From cb7253f5eb32d78bb62b5334cbf3b9a5e4b2a057 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Fri, 3 Sep 2021 19:09:26 +0300 Subject: [PATCH] [Build] --- .patch-version | 2 +- dist/347.e76314e5520fe6e65783.js | 2 -- dist/347.e76314e5520fe6e65783.js.map | 1 - ...29fbd6ca7.js => 354.701ac7c1e3f066f82e25.js} | 2 +- ...7.js.map => 354.701ac7c1e3f066f82e25.js.map} | 2 +- dist/433.29f542772c88e944d938.css.map | 1 - dist/433.29f542772c88e944d938.js | 2 -- dist/433.29f542772c88e944d938.js.map | 1 - ...944d938.css => 433.c66cb5158ff9fdb2297f.css} | 8 ++++---- dist/433.c66cb5158ff9fdb2297f.css.map | 1 + dist/433.c66cb5158ff9fdb2297f.js | 2 ++ dist/433.c66cb5158ff9fdb2297f.js.map | 1 + dist/484.40f6759b976ebb12ec3f.js | 2 -- dist/484.40f6759b976ebb12ec3f.js.map | 1 - ...b12ec3f.css => 484.87953bd73fba4543a4f6.css} | 2 +- ...css.map => 484.87953bd73fba4543a4f6.css.map} | 2 +- dist/484.87953bd73fba4543a4f6.js | 2 ++ dist/484.87953bd73fba4543a4f6.js.map | 1 + dist/514.c2aea8c517396debc7b4.js | 2 -- dist/514.c2aea8c517396debc7b4.js.map | 1 - dist/514.e85ae04366b5ac2cfcb1.js | 2 ++ dist/514.e85ae04366b5ac2cfcb1.js.map | 1 + ...ef80e2cdd.js => 524.c17eab1f1ac04dc51e06.js} | 2 +- ...d.js.map => 524.c17eab1f1ac04dc51e06.js.map} | 2 +- ...6e65783.css => 860.71a26210d53a0e37c47e.css} | 2 +- ...css.map => 860.71a26210d53a0e37c47e.css.map} | 2 +- dist/860.71a26210d53a0e37c47e.js | 2 ++ dist/860.71a26210d53a0e37c47e.js.map | 1 + ...Vazir-Medium-WOL.107ead8042d2d2a10827..woff2 | Bin 26248 -> 0 bytes .../Vazir-Medium-WOL.25ba8d95080e1e2952f4..woff | Bin 32272 -> 0 bytes ...Vazir-Medium-WOL.2f98e6f8ba81b54a0f96..woff2 | Bin 0 -> 26192 bytes .../Vazir-Medium-WOL.f4d87915577d64b321c6..woff | Bin 0 -> 32300 bytes ...azir-Regular-WOL.4a4990b236f65249e659..woff2 | Bin 25756 -> 0 bytes ...Vazir-Regular-WOL.a6f663c7a4c514c9de99..woff | Bin 31992 -> 0 bytes ...azir-Regular-WOL.c7b24ace258717d9a320..woff2 | Bin 0 -> 25744 bytes ...Vazir-Regular-WOL.ed6379fdf8108ff3bc5b..woff | Bin 0 -> 31948 bytes dist/index.html | 2 +- ...d957f8.css => main.1caddd72e47829af6ab5.css} | 14 +++++++------- ...ss.map => main.1caddd72e47829af6ab5.css.map} | 2 +- dist/main.482b1a48855e4e7aae9a.js | 2 -- dist/main.482b1a48855e4e7aae9a.js.map | 1 - dist/main.d9882afcc7d8fd6c3156.js | 2 ++ dist/main.d9882afcc7d8fd6c3156.js.map | 1 + dist/report.html | 4 ++-- 44 files changed, 40 insertions(+), 40 deletions(-) delete mode 100644 dist/347.e76314e5520fe6e65783.js delete mode 100644 dist/347.e76314e5520fe6e65783.js.map rename dist/{354.66350c1e61029fbd6ca7.js => 354.701ac7c1e3f066f82e25.js} (97%) rename dist/{354.66350c1e61029fbd6ca7.js.map => 354.701ac7c1e3f066f82e25.js.map} (99%) delete mode 100644 dist/433.29f542772c88e944d938.css.map delete mode 100644 dist/433.29f542772c88e944d938.js delete mode 100644 dist/433.29f542772c88e944d938.js.map rename dist/{433.29f542772c88e944d938.css => 433.c66cb5158ff9fdb2297f.css} (94%) create mode 100644 dist/433.c66cb5158ff9fdb2297f.css.map create mode 100644 dist/433.c66cb5158ff9fdb2297f.js create mode 100644 dist/433.c66cb5158ff9fdb2297f.js.map delete mode 100644 dist/484.40f6759b976ebb12ec3f.js delete mode 100644 dist/484.40f6759b976ebb12ec3f.js.map rename dist/{484.40f6759b976ebb12ec3f.css => 484.87953bd73fba4543a4f6.css} (99%) rename dist/{484.40f6759b976ebb12ec3f.css.map => 484.87953bd73fba4543a4f6.css.map} (99%) create mode 100644 dist/484.87953bd73fba4543a4f6.js create mode 100644 dist/484.87953bd73fba4543a4f6.js.map delete mode 100644 dist/514.c2aea8c517396debc7b4.js delete mode 100644 dist/514.c2aea8c517396debc7b4.js.map create mode 100644 dist/514.e85ae04366b5ac2cfcb1.js create mode 100644 dist/514.e85ae04366b5ac2cfcb1.js.map rename dist/{524.157e5943ba0ef80e2cdd.js => 524.c17eab1f1ac04dc51e06.js} (99%) rename dist/{524.157e5943ba0ef80e2cdd.js.map => 524.c17eab1f1ac04dc51e06.js.map} (99%) rename dist/{347.e76314e5520fe6e65783.css => 860.71a26210d53a0e37c47e.css} (99%) rename dist/{347.e76314e5520fe6e65783.css.map => 860.71a26210d53a0e37c47e.css.map} (99%) create mode 100644 dist/860.71a26210d53a0e37c47e.js create mode 100644 dist/860.71a26210d53a0e37c47e.js.map delete mode 100644 dist/Vazir-Medium-WOL.107ead8042d2d2a10827..woff2 delete mode 100644 dist/Vazir-Medium-WOL.25ba8d95080e1e2952f4..woff create mode 100644 dist/Vazir-Medium-WOL.2f98e6f8ba81b54a0f96..woff2 create mode 100644 dist/Vazir-Medium-WOL.f4d87915577d64b321c6..woff delete mode 100644 dist/Vazir-Regular-WOL.4a4990b236f65249e659..woff2 delete mode 100644 dist/Vazir-Regular-WOL.a6f663c7a4c514c9de99..woff create mode 100644 dist/Vazir-Regular-WOL.c7b24ace258717d9a320..woff2 create mode 100644 dist/Vazir-Regular-WOL.ed6379fdf8108ff3bc5b..woff rename dist/{main.ae6f9de5758018d957f8.css => main.1caddd72e47829af6ab5.css} (99%) rename dist/{main.ae6f9de5758018d957f8.css.map => main.1caddd72e47829af6ab5.css.map} (99%) delete mode 100644 dist/main.482b1a48855e4e7aae9a.js delete mode 100644 dist/main.482b1a48855e4e7aae9a.js.map create mode 100644 dist/main.d9882afcc7d8fd6c3156.js create mode 100644 dist/main.d9882afcc7d8fd6c3156.js.map diff --git a/.patch-version b/.patch-version index b1bd38b6..d00491fd 100644 --- a/.patch-version +++ b/.patch-version @@ -1 +1 @@ -13 +1 diff --git a/dist/347.e76314e5520fe6e65783.js b/dist/347.e76314e5520fe6e65783.js deleted file mode 100644 index 99cade7d..00000000 --- a/dist/347.e76314e5520fe6e65783.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[347],{6347:(e,t,n)=>{n.r(t),n.d(t,{ArchivedChats:()=>Ma,AttachMenu:()=>$s,AttachmentModal:()=>ls,BotCommandMenu:()=>Us,BotCommandTooltip:()=>Ds,CalendarModal:()=>$e,ContactList:()=>ba,ContextMenuContainer:()=>Ga,CustomSendMenu:()=>Os,DeleteMessageModal:()=>De,Dialogs:()=>we,DropArea:()=>Gs.Z,EmojiTooltip:()=>zs,ForwardPicker:()=>be,GifSearch:()=>sr,HeaderMenuContainer:()=>za,HistoryCalendar:()=>Be,InlineBotTooltip:()=>Ks,LeftSearch:()=>Ft,Management:()=>Ir,MediaViewer:()=>me,MentionTooltip:()=>rs,MessageSelectToolbar:()=>ze,MobileSearch:()=>ja,NewChat:()=>ka,NewChatStep1:()=>Ia,NewChatStep2:()=>wa,Notifications:()=>ke,PaymentModal:()=>jr,PinMessageModal:()=>Ue,PollModal:()=>cs,PollResults:()=>or,ReceiptModal:()=>qr,RightSearch:()=>Qs,SafeLinkModal:()=>Te,Settings:()=>Ca,StickerSearch:()=>ar,StickerSetModal:()=>Ja,StickerTooltip:()=>xs,SymbolMenu:()=>Rs,TextFormatter:()=>Js.Z,UnpinAllMessagesModal:()=>xe});var a=n(4050),s=n(5116),r=n(6137),o=n(1713),l=n(3716),i=n(7361),c=n(3858),d=n(4399),m=n(8085),u=n(2858),h=n(782),Z=n(1174),P=n(3989),g=n(396),v=n(5326),p=n(6202),E=n(2761),C=n(2937),f=n(7204),b=n(8674),y=n(935);function I(e,t){const n=document.createElement("div");n.classList.add("ghost");const a=new Image;if("string"==typeof e?a.src=e:e instanceof HTMLVideoElement?a.src=e.poster:a.src=e.src,n.appendChild(a),t===o.bZ.ProfileAvatar||t===o.bZ.SettingsAvatar){n.classList.add("ProfileInfo"),t===o.bZ.SettingsAvatar&&n.classList.add("self");const e=document.querySelector(t===o.bZ.ProfileAvatar?"#RightColumn .ProfileInfo .info":"#Settings .ProfileInfo .info");e&&n.appendChild(e.cloneNode(!0))}return n}function w(e,t){const n=document.querySelector(".active > .MessageList");let a=e.offsetTop+t.closest(".content-inner, .WebPage").offsetTop;return e.id.includes("album-media-")&&(a+=e.parentElement.offsetTop+e.closest(".Message").offsetTop),a>n.scrollTop&&a+t.offsetHeight .MessageList #album-media-${t.id}`,a=".full-media";break;case o.bZ.SharedMedia:n=`#shared-media${t.id}`,a="img";break;case o.bZ.SearchResult:n=`#search-media${t.id}`,a="img";break;case o.bZ.MiddleHeaderAvatar:n=".MiddleHeader .ChatInfo .Avatar",a="img.avatar-media";break;case o.bZ.SettingsAvatar:n="#Settings .ProfileInfo .active .ProfilePhoto",a="img.avatar-media";break;case o.bZ.ProfileAvatar:n="#RightColumn .ProfileInfo .active .ProfilePhoto",a="img.avatar-media";break;case o.bZ.ScheduledInline:case o.bZ.Inline:default:n=`.active > .MessageList #message${t.id}`,a=".message-content .full-media, .message-content .thumbnail"}const s=document.querySelector(n),r=s&&s.querySelectorAll(a);return{container:s,mediaEl:null==r?void 0:r[r.length-1]}}function S(e,t){switch(t){case o.bZ.Album:case o.bZ.ScheduledAlbum:case o.bZ.Inline:case o.bZ.ScheduledInline:e.classList.add("rounded-corners");break;case o.bZ.SharedMedia:case o.bZ.SettingsAvatar:case o.bZ.ProfileAvatar:case o.bZ.SearchResult:e.firstChild.style.objectFit="cover";break;case o.bZ.MiddleHeaderAvatar:e.classList.add("circle")}}var M=n(9107),T=n(6590),F=n(9204),A=n(126),L=n(2255),R=n(231),$=n(790),B=n(2340),D=n(172);const U=(0,s.c$)(((e,{chatId:t,messageId:n,isAvatar:a})=>{if(a&&t)return{sender:(0,u.YA)(t)?(0,m.dy)(e,t):(0,m.Z1)(e,t)};if(!n||!t)return{};const s=(0,m.hj)(e,t,n);return{message:s,sender:s&&(0,m.Ur)(e,s)}}),((e,t)=>(0,h.ei)(t,["closeMediaViewer","focusMessage"])))((({chatId:e,messageId:t,sender:n,isAvatar:s,message:r,closeMediaViewer:o,focusMessage:l})=>{const i=(0,a.I4)((()=>{o(),l({chatId:e,messageId:t})}),[e,l,t,o]),c=(0,M.Z)();if(!n||!r&&!s)return;const d=n.id<0,m=(0,u.OU)(c,n);return a.ZP.createElement("div",{className:"SenderInfo",onClick:i},d?a.ZP.createElement(D.Z,{key:n.id,size:"medium",chat:n}):a.ZP.createElement(D.Z,{key:n.id,size:"medium",user:n}),a.ZP.createElement("div",{className:"meta"},a.ZP.createElement("div",{className:"title",dir:"auto"},m&&(0,B.Z)(m)),a.ZP.createElement("div",{className:"date",dir:"auto"},s?c("lng_mediaview_profile_photo"):(0,$.ZK)(c,1e3*r.date))))}));var x=n(2619),O=n(3106),G=n(8964),J=n(9196);const X=({mediaData:e,isVideo:t,isZoomed:n,message:s,fileName:r,isAvatar:o,onCloseMediaViewer:l,onForward:c,onZoomToggle:d})=>{const{isDownloadStarted:m,downloadProgress:h,handleDownloadClick:Z}=(0,x.Z)(s&&t?(0,u.Ti)(s,"download"):void 0,r),P=(0,M.Z)(),g=(0,a.Ye)((()=>({onTrigger:e,isOpen:t})=>a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",className:t?"active":void 0,onClick:e,ariaLabel:"More actions"},a.ZP.createElement("i",{className:"icon-more"}))),[]);return i.wB?a.ZP.createElement("div",{className:"MediaViewerActions-mobile"},a.ZP.createElement(O.Z,{trigger:g,positionX:"right"},!o&&a.ZP.createElement(G.Z,{icon:"forward",onClick:c},P("Forward")),t?a.ZP.createElement(G.Z,{icon:m?"close":"download",onClick:Z},m?`${Math.round(100*h)}% Downloading...`:"Download"):a.ZP.createElement(G.Z,{icon:"download",href:e,download:r},P("AccActionDownload"))),m&&a.ZP.createElement(J.Z,{progress:h,size:"s",noCross:!0})):a.ZP.createElement("div",{className:"MediaViewerActions"},!o&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:P("Forward"),onClick:c},a.ZP.createElement("i",{className:"icon-forward"}))),t?a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:P("AccActionDownload"),onClick:Z},m?a.ZP.createElement(J.Z,{progress:h,size:"s",onClick:Z}):a.ZP.createElement("i",{className:"icon-download"})):a.ZP.createElement(R.Z,{href:e,download:r,round:!0,size:"smaller",color:"translucent-white",ariaLabel:P("AccActionDownload")},a.ZP.createElement("i",{className:"icon-download"})),a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:n?"Zoom Out":"Zoom In",onClick:d},a.ZP.createElement("i",{className:n?"icon-zoom-out":"icon-zoom-in"})),a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:P("Close"),onClick:l},a.ZP.createElement("i",{className:"icon-close"})))};var z=n(9118),_=n(6752);const Y=({text:e="",isHidden:t,isForVideo:n,onClick:s})=>{const[r,o]=(0,a.eJ)(!1);(0,a.d4)((()=>{const e=document.querySelector(".MediaViewerFooter .media-text"),t=()=>{const t=e?e.clientHeight:0;o(t>2*d.Gw)};t();const n=(0,z.P2)(t,500,!0);return window.addEventListener("resize",n,!1),()=>{window.removeEventListener("resize",n,!1)}}),[]);const l=(0,_.Z)("MediaViewerFooter",n&&"is-for-video",t&&"is-hidden");return a.ZP.createElement("div",{className:l,onClick:function(t){e&&t.stopPropagation()}},e&&a.ZP.createElement("div",{className:"media-viewer-footer-content",onClick:i.wB?void 0:s},a.ZP.createElement("p",{className:"media-text custom-scroll "+(r?"multiline":""),dir:"auto"},e)))};var j=n(1212),H=n(2019);const V=void 0!==document.fullscreenElement?"fullscreenElement":void 0!==document.mozFullScreenElement?"mozFullScreenElement":void 0!==document.webkitFullscreenElement?"webkitFullscreenElement":"";var q=n(6898),K=n(4753);const W=["bytes","kB","MB","GB","TB","PB"],Q=e=>{const t=0===e?0:Math.floor(Math.log(e)/Math.log(1024));return`${(e/1024**Math.floor(t)).toFixed(1)} ${W[t]}`},ee=e=>{e.stopPropagation()},te=({bufferedProgress:e,currentTime:t,duration:n,fileSize:s,isForceVisible:r,isForceMobileVersion:o,isPlayed:l,isFullscreenSupported:c,isFullscreen:d,onChangeFullscreen:m,onPlayPause:u,onSeek:h})=>{const[Z,P]=(0,a.eJ)(!0);(0,a.d4)((()=>{r&&P(r)}),[r]),(0,a.d4)((()=>{let e;return r||(i.wB?P(!1):e=window.setTimeout((()=>{P(!1)}),800)),()=>{e&&window.clearTimeout(e)}}),[r]),(0,a.d4)((()=>((Z||r)&&document.body.classList.add("video-controls-visible"),()=>{document.body.classList.remove("video-controls-visible")})),[r,Z]);const g=(0,M.Z)();var v,p;if(Z||r)return a.ZP.createElement("div",{className:"VideoPlayerControls "+(o?"mobile":""),onClick:ee},function(e,t,n,s){const r=e/t*100,o=100*n;return a.ZP.createElement("div",{className:"player-seekline"},a.ZP.createElement("div",{className:"player-seekline-track"},a.ZP.createElement("div",{className:"player-seekline-buffered",style:`width: ${o||0}%`}),a.ZP.createElement("div",{className:"player-seekline-played",style:`width: ${r||0}%`}),a.ZP.createElement("input",{min:"0",max:"100",step:.01,type:"range",onInput:s,className:"player-seekline-input",value:r||0})))}(t,n,e,h),a.ZP.createElement(R.Z,{ariaLabel:g("AccActionPlay"),size:"tiny",ripple:!i.wB,color:"translucent-white",className:"play",onClick:u},a.ZP.createElement("i",{className:l?"icon-pause":"icon-play"})),function(e,t){return a.ZP.createElement("div",{className:"player-time"},`${(0,$.k9)(e)} / ${(0,$.k9)(t)}`)}(t,n),e<1&&(v=e,p=s,a.ZP.createElement("div",{className:"player-file-size"},`${Q(p*v)} / ${Q(p)}`)),c&&a.ZP.createElement(R.Z,{ariaLabel:"Fullscreen",size:"tiny",color:"translucent-white",className:"fullscreen",onClick:m},a.ZP.createElement("i",{className:d?"icon-smallscreen":"icon-fullscreen"})))};function ne(){return(ne=Object.assign||function(e){for(var t=1;t{const m=(0,a.sO)(null),[u,h]=(0,a.eJ)(!i.$b||!i.cj),[Z,P]=(0,a.eJ)(0),[g,v]=(0,a.eJ)(!0),[p,E,C]=function(e,t){const[n,s]=(0,a.eJ)(Boolean(V&&document[V]));return(0,a.bt)((()=>{const n=()=>{s(Boolean(V&&document[V]))},a=()=>{s(!0)},r=()=>{s(!1),t(!1)},o=e.current;return document.addEventListener("fullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),o&&(o.addEventListener("webkitbeginfullscreen",a,!1),o.addEventListener("webkitendfullscreen",r,!1)),()=>{document.removeEventListener("fullscreenchange",n,!1),document.removeEventListener("webkitfullscreenchange",n,!1),document.removeEventListener("mozfullscreenchange",n,!1),o&&(o.removeEventListener("webkitbeginfullscreen",a,!1),o.removeEventListener("webkitendfullscreen",r,!1))}}),[]),V||"iOS"===i.Lt?[n,()=>{e.current&&(V||"iOS"===i.Lt)&&(e.current.requestFullscreen?e.current.requestFullscreen():e.current.webkitRequestFullscreen?e.current.webkitRequestFullscreen():e.current.webkitEnterFullscreen?e.current.webkitEnterFullscreen():e.current.mozRequestFullScreen&&e.current.mozRequestFullScreen(),s(!0))},()=>{e.current&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen(),s(!1))}]:[!1]}(m,h),{isBuffered:f,bufferedProgress:b,bufferingHandlers:y}=(0,H.Z)(),{shouldRender:I,transitionClassNames:w}=(0,j.Z)(!f,void 0,void 0,"slow"),{shouldRender:N,transitionClassNames:k}=(0,j.Z)(i.cj&&!u&&!I,void 0,void 0,"slow");(0,a.d4)((()=>{c||!l?m.current.pause():e&&!i.$b&&(0,K.Z)(m.current)}),[c,l,e]),(0,a.d4)((()=>{m.current.currentTime===m.current.duration?(P(0),h(!1)):P(m.current.currentTime)}),[Z]);const S=(0,a.I4)((e=>{e.stopPropagation(),u?(m.current.pause(),h(!1)):(m.current.play(),h(!0))}),[u]);(0,q.Z)(m,[]);const M=(0,a.I4)((()=>{v(!0)}),[]),T=(0,a.I4)((()=>{v(!1)}),[]),F=(0,a.I4)((e=>{P(e.currentTarget.currentTime)}),[]),A=(0,a.I4)((()=>{P(0),h(!1)}),[]),L=(0,a.I4)((()=>{p&&C?C():!p&&E&&E()}),[C,p,E]),$=(0,a.I4)((e=>{e.stopPropagation(),m.current.currentTime=Number(e.target.value)*m.current.duration/100}),[]),B=(0,a.I4)((e=>{e.stopPropagation(),v(!g)}),[g]);(0,a.d4)((()=>{const e=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),S(e))};return document.addEventListener("keydown",e,!1),()=>{document.removeEventListener("keydown",e,!1)}}),[S]);const D=s&&`width: ${s.width}px; height: ${s.height}px`,U=`background-image: url(${n})`;return a.ZP.createElement("div",{className:"VideoPlayer",onClick:!t&&i.wB?B:void 0,onMouseOver:t?void 0:M,onMouseOut:t?void 0:T},a.ZP.createElement("div",{style:D},a.ZP.createElement("video",ne({ref:m,autoPlay:i.$b,playsInline:!0,loop:t,muted:t,id:"media-viewer-video",style:U,onEnded:A,onClick:i.wB?void 0:S,onDoubleClick:L},y,{onTimeUpdate:F}),e&&a.ZP.createElement("source",{src:e}))),N&&a.ZP.createElement(R.Z,{round:!0,className:`play-button ${k}`,onClick:S},a.ZP.createElement("i",{className:"icon-play"})),I&&a.ZP.createElement("div",{className:["spinner-container",w].join(" ")},!f&&a.ZP.createElement("div",{className:"buffering"},"Buffering..."),a.ZP.createElement(J.Z,{size:"xl",progress:f?1:r,square:!0,onClick:d})),!t&&!I&&a.ZP.createElement(te,{isPlayed:u,bufferedProgress:b,currentTime:Z,isFullscreenSupported:Boolean(E),isFullscreen:p,fileSize:o,duration:m.current?m.current.duration:0,isForceVisible:!u||g,isForceMobileVersion:s&&s.width<400,onSeek:$,onChangeFullscreen:L,onPlayPause:S}))})),se=(0,a.X$)((({isShown:e,onChangeZoom:t})=>{const{transitionClassNames:n}=(0,j.Z)(e),s=(0,f.Z)(e),r=(0,a.sO)(null),[o,l]=(0,a.eJ)(1),c=(0,a.sO)(!1);(0,a.d4)((()=>{e&&!s&&l(1.5)}),[e,s]);const d=(0,a.I4)((()=>{c.current=!0}),[]),m=(0,a.I4)((()=>{c.current=!1,1===o&&t(o,!c.current)}),[t,o]);(0,a.d4)((()=>{t(o,!c.current)}),[o,t]);const u=(0,M.Z)(),h=(0,_.Z)("ZoomControls",n);return a.ZP.createElement("div",{className:h},a.ZP.createElement(R.Z,{disabled:1===o,size:"tiny",color:"translucent-white",ariaLabel:u("ZoomOut"),className:"zoom-out",ripple:!i.wB,onClick:()=>{r.current&&l(Math.max(1,o-.5))}},a.ZP.createElement("i",{className:"icon-zoom-out"})),a.ZP.createElement(R.Z,{disabled:3===o,size:"tiny",color:"translucent-white",ariaLabel:"Zoom In",className:"zoom-in",ripple:!i.wB,onClick:()=>{r.current&&l(Math.min(3,o+.5))}},a.ZP.createElement("i",{className:"icon-zoom-in"})),a.ZP.createElement("div",{className:"seekline"},a.ZP.createElement("div",{className:"seekline-track"},a.ZP.createElement("div",{className:"seekline-played",style:`width: ${50*(o-1)}%`}),a.ZP.createElement("input",{ref:r,min:1,max:3,step:"0.5",value:o,type:"range",className:"seekline-input",onChange:e=>{l(Math.min(3,Math.max(Number(e.target.value),1)))},onMouseDown:d,onMouseUp:m}))))})),re=[1,0,0,1,0,0],oe={1:1,1.5:1.5,2:2.2,2.5:3.3,3:5.5},le=150,ie=(0,a.X$)((({children:e,className:t,noWrap:n,canPan:s,zoomLevel:r,panDeltaX:o,panDeltaY:l,onPan:i})=>{const c=oe[r]||r,[d,m]=(0,a.eJ)(!1),[u,Z]=(0,a.eJ)({dx:o,dy:l,x:0,y:0}),[P,g]=(0,a.eJ)(re),v=(0,a.sO)(null),p=(0,a.sO)(null);return(0,a.d4)((()=>{const e=c||P[0],t=o||P[4],n=l||P[5],a=[...P];P[0]!==e&&(a[0]=e||a[0],a[3]=e||a[3]),P[4]!==t&&(a[4]=t),P[5]!==n&&(a[5]=n),(0,h.et)(P,a)||g(function(e,t,n){const a=n&&n.querySelector(".active img");if(!n||!a)return t;const s=n.getBoundingClientRect(),r=a.getBoundingClientRect(),o=r.width/e*t[0],l=r.height/e*t[3],i=(s.width-o)/2+t[4],c=(s.height-l)/2+t[5];return s.width&&s.width-le{s||g(re)}),[s]),(0,a.d4)((()=>{p.current&&(p.current.style.transform=`matrix(${P.toString()})`)}),[n,P]),n?e:a.ZP.createElement("div",{ref:v,className:`pan-wrapper ${t||""}`,onMouseDown:e=>{if(!s)return;e.stopPropagation(),e.preventDefault();const t={dx:P[4],dy:P[5],x:e.pageX,y:e.pageY};Z(t),m(!0),v.current&&v.current.classList.add("move")},onMouseUp:()=>{m(!1),v.current&&v.current.classList.remove("move"),i&&i(P[4],P[5])},onMouseMove:e=>{if(d){const t=function(e,t){const n=[...P],a=u.x-e,s=u.y-t;return n[4]=u.dx-a,n[5]=u.dy-s,n}(e.pageX,e.pageY);g(t),p.current&&(p.current.style.transform=`matrix(${P.toString()})`)}}},a.ZP.createElement("div",{ref:p,className:"pan-container"},e))})),ce=350;function de(e,t,n){return e?a.ZP.createElement("img",{src:e,alt:"",style:t?`width: ${t.width}px`:"",draggable:Boolean(n)}):a.ZP.createElement("div",{className:"spinner-wrapper",style:t?`width: ${t.width}px`:""},a.ZP.createElement(F.Z,{color:"white"}))}const me=(0,a.X$)((0,s.c$)((e=>{const{chatId:t,threadId:n,messageId:a,avatarOwnerId:s,profilePhotoIndex:r,origin:l}=e.mediaViewer,{animationLevel:i}=e.settings.byKey;if(l===o.bZ.SearchResult){if(!t||!a)return{animationLevel:i};const n=(0,m.hj)(e,t,a);return n?{chatId:t,messageId:a,senderId:n.senderId,origin:l,message:n,animationLevel:i}:{animationLevel:i}}if(s)return{messageId:-1,senderId:s,avatarOwner:(0,m.dy)(e,s)||(0,m.Z1)(e,s),profilePhotoIndex:r||0,animationLevel:i,origin:l};if(!(t&&n&&a))return{animationLevel:i};let c,d,u;if(c=l&&[o.bZ.ScheduledAlbum,o.bZ.ScheduledInline].includes(l)?(0,m.Tm)(e,t,a):(0,m.hj)(e,t,a),!c)return{animationLevel:i};if(d=l&&[o.bZ.ScheduledAlbum,o.bZ.ScheduledInline].includes(l)?(0,m.Fn)(e,t):(0,m.Zw)(e,t),l===o.bZ.Inline||l===o.bZ.Album)u=(0,m.qC)(e,t,n)||(0,m.gb)(e,t,n);else if(l===o.bZ.SharedMedia){const t=(0,m.we)(e),{foundIds:n}=t&&t.resultsByType&&t.resultsByType.media||{};u=n}return{chatId:t,threadId:n,messageId:a,senderId:c.senderId,origin:l,message:c,chatMessages:d,collectionIds:u,animationLevel:i}}),((e,t)=>(0,h.ei)(t,["openMediaViewer","closeMediaViewer","openForwardMenu","focusMessage"])))((({chatId:e,threadId:t,messageId:n,senderId:s,origin:m,avatarOwner:h,profilePhotoIndex:F,message:$,chatMessages:B,collectionIds:D,openMediaViewer:x,closeMediaViewer:O,openForwardMenu:G,focusMessage:J,animationLevel:z})=>{const _=Boolean(h||n),j=m===o.bZ.SharedMedia,H=m===o.bZ.SearchResult,V=$?(0,u.O$)($):void 0,q=$?(0,u.b7)($):void 0,K=$?(0,u.F$)($):void 0,W=$?(0,u.Cg)($):void 0,Q=!!$&&(0,u.rl)($),ee=!!$&&(0,u.hC)($),te=Boolean(q||W||ee),ne=Boolean(!te&&(V||K||Q)),{isGif:re}=q||W||{},oe=Boolean(h),le=Boolean(K||W),me=(0,a.Ye)((()=>le&&n?[n]:(0,u.N0)(B||{},D||[],j)),[le,n,B,D,j]),ue=n?me.indexOf(n):-1,he=0===ue||-1===ue,Ze=ue===me.length-1||-1===ue,Pe=(0,a.sO)(),ge=(0,f.Z)(s);!_||ge&&ge===s&&Pe.current||(Pe.current=ue);const ve=z>=1?"mv-slide":"none",pe=2===z?"slide-fade":"none",Ee=2===z,[Ce,fe]=(0,a.eJ)(!1),[be,ye]=(0,a.eJ)(!1),[Ie,we]=(0,a.eJ)(!1),[Ne,ke]=(0,a.eJ)(1),[Se,Me]=(0,a.eJ)({x:0,y:0});function Te(e){if(oe&&void 0!==F){const{photos:t}=h;return t&&t[F]?`photo${t[F].id}?size=c`:(0,u.RT)(h,e?"big":"normal")}return $&&(0,u.Ti)($,e?"viewerFull":"viewerPreview")}const Fe=(0,p.Z)($&&(j||H)&&(0,u.Ti)($,"pictogram"),void 0,r.IU.BlobUrl,void 0,Ee&&ce),Ae=Te(),Le=(0,p.Z)(Ae,void 0,oe&&Ae&&Ae.startsWith("profilePhoto")?r.IU.DataUri:r.IU.BlobUrl,void 0,Ee&&ce),{mediaData:Re,downloadProgress:$e}=(0,E.Z)(Te(!0),void 0,$&&(0,u.kG)($,"viewerFull"),void 0,Ee&&ce),Be=V||q?(V||q).blobUrl:void 0;let De=!te&&(Be||Re)||Le||Fe;const Ue=(0,C.Z)(!De&&$&&(0,u.DH)($));De||m===o.bZ.SearchResult||(De=Ue);const xe=$?(0,u.c0)($):void 0,Oe=$?(0,u.ep)($):oe?`avatar${h.id}-${F}.jpg`:void 0;let Ge;$?Q||ee?Ge=(0,u.aE)($).mediaSize:V||K?Ge=(0,u.bV)(V||K):(q||W)&&(Ge=(0,u.jC)(q||W)):Ge=d.vY,(0,a.d4)((()=>{i.wB&&document.body.classList.toggle("is-media-viewer-open",_)}),[_]);const Je=(0,v.Z)();(0,a.d4)((()=>{const e=window.matchMedia(d.L6);return"function"==typeof e.addEventListener?e.addEventListener("change",Je):"function"==typeof e.addListener&&e.addListener(Je),()=>{"function"==typeof e.removeEventListener?e.removeEventListener("change",Je):"function"==typeof e.removeListener&&e.removeListener(Je)}}),[Je]);const Xe=(0,f.Z)($),ze=(0,f.Z)(m),_e=(0,f.Z)(h),Ye=(0,f.Z)(De);(0,a.d4)((()=>{if(Ee&&_&&!Xe&&!_e){(0,b.YW)(ce+l.fK);const e=$?(0,y.X)($):void 0;!function(e,t,n,a,s,r){const{mediaEl:i}=k(t,r);if(!i)return;const{width:m}=c.Z.get(),{width:u,height:h}=(0,d.fM)(e,s),{width:Z,height:P}=(0,d.jg)(u,h,a.width,a.height),g=(m-Z)/2,v=function(e){const t=window.matchMedia(d.L6);let n=4.125;return e&&(n+=t.matches?.875:3.375),n*d.Gw}(e)+(h-P)/2;let{top:p,left:E,width:C,height:f}=i.getBoundingClientRect();if([o.bZ.SharedMedia,o.bZ.Album,o.bZ.ScheduledAlbum,o.bZ.SearchResult].includes(t)){const e=function(e,t,n,a,s,r){if(e===t){const o=Math.max(s,r)*(e/t);a-=(o-s)/2,n-=(o-r)/2,s=o,r=o}else if(e>t){const n=s;a-=((s=r*(e/t))-n)/2}else if(t>e){const a=r;n-=((r=s*(t/e))-a)/2}return{top:n,left:a,width:s,height:r}}(Z,P,p,E,C,f);p=e.top,E=e.left,C=e.width,f=e.height}const b=E+C/2-(g+Z/2),y=p+f/2-(v+P/2),w=C/Z,M=f/P,T=I(n||i);N(T,{top:`${v}px`,left:`${g}px`,width:`${Z}px`,height:`${P}px`,transform:`translate3d(${b}px, ${y}px, 0) scale(${w}, ${M})`}),S(T,t),document.body.classList.add("ghost-animating"),requestAnimationFrame((()=>{document.body.appendChild(T),requestAnimationFrame((()=>{T.style.transform="",function(e){e.firstChild.style.objectFit="default",e.classList.remove("rounded-corners","circle")}(T),setTimeout((()=>{requestAnimationFrame((()=>{document.body.contains(T)&&document.body.removeChild(T),document.body.classList.remove("ghost-animating")}))}),200+l.fK)}))}))}(Boolean(e),m,De,Ge,te,$)}Ee&&!_&&(Xe||_e)&&((0,b.YW)(ce+l.fK),function(e,t,n){const{container:a,mediaEl:s}=k(e,n);if(!s)return;const r=document.getElementById("MediaViewer").querySelector(".active .media-viewer-content img, .active .media-viewer-content video");if(!r||!s)return;const{top:i,left:d,width:m,height:u}=r.getBoundingClientRect(),{top:h,left:Z,width:P,height:g}=s.getBoundingClientRect();let v=h;if(!function(e){if("none"===e.style.display)return!1;const t=e.getBoundingClientRect(),{height:n}=c.Z.get();return t.top<=n&&t.top+t.height>=0}(a)){const{height:e}=c.Z.get();v=hf?C=f:f>C&&(f=C));const y=document.getElementsByClassName("ghost")[0],M=y||I(t||s,e);y||N(M,{top:`${v}px`,left:`${Z}px`,width:`${P}px`,height:`${g}px`,transform:`translate3d(${p}px, ${E}px, 0) scale(${C}, ${f})`}),requestAnimationFrame((()=>{if(y){const{top:e,left:t,width:n,height:a}=y.getBoundingClientRect();N(M,{transition:"none",top:`${v}px`,left:`${Z}px`,transformOrigin:"top left",transform:`translate3d(${t-Z}px, ${e-v}px, 0) scale(${n/P}, ${a/g})`,width:`${P}px`,height:`${g}px`})}document.body.classList.add("ghost-animating"),y||document.body.appendChild(M),requestAnimationFrame((()=>{y&&(y.style.transition=""),M.style.transform="",b&&(M.style.opacity="0"),S(M,e),setTimeout((()=>{requestAnimationFrame((()=>{document.body.contains(M)&&document.body.removeChild(M),document.body.classList.remove("ghost-animating")}))}),200+l.fK)}))}))}(ze,Ye,Xe||void 0))}),[Ee,_,m,ze,$,Xe,_e,De,Ye,Ge,te]),(0,a.d4)((()=>{let e;return Ie?ye(!0):e=window.setTimeout((()=>{ye(!1)}),ce),()=>{e&&window.clearTimeout(e)}}),[Ie]);const je=()=>{we(!1),ke(1),Me({x:0,y:0})},He=(0,a.I4)((()=>{we(!Ie),ke(Ie?1:1.5),Ie&&Me({x:0,y:0})}),[Ie]),Ve=(0,a.I4)(((e,t=!1)=>{ke(e),1===e&&t&&je()}),[]),qe=(0,a.I4)((()=>{O(),je()}),[O]),Ke=(0,a.I4)((()=>{qe(),J({chatId:e,threadId:t,messageId:n})}),[qe,e,t,J,n]),We=(0,a.I4)((()=>{G({fromChatId:e,messageIds:[n]}),je()}),[G,e,n]);(0,a.d4)((()=>_?(0,P.Z)((()=>{Ie?je():qe()})):void 0),[qe,_,Ie]),(0,a.d4)((()=>{te&&!re&&(0,g.E)()}),[re,te]),(0,a.d4)((()=>{if(_)return c.Z.disableRefresh(),()=>{c.Z.enableRefresh()}}),[_]);const Qe=(0,a.I4)(((e,t)=>{let n=me.indexOf(e);return(-1===t&&n>0||1===t&&n{he||x({chatId:e,threadId:t,messageId:n?Qe(n,-1):void 0,origin:m})}),[e,t,Qe,he,n,x,m]),tt=(0,a.I4)((()=>{Ze||x({chatId:e,threadId:t,messageId:n?Qe(n,1):void 0,origin:m})}),[e,t,Qe,Ze,n,x,m]);(0,a.d4)((()=>{const e=e=>{switch(e.key){case"Left":case"ArrowLeft":et();break;case"Right":case"ArrowRight":tt()}};return document.addEventListener("keydown",e,!1),()=>{document.removeEventListener("keydown",e,!1)}})),(0,a.d4)((()=>{const e=document.querySelector(".slide-container > .active, .slide-container > .to");if(!e)return;const t=re&&!i.cj;return(0,Z.s)(e,{excludedClosestSelector:".backdrop, .navigation, .media-viewer-head, .media-viewer-footer"+(t?"":", .VideoPlayer"),onClick:()=>{Ie||i.$b||qe()},onSwipe:i.$b?(e,t)=>(t===Z.e.Right?et():t===Z.e.Left?tt():e.target&&e.target.closest(".MediaViewerFooter")||qe(),!0):void 0})}),[qe,Ce,re,ne,Ie,tt,et]);const nt=(0,a.I4)(((e,t)=>{Me({x:e,y:t})}),[]),at=(0,a.I4)((()=>{i.$b&&(ne||re)&&fe(!Ce)}),[Ce,re,ne]),st=(0,M.Z)();function rt(t){if(oe)return a.ZP.createElement("div",{key:e,className:"media-viewer-content"},de(Re||Le,(0,d.PA)(d.vY,!1),!i.wB&&!Ie));if($){const e=(0,y.X)($),s=Boolean(e);return a.ZP.createElement("div",{key:n,className:"media-viewer-content "+(s?"has-footer":""),onClick:at},ne&&de(Be||Re||Le||Fe,$&&(0,d.PA)(Ge,s),!i.wB&&!Ie),te&&a.ZP.createElement(ae,{key:n,url:Be||Re,isGif:re,posterData:De,posterSize:$&&(0,d.PA)(Ge,s,!0),downloadProgress:$e,fileSize:xe,isMediaViewerOpen:_,noPlay:!t,onClose:qe}),e&&a.ZP.createElement(Y,{text:e,onClick:Ke,isHidden:Ce&&(!te||re),isForVideo:te&&!re}))}}function ot(){return oe?a.ZP.createElement(U,{key:h.id,chatId:h.id,isAvatar:!0}):a.ZP.createElement(U,{key:n,chatId:e,messageId:n})}return(0,T.ZP)(_,O,x,{chatId:e,threadId:t,messageId:n,origin:m,avatarOwnerId:h&&h.id}),a.ZP.createElement(A.Z,{id:"MediaViewer",className:Ie?"zoomed":"",isOpen:_},(()=>a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("div",{className:"media-viewer-head",dir:st.isRtl?"rtl":void 0},i.wB&&a.ZP.createElement(R.Z,{className:"media-viewer-close",round:!0,size:"smaller",color:"translucent-white",ariaLabel:st("Close"),onClick:qe},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement(L.Z,{activeKey:Pe.current,name:pe},ot),a.ZP.createElement(X,{mediaData:Re||Le,isVideo:te,isZoomed:Ie,message:$,fileName:Oe,onCloseMediaViewer:qe,onForward:We,onZoomToggle:He,isAvatar:oe})),a.ZP.createElement(ie,{noWrap:!be,canPan:Ie,panDeltaX:Se.x,panDeltaY:Se.y,zoomLevel:Ne,onPan:nt},a.ZP.createElement(L.Z,{className:"slide-container",activeKey:ue,name:ve},rt)),!he&&a.ZP.createElement("button",{type:"button",className:`navigation prev ${te&&!re&&"inline"}`,"aria-label":st("AccDescrPrevious"),dir:st.isRtl?"rtl":void 0,onClick:et}),!Ze&&a.ZP.createElement("button",{type:"button",className:`navigation next ${te&&!re&&"inline"}`,"aria-label":st("Next"),dir:st.isRtl?"rtl":void 0,onClick:tt}),a.ZP.createElement(se,{isShown:Ie,onChangeZoom:Ve}))))})));var ue=n(5765),he=n(7407),Ze=n(2313),Pe=n(4288),ge=n(3103),ve=n(7687),pe=n(1273),Ee=n(1876),Ce=n(6058),fe=n(8799);const be=(0,a.X$)((0,s.c$)((e=>{const{chats:{byId:t,listIds:n,orderedPinnedIds:a},currentUserId:s}=e;return{chatsById:t,pinnedIds:a.active,activeListIds:n.active,archivedListIds:n.archived,currentUserId:s}}),((e,t)=>(0,h.ei)(t,["setForwardChatId","exitForwardMode","loadMoreChats"])))((({chatsById:e,pinnedIds:t,activeListIds:n,archivedListIds:s,currentUserId:o,isOpen:l,setForwardChatId:c,exitForwardMode:d,loadMoreChats:m})=>{const[Z,P]=(0,a.eJ)(""),g=(0,a.sO)(null),v=(0,M.Z)();(0,a.d4)((()=>{l?i.wB||setTimeout((()=>{requestAnimationFrame((()=>{g.current&&g.current.focus()}))}),500):(g.current&&g.current.blur(),setTimeout((()=>{P("")}),300))}),[l]);const p=(0,a.Ye)((()=>{const a=[...n||[],...s||[]];let l=t||[];return o&&(l=(0,h.Tw)([o,...l])),(0,u.ih)([...a.filter((t=>{const n=e[t];return!n||!!(0,u.Qm)(n,r._f)&&(!Z||(0,ue.Z)((0,u.U)(v,e[t],void 0,t===o),Z))}))],e,void 0,l)}),[n,s,e,o,Z,v,t]),[E,C]=(0,he.Z)(m,p,Boolean(Z)),f=(0,a.I4)((e=>{P(e.currentTarget.value)}),[]),b=(0,a.sO)(null),y=(0,Ze.Z)(b,l,(e=>{E&&E.length>0&&c({id:E[-1===e?0:e]})}),".ListItem-button",!0),I=a.ZP.createElement("div",{className:"modal-header",dir:v.isRtl?"rtl":void 0},a.ZP.createElement(R.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:v("Close"),onClick:d},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement(ve.Z,{ref:g,value:Z,onChange:f,onKeyDown:y,placeholder:v("ForwardTo")}));return a.ZP.createElement(ge.Z,{isOpen:l,onClose:d,className:"ForwardPicker",header:I},null!=E&&E.length?a.ZP.createElement(pe.Z,{className:"picker-list custom-scroll",items:E,onLoadMore:C,noScrollRestore:Boolean(Z),ref:b,onKeyDown:y},E.map((e=>a.ZP.createElement(Ee.Z,{key:e,className:"chat-item-clickable force-rounded-corners",onClick:()=>c({id:e})},(0,u.YA)(e)?a.ZP.createElement(Ce.Z,{status:e===o?v("SavedMessagesInfo"):void 0,userId:e}):a.ZP.createElement(fe.Z,{chatId:e}))))):E&&!E.length?a.ZP.createElement("p",{className:"no-results"},"Sorry, nothing found."):a.ZP.createElement(Pe.Z,null))})));var ye=n(1947);function Ie(e){return e.isSlowMode?"Slowmode enabled":e.hasErrorKey?"Something went wrong":"Telegram"}const we=(0,a.X$)((0,s.c$)((e=>(0,h.ei)(e,["dialogs"])),((e,t)=>(0,h.ei)(t,["dismissDialog","acceptInviteConfirmation"])))((({dialogs:e,dismissDialog:t,acceptInviteConfirmation:n})=>{const s=(0,M.Z)();if(e.length)return a.ZP.createElement("div",{id:"Dialogs"},e.map((e=>{return"hash"in e?(e=>{const{hash:r,title:o,participantsCount:l,isChannel:i}=e,c=s(i?"Subscribers":"Members",l,"i"),d=s(i?"ChannelJoin":"JoinGroup");return a.ZP.createElement(ge.Z,{isOpen:!0,onClose:t,className:"error",title:o},void 0!==l&&a.ZP.createElement("p",null,c),a.ZP.createElement(R.Z,{isText:!0,className:"confirm-dialog-button",onClick:()=>{n({hash:r}),t()}},d),a.ZP.createElement(R.Z,{isText:!0,className:"confirm-dialog-button",onClick:t},s("Cancel")))})(e):(r=e,a.ZP.createElement(ge.Z,{isOpen:!0,onClose:t,className:"error",title:Ie(r)},r.hasErrorKey?(0,ye.ZP)(r):(0,B.Z)(r.message,["emoji","br"]),a.ZP.createElement("div",null,a.ZP.createElement(R.Z,{isText:!0,onClick:t},s("OK")))));var r})))})));var Ne=n(6937);const ke=(0,a.X$)((0,s.c$)((e=>(0,h.ei)(e,["notifications"])),((e,t)=>(0,h.ei)(t,["dismissNotification"])))((({notifications:e,dismissNotification:t})=>{if(e.length)return a.ZP.createElement("div",{id:"Notifications"},e.map((({message:e,localId:n})=>a.ZP.createElement(Ne.Z,{message:(0,B.Z)(e,["emoji","br","links","simple_markdown"]),onDismiss:()=>t({localId:n})}))))})));var Se=n(8360),Me=n(7551);const Te=(0,a.X$)((0,s.c$)(void 0,((e,t)=>(0,h.ei)(t,["toggleSafeLinkModal"])))((({url:e,toggleSafeLinkModal:t})=>{const n=(0,M.Z)(),s=(0,a.I4)((()=>{window.open(e),t({url:void 0})}),[t,e]),r=(0,a.I4)((()=>{t({url:void 0})}),[t]),o=(0,Se.Z)(e);return a.ZP.createElement(Me.Z,{isOpen:Boolean(e),onClose:r,title:n("OpenUrlTitle"),textParts:(0,B.Z)(n("OpenUrlAlert2",o),["links"]),confirmLabel:n("OpenUrlTitle"),confirmHandler:s})})));var Fe=n(706);const Ae=["lng_weekday1","lng_weekday2","lng_weekday3","lng_weekday4","lng_weekday5","lng_weekday6","lng_weekday7"];function Le(e,t,n,a,s){const r=new Date(e,t,n,0,0,0,0),o=a&&new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0),l=s&&new Date(s.getFullYear(),s.getMonth(),s.getDate(),0,0,0,0);return!!(l&&r>l)||!!(o&&r{const u=(0,M.Z)(),h=new Date,Z=(0,a.Ye)((()=>e?new Date(e):new Date),[e]),P=t?new Date(t):void 0,g=(0,f.Z)(r),[v,p,E]=(0,Fe.Z)(!1),[C,b]=(0,a.eJ)(Z),[y,I]=(0,a.eJ)(Re(Z.getHours())),[w,N]=(0,a.eJ)(Re(Z.getMinutes())),k=C.getFullYear(),S=C.getMonth(),T=C.getDate();(0,a.d4)((()=>{!g&&r&&b(Z)}),[r,Z,g]),(0,a.d4)((()=>{n&&!v&&C.getTime()=h.getFullYear()&&S>=h.getMonth()||P&&k>=P.getFullYear()&&S>=P.getMonth(),A=n&&k<=h.getFullYear()&&S<=h.getMonth(),L=(0,a.Ye)((()=>function(e,t){const n=[],a=new Date;a.setFullYear(e),a.setMonth(t),a.setDate(1);const s=a.getDay()||7;for(let e=1;e{const t=e.target.value.replace(/[^\d]+/g,"");if(!t.length)return I(""),void(e.target.value="");const n=Math.max(0,Math.min(Number(t),23)),a=new Date(C.getTime());a.setHours(n),b(a);const s=Re(n);I(s),e.target.value=s}),[C]),D=(0,a.I4)((e=>{const t=e.target.value.replace(/[^\d]+/g,"");if(!t.length)return N(""),void(e.target.value="");const n=Math.max(0,Math.min(Number(t),59)),a=new Date(C.getTime());a.setMinutes(n),b(a);const s=Re(n);N(s),e.target.value=s}),[C]);return a.ZP.createElement(ge.Z,{isOpen:r,onClose:c,className:"CalendarModal"},a.ZP.createElement("div",{className:"container"},a.ZP.createElement("div",{className:"month-selector"},a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",onClick:c},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement("h4",null,u(`lng_month${C.getMonth()+1}`)," ",C.getFullYear()),a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",disabled:A,onClick:A?void 0:function(){b((e=>{const t=new Date(e);return t.setMonth(t.getMonth()-1),t}))}},a.ZP.createElement("i",{className:"icon-previous"})),a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",disabled:F,onClick:F?void 0:function(){b((e=>{const t=new Date(e);return t.setMonth(t.getMonth()+1),t}))}},a.ZP.createElement("i",{className:"icon-next"})))),a.ZP.createElement("div",{className:"calendar-wrapper"},a.ZP.createElement("div",{className:"calendar-grid"},Ae.map((e=>a.ZP.createElement("div",{className:"day-button faded weekday"},a.ZP.createElement("span",null,u(e))))),L.map((e=>a.ZP.createElement("div",{role:"button",tabIndex:0,onClick:()=>{return t=e,void b((e=>{const n=new Date(e);return n.setDate(t),n}));var t},className:(0,_.Z)("day-button",Le(k,S,e,n?h:void 0,s?h:P)?"disabled":e?"clickable":"",e===T&&"selected")},!!e&&a.ZP.createElement("span",null,e)))))),o&&a.ZP.createElement("div",{className:"timepicker"},a.ZP.createElement("input",{type:"text",className:"form-control",inputMode:"decimal",value:y,onChange:B,onFocus:p,onBlur:E}),":",a.ZP.createElement("input",{type:"text",className:"form-control",inputMode:"decimal",value:w,onChange:D,onFocus:p,onBlur:E})),a.ZP.createElement("div",{className:"footer"},a.ZP.createElement(R.Z,{onClick:function(){d(C)}},o?function(e,t){const n=(0,$.xH)(t,e.code);return n===(0,$.xH)(new Date,e.code)?e("Conversation.ScheduleMessage.SendToday",(0,$.mr)(t)):e("Conversation.ScheduleMessage.SendOn",[n,(0,$.mr)(t)])}(u,C):l),i&&a.ZP.createElement(R.Z,{onClick:m,isText:!0},i)))})),Be=(0,a.X$)((0,s.c$)((e=>({selectedAt:e.historyCalendarSelectedAt})),((e,t)=>(0,h.ei)(t,["searchMessagesByDate","closeHistoryCalendar"])))((({isOpen:e,selectedAt:t,searchMessagesByDate:n,closeHistoryCalendar:s})=>{const r=(0,a.I4)((e=>{n({timestamp:e.valueOf()/1e3}),s()}),[s,n]),o=(0,M.Z)();return a.ZP.createElement($e,{isOpen:e,selectedAt:t,isPastMode:!0,submitButtonLabel:o("JumpToDate"),onClose:s,onSubmit:r})}))),De=(0,a.X$)((0,s.c$)(((e,{message:t,isSchedule:n})=>{const{threadId:a}=(0,m.Bt)(e)||{},{canDeleteForAll:s}=a&&(0,m._k)(e,t,a)||{},r=(0,m.Z1)(e,t.chatId);return{canDeleteForAll:!n&&s,contactName:r&&(0,u.YA)(r.id)?(0,u.Vl)((0,m.dy)(e,(0,u.zX)(r))):void 0,willDeleteForCurrentUserOnly:r&&(0,u.G9)(r)&&!s,willDeleteForAll:r&&(0,u.ZV)(r)}}),((e,t)=>(0,h.ei)(t,["deleteMessages","deleteScheduledMessages"])))((({isOpen:e,isSchedule:t,message:n,album:s,canDeleteForAll:r,contactName:o,willDeleteForCurrentUserOnly:l,willDeleteForAll:i,onClose:c,deleteMessages:d,deleteScheduledMessages:m})=>{const u=(0,a.I4)((()=>{const e=null!=s&&s.messages?s.messages.map((({id:e})=>e)):[n.id];d({messageIds:e,shouldDeleteForAll:!0}),c()}),[d,n.id,c,s]),h=(0,a.I4)((()=>{const e=null!=s&&s.messages?s.messages.map((({id:e})=>e)):[n.id];t?m({messageIds:e}):d({messageIds:e,shouldDeleteForAll:!1}),c()}),[s,n.id,t,c,m,d]),Z=(0,M.Z)();return a.ZP.createElement(ge.Z,{isOpen:e,onClose:c,onEnter:e&&!r?h:void 0,className:"delete",title:Z("DeleteSingleMessagesTitle")},a.ZP.createElement("p",null,Z("AreYouSureDeleteSingleMessage")),l&&a.ZP.createElement("p",null,Z("lng_delete_for_me_chat_hint",1,"i")),i&&a.ZP.createElement("p",null,Z("lng_delete_for_everyone_hint",1,"i")),r&&a.ZP.createElement(R.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:u},o&&(0,B.Z)(Z("Conversation.DeleteMessagesFor",o)),!o&&Z("Conversation.DeleteMessagesForEveryone")),a.ZP.createElement(R.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:h},Z(r?"ChatList.DeleteForCurrentUser":"Delete")),a.ZP.createElement(R.Z,{className:"confirm-dialog-button",isText:!0,onClick:c},Z("Cancel")))}))),Ue=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{const n=(0,u.YA)(t),a=(0,m.FM)(e,t),s=(0,m.Z1)(e,t),r=!!s&&(0,u.eA)(s),o=!!s&&(0,u.G9)(s),l=!!s&&(0,u.ZV)(s);return{isPrivateChat:n,isChatWithSelf:a,isChannel:r,isGroup:o,isSuperGroup:l,canPinForAll:n&&!a||l||o,contactName:s&&(0,u.YA)(s.id)?(0,u.Vl)((0,m.dy)(e,(0,u.zX)(s))):void 0}}),((e,t)=>(0,h.ei)(t,["pinMessage"])))((({isOpen:e,messageId:t,chatId:n,isChannel:s,isGroup:r,isSuperGroup:o,canPinForAll:l,contactName:i,onClose:c,pinMessage:d})=>{const m=(0,a.I4)((()=>{d({chatId:n,messageId:t,isUnpin:!1}),c()}),[d,n,t,c]),u=(0,a.I4)((()=>{d({chatId:n,messageId:t,isUnpin:!1,isOneSide:!0,isSilent:!0}),c()}),[n,t,c,d]),h=(0,M.Z)();return a.ZP.createElement(ge.Z,{isOpen:e,onClose:c,className:"pin",title:h("PinMessageAlertTitle")},a.ZP.createElement("p",null,h(s?"PinMessageAlertChannel":r||o?"PinMessageAlert":"PinMessageAlertChat")),a.ZP.createElement(R.Z,{className:"confirm-dialog-button",isText:!0,onClick:u},h("DialogPin")),l&&a.ZP.createElement(R.Z,{className:"confirm-dialog-button",isText:!0,onClick:m},i?(0,B.Z)(h("Conversation.PinMessagesFor",i)):h("Conversation.PinMessageAlert.PinAndNotifyMembers")),a.ZP.createElement(R.Z,{className:"confirm-dialog-button",isText:!0,onClick:c},h("Cancel")))}))),xe=(0,a.X$)((({isOpen:e,pinnedMessagesCount:t=0,onClose:n,onUnpin:s})=>{const r=(0,M.Z)();return a.ZP.createElement(ge.Z,{isOpen:e,onClose:n,className:"unpin-all",title:r("Chat.PanelUnpinAllMessages")},a.ZP.createElement("p",null,r("Chat.UnpinAllMessagesConfirmation",t,"i")),a.ZP.createElement(R.Z,{className:"confirm-dialog-button",isText:!0,onClick:s},r("DialogUnpin")),a.ZP.createElement(R.Z,{className:"confirm-dialog-button",isText:!0,onClick:n},r("Cancel")))}));var Oe=n(517);const Ge=(0,a.X$)((0,s.c$)(((e,{isSchedule:t})=>{const{messageIds:n}=e.selectedMessages||{},{canDeleteForAll:a}=(0,m.xl)(e),s=(0,m.jr)(e);return{selectedMessageIds:n,canDeleteForAll:!t&&a,contactName:s&&(0,u.YA)(s.id)?(0,u.Vl)((0,m.dy)(e,(0,u.zX)(s))):void 0,willDeleteForCurrentUserOnly:s&&(0,u.G9)(s)&&!a,willDeleteForAll:s&&(0,u.ZV)(s)}}),((e,t)=>(0,h.ei)(t,["deleteMessages","deleteScheduledMessages","exitMessageSelectMode"])))((({isOpen:e,isSchedule:t,selectedMessageIds:n,canDeleteForAll:s,contactName:r,willDeleteForCurrentUserOnly:o,willDeleteForAll:l,onClose:i,deleteMessages:c,deleteScheduledMessages:d,exitMessageSelectMode:m})=>{const u=(0,f.Z)(e),h=(0,a.I4)((()=>{i(),c({messageIds:n,shouldDeleteForAll:!0})}),[c,n,i]),Z=(0,a.I4)((()=>{t?d({messageIds:n}):c({messageIds:n,shouldDeleteForAll:!1}),i()}),[t,i,d,n,c]),P=(0,M.Z)();if((0,a.d4)((()=>{!e&&u&&m()}),[m,e,u]),n)return a.ZP.createElement(ge.Z,{isOpen:e,onClose:i,onEnter:s?void 0:Z,className:"delete",title:P("Conversation.DeleteManyMessages")},a.ZP.createElement("p",null,P("AreYouSureDeleteFewMessages")),o&&a.ZP.createElement("p",null,"This will delete them just for you, not for other participants in the chat."),l&&a.ZP.createElement("p",null,"This will delete them for everyone in this chat."),s&&a.ZP.createElement(R.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:h},r?(0,B.Z)(P("ChatList.DeleteForEveryone",r)):P("Conversation.DeleteMessagesForEveryone")),a.ZP.createElement(R.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:Z},P(s?"ChatList.DeleteForCurrentUser":"Delete")),a.ZP.createElement(R.Z,{className:"confirm-dialog-button",isText:!0,onClick:i},P("Cancel")))})));var Je=n(4434);const Xe=(0,a.X$)((0,s.c$)(void 0,((e,t)=>(0,h.ei)(t,["reportMessages","exitMessageSelectMode"])))((({isOpen:e,messageIds:t,reportMessages:n,exitMessageSelectMode:s,onClose:r})=>{const[o,l]=(0,a.eJ)("spam"),[i,c]=(0,a.eJ)(""),d=()=>{n({messageIds:t,reason:o,description:i}),s(),r()},m=(0,a.I4)((e=>{l(e)}),[]),u=(0,a.I4)((e=>{c(e.target.value)}),[]),h=(0,M.Z)(),Z=[{value:"spam",label:h("lng_report_reason_spam")},{value:"violence",label:h("lng_report_reason_violence")},{value:"pornography",label:h("lng_report_reason_pornography")},{value:"childAbuse",label:h("lng_report_reason_child_abuse")},{value:"copyright",label:h("ReportPeer.ReasonCopyright")},{value:"other",label:h("lng_report_reason_other")}];if(t)return a.ZP.createElement(ge.Z,{isOpen:e,onClose:r,onEnter:e?d:void 0,className:"report",title:h("lng_report_message_title")},a.ZP.createElement(Je.Z,{name:"report-message",options:Z,onChange:m,selected:o}),a.ZP.createElement(ve.Z,{label:h("lng_report_reason_description"),value:i,onChange:u}),a.ZP.createElement(R.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:d},h("lng_report_button")),a.ZP.createElement(R.Z,{className:"confirm-dialog-button",isText:!0,onClick:r},h("Cancel")))}))),ze=(0,a.X$)((0,s.c$)((e=>{const{type:t}=(0,m.Bt)(e)||{},{canDelete:n}=(0,m.xl)(e),a=(0,m.nB)(e),{messageIds:s}=e.selectedMessages||{};return{isSchedule:"scheduled"===t,selectedMessagesCount:(0,m.D7)(e),canDeleteMessages:n,canReportMessages:a,selectedMessageIds:s}}),((e,t)=>(0,h.ei)(t,["exitMessageSelectMode","openForwardMenuForSelectedMessages"])))((({canPost:e,isActive:t,messageListType:n,isSchedule:s,selectedMessagesCount:r,canDeleteMessages:o,canReportMessages:l,selectedMessageIds:i,exitMessageSelectMode:c,openForwardMenuForSelectedMessages:d})=>{const[m,u,h]=(0,Fe.Z)(),[Z,P,g]=(0,Fe.Z)();(0,a.d4)((()=>!t||m||Z?void 0:(0,Oe.Z)({onBackspace:u,onDelete:u,onEsc:c})),[t,m,Z,u,c]);const v=(0,f.Z)(r||void 0,!0),p=t?r:v,E=(0,M.Z)(),C=E("VoiceOver.Chat.MessagesSelected",p),b=(0,_.Z)("MessageSelectToolbar",e&&"with-composer",t&&"shown");return a.ZP.createElement("div",{className:b},a.ZP.createElement("div",{className:"MessageSelectToolbar-inner"},a.ZP.createElement(R.Z,{color:"translucent",round:!0,onClick:c,ariaLabel:"Exit select mode"},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement("span",{className:"MessageSelectToolbar-count",title:C},C),!!r&&a.ZP.createElement("div",{className:"MessageSelectToolbar-actions"},"scheduled"!==n&&a.ZP.createElement(G.Z,{icon:"forward",ariaLabel:"Forward Messages",onClick:d},a.ZP.createElement("span",{className:"item-text"},E("Forward"))),l&&a.ZP.createElement(G.Z,{icon:"flag",onClick:P,disabled:!l,ariaLabel:E("Conversation.ReportMessages")},a.ZP.createElement("span",{className:"item-text"},E("Report"))),a.ZP.createElement(G.Z,{destructive:!0,icon:"delete",onClick:u,disabled:!o,ariaLabel:E("EditAdminGroupDeleteMessages")},a.ZP.createElement("span",{className:"item-text"},E("Delete"))))),a.ZP.createElement(Ge,{isOpen:m,isSchedule:s,onClose:h}),a.ZP.createElement(Xe,{isOpen:Z,onClose:g,messageIds:i}))})));var _e=n(3133),Ye=n(735),je=n(1470);const He=e=>{const t=(0,a.sO)(null),n=(0,a.I4)((n=>{"Enter"===n.key&&t.current===document.activeElement&&e()}),[e]);return(0,a.d4)((()=>(window.addEventListener("keydown",n,!1),()=>window.removeEventListener("keydown",n))),[n]),t};var Ve=n(329);const qe=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{const n=(0,m.Z1)(e,t),a=n&&(0,u.zX)(n);return{chat:n,privateChatUser:a?(0,m.dy)(e,a):void 0,isPinned:(0,m.ep)(e,t),isMuted:n?(0,u.i4)(n,(0,m.dZ)(e),(0,m.NJ)(e)):void 0}}))((({chatId:e,chat:t,privateChatUser:n,isPinned:s,isMuted:r,withUsername:o,onClick:l})=>{const[i,c,d]=(0,Fe.Z)(),m=(0,je.Z)({chat:t,privateChatUser:n,isPinned:s,isMuted:r,handleDelete:c},!0),h=()=>{l(e)},Z=He(h);if(t)return a.ZP.createElement(Ee.Z,{className:"chat-item-clickable search-result",onClick:h,contextActions:m,buttonRef:Z},(0,u.YA)(e)?a.ZP.createElement(Ce.Z,{userId:e,withUsername:o,avatarSize:"large"}):a.ZP.createElement(fe.Z,{chatId:e,withUsername:o,avatarSize:"large"}),a.ZP.createElement(Ve.Z,{isOpen:i,onClose:d,chat:t}))})));var Ke=n(8781);const We=(0,z.P2)((e=>e()),6e4,!0),Qe=(0,a.X$)((0,s.c$)((e=>{const{userIds:t}=e.topPeers,n=e.users.byId,{recentlyFoundChatIds:a}=e.globalSearch;return{topUserIds:t,usersById:n,recentlyFoundChatIds:a}}),((e,t)=>(0,h.ei)(t,["loadTopUsers","loadContactList","openChat","addRecentlyFoundChatId","clearRecentlyFoundChats"])))((({topUserIds:e,usersById:t,recentlyFoundChatIds:n,onReset:s,loadTopUsers:r,loadContactList:o,openChat:l,addRecentlyFoundChatId:i,clearRecentlyFoundChats:c})=>{const d=(0,a.sO)(null);(0,a.d4)((()=>{We((()=>{r(),o()}))}),[r,o]),(0,Ke.Z)(d.current,!e);const m=(0,a.I4)((e=>{l({id:e,shouldReplaceHistory:!0}),s(),setTimeout((()=>{i({id:e})}),250)}),[l,i,s]),h=(0,M.Z)();return a.ZP.createElement("div",{className:"RecentContacts custom-scroll"},e&&a.ZP.createElement("div",{className:"top-peers-section",dir:h.isRtl?"rtl":void 0},a.ZP.createElement("div",{ref:d,className:"top-peers no-selection"},e.map((e=>a.ZP.createElement("div",{className:"top-peer-item",onClick:()=>m(e),dir:h.isRtl?"rtl":void 0},a.ZP.createElement(D.Z,{user:t[e]}),a.ZP.createElement("div",{className:"top-peer-name"},(0,B.Z)((0,u.Vl)(t[e])||" "))))))),n&&a.ZP.createElement("div",{className:"search-section pt-1"},a.ZP.createElement("h3",{className:"section-heading mt-0 recent-chats-header",dir:h.isRtl?"rtl":void 0},h("Recent"),a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",ariaLabel:"Clear recent chats",onClick:c,isRtl:h.isRtl},a.ZP.createElement("i",{className:"icon-close"}))),n.map((e=>a.ZP.createElement(qe,{chatId:e,onClick:m})))))})));var et=n(9411),tt=n(8033);const nt=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{const n=(0,m.Z1)(e,t);if(!n)return{};const a=(0,u.zX)(n);return{chat:n,lastSyncTime:e.lastSyncTime,...a&&{privateChatUser:(0,m.dy)(e,a)}}}),((e,t)=>(0,h.ei)(t,["focusMessage"])))((({message:e,searchQuery:t,chatId:n,chat:s,privateChatUser:r,focusMessage:o,lastSyncTime:l})=>{const c=(0,u.DH)(e),d=(0,p.Z)((0,u.Ti)(e,"micro")),m=Boolean((0,u.Y5)(e)),h=(0,a.I4)((()=>{o({chatId:n,messageId:e.id})}),[n,o,e.id]),Z=(0,M.Z)(),P=He(h);if(s)return a.ZP.createElement(Ee.Z,{className:"ChatMessage chat-item-clickable",ripple:!i.wB,onClick:h,buttonRef:P},a.ZP.createElement(D.Z,{chat:s,user:r,withOnlineStatus:!0,isSavedMessages:null==r?void 0:r.isSelf,lastSyncTime:l}),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"info-row"},a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},(0,B.Z)((0,u.U)(Z,s,r))),s.isVerified&&a.ZP.createElement(et.Z,null)),a.ZP.createElement("div",{className:"message-date"},a.ZP.createElement(tt.Z,{className:"date"},(0,$.VX)(Z,1e3*e.date)))),a.ZP.createElement("div",{className:"subtitle"},a.ZP.createElement("div",{className:"message",dir:"auto"},function(e,t,n,s,r){return n?a.ZP.createElement("span",{className:"media-preview"},a.ZP.createElement("img",{src:n,alt:"",className:r?"round":void 0}),(0,u.b7)(t)&&a.ZP.createElement("i",{className:"icon-play"}),(0,B.Z)((0,u.MK)(e,t,!0),["emoji","highlight"],{highlight:s})):(0,B.Z)((0,u.MK)(e,t))}(Z,e,d||c,t,m)))))}))),at=(0,a.X$)((({searchDate:e,onSelect:t})=>{const n=(0,a.Ye)((()=>function(e){if(e.match(/^\d{2,4}-\d{2}-\d{2}$/g)){const t=new Date(e);return[{date:t,text:(0,$.xH)(t)}]}const t=[],n=new Date,a=n.getFullYear(),s=n.getTime()>new Date(`${a}-${e}`).getTime()?a:a-1;for(let n=0;n<8;n++){const a=new Date(`${s-n}-${e}`);t.push({date:a,text:(0,$.xH)(a)})}return t}(e)),[e]);return a.ZP.createElement("section",{className:"DateSuggest custom-scroll custom-scroll-x"},n.map((({date:e,text:n})=>a.ZP.createElement("div",{onClick:()=>t(e),className:"date-item",key:n},a.ZP.createElement("i",{className:"icon-calendar"}),a.ZP.createElement("span",null,n)))))}));var st=n(7262),rt=n(9187);const ot=(0,z.P2)((e=>e()),500,!0),lt=(0,a.X$)((0,s.c$)((e=>{var t;const{byId:n}=e.chats,{byId:a}=e.users,{userIds:s}=e.contactList||{};if(!s)return{chatsById:n,usersById:a};const{currentUserId:r,messages:o,lastSyncTime:l}=e,{fetchingStatus:i,globalResults:c,localResults:d,resultsByType:m}=e.globalSearch,{chatIds:u,userIds:h}=c||{},{chatIds:Z,userIds:P}=d||{},{byChatId:g}=o;return{currentUserId:r,localContactIds:s,localChatIds:Z,localUserIds:P,globalChatIds:u,globalUserIds:h,foundIds:null==m||null===(t=m.text)||void 0===t?void 0:t.foundIds,globalMessagesByChatId:g,chatsById:n,usersById:a,fetchingStatus:i,lastSyncTime:l}}),((e,t)=>(0,h.ei)(t,["openChat","addRecentlyFoundChatId","searchMessagesGlobal","setGlobalSearchChatId"])))((({searchQuery:e,searchDate:t,dateSearchQuery:n,currentUserId:s,localContactIds:r,localChatIds:l,localUserIds:c,globalChatIds:d,globalUserIds:m,foundIds:Z,globalMessagesByChatId:P,chatsById:g,usersById:v,fetchingStatus:p,lastSyncTime:E,onReset:C,onSearchDateSelect:f,openChat:b,addRecentlyFoundChatId:y,searchMessagesGlobal:I,setGlobalSearchChatId:w})=>{const N=(0,M.Z)(),[k,S]=(0,a.eJ)(!1),[T,F]=(0,a.eJ)(!1),A=(0,a.I4)((({direction:t})=>{E&&t===o.Uq.Backwards&&ot((()=>{I({type:"text",query:e})}))}),[E,I,e]),L=(0,a.I4)((e=>{b({id:e,shouldReplaceHistory:!0}),e!==s&&y({id:e}),i.wB||C()}),[s,b,y,C]),R=(0,a.I4)((e=>{w({id:e})}),[w]),$=(0,a.Ye)((()=>{if(!e||e.startsWith("@")&&e.length<2)return Ye.D;const t=r?r.filter((t=>{const n=v[t];if(!n)return!1;const a=(0,u.Js)(n);return a&&(0,ue.Z)(a,e)||(0,ue.Z)(n.username,e)})):[];return[...s&&(0,ue.Z)(N("SavedMessages"),e)?[s]:[],...(0,u.ih)((0,h.Tw)([...t,...l||[],...c||[]]),g)]}),[e,r,s,N,l,c,g,v]),B=(0,a.Ye)((()=>!e||e.length<4||!d||!m?Ye.D:(0,u.ih)((0,h.Tw)([...d,...m]),g,!0)),[g,d,m,e]),D=(0,a.Ye)((()=>(e||t)&&Z&&0!==Z.length?Z.map((e=>{var t;const[n,a]=e.split("_").map(Number);return null==P||null===(t=P[n])||void 0===t?void 0:t.byId[a]})).filter(Boolean).sort(((e,t)=>t.date-e.date)):Ye.D),[Z,P,e,t]),U=(0,a.I4)((()=>{S(!k)}),[k]),x=(0,a.I4)((()=>{F(!T)}),[T]),O=p&&!p.chats&&!p.messages&&!$.length&&!B.length&&!D.length;return e||t?a.ZP.createElement(pe.Z,{className:"LeftSearch custom-scroll",items:D,onLoadMore:A,noScrollRestoreOnTop:!0,noFastList:!0},n&&a.ZP.createElement("div",{className:"chat-selection no-selection no-scrollbar"},a.ZP.createElement(at,{searchDate:n,onSelect:f})),O&&a.ZP.createElement(st.Z,{text:N("ChatList.Search.NoResults"),description:N("ChatList.Search.NoResultsDescription")}),!!$.length&&a.ZP.createElement("div",{className:"chat-selection no-selection no-scrollbar",dir:N.isRtl?"rtl":void 0},$.map((e=>a.ZP.createElement(rt.Z,{chatOrUserId:e,onClick:R,clickArg:e})))),!!$.length&&a.ZP.createElement("div",{className:"search-section"},a.ZP.createElement("h3",{className:"section-heading",dir:N.isRtl?"auto":void 0},$.length>3&&a.ZP.createElement(tt.Z,{onClick:U},N(k?"ChatList.Search.ShowLess":"ChatList.Search.ShowMore")),N("DialogList.SearchSectionDialogs")),$.map(((e,t)=>{if(k||!(t>=3))return a.ZP.createElement(qe,{chatId:e,onClick:L})}))),!!B.length&&a.ZP.createElement("div",{className:"search-section"},a.ZP.createElement("h3",{className:"section-heading",dir:N.isRtl?"auto":void 0},B.length>3&&a.ZP.createElement(tt.Z,{onClick:x},N(T?"ChatList.Search.ShowLess":"ChatList.Search.ShowMore")),N("DialogList.SearchSectionGlobal")),B.map(((e,t)=>{if(T||!(t>=3))return a.ZP.createElement(qe,{chatId:e,withUsername:!0,onClick:L})}))),!!D.length&&a.ZP.createElement("div",{className:"search-section"},a.ZP.createElement("h3",{className:"section-heading",dir:N.isRtl?"auto":void 0},N("SearchMessages")),D.map((function(t){const n=(0,u.MK)(N,t),s=g[t.chatId];if(n&&s)return a.ZP.createElement(nt,{chatId:t.chatId,message:t,searchQuery:e})})))):a.ZP.createElement(Qe,{onReset:C})}))),it=(0,z.P2)((e=>e()),500,!0),ct=(0,a.X$)((0,s.c$)((e=>{const{byId:t}=e.chats,{currentUserId:n,messages:{byChatId:a},lastSyncTime:s}=e,{fetchingStatus:r,resultsByType:o}=e.globalSearch,{foundIds:l}=(null==o?void 0:o.text)||{};return{currentUserId:n,foundIds:l,globalMessagesByChatId:a,chatsById:t,fetchingStatus:r,lastSyncTime:s}}),((e,t)=>(0,h.ei)(t,["searchMessagesGlobal"])))((({searchQuery:e,currentUserId:t,dateSearchQuery:n,foundIds:s,globalMessagesByChatId:r,chatsById:l,fetchingStatus:i,lastSyncTime:c,searchMessagesGlobal:d,onSearchDateSelect:m})=>{const h=(0,M.Z)(),Z=(0,a.I4)((({direction:n})=>{c&&n===o.Uq.Backwards&&it((()=>{d({type:"text",query:e,chatId:t})}))}),[t,c,d,e]),P=(0,a.Ye)((()=>s&&0!==s.length?s.map((e=>{var t;const[n,a]=e.split("_").map(Number);return null==r||null===(t=r[n])||void 0===t?void 0:t.byId[a]})).filter(Boolean).sort(((e,t)=>t.date-e.date)):Ye.D),[s,r]),g=i&&!i.chats&&!i.messages&&!P.length;return a.ZP.createElement("div",{className:"LeftSearch"},a.ZP.createElement(pe.Z,{className:"search-content custom-scroll chat-list",items:P,onLoadMore:Z,noFastList:!0},n&&a.ZP.createElement("div",{className:"chat-selection no-selection no-scrollbar"},a.ZP.createElement(at,{searchDate:n,onSelect:m})),g&&a.ZP.createElement(st.Z,{text:h("ChatList.Search.NoResults"),description:h("ChatList.Search.NoResultsDescription")}),!!P.length&&P.map((function(t){const n=(0,u.MK)(h,t),s=l[t.chatId];if(n&&s)return a.ZP.createElement(nt,{chatId:t.chatId,message:t,searchQuery:e})}))))})));function dt(e){return(t,n)=>{var a;const{byId:s}=t.chats,{byId:r}=t.users,{fetchingStatus:o,resultsByType:l,chatId:i}=t.globalSearch,c="audio"!==e?e:null!=n&&n.isVoice?"voice":"audio",{byChatId:d}=t.messages,u=null==l||null===(a=l[c])||void 0===a?void 0:a.foundIds;return{theme:(0,m.Pu)(t),isLoading:void 0===u||!!o&&Boolean(o.chats||o.messages),chatsById:s,usersById:r,globalMessagesByChatId:d,foundIds:u,searchChatId:i,lastSyncTime:t.lastSyncTime}}}var mt=n(7891),ut=n(3709);const ht="media",Zt=(0,z.P2)((e=>e()),500,!0),Pt=(0,a.X$)((0,s.c$)(dt(ht),((e,t)=>(0,h.ei)(t,["searchMessagesGlobal","openMediaViewer"])))((({searchQuery:e,searchChatId:t,isLoading:n,globalMessagesByChatId:s,foundIds:r,lastSyncTime:i,searchMessagesGlobal:c,openMediaViewer:d})=>{const m=(0,M.Z)(),u=(0,a.I4)((({direction:n})=>{i&&n===o.Uq.Backwards&&Zt((()=>{c({type:ht,query:e,chatId:t})}))}),[i,c,e,t]),h=(0,a.Ye)((()=>r&&s?r.map((e=>{var t;const[n,a]=e.split("_").map(Number);return null===(t=s[n])||void 0===t?void 0:t.byId[a]})).filter(Boolean):Ye.D),[s,r]),Z=(0,a.I4)(((e,t)=>{d({chatId:t,messageId:e,origin:o.bZ.SearchResult})}),[d]),P=(0,mt.Z)([e],l.Y)&&!n,g=P&&r&&r.length>0&&!e,v=P&&r&&r.length>0&&e,p=(0,_.Z)("search-content custom-scroll",v&&"chat-list");return a.ZP.createElement("div",{className:"LeftSearch"},a.ZP.createElement(pe.Z,{className:p,items:h,itemSelector:e?".ListItem":".Media",onLoadMore:u,noFastList:!0},!P&&a.ZP.createElement(Pe.Z,null),P&&(!r||0===r.length)&&a.ZP.createElement(st.Z,{text:m("ChatList.Search.NoResults"),description:m("ChatList.Search.NoResultsDescription")}),g&&a.ZP.createElement("div",{className:"media-list",dir:m.isRtl?"rtl":void 0},h.map((e=>a.ZP.createElement(ut.Z,{key:e.id,idPrefix:"search-media",message:e,onClick:Z})))),v&&h.map((e=>a.ZP.createElement(nt,{key:e.id,chatId:e.chatId,message:e})))))})));function gt(e,t,n,a){const{senderId:s}=t;if(!s)return;const r=(0,u.YA)(s)?a[s]:n[s];let o=(0,u.OU)(e,r);const l=n[t.chatId];return l&&((0,u.YA)(s)&&r.isSelf?o=`${e("FromYou")} → ${(0,u.U)(e,l)}`:(0,u.Bf)(l)&&(o+=` → ${(0,u.U)(e,l)}`)),o}var vt=n(5418);const pt="links",Et=(0,z.P2)((e=>e()),500,!0),Ct=(0,a.X$)((0,s.c$)(dt(pt),((e,t)=>(0,h.ei)(t,["searchMessagesGlobal","focusMessage"])))((({searchQuery:e,searchChatId:t,isLoading:n,chatsById:s,usersById:r,globalMessagesByChatId:i,foundIds:c,lastSyncTime:d,searchMessagesGlobal:m,focusMessage:u})=>{const h=(0,M.Z)(),Z=(0,a.I4)((({direction:n})=>{d&&n===o.Uq.Backwards&&Et((()=>{m({type:pt,query:e,chatId:t})}))}),[d,m,e,t]),P=(0,a.Ye)((()=>c&&i?c.map((e=>{var t;const[n,a]=e.split("_").map(Number);return null===(t=i[n])||void 0===t?void 0:t.byId[a]})).filter(Boolean):Ye.D),[i,c]),g=(0,a.I4)(((e,t)=>{u({chatId:t,messageId:e})}),[u]),v=(0,mt.Z)([e],l.Y)&&!n;return a.ZP.createElement("div",{className:"LeftSearch"},a.ZP.createElement(pe.Z,{className:"search-content documents-list custom-scroll",items:P,onLoadMore:Z,noFastList:!0},!v&&a.ZP.createElement(Pe.Z,null),v&&(!c||0===c.length)&&a.ZP.createElement(st.Z,{text:h("ChatList.Search.NoResults"),description:h("ChatList.Search.NoResultsDescription")}),v&&c&&c.length>0&&P.map(((e,t)=>{const n=0===t||(0,$.kj)(e.date)!==(0,$.kj)(P[t-1].date);return a.ZP.createElement("div",{className:"ListItem small-icon",dir:h.isRtl?"rtl":void 0,key:e.id},n&&a.ZP.createElement("p",{className:"section-heading",dir:h.isRtl?"rtl":void 0},(0,$.np)(h,new Date(1e3*e.date))),a.ZP.createElement(vt.Z,{key:e.id,message:e,senderTitle:gt(h,e,s,r),onMessageClick:g}))}))))})));var ft=n(2535);const bt="documents",yt=(0,z.P2)((e=>e()),500,!0),It=(0,a.X$)((0,s.c$)(dt(bt),((e,t)=>(0,h.ei)(t,["searchMessagesGlobal","focusMessage"])))((({searchQuery:e,searchChatId:t,isLoading:n,chatsById:s,usersById:r,globalMessagesByChatId:i,foundIds:c,lastSyncTime:d,searchMessagesGlobal:m,focusMessage:h})=>{const Z=(0,M.Z)(),P=(0,a.I4)((({direction:n})=>{d&&n===o.Uq.Backwards&&yt((()=>{m({type:bt,query:e,chatId:t})}))}),[d,m,e,t]),g=(0,a.Ye)((()=>c&&i?c.map((e=>{var t;const[n,a]=e.split("_").map(Number),s=null===(t=i[n])||void 0===t?void 0:t.byId[a];return s&&(0,u.aE)(s)?s:void 0})).filter(Boolean):Ye.D),[i,c]),v=(0,a.I4)(((e,t)=>{h({chatId:t,messageId:e})}),[h]),p=(0,mt.Z)([e],l.Y)&&!n;return a.ZP.createElement("div",{className:"LeftSearch"},a.ZP.createElement(pe.Z,{className:"search-content documents-list custom-scroll",items:g,onLoadMore:P,noFastList:!0},!p&&a.ZP.createElement(Pe.Z,null),p&&(!c||0===c.length)&&a.ZP.createElement(st.Z,{text:Z("ChatList.Search.NoResults"),description:Z("ChatList.Search.NoResultsDescription")}),p&&c&&c.length>0&&g.map(((e,t)=>{const n=0===t||(0,$.kj)(e.date)!==(0,$.kj)(g[t-1].date);return a.ZP.createElement("div",{className:"ListItem small-icon",key:e.id},n&&a.ZP.createElement("p",{className:"section-heading"},(0,$.np)(Z,new Date(1e3*e.date))),a.ZP.createElement(ft.Z,{message:e,withDate:!0,datetime:e.date,smaller:!0,sender:gt(Z,e,s,r),className:"scroll-item",onDateClick:v}))}))))})));var wt=n(4752);const Nt=(0,z.P2)((e=>e()),500,!0),kt=(0,a.X$)((0,s.c$)(dt("audio"),((e,t)=>(0,h.ei)(t,["searchMessagesGlobal","focusMessage","openAudioPlayer"])))((({theme:e,isVoice:t,searchQuery:n,searchChatId:s,isLoading:r,chatsById:i,usersById:c,globalMessagesByChatId:d,foundIds:m,lastSyncTime:u,searchMessagesGlobal:h,focusMessage:Z,openAudioPlayer:P})=>{const g=(0,M.Z)(),v=t?"voice":"audio",p=(0,a.I4)((({direction:e})=>{u&&e===o.Uq.Backwards&&Nt((()=>{h({type:v,query:n,chatId:s})}))}),[v,u,h,n,s]),E=(0,a.Ye)((()=>m&&d?m.map((e=>{var t;const[n,a]=e.split("_").map(Number);return null===(t=d[n])||void 0===t?void 0:t.byId[a]})).filter(Boolean):Ye.D),[d,m]),C=(0,a.I4)(((e,t)=>{Z({chatId:t,messageId:e})}),[Z]),f=(0,a.I4)(((e,t)=>{P({chatId:t,messageId:e})}),[P]),b=(0,mt.Z)([n],l.Y)&&!r;return a.ZP.createElement("div",{className:"LeftSearch"},a.ZP.createElement(pe.Z,{className:"search-content documents-list custom-scroll",items:E,onLoadMore:p,noFastList:!0},!b&&a.ZP.createElement(Pe.Z,null),b&&(!m||0===m.length)&&a.ZP.createElement(st.Z,{text:g("ChatList.Search.NoResults"),description:g("ChatList.Search.NoResultsDescription")}),b&&m&&m.length>0&&E.map(((t,n)=>{const s=0===n||(0,$.kj)(t.date)!==(0,$.kj)(E[n-1].date);return a.ZP.createElement("div",{className:"ListItem small-icon",key:t.id},s&&a.ZP.createElement("p",{className:"section-heading",dir:g.isRtl?"rtl":void 0},(0,$.np)(g,new Date(1e3*t.date))),a.ZP.createElement(wt.Z,{key:t.id,theme:e,message:t,target:"searchResult",senderTitle:gt(g,t,i,c),date:t.date,lastSyncTime:u,className:"scroll-item",onPlay:f,onDateClick:C}))}))))}))),St=[{type:o.nJ.ChatList,title:"SearchAllChatsShort"},{type:o.nJ.Media,title:"SharedMediaTab2"},{type:o.nJ.Links,title:"SharedLinksTab2"},{type:o.nJ.Files,title:"SharedFilesTab2"},{type:o.nJ.Music,title:"SharedMusicTab2"},{type:o.nJ.Voice,title:"SharedVoiceTab2"}],Mt=[{type:o.nJ.ChatList,title:"All Messages"},...St.slice(1)],Tt=Object.keys(o.nJ).length/2,Ft=(0,a.X$)((0,s.c$)((e=>{const{currentContent:t,chatId:n}=e.globalSearch;return{currentContent:t,chatId:n}}),((e,t)=>(0,h.ei)(t,["setGlobalSearchContent","setGlobalSearchDate"])))((({searchQuery:e,searchDate:t,isActive:n,currentContent:s=o.nJ.ChatList,chatId:r,setGlobalSearchContent:l,setGlobalSearchDate:i,onReset:c})=>{const d=(0,M.Z)(),[m,u]=(0,a.eJ)(s),h=(0,a.Ye)((()=>(0,$.xk)(e)),[e]),Z=(0,a.I4)((e=>{const t=St[e];l({content:t.type}),u(e)}),[l]),P=(0,a.I4)((e=>{i({date:e.getTime()/1e3})}),[i]);(0,T.ZP)(n,c,void 0,void 0,!0);const g=(0,a.sO)(null),v=(0,Ze.Z)(g,n,void 0,".ListItem-button",!0);return a.ZP.createElement("div",{className:"LeftSearch",ref:g,onKeyDown:v},a.ZP.createElement(_e.Z,{activeTab:m,tabs:r?Mt:St,onSwitchTab:Z}),a.ZP.createElement(L.Z,{name:d.isRtl?"slide-reversed":"slide",renderCount:Tt,activeKey:s},(()=>{switch(s){case o.nJ.ChatList:return r?a.ZP.createElement(ct,{searchQuery:e,dateSearchQuery:h,onReset:c,onSearchDateSelect:P}):a.ZP.createElement(lt,{searchQuery:e,searchDate:t,dateSearchQuery:h,onReset:c,onSearchDateSelect:P});case o.nJ.Media:return a.ZP.createElement(Pt,{searchQuery:e});case o.nJ.Links:return a.ZP.createElement(Ct,{searchQuery:e});case o.nJ.Files:return a.ZP.createElement(It,{searchQuery:e});case o.nJ.Music:return a.ZP.createElement(kt,{key:"audio",searchQuery:e});case o.nJ.Voice:return a.ZP.createElement(kt,{key:"voice",isVoice:!0,searchQuery:e});default:return}})))})));var At=n(1090);const Lt={currentPassword:"",password:"",hint:"",email:""},Rt=(e,t)=>{switch(t.type){case"setCurrentPassword":return{...e,currentPassword:t.payload};case"setPassword":return{...e,password:t.payload};case"setHint":return{...e,hint:t.payload};case"setEmail":return{...e,email:t.payload};case"reset":return Lt;default:return e}},$t=(0,a.X$)((0,s.c$)(void 0,((e,t)=>(0,h.ei)(t,["signOut","deleteChatFolder"])))((({currentScreen:e,editedFolderId:t,onReset:n,onSaveFilter:s,signOut:r,deleteChatFolder:l,onScreenSelect:c})=>{const[d,m]=(0,a.eJ)(!1),[u,h]=(0,a.eJ)(!1),Z=(0,a.I4)((()=>{m(!0)}),[]),P=(0,a.I4)((()=>{m(!1)}),[]),g=(0,a.I4)((()=>{h(!0)}),[]),v=(0,a.I4)((()=>{h(!1)}),[]),p=(0,a.I4)((()=>{P(),r()}),[P,r]),E=(0,a.I4)((()=>{v(),l({id:t}),n()}),[t,v,l,n]),C=(0,a.Ye)((()=>({onTrigger:e,isOpen:t})=>a.ZP.createElement(R.Z,{round:!0,ripple:!i.wB,size:"smaller",color:"translucent",className:t?"active":"",onClick:e,ariaLabel:"More actions"},a.ZP.createElement("i",{className:"icon-more"}))),[]),f=(0,M.Z)();return a.ZP.createElement("div",{className:"left-header"},a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",onClick:n,ariaLabel:f("AccDescrGoBack")},a.ZP.createElement("i",{className:"icon-arrow-left"})),function(){switch(e){case o.MT.EditProfile:return a.ZP.createElement("h3",null,f("lng_settings_information"));case o.MT.General:return a.ZP.createElement("h3",null,f("General"));case o.MT.Notifications:return a.ZP.createElement("h3",null,f("Notifications"));case o.MT.Privacy:return a.ZP.createElement("h3",null,f("PrivacySettings"));case o.MT.Language:return a.ZP.createElement("h3",null,f("Language"));case o.MT.GeneralChatBackground:return a.ZP.createElement("h3",null,f("ChatBackground"));case o.MT.GeneralChatBackgroundColor:return a.ZP.createElement("h3",null,f("SetColor"));case o.MT.PrivacyPhoneNumber:return a.ZP.createElement("h3",null,f("PrivacyPhone"));case o.MT.PrivacyLastSeen:return a.ZP.createElement("h3",null,f("PrivacyLastSeen"));case o.MT.PrivacyProfilePhoto:return a.ZP.createElement("h3",null,f("Privacy.ProfilePhoto"));case o.MT.PrivacyForwarding:return a.ZP.createElement("h3",null,f("PrivacyForwards"));case o.MT.PrivacyGroupChats:return a.ZP.createElement("h3",null,f("AutodownloadGroupChats"));case o.MT.PrivacyPhoneNumberAllowedContacts:case o.MT.PrivacyLastSeenAllowedContacts:case o.MT.PrivacyProfilePhotoAllowedContacts:case o.MT.PrivacyForwardingAllowedContacts:case o.MT.PrivacyGroupChatsAllowedContacts:return a.ZP.createElement("h3",null,f("AlwaysShareWith"));case o.MT.PrivacyPhoneNumberDeniedContacts:case o.MT.PrivacyLastSeenDeniedContacts:case o.MT.PrivacyProfilePhotoDeniedContacts:case o.MT.PrivacyForwardingDeniedContacts:case o.MT.PrivacyGroupChatsDeniedContacts:return a.ZP.createElement("h3",null,f("NeverShareWith"));case o.MT.PrivacyActiveSessions:return a.ZP.createElement("h3",null,f("SessionsTitle"));case o.MT.PrivacyBlockedUsers:return a.ZP.createElement("h3",null,f("BlockedUsers"));case o.MT.TwoFaDisabled:case o.MT.TwoFaEnabled:return a.ZP.createElement("h3",null,f("TwoStepVerification"));case o.MT.TwoFaNewPassword:case o.MT.TwoFaChangePasswordNew:case o.MT.TwoFaChangePasswordConfirm:return a.ZP.createElement("h3",null,f("PleaseEnterCurrentPassword"));case o.MT.TwoFaNewPasswordConfirm:return a.ZP.createElement("h3",null,f("PleaseReEnterPassword"));case o.MT.TwoFaNewPasswordHint:case o.MT.TwoFaChangePasswordHint:return a.ZP.createElement("h3",null,f("PasswordHint"));case o.MT.TwoFaNewPasswordEmail:case o.MT.TwoFaRecoveryEmail:return a.ZP.createElement("h3",null,f("RecoveryEmailTitle"));case o.MT.TwoFaNewPasswordEmailCode:case o.MT.TwoFaRecoveryEmailCode:return a.ZP.createElement("h3",null,"Recovery Email Code");case o.MT.TwoFaCongratulations:return a.ZP.createElement("h3",null,f("TwoStepVerificationPasswordSet"));case o.MT.TwoFaChangePasswordCurrent:case o.MT.TwoFaTurnOff:case o.MT.TwoFaRecoveryEmailCurrentPassword:return a.ZP.createElement("h3",null,f("PleaseEnterCurrentPassword"));case o.MT.Folders:return a.ZP.createElement("h3",null,f("Filters"));case o.MT.FoldersCreateFolder:return a.ZP.createElement("h3",null,f("FilterNew"));case o.MT.FoldersEditFolder:case o.MT.FoldersEditFolderFromChatList:return a.ZP.createElement("div",{className:"settings-main-header"},a.ZP.createElement("h3",null,f("FilterEdit")),t&&a.ZP.createElement(O.Z,{className:"settings-more-menu",trigger:C,positionX:"right"},a.ZP.createElement(G.Z,{icon:"delete",destructive:!0,onClick:g},f("Delete"))));case o.MT.FoldersIncludedChats:case o.MT.FoldersIncludedChatsFromChatList:case o.MT.FoldersExcludedChats:case o.MT.FoldersExcludedChatsFromChatList:return a.ZP.createElement("div",{className:"settings-main-header"},e===o.MT.FoldersIncludedChats||e===o.MT.FoldersIncludedChatsFromChatList?a.ZP.createElement("h3",null,f("FilterInclude")):a.ZP.createElement("h3",null,f("FilterExclude")),a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",className:"color-primary",onClick:s,ariaLabel:f("AutoDeleteConfirm")},a.ZP.createElement("i",{className:"icon-check"})));default:return a.ZP.createElement("div",{className:"settings-main-header"},a.ZP.createElement("h3",null,f("SETTINGS")),a.ZP.createElement(R.Z,{round:!0,ripple:!i.wB,size:"smaller",color:"translucent",onClick:()=>c(o.MT.EditProfile),ariaLabel:f("lng_settings_information")},a.ZP.createElement("i",{className:"icon-edit"})),a.ZP.createElement(O.Z,{className:"settings-more-menu",trigger:C,positionX:"right"},a.ZP.createElement(G.Z,{icon:"logout",onClick:Z},f("LogOutTitle"))))}}(),a.ZP.createElement(Me.Z,{isOpen:d,onClose:P,text:f("lng_sure_logout"),confirmLabel:f("AccountSettings.Logout"),confirmHandler:p,confirmIsDestructive:!0}),a.ZP.createElement(Me.Z,{isOpen:u,onClose:v,text:f("FilterDeleteAlert"),confirmLabel:f("Delete"),confirmHandler:E,confirmIsDestructive:!0}))})));var Bt=n(787),Dt=n(180);const Ut=(0,a.X$)((0,s.c$)((e=>{const{currentUserId:t,lastSyncTime:n}=e;return{currentUser:t?(0,m.dy)(e,t):void 0,lastSyncTime:n}}),((e,t)=>(0,h.ei)(t,["loadProfilePhotos"])))((({isActive:e,onScreenSelect:t,onReset:n,loadProfilePhotos:s,currentUser:r,lastSyncTime:l})=>{const i=(0,M.Z)(),c=null==r?void 0:r.id;return(0,a.d4)((()=>{c&&l&&s({profileId:c})}),[l,c,s]),(0,T.ZP)(e,n,t,o.MT.Main),a.ZP.createElement("div",{className:"settings-content custom-scroll"},a.ZP.createElement("div",{className:"settings-main-menu"},r&&a.ZP.createElement(Bt.Z,{userId:r.id,forceShowSelf:!0}),r&&a.ZP.createElement(Dt.Z,{chatOrUserId:r.id,forceShowSelf:!0}),a.ZP.createElement(Ee.Z,{icon:"settings",onClick:()=>t(o.MT.General)},i("Telegram.GeneralSettingsViewController")),a.ZP.createElement(Ee.Z,{icon:"unmute",onClick:()=>t(o.MT.Notifications)},i("Notifications")),a.ZP.createElement(Ee.Z,{icon:"lock",onClick:()=>t(o.MT.Privacy)},i("PrivacySettings")),a.ZP.createElement(Ee.Z,{icon:"folder",onClick:()=>t(o.MT.Folders)},i("Filters")),a.ZP.createElement(Ee.Z,{icon:"language",onClick:()=>t(o.MT.Language)},i("Language"))))})));var xt=n(710),Ot=n(1151);const Gt="https://t.me/",Jt=/https:\/\/t\.me\/?/i,Xt=/^([a-zA-Z0-9_]+)$/,zt=(0,z.Ds)((e=>e()),250,!1),_t=(0,a.X$)((({currentUsername:e,asLink:t,isLoading:n,isUsernameAvailable:s,checkUsername:r,onChange:o})=>{const[l,i]=(0,a.eJ)(e||""),c=(0,M.Z)(),d=t?"SetUrl":"Username",m=c(t?"SetUrlPlaceholder":"Username"),[u,h]=(0,a.Ye)((()=>l.length?l.length<5?[void 0,`${m} is too short`]:l.length>32?[void 0,`${m} is too long`]:Xt.test(l)?void 0===s?[]:[s?c(`${d}Available`,"Username"):void 0,!1===s?c(`${d}InUse`):void 0]:[void 0,`${m} contains invalid characters`]:[]),[l,s,c,d,m]);(0,a.d4)((()=>{i(e||"")}),[t,e]);const Z=(0,a.I4)((e=>{const n=e.target.value.trim().replace(Jt,"");i(n),e.target.value=`${t?Gt:""}${n}`;const a=function(e){return e.length>=5&&e.length<=32&&Xt.test(e)}(n);a&&zt((()=>{r({username:n})})),o&&o(!!a&&n)}),[t,r,o]);return a.ZP.createElement(ve.Z,{value:`${t?Gt:""}${l}`,onChange:Z,label:m,error:h,success:u,readOnly:n})})),Yt=(0,z.P2)((e=>e()),6e4,!0),jt="Please provide your first name",Ht="Bio can' be longer than 70 characters",Vt=(0,a.X$)((0,s.c$)((e=>{const{currentUserId:t}=e,{progress:n,isUsernameAvailable:a}=e.profileEdit||{},s=t?(0,m.dy)(e,t):void 0;if(!s)return{progress:n,isUsernameAvailable:a};const{firstName:r,lastName:o,username:l,fullInfo:i}=s,{bio:c}=i||{};return{currentAvatarHash:(0,u.RT)(s),currentFirstName:r,currentLastName:o,currentBio:c,currentUsername:l,progress:n,isUsernameAvailable:a}}),((e,t)=>(0,h.ei)(t,["loadCurrentUser","updateProfile","checkUsername"])))((({isActive:e,onScreenSelect:t,onReset:n,currentAvatarHash:s,currentFirstName:l,currentLastName:i,currentBio:c,currentUsername:d,progress:m,isUsernameAvailable:u,loadCurrentUser:h,updateProfile:Z,checkUsername:P})=>{const g=(0,M.Z)(),[v,E]=(0,a.eJ)(!1),[C,f]=(0,a.eJ)(!1),[b,y]=(0,a.eJ)(),[I,w]=(0,a.eJ)(),[N,k]=(0,a.eJ)(l||""),[S,A]=(0,a.eJ)(i||""),[L,R]=(0,a.eJ)(c||""),[$,D]=(0,a.eJ)(d||""),U=(0,p.Z)(s,!1,r.IU.BlobUrl),x=m===o.rN.InProgress,O=!1===$,G=(0,a.Ye)((()=>!O&&(Boolean(I)||C||!0===u)),[I,C,O,u]);(0,T.ZP)(e,n,t,o.MT.EditProfile),(0,a.d4)((()=>{Yt((()=>{h()}))}),[h]),(0,a.d4)((()=>{w(void 0)}),[U]),(0,a.d4)((()=>{k(l||""),A(i||""),R(c||"")}),[l,i,c]),(0,a.d4)((()=>{D(d||"")}),[d]),(0,a.d4)((()=>{m===o.rN.Complete&&(f(!1),E(!1),y(void 0))}),[m]);const J=(0,a.I4)((e=>{w(e)}),[]),X=(0,a.I4)((e=>{k(e.target.value),f(!0)}),[]),z=(0,a.I4)((e=>{A(e.target.value),f(!0)}),[]),_=(0,a.I4)((e=>{R(e.target.value),f(!0)}),[]),Y=(0,a.I4)((e=>{D(e),E(!0)}),[]),j=(0,a.I4)((()=>{const e=N.trim(),t=S.trim(),n=L.trim();e.length?n.length>70?y(Ht):Z({photo:I,...C&&{firstName:e,lastName:t,bio:n},...v&&{username:$}}):y(jt)}),[I,N,S,L,C,$,v,Z]);return a.ZP.createElement("div",{className:"settings-fab-wrapper"},a.ZP.createElement("div",{className:"settings-content custom-scroll"},a.ZP.createElement("div",{className:"settings-edit-profile"},a.ZP.createElement(xt.Z,{currentAvatarBlobUrl:U,onChange:J,title:"Edit your profile photo",disabled:x}),a.ZP.createElement(ve.Z,{value:N,onChange:X,label:g("FirstName"),disabled:x,error:b===jt?b:void 0}),a.ZP.createElement(ve.Z,{value:S,onChange:z,label:g("LastName"),disabled:x}),a.ZP.createElement(ve.Z,{value:L,onChange:_,label:g("UserBio"),disabled:x,error:b===Ht?b:void 0}),a.ZP.createElement("p",{className:"settings-item-description",dir:g.isRtl?"rtl":void 0},(0,B.Z)(g("lng_settings_about_bio"),["br","simple_markdown"]))),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:g.isRtl?"rtl":void 0},g("Username")),a.ZP.createElement(_t,{currentUsername:$||"",isLoading:x,isUsernameAvailable:u,checkUsername:P,onChange:Y}),a.ZP.createElement("p",{className:"settings-item-description",dir:g.isRtl?"rtl":void 0},(0,B.Z)(g("UsernameHelp"),["br","simple_markdown"])),$&&a.ZP.createElement("p",{className:"settings-item-description",dir:g.isRtl?"rtl":void 0},g("lng_username_link"),a.ZP.createElement("br",null),a.ZP.createElement("span",{className:"username-link"},"https://t.me/",$)))),a.ZP.createElement(Ot.Z,{isShown:G,onClick:j,disabled:x,ariaLabel:"Save changes"},x?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-check"})))})));var qt=n(7324),Kt=n(7799);const Wt=(0,z.P2)((e=>e()),6e4,!0),Qt=(0,a.X$)((0,s.c$)((e=>{const{chats:{byId:t},users:{byId:n}}=e,{orderedIds:a,byId:s,recommended:r}=e.chatFolders;return{chatsById:t,usersById:n,orderedFolderIds:a,foldersById:s,recommendedChatFolders:r,notifySettings:(0,m.dZ)(e),notifyExceptions:(0,m.NJ)(e)}}),((e,t)=>(0,h.ei)(t,["loadRecommendedChatFolders","addChatFolder","showDialog"])))((({onCreateFolder:e,onEditFolder:t,isActive:n,onScreenSelect:s,onReset:r,chatsById:i,usersById:c,orderedFolderIds:d,foldersById:m,recommendedChatFolders:h,notifySettings:Z,notifyExceptions:P,loadRecommendedChatFolders:g,addChatFolder:v,showDialog:p})=>{const[E,C]=(0,a.eJ)(),[f,b]=(0,a.eJ)(!1),y=(0,a.I4)((()=>b(!0)),[]);(0,a.d4)((()=>{E||(0,qt.Z)("FoldersAll").then(C)}),[E]),(0,a.d4)((()=>{Wt((()=>{g()}))}),[g]);const I=(0,a.I4)((()=>{Object.keys(m).length>=10?p({data:{message:"DIALOG_FILTERS_TOO_MUCH",hasErrorKey:!0}}):e()}),[m,p,e]),w=(0,M.Z)();(0,T.ZP)(n,r,s,o.MT.Folders);const N=(0,a.Ye)((()=>{if(!d)return;const e=Object.keys(i).map(Number);return d.map((t=>{const n=m[t];return{id:n.id,title:n.title,subtitle:(0,u.SB)(w,i,c,n,e,Z,P)}}))}),[d,i,m,c,Z,P,w]),k=(0,a.I4)((e=>{Object.keys(m).length>=10?p({data:{message:"DIALOG_FILTERS_TOO_MUCH",hasErrorKey:!0}}):v({folder:e})}),[m,v,p]);return a.ZP.createElement("div",{className:"settings-content custom-scroll"},a.ZP.createElement("div",{className:"settings-content-header"},a.ZP.createElement("div",{className:"settings-content-icon"},E&&a.ZP.createElement(Kt.Z,{id:"settingsFoldersMain",size:l.ku,animationData:E,play:f,noLoop:!0,onLoad:y})),a.ZP.createElement("p",{className:"settings-item-description mb-3",dir:"auto"},w("CreateNewFilterInfo")),a.ZP.createElement(R.Z,{className:"with-icon mb-2",color:"primary",size:"smaller",pill:!0,fluid:!0,onClick:I,isRtl:w.isRtl},a.ZP.createElement("i",{className:"icon-add"}),w("CreateNewFilter"))),a.ZP.createElement("div",{className:"settings-item pt-3"},a.ZP.createElement("h4",{className:"settings-item-header mb-3",dir:w.isRtl?"rtl":void 0},w("Filters")),null!=N&&N.length?N.map((e=>a.ZP.createElement(Ee.Z,{className:"mb-2 no-icon",narrow:!0,multiline:!0,onClick:()=>t(m[e.id])},a.ZP.createElement("span",{className:"title"},e.title),a.ZP.createElement("span",{className:"subtitle"},e.subtitle)))):N&&!N.length?a.ZP.createElement("p",{className:"settings-item-description my-4",dir:"auto"},"You have no folders yet."):a.ZP.createElement(Pe.Z,null)),h&&!!h.length&&a.ZP.createElement("div",{className:"settings-item pt-3"},a.ZP.createElement("h4",{className:"settings-item-header mb-3",dir:w.isRtl?"rtl":void 0},w("FilterRecommended")),h.map((e=>a.ZP.createElement(Ee.Z,{className:"mb-2",narrow:!0,onClick:()=>k(e)},a.ZP.createElement("div",{className:"settings-folders-recommended-item"},a.ZP.createElement("div",{className:"multiline-item"},a.ZP.createElement("span",{className:"title"},e.title),a.ZP.createElement("span",{className:"subtitle"},e.description)),a.ZP.createElement(R.Z,{className:"px-3",color:"primary",size:"tiny",pill:!0,fluid:!0,isRtl:w.isRtl},w("Add"))))))))})));var en=n(3455);const tn=({count:e,itemName:t,itemPluralName:n,isLoading:s,onClick:r})=>{const o=(0,M.Z)();return a.ZP.createElement(R.Z,{className:"ShowMoreButton",color:"translucent",size:"smaller",isText:!0,isLoading:s,isRtl:o.isRtl,onClick:r},a.ZP.createElement("i",{className:"icon-down"}),"Show ",e," more ",e>1?n||`${t}s`:t)},nn="Please provide a title for this folder.",an="ChatList.Filter.Error.Empty",sn=(0,a.X$)((0,s.c$)((e=>{const{listIds:t}=e.chats;return{loadedActiveChatIds:t.active,loadedArchivedChatIds:t.archived}}),((e,t)=>(0,h.ei)(t,["editChatFolder","addChatFolder","loadMoreChats"])))((({state:e,dispatch:t,onAddIncludedChats:n,onAddExcludedChats:s,isActive:r,onScreenSelect:i,onReset:c,onBack:d,loadedActiveChatIds:m,loadedArchivedChatIds:Z,editChatFolder:P,addChatFolder:g,loadMoreChats:v})=>{const[p,E]=(0,a.eJ)(),[C,f]=(0,a.eJ)(!1),b=(0,a.I4)((()=>f(!0)),[]),[y,I]=(0,a.eJ)(!1),[w,N]=(0,a.eJ)(!1),{selectedChatIds:k,selectedChatTypes:S}=(0,en.vb)(e,"included"),{selectedChatIds:A,selectedChatTypes:L}=(0,en.vb)(e,"excluded");(0,a.d4)((()=>{p||(0,qt.Z)("FoldersNew").then(E)}),[p]),(0,a.d4)((()=>{I(!1),N(!1)}),[e.folderId]);const[R,$]=(0,a.Ye)((()=>{const e=new Set([...m||[],...Z||[]]),t=(0,h.eL)(k,e),n=(0,h.eL)(A,e);return[y?t:t.slice(0,5-S.length),w?n:n.slice(0,5-L.length)]}),[A,k,S,L,w,y,m,Z]);(0,a.d4)((()=>{(R.lengthI(!0):()=>N(!0);return a.ZP.createElement(a.ZP.Fragment,null,t.map((t=>function(e,t){const n="included"===t?en.fi.find((({key:t})=>t===e)):en.Yy.find((({key:t})=>t===e));if(n)return a.ZP.createElement(Ee.Z,{key:n.key,className:"settings-folders-list-item mb-1",icon:n.icon,narrow:!0,inactive:!0},B(n.title))}(t,e))),n.map((e=>a.ZP.createElement(Ee.Z,{className:"settings-folders-list-item mb-1",narrow:!0,inactive:!0},(0,u.YA)(e)?a.ZP.createElement(Ce.Z,{avatarSize:"small",userId:e}):a.ZP.createElement(fe.Z,{avatarSize:"small",chatId:e})))),!s&&r>0&&a.ZP.createElement(tn,{count:r,itemName:"chat",onClick:o}))}return(0,T.ZP)(r,d,i,"edit"===e.mode?o.MT.FoldersEditFolder:o.MT.FoldersCreateFolder),a.ZP.createElement("div",{className:"settings-fab-wrapper"},a.ZP.createElement("div",{className:"settings-content custom-scroll"},a.ZP.createElement("div",{className:"settings-content-header"},a.ZP.createElement("div",{className:"settings-content-icon"},p&&a.ZP.createElement(Kt.Z,{id:"settingsFoldersEdit",size:l.ku,animationData:p,play:C&&String(e.folderId),noLoop:!0,onLoad:b})),"create"===e.mode&&a.ZP.createElement("p",{className:"settings-item-description mb-3",dir:B.isRtl?"rtl":void 0},B("FilterIncludeInfo")),a.ZP.createElement(ve.Z,{className:"mb-0",label:B("FilterNameHint"),value:e.folder.title,onChange:function(e){const{currentTarget:n}=e;t({type:"setTitle",payload:n.value.trim()})},error:e.error&&e.error===nn?nn:void 0})),a.ZP.createElement("div",{className:"settings-item no-border pt-3"},e.error&&e.error===an&&a.ZP.createElement("p",{className:"settings-item-description color-danger mb-2",dir:B.isRtl?"rtl":void 0},B(e.error)),a.ZP.createElement("h4",{className:"settings-item-header mb-3",dir:B.isRtl?"rtl":void 0},B("FilterInclude")),a.ZP.createElement(Ee.Z,{className:"settings-folders-list-item color-primary mb-0",icon:"add",onClick:n},B("FilterAddChats")),D("included")),a.ZP.createElement("div",{className:"settings-item no-border pt-3"},a.ZP.createElement("h4",{className:"settings-item-header mb-3",dir:B.isRtl?"rtl":void 0},B("FilterExclude")),a.ZP.createElement(Ee.Z,{className:"settings-folders-list-item color-primary mb-0",icon:"add",onClick:s},B("FilterAddChats")),D("excluded"))),a.ZP.createElement(Ot.Z,{isShown:!!e.isTouched,disabled:e.isLoading,onClick:function(){const{title:n}=e.folder;n?k.length||Object.keys(S).length?(t({type:"setIsLoading",payload:!0}),"edit"===e.mode?P({id:e.folderId,folderUpdate:e.folder}):g({folder:e.folder}),setTimeout((()=>{c()}),500)):t({type:"setError",payload:an}):t({type:"setError",payload:nn})},ariaLabel:"edit"===e.mode?"Save changes":"Create folder"},e.isLoading?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-check"})))})));var rn=n(4605);const on=(0,a.X$)((({mode:e,chatIds:t,selectedIds:n,selectedChatTypes:s,filterValue:r,onSelectedIdsChange:o,onSelectedChatTypesChange:l,onFilterChange:i,onLoadMore:c})=>{const d=(0,a.sO)(null),m="included"===e?en.fi:en.Yy,h=n.length+s.length>10,Z=n.length>=100;(0,a.d4)((()=>{setTimeout((()=>{requestAnimationFrame((()=>{d.current.focus()}))}),500)}),[]);const P=(0,a.I4)((e=>{const t=[...n];t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),o(t)}),[n,o]),g=(0,a.I4)((e=>{const t=[...s];t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),l(t)}),[s,l]),v=(0,a.I4)((e=>{const{value:t}=e.currentTarget;i(t)}),[i]),p=(0,M.Z)(),[E,C]=(0,he.Z)(c,t,Boolean(r));return a.ZP.createElement("div",{className:"Picker SettingsFoldersChatsPicker"},a.ZP.createElement("div",{className:"picker-header custom-scroll"},s.map((function(e){const t=m.find((({key:t})=>e===t));if(t)return a.ZP.createElement(rt.Z,{icon:t.icon,title:p(t.title),isMinimized:h,canClose:!0,onClick:g,clickArg:t.key})})),n.map(((e,t)=>a.ZP.createElement(rt.Z,{chatOrUserId:e,isMinimized:h&&tg(e.key),ripple:!0},a.ZP.createElement("i",{className:`icon-${e.icon}`}),a.ZP.createElement("h3",{className:"chat-type",dir:"auto"},p(e.title)),a.ZP.createElement(rn.Z,{label:"",checked:s.includes(e.key),round:!0}))})),a.ZP.createElement("div",{key:"divider",className:"picker-list-divider"}),a.ZP.createElement("h4",{key:"header2",className:"settings-item-header",dir:p.isRtl?"rtl":void 0},p("FilterChats"))),null!=E&&E.length?E.map((function(e){const t=n.includes(e);return a.ZP.createElement(Ee.Z,{key:e,className:"chat-item-clickable picker-list-item chat-item",onClick:()=>P(e),ripple:!0,disabled:!t&&Z},(0,u.YA)(e)?a.ZP.createElement(Ce.Z,{userId:e}):a.ZP.createElement(fe.Z,{chatId:e,withChatType:!0}),a.ZP.createElement(rn.Z,{label:"",checked:t,round:!0}))})):E&&!E.length?a.ZP.createElement("p",{className:"no-results",key:"no-results"},"Sorry, nothing found."):a.ZP.createElement(Pe.Z,{key:"loading"})))})),ln=(0,a.X$)((0,s.c$)((e=>{const{chats:{byId:t,listIds:n,orderedPinnedIds:a}}=e;return{chatsById:t,listIds:n.active,orderedPinnedIds:a.active,archivedPinnedIds:a.archived,archivedListIds:n.archived}}),((e,t)=>(0,h.ei)(t,["loadMoreChats"])))((({isActive:e,onScreenSelect:t,onReset:n,mode:s,state:r,dispatch:l,chatsById:i,listIds:c,orderedPinnedIds:d,archivedListIds:m,archivedPinnedIds:h,loadMoreChats:Z})=>{const{chatFilter:P}=r,{selectedChatIds:g,selectedChatTypes:v}=(0,en.vb)(r,s,!0),p=(0,M.Z)(),E=(0,a.Ye)((()=>{const e=c?(0,u.O)(i,c,d,"all"):void 0,t=m?(0,u.O)(i,m,h,"archived"):void 0;if(e||t)return[...e?[...e.pinnedChats,...e.otherChats]:[],...t?t.otherChats:[]]}),[i,c,d,m,h]),C=(0,a.Ye)((()=>{if(E)return E.filter((e=>!P||(0,ue.Z)((0,u.U)(p,e),P)||g.includes(e.id))).map((({id:e})=>e))}),[E,P,p,g]),f=(0,a.I4)((e=>{l({type:"setChatFilter",payload:e})}),[l]),b=(0,a.I4)((e=>{l("included"===s?{type:"setIncludeFilters",payload:{...r.includeFilters,includedChatIds:e}}:{type:"setExcludeFilters",payload:{...r.excludeFilters,excludedChatIds:e}})}),[s,r,l]),y=(0,a.I4)((e=>{const t={};e.forEach((e=>{t[e]=!0})),l("included"===s?{type:"setIncludeFilters",payload:{includedChatIds:g,...t}}:{type:"setExcludeFilters",payload:{excludedChatIds:g,...t}})}),[s,g,l]);return(0,T.ZP)(e,n,t,"included"===s?o.MT.FoldersIncludedChats:o.MT.FoldersExcludedChats),C?a.ZP.createElement(on,{mode:s,chatIds:C,selectedIds:g,selectedChatTypes:v,filterValue:P,onSelectedIdsChange:b,onSelectedChatTypesChange:y,onFilterChange:f,onLoadMore:Z}):a.ZP.createElement(Pe.Z,null)}))),cn=(0,a.X$)((({currentScreen:e,shownScreen:t,state:n,dispatch:s,isActive:r,onScreenSelect:l,onReset:i})=>{const c=(0,a.I4)((()=>{e!==o.MT.FoldersCreateFolder&&e!==o.MT.FoldersEditFolder&&e!==o.MT.FoldersEditFolderFromChatList||setTimeout((()=>{s({type:"reset"})}),200),e!==o.MT.FoldersIncludedChats&&e!==o.MT.FoldersExcludedChats?i():"create"===n.mode?l(o.MT.FoldersCreateFolder):l(o.MT.FoldersEditFolder)}),[n.mode,s,e,i,l]),d=(0,a.I4)((()=>{s({type:"reset"}),l(o.MT.FoldersCreateFolder)}),[l,s]),m=(0,a.I4)((e=>{s({type:"editFolder",payload:e}),l(o.MT.FoldersEditFolder)}),[s,l]),u=(0,a.I4)((()=>{s({type:"editIncludeFilters"}),l(e===o.MT.FoldersEditFolderFromChatList?o.MT.FoldersIncludedChatsFromChatList:o.MT.FoldersIncludedChats)}),[e,s,l]),h=(0,a.I4)((()=>{s({type:"editExcludeFilters"}),l(e===o.MT.FoldersEditFolderFromChatList?o.MT.FoldersExcludedChatsFromChatList:o.MT.FoldersExcludedChats)}),[e,s,l]);switch(e){case o.MT.Folders:return a.ZP.createElement(Qt,{onCreateFolder:d,onEditFolder:m,onScreenSelect:l,isActive:r||[o.MT.FoldersCreateFolder,o.MT.FoldersEditFolder,o.MT.FoldersIncludedChats,o.MT.FoldersExcludedChats].includes(t),onReset:i});case o.MT.FoldersCreateFolder:case o.MT.FoldersEditFolder:case o.MT.FoldersEditFolderFromChatList:return a.ZP.createElement(sn,{state:n,dispatch:s,onAddIncludedChats:u,onAddExcludedChats:h,onReset:c,onScreenSelect:l,isActive:r||[o.MT.FoldersIncludedChats,o.MT.FoldersExcludedChats].includes(t),onBack:i});case o.MT.FoldersIncludedChats:case o.MT.FoldersIncludedChatsFromChatList:return a.ZP.createElement(ln,{mode:"included",state:n,dispatch:s,onReset:c,onScreenSelect:l,isActive:r});case o.MT.FoldersExcludedChats:case o.MT.FoldersExcludedChatsFromChatList:return a.ZP.createElement(ln,{mode:"excluded",state:n,dispatch:s,onReset:c,onScreenSelect:l,isActive:r});default:return}}));var dn=n(3657);const mn=(0,a.X$)((({options:e,range:t,label:n,value:s,disabled:r,onChange:o})=>{const l=(0,M.Z)(),i=(0,a.I4)((e=>{o(Number(e.currentTarget.value))}),[o]),c=(0,_.Z)("RangeSlider",r&&"disabled"),d=(0,a.Ye)((()=>{if(e)return s/(e.length-1)*100;if(t){const e=(t.max-t.min)/(t.step||1);return(s-t.min)/e*100}return 0}),[s,e,t]),[m,u,h]=(0,a.Ye)((()=>e?[0,e.length-1,1]:t?[t.min,t.max,t.step||1]:[0,0,0]),[t,e]);return a.ZP.createElement("div",{className:c},n&&a.ZP.createElement("div",{className:"slider-top-row",dir:l.isRtl?"rtl":void 0},a.ZP.createElement("span",{className:"label",dir:"auto"},n),t&&a.ZP.createElement("span",{className:"value",dir:"auto"},s)),a.ZP.createElement("div",{className:"slider-main"},a.ZP.createElement("div",{className:"slider-fill-track",style:`width: ${d}%`}),a.ZP.createElement("input",{min:m,max:u,value:s,step:h,type:"range",onChange:i}),e&&a.ZP.createElement("div",{className:"slider-options"},e.map(((e,t)=>a.ZP.createElement("div",{className:(0,_.Z)("slider-option no-selection",t===s&&"active"),onClick:()=>o(t)},e))))))}));var un=n(8835),hn=n(2155);const Zn=(0,a.X$)((({size:e=l.DC,stickerSet:t,observeIntersection:n})=>{const s=(0,a.sO)(null),o=(0,dn.Op)(s,n),i=`stickerSet${t.id}`,c=(0,p.Z)(i,!o,r.IU.Lottie),{shouldRenderFullMedia:d,transitionClassNames:m}=(0,un.Z)(c,"slow");return a.ZP.createElement("div",{ref:s,className:"sticker-set-cover"},!d&&(0,hn.Xv)(t.title,2),d&&c&&a.ZP.createElement(Kt.Z,{id:i,size:e,animationData:c,className:m}))})),Pn=(0,a.X$)((({stickerSet:e,observeIntersection:t})=>{const n=(0,a.sO)(null),s=(0,dn.Op)(n,t),r=(0,p.Z)(e.hasThumbnail&&`stickerSet${e.id}`,!s),{shouldRenderFullMedia:o,transitionClassNames:l}=(0,un.Z)(r,"slow");return a.ZP.createElement("div",{ref:n,className:"sticker-set-cover"},!o&&(0,hn.Xv)(e.title,2),o&&a.ZP.createElement("img",{src:r,className:l,alt:""}))}));var gn=n(3547);const vn=(0,a.X$)((({stickerSet:e,observeIntersection:t,onClick:n})=>{var s;const r=(0,M.Z)();if(!e||!e.stickers)return;const o=null===(s=e.stickers)||void 0===s?void 0:s[0];return e.hasThumbnail||!o?a.ZP.createElement(Ee.Z,{narrow:!0,className:"SettingsStickerSet",inactive:!o,onClick:()=>o&&n(o)},a.ZP.createElement(R.Z,{ariaLabel:e.title,color:"translucent",isRtl:r.isRtl},e.isAnimated?a.ZP.createElement(Zn,{size:l.Mw,stickerSet:e,observeIntersection:t}):a.ZP.createElement(Pn,{stickerSet:e,observeIntersection:t})),a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("div",{className:"title"},e.title),a.ZP.createElement("div",{className:"subtitle"},r("StickerPack.StickerCount",e.count,"i")))):a.ZP.createElement(Ee.Z,{narrow:!0,className:"SettingsStickerSet",onClick:()=>n(o)},a.ZP.createElement(gn.Z,{sticker:o,size:l.Mw,title:e.title,observeIntersection:t}),a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("div",{className:"title"},e.title),a.ZP.createElement("div",{className:"subtitle"},r("StickerPack.StickerCount",e.count,"i"))))}));var pn=n(4851);const En=["Solid and Steady","Nice and Fast","Lots of Stuff"],Cn=(0,a.X$)((0,s.c$)((e=>({...(0,h.ei)(e.settings.byKey,["messageTextSize","animationLevel","messageSendKeyCombo","shouldAutoDownloadMediaFromContacts","shouldAutoDownloadMediaInPrivateChats","shouldAutoDownloadMediaInGroups","shouldAutoDownloadMediaInChannels","shouldAutoPlayGifs","shouldAutoPlayVideos","shouldSuggestStickers","shouldLoopStickers","isSensitiveEnabled","canChangeSensitive"]),stickerSetIds:e.stickers.added.setIds,stickerSetsById:e.stickers.setsById})),((e,t)=>(0,h.ei)(t,["setSettingOption","loadStickerSets","loadAddedStickers"])))((({isActive:e,onScreenSelect:t,onReset:n,stickerSetIds:s,stickerSetsById:r,messageTextSize:l,animationLevel:c,messageSendKeyCombo:d,shouldAutoDownloadMediaFromContacts:m,shouldAutoDownloadMediaInPrivateChats:u,shouldAutoDownloadMediaInGroups:h,shouldAutoDownloadMediaInChannels:Z,shouldAutoPlayGifs:P,shouldAutoPlayVideos:g,shouldSuggestStickers:v,shouldLoopStickers:p,setSettingOption:E,loadStickerSets:C,loadAddedStickers:f})=>{const b=(0,a.sO)(null),{observe:y}=(0,dn.S1)({rootRef:b}),[I,w,N]=(0,Fe.Z)(),[k,S]=(0,a.eJ)(),F=(0,M.Z)(),A=i.$b?void 0:[{value:"enter",label:F("lng_settings_send_enter"),subLabel:"New line by Shift + Enter"},{value:"ctrl-enter",label:F(i.jm?"lng_settings_send_cmdenter":"lng_settings_send_ctrlenter"),subLabel:"New line by Enter"}];(0,a.d4)((()=>{C()}),[C]),(0,a.d4)((()=>{null!=s&&s.length&&f()}),[s,f]);const L=(0,a.I4)((e=>{En.forEach(((t,n)=>{document.body.classList.toggle(`animation-level-${n}`,e===n)})),E({animationLevel:e})}),[E]),R=(0,a.I4)((e=>{document.documentElement.style.setProperty("--composer-text-size",`${Math.max(e,i.cj?16:15)}px`),document.documentElement.style.setProperty("--message-meta-height",`${Math.floor(1.3125*e)}px`),document.documentElement.style.setProperty("--message-text-size",`${e}px`),document.documentElement.setAttribute("data-message-text-size",e.toString()),E({messageTextSize:e})}),[E]),$=(0,a.I4)((e=>{S(e),w()}),[w]),B=s&&s.map((e=>{var t;return!(null==r||null===(t=r[e])||void 0===t||!t.installedDate)&&r[e]})).filter(Boolean);return(0,T.ZP)(e,n,t,o.MT.General),a.ZP.createElement("div",{className:"settings-content custom-scroll"},a.ZP.createElement("div",{className:"settings-item pt-3"},a.ZP.createElement("h4",{className:"settings-item-header",dir:F.isRtl?"rtl":void 0},F("SETTINGS")),a.ZP.createElement(mn,{label:F("TextSize"),range:{min:12,max:20},value:l,onChange:R}),a.ZP.createElement(Ee.Z,{icon:"photo",onClick:()=>t(o.MT.GeneralChatBackground)},F("ChatBackground"))),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:F.isRtl?"rtl":void 0},"Animation Level"),a.ZP.createElement("p",{className:"settings-item-description",dir:F.isRtl?"rtl":void 0},"Choose the desired animations amount."),a.ZP.createElement(mn,{options:En,value:c,onChange:L})),A&&a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:F.isRtl?"rtl":void 0},F("VoiceOver.Keyboard")),a.ZP.createElement(Je.Z,{name:"keyboard-send-settings",options:A,onChange:e=>E({messageSendKeyCombo:e}),selected:d})),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:F.isRtl?"rtl":void 0},F("AutoDownloadMedia")),a.ZP.createElement(rn.Z,{label:F("Contacts"),checked:m,onCheck:e=>E({shouldAutoDownloadMediaFromContacts:e})}),a.ZP.createElement(rn.Z,{label:F("AutodownloadPrivateChats"),checked:u,onCheck:e=>E({shouldAutoDownloadMediaInPrivateChats:e})}),a.ZP.createElement(rn.Z,{label:F("AutodownloadGroupChats"),checked:h,onCheck:e=>E({shouldAutoDownloadMediaInGroups:e})}),a.ZP.createElement(rn.Z,{label:F("FilterChannels"),checked:Z,onCheck:e=>E({shouldAutoDownloadMediaInChannels:e})})),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:F.isRtl?"rtl":void 0},F("AutoplayMedia")),a.ZP.createElement(rn.Z,{label:F("GifsTab2"),checked:P,onCheck:e=>E({shouldAutoPlayGifs:e})}),a.ZP.createElement(rn.Z,{label:F("DataAndStorage.Autoplay.Videos"),checked:g,onCheck:e=>E({shouldAutoPlayVideos:e})})),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:F.isRtl?"rtl":void 0},F("AccDescrStickers")),a.ZP.createElement(rn.Z,{label:F("SuggestStickers"),checked:v,onCheck:e=>E({shouldSuggestStickers:e})}),a.ZP.createElement(rn.Z,{label:F("LoopAnimatedStickers"),checked:p,onCheck:e=>E({shouldLoopStickers:e})}),a.ZP.createElement("div",{className:"mt-4",ref:b},B&&B.map((e=>a.ZP.createElement(vn,{key:e.id,stickerSet:e,observeIntersection:y,onClick:$})))),k&&a.ZP.createElement(pn.Z,{isOpen:I,fromSticker:k,onClose:N})))})));let fn;function bn(e="*",t,n=!1){fn||(fn=document.createElement("input"),fn.setAttribute("type","file")),fn.setAttribute("accept",e),n?fn.removeAttribute("multiple"):fn.setAttribute("multiple","multiple"),fn.onchange=null,fn.value="",fn.onchange=t,fn.click()}var yn=n(1394);function In(e){return[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)]}function wn(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 Nn([e,t,n]){e/=255,t/=255,n/=255;let a,s,r=Math.max(e,t,n),o=Math.min(e,t,n),l=r,i=r-o;if(s=0==r?0:i/r,r==o)a=0;else{switch(r){case e:a=(t-n)/i+(t.5?Math.max(0,.65*a):Math.max(0,Math.min(1,1-.65*a)),`hsla(${360*t}, ${100*n}%, ${100*a}%, .4)`}var Mn=n(9524),Tn=n(5866);const Fn=(0,a.X$)((({wallpaper:e,theme:t,isSelected:n,onClick:s})=>{var r;const{slug:i,document:c}=e,d=`wallpaper${c.id}`,m=c.previewBlobUrl,u=(0,p.Z)(`${d}?size=m`),h=(0,Tn.Z)(null===(r=c.thumbnail)||void 0===r?void 0:r.dataUri,Boolean(u),!0),{shouldRenderThumb:Z,shouldRenderFullMedia:P,transitionClassNames:g}=(0,un.Z)(u||m,"slow"),[v,C]=(0,a.eJ)(!1),{mediaData:b,downloadProgress:y}=(0,E.Z)(d,!v),I=!1===(0,f.Z)(v),{shouldRender:w,transitionClassNames:N}=(0,j.Z)(v&&!b||i===o.mp,void 0,I,"slow"),k=(0,a.sO)();k.current=t;const S=(0,a.I4)((()=>{(async()=>{const e=await(0,yn.gm)(b);await Mn.save(l.fo,k.current,e),s(i)})()}),[b,s,i]);(0,a.d4)((()=>{b&&S()}),[b,S]);const M=(0,a.I4)((()=>{b?S():C((e=>!e))}),[b,S]),T=(0,_.Z)("WallpaperTile",n&&"selected");return a.ZP.createElement("div",{className:T,onClick:M},a.ZP.createElement("div",{className:"media-inner"},Z&&a.ZP.createElement("canvas",{ref:h,className:"thumbnail"}),P&&a.ZP.createElement("img",{src:u||m,className:`full-media ${g}`,alt:""}),w&&a.ZP.createElement("div",{className:(0,_.Z)("spinner-container",N)},a.ZP.createElement(J.Z,{progress:y,onClick:M}))))})),An=(0,z.P2)((e=>e()),6e4,!0),Ln=(0,a.X$)((0,s.c$)((e=>{const t=(0,m.Pu)(e),{background:n,isBlurred:a}=e.settings.themes[t]||{},{loadedWallpapers:s}=e.settings;return{background:n,isBlurred:a,loadedWallpapers:s,theme:t}}),((e,t)=>(0,h.ei)(t,["loadWallpapers","uploadWallpaper","setThemeSettings"])))((({isActive:e,onScreenSelect:t,onReset:n,background:s,isBlurred:r,loadedWallpapers:i,theme:c,loadWallpapers:d,uploadWallpaper:m,setThemeSettings:u})=>{const h=(0,a.sO)();h.current=c,(0,a.d4)((()=>{An((()=>{d()}))}),[d]);const Z=(0,a.I4)((e=>{const{files:t}=e.target;t&&t.length>0&&m(t[0])}),[m]),P=(0,a.I4)((()=>{bn("image/jpeg",Z,!0)}),[Z]),g=(0,a.I4)((()=>{t(o.MT.GeneralChatBackgroundColor)}),[t]),v=(0,a.I4)((()=>{u({theme:c,background:void 0,backgroundColor:void 0,isBlurred:!0,patternColor:"dark"===c?l.Vv:l.g})}),[u,c]),p=(0,a.I4)((e=>{u({theme:h.current,background:e});const t=i&&i.find((t=>t.slug===e));null!=t&&t.document.thumbnail&&async function(e){const t=[0,0,0];let n,a,s,r,o=-4,l=[0,0,0],i=0;const c=document.createElement("canvas"),d=c.getContext&&c.getContext("2d");if(!d)return t;const m=await(0,yn.pt)(e);s=m.naturalHeight||m.offsetHeight||m.height,a=m.naturalWidth||m.offsetWidth||m.width,c.height=s,c.width=a,d.drawImage(m,0,0);try{n=d.getImageData(0,0,a,s)}catch(e){return t}for(r=n.data.length;(o+=20){const t=Sn(e),n=`#${wn(e)}`;u({theme:h.current,backgroundColor:n,patternColor:t})}))}),[i,u]),E=(0,a.I4)((e=>{u({theme:h.current,isBlurred:e.target.checked})}),[u]),C=(0,M.Z)();(0,T.ZP)(e,n,t,o.MT.GeneralChatBackground);const f=(null==i?void 0:i[0])&&i[0].slug===o.mp;return a.ZP.createElement("div",{className:"SettingsGeneralBackground settings-content custom-scroll"},a.ZP.createElement("div",{className:"settings-item pt-3"},a.ZP.createElement(Ee.Z,{icon:"camera-add",className:"mb-0",disabled:f,onClick:P},C("UploadImage")),a.ZP.createElement(Ee.Z,{icon:"colorize",className:"mb-0",onClick:g},C("SetColor")),a.ZP.createElement(Ee.Z,{icon:"favorite",onClick:v},C("ThemeResetToDefaults")),a.ZP.createElement(rn.Z,{label:C("BackgroundBlurred"),checked:Boolean(r),onChange:E})),i?a.ZP.createElement("div",{className:"settings-wallpapers"},i.map((e=>a.ZP.createElement(Fn,{wallpaper:e,theme:c,isSelected:s===e.slug,onClick:p})))):a.ZP.createElement(Pe.Z,null))}))),Rn=Nn(In("e6ebee")),$n=["#e6ebee","#b2cee1","#008dd0","#c6e7cb","#c4e1a6","#60b16e","#ccd0af","#a6a997","#7a7072","#fdd7af","#fdb76e","#dd8851"];function Bn(e,t){return{colorPosition:[Math.round(e[1]*(t.colorRect.width-1)),Math.round((1-e[2])*(t.colorRect.height-1))],huePosition:Math.round(e[0]*(t.hueRect.width-1))}}function Dn({colorPosition:e,huePosition:t},n){return[t/(n.hueRect.width-1),e[0]/(n.colorRect.width-1),1-e[1]/(n.colorRect.height-1)]}const Un=(0,a.X$)((0,s.c$)((e=>{const t=(0,m.Pu)(e),{backgroundColor:n}=e.settings.themes[t]||{};return{backgroundColor:n,theme:t}}),((e,t)=>(0,h.ei)(t,["setThemeSettings"])))((({isActive:e,onScreenSelect:t,onReset:n,theme:s,backgroundColor:r,setThemeSettings:l})=>{const i=(0,a.sO)();i.current=s;const c=(0,a.sO)(null),d=(0,a.sO)(null),m=(0,a.sO)(null),u=(0,a.sO)(!0),[P,g]=(0,a.eJ)(function(e){return e&&e.startsWith("#")?Nn(In(e.replace("#",""))):Rn}(r)),v=(0,a.sO)(P);(0,a.d4)((()=>{v.current=P}),[P]);const[p,E,C]=(0,Fe.Z)(),[f,b]=(0,a.eJ)(""),[y,I]=(0,a.eJ)(""),w=(0,a.sO)(),N=(0,a.sO)();(0,a.d4)((()=>{const e={offsetLeft:d.current.offsetLeft,...(0,h.ei)(d.current.getBoundingClientRect(),["top","width","height"])},t={offsetLeft:m.current.offsetLeft,...(0,h.ei)(m.current.getBoundingClientRect(),["width"])};function n(t){const n=[Math.min(Math.max(0,t.pageX-e.offsetLeft),e.width-1),Math.min(Math.max(0,t.pageY-e.top+c.current.scrollTop),e.height-1)],{huePosition:a}=Bn(v.current,w.current);return g(Dn({colorPosition:n,huePosition:a},w.current)),E(),!0}function a(e){const{colorPosition:n}=Bn(v.current,w.current),a=Math.min(Math.max(0,e.pageX-t.offsetLeft),t.width-1);return g(Dn({colorPosition:n,huePosition:a},w.current)),E(),!0}w.current={colorRect:e,hueRect:t},(0,Z.s)(d.current,{onCapture:n,onDrag:n,onRelease:C,onClick:C,selectorToPreventScroll:".SettingsGeneralBackgroundColor",withCursor:!0}),(0,Z.s)(m.current,{onCapture:a,onDrag:a,onRelease:C,onClick:C,selectorToPreventScroll:".SettingsGeneralBackgroundColor",withCursor:!0})}),[E,C]);const{colorPosition:k=[0,0],huePosition:S=0}=w.current?Bn(P,w.current):{},M=wn(kn(P)),F=P[0],A=wn(kn([F,1,1]));(0,a.d4)((()=>{const e=kn(P),t=`#${wn(e)}`;if(b(e.join(", ")),I(t),!u.current){const n=Sn(e);l({theme:i.current,background:void 0,backgroundColor:t,patternColor:n})}u.current=!1}),[P,l]),(0,a.d4)((()=>{!function(e,t,n,a){let s,r,o;n.current&&a.current?(s=a.current.colorRect.width,r=a.current.colorRect.height,o=n.current):(s=e.offsetWidth,r=e.offsetHeight,o=e.getContext("2d"),e.width=s,e.height=r,n.current=o);const l=o.createImageData(s,r),i=l.data,c=kn([t,1,1]);let d=0;for(let e=0;e{!function(e){const t=e.offsetWidth;e.width=t,e.height=1;const n=e.getContext("2d"),a=n.createImageData(t,1),s=a.data;let r=0;for(let e=0;e{const t=e.currentTarget.value.replace(/[^\d, ]/g,"").slice(0,13);if(t.match(/^\d{1,3},\s?\d{1,3},\s?\d{1,3}$/)){const e=t.split(",").map((e=>Number(e.trim())));g(Nn(e))}e.currentTarget.value=t}),[]),R=(0,a.I4)((e=>{const t=e.currentTarget.value.replace(/[^0-9a-fA-F]/g,"").slice(0,6);t.match(/^#?[0-9a-fA-F]{6}$/)&&g(Nn(In(t.replace("#","")))),e.currentTarget.value=t}),[]),$=(0,a.I4)((e=>{g(Nn(In(e.currentTarget.dataset.color.replace("#",""))))}),[]),B=(0,_.Z)("SettingsGeneralBackgroundColor settings-content custom-scroll",p&&"is-dragging");return(0,T.ZP)(e,n,t,o.MT.GeneralChatBackgroundColor),a.ZP.createElement("div",{ref:c,className:B},a.ZP.createElement("div",{className:"settings-item pt-3"},a.ZP.createElement("div",{ref:d,className:"color-picker"},a.ZP.createElement("canvas",null),a.ZP.createElement("div",{className:"handle",style:`transform: translate(${k[0]}px, ${k[1]}px); background-color: #${M};`})),a.ZP.createElement("div",{ref:m,className:"hue-picker"},a.ZP.createElement("canvas",null),a.ZP.createElement("div",{className:"handle",style:`transform: translateX(${S}px); background-color: #${A};`})),a.ZP.createElement("div",{className:"tools"},a.ZP.createElement(ve.Z,{value:y,label:"HEX",onChange:R}),a.ZP.createElement(ve.Z,{value:f,label:"RGB",onChange:L}))),a.ZP.createElement("div",{className:"predefined-colors"},$n.map((e=>a.ZP.createElement("div",{className:e===`#${M}`?"active":void 0,"data-color":e,style:`background-color: ${e};`,onClick:$})))))}))),xn=(0,a.X$)((0,s.c$)((e=>({hasPrivateChatsNotifications:Boolean(e.settings.byKey.hasPrivateChatsNotifications),hasPrivateChatsMessagePreview:Boolean(e.settings.byKey.hasPrivateChatsMessagePreview),hasGroupNotifications:Boolean(e.settings.byKey.hasGroupNotifications),hasGroupMessagePreview:Boolean(e.settings.byKey.hasGroupMessagePreview),hasBroadcastNotifications:Boolean(e.settings.byKey.hasBroadcastNotifications),hasBroadcastMessagePreview:Boolean(e.settings.byKey.hasBroadcastMessagePreview),hasContactJoinedNotifications:Boolean(e.settings.byKey.hasContactJoinedNotifications),hasWebNotifications:e.settings.byKey.hasWebNotifications,hasPushNotifications:e.settings.byKey.hasPushNotifications,notificationSoundVolume:e.settings.byKey.notificationSoundVolume})),((e,t)=>(0,h.ei)(t,["loadNotificationSettings","updateContactSignUpNotification","updateNotificationSettings","updateWebNotificationSettings"])))((({isActive:e,onScreenSelect:t,onReset:n,hasPrivateChatsNotifications:s,hasPrivateChatsMessagePreview:r,hasGroupNotifications:l,hasGroupMessagePreview:i,hasBroadcastNotifications:c,hasBroadcastMessagePreview:d,hasContactJoinedNotifications:m,hasPushNotifications:u,hasWebNotifications:h,notificationSoundVolume:Z,loadNotificationSettings:P,updateContactSignUpNotification:g,updateNotificationSettings:v,updateWebNotificationSettings:p})=>{(0,a.d4)((()=>{P()}),[P]);const E=(0,a.I4)(((e,t,n)=>{const a="contact"===t?!s:!("group"===t?l:c),o="contact"===t?r:"group"===t?i:d;v({peerType:t,..."silent"===n&&{isSilent:!e.target.checked,shouldShowPreviews:o},..."showPreviews"===n&&{shouldShowPreviews:e.target.checked,isSilent:a}})}),[d,c,i,l,r,s,v]),C=(0,a.I4)((e=>{g({isSilent:!e.target.checked})}),[g]),f=(0,M.Z)();return(0,T.ZP)(e,n,t,o.MT.Notifications),a.ZP.createElement("div",{className:"settings-content custom-scroll"},a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:f.isRtl?"rtl":void 0},"Web notifications"),a.ZP.createElement(rn.Z,{label:"Web notifications",subLabel:f(h?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:h,onChange:e=>{p({hasWebNotifications:e.target.checked})}}),a.ZP.createElement(rn.Z,{label:"Offline notifications",disabled:!h,subLabel:f(u?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:u,onChange:e=>{p({hasPushNotifications:e.target.checked})}}),a.ZP.createElement("div",{className:"settings-item-slider"},a.ZP.createElement(mn,{label:"Sound",disabled:!h,range:{min:0,max:10},value:Z,onChange:e=>{p({notificationSoundVolume:e})}}))),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:f.isRtl?"rtl":void 0},f("AutodownloadPrivateChats")),a.ZP.createElement(rn.Z,{label:f("NotificationsForPrivateChats"),subLabel:f(s?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:s,onChange:e=>{E(e,"contact","silent")}}),a.ZP.createElement(rn.Z,{label:f("MessagePreview"),disabled:!s,subLabel:f(r?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:r,onChange:e=>{E(e,"contact","showPreviews")}})),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:f.isRtl?"rtl":void 0},f("FilterGroups")),a.ZP.createElement(rn.Z,{label:f("NotificationsForGroups"),subLabel:f(l?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:l,onChange:e=>{E(e,"group","silent")}}),a.ZP.createElement(rn.Z,{label:f("MessagePreview"),disabled:!l,subLabel:f(i?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:i,onChange:e=>{E(e,"group","showPreviews")}})),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:f.isRtl?"rtl":void 0},f("FilterChannels")),a.ZP.createElement(rn.Z,{label:f("NotificationsForChannels"),subLabel:f(c?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:c,onChange:e=>{E(e,"broadcast","silent")}}),a.ZP.createElement(rn.Z,{label:f("MessagePreview"),disabled:!c,subLabel:f(d?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:d,onChange:e=>{E(e,"broadcast","showPreviews")}})),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:f.isRtl?"rtl":void 0},f("PhoneOther")),a.ZP.createElement(rn.Z,{label:f("ContactJoined"),checked:m,onChange:C})))}))),On=(0,a.X$)((0,s.c$)((e=>{var t,n,a,s,r;const{settings:{byKey:{hasPassword:o,isSensitiveEnabled:l,canChangeSensitive:i},privacy:c},blocked:d,activeSessions:m}=e;return{hasPassword:o,blockedCount:d.totalCount,sessionsCount:m.length,isSensitiveEnabled:l,canChangeSensitive:i,visibilityPrivacyPhoneNumber:null===(t=c.phoneNumber)||void 0===t?void 0:t.visibility,visibilityPrivacyLastSeen:null===(n=c.lastSeen)||void 0===n?void 0:n.visibility,visibilityPrivacyProfilePhoto:null===(a=c.profilePhoto)||void 0===a?void 0:a.visibility,visibilityPrivacyForwarding:null===(s=c.forwards)||void 0===s?void 0:s.visibility,visibilityPrivacyGroupChats:null===(r=c.chatInvite)||void 0===r?void 0:r.visibility}}),((e,t)=>(0,h.ei)(t,["loadBlockedContacts","loadAuthorizations","loadPrivacySettings","loadContentSettings","updateContentSettings"])))((({isActive:e,onScreenSelect:t,onReset:n,hasPassword:s,blockedCount:r,sessionsCount:l,isSensitiveEnabled:i,canChangeSensitive:c,visibilityPrivacyPhoneNumber:d,visibilityPrivacyLastSeen:m,visibilityPrivacyProfilePhoto:u,visibilityPrivacyForwarding:h,visibilityPrivacyGroupChats:Z,loadPrivacySettings:P,loadBlockedContacts:g,loadAuthorizations:v,loadContentSettings:p,updateContentSettings:E})=>{(0,a.d4)((()=>{g(),v(),P(),p()}),[g,v,P,p]);const C=(0,M.Z)();function f(e){switch(e){case"everybody":return C("P2PEverybody");case"contacts":return C("P2PContacts");case"nobody":return C("P2PNobody")}}return(0,T.ZP)(e,n,t,o.MT.Privacy),a.ZP.createElement("div",{className:"settings-content custom-scroll"},a.ZP.createElement("div",{className:"settings-item pt-3"},a.ZP.createElement(Ee.Z,{icon:"delete-user",narrow:!0,onClick:()=>t(o.MT.PrivacyBlockedUsers)},a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("span",{className:"title"},C("BlockedUsers")),r>0&&a.ZP.createElement("span",{className:"subtitle",dir:"auto"},C("Users",r)))),a.ZP.createElement(Ee.Z,{icon:"lock",narrow:!0,onClick:()=>t(s?o.MT.TwoFaEnabled:o.MT.TwoFaDisabled)},a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("span",{className:"title"},C("TwoStepVerification")),a.ZP.createElement("span",{className:"subtitle",dir:"auto"},C(s?"PasswordOn":"PasswordOff")))),a.ZP.createElement(Ee.Z,{icon:"active-sessions",narrow:!0,onClick:()=>t(o.MT.PrivacyActiveSessions)},a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("span",{className:"title"},C("SessionsTitle")),l>0&&a.ZP.createElement("span",{className:"subtitle",dir:"auto"},1===l?"1 session":`${l} sessions`)))),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header mb-4",dir:C.isRtl?"rtl":void 0},C("PrivacyTitle")),a.ZP.createElement(Ee.Z,{narrow:!0,className:"no-icon",onClick:()=>t(o.MT.PrivacyPhoneNumber)},a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("span",{className:"title"},C("PrivacyPhoneTitle")),a.ZP.createElement("span",{className:"subtitle",dir:"auto"},f(d)))),a.ZP.createElement(Ee.Z,{narrow:!0,className:"no-icon",onClick:()=>t(o.MT.PrivacyLastSeen)},a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("span",{className:"title"},C("LastSeenTitle")),a.ZP.createElement("span",{className:"subtitle",dir:"auto"},f(m)))),a.ZP.createElement(Ee.Z,{narrow:!0,className:"no-icon",onClick:()=>t(o.MT.PrivacyProfilePhoto)},a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("span",{className:"title"},C("PrivacyProfilePhotoTitle")),a.ZP.createElement("span",{className:"subtitle",dir:"auto"},f(u)))),a.ZP.createElement(Ee.Z,{narrow:!0,className:"no-icon",onClick:()=>t(o.MT.PrivacyForwarding)},a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("span",{className:"title"},C("PrivacyForwardsTitle")),a.ZP.createElement("span",{className:"subtitle",dir:"auto"},f(h)))),a.ZP.createElement(Ee.Z,{narrow:!0,className:"no-icon",onClick:()=>t(o.MT.PrivacyGroupChats)},a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("span",{className:"title"},C("WhoCanAddMe")),a.ZP.createElement("span",{className:"subtitle",dir:"auto"},f(Z))))),c&&a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:C.isRtl?"rtl":void 0},C("lng_settings_sensitive_title")),a.ZP.createElement(rn.Z,{label:C("lng_settings_sensitive_disable_filtering"),subLabel:C("lng_settings_sensitive_about"),checked:Boolean(i),disabled:!c,onCheck:E})))})));var Gn=n(663);const Jn=(0,a.X$)((0,s.c$)((e=>({languages:e.settings.byKey.languages,language:e.settings.byKey.language})),((e,t)=>(0,h.ei)(t,["loadLanguages","setSettingOption"])))((({isActive:e,onScreenSelect:t,onReset:n,languages:s,language:r,loadLanguages:l,setSettingOption:i})=>{const[c,d]=(0,a.eJ)(r),[m,u,h]=(0,Fe.Z)();(0,a.d4)((()=>{l()}),[l]);const Z=(0,a.I4)((e=>{d(e),u(),(0,Gn.m0)(e,(()=>{h(),i({language:e})}))}),[u,h,i]),P=(0,a.Ye)((()=>s?function(e){const t=(window.navigator.language||"en").toLowerCase(),n=t.substr(0,2);return e.map((({langCode:e,nativeName:t,name:n})=>({value:e,label:t,subLabel:n}))).sort((e=>!t||e.value!==t&&e.value!==n?0:-1))}(s):void 0),[s]);return(0,T.ZP)(e,n,t,o.MT.Language),a.ZP.createElement("div",{className:"settings-content settings-item settings-language custom-scroll"},P?a.ZP.createElement(Je.Z,{name:"keyboard-send-settings",options:P,selected:c,loadingOption:m?c:void 0,onChange:Z}):a.ZP.createElement(Pe.Z,null))})));function Xn(e){switch(e){case o.MT.PrivacyPhoneNumber:case o.MT.PrivacyPhoneNumberAllowedContacts:case o.MT.PrivacyPhoneNumberDeniedContacts:return"phoneNumber";case o.MT.PrivacyLastSeen:case o.MT.PrivacyLastSeenAllowedContacts:case o.MT.PrivacyLastSeenDeniedContacts:return"lastSeen";case o.MT.PrivacyProfilePhoto:case o.MT.PrivacyProfilePhotoAllowedContacts:case o.MT.PrivacyProfilePhotoDeniedContacts:return"profilePhoto";case o.MT.PrivacyForwarding:case o.MT.PrivacyForwardingAllowedContacts:case o.MT.PrivacyForwardingDeniedContacts:return"forwards";case o.MT.PrivacyGroupChats:case o.MT.PrivacyGroupChatsAllowedContacts:case o.MT.PrivacyGroupChatsDeniedContacts:return"chatInvite"}}const zn=(0,a.X$)((0,s.c$)(((e,{screen:t})=>{let n;const{chats:{byId:a},settings:{privacy:s}}=e;switch(t){case o.MT.PrivacyPhoneNumber:n=s.phoneNumber;break;case o.MT.PrivacyLastSeen:n=s.lastSeen;break;case o.MT.PrivacyProfilePhoto:n=s.profilePhoto;break;case o.MT.PrivacyForwarding:n=s.forwards;break;case o.MT.PrivacyGroupChats:n=s.chatInvite}return n?{...n,chatsById:a}:{}}),((e,t)=>(0,h.ei)(t,["setPrivacyVisibility"])))((({screen:e,isActive:t,onScreenSelect:n,onReset:s,visibility:r,allowUserIds:l,allowChatIds:i,blockUserIds:c,blockChatIds:d,chatsById:m,setPrivacyVisibility:u})=>{const h=(0,M.Z)(),Z=(0,a.Ye)((()=>{switch(e){case o.MT.PrivacyProfilePhoto:case o.MT.PrivacyGroupChats:return[{value:"everybody",label:h("P2PEverybody")},{value:"contacts",label:h("P2PContacts")}];default:return[{value:"everybody",label:h("P2PEverybody")},{value:"contacts",label:h("P2PContacts")},{value:"nobody",label:h("P2PNobody")}]}}),[h,e]),P={shouldShowDenied:"nobody"!==r,shouldShowAllowed:"everybody"!==r},g=Xn(e),v=(0,a.Ye)((()=>{switch(e){case o.MT.PrivacyPhoneNumber:return h("PrivacyPhoneTitle");case o.MT.PrivacyLastSeen:return h("LastSeenTitle");case o.MT.PrivacyProfilePhoto:return h("PrivacyProfilePhotoTitle");case o.MT.PrivacyForwarding:return h("PrivacyForwardsTitle");case o.MT.PrivacyGroupChats:return h("WhoCanAddMe");default:return}}),[h,e]);(0,T.ZP)(t,s,n,e);const p=(0,a.Ye)((()=>{switch(e){case o.MT.PrivacyLastSeen:return h("CustomHelp");default:return}}),[h,e]),E=(()=>{switch(e){case o.MT.PrivacyPhoneNumber:return o.MT.PrivacyPhoneNumberAllowedContacts;case o.MT.PrivacyLastSeen:return o.MT.PrivacyLastSeenAllowedContacts;case o.MT.PrivacyProfilePhoto:return o.MT.PrivacyProfilePhotoAllowedContacts;case o.MT.PrivacyForwarding:return o.MT.PrivacyForwardingAllowedContacts;default:return o.MT.PrivacyGroupChatsAllowedContacts}})(),C=(()=>{switch(e){case o.MT.PrivacyPhoneNumber:return o.MT.PrivacyPhoneNumberDeniedContacts;case o.MT.PrivacyLastSeen:return o.MT.PrivacyLastSeenDeniedContacts;case o.MT.PrivacyProfilePhoto:return o.MT.PrivacyProfilePhotoDeniedContacts;case o.MT.PrivacyForwarding:return o.MT.PrivacyForwardingDeniedContacts;default:return o.MT.PrivacyGroupChatsDeniedContacts}})(),f=(0,a.Ye)((()=>l&&i&&m?i.reduce(((e,t)=>e+(m[t]?m[t].membersCount:0)),l.length):0),[i,l,m]),b=(0,a.Ye)((()=>c&&d&&m?d.reduce(((e,t)=>e+(m[t]?m[t].membersCount:0)),c.length):0),[d,c,m]),y=(0,a.I4)((e=>{u({privacyKey:g,visibility:e})}),[g,u]);return a.ZP.createElement("div",{className:"settings-content custom-scroll"},a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:h.isRtl?"rtl":void 0},v),a.ZP.createElement(Je.Z,{name:`visibility-${g}`,options:Z,onChange:y,selected:r}),p&&a.ZP.createElement("p",{className:"settings-item-description-larger",dir:h.isRtl?"rtl":void 0},p)),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header mb-4",dir:h.isRtl?"rtl":void 0},h("PrivacyExceptions")),P.shouldShowAllowed&&a.ZP.createElement(Ee.Z,{narrow:!0,icon:"add-user",onClick:()=>{n(E)}},a.ZP.createElement("div",{className:"multiline-menu-item full-size"},f>0&&a.ZP.createElement("span",{className:"date",dir:"auto"},"+",f),a.ZP.createElement("span",{className:"title"},h("AlwaysShareWith")),a.ZP.createElement("span",{className:"subtitle"},h("EditAdminAddUsers")))),P.shouldShowDenied&&a.ZP.createElement(Ee.Z,{narrow:!0,icon:"delete-user",onClick:()=>{n(C)}},a.ZP.createElement("div",{className:"multiline-menu-item full-size"},b>0&&a.ZP.createElement("span",{className:"date",dir:"auto"},"−",b),a.ZP.createElement("span",{className:"title"},h("NeverShareWith")),a.ZP.createElement("span",{className:"subtitle"},h("EditAdminAddUsers"))))))})));function _n(e){return[e.region,e.country].filter(Boolean).join(", ")}function Yn(e){return`${e.deviceModel}${e.deviceModel?", ":""} ${e.platform} ${e.systemVersion}`}const jn=(0,a.X$)((0,s.c$)((e=>({activeSessions:e.activeSessions})),((e,t)=>(0,h.ei)(t,["loadAuthorizations","terminateAuthorization","terminateAllAuthorizations"])))((({isActive:e,onScreenSelect:t,onReset:n,activeSessions:s,loadAuthorizations:r,terminateAuthorization:l,terminateAllAuthorizations:i})=>{const[c,d,m]=(0,Fe.Z)();(0,a.d4)((()=>{r()}),[r]);const u=(0,a.I4)((e=>{l({hash:e})}),[l]),h=(0,a.I4)((()=>{m(),i()}),[m,i]),Z=(0,a.Ye)((()=>s.find((e=>e.isCurrent))),[s]),P=(0,a.Ye)((()=>s.filter((e=>!e.isCurrent))),[s]),g=(0,M.Z)();return(0,T.ZP)(e,n,t,o.MT.PrivacyActiveSessions),a.ZP.createElement("div",{className:"settings-content custom-scroll"},Z&&(p=Z,a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header mb-4",dir:g.isRtl?"rtl":void 0},g("AuthSessions.CurrentSession")),a.ZP.createElement(Ee.Z,{narrow:!0,inactive:!0,className:"no-icon"},a.ZP.createElement("div",{className:"multiline-menu-item",dir:"auto"},a.ZP.createElement("span",{className:"title",dir:"auto"},p.appName),a.ZP.createElement("span",{className:"subtitle black tight"},Yn(p)),a.ZP.createElement("span",{className:"subtitle"},p.ip," - ",_n(p)))),a.ZP.createElement(Ee.Z,{className:"destructive mb-0 no-icon",icon:"stop",ripple:!0,narrow:!0,onClick:d},g("TerminateAllSessions")))),P&&(v=P,a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header mb-4",dir:g.isRtl?"rtl":void 0},g("OtherSessions")),v.map((function(e){return a.ZP.createElement(Ee.Z,{key:e.hash,ripple:!0,narrow:!0,contextActions:[{title:"Terminate",icon:"stop",handler:()=>{u(e.hash)}}],className:"no-icon"},a.ZP.createElement("div",{className:"multiline-menu-item full-size",dir:"auto"},a.ZP.createElement("span",{className:"date"},(0,$.VX)(g,1e3*e.dateActive)),a.ZP.createElement("span",{className:"title"},e.appName),a.ZP.createElement("span",{className:"subtitle black tight"},Yn(e)),a.ZP.createElement("span",{className:"subtitle"},e.ip," - ",_n(e))))})))),P&&a.ZP.createElement(Me.Z,{isOpen:c,onClose:m,text:"Are you sure you want to terminate all other sessions?",confirmLabel:"Terminate All Other Sessions",confirmHandler:h,confirmIsDestructive:!0}));var v,p})));var Hn=n(2969);const Vn=(0,a.X$)((0,s.c$)((e=>{const{chats:{byId:t},users:{byId:n},blocked:{ids:a}}=e;return{chatsByIds:t,usersByIds:n,blockedIds:a}}),((e,t)=>(0,h.ei)(t,["unblockContact"])))((({isActive:e,onScreenSelect:t,onReset:n,chatsByIds:s,usersByIds:r,blockedIds:i,unblockContact:c})=>{const d=(0,a.I4)((e=>{c({contactId:e})}),[c]),m=(0,M.Z)();return(0,T.ZP)(e,n,t,o.MT.PrivacyBlockedUsers),a.ZP.createElement("div",{className:"settings-fab-wrapper"},a.ZP.createElement("div",{className:"settings-content infinite-scroll"},a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("p",{className:"settings-item-description-larger mt-0 mb-2",dir:m.isRtl?"rtl":void 0},m("BlockedUsersInfo"))),a.ZP.createElement("div",{className:"chat-list custom-scroll"},null!=i&&i.length?a.ZP.createElement("div",{className:"scroll-container"},i.map(((e,t)=>function(e,t,n){const o=(0,u.YA)(e),i=o?r[e]:void 0,c=o?void 0:s[e],h=(0,_.Z)("Chat chat-item-clickable blocked-list-item small-icon",o?"private":"group");return a.ZP.createElement(Ee.Z,{key:e,className:h,ripple:!0,narrow:!0,contextActions:[{title:"Unblock",icon:"unlock",handler:()=>{d(e)}}],style:`top: ${(0+t)*l.rS}px;`},a.ZP.createElement(D.Z,{size:"medium",user:i,chat:c}),a.ZP.createElement("div",{className:"contact-info",dir:"auto"},a.ZP.createElement("h3",{dir:"auto"},(0,B.Z)((o?(0,u.Js)(i):(0,u.U)(m,c))||"")),(null==i?void 0:i.phoneNumber)&&a.ZP.createElement("div",{className:"contact-phone",dir:"auto"},(0,Hn.WZ)(i.phoneNumber)),i&&!i.phoneNumber&&i.username&&a.ZP.createElement("div",{className:"contact-username",dir:"auto"},"@",i.username)))}(e,t)))):i&&!i.length?a.ZP.createElement("div",{className:"no-results",dir:"auto"},"List is empty"):a.ZP.createElement(Pe.Z,{key:"loading"}))),a.ZP.createElement(Ot.Z,{isShown:!0,onClick:()=>{},className:"not-implemented",ariaLabel:"Add a blocked user"},a.ZP.createElement("i",{className:"icon-add"})))})));var qn=n(7854);const Kn=(0,a.X$)((0,s.c$)((e=>({animatedEmoji:(0,m.zB)(e,"🔐")})))((({isActive:e,onReset:t,animatedEmoji:n,onScreenSelect:s})=>{const r=(0,M.Z)();return(0,T.ZP)(e,t,s,o.MT.TwoFaEnabled),a.ZP.createElement("div",{className:"settings-content two-fa custom-scroll"},a.ZP.createElement("div",{className:"settings-content-header"},a.ZP.createElement(qn.Z,{sticker:n,size:"large"}),a.ZP.createElement("p",{className:"settings-item-description mb-3",dir:"auto"},(0,B.Z)(r("EnabledPasswordText"),["br"]))),a.ZP.createElement("div",{className:"settings-item pt-0 no-border"},a.ZP.createElement(Ee.Z,{icon:"edit",onClick:()=>s(o.MT.TwoFaChangePasswordCurrent)},r("ChangePassword")),a.ZP.createElement(Ee.Z,{icon:"password-off",onClick:()=>s(o.MT.TwoFaTurnOff)},r("TurnPasswordOff")),a.ZP.createElement(Ee.Z,{icon:"email",onClick:()=>s(o.MT.TwoFaRecoveryEmailCurrentPassword)},r("SetRecoveryEmail"))))})));var Wn=n(3490),Qn=n(9364);const ea=(0,a.X$)((({screen:e,isActive:t,onScreenSelect:n,onReset:s,error:r,isLoading:o,expectedPassword:l,placeholder:i="Current Password",hint:c,submitLabel:d,clearError:m,onSubmit:u})=>{const[h,Z]=(0,a.eJ)(""),[P,g]=(0,a.eJ)(!1),v=(0,a.I4)((e=>{l&&e!==l?Z("Passwords Should Be Equal"):u(e)}),[u,l]),p=(0,a.I4)((()=>{m&&m(),Z("")}),[m]),E=(0,M.Z)();return(0,T.ZP)(t,s,n,e),a.ZP.createElement("div",{className:"settings-content two-fa custom-scroll"},a.ZP.createElement("div",{className:"settings-content-header"},a.ZP.createElement(Wn.Z,{isBig:!0,isPasswordVisible:P})),a.ZP.createElement("div",{className:"settings-item pt-0 no-border"},a.ZP.createElement(Qn.Z,{error:h||r,hint:c,placeholder:i,submitLabel:d||E("Next"),clearError:p,isLoading:o,isPasswordVisible:P,onChangePasswordVisibility:g,onSubmit:v})))})),ta=(0,a.X$)((0,s.c$)((e=>({animatedEmoji:(0,m.zB)(e,"🔐")})))((({isActive:e,onScreenSelect:t,onReset:n,animatedEmoji:s,onStart:r})=>{const l=(0,M.Z)();return(0,T.ZP)(e,n,t,o.MT.TwoFaDisabled),a.ZP.createElement("div",{className:"settings-content two-fa custom-scroll"},a.ZP.createElement("div",{className:"settings-content-header"},a.ZP.createElement(qn.Z,{sticker:s,size:"large"}),a.ZP.createElement("p",{className:"settings-item-description mb-3",dir:"auto"},l("SetAdditionalPasswordInfo"))),a.ZP.createElement("div",{className:"settings-item pt-0 no-border"},a.ZP.createElement(R.Z,{onClick:r},l("EditAdminTransferSetPassword"))))}))),na=i.wB?550:400,aa=(0,a.X$)((0,s.c$)(((e,{icon:t})=>({animatedEmoji:(0,m.zB)(e,"email"===t?"💌":"💡")})))((({animatedEmoji:e,type:t="text",isLoading:n,error:s,placeholder:r,shouldConfirm:o,clearError:l,onSubmit:c,isActive:d,onScreenSelect:m,onReset:u,screen:h})=>{const Z=(0,a.sO)(null),[P,g]=(0,a.eJ)(""),[v,p,E]=(0,Fe.Z)(!1);(0,a.d4)((()=>{i.$b||setTimeout((()=>{Z.current.focus()}),na)}),[]);const C=(0,M.Z)();return(0,T.ZP)(d,u,m,h),a.ZP.createElement("div",{className:"settings-content two-fa custom-scroll"},a.ZP.createElement("div",{className:"settings-content-header"},a.ZP.createElement(qn.Z,{sticker:e,size:"large"})),a.ZP.createElement("div",{className:"settings-item pt-0 no-border"},a.ZP.createElement("form",{action:"",onSubmit:e=>{e.preventDefault(),Z.current&&c(P)}},a.ZP.createElement(ve.Z,{ref:Z,value:P,inputMode:t,label:r,error:s,onChange:e=>{s&&l&&l(),g(e.target.value)}}),P?a.ZP.createElement(R.Z,{type:"submit",isLoading:n,ripple:!0},C("Continue")):a.ZP.createElement(R.Z,{isText:!0,isLoading:n,ripple:!0,onClick:o?p:()=>{c()}},C("YourEmailSkip"))),o&&a.ZP.createElement(ge.Z,{className:"narrow",isOpen:v,title:C("YourEmailSkipWarning"),onClose:E},(0,B.Z)(C("YourEmailSkipWarningText"),["br","simple_markdown"]),a.ZP.createElement("div",{className:"dialog-buttons"},a.ZP.createElement(R.Z,{color:"danger",ripple:!0,isText:!0,className:"confirm-dialog-button",onClick:()=>{E(),c()}},C("YourEmailSkip")),a.ZP.createElement(R.Z,{color:"primary",ripple:!0,isText:!0,className:"confirm-dialog-button",onClick:E},C("Cancel"))))))}))),sa=(0,a.X$)((0,s.c$)((e=>({animatedEmoji:(0,m.zB)(e,"🥳")})))((({isActive:e,onReset:t,animatedEmoji:n,onScreenSelect:s})=>{const r=(0,M.Z)();return(0,T.ZP)(e,t,s,o.MT.TwoFaCongratulations),a.ZP.createElement("div",{className:"settings-content two-fa custom-scroll"},a.ZP.createElement("div",{className:"settings-content-header"},a.ZP.createElement(qn.Z,{sticker:n,size:"large"}),a.ZP.createElement("p",{className:"settings-item-description mb-3",dir:"auto"},r("TwoStepVerificationPasswordSetInfo"))),a.ZP.createElement("div",{className:"settings-item pt-0 no-border"},a.ZP.createElement(R.Z,{onClick:()=>{s(o.MT.Privacy)}},r("TwoStepVerificationPasswordReturnSettings"))))}))),ra=i.wB?550:400,oa=(0,a.X$)((0,s.c$)((e=>({animatedEmoji:(0,m.zB)(e,"💌"),codeLength:e.twoFaSettings.waitingEmailCodeLength})))((({animatedEmoji:e,codeLength:t,isLoading:n,error:s,clearError:r,onSubmit:o,isActive:l,onScreenSelect:c,onReset:d,screen:m})=>{const u=(0,a.sO)(null),[h,Z]=(0,a.eJ)("");(0,a.d4)((()=>{i.$b||setTimeout((()=>{u.current.focus()}),ra)}),[]);const P=(0,M.Z)();return(0,T.ZP)(l,d,c,m),a.ZP.createElement("div",{className:"settings-content two-fa custom-scroll"},a.ZP.createElement("div",{className:"settings-content-header"},a.ZP.createElement(qn.Z,{sticker:e,size:"large"})),a.ZP.createElement("div",{className:"settings-item pt-0 no-border"},a.ZP.createElement(ve.Z,{value:h,ref:u,inputMode:"decimal",label:P("YourEmailCode"),error:s,onChange:e=>{s&&r&&r();const n=e.target.value.slice(0,t);n.length===t&&o(n),Z(n),e.target.value=n}}),n&&a.ZP.createElement(Pe.Z,null)))}))),la=(0,a.X$)((0,s.c$)((e=>({...e.twoFaSettings})),((e,t)=>(0,h.ei)(t,["updatePassword","updateRecoveryEmail","clearPassword","provideTwoFaEmailCode","checkPassword","clearTwoFaError"])))((({currentScreen:e,shownScreen:t,state:n,hint:s,isLoading:r,error:l,waitingEmailCodeLength:i,dispatch:c,isActive:d,onScreenSelect:m,onReset:u,updatePassword:h,checkPassword:Z,clearTwoFaError:P,updateRecoveryEmail:g,provideTwoFaEmailCode:v,clearPassword:p})=>{(0,a.d4)((()=>{i&&(e===o.MT.TwoFaNewPasswordEmail?m(o.MT.TwoFaNewPasswordEmailCode):e===o.MT.TwoFaRecoveryEmail&&m(o.MT.TwoFaRecoveryEmailCode))}),[e,m,i]);const E=(0,a.I4)((()=>{c({type:"reset"}),m(o.MT.TwoFaNewPassword)}),[c,m]),C=(0,a.I4)((e=>{c({type:"setPassword",payload:e}),m(o.MT.TwoFaNewPasswordConfirm)}),[c,m]),f=(0,a.I4)((()=>{m(o.MT.TwoFaNewPasswordHint)}),[m]),b=(0,a.I4)((e=>{c({type:"setHint",payload:e}),m(o.MT.TwoFaNewPasswordEmail)}),[c,m]),y=(0,a.I4)((e=>{c({type:"setEmail",payload:e}),h({...n,email:e,onSuccess:()=>{m(o.MT.TwoFaCongratulations)}})}),[c,m,n,h]),I=(0,a.I4)((e=>{c({type:"setCurrentPassword",payload:e}),Z({currentPassword:e,onSuccess:()=>{m(o.MT.TwoFaChangePasswordNew)}})}),[Z,c,m]),w=(0,a.I4)((e=>{c({type:"setPassword",payload:e}),m(o.MT.TwoFaChangePasswordConfirm)}),[c,m]),N=(0,a.I4)((()=>{m(o.MT.TwoFaChangePasswordHint)}),[m]),k=(0,a.I4)((e=>{c({type:"setHint",payload:e}),h({...n,hint:e,onSuccess:()=>{m(o.MT.TwoFaCongratulations)}})}),[c,m,n,h]),S=(0,a.I4)((e=>{p({currentPassword:e,onSuccess:()=>{m(o.MT.Privacy)}})}),[p,m]),T=(0,a.I4)((e=>{c({type:"setCurrentPassword",payload:e}),Z({currentPassword:e,onSuccess:()=>{m(o.MT.TwoFaRecoveryEmail)}})}),[Z,c,m]),F=(0,a.I4)((e=>{c({type:"setEmail",payload:e}),g({...n,email:e,onSuccess:()=>{m(o.MT.TwoFaCongratulations)}})}),[c,m,n,g]),A=(0,a.I4)((e=>{v({code:e})}),[v]),L=(0,M.Z)();switch(e){case o.MT.TwoFaDisabled:return a.ZP.createElement(ta,{onStart:E,onScreenSelect:m,isActive:d||[o.MT.TwoFaNewPassword,o.MT.TwoFaNewPasswordConfirm,o.MT.TwoFaNewPasswordHint,o.MT.TwoFaNewPasswordEmail,o.MT.TwoFaNewPasswordEmailCode,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaNewPassword:return a.ZP.createElement(ea,{screen:e,placeholder:L("PleaseEnterPassword"),submitLabel:L("Continue"),onSubmit:C,onScreenSelect:m,isActive:d||[o.MT.TwoFaNewPasswordConfirm,o.MT.TwoFaNewPasswordHint,o.MT.TwoFaNewPasswordEmail,o.MT.TwoFaNewPasswordEmailCode,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaNewPasswordConfirm:return a.ZP.createElement(ea,{screen:e,expectedPassword:n.password,placeholder:L("PleaseReEnterPassword"),submitLabel:L("Continue"),onSubmit:f,onScreenSelect:m,isActive:d||[o.MT.TwoFaNewPasswordHint,o.MT.TwoFaNewPasswordEmail,o.MT.TwoFaNewPasswordEmailCode,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaNewPasswordHint:return a.ZP.createElement(aa,{icon:"hint",placeholder:L("PasswordHintPlaceholder"),onSubmit:b,screen:e,onScreenSelect:m,isActive:d||[o.MT.TwoFaNewPasswordEmail,o.MT.TwoFaNewPasswordEmailCode,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaNewPasswordEmail:return a.ZP.createElement(aa,{icon:"email",type:"email",isLoading:r,error:l,clearError:P,placeholder:L("RecoveryEmailTitle"),shouldConfirm:!0,onSubmit:y,screen:e,onScreenSelect:m,isActive:d||[o.MT.TwoFaNewPasswordEmailCode,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaNewPasswordEmailCode:return a.ZP.createElement(oa,{isLoading:r,error:l,clearError:P,onSubmit:A,screen:e,onScreenSelect:m,isActive:d||t===o.MT.TwoFaCongratulations,onReset:u});case o.MT.TwoFaCongratulations:return a.ZP.createElement(sa,{onScreenSelect:m,isActive:d,onReset:u});case o.MT.TwoFaEnabled:return a.ZP.createElement(Kn,{onScreenSelect:m,isActive:d||[o.MT.TwoFaChangePasswordCurrent,o.MT.TwoFaChangePasswordNew,o.MT.TwoFaChangePasswordConfirm,o.MT.TwoFaChangePasswordHint,o.MT.TwoFaTurnOff,o.MT.TwoFaRecoveryEmailCurrentPassword,o.MT.TwoFaRecoveryEmail,o.MT.TwoFaRecoveryEmailCode,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaChangePasswordCurrent:return a.ZP.createElement(ea,{screen:e,isLoading:r,error:l,clearError:P,hint:s,onSubmit:I,onScreenSelect:m,isActive:d||[o.MT.TwoFaChangePasswordNew,o.MT.TwoFaChangePasswordConfirm,o.MT.TwoFaChangePasswordHint,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaChangePasswordNew:return a.ZP.createElement(ea,{screen:e,placeholder:L("PleaseEnterNewFirstPassword"),onSubmit:w,onScreenSelect:m,isActive:d||[o.MT.TwoFaChangePasswordConfirm,o.MT.TwoFaChangePasswordHint,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaChangePasswordConfirm:return a.ZP.createElement(ea,{screen:e,expectedPassword:n.password,placeholder:L("PleaseReEnterPassword"),onSubmit:N,onScreenSelect:m,isActive:d||[o.MT.TwoFaChangePasswordHint,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaChangePasswordHint:return a.ZP.createElement(aa,{isLoading:r,error:l,clearError:P,icon:"hint",placeholder:L("PasswordHintPlaceholder"),onSubmit:k,onScreenSelect:m,isActive:d||t===o.MT.TwoFaCongratulations,onReset:u,screen:e});case o.MT.TwoFaTurnOff:return a.ZP.createElement(ea,{isLoading:r,error:l,clearError:P,hint:s,onSubmit:S,onScreenSelect:m,isActive:d,onReset:u,screen:e});case o.MT.TwoFaRecoveryEmailCurrentPassword:return a.ZP.createElement(ea,{screen:e,isLoading:r,error:l,clearError:P,hint:s,onSubmit:T,onScreenSelect:m,isActive:d||[o.MT.TwoFaRecoveryEmail,o.MT.TwoFaRecoveryEmailCode,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaRecoveryEmail:return a.ZP.createElement(aa,{screen:e,icon:"email",type:"email",placeholder:L("RecoveryEmailTitle"),onSubmit:F,onScreenSelect:m,isActive:d||[o.MT.TwoFaRecoveryEmailCode,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaRecoveryEmailCode:return a.ZP.createElement(oa,{screen:e,isLoading:r,error:l,clearError:P,onSubmit:A,onScreenSelect:m,isActive:d||t===o.MT.TwoFaCongratulations,onReset:u});default:return}})));var ia=n(1820);function ca(e,t){const{privacy:n}=e.settings;switch(t){case o.MT.PrivacyPhoneNumberAllowedContacts:case o.MT.PrivacyPhoneNumberDeniedContacts:return n.phoneNumber;case o.MT.PrivacyLastSeenAllowedContacts:case o.MT.PrivacyLastSeenDeniedContacts:return n.lastSeen;case o.MT.PrivacyProfilePhotoAllowedContacts:case o.MT.PrivacyProfilePhotoDeniedContacts:return n.profilePhoto;case o.MT.PrivacyForwardingAllowedContacts:case o.MT.PrivacyForwardingDeniedContacts:return n.forwards;case o.MT.PrivacyGroupChatsDeniedContacts:case o.MT.PrivacyGroupChatsAllowedContacts:return n.chatInvite}}const da=(0,a.X$)((0,s.c$)(((e,{screen:t})=>{const{chats:{byId:n,listIds:a,orderedPinnedIds:s},currentUserId:r}=e;return{currentUserId:r,chatsById:n,listIds:a.active,orderedPinnedIds:s.active,archivedPinnedIds:s.archived,archivedListIds:a.archived,settings:ca(e,t)}}),((e,t)=>(0,h.ei)(t,["setPrivacySettings"])))((({currentUserId:e,isAllowList:t,screen:n,settings:s,chatsById:r,listIds:l,orderedPinnedIds:i,archivedListIds:c,archivedPinnedIds:d,setPrivacySettings:m,isActive:h,onScreenSelect:Z,onReset:P})=>{const g=(0,M.Z)(),v=(0,a.Ye)((()=>s?t?[...s.allowUserIds,...s.allowChatIds]:[...s.blockUserIds,...s.blockChatIds]:[]),[t,s]),[p,E]=(0,a.eJ)(""),[C,f]=(0,a.eJ)(!1),[b,y]=(0,a.eJ)(v),I=(0,a.Ye)((()=>{const e=l?(0,u.O)(r,l,i,"all"):void 0,t=c?(0,u.O)(r,c,d,"archived"):void 0;if(e||t)return[...e?[...e.pinnedChats,...e.otherChats]:[],...t?t.otherChats:[]]}),[r,l,i,c,d]),w=(0,a.Ye)((()=>{if(I)return I.filter((t=>((0,u.YA)(t.id)&&t.id!==e||(0,u.Bf)(t))&&(!p||(0,ue.Z)((0,u.U)(g,t),p)||v.includes(t.id)))).map((({id:e})=>e))}),[I,e,g,p,v]),N=(0,a.I4)((e=>{y(e),f(!0)}),[]),k=(0,a.I4)((()=>{m({privacyKey:Xn(n),isAllowList:Boolean(t),contactsIds:b}),Z(o.MT.Privacy)}),[t,b,Z,n,m]);return(0,T.ZP)(h,P,Z,n),a.ZP.createElement("div",{className:"NewChat-inner step-1"},a.ZP.createElement(ia.Z,{itemIds:w||[],selectedIds:b,filterValue:p,filterPlaceholder:g(t?"AlwaysShareWithPlaceholder":"NeverShareWithPlaceholder"),searchInputId:"new-group-picker-search",onSelectedIdsChange:N,onFilterChange:E}),a.ZP.createElement(Ot.Z,{isShown:C,onClick:k,ariaLabel:g(t?"AlwaysShareWithTitle":"NeverShareWithTitle")},a.ZP.createElement("i",{className:"icon-arrow-right"})))}))),ma=Object.keys(o.MT).length/2,ua=[o.MT.TwoFaDisabled,o.MT.TwoFaNewPassword,o.MT.TwoFaNewPasswordConfirm,o.MT.TwoFaNewPasswordHint,o.MT.TwoFaNewPasswordEmail,o.MT.TwoFaNewPasswordEmailCode,o.MT.TwoFaCongratulations,o.MT.TwoFaEnabled,o.MT.TwoFaChangePasswordCurrent,o.MT.TwoFaChangePasswordNew,o.MT.TwoFaChangePasswordConfirm,o.MT.TwoFaChangePasswordHint,o.MT.TwoFaTurnOff,o.MT.TwoFaRecoveryEmailCurrentPassword,o.MT.TwoFaRecoveryEmail,o.MT.TwoFaRecoveryEmailCode],ha=[o.MT.Folders,o.MT.FoldersCreateFolder,o.MT.FoldersEditFolder,o.MT.FoldersEditFolderFromChatList,o.MT.FoldersIncludedChats,o.MT.FoldersIncludedChatsFromChatList,o.MT.FoldersExcludedChats,o.MT.FoldersExcludedChatsFromChatList],Za=[o.MT.PrivacyBlockedUsers,o.MT.PrivacyActiveSessions],Pa=[o.MT.PrivacyPhoneNumberAllowedContacts,o.MT.PrivacyPhoneNumberDeniedContacts],ga=[o.MT.PrivacyLastSeenAllowedContacts,o.MT.PrivacyLastSeenDeniedContacts],va=[o.MT.PrivacyProfilePhotoAllowedContacts,o.MT.PrivacyProfilePhotoDeniedContacts],pa=[o.MT.PrivacyForwardingAllowedContacts,o.MT.PrivacyForwardingDeniedContacts],Ea=[o.MT.PrivacyGroupChatsAllowedContacts,o.MT.PrivacyGroupChatsDeniedContacts],Ca=(0,a.X$)((({isActive:e,currentScreen:t,foldersState:n,foldersDispatch:s,onScreenSelect:r,onReset:l,shouldSkipTransition:c})=>{const[d,m]=(0,At.Z)(Rt,Lt),u=(0,a.I4)((()=>{t!==o.MT.FoldersCreateFolder&&t!==o.MT.FoldersEditFolder&&t!==o.MT.FoldersEditFolderFromChatList||setTimeout((()=>{s({type:"reset"})}),200),t!==o.MT.FoldersIncludedChats&&t!==o.MT.FoldersExcludedChats?l():"create"===n.mode?r(o.MT.FoldersCreateFolder):r(o.MT.FoldersEditFolder)}),[n.mode,s,t,l,r]),h=(0,a.I4)((()=>{s({type:"saveFilters"}),u()}),[s,u]);function Z(l,i,c){return a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement($t,{currentScreen:t,onReset:u,onSaveFilter:h,onScreenSelect:r,editedFolderId:n.folderId}),function(l,i){const c={[o.MT.PrivacyPhoneNumber]:Pa.includes(i),[o.MT.PrivacyLastSeen]:ga.includes(i),[o.MT.PrivacyProfilePhoto]:va.includes(i),[o.MT.PrivacyForwarding]:pa.includes(i),[o.MT.PrivacyGroupChats]:Ea.includes(i)},h=ua.includes(i),Z=ha.includes(i),P=Za.includes(i)||h||Object.keys(c).includes(i.toString())||Object.values(c).find((e=>!0===e));switch(t){case o.MT.Main:return a.ZP.createElement(Ut,{onScreenSelect:r,isActive:e,onReset:u});case o.MT.EditProfile:return a.ZP.createElement(Vt,{onScreenSelect:r,isActive:e&&l,onReset:u});case o.MT.General:return a.ZP.createElement(Cn,{onScreenSelect:r,isActive:l||i===o.MT.GeneralChatBackgroundColor||i===o.MT.GeneralChatBackground||P||Z,onReset:u});case o.MT.Notifications:return a.ZP.createElement(xn,{onScreenSelect:r,isActive:l,onReset:u});case o.MT.Privacy:return a.ZP.createElement(On,{onScreenSelect:r,isActive:l||P||h,onReset:u});case o.MT.Language:return a.ZP.createElement(Jn,{onScreenSelect:r,isActive:l,onReset:u});case o.MT.GeneralChatBackground:return a.ZP.createElement(Ln,{onScreenSelect:r,isActive:l||i===o.MT.GeneralChatBackgroundColor,onReset:u});case o.MT.GeneralChatBackgroundColor:return a.ZP.createElement(Un,{onScreenSelect:r,isActive:l,onReset:u});case o.MT.PrivacyActiveSessions:return a.ZP.createElement(jn,{onScreenSelect:r,isActive:l,onReset:u});case o.MT.PrivacyBlockedUsers:return a.ZP.createElement(Vn,{onScreenSelect:r,isActive:l,onReset:u});case o.MT.PrivacyPhoneNumber:case o.MT.PrivacyLastSeen:case o.MT.PrivacyProfilePhoto:case o.MT.PrivacyForwarding:case o.MT.PrivacyGroupChats:return a.ZP.createElement(zn,{screen:t,onScreenSelect:r,isActive:l||c[t],onReset:u});case o.MT.PrivacyPhoneNumberAllowedContacts:case o.MT.PrivacyLastSeenAllowedContacts:case o.MT.PrivacyProfilePhotoAllowedContacts:case o.MT.PrivacyForwardingAllowedContacts:case o.MT.PrivacyGroupChatsAllowedContacts:return a.ZP.createElement(da,{isAllowList:!0,screen:t,onScreenSelect:r,isActive:l||c[t],onReset:u});case o.MT.PrivacyPhoneNumberDeniedContacts:case o.MT.PrivacyLastSeenDeniedContacts:case o.MT.PrivacyProfilePhotoDeniedContacts:case o.MT.PrivacyForwardingDeniedContacts:case o.MT.PrivacyGroupChatsDeniedContacts:return a.ZP.createElement(da,{screen:t,onScreenSelect:r,isActive:l,onReset:u});case o.MT.Folders:case o.MT.FoldersCreateFolder:case o.MT.FoldersEditFolder:case o.MT.FoldersEditFolderFromChatList:case o.MT.FoldersIncludedChats:case o.MT.FoldersIncludedChatsFromChatList:case o.MT.FoldersExcludedChats:case o.MT.FoldersExcludedChatsFromChatList:return a.ZP.createElement(cn,{currentScreen:t,shownScreen:i,state:n,dispatch:s,isActive:l,onScreenSelect:r,onReset:u});case o.MT.TwoFaDisabled:case o.MT.TwoFaNewPassword:case o.MT.TwoFaNewPasswordConfirm:case o.MT.TwoFaNewPasswordHint:case o.MT.TwoFaNewPasswordEmail:case o.MT.TwoFaNewPasswordEmailCode:case o.MT.TwoFaCongratulations:case o.MT.TwoFaEnabled:case o.MT.TwoFaChangePasswordCurrent:case o.MT.TwoFaChangePasswordNew:case o.MT.TwoFaChangePasswordConfirm:case o.MT.TwoFaChangePasswordHint:case o.MT.TwoFaTurnOff:case o.MT.TwoFaRecoveryEmailCurrentPassword:case o.MT.TwoFaRecoveryEmail:case o.MT.TwoFaRecoveryEmailCode:return a.ZP.createElement(la,{currentScreen:t,state:d,dispatch:m,shownScreen:i,isActive:l,onScreenSelect:r,onReset:u});default:return}}(l,c))}return a.ZP.createElement(L.Z,{id:"Settings",name:c?"none":i.s0,activeKey:t,renderCount:ma},Z)})),fa=(0,z.P2)((e=>e()),6e4,!0),ba=(0,a.X$)((0,s.c$)((e=>{const{userIds:t}=e.contactList||{},{byId:n}=e.users;return{usersById:n,contactIds:t,serverTimeOffset:e.serverTimeOffset}}),((e,t)=>(0,h.ei)(t,["loadContactList","openChat"])))((({isActive:e,onReset:t,filter:n,usersById:s,contactIds:r,loadContactList:o,openChat:l,serverTimeOffset:c})=>{(0,a.d4)((()=>{fa((()=>{o()}))})),(0,T.ZP)(e,t);const d=(0,a.I4)((e=>{l({id:e,shouldReplaceHistory:!0})}),[l]),m=(0,a.Ye)((()=>{if(!r)return;const e=n?r.filter((e=>{const t=s[e];if(!t)return!1;const a=(0,u.Js)(t);return a&&(0,ue.Z)(a,n)})):r;return(0,u.Z0)(e,s,void 0,c)}),[r,n,s,c]),[h,Z]=(0,he.Z)(void 0,m,Boolean(n));return a.ZP.createElement(pe.Z,{items:h,onLoadMore:Z,className:"chat-list custom-scroll"},null!=h&&h.length?h.map((e=>a.ZP.createElement(Ee.Z,{key:e,className:"chat-item-clickable",onClick:()=>d(e),ripple:!i.wB},a.ZP.createElement(Ce.Z,{userId:e,forceShowSelf:!0,avatarSize:"large"})))):h&&!h.length?a.ZP.createElement("p",{className:"no-results",key:"no-results",dir:"auto"},n.length?"No contacts matched your search.":"Contact list is empty."):a.ZP.createElement(Pe.Z,{key:"loading"}))}))),ya=(0,z.P2)((e=>e()),6e4,!0),Ia=(0,a.X$)((0,s.c$)((e=>{const{userIds:t}=e.contactList||{},{byId:n}=e.users,{byId:a}=e.chats,{currentUserId:s}=e,{query:r,fetchingStatus:o,globalResults:l,localResults:i}=e.globalSearch,{userIds:c}=l||{},{userIds:d}=i||{};return{currentUserId:s,usersById:n,chatsById:a,localContactIds:t,searchQuery:r,isSearching:null==o?void 0:o.chats,globalUserIds:c,localUserIds:d}}),((e,t)=>(0,h.ei)(t,["loadContactList","setGlobalSearchQuery"])))((({isChannel:e,isActive:t,selectedMemberIds:n,onSelectedMemberIdsChange:s,onNextStep:r,onReset:o,currentUserId:l,usersById:i,chatsById:c,localContactIds:d,searchQuery:m,isSearching:Z,localUserIds:P,globalUserIds:g,loadContactList:v,setGlobalSearchQuery:p})=>{(0,a.d4)((()=>{ya((()=>{v()}))}));const E=(0,M.Z)();(0,T.ZP)(t,o);const C=(0,a.I4)((e=>{p({query:e})}),[p]),f=(0,a.Ye)((()=>{const e=d?(0,u.ih)(d.filter((e=>e!==l)),c):[];if(!m)return e;const t=e.filter((e=>{const t=i[e];if(!t)return!1;const n=(0,u.Js)(t);return n&&(0,ue.Z)(n,m)}));return(0,u.ih)((0,h.Tw)([...t,...P||[],...g||[]]).filter((e=>{const t=i[e];return!t||!(0,u.cS)(t)||t.canBeInvitedToGroup})),c,!1,n)}),[d,c,m,P,g,n,l,i]),b=(0,a.I4)((()=>{(n.length||e)&&(p({query:""}),r())}),[n.length,e,p,r]);return a.ZP.createElement("div",{className:"NewChat step-1"},a.ZP.createElement("div",{className:"left-header"},a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",onClick:o,ariaLabel:"Return to Chat List"},a.ZP.createElement("i",{className:"icon-arrow-left"})),a.ZP.createElement("h3",null,E("GroupAddMembers"))),a.ZP.createElement("div",{className:"NewChat-inner step-1"},a.ZP.createElement(ia.Z,{itemIds:f,selectedIds:n,filterValue:m,filterPlaceholder:E("SendMessageTo"),searchInputId:"new-group-picker-search",isLoading:Z,onSelectedIdsChange:s,onFilterChange:C}),a.ZP.createElement(Ot.Z,{isShown:Boolean(n.length||e),onClick:b,ariaLabel:e?"Continue To Channel Info":"Continue To Group Info"},a.ZP.createElement("i",{className:"icon-arrow-right"}))))}))),wa=(0,a.X$)((0,s.c$)((e=>{const{progress:t,error:n}=e.chatCreation||{};return{creationProgress:t,creationError:n}}),((e,t)=>(0,h.ei)(t,["createGroupChat","createChannel"])))((({isChannel:e,isActive:t,memberIds:n,onReset:s,creationProgress:r,creationError:l,createGroupChat:i,createChannel:c})=>{const d=(0,M.Z)();(0,T.ZP)(t,s);const[m,u]=(0,a.eJ)(""),[h,Z]=(0,a.eJ)(""),[P,g]=(0,a.eJ)(),[v,p]=(0,a.eJ)(),E="Chat title can't be empty",C="Channel title can't be empty",f="Sorry, creating supergroups is not yet supported",b=r===o.Nh.InProgress,y=(0,a.I4)((e=>{const{value:t}=e.currentTarget,n=t.replace(/^\s+/,"");u(n),n!==t&&(e.currentTarget.value=n)}),[]),I=(0,a.I4)((e=>{Z(e.currentTarget.value)}),[]),w=(0,a.I4)((()=>{m.length?n.length>199?p(f):i({title:m,photo:P,memberIds:n}):p(E)}),[m,n,i,P,E,f]),N=(0,a.I4)((()=>{m.length?c({title:m,about:h,photo:P,memberIds:n}):p(C)}),[m,c,h,P,n,C]);(0,a.d4)((()=>{r===o.Nh.Complete&&s(!0)}),[r,s]);const k=l||(v!==E&&v!==C?v:void 0);return a.ZP.createElement("div",{className:"NewChat"},a.ZP.createElement("div",{className:"left-header"},a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",onClick:()=>s(),ariaLabel:"Return to member selection"},a.ZP.createElement("i",{className:"icon-arrow-left"})),a.ZP.createElement("h3",null,d(e?"NewChannel":"NewGroup"))),a.ZP.createElement("div",{className:"NewChat-inner step-2"},a.ZP.createElement(xt.Z,{onChange:g,title:d("AddPhoto")}),a.ZP.createElement(ve.Z,{value:m,onChange:y,label:d(e?"EnterChannelName":"GroupName"),error:v===E||v===C?v:void 0}),e&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(ve.Z,{value:h,onChange:I,label:d("DescriptionOptionalPlaceholder")}),a.ZP.createElement("p",{className:"note"},d("DescriptionInfo"))),k&&a.ZP.createElement("p",{className:"error"},k),n.length>0&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("h3",{className:"chat-members-heading"},d("GroupInfo.ParticipantCount",n.length,"i")),a.ZP.createElement("div",{className:"chat-members-list custom-scroll"},n.map((e=>a.ZP.createElement(Ee.Z,{inactive:!0,className:"chat-item-clickable"},a.ZP.createElement(Ce.Z,{userId:e}))))))),a.ZP.createElement(Ot.Z,{isShown:0!==m.length,onClick:e?N:w,disabled:b,ariaLabel:e?d("ChannelIntro.CreateChannel"):"Create Group"},b?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-arrow-right"})))}))),Na=Object.keys(o.du).length/2,ka=(0,a.X$)((({isActive:e,isChannel:t=!1,content:n,onContentChange:s,onReset:r})=>{const[l,c]=(0,a.eJ)([]),d=(0,a.I4)((()=>{s(t?o.du.NewChannelStep2:o.du.NewGroupStep2)}),[t,s]);return a.ZP.createElement(L.Z,{id:"NewChat",name:i.s0,renderCount:Na,activeKey:n},(s=>{switch(n){case o.du.NewChannelStep1:case o.du.NewGroupStep1:return a.ZP.createElement(Ia,{isChannel:t,isActive:e,selectedMemberIds:l,onSelectedMemberIdsChange:c,onNextStep:d,onReset:r});case o.du.NewChannelStep2:case o.du.NewGroupStep2:return a.ZP.createElement(wa,{isChannel:t,isActive:s&&e,memberIds:l,onReset:r});default:return}}))}));var Sa=n(9359);const Ma=(0,a.X$)((({isActive:e,onReset:t,onContentChange:n})=>{const s=(0,M.Z)();return(0,T.ZP)(e,t,n,o.du.Archived),a.ZP.createElement("div",{className:"ArchivedChats"},a.ZP.createElement("div",{className:"left-header"},a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",onClick:t,ariaLabel:"Return to chat list"},a.ZP.createElement("i",{className:"icon-arrow-left"})),a.ZP.createElement("h3",null,s("ArchivedChats"))),a.ZP.createElement(Sa.Z,{folderType:"archived",isActive:e}))})),Ta={Down:!0,ArrowDown:!0,Up:!0,ArrowUp:!0,Left:!0,ArrowLeft:!0,Right:!0,ArrowRight:!0," ":!0,PageUp:!0,PageDown:!0,End:!0,Home:!0,Tab:!0},Fa=e=>{e.preventDefault()};function Aa(e){Ta[e.key]&&!function(e){if(!(e&&e instanceof HTMLElement))return!1;const t=e,n=t.tagName.toLowerCase();if("textarea"===n)return!0;if("input"!==n)return!1;const a=t.getAttribute("type");return!!a&&["text","password","number","email","tel","url","search","date","datetime","datetime-local","time","month","week"].indexOf(a.toLowerCase())>-1}(e.target)&&Fa(e)}function La(){document.addEventListener("wheel",Fa,{passive:!1}),window.ontouchmove=Fa,document.onkeydown=Aa}function Ra(){document.removeEventListener("wheel",Fa),window.ontouchmove=null,document.onkeydown=null}var $a=n(647),Ba=n(4319);function Da(e){return e?"lng_context_copy_selected":"lng_context_copy_text"}var Ua=n(3394),xa=n(2328);const Oa=({isOpen:e,message:t,anchor:n,canSendNow:s,canReschedule:o,canReply:l,canEdit:i,canPin:c,canUnpin:d,canDelete:m,canReport:h,canForward:Z,canFaveSticker:P,canUnfaveSticker:g,canCopy:v,canCopyLink:p,canSelect:E,onReply:C,onEdit:f,onPin:b,onUnpin:y,onForward:I,onDelete:w,onReport:N,onFaveSticker:k,onUnfaveSticker:S,onSelect:T,onSend:F,onReschedule:A,onClose:L,onCloseAnimationEnd:R,onCopyLink:$})=>{const B=function(e,t,n){const a=[],s=(0,u.UD)(e),o=(0,u.O$)(e)||((0,u.Cg)(e)?void 0:(0,u.F$)(e)),l=(0,u.Ti)(e,"inline"),i=o&&(l||(0,u.BM)(e))&&Ba.yl,c=window.getSelection();if(i&&a.push({label:"lng_context_copy_image",handler:()=>{Promise.resolve(l?$a.he(l,r.IU.BlobUrl):o.blobUrl).then(Ba.VP),t&&t()}}),s){var d;const e=Boolean((null==c||null===(d=c.anchorNode)||void 0===d?void 0:d.parentNode)&&c.anchorNode.parentNode.closest(".Message .content-inner")&&""!==c.toString().replace(/(?:\r\n|\r|\n)/g,""));a.push({label:Da(e),handler:()=>{const n=e&&c?c.toString():s;(0,Ba.TE)(n),t&&t()}})}return n&&a.push({label:"lng_context_copy_message_link",handler:()=>{n(),t&&t()}}),a}(t,L,p?$:void 0),D=(0,a.I4)((()=>document.querySelector(`.active > .MessageList div[data-message-id="${t.id}"]`)),[t.id]),U=(0,a.I4)((()=>document.querySelector(".active > .MessageList")),[]),x=(0,a.I4)((()=>document.querySelector(".MessageContextMenu .bubble")),[]),{positionX:O,positionY:J,style:X}=(0,Ua.Z)(n,D,U,x,10,document.querySelector(".MiddleHeader").offsetHeight),z=(0,M.Z)();return a.ZP.createElement(xa.Z,{isOpen:e,positionX:O,positionY:J,style:X,className:"MessageContextMenu fluid",onClose:L,onCloseAnimationEnd:R},s&&a.ZP.createElement(G.Z,{icon:"send-outline",onClick:F},z("MessageScheduleSend")),o&&a.ZP.createElement(G.Z,{icon:"schedule",onClick:A},z("MessageScheduleEditTime")),l&&a.ZP.createElement(G.Z,{icon:"reply",onClick:C},z("Reply")),i&&a.ZP.createElement(G.Z,{icon:"edit",onClick:f},z("Edit")),P&&a.ZP.createElement(G.Z,{icon:"favorite",onClick:k},z("AddToFavorites")),g&&a.ZP.createElement(G.Z,{icon:"favorite",onClick:S},z("Stickers.RemoveFromFavorites")),v&&B.map((e=>a.ZP.createElement(G.Z,{key:e.label,icon:"copy",onClick:e.handler},z(e.label)))),c&&a.ZP.createElement(G.Z,{icon:"pin",onClick:b},z("DialogPin")),d&&a.ZP.createElement(G.Z,{icon:"unpin",onClick:y},z("DialogUnpin")),Z&&a.ZP.createElement(G.Z,{icon:"forward",onClick:I},z("Forward")),E&&a.ZP.createElement(G.Z,{icon:"select",onClick:T},z("Common.Select")),h&&a.ZP.createElement(G.Z,{icon:"flag",onClick:N},z("lng_context_report_msg")),m&&a.ZP.createElement(G.Z,{destructive:!0,icon:"delete",onClick:w},z("Delete")))},Ga=(0,a.X$)((0,s.c$)(((e,{message:t,messageListType:n})=>{const{threadId:a}=(0,m.Bt)(e)||{},{noOptions:s,canReply:r,canPin:o,canUnpin:l,canDelete:i,canReport:c,canEdit:d,canForward:u,canFaveSticker:h,canUnfaveSticker:Z,canCopy:P,canCopyLink:g,canSelect:v}=a&&(0,m._k)(e,t,a)||{},p="pinned"===n,E="scheduled"===n;return{noOptions:s,canSendNow:E,canReschedule:E,canReply:!p&&!E&&r,canPin:!E&&o,canUnpin:!E&&l,canDelete:i,canReport:c,canEdit:!p&&d,canForward:!E&&u,canFaveSticker:!E&&h,canUnfaveSticker:!E&&Z,canCopy:P,canCopyLink:!E&&g,canSelect:v}}),((e,t)=>(0,h.ei)(t,["setReplyingToId","setEditingId","pinMessage","openForwardMenu","faveSticker","unfaveSticker","toggleMessageSelection","sendScheduledMessages","rescheduleMessage"])))((({isOpen:e,messageListType:t,chatUsername:n,message:s,album:r,anchor:o,onClose:l,onCloseAnimationEnd:i,noOptions:c,canSendNow:d,canReschedule:m,canReply:u,canPin:h,canUnpin:Z,canDelete:P,canReport:g,canEdit:v,canForward:p,canFaveSticker:E,canUnfaveSticker:C,canCopy:f,canCopyLink:b,canSelect:y,setReplyingToId:I,setEditingId:w,pinMessage:N,openForwardMenu:k,faveSticker:S,unfaveSticker:M,toggleMessageSelection:T,sendScheduledMessages:F,rescheduleMessage:A})=>{const{transitionClassNames:L}=(0,j.Z)(e,i,void 0,!1),[R,B]=(0,a.eJ)(!0),[D,U]=(0,a.eJ)(!1),[x,O]=(0,a.eJ)(!1),[G,J]=(0,a.eJ)(!1),[X,z,_]=(0,Fe.Z)(),Y=(0,a.I4)((()=>{B(!1),U(!0)}),[]),H=(0,a.I4)((()=>{B(!1),O(!0)}),[]),V=(0,a.I4)((()=>{B(!1),l()}),[l]),q=(0,a.I4)((()=>{U(!1),l()}),[l]),K=(0,a.I4)((()=>{O(!1),l()}),[l]),W=(0,a.I4)((()=>{J(!1),l()}),[l]),Q=(0,a.I4)((()=>{_(),l()}),[_,l]),ee=(0,a.I4)((()=>{I({messageId:s.id}),V()}),[I,s.id,V]),te=(0,a.I4)((()=>{w({messageId:s.id}),V()}),[w,s.id,V]),ne=(0,a.I4)((()=>{B(!1),J(!0)}),[]),ae=(0,a.I4)((()=>{N({messageId:s.id,isUnpin:!0}),V()}),[N,s.id,V]),se=(0,a.I4)((()=>{if(V(),null!=r&&r.messages){const e=r.messages.map((({id:e})=>e));k({fromChatId:s.chatId,messageIds:e})}else k({fromChatId:s.chatId,messageIds:[s.id]})}),[k,s,V,r]),re=(0,a.I4)((()=>{V(),S({sticker:s.content.sticker})}),[V,s.content.sticker,S]),oe=(0,a.I4)((()=>{V(),M({sticker:s.content.sticker})}),[V,s.content.sticker,M]),le=(0,a.I4)((()=>{const e=null!=r&&r.messages?{messageId:s.id,childMessageIds:r.messages.map((({id:e})=>e)),withShift:!1}:{messageId:s.id,withShift:!1};T(e),V()}),[V,s.id,T,r]),ie=(0,a.I4)((()=>{F({chatId:s.chatId,id:s.id}),V()}),[V,s.chatId,s.id,F]),ce=(0,a.I4)((()=>{B(!1),z()}),[z]),de=(0,a.I4)((e=>{A({chatId:s.chatId,messageId:s.id,scheduledAt:Math.round(e.getTime()/1e3)})}),[s.chatId,s.id,A]),me=(0,a.I4)((()=>{(0,Ba.TE)(`https://t.me/${n||`c/${Math.abs(s.chatId)}`}/${s.id}`),V()}),[n,V,s.chatId,s.id]);(0,a.d4)((()=>(La(),Ra)),[]);const ue=(0,a.Ye)((()=>(r?r.messages:[s]).map((({id:e})=>e))),[r,s]);if(c)return void V();const he=new Date;return he.setFullYear(he.getFullYear()+1),a.ZP.createElement("div",{className:["ContextMenuContainer",L].join(" ")},a.ZP.createElement(Oa,{message:s,isOpen:R,anchor:o,canSendNow:d,canReschedule:m,canReply:u,canDelete:P,canReport:g,canPin:h,canUnpin:Z,canEdit:v,canForward:p,canFaveSticker:E,canUnfaveSticker:C,canCopy:f,canCopyLink:b,canSelect:y,onReply:ee,onEdit:te,onPin:ne,onUnpin:ae,onForward:se,onDelete:Y,onReport:H,onFaveSticker:re,onUnfaveSticker:oe,onSelect:le,onSend:ie,onReschedule:ce,onClose:V,onCopyLink:me}),a.ZP.createElement(De,{isOpen:D,isSchedule:"scheduled"===t,onClose:q,album:r,message:s}),a.ZP.createElement(Xe,{isOpen:x,onClose:K,messageIds:ue}),a.ZP.createElement(Ue,{isOpen:G,messageId:s.id,chatId:s.chatId,onClose:W}),a.ZP.createElement($e,{isOpen:X,withTimePicker:!0,selectedAt:1e3*s.date,maxAt:(0,$._F)(he),isFutureMode:!0,onClose:Q,onSubmit:de}))}))),Ja=(0,a.X$)((0,s.c$)(((e,{fromSticker:t,stickerSetShortName:n})=>({stickerSet:t?(0,m.Ny)(e,t.stickerSetId):n?(0,m.E_)(e,n):void 0})),((e,t)=>(0,h.ei)(t,["loadStickers","toggleStickerSet","sendMessage"])))((({isOpen:e,fromSticker:t,stickerSetShortName:n,stickerSet:s,onClose:r,loadStickers:o,toggleStickerSet:i,sendMessage:c})=>{const d=(0,a.sO)(null),m=(0,M.Z)(),{observe:u}=(0,dn.S1)({rootRef:d,throttleMs:200,isDisabled:!e});(0,a.d4)((()=>{if(e)if(t){const{stickerSetId:e,stickerSetAccessHash:n}=t;o({stickerSetId:e,stickerSetAccessHash:n})}else n&&o({stickerSetShortName:n})}),[e,t,o,n]);const h=(0,a.I4)((e=>{e={...e,isPreloadedGlobally:!0},c({sticker:e}),r()}),[r,c]),Z=(0,a.I4)((()=>{s&&(i({stickerSetId:s.id}),r())}),[r,s,i]);return a.ZP.createElement(ge.Z,{className:"StickerSetModal",isOpen:e,onClose:r,hasCloseButton:!0,title:s?(0,B.Z)(s.title,["emoji","links"]):m("AccDescrStickerSet")},null!=s&&s.stickers?a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("div",{ref:d,className:"stickers custom-scroll"},s.stickers.map((e=>a.ZP.createElement(gn.Z,{sticker:e,size:l.yK,observeIntersection:u,onClick:h,clickArg:e})))),a.ZP.createElement("div",{className:"button-wrapper"},a.ZP.createElement(R.Z,{size:"smaller",fluid:!0,color:s.installedDate?"danger":"primary",onClick:Z},m(s.installedDate?"StickerPack.RemoveStickerCount":"StickerPack.AddStickerCount",s.count,"i")))):a.ZP.createElement(Pe.Z,null))})));var Xa=n(2898);const za=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{const n=(0,m.Z1)(e,t);return!n||n.isRestricted?{}:{chat:n,isMuted:(0,u.i4)(n,(0,m.dZ)(e),(0,m.NJ)(e)),isPrivate:(0,u.YA)(n.id),canDeleteChat:(0,u.cc)(n)}}),((e,t)=>(0,h.ei)(t,["updateChatMutedState","enterMessageSelectMode","sendBotCommand","restartBot"])))((({chatId:e,isOpen:t,anchor:n,isChannel:s,canStartBot:r,canRestartBot:o,canSubscribe:l,canSearch:c,canMute:d,canLeave:m,chat:u,isPrivate:h,isMuted:Z,canDeleteChat:P,onSubscribeChannel:g,onSearchClick:v,onClose:p,onCloseAnimationEnd:E,updateChatMutedState:C,enterMessageSelectMode:f,sendBotCommand:b,restartBot:y})=>{const[I,w]=(0,a.eJ)(!0),[N,k]=(0,a.eJ)(!1),{x:S,y:T}=n;(0,j.Z)(t,E,void 0,!1);const F=(0,a.I4)((()=>{w(!1),k(!0)}),[]),A=(0,a.I4)((()=>{w(!1),p()}),[p]),L=(0,a.I4)((()=>{k(!1),p()}),[p]),R=(0,a.I4)((()=>{b({command:"/start"})}),[b]),$=(0,a.I4)((()=>{y({chatId:e})}),[e,y]),B=(0,a.I4)((()=>{C({chatId:e,isMuted:!Z}),A()}),[e,A,Z,C]),D=(0,a.I4)((()=>{g(),A()}),[A,g]),U=(0,a.I4)((()=>{v(),A()}),[A,v]),x=(0,a.I4)((()=>{f(),A()}),[A,f]);(0,a.d4)((()=>(La(),Ra)),[]);const O=(0,M.Z)();return a.ZP.createElement(Xa.Z,null,a.ZP.createElement("div",{className:"HeaderMenuContainer"},a.ZP.createElement(xa.Z,{isOpen:I,positionX:"right",style:`left: ${S}px;top: ${T}px;`,onClose:A},i.wB&&r&&a.ZP.createElement(G.Z,{icon:"bots",onClick:R},O("BotStart")),i.wB&&o&&a.ZP.createElement(G.Z,{icon:"bots",onClick:$},O("BotRestart")),i.wB&&l&&a.ZP.createElement(G.Z,{icon:s?"channel":"group",onClick:D},O(s?"Subscribe":"Join Group")),i.wB&&c&&a.ZP.createElement(G.Z,{icon:"search",onClick:U},O("Search")),d&&a.ZP.createElement(G.Z,{icon:Z?"unmute":"mute",onClick:B},O(Z?"ChatsUnmute":"ChatsMute")),a.ZP.createElement(G.Z,{icon:"select",onClick:x},O("ReportSelectMessages")),m&&a.ZP.createElement(G.Z,{destructive:!0,icon:"delete",onClick:F},O(h?"DeleteChatUser":P?"GroupInfo.DeleteAndExit":s?"LeaveChannel":"Group.LeaveGroup"))),u&&a.ZP.createElement(Ve.Z,{isOpen:N,onClose:L,chat:u})))})));var _a=n(9589);const Ya=(0,z.Ds)((e=>e()),200,!1),ja=(0,a.X$)((0,s.c$)((e=>{const t=(0,m.jr)(e);if(!t)return{};const{query:n,results:a}=(0,m.n5)(e)||{},{totalCount:s,foundIds:r}=a||{};return{chat:t,query:n,totalCount:s,foundIds:r,isHistoryCalendarOpen:Boolean(e.historyCalendarSelectedAt)}}),((e,t)=>(0,h.ei)(t,["setLocalTextSearchQuery","searchTextMessagesLocal","focusMessage","closeLocalTextSearch","openHistoryCalendar"])))((({isActive:e,chat:t,query:n,totalCount:s,foundIds:r,isHistoryCalendarOpen:o,setLocalTextSearchQuery:l,searchTextMessagesLocal:i,focusMessage:c,closeLocalTextSearch:d,openHistoryCalendar:m})=>{const u=(0,a.sO)(null),[h,Z]=(0,a.eJ)(0);(0,a.d4)((()=>{const{visualViewport:e}=window;if(!e)return;const t=document.getElementById("Main"),n=()=>{const{activeElement:n}=document;if(n&&n===u.current){const{pageTop:n,height:a}=e;t.style.transform=`translateY(${n}px)`,t.style.height=`${a}px`,document.documentElement.scrollTop=n}else t.style.transform="",t.style.height=""};return e.addEventListener("resize",n),()=>{e.removeEventListener("resize",n)}}),[]),(0,a.d4)((()=>{t&&r&&r.length?(c({chatId:t.id,messageId:r[r.length-1]}),Z(0)):Z(-1)}),[t,c,r]),(0,a.d4)((()=>{Array.from(document.querySelectorAll("input")).forEach((t=>{t.disabled=Boolean(e&&t!==u.current)})),Array.from(document.querySelectorAll("div[contenteditable]")).forEach((t=>{t.contentEditable=e?"false":"true"}))}),[e]),(0,a.d4)((()=>{e||u.current.blur()}),[e]),(0,a.bt)((()=>{document.querySelector("#MobileSearch input").blur()}),[o]);const P=(0,a.I4)((e=>{l({query:e}),e.length&&Ya(i)}),[i,l]),g=(0,a.I4)((()=>{if(t&&r){const e=h+1;c({chatId:t.id,messageId:r[r.length-1-e]}),Z(e)}}),[t,h,c,r]),v=(0,a.I4)((()=>{if(t&&r){const e=h-1;c({chatId:t.id,messageId:r[r.length-1-e]}),Z(e)}}),[t,h,c,r]);return a.ZP.createElement("div",{id:"MobileSearch",className:e?"active":""},a.ZP.createElement("div",{className:"header"},a.ZP.createElement(R.Z,{size:"smaller",round:!0,color:"translucent",onClick:d},a.ZP.createElement("i",{className:"icon-arrow-left"})),a.ZP.createElement(_a.Z,{ref:u,value:n,onChange:P})),a.ZP.createElement("div",{className:"footer"},a.ZP.createElement("div",{className:"counter"},n?null!=r&&r.length?`${h+1} of ${s}`:r&&!r.length?"No results":"":a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",onClick:()=>m({selectedAt:(0,$._F)(Date.now())}),ariaLabel:"Search messages by date"},a.ZP.createElement("i",{className:"icon-calendar"}))),a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",onClick:g,disabled:!r||!r.length||h===r.length-1},a.ZP.createElement("i",{className:"icon-up"})),a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",onClick:v,disabled:!r||!r.length||0===h},a.ZP.createElement("i",{className:"icon-down"}))))})));var Ha=n(5376),Va=n(2365),qa=n(8353),Ka=n(7002),Wa=n(3616);function Qa(e,t,n=0,a=!1,s=!1,r=!1){const o=e[r?"scrollLeft":"scrollTop"],l=o+e[r?"offsetWidth":"offsetHeight"],i="string"==typeof t?e.querySelectorAll(t):t,{length:c}=i,d=[];let m=!1;for(let e=0;e=o-n&&u<=l+n:c<=l+n&&u>=o-n)d.push(e),m=!0;else if(m&&!a)break}return{allElements:i,visibleIndexes:d}}const es=function(e,t,n=!1){const a=e[n?"scrollLeft":"scrollTop"],s=a+e[n?"offsetWidth":"offsetHeight"],r=t[n?"offsetLeft":"offsetTop"],o=r+t[n?"offsetWidth":"offsetHeight"];return r>a&&os[s.length-1]?"start":"end";(0,ts.Z)(a,r[t],e,10)}}var as=n(3570);function ss({isActive:e,isHorizontal:t,shouldRemoveSelectionOnReset:n,noArrowNavigation:s,items:r,shouldSelectOnTab:o,onSelect:l,onClose:i}){const[c,d]=(0,a.eJ)(-1),m=(0,a.I4)((e=>r?(0,as.Z)(r.length,e):-1),[r]),u=(0,a.I4)(((e,t)=>{t.preventDefault(),d((t=>m(t+e)))}),[d,m]),h=(0,a.I4)((e=>{if(r&&r.length&&c>-1){const t=r[c];t&&(e.preventDefault(),l(t))}}),[r,l,c]);return(0,a.d4)((()=>{d(n?-1:0)}),[r,n]),(0,a.d4)((()=>e?(0,Oe.Z)({onEsc:i,onUp:s||t?void 0:e=>u(-1,e),onDown:s||t?void 0:e=>u(1,e),onLeft:s||!t?void 0:e=>u(-1,e),onRight:s||!t?void 0:e=>u(1,e),onTab:o?h:void 0,onEnter:h}):void 0),[s,u,h,e,t,i,o]),c}const rs=(0,a.X$)((({isOpen:e,onClose:t,onInsertUserName:n,usersById:s,filteredUsers:r})=>{const o=(0,a.sO)(null),{shouldRender:l,transitionClassNames:i}=(0,j.Z)(e,void 0,void 0,!1),c=(0,a.I4)(((e,t=!1)=>{const a=null==s?void 0:s[e];a&&n(a,t)}),[s,n]),d=(0,a.I4)((e=>{c(e.id,!0)}),[c]),m=ss({isActive:e,items:r,onSelect:d,shouldSelectOnTab:!0,onClose:t});(0,a.d4)((()=>{ns(".chat-item-clickable",m,o)}),[m]),(0,a.d4)((()=>{r&&!r.length&&t()}),[r,t]);const u=(0,f.Z)(null!=r&&r.length?r:void 0,l),h=r&&!r.length?u:r;if(!l||h&&!h.length)return;const Z=(0,_.Z)("MentionTooltip composer-tooltip custom-scroll",i);return a.ZP.createElement("div",{className:Z,ref:o},null==h?void 0:h.map((({id:e},t)=>a.ZP.createElement(Ee.Z,{key:e,className:"chat-item-clickable scroll-item",onClick:()=>c(e),focus:m===t},a.ZP.createElement(Ce.Z,{userId:e,avatarSize:"small",withUsername:!0})))))}));var os=n(9830);const ls=(0,a.X$)((({attachments:e,caption:t,isReady:n,currentUserId:s,groupChatMembers:r,usersById:o,recentEmojis:i,baseEmojiKeywords:c,emojiKeywords:d,addRecentEmoji:m,onCaptionUpdate:u,onSend:h,onFileAppend:Z,onClear:g})=>{const v=(0,a.sO)(null),p=(0,f.Z)(e),E=e.length?e:p,C=Boolean(e.length),[b,y,I]=(0,Fe.Z)(),w=Boolean(E&&E.every((e=>e.quick))),N=(0,M.Z)(),{isMentionTooltipOpen:k,closeMentionTooltip:S,insertMention:T,mentionFilteredUsers:F}=(0,Va.Z)(C,t,u,l.nY,r,void 0,s,o),{isEmojiTooltipOpen:A,closeEmojiTooltip:L,filteredEmojis:$,insertEmoji:B}=(0,qa.Z)(C,t,i,l.nY,u,c,d,!n);(0,a.d4)((()=>C?(0,P.Z)(g):void 0),[C,g]);const D=(0,a.I4)((()=>{C&&h()}),[C,h]),U=(0,a.I4)((e=>{e.preventDefault(),I();const{dataTransfer:{files:t}}=e;if(null!=t&&t.length){const e=w?Array.from(t).filter((e=>e.type&&l.AK.has(e.type))):Array.from(t);Z(e,w)}}),[w,Z,I]);if(!E)return;const x=E.every((e=>e.mimeType.startsWith("image/"))),O=E.every((e=>e.mimeType.startsWith("video/")));let G="";return G=N(x?"PreviewSender.SendPhoto":O?"PreviewSender.SendVideo":"PreviewSender.SendFile",E.length,"i"),a.ZP.createElement(ge.Z,{isOpen:C,onClose:g,header:function(){if(E)return a.ZP.createElement("div",{className:"modal-header-condensed",dir:N.isRtl?"rtl":void 0},a.ZP.createElement(R.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:"Cancel attachments",onClick:g},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement("div",{className:"modal-title"},G),a.ZP.createElement(R.Z,{color:"primary",size:"smaller",className:"modal-action-button",onClick:D},N("Send")))}(),className:"AttachmentModal "+(b?"hovered":"")},a.ZP.createElement("div",{className:"drop-target",onDragEnter:y,onDrop:U,onDragOver:function(e){e.preventDefault(),e.stopPropagation(),v.current&&window.clearTimeout(v.current)},onDragLeave:e=>{const{relatedTarget:t,target:n}=e;n.matches(".drop-target")&&!t&&(v.current=window.setTimeout(I,150)),n&&n.closest(".AttachmentModal.hovered")||(t&&e.stopPropagation(),I())},"data-attach-description":N("Preview.Dragging.AddItems",10)},w?a.ZP.createElement("div",{className:"media-wrapper custom-scroll"},E.map((e=>e.mimeType.startsWith("image/")?a.ZP.createElement("img",{src:e.blobUrl,alt:""}):a.ZP.createElement("video",{src:e.blobUrl,autoPlay:!0,muted:!0,loop:!0})))):a.ZP.createElement("div",{className:"document-wrapper custom-scroll"},E.map((e=>a.ZP.createElement(Ka.Z,{name:e.filename,extension:(0,Ha.mD)(e.filename,e.mimeType),previewData:e.previewBlobUrl,size:e.size,smaller:!0})))),a.ZP.createElement("div",{className:"attachment-caption-wrapper"},a.ZP.createElement(rs,{isOpen:k,onClose:S,onInsertUserName:T,filteredUsers:F,usersById:o}),a.ZP.createElement(os.Z,{isOpen:A,emojis:$,onClose:L,onEmojiSelect:B,addRecentEmoji:m}),a.ZP.createElement(Wa.Z,{id:"caption-input-text",isAttachmentModalInput:!0,html:t,editableInputId:l.nY,placeholder:N("Caption"),onUpdate:u,onSend:h,shouldSetFocus:Boolean(e.length)}))))}));var is=n(6980);const cs=(0,a.X$)((({isOpen:e,onSend:t,onClear:n})=>{const s=(0,a.sO)(null),r=(0,a.sO)(null),o=(0,a.sO)(null),[l,i]=(0,a.eJ)(""),[c,d]=(0,a.eJ)([""]),[m,u]=(0,a.eJ)(!0),[h,Z]=(0,a.eJ)(!1),[g,v]=(0,a.eJ)(!1),[p,E]=(0,a.eJ)(),[C,f]=(0,a.eJ)(),[b,y]=(0,a.eJ)(!1),I=(0,M.Z)(),w=(0,a.I4)((t=>{e&&t.current&&t.current.focus()}),[e]);(0,a.d4)((()=>e?(0,P.Z)(n):void 0),[e,n]),(0,a.d4)((()=>{e||(i(""),d([""]),u(!0),Z(!1),v(!1),E(""),f(""),y(!1))}),[e]),(0,a.d4)((()=>w(s)),[w,e]),(0,a.bt)((()=>{const e=o.current;e&&p!==e.innerHTML&&(e.innerHTML=p)}),[p]);const N=(0,a.I4)(((e=[])=>{d([...e,""]),requestAnimationFrame((()=>{const e=r.current;e&&(e.classList.toggle("overflown",e.scrollHeight>320),e.scrollTo({top:e.scrollHeight,behavior:"smooth"}))}))}),[]),k=(0,a.I4)((()=>{if(y(!1),!e)return;const n=l.trim().substring(0,255),a=c.map((e=>e.trim().substring(0,100))).filter((e=>e.length));if(!n||a.length<2)return i(n),a.length?a.length<2?N(a):d(a):N(),void y(!0);if(g&&(!C||!a[Number(C)]))return void y(!0);const s={summary:{question:n,answers:a.map(((e,t)=>({text:e.trim(),option:String(t),...String(t)===C&&{correct:!0}}))),...!m&&{isPublic:!0},...h&&{multipleChoice:!0},...g&&{quiz:!0}}};if(g){const{text:e,entities:t}=p&&(0,is.Z)(p.substring(0,200))||{};s.quiz={correctAnswers:[C],...e&&{solution:e},...t&&{solutionEntities:t}}}t(s)}),[e,l,c,g,C,m,h,t,N,p]),S=(0,a.I4)(((e,t)=>{const n=[...c];n[e]=t,n[n.length-1].trim().length&&n.length<10?N(n):d(n)}),[c,N]),T=(0,a.I4)((e=>{const t=[...c];t.splice(e,1),d(t),requestAnimationFrame((()=>{r.current&&r.current.classList.toggle("overflown",r.current.scrollHeight>320)}))}),[c]),F=(0,a.I4)((e=>{f(e)}),[f]),A=(0,a.I4)((e=>{u(e.target.checked)}),[]),L=(0,a.I4)((e=>{Z(e.target.checked)}),[]),$=(0,a.I4)((e=>{v(e.target.checked)}),[]),B=(0,a.I4)((e=>{13===e.keyCode&&k()}),[k]),D=(0,a.I4)((()=>{if(b&&!l.trim().length)return I("lng_polls_choose_question")}),[b,I,l]),U=(0,a.I4)((e=>{const t=c.map((e=>e.trim())).filter((e=>e.length));if(b&&t.length<2&&!c[e].trim().length)return I("lng_polls_choose_answers")}),[b,I,c]);function x(){return c.map(((e,t)=>a.ZP.createElement("div",{className:"option-wrapper"},a.ZP.createElement(ve.Z,{label:t!==c.length-1||10===c.length?I("OptionHint"):I("CreatePoll.AddOption"),error:U(t),value:e,onChange:e=>S(t,e.currentTarget.value),onKeyPress:B}),t!==c.length-1&&a.ZP.createElement(R.Z,{className:"option-remove-button",round:!0,color:"translucent",size:"smaller",ariaLabel:I("Delete"),onClick:()=>T(t)},a.ZP.createElement("i",{className:"icon-close"})))))}return a.ZP.createElement(ge.Z,{isOpen:e,onClose:n,header:a.ZP.createElement("div",{className:"modal-header-condensed"},a.ZP.createElement(R.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:"Cancel poll creation",onClick:n},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement("div",{className:"modal-title"},I("NewPoll")),a.ZP.createElement(R.Z,{color:"primary",size:"smaller",className:"modal-action-button",onClick:k},I("Create"))),className:"PollModal"},a.ZP.createElement(ve.Z,{ref:s,label:I("AskAQuestion"),value:l,error:D(),onChange:e=>i(e.currentTarget.value),onKeyPress:B}),a.ZP.createElement("div",{className:"options-divider"}),a.ZP.createElement("div",{className:"options-list custom-scroll",ref:r},a.ZP.createElement("h3",{className:"options-header"},I("PollOptions")),b&&function(){const e=c.map((e=>e.trim())).filter((e=>e.length));return g&&(!C||!e[Number(C)])&&a.ZP.createElement("p",{className:"error"},I("lng_polls_choose_correct"))}(),g?a.ZP.createElement(Je.Z,{name:"correctOption",options:x().map(((e,t)=>({value:String(t),label:e,hidden:t===c.length-1}))),onChange:F}):x()),a.ZP.createElement("div",{className:"options-divider"}),a.ZP.createElement("div",{className:"quiz-mode"},a.ZP.createElement(rn.Z,{label:I("PollAnonymous"),checked:m,onChange:A}),a.ZP.createElement(rn.Z,{label:I("PollMultiple"),checked:h,disabled:g,onChange:L}),a.ZP.createElement(rn.Z,{label:I("PollQuiz"),checked:g,disabled:h,onChange:$}),g&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("h3",{className:"options-header"},I("lng_polls_solution_title")),a.ZP.createElement("div",{ref:o,className:"form-control",contentEditable:!0,dir:"auto",onChange:e=>E(e.currentTarget.innerHTML)}),a.ZP.createElement("div",{className:"note"},I("CreatePoll.ExplanationInfo")))))}));var ds=n(6503),ms=n(4284),us=n(1367);const hs=(0,a.X$)((({emoji:e,focus:t,onClick:n})=>{const s=(0,a.I4)((t=>{t.preventDefault(),n(e.native,e.id)}),[e,n]);return a.ZP.createElement("div",{className:"EmojiButton "+(t?"focus":""),onMouseDown:s,title:`:${e.names[0]}:`},i.op?e.native:a.ZP.createElement("img",{src:`./img-apple-64/${e.image}.png`,alt:"",loading:"lazy"}))})),Zs=(0,a.X$)((({category:e,index:t,allEmojis:n,observeIntersection:s,shouldRender:r,onEmojiSelect:o})=>{const l=(0,a.sO)(null);(0,dn._N)(l,s);const{transitionClassNames:d}=(0,j.Z)(r,void 0,void 0,"slow"),m=(0,M.Z)(),u=i.wB?Math.floor((c.Z.get().width-8)/44):9,h=44*Math.ceil(e.emojis.length/u);return a.ZP.createElement("div",{ref:l,key:e.id,id:`emoji-category-${t}`,className:"symbol-set"},a.ZP.createElement("p",{className:"symbol-set-name",dir:"auto"},m("recent"===e.id?"RecentStickers":`Emoji${t}`)),a.ZP.createElement("div",{className:(0,_.Z)("symbol-set-container",d),style:`height: ${h}px;`,dir:m.isRtl?"rtl":void 0},r&&e.emojis.map((e=>{const t=n[e];if(!t)return;const s="id"in t?t:t[1];return a.ZP.createElement(hs,{key:s.id,emoji:s,onClick:o})}))))})),Ps={recent:"icon-recent",people:"icon-smile",nature:"icon-animals",foods:"icon-eats",activity:"icon-sport",places:"icon-car",objects:"icon-lamp",symbols:"icon-language",flags:"icon-flag"},gs=[];let vs,ps,Es;const Cs=(0,a.X$)((0,s.c$)((e=>(0,h.ei)(e,["recentEmojis"])))((({className:e,onEmojiSelect:t,recentEmojis:s})=>{const r=(0,a.sO)(null),o=(0,a.sO)(null),[c,d]=(0,a.eJ)(),[m,u]=(0,a.eJ)(),[h,Z]=(0,a.eJ)(0),{observe:P}=(0,dn.S1)({rootRef:r,throttleMs:200},(e=>{e.forEach((e=>{const{id:t}=e.target;if(!t||!t.startsWith("emoji-category-"))return;const n=Number(t.replace("emoji-category-",""));gs[n]=e.isIntersecting}));const t=gs.map(((e,t)=>({index:t,isIntersecting:e}))).filter((({isIntersecting:e})=>e));t.length&&Z(t[Math.floor(t.length/2)].index)}));(0,Ke.Z)(o.current,!i.wB),(0,a.d4)((()=>{if(!c)return;const e=o.current;if(!e)return;const t=42*h-e.offsetWidth/2+21;(0,us.Z)(e,t)}),[c,h]);const g=(0,M.Z)(),v=(0,a.Ye)((()=>{if(!c)return Ye.D;const e=[...c];return null!=s&&s.length&&e.unshift({id:"recent",name:g("RecentStickers"),emojis:s}),e}),[c,g,s]);(0,a.d4)((()=>{setTimeout((()=>{const e=()=>{d(Es.categories),u(Es.emojis)};Es?e():async function(){return vs||(vs=n.e(501).then(n.t.bind(n,7501,19)),ps=(await vs).default,Es=(0,ms.NM)(ps)),vs}().then(e)}),200)}),[]);const p=(0,a.I4)((e=>{Z(e);const t=document.getElementById(`emoji-category-${e}`);(0,ts.Z)(r.current,t,"start",50,800)}),[]),E=(0,a.I4)(((e,n)=>{t(e,n)}),[t]),C=(0,mt.Z)([],l.kU),f=(0,_.Z)("EmojiPicker",e);return m&&C?a.ZP.createElement("div",{className:f},a.ZP.createElement("div",{ref:o,className:"EmojiPicker-header",dir:g.isRtl?"rtl":""},v.map((function(e,t){const n=Ps[e.id];return n&&a.ZP.createElement(R.Z,{className:"symbol-set-button "+(t===h?"activated":""),round:!0,faded:!0,color:"translucent",onClick:()=>p(t),ariaLabel:e.name},a.ZP.createElement("i",{className:n}))}))),a.ZP.createElement("div",{ref:r,className:(0,_.Z)("EmojiPicker-main no-selection",i.$b?"no-scrollbar":"custom-scroll")},v.map(((e,t)=>a.ZP.createElement(Zs,{category:e,index:t,allEmojis:m,observeIntersection:P,shouldRender:h>=t-1&&h<=t+1,onEmojiSelect:E}))))):a.ZP.createElement("div",{className:f},a.ZP.createElement(Pe.Z,null))}))),fs=i.wB?8:16,bs=(0,a.X$)((({stickerSet:e,loadAndPlay:t,index:n,observeIntersection:s,shouldRender:r,onStickerSelect:o,onStickerUnfave:d})=>{const m=(0,a.sO)(null);(0,dn._N)(m,s);const{transitionClassNames:u}=(0,j.Z)(r,void 0,void 0,"slow"),h=i.wB?Math.floor((c.Z.get().width-8)/(l.Q+fs)):5,Z=Math.ceil(e.count/h)*(l.Q+fs);return a.ZP.createElement("div",{ref:m,key:e.id,id:`sticker-set-${n}`,className:"symbol-set"},a.ZP.createElement("p",{className:"symbol-set-name"},e.title),a.ZP.createElement("div",{className:(0,_.Z)("symbol-set-container",u),style:`height: ${Z}px;`},r&&e.stickers&&e.stickers.map((n=>a.ZP.createElement(gn.Z,{key:n.id,sticker:n,size:l.Q,observeIntersection:s,noAnimate:!t,onClick:o,clickArg:n,onUnfaveClick:"favorite"===e.id?d:void 0})))))})),ys=[],Is=(0,a.X$)((0,s.c$)((e=>{const{setsById:t,added:n,recent:a,favorite:s}=e.stickers;return{recentStickers:a.stickers,favoriteStickers:s.stickers,stickerSetsById:t,addedSetIds:n.setIds,shouldPlay:e.settings.byKey.shouldLoopStickers}}),((e,t)=>(0,h.ei)(t,["loadStickerSets","loadRecentStickers","loadFavoriteStickers","loadAddedStickers","addRecentSticker","unfaveSticker"])))((({className:e,loadAndPlay:t,canSendStickers:n,recentStickers:s,favoriteStickers:r,addedSetIds:o,stickerSetsById:c,shouldPlay:d,onStickerSelect:m,loadStickerSets:u,loadRecentStickers:h,loadFavoriteStickers:Z,loadAddedStickers:P,addRecentSticker:g,unfaveSticker:v})=>{const p=(0,a.sO)(null),E=(0,a.sO)(null),[C,f]=(0,a.eJ)(0),{observe:b}=(0,dn.S1)({rootRef:p,throttleMs:200},(e=>{e.forEach((e=>{const{id:t}=e.target;if(!t||!t.startsWith("sticker-set-"))return;const n=Number(t.replace("sticker-set-",""));ys[n]=e.isIntersecting}));const t=ys.map(((e,t)=>({index:t,isIntersecting:e}))).filter((({isIntersecting:e})=>e));t.length&&f(t[Math.floor(t.length/2)].index)})),{observe:y}=(0,dn.S1)({rootRef:E}),I=(0,M.Z)(),w=Boolean(o),N=(0,a.Ye)((()=>o?[{id:"recent",title:I("RecentStickers"),stickers:s,count:s.length},{id:"favorite",title:I("FavoriteStickers"),stickers:r,count:r.length},...o.map((e=>c[e])).filter(Boolean)]:Ye.D),[o,I,s,r,c]),k=(0,a.Ye)((()=>w&&0===N.filter((e=>{var t;return null===(t=e.stickers)||void 0===t?void 0:t.length})).length),[N,w]);(0,a.d4)((()=>{t&&(u(),h(),Z())}),[t,Z,h,u]),(0,a.d4)((()=>{null!=o&&o.length&&P()}),[o,P]),(0,Ke.Z)(E.current),(0,a.d4)((()=>{if(!w)return;const e=E.current;if(!e)return;const t=52*C-(e.offsetWidth/2-26);(0,us.Z)(e,t)}),[w,C]);const S=(0,a.I4)((e=>{f(e);const t=document.getElementById(`sticker-set-${e}`);(0,ts.Z)(p.current,t,"start",void 0,500)}),[]),T=(0,a.I4)((e=>{m(e),g({sticker:e})}),[g,m]),F=(0,a.I4)((e=>{v({sticker:e})}),[v]),A=(0,mt.Z)([],l.Y),L=(0,_.Z)("StickerPicker",e);return w&&A&&!k&&n?a.ZP.createElement("div",{className:L},a.ZP.createElement("div",{ref:E,className:"StickerPicker-header no-selection no-scrollbar"},N.map((function(e,t){var n;const s=null===(n=e.stickers)||void 0===n?void 0:n[0],r=(0,_.Z)("symbol-set-button sticker-set-button",t===C&&"activated");return"recent"===e.id||"favorite"===e.id||e.hasThumbnail||!s?a.ZP.createElement(R.Z,{key:e.id,className:r,ariaLabel:e.title,round:!0,faded:"recent"===e.id||"favorite"===e.id,color:"translucent",onClick:()=>S(t)},"recent"===e.id?a.ZP.createElement("i",{className:"icon-recent"}):"favorite"===e.id?a.ZP.createElement("i",{className:"icon-favorite"}):e.isAnimated?a.ZP.createElement(Zn,{stickerSet:e,observeIntersection:y}):a.ZP.createElement(Pn,{stickerSet:e,observeIntersection:y})):a.ZP.createElement(gn.Z,{key:e.id,sticker:s,size:l.DC,title:e.title,className:r,observeIntersection:y,onClick:S,clickArg:t})}))),a.ZP.createElement("div",{ref:p,className:(0,_.Z)("StickerPicker-main no-selection",i.$b?"no-scrollbar":"custom-scroll")},N.map(((e,n)=>a.ZP.createElement(bs,{key:e.id,stickerSet:e,loadAndPlay:Boolean(d&&t),index:n,observeIntersection:b,shouldRender:C>=n-1&&C<=n+1,onStickerSelect:T,onStickerUnfave:F}))))):a.ZP.createElement("div",{className:L},n?k?a.ZP.createElement("div",{className:"picker-disabled"},"You have no saved Stickers."):a.ZP.createElement(Pe.Z,null):a.ZP.createElement("div",{className:"picker-disabled"},"Sending stickers is not allowed in this chat."))})));var ws=n(386);function Ns(){return(Ns=Object.assign||function(e){for(var t=1;t{var l,i;const c=(0,a.sO)(null),d=(0,a.sO)(null),m=Boolean(null===(l=e.thumbnail)||void 0===l?void 0:l.dataUri),u=`gif${e.id}`,h=(0,dn.Op)(c,t)&&!n,Z=(0,p.Z)(`${u}?size=m`,!h,r.IU.BlobUrl),P=(0,Tn.Z)(null===(i=e.thumbnail)||void 0===i?void 0:i.dataUri,Boolean(Z)),g=(0,p.Z)(u,!h,r.IU.BlobUrl),v=Boolean(h&&g),{isBuffered:E,bufferingHandlers:C}=(0,H.Z)(!0),f=h&&!E,b=h&&E;(0,q.Z)(d,[v]);const y=(0,a.I4)((()=>o({...e,blobUrl:g})),[o,e,g]),I=(0,_.Z)("GifButton",e.width&&e.height&&e.width({savedGifs:e.gifs.saved.gifs})),((e,t)=>(0,h.ei)(t,["loadSavedGifs"])))((({className:e,loadAndPlay:t,canSendGifs:n,savedGifs:s,onGifSelect:r,loadSavedGifs:o})=>{const c=(0,a.sO)(null),{observe:d}=(0,dn.S1)({rootRef:c,debounceMs:300});(0,a.d4)((()=>{t&&o()}),[t,o]);const m=(0,mt.Z)([],l.Y);return a.ZP.createElement("div",{ref:c,className:(0,_.Z)("GifPicker",e,i.$b?"no-scrollbar":"custom-scroll")},n?m&&s&&s.length?s.map((e=>a.ZP.createElement(ks,{key:e.id,gif:e,observeIntersection:d,isDisabled:!t,onClick:r}))):m&&s?a.ZP.createElement("div",{className:"picker-disabled"},"No saved GIFs."):a.ZP.createElement(Pe.Z,null):a.ZP.createElement("div",{className:"picker-disabled"},"Sending GIFs is not allowed in this chat."))})));let Ms;!function(e){e[e.Emoji=0]="Emoji",e[e.Stickers=1]="Stickers",e[e.GIFs=2]="GIFs"}(Ms||(Ms={}));const Ts=Object.values(Ms).filter((e=>"string"==typeof e)),Fs={[Ms.Emoji]:"icon-smile",[Ms.Stickers]:"icon-stickers",[Ms.GIFs]:"icon-gifs"},As=(0,a.X$)((({activeTab:e,onSwitchTab:t,onRemoveSymbol:n,onSearchOpen:s})=>{const r=(0,M.Z)();function o(n){return a.ZP.createElement(R.Z,{className:"symbol-tab-button "+(e===n?"activated":""),onClick:()=>t(n),ariaLabel:Ts[n],round:!0,faded:!0,color:"translucent"},a.ZP.createElement("i",{className:Fs[n]}))}const l=(0,a.I4)((()=>{s(e===Ms.Stickers?"stickers":"gifs")}),[e,s]);return a.ZP.createElement("div",{className:"SymbolMenu-footer",onClick:function(e){e.stopPropagation()},dir:r.isRtl?"rtl":void 0},e!==Ms.Emoji&&a.ZP.createElement(R.Z,{className:"symbol-search-button",ariaLabel:e===Ms.Stickers?"Search Stickers":"Search GIFs",round:!0,faded:!0,color:"translucent",onClick:l},a.ZP.createElement("i",{className:"icon-search"})),o(Ms.Emoji),o(Ms.Stickers),o(Ms.GIFs),e===Ms.Emoji&&a.ZP.createElement(R.Z,{className:"symbol-delete-button",onClick:n,ariaLabel:"Remove Symbol",round:!0,faded:!0,color:"translucent"},a.ZP.createElement("i",{className:"icon-delete-left"})))}));let Ls=!1;const Rs=(0,a.X$)((0,s.c$)((e=>({isLeftColumnShown:e.isLeftColumnShown})))((({isOpen:e,allowedAttachmentOptions:t,isLeftColumnShown:n,onLoad:s,onClose:r,onEmojiSelect:o,onStickerSelect:l,onGifSelect:c,onRemoveSymbol:d,onSearchOpen:m,addRecentEmoji:u})=>{const[h,Z]=(0,a.eJ)(0),[P,g]=(0,a.eJ)([]),[v,p]=(0,ds.Z)(e,r,void 0,i.wB),{shouldRender:E,transitionClassNames:C}=(0,j.Z)(e,r,!1,!1);!Ls&&e&&(Ls=!0),(0,a.d4)((()=>{s()}),[s]),(0,a.bt)((()=>{if(i.wB)return e&&(document.body.classList.add("enable-symbol-menu-transforms"),document.body.classList.add("is-symbol-menu-open")),()=>{e&&(0,z.T2)((()=>{document.body.classList.remove("is-symbol-menu-open"),setTimeout((()=>{document.body.classList.remove("enable-symbol-menu-transforms")}),350)}))}}),[e]);const f=(0,a.sO)(P);f.current=P,(0,a.d4)((()=>{f.current.length&&(f.current.forEach((e=>{u({emoji:e})})),g([]))}),[e,h,u]);const b=(0,a.I4)(((e,t)=>{g((e=>[...e,t])),o(e)}),[o]),y=(0,a.I4)((e=>{r(),m(e)}),[r,m]),I=(0,a.I4)((e=>{l(e,!0)}),[l]),w=(0,M.Z)(),{canSendStickers:N,canSendGifs:k}=t;function S(t,n){switch(h){case Ms.Emoji:return a.ZP.createElement(Cs,{className:"picker-tab",onEmojiSelect:b});case Ms.Stickers:return a.ZP.createElement(Is,{className:"picker-tab",loadAndPlay:!!N&&e&&(t||n),canSendStickers:N,onStickerSelect:I});case Ms.GIFs:return a.ZP.createElement(Ss,{className:"picker-tab",loadAndPlay:!!k&&e&&(t||n),canSendGifs:k,onGifSelect:c})}}const T=a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("div",{className:"SymbolMenu-main",onClick:function(e){e.stopPropagation()}},Ls&&a.ZP.createElement(L.Z,{name:"slide",activeKey:h,renderCount:Ts.length},S)),i.wB&&a.ZP.createElement(R.Z,{round:!0,faded:!0,color:"translucent",ariaLabel:w("Close"),className:"symbol-close-button",size:"tiny",onClick:r},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement(As,{activeTab:h,onSwitchTab:Z,onRemoveSymbol:d,onSearchOpen:y}));if(i.wB){if(!E)return;const e=(0,_.Z)("SymbolMenu mobile-menu",C,!n&&"middle-column-open");return a.ZP.createElement(Xa.Z,null,a.ZP.createElement("div",{className:e},T))}return a.ZP.createElement(xa.Z,{isOpen:e,positionX:"left",positionY:"bottom",onClose:r,className:"SymbolMenu",onCloseAnimationEnd:r,onMouseEnter:i.$b?void 0:v,onMouseLeave:i.$b?void 0:p,noCloseOnBackdrop:!i.$b},T)}))),$s=(0,a.X$)((({isOpen:e,allowedAttachmentOptions:t,onFileSelect:n,onPollCreate:s,onClose:r})=>{const[o,c]=(0,ds.Z)(e,r),d=(0,a.I4)(((e,t)=>{const{files:a}=e.target;a&&a.length>0&&n(Array.from(a),t)}),[n]),m=(0,a.I4)((()=>{bn(Array.from(l.AK).join(","),(e=>d(e,!0)))}),[d]),u=(0,a.I4)((()=>{bn("*",(e=>d(e,!1)))}),[d]),h=(0,M.Z)(),{canAttachMedia:Z,canAttachPolls:P}=t;return a.ZP.createElement(xa.Z,{isOpen:e,autoClose:!0,positionX:"right",positionY:"bottom",onClose:r,className:"AttachMenu fluid",onCloseAnimationEnd:r,onMouseEnter:i.$b?void 0:o,onMouseLeave:i.$b?void 0:c,noCloseOnBackdrop:!i.$b},!Z&&a.ZP.createElement(G.Z,{className:"media-disabled",disabled:!0},"Posting media content is not allowed in this group."),Z&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(G.Z,{icon:"photo",onClick:m},h("AttachmentMenu.PhotoOrVideo")),a.ZP.createElement(G.Z,{icon:"document",onClick:u},h("AttachDocument"))),P&&a.ZP.createElement(G.Z,{icon:"poll",onClick:s},h("Poll")))})),Bs=(0,a.X$)((({withAvatar:e,focus:t,botCommand:n,bot:s,onClick:r})=>a.ZP.createElement(Ee.Z,{key:n.command,className:(0,_.Z)("BotCommand chat-item-clickable scroll-item",e&&"with-avatar"),multiline:!0,onClick:()=>r(n),focus:t},e&&a.ZP.createElement(D.Z,{size:"small",user:s}),a.ZP.createElement("div",{className:"content-inner"},a.ZP.createElement("span",{className:"title"},"/",n.command),a.ZP.createElement("span",{className:"subtitle"},(0,B.Z)(n.description)))))),Ds=(0,a.X$)((0,s.c$)((e=>({usersById:e.users.byId})),((e,t)=>(0,h.ei)(t,["sendBotCommand"])))((({usersById:e,isOpen:t,withUsername:n,botCommands:s,onClick:r,onClose:o,sendBotCommand:l})=>{const i=(0,a.sO)(null),{shouldRender:c,transitionClassNames:d}=(0,j.Z)(t,void 0,void 0,!1),m=(0,a.I4)((({botId:t,command:a})=>{const s=e[t];l({command:`/${a}${n&&s?`@${s.username}`:""}`,botId:t}),r()}),[r,l,e,n]),u=ss({isActive:t,items:s,onSelect:m,onClose:o});(0,a.d4)((()=>{s&&!s.length&&o()}),[s,o]),(0,a.d4)((()=>{ns(".chat-item-clickable",u,i)}),[u]);const h=(0,f.Z)(s&&s.length?s:void 0,c),Z=s&&!s.length?h:s;if(!c||Z&&!Z.length)return;const P=(0,_.Z)("BotCommandTooltip composer-tooltip custom-scroll",d);return a.ZP.createElement("div",{className:P,ref:i},Z&&Z.map(((t,n)=>a.ZP.createElement(Bs,{key:`${t.botId}_${t.command}`,botCommand:t,bot:e[t.botId],withAvatar:!0,onClick:m,focus:u===n}))))}))),Us=(0,a.X$)((0,s.c$)(void 0,((e,t)=>(0,h.ei)(t,["sendBotCommand"])))((({isOpen:e,botCommands:t,onClose:n,sendBotCommand:s})=>{const[r,o]=(0,ds.Z)(e,n,void 0,i.wB),l=(0,a.I4)((e=>{s({command:`/${e.command}`,botId:e.botId}),n()}),[n,s]);return a.ZP.createElement(xa.Z,{isOpen:e,positionX:"left",positionY:"bottom",onClose:n,className:"BotCommandMenu",onCloseAnimationEnd:n,onMouseEnter:i.$b?void 0:r,onMouseLeave:i.$b?void 0:o,noCloseOnBackdrop:!i.$b},t.map((e=>a.ZP.createElement(Bs,{key:e.command,botCommand:e,onClick:l}))))}))),xs=(0,a.X$)((0,s.c$)((e=>{const{stickers:t}=e.stickers.forEmoji;return{stickers:t}}),((e,t)=>(0,h.ei)(t,["clearStickersForEmoji"])))((({isOpen:e,onStickerSelect:t,stickers:n,clearStickersForEmoji:s})=>{const r=(0,a.sO)(null),{shouldRender:o,transitionClassNames:c}=(0,j.Z)(e,void 0,void 0,!1),d=(0,f.Z)(n,!0),m=n||d,{observe:u}=(0,dn.S1)({rootRef:r,throttleMs:200});(0,a.d4)((()=>e?(0,P.Z)(s):void 0),[e,s]);const h=(0,_.Z)("StickerTooltip composer-tooltip custom-scroll",c,!(null!=m&&m.length)&&"hidden");return a.ZP.createElement("div",{ref:r,className:h,onMouseEnter:i.$b?void 0:()=>{document.body.classList.add("no-select")},onMouseLeave:i.$b?void 0:()=>{document.body.classList.remove("no-select")}},o&&m?m.map((e=>a.ZP.createElement(gn.Z,{key:e.id,sticker:e,size:l.Q,observeIntersection:u,onClick:t,clickArg:e}))):o?a.ZP.createElement(Pe.Z,null):void 0)}))),Os=(0,a.X$)((({isOpen:e,onSilentSend:t,onScheduleSend:n,onClose:s,onCloseAnimationEnd:r})=>{const[o,l]=(0,ds.Z)(e,s),c=(0,M.Z)();return a.ZP.createElement(xa.Z,{isOpen:e,autoClose:!0,positionX:"right",positionY:"bottom",className:"CustomSendMenu",onClose:s,onCloseAnimationEnd:r,onMouseEnter:i.$b?void 0:o,onMouseLeave:i.$b?void 0:l,noCloseOnBackdrop:!i.$b},t&&a.ZP.createElement(G.Z,{icon:"mute",onClick:t},c("SendWithoutSound")),n&&a.ZP.createElement(G.Z,{icon:"schedule",onClick:n},c("ScheduleMessage")))}));var Gs=n(2420),Js=n(3283),Xs=n(2678);const zs=(0,a.X$)((({isOpen:e,emojis:t,onClose:n,onEmojiSelect:s,addRecentEmoji:r})=>{const o=(0,a.sO)(null),{shouldRender:l,transitionClassNames:c}=(0,j.Z)(e,void 0,void 0,!1),d=(0,Xs.Z)(t.length?t:void 0,350)||[],m=(0,a.I4)((e=>{s(e.native),r({emoji:e.id})}),[r,s]),u=(0,a.I4)(((e,t)=>{s(e),r({emoji:t})}),[r,s]),h=ss({isActive:e,isHorizontal:!0,items:t,onSelect:m,onClose:n});(0,a.d4)((()=>{!function(e,t){const n=t.current;if(!n)return;const{visibleIndexes:a,allElements:s}=Qa(n,".EmojiButton",8,!0,!0,!0);if(!s.length||!s[e])return;const r=a[0];if(!a.includes(e)||e===r&&!es(n,s[r],!0)){const t="start"==(e>a[a.length-1]?"start":"end")?44*e:0;(0,us.Z)(n,t)}}(h,o)}),[h]);const Z=(0,_.Z)("EmojiTooltip composer-tooltip custom-scroll-x",c);return a.ZP.createElement("div",{ref:o,className:Z,onMouseEnter:i.$b?void 0:()=>{document.body.classList.add("no-select")},onMouseLeave:i.$b?void 0:()=>{document.body.classList.remove("no-select")}},l&&d?d.map(((e,t)=>a.ZP.createElement(hs,{key:e.id,emoji:e,focus:h===t,onClick:u}))):l?a.ZP.createElement(Pe.Z,null):void 0)})),_s=(0,a.X$)((({title:e,description:t,thumbnail:n,thumbUrl:s,focus:r,transitionClassNames:o="",onClick:l})=>{let i="";const c=(0,p.Z)(n?`webDocument:${n.url}`:void 0);return(s=s||c)?i=a.ZP.createElement("img",{src:s,className:o,alt:"",decoding:"async",draggable:"false"}):e&&(i=(0,hn.Xv)(e,1)),a.ZP.createElement(Ee.Z,{focus:r,className:"BaseResult chat-item-clickable",onMouseDown:ws.b,onClick:l},a.ZP.createElement("span",{className:"thumb"},"string"==typeof i?(0,B.Z)(i):i),a.ZP.createElement("div",{className:"content-inner"},e&&a.ZP.createElement("div",{className:"title"},e),t&&a.ZP.createElement("div",{className:"description"},t)))})),Ys=(0,a.X$)((({focus:e,isForGallery:t,inlineResult:n,onClick:s})=>{var r;let o,l,i;"photo"in n&&(o=n.photo),"thumbnail"in n&&(l=n.thumbnail),"webThumbnail"in n&&t&&(i=n.webThumbnail);const c=(0,p.Z)(i?`webDocument:${i.url}`:void 0),d=(0,p.Z)(o&&`photo${o.id}?size=m`),{shouldRenderThumb:m,shouldRenderFullMedia:u,transitionClassNames:h}=(0,un.Z)(d,"slow"),Z=(0,a.I4)((()=>{s(n)}),[n,s]);var P,g;if(t)return a.ZP.createElement("div",{className:"MediaResult chat-item-clickable",onClick:Z},m&&a.ZP.createElement("img",{src:(null===(P=o)||void 0===P||null===(g=P.thumbnail)||void 0===g?void 0:g.dataUri)||c,alt:""}),u&&a.ZP.createElement("img",{src:d,className:`${h} full-media`,alt:""}));const{title:v,description:E}=n;return a.ZP.createElement(_s,{focus:e,thumbUrl:u?d:(null===(r=l)||void 0===r?void 0:r.dataUri)||c,transitionClassNames:u?h:void 0,title:v,description:E,onClick:Z})})),js=(0,a.X$)((({focus:e,inlineResult:t,onClick:n})=>{const{title:s,url:r,description:o,webThumbnail:l}=t,i=(0,a.I4)((()=>{n(t)}),[t,n]);return a.ZP.createElement(_s,{focus:e,thumbnail:l,title:s||r,description:o,onClick:i})})),Hs=(0,a.X$)((({inlineResult:e,observeIntersection:t,onClick:n})=>{const{gif:s}=e,r=(0,a.I4)((()=>{n(e)}),[e,n]);if(s)return a.ZP.createElement(ks,{gif:s,observeIntersection:t,className:"chat-item-clickable",onClick:r})})),Vs=(0,a.X$)((({inlineResult:e,observeIntersection:t,onClick:n})=>{const{sticker:s}=e;if(s)return a.ZP.createElement(gn.Z,{sticker:s,size:l.zq,observeIntersection:t,title:s.emoji,className:"chat-item-clickable",onClick:n,clickArg:e})})),qs=(0,z.P2)((e=>e()),500,!0),Ks=(0,a.X$)((0,s.c$)(void 0,((e,t)=>(0,h.ei)(t,["startBot","openChat","sendInlineBotResult"])))((({isOpen:e,botId:t,isGallery:n,inlineBotResults:s,switchPm:r,loadMore:l,onClose:c,openChat:d,startBot:m,onSelectResult:u})=>{const h=(0,a.sO)(null),{shouldRender:Z,transitionClassNames:P}=(0,j.Z)(e,void 0,void 0,!1),{observe:g}=(0,dn.S1)({rootRef:h,debounceMs:200,isDisabled:!e}),v=(0,a.I4)((({direction:e})=>{e===o.Uq.Backwards&&qs(l)}),[l]),p=ss({isActive:e,shouldRemoveSelectionOnReset:n,noArrowNavigation:n,items:s,onSelect:u,onClose:c});(0,a.d4)((()=>{ns(".chat-item-clickable",p,h)}),[p]);const E=(0,a.I4)((()=>{d({id:t}),m({botId:t,param:r.startParam})}),[t,d,m,r]),C=(0,f.Z)(null!=s&&s.length?s:void 0,Z),b=s&&!s.length?C:s;if(!Z||!b||!b.length&&!r)return;const y=(0,_.Z)("InlineBotTooltip composer-tooltip",i.$b?"no-scrollbar":"custom-scroll",n&&"gallery",P);return a.ZP.createElement(pe.Z,{ref:h,className:y,items:b,itemSelector:".chat-item-clickable",noFastList:!0,onLoadMore:v,sensitiveArea:160},r&&a.ZP.createElement(Ee.Z,{ripple:!0,className:"switch-pm scroll-item",onClick:E},a.ZP.createElement("span",{className:"title"},r.text)),b.map(((e,t)=>{switch(e.type){case"gif":return a.ZP.createElement(Hs,{key:e.id,inlineResult:e,observeIntersection:g,onClick:u});case"photo":return a.ZP.createElement(Ys,{key:e.id,isForGallery:n,inlineResult:e,onClick:u});case"sticker":return a.ZP.createElement(Vs,{key:e.id,inlineResult:e,observeIntersection:g,onClick:u});case"video":case"game":return a.ZP.createElement(Ys,{key:e.id,focus:p===t,inlineResult:e,onClick:u});case"article":case"audio":return a.ZP.createElement(js,{key:e.id,focus:p===t,inlineResult:e,onClick:u});default:return}})))})));var Ws=n(6844);const Qs=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{const n=(0,m.Z1)(e,t),a=n&&(0,m.Zw)(e,n.id);if(!n||!a)return{};const{query:s,results:r}=(0,m.n5)(e)||{},{totalCount:o,foundIds:l}=r||{};return{chat:n,messagesById:a,query:s,totalCount:o,foundIds:l}}),((e,t)=>(0,h.ei)(t,["searchTextMessagesLocal","focusMessage"])))((({chatId:e,threadId:t,onClose:n,isActive:r,chat:o,messagesById:l,query:i,totalCount:c,foundIds:d,searchTextMessagesLocal:Z,focusMessage:P})=>{const g=(0,M.Z)(),v=(0,a.Ye)((()=>{if(!(i&&d&&d.length&&l))return Ye.D;const n=d.map((n=>{const a=l[n];if(!a)return;const r=a.senderId?(0,m.dy)((0,s.Rd)(),a.senderId):void 0;let i;if(o&&(0,u.eA)(o))i=o;else if(a.forwardInfo){const{isChannelPost:e,fromChatId:t}=a.forwardInfo;i=e&&t?(0,m.Z1)((0,s.Rd)(),t):void 0}else i=a.senderId?(0,m.Z1)((0,s.Rd)(),a.senderId):void 0;return{message:a,senderUser:r,senderChat:i,onClick:()=>P({chatId:e,threadId:t,messageId:n})}})).filter(Boolean);return(0,h.Xo)(n,(({message:e})=>e.date),"desc")}),[e,t,P,d,o,l,i]);(0,T.ZP)(r,n);const p=(0,a.sO)(null),E=(0,Ze.Z)(p,!0,(e=>{const t=null==v?void 0:v[-1===e?0:e];t&&t.onClick()}),".ListItem-button",!0);return a.ZP.createElement(pe.Z,{className:"RightSearch custom-scroll",items:v,preloadBackwards:0,onLoadMore:Z,noFastList:!0,onKeyDown:E,ref:p},a.ZP.createElement("p",{className:"helper-text",dir:"auto"},i?0!==c&&v.length?1===c?"1 message found":`${v.length&&(c||v.length)} messages found`:g("lng_search_no_results"):g("lng_dlg_search_for_messages")),v.map((({message:e,senderUser:t,senderChat:n,onClick:s})=>{const r=n?(0,u.U)(g,n):(0,u.Js)(t),o=(0,u.MK)(g,e);return a.ZP.createElement(Ee.Z,{className:"chat-item-clickable search-result-message m-0",onClick:s},a.ZP.createElement(D.Z,{chat:n,user:t}),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},r&&(0,B.Z)(r)),a.ZP.createElement(Ws.Z,{message:e})),a.ZP.createElement("div",{className:"subtitle",dir:"auto"},(0,B.Z)(o,["emoji","highlight"],{highlight:i}))))})))})));var er=n(9290);const tr=(0,a.X$)((0,s.c$)(((e,{stickerSetId:t})=>({set:(0,m.Ny)(e,t),shouldPlay:(0,m.yB)(e)})),((e,t)=>(0,h.ei)(t,["loadStickers","toggleStickerSet"])))((({stickerSetId:e,observeIntersection:t,set:n,shouldPlay:s,loadStickers:r,toggleStickerSet:o,isSomeModalOpen:i,onModalToggle:c})=>{const d=(0,M.Z)(),m=n&&Boolean(n.installedDate),u=Boolean(null==n?void 0:n.stickers),[h,Z,P]=(0,Fe.Z)();(0,er.Z)((()=>{c(h)}),[h,c]);const g=(0,a.Ye)((()=>{if(!n)return[];const e=(n.covers||[]).map((({id:e})=>e)),t=n.stickers?n.stickers.filter((({id:t})=>!e.includes(t))):[];return[...n.covers||[],...t].slice(0,5)}),[n]);(0,a.d4)((()=>{!u&&g.length<5&&r({stickerSetId:e})}),[u,g.length,r,e]);const v=(0,a.I4)((()=>{o({stickerSetId:e})}),[o,e]);if(!n)return;const p=g.length>0;return a.ZP.createElement("div",{key:n.id,className:"sticker-set",dir:d.isRtl?"rtl":void 0},a.ZP.createElement("div",{className:"sticker-set-header"},a.ZP.createElement("div",{className:"title-wrapper"},a.ZP.createElement("h3",{className:"title",dir:"auto"},n.title),a.ZP.createElement("p",{className:"count",dir:"auto"},d("Stickers",n.count,"i"))),a.ZP.createElement(R.Z,{className:m?"is-added":void 0,color:"primary",size:"tiny",pill:!0,fluid:!0,onClick:v},d(m?"Stickers.Installed":"Stickers.Install"))),a.ZP.createElement("div",{className:"sticker-set-main"},!p&&a.ZP.createElement(F.Z,null),p&&g.map((e=>a.ZP.createElement(gn.Z,{sticker:e,size:l.Y7,observeIntersection:t,noAnimate:!s||h||i,onClick:Z})))),p&&a.ZP.createElement(pn.Z,{isOpen:h,fromSticker:g[0],onClose:P}))}))),nr=(0,z.P2)((e=>e()),6e4,!0),ar=(0,a.X$)((0,s.c$)((e=>{const t=(0,m.y5)(e),{query:n,resultIds:a}=t||{},{featured:s}=e.stickers;return{query:n,featuredIds:s.setIds,resultIds:a}}),((e,t)=>(0,h.ei)(t,["loadFeaturedStickers"])))((({onClose:e,isActive:t,query:n,featuredIds:s,resultIds:r,loadFeaturedStickers:o})=>{const l=(0,a.sO)(null),i=(0,M.Z)(),[c,d]=(0,a.eJ)(!1),{observe:m}=(0,dn.S1)({rootRef:l,throttleMs:200});return(0,a.d4)((()=>{nr((()=>{o()}))})),(0,T.ZP)(t,e),a.ZP.createElement("div",{ref:l,className:"StickerSearch custom-scroll",dir:i.isRtl?"rtl":void 0},function(){if(void 0!==n)return!n&&s?s.map((e=>a.ZP.createElement(tr,{key:e,stickerSetId:e,observeIntersection:m,isSomeModalOpen:c,onModalToggle:d}))):r?r.length?r.map((e=>a.ZP.createElement(tr,{key:e,stickerSetId:e,observeIntersection:m,isSomeModalOpen:c,onModalToggle:d}))):a.ZP.createElement("p",{className:"helper-text",dir:"auto"},"Nothing found."):a.ZP.createElement(Pe.Z,null)}())}))),sr=(0,a.X$)((0,s.c$)((e=>{const t=(0,m.yN)(e),{query:n,results:a}=t||{},{chatId:s}=(0,m.Bt)(e)||{},r=s?(0,m.Z1)(e,s):void 0;return{query:n,results:a,chat:r,isChatWithBot:r?(0,m.xo)(e,r):void 0}}),((e,t)=>(0,h.ei)(t,["searchMoreGifs","sendMessage","setGifSearchQuery"])))((({onClose:e,isActive:t,query:n,results:s,chat:r,isChatWithBot:o,searchMoreGifs:l,sendMessage:c,setGifSearchQuery:d})=>{const m=(0,a.sO)(null),{observe:h}=(0,dn.S1)({rootRef:m,debounceMs:300}),{canSendGifs:Z}=(0,u.H5)(r,o),P=(0,a.I4)((e=>{Z&&c({gif:e}),i.$b&&d({query:void 0})}),[Z,c,d]),g=(0,M.Z)();(0,T.ZP)(t,e);const v=Boolean(void 0!==n&&s&&s.length);return a.ZP.createElement("div",{className:"GifSearch",dir:g.isRtl?"rtl":void 0},a.ZP.createElement(pe.Z,{ref:m,className:(0,_.Z)("gif-container custom-scroll",v&&"grid"),items:s,itemSelector:".GifButton",preloadBackwards:96,noFastList:!0,onLoadMore:l},function(){if(void 0!==n)return s?s.length?s.map((e=>a.ZP.createElement(ks,{key:e.id,gif:e,observeIntersection:h,onClick:P}))):a.ZP.createElement("p",{className:"helper-text",dir:"auto"},g("NoGIFsFound")):a.ZP.createElement(Pe.Z,null)}()))}))),rr=(0,a.X$)((0,s.c$)(((e,{answer:t})=>{const{voters:n,offsets:a}=e.pollResults;return{voters:null==n?void 0:n[t.option],offset:(null==a?void 0:a[t.option])||""}}),((e,t)=>(0,h.ei)(t,["loadPollOptionResults","openChat","closePollResults"])))((({chat:e,message:t,answer:n,answerVote:s,totalVoters:r,voters:o,offset:l,loadPollOptionResults:i,openChat:c,closePollResults:d})=>{const m=(0,f.Z)(s.votersCount),[u,h]=(0,a.eJ)(!0),Z=Boolean(o),{option:P,text:g}=n,v=(0,M.Z)();(0,a.d4)((()=>{Z&&m===s.votersCount||i({chat:e,messageId:t.id,option:P,offset:l,limit:4,shouldResetVoters:!0})}),[s.votersCount,Z]);const p=(0,a.I4)((()=>{h(!0),i({chat:e,messageId:t.id,option:P,offset:l,limit:50})}),[e,i,t.id,l,P]);(0,a.d4)((()=>{h(!1)}),[o]);const E=(0,a.I4)((e=>{c({id:e}),d()}),[d,c]);return a.ZP.createElement("div",{className:"PollAnswerResults"},a.ZP.createElement("div",{className:"poll-voters"},o?o.map((e=>a.ZP.createElement(Ee.Z,{key:e,className:"chat-item-clickable",onClick:()=>E(e)},a.ZP.createElement(Ce.Z,{avatarSize:"tiny",userId:e,forceShowSelf:!0,noStatusOrTyping:!0})))):a.ZP.createElement(Pe.Z,null),o&&function(){const e=s.votersCount-o.length;return s.votersCount>4&&e>0&&a.ZP.createElement(tn,{count:e,itemName:"voter",isLoading:u,onClick:p})}()),a.ZP.createElement("div",{className:"answer-head",dir:v.isRtl?"rtl":void 0},a.ZP.createElement("span",{className:"answer-title",dir:"auto"},g),a.ZP.createElement("span",{className:"answer-percent",dir:v.isRtl?"auto":void 0},(C=s.votersCount,(b=r)>0?(C/b*100).toFixed():0),"%")));var C,b}))),or=(0,a.X$)((0,s.c$)((e=>{const{pollResults:{chatId:t,messageId:n},lastSyncTime:a}=e;return t&&n?{chat:(0,m.Z1)(e,t),message:(0,m.hj)(e,t,n),lastSyncTime:a}:{}}))((({onClose:e,isActive:t,chat:n,message:s,lastSyncTime:r})=>{const o=(0,M.Z)();if((0,T.ZP)(t,e),!s||!n)return a.ZP.createElement(Pe.Z,null);const{summary:l,results:i}=(0,u.t9)(s);if(!i.results)return;const c=(0,h.ee)(i.results,"option");return a.ZP.createElement("div",{className:"PollResults",dir:o.isRtl?"rtl":void 0},a.ZP.createElement("h3",{className:"poll-question",dir:"auto"},l.question),a.ZP.createElement("div",{className:"poll-results-list custom-scroll"},r&&l.answers.map((e=>a.ZP.createElement(rr,{key:`${s.id}-${e.option}`,chat:n,message:s,answer:e,answerVote:c[e.option],totalVoters:i.totalVoters}))),!r&&a.ZP.createElement(Pe.Z,null)))}))),lr="Please provide first name",ir=(0,a.X$)((0,s.c$)(((e,{userId:t})=>{const n=(0,m.dy)(e,t),a=(0,m.Z1)(e,t),{progress:s}=e.management;return{user:n,chat:a,progress:s,isMuted:(0,u.i4)(a,(0,m.dZ)(e),(0,m.NJ)(e))}}),((e,t)=>(0,h.ei)(t,["updateContact","deleteUser","closeManagement","openChat","deleteHistory"])))((({userId:e,user:t,chat:n,progress:s,isMuted:r,updateContact:l,deleteUser:i,deleteHistory:c,closeManagement:d,openChat:m,onClose:u,isActive:h})=>{const[Z,P,g]=(0,Fe.Z)(),[v,p]=(0,a.eJ)(!1),[E,C]=(0,a.eJ)(),f=(0,M.Z)();(0,T.ZP)(h,u);const b=t&&t.firstName||"",y=t&&t.lastName||"",[I,w]=(0,a.eJ)(b),[N,k]=(0,a.eJ)(y),[S,A]=(0,a.eJ)(!r);(0,a.d4)((()=>{A(!r)}),[r]),(0,a.d4)((()=>{p(!1),g()}),[g,e]),(0,a.d4)((()=>{w(b),k(y)}),[b,y,t]),(0,a.d4)((()=>{s===o.wv.Complete&&(p(!1),C(void 0),g())}),[g,s]);const L=(0,a.I4)((e=>{w(e.target.value),p(!0)}),[]),R=(0,a.I4)((e=>{k(e.target.value),p(!0)}),[]),$=(0,a.I4)((e=>{A(e.target.checked),p(!0)}),[]),B=(0,a.I4)((()=>{const t=I.trim(),n=N.trim();t.length||C(lr),l({userId:e,isMuted:!S,firstName:t,lastName:n})}),[I,N,l,e,S]),D=(0,a.I4)((()=>{c({chatId:n.id,shouldDeleteForAll:!1}),i({userId:e}),g(),d(),m({id:void 0})}),[n.id,g,d,c,i,m,e]);if(!t)return;const U=s===o.wv.InProgress;return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ce.Z,{userId:t.id,avatarSize:"jumbo",status:"original name",withFullInfo:!0}),a.ZP.createElement(ve.Z,{id:"user-first-name",label:f("UserInfo.FirstNamePlaceholder"),onChange:L,value:I,error:E===lr?E:void 0}),a.ZP.createElement(ve.Z,{id:"user-last-name",label:f("UserInfo.LastNamePlaceholder"),onChange:R,value:N}),a.ZP.createElement("div",{className:"ListItem no-selection narrow"},a.ZP.createElement(rn.Z,{checked:S,label:f("Notifications"),subLabel:f(S?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),onChange:$}))),a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{icon:"delete",ripple:!0,destructive:!0,onClick:P},f("DeleteContact")))),a.ZP.createElement(Ot.Z,{isShown:v,onClick:B,disabled:U,ariaLabel:f("Save")},U?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-check"})),a.ZP.createElement(Me.Z,{isOpen:Z,onClose:g,text:f("AreYouSureDeleteContact"),confirmLabel:f("DeleteContact"),confirmHandler:D,confirmIsDestructive:!0}))}))),cr="Group title can't be empty",dr=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{var n;const a=(0,m.Z1)(e,t),{progress:s}=e.management,r=Boolean(null===(n=a.fullInfo)||void 0===n?void 0:n.linkedChatId),o=(0,u.G9)(a);return{chat:a,progress:s,isBasicGroup:o,hasLinkedChannel:r,canChangeInfo:o?a.isCreator:(0,u.VE)(a,"changeInfo"),canBanUsers:o?a.isCreator:(0,u.VE)(a,"banUsers")}}),((e,t)=>(0,h.ei)(t,["togglePreHistoryHidden","updateChat","closeManagement","leaveChannel","deleteChannel","deleteChat","openChat"])))((({chatId:e,chat:t,progress:n,isBasicGroup:s,hasLinkedChannel:l,canChangeInfo:i,canBanUsers:c,onScreenSelect:d,togglePreHistoryHidden:m,updateChat:h,deleteChat:Z,leaveChannel:P,deleteChannel:g,closeManagement:v,openChat:E,onClose:C,isActive:f})=>{var b,y,I;const[w,N,k]=(0,Fe.Z)(),S=t.title,A=t.fullInfo&&t.fullInfo.about||"",[L,R]=(0,a.eJ)(!1),[$,D]=(0,a.eJ)(S),[U,x]=(0,a.eJ)(A),[O,G]=(0,a.eJ)(),[J,X]=(0,a.eJ)(),z=(0,u.RT)(t),_=(0,p.Z)(z,!1,r.IU.BlobUrl),Y=(0,M.Z)();(0,T.ZP)(f,C),(0,a.d4)((()=>{n===o.wv.Complete&&(R(!1),X(void 0))}),[n]);const j=(0,a.I4)((()=>{d(o.u1.ChatPrivacyType)}),[d]),H=(0,a.I4)((()=>{d(o.u1.Discussion)}),[d]),V=(0,a.I4)((()=>{d(o.u1.GroupPermissions)}),[d]),q=(0,a.I4)((()=>{d(o.u1.ChatAdministrators)}),[d]),K=(0,a.I4)((e=>{G(e),R(!0)}),[]),W=(0,a.I4)((e=>{D(e.target.value),R(!0)}),[]),Q=(0,a.I4)((e=>{x(e.target.value),R(!0)}),[]),ee=(0,a.I4)((()=>{const t=$.trim(),n=U.trim();t.length?h({chatId:e,title:t,about:n,photo:O}):X(cr)}),[U,e,O,$,h]),te=(0,a.I4)((()=>{d(o.u1.GroupMembers)}),[d]),ne=(0,a.I4)((()=>{if(!t.fullInfo)return;const{isPreHistoryHidden:e}=t.fullInfo;m({chatId:t.id,isEnabled:!e})}),[t,m]),ae=(0,a.Ye)((()=>{if(!t.defaultBannedRights)return 0;let e=["sendMessages","sendMedia","embedLinks","sendPolls","changeInfo","inviteUsers","pinMessages"].filter((e=>!t.defaultBannedRights[e])).length;const{sendStickers:n,sendGifs:a}=t.defaultBannedRights;return n||a||(e+=1),e}),[t]),se=(null===(b=t.fullInfo)||void 0===b||null===(y=b.adminMembers)||void 0===y?void 0:y.length)||0,re=(0,a.I4)((()=>{s?Z({chatId:t.id}):t.isCreator?g({chatId:t.id}):P({chatId:t.id}),k(),v(),E({id:void 0})}),[s,t.isCreator,t.id,k,v,P,g,Z,E]);if(t.isRestricted)return;const oe=n===o.wv.InProgress;return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section"},a.ZP.createElement(xt.Z,{currentAvatarBlobUrl:_,onChange:K,disabled:!i}),a.ZP.createElement(ve.Z,{id:"group-title",label:Y("GroupName"),onChange:W,value:$,error:J===cr?J:void 0,disabled:!i}),a.ZP.createElement(ve.Z,{id:"group-about",className:"mb-2",label:Y("DescriptionPlaceholder"),onChange:Q,value:U,disabled:!i}),t.isCreator&&a.ZP.createElement(Ee.Z,{icon:"lock",multiline:!0,onClick:j},a.ZP.createElement("span",{className:"title"},Y("GroupType")),a.ZP.createElement("span",{className:"subtitle"},t.username?Y("TypePublic"):Y("TypePrivate"))),l&&a.ZP.createElement(Ee.Z,{icon:"message",multiline:!0,onClick:H},a.ZP.createElement("span",{className:"title"},Y("LinkedChannel")),a.ZP.createElement("span",{className:"subtitle"},Y("DiscussionUnlink"))),a.ZP.createElement(Ee.Z,{icon:"permissions",multiline:!0,onClick:V,disabled:!c},a.ZP.createElement("span",{className:"title"},Y("ChannelPermissions")),a.ZP.createElement("span",{className:"subtitle",dir:"auto"},ae,"/",8)),a.ZP.createElement(Ee.Z,{icon:"admin",multiline:!0,onClick:q},a.ZP.createElement("span",{className:"title"},Y("ChannelAdministrators")),a.ZP.createElement("span",{className:"subtitle"},(0,hn.kh)(se)))),a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{icon:"group",multiline:!0,onClick:te},a.ZP.createElement("span",{className:"title"},Y("GroupMembers")),a.ZP.createElement("span",{className:"subtitle"},(0,hn.kh)(null!==(I=t.membersCount)&&void 0!==I?I:0))),t.fullInfo&&a.ZP.createElement("div",{className:"ListItem narrow no-selection"},a.ZP.createElement(rn.Z,{checked:!t.fullInfo.isPreHistoryHidden,label:Y("ChatHistory"),onChange:ne,disabled:!c}))),a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{icon:"delete",ripple:!0,destructive:!0,onClick:N},Y("DeleteMega")))),a.ZP.createElement(Ot.Z,{isShown:L,onClick:ee,disabled:oe,ariaLabel:Y("Save")},oe?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-check"})),a.ZP.createElement(Me.Z,{isOpen:w,onClose:k,textParts:(0,B.Z)(s||!t.isCreator?Y("AreYouSureDeleteAndExit"):Y("AreYouSureDeleteThisChatWithGroup",t.title),["br","simple_markdown"]),confirmLabel:s||!t.isCreator?Y("DeleteMega"):Y("DeleteGroupForAll"),confirmHandler:re,confirmIsDestructive:!0}))}))),mr=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>({chat:(0,m.Z1)(e,t),currentUserId:e.currentUserId})),((e,t)=>(0,h.ei)(t,["updateChatDefaultBannedRights"])))((({onScreenSelect:e,onChatMemberSelect:t,chat:n,currentUserId:s,updateChatDefaultBannedRights:r,onClose:l,isActive:i})=>{const[c,d]=(0,a.eJ)({}),[m,u]=(0,a.eJ)(!1),[h,Z]=(0,a.eJ)(!1),P=(0,M.Z)();(0,T.ZP)(i,l);const g=(0,a.I4)((()=>{e(o.u1.GroupRemovedUsers)}),[e]),v=(0,a.I4)((()=>{e(o.u1.GroupUserPermissionsCreate)}),[e]),p=(0,a.I4)((n=>{t(n.userId,n.promotedByUserId===s),e(o.u1.GroupUserPermissions)}),[s,t,e]);(0,a.d4)((()=>{d((null==n?void 0:n.defaultBannedRights)||{}),u(!1),setTimeout((()=>{Z(!1)}),250)}),[n]);const E=(0,a.I4)((e=>{const{name:t}=e.target;function n(e){return!e||void 0}d((e=>({...e,[t]:n(e[t]),..."sendStickers"===t&&{sendGifs:n(e[t])}}))),u(!0)}),[]),C=(0,a.I4)((()=>{n&&(Z(!0),r({chatId:n.id,bannedRights:c}))}),[n,c,r]),f=(0,a.Ye)((()=>n&&n.fullInfo&&n.fullInfo.kickedMembers?n.fullInfo.kickedMembers.length:0),[n]),b=(0,a.Ye)((()=>n&&n.fullInfo&&n.fullInfo.members?n.fullInfo.members.filter((({bannedRights:e})=>!!e)):[]),[n]),y=(0,a.I4)((e=>{const{bannedRights:t}=e;if(!t||!n)return;const{defaultBannedRights:a}=n;return Object.keys(t).reduce(((e,n)=>{if(!t[n]||null!=a&&a[n]||"sendInline"===n||"viewMessages"===n||"sendGames"===n)return e;const s=function(e){switch(e){case"sendMessages":return"UserRestrictionsNoSend";case"sendMedia":return"UserRestrictionsNoSendMedia";case"sendStickers":return"UserRestrictionsNoSendStickers";case"embedLinks":return"UserRestrictionsNoEmbedLinks";case"sendPolls":return"UserRestrictionsNoSendPolls";case"changeInfo":return"UserRestrictionsNoChangeInfo";case"inviteUsers":return"UserRestrictionsInviteUsers";case"pinMessages":return"UserRestrictionsPinMessages";default:return}}(n);if(!s)return e;const r=P(s);return`${e}${e.length?`, ${r}`:r}`}),"")}),[n,P]);return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section"},a.ZP.createElement("h3",{className:"section-heading",dir:"auto"},P("ChannelPermissionsHeader")),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"sendMessages",checked:!c.sendMessages,label:P("UserRestrictionsSend"),blocking:!0,onChange:E})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"sendMedia",checked:!c.sendMedia,label:P("UserRestrictionsSendMedia"),blocking:!0,onChange:E})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"sendStickers",checked:!c.sendStickers&&!c.sendGifs,label:P("UserRestrictionsSendStickers"),blocking:!0,onChange:E})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"sendPolls",checked:!c.sendPolls,label:P("UserRestrictionsSendPolls"),blocking:!0,onChange:E})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"embedLinks",checked:!c.embedLinks,label:P("UserRestrictionsEmbedLinks"),blocking:!0,onChange:E})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"inviteUsers",checked:!c.inviteUsers,label:P("UserRestrictionsInviteUsers"),blocking:!0,onChange:E})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"pinMessages",checked:!c.pinMessages,label:P("UserRestrictionsPinMessages"),blocking:!0,onChange:E})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"changeInfo",checked:!c.changeInfo,label:P("UserRestrictionsChangeInfo"),blocking:!0,onChange:E}))),a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{icon:"delete-user",multiline:!0,narrow:!0,onClick:g},a.ZP.createElement("span",{className:"title"},P("ChannelBlockedUsers")),a.ZP.createElement("span",{className:"subtitle"},f))),a.ZP.createElement("div",{className:"section"},a.ZP.createElement("h3",{className:"section-heading",dir:"auto"},P("PrivacyExceptions")),a.ZP.createElement(Ee.Z,{icon:"add-user",onClick:v},P("ChannelAddException")),b.map((e=>a.ZP.createElement(Ee.Z,{key:e.userId,className:"chat-item-clickable exceptions-member",onClick:()=>p(e)},a.ZP.createElement(Ce.Z,{userId:e.userId,status:y(e)})))))),a.ZP.createElement(Ot.Z,{isShown:m,onClick:C,ariaLabel:P("Save"),disabled:h},h?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-check"})))}))),ur=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{const n=(0,m.Z1)(e,t),{byId:a}=e.users;return{chat:n,usersById:a}}),((e,t)=>(0,h.ei)(t,["updateChatMemberBannedRights"])))((({chat:e,usersById:t,updateChatMemberBannedRights:n,onClose:s,isActive:r})=>{const o=(0,M.Z)();(0,T.ZP)(r,s);const l=(0,a.Ye)((()=>e&&e.fullInfo&&e.fullInfo.kickedMembers?e.fullInfo.kickedMembers:[]),[e]),i=(0,a.I4)((e=>{if(!e.kickedByUserId)return;const n=t[e.kickedByUserId];return n?o("UserRemovedBy",(0,u.Js)(n)):void 0}),[o,t]),c=(0,a.I4)((t=>{if(e)return[{title:o("Unblock"),icon:"delete",destructive:!0,handler:()=>n({chatId:e.id,userId:t.userId,bannedRights:{}})}]}),[o,e,n]);return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section",dir:o.isRtl?"rtl":void 0},a.ZP.createElement("p",{className:"text-muted"},o("NoBlockedGroup2")),l.map((e=>a.ZP.createElement(Ee.Z,{key:e.userId,className:"chat-item-clickable",ripple:!0,contextActions:c(e)},a.ZP.createElement(Ce.Z,{userId:e.userId,status:i(e)})))))))}))),hr="Channel title can't be empty",Zr=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{const n=(0,m.Z1)(e,t),{progress:a}=e.management;return{chat:n,progress:a,isSignaturesShown:Boolean(null==n?void 0:n.isSignaturesShown),canChangeInfo:(0,u.VE)(n,"changeInfo")}}),((e,t)=>(0,h.ei)(t,["toggleSignatures","updateChat","closeManagement","leaveChannel","deleteChannel","openChat"])))((({chatId:e,chat:t,progress:n,isSignaturesShown:s,canChangeInfo:l,onScreenSelect:i,updateChat:c,toggleSignatures:d,closeManagement:m,leaveChannel:h,deleteChannel:Z,openChat:P,onClose:g,isActive:v})=>{var E,C,f,b;const y=t&&t.title||"",I=null!=t&&t.fullInfo&&t.fullInfo.about||"",w=null==t||null===(E=t.fullInfo)||void 0===E?void 0:E.linkedChatId,[N,k,S]=(0,Fe.Z)(),[A,L]=(0,a.eJ)(!1),[R,$]=(0,a.eJ)(y),[B,D]=(0,a.eJ)(I),[U,x]=(0,a.eJ)(),[O,G]=(0,a.eJ)(),J=t&&(0,u.RT)(t),X=(0,p.Z)(J,!1,r.IU.BlobUrl),z=(0,M.Z)();(0,T.ZP)(v,g),(0,a.d4)((()=>{n===o.wv.Complete&&(L(!1),G(void 0))}),[n]);const _=(null==t||null===(C=t.fullInfo)||void 0===C||null===(f=C.adminMembers)||void 0===f?void 0:f.length)||0,Y=(0,a.I4)((()=>{i(o.u1.ChatPrivacyType)}),[i]),j=(0,a.I4)((()=>{i(o.u1.Discussion)}),[i]),H=(0,a.I4)((()=>{i(o.u1.ChatAdministrators)}),[i]),V=(0,a.I4)((e=>{x(e),L(!0)}),[]),q=(0,a.I4)((e=>{$(e.target.value),L(!0)}),[]),K=(0,a.I4)((e=>{D(e.target.value),L(!0)}),[]),W=(0,a.I4)((()=>{const t=R.trim(),n=B.trim();t.length?c({chatId:e,title:t,about:n,photo:U}):G(hr)}),[B,e,U,R,c]),Q=(0,a.I4)((()=>{d({chatId:e,isEnabled:!s})}),[e,s,d]),ee=(0,a.I4)((()=>{i(o.u1.ChannelSubscribers)}),[i]),te=(0,a.I4)((()=>{t.isCreator?Z({chatId:t.id}):h({chatId:t.id}),S(),m(),P({id:void 0})}),[t.isCreator,t.id,S,m,h,Z,P]);if(t.isRestricted)return;const ne=n===o.wv.InProgress;return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section"},a.ZP.createElement(xt.Z,{currentAvatarBlobUrl:X,onChange:V,disabled:!l}),a.ZP.createElement(ve.Z,{id:"channel-title",label:z("EnterChannelName"),onChange:q,value:R,error:O===hr?O:void 0,disabled:!l}),a.ZP.createElement(ve.Z,{id:"channel-about",className:"mb-2",label:z("DescriptionPlaceholder"),onChange:K,value:B,disabled:!l}),t.isCreator&&a.ZP.createElement(Ee.Z,{icon:"lock",multiline:!0,onClick:Y},a.ZP.createElement("span",{className:"title"},z("ChannelType")),a.ZP.createElement("span",{className:"subtitle"},t.username?z("TypePublic"):z("TypePrivate"))),a.ZP.createElement(Ee.Z,{icon:"message",multiline:!0,onClick:j,disabled:!l},a.ZP.createElement("span",{className:"title"},z("Discussion")),a.ZP.createElement("span",{className:"subtitle"},z(w?"DiscussionUnlink":"Add"))),a.ZP.createElement(Ee.Z,{icon:"admin",multiline:!0,onClick:H},a.ZP.createElement("span",{className:"title"},z("ChannelAdministrators")),a.ZP.createElement("span",{className:"subtitle"},_)),a.ZP.createElement("div",{className:"ListItem no-selection narrow"},a.ZP.createElement(rn.Z,{checked:s,label:z("ChannelSignMessages"),onChange:Q}))),a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{icon:"group",multiline:!0,onClick:ee},a.ZP.createElement("span",{className:"title",dir:"auto"},z("ChannelSubscribers")),a.ZP.createElement("span",{className:"subtitle",dir:"auto"},z("Subscribers",null!==(b=t.membersCount)&&void 0!==b?b:0,"i")))),a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{icon:"delete",ripple:!0,destructive:!0,onClick:k},t.isCreator?z("ChannelDelete"):z("LeaveChannel")))),a.ZP.createElement(Ot.Z,{isShown:A,onClick:W,disabled:ne,ariaLabel:z("Save")},ne?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-check"})),a.ZP.createElement(Me.Z,{isOpen:N,onClose:S,text:t.isCreator?z("ChannelDeleteAlert"):z("ChannelLeaveAlert"),confirmLabel:t.isCreator?z("ChannelDelete"):z("LeaveChannel"),confirmHandler:te,confirmIsDestructive:!0}))})));var Pr=n(88);const gr=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{const n=(0,m.Z1)(e,t),{isUsernameAvailable:a}=(0,m.aW)(e,t);return{chat:n,isChannel:(0,u.eA)(n),progress:e.management.progress,isUsernameAvailable:a}}),((e,t)=>(0,h.ei)(t,["checkPublicLink","updatePublicLink","updatePrivateLink"])))((({chat:e,onClose:t,isActive:n,isChannel:s,progress:r,isUsernameAvailable:l,checkPublicLink:i,updatePublicLink:c,updatePrivateLink:d})=>{var m;const u=Boolean(e.username),h=null===(m=e.fullInfo)||void 0===m?void 0:m.inviteLink,[Z,P]=(0,a.eJ)(u?"public":"private"),[g,v]=(0,a.eJ)(),[p,E,C]=(0,Fe.Z)(),f=Boolean("public"===Z&&g&&l||"private"===Z&&u);(0,T.ZP)(n,t),(0,a.d4)((()=>{Z&&!h&&d()}),[Z,h,d]);const b=(0,a.I4)((e=>{P(e)}),[]),y=(0,a.I4)((()=>{c({username:"public"===Z?g:""})}),[Z,c,g]),I=(0,a.I4)((()=>{C(),d()}),[C,d]),w=(0,M.Z)(),N=s?"Channel":"Mega",k=s?"Channel":"Group",S=[{value:"private",label:w(`${N}Private`),subLabel:w(`${N}PrivateInfo`)},{value:"public",label:w(`${N}Public`),subLabel:w(`${N}PublicInfo`)}],A=r===o.wv.InProgress;return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section",dir:w.isRtl?"rtl":void 0},a.ZP.createElement("h3",{className:"section-heading"},w(`${k}Type`)),a.ZP.createElement(Je.Z,{selected:Z,name:"channel-type",options:S,onChange:b})),"private"===Z?a.ZP.createElement("div",{className:"section",dir:w.isRtl?"rtl":void 0},h?a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(Pr.Z,{url:h,className:"group-link",text:h}),a.ZP.createElement("p",{className:"section-info",dir:w.isRtl?"rtl":void 0},w(`${N}PrivateLinkHelp`)),a.ZP.createElement(Ee.Z,{icon:"delete",ripple:!0,destructive:!0,onClick:E},w("RevokeLink")),a.ZP.createElement(Me.Z,{isOpen:p,onClose:C,text:w("RevokeAlert"),confirmLabel:w("RevokeButton"),confirmHandler:I,confirmIsDestructive:!0})):a.ZP.createElement(Pe.Z,null)):a.ZP.createElement("div",{className:"section no-border"},a.ZP.createElement(_t,{asLink:!0,currentUsername:e.username,isLoading:A,isUsernameAvailable:l,checkUsername:i,onChange:v}),a.ZP.createElement("p",{className:"section-info",dir:"auto"},w(`${k}.Username.CreatePublicLinkHelp`)))),a.ZP.createElement(Ot.Z,{isShown:f,disabled:A,ariaLabel:w("Save"),onClick:y},A?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-check"})))}))),vr=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{var n;const a=(0,m.Z1)(e,t),{forDiscussionIds:s,byId:r}=e.chats;return{chat:a,chatsByIds:r,forDiscussionIds:s,linkedChat:null!=a&&null!==(n=a.fullInfo)&&void 0!==n&&n.linkedChatId?(0,m.Z1)(e,a.fullInfo.linkedChatId):void 0,isChannel:a&&(0,u.eA)(a)}}),((e,t)=>(0,h.ei)(t,["loadGroupsForDiscussion","linkDiscussionGroup","unlinkDiscussionGroup"])))((({chat:e,onClose:t,isActive:n,chatId:s,chatsByIds:r,linkedChat:i,forDiscussionIds:c,isChannel:d,onScreenSelect:m,loadGroupsForDiscussion:u,linkDiscussionGroup:h,unlinkDiscussionGroup:Z})=>{const[P,g]=(0,a.eJ)(),[v,p]=(0,a.eJ)(),[E,C]=(0,a.eJ)(!1),f=(0,a.I4)((()=>C(!0)),[]),[b,y,I]=(0,Fe.Z)(),[w,N,k]=(0,Fe.Z)(),S=(0,M.Z)(),F=null==i?void 0:i.id;(0,T.ZP)(n,t),(0,a.d4)((()=>{u()}),[u]),(0,a.d4)((()=>{v||(0,qt.Z)("DiscussionGroups").then(p)}),[v]);const A=(0,a.I4)((()=>{I(),Z({channelId:d?s:F}),d||m(o.u1.Initial)}),[I,Z,d,s,F,m]),L=(0,a.I4)((()=>{k(),h({channelId:s,chatId:P})}),[k,h,s,P]);return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section"},a.ZP.createElement("div",{className:"section-icon"},v&&a.ZP.createElement(Kt.Z,{id:"discussionGroupsDucks",size:l.bM,animationData:v,play:E,noLoop:!0,onLoad:f})),i&&a.ZP.createElement("div",null,a.ZP.createElement(Ee.Z,{className:"chat-item-clickable",inactive:!0},a.ZP.createElement(fe.Z,{chatId:i.id})),a.ZP.createElement(Ee.Z,{icon:"delete",ripple:!0,destructive:!0,onClick:y},S(d?"DiscussionUnlinkGroup":"DiscussionUnlinkChannel")),a.ZP.createElement(Me.Z,{isOpen:b,onClose:I,header:a.ZP.createElement("div",{className:"modal-header"},a.ZP.createElement(D.Z,{size:"tiny",chat:i}),a.ZP.createElement("div",{className:"modal-title"},S(d?"DiscussionUnlinkGroup":"DiscussionUnlinkChannel"))),textParts:(0,B.Z)(S(d?"DiscussionUnlinkChannelAlert":"DiscussionUnlinkGroupAlert",i.title),["br","simple_markdown"]),confirmLabel:S(d?"DiscussionUnlinkGroup":"DiscussionUnlinkChannel"),confirmHandler:A,confirmIsDestructive:!0})),!i&&a.ZP.createElement("div",null,a.ZP.createElement("p",{className:"section-help",dir:"auto"},S("DiscussionChannelHelp")),a.ZP.createElement("div",{teactFastList:!0},a.ZP.createElement(Ee.Z,{key:"create-group",icon:"group",ripple:!0,teactOrderKey:0,className:"not-implemented"},S("DiscussionCreateGroup")),c?c.map(((e,t)=>a.ZP.createElement(Ee.Z,{key:e,teactOrderKey:t+1,className:"chat-item-clickable scroll-item",onClick:()=>{g(e),N()}},a.ZP.createElement(fe.Z,{chatId:e})))):a.ZP.createElement(st.Z,{key:"nothing-found",teactOrderKey:0,text:"No discussion groups found"})),a.ZP.createElement("p",{className:"mt-4 mb-0 section-help",dir:"auto"},S("DiscussionChannelHelp2")),a.ZP.createElement(Me.Z,{isOpen:w,onClose:k,header:function(){const e=r[P];if(e)return a.ZP.createElement("div",{className:"modal-header"},a.ZP.createElement(D.Z,{size:"tiny",chat:e}),a.ZP.createElement("div",{className:"modal-title"},S("Channel.DiscussionGroup.LinkGroup")))}(),textParts:function(){const t=r[P];if(t)return t.hasPrivateLink?(0,B.Z)(`Do you want to make **${t.title}** the discussion board for **${e.title}**?`,["br","simple_markdown"]):(0,B.Z)(`Do you want to make **${t.title}** the discussion board for **${e.title}**?\n\nAnyone from the channel will be able to see messages in this group.`,["br","simple_markdown"])}(),confirmLabel:S("DiscussionLinkGroup"),confirmHandler:L,isButtonsInOneRow:!0})))))}))),pr=(0,a.X$)((0,s.c$)(((e,{chatId:t,isPromotedByCurrentUser:n})=>{const a=(0,m.Z1)(e,t);return{chat:a,isFormFullyDisabled:!(a.isCreator||n)}}),((e,t)=>(0,h.ei)(t,["updateChatMemberBannedRights"])))((({chat:e,selectedChatMemberId:t,onScreenSelect:n,updateChatMemberBannedRights:s,isFormFullyDisabled:r,onClose:l,isActive:i})=>{const[c,d]=(0,a.eJ)({}),[m,u]=(0,a.eJ)(!1),[h,Z]=(0,a.eJ)(!1),[P,g,v]=(0,Fe.Z)(),p=(0,M.Z)();(0,T.ZP)(i,l);const E=(0,a.Ye)((()=>{if(e&&e.fullInfo&&e.fullInfo.members)return e.fullInfo.members.find((({userId:e})=>e===t))}),[e,t]);(0,a.d4)((()=>{null!=e&&e.fullInfo&&t&&!E&&n(o.u1.GroupPermissions)}),[e,n,E,t]),(0,a.d4)((()=>{d((null==E?void 0:E.bannedRights)||(null==e?void 0:e.defaultBannedRights)||{}),u(!1),Z(!1)}),[e,E]);const C=(0,a.I4)((e=>{const{name:t}=e.target;function n(e){return!e||void 0}d((e=>({...e,[t]:n(e[t]),..."sendStickers"===t&&{sendGifs:n(e[t])}}))),u(!0)}),[]),f=(0,a.I4)((()=>{e&&t&&(Z(!0),s({chatId:e.id,userId:t,bannedRights:c}))}),[e,t,c,s]),b=(0,a.I4)((()=>{e&&t&&s({chatId:e.id,userId:t,bannedRights:{viewMessages:!0}})}),[e,t,s]),y=(0,a.I4)((t=>!!r||!(!e||!e.defaultBannedRights)&&e.defaultBannedRights[t]),[e,r]);if(E)return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{inactive:!0,className:"chat-item-clickable"},a.ZP.createElement(Ce.Z,{userId:E.userId})),a.ZP.createElement("h3",{className:"section-heading mt-4",dir:"auto"},p("UserRestrictionsCanDo")),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"sendMessages",checked:!c.sendMessages,label:p("UserRestrictionsSend"),blocking:!0,disabled:y("sendMessages"),onChange:C})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"sendMedia",checked:!c.sendMedia,label:p("UserRestrictionsSendMedia"),blocking:!0,disabled:y("sendMedia"),onChange:C})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"sendStickers",checked:!c.sendStickers&&!c.sendGifs,label:p("UserRestrictionsSendStickers"),blocking:!0,disabled:y("sendStickers"),onChange:C})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"sendPolls",checked:!c.sendPolls,label:p("UserRestrictionsSendPolls"),blocking:!0,disabled:y("sendPolls"),onChange:C})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"embedLinks",checked:!c.embedLinks,label:p("UserRestrictionsEmbedLinks"),blocking:!0,disabled:y("embedLinks"),onChange:C})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"inviteUsers",checked:!c.inviteUsers,label:p("UserRestrictionsInviteUsers"),blocking:!0,disabled:y("inviteUsers"),onChange:C})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"pinMessages",checked:!c.pinMessages,label:p("UserRestrictionsPinMessages"),blocking:!0,disabled:y("pinMessages"),onChange:C})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"changeInfo",checked:!c.changeInfo,label:p("UserRestrictionsChangeInfo"),blocking:!0,disabled:y("changeInfo"),onChange:C}))),!r&&a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{icon:"delete-user",ripple:!0,destructive:!0,onClick:g},p("UserRestrictionsBlock")))),a.ZP.createElement(Ot.Z,{isShown:m,onClick:f,ariaLabel:p("Save"),disabled:h},h?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-check"})),a.ZP.createElement(Me.Z,{isOpen:P,onClose:v,text:"Are you sure you want to ban and remove this user from the group?",confirmLabel:"Remove",confirmHandler:b,confirmIsDestructive:!0}))}))),Er=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{const n=(0,m.Z1)(e,t),{byId:a}=e.users;return{chat:n,currentUserId:e.currentUserId,isChannel:(0,u.eA)(n),usersById:a}}))((({chat:e,isChannel:t,currentUserId:n,usersById:s,onScreenSelect:r,onChatMemberSelect:l,onClose:i,isActive:c})=>{const d=(0,M.Z)();(0,T.ZP)(c,i);const m=(0,a.Ye)((()=>e.fullInfo&&e.fullInfo.adminMembers?e.fullInfo.adminMembers.sort(((e,t)=>e.isOwner?-1:t.isOwner?1:0)):[]),[e]),h=(0,a.I4)((e=>{l(e.userId,e.promotedByUserId===n),r(o.u1.ChatAdminRights)}),[n,l,r]),Z=(0,a.I4)((e=>{if(e.isOwner)return d("ChannelCreator");const t=e.promotedByUserId?s[e.promotedByUserId]:void 0;return t?d("EditAdminPromotedBy",(0,u.Js)(t)):d("ChannelAdmin")}),[d,s]);return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{icon:"recent",multiline:!0,onClick:function(){r(o.u1.GroupRecentActions)}},a.ZP.createElement("span",{className:"title"},d("EventLog")),a.ZP.createElement("span",{className:"subtitle"},d(t?"EventLogInfoDetailChannel":"EventLogInfoDetail")))),a.ZP.createElement("div",{className:"section",dir:d.isRtl?"rtl":void 0},a.ZP.createElement("p",{className:"text-muted",dir:"auto"},t?"You can add administrators to help you manage your channel.":"You can add administrators to help you manage your group."),m.map((e=>a.ZP.createElement(Ee.Z,{key:e.userId,className:"chat-item-clickable",onClick:()=>h(e)},a.ZP.createElement(Ce.Z,{userId:e.userId,status:Z(e),forceShowSelf:!0})))))))}))),Cr=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>({chat:(0,m.Z1)(e,t)})))((({chat:e,onClose:t,isActive:n})=>{const s=(0,M.Z)();(0,T.ZP)(n,t);const r=(0,a.Ye)((()=>e&&e.fullInfo&&e.fullInfo.adminMembers?e.fullInfo.adminMembers.sort(((e,t)=>e.isOwner?-1:t.isOwner?1:0)):[]),[e]),o=(0,a.I4)((e=>e.isOwner?s("ChannelCreator"):s("ChannelAdmin")),[s]);return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section not-implemented",dir:s.isRtl?"rtl":void 0},a.ZP.createElement("h3",{className:"section-heading",dir:"auto"},"Actions"),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"changeInfo",checked:!0,label:s("EventLogAllEvents"),onChange:void 0})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"changeInfo",checked:!0,label:s("EventLogFilterNewAdmins"),onChange:void 0})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"changeInfo",checked:!0,label:s("EventLogFilterNewMembers"),onChange:void 0})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"changeInfo",checked:!0,label:s("EventLogFilterChannelInfo"),onChange:void 0})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"changeInfo",checked:!0,label:s("EventLogFilterDeletedMessages"),onChange:void 0})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"changeInfo",checked:!0,label:s("EventLogFilterEditedMessages"),onChange:void 0})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"changeInfo",checked:!0,label:s("EventLogFilterLeavingMembers"),onChange:void 0}))),a.ZP.createElement("div",{className:"section not-implemented",dir:s.isRtl?"rtl":void 0},a.ZP.createElement("h3",{className:"section-heading",dir:"auto"},s("Channel.Management.Title")),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"changeInfo",checked:!0,label:s("EventLogAllAdmins"),onChange:void 0})),r.map((e=>a.ZP.createElement(Ee.Z,{key:e.userId,className:"chat-item-clickable picker-list-item",onClick:void 0,ripple:!0},a.ZP.createElement(rn.Z,{label:"",checked:!0}),a.ZP.createElement(Ce.Z,{userId:e.userId,status:o(e),forceShowSelf:!0})))))))}))),fr=(0,a.X$)((0,s.c$)(((e,{chatId:t,isPromotedByCurrentUser:n})=>{const a=(0,m.Z1)(e,t),{byId:s}=e.users,{currentUserId:r}=e;return{chat:a,usersById:s,currentUserId:r,isChannel:(0,u.eA)(a),isFormFullyDisabled:!(a.isCreator||n)}}),((e,t)=>(0,h.ei)(t,["updateChatAdmin"])))((({selectedChatMemberId:e,onScreenSelect:t,chat:n,usersById:s,currentUserId:r,isChannel:l,isFormFullyDisabled:i,updateChatAdmin:c,onClose:d,isActive:m})=>{const[h,Z]=(0,a.eJ)({}),[P,g]=(0,a.eJ)(!1),[v,p]=(0,a.eJ)(!1),[E,C,f]=(0,Fe.Z)(),[b,y]=(0,a.eJ)(""),I=(0,M.Z)();(0,T.ZP)(m,d);const w=(0,a.Ye)((()=>{if(n.fullInfo&&n.fullInfo.adminMembers)return n.fullInfo.adminMembers.find((({userId:t})=>t===e))}),[n,e]);(0,a.d4)((()=>{null!=n&&n.fullInfo&&e&&!w&&t(o.u1.ChatAdministrators)}),[n,t,w,e]),(0,a.d4)((()=>{Z((null==w?void 0:w.adminRights)||{}),y(((null==w?void 0:w.customTitle)||"").substr(0,16)),g(!1),p(!1)}),[w]);const N=(0,a.I4)((e=>{const{name:t}=e.target;Z((e=>{return{...e,[t]:(n=e[t],!n||void 0)};var n})),g(!0)}),[]),k=(0,a.I4)((()=>{e&&(p(!0),c({chatId:n.id,userId:e,adminRights:h,customTitle:b}))}),[n,e,h,b,c]),S=(0,a.I4)((()=>{e&&(c({chatId:n.id,userId:e,adminRights:{}}),f())}),[n.id,f,e,c]),A=(0,a.I4)((e=>!((0,u.G9)(n)||!i&&n.adminRights&&n.adminRights[e])),[n,i]),L=(0,a.Ye)((()=>{if(!w)return;if(w.isOwner)return I("ChannelCreator");const e=w.promotedByUserId?s[w.promotedByUserId]:void 0;return e?I("EditAdminPromotedBy",(0,u.Js)(e)):I("ChannelAdmin")}),[w,s,I]),R=(0,a.I4)((e=>{const{value:t}=e.target;y(t),g(!0)}),[]);if(w)return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{inactive:!0,className:"chat-item-clickable"},a.ZP.createElement(Ce.Z,{userId:w.userId,status:L,forceShowSelf:!0})),a.ZP.createElement("h3",{className:"section-heading mt-4",dir:"auto"},I("EditAdminWhatCanDo")),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"changeInfo",checked:!!h.changeInfo,label:I(l?"EditAdminChangeChannelInfo":"EditAdminChangeGroupInfo"),blocking:!0,disabled:A("changeInfo"),onChange:N})),l&&a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"postMessages",checked:!!h.postMessages,label:I("EditAdminPostMessages"),blocking:!0,disabled:A("postMessages"),onChange:N})),l&&a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"editMessages",checked:!!h.editMessages,label:I("EditAdminEditMessages"),blocking:!0,disabled:A("editMessages"),onChange:N})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"deleteMessages",checked:!!h.deleteMessages,label:I(l?"EditAdminDeleteMessages":"EditAdminGroupDeleteMessages"),blocking:!0,disabled:A("deleteMessages"),onChange:N})),!l&&a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"banUsers",checked:!!h.banUsers,label:I("EditAdminBanUsers"),blocking:!0,disabled:A("banUsers"),onChange:N})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"inviteUsers",checked:!!h.inviteUsers,label:I("EditAdminAddUsers"),blocking:!0,disabled:A("inviteUsers"),onChange:N})),!l&&a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"pinMessages",checked:!!h.pinMessages,label:I("EditAdminPinMessages"),blocking:!0,disabled:A("pinMessages"),onChange:N})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"addAdmins",checked:!!h.addAdmins,label:I("EditAdminAddAdmins"),blocking:!0,disabled:A("addAdmins"),onChange:N})),!l&&a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(rn.Z,{name:"anonymous",checked:!!h.anonymous,label:I("EditAdminSendAnonymously"),blocking:!0,disabled:A("anonymous"),onChange:N})),i&&a.ZP.createElement("p",{className:"section-info mb-4",dir:"auto"},I("Channel.EditAdmin.CannotEdit")),!l&&a.ZP.createElement(ve.Z,{id:"admin-title",label:I("EditAdminRank"),onChange:R,value:b,disabled:i,maxLength:16}),r!==e&&!i&&a.ZP.createElement(Ee.Z,{icon:"delete",ripple:!0,destructive:!0,onClick:C},I("EditAdminRemoveAdmin")))),a.ZP.createElement(Ot.Z,{isShown:P,onClick:k,ariaLabel:I("Save"),disabled:v},v?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-check"})),a.ZP.createElement(Me.Z,{isOpen:E,onClose:f,text:"Are you sure you want to dismiss this admin?",confirmLabel:"Dismiss",confirmHandler:S,confirmIsDestructive:!0}))}))),br=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{var n;const a=(0,m.Z1)(e,t),{byId:s}=e.users;return{members:null==a||null===(n=a.fullInfo)||void 0===n?void 0:n.members,usersById:s,isChannel:a&&(0,u.eA)(a),serverTimeOffset:e.serverTimeOffset}}),((e,t)=>(0,h.ei)(t,["openUserInfo"])))((({members:e,usersById:t,isChannel:n,openUserInfo:s,onClose:r,isActive:o,serverTimeOffset:l})=>{const i=(0,a.Ye)((()=>{if(e&&t)return(0,u.Z0)(e.map((({userId:e})=>e)),t,void 0,l)}),[e,l,t]),c=(0,a.I4)((e=>{s({id:e})}),[s]);return(0,T.ZP)(o,r),a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section",teactFastList:!0},i?i.map(((e,t)=>a.ZP.createElement(Ee.Z,{key:e,teactOrderKey:t,className:"chat-item-clickable scroll-item",onClick:()=>c(e)},a.ZP.createElement(Ce.Z,{userId:e,forceShowSelf:!0})))):a.ZP.createElement(st.Z,{teactOrderKey:0,key:"nothing-found",text:n?"No subscribers found":"No members found"}))))}))),yr=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{var n;const a=(0,m.Z1)(e,t),{byId:s}=e.users;return{members:null==a||null===(n=a.fullInfo)||void 0===n?void 0:n.members,usersById:s,isChannel:a&&(0,u.eA)(a),serverTimeOffset:e.serverTimeOffset}}))((({usersById:e,members:t,isChannel:n,onScreenSelect:s,onChatMemberSelect:r,onClose:l,isActive:i,serverTimeOffset:c})=>{(0,T.ZP)(i,l);const d=(0,a.Ye)((()=>{if(t&&e)return(0,u.Z0)(t.filter((e=>!e.isOwner)).map((({userId:e})=>e)),e,void 0,c)}),[t,c,e]),m=(0,a.I4)((e=>{r(e),s(o.u1.GroupUserPermissions)}),[r,s]);return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section",teactFastList:!0},d?d.map(((e,t)=>a.ZP.createElement(Ee.Z,{key:e,teactOrderKey:t,className:"chat-item-clickable scroll-item",onClick:()=>m(e)},a.ZP.createElement(Ce.Z,{userId:e,forceShowSelf:!0})))):a.ZP.createElement(st.Z,{teactOrderKey:0,key:"nothing-found",text:n?"No subscribers found":"No members found"}))))}))),Ir=(0,a.X$)((0,s.c$)((e=>({managementType:(0,m.pP)(e)})))((({chatId:e,currentScreen:t,selectedChatMemberId:n,isPromotedByCurrentUser:s,onScreenSelect:r,onChatMemberSelect:l,onClose:i,isActive:c,managementType:d})=>{switch(t){case o.u1.Initial:switch(d){case"user":return a.ZP.createElement(ir,{key:e,userId:e,onClose:i,isActive:c});case"group":return a.ZP.createElement(dr,{key:e,chatId:e,onScreenSelect:r,onClose:i,isActive:c||[o.u1.ChatPrivacyType,o.u1.Discussion,o.u1.GroupPermissions,o.u1.ChatAdministrators,o.u1.GroupRemovedUsers,o.u1.GroupUserPermissionsCreate,o.u1.GroupUserPermissions,o.u1.ChatAdminRights,o.u1.GroupRecentActions].includes(t)});case"channel":return a.ZP.createElement(Zr,{key:e,chatId:e,onScreenSelect:r,onClose:i,isActive:c||[o.u1.ChannelSubscribers,o.u1.ChatAdministrators,o.u1.Discussion,o.u1.ChatPrivacyType,o.u1.ChatAdminRights,o.u1.GroupRecentActions].includes(t)})}break;case o.u1.ChatPrivacyType:return a.ZP.createElement(gr,{chatId:e,isActive:c,onClose:i});case o.u1.Discussion:return a.ZP.createElement(vr,{chatId:e,onScreenSelect:r,isActive:c,onClose:i});case o.u1.GroupPermissions:return a.ZP.createElement(mr,{chatId:e,onScreenSelect:r,onChatMemberSelect:l,isActive:c||[o.u1.GroupRemovedUsers,o.u1.GroupUserPermissionsCreate,o.u1.GroupUserPermissions].includes(t),onClose:i});case o.u1.GroupRemovedUsers:return a.ZP.createElement(ur,{chatId:e,isActive:c,onClose:i});case o.u1.GroupUserPermissionsCreate:return a.ZP.createElement(yr,{chatId:e,onChatMemberSelect:l,onScreenSelect:r,isActive:c||[o.u1.GroupUserPermissions].includes(t),onClose:i});case o.u1.GroupUserPermissions:return a.ZP.createElement(pr,{chatId:e,selectedChatMemberId:n,isPromotedByCurrentUser:s,onScreenSelect:r,isActive:c,onClose:i});case o.u1.ChatAdministrators:return a.ZP.createElement(Er,{chatId:e,onScreenSelect:r,onChatMemberSelect:l,isActive:c||[o.u1.ChatAdminRights,o.u1.GroupRecentActions].includes(t),onClose:i});case o.u1.GroupRecentActions:return a.ZP.createElement(Cr,{chatId:e,isActive:c,onClose:i});case o.u1.ChatAdminRights:return a.ZP.createElement(fr,{chatId:e,selectedChatMemberId:n,isPromotedByCurrentUser:s,onScreenSelect:r,isActive:c,onClose:i});case o.u1.ChannelSubscribers:case o.u1.GroupMembers:return a.ZP.createElement(br,{chatId:e,isActive:c,onClose:i})}})));var wr=n(9937);const Nr=/^4[0-9]{12}(?:[0-9]{1,3})?$/,kr=/^5[1-5][0-9]{11,14}$/,Sr=/^2[2-7][0-9]{11,14}$/;let Mr;!function(e){e[e.Default=0]="Default",e[e.Visa=1]="Visa",e[e.Mastercard=2]="Mastercard"}(Mr||(Mr={}));const Tr={[Mr.Default]:"",[Mr.Visa]:"visa",[Mr.Mastercard]:"mastercard"};function Fr(e){return e=e.replace(/\s/g,""),Nr.test(e)?Mr.Visa:kr.test(e)||Sr.test(e)?Mr.Mastercard:Mr.Default}const Ar={streetLine1:"",streetLine2:"",city:"",state:"",countryIso2:"",postCode:"",fullName:"",email:"",phone:"",shipping:"",cardNumber:"",cardholder:"",expiry:"",cvv:"",billingCountry:"",billingZip:"",saveInfo:!0,saveCredentials:!1,formErrors:{}},Lr=(e,t)=>{switch(t.type){case"changeAddress1":return{...e,streetLine1:t.payload,formErrors:{...e.formErrors,streetLine1:void 0}};case"changeAddress2":return{...e,streetLine2:t.payload,formErrors:{...e.formErrors,streetLine2:void 0}};case"changeCity":return{...e,city:t.payload,formErrors:{...e.formErrors,city:void 0}};case"changeState":return{...e,state:t.payload,formErrors:{...e.formErrors,state:void 0}};case"changeCountry":return{...e,countryIso2:t.payload,billingCountry:Rr(t.payload),formErrors:{...e.formErrors,countryIso2:void 0}};case"changePostCode":return{...e,postCode:t.payload,formErrors:{...e.formErrors,postCode:void 0}};case"changeFullName":return{...e,fullName:t.payload,formErrors:{...e.formErrors,fullName:void 0}};case"changeEmail":return{...e,email:t.payload,formErrors:{...e.formErrors,email:void 0}};case"changePhone":return{...e,phone:t.payload,formErrors:{...e.formErrors,phone:void 0}};case"changeShipping":return{...e,shipping:t.payload};case"changeCardNumber":return{...e,cardNumber:t.payload,formErrors:{...e.formErrors,cardNumber:void 0}};case"changeCardholder":return{...e,cardholder:t.payload,formErrors:{...e.formErrors,cardholder:void 0}};case"changeExpiryDate":return{...e,expiry:t.payload,formErrors:{...e.formErrors,expiry:void 0}};case"changeCvvCode":return{...e,cvv:t.payload,formErrors:{...e.formErrors,cvv:void 0}};case"changeBillingCountry":return{...e,billingCountry:t.payload,formErrors:{...e.formErrors,billingCountry:void 0}};case"changeBillingZip":return{...e,billingZip:t.payload,formErrors:{...e.formErrors,billingZip:void 0}};case"changeSaveInfo":return{...e,saveInfo:t.payload};case"changeSaveCredentials":return{...e,saveCredentials:t.payload};case"updateUserInfo":return t.payload.countryIso2?{...e,...t.payload,billingCountry:Rr(t.payload.countryIso2)}:{...e,...t.payload};case"setFormErrors":return{...e,formErrors:{...e.formErrors,...t.payload}};default:return e}};function Rr(e){const t=Hn.Jm.find((({id:t})=>t===e));return t?t.name:""}function $r(e,t=400){(0,a.d4)((()=>{i.$b||setTimeout((()=>{(0,z.T2)((()=>{e.current&&e.current.focus()}))}),t)}),[e,t])}const Br=(0,a.X$)((e=>{const{id:t,value:n,label:s,hasArrow:r,error:o,ref:l,placeholder:i,onChange:c,children:d}=e,m=o||s,u=(0,_.Z)("input-group",n&&"touched",o&&"error",m&&"with-label",r&&"with-arrow","input-group");return a.ZP.createElement("div",{className:u},a.ZP.createElement("select",{className:"form-control",id:t,value:n||"",onChange:c,placeholder:i||s,ref:l},d),m&&t&&a.ZP.createElement("label",{htmlFor:t},m))})),Dr=(0,a.X$)((({state:e,needEmail:t,needPhone:n,needName:s,needAddress:r,dispatch:o})=>{const l=(0,a.sO)(null),i=(0,a.sO)(null),c=(0,a.sO)(null);(0,a.d4)((()=>{c.current&&c.current.value!==e.countryIso2&&(c.current.value=e.countryIso2)}),[e.countryIso2]);const d=(0,M.Z)();$r(l);const m=(0,a.I4)((e=>{o({type:"changeAddress1",payload:e.target.value})}),[o]),u=(0,a.I4)((e=>{o({type:"changeAddress2",payload:e.target.value})}),[o]),h=(0,a.I4)((e=>{o({type:"changeCity",payload:e.target.value})}),[o]),Z=(0,a.I4)((e=>{o({type:"changeState",payload:e.target.value})}),[o]),P=(0,a.I4)((e=>{o({type:"changeCountry",payload:e.target.value})}),[o]),g=(0,a.I4)((e=>{o({type:"changePostCode",payload:e.target.value})}),[o]),v=(0,a.I4)((e=>{o({type:"changeFullName",payload:e.target.value})}),[o]),p=(0,a.I4)((e=>{o({type:"changeEmail",payload:e.target.value})}),[o]),E=(0,a.I4)((e=>{let{value:t}=e.target;t=`+${t.replace(/\D/g,"")}`,i.current&&(i.current.value=t),o({type:"changePhone",payload:t})}),[o]),C=(0,a.I4)((e=>{o({type:"changeSaveInfo",payload:e.target.value})}),[o]),{formErrors:f}=e;return a.ZP.createElement("div",{className:"ShippingInfo"},a.ZP.createElement("form",null,r?a.ZP.createElement("div",null,a.ZP.createElement("h5",null,d("PaymentShippingAddress")),a.ZP.createElement(ve.Z,{ref:l,label:"Address1 (Street)",onChange:m,value:e.streetLine1,inputMode:"text",error:f.streetLine1}),a.ZP.createElement(ve.Z,{label:"Address2 (Street)",onChange:u,value:e.streetLine2,inputMode:"text",error:f.streetLine2}),a.ZP.createElement(ve.Z,{label:"City",onChange:h,value:e.city,inputMode:"text",error:f.city}),a.ZP.createElement(ve.Z,{label:"State",onChange:Z,value:e.state,inputMode:"text",error:f.state}),a.ZP.createElement(Br,{label:"Country",placeholder:"Country",onChange:P,value:e.countryIso2,hasArrow:Boolean(!0),id:"shipping-country",error:f.countryIso2,ref:c},Hn.Jm.map((({name:e,id:t})=>a.ZP.createElement("option",{value:t,className:"county-item"},e)))),a.ZP.createElement(ve.Z,{label:"Post Code",onChange:g,value:e.postCode,inputMode:"text",error:f.postCode})):void 0,s||t||n?a.ZP.createElement("h5",null,d("PaymentShippingReceiver")):void 0,s&&a.ZP.createElement(ve.Z,{label:"Full name",onChange:v,value:e.fullName,inputMode:"text",error:f.fullName}),t&&a.ZP.createElement(ve.Z,{label:"Email",onChange:p,value:e.email,inputMode:"email",error:f.email}),n&&a.ZP.createElement(ve.Z,{label:"Phone number",onChange:E,value:e.phone,inputMode:"tel",error:f.phone,ref:i}),a.ZP.createElement(rn.Z,{label:d("PaymentShippingSave"),subLabel:d("PaymentShippingSaveInfo"),checked:Boolean(e.saveInfo),onChange:C})))})),Ur=(0,a.X$)((({state:e,shippingOptions:t,currency:n,dispatch:s})=>{const r=(0,M.Z)();(0,a.d4)((()=>{t&&!e.shipping&&s({type:"changeShipping",payload:t[0].id})}),[t,e.shipping,s]);const o=(0,a.I4)((e=>{s({type:"changeShipping",payload:e})}),[s]),l=(0,a.Ye)((()=>t.map((({id:e,title:t,amount:a})=>({label:t,subLabel:(0,wr.x)(a,n,r.code),value:e})))),[t,n,r.code]);return a.ZP.createElement("div",{className:"Shipping"},a.ZP.createElement("form",null,a.ZP.createElement("p",null,"Select shipping method"),a.ZP.createElement(Je.Z,{name:"shipping-options",options:l,onChange:o,selected:e.shipping})))}));function xr(e,t,n,s,r=!1){return a.ZP.createElement("div",{className:"price-info-item "+(r?"price-info-item-main":"")},a.ZP.createElement("div",{className:"title"},t),a.ZP.createElement("div",{className:"value"},(0,wr.x)(n,s,e)))}function Or(e,t,n){return a.ZP.createElement("div",{className:"checkout-info-item"},a.ZP.createElement("i",{className:e}," "),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"title"},t),a.ZP.createElement("p",{className:"data"},n)))}const Gr=(0,a.X$)((({invoiceContent:e,prices:t,shippingPrices:n,checkoutInfo:s,currency:r,totalPrice:o})=>{const l=(0,M.Z)(),{photoUrl:i,title:c,text:d}=e||{},{paymentMethod:m,paymentProvider:u,shippingAddress:h,name:Z,phone:P,shippingMethod:g}=s||{};return a.ZP.createElement("div",{className:"Checkout"},a.ZP.createElement("div",{className:"description has-image"},i&&a.ZP.createElement("img",{src:i,alt:""}),a.ZP.createElement("div",{className:"text"},a.ZP.createElement("h5",null,c),a.ZP.createElement("p",null,d))),a.ZP.createElement("div",{className:"price-info"},t&&t.map((e=>xr(l.code,e.label,e.amount,r))),n&&n.map((e=>xr(l.code,e.label,e.amount,r))),void 0!==o&&xr(l.code,l("Checkout.TotalAmount"),o,r,!0)),a.ZP.createElement("div",{className:"invoice-info"},m&&Or("icon-card",m,"Payment method"),u&&Or("stripe-provider",u,"Payment provider"),h&&Or("icon-location",h,"Shipping address"),Z&&Or("icon-user",Z,"Name"),P&&Or("icon-phone",P,"Phone number"),g&&Or("icon-truck",g,"Shipping method")))})),Jr=(0,a.X$)((({value:e,error:t,onChange:n})=>{const s=(0,a.sO)(null),r=(0,a.I4)((t=>{if("Backspace"===t.key&&"/"===e.charAt(e.length-1)){const t=e.slice(0,e.length-1);s.current&&(s.current.value=t)}}),[e]),o=(0,a.I4)((e=>{n(function(e){const t=(e=e.replace(/[^\d]/g,"").slice(0,4)).match(/.{1,2}/g);return null!=t&&t[0]&&Number(t[0])>12&&(t[0]="12"),null!=t&&t[0]&&2===t[0].length&&!t[1]&&(t[1]=""),t?t.join("/"):""}(e.target.value))}),[n]);return a.ZP.createElement(ve.Z,{label:"Expiry date",ref:s,onChange:o,onKeyDown:r,value:e,error:t,inputMode:"numeric",maxLength:5})}));var Xr=n(6352),zr=n(5753);const _r=(0,a.X$)((({value:e,error:t,onChange:n})=>{const s=(0,a.sO)(null);$r(s);const[r,o]=(0,a.eJ)(Mr.Default);(0,a.d4)((()=>{const t=Fr(e);o(t)}),[]);const l=(0,a.I4)((e=>{const t=function(e){const t=(e=e.replace(/[^\d]/g,"")).match(/.{1,4}/g);return t?t.join(" "):""}(e.target.value),a=Fr(e.target.value);o(a),n(t),s.current&&(s.current.value=t)}),[n,s]),i=function(e){switch(e){case Mr.Mastercard:return a.ZP.createElement("img",{src:Xr,alt:""});case Mr.Visa:return a.ZP.createElement("img",{src:zr,alt:""});default:return}}(r);return a.ZP.createElement("div",{className:"CardInput"},a.ZP.createElement("span",{className:"left-addon"},i),a.ZP.createElement(ve.Z,{ref:s,label:"Card number",onChange:l,value:e,inputMode:"numeric",className:r?"has-left-addon":"",error:t,maxLength:23}))})),Yr=(0,a.X$)((({state:e,canSaveCredentials:t,needCardholderName:n,needCountry:s,needZip:r,dispatch:o})=>{const l=(0,a.sO)(null);(0,a.d4)((()=>{l.current&&l.current.value!==e.billingCountry&&(l.current.value=e.billingCountry)}),[e.billingCountry]);const i=(0,a.I4)((e=>{o({type:"changeCardNumber",payload:e})}),[o]),c=(0,a.I4)((e=>{o({type:"changeCardholder",payload:e.target.value.toUpperCase()})}),[o]),d=(0,a.I4)((e=>{o({type:"changeExpiryDate",payload:e})}),[o]),m=(0,a.I4)((e=>{o({type:"changeCvvCode",payload:e.target.value})}),[o]),u=(0,a.I4)((e=>{o({type:"changeBillingCountry",payload:e.target.value})}),[o]),h=(0,a.I4)((e=>{o({type:"changeBillingZip",payload:e.target.value})}),[o]),Z=(0,a.I4)((e=>{o({type:"changeSaveCredentials",payload:e.target.value})}),[o]),P=(0,M.Z)(),{formErrors:g={}}=e;return a.ZP.createElement("div",{className:"PaymentInfo"},a.ZP.createElement("form",null,a.ZP.createElement("h5",null,P("PaymentCardTitle")),a.ZP.createElement(_r,{onChange:i,value:e.cardNumber,error:g.cardNumber}),n&&a.ZP.createElement(ve.Z,{label:"Name on card",onChange:c,value:e.cardholder,inputMode:"text",error:g.cardholder}),a.ZP.createElement("section",{className:"inline-inputs"},a.ZP.createElement(Jr,{value:e.expiry,onChange:d,error:g.expiry}),a.ZP.createElement(ve.Z,{label:"CVV code",onChange:m,value:e.cvv,inputMode:"numeric",maxLength:3,error:g.cvv})),s||r?a.ZP.createElement("h5",null,P("PaymentBillingAddress")):void 0,s&&a.ZP.createElement(Br,{label:"Country",placeholder:"Country",onChange:u,value:e.billingCountry,hasArrow:Boolean(!0),id:"billing-country",error:g.billingCountry,ref:l},Hn.Jm.map((({name:e})=>a.ZP.createElement("option",{value:e,className:"county-item"},e)))),r&&a.ZP.createElement(ve.Z,{label:"Post Code",onChange:h,value:e.billingZip,inputMode:"text",error:g.billingZip}),t&&a.ZP.createElement(rn.Z,{label:P("PaymentCardSavePaymentInformation"),checked:e.saveCredentials,onChange:Z})))})),jr=(0,a.X$)((0,s.c$)((e=>{const{step:t,shippingOptions:n,savedInfo:a,canSaveCredentials:s,invoice:r,invoiceContent:o,nativeProvider:l,nativeParams:i,passwordMissing:c,error:d}=e.payment,m=Boolean(r&&(!l||"stripe"!==l)),{needCardholderName:u,needCountry:h,needZip:Z}=i||{},{nameRequested:P,phoneRequested:g,emailRequested:v,shippingAddressRequested:p,flexible:E,phoneToProvider:C,emailToProvider:f,currency:b,prices:y}=r||{};return{step:t,shippingOptions:n,savedInfo:a,canSaveCredentials:s,nativeProvider:l,passwordMissing:c,nameRequested:P,shippingAddressRequested:p,phoneRequested:g,emailRequested:v,flexible:E,phoneToProvider:C,emailToProvider:f,currency:b,prices:y,isProviderError:m,invoiceContent:o,needCardholderName:u,needCountry:h,needZip:Z,error:d}}),((e,t)=>(0,h.ei)(t,["validateRequestedInfo","sendPaymentForm","setPaymentStep","sendCredentialsInfo","clearPaymentError"])))((({isOpen:e,onClose:t,step:n,shippingOptions:s,savedInfo:r,canSaveCredentials:l,nameRequested:i,shippingAddressRequested:c,phoneRequested:d,emailRequested:m,phoneToProvider:u,emailToProvider:h,currency:Z,passwordMissing:P,isProviderError:g,invoiceContent:v,nativeProvider:p,prices:E,needCardholderName:C,needCountry:f,needZip:b,error:y,validateRequestedInfo:I,sendPaymentForm:w,setPaymentStep:N,sendCredentialsInfo:k,clearPaymentError:S})=>{const[T,A]=(0,At.Z)(Lr,Ar),[$,B]=(0,a.eJ)(!1),D=(0,M.Z)();(0,a.d4)((()=>{(n||y)&&B(!1)}),[n,y]),(0,a.d4)((()=>{null!=y&&y.field&&A({type:"setFormErrors",payload:{[y.field]:y.message}})}),[y,A]),(0,a.d4)((()=>{if(r){const{name:e,phone:t,email:n,shippingAddress:a}=r;A({type:"updateUserInfo",payload:{fullName:e,phone:t&&"+"!==t.charAt(0)?`+${t}`:t,email:n,...a||{}}})}}),[r,A]);const U=(0,a.I4)((()=>{S()}),[S]),x=(0,a.Ye)((()=>n!==o.KB.Checkout?0:function(e=[],t,n){const a=t?Vr(t,n):[];let s=0;return s=e.concat(a||[]).reduce(((e,t)=>e+t.amount),s),s}(E,s,T.shipping)),[n,T.shipping,E,s]),O=(0,a.Ye)((()=>{if(n===o.KB.Checkout)return function(e,t,n){const a=`${function(e){const t=Fr(e);return Tr[t]||""}(e.cardNumber)} *${e.cardNumber.slice(-4)}`,s=e.streetLine1?`${e.streetLine1}, ${e.city}, ${e.countryIso2}`:void 0,{phone:r,fullName:o}=e,l=t?Hr(t,e.shipping):void 0;return{paymentMethod:a,paymentProvider:n,shippingAddress:s,name:o,phone:r,shippingMethod:null==l?void 0:l.title}}(T,s,p||"")}),[n,T,s,p]),G=(0,a.I4)((()=>{const{saveInfo:e}=T,t=function(e){const{streetLine1:t,streetLine2:n,city:a,state:s,countryIso2:r,postCode:o,fullName:l,phone:i,email:c}=e;return{name:l,phone:i,email:c,shippingAddress:{streetLine1:t,streetLine2:n,city:a,state:s,countryIso2:r,postCode:o}}}(T);I({requestInfo:t,saveInfo:e})}),[I,T]),J=(0,a.I4)((()=>{const e=function(e){const{cardNumber:t,cardholder:n,expiry:a,cvv:s,billingCountry:r,billingZip:o}=e,[l,i]=a.split("/");return{data:{cardNumber:t,cardholder:n,expiryMonth:l,expiryYear:i,cvv:s,country:r,zip:o}}}(T);k({credentials:e})}),[k,T]),X=(0,a.I4)((()=>{w({shippingOptionId:T.shipping,saveCredentials:T.saveCredentials})}),[w,T]),z=(0,a.I4)((e=>{N({step:e})}),[N]),_=(0,a.I4)((()=>{switch(B(!0),n){case o.KB.ShippingInfo:return G();case o.KB.Shipping:return z(o.KB.PaymentInfo);case o.KB.PaymentInfo:return J();case o.KB.Checkout:return X();default:return()=>{}}}),[n,G,z,J,X]),Y=(0,a.Ye)((()=>{switch(n){case o.KB.ShippingInfo:return D("PaymentShippingInfo");case o.KB.Shipping:return D("PaymentShippingMethod");case o.KB.PaymentInfo:return D("PaymentCardInfo");case o.KB.Checkout:return D("PaymentCheckout");default:return""}}),[n,D]),j=(0,a.Ye)((()=>{switch(n){case o.KB.Checkout:return D("Checkout.PayPrice",(0,wr.x)(x,Z,D.code));default:return D("Next")}}),[n,D,Z,x]);return g?a.ZP.createElement(ge.Z,{className:"error",isOpen:e,onClose:t},a.ZP.createElement("p",null,"Sorry, Telegram WebZ doesn't support payments with this provider yet. ",a.ZP.createElement("br",null),"Please use one of our mobile apps to do this."),a.ZP.createElement(R.Z,{isText:!0,onClick:t},D("OK"))):a.ZP.createElement(ge.Z,{className:"PaymentModal",isOpen:e,onClose:t},a.ZP.createElement("div",{className:"header",dir:D.isRtl?"rtl":void 0},a.ZP.createElement(R.Z,{className:"close-button",color:"translucent",round:!0,size:"smaller",onClick:t,ariaLabel:"Close"},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement("h3",null,Y)),void 0!==n?a.ZP.createElement(L.Z,{name:"slide",activeKey:n},(()=>a.ZP.createElement("div",{className:"content custom-scroll"},function(e){switch(e){case o.KB.ShippingInfo:return a.ZP.createElement(Dr,{state:T,dispatch:A,needAddress:Boolean(c),needEmail:Boolean(m||h),needPhone:Boolean(d||u),needName:Boolean(i)});case o.KB.Shipping:return a.ZP.createElement(Ur,{state:T,dispatch:A,shippingOptions:s||[],currency:Z});case o.KB.PaymentInfo:return a.ZP.createElement(Yr,{state:T,dispatch:A,canSaveCredentials:Boolean(!P&&l),needCardholderName:C,needCountry:f,needZip:b});case o.KB.Checkout:return a.ZP.createElement(Gr,{prices:E,shippingPrices:T.shipping&&s?Vr(s,T.shipping):void 0,totalPrice:x,invoiceContent:v,checkoutInfo:O,currency:Z});default:return}}(n)))):a.ZP.createElement("div",{className:"empty-content"},a.ZP.createElement(F.Z,{color:"gray"})),a.ZP.createElement("div",{className:"footer"},a.ZP.createElement(R.Z,{type:"submit",onClick:_,disabled:$,isLoading:$},j)),y&&!y.field&&function(){if(y)return a.ZP.createElement(ge.Z,{className:"error",isOpen:Boolean(y),onClose:U},a.ZP.createElement("h4",null,y.description||"Error"),a.ZP.createElement("p",null,y.description||"Error"),a.ZP.createElement(R.Z,{isText:!0,onClick:S},D("OK")))}())})));function Hr(e,t){return e.find((({id:e})=>e===t))}function Vr(e,t){const n=Hr(e,t);return null==n?void 0:n.prices}const qr=(0,a.X$)((0,s.c$)((e=>{const{receipt:t}=e.payment,{currency:n,prices:a,info:s,totalAmount:r,credentialsTitle:o,shippingPrices:l,shippingMethod:i,photoUrl:c,text:d,title:m}=t||{};return{currency:n,prices:a,info:s,totalAmount:r,credentialsTitle:o,shippingPrices:l,shippingMethod:i,photoUrl:c,text:d,title:m}}))((({isOpen:e,onClose:t,prices:n,shippingPrices:s,totalAmount:r,currency:o,info:l,photoUrl:i,text:c,title:d,credentialsTitle:m,shippingMethod:u})=>{const h=(0,M.Z)(),Z=(0,a.Ye)((()=>function(e,t,n){if(!t)return{paymentMethod:e};const{shippingAddress:a}=t,s=null!=a&&a.streetLine1?`${a.streetLine1}, ${a.city}, ${a.countryIso2}`:void 0,{phone:r,name:o}=t;return{paymentMethod:e,paymentProvider:"Stripe",shippingAddress:s,name:o,phone:r,shippingMethod:n}}(m,l,u)),[l,u,m]);return a.ZP.createElement(ge.Z,{className:"PaymentModal PaymentModal-receipt",isOpen:e,onClose:t},a.ZP.createElement("div",null,a.ZP.createElement("div",{className:"header",dir:h.isRtl?"rtl":void 0},a.ZP.createElement(R.Z,{className:"close-button",color:"translucent",round:!0,size:"smaller",onClick:t,ariaLabel:"Close"},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement("h3",null," ",h("PaymentReceipt")," ")),a.ZP.createElement("div",{className:"receipt-content custom-scroll"},a.ZP.createElement(Gr,{prices:n,shippingPrices:s,totalPrice:r,invoiceContent:{photoUrl:i,text:c,title:d},checkoutInfo:Z,currency:o}))))})))},9364:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(4050),s=n(3716),r=n(7361),o=n(6752),l=n(9107),i=n(231);const c=r.wB?550:400,d=(0,a.X$)((({isLoading:e=!1,isPasswordVisible:t,error:n,hint:d,placeholder:m="Password",submitLabel:u="Next",clearError:h,onChangePasswordVisibility:Z,onInputChange:P,onSubmit:g})=>{const v=(0,a.sO)(null),p=(0,l.Z)(),[E,C]=(0,a.eJ)(""),[f,b]=(0,a.eJ)(!1);return(0,a.d4)((()=>{r.$b||setTimeout((()=>{v.current.focus()}),c)}),[]),(0,a.d4)((()=>{n&&requestAnimationFrame((()=>{v.current.focus(),v.current.select()}))}),[n]),a.ZP.createElement("form",{action:"",onSubmit:function(t){t.preventDefault(),e||f&&g(E)},autoComplete:"off"},a.ZP.createElement("div",{className:(0,o.Z)("input-group password-input",E&&"touched",n&&"error"),dir:p.isRtl?"rtl":void 0},a.ZP.createElement("input",{ref:v,className:"form-control",type:t?"text":"password",id:"sign-in-password",value:E||"",autoComplete:"current-password",onChange:function(e){n&&h();const{target:t}=e;C(t.value),b(t.value.length>=s.lo),P&&P(t.value)},dir:"auto"}),a.ZP.createElement("label",null,n||d||m),a.ZP.createElement("div",{className:"toggle-password",onClick:function(){Z(!t)},role:"button",tabIndex:0,title:"Toggle password visibility"},a.ZP.createElement("i",{className:t?"icon-eye":"icon-eye-closed"}))),f&&a.ZP.createElement(i.Z,{type:"submit",ripple:!0,isLoading:e},u))}))},3490:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(4050),s=n(3716),r=n(7361),o=n(7324),l=n(7799);const i=[0,50],c=[0,20],d=[20,0],m=r.wB?s.qp:s.z7,u=(0,a.X$)((({isPasswordVisible:e,isBig:t})=>{const[n,r]=(0,a.eJ)(),[u,h]=(0,a.eJ)(),[Z,P]=(0,a.eJ)(!1),[g,v]=(0,a.eJ)(!1);(0,a.d4)((()=>{n?setTimeout((()=>v(!0)),2e3):(0,o.Z)("MonkeyClose").then(r)}),[n]),(0,a.d4)((()=>{u||(0,o.Z)("MonkeyPeek").then(h)}),[u]);const p=(0,a.I4)((()=>P(!0)),[]);return a.ZP.createElement("div",{id:"monkey",className:t?"big":""},!Z&&a.ZP.createElement("div",{className:"monkey-preview"}),n&&a.ZP.createElement(l.Z,{id:"closeMonkey",size:t?s.K2:m,className:g?"hidden":"shown",animationData:n,playSegment:i,noLoop:!0,onLoad:p}),u&&a.ZP.createElement(l.Z,{id:"peekMonkey",size:t?s.K2:m,className:g?"shown":"hidden",animationData:u,playSegment:e?c:d,noLoop:!0}))}))},7324:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(6137),s=n(647);const r={MonkeyIdle:n(1679),MonkeyTracking:n(4889),MonkeyClose:n(4185),MonkeyPeek:n(8431),FoldersAll:n(6041),FoldersNew:n(7196),DiscussionGroups:n(4349)};function o(e){const t=r[e].replace(window.location.origin,"");return s.he(`file${t}`,a.IU.Lottie)}},710:(e,t,n)=>{n.d(t,{Z:()=>g});var a=n(4050),s=n(6752),r=n(3716),o=n(1394),l=n(9107),i=n(231),c=n(3103),d=n(4288);const m={type:"blob",quality:1,format:"jpeg",circle:!1};let u,h,Z;const P=(0,a.X$)((({file:e,onChange:t,onClose:s})=>{const[P,g]=(0,a.eJ)(!1);(0,a.d4)((()=>{e&&(P?async function(e){try{const t=document.getElementById("avatar-crop");if(!t)return;const{offsetWidth:n,offsetHeight:a}=t;Z=new u(t,{enableZoom:!0,boundary:{width:n,height:a},viewport:{width:n-16,height:a-16,type:"circle"}});const s=await(0,o.YJ)(e);await Z.bind({url:s})}catch(e){r.eM&&console.error(e)}}(e):async function(){return h||(h=Promise.all([n.e(99),n.e(472)]).then(n.bind(n,3472)),u=(await h).default),h}().then((()=>g(!0))))}),[e,P]);const v=(0,l.Z)();return a.ZP.createElement(c.Z,{isOpen:Boolean(e),onClose:s,title:"Drag to reposition",className:"CropModal",hasCloseButton:!0},P?a.ZP.createElement("div",{id:"avatar-crop"}):a.ZP.createElement(d.Z,null),a.ZP.createElement(i.Z,{className:"confirm-button",round:!0,color:"primary",onClick:async function(){if(!Z)return;const e=await Z.result(m),n="string"==typeof e?e:(0,o.hl)(e,"avatar.jpg");t(n)},ariaLabel:v("CropImage")},a.ZP.createElement("i",{className:"icon-check"})))})),g=(0,a.X$)((({title:e="Change your profile picture",disabled:t,currentAvatarBlobUrl:n,onChange:r})=>{const[o,l]=(0,a.eJ)(),[i,c]=(0,a.eJ)(n);(0,a.d4)((()=>{c(n)}),[n]);const d=(0,s.Z)(i&&"filled",t&&"disabled");return a.ZP.createElement("div",{className:"AvatarEditable"},a.ZP.createElement("label",{className:d,role:"button",tabIndex:0,title:e},a.ZP.createElement("input",{type:"file",onChange:function(e){const t=e.target;t&&t.files&&t.files[0]&&(l(t.files[0]),t.value="")},accept:"image/png, image/jpeg"}),a.ZP.createElement("i",{className:"icon-camera-add"}),i&&a.ZP.createElement("img",{src:i,alt:"Avatar"})),a.ZP.createElement(P,{file:o,onClose:function(){l(void 0)},onChange:function(e){l(void 0),r(e),i&&URL.revokeObjectURL(i),c(URL.createObjectURL(e))}}))}))},4349:(e,t,n)=>{e.exports=n.p+"DiscussionGroupsDucks.9ea453d1be9d1b0ee77a..tgs"},6041:(e,t,n)=>{e.exports=n.p+"FoldersAll.3f9f9e243d19f0fbf9aa..tgs"},7196:(e,t,n)=>{e.exports=n.p+"FoldersNew.9a40d71c0c8be70f5bd1..tgs"},4185:(e,t,n)=>{e.exports=n.p+"TwoFactorSetupMonkeyClose.604c4c833d322b7e6c3e..tgs"},1679:(e,t,n)=>{e.exports=n.p+"TwoFactorSetupMonkeyIdle.dea4a492c144df84ddab..tgs"},8431:(e,t,n)=>{e.exports=n.p+"TwoFactorSetupMonkeyPeek.1905436b042520363d7e..tgs"},4889:(e,t,n)=>{e.exports=n.p+"TwoFactorSetupMonkeyTracking.eb5a7a6f166fb7589c12..tgs"},6352:(e,t,n)=>{e.exports=n.p+"mastercard.4216118edafe23cc2dec..svg"},5753:(e,t,n)=>{e.exports=n.p+"visa.e5a7c336e1deb4b92a63..svg"}}]); -//# sourceMappingURL=347.e76314e5520fe6e65783.js.map \ No newline at end of file diff --git a/dist/347.e76314e5520fe6e65783.js.map b/dist/347.e76314e5520fe6e65783.js.map deleted file mode 100644 index 28765ac3..00000000 --- a/dist/347.e76314e5520fe6e65783.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"347.e76314e5520fe6e65783.js","mappings":"4rCA6MA,SAASA,EAAYC,EA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B,MAAM,IAC7B//B,EAAOjE,MAAQ,KAiCTogC,OAAO,0BAET,wBAAG5mC,UAAU,oBACZ45E,GAAkB,0BAAKx9E,IAAKw9E,EAAgB9pE,IAAI,YAEnD,mBAAC,EAAD,CAAWk/C,KAAM0qB,EAAcryE,QAzBnC,WACEsyE,OAAgBp4E,IAwB4CgL,SAnC9D,SAA0BitE,GACxBG,OAAgBp4E,GAChBgL,EAASitE,GAELI,GACFG,IAAIC,gBAAgBJ,GAEtBC,EAAkBE,IAAIE,gBAAgBT,Y","sources":["webpack://telegram-t/./src/components/mediaViewer/helpers/ghostAnimation.ts","webpack://telegram-t/./src/components/mediaViewer/SenderInfo.tsx","webpack://telegram-t/./src/components/mediaViewer/MediaViewerActions.tsx","webpack://telegram-t/./src/components/mediaViewer/MediaViewerFooter.tsx","webpack://telegram-t/./src/hooks/useFullscreen.ts","webpack://telegram-t/./src/components/mediaViewer/helpers/formatFileSize.ts","webpack://telegram-t/./src/components/mediaViewer/VideoPlayerControls.tsx","webpack://telegram-t/./src/components/mediaViewer/VideoPlayer.tsx","webpack://telegram-t/./src/components/mediaViewer/ZoomControls.tsx","webpack://telegram-t/./src/components/mediaViewer/PanZoom.tsx","webpack://telegram-t/./src/components/mediaViewer/MediaViewer.tsx","webpack://telegram-t/./src/components/main/ForwardPicker.tsx","webpack://telegram-t/./src/components/main/Dialogs.tsx","webpack://telegram-t/./src/components/main/Notifications.tsx","webpack://telegram-t/./src/components/main/SafeLinkModal.tsx","webpack://telegram-t/./src/components/common/CalendarModal.tsx","webpack://telegram-t/./src/components/main/HistoryCalendar.tsx","webpack://telegram-t/./src/components/common/DeleteMessageModal.tsx","webpack://telegram-t/./src/components/common/PinMessageModal.tsx","webpack://telegram-t/./src/components/common/UnpinAllMessagesModal.tsx","webpack://telegram-t/./src/components/middle/DeleteSelectedMessageModal.tsx","webpack://telegram-t/./src/components/common/ReportMessageModal.tsx","webpack://telegram-t/./src/components/middle/MessageSelectToolbar.tsx","webpack://telegram-t/./src/hooks/useSelectWithEnter.ts","webpack://telegram-t/./src/components/left/search/LeftSearchResultChat.tsx","webpack://telegram-t/./src/components/left/search/RecentContacts.tsx","webpack://telegram-t/./src/components/left/search/ChatMessage.tsx","webpack://telegram-t/./src/components/left/search/DateSuggest.tsx","webpack://telegram-t/./src/components/left/search/ChatResults.tsx","webpack://telegram-t/./src/components/left/search/ChatMessageResults.tsx","webpack://telegram-t/./src/components/left/search/helpers/createMapStateToProps.ts","webpack://telegram-t/./src/components/left/search/MediaResults.tsx","webpack://telegram-t/./src/components/left/search/helpers/getSenderName.ts","webpack://telegram-t/./src/components/left/search/LinkResults.tsx","webpack://telegram-t/./src/components/left/search/FileResults.tsx","webpack://telegram-t/./src/components/left/search/AudioResults.tsx","webpack://telegram-t/./src/components/left/search/LeftSearch.tsx","webpack://telegram-t/./src/hooks/reducers/useTwoFaReducer.ts","webpack://telegram-t/./src/components/left/settings/SettingsHeader.tsx","webpack://telegram-t/./src/components/left/settings/SettingsMain.tsx","webpack://telegram-t/./src/components/common/UsernameInput.tsx","webpack://telegram-t/./src/components/left/settings/SettingsEditProfile.tsx","webpack://telegram-t/./src/components/left/settings/folders/SettingsFoldersMain.tsx","webpack://telegram-t/./src/components/ui/ShowMoreButton.tsx","webpack://telegram-t/./src/components/left/settings/folders/SettingsFoldersEdit.tsx","webpack://telegram-t/./src/components/left/settings/folders/SettingsFoldersChatsPicker.tsx","webpack://telegram-t/./src/components/left/settings/folders/SettingsFoldersChatFilters.tsx","webpack://telegram-t/./src/components/left/settings/folders/SettingsFolders.tsx","webpack://telegram-t/./src/components/ui/RangeSlider.tsx","webpack://telegram-t/./src/components/middle/composer/StickerSetCoverAnimated.tsx","webpack://telegram-t/./src/components/middle/composer/StickerSetCover.tsx","webpack://telegram-t/./src/components/left/settings/SettingsStickerSet.tsx","webpack://telegram-t/./src/components/left/settings/SettingsGeneral.tsx","webpack://telegram-t/./src/util/systemFilesDialog.ts","webpack://telegram-t/./src/util/colors.ts","webpack://telegram-t/./src/components/left/settings/WallpaperTile.tsx","webpack://telegram-t/./src/components/left/settings/SettingsGeneralBackground.tsx","webpack://telegram-t/./src/components/left/settings/SettingsGeneralBackgroundColor.tsx","webpack://telegram-t/./src/components/left/settings/SettingsNotifications.tsx","webpack://telegram-t/./src/components/left/settings/SettingsPrivacy.tsx","webpack://telegram-t/./src/components/left/settings/SettingsLanguage.tsx","webpack://telegram-t/./src/components/left/settings/helper/privacy.ts","webpack://telegram-t/./src/components/left/settings/SettingsPrivacyVisibility.tsx","webpack://telegram-t/./src/components/left/settings/SettingsPrivacyActiveSessions.tsx","webpack://telegram-t/./src/components/left/settings/SettingsPrivacyBlockedUsers.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFaPassword.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFaStart.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFa.tsx","webpack://telegram-t/./src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx","webpack://telegram-t/./src/components/left/settings/Settings.tsx","webpack://telegram-t/./src/components/left/main/ContactList.tsx","webpack://telegram-t/./src/components/left/newChat/NewChatStep1.tsx","webpack://telegram-t/./src/components/left/newChat/NewChatStep2.tsx","webpack://telegram-t/./src/components/left/newChat/NewChat.tsx","webpack://telegram-t/./src/components/left/ArchivedChats.tsx","webpack://telegram-t/./src/util/scrollLock.ts","webpack://telegram-t/./src/components/middle/message/helpers/copyOptions.ts","webpack://telegram-t/./src/components/middle/message/MessageContextMenu.tsx","webpack://telegram-t/./src/components/middle/message/ContextMenuContainer.tsx","webpack://telegram-t/./src/components/common/StickerSetModal.tsx","webpack://telegram-t/./src/components/middle/HeaderMenuContainer.tsx","webpack://telegram-t/./src/components/middle/MobileSearch.tsx","webpack://telegram-t/./src/util/findInViewport.ts","webpack://telegram-t/./src/util/isFullyVisible.ts","webpack://telegram-t/./src/util/setTooltipItemVisible.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useKeyboardNavigation.ts","webpack://telegram-t/./src/components/middle/composer/MentionTooltip.tsx","webpack://telegram-t/./src/components/middle/composer/AttachmentModal.tsx","webpack://telegram-t/./src/components/middle/composer/PollModal.tsx","webpack://telegram-t/./src/components/middle/composer/EmojiButton.tsx","webpack://telegram-t/./src/components/middle/composer/EmojiCategory.tsx","webpack://telegram-t/./src/components/middle/composer/EmojiPicker.tsx","webpack://telegram-t/./src/components/middle/composer/StickerSet.tsx","webpack://telegram-t/./src/components/middle/composer/StickerPicker.tsx","webpack://telegram-t/./src/components/common/GifButton.tsx","webpack://telegram-t/./src/components/middle/composer/GifPicker.tsx","webpack://telegram-t/./src/components/middle/composer/SymbolMenuFooter.tsx","webpack://telegram-t/./src/components/middle/composer/SymbolMenu.tsx","webpack://telegram-t/./src/components/middle/composer/AttachMenu.tsx","webpack://telegram-t/./src/components/middle/composer/BotCommand.tsx","webpack://telegram-t/./src/components/middle/composer/BotCommandTooltip.tsx","webpack://telegram-t/./src/components/middle/composer/BotCommandMenu.tsx","webpack://telegram-t/./src/components/middle/composer/StickerTooltip.tsx","webpack://telegram-t/./src/components/middle/composer/CustomSendMenu.tsx","webpack://telegram-t/./src/components/middle/composer/EmojiTooltip.tsx","webpack://telegram-t/./src/components/middle/composer/inlineResults/BaseResult.tsx","webpack://telegram-t/./src/components/middle/composer/inlineResults/MediaResult.tsx","webpack://telegram-t/./src/components/middle/composer/inlineResults/ArticleResult.tsx","webpack://telegram-t/./src/components/middle/composer/inlineResults/GifResult.tsx","webpack://telegram-t/./src/components/middle/composer/inlineResults/StickerResult.tsx","webpack://telegram-t/./src/components/middle/composer/InlineBotTooltip.tsx","webpack://telegram-t/./src/components/right/RightSearch.tsx","webpack://telegram-t/./src/components/right/StickerSetResult.tsx","webpack://telegram-t/./src/components/right/StickerSearch.tsx","webpack://telegram-t/./src/components/right/GifSearch.tsx","webpack://telegram-t/./src/components/right/PollAnswerResults.tsx","webpack://telegram-t/./src/components/right/PollResults.tsx","webpack://telegram-t/./src/components/right/management/ManageUser.tsx","webpack://telegram-t/./src/components/right/management/ManageGroup.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupPermissions.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupRemovedUsers.tsx","webpack://telegram-t/./src/components/right/management/ManageChannel.tsx","webpack://telegram-t/./src/components/right/management/ManageChatPrivacyType.tsx","webpack://telegram-t/./src/components/right/management/ManageDiscussion.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupUserPermissions.tsx","webpack://telegram-t/./src/components/right/management/ManageChatAdministrators.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupRecentActions.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupAdminRights.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupMembers.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupUserPermissionsCreate.tsx","webpack://telegram-t/./src/components/right/management/Management.tsx","webpack://telegram-t/./src/components/common/helpers/detectCardType.ts","webpack://telegram-t/./src/hooks/reducers/usePaymentReducer.ts","webpack://telegram-t/./src/hooks/useFocusAfterAnimation.tsx","webpack://telegram-t/./src/components/ui/Select.tsx","webpack://telegram-t/./src/components/payment/ShippingInfo.tsx","webpack://telegram-t/./src/components/payment/Shipping.tsx","webpack://telegram-t/./src/components/payment/Checkout.tsx","webpack://telegram-t/./src/components/payment/ExpiryInput.tsx","webpack://telegram-t/./src/components/middle/helpers/inputFormatters.ts","webpack://telegram-t/./src/components/payment/CardInput.tsx","webpack://telegram-t/./src/components/payment/PaymentInfo.tsx","webpack://telegram-t/./src/components/payment/PaymentModal.tsx","webpack://telegram-t/./src/components/payment/ReceiptModal.tsx","webpack://telegram-t/./src/components/common/PasswordForm.tsx","webpack://telegram-t/./src/components/common/PasswordMonkey.tsx","webpack://telegram-t/./src/components/common/helpers/animatedAssets.ts","webpack://telegram-t/./src/components/ui/CropModal.tsx","webpack://telegram-t/./src/components/ui/AvatarEditable.tsx"],"sourcesContent":["import { ApiMessage, ApiDimensions } from '../../../api/types';\n\nimport { MediaViewerOrigin } from '../../../types';\n\nimport { ANIMATION_END_DELAY } from '../../../config';\nimport {\n calculateDimensions,\n getMediaViewerAvailableDimensions,\n MEDIA_VIEWER_MEDIA_QUERY,\n REM,\n} from '../../common/helpers/mediaDimensions';\nimport windowSize from '../../../util/windowSize';\n\nconst ANIMATION_DURATION = 200;\n\nexport function animateOpening(\n hasFooter: boolean,\n origin: MediaViewerOrigin,\n bestImageData: string,\n dimensions: ApiDimensions,\n isVideo: boolean,\n message?: ApiMessage,\n) {\n const { mediaEl: fromImage } = getNodes(origin, message);\n if (!fromImage) {\n return;\n }\n\n const { width: windowWidth } = windowSize.get();\n const {\n width: availableWidth, height: availableHeight,\n } = getMediaViewerAvailableDimensions(hasFooter, isVideo);\n const { width: toWidth, height: toHeight } = calculateDimensions(\n availableWidth, availableHeight, dimensions.width, dimensions.height,\n );\n const toLeft = (windowWidth - toWidth) / 2;\n const toTop = getTopOffset(hasFooter) + (availableHeight - toHeight) / 2;\n\n let {\n top: fromTop, left: fromLeft, width: fromWidth, height: fromHeight,\n } = fromImage.getBoundingClientRect();\n\n if ([\n MediaViewerOrigin.SharedMedia,\n MediaViewerOrigin.Album,\n MediaViewerOrigin.ScheduledAlbum,\n MediaViewerOrigin.SearchResult,\n ].includes(origin)) {\n const uncovered = uncover(toWidth, toHeight, fromTop, fromLeft, fromWidth, fromHeight);\n fromTop = uncovered.top;\n fromLeft = uncovered.left;\n fromWidth = uncovered.width;\n fromHeight = uncovered.height;\n }\n\n const fromTranslateX = (fromLeft + fromWidth / 2) - (toLeft + toWidth / 2);\n const fromTranslateY = (fromTop + fromHeight / 2) - (toTop + toHeight / 2);\n const fromScaleX = fromWidth / toWidth;\n const fromScaleY = fromHeight / toHeight;\n\n const ghost = createGhost(bestImageData || fromImage);\n applyStyles(ghost, {\n top: `${toTop}px`,\n left: `${toLeft}px`,\n width: `${toWidth}px`,\n height: `${toHeight}px`,\n transform: `translate3d(${fromTranslateX}px, ${fromTranslateY}px, 0) scale(${fromScaleX}, ${fromScaleY})`,\n });\n applyShape(ghost, origin);\n\n document.body.classList.add('ghost-animating');\n\n requestAnimationFrame(() => {\n document.body.appendChild(ghost);\n\n requestAnimationFrame(() => {\n ghost.style.transform = '';\n clearShape(ghost);\n\n setTimeout(() => {\n requestAnimationFrame(() => {\n if (document.body.contains(ghost)) {\n document.body.removeChild(ghost);\n }\n document.body.classList.remove('ghost-animating');\n });\n }, ANIMATION_DURATION + ANIMATION_END_DELAY);\n });\n });\n}\n\nexport function animateClosing(origin: MediaViewerOrigin, bestImageData: string, message?: ApiMessage) {\n const { container, mediaEl: toImage } = getNodes(origin, message);\n if (!toImage) {\n return;\n }\n\n const fromImage = document.getElementById('MediaViewer')!.querySelector(\n '.active .media-viewer-content img, .active .media-viewer-content video',\n );\n if (!fromImage || !toImage) {\n return;\n }\n\n const {\n top: fromTop, left: fromLeft, width: fromWidth, height: fromHeight,\n } = fromImage.getBoundingClientRect();\n const {\n top: targetTop, left: toLeft, width: toWidth, height: toHeight,\n } = toImage.getBoundingClientRect();\n\n let toTop = targetTop;\n if (!isElementInViewport(container)) {\n const { height: windowHeight } = windowSize.get();\n toTop = targetTop < fromTop ? -toHeight : windowHeight;\n }\n\n const fromTranslateX = (fromLeft + fromWidth / 2) - (toLeft + toWidth / 2);\n const fromTranslateY = (fromTop + fromHeight / 2) - (toTop + toHeight / 2);\n let fromScaleX = fromWidth / toWidth;\n let fromScaleY = fromHeight / toHeight;\n\n const shouldFadeOut = (\n [MediaViewerOrigin.Inline, MediaViewerOrigin.ScheduledInline].includes(origin)\n && !isMessageImageFullyVisible(container, toImage)\n ) || (\n [MediaViewerOrigin.Album, MediaViewerOrigin.ScheduledAlbum].includes(origin)\n && !isMessageImageFullyVisible(container, toImage)\n );\n\n if ([\n MediaViewerOrigin.SharedMedia,\n MediaViewerOrigin.Album,\n MediaViewerOrigin.ScheduledAlbum,\n MediaViewerOrigin.SearchResult,\n ].includes(origin)) {\n if (fromScaleX > fromScaleY) {\n fromScaleX = fromScaleY;\n } else if (fromScaleY > fromScaleX) {\n fromScaleY = fromScaleX;\n }\n }\n\n const existingGhost = document.getElementsByClassName('ghost')[0] as HTMLDivElement;\n\n const ghost = existingGhost || createGhost(bestImageData || toImage, origin);\n if (!existingGhost) {\n applyStyles(ghost, {\n top: `${toTop}px`,\n left: `${toLeft}px`,\n width: `${toWidth}px`,\n height: `${toHeight}px`,\n transform: `translate3d(${fromTranslateX}px, ${fromTranslateY}px, 0) scale(${fromScaleX}, ${fromScaleY})`,\n });\n }\n\n requestAnimationFrame(() => {\n if (existingGhost) {\n const {\n top,\n left,\n width,\n height,\n } = existingGhost.getBoundingClientRect();\n const scaleX = width / toWidth;\n const scaleY = height / toHeight;\n\n applyStyles(ghost, {\n transition: 'none',\n top: `${toTop}px`,\n left: `${toLeft}px`,\n transformOrigin: 'top left',\n transform: `translate3d(${left - toLeft}px, ${top - toTop}px, 0) scale(${scaleX}, ${scaleY})`,\n width: `${toWidth}px`,\n height: `${toHeight}px`,\n });\n }\n document.body.classList.add('ghost-animating');\n if (!existingGhost) document.body.appendChild(ghost);\n\n requestAnimationFrame(() => {\n if (existingGhost) {\n existingGhost.style.transition = '';\n }\n\n ghost.style.transform = '';\n\n if (shouldFadeOut) {\n ghost.style.opacity = '0';\n }\n\n applyShape(ghost, origin);\n\n setTimeout(() => {\n requestAnimationFrame(() => {\n if (document.body.contains(ghost)) {\n document.body.removeChild(ghost);\n }\n document.body.classList.remove('ghost-animating');\n });\n }, ANIMATION_DURATION + ANIMATION_END_DELAY);\n });\n });\n}\n\nfunction createGhost(source: string | HTMLImageElement | HTMLVideoElement, origin?: MediaViewerOrigin) {\n const ghost = document.createElement('div');\n ghost.classList.add('ghost');\n\n const img = new Image();\n\n if (typeof source === 'string') {\n img.src = source;\n } else if (source instanceof HTMLVideoElement) {\n img.src = source.poster;\n } else {\n img.src = source.src;\n }\n\n ghost.appendChild(img);\n\n if (origin === MediaViewerOrigin.ProfileAvatar || origin === MediaViewerOrigin.SettingsAvatar) {\n ghost.classList.add('ProfileInfo');\n if (origin === MediaViewerOrigin.SettingsAvatar) {\n ghost.classList.add('self');\n }\n const profileInfo = document.querySelector(\n origin === MediaViewerOrigin.ProfileAvatar\n ? '#RightColumn .ProfileInfo .info'\n : '#Settings .ProfileInfo .info',\n );\n if (profileInfo) {\n ghost.appendChild(profileInfo.cloneNode(true));\n }\n }\n\n return ghost;\n}\n\nfunction uncover(realWidth: number, realHeight: number, top: number, left: number, width: number, height: number) {\n if (realWidth === realHeight) {\n const size = Math.max(width, height) * (realWidth / realHeight);\n left -= (size - width) / 2;\n top -= (size - height) / 2;\n width = size;\n height = size;\n } else if (realWidth > realHeight) {\n const srcWidth = width;\n width = height * (realWidth / realHeight);\n left -= (width - srcWidth) / 2;\n } else if (realHeight > realWidth) {\n const srcHeight = height;\n height = width * (realHeight / realWidth);\n top -= (height - srcHeight) / 2;\n }\n\n return {\n top, left, width, height,\n };\n}\n\nfunction isElementInViewport(el: HTMLElement) {\n if (el.style.display === 'none') {\n return false;\n }\n\n const rect = el.getBoundingClientRect();\n const { height: windowHeight } = windowSize.get();\n\n return (rect.top <= windowHeight) && ((rect.top + rect.height) >= 0);\n}\n\nfunction isMessageImageFullyVisible(container: HTMLElement, imageEl: HTMLElement) {\n const messageListElement = document.querySelector('.active > .MessageList')!;\n let imgOffsetTop = container.offsetTop + imageEl.closest('.content-inner, .WebPage')!.offsetTop;\n if (container.id.includes('album-media-')) {\n imgOffsetTop += container.parentElement!.offsetTop + container.closest('.Message')!.offsetTop;\n }\n\n return imgOffsetTop > messageListElement.scrollTop\n && imgOffsetTop + imageEl.offsetHeight < messageListElement.scrollTop + messageListElement.offsetHeight;\n}\n\nfunction getTopOffset(hasFooter: boolean) {\n const mql = window.matchMedia(MEDIA_VIEWER_MEDIA_QUERY);\n let topOffsetRem = 4.125;\n if (hasFooter) {\n topOffsetRem += mql.matches ? 0.875 : 3.375;\n }\n\n return topOffsetRem * REM;\n}\n\nfunction applyStyles(element: HTMLElement, styles: Record) {\n Object.assign(element.style, styles);\n}\n\nfunction getNodes(origin: MediaViewerOrigin, message?: ApiMessage) {\n let containerSelector;\n let mediaSelector;\n\n switch (origin) {\n case MediaViewerOrigin.Album:\n case MediaViewerOrigin.ScheduledAlbum:\n containerSelector = `.active > .MessageList #album-media-${message!.id}`;\n mediaSelector = '.full-media';\n break;\n\n case MediaViewerOrigin.SharedMedia:\n containerSelector = `#shared-media${message!.id}`;\n mediaSelector = 'img';\n break;\n\n case MediaViewerOrigin.SearchResult:\n containerSelector = `#search-media${message!.id}`;\n mediaSelector = 'img';\n break;\n\n case MediaViewerOrigin.MiddleHeaderAvatar:\n containerSelector = '.MiddleHeader .ChatInfo .Avatar';\n mediaSelector = 'img.avatar-media';\n break;\n\n case MediaViewerOrigin.SettingsAvatar:\n containerSelector = '#Settings .ProfileInfo .active .ProfilePhoto';\n mediaSelector = 'img.avatar-media';\n break;\n\n case MediaViewerOrigin.ProfileAvatar:\n containerSelector = '#RightColumn .ProfileInfo .active .ProfilePhoto';\n mediaSelector = 'img.avatar-media';\n break;\n\n case MediaViewerOrigin.ScheduledInline:\n case MediaViewerOrigin.Inline:\n default:\n containerSelector = `.active > .MessageList #message${message!.id}`;\n mediaSelector = '.message-content .full-media, .message-content .thumbnail';\n }\n\n const container = document.querySelector(containerSelector)!;\n const mediaEls = container && container.querySelectorAll(mediaSelector);\n\n return {\n container,\n mediaEl: mediaEls?.[mediaEls.length - 1],\n };\n}\n\nfunction applyShape(ghost: HTMLDivElement, origin: MediaViewerOrigin) {\n switch (origin) {\n case MediaViewerOrigin.Album:\n case MediaViewerOrigin.ScheduledAlbum:\n case MediaViewerOrigin.Inline:\n case MediaViewerOrigin.ScheduledInline:\n ghost.classList.add('rounded-corners');\n break;\n\n case MediaViewerOrigin.SharedMedia:\n case MediaViewerOrigin.SettingsAvatar:\n case MediaViewerOrigin.ProfileAvatar:\n case MediaViewerOrigin.SearchResult:\n (ghost.firstChild as HTMLElement).style.objectFit = 'cover';\n break;\n\n case MediaViewerOrigin.MiddleHeaderAvatar:\n ghost.classList.add('circle');\n break;\n }\n}\n\nfunction clearShape(ghost: HTMLDivElement) {\n (ghost.firstChild as HTMLElement).style.objectFit = 'default';\n ghost.classList.remove('rounded-corners', 'circle');\n}\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat, ApiMessage, ApiUser } from '../../api/types';\n\nimport { getSenderTitle, isChatPrivate } from '../../modules/helpers';\nimport { formatMediaDateTime } from '../../util/dateFormat';\nimport renderText from '../common/helpers/renderText';\nimport {\n selectChat,\n selectChatMessage,\n selectSender,\n selectUser,\n} from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport Avatar from '../common/Avatar';\n\nimport './SenderInfo.scss';\n\ntype OwnProps = {\n chatId?: number;\n messageId?: number;\n isAvatar?: boolean;\n};\n\ntype StateProps = {\n sender?: ApiUser | ApiChat;\n message?: ApiMessage;\n};\n\ntype DispatchProps = Pick;\n\nconst SenderInfo: FC = ({\n chatId, messageId, sender, isAvatar, message, closeMediaViewer, focusMessage,\n}) => {\n const handleFocusMessage = useCallback(() => {\n closeMediaViewer();\n focusMessage({ chatId, messageId });\n }, [chatId, focusMessage, messageId, closeMediaViewer]);\n\n const lang = useLang();\n\n if (!sender || (!message && !isAvatar)) {\n return undefined;\n }\n\n const isFromChat = sender.id < 0;\n const senderTitle = getSenderTitle(lang, sender);\n\n return (\n
\n {isFromChat ? (\n \n ) : (\n \n )}\n
\n
\n {senderTitle && renderText(senderTitle)}\n
\n
\n {isAvatar ? lang('lng_mediaview_profile_photo') : formatMediaDateTime(lang, message!.date * 1000)}\n
\n
\n
\n );\n};\n\nexport default withGlobal(\n (global, { chatId, messageId, isAvatar }): StateProps => {\n if (isAvatar && chatId) {\n return {\n sender: isChatPrivate(chatId) ? selectUser(global, chatId) : selectChat(global, chatId),\n };\n }\n\n if (!messageId || !chatId) {\n return {};\n }\n\n const message = selectChatMessage(global, chatId, messageId);\n\n return {\n message,\n sender: message && selectSender(global, message),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['closeMediaViewer', 'focusMessage']),\n)(SenderInfo);\n","import React, { FC, useMemo } from '../../lib/teact/teact';\n\nimport { ApiMessage } from '../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { getMessageMediaHash } from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport useMediaDownload from '../../hooks/useMediaDownload';\n\nimport Button from '../ui/Button';\nimport DropdownMenu from '../ui/DropdownMenu';\nimport MenuItem from '../ui/MenuItem';\nimport ProgressSpinner from '../ui/ProgressSpinner';\n\nimport './MediaViewerActions.scss';\n\ntype OwnProps = {\n mediaData?: string;\n isVideo: boolean;\n isZoomed: boolean;\n message?: ApiMessage;\n fileName?: string;\n isAvatar?: boolean;\n onCloseMediaViewer: NoneToVoidFunction;\n onForward: NoneToVoidFunction;\n onZoomToggle: NoneToVoidFunction;\n};\n\nconst MediaViewerActions: FC = ({\n mediaData,\n isVideo,\n isZoomed,\n message,\n fileName,\n isAvatar,\n onCloseMediaViewer,\n onForward,\n onZoomToggle,\n}) => {\n const {\n isDownloadStarted,\n downloadProgress,\n handleDownloadClick,\n } = useMediaDownload(\n message && isVideo ? getMessageMediaHash(message, 'download') : undefined,\n fileName,\n );\n\n const lang = useLang();\n\n const MenuButton: FC<{ onTrigger: () => void; isOpen?: boolean }> = useMemo(() => {\n return ({ onTrigger, isOpen }) => (\n \n \n \n );\n }, []);\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n return (\n
\n \n {!isAvatar && (\n \n {lang('Forward')}\n \n )}\n {isVideo ? (\n \n {isDownloadStarted ? `${Math.round(downloadProgress * 100)}% Downloading...` : 'Download'}\n \n ) : (\n \n {lang('AccActionDownload')}\n \n )}\n \n {isDownloadStarted && }\n
\n );\n }\n\n return (\n
\n {!isAvatar && (\n <>\n \n \n \n \n )}\n {isVideo ? (\n \n {isDownloadStarted ? (\n \n ) : (\n \n )}\n \n ) : (\n \n \n \n )}\n \n \n \n \n \n \n
\n );\n};\n\nexport default MediaViewerActions;\n","import React, { FC, useEffect, useState } from '../../lib/teact/teact';\n\nimport { throttle } from '../../util/schedulers';\nimport { TextPart } from '../common/helpers/renderMessageText';\nimport buildClassName from '../../util/buildClassName';\nimport { REM } from '../common/helpers/mediaDimensions';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\n\nimport './MediaViewerFooter.scss';\n\nconst RESIZE_THROTTLE_MS = 500;\n\ntype OwnProps = {\n text: TextPart | TextPart[];\n onClick: () => void;\n isHidden?: boolean;\n isForVideo: boolean;\n};\n\nconst MediaViewerFooter: FC = ({\n text = '', isHidden, isForVideo, onClick,\n}) => {\n const [isMultiline, setIsMultiline] = useState(false);\n useEffect(() => {\n const footerContent = document.querySelector('.MediaViewerFooter .media-text') as HTMLDivElement | null;\n\n const checkIsMultiline = () => {\n const height = footerContent ? footerContent.clientHeight : 0;\n\n setIsMultiline(height > REM * 2);\n };\n\n // First run for initial detection of multiline footer text\n checkIsMultiline();\n\n const handleResize = throttle(checkIsMultiline, RESIZE_THROTTLE_MS, true);\n\n window.addEventListener('resize', handleResize, false);\n\n return () => {\n window.removeEventListener('resize', handleResize, false);\n };\n }, []);\n\n function stopEvent(e: React.MouseEvent) {\n if (text) {\n e.stopPropagation();\n }\n }\n\n const classNames = buildClassName(\n 'MediaViewerFooter',\n isForVideo && 'is-for-video',\n isHidden && 'is-hidden',\n );\n\n return (\n
\n {text && (\n
\n

{text}

\n
\n )}\n
\n );\n};\n\nexport default MediaViewerFooter;\n","import { useLayoutEffect, useState } from '../lib/teact/teact';\nimport { PLATFORM_ENV } from '../util/environment';\n\ntype RefType = {\n current: HTMLElement | null;\n};\n\ntype ReturnType = [boolean, () => void, () => void] | [false];\ntype CallbackType = (isPlayed: boolean) => void;\n\nconst prop = getBrowserFullscreenElementProp();\n\nexport default function useFullscreenStatus(elRef: RefType, setIsPlayed: CallbackType): ReturnType {\n const [isFullscreen, setIsFullscreen] = useState(Boolean(prop && document[prop]));\n\n const setFullscreen = () => {\n if (!elRef.current || !(prop || PLATFORM_ENV === 'iOS')) {\n return;\n }\n\n if (elRef.current.requestFullscreen) {\n elRef.current.requestFullscreen();\n } else if (elRef.current.webkitRequestFullscreen) {\n elRef.current.webkitRequestFullscreen();\n } else if (elRef.current.webkitEnterFullscreen) {\n elRef.current.webkitEnterFullscreen();\n } else if (elRef.current.mozRequestFullScreen) {\n elRef.current.mozRequestFullScreen();\n }\n\n setIsFullscreen(true);\n };\n\n const exitFullscreen = () => {\n if (!elRef.current) {\n return;\n }\n\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n }\n\n setIsFullscreen(false);\n };\n\n useLayoutEffect(() => {\n const listener = () => { setIsFullscreen(Boolean(prop && document[prop])); };\n const listenerEnter = () => { setIsFullscreen(true); };\n const listenerExit = () => {\n setIsFullscreen(false);\n setIsPlayed(false);\n };\n const video = elRef.current;\n\n document.addEventListener('fullscreenchange', listener, false);\n document.addEventListener('webkitfullscreenchange', listener, false);\n document.addEventListener('mozfullscreenchange', listener, false);\n\n if (video) {\n video.addEventListener('webkitbeginfullscreen', listenerEnter, false);\n video.addEventListener('webkitendfullscreen', listenerExit, false);\n }\n\n return () => {\n document.removeEventListener('fullscreenchange', listener, false);\n document.removeEventListener('webkitfullscreenchange', listener, false);\n document.removeEventListener('mozfullscreenchange', listener, false);\n if (video) {\n video.removeEventListener('webkitbeginfullscreen', listenerEnter, false);\n video.removeEventListener('webkitendfullscreen', listenerExit, false);\n }\n };\n // eslint-disable-next-line\n }, []);\n\n if (!prop && PLATFORM_ENV !== 'iOS') {\n return [false];\n }\n\n return [isFullscreen, setFullscreen, exitFullscreen];\n}\n\nfunction getBrowserFullscreenElementProp() {\n if (typeof document.fullscreenElement !== 'undefined') {\n return 'fullscreenElement';\n } else if (typeof document.mozFullScreenElement !== 'undefined') {\n return 'mozFullScreenElement';\n } else if (typeof document.webkitFullscreenElement !== 'undefined') {\n return 'webkitFullscreenElement';\n }\n\n return '';\n}\n","const units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'];\n\nexport default (bytes: number) => {\n const number = bytes === 0 ? 0 : Math.floor(Math.log(bytes) / Math.log(1024));\n\n return `${(bytes / 1024 ** Math.floor(number)).toFixed(1)} ${units[number]}`;\n};\n","import React, { FC, useState, useEffect } from '../../lib/teact/teact';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { formatMediaDuration } from '../../util/dateFormat';\nimport formatFileSize from './helpers/formatFileSize';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\n\nimport './VideoPlayerControls.scss';\n\ntype IProps = {\n bufferedProgress: number;\n currentTime: number;\n duration: number;\n fileSize: number;\n isForceVisible: boolean;\n isForceMobileVersion?: boolean;\n isPlayed: boolean;\n isFullscreenSupported: boolean;\n isFullscreen: boolean;\n onChangeFullscreen: (e: React.MouseEvent) => void;\n onPlayPause: (e: React.MouseEvent) => void;\n onSeek: OnChangeHandler;\n};\n\ntype OnChangeHandler = (e: React.ChangeEvent) => void;\n\nconst stopEvent = (e: React.MouseEvent) => {\n e.stopPropagation();\n};\n\nconst HIDE_CONTROLS_TIMEOUT_MS = 800;\n\nconst VideoPlayerControls: FC = ({\n bufferedProgress,\n currentTime,\n duration,\n fileSize,\n isForceVisible,\n isForceMobileVersion,\n isPlayed,\n isFullscreenSupported,\n isFullscreen,\n onChangeFullscreen,\n onPlayPause,\n onSeek,\n}) => {\n const [isVisible, setVisibility] = useState(true);\n\n useEffect(() => {\n if (isForceVisible) {\n setVisibility(isForceVisible);\n }\n }, [isForceVisible]);\n\n useEffect(() => {\n let timeout: number | undefined;\n\n if (!isForceVisible) {\n if (IS_SINGLE_COLUMN_LAYOUT) {\n setVisibility(false);\n } else {\n timeout = window.setTimeout(() => {\n setVisibility(false);\n }, HIDE_CONTROLS_TIMEOUT_MS);\n }\n }\n\n return () => {\n if (timeout) {\n window.clearTimeout(timeout);\n }\n };\n }, [isForceVisible]);\n\n useEffect(() => {\n if (isVisible || isForceVisible) {\n document.body.classList.add('video-controls-visible');\n }\n\n return () => {\n document.body.classList.remove('video-controls-visible');\n };\n }, [isForceVisible, isVisible]);\n\n const lang = useLang();\n\n if (!isVisible && !isForceVisible) {\n return undefined;\n }\n\n return (\n
\n {renderSeekLine(currentTime, duration, bufferedProgress, onSeek)}\n \n \n \n {renderTime(currentTime, duration)}\n {bufferedProgress < 1 && renderFileSize(bufferedProgress, fileSize)}\n {isFullscreenSupported && (\n \n \n \n )}\n
\n );\n};\n\nfunction renderTime(currentTime: number, duration: number) {\n return (\n
\n {`${formatMediaDuration(currentTime)} / ${formatMediaDuration(duration)}`}\n
\n );\n}\n\nfunction renderFileSize(downloadedPercent: number, totalSize: number) {\n return (\n
\n {`${formatFileSize(totalSize * downloadedPercent)} / ${formatFileSize(totalSize)}`}\n
\n );\n}\n\nfunction renderSeekLine(currentTime: number, duration: number, bufferedProgress: number, onSeek: OnChangeHandler) {\n const percentagePlayed = (currentTime / duration) * 100;\n const percentageBuffered = bufferedProgress * 100;\n\n return (\n
\n
\n \n \n \n
\n
\n );\n}\n\nexport default VideoPlayerControls;\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { ApiDimensions } from '../../api/types';\n\nimport { IS_IOS, IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../util/environment';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useBuffering from '../../hooks/useBuffering';\nimport useFullscreenStatus from '../../hooks/useFullscreen';\nimport useVideoCleanup from '../../hooks/useVideoCleanup';\nimport safePlay from '../../util/safePlay';\n\nimport VideoPlayerControls from './VideoPlayerControls';\nimport ProgressSpinner from '../ui/ProgressSpinner';\nimport Button from '../ui/Button';\n\nimport './VideoPlayer.scss';\n\ntype OwnProps = {\n url?: string;\n isGif?: boolean;\n posterData?: string;\n posterSize?: ApiDimensions;\n downloadProgress?: number;\n fileSize: number;\n isMediaViewerOpen?: boolean;\n noPlay?: boolean;\n onClose: (e: React.MouseEvent) => void;\n};\n\nconst MOBILE_VERSION_CONTROL_WIDTH = 400;\n\nconst VideoPlayer: FC = ({\n url,\n isGif,\n posterData,\n posterSize,\n downloadProgress,\n fileSize,\n isMediaViewerOpen,\n noPlay,\n onClose,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const videoRef = useRef(null);\n const [isPlayed, setIsPlayed] = useState(!IS_TOUCH_ENV || !IS_IOS);\n const [currentTime, setCurrentTime] = useState(0);\n const [isControlsVisible, setIsControlsVisible] = useState(true);\n\n const [isFullscreen, setFullscreen, exitFullscreen] = useFullscreenStatus(videoRef, setIsPlayed);\n\n const { isBuffered, bufferedProgress, bufferingHandlers } = useBuffering();\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(!isBuffered, undefined, undefined, 'slow');\n const {\n shouldRender: shouldRenderPlayButton,\n transitionClassNames: playButtonClassNames,\n } = useShowTransition(IS_IOS && !isPlayed && !shouldRenderSpinner, undefined, undefined, 'slow');\n\n useEffect(() => {\n if (noPlay || !isMediaViewerOpen) {\n videoRef.current!.pause();\n } else if (url && !IS_TOUCH_ENV) {\n // Chrome does not automatically start playing when `url` becomes available (even with `autoPlay`),\n // so we force it here. Contrary, iOS does not allow to call `play` without mouse event,\n // so we need to use `autoPlay` instead to allow pre-buffering.\n safePlay(videoRef.current!);\n }\n }, [noPlay, isMediaViewerOpen, url]);\n\n useEffect(() => {\n if (videoRef.current!.currentTime === videoRef.current!.duration) {\n setCurrentTime(0);\n setIsPlayed(false);\n } else {\n setCurrentTime(videoRef.current!.currentTime);\n }\n }, [currentTime]);\n\n const togglePlayState = useCallback((e: React.MouseEvent | KeyboardEvent) => {\n e.stopPropagation();\n if (isPlayed) {\n videoRef.current!.pause();\n setIsPlayed(false);\n } else {\n videoRef.current!.play();\n setIsPlayed(true);\n }\n }, [isPlayed]);\n\n useVideoCleanup(videoRef, []);\n\n const handleMouseOver = useCallback(() => {\n setIsControlsVisible(true);\n }, []);\n\n const handleMouseOut = useCallback(() => {\n setIsControlsVisible(false);\n }, []);\n\n const handleTimeUpdate = useCallback((e: React.SyntheticEvent) => {\n setCurrentTime(e.currentTarget.currentTime);\n }, []);\n\n const handleEnded = useCallback(() => {\n setCurrentTime(0);\n setIsPlayed(false);\n }, []);\n\n const handleFullscreenChange = useCallback(() => {\n if (isFullscreen && exitFullscreen) {\n exitFullscreen();\n } else if (!isFullscreen && setFullscreen) {\n setFullscreen();\n }\n }, [exitFullscreen, isFullscreen, setFullscreen]);\n\n const handleSeek = useCallback((e: React.ChangeEvent) => {\n e.stopPropagation();\n\n videoRef.current!.currentTime = (Number(e.target.value) * videoRef.current!.duration) / 100;\n }, []);\n\n const toggleControls = useCallback((e: React.MouseEvent) => {\n e.stopPropagation();\n setIsControlsVisible(!isControlsVisible);\n }, [isControlsVisible]);\n\n useEffect(() => {\n const togglePayingStateBySpace = (e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n togglePlayState(e);\n }\n };\n\n document.addEventListener('keydown', togglePayingStateBySpace, false);\n\n return () => {\n document.removeEventListener('keydown', togglePayingStateBySpace, false);\n };\n }, [togglePlayState]);\n\n const wrapperStyle = posterSize && `width: ${posterSize.width}px; height: ${posterSize.height}px`;\n const videoStyle = `background-image: url(${posterData})`;\n\n return (\n \n \n {/* eslint-disable-next-line jsx-a11y/media-has-caption */}\n \n {url && }\n \n \n {shouldRenderPlayButton && (\n \n )}\n {shouldRenderSpinner && (\n
\n {!isBuffered &&
Buffering...
}\n \n
\n )}\n {!isGif && !shouldRenderSpinner && (\n \n )}\n \n );\n};\n\nexport default memo(VideoPlayer);\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport buildClassName from '../../util/buildClassName';\nimport usePrevious from '../../hooks/usePrevious';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\n\nimport './ZoomControls.scss';\n\ntype OwnProps = {\n isShown: boolean;\n onChangeZoom: (level: number, canCloseZoom?: boolean) => void;\n};\n\nexport const MAX_ZOOM_LEVEL = 3;\nexport const MIN_ZOOM_LEVEL = 1;\nconst ONE_STEP_PERCENT = 100 / (MAX_ZOOM_LEVEL - MIN_ZOOM_LEVEL);\nconst RESET_ZOOM_LEVEL = 1.5;\n\nconst ZoomControls: FC = ({ isShown, onChangeZoom }) => {\n const { transitionClassNames } = useShowTransition(isShown);\n const prevIsShown = usePrevious(isShown);\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const [zoomLevel, setZoomLevel] = useState(1);\n const isSeeking = useRef(false);\n\n useEffect(() => {\n if (isShown && !prevIsShown) {\n setZoomLevel(RESET_ZOOM_LEVEL);\n }\n }, [isShown, prevIsShown]);\n\n const handleZoomOut = () => {\n if (inputRef.current) {\n setZoomLevel(Math.max(MIN_ZOOM_LEVEL, zoomLevel - 0.5));\n }\n };\n\n const handleZoomIn = () => {\n if (inputRef.current) {\n setZoomLevel(Math.min(MAX_ZOOM_LEVEL, zoomLevel + 0.5));\n }\n };\n\n const handleStartSeek = useCallback(() => {\n isSeeking.current = true;\n }, []);\n\n const handleStopSeek = useCallback(() => {\n isSeeking.current = false;\n if (zoomLevel === 1) {\n onChangeZoom(zoomLevel, !isSeeking.current);\n }\n }, [onChangeZoom, zoomLevel]);\n\n const handleSeeklineChange = (e:React.ChangeEvent) => {\n setZoomLevel(Math.min(MAX_ZOOM_LEVEL, Math.max(Number(e.target.value), MIN_ZOOM_LEVEL)));\n };\n\n useEffect(() => {\n onChangeZoom(zoomLevel, !isSeeking.current);\n }, [zoomLevel, onChangeZoom]);\n\n const lang = useLang();\n\n const className = buildClassName(\n 'ZoomControls',\n transitionClassNames,\n );\n\n return (\n
\n \n \n \n \n \n \n
\n
\n \n \n
\n
\n
\n );\n};\n\nexport default memo(ZoomControls);\n","/*\n @source https://github.com/ajainarayanan/react-pan-zoom\n\n Heavily inspired/lifted from this idea: https://stackoverflow.com/a/39311435/661768\n without jqueryUI or jquery dependency.\n*/\nimport React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { areSortedArraysEqual } from '../../util/iteratees';\n\nimport './PanZoom.scss';\n\nexport interface IDragData {\n x: number;\n y: number;\n dx: number;\n dy: number;\n}\n\nexport interface OwnProps {\n children: any;\n className?: string;\n noWrap: boolean;\n canPan: boolean;\n zoomLevel: number;\n panDeltaX: number;\n panDeltaY: number;\n onPan?: (x: number, y: number) => void;\n}\n\nconst INITIAL_MATRIX = [\n 1, 0, 0, 1, 0, 0,\n];\n\nconst SCALE_VALUES = {\n 1: 1,\n 1.5: 1.5,\n 2: 2.2,\n 2.5: 3.3,\n 3: 5.5,\n};\n\nconst ZOOM_SAFE_AREA = 150;\n\nfunction calculateSafeZoneOnZoom(oldScale: number, matrixData: number[], wrapper: HTMLDivElement | null) {\n const image = wrapper && wrapper.querySelector('.active img');\n if (!wrapper || !image) {\n return matrixData;\n }\n const wrapperRect = wrapper.getBoundingClientRect();\n const imageRect = image.getBoundingClientRect();\n\n const newImgWidth = (imageRect.width / oldScale) * matrixData[0];\n const newImgHeight = (imageRect.height / oldScale) * matrixData[3];\n const newImgX = (wrapperRect.width - newImgWidth) / 2 + matrixData[4];\n const newImgY = (wrapperRect.height - newImgHeight) / 2 + matrixData[5];\n if (wrapperRect.width && wrapperRect.width - ZOOM_SAFE_AREA < newImgX) {\n matrixData[4] -= newImgX + wrapperRect.width - ZOOM_SAFE_AREA;\n } else if (newImgWidth && newImgWidth + newImgX < ZOOM_SAFE_AREA) {\n matrixData[4] -= newImgWidth + newImgX - ZOOM_SAFE_AREA;\n }\n if (wrapperRect.height && wrapperRect.height - ZOOM_SAFE_AREA < newImgY) {\n matrixData[5] -= newImgY + wrapperRect.height - ZOOM_SAFE_AREA;\n } else if (newImgHeight && newImgHeight + newImgY < ZOOM_SAFE_AREA) {\n matrixData[5] -= newImgHeight + newImgY - ZOOM_SAFE_AREA;\n }\n\n return matrixData;\n}\n\nconst PanZoom: FC = ({\n children,\n className,\n noWrap,\n canPan,\n zoomLevel,\n panDeltaX,\n panDeltaY,\n onPan,\n}) => {\n const tunedZoomLevel = SCALE_VALUES[zoomLevel as keyof typeof SCALE_VALUES] || zoomLevel;\n const [isDragging, setIsDragging] = useState(false);\n const [dragData, setDragData] = useState({\n dx: panDeltaX, dy: panDeltaY, x: 0, y: 0,\n });\n // [zoom, skew, skew, zoom, dx, dy] - see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix()\n const [matrixData, setMatrixData] = useState(INITIAL_MATRIX);\n // Used to set cursor while moving.\n // eslint-disable-next-line no-null/no-null\n const panWrapperRef = useRef(null);\n // Used to set transform for pan.\n // eslint-disable-next-line no-null/no-null\n const panContainerRef = useRef(null);\n\n useEffect(() => {\n const newZoomLevel = tunedZoomLevel || matrixData[0];\n const newPandx = panDeltaX || matrixData[4];\n const newPandy = panDeltaY || matrixData[5];\n\n const newMatrixData = [...matrixData];\n if (matrixData[0] !== newZoomLevel) {\n newMatrixData[0] = newZoomLevel || newMatrixData[0];\n newMatrixData[3] = newZoomLevel || newMatrixData[3];\n }\n if (matrixData[4] !== newPandx) {\n newMatrixData[4] = newPandx;\n }\n if (matrixData[5] !== newPandy) {\n newMatrixData[5] = newPandy;\n }\n\n if (!areSortedArraysEqual(matrixData, newMatrixData)) {\n setMatrixData(calculateSafeZoneOnZoom(matrixData[0], newMatrixData, panWrapperRef.current));\n }\n // eslint-disable-next-line\n }, [panDeltaX, panDeltaY, tunedZoomLevel]);\n\n useEffect(() => {\n if (!canPan) {\n setMatrixData(INITIAL_MATRIX);\n }\n }, [canPan]);\n\n useEffect(() => {\n if (panContainerRef.current) {\n panContainerRef.current.style.transform = `matrix(${matrixData.toString()})`;\n }\n }, [noWrap, matrixData]);\n\n const handleMouseDown = (e: React.MouseEvent) => {\n if (!canPan) {\n return;\n }\n\n e.stopPropagation();\n e.preventDefault();\n\n const offsetX = matrixData[4];\n const offsetY = matrixData[5];\n const newDragData: IDragData = {\n dx: offsetX,\n dy: offsetY,\n x: e.pageX,\n y: e.pageY,\n };\n setDragData(newDragData);\n setIsDragging(true);\n\n if (panWrapperRef.current) {\n panWrapperRef.current.classList.add('move');\n }\n };\n\n const handleMouseUp = () => {\n setIsDragging(false);\n\n if (panWrapperRef.current) {\n panWrapperRef.current.classList.remove('move');\n }\n\n if (onPan) {\n onPan(matrixData[4], matrixData[5]);\n }\n };\n\n function getNewMatrixData(x: number, y: number): number[] {\n const newMatrixData = [...matrixData];\n const deltaX = dragData.x - x;\n const deltaY = dragData.y - y;\n newMatrixData[4] = dragData.dx - deltaX;\n newMatrixData[5] = dragData.dy - deltaY;\n\n return newMatrixData;\n }\n\n const handleMouseMove = (e: React.MouseEvent) => {\n if (isDragging) {\n const newMatrixData = getNewMatrixData(e.pageX, e.pageY);\n setMatrixData(newMatrixData);\n\n if (panContainerRef.current) {\n panContainerRef.current.style.transform = `matrix(${matrixData.toString()})`;\n }\n }\n };\n\n if (noWrap) {\n return children;\n }\n\n return (\n \n \n {children}\n \n \n );\n};\n\nexport default memo(PanZoom);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport {\n ApiChat, ApiMediaFormat, ApiMessage, ApiUser, ApiDimensions,\n} from '../../api/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport { ANIMATION_END_DELAY } from '../../config';\nimport { IS_IOS, IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../util/environment';\nimport windowSize from '../../util/windowSize';\nimport {\n AVATAR_FULL_DIMENSIONS,\n MEDIA_VIEWER_MEDIA_QUERY,\n calculateMediaViewerDimensions,\n} from '../common/helpers/mediaDimensions';\nimport {\n selectChat,\n selectChatMessage,\n selectChatMessages,\n selectCurrentMediaSearch,\n selectListedIds,\n selectOutlyingIds,\n selectScheduledMessage,\n selectScheduledMessages,\n selectUser,\n} from '../../modules/selectors';\nimport {\n getChatAvatarHash,\n getChatMediaMessageIds,\n getMessageFileName,\n getMessageMediaFormat,\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n getMessagePhoto,\n getMessageVideo,\n getMessageDocument,\n isMessageDocumentPhoto,\n isMessageDocumentVideo,\n getMessageWebPagePhoto,\n getMessageWebPageVideo,\n getPhotoFullDimensions,\n getVideoDimensions, getMessageFileSize,\n} from '../../modules/helpers';\nimport { pick } from '../../util/iteratees';\nimport { captureEvents, SwipeDirection } from '../../util/captureEvents';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport { stopCurrentAudio } from '../../util/audioPlayer';\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport useMedia from '../../hooks/useMedia';\nimport useMediaWithDownloadProgress from '../../hooks/useMediaWithDownloadProgress';\nimport useBlurSync from '../../hooks/useBlurSync';\nimport usePrevious from '../../hooks/usePrevious';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport { renderMessageText } from '../common/helpers/renderMessageText';\nimport { animateClosing, animateOpening } from './helpers/ghostAnimation';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Spinner from '../ui/Spinner';\nimport ShowTransition from '../ui/ShowTransition';\nimport Transition from '../ui/Transition';\nimport Button from '../ui/Button';\nimport SenderInfo from './SenderInfo';\nimport MediaViewerActions from './MediaViewerActions';\nimport MediaViewerFooter from './MediaViewerFooter';\nimport VideoPlayer from './VideoPlayer';\nimport ZoomControls from './ZoomControls';\nimport PanZoom from './PanZoom';\n\nimport './MediaViewer.scss';\n\ntype StateProps = {\n chatId?: number;\n threadId?: number;\n messageId?: number;\n senderId?: number;\n origin?: MediaViewerOrigin;\n avatarOwner?: ApiChat | ApiUser;\n profilePhotoIndex?: number;\n message?: ApiMessage;\n chatMessages?: Record;\n collectionIds?: number[];\n animationLevel: 0 | 1 | 2;\n};\n\ntype DispatchProps = Pick;\n\nconst ANIMATION_DURATION = 350;\n\nconst MediaViewer: FC = ({\n chatId,\n threadId,\n messageId,\n senderId,\n origin,\n avatarOwner,\n profilePhotoIndex,\n message,\n chatMessages,\n collectionIds,\n openMediaViewer,\n closeMediaViewer,\n openForwardMenu,\n focusMessage,\n animationLevel,\n}) => {\n const isOpen = Boolean(avatarOwner || messageId);\n\n const isFromSharedMedia = origin === MediaViewerOrigin.SharedMedia;\n const isFromSearch = origin === MediaViewerOrigin.SearchResult;\n\n /* Content */\n const photo = message ? getMessagePhoto(message) : undefined;\n const video = message ? getMessageVideo(message) : undefined;\n const webPagePhoto = message ? getMessageWebPagePhoto(message) : undefined;\n const webPageVideo = message ? getMessageWebPageVideo(message) : undefined;\n const isDocumentPhoto = message ? isMessageDocumentPhoto(message) : false;\n const isDocumentVideo = message ? isMessageDocumentVideo(message) : false;\n const isVideo = Boolean(video || webPageVideo || isDocumentVideo);\n const isPhoto = Boolean(!isVideo && (photo || webPagePhoto || isDocumentPhoto));\n const { isGif } = video || webPageVideo || {};\n const isAvatar = Boolean(avatarOwner);\n\n /* Navigation */\n const isSingleSlide = Boolean(webPagePhoto || webPageVideo);\n const messageIds = useMemo(() => {\n return isSingleSlide && messageId\n ? [messageId]\n : getChatMediaMessageIds(chatMessages || {}, collectionIds || [], isFromSharedMedia);\n }, [isSingleSlide, messageId, chatMessages, collectionIds, isFromSharedMedia]);\n\n const selectedMediaMessageIndex = messageId ? messageIds.indexOf(messageId) : -1;\n const isFirst = selectedMediaMessageIndex === 0 || selectedMediaMessageIndex === -1;\n const isLast = selectedMediaMessageIndex === messageIds.length - 1 || selectedMediaMessageIndex === -1;\n\n /* Animation */\n const animationKey = useRef();\n const prevSenderId = usePrevious(senderId);\n if (isOpen && (!prevSenderId || prevSenderId !== senderId || !animationKey.current)) {\n animationKey.current = selectedMediaMessageIndex;\n }\n const slideAnimation = animationLevel >= 1 ? 'mv-slide' : 'none';\n const headerAnimation = animationLevel === 2 ? 'slide-fade' : 'none';\n const isGhostAnimation = animationLevel === 2;\n\n /* Controls */\n const [isFooterHidden, setIsFooterHidden] = useState(false);\n const [canPanZoomWrap, setCanPanZoomWrap] = useState(false);\n const [isZoomed, setIsZoomed] = useState(false);\n const [zoomLevel, setZoomLevel] = useState(1);\n const [panDelta, setPanDelta] = useState({ x: 0, y: 0 });\n\n /* Media data */\n function getMediaHash(isFull?: boolean) {\n if (isAvatar && profilePhotoIndex !== undefined) {\n const { photos } = avatarOwner!;\n return photos && photos[profilePhotoIndex]\n ? `photo${photos[profilePhotoIndex].id}?size=c`\n : getChatAvatarHash(avatarOwner!, isFull ? 'big' : 'normal');\n }\n\n return message && getMessageMediaHash(message, isFull ? 'viewerFull' : 'viewerPreview');\n }\n\n const blobUrlPictogram = useMedia(\n message && (isFromSharedMedia || isFromSearch) && getMessageMediaHash(message, 'pictogram'),\n undefined,\n ApiMediaFormat.BlobUrl,\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n const previewMediaHash = getMediaHash();\n const blobUrlPreview = useMedia(\n previewMediaHash,\n undefined,\n isAvatar && previewMediaHash && previewMediaHash.startsWith('profilePhoto')\n ? ApiMediaFormat.DataUri\n : ApiMediaFormat.BlobUrl,\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n const { mediaData: fullMediaData, downloadProgress } = useMediaWithDownloadProgress(\n getMediaHash(true),\n undefined,\n message && getMessageMediaFormat(message, 'viewerFull'),\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n\n const localBlobUrl = (photo || video) ? (photo || video)!.blobUrl : undefined;\n let bestImageData = (!isVideo && (localBlobUrl || fullMediaData)) || blobUrlPreview || blobUrlPictogram;\n const thumbDataUri = useBlurSync(!bestImageData && message && getMessageMediaThumbDataUri(message));\n if (!bestImageData && origin !== MediaViewerOrigin.SearchResult) {\n bestImageData = thumbDataUri;\n }\n\n const videoSize = message ? getMessageFileSize(message) : undefined;\n const fileName = message\n ? getMessageFileName(message)\n : isAvatar\n ? `avatar${avatarOwner!.id}-${profilePhotoIndex}.jpg`\n : undefined;\n\n let dimensions!: ApiDimensions;\n if (message) {\n if (isDocumentPhoto || isDocumentVideo) {\n dimensions = getMessageDocument(message)!.mediaSize!;\n } else if (photo || webPagePhoto) {\n dimensions = getPhotoFullDimensions((photo || webPagePhoto)!)!;\n } else if (video || webPageVideo) {\n dimensions = getVideoDimensions((video || webPageVideo)!)!;\n }\n } else {\n dimensions = AVATAR_FULL_DIMENSIONS;\n }\n\n useEffect(() => {\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n return;\n }\n\n document.body.classList.toggle('is-media-viewer-open', isOpen);\n }, [isOpen]);\n\n const forceUpdate = useForceUpdate();\n useEffect(() => {\n const mql = window.matchMedia(MEDIA_VIEWER_MEDIA_QUERY);\n if (typeof mql.addEventListener === 'function') {\n mql.addEventListener('change', forceUpdate);\n } else if (typeof mql.addListener === 'function') {\n mql.addListener(forceUpdate);\n }\n\n return () => {\n if (typeof mql.removeEventListener === 'function') {\n mql.removeEventListener('change', forceUpdate);\n } else if (typeof mql.removeListener === 'function') {\n mql.removeListener(forceUpdate);\n }\n };\n }, [forceUpdate]);\n\n const prevMessage = usePrevious(message);\n const prevOrigin = usePrevious(origin);\n const prevAvatarOwner = usePrevious(avatarOwner);\n const prevBestImageData = usePrevious(bestImageData);\n useEffect(() => {\n if (isGhostAnimation && isOpen && !prevMessage && !prevAvatarOwner) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION + ANIMATION_END_DELAY);\n const textParts = message ? renderMessageText(message) : undefined;\n const hasFooter = Boolean(textParts);\n animateOpening(hasFooter, origin!, bestImageData!, dimensions, isVideo, message);\n }\n\n if (isGhostAnimation && !isOpen && (prevMessage || prevAvatarOwner)) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION + ANIMATION_END_DELAY);\n animateClosing(prevOrigin!, prevBestImageData!, prevMessage || undefined);\n }\n }, [\n isGhostAnimation, isOpen, origin, prevOrigin, message, prevMessage, prevAvatarOwner,\n bestImageData, prevBestImageData, dimensions, isVideo,\n ]);\n\n useEffect(() => {\n let timer: number | undefined;\n\n if (isZoomed) {\n setCanPanZoomWrap(true);\n } else {\n timer = window.setTimeout(() => {\n setCanPanZoomWrap(false);\n }, ANIMATION_DURATION);\n }\n\n return () => {\n if (timer) {\n window.clearTimeout(timer);\n }\n };\n }, [isZoomed]);\n\n const closeZoom = () => {\n setIsZoomed(false);\n setZoomLevel(1);\n setPanDelta({ x: 0, y: 0 });\n };\n\n const handleZoomToggle = useCallback(() => {\n setIsZoomed(!isZoomed);\n setZoomLevel(!isZoomed ? 1.5 : 1);\n if (isZoomed) {\n setPanDelta({ x: 0, y: 0 });\n }\n }, [isZoomed]);\n\n const handleZoomValue = useCallback((level: number, canCloseZoom = false) => {\n setZoomLevel(level);\n if (level === 1 && canCloseZoom) {\n closeZoom();\n }\n }, []);\n\n const close = useCallback(() => {\n closeMediaViewer();\n closeZoom();\n }, [closeMediaViewer]);\n\n const handleFooterClick = useCallback(() => {\n close();\n focusMessage({ chatId, threadId, messageId });\n }, [close, chatId, threadId, focusMessage, messageId]);\n\n const handleForward = useCallback(() => {\n openForwardMenu({ fromChatId: chatId, messageIds: [messageId] });\n closeZoom();\n }, [openForwardMenu, chatId, messageId]);\n\n useEffect(() => (isOpen ? captureEscKeyListener(() => {\n if (isZoomed) {\n closeZoom();\n } else {\n close();\n }\n }) : undefined), [close, isOpen, isZoomed]);\n\n useEffect(() => {\n if (isVideo && !isGif) {\n stopCurrentAudio();\n }\n }, [isGif, isVideo]);\n\n // Prevent refresh when rotating device to watch a video\n useEffect(() => {\n if (!isOpen) {\n return undefined;\n }\n\n windowSize.disableRefresh();\n\n return () => {\n windowSize.enableRefresh();\n };\n }, [isOpen]);\n\n const getMessageId = useCallback((fromId: number, direction: number): number => {\n let index = messageIds.indexOf(fromId);\n if ((direction === -1 && index > 0) || (direction === 1 && index < messageIds.length - 1)) {\n index += direction;\n }\n\n return messageIds[index];\n }, [messageIds]);\n\n const selectPreviousMedia = useCallback(() => {\n if (isFirst) {\n return;\n }\n\n openMediaViewer({\n chatId,\n threadId,\n messageId: messageId ? getMessageId(messageId, -1) : undefined,\n origin,\n });\n }, [chatId, threadId, getMessageId, isFirst, messageId, openMediaViewer, origin]);\n\n const selectNextMedia = useCallback(() => {\n if (isLast) {\n return;\n }\n\n openMediaViewer({\n chatId,\n threadId,\n messageId: messageId ? getMessageId(messageId, 1) : undefined,\n origin,\n });\n }, [chatId, threadId, getMessageId, isLast, messageId, openMediaViewer, origin]);\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n switch (e.key) {\n case 'Left': // IE/Edge specific value\n case 'ArrowLeft':\n selectPreviousMedia();\n break;\n\n case 'Right': // IE/Edge specific value\n case 'ArrowRight':\n selectNextMedia();\n break;\n }\n };\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n });\n\n // Support for swipe gestures and closing on click\n useEffect(() => {\n const element = document.querySelector('.slide-container > .active, .slide-container > .to');\n if (!element) {\n return undefined;\n }\n\n const shouldCloseOnVideo = isGif && !IS_IOS;\n\n return captureEvents(element, {\n // eslint-disable-next-line max-len\n excludedClosestSelector: `.backdrop, .navigation, .media-viewer-head, .media-viewer-footer${!shouldCloseOnVideo ? ', .VideoPlayer' : ''}`,\n onClick: () => {\n if (!isZoomed && !IS_TOUCH_ENV) {\n close();\n }\n },\n onSwipe: IS_TOUCH_ENV ? (e, direction) => {\n if (direction === SwipeDirection.Right) {\n selectPreviousMedia();\n } else if (direction === SwipeDirection.Left) {\n selectNextMedia();\n } else if (!(e.target && (e.target as HTMLElement).closest('.MediaViewerFooter'))) {\n close();\n }\n\n return true;\n } : undefined,\n });\n }, [close, isFooterHidden, isGif, isPhoto, isZoomed, selectNextMedia, selectPreviousMedia]);\n\n const handlePan = useCallback((x: number, y: number) => {\n setPanDelta({ x, y });\n }, []);\n\n const handleToggleFooterVisibility = useCallback(() => {\n if (IS_TOUCH_ENV && (isPhoto || isGif)) {\n setIsFooterHidden(!isFooterHidden);\n }\n }, [isFooterHidden, isGif, isPhoto]);\n\n const lang = useLang();\n\n useHistoryBack(isOpen, closeMediaViewer, openMediaViewer, {\n chatId,\n threadId,\n messageId,\n origin,\n avatarOwnerId: avatarOwner && avatarOwner.id,\n });\n\n function renderSlide(isActive: boolean) {\n if (isAvatar) {\n return (\n
\n {renderPhoto(\n fullMediaData || blobUrlPreview,\n calculateMediaViewerDimensions(AVATAR_FULL_DIMENSIONS, false),\n !IS_SINGLE_COLUMN_LAYOUT && !isZoomed,\n )}\n
\n );\n } else if (message) {\n const textParts = renderMessageText(message);\n const hasFooter = Boolean(textParts);\n\n return (\n \n {isPhoto && renderPhoto(\n localBlobUrl || fullMediaData || blobUrlPreview || blobUrlPictogram,\n message && calculateMediaViewerDimensions(dimensions!, hasFooter),\n !IS_SINGLE_COLUMN_LAYOUT && !isZoomed,\n )}\n {isVideo && (\n \n )}\n {textParts && (\n \n )}\n \n );\n }\n\n return undefined;\n }\n\n function renderSenderInfo() {\n return isAvatar ? (\n \n ) : (\n \n );\n }\n\n return (\n \n {() => (\n <>\n
\n {IS_SINGLE_COLUMN_LAYOUT && (\n \n \n \n )}\n \n {renderSenderInfo}\n \n \n
\n \n \n {renderSlide}\n \n \n {!isFirst && (\n \n )}\n {!isLast && (\n \n )}\n \n \n )}\n \n );\n};\n\nfunction renderPhoto(blobUrl?: string, imageSize?: ApiDimensions, canDrag?: boolean) {\n return blobUrl\n ? (\n \n )\n : (\n \n \n \n );\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chatId, threadId, messageId, avatarOwnerId, profilePhotoIndex, origin,\n } = global.mediaViewer;\n const {\n animationLevel,\n } = global.settings.byKey;\n\n if (origin === MediaViewerOrigin.SearchResult) {\n if (!(chatId && messageId)) {\n return { animationLevel };\n }\n\n const message = selectChatMessage(global, chatId, messageId);\n if (!message) {\n return { animationLevel };\n }\n\n return {\n chatId,\n messageId,\n senderId: message.senderId,\n origin,\n message,\n animationLevel,\n };\n }\n\n if (avatarOwnerId) {\n const sender = selectUser(global, avatarOwnerId) || selectChat(global, avatarOwnerId);\n\n return {\n messageId: -1,\n senderId: avatarOwnerId,\n avatarOwner: sender,\n profilePhotoIndex: profilePhotoIndex || 0,\n animationLevel,\n origin,\n };\n }\n\n if (!(chatId && threadId && messageId)) {\n return { animationLevel };\n }\n\n let message: ApiMessage | undefined;\n if (origin && [MediaViewerOrigin.ScheduledAlbum, MediaViewerOrigin.ScheduledInline].includes(origin)) {\n message = selectScheduledMessage(global, chatId, messageId);\n } else {\n message = selectChatMessage(global, chatId, messageId);\n }\n\n if (!message) {\n return { animationLevel };\n }\n\n let chatMessages: Record | undefined;\n\n if (origin && [MediaViewerOrigin.ScheduledAlbum, MediaViewerOrigin.ScheduledInline].includes(origin)) {\n chatMessages = selectScheduledMessages(global, chatId);\n } else {\n chatMessages = selectChatMessages(global, chatId);\n }\n let collectionIds: number[] | undefined;\n\n if (origin === MediaViewerOrigin.Inline || origin === MediaViewerOrigin.Album) {\n collectionIds = selectOutlyingIds(global, chatId, threadId) || selectListedIds(global, chatId, threadId);\n } else if (origin === MediaViewerOrigin.SharedMedia) {\n const currentSearch = selectCurrentMediaSearch(global);\n const { foundIds } = (currentSearch && currentSearch.resultsByType && currentSearch.resultsByType.media) || {};\n collectionIds = foundIds;\n }\n\n return {\n chatId,\n threadId,\n messageId,\n senderId: message.senderId,\n origin,\n message,\n chatMessages,\n collectionIds,\n animationLevel,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openMediaViewer', 'closeMediaViewer', 'openForwardMenu', 'focusMessage',\n ]),\n)(MediaViewer));\n","import React, {\n FC, useMemo, useState, memo, useRef, useEffect, useCallback,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat, MAIN_THREAD_ID } from '../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport {\n getCanPostInChat, getChatTitle, isChatPrivate, sortChatIds,\n} from '../../modules/helpers';\nimport searchWords from '../../util/searchWords';\nimport { pick, unique } from '../../util/iteratees';\nimport useInfiniteScroll from '../../hooks/useInfiniteScroll';\nimport useLang from '../../hooks/useLang';\nimport useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';\n\nimport Loading from '../ui/Loading';\nimport Modal from '../ui/Modal';\nimport InputText from '../ui/InputText';\nimport Button from '../ui/Button';\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport ListItem from '../ui/ListItem';\nimport PrivateChatInfo from '../common/PrivateChatInfo';\nimport GroupChatInfo from '../common/GroupChatInfo';\n\nimport './ForwardPicker.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n};\n\ntype StateProps = {\n chatsById: Record;\n pinnedIds?: number[];\n activeListIds?: number[];\n archivedListIds?: number[];\n orderedPinnedIds?: number[];\n currentUserId?: number;\n};\n\ntype DispatchProps = Pick;\n\n// Focus slows down animation, also it breaks transition layout in Chrome\nconst FOCUS_DELAY_MS = 500;\nconst MODAL_HIDE_DELAY_MS = 300;\n\nconst ForwardPicker: FC = ({\n chatsById,\n pinnedIds,\n activeListIds,\n archivedListIds,\n currentUserId,\n isOpen,\n setForwardChatId,\n exitForwardMode,\n loadMoreChats,\n}) => {\n const [filter, setFilter] = useState('');\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n\n const lang = useLang();\n\n useEffect(() => {\n if (isOpen) {\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n setTimeout(() => {\n requestAnimationFrame(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n });\n }, FOCUS_DELAY_MS);\n }\n } else {\n if (inputRef.current) {\n inputRef.current.blur();\n }\n\n setTimeout(() => {\n setFilter('');\n }, MODAL_HIDE_DELAY_MS);\n }\n }, [isOpen]);\n\n const chatIds = useMemo(() => {\n const listIds = [\n ...(activeListIds || []),\n ...(archivedListIds || []),\n ];\n\n let priorityIds = pinnedIds || [];\n if (currentUserId) {\n priorityIds = unique([currentUserId, ...priorityIds]);\n }\n\n return sortChatIds([\n ...listIds.filter((id) => {\n const chat = chatsById[id];\n if (!chat) {\n return true;\n }\n\n if (!getCanPostInChat(chat, MAIN_THREAD_ID)) {\n return false;\n }\n\n if (!filter) {\n return true;\n }\n\n return searchWords(getChatTitle(lang, chatsById[id], undefined, id === currentUserId), filter);\n }),\n ], chatsById, undefined, priorityIds);\n }, [activeListIds, archivedListIds, chatsById, currentUserId, filter, lang, pinnedIds]);\n\n const [viewportIds, getMore] = useInfiniteScroll(loadMoreChats, chatIds, Boolean(filter));\n\n const handleFilterChange = useCallback((e: React.ChangeEvent) => {\n setFilter(e.currentTarget.value);\n }, []);\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const handleKeyDown = useKeyboardListNavigation(containerRef, isOpen, (index) => {\n if (viewportIds && viewportIds.length > 0) {\n setForwardChatId({ id: viewportIds[index === -1 ? 0 : index] });\n }\n }, '.ListItem-button', true);\n\n const modalHeader = (\n
\n \n \n \n \n
\n );\n\n return (\n \n {viewportIds?.length ? (\n \n {viewportIds.map((id) => (\n setForwardChatId({ id })}\n >\n {isChatPrivate(id) ? (\n \n ) : (\n \n )}\n \n ))}\n \n ) : viewportIds && !viewportIds.length ? (\n

Sorry, nothing found.

\n ) : (\n \n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chats: {\n byId: chatsById,\n listIds,\n orderedPinnedIds,\n },\n currentUserId,\n } = global;\n\n return {\n chatsById,\n pinnedIds: orderedPinnedIds.active,\n activeListIds: listIds.active,\n archivedListIds: listIds.archived,\n currentUserId,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['setForwardChatId', 'exitForwardMode', 'loadMoreChats']),\n)(ForwardPicker));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiError, ApiInviteInfo } from '../../api/types';\n\nimport getReadableErrorText from '../../util/getReadableErrorText';\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\nimport renderText from '../common/helpers/renderText';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nimport './Dialogs.scss';\n\ntype StateProps = {\n dialogs: (ApiError | ApiInviteInfo)[];\n};\n\ntype DispatchProps = Pick;\n\nconst Dialogs: FC = ({ dialogs, dismissDialog, acceptInviteConfirmation }) => {\n const lang = useLang();\n\n if (!dialogs.length) {\n return undefined;\n }\n\n const renderInvite = (invite: ApiInviteInfo) => {\n const {\n hash, title, participantsCount, isChannel,\n } = invite;\n\n const handleJoinClick = () => {\n acceptInviteConfirmation({\n hash,\n });\n dismissDialog();\n };\n\n const participantsText = isChannel\n ? lang('Subscribers', participantsCount, 'i')\n : lang('Members', participantsCount, 'i');\n\n const joinText = isChannel ? lang('ChannelJoin') : lang('JoinGroup');\n\n return (\n \n {participantsCount !== undefined &&

{participantsText}

}\n \n \n \n );\n };\n\n const renderError = (error: ApiError) => {\n return (\n \n {error.hasErrorKey ? getReadableErrorText(error) : renderText(error.message!, ['emoji', 'br'])}\n
\n \n
\n \n );\n };\n\n const renderDialog = (dialog: ApiError | ApiInviteInfo) => {\n if ('hash' in dialog) {\n return renderInvite(dialog);\n }\n\n return renderError(dialog);\n };\n\n return (\n
\n {dialogs.map(renderDialog)}\n
\n );\n};\n\nfunction getErrorHeader(error: ApiError) {\n if (error.isSlowMode) {\n return 'Slowmode enabled';\n }\n\n if (!error.hasErrorKey) {\n return 'Telegram';\n }\n\n return 'Something went wrong';\n}\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['dialogs']),\n (setGlobal, actions): DispatchProps => pick(actions, ['dismissDialog', 'acceptInviteConfirmation']),\n)(Dialogs));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiNotification } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport renderText from '../common/helpers/renderText';\n\nimport Notification from '../ui/Notification';\n\ntype StateProps = {\n notifications: ApiNotification[];\n};\n\ntype DispatchProps = Pick;\n\nconst Notifications: FC = ({ notifications, dismissNotification }) => {\n if (!notifications.length) {\n return undefined;\n }\n\n return (\n
\n {notifications.map(({ message, localId }) => (\n dismissNotification({ localId })}\n />\n ))}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['notifications']),\n (setGlobal, actions): DispatchProps => pick(actions, ['dismissNotification']),\n)(Notifications));\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\n\nimport ConfirmDialog from '../ui/ConfirmDialog';\n\nexport type OwnProps = {\n url?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst SafeLinkModal: FC = ({ url, toggleSafeLinkModal }) => {\n const lang = useLang();\n\n const handleOpen = useCallback(() => {\n window.open(url);\n toggleSafeLinkModal({ url: undefined });\n }, [toggleSafeLinkModal, url]);\n\n const handleDismiss = useCallback(() => {\n toggleSafeLinkModal({ url: undefined });\n }, [toggleSafeLinkModal]);\n\n const renderingUrl = useCurrentOrPrev(url);\n\n return (\n \n );\n};\n\nexport default memo(withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['toggleSafeLinkModal']),\n)(SafeLinkModal));\n","import React, {\n FC, memo, useState, useEffect, useMemo, useCallback,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport { formatTime, formatDateToString } from '../../util/dateFormat';\nimport useLang, { LangFn } from '../../hooks/useLang';\nimport usePrevious from '../../hooks/usePrevious';\nimport useFlag from '../../hooks/useFlag';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nimport './CalendarModal.scss';\n\nexport type OwnProps = {\n selectedAt?: number;\n maxAt?: number;\n isFutureMode?: boolean;\n isPastMode?: boolean;\n isOpen: boolean;\n withTimePicker?: boolean;\n submitButtonLabel?: string;\n secondButtonLabel?: string;\n onClose: () => void;\n onSubmit: (date: Date) => void;\n onSecondButtonClick?: NoneToVoidFunction;\n};\n\nconst WEEKDAY_LETTERS = [\n 'lng_weekday1',\n 'lng_weekday2',\n 'lng_weekday3',\n 'lng_weekday4',\n 'lng_weekday5',\n 'lng_weekday6',\n 'lng_weekday7',\n];\n\nconst CalendarModal: FC = ({\n selectedAt,\n maxAt,\n isFutureMode,\n isPastMode,\n isOpen,\n withTimePicker,\n submitButtonLabel,\n secondButtonLabel,\n onClose,\n onSubmit,\n onSecondButtonClick,\n}) => {\n const lang = useLang();\n const now = new Date();\n const defaultSelectedDate = useMemo(() => (selectedAt ? new Date(selectedAt) : new Date()), [selectedAt]);\n const maxDate = maxAt ? new Date(maxAt) : undefined;\n const prevIsOpen = usePrevious(isOpen);\n const [isTimeInputFocused, markTimeInputAsFocused, unmarkTimeInputAsFocused] = useFlag(false);\n\n const [selectedDate, setSelectedDate] = useState(defaultSelectedDate);\n const [selectedHours, setSelectedHours] = useState(\n formatInputTime(defaultSelectedDate.getHours()),\n );\n const [selectedMinutes, setSelectedMinutes] = useState(\n formatInputTime(defaultSelectedDate.getMinutes()),\n );\n\n const currentYear = selectedDate.getFullYear();\n const currentMonth = selectedDate.getMonth();\n const currentDate = selectedDate.getDate();\n\n useEffect(() => {\n if (!prevIsOpen && isOpen) {\n setSelectedDate(defaultSelectedDate);\n }\n }, [isOpen, defaultSelectedDate, prevIsOpen]);\n\n useEffect(() => {\n if (isFutureMode && !isTimeInputFocused && selectedDate.getTime() < defaultSelectedDate.getTime()) {\n setSelectedDate(defaultSelectedDate);\n setSelectedHours(formatInputTime(defaultSelectedDate.getHours()));\n setSelectedMinutes(formatInputTime(defaultSelectedDate.getMinutes()));\n }\n }, [defaultSelectedDate, isTimeInputFocused, isFutureMode, selectedDate]);\n\n const shouldDisableNextMonth = (isPastMode && currentYear >= now.getFullYear() && currentMonth >= now.getMonth())\n || (maxDate && currentYear >= maxDate.getFullYear() && currentMonth >= maxDate.getMonth());\n const shouldDisablePrevMonth = isFutureMode && currentYear <= now.getFullYear() && currentMonth <= now.getMonth();\n\n const calendarGrid = useMemo(() => (\n buildCalendarGrid(currentYear, currentMonth)\n ), [currentMonth, currentYear]);\n\n function handlePrevMonth() {\n setSelectedDate((d) => {\n const dateCopy = new Date(d);\n dateCopy.setMonth(dateCopy.getMonth() - 1);\n\n return dateCopy;\n });\n }\n\n function handleNextMonth() {\n setSelectedDate((d) => {\n const dateCopy = new Date(d);\n dateCopy.setMonth(dateCopy.getMonth() + 1);\n\n return dateCopy;\n });\n }\n\n function handleDateSelect(date: number) {\n setSelectedDate((d) => {\n const dateCopy = new Date(d);\n dateCopy.setDate(date);\n\n return dateCopy;\n });\n }\n\n function handleSubmit() {\n onSubmit(selectedDate);\n }\n\n const handleChangeHours = useCallback((e: React.ChangeEvent) => {\n const value = e.target.value.replace(/[^\\d]+/g, '');\n if (!value.length) {\n setSelectedHours('');\n e.target.value = '';\n return;\n }\n\n const hours = Math.max(0, Math.min(Number(value), 23));\n\n const date = new Date(selectedDate.getTime());\n date.setHours(hours);\n setSelectedDate(date);\n\n const hoursStr = formatInputTime(hours);\n setSelectedHours(hoursStr);\n e.target.value = hoursStr;\n }, [selectedDate]);\n\n const handleChangeMinutes = useCallback((e: React.ChangeEvent) => {\n const value = e.target.value.replace(/[^\\d]+/g, '');\n if (!value.length) {\n setSelectedMinutes('');\n e.target.value = '';\n return;\n }\n\n const minutes = Math.max(0, Math.min(Number(value), 59));\n\n const date = new Date(selectedDate.getTime());\n date.setMinutes(minutes);\n setSelectedDate(date);\n\n const minutesStr = formatInputTime(minutes);\n setSelectedMinutes(minutesStr);\n e.target.value = minutesStr;\n }, [selectedDate]);\n\n function renderTimePicker() {\n return (\n
\n \n :\n \n
\n );\n }\n\n return (\n \n
\n
\n \n \n \n\n

\n {lang(`lng_month${selectedDate.getMonth() + 1}`)}\n {' '}\n {selectedDate.getFullYear()}\n

\n\n \n \n \n\n \n \n \n
\n
\n\n
\n
\n {WEEKDAY_LETTERS.map((day) => (\n
\n {lang(day)}\n
\n ))}\n {calendarGrid.map((gridDate) => (\n handleDateSelect(gridDate)}\n className={buildClassName(\n 'day-button',\n isDisabledDay(\n currentYear, currentMonth, gridDate, isFutureMode ? now : undefined, isPastMode ? now : maxDate,\n )\n ? 'disabled'\n : `${gridDate ? 'clickable' : ''}`,\n gridDate === currentDate && 'selected',\n )}\n >\n {!!gridDate && (\n {gridDate}\n )}\n
\n ))}\n
\n \n\n {withTimePicker && renderTimePicker()}\n\n
\n \n {secondButtonLabel && (\n \n )}\n
\n \n );\n};\n\nfunction buildCalendarGrid(year: number, month: number) {\n const grid: number[] = [];\n\n const date = new Date();\n date.setFullYear(year);\n date.setMonth(month);\n date.setDate(1);\n\n const monthStartDay = date.getDay() || 7;\n // Fill empty cells\n for (let i = 1; i < monthStartDay; i++) {\n grid.push(0);\n }\n\n while (date.getMonth() === month) {\n const gridDate = date.getDate();\n grid.push(gridDate);\n date.setDate(gridDate + 1);\n }\n\n return grid;\n}\n\nfunction isDisabledDay(year: number, month: number, day: number, minDate?: Date, maxDate?: Date) {\n const selectedDay = new Date(year, month, day, 0, 0, 0, 0);\n const fixedMinDate = minDate && new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate(), 0, 0, 0, 0);\n const fixedMaxDate = maxDate && new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate(), 0, 0, 0, 0);\n\n if (fixedMaxDate && selectedDay > fixedMaxDate) {\n return true;\n } else if (fixedMinDate && selectedDay < fixedMinDate) {\n return true;\n }\n\n return false;\n}\n\nfunction formatInputTime(value: string | number) {\n return String(value).padStart(2, '0');\n}\n\nfunction formatSubmitLabel(lang: LangFn, date: Date) {\n const day = formatDateToString(date, lang.code);\n const today = formatDateToString(new Date(), lang.code);\n\n if (day === today) {\n return lang('Conversation.ScheduleMessage.SendToday', formatTime(date));\n }\n\n return lang('Conversation.ScheduleMessage.SendOn', [day, formatTime(date)]);\n}\n\nexport default memo(CalendarModal);\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport CalendarModal from '../common/CalendarModal';\n\nexport type OwnProps = {\n isOpen: boolean;\n};\n\ntype StateProps = {\n selectedAt?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst HistoryCalendar: FC = ({\n isOpen, selectedAt, searchMessagesByDate, closeHistoryCalendar,\n}) => {\n const handleJumpToDate = useCallback((date: Date) => {\n searchMessagesByDate({ timestamp: date.valueOf() / 1000 });\n closeHistoryCalendar();\n }, [closeHistoryCalendar, searchMessagesByDate]);\n\n const lang = useLang();\n\n return (\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n selectedAt: global.historyCalendarSelectedAt,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesByDate', 'closeHistoryCalendar',\n ]),\n)(HistoryCalendar));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../api/types';\nimport { IAlbum } from '../../types';\n\nimport { GlobalActions } from '../../global/types';\n\nimport {\n selectAllowedMessageActions,\n selectChat,\n selectCurrentMessageList,\n selectUser,\n} from '../../modules/selectors';\nimport {\n isChatPrivate,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n isSchedule: boolean;\n message: ApiMessage;\n album?: IAlbum;\n onClose: () => void;\n};\n\ntype StateProps = {\n canDeleteForAll?: boolean;\n contactName?: string;\n willDeleteForCurrentUserOnly?: boolean;\n willDeleteForAll?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst DeleteMessageModal: FC = ({\n isOpen,\n isSchedule,\n message,\n album,\n canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n onClose,\n deleteMessages,\n deleteScheduledMessages,\n}) => {\n const handleDeleteMessageForAll = useCallback(() => {\n const messageIds = album?.messages\n ? album.messages.map(({ id }) => id)\n : [message.id];\n deleteMessages({ messageIds, shouldDeleteForAll: true });\n onClose();\n }, [deleteMessages, message.id, onClose, album]);\n\n const handleDeleteMessageForSelf = useCallback(() => {\n const messageIds = album?.messages\n ? album.messages.map(({ id }) => id)\n : [message.id];\n if (isSchedule) {\n deleteScheduledMessages({ messageIds });\n } else {\n deleteMessages({\n messageIds,\n shouldDeleteForAll: false,\n });\n }\n onClose();\n }, [album, message.id, isSchedule, onClose, deleteScheduledMessages, deleteMessages]);\n\n const lang = useLang();\n\n return (\n \n

{lang('AreYouSureDeleteSingleMessage')}

\n {willDeleteForCurrentUserOnly && (\n

{lang('lng_delete_for_me_chat_hint', 1, 'i')}

\n )}\n {willDeleteForAll && (\n

{lang('lng_delete_for_everyone_hint', 1, 'i')}

\n )}\n {canDeleteForAll && (\n \n )}\n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { message, isSchedule }): StateProps => {\n const { threadId } = selectCurrentMessageList(global) || {};\n const { canDeleteForAll } = (threadId && selectAllowedMessageActions(global, message, threadId)) || {};\n const chat = selectChat(global, message.chatId);\n const contactName = chat && isChatPrivate(chat.id)\n ? getUserFirstOrLastName(selectUser(global, getPrivateChatUserId(chat)!))\n : undefined;\n\n const willDeleteForCurrentUserOnly = chat && isChatBasicGroup(chat) && !canDeleteForAll;\n const willDeleteForAll = chat && isChatSuperGroup(chat);\n\n return {\n canDeleteForAll: !isSchedule && canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'deleteMessages', 'deleteScheduledMessages',\n ]),\n)(DeleteMessageModal));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { selectChat, selectIsChatWithSelf, selectUser } from '../../modules/selectors';\nimport {\n isChatPrivate,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n isChatChannel,\n} from '../../modules/helpers';\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\nimport renderText from './helpers/renderText';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n chatId: number;\n messageId: number;\n onClose: () => void;\n};\n\ntype StateProps = {\n isChannel: boolean;\n isPrivateChat: boolean;\n isChatWithSelf: boolean;\n isGroup: boolean;\n isSuperGroup: boolean;\n canPinForAll: boolean;\n contactName?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst PinMessageModal: FC = ({\n isOpen,\n messageId,\n chatId,\n isChannel,\n isGroup,\n isSuperGroup,\n canPinForAll,\n contactName,\n onClose,\n pinMessage,\n}) => {\n const handlePinMessageForAll = useCallback(() => {\n pinMessage({\n chatId, messageId, isUnpin: false,\n });\n onClose();\n }, [pinMessage, chatId, messageId, onClose]);\n\n const handlePinMessage = useCallback(() => {\n pinMessage({\n chatId, messageId, isUnpin: false, isOneSide: true, isSilent: true,\n });\n onClose();\n }, [chatId, messageId, onClose, pinMessage]);\n\n const lang = useLang();\n\n function renderMessage() {\n if (isChannel) {\n return lang('PinMessageAlertChannel');\n }\n\n if (isGroup || isSuperGroup) {\n return lang('PinMessageAlert');\n }\n\n return lang('PinMessageAlertChat');\n }\n\n return (\n \n

{renderMessage()}

\n \n {canPinForAll && (\n \n )}\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const isPrivateChat = isChatPrivate(chatId);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const chat = selectChat(global, chatId);\n const isChannel = !!chat && isChatChannel(chat);\n const isGroup = !!chat && isChatBasicGroup(chat);\n const isSuperGroup = !!chat && isChatSuperGroup(chat);\n const canPinForAll = (isPrivateChat && !isChatWithSelf) || isSuperGroup || isGroup;\n const contactName = chat && isChatPrivate(chat.id)\n ? getUserFirstOrLastName(selectUser(global, getPrivateChatUserId(chat)!))\n : undefined;\n\n return {\n isPrivateChat,\n isChatWithSelf,\n isChannel,\n isGroup,\n isSuperGroup,\n canPinForAll,\n contactName,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['pinMessage']),\n)(PinMessageModal));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n chatId?: number;\n pinnedMessagesCount?: number;\n onClose: () => void;\n onUnpin: () => void;\n};\n\nconst UnpinAllMessagesModal: FC = ({\n isOpen,\n pinnedMessagesCount = 0,\n onClose,\n onUnpin,\n}) => {\n const lang = useLang();\n\n return (\n \n

{lang('Chat.UnpinAllMessagesConfirmation', pinnedMessagesCount, 'i')}

\n \n \n \n );\n};\n\nexport default memo(UnpinAllMessagesModal);\n","import React, {\n FC, useCallback, memo, useEffect,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { selectCanDeleteSelectedMessages, selectCurrentChat, selectUser } from '../../modules/selectors';\nimport {\n isChatPrivate,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n} from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\nimport usePrevious from '../../hooks/usePrevious';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n isSchedule: boolean;\n onClose: () => void;\n};\n\ntype StateProps = {\n selectedMessageIds?: number[];\n canDeleteForAll?: boolean;\n contactName?: string;\n willDeleteForCurrentUserOnly?: boolean;\n willDeleteForAll?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst DeleteSelectedMessageModal: FC = ({\n isOpen,\n isSchedule,\n selectedMessageIds,\n canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n onClose,\n deleteMessages,\n deleteScheduledMessages,\n exitMessageSelectMode,\n}) => {\n const prevIsOpen = usePrevious(isOpen);\n\n const handleDeleteMessageForAll = useCallback(() => {\n onClose();\n deleteMessages({ messageIds: selectedMessageIds, shouldDeleteForAll: true });\n }, [deleteMessages, selectedMessageIds, onClose]);\n\n const handleDeleteMessageForSelf = useCallback(() => {\n if (isSchedule) {\n deleteScheduledMessages({ messageIds: selectedMessageIds });\n } else {\n deleteMessages({ messageIds: selectedMessageIds, shouldDeleteForAll: false });\n }\n\n onClose();\n }, [isSchedule, onClose, deleteScheduledMessages, selectedMessageIds, deleteMessages]);\n\n const lang = useLang();\n\n // Returning `undefined` from FC instead of `` doesn't trigger useHistoryBack\n useEffect(() => {\n if (!isOpen && prevIsOpen) {\n exitMessageSelectMode();\n }\n }, [exitMessageSelectMode, isOpen, prevIsOpen]);\n\n if (!selectedMessageIds) {\n return undefined;\n }\n\n return (\n \n

{lang('AreYouSureDeleteFewMessages')}

\n {willDeleteForCurrentUserOnly && (\n

This will delete them just for you, not for other participants in the chat.

\n )}\n {willDeleteForAll && (\n

This will delete them for everyone in this chat.

\n )}\n {canDeleteForAll && (\n \n )}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { isSchedule }): StateProps => {\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n const { canDeleteForAll } = selectCanDeleteSelectedMessages(global);\n const chat = selectCurrentChat(global);\n const contactName = chat && isChatPrivate(chat.id)\n ? getUserFirstOrLastName(selectUser(global, getPrivateChatUserId(chat)!))\n : undefined;\n\n const willDeleteForCurrentUserOnly = chat && isChatBasicGroup(chat) && !canDeleteForAll;\n const willDeleteForAll = chat && isChatSuperGroup(chat);\n\n return {\n selectedMessageIds,\n canDeleteForAll: !isSchedule && canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'deleteMessages',\n 'deleteScheduledMessages',\n 'exitMessageSelectMode',\n ]),\n)(DeleteSelectedMessageModal));\n","import { ChangeEvent } from 'react';\n\nimport React, {\n FC, memo, useCallback, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiReportReason } from '../../api/types';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\nimport RadioGroup from '../ui/RadioGroup';\nimport InputText from '../ui/InputText';\n\nexport type OwnProps = {\n isOpen: boolean;\n messageIds?: number[];\n onClose: () => void;\n};\n\ntype DispatchProps = Pick;\n\nconst ReportMessageModal: FC = ({\n isOpen,\n messageIds,\n reportMessages,\n exitMessageSelectMode,\n onClose,\n}) => {\n const [selectedReason, setSelectedReason] = useState('spam');\n const [description, setDescription] = useState('');\n\n const handleReport = () => {\n reportMessages({ messageIds, reason: selectedReason, description });\n exitMessageSelectMode();\n onClose();\n };\n\n const handleSelectReason = useCallback((value: string) => {\n setSelectedReason(value as ApiReportReason);\n }, []);\n\n const handleDescriptionChange = useCallback((e: ChangeEvent) => {\n setDescription(e.target.value);\n }, []);\n\n const lang = useLang();\n\n const REPORT_OPTIONS: { value: ApiReportReason; label: string }[] = [\n { value: 'spam', label: lang('lng_report_reason_spam') },\n { value: 'violence', label: lang('lng_report_reason_violence') },\n { value: 'pornography', label: lang('lng_report_reason_pornography') },\n { value: 'childAbuse', label: lang('lng_report_reason_child_abuse') },\n { value: 'copyright', label: lang('ReportPeer.ReasonCopyright') },\n { value: 'other', label: lang('lng_report_reason_other') },\n ];\n\n if (!messageIds) {\n return undefined;\n }\n\n return (\n \n \n \n \n \n \n );\n};\n\nexport default memo(withGlobal(\n undefined, (setGlobal, actions): DispatchProps => pick(actions, [\n 'reportMessages', 'exitMessageSelectMode',\n ]),\n)(ReportMessageModal));\n","import React, { FC, memo, useEffect } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, MessageListType } from '../../global/types';\n\nimport {\n selectCanDeleteSelectedMessages,\n selectCanReportSelectedMessages,\n selectCurrentMessageList,\n selectSelectedMessagesCount,\n} from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\nimport useFlag from '../../hooks/useFlag';\nimport captureKeyboardListeners from '../../util/captureKeyboardListeners';\nimport buildClassName from '../../util/buildClassName';\nimport usePrevious from '../../hooks/usePrevious';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport MenuItem from '../ui/MenuItem';\n\nimport DeleteSelectedMessageModal from './DeleteSelectedMessageModal';\nimport ReportMessageModal from '../common/ReportMessageModal';\n\nimport './MessageSelectToolbar.scss';\n\nexport type OwnProps = {\n isActive?: boolean;\n canPost?: boolean;\n messageListType?: MessageListType;\n};\n\ntype StateProps = {\n isSchedule: boolean;\n selectedMessagesCount?: number;\n canDeleteMessages?: boolean;\n canReportMessages?: boolean;\n selectedMessageIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst MessageSelectToolbar: FC = ({\n canPost,\n isActive,\n messageListType,\n isSchedule,\n selectedMessagesCount,\n canDeleteMessages,\n canReportMessages,\n selectedMessageIds,\n exitMessageSelectMode,\n openForwardMenuForSelectedMessages,\n}) => {\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n const [isReportModalOpen, openReportModal, closeReportModal] = useFlag();\n\n useEffect(() => {\n return isActive && !isDeleteModalOpen && !isReportModalOpen\n ? captureKeyboardListeners({\n onBackspace: openDeleteModal,\n onDelete: openDeleteModal,\n onEsc: exitMessageSelectMode,\n })\n : undefined;\n }, [isActive, isDeleteModalOpen, isReportModalOpen, openDeleteModal, exitMessageSelectMode]);\n\n const prevSelectedMessagesCount = usePrevious(selectedMessagesCount || undefined, true);\n const renderingSelectedMessagesCount = isActive ? selectedMessagesCount : prevSelectedMessagesCount;\n\n const lang = useLang();\n\n const formattedMessagesCount = lang('VoiceOver.Chat.MessagesSelected', renderingSelectedMessagesCount);\n\n const className = buildClassName(\n 'MessageSelectToolbar',\n canPost && 'with-composer',\n isActive && 'shown',\n );\n\n return (\n
\n
\n \n \n \n \n {formattedMessagesCount}\n \n\n {!!selectedMessagesCount && (\n
\n {messageListType !== 'scheduled' && (\n \n \n {lang('Forward')}\n \n \n )}\n {canReportMessages && (\n \n \n {lang('Report')}\n \n \n )}\n \n \n {lang('Delete')}\n \n \n
\n )}\n
\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { type: messageListType } = selectCurrentMessageList(global) || {};\n const { canDelete } = selectCanDeleteSelectedMessages(global);\n const canReport = selectCanReportSelectedMessages(global);\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n\n return {\n isSchedule: messageListType === 'scheduled',\n selectedMessagesCount: selectSelectedMessagesCount(global),\n canDeleteMessages: canDelete,\n canReportMessages: canReport,\n selectedMessageIds,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['exitMessageSelectMode', 'openForwardMenuForSelectedMessages']),\n)(MessageSelectToolbar));\n","import { useCallback, useEffect, useRef } from '../lib/teact/teact';\n\nexport default (\n onSelect: NoneToVoidFunction,\n) => {\n // eslint-disable-next-line no-null/no-null\n const buttonRef = useRef(null);\n\n const handleKeyDown = useCallback((e: KeyboardEvent) => {\n if (e.key !== 'Enter') return;\n const isFocused = buttonRef.current === document.activeElement;\n\n if (isFocused) {\n onSelect();\n }\n }, [onSelect]);\n\n useEffect(() => {\n window.addEventListener('keydown', handleKeyDown, false);\n\n return () => window.removeEventListener('keydown', handleKeyDown);\n }, [handleKeyDown]);\n\n return buttonRef;\n};\n","import React, {\n FC, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport useChatContextActions from '../../../hooks/useChatContextActions';\nimport useFlag from '../../../hooks/useFlag';\nimport { isChatPrivate, getPrivateChatUserId, selectIsChatMuted } from '../../../modules/helpers';\nimport {\n selectChat, selectUser, selectIsChatPinned, selectNotifySettings, selectNotifyExceptions,\n} from '../../../modules/selectors';\nimport useSelectWithEnter from '../../../hooks/useSelectWithEnter';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport GroupChatInfo from '../../common/GroupChatInfo';\nimport DeleteChatModal from '../../common/DeleteChatModal';\nimport ListItem from '../../ui/ListItem';\n\ntype OwnProps = {\n chatId: number;\n withUsername?: boolean;\n onClick: (id: number) => void;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n privateChatUser?: ApiUser;\n isPinned?: boolean;\n isMuted?: boolean;\n};\n\nconst LeftSearchResultChat: FC = ({\n chatId,\n chat,\n privateChatUser,\n isPinned,\n isMuted,\n withUsername,\n onClick,\n}) => {\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n\n const contextActions = useChatContextActions({\n chat,\n privateChatUser,\n isPinned,\n isMuted,\n handleDelete: openDeleteModal,\n }, true);\n\n const handleClick = () => {\n onClick(chatId);\n };\n\n const buttonRef = useSelectWithEnter(handleClick);\n\n if (!chat) {\n return undefined;\n }\n\n return (\n \n {isChatPrivate(chatId) ? (\n \n ) : (\n \n )}\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const privateChatUserId = chat && getPrivateChatUserId(chat);\n const privateChatUser = privateChatUserId ? selectUser(global, privateChatUserId) : undefined;\n const isPinned = selectIsChatPinned(global, chatId);\n const isMuted = chat\n ? selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global))\n : undefined;\n\n return {\n chat,\n privateChatUser,\n isPinned,\n isMuted,\n };\n },\n)(LeftSearchResultChat));\n","import React, {\n FC, useEffect, useCallback, useRef, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiUser } from '../../../api/types';\n\nimport { getUserFirstOrLastName } from '../../../modules/helpers';\nimport renderText from '../../common/helpers/renderText';\nimport { throttle } from '../../../util/schedulers';\nimport { pick } from '../../../util/iteratees';\nimport useHorizontalScroll from '../../../hooks/useHorizontalScroll';\nimport useLang from '../../../hooks/useLang';\n\nimport Avatar from '../../common/Avatar';\nimport Button from '../../ui/Button';\nimport LeftSearchResultChat from './LeftSearchResultChat';\n\nimport './RecentContacts.scss';\n\ntype OwnProps = {\n onReset: () => void;\n};\n\ntype StateProps = {\n topUserIds?: number[];\n usersById: Record;\n recentlyFoundChatIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst SEARCH_CLOSE_TIMEOUT_MS = 250;\nconst NBSP = '\\u00A0';\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst RecentContacts: FC = ({\n topUserIds, usersById, recentlyFoundChatIds,\n onReset, loadTopUsers, loadContactList, openChat,\n addRecentlyFoundChatId, clearRecentlyFoundChats,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const topUsersRef = useRef(null);\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadTopUsers();\n // Loading full contact list for quick local search before user enters the query\n loadContactList();\n });\n }, [loadTopUsers, loadContactList]);\n\n useHorizontalScroll(topUsersRef.current, !topUserIds);\n\n const handleClick = useCallback(\n (id: number) => {\n openChat({ id, shouldReplaceHistory: true });\n onReset();\n setTimeout(() => {\n addRecentlyFoundChatId({ id });\n }, SEARCH_CLOSE_TIMEOUT_MS);\n },\n [openChat, addRecentlyFoundChatId, onReset],\n );\n\n const lang = useLang();\n\n return (\n
\n {topUserIds && (\n
\n
\n {topUserIds.map((userId) => (\n
handleClick(userId)} dir={lang.isRtl ? 'rtl' : undefined}>\n \n
{renderText(getUserFirstOrLastName(usersById[userId]) || NBSP)}
\n
\n ))}\n
\n
\n )}\n {recentlyFoundChatIds && (\n
\n

\n {lang('Recent')}\n\n \n \n \n

\n {recentlyFoundChatIds.map((id) => (\n \n ))}\n
\n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { userIds: topUserIds } = global.topPeers;\n const usersById = global.users.byId;\n const { recentlyFoundChatIds } = global.globalSearch;\n\n return {\n topUserIds,\n usersById,\n recentlyFoundChatIds,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadTopUsers',\n 'loadContactList',\n 'openChat',\n 'addRecentlyFoundChatId',\n 'clearRecentlyFoundChats',\n ]),\n)(RecentContacts));\n","import React, {\n FC, memo, useCallback,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport {\n ApiChat, ApiUser, ApiMessage, ApiMessageOutgoingStatus,\n} from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport {\n getChatTitle,\n getPrivateChatUserId,\n getMessageMediaHash,\n getMessageSummaryText,\n getMessageMediaThumbDataUri,\n getMessageVideo,\n getMessageRoundVideo,\n} from '../../../modules/helpers';\nimport { selectChat, selectUser } from '../../../modules/selectors';\nimport renderText from '../../common/helpers/renderText';\nimport { pick } from '../../../util/iteratees';\nimport useMedia from '../../../hooks/useMedia';\nimport { formatPastTimeShort } from '../../../util/dateFormat';\nimport useLang, { LangFn } from '../../../hooks/useLang';\nimport useSelectWithEnter from '../../../hooks/useSelectWithEnter';\n\nimport Avatar from '../../common/Avatar';\nimport VerifiedIcon from '../../common/VerifiedIcon';\nimport ListItem from '../../ui/ListItem';\nimport Link from '../../ui/Link';\n\nimport './ChatMessage.scss';\n\ntype OwnProps = {\n searchQuery?: string;\n message: ApiMessage;\n chatId: number;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n privateChatUser?: ApiUser;\n lastMessageOutgoingStatus?: ApiMessageOutgoingStatus;\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst ChatMessage: FC = ({\n message,\n searchQuery,\n chatId,\n chat,\n privateChatUser,\n focusMessage,\n lastSyncTime,\n}) => {\n const mediaThumbnail = getMessageMediaThumbDataUri(message);\n const mediaBlobUrl = useMedia(getMessageMediaHash(message, 'micro'));\n const isRoundVideo = Boolean(getMessageRoundVideo(message));\n\n const handleClick = useCallback(() => {\n focusMessage({ chatId, messageId: message.id });\n }, [chatId, focusMessage, message.id]);\n\n const lang = useLang();\n\n const buttonRef = useSelectWithEnter(handleClick);\n\n if (!chat) {\n return undefined;\n }\n\n return (\n \n \n
\n
\n
\n

{renderText(getChatTitle(lang, chat, privateChatUser))}

\n {chat.isVerified && }\n
\n
\n \n {formatPastTimeShort(lang, message.date * 1000)}\n \n
\n\n
\n
\n
\n {renderMessageSummary(lang, message, mediaBlobUrl || mediaThumbnail, searchQuery, isRoundVideo)}\n
\n
\n
\n \n );\n};\n\nfunction renderMessageSummary(\n lang: LangFn, message: ApiMessage, blobUrl?: string, searchQuery?: string, isRoundVideo?: boolean,\n) {\n if (!blobUrl) {\n return renderText(getMessageSummaryText(lang, message));\n }\n\n return (\n \n \"\"\n {getMessageVideo(message) && }\n {renderText(getMessageSummaryText(lang, message, true), ['emoji', 'highlight'], { highlight: searchQuery })}\n \n );\n}\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n if (!chat) {\n return {};\n }\n\n const privateChatUserId = getPrivateChatUserId(chat);\n\n return {\n chat,\n lastSyncTime: global.lastSyncTime,\n ...(privateChatUserId && { privateChatUser: selectUser(global, privateChatUserId) }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'focusMessage',\n ]),\n)(ChatMessage));\n","import React, { FC, memo, useMemo } from '../../../lib/teact/teact';\nimport { formatDateToString } from '../../../util/dateFormat';\n\nimport './DateSuggest.scss';\n\nconst SUGGESTION_COUNT = 8;\n\nexport type OwnProps = {\n searchDate: string;\n onSelect: (value: Date) => void;\n};\n\nconst DateSuggest: FC = ({\n searchDate, onSelect,\n}) => {\n const suggestions = useMemo(() => getSuggestionsFromDate(searchDate), [searchDate]);\n return (\n
\n {suggestions.map(({ date, text }) => {\n return (\n onSelect(date)}\n className=\"date-item\"\n key={text}\n >\n \n {text}\n \n );\n })}\n
\n );\n};\n\nfunction getSuggestionsFromDate(searchDate: string) {\n const hasYear = searchDate.match(/^\\d{2,4}-\\d{2}-\\d{2}$/g);\n if (hasYear) {\n const date = new Date(searchDate);\n return [{ date, text: formatDateToString(date) }];\n }\n\n const suggestion = [];\n const currentDate = new Date();\n const currentYear = currentDate.getFullYear();\n const latestYear = currentDate.getTime() > (new Date(`${currentYear}-${searchDate}`)).getTime()\n ? currentYear\n : currentYear - 1;\n\n for (let i = 0; i < SUGGESTION_COUNT; i++) {\n const date = new Date(`${latestYear - i}-${searchDate}`);\n suggestion.push({ date, text: formatDateToString(date) });\n }\n\n return suggestion;\n}\n\nexport default memo(DateSuggest);\n","import React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUser, ApiChat, ApiMessage } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport searchWords from '../../../util/searchWords';\nimport { unique, pick } from '../../../util/iteratees';\nimport { getUserFullName, getMessageSummaryText, sortChatIds } from '../../../modules/helpers';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { throttle } from '../../../util/schedulers';\nimport useLang from '../../../hooks/useLang';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport LeftSearchResultChat from './LeftSearchResultChat';\nimport RecentContacts from './RecentContacts';\nimport ChatMessage from './ChatMessage';\nimport DateSuggest from './DateSuggest';\nimport Link from '../../ui/Link';\nimport NothingFound from '../../common/NothingFound';\nimport PickerSelectedItem from '../../common/PickerSelectedItem';\n\nexport type OwnProps = {\n searchQuery?: string;\n dateSearchQuery?: string;\n searchDate?: number;\n onReset: () => void;\n onSearchDateSelect: (value: Date) => void;\n};\n\ntype StateProps = {\n currentUserId?: number;\n localContactIds?: number[];\n localChatIds?: number[];\n localUserIds?: number[];\n globalChatIds?: number[];\n globalUserIds?: number[];\n foundIds?: string[];\n globalMessagesByChatId?: Record }>;\n chatsById: Record;\n usersById: Record;\n fetchingStatus?: { chats?: boolean; messages?: boolean };\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst MIN_QUERY_LENGTH_FOR_GLOBAL_SEARCH = 4;\nconst LESS_LIST_ITEMS_AMOUNT = 3;\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst ChatResults: FC = ({\n searchQuery, searchDate, dateSearchQuery, currentUserId,\n localContactIds, localChatIds, localUserIds, globalChatIds, globalUserIds,\n foundIds, globalMessagesByChatId, chatsById, usersById, fetchingStatus, lastSyncTime,\n onReset, onSearchDateSelect, openChat, addRecentlyFoundChatId, searchMessagesGlobal, setGlobalSearchChatId,\n}) => {\n const lang = useLang();\n\n const [shouldShowMoreLocal, setShouldShowMoreLocal] = useState(false);\n const [shouldShowMoreGlobal, setShouldShowMoreGlobal] = useState(false);\n\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: 'text',\n query: searchQuery,\n });\n });\n }\n }, [lastSyncTime, searchMessagesGlobal, searchQuery]);\n\n const handleChatClick = useCallback(\n (id: number) => {\n openChat({ id, shouldReplaceHistory: true });\n\n if (id !== currentUserId) {\n addRecentlyFoundChatId({ id });\n }\n\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n onReset();\n }\n },\n [currentUserId, openChat, addRecentlyFoundChatId, onReset],\n );\n\n const handlePickerItemClick = useCallback((id: number) => {\n setGlobalSearchChatId({ id });\n }, [setGlobalSearchChatId]);\n\n const localResults = useMemo(() => {\n if (!searchQuery || (searchQuery.startsWith('@') && searchQuery.length < 2)) {\n return MEMO_EMPTY_ARRAY;\n }\n\n const foundContactIds = localContactIds\n ? localContactIds.filter((id) => {\n const user = usersById[id];\n if (!user) {\n return false;\n }\n\n const fullName = getUserFullName(user);\n return (fullName && searchWords(fullName, searchQuery)) || searchWords(user.username, searchQuery);\n })\n : [];\n\n return [\n ...(currentUserId && searchWords(lang('SavedMessages'), searchQuery) ? [currentUserId] : []),\n ...sortChatIds(unique([\n ...foundContactIds,\n ...(localChatIds || []),\n ...(localUserIds || []),\n ]), chatsById),\n ];\n }, [\n searchQuery, localContactIds, currentUserId, lang, localChatIds, localUserIds, chatsById, usersById,\n ]);\n\n const globalResults = useMemo(() => {\n if (!searchQuery || searchQuery.length < MIN_QUERY_LENGTH_FOR_GLOBAL_SEARCH || !globalChatIds || !globalUserIds) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return sortChatIds(unique([...globalChatIds, ...globalUserIds]),\n chatsById, true);\n }, [chatsById, globalChatIds, globalUserIds, searchQuery]);\n\n const foundMessages = useMemo(() => {\n if ((!searchQuery && !searchDate) || !foundIds || foundIds.length === 0) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds\n .map((id) => {\n const [chatId, messageId] = id.split('_').map(Number);\n\n return globalMessagesByChatId?.[chatId]?.byId[messageId];\n })\n .filter(Boolean as any)\n .sort((a, b) => b.date - a.date);\n }, [foundIds, globalMessagesByChatId, searchQuery, searchDate]);\n\n const handleClickShowMoreLocal = useCallback(() => {\n setShouldShowMoreLocal(!shouldShowMoreLocal);\n }, [shouldShowMoreLocal]);\n\n const handleClickShowMoreGlobal = useCallback(() => {\n setShouldShowMoreGlobal(!shouldShowMoreGlobal);\n }, [shouldShowMoreGlobal]);\n\n function renderFoundMessage(message: ApiMessage) {\n const text = getMessageSummaryText(lang, message);\n const chat = chatsById[message.chatId];\n\n if (!text || !chat) {\n return undefined;\n }\n\n return (\n \n );\n }\n\n const nothingFound = fetchingStatus && !fetchingStatus.chats && !fetchingStatus.messages\n && !localResults.length && !globalResults.length && !foundMessages.length;\n\n if (!searchQuery && !searchDate) {\n return ;\n }\n\n return (\n \n {dateSearchQuery && (\n
\n \n
\n )}\n {nothingFound && (\n \n )}\n {!!localResults.length && (\n
\n {localResults.map((id) => (\n \n ))}\n
\n )}\n {!!localResults.length && (\n
\n

\n {localResults.length > LESS_LIST_ITEMS_AMOUNT && (\n \n {lang(shouldShowMoreLocal ? 'ChatList.Search.ShowLess' : 'ChatList.Search.ShowMore')}\n \n )}\n {lang('DialogList.SearchSectionDialogs')}\n

\n {localResults.map((id, index) => {\n if (!shouldShowMoreLocal && index >= LESS_LIST_ITEMS_AMOUNT) {\n return undefined;\n }\n\n return (\n \n );\n })}\n
\n )}\n {!!globalResults.length && (\n
\n

\n {globalResults.length > LESS_LIST_ITEMS_AMOUNT && (\n \n {lang(shouldShowMoreGlobal ? 'ChatList.Search.ShowLess' : 'ChatList.Search.ShowMore')}\n \n )}\n {lang('DialogList.SearchSectionGlobal')}\n

\n {globalResults.map((id, index) => {\n if (!shouldShowMoreGlobal && index >= LESS_LIST_ITEMS_AMOUNT) {\n return undefined;\n }\n\n return (\n \n );\n })}\n
\n )}\n {!!foundMessages.length && (\n
\n

{lang('SearchMessages')}

\n {foundMessages.map(renderFoundMessage)}\n
\n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { byId: chatsById } = global.chats;\n const { byId: usersById } = global.users;\n\n const { userIds: localContactIds } = global.contactList || {};\n\n if (!localContactIds) {\n return {\n chatsById,\n usersById,\n };\n }\n\n const {\n currentUserId, messages, lastSyncTime,\n } = global;\n const {\n fetchingStatus, globalResults, localResults, resultsByType,\n } = global.globalSearch;\n const { chatIds: globalChatIds, userIds: globalUserIds } = globalResults || {};\n const { chatIds: localChatIds, userIds: localUserIds } = localResults || {};\n const { byChatId: globalMessagesByChatId } = messages;\n const foundIds = resultsByType?.text?.foundIds;\n\n return {\n currentUserId,\n localContactIds,\n localChatIds,\n localUserIds,\n globalChatIds,\n globalUserIds,\n foundIds,\n globalMessagesByChatId,\n chatsById,\n usersById,\n fetchingStatus,\n lastSyncTime,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat',\n 'addRecentlyFoundChatId',\n 'searchMessagesGlobal',\n 'setGlobalSearchChatId',\n ]),\n)(ChatResults));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiMessage } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport { getMessageSummaryText } from '../../../modules/helpers';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { throttle } from '../../../util/schedulers';\nimport useLang from '../../../hooks/useLang';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport ChatMessage from './ChatMessage';\nimport NothingFound from '../../common/NothingFound';\nimport DateSuggest from './DateSuggest';\n\nexport type OwnProps = {\n searchQuery?: string;\n dateSearchQuery?: string;\n onReset: () => void;\n onSearchDateSelect: (value: Date) => void;\n};\n\ntype StateProps = {\n currentUserId?: number;\n foundIds?: string[];\n globalMessagesByChatId?: Record }>;\n chatsById: Record;\n fetchingStatus?: { chats?: boolean; messages?: boolean };\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst ChatMessageResults: FC = ({\n searchQuery,\n currentUserId,\n dateSearchQuery,\n foundIds,\n globalMessagesByChatId,\n chatsById,\n fetchingStatus,\n lastSyncTime,\n searchMessagesGlobal,\n onSearchDateSelect,\n}) => {\n const lang = useLang();\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: 'text',\n query: searchQuery,\n chatId: currentUserId,\n });\n });\n }\n }, [currentUserId, lastSyncTime, searchMessagesGlobal, searchQuery]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || foundIds.length === 0) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds\n .map((id) => {\n const [chatId, messageId] = id.split('_').map(Number);\n\n return globalMessagesByChatId?.[chatId]?.byId[messageId];\n })\n .filter(Boolean as any)\n .sort((a, b) => b.date - a.date);\n }, [foundIds, globalMessagesByChatId]);\n\n function renderFoundMessage(message: ApiMessage) {\n const text = getMessageSummaryText(lang, message);\n const chat = chatsById[message.chatId];\n\n if (!text || !chat) {\n return undefined;\n }\n\n return (\n \n );\n }\n\n const nothingFound = fetchingStatus && !fetchingStatus.chats && !fetchingStatus.messages && !foundMessages.length;\n\n return (\n
\n \n {dateSearchQuery && (\n
\n \n
\n )}\n {nothingFound && (\n \n )}\n {!!foundMessages.length && foundMessages.map(renderFoundMessage)}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { byId: chatsById } = global.chats;\n const { currentUserId, messages: { byChatId: globalMessagesByChatId }, lastSyncTime } = global;\n const { fetchingStatus, resultsByType } = global.globalSearch;\n\n const { foundIds } = (resultsByType?.text) || {};\n\n return {\n currentUserId,\n foundIds,\n globalMessagesByChatId,\n chatsById,\n fetchingStatus,\n lastSyncTime,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['searchMessagesGlobal']),\n)(ChatMessageResults));\n","import { GlobalState } from '../../../../global/types';\nimport {\n ApiChat, ApiGlobalMessageSearchType, ApiMessage, ApiUser,\n} from '../../../../api/types';\nimport { ISettings } from '../../../../types';\n\nimport { selectTheme } from '../../../../modules/selectors';\n\nexport type StateProps = {\n theme: ISettings['theme'];\n isLoading?: boolean;\n chatsById: Record;\n usersById: Record;\n globalMessagesByChatId?: Record }>;\n foundIds?: string[];\n lastSyncTime?: number;\n searchChatId?: number;\n};\n\nexport function createMapStateToProps(type: ApiGlobalMessageSearchType) {\n return (global: GlobalState, props: any) => {\n const { byId: chatsById } = global.chats;\n const { byId: usersById } = global.users;\n const {\n fetchingStatus, resultsByType, chatId,\n } = global.globalSearch;\n\n // One component is used for two different types of results.\n // The differences between them are only in the isVoice property.\n // The rest of the search results use their own personal components.\n const currentType = type !== 'audio' ? type : (props?.isVoice ? 'voice' : 'audio');\n\n const { byChatId: globalMessagesByChatId } = global.messages;\n const foundIds = resultsByType?.[currentType]?.foundIds;\n\n return {\n theme: selectTheme(global),\n isLoading: foundIds === undefined\n || (fetchingStatus ? Boolean(fetchingStatus.chats || fetchingStatus.messages) : false),\n chatsById,\n usersById,\n globalMessagesByChatId,\n foundIds,\n searchChatId: chatId,\n lastSyncTime: global.lastSyncTime,\n };\n };\n}\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { LoadMoreDirection, MediaViewerOrigin } from '../../../types';\n\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { createMapStateToProps, StateProps } from './helpers/createMapStateToProps';\nimport { pick } from '../../../util/iteratees';\nimport buildClassName from '../../../util/buildClassName';\nimport { throttle } from '../../../util/schedulers';\nimport useLang from '../../../hooks/useLang';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport Media from '../../common/Media';\nimport ChatMessage from './ChatMessage';\nimport NothingFound from '../../common/NothingFound';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n searchQuery?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst CURRENT_TYPE = 'media';\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst MediaResults: FC = ({\n searchQuery,\n searchChatId,\n isLoading,\n globalMessagesByChatId,\n foundIds,\n lastSyncTime,\n searchMessagesGlobal,\n openMediaViewer,\n}) => {\n const lang = useLang();\n\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: CURRENT_TYPE,\n query: searchQuery,\n chatId: searchChatId,\n });\n });\n }\n }, [lastSyncTime, searchMessagesGlobal, searchQuery, searchChatId]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || !globalMessagesByChatId) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds.map((id) => {\n const [chatId, messageId] = id.split('_').map(Number);\n\n return globalMessagesByChatId[chatId]?.byId[messageId];\n }).filter(Boolean);\n }, [globalMessagesByChatId, foundIds]);\n\n const handleSelectMedia = useCallback((messageId: number, chatId: number) => {\n openMediaViewer({\n chatId,\n messageId,\n origin: MediaViewerOrigin.SearchResult,\n });\n }, [openMediaViewer]);\n\n function renderGallery() {\n return (\n
\n {foundMessages.map((message) => (\n \n ))}\n
\n );\n }\n\n function renderSearchResult() {\n return foundMessages.map((message) => (\n \n ));\n }\n\n const canRenderContents = useAsyncRendering([searchQuery], SLIDE_TRANSITION_DURATION) && !isLoading;\n const isMediaGrid = canRenderContents && foundIds && foundIds.length > 0 && !searchQuery;\n const isMessageList = canRenderContents && foundIds && foundIds.length > 0 && searchQuery;\n\n const classNames = buildClassName(\n 'search-content custom-scroll',\n isMessageList && 'chat-list',\n );\n\n return (\n
\n \n {!canRenderContents && }\n {canRenderContents && (!foundIds || foundIds.length === 0) && (\n \n )}\n {isMediaGrid && renderGallery()}\n {isMessageList && renderSearchResult()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n createMapStateToProps(CURRENT_TYPE),\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesGlobal',\n 'openMediaViewer',\n ]),\n)(MediaResults));\n","import { ApiChat, ApiMessage, ApiUser } from '../../../../api/types';\nimport {\n getChatTitle,\n getSenderTitle,\n isChatPrivate,\n isChatGroup,\n} from '../../../../modules/helpers';\nimport { LangFn } from '../../../../hooks/useLang';\n\nexport function getSenderName(\n lang: LangFn, message: ApiMessage, chatsById: Record, usersById: Record,\n) {\n const { senderId } = message;\n if (!senderId) {\n return undefined;\n }\n\n const sender = isChatPrivate(senderId) ? usersById[senderId] : chatsById[senderId];\n\n let senderName = getSenderTitle(lang, sender);\n\n const chat = chatsById[message.chatId];\n if (chat) {\n if (isChatPrivate(senderId) && (sender as ApiUser).isSelf) {\n senderName = `${lang('FromYou')} → ${getChatTitle(lang, chat)}`;\n } else if (isChatGroup(chat)) {\n senderName += ` → ${getChatTitle(lang, chat)}`;\n }\n }\n\n return senderName;\n}\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { createMapStateToProps, StateProps } from './helpers/createMapStateToProps';\nimport { pick } from '../../../util/iteratees';\nimport { formatMonthAndYear, toYearMonth } from '../../../util/dateFormat';\nimport { getSenderName } from './helpers/getSenderName';\nimport { throttle } from '../../../util/schedulers';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport useLang from '../../../hooks/useLang';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport WebLink from '../../common/WebLink';\nimport NothingFound from '../../common/NothingFound';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n searchQuery?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst CURRENT_TYPE = 'links';\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst LinkResults: FC = ({\n searchQuery,\n searchChatId,\n isLoading,\n chatsById,\n usersById,\n globalMessagesByChatId,\n foundIds,\n lastSyncTime,\n searchMessagesGlobal,\n focusMessage,\n}) => {\n const lang = useLang();\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: CURRENT_TYPE,\n query: searchQuery,\n chatId: searchChatId,\n });\n });\n }\n }, [lastSyncTime, searchMessagesGlobal, searchQuery, searchChatId]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || !globalMessagesByChatId) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds.map((id) => {\n const [chatId, messageId] = id.split('_').map(Number);\n\n return globalMessagesByChatId[chatId]?.byId[messageId];\n }).filter(Boolean);\n }, [globalMessagesByChatId, foundIds]);\n\n const handleMessageFocus = useCallback((messageId: number, chatId: number) => {\n focusMessage({ chatId, messageId });\n }, [focusMessage]);\n\n function renderList() {\n return foundMessages.map((message, index) => {\n const shouldDrawDateDivider = index === 0\n || toYearMonth(message.date) !== toYearMonth(foundMessages[index - 1].date);\n return (\n \n {shouldDrawDateDivider && (\n

\n {formatMonthAndYear(lang, new Date(message.date * 1000))}\n

\n )}\n \n \n );\n });\n }\n\n const canRenderContents = useAsyncRendering([searchQuery], SLIDE_TRANSITION_DURATION) && !isLoading;\n\n return (\n
\n \n {!canRenderContents && }\n {canRenderContents && (!foundIds || foundIds.length === 0) && (\n \n )}\n {canRenderContents && foundIds && foundIds.length > 0 && renderList()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n createMapStateToProps(CURRENT_TYPE),\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesGlobal',\n 'focusMessage',\n ]),\n)(LinkResults));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { createMapStateToProps, StateProps } from './helpers/createMapStateToProps';\nimport { pick } from '../../../util/iteratees';\nimport { formatMonthAndYear, toYearMonth } from '../../../util/dateFormat';\nimport { getSenderName } from './helpers/getSenderName';\nimport { throttle } from '../../../util/schedulers';\nimport { getMessageDocument } from '../../../modules/helpers';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport useLang from '../../../hooks/useLang';\n\nimport Document from '../../common/Document';\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport NothingFound from '../../common/NothingFound';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n searchQuery?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst CURRENT_TYPE = 'documents';\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst FileResults: FC = ({\n searchQuery,\n searchChatId,\n isLoading,\n chatsById,\n usersById,\n globalMessagesByChatId,\n foundIds,\n lastSyncTime,\n searchMessagesGlobal,\n focusMessage,\n}) => {\n const lang = useLang();\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: CURRENT_TYPE,\n query: searchQuery,\n chatId: searchChatId,\n });\n });\n }\n }, [lastSyncTime, searchMessagesGlobal, searchQuery, searchChatId]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || !globalMessagesByChatId) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds.map((id) => {\n const [chatId, messageId] = id.split('_').map(Number);\n const message = globalMessagesByChatId[chatId]?.byId[messageId];\n\n return message && getMessageDocument(message) ? message : undefined;\n }).filter(Boolean) as ApiMessage[];\n }, [globalMessagesByChatId, foundIds]);\n\n const handleMessageFocus = useCallback((messageId: number, chatId: number) => {\n focusMessage({ chatId, messageId });\n }, [focusMessage]);\n\n function renderList() {\n return foundMessages.map((message, index) => {\n const shouldDrawDateDivider = index === 0\n || toYearMonth(message.date) !== toYearMonth(foundMessages[index - 1].date);\n return (\n \n {shouldDrawDateDivider && (\n

{formatMonthAndYear(lang, new Date(message.date * 1000))}

\n )}\n \n \n );\n });\n }\n\n const canRenderContents = useAsyncRendering([searchQuery], SLIDE_TRANSITION_DURATION) && !isLoading;\n\n return (\n
\n \n {!canRenderContents && }\n {canRenderContents && (!foundIds || foundIds.length === 0) && (\n \n )}\n {canRenderContents && foundIds && foundIds.length > 0 && renderList()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n createMapStateToProps(CURRENT_TYPE),\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesGlobal',\n 'focusMessage',\n ]),\n)(FileResults));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { createMapStateToProps, StateProps } from './helpers/createMapStateToProps';\nimport { pick } from '../../../util/iteratees';\nimport { formatMonthAndYear, toYearMonth } from '../../../util/dateFormat';\nimport { getSenderName } from './helpers/getSenderName';\nimport { throttle } from '../../../util/schedulers';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport useLang from '../../../hooks/useLang';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport Audio from '../../common/Audio';\nimport NothingFound from '../../common/NothingFound';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n isVoice?: boolean;\n searchQuery?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst AudioResults: FC = ({\n theme,\n isVoice,\n searchQuery,\n searchChatId,\n isLoading,\n chatsById,\n usersById,\n globalMessagesByChatId,\n foundIds,\n lastSyncTime,\n searchMessagesGlobal,\n focusMessage,\n openAudioPlayer,\n}) => {\n const lang = useLang();\n const currentType = isVoice ? 'voice' : 'audio';\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: currentType,\n query: searchQuery,\n chatId: searchChatId,\n });\n });\n }\n }, [currentType, lastSyncTime, searchMessagesGlobal, searchQuery, searchChatId]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || !globalMessagesByChatId) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds.map((id) => {\n const [chatId, messageId] = id.split('_').map(Number);\n\n return globalMessagesByChatId[chatId]?.byId[messageId];\n }).filter(Boolean);\n }, [globalMessagesByChatId, foundIds]);\n\n const handleMessageFocus = useCallback((messageId: number, chatId: number) => {\n focusMessage({ chatId, messageId });\n }, [focusMessage]);\n\n const handlePlayAudio = useCallback((messageId: number, chatId: number) => {\n openAudioPlayer({ chatId, messageId });\n }, [openAudioPlayer]);\n\n function renderList() {\n return foundMessages.map((message, index) => {\n const shouldDrawDateDivider = index === 0\n || toYearMonth(message.date) !== toYearMonth(foundMessages[index - 1].date);\n return (\n \n {shouldDrawDateDivider && (\n

\n {formatMonthAndYear(lang, new Date(message.date * 1000))}\n

\n )}\n \n \n );\n });\n }\n\n const canRenderContents = useAsyncRendering([searchQuery], SLIDE_TRANSITION_DURATION) && !isLoading;\n\n return (\n
\n \n {!canRenderContents && }\n {canRenderContents && (!foundIds || foundIds.length === 0) && (\n \n )}\n {canRenderContents && foundIds && foundIds.length > 0 && renderList()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n createMapStateToProps('audio'),\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesGlobal',\n 'focusMessage',\n 'openAudioPlayer',\n ]),\n)(AudioResults));\n","import React, {\n FC, memo, useCallback, useState, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { GlobalSearchContent } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport { parseDateString } from '../../../util/dateFormat';\nimport useKeyboardListNavigation from '../../../hooks/useKeyboardListNavigation';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport TabList from '../../ui/TabList';\nimport Transition from '../../ui/Transition';\nimport ChatResults from './ChatResults';\nimport UserChatResults from './ChatMessageResults';\nimport MediaResults from './MediaResults';\nimport LinkResults from './LinkResults';\nimport FileResults from './FileResults';\nimport AudioResults from './AudioResults';\n\nimport './LeftSearch.scss';\n\nexport type OwnProps = {\n searchQuery?: string;\n searchDate?: number;\n isActive: boolean;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentContent?: GlobalSearchContent;\n chatId?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst TABS = [\n { type: GlobalSearchContent.ChatList, title: 'SearchAllChatsShort' },\n { type: GlobalSearchContent.Media, title: 'SharedMediaTab2' },\n { type: GlobalSearchContent.Links, title: 'SharedLinksTab2' },\n { type: GlobalSearchContent.Files, title: 'SharedFilesTab2' },\n { type: GlobalSearchContent.Music, title: 'SharedMusicTab2' },\n { type: GlobalSearchContent.Voice, title: 'SharedVoiceTab2' },\n];\n\nconst CHAT_TABS = [\n { type: GlobalSearchContent.ChatList, title: 'All Messages' },\n ...TABS.slice(1),\n];\n\nconst TRANSITION_RENDER_COUNT = Object.keys(GlobalSearchContent).length / 2;\n\nconst LeftSearch: FC = ({\n searchQuery,\n searchDate,\n isActive,\n currentContent = GlobalSearchContent.ChatList,\n chatId,\n setGlobalSearchContent,\n setGlobalSearchDate,\n onReset,\n}) => {\n const lang = useLang();\n const [activeTab, setActiveTab] = useState(currentContent);\n const dateSearchQuery = useMemo(() => parseDateString(searchQuery), [searchQuery]);\n\n const handleSwitchTab = useCallback((index: number) => {\n const tab = TABS[index];\n setGlobalSearchContent({ content: tab.type });\n setActiveTab(index);\n }, [setGlobalSearchContent]);\n\n const handleSearchDateSelect = useCallback((value: Date) => {\n setGlobalSearchDate({ date: value.getTime() / 1000 });\n }, [setGlobalSearchDate]);\n\n useHistoryBack(isActive, onReset, undefined, undefined, true);\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const handleKeyDown = useKeyboardListNavigation(containerRef, isActive, undefined, '.ListItem-button', true);\n\n return (\n
\n \n \n {() => {\n switch (currentContent) {\n case GlobalSearchContent.ChatList:\n if (chatId) {\n return (\n \n );\n }\n return (\n \n );\n case GlobalSearchContent.Media:\n return ;\n case GlobalSearchContent.Links:\n return ;\n case GlobalSearchContent.Files:\n return ;\n case GlobalSearchContent.Music:\n return (\n \n );\n case GlobalSearchContent.Voice:\n return (\n \n );\n default:\n return undefined;\n }\n }}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { currentContent, chatId } = global.globalSearch;\n\n return { currentContent, chatId };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['setGlobalSearchContent', 'setGlobalSearchDate']),\n)(LeftSearch));\n","import useReducer, { StateReducer, Dispatch } from '../useReducer';\n\nexport type TwoFaActions = (\n 'setCurrentPassword' | 'setPassword' | 'setHint' | 'setEmail' | 'reset'\n);\nexport type TwoFaDispatch = Dispatch;\n\nexport type TwoFaState = {\n currentPassword: string;\n password: string;\n hint: string;\n email: string;\n};\n\nconst INITIAL_STATE: TwoFaState = {\n currentPassword: '',\n password: '',\n hint: '',\n email: '',\n};\n\nconst twoFaReducer: StateReducer = (\n state,\n action,\n) => {\n switch (action.type) {\n case 'setCurrentPassword':\n return {\n ...state,\n currentPassword: action.payload,\n };\n\n case 'setPassword':\n return {\n ...state,\n password: action.payload,\n };\n\n case 'setHint':\n return {\n ...state,\n hint: action.payload,\n };\n\n case 'setEmail':\n return {\n ...state,\n email: action.payload,\n };\n\n case 'reset':\n return INITIAL_STATE;\n\n default:\n return state;\n }\n};\n\nexport default () => {\n return useReducer(twoFaReducer, INITIAL_STATE);\n};\n","import React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\n\nimport DropdownMenu from '../../ui/DropdownMenu';\nimport MenuItem from '../../ui/MenuItem';\nimport Button from '../../ui/Button';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\ntype OwnProps = {\n currentScreen: SettingsScreens;\n editedFolderId?: number;\n onReset: () => void;\n onSaveFilter: () => void;\n onScreenSelect: (screen: SettingsScreens) => void;\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsHeader: FC = ({\n currentScreen,\n editedFolderId,\n onReset,\n onSaveFilter,\n signOut,\n deleteChatFolder,\n onScreenSelect,\n}) => {\n const [isSignOutDialogOpen, setIsSignOutDialogOpen] = useState(false);\n const [isDeleteFolderDialogOpen, setIsDeleteFolderDialogOpen] = useState(false);\n\n const openSignOutConfirmation = useCallback(() => {\n setIsSignOutDialogOpen(true);\n }, []);\n\n const closeSignOutConfirmation = useCallback(() => {\n setIsSignOutDialogOpen(false);\n }, []);\n\n const openDeleteFolderConfirmation = useCallback(() => {\n setIsDeleteFolderDialogOpen(true);\n }, []);\n\n const closeDeleteFolderConfirmation = useCallback(() => {\n setIsDeleteFolderDialogOpen(false);\n }, []);\n\n const handleSignOutMessage = useCallback(() => {\n closeSignOutConfirmation();\n signOut();\n }, [closeSignOutConfirmation, signOut]);\n\n const handleDeleteFolderMessage = useCallback(() => {\n closeDeleteFolderConfirmation();\n deleteChatFolder({ id: editedFolderId });\n onReset();\n }, [editedFolderId, closeDeleteFolderConfirmation, deleteChatFolder, onReset]);\n\n const SettingsMenuButton: FC<{ onTrigger: () => void; isOpen?: boolean }> = useMemo(() => {\n return ({ onTrigger, isOpen }) => (\n \n \n \n );\n }, []);\n\n const lang = useLang();\n\n function renderHeaderContent() {\n switch (currentScreen) {\n case SettingsScreens.EditProfile:\n return

{lang('lng_settings_information')}

;\n case SettingsScreens.General:\n return

{lang('General')}

;\n case SettingsScreens.Notifications:\n return

{lang('Notifications')}

;\n case SettingsScreens.Privacy:\n return

{lang('PrivacySettings')}

;\n case SettingsScreens.Language:\n return

{lang('Language')}

;\n\n case SettingsScreens.GeneralChatBackground:\n return

{lang('ChatBackground')}

;\n case SettingsScreens.GeneralChatBackgroundColor:\n return

{lang('SetColor')}

;\n\n case SettingsScreens.PrivacyPhoneNumber:\n return

{lang('PrivacyPhone')}

;\n case SettingsScreens.PrivacyLastSeen:\n return

{lang('PrivacyLastSeen')}

;\n case SettingsScreens.PrivacyProfilePhoto:\n return

{lang('Privacy.ProfilePhoto')}

;\n case SettingsScreens.PrivacyForwarding:\n return

{lang('PrivacyForwards')}

;\n case SettingsScreens.PrivacyGroupChats:\n return

{lang('AutodownloadGroupChats')}

;\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n return

{lang('AlwaysShareWith')}

;\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n return

{lang('NeverShareWith')}

;\n\n case SettingsScreens.PrivacyActiveSessions:\n return

{lang('SessionsTitle')}

;\n case SettingsScreens.PrivacyBlockedUsers:\n return

{lang('BlockedUsers')}

;\n\n case SettingsScreens.TwoFaDisabled:\n case SettingsScreens.TwoFaEnabled:\n return

{lang('TwoStepVerification')}

;\n case SettingsScreens.TwoFaNewPassword:\n case SettingsScreens.TwoFaChangePasswordNew:\n case SettingsScreens.TwoFaChangePasswordConfirm:\n return

{lang('PleaseEnterCurrentPassword')}

;\n case SettingsScreens.TwoFaNewPasswordConfirm:\n return

{lang('PleaseReEnterPassword')}

;\n case SettingsScreens.TwoFaNewPasswordHint:\n case SettingsScreens.TwoFaChangePasswordHint:\n return

{lang('PasswordHint')}

;\n case SettingsScreens.TwoFaNewPasswordEmail:\n case SettingsScreens.TwoFaRecoveryEmail:\n return

{lang('RecoveryEmailTitle')}

;\n case SettingsScreens.TwoFaNewPasswordEmailCode:\n case SettingsScreens.TwoFaRecoveryEmailCode:\n return

Recovery Email Code

;\n case SettingsScreens.TwoFaCongratulations:\n return

{lang('TwoStepVerificationPasswordSet')}

;\n case SettingsScreens.TwoFaChangePasswordCurrent:\n case SettingsScreens.TwoFaTurnOff:\n case SettingsScreens.TwoFaRecoveryEmailCurrentPassword:\n return

{lang('PleaseEnterCurrentPassword')}

;\n\n case SettingsScreens.Folders:\n return

{lang('Filters')}

;\n case SettingsScreens.FoldersCreateFolder:\n return

{lang('FilterNew')}

;\n case SettingsScreens.FoldersEditFolder:\n case SettingsScreens.FoldersEditFolderFromChatList:\n return (\n
\n

{lang('FilterEdit')}

\n\n {editedFolderId && (\n \n \n {lang('Delete')}\n \n \n )}\n
\n );\n case SettingsScreens.FoldersIncludedChats:\n case SettingsScreens.FoldersIncludedChatsFromChatList:\n case SettingsScreens.FoldersExcludedChats:\n case SettingsScreens.FoldersExcludedChatsFromChatList:\n return (\n
\n {(currentScreen === SettingsScreens.FoldersIncludedChats\n || currentScreen === SettingsScreens.FoldersIncludedChatsFromChatList) ? (\n

{lang('FilterInclude')}

\n ) : (\n

{lang('FilterExclude')}

\n )}\n\n \n \n \n
\n );\n\n default:\n return (\n
\n

{lang('SETTINGS')}

\n\n onScreenSelect(SettingsScreens.EditProfile)}\n ariaLabel={lang('lng_settings_information')}\n >\n \n \n \n {lang('LogOutTitle')}\n \n
\n );\n }\n }\n\n return (\n
\n \n \n \n {renderHeaderContent()}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['signOut', 'deleteChatFolder']),\n)(SettingsHeader));\n","import React, { FC, memo, useEffect } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { SettingsScreens } from '../../../types';\nimport { ApiUser } from '../../../api/types';\n\nimport { selectUser } from '../../../modules/selectors';\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport ProfileInfo from '../../common/ProfileInfo';\nimport ChatExtra from '../../common/ChatExtra';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentUser?: ApiUser;\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsMain: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n loadProfilePhotos,\n currentUser,\n lastSyncTime,\n}) => {\n const lang = useLang();\n const profileId = currentUser?.id;\n\n useEffect(() => {\n if (profileId && lastSyncTime) {\n loadProfilePhotos({ profileId });\n }\n }, [lastSyncTime, profileId, loadProfilePhotos]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Main);\n\n return (\n
\n
\n {currentUser && (\n \n )}\n {currentUser && (\n \n )}\n onScreenSelect(SettingsScreens.General)}\n >\n {lang('Telegram.GeneralSettingsViewController')}\n \n onScreenSelect(SettingsScreens.Notifications)}\n >\n {lang('Notifications')}\n \n onScreenSelect(SettingsScreens.Privacy)}\n >\n {lang('PrivacySettings')}\n \n onScreenSelect(SettingsScreens.Folders)}\n >\n {lang('Filters')}\n \n onScreenSelect(SettingsScreens.Language)}\n >\n {lang('Language')}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { currentUserId, lastSyncTime } = global;\n\n return {\n currentUser: currentUserId ? selectUser(global, currentUserId) : undefined,\n lastSyncTime,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadProfilePhotos']),\n)(SettingsMain));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useState, useCallback, memo, useEffect, useMemo,\n} from '../../lib/teact/teact';\n\nimport { debounce } from '../../util/schedulers';\nimport useLang from '../../hooks/useLang';\n\nimport InputText from '../ui/InputText';\n\ntype OwnProps = {\n currentUsername?: string;\n asLink?: boolean;\n isLoading?: boolean;\n isUsernameAvailable?: boolean;\n checkUsername: AnyToVoidFunction;\n onChange: (value: string | false) => void;\n};\n\nconst MIN_USERNAME_LENGTH = 5;\nconst MAX_USERNAME_LENGTH = 32;\nconst LINK_PREFIX = 'https://t.me/';\nconst LINK_PREFIX_REGEX = /https:\\/\\/t\\.me\\/?/i;\nconst USERNAME_REGEX = /^([a-zA-Z0-9_]+)$/;\n\nconst runDebouncedForCheckUsername = debounce((cb) => cb(), 250, false);\n\nfunction isUsernameValid(username: string) {\n return username.length >= MIN_USERNAME_LENGTH\n && username.length <= MAX_USERNAME_LENGTH\n && USERNAME_REGEX.test(username);\n}\n\nconst SettingsEditProfile: FC = ({\n currentUsername,\n asLink,\n isLoading,\n isUsernameAvailable,\n checkUsername,\n onChange,\n}) => {\n const [username, setUsername] = useState(currentUsername || '');\n\n const lang = useLang();\n const langPrefix = asLink ? 'SetUrl' : 'Username';\n const label = asLink ? lang('SetUrlPlaceholder') : lang('Username');\n\n const [usernameSuccess, usernameError] = useMemo(() => {\n if (!username.length) {\n return [];\n }\n\n if (username.length < MIN_USERNAME_LENGTH) {\n return [undefined, `${label} is too short`];\n }\n if (username.length > MAX_USERNAME_LENGTH) {\n return [undefined, `${label} is too long`];\n }\n if (!USERNAME_REGEX.test(username)) {\n return [undefined, `${label} contains invalid characters`];\n }\n\n if (isUsernameAvailable === undefined) {\n return [];\n }\n\n // Variable `isUsernameAvailable` is initialized with `undefined`, so a strict false check is required\n return [\n isUsernameAvailable ? lang(`${langPrefix}Available`, 'Username') : undefined,\n isUsernameAvailable === false ? lang(`${langPrefix}InUse`) : undefined,\n ];\n }, [username, isUsernameAvailable, lang, langPrefix, label]);\n\n useEffect(() => {\n setUsername(currentUsername || '');\n }, [asLink, currentUsername]);\n\n const handleUsernameChange = useCallback((e: ChangeEvent) => {\n const newUsername = e.target.value.trim().replace(LINK_PREFIX_REGEX, '');\n setUsername(newUsername);\n e.target.value = `${asLink ? LINK_PREFIX : ''}${newUsername}`;\n\n const isValid = isUsernameValid(newUsername);\n\n if (isValid) {\n runDebouncedForCheckUsername(() => {\n checkUsername({ username: newUsername });\n });\n }\n\n if (onChange) {\n onChange(isValid ? newUsername : false);\n }\n }, [asLink, checkUsername, onChange]);\n\n return (\n \n );\n};\n\nexport default memo(SettingsEditProfile);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useState, useCallback, memo, useEffect, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiMediaFormat } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { ProfileEditProgress, SettingsScreens } from '../../../types';\n\nimport { throttle } from '../../../util/schedulers';\nimport { pick } from '../../../util/iteratees';\nimport { selectUser } from '../../../modules/selectors';\nimport { getChatAvatarHash } from '../../../modules/helpers';\nimport useMedia from '../../../hooks/useMedia';\nimport useLang from '../../../hooks/useLang';\n\nimport AvatarEditable from '../../ui/AvatarEditable';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport InputText from '../../ui/InputText';\nimport renderText from '../../common/helpers/renderText';\nimport UsernameInput from '../../common/UsernameInput';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\ntype OwnProps = {\n isActive: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentAvatarHash?: string;\n currentFirstName?: string;\n currentLastName?: string;\n currentBio?: string;\n currentUsername?: string;\n progress?: ProfileEditProgress;\n isUsernameAvailable?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst MAX_BIO_LENGTH = 70;\n\nconst ERROR_FIRST_NAME_MISSING = 'Please provide your first name';\nconst ERROR_BIO_TOO_LONG = 'Bio can\\' be longer than 70 characters';\n\nconst SettingsEditProfile: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n currentAvatarHash,\n currentFirstName,\n currentLastName,\n currentBio,\n currentUsername,\n progress,\n isUsernameAvailable,\n loadCurrentUser,\n updateProfile,\n checkUsername,\n}) => {\n const lang = useLang();\n\n const [isUsernameTouched, setIsUsernameTouched] = useState(false);\n const [isProfileFieldsTouched, setIsProfileFieldsTouched] = useState(false);\n const [error, setError] = useState();\n\n const [photo, setPhoto] = useState();\n const [firstName, setFirstName] = useState(currentFirstName || '');\n const [lastName, setLastName] = useState(currentLastName || '');\n const [bio, setBio] = useState(currentBio || '');\n const [username, setUsername] = useState(currentUsername || '');\n\n const currentAvatarBlobUrl = useMedia(currentAvatarHash, false, ApiMediaFormat.BlobUrl);\n\n const isLoading = progress === ProfileEditProgress.InProgress;\n const isUsernameError = username === false;\n\n const isSaveButtonShown = useMemo(() => {\n if (isUsernameError) {\n return false;\n }\n\n return Boolean(photo) || isProfileFieldsTouched || isUsernameAvailable === true;\n }, [photo, isProfileFieldsTouched, isUsernameError, isUsernameAvailable]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.EditProfile);\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadCurrentUser();\n });\n }, [loadCurrentUser]);\n\n useEffect(() => {\n setPhoto(undefined);\n }, [currentAvatarBlobUrl]);\n\n useEffect(() => {\n setFirstName(currentFirstName || '');\n setLastName(currentLastName || '');\n setBio(currentBio || '');\n }, [currentFirstName, currentLastName, currentBio]);\n\n useEffect(() => {\n setUsername(currentUsername || '');\n }, [currentUsername]);\n\n useEffect(() => {\n if (progress === ProfileEditProgress.Complete) {\n setIsProfileFieldsTouched(false);\n setIsUsernameTouched(false);\n setError(undefined);\n }\n }, [progress]);\n\n const handlePhotoChange = useCallback((newPhoto: File) => {\n setPhoto(newPhoto);\n }, []);\n\n const handleFirstNameChange = useCallback((e: ChangeEvent) => {\n setFirstName(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleLastNameChange = useCallback((e: ChangeEvent) => {\n setLastName(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleBioChange = useCallback((e: ChangeEvent) => {\n setBio(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleUsernameChange = useCallback((value: string | false) => {\n setUsername(value);\n setIsUsernameTouched(true);\n }, []);\n\n const handleProfileSave = useCallback(() => {\n const trimmedFirstName = firstName.trim();\n const trimmedLastName = lastName.trim();\n const trimmedBio = bio.trim();\n\n if (!trimmedFirstName.length) {\n setError(ERROR_FIRST_NAME_MISSING);\n return;\n }\n\n if (trimmedBio.length > MAX_BIO_LENGTH) {\n setError(ERROR_BIO_TOO_LONG);\n return;\n }\n\n updateProfile({\n photo,\n ...(isProfileFieldsTouched && {\n firstName: trimmedFirstName,\n lastName: trimmedLastName,\n bio: trimmedBio,\n }),\n ...(isUsernameTouched && {\n username,\n }),\n });\n }, [\n photo,\n firstName, lastName, bio, isProfileFieldsTouched,\n username, isUsernameTouched,\n updateProfile,\n ]);\n\n return (\n
\n
\n
\n \n \n \n \n\n

\n {renderText(lang('lng_settings_about_bio'), ['br', 'simple_markdown'])}\n

\n
\n\n
\n

{lang('Username')}

\n\n \n\n

\n {renderText(lang('UsernameHelp'), ['br', 'simple_markdown'])}\n

\n {username && (\n

\n {lang('lng_username_link')}
\n https://t.me/{username}\n

\n )}\n
\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { currentUserId } = global;\n const { progress, isUsernameAvailable } = global.profileEdit || {};\n const currentUser = currentUserId ? selectUser(global, currentUserId) : undefined;\n\n if (!currentUser) {\n return {\n progress,\n isUsernameAvailable,\n };\n }\n\n const {\n firstName: currentFirstName,\n lastName: currentLastName,\n username: currentUsername,\n fullInfo,\n } = currentUser;\n const { bio: currentBio } = fullInfo || {};\n const currentAvatarHash = getChatAvatarHash(currentUser);\n\n return {\n currentAvatarHash,\n currentFirstName,\n currentLastName,\n currentBio,\n currentUsername,\n progress,\n isUsernameAvailable,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadCurrentUser',\n 'updateProfile',\n 'checkUsername',\n ]),\n)(SettingsEditProfile));\n","import React, {\n FC, memo, useMemo, useCallback, useState, useEffect,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../../global/types';\nimport { ApiChatFolder, ApiChat, ApiUser } from '../../../../api/types';\nimport { NotifyException, NotifySettings, SettingsScreens } from '../../../../types';\n\nimport { STICKER_SIZE_FOLDER_SETTINGS } from '../../../../config';\nimport { pick } from '../../../../util/iteratees';\nimport { selectNotifyExceptions, selectNotifySettings } from '../../../../modules/selectors';\nimport { throttle } from '../../../../util/schedulers';\nimport getAnimationData from '../../../common/helpers/animatedAssets';\nimport { getFolderDescriptionText } from '../../../../modules/helpers';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport ListItem from '../../../ui/ListItem';\nimport Button from '../../../ui/Button';\nimport Loading from '../../../ui/Loading';\nimport AnimatedSticker from '../../../common/AnimatedSticker';\n\ntype OwnProps = {\n onCreateFolder: () => void;\n onEditFolder: (folder: ApiChatFolder) => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n chatsById: Record;\n usersById: Record;\n orderedFolderIds?: number[];\n foldersById: Record;\n recommendedChatFolders?: ApiChatFolder[];\n notifySettings: NotifySettings;\n notifyExceptions?: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst runThrottledForLoadRecommended = throttle((cb) => cb(), 60000, true);\n\nconst MAX_ALLOWED_FOLDERS = 10;\n\nconst SettingsFoldersMain: FC = ({\n onCreateFolder,\n onEditFolder,\n isActive,\n onScreenSelect,\n onReset,\n chatsById,\n usersById,\n orderedFolderIds,\n foldersById,\n recommendedChatFolders,\n notifySettings,\n notifyExceptions,\n loadRecommendedChatFolders,\n addChatFolder,\n showDialog,\n}) => {\n const [animationData, setAnimationData] = useState>();\n const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);\n const handleAnimationLoad = useCallback(() => setIsAnimationLoaded(true), []);\n\n useEffect(() => {\n if (!animationData) {\n getAnimationData('FoldersAll').then(setAnimationData);\n }\n }, [animationData]);\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottledForLoadRecommended(() => {\n loadRecommendedChatFolders();\n });\n }, [loadRecommendedChatFolders]);\n\n const handleCreateFolder = useCallback(() => {\n if (Object.keys(foldersById).length >= MAX_ALLOWED_FOLDERS) {\n showDialog({\n data: {\n message: 'DIALOG_FILTERS_TOO_MUCH',\n hasErrorKey: true,\n },\n });\n\n return;\n }\n\n onCreateFolder();\n }, [foldersById, showDialog, onCreateFolder]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Folders);\n\n const userFolders = useMemo(() => {\n if (!orderedFolderIds) {\n return undefined;\n }\n\n const chatIds = Object.keys(chatsById).map(Number);\n\n return orderedFolderIds.map((id) => {\n const folder = foldersById[id];\n\n return {\n id: folder.id,\n title: folder.title,\n subtitle: getFolderDescriptionText(\n lang, chatsById, usersById, folder, chatIds, notifySettings, notifyExceptions,\n ),\n };\n });\n }, [orderedFolderIds, chatsById, foldersById, usersById, notifySettings, notifyExceptions, lang]);\n\n const handleCreateFolderFromRecommended = useCallback((folder: ApiChatFolder) => {\n if (Object.keys(foldersById).length >= MAX_ALLOWED_FOLDERS) {\n showDialog({\n data: {\n message: 'DIALOG_FILTERS_TOO_MUCH',\n hasErrorKey: true,\n },\n });\n\n return;\n }\n\n addChatFolder({ folder });\n }, [foldersById, addChatFolder, showDialog]);\n\n return (\n
\n
\n
\n {animationData && (\n \n )}\n
\n\n

\n {lang('CreateNewFilterInfo')}\n

\n\n \n \n {lang('CreateNewFilter')}\n \n
\n\n
\n

{lang('Filters')}

\n\n {userFolders?.length ? userFolders.map((folder) => (\n onEditFolder(foldersById[folder.id])}\n >\n {folder.title}\n {folder.subtitle}\n \n )) : userFolders && !userFolders.length ? (\n

\n You have no folders yet.\n

\n ) : }\n
\n\n {(recommendedChatFolders && !!recommendedChatFolders.length) && (\n
\n

\n {lang('FilterRecommended')}\n

\n\n {recommendedChatFolders.map((folder) => (\n handleCreateFolderFromRecommended(folder)}\n >\n
\n
\n {folder.title}\n {folder.description}\n
\n\n \n {lang('Add')}\n \n
\n \n ))}\n
\n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chats: { byId: chatsById },\n users: { byId: usersById },\n } = global;\n\n const {\n orderedIds: orderedFolderIds,\n byId: foldersById,\n recommended: recommendedChatFolders,\n } = global.chatFolders;\n\n return {\n chatsById,\n usersById,\n orderedFolderIds,\n foldersById,\n recommendedChatFolders,\n notifySettings: selectNotifySettings(global),\n notifyExceptions: selectNotifyExceptions(global),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadRecommendedChatFolders', 'addChatFolder', 'showDialog']),\n)(SettingsFoldersMain));\n","import React, { FC } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\n\nimport Button from './Button';\n\nimport './ShowMoreButton.scss';\n\ntype OwnProps = {\n count: number;\n itemName: string;\n itemPluralName?: string;\n isLoading?: boolean;\n onClick: () => void;\n};\n\nconst ShowMoreButton: FC = ({\n count,\n itemName,\n itemPluralName,\n isLoading,\n onClick,\n}) => {\n const lang = useLang();\n\n return (\n \n \n Show {count} more {count > 1 ? itemPluralName || `${itemName}s` : itemName}\n \n );\n};\n\nexport default ShowMoreButton;\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../../global/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { STICKER_SIZE_FOLDER_SETTINGS } from '../../../../config';\nimport { findIntersectionWithSet, pick } from '../../../../util/iteratees';\nimport { isChatPrivate } from '../../../../modules/helpers';\nimport getAnimationData from '../../../common/helpers/animatedAssets';\nimport {\n EXCLUDED_CHAT_TYPES,\n FolderEditDispatch,\n FoldersState,\n INCLUDED_CHAT_TYPES,\n selectChatFilters,\n} from '../../../../hooks/reducers/useFoldersReducer';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport ListItem from '../../../ui/ListItem';\nimport AnimatedSticker from '../../../common/AnimatedSticker';\nimport InputText from '../../../ui/InputText';\nimport PrivateChatInfo from '../../../common/PrivateChatInfo';\nimport GroupChatInfo from '../../../common/GroupChatInfo';\nimport FloatingActionButton from '../../../ui/FloatingActionButton';\nimport Spinner from '../../../ui/Spinner';\nimport ShowMoreButton from '../../../ui/ShowMoreButton';\n\ntype OwnProps = {\n state: FoldersState;\n dispatch: FolderEditDispatch;\n onAddIncludedChats: () => void;\n onAddExcludedChats: () => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n onBack: () => void;\n};\n\ntype StateProps = {\n loadedActiveChatIds?: number[];\n loadedArchivedChatIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst SUBMIT_TIMEOUT = 500;\n\nconst INITIAL_CHATS_LIMIT = 5;\n\nconst ERROR_NO_TITLE = 'Please provide a title for this folder.';\nconst ERROR_NO_CHATS = 'ChatList.Filter.Error.Empty';\n\nconst SettingsFoldersEdit: FC = ({\n state,\n dispatch,\n onAddIncludedChats,\n onAddExcludedChats,\n isActive,\n onScreenSelect,\n onReset,\n onBack,\n loadedActiveChatIds,\n loadedArchivedChatIds,\n editChatFolder,\n addChatFolder,\n loadMoreChats,\n}) => {\n const [animationData, setAnimationData] = useState>();\n const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);\n const handleAnimationLoad = useCallback(() => setIsAnimationLoaded(true), []);\n\n const [isIncludedChatsListExpanded, setIsIncludedChatsListExpanded] = useState(false);\n const [isExcludedChatsListExpanded, setIsExcludedChatsListExpanded] = useState(false);\n\n const {\n selectedChatIds: includedChatIds,\n selectedChatTypes: includedChatTypes,\n } = selectChatFilters(state, 'included');\n const {\n selectedChatIds: excludedChatIds,\n selectedChatTypes: excludedChatTypes,\n } = selectChatFilters(state, 'excluded');\n\n useEffect(() => {\n if (!animationData) {\n getAnimationData('FoldersNew').then(setAnimationData);\n }\n }, [animationData]);\n\n useEffect(() => {\n setIsIncludedChatsListExpanded(false);\n setIsExcludedChatsListExpanded(false);\n }, [state.folderId]);\n\n const [visibleIncludedChatIds, visibleExcludedChatIds] = useMemo(() => {\n const allLoadedChatsSet = new Set([\n ...(loadedActiveChatIds || []),\n ...(loadedArchivedChatIds || []),\n ]);\n\n const loadedIncludedChatIds = findIntersectionWithSet(includedChatIds, allLoadedChatsSet);\n const loadedExcludedChatIds = findIntersectionWithSet(excludedChatIds, allLoadedChatsSet);\n\n return [\n isIncludedChatsListExpanded\n ? loadedIncludedChatIds\n : loadedIncludedChatIds.slice(0, INITIAL_CHATS_LIMIT - includedChatTypes.length),\n isExcludedChatsListExpanded\n ? loadedExcludedChatIds\n : loadedExcludedChatIds.slice(0, INITIAL_CHATS_LIMIT - excludedChatTypes.length),\n ];\n }, [\n excludedChatIds, includedChatIds, includedChatTypes, excludedChatTypes,\n isExcludedChatsListExpanded, isIncludedChatsListExpanded,\n loadedActiveChatIds, loadedArchivedChatIds,\n ]);\n\n useEffect(() => {\n if (\n visibleIncludedChatIds.length < includedChatIds.length\n || visibleExcludedChatIds.length < excludedChatIds.length\n ) {\n loadMoreChats({ listType: 'active' });\n }\n }, [\n loadMoreChats,\n excludedChatIds.length,\n includedChatIds.length,\n visibleExcludedChatIds.length,\n visibleIncludedChatIds.length,\n ]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onBack, onScreenSelect, state.mode === 'edit'\n ? SettingsScreens.FoldersEditFolder\n : SettingsScreens.FoldersCreateFolder);\n\n function handleChange(event: React.ChangeEvent) {\n const { currentTarget } = event;\n dispatch({ type: 'setTitle', payload: currentTarget.value.trim() });\n }\n\n function handleSubmit() {\n const { title } = state.folder;\n\n if (!title) {\n dispatch({ type: 'setError', payload: ERROR_NO_TITLE });\n return;\n }\n\n if (!includedChatIds.length && !Object.keys(includedChatTypes).length) {\n dispatch({ type: 'setError', payload: ERROR_NO_CHATS });\n return;\n }\n\n dispatch({ type: 'setIsLoading', payload: true });\n if (state.mode === 'edit') {\n editChatFolder({ id: state.folderId, folderUpdate: state.folder });\n } else {\n addChatFolder({ folder: state.folder });\n }\n\n setTimeout(() => {\n onReset();\n }, SUBMIT_TIMEOUT);\n }\n\n function renderChatType(key: string, mode: 'included' | 'excluded') {\n const chatType = mode === 'included'\n ? INCLUDED_CHAT_TYPES.find(({ key: typeKey }) => typeKey === key)\n : EXCLUDED_CHAT_TYPES.find(({ key: typeKey }) => typeKey === key);\n\n if (!chatType) {\n return undefined;\n }\n\n return (\n \n {lang(chatType.title)}\n \n );\n }\n\n function renderChats(mode: 'included' | 'excluded') {\n const selectedChatTypes = mode === 'included' ? includedChatTypes : excludedChatTypes;\n const visibleChatIds = mode === 'included' ? visibleIncludedChatIds : visibleExcludedChatIds;\n\n const isExpanded = mode === 'included' ? isIncludedChatsListExpanded : isExcludedChatsListExpanded;\n const allChatIds = mode === 'included' ? includedChatIds : excludedChatIds;\n const leftChatsCount = allChatIds.length - selectedChatTypes.length - visibleChatIds.length;\n const clickHandler = mode === 'included'\n ? () => setIsIncludedChatsListExpanded(true)\n : () => setIsExcludedChatsListExpanded(true);\n\n return (\n <>\n {selectedChatTypes.map((key) => renderChatType(key, mode))}\n {visibleChatIds.map((id) => (\n \n {isChatPrivate(id) ? (\n \n ) : (\n \n )}\n \n ))}\n {(!isExpanded && leftChatsCount > 0) && (\n \n )}\n \n );\n }\n\n return (\n
\n
\n
\n
\n {animationData && (\n \n )}\n
\n\n {state.mode === 'create' && (\n

\n {lang('FilterIncludeInfo')}\n

\n )}\n\n \n
\n\n
\n {state.error && state.error === ERROR_NO_CHATS && (\n

\n {lang(state.error)}\n

\n )}\n\n

{lang('FilterInclude')}

\n\n \n {lang('FilterAddChats')}\n \n\n {renderChats('included')}\n
\n\n
\n

{lang('FilterExclude')}

\n\n \n {lang('FilterAddChats')}\n \n\n {renderChats('excluded')}\n
\n
\n\n \n {state.isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { listIds } = global.chats;\n\n return {\n loadedActiveChatIds: listIds.active,\n loadedArchivedChatIds: listIds.archived,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['editChatFolder', 'addChatFolder', 'loadMoreChats']),\n)(SettingsFoldersEdit));\n","import React, {\n FC, useCallback, useRef, useEffect, memo,\n} from '../../../../lib/teact/teact';\n\nimport { isChatPrivate } from '../../../../modules/helpers';\nimport {\n INCLUDED_CHAT_TYPES,\n EXCLUDED_CHAT_TYPES,\n FolderChatType,\n} from '../../../../hooks/reducers/useFoldersReducer';\nimport useInfiniteScroll from '../../../../hooks/useInfiniteScroll';\nimport useLang from '../../../../hooks/useLang';\n\nimport Checkbox from '../../../ui/Checkbox';\nimport InputText from '../../../ui/InputText';\nimport ListItem from '../../../ui/ListItem';\nimport PrivateChatInfo from '../../../common/PrivateChatInfo';\nimport GroupChatInfo from '../../../common/GroupChatInfo';\nimport PickerSelectedItem from '../../../common/PickerSelectedItem';\nimport InfiniteScroll from '../../../ui/InfiniteScroll';\nimport Loading from '../../../ui/Loading';\n\nimport '../../../common/Picker.scss';\nimport './SettingsFoldersChatsPicker.scss';\n\ntype OwnProps = {\n mode: 'included' | 'excluded';\n chatIds: number[];\n selectedIds: number[];\n selectedChatTypes: string[];\n filterValue?: string;\n onSelectedIdsChange: (ids: number[]) => void;\n onSelectedChatTypesChange: (types: string[]) => void;\n onFilterChange: (value: string) => void;\n onLoadMore: () => void;\n};\n\n// Focus slows down animation, also it breaks transition layout in Chrome\nconst FOCUS_DELAY_MS = 500;\n\nconst MAX_CHATS = 100;\nconst MAX_FULL_ITEMS = 10;\nconst ALWAYS_FULL_ITEMS_COUNT = 5;\n\nconst SettingsFoldersChatsPicker: FC = ({\n mode,\n chatIds,\n selectedIds,\n selectedChatTypes,\n filterValue,\n onSelectedIdsChange,\n onSelectedChatTypesChange,\n onFilterChange,\n onLoadMore,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const chatTypes = mode === 'included' ? INCLUDED_CHAT_TYPES : EXCLUDED_CHAT_TYPES;\n const shouldMinimize = selectedIds.length + selectedChatTypes.length > MAX_FULL_ITEMS;\n const hasMaxChats = selectedIds.length >= MAX_CHATS;\n\n useEffect(() => {\n setTimeout(() => {\n requestAnimationFrame(() => {\n inputRef.current!.focus();\n });\n }, FOCUS_DELAY_MS);\n }, []);\n\n const handleItemClick = useCallback((id: number) => {\n const newSelectedIds = [...selectedIds];\n if (newSelectedIds.includes(id)) {\n newSelectedIds.splice(newSelectedIds.indexOf(id), 1);\n } else {\n newSelectedIds.push(id);\n }\n onSelectedIdsChange(newSelectedIds);\n }, [selectedIds, onSelectedIdsChange]);\n\n const handleChatTypeClick = useCallback((key: FolderChatType['key']) => {\n const newSelectedChatTypes = [...selectedChatTypes];\n if (newSelectedChatTypes.includes(key)) {\n newSelectedChatTypes.splice(newSelectedChatTypes.indexOf(key), 1);\n } else {\n newSelectedChatTypes.push(key);\n }\n onSelectedChatTypesChange(newSelectedChatTypes);\n }, [selectedChatTypes, onSelectedChatTypesChange]);\n\n const handleFilterChange = useCallback((e: React.ChangeEvent) => {\n const { value } = e.currentTarget;\n onFilterChange(value);\n }, [onFilterChange]);\n\n const lang = useLang();\n\n function renderSelectedChatType(key: string) {\n const selectedType = chatTypes.find(({ key: typeKey }) => key === typeKey);\n if (!selectedType) {\n return undefined;\n }\n\n return (\n \n );\n }\n\n function renderChatType(type: FolderChatType) {\n return (\n handleChatTypeClick(type.key)}\n ripple\n >\n \n

{lang(type.title)}

\n \n \n );\n }\n\n function renderItem(id: number) {\n const isSelected = selectedIds.includes(id);\n\n return (\n handleItemClick(id)}\n ripple\n disabled={!isSelected && hasMaxChats}\n >\n {isChatPrivate(id) ? (\n \n ) : (\n \n )}\n \n \n );\n }\n\n const [viewportIds, getMore] = useInfiniteScroll(onLoadMore, chatIds, Boolean(filterValue));\n\n return (\n
\n
\n {selectedChatTypes.map(renderSelectedChatType)}\n {selectedIds.map((id, i) => (\n \n ))}\n {!hasMaxChats ? (\n \n ) : (\n

\n {`Sorry, you can't add more than ${MAX_CHATS} chats.`}\n

\n )}\n
\n \n {(!viewportIds || !viewportIds.length || viewportIds.includes(chatIds[0])) && (\n <>\n

\n {lang('FilterChatTypes')}\n

\n {chatTypes.map(renderChatType)}\n
\n

\n {lang('FilterChats')}\n

\n \n )}\n\n {viewportIds?.length ? (\n viewportIds.map(renderItem)\n ) : viewportIds && !viewportIds.length ? (\n

Sorry, nothing found.

\n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(SettingsFoldersChatsPicker);\n","import React, {\n FC, memo, useMemo, useCallback,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../../global/types';\nimport { ApiChat } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport useLang from '../../../../hooks/useLang';\nimport { pick } from '../../../../util/iteratees';\nimport searchWords from '../../../../util/searchWords';\nimport { prepareChatList, getChatTitle } from '../../../../modules/helpers';\nimport {\n FoldersState,\n FolderEditDispatch,\n selectChatFilters,\n} from '../../../../hooks/reducers/useFoldersReducer';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport SettingsFoldersChatsPicker from './SettingsFoldersChatsPicker';\n\nimport Loading from '../../../ui/Loading';\n\ntype OwnProps = {\n mode: 'included' | 'excluded';\n state: FoldersState;\n dispatch: FolderEditDispatch;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n chatsById: Record;\n listIds?: number[];\n orderedPinnedIds?: number[];\n archivedListIds?: number[];\n archivedPinnedIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsFoldersChatFilters: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n mode,\n state,\n dispatch,\n chatsById,\n listIds,\n orderedPinnedIds,\n archivedListIds,\n archivedPinnedIds,\n loadMoreChats,\n}) => {\n const { chatFilter } = state;\n const { selectedChatIds, selectedChatTypes } = selectChatFilters(state, mode, true);\n\n const lang = useLang();\n const chats = useMemo(() => {\n const activeChatArrays = listIds\n ? prepareChatList(chatsById, listIds, orderedPinnedIds, 'all')\n : undefined;\n const archivedChatArrays = archivedListIds\n ? prepareChatList(chatsById, archivedListIds, archivedPinnedIds, 'archived')\n : undefined;\n\n if (!activeChatArrays && !archivedChatArrays) {\n return undefined;\n }\n\n return [\n ...(activeChatArrays\n ? [...activeChatArrays.pinnedChats, ...activeChatArrays.otherChats]\n : []\n ),\n ...(archivedChatArrays ? archivedChatArrays.otherChats : []),\n ];\n }, [chatsById, listIds, orderedPinnedIds, archivedListIds, archivedPinnedIds]);\n\n const displayedIds = useMemo(() => {\n if (!chats) {\n return undefined;\n }\n\n return chats\n .filter((chat) => (\n !chatFilter\n || searchWords(getChatTitle(lang, chat), chatFilter)\n || selectedChatIds.includes(chat.id)\n ))\n .map(({ id }) => id);\n }, [chats, chatFilter, lang, selectedChatIds]);\n\n const handleFilterChange = useCallback((newFilter: string) => {\n dispatch({\n type: 'setChatFilter',\n payload: newFilter,\n });\n }, [dispatch]);\n\n const handleSelectedIdsChange = useCallback((ids: number[]) => {\n if (mode === 'included') {\n dispatch({\n type: 'setIncludeFilters',\n payload: { ...state.includeFilters, includedChatIds: ids },\n });\n } else {\n dispatch({\n type: 'setExcludeFilters',\n payload: { ...state.excludeFilters, excludedChatIds: ids },\n });\n }\n }, [mode, state, dispatch]);\n\n const handleSelectedChatTypesChange = useCallback((keys: string[]) => {\n const newFilters: Record = {};\n keys.forEach((key) => {\n newFilters[key] = true;\n });\n\n if (mode === 'included') {\n dispatch({\n type: 'setIncludeFilters',\n payload: {\n includedChatIds: selectedChatIds,\n ...newFilters,\n },\n });\n } else {\n dispatch({\n type: 'setExcludeFilters',\n payload: {\n excludedChatIds: selectedChatIds,\n ...newFilters,\n },\n });\n }\n }, [mode, selectedChatIds, dispatch]);\n\n useHistoryBack(isActive, onReset, onScreenSelect,\n mode === 'included' ? SettingsScreens.FoldersIncludedChats : SettingsScreens.FoldersExcludedChats);\n\n if (!displayedIds) {\n return ;\n }\n\n return (\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chats: {\n byId: chatsById,\n listIds,\n orderedPinnedIds,\n },\n } = global;\n\n return {\n chatsById,\n listIds: listIds.active,\n orderedPinnedIds: orderedPinnedIds.active,\n archivedPinnedIds: orderedPinnedIds.archived,\n archivedListIds: listIds.archived,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadMoreChats']),\n)(SettingsFoldersChatFilters));\n","import React, { FC, memo, useCallback } from '../../../../lib/teact/teact';\n\nimport { ApiChatFolder } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { FolderEditDispatch, FoldersState } from '../../../../hooks/reducers/useFoldersReducer';\n\nimport SettingsFoldersMain from './SettingsFoldersMain';\nimport SettingsFoldersEdit from './SettingsFoldersEdit';\nimport SettingsFoldersChatFilters from './SettingsFoldersChatFilters';\n\nimport './SettingsFolders.scss';\n\nconst TRANSITION_DURATION = 200;\n\nexport type OwnProps = {\n currentScreen: SettingsScreens;\n shownScreen: SettingsScreens;\n state: FoldersState;\n dispatch: FolderEditDispatch;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\nconst SettingsFolders: FC = ({\n currentScreen,\n shownScreen,\n state,\n dispatch,\n isActive,\n onScreenSelect,\n onReset,\n}) => {\n const handleReset = useCallback(() => {\n if (\n currentScreen === SettingsScreens.FoldersCreateFolder\n || currentScreen === SettingsScreens.FoldersEditFolder\n || currentScreen === SettingsScreens.FoldersEditFolderFromChatList\n ) {\n setTimeout(() => {\n dispatch({ type: 'reset' });\n }, TRANSITION_DURATION);\n }\n\n if (\n currentScreen === SettingsScreens.FoldersIncludedChats\n || currentScreen === SettingsScreens.FoldersExcludedChats\n ) {\n if (state.mode === 'create') {\n onScreenSelect(SettingsScreens.FoldersCreateFolder);\n } else {\n onScreenSelect(SettingsScreens.FoldersEditFolder);\n }\n return;\n }\n\n onReset();\n }, [\n state.mode, dispatch,\n currentScreen, onReset, onScreenSelect,\n ]);\n\n const handleCreateFolder = useCallback(() => {\n dispatch({ type: 'reset' });\n onScreenSelect(SettingsScreens.FoldersCreateFolder);\n }, [onScreenSelect, dispatch]);\n\n const handleEditFolder = useCallback((folder: ApiChatFolder) => {\n dispatch({ type: 'editFolder', payload: folder });\n onScreenSelect(SettingsScreens.FoldersEditFolder);\n }, [dispatch, onScreenSelect]);\n\n const handleAddIncludedChats = useCallback(() => {\n dispatch({ type: 'editIncludeFilters' });\n onScreenSelect(currentScreen === SettingsScreens.FoldersEditFolderFromChatList\n ? SettingsScreens.FoldersIncludedChatsFromChatList\n : SettingsScreens.FoldersIncludedChats);\n }, [currentScreen, dispatch, onScreenSelect]);\n\n const handleAddExcludedChats = useCallback(() => {\n dispatch({ type: 'editExcludeFilters' });\n onScreenSelect(currentScreen === SettingsScreens.FoldersEditFolderFromChatList\n ? SettingsScreens.FoldersExcludedChatsFromChatList\n : SettingsScreens.FoldersExcludedChats);\n }, [currentScreen, dispatch, onScreenSelect]);\n\n switch (currentScreen) {\n case SettingsScreens.Folders:\n return (\n \n );\n case SettingsScreens.FoldersCreateFolder:\n case SettingsScreens.FoldersEditFolder:\n case SettingsScreens.FoldersEditFolderFromChatList:\n return (\n \n );\n case SettingsScreens.FoldersIncludedChats:\n case SettingsScreens.FoldersIncludedChatsFromChatList:\n return (\n \n );\n case SettingsScreens.FoldersExcludedChats:\n case SettingsScreens.FoldersExcludedChatsFromChatList:\n return (\n \n );\n\n default:\n return undefined;\n }\n};\n\nexport default memo(SettingsFolders);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useCallback, useMemo, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport './RangeSlider.scss';\n\ntype OwnProps = {\n options?: string[];\n range?: { min: number; max: number; step?: number };\n label?: string;\n value: number;\n disabled?: boolean;\n onChange: (value: number) => void;\n};\n\nconst RangeSlider: FC = ({\n options,\n range,\n label,\n value,\n disabled,\n onChange,\n}) => {\n const lang = useLang();\n const handleChange = useCallback((event: ChangeEvent) => {\n onChange(Number(event.currentTarget.value));\n }, [onChange]);\n\n const className = buildClassName(\n 'RangeSlider',\n disabled && 'disabled',\n );\n\n const trackWidth = useMemo(() => {\n if (options) {\n return (value / (options.length - 1)) * 100;\n } else if (range) {\n const possibleValuesLength = (range.max - range.min) / (range.step || 1);\n return ((value - range.min) / possibleValuesLength) * 100;\n }\n return 0;\n }, [value, options, range]);\n\n const [min, max, step] = useMemo(() => {\n if (options) {\n return [0, options.length - 1, 1];\n } else if (range) {\n return [range.min, range.max, range.step || 1];\n }\n\n return [0, 0, 0];\n }, [range, options]);\n\n return (\n
\n {label && (\n
\n {label}\n {range && (\n {value}\n )}\n
\n )}\n
\n \n \n {options && (\n
\n {options.map((option, index) => (\n onChange(index)}\n >\n {option}\n
\n ))}\n
\n )}\n
\n
\n );\n};\n\nexport default memo(RangeSlider);\n","import React, { FC, memo, useRef } from '../../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiStickerSet } from '../../../api/types';\n\nimport { STICKER_SIZE_PICKER_HEADER } from '../../../config';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMedia from '../../../hooks/useMedia';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport { getFirstLetters } from '../../../util/textFormat';\n\nimport AnimatedSticker from '../../common/AnimatedSticker';\n\ntype OwnProps = {\n size?: number;\n stickerSet: ApiStickerSet;\n observeIntersection: ObserveFn;\n};\n\nconst StickerSetCoverAnimated: FC = ({\n size = STICKER_SIZE_PICKER_HEADER,\n stickerSet,\n observeIntersection,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const mediaHash = `stickerSet${stickerSet.id}`;\n const lottieData = useMedia(mediaHash, !isIntersecting, ApiMediaFormat.Lottie);\n const { shouldRenderFullMedia, transitionClassNames } = useTransitionForMedia(lottieData, 'slow');\n\n return (\n
\n {!shouldRenderFullMedia && getFirstLetters(stickerSet.title, 2)}\n {shouldRenderFullMedia && lottieData && (\n \n )}\n
\n );\n};\n\nexport default memo(StickerSetCoverAnimated);\n","import React, { FC, memo, useRef } from '../../../lib/teact/teact';\n\nimport { ApiStickerSet } from '../../../api/types';\n\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMedia from '../../../hooks/useMedia';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport { getFirstLetters } from '../../../util/textFormat';\n\ntype OwnProps = {\n stickerSet: ApiStickerSet;\n observeIntersection: ObserveFn;\n};\n\nconst StickerSetCover: FC = ({ stickerSet, observeIntersection }) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const mediaData = useMedia(stickerSet.hasThumbnail && `stickerSet${stickerSet.id}`, !isIntersecting);\n const { shouldRenderFullMedia, transitionClassNames } = useTransitionForMedia(mediaData, 'slow');\n\n return (\n
\n {!shouldRenderFullMedia && getFirstLetters(stickerSet.title, 2)}\n {shouldRenderFullMedia && (\n \"\"\n )}\n
\n );\n};\n\nexport default memo(StickerSetCover);\n","import React, {\n FC, memo,\n} from '../../../lib/teact/teact';\nimport { ApiSticker, ApiStickerSet } from '../../../api/types';\n\nimport { STICKER_SIZE_GENERAL_SETTINGS } from '../../../config';\nimport { ObserveFn } from '../../../hooks/useIntersectionObserver';\nimport useLang from '../../../hooks/useLang';\n\nimport ListItem from '../../ui/ListItem';\nimport Button from '../../ui/Button';\nimport StickerSetCoverAnimated from '../../middle/composer/StickerSetCoverAnimated';\nimport StickerSetCover from '../../middle/composer/StickerSetCover';\nimport StickerButton from '../../common/StickerButton';\n\nimport './SettingsStickerSet.scss';\n\ntype OwnProps = {\n stickerSet?: ApiStickerSet;\n observeIntersection: ObserveFn;\n onClick: (value: ApiSticker) => void;\n};\n\nconst SettingsStickerSet: FC = ({\n stickerSet,\n observeIntersection,\n onClick,\n}) => {\n const lang = useLang();\n\n if (!stickerSet || !stickerSet.stickers) {\n return undefined;\n }\n\n const firstSticker = stickerSet.stickers?.[0];\n\n if (stickerSet.hasThumbnail || !firstSticker) {\n return (\n firstSticker && onClick(firstSticker)}\n >\n \n {stickerSet.isAnimated ? (\n \n ) : (\n \n )}\n \n
\n
{stickerSet.title}
\n
{lang('StickerPack.StickerCount', stickerSet.count, 'i')}
\n
\n \n );\n } else {\n return (\n onClick(firstSticker)}\n >\n \n
\n
{stickerSet.title}
\n
{lang('StickerPack.StickerCount', stickerSet.count, 'i')}
\n
\n \n );\n }\n};\n\nexport default memo(SettingsStickerSet);\n","import React, {\n FC, useCallback, memo, useEffect, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { SettingsScreens, ISettings } from '../../../types';\nimport { ApiSticker, ApiStickerSet } from '../../../api/types';\n\nimport { IS_IOS, IS_MAC_OS, IS_TOUCH_ENV } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport RangeSlider from '../../ui/RangeSlider';\nimport Checkbox from '../../ui/Checkbox';\nimport RadioGroup from '../../ui/RadioGroup';\nimport SettingsStickerSet from './SettingsStickerSet';\nimport StickerSetModal from '../../common/StickerSetModal.async';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = Pick & {\n stickerSetIds?: string[];\n stickerSetsById?: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst ANIMATION_LEVEL_OPTIONS = [\n 'Solid and Steady',\n 'Nice and Fast',\n 'Lots of Stuff',\n];\n\nconst SettingsGeneral: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n stickerSetIds,\n stickerSetsById,\n messageTextSize,\n animationLevel,\n messageSendKeyCombo,\n shouldAutoDownloadMediaFromContacts,\n shouldAutoDownloadMediaInPrivateChats,\n shouldAutoDownloadMediaInGroups,\n shouldAutoDownloadMediaInChannels,\n shouldAutoPlayGifs,\n shouldAutoPlayVideos,\n shouldSuggestStickers,\n shouldLoopStickers,\n setSettingOption,\n loadStickerSets,\n loadAddedStickers,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const stickerSettingsRef = useRef(null);\n const { observe: observeIntersectionForCovers } = useIntersectionObserver({ rootRef: stickerSettingsRef });\n const [isModalOpen, openModal, closeModal] = useFlag();\n const [sticker, setSticker] = useState();\n\n const lang = useLang();\n\n const KEYBOARD_SEND_OPTIONS = !IS_TOUCH_ENV ? [\n { value: 'enter', label: lang('lng_settings_send_enter'), subLabel: 'New line by Shift + Enter' },\n {\n value: 'ctrl-enter',\n label: lang(IS_MAC_OS ? 'lng_settings_send_cmdenter' : 'lng_settings_send_ctrlenter'),\n subLabel: 'New line by Enter',\n },\n ] : undefined;\n\n useEffect(() => {\n loadStickerSets();\n }, [loadStickerSets]);\n\n useEffect(() => {\n if (stickerSetIds?.length) {\n loadAddedStickers();\n }\n }, [stickerSetIds, loadAddedStickers]);\n\n const handleAnimationLevelChange = useCallback((newLevel: number) => {\n ANIMATION_LEVEL_OPTIONS.forEach((_, i) => {\n document.body.classList.toggle(`animation-level-${i}`, newLevel === i);\n });\n\n setSettingOption({ animationLevel: newLevel });\n }, [setSettingOption]);\n\n const handleMessageTextSizeChange = useCallback((newSize: number) => {\n document.documentElement.style.setProperty(\n '--composer-text-size', `${Math.max(newSize, IS_IOS ? 16 : 15)}px`,\n );\n document.documentElement.style.setProperty('--message-meta-height', `${Math.floor(newSize * 1.3125)}px`);\n document.documentElement.style.setProperty('--message-text-size', `${newSize}px`);\n document.documentElement.setAttribute('data-message-text-size', newSize.toString());\n\n setSettingOption({ messageTextSize: newSize });\n }, [setSettingOption]);\n\n const handleStickerSetClick = useCallback((value: ApiSticker) => {\n setSticker(value);\n openModal();\n }, [openModal]);\n\n const stickerSets = stickerSetIds && stickerSetIds.map((id: string) => {\n return stickerSetsById?.[id]?.installedDate ? stickerSetsById[id] : false;\n }).filter(Boolean as any);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.General);\n\n return (\n
\n
\n

{lang('SETTINGS')}

\n\n \n\n onScreenSelect(SettingsScreens.GeneralChatBackground)}\n >\n {lang('ChatBackground')}\n \n
\n\n
\n

\n Animation Level\n

\n

\n Choose the desired animations amount.\n

\n\n \n
\n\n {KEYBOARD_SEND_OPTIONS && (\n
\n

{lang('VoiceOver.Keyboard')}

\n\n setSettingOption({ messageSendKeyCombo: value })}\n selected={messageSendKeyCombo}\n />\n
\n )}\n\n
\n

{lang('AutoDownloadMedia')}

\n\n setSettingOption({ shouldAutoDownloadMediaFromContacts: isChecked })}\n />\n setSettingOption({ shouldAutoDownloadMediaInPrivateChats: isChecked })}\n />\n setSettingOption({ shouldAutoDownloadMediaInGroups: isChecked })}\n />\n setSettingOption({ shouldAutoDownloadMediaInChannels: isChecked })}\n />\n
\n\n
\n

{lang('AutoplayMedia')}

\n\n setSettingOption({ shouldAutoPlayGifs: isChecked })}\n />\n setSettingOption({ shouldAutoPlayVideos: isChecked })}\n />\n
\n\n
\n

{lang('AccDescrStickers')}

\n\n setSettingOption({ shouldSuggestStickers: isChecked })}\n />\n setSettingOption({ shouldLoopStickers: isChecked })}\n />\n\n
\n {stickerSets && stickerSets.map((stickerSet: ApiStickerSet) => (\n \n ))}\n
\n {sticker && (\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n ...pick(global.settings.byKey, [\n 'messageTextSize',\n 'animationLevel',\n 'messageSendKeyCombo',\n 'shouldAutoDownloadMediaFromContacts',\n 'shouldAutoDownloadMediaInPrivateChats',\n 'shouldAutoDownloadMediaInGroups',\n 'shouldAutoDownloadMediaInChannels',\n 'shouldAutoPlayGifs',\n 'shouldAutoPlayVideos',\n 'shouldSuggestStickers',\n 'shouldLoopStickers',\n 'isSensitiveEnabled',\n 'canChangeSensitive',\n ]),\n stickerSetIds: global.stickers.added.setIds,\n stickerSetsById: global.stickers.setsById,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setSettingOption', 'loadStickerSets', 'loadAddedStickers',\n ]),\n)(SettingsGeneral));\n","let fileSelector: HTMLInputElement;\n\nexport function openSystemFilesDialog(accept = '*', callback: (e: Event) => void, noMultiple = false) {\n if (!fileSelector) {\n fileSelector = document.createElement('input');\n fileSelector.setAttribute('type', 'file');\n }\n\n fileSelector.setAttribute('accept', accept);\n\n if (noMultiple) {\n fileSelector.removeAttribute('multiple');\n } else {\n fileSelector.setAttribute('multiple', 'multiple');\n }\n\n // eslint-disable-next-line no-null/no-null\n fileSelector.onchange = null;\n fileSelector.value = '';\n fileSelector.onchange = callback;\n\n fileSelector.click();\n}\n","/* eslint-disable eqeqeq */\n/* eslint-disable prefer-template */\n/* eslint-disable prefer-const */\n/* eslint-disable prefer-destructuring */\n/* eslint-disable one-var */\n/* eslint-disable one-var-declaration-per-line */\n\nimport { preloadImage } from './files';\n\n/**\n * HEX > RGB\n * input: 'xxxxxx' (ex. 'ed15fa') case-insensitive\n * output: [r, g, b] ([0-255, 0-255, 0-255])\n */\nexport function hex2rgb(param: string): [number, number, number] {\n return [\n parseInt(param.substring(0, 2), 16),\n parseInt(param.substring(2, 4), 16),\n parseInt(param.substring(4, 6), 16),\n ];\n}\n\n/**\n * RGB > HEX\n * input: [r, g, b] ([0-255, 0-255, 0-255])\n * output: 'xxxxxx' (ex. 'ff0000')\n */\nexport function rgb2hex(param: [number, number, number]) {\n const p0 = param[0].toString(16);\n const p1 = param[1].toString(16);\n const p2 = param[2].toString(16);\n return (p0.length == 1 ? '0' + p0 : p0) + (p1.length == 1 ? '0' + p1 : p1) + (p2.length == 1 ? '0' + p2 : p2);\n}\n\n/**\n * Converts an RGB color value to HSV. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\n * Assumes r, g, and b are contained in the set [0, 255] and\n * returns h, s, and v in the set [0, 1].\n *\n * @param Number r The red color value\n * @param Number g The green color value\n * @param Number b The blue color value\n * @return Array The HSV representation\n */\nexport function rgb2hsb([r, g, b]: [number, number, number]): [number, number, number] {\n r /= 255;\n g /= 255;\n b /= 255;\n\n let max = Math.max(r, g, b), min = Math.min(r, g, b);\n let h!: number, s: number, v: number = max;\n\n let d = max - min;\n s = max == 0 ? 0 : d / max;\n\n if (max == min) {\n h = 0; // achromatic\n } else {\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n\n h /= 6;\n }\n\n return [h, s, v];\n}\n\n/**\n * Converts an HSV color value to RGB. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\n * Assumes h, s, and v are contained in the set [0, 1] and\n * returns r, g, and b in the set [0, 255].\n *\n * @param Number h The hue\n * @param Number s The saturation\n * @param Number v The value\n * @return Array The RGB representation\n */\nexport function hsb2rgb([h, s, v]: [number, number, number]): [number, number, number] {\n let r!: number, g!: number, b!: number;\n\n let i = Math.floor(h * 6);\n let f = h * 6 - i;\n let p = v * (1 - s);\n let q = v * (1 - f * s);\n let t = v * (1 - (1 - f) * s);\n\n switch (i % 6) {\n case 0:\n r = v;\n g = t;\n b = p;\n break;\n case 1:\n r = q;\n g = v;\n b = p;\n break;\n case 2:\n r = p;\n g = v;\n b = t;\n break;\n case 3:\n r = p;\n g = q;\n b = v;\n break;\n case 4:\n r = t;\n g = p;\n b = v;\n break;\n case 5:\n r = v;\n g = p;\n b = q;\n break;\n }\n\n return [\n Math.round(r * 255),\n Math.round(g * 255),\n Math.round(b * 255),\n ];\n}\n\nexport async function getAverageColor(url: string): Promise<[number, number, number]> {\n // Only visit every 5 pixels\n const blockSize = 5;\n const defaultRGB: [number, number, number] = [0, 0, 0];\n let data;\n let width;\n let height;\n let i = -4;\n let length;\n let rgb: [number, number, number] = [0, 0, 0];\n let count = 0;\n\n const canvas = document.createElement('canvas');\n const context = canvas.getContext && canvas.getContext('2d');\n if (!context) {\n return defaultRGB;\n }\n\n const image = await preloadImage(url);\n height = image.naturalHeight || image.offsetHeight || image.height;\n width = image.naturalWidth || image.offsetWidth || image.width;\n canvas.height = height;\n canvas.width = width;\n\n context.drawImage(image, 0, 0);\n\n try {\n data = context.getImageData(0, 0, width, height);\n } catch (e) {\n return defaultRGB;\n }\n\n length = data.data.length;\n\n // eslint-disable-next-line no-cond-assign\n while ((i += blockSize * 4) < length) {\n ++count;\n rgb[0] += data.data[i];\n rgb[1] += data.data[i + 1];\n rgb[2] += data.data[i + 2];\n }\n\n rgb[0] = Math.floor(rgb[0] / count);\n rgb[1] = Math.floor(rgb[1] / count);\n rgb[2] = Math.floor(rgb[2] / count);\n\n return rgb;\n}\n\n// eslint-disable-next-line max-len\n// Function was adapted from https://github.com/telegramdesktop/tdesktop/blob/35ff621b5b52f7e3553fb0f990ea13ade7101b8e/Telegram/SourceFiles/data/data_wall_paper.cpp#L518\nexport function getPatternColor(rgbColor: [number, number, number]) {\n let [hue, saturation, value] = rgb2hsb(rgbColor);\n\n saturation = Math.min(1, saturation + 0.05 + 0.1 * (1 - saturation));\n value = value > 0.5\n ? Math.max(0, value * 0.65)\n : Math.max(0, Math.min(1, 1 - value * 0.65));\n\n return `hsla(${hue * 360}, ${saturation * 100}%, ${value * 100}%, .4)`;\n}\n","import React, {\n FC, memo, useCallback, useEffect, useState, useRef,\n} from '../../../lib/teact/teact';\nimport { ApiWallpaper } from '../../../api/types';\nimport { ThemeKey, UPLOADING_WALLPAPER_SLUG } from '../../../types';\n\nimport { CUSTOM_BG_CACHE_NAME } from '../../../config';\nimport * as cacheApi from '../../../util/cacheApi';\nimport { fetchBlob } from '../../../util/files';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport buildClassName from '../../../util/buildClassName';\nimport useMedia from '../../../hooks/useMedia';\nimport useMediaWithDownloadProgress from '../../../hooks/useMediaWithDownloadProgress';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useCanvasBlur from '../../../hooks/useCanvasBlur';\n\nimport ProgressSpinner from '../../ui/ProgressSpinner';\n\nimport './WallpaperTile.scss';\n\ntype OwnProps = {\n wallpaper: ApiWallpaper;\n theme: ThemeKey;\n isSelected: boolean;\n onClick: (slug: string) => void;\n};\n\nconst WallpaperTile: FC = ({\n wallpaper,\n theme,\n isSelected,\n onClick,\n}) => {\n const { slug, document } = wallpaper;\n const localMediaHash = `wallpaper${document.id!}`;\n const localBlobUrl = document.previewBlobUrl;\n const previewBlobUrl = useMedia(`${localMediaHash}?size=m`);\n const thumbRef = useCanvasBlur(\n document.thumbnail?.dataUri,\n Boolean(previewBlobUrl),\n true,\n );\n const {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(previewBlobUrl || localBlobUrl, 'slow');\n const [isDownloadAllowed, setIsDownloadAllowed] = useState(false);\n const {\n mediaData: fullMedia, downloadProgress,\n } = useMediaWithDownloadProgress(localMediaHash, !isDownloadAllowed);\n const wasDownloadDisabled = usePrevious(isDownloadAllowed) === false;\n const { shouldRender: shouldRenderSpinner, transitionClassNames: spinnerClassNames } = useShowTransition(\n (isDownloadAllowed && !fullMedia) || slug === UPLOADING_WALLPAPER_SLUG,\n undefined,\n wasDownloadDisabled,\n 'slow',\n );\n // To prevent triggering of the effect for useCallback\n const cacheKeyRef = useRef();\n cacheKeyRef.current = theme;\n\n const handleSelect = useCallback(() => {\n (async () => {\n const blob = await fetchBlob(fullMedia!);\n await cacheApi.save(CUSTOM_BG_CACHE_NAME, cacheKeyRef.current!, blob);\n onClick(slug);\n })();\n }, [fullMedia, onClick, slug]);\n\n useEffect(() => {\n if (fullMedia) {\n handleSelect();\n }\n }, [fullMedia, handleSelect]);\n\n const handleClick = useCallback(() => {\n if (fullMedia) {\n handleSelect();\n } else {\n setIsDownloadAllowed((isAllowed) => !isAllowed);\n }\n }, [fullMedia, handleSelect]);\n\n const className = buildClassName(\n 'WallpaperTile',\n isSelected && 'selected',\n );\n\n return (\n
\n
\n {shouldRenderThumb && (\n \n )}\n {shouldRenderFullMedia && (\n \n )}\n {shouldRenderSpinner && (\n
\n \n
\n )}\n
\n
\n );\n};\n\nexport default memo(WallpaperTile);\n","import React, {\n FC, memo, useEffect, useCallback, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { SettingsScreens, ThemeKey, UPLOADING_WALLPAPER_SLUG } from '../../../types';\nimport { ApiWallpaper } from '../../../api/types';\n\nimport { DARK_THEME_PATTERN_COLOR, DEFAULT_PATTERN_COLOR } from '../../../config';\nimport { pick } from '../../../util/iteratees';\nimport { throttle } from '../../../util/schedulers';\nimport { openSystemFilesDialog } from '../../../util/systemFilesDialog';\nimport { getAverageColor, getPatternColor, rgb2hex } from '../../../util/colors';\nimport { selectTheme } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport Loading from '../../ui/Loading';\nimport WallpaperTile from './WallpaperTile';\n\nimport './SettingsGeneralBackground.scss';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n background?: string;\n isBlurred?: boolean;\n loadedWallpapers?: ApiWallpaper[];\n theme: ThemeKey;\n};\n\ntype DispatchProps = Pick;\n\nconst SUPPORTED_TYPES = 'image/jpeg';\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst SettingsGeneralBackground: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n background,\n isBlurred,\n loadedWallpapers,\n theme,\n loadWallpapers,\n uploadWallpaper,\n setThemeSettings,\n}) => {\n const themeRef = useRef();\n themeRef.current = theme;\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadWallpapers();\n });\n }, [loadWallpapers]);\n\n const handleFileSelect = useCallback((e: Event) => {\n const { files } = e.target as HTMLInputElement;\n\n if (files && files.length > 0) {\n uploadWallpaper(files[0]);\n }\n }, [uploadWallpaper]);\n\n const handleUploadWallpaper = useCallback(() => {\n openSystemFilesDialog(SUPPORTED_TYPES, handleFileSelect, true);\n }, [handleFileSelect]);\n\n const handleSetColor = useCallback(() => {\n onScreenSelect(SettingsScreens.GeneralChatBackgroundColor);\n }, [onScreenSelect]);\n\n const handleResetToDefault = useCallback(() => {\n setThemeSettings({\n theme,\n background: undefined,\n backgroundColor: undefined,\n isBlurred: true,\n patternColor: theme === 'dark' ? DARK_THEME_PATTERN_COLOR : DEFAULT_PATTERN_COLOR,\n });\n }, [setThemeSettings, theme]);\n\n const handleWallPaperSelect = useCallback((slug: string) => {\n setThemeSettings({ theme: themeRef.current, background: slug });\n const currentWallpaper = loadedWallpapers && loadedWallpapers.find((wallpaper) => wallpaper.slug === slug);\n if (currentWallpaper?.document.thumbnail) {\n getAverageColor(currentWallpaper.document.thumbnail.dataUri)\n .then((color) => {\n const patternColor = getPatternColor(color);\n const rgbColor = `#${rgb2hex(color)}`;\n setThemeSettings({ theme: themeRef.current, backgroundColor: rgbColor, patternColor });\n });\n }\n }, [loadedWallpapers, setThemeSettings]);\n\n const handleWallPaperBlurChange = useCallback((e: React.ChangeEvent) => {\n setThemeSettings({ theme: themeRef.current, isBlurred: e.target.checked });\n }, [setThemeSettings]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.GeneralChatBackground);\n\n const isUploading = loadedWallpapers?.[0] && loadedWallpapers[0].slug === UPLOADING_WALLPAPER_SLUG;\n\n return (\n
\n
\n \n {lang('UploadImage')}\n \n\n \n {lang('SetColor')}\n \n\n \n {lang('ThemeResetToDefaults')}\n \n\n \n
\n\n {loadedWallpapers ? (\n
\n {loadedWallpapers.map((wallpaper) => (\n \n ))}\n
\n ) : (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const theme = selectTheme(global);\n const { background, isBlurred } = global.settings.themes[theme] || {};\n const { loadedWallpapers } = global.settings;\n\n return {\n background,\n isBlurred,\n loadedWallpapers,\n theme,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadWallpapers', 'uploadWallpaper', 'setThemeSettings',\n ]),\n)(SettingsGeneralBackground));\n","import { ChangeEvent, MutableRefObject, RefObject } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { SettingsScreens, ThemeKey } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport {\n getPatternColor, hex2rgb, hsb2rgb, rgb2hex, rgb2hsb,\n} from '../../../util/colors';\nimport { captureEvents, RealTouchEvent } from '../../../util/captureEvents';\nimport { selectTheme } from '../../../modules/selectors';\nimport useFlag from '../../../hooks/useFlag';\nimport buildClassName from '../../../util/buildClassName';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport InputText from '../../ui/InputText';\n\nimport './SettingsGeneralBackgroundColor.scss';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n backgroundColor?: string;\n theme: ThemeKey;\n};\n\ntype DispatchProps = Pick;\n\ninterface CanvasRects {\n colorRect: {\n offsetLeft: number;\n top: number;\n width: number;\n height: number;\n };\n hueRect: {\n offsetLeft: number;\n width: number;\n };\n}\n\nconst DEFAULT_HSB = rgb2hsb(hex2rgb('e6ebee'));\nconst PREDEFINED_COLORS = [\n '#e6ebee', '#b2cee1', '#008dd0', '#c6e7cb', '#c4e1a6', '#60b16e',\n '#ccd0af', '#a6a997', '#7a7072', '#fdd7af', '#fdb76e', '#dd8851',\n];\n\nconst SettingsGeneralBackground: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n theme,\n backgroundColor,\n setThemeSettings,\n}) => {\n const themeRef = useRef();\n themeRef.current = theme;\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const colorPickerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const huePickerRef = useRef(null);\n const isFirstRunRef = useRef(true);\n\n const [hsb, setHsb] = useState(getInitialHsb(backgroundColor));\n // Cache for drag handlers\n const hsbRef = useRef(hsb);\n useEffect(() => {\n hsbRef.current = hsb;\n }, [hsb]);\n\n const [isDragging, markIsDragging, unmarkIsDragging] = useFlag();\n const [rgbInput, setRgbInput] = useState('');\n const [hexInput, setHexInput] = useState('');\n\n const rectsRef = useRef();\n const colorCtxRef = useRef();\n\n // Setup: cache rects, subscribe for drag events\n useEffect(() => {\n // We use `offsetLeft` instead of `left` to support screen transition\n const colorRect = {\n offsetLeft: colorPickerRef.current!.offsetLeft,\n ...pick(colorPickerRef.current!.getBoundingClientRect(), ['top', 'width', 'height']),\n };\n const hueRect = {\n offsetLeft: huePickerRef.current!.offsetLeft,\n ...pick(huePickerRef.current!.getBoundingClientRect(), ['width']),\n };\n\n rectsRef.current = { colorRect, hueRect };\n\n function handleColorDrag(e: MouseEvent | RealTouchEvent) {\n const colorPosition = [\n Math.min(Math.max(0, e.pageX! - colorRect.offsetLeft), colorRect.width - 1),\n Math.min(Math.max(0, e.pageY! - colorRect.top + containerRef.current!.scrollTop), colorRect.height - 1),\n ];\n\n const { huePosition } = hsb2positions(hsbRef.current, rectsRef.current!);\n\n setHsb(positions2hsb({ colorPosition, huePosition }, rectsRef.current!));\n markIsDragging();\n\n return true;\n }\n\n captureEvents(colorPickerRef.current!, {\n onCapture: handleColorDrag,\n onDrag: handleColorDrag,\n onRelease: unmarkIsDragging,\n onClick: unmarkIsDragging,\n selectorToPreventScroll: '.SettingsGeneralBackgroundColor',\n withCursor: true,\n });\n\n function handleHueDrag(e: MouseEvent | RealTouchEvent) {\n const { colorPosition } = hsb2positions(hsbRef.current, rectsRef.current!);\n const huePosition = Math.min(Math.max(0, e.pageX! - hueRect.offsetLeft), hueRect.width - 1);\n\n setHsb(positions2hsb({ colorPosition, huePosition }, rectsRef.current!));\n markIsDragging();\n\n return true;\n }\n\n captureEvents(huePickerRef.current!, {\n onCapture: handleHueDrag,\n onDrag: handleHueDrag,\n onRelease: unmarkIsDragging,\n onClick: unmarkIsDragging,\n selectorToPreventScroll: '.SettingsGeneralBackgroundColor',\n withCursor: true,\n });\n }, [markIsDragging, unmarkIsDragging]);\n\n const { colorPosition = [0, 0], huePosition = 0 } = rectsRef.current ? hsb2positions(hsb, rectsRef.current) : {};\n const hex = rgb2hex(hsb2rgb(hsb));\n const hue = hsb[0];\n const hueHex = rgb2hex(hsb2rgb([hue, 1, 1]));\n\n // Save value and update inputs when HSL changes\n useEffect(() => {\n const rgb = hsb2rgb(hsb);\n const color = `#${rgb2hex(rgb)}`;\n\n setRgbInput(rgb.join(', '));\n setHexInput(color);\n\n if (!isFirstRunRef.current) {\n const patternColor = getPatternColor(rgb);\n setThemeSettings({\n theme: themeRef.current,\n background: undefined,\n backgroundColor: color,\n patternColor,\n });\n }\n isFirstRunRef.current = false;\n }, [hsb, setThemeSettings]);\n\n // Redraw color picker when hue changes\n useEffect(() => {\n drawColor(colorPickerRef.current!.firstChild as HTMLCanvasElement, hue, colorCtxRef, rectsRef);\n }, [hue]);\n\n // Initially draw hue picker\n useEffect(() => {\n drawHue(huePickerRef.current!.firstChild as HTMLCanvasElement);\n }, []);\n\n const handleRgbChange = useCallback((e: ChangeEvent) => {\n const rgbValue = e.currentTarget.value.replace(/[^\\d, ]/g, '').slice(0, 13);\n\n if (rgbValue.match(/^\\d{1,3},\\s?\\d{1,3},\\s?\\d{1,3}$/)) {\n const rgb = rgbValue.split(',').map((channel) => Number(channel.trim())) as [number, number, number];\n setHsb(rgb2hsb(rgb));\n }\n\n e.currentTarget.value = rgbValue;\n }, []);\n\n const handleHexChange = useCallback((e: ChangeEvent) => {\n const hexValue = e.currentTarget.value.replace(/[^0-9a-fA-F]/g, '').slice(0, 6);\n\n if (hexValue.match(/^#?[0-9a-fA-F]{6}$/)) {\n setHsb(rgb2hsb(hex2rgb(hexValue.replace('#', ''))));\n }\n\n e.currentTarget.value = hexValue;\n }, []);\n\n const handlePredefinedColorClick = useCallback((e: React.MouseEvent) => {\n setHsb(rgb2hsb(hex2rgb(e.currentTarget.dataset.color!.replace('#', ''))));\n }, []);\n\n const className = buildClassName(\n 'SettingsGeneralBackgroundColor settings-content custom-scroll',\n isDragging && 'is-dragging',\n );\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.GeneralChatBackgroundColor);\n\n return (\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n {PREDEFINED_COLORS.map((color) => (\n \n ))}\n
\n
\n );\n};\n\nfunction getInitialHsb(backgroundColor?: string) {\n return backgroundColor && backgroundColor.startsWith('#')\n ? rgb2hsb(hex2rgb(backgroundColor.replace('#', '')))\n : DEFAULT_HSB;\n}\n\nfunction hsb2positions(hsb: [number, number, number], rects: CanvasRects) {\n return {\n colorPosition: [\n Math.round((hsb[1]) * (rects.colorRect.width - 1)),\n Math.round((1 - hsb[2]) * (rects.colorRect.height - 1)),\n ],\n huePosition: Math.round(hsb[0] * (rects.hueRect.width - 1)),\n };\n}\n\nfunction positions2hsb(\n { colorPosition, huePosition }: { colorPosition: number[]; huePosition: number },\n rects: CanvasRects,\n): [number, number, number] {\n return [\n huePosition / (rects.hueRect.width - 1),\n colorPosition[0] / (rects.colorRect.width - 1),\n 1 - colorPosition[1] / (rects.colorRect.height - 1),\n ];\n}\n\nfunction drawColor(\n canvas: HTMLCanvasElement,\n hue: number,\n colorCtxRef: MutableRefObject,\n rectsRef: RefObject,\n) {\n let w: number;\n let h: number;\n let ctx: CanvasRenderingContext2D;\n\n if (!colorCtxRef.current || !rectsRef.current) {\n // First run\n w = canvas.offsetWidth;\n h = canvas.offsetHeight;\n ctx = canvas.getContext('2d')!;\n\n canvas.width = w;\n canvas.height = h;\n\n colorCtxRef.current = ctx;\n } else {\n w = rectsRef.current.colorRect.width;\n h = rectsRef.current.colorRect.height;\n ctx = colorCtxRef.current;\n }\n\n const imgData = ctx!.createImageData(w, h);\n const pixels = imgData.data;\n const col = hsb2rgb([hue, 1, 1]);\n\n let index = 0;\n\n for (let y = 0; y < h; y++) {\n const perY = 1 - y / (h - 1);\n const st = [255 * perY, 255 * perY, 255 * perY];\n const ed = [col[0] * perY, col[1] * perY, col[2] * perY];\n for (let x = 0; x < w; x++) {\n const perX = x / (w - 1);\n pixels[index++] = st[0] + (ed[0] - st[0]) * perX;\n pixels[index++] = st[1] + (ed[1] - st[1]) * perX;\n pixels[index++] = st[2] + (ed[2] - st[2]) * perX;\n pixels[index++] = 255;\n }\n }\n\n ctx!.putImageData(imgData, 0, 0);\n}\n\nfunction drawHue(canvas: HTMLCanvasElement) {\n const w = canvas.offsetWidth;\n const h = 1;\n canvas.width = w;\n canvas.height = h;\n const ctx = canvas.getContext('2d')!;\n\n const imgData = ctx.createImageData(w, h);\n const pixels = imgData.data;\n\n let index = 0;\n\n for (let x = 0; x < w; x++) {\n const hue = x / (w - 1);\n const rgb = hsb2rgb([hue, 1, 1]);\n /* eslint-disable prefer-destructuring */\n pixels[index++] = rgb[0];\n pixels[index++] = rgb[1];\n pixels[index++] = rgb[2];\n /* eslint-enable prefer-destructuring */\n pixels[index++] = 255;\n }\n\n ctx.putImageData(imgData, 0, 0);\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const theme = selectTheme(global);\n const { backgroundColor } = global.settings.themes[theme] || {};\n return {\n backgroundColor,\n theme,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['setThemeSettings']),\n)(SettingsGeneralBackground));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport Checkbox from '../../ui/Checkbox';\nimport RangeSlider from '../../ui/RangeSlider';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n hasPrivateChatsNotifications: boolean;\n hasPrivateChatsMessagePreview: boolean;\n hasGroupNotifications: boolean;\n hasGroupMessagePreview: boolean;\n hasBroadcastNotifications: boolean;\n hasBroadcastMessagePreview: boolean;\n hasContactJoinedNotifications: boolean;\n hasWebNotifications: boolean;\n hasPushNotifications: boolean;\n notificationSoundVolume: number;\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsNotifications: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n hasPrivateChatsNotifications,\n hasPrivateChatsMessagePreview,\n hasGroupNotifications,\n hasGroupMessagePreview,\n hasBroadcastNotifications,\n hasBroadcastMessagePreview,\n hasContactJoinedNotifications,\n hasPushNotifications,\n hasWebNotifications,\n notificationSoundVolume,\n loadNotificationSettings,\n updateContactSignUpNotification,\n updateNotificationSettings,\n updateWebNotificationSettings,\n}) => {\n useEffect(() => {\n loadNotificationSettings();\n }, [loadNotificationSettings]);\n\n const handleSettingsChange = useCallback((\n e: ChangeEvent,\n peerType: 'contact' | 'group' | 'broadcast',\n setting: 'silent' | 'showPreviews',\n ) => {\n const currentIsSilent = peerType === 'contact'\n ? !hasPrivateChatsNotifications\n : !(peerType === 'group' ? hasGroupNotifications : hasBroadcastNotifications);\n const currentShouldShowPreviews = peerType === 'contact'\n ? hasPrivateChatsMessagePreview\n : (peerType === 'group' ? hasGroupMessagePreview : hasBroadcastMessagePreview);\n\n updateNotificationSettings({\n peerType,\n ...(setting === 'silent' && { isSilent: !e.target.checked, shouldShowPreviews: currentShouldShowPreviews }),\n ...(setting === 'showPreviews' && { shouldShowPreviews: e.target.checked, isSilent: currentIsSilent }),\n });\n }, [\n hasBroadcastMessagePreview, hasBroadcastNotifications,\n hasGroupMessagePreview, hasGroupNotifications,\n hasPrivateChatsMessagePreview, hasPrivateChatsNotifications,\n updateNotificationSettings,\n ]);\n\n const handleContactNotificationChange = useCallback((e: ChangeEvent) => {\n updateContactSignUpNotification({\n isSilent: !e.target.checked,\n });\n }, [updateContactSignUpNotification]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Notifications);\n\n return (\n
\n
\n

\n Web notifications\n

\n {\n updateWebNotificationSettings({ hasWebNotifications: e.target.checked });\n }}\n />\n {\n updateWebNotificationSettings({ hasPushNotifications: e.target.checked });\n }}\n />\n
\n {\n updateWebNotificationSettings({ notificationSoundVolume: volume });\n }}\n />\n
\n
\n
\n

\n {lang('AutodownloadPrivateChats')}\n

\n\n { handleSettingsChange(e, 'contact', 'silent'); }}\n />\n { handleSettingsChange(e, 'contact', 'showPreviews'); }}\n />\n
\n\n
\n

{lang('FilterGroups')}

\n\n { handleSettingsChange(e, 'group', 'silent'); }}\n />\n { handleSettingsChange(e, 'group', 'showPreviews'); }}\n />\n
\n\n
\n

{lang('FilterChannels')}

\n\n { handleSettingsChange(e, 'broadcast', 'silent'); }}\n />\n { handleSettingsChange(e, 'broadcast', 'showPreviews'); }}\n />\n
\n\n
\n

{lang('PhoneOther')}

\n\n \n
\n
\n );\n};\n\nexport default memo(withGlobal((global): StateProps => {\n return {\n hasPrivateChatsNotifications: Boolean(global.settings.byKey.hasPrivateChatsNotifications),\n hasPrivateChatsMessagePreview: Boolean(global.settings.byKey.hasPrivateChatsMessagePreview),\n hasGroupNotifications: Boolean(global.settings.byKey.hasGroupNotifications),\n hasGroupMessagePreview: Boolean(global.settings.byKey.hasGroupMessagePreview),\n hasBroadcastNotifications: Boolean(global.settings.byKey.hasBroadcastNotifications),\n hasBroadcastMessagePreview: Boolean(global.settings.byKey.hasBroadcastMessagePreview),\n hasContactJoinedNotifications: Boolean(global.settings.byKey.hasContactJoinedNotifications),\n hasWebNotifications: global.settings.byKey.hasWebNotifications,\n hasPushNotifications: global.settings.byKey.hasPushNotifications,\n notificationSoundVolume: global.settings.byKey.notificationSoundVolume,\n };\n},\n(setGlobal, actions): DispatchProps => pick(actions, [\n 'loadNotificationSettings',\n 'updateContactSignUpNotification',\n 'updateNotificationSettings',\n 'updateWebNotificationSettings',\n]))(SettingsNotifications));\n","import React, { FC, memo, useEffect } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { PrivacyVisibility, SettingsScreens } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n hasPassword?: boolean;\n blockedCount: number;\n sessionsCount: number;\n isSensitiveEnabled?: boolean;\n canChangeSensitive?: boolean;\n visibilityPrivacyPhoneNumber?: PrivacyVisibility;\n visibilityPrivacyLastSeen?: PrivacyVisibility;\n visibilityPrivacyProfilePhoto?: PrivacyVisibility;\n visibilityPrivacyForwarding?: PrivacyVisibility;\n visibilityPrivacyGroupChats?: PrivacyVisibility;\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsPrivacy: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n hasPassword,\n blockedCount,\n sessionsCount,\n isSensitiveEnabled,\n canChangeSensitive,\n visibilityPrivacyPhoneNumber,\n visibilityPrivacyLastSeen,\n visibilityPrivacyProfilePhoto,\n visibilityPrivacyForwarding,\n visibilityPrivacyGroupChats,\n loadPrivacySettings,\n loadBlockedContacts,\n loadAuthorizations,\n loadContentSettings,\n updateContentSettings,\n}) => {\n useEffect(() => {\n loadBlockedContacts();\n loadAuthorizations();\n loadPrivacySettings();\n loadContentSettings();\n }, [loadBlockedContacts, loadAuthorizations, loadPrivacySettings, loadContentSettings]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Privacy);\n\n function getVisibilityValue(visibility?: PrivacyVisibility) {\n switch (visibility) {\n case 'everybody':\n return lang('P2PEverybody');\n\n case 'contacts':\n return lang('P2PContacts');\n\n case 'nobody':\n return lang('P2PNobody');\n }\n\n return undefined;\n }\n\n return (\n
\n
\n onScreenSelect(SettingsScreens.PrivacyBlockedUsers)}\n >\n
\n {lang('BlockedUsers')}\n {blockedCount > 0 && (\n \n {lang('Users', blockedCount)}\n \n )}\n
\n \n onScreenSelect(\n hasPassword ? SettingsScreens.TwoFaEnabled : SettingsScreens.TwoFaDisabled,\n )}\n >\n
\n {lang('TwoStepVerification')}\n \n {lang(hasPassword ? 'PasswordOn' : 'PasswordOff')}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyActiveSessions)}\n >\n
\n {lang('SessionsTitle')}\n {sessionsCount > 0 && (\n \n {sessionsCount === 1 ? '1 session' : `${sessionsCount} sessions`}\n \n )}\n
\n \n
\n\n
\n

{lang('PrivacyTitle')}

\n\n onScreenSelect(SettingsScreens.PrivacyPhoneNumber)}\n >\n
\n {lang('PrivacyPhoneTitle')}\n \n {getVisibilityValue(visibilityPrivacyPhoneNumber)}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyLastSeen)}\n >\n
\n {lang('LastSeenTitle')}\n \n {getVisibilityValue(visibilityPrivacyLastSeen)}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyProfilePhoto)}\n >\n
\n {lang('PrivacyProfilePhotoTitle')}\n \n {getVisibilityValue(visibilityPrivacyProfilePhoto)}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyForwarding)}\n >\n
\n {lang('PrivacyForwardsTitle')}\n \n {getVisibilityValue(visibilityPrivacyForwarding)}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyGroupChats)}\n >\n
\n {lang('WhoCanAddMe')}\n \n {getVisibilityValue(visibilityPrivacyGroupChats)}\n \n
\n \n
\n\n {canChangeSensitive && (\n
\n

\n {lang('lng_settings_sensitive_title')}\n

\n \n
\n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n settings: {\n byKey: { hasPassword, isSensitiveEnabled, canChangeSensitive },\n privacy,\n },\n blocked,\n activeSessions,\n } = global;\n\n return {\n hasPassword,\n blockedCount: blocked.totalCount,\n sessionsCount: activeSessions.length,\n isSensitiveEnabled,\n canChangeSensitive,\n visibilityPrivacyPhoneNumber: privacy.phoneNumber?.visibility,\n visibilityPrivacyLastSeen: privacy.lastSeen?.visibility,\n visibilityPrivacyProfilePhoto: privacy.profilePhoto?.visibility,\n visibilityPrivacyForwarding: privacy.forwards?.visibility,\n visibilityPrivacyGroupChats: privacy.chatInvite?.visibility,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadBlockedContacts', 'loadAuthorizations', 'loadPrivacySettings', 'loadContentSettings', 'updateContentSettings',\n ]),\n)(SettingsPrivacy));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ISettings, LangCode, SettingsScreens } from '../../../types';\nimport { ApiLanguage } from '../../../api/types';\n\nimport { setLanguage } from '../../../util/langProvider';\nimport { pick } from '../../../util/iteratees';\n\nimport RadioGroup from '../../ui/RadioGroup';\nimport Loading from '../../ui/Loading';\nimport useFlag from '../../../hooks/useFlag';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = Pick;\n\ntype DispatchProps = Pick;\n\nconst SettingsLanguage: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n languages,\n language,\n loadLanguages,\n setSettingOption,\n}) => {\n const [selectedLanguage, setSelectedLanguage] = useState(language);\n const [isLoading, markIsLoading, unmarkIsLoading] = useFlag();\n\n // TODO Throttle\n useEffect(() => {\n loadLanguages();\n }, [loadLanguages]);\n\n const handleChange = useCallback((langCode: string) => {\n setSelectedLanguage(langCode);\n markIsLoading();\n\n void setLanguage(langCode as LangCode, () => {\n unmarkIsLoading();\n\n setSettingOption({ language: langCode });\n });\n }, [markIsLoading, unmarkIsLoading, setSettingOption]);\n\n const options = useMemo(() => {\n return languages ? buildOptions(languages) : undefined;\n }, [languages]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Language);\n\n return (\n
\n {options ? (\n \n ) : (\n \n )}\n
\n );\n};\n\nfunction buildOptions(languages: ApiLanguage[]) {\n const currentLangCode = (window.navigator.language || 'en').toLowerCase();\n const shortLangCode = currentLangCode.substr(0, 2);\n\n return languages.map(({ langCode, nativeName, name }) => ({\n value: langCode,\n label: nativeName,\n subLabel: name,\n })).sort((a) => {\n return currentLangCode && (a.value === currentLangCode || a.value === shortLangCode) ? -1 : 0;\n });\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n languages: global.settings.byKey.languages,\n language: global.settings.byKey.language,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadLanguages', 'setSettingOption',\n ]),\n)(SettingsLanguage));\n","import { ApiPrivacyKey, SettingsScreens } from '../../../../types';\n\nexport function getPrivacyKey(screen: SettingsScreens): ApiPrivacyKey | undefined {\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n return 'phoneNumber';\n case SettingsScreens.PrivacyLastSeen:\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n return 'lastSeen';\n case SettingsScreens.PrivacyProfilePhoto:\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n return 'profilePhoto';\n case SettingsScreens.PrivacyForwarding:\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n return 'forwards';\n case SettingsScreens.PrivacyGroupChats:\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n return 'chatInvite';\n }\n\n return undefined;\n}\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\nimport { ApiPrivacySettings, SettingsScreens } from '../../../types';\n\nimport useLang from '../../../hooks/useLang';\nimport { pick } from '../../../util/iteratees';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport RadioGroup from '../../ui/RadioGroup';\nimport { getPrivacyKey } from './helper/privacy';\n\ntype OwnProps = {\n screen: SettingsScreens;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = Partial & {\n chatsById?: Record;\n usersById?: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsPrivacyVisibility: FC = ({\n screen,\n isActive,\n onScreenSelect,\n onReset,\n visibility,\n allowUserIds,\n allowChatIds,\n blockUserIds,\n blockChatIds,\n chatsById,\n setPrivacyVisibility,\n}) => {\n const lang = useLang();\n\n const visibilityOptions = useMemo(() => {\n switch (screen) {\n case SettingsScreens.PrivacyProfilePhoto:\n case SettingsScreens.PrivacyGroupChats:\n return [\n { value: 'everybody', label: lang('P2PEverybody') },\n { value: 'contacts', label: lang('P2PContacts') },\n ];\n\n default:\n return [\n { value: 'everybody', label: lang('P2PEverybody') },\n { value: 'contacts', label: lang('P2PContacts') },\n { value: 'nobody', label: lang('P2PNobody') },\n ];\n }\n }, [lang, screen]);\n\n const exceptionLists = {\n shouldShowDenied: visibility !== 'nobody',\n shouldShowAllowed: visibility !== 'everybody',\n };\n\n const privacyKey = getPrivacyKey(screen);\n\n const headerText = useMemo(() => {\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n return lang('PrivacyPhoneTitle');\n case SettingsScreens.PrivacyLastSeen:\n return lang('LastSeenTitle');\n case SettingsScreens.PrivacyProfilePhoto:\n return lang('PrivacyProfilePhotoTitle');\n case SettingsScreens.PrivacyForwarding:\n return lang('PrivacyForwardsTitle');\n case SettingsScreens.PrivacyGroupChats:\n return lang('WhoCanAddMe');\n default:\n return undefined;\n }\n }, [lang, screen]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n const descriptionText = useMemo(() => {\n switch (screen) {\n case SettingsScreens.PrivacyLastSeen:\n return lang('CustomHelp');\n default:\n return undefined;\n }\n }, [lang, screen]);\n\n const allowedContactsScreen = (() => {\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n return SettingsScreens.PrivacyPhoneNumberAllowedContacts;\n case SettingsScreens.PrivacyLastSeen:\n return SettingsScreens.PrivacyLastSeenAllowedContacts;\n case SettingsScreens.PrivacyProfilePhoto:\n return SettingsScreens.PrivacyProfilePhotoAllowedContacts;\n case SettingsScreens.PrivacyForwarding:\n return SettingsScreens.PrivacyForwardingAllowedContacts;\n default:\n return SettingsScreens.PrivacyGroupChatsAllowedContacts;\n }\n })();\n\n const deniedContactsScreen = (() => {\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n return SettingsScreens.PrivacyPhoneNumberDeniedContacts;\n case SettingsScreens.PrivacyLastSeen:\n return SettingsScreens.PrivacyLastSeenDeniedContacts;\n case SettingsScreens.PrivacyProfilePhoto:\n return SettingsScreens.PrivacyProfilePhotoDeniedContacts;\n case SettingsScreens.PrivacyForwarding:\n return SettingsScreens.PrivacyForwardingDeniedContacts;\n default:\n return SettingsScreens.PrivacyGroupChatsDeniedContacts;\n }\n })();\n\n const allowedCount = useMemo(() => {\n if (!allowUserIds || !allowChatIds || !chatsById) {\n return 0;\n }\n\n return allowChatIds.reduce((result, chatId) => {\n return result + (chatsById[chatId] ? chatsById[chatId].membersCount! : 0);\n }, allowUserIds.length);\n }, [allowChatIds, allowUserIds, chatsById]);\n\n const blockCount = useMemo(() => {\n if (!blockUserIds || !blockChatIds || !chatsById) {\n return 0;\n }\n\n return blockChatIds.reduce((result, chatId) => {\n return result + (chatsById[chatId] ? chatsById[chatId].membersCount! : 0);\n }, blockUserIds.length);\n }, [blockChatIds, blockUserIds, chatsById]);\n\n const handleVisibilityChange = useCallback((value) => {\n setPrivacyVisibility({\n privacyKey,\n visibility: value,\n });\n }, [privacyKey, setPrivacyVisibility]);\n\n return (\n
\n
\n

{headerText}

\n\n \n\n {descriptionText && (\n

{descriptionText}

\n )}\n
\n\n
\n

{lang('PrivacyExceptions')}

\n\n {exceptionLists.shouldShowAllowed && (\n { onScreenSelect(allowedContactsScreen); }}\n >\n
\n {allowedCount > 0 && +{allowedCount}}\n {lang('AlwaysShareWith')}\n {lang('EditAdminAddUsers')}\n
\n \n )}\n {exceptionLists.shouldShowDenied && (\n { onScreenSelect(deniedContactsScreen); }}\n >\n
\n {blockCount > 0 && −{blockCount}}\n {lang('NeverShareWith')}\n {lang('EditAdminAddUsers')}\n
\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { screen }): StateProps => {\n let privacySettings: ApiPrivacySettings | undefined;\n\n const {\n chats: { byId: chatsById },\n settings: { privacy },\n } = global;\n\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n privacySettings = privacy.phoneNumber;\n break;\n\n case SettingsScreens.PrivacyLastSeen:\n privacySettings = privacy.lastSeen;\n break;\n\n case SettingsScreens.PrivacyProfilePhoto:\n privacySettings = privacy.profilePhoto;\n break;\n\n case SettingsScreens.PrivacyForwarding:\n privacySettings = privacy.forwards;\n break;\n\n case SettingsScreens.PrivacyGroupChats:\n privacySettings = privacy.chatInvite;\n break;\n }\n\n if (!privacySettings) {\n return {};\n }\n\n return {\n ...privacySettings,\n chatsById,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['setPrivacyVisibility']),\n)(SettingsPrivacyVisibility));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiSession } from '../../../api/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport { formatPastTimeShort } from '../../../util/dateFormat';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n activeSessions: ApiSession[];\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsPrivacyActiveSessions: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n activeSessions,\n loadAuthorizations,\n terminateAuthorization,\n terminateAllAuthorizations,\n}) => {\n const [isConfirmTerminateAllDialogOpen, openConfirmTerminateAllDialog, closeConfirmTerminateAllDialog] = useFlag();\n useEffect(() => {\n loadAuthorizations();\n }, [loadAuthorizations]);\n\n const handleTerminateSessionClick = useCallback((hash: string) => {\n terminateAuthorization({ hash });\n }, [terminateAuthorization]);\n\n const handleTerminateAllSessions = useCallback(() => {\n closeConfirmTerminateAllDialog();\n terminateAllAuthorizations();\n }, [closeConfirmTerminateAllDialog, terminateAllAuthorizations]);\n\n const currentSession = useMemo(() => {\n return activeSessions.find((session) => session.isCurrent);\n }, [activeSessions]);\n\n const otherSessions = useMemo(() => {\n return activeSessions.filter((session) => !session.isCurrent);\n }, [activeSessions]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.PrivacyActiveSessions);\n\n function renderCurrentSession(session: ApiSession) {\n return (\n
\n

\n {lang('AuthSessions.CurrentSession')}\n

\n\n \n
\n {session.appName}\n {getDeviceEnvironment(session)}\n {session.ip} - {getLocation(session)}\n
\n
\n\n \n {lang('TerminateAllSessions')}\n \n
\n );\n }\n\n function renderOtherSessions(sessions: ApiSession[]) {\n return (\n
\n

\n {lang('OtherSessions')}\n

\n\n {sessions.map(renderSession)}\n
\n );\n }\n\n function renderSession(session: ApiSession) {\n return (\n {\n handleTerminateSessionClick(session.hash);\n },\n }]}\n className=\"no-icon\"\n >\n
\n {formatPastTimeShort(lang, session.dateActive * 1000)}\n {session.appName}\n {getDeviceEnvironment(session)}\n {session.ip} - {getLocation(session)}\n
\n \n );\n }\n\n return (\n
\n {currentSession && renderCurrentSession(currentSession)}\n {otherSessions && renderOtherSessions(otherSessions)}\n {otherSessions && (\n \n )}\n
\n );\n};\n\nfunction getLocation(session: ApiSession) {\n return [session.region, session.country].filter(Boolean).join(', ');\n}\n\nfunction getDeviceEnvironment(session: ApiSession) {\n return `${session.deviceModel}${session.deviceModel ? ', ' : ''} ${session.platform} ${session.systemVersion}`;\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n activeSessions: global.activeSessions,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadAuthorizations', 'terminateAuthorization', 'terminateAllAuthorizations',\n ]),\n)(SettingsPrivacyActiveSessions));\n","import React, {\n FC, memo, useCallback,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { CHAT_HEIGHT_PX } from '../../../config';\nimport { formatPhoneNumberWithCode } from '../../../util/phoneNumber';\nimport { pick } from '../../../util/iteratees';\nimport {\n getChatTitle, getUserFullName, isChatPrivate,\n} from '../../../modules/helpers';\nimport renderText from '../../common/helpers/renderText';\nimport buildClassName from '../../../util/buildClassName';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Avatar from '../../common/Avatar';\nimport Loading from '../../ui/Loading';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n chatsByIds: Record;\n usersByIds: Record;\n blockedIds: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsPrivacyBlockedUsers: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n chatsByIds,\n usersByIds,\n blockedIds,\n unblockContact,\n}) => {\n const handleUnblockClick = useCallback((contactId: number) => {\n unblockContact({ contactId });\n }, [unblockContact]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.PrivacyBlockedUsers);\n\n function renderContact(contactId: number, i: number, viewportOffset: number) {\n const isPrivate = isChatPrivate(contactId);\n const user = isPrivate ? usersByIds[contactId] : undefined;\n const chat = !isPrivate ? chatsByIds[contactId] : undefined;\n\n const className = buildClassName(\n 'Chat chat-item-clickable blocked-list-item small-icon',\n isPrivate ? 'private' : 'group',\n );\n\n return (\n {\n handleUnblockClick(contactId);\n },\n }]}\n style={`top: ${(viewportOffset + i) * CHAT_HEIGHT_PX}px;`}\n >\n \n
\n

{renderText((isPrivate ? getUserFullName(user) : getChatTitle(lang, chat!)) || '')}

\n {user?.phoneNumber && (\n
{formatPhoneNumberWithCode(user.phoneNumber)}
\n )}\n {user && !user.phoneNumber && user.username && (\n
@{user.username}
\n )}\n
\n \n );\n }\n\n return (\n
\n
\n
\n

\n {lang('BlockedUsersInfo')}\n

\n
\n\n
\n {blockedIds?.length ? (\n
\n {blockedIds!.map((contactId, i) => renderContact(contactId, i, 0))}\n
\n ) : blockedIds && !blockedIds.length ? (\n
\n List is empty\n
\n ) : (\n \n )}\n
\n
\n\n {\n }}\n className=\"not-implemented\"\n ariaLabel=\"Add a blocked user\"\n >\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chats: {\n byId: chatsByIds,\n },\n users: {\n byId: usersByIds,\n },\n blocked: {\n ids,\n },\n } = global;\n\n return {\n chatsByIds,\n usersByIds,\n blockedIds: ids,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['unblockContact']),\n)(SettingsPrivacyBlockedUsers));\n","import React, { FC, memo } from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport ListItem from '../../../ui/ListItem';\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\nimport renderText from '../../../common/helpers/renderText';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n};\n\nconst SettingsTwoFaEnabled: FC = ({\n isActive, onReset, animatedEmoji, onScreenSelect,\n}) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.TwoFaEnabled);\n\n return (\n
\n
\n \n\n

\n {renderText(lang('EnabledPasswordText'), ['br'])}\n

\n
\n\n
\n onScreenSelect(SettingsScreens.TwoFaChangePasswordCurrent)}\n >\n {lang('ChangePassword')}\n \n onScreenSelect(SettingsScreens.TwoFaTurnOff)}\n >\n {lang('TurnPasswordOff')}\n \n onScreenSelect(SettingsScreens.TwoFaRecoveryEmailCurrentPassword)}\n >\n {lang('SetRecoveryEmail')}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal((global) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, '🔐'),\n };\n})(SettingsTwoFaEnabled));\n","import React, {\n FC, memo, useCallback, useState,\n} from '../../../../lib/teact/teact';\n\nimport { SettingsScreens } from '../../../../types';\n\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport PasswordMonkey from '../../../common/PasswordMonkey';\nimport PasswordForm from '../../../common/PasswordForm';\n\ntype OwnProps = {\n screen: SettingsScreens;\n error?: string;\n isLoading?: boolean;\n expectedPassword?: string;\n placeholder?: string;\n hint?: string;\n submitLabel?: string;\n clearError?: NoneToVoidFunction;\n onSubmit: (password: string) => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\nconst EQUAL_PASSWORD_ERROR = 'Passwords Should Be Equal';\n\nconst SettingsTwoFaPassword: FC = ({\n screen,\n isActive,\n onScreenSelect,\n onReset,\n error,\n isLoading,\n expectedPassword,\n placeholder = 'Current Password',\n hint,\n submitLabel,\n clearError,\n onSubmit,\n}) => {\n const [validationError, setValidationError] = useState('');\n const [shouldShowPassword, setShouldShowPassword] = useState(false);\n\n const handleSubmit = useCallback((newPassword) => {\n if (expectedPassword && newPassword !== expectedPassword) {\n setValidationError(EQUAL_PASSWORD_ERROR);\n } else {\n onSubmit(newPassword);\n }\n }, [onSubmit, expectedPassword]);\n\n const handleClearError = useCallback(() => {\n if (clearError) {\n clearError();\n }\n setValidationError('');\n }, [clearError]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n return (\n
\n
\n \n
\n\n
\n \n
\n
\n );\n};\n\nexport default memo(SettingsTwoFaPassword);\n","import React, { FC, memo } from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport Button from '../../../ui/Button';\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\n\ntype OwnProps = {\n onStart: NoneToVoidFunction;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n};\n\nconst SettingsTwoFaStart: FC = ({\n isActive, onScreenSelect, onReset, animatedEmoji, onStart,\n}) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.TwoFaDisabled);\n\n return (\n
\n
\n \n\n

\n {lang('SetAdditionalPasswordInfo')}\n

\n
\n\n
\n \n
\n
\n );\n};\n\nexport default memo(withGlobal((global) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, '🔐'),\n };\n})(SettingsTwoFaStart));\n","import React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../../util/environment';\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useFlag from '../../../../hooks/useFlag';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport Button from '../../../ui/Button';\nimport Modal from '../../../ui/Modal';\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\nimport InputText from '../../../ui/InputText';\nimport renderText from '../../../common/helpers/renderText';\n\ntype OwnProps = {\n icon: 'hint' | 'email';\n type?: 'text' | 'email';\n isLoading?: boolean;\n error?: string;\n placeholder: string;\n shouldConfirm?: boolean;\n clearError?: NoneToVoidFunction;\n onSubmit: (value?: string) => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n screen: SettingsScreens;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n};\n\nconst FOCUS_DELAY_TIMEOUT_MS = IS_SINGLE_COLUMN_LAYOUT ? 550 : 400;\n\nconst SettingsTwoFaSkippableForm: FC = ({\n animatedEmoji,\n type = 'text',\n isLoading,\n error,\n placeholder,\n shouldConfirm,\n clearError,\n onSubmit,\n isActive,\n onScreenSelect,\n onReset,\n screen,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n\n const [value, setValue] = useState('');\n const [isConfirmShown, markIsConfirmShown, unmarkIsConfirmShown] = useFlag(false);\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n setTimeout(() => {\n inputRef.current!.focus();\n }, FOCUS_DELAY_TIMEOUT_MS);\n }\n }, []);\n\n const handleInputChange = (e: React.ChangeEvent) => {\n if (error && clearError) {\n clearError();\n }\n\n setValue(e.target.value);\n };\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n\n if (!inputRef.current) {\n return;\n }\n\n onSubmit(value);\n };\n\n const handleSkip = () => {\n onSubmit();\n };\n\n const handleSkipConfirm = () => {\n unmarkIsConfirmShown();\n onSubmit();\n };\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n return (\n
\n
\n \n
\n\n
\n
\n \n\n {value ? (\n \n ) : (\n \n {lang('YourEmailSkip')}\n \n )}\n \n {shouldConfirm && (\n \n {renderText(lang('YourEmailSkipWarningText'), ['br', 'simple_markdown'])}\n
\n \n {lang('YourEmailSkip')}\n \n \n {lang('Cancel')}\n \n
\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal((global, { icon }) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, icon === 'email' ? '💌' : '💡'),\n };\n})(SettingsTwoFaSkippableForm));\n","import React, { FC, memo } from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport Button from '../../../ui/Button';\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n};\n\nconst SettingsTwoFaCongratulations: FC = ({\n isActive, onReset, animatedEmoji, onScreenSelect,\n}) => {\n const lang = useLang();\n\n const handleClick = () => {\n onScreenSelect(SettingsScreens.Privacy);\n };\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.TwoFaCongratulations);\n\n return (\n
\n
\n \n\n

\n {lang('TwoStepVerificationPasswordSetInfo')}\n

\n
\n\n
\n \n
\n
\n );\n};\n\nexport default memo(withGlobal((global) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, '🥳'),\n };\n})(SettingsTwoFaCongratulations));\n","import React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../../util/environment';\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\nimport InputText from '../../../ui/InputText';\nimport Loading from '../../../ui/Loading';\n\ntype OwnProps = {\n isLoading?: boolean;\n error?: string;\n clearError: NoneToVoidFunction;\n onSubmit: (hint: string) => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n screen: SettingsScreens;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n codeLength: number;\n};\n\nconst FOCUS_DELAY_TIMEOUT_MS = IS_SINGLE_COLUMN_LAYOUT ? 550 : 400;\n\nconst SettingsTwoFaEmailCode: FC = ({\n animatedEmoji,\n codeLength,\n isLoading,\n error,\n clearError,\n onSubmit,\n isActive,\n onScreenSelect,\n onReset,\n screen,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n\n const [value, setValue] = useState('');\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n setTimeout(() => {\n inputRef.current!.focus();\n }, FOCUS_DELAY_TIMEOUT_MS);\n }\n }, []);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n const handleInputChange = (e: React.ChangeEvent) => {\n if (error && clearError) {\n clearError();\n }\n\n const newValue = e.target.value.slice(0, codeLength);\n\n if (newValue.length === codeLength) {\n onSubmit(newValue);\n }\n\n setValue(newValue);\n e.target.value = newValue;\n };\n\n return (\n
\n
\n \n
\n\n
\n \n {isLoading && }\n
\n
\n );\n};\n\nexport default memo(withGlobal((global) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, '💌'),\n codeLength: global.twoFaSettings.waitingEmailCodeLength,\n };\n})(SettingsTwoFaEmailCode));\n","import React, {\n FC, memo, useCallback, useEffect,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../../../global/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { pick } from '../../../../util/iteratees';\nimport { TwoFaDispatch, TwoFaState } from '../../../../hooks/reducers/useTwoFaReducer';\nimport useLang from '../../../../hooks/useLang';\n\nimport SettingsTwoFaEnabled from './SettingsTwoFaEnabled';\nimport SettingsTwoFaPassword from './SettingsTwoFaPassword';\nimport SettingsTwoFaStart from './SettingsTwoFaStart';\nimport SettingsTwoFaSkippableForm from './SettingsTwoFaSkippableForm';\nimport SettingsTwoFaCongratulations from './SettingsTwoFaCongratulations';\nimport SettingsTwoFaEmailCode from './SettingsTwoFaEmailCode';\n\nexport type OwnProps = {\n state: TwoFaState;\n currentScreen: SettingsScreens;\n shownScreen: SettingsScreens;\n dispatch: TwoFaDispatch;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = GlobalState['twoFaSettings'];\n\ntype DispatchProps = Pick;\n\nconst SettingsTwoFa: FC = ({\n currentScreen,\n shownScreen,\n state,\n hint,\n isLoading,\n error,\n waitingEmailCodeLength,\n dispatch,\n isActive,\n onScreenSelect,\n onReset,\n updatePassword,\n checkPassword,\n clearTwoFaError,\n updateRecoveryEmail,\n provideTwoFaEmailCode,\n clearPassword,\n}) => {\n useEffect(() => {\n if (waitingEmailCodeLength) {\n if (currentScreen === SettingsScreens.TwoFaNewPasswordEmail) {\n onScreenSelect(SettingsScreens.TwoFaNewPasswordEmailCode);\n } else if (currentScreen === SettingsScreens.TwoFaRecoveryEmail) {\n onScreenSelect(SettingsScreens.TwoFaRecoveryEmailCode);\n }\n }\n }, [currentScreen, onScreenSelect, waitingEmailCodeLength]);\n\n const handleStartWizard = useCallback(() => {\n dispatch({ type: 'reset' });\n onScreenSelect(SettingsScreens.TwoFaNewPassword);\n }, [dispatch, onScreenSelect]);\n\n const handleNewPassword = useCallback((value: string) => {\n dispatch({ type: 'setPassword', payload: value });\n onScreenSelect(SettingsScreens.TwoFaNewPasswordConfirm);\n }, [dispatch, onScreenSelect]);\n\n const handleNewPasswordConfirm = useCallback(() => {\n onScreenSelect(SettingsScreens.TwoFaNewPasswordHint);\n }, [onScreenSelect]);\n\n const handleNewPasswordHint = useCallback((value?: string) => {\n dispatch({ type: 'setHint', payload: value });\n onScreenSelect(SettingsScreens.TwoFaNewPasswordEmail);\n }, [dispatch, onScreenSelect]);\n\n const handleNewPasswordEmail = useCallback((value?: string) => {\n dispatch({ type: 'setEmail', payload: value });\n updatePassword({\n ...state,\n email: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaCongratulations);\n },\n });\n }, [dispatch, onScreenSelect, state, updatePassword]);\n\n const handleChangePasswordCurrent = useCallback((value: string) => {\n dispatch({ type: 'setCurrentPassword', payload: value });\n checkPassword({\n currentPassword: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaChangePasswordNew);\n },\n });\n }, [checkPassword, dispatch, onScreenSelect]);\n\n const handleChangePasswordNew = useCallback((value: string) => {\n dispatch({ type: 'setPassword', payload: value });\n onScreenSelect(SettingsScreens.TwoFaChangePasswordConfirm);\n }, [dispatch, onScreenSelect]);\n\n const handleChangePasswordConfirm = useCallback(() => {\n onScreenSelect(SettingsScreens.TwoFaChangePasswordHint);\n }, [onScreenSelect]);\n\n const handleChangePasswordHint = useCallback((value?: string) => {\n dispatch({ type: 'setHint', payload: value });\n updatePassword({\n ...state,\n hint: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaCongratulations);\n },\n });\n }, [dispatch, onScreenSelect, state, updatePassword]);\n\n const handleTurnOff = useCallback((value: string) => {\n clearPassword({\n currentPassword: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.Privacy);\n },\n });\n }, [clearPassword, onScreenSelect]);\n\n const handleRecoveryEmailCurrentPassword = useCallback((value: string) => {\n dispatch({ type: 'setCurrentPassword', payload: value });\n checkPassword({\n currentPassword: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaRecoveryEmail);\n },\n });\n }, [checkPassword, dispatch, onScreenSelect]);\n\n const handleRecoveryEmail = useCallback((value?: string) => {\n dispatch({ type: 'setEmail', payload: value });\n updateRecoveryEmail({\n ...state,\n email: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaCongratulations);\n },\n });\n }, [dispatch, onScreenSelect, state, updateRecoveryEmail]);\n\n const handleEmailCode = useCallback((code: string) => {\n provideTwoFaEmailCode({ code });\n }, [provideTwoFaEmailCode]);\n\n const lang = useLang();\n\n switch (currentScreen) {\n case SettingsScreens.TwoFaDisabled:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPassword:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPasswordConfirm:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPasswordHint:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPasswordEmail:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPasswordEmailCode:\n return (\n \n );\n\n case SettingsScreens.TwoFaCongratulations:\n return (\n \n );\n\n case SettingsScreens.TwoFaEnabled:\n return (\n \n );\n\n case SettingsScreens.TwoFaChangePasswordCurrent:\n return (\n \n );\n\n case SettingsScreens.TwoFaChangePasswordNew:\n return (\n \n );\n\n case SettingsScreens.TwoFaChangePasswordConfirm:\n return (\n \n );\n\n case SettingsScreens.TwoFaChangePasswordHint:\n return (\n \n );\n\n case SettingsScreens.TwoFaTurnOff:\n return (\n \n );\n\n case SettingsScreens.TwoFaRecoveryEmailCurrentPassword:\n return (\n \n );\n\n case SettingsScreens.TwoFaRecoveryEmail:\n return (\n \n );\n\n case SettingsScreens.TwoFaRecoveryEmailCode:\n return (\n \n );\n\n default:\n return undefined;\n }\n};\n\nexport default memo(withGlobal(\n (global): StateProps => ({ ...global.twoFaSettings }),\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'updatePassword', 'updateRecoveryEmail', 'clearPassword', 'provideTwoFaEmailCode',\n 'checkPassword', 'clearTwoFaError',\n ]),\n)(SettingsTwoFa));\n","import React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../../global/types';\nimport { ApiChat } from '../../../api/types';\nimport { ApiPrivacySettings, SettingsScreens } from '../../../types';\n\nimport useLang from '../../../hooks/useLang';\nimport { pick } from '../../../util/iteratees';\nimport searchWords from '../../../util/searchWords';\nimport { getPrivacyKey } from './helper/privacy';\nimport {\n getChatTitle, isChatGroup, isChatPrivate, prepareChatList,\n} from '../../../modules/helpers';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport Picker from '../../common/Picker';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\n\nexport type OwnProps = {\n isAllowList?: boolean;\n screen: SettingsScreens;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentUserId?: number;\n chatsById: Record;\n listIds?: number[];\n orderedPinnedIds?: number[];\n archivedListIds?: number[];\n archivedPinnedIds?: number[];\n settings?: ApiPrivacySettings;\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsPrivacyVisibilityExceptionList: FC = ({\n currentUserId,\n isAllowList,\n screen,\n settings,\n chatsById,\n listIds,\n orderedPinnedIds,\n archivedListIds,\n archivedPinnedIds,\n setPrivacySettings,\n isActive,\n onScreenSelect,\n onReset,\n}) => {\n const lang = useLang();\n\n const selectedContactIds = useMemo(() => {\n if (!settings) {\n return [];\n }\n\n if (isAllowList) {\n return [...settings.allowUserIds, ...settings.allowChatIds];\n } else {\n return [...settings.blockUserIds, ...settings.blockChatIds];\n }\n }, [isAllowList, settings]);\n const [searchQuery, setSearchQuery] = useState('');\n const [isSubmitShown, setIsSubmitShown] = useState(false);\n const [newSelectedContactIds, setNewSelectedContactIds] = useState(selectedContactIds);\n\n const chats = useMemo(() => {\n const activeChatArrays = listIds\n ? prepareChatList(chatsById, listIds, orderedPinnedIds, 'all')\n : undefined;\n const archivedChatArrays = archivedListIds\n ? prepareChatList(chatsById, archivedListIds, archivedPinnedIds, 'archived')\n : undefined;\n\n if (!activeChatArrays && !archivedChatArrays) {\n return undefined;\n }\n\n return [\n ...(activeChatArrays\n ? [\n ...activeChatArrays.pinnedChats,\n ...activeChatArrays.otherChats,\n ]\n : []\n ),\n ...(archivedChatArrays ? archivedChatArrays.otherChats : []),\n ];\n }, [chatsById, listIds, orderedPinnedIds, archivedListIds, archivedPinnedIds]);\n\n const displayedIds = useMemo(() => {\n if (!chats) {\n return undefined;\n }\n\n return chats\n .filter((chat) => (\n ((isChatPrivate(chat.id) && chat.id !== currentUserId) || isChatGroup(chat))\n && (\n !searchQuery\n || searchWords(getChatTitle(lang, chat), searchQuery)\n || selectedContactIds.includes(chat.id)\n )\n ))\n .map(({ id }) => id);\n }, [chats, currentUserId, lang, searchQuery, selectedContactIds]);\n\n const handleSelectedContactIdsChange = useCallback((value: number[]) => {\n setNewSelectedContactIds(value);\n setIsSubmitShown(true);\n }, []);\n\n const handleSubmit = useCallback(() => {\n setPrivacySettings({\n privacyKey: getPrivacyKey(screen),\n isAllowList: Boolean(isAllowList),\n contactsIds: newSelectedContactIds,\n });\n\n onScreenSelect(SettingsScreens.Privacy);\n }, [isAllowList, newSelectedContactIds, onScreenSelect, screen, setPrivacySettings]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n return (\n
\n \n\n \n \n \n
\n );\n};\n\nfunction getCurrentPrivacySettings(global: GlobalState, screen: SettingsScreens) {\n const { privacy } = global.settings;\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n return privacy.phoneNumber;\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n return privacy.lastSeen;\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n return privacy.profilePhoto;\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n return privacy.forwards;\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n return privacy.chatInvite;\n }\n\n return undefined;\n}\n\nexport default memo(withGlobal(\n (global, { screen }): StateProps => {\n const {\n chats: {\n byId: chatsById,\n listIds,\n orderedPinnedIds,\n },\n currentUserId,\n } = global;\n\n return {\n currentUserId,\n chatsById,\n listIds: listIds.active,\n orderedPinnedIds: orderedPinnedIds.active,\n archivedPinnedIds: orderedPinnedIds.archived,\n archivedListIds: listIds.archived,\n settings: getCurrentPrivacySettings(global, screen),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['setPrivacySettings']),\n)(SettingsPrivacyVisibilityExceptionList));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { SettingsScreens } from '../../../types';\nimport { FolderEditDispatch, FoldersState } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { LAYERS_ANIMATION_NAME } from '../../../util/environment';\nimport useTwoFaReducer from '../../../hooks/reducers/useTwoFaReducer';\n\nimport Transition from '../../ui/Transition';\nimport SettingsHeader from './SettingsHeader';\nimport SettingsMain from './SettingsMain';\nimport SettingsEditProfile from './SettingsEditProfile';\nimport SettingsFolders from './folders/SettingsFolders';\nimport SettingsGeneral from './SettingsGeneral';\nimport SettingsGeneralBackground from './SettingsGeneralBackground';\nimport SettingsGeneralBackgroundColor from './SettingsGeneralBackgroundColor';\nimport SettingsNotifications from './SettingsNotifications';\nimport SettingsPrivacy from './SettingsPrivacy';\nimport SettingsLanguage from './SettingsLanguage';\nimport SettingsPrivacyVisibility from './SettingsPrivacyVisibility';\nimport SettingsPrivacyActiveSessions from './SettingsPrivacyActiveSessions';\nimport SettingsPrivacyBlockedUsers from './SettingsPrivacyBlockedUsers';\nimport SettingsTwoFa from './twoFa/SettingsTwoFa';\nimport SettingsPrivacyVisibilityExceptionList from './SettingsPrivacyVisibilityExceptionList';\n\nimport './Settings.scss';\n\nconst TRANSITION_RENDER_COUNT = Object.keys(SettingsScreens).length / 2;\nconst TRANSITION_DURATION = 200;\n\nconst TWO_FA_SCREENS = [\n SettingsScreens.TwoFaDisabled,\n SettingsScreens.TwoFaNewPassword,\n SettingsScreens.TwoFaNewPasswordConfirm,\n SettingsScreens.TwoFaNewPasswordHint,\n SettingsScreens.TwoFaNewPasswordEmail,\n SettingsScreens.TwoFaNewPasswordEmailCode,\n SettingsScreens.TwoFaCongratulations,\n SettingsScreens.TwoFaEnabled,\n SettingsScreens.TwoFaChangePasswordCurrent,\n SettingsScreens.TwoFaChangePasswordNew,\n SettingsScreens.TwoFaChangePasswordConfirm,\n SettingsScreens.TwoFaChangePasswordHint,\n SettingsScreens.TwoFaTurnOff,\n SettingsScreens.TwoFaRecoveryEmailCurrentPassword,\n SettingsScreens.TwoFaRecoveryEmail,\n SettingsScreens.TwoFaRecoveryEmailCode,\n];\n\nconst FOLDERS_SCREENS = [\n SettingsScreens.Folders,\n SettingsScreens.FoldersCreateFolder,\n SettingsScreens.FoldersEditFolder,\n SettingsScreens.FoldersEditFolderFromChatList,\n SettingsScreens.FoldersIncludedChats,\n SettingsScreens.FoldersIncludedChatsFromChatList,\n SettingsScreens.FoldersExcludedChats,\n SettingsScreens.FoldersExcludedChatsFromChatList,\n];\n\nconst PRIVACY_SCREENS = [\n SettingsScreens.PrivacyBlockedUsers,\n SettingsScreens.PrivacyActiveSessions,\n];\n\nconst PRIVACY_PHONE_NUMBER_SCREENS = [\n SettingsScreens.PrivacyPhoneNumberAllowedContacts,\n SettingsScreens.PrivacyPhoneNumberDeniedContacts,\n];\n\nconst PRIVACY_LAST_SEEN_PHONE_SCREENS = [\n SettingsScreens.PrivacyLastSeenAllowedContacts,\n SettingsScreens.PrivacyLastSeenDeniedContacts,\n];\n\nconst PRIVACY_PROFILE_PHOTO_SCREENS = [\n SettingsScreens.PrivacyProfilePhotoAllowedContacts,\n SettingsScreens.PrivacyProfilePhotoDeniedContacts,\n];\n\nconst PRIVACY_FORWARDING_SCREENS = [\n SettingsScreens.PrivacyForwardingAllowedContacts,\n SettingsScreens.PrivacyForwardingDeniedContacts,\n];\n\nconst PRIVACY_GROUP_CHATS_SCREENS = [\n SettingsScreens.PrivacyGroupChatsAllowedContacts,\n SettingsScreens.PrivacyGroupChatsDeniedContacts,\n];\n\nexport type OwnProps = {\n isActive: boolean;\n currentScreen: SettingsScreens;\n foldersState: FoldersState;\n foldersDispatch: FolderEditDispatch;\n onScreenSelect: (screen: SettingsScreens) => void;\n shouldSkipTransition?: boolean;\n onReset: () => void;\n};\n\nconst Settings: FC = ({\n isActive,\n currentScreen,\n foldersState,\n foldersDispatch,\n onScreenSelect,\n onReset,\n shouldSkipTransition,\n}) => {\n const [twoFaState, twoFaDispatch] = useTwoFaReducer();\n\n const handleReset = useCallback(() => {\n if (\n currentScreen === SettingsScreens.FoldersCreateFolder\n || currentScreen === SettingsScreens.FoldersEditFolder\n || currentScreen === SettingsScreens.FoldersEditFolderFromChatList\n ) {\n setTimeout(() => {\n foldersDispatch({ type: 'reset' });\n }, TRANSITION_DURATION);\n }\n\n if (\n currentScreen === SettingsScreens.FoldersIncludedChats\n || currentScreen === SettingsScreens.FoldersExcludedChats\n ) {\n if (foldersState.mode === 'create') {\n onScreenSelect(SettingsScreens.FoldersCreateFolder);\n } else {\n onScreenSelect(SettingsScreens.FoldersEditFolder);\n }\n return;\n }\n\n onReset();\n }, [\n foldersState.mode, foldersDispatch,\n currentScreen, onReset, onScreenSelect,\n ]);\n\n const handleSaveFilter = useCallback(() => {\n foldersDispatch({ type: 'saveFilters' });\n handleReset();\n }, [foldersDispatch, handleReset]);\n\n function renderCurrentSectionContent(isScreenActive: boolean, screen: SettingsScreens) {\n const privacyAllowScreens: Record = {\n [SettingsScreens.PrivacyPhoneNumber]: PRIVACY_PHONE_NUMBER_SCREENS.includes(screen),\n [SettingsScreens.PrivacyLastSeen]: PRIVACY_LAST_SEEN_PHONE_SCREENS.includes(screen),\n [SettingsScreens.PrivacyProfilePhoto]: PRIVACY_PROFILE_PHOTO_SCREENS.includes(screen),\n [SettingsScreens.PrivacyForwarding]: PRIVACY_FORWARDING_SCREENS.includes(screen),\n [SettingsScreens.PrivacyGroupChats]: PRIVACY_GROUP_CHATS_SCREENS.includes(screen),\n };\n\n const isTwoFaScreen = TWO_FA_SCREENS.includes(screen);\n const isFoldersScreen = FOLDERS_SCREENS.includes(screen);\n const isPrivacyScreen = PRIVACY_SCREENS.includes(screen)\n || isTwoFaScreen\n || Object.keys(privacyAllowScreens).includes(screen.toString())\n || Object.values(privacyAllowScreens).find((key) => key === true);\n\n switch (currentScreen) {\n case SettingsScreens.Main:\n return (\n \n );\n case SettingsScreens.EditProfile:\n return (\n \n );\n case SettingsScreens.General:\n return (\n \n );\n case SettingsScreens.Notifications:\n return (\n \n );\n case SettingsScreens.Privacy:\n return (\n \n );\n case SettingsScreens.Language:\n return (\n \n );\n case SettingsScreens.GeneralChatBackground:\n return (\n \n );\n case SettingsScreens.GeneralChatBackgroundColor:\n return (\n \n );\n case SettingsScreens.PrivacyActiveSessions:\n return (\n \n );\n case SettingsScreens.PrivacyBlockedUsers:\n return (\n \n );\n case SettingsScreens.PrivacyPhoneNumber:\n case SettingsScreens.PrivacyLastSeen:\n case SettingsScreens.PrivacyProfilePhoto:\n case SettingsScreens.PrivacyForwarding:\n case SettingsScreens.PrivacyGroupChats:\n return (\n \n );\n\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n return (\n \n );\n\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n return (\n \n );\n\n case SettingsScreens.Folders:\n case SettingsScreens.FoldersCreateFolder:\n case SettingsScreens.FoldersEditFolder:\n case SettingsScreens.FoldersEditFolderFromChatList:\n case SettingsScreens.FoldersIncludedChats:\n case SettingsScreens.FoldersIncludedChatsFromChatList:\n case SettingsScreens.FoldersExcludedChats:\n case SettingsScreens.FoldersExcludedChatsFromChatList:\n return (\n \n );\n\n case SettingsScreens.TwoFaDisabled:\n case SettingsScreens.TwoFaNewPassword:\n case SettingsScreens.TwoFaNewPasswordConfirm:\n case SettingsScreens.TwoFaNewPasswordHint:\n case SettingsScreens.TwoFaNewPasswordEmail:\n case SettingsScreens.TwoFaNewPasswordEmailCode:\n case SettingsScreens.TwoFaCongratulations:\n case SettingsScreens.TwoFaEnabled:\n case SettingsScreens.TwoFaChangePasswordCurrent:\n case SettingsScreens.TwoFaChangePasswordNew:\n case SettingsScreens.TwoFaChangePasswordConfirm:\n case SettingsScreens.TwoFaChangePasswordHint:\n case SettingsScreens.TwoFaTurnOff:\n case SettingsScreens.TwoFaRecoveryEmailCurrentPassword:\n case SettingsScreens.TwoFaRecoveryEmail:\n case SettingsScreens.TwoFaRecoveryEmailCode:\n return (\n \n );\n\n default:\n return undefined;\n }\n }\n\n function renderCurrentSection(isScreenActive: boolean, isFrom: boolean, currentKey: SettingsScreens) {\n return (\n <>\n \n {renderCurrentSectionContent(isScreenActive, currentKey)}\n \n );\n }\n\n return (\n \n {renderCurrentSection}\n \n );\n};\n\nexport default memo(Settings);\n","import React, {\n FC, useEffect, useCallback, useMemo, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiUser } from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { throttle } from '../../../util/schedulers';\nimport searchWords from '../../../util/searchWords';\nimport { pick } from '../../../util/iteratees';\nimport { getUserFullName, sortUserIds } from '../../../modules/helpers';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport ListItem from '../../ui/ListItem';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n filter: string;\n isActive: boolean;\n onReset: () => void;\n};\n\ntype StateProps = {\n usersById: Record;\n contactIds?: number[];\n serverTimeOffset: number;\n};\n\ntype DispatchProps = Pick;\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst ContactList: FC = ({\n isActive, onReset,\n filter, usersById, contactIds, loadContactList, openChat, serverTimeOffset,\n}) => {\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadContactList();\n });\n });\n\n useHistoryBack(isActive, onReset);\n\n const handleClick = useCallback(\n (id: number) => {\n openChat({ id, shouldReplaceHistory: true });\n },\n [openChat],\n );\n\n const listIds = useMemo(() => {\n if (!contactIds) {\n return undefined;\n }\n\n const resultIds = filter ? contactIds.filter((id) => {\n const user = usersById[id];\n if (!user) {\n return false;\n }\n const fullName = getUserFullName(user);\n return fullName && searchWords(fullName, filter);\n }) : contactIds;\n\n return sortUserIds(resultIds, usersById, undefined, serverTimeOffset);\n }, [contactIds, filter, usersById, serverTimeOffset]);\n\n const [viewportIds, getMore] = useInfiniteScroll(undefined, listIds, Boolean(filter));\n\n return (\n \n {viewportIds?.length ? (\n viewportIds.map((id) => (\n handleClick(id)}\n ripple={!IS_SINGLE_COLUMN_LAYOUT}\n >\n \n \n ))\n ) : viewportIds && !viewportIds.length ? (\n

\n {filter.length ? 'No contacts matched your search.' : 'Contact list is empty.'}\n

\n ) : (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { userIds: contactIds } = global.contactList || {};\n const { byId: usersById } = global.users;\n\n return {\n usersById,\n contactIds,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadContactList', 'openChat']),\n)(ContactList));\n","import React, {\n FC, useCallback, useEffect, useMemo, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport { pick, unique } from '../../../util/iteratees';\nimport { throttle } from '../../../util/schedulers';\nimport searchWords from '../../../util/searchWords';\nimport { getUserFullName, isUserBot, sortChatIds } from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport Picker from '../../common/Picker';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Button from '../../ui/Button';\n\nexport type OwnProps = {\n isChannel?: boolean;\n isActive: boolean;\n selectedMemberIds: number[];\n onSelectedMemberIdsChange: (ids: number[]) => void;\n onNextStep: () => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentUserId?: number;\n usersById: Record;\n chatsById: Record;\n localContactIds?: number[];\n searchQuery?: string;\n isSearching?: boolean;\n localUserIds?: number[];\n globalUserIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst NewChatStep1: FC = ({\n isChannel,\n isActive,\n selectedMemberIds,\n onSelectedMemberIdsChange,\n onNextStep,\n onReset,\n currentUserId,\n usersById,\n chatsById,\n localContactIds,\n searchQuery,\n isSearching,\n localUserIds,\n globalUserIds,\n loadContactList,\n setGlobalSearchQuery,\n}) => {\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadContactList();\n });\n });\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset);\n\n const handleFilterChange = useCallback((query: string) => {\n setGlobalSearchQuery({ query });\n }, [setGlobalSearchQuery]);\n\n const displayedIds = useMemo(() => {\n const contactIds = localContactIds\n ? sortChatIds(localContactIds.filter((id) => id !== currentUserId), chatsById)\n : [];\n\n if (!searchQuery) {\n return contactIds;\n }\n\n const foundContactIds = contactIds.filter((id) => {\n const user = usersById[id];\n if (!user) {\n return false;\n }\n const fullName = getUserFullName(user);\n return fullName && searchWords(fullName, searchQuery);\n });\n\n return sortChatIds(\n unique([\n ...foundContactIds,\n ...(localUserIds || []),\n ...(globalUserIds || []),\n ]).filter((contactId) => {\n const user = usersById[contactId];\n\n return !user || !isUserBot(user) || user.canBeInvitedToGroup;\n }),\n chatsById,\n false,\n selectedMemberIds,\n );\n }, [\n localContactIds, chatsById, searchQuery, localUserIds, globalUserIds, selectedMemberIds,\n currentUserId, usersById,\n ]);\n\n const handleNextStep = useCallback(() => {\n if (selectedMemberIds.length || isChannel) {\n setGlobalSearchQuery({ query: '' });\n onNextStep();\n }\n }, [selectedMemberIds.length, isChannel, setGlobalSearchQuery, onNextStep]);\n\n return (\n
\n
\n \n \n \n

{lang('GroupAddMembers')}

\n
\n
\n \n\n \n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { userIds: localContactIds } = global.contactList || {};\n const { byId: usersById } = global.users;\n const { byId: chatsById } = global.chats;\n const { currentUserId } = global;\n\n const {\n query: searchQuery,\n fetchingStatus,\n globalResults,\n localResults,\n } = global.globalSearch;\n const { userIds: globalUserIds } = globalResults || {};\n const { userIds: localUserIds } = localResults || {};\n\n return {\n currentUserId,\n usersById,\n chatsById,\n localContactIds,\n searchQuery,\n isSearching: fetchingStatus?.chats,\n globalUserIds,\n localUserIds,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadContactList', 'setGlobalSearchQuery']),\n)(NewChatStep1));\n","import React, {\n FC, useState, useCallback, useEffect, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ChatCreationProgress } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport InputText from '../../ui/InputText';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport AvatarEditable from '../../ui/AvatarEditable';\nimport Button from '../../ui/Button';\nimport ListItem from '../../ui/ListItem';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\nexport type OwnProps = {\n isChannel?: boolean;\n isActive: boolean;\n memberIds: number[];\n onReset: (forceReturnToChatList?: boolean) => void;\n};\n\ntype StateProps = {\n creationProgress?: ChatCreationProgress;\n creationError?: string;\n};\n\ntype DispatchProps = Pick;\n\n// TODO @implement\nconst MAX_USERS_FOR_LEGACY_CHAT = 199; // Accounting for current user\n\nconst NewChatStep2: FC = ({\n isChannel,\n isActive,\n memberIds,\n onReset,\n creationProgress,\n creationError,\n createGroupChat,\n createChannel,\n}) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onReset);\n\n const [title, setTitle] = useState('');\n const [about, setAbout] = useState('');\n const [photo, setPhoto] = useState();\n const [error, setError] = useState();\n\n const chatTitleEmptyError = 'Chat title can\\'t be empty';\n const channelTitleEmptyError = 'Channel title can\\'t be empty';\n const chatTooManyUsersError = 'Sorry, creating supergroups is not yet supported';\n\n const isLoading = creationProgress === ChatCreationProgress.InProgress;\n\n const handleTitleChange = useCallback((e: React.ChangeEvent) => {\n const { value } = e.currentTarget;\n const newValue = value.replace(/^\\s+/, '');\n\n setTitle(newValue);\n\n if (newValue !== value) {\n e.currentTarget.value = newValue;\n }\n }, []);\n\n const handleDescriptionChange = useCallback((e: React.ChangeEvent) => {\n setAbout(e.currentTarget.value);\n }, []);\n\n const handleCreateGroup = useCallback(() => {\n if (!title.length) {\n setError(chatTitleEmptyError);\n return;\n }\n\n if (memberIds.length > MAX_USERS_FOR_LEGACY_CHAT) {\n setError(chatTooManyUsersError);\n return;\n }\n\n createGroupChat({\n title,\n photo,\n memberIds,\n });\n }, [title, memberIds, createGroupChat, photo, chatTitleEmptyError, chatTooManyUsersError]);\n\n const handleCreateChannel = useCallback(() => {\n if (!title.length) {\n setError(channelTitleEmptyError);\n return;\n }\n\n createChannel({\n title,\n about,\n photo,\n memberIds,\n });\n }, [title, createChannel, about, photo, memberIds, channelTitleEmptyError]);\n\n useEffect(() => {\n if (creationProgress === ChatCreationProgress.Complete) {\n onReset(true);\n }\n }, [creationProgress, onReset]);\n\n const renderedError = creationError || (\n error !== chatTitleEmptyError && error !== channelTitleEmptyError\n ? error\n : undefined\n );\n\n return (\n
\n
\n onReset()}\n ariaLabel=\"Return to member selection\"\n >\n \n \n

{lang(isChannel ? 'NewChannel' : 'NewGroup')}

\n
\n
\n \n \n {isChannel && (\n <>\n \n

{lang('DescriptionInfo')}

\n \n )}\n\n {renderedError && (\n

{renderedError}

\n )}\n\n {memberIds.length > 0 && (\n <>\n

{lang('GroupInfo.ParticipantCount', memberIds.length, 'i')}

\n\n
\n {memberIds.map((id) => (\n \n \n \n ))}\n
\n \n )}\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n progress: creationProgress,\n error: creationError,\n } = global.chatCreation || {};\n\n return {\n creationProgress,\n creationError,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'createGroupChat', 'createChannel',\n ]),\n)(NewChatStep2));\n","import React, {\n FC, memo, useCallback, useState,\n} from '../../../lib/teact/teact';\n\nimport { LeftColumnContent } from '../../../types';\n\nimport { LAYERS_ANIMATION_NAME } from '../../../util/environment';\n\nimport Transition from '../../ui/Transition';\nimport NewChatStep1 from './NewChatStep1';\nimport NewChatStep2 from './NewChatStep2';\n\nimport './NewChat.scss';\n\nexport type OwnProps = {\n isActive: boolean;\n isChannel?: boolean;\n content: LeftColumnContent;\n onContentChange: (content: LeftColumnContent) => void;\n onReset: () => void;\n};\n\nconst RENDER_COUNT = Object.keys(LeftColumnContent).length / 2;\n\nconst NewChat: FC = ({\n isActive,\n isChannel = false,\n content,\n onContentChange,\n onReset,\n}) => {\n const [newChatMemberIds, setNewChatMemberIds] = useState([]);\n\n const handleNextStep = useCallback(() => {\n onContentChange(isChannel ? LeftColumnContent.NewChannelStep2 : LeftColumnContent.NewGroupStep2);\n }, [isChannel, onContentChange]);\n\n return (\n \n {(isStepActive) => {\n switch (content) {\n case LeftColumnContent.NewChannelStep1:\n case LeftColumnContent.NewGroupStep1:\n return (\n \n );\n case LeftColumnContent.NewChannelStep2:\n case LeftColumnContent.NewGroupStep2:\n return (\n \n );\n default:\n return undefined;\n }\n }}\n \n );\n};\n\nexport default memo(NewChat);\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Button from '../ui/Button';\nimport ChatList from './main/ChatList';\nimport { LeftColumnContent } from '../../types';\n\nimport './ArchivedChats.scss';\n\nexport type OwnProps = {\n isActive: boolean;\n onReset: () => void;\n onContentChange: (content: LeftColumnContent) => void;\n};\n\nconst ArchivedChats: FC = ({ isActive, onReset, onContentChange }) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onContentChange, LeftColumnContent.Archived);\n\n return (\n
\n
\n \n \n \n

{lang('ArchivedChats')}

\n
\n \n
\n );\n};\n\nexport default memo(ArchivedChats);\n","const IGNORED_KEYS: Record = {\n Down: true,\n ArrowDown: true,\n Up: true,\n ArrowUp: true,\n Left: true,\n ArrowLeft: true,\n Right: true,\n ArrowRight: true,\n ' ': true,\n PageUp: true,\n PageDown: true,\n End: true,\n Home: true,\n Tab: true,\n};\n\nfunction isTextBox(target: EventTarget | null) {\n if (!target || !(target instanceof HTMLElement)) return false;\n const element = target;\n const tagName = element.tagName.toLowerCase();\n if (tagName === 'textarea') return true;\n if (tagName !== 'input') return false;\n const type = element.getAttribute('type');\n if (!type) return false;\n const inputTypes = [\n 'text', 'password', 'number', 'email', 'tel', 'url',\n 'search', 'date', 'datetime', 'datetime-local', 'time', 'month', 'week',\n ];\n return inputTypes.indexOf(type.toLowerCase()) > -1;\n}\n\nconst preventDefault = (e: Event) => {\n e.preventDefault();\n};\n\nfunction preventDefaultForScrollKeys(e: KeyboardEvent) {\n if (IGNORED_KEYS[e.key] && !isTextBox(e.target)) {\n preventDefault(e);\n }\n}\n\nexport function disableScrolling() {\n // Disable scrolling in Chrome\n document.addEventListener('wheel', preventDefault, { passive: false });\n window.ontouchmove = preventDefault; // mobile\n document.onkeydown = preventDefaultForScrollKeys;\n}\n\nexport function enableScrolling() {\n document.removeEventListener('wheel', preventDefault); // Enable scrolling in Chrome\n // eslint-disable-next-line no-null/no-null\n window.ontouchmove = null;\n // eslint-disable-next-line no-null/no-null\n document.onkeydown = null;\n}\n","import { ApiMediaFormat, ApiMessage } from '../../../../api/types';\n\nimport * as mediaLoader from '../../../../util/mediaLoader';\nimport {\n getMessageMediaHash,\n getMessagePhoto,\n getMessageText,\n getMessageWebPagePhoto,\n getMessageWebPageVideo,\n hasMessageLocalBlobUrl,\n} from '../../../../modules/helpers';\nimport { CLIPBOARD_ITEM_SUPPORTED, copyImageToClipboard, copyTextToClipboard } from '../../../../util/clipboard';\n\ntype ICopyOptions = {\n label: string;\n handler: () => void;\n}[];\n\nexport function getMessageCopyOptions(\n message: ApiMessage, afterEffect?: () => void, onCopyLink?: () => void,\n): ICopyOptions {\n const options: ICopyOptions = [];\n const text = getMessageText(message);\n const photo = getMessagePhoto(message)\n || (!getMessageWebPageVideo(message) ? getMessageWebPagePhoto(message) : undefined);\n const mediaHash = getMessageMediaHash(message, 'inline');\n const canImageBeCopied = photo && (mediaHash || hasMessageLocalBlobUrl(message)) && CLIPBOARD_ITEM_SUPPORTED;\n const selection = window.getSelection();\n\n if (canImageBeCopied) {\n options.push({\n label: 'lng_context_copy_image',\n handler: () => {\n Promise.resolve(mediaHash ? mediaLoader.fetch(mediaHash, ApiMediaFormat.BlobUrl) : photo!.blobUrl)\n .then(copyImageToClipboard);\n\n if (afterEffect) {\n afterEffect();\n }\n },\n });\n }\n\n if (text) {\n // Detect if the user has selection in the current message\n const hasSelection = Boolean((\n selection?.anchorNode?.parentNode\n && (selection.anchorNode.parentNode as HTMLElement).closest('.Message .content-inner')\n && selection.toString().replace(/(?:\\r\\n|\\r|\\n)/g, '') !== ''\n ));\n\n options.push({\n label: getCopyLabel(hasSelection),\n handler: () => {\n const clipboardText = hasSelection && selection ? selection.toString() : text;\n copyTextToClipboard(clipboardText);\n\n if (afterEffect) {\n afterEffect();\n }\n },\n });\n }\n\n if (onCopyLink) {\n options.push({\n label: 'lng_context_copy_message_link',\n handler: () => {\n onCopyLink();\n\n if (afterEffect) {\n afterEffect();\n }\n },\n });\n }\n\n return options;\n}\n\nfunction getCopyLabel(hasSelection: boolean): string {\n if (hasSelection) {\n return 'lng_context_copy_selected';\n }\n return 'lng_context_copy_text';\n}\n","import React, { FC, useCallback } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\nimport { IAnchorPosition } from '../../../types';\n\nimport { getMessageCopyOptions } from './helpers/copyOptions';\nimport useContextMenuPosition from '../../../hooks/useContextMenuPosition';\nimport useLang from '../../../hooks/useLang';\n\nimport Menu from '../../ui/Menu';\nimport MenuItem from '../../ui/MenuItem';\n\nimport './MessageContextMenu.scss';\n\ntype OwnProps = {\n isOpen: boolean;\n anchor: IAnchorPosition;\n message: ApiMessage;\n canSendNow?: boolean;\n canReschedule?: boolean;\n canReply?: boolean;\n canPin?: boolean;\n canUnpin?: boolean;\n canDelete?: boolean;\n canReport?: boolean;\n canEdit?: boolean;\n canForward?: boolean;\n canFaveSticker?: boolean;\n canUnfaveSticker?: boolean;\n canCopy?: boolean;\n canCopyLink?: boolean;\n canSelect?: boolean;\n onReply: () => void;\n onEdit: () => void;\n onPin: () => void;\n onUnpin: () => void;\n onForward: () => void;\n onDelete: () => void;\n onReport: () => void;\n onFaveSticker: () => void;\n onUnfaveSticker: () => void;\n onSelect: () => void;\n onSend: () => void;\n onReschedule: () => void;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n onCopyLink?: () => void;\n};\n\nconst SCROLLBAR_WIDTH = 10;\n\nconst MessageContextMenu: FC = ({\n isOpen,\n message,\n anchor,\n canSendNow,\n canReschedule,\n canReply,\n canEdit,\n canPin,\n canUnpin,\n canDelete,\n canReport,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n onReply,\n onEdit,\n onPin,\n onUnpin,\n onForward,\n onDelete,\n onReport,\n onFaveSticker,\n onUnfaveSticker,\n onSelect,\n onSend,\n onReschedule,\n onClose,\n onCloseAnimationEnd,\n onCopyLink,\n}) => {\n const copyOptions = getMessageCopyOptions(message, onClose, canCopyLink ? onCopyLink : undefined);\n\n const getTriggerElement = useCallback(() => {\n return document.querySelector(`.active > .MessageList div[data-message-id=\"${message.id}\"]`);\n }, [message.id]);\n\n const getRootElement = useCallback(\n () => document.querySelector('.active > .MessageList'),\n [],\n );\n\n const getMenuElement = useCallback(\n () => document.querySelector('.MessageContextMenu .bubble'),\n [],\n );\n\n const { positionX, positionY, style } = useContextMenuPosition(\n anchor,\n getTriggerElement,\n getRootElement,\n getMenuElement,\n SCROLLBAR_WIDTH,\n (document.querySelector('.MiddleHeader') as HTMLElement).offsetHeight,\n );\n\n const lang = useLang();\n\n return (\n \n {canSendNow && {lang('MessageScheduleSend')}}\n {canReschedule && (\n {lang('MessageScheduleEditTime')}\n )}\n {canReply && {lang('Reply')}}\n {canEdit && {lang('Edit')}}\n {canFaveSticker && (\n {lang('AddToFavorites')}\n )}\n {canUnfaveSticker && (\n {lang('Stickers.RemoveFromFavorites')}\n )}\n {canCopy && copyOptions.map((options) => (\n {lang(options.label)}\n ))}\n {canPin && {lang('DialogPin')}}\n {canUnpin && {lang('DialogUnpin')}}\n {canForward && {lang('Forward')}}\n {canSelect && {lang('Common.Select')}}\n {canReport && {lang('lng_context_report_msg')}}\n {canDelete && {lang('Delete')}}\n \n );\n};\n\nexport default MessageContextMenu;\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions, MessageListType } from '../../../global/types';\nimport { ApiMessage } from '../../../api/types';\nimport { IAlbum, IAnchorPosition } from '../../../types';\nimport { selectAllowedMessageActions, selectCurrentMessageList } from '../../../modules/selectors';\nimport { disableScrolling, enableScrolling } from '../../../util/scrollLock';\nimport { pick } from '../../../util/iteratees';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useFlag from '../../../hooks/useFlag';\n\nimport DeleteMessageModal from '../../common/DeleteMessageModal';\nimport ReportMessageModal from '../../common/ReportMessageModal';\nimport PinMessageModal from '../../common/PinMessageModal';\nimport MessageContextMenu from './MessageContextMenu';\nimport CalendarModal from '../../common/CalendarModal';\nimport { getDayStartAt } from '../../../util/dateFormat';\nimport { copyTextToClipboard } from '../../../util/clipboard';\n\nexport type OwnProps = {\n isOpen: boolean;\n chatUsername?: string;\n message: ApiMessage;\n album?: IAlbum;\n anchor: IAnchorPosition;\n messageListType: MessageListType;\n onClose: () => void;\n onCloseAnimationEnd: () => void;\n};\n\ntype StateProps = {\n noOptions?: boolean;\n canSendNow?: boolean;\n canReschedule?: boolean;\n canReply?: boolean;\n canPin?: boolean;\n canUnpin?: boolean;\n canDelete?: boolean;\n canReport?: boolean;\n canEdit?: boolean;\n canForward?: boolean;\n canFaveSticker?: boolean;\n canUnfaveSticker?: boolean;\n canCopy?: boolean;\n canCopyLink?: boolean;\n canSelect?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst ContextMenuContainer: FC = ({\n isOpen,\n messageListType,\n chatUsername,\n message,\n album,\n anchor,\n onClose,\n onCloseAnimationEnd,\n noOptions,\n canSendNow,\n canReschedule,\n canReply,\n canPin,\n canUnpin,\n canDelete,\n canReport,\n canEdit,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n setReplyingToId,\n setEditingId,\n pinMessage,\n openForwardMenu,\n faveSticker,\n unfaveSticker,\n toggleMessageSelection,\n sendScheduledMessages,\n rescheduleMessage,\n}) => {\n const { transitionClassNames } = useShowTransition(isOpen, onCloseAnimationEnd, undefined, false);\n const [isMenuOpen, setIsMenuOpen] = useState(true);\n const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);\n const [isReportModalOpen, setIsReportModalOpen] = useState(false);\n const [isPinModalOpen, setIsPinModalOpen] = useState(false);\n const [isCalendarOpen, openCalendar, closeCalendar] = useFlag();\n\n const handleDelete = useCallback(() => {\n setIsMenuOpen(false);\n setIsDeleteModalOpen(true);\n }, []);\n\n const handleReport = useCallback(() => {\n setIsMenuOpen(false);\n setIsReportModalOpen(true);\n }, []);\n\n const closeMenu = useCallback(() => {\n setIsMenuOpen(false);\n onClose();\n }, [onClose]);\n\n const closeDeleteModal = useCallback(() => {\n setIsDeleteModalOpen(false);\n onClose();\n }, [onClose]);\n\n const closeReportModal = useCallback(() => {\n setIsReportModalOpen(false);\n onClose();\n }, [onClose]);\n\n const closePinModal = useCallback(() => {\n setIsPinModalOpen(false);\n onClose();\n }, [onClose]);\n\n const handleCloseCalendar = useCallback(() => {\n closeCalendar();\n onClose();\n }, [closeCalendar, onClose]);\n\n const handleReply = useCallback(() => {\n setReplyingToId({ messageId: message.id });\n closeMenu();\n }, [setReplyingToId, message.id, closeMenu]);\n\n const handleEdit = useCallback(() => {\n setEditingId({ messageId: message.id });\n closeMenu();\n }, [setEditingId, message.id, closeMenu]);\n\n const handlePin = useCallback(() => {\n setIsMenuOpen(false);\n setIsPinModalOpen(true);\n }, []);\n\n const handleUnpin = useCallback(() => {\n pinMessage({ messageId: message.id, isUnpin: true });\n closeMenu();\n }, [pinMessage, message.id, closeMenu]);\n\n const handleForward = useCallback(() => {\n closeMenu();\n if (album?.messages) {\n const messageIds = album.messages.map(({ id }) => id);\n openForwardMenu({ fromChatId: message.chatId, messageIds });\n } else {\n openForwardMenu({ fromChatId: message.chatId, messageIds: [message.id] });\n }\n }, [openForwardMenu, message, closeMenu, album]);\n\n const handleFaveSticker = useCallback(() => {\n closeMenu();\n faveSticker({ sticker: message.content.sticker });\n }, [closeMenu, message.content.sticker, faveSticker]);\n\n const handleUnfaveSticker = useCallback(() => {\n closeMenu();\n unfaveSticker({ sticker: message.content.sticker });\n }, [closeMenu, message.content.sticker, unfaveSticker]);\n\n const handleSelectMessage = useCallback(() => {\n const params = album?.messages\n ? {\n messageId: message.id,\n childMessageIds: album.messages.map(({ id }) => id),\n withShift: false,\n }\n : { messageId: message.id, withShift: false };\n\n toggleMessageSelection(params);\n closeMenu();\n }, [closeMenu, message.id, toggleMessageSelection, album]);\n\n const handleScheduledMessageSend = useCallback(() => {\n sendScheduledMessages({ chatId: message.chatId, id: message.id });\n closeMenu();\n }, [closeMenu, message.chatId, message.id, sendScheduledMessages]);\n\n const handleOpenCalendar = useCallback(() => {\n setIsMenuOpen(false);\n openCalendar();\n }, [openCalendar]);\n\n const handleRescheduleMessage = useCallback((date: Date) => {\n rescheduleMessage({\n chatId: message.chatId,\n messageId: message.id,\n scheduledAt: Math.round(date.getTime() / 1000),\n });\n }, [message.chatId, message.id, rescheduleMessage]);\n\n const handleCopyLink = useCallback(() => {\n copyTextToClipboard(`https://t.me/${chatUsername || `c/${Math.abs(message.chatId)}`}/${message.id}`);\n closeMenu();\n }, [chatUsername, closeMenu, message.chatId, message.id]);\n\n useEffect(() => {\n disableScrolling();\n\n return enableScrolling;\n }, []);\n\n const reportMessageIds = useMemo(() => (album ? album.messages : [message]).map(({ id }) => id), [album, message]);\n\n if (noOptions) {\n closeMenu();\n\n return undefined;\n }\n\n const scheduledMaxDate = new Date();\n scheduledMaxDate.setFullYear(scheduledMaxDate.getFullYear() + 1);\n\n return (\n
\n \n \n \n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { message, messageListType }): StateProps => {\n const { threadId } = selectCurrentMessageList(global) || {};\n const {\n noOptions,\n canReply,\n canPin,\n canUnpin,\n canDelete,\n canReport,\n canEdit,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n } = (threadId && selectAllowedMessageActions(global, message, threadId)) || {};\n const isPinned = messageListType === 'pinned';\n const isScheduled = messageListType === 'scheduled';\n\n return {\n noOptions,\n canSendNow: isScheduled,\n canReschedule: isScheduled,\n canReply: !isPinned && !isScheduled && canReply,\n canPin: !isScheduled && canPin,\n canUnpin: !isScheduled && canUnpin,\n canDelete,\n canReport,\n canEdit: !isPinned && canEdit,\n canForward: !isScheduled && canForward,\n canFaveSticker: !isScheduled && canFaveSticker,\n canUnfaveSticker: !isScheduled && canUnfaveSticker,\n canCopy,\n canCopyLink: !isScheduled && canCopyLink,\n canSelect,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setReplyingToId',\n 'setEditingId',\n 'pinMessage',\n 'openForwardMenu',\n 'faveSticker',\n 'unfaveSticker',\n 'toggleMessageSelection',\n 'sendScheduledMessages',\n 'rescheduleMessage',\n ]),\n)(ContextMenuContainer));\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiSticker, ApiStickerSet } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\n\nimport { STICKER_SIZE_MODAL } from '../../config';\nimport { pick } from '../../util/iteratees';\nimport { selectStickerSet, selectStickerSetByShortName } from '../../modules/selectors';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\nimport renderText from './helpers/renderText';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\nimport Loading from '../ui/Loading';\nimport StickerButton from './StickerButton';\n\nimport './StickerSetModal.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n fromSticker?: ApiSticker;\n stickerSetShortName?: string;\n onClose: () => void;\n};\n\ntype StateProps = {\n stickerSet?: ApiStickerSet;\n};\n\ntype DispatchProps = Pick;\n\nconst INTERSECTION_THROTTLE = 200;\n\nconst StickerSetModal: FC = ({\n isOpen,\n fromSticker,\n stickerSetShortName,\n stickerSet,\n onClose,\n loadStickers,\n toggleStickerSet,\n sendMessage,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const lang = useLang();\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, throttleMs: INTERSECTION_THROTTLE, isDisabled: !isOpen });\n\n useEffect(() => {\n if (isOpen) {\n if (fromSticker) {\n const { stickerSetId, stickerSetAccessHash } = fromSticker;\n loadStickers({\n stickerSetId,\n stickerSetAccessHash,\n });\n } else if (stickerSetShortName) {\n loadStickers({\n stickerSetShortName,\n });\n }\n }\n }, [isOpen, fromSticker, loadStickers, stickerSetShortName]);\n\n const handleSelect = useCallback((sticker: ApiSticker) => {\n sticker = {\n ...sticker,\n isPreloadedGlobally: true,\n };\n\n sendMessage({ sticker });\n onClose();\n }, [onClose, sendMessage]);\n\n const handleButtonClick = useCallback(() => {\n if (stickerSet) {\n toggleStickerSet({ stickerSetId: stickerSet.id });\n onClose();\n }\n }, [onClose, stickerSet, toggleStickerSet]);\n\n return (\n \n {stickerSet?.stickers ? (\n <>\n
\n {stickerSet.stickers.map((sticker) => (\n \n ))}\n
\n
\n \n {lang(\n stickerSet.installedDate ? 'StickerPack.RemoveStickerCount' : 'StickerPack.AddStickerCount',\n stickerSet.count,\n 'i',\n )}\n \n
\n \n ) : (\n \n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { fromSticker, stickerSetShortName }: OwnProps) => {\n return {\n stickerSet: fromSticker\n ? selectStickerSet(global, fromSticker.stickerSetId)\n : stickerSetShortName\n ? selectStickerSetByShortName(global, stickerSetShortName)\n : undefined,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadStickers',\n 'toggleStickerSet',\n 'sendMessage',\n ]),\n)(StickerSetModal));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat } from '../../api/types';\nimport { IAnchorPosition } from '../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { disableScrolling, enableScrolling } from '../../util/scrollLock';\nimport { selectChat, selectNotifySettings, selectNotifyExceptions } from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\nimport { isChatPrivate, getCanDeleteChat, selectIsChatMuted } from '../../modules/helpers';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useLang from '../../hooks/useLang';\n\nimport Portal from '../ui/Portal';\nimport Menu from '../ui/Menu';\nimport MenuItem from '../ui/MenuItem';\nimport DeleteChatModal from '../common/DeleteChatModal';\n\nimport './HeaderMenuContainer.scss';\n\ntype DispatchProps = Pick;\n\nexport type OwnProps = {\n chatId: number;\n threadId: number;\n isOpen: boolean;\n anchor: IAnchorPosition;\n isChannel?: boolean;\n canStartBot?: boolean;\n canRestartBot?: boolean;\n canSubscribe?: boolean;\n canSearch?: boolean;\n canMute?: boolean;\n canLeave?: boolean;\n onSubscribeChannel: () => void;\n onSearchClick: () => void;\n onClose: () => void;\n onCloseAnimationEnd: () => void;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n isPrivate?: boolean;\n isMuted?: boolean;\n canDeleteChat?: boolean;\n};\n\nconst HeaderMenuContainer: FC = ({\n chatId,\n isOpen,\n anchor,\n isChannel,\n canStartBot,\n canRestartBot,\n canSubscribe,\n canSearch,\n canMute,\n canLeave,\n chat,\n isPrivate,\n isMuted,\n canDeleteChat,\n onSubscribeChannel,\n onSearchClick,\n onClose,\n onCloseAnimationEnd,\n updateChatMutedState,\n enterMessageSelectMode,\n sendBotCommand,\n restartBot,\n}) => {\n const [isMenuOpen, setIsMenuOpen] = useState(true);\n const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);\n const { x, y } = anchor;\n\n useShowTransition(isOpen, onCloseAnimationEnd, undefined, false);\n\n const handleDelete = useCallback(() => {\n setIsMenuOpen(false);\n setIsDeleteModalOpen(true);\n }, []);\n\n const closeMenu = useCallback(() => {\n setIsMenuOpen(false);\n onClose();\n }, [onClose]);\n\n const closeDeleteModal = useCallback(() => {\n setIsDeleteModalOpen(false);\n onClose();\n }, [onClose]);\n\n const handleStartBot = useCallback(() => {\n sendBotCommand({ command: '/start' });\n }, [sendBotCommand]);\n\n const handleRestartBot = useCallback(() => {\n restartBot({ chatId });\n }, [chatId, restartBot]);\n\n const handleToggleMuteClick = useCallback(() => {\n updateChatMutedState({ chatId, isMuted: !isMuted });\n closeMenu();\n }, [chatId, closeMenu, isMuted, updateChatMutedState]);\n\n const handleSubscribe = useCallback(() => {\n onSubscribeChannel();\n closeMenu();\n }, [closeMenu, onSubscribeChannel]);\n\n const handleSearch = useCallback(() => {\n onSearchClick();\n closeMenu();\n }, [closeMenu, onSearchClick]);\n\n const handleSelectMessages = useCallback(() => {\n enterMessageSelectMode();\n closeMenu();\n }, [closeMenu, enterMessageSelectMode]);\n\n useEffect(() => {\n disableScrolling();\n\n return enableScrolling;\n }, []);\n\n const lang = useLang();\n\n return (\n \n
\n \n {IS_SINGLE_COLUMN_LAYOUT && canStartBot && (\n \n {lang('BotStart')}\n \n )}\n {IS_SINGLE_COLUMN_LAYOUT && canRestartBot && (\n \n {lang('BotRestart')}\n \n )}\n {IS_SINGLE_COLUMN_LAYOUT && canSubscribe && (\n \n {lang(isChannel ? 'Subscribe' : 'Join Group')}\n \n )}\n {IS_SINGLE_COLUMN_LAYOUT && canSearch && (\n \n {lang('Search')}\n \n )}\n {canMute && (\n \n {lang(isMuted ? 'ChatsUnmute' : 'ChatsMute')}\n \n )}\n \n {lang('ReportSelectMessages')}\n \n {canLeave && (\n \n {lang(isPrivate\n ? 'DeleteChatUser'\n : (canDeleteChat ? 'GroupInfo.DeleteAndExit' : (isChannel ? 'LeaveChannel' : 'Group.LeaveGroup')))}\n \n )}\n \n {chat && (\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n if (!chat || chat.isRestricted) {\n return {};\n }\n\n return {\n chat,\n isMuted: selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global)),\n isPrivate: isChatPrivate(chat.id),\n canDeleteChat: getCanDeleteChat(chat),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'updateChatMutedState',\n 'enterMessageSelectMode',\n 'sendBotCommand',\n 'restartBot',\n ]),\n)(HeaderMenuContainer));\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState, useLayoutEffect,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\n\nimport { debounce } from '../../util/schedulers';\nimport { selectCurrentTextSearch, selectCurrentChat } from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\nimport { getDayStartAt } from '../../util/dateFormat';\n\nimport Button from '../ui/Button';\nimport SearchInput from '../ui/SearchInput';\n\nimport './MobileSearch.scss';\n\nexport type OwnProps = {\n isActive: boolean;\n};\n\ntype StateProps = {\n isActive?: boolean;\n chat?: ApiChat;\n query?: string;\n totalCount?: number;\n foundIds?: number[];\n isHistoryCalendarOpen?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst runDebouncedForSearch = debounce((cb) => cb(), 200, false);\n\nconst MobileSearchFooter: FC = ({\n isActive,\n chat,\n query,\n totalCount,\n foundIds,\n isHistoryCalendarOpen,\n setLocalTextSearchQuery,\n searchTextMessagesLocal,\n focusMessage,\n closeLocalTextSearch,\n openHistoryCalendar,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const [focusedIndex, setFocusedIndex] = useState(0);\n\n // Fix for iOS keyboard\n useEffect(() => {\n const { visualViewport } = window as any;\n if (!visualViewport) {\n return undefined;\n }\n\n const mainEl = document.getElementById('Main') as HTMLDivElement;\n const handleResize = () => {\n const { activeElement } = document;\n if (activeElement && (activeElement === inputRef.current)) {\n const { pageTop, height } = visualViewport;\n mainEl.style.transform = `translateY(${pageTop}px)`;\n mainEl.style.height = `${height}px`;\n document.documentElement.scrollTop = pageTop;\n } else {\n mainEl.style.transform = '';\n mainEl.style.height = '';\n }\n };\n\n visualViewport.addEventListener('resize', handleResize);\n\n return () => {\n visualViewport.removeEventListener('resize', handleResize);\n };\n }, []);\n\n // Focus message\n useEffect(() => {\n if (chat && foundIds && foundIds.length) {\n focusMessage({ chatId: chat.id, messageId: foundIds[foundIds.length - 1] });\n setFocusedIndex(0);\n } else {\n setFocusedIndex(-1);\n }\n }, [chat, focusMessage, foundIds]);\n\n // Disable native up/down buttons on iOS\n useEffect(() => {\n Array.from(document.querySelectorAll('input')).forEach((input) => {\n input.disabled = Boolean(isActive && input !== inputRef.current);\n });\n\n Array.from(document.querySelectorAll('div[contenteditable]')).forEach((div) => {\n div.contentEditable = isActive ? 'false' : 'true';\n });\n }, [isActive]);\n\n // Blur on exit\n useEffect(() => {\n if (!isActive) {\n inputRef.current!.blur();\n }\n }, [isActive]);\n\n useLayoutEffect(() => {\n const searchInput = document.querySelector('#MobileSearch input')!;\n searchInput.blur();\n }, [isHistoryCalendarOpen]);\n\n const handleMessageSearchQueryChange = useCallback((newQuery: string) => {\n setLocalTextSearchQuery({ query: newQuery });\n\n if (newQuery.length) {\n runDebouncedForSearch(searchTextMessagesLocal);\n }\n }, [searchTextMessagesLocal, setLocalTextSearchQuery]);\n\n const handleUp = useCallback(() => {\n if (chat && foundIds) {\n const newFocusIndex = focusedIndex + 1;\n focusMessage({ chatId: chat.id, messageId: foundIds[foundIds.length - 1 - newFocusIndex] });\n setFocusedIndex(newFocusIndex);\n }\n }, [chat, focusedIndex, focusMessage, foundIds]);\n\n const handleDown = useCallback(() => {\n if (chat && foundIds) {\n const newFocusIndex = focusedIndex - 1;\n focusMessage({ chatId: chat.id, messageId: foundIds[foundIds.length - 1 - newFocusIndex] });\n setFocusedIndex(newFocusIndex);\n }\n }, [chat, focusedIndex, focusMessage, foundIds]);\n\n return (\n
\n
\n \n \n \n \n
\n
\n
\n {query ? (\n foundIds?.length ? (\n `${focusedIndex + 1} of ${totalCount}`\n ) : foundIds && !foundIds.length ? (\n 'No results'\n ) : (\n ''\n )\n ) : (\n openHistoryCalendar({ selectedAt: getDayStartAt(Date.now()) })}\n ariaLabel=\"Search messages by date\"\n >\n \n \n )}\n
\n \n \n \n \n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return {};\n }\n\n const { query, results } = selectCurrentTextSearch(global) || {};\n const { totalCount, foundIds } = results || {};\n\n return {\n chat,\n query,\n totalCount,\n foundIds,\n isHistoryCalendarOpen: Boolean(global.historyCalendarSelectedAt),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setLocalTextSearchQuery',\n 'searchTextMessagesLocal',\n 'focusMessage',\n 'closeLocalTextSearch',\n 'openHistoryCalendar',\n ]),\n)(MobileSearchFooter));\n","export default function findInViewport(\n container: HTMLElement,\n selectorOrElements: string | NodeListOf,\n margin = 0,\n isDense = false,\n shouldContainBottom = false,\n isHorizontal = false,\n) {\n const viewportY1 = container[isHorizontal ? 'scrollLeft' : 'scrollTop'];\n const viewportY2 = viewportY1 + container[isHorizontal ? 'offsetWidth' : 'offsetHeight'];\n const allElements = typeof selectorOrElements === 'string'\n ? container.querySelectorAll(selectorOrElements)\n : selectorOrElements;\n const { length } = allElements;\n const visibleIndexes: number[] = [];\n let isFound = false;\n\n for (let i = 0; i < length; i++) {\n const element = allElements[i];\n const y1 = element[isHorizontal ? 'offsetLeft' : 'offsetTop'];\n const y2 = y1 + element[isHorizontal ? 'offsetWidth' : 'offsetHeight'];\n const isVisible = shouldContainBottom\n ? y2 >= viewportY1 - margin && y2 <= viewportY2 + margin\n : y1 <= viewportY2 + margin && y2 >= viewportY1 - margin;\n\n if (isVisible) {\n visibleIndexes.push(i);\n isFound = true;\n } else if (isFound && !isDense) {\n break;\n }\n }\n\n return { allElements, visibleIndexes };\n}\n","function isFullyVisible(container: HTMLElement, element: HTMLElement, isHorizontal = false) {\n const viewportY1 = container[isHorizontal ? 'scrollLeft' : 'scrollTop'];\n const viewportY2 = viewportY1 + container[isHorizontal ? 'offsetWidth' : 'offsetHeight'];\n const y1 = element[isHorizontal ? 'offsetLeft' : 'offsetTop'];\n const y2 = y1 + element[isHorizontal ? 'offsetWidth' : 'offsetHeight'];\n return y1 > viewportY1 && y2 < viewportY2;\n}\n\nexport default isFullyVisible;\n","import findInViewport from './findInViewport';\nimport isFullyVisible from './isFullyVisible';\nimport fastSmoothScroll from './fastSmoothScroll';\n\nconst VIEWPORT_MARGIN = 8;\nconst SCROLL_MARGIN = 10;\n\nexport default function setTooltipItemVisible(selector: string, index: number, containerRef: Record) {\n const container = containerRef.current!;\n if (!container || index < 0) {\n return;\n }\n const { visibleIndexes, allElements } = findInViewport(\n container,\n selector,\n VIEWPORT_MARGIN,\n true,\n true,\n );\n\n if (!allElements.length || !allElements[index]) {\n return;\n }\n const first = visibleIndexes[0];\n if (!visibleIndexes.includes(index)\n || (index === first && !isFullyVisible(container, allElements[first]))) {\n const position = index > visibleIndexes[visibleIndexes.length - 1] ? 'start' : 'end';\n fastSmoothScroll(container, allElements[index], position, SCROLL_MARGIN);\n }\n}\n","import { useCallback, useEffect, useState } from '../../../../lib/teact/teact';\nimport captureKeyboardListeners from '../../../../util/captureKeyboardListeners';\nimport cycleRestrict from '../../../../util/cycleRestrict';\n\nexport function useKeyboardNavigation({\n isActive,\n isHorizontal,\n shouldRemoveSelectionOnReset,\n noArrowNavigation,\n items,\n shouldSelectOnTab,\n onSelect,\n onClose,\n}: {\n isActive: boolean;\n isHorizontal?: boolean;\n shouldRemoveSelectionOnReset?: boolean;\n noArrowNavigation?: boolean;\n items?: any[];\n shouldSelectOnTab?: boolean;\n onSelect: AnyToVoidFunction;\n onClose: NoneToVoidFunction;\n}) {\n const [selectedItemIndex, setSelectedItemIndex] = useState(-1);\n\n const getSelectedIndex = useCallback((newIndex: number) => {\n if (!items) {\n return -1;\n }\n\n return cycleRestrict(items.length, newIndex);\n }, [items]);\n\n const handleArrowKey = useCallback((value: number, e: KeyboardEvent) => {\n e.preventDefault();\n setSelectedItemIndex((index) => (getSelectedIndex(index + value)));\n }, [setSelectedItemIndex, getSelectedIndex]);\n\n const handleItemSelect = useCallback((e: KeyboardEvent) => {\n if (items && items.length && selectedItemIndex > -1) {\n const item = items[selectedItemIndex];\n if (item) {\n e.preventDefault();\n onSelect(item);\n }\n }\n }, [items, onSelect, selectedItemIndex]);\n\n useEffect(() => {\n setSelectedItemIndex(shouldRemoveSelectionOnReset ? -1 : 0);\n }, [items, shouldRemoveSelectionOnReset]);\n\n useEffect(() => (isActive ? captureKeyboardListeners({\n onEsc: onClose,\n onUp: noArrowNavigation || isHorizontal ? undefined : (e: KeyboardEvent) => handleArrowKey(-1, e),\n onDown: noArrowNavigation || isHorizontal ? undefined : (e: KeyboardEvent) => handleArrowKey(1, e),\n onLeft: noArrowNavigation || !isHorizontal ? undefined : (e: KeyboardEvent) => handleArrowKey(-1, e),\n onRight: noArrowNavigation || !isHorizontal ? undefined : (e: KeyboardEvent) => handleArrowKey(1, e),\n onTab: shouldSelectOnTab ? handleItemSelect : undefined,\n onEnter: handleItemSelect,\n }) : undefined), [\n noArrowNavigation, handleArrowKey, handleItemSelect, isActive, isHorizontal, onClose, shouldSelectOnTab,\n ]);\n\n return selectedItemIndex;\n}\n","import React, {\n FC, useCallback, useEffect, useRef, memo,\n} from '../../../lib/teact/teact';\nimport usePrevious from '../../../hooks/usePrevious';\n\nimport { ApiUser } from '../../../api/types';\n\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\nimport setTooltipItemVisible from '../../../util/setTooltipItemVisible';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\n\nimport ListItem from '../../ui/ListItem';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\nimport './MentionTooltip.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onClose: () => void;\n onInsertUserName: (user: ApiUser, forceFocus?: boolean) => void;\n filteredUsers?: ApiUser[];\n usersById?: Record;\n};\n\nconst MentionTooltip: FC = ({\n isOpen,\n onClose,\n onInsertUserName,\n usersById,\n filteredUsers,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n\n const handleUserSelect = useCallback((userId: number, forceFocus = false) => {\n const user = usersById?.[userId];\n if (!user) {\n return;\n }\n\n onInsertUserName(user, forceFocus);\n }, [usersById, onInsertUserName]);\n\n const handleSelectMention = useCallback((member: ApiUser) => {\n handleUserSelect(member.id, true);\n }, [handleUserSelect]);\n\n const selectedMentionIndex = useKeyboardNavigation({\n isActive: isOpen,\n items: filteredUsers,\n onSelect: handleSelectMention,\n shouldSelectOnTab: true,\n onClose,\n });\n\n useEffect(() => {\n setTooltipItemVisible('.chat-item-clickable', selectedMentionIndex, containerRef);\n }, [selectedMentionIndex]);\n\n useEffect(() => {\n if (filteredUsers && !filteredUsers.length) {\n onClose();\n }\n }, [filteredUsers, onClose]);\n\n const prevChatMembers = usePrevious(\n filteredUsers?.length\n ? filteredUsers\n : undefined,\n shouldRender,\n );\n const renderedChatMembers = filteredUsers && !filteredUsers.length\n ? prevChatMembers\n : filteredUsers;\n\n if (!shouldRender || (renderedChatMembers && !renderedChatMembers.length)) {\n return undefined;\n }\n\n const className = buildClassName(\n 'MentionTooltip composer-tooltip custom-scroll',\n transitionClassNames,\n );\n\n return (\n
\n {renderedChatMembers?.map(({ id }, index) => (\n handleUserSelect(id)}\n focus={selectedMentionIndex === index}\n >\n \n \n ))}\n
\n );\n};\n\nexport default memo(MentionTooltip);\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiAttachment, ApiChatMember, ApiUser } from '../../../api/types';\n\nimport { CONTENT_TYPES_FOR_QUICK_UPLOAD, EDITABLE_INPUT_MODAL_ID } from '../../../config';\nimport { getFileExtension } from '../../common/helpers/documentInfo';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useMentionTooltip from './hooks/useMentionTooltip';\nimport useEmojiTooltip from './hooks/useEmojiTooltip';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\n\nimport Button from '../../ui/Button';\nimport Modal from '../../ui/Modal';\nimport File from '../../common/File';\nimport MessageInput from './MessageInput';\nimport MentionTooltip from './MentionTooltip';\nimport EmojiTooltip from './EmojiTooltip.async';\n\nimport './AttachmentModal.scss';\n\nexport type OwnProps = {\n attachments: ApiAttachment[];\n caption: string;\n isReady?: boolean;\n currentUserId?: number;\n groupChatMembers?: ApiChatMember[];\n usersById?: Record;\n recentEmojis: string[];\n baseEmojiKeywords?: Record;\n emojiKeywords?: Record;\n addRecentEmoji: AnyToVoidFunction;\n onCaptionUpdate: (html: string) => void;\n onSend: () => void;\n onFileAppend: (files: File[], isQuick: boolean) => void;\n onClear: () => void;\n};\n\nconst DROP_LEAVE_TIMEOUT_MS = 150;\n\nconst AttachmentModal: FC = ({\n attachments,\n caption,\n isReady,\n currentUserId,\n groupChatMembers,\n usersById,\n recentEmojis,\n baseEmojiKeywords,\n emojiKeywords,\n addRecentEmoji,\n onCaptionUpdate,\n onSend,\n onFileAppend,\n onClear,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const hideTimeoutRef = useRef(null);\n const prevAttachments = usePrevious(attachments);\n const renderingAttachments = attachments.length ? attachments : prevAttachments;\n const isOpen = Boolean(attachments.length);\n const [isHovered, markHovered, unmarkHovered] = useFlag();\n const isQuick = Boolean(renderingAttachments && renderingAttachments.every((a) => a.quick));\n const lang = useLang();\n\n const {\n isMentionTooltipOpen, closeMentionTooltip, insertMention, mentionFilteredUsers,\n } = useMentionTooltip(\n isOpen,\n caption,\n onCaptionUpdate,\n EDITABLE_INPUT_MODAL_ID,\n groupChatMembers,\n undefined,\n currentUserId,\n usersById,\n );\n const {\n isEmojiTooltipOpen, closeEmojiTooltip, filteredEmojis, insertEmoji,\n } = useEmojiTooltip(\n isOpen,\n caption,\n recentEmojis,\n EDITABLE_INPUT_MODAL_ID,\n onCaptionUpdate,\n baseEmojiKeywords,\n emojiKeywords,\n !isReady,\n );\n\n useEffect(() => (isOpen ? captureEscKeyListener(onClear) : undefined), [isOpen, onClear]);\n\n const sendAttachments = useCallback(() => {\n if (isOpen) {\n onSend();\n }\n }, [isOpen, onSend]);\n\n const handleDragLeave = (e: React.DragEvent) => {\n const { relatedTarget: toTarget, target: fromTarget } = e;\n\n // Esc button pressed during drag event\n if ((fromTarget as HTMLDivElement).matches('.drop-target') && !toTarget) {\n hideTimeoutRef.current = window.setTimeout(unmarkHovered, DROP_LEAVE_TIMEOUT_MS);\n }\n\n // Prevent DragLeave event from firing when the pointer moves inside the AttachmentModal drop target\n if (fromTarget && (fromTarget as HTMLElement).closest('.AttachmentModal.hovered')) {\n return;\n }\n\n if (toTarget) {\n e.stopPropagation();\n }\n\n unmarkHovered();\n };\n\n const handleFilesDrop = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n unmarkHovered();\n\n const { dataTransfer: { files } } = e;\n\n if (files?.length) {\n const newFiles = isQuick\n ? Array.from(files).filter((file) => {\n return file.type && CONTENT_TYPES_FOR_QUICK_UPLOAD.has(file.type);\n })\n : Array.from(files);\n\n onFileAppend(newFiles, isQuick);\n }\n }, [isQuick, onFileAppend, unmarkHovered]);\n\n function handleDragOver(e: React.MouseEvent) {\n e.preventDefault();\n e.stopPropagation();\n\n if (hideTimeoutRef.current) {\n window.clearTimeout(hideTimeoutRef.current);\n }\n }\n\n if (!renderingAttachments) {\n return undefined;\n }\n\n const areAllPhotos = renderingAttachments.every((a) => a.mimeType.startsWith('image/'));\n const areAllVideos = renderingAttachments.every((a) => a.mimeType.startsWith('video/'));\n\n let title = '';\n if (areAllPhotos) {\n title = lang('PreviewSender.SendPhoto', renderingAttachments.length, 'i');\n } else if (areAllVideos) {\n title = lang('PreviewSender.SendVideo', renderingAttachments.length, 'i');\n } else {\n title = lang('PreviewSender.SendFile', renderingAttachments.length, 'i');\n }\n\n function renderHeader() {\n if (!renderingAttachments) {\n return undefined;\n }\n\n return (\n
\n \n
{title}
\n \n {lang('Send')}\n \n
\n );\n }\n\n return (\n \n \n {isQuick ? (\n
\n {renderingAttachments.map((attachment) => (\n attachment.mimeType.startsWith('image/')\n ? \"\"\n :
\n ) : (\n
\n {renderingAttachments.map((attachment) => (\n \n ))}\n
\n )}\n\n
\n \n \n \n
\n \n \n );\n};\n\nexport default memo(AttachmentModal);\n","import { ChangeEvent, RefObject } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { ApiNewPoll } from '../../../api/types';\n\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport parseMessageInput from './helpers/parseMessageInput';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\nimport Modal from '../../ui/Modal';\nimport InputText from '../../ui/InputText';\nimport Checkbox from '../../ui/Checkbox';\nimport RadioGroup from '../../ui/RadioGroup';\n\nimport './PollModal.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onSend: (pollSummary: ApiNewPoll) => void;\n onClear: () => void;\n};\n\nconst MAX_LIST_HEIGHT = 320;\nconst MAX_OPTIONS_COUNT = 10;\nconst MAX_OPTION_LENGTH = 100;\nconst MAX_QUESTION_LENGTH = 255;\nconst MAX_SOLUTION_LENGTH = 200;\n\nconst PollModal: FC = ({ isOpen, onSend, onClear }) => {\n // eslint-disable-next-line no-null/no-null\n const questionInputRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const optionsListRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const solutionRef = useRef(null);\n\n const [question, setQuestion] = useState('');\n const [options, setOptions] = useState(['']);\n const [isAnonymous, setIsAnonymous] = useState(true);\n const [isMultipleAnswers, setIsMultipleAnswers] = useState(false);\n const [isQuizMode, setIsQuizMode] = useState(false);\n const [solution, setSolution] = useState();\n const [correctOption, setCorrectOption] = useState();\n const [hasErrors, setHasErrors] = useState(false);\n\n const lang = useLang();\n\n const focusInput = useCallback((ref: RefObject) => {\n if (isOpen && ref.current) {\n ref.current.focus();\n }\n }, [isOpen]);\n\n useEffect(() => (isOpen ? captureEscKeyListener(onClear) : undefined), [isOpen, onClear]);\n useEffect(() => {\n if (!isOpen) {\n setQuestion('');\n setOptions(['']);\n setIsAnonymous(true);\n setIsMultipleAnswers(false);\n setIsQuizMode(false);\n setSolution('');\n setCorrectOption('');\n setHasErrors(false);\n }\n }, [isOpen]);\n\n useEffect(() => focusInput(questionInputRef), [focusInput, isOpen]);\n\n useLayoutEffect(() => {\n const solutionEl = solutionRef.current;\n\n if (solutionEl && solution !== solutionEl.innerHTML) {\n solutionEl.innerHTML = solution;\n }\n }, [solution]);\n\n const addNewOption = useCallback((newOptions: string[] = []) => {\n setOptions([...newOptions, '']);\n requestAnimationFrame(() => {\n const list = optionsListRef.current;\n if (!list) {\n return;\n }\n\n list.classList.toggle('overflown', list.scrollHeight > MAX_LIST_HEIGHT);\n list.scrollTo({ top: list.scrollHeight, behavior: 'smooth' });\n });\n }, []);\n\n const handleCreate = useCallback(() => {\n setHasErrors(false);\n if (!isOpen) {\n return;\n }\n\n const questionTrimmed = question.trim().substring(0, MAX_QUESTION_LENGTH);\n const optionsTrimmed = options.map((o) => o.trim().substring(0, MAX_OPTION_LENGTH)).filter((o) => o.length);\n\n if (!questionTrimmed || optionsTrimmed.length < 2) {\n setQuestion(questionTrimmed);\n if (optionsTrimmed.length) {\n if (optionsTrimmed.length < 2) {\n addNewOption(optionsTrimmed);\n } else {\n setOptions(optionsTrimmed);\n }\n } else {\n addNewOption();\n }\n setHasErrors(true);\n return;\n }\n\n if (isQuizMode && (!correctOption || !optionsTrimmed[Number(correctOption)])) {\n setHasErrors(true);\n return;\n }\n\n const answers = optionsTrimmed\n .map((text, index) => ({\n text: text.trim(),\n option: String(index),\n ...(String(index) === correctOption && { correct: true }),\n }));\n\n const payload: ApiNewPoll = {\n summary: {\n question: questionTrimmed,\n answers,\n ...(!isAnonymous && { isPublic: true }),\n ...(isMultipleAnswers && { multipleChoice: true }),\n ...(isQuizMode && { quiz: true }),\n },\n };\n\n if (isQuizMode) {\n const { text, entities } = (solution && parseMessageInput(solution.substring(0, MAX_SOLUTION_LENGTH))) || {};\n\n payload.quiz = {\n correctAnswers: [correctOption],\n ...(text && { solution: text }),\n ...(entities && { solutionEntities: entities }),\n };\n }\n\n onSend(payload);\n }, [\n isOpen,\n question,\n options,\n isQuizMode,\n correctOption,\n isAnonymous,\n isMultipleAnswers,\n onSend,\n addNewOption,\n solution,\n ]);\n\n const updateOption = useCallback((index: number, text: string) => {\n const newOptions = [...options];\n newOptions[index] = text;\n if (newOptions[newOptions.length - 1].trim().length && newOptions.length < MAX_OPTIONS_COUNT) {\n addNewOption(newOptions);\n } else {\n setOptions(newOptions);\n }\n }, [options, addNewOption]);\n\n const removeOption = useCallback((index: number) => {\n const newOptions = [...options];\n newOptions.splice(index, 1);\n setOptions(newOptions);\n requestAnimationFrame(() => {\n if (!optionsListRef.current) {\n return;\n }\n\n optionsListRef.current.classList.toggle('overflown', optionsListRef.current.scrollHeight > MAX_LIST_HEIGHT);\n });\n }, [options]);\n\n const handleCorrectOptionChange = useCallback((newValue: string) => {\n setCorrectOption(newValue);\n }, [setCorrectOption]);\n\n const handleIsAnonymousChange = useCallback((e: ChangeEvent) => {\n setIsAnonymous(e.target.checked);\n }, []);\n\n const handleMultipleAnswersChange = useCallback((e: ChangeEvent) => {\n setIsMultipleAnswers(e.target.checked);\n }, []);\n\n const handleQuizModeChange = useCallback((e: ChangeEvent) => {\n setIsQuizMode(e.target.checked);\n }, []);\n\n const handleKeyPress = useCallback((e: React.KeyboardEvent) => {\n if (e.keyCode === 13) {\n handleCreate();\n }\n }, [handleCreate]);\n\n const getQuestionError = useCallback(() => {\n if (hasErrors && !question.trim().length) {\n return lang('lng_polls_choose_question');\n }\n\n return undefined;\n }, [hasErrors, lang, question]);\n\n const getOptionsError = useCallback((index: number) => {\n const optionsTrimmed = options.map((o) => o.trim()).filter((o) => o.length);\n if (hasErrors && optionsTrimmed.length < 2 && !options[index].trim().length) {\n return lang('lng_polls_choose_answers');\n }\n return undefined;\n }, [hasErrors, lang, options]);\n\n function renderHeader() {\n return (\n
\n \n
{lang('NewPoll')}
\n \n {lang('Create')}\n \n
\n );\n }\n\n function renderOptions() {\n return options.map((option, index) => (\n
\n updateOption(index, e.currentTarget.value)}\n onKeyPress={handleKeyPress}\n />\n {index !== options.length - 1 && (\n removeOption(index)}\n >\n \n \n )}\n
\n ));\n }\n\n function renderRadioOptions() {\n return renderOptions()\n .map((label, index) => ({ value: String(index), label, hidden: index === options.length - 1 }));\n }\n\n function renderQuizNoOptionError() {\n const optionsTrimmed = options.map((o) => o.trim()).filter((o) => o.length);\n\n return isQuizMode && (!correctOption || !optionsTrimmed[Number(correctOption)]) && (\n

{lang('lng_polls_choose_correct')}

\n );\n }\n\n return (\n \n setQuestion(e.currentTarget.value)}\n onKeyPress={handleKeyPress}\n />\n
\n\n
\n

{lang('PollOptions')}

\n\n {hasErrors && renderQuizNoOptionError()}\n {isQuizMode ? (\n \n ) : (\n renderOptions()\n )}\n\n
\n\n
\n\n
\n \n \n \n {isQuizMode && (\n <>\n

{lang('lng_polls_solution_title')}

\n setSolution(e.currentTarget.innerHTML)}\n />\n
{lang('CreatePoll.ExplanationInfo')}
\n \n )}\n
\n \n );\n};\n\nexport default memo(PollModal);\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { IS_EMOJI_SUPPORTED } from '../../../util/environment';\n\nimport './EmojiButton.scss';\n\ntype OwnProps = {\n emoji: Emoji;\n focus?: boolean;\n onClick: (emoji: string, name: string) => void;\n};\n\nconst EmojiButton: FC = ({ emoji, focus, onClick }) => {\n const handleClick = useCallback((e: React.MouseEvent) => {\n // Preventing safari from losing focus on Composer MessageInput\n e.preventDefault();\n\n onClick(emoji.native, emoji.id);\n }, [emoji, onClick]);\n\n return (\n \n {IS_EMOJI_SUPPORTED ? emoji.native : \"\"}\n
\n );\n};\n\nexport default memo(EmojiButton);\n","import React, { FC, memo, useRef } from '../../../lib/teact/teact';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport windowSize from '../../../util/windowSize';\nimport { ObserveFn, useOnIntersect } from '../../../hooks/useIntersectionObserver';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useLang from '../../../hooks/useLang';\n\nimport EmojiButton from './EmojiButton';\n\nconst EMOJIS_PER_ROW_ON_DESKTOP = 9;\nconst EMOJI_MARGIN = 4;\nconst MOBILE_CONTAINER_PADDING = 8;\nconst EMOJI_SIZE = 40;\n\ntype OwnProps = {\n category: EmojiCategory;\n index: number;\n allEmojis: AllEmojis;\n observeIntersection: ObserveFn;\n shouldRender: boolean;\n onEmojiSelect: (emoji: string, name: string) => void;\n};\n\nconst EmojiCategory: FC = ({\n category, index, allEmojis, observeIntersection, shouldRender, onEmojiSelect,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n useOnIntersect(ref, observeIntersection);\n\n const { transitionClassNames } = useShowTransition(shouldRender, undefined, undefined, 'slow');\n\n const lang = useLang();\n\n const emojisPerRow = IS_SINGLE_COLUMN_LAYOUT\n ? Math.floor((windowSize.get().width - MOBILE_CONTAINER_PADDING) / (EMOJI_SIZE + EMOJI_MARGIN))\n : EMOJIS_PER_ROW_ON_DESKTOP;\n const height = Math.ceil(category.emojis.length / emojisPerRow) * (EMOJI_SIZE + EMOJI_MARGIN);\n\n return (\n \n

\n {lang(category.id === 'recent' ? 'RecentStickers' : `Emoji${index}`)}\n

\n \n {shouldRender && category.emojis.map((name) => {\n const emoji = allEmojis[name];\n // Recent emojis may contain emoticons that are no longer in the list\n if (!emoji) {\n return undefined;\n }\n // Some emojis have multiple skins and are represented as an Object with emojis for all skins.\n // For now, we select only the first emoji with 'neutral' skin.\n const displayedEmoji = 'id' in emoji ? emoji : emoji[1];\n\n return (\n \n );\n })}\n
\n \n );\n};\n\nexport default memo(EmojiCategory);\n","import React, {\n FC, useState, useEffect, memo, useRef, useMemo, useCallback,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\n\nimport { MENU_TRANSITION_DURATION } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport {\n EmojiModule,\n EmojiRawData,\n EmojiData,\n uncompressEmoji,\n} from '../../../util/emoji';\nimport fastSmoothScroll from '../../../util/fastSmoothScroll';\nimport buildClassName from '../../../util/buildClassName';\nimport { pick } from '../../../util/iteratees';\nimport fastSmoothScrollHorizontal from '../../../util/fastSmoothScrollHorizontal';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useHorizontalScroll from '../../../hooks/useHorizontalScroll';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\nimport Loading from '../../ui/Loading';\nimport EmojiCategory from './EmojiCategory';\n\nimport './EmojiPicker.scss';\n\ntype OwnProps = {\n className?: string;\n onEmojiSelect: (emoji: string, name: string) => void;\n};\n\ntype StateProps = Pick;\ntype EmojiCategoryData = { id: string; name: string; emojis: string[] };\n\nconst ICONS_BY_CATEGORY: Record = {\n recent: 'icon-recent',\n people: 'icon-smile',\n nature: 'icon-animals',\n foods: 'icon-eats',\n activity: 'icon-sport',\n places: 'icon-car',\n objects: 'icon-lamp',\n symbols: 'icon-language',\n flags: 'icon-flag',\n};\n\nconst OPEN_ANIMATION_DELAY = 200;\n// Only a few categories are above this height.\nconst SMOOTH_SCROLL_DISTANCE = 800;\nconst FOCUS_MARGIN = 50;\nconst HEADER_BUTTON_WIDTH = 42; // px. Includes margins\nconst INTERSECTION_THROTTLE = 200;\n\nconst categoryIntersections: boolean[] = [];\n\nlet emojiDataPromise: Promise;\nlet emojiRawData: EmojiRawData;\nlet emojiData: EmojiData;\n\nconst EmojiPicker: FC = ({\n className, onEmojiSelect, recentEmojis,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const headerRef = useRef(null);\n\n const [categories, setCategories] = useState();\n const [emojis, setEmojis] = useState();\n const [activeCategoryIndex, setActiveCategoryIndex] = useState(0);\n\n const { observe: observeIntersection } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE,\n }, (entries) => {\n entries.forEach((entry) => {\n const { id } = entry.target as HTMLDivElement;\n if (!id || !id.startsWith('emoji-category-')) {\n return;\n }\n\n const index = Number(id.replace('emoji-category-', ''));\n categoryIntersections[index] = entry.isIntersecting;\n });\n\n const intersectingWithIndexes = categoryIntersections\n .map((isIntersecting, index) => ({ index, isIntersecting }))\n .filter(({ isIntersecting }) => isIntersecting);\n\n if (!intersectingWithIndexes.length) {\n return;\n }\n\n setActiveCategoryIndex(intersectingWithIndexes[Math.floor(intersectingWithIndexes.length / 2)].index);\n });\n\n useHorizontalScroll(headerRef.current, !IS_SINGLE_COLUMN_LAYOUT);\n\n // Scroll header when active set updates\n useEffect(() => {\n if (!categories) {\n return;\n }\n\n const header = headerRef.current;\n if (!header) {\n return;\n }\n\n const newLeft = activeCategoryIndex * HEADER_BUTTON_WIDTH - header.offsetWidth / 2 + HEADER_BUTTON_WIDTH / 2;\n\n fastSmoothScrollHorizontal(header, newLeft);\n }, [categories, activeCategoryIndex]);\n\n const lang = useLang();\n\n const allCategories = useMemo(() => {\n if (!categories) {\n return MEMO_EMPTY_ARRAY;\n }\n const themeCategories = [...categories];\n if (recentEmojis?.length) {\n themeCategories.unshift({\n id: 'recent',\n name: lang('RecentStickers'),\n emojis: recentEmojis,\n });\n }\n\n return themeCategories;\n }, [categories, lang, recentEmojis]);\n\n // Initialize data on first render.\n useEffect(() => {\n setTimeout(() => {\n const exec = () => {\n setCategories(emojiData.categories);\n\n setEmojis(emojiData.emojis as AllEmojis);\n };\n\n if (emojiData) {\n exec();\n } else {\n ensureEmojiData()\n .then(exec);\n }\n }, OPEN_ANIMATION_DELAY);\n }, []);\n\n const selectCategory = useCallback((index: number) => {\n setActiveCategoryIndex(index);\n const categoryEl = document.getElementById(`emoji-category-${index}`)!;\n fastSmoothScroll(containerRef.current!, categoryEl, 'start', FOCUS_MARGIN, SMOOTH_SCROLL_DISTANCE);\n }, []);\n\n const handleEmojiSelect = useCallback((emoji: string, name: string) => {\n onEmojiSelect(emoji, name);\n }, [onEmojiSelect]);\n\n const canRenderContents = useAsyncRendering([], MENU_TRANSITION_DURATION);\n\n function renderCategoryButton(category: EmojiCategoryData, index: number) {\n const icon = ICONS_BY_CATEGORY[category.id];\n\n return icon && (\n selectCategory(index)}\n ariaLabel={category.name}\n >\n \n \n );\n }\n\n const containerClassName = buildClassName('EmojiPicker', className);\n\n if (!emojis || !canRenderContents) {\n return (\n
\n \n
\n );\n }\n\n return (\n
\n
\n {allCategories.map(renderCategoryButton)}\n
\n \n {allCategories.map((category, i) => (\n = i - 1 && activeCategoryIndex <= i + 1}\n onEmojiSelect={handleEmojiSelect}\n />\n ))}\n
\n \n );\n};\n\nasync function ensureEmojiData() {\n if (!emojiDataPromise) {\n emojiDataPromise = import('emoji-data-ios/emoji-data.json') as unknown as Promise;\n emojiRawData = (await emojiDataPromise).default;\n\n emojiData = uncompressEmoji(emojiRawData);\n }\n\n return emojiDataPromise;\n}\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['recentEmojis']),\n)(EmojiPicker));\n","import React, { FC, memo, useRef } from '../../../lib/teact/teact';\n\nimport { ApiSticker } from '../../../api/types';\nimport { StickerSetOrRecent } from '../../../types';\nimport { ObserveFn, useOnIntersect } from '../../../hooks/useIntersectionObserver';\n\nimport { STICKER_SIZE_PICKER } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport windowSize from '../../../util/windowSize';\nimport StickerButton from '../../common/StickerButton';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\n\ntype OwnProps = {\n stickerSet: StickerSetOrRecent;\n loadAndPlay: boolean;\n index: number;\n observeIntersection: ObserveFn;\n shouldRender: boolean;\n onStickerSelect: (sticker: ApiSticker) => void;\n onStickerUnfave: (sticker: ApiSticker) => void;\n};\n\nconst STICKERS_PER_ROW_ON_DESKTOP = 5;\nconst STICKER_MARGIN = IS_SINGLE_COLUMN_LAYOUT ? 8 : 16;\nconst MOBILE_CONTAINER_PADDING = 8;\n\nconst StickerSet: FC = ({\n stickerSet,\n loadAndPlay,\n index,\n observeIntersection,\n shouldRender,\n onStickerSelect,\n onStickerUnfave,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n useOnIntersect(ref, observeIntersection);\n\n const { transitionClassNames } = useShowTransition(shouldRender, undefined, undefined, 'slow');\n\n const stickersPerRow = IS_SINGLE_COLUMN_LAYOUT\n ? Math.floor((windowSize.get().width - MOBILE_CONTAINER_PADDING) / (STICKER_SIZE_PICKER + STICKER_MARGIN))\n : STICKERS_PER_ROW_ON_DESKTOP;\n const height = Math.ceil(stickerSet.count / stickersPerRow) * (STICKER_SIZE_PICKER + STICKER_MARGIN);\n\n return (\n \n

{stickerSet.title}

\n \n {shouldRender && stickerSet.stickers && stickerSet.stickers.map((sticker) => (\n \n ))}\n \n \n );\n};\n\nexport default memo(StickerSet);\n","import React, {\n FC, useState, useEffect, memo, useRef, useMemo, useCallback,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiStickerSet, ApiSticker } from '../../../api/types';\nimport { StickerSetOrRecent } from '../../../types';\n\nimport { SLIDE_TRANSITION_DURATION, STICKER_SIZE_PICKER_HEADER } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport fastSmoothScroll from '../../../util/fastSmoothScroll';\nimport buildClassName from '../../../util/buildClassName';\nimport { pick } from '../../../util/iteratees';\nimport fastSmoothScrollHorizontal from '../../../util/fastSmoothScrollHorizontal';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useHorizontalScroll from '../../../hooks/useHorizontalScroll';\nimport useLang from '../../../hooks/useLang';\n\nimport Loading from '../../ui/Loading';\nimport Button from '../../ui/Button';\nimport StickerButton from '../../common/StickerButton';\nimport StickerSet from './StickerSet';\nimport StickerSetCover from './StickerSetCover';\nimport StickerSetCoverAnimated from './StickerSetCoverAnimated';\n\nimport './StickerPicker.scss';\n\ntype OwnProps = {\n className: string;\n loadAndPlay: boolean;\n canSendStickers: boolean;\n onStickerSelect: (sticker: ApiSticker) => void;\n};\n\ntype StateProps = {\n recentStickers: ApiSticker[];\n favoriteStickers: ApiSticker[];\n stickerSetsById: Record;\n addedSetIds?: string[];\n shouldPlay?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst SMOOTH_SCROLL_DISTANCE = 500;\nconst HEADER_BUTTON_WIDTH = 52; // px (including margin)\nconst STICKER_INTERSECTION_THROTTLE = 200;\n\nconst stickerSetIntersections: boolean[] = [];\n\nconst StickerPicker: FC = ({\n className,\n loadAndPlay,\n canSendStickers,\n recentStickers,\n favoriteStickers,\n addedSetIds,\n stickerSetsById,\n shouldPlay,\n onStickerSelect,\n loadStickerSets,\n loadRecentStickers,\n loadFavoriteStickers,\n loadAddedStickers,\n addRecentSticker,\n unfaveSticker,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const headerRef = useRef(null);\n const [activeSetIndex, setActiveSetIndex] = useState(0);\n\n const { observe: observeIntersection } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: STICKER_INTERSECTION_THROTTLE,\n }, (entries) => {\n entries.forEach((entry) => {\n const { id } = entry.target as HTMLDivElement;\n if (!id || !id.startsWith('sticker-set-')) {\n return;\n }\n\n const index = Number(id.replace('sticker-set-', ''));\n stickerSetIntersections[index] = entry.isIntersecting;\n });\n\n const intersectingWithIndexes = stickerSetIntersections\n .map((isIntersecting, index) => ({ index, isIntersecting }))\n .filter(({ isIntersecting }) => isIntersecting);\n\n if (!intersectingWithIndexes.length) {\n return;\n }\n\n setActiveSetIndex(intersectingWithIndexes[Math.floor(intersectingWithIndexes.length / 2)].index);\n });\n const { observe: observeIntersectionForCovers } = useIntersectionObserver({ rootRef: headerRef });\n\n const lang = useLang();\n\n const areAddedLoaded = Boolean(addedSetIds);\n\n const allSets = useMemo(() => {\n if (!addedSetIds) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return [\n {\n id: 'recent',\n title: lang('RecentStickers'),\n stickers: recentStickers,\n count: recentStickers.length,\n },\n {\n id: 'favorite',\n title: lang('FavoriteStickers'),\n stickers: favoriteStickers,\n count: favoriteStickers.length,\n },\n ...addedSetIds.map((id) => stickerSetsById[id]).filter(Boolean),\n ];\n }, [addedSetIds, lang, recentStickers, favoriteStickers, stickerSetsById]);\n\n const noPopulatedSets = useMemo(() => (\n areAddedLoaded\n && allSets.filter((set) => set.stickers?.length).length === 0\n ), [allSets, areAddedLoaded]);\n\n useEffect(() => {\n if (loadAndPlay) {\n loadStickerSets();\n loadRecentStickers();\n loadFavoriteStickers();\n }\n }, [loadAndPlay, loadFavoriteStickers, loadRecentStickers, loadStickerSets]);\n\n useEffect(() => {\n if (addedSetIds?.length) {\n loadAddedStickers();\n }\n }, [addedSetIds, loadAddedStickers]);\n\n useHorizontalScroll(headerRef.current);\n\n // Scroll container and header when active set changes\n useEffect(() => {\n if (!areAddedLoaded) {\n return;\n }\n\n const header = headerRef.current;\n if (!header) {\n return;\n }\n\n const newLeft = activeSetIndex * HEADER_BUTTON_WIDTH - (header.offsetWidth / 2 - HEADER_BUTTON_WIDTH / 2);\n\n fastSmoothScrollHorizontal(header, newLeft);\n }, [areAddedLoaded, activeSetIndex]);\n\n const selectStickerSet = useCallback((index: number) => {\n setActiveSetIndex(index);\n const stickerSetEl = document.getElementById(`sticker-set-${index}`)!;\n fastSmoothScroll(containerRef.current!, stickerSetEl, 'start', undefined, SMOOTH_SCROLL_DISTANCE);\n }, []);\n\n const handleStickerSelect = useCallback((sticker: ApiSticker) => {\n onStickerSelect(sticker);\n addRecentSticker({ sticker });\n }, [addRecentSticker, onStickerSelect]);\n\n const handleStickerUnfave = useCallback((sticker: ApiSticker) => {\n unfaveSticker({ sticker });\n }, [unfaveSticker]);\n\n const canRenderContents = useAsyncRendering([], SLIDE_TRANSITION_DURATION);\n\n function renderCover(stickerSet: StickerSetOrRecent, index: number) {\n const firstSticker = stickerSet.stickers?.[0];\n const buttonClassName = buildClassName(\n 'symbol-set-button sticker-set-button',\n index === activeSetIndex && 'activated',\n );\n\n if (stickerSet.id === 'recent' || stickerSet.id === 'favorite' || stickerSet.hasThumbnail || !firstSticker) {\n return (\n selectStickerSet(index)}\n >\n {stickerSet.id === 'recent' ? (\n \n ) : stickerSet.id === 'favorite' ? (\n \n ) : stickerSet.isAnimated ? (\n \n ) : (\n \n )}\n \n );\n } else {\n return (\n \n );\n }\n }\n\n const fullClassName = buildClassName('StickerPicker', className);\n\n if (!areAddedLoaded || !canRenderContents || noPopulatedSets || !canSendStickers) {\n return (\n
\n {!canSendStickers ? (\n
Sending stickers is not allowed in this chat.
\n ) : noPopulatedSets ? (\n
You have no saved Stickers.
\n ) : (\n \n )}\n
\n );\n }\n\n return (\n
\n \n {allSets.map(renderCover)}\n
\n \n {allSets.map((stickerSet, i) => (\n = i - 1 && activeSetIndex <= i + 1}\n onStickerSelect={handleStickerSelect}\n onStickerUnfave={handleStickerUnfave}\n />\n ))}\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n setsById,\n added,\n recent,\n favorite,\n } = global.stickers;\n\n return {\n recentStickers: recent.stickers,\n favoriteStickers: favorite.stickers,\n stickerSetsById: setsById,\n addedSetIds: added.setIds,\n shouldPlay: global.settings.byKey.shouldLoopStickers,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadStickerSets',\n 'loadRecentStickers',\n 'loadFavoriteStickers',\n 'loadAddedStickers',\n 'addRecentSticker',\n 'unfaveSticker',\n ]),\n)(StickerPicker));\n","import React, {\n FC, memo, useCallback, useRef,\n} from '../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiVideo } from '../../api/types';\n\nimport buildClassName from '../../util/buildClassName';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport useMedia from '../../hooks/useMedia';\nimport useTransitionForMedia from '../../hooks/useTransitionForMedia';\nimport useVideoCleanup from '../../hooks/useVideoCleanup';\nimport useBuffering from '../../hooks/useBuffering';\nimport useCanvasBlur from '../../hooks/useCanvasBlur';\nimport { preventMessageInputBlurWithBubbling } from '../middle/helpers/preventMessageInputBlur';\n\nimport Spinner from '../ui/Spinner';\n\nimport './GifButton.scss';\n\ntype OwnProps = {\n gif: ApiVideo;\n observeIntersection: ObserveFn;\n isDisabled?: boolean;\n className?: string;\n onClick: (gif: ApiVideo) => void;\n};\n\nconst GifButton: FC = ({\n gif, observeIntersection, isDisabled, className, onClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const videoRef = useRef(null);\n\n const hasThumbnail = Boolean(gif.thumbnail?.dataUri);\n const localMediaHash = `gif${gif.id}`;\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n const loadAndPlay = isIntersecting && !isDisabled;\n const previewBlobUrl = useMedia(`${localMediaHash}?size=m`, !loadAndPlay, ApiMediaFormat.BlobUrl);\n const thumbRef = useCanvasBlur(gif.thumbnail?.dataUri, Boolean(previewBlobUrl));\n const videoData = useMedia(localMediaHash, !loadAndPlay, ApiMediaFormat.BlobUrl);\n const shouldRenderVideo = Boolean(loadAndPlay && videoData);\n const { isBuffered, bufferingHandlers } = useBuffering(true);\n const shouldRenderSpinner = loadAndPlay && !isBuffered;\n const isVideoReady = loadAndPlay && isBuffered;\n\n useVideoCleanup(videoRef, [shouldRenderVideo]);\n\n const handleClick = useCallback(\n () => onClick({\n ...gif,\n blobUrl: videoData,\n }),\n [onClick, gif, videoData],\n );\n\n const fullClassName = buildClassName(\n 'GifButton',\n gif.width && gif.height && gif.width < gif.height ? 'vertical' : 'horizontal',\n localMediaHash,\n className,\n );\n\n return (\n \n {hasThumbnail && (\n \n )}\n {previewBlobUrl && !isVideoReady && (\n \n )}\n {shouldRenderVideo && (\n \n \n \n )}\n {shouldRenderSpinner && (\n \n )}\n \n );\n};\n\nexport default memo(GifButton);\n","import React, {\n FC, useEffect, memo, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiVideo } from '../../../api/types';\n\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport { pick } from '../../../util/iteratees';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\n\nimport Loading from '../../ui/Loading';\nimport GifButton from '../../common/GifButton';\n\nimport './GifPicker.scss';\n\ntype OwnProps = {\n className: string;\n loadAndPlay: boolean;\n canSendGifs: boolean;\n onGifSelect: (gif: ApiVideo) => void;\n};\n\ntype StateProps = {\n savedGifs?: ApiVideo[];\n};\n\ntype DispatchProps = Pick;\n\nconst INTERSECTION_DEBOUNCE = 300;\n\nconst GifPicker: FC = ({\n className,\n loadAndPlay,\n canSendGifs,\n savedGifs,\n onGifSelect,\n loadSavedGifs,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, debounceMs: INTERSECTION_DEBOUNCE });\n\n useEffect(() => {\n if (loadAndPlay) {\n loadSavedGifs();\n }\n }, [loadAndPlay, loadSavedGifs]);\n\n const canRenderContents = useAsyncRendering([], SLIDE_TRANSITION_DURATION);\n\n return (\n \n {!canSendGifs ? (\n
Sending GIFs is not allowed in this chat.
\n ) : canRenderContents && savedGifs && savedGifs.length ? (\n savedGifs.map((gif) => (\n \n ))\n ) : canRenderContents && savedGifs ? (\n
No saved GIFs.
\n ) : (\n \n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n savedGifs: global.gifs.saved.gifs,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadSavedGifs']),\n)(GifPicker));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\n\ntype OwnProps = {\n activeTab: SymbolMenuTabs;\n onSwitchTab: (tab: SymbolMenuTabs) => void;\n onRemoveSymbol: () => void;\n onSearchOpen: (type: 'stickers' | 'gifs') => void;\n};\n\nexport enum SymbolMenuTabs {\n 'Emoji',\n 'Stickers',\n 'GIFs',\n}\n\n// Getting enum string values for display in Tabs.\n// See: https://www.typescriptlang.org/docs/handbook/enums.html#reverse-mappings\nexport const SYMBOL_MENU_TAB_TITLES = Object.values(SymbolMenuTabs)\n .filter((value): value is string => typeof value === 'string');\n\nconst SYMBOL_MENU_TAB_ICONS = {\n [SymbolMenuTabs.Emoji]: 'icon-smile',\n [SymbolMenuTabs.Stickers]: 'icon-stickers',\n [SymbolMenuTabs.GIFs]: 'icon-gifs',\n};\n\nconst SymbolMenuFooter: FC = ({\n activeTab, onSwitchTab, onRemoveSymbol, onSearchOpen,\n}) => {\n const lang = useLang();\n\n function renderTabButton(tab: SymbolMenuTabs) {\n return (\n onSwitchTab(tab)}\n ariaLabel={SYMBOL_MENU_TAB_TITLES[tab]}\n round\n faded\n color=\"translucent\"\n >\n \n \n );\n }\n\n const handleSearchOpen = useCallback(() => {\n onSearchOpen(activeTab === SymbolMenuTabs.Stickers ? 'stickers' : 'gifs');\n }, [activeTab, onSearchOpen]);\n\n function stopPropagation(event: any) {\n event.stopPropagation();\n }\n\n return (\n
\n {activeTab !== SymbolMenuTabs.Emoji && (\n \n \n \n )}\n\n {renderTabButton(SymbolMenuTabs.Emoji)}\n {renderTabButton(SymbolMenuTabs.Stickers)}\n {renderTabButton(SymbolMenuTabs.GIFs)}\n\n {activeTab === SymbolMenuTabs.Emoji && (\n \n \n \n )}\n
\n );\n};\n\nexport default memo(SymbolMenuFooter);\n","import React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiSticker, ApiVideo } from '../../../api/types';\n\nimport { IAllowedAttachmentOptions } from '../../../modules/helpers';\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment';\nimport { fastRaf } from '../../../util/schedulers';\nimport buildClassName from '../../../util/buildClassName';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useMouseInside from '../../../hooks/useMouseInside';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\nimport Menu from '../../ui/Menu';\nimport Transition from '../../ui/Transition';\nimport EmojiPicker from './EmojiPicker';\nimport StickerPicker from './StickerPicker';\nimport GifPicker from './GifPicker';\nimport SymbolMenuFooter, { SYMBOL_MENU_TAB_TITLES, SymbolMenuTabs } from './SymbolMenuFooter';\nimport Portal from '../../ui/Portal';\n\nimport './SymbolMenu.scss';\n\nconst ANIMATION_DURATION = 350;\n\nexport type OwnProps = {\n isOpen: boolean;\n allowedAttachmentOptions: IAllowedAttachmentOptions;\n onLoad: () => void;\n onClose: () => void;\n onEmojiSelect: (emoji: string) => void;\n onStickerSelect: (sticker: ApiSticker, shouldPreserveInput?: boolean) => void;\n onGifSelect: (gif: ApiVideo) => void;\n onRemoveSymbol: () => void;\n onSearchOpen: (type: 'stickers' | 'gifs') => void;\n addRecentEmoji: AnyToVoidFunction;\n};\n\ntype StateProps = {\n isLeftColumnShown: boolean;\n};\n\nlet isActivated = false;\n\nconst SymbolMenu: FC = ({\n isOpen, allowedAttachmentOptions, isLeftColumnShown,\n onLoad, onClose,\n onEmojiSelect, onStickerSelect, onGifSelect,\n onRemoveSymbol, onSearchOpen, addRecentEmoji,\n}) => {\n const [activeTab, setActiveTab] = useState(0);\n const [recentEmojis, setRecentEmojis] = useState([]);\n\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose, undefined, IS_SINGLE_COLUMN_LAYOUT);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, onClose, false, false);\n\n if (!isActivated && isOpen) {\n isActivated = true;\n }\n\n useEffect(() => {\n onLoad();\n }, [onLoad]);\n\n useLayoutEffect(() => {\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n return undefined;\n }\n\n if (isOpen) {\n document.body.classList.add('enable-symbol-menu-transforms');\n document.body.classList.add('is-symbol-menu-open');\n }\n\n return () => {\n if (isOpen) {\n fastRaf(() => {\n document.body.classList.remove('is-symbol-menu-open');\n setTimeout(() => {\n document.body.classList.remove('enable-symbol-menu-transforms');\n }, ANIMATION_DURATION);\n });\n }\n };\n }, [isOpen]);\n\n const recentEmojisRef = useRef(recentEmojis);\n recentEmojisRef.current = recentEmojis;\n useEffect(() => {\n if (!recentEmojisRef.current.length) {\n return;\n }\n\n recentEmojisRef.current.forEach((name) => {\n addRecentEmoji({ emoji: name });\n });\n\n setRecentEmojis([]);\n }, [isOpen, activeTab, addRecentEmoji]);\n\n const handleEmojiSelect = useCallback((emoji: string, name: string) => {\n setRecentEmojis((emojis) => {\n return [...emojis, name];\n });\n\n onEmojiSelect(emoji);\n }, [onEmojiSelect]);\n\n const handleSearch = useCallback((type: 'stickers' | 'gifs') => {\n onClose();\n onSearchOpen(type);\n }, [onClose, onSearchOpen]);\n\n const handleStickerSelect = useCallback((sticker: ApiSticker) => {\n onStickerSelect(sticker, true);\n }, [onStickerSelect]);\n\n const lang = useLang();\n\n const { canSendStickers, canSendGifs } = allowedAttachmentOptions;\n\n function renderContent(isActive: boolean, isFrom: boolean) {\n switch (activeTab) {\n case SymbolMenuTabs.Emoji:\n return (\n \n );\n case SymbolMenuTabs.Stickers:\n return (\n \n );\n case SymbolMenuTabs.GIFs:\n return (\n \n );\n }\n\n return undefined;\n }\n\n function stopPropagation(event: any) {\n event.stopPropagation();\n }\n\n const content = (\n <>\n
\n {isActivated && (\n \n {renderContent}\n \n )}\n
\n {IS_SINGLE_COLUMN_LAYOUT && (\n \n \n \n )}\n \n \n );\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n if (!shouldRender) {\n return undefined;\n }\n\n const className = buildClassName(\n 'SymbolMenu mobile-menu',\n transitionClassNames,\n !isLeftColumnShown && 'middle-column-open',\n );\n\n return (\n \n
\n {content}\n
\n
\n );\n }\n\n return (\n \n {content}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n isLeftColumnShown: global.isLeftColumnShown,\n };\n },\n)(SymbolMenu));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { CONTENT_TYPES_FOR_QUICK_UPLOAD } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { openSystemFilesDialog } from '../../../util/systemFilesDialog';\nimport { IAllowedAttachmentOptions } from '../../../modules/helpers';\nimport useMouseInside from '../../../hooks/useMouseInside';\nimport useLang from '../../../hooks/useLang';\n\nimport Menu from '../../ui/Menu';\nimport MenuItem from '../../ui/MenuItem';\n\nimport './AttachMenu.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n allowedAttachmentOptions: IAllowedAttachmentOptions;\n onFileSelect: (files: File[], isQuick: boolean) => void;\n onPollCreate: () => void;\n onClose: () => void;\n};\n\nconst AttachMenu: FC = ({\n isOpen, allowedAttachmentOptions, onFileSelect, onPollCreate, onClose,\n}) => {\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose);\n\n const handleFileSelect = useCallback((e: Event, isQuick: boolean) => {\n const { files } = e.target as HTMLInputElement;\n\n if (files && files.length > 0) {\n onFileSelect(Array.from(files), isQuick);\n }\n }, [onFileSelect]);\n\n const handleQuickSelect = useCallback(() => {\n openSystemFilesDialog(\n Array.from(CONTENT_TYPES_FOR_QUICK_UPLOAD).join(','),\n (e) => handleFileSelect(e, true),\n );\n }, [handleFileSelect]);\n\n const handleDocumentSelect = useCallback(() => {\n openSystemFilesDialog('*', (e) => handleFileSelect(e, false));\n }, [handleFileSelect]);\n\n const lang = useLang();\n\n const { canAttachMedia, canAttachPolls } = allowedAttachmentOptions;\n\n return (\n \n {/*\n ** Using ternary operator here causes some attributes from first clause\n ** transferring to the fragment content in the second clause\n */}\n {!canAttachMedia && (\n Posting media content is not allowed in this group.\n )}\n {canAttachMedia && (\n <>\n \n {lang('AttachmentMenu.PhotoOrVideo')}\n \n {lang('AttachDocument')}\n \n )}\n {canAttachPolls && (\n {lang('Poll')}\n )}\n \n );\n};\n\nexport default memo(AttachMenu);\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { ApiBotCommand, ApiUser } from '../../../api/types';\n\nimport renderText from '../../common/helpers/renderText';\nimport buildClassName from '../../../util/buildClassName';\n\nimport ListItem from '../../ui/ListItem';\nimport Avatar from '../../common/Avatar';\n\nimport './BotCommand.scss';\n\ntype OwnProps = {\n botCommand: ApiBotCommand;\n bot?: ApiUser;\n withAvatar?: boolean;\n focus?: boolean;\n onClick: (botCommand: ApiBotCommand) => void;\n};\n\nconst BotCommand: FC = ({\n withAvatar,\n focus,\n botCommand,\n bot,\n onClick,\n}) => {\n return (\n onClick(botCommand)}\n focus={focus}\n >\n {withAvatar && (\n \n )}\n
\n /{botCommand.command}\n {renderText(botCommand.description)}\n
\n \n );\n};\n\nexport default memo(BotCommand);\n","import React, {\n FC, useCallback, useEffect, useRef, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiBotCommand, ApiUser } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { pick } from '../../../util/iteratees';\nimport buildClassName from '../../../util/buildClassName';\nimport setTooltipItemVisible from '../../../util/setTooltipItemVisible';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevious from '../../../hooks/usePrevious';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\n\nimport BotCommand from './BotCommand';\n\nimport './BotCommandTooltip.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n withUsername?: boolean;\n botCommands?: ApiBotCommand[];\n onClick: NoneToVoidFunction;\n onClose: NoneToVoidFunction;\n};\n\ntype StateProps = {\n usersById: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst BotCommandTooltip: FC = ({\n usersById,\n isOpen,\n withUsername,\n botCommands,\n onClick,\n onClose,\n sendBotCommand,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n\n const handleSendCommand = useCallback(({ botId, command }: ApiBotCommand) => {\n const bot = usersById[botId];\n sendBotCommand({\n command: `/${command}${withUsername && bot ? `@${bot.username}` : ''}`,\n botId,\n });\n onClick();\n }, [onClick, sendBotCommand, usersById, withUsername]);\n\n const selectedCommandIndex = useKeyboardNavigation({\n isActive: isOpen,\n items: botCommands,\n onSelect: handleSendCommand,\n onClose,\n });\n\n useEffect(() => {\n if (botCommands && !botCommands.length) {\n onClose();\n }\n }, [botCommands, onClose]);\n\n useEffect(() => {\n setTooltipItemVisible('.chat-item-clickable', selectedCommandIndex, containerRef);\n }, [selectedCommandIndex]);\n\n const prevCommands = usePrevious(botCommands && botCommands.length ? botCommands : undefined, shouldRender);\n const renderedCommands = botCommands && !botCommands.length ? prevCommands : botCommands;\n\n if (!shouldRender || (renderedCommands && !renderedCommands.length)) {\n return undefined;\n }\n\n const className = buildClassName(\n 'BotCommandTooltip composer-tooltip custom-scroll',\n transitionClassNames,\n );\n\n return (\n
\n {renderedCommands && renderedCommands.map((chatBotCommand, index) => (\n \n ))}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => ({\n usersById: global.users.byId,\n }),\n (setGlobal, actions): DispatchProps => pick(actions, ['sendBotCommand']),\n)(BotCommandTooltip));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiBotCommand } from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\nimport useMouseInside from '../../../hooks/useMouseInside';\n\nimport Menu from '../../ui/Menu';\nimport BotCommand from './BotCommand';\n\nimport './BotCommandMenu.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n botCommands: ApiBotCommand[];\n onClose: NoneToVoidFunction;\n};\n\ntype DispatchProps = Pick;\n\nconst BotCommandMenu: FC = ({\n isOpen, botCommands, onClose, sendBotCommand,\n}) => {\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose, undefined, IS_SINGLE_COLUMN_LAYOUT);\n\n const handleClick = useCallback((botCommand: ApiBotCommand) => {\n sendBotCommand({\n command: `/${botCommand.command}`,\n botId: botCommand.botId,\n });\n onClose();\n }, [onClose, sendBotCommand]);\n\n return (\n \n {botCommands.map((botCommand) => (\n \n ))}\n \n );\n};\n\nexport default memo(withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['sendBotCommand']),\n)(BotCommandMenu));\n","import React, {\n FC, memo, useEffect, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { STICKER_SIZE_PICKER } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport { pick } from '../../../util/iteratees';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevious from '../../../hooks/usePrevious';\n\nimport Loading from '../../ui/Loading';\nimport StickerButton from '../../common/StickerButton';\n\nimport './StickerTooltip.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onStickerSelect: (sticker: ApiSticker) => void;\n};\n\ntype StateProps = {\n stickers?: ApiSticker[];\n};\n\ntype DispatchProps = Pick;\n\nconst INTERSECTION_THROTTLE = 200;\n\nconst StickerTooltip: FC = ({\n isOpen,\n onStickerSelect,\n stickers,\n clearStickersForEmoji,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n const prevStickers = usePrevious(stickers, true);\n const displayedStickers = stickers || prevStickers;\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, throttleMs: INTERSECTION_THROTTLE });\n\n useEffect(() => (isOpen ? captureEscKeyListener(clearStickersForEmoji) : undefined), [isOpen, clearStickersForEmoji]);\n\n const handleMouseEnter = () => {\n document.body.classList.add('no-select');\n };\n\n const handleMouseLeave = () => {\n document.body.classList.remove('no-select');\n };\n\n const className = buildClassName(\n 'StickerTooltip composer-tooltip custom-scroll',\n transitionClassNames,\n !(displayedStickers?.length) && 'hidden',\n );\n\n return (\n \n {shouldRender && displayedStickers ? (\n displayedStickers.map((sticker) => (\n \n ))\n ) : shouldRender ? (\n \n ) : undefined}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { stickers } = global.stickers.forEmoji;\n\n return { stickers };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['clearStickersForEmoji']),\n)(StickerTooltip));\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport useMouseInside from '../../../hooks/useMouseInside';\nimport useLang from '../../../hooks/useLang';\n\nimport Menu from '../../ui/Menu';\nimport MenuItem from '../../ui/MenuItem';\n\nimport './CustomSendMenu.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onSilentSend?: NoneToVoidFunction;\n onScheduleSend?: NoneToVoidFunction;\n onClose: NoneToVoidFunction;\n onCloseAnimationEnd?: NoneToVoidFunction;\n};\n\nconst CustomSendMenu: FC = ({\n isOpen, onSilentSend, onScheduleSend, onClose, onCloseAnimationEnd,\n}) => {\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose);\n\n const lang = useLang();\n\n return (\n \n {onSilentSend && {lang('SendWithoutSound')}}\n {onScheduleSend && {lang('ScheduleMessage')}}\n \n );\n};\n\nexport default memo(CustomSendMenu);\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport findInViewport from '../../../util/findInViewport';\nimport isFullyVisible from '../../../util/isFullyVisible';\nimport fastSmoothScrollHorizontal from '../../../util/fastSmoothScrollHorizontal';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevDuringAnimation from '../../../hooks/usePrevDuringAnimation';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\n\nimport Loading from '../../ui/Loading';\nimport EmojiButton from './EmojiButton';\n\nimport './EmojiTooltip.scss';\n\nconst VIEWPORT_MARGIN = 8;\nconst EMOJI_BUTTON_WIDTH = 44;\nconst CLOSE_DURATION = 350;\n\nfunction setItemVisible(index: number, containerRef: Record) {\n const container = containerRef.current!;\n if (!container) {\n return;\n }\n\n const { visibleIndexes, allElements } = findInViewport(\n container,\n '.EmojiButton',\n VIEWPORT_MARGIN,\n true,\n true,\n true,\n );\n\n if (!allElements.length || !allElements[index]) {\n return;\n }\n const first = visibleIndexes[0];\n if (!visibleIndexes.includes(index)\n || (index === first && !isFullyVisible(container, allElements[first], true))) {\n const position = index > visibleIndexes[visibleIndexes.length - 1] ? 'start' : 'end';\n const newLeft = position === 'start' ? index * EMOJI_BUTTON_WIDTH : 0;\n\n fastSmoothScrollHorizontal(container, newLeft);\n }\n}\n\nexport type OwnProps = {\n isOpen: boolean;\n onEmojiSelect: (text: string) => void;\n onClose: NoneToVoidFunction;\n addRecentEmoji: AnyToVoidFunction;\n emojis: Emoji[];\n};\n\nconst EmojiTooltip: FC = ({\n isOpen,\n emojis,\n onClose,\n onEmojiSelect,\n addRecentEmoji,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n const listEmojis: Emoji[] = usePrevDuringAnimation(emojis.length ? emojis : undefined, CLOSE_DURATION) || [];\n\n const handleSelectEmoji = useCallback((emoji: Emoji) => {\n onEmojiSelect(emoji.native);\n addRecentEmoji({ emoji: emoji.id });\n }, [addRecentEmoji, onEmojiSelect]);\n\n const handleClick = useCallback((native: string, id: string) => {\n onEmojiSelect(native);\n addRecentEmoji({ emoji: id });\n }, [addRecentEmoji, onEmojiSelect]);\n\n const selectedIndex = useKeyboardNavigation({\n isActive: isOpen,\n isHorizontal: true,\n items: emojis,\n onSelect: handleSelectEmoji,\n onClose,\n });\n\n useEffect(() => {\n setItemVisible(selectedIndex, containerRef);\n }, [selectedIndex]);\n\n const handleMouseEnter = () => {\n document.body.classList.add('no-select');\n };\n\n const handleMouseLeave = () => {\n document.body.classList.remove('no-select');\n };\n\n const className = buildClassName(\n 'EmojiTooltip composer-tooltip custom-scroll-x',\n transitionClassNames,\n );\n\n return (\n \n {shouldRender && listEmojis ? (\n listEmojis.map((emoji, index) => (\n \n ))\n ) : shouldRender ? (\n \n ) : undefined}\n \n );\n};\n\nexport default memo(EmojiTooltip);\n","import React, { FC, memo } from '../../../../lib/teact/teact';\n\nimport { ApiWebDocument } from '../../../../api/types';\n\nimport { getFirstLetters } from '../../../../util/textFormat';\nimport renderText from '../../../common/helpers/renderText';\nimport useMedia from '../../../../hooks/useMedia';\n\nimport ListItem from '../../../ui/ListItem';\n\nimport './BaseResult.scss';\nimport { preventMessageInputBlurWithBubbling } from '../../helpers/preventMessageInputBlur';\n\nexport type OwnProps = {\n focus?: boolean;\n thumbnail?: ApiWebDocument;\n thumbUrl?: string;\n title?: string;\n description?: string;\n transitionClassNames?: string;\n onClick: NoneToVoidFunction;\n};\n\nconst BaseResult: FC = ({\n title,\n description,\n thumbnail,\n thumbUrl,\n focus,\n transitionClassNames = '',\n onClick,\n}) => {\n let content: string | undefined = '';\n\n const thumbnailDataUrl = useMedia(thumbnail ? `webDocument:${thumbnail.url}` : undefined);\n thumbUrl = thumbUrl || thumbnailDataUrl;\n\n if (thumbUrl) {\n content = (\n \"\"\n );\n } else if (title) {\n content = getFirstLetters(title, 1);\n }\n\n return (\n \n \n {typeof content === 'string' ? renderText(content) : content}\n \n
\n {title && (
{title}
)}\n {description && (
{description}
)}\n
\n \n );\n};\n\nexport default memo(BaseResult);\n","import React, { FC, memo, useCallback } from '../../../../lib/teact/teact';\n\nimport {\n ApiBotInlineMediaResult, ApiBotInlineResult, ApiPhoto, ApiThumbnail, ApiWebDocument,\n} from '../../../../api/types';\n\nimport useMedia from '../../../../hooks/useMedia';\nimport useTransitionForMedia from '../../../../hooks/useTransitionForMedia';\n\nimport BaseResult from './BaseResult';\n\nimport './MediaResult.scss';\n\nexport type OwnProps = {\n focus?: boolean;\n isForGallery?: boolean;\n inlineResult: ApiBotInlineMediaResult | ApiBotInlineResult;\n onClick: (result: ApiBotInlineResult) => void;\n};\n\nconst MediaResult: FC = ({\n focus, isForGallery, inlineResult, onClick,\n}) => {\n let photo: ApiPhoto | undefined;\n let thumbnail: ApiThumbnail | undefined;\n let webThumbnail: ApiWebDocument | undefined;\n\n if ('photo' in inlineResult) {\n photo = inlineResult.photo;\n }\n // For results with type=video (for example @stikstokbot)\n if ('thumbnail' in inlineResult) {\n thumbnail = inlineResult.thumbnail;\n }\n if ('webThumbnail' in inlineResult && isForGallery) {\n webThumbnail = inlineResult.webThumbnail;\n }\n\n const thumbnailDataUrl = useMedia(webThumbnail ? `webDocument:${webThumbnail.url}` : undefined);\n const mediaBlobUrl = useMedia(photo && `photo${photo.id}?size=m`);\n const {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(mediaBlobUrl, 'slow');\n\n const handleClick = useCallback(() => {\n onClick(inlineResult);\n }, [inlineResult, onClick]);\n\n if (isForGallery) {\n return (\n
\n {shouldRenderThumb && (\n \"\"\n )}\n {shouldRenderFullMedia && (\n \"\"\n )}\n
\n );\n }\n\n const { title, description } = inlineResult;\n\n return (\n \n );\n};\n\nexport default memo(MediaResult);\n","import React, { FC, memo, useCallback } from '../../../../lib/teact/teact';\n\nimport { ApiBotInlineResult } from '../../../../api/types';\n\nimport BaseResult from './BaseResult';\n\nexport type OwnProps = {\n focus?: boolean;\n inlineResult: ApiBotInlineResult;\n onClick: (result: ApiBotInlineResult) => void;\n};\n\nconst ArticleResult: FC = ({ focus, inlineResult, onClick }) => {\n const {\n title, url, description, webThumbnail,\n } = inlineResult;\n\n const handleClick = useCallback(() => {\n onClick(inlineResult);\n }, [inlineResult, onClick]);\n\n return (\n \n );\n};\n\nexport default memo(ArticleResult);\n","import React, {\n FC, memo, useCallback,\n} from '../../../../lib/teact/teact';\n\nimport { ApiBotInlineMediaResult, ApiBotInlineResult } from '../../../../api/types';\n\nimport { ObserveFn } from '../../../../hooks/useIntersectionObserver';\n\nimport GifButton from '../../../common/GifButton';\n\ntype OwnProps = {\n inlineResult: ApiBotInlineMediaResult;\n observeIntersection: ObserveFn;\n onClick: (result: ApiBotInlineResult) => void;\n};\n\nconst GifResult: FC = ({\n inlineResult, observeIntersection, onClick,\n}) => {\n const { gif } = inlineResult;\n\n const handleClick = useCallback(() => {\n onClick(inlineResult);\n }, [inlineResult, onClick]);\n\n if (!gif) {\n return undefined;\n }\n\n return (\n \n );\n};\n\nexport default memo(GifResult);\n","import React, { FC, memo } from '../../../../lib/teact/teact';\n\nimport { ApiBotInlineMediaResult, ApiBotInlineResult } from '../../../../api/types';\n\nimport { STICKER_SIZE_INLINE_BOT_RESULT } from '../../../../config';\nimport { ObserveFn } from '../../../../hooks/useIntersectionObserver';\n\nimport StickerButton from '../../../common/StickerButton';\n\ntype OwnProps = {\n inlineResult: ApiBotInlineMediaResult;\n observeIntersection: ObserveFn;\n onClick: (result: ApiBotInlineResult) => void;\n};\n\nconst StickerResult: FC = ({ inlineResult, observeIntersection, onClick }) => {\n const { sticker } = inlineResult;\n\n if (!sticker) {\n return undefined;\n }\n\n return (\n \n );\n};\n\nexport default memo(StickerResult);\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiBotInlineMediaResult, ApiBotInlineResult, ApiBotInlineSwitchPm } from '../../../api/types';\nimport { IAllowedAttachmentOptions } from '../../../modules/helpers';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport setTooltipItemVisible from '../../../util/setTooltipItemVisible';\nimport buildClassName from '../../../util/buildClassName';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport { throttle } from '../../../util/schedulers';\nimport { pick } from '../../../util/iteratees';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport usePrevious from '../../../hooks/usePrevious';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\n\nimport MediaResult from './inlineResults/MediaResult';\nimport ArticleResult from './inlineResults/ArticleResult';\nimport GifResult from './inlineResults/GifResult';\nimport StickerResult from './inlineResults/StickerResult';\nimport ListItem from '../../ui/ListItem';\nimport InfiniteScroll from '../../ui/InfiniteScroll';\n\nimport './InlineBotTooltip.scss';\n\nconst INTERSECTION_DEBOUNCE_MS = 200;\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nexport type OwnProps = {\n isOpen: boolean;\n botId?: number;\n isGallery?: boolean;\n allowedAttachmentOptions: IAllowedAttachmentOptions;\n inlineBotResults?: (ApiBotInlineResult | ApiBotInlineMediaResult)[];\n switchPm?: ApiBotInlineSwitchPm;\n onSelectResult: (inlineResult: ApiBotInlineMediaResult | ApiBotInlineResult) => void;\n loadMore: NoneToVoidFunction;\n onClose: NoneToVoidFunction;\n};\n\ntype DispatchProps = Pick;\n\nconst InlineBotTooltip: FC = ({\n isOpen,\n botId,\n isGallery,\n inlineBotResults,\n switchPm,\n loadMore,\n onClose,\n openChat,\n startBot,\n onSelectResult,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({\n rootRef: containerRef,\n debounceMs: INTERSECTION_DEBOUNCE_MS,\n isDisabled: !isOpen,\n });\n\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (direction === LoadMoreDirection.Backwards) {\n runThrottled(loadMore);\n }\n }, [loadMore]);\n\n const selectedIndex = useKeyboardNavigation({\n isActive: isOpen,\n shouldRemoveSelectionOnReset: isGallery,\n noArrowNavigation: isGallery,\n items: inlineBotResults,\n onSelect: onSelectResult,\n onClose,\n });\n\n useEffect(() => {\n setTooltipItemVisible('.chat-item-clickable', selectedIndex, containerRef);\n }, [selectedIndex]);\n\n const handleSendPm = useCallback(() => {\n openChat({ id: botId });\n startBot({ botId, param: switchPm!.startParam });\n }, [botId, openChat, startBot, switchPm]);\n\n const prevInlineBotResults = usePrevious(\n inlineBotResults?.length\n ? inlineBotResults\n : undefined,\n shouldRender,\n );\n const renderedInlineBotResults = inlineBotResults && !inlineBotResults.length\n ? prevInlineBotResults\n : inlineBotResults;\n\n if (!shouldRender || !renderedInlineBotResults || (!renderedInlineBotResults.length && !switchPm)) {\n return undefined;\n }\n\n const className = buildClassName(\n 'InlineBotTooltip composer-tooltip',\n IS_TOUCH_ENV ? 'no-scrollbar' : 'custom-scroll',\n isGallery && 'gallery',\n transitionClassNames,\n );\n\n function renderSwitchPm() {\n return (\n \n {switchPm!.text}\n \n );\n }\n\n function renderContent() {\n return renderedInlineBotResults!.map((inlineBotResult, index) => {\n switch (inlineBotResult.type) {\n case 'gif':\n return (\n \n );\n\n case 'photo':\n return (\n \n );\n\n case 'sticker':\n return (\n \n );\n\n case 'video':\n case 'game':\n return (\n \n );\n case 'article':\n case 'audio':\n return (\n \n );\n\n default:\n return undefined;\n }\n });\n }\n\n return (\n \n {switchPm && renderSwitchPm()}\n {renderContent()}\n \n );\n};\n\nexport default memo(withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'startBot', 'openChat', 'sendInlineBotResult',\n ]),\n)(InlineBotTooltip));\n","import React, {\n FC, useMemo, memo, useRef,\n} from '../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage, ApiUser, ApiChat } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\n\nimport {\n selectUser,\n selectChatMessages,\n selectChat,\n selectCurrentTextSearch,\n} from '../../modules/selectors';\nimport {\n getMessageSummaryText,\n getChatTitle,\n getUserFullName,\n isChatChannel,\n} from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport { orderBy, pick } from '../../util/iteratees';\nimport { MEMO_EMPTY_ARRAY } from '../../util/memo';\nimport useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport ListItem from '../ui/ListItem';\nimport LastMessageMeta from '../common/LastMessageMeta';\nimport Avatar from '../common/Avatar';\n\nimport './RightSearch.scss';\n\nexport type OwnProps = {\n chatId: number;\n threadId: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n messagesById?: Record;\n query?: string;\n totalCount?: number;\n foundIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\ninterface Result {\n message: ApiMessage;\n senderUser?: ApiUser;\n senderChat?: ApiChat;\n onClick: NoneToVoidFunction;\n}\n\nconst RightSearch: FC = ({\n chatId,\n threadId,\n onClose,\n isActive,\n chat,\n messagesById,\n query,\n totalCount,\n foundIds,\n searchTextMessagesLocal,\n focusMessage,\n}) => {\n const lang = useLang();\n\n const foundResults = useMemo(() => {\n if (!query || !foundIds || !foundIds.length || !messagesById) {\n return MEMO_EMPTY_ARRAY;\n }\n\n const results = foundIds.map((id) => {\n const message = messagesById[id];\n if (!message) {\n return undefined;\n }\n\n const senderUser = message.senderId ? selectUser(getGlobal(), message.senderId) : undefined;\n\n let senderChat;\n if (chat && isChatChannel(chat)) {\n senderChat = chat;\n } else if (message.forwardInfo) {\n const { isChannelPost, fromChatId } = message.forwardInfo;\n senderChat = isChannelPost && fromChatId ? selectChat(getGlobal(), fromChatId) : undefined;\n } else {\n senderChat = message.senderId ? selectChat(getGlobal(), message.senderId) : undefined;\n }\n\n return {\n message,\n senderUser,\n senderChat,\n onClick: () => focusMessage({ chatId, threadId, messageId: id }),\n };\n }).filter(Boolean) as Result[];\n\n return orderBy(results, ({ message }) => message.date, 'desc');\n }, [chatId, threadId, focusMessage, foundIds, chat, messagesById, query]);\n\n const renderSearchResult = ({\n message, senderUser, senderChat, onClick,\n }: Result) => {\n const title = senderChat ? getChatTitle(lang, senderChat) : getUserFullName(senderUser);\n const text = getMessageSummaryText(lang, message);\n\n return (\n \n \n
\n
\n

{title && renderText(title)}

\n \n
\n
\n {renderText(text, ['emoji', 'highlight'], { highlight: query })}\n
\n
\n \n );\n };\n\n useHistoryBack(isActive, onClose);\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const handleKeyDown = useKeyboardListNavigation(containerRef, true, (index) => {\n const foundResult = foundResults?.[index === -1 ? 0 : index];\n if (foundResult) {\n foundResult.onClick();\n }\n }, '.ListItem-button', true);\n\n return (\n \n

\n {!query ? (\n lang('lng_dlg_search_for_messages')\n ) : (totalCount === 0 || !foundResults.length) ? (\n lang('lng_search_no_results')\n ) : totalCount === 1 ? (\n '1 message found'\n ) : (\n `${(foundResults.length && (totalCount || foundResults.length))} messages found`\n )}\n

\n {foundResults.map(renderSearchResult)}\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const messagesById = chat && selectChatMessages(global, chat.id);\n if (!chat || !messagesById) {\n return {};\n }\n\n const { query, results } = selectCurrentTextSearch(global) || {};\n const { totalCount, foundIds } = results || {};\n\n return {\n chat,\n messagesById,\n query,\n totalCount,\n foundIds,\n };\n },\n (global, actions): DispatchProps => pick(actions, ['searchTextMessagesLocal', 'focusMessage']),\n)(RightSearch));\n","import React, {\n FC, useEffect, memo, useMemo, useCallback,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiStickerSet } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\nimport { ObserveFn } from '../../hooks/useIntersectionObserver';\n\nimport { STICKER_SIZE_SEARCH } from '../../config';\nimport { pick } from '../../util/iteratees';\nimport { selectShouldLoopStickers, selectStickerSet } from '../../modules/selectors';\nimport useFlag from '../../hooks/useFlag';\nimport useOnChange from '../../hooks/useOnChange';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport StickerButton from '../common/StickerButton';\nimport StickerSetModal from '../common/StickerSetModal.async';\nimport Spinner from '../ui/Spinner';\n\ntype OwnProps = {\n stickerSetId: string;\n observeIntersection: ObserveFn;\n isSomeModalOpen: boolean;\n onModalToggle: (isOpen: boolean) => void;\n};\n\ntype StateProps = {\n set?: ApiStickerSet;\n shouldPlay?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst STICKERS_TO_DISPLAY = 5;\n\nconst StickerSetResult: FC = ({\n stickerSetId, observeIntersection, set, shouldPlay,\n loadStickers, toggleStickerSet, isSomeModalOpen, onModalToggle,\n}) => {\n const lang = useLang();\n const isAdded = set && Boolean(set.installedDate);\n const areStickersLoaded = Boolean(set?.stickers);\n\n const [isModalOpen, openModal, closeModal] = useFlag();\n\n useOnChange(() => {\n onModalToggle(isModalOpen);\n }, [isModalOpen, onModalToggle]);\n\n const displayedStickers = useMemo(() => {\n if (!set) {\n return [];\n }\n\n const coverStickerIds = (set.covers || []).map(({ id }) => id);\n const otherStickers = set.stickers ? set.stickers.filter(({ id }) => !coverStickerIds.includes(id)) : [];\n\n return [...(set.covers || []), ...otherStickers].slice(0, STICKERS_TO_DISPLAY);\n }, [set]);\n\n useEffect(() => {\n // Featured stickers are initialized with one sticker in collection (cover of SickerSet)\n if (!areStickersLoaded && displayedStickers.length < STICKERS_TO_DISPLAY) {\n loadStickers({ stickerSetId });\n }\n }, [areStickersLoaded, displayedStickers.length, loadStickers, stickerSetId]);\n\n const handleAddClick = useCallback(() => {\n toggleStickerSet({ stickerSetId });\n }, [toggleStickerSet, stickerSetId]);\n\n if (!set) {\n return undefined;\n }\n\n const canRenderStickers = displayedStickers.length > 0;\n\n return (\n
\n
\n
\n

{set.title}

\n

{lang('Stickers', set.count, 'i')}

\n
\n \n {lang(isAdded ? 'Stickers.Installed' : 'Stickers.Install')}\n \n
\n
\n {!canRenderStickers && }\n {canRenderStickers && displayedStickers.map((sticker) => (\n \n ))}\n
\n {canRenderStickers && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { stickerSetId }): StateProps => {\n return {\n set: selectStickerSet(global, stickerSetId),\n shouldPlay: selectShouldLoopStickers(global),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadStickers', 'toggleStickerSet']),\n)(StickerSetResult));\n","import React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\nimport { throttle } from '../../util/schedulers';\nimport { selectCurrentStickerSearch } from '../../modules/selectors';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Loading from '../ui/Loading';\nimport StickerSetResult from './StickerSetResult';\n\nimport './StickerSearch.scss';\n\ntype OwnProps = {\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n query?: string;\n featuredIds?: string[];\n resultIds?: string[];\n};\n\ntype DispatchProps = Pick;\n\nconst INTERSECTION_THROTTLE = 200;\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst StickerSearch: FC = ({\n onClose,\n isActive,\n query,\n featuredIds,\n resultIds,\n loadFeaturedStickers,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const lang = useLang();\n\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, throttleMs: INTERSECTION_THROTTLE });\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadFeaturedStickers();\n });\n });\n\n useHistoryBack(isActive, onClose);\n\n function renderContent() {\n if (query === undefined) {\n return undefined;\n }\n\n if (!query && featuredIds) {\n return featuredIds.map((id) => (\n \n ));\n }\n\n if (resultIds) {\n if (!resultIds.length) {\n return

Nothing found.

;\n }\n\n return resultIds.map((id) => (\n \n ));\n }\n\n return ;\n }\n\n return (\n
\n {renderContent()}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const currentSearch = selectCurrentStickerSearch(global);\n const { query, resultIds } = currentSearch || {};\n const { featured } = global.stickers;\n\n return {\n query,\n featuredIds: featured.setIds,\n resultIds,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadFeaturedStickers']),\n)(StickerSearch));\n","import React, {\n FC, memo, useRef, useCallback,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat, ApiVideo } from '../../api/types';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport {\n selectCurrentGifSearch,\n selectChat,\n selectIsChatWithBot,\n selectCurrentMessageList,\n} from '../../modules/selectors';\nimport { getAllowedAttachmentOptions } from '../../modules/helpers';\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport GifButton from '../common/GifButton';\nimport Loading from '../ui/Loading';\n\nimport './GifSearch.scss';\n\ntype OwnProps = {\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n query?: string;\n results?: ApiVideo[];\n chat?: ApiChat;\n isChatWithBot?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst PRELOAD_BACKWARDS = 96; // GIF Search bot results are multiplied by 24\nconst INTERSECTION_DEBOUNCE = 300;\n\nconst GifSearch: FC = ({\n onClose,\n isActive,\n query,\n results,\n chat,\n isChatWithBot,\n searchMoreGifs,\n sendMessage,\n setGifSearchQuery,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, debounceMs: INTERSECTION_DEBOUNCE });\n\n const { canSendGifs } = getAllowedAttachmentOptions(chat, isChatWithBot);\n\n const handleGifClick = useCallback((gif: ApiVideo) => {\n if (canSendGifs) {\n sendMessage({ gif });\n }\n\n if (IS_TOUCH_ENV) {\n setGifSearchQuery({ query: undefined });\n }\n }, [canSendGifs, sendMessage, setGifSearchQuery]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n function renderContent() {\n if (query === undefined) {\n return undefined;\n }\n\n if (!results) {\n return (\n \n );\n }\n\n if (!results.length) {\n return (\n

{lang('NoGIFsFound')}

\n );\n }\n\n return results.map((gif) => (\n \n ));\n }\n\n const hasResults = Boolean(query !== undefined && results && results.length);\n\n return (\n
\n \n {renderContent()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const currentSearch = selectCurrentGifSearch(global);\n const { query, results } = currentSearch || {};\n const { chatId } = selectCurrentMessageList(global) || {};\n const chat = chatId ? selectChat(global, chatId) : undefined;\n const isChatWithBot = chat ? selectIsChatWithBot(global, chat) : undefined;\n\n return {\n query,\n results,\n chat,\n isChatWithBot,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['searchMoreGifs', 'sendMessage', 'setGifSearchQuery']),\n)(GifSearch));\n","import React, {\n FC, useCallback, useState, memo, useEffect,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiChat,\n ApiMessage,\n ApiPollAnswer,\n ApiPollResult,\n} from '../../api/types';\nimport { GlobalActions } from '../../global/types';\nimport { pick } from '../../util/iteratees';\nimport usePrevious from '../../hooks/usePrevious';\nimport useLang from '../../hooks/useLang';\n\nimport ShowMoreButton from '../ui/ShowMoreButton';\nimport Loading from '../ui/Loading';\nimport ListItem from '../ui/ListItem';\nimport PrivateChatInfo from '../common/PrivateChatInfo';\n\nimport './PollAnswerResults.scss';\n\ntype OwnProps = {\n chat: ApiChat;\n message: ApiMessage;\n answer: ApiPollAnswer;\n answerVote: ApiPollResult;\n totalVoters: number;\n};\n\ntype StateProps = {\n voters?: number[];\n offset: string;\n};\n\ntype DispatchProps = Pick;\n\nconst INITIAL_LIMIT = 4;\nconst VIEW_MORE_LIMIT = 50;\n\nconst PollAnswerResults: FC = ({\n chat,\n message,\n answer,\n answerVote,\n totalVoters,\n voters,\n offset,\n loadPollOptionResults,\n openChat,\n closePollResults,\n}) => {\n const prevVotersCount = usePrevious(answerVote.votersCount);\n const [isLoading, setIsLoading] = useState(true);\n const areVotersLoaded = Boolean(voters);\n const { option, text } = answer;\n const lang = useLang();\n\n useEffect(() => {\n // For update when new votes arrive or when the user takes back his vote\n if (!areVotersLoaded || prevVotersCount !== answerVote.votersCount) {\n loadPollOptionResults({\n chat, messageId: message.id, option, offset, limit: INITIAL_LIMIT, shouldResetVoters: true,\n });\n }\n // eslint-disable-next-line\n }, [answerVote.votersCount, areVotersLoaded]);\n\n const handleViewMoreClick = useCallback(() => {\n setIsLoading(true);\n loadPollOptionResults({\n chat, messageId: message.id, option, offset, limit: VIEW_MORE_LIMIT,\n });\n }, [chat, loadPollOptionResults, message.id, offset, option]);\n\n useEffect(() => {\n setIsLoading(false);\n }, [voters]);\n\n const handleMemberClick = useCallback((id: number) => {\n openChat({ id });\n closePollResults();\n }, [closePollResults, openChat]);\n\n function renderViewMoreButton() {\n const leftVotersCount = answerVote.votersCount - voters!.length;\n\n return answerVote.votersCount > INITIAL_LIMIT && leftVotersCount > 0 && (\n \n );\n }\n\n return (\n
\n
\n {voters\n ? voters.map((id) => (\n handleMemberClick(id)}\n >\n \n \n ))\n : }\n {voters && renderViewMoreButton()}\n
\n
\n {text}\n \n {getPercentage(answerVote.votersCount, totalVoters)}%\n \n
\n
\n );\n};\n\nfunction getPercentage(value: number, total: number) {\n return total > 0 ? ((value / total) * 100).toFixed() : 0;\n}\n\nexport default memo(withGlobal(\n (global, { answer }: OwnProps): StateProps => {\n const { voters, offsets } = global.pollResults;\n\n return {\n voters: voters?.[answer.option],\n offset: (offsets?.[answer.option]) || '',\n };\n },\n (global, actions): DispatchProps => pick(actions, ['loadPollOptionResults', 'openChat', 'closePollResults']),\n)(PollAnswerResults));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage, ApiChat } from '../../api/types';\nimport { selectChat, selectChatMessage } from '../../modules/selectors';\nimport { buildCollectionByKey } from '../../util/iteratees';\nimport { getMessagePoll } from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport PollAnswerResults from './PollAnswerResults';\nimport Loading from '../ui/Loading';\n\nimport './PollResults.scss';\n\ntype OwnProps = {\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n message?: ApiMessage;\n lastSyncTime?: number;\n};\n\nconst PollResults: FC = ({\n onClose,\n isActive,\n chat,\n message,\n lastSyncTime,\n}) => {\n const lang = useLang();\n useHistoryBack(isActive, onClose);\n\n if (!message || !chat) {\n return ;\n }\n\n const { summary, results } = getMessagePoll(message)!;\n if (!results.results) {\n return undefined;\n }\n\n const resultsByOption = buildCollectionByKey(results.results, 'option');\n\n return (\n
\n

{summary.question}

\n
\n {lastSyncTime && summary.answers.map((answer) => (\n \n ))}\n {!lastSyncTime && }\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n pollResults: { chatId, messageId },\n lastSyncTime,\n } = global;\n\n if (!chatId || !messageId) {\n return {};\n }\n\n const chat = selectChat(global, chatId);\n const message = selectChatMessage(global, chatId, messageId);\n\n return {\n chat,\n message,\n lastSyncTime,\n };\n },\n)(PollResults));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\nimport { ManagementProgress } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport {\n selectChat, selectNotifyExceptions, selectNotifySettings, selectUser,\n} from '../../../modules/selectors';\nimport { selectIsChatMuted } from '../../../modules/helpers';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport InputText from '../../ui/InputText';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\nimport './Management.scss';\n\ntype OwnProps = {\n userId: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat: ApiChat;\n progress?: ManagementProgress;\n isMuted?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst ERROR_FIRST_NAME_MISSING = 'Please provide first name';\n\nconst ManageUser: FC = ({\n userId,\n user,\n chat,\n progress,\n isMuted,\n updateContact,\n deleteUser,\n deleteHistory,\n closeManagement,\n openChat,\n onClose,\n isActive,\n}) => {\n const [isDeleteDialogOpen, openDeleteDialog, closeDeleteDialog] = useFlag();\n const [isProfileFieldsTouched, setIsProfileFieldsTouched] = useState(false);\n const [error, setError] = useState();\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const currentFirstName = user ? (user.firstName || '') : '';\n const currentLastName = user ? (user.lastName || '') : '';\n\n const [firstName, setFirstName] = useState(currentFirstName);\n const [lastName, setLastName] = useState(currentLastName);\n const [isNotificationsEnabled, setIsNotificationsEnabled] = useState(!isMuted);\n\n useEffect(() => {\n setIsNotificationsEnabled(!isMuted);\n }, [isMuted]);\n\n useEffect(() => {\n setIsProfileFieldsTouched(false);\n closeDeleteDialog();\n }, [closeDeleteDialog, userId]);\n\n useEffect(() => {\n setFirstName(currentFirstName);\n setLastName(currentLastName);\n }, [currentFirstName, currentLastName, user]);\n\n useEffect(() => {\n if (progress === ManagementProgress.Complete) {\n setIsProfileFieldsTouched(false);\n setError(undefined);\n closeDeleteDialog();\n }\n }, [closeDeleteDialog, progress]);\n\n const handleFirstNameChange = useCallback((e: ChangeEvent) => {\n setFirstName(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleLastNameChange = useCallback((e: ChangeEvent) => {\n setLastName(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleNotificationChange = useCallback((e: ChangeEvent) => {\n setIsNotificationsEnabled(e.target.checked);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleProfileSave = useCallback(() => {\n const trimmedFirstName = firstName.trim();\n const trimmedLastName = lastName.trim();\n\n if (!trimmedFirstName.length) {\n setError(ERROR_FIRST_NAME_MISSING);\n }\n\n updateContact({\n userId,\n isMuted: !isNotificationsEnabled,\n firstName: trimmedFirstName,\n lastName: trimmedLastName,\n });\n }, [firstName, lastName, updateContact, userId, isNotificationsEnabled]);\n\n const handleDeleteContact = useCallback(() => {\n deleteHistory({\n chatId: chat.id,\n shouldDeleteForAll: false,\n });\n deleteUser({ userId });\n closeDeleteDialog();\n closeManagement();\n openChat({ id: undefined });\n }, [chat.id, closeDeleteDialog, closeManagement, deleteHistory, deleteUser, openChat, userId]);\n\n if (!user) {\n return undefined;\n }\n\n const isLoading = progress === ManagementProgress.InProgress;\n\n return (\n
\n
\n
\n \n \n \n
\n \n
\n
\n
\n \n {lang('DeleteContact')}\n \n
\n
\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { userId }): StateProps => {\n const user = selectUser(global, userId);\n const chat = selectChat(global, userId)!;\n const { progress } = global.management;\n const isMuted = selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global));\n\n return {\n user, chat, progress, isMuted,\n };\n },\n (global, actions): DispatchProps => pick(actions, [\n 'updateContact', 'deleteUser', 'closeManagement', 'openChat', 'deleteHistory',\n ]),\n)(ManageUser));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens, ManagementProgress } from '../../../types';\nimport { ApiChat, ApiChatBannedRights, ApiMediaFormat } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { getChatAvatarHash, getHasAdminRight, isChatBasicGroup } from '../../../modules/helpers';\nimport useMedia from '../../../hooks/useMedia';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport { selectChat } from '../../../modules/selectors';\nimport { formatInteger } from '../../../util/textFormat';\nimport { pick } from '../../../util/iteratees';\nimport renderText from '../../common/helpers/renderText';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport AvatarEditable from '../../ui/AvatarEditable';\nimport InputText from '../../ui/InputText';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport Spinner from '../../ui/Spinner';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\nimport './Management.scss';\n\ntype OwnProps = {\n chatId: number;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n progress?: ManagementProgress;\n isBasicGroup: boolean;\n hasLinkedChannel: boolean;\n canChangeInfo?: boolean;\n canBanUsers?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst GROUP_TITLE_EMPTY = 'Group title can\\'t be empty';\n\n// Some checkboxes control multiple rights, and some rights are not controlled from Permissions screen,\n// so we need to define the amount manually\nconst TOTAL_PERMISSIONS_COUNT = 8;\n\nconst ManageGroup: FC = ({\n chatId,\n chat,\n progress,\n isBasicGroup,\n hasLinkedChannel,\n canChangeInfo,\n canBanUsers,\n onScreenSelect,\n togglePreHistoryHidden,\n updateChat,\n deleteChat,\n leaveChannel,\n deleteChannel,\n closeManagement,\n openChat,\n onClose,\n isActive,\n}) => {\n const [isDeleteDialogOpen, openDeleteDialog, closeDeleteDialog] = useFlag();\n const currentTitle = chat.title;\n const currentAbout = chat.fullInfo ? (chat.fullInfo.about || '') : '';\n\n const [isProfileFieldsTouched, setIsProfileFieldsTouched] = useState(false);\n const [title, setTitle] = useState(currentTitle);\n const [about, setAbout] = useState(currentAbout);\n const [photo, setPhoto] = useState();\n const [error, setError] = useState();\n const imageHash = getChatAvatarHash(chat);\n const currentAvatarBlobUrl = useMedia(imageHash, false, ApiMediaFormat.BlobUrl);\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n useEffect(() => {\n if (progress === ManagementProgress.Complete) {\n setIsProfileFieldsTouched(false);\n setError(undefined);\n }\n }, [progress]);\n\n const handleClickEditType = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatPrivacyType);\n }, [onScreenSelect]);\n\n const handleClickDiscussion = useCallback(() => {\n onScreenSelect(ManagementScreens.Discussion);\n }, [onScreenSelect]);\n\n const handleClickPermissions = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupPermissions);\n }, [onScreenSelect]);\n\n const handleClickAdministrators = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatAdministrators);\n }, [onScreenSelect]);\n\n const handleSetPhoto = useCallback((file: File) => {\n setPhoto(file);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleTitleChange = useCallback((e: ChangeEvent) => {\n setTitle(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleAboutChange = useCallback((e: ChangeEvent) => {\n setAbout(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleUpdateGroup = useCallback(() => {\n const trimmedTitle = title.trim();\n const trimmedAbout = about.trim();\n\n if (!trimmedTitle.length) {\n setError(GROUP_TITLE_EMPTY);\n return;\n }\n\n updateChat({\n chatId,\n title: trimmedTitle,\n about: trimmedAbout,\n photo,\n });\n }, [about, chatId, photo, title, updateChat]);\n\n const handleClickMembers = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupMembers);\n }, [onScreenSelect]);\n\n const handleTogglePreHistory = useCallback(() => {\n if (!chat.fullInfo) {\n return;\n }\n\n const { isPreHistoryHidden } = chat.fullInfo;\n\n togglePreHistoryHidden({ chatId: chat.id, isEnabled: !isPreHistoryHidden });\n }, [chat, togglePreHistoryHidden]);\n\n const enabledPermissionsCount = useMemo(() => {\n if (!chat.defaultBannedRights) {\n return 0;\n }\n\n let totalCount = [\n 'sendMessages',\n 'sendMedia',\n 'embedLinks',\n 'sendPolls',\n 'changeInfo',\n 'inviteUsers',\n 'pinMessages',\n ].filter(\n (key) => !chat.defaultBannedRights![key as keyof ApiChatBannedRights],\n ).length;\n\n const { sendStickers, sendGifs } = chat.defaultBannedRights;\n\n // These two rights are controlled with a single checkbox\n if (!sendStickers && !sendGifs) {\n totalCount += 1;\n }\n\n return totalCount;\n }, [chat]);\n\n const adminsCount = (chat.fullInfo?.adminMembers?.length) || 0;\n\n const handleDeleteGroup = useCallback(() => {\n if (isBasicGroup) {\n deleteChat({ chatId: chat.id });\n } else if (!chat.isCreator) {\n leaveChannel({ chatId: chat.id });\n } else {\n deleteChannel({ chatId: chat.id });\n }\n closeDeleteDialog();\n closeManagement();\n openChat({ id: undefined });\n }, [\n isBasicGroup, chat.isCreator, chat.id,\n closeDeleteDialog, closeManagement, leaveChannel, deleteChannel, deleteChat, openChat,\n ]);\n\n if (chat.isRestricted) {\n return undefined;\n }\n\n const isLoading = progress === ManagementProgress.InProgress;\n\n return (\n
\n
\n
\n \n \n \n {chat.isCreator && (\n \n {lang('GroupType')}\n {chat.username ? lang('TypePublic') : lang('TypePrivate')}\n \n )}\n {hasLinkedChannel && (\n \n {lang('LinkedChannel')}\n {lang('DiscussionUnlink')}\n \n )}\n \n {lang('ChannelPermissions')}\n \n {enabledPermissionsCount}/{TOTAL_PERMISSIONS_COUNT}\n \n \n \n {lang('ChannelAdministrators')}\n {formatInteger(adminsCount)}\n \n
\n
\n \n {lang('GroupMembers')}\n {formatInteger(chat.membersCount ?? 0)}\n \n\n {chat.fullInfo && (\n
\n \n
\n )}\n
\n
\n \n {lang('DeleteMega')}\n \n
\n
\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { progress } = global.management;\n const hasLinkedChannel = Boolean(chat.fullInfo?.linkedChatId);\n const isBasicGroup = isChatBasicGroup(chat);\n\n return {\n chat,\n progress,\n isBasicGroup,\n hasLinkedChannel,\n canChangeInfo: isBasicGroup ? chat.isCreator : getHasAdminRight(chat, 'changeInfo'),\n canBanUsers: isBasicGroup ? chat.isCreator : getHasAdminRight(chat, 'banUsers'),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'togglePreHistoryHidden', 'updateChat', 'closeManagement',\n 'leaveChannel', 'deleteChannel', 'deleteChat', 'openChat',\n ]),\n)(ManageGroup));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens } from '../../../types';\nimport { ApiChat, ApiChatBannedRights, ApiChatMember } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport useLang from '../../../hooks/useLang';\nimport { selectChat } from '../../../modules/selectors';\nimport { pick } from '../../../util/iteratees';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\ntype OwnProps = {\n chatId: number;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: number, isPromotedByCurrentUser?: boolean) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n currentUserId?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst FLOATING_BUTTON_ANIMATION_TIMEOUT_MS = 250;\n\nfunction getLangKeyForBannedRightKey(key: string) {\n switch (key) {\n case 'sendMessages':\n return 'UserRestrictionsNoSend';\n case 'sendMedia':\n return 'UserRestrictionsNoSendMedia';\n case 'sendStickers':\n return 'UserRestrictionsNoSendStickers';\n case 'embedLinks':\n return 'UserRestrictionsNoEmbedLinks';\n case 'sendPolls':\n return 'UserRestrictionsNoSendPolls';\n case 'changeInfo':\n return 'UserRestrictionsNoChangeInfo';\n case 'inviteUsers':\n return 'UserRestrictionsInviteUsers';\n case 'pinMessages':\n return 'UserRestrictionsPinMessages';\n default:\n return undefined;\n }\n}\n\nconst ManageGroupPermissions: FC = ({\n onScreenSelect,\n onChatMemberSelect,\n chat,\n currentUserId,\n updateChatDefaultBannedRights,\n onClose,\n isActive,\n}) => {\n const [permissions, setPermissions] = useState({});\n const [havePermissionChanged, setHavePermissionChanged] = useState(false);\n const [isLoading, setIsLoading] = useState(false);\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const handleRemovedUsersClick = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupRemovedUsers);\n }, [onScreenSelect]);\n\n const handleAddExceptionClick = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupUserPermissionsCreate);\n }, [onScreenSelect]);\n\n const handleExceptionMemberClick = useCallback((member: ApiChatMember) => {\n onChatMemberSelect(member.userId, member.promotedByUserId === currentUserId);\n onScreenSelect(ManagementScreens.GroupUserPermissions);\n }, [currentUserId, onChatMemberSelect, onScreenSelect]);\n\n useEffect(() => {\n setPermissions((chat?.defaultBannedRights) || {});\n setHavePermissionChanged(false);\n setTimeout(() => {\n setIsLoading(false);\n }, FLOATING_BUTTON_ANIMATION_TIMEOUT_MS);\n }, [chat]);\n\n const handlePermissionChange = useCallback((e: React.ChangeEvent) => {\n const { name } = e.target;\n\n function getUpdatedPermissionValue(value: true | undefined) {\n return value ? undefined : true;\n }\n\n setPermissions((p) => ({\n ...p,\n [name]: getUpdatedPermissionValue(p[name as Exclude]),\n ...(name === 'sendStickers' && {\n sendGifs: getUpdatedPermissionValue(p[name]),\n }),\n }));\n setHavePermissionChanged(true);\n }, []);\n\n const handleSavePermissions = useCallback(() => {\n if (!chat) {\n return;\n }\n\n setIsLoading(true);\n updateChatDefaultBannedRights({ chatId: chat.id, bannedRights: permissions });\n }, [chat, permissions, updateChatDefaultBannedRights]);\n\n const removedUsersCount = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.kickedMembers) {\n return 0;\n }\n\n return chat.fullInfo.kickedMembers.length;\n }, [chat]);\n\n const exceptionMembers = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.members) {\n return [];\n }\n\n return chat.fullInfo.members.filter(({ bannedRights }) => !!bannedRights);\n }, [chat]);\n\n const getMemberExceptions = useCallback((member: ApiChatMember) => {\n const { bannedRights } = member;\n if (!bannedRights || !chat) {\n return undefined;\n }\n\n const { defaultBannedRights } = chat;\n\n return Object.keys(bannedRights).reduce((result, key) => {\n if (\n !bannedRights[key as keyof ApiChatBannedRights]\n || (defaultBannedRights?.[key as keyof ApiChatBannedRights])\n || key === 'sendInline' || key === 'viewMessages' || key === 'sendGames'\n ) {\n return result;\n }\n\n const langKey = getLangKeyForBannedRightKey(key);\n\n if (!langKey) {\n return result;\n }\n\n const translatedString = lang(langKey);\n\n return `${result}${!result.length ? translatedString : `, ${translatedString}`}`;\n }, '');\n }, [chat, lang]);\n\n return (\n
\n
\n
\n

{lang('ChannelPermissionsHeader')}

\n\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n\n
\n \n {lang('ChannelBlockedUsers')}\n {removedUsersCount}\n \n
\n\n
\n

{lang('PrivacyExceptions')}

\n\n \n {lang('ChannelAddException')}\n \n\n {exceptionMembers.map((member) => (\n handleExceptionMemberClick(member)}\n >\n \n \n ))}\n
\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n\n return { chat, currentUserId: global.currentUserId };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['updateChatDefaultBannedRights']),\n)(ManageGroupPermissions));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatMember, ApiUser } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { selectChat } from '../../../modules/selectors';\nimport { getUserFullName } from '../../../modules/helpers';\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\n\ntype OwnProps = {\n chatId: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n usersById: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst ManageGroupRemovedUsers: FC = ({\n chat,\n usersById,\n updateChatMemberBannedRights,\n onClose,\n isActive,\n}) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const removedMembers = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.kickedMembers) {\n return [];\n }\n\n return chat.fullInfo.kickedMembers;\n }, [chat]);\n\n const getRemovedBy = useCallback((member: ApiChatMember) => {\n if (!member.kickedByUserId) {\n return undefined;\n }\n\n const kickedByUser = usersById[member.kickedByUserId];\n if (!kickedByUser) {\n return undefined;\n }\n\n return lang('UserRemovedBy', getUserFullName(kickedByUser));\n }, [lang, usersById]);\n\n const getContextActions = useCallback((member: ApiChatMember) => {\n if (!chat) {\n return undefined;\n }\n\n return [{\n title: lang('Unblock'),\n icon: 'delete',\n destructive: true,\n handler: () => updateChatMemberBannedRights({\n chatId: chat.id,\n userId: member.userId,\n bannedRights: {},\n }),\n }];\n }, [lang, chat, updateChatMemberBannedRights]);\n\n return (\n
\n
\n
\n

{lang('NoBlockedGroup2')}

\n\n {removedMembers.map((member) => (\n \n \n \n ))}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { byId: usersById } = global.users;\n\n return { chat, usersById };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['updateChatMemberBannedRights']),\n)(ManageGroupRemovedUsers));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ManagementScreens, ManagementProgress } from '../../../types';\nimport { ApiChat, ApiMediaFormat } from '../../../api/types';\n\nimport { pick } from '../../../util/iteratees';\nimport { getChatAvatarHash, getHasAdminRight } from '../../../modules/helpers';\nimport useMedia from '../../../hooks/useMedia';\nimport useLang from '../../../hooks/useLang';\nimport { selectChat } from '../../../modules/selectors';\n\nimport AvatarEditable from '../../ui/AvatarEditable';\nimport InputText from '../../ui/InputText';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport Spinner from '../../ui/Spinner';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\nimport useFlag from '../../../hooks/useFlag';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport './Management.scss';\n\ntype OwnProps = {\n chatId: number;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n progress?: ManagementProgress;\n isSignaturesShown: boolean;\n canChangeInfo?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst CHANNEL_TITLE_EMPTY = 'Channel title can\\'t be empty';\n\nconst ManageChannel: FC = ({\n chatId,\n chat,\n progress,\n isSignaturesShown,\n canChangeInfo,\n onScreenSelect,\n updateChat,\n toggleSignatures,\n closeManagement,\n leaveChannel,\n deleteChannel,\n openChat,\n onClose,\n isActive,\n}) => {\n const currentTitle = chat ? (chat.title || '') : '';\n const currentAbout = chat?.fullInfo ? (chat.fullInfo.about || '') : '';\n const hasLinkedChat = chat?.fullInfo?.linkedChatId;\n\n const [isDeleteDialogOpen, openDeleteDialog, closeDeleteDialog] = useFlag();\n const [isProfileFieldsTouched, setIsProfileFieldsTouched] = useState(false);\n const [title, setTitle] = useState(currentTitle);\n const [about, setAbout] = useState(currentAbout);\n const [photo, setPhoto] = useState();\n const [error, setError] = useState();\n const imageHash = chat && getChatAvatarHash(chat);\n const currentAvatarBlobUrl = useMedia(imageHash, false, ApiMediaFormat.BlobUrl);\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n useEffect(() => {\n if (progress === ManagementProgress.Complete) {\n setIsProfileFieldsTouched(false);\n setError(undefined);\n }\n }, [progress]);\n\n const adminsCount = (chat?.fullInfo?.adminMembers?.length) || 0;\n\n const handleClickEditType = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatPrivacyType);\n }, [onScreenSelect]);\n\n const handleClickDiscussion = useCallback(() => {\n onScreenSelect(ManagementScreens.Discussion);\n }, [onScreenSelect]);\n\n const handleClickAdministrators = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatAdministrators);\n }, [onScreenSelect]);\n\n const handleSetPhoto = useCallback((file: File) => {\n setPhoto(file);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleTitleChange = useCallback((e: ChangeEvent) => {\n setTitle(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleAboutChange = useCallback((e: ChangeEvent) => {\n setAbout(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleUpdateChannel = useCallback(() => {\n const trimmedTitle = title.trim();\n const trimmedAbout = about.trim();\n\n if (!trimmedTitle.length) {\n setError(CHANNEL_TITLE_EMPTY);\n return;\n }\n\n updateChat({\n chatId,\n title: trimmedTitle,\n about: trimmedAbout,\n photo,\n });\n }, [about, chatId, photo, title, updateChat]);\n\n const handleToggleSignatures = useCallback(() => {\n toggleSignatures({ chatId, isEnabled: !isSignaturesShown });\n }, [chatId, isSignaturesShown, toggleSignatures]);\n\n const handleClickSubscribers = useCallback(() => {\n onScreenSelect(ManagementScreens.ChannelSubscribers);\n }, [onScreenSelect]);\n\n const handleDeleteChannel = useCallback(() => {\n if (chat.isCreator) {\n deleteChannel({ chatId: chat.id });\n } else {\n leaveChannel({ chatId: chat.id });\n }\n\n closeDeleteDialog();\n closeManagement();\n openChat({ id: undefined });\n }, [chat.isCreator, chat.id, closeDeleteDialog, closeManagement, leaveChannel, deleteChannel, openChat]);\n\n if (chat.isRestricted) {\n return undefined;\n }\n\n const isLoading = progress === ManagementProgress.InProgress;\n\n return (\n
\n
\n
\n \n \n \n {chat.isCreator && (\n \n {lang('ChannelType')}\n {chat.username ? lang('TypePublic') : lang('TypePrivate')}\n \n )}\n \n {lang('Discussion')}\n {hasLinkedChat ? lang('DiscussionUnlink') : lang('Add')}\n \n \n {lang('ChannelAdministrators')}\n {adminsCount}\n \n
\n \n
\n
\n
\n \n {lang('ChannelSubscribers')}\n {lang('Subscribers', chat.membersCount ?? 0, 'i')}\n \n
\n
\n \n {chat.isCreator ? lang('ChannelDelete') : lang('LeaveChannel')}\n \n
\n
\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { progress } = global.management;\n const isSignaturesShown = Boolean(chat?.isSignaturesShown);\n\n return {\n chat,\n progress,\n isSignaturesShown,\n canChangeInfo: getHasAdminRight(chat, 'changeInfo'),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'toggleSignatures', 'updateChat', 'closeManagement', 'leaveChannel', 'deleteChannel', 'openChat',\n ]),\n)(ManageChannel));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat } from '../../../api/types';\nimport { ManagementProgress } from '../../../types';\n\nimport { selectChat, selectManagement } from '../../../modules/selectors';\nimport { pick } from '../../../util/iteratees';\nimport { isChatChannel } from '../../../modules/helpers';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport SafeLink from '../../common/SafeLink';\nimport ListItem from '../../ui/ListItem';\nimport RadioGroup from '../../ui/RadioGroup';\nimport Loading from '../../ui/Loading';\nimport Spinner from '../../ui/Spinner';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport UsernameInput from '../../common/UsernameInput';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\ntype PrivacyType = 'private' | 'public';\n\ntype OwnProps = {\n chatId: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n isChannel: boolean;\n progress?: ManagementProgress;\n isUsernameAvailable?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst ManageChatPrivacyType: FC = ({\n chat,\n onClose,\n isActive,\n isChannel,\n progress,\n isUsernameAvailable,\n checkPublicLink,\n updatePublicLink,\n updatePrivateLink,\n}) => {\n const isPublic = Boolean(chat.username);\n const privateLink = chat.fullInfo?.inviteLink;\n\n const [privacyType, setPrivacyType] = useState(isPublic ? 'public' : 'private');\n const [username, setUsername] = useState();\n const [isRevokeConfirmDialogOpen, openRevokeConfirmDialog, closeRevokeConfirmDialog] = useFlag();\n\n const canUpdate = Boolean(\n (privacyType === 'public' && username && isUsernameAvailable)\n || (privacyType === 'private' && isPublic),\n );\n\n useHistoryBack(isActive, onClose);\n\n useEffect(() => {\n if (privacyType && !privateLink) {\n updatePrivateLink();\n }\n }, [privacyType, privateLink, updatePrivateLink]);\n\n const handleOptionChange = useCallback((value: string) => {\n setPrivacyType(value as PrivacyType);\n }, []);\n\n const handleSave = useCallback(() => {\n updatePublicLink({ username: privacyType === 'public' ? username : '' });\n }, [privacyType, updatePublicLink, username]);\n\n const handleRevokePrivateLink = useCallback(() => {\n closeRevokeConfirmDialog();\n updatePrivateLink();\n }, [closeRevokeConfirmDialog, updatePrivateLink]);\n\n const lang = useLang();\n const langPrefix1 = isChannel ? 'Channel' : 'Mega';\n const langPrefix2 = isChannel ? 'Channel' : 'Group';\n\n const options = [\n { value: 'private', label: lang(`${langPrefix1}Private`), subLabel: lang(`${langPrefix1}PrivateInfo`) },\n { value: 'public', label: lang(`${langPrefix1}Public`), subLabel: lang(`${langPrefix1}PublicInfo`) },\n ];\n\n const isLoading = progress === ManagementProgress.InProgress;\n\n return (\n
\n
\n
\n

{lang(`${langPrefix2}Type`)}

\n \n
\n {privacyType === 'private' ? (\n
\n {privateLink ? (\n <>\n \n

\n {lang(`${langPrefix1}PrivateLinkHelp`)}\n

\n\n \n {lang('RevokeLink')}\n \n \n \n ) : (\n \n )}\n
\n ) : (\n
\n \n

\n {lang(`${langPrefix2}.Username.CreatePublicLinkHelp`)}\n

\n
\n )}\n
\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { isUsernameAvailable } = selectManagement(global, chatId)!;\n\n return {\n chat,\n isChannel: isChatChannel(chat),\n progress: global.management.progress,\n isUsernameAvailable,\n };\n },\n (setGlobal, actions) => pick(actions, [\n 'checkPublicLink', 'updatePublicLink', 'updatePrivateLink',\n ]),\n)(ManageChatPrivacyType));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport { STICKER_SIZE_DISCUSSION_GROUPS } from '../../../config';\nimport { selectChat } from '../../../modules/selectors';\nimport { pick } from '../../../util/iteratees';\nimport getAnimationData from '../../common/helpers/animatedAssets';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport NothingFound from '../../common/NothingFound';\nimport GroupChatInfo from '../../common/GroupChatInfo';\nimport AnimatedSticker from '../../common/AnimatedSticker';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\nimport useFlag from '../../../hooks/useFlag';\nimport renderText from '../../common/helpers/renderText';\nimport Avatar from '../../common/Avatar';\nimport { isChatChannel } from '../../../modules/helpers';\n\ntype OwnProps = {\n chatId: number;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n chatsByIds: Record;\n linkedChat?: ApiChat;\n forDiscussionIds?: number[];\n isChannel?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst ManageDiscussion: FC = ({\n chat,\n onClose,\n isActive,\n chatId,\n chatsByIds,\n linkedChat,\n forDiscussionIds,\n isChannel,\n onScreenSelect,\n loadGroupsForDiscussion,\n linkDiscussionGroup,\n unlinkDiscussionGroup,\n}) => {\n const [linkedGroupId, setLinkedGroupId] = useState();\n const [animationData, setAnimationData] = useState>();\n const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);\n const handleAnimationLoad = useCallback(() => setIsAnimationLoaded(true), []);\n const [isConfirmUnlinkGroupDialogOpen, openConfirmUnlinkGroupDialog, closeConfirmUnlinkGroupDialog] = useFlag();\n const [isConfirmLinkGroupDialogOpen, openConfirmLinkGroupDialog, closeConfirmLinkGroupDialog] = useFlag();\n const lang = useLang();\n const linkedChatId = linkedChat?.id;\n\n useHistoryBack(isActive, onClose);\n\n useEffect(() => {\n loadGroupsForDiscussion();\n }, [loadGroupsForDiscussion]);\n\n useEffect(() => {\n if (!animationData) {\n getAnimationData('DiscussionGroups').then(setAnimationData);\n }\n }, [animationData]);\n\n const handleUnlinkGroupSessions = useCallback(() => {\n closeConfirmUnlinkGroupDialog();\n unlinkDiscussionGroup({ channelId: isChannel ? chatId : linkedChatId });\n if (!isChannel) {\n onScreenSelect(ManagementScreens.Initial);\n }\n }, [closeConfirmUnlinkGroupDialog, unlinkDiscussionGroup, isChannel, chatId, linkedChatId, onScreenSelect]);\n\n const handleLinkGroupSessions = useCallback(() => {\n closeConfirmLinkGroupDialog();\n linkDiscussionGroup({ channelId: chatId, chatId: linkedGroupId });\n }, [closeConfirmLinkGroupDialog, linkDiscussionGroup, chatId, linkedGroupId]);\n\n const onDiscussionClick = (groupId: number) => {\n setLinkedGroupId(groupId);\n openConfirmLinkGroupDialog();\n };\n\n function renderUnlinkGroupHeader() {\n return (\n
\n \n
\n {lang(isChannel ? 'DiscussionUnlinkGroup' : 'DiscussionUnlinkChannel')}\n
\n
\n );\n }\n function renderLinkGroupHeader() {\n const linkedGroup = chatsByIds[linkedGroupId];\n\n if (!linkedGroup) {\n return undefined;\n }\n\n return (\n
\n \n
\n {lang('Channel.DiscussionGroup.LinkGroup')}\n
\n
\n );\n }\n\n function renderLinkGroupConfirmText() {\n const linkedGroup = chatsByIds[linkedGroupId];\n\n if (!linkedGroup) {\n return undefined;\n }\n\n if (linkedGroup.hasPrivateLink) {\n return renderText(\n `Do you want to make **${linkedGroup.title}** the discussion board for **${chat!.title}**?`,\n ['br', 'simple_markdown'],\n );\n // return renderText(\n // lang('DiscussionLinkGroupPublicAlert', linkedChat.title, chat!.title),\n // ['br', 'simple_markdown'],\n // );\n }\n\n return renderText(\n // eslint-disable-next-line max-len\n `Do you want to make **${linkedGroup.title}** the discussion board for **${chat!.title}**?\\n\\nAnyone from the channel will be able to see messages in this group.`,\n ['br', 'simple_markdown'],\n );\n // return renderText(\n // lang('DiscussionLinkGroupPrivateAlert', linkedChat.title, chat!.title),\n // ['br', 'simple_markdown'],\n // );\n }\n\n function renderLinkedGroup() {\n return (\n
\n \n \n \n \n {lang(isChannel ? 'DiscussionUnlinkGroup' : 'DiscussionUnlinkChannel')}\n \n \n
\n );\n }\n\n function renderDiscussionGroups() {\n return (\n
\n

{lang('DiscussionChannelHelp')}

\n\n
\n \n {lang('DiscussionCreateGroup')}\n \n {forDiscussionIds ? (\n forDiscussionIds.map((id, i) => (\n { onDiscussionClick(id); }}\n >\n \n \n ))\n ) : (\n \n )}\n
\n

{lang('DiscussionChannelHelp2')}

\n \n
\n );\n }\n\n return (\n
\n
\n
\n
\n {animationData && (\n \n )}\n
\n {linkedChat && renderLinkedGroup()}\n {!linkedChat && renderDiscussionGroups()}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { forDiscussionIds, byId: chatsByIds } = global.chats;\n const linkedChat = chat?.fullInfo?.linkedChatId\n ? selectChat(global, chat.fullInfo.linkedChatId)\n : undefined;\n\n return {\n chat,\n chatsByIds,\n forDiscussionIds,\n linkedChat,\n isChannel: chat && isChatChannel(chat),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadGroupsForDiscussion', 'linkDiscussionGroup', 'unlinkDiscussionGroup',\n ]),\n)(ManageDiscussion));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatBannedRights } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { pick } from '../../../util/iteratees';\nimport { selectChat } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\ntype OwnProps = {\n chatId: number;\n selectedChatMemberId?: number;\n isPromotedByCurrentUser?: boolean;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n isFormFullyDisabled?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst ManageGroupUserPermissions: FC = ({\n chat,\n selectedChatMemberId,\n onScreenSelect,\n updateChatMemberBannedRights,\n isFormFullyDisabled,\n onClose,\n isActive,\n}) => {\n const [permissions, setPermissions] = useState({});\n const [havePermissionChanged, setHavePermissionChanged] = useState(false);\n const [isLoading, setIsLoading] = useState(false);\n const [isBanConfirmationDialogOpen, openBanConfirmationDialog, closeBanConfirmationDialog] = useFlag();\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const selectedChatMember = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.members) {\n return undefined;\n }\n\n return chat.fullInfo.members.find(({ userId }) => userId === selectedChatMemberId);\n }, [chat, selectedChatMemberId]);\n\n useEffect(() => {\n if (chat?.fullInfo && selectedChatMemberId && !selectedChatMember) {\n onScreenSelect(ManagementScreens.GroupPermissions);\n }\n }, [chat, onScreenSelect, selectedChatMember, selectedChatMemberId]);\n\n useEffect(() => {\n setPermissions((selectedChatMember?.bannedRights) || (chat?.defaultBannedRights) || {});\n setHavePermissionChanged(false);\n setIsLoading(false);\n }, [chat, selectedChatMember]);\n\n const handlePermissionChange = useCallback((e: React.ChangeEvent) => {\n const { name } = e.target;\n\n function getUpdatedPermissionValue(value: true | undefined) {\n return value ? undefined : true;\n }\n\n setPermissions((p) => ({\n ...p,\n [name]: getUpdatedPermissionValue(p[name as Exclude]),\n ...(name === 'sendStickers' && {\n sendGifs: getUpdatedPermissionValue(p[name]),\n }),\n }));\n setHavePermissionChanged(true);\n }, []);\n\n const handleSavePermissions = useCallback(() => {\n if (!chat || !selectedChatMemberId) {\n return;\n }\n\n setIsLoading(true);\n updateChatMemberBannedRights({\n chatId: chat.id,\n userId: selectedChatMemberId,\n bannedRights: permissions,\n });\n }, [chat, selectedChatMemberId, permissions, updateChatMemberBannedRights]);\n\n const handleBanFromGroup = useCallback(() => {\n if (!chat || !selectedChatMemberId) {\n return;\n }\n\n updateChatMemberBannedRights({\n chatId: chat.id,\n userId: selectedChatMemberId,\n bannedRights: {\n viewMessages: true,\n },\n });\n }, [chat, selectedChatMemberId, updateChatMemberBannedRights]);\n\n const getControlIsDisabled = useCallback((key: Exclude) => {\n if (isFormFullyDisabled) {\n return true;\n }\n\n if (!chat || !chat.defaultBannedRights) {\n return false;\n }\n\n return chat.defaultBannedRights[key];\n }, [chat, isFormFullyDisabled]);\n\n if (!selectedChatMember) {\n return undefined;\n }\n\n return (\n
\n
\n
\n \n \n \n\n

{lang('UserRestrictionsCanDo')}

\n\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n\n {!isFormFullyDisabled && (\n
\n \n {lang('UserRestrictionsBlock')}\n \n
\n )}\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, isPromotedByCurrentUser }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const isFormFullyDisabled = !(chat.isCreator || isPromotedByCurrentUser);\n\n return { chat, isFormFullyDisabled };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['updateChatMemberBannedRights']),\n)(ManageGroupUserPermissions));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens } from '../../../types';\nimport { ApiChat, ApiChatMember, ApiUser } from '../../../api/types';\n\nimport { getUserFullName, isChatChannel } from '../../../modules/helpers';\nimport { selectChat } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\ntype OwnProps = {\n chatId: number;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: number, isPromotedByCurrentUser?: boolean) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n currentUserId?: number;\n isChannel: boolean;\n usersById: Record;\n};\n\nconst ManageChatAdministrators: FC = ({\n chat,\n isChannel,\n currentUserId,\n usersById,\n onScreenSelect,\n onChatMemberSelect,\n onClose,\n isActive,\n}) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n function handleRecentActionsClick() {\n onScreenSelect(ManagementScreens.GroupRecentActions);\n }\n\n const adminMembers = useMemo(() => {\n if (!chat.fullInfo || !chat.fullInfo.adminMembers) {\n return [];\n }\n\n return chat.fullInfo.adminMembers.sort((a, b) => {\n if (a.isOwner) {\n return -1;\n } else if (b.isOwner) {\n return 1;\n }\n\n return 0;\n });\n }, [chat]);\n\n const handleAdminMemberClick = useCallback((member: ApiChatMember) => {\n onChatMemberSelect(member.userId, member.promotedByUserId === currentUserId);\n onScreenSelect(ManagementScreens.ChatAdminRights);\n }, [currentUserId, onChatMemberSelect, onScreenSelect]);\n\n const getMemberStatus = useCallback((member: ApiChatMember) => {\n if (member.isOwner) {\n return lang('ChannelCreator');\n }\n\n const promotedByUser = member.promotedByUserId ? usersById[member.promotedByUserId] : undefined;\n\n if (promotedByUser) {\n return lang('EditAdminPromotedBy', getUserFullName(promotedByUser));\n }\n\n return lang('ChannelAdmin');\n }, [lang, usersById]);\n\n return (\n
\n
\n
\n \n {lang('EventLog')}\n {lang(isChannel ? 'EventLogInfoDetailChannel' : 'EventLogInfoDetail')}\n \n
\n\n
\n

\n {isChannel\n ? 'You can add administrators to help you manage your channel.'\n : 'You can add administrators to help you manage your group.'}\n

\n\n {adminMembers.map((member) => (\n handleAdminMemberClick(member)}\n >\n \n \n ))}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { byId: usersById } = global.users;\n\n return {\n chat,\n currentUserId: global.currentUserId,\n isChannel: isChatChannel(chat),\n usersById,\n };\n },\n // (setGlobal, actions): DispatchProps => pick(actions, ['togglePreHistoryHidden', 'updateChat']),\n)(ManageChatAdministrators));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatMember } from '../../../api/types';\nimport useLang from '../../../hooks/useLang';\nimport { selectChat } from '../../../modules/selectors';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\ntype OwnProps = {\n chatId: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n};\n\nconst ManageGroupRecentActions: FC = ({ chat, onClose, isActive }) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const adminMembers = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.adminMembers) {\n return [];\n }\n\n return chat.fullInfo.adminMembers.sort((a, b) => {\n if (a.isOwner) {\n return -1;\n } else if (b.isOwner) {\n return 1;\n }\n\n return 0;\n });\n }, [chat]);\n\n const getMemberStatus = useCallback((member: ApiChatMember) => {\n if (member.isOwner) {\n return lang('ChannelCreator');\n }\n\n return lang('ChannelAdmin');\n }, [lang]);\n\n return (\n
\n
\n
\n

Actions

\n\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n\n
\n

{lang('Channel.Management.Title')}

\n\n
\n \n
\n\n {adminMembers.map((member) => (\n \n \n \n \n ))}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n\n return { chat };\n },\n)(ManageGroupRecentActions));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatAdminRights, ApiUser } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { pick } from '../../../util/iteratees';\nimport { selectChat } from '../../../modules/selectors';\nimport { getUserFullName, isChatBasicGroup, isChatChannel } from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\nimport InputText from '../../ui/InputText';\n\ntype OwnProps = {\n chatId: number;\n selectedChatMemberId?: number;\n isPromotedByCurrentUser?: boolean;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n usersById: Record;\n currentUserId?: number;\n isChannel: boolean;\n isFormFullyDisabled: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst CUSTOM_TITLE_MAX_LENGTH = 16;\n\nconst ManageGroupAdminRights: FC = ({\n selectedChatMemberId,\n onScreenSelect,\n chat,\n usersById,\n currentUserId,\n isChannel,\n isFormFullyDisabled,\n updateChatAdmin,\n onClose,\n isActive,\n}) => {\n const [permissions, setPermissions] = useState({});\n const [isTouched, setIsTouched] = useState(false);\n const [isLoading, setIsLoading] = useState(false);\n const [isDismissConfirmationDialogOpen, openDismissConfirmationDialog, closeDismissConfirmationDialog] = useFlag();\n const [customTitle, setCustomTitle] = useState('');\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const selectedChatMember = useMemo(() => {\n if (!chat.fullInfo || !chat.fullInfo.adminMembers) {\n return undefined;\n }\n\n return chat.fullInfo.adminMembers.find(({ userId }) => userId === selectedChatMemberId);\n }, [chat, selectedChatMemberId]);\n\n useEffect(() => {\n if (chat?.fullInfo && selectedChatMemberId && !selectedChatMember) {\n onScreenSelect(ManagementScreens.ChatAdministrators);\n }\n }, [chat, onScreenSelect, selectedChatMember, selectedChatMemberId]);\n\n useEffect(() => {\n setPermissions((selectedChatMember?.adminRights) || {});\n setCustomTitle(((selectedChatMember?.customTitle) || '').substr(0, CUSTOM_TITLE_MAX_LENGTH));\n setIsTouched(false);\n setIsLoading(false);\n }, [selectedChatMember]);\n\n const handlePermissionChange = useCallback((e: React.ChangeEvent) => {\n const { name } = e.target;\n\n function getUpdatedPermissionValue(value: true | undefined) {\n return value ? undefined : true;\n }\n\n setPermissions((p) => ({\n ...p,\n [name]: getUpdatedPermissionValue(p[name as keyof ApiChatAdminRights]),\n }));\n setIsTouched(true);\n }, []);\n\n const handleSavePermissions = useCallback(() => {\n if (!selectedChatMemberId) {\n return;\n }\n\n setIsLoading(true);\n updateChatAdmin({\n chatId: chat.id,\n userId: selectedChatMemberId,\n adminRights: permissions,\n customTitle,\n });\n }, [chat, selectedChatMemberId, permissions, customTitle, updateChatAdmin]);\n\n const handleDismissAdmin = useCallback(() => {\n if (!selectedChatMemberId) {\n return;\n }\n\n updateChatAdmin({\n chatId: chat.id,\n userId: selectedChatMemberId,\n adminRights: {},\n });\n closeDismissConfirmationDialog();\n }, [chat.id, closeDismissConfirmationDialog, selectedChatMemberId, updateChatAdmin]);\n\n const getControlIsDisabled = useCallback((key: keyof ApiChatAdminRights) => {\n if (isChatBasicGroup(chat)) {\n return false;\n }\n\n if (isFormFullyDisabled || !chat.adminRights) {\n return true;\n }\n\n return !chat.adminRights![key];\n }, [chat, isFormFullyDisabled]);\n\n const memberStatus = useMemo(() => {\n if (!selectedChatMember) {\n return undefined;\n }\n\n if (selectedChatMember.isOwner) {\n return lang('ChannelCreator');\n }\n\n const promotedByUser = selectedChatMember.promotedByUserId\n ? usersById[selectedChatMember.promotedByUserId]\n : undefined;\n\n if (promotedByUser) {\n return lang('EditAdminPromotedBy', getUserFullName(promotedByUser));\n }\n\n return lang('ChannelAdmin');\n }, [selectedChatMember, usersById, lang]);\n\n const handleCustomTitleChange = useCallback((e) => {\n const { value } = e.target;\n setCustomTitle(value);\n setIsTouched(true);\n }, []);\n\n if (!selectedChatMember) {\n return undefined;\n }\n\n return (\n
\n
\n
\n \n \n \n\n

{lang('EditAdminWhatCanDo')}

\n\n
\n \n
\n {isChannel && (\n
\n \n
\n )}\n {isChannel && (\n
\n \n
\n )}\n
\n \n
\n {!isChannel && (\n
\n \n
\n )}\n
\n \n
\n {!isChannel && (\n
\n \n
\n )}\n
\n \n
\n {!isChannel && (\n
\n \n
\n )}\n\n {isFormFullyDisabled && (\n

\n {lang('Channel.EditAdmin.CannotEdit')}\n

\n )}\n\n {!isChannel && (\n \n )}\n\n {currentUserId !== selectedChatMemberId && !isFormFullyDisabled && (\n \n {lang('EditAdminRemoveAdmin')}\n \n )}\n
\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, isPromotedByCurrentUser }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { byId: usersById } = global.users;\n const { currentUserId } = global;\n const isChannel = isChatChannel(chat);\n const isFormFullyDisabled = !(chat.isCreator || isPromotedByCurrentUser);\n\n return {\n chat,\n usersById,\n currentUserId,\n isChannel,\n isFormFullyDisabled,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['updateChatAdmin']),\n)(ManageGroupAdminRights));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChatMember, ApiUser } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { selectChat } from '../../../modules/selectors';\nimport { sortUserIds, isChatChannel } from '../../../modules/helpers';\nimport { pick } from '../../../util/iteratees';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport NothingFound from '../../common/NothingFound';\nimport ListItem from '../../ui/ListItem';\n\ntype OwnProps = {\n chatId: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n usersById: Record;\n members?: ApiChatMember[];\n isChannel?: boolean;\n serverTimeOffset: number;\n};\n\ntype DispatchProps = Pick;\n\nconst ManageGroupMembers: FC = ({\n members,\n usersById,\n isChannel,\n openUserInfo,\n onClose,\n isActive,\n serverTimeOffset,\n}) => {\n const memberIds = useMemo(() => {\n if (!members || !usersById) {\n return undefined;\n }\n\n return sortUserIds(members.map(({ userId }) => userId), usersById, undefined, serverTimeOffset);\n }, [members, serverTimeOffset, usersById]);\n\n const handleMemberClick = useCallback((id: number) => {\n openUserInfo({ id });\n }, [openUserInfo]);\n\n useHistoryBack(isActive, onClose);\n\n return (\n
\n
\n
\n {memberIds ? (\n memberIds.map((id, i) => (\n handleMemberClick(id)}\n >\n \n \n ))\n ) : (\n \n )}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { byId: usersById } = global.users;\n const members = chat?.fullInfo?.members;\n const isChannel = chat && isChatChannel(chat);\n\n return {\n members,\n usersById,\n isChannel,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openUserInfo',\n ]),\n)(ManageGroupMembers));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChatMember, ApiUser } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport { selectChat } from '../../../modules/selectors';\nimport { sortUserIds, isChatChannel } from '../../../modules/helpers';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\nimport NothingFound from '../../common/NothingFound';\n\ntype OwnProps = {\n chatId: number;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: number) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n usersById: Record;\n members?: ApiChatMember[];\n isChannel?: boolean;\n serverTimeOffset: number;\n};\n\nconst ManageGroupUserPermissionsCreate: FC = ({\n usersById,\n members,\n isChannel,\n onScreenSelect,\n onChatMemberSelect,\n onClose,\n isActive,\n serverTimeOffset,\n}) => {\n useHistoryBack(isActive, onClose);\n\n const memberIds = useMemo(() => {\n if (!members || !usersById) {\n return undefined;\n }\n\n return sortUserIds(\n members.filter((member) => !member.isOwner).map(({ userId }) => userId),\n usersById, undefined, serverTimeOffset,\n );\n }, [members, serverTimeOffset, usersById]);\n\n const handleExceptionMemberClick = useCallback((memberId: number) => {\n onChatMemberSelect(memberId);\n onScreenSelect(ManagementScreens.GroupUserPermissions);\n }, [onChatMemberSelect, onScreenSelect]);\n\n return (\n
\n
\n
\n {memberIds ? (\n memberIds.map((id, i) => (\n handleExceptionMemberClick(id)}\n >\n \n \n ))\n ) : (\n \n )}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { byId: usersById } = global.users;\n const members = chat?.fullInfo?.members;\n const isChannel = chat && isChatChannel(chat);\n\n return {\n members,\n usersById,\n isChannel,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n)(ManageGroupUserPermissionsCreate));\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens, ManagementType } from '../../../types';\n\nimport { selectCurrentManagementType } from '../../../modules/selectors';\n\nimport ManageUser from './ManageUser';\nimport ManageGroup from './ManageGroup';\nimport ManageGroupPermissions from './ManageGroupPermissions';\nimport ManageGroupRemovedUsers from './ManageGroupRemovedUsers';\nimport ManageChannel from './ManageChannel';\nimport ManageChatPrivacyType from './ManageChatPrivacyType';\nimport ManageDiscussion from './ManageDiscussion';\nimport ManageGroupUserPermissions from './ManageGroupUserPermissions';\nimport ManageChatAdministrators from './ManageChatAdministrators';\nimport ManageGroupRecentActions from './ManageGroupRecentActions';\nimport ManageGroupAdminRights from './ManageGroupAdminRights';\nimport ManageGroupMembers from './ManageGroupMembers';\nimport ManageGroupUserPermissionsCreate from './ManageGroupUserPermissionsCreate';\n\nexport type OwnProps = {\n chatId: number;\n currentScreen: ManagementScreens;\n selectedChatMemberId?: number;\n isPromotedByCurrentUser?: boolean;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: number, isPromotedByCurrentUser?: boolean) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n managementType?: ManagementType;\n};\n\nconst Management: FC = ({\n chatId,\n currentScreen,\n selectedChatMemberId,\n isPromotedByCurrentUser,\n onScreenSelect,\n onChatMemberSelect,\n onClose,\n isActive,\n managementType,\n}) => {\n switch (currentScreen) {\n case ManagementScreens.Initial: {\n switch (managementType) {\n case 'user':\n return (\n \n );\n case 'group':\n return (\n \n );\n case 'channel':\n return (\n \n );\n }\n\n break;\n }\n\n case ManagementScreens.ChatPrivacyType:\n return (\n \n );\n\n case ManagementScreens.Discussion:\n return (\n \n );\n\n case ManagementScreens.GroupPermissions:\n return (\n \n );\n\n case ManagementScreens.GroupRemovedUsers:\n return (\n \n );\n\n case ManagementScreens.GroupUserPermissionsCreate:\n return (\n \n );\n\n case ManagementScreens.GroupUserPermissions:\n return (\n \n );\n\n case ManagementScreens.ChatAdministrators:\n return (\n \n );\n\n case ManagementScreens.GroupRecentActions:\n return (\n \n );\n\n case ManagementScreens.ChatAdminRights:\n return (\n \n );\n\n case ManagementScreens.ChannelSubscribers:\n case ManagementScreens.GroupMembers:\n return (\n \n );\n }\n\n return undefined; // Never reached\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const managementType = selectCurrentManagementType(global);\n\n return {\n managementType,\n };\n },\n)(Management));\n","const VISA = /^4[0-9]{12}(?:[0-9]{1,3})?$/;\nconst MASTERCARD1 = /^5[1-5][0-9]{11,14}$/;\nconst MASTERCARD2 = /^2[2-7][0-9]{11,14}$/;\n\nexport enum CardType {\n Default,\n Visa,\n Mastercard,\n}\n\nconst cards: Record = {\n [CardType.Default]: '',\n [CardType.Visa]: 'visa',\n [CardType.Mastercard]: 'mastercard',\n};\n\nexport function detectCardType(cardNumber: string): number {\n cardNumber = cardNumber.replace(/\\s/g, '');\n if (VISA.test(cardNumber)) {\n return CardType.Visa;\n }\n if (MASTERCARD1.test(cardNumber) || MASTERCARD2.test(cardNumber)) {\n return CardType.Mastercard;\n }\n return CardType.Default;\n}\n\nexport function detectCardTypeText(cardNumber: string): string {\n const cardType = detectCardType(cardNumber);\n return cards[cardType as number] || '';\n}\n","import useReducer, { StateReducer, Dispatch } from '../useReducer';\nimport { countryList } from '../../util/phoneNumber';\n\nexport type FormState = {\n streetLine1: string;\n streetLine2: string;\n city: string;\n state: string;\n countryIso2: string;\n postCode: string;\n fullName: string;\n email: string;\n phone: string;\n shipping: string;\n cardNumber: string;\n cardholder: string;\n expiry: string;\n cvv: string;\n billingCountry: string;\n billingZip: string;\n saveInfo: boolean;\n saveCredentials: boolean;\n formErrors: Record;\n};\n\nexport type FormActions = (\n 'changeAddress1' | 'changeAddress2' | 'changeCity' | 'changeState' | 'changeCountry' |\n 'changePostCode' | 'changeFullName' | 'changeEmail' | 'changePhone' | 'changeShipping' | 'updateUserInfo' |\n 'changeCardNumber' | 'changeCardholder' | 'changeExpiryDate' | 'changeCvvCode' | 'changeBillingCountry' |\n 'changeBillingZip' | 'changeSaveInfo' | 'changeSaveCredentials' | 'setFormErrors'\n);\nexport type FormEditDispatch = Dispatch;\n\nconst INITIAL_STATE: FormState = {\n streetLine1: '',\n streetLine2: '',\n city: '',\n state: '',\n countryIso2: '',\n postCode: '',\n fullName: '',\n email: '',\n phone: '',\n shipping: '',\n cardNumber: '',\n cardholder: '',\n expiry: '',\n cvv: '',\n billingCountry: '',\n billingZip: '',\n saveInfo: true,\n saveCredentials: false,\n formErrors: {},\n};\n\nconst reducer: StateReducer = (state, action) => {\n switch (action.type) {\n case 'changeAddress1':\n return {\n ...state,\n streetLine1: action.payload,\n formErrors: {\n ...state.formErrors,\n streetLine1: undefined,\n },\n };\n case 'changeAddress2':\n return {\n ...state,\n streetLine2: action.payload,\n formErrors: {\n ...state.formErrors,\n streetLine2: undefined,\n },\n };\n case 'changeCity':\n return {\n ...state,\n city: action.payload,\n formErrors: {\n ...state.formErrors,\n city: undefined,\n },\n };\n case 'changeState':\n return {\n ...state,\n state: action.payload,\n formErrors: {\n ...state.formErrors,\n state: undefined,\n },\n };\n case 'changeCountry':\n return {\n ...state,\n countryIso2: action.payload,\n billingCountry: getBillingCountry(action.payload),\n formErrors: {\n ...state.formErrors,\n countryIso2: undefined,\n },\n };\n case 'changePostCode':\n return {\n ...state,\n postCode: action.payload,\n formErrors: {\n ...state.formErrors,\n postCode: undefined,\n },\n };\n case 'changeFullName':\n return {\n ...state,\n fullName: action.payload,\n formErrors: {\n ...state.formErrors,\n fullName: undefined,\n },\n };\n case 'changeEmail':\n return {\n ...state,\n email: action.payload,\n formErrors: {\n ...state.formErrors,\n email: undefined,\n },\n };\n case 'changePhone':\n return {\n ...state,\n phone: action.payload,\n formErrors: {\n ...state.formErrors,\n phone: undefined,\n },\n };\n case 'changeShipping':\n return { ...state, shipping: action.payload };\n case 'changeCardNumber':\n return {\n ...state,\n cardNumber: action.payload,\n formErrors: {\n ...state.formErrors,\n cardNumber: undefined,\n },\n };\n case 'changeCardholder':\n return {\n ...state,\n cardholder: action.payload,\n formErrors: {\n ...state.formErrors,\n cardholder: undefined,\n },\n };\n case 'changeExpiryDate':\n return {\n ...state,\n expiry: action.payload,\n formErrors: {\n ...state.formErrors,\n expiry: undefined,\n },\n };\n case 'changeCvvCode':\n return {\n ...state,\n cvv: action.payload,\n formErrors: {\n ...state.formErrors,\n cvv: undefined,\n },\n };\n case 'changeBillingCountry':\n return {\n ...state,\n billingCountry: action.payload,\n formErrors: {\n ...state.formErrors,\n billingCountry: undefined,\n },\n };\n case 'changeBillingZip':\n return {\n ...state,\n billingZip: action.payload,\n formErrors: {\n ...state.formErrors,\n billingZip: undefined,\n },\n };\n case 'changeSaveInfo':\n return { ...state, saveInfo: action.payload };\n case 'changeSaveCredentials':\n return { ...state, saveCredentials: action.payload };\n case 'updateUserInfo':\n if (action.payload.countryIso2) {\n return {\n ...state,\n ...action.payload,\n billingCountry: getBillingCountry(action.payload.countryIso2),\n };\n }\n return { ...state, ...action.payload };\n case 'setFormErrors':\n return {\n ...state,\n formErrors: {\n ...state.formErrors,\n ...action.payload,\n },\n };\n default:\n return state;\n }\n};\n\nfunction getBillingCountry(countryCode: string) {\n const country = countryList.find(({ id }) => id === countryCode);\n return country ? country.name : '';\n}\n\nexport default () => {\n return useReducer(reducer, INITIAL_STATE);\n};\n","import { RefObject } from 'react';\n\nimport { IS_TOUCH_ENV } from '../util/environment';\nimport { fastRaf } from '../util/schedulers';\nimport { useEffect } from '../lib/teact/teact';\n\nconst DEFAULT_DURATION = 400;\n\nexport default function useFocusAfterAnimation(\n ref: RefObject, animationDuration = DEFAULT_DURATION,\n) {\n useEffect(() => {\n if (IS_TOUCH_ENV) {\n return;\n }\n\n setTimeout(() => {\n fastRaf(() => {\n if (ref.current) {\n ref.current.focus();\n }\n });\n }, animationDuration);\n }, [ref, animationDuration]);\n}\n","import { ChangeEvent, RefObject } from 'react';\nimport React, { FC, memo } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\ntype OwnProps = {\n id?: string;\n value?: string;\n label?: string;\n error?: string;\n ref?: RefObject;\n hasArrow?: boolean;\n placeholder?: string;\n onChange?: (e: ChangeEvent) => void;\n children: any;\n};\n\nconst Select: FC = (props) => {\n const {\n id,\n value,\n label,\n hasArrow,\n error,\n ref,\n placeholder,\n onChange,\n children,\n } = props;\n const labelText = error || label;\n const fullClassName = buildClassName(\n 'input-group',\n value && 'touched',\n error && 'error',\n labelText && 'with-label',\n hasArrow && 'with-arrow',\n 'input-group',\n );\n\n return (\n
\n \n {children}\n \n {labelText && id && (\n \n )}\n
\n );\n};\n\nexport default memo(Select);\n","import React, {\n FC, useRef, useCallback, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer';\nimport useFocusAfterAnimation from '../../hooks/useFocusAfterAnimation';\nimport useLang from '../../hooks/useLang';\nimport { countryList } from '../../util/phoneNumber';\n\nimport InputText from '../ui/InputText';\nimport Select from '../ui/Select';\nimport Checkbox from '../ui/Checkbox';\n\nimport './ShippingInfo.scss';\n\nexport type OwnProps = {\n state: FormState;\n needEmail: boolean;\n needPhone: boolean;\n needName: boolean;\n needAddress: boolean;\n dispatch: FormEditDispatch;\n};\n\nconst ShippingInfo: FC = ({\n state,\n needEmail,\n needPhone,\n needName,\n needAddress,\n dispatch,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const phoneRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const selectCountryRef = useRef(null);\n\n useEffect(() => {\n if (selectCountryRef.current\n && selectCountryRef.current.value !== state.countryIso2) {\n selectCountryRef.current.value = state.countryIso2;\n }\n }, [state.countryIso2]);\n\n const lang = useLang();\n\n useFocusAfterAnimation(inputRef);\n\n const handleAddress1Change = useCallback((e) => {\n dispatch({ type: 'changeAddress1', payload: e.target.value });\n }, [dispatch]);\n\n const handleAddress2Change = useCallback((e) => {\n dispatch({ type: 'changeAddress2', payload: e.target.value });\n }, [dispatch]);\n\n const handleCityChange = useCallback((e) => {\n dispatch({ type: 'changeCity', payload: e.target.value });\n }, [dispatch]);\n\n const handleStateChange = useCallback((e) => {\n dispatch({ type: 'changeState', payload: e.target.value });\n }, [dispatch]);\n\n const handleCountryChange = useCallback((e) => {\n dispatch({ type: 'changeCountry', payload: e.target.value });\n }, [dispatch]);\n\n const handlePostCodeChange = useCallback((e) => {\n dispatch({ type: 'changePostCode', payload: e.target.value });\n }, [dispatch]);\n\n const handleFullNameChange = useCallback((e) => {\n dispatch({ type: 'changeFullName', payload: e.target.value });\n }, [dispatch]);\n\n const handleEmailChange = useCallback((e) => {\n dispatch({ type: 'changeEmail', payload: e.target.value });\n }, [dispatch]);\n\n const handlePhoneChange = useCallback((e) => {\n let { value } = e.target;\n value = `+${value.replace(/\\D/g, '')}`;\n if (phoneRef.current) {\n phoneRef.current.value = value;\n }\n dispatch({ type: 'changePhone', payload: value });\n }, [dispatch]);\n\n const handleSaveInfoChange = useCallback((e) => {\n dispatch({ type: 'changeSaveInfo', payload: e.target.value });\n }, [dispatch]);\n\n const { formErrors } = state;\n return (\n
\n
\n {needAddress ? (\n
\n
{lang('PaymentShippingAddress')}
\n \n \n \n \n \n {countryList.map(({ name, id }) => (\n \n {name}\n \n ))}\n \n\n \n
\n ) : undefined}\n { needName || needEmail || needPhone ? (\n
{lang('PaymentShippingReceiver')}
\n ) : undefined }\n { needName && (\n \n ) }\n { needEmail && (\n \n ) }\n { needPhone && (\n \n ) }\n \n \n
\n );\n};\n\nexport default memo(ShippingInfo);\n","import React, {\n FC, useCallback, memo, useMemo, useEffect,\n} from '../../lib/teact/teact';\n\nimport { ShippingOption } from '../../types';\n\nimport { formatCurrency } from '../../util/formatCurrency';\nimport { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer';\nimport useLang from '../../hooks/useLang';\n\nimport RadioGroup from '../ui/RadioGroup';\n\nimport './Shipping.scss';\n\nexport type OwnProps = {\n state: FormState;\n shippingOptions: ShippingOption[];\n currency?: string;\n dispatch: FormEditDispatch;\n};\n\nconst Shipping: FC = ({\n state,\n shippingOptions,\n currency,\n dispatch,\n}) => {\n const lang = useLang();\n\n useEffect(() => {\n if (!shippingOptions || state.shipping) {\n return;\n }\n dispatch({ type: 'changeShipping', payload: shippingOptions[0].id });\n }, [shippingOptions, state.shipping, dispatch]);\n\n const handleShippingSelect = useCallback((value) => {\n dispatch({ type: 'changeShipping', payload: value });\n }, [dispatch]);\n\n const options = useMemo(() => (shippingOptions.map(({ id: value, title: label, amount }) => ({\n label,\n subLabel: formatCurrency(amount, currency, lang.code),\n value,\n }))), [shippingOptions, currency, lang.code]);\n\n return (\n
\n
\n

Select shipping method

\n \n \n
\n );\n};\n\nexport default memo(Shipping);\n","import React, {\n FC, memo,\n} from '../../lib/teact/teact';\n\nimport { LangCode, Price } from '../../types';\n\nimport { formatCurrency } from '../../util/formatCurrency';\nimport useLang from '../../hooks/useLang';\n\nimport './Checkout.scss';\n\nexport type OwnProps = {\n invoiceContent?: {\n title?: string;\n text?: string;\n photoUrl?: string;\n };\n checkoutInfo?: {\n paymentMethod?: string;\n paymentProvider?: string;\n shippingAddress?: string;\n name?: string;\n phone?: string;\n shippingMethod?: string;\n };\n prices?: Price[];\n totalPrice?: number;\n shippingPrices?: Price[];\n currency?: string;\n};\n\nconst Checkout: FC = ({\n invoiceContent,\n prices,\n shippingPrices,\n checkoutInfo,\n currency,\n totalPrice,\n}) => {\n const lang = useLang();\n\n const { photoUrl, title, text } = invoiceContent || {};\n const {\n paymentMethod,\n paymentProvider,\n shippingAddress,\n name,\n phone,\n shippingMethod,\n } = (checkoutInfo || {});\n\n return (\n
\n
\n {photoUrl && \"\"}\n
\n
{title}
\n

{text}

\n
\n
\n
\n { prices && prices.map((item) => (\n renderPaymentItem(lang.code, item.label, item.amount, currency)\n )) }\n { shippingPrices && shippingPrices.map((item) => (\n renderPaymentItem(lang.code, item.label, item.amount, currency)\n )) }\n { totalPrice !== undefined && (\n renderPaymentItem(lang.code, lang('Checkout.TotalAmount'), totalPrice, currency, true)\n ) }\n
\n
\n {paymentMethod && renderCheckoutItem('icon-card', paymentMethod, 'Payment method')}\n {paymentProvider && renderCheckoutItem('stripe-provider', paymentProvider, 'Payment provider')}\n {shippingAddress && renderCheckoutItem('icon-location', shippingAddress, 'Shipping address')}\n {name && renderCheckoutItem('icon-user', name, 'Name')}\n {phone && renderCheckoutItem('icon-phone', phone, 'Phone number')}\n {shippingMethod && renderCheckoutItem('icon-truck', shippingMethod, 'Shipping method')}\n
\n
\n );\n};\n\nfunction renderPaymentItem(\n langCode: LangCode | undefined, title: string, value: number, currency?: string, main = false,\n) {\n return (\n
\n
\n { title }\n
\n
\n {formatCurrency(value, currency, langCode)}\n
\n
\n );\n}\n\nfunction renderCheckoutItem(icon: string, title: string, data: string) {\n return (\n
\n \n
\n
\n { title }\n
\n

\n { data }\n

\n
\n
\n );\n}\n\nexport default memo(Checkout);\n","import React, {\n FC, memo, useCallback, useRef,\n} from '../../lib/teact/teact';\n\nimport { formatCardExpiry } from '../middle/helpers/inputFormatters';\n\nimport InputText from '../ui/InputText';\n\nconst MAX_FIELD_LENGTH = 5;\n\nexport type OwnProps = {\n value: string;\n error?: string;\n onChange: (value: string) => void;\n};\n\nconst ExpiryInput : FC = ({ value, error, onChange }) => {\n // eslint-disable-next-line no-null/no-null\n const expiryInputRef = useRef(null);\n\n const handleKeyDown = useCallback((e) => {\n if (e.key === 'Backspace' && value.charAt(value.length - 1) === '/') {\n const newValue = value.slice(0, value.length - 1);\n if (expiryInputRef.current) {\n expiryInputRef.current.value = newValue;\n }\n }\n }, [value]);\n\n const handleChange = useCallback((e) => {\n onChange(formatCardExpiry(e.target.value));\n }, [onChange]);\n\n return (\n \n );\n};\n\nexport default memo(ExpiryInput);\n","export function formatCardExpiry(input: string) {\n input = input.replace(/[^\\d]/g, '').slice(0, 4);\n const parts = input.match(/.{1,2}/g);\n if (parts?.[0] && Number(parts[0]) > 12) {\n parts[0] = '12';\n }\n if (parts?.[0] && parts[0].length === 2 && !parts[1]) {\n parts[1] = '';\n }\n return parts ? parts.join('/') : '';\n}\n\nexport function formatCardNumber(input: string) {\n input = input.replace(/[^\\d]/g, '');\n const parts = input.match(/.{1,4}/g);\n return parts ? parts.join(' ') : '';\n}\n","import React, {\n FC, memo, useCallback, useState, useRef, useEffect,\n} from '../../lib/teact/teact';\n\nimport useFocusAfterAnimation from '../../hooks/useFocusAfterAnimation';\nimport { formatCardNumber } from '../middle/helpers/inputFormatters';\nimport { detectCardType, CardType } from '../common/helpers/detectCardType';\n\nimport InputText from '../ui/InputText';\n\nimport './CardInput.scss';\n\n// @ts-ignore\nimport mastercardIconPath from '../../assets/mastercard.svg';\n// @ts-ignore\nimport visaIconPath from '../../assets/visa.svg';\n\nconst CARD_NUMBER_MAX_LENGTH = 23;\n\nexport type OwnProps = {\n value: string;\n error?: string;\n onChange: (value: string) => void;\n};\n\nconst CardInput : FC = ({ value, error, onChange }) => {\n // eslint-disable-next-line no-null/no-null\n const cardNumberRef = useRef(null);\n\n useFocusAfterAnimation(cardNumberRef);\n\n const [cardType, setCardType] = useState(CardType.Default);\n useEffect(() => {\n const newCardType = detectCardType(value);\n setCardType(newCardType);\n // eslint-disable-next-line\n }, []);\n\n const handleChange = useCallback((e) => {\n const newValue = formatCardNumber(e.target.value);\n const newCardType = detectCardType(e.target.value);\n setCardType(newCardType);\n onChange(newValue);\n if (cardNumberRef.current) {\n cardNumberRef.current.value = newValue;\n }\n }, [onChange, cardNumberRef]);\n\n const cardIcon = getCardIcon(cardType);\n\n return (\n
\n {cardIcon}\n \n
\n );\n};\n\nexport default memo(CardInput);\n\nfunction getCardIcon(cardType: CardType) {\n switch (cardType) {\n case CardType.Mastercard:\n return \"\";\n case CardType.Visa:\n return \"\";\n default:\n return undefined;\n }\n}\n","import React, {\n FC, useCallback, memo, useRef, useEffect,\n} from '../../lib/teact/teact';\n\nimport { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer';\nimport useLang from '../../hooks/useLang';\nimport { countryList } from '../../util/phoneNumber';\n\nimport InputText from '../ui/InputText';\nimport Checkbox from '../ui/Checkbox';\nimport Select from '../ui/Select';\nimport ExpiryInput from './ExpiryInput';\nimport CardInput from './CardInput';\n\nimport './PaymentInfo.scss';\n\nexport type OwnProps = {\n state: FormState;\n canSaveCredentials: boolean;\n needCardholderName?: boolean;\n needCountry?: boolean;\n needZip?: boolean;\n dispatch: FormEditDispatch;\n};\n\nconst PaymentInfo: FC = ({\n state,\n canSaveCredentials,\n needCardholderName,\n needCountry,\n needZip,\n dispatch,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const selectCountryRef = useRef(null);\n\n useEffect(() => {\n if (selectCountryRef.current\n && selectCountryRef.current.value !== state.billingCountry) {\n selectCountryRef.current.value = state.billingCountry;\n }\n }, [state.billingCountry]);\n\n const handleCardNumberChange = useCallback((value) => {\n dispatch({ type: 'changeCardNumber', payload: value });\n }, [dispatch]);\n\n const handleCardholderChange = useCallback((e) => {\n dispatch({ type: 'changeCardholder', payload: e.target.value.toUpperCase() });\n }, [dispatch]);\n\n const handleExpiryChange = useCallback((value) => {\n dispatch({ type: 'changeExpiryDate', payload: value });\n }, [dispatch]);\n\n const handleCvvChange = useCallback((e) => {\n dispatch({ type: 'changeCvvCode', payload: e.target.value });\n }, [dispatch]);\n\n const handleCountryChange = useCallback((e) => {\n dispatch({ type: 'changeBillingCountry', payload: e.target.value });\n }, [dispatch]);\n\n const handleBillingPostCodeChange = useCallback((e) => {\n dispatch({ type: 'changeBillingZip', payload: e.target.value });\n }, [dispatch]);\n\n const handleChangeSaveCredentials = useCallback((e) => {\n dispatch({ type: 'changeSaveCredentials', payload: e.target.value });\n }, [dispatch]);\n\n const lang = useLang();\n\n const { formErrors = {} } = state;\n\n return (\n
\n
\n
{lang('PaymentCardTitle')}
\n \n { needCardholderName && (\n \n )}\n
\n \n \n
\n { needCountry || needZip ? (\n
{lang('PaymentBillingAddress')}
\n ) : undefined }\n { needCountry && (\n \n {\n countryList.map(({ name }) => (\n \n {name}\n \n ))\n }\n \n ) }\n { needZip && (\n \n )}\n { canSaveCredentials && (\n \n ) }\n \n
\n );\n};\n\nexport default memo(PaymentInfo);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { PaymentStep, ShippingOption, Price } from '../../types';\n\nimport { pick } from '../../util/iteratees';\nimport { formatCurrency } from '../../util/formatCurrency';\nimport { detectCardTypeText } from '../common/helpers/detectCardType';\nimport usePaymentReducer, { FormState } from '../../hooks/reducers/usePaymentReducer';\nimport useLang from '../../hooks/useLang';\n\nimport ShippingInfo from './ShippingInfo';\nimport Shipping from './Shipping';\nimport Checkout from './Checkout';\nimport PaymentInfo from './PaymentInfo';\nimport Button from '../ui/Button';\nimport Modal from '../ui/Modal';\nimport Transition from '../ui/Transition';\nimport Spinner from '../ui/Spinner';\n\nimport './PaymentModal.scss';\n\nconst DEFAULT_PROVIDER = 'stripe';\n\nexport type OwnProps = {\n isOpen: boolean;\n onClose: () => void;\n};\n\ntype StateProps = {\n nameRequested?: boolean;\n shippingAddressRequested?: boolean;\n phoneRequested?: boolean;\n emailRequested?: boolean;\n flexible?: boolean;\n phoneToProvider?: boolean;\n emailToProvider?: boolean;\n currency?: string;\n prices?: Price[];\n isProviderError: boolean;\n needCardholderName?: boolean;\n needCountry?: boolean;\n needZip?: boolean;\n};\n\ntype GlobalStateProps = Pick;\n\ntype DispatchProps = Pick;\n\nconst Invoice: FC = ({\n isOpen,\n onClose,\n step,\n shippingOptions,\n savedInfo,\n canSaveCredentials,\n nameRequested,\n shippingAddressRequested,\n phoneRequested,\n emailRequested,\n phoneToProvider,\n emailToProvider,\n currency,\n passwordMissing,\n isProviderError,\n invoiceContent,\n nativeProvider,\n prices,\n needCardholderName,\n needCountry,\n needZip,\n error,\n validateRequestedInfo,\n sendPaymentForm,\n setPaymentStep,\n sendCredentialsInfo,\n clearPaymentError,\n}) => {\n const [paymentState, paymentDispatch] = usePaymentReducer();\n const [isLoading, setIsLoading] = useState(false);\n const lang = useLang();\n\n useEffect(() => {\n if (step || error) {\n setIsLoading(false);\n }\n }, [step, error]);\n\n useEffect(() => {\n if (error?.field) {\n paymentDispatch({\n type: 'setFormErrors',\n payload: {\n [error.field]: error.message,\n },\n });\n }\n }, [error, paymentDispatch]);\n\n useEffect(() => {\n if (savedInfo) {\n const {\n name: fullName, phone, email, shippingAddress,\n } = savedInfo;\n paymentDispatch({\n type: 'updateUserInfo',\n payload: {\n fullName,\n phone: phone && phone.charAt(0) !== '+'\n ? `+${phone}`\n : phone,\n email,\n ...(shippingAddress || {}),\n },\n });\n }\n }, [savedInfo, paymentDispatch]);\n\n const handleErrorModalClose = useCallback(() => {\n clearPaymentError();\n }, [clearPaymentError]);\n\n const totalPrice = useMemo(() => {\n if (step !== PaymentStep.Checkout) {\n return 0;\n }\n\n return getTotalPrice(prices, shippingOptions, paymentState.shipping);\n }, [step, paymentState.shipping, prices, shippingOptions]);\n\n const checkoutInfo = useMemo(() => {\n if (step !== PaymentStep.Checkout) {\n return undefined;\n }\n return getCheckoutInfo(paymentState, shippingOptions, nativeProvider || '');\n }, [step, paymentState, shippingOptions, nativeProvider]);\n\n function renderError() {\n if (!error) {\n return undefined;\n }\n return (\n \n

{error.description || 'Error'}

\n

{error.description || 'Error'}

\n \n {lang('OK')}\n \n
\n );\n }\n\n function renderModalContent(currentStep: PaymentStep) {\n switch (currentStep) {\n case PaymentStep.ShippingInfo:\n return (\n \n );\n case PaymentStep.Shipping:\n return (\n \n );\n case PaymentStep.PaymentInfo:\n return (\n \n );\n case PaymentStep.Checkout:\n return (\n \n );\n default:\n return undefined;\n }\n }\n\n const validateRequest = useCallback(() => {\n const { saveInfo } = paymentState;\n const requestInfo = getRequestInfo(paymentState);\n validateRequestedInfo({ requestInfo, saveInfo });\n }, [validateRequestedInfo, paymentState]);\n\n const sendCredentials = useCallback(() => {\n const credentials = getCredentials(paymentState);\n sendCredentialsInfo({\n credentials,\n });\n }, [sendCredentialsInfo, paymentState]);\n\n const sendForm = useCallback(() => {\n sendPaymentForm({\n shippingOptionId: paymentState.shipping,\n saveCredentials: paymentState.saveCredentials,\n });\n }, [sendPaymentForm, paymentState]);\n\n const setStep = useCallback((nextStep) => {\n setPaymentStep({ step: nextStep });\n }, [setPaymentStep]);\n\n const handleButtonClick = useCallback(() => {\n setIsLoading(true);\n switch (step) {\n case PaymentStep.ShippingInfo:\n return validateRequest();\n case PaymentStep.Shipping:\n return setStep(PaymentStep.PaymentInfo);\n case PaymentStep.PaymentInfo:\n return sendCredentials();\n case PaymentStep.Checkout:\n return sendForm();\n default:\n return () => {};\n }\n }, [step, validateRequest, setStep, sendCredentials, sendForm]);\n\n const modalHeader = useMemo(() => {\n switch (step) {\n case PaymentStep.ShippingInfo:\n return lang('PaymentShippingInfo');\n case PaymentStep.Shipping:\n return lang('PaymentShippingMethod');\n case PaymentStep.PaymentInfo:\n return lang('PaymentCardInfo');\n case PaymentStep.Checkout:\n return lang('PaymentCheckout');\n default:\n return '';\n }\n }, [step, lang]);\n\n const buttonText = useMemo(() => {\n switch (step) {\n case PaymentStep.Checkout:\n return lang('Checkout.PayPrice', formatCurrency(totalPrice, currency, lang.code));\n default:\n return lang('Next');\n }\n }, [step, lang, currency, totalPrice]);\n\n if (isProviderError) {\n return (\n \n

\n Sorry, Telegram WebZ doesn't support payments with this provider yet.
\n Please use one of our mobile apps to do this.\n

\n \n {lang('OK')}\n \n \n );\n }\n\n return (\n \n
\n \n \n \n

{modalHeader}

\n
\n {step !== undefined ? (\n \n {() => (\n
\n {renderModalContent(step)}\n
\n )}\n
\n ) : (\n
\n \n
\n )}\n
\n \n {buttonText}\n \n
\n {error && !error.field && renderError()}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps & GlobalStateProps => {\n const {\n step,\n shippingOptions,\n savedInfo,\n canSaveCredentials,\n invoice,\n invoiceContent,\n nativeProvider,\n nativeParams,\n passwordMissing,\n error,\n } = global.payment;\n\n const isProviderError = Boolean(invoice && (!nativeProvider || nativeProvider !== DEFAULT_PROVIDER));\n const { needCardholderName, needCountry, needZip } = (nativeParams || {});\n const {\n nameRequested,\n phoneRequested,\n emailRequested,\n shippingAddressRequested,\n flexible,\n phoneToProvider,\n emailToProvider,\n currency,\n prices,\n } = (invoice || {});\n\n return {\n step,\n shippingOptions,\n savedInfo,\n canSaveCredentials,\n nativeProvider,\n passwordMissing,\n nameRequested,\n shippingAddressRequested,\n phoneRequested,\n emailRequested,\n flexible,\n phoneToProvider,\n emailToProvider,\n currency,\n prices,\n isProviderError,\n invoiceContent,\n needCardholderName,\n needCountry,\n needZip,\n error,\n };\n },\n (setGlobal, actions): DispatchProps => {\n return pick(actions, [\n 'validateRequestedInfo',\n 'sendPaymentForm',\n 'setPaymentStep',\n 'sendCredentialsInfo',\n 'clearPaymentError',\n ]);\n },\n)(Invoice));\n\nfunction findShippingOption(shippingOptions: ShippingOption[], optionId: string) {\n return shippingOptions.find(({ id }) => id === optionId);\n}\n\nfunction getShippingPrices(shippingOptions: ShippingOption[], shippingOption: string) {\n const option = findShippingOption(shippingOptions, shippingOption);\n return option?.prices;\n}\n\nfunction getTotalPrice(prices: Price[] = [], shippingOptions: ShippingOption[] | undefined, shippingOption: string) {\n const shippingPrices = shippingOptions\n ? getShippingPrices(shippingOptions, shippingOption)\n : [];\n let total = 0;\n const totalPrices = prices.concat(shippingPrices || []);\n total = totalPrices.reduce((acc, cur) => {\n return acc + cur.amount;\n }, total);\n return total;\n}\n\nfunction getCheckoutInfo(state: FormState, shippingOptions: ShippingOption[] | undefined, paymentProvider: string) {\n const cardTypeText = detectCardTypeText(state.cardNumber);\n const paymentMethod = `${cardTypeText} *${state.cardNumber.slice(-4)}`;\n const shippingAddress = state.streetLine1\n ? `${state.streetLine1}, ${state.city}, ${state.countryIso2}`\n : undefined;\n const { phone, fullName: name } = state;\n const shippingOption = shippingOptions ? findShippingOption(shippingOptions, state.shipping) : undefined;\n const shippingMethod = shippingOption?.title;\n return {\n paymentMethod,\n paymentProvider,\n shippingAddress,\n name,\n phone,\n shippingMethod,\n };\n}\n\nfunction getRequestInfo(paymentState: FormState) {\n const {\n streetLine1,\n streetLine2,\n city,\n state,\n countryIso2,\n postCode,\n fullName: name,\n phone,\n email,\n } = paymentState;\n\n const shippingAddress = {\n streetLine1,\n streetLine2,\n city,\n state,\n countryIso2,\n postCode,\n };\n\n return {\n name,\n phone,\n email,\n shippingAddress,\n };\n}\n\nfunction getCredentials(paymentState: FormState) {\n const {\n cardNumber, cardholder, expiry, cvv, billingCountry, billingZip,\n } = paymentState;\n const [expiryMonth, expiryYear] = expiry.split('/');\n const data = {\n cardNumber,\n cardholder,\n expiryMonth,\n expiryYear,\n cvv,\n country: billingCountry,\n zip: billingZip,\n };\n\n return {\n data,\n };\n}\n","import React, {\n FC, memo, useMemo,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { Price } from '../../types';\nimport { ApiShippingAddress } from '../../api/types';\n\nimport useLang from '../../hooks/useLang';\n\nimport Checkout from './Checkout';\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nimport './PaymentModal.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onClose: () => void;\n};\n\ntype StateProps = {\n prices?: Price[];\n shippingPrices: any;\n totalAmount?: number;\n currency?: string;\n info?: {\n shippingAddress?: ApiShippingAddress;\n phone?: string;\n name?: string;\n };\n photoUrl?: string;\n text?: string;\n title?: string;\n credentialsTitle?: string;\n shippingMethod?: string;\n};\n\nconst ReceiptModal: FC = ({\n isOpen,\n onClose,\n prices,\n shippingPrices,\n totalAmount,\n currency,\n info,\n photoUrl,\n text,\n title,\n credentialsTitle,\n shippingMethod,\n}) => {\n const lang = useLang();\n const checkoutInfo = useMemo(() => {\n return getCheckoutInfo(credentialsTitle, info, shippingMethod);\n }, [info, shippingMethod, credentialsTitle]);\n\n return (\n \n
\n
\n \n \n \n

{lang('PaymentReceipt')}

\n
\n
\n \n
\n
\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { receipt } = global.payment;\n const {\n currency,\n prices,\n info,\n totalAmount,\n credentialsTitle,\n shippingPrices,\n shippingMethod,\n photoUrl,\n text,\n title,\n } = (receipt || {});\n\n return {\n currency,\n prices,\n info,\n totalAmount,\n credentialsTitle,\n shippingPrices,\n shippingMethod,\n photoUrl,\n text,\n title,\n };\n },\n)(ReceiptModal));\n\nfunction getCheckoutInfo(paymentMethod?: string,\n info?:\n { phone?: string;\n name?: string;\n shippingAddress?: ApiShippingAddress;\n },\n shippingMethod?: string) {\n if (!info) {\n return { paymentMethod };\n }\n const { shippingAddress } = info;\n const fullAddress = shippingAddress?.streetLine1\n ? `${shippingAddress.streetLine1}, ${shippingAddress.city}, ${shippingAddress.countryIso2}`\n : undefined;\n const { phone, name } = info;\n return {\n paymentMethod,\n paymentProvider: 'Stripe',\n shippingAddress: fullAddress,\n name,\n phone,\n shippingMethod,\n };\n}\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { MIN_PASSWORD_LENGTH } from '../../config';\nimport { IS_TOUCH_ENV, IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\n\ntype OwnProps = {\n submitLabel?: string;\n error?: string;\n hint?: string;\n placeholder?: string;\n isLoading?: boolean;\n isPasswordVisible?: boolean;\n clearError: NoneToVoidFunction;\n onChangePasswordVisibility: (state: boolean) => void;\n onInputChange?: (password: string) => void;\n onSubmit: (password: string) => void;\n};\n\nconst FOCUS_DELAY_TIMEOUT_MS = IS_SINGLE_COLUMN_LAYOUT ? 550 : 400;\n\nconst PasswordForm: FC = ({\n isLoading = false,\n isPasswordVisible,\n error,\n hint,\n placeholder = 'Password',\n submitLabel = 'Next',\n clearError,\n onChangePasswordVisibility,\n onInputChange,\n onSubmit,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const lang = useLang();\n\n const [password, setPassword] = useState('');\n const [canSubmit, setCanSubmit] = useState(false);\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n setTimeout(() => {\n inputRef.current!.focus();\n }, FOCUS_DELAY_TIMEOUT_MS);\n }\n }, []);\n\n useEffect(() => {\n if (error) {\n requestAnimationFrame(() => {\n inputRef.current!.focus();\n inputRef.current!.select();\n });\n }\n }, [error]);\n\n function onPasswordChange(e: ChangeEvent) {\n if (error) {\n clearError();\n }\n\n const { target } = e;\n setPassword(target.value);\n setCanSubmit(target.value.length >= MIN_PASSWORD_LENGTH);\n if (onInputChange) {\n onInputChange(target.value);\n }\n }\n\n function togglePasswordVisibility() {\n onChangePasswordVisibility(!isPasswordVisible);\n }\n\n function handleSubmit(event: React.FormEvent) {\n event.preventDefault();\n\n if (isLoading) {\n return;\n }\n\n if (canSubmit) {\n onSubmit(password);\n }\n }\n\n return (\n
\n \n \n \n \n \n \n \n {canSubmit && (\n \n )}\n \n );\n};\n\nexport default memo(PasswordForm);\n","import React, {\n FC, useState, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\n\nimport { STICKER_SIZE_AUTH, STICKER_SIZE_AUTH_MOBILE, STICKER_SIZE_TWO_FA } from '../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport getAnimationData from './helpers/animatedAssets';\n\nimport AnimatedSticker from './AnimatedSticker';\n\nimport './PasswordMonkey.scss';\n\ntype OwnProps = {\n isPasswordVisible: boolean;\n isBig?: boolean;\n};\n\nconst PEEK_MONKEY_SHOW_DELAY = 2000;\nconst SEGMENT_COVER_EYES: [number, number] = [0, 50];\nconst SEGMENT_UNCOVER_EYE: [number, number] = [0, 20];\nconst SEGMENT_COVER_EYE: [number, number] = [20, 0];\nconst STICKER_SIZE = IS_SINGLE_COLUMN_LAYOUT ? STICKER_SIZE_AUTH_MOBILE : STICKER_SIZE_AUTH;\n\nconst PasswordMonkey: FC = ({ isPasswordVisible, isBig }) => {\n const [closeMonkeyData, setCloseMonkeyData] = useState>();\n const [peekMonkeyData, setPeekMonkeyData] = useState>();\n const [isFirstMonkeyLoaded, setIsFirstMonkeyLoaded] = useState(false);\n const [isPeekShown, setIsPeekShown] = useState(false);\n\n useEffect(() => {\n if (!closeMonkeyData) {\n getAnimationData('MonkeyClose').then(setCloseMonkeyData);\n } else {\n setTimeout(() => setIsPeekShown(true), PEEK_MONKEY_SHOW_DELAY);\n }\n }, [closeMonkeyData]);\n\n useEffect(() => {\n if (!peekMonkeyData) {\n getAnimationData('MonkeyPeek').then(setPeekMonkeyData);\n }\n }, [peekMonkeyData]);\n\n const handleFirstMonkeyLoad = useCallback(() => setIsFirstMonkeyLoaded(true), []);\n\n return (\n
\n {!isFirstMonkeyLoaded && (\n
\n )}\n {closeMonkeyData && (\n \n )}\n {peekMonkeyData && (\n \n )}\n
\n );\n};\n\nexport default memo(PasswordMonkey);\n","import { ApiMediaFormat } from '../../../api/types';\n\nimport * as mediaLoader from '../../../util/mediaLoader';\n\n// @ts-ignore\nimport MonkeyIdle from '../../../assets/TwoFactorSetupMonkeyIdle.tgs';\n// @ts-ignore\nimport MonkeyTracking from '../../../assets/TwoFactorSetupMonkeyTracking.tgs';\n// @ts-ignore\nimport MonkeyClose from '../../../assets/TwoFactorSetupMonkeyClose.tgs';\n// @ts-ignore\nimport MonkeyPeek from '../../../assets/TwoFactorSetupMonkeyPeek.tgs';\n// @ts-ignore\nimport FoldersAll from '../../../assets/FoldersAll.tgs';\n// @ts-ignore\nimport FoldersNew from '../../../assets/FoldersNew.tgs';\n// @ts-ignore\nimport DiscussionGroups from '../../../assets/DiscussionGroupsDucks.tgs';\n\nexport const ANIMATED_STICKERS_PATHS = {\n MonkeyIdle,\n MonkeyTracking,\n MonkeyClose,\n MonkeyPeek,\n FoldersAll,\n FoldersNew,\n DiscussionGroups,\n};\n\nexport default function getAnimationData(name: keyof typeof ANIMATED_STICKERS_PATHS) {\n const path = ANIMATED_STICKERS_PATHS[name].replace(window.location.origin, '');\n\n return mediaLoader.fetch(`file${path}`, ApiMediaFormat.Lottie);\n}\n","import React, {\n FC, useEffect, useState, memo,\n} from '../../lib/teact/teact';\n\nimport { DEBUG } from '../../config';\nimport { blobToFile, blobToDataUri } from '../../util/files';\nimport useLang from '../../hooks/useLang';\n\nimport Button from './Button';\nimport Modal from './Modal';\nimport Loading from './Loading';\n\nimport './CropModal.scss';\n\n// Change to 'base64' to get base64-encoded string\nconst cropperResultOptions: Croppie.ResultOptions & { type: 'blob' } = {\n type: 'blob',\n quality: 1,\n format: 'jpeg',\n circle: false,\n};\n\ntype ICroppie = typeof import('croppie');\nlet Croppie: ICroppie;\nlet croppiePromise: Promise<{ default: ICroppie }>;\n\nasync function ensureCroppie() {\n if (!croppiePromise) {\n croppiePromise = import('../../lib/croppie') as unknown as Promise<{ default: ICroppie }>;\n Croppie = (await croppiePromise).default;\n }\n\n return croppiePromise;\n}\n\nlet cropper: Croppie;\n\nasync function initCropper(imgFile: File) {\n try {\n const cropContainer = document.getElementById('avatar-crop');\n if (!cropContainer) {\n return;\n }\n\n const { offsetWidth, offsetHeight } = cropContainer;\n\n cropper = new Croppie(cropContainer, {\n enableZoom: true,\n boundary: {\n width: offsetWidth,\n height: offsetHeight,\n },\n viewport: {\n width: offsetWidth - 16,\n height: offsetHeight - 16,\n type: 'circle',\n },\n });\n\n const dataUri = await blobToDataUri(imgFile);\n await cropper.bind({ url: dataUri });\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n }\n}\n\ntype OwnProps = {\n file?: File;\n onChange: (file: File) => void;\n onClose: () => void;\n};\n\nconst CropModal: FC = ({ file, onChange, onClose }: OwnProps) => {\n const [isCroppieReady, setIsCroppieReady] = useState(false);\n\n useEffect(() => {\n if (!file) {\n return;\n }\n\n if (!isCroppieReady) {\n ensureCroppie().then(() => setIsCroppieReady(true));\n\n return;\n }\n\n initCropper(file);\n }, [file, isCroppieReady]);\n\n const lang = useLang();\n\n async function handleCropClick() {\n if (!cropper) {\n return;\n }\n\n const result: Blob | string = await cropper.result(cropperResultOptions);\n const croppedImg = typeof result === 'string' ? result : blobToFile(result, 'avatar.jpg');\n\n onChange(croppedImg);\n }\n\n return (\n \n {isCroppieReady ? (\n
\n ) : (\n \n )}\n \n \n \n \n );\n};\n\nexport default memo(CropModal);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useState, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport CropModal from './CropModal';\n\nimport './AvatarEditable.scss';\n\ninterface OwnProps {\n title?: string;\n disabled?: boolean;\n currentAvatarBlobUrl?: string;\n onChange: (file: File) => void;\n}\n\nconst AvatarEditable: FC = ({\n title = 'Change your profile picture',\n disabled,\n currentAvatarBlobUrl,\n onChange,\n}) => {\n const [selectedFile, setSelectedFile] = useState();\n const [croppedBlobUrl, setCroppedBlobUrl] = useState(currentAvatarBlobUrl);\n\n useEffect(() => {\n setCroppedBlobUrl(currentAvatarBlobUrl);\n }, [currentAvatarBlobUrl]);\n\n function handleSelectFile(event: ChangeEvent) {\n const target = event.target as HTMLInputElement;\n\n if (!target || !target.files || !target.files[0]) {\n return;\n }\n\n setSelectedFile(target.files[0]);\n target.value = '';\n }\n\n function handleAvatarCrop(croppedImg: File) {\n setSelectedFile(undefined);\n onChange(croppedImg);\n\n if (croppedBlobUrl) {\n URL.revokeObjectURL(croppedBlobUrl);\n }\n setCroppedBlobUrl(URL.createObjectURL(croppedImg));\n }\n\n function handleModalClose() {\n setSelectedFile(undefined);\n }\n\n const labelClassName = buildClassName(\n croppedBlobUrl && 'filled',\n disabled && 'disabled',\n );\n\n return (\n
\n \n \n \n {croppedBlobUrl && \"Avatar\"}\n \n \n
\n );\n};\n\nexport default memo(AvatarEditable);\n"],"names":["createGhost","source","origin","ghost","document","createElement","classList","add","img","Image","src","HTMLVideoElement","poster","appendChild","MediaViewerOrigin","profileInfo","querySelector","cloneNode","isMessageImageFullyVisible","container","imageEl","messageListElement","imgOffsetTop","offsetTop","closest","id","includes","parentElement","scrollTop","offsetHeight","applyStyles","element","styles","Object","assign","style","getNodes","message","containerSelector","mediaSelector","mediaEls","querySelectorAll","mediaEl","length","applyShape","firstChild","objectFit","withGlobal","global","chatId","messageId","isAvatar","sender","isChatPrivate","selectUser","selectChat","selectChatMessage","selectSender","setGlobal","actions","pick","closeMediaViewer","focusMessage","handleFocusMessage","useCallback","lang","useLang","isFromChat","senderTitle","getSenderTitle","className","onClick","Avatar","key","size","chat","user","dir","renderText","formatMediaDateTime","date","mediaData","isVideo","isZoomed","fileName","onCloseMediaViewer","onForward","onZoomToggle","isDownloadStarted","downloadProgress","handleDownloadClick","useMediaDownload","getMessageMediaHash","undefined","MenuButton","useMemo","onTrigger","isOpen","Button","round","color","ariaLabel","IS_SINGLE_COLUMN_LAYOUT","DropdownMenu","trigger","positionX","MenuItem","icon","Math","href","download","ProgressSpinner","progress","noCross","text","isHidden","isForVideo","isMultiline","setIsMultiline","useState","useEffect","footerContent","checkIsMultiline","height","clientHeight","REM","handleResize","throttle","window","addEventListener","removeEventListener","classNames","buildClassName","e","stopPropagation","prop","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","units","bytes","number","floor","log","toFixed","stopEvent","bufferedProgress","currentTime","duration","fileSize","isForceVisible","isForceMobileVersion","isPlayed","isFullscreenSupported","isFullscreen","onChangeFullscreen","onPlayPause","onSeek","isVisible","setVisibility","timeout","setTimeout","clearTimeout","body","remove","downloadedPercent","totalSize","percentagePlayed","percentageBuffered","min","max","step","type","onInput","value","renderSeekLine","ripple","formatMediaDuration","renderTime","formatFileSize","memo","url","isGif","posterData","posterSize","isMediaViewerOpen","noPlay","onClose","videoRef","useRef","setIsPlayed","IS_TOUCH_ENV","IS_IOS","setCurrentTime","isControlsVisible","setIsControlsVisible","setFullscreen","exitFullscreen","elRef","setIsFullscreen","Boolean","useLayoutEffect","listener","listenerEnter","listenerExit","video","current","PLATFORM_ENV","requestFullscreen","webkitRequestFullscreen","webkitEnterFullscreen","mozRequestFullScreen","mozCancelFullScreen","webkitCancelFullScreen","webkitExitFullscreen","useFullscreenStatus","isBuffered","bufferingHandlers","useBuffering","shouldRender","shouldRenderSpinner","transitionClassNames","spinnerClassNames","useShowTransition","shouldRenderPlayButton","playButtonClassNames","pause","safePlay","togglePlayState","play","useVideoCleanup","handleMouseOver","handleMouseOut","handleTimeUpdate","currentTarget","handleEnded","handleFullscreenChange","handleSeek","Number","target","toggleControls","togglePayingStateBySpace","preventDefault","wrapperStyle","width","videoStyle","onMouseOver","onMouseOut","ref","autoPlay","playsInline","loop","muted","onEnded","onDoubleClick","onTimeUpdate","join","square","isShown","onChangeZoom","prevIsShown","usePrevious","inputRef","zoomLevel","setZoomLevel","isSeeking","handleStartSeek","handleStopSeek","disabled","onChange","onMouseDown","onMouseUp","INITIAL_MATRIX","SCALE_VALUES","ZOOM_SAFE_AREA","children","noWrap","canPan","panDeltaX","panDeltaY","onPan","tunedZoomLevel","isDragging","setIsDragging","dragData","setDragData","dx","dy","x","y","matrixData","setMatrixData","panWrapperRef","panContainerRef","newZoomLevel","newPandx","newPandy","newMatrixData","areSortedArraysEqual","oldScale","wrapper","image","wrapperRect","getBoundingClientRect","imageRect","newImgWidth","newImgHeight","newImgX","newImgY","calculateSafeZoneOnZoom","transform","toString","newDragData","pageX","pageY","onMouseMove","deltaX","deltaY","getNewMatrixData","ANIMATION_DURATION","renderPhoto","blobUrl","imageSize","canDrag","alt","draggable","Spinner","threadId","avatarOwnerId","profilePhotoIndex","mediaViewer","animationLevel","settings","byKey","senderId","avatarOwner","chatMessages","collectionIds","selectScheduledMessage","selectScheduledMessages","selectChatMessages","selectOutlyingIds","selectListedIds","currentSearch","selectCurrentMediaSearch","foundIds","resultsByType","media","openMediaViewer","openForwardMenu","isFromSharedMedia","isFromSearch","photo","getMessagePhoto","getMessageVideo","webPagePhoto","getMessageWebPagePhoto","webPageVideo","getMessageWebPageVideo","isDocumentPhoto","isMessageDocumentPhoto","isDocumentVideo","isMessageDocumentVideo","isPhoto","isSingleSlide","messageIds","getChatMediaMessageIds","selectedMediaMessageIndex","indexOf","isFirst","isLast","animationKey","prevSenderId","slideAnimation","headerAnimation","isGhostAnimation","isFooterHidden","setIsFooterHidden","canPanZoomWrap","setCanPanZoomWrap","setIsZoomed","panDelta","setPanDelta","getMediaHash","isFull","photos","getChatAvatarHash","blobUrlPictogram","useMedia","ApiMediaFormat","previewMediaHash","blobUrlPreview","startsWith","fullMediaData","useMediaWithDownloadProgress","getMessageMediaFormat","localBlobUrl","bestImageData","thumbDataUri","useBlurSync","getMessageMediaThumbDataUri","videoSize","getMessageFileSize","getMessageFileName","dimensions","getMessageDocument","mediaSize","getPhotoFullDimensions","getVideoDimensions","AVATAR_FULL_DIMENSIONS","toggle","forceUpdate","useForceUpdate","mql","matchMedia","MEDIA_VIEWER_MEDIA_QUERY","addListener","removeListener","prevMessage","prevOrigin","prevAvatarOwner","prevBestImageData","dispatchHeavyAnimationEvent","ANIMATION_END_DELAY","textParts","renderMessageText","hasFooter","fromImage","windowWidth","windowSize","availableWidth","availableHeight","getMediaViewerAvailableDimensions","toWidth","toHeight","calculateDimensions","toLeft","toTop","topOffsetRem","matches","getTopOffset","top","fromTop","left","fromLeft","fromWidth","fromHeight","uncovered","realWidth","realHeight","srcWidth","srcHeight","uncover","fromTranslateX","fromTranslateY","fromScaleX","fromScaleY","requestAnimationFrame","clearShape","contains","removeChild","animateOpening","toImage","getElementById","targetTop","el","display","rect","windowHeight","isElementInViewport","shouldFadeOut","existingGhost","getElementsByClassName","transition","transformOrigin","opacity","animateClosing","timer","closeZoom","handleZoomToggle","handleZoomValue","level","canCloseZoom","close","handleFooterClick","handleForward","fromChatId","captureEscKeyListener","stopCurrentAudio","getMessageId","fromId","direction","index","selectPreviousMedia","selectNextMedia","handleKeyDown","shouldCloseOnVideo","captureEvents","excludedClosestSelector","onSwipe","SwipeDirection","handlePan","handleToggleFooterVisibility","renderSlide","isActive","calculateMediaViewerDimensions","renderSenderInfo","useHistoryBack","ShowTransition","isRtl","Transition","activeKey","name","chats","byId","chatsById","listIds","orderedPinnedIds","currentUserId","pinnedIds","active","activeListIds","archivedListIds","archived","setForwardChatId","exitForwardMode","loadMoreChats","filter","setFilter","focus","blur","chatIds","priorityIds","unique","sortChatIds","getCanPostInChat","MAIN_THREAD_ID","searchWords","getChatTitle","viewportIds","getMore","useInfiniteScroll","handleFilterChange","containerRef","useKeyboardListNavigation","modalHeader","InputText","onKeyDown","placeholder","Modal","header","InfiniteScroll","items","onLoadMore","noScrollRestore","map","ListItem","PrivateChatInfo","status","userId","GroupChatInfo","Loading","getErrorHeader","error","isSlowMode","hasErrorKey","dialogs","dismissDialog","acceptInviteConfirmation","dialog","invite","hash","title","participantsCount","isChannel","participantsText","joinText","isText","renderInvite","getReadableErrorText","notifications","dismissNotification","localId","Notification","onDismiss","toggleSafeLinkModal","handleOpen","open","handleDismiss","renderingUrl","useCurrentOrPrev","ConfirmDialog","confirmLabel","confirmHandler","WEEKDAY_LETTERS","isDisabledDay","year","month","day","minDate","maxDate","selectedDay","Date","fixedMinDate","getFullYear","getMonth","getDate","fixedMaxDate","formatInputTime","String","padStart","selectedAt","maxAt","isFutureMode","isPastMode","withTimePicker","submitButtonLabel","secondButtonLabel","onSubmit","onSecondButtonClick","now","defaultSelectedDate","prevIsOpen","isTimeInputFocused","markTimeInputAsFocused","unmarkTimeInputAsFocused","useFlag","selectedDate","setSelectedDate","selectedHours","setSelectedHours","getHours","selectedMinutes","setSelectedMinutes","getMinutes","currentYear","currentMonth","currentDate","getTime","shouldDisableNextMonth","shouldDisablePrevMonth","calendarGrid","grid","setFullYear","setMonth","setDate","monthStartDay","getDay","i","push","gridDate","buildCalendarGrid","handleChangeHours","replace","hours","setHours","hoursStr","handleChangeMinutes","minutes","setMinutes","minutesStr","d","dateCopy","role","tabIndex","handleDateSelect","inputMode","onFocus","onBlur","formatDateToString","code","formatTime","formatSubmitLabel","historyCalendarSelectedAt","searchMessagesByDate","closeHistoryCalendar","handleJumpToDate","timestamp","valueOf","isSchedule","selectCurrentMessageList","canDeleteForAll","selectAllowedMessageActions","contactName","getUserFirstOrLastName","getPrivateChatUserId","willDeleteForCurrentUserOnly","isChatBasicGroup","willDeleteForAll","isChatSuperGroup","album","deleteMessages","deleteScheduledMessages","handleDeleteMessageForAll","messages","shouldDeleteForAll","handleDeleteMessageForSelf","onEnter","isPrivateChat","isChatWithSelf","selectIsChatWithSelf","isChatChannel","isGroup","isSuperGroup","canPinForAll","pinMessage","handlePinMessageForAll","isUnpin","handlePinMessage","isOneSide","isSilent","pinnedMessagesCount","onUnpin","selectedMessageIds","selectedMessages","selectCanDeleteSelectedMessages","selectCurrentChat","exitMessageSelectMode","reportMessages","selectedReason","setSelectedReason","description","setDescription","handleReport","reason","handleSelectReason","handleDescriptionChange","REPORT_OPTIONS","label","RadioGroup","options","selected","messageListType","canDelete","canReport","selectCanReportSelectedMessages","selectedMessagesCount","selectSelectedMessagesCount","canDeleteMessages","canReportMessages","canPost","openForwardMenuForSelectedMessages","isDeleteModalOpen","openDeleteModal","closeDeleteModal","isReportModalOpen","openReportModal","closeReportModal","captureKeyboardListeners","onBackspace","onDelete","onEsc","prevSelectedMessagesCount","renderingSelectedMessagesCount","formattedMessagesCount","destructive","onSelect","buttonRef","activeElement","privateChatUserId","privateChatUser","isPinned","selectIsChatPinned","isMuted","selectIsChatMuted","selectNotifySettings","selectNotifyExceptions","withUsername","contextActions","useChatContextActions","handleDelete","handleClick","useSelectWithEnter","avatarSize","DeleteChatModal","runThrottled","cb","userIds","topUserIds","topPeers","usersById","users","recentlyFoundChatIds","globalSearch","onReset","loadTopUsers","loadContactList","openChat","addRecentlyFoundChatId","clearRecentlyFoundChats","topUsersRef","useHorizontalScroll","shouldReplaceHistory","lastSyncTime","searchQuery","mediaThumbnail","mediaBlobUrl","isRoundVideo","getMessageRoundVideo","withOnlineStatus","isSavedMessages","isSelf","isVerified","VerifiedIcon","Link","formatPastTimeShort","getMessageSummaryText","highlight","renderMessageSummary","searchDate","suggestions","match","suggestion","latestYear","getSuggestionsFromDate","localContactIds","contactList","fetchingStatus","globalResults","localResults","globalChatIds","globalUserIds","localChatIds","localUserIds","byChatId","globalMessagesByChatId","dateSearchQuery","onSearchDateSelect","searchMessagesGlobal","setGlobalSearchChatId","shouldShowMoreLocal","setShouldShowMoreLocal","shouldShowMoreGlobal","setShouldShowMoreGlobal","handleLoadMore","LoadMoreDirection","query","handleChatClick","handlePickerItemClick","MEMO_EMPTY_ARRAY","foundContactIds","fullName","getUserFullName","username","foundMessages","split","sort","a","b","handleClickShowMoreLocal","handleClickShowMoreGlobal","nothingFound","noScrollRestoreOnTop","noFastList","NothingFound","PickerSelectedItem","chatOrUserId","clickArg","createMapStateToProps","props","currentType","isVoice","theme","selectTheme","isLoading","searchChatId","CURRENT_TYPE","handleSelectMedia","canRenderContents","useAsyncRendering","SLIDE_TRANSITION_DURATION","isMediaGrid","isMessageList","itemSelector","Media","idPrefix","getSenderName","senderName","isChatGroup","handleMessageFocus","shouldDrawDateDivider","toYearMonth","formatMonthAndYear","WebLink","onMessageClick","Document","withDate","datetime","smaller","onDateClick","openAudioPlayer","handlePlayAudio","Audio","onPlay","TABS","GlobalSearchContent","CHAT_TABS","slice","TRANSITION_RENDER_COUNT","keys","currentContent","setGlobalSearchContent","setGlobalSearchDate","activeTab","setActiveTab","parseDateString","handleSwitchTab","tab","content","handleSearchDateSelect","TabList","tabs","onSwitchTab","renderCount","INITIAL_STATE","currentPassword","password","hint","email","twoFaReducer","state","action","payload","currentScreen","editedFolderId","onSaveFilter","signOut","deleteChatFolder","onScreenSelect","isSignOutDialogOpen","setIsSignOutDialogOpen","isDeleteFolderDialogOpen","setIsDeleteFolderDialogOpen","openSignOutConfirmation","closeSignOutConfirmation","openDeleteFolderConfirmation","closeDeleteFolderConfirmation","handleSignOutMessage","handleDeleteFolderMessage","SettingsMenuButton","SettingsScreens","renderHeaderContent","confirmIsDestructive","currentUser","loadProfilePhotos","profileId","ProfileInfo","forceShowSelf","ChatExtra","LINK_PREFIX","LINK_PREFIX_REGEX","USERNAME_REGEX","runDebouncedForCheckUsername","debounce","currentUsername","asLink","isUsernameAvailable","checkUsername","setUsername","langPrefix","usernameSuccess","usernameError","test","handleUsernameChange","newUsername","trim","isValid","isUsernameValid","success","readOnly","ERROR_FIRST_NAME_MISSING","ERROR_BIO_TOO_LONG","profileEdit","firstName","currentFirstName","lastName","currentLastName","fullInfo","bio","currentBio","currentAvatarHash","loadCurrentUser","updateProfile","isUsernameTouched","setIsUsernameTouched","isProfileFieldsTouched","setIsProfileFieldsTouched","setError","setPhoto","setFirstName","setLastName","setBio","currentAvatarBlobUrl","ProfileEditProgress","isUsernameError","isSaveButtonShown","handlePhotoChange","newPhoto","handleFirstNameChange","handleLastNameChange","handleBioChange","handleProfileSave","trimmedFirstName","trimmedLastName","trimmedBio","AvatarEditable","UsernameInput","FloatingActionButton","runThrottledForLoadRecommended","orderedIds","orderedFolderIds","foldersById","recommended","recommendedChatFolders","chatFolders","notifySettings","notifyExceptions","onCreateFolder","onEditFolder","loadRecommendedChatFolders","addChatFolder","showDialog","animationData","setAnimationData","isAnimationLoaded","setIsAnimationLoaded","handleAnimationLoad","getAnimationData","then","handleCreateFolder","data","userFolders","folder","subtitle","getFolderDescriptionText","handleCreateFolderFromRecommended","AnimatedSticker","STICKER_SIZE_FOLDER_SETTINGS","noLoop","onLoad","pill","fluid","narrow","multiline","count","itemName","itemPluralName","ERROR_NO_TITLE","ERROR_NO_CHATS","loadedActiveChatIds","loadedArchivedChatIds","dispatch","onAddIncludedChats","onAddExcludedChats","onBack","editChatFolder","isIncludedChatsListExpanded","setIsIncludedChatsListExpanded","isExcludedChatsListExpanded","setIsExcludedChatsListExpanded","selectedChatIds","includedChatIds","selectedChatTypes","includedChatTypes","selectChatFilters","excludedChatIds","excludedChatTypes","folderId","visibleIncludedChatIds","visibleExcludedChatIds","allLoadedChatsSet","Set","loadedIncludedChatIds","findIntersectionWithSet","loadedExcludedChatIds","listType","renderChats","mode","visibleChatIds","isExpanded","leftChatsCount","clickHandler","chatType","INCLUDED_CHAT_TYPES","typeKey","EXCLUDED_CHAT_TYPES","inactive","renderChatType","event","isTouched","folderUpdate","selectedIds","filterValue","onSelectedIdsChange","onSelectedChatTypesChange","onFilterChange","chatTypes","shouldMinimize","hasMaxChats","handleItemClick","newSelectedIds","splice","handleChatTypeClick","newSelectedChatTypes","selectedType","find","isMinimized","canClose","Checkbox","checked","isSelected","withChatType","archivedPinnedIds","chatFilter","activeChatArrays","prepareChatList","archivedChatArrays","pinnedChats","otherChats","displayedIds","newFilter","handleSelectedIdsChange","ids","includeFilters","excludeFilters","handleSelectedChatTypesChange","newFilters","forEach","shownScreen","handleReset","handleEditFolder","handleAddIncludedChats","handleAddExcludedChats","range","handleChange","trackWidth","possibleValuesLength","option","STICKER_SIZE_PICKER_HEADER","stickerSet","observeIntersection","isIntersecting","useIsIntersecting","mediaHash","lottieData","shouldRenderFullMedia","useTransitionForMedia","getFirstLetters","hasThumbnail","stickers","firstSticker","isAnimated","STICKER_SIZE_GENERAL_SETTINGS","StickerButton","sticker","ANIMATION_LEVEL_OPTIONS","stickerSetIds","added","setIds","stickerSetsById","setsById","messageTextSize","messageSendKeyCombo","shouldAutoDownloadMediaFromContacts","shouldAutoDownloadMediaInPrivateChats","shouldAutoDownloadMediaInGroups","shouldAutoDownloadMediaInChannels","shouldAutoPlayGifs","shouldAutoPlayVideos","shouldSuggestStickers","shouldLoopStickers","setSettingOption","loadStickerSets","loadAddedStickers","stickerSettingsRef","observe","observeIntersectionForCovers","useIntersectionObserver","rootRef","isModalOpen","openModal","closeModal","setSticker","KEYBOARD_SEND_OPTIONS","subLabel","IS_MAC_OS","handleAnimationLevelChange","newLevel","_","handleMessageTextSizeChange","newSize","documentElement","setProperty","setAttribute","handleStickerSetClick","stickerSets","installedDate","onCheck","isChecked","fromSticker","fileSelector","openSystemFilesDialog","accept","callback","noMultiple","removeAttribute","onchange","click","hex2rgb","param","parseInt","substring","rgb2hex","p0","p1","p2","rgb2hsb","r","g","h","s","v","hsb2rgb","f","p","q","t","getPatternColor","rgbColor","hue","saturation","wallpaper","slug","localMediaHash","previewBlobUrl","thumbRef","useCanvasBlur","thumbnail","dataUri","shouldRenderThumb","isDownloadAllowed","setIsDownloadAllowed","fullMedia","wasDownloadDisabled","UPLOADING_WALLPAPER_SLUG","cacheKeyRef","handleSelect","blob","fetchBlob","cacheApi","save","CUSTOM_BG_CACHE_NAME","isAllowed","background","isBlurred","themes","loadedWallpapers","loadWallpapers","uploadWallpaper","setThemeSettings","themeRef","handleFileSelect","files","handleUploadWallpaper","handleSetColor","handleResetToDefault","backgroundColor","patternColor","DARK_THEME_PATTERN_COLOR","DEFAULT_PATTERN_COLOR","handleWallPaperSelect","currentWallpaper","async","defaultRGB","rgb","canvas","context","getContext","preloadImage","naturalHeight","naturalWidth","offsetWidth","drawImage","getImageData","blockSize","getAverageColor","handleWallPaperBlurChange","isUploading","DEFAULT_HSB","PREDEFINED_COLORS","hsb2positions","hsb","rects","colorPosition","colorRect","huePosition","hueRect","positions2hsb","colorPickerRef","huePickerRef","isFirstRunRef","setHsb","getInitialHsb","hsbRef","markIsDragging","unmarkIsDragging","rgbInput","setRgbInput","hexInput","setHexInput","rectsRef","colorCtxRef","offsetLeft","handleColorDrag","handleHueDrag","onCapture","onDrag","onRelease","selectorToPreventScroll","withCursor","hex","hueHex","w","ctx","imgData","createImageData","pixels","col","perY","st","ed","perX","putImageData","drawColor","drawHue","handleRgbChange","rgbValue","channel","handleHexChange","hexValue","handlePredefinedColorClick","dataset","hasPrivateChatsNotifications","hasPrivateChatsMessagePreview","hasGroupNotifications","hasGroupMessagePreview","hasBroadcastNotifications","hasBroadcastMessagePreview","hasContactJoinedNotifications","hasWebNotifications","hasPushNotifications","notificationSoundVolume","loadNotificationSettings","updateContactSignUpNotification","updateNotificationSettings","updateWebNotificationSettings","handleSettingsChange","peerType","setting","currentIsSilent","currentShouldShowPreviews","shouldShowPreviews","handleContactNotificationChange","volume","hasPassword","isSensitiveEnabled","canChangeSensitive","privacy","blocked","activeSessions","blockedCount","totalCount","sessionsCount","visibilityPrivacyPhoneNumber","phoneNumber","visibility","visibilityPrivacyLastSeen","lastSeen","visibilityPrivacyProfilePhoto","profilePhoto","visibilityPrivacyForwarding","forwards","visibilityPrivacyGroupChats","chatInvite","loadPrivacySettings","loadBlockedContacts","loadAuthorizations","loadContentSettings","updateContentSettings","getVisibilityValue","languages","language","loadLanguages","selectedLanguage","setSelectedLanguage","markIsLoading","unmarkIsLoading","langCode","setLanguage","currentLangCode","navigator","toLowerCase","shortLangCode","substr","nativeName","buildOptions","loadingOption","getPrivacyKey","screen","privacySettings","allowUserIds","allowChatIds","blockUserIds","blockChatIds","setPrivacyVisibility","visibilityOptions","exceptionLists","shouldShowDenied","shouldShowAllowed","privacyKey","headerText","descriptionText","allowedContactsScreen","deniedContactsScreen","allowedCount","reduce","result","membersCount","blockCount","handleVisibilityChange","getLocation","session","region","country","getDeviceEnvironment","deviceModel","platform","systemVersion","terminateAuthorization","terminateAllAuthorizations","isConfirmTerminateAllDialogOpen","openConfirmTerminateAllDialog","closeConfirmTerminateAllDialog","handleTerminateSessionClick","handleTerminateAllSessions","currentSession","isCurrent","otherSessions","appName","ip","sessions","handler","dateActive","chatsByIds","usersByIds","blockedIds","unblockContact","handleUnblockClick","contactId","viewportOffset","isPrivate","CHAT_HEIGHT_PX","formatPhoneNumberWithCode","renderContact","animatedEmoji","selectAnimatedEmoji","AnimatedEmoji","expectedPassword","submitLabel","clearError","validationError","setValidationError","shouldShowPassword","setShouldShowPassword","handleSubmit","newPassword","handleClearError","PasswordMonkey","isBig","isPasswordVisible","PasswordForm","onChangePasswordVisibility","onStart","FOCUS_DELAY_TIMEOUT_MS","shouldConfirm","setValue","isConfirmShown","markIsConfirmShown","unmarkIsConfirmShown","codeLength","twoFaSettings","waitingEmailCodeLength","newValue","updatePassword","checkPassword","clearTwoFaError","updateRecoveryEmail","provideTwoFaEmailCode","clearPassword","handleStartWizard","handleNewPassword","handleNewPasswordConfirm","handleNewPasswordHint","handleNewPasswordEmail","onSuccess","handleChangePasswordCurrent","handleChangePasswordNew","handleChangePasswordConfirm","handleChangePasswordHint","handleTurnOff","handleRecoveryEmailCurrentPassword","handleRecoveryEmail","handleEmailCode","getCurrentPrivacySettings","isAllowList","setPrivacySettings","selectedContactIds","setSearchQuery","isSubmitShown","setIsSubmitShown","newSelectedContactIds","setNewSelectedContactIds","handleSelectedContactIdsChange","contactsIds","Picker","itemIds","filterPlaceholder","searchInputId","TWO_FA_SCREENS","FOLDERS_SCREENS","PRIVACY_SCREENS","PRIVACY_PHONE_NUMBER_SCREENS","PRIVACY_LAST_SEEN_PHONE_SCREENS","PRIVACY_PROFILE_PHOTO_SCREENS","PRIVACY_FORWARDING_SCREENS","PRIVACY_GROUP_CHATS_SCREENS","foldersState","foldersDispatch","shouldSkipTransition","twoFaState","twoFaDispatch","useReducer","handleSaveFilter","renderCurrentSection","isScreenActive","isFrom","currentKey","privacyAllowScreens","isTwoFaScreen","isFoldersScreen","isPrivacyScreen","values","SettingsGeneralBackgroundColor","renderCurrentSectionContent","LAYERS_ANIMATION_NAME","contactIds","serverTimeOffset","resultIds","sortUserIds","isSearching","selectedMemberIds","onSelectedMemberIdsChange","onNextStep","setGlobalSearchQuery","isUserBot","canBeInvitedToGroup","handleNextStep","creationProgress","creationError","chatCreation","memberIds","createGroupChat","createChannel","setTitle","about","setAbout","chatTitleEmptyError","channelTitleEmptyError","chatTooManyUsersError","ChatCreationProgress","handleTitleChange","handleCreateGroup","handleCreateChannel","renderedError","RENDER_COUNT","LeftColumnContent","onContentChange","newChatMemberIds","setNewChatMemberIds","isStepActive","ChatList","folderType","IGNORED_KEYS","Down","ArrowDown","Up","ArrowUp","Left","ArrowLeft","Right","ArrowRight","PageUp","PageDown","End","Home","Tab","preventDefaultForScrollKeys","HTMLElement","tagName","getAttribute","isTextBox","disableScrolling","passive","ontouchmove","onkeydown","enableScrolling","getCopyLabel","hasSelection","anchor","canSendNow","canReschedule","canReply","canEdit","canPin","canUnpin","canForward","canFaveSticker","canUnfaveSticker","canCopy","canCopyLink","canSelect","onReply","onEdit","onPin","onReport","onFaveSticker","onUnfaveSticker","onSend","onReschedule","onCloseAnimationEnd","onCopyLink","copyOptions","afterEffect","getMessageText","canImageBeCopied","hasMessageLocalBlobUrl","CLIPBOARD_ITEM_SUPPORTED","selection","getSelection","Promise","resolve","mediaLoader","copyImageToClipboard","anchorNode","parentNode","clipboardText","copyTextToClipboard","getMessageCopyOptions","getTriggerElement","getRootElement","getMenuElement","positionY","useContextMenuPosition","Menu","noOptions","isScheduled","chatUsername","setReplyingToId","setEditingId","faveSticker","unfaveSticker","toggleMessageSelection","sendScheduledMessages","rescheduleMessage","isMenuOpen","setIsMenuOpen","setIsDeleteModalOpen","setIsReportModalOpen","isPinModalOpen","setIsPinModalOpen","isCalendarOpen","openCalendar","closeCalendar","closeMenu","closePinModal","handleCloseCalendar","handleReply","handleEdit","handlePin","handleUnpin","handleFaveSticker","handleUnfaveSticker","handleSelectMessage","params","childMessageIds","withShift","handleScheduledMessageSend","handleOpenCalendar","handleRescheduleMessage","scheduledAt","handleCopyLink","abs","reportMessageIds","scheduledMaxDate","getDayStartAt","stickerSetShortName","selectStickerSet","stickerSetId","selectStickerSetByShortName","loadStickers","toggleStickerSet","sendMessage","throttleMs","isDisabled","stickerSetAccessHash","isPreloadedGlobally","handleButtonClick","hasCloseButton","STICKER_SIZE_MODAL","isRestricted","canDeleteChat","getCanDeleteChat","canStartBot","canRestartBot","canSubscribe","canSearch","canMute","canLeave","onSubscribeChannel","onSearchClick","updateChatMutedState","enterMessageSelectMode","sendBotCommand","restartBot","handleStartBot","command","handleRestartBot","handleToggleMuteClick","handleSubscribe","handleSearch","handleSelectMessages","Portal","runDebouncedForSearch","results","selectCurrentTextSearch","isHistoryCalendarOpen","setLocalTextSearchQuery","searchTextMessagesLocal","closeLocalTextSearch","openHistoryCalendar","focusedIndex","setFocusedIndex","visualViewport","mainEl","pageTop","Array","from","input","div","contentEditable","handleMessageSearchQueryChange","newQuery","handleUp","newFocusIndex","handleDown","SearchInput","findInViewport","selectorOrElements","margin","isDense","shouldContainBottom","isHorizontal","viewportY1","viewportY2","allElements","visibleIndexes","isFound","y1","y2","setTooltipItemVisible","selector","first","isFullyVisible","position","fastSmoothScroll","useKeyboardNavigation","shouldRemoveSelectionOnReset","noArrowNavigation","shouldSelectOnTab","selectedItemIndex","setSelectedItemIndex","getSelectedIndex","newIndex","cycleRestrict","handleArrowKey","handleItemSelect","item","onUp","onDown","onLeft","onRight","onTab","onInsertUserName","filteredUsers","handleUserSelect","forceFocus","handleSelectMention","member","selectedMentionIndex","prevChatMembers","renderedChatMembers","attachments","caption","isReady","groupChatMembers","recentEmojis","baseEmojiKeywords","emojiKeywords","addRecentEmoji","onCaptionUpdate","onFileAppend","onClear","hideTimeoutRef","prevAttachments","renderingAttachments","isHovered","markHovered","unmarkHovered","isQuick","every","quick","isMentionTooltipOpen","closeMentionTooltip","insertMention","mentionFilteredUsers","useMentionTooltip","EDITABLE_INPUT_MODAL_ID","isEmojiTooltipOpen","closeEmojiTooltip","filteredEmojis","insertEmoji","useEmojiTooltip","sendAttachments","handleFilesDrop","dataTransfer","newFiles","file","CONTENT_TYPES_FOR_QUICK_UPLOAD","areAllPhotos","mimeType","areAllVideos","renderHeader","onDragEnter","onDrop","onDragOver","onDragLeave","relatedTarget","toTarget","fromTarget","attachment","File","filename","extension","getFileExtension","previewData","emojis","onEmojiSelect","MessageInput","isAttachmentModalInput","html","editableInputId","onUpdate","shouldSetFocus","questionInputRef","optionsListRef","solutionRef","question","setQuestion","setOptions","isAnonymous","setIsAnonymous","isMultipleAnswers","setIsMultipleAnswers","isQuizMode","setIsQuizMode","solution","setSolution","correctOption","setCorrectOption","hasErrors","setHasErrors","focusInput","solutionEl","innerHTML","addNewOption","newOptions","list","scrollHeight","scrollTo","behavior","handleCreate","questionTrimmed","optionsTrimmed","o","summary","answers","correct","isPublic","multipleChoice","quiz","entities","parseMessageInput","correctAnswers","solutionEntities","updateOption","removeOption","handleCorrectOptionChange","handleIsAnonymousChange","handleMultipleAnswersChange","handleQuizModeChange","handleKeyPress","keyCode","getQuestionError","getOptionsError","renderOptions","onKeyPress","renderQuizNoOptionError","hidden","emoji","native","names","IS_EMOJI_SUPPORTED","loading","category","allEmojis","useOnIntersect","emojisPerRow","ceil","displayedEmoji","ICONS_BY_CATEGORY","recent","people","nature","foods","activity","places","objects","symbols","flags","categoryIntersections","emojiDataPromise","emojiRawData","emojiData","headerRef","categories","setCategories","setEmojis","activeCategoryIndex","setActiveCategoryIndex","entries","entry","intersectingWithIndexes","newLeft","HEADER_BUTTON_WIDTH","fastSmoothScrollHorizontal","allCategories","themeCategories","unshift","exec","default","uncompressEmoji","ensureEmojiData","selectCategory","categoryEl","handleEmojiSelect","MENU_TRANSITION_DURATION","containerClassName","faded","STICKER_MARGIN","loadAndPlay","onStickerSelect","onStickerUnfave","stickersPerRow","STICKER_SIZE_PICKER","noAnimate","onUnfaveClick","stickerSetIntersections","favorite","recentStickers","favoriteStickers","addedSetIds","shouldPlay","canSendStickers","loadRecentStickers","loadFavoriteStickers","addRecentSticker","activeSetIndex","setActiveSetIndex","areAddedLoaded","allSets","noPopulatedSets","set","stickerSetEl","handleStickerSelect","handleStickerUnfave","fullClassName","buttonClassName","gif","videoData","shouldRenderVideo","isVideoReady","preventMessageInputBlurWithBubbling","preload","savedGifs","gifs","saved","canSendGifs","onGifSelect","loadSavedGifs","debounceMs","SymbolMenuTabs","SYMBOL_MENU_TAB_TITLES","SYMBOL_MENU_TAB_ICONS","Emoji","Stickers","GIFs","onRemoveSymbol","onSearchOpen","renderTabButton","handleSearchOpen","isActivated","isLeftColumnShown","allowedAttachmentOptions","setRecentEmojis","handleMouseEnter","handleMouseLeave","useMouseInside","fastRaf","recentEmojisRef","renderContent","onMouseEnter","onMouseLeave","noCloseOnBackdrop","onFileSelect","onPollCreate","handleQuickSelect","handleDocumentSelect","canAttachMedia","canAttachPolls","autoClose","withAvatar","botCommand","bot","botCommands","handleSendCommand","botId","selectedCommandIndex","prevCommands","renderedCommands","chatBotCommand","forEmoji","clearStickersForEmoji","prevStickers","displayedStickers","onSilentSend","onScheduleSend","listEmojis","usePrevDuringAnimation","handleSelectEmoji","selectedIndex","setItemVisible","thumbUrl","thumbnailDataUrl","decoding","isForGallery","inlineResult","webThumbnail","STICKER_SIZE_INLINE_BOT_RESULT","isGallery","inlineBotResults","switchPm","loadMore","startBot","onSelectResult","handleSendPm","startParam","prevInlineBotResults","renderedInlineBotResults","sensitiveArea","inlineBotResult","messagesById","foundResults","senderUser","getGlobal","senderChat","forwardInfo","isChannelPost","orderBy","foundResult","preloadBackwards","LastMessageMeta","selectShouldLoopStickers","isSomeModalOpen","onModalToggle","isAdded","areStickersLoaded","useOnChange","coverStickerIds","covers","otherStickers","handleAddClick","canRenderStickers","STICKER_SIZE_SEARCH","selectCurrentStickerSearch","featured","featuredIds","loadFeaturedStickers","setIsModalOpen","selectCurrentGifSearch","isChatWithBot","selectIsChatWithBot","searchMoreGifs","setGifSearchQuery","getAllowedAttachmentOptions","handleGifClick","hasResults","answer","voters","offsets","pollResults","offset","answerVote","totalVoters","loadPollOptionResults","closePollResults","prevVotersCount","votersCount","setIsLoading","areVotersLoaded","limit","shouldResetVoters","handleViewMoreClick","handleMemberClick","noStatusOrTyping","leftVotersCount","renderViewMoreButton","total","getMessagePoll","resultsByOption","buildCollectionByKey","management","updateContact","deleteUser","deleteHistory","closeManagement","isDeleteDialogOpen","openDeleteDialog","closeDeleteDialog","isNotificationsEnabled","setIsNotificationsEnabled","ManagementProgress","handleNotificationChange","handleDeleteContact","withFullInfo","GROUP_TITLE_EMPTY","hasLinkedChannel","linkedChatId","isBasicGroup","canChangeInfo","isCreator","getHasAdminRight","canBanUsers","togglePreHistoryHidden","updateChat","deleteChat","leaveChannel","deleteChannel","currentTitle","currentAbout","imageHash","handleClickEditType","ManagementScreens","handleClickDiscussion","handleClickPermissions","handleClickAdministrators","handleSetPhoto","handleAboutChange","handleUpdateGroup","trimmedTitle","trimmedAbout","handleClickMembers","handleTogglePreHistory","isPreHistoryHidden","isEnabled","enabledPermissionsCount","defaultBannedRights","sendStickers","sendGifs","adminsCount","adminMembers","handleDeleteGroup","formatInteger","onChatMemberSelect","updateChatDefaultBannedRights","permissions","setPermissions","havePermissionChanged","setHavePermissionChanged","handleRemovedUsersClick","handleAddExceptionClick","handleExceptionMemberClick","promotedByUserId","handlePermissionChange","getUpdatedPermissionValue","handleSavePermissions","bannedRights","removedUsersCount","kickedMembers","exceptionMembers","members","getMemberExceptions","langKey","getLangKeyForBannedRightKey","translatedString","sendMessages","blocking","sendMedia","sendPolls","embedLinks","inviteUsers","pinMessages","changeInfo","updateChatMemberBannedRights","removedMembers","getRemovedBy","kickedByUserId","kickedByUser","getContextActions","CHANNEL_TITLE_EMPTY","isSignaturesShown","toggleSignatures","hasLinkedChat","handleUpdateChannel","handleToggleSignatures","handleClickSubscribers","handleDeleteChannel","selectManagement","checkPublicLink","updatePublicLink","updatePrivateLink","privateLink","inviteLink","privacyType","setPrivacyType","isRevokeConfirmDialogOpen","openRevokeConfirmDialog","closeRevokeConfirmDialog","canUpdate","handleOptionChange","handleSave","handleRevokePrivateLink","langPrefix1","langPrefix2","SafeLink","forDiscussionIds","linkedChat","loadGroupsForDiscussion","linkDiscussionGroup","unlinkDiscussionGroup","linkedGroupId","setLinkedGroupId","isConfirmUnlinkGroupDialogOpen","openConfirmUnlinkGroupDialog","closeConfirmUnlinkGroupDialog","isConfirmLinkGroupDialogOpen","openConfirmLinkGroupDialog","closeConfirmLinkGroupDialog","handleUnlinkGroupSessions","channelId","handleLinkGroupSessions","STICKER_SIZE_DISCUSSION_GROUPS","teactFastList","teactOrderKey","linkedGroup","renderLinkGroupHeader","hasPrivateLink","renderLinkGroupConfirmText","isButtonsInOneRow","isPromotedByCurrentUser","isFormFullyDisabled","selectedChatMemberId","isBanConfirmationDialogOpen","openBanConfirmationDialog","closeBanConfirmationDialog","selectedChatMember","handleBanFromGroup","viewMessages","getControlIsDisabled","isOwner","handleAdminMemberClick","getMemberStatus","promotedByUser","updateChatAdmin","setIsTouched","isDismissConfirmationDialogOpen","openDismissConfirmationDialog","closeDismissConfirmationDialog","customTitle","setCustomTitle","adminRights","handleDismissAdmin","memberStatus","handleCustomTitleChange","postMessages","editMessages","banUsers","addAdmins","anonymous","maxLength","openUserInfo","memberId","managementType","selectCurrentManagementType","VISA","MASTERCARD1","MASTERCARD2","CardType","cards","Default","Visa","Mastercard","detectCardType","cardNumber","streetLine1","streetLine2","city","countryIso2","postCode","phone","shipping","cardholder","expiry","cvv","billingCountry","billingZip","saveInfo","saveCredentials","formErrors","reducer","getBillingCountry","countryCode","countryList","useFocusAfterAnimation","animationDuration","hasArrow","labelText","htmlFor","needEmail","needPhone","needName","needAddress","phoneRef","selectCountryRef","handleAddress1Change","handleAddress2Change","handleCityChange","handleStateChange","handleCountryChange","handlePostCodeChange","handleFullNameChange","handleEmailChange","handlePhoneChange","handleSaveInfoChange","shippingOptions","currency","handleShippingSelect","amount","formatCurrency","renderPaymentItem","main","renderCheckoutItem","invoiceContent","prices","shippingPrices","checkoutInfo","totalPrice","photoUrl","paymentMethod","paymentProvider","shippingAddress","shippingMethod","expiryInputRef","charAt","parts","formatCardExpiry","cardNumberRef","cardType","setCardType","newCardType","formatCardNumber","cardIcon","mastercardIconPath","visaIconPath","getCardIcon","canSaveCredentials","needCardholderName","needCountry","needZip","handleCardNumberChange","handleCardholderChange","toUpperCase","handleExpiryChange","handleCvvChange","handleBillingPostCodeChange","handleChangeSaveCredentials","savedInfo","invoice","nativeProvider","nativeParams","passwordMissing","payment","isProviderError","nameRequested","phoneRequested","emailRequested","shippingAddressRequested","flexible","phoneToProvider","emailToProvider","validateRequestedInfo","sendPaymentForm","setPaymentStep","sendCredentialsInfo","clearPaymentError","paymentState","paymentDispatch","field","handleErrorModalClose","PaymentStep","shippingOption","getShippingPrices","concat","acc","cur","getTotalPrice","detectCardTypeText","findShippingOption","getCheckoutInfo","validateRequest","requestInfo","getRequestInfo","sendCredentials","credentials","expiryMonth","expiryYear","zip","getCredentials","sendForm","shippingOptionId","setStep","nextStep","buttonText","currentStep","renderModalContent","renderError","optionId","receipt","info","totalAmount","credentialsTitle","fullAddress","onInputChange","setPassword","canSubmit","setCanSubmit","select","autoComplete","MIN_PASSWORD_LENGTH","SEGMENT_COVER_EYES","SEGMENT_UNCOVER_EYE","SEGMENT_COVER_EYE","STICKER_SIZE","STICKER_SIZE_AUTH_MOBILE","STICKER_SIZE_AUTH","closeMonkeyData","setCloseMonkeyData","peekMonkeyData","setPeekMonkeyData","isFirstMonkeyLoaded","setIsFirstMonkeyLoaded","isPeekShown","setIsPeekShown","handleFirstMonkeyLoad","STICKER_SIZE_TWO_FA","playSegment","ANIMATED_STICKERS_PATHS","MonkeyIdle","MonkeyTracking","MonkeyClose","MonkeyPeek","FoldersAll","FoldersNew","DiscussionGroups","path","location","cropperResultOptions","quality","format","circle","Croppie","croppiePromise","cropper","isCroppieReady","setIsCroppieReady","imgFile","cropContainer","enableZoom","boundary","viewport","blobToDataUri","bind","err","DEBUG","console","initCropper","ensureCroppie","croppedImg","blobToFile","selectedFile","setSelectedFile","croppedBlobUrl","setCroppedBlobUrl","labelClassName","URL","revokeObjectURL","createObjectURL"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/354.66350c1e61029fbd6ca7.js b/dist/354.701ac7c1e3f066f82e25.js similarity index 97% rename from dist/354.66350c1e61029fbd6ca7.js rename to dist/354.701ac7c1e3f066f82e25.js index 046f1cc8..2bed23ba 100644 --- a/dist/354.66350c1e61029fbd6ca7.js +++ b/dist/354.701ac7c1e3f066f82e25.js @@ -1,2 +1,2 @@ (()=>{"use strict";"undefined"!=typeof window&&window.innerHeight,Math.round(425),new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory"]),new Set(["image/png","image/gif","image/jpeg","video/mp4","video/avi","video/quicktime"]),self.onerror=e=>{console.error(e),r({type:"unhandledError",error:{message:e.error.message||"Uncaught exception in worker"}})},self.addEventListener("unhandledrejection",(e=>{console.error(e),r({type:"unhandledError",error:{message:e.reason.message||"Uncaught rejection in worker"}})}));const e=new Map;function r(e,r){r?postMessage(e,r):postMessage(e)}let t;self.importScripts("rlottie-wasm.js");const n=new Promise((e=>{Module.onRuntimeInitialized=()=>{t={init:Module.cwrap("lottie_init","",[]),destroy:Module.cwrap("lottie_destroy","",["number"]),resize:Module.cwrap("lottie_resize","",["number","number","number"]),buffer:Module.cwrap("lottie_buffer","number",["number"]),render:Module.cwrap("lottie_render","",["number","number"]),loadFromData:Module.cwrap("lottie_load_from_data","number",["number","number"])},e()}})),s=new Map;var a;a={init:async function(e,r,a,o,i,d){t||await n;const c=JSON.stringify(r),l=allocate(intArrayFromString(c),"i8",0),m=t.init(),u=t.loadFromData(m,l);t.resize(m,a,a),s.set(e,{imgSize:a,reduceFactor:i,handle:m}),d(Math.ceil(u/i))},renderFrames:async function(e,r,a,o){t||await n;const{imgSize:i,reduceFactor:d,handle:c}=s.get(e);for(let e=r;e<=a;e++){const r=e*d;t.render(c,r);const n=t.buffer(c),s=Module.HEAPU8.subarray(n,n+i*i*4);o(e,new Uint8ClampedArray(s).buffer)}},destroy:function(e){const r=s.get(e);t.destroy(r.handle),s.delete(e)}},onmessage=async t=>{const{data:n}=t;switch(n.type){case"callMethod":{const{messageId:t,name:s,args:o}=n;try{if(t){const n=(...e)=>{const n=e[e.length-1];r({type:"methodCallback",messageId:t,callbackArgs:e},n instanceof ArrayBuffer?[n]:void 0)};e.set(t,n),o.push(n)}const[n,i]=await a[s](...o)||[];t&&r({type:"methodResponse",messageId:t,response:n},i)}catch(e){t&&r({type:"methodResponse",messageId:t,error:{message:e.message}})}t&&e.delete(t);break}case"cancelProgress":{const r=e.get(n.messageId);r&&(r.isCanceled=!0);break}}}})(); -//# sourceMappingURL=354.66350c1e61029fbd6ca7.js.map \ No newline at end of file +//# sourceMappingURL=354.701ac7c1e3f066f82e25.js.map \ No newline at end of file diff --git a/dist/354.66350c1e61029fbd6ca7.js.map b/dist/354.701ac7c1e3f066f82e25.js.map similarity index 99% rename from dist/354.66350c1e61029fbd6ca7.js.map rename to dist/354.701ac7c1e3f066f82e25.js.map index db23a945..cafb258f 100644 --- a/dist/354.66350c1e61029fbd6ca7.js.map +++ b/dist/354.701ac7c1e3f066f82e25.js.map @@ -1 +1 @@ -{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MH0D,GACFzD,EAAa,CACXC,KAAM,iBACNwD,UAAAA,EACA1D,MAAO,CAAEG,QAASH,EAAMG,WAK1BuD,GACFpD,EAAckD,OAAOE,GAGvB,MAEF,IAAK,iBAAkB,CACrB,MAAMG,EAAWvD,EAAc0C,IAAIxC,EAAKkD,WACpCG,IACFA,EAASQ,YAAa,GAGxB,U","sources":["webpack://telegram-t/./src/config.ts","webpack://telegram-t/./src/util/createWorkerInterface.ts","webpack://telegram-t/./src/lib/rlottie/rlottie.worker.ts"],"sourcesContent":["export const PAGE_TITLE = 'Telegram';\nexport const INACTIVE_MARKER = ' [Inactive]';\n\nexport const APP_NAME = process.env.APP_NAME || 'Telegram WebZ';\nexport const APP_VERSION = process.env.APP_VERSION || 'dev';\n\nexport const DEBUG = (\n process.env.APP_ENV !== 'production' && process.env.APP_ENV !== 'perf' && process.env.APP_ENV !== 'test'\n);\nexport const DEBUG_MORE = false;\n\nexport const IS_TEST = process.env.APP_ENV === 'test';\nexport const IS_PERF = process.env.APP_ENV === 'perf';\n\nexport const DEBUG_ALERT_MSG = 'Shoot!\\nSomething went wrong, please see the error details in Dev Tools Console.';\nexport const DEBUG_GRAMJS = false;\n\nexport const SESSION_USER_KEY = 'user_auth';\nexport const LEGACY_SESSION_KEY = 'GramJs:sessionId';\n\nexport const GLOBAL_STATE_CACHE_DISABLED = false;\nexport const GLOBAL_STATE_CACHE_KEY = 'tt-global-state';\nexport const GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT = 30;\nexport const GLOBAL_STATE_CACHE_USER_LIST_LIMIT = 5000;\n\nexport const MEDIA_CACHE_DISABLED = false;\nexport const MEDIA_CACHE_NAME = 'tt-media';\nexport const MEDIA_CACHE_NAME_AVATARS = 'tt-media-avatars';\nexport const MEDIA_PROGRESSIVE_CACHE_DISABLED = false;\nexport const MEDIA_PROGRESSIVE_CACHE_NAME = 'tt-media-progressive';\nexport const MEDIA_CACHE_MAX_BYTES = 512 * 1024; // 512 KB\nexport const CUSTOM_BG_CACHE_NAME = 'tt-custom-bg';\nexport const LANG_CACHE_NAME = 'tt-lang-packs-v5';\nexport const ASSET_CACHE_NAME = 'tt-assets';\n\nexport const DOWNLOAD_WORKERS = 16;\nexport const UPLOAD_WORKERS = 16;\n\nconst isBigScreen = typeof window !== 'undefined' && window.innerHeight >= 900;\n\nexport const MIN_PASSWORD_LENGTH = 1;\n\nexport const MESSAGE_LIST_SENSITIVE_AREA = 750;\nexport const MESSAGE_LIST_SLICE = isBigScreen ? 60 : 40;\nexport const MESSAGE_LIST_VIEWPORT_LIMIT = MESSAGE_LIST_SLICE * 2;\n\nexport const CHAT_HEIGHT_PX = 72;\nexport const CHAT_LIST_SLICE = isBigScreen ? 30 : 25;\nexport const CHAT_LIST_LOAD_SLICE = 100;\nexport const SHARED_MEDIA_SLICE = 42;\nexport const MESSAGE_SEARCH_SLICE = 42;\nexport const GLOBAL_SEARCH_SLICE = 20;\nexport const MEMBERS_SLICE = 30;\nexport const MEMBERS_LOAD_SLICE = 200;\nexport const PINNED_MESSAGES_LIMIT = 50;\nexport const BLOCKED_LIST_LIMIT = 100;\nexport const PROFILE_PHOTOS_LIMIT = 40;\nexport const PROFILE_SENSITIVE_AREA = 500;\n\nexport const TOP_CHAT_MESSAGES_PRELOAD_LIMIT = 20;\nexport const ALL_CHATS_PRELOAD_DISABLED = false;\n\nexport const ANIMATION_LEVEL_MIN = 0;\nexport const ANIMATION_LEVEL_MED = 1;\nexport const ANIMATION_LEVEL_MAX = 2;\nexport const ANIMATION_LEVEL_DEFAULT = ANIMATION_LEVEL_MAX;\n\nexport const DEFAULT_MESSAGE_TEXT_SIZE_PX = 16;\nexport const IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 17;\nexport const MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 15;\n\nexport const DRAFT_DEBOUNCE = 10000; // 10s\n\nexport const EDITABLE_INPUT_ID = 'editable-message-text';\nexport const EDITABLE_INPUT_MODAL_ID = 'editable-message-text-modal';\n\n// Screen width where Pinned Message / Audio Player in the Middle Header can be safely displayed\nexport const SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1440; // px\n// Screen width where Pinned Message / Audio Player in the Middle Header shouldn't collapse with ChatInfo\nexport const SAFE_SCREEN_WIDTH_FOR_CHAT_INFO = 1150; // px\n\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1275; // px\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN = 925; // px\nexport const MOBILE_SCREEN_MAX_WIDTH = 600; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH = 950; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT = 450; // px\n\nexport const LOCAL_MESSAGE_ID_BASE = 1e9;\n\nexport const ANIMATION_END_DELAY = 100;\n\nexport const FAST_SMOOTH_MAX_DISTANCE = 1500;\nexport const FAST_SMOOTH_MIN_DURATION = 250;\nexport const FAST_SMOOTH_MAX_DURATION = 600;\nexport const FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE = 500; // px\n\n// Average duration of message sending animation\nexport const API_UPDATE_THROTTLE = Math.round((FAST_SMOOTH_MIN_DURATION + FAST_SMOOTH_MAX_DURATION) / 2);\nexport const API_THROTTLE_RESET_UPDATES = new Set([\n 'newMessage', 'newScheduledMessage', 'deleteMessages', 'deleteScheduledMessages', 'deleteHistory',\n]);\n\nexport const STICKER_SIZE_INLINE_DESKTOP_FACTOR = 13;\nexport const STICKER_SIZE_INLINE_MOBILE_FACTOR = 11;\nexport const STICKER_SIZE_AUTH = 160;\nexport const STICKER_SIZE_AUTH_MOBILE = 120;\nexport const STICKER_SIZE_PICKER = 64;\nexport const STICKER_SIZE_GENERAL_SETTINGS = 48;\nexport const STICKER_SIZE_PICKER_HEADER = 32;\nexport const STICKER_SIZE_SEARCH = 64;\nexport const STICKER_SIZE_MODAL = 64;\nexport const STICKER_SIZE_TWO_FA = 160;\nexport const STICKER_SIZE_DISCUSSION_GROUPS = 140;\nexport const STICKER_SIZE_FOLDER_SETTINGS = 80;\nexport const STICKER_SIZE_INLINE_BOT_RESULT = 100;\nexport const RECENT_STICKERS_LIMIT = 20;\nexport const MEMOJI_STICKER_ID = 'MEMOJI_STICKER';\n\nexport const BASE_EMOJI_KEYWORD_LANG = 'en';\n\nexport const MENU_TRANSITION_DURATION = 200;\nexport const SLIDE_TRANSITION_DURATION = 450;\n\nexport const CONTENT_TYPES_FOR_QUICK_UPLOAD = new Set([\n 'image/png', 'image/gif', 'image/jpeg', 'video/mp4', 'video/avi', 'video/quicktime',\n]);\n\n// eslint-disable-next-line max-len\nexport const RE_LINK_TEMPLATE = '((ftp|https?):\\\\/\\\\/)?((www\\\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\\\.[a-zA-Z0-9()]{1,63})\\\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)';\nexport const RE_MENTION_TEMPLATE = '(@[\\\\w\\\\d_-]+)';\nexport const RE_TME_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/)([\\d\\w_]+)(?:\\/([\\d]+))?(?:\\/([\\d]+))?$/gm;\nexport const RE_TME_INVITE_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/joinchat\\/)([\\d\\w_-]+)?$/gm;\n\n// MTProto constants\nexport const SERVICE_NOTIFICATIONS_USER_ID = 777000;\nexport const REPLIES_USER_ID = 1271266957;\nexport const ALL_FOLDER_ID = 0;\nexport const ARCHIVED_FOLDER_ID = 1;\nexport const DELETED_COMMENTS_CHANNEL_ID = 777;\nexport const MAX_MEDIA_FILES_FOR_ALBUM = 10;\nexport const MAX_ACTIVE_PINNED_CHATS = 5;\nexport const SCHEDULED_WHEN_ONLINE = 0x7FFFFFFE;\nexport const DEFAULT_LANG_CODE = 'en';\nexport const DEFAULT_LANG_PACK = 'android';\nexport const LANG_PACKS = ['android', 'ios', 'tdesktop', 'macos'] as const;\nexport const TIPS_USERNAME = 'TelegramTips';\nexport const LOCALIZED_TIPS = ['ar', 'pt-br', 'id', 'it', 'ko', 'ms', 'pl', 'es', 'tr'];\nexport const FEEDBACK_URL = 'https://bugs.telegram.org/?tag_ids=41&sort=time';\nexport const LIGHT_THEME_BG_COLOR = '#A2AF8E';\nexport const DARK_THEME_BG_COLOR = '#0F0F0F';\nexport const DARK_THEME_PATTERN_COLOR = '#0a0a0a8c';\nexport const DEFAULT_PATTERN_COLOR = 'rgba(90, 110, 70, 0.6)';\n","import { CancellableCallback, OriginMessageEvent, WorkerMessageData } from './WorkerConnector';\nimport { DEBUG } from '../config';\n\ndeclare const self: WorkerGlobalScope;\n\nhandleErrors();\n\nconst callbackState = new Map();\n\nexport default function createInterface(api: Record) {\n onmessage = async (message: OriginMessageEvent) => {\n const { data } = message;\n\n switch (data.type) {\n case 'callMethod': {\n const { messageId, name, args } = data;\n try {\n if (messageId) {\n const callback = (...callbackArgs: any[]) => {\n const lastArg = callbackArgs[callbackArgs.length - 1];\n\n sendToOrigin({\n type: 'methodCallback',\n messageId,\n callbackArgs,\n }, lastArg instanceof ArrayBuffer ? [lastArg] : undefined);\n };\n\n callbackState.set(messageId, callback);\n\n args.push(callback as never);\n }\n\n const [response, arrayBuffers] = (await api[name](...args)) || [];\n\n if (messageId) {\n sendToOrigin(\n {\n type: 'methodResponse',\n messageId,\n response,\n },\n arrayBuffers,\n );\n }\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n\n if (messageId) {\n sendToOrigin({\n type: 'methodResponse',\n messageId,\n error: { message: error.message },\n });\n }\n }\n\n if (messageId) {\n callbackState.delete(messageId);\n }\n\n break;\n }\n case 'cancelProgress': {\n const callback = callbackState.get(data.messageId);\n if (callback) {\n callback.isCanceled = true;\n }\n\n break;\n }\n }\n };\n}\n\nfunction handleErrors() {\n self.onerror = (e) => {\n // eslint-disable-next-line no-console\n console.error(e);\n sendToOrigin({ type: 'unhandledError', error: { message: e.error.message || 'Uncaught exception in worker' } });\n };\n\n self.addEventListener('unhandledrejection', (e) => {\n // eslint-disable-next-line no-console\n console.error(e);\n sendToOrigin({ type: 'unhandledError', error: { message: e.reason.message || 'Uncaught rejection in worker' } });\n });\n}\n\nfunction sendToOrigin(data: WorkerMessageData, arrayBuffers?: ArrayBuffer[]) {\n if (arrayBuffers) {\n postMessage(data, arrayBuffers);\n } else {\n postMessage(data);\n }\n}\n","import createWorkerInterface from '../../util/createWorkerInterface';\nimport { CancellableCallback } from '../../util/WorkerConnector';\n\ndeclare const Module: any;\n\ndeclare function allocate(...args: any[]): string;\n\ndeclare function intArrayFromString(str: String): string;\n\ndeclare const self: WorkerGlobalScope;\n\nself.importScripts('rlottie-wasm.js');\n\nlet rLottieApi: Record;\nconst rLottieApiPromise = new Promise((resolve) => {\n Module.onRuntimeInitialized = () => {\n rLottieApi = {\n init: Module.cwrap('lottie_init', '', []),\n destroy: Module.cwrap('lottie_destroy', '', ['number']),\n resize: Module.cwrap('lottie_resize', '', ['number', 'number', 'number']),\n buffer: Module.cwrap('lottie_buffer', 'number', ['number']),\n render: Module.cwrap('lottie_render', '', ['number', 'number']),\n loadFromData: Module.cwrap('lottie_load_from_data', 'number', ['number', 'number']),\n };\n\n resolve();\n };\n});\n\nconst renderers = new Map();\n\nasync function init(\n key: string,\n animationData: AnyLiteral,\n imgSize: number,\n isLowPriority: boolean,\n reduceFactor: number,\n onInit: CancellableCallback,\n) {\n if (!rLottieApi) {\n await rLottieApiPromise;\n }\n\n const json = JSON.stringify(animationData);\n const stringOnWasmHeap = allocate(intArrayFromString(json), 'i8', 0);\n const handle = rLottieApi.init();\n const framesCount = rLottieApi.loadFromData(handle, stringOnWasmHeap);\n rLottieApi.resize(handle, imgSize, imgSize);\n\n renderers.set(key, { imgSize, reduceFactor, handle });\n\n onInit(Math.ceil(framesCount / reduceFactor));\n}\n\nasync function renderFrames(\n key: string, fromIndex: number, toIndex: number, onProgress: CancellableCallback,\n) {\n if (!rLottieApi) {\n await rLottieApiPromise;\n }\n\n const { imgSize, reduceFactor, handle } = renderers.get(key)!;\n\n for (let i = fromIndex; i <= toIndex; i++) {\n const realIndex = i * reduceFactor;\n\n rLottieApi.render(handle, realIndex);\n const bufferPointer = rLottieApi.buffer(handle);\n const data = Module.HEAPU8.subarray(bufferPointer, bufferPointer + (imgSize * imgSize * 4));\n const arrayBuffer = new Uint8ClampedArray(data).buffer;\n onProgress(i, arrayBuffer);\n }\n}\n\nfunction destroy(key: string) {\n const renderer = renderers.get(key)!;\n\n rLottieApi.destroy(renderer.handle);\n\n renderers.delete(key);\n}\n\ncreateWorkerInterface({\n init,\n renderFrames,\n destroy,\n});\n"],"names":["window","innerHeight","Math","round","Set","self","onerror","e","console","error","sendToOrigin","type","message","addEventListener","reason","callbackState","Map","data","arrayBuffers","postMessage","rLottieApi","importScripts","rLottieApiPromise","Promise","resolve","Module","onRuntimeInitialized","init","cwrap","destroy","resize","buffer","render","loadFromData","renderers","api","async","key","animationData","imgSize","isLowPriority","reduceFactor","onInit","json","JSON","stringify","stringOnWasmHeap","allocate","intArrayFromString","handle","framesCount","set","ceil","renderFrames","fromIndex","toIndex","onProgress","get","i","realIndex","bufferPointer","HEAPU8","subarray","Uint8ClampedArray","renderer","delete","onmessage","messageId","name","args","callback","callbackArgs","lastArg","length","ArrayBuffer","undefined","push","response","isCanceled"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"354.701ac7c1e3f066f82e25.js","mappings":"mBAsCsC,oBAAXA,QAA0BA,OAAOC,YA2DzBC,KAAKC,MAAM,KACJ,IAAIC,IAAI,CAChD,aAAc,sBAAuB,iBAAkB,0BAA2B,kBAwBtC,IAAIA,IAAI,CACpD,YAAa,YAAa,aAAc,YAAa,YAAa,oBC7ClEC,KAAKC,QAAWC,IAEdC,QAAQC,MAAMF,GACdG,EAAa,CAAEC,KAAM,iBAAkBF,MAAO,CAAEG,QAASL,EAAEE,MAAMG,SAAW,mCAG9EP,KAAKQ,iBAAiB,sBAAuBN,IAE3CC,QAAQC,MAAMF,GAC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AAIjB,EAEtBrB,EAAWY,OAAOiB,EAAQU,GAC1B,MAAMC,EAAgBxC,EAAWW,OAAOkB,GAClChC,EAAOQ,OAAOoC,OAAOC,SAASF,EAAeA,EAAiBrB,EAAUA,EAAU,GAExFiB,EAAWE,EADS,IAAIK,kBAAkB9C,GAAMc,UAgBlDF,QAXF,SAAiBQ,GACf,MAAM2B,EAAW9B,EAAUuB,IAAIpB,GAE/BjB,EAAWS,QAAQmC,EAASf,QAE5Bf,EAAU+B,OAAO5B,KDzEjB6B,UAAY9B,MAAAA,IACV,MAAM,KAAEnB,GAASL,EAEjB,OAAQK,EAAKN,MACX,IAAK,aAAc,CACjB,MAAM,UAAEwD,EAAF,KAAaC,EAAb,KAAmBC,GAASpD,EAClC,IACE,GAAIkD,EAAW,CACb,MAAMG,EAAW,IAAIC,KACnB,MAAMC,EAAUD,EAAaA,EAAaE,OAAS,GAEnD/D,EAAa,CACXC,KAAM,iBACNwD,UAAAA,EACAI,aAAAA,GACCC,aAAmBE,YAAc,CAACF,QAAWG,IAGlD5D,EAAcoC,IAAIgB,EAAWG,GAE7BD,EAAKO,KAAKN,GAGZ,MAAOO,EAAU3D,SAAuBiB,EAAIiC,MAASC,IAAU,GAE3DF,GACFzD,EACE,CACEC,KAAM,iBACNwD,UAAAA,EACAU,SAAAA,GAEF3D,GAGJ,MAAOT,GAMH0D,GACFzD,EAAa,CACXC,KAAM,iBACNwD,UAAAA,EACA1D,MAAO,CAAEG,QAASH,EAAMG,WAK1BuD,GACFpD,EAAckD,OAAOE,GAGvB,MAEF,IAAK,iBAAkB,CACrB,MAAMG,EAAWvD,EAAc0C,IAAIxC,EAAKkD,WACpCG,IACFA,EAASQ,YAAa,GAGxB,U","sources":["webpack://telegram-t/./src/config.ts","webpack://telegram-t/./src/util/createWorkerInterface.ts","webpack://telegram-t/./src/lib/rlottie/rlottie.worker.ts"],"sourcesContent":["export const PAGE_TITLE = 'Telegram';\nexport const INACTIVE_MARKER = ' [Inactive]';\n\nexport const APP_NAME = process.env.APP_NAME || 'Telegram WebZ';\nexport const APP_VERSION = process.env.APP_VERSION || 'dev';\n\nexport const DEBUG = (\n process.env.APP_ENV !== 'production' && process.env.APP_ENV !== 'perf' && process.env.APP_ENV !== 'test'\n);\nexport const DEBUG_MORE = false;\n\nexport const IS_TEST = process.env.APP_ENV === 'test';\nexport const IS_PERF = process.env.APP_ENV === 'perf';\n\nexport const DEBUG_ALERT_MSG = 'Shoot!\\nSomething went wrong, please see the error details in Dev Tools Console.';\nexport const DEBUG_GRAMJS = false;\n\nexport const SESSION_USER_KEY = 'user_auth';\nexport const LEGACY_SESSION_KEY = 'GramJs:sessionId';\n\nexport const GLOBAL_STATE_CACHE_DISABLED = false;\nexport const GLOBAL_STATE_CACHE_KEY = 'tt-global-state';\nexport const GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT = 30;\nexport const GLOBAL_STATE_CACHE_USER_LIST_LIMIT = 5000;\n\nexport const MEDIA_CACHE_DISABLED = false;\nexport const MEDIA_CACHE_NAME = 'tt-media';\nexport const MEDIA_CACHE_NAME_AVATARS = 'tt-media-avatars';\nexport const MEDIA_PROGRESSIVE_CACHE_DISABLED = false;\nexport const MEDIA_PROGRESSIVE_CACHE_NAME = 'tt-media-progressive';\nexport const MEDIA_CACHE_MAX_BYTES = 512 * 1024; // 512 KB\nexport const CUSTOM_BG_CACHE_NAME = 'tt-custom-bg';\nexport const LANG_CACHE_NAME = 'tt-lang-packs-v5';\nexport const ASSET_CACHE_NAME = 'tt-assets';\n\nexport const DOWNLOAD_WORKERS = 16;\nexport const UPLOAD_WORKERS = 16;\n\nconst isBigScreen = typeof window !== 'undefined' && window.innerHeight >= 900;\n\nexport const MIN_PASSWORD_LENGTH = 1;\n\nexport const MESSAGE_LIST_SENSITIVE_AREA = 750;\nexport const MESSAGE_LIST_SLICE = isBigScreen ? 60 : 40;\nexport const MESSAGE_LIST_VIEWPORT_LIMIT = MESSAGE_LIST_SLICE * 2;\n\nexport const CHAT_HEIGHT_PX = 72;\nexport const CHAT_LIST_SLICE = isBigScreen ? 30 : 25;\nexport const CHAT_LIST_LOAD_SLICE = 100;\nexport const SHARED_MEDIA_SLICE = 42;\nexport const MESSAGE_SEARCH_SLICE = 42;\nexport const GLOBAL_SEARCH_SLICE = 20;\nexport const MEMBERS_SLICE = 30;\nexport const MEMBERS_LOAD_SLICE = 200;\nexport const PINNED_MESSAGES_LIMIT = 50;\nexport const BLOCKED_LIST_LIMIT = 100;\nexport const PROFILE_PHOTOS_LIMIT = 40;\nexport const PROFILE_SENSITIVE_AREA = 500;\n\nexport const TOP_CHAT_MESSAGES_PRELOAD_LIMIT = 20;\nexport const ALL_CHATS_PRELOAD_DISABLED = false;\n\nexport const ANIMATION_LEVEL_MIN = 0;\nexport const ANIMATION_LEVEL_MED = 1;\nexport const ANIMATION_LEVEL_MAX = 2;\nexport const ANIMATION_LEVEL_DEFAULT = ANIMATION_LEVEL_MAX;\n\nexport const DEFAULT_MESSAGE_TEXT_SIZE_PX = 16;\nexport const IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 17;\nexport const MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 15;\n\nexport const DRAFT_DEBOUNCE = 10000; // 10s\n\nexport const EDITABLE_INPUT_ID = 'editable-message-text';\nexport const EDITABLE_INPUT_MODAL_ID = 'editable-message-text-modal';\n\n// Screen width where Pinned Message / Audio Player in the Middle Header can be safely displayed\nexport const SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1440; // px\n// Screen width where Pinned Message / Audio Player in the Middle Header shouldn't collapse with ChatInfo\nexport const SAFE_SCREEN_WIDTH_FOR_CHAT_INFO = 1150; // px\n\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1275; // px\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN = 925; // px\nexport const MOBILE_SCREEN_MAX_WIDTH = 600; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH = 950; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT = 450; // px\n\nexport const LOCAL_MESSAGE_ID_BASE = 1e9;\n\nexport const ANIMATION_END_DELAY = 100;\n\nexport const FAST_SMOOTH_MAX_DISTANCE = 1500;\nexport const FAST_SMOOTH_MIN_DURATION = 250;\nexport const FAST_SMOOTH_MAX_DURATION = 600;\nexport const FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE = 500; // px\n\n// Average duration of message sending animation\nexport const API_UPDATE_THROTTLE = Math.round((FAST_SMOOTH_MIN_DURATION + FAST_SMOOTH_MAX_DURATION) / 2);\nexport const API_THROTTLE_RESET_UPDATES = new Set([\n 'newMessage', 'newScheduledMessage', 'deleteMessages', 'deleteScheduledMessages', 'deleteHistory',\n]);\n\nexport const STICKER_SIZE_INLINE_DESKTOP_FACTOR = 13;\nexport const STICKER_SIZE_INLINE_MOBILE_FACTOR = 11;\nexport const STICKER_SIZE_AUTH = 160;\nexport const STICKER_SIZE_AUTH_MOBILE = 120;\nexport const STICKER_SIZE_PICKER = 64;\nexport const STICKER_SIZE_GENERAL_SETTINGS = 48;\nexport const STICKER_SIZE_PICKER_HEADER = 32;\nexport const STICKER_SIZE_SEARCH = 64;\nexport const STICKER_SIZE_MODAL = 64;\nexport const STICKER_SIZE_TWO_FA = 160;\nexport const STICKER_SIZE_DISCUSSION_GROUPS = 140;\nexport const STICKER_SIZE_FOLDER_SETTINGS = 80;\nexport const STICKER_SIZE_INLINE_BOT_RESULT = 100;\nexport const RECENT_STICKERS_LIMIT = 20;\nexport const MEMOJI_STICKER_ID = 'MEMOJI_STICKER';\n\nexport const BASE_EMOJI_KEYWORD_LANG = 'en';\n\nexport const MENU_TRANSITION_DURATION = 200;\nexport const SLIDE_TRANSITION_DURATION = 450;\n\nexport const CONTENT_TYPES_FOR_QUICK_UPLOAD = new Set([\n 'image/png', 'image/gif', 'image/jpeg', 'video/mp4', 'video/avi', 'video/quicktime',\n]);\n\n// eslint-disable-next-line max-len\nexport const RE_LINK_TEMPLATE = '((ftp|https?):\\\\/\\\\/)?((www\\\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\\\.[a-zA-Z0-9()]{1,63})\\\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)';\nexport const RE_MENTION_TEMPLATE = '(@[\\\\w\\\\d_-]+)';\nexport const RE_TME_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/)([\\d\\w_]+)(?:\\/([\\d]+))?(?:\\/([\\d]+))?$/gm;\nexport const RE_TME_INVITE_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/joinchat\\/)([\\d\\w_-]+)?$/gm;\n\n// MTProto constants\nexport const SERVICE_NOTIFICATIONS_USER_ID = 777000;\nexport const REPLIES_USER_ID = 1271266957;\nexport const ALL_FOLDER_ID = 0;\nexport const ARCHIVED_FOLDER_ID = 1;\nexport const DELETED_COMMENTS_CHANNEL_ID = 777;\nexport const MAX_MEDIA_FILES_FOR_ALBUM = 10;\nexport const MAX_ACTIVE_PINNED_CHATS = 5;\nexport const SCHEDULED_WHEN_ONLINE = 0x7FFFFFFE;\nexport const DEFAULT_LANG_CODE = 'en';\nexport const DEFAULT_LANG_PACK = 'android';\nexport const LANG_PACKS = ['android', 'ios', 'tdesktop', 'macos'] as const;\nexport const TIPS_USERNAME = 'TelegramTips';\nexport const LOCALIZED_TIPS = ['ar', 'pt-br', 'id', 'it', 'ko', 'ms', 'pl', 'es', 'tr'];\nexport const FEEDBACK_URL = 'https://bugs.telegram.org/?tag_ids=41&sort=time';\nexport const LIGHT_THEME_BG_COLOR = '#A2AF8E';\nexport const DARK_THEME_BG_COLOR = '#0F0F0F';\nexport const DARK_THEME_PATTERN_COLOR = '#0a0a0a8c';\nexport const DEFAULT_PATTERN_COLOR = 'rgba(90, 110, 70, 0.6)';\n","import { CancellableCallback, OriginMessageEvent, WorkerMessageData } from './WorkerConnector';\nimport { DEBUG } from '../config';\n\ndeclare const self: WorkerGlobalScope;\n\nhandleErrors();\n\nconst callbackState = new Map();\n\nexport default function createInterface(api: Record) {\n onmessage = async (message: OriginMessageEvent) => {\n const { data } = message;\n\n switch (data.type) {\n case 'callMethod': {\n const { messageId, name, args } = data;\n try {\n if (messageId) {\n const callback = (...callbackArgs: any[]) => {\n const lastArg = callbackArgs[callbackArgs.length - 1];\n\n sendToOrigin({\n type: 'methodCallback',\n messageId,\n callbackArgs,\n }, lastArg instanceof ArrayBuffer ? [lastArg] : undefined);\n };\n\n callbackState.set(messageId, callback);\n\n args.push(callback as never);\n }\n\n const [response, arrayBuffers] = (await api[name](...args)) || [];\n\n if (messageId) {\n sendToOrigin(\n {\n type: 'methodResponse',\n messageId,\n response,\n },\n arrayBuffers,\n );\n }\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n\n if (messageId) {\n sendToOrigin({\n type: 'methodResponse',\n messageId,\n error: { message: error.message },\n });\n }\n }\n\n if (messageId) {\n callbackState.delete(messageId);\n }\n\n break;\n }\n case 'cancelProgress': {\n const callback = callbackState.get(data.messageId);\n if (callback) {\n callback.isCanceled = true;\n }\n\n break;\n }\n }\n };\n}\n\nfunction handleErrors() {\n self.onerror = (e) => {\n // eslint-disable-next-line no-console\n console.error(e);\n sendToOrigin({ type: 'unhandledError', error: { message: e.error.message || 'Uncaught exception in worker' } });\n };\n\n self.addEventListener('unhandledrejection', (e) => {\n // eslint-disable-next-line no-console\n console.error(e);\n sendToOrigin({ type: 'unhandledError', error: { message: e.reason.message || 'Uncaught rejection in worker' } });\n });\n}\n\nfunction sendToOrigin(data: WorkerMessageData, arrayBuffers?: ArrayBuffer[]) {\n if (arrayBuffers) {\n postMessage(data, arrayBuffers);\n } else {\n postMessage(data);\n }\n}\n","import createWorkerInterface from '../../util/createWorkerInterface';\nimport { CancellableCallback } from '../../util/WorkerConnector';\n\ndeclare const Module: any;\n\ndeclare function allocate(...args: any[]): string;\n\ndeclare function intArrayFromString(str: String): string;\n\ndeclare const self: WorkerGlobalScope;\n\nself.importScripts('rlottie-wasm.js');\n\nlet rLottieApi: Record;\nconst rLottieApiPromise = new Promise((resolve) => {\n Module.onRuntimeInitialized = () => {\n rLottieApi = {\n init: Module.cwrap('lottie_init', '', []),\n destroy: Module.cwrap('lottie_destroy', '', ['number']),\n resize: Module.cwrap('lottie_resize', '', ['number', 'number', 'number']),\n buffer: Module.cwrap('lottie_buffer', 'number', ['number']),\n render: Module.cwrap('lottie_render', '', ['number', 'number']),\n loadFromData: Module.cwrap('lottie_load_from_data', 'number', ['number', 'number']),\n };\n\n resolve();\n };\n});\n\nconst renderers = new Map();\n\nasync function init(\n key: string,\n animationData: AnyLiteral,\n imgSize: number,\n isLowPriority: boolean,\n reduceFactor: number,\n onInit: CancellableCallback,\n) {\n if (!rLottieApi) {\n await rLottieApiPromise;\n }\n\n const json = JSON.stringify(animationData);\n const stringOnWasmHeap = allocate(intArrayFromString(json), 'i8', 0);\n const handle = rLottieApi.init();\n const framesCount = rLottieApi.loadFromData(handle, stringOnWasmHeap);\n rLottieApi.resize(handle, imgSize, imgSize);\n\n renderers.set(key, { imgSize, reduceFactor, handle });\n\n onInit(Math.ceil(framesCount / reduceFactor));\n}\n\nasync function renderFrames(\n key: string, fromIndex: number, toIndex: number, onProgress: CancellableCallback,\n) {\n if (!rLottieApi) {\n await rLottieApiPromise;\n }\n\n const { imgSize, reduceFactor, handle } = renderers.get(key)!;\n\n for (let i = fromIndex; i <= toIndex; i++) {\n const realIndex = i * reduceFactor;\n\n rLottieApi.render(handle, realIndex);\n const bufferPointer = rLottieApi.buffer(handle);\n const data = Module.HEAPU8.subarray(bufferPointer, bufferPointer + (imgSize * imgSize * 4));\n const arrayBuffer = new Uint8ClampedArray(data).buffer;\n onProgress(i, arrayBuffer);\n }\n}\n\nfunction destroy(key: string) {\n const renderer = renderers.get(key)!;\n\n rLottieApi.destroy(renderer.handle);\n\n renderers.delete(key);\n}\n\ncreateWorkerInterface({\n init,\n renderFrames,\n destroy,\n});\n"],"names":["window","innerHeight","Math","round","Set","self","onerror","e","console","error","sendToOrigin","type","message","addEventListener","reason","callbackState","Map","data","arrayBuffers","postMessage","rLottieApi","importScripts","rLottieApiPromise","Promise","resolve","Module","onRuntimeInitialized","init","cwrap","destroy","resize","buffer","render","loadFromData","renderers","api","async","key","animationData","imgSize","isLowPriority","reduceFactor","onInit","json","JSON","stringify","stringOnWasmHeap","allocate","intArrayFromString","handle","framesCount","set","ceil","renderFrames","fromIndex","toIndex","onProgress","get","i","realIndex","bufferPointer","HEAPU8","subarray","Uint8ClampedArray","renderer","delete","onmessage","messageId","name","args","callback","callbackArgs","lastArg","length","ArrayBuffer","undefined","push","response","isCanceled"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/433.29f542772c88e944d938.css.map b/dist/433.29f542772c88e944d938.css.map deleted file mode 100644 index e88b1089..00000000 --- a/dist/433.29f542772c88e944d938.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"433.29f542772c88e944d938.css","mappings":"AAEA,gBACE,kBAEA,oCACE,kBAEA,2HACE,eACA,eACA,sBACA,6CACA,0BACA,oBAGF,uFACE,kBACA,OACA,WAGF,4CACE,eAGF,2CACE,aAGF,+CACE,yBAEA,uDACE,qEAGF,sDACE,qEAIJ,iDACE,gBAEA,iHACE,gBAKN,gCACE,iBACA,cACA,iBACA,6BACA,qBACA,iBACA,WACA,kBACA,mBACA,gBACA,kBACA,cAGF,0CACE,cACA,kBAGF,8BACE,gBACA,2CAEA,gBCpEF,+BDgEA,8BC/DE,mBAGA,mBDsEA,qHACE,2B;AEnFN,iBACE,cACA,aACA,mBACA,qBACA,eACA,+BACA,2CAEA,0BACE,wBAGF,6BACE,gCACA,gBACA,iBACA,6BACA,mBAGF,yBACE,6BACE,6B;ACvBN,eACE,kBACA,WACA,YACA,2BAEA,4DAEA,sCACE,0BACA,UAEA,wBAEA,+CACE,UAIJ,wBACE,wBACA,yBAFF,wBAII,kCACA,6BAKF,oCACE,WACA,cACA,kBACA,WACA,YACA,YACA,aACA,WAKF,6CACE,kBACA,YACA,aACA,WACA,cAKF,gFAEE,kBAIA,0DACE,iCAGF,gDACE,0CAKF,0CACE,iCAGF,oDACE,0C;ACzER,iBACE,YACA,kBACA,aACA,sBACA,gBACA,UAEA,2CACE,kBACA,YACA,WAGF,6BACE,OACA,gBACA,gCAEA,uCACE,8BAIJ,8BACE,YACA,aACA,sBACA,gBAEA,gDACE,gBACA,6BAEA,2DACE,SAIJ,uCACE,2BACA,sBACA,mBACA,gBACA,UAGF,mCACE,cACA,qBACA,sBAEA,wCACE,mBACA,oBAIJ,0CACE,OACA,gBAIJ,+FACE,YACA,gBAGF,6BACE,kBACA,YACA,UACA,WACA,c;AC1EJ,YACE,gBAGF,SACE,YAGF,aACE,4BACA,uCACA,aACA,mBACA,cACA,yCAEA,gBACE,gBACA,kBACA,gBACA,qBACA,kBAGF,0BACE,oBACA,gCAEA,yBAJF,0BAKI,iCAIJ,yBAzBF,aA0BI,eAGF,6BACE,aACA,cAEA,2CACE,mB;AC1CN,aACE,aACA,iBACA,oBACA,uBAEA,oCACE,2BAGF,qBACE,cACA,eAGF,0BACE,6CACA,2DACA,0CACA,2CAGF,0CACE,mBAIA,kCACE,WACA,YAEA,oCACE,mBACA,qBAIJ,4BACE,kBACA,oBACA,oBAEA,sCACE,kBAIJ,2EACE,UACA,mBACA,uEAGF,iLAIE,UACA,qBAIJ,qBACE,aACA,uBACA,sBACA,cACA,qBACA,kBACA,gBACA,eACA,gBACA,kDAEA,2BACE,wDAGF,iDAhBF,qBAiBI,iBAGF,yCACE,cACA,gBACA,6BACA,iBACA,YACA,mBACA,gBACA,uBAEA,qDACE,8BACA,qBAIJ,+BACE,4BACA,kCACA,qBACA,gBACA,mBACA,gBACA,uBACA,mBAEA,2CACE,8B;ACrCR,cACE,aACA,mBACA,WACA,+CACA,mCACA,oCACA,kBACA,+BAEA,yBAVF,cAWI,cACA,kBAEA,kCACA,6BAGF,0BACE,WAGA,YAEA,8BACE,aACA,mBACA,WAIJ,2BACE,oBACA,mBACA,kBAEA,yBALF,2BAMI,eAGF,yCACE,kBACA,eACA,kBACA,sBACA,iBACA,oBACA,gBACA,kBAEA,kBACA,aACA,cAEA,6BACA,WACA,oBAEA,gDACE,gCAKN,iCACE,YACA,gBAGF,4BACE,aACA,mBACA,yBACA,iBACA,cAGE,qQAIE,2BAIJ,iDACE,2CACE,+BACA,6CAEA,mEACE,mEAKN,0BA3BF,4BA4BI,+BACA,6CAEA,oDACE,mEN3KN,iHMiLI,oBAIJ,iDAEI,0IAEE,UAEA,0LACE,WA3LR,8HAEE,kBACA,SACA,OACA,QACA,gBACA,gBACA,+CAEA,aACA,2BACA,sBACA,oBACA,mCAEA,8IACE,WACA,cACA,kBACA,eACA,OACA,QACA,eACA,uDAGF,wKACE,gBACA,sBAIJ,uDACE,eAEA,mBACA,sBAEA,+DACE,gBACA,YAGF,+DACE,SAGF,qEACE,iBAIJ,+DACE,YACA,cACA,iBAEA,uEACE,YACA,eAGF,6EACE,eAoIF,0BAEI,8KAEE,wDAON,gJAEE,mDAEA,8LACE,eAKN,iBACE,gBACA,mBACA,qBACA,gBACA,SACA,gBACA,uBACA,uBAEA,4DAEE,oBACA,gBAGF,yBAhBF,iBAiBI,cACA,gBACA,wBAGF,0BACE,yCACE,kDAKN,wBACE,eACA,aACA,mBAEA,8BACE,aACA,sBACA,uBACA,YACA,gBAGF,+BACE,aACA,mBAEA,6CACE,cACA,eACA,mBACA,kBAIJ,qEACE,uBAIJ,sBACE,qBACA,aACA,cACA,oBAGF,mDACE,kBACA,qBACA,SACA,kCACA,gBACA,mBACA,uBACA,qBAEA,uEACE,oBAGF,iEACE,2BAGF,2EACE,iBAIJ,8BACE,aACA,cAGF,2CACE,aACA,mBACA,iBACA,eACA,2BAGE,oFACE,aAIJ,gEACE,gBAGF,mDACE,cAIJ,mCACE,aACA,cACA,oBACA,uBACA,eACA,qBACA,kDACA,kBACA,gBACA,eAEA,yCACE,wDAGF,0DACE,kBACA,eACA,iBACA,cACA,kBACA,gBAEA,2FACE,eACA,cACA,uBACA,gCAGF,yFACE,8CACA,kBACA,sBACA,sCAGF,sFACE,kBACA,OACA,MACA,cACA,gCACA,uBACA,sBACA,sCAIJ,iDACE,gBACA,4BACA,mBACA,gBAEA,iDANF,iDAOI,iBAGF,wDACE,gBACA,kBACA,iBACA,YACA,2BACA,sBACA,gBACA,mBAEA,oEACE,mBAIJ,mDACE,kBACA,qBACA,gBACA,mBACA,gBACA,uBACA,SAEA,+DACE,mBAKN,gDACE,WACA,YAGF,uCACE,cACA,eACA,iBACA,qBACA,4BACA,mBACA,cAEA,qDACE,gBAKN,6BACE,cACA,iBACA,aACA,mBACA,yBAGE,8DACE,2BACA,UAMJ,wFACE,mBAEA,kGACE,qBAKN,yBApdA,sEAEE,kBACA,SACA,OACA,QACA,gBACA,gBACA,+CAEA,aACA,2BACA,sBACA,oBACA,mCAEA,sFACE,WACA,cACA,kBACA,eACA,OACA,QACA,eACA,uDAGF,gHACE,gBACA,sBAIJ,2BACE,eAEA,mBACA,sBAEA,mCACE,gBACA,YAGF,mCACE,SAGF,yCACE,iBAIJ,mCACE,YACA,cACA,iBAEA,2CACE,YACA,eAGF,iDACE,eAuZF,sEAGE,gCAIJ,kDACE,sEAEE,mBAKN,mBACE,KACE,UAEF,GACE,W;AC9eJ,iBACE,aACA,mBACA,yDACA,qBACA,2BACA,0CACA,kDACA,kBACA,gBACA,eACA,cAGE,0DACE,aAIJ,+BACE,gBACA,cACA,SACA,yCACA,iDAEA,uCACE,aACA,YACA,eAGF,+CACE,0BAGF,wCACE,cAIJ,yBACE,WACA,cACA,kBACA,aACA,gBACA,cACA,UACA,+BACA,kBAGF,uBACE,oCAGF,wBACE,qCAGF,gCACE,yDAGF,+BACE,gBACA,0BACA,aACA,8BAEA,8CACE,mBACA,gBACA,uBACA,sBACA,OACA,cAGF,iCACE,mBACA,gBACA,uBACA,gBACA,gBACA,OAEA,wCACE,aACA,aAIJ,sCACE,8DACA,+DACA,sCAIJ,0CACE,0BACA,YAGF,iCACE,WACA,YACA,iBACA,qBACA,mBACA,cAEA,uCACE,mBAIJ,8BACE,8BACA,gCACA,aACA,+BACA,uBACA,WACA,qCACA,sDAEA,sCACE,gBAGF,8CACE,oBAGF,4CACE,4BAGF,6CACE,gBACA,0B;AC/IN,aACE,kBACA,eACA,SACA,QACA,aACA,mBACA,gCACA,sBACA,iBACA,WACA,eACA,eAEA,uFAGE,iBACA,mBAGF,2BACE,sBAGF,4BACE,qBAGF,gCACE,gBACA,uBACA,qBAGF,gCACE,oBACA,qBACA,mBACA,kBACA,eAGF,mCACE,6CACA,gBAGF,mEAEE,0BACA,0BACA,sBACA,sBACA,UACA,cACA,aACA,UACA,gBACA,6BAEA,qHACE,uBAIJ,qFAEE,sBACA,YACA,6BAGF,+GAEE,cAGF,4CACE,eACA,eAGF,yBACE,QAGF,gDACE,oCAGF,oCACE,uBACA,oBACA,sBAEA,iDACE,8BAIJ,6DACE,gBAGF,kEACE,iBAKF,6DACE,WACA,aACA,cAGF,6DACE,YAGF,6DACE,YAGF,6DACE,Y;AC7HF,wBACE,eAGF,kBACE,oB;ACNJ,SACE,aACA,mBACA,eAEA,qBACE,eAGF,iBACE,mBAGF,uBACE,cACA,eACA,mBACA,gBAEA,qCACE,eACA,iBACA,qBACA,gBAGF,sCACE,iBACA,6B;AC5BN,YACE,aACA,qBACA,qBAEA,uBACE,gBAGF,8BACE,sBAGF,+BACE,kBACA,mBACA,cACA,wBACA,cACA,gBACA,kBACA,iBAEA,2CACE,oBACA,uBACA,iBAIJ,gCACE,kBACA,QACA,YACA,WACA,YACA,+BACA,8BACA,oBACA,iBACA,kBAEA,sCACE,8BAGF,gDACE,gBAGF,wCACE,UACA,qCACA,qBACA,uBACA,6BAIJ,+BACE,YAGF,gCACE,kBAGF,8BACE,kBACA,QACA,cACA,gBACA,sBACA,iBACA,+BAEA,qBACA,yBACA,sBAIF,uBACE,WACA,YACA,kBACA,WACA,YACA,sDACA,oBACA,wBAGF,4BACE,iBACA,qBACA,2BACA,UAIA,qCACE,8BAGF,mCACE,0BAKN,iCACE,aACA,gB;ACjHF,MACE,gBACA,mBAEA,yBAJF,MAKI,gBAGF,qBACE,gBACA,oBACA,iBACA,sBAGF,0CAEE,6BACA,kBAGF,iBACE,oBACA,aACA,mBACA,oBAGF,yBACE,2BACA,kBAGF,oBACE,mBACA,oBAGF,6BAEE,qBAEA,mDACE,qBAGF,+CACE,qBACA,mBAKA,gJACE,aACA,yCAEA,gMACE,4CAGF,oMACE,qCAIJ,4IACE,cACA,qCAMF,wMACE,iCAIJ,+CACE,aAMA,sCACE,aACA,sCAEA,mDACE,qCAMR,mBAEE,0CAEA,+BACE,2CAGF,gCAEE,2CACA,4CACE,2CAKN,0BACE,oBACA,mBACA,2BACA,oBACA,mBACA,gBAEA,kCACE,oCACA,eACA,uBAEA,oDACE,iBAKN,sBACE,iBACA,iBACA,qBAEA,+BACE,yBAEA,wDACE,0BAIJ,0BACE,oBAIJ,+BACE,4BACA,iBACA,eACA,qBACA,2CAGF,sBACE,kCACA,yCACE,2BAIJ,wCAEE,mBACA,qBAGF,cACE,oBACA,eAEA,2BACE,0BACA,mDAIJ,cACE,qBACA,yB;ACxLJ,SACE,kBACA,sBACA,qBACA,yDACA,qBACA,gBACA,kBAEA,iBACE,WACA,cACA,kBACA,MACA,SACA,OACA,cACA,+BACA,sBAGF,cACE,aACA,sBACA,uBAGF,sBACE,oBACA,iCAEA,sFACE,6DAGF,mCACE,WACA,YACA,aACA,2BAEA,uCACE,WACA,YAKN,iCACE,4BACA,8BAGF,2BACE,aACA,mBAEA,yCACE,QACA,mBAGF,wCACE,QACA,cAIA,kDACE,wBASF,kMACE,WACA,qBACA,iCACA,cACA,YAKN,oEAGE,sBACA,eAGF,oBACE,0BACA,gBACA,sBAGF,qBACE,gBACA,sBAGF,2BACE,iBACA,gBAEA,uCACE,qBAIJ,kBACE,6BAEA,0BACE,UACA,Q;ACvHJ,gBACE,0BACA,gBAGF,sBACE,kBAGE,+CACE,eACA,aAEA,yBAJF,+CAKI,cAIJ,kDACE,kBACA,MACA,qBACA,cACA,oCACA,kDACA,wBACA,gBAEA,uDACE,kB;AC9BV,OACE,kBACA,gBAEA,mCACE,mCAGF,0BACE,sBAEA,sDACE,oBACA,qCACA,sCAMF,0HACE,oBAKF,uJACE,2BACA,iB;AC5BN,YACE,kBACA,YACA,aACA,eAEA,+BACE,YACA,aACA,kBACA,gBAGF,2BACE,kBACA,OACA,MACA,kBACA,gBAGF,sBACE,kBACA,MACA,OACA,WACA,YACA,oBAGF,6BACE,YACA,iBACA,eACA,mBACA,qBAGF,kKAGE,a;ACzCJ,eACE,aACA,sBAEA,oBACE,aACA,mBAGF,uBACE,OACA,WACA,eACA,gCACA,kDACA,gBACA,oBAEA,+BACE,WACA,oCACA,UAEA,kBACA,MACA,OACA,QACA,SACA,kDACA,uBACA,yBAGF,6BACE,2CAEA,qCACE,WAIJ,qCACE,cAGF,oCACE,eAGF,yBACE,kBACA,kBACA,eACA,aACA,cAEA,0CACE,iBACA,YACA,cACA,yBAKN,0CACE,6BAGF,yCACE,gBAEA,uDACE,wDAGF,sDACE,yD;AC7EN,eACE,4CACA,uCAEA,aACA,WACA,mBACA,yCACA,6BACA,0BACA,mCACA,6DACA,2DACA,mBACA,gBACA,iBACA,0BACA,mBACA,eACA,4CAEA,sCACE,2BAGF,8CACE,WACA,cACA,kBACA,kBACA,gBACA,eACA,eACA,gCACA,yDACA,UACA,oCAEA,gEACE,oBAGF,qEACE,2BAIJ,6BACE,kBACA,YACA,cACA,YACA,gBACA,uBACA,gCACA,uBACA,WACA,gCAEA,UACA,4BAEA,wBAfF,6BAgBI,sBAGF,mCACE,iCAGF,4CACE,UAGF,oCACE,uBACA,kBACA,kBACA,OACA,WACA,kBACA,eACA,cAGF,2CACE,eACA,kDACE,aAIJ,oDACE,cACA,iBACA,cAGF,sKAIE,aAIJ,qBACE,8BAEA,oDACE,UAGF,6BACE,2CAIJ,mHAKE,0CAGF,qDACE,iCAGF,sCACE,sBAGF,sCACE,yBAGF,6OAKE,wBAGF,sCACE,aAGF,8BACE,oBACA,iBACA,0BAGF,0BACE,yBACA,iBAGF,gCACE,oBACA,mBACA,wBACA,8BAEA,wCACE,uBACA,yCACA,oBACA,UACA,gBAEA,+CACE,WACA,qBAGF,gDACE,UAEA,wDACE,UAIJ,0DACE,6BAKN,iCACE,kBAEA,wCACE,WACA,qBACA,YACA,aACA,kBACA,+BACA,2BAIJ,wBACE,eACA,q2B;AChNJ,SACE,aACA,qBACA,sBACA,kBAEA,4CACA,wCACA,0CACA,mBACA,qCACA,iDACA,+CACA,+BACA,8BACA,kCACA,4HACA,6BACA,4BACA,iCAEA,mBACE,yCAGF,mDAEE,UACA,iCACA,8CAEA,iGACE,2BAIJ,iBACE,kBACA,SACA,OAEA,yBALF,iBAMI,aACA,eAIJ,uBACE,sBAGF,sBAGE,sBAIA,qCACE,gDACA,gDAIA,+DACE,wCAIF,2DACE,oBAMJ,6CACE,+DAIJ,mBACE,oBAEA,gEACE,eAGF,yBAPF,mBAQI,sBAEA,gEACE,qBAKN,aACE,2BACA,gDACA,4CACA,8CACA,mBACA,wCACA,yCACA,2CACA,oCACA,0CACA,sCACA,4CACA,8BACA,4BACA,4CAEA,oDAEE,0DACA,4DACA,8DAGF,yBAxBF,aAyBI,sBAKF,2EAEE,kDACA,UACA,6DACA,wBAIJ,mBACE,mCAGF,oBACE,qCAEA,8BACE,qCAGF,kCACE,qCAEA,4CACE,qCAKN,6BACE,eAEA,yBAHF,6BAII,2CAIA,+GAEE,6BAIJ,mDACE,WACA,kBACA,aACA,gBACA,WACA,YACA,qCAKA,wIACE,qBAIJ,qDACE,UAKF,6CACE,8BAEA,0DACE,uBAEA,sEACE,8BAON,wDACE,8BAIJ,6HAEE,qDAGF,qIAEE,yDAGF,wCACE,eACA,aAGF,qDACE,yDACA,2BACA,qBAEA,4DACE,+BAKJ,eACE,kBAEA,uCACE,kBACA,SACA,UACA,UAKF,iDACE,uCAGF,4DAC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I,mCACA,2DACE,qCAEF,gDACE,uCAMR,qBACE,2BACA,yBAGF,+BACE,SACA,sBACA,mBACA,mBACA,kBACA,uBAGF,mCACE,uBAKA,sGACE,kBACA,YACA,uBACA,YACA,cACA,8CACA,qBACA,qBAEA,4KACE,kDACA,gBAGF,0KACE,WAGF,0KACE,aAGF,oVAEE,UAGF,0KACE,aAKF,wHACE,WACA,qBACA,sBAMJ,4CACE,WACA,cACA,WAGF,kDACE,oBACA,0BACA,oBAEA,iEACE,oBAMJ,4DACE,0BAEA,kEACE,qBAKN,oCACE,yCAEA,gDACE,8CAGF,mDACE,YAIJ,0CACE,mBACA,qBACA,kBAGF,gCACE,mBACA,gBACA,uBACA,yDACA,gBACA,oBACA,0BACA,uBACA,aAEA,6CACE,gBACA,uBAGF,yFACE,eAEA,qGACE,YAIJ,yCACE,0BAGF,yCACE,0BAGF,yCACE,0BAGF,yCACE,0BAGF,yCACE,0BAGF,yCACE,0BAGF,yCACE,0BAGF,kEACE,0BAGF,sCACE,kBAGF,qCACE,qBACA,gBAGF,0CACE,oBAGF,6CACE,OACA,iBACA,iBACA,gBACA,iBACA,mBACA,6CAEA,0DACE,0BAKN,4BACE,iDAGF,iGACE,mCAGF,sCACE,+BAEA,yGACE,WACA,qBACA,iCACA,YAIJ,kDACE,aAGF,+BACE,gBACA,kBACA,kBACA,eACA,gBACA,0BAEA,uCACE,6BAGF,4CACE,gBAGF,kDACE,eAKF,iEACE,wBAMA,2DACE,yBACA,UACA,8BAKN,0BACE,yBAGE,4CACE,kDAIJ,8CACE,oBAMF,8IAEE,sBACA,uBAIJ,uBACE,yBAEA,4CACE,iBAIJ,uBACE,qBACA,wCAEA,4CACE,kBAIA,8DACE,yBAKN,2CACE,qBACA,cACA,wBACA,kBACA,sBACA,2BAEA,sDACE,wDACA,kBAIJ,yDACE,kDACA,mDACA,4DAGF,mCACE,4BACA,6BAGF,yCACE,6BAEA,uEACE,oBACA,kBACA,YACA,4BACA,8BACA,gBACA,yCACA,4CAEA,oFACE,kBAIJ,sDACE,mBAOJ,0DACE,aACA,uBACA,mBAEA,kFACE,eAEA,wGACE,yBAKN,8DACE,sBAGF,gdAME,oBACA,qBAGF,oEACE,sBAGF,sTAIE,mBACA,wBAIF,4HAEE,sBAGF,8DACE,aACA,mBACA,uBAEA,oFACE,WACA,mBACA,+CAIJ,gIACE,kBACA,aACA,mBACA,uBACA,WACA,WACA,yBAEA,wJACE,UAGF,4JACE,aACA,mBACA,uBACA,eACA,gBACA,kBACA,2BAIJ,8DACE,iBAGF,kEACE,iBAGF,kKAEE,2BACA,WACA,iBACA,kBACA,cACA,aACA,UACA,kBACA,qBACA,qBAGF,kHACE,0BACA,oBACA,oBAIJ,8BACE,gBACA,gBACA,aACA,eACA,qBAEA,2CACE,mBACA,wBAEA,uDACE,kBAIJ,uCACE,eAGF,6CACE,aACA,uBACA,2BACA,cAEA,+CACE,gBAGF,8DACE,kBACA,4CAEA,yBAJF,8DAKI,8BAGF,yBARF,8DASI,kBACA,UACA,8BAKN,4CACE,mBAGF,2CACE,cACA,eACA,cAEA,uDACE,MACA,OACA,SACA,QAIJ,qCACE,qBACA,kBAEA,gDACE,wDACA,kBAKF,uDACE,gBAIJ,2CACE,eACA,iBAEA,0DACE,YAGF,yDACE,gBACA,kBAGF,+DACE,gBAGF,kDACE,WACA,YAIJ,2CACE,eACA,iBACA,gBAEA,wDACE,mBAGF,+DACE,gBAGF,kDACE,WACA,YAIJ,2CACE,eACA,mBACA,gBAEA,wDACE,kBAGF,+DACE,gBAGF,kDACE,WACA,YAIJ,iDACE,wCACA,0CAGF,2CACE,4CACA,8CAEA,0DACE,mBAEA,2EACE,mBAEA,yBAHF,2EAII,cACA,UACA,gCAOV,mBAiCE,8DACA,+DACA,iEACA,kEAnCA,yCAEE,oBAGF,uDACE,kBACA,kBACA,qBAEA,+DACE,WACA,cACA,kBACA,MACA,SACA,YACA,UACA,+BACA,kBAGF,gEACE,6BAEA,wEACE,UACA,aAUN,gCACE,oBACA,gCAIJ,qBACE,qBAGF,kBACE,oCACA,qBACA,sBACA,eACA,qBAEA,2EACE,0CACA,0BAIJ,mCACE,wBACA,gCACA,qBACA,SACA,gBACA,kBACA,uhB;ACjuBF,iBACE,WACA,YACA,aACA,mBACA,uBACA,kBAEA,0BACE,oBACA,sBACA,mBACA,gCACA,cACA,oBACA,qBACA,WAGF,wBACE,gBACA,gBAGF,8BACE,mBACA,gBAGF,0BACE,mBACA,aACA,YACA,eAEA,qCACE,aACA,Y;ACrCN,sBACE,YACA,aACA,mBACA,uBACA,mBAEA,cACE,mBACA,sBAGF,mBACE,sBACA,gCACA,gBACA,oBACA,qBACA,WACA,+BAEA,gBACE,oBAIJ,eACE,eACA,qBACA,kBACA,uBACA,0BAGF,kBACE,SACA,UACA,gBACA,uBACA,8BAGF,kBACE,kBACA,UACA,gBACA,uBACA,gBACA,yCAEA,WACE,wBACA,C;AClDN,aACE,OACA,WACA,oBAEA,qBACA,gBACA,kBACA,gBvBFA,+BuBNF,avBOI,mBAGA,mBuBCF,iCACE,sIAGF,wBAfF,aAgBI,0CACA,mBAEA,gCACE,0CACA,uBAIJ,yCACE,aAGF,iCACE,WACA,0CACA,gBACA,cACA,aACA,yBACA,sBACA,6BAEA,wDACE,4BAGF,yBAdF,iCAeI,YACA,wBAEA,UAIJ,yBACE,gBAEA,uCACE,mBAIJ,yDACE,gBAEA,qFACE,uBAEA,yBAHF,qFAII,uBAGF,iHACE,uBAKN,kDAEE,kBAEA,UACA,mBACA,+CAEA,wEACE,qBACA,UAKF,wEACE,eAGF,kEACE,WACA,kBACA,eACA,kBACA,WACA,YACA,gBACA,WAEA,UACA,4CAEA,gHACE,2BAKF,0GACE,kBAKF,4GACE,eAIJ,kFAEE,2BAOA,wWACE,WAKN,oBACE,WACA,YACA,aACA,mBACA,uBAGF,6GAIE,kBAEA,iIACE,qBACA,gCACA,WACA,0DACA,gBACA,iBACA,gBACA,mBACA,sBAEA,0WAEE,yDAGF,qLACE,2BACA,kDACA,mDACA,4DAKF,qJACE,cACA,gBAIA,kTACE,2CAGF,sUACE,iDAMR,0BACE,gBACA,mBACA,6BACA,oBACA,UACA,4BAEA,iEACE,UAEA,sEACE,oBAIJ,iDACE,gBAGF,sCACE,eAGF,+BACE,oBAIJ,sDACE,gBACA,YAGF,0BACE,gBAGF,kDACE,wBAGF,4CACE,YAGF,+DAEE,iBACA,oBAIA,yCACE,eAEA,+CACE,0BAKN,yCACE,mBAGF,0BArQF,aAsQI,WACA,+BACA,6CAEA,iCACE,6CAGF,oCACE,gBAGF,qCACE,kEAGF,0NAGE,6CAEA,sRACE,YAKN,yBAjSF,aAkSI,6CAEA,gDACE,+BAGF,sCACE,wGAKF,+CACE,QAIF,iCANF,4BAOI,uBACA,sB;ACvTN,kBACE,wBAEA,kBACA,8BACA,WACA,UACA,6BACA,6EACA,oCACA,oBAEA,yCACE,0BAEA,wBAGF,yBAlBF,kBAmBI,YACA,eAGF,wBACE,aACA,sBACA,mBAEA,gCACE,iDAEA,kCACE,kBAIJ,0BAbF,wBAcI,wBAEA,6CAEA,+CACE,2BAGF,gDACE,4DAIJ,yBACE,gCACE,eACA,iBAKN,2BACE,wBACA,UACA,mBAEA,uCACE,2BAIJ,gCACE,iBACA,cACA,iBACA,qBACA,kBACA,mBACA,gBACA,kBAEA,kBACA,YACA,cAEA,8BACA,WAEA,oBAEA,yBAnBF,gCAoBI,YACA,YAIJ,yBACE,2CACE,oG;AC9FJ,yBACE,sBACA,gBACA,iDAGF,0BACE,aACA,sBACA,yBACA,gBACA,cAEA,yBAPF,0BAQI,iBAGF,+BACE,aACA,mBAGF,oCACE,mBAGF,kCACE,OACA,WACA,YACA,qBACA,kDACA,sCACA,mCACA,2BACA,gBACA,oBAEA,wCACE,WACA,wCACA,sCAIJ,0CACE,oB;AC/CN,yBACE,gBACA,wDAEA,mEACE,aAGF,oCACE,oBAGF,gDACE,2BAGF,6BACE,aACA,mBACA,sBACA,qBAGF,qCACE,cACA,2BACA,aACA,gBACA,wBACA,UACA,kBAEA,yBATF,qCAUI,gB;ACjCN,gBACE,gBACA,wDAsBA,qCApBA,uCACE,2BAGF,0DACE,aAGF,2BACE,oBAIF,oBACE,aACA,mBACA,sBACA,qBAKF,yCACE,kBAGF,4BACE,cACA,2BACA,aACA,gBACA,wBACA,UACA,kBAEA,yBATF,4BAUI,gBAIJ,yBACE,YACA,mCACA,gCAEA,iCACE,UACA,cAGF,iDACE,aAGF,gFAEE,OACA,eACA,gBAGF,qCACE,mBACA,uBAGF,2CACE,gBACA,mBACA,uB;ACvEN,UACE,qBAEA,oDACE,kBACA,mBACA,SAEA,yBALF,oDAMI,oBAGF,4DACE,eAEA,yBAHF,4DAII,YAIJ,kEACE,UAIJ,wBACE,kBAGF,kBACE,cACA,kBAEA,yBAJF,kBAKI,eACA,iBAGF,kGAGE,kBAIA,qIAEE,2BAIJ,yBACE,kBACA,UAEA,+DACE,mCAIJ,4BACE,kBACA,UACA,0BAIA,kCACE,iCAGF,+EAEE,0CAKF,8CACE,iCAGF,yEAEE,0CAKF,8EAEE,0CAGF,mCACE,iCAIJ,8BACE,kCAIA,8UACE,kCAKN,qCACE,eACA,gBACA,kBAEA,mJAGE,kBAGF,8CACE,uBAGF,iDACE,iCAGF,kGACE,0CAGF,iDACE,kCAIA,yDACE,iCAGF,2HACE,0CAKF,gEACE,iCAGF,uHACE,0CAMR,iBACE,YACA,4BACA,mCACA,4CACA,6BACA,iDACA,kBACA,UAEA,+BACE,kBACA,kBACA,gBACA,eACA,eACA,yBACA,0BAEA,uCACE,6BAIJ,yBAxBF,iBAyBI,6BAIJ,uBACE,aAEA,gCACE,kBACA,uBACA,qBAGF,+BACE,cACA,2BACA,aACA,cACA,SACA,UACA,oBAEA,uCACE,kBAGF,yBAbF,+BAcI,eACA,gBAEA,uCACE,wBAIJ,4CACE,sCAGA,0GACE,yCAIJ,yDACE,WACA,kBACA,WACA,aACA,8CACA,uBACA,YACA,aACA,kBACA,qCACA,mEACA,yBAZF,yDAaI,UACA,aAKN,oCACE,YACA,gBAGF,wCACE,qBACA,kBACA,mBACA,cACA,0BAEA,+CACE,WACA,WACA,YACA,8BACA,kBACA,kBACA,QACA,gBACA,eAGF,yBAnBF,wCAoBI,gBACA,sBAKN,wCAEE,kBAEA,oEACE,qIACA,gBACA,kBACA,iFACA,uBACA,mBACA,0CAEA,4LAEE,gHAGF,wFACE,gBACA,kBAIA,4OACE,aAIJ,kGACE,oBAIJ,4JAEE,kBACA,gCACA,oBACA,uBACA,mBACA,mBACA,0CACA,kEACA,YAGF,gFACE,uBACA,OACA,mBACA,gBACA,eACA,uBAGF,8FACE,QAGF,4EACE,oCACA,eACA,qBAEA,8QACE,0CAIJ,sDACE,kBACA,MACA,OACA,UACA,oBACA,YACA,uBACA,mBAIJ,oBACE,YAEA,kCACE,gBACA,kCACA,uBACA,2BACA,2BACA,8BACA,kBACA,iBACA,mBACA,wEAUA,6BARA,yBAZF,kCAaI,gBACA,oBACA,iBACA,0EACA,eAKF,yDACE,2BAIJ,8EAEE,kEAEA,yBAJF,8EAKI,qEAKF,mDACE,eACA,gBAMF,+KACE,kBAIJ,2BACE,cACA,eACA,kBACA,iBACA,oBAKF,kCACE,eACA,mBACA,iBAGF,sCACE,gBACA,eAIJ,kBACE,kBACA,0BACA,OACA,WACA,mCACA,4CACA,gBACA,iBAEA,kBACA,gBAGA,iDAEA,UACA,6BACA,wBACA,6E5BhcA,+B4B6aF,kB5B5aI,mBAGA,mB4B8bF,8BACE,aAGF,uBACE,UACA,wBAGF,2BACE,c;ACpdJ,kBACE,kBACA,MACA,OACA,SACA,QACA,gBACA,WAEA,mDAEE,WACA,cACA,kBACA,MACA,OACA,SACA,QACA,+CAGF,yBASE,2BACA,4BACA,sBAVA,sCACE,yDAEA,yBAHF,sCAII,0DAQJ,4DACE,oEAGF,gDACE,gBAIJ,gEACE,UAGF,0CACE,qDACA,YACA,qBAGF,kDACE,kBAGF,sCACE,gDACE,6BACA,gBACA,mBACA,6BACA,6CAGF,wEACE,kCAKN,cACE,aACA,uBACA,YACA,kBACA,UAEA,yBAPF,cAQI,iBAGF,+BACE,wDAEA,aACA,sBACA,mBACA,WACA,YACA,kBACA,gBAEA,2CACE,WACA,YACA,gBAEA,+CACE,aACA,sBACA,mBAMJ,wCACE,WACA,aACA,4CACA,mCACA,kCACA,kBACA,iDAKF,yCACE,kCACA,kGAEA,iDACE,mCACA,8CAIA,wIACE,2BAKN,+EACE,UACA,4CAEA,6HACE,2BAIJ,gCACE,UACA,mBACA,+EAEA,uDACE,2BAIJ,2EACE,oBAIA,6DACE,SAGF,qDACE,6FACA,yDAEA,6DACE,sCAIJ,2DACE,yBAEA,yBAHF,2DAII,0BAIJ,uGACE,UAGF,4CACE,qBACA,qBAKN,kCACE,oBACA,8CAEA,iEACE,UACA,4CAEA,wFACE,2BAIJ,yDACE,2BAGF,8CACE,kDACA,oBAEA,6EACE,UAKN,oCACE,WACA,0CACA,eACA,kBACA,aACA,qBACA,+BAEA,+BACA,6CAEA,2DACE,2BAGF,0BAhBF,oCAiBI,6CAEA,4DACE,mEAIJ,yBAxBF,oCAyBI,gBAEA,6DACE,wGAIJ,4CACE,WACA,kBACA,eACA,OACA,QACA,WACA,qJACA,UACA,8BAEA,yBAXF,4CAYI,SACA,WAIJ,uDACE,UAGF,4DACE,qJAMN,oDAGE,sBAEA,yBALF,oDAMI,qBAIJ,sEAIE,WACA,aACA,uBACA,kBAMA,iIACE,8DAIJ,wBACE,WACA,aACA,uBACA,kBACA,uBAEA,0CACE,0BACA,yBACA,cACA,iBACA,oBACA,+EAGE,4DACE,yBAIJ,oFACE,gBACA,4CAGF,yBAnBF,0CAoBI,eAGF,sDACE,+BACA,yBACA,kCACA,iBACA,sBAIJ,yBAvCF,wBAwCI,uBAGF,qDACE,sB;AC/VJ,aACE,aACA,mBACA,4BACA,uBACA,oBAEA,yBAPF,aAQI,eAGF,2BACE,cAGF,yBACE,OACA,YAEA,6BACE,aACA,mBAIJ,gBACE,gBACA,kBACA,gBACA,qBAGF,oBACE,aACA,iBAGF,0BACE,iBAEA,yBAHF,0BAII,mBAIJ,2BACE,iB;AC5CJ,SACE,YACA,aACA,sBAEA,kBACA,iDANF,S/BOI,mBAGA,mB+BDF,iCACE,oBAEA,gDACE,2BAIJ,kCACE,4BACA,2EACA,8DAEA,0CACE,gBAGF,yDACE,iBACA,oCAGF,4CACE,iBAGA,sDACE,cACA,kBAKN,+BACE,UAIJ,cACE,aACA,8BAEA,uBACE,mCACA,SACA,UAEA,4BACE,oBACA,8BACE,aAKN,0BACE,OAIA,kCACE,YACA,iBACA,aACA,uBACA,uBAEA,2CACE,wBAIJ,kCACE,aACA,qCACA,mBACA,kBAGF,sCACE,gBAEA,kDACE,mBAIJ,kCACE,gBAEA,8GAEE,aAIJ,kCACE,gBAGE,wDACE,MACA,OACA,aACA,mBACA,uBAGF,gDACE,qBAKN,oCACE,mBAEA,yBAHF,oCAII,gBACA,kEACE,U;ACnIV,gBACE,YACA,gBACA,kBAEA,sBACE,YACA,gB;ACPJ,aACE,kBACA,MACA,QACA,gCACA,YACA,uDACA,mCACA,2CACA,8BAEA,6CAEA,oCACE,gBAKA,qFACE,wBAIJ,0BAxBF,aAyBI,8DACA,kBAGF,yBA7BF,aA8BI,YACA,oCAGF,yBACE,yCACA,gBAGF,4CACE,iBACA,cACA,kBAEA,oDACE,oBAEA,6DACE,0BAIJ,mDACE,aACA,uBACA,mBAEA,sDACE,gBACA,kBACA,iBACA,qBACA,sBAGF,iEACE,mBACA,oBAGF,0DACE,aACA,cACA,uBAIJ,oDACE,kBACA,cAKN,qBACE,kBACA,MACA,OACA,QACA,SACA,8BACA,gBACA,kBACA,oBAEA,0BAXF,qBAYI,gBAGF,+BACE,aAGF,uCACE,kBACA,MACA,QACA,SACA,OACA,WACA,gBACA,UAEA,yBAVF,uCAWI,2CAEA,8DACE,iBAKN,8FACE,mBAIA,yBACE,+DACE,uCAIJ,0DACE,oBACA,+B;ACvIN,MACE,aACA,YACA,gBACA,gBAEA,0BANF,MAOI,mBAGF,yBAVF,MAWI,mCAIJ,YACE,OACA,gBACA,kBACA,YAEA,yBANF,YAOI,mCAGF,0BAVF,YAWI,4CAGF,0BAdF,YAeI,QAGF,yBAlBF,YAmBI,eACA,OACA,MACA,kCACA,cAEA,mCACA,6CAEA,mCACE,gBAGF,mBACE,WACA,cACA,kBACA,OACA,MACA,QACA,SACA,gBACA,sCACA,2CACA,UAEA,0CACE,gBAIF,mCACE,aAGF,wDACE,cAIJ,2CACE,+BAEA,kDACE,UACA,oBAIJ,6CACE,gBAEA,mDACE,iBAKN,yBA7EF,YA8EI,eACA,YACA,oCAKF,0BADF,aAEI,6CAGF,yBALF,aAMI,yCAGF,8CACE,gBAEA,gEACE,gBAKN,mDACE,gBAGF,cACE,OACA,2CACA,eAEA,0BALF,cAMI,iCAGF,4BATF,cAUI,gBAGF,0BAbF,cAcI,4CACA,kCAGF,yBAlBF,cAmBI,eACA,eACA,OACA,MACA,SACA,QAEA,+BACA,6CAEA,qCACE,gBAGF,6CACE,sCAIJ,yBAtCF,cAuCI,iBAEA,6CACE,mCAGF,sCACE,oCAIJ,+CACE,gBAEA,qDACE,gBAKN,kCACE,sCAEA,6IACE,6EAIA,gFACE,aAKF,+EACE,kCACA,UAKF,uEACE,+BACA,UAKF,8EACE,aAKF,6EACE,kCACA,UAKF,wEACE,+BACA,U","sources":["webpack://telegram-t/./src/components/left/main/LeftMainHeader.scss","webpack://telegram-t/./src/styles/_mixins.scss","webpack://telegram-t/./src/components/left/ConnectionState.scss","webpack://telegram-t/./src/components/left/NewChatButton.scss","webpack://telegram-t/./src/components/left/main/LeftMain.scss","webpack://telegram-t/./src/components/left/LeftColumn.scss","webpack://telegram-t/./src/components/middle/AudioPlayer.scss","webpack://telegram-t/./src/components/middle/MiddleHeader.scss","webpack://telegram-t/./src/components/common/EmbeddedMessage.scss","webpack://telegram-t/./src/components/middle/message/MessageMeta.scss","webpack://telegram-t/./src/components/middle/message/Sticker.scss","webpack://telegram-t/./src/components/middle/message/Contact.scss","webpack://telegram-t/./src/components/middle/message/PollOption.scss","webpack://telegram-t/./src/components/middle/message/Poll.scss","webpack://telegram-t/./src/components/middle/message/WebPage.scss","webpack://telegram-t/./src/components/middle/message/Invoice.scss","webpack://telegram-t/./src/components/middle/message/Album.scss","webpack://telegram-t/./src/components/middle/message/RoundVideo.scss","webpack://telegram-t/./src/components/middle/message/InlineButtons.scss","webpack://telegram-t/./src/components/middle/message/CommentButton.scss","webpack://telegram-t/./src/components/middle/message/Message.scss","webpack://telegram-t/./src/components/middle/message/_message-content.scss","webpack://telegram-t/./src/components/middle/ContactGreeting.scss","webpack://telegram-t/./src/components/middle/NoMessages.scss","webpack://telegram-t/./src/components/middle/MessageList.scss","webpack://telegram-t/./src/components/middle/ScrollDownButton.scss","webpack://telegram-t/./src/components/middle/composer/BotKeyboardMenu.scss","webpack://telegram-t/./src/components/middle/composer/ComposerEmbeddedMessage.scss","webpack://telegram-t/./src/components/middle/composer/WebPagePreview.scss","webpack://telegram-t/./src/components/middle/composer/Composer.scss","webpack://telegram-t/./src/components/middle/MiddleColumn.scss","webpack://telegram-t/./src/components/right/RightHeader.scss","webpack://telegram-t/./src/components/right/Profile.scss","webpack://telegram-t/./src/components/right/AddChatMembers.scss","webpack://telegram-t/./src/components/right/RightColumn.scss","webpack://telegram-t/./src/components/main/Main.scss"],"sourcesContent":["@import '../../../styles/mixins';\n\n#LeftMainHeader {\n position: relative;\n\n .animated-menu-icon {\n position: absolute;\n\n &, &::before, &::after {\n width: 1.125rem;\n height: 0.125rem;\n border-radius: 0.125rem;\n background-color: var(--color-text-secondary);\n transition: transform .25s;\n transform: rotate(0);\n }\n\n &::before, &::after {\n position: absolute;\n left: 0;\n content: '';\n }\n\n &::before {\n top: -0.3125rem;\n }\n\n &::after {\n top: 0.3125rem;\n }\n\n &.state-back {\n transform: rotate(180deg);\n\n &::before {\n transform: rotate(45deg) scaleX(0.75) translate(0.375rem, -0.1875rem);\n }\n\n &::after {\n transform: rotate(-45deg) scaleX(0.75) translate(0.375rem, 0.1875rem);\n }\n }\n\n &.no-animation {\n transition: none;\n\n &::before, &::after {\n transition: none;\n }\n }\n }\n\n .archived-badge {\n min-width: 1.5rem;\n height: 1.5rem;\n margin-left: auto;\n background: var(--color-gray);\n border-radius: 0.75rem;\n padding: 0 .45rem;\n color: white;\n font-size: 0.875rem;\n line-height: 1.5rem;\n font-weight: 500;\n text-align: center;\n flex-shrink: 0;\n }\n\n [dir=rtl] .archived-badge {\n margin-left: 0;\n margin-right: auto;\n }\n\n .Menu .bubble {\n min-width: 17rem;\n max-height: calc(100 * var(--vh) - 3.75rem);\n\n overflow-y: auto;\n @include overflow-y-overlay();\n }\n\n // @optimization\n @include while-transition() {\n .Menu .bubble {\n transition: none !important;\n }\n }\n}\n","// @optimization\n@mixin while-transition() {\n .Transition > div:not(.active) &, body.animating-right-column & {\n @content;\n }\n}\n\n@mixin overflow-y-overlay() {\n @supports (overflow-y: overlay) {\n overflow-y: overlay;\n\n //Workaround for Android <= 9\n overflow-x: hidden;\n }\n}\n","#ConnectionState {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n margin: 0 0.5rem 0.5rem;\n padding: 0.75rem;\n background: var(--color-yellow);\n border-radius: var(--border-radius-default);\n\n > .Spinner {\n --spinner-size: 1.75rem;\n }\n\n > .state-text {\n color: var(--color-text-lighter);\n font-weight: 500;\n line-height: 2rem;\n margin-inline-start: 1.875rem;\n white-space: nowrap;\n }\n\n @media (max-width: 950px) {\n > .state-text {\n margin-inline-start: 1.25rem;\n }\n }\n}\n",".NewChatButton {\n position: absolute;\n right: 1rem;\n bottom: 1rem;\n transform: translateY(5rem);\n\n transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);\n\n body.animation-level-0 & {\n transform: none !important;\n opacity: 0;\n\n transition: opacity .15s;\n\n &.revealed {\n opacity: 1;\n }\n }\n\n &.revealed {\n transform: translateY(0);\n @media (max-width: 600px) {\n // Force rendering in the composite layer to fix the z-index rendering issue\n transform: translate3d(0,0,10px);\n transform-style: preserve-3d;\n }\n }\n\n &.menu-is-open {\n &::before {\n content: '';\n display: block;\n position: absolute;\n top: -13rem;\n left: -11rem;\n right: -1rem;\n bottom: -1rem;\n z-index: -1;\n }\n }\n\n .is-touch-env & {\n .Menu > .backdrop {\n position: absolute;\n left: -100vw;\n right: -100vw;\n top: -100vh;\n bottom: -100vh;\n }\n }\n\n > .Button {\n .icon-new-chat-filled,\n .icon-close {\n position: absolute;\n }\n\n &:not(.active) {\n .icon-new-chat-filled {\n animation: grow-icon .4s ease-out;\n }\n\n .icon-close {\n animation: hide-icon .4s forwards ease-out;\n }\n }\n\n &.active {\n .icon-close {\n animation: grow-icon .4s ease-out;\n }\n\n .icon-new-chat-filled {\n animation: hide-icon .4s forwards ease-out;\n }\n }\n }\n}\n","#LeftColumn-main {\n height: 100%;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n z-index: 1;\n\n .connection-state-wrapper {\n position: absolute;\n top: 3.75rem;\n width: 100%;\n }\n\n > .Transition {\n flex: 1;\n overflow: hidden;\n transition: transform 300ms ease;\n\n &.pull-down {\n transform: translateY(3.75rem);\n }\n }\n\n .ChatFolders {\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n\n .tabs-placeholder {\n height: 2.625rem;\n transition: height 150ms ease;\n\n &:not(.open) {\n height: 0;\n }\n }\n\n .TabList {\n justify-content: flex-start;\n padding-left: .5625rem;\n padding-bottom: 1px;\n border-bottom: 0;\n z-index: 1;\n }\n\n .Tab {\n flex: 0 0 auto;\n padding-left: 0.625rem;\n padding-right: 0.625rem;\n\n > span {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n }\n }\n\n > .Transition {\n flex: 1;\n overflow: hidden;\n }\n }\n\n .RecentContacts, .LeftSearch, .search-content {\n height: 100%;\n overflow-y: auto;\n }\n\n .btn-update {\n position: absolute;\n bottom: 1rem;\n left: 1rem;\n right: 1rem;\n margin: 0 auto;\n }\n}\n","#LeftColumn {\n overflow: hidden;\n}\n\n#NewChat {\n height: 100%;\n}\n\n.left-header {\n height: var(--header-height);\n padding: 0.375rem 1.25rem .5rem 0.8125rem;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n background-color: var(--color-background);\n\n h3 {\n margin-bottom: 0;\n font-size: 1.25rem;\n font-weight: 500;\n margin-left: 1.375rem;\n margin-right: auto;\n }\n\n .SearchInput {\n margin-left: 0.875rem;\n max-width: calc(100% - 3.625rem);\n\n @media (max-width: 600px) {\n max-width: calc(100% - 3.375rem);\n }\n }\n\n @media (max-width: 600px) {\n padding: 0.5rem;\n }\n\n .Button.smaller {\n width: 2.5rem;\n height: 2.5rem;\n\n + .DropdownMenu {\n margin-left: .25rem;\n }\n }\n}\n",".AudioPlayer {\n display: flex;\n margin-left: auto;\n margin-top: -.25rem;\n margin-bottom: -.25rem;\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n > .Button {\n flex-shrink: 0;\n margin: .125rem;\n }\n\n > .toggle-play {\n --color-text-secondary: var(--color-primary);\n --color-text-secondary-rgb: var(--color-primary-shade-rgb);\n --color-primary-shade: var(--color-green);\n --color-white: var(--color-background-own);\n }\n\n .MiddleHeader & + .HeaderActions {\n margin-left: 1.5rem;\n }\n\n .toggle-play {\n &.smaller {\n width: 3rem;\n height: 3rem;\n\n i {\n font-size: 1.625rem;\n margin-top: -.025rem;\n }\n }\n\n i {\n position: absolute;\n font-size: 1.9375rem;\n margin-top: -.05rem;\n\n &.icon-play {\n margin-left: .1rem;\n }\n }\n\n .icon-play, .icon-pause {\n opacity: 1;\n transform: scale(1);\n transition: opacity .4s, transform .6s cubic-bezier(0.34, 1.56, 0.64, 1);\n }\n\n &.play .icon-pause,\n &.pause .icon-play,\n &.loading .icon-play,\n &.loading .icon-pause {\n opacity: 0;\n transform: scale(.5);\n }\n }\n\n &-content {\n display: flex;\n justify-content: center;\n flex-direction: column;\n flex-shrink: 1;\n padding: .25rem .5rem;\n position: relative;\n overflow: hidden;\n cursor: pointer;\n max-width: 15rem;\n border-radius: var(--border-radius-messages-small);\n\n &:hover {\n background-color: var(--color-interactive-element-hover);\n }\n\n @media (min-width: 1440px) and (max-width: 1500px) {\n max-width: 14rem;\n }\n\n .AudioPlayer & .title {\n display: block;\n font-weight: 500;\n font-size: 0.875rem !important;\n line-height: 1rem;\n height: 1rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n body.is-ios & {\n font-size: .9375rem !important;\n line-height: .8125rem;\n }\n }\n\n .subtitle {\n font-size: 0.85rem !important;\n color: var(--color-text-secondary);\n line-height: 1.125rem;\n height: 1.125rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: .125rem 0 0;\n\n body.is-ios & {\n font-size: .9375rem !important;\n }\n }\n }\n}\n","@import '../../styles/mixins';\n\n@mixin mobile-header-styles() {\n .HeaderPinnedMessage-wrapper,\n .AudioPlayer {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n height: 2.875rem;\n overflow: hidden;\n box-shadow: 0 2px 2px var(--color-light-shadow);\n\n display: flex;\n flex-direction: row-reverse;\n padding: 0.375rem 0.5rem;\n padding-left: 0.75rem;\n background: var(--color-background);\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: -.1875rem;\n left: 0;\n right: 0;\n height: .125rem;\n box-shadow: 0 .125rem .125rem var(--color-light-shadow);\n }\n\n .HeaderPinnedMessage {\n max-width: unset;\n margin-top: -0.1875rem;\n }\n }\n\n .AudioPlayer {\n height: 3.25rem;\n\n flex-direction: row;\n padding: 0.375rem 0.5rem;\n\n &-content {\n padding: 0 0.5rem;\n flex-grow: 1\n }\n\n > .Button {\n margin: 0;\n }\n\n > .player-close {\n margin-left: auto;\n }\n }\n\n .HeaderPinnedMessage {\n flex-grow: 1;\n padding-top: 0;\n padding-bottom: 0;\n\n &::before {\n top: 0.125rem;\n bottom: 0.125rem;\n }\n\n .message-text {\n max-width: none;\n }\n }\n}\n\n.MiddleHeader {\n display: flex;\n align-items: center;\n width: 100%;\n box-shadow: 0 2px 2px var(--color-light-shadow);\n background: var(--color-background);\n padding: .5rem .8125rem .5rem 1.5rem;\n position: relative;\n z-index: var(--z-middle-header);\n\n @media (max-width: 600px) {\n padding: 0.5rem;\n position: relative;\n // Force rendering in the composite layer to fix the z-index rendering issue\n transform: translate3d(0, 0, 10px);\n transform-style: preserve-3d;\n }\n\n .Transition {\n width: 100%;\n // https://dfmcphee.com/flex-items-and-min-width-0/\n // https://stackoverflow.com/questions/36247140/why-dont-flex-items-shrink-past-content-size\n min-width: 0;\n\n > div {\n display: flex;\n align-items: center;\n width: 100%;\n }\n }\n\n .back-button {\n margin-left: -0.5rem;\n margin-right: 0.5rem;\n position: relative;\n\n @media (max-width: 600px) {\n margin-left: 0;\n }\n\n .unread-count {\n min-width: 1.25rem;\n height: 1.25rem;\n padding: 0 0.375rem;\n border-radius: 0.625rem;\n font-size: 0.75rem;\n line-height: 1.25rem;\n font-weight: 500;\n text-align: center;\n\n position: absolute;\n top: -0.25rem;\n right: -0.5rem;\n\n background: var(--color-gray);\n color: white;\n pointer-events: none;\n\n &.active {\n background: var(--color-primary);\n }\n }\n }\n\n .chat-info-wrapper {\n flex-grow: 1;\n overflow: hidden;\n }\n\n .header-tools {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-left: auto;\n flex-shrink: 0;\n\n body.animation-level-0 & {\n &,\n .HeaderPinnedMessage-wrapper,\n .AudioPlayer,\n .HeaderActions {\n transition: none !important;\n }\n }\n\n @media (min-width: 1276px) and (max-width: 1439px) {\n .HeaderActions {\n transform: translate3d(0, 0, 0);\n transition: transform var(--layer-transition);\n\n #Main.right-column-open & {\n transform: translate3d(calc(var(--right-column-width) * -1), 0, 0);\n }\n }\n }\n\n @media (min-width: 1440px) {\n transform: translate3d(0, 0, 0);\n transition: transform var(--layer-transition);\n\n #Main.right-column-open & {\n transform: translate3d(calc(var(--right-column-width) * -1), 0, 0);\n }\n }\n\n // @optimization\n @include while-transition() {\n pointer-events: none;\n }\n }\n\n @media (min-width: 1276px) and (max-width: 1439px) {\n &:not(.tools-stacked) .header-tools {\n .HeaderPinnedMessage-wrapper,\n .AudioPlayer {\n opacity: 1;\n\n #Main.right-column-open & {\n opacity: 0;\n }\n }\n }\n }\n\n &.tools-stacked .header-tools {\n @include mobile-header-styles();\n\n @media (min-width: 1150px) {\n #Main.right-column-open & {\n .HeaderPinnedMessage-wrapper,\n .AudioPlayer {\n padding-right: calc(0.5rem + var(--right-column-width));\n }\n }\n }\n }\n\n &.tools-stacked.animated .header-tools {\n .HeaderPinnedMessage-wrapper,\n .AudioPlayer {\n animation: fade-in var(--layer-transition) forwards;\n\n body.animation-level-0 & {\n animation: none;\n }\n }\n }\n\n h3 {\n font-weight: 500;\n font-size: 1.125rem;\n line-height: 1.375rem;\n white-space: pre;\n margin: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n unicode-bidi: plaintext;\n\n body.is-ios &,\n body.is-macos & {\n font-size: 1.0625rem;\n font-weight: 600;\n }\n\n @media (max-width: 600px) {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n @media (min-width: 1275px) {\n #Main.right-column-open & {\n max-width: calc(100% - var(--right-column-width));\n }\n }\n }\n\n .ChatInfo {\n cursor: pointer;\n display: flex;\n align-items: center;\n\n .info {\n display: flex;\n flex-direction: column;\n justify-content: center;\n flex-grow: 1;\n overflow: hidden;\n }\n\n .title {\n display: flex;\n align-items: center;\n\n .VerifiedIcon {\n width: 1.25rem;\n height: 1.25rem;\n margin-left: 0.25rem;\n margin-top: 0.05rem;\n }\n }\n\n .user-status, .status {\n unicode-bidi: plaintext;\n }\n }\n\n .Avatar {\n margin-right: .625rem;\n width: 2.5rem;\n height: 2.5rem;\n font-size: 1.0625rem;\n }\n\n .status, .typing-status {\n font-size: 0.875rem;\n line-height: 1.125rem;\n margin: 0;\n color: var(--color-text-secondary);\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n display: inline-block;\n\n .ellipsis {\n display: inline-flex;\n }\n\n &.online {\n color: var(--color-primary);\n }\n\n .font-emoji {\n line-height: 1rem;\n }\n }\n\n .Button.smaller {\n width: 2.5rem;\n height: 2.5rem;\n }\n\n .HeaderPinnedMessage-wrapper {\n display: flex;\n align-items: center;\n margin-left: auto;\n cursor: default;\n flex-direction: row-reverse;\n\n body.animation-level-1 & {\n .ripple-container {\n display: none;\n }\n }\n\n .HeaderPinnedMessage {\n min-width: 16rem;\n }\n\n > .Button {\n flex-shrink: 0;\n }\n }\n\n .HeaderPinnedMessage {\n display: flex;\n flex-shrink: 1;\n margin-top: -0.25rem;\n margin-bottom: -0.25rem;\n padding: 0.25rem;\n padding-left: 0.375rem;\n border-radius: var(--border-radius-messages-small);\n position: relative;\n overflow: hidden;\n cursor: pointer;\n\n &:hover {\n background-color: var(--color-interactive-element-hover);\n }\n\n .pinned-message-border {\n position: relative;\n height: 2.25rem;\n margin: 0.125rem 0;\n width: 0.125rem;\n min-width: 0.125rem;\n overflow: hidden;\n\n .pinned-message-border-wrapper-1 {\n height: 2.25rem;\n width: 0.125rem;\n border-radius: 0.0625rem;\n background: var(--color-primary);\n }\n\n .pinned-message-border-wrapper {\n background-color: var(--color-primary-opacity);\n position: relative;\n will-change: transform;\n transition: transform .25s ease-in-out;\n }\n\n .pinned-message-border-mark {\n position: absolute;\n left: 0;\n top: 0;\n width: 0.125rem;\n background: var(--color-primary);\n border-radius: 0.0625rem;\n will-change: transform;\n transition: transform .25s ease-in-out;\n }\n }\n\n .message-text {\n overflow: hidden;\n margin-inline-start: 0.375rem;\n margin-top: 0.125rem;\n max-width: 15rem;\n\n @media (min-width: 1440px) and (max-width: 1500px) {\n max-width: 14rem;\n }\n\n .title {\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1rem;\n height: 1rem;\n color: var(--color-primary);\n margin-bottom: 0.125rem;\n white-space: pre;\n text-align: initial;\n\n body.is-ios & {\n font-size: .9375rem;\n }\n }\n\n p {\n font-size: 0.875rem;\n line-height: 1.125rem;\n height: 1.125rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0;\n\n body.is-ios & {\n font-size: .9375rem;\n }\n }\n }\n\n .emoji-small {\n width: 1rem;\n height: 1rem;\n }\n\n & > img {\n width: 2.25rem;\n height: 2.25rem;\n object-fit: cover;\n border-radius: 0.25rem;\n margin-inline-start: 0.375rem;\n margin-top: 0.125rem;\n flex-shrink: 0;\n\n & + .message-text {\n max-width: 12rem;\n }\n }\n }\n\n .HeaderActions {\n flex-shrink: 0;\n margin-left: auto;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n\n .toggle-right-pane-button {\n &.active {\n color: var(--color-primary);\n opacity: 1;\n }\n }\n }\n\n .HeaderPinnedMessage-wrapper, .HeaderActions {\n .Button {\n margin-left: 0.25rem;\n\n &.tiny {\n margin-right: .625rem;\n }\n }\n }\n\n @media (max-width: 600px) {\n @include mobile-header-styles();\n\n .HeaderPinnedMessage-wrapper,\n .AudioPlayer {\n // Force rendering in the composite layer to fix the z-index rendering issue\n transform: translate3d(0, 0, 0);\n }\n }\n\n @media (min-width: 925px) and (max-width: 1149.9px) {\n .HeaderPinnedMessage-wrapper,\n .AudioPlayer {\n position: absolute;\n }\n }\n}\n\n@keyframes fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n",".EmbeddedMessage {\n display: flex;\n align-items: center;\n font-size: calc(var(--message-text-size, 1rem) - .125rem);\n line-height: 1.125rem;\n margin: 0 -0.25rem .0625rem;\n padding: .1875rem 0.25rem .1875rem .4375rem;\n border-radius: var(--border-radius-messages-small);\n position: relative;\n overflow: hidden;\n cursor: pointer;\n direction: ltr;\n\n body.animation-level-1 & {\n .ripple-container {\n display: none;\n }\n }\n\n .custom-shape & {\n max-width: 15rem;\n padding: 0.5rem;\n margin: 0;\n background-color: var(--background-color);\n box-shadow: 0 1px 2px var(--color-default-shadow);\n\n &::before {\n left: .625rem;\n top: .625rem;\n bottom: .625rem;\n }\n\n img:not(.emoji) {\n margin-inline-start: .5rem;\n }\n\n &:dir(rtl) {\n padding: 0.5rem;\n }\n }\n\n &::before {\n content: '';\n display: block;\n position: absolute;\n top: .3125rem;\n bottom: .3125rem;\n left: .3125rem;\n width: 2px;\n background: var(--accent-color);\n border-radius: 2px;\n }\n\n &:hover {\n background-color: var(--hover-color);\n }\n\n &:active {\n background-color: var(--active-color);\n }\n\n .message-title {\n font-size: calc(var(--message-text-size, 1rem) - .125rem);\n }\n\n .message-text {\n overflow: hidden;\n margin-inline-start: 0.5rem;\n display: flex;\n flex-direction: column-reverse;\n\n .message-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 0.125rem;\n flex: 1;\n display: block;\n }\n\n p {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n height: 1.125rem;\n margin-bottom: 0;\n flex: 1;\n\n &::after {\n content: none;\n display: none;\n }\n }\n\n .emoji {\n width: calc(1.125 * var(--message-text-size, 1rem)) !important;\n height: calc(1.125 * var(--message-text-size, 1rem)) !important;\n vertical-align: text-bottom !important;\n }\n }\n\n .embedded-action-message {\n color: var(--accent-color);\n opacity: 0.75;\n }\n\n img:not(.emoji) {\n width: 2rem;\n height: 2rem;\n object-fit: cover;\n border-radius: .25rem;\n margin-left: .25rem;\n flex-shrink: 0;\n\n &.round {\n border-radius: 1rem;\n }\n }\n\n &.inside-input {\n padding-inline-start: 0.5625rem;\n margin: 0 0 -.125rem -0.1875rem;\n display: grid;\n grid-template-columns: auto 1fr;\n grid-template-rows: 1fr;\n width: 100%;\n --accent-color: var(--color-primary);\n --hover-color: var(--color-interactive-element-hover);\n\n &::before {\n bottom: .3125rem;\n }\n\n img:not(.emoji) {\n margin-left: .125rem;\n }\n\n .message-text {\n margin-inline-start: .375rem;\n }\n\n .message-title {\n font-weight: 500;\n color: var(--accent-color);\n }\n }\n}\n",".MessageMeta {\n position: absolute;\n height: 1.25rem;\n bottom: 0;\n right: 0;\n display: flex;\n align-items: center;\n background: rgba(#999999, 0.6);\n border-radius: .625rem;\n padding: 0 .25rem;\n color: white;\n cursor: pointer;\n max-width: 100%;\n\n .message-time,\n .message-signature,\n .message-views {\n font-size: .75rem;\n white-space: nowrap;\n }\n\n .message-time {\n margin-right: .1875rem;\n }\n\n .message-views {\n margin-left: .1875rem;\n }\n\n .message-signature {\n overflow: hidden;\n text-overflow: ellipsis;\n margin-right: 0.375rem;\n }\n\n .icon-channelviews {\n margin-left: 0.125rem;\n margin-right: 0.375rem;\n font-size: 1.125rem;\n position: relative;\n top: -0.0625rem;\n }\n\n .has-solid-background & {\n color: rgba(var(--color-text-meta-rgb), 0.75);\n background: none;\n }\n\n .media:not(.text) &,\n .Message .custom-shape & {\n background: rgba(0,0,0, 0.2);\n --color-accent-own: white;\n --color-accent: white;\n color: white !important;\n opacity: 1;\n bottom: .25rem;\n right: .25rem;\n left: auto;\n height: 1.125rem;\n padding: 0 .3125rem 0 .375rem;\n\n .MessageOutgoingStatus i {\n background: transparent;\n }\n }\n\n .media:not(.text):dir(rtl) &,\n .Message .custom-shape:dir(rtl) & {\n right: auto !important;\n left: .25rem;\n padding: 0 .375rem 0 .3125rem;\n }\n\n .is-forwarded.media:not(.text):dir(rtl) &,\n .Message .is-forwarded.custom-shape:dir(rtl) & {\n left: .8125rem;\n }\n\n .is-forwarded.media:not(.text) & {\n bottom: 0.935rem;\n right: 0.8125rem;\n }\n\n .emoji-only & {\n right: 0;\n }\n\n .Message.own .has-solid-background & {\n color: var(--color-message-meta-own);\n }\n\n .MessageOutgoingStatus {\n margin-left: -.1875rem;\n font-size: 1.1875rem;\n border-radius: .625rem;\n\n .Message.own & {\n color: var(--color-accent-own);\n }\n }\n\n .message-content.has-replies:not(.custom-shape) & {\n bottom: 3.375rem;\n }\n\n .message-content.has-replies.text:not(.custom-shape) & {\n bottom: 3.4375rem;\n }\n}\n\n.Message:not(.own) {\n .custom-shape .reply-message + .MessageMeta {\n right: auto;\n left: 13.2rem;\n bottom: 0.25rem;\n }\n\n .emoji-only-1 .reply-message + .MessageMeta {\n left: 2.5rem;\n }\n\n .emoji-only-2 .reply-message + .MessageMeta {\n left: 5.5rem;\n }\n\n .emoji-only-3 .reply-message + .MessageMeta {\n left: 6.5rem;\n }\n}\n",".Sticker {\n &:not(.inactive) {\n cursor: pointer;\n }\n\n &.inactive {\n pointer-events: none;\n }\n}\n",".Contact {\n display: flex;\n align-items: center;\n padding: 0.25rem;\n\n &.interactive {\n cursor: pointer;\n }\n\n .Avatar {\n margin-right: 0.8rem;\n }\n\n .contact-info {\n padding: 0.5rem;\n padding-left: 0;\n white-space: nowrap;\n overflow: hidden;\n\n .contact-name {\n font-size: 1rem;\n line-height: 1rem;\n margin-bottom: 0.25rem;\n font-weight: 500;\n }\n\n .contact-phone {\n line-height: 1rem;\n color: var(--secondary-color);\n }\n }\n}\n\n\n",".PollOption {\n display: flex;\n flex-flow: row nowrap;\n margin-bottom: 0.75rem;\n\n &:last-child {\n margin-bottom: 0;\n }\n\n .poll-option-text {\n word-break: break-word;\n }\n\n .poll-option-share {\n position: relative;\n margin-top: .125rem;\n width: 1.75rem;\n margin-inline-end: .5rem;\n flex-shrink: 0;\n font-weight: 500;\n font-size: .875rem;\n text-align: right;\n\n &.limit-width {\n display: inline-flex;\n justify-content: center;\n font-size: .75rem;\n }\n }\n\n .poll-option-chosen {\n position: absolute;\n right: 0;\n bottom: -5px;\n width: 1rem;\n height: 1rem;\n background: var(--accent-color);\n color: var(--background-color);\n border-radius: .5rem;\n font-size: .75rem;\n text-align: center;\n\n &.wrong {\n background: var(--color-error);\n }\n\n .is-forwarded & > i {\n margin-left: 1px;\n }\n\n &.animate {\n opacity: 0;\n animation-name: PollOptionIconAnimate;\n animation-delay: .09s;\n animation-duration: .3s;\n animation-fill-mode: forwards;\n }\n }\n\n .poll-option-right {\n flex-grow: 1;\n }\n\n .poll-option-answer {\n position: relative;\n }\n\n .poll-option-line {\n position: relative;\n width: 0;\n height: 0.25rem;\n min-width: 0.5rem;\n border-radius: 0.125rem;\n margin-top: 0.5rem;\n background: var(--accent-color);\n\n transform-origin: 0 0;\n transition: transform .3s;\n transition-delay: .09s;\n\n }\n\n .poll-line {\n width: 30px;\n height: 35px;\n position: absolute;\n left: -27px;\n bottom: -5px;\n transition: stroke-dashoffset .3s, stroke-dasharray .3s;\n stroke-dashoffset: 0;\n stroke-dasharray: 0, 200%\n }\n\n .poll-line path {\n stroke-width: 4px;\n stroke-linecap: round;\n stroke: var(--accent-color);\n fill:none\n }\n\n .wrong {\n .poll-option-line {\n background: var(--color-error);\n }\n\n .poll-line path {\n stroke: var(--color-error);\n }\n }\n}\n\n@keyframes PollOptionIconAnimate {\n 0% { opacity: 0 }\n 100% { opacity: 1 }\n}\n",".Poll {\n min-width: 15rem;\n text-align: initial;\n\n @media (max-width: 600px) {\n min-width: 50vw;\n }\n\n .poll-question {\n font-weight: 500;\n line-height: 1.25rem;\n margin: 0.125rem 0;\n word-break: break-word;\n }\n\n .poll-type,\n .poll-voters-count {\n color: var(--secondary-color);\n font-size: 0.875rem;\n }\n\n .poll-type {\n margin-bottom: 0.5rem;\n display: flex;\n align-items: center;\n min-height: 1.375rem;\n }\n\n .poll-voters-count {\n margin: .4375rem 0 .3125rem;\n text-align: center;\n }\n\n .poll-answers {\n padding-top: 0.25rem;\n padding-bottom: 1rem;\n }\n\n .Checkbox,\n .Radio {\n padding-left: 2.25rem;\n\n &:last-child {\n margin-bottom: .75rem;\n }\n\n &.disabled {\n opacity: 1 !important;\n cursor: not-allowed;\n }\n\n .Checkbox-main,\n .Radio-main {\n &::before {\n left: 0.125rem;\n background-color: var(--background-color);\n\n .theme-dark & {\n --color-borders: var(--color-borders-input);\n }\n\n .Message.own & {\n --color-borders: var(--accent-color);\n }\n }\n\n &::after {\n left: 0.4375rem;\n background-color: var(--accent-color);\n }\n }\n\n input:checked ~ .Radio-main,\n input:checked ~ .Checkbox-main {\n &::before {\n border-color: var(--accent-color);\n }\n }\n\n .Spinner {\n left: 0.125rem;\n }\n }\n\n .Checkbox {\n .Checkbox-main {\n &::after {\n left: 0.125rem;\n background-color: var(--color-primary);\n\n .Message.own & {\n background-color: var(--accent-color);\n }\n }\n }\n }\n\n .Spinner > div {\n // gray spinner\n background-image: var(--spinner-gray-data);\n\n .theme-dark & {\n background-image: var(--spinner-white-data);\n }\n\n .Message.own & {\n // green spinner\n background-image: var(--spinner-green-data);\n .theme-dark & {\n background-image: var(--spinner-white-data);\n }\n }\n }\n\n .poll-recent-voters {\n display: inline-flex;\n align-items: center;\n vertical-align: text-bottom;\n margin-left: .875rem;\n margin-right: .5rem;\n margin-top: -2px;\n\n .Avatar {\n border: 1px solid var(--color-white);\n margin-right: 0;\n box-sizing: content-box;\n\n &:not(:first-child) {\n margin-left: -3px;\n }\n }\n }\n\n .poll-countdown {\n margin-left: auto;\n font-size: .75rem;\n transition: color .2s;\n\n &.hurry-up {\n color: var(--color-error);\n\n .poll-countdown-progress {\n stroke: var(--color-error);\n }\n }\n\n svg {\n vertical-align: -3px;\n }\n }\n\n .poll-countdown-progress {\n stroke: var(--color-primary);\n fill: transparent;\n stroke-width: 2;\n stroke-linecap: round;\n transition: stroke-dashoffset 2s, stroke .2s;\n }\n\n .poll-quiz-help {\n margin: -.625rem 0 -.625rem auto;\n .Message:not(.own) & {\n color: var(--color-primary);\n }\n }\n\n .poll-results,\n .poll-answers {\n padding-top: 0.25rem;\n padding-bottom: 0.5rem;\n }\n\n .Button {\n text-transform: none;\n font-size: 1rem;\n\n .Message.own & {\n color: var(--accent-color);\n --color-primary-shade-rgb: var(--color-accent-own);\n }\n }\n\n > .Button {\n margin-top: -.125rem;\n margin-bottom: -.0625rem;\n }\n}\n",".WebPage {\n margin-top: 0.25rem;\n margin-bottom: 0.125rem;\n padding-left: .625rem;\n font-size: calc(var(--message-text-size, 1rem) - .125rem);\n line-height: 1.125rem;\n max-width: 29rem;\n position: relative;\n\n &::before {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: .125rem;\n background: var(--accent-color);\n border-radius: .125rem;\n }\n\n &-text {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n }\n\n .media-inner {\n margin: 0 !important;\n margin-bottom: 0.375rem !important;\n\n &, & img, &.small-image img {\n border-radius: var(--border-radius-messages-small) !important;\n }\n\n &.square-image {\n width: 5rem;\n height: 5rem;\n min-height: 0;\n margin-bottom: 0 !important;\n\n img {\n width: 100%;\n height: 100%;\n }\n }\n }\n\n &.with-video .media-inner{\n margin-top: 0.5rem !important;\n margin-bottom: 1rem !important;\n }\n\n &.with-square-photo {\n display: flex;\n margin-bottom: 1rem;\n\n .WebPage-text {\n order: 1;\n padding-right: 1rem;\n }\n\n .media-inner {\n order: 2;\n flex-shrink: 0;\n }\n\n &:dir(rtl) {\n .WebPage-text {\n padding-inline-end: 1rem;\n }\n }\n }\n\n &:not(.with-square-photo) {\n .site-name,\n .site-title,\n .site-description {\n &:last-child::after {\n content: '';\n display: inline-block;\n width: var(--meta-safe-area-size);\n height: 0.75rem;\n float: right;\n }\n }\n }\n\n .site-name,\n .site-description,\n .site-title {\n word-break: break-word;\n max-width: 100%;\n }\n\n .site-name {\n color: var(--accent-color);\n font-weight: 500;\n margin-bottom: 0.125rem;\n }\n\n .site-title {\n font-weight: 500;\n margin-bottom: 0.125rem;\n }\n\n .site-description {\n line-height: 1.25;\n margin-bottom: 0;\n\n body.is-ios & {\n line-height: 1.125rem;\n }\n }\n\n &:dir(rtl) {\n padding-inline-start: .625rem;\n\n &::before {\n left: auto;\n right: 0;\n }\n }\n}\n\n\n",".Invoice {\n .title {\n color: var(--accent-color);\n font-weight: 500;\n }\n\n .description {\n position: relative;\n\n &.has-image {\n .invoice-image {\n max-width: 100%;\n height: 20rem;\n\n @media (max-width: 600px) {\n height: 10rem;\n }\n }\n\n .description-text {\n position: absolute;\n top: 0;\n padding: .25rem .5rem;\n margin: .25rem;\n background-color: rgba(90, 110, 70, 0.6);\n border-radius: var(--border-radius-messages-small);\n color: var(--color-text);\n font-weight: 500;\n\n span {\n margin-left: .5rem;\n }\n }\n }\n\n }\n}\n",".Album {\n position: relative;\n overflow: hidden;\n\n .message-content.media.text & {\n margin: -0.3125rem -0.5rem 0.3125rem;\n }\n\n .forwarded-message & {\n margin-bottom: .125rem;\n\n .message-content.media.text & {\n margin: 0 0 0.3125rem;\n --border-bottom-left-radius: inherit;\n --border-bottom-right-radius: inherit;\n }\n }\n\n &,\n .message-content.media.text & {\n > .album-item-select-wrapper .media-inner {\n margin: 0 !important;\n }\n }\n\n > .album-item-select-wrapper .media-inner {\n &, & img, & video {\n border-radius: 0 !important;\n object-fit: cover;\n }\n }\n}\n",".RoundVideo {\n position: relative;\n width: 200px;\n height: 200px;\n cursor: pointer;\n\n .thumbnail-wrapper {\n width: 200px;\n height: 200px;\n border-radius: 50%;\n overflow: hidden;\n }\n\n .video-wrapper {\n position: absolute;\n left: 0;\n top: 0;\n border-radius: 50%;\n overflow: hidden;\n }\n\n .progress {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n }\n\n .progress-circle {\n stroke: white;\n fill: transparent;\n stroke-width: 4;\n stroke-opacity: .35;\n stroke-linecap: round;\n }\n\n video::-internal-media-controls-cast-button,\n video::-webkit-media-controls,\n video::-webkit-media-controls-start-playback-button {\n display: none;\n }\n}\n",".InlineButtons {\n display: flex;\n flex-direction: column;\n\n .row {\n display: flex;\n flex-direction: row;\n }\n\n .Button {\n flex: 1;\n width: auto;\n margin: 0.125rem;\n background: var(--pattern-color);\n border-radius: var(--border-radius-messages-small);\n font-weight: 500;\n text-transform: none;\n\n &::before {\n content: '';\n background-color: var(--color-white);\n opacity: 0;\n\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: var(--border-radius-messages-small);\n z-index: var(--z-below);\n transition: opacity 200ms;\n }\n\n &:hover {\n background: var(--pattern-color) !important;\n\n &::before {\n opacity: .4;\n }\n }\n\n &:first-of-type {\n margin-left: 0;\n }\n\n &:last-of-type {\n margin-right: 0;\n }\n\n i {\n font-size: .875rem;\n position: absolute;\n right: .1875rem;\n top: .1875rem;\n display: block;\n\n &.icon-arrow-right {\n font-size: .75rem;\n top: .125rem;\n right: .125rem;\n transform: rotate(-45deg);\n }\n }\n }\n\n .row:first-of-type .Button {\n margin-top: 0.25rem !important;\n }\n\n .row:last-of-type .Button {\n margin-bottom: 0;\n\n &:first-of-type {\n border-bottom-left-radius: var(--border-radius-messages);\n }\n\n &:last-of-type {\n border-bottom-right-radius: var(--border-radius-messages);\n }\n }\n}\n",".CommentButton {\n --background-color: var(--color-background);\n --hover-color: var(--color-chat-hover);\n\n display: flex;\n width: 100%;\n align-items: center;\n padding: .5625rem .25rem .5625rem .625rem;\n padding-inline-start: .625rem;\n padding-inline-end: .25rem;\n background: var(--background-color);\n border-bottom-right-radius: var(--border-bottom-right-radius);\n border-bottom-left-radius: var(--border-bottom-left-radius);\n font-size: .9375rem;\n font-weight: 500;\n line-height: 2rem;\n color: var(--accent-color);\n white-space: nowrap;\n cursor: pointer;\n transition: background-color .15s, color .15s;\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n .Message .has-appendix &::before {\n content: '';\n display: block;\n position: absolute;\n bottom: -.1875rem;\n left: -.5625rem;\n width: .5625rem;\n height: 1.25rem;\n background-position: bottom left;\n background-image: url('data:image/svg+xml,%3Csvg width=\"9\" height=\"20\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"%3E%3Cdefs%3E%3Cfilter x=\"-50%25\" y=\"-14.7%25\" width=\"200%25\" height=\"141.2%25\" filterUnits=\"objectBoundingBox\" id=\"a\"%3E%3CfeOffset dy=\"1\" in=\"SourceAlpha\" result=\"shadowOffsetOuter1\"/%3E%3CfeGaussianBlur stdDeviation=\"1\" in=\"shadowOffsetOuter1\" result=\"shadowBlurOuter1\"/%3E%3CfeColorMatrix 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\"/%3E%3C/filter%3E%3Cpath d=\"M3 17h6V0c-.193 2.84-.876 5.767-2.05 8.782-.904 2.325-2.446 4.485-4.625 6.48A1 1 0 003 17z\" id=\"b\"/%3E%3C/defs%3E%3Cg fill=\"none\" fill-rule=\"evenodd\"%3E%3Cuse fill=\"%23000\" filter=\"url(%23a)\" xlink:href=\"%23b\"/%3E%3Cuse fill=\"%23FFF\" xlink:href=\"%23b\"/%3E%3C/g%3E%3C/svg%3E');\n opacity: 0;\n transition: opacity .15s, filter .15s;\n\n .theme-dark #root & {\n filter: invert(.83);\n }\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n .custom-shape & {\n position: absolute;\n right: -3rem;\n width: 2.25rem;\n bottom: 3rem;\n height: 3.375rem;\n border-radius: 1.375rem;\n padding: 0.375rem .3125rem .25rem;\n align-items: flex-start;\n color: white;\n background-color: rgba(0, 0, 0, .2);\n\n opacity: 0;\n transition: opacity .2s ease;\n\n @media (pointer: coarse) {\n opacity: 1 !important;\n }\n\n &:hover {\n background-color: rgba(0, 0, 0, .28);\n }\n\n .Message:hover & {\n opacity: 1;\n }\n\n &::after {\n content: attr(data-cnt);\n position: absolute;\n bottom: -.0625rem;\n left: 0;\n width: 100%;\n text-align: center;\n font-size: 12px;\n display: block;\n }\n\n &[data-cnt=\"0\"] {\n height: 2.25rem;\n &::after {\n display: none;\n }\n }\n\n .icon-comments-sticker {\n display: block;\n font-size: 1.5rem;\n margin: 0 auto;\n }\n\n .recent-repliers,\n .icon-comments,\n .label,\n .icon-next {\n display: none;\n }\n }\n\n &:hover {\n background: var(--hover-color);\n\n .Message .has-appendix &::before {\n opacity: 1;\n }\n\n .Avatar {\n border-color: var(--hover-color) !important;\n }\n }\n\n .is-forwarded &,\n .audio &,\n .voice &,\n .poll &,\n .text & {\n border-top: 1px solid var(--color-borders);\n }\n\n .message-content.has-solid-background & {\n margin: .375rem -.5rem -.375rem;\n }\n\n .message-content.voice & {\n margin-bottom: -.5rem;\n }\n\n .message-content.audio & {\n margin-bottom: -.8125rem;\n }\n\n .message-content.audio &,\n .message-content.voice &,\n .message-content.poll &,\n .message-content.has-solid-background.text &,\n .message-content.has-solid-background.is-forwarded & {\n width: calc(100% + 1rem);\n }\n\n .icon-comments-sticker {\n display: none;\n }\n\n .icon-comments {\n font-size: 1.5625rem;\n line-height: 2rem;\n margin-inline-end: .875rem;\n }\n\n .icon-next {\n margin-inline-start: auto;\n font-size: 1.5rem;\n }\n\n .recent-repliers {\n display: inline-flex;\n align-items: center;\n margin-inline-end: .5rem;\n margin-inline-start: -.125rem;\n\n .Avatar {\n transition: border .15s;\n border: 2px solid var(--color-background);\n margin-inline-end: 0;\n z-index: 3;\n overflow: hidden;\n\n .emoji {\n width: 1rem;\n background-size: 1rem;\n }\n\n + .Avatar {\n z-index: 2;\n\n + .Avatar {\n z-index: 1;\n }\n }\n\n &:not(:first-child) {\n margin-inline-start: -.75rem;\n }\n }\n }\n\n &.has-unread .label {\n position: relative;\n\n &::after {\n content: '';\n display: inline-block;\n width: .5rem;\n height: .5rem;\n border-radius: 50%;\n background: var(--accent-color);\n margin-inline-start: \t.75rem;\n }\n }\n\n &.disabled {\n cursor: default;\n pointer-events: none;\n }\n}\n","// General styles\n.Message {\n display: flex;\n align-items: flex-end;\n margin-bottom: 0.375rem;\n position: relative;\n\n --background-color: var(--color-background);\n --hover-color: var(--color-reply-hover);\n --active-color: var(--color-reply-active);\n --max-width: 29rem;\n --accent-color: var(--color-primary);\n --accent-shade-color: var(--color-primary-shade);\n --secondary-color: var(--color-text-secondary);\n --meta-safe-area-base: 2.25rem;\n --meta-safe-author-width: 0px;\n --meta-safe-area-extra-width: 0px;\n --meta-safe-area-size: calc(var(--meta-safe-area-base) + var(--meta-safe-author-width) + var(--meta-safe-area-extra-width));\n --deleting-translate-x: -50%;\n --select-message-scale: 0.9;\n --select-background-color: white;\n\n &.is-swiped {\n transform: translateX(-2.5rem) !important;\n }\n\n > .Avatar,\n > .message-content-wrapper {\n opacity: 1;\n transform: scale(1) translateX(0);\n transition: transform var(--select-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n > .Avatar {\n position: absolute;\n bottom: 0;\n left: 0;\n\n @media (max-width: 600px) {\n width: 2.5rem;\n height: 2.5rem;\n }\n }\n\n &.last-in-group {\n margin-bottom: 0.625rem;\n }\n\n &.last-in-list {\n // Forcing extra space which is taken by the appendix and causes incorrect container height calculation.\n // This value is accurately crafted as a minimum possible.\n margin-bottom: 0.375rem;\n }\n\n &.is-in-selection-mode {\n .Album {\n border: 1px var(--select-background-color) solid;\n background-color: var(--select-background-color);\n }\n\n body.is-android & {\n .can-select-text {\n z-index: var(--z-message-select-control);\n }\n\n // Prevent media viewer from opening\n .media-inner {\n pointer-events: none;\n }\n }\n }\n\n &.has-inline-buttons {\n .message-content {\n border-bottom-right-radius: var(--border-radius-messages-small);\n }\n }\n\n &:not(.own) {\n padding-left: 2.5rem;\n\n .no-avatars &, &.is-thread-top {\n padding-left: 0;\n }\n\n @media (max-width: 600px) {\n padding-left: 2.875rem;\n\n .no-avatars &, &.is-thread-top {\n padding-left: 0.25rem;\n }\n }\n }\n\n &.own {\n flex-direction: row-reverse;\n --background-color: var(--color-background-own);\n --hover-color: var(--color-reply-own-hover);\n --active-color: var(--color-reply-own-active);\n --max-width: 30rem;\n --accent-color: var(--color-accent-own);\n --accent-shade-color: var(--color-green);\n --secondary-color: var(--color-accent-own);\n --color-code: var(--color-code-own);\n --color-code-bg: var(--color-code-own-bg);\n --color-links: var(--color-own-links);\n --color-links-hover: var(--color-own-links);\n --meta-safe-area-base: 3.5rem;\n --deleting-translate-x: 50%;\n --color-text-green: var(--color-accent-own);\n\n body.is-ios &,\n body.is-macos & {\n --color-background-own: var(--color-background-own-apple);\n --color-reply-own-hover: var(--color-reply-own-hover-apple);\n --color-reply-own-active: var(--color-reply-own-active-apple);\n }\n\n @media (max-width: 600px) {\n padding-right: 0.25rem;\n }\n }\n\n &.is-deleting {\n > .Avatar,\n > .message-content-wrapper {\n transition: opacity .2s ease, transform .2s ease-in;\n opacity: 0;\n transform: scale(0.3) translateX(var(--deleting-translate-x));\n transform-origin: bottom;\n }\n }\n\n &.has-views {\n --meta-safe-area-extra-width: 4rem;\n }\n\n &.was-edited {\n --meta-safe-area-extra-width: 2.5rem;\n\n &.has-views {\n --meta-safe-area-extra-width: 7.5rem;\n }\n\n html[lang=ru] & {\n --meta-safe-area-extra-width: 3.5rem;\n\n &.has-views {\n --meta-safe-area-extra-width: 8.5rem;\n }\n }\n }\n\n .select-mode-active & {\n cursor: pointer;\n\n @media (min-width: 600px) {\n user-select: none;\n }\n\n &:not(.own) {\n > .Avatar,\n > .message-content-wrapper {\n transform: translateX(2.5rem);\n }\n }\n\n &:not(.is-album)::after {\n content: \"\";\n position: absolute;\n top: -0.25rem;\n bottom: -0.25rem;\n left: -4rem;\n right: -4rem;\n z-index: var(--z-message-select-area);\n }\n\n &.is-album,\n &.is-in-document-group {\n .message-select-control {\n pointer-events: unset;\n }\n }\n\n .message-select-control {\n opacity: 1;\n }\n }\n\n &.is-selected {\n .message-select-control {\n background: var(--color-green);\n\n &.group-select {\n background: transparent;\n\n &.is-selected {\n background: var(--color-green);\n }\n }\n }\n }\n\n .File.file-is-selected {\n .message-select-control {\n background: var(--color-green);\n }\n }\n\n &.is-in-document-group .File.file-is-selected .file-icon,\n &.has-menu-open.is-in-document-group .File .file-icon {\n --background-color: var(--color-background-selected);\n }\n\n &.own.is-in-document-group .File.file-is-selected .file-icon,\n &.own.has-menu-open.is-in-document-group .File .file-icon {\n --background-color: var(--color-background-own-selected);\n }\n\n .Audio .message-select-control {\n left: 1.0625rem;\n top: 1.375rem;\n }\n\n html.theme-dark &.own .Audio .ProgressSpinner {\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTguMjE4IDcuNWw1LjYzMy01LjYzM2EuNTA4LjUwOCAwIDEwLS43MTgtLjcxOEw3LjUgNi43ODIgMS44NjcgMS4xNDlhLjUwOC41MDggMCAxMC0uNzE4LjcxOEw2Ljc4MiA3LjVsLTUuNjMzIDUuNjMzYS41MDguNTA4IDAgMTAuNzE4LjcxOEw3LjUgOC4yMThsNS42MzMgNS42MzNhLjUwNi41MDYgMCAwMC43MTggMCAuNTA4LjUwOCAwIDAwMC0uNzE4TDguMjE4IDcuNXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjODA3QkQ1IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+);\n background-position: center;\n background-size: 1rem;\n\n circle {\n stroke: var(--background-color);\n }\n }\n\n\n .File {\n position: relative;\n\n .message-select-control {\n position: absolute;\n top: 2rem;\n left: 2rem;\n z-index: 2;\n }\n }\n\n .album-item-select-wrapper {\n .Message.own & {\n background: var(--color-background-own);\n }\n\n .message-select-control {\n position: absolute;\n top: 0.438rem;\n right: 0.438rem;\n left: unset;\n }\n\n .media-inner {\n border: 0 var(--select-background-color) solid;\n transition: border-width var(--select-transition);\n }\n\n img, video {\n transition: transform var(--select-transition), opacity ease 300ms;\n }\n\n &.is-selected {\n .message-select-control {\n background: var(--color-green);\n }\n\n img, video {\n transform: scale(var(--select-message-scale));\n }\n }\n\n }\n\n &.is-selected, &.is-forwarding {\n .message-select-control {\n background: var(--color-green);\n }\n\n .Menu .bubble {\n transition: none !important;\n }\n }\n\n &.is-in-document-group {\n &:not(.first-in-document-group) {\n &::before {\n top: 0 !important;\n }\n\n .message-content {\n box-shadow: none;\n border-top-left-radius: 0 !important;\n border-top-right-radius: 0 !important;\n }\n\n .forwarded-message::before {\n top: -1.5rem;\n }\n }\n\n &:not(.last-in-document-group) {\n margin-bottom: 0;\n\n &::before {\n bottom: 0 !important;\n }\n\n .message-content {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n }\n\n &.is-in-selection-mode {\n .Audio:not(.audio-is-selected),\n .File:not(.file-is-selected) {\n .message-select-control:not(.group-select) {\n background: white;\n\n &::after {\n content: '';\n width: 1.25rem;\n height: 1.25rem;\n border-radius: 0.688rem;\n background: white;\n border: 0.125rem rgba(0, 0, 0, 0.2) solid;\n position: absolute;\n }\n }\n }\n\n &.own {\n .message-content {\n .Audio:not(.audio-is-selected),\n .File:not(.file-is-selected) {\n .message-select-control:not(.group-select) {\n background: var(--background-color);\n border-color: var(--background-color);\n\n &::after {\n background: var(--background-color);\n border-color: var(--color-message-meta-own);\n }\n }\n }\n }\n }\n\n }\n\n &.focused,\n &.has-menu-open,\n &.is-forwarding,\n &.is-selected {\n .message-content {\n background: var(--color-background-selected);\n }\n\n &.own {\n .message-content {\n --background-color: var(--color-background-own-selected);\n background: var(--color-background-own-selected);\n }\n }\n }\n\n .message-content-wrapper {\n width: 17.1875rem;\n }\n\n .message-content {\n transition: background-color var(--select-transition);\n }\n\n &.own {\n .message-content-wrapper {\n display: flex;\n justify-content: flex-end;\n\n .message-content {\n width: 100%;\n }\n }\n }\n }\n\n .album-item-select-wrapper {\n position: absolute;\n\n .message-select-control {\n position: absolute;\n z-index: 2;\n }\n }\n\n .message-select-control {\n position: absolute;\n left: 0;\n bottom: 0.25rem;\n width: 1.5rem;\n height: 1.5rem;\n border: 2px solid white;\n border-radius: 50%;\n z-index: var(--z-message-select-control);\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n color: white;\n font-size: 1rem;\n\n opacity: 0;\n pointer-events: none;\n transition: opacity var(--select-transition);\n\n .icon-select {\n position: absolute;\n left: -3px;\n top: -3px;\n font-size: 1.625rem;\n }\n\n .theme-dark & {\n border-color: #ffffff80;\n }\n }\n\n .Avatar {\n margin-right: 0.3rem;\n }\n\n &.is-in-document-group {\n .message-content.document {\n padding: .25rem .5rem !important;\n }\n\n &.last-in-document-group {\n .message-content.document {\n padding-bottom: .5rem !important\n }\n }\n\n &.first-in-document-group {\n .message-content.document {\n padding-top: .5rem !important\n }\n }\n }\n}\n\n// Border-radius styles\n.message-content,\n.Album,\n.media-inner,\n.message-content.media .media-inner img,\n.message-content.media .media-inner video,\n.message-content.custom-shape .media-inner img {\n border-top-left-radius: var(--border-top-left-radius);\n border-top-right-radius: var(--border-top-right-radius);\n border-bottom-left-radius: var(--border-bottom-left-radius);\n border-bottom-right-radius: var(--border-bottom-right-radius);\n}\n\n.media-inner video.full-media {\n background: transparent !important;\n}\n\n.media-inner {\n overflow: hidden;\n\n &.small-image img {\n border-radius: 0 !important;\n }\n}\n\n.Message {\n --border-top-left-radius: var(--border-radius-messages);\n --border-top-right-radius: var(--border-radius-messages);\n --border-bottom-left-radius: var(--border-radius-messages);\n --border-bottom-right-radius: var(--border-radius-messages);\n\n &:not(.own) {\n &.first-in-group:not(.last-in-group) {\n --border-bottom-left-radius: var(--border-radius-messages-small);\n }\n\n &:not(.first-in-group):not(.last-in-group) {\n --border-top-left-radius: var(--border-radius-messages-small);\n --border-bottom-left-radius: var(--border-radius-messages-small);\n }\n\n &.last-in-group:not(.first-in-group) {\n --border-top-left-radius: var(--border-radius-messages-small);\n }\n\n &.last-in-group {\n --border-bottom-left-radius: var(--border-radius-messages-small);\n\n .message-content.has-appendix {\n --border-bottom-left-radius: 0;\n }\n }\n }\n\n &.own {\n &.first-in-group:not(.last-in-group) {\n --border-bottom-right-radius: var(--border-radius-messages-small);\n }\n\n &:not(.first-in-group):not(.last-in-group) {\n --border-top-right-radius: var(--border-radius-messages-small);\n --border-bottom-right-radius: var(--border-radius-messages-small);\n }\n\n &.last-in-group:not(.first-in-group) {\n --border-top-right-radius: var(--border-radius-messages-small);\n }\n\n &.last-in-group {\n --border-bottom-right-radius: var(--border-radius-messages-small);\n\n .message-content.has-appendix {\n --border-bottom-right-radius: 0;\n }\n }\n }\n\n .message-content {\n &.has-replies:not(.custom-shape),\n &.text {\n .media-inner,\n .Album {\n --border-bottom-left-radius: 0;\n --border-bottom-right-radius: 0;\n }\n }\n\n &.is-reply .EmbeddedMessage {\n & + .Album,\n & + .Audio,\n & + .File {\n margin-top: .375rem;\n }\n }\n\n &:not(.custom-shape).is-reply .media-inner,\n &:not(.custom-shape).is-reply .Album,\n &:not(.custom-shape).force-sender-name .Album,\n &:not(.is-forwarded) .message-title ~ .media-inner {\n --border-top-left-radius: 0;\n --border-top-right-radius: 0;\n }\n\n &.is-forwarded .content-inner .message-title {\n margin-bottom: 0.25rem;\n }\n }\n\n .message-action-button {\n position: absolute;\n bottom: 0;\n color: white;\n background-color: rgba(0, 0, 0, .2);\n\n opacity: 0;\n transition: opacity .2s ease;\n\n @media (pointer: coarse) {\n opacity: 1 !important;\n }\n\n &:hover,\n &:active,\n &:focus {\n background-color: rgba(0, 0, 0, .28) !important;\n }\n }\n\n &:hover,\n &[data-is-document-group-hover] {\n .message-action-button {\n opacity: 1;\n }\n }\n\n &.own .message-action-button {\n left: -3rem;\n }\n\n &:not(.own) .message-action-button {\n right: -3rem;\n }\n\n .bottom-marker {\n height: 1px;\n width: 1px;\n visibility: hidden;\n }\n}\n\n.Message .custom-shape .message-action-button {\n bottom: .25rem;\n}\n\n@import 'message-content';\n",".message-content {\n position: relative;\n max-width: var(--max-width);\n\n @media (max-width: 600px) {\n max-width: calc(100vw - 6.25rem);\n\n .Message.own &,\n .MessageList.no-avatars & {\n max-width: calc(100vw - 3.75rem);\n }\n\n // Workaround for sass function override - we should use CSS min() here\n @supports (max-width: #{\"min(29rem, 100vw - 6.25rem)\"}) {\n max-width: #{\"min(29rem, 100vw - 6.25rem)\"};\n .MessageList.no-avatars & {\n max-width: #{\"min(29rem, 100vw - 3.75rem)\"};\n }\n .Message.own & {\n max-width: #{\"min(30rem, 100vw - 3.75rem)\"};\n }\n }\n\n &.has-action-button {\n max-width: calc(100vw - 7rem);\n\n .Message.own &,\n .MessageList.no-avatars & {\n max-width: calc(100vw - 4.5rem);\n }\n\n // Workaround for sass function override - we should use CSS min() here\n @supports (max-width: #{\"min(29rem, 100vw - 5.5rem)\"}) {\n max-width: #{\"min(29rem, 100vw - 7rem)\"};\n .MessageList.no-avatars & {\n max-width: #{\"min(29rem, 100vw - 4.5rem)\"};\n }\n .Message.own & {\n max-width: #{\"min(30rem, 100vw - 4.5rem)\"};\n }\n }\n }\n }\n\n img {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n }\n\n .text-content {\n margin: 0;\n word-break: break-word;\n line-height: 1.3125;\n text-align: initial;\n display: flow-root;\n unicode-bidi: plaintext;\n }\n\n .text-entity-link {\n unicode-bidi: plaintext;\n }\n\n &:not(.custom-shape) .text-content,\n &.document {\n & > .MessageMeta {\n position: relative;\n top: .375rem;\n bottom: auto !important;\n float: right;\n line-height: 1;\n height: calc(var(--message-meta-height, 1rem));\n margin-left: .4375rem;\n margin-right: -.5rem;\n\n .MessageOutgoingStatus .Transition {\n max-height: calc(var(--message-meta-height, 1rem));\n overflow: hidden;\n }\n\n html[data-message-text-size=\"12\"] & {\n top: .25rem;\n }\n\n html[data-message-text-size=\"17\"] & {\n top: .4375rem;\n }\n\n html[data-message-text-size=\"18\"] &,\n html[data-message-text-size=\"19\"] & {\n top: .5rem;\n }\n\n html[data-message-text-size=\"20\"] & {\n top: .5625rem;\n }\n }\n\n &:dir(rtl) {\n & > .MessageMeta {\n float: left;\n margin-left: -.25rem;\n margin-right: .4375rem;\n }\n }\n }\n\n &.document:not(.text) {\n &::after {\n content: \"\";\n display: block;\n clear: both;\n }\n\n & > .MessageMeta {\n top: auto !important;\n bottom: -.5rem !important;\n margin-top: -.25rem;\n\n &:not([dir=rtl]) {\n margin-top: -1.25rem;\n }\n }\n }\n\n .theme-dark .Message.own & {\n .text-entity-link {\n text-decoration: underline;\n\n &:hover {\n text-decoration: none;\n }\n }\n }\n\n &:not(.custom-shape) {\n font-size: var(--message-text-size, 1rem);\n\n body.is-ios & {\n font-size: var(--message-text-size, 1.0625rem);\n }\n\n & > .content-inner {\n min-width: 0;\n }\n }\n\n .matching-text-highlight {\n background: #CAE3F7;\n border-radius: 0.25rem;\n padding: 0 0.125rem;\n }\n\n .message-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: calc(var(--message-text-size, 1rem) - .125rem);\n font-weight: 500;\n line-height: 1.25rem;\n color: var(--accent-color);\n unicode-bidi: plaintext;\n display: flex;\n\n & > .interactive {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &.interactive, & > .interactive {\n cursor: pointer;\n\n &:hover {\n opacity: 0.85;\n }\n }\n\n & > .color-1 {\n color: var(--color-user-1);\n }\n\n & > .color-2 {\n color: var(--color-user-2);\n }\n\n & > .color-4 {\n color: var(--color-user-4);\n }\n\n & > .color-5 {\n color: var(--color-user-5);\n }\n\n & > .color-6 {\n color: var(--color-user-6);\n }\n\n & > .color-7 {\n color: var(--color-user-7);\n }\n\n & > .color-8 {\n color: var(--color-user-8);\n }\n\n .theme-dark .Message.own & > .color-1 {\n color: var(--accent-color);\n }\n\n & + .File {\n margin-top: .25rem;\n }\n\n .via {\n padding-right: .25rem;\n font-weight: 400;\n }\n\n span + .via {\n padding-left: .25rem;\n }\n\n .admin-title {\n flex: 1;\n margin-left: 1rem;\n text-align: right;\n font-weight: 400;\n font-size: 0.75rem;\n margin-top: -0.1rem;\n color: rgba(var(--color-text-meta-rgb), 0.75);\n\n .Message.own & {\n color: var(--accent-color);\n }\n }\n }\n\n &.has-shadow {\n box-shadow: 0 1px 2px var(--color-default-shadow);\n }\n\n &.has-solid-background, &.has-background, .is-album & {\n background: var(--background-color);\n }\n\n &.has-solid-background {\n padding: .3125rem .5rem .375rem;\n\n .forwarded-message > .text-content:not(.with-meta):last-child::after {\n content: '';\n display: inline-block;\n width: var(--meta-safe-area-size);\n height: 1rem;\n }\n }\n\n &:not(.has-appendix) .svg-appendix {\n display: none;\n }\n\n .svg-appendix {\n overflow: hidden;\n position: absolute;\n bottom: -.0625rem;\n width: .5625rem;\n height: 1.125rem;\n font-size: 1rem !important;\n\n .corner {\n fill: var(--background-color);\n }\n\n .Message.own & {\n right: -.551rem; // This value is correct. Safari fix\n }\n\n .Message:not(.own) & {\n left: -.562rem; // This value is correct. Safari fix\n }\n }\n\n &[data-has-custom-appendix] {\n .svg-appendix .corner {\n fill: var(--appendix-bg);\n }\n }\n\n &.has-appendix-thumb {\n .Message & {\n .svg-appendix {\n --background-color: #ccc;\n opacity: 1;\n transition: opacity 500ms ease;\n }\n }\n }\n\n &.document {\n padding: .5rem !important;\n\n .File {\n .theme-dark & {\n --color-primary: var(--color-selection-highlight);\n }\n }\n\n .File + .text-content {\n margin-top: .3125rem;\n }\n }\n\n &.voice,\n &.audio {\n .message-title,\n .Embedded {\n margin-top: -.1875rem;\n margin-bottom: .1875rem;\n }\n }\n\n &.voice {\n padding: .5rem !important;\n\n .Voice + .text-content {\n margin-top: .5rem;\n }\n }\n\n &.audio {\n min-width: 17.1875rem;\n padding: .5rem .5rem .8125rem !important;\n\n .Audio + .text-content {\n margin-top: .25rem;\n }\n\n &:not(.has-replies) {\n .Audio + .text-content {\n margin-bottom: -0.4375rem;\n }\n }\n }\n\n &:not(.custom-shape) .emoji {\n display: inline-block;\n width: 1.25rem;\n background-size: 1.25rem;\n color: transparent;\n margin-inline-end: 1px;\n vertical-align: text-bottom;\n\n &::selection {\n background-color: var(--color-selection-highlight-emoji);\n color: transparent;\n }\n }\n\n &:not(.custom-shape) .text-content .emoji {\n width: calc(1.25 * var(--message-text-size, 1rem));\n height: calc(1.25 * var(--message-text-size, 1rem));\n background-size: calc(1.25 * var(--message-text-size, 1rem));\n }\n\n .no-media-corners {\n --border-top-left-radius: 0;\n --border-top-right-radius: 0;\n }\n\n &.custom-shape.is-via-bot {\n font-size: inherit !important;\n\n .content-inner > .message-title {\n display: inline-flex;\n position: relative;\n top: .125rem;\n max-width: calc(100% - 3rem);\n margin-left: calc(100% - 3rem);\n padding: 0 .5rem;\n background-color: var(--background-color);\n border-radius: var(--border-radius-messages);\n\n .Message.own & {\n margin-left: -3rem;\n }\n }\n\n .media-inner {\n margin-top: 0.375rem;\n }\n }\n\n}\n\n.message-content.media, .WebPage {\n .media-inner {\n display: flex;\n justify-content: center;\n align-items: center;\n\n &.interactive {\n cursor: pointer;\n\n &.dark video {\n background-color: #232323;\n }\n }\n }\n\n &.round.is-reply {\n width: auto !important;\n }\n\n &.force-sender-name .media-inner,\n &.force-sender-name .Album,\n &.text .media-inner,\n &.is-via-bot .media-inner,\n &.is-reply .media-inner,\n &.is-reply .Album {\n margin-left: -0.5rem;\n margin-right: -0.5rem;\n }\n\n &.text .media-inner {\n margin-top: -0.3125rem;\n }\n\n &.is-reply .media-inner,\n &.force-sender-name .Album,\n &.is-reply .Album,\n .message-title ~ .media-inner {\n margin-top: 0.375rem;\n margin-bottom: -0.375rem;\n }\n\n // Moved below .is-reply to overwrite its styles\n &.text .media-inner,\n &.text .Album {\n margin-bottom: 0.375rem;\n }\n\n .media-loading {\n display: flex;\n align-items: center;\n justify-content: center;\n\n &:not(.open) {\n opacity: 0.5;\n transform: scale(0);\n transition: opacity .3s ease, transform .3s ease;\n }\n }\n\n .icon-large-play, .icon-download {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n opacity: 0.7;\n transition: opacity 150ms;\n\n &:hover {\n opacity: 1;\n }\n\n &:before {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 3.375rem;\n height: 3.375rem;\n border-radius: 50%;\n background: rgba(black, 0.25);\n }\n }\n\n .icon-download {\n font-size: 1.5rem;\n }\n\n .icon-large-play {\n font-size: 2.5rem;\n }\n\n .message-media-duration,\n .message-upload-progress {\n background: rgba(0, 0, 0, .25);\n color: #fff;\n font-size: 0.75rem;\n position: absolute;\n left: .1875rem;\n top: .1875rem;\n z-index: 1;\n padding: 0 .375rem;\n border-radius: .75rem;\n line-height: 1.125rem;\n }\n\n .message-media-duration .icon-muted-chat {\n vertical-align: -.1875rem;\n margin-left: .375rem;\n font-size: 1.0625rem;\n }\n}\n\n.message-content.custom-shape {\n line-height: 1.2;\n font-size: 10rem;\n display: flex;\n flex-wrap: wrap;\n align-items: flex-end;\n\n &.has-comments {\n min-height: 5.25rem;\n margin-top: 0 !important;\n\n &.has-replies {\n min-height: 6.5rem;\n }\n }\n\n &.is-reply {\n max-width: 100%;\n }\n\n .reply-message {\n display: flex;\n align-items: flex-start;\n flex-direction: row-reverse;\n direction: ltr;\n\n > p {\n margin-bottom: 0;\n }\n\n .EmbeddedMessage {\n margin-left: 0.5rem;\n border-radius: var(--border-radius-messages);\n\n @media (max-width: 600px) {\n max-width: calc(90vw - 13rem);\n }\n\n @media (max-width: 340px) {\n margin-left: -1rem;\n z-index: 1;\n max-width: calc(90vw - 12rem);\n }\n }\n }\n\n .text-content {\n margin-bottom: 1rem;\n }\n\n .media-inner {\n line-height: 1;\n font-size: 1rem;\n flex-shrink: 0;\n\n .full-media {\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n }\n }\n\n .emoji {\n display: inline-block;\n color: transparent;\n\n &::selection {\n background-color: var(--color-selection-highlight-emoji);\n color: transparent;\n }\n }\n\n &.emoji-only {\n .text-content {\n margin-bottom: 0;\n }\n }\n\n &.emoji-only-1 {\n min-width: 8rem;\n font-size: 4.5rem;\n\n .content-inner {\n height: 7rem;\n }\n\n .text-content {\n line-height: 1.5;\n text-align: center;\n }\n\n .Message.was-edited & {\n min-width: 10rem;\n }\n\n .emoji {\n width: 5rem;\n height: 5rem;\n }\n }\n\n &.emoji-only-2 {\n font-size: 4rem;\n margin-top: .5rem;\n min-width: 10rem;\n\n &.has-comments {\n margin-top: 1.25rem;\n }\n\n .Message.was-edited & {\n min-width: 12rem;\n }\n\n .emoji {\n width: 4rem;\n height: 4rem;\n }\n }\n\n &.emoji-only-3 {\n font-size: 3rem;\n margin-top: 1.75rem;\n min-width: 12rem;\n\n &.has-comments {\n margin-top: 2.5rem;\n }\n\n .Message.was-edited & {\n min-width: 14rem;\n }\n\n .emoji {\n width: 3rem;\n height: 3rem;\n }\n }\n\n .Message:not(.own) & {\n --hover-color: var(--color-reply-hover);\n --active-color: var(--color-reply-active);\n }\n\n .Message.own & {\n --hover-color: var(--color-reply-own-hover);\n --active-color: var(--color-reply-own-active);\n\n .reply-message {\n flex-direction: row;\n\n .EmbeddedMessage {\n margin-right: 0.5rem;\n\n @media (max-width: 340px) {\n margin-left: 0;\n z-index: 1;\n max-width: calc(90vw - 11.5rem);\n }\n }\n }\n }\n}\n\n.forwarded-message {\n .message-content.poll & {\n // MessageOutgoingStatus's icon needs more space\n margin-bottom: 0.5rem;\n }\n\n .message-content:not(.custom-shape) & {\n position: relative;\n margin-top: 0.25rem;\n padding-left: 0.625rem;\n\n &::before {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0.05rem;\n width: 2px;\n background: var(--accent-color);\n border-radius: 2px;\n }\n\n &:dir(rtl) {\n padding-inline-start: 0.625rem;\n\n &::before {\n left: auto;\n right: 0.05rem;\n }\n }\n }\n\n --border-top-left-radius: var(--border-radius-messages-small);\n --border-top-right-radius: var(--border-radius-messages-small);\n --border-bottom-left-radius: var(--border-radius-messages-small);\n --border-bottom-right-radius: var(--border-radius-messages-small);\n\n > .media-inner {\n margin: 0 !important;\n margin-bottom: 0.25rem !important;\n }\n}\n\n.long-word-break-all {\n word-break: break-all;\n}\n\n.text-entity-link {\n color: var(--color-links) !important;\n text-decoration: none;\n word-break: break-word;\n cursor: pointer;\n unicode-bidi: initial;\n\n &:hover, &:active, &:visited {\n color: var(--color-links-hover) !important;\n text-decoration: underline;\n }\n}\n\n.text-entity-code, .text-entity-pre {\n color: var(--color-code);\n background: var(--color-code-bg);\n white-space: pre-wrap;\n margin: 0;\n padding: 1px 2px;\n border-radius: 4px;\n font-size: calc(var(--message-text-size, 1rem) - 0.0625rem);\n}\n",".ContactGreeting {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n\n .wrapper {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n background: var(--pattern-color);\n width: 14.5rem;\n padding: .75rem 1rem;\n border-radius: 1.5rem;\n color: #fff;\n }\n\n .title {\n font-weight: 500;\n margin-bottom: 0;\n }\n\n .description {\n font-size: .9375rem;\n margin-bottom: 0;\n }\n\n .sticker {\n margin: 2rem 0 1rem;\n height: 10rem;\n width: 10rem;\n cursor: pointer;\n\n .thumbnail {\n height: 10rem;\n width: 10rem;\n }\n }\n}\n",".NoMessages {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n\n .icon {\n font-size: 5rem;\n margin: 0 auto 1rem;\n }\n\n .wrapper {\n display: inline-flex;\n flex-direction: column;\n background: var(--pattern-color);\n max-width: 20rem;\n padding: .75rem 1rem;\n border-radius: 1.5rem;\n color: #fff;\n\n &[dir=rtl] {\n text-align: right;\n }\n }\n\n .title {\n font-weight: 500;\n font-size: 1rem;\n margin-bottom: .25rem;\n text-align: center;\n unicode-bidi: plaintext;\n }\n\n .description {\n font-size: .9375rem;\n margin: 0;\n padding: 0;\n list-style: none;\n unicode-bidi: plaintext;\n }\n\n .list-checkmarks {\n font-size: .9375rem;\n margin: .25rem 0 0;\n padding: 0;\n list-style: none;\n unicode-bidi: plaintext;\n line-height: 1.8;\n\n li::before {\n content: '✓';\n margin-inline-end: .5rem;\n }\n }\n}\n","@import '../../styles/mixins';\n\n.MessageList {\n flex: 1;\n width: 100%;\n margin-bottom: .5rem;\n\n overflow-anchor: none;\n overflow: scroll;\n overflow-x: hidden;\n overflow-y: auto;\n @include overflow-y-overlay();\n\n .mask-image-enabled & {\n mask-image: linear-gradient(to top, transparent 0, #000 0.5rem);\n }\n\n @media (pointer: coarse) {\n user-select: none;\n touch-callout: none;\n\n &.select-mode-active {\n user-select: auto;\n touch-callout: default;\n }\n }\n\n &.no-avatars .Message > .Avatar {\n display: none;\n }\n\n .messages-container {\n width: 100%;\n max-width: var(--messages-container-width);\n min-height: 100%;\n margin: 0 auto;\n display: flex;\n justify-content: flex-end;\n flex-direction: column;\n padding: 1rem 1rem 0 1.125rem;\n\n .force-messages-scroll & {\n margin-top: 100vh !important;\n }\n\n @media (max-width: 600px) {\n width: 100vw;\n padding: 2.75rem 0.5rem 0;\n // Patch for an issue on Android when rotating device\n margin: 0;\n }\n }\n\n &.no-composer {\n margin-bottom: 0;\n\n .last-in-list {\n margin-bottom: 1rem;\n }\n }\n\n &.select-mode-active, &.type-pinned {\n margin-bottom: 0;\n\n .last-in-list {\n margin-bottom: 5.625rem;\n\n @media (max-width: 600px) {\n margin-bottom: 4.25rem;\n }\n\n &.ActionMessage {\n padding-bottom: 0.125rem;\n }\n }\n }\n\n .Message,\n .ActionMessage {\n position: relative;\n\n opacity: 1;\n transform: scale(1);\n transition: opacity .2s ease, transform .2s ease;\n\n &:not(.open) {\n transform: scale(0.8);\n opacity: 0;\n }\n\n // Restore stacking context\n // https://developer.mozilla.org/ru/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n &.open.shown {\n transform: none;\n }\n\n &::before {\n content: \"\";\n position: absolute;\n top: -0.1875rem;\n bottom: -0.1875rem;\n left: -50vw;\n right: -50vw;\n background: black;\n z-index: -1;\n\n opacity: 0;\n transition: opacity var(--select-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n &:not(.last-in-group) {\n &::before {\n bottom: -0.1875rem;\n }\n }\n\n &:not(.first-in-group) {\n &::before {\n top: -0.1875rem;\n }\n }\n\n &.focused::before {\n // @optimization\n transition: none !important;\n }\n\n &.focused,\n &.is-forwarding,\n &.is-selected,\n &.has-menu-open {\n &::before {\n opacity: 0.1;\n }\n }\n }\n\n > .empty {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .sticky-date,\n .local-action-message,\n .ActionMessage,\n .empty {\n text-align: center;\n\n > span {\n display: inline-block;\n background: var(--pattern-color);\n color: white;\n font-size: calc(var(--message-text-size, 1rem) - .0625rem);\n font-weight: 500;\n line-height: 1.75;\n padding: 0 .5rem;\n border-radius: 2rem;\n word-break: break-word;\n\n body.is-ios &,\n body.is-macos & {\n font-size: calc(var(--message-text-size, 1rem) - .125rem);\n }\n\n .emoji-small {\n vertical-align: text-bottom;\n width: calc(1.25 * var(--message-text-size, 1rem));\n height: calc(1.25 * var(--message-text-size, 1rem));\n background-size: calc(1.25 * var(--message-text-size, 1rem));\n }\n }\n\n &.rich {\n > span {\n max-width: 80%;\n text-align: left;\n }\n\n a {\n &, &:visited {\n color: var(--color-links-darker) !important;\n }\n\n &:hover, &:active {\n color: var(--color-links-darker-hover) !important;\n }\n }\n }\n }\n\n .sticky-date {\n margin-top: 1rem;\n margin-bottom: 1rem;\n z-index: var(--z-sticky-date);\n pointer-events: none;\n opacity: 1;\n transition: opacity .3s ease;\n\n body:not(.is-scrolling-messages) &.stuck {\n opacity: 0;\n\n span {\n pointer-events: none;\n }\n }\n\n body.animation-level-0 & {\n transition: none;\n }\n\n &.interactive {\n cursor: pointer;\n }\n\n span {\n pointer-events: auto;\n }\n }\n\n &.scrolled:not(.is-animating) .sticky-date {\n position: sticky;\n top: 0.625rem;\n }\n\n &.is-animating {\n overflow: hidden;\n }\n\n &.is-animating .message-select-control {\n display: none !important;\n }\n\n .has-header-tools & .sticky-date {\n top: 3.75rem;\n }\n\n .local-action-message,\n .ActionMessage {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n }\n\n .ActionMessage {\n .action-link {\n cursor: pointer;\n\n &:hover {\n text-decoration: underline;\n }\n }\n }\n\n .sticky-date + .ActionMessage {\n margin-top: -0.5rem;\n }\n\n @media (min-width: 1276px) {\n width: 100%;\n transform: translate3d(0, 0, 0);\n transition: transform var(--layer-transition);\n\n .messages-container {\n width: calc(100% - var(--right-column-width));\n }\n\n body.animation-level-0 & {\n transition: none;\n }\n\n #Main.right-column-open & {\n transform: translate3d(calc(var(--right-column-width) / -2), 0, 0);\n }\n\n body:not(.animating-right-column) #Main.right-column-open &.select-mode-active,\n #Main.right-column-open &:not(.select-mode-active),\n body.animating-right-column &:not(.select-mode-active) {\n width: calc(100% - var(--right-column-width));\n\n .messages-container {\n width: 100%;\n }\n }\n }\n\n @media (max-width: 600px) {\n transition: transform var(--layer-transition);\n\n body.enable-symbol-menu-transforms & {\n transform: translate3d(0, 0, 0);\n }\n\n body.is-symbol-menu-open & {\n transform: translate3d(0, calc(-1 * (var(--symbol-menu-height) + var(--symbol-menu-footer-height))), 0);\n }\n }\n\n .animating > div > & {\n &::-webkit-scrollbar {\n width: 0;\n }\n\n /* Styles for Firefox */\n @supports (scrollbar-width: none) {\n padding-right: .6875rem;\n scrollbar-width: none;\n }\n }\n}\n",".ScrollDownButton {\n --base-bottom-pos: 6rem;\n\n position: absolute;\n bottom: var(--base-bottom-pos);\n right: 1rem;\n opacity: 0;\n transform: translateY(4.5rem);\n transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity .2s ease;\n z-index: var(--z-scroll-down-button);\n pointer-events: none;\n\n body.animation-level-0 & {\n transform: none !important;\n\n transition: opacity .15s;\n }\n\n @media (max-width: 600px) {\n right: 0.5rem;\n bottom: 4.5rem;\n }\n\n &-inner {\n display: flex;\n flex-direction: column;\n align-items: center;\n\n > .Button {\n box-shadow: 0 1px 2px var(--color-default-shadow);\n\n i {\n font-size: 1.75rem;\n }\n }\n\n @media (min-width: 1276px) {\n transform: translateX(0);\n\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n #Main.right-column-open & {\n transform: translateX(calc(-1 * var(--right-column-width)));\n }\n }\n\n @media (max-width: 600px) {\n > .Button {\n width: 2.875rem;\n height: 2.875rem;\n }\n }\n }\n\n &.revealed {\n transform: translateY(0);\n opacity: 1;\n pointer-events: all;\n\n &.no-composer {\n transform: translateY(4rem);\n }\n }\n\n .unread-count {\n min-width: 1.5rem;\n height: 1.5rem;\n padding: 0 .45rem;\n border-radius: 0.75rem;\n font-size: 0.875rem;\n line-height: 1.5rem;\n font-weight: 500;\n text-align: center;\n\n position: absolute;\n top: -0.3rem;\n right: -0.3rem;\n\n background: var(--color-green);\n color: white;\n\n pointer-events: none;\n\n @media (max-width: 600px) {\n top: -0.7rem;\n right: auto;\n }\n }\n\n @media (max-width: 600px) {\n body.is-symbol-menu-open & {\n bottom: calc(var(--base-bottom-pos) + var(--symbol-menu-height) + var(--symbol-menu-footer-height));\n }\n }\n}\n",".BotKeyboardMenu {\n .bubble {\n width: 100% !important;\n max-width: 27rem;\n border-radius: var(--border-radius-default-small);\n }\n\n .content {\n display: flex;\n flex-direction: column;\n padding: .1875rem .625rem;\n max-height: 80vh;\n overflow: auto;\n\n @media (max-width: 600px) {\n max-height: 75vh;\n }\n\n .row {\n display: flex;\n flex-direction: row;\n }\n\n .row + .row {\n margin-top: .375rem;\n }\n\n .Button {\n flex: 1;\n width: auto;\n height: auto;\n min-height: 3.0625rem;\n border-radius: var(--border-radius-messages-small);\n border: 2px solid var(--color-primary);\n background: var(--color-background);\n color: var(--color-primary);\n font-weight: 500;\n text-transform: none;\n\n &:hover {\n color: #fff;\n border-color: var(--color-primary-shade);\n background: var(--color-primary-shade);\n }\n }\n\n .Button + .Button {\n margin-left: .375rem;\n }\n }\n}\n",".ComposerEmbeddedMessage {\n height: 2.625rem;\n transition: height 150ms ease-out, opacity 150ms ease-out;\n\n .select-mode-active + .middle-column-footer & {\n display: none;\n }\n\n &:not(.open) {\n height: 0 !important;\n }\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n & > div {\n display: flex;\n align-items: center;\n padding-right: 0.625rem;\n padding-top: 0.1875rem;\n }\n\n & > div > .Button {\n flex-shrink: 0;\n background: none !important;\n width: 3.5rem;\n height: 2.875rem;\n margin: 0 -0.0625rem 0 0;\n padding: 0;\n align-self: center;\n\n @media (max-width: 600px) {\n width: 2.875rem;\n }\n }\n}\n",".WebPagePreview {\n height: 2.625rem;\n transition: height 150ms ease-out, opacity 150ms ease-out;\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n .select-mode-active + .middle-column-footer & {\n display: none;\n }\n\n &:not(.open) {\n height: 0 !important;\n }\n\n // TODO Remove duplication with `.ComposerEmbeddedMessage`\n & > div {\n display: flex;\n align-items: center;\n padding-right: 0.625rem;\n padding-top: 0.1875rem;\n }\n\n --accent-color: var(--color-primary);\n\n .ComposerEmbeddedMessage + & {\n margin-top: 0.75rem;\n }\n\n & > div > .Button {\n flex-shrink: 0;\n background: none !important;\n width: 3.5rem;\n height: 2.875rem;\n margin: 0 -0.0625rem 0 0;\n padding: 0;\n align-self: center;\n\n @media (max-width: 600px) {\n width: 2.875rem;\n }\n }\n\n .WebPage {\n flex-grow: 1;\n margin: 0.1875rem 0 0.1875rem 0.125rem;\n max-width: calc(100% - 3.375rem);\n\n &::before {\n top: .1rem;\n bottom: .05rem;\n }\n\n &.with-video .media-inner { // TODO add support for video in previews in composer\n display: none;\n }\n\n .site-title,\n .site-description {\n flex: 1;\n max-width: 100%;\n max-height: 1rem;\n }\n\n .site-title {\n margin-top: .125rem;\n margin-bottom: 0.1875rem;\n }\n\n .site-description {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n }\n}\n","@import '../../../styles/mixins';\n\n.Composer {\n align-items: flex-end;\n\n .select-mode-active + .middle-column-footer & {\n position: absolute;\n padding-right: 2rem;\n bottom: 0;\n\n @media (max-width: 600px) {\n padding-right: 1rem;\n }\n\n &::before {\n right: 2.125rem;\n\n @media (max-width: 600px) {\n right: 1rem;\n }\n }\n\n .svg-appendix {\n opacity: 0;\n }\n }\n\n .form-control {\n --border-width: 0;\n }\n\n > .Button {\n flex-shrink: 0;\n margin-left: .5rem;\n\n @media (max-width: 600px) {\n width: 2.875rem;\n height: 2.875rem;\n }\n\n .icon-send,\n .icon-microphone-alt,\n .icon-check {\n position: absolute;\n }\n\n &:not(:active):not(:focus):not(:hover) {\n .icon-send,\n .icon-check {\n color: var(--color-primary);\n }\n }\n\n &.cancel {\n position: relative;\n z-index: 1;\n\n &:hover, &.active {\n background: var(--color-chat-hover);\n }\n }\n\n &.recording {\n position: relative;\n z-index: 0;\n transition: box-shadow .1s;\n }\n\n &.send {\n .icon-send {\n animation: grow-icon .4s ease-out;\n }\n\n .icon-microphone-alt,\n .icon-check {\n animation: hide-icon .4s forwards ease-out;\n }\n }\n\n &.record {\n .icon-microphone-alt {\n animation: grow-icon .4s ease-out;\n }\n\n .icon-send,\n .icon-check {\n animation: hide-icon .4s forwards ease-out;\n }\n }\n\n &.edit {\n .icon-send,\n .icon-microphone-alt {\n animation: hide-icon .4s forwards ease-out;\n }\n\n .icon-check {\n animation: grow-icon .4s ease-out;\n }\n }\n\n &.not-ready > i {\n animation-duration: 0ms !important;\n }\n\n body.animation-level-0 &, body.animation-level-1 & {\n .icon-send, .icon-microphone-alt, .icon-check {\n animation-duration: 0ms !important;\n }\n }\n }\n\n .mobile-symbol-menu-button {\n width: 2.875rem;\n height: 2.875rem;\n position: relative;\n\n .icon-smile,\n .icon-keyboard,\n .Spinner {\n position: absolute;\n }\n\n .Spinner {\n --spinner-size: 1.5rem;\n }\n\n .icon-smile {\n animation: grow-icon .4s ease-out;\n }\n\n .icon-keyboard, .Spinner {\n animation: hide-icon .4s forwards ease-out;\n }\n\n &.not-ready > i {\n animation-duration: 0ms !important;\n }\n\n &.is-loading {\n .Spinner {\n animation: grow-icon .4s ease-out;\n }\n\n .icon-keyboard, .icon-smile {\n animation: hide-icon .4s forwards ease-out;\n }\n }\n\n &.menu-opened {\n .icon-keyboard {\n animation: grow-icon .4s ease-out;\n }\n\n .icon-smile, .Spinner {\n animation: hide-icon .4s forwards ease-out;\n }\n }\n }\n}\n\n#message-compose {\n flex-grow: 1;\n max-width: calc(100% - 4rem);\n background: var(--color-background);\n border-radius: var(--border-radius-messages);\n border-bottom-right-radius: 0;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n position: relative;\n z-index: 1;\n\n .svg-appendix {\n position: absolute;\n bottom: -.1875rem;\n right: -.551rem; // This value is correct. Safari fix\n width: .5625rem;\n height: 1.25rem;\n transition: opacity 200ms;\n font-size: 1rem !important;\n\n .corner {\n fill: var(--color-background);\n }\n }\n\n @media (max-width: 600px) {\n max-width: calc(100% - 3rem);\n }\n}\n\n.message-input-wrapper {\n display: flex;\n\n > .Spinner {\n align-self: center;\n --spinner-size: 1.5rem;\n margin-right: -.5rem;\n }\n\n > .Button {\n flex-shrink: 0;\n background: none !important;\n width: 3.5rem;\n height: 3.5rem;\n margin: 0;\n padding: 0;\n align-self: flex-end;\n\n + .Button {\n margin-left: -1rem;\n }\n\n @media (max-width: 600px) {\n width: 2.875rem;\n height: 2.875rem;\n\n + .Button {\n margin-left: -0.6875rem;\n }\n }\n\n &.bot-commands {\n color: var(--color-primary) !important;\n\n // SymbolMenu button should be accessible if BotCommandsMenu opened\n body.is-touch-env &.activated + .Button.mobile-symbol-menu-button {\n z-index: calc(var(--z-menu-backdrop) + 1);\n }\n }\n\n &.scheduled-button i::after {\n content: '';\n position: absolute;\n top: .75rem;\n right: .75rem;\n border: .1875rem solid var(--color-background);\n box-sizing: content-box;\n width: .5rem;\n height: .5rem;\n border-radius: 50%;\n background: var(--color-green-darker);\n box-shadow: -.375rem -.25rem 0 -.1875rem var(--color-background);\n @media (max-width: 600px) {\n top: .5rem;\n right: .5rem;\n }\n }\n }\n\n > .input-group {\n flex-grow: 1;\n margin-bottom: 0;\n }\n\n .recording-state {\n display: inline-block;\n position: relative;\n line-height: 3.5rem;\n height: 3.5rem;\n padding: 0 3.125rem 0 1rem;\n\n &::after {\n content: '';\n width: 10px;\n height: 10px;\n background: var(--color-error);\n border-radius: 5px;\n position: absolute;\n top: 50%;\n margin-top: -5px;\n right: 1.375rem;\n }\n\n @media (max-width: 600px) {\n height: 2.875rem;\n line-height: 2.875rem;\n }\n }\n}\n\n#message-input-text,\n#caption-input-text {\n position: relative;\n\n .form-control {\n padding: calc((3.25rem - var(--composer-text-size, 1rem) * 1.375) / 2 - var(--border-width, 0) * 2) calc(.9rem - var(--border-width));\n overflow: hidden;\n line-height: 1.375;\n font-family: Roboto, -apple-system, \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;\n unicode-bidi: plaintext;\n text-align: initial;\n font-size: var(--composer-text-size, 1rem);\n\n body.is-ios &,\n body.is-macos & {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, \"Roboto\", \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;\n }\n\n &.overflown {\n overflow-y: auto;\n overflow-x: hidden;\n }\n\n &.touched, &:focus {\n & + .placeholder-text {\n display: none;\n }\n }\n\n &.focus-disabled {\n pointer-events: none;\n }\n }\n\n .forced-placeholder,\n .placeholder-text {\n position: absolute;\n color: var(--color-placeholders);\n pointer-events: none;\n unicode-bidi: plaintext;\n text-align: initial;\n line-height: 1.3125;\n font-size: var(--composer-text-size, 1rem);\n top: calc((3.25rem - var(--composer-text-size, 1rem) * 1.375) / 2);\n bottom: auto;\n }\n\n .forced-placeholder {\n z-index: var(--z-below);\n left: 0;\n white-space: nowrap;\n overflow: hidden;\n max-width: 100%;\n text-overflow: ellipsis;\n }\n\n &[dir=rtl] .placeholder-text {\n right: 0;\n }\n\n .text-entity-link {\n color: var(--color-links) !important;\n cursor: default;\n text-decoration: none;\n\n &:hover, &:active, &:visited {\n color: var(--color-links-hover) !important;\n }\n }\n\n .clone {\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n pointer-events: none;\n z-index: -10;\n unicode-bidi: plaintext;\n text-align: initial;\n }\n}\n\n#message-input-text {\n flex-grow: 1;\n\n .form-control {\n margin-bottom: 0;\n background: transparent !important;\n border: none !important;\n border-radius: 0 !important;\n box-shadow: none !important;\n caret-color: var(--color-text);\n min-height: 3.5rem;\n max-height: 26rem;\n line-height: 1.3125;\n padding: calc((3.5rem - var(--composer-text-size, 1rem) * 1.3125) / 2) 0;\n\n @media (max-width: 600px) {\n height: 2.875rem;\n min-height: 2.875rem;\n max-height: 16rem;\n padding: calc((2.875rem - var(--composer-text-size, 1rem) * 1.3125) / 2) 0;\n overflow: auto;\n }\n\n transition: height 100ms ease;\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n .forced-placeholder,\n .placeholder-text {\n top: calc((3.5rem - var(--composer-text-size, 1rem) * 1.3125) / 2);\n\n @media (max-width: 600px) {\n top: calc((2.875rem - var(--composer-text-size, 1rem) * 1.3125) / 2);\n }\n }\n\n &:not(:only-child) {\n .form-control {\n padding-left: 0;\n padding-right: 0;\n }\n }\n\n .ComposerEmbeddedMessage + .message-input-wrapper &,\n .WebPagePreview + .message-input-wrapper & {\n .form-control.overflown {\n margin-top: 0.75rem;\n }\n }\n\n .emoji {\n width: 1.25rem;\n height: 1.25rem;\n margin: 0 1px -5px;\n vertical-align: 0;\n pointer-events: none;\n }\n}\n\n#caption-input-text {\n .form-control {\n height: 3.25rem;\n min-height: 3.25rem;\n max-height: 15rem;\n }\n\n .placeholder-text {\n bottom: .8125rem;\n left: .90625rem;\n }\n}\n\n.composer-tooltip {\n position: absolute;\n bottom: calc(100% + .5rem);\n left: 0;\n width: 100%;\n background: var(--color-background);\n border-radius: var(--border-radius-messages);\n padding: 0.5rem 0;\n max-height: 15rem;\n\n overflow-x: hidden;\n overflow-y: auto;\n @include overflow-y-overlay();\n\n box-shadow: 0 1px 2px var(--color-default-shadow);\n\n opacity: 0;\n transform: translateY(1.5rem);\n transform-origin: bottom;\n transition: opacity var(--layer-transition), transform var(--layer-transition);\n\n &:not(.shown) {\n display: none;\n }\n\n &.open {\n opacity: 1;\n transform: translateY(0);\n }\n\n .Loading {\n margin: 1rem 0;\n }\n}\n","#middle-column-bg {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n overflow: hidden;\n z-index: -1;\n\n &::before,\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n background-color: var(--theme-background-color);\n }\n\n &::after {\n .theme-light & {\n background-image: url('../../assets/chat-bg.jpg');\n\n @media (max-width: 600px) {\n background-image: url('../../assets/chat-bg-mobile.jpg');\n }\n }\n\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n\n body:not(.animation-level-0) #root & {\n transition: transform var(--layer-transition), opacity .2s !important;\n }\n\n body.animation-level-0 & {\n transition: none;\n }\n }\n\n .custom-bg-color:not(.custom-bg-image) > &::after {\n opacity: 0;\n }\n\n .custom-bg-image > &::after {\n background-image: var(--custom-background) !important;\n filter: none;\n transform: scale(1.1);\n }\n\n .custom-bg-image.blurred > &::after {\n filter: blur(12px);\n }\n\n @media screen and (min-width: 1276px) {\n body.animation-level-2 &::after {\n margin: -16rem -5rem -20rem 0;\n overflow: hidden;\n transform: scale(1);\n transform-origin: left center;\n transition: transform var(--layer-transition);\n }\n\n body.animation-level-2 #Main.right-column-open &::after {\n transform: scale(0.67) !important;\n }\n }\n}\n\n#MiddleColumn {\n display: flex;\n justify-content: center;\n height: 100%;\n position: relative;\n z-index: 1;\n\n @media (max-width: 600px) {\n overflow: hidden;\n }\n\n .messages-layout {\n --slide-transition: 450ms cubic-bezier(0.25, 1, 0.5, 1);\n\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n\n > .Transition {\n width: 100%;\n height: 100%;\n overflow: hidden;\n\n > div {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n }\n }\n\n .messaging-disabled {\n &-inner {\n width: 100%;\n padding: 1rem;\n border-radius: var(--border-radius-messages);\n background: var(--color-background);\n color: var(--color-text-secondary);\n text-align: center;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n }\n }\n\n .Composer {\n #message-compose {\n transform: scaleX(1) translateX(0);\n transition: transform var(--select-transition), border-bottom-right-radius var(--select-transition);\n\n &::before {\n transform: scaleX(-1) translateX(0);\n transition: transform var(--select-transition);\n }\n\n body.animation-level-0 & {\n &, &::before {\n transition: none !important;\n }\n }\n }\n\n .message-input-wrapper, &::before {\n opacity: 1;\n transition: opacity var(--select-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n > .Button {\n opacity: 1;\n transform: scale(1);\n transition: opacity var(--select-transition), transform var(--select-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n &.hover-disabled, &:not(.shown) {\n pointer-events: none;\n }\n\n &:not(.shown) {\n .ComposerEmbeddedMessage {\n height: 0;\n }\n\n #message-compose {\n transform: scaleX(var(--composer-hidden-scale, 1)) translateX(var(--composer-translate-x, 0));\n border-bottom-right-radius: var(--border-radius-messages);\n\n &::before {\n transform: scaleX(-1) translateX(200%);\n }\n }\n\n #editable-message-text {\n height: 3.5rem !important;\n\n @media (max-width: 600px) {\n height: 2.5rem !important;\n }\n }\n\n .message-input-wrapper, &::before {\n opacity: 0;\n }\n\n > .Button {\n opacity: 0 !important;\n transform: scale(0.5);\n }\n }\n }\n\n .messaging-disabled {\n transform: scaleX(1);\n transition: transform var(--select-transition);\n\n .messaging-disabled-inner span {\n opacity: 1;\n transition: opacity var(--select-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n &:not(.shown) {\n transform: scaleX(var(--composer-hidden-scale, 1));\n pointer-events: none;\n\n .messaging-disabled-inner span {\n opacity: 0;\n }\n }\n }\n\n .middle-column-footer {\n width: 100%;\n max-width: var(--messages-container-width);\n padding: 0 1rem;\n position: relative;\n display: flex;\n align-items: flex-end;\n z-index: var(--z-middle-footer);\n\n transform: translate3d(0, 0, 0);\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n @media (min-width: 1276px) {\n width: calc(100% - var(--right-column-width));\n\n #Main.right-column-open & {\n transform: translate3d(calc(var(--right-column-width) / -2), 0, 0);\n }\n }\n\n @media (max-width: 600px) {\n padding: 0 0.5rem;\n\n body.is-symbol-menu-open & {\n transform: translate3d(0, calc(-1 * (var(--symbol-menu-height) + var(--symbol-menu-footer-height))), 0);\n }\n }\n\n &::before {\n content: \"\";\n position: absolute;\n top: -.5625rem;\n left: 0;\n right: 0;\n height: 1px;\n background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 2%, rgba(255, 255, 255, 0.4) 98%, rgba(255, 255, 255, 0) 100%);\n opacity: 0;\n transition: opacity 350ms ease;\n\n @media (max-width: 600px) {\n left: -2%;\n right: -2%;\n }\n }\n\n &.with-notch::before {\n opacity: 1;\n }\n\n html.theme-dark &::before {\n background: linear-gradient(90deg, rgba(127, 127, 127, 0) 0%, rgba(127, 127, 127, 0.4) 2%, rgba(127, 127, 127, 0.4) 98%, rgba(127, 127, 127, 0) 100%);\n }\n }\n}\n\n/* Common styles for message list fade-out shadow */\n.Composer,\n.MessageSelectToolbar,\n.messaging-disabled {\n margin-bottom: 1.25rem;\n\n @media (max-width: 600px) {\n margin-bottom: 0.5rem;\n }\n}\n\n.Composer,\n.MessageSelectToolbar,\n.unpin-all-button,\n.messaging-disabled {\n width: 100%;\n display: flex;\n justify-content: center;\n position: relative;\n}\n\n.MessageSelectToolbar-inner,\n.unpin-all-button,\n.messaging-disabled {\n .mask-image-disabled & {\n box-shadow: 0 .25rem .5rem .125rem var(--color-default-shadow);\n }\n}\n\n.unpin-button-container {\n width: 100%;\n display: flex;\n justify-content: center;\n position: absolute;\n padding-bottom: 1.25rem;\n\n .unpin-all-button {\n text-transform: capitalize;\n color: var(--color-black);\n height: 3.5rem;\n overflow: visible;\n transform: scaleX(1);\n transition: transform var(--select-transition), background-color .15s, color .15s;\n\n &:hover {\n .icon-unpin {\n color: var(--color-white);\n }\n }\n\n .select-mode-active + .middle-column-footer & {\n box-shadow: none;\n transform: scaleX(var(--unpin-hidden-scale));\n }\n\n @media (max-width: 600px) {\n height: 2.5rem;\n }\n\n .icon-unpin {\n margin-inline-start: -0.4375rem;\n margin-inline-end: .75rem;\n color: var(--color-text-secondary);\n font-size: 1.5rem;\n transition: color .15s\n }\n }\n\n @media (max-width: 600px) {\n padding-bottom: 0.75rem;\n }\n\n .mask-image-disabled &::before {\n background: unset;\n }\n}\n",".RightHeader {\n display: flex;\n align-items: center;\n height: var(--header-height);\n padding: 0.5rem .8125rem;\n pointer-events: auto;\n\n @media (max-width: 600px) {\n padding: 0.5rem;\n }\n\n .close-button {\n flex-shrink: 0;\n }\n\n > .Transition {\n flex: 1;\n height: 100%;\n\n > div {\n display: flex;\n align-items: center;\n }\n }\n\n h3 {\n margin-bottom: 0;\n font-size: 1.25rem;\n font-weight: 500;\n margin-left: 1.375rem;\n }\n\n .tools {\n display: flex;\n margin-left: auto;\n }\n\n .SearchInput {\n margin-left: 1rem;\n\n @media (min-width: 600px) {\n margin-right: 1rem;\n }\n }\n\n .DropdownMenu {\n margin-left: auto;\n }\n}\n","@import '../../styles/mixins';\n\n.Profile {\n height: 100%;\n display: flex;\n flex-direction: column;\n\n overflow-x: hidden;\n overflow-y: scroll;\n @include overflow-y-overlay();\n\n > .profile-info > .ChatInfo {\n grid-area: chat_info;\n\n .status.online {\n color: var(--color-primary);\n }\n }\n\n > .profile-info > .ChatExtra {\n padding: .875rem .5rem .5rem;\n box-shadow: inset 0 -.0625rem 0 0 var(--color-background-secondary-accent);\n border-bottom: .625rem solid var(--color-background-secondary);\n\n .narrow {\n margin-bottom: 0;\n }\n\n .inactive.no-selection {\n user-select: auto;\n -webkit-user-select: auto !important;\n }\n\n .Switcher {\n margin-left: auto;\n }\n [dir=rtl] {\n .Switcher {\n margin-left: 0;\n margin-right: auto;\n }\n }\n }\n\n .FloatingActionButton {\n z-index: 1;\n }\n}\n\n.shared-media {\n display: flex;\n flex-direction: column-reverse;\n\n .TabList {\n background: var(--color-background);\n top: -1px;\n z-index: 1;\n\n .Tab {\n padding: 1rem .25rem;\n i {\n bottom: -1rem;\n }\n }\n }\n\n .Transition {\n flex: 1;\n }\n\n .content {\n &.empty-list {\n height: 100%;\n padding-top: 5rem;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n\n .Spinner {\n --spinner-size: 2.75rem;\n }\n }\n\n &.media-list {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-auto-rows: 1fr;\n grid-gap: .0625rem;\n }\n\n &.documents-list {\n padding: 1.25rem;\n\n & .File + .File {\n margin-top: 1.25rem;\n }\n }\n\n &.links-list {\n padding: 1.25rem;\n\n .ProgressSpinner,\n .message-upload-progress {\n display: none;\n }\n }\n\n &.audio-list {\n padding: 1.25rem;\n\n & .Audio {\n .media-loading {\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n & + .Audio {\n margin-top: 1.6875rem;\n }\n }\n }\n\n &.members-list {\n padding: 0.5rem 1rem;\n\n @media (max-width: 600px) {\n padding: .5rem 0;\n .ListItem.chat-item-clickable {\n margin: 0;\n }\n }\n }\n }\n}\n",".AddChatMembers {\n height: 100%;\n overflow: hidden;\n position: relative;\n\n &-inner {\n height: 100%;\n overflow: hidden;\n }\n}\n","#RightColumn {\n position: absolute;\n top: 0;\n right: 0;\n width: var(--right-column-width);\n height: 100%;\n transform: translate3d(var(--right-column-width), 0, 0);\n background: var(--color-background);\n border-left: 1px solid var(--color-borders);\n z-index: var(--z-right-column);\n\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none;\n }\n\n // @optimization\n &:not(:hover) {\n .chat-item-clickable:not(.picker-list-item):nth-child(n + 18) {\n display: none !important;\n }\n }\n\n @media (max-width: 1275px) {\n box-shadow: 0 .25rem .5rem .125rem var(--color-default-shadow);\n border-left: none;\n }\n\n @media (max-width: 600px) {\n width: 100vw;\n transform: translate3d(110vw, 0, 0);\n }\n\n > .Transition {\n height: calc(100% - var(--header-height));\n overflow: hidden;\n }\n\n .Management .section > .ChatInfo {\n padding: 0 1.5rem;\n margin: 1rem 0;\n text-align: center;\n\n .Avatar {\n margin: 0 auto .5rem;\n\n &.no-photo {\n cursor: default !important;\n }\n }\n\n .title {\n display: flex;\n justify-content: center;\n align-items: center;\n\n h3 {\n font-weight: 500;\n font-size: 1.25rem;\n line-height: 2rem;\n white-space: pre-wrap;\n word-break: break-word;\n }\n\n .VerifiedIcon {\n margin-left: 0.25rem;\n margin-bottom: .5rem;\n }\n\n .emoji {\n width: 1.5rem;\n height: 1.5rem;\n background-size: 1.5rem;\n }\n }\n\n .status {\n font-size: 0.875rem;\n color: #868e96;\n }\n }\n}\n\n#RightColumn-wrapper {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: var(--z-right-column);\n overflow: hidden;\n visibility: hidden;\n pointer-events: none;\n\n @media (max-width: 1275px) {\n position: fixed;\n }\n\n &.is-hidden {\n display: none;\n }\n\n .overlay-backdrop {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n background: black;\n opacity: 0;\n\n @media (max-width: 600px) {\n transition: opacity var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none;\n }\n }\n }\n\n #Main.right-column-open &, body.animating-right-column & {\n visibility: visible;\n }\n\n #Main.right-column-open & {\n @media (max-width: 600px) {\n .overlay-backdrop {\n opacity: var(--layer-blackout-opacity);\n }\n }\n\n #RightColumn {\n pointer-events: auto;\n transform: translate3d(0, 0, 0);\n }\n }\n}\n","#Main {\n display: flex;\n height: 100%;\n text-align: left;\n overflow: hidden;\n\n @media (min-width: 1276px) {\n position: relative;\n }\n\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n}\n\n#LeftColumn {\n flex: 1;\n min-width: 18rem;\n max-width: 26.5rem;\n height: 100%;\n\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n\n @media (min-width: 1680px) {\n border-left: 1px solid var(--color-borders);\n }\n\n @media (max-width: 1275px) {\n flex: 2;\n }\n\n @media (max-width: 925px) {\n position: fixed;\n left: 0;\n top: 0;\n height: calc(var(--vh, 1vh) * 100);\n width: 26.5rem;\n\n transform: translate3d(-5rem, 0, 0);\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none;\n }\n\n &::after {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n background: black;\n opacity: var(--layer-blackout-opacity);\n transition: opacity var(--layer-transition);\n z-index: 1;\n\n body.animation-level-0 & {\n transition: none;\n }\n\n // @optimization\n body.is-android & {\n display: none;\n }\n\n body.is-android .middle-column-shown & {\n display: block;\n }\n }\n\n #Main:not(.middle-column-open) & {\n transform: translate3d(0, 0, 0);\n\n &::after {\n opacity: 0;\n pointer-events: none;\n }\n }\n\n #Main.history-animation-disabled & {\n transition: none;\n\n &:after {\n transition: none;\n }\n }\n }\n\n @media (max-width: 600px) {\n max-width: none;\n width: 100vw;\n transform: translate3d(-20vw, 0, 0);\n }\n}\n\n#RightColumn {\n @media (min-width: 1680px) {\n border-right: 1px solid var(--color-borders);\n }\n\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100 + 1px);\n }\n\n #Main.history-animation-disabled & {\n transition: none;\n\n .overlay-backdrop {\n transition: none;\n }\n }\n}\n\n#Main.history-animation-disabled .overlay-backdrop {\n transition: none;\n}\n\n#MiddleColumn {\n flex: 3;\n border-left: 1px solid var(--color-borders);\n max-width: 75vw;\n\n @media (max-width: 1275px) {\n max-width: calc(100vw - 26.5rem);\n }\n\n @media (max-width: 66.25rem) {\n max-width: 60vw;\n }\n\n @media (min-width: 1680px) {\n border-right: 1px solid var(--color-borders);\n max-width: calc(1680px - 26.5rem);\n }\n\n @media (max-width: 925px) {\n max-width: none;\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n\n transform: translate3d(0, 0, 0);\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none;\n }\n\n #Main:not(.middle-column-open) & {\n transform: translate3d(26.5rem, 0, 0);\n }\n }\n\n @media (max-width: 600px) {\n border-left: none;\n\n #Main:not(.middle-column-open) & {\n transform: translate3d(100vw, 0, 0);\n }\n\n #Main.right-column-open & {\n transform: translate3d(-20vw, 0, 0);\n }\n }\n\n #Main.history-animation-disabled & {\n transition: none;\n\n &:after {\n transition: none;\n }\n }\n}\n\nbody.is-android.animation-level-1 {\n --layer-transition: 250ms ease-in-out;\n\n #LeftColumn, #MiddleColumn, #RightColumn {\n transition: transform var(--layer-transition), opacity var(--layer-transition);\n }\n\n #Main:not(.middle-column-shown) {\n #MiddleColumn {\n display: none;\n }\n }\n\n #Main:not(.middle-column-open) {\n #MiddleColumn {\n transform: translate3d(10vw, 0, 0);\n opacity: 0;\n }\n }\n\n #Main.middle-column-open {\n #LeftColumn {\n transform: translate3d(0, 0, 0);\n opacity: 0;\n }\n }\n\n #Main:not(.right-column-shown) {\n #RightColumn {\n display: none;\n }\n }\n\n #Main:not(.right-column-open) {\n #RightColumn {\n transform: translate3d(10vw, 0, 0);\n opacity: 0;\n }\n }\n\n #Main.right-column-open {\n #MiddleColumn {\n transform: translate3d(0, 0, 0);\n opacity: 0;\n }\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/433.29f542772c88e944d938.js b/dist/433.29f542772c88e944d938.js deleted file mode 100644 index 11731a1e..00000000 --- a/dist/433.29f542772c88e944d938.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[433],{8065:(e,t,s)=>{s.r(t),s.d(t,{Main:()=>no});var n=s(5116),a=s(3716),o=s(4050),r=(s(7895),s(1752)),i=s(8085),c=s(735),d=s(2858);function l(e){const{chatId:t,threadId:s}=(0,i.Bt)(e)||{};return t&&s?(e=(0,r.qr)(e,t,s,!1),e=(0,r.Pb)(e,t,s,void 0)):e}(0,n.Q6)("openLocalTextSearch",(e=>{const{chatId:t,threadId:s}=(0,i.Bt)(e)||{};if(t&&s)return(0,r.qr)(e,t,s,!0)})),(0,n.Q6)("closeLocalTextSearch",l),(0,n.Q6)("setLocalTextSearchQuery",((e,t,s)=>{const{chatId:n,threadId:a}=(0,i.Bt)(e)||{};if(!n||!a)return;const{query:o}=s,l=(0,d.uw)(n,a),{query:u}=e.localTextSearch.byChatThreadKey[l]||{};return o!==u&&(e=(0,r.Pb)(e,n,a,c.D)),(0,r.qr)(e,n,a,!0,o)})),(0,n.Q6)("setLocalMediaSearchType",((e,t,s)=>{const{chatId:n}=(0,i.Bt)(e)||{};if(!n)return;const{mediaType:a}=s;return(0,r.z5)(e,n,a)})),(0,n.Q6)("openChat",((e,t,s)=>{const{id:a,threadId:o=-1,type:c="thread",shouldReplaceHistory:d=!1}=s,u=(0,i.Bt)(e);return u&&u.chatId===a&&u.threadId===o&&u.type===c||(e=(0,r.pf)(e,a,o,"replyStack",[]),e=l(e=(0,r.i9)(e)),e={...e,messages:{...e.messages,contentToBeScheduled:void 0},...a!==e.forwardMessages.toChatId&&{forwardMessages:{}}},(0,n.R3)(e)),(0,r.Wy)(e,a,o,c,d)})),(0,n.Q6)("openPreviousChat",(e=>(0,r.Wy)(e,void 0))),(0,n.Q6)("openChatWithInfo",((e,t,s)=>{(0,n.R3)({...e,isChatInfoShown:!0}),t.openChat(s)})),(0,n.Q6)("resetChatCreation",(e=>({...e,chatCreation:void 0}))),(0,n.Q6)("setNewChatMembersDialogState",((e,t,s)=>({...e,newChatMembersProgress:s}))),(0,n.Q6)("openNextChat",((e,t,s)=>{const{targetIndexDelta:n,orderedIds:a}=s,{chatId:o}=(0,i.Bt)(e)||{};if(!o)return void t.openChat({id:a[0]});const r=a.indexOf(o);if(-1===r)return;const c=a[r+n];t.openChat({id:c,shouldReplaceHistory:!0})}));var u=s(6137),h=s(1713),m=s(7361),g=s(782);const f=a.ck+a.fK;let p;(0,n.Q6)("setScrollOffset",((e,t,s)=>{const{chatId:n,threadId:a,scrollOffset:o}=s;return(0,r.pf)(e,n,a,"scrollOffset",o)})),(0,n.Q6)("setReplyingToId",((e,t,s)=>{const{messageId:n}=s,a=(0,i.Bt)(e);if(!a)return;const{chatId:o,threadId:c}=a;return(0,r.pf)(e,o,c,"replyingToId",n)})),(0,n.Q6)("setEditingId",((e,t,s)=>{const{messageId:n}=s,a=(0,i.Bt)(e);if(!a)return;const{chatId:o,threadId:c,type:d}=a,l="scheduled"===d?"editingScheduledId":"editingId";return(0,r.pf)(e,o,c,l,n)})),(0,n.Q6)("editLastMessage",(e=>{const{chatId:t,threadId:s}=(0,i.Bt)(e)||{};if(!t||!s)return;const n=(0,i.Zw)(e,t),a=(0,i.Cb)(e,t,s);if(!n||!a)return;const o=(0,g.dF)(a,(t=>Boolean(n[t]&&(0,i._k)(e,n[t],s).canEdit)));return o?(0,r.pf)(e,t,s,"editingId",o):void 0})),(0,n.Q6)("replyToNextMessage",((e,t,s)=>{const{targetIndexDelta:n}=s,{chatId:a,threadId:o}=(0,i.Bt)(e)||{};if(!a||!o)return;const r=(0,i.Zw)(e,a),c=(0,i.Cb)(e,a,o);if(!r||!c)return;const d=(0,i.Yy)(e,a,o);let l;if((0,i.b9)(e,a,o)&&d){const e=Object.keys(r),t=e.indexOf(d.toString())+n;l=t<=e.length+1&&t>=0?Number(e[t]):void 0}else if(o===u._f){var h;const t=(0,i.Z1)(e,a);l=null==t||null===(h=t.lastMessage)||void 0===h?void 0:h.id}else{const t=(0,i.tZ)(e,a,o);l=null==t?void 0:t.lastMessageId}t.setReplyingToId({messageId:l}),t.focusMessage({chatId:a,threadId:o,messageId:l})})),(0,n.Q6)("openMediaViewer",((e,t,s)=>{const{chatId:n,threadId:a,messageId:o,avatarOwnerId:r,profilePhotoIndex:i,origin:c}=s;return{...e,mediaViewer:{chatId:n,threadId:a,messageId:o,avatarOwnerId:r,profilePhotoIndex:i,origin:c},forwardMessages:{}}})),(0,n.Q6)("closeMediaViewer",(e=>({...e,mediaViewer:{}}))),(0,n.Q6)("openAudioPlayer",((e,t,s)=>{const{chatId:n,threadId:a,messageId:o}=s;return{...e,audioPlayer:{chatId:n,threadId:a,messageId:o}}})),(0,n.Q6)("closeAudioPlayer",(e=>({...e,audioPlayer:{}}))),(0,n.Q6)("openPollResults",((e,t,s)=>{const{chatId:a,messageId:o}=s;(0,i.Jf)(e)?a===e.pollResults.chatId&&o===e.pollResults.messageId||(0,n.R3)({...e,pollResults:{chatId:a,messageId:o,voters:{}}}):window.setTimeout((()=>{const e=(0,n.Rd)();(0,n.R3)({...e,pollResults:{chatId:a,messageId:o,voters:{}}})}),450)})),(0,n.Q6)("closePollResults",(e=>{(0,n.R3)({...e,pollResults:{}})})),(0,n.Q6)("focusLastMessage",((e,t)=>{const s=(0,i.Bt)(e);if(!s)return;const{chatId:n,threadId:a}=s;let o;if(a===u._f){var r;const t=(0,i.Z1)(e,n);o=null==t||null===(r=t.lastMessage)||void 0===r?void 0:r.id}else{const t=(0,i.tZ)(e,n,a);o=null==t?void 0:t.lastMessageId}o&&t.focusMessage({chatId:n,threadId:a,messageId:o,noHighlight:!0})})),(0,n.Q6)("focusNextReply",((e,t)=>{const s=(0,i.Bt)(e);if(!s)return;const{chatId:a,threadId:o}=s,c=(0,i.p9)(e,a,o);if(c&&0!==c.length){const s=c.pop();e=(0,r.pf)(e,a,o,"replyStack",[...c]),(0,n.R3)(e),t.focusMessage({chatId:a,threadId:o,messageId:s})}else t.focusLastMessage()})),(0,n.Q6)("focusMessage",((e,t,s)=>{const{chatId:a,threadId:o=u._f,messageListType:c="thread",noHighlight:d,groupedId:l,groupedChatId:m,replyMessageId:g,isResizingContainer:I}=s;let{messageId:v}=s;if(void 0!==l){const t=(0,i.y8)(e,m,l);null!=t&&t.length&&([v]=t)}const y=(0,i.Bt)(e),Z=!y||a!==y.chatId||o!==y.threadId||c!==y.type;if(p&&(clearTimeout(p),p=void 0),p=window.setTimeout((()=>{let e=(0,n.Rd)();e=(0,r.cq)(e),e=(0,r.wV)(e),(0,n.R3)(e)}),d?f:1500),e=(0,r.cq)(e,a,v,d,I),e=(0,r.wV)(e,void 0),g){const t=(0,i.p9)(e,a,o)||[];e=(0,r.pf)(e,a,o,"replyStack",[...t,g])}Z&&(e=(0,r.wV)(e,h.fo.Static));const P=(0,i.Cb)(e,a,o);if(P&&P.includes(v))return(0,n.R3)(e),void t.openChat({id:a,threadId:o});if(Z&&(e=(0,r.pf)(e,a,o,"viewportIds",void 0)),e=(0,r.pf)(e,a,o,"outlyingIds",void 0),P&&!Z){const t=v>P[0]?h.fo.Down:h.fo.Up;e=(0,r.wV)(e,t)}(0,n.R3)(e),t.openChat({id:a,threadId:o}),t.loadViewportMessages()})),(0,n.Q6)("openForwardMenu",((e,t,s)=>{const{fromChatId:n,messageIds:a,groupedId:o}=s;let r;return o&&(r=(0,i.xH)(e,n,o)),{...e,forwardMessages:{fromChatId:n,messageIds:r||a,isModalShown:!0}}})),(0,n.Q6)("exitForwardMode",(e=>{(0,n.R3)({...e,forwardMessages:{}})})),(0,n.Q6)("setForwardChatId",((e,t,s)=>{const{id:a}=s;(0,n.R3)({...e,forwardMessages:{...e.forwardMessages,toChatId:a,isModalShown:!1}}),t.openChat({id:a}),t.closeMediaViewer(),t.exitMessageSelectMode()})),(0,n.Q6)("openForwardMenuForSelectedMessages",((e,t)=>{if(!e.selectedMessages)return;const{chatId:s,messageIds:n}=e.selectedMessages;t.openForwardMenu({fromChatId:s,messageIds:n})})),(0,n.Q6)("enterMessageSelectMode",((e,t,s)=>{const{messageId:n}=s||{},a=(0,i.jr)(e);return a?(0,r.M6)(e,a.id,n):e})),(0,n.Q6)("toggleMessageSelection",((e,t,s)=>{const{messageId:a,groupedId:o,childMessageIds:c,withShift:d}=s,l=(0,i.Bt)(e);if(!l)return;const{chatId:u,threadId:h,type:g}=l;e=(0,r.Ob)(e,u,h,g,a,o,c,d),(0,n.R3)(e),e.shouldShowContextMenuHint&&(t.disableContextMenuHint(),t.showNotification({message:`To **edit** or **reply**, close this menu. Then ${m.$b?"long tap":"right click"} on a message.`}))})),(0,n.Q6)("disableContextMenuHint",(e=>{if(e.shouldShowContextMenuHint)return{...e,shouldShowContextMenuHint:!1}})),(0,n.Q6)("exitMessageSelectMode",r.i9),(0,n.Q6)("openPollModal",(e=>({...e,isPollModalOpen:!0}))),(0,n.Q6)("closePollModal",(e=>({...e,isPollModalOpen:!1}))),(0,n.Q6)("setGlobalSearchQuery",((e,t,s)=>{const{query:n}=s,{chatId:a}=e.globalSearch;return(0,r.No)(e,{globalResults:{},localResults:{},resultsByType:void 0,...n?{fetchingStatus:{chats:!a,messages:!0}}:{fetchingStatus:void 0},query:n})})),(0,n.Q6)("addRecentlyFoundChatId",((e,t,s)=>{const{id:n}=s,{recentlyFoundChatIds:a}=e.globalSearch;if(!a)return(0,r.No)(e,{recentlyFoundChatIds:[n]});const o=a.filter((e=>e!==n));return o.unshift(n),o.length>10&&o.pop(),(0,r.No)(e,{recentlyFoundChatIds:o})})),(0,n.Q6)("clearRecentlyFoundChats",(e=>(0,r.No)(e,{recentlyFoundChatIds:void 0}))),(0,n.Q6)("setGlobalSearchContent",((e,t,s)=>{const{content:n}=s;return(0,r.Og)(e,n)})),(0,n.Q6)("setGlobalSearchChatId",((e,t,s)=>{const{id:n}=s;return(0,r.No)(e,{chatId:n,query:void 0,resultsByType:void 0})})),(0,n.Q6)("setStickerSearchQuery",((e,t,s)=>{const{query:n}=s;return{...e,stickers:{...e.stickers,search:{query:n,resultIds:void 0}}}})),(0,n.Q6)("setGifSearchQuery",((e,t,s)=>{const{query:n}=s;return{...e,gifs:{...e.gifs,search:{query:n,offsetId:void 0,results:void 0}}}})),(0,n.Q6)("openUserInfo",((e,t,s)=>{const{id:n}=s;t.openChat({id:n})})),(0,n.Q6)("openChat",(e=>(0,r.x1)(e,void 0))),(0,n.Q6)("setUserSearchQuery",((e,t,s)=>{const{query:n}=s;return(0,r.Lm)(e,{globalUserIds:void 0,localUserIds:void 0,fetchingStatus:Boolean(n),query:n})})),s(3781);var I=s(1947),v=s(6926);(0,n.Q6)("toggleChatInfo",(e=>({...e,isChatInfoShown:!e.isChatInfoShown}))),(0,n.Q6)("toggleManagement",(e=>{const{chatId:t}=(0,i.Bt)(e)||{};if(t)return{...e,management:{byChatId:{...e.management.byChatId,[t]:{...e.management.byChatId[t],isActive:!(e.management.byChatId[t]||{}).isActive}}}}})),(0,n.Q6)("closeManagement",(e=>{const{chatId:t}=(0,i.Bt)(e)||{};if(t)return{...e,management:{byChatId:{...e.management.byChatId,[t]:{...e.management.byChatId[t],isActive:!1}}}}})),(0,n.Q6)("openChat",(e=>{if(m.wB||m.p7)return{...e,isLeftColumnShown:0===e.messages.messageLists.length}})),(0,n.Q6)("toggleLeftColumn",(e=>({...e,isLeftColumnShown:!e.isLeftColumnShown}))),(0,n.Q6)("addRecentEmoji",((e,t,s)=>{const{emoji:n}=s,{recentEmojis:a}=e;if(!a)return{...e,recentEmojis:[n]};const o=a.filter((e=>e!==n));return o.unshift(n),o.length>18&&o.pop(),{...e,recentEmojis:o}})),(0,n.Q6)("addRecentSticker",((e,t,s)=>{const{sticker:n}=s,{recent:a}=e.stickers;if(!a)return{...e,stickers:{...e.stickers,recent:{hash:0,stickers:[n]}}};const o=a.stickers.filter((e=>e.id!==n.id));return o.unshift(n),{...e,stickers:{...e.stickers,recent:{...a,stickers:o}}}})),(0,n.Q6)("showNotification",((e,t,s)=>{const n=s;n.localId=(0,v.Z)({});const a=[...e.notifications],o=a.findIndex((e=>e.message===n.message));return-1!==o&&a.splice(o,1),a.push(n),{...e,notifications:a}})),(0,n.Q6)("dismissNotification",((e,t,s)=>{const n=e.notifications.filter((({localId:e})=>e!==s.localId));return{...e,notifications:n}})),(0,n.Q6)("showDialog",((e,t,s)=>{const{data:n}=s;if("message"in n&&n.hasErrorKey&&!(0,I.ZP)(n))return e;const a=[...e.dialogs];if("message"in n){const e=a.findIndex((e=>e.message===n.message));-1!==e&&a.splice(e,1)}return a.push(n),{...e,dialogs:a}})),(0,n.Q6)("dismissDialog",(e=>{const t=[...e.dialogs];return t.pop(),{...e,dialogs:t}})),(0,n.Q6)("toggleSafeLinkModal",((e,t,s)=>{const{url:n}=s;return{...e,safeLinkModalUrl:n}})),(0,n.Q6)("openHistoryCalendar",((e,t,s)=>{const{selectedAt:n}=s;return{...e,historyCalendarSelectedAt:n}})),(0,n.Q6)("closeHistoryCalendar",(e=>({...e,historyCalendarSelectedAt:void 0}))),(0,n.Q6)("openPaymentModal",((e,t,s)=>{const{chatId:n,messageId:a}=s;return{...e,payment:{...e.payment,chatId:n,messageId:a,isPaymentModalOpen:!0}}})),(0,n.Q6)("closePaymentModal",(e=>{const t=(0,r.bp)(e);return(0,r.WY)(t)})),(0,n.Q6)("addPaymentError",((e,t,s)=>{const{error:n}=s;return{...e,payment:{...e.payment,error:n}}})),s(1363);var y=s(1226),Z=s(9118);const P=(0,Z.P2)((e=>e()),1e3,!0),C=(0,Z.P2)((e=>e()),3e3,!0),w=(0,Z.Ds)((e=>e()),500,!1,!0);async function b(e,t,s){const o=await(0,y.t9)("fetchChats",{limit:a.Ov,offsetDate:s,archived:"archived"===e,withPinned:void 0===(0,n.Rd)().chats.orderedPinnedIds[e],serverTimeOffset:(0,n.Rd)().serverTimeOffset});if(!o)return;const{chatIds:i}=o;i.length>0&&i[0]===t&&i.shift();let c=(0,n.Rd)();c=(0,r.Sh)(c,(0,g.ee)(o.users,"id")),c=(0,r.GL)(c,(0,g.ee)(o.chats,"id")),c=(0,r.B1)(c,e,i),c=(0,r.vv)(c,e,o),Object.keys(o.draftsById).map(Number).forEach((e=>{c=(0,r.pf)(c,e,u._f,"draft",o.draftsById[e])})),Object.keys(o.replyingToById).map(Number).forEach((e=>{c=(0,r.pf)(c,e,u._f,"replyingToId",o.replyingToById[e])})),0!==i.length||c.chats.isFullyLoaded[e]||(c={...c,chats:{...c.chats,isFullyLoaded:{...c.chats.isFullyLoaded,[e]:!0}}}),(0,n.R3)(c)}async function M(e){const t=await(0,y.t9)("fetchFullChat",e);if(!t)return;const{users:s,fullInfo:a}=t;let o=(0,n.Rd)();s&&(o=(0,r.Sh)(o,(0,g.ee)(s,"id"))),o=(0,r.a4)(o,e.id,{fullInfo:a}),(0,n.R3)(o)}async function S(e,t,s){const a=(0,n.Rd)(),o=(0,i.DI)(a,t);if(o&&!o.isMin)return void(s?e.focusMessage({chatId:o.id,messageId:s}):e.openChat({id:o.id}));const c=(0,i.jr)(a);e.openChat({id:-1});const d=await(0,y.t9)("getChatByUsername",t);if(!d)return c&&e.openChat({id:c.id}),void e.showNotification({message:"User does not exist"});(0,n.R3)((0,r.a4)((0,n.Rd)(),d.id,d)),s?e.focusMessage({chatId:d.id,messageId:s}):e.openChat({id:d.id})}(0,n.Q6)("preloadTopChatMessages",((e,t)=>{(async()=>{const s=[];for(let o=0;oe!==c&&!s.includes(e)));if(!m)return;s.push(m.id),t.loadViewportMessages({chatId:m.id,threadId:u._f})}})()})),(0,n.Q6)("openChat",((e,t,s)=>{const{id:n,threadId:a}=s,{currentUserId:o}=e,r=(0,i.Z1)(e,n);if(null!=r&&r.hasUnreadMark&&t.toggleChatUnread({id:n}),r&&r.lastMessage&&r.lastMessage.threadInfo&&t.requestThreadInfoUpdate({chatId:r.lastMessage.threadInfo.chatId,threadId:r.lastMessage.threadInfo.threadId}),r)(0,d.Hp)(r)&&!r.isMin&&t.requestChatUpdate({chatId:n});else if(n===o)(0,y.t9)("fetchChat",{type:"self"});else{const t=(0,i.dy)(e,n);t&&(0,y.t9)("fetchChat",{type:"user",user:t})}a!==u._f&&((0,i.qS)(e,n,a)||t.requestThreadInfoUpdate({chatId:n,threadId:a}))})),(0,n.Q6)("openSupportChat",((e,t)=>{const s=(0,i.P_)(e);t.openChat({id:s?s.id:-1}),s||(async()=>{const e=await(0,y.t9)("fetchChat",{type:"support"});e&&t.openChat({id:e.chatId})})()})),(0,n.Q6)("openTipsChat",((e,t,s)=>{const{langCode:n}=s,o="pt-br"===n?"BR":a.Db.includes(n)?n.toUpperCase():"";t.openChatByUsername({username:`${a.vi}${o}`})})),(0,n.Q6)("loadMoreChats",((e,t,s)=>{const{listType:n="active"}=s,a=e.chats.listIds[n];if(e.chats.isFullyLoaded[n])return;const o=a?a.map((t=>e.chats.byId[t])).filter((t=>Boolean(null==t?void 0:t.lastMessage)&&!(0,i.ep)(e,t.id))).sort(((e,t)=>e.lastMessage.date-t.lastMessage.date))[0]:void 0;P(o?()=>b(n,o.id,o.lastMessage.date):()=>b(n))})),(0,n.Q6)("loadFullChat",((e,t,s)=>{const{chatId:n,force:a}=s,o=(0,i.Z1)(e,n);o&&(a?M(o):w((()=>M(o))))})),(0,n.Q6)("loadTopChats",(()=>{C((()=>b("active")))})),(0,n.Q6)("requestChatUpdate",((e,t,s)=>{const{serverTimeOffset:n}=e,{chatId:a}=s,o=(0,i.Z1)(e,a);o&&(0,y.t9)("requestChatUpdate",{chat:o,serverTimeOffset:n})})),(0,n.Q6)("updateChatMutedState",((e,t,s)=>{const{serverTimeOffset:a}=e,{chatId:o,isMuted:c}=s,d=(0,i.Z1)(e,o);d&&((0,n.R3)((0,r.a4)(e,o,{isMuted:c})),(0,y.t9)("updateChatMutedState",{chat:d,isMuted:c,serverTimeOffset:a}))})),(0,n.Q6)("createChannel",((e,t,s)=>{const{title:a,about:o,photo:c,memberIds:d}=s;!async function(e,t,s,a){(0,n.R3)({...(0,n.Rd)(),chatCreation:{progress:h.Nh.InProgress}});const o=await(0,y.t9)("createChannel",{title:e,about:s,users:t});if(!o)return;const{id:i,accessHash:c}=o;let d=(0,n.Rd)();d=(0,r.a4)(d,i,o),d={...d,chatCreation:{...d.chatCreation,progress:o?h.Nh.Complete:h.Nh.Error}},(0,n.R3)(d),(0,n.uC)().openChat({id:i}),i&&c&&a&&await(0,y.t9)("editChatPhoto",{chatId:i,accessHash:c,photo:a})}(a,d.map((t=>(0,i.dy)(e,t))).filter(Boolean),o,c)})),(0,n.Q6)("joinChannel",((e,t,s)=>{const{chatId:n}=s,a=(0,i.Z1)(e,n);if(!a)return;const{id:o,accessHash:r}=a;o&&r&&(0,y.t9)("joinChannel",{channelId:o,accessHash:r})})),(0,n.Q6)("deleteChatUser",((e,t,s)=>{(async()=>{const{chatId:n,userId:a}=s,o=(0,i.Z1)(e,n),r=(0,i.dy)(e,a);if(!o||!r)return;await(0,y.t9)("deleteChatUser",{chat:o,user:r});const c=(0,i.Bt)(e);c&&c.chatId===n&&e.currentUserId===a&&t.openChat({id:void 0})})()})),(0,n.Q6)("deleteChat",((e,t,s)=>{(async()=>{const{chatId:n}=s,a=(0,i.Z1)(e,n);if(!a)return;await(0,y.t9)("deleteChat",{chatId:a.id});const o=(0,i.Bt)(e);o&&o.chatId===n&&t.openChat({id:void 0})})()})),(0,n.Q6)("leaveChannel",((e,t,s)=>{(async()=>{const{chatId:n}=s,a=(0,i.Z1)(e,n);if(!a)return;const{id:o,accessHash:r}=a;o&&r&&await(0,y.t9)("leaveChannel",{channelId:o,accessHash:r});const c=(0,i.Bt)(e);c&&c.chatId===n&&t.openChat({id:void 0})})()})),(0,n.Q6)("deleteChannel",((e,t,s)=>{(async()=>{const{chatId:n}=s,a=(0,i.Z1)(e,n);if(!a)return;const{id:o,accessHash:r}=a;o&&r&&await(0,y.t9)("deleteChannel",{channelId:o,accessHash:r});const c=(0,i.Bt)(e);c&&c.chatId===n&&t.openChat({id:void 0})})()})),(0,n.Q6)("createGroupChat",((e,t,s)=>{const{title:a,memberIds:o,photo:c}=s;!async function(e,t,s){(0,n.R3)({...(0,n.Rd)(),chatCreation:{progress:h.Nh.InProgress}});const a=await(0,y.t9)("createGroupChat",{title:e,users:t});if(!a)return;const{id:o}=a;let i=(0,n.Rd)();i=(0,r.a4)(i,o,a),i={...i,chatCreation:{...i.chatCreation,progress:a?h.Nh.Complete:h.Nh.Error}},(0,n.R3)(i),(0,n.uC)().openChat({id:o}),o&&s&&await(0,y.t9)("editChatPhoto",{chatId:o,photo:s})}(a,o.map((t=>(0,i.dy)(e,t))).filter(Boolean),c)})),(0,n.Q6)("toggleChatPinned",((e,t,s)=>{const{id:n,folderId:o}=s,r=(0,i.Z1)(e,n);if(r)if(o){const t=(0,i.Mw)(e,o);if(t){const s=!(0,i.ep)(e,n,o),{pinnedChatIds:a,includedChatIds:r}=t,c=s?[n,...a||[]]:(a||[]).filter((e=>e!==n)),d=[n,...r];(0,y.t9)("editChatFolder",{id:o,folderUpdate:{...t,pinnedChatIds:c,includedChatIds:d}})}}else{const t=(0,i.Ek)(e,n),s=(0,i.ep)(e,n,"archived"===t?a.WS:void 0);(0,y.t9)("toggleChatPinned",{chat:r,shouldBePinned:!s})}})),(0,n.Q6)("toggleChatArchived",((e,t,s)=>{const{id:n}=s,o=(0,i.Z1)(e,n);o&&(0,y.t9)("toggleChatArchived",{chat:o,folderId:(0,d.pE)(o)?0:a.WS})})),(0,n.Q6)("loadChatFolders",(()=>{!async function(){const e=await(0,y.t9)("fetchChatFolders");if(e){const t=(0,n.Rd)();(0,n.R3)({...t,chatFolders:{...t.chatFolders,...e}})}}()})),(0,n.Q6)("loadRecommendedChatFolders",(()=>{!async function(){const e=await(0,y.t9)("fetchRecommendedChatFolders");if(e){const t=(0,n.Rd)();(0,n.R3)({...t,chatFolders:{...t.chatFolders,recommended:e}})}}()})),(0,n.Q6)("editChatFolder",((e,t,s)=>{const{id:n,folderUpdate:a}=s,o=(0,i.Mw)(e,n);o&&(0,y.t9)("editChatFolder",{id:n,folderUpdate:{id:n,emoticon:o.emoticon,pinnedChatIds:o.pinnedChatIds,...a}})})),(0,n.Q6)("addChatFolder",((e,t,s)=>{const{folder:o}=s,{orderedIds:r}=e.chatFolders;!async function(e,t){const{id:s,description:a,...o}=e;if(await(0,y.t9)("editChatFolder",{id:t+1,folderUpdate:{id:t+1,...o}}),!a)return;const r=(0,n.Rd)(),{recommended:i}=r.chatFolders;i&&(0,n.R3)({...r,chatFolders:{...r.chatFolders,recommended:i.filter((({id:e})=>e!==s))}})}(o,null!=r&&r.length?Math.max.apply(Math.max,r):a.WS)})),(0,n.Q6)("deleteChatFolder",((e,t,s)=>{const{id:n}=s;(0,i.Mw)(e,n)&&async function(e){await(0,y.t9)("deleteChatFolder",e)}(n)})),(0,n.Q6)("toggleChatUnread",((e,t,s)=>{const{id:n}=s,{serverTimeOffset:a}=e,o=(0,i.Z1)(e,n);o&&(o.unreadCount?(0,y.t9)("markMessageListRead",{serverTimeOffset:a,chat:o,threadId:u._f}):(0,y.t9)("toggleDialogUnread",{chat:o,hasUnreadMark:!o.hasUnreadMark}))})),(0,n.Q6)("openTelegramLink",((e,t,s)=>{const{url:n}=s;let o=a.Lj.exec(n);if(o){const e=o[1];(async()=>{const s=await(0,y.t9)("openChatByInvite",e);s&&t.openChat({id:s.chatId})})()}else{o=a.FS.exec(n);const e=o[1],s=o[2]?Number(o[2]):void 0,r=o[3]?Number(o[3]):void 0;"c"===e&&s&&r?t.focusMessage({chatId:-s,messageId:r}):S(t,e,s)}})),(0,n.Q6)("acceptInviteConfirmation",((e,t,s)=>{const{hash:n}=s;(async()=>{const e=await(0,y.t9)("importChatInvite",{hash:n});e&&t.openChat({id:e.id})})()})),(0,n.Q6)("openChatByUsername",((e,t,s)=>{const{username:n}=s;S(t,n)})),(0,n.Q6)("togglePreHistoryHidden",((e,t,s)=>{const{chatId:n,isEnabled:a}=s;let o=(0,i.Z1)(e,n);o&&(async()=>{if((0,d.G9)(o)){if(o=await(0,y.t9)("migrateChat",o),!o)return;t.openChat({id:o.id})}(0,y.t9)("togglePreHistoryHidden",{chat:o,isEnabled:a})})()})),(0,n.Q6)("updateChatDefaultBannedRights",((e,t,s)=>{const{chatId:n,bannedRights:a}=s,o=(0,i.Z1)(e,n);o&&(0,y.t9)("updateChatDefaultBannedRights",{chat:o,bannedRights:a})})),(0,n.Q6)("updateChatMemberBannedRights",((e,t,s)=>{const{chatId:a,userId:o,bannedRights:c}=s;let l=(0,i.Z1)(e,a);const u=(0,i.dy)(e,o);l&&u&&(async()=>{if((0,d.G9)(l)){if(l=await(0,y.t9)("migrateChat",l),!l)return;t.openChat({id:l.id})}await(0,y.t9)("updateChatMemberBannedRights",{chat:l,user:u,bannedRights:c});const e=(0,n.Rd)(),s=(0,i.Z1)(e,a);if(!s||!s.fullInfo)return;const{members:h,kickedMembers:m}=s.fullInfo,g=!!c.viewMessages,f=!Object.keys(c).length;(0,n.R3)((0,r.a4)(e,a,{fullInfo:{...s.fullInfo,...h&&g&&{members:h.filter((e=>e.userId!==o))},...h&&!g&&{members:h.map((e=>e.userId===o?{...e,bannedRights:c}:e))},...f&&m&&{kickedMembers:m.filter((e=>e.userId!==o))}}}))})()})),(0,n.Q6)("updateChatAdmin",((e,t,s)=>{const{chatId:a,userId:o,adminRights:c,customTitle:l}=s;let u=(0,i.Z1)(e,a);const h=(0,i.dy)(e,o);u&&h&&(async()=>{if((0,d.G9)(u)){if(u=await(0,y.t9)("migrateChat",u),!u)return;t.openChat({id:u.id})}await(0,y.t9)("updateChatAdmin",{chat:u,user:h,adminRights:c,customTitle:l});const e=(0,n.Rd)(),s=(0,i.Z1)(e,a);if(!s||!s.fullInfo)return;const{adminMembers:m}=s.fullInfo,g=!Object.keys(c).length;(0,n.R3)((0,r.a4)(e,a,{fullInfo:{...s.fullInfo,...m&&g&&{adminMembers:m.filter((e=>e.userId!==o))},...m&&!g&&{adminMembers:m.map((e=>e.userId===o?{...e,adminRights:c,customTitle:l}:e))}}}))})()})),(0,n.Q6)("updateChat",((e,t,s)=>{const{chatId:a,title:o,about:c,photo:d}=s,l=(0,i.Z1)(e,a);l&&(async()=>{(0,n.R3)((0,r.H9)((0,n.Rd)(),h.wv.InProgress)),await Promise.all([l.title!==o?(0,y.t9)("updateChatTitle",l,o):void 0,l.fullInfo&&l.fullInfo.about!==c?(0,y.t9)("updateChatAbout",l,c):void 0,d?(0,y.t9)("editChatPhoto",{chatId:a,accessHash:l.accessHash,photo:d}):void 0]),(0,n.R3)((0,r.H9)((0,n.Rd)(),h.wv.Complete))})()})),(0,n.Q6)("toggleSignatures",((e,t,s)=>{const{chatId:n,isEnabled:a}=s,o=(0,i.Z1)(e,n);o&&(0,y.t9)("toggleSignatures",{chat:o,isEnabled:a})})),(0,n.Q6)("loadGroupsForDiscussion",(()=>{(async()=>{const e=await(0,y.t9)("fetchGroupsForDiscussion");if(!e)return;const t=e.reduce(((e,t)=>(t&&(e[t.id]=t),e)),{}),s=(0,r.fZ)((0,n.Rd)(),t);(0,n.R3)({...s,chats:{...s.chats,forDiscussionIds:Object.keys(t).map(Number)}})})()})),(0,n.Q6)("linkDiscussionGroup",((e,t,s)=>{const{channelId:n,chatId:a}=s,o=(0,i.Z1)(e,n);let r=(0,i.Z1)(e,a);o&&r&&(async()=>{if((0,d.G9)(r)){if(r=await(0,y.t9)("migrateChat",r),!r)return;t.openChat({id:r.id})}let{fullInfo:e}=r;if(!e){const t=await(0,y.t9)("fetchFullChat",r);if(!t)return;e=t.fullInfo}e.isPreHistoryHidden&&await(0,y.t9)("togglePreHistoryHidden",{chat:r,isEnabled:!1}),(0,y.t9)("setDiscussionGroup",{channel:o,chat:r})})()})),(0,n.Q6)("unlinkDiscussionGroup",((e,t,s)=>{var n;const{channelId:a}=s,o=(0,i.Z1)(e,a);if(!o)return;let r;null!==(n=o.fullInfo)&&void 0!==n&&n.linkedChatId&&(r=(0,i.Z1)(e,o.fullInfo.linkedChatId)),(async()=>{await(0,y.t9)("setDiscussionGroup",{channel:o}),r&&M(r)})()})),(0,n.Q6)("setActiveChatFolder",((e,t,s)=>({...e,chatFolders:{...e.chatFolders,activeChatFolder:s}}))),(0,n.Q6)("loadMoreMembers",(e=>{(async()=>{var t,s;const{chatId:a}=(0,i.Bt)(e)||{},o=a?(0,i.Z1)(e,a):void 0;if(!o||(0,d.G9)(o))return;const c=(null===(t=o.fullInfo)||void 0===t||null===(s=t.members)||void 0===s?void 0:s.length)||void 0,l=await(0,y.t9)("fetchMembers",o.id,o.accessHash,"recent",c);if(!l)return;const{members:u,users:h}=l;u&&u.length&&(e=(0,n.Rd)(),e=(0,r.Sh)(e,(0,g.ee)(h,"id")),e=(0,r.a4)(e,o.id,{fullInfo:{...o.fullInfo,members:[...(o.fullInfo||{}).members||[],...u||[]]}}),(0,n.R3)(e))})()})),(0,n.Q6)("addChatMembers",((e,t,s)=>{const{chatId:n,memberIds:a}=s,o=(0,i.Z1)(e,n),r=a.map((t=>(0,i.dy)(e,t))).filter(Boolean);o&&r.length&&(t.setNewChatMembersDialogState(h.WB.Loading),(async()=>{await(0,y.t9)("addChatMembers",o,r),t.setNewChatMembersDialogState(h.WB.Closed),M(o)})())})),(0,n.Q6)("deleteChatMember",((e,t,s)=>{const{chatId:n,userId:a}=s,o=(0,i.Z1)(e,n),r=(0,i.dy)(e,a);o&&r&&(async()=>{await(0,y.t9)("deleteChatMember",o,r),M(o)})()}));const E=new Map,k=(0,Z.Ds)((e=>e()),500,!1);async function R(e,t,s,o,c=!1,d=!1){const l=e.id;let u;switch(o){case h.Uq.Backwards:u=void 0;break;case h.Uq.Around:u=-(Math.round(a.hT/2)+1);break;case h.Uq.Forwards:u=-(a.hT+1)}const m=await(0,y.t9)("fetchMessages",{chat:(0,i.Cm)((0,n.Rd)(),l,t),offsetId:s,addOffset:u,limit:a.hT,threadId:t});if(!m)return;const{messages:f,users:p,chats:I,threadInfos:v}=m,Z=(0,g.ee)(f,"id"),P=Object.keys(Z).map(Number);let C=(0,n.Rd)();C=(0,r.c_)(C,l,Z),C=c?(0,r.ff)(C,l,t,P):(0,r.xj)(C,l,t,P),C=(0,r.Sh)(C,(0,g.ee)(p,"id")),C=(0,r.fZ)(C,(0,g.ee)(I,"id")),C=(0,r.j6)(C,l,v);let w=(0,i.gb)(C,l,t);const b=(0,i.qC)(C,l,t);if(c&&w&&b&&(b.length&&!(0,g.YE)(w,b)||(C=(0,r.xj)(C,l,t,b),w=(0,i.gb)(C,l,t),C=(0,r.pf)(C,l,t,"outlyingIds",void 0),c=!1)),!d){const e=c?b:w,{newViewportIds:n}=T(e,s,o);C=(0,r.y9)(C,l,t,n)}(0,n.R3)(C)}function T(e,t,s){const{length:n}=e,o=t?function(e,t){return te[e.length-1]?e.length-1:e.findIndex(((s,n)=>s===t||st))}(e,t):-1,r=s===h.Uq.Backwards?o:o+1||n,i=r-a.hT,c=r+a.hT-1,d=e.slice(Math.max(0,i),c+1);let l,u;switch(s){case h.Uq.Backwards:l=r>0,u=i>=0;break;case h.Uq.Forwards:l=r0,u=d.length===a.hT}return{newViewportIds:d,areSomeLocal:l,areAllLocal:u}}async function N(e){let t;const s=e.attachment?(e,a)=>{E.has(a)||(t=a,E.set(a,s));const o=(0,n.Rd)();(0,n.R3)({...o,fileUploads:{byMessageLocalId:{...o.fileUploads.byMessageLocalId,[a]:{progress:e}}}})}:void 0;(e.replyingTo||m.cj)&&await(0,Z.Pn)();const a=(0,n.Rd)();e.serverTimeOffset=a.serverTimeOffset;const o=(0,i.Bt)(a);if(!o)return;const{threadId:r}=o;e.replyingTo||r===u._f||(e.replyingTo=(0,i.qS)(a,e.chat.id,r)),await(0,y.t9)("sendMessage",e,s),s&&t&&E.delete(t)}(0,n.Q6)("loadViewportMessages",((e,t,s)=>{const{direction:n=h.Uq.Around,isBudgetPreload:o=!1}=s||{};let{chatId:c,threadId:d}=s||{};if(!c){const t=(0,i.Bt)(e);if(!t)return;c=t.chatId,d=t.threadId}const l=(0,i.Z1)(e,c);if(!l||l.isRestricted)return;const u=(0,i.Cb)(e,c,d),m=(0,i.gb)(e,c,d),g=(0,i.qC)(e,c,d);if(u&&u.length&&n!==h.Uq.Around){const s=n===h.Uq.Backwards?u[0]:u[u.length-1],a=Boolean(g),i=a?g:m,{newViewportIds:f,areSomeLocal:p,areAllLocal:I}=T(i,s,n);if(p&&(e=(0,r.y9)(e,c,d,f)),async function(e,t,s,n,a,o,r,i){t||await R(a,o,i,r,s,n),n||(await Promise.resolve(),e.loadViewportMessages({chatId:a.id,threadId:o,direction:r,isBudgetPreload:!0}))}(t,I,a,o,l,d,n,s),o)return}else{const t=(0,i.G$)(e,c)||(0,i.rd)(e,c,d),s=Boolean(t&&m&&!m.includes(t)),n=(s?g:m)||[],{newViewportIds:u,areSomeLocal:f,areAllLocal:p}=T(n,t,h.Uq.Around);f&&u.length>=a.hT&&(e=(0,r.y9)(e,c,d,u)),p||R(l,d,t,h.Uq.Around,s,o)}return e})),(0,n.Q6)("loadMessage",((e,t,s)=>{const{chatId:a,messageId:o,replyOriginForId:c,threadUpdate:d}=s,l=(0,i.Z1)(e,a);l&&(async()=>{const e=await async function(e,t,s){const a=await(0,y.t9)("fetchMessage",{chat:e,messageId:t});if(!a)return;if(a===u._Q){if(s){let t=(0,n.Rd)();const a=(0,i.hj)(t,e.id,s);t=(0,r.cY)(t,e.id,s,{...a,replyToMessageId:void 0}),(0,n.R3)(t)}return}let o=(0,n.Rd)();return o=(0,r.cY)(o,e.id,t,a.message),o=(0,r.Sh)(o,(0,g.ee)(a.users,"id")),(0,n.R3)(o),a.message}(l,o,c);if(e&&d){const{lastMessageId:t,isDeleting:s}=d;(0,n.R3)((0,r.lG)((0,n.Rd)(),e,a,t,s))}})()})),(0,n.Q6)("sendMessage",((e,t,s)=>{const n=(0,i.Bt)(e);if(!n)return;const{chatId:o,threadId:r,type:c}=n;if("scheduled"===c&&!s.scheduledAt)return{...e,messages:{...e.messages,contentToBeScheduled:s}};const d=(0,i.Z1)(e,o);t.setReplyingToId({messageId:void 0}),t.clearWebPagePreview({chatId:o,threadId:r,value:!1});const l={...s,chat:d,replyingTo:(0,i.Yy)(e,o,r),noWebPage:(0,i.tV)(e,o,r)},u=!s.attachments||s.attachments.length<=1,h=!u&&s.attachments&&s.attachments.length>1;if(u){const{attachments:e,...t}=l;N({...t,attachment:e?e[0]:void 0})}else if(h){const{text:e,entities:t,attachments:s,...n}=l,o=(0,g.Vl)(s,a.DU);for(let s=0;s0?i:void 0}),r.forEach((e=>{N({...n,attachment:e,groupedId:i})}))}}else{const{text:e,entities:t,attachments:s,replyingTo:n,...a}=l;e&&N({...a,text:e,entities:t,replyingTo:n}),s.forEach((e=>{N({...a,attachment:e})}))}})),(0,n.Q6)("editMessage",((e,t,s)=>{const{serverTimeOffset:n}=e,{text:a,entities:o}=s,r=(0,i.Bt)(e);if(!r)return;const{chatId:c,threadId:d,type:l}=r,u=(0,i.Z1)(e,c),h=(0,i.kK)(e,c,d,l);u&&h&&((0,y.t9)("editMessage",{chat:u,message:h,text:a,entities:o,noWebPage:(0,i.tV)(e,c,d),serverTimeOffset:n}),t.setEditingId({messageId:void 0}))})),(0,n.Q6)("cancelSendingMessage",((e,t,s)=>{const{chatId:n,messageId:a}=s,o=(0,i.hj)(e,n,a),r=o&&E.get(o.previousLocalId||o.id);r&&(0,y.u3)(r),t.apiUpdate({"@type":"deleteMessages",ids:[a],chatId:n})})),(0,n.Q6)("saveDraft",((e,t,s)=>{const{chatId:n,threadId:a,draft:o}=s;if(!o)return;const{text:c,entities:d}=o,l=(0,i.Z1)(e,n);return a===u._f&&(0,y.t9)("saveDraft",{chat:l,text:c,entities:d,replyToMsgId:(0,i.Yy)(e,n,a)}),e=(0,r.pf)(e,n,a,"draft",o),(0,r.a4)(e,n,{draftDate:Math.round(Date.now()/1e3)})})),(0,n.Q6)("clearDraft",((e,t,s)=>{const{chatId:n,threadId:a,localOnly:o}=s;if(!(0,i.Ms)(e,n,a))return;const c=(0,i.Z1)(e,n);return o||a!==u._f||(0,y.t9)("clearDraft",c),e=(0,r.pf)(e,n,a,"draft",void 0),(0,r.a4)(e,n,{draftDate:void 0})})),(0,n.Q6)("toggleMessageWebPage",((e,t,s)=>{const{chatId:n,threadId:a,noWebPage:o}=s;return(0,r.pf)(e,n,a,"noWebPage",o)})),(0,n.Q6)("pinMessage",((e,t,s)=>{const n=(0,i.jr)(e);if(!n)return;const{messageId:a,isUnpin:o,isOneSide:r,isSilent:c}=s;(0,y.t9)("pinMessage",{chat:n,messageId:a,isUnpin:o,isOneSide:r,isSilent:c})})),(0,n.Q6)("unpinAllMessages",((e,t,s)=>{const a=(0,i.Z1)(e,s.chatId);a&&async function(e){await(0,y.t9)("unpinAllMessages",{chat:e});let t=(0,n.Rd)();t=(0,r.pf)(t,e.id,u._f,"pinnedIds",[]),(0,n.R3)(t)}(a)})),(0,n.Q6)("deleteMessages",((e,t,s)=>{const{messageIds:n,shouldDeleteForAll:a}=s,o=(0,i.Bt)(e);if(!o)return;const{chatId:r,threadId:c}=o,d=(0,i.Z1)(e,r);(0,y.t9)("deleteMessages",{chat:d,messageIds:n,shouldDeleteForAll:a});const l=(0,i._$)(e,r,c);n.includes(l)&&t.setEditingId({messageId:void 0})})),(0,n.Q6)("deleteScheduledMessages",((e,t,s)=>{const{messageIds:n}=s,a=(0,i.Bt)(e);if(!a)return;const{chatId:o}=a,r=(0,i.Z1)(e,o);(0,y.t9)("deleteScheduledMessages",{chat:r,messageIds:n});const c=(0,i.wU)(e,o);n.includes(c)&&t.setEditingId({messageId:void 0})})),(0,n.Q6)("deleteHistory",((e,t,s)=>{(async()=>{var n;const{chatId:a,shouldDeleteForAll:o}=s,r=(0,i.Z1)(e,a);if(!r)return;const c=null===(n=r.lastMessage)||void 0===n?void 0:n.id;await(0,y.t9)("deleteHistory",{chat:r,shouldDeleteForAll:o,maxId:c});const d=(0,i.Bt)(e);d&&d.chatId===a&&t.openChat({id:void 0})})()})),(0,n.Q6)("reportMessages",((e,t,s)=>{(async()=>{const{messageIds:n,reason:a,description:o}=s,r=(0,i.Bt)(e);if(!r)return;const{chatId:c}=r,d=(0,i.Z1)(e,c),l=await(0,y.t9)("reportMessages",{peer:d,messageIds:n,reason:a,description:o});t.showNotification({message:l?"Thank you! Your report will be reviewed by our team.":"Error occured while submiting report. Please, try again later."})})()})),(0,n.Q6)("markMessageListRead",((e,t,s)=>{const{serverTimeOffset:n}=e,a=(0,i.Bt)(e);if(!a)return;const{chatId:o,threadId:c}=a,d=(0,i.Cm)(e,o,c);if(!d)return;const{maxId:l}=s;if(k((()=>{(0,y.t9)("markMessageListRead",{serverTimeOffset:n,chat:d,threadId:c,maxId:l})})),c!==u._f)return;const h=(0,i.Cb)(e,o,c),m=(0,i.It)(e,o,c);if(!h||!m||!d.unreadCount)return;const g=function(e,t,s){let n=0;for(let a=0,o=e.length;a=t&&e[a]<=s&&n++,!(e[a]>=s));a++);return n}(h,m,l);return g?(0,r.a4)(e,o,{lastReadInboxMessageId:l,unreadCount:Math.max(0,d.unreadCount-g)}):void 0})),(0,n.Q6)("markMessagesRead",((e,t,s)=>{const n=(0,i.jr)(e);if(!n)return;const{messageIds:a}=s;(0,y.t9)("markMessagesRead",{chat:n,messageIds:a})})),(0,n.Q6)("loadWebPagePreview",((e,t,s)=>{const{text:a}=s;!async function(e){const t=await(0,y.t9)("fetchWebPagePreview",{message:e});(0,n.R3)({...(0,n.Rd)(),webPagePreview:t})}(a)})),(0,n.Q6)("clearWebPagePreview",(e=>{if(e.webPagePreview)return{...e,webPagePreview:void 0}})),(0,n.Q6)("sendPollVote",((e,t,s)=>{const{chatId:n,messageId:a,options:o}=s,r=(0,i.Z1)(e,n);r&&(0,y.t9)("sendPollVote",{chat:r,messageId:a,options:o})})),(0,n.Q6)("loadPollOptionResults",((e,t,s)=>{const{chat:a,messageId:o,option:i,offset:c,limit:d,shouldResetVoters:l}=s;!async function(e,t,s,a,o,i){const c=await(0,y.t9)("loadPollOptionResults",{chat:e,messageId:t,option:s,offset:a,limit:o});if(!c)return;let d=(0,n.Rd)();d=(0,r.Sh)(d,(0,g.ee)(c.users,"id"));const{voters:l}=d.pollResults;(0,n.R3)({...d,pollResults:{...d.pollResults,voters:{...l,[s]:[...!i&&l&&l[s]?l[s]:[],...c&&c.users.map((e=>e.id))].filter(((e,t,s)=>s.indexOf(e)===t))},offsets:{...d.pollResults.offsets?d.pollResults.offsets:{},[s]:c.nextOffset||""}}})}(a,o,i,c,d,l)})),(0,n.Q6)("forwardMessages",(e=>{const{fromChatId:t,messageIds:s,toChatId:a}=e.forwardMessages,o=t?(0,i.Z1)(e,t):void 0,r=a?(0,i.Z1)(e,a):void 0,c=t&&s?s.sort(((e,t)=>e-t)).map((s=>(0,i.hj)(e,t,s))).filter(Boolean):void 0;o&&r&&c&&c.length&&function(e,t,s){(0,y.t9)("forwardMessages",{fromChat:e,toChat:t,messages:s,serverTimeOffset:(0,n.Rd)().serverTimeOffset}),(0,n.R3)({...(0,n.Rd)(),forwardMessages:{}})}(o,r,c)})),(0,n.Q6)("loadScheduledHistory",(e=>{const t=(0,i.jr)(e);if(!t)return;const{hash:s}=e.scheduledMessages.byChatId[t.id]||{};!async function(e,t){const s=await(0,y.t9)("fetchScheduledHistory",{chat:e,hash:t});if(!s)return;const{hash:a,messages:o}=s,i=(0,g.ee)(o,"id"),c=Object.keys(i).map(Number).sort(((e,t)=>t-e));let d=(0,n.Rd)();d=(0,r.w3)(d,e.id,i,a),d=(0,r.pf)(d,e.id,u._f,"scheduledIds",c),(0,n.R3)(d)}(t,s)})),(0,n.Q6)("sendScheduledMessages",((e,t,s)=>{const{chatId:n,id:a}=s,o=(0,i.Z1)(e,n);o&&(0,y.t9)("sendScheduledMessages",{chat:o,ids:[a]})})),(0,n.Q6)("rescheduleMessage",((e,t,s)=>{const{chatId:n,messageId:a,scheduledAt:o}=s,r=(0,i.Z1)(e,n),c=r&&(0,i.Tm)(e,r.id,a);r&&c&&(0,y.t9)("rescheduleMessage",{chat:r,message:c,scheduledAt:o})})),(0,n.Q6)("requestThreadInfoUpdate",((e,t,s)=>{const{chatId:n,threadId:a}=s,o=(0,i.Cm)(e,n,a);o&&(0,y.t9)("requestThreadInfoUpdate",{chat:o,threadId:a})})),(0,n.Q6)("loadPinnedMessages",((e,t,s)=>{const{chatId:a}=s,o=(0,i.Z1)(e,a);o&&async function(e){const t=await(0,y.t9)("fetchPinnedMessages",{chat:e});if(!t)return;const{messages:s,chats:a,users:o}=t,i=(0,g.ee)(s,"id"),c=Object.keys(i).map(Number).sort(((e,t)=>t-e));let d=(0,n.Rd)();d=(0,r.c_)(d,e.id,i),d=(0,r.pf)(d,e.id,u._f,"pinnedIds",c),d=(0,r.Sh)(d,(0,g.ee)(o,"id")),d=(0,r.fZ)(d,(0,g.ee)(a,"id")),(0,n.R3)(d)}(o)}));var B=s(5765);const x=(0,Z.P2)((e=>e()),500,!1);async function A(e,t){const s=await(0,y.t9)("searchGifs",{query:e,offset:t});s&&(0,n.R3)((0,r.rq)((0,n.Rd)(),!t,s.gifs,s.nextOffset))}(0,n.Q6)("loadStickerSets",(e=>{const{hash:t}=e.stickers.added||{};!async function(e=0){const t=await(0,y.t9)("fetchStickerSets",{hash:e});t&&(0,n.R3)((0,r.z3)((0,n.Rd)(),"added",t.hash,t.sets))}(t)})),(0,n.Q6)("loadAddedStickers",((e,t)=>{const{setIds:s}=e.stickers.added;s&&s.length&&(async()=>{for(let e=0;e0&&await(0,Z.wO)(500)})()})),(0,n.Q6)("loadRecentStickers",(e=>{const{hash:t}=e.stickers.recent||{};!async function(e=0){const t=await(0,y.t9)("fetchRecentStickers",{hash:e});if(!t)return;const s=(0,n.Rd)();(0,n.R3)({...s,stickers:{...s.stickers,recent:t}})}(t)})),(0,n.Q6)("loadFavoriteStickers",(e=>{const{hash:t}=e.stickers.favorite||{};!async function(e=0){const t=await(0,y.t9)("fetchFavoriteStickers",{hash:e});if(!t)return;const s=(0,n.Rd)();(0,n.R3)({...s,stickers:{...s.stickers,favorite:t}})}(t)})),(0,n.Q6)("loadGreetingStickers",(e=>{const{hash:t}=e.stickers.greeting||{};(async()=>{const e=await(0,y.t9)("fetchStickersForEmoji",{emoji:"👋⭐️",hash:t});if(!e)return;const s=(0,n.Rd)();(0,n.R3)({...s,stickers:{...s.stickers,greeting:{hash:e.hash,stickers:e.stickers.filter((e=>"👋"===e.emoji))}}})})()})),(0,n.Q6)("loadFeaturedStickers",(e=>{const{hash:t}=e.stickers.featured||{};!async function(e=0){const t=await(0,y.t9)("fetchFeaturedStickers",{hash:e});t&&(0,n.R3)((0,r.z3)((0,n.Rd)(),"featured",t.hash,t.sets))}(t)})),(0,n.Q6)("loadStickers",((e,t,s)=>{const{stickerSetId:a,stickerSetShortName:o}=s;let{stickerSetAccessHash:c}=s;if(!c&&!o){const t=(0,i.Ny)(e,a);if(!t)return;c=t.accessHash}!async function(e,t,s){const a=await(0,y.t9)("fetchStickers",{stickerSetShortName:s,stickerSetId:e,accessHash:t});if(!a)return;const{set:o,stickers:i,packs:c}=a;let d=(0,n.Rd)();d=(0,r.Rg)(d,o.id,{...o,stickers:i,packs:c});const l=d.stickers.forEmoji.emoji;l&&c[l]&&(d=(0,r.vy)(d)),(0,n.R3)(d)}(a,c,o)})),(0,n.Q6)("loadAnimatedEmojis",(()=>{!async function(){const e=await(0,y.t9)("fetchAnimatedEmojis");if(!e)return;const{set:t,stickers:s}=e;(0,n.R3)((0,r.g_)((0,n.Rd)(),{...t,stickers:s}))}()})),(0,n.Q6)("loadSavedGifs",(e=>{const{hash:t}=e.gifs.saved;!async function(e=0){const t=await(0,y.t9)("fetchSavedGifs",{hash:e});if(!t)return;const s=(0,n.Rd)();(0,n.R3)({...s,gifs:{...s.gifs,saved:t}})}(t)})),(0,n.Q6)("faveSticker",((e,t,s)=>{const{sticker:n}=s;n&&(0,y.t9)("faveSticker",{sticker:n})})),(0,n.Q6)("unfaveSticker",((e,t,s)=>{const{sticker:a}=s;a&&function(e){const t=(0,n.Rd)();(0,n.R3)({...t,stickers:{...t.stickers,favorite:{...t.stickers.favorite,stickers:t.stickers.favorite.stickers.filter((({id:t})=>t!==e.id))}}}),(0,y.t9)("faveSticker",{sticker:e,unfave:!0})}(a)})),(0,n.Q6)("toggleStickerSet",((e,t,s)=>{const{stickerSetId:n}=s,a=(0,i.Ny)(e,n);if(!a)return;const{accessHash:o,installedDate:r}=a;(0,y.t9)(r?"uninstallStickerSet":"installStickerSet",{stickerSetId:n,accessHash:o})})),(0,n.Q6)("loadEmojiKeywords",((e,t,s)=>{var a;const{language:o}=s;let r=e.emojiKeywords[o];null!==(a=r)&&void 0!==a&&a.isLoading||((0,n.R3)({...e,emojiKeywords:{...e.emojiKeywords,[o]:{...r,isLoading:!0}}}),(async()=>{var t;const s=await(0,y.t9)("fetchEmojiKeywords",{language:o,fromVersion:r?r.version:0});e=(0,n.Rd)(),r=e.emojiKeywords[o],s?(0,n.R3)({...e,emojiKeywords:{...e.emojiKeywords,[o]:{isLoading:!1,version:s.version,keywords:{...null===(t=r)||void 0===t?void 0:t.keywords,...s.keywords}}}}):(0,n.R3)({...e,emojiKeywords:{...e.emojiKeywords,[o]:{...r,isLoading:!1}}})})())})),(0,n.Q6)("setStickerSearchQuery",((e,t,s)=>{const{query:a}=s;a&&x((()=>{!async function(e,t=0){const s=await(0,y.t9)("searchStickers",{query:e,hash:t});if(!s)return;const a=(0,n.Rd)(),{setsById:o,added:i}=a.stickers,c=s.sets.map((({id:e})=>e));i.setIds&&i.setIds.forEach((t=>{if(!c.includes(t)){const{title:s}=o[t]||{};s&&(0,B.Z)(s,e)&&c.unshift(t)}})),(0,n.R3)((0,r.z3)(a,"search",s.hash,s.sets,c))}(a)}))})),(0,n.Q6)("setGifSearchQuery",((e,t,s)=>{const{query:n}=s;"string"==typeof n&&x((()=>{A(n)}))})),(0,n.Q6)("searchMoreGifs",(e=>{const{query:t,offset:s}=e.gifs.search;"string"==typeof t&&x((()=>{A(t,s)}))})),(0,n.Q6)("loadStickersForEmoji",((e,t,s)=>{const{emoji:a}=s,{hash:o}=e.stickers.forEmoji;x((()=>{!async function(e,t=0){let s=(0,n.Rd)();(0,n.R3)({...s,stickers:{...s.stickers,forEmoji:{...s.stickers.forEmoji,emoji:e}}});const a=await(0,y.t9)("fetchStickersForEmoji",{emoji:e,hash:t});s=(0,n.Rd)(),a&&s.stickers.forEmoji.emoji===e&&(s=(0,r.IM)(s,e,a.stickers,a.hash),(0,n.R3)(s))}(a,o)}))})),(0,n.Q6)("clearStickersForEmoji",(e=>({...e,stickers:{...e.stickers,forEmoji:{}}}))),(0,n.Q6)("openStickerSetShortName",((e,t,s)=>{const{stickerSetShortName:n}=s;return{...e,openedStickerSetShortName:n}}));var L=s(790);const O=(0,Z.P2)((e=>e()),500,!1);async function F(e="",t,s,o,c,d){let l;if(o){const n=await(0,y.t9)("searchMessagesLocal",{chatOrUser:o,query:e,type:t,limit:a.Hk,offsetId:s,minDate:d,maxDate:c});if(n){const{messages:e,users:t,totalCount:s,nextOffsetId:a}=n;l={messages:e,users:t,chats:[],totalCount:s,nextRate:a}}}else l=await(0,y.t9)("searchMessagesGlobal",{query:e,offsetRate:s,limit:a.Hk,type:t,maxDate:c,minDate:d});let u=(0,n.Rd)();const h=(0,i.JX)(u);if(!l||""!==e&&e!==h)return void(0,n.R3)((0,r.xv)(u,{messages:!1}));const{messages:m,users:f,chats:p,totalCount:I,nextRate:v}=l;p.length&&(u=(0,r.fZ)(u,(0,g.ee)(p,"id"))),f.length&&(u=(0,r.Sh)(u,(0,g.ee)(f,"id"))),m.length&&(u=(0,r.m6)(u,m)),u=(0,r.px)(u,m,I,t,v),(0,n.R3)(u)}async function U(){const e=await(0,y.t9)("fetchChats",{limit:a.Ov,archived:!0,withPinned:!0,serverTimeOffset:(0,n.Rd)().serverTimeOffset});if(!e)return;let t=(0,n.Rd)();t=(0,r.eD)(t,(0,g.ee)(e.users,"id")),t=(0,r.GL)(t,(0,g.ee)(e.chats,"id")),t=(0,r.Mg)(t,"archived",e.chatIds),t=(0,r.vv)(t,"archived",e),(0,n.R3)(t)}async function $(){let e=(0,n.Rd)();const{recentlyFoundChatIds:t}=e.globalSearch,{userIds:s}=e.contactList||{};if(!(s&&s.length||t&&t.length))return;const a=[...t||[],...s||[]].map((t=>(0,i.dy)(e,t))).filter(Boolean),o=await(0,y.t9)("fetchUsers",{users:a});o&&(e=(0,n.Rd)(),e=(0,r.eD)(e,(0,g.ee)(o,"id")),(0,n.R3)(e))}function Q(e){return(0,y.t9)("fetchMessages",{chat:e,threadId:u._f,offsetId:e.lastReadInboxMessageId,addOffset:-(Math.round(a.hT/2)+1),limit:a.hT})}(0,n.Q6)("setGlobalSearchQuery",((e,t,s)=>{const{chatId:a}=e.globalSearch,{query:o}=s;o&&!a&&O((()=>{!async function(e){const t=await(0,y.t9)("searchChats",{query:e});let s=(0,n.Rd)();const a=(0,i.JX)(s);if(!t||!a||e!==a)return void(0,n.R3)((0,r.xv)(s,{chats:!1}));const{localChats:o,localUsers:c,globalChats:d,globalUsers:l}=t;(o.length||d.length)&&(s=(0,r.fZ)(s,(0,g.ee)([...o,...d],"id"))),(c.length||l.length)&&(s=(0,r.Sh)(s,(0,g.ee)([...c,...l],"id"))),s=(0,r.xv)(s,{chats:!1}),s=(0,r.No)(s,{localResults:{chatIds:o.map((({id:e})=>e)),userIds:c.map((({id:e})=>e))},globalResults:{...s.globalSearch.globalResults,chatIds:l.map((({id:e})=>e)),userIds:d.map((({id:e})=>e))}}),(0,n.R3)(s)}(o)}))})),(0,n.Q6)("setGlobalSearchDate",((e,t,s)=>{const{date:a}=s,o=a?(0,L.IS)(a):a,c=(0,r.No)(e,{date:a,query:"",resultsByType:{...e.globalSearch.resultsByType,text:{totalCount:void 0,foundIds:[],nextOffsetId:0}}});(0,n.R3)(c);const{chatId:d}=e.globalSearch;F("","text",void 0,d?(0,i.Z1)(e,d):void 0,o,a)})),(0,n.Q6)("searchMessagesGlobal",((e,t,s)=>{var n;const{query:a,resultsByType:o,chatId:r,date:c}=e.globalSearch,d=c?(0,L.IS)(c):c,{type:l}=s;F(a,l,null==o||null===(n=o[l])||void 0===n?void 0:n.nextOffsetId,r?(0,i.Z1)(e,r):void 0,d,c)})),(0,n.Q6)("searchTextMessagesLocal",(e=>{const{chatId:t,threadId:s}=(0,i.Bt)(e)||{},o=t?(0,i.Z1)(e,t):void 0,c=(0,i.n5)(e);if(!o||!c||!s)return;const{query:d,results:l}=c,h=null==l?void 0:l.nextOffsetId;let m;if(s!==u._f){const n=(0,i.tZ)(e,t,s);m=null==n?void 0:n.topMessageId}!async function(e,t,s,o,c){const d=await(0,y.t9)("searchMessagesLocal",{chatOrUser:e,type:"text",query:o,topMessageId:s,limit:a.pn,offsetId:c});if(!d)return;const{messages:l,users:u,totalCount:h,nextOffsetId:m}=d,f=(0,g.ee)(l,"id"),p=Object.keys(f).map(Number);let I=(0,n.Rd)();const v=(0,i.n5)(I);!v||o&&o!==v.query||(I=(0,r.c_)(I,e.id,f),I=(0,r.Sh)(I,(0,g.ee)(u,"id")),I=(0,r.dx)(I,e.id,t,p,h,m),(0,n.R3)(I))}(o,s,m,d,h)})),(0,n.Q6)("searchMediaMessagesLocal",(e=>{const t=(0,i.og)(e),s=t?e.users.byId[t]||e.chats.byId[t]:void 0,o=(0,i.we)(e);if(!s||!o)return;const{currentType:c,resultsByType:d}=o,l=c&&d&&d[c],u=null==l?void 0:l.nextOffsetId;c&&async function(e,t,s){const o=await(0,y.t9)("searchMessagesLocal",{chatOrUser:e,type:t,limit:a.EN,offsetId:s});if(!o)return;const{messages:c,users:d,totalCount:l,nextOffsetId:u}=o,h=(0,g.ee)(c,"id"),m=Object.keys(h).map(Number);let f=(0,n.Rd)();(0,i.we)(f)&&(f=(0,r.c_)(f,e.id,h),f=(0,r.Sh)(f,(0,g.ee)(d,"id")),f=(0,r.c1)(f,e.id,t,m,l,u),(0,n.R3)(f))}(s,c,u)})),(0,n.Q6)("searchMessagesByDate",((e,t,s)=>{const{timestamp:a}=s,{chatId:o}=(0,i.Bt)(e)||{};if(!o)return;const r=(0,i.Z1)(e,o);r&&async function(e,t){const s=await(0,y.t9)("findFirstMessageIdAfterDate",{chat:e,timestamp:t});s&&(0,n.uC)().focusMessage({chatId:e.id,messageId:s})}(r,a)})),(0,n.Q6)("checkPublicLink",((e,t,s)=>{const{chatId:a}=(0,i.Bt)(e)||{};if(!a)return;if(e.management.progress===h.wv.InProgress)return;const{username:o}=s;(async()=>{e=(0,r.H9)(e,h.wv.InProgress),e=(0,r.fw)(e,a,{isUsernameAvailable:void 0}),(0,n.R3)(e);const t=await(0,y.t9)("checkChatUsername",{username:o});e=(0,n.Rd)(),e=(0,r.H9)(e,t?h.wv.Complete:h.wv.Error),e=(0,r.fw)(e,a,{isUsernameAvailable:t}),(0,n.R3)(e)})()})),(0,n.Q6)("updatePublicLink",((e,t,s)=>{const{chatId:a}=(0,i.Bt)(e)||{};let o=a&&(0,i.Z1)(e,a);if(!a||!o)return;const{username:c}=s;(async()=>{if(e=(0,r.H9)(e,h.wv.InProgress),(0,n.R3)(e),(0,d.G9)(o)){if(o=await(0,y.t9)("migrateChat",o),!o)return;t.openChat({id:o.id})}const s=await(0,y.t9)("setChatUsername",{chat:o,username:c});e=(0,n.Rd)(),e=(0,r.H9)(e,s?h.wv.Complete:h.wv.Error),e=(0,r.fw)(e,a,{isUsernameAvailable:void 0}),(0,n.R3)(e)})()})),(0,n.Q6)("updatePrivateLink",(e=>{const{chatId:t}=(0,i.Bt)(e)||{},s=t&&(0,i.Z1)(e,t);t&&s&&(0,y.t9)("updatePrivateLink",{chat:s})})),(0,n.Q6)("sync",((e,t)=>{!async function(e){a.eM&&console.log(">>> START SYNC"),await(0,y.t9)("fetchCurrentUser");const t=await async function(){const e=await(0,y.t9)("fetchChats",{limit:a.Ov,withPinned:!0,serverTimeOffset:(0,n.Rd)().serverTimeOffset});if(!e)return;let t=(0,n.Rd)();const{recentlyFoundChatIds:s}=t.globalSearch,{userIds:o}=t.contactList||{},{currentUserId:c}=t,l=[...s||[],...o||[],...c?[c]:[]],h=l.map((e=>(0,i.dy)(t,e))).filter(Boolean),m=l.map((e=>(0,i.Z1)(t,e))).filter(Boolean),{chatId:f}=(0,i.Bt)(t)||{};if(f){const e=(0,i.Z1)(t,f);if(e&&!l.includes(f)&&m.push(e),(0,d.YA)(f)){const e=(0,i.dy)(t,f);e&&!l.includes(f)&&h.push(e)}}return h.push(...e.users),m.push(...e.chats),t=(0,r.SL)(t,(0,g.ee)(m,"id")),t=(0,r.Mg)(t,"active",e.chatIds),t={...t,chats:{...t.chats}},t=(0,r.vv)(t,"active",e),Object.keys(e.draftsById).map(Number).forEach((s=>{t=(0,r.pf)(t,s,u._f,"draft",e.draftsById[s])})),Object.keys(e.replyingToById).map(Number).forEach((s=>{t=(0,r.pf)(t,s,u._f,"replyingToId",e.replyingToById[s])})),(0,n.R3)(t),f&&!t.chats.byId[f]&&(0,n.uC)().openChat({id:void 0}),h}();await async function(e){let t=!1,s=e||[],a=(0,n.Rd)();const{chatId:o,threadId:c}=(0,i.Bt)(a)||{},d=Object.keys(a.messages.byChatId).map(Number).reduce(((e,t)=>{const s=(0,i.Ms)(a,t,u._f);return s?{...e,[t]:s}:e}),{});if(o){const e=await Q(a.chats.byId[o]);a=(0,n.Rd)();const{chatId:d}=(0,i.Bt)(a)||{},l=c&&(0,i.tZ)(a,o,c);if(e&&d===o){const n=a.messages.byChatId[o],i=(0,g.ee)(e.messages,"id"),d=Object.keys(i).map(Number);if(a={...a,messages:{...a.messages,byChatId:{[o]:{byId:i,threadsById:{[u._f]:{...null==n?void 0:n.threadsById[u._f],listedIds:d,viewportIds:d,outlyingIds:void 0}}}}}},c&&l&&l.originChannelId){const{originChannelId:e}=l,t=a.messages.byChatId[e],s=await Q(a.chats.byId[e]);if(s){const e=(0,g.ee)(s.messages,"id"),r=Object.keys(e).map(Number);a={...a,messages:{...a.messages,byChatId:{...a.messages.byChatId,[l.originChannelId]:{byId:e,threadsById:{[u._f]:{...null==t?void 0:t.threadsById[u._f],listedIds:r,viewportIds:r,outlyingIds:void 0}}},[o]:{...a.messages.byChatId[o],threadsById:{...a.messages.byChatId[o].threadsById,[c]:{...null==n?void 0:n.threadsById[c],outlyingIds:void 0}}}}}}}}a=(0,r.GL)(a,(0,g.ee)(e.chats,"id")),a=(0,r.j6)(a,o,e.threadInfos),t=!0,s=Array.prototype.concat(s,e.users)}}t||(a={...a,messages:{...a.messages,byChatId:{}}}),Object.keys(d).map(Number).forEach((e=>{a=(0,r.pf)(a,e,u._f,"draft",d[e])})),e?a=(0,r.s5)(a,(0,g.ee)(s,"id")):s&&(a=(0,r.eD)(a,(0,g.ee)(s,"id"))),(0,n.R3)(a);const{chatId:l,messageId:h}=a.audioPlayer;l&&h&&!(0,i.hj)(a,l,h)&&(0,n.uC)().closeAudioPlayer()}(t),(0,n.R3)({...(0,n.Rd)(),lastSyncTime:Date.now()}),a.eM&&console.log(">>> FINISH SYNC"),e()}(t.afterSync)})),(0,n.Q6)("afterSync",((e,t)=>{!async function(e){a.eM&&console.log(">>> START AFTER-SYNC"),e.loadFavoriteStickers(),await Promise.all([$(),U()]),await(0,y.t9)("fetchCurrentUser"),a.eM&&console.log(">>> FINISH AFTER-SYNC")}(t)}));var D=s(2267);const q=(0,Z.Ds)((e=>e()),500,!1,!0),G=(0,Z.P2)((e=>e()),500,!1);function H(e,t,s){return{...e,inlineBots:{...e.inlineBots,byUsername:{...e.inlineBots.byUsername,[t]:s}}}}function j(e,t){return{...e,inlineBots:{...e.inlineBots,isLoading:t}}}(0,n.Q6)("loadFullUser",((e,t,s)=>{const{userId:n}=s,a=(0,i.dy)(e,n);if(!a)return;const{id:o,accessHash:r}=a;q((()=>(0,y.t9)("fetchFullUser",{id:o,accessHash:r})))})),(0,n.Q6)("loadUser",((e,t,s)=>{const{userId:a}=s,o=(0,i.dy)(e,a);o&&(async()=>{const t=await(0,y.t9)("fetchUsers",{users:[o]});t&&(e=(0,n.Rd)(),e=(0,r.eD)(e,(0,g.ee)(t,"id")),(0,n.R3)(e))})()})),(0,n.Q6)("loadTopUsers",(e=>{const{topPeers:{hash:t,lastRequestedAt:s}}=e;(!s||(0,D.b)(e.serverTimeOffset)-s>60)&&async function(e){const t=await(0,y.t9)("fetchTopUsers",{hash:e});if(!t)return;const{hash:s,ids:a,users:o}=t;let i=(0,n.Rd)();i=(0,r.Sh)(i,(0,g.ee)(o,"id")),i={...i,topPeers:{...i.topPeers,hash:s,userIds:a,lastRequestedAt:(0,D.b)(i.serverTimeOffset)}},(0,n.R3)(i)}(t)})),(0,n.Q6)("loadContactList",(e=>{const{hash:t}=e.contactList||{};!async function(e){const t=await(0,y.t9)("fetchContactList",{hash:e});if(!t)return;let s=(0,r.Sh)((0,n.Rd)(),(0,g.ee)(t.users,"id"));s=(0,r.fZ)(s,(0,g.ee)(t.chats,"id"));const a=e=>e.lastName||e.firstName||"",o=new Intl.Collator("en-US"),i=t.users.sort(((e,t)=>o.compare(a(e),a(t)))).filter((e=>!e.isSelf));(0,n.R3)({...s,contactList:{hash:t.hash,userIds:i.map((e=>e.id))}})}(t)})),(0,n.Q6)("loadCurrentUser",(()=>{(0,y.t9)("fetchCurrentUser")})),(0,n.Q6)("updateContact",((e,t,s)=>{const{userId:a,isMuted:o,firstName:c,lastName:d}=s;!async function(e,t,s,a){const o=(0,n.Rd)(),c=(0,i.dy)(o,e);c&&((0,n.uC)().updateChatMutedState({chatId:e,isMuted:t}),(0,n.R3)((0,r.H9)((0,n.Rd)(),h.wv.InProgress)),await(0,y.t9)("updateContact",{phone:c.phoneNumber,firstName:s,lastName:a})&&(0,n.R3)((0,r.Nq)((0,n.Rd)(),c.id,{firstName:s,lastName:a})),(0,n.R3)((0,r.H9)((0,n.Rd)(),h.wv.Complete)))}(a,o,c,d)})),(0,n.Q6)("deleteUser",((e,t,s)=>{const{userId:a}=s;!async function(e){const t=(0,n.Rd)(),s=(0,i.dy)(t,e);if(!s)return;const{id:a,accessHash:o}=s;await(0,y.t9)("deleteUser",{id:a,accessHash:o})}(a)})),(0,n.Q6)("loadProfilePhotos",((e,t,s)=>{const{profileId:a}=s,o=(0,d.YA)(a),c=o?(0,i.dy)(e,a):void 0,l=o?void 0:(0,i.Z1)(e,a);(async()=>{const e=await(0,y.t9)("fetchProfilePhotos",c,l);if(!e||!e.photos)return;let t=(0,n.Rd)();o?t=(0,r.Nq)(t,a,{photos:e.photos}):(t=(0,r.Sh)(t,(0,g.ee)(e.users,"id")),t=(0,r.a4)(t,a,{photos:e.photos})),(0,n.R3)(t)})()})),(0,n.Q6)("setUserSearchQuery",((e,t,s)=>{const{query:a}=s;a&&G((()=>{!async function(e){const t=await(0,y.t9)("searchChats",{query:e});let s=(0,n.Rd)();const a=s.userSearch.query;if(!t||!a||e!==a)return void(0,n.R3)((0,r.Q3)(s,!1));const{localUsers:o,globalUsers:i}=t;let c,d;o.length&&(s=(0,r.Sh)(s,(0,g.ee)(o,"id")),c=o.map((({id:e})=>e))),i.length&&(s=(0,r.Sh)(s,(0,g.ee)(i,"id")),d=i.map((({id:e})=>e))),s=(0,r.Q3)(s,!1),s=(0,r.Lm)(s,{localUserIds:c,globalUserIds:d}),(0,n.R3)(s)}(a)}))}));const _=(0,Z.Ds)((e=>e()),500,!1);async function V(e,t,s){await(0,y.t9)("sendMessage",{chat:e,text:s})}(0,n.Q6)("clickInlineButton",((e,t,s)=>{const{button:o}=s;switch(o.type){case"command":t.sendBotCommand({command:o.value});break;case"url":o.value.match(a.Lj)||o.value.match(a.FS)?t.openTelegramLink({url:o.value}):t.toggleSafeLinkModal({url:o.value});break;case"callback":{const t=(0,i.jr)(e);if(!t)return;!async function(e,t,s){const a=await(0,y.t9)("answerCallbackButton",{chatId:e.id,accessHash:e.accessHash,messageId:t,data:s});if(!a)return;const{showDialog:o,showNotification:r,toggleSafeLinkModal:i}=(0,n.uC)(),{message:c,alert:d,url:l}=a;d?o({data:{message:c||"Error"}}):c?r({message:c}):l&&i({url:l})}(t,o.messageId,o.value);break}case"requestPoll":t.openPollModal();break;case"buy":{const s=(0,i.jr)(e),{messageId:n,value:a}=o;if(!s)return;a?t.getReceipt({receiptMessageId:a,chatId:s.id,messageId:n}):(t.getPaymentForm({chat:s,messageId:n}),t.setInvoiceMessageInfo((0,i.hj)(e,s.id,n)),t.openPaymentModal({chatId:s.id,messageId:n}));break}}})),(0,n.Q6)("sendBotCommand",((e,t,s)=>{const{command:n,chatId:a}=s,{currentUserId:o}=e,r=a?(0,i.Z1)(e,a):(0,i.jr)(e);o&&r&&V(r,0,n)})),(0,n.Q6)("restartBot",((e,t,s)=>{const{chatId:a}=s,{currentUserId:o}=e,c=(0,i.jr)(e),d=o&&(0,i.IK)(e,a);o&&c&&d&&(async()=>{await(0,y.t9)("unblockContact",d.id,d.accessHash)&&((0,n.R3)((0,r.rB)((0,n.Rd)(),d.id)),V(c,0,"/start"))})()})),(0,n.Q6)("loadTopInlineBots",(e=>{const{hash:t,lastRequestedAt:s}=e.topInlineBots;s&&(0,D.b)(e.serverTimeOffset)-s<60||(async()=>{const s=await(0,y.t9)("fetchTopInlineBots",{hash:t});if(!s)return;const{hash:a,ids:o,users:i}=s;let c=(0,n.Rd)();c=(0,r.Sh)(c,(0,g.ee)(i,"id")),c={...c,topInlineBots:{...c.topInlineBots,hash:a,userIds:o,lastRequestedAt:(0,D.b)(e.serverTimeOffset)}},(0,n.R3)(c)})()})),(0,n.Q6)("queryInlineBot",((e,t,s)=>{const{chatId:a,username:o,query:c,offset:d}=s;(async()=>{let t=e.inlineBots.byUsername[o];if(!1!==t){if(void 0===t){const{user:s,chat:a}=await(0,y.t9)("fetchInlineBot",{username:o})||{};if(e=(0,n.Rd)(),!s||!a)return void(0,n.R3)(H(e,o,!1));e=(0,r.Sh)(e,{[s.id]:s}),e=(0,r.fZ)(e,{[a.id]:a}),t={id:s.id,query:"",offset:"",switchPm:void 0,canLoadMore:!0,results:[]},e=H(e,o,t),(0,n.R3)(e)}(c!==t.query||t.canLoadMore)&&_((()=>{!async function({username:e,inlineBotData:t,chatId:s,query:a,offset:o}){let r=(0,n.Rd)();const c=(0,i.dy)(r,t.id),d=(0,i.Z1)(r,s);if(!c||!d)return;const l=t.query!==a;r=j(r,!0),r=H(r,e,{...t,query:a,...l&&{offset:void 0,results:[]}}),(0,n.R3)(r);const u=await(0,y.t9)("fetchInlineBotResults",{bot:c,chat:d,query:a,offset:l?void 0:o}),h=r.inlineBots.byUsername[e];if(r=j((0,n.Rd)(),!1),!u||!h||a!==h.query)return void(0,n.R3)(r);const m=new Set((h.results||[]).map((e=>e.id))),g=u.results.filter((e=>!m.has(e.id)));r=H(r,e,{...h,help:u.help,...g.length&&{isGallery:u.isGallery},...u.switchPm&&{switchPm:u.switchPm},canLoadMore:u.results.length>0&&Boolean(u.nextOffset),results:""===h.offset||h.offset===u.nextOffset?u.results:(h.results||[]).concat(g),offset:g.length?u.nextOffset:""}),(0,n.R3)(r)}({username:o,inlineBotData:t,chatId:a,query:c,offset:d})}))}})()})),(0,n.Q6)("sendInlineBotResult",((e,t,s)=>{const{id:n,queryId:a}=s,o=(0,i.Bt)(e);if(!o||!n)return;const{chatId:r,threadId:c}=o,d=(0,i.Z1)(e,r);t.setReplyingToId({messageId:void 0}),t.clearWebPagePreview({chatId:r,threadId:c,value:!1}),(0,y.t9)("sendInlineBotResult",{chat:d,resultId:n,queryId:a,replyingTo:(0,i.Yy)(e,r,c)})})),(0,n.Q6)("resetInlineBot",((e,t,s)=>{const{username:a}=s;let o=e.inlineBots.byUsername[a];o&&(o={id:o.id,query:"",offset:"",switchPm:void 0,canLoadMore:!0,results:[]},(0,n.R3)(H(e,a,o)))})),(0,n.Q6)("startBot",((e,t,s)=>{const{botId:n,param:a}=s,o=(0,i.dy)(e,n);o&&(async()=>{await(0,y.t9)("startBot",{bot:o,startParam:a})})()})),s(9667),(0,n.Q6)("loadPasswordInfo",(()=>{(async()=>{const e=await(0,y.t9)("getPasswordInfo");if(!e)return;let t=(0,n.Rd)();t=(0,r.BI)(t,{hasPassword:e.hasPassword}),t=(0,r.IE)(t,{hint:e.hint}),(0,n.R3)(t)})()})),(0,n.Q6)("checkPassword",((e,t,s)=>{const{currentPassword:a,onSuccess:o}=s;(0,n.R3)((0,r.IE)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await(0,y.t9)("checkPassword",a);(0,n.R3)((0,r.IE)((0,n.Rd)(),{isLoading:!1})),e&&o()})()})),(0,n.Q6)("clearPassword",((e,t,s)=>{const{currentPassword:a,onSuccess:o}=s;(0,n.R3)((0,r.IE)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await(0,y.t9)("clearPassword",a);(0,n.R3)((0,r.IE)((0,n.Rd)(),{isLoading:!1})),e&&o()})()})),(0,n.Q6)("updatePassword",((e,t,s)=>{const{currentPassword:a,password:o,hint:i,email:c,onSuccess:d}=s;(0,n.R3)((0,r.IE)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await(0,y.t9)("updatePassword",a,o,i,c);(0,n.R3)((0,r.IE)((0,n.Rd)(),{isLoading:!1})),e&&d()})()})),(0,n.Q6)("updateRecoveryEmail",((e,t,s)=>{const{currentPassword:a,email:o,onSuccess:i}=s;(0,n.R3)((0,r.IE)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await(0,y.t9)("updateRecoveryEmail",a,o);(0,n.R3)((0,r.IE)((0,n.Rd)(),{isLoading:!1,waitingEmailCodeLength:void 0})),e&&i()})()})),(0,n.Q6)("provideTwoFaEmailCode",((e,t,s)=>{const{code:n}=s;(0,y.t9)("provideRecoveryEmailCode",n)})),(0,n.Q6)("clearTwoFaError",(e=>(0,r.IE)(e,{error:void 0}))),(0,n.Q6)("validateRequestedInfo",((e,t,s)=>{const{requestInfo:a,saveInfo:o}=s,c=(0,i.gx)(e),d=c&&(0,i.Z1)(e,c),l=(0,i.Mz)(e);d&&l&&async function(e,t,s,a){const o=await(0,y.t9)("validateRequestedInfo",{chat:e,messageId:t,requestInfo:s,shouldSave:a});if(!o)return;const{id:i,shippingOptions:c}=o;if(!i)return;let d=(0,r.vT)((0,n.Rd)(),i);c?(d=(0,r.TM)(d,c),d=(0,r.Q$)(d,h.KB.Shipping)):d=(0,r.Q$)(d,h.KB.PaymentInfo),(0,n.R3)(d)}(d,l,a,o)})),(0,n.Q6)("getPaymentForm",((e,t,s)=>{const{chat:a,messageId:o}=s;a&&o&&async function(e,t){const s=await(0,y.t9)("getPaymentForm",{chat:e,messageId:t});if(!s)return;let a=(0,r._7)((0,n.Rd)(),s),o=h.KB.PaymentInfo;a.payment.invoice&&(a.payment.invoice.shippingAddressRequested||a.payment.invoice.nameRequested||a.payment.invoice.phoneRequested||a.payment.invoice.emailRequested)&&(o=h.KB.ShippingInfo),a=(0,r.Q$)(a,o),(0,n.R3)(a)}(a,o)})),(0,n.Q6)("getReceipt",((e,t,s)=>{const{receiptMessageId:a,chatId:o,messageId:c}=s,d=o&&(0,i.Z1)(e,o);c&&a&&d&&async function(e,t,s){const a=await(0,y.t9)("getReceipt",e,s);if(!a)return;let o=(0,n.Rd)();const c=(0,i.hj)(o,e.id,t);o=(0,r.Dq)(o,a,c),(0,n.R3)(o)}(d,c,a)})),(0,n.Q6)("clearPaymentError",(e=>{(0,n.R3)({...e,payment:{...e.payment,error:void 0}})})),(0,n.Q6)("clearReceipt",(e=>{(0,n.R3)({...e,payment:{...e.payment,receipt:void 0}})})),(0,n.Q6)("sendCredentialsInfo",((e,t,s)=>{const a=(0,i.$$)(e);if(!a)return;const{credentials:o}=s,{data:c}=o;!async function(e,t){const s=function(e){const t=Object.keys(e).map((t=>`${t}=${e[t]}`)).join("&");return t.length>0?`?${t}`:""}({"card[number]":e.cardNumber,"card[exp_month]":e.expiryMonth,"card[exp_year]":e.expiryYear,"card[cvc]":e.cvv,"card[address_zip]":e.zip,"card[address_country]":e.country}),a=await fetch(`https://api.stripe.com/v1/tokens${s}`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:`Bearer ${t}`}}),o=await a.json();if(o.error){const e=(0,d.Ow)(o.error),t=(0,n.Rd)();return void(0,n.R3)({...t,payment:{...t.payment,error:{...e}}})}let i=(0,r.QH)((0,n.Rd)(),{type:o.type,id:o.id});i=(0,r.Q$)(i,h.KB.Checkout),(0,n.R3)(i)}(c,a)})),(0,n.Q6)("sendPaymentForm",((e,t,s)=>{const{shippingOptionId:a,saveCredentials:o}=s,c=(0,i.gx)(e),d=c&&(0,i.Z1)(e,c),l=(0,i.Mz)(e),u=(0,i.eh)(e),h=(0,i.sp)(e),m=(0,i.$$)(e),g=(0,i.i3)(e);d&&l&&m&&u&&async function(e,t,s,a,o,i){if(await(0,y.t9)("sendPaymentForm",{chat:e,messageId:t,formId:s,credentials:a,requestedInfoId:o,shippingOptionId:i})){const e=(0,r.bp)((0,n.Rd)());(0,n.R3)((0,r.WY)(e))}}(d,l,u,{save:o,data:g},h,a)})),(0,n.Q6)("setPaymentStep",((e,t,s={})=>(0,r.Q$)(e,s.step||h.KB.ShippingInfo))),(0,n.Q6)("setInvoiceMessageInfo",((e,t,s)=>(0,r.nA)(e,s))),s(4907);var W=s(8406),K=s(7358);const X=(0,Z.P2)((e=>e()),500,!0);(0,n.Q6)("apiUpdate",((e,t,s)=>{switch(s["@type"]){case"updateChat":{s.noTopChatsRequest||(0,i.N)(e,s.id)||t.loadTopChats();const a=(0,r.a4)(e,s.id,s.chat,s.newProfilePhoto);(0,n.R3)(a),X((()=>(0,K.w)((0,i.A1)((0,n.Rd)())))),s.chat.id&&(0,W.Vr)({chatId:s.chat.id,lastReadInboxMessageId:s.chat.lastReadInboxMessageId});break}case"updateChatJoin":{const a=(0,i.Ek)(e,s.id);if(!a)break;e=(0,r.B1)(e,a,[s.id]),e=(0,r.a4)(e,s.id,{isNotJoined:!1}),(0,n.R3)(e);const o=(0,i.Z1)(e,s.id);o&&t.requestChatUpdate({chatId:o.id});break}case"updateChatLeave":{const t=(0,i.Ek)(e,s.id);if(!t)break;const{[t]:a}=e.chats.listIds;a&&(e=(0,r.Mg)(e,t,a.filter((e=>e!==s.id)))),e=(0,r.a4)(e,s.id,{isNotJoined:!0}),(0,n.R3)(e);break}case"updateChatInbox":(0,n.R3)((0,r.a4)(e,s.id,s.chat)),X((()=>(0,K.w)((0,i.A1)((0,n.Rd)()))));break;case"updateChatTypingStatus":{const{id:t,typingStatus:a}=s;(0,n.R3)((0,r.a4)(e,t,{typingStatus:a})),setTimeout((()=>{const e=(0,n.Rd)(),s=(0,i.Z1)(e,t);s&&a&&s.typingStatus&&s.typingStatus.timestamp===a.timestamp&&(0,n.R3)((0,r.a4)(e,t,{typingStatus:void 0}))}),6e3);break}case"newMessage":{const{message:a}=s,{chatId:o,threadId:c,type:d}=(0,i.Bt)(e)||{};if(a.senderId===e.currentUserId&&!a.isFromScheduled)return;const l=(0,i.Z1)(e,s.chatId);if(!l)return;const h="thread"===d&&c===u._f&&s.chatId===o;h?setTimeout((()=>{t.requestChatUpdate({chatId:s.chatId})}),1500):(0,n.R3)((0,r.a4)(e,s.chatId,{unreadCount:l.unreadCount?l.unreadCount+1:1,...s.message.hasUnreadMention&&{unreadMentionsCount:l.unreadMentionsCount?l.unreadMentionsCount+1:1}})),(0,K.w)((0,i.A1)((0,n.Rd)()));const{hasWebNotifications:m}=(0,i.dZ)(e);m&&(0,W.VL)({chat:l,message:a,isActiveChat:h});break}case"updateCommonBoxMessages":case"updateChannelMessages":{const{ids:t,messageUpdate:a}=s;if(!1!==a.hasUnreadMention)return;t.forEach((t=>{const n="channelId"in s?s.channelId:(0,i.X5)(e,t),a=(0,i.Z1)(e,n);null!=a&&a.unreadMentionsCount&&(e=(0,r.a4)(e,n,{unreadMentionsCount:a.unreadMentionsCount-1}))})),(0,n.R3)(e);break}case"updateChatFullInfo":{const{fullInfo:t}=s,a=e.chats.byId[s.id];if(!a)return;(0,n.R3)((0,r.a4)(e,s.id,{fullInfo:{...a.fullInfo,...t}}));break}case"updatePinnedChatIds":{const{ids:t,folderId:o}=s,r=o===a.WS?"archived":"active";e={...e,chats:{...e.chats,orderedPinnedIds:{...e.chats.orderedPinnedIds,[r]:t.length?t:void 0}}},(0,n.R3)(e);break}case"updateChatPinned":{const{id:t,isPinned:o}=s,r=(0,i.Ek)(e,t);if(r){const{[r]:s}=e.chats.orderedPinnedIds;let n=s||[];if(o){if(!n.includes(t)){if("active"===r&&n.length>=a.EG){const t=e.chats.listIds.active;n=n.filter((e=>t&&t.includes(e)))}n=[t,...n]}}else n=n.filter((e=>e!==t));e={...e,chats:{...e.chats,orderedPinnedIds:{...e.chats.orderedPinnedIds,[r]:n.length?n:void 0}}}}(0,n.R3)(e);break}case"updateChatListType":{const{id:t,folderId:a}=s;(0,n.R3)((0,r.Pi)(e,t,a));break}case"updateChatFolder":{const{id:t,folder:a}=s,{byId:o,orderedIds:r}=e.chatFolders,i=a?{...o,[t]:a}:(0,g.ei)(o,Object.keys(o).map(Number).filter((e=>e!==t))),c=a?r&&r.includes(t)?r:[...r||[],t]:r?r.filter((e=>e!==t)):void 0;(0,n.R3)({...e,chatFolders:{...e.chatFolders,byId:i,orderedIds:c}});break}case"updateChatFoldersOrder":{const{orderedIds:t}=s;(0,n.R3)({...e,chatFolders:{...e.chatFolders,orderedIds:t}});break}case"updateRecommendedChatFolders":{const{folders:t}=s;(0,n.R3)({...e,chatFolders:{...e.chatFolders,recommended:t}});break}case"updateChatMembers":{var o;const t=e.chats.byId[s.id],{replacedMembers:a,addedMember:i,deletedMemberId:c}=s;if(!t)return;let d=!1,l=null!==(o=t.fullInfo)&&void 0!==o&&o.members?[...t.fullInfo.members]:[];if(a)l=a,d=!0;else if(i)l.length&&l.some((e=>e.userId===i.userId))||(l.push(i),d=!0);else if(l.length&&c){const e=l.findIndex((e=>e.userId===c));e>-1&&(l.slice(e,1),d=!0)}if(d){const a=l.filter((({isOwner:e,isAdmin:t})=>e||t));(0,n.R3)((0,r.a4)(e,s.id,{membersCount:l.length,fullInfo:{...t.fullInfo,members:l,adminMembers:a}}))}break}case"deleteProfilePhotos":{const{chatId:t,ids:a}=s,o=e.chats.byId[t];null!=o&&o.photos&&(0,n.R3)((0,r.a4)(e,t,{photos:o.photos.filter((e=>!a.includes(e.id)))}));break}case"draftMessage":{const{chatId:t,formattedText:a,date:o,replyingToId:i}=s;e.chats.byId[t]&&(e=(0,r.pf)(e,t,u._f,"draft",a),e=(0,r.pf)(e,t,u._f,"replyingToId",i),e=(0,r.a4)(e,t,{draftDate:o}),(0,n.R3)(e));break}case"showInvite":{const{data:e}=s;t.showDialog({data:e});break}}}));const Y=350;function z(e,t,s,n,a=!1){const o=a?(0,i.Tm)(e,t,s):(0,i.hj)(e,t,s);if(o&&n.content){const{photo:e,video:t,sticker:s,document:a}=(0,d.qp)(o);e&&n.content.photo?(n.content.photo.blobUrl=e.blobUrl,n.content.photo.thumbnail=e.thumbnail):t&&n.content.video?n.content.video.blobUrl=t.blobUrl:s&&n.content.sticker?n.content.sticker.isPreloadedGlobally=s.isPreloadedGlobally:a&&n.content.document&&(n.content.document.previewBlobUrl=a.previewBlobUrl)}return a?(0,r.P4)(e,t,s,n):(0,r.cY)(e,t,s,n)}function J(e,t,s,n){const{chatId:a}=s,{threadInfo:o}=(0,i.Db)(e,a,s)||{};if(!o&&s.replyToMessageId){const o=(0,i.hj)(e,a,s.replyToMessageId);o?e=(0,r.lG)(e,o,a,s.id,n):t.loadMessage({chatId:a,messageId:s.replyToMessageId,threadUpdate:{isDeleting:n,lastMessageId:s.id}})}return e}function ee(e,t,s){const{id:n,chatId:a}=s,{threadInfo:o,firstMessageId:c}=(0,i.Db)(e,a,s)||{},l=(0,i.Z1)(e,a),h=(null==l?void 0:l.unreadCount)&&!(0,i.gb)(e,a,u._f);if(e=J(e,t,s),o&&(!c&&(0,d.CI)(s)||(e=(0,r.xj)(e,a,o.threadId,[n]),(0,i.b9)(e,a,o.threadId)&&(e=(0,r.$S)(e,a,o.threadId,n),c||(e=(0,r.pf)(e,a,o.threadId,"firstMessageId",s.id)))),e=(0,r.pf)(e,a,o.threadId,"threadInfo",{...o,lastMessageId:s.id,messagesCount:o.messagesCount+1})),h)return e;if(e=(0,r.xj)(e,a,u._f,[n]),(0,i.b9)(e,a,u._f)){const t=(0,i.It)(e,a,u._f),s=(0,r.$S)(e,a,u._f,n),o=(0,i.Cb)(s,a,u._f);t&&!o.includes(t)||(e=s)}return e}function te(e,t,s,n=!1){var a;const{chats:o}=e,i=null===(a=o.byId[t])||void 0===a?void 0:a.lastMessage;return!i||n||i.id===s.id||i.id===s.previousLocalId||s.id>i.id?(0,r.a4)(e,t,{lastMessage:s}):e}function se(e,t){const s=(0,i.Zw)(e,t),n=(0,i.gb)(e,t,u._f);if(!s||!n)return;let a=n.length;for(;a--;){const e=s[n[a]];if(!e.isDeleting)return e}}function ne(e,t,s,a){if(e){t.forEach((t=>{const s=se(a=(0,r.cY)(a,e,t,{isDeleting:!0}),e);s&&(a=te(a,e,s,!0))})),(0,n.R3)(a),s.requestChatUpdate({chatId:e});const o=[];return t.forEach((t=>{const n=(0,i.hj)(a,e,t);if(!n)return;a=J(a,s,n,!0);const{threadInfo:r}=(0,i.Db)(a,e,n)||{};r&&o.push(r.threadId)})),(0,n.R3)(a),void setTimeout((()=>{(0,n.R3)((0,r.K4)((0,n.Rd)(),e,t)),(0,g.Tw)(o).forEach((t=>{s.requestThreadInfoUpdate({chatId:e,threadId:t})}))}),Y)}const o=[];t.forEach((e=>{const t=(0,i.X5)(a,e);if(t){o.push(t);const s=se(a=(0,r.cY)(a,t,e,{isDeleting:!0}),t);s&&(a=te(a,t,s,!0)),setTimeout((()=>{(0,n.R3)((0,r.K4)((0,n.Rd)(),t,[e]))}),Y)}})),(0,n.R3)(a),(0,g.Tw)(o).forEach((e=>{s.requestChatUpdate({chatId:e})}))}(0,n.Q6)("apiUpdate",((e,t,s)=>{switch(s["@type"]){case"newMessage":{const{chatId:o,id:c,message:l}=s;e=ee(e=z(e,o,c,l),t,l),l.threadInfo&&(e=(0,r.Xg)(e,l.threadInfo.chatId,l.threadInfo.threadId,l.threadInfo)),(0,n.R3)(e);const u=(0,i.hj)(e,o,c);if((0,i.hg)(e,o,l)){var a;if(l.isOutgoing&&(null===(a=l.content)||void 0===a||!a.action)){const s=(0,i.Bt)(e);s&&t.focusMessage({chatId:o,threadId:s.threadId,messageId:l.id,noHighlight:!0,isResizingContainer:!0})}const{threadInfo:s}=(0,i.Db)(e,o,l)||{};s&&t.requestThreadInfoUpdate({chatId:o,threadId:s.threadId}),(0,d.CI)(l)||setTimeout((()=>{(0,n.R3)(te((0,n.Rd)(),o,u))}),Y)}else(0,n.R3)(te((0,n.Rd)(),o,u));(0,i.N)(e,o)||t.loadTopChats();break}case"newScheduledMessage":{const{chatId:t,id:a,message:o}=s;e=z(e,t,a,o,!0);const c=(0,i.qy)(e,t)||[];e=(0,r.pf)(e,t,u._f,"scheduledIds",(0,g.Tw)([...c,a])),(0,n.R3)(e);break}case"updateMessage":{var o,c;const{chatId:a,id:d,message:l}=s;if(!(0,i.hj)(e,a,d))return;e=z(e,a,d,l);const h=(0,i.hj)(e,a,d);l.threadInfo&&(e=(0,r.Xg)(e,l.threadInfo.chatId,l.threadInfo.threadId,l.threadInfo)),e=te(e,a,h),(0,n.R3)(e);const m=(0,i.Z1)(e,a);m&&!l.isOutgoing&&(null===(o=m.lastMessage)||void 0===o?void 0:o.id)===l.id&&(0,i.xo)(e,m)&&(0,i.hg)(e,a,l)&&(0,i.b9)(e,a,(null===(c=l.threadInfo)||void 0===c?void 0:c.threadId)||u._f)&&t.focusLastMessage();break}case"updateScheduledMessage":{const{chatId:t,id:a,message:o}=s;if(!(0,i.Tm)(e,t,a))return;e=z(e,t,a,o,!0);const c=Object.keys((0,i.Fn)(e,t)||{}).map(Number).sort(((e,t)=>t-e));e=(0,r.pf)(e,t,u._f,"scheduledIds",c),(0,n.R3)(e);break}case"updateMessageSendSucceeded":{const{chatId:a,localId:o,message:c}=s;e=ee(e,t,c);const d=(0,i.hj)(e,a,o);e=(0,r.K4)(e,a,[o]),c.isScheduled&&(e=(0,r.bV)(e,a,[o])),e=(0,r.cY)(e,a,c.id,{...d,...c,previousLocalId:o});const l=(0,i.hj)(e,a,c.id);e=te(e,a,l);const u=(0,i.Db)(e,a,c);null!=u&&u.threadInfo&&(t.markMessageListRead({maxId:c.id}),e=(0,r.pf)(e,a,u.threadInfo.threadId,"threadInfo",{...u.threadInfo,lastMessageId:c.id,lastReadInboxMessageId:c.id})),(0,n.R3)(e);break}case"updateScheduledMessageSendSucceeded":{const{chatId:t,localId:a,message:o}=s,c=(0,i.qy)(e,t)||[];e=(0,r.pf)(e,t,u._f,"scheduledIds",[...c,o.id]);const d=(0,i.Tm)(e,t,a);e=(0,r.bV)(e,t,[a]),e=(0,r.P4)(e,t,o.id,{...d,...o,previousLocalId:a}),(0,n.R3)(e);break}case"updatePinnedIds":{const{chatId:t,isPinned:a,messageIds:o}=s,c=(0,i.KB)(e,t)||[],d=a?[...c,...o].sort(((e,t)=>t-e)):c.filter((e=>!o.includes(e)));(0,n.R3)((0,r.pf)(e,t,u._f,"pinnedIds",d));break}case"updateThreadInfo":{const{chatId:t,threadId:a,threadInfo:o,firstMessageId:c}=s,d={...(0,i.tZ)(e,t,a),...o};if(!d.threadId)return;e=(0,r.Xg)(e,t,a,d),c&&(e=(0,r.pf)(e,t,a,"firstMessageId",c)),(0,n.R3)(e);break}case"resetMessages":{const{id:a}=s,o=(0,i.Zw)(e,a);o&&!(0,d.YA)(a)&&(e=(0,r.K4)(e,a,Object.keys(o).map(Number)),(0,n.R3)(e),t.loadFullChat({chatId:a,force:!0}));break}case"deleteMessages":{const{ids:n,chatId:a}=s;ne(a,n,t,e);break}case"deleteScheduledMessages":{const{ids:t,chatId:a}=s;!function(e,t,s,a){e&&(t.forEach((t=>{a=(0,r.P4)(a,e,t,{isDeleting:!0})})),(0,n.R3)(a),setTimeout((()=>{a=(0,r.bV)((0,n.Rd)(),e,t);const s=(0,i.Fn)(a,e);a=(0,r.pf)(a,e,u._f,"scheduledIds",Object.keys(s||{}).map(Number)),(0,n.R3)(a)}),Y))}(a,t,0,e);break}case"deleteHistory":{const{chatId:n}=s,a=e.messages.byChatId[n];a?ne(n,Object.keys(a.byId).map(Number),t,e):t.requestChatUpdate({chatId:n});break}case"updateCommonBoxMessages":{const{ids:t,messageUpdate:a}=s;t.forEach((t=>{const s=(0,i.X5)(e,t);s&&(e=(0,r.cY)(e,s,t,a))})),(0,n.R3)(e);break}case"updateChannelMessages":{const{channelId:t,ids:a,messageUpdate:o}=s;a.forEach((s=>{e=(0,r.cY)(e,t,s,o)})),(0,n.R3)(e);break}case"updateMessagePoll":{const{pollId:t,pollUpdate:a}=s,o=(0,i.ZB)(e,t);if(null!=o&&o.content.poll){const t={...o.content.poll,...a},{results:s}=t.results||{};if(s&&!s.some((e=>e.isChosen))){const{results:e}=o.content.poll.results,n=e&&e.filter((e=>e.isChosen));n&&n.forEach((e=>{const n=s.findIndex((t=>t.option===e.option));n>=0&&(t.results.results[n].isChosen=!0)}))}(0,n.R3)((0,r.cY)(e,o.chatId,o.id,{content:{...o.content,poll:t}}))}break}case"updateMessagePollVote":{const{pollId:t,userId:a,options:o}=s,c=(0,i.ZB)(e,t);if(!c||!c.content.poll||!c.content.poll.results)break;const{poll:d}=c.content,{recentVoterIds:l,totalVoters:u,results:h}=d.results,m=l?[...l]:[],g=u?u+1:1,f=h?[...h]:[];m.push(a),o.forEach((t=>{const s=f.find((e=>e.option===t)),n=f.findIndex((e=>e.option===t)),o=s?{...s}:{option:t,votersCount:0};o.votersCount+=1,a===e.currentUserId&&(o.isChosen=!0),n?f[n]=o:f.push(o)})),(0,n.R3)((0,r.cY)(e,c.chatId,c.id,{content:{...c.content,poll:{...d,results:{...d.results,recentVoterIds:m,totalVoters:g,results:f}}}}));break}}}));const ae=(0,Z.P2)((function(){let e=(0,n.Rd)();oe.forEach((([t,s])=>{e=(0,r.Nq)(e,t,{status:s})})),(0,n.R3)(e),oe=[]}),3e3,!0);let oe=[];(0,n.Q6)("apiUpdate",((e,t,s)=>{switch(s["@type"]){case"deleteUser":return(0,r.h8)(e,s.id);case"updateUser":return(0,r.Nq)(e,s.id,s.user);case"updateUserStatus":return n=s.userId,a=s.status,oe.push([n,a]),void ae();case"updateUserFullInfo":{const{id:t,fullInfo:n}=s,a=e.users.byId[t];if(!a)return;return(0,r.Nq)(e,t,{fullInfo:{...a.fullInfo,...n}})}}var n,a})),(0,n.Q6)("apiUpdate",((e,t,s)=>{switch(s["@type"]){case"updateStickerSet":return(0,r.Rg)(e,s.id,s.stickerSet)}})),(0,n.Q6)("apiUpdate",((e,t,s)=>{switch(s["@type"]){case"updatePeerBlocked":return s.isBlocked?(0,r.O4)((0,n.Rd)(),s.id):(0,r.rB)((0,n.Rd)(),s.id);case"updateResetContactList":(0,n.R3)({...(0,n.Rd)(),contactList:{hash:0,userIds:[]}});break;case"updateFavoriteStickers":t.loadFavoriteStickers();break;case"updatePrivacy":e.settings.privacy[s.key]=s.rules}})),(0,n.Q6)("apiUpdate",((e,t,s)=>{switch(s["@type"]){case"updateNotifySettings":return(0,r.HN)(e,s.peerType,s.isSilent,s.shouldShowPreviews);case"updateNotifyExceptions":{const{chatId:t,isMuted:a,isSilent:o,shouldShowPreviews:i}=s;e.chats.byId[t]&&(e=(0,r.a4)(e,t,{isMuted:a})),(0,n.R3)((0,r.aK)(e,t,{isMuted:a,isSilent:o,shouldShowPreviews:i}));break}}})),(0,n.Q6)("apiUpdate",((e,t,s)=>{switch(s["@type"]){case"updateTwoFaStateWaitCode":return{...e,twoFaSettings:{...e.twoFaSettings,isLoading:!1,waitingEmailCodeLength:s.length}};case"updateTwoFaError":return{...e,twoFaSettings:{...e.twoFaSettings,error:s.message}}}}));var re=s(8674),ie=s(6752),ce=s(1279),de=s(1212),le=s(5332);function ue(e){(0,o.d4)((()=>(0,Z.Gq)(e)),[e])}var he=s(9290);function me(e){e.preventDefault()}var ge=s(6590),fe=s(3989),pe=s(3455),Ie=s(2255);function ve(){const[e,t]=(0,o.eJ)(window.navigator.onLine);return(0,o.d4)((()=>{function e(){t(window.navigator.onLine)}return window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("offline",e),window.removeEventListener("online",e)}}),[]),e}var ye=s(706),Ze=s(9107),Pe=s(6917),Ce=s(3106),we=s(8964),be=s(231),Me=s(9589),Se=s(9187),Ee=s(3321);const ke=[0,1,2],Re=(0,o.X$)((0,n.c$)((e=>{const{query:t,fetchingStatus:s,chatId:n,date:a}=e.globalSearch,{currentUserId:o}=e,{byId:r}=e.chats,{animationLevel:c}=e.settings.byKey;return{searchQuery:t,isLoading:!!s&&Boolean(s.chats||s.messages),currentUserId:o,chatsById:r,globalSearchChatId:n,searchDate:a,theme:(0,i.Pu)(e),animationLevel:c}}),((e,t)=>(0,g.ei)(t,["openChat","openTipsChat","setGlobalSearchDate","setGlobalSearchChatId","setSettingOption"])))((({content:e,contactsFilter:t,onSearchQuery:s,onSelectSettings:n,onSelectContacts:r,onSelectArchived:i,setGlobalSearchChatId:c,onReset:l,searchQuery:u,isLoading:g,shouldSkipTransition:f,currentUserId:p,globalSearchChatId:I,searchDate:v,theme:y,animationLevel:Z,chatsById:P,openChat:C,openTipsChat:w,setGlobalSearchDate:b,setSettingOption:M})=>{const S=(0,Ze.Z)(),E=e===h.du.ChatList,k=(0,o.Ye)((()=>v?(0,L.xH)(new Date(1e3*v)):void 0),[v]),R=(0,o.Ye)((()=>E&&P?Object.values(P).reduce(((e,t)=>(0,d.pE)(t)&&t.unreadCount?e+1:e),0):0),[E,P]),T="web.telegram.org"===window.location.hostname,N=(0,o.Ye)((()=>({onTrigger:e,isOpen:t})=>o.ZP.createElement(be.Z,{round:!0,ripple:E&&!m.wB,size:"smaller",color:"translucent",className:t?"active":"",onClick:E?e:()=>l(),ariaLabel:E?S("AccDescrOpenMenu2"):"Return to chat list"},o.ZP.createElement("div",{className:(0,ie.Z)("animated-menu-icon",!E&&"state-back",f&&"no-animation")}))),[E,S,l,f]),B=(0,o.I4)((()=>{u||s("")}),[u,s]),x=(0,o.I4)((()=>{C({id:p,shouldReplaceHistory:!0})}),[p,C]),A=(0,o.I4)((e=>{e.stopPropagation();const t="light"===y?"dark":"light";M({theme:t}),M({shouldUseSystemTheme:!1}),(0,Pe.Z)(t,Z===a.zy)}),[Z,M,y]),O=(0,o.I4)((e=>{e.stopPropagation();const t=0===Z?2:0;ke.forEach(((e,s)=>{document.body.classList.toggle(`animation-level-${s}`,t===s)})),M({animationLevel:t})}),[Z,M]),F=Boolean(I)||e===h.du.GlobalSearch||e===h.du.Contacts,U=e===h.du.Contacts?S("SearchFriends"):S("Search");return o.ZP.createElement("div",{className:"LeftMainHeader"},o.ZP.createElement("div",{id:"LeftMainHeader",className:"left-header"},o.ZP.createElement(Ce.Z,{trigger:N,footer:`${a.iC} alpha ${a.Ji}`},o.ZP.createElement(we.Z,{icon:"saved-messages",onClick:x},S("SavedMessages")),o.ZP.createElement(we.Z,{icon:"archive",onClick:i},o.ZP.createElement("span",{className:"menu-item-name"},S("ArchivedChats")),R>0&&o.ZP.createElement("div",{className:"archived-badge"},R)),o.ZP.createElement(we.Z,{icon:"user",onClick:r},S("Contacts")),o.ZP.createElement(we.Z,{icon:"settings",onClick:n},S("Settings")),o.ZP.createElement(we.Z,{icon:"darkmode",onClick:A},o.ZP.createElement("span",{className:"menu-item-name"},S("lng_menu_night_mode")),o.ZP.createElement(Ee.Z,{id:"darkmode",label:S("dark"===y?"lng_settings_disable_night_theme":"lng_settings_enable_night_theme"),checked:"dark"===y,noAnimation:!0})),o.ZP.createElement(we.Z,{icon:"animations",onClick:O},o.ZP.createElement("span",{className:"menu-item-name capitalize"},S("Appearance.Animations").toLowerCase()),o.ZP.createElement(Ee.Z,{id:"animations",label:"Toggle Animations",checked:Z>0})),o.ZP.createElement(we.Z,{icon:"help",onClick:()=>{w({langCode:S.code})}},S("TelegramFeatures")),o.ZP.createElement(we.Z,{icon:"bug",href:a.mU},"Report Bug"),T&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(we.Z,{icon:"char-K",href:"https://web.telegram.org/k/",onClick:()=>{localStorage.setItem("kz_version",JSON.stringify("K")),(0,ge.Wv)()}},"Switch to K Version"),o.ZP.createElement(we.Z,{icon:"char-W",href:"https://web.telegram.org/?legacy=1",onClick:ge.Wv},"Switch to Old Version"))),o.ZP.createElement(Me.Z,{inputId:"telegram-search-input",parentContainerClassName:"LeftSearch",className:I||v?"with-picker-item":"",value:t||u,focused:F,isLoading:g,placeholder:U,autoComplete:"off",canClose:Boolean(I||v),onChange:s,onReset:l,onFocus:B},k&&o.ZP.createElement(Se.Z,{icon:"calendar",title:k,canClose:!0,isMinimized:Boolean(I),className:"search-date",onClick:b,clickArg:{date:void 0}}),I&&o.ZP.createElement(Se.Z,{chatOrUserId:I,onClick:c,canClose:!0,clickArg:{id:void 0}}))))})));var Te=s(9204);const Ne=(0,o.X$)((()=>{const e=(0,Ze.Z)();return o.ZP.createElement("div",{id:"ConnectionState",dir:e.isRtl?"rtl":void 0},o.ZP.createElement(Te.Z,{color:"black"}),o.ZP.createElement("div",{className:"state-text"},e("WaitingForNetwork")))}));var Be=s(1174);var xe=s(3133),Ae=s(9359);const Le=(0,o.X$)((0,n.c$)((e=>{const{chats:{byId:t},users:{byId:s},chatFolders:{byId:n,orderedIds:a,activeChatFolder:o},currentUserId:r,lastSyncTime:c,shouldSkipHistoryAnimations:d}=e;return{chatsById:t,usersById:s,chatFoldersById:n,orderedFolderIds:a,lastSyncTime:c,notifySettings:(0,i.dZ)(e),notifyExceptions:(0,i.NJ)(e),activeChatFolder:o,currentUserId:r,shouldSkipHistoryAnimations:d}}),((e,t)=>(0,g.ei)(t,["loadChatFolders","setActiveChatFolder","openChat"])))((({chatsById:e,usersById:t,chatFoldersById:s,notifySettings:n,notifyExceptions:a,orderedFolderIds:r,activeChatFolder:i,currentUserId:c,lastSyncTime:l,shouldSkipHistoryAnimations:u,foldersDispatch:h,onScreenSelect:f,loadChatFolders:p,setActiveChatFolder:I,openChat:v})=>{const y=(0,o.sO)(null),P=(0,Ze.Z)();(0,o.d4)((()=>{l&&p()}),[l,p]);const C=(0,o.Ye)((()=>r?r.map((e=>s[e]||{})).filter(Boolean):void 0),[s,r]),w=((e,t,s)=>{const n=((e,t=!1)=>(0,o.Ye)((()=>(0,Z.P2)((e=>e()),e,!t)),[e,t]))(t,!0),[a,r]=(0,o.eJ)(),[i,c,d]=(0,ye.Z)();return(0,re.ZP)(c,d),(0,he.Z)((()=>{i||n((()=>{r(e())}))}),s.concat([i])),a})((()=>{if(!C||!C.length)return;const s=Object.keys(e).map(Number),o=C.map((o=>{const{unreadDialogsCount:r,hasActiveDialogs:i}=(0,d.Fu)(e,t,o,s,n,a)||{};return{id:o.id,badgeCount:r,isBadgeActive:i}}));return(0,g.ee)(o,"id")}),3e3,[C,e,t,n,a]),b=(0,o.Ye)((()=>{if(C&&C.length)return[{title:"en"===P.code?"All":P("FilterAllChats")},...C.map((e=>({title:e.title,...null==w?void 0:w[e.id]})))]}),[C,w,P]),M=(0,o.I4)((e=>{I(e)}),[I]);(0,o.d4)((()=>{b&&b.length&&i>=b.length&&I(0)}),[i,b,I]),(0,o.d4)((()=>{if(y.current&&m.$b&&b&&b.length)return(0,Be.s)(y.current,{selectorToPreventScroll:".chat-list",onSwipe:(e,t)=>t===Be.e.Left?(I(Math.min(i+1,b.length-1)),!0):t===Be.e.Right&&(I(Math.max(0,i-1)),!0)})}),[i,b,I]);const S=(0,o.sO)();S.current=0!==i,(0,o.d4)((()=>S.current?(0,fe.Z)((()=>{S.current&&I(0)})):void 0),[i,I]),(0,ge.ZP)(0!==i,(()=>I(0))),(0,o.d4)((()=>{const e=e=>{if(e.ctrlKey&&e.shiftKey&&e.code.startsWith("Digit")&&b){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t)return;if("0"===t)return void v({id:c,shouldReplaceHistory:!0});const s=Number(t)-1;if(s>b.length-1)return;I(s),e.preventDefault()}};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}}));const{shouldRender:E,transitionClassNames:k}=(0,de.Z)(!r,void 0,!0);function R(e){const t=Object.values(s).find((({title:e})=>e===b[i].title));return t&&0!==i?o.ZP.createElement(Ae.Z,{folderType:"folder",folderId:t.id,isActive:e,onScreenSelect:f,foldersDispatch:h}):o.ZP.createElement(Ae.Z,{folderType:"all",isActive:e,foldersDispatch:h,onScreenSelect:f})}return o.ZP.createElement("div",{className:"ChatFolders"},null!=b&&b.length?o.ZP.createElement(xe.Z,{tabs:b,activeTab:i,onSwitchTab:M}):E?o.ZP.createElement("div",{className:(0,ie.Z)("tabs-placeholder",k)}):void 0,o.ZP.createElement(Ie.Z,{ref:y,name:u?"none":P.isRtl?"slide-reversed":"slide",activeKey:i,renderCount:b?b.length:void 0},R))})));var Oe=s(9203),Fe=s(8778),Ue=s(4288);const $e=(0,o.X$)((e=>{const t=(0,Fe.Z)(Oe.gl.Extra,"LeftSearch");return t?o.ZP.createElement(t,e):o.ZP.createElement(Ue.Z,null)})),Qe=(0,o.X$)((e=>{const t=(0,Fe.Z)(Oe.gl.Extra,"ContactList");return t?o.ZP.createElement(t,e):o.ZP.createElement(Ue.Z,null)}));var De=s(2328);let qe;const Ge=(0,o.X$)((({isShown:e,onNewPrivateChat:t,onNewChannel:s,onNewGroup:n})=>{const[a,r]=(0,o.eJ)(!1);(0,o.d4)((()=>{e||r(!1)}),[e]);const i=(0,Ze.Z)(),c=(0,ie.Z)("NewChatButton",e&&"revealed",a&&"menu-is-open"),d=(0,o.I4)((()=>{qe&&(clearTimeout(qe),qe=void 0)}),[]),l=(0,o.I4)((()=>{qe&&(clearTimeout(qe),qe=void 0),qe=window.setTimeout((()=>{r(!1)}),750)}),[]);return o.ZP.createElement("div",{className:c,onMouseEnter:d,onMouseLeave:l},o.ZP.createElement(be.Z,{round:!0,color:"primary",className:a?"active":"",onClick:()=>{r(!a)},ariaLabel:i(a?"Close":"NewMessageTitle"),tabIndex:-1},o.ZP.createElement("i",{className:"icon-new-chat-filled"}),o.ZP.createElement("i",{className:"icon-close"})),o.ZP.createElement(De.Z,{isOpen:a,positionX:"right",positionY:"bottom",autoClose:!0,onClose:()=>{r(!1)}},o.ZP.createElement(we.Z,{icon:"channel",onClick:s},i("NewChannel")),o.ZP.createElement(we.Z,{icon:"group",onClick:n},i("NewGroup")),o.ZP.createElement(we.Z,{icon:"user",onClick:t},i("NewMessageTitle"))))}));var He=s(126);const je=Object.keys(h.du).length/2;let _e;const Ve=(0,n.c$)((e=>(0,g.ei)(e,["connectionState"])))((({content:e,searchQuery:t,searchDate:s,contactsFilter:n,shouldSkipTransition:a,foldersDispatch:r,onSearchQuery:i,onContentChange:c,onScreenSelect:d,onReset:l,connectionState:u})=>{const[g,f]=(0,o.eJ)(m.$b),p=!ve()||"connectionStateConnecting"===u,I=(0,o.sO)(!1),v=(0,o.I4)((()=>{c(h.du.Settings)}),[c]),y=(0,o.I4)((()=>{c(h.du.Contacts)}),[c]),Z=(0,o.I4)((()=>{c(h.du.NewChannelStep1)}),[c]),P=(0,o.I4)((()=>{c(h.du.NewGroupStep1)}),[c]),C=(0,o.I4)((()=>{c(h.du.Archived)}),[c]),w=(0,o.I4)((()=>{e===h.du.ChatList&&(I.current=!0,f(!0))}),[e]),b=(0,o.I4)((()=>{I.current=!1,_e&&(clearTimeout(_e),_e=void 0),_e=window.setTimeout((()=>{I.current||f(!1)}),250)}),[]);(0,o.d4)((()=>{let t;return e!==h.du.ChatList?t=window.setTimeout((()=>{f(!1)}),250):(I.current||m.$b)&&f(!0),()=>{t&&(clearTimeout(t),t=void 0)}}),[e]);const[M,S,E]=function(){const[e,t]=(0,ye.Z)(!1);(0,o.d4)((()=>{const e=window.setTimeout(t,2592e5);return()=>{clearTimeout(e)}}),[t]);const{shouldRender:s,transitionClassNames:n}=(0,de.Z)(e);return[s,n,()=>{window.location.reload()}]}(),k=(0,Ze.Z)();return o.ZP.createElement("div",{id:"LeftColumn-main",onMouseEnter:m.$b?void 0:w,onMouseLeave:m.$b?void 0:b},o.ZP.createElement(Re,{content:e,contactsFilter:n,onSearchQuery:i,onSelectSettings:v,onSelectContacts:y,onSelectArchived:C,onReset:l,shouldSkipTransition:a}),o.ZP.createElement(He.Z,{isOpen:p,isCustom:!0,className:"connection-state-wrapper opacity-transition slow"},(()=>o.ZP.createElement(Ne,null))),o.ZP.createElement(Ie.Z,{name:a?"none":"zoom-fade",renderCount:je,activeKey:e,shouldCleanup:!0,cleanupExceptionKey:h.du.ChatList,className:p?"pull-down":void 0},(a=>{switch(e){case h.du.ChatList:return o.ZP.createElement(Le,{onScreenSelect:d,foldersDispatch:r});case h.du.GlobalSearch:return o.ZP.createElement($e,{searchQuery:t,searchDate:s,isActive:a,onReset:l});case h.du.Contacts:return o.ZP.createElement(Qe,{filter:n,isActive:a,onReset:l});default:return}})),M&&o.ZP.createElement(be.Z,{fluid:!0,pill:!0,className:(0,ie.Z)("btn-update",S),onClick:E},k("lng_update_telegram")),o.ZP.createElement(Ge,{isShown:g,onNewPrivateChat:y,onNewChannel:Z,onNewGroup:P}))})),We=(0,o.X$)((e=>{const t=(0,Fe.Z)(Oe.gl.Extra,"Settings");return t?o.ZP.createElement(t,e):o.ZP.createElement(Ue.Z,null)})),Ke=(0,o.X$)((e=>{const t=(0,Fe.Z)(Oe.gl.Extra,"NewChat");return t?o.ZP.createElement(t,e):o.ZP.createElement(Ue.Z,null)})),Xe=(0,o.X$)((e=>{const t=(0,Fe.Z)(Oe.gl.Extra,"ArchivedChats");return t?o.ZP.createElement(t,e):o.ZP.createElement(Ue.Z,null)}));var Ye;!function(e){e[e.Main=0]="Main",e[e.Settings=1]="Settings",e[e.Archived=2]="Archived",e[e.NewGroup=3]="NewGroup",e[e.NewChannel=4]="NewChannel"}(Ye||(Ye={}));const ze=Object.keys(Ye).length/2,Je=(0,o.X$)((0,n.c$)((e=>{const{globalSearch:{query:t,date:s},chatFolders:{activeChatFolder:n},shouldSkipHistoryAnimations:a}=e;return{searchQuery:t,searchDate:s,activeChatFolder:n,shouldSkipHistoryAnimations:a}}),((e,t)=>(0,g.ei)(t,["setGlobalSearchQuery","setGlobalSearchChatId","resetChatCreation","setGlobalSearchDate","loadPasswordInfo","clearTwoFaError"])))((({searchQuery:e,searchDate:t,activeChatFolder:s,shouldSkipHistoryAnimations:n,setGlobalSearchQuery:a,setGlobalSearchChatId:r,resetChatCreation:i,setGlobalSearchDate:c,loadPasswordInfo:d,clearTwoFaError:l})=>{const[u,g]=(0,o.eJ)(h.du.ChatList),[f,p]=(0,o.eJ)(h.MT.Main),[I,v]=(0,o.eJ)(""),[y,Z]=(0,pe.ZP)(),[P,C]=(0,o.eJ)(0);let w=Ye.Main;switch(u){case h.du.Archived:w=Ye.Archived;break;case h.du.Settings:w=Ye.Settings;break;case h.du.NewChannelStep1:case h.du.NewChannelStep2:w=Ye.NewChannel;break;case h.du.NewGroupStep1:case h.du.NewGroupStep2:w=Ye.NewGroup}const b=(0,o.I4)((e=>{if(u!==h.du.NewGroupStep2||e)if(u!==h.du.NewChannelStep2||e){if(u===h.du.NewGroupStep1){const e=document.getElementById("new-group-picker-search");e&&e.blur()}if(u===h.du.Settings)switch(f){case h.MT.EditProfile:case h.MT.Folders:case h.MT.General:case h.MT.Notifications:case h.MT.Privacy:case h.MT.Language:return void p(h.MT.Main);case h.MT.GeneralChatBackground:return void p(h.MT.General);case h.MT.GeneralChatBackgroundColor:return void p(h.MT.GeneralChatBackground);case h.MT.PrivacyPhoneNumber:case h.MT.PrivacyLastSeen:case h.MT.PrivacyProfilePhoto:case h.MT.PrivacyForwarding:case h.MT.PrivacyGroupChats:case h.MT.PrivacyActiveSessions:case h.MT.PrivacyBlockedUsers:case h.MT.TwoFaDisabled:case h.MT.TwoFaEnabled:case h.MT.TwoFaCongratulations:return void p(h.MT.Privacy);case h.MT.PrivacyPhoneNumberAllowedContacts:case h.MT.PrivacyPhoneNumberDeniedContacts:return void p(h.MT.PrivacyPhoneNumber);case h.MT.PrivacyLastSeenAllowedContacts:case h.MT.PrivacyLastSeenDeniedContacts:return void p(h.MT.PrivacyLastSeen);case h.MT.PrivacyProfilePhotoAllowedContacts:case h.MT.PrivacyProfilePhotoDeniedContacts:return void p(h.MT.PrivacyProfilePhoto);case h.MT.PrivacyForwardingAllowedContacts:case h.MT.PrivacyForwardingDeniedContacts:return void p(h.MT.PrivacyForwarding);case h.MT.PrivacyGroupChatsAllowedContacts:case h.MT.PrivacyGroupChatsDeniedContacts:return void p(h.MT.PrivacyGroupChats);case h.MT.TwoFaNewPassword:return void p(h.MT.TwoFaDisabled);case h.MT.TwoFaNewPasswordConfirm:return void p(h.MT.TwoFaNewPassword);case h.MT.TwoFaNewPasswordHint:return void p(h.MT.TwoFaNewPasswordConfirm);case h.MT.TwoFaNewPasswordEmail:return void p(h.MT.TwoFaNewPasswordHint);case h.MT.TwoFaNewPasswordEmailCode:return void p(h.MT.TwoFaNewPasswordEmail);case h.MT.TwoFaChangePasswordCurrent:case h.MT.TwoFaTurnOff:case h.MT.TwoFaRecoveryEmailCurrentPassword:return void p(h.MT.TwoFaEnabled);case h.MT.TwoFaChangePasswordNew:return void p(h.MT.TwoFaChangePasswordCurrent);case h.MT.TwoFaChangePasswordConfirm:return void p(h.MT.TwoFaChangePasswordNew);case h.MT.TwoFaChangePasswordHint:return void p(h.MT.TwoFaChangePasswordConfirm);case h.MT.TwoFaRecoveryEmail:return void p(h.MT.TwoFaRecoveryEmailCurrentPassword);case h.MT.TwoFaRecoveryEmailCode:return void p(h.MT.TwoFaRecoveryEmail);case h.MT.FoldersCreateFolder:case h.MT.FoldersEditFolder:return void p(h.MT.Folders);case h.MT.FoldersIncludedChatsFromChatList:case h.MT.FoldersExcludedChatsFromChatList:return void p(h.MT.FoldersEditFolderFromChatList);case h.MT.FoldersEditFolderFromChatList:return g(h.du.ChatList),void p(h.MT.Main)}u!==h.du.ChatList||0!==s?(g(h.du.ChatList),v(""),a({query:""}),c({date:void 0}),r({id:void 0}),i(),setTimeout((()=>{C(Date.now())}),250)):g(h.du.GlobalSearch)}else g(h.du.NewChannelStep1);else g(h.du.NewGroupStep1)}),[u,s,f,a,c,r,i]),M=(0,o.I4)((t=>{u!==h.du.Contacts?(g(h.du.GlobalSearch),t!==e&&a({query:t})):v(t)}),[u,e,a]);(0,o.d4)((()=>u!==h.du.ChatList||0===s?(0,fe.Z)((()=>b())):void 0),[s,u,b]),(0,o.d4)((()=>{l(),f===h.MT.Privacy&&d()}),[l,d,f]);const S=e=>{g(h.du.Settings),p(e)};return o.ZP.createElement(Ie.Z,{id:"LeftColumn",name:n?"none":m.s0,renderCount:ze,activeKey:w,shouldCleanup:!0,cleanupExceptionKey:Ye.Main},(s=>{switch(w){case Ye.Archived:return o.ZP.createElement(Xe,{isActive:s,onReset:b,onContentChange:g});case Ye.Settings:return o.ZP.createElement(We,{isActive:s,currentScreen:f,foldersState:y,foldersDispatch:Z,onScreenSelect:S,onReset:b,shouldSkipTransition:n});case Ye.NewChannel:return o.ZP.createElement(Ke,{key:P,isActive:s,isChannel:!0,content:u,onContentChange:g,onReset:b});case Ye.NewGroup:return o.ZP.createElement(Ke,{key:P,isActive:s,content:u,onContentChange:g,onReset:b});default:return o.ZP.createElement(Ve,{content:u,searchQuery:e,searchDate:t,contactsFilter:I,foldersDispatch:Z,onContentChange:g,onSearchQuery:M,onScreenSelect:S,onReset:b,shouldSkipTransition:n})}}))})));var et=s(2420),tt=s(9524),st=s(1394),nt=s(3858);const at=()=>{const[e,t]=(0,o.eJ)(nt.Z.get());return(0,o.d4)((()=>{const e=(0,Z.P2)((()=>{t(nt.Z.get())}),250,!1);return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),e};var ot=s(2678);const rt=728;const it=e=>e.chatId.toString()+("thread"!==e.type?`_${e.type}`:-1!==e.threadId?`_${e.threadId}`:"");var ct=s(3570),dt=s(5790),lt=s(8360),ut=s(2155),ht=s(6058),mt=s(8799);const gt=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"HeaderMenuContainer",!t);return s?o.ZP.createElement(s,e):void 0})),ft=(0,o.X$)((0,n.c$)(((e,{chatId:t,threadId:s,messageListType:n})=>{const a=(0,i.Z1)(e,t),o=Boolean(a&&(0,d.eA)(a));if(null!=a&&a.isRestricted||(0,i.CA)(e))return{noMenu:!0};const r=(0,i.IK)(e,t),c=(0,i.FM)(e,t),l="thread"===n&&s===u._f,h="thread"===n&&s!==u._f,g=(0,i.Jf)(e),f=Boolean(r&&(0,i.s4)(e,r.id)),p=!f&&Boolean((0,i.pk)(e,t)),I=Boolean(l&&a&&(o||(0,d.ZV)(a))&&a.isNotJoined),v=l||h,y=l&&!c&&!I,Z=l&&!I;return{noMenu:!(m.wB&&I||m.wB&&v||y||Z),isChannel:o,isRightColumnShown:g,canStartBot:p,canRestartBot:f,canSubscribe:I,canSearch:v,canMute:y,canLeave:Z}}),((e,t)=>(0,g.ei)(t,["joinChannel","sendBotCommand","openLocalTextSearch","restartBot"])))((({chatId:e,threadId:t,noMenu:s,isChannel:n,canStartBot:a,canRestartBot:r,canSubscribe:i,canSearch:c,canMute:d,canLeave:l,isRightColumnShown:u,joinChannel:h,sendBotCommand:g,openLocalTextSearch:f,restartBot:p})=>{const I=(0,o.sO)(null),[v,y]=(0,o.eJ)(!1),[Z,P]=(0,o.eJ)(void 0),C=(0,o.I4)((()=>{y(!0);const e=I.current.getBoundingClientRect();P({x:e.right,y:e.bottom})}),[]),w=(0,o.I4)((()=>{y(!1)}),[]),b=(0,o.I4)((()=>{P(void 0)}),[]),M=(0,o.I4)((()=>{h({chatId:e})}),[h,e]),S=(0,o.I4)((()=>{g({command:"/start"})}),[g]),E=(0,o.I4)((()=>{p({chatId:e})}),[e,p]),k=(0,o.I4)((()=>{f(),m.wB?document.querySelector("#MobileSearch input").focus():setTimeout((()=>{const e=document.querySelector(".RightHeader .SearchInput input");e&&e.focus()}),400)}),[f]),R=(0,Ze.Z)();return o.ZP.createElement("div",{className:"HeaderActions"},!m.wB&&i&&o.ZP.createElement(be.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:M},R(n?"Subscribe":"Join Group")),!m.wB&&a&&o.ZP.createElement(be.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:S},R("BotStart")),!m.wB&&r&&o.ZP.createElement(be.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:E},R("BotRestart")),!m.wB&&c&&o.ZP.createElement(be.Z,{round:!0,ripple:u,color:"translucent",size:"smaller",onClick:k,ariaLabel:"Search in this chat"},o.ZP.createElement("i",{className:"icon-search"})),(m.wB||!i)&&o.ZP.createElement(be.Z,{ref:I,className:v?"active":"",round:!0,ripple:!m.wB,size:"smaller",color:"translucent",disabled:s,ariaLabel:"More actions",onClick:C},o.ZP.createElement("i",{className:"icon-more"})),Z&&o.ZP.createElement(gt,{chatId:e,threadId:t,isOpen:v,anchor:Z,isChannel:n,canStartBot:a,canRestartBot:r,canSubscribe:i,canSearch:c,canMute:d,canLeave:l,onSubscribeChannel:M,onSearchClick:k,onClose:w,onCloseAnimationEnd:b}))})));var pt=s(4399),It=s(2340),vt=s(6202),yt=s(862);function Zt(e){var t;const s=e&&(0,d.DH)(e),n=null==e||null===(t=e.content)||void 0===t?void 0:t.sticker,r=s&&n&&!(0,m.on)()&&s.includes("image/webp"),[i,c]=(0,o.eJ)(yt.Hu),l=null==e?void 0:e.id;return(0,o.bt)((()=>{r&&(0,yt.p6)(`b64-${l}`,s).then(c).catch((e=>{a.eM&&console.error(e)}))}),[l,r,s]),r?i:s}var Pt=s(7551),Ct=s(8512);function wt(e,t,s,n,a){return`M${e},${t+a}a${a},${a},0,0,1,\n ${s},0v${n-2*a}a${a},${a},0,0,1,${-s},0Z`}const bt=(0,o.X$)((({count:e,index:t})=>{const s=(0,o.sO)(null),n=(0,o.Ye)((()=>function(e,t){const s=e-t-1,n=function(e){let t=8;return 1===e?t=36:2===e?t=17:3===e?t=11:(4===e||e>3)&&(t=7.5),t}(e),a=function(e,t){let s=36;return 1===e?s=36:2===e?s=17:3===e?s=1===t?12:11:(4===e||e>3)&&(s=7.5),s}(e,s),o=function(e,t){return e<=3?36:t*e+2*(e-1)}(e,n),r=`clipPath${e}`;return{markHeight:a,clipPath:function(e,t,s){let n="";if(3===s)n=wt(0,0,2,t,1)+wt(0,12,2,t+1,1)+wt(0,25,2,t,1);else for(let e=0;e\n \n `}(r,n,e),markTranslateY:function(e,t,s){return 1===s?0:2===s?0===e?0:t+2:3===s?0===e?0:1===e?12:25:(t+2)*e}(s,n,e),trackTranslateY:function(e,t,s,n){return t<=4||e<=1?0:e>=t-2?n-36:(s+4)/2+(e-2)*(s+2)}(s,e,n,o),trackHeight:o,clipPathId:r}}(e,t)),[e,t]);if((0,o.d4)((()=>{if(!s.current)return;const{trackHeight:e,trackTranslateY:t,markHeight:a,markTranslateY:o,clipPathId:r,clipPath:i}=n,c=s.current.firstElementChild;if(null!=s&&s.current){const n=s.current,{style:d}=n;d.height=`${e}px`,d.transform=`translateY(-${t}px)`,d.clipPath=`url("#${r}")`;const l=n.querySelector("svg"),u=n.querySelector("div"),h=n.querySelector("defs");l||c&&(c.innerHTML=` ${i} `),h&&(h.innerHTML=i),u&&(u.style.height=`${a}px`,u.style.transform=`translateY(${o}px)`)}}),[n]),1===e)return o.ZP.createElement("div",{className:"pinned-message-border"},o.ZP.createElement("div",{className:"pinned-message-border-wrapper-1",ref:s}));const{trackHeight:a,trackTranslateY:r,markHeight:i,markTranslateY:c,clipPathId:d}=n;return o.ZP.createElement("div",{className:(0,ie.Z)("pinned-message-border",e>4&&"pinned-message-border-mask")},o.ZP.createElement("div",{className:"pinned-message-border-wrapper",ref:s,style:`clip-path: url("#${d}"); width: 2px;\n height: ${a}px; transform: translateY(-${r}px);`},o.ZP.createElement("span",null),o.ZP.createElement("div",{className:"pinned-message-border-mark",style:`height: ${i}px; transform: translateY(${c}px);`})))})),Mt=(0,o.X$)((({message:e,count:t,index:s,customTitle:n,className:a,onUnpinMessage:r,onClick:i,onAllPinnedClick:c})=>{const l=(0,Ze.Z)(),u=Zt(e),h=(0,vt.Z)((0,d.Ti)(e,"pictogram")),m=(0,d.MK)(l,e,Boolean(u)),[g,f,p]=(0,ye.Z)(),I=(0,o.I4)((()=>{p(),r&&r(e.id)}),[p,r,e.id]);return o.ZP.createElement("div",{className:(0,ie.Z)("HeaderPinnedMessage-wrapper",a)},t>1&&o.ZP.createElement(be.Z,{round:!0,size:"smaller",color:"translucent",className:"pin-list-button",ariaLabel:l("EventLogFilterPinnedMessages"),onClick:c},o.ZP.createElement("i",{className:"icon-pin-list"})),r&&o.ZP.createElement(be.Z,{round:!0,size:"smaller",color:"translucent",ariaLabel:l("UnpinMessageAlertTitle"),className:"unpin-button",onClick:f},o.ZP.createElement("i",{className:"icon-close"})),o.ZP.createElement(Pt.Z,{isOpen:g,onClose:p,text:"Would you like to unpin this message?",confirmLabel:"Unpin",confirmHandler:I}),o.ZP.createElement("div",{className:"HeaderPinnedMessage",onClick:i,dir:l.isRtl?"rtl":void 0},o.ZP.createElement(bt,{count:t,index:s}),u&&function(e,t){const{width:s,height:n}=(0,pt.W7)();return o.ZP.createElement("img",{src:t||e,width:s,height:n,alt:""})}(u,h),o.ZP.createElement("div",{className:"message-text"},o.ZP.createElement("div",{className:"title",dir:"auto"},n||`${l("PinnedMessage")} ${s>0?"#"+(t-s):""}`),o.ZP.createElement("p",{dir:"auto"},(0,It.Z)(m))),o.ZP.createElement(Ct.Z,null)))}));var St=s(647),Et=s(3186);const kt=(0,n.c$)(((e,{message:t})=>({sender:(0,i.Ur)(e,t)})),((e,t)=>(0,g.ei)(t,["focusMessage","closeAudioPlayer"])))((({message:e,className:t,noUi:s,sender:n,focusMessage:a,closeAudioPlayer:r})=>{const i=(0,Ze.Z)(),c=n?(0,d.OU)(i,n):void 0,l=St.UV((0,d.Ti)(e,"inline")),{playPause:u,isPlaying:h}=(0,Et.Z)((0,d.Tp)(e),(0,d.XV)(e),l,void 0,void 0,!0),g=(0,o.I4)((()=>{a({chatId:e.chatId,messageId:e.id})}),[a,e.chatId,e.id]),f=(0,o.I4)((()=>{h&&u(),r()}),[r,h,u]);if(s)return;const p=(0,d.oP)(e);return o.ZP.createElement("div",{className:(0,ie.Z)("AudioPlayer",t),dir:i.isRtl?"rtl":void 0},o.ZP.createElement(be.Z,{round:!0,ripple:!m.wB,color:"translucent",size:"smaller",className:(0,ie.Z)("toggle-play",h?"pause":"play"),onClick:u,ariaLabel:h?"Pause audio":"Play audio"},o.ZP.createElement("i",{className:"icon-play"}),o.ZP.createElement("i",{className:"icon-pause"})),o.ZP.createElement("div",{className:"AudioPlayer-content",onClick:g},p?function(e){const{title:t,performer:s,fileName:n}=e;return o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("div",{className:"title",dir:"auto"},(0,It.Z)(t||n)),s&&o.ZP.createElement("div",{className:"subtitle",dir:"auto"},(0,It.Z)(s)))}(p):function(e,t){return o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("div",{className:"title",dir:"auto"},t&&(0,It.Z)(t)),o.ZP.createElement("div",{className:"subtitle",dir:"auto"},e))}(i("AttachAudio"),c),o.ZP.createElement(Ct.Z,null)),o.ZP.createElement(be.Z,{round:!0,className:"player-close",color:"translucent",size:"smaller",onClick:f,ariaLabel:"Close player"},o.ZP.createElement("i",{className:"icon-close"})))})),Rt=(0,o.X$)((0,n.c$)(((e,{chatId:t,threadId:s,messageListType:n})=>{const{isLeftColumnShown:a,lastSyncTime:o,shouldSkipHistoryAnimations:r}=e,{byId:c}=e.chats,d=(0,i.Z1)(e,t),{typingStatus:l}=d||{},{chatId:h,messageId:m}=e.audioPlayer,g=h&&m?(0,i.hj)(e,h,m):void 0;let f;if("pinned"===n){const s=(0,i.KB)(e,t);f=null==s?void 0:s.length}else if("scheduled"===n){const s=(0,i.qy)(e,t);f=null==s?void 0:s.length}else if("thread"===n&&s!==u._f){const n=(0,i.tZ)(e,t,s);n&&(f=n.messagesCount)}const p={typingStatus:l,isLeftColumnShown:a,isRightColumnShown:(0,i.Jf)(e),isSelectModeActive:(0,i.CA)(e),audioMessage:g,chat:d,chatsById:c,messagesCount:f,isChatWithSelf:(0,i.FM)(e,t),isChatWithBot:d&&(0,i.xo)(e,d),lastSyncTime:o,shouldSkipHistoryAnimations:r,currentTransitionKey:Math.max(0,e.messages.messageLists.length-1),connectionState:e.connectionState},I=(0,i.Zw)(e,t);if("thread"!==n||!I)return p;if(Object.assign(p,{messagesById:I}),s!==u._f){const n=(0,i.qS)(e,t,s),a=n?(0,i.hj)(e,t,n):void 0,o=a?(0,i.cv)(e,a):void 0;return{...p,pinnedMessageIds:n,canUnpin:!1,topMessageSender:o}}const v=(0,i.KB)(e,t);if(null!=v&&v.length){const t=I[v[0]],{canUnpin:n}=t&&(0,i._k)(e,t,s)||{};return{...p,pinnedMessageIds:v,canUnpin:n}}return p}),((e,t)=>(0,g.ei)(t,["openChatWithInfo","pinMessage","focusMessage","openChat","openPreviousChat","loadPinnedMessages","toggleLeftColumn","exitMessageSelectMode"])))((({chatId:e,threadId:t,messageListType:s,isReady:r,pinnedMessageIds:c,messagesById:l,canUnpin:h,topMessageSender:g,typingStatus:f,isSelectModeActive:p,isLeftColumnShown:I,isRightColumnShown:v,audioMessage:y,chat:Z,chatsById:P,messagesCount:C,isChatWithSelf:w,isChatWithBot:b,lastSyncTime:M,shouldSkipHistoryAnimations:S,currentTransitionKey:E,connectionState:k,openChatWithInfo:R,pinMessage:T,focusMessage:N,openChat:B,openPreviousChat:x,loadPinnedMessages:A,toggleLeftColumn:L,exitMessageSelectMode:O})=>{const F=(0,Ze.Z)(),[U,$]=(0,o.eJ)(0),Q=Array.isArray(c)?c[U]:c,D=l&&Q?l[Q]:void 0,q=Array.isArray(c)?c.length:c?1:0,G=Z&&(0,d.U)(F,Z).length,H=g?(0,d.OU)(F,g):void 0;(0,o.d4)((()=>{t===u._f&&M&&r&&A({chatId:e})}),[e,A,M,t,r]),(0,o.d4)((()=>{$(0)}),[c]),(0,dt.Z)(e,Q,D);const{width:j}=at(),_=j<=a.ks,V=m.p7&&I,W=(0,o.sO)(null),K=(0,o.sO)(!0),X=(0,o.I4)((()=>{R({id:e})}),[R,e]),Y=(0,o.I4)((t=>{T({chatId:e,messageId:t,isUnpin:!0})}),[T,e]),z=(0,o.I4)((()=>{if(D){N({chatId:D.chatId,threadId:t,messageId:D.id});const e=(0,ct.Z)(q,U+1);$(e)}}),[D,N,t,q,U]),J=(0,o.I4)((()=>{B({id:e,threadId:u._f,type:"pinned"})}),[B,e]),ee=(0,o.I4)((e=>{if(m.wB){const e=document.getElementById(a.R2);e&&e.blur()}p?O():t!==u._f||"thread"!==s||0!==E?x():m.wB||V?(e.stopPropagation(),B({id:void 0})):L()}),[t,s,E,p,x,V,B,L,O]),te=(0,o.Ye)((()=>{if(_&&P)return(0,i.A1)((0,n.Rd)())||void 0}),[_,P]),se=j>=a.ks&&ja.l3&&j30),ne=se||j>a._m&&j{const e=W.current;if(e)return ne&&me?void(v||se?(K.current&&(e.classList.add("tools-stacked","animated"),K.current=!1),setTimeout((()=>{e.classList.remove("animated")}),350)):(e.classList.remove("tools-stacked"),K.current=!0)):(e.classList.remove("tools-stacked","animated"),void(K.current=!0))}),[ne,me,se,v]);const ge=(!ve()||"connectionStateConnecting"===k)&&(m.wB||m.p7&&!V);function fe(){return ge?o.ZP.createElement(o.ZP.Fragment,null,pe(),o.ZP.createElement("h3",null,F("WaitingForNetwork"))):"thread"===s&&t===u._f?o.ZP.createElement(o.ZP.Fragment,null,(_||E>0)&&pe(V,!0),o.ZP.createElement("div",{className:"chat-info-wrapper",onClick:X},(0,d.YA)(e)?o.ZP.createElement(ht.Z,{userId:e,typingStatus:f,withFullInfo:b,withMediaViewer:!0,withUpdatingStatus:!0,noRtl:!0}):o.ZP.createElement(mt.Z,{chatId:e,typingStatus:f,noRtl:!0,withMediaViewer:!0,withFullInfo:!0,withUpdatingStatus:!0}))):"thread"===s?o.ZP.createElement(o.ZP.Fragment,null,pe(),o.ZP.createElement("h3",null,F("CommentsCount",C))):"pinned"===s?o.ZP.createElement(o.ZP.Fragment,null,pe(),o.ZP.createElement("h3",null,F("PinnedMessagesCount",C))):"scheduled"===s?o.ZP.createElement(o.ZP.Fragment,null,pe(),o.ZP.createElement("h3",null,w?F("Reminders"):F("messages",C,"i"))):void 0}function pe(e=!1,t=!1){return o.ZP.createElement("div",{className:"back-button"},o.ZP.createElement(be.Z,{round:!0,size:"smaller",color:"translucent",onClick:ee,ariaLabel:e?"Close":"Back"},o.ZP.createElement("div",{className:(0,ie.Z)("animated-close-icon",!e&&"state-back")})),t&&te&&o.ZP.createElement("div",{className:"unread-count active"},(0,ut.bi)(te)))}return o.ZP.createElement("div",{className:"MiddleHeader",ref:W},o.ZP.createElement(Ie.Z,{name:S?"none":"slide-fade",activeKey:ge?1/0:E},fe),o.ZP.createElement("div",{className:"header-tools"},ce&&ue&&!ae&&o.ZP.createElement(Mt,{key:e,message:ue,count:q,index:U,customTitle:he,className:le,onUnpinMessage:h?Y:void 0,onClick:z,onAllPinnedClick:J}),ae&&re&&o.ZP.createElement(kt,{key:(0,d.Tp)(re),message:re,className:oe}),o.ZP.createElement(ft,{chatId:e,threadId:t,messageListType:s})))})));var Tt=s(2645),Nt=s(274);function Bt(e){return"albumId"in e}function xt(e,t){let s,n=[],a={originalDate:e[0].date,datetime:Number((0,L.$Y)(1e3*e[0].date)),senderGroups:[n]};const o=[a];return e.forEach(((r,i)=>{r.isInAlbum?s?(s.messages.push(r),r.content.text&&(s.mainMessage=r)):s={albumId:r.groupedId,messages:[r],mainMessage:r}:n.push(r);const c=e[i+1];if(!s||c&&c.groupedId&&c.groupedId===s.albumId||(n.push(s),s=void 0),c){const e=Number((0,L.$Y)(1e3*c.date));a.datetime!==e?(a={originalDate:c.date,datetime:e,senderGroups:[]},o.push(a),n=[],a.senderGroups.push(n)):(c.id===t||r.senderId!==c.senderId||r.isOutgoing!==c.isOutgoing||(0,d.Lo)(r)||(0,d.Lo)(c)||r.forwardInfo&&c.forwardInfo&&(r.forwardInfo.senderUserId!==c.forwardInfo.senderUserId||r.forwardInfo.fromChatId!==c.forwardInfo.fromChatId||r.forwardInfo.hiddenUserName!==c.forwardInfo.hiddenUserName)||r.inlineButtons||c.inlineButtons||c.date-r.date>600)&&(n=[],a.senderGroups.push(n))}})),o}var At=s(386);var Lt=s(7675),Ot=s(539),Ft=s(3657);const Ut=m.wZ?1e3:350,$t=m.wB?300:500;var Qt=s(7240),Dt=s(935);function qt(e){return"number"==typeof e}function Gt(e,t){return e?t?238:175:t?238:100}function Ht(e,t){const s=(0,d.B4)(e),n=(0,d.MF)(e),a=(0,d.O$)(e)||(0,d.F$)(e),o=(0,d.b7)(e),r=Boolean((0,d.F$)(e)),{width:i,height:c}=a?(0,pt.Eh)(a,s,n,r,t):(0,pt.GC)(o,s,n,t),l=Gt(Boolean((0,d.UD)(e)));let u=1;ie+t),t)}function _t(e,t,s){return es?s:e}function Vt(e){const t={width:0,height:0};return e.forEach((({dimensions:e,sides:s})=>{2&s&&(t.width=e.width+e.x),4&s&&(t.height=e.height+e.y)})),t}function Wt(e,t,s,n){const a=n.messages.map((e=>{const t=Ht(e);return t.width/t.height})),o=function(e){return e.map((e=>e>1.2?"w":e<.8?"n":"q")).join("")}(a),r=function(e){return e.reduce(((e,t)=>t+e),1)/e.length}(a),i=a.length,c=a.some((e=>e>2)),d=(0,pt.kc)(e,t,!1,s)-(t?2.5:0)*pt.Gw;let l;const u={ratios:a,proportions:o,averageRatio:r,maxWidth:d,minWidth:100,maxHeight:d,spacing:2};return l=i>=5||c?function({ratios:e,averageRatio:t,maxWidth:s,minWidth:n,spacing:a,maxHeight:o=4*s/3}){const r=function(e,t){return e.map((e=>t>1.1?_t(e,1,2.75):_t(e,.6667,1)))}(e,t),i=e.length,c=new Array(i),d=[],l=e=>{const t=[];let n=0;e.forEach((e=>{t.push(((e,t)=>{const n=jt(r.slice(e,e+t),0);return(s-(t-1)*a)/n})(n,e)),n+=e})),d.push({lineCounts:e,heights:t})};for(let e=1;e!==i;++e){const t=i-e;e<=3&&t<=3&&l([e,t])}for(let e=1;e!==i-1;++e)for(let s=1;s!==i-e;++s){const n=i-e-s;e<=3&&s<=(t<.85?4:3)&&n<=3&&l([e,s,n])}for(let e=1;e!==i-1;++e)for(let t=1;t!==i-e;++t)for(let s=1;s!==i-e-t;++s){const n=i-e-t-s;e<=3&&t<=3&&s<=3&&n<=4&&l([e,t,s,n])}let u,h=0;for(let e=0;e{for(let e=1;e!==r;++e)if(s[e-1]>s[e])return 1.5;return 1})(),m=Math.abs(i-o)*c*l;(!u||m1.4&&t[1]-t[0]<.2?function(e){const{ratios:t,maxWidth:s,spacing:n,maxHeight:a}=e,o=Math.round(Math.min(s/t[0],Math.min(s/t[1],(a-n)/2)));return[{dimensions:{x:0,y:0,width:s,height:o},sides:11},{dimensions:{x:0,y:o+n,width:s,height:o},sides:14}]}(e):"ww"===s||"qq"===s?function(e){const{ratios:t,maxWidth:s,spacing:n,maxHeight:a}=e,o=(s-n)/2,r=Math.round(Math.min(o/t[0],Math.min(o/t[1],a)));return[{dimensions:{x:0,y:0,width:o,height:r},sides:13},{dimensions:{x:o+n,y:0,width:o,height:r},sides:7}]}(e):function(e){const{ratios:t,minWidth:s,maxWidth:n,spacing:a,maxHeight:o}=e,r=Math.round(1.5*s),i=Math.min(Math.round(Math.max(.4*(n-a),(n-a)/t[0]/(1/t[0]+1/t[1]))),n-a-r),c=n-i-a,d=Math.min(o,Math.round(Math.min(c/t[0],i/t[1])));return[{dimensions:{x:0,y:0,width:c,height:d},sides:13},{dimensions:{x:c+a,y:0,width:i,height:d},sides:7}]}(e)}(u):3===i?function(e){const{proportions:t}=e;return"n"===t[0]?function(e){const{maxHeight:t,spacing:s,ratios:n,maxWidth:a,minWidth:o}=e,r=t,i=Math.round(Math.min((t-s)/2,n[1]*(a-s)/(n[2]+n[1]))),c=r-i-s,d=Math.max(o,Math.round(Math.min((a-s)/2,Math.min(i*n[2],c*n[1])))),l=Math.min(Math.round(r*n[0]),a-s-d);return[{dimensions:{x:0,y:0,width:l,height:r},sides:13},{dimensions:{x:l+s,y:0,width:d,height:c},sides:3},{dimensions:{x:l+s,y:c+s,width:d,height:i},sides:6}]}(e):function(e){const{maxWidth:t,ratios:s,maxHeight:n,spacing:a}=e,o=t,r=Math.round(Math.min(o/s[0],.66*(n-a))),i=(t-a)/2,c=Math.min(n-r-a,Math.round(Math.min(i/s[1],i/s[2])));return[{dimensions:{x:0,y:0,width:o,height:r},sides:11},{dimensions:{x:0,y:r+a,width:i,height:c},sides:12},{dimensions:{x:i+a,y:r+a,width:o-i-a,height:c},sides:6}]}(e)}(u):function(e){const{proportions:t}=e;return"w"===t[0]?function({maxWidth:e,ratios:t,spacing:s,maxHeight:n,minWidth:a}){const o=e,r=Math.round(Math.min(o/t[0],.66*(n-s))),i=Math.round((e-2*s)/(t[1]+t[2]+t[3])),c=Math.max(a,Math.round(Math.min(.4*(e-2*s),i*t[1]))),d=Math.round(Math.max(Math.max(a,.33*(e-2*s)),i*t[3])),l=o-c-d-2*s,u=Math.min(n-r-s,i);return[{dimensions:{x:0,y:0,width:o,height:r},sides:11},{dimensions:{x:0,y:r+s,width:c,height:u},sides:12},{dimensions:{x:c+s,y:r+s,width:l,height:u},sides:4},{dimensions:{x:c+s+l+s,y:r+s,width:d,height:u},sides:6}]}(e):function({maxHeight:e,ratios:t,maxWidth:s,spacing:n,minWidth:a}){const o=e,r=Math.round(Math.min(o*t[0],.6*(s-n))),i=Math.round((e-2*n)/(1/t[1]+1/t[2]+1/t[3])),c=Math.round(i/t[1]),d=Math.round(i/t[2]),l=o-c-d-2*n,u=Math.max(a,Math.min(s-r-n,i));return[{dimensions:{x:0,y:0,width:r,height:o},sides:13},{dimensions:{x:r+n,y:0,width:u,height:c},sides:3},{dimensions:{x:r+n,y:c+n,width:u,height:d},sides:2},{dimensions:{x:r+n,y:c+d+2*n,width:u,height:l},sides:6}]}(e)}(u),{layout:l,containerStyle:Vt(l)}}let Kt;function Xt(e){return Kt||(Kt=document.createElement("span"),Kt.style.font=m.cj?'400 12px system-ui, -apple-system, BlinkMacSystemFont, "Roboto", "Apple Color Emoji", "Helvetica Neue", sans-serif':'400 12px "Roboto", -apple-system, "Apple Color Emoji", BlinkMacSystemFont, "Helvetica Neue", sans-serif',Kt.style.whiteSpace="nowrap",Kt.style.position="absolute",Kt.style.left="-999px",Kt.style.opacity=".01",document.body.appendChild(Kt)),Kt.innerHTML=e,Kt.offsetWidth}function Yt(e,t,s,n,a,r){(0,o.bt)((()=>{if(s&&e.current){const t=e.current.closest(".MessageList");(0,Ot.Z)(t,e.current,a?"end":"centerOrTop",20,void 0!==n?1e3:void 0,n,void 0,r)}}),[e,t,s,n,a,r])}var zt=s(172),Jt=s(2864);const es=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"ContextMenuContainer",!t);return s?o.ZP.createElement(s,e):void 0})),ts=(0,o.X$)((0,n.c$)(((e,{message:t})=>{const{byId:s}=e.users,n=t.senderId,{targetUserIds:a,targetChatId:o}=t.content.action||{},r=t.replyToMessageId,c=r?(0,i.hj)(e,t.chatId,r):void 0,l=(0,i._X)(e,t),{direction:u,noHighlight:h}=l&&e.focusedMessage||{},m=(0,i.Z1)(e,t.chatId);return{usersById:s,sender:m&&((0,d.eA)(m)||n===t.chatId)?m:n?(0,i.dy)(e,n):void 0,targetChatId:o,targetUserIds:a,targetMessage:c,isFocused:l,...l&&{focusDirection:u,noFocusHighlight:h}}}))((({message:e,observeIntersection:t,isEmbedded:s,appearanceOrder:n=0,isLastInList:a,usersById:r,sender:i,targetUserIds:c,targetMessage:d,targetChatId:l,isFocused:u,focusDirection:h,noFocusHighlight:m})=>{const g=(0,o.sO)(null);(0,Ft._N)(g,t),(0,dt.Z)(e.chatId,e.replyToMessageId,d),Yt(g,e.chatId,u,h,m);const f=(0,Ze.Z)(),p=n<=0,[I,v]=(0,ye.Z)(p);(0,o.d4)((()=>{p||setTimeout(v,10*n)}),[n,v,p]);const{transitionClassNames:y}=(0,de.Z)(I,void 0,p,!1),Z=(0,o.Ye)((()=>c?c.map((e=>null==r?void 0:r[e])).filter(Boolean):void 0),[c,r]),P=(0,Jt.D)(f,e,i,Z,d,l,s?{isEmbedded:!0,asPlain:!0}:void 0),{isContextMenuOpen:C,contextMenuPosition:w,handleBeforeContextMenu:b,handleContextMenu:M,handleContextMenuClose:S,handleContextMenuHide:E}=(0,Qt.Z)(g),k=void 0!==w;if(s)return o.ZP.createElement("span",{className:"embedded-action-message"},(0,It.Z)(P));const R=(0,ie.Z)("ActionMessage message-list-item",u&&!m&&"focused",k&&"has-menu-open",a&&"last-in-list",y);return o.ZP.createElement("div",{ref:g,id:`message${e.id}`,className:R,"data-message-id":e.id,onMouseDown:e=>{(0,At.q)(e),b(e)},onContextMenu:M},o.ZP.createElement("span",null,P),w&&o.ZP.createElement(es,{isOpen:C,anchor:w,message:e,messageListType:"thread",onClose:S,onCloseAnimationEnd:E}))}))),ss=({className:e,message:t,sender:s,title:n,customText:a,observeIntersection:r,onClick:i})=>{const c=(0,o.sO)(null),l=(0,Ft.Op)(c,r),u=(0,vt.Z)(t&&(0,d.Ti)(t,"pictogram"),!l),h=t&&`sticker-reply-thumb${t.id}`,m=Zt(t),g=Boolean(t&&(0,d.Y5)(t)),f=(0,Ze.Z)(),p=s&&(0,d.OU)(f,s);return o.ZP.createElement("div",{ref:c,className:(0,ie.Z)("EmbeddedMessage",e),onClick:t?i:void 0},m&&function(e,t,s,n){const{width:a,height:r}=(0,pt.W7)();return o.ZP.createElement("img",{id:e,src:s||t,width:a,height:r,alt:"",className:n?"round":""})}(h,m,u,g),o.ZP.createElement("div",{className:"message-text"},o.ZP.createElement("p",{dir:"auto"},t?(0,d.Lo)(t)?o.ZP.createElement(ts,{message:t,isEmbedded:!0}):(0,It.Z)((0,d.MK)(f,t,Boolean(m))):a||" "),o.ZP.createElement("div",{className:"message-title",dir:"auto"},(0,It.Z)(p||n||" "))))};var ns=s(2535),as=s(4752),os=s(8018);const rs=(0,o.X$)((({message:e,outgoingStatus:t,signature:s,onClick:n})=>{const a=(0,Ze.Z)();return o.ZP.createElement("span",{className:"MessageMeta",dir:a.isRtl?"rtl":"ltr",onClick:n},Boolean(e.views)&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("span",{className:"message-views"},(0,ut.bi)(e.views)),o.ZP.createElement("i",{className:"icon-channelviews"})),s&&o.ZP.createElement("span",{className:"message-signature"},(0,It.Z)(s)),o.ZP.createElement("span",{className:"message-time"},e.isEdited&&`${a("EditedMessage")} `,(0,L.mr)(1e3*e.date)),t&&o.ZP.createElement(os.Z,{status:t}))}));var is=s(8835),cs=s(7799),ds=s(4851);const ls=({message:e,observeIntersection:t,observeIntersectionForPlaying:s,shouldLoop:n,lastSyncTime:r})=>{const i=(0,o.sO)(null),[c,l,u]=(0,ye.Z)(),h=e.content.sticker,{isAnimated:m,stickerSetId:g}=h,f=g===a.n,p=(0,Ft.Op)(i,t),I=(0,Ft.Op)(i,s),v=h.isPreloadedGlobally?`sticker${h.id}`:(0,d.Ti)(e,"inline"),y=Zt(e),Z=(0,vt.Z)(v,!p,(0,d.kG)(e,"inline",!0),r),P=Boolean(Z),[C,w]=(0,ye.Z)(P),b=m?C:P,{shouldRenderFullMedia:M,transitionClassNames:S}=(0,is.Z)(b,"slow"),{width:E,height:k}=(0,pt.Wr)(h),R=(0,ie.Z)("thumbnail",!y&&"empty"),T=(0,ie.Z)("Sticker media-inner",f&&"inactive");return o.ZP.createElement("div",{ref:i,className:T,onClick:f?void 0:l},!b&&o.ZP.createElement("img",{id:`sticker-thumb-${e.id}`,src:y,width:E,height:k,alt:"",className:R}),!m&&M&&o.ZP.createElement("img",{id:`sticker-${e.id}`,src:Z,width:E,height:k,alt:"",className:(0,ie.Z)("full-media",S)}),m&&P&&o.ZP.createElement(cs.Z,{key:v,className:(0,ie.Z)("full-media",S),id:v,animationData:Z,size:E,play:I,noLoop:!n,onLoad:w}),o.ZP.createElement(ds.Z,{isOpen:c,fromSticker:h,onClose:u}))};var us=s(7854),hs=s(2761),ms=s(5866);function gs(e,t){return(0,ms.Z)((0,d.DH)(e),Boolean(t),m.wB&&!m.vX)}var fs=s(7204);const ps=Promise.resolve("rgba(255,255,255,1)");var Is=s(9196);const vs=({id:e,message:t,observeIntersection:s,noAvatars:n,shouldAutoLoad:a,isInSelectMode:r,isSelected:i,uploadProgress:c,size:l="inline",dimensions:u,nonInteractive:h,shouldAffectAppendix:m,onClick:g,onCancelUpload:f})=>{const p=(0,o.sO)(null),I=((0,d.O$)(t)||(0,d.F$)(t)).blobUrl,v=(0,Ft.Op)(p,s),[y,Z]=(0,o.eJ)(a),P=y&&v,{mediaData:C,downloadProgress:w}=(0,hs.Z)((0,d.Ti)(t,l),!P),b=I||C,M=gs(t,b),{isUploading:S,isTransferring:E,transferProgress:k}=(0,d.Sc)(t,c||w,P&&!b),R=!1===(0,fs.Z)(y),{shouldRender:T,transitionClassNames:N}=(0,de.Z)(E,void 0,R,"slow"),{shouldRenderThumb:B,shouldRenderFullMedia:x,transitionClassNames:A}=(0,is.Z)(b,"slow"),L=(0,o.I4)((()=>{S?f&&f(t):b?g&&g(t.id):Z((e=>!e))}),[b,S,t,f,g]),O=(0,d.B4)(t);(0,o.bt)((()=>{if(!m)return;const e=p.current.closest(".message-content");b?function(e,t,s,n){return n?ps:async function(e,t){const s=new Image;s.src=e,s.width||await new Promise((e=>{s.onload=e}));const n=document.createElement("canvas"),a=n.getContext("2d");n.width=s.width,n.height=s.height,a.drawImage(s,0,0,s.width,s.height);const o=t?s.width-1:0,r=s.height-1;return`rgba(${Array.from(a.getImageData(o,r,1,1).data).join(",")})`}(e,t)}(b,O,0,i).then((t=>{e.style.setProperty("--appendix-bg",t),e.setAttribute("data-has-custom-appendix","")})):e.classList.add("has-appendix-thumb")}),[b,O,m,r,i]);const{width:F,height:U,isSmall:$}=u||Ht(t,n),Q=(0,ie.Z)("media-inner",!S&&!h&&"interactive",$&&"small-image",F===U&&"square-image"),D=u?`width: ${F}px; height: ${U}px; left: ${u.x}px; top: ${u.y}px;`:"";return o.ZP.createElement("div",{id:e,ref:p,className:Q,style:D,onClick:S?void 0:L},B&&o.ZP.createElement("canvas",{ref:M,className:"thumbnail",style:`width: ${F}px; height: ${U}px`}),x&&o.ZP.createElement("img",{src:b,className:`full-media ${A}`,width:F,height:U,alt:""}),T&&o.ZP.createElement("div",{className:`media-loading ${N}`},o.ZP.createElement(Is.Z,{progress:k,onClick:S?L:void 0})),!b&&!y&&o.ZP.createElement("i",{className:"icon-download"}),E&&o.ZP.createElement("span",{className:"message-upload-progress"},Math.round(100*k),"%"))};var ys=s(2019),Zs=s(4753);function Ps(e,t){const s=(0,o.sO)();s.current=t;const n=(0,o.I4)((()=>{e.current&&e.current.pause()}),[e]),a=(0,o.I4)((()=>{e.current&&s.current&&(0,Zs.Z)(e.current)}),[e]);(0,re.ZP)(n,a)}var Cs=s(6898);const ws=(e,t=!1)=>{const s=(0,o.sO)(!1),n=(0,o.sO)(!1),a=(0,o.I4)((()=>{n.current=!0,t&&e.current&&(s.current||(s.current=!e.current.paused),e.current.pause())}),[t,e]),r=(0,o.I4)((()=>{t&&e.current&&s.current&&document.body.contains(e.current)&&(0,Zs.Z)(e.current),s.current=!1,n.current=!1}),[t,e]),i=(0,o.I4)((()=>{(0,Z.T2)(r)}),[r]);document.hasFocus()||a(),(0,le.Z)(a,i)};function bs(){return(bs=Object.assign||function(e){for(var t=1;t{var m;const g=(0,o.sO)(null),f=(0,o.sO)(null),p=(0,d.b7)(t)||(0,d.Cg)(t),I=p.blobUrl,v=(0,Ft.Op)(g,s),[y,Z]=(0,o.eJ)(a),P=Boolean(y&&v&&c),[C,w]=(0,o.eJ)(r),b=(0,vt.Z)((0,d.Ti)(t,"pictogram"),!(v&&c),(0,d.kG)(t,"pictogram"),c),{mediaData:M,downloadProgress:S}=(0,hs.Z)((0,d.Ti)(t,"inline"),!P,(0,d.kG)(t,"inline"),c),E=I||M,k=Boolean(v&&E),R=gs(t,b),{isBuffered:T,bufferingHandlers:N}=(0,ys.Z)(!a),{isUploading:B,isTransferring:x,transferProgress:A}=(0,d.Sc)(t,i||S,P&&!T),O=!1===(0,fs.Z)(y),{shouldRender:F,transitionClassNames:U}=(0,de.Z)(x,void 0,O),{transitionClassNames:$}=(0,is.Z)(E,"slow"),[Q,D]=(0,o.eJ)(0),q=(0,o.I4)((e=>{D(Math.max(0,e.currentTarget.currentTime-1))}),[]),G=(null===(m=f.current)||void 0===m?void 0:m.duration)||p.duration||0,H=(0,d.B4)(t),j=(0,d.MF)(t),{width:_,height:V}=l||(0,pt.GC)(p,H,j,n);Ps(f,Boolean(k&&r)),ws(f,C),(0,Cs.Z)(f,[k]);const W=(0,o.I4)((()=>{B?h&&h(t):E?E&&!C?(w(!0),f.current.play()):u&&u(t.id):Z((e=>!e))}),[B,E,C,u,h,t]),K=(0,ie.Z)("media-inner dark",!B&&"interactive"),X=(0,ie.Z)("full-media",$),Y=l?`width: ${_}px; height: ${V}px; left: ${l.x}px; top: ${l.y}px;`:"";return o.ZP.createElement("div",{ref:g,id:e,className:K,style:Y,onClick:B?void 0:W},!b&&o.ZP.createElement("canvas",{ref:R,className:"thumbnail",style:`width: ${_}px; height: ${V}px;`}),b&&o.ZP.createElement("img",{src:b,className:"thumbnail",style:`width: ${_}px; height: ${V}px;`,alt:""}),k&&o.ZP.createElement("video",bs({ref:f,className:X,width:_,height:V,autoPlay:C,muted:!0,loop:!0,playsInline:!0},N,{onTimeUpdate:q}),o.ZP.createElement("source",{src:E})),y&&!C&&!F&&o.ZP.createElement("i",{className:"icon-large-play"}),F&&o.ZP.createElement("div",{className:`media-loading ${U}`},o.ZP.createElement(Is.Z,{progress:A,onClick:B?W:void 0})),!y&&o.ZP.createElement("i",{className:"icon-download"}),x?o.ZP.createElement("span",{className:"message-upload-progress"},"..."):o.ZP.createElement("div",{className:"message-media-duration"},p.isGif?"GIF":(0,L.k9)(Math.max(G-Q,0))))};var Ss=s(2969);const Es=(0,n.c$)(((e,{contact:t})=>({user:(0,i.dy)(e,t.userId)})),((e,t)=>(0,g.ei)(t,["openUserInfo"])))((({contact:e,user:t,openUserInfo:s})=>{const{firstName:n,lastName:a,phoneNumber:r,userId:i}=e,c=(0,o.I4)((()=>{s({id:i})}),[s,i]);return o.ZP.createElement("div",{className:(0,ie.Z)("Contact",Boolean(i)&&"interactive"),onClick:i?c:void 0},o.ZP.createElement(zt.Z,{size:"large",user:t,text:n||a}),o.ZP.createElement("div",{className:"contact-info"},o.ZP.createElement("div",{className:"contact-name"},n," ",a),o.ZP.createElement("div",{className:"contact-phone"},(0,Ss.WZ)(r))))}));var ks=s(4605);const Rs=(0,o.X$)((({id:e,options:t,selected:s=[],disabled:n,round:a,loadingOptions:r,onChange:i})=>{const[c,d]=(0,o.eJ)([]),l=(0,o.I4)((e=>{const{value:t,checked:s}=e.currentTarget;let n;n=s?[...c,t]:c.filter((e=>e!==t)),d(n),i(n)}),[i,c]);return o.ZP.createElement("div",{id:e,className:"radio-group"},t.map((e=>o.ZP.createElement(ks.Z,{label:e.label,subLabel:e.subLabel,value:e.value,checked:-1!==s.indexOf(e.value),disabled:n,round:a,isLoading:r?-1!==r.indexOf(e.value):void 0,onChange:l}))))}));var Ts=s(4434),Ns=s(6937);function Bs(e,t){return t>0?(e/t*100).toFixed():0}const xs=({answer:e,voteResults:t,totalVoters:s,maxVotersCount:n,correctResults:a,shouldAnimate:r})=>{const i=t&&t.find((t=>t.option===e.option)),c=0===a.length||-1!==a.indexOf(e.option),d=a.length>0&&c||(null==i?void 0:i.isChosen),l=i?Bs(i.votersCount,s||0):0,[u,h]=(0,o.eJ)(r?0:l),m=(0,o.sO)(null),g=i?Bs(i.votersCount,n||0):0,f=u{r&&h(l)}),[r,l]),(0,o.d4)((()=>{const e=m.current;if(e&&r){const t=e.firstElementChild,s=f?"":"stroke-dasharray: 100% 200%; stroke-dashoffset: -44";t?t.setAttribute("style",s):e.innerHTML=`\n \n \n `}}),[f,r]),!t||!i)return;const p=`width: ${g}%; transform:scaleX(${f?0:1})`;return o.ZP.createElement("div",{className:"PollOption",dir:"ltr"},o.ZP.createElement("div",{className:"poll-option-share "+("100"===l?"limit-width":"")},l,"%",d&&o.ZP.createElement("span",{className:(0,ie.Z)("poll-option-chosen",!c&&"wrong",r&&"animate")},o.ZP.createElement("i",{className:c?"icon-check":"icon-close"}))),o.ZP.createElement("div",{className:"poll-option-right"},o.ZP.createElement("div",{className:"poll-option-text",dir:"auto"},(0,It.Z)(e.text)),o.ZP.createElement("div",{className:(0,ie.Z)("poll-option-answer",d&&!c&&"wrong")},o.ZP.createElement("div",{className:"poll-option-corner",ref:m}),o.ZP.createElement("div",{className:"poll-option-line",style:p}))))},As=(0,o.X$)((0,n.c$)(((e,{poll:t})=>{const{recentVoterIds:s}=t.results,{serverTimeOffset:n,users:{byId:a}}=e;return s&&0!==s.length?{recentVoterIds:s,usersById:a,serverTimeOffset:n}:{}}),((e,t)=>(0,g.ei)(t,["loadMessage","openPollResults"])))((({message:e,poll:t,recentVoterIds:s,usersById:n,loadMessage:a,onSendVote:r,openPollResults:i,serverTimeOffset:c})=>{const{id:d,chatId:l}=e,{summary:u,results:h}=t,[m,g]=(0,o.eJ)(!1),[f,p]=(0,o.eJ)([]),[I,v]=(0,o.eJ)(!1),[y,Z]=(0,o.eJ)(!1),[P,C]=(0,o.eJ)(!u.closed&&u.closeDate&&u.closeDate>0?Math.min(u.closeDate-Math.floor(Date.now()/1e3)+c,u.closePeriod):0),w=(0,o.sO)(null),{results:b,totalVoters:M}=h,S=b&&b.some((e=>e.isChosen)),E=!u.closed&&!S,k=!E&&u.isPublic&&Number(h.totalVoters)>0,R=E&&u.multipleChoice,T=b?Math.max(...b.map((e=>e.votersCount))):M,N=b?b.reduce(((e,t)=>(t.isCorrect&&e.push(t.option),e)),[]):[],B=u.answers.map((e=>({label:e.text,value:e.option,hidden:Boolean(u.quiz&&u.closePeriod&&P<=0)})));(0,o.d4)((()=>{m&&t.results.results&&t.results.results.some((e=>e.isChosen))&&g(!1)}),[m,t.results.results]),(0,o.d4)((()=>{P>0&&setTimeout((()=>C(P-1)),1e3);const e=w.current;if(e){const t=12*Math.PI,s=e.lastElementChild,n=e.firstElementChild;if(P<=5&&e.classList.add("hurry-up"),s&&n){const e=(u.closePeriod-P)/u.closePeriod*t;n.textContent=(0,L.k9)(P),s.firstElementChild.setAttribute("stroke-dashoffset",`-${e}`)}else e.innerHTML=`\n ${(0,L.k9)(P)}\n \n \n `}}),[P,u.closePeriod]),(0,o.d4)((()=>{u.quiz&&(P<=0||S&&!u.closed)&&a({chatId:l,messageId:d})}),[l,P,S,a,d,u.closed,u.quiz]),(0,o.d4)((()=>{let e;return u.quiz&&!u.closed&&u.closePeriod&&u.closePeriod>0&&(e=window.setTimeout((()=>{a({chatId:l,messageId:d})}),1e3*u.closePeriod)),()=>{e&&window.clearTimeout(e)}}),[E,l,a,d,u.closePeriod,u.closed,u.quiz]);const x=(0,o.Ye)((()=>s?s.reduce(((e,t)=>{const s=n[t];return s&&e.push(s),e}),[]):[]),[n,s]),A=(0,o.I4)((e=>{p([e]),g(!0),Z(!0),r([e])}),[r]),O=(0,o.I4)((e=>{p(e)}),[]),F=(0,o.I4)((()=>{g(!0),Z(!0),r(f)}),[r,f]),U=(0,o.I4)((()=>{i({chatId:l,messageId:d})}),[l,d,i]),$=(0,o.I4)((()=>{v(!0)}),[]),Q=(0,o.I4)((()=>{v(!1),Z(!1)}),[]);(0,o.d4)((()=>{y&&S&&u.quiz&&h.results&&t.results.solution&&(h.results.find((e=>e.isChosen&&e.isCorrect))||v(!0))}),[S,y,h.results,u.quiz,t.results.solution]);const D=(0,Ze.Z)();return o.ZP.createElement("div",{className:"Poll",dir:D.isRtl?"auto":"ltr"},I&&t.results.solution&&o.ZP.createElement(Ns.Z,{message:(0,Dt.H)(t.results.solution,t.results.solutionEntities),duration:5e3,onDismiss:Q,containerId:"#middle-column-portals"}),o.ZP.createElement("div",{className:"poll-question"},(0,It.Z)(u.question)),o.ZP.createElement("div",{className:"poll-type"},D(function(e){return void 0===e.isPublic?" ":e.quiz?e.isPublic?"QuizPoll":"AnonymousQuizPoll":e.closed?"FinalResults":e.isPublic?"PublicPoll":"AnonymousPoll"}(u)),x.length>0&&o.ZP.createElement("div",{className:"poll-recent-voters"},x.map((e=>o.ZP.createElement(zt.Z,{size:"micro",user:e})))),P>0&&E&&o.ZP.createElement("div",{ref:w,className:"poll-countdown"}),u.quiz&&t.results.solution&&!E&&o.ZP.createElement(be.Z,{round:!0,size:"tiny",color:"translucent",className:"poll-quiz-help",disabled:I,onClick:$,ariaLabel:"Show Solution"},o.ZP.createElement("i",{className:"icon-lamp"}))),E&&o.ZP.createElement("div",{className:"poll-answers"},R?o.ZP.createElement(Rs,{options:B,onChange:O,disabled:e.isScheduled||m,loadingOptions:m?f:void 0,round:!0}):o.ZP.createElement(Ts.Z,{name:`poll-${d}`,options:B,onChange:A,disabled:e.isScheduled||m,loadingOption:m?f[0]:void 0})),!E&&o.ZP.createElement("div",{className:"poll-results"},u.answers.map((function(e){return o.ZP.createElement(xs,{key:e.option,shouldAnimate:y,answer:e,voteResults:b,totalVoters:M,maxVotersCount:T,correctResults:N})}))),!k&&!R&&o.ZP.createElement("div",{className:"poll-voters-count"},function(e,t,s){return s?e(t?"Answer":"Vote",s,"i"):e(t?"Chat.Quiz.TotalVotesEmpty":"Chat.Poll.TotalVotesResultEmpty")}(D,u.quiz,h.totalVoters)),R&&o.ZP.createElement(be.Z,{isText:!0,disabled:0===f.length,size:"tiny",onClick:F},D("PollSubmitVotes")),k&&o.ZP.createElement(be.Z,{isText:!0,size:"tiny",onClick:U},D("PollViewResults")))})));var Ls=s(8035),Os=s(88);const Fs=(0,o.X$)((({message:e,observeIntersection:t,noAvatars:s,shouldAutoLoad:n,shouldAutoPlay:a,inPreview:r,lastSyncTime:i,onMediaClick:c,onCancelMediaTransfer:l})=>{const u=(0,d.s1)(e);let h=!1;if(null!=u&&u.photo&&!u.video){const{width:t,height:s}=Ht(e);h=t===s}const m=(0,o.I4)((()=>{c()}),[c]);if(!u)return;const{siteName:g,url:f,displayUrl:p,title:I,description:v,photo:y,video:Z}=u,P=(y||Z)&&c&&!h,C=(0,Ls.Z)(v,170),w=(0,ie.Z)("WebPage",h&&"with-square-photo",!y&&!Z&&!r&&"without-media",Z&&"with-video");return o.ZP.createElement("div",{className:w,"data-initial":(g||p)[0],dir:"auto"},y&&!Z&&o.ZP.createElement(vs,{message:e,observeIntersection:t,noAvatars:s,shouldAutoLoad:n,size:h?"pictogram":"inline",nonInteractive:!P,onClick:P?m:void 0,onCancelUpload:l}),o.ZP.createElement("div",{className:"WebPage-text"},o.ZP.createElement(Os.Z,{className:"site-name",url:f,text:g||p}),!r&&I&&o.ZP.createElement("p",{className:"site-title"},(0,It.Z)(I)),C&&o.ZP.createElement("p",{className:"site-description"},(0,It.Z)(C,["emoji","br"]))),!r&&Z&&o.ZP.createElement(Ms,{message:e,observeIntersection:t,noAvatars:s,shouldAutoLoad:n,shouldAutoPlay:a,lastSyncTime:i,onClick:P?m:void 0,onCancelUpload:l}))}));var Us=s(9937);const $s=(0,o.X$)((({message:e})=>{const t=(0,Ze.Z)(),s=(0,d.eO)(e),{title:n,text:a,amount:r,currency:i,isTest:c,photoUrl:l}=s;return o.ZP.createElement("div",{className:"Invoice"},n&&o.ZP.createElement("p",{className:"title"},(0,It.Z)(n)),a&&o.ZP.createElement("p",null,(0,It.Z)(a,["emoji","br"])),o.ZP.createElement("div",{className:"description "+(l?"has-image":"")},l&&o.ZP.createElement("img",{className:"invoice-image",src:l,alt:""}),o.ZP.createElement("p",{className:"description-text"},(0,Us.x)(r,i,t.code),c&&o.ZP.createElement("span",null,t("PaymentTestInvoice")))))}));function Qs(e){return(0,o.X$)((0,n.c$)(((e,t)=>{const{message:s}=t;return{isInSelectMode:(0,i.CA)(e),isSelected:(0,i.vk)(e,s.id)}}),((e,t)=>(0,g.ei)(t,["toggleMessageSelection"])))((t=>{const{isInSelectMode:s,isSelected:n,message:a,toggleMessageSelection:r,dimensions:i}=t,c=(0,o.I4)((e=>{e.stopPropagation(),r({messageId:a.id,withShift:null==e?void 0:e.shiftKey})}),[r,a]),d=(0,o.Ye)((()=>({...t,isInSelectMode:s,isSelected:n,dimensions:{...t.dimensions,x:0,y:0},onClick:s?void 0:t.onClick})),[t,s,n]);return o.ZP.createElement("div",{className:(0,ie.Z)("album-item-select-wrapper",n&&"is-selected"),style:i?`left: ${i.x}px; top: ${i.y}px;`:"",onClick:s?c:void 0},s&&o.ZP.createElement("div",{className:"message-select-control"},n&&o.ZP.createElement("i",{className:"icon-select"})),o.ZP.createElement(e,d))})))}const Ds=Qs(vs),qs=Qs(Ms),Gs=(0,n.c$)((e=>({uploadsById:e.fileUploads.byMessageLocalId})),((e,t)=>(0,g.ei)(t,["cancelSendingMessage"])))((({album:e,observeIntersection:t,shouldAutoLoad:s,shouldAutoPlay:n,hasCustomAppendix:a,lastSyncTime:r,isOwn:i,albumLayout:c,onMediaClick:l,uploadsById:u,cancelSendingMessage:h})=>{const m=e.messages.length,g=(0,o.I4)((e=>{h({chatId:e.chatId,messageId:e.id})}),[h]),{width:f,height:p}=c.containerStyle;return o.ZP.createElement("div",{className:"Album",style:`width: ${f}px; height: ${p}px;`},e.messages.map((function(e,h){const{photo:f,video:p}=(0,d.qp)(e),I=u[e.previousLocalId||e.id],v=null==I?void 0:I.progress,{dimensions:y,sides:Z}=c.layout[h];if(f){const n=a&&(i?h===m-1:Boolean(8&Z&&4&Z));return o.ZP.createElement(Ds,{id:`album-media-${e.id}`,message:e,observeIntersection:t,shouldAutoLoad:s,shouldAffectAppendix:n,uploadProgress:v,dimensions:y,onClick:l,onCancelUpload:g})}if(p)return o.ZP.createElement(qs,{id:`album-media-${e.id}`,message:e,observeIntersection:t,shouldAutoLoad:s,shouldAutoPlay:n,uploadProgress:v,lastSyncTime:r,dimensions:y,onClick:l,onCancelUpload:g})})))}));function Hs(){return(Hs=Object.assign||function(e){for(var t=1;t{const r=(0,o.sO)(null),i=(0,o.sO)(null),c=(0,o.sO)(null),l=e.content.video,u=(0,Ft.Op)(r,t),[h,m]=(0,o.eJ)(s&&n),g=Boolean(h&&u&&a),{mediaData:f,downloadProgress:p}=(0,hs.Z)((0,d.Ti)(e,"inline"),!g,(0,d.kG)(e,"inline"),a),I=gs(e,f),{isBuffered:v,bufferingHandlers:y}=(0,ys.Z)(),P=h&&!v,C=!1===(0,fs.Z)(h),{shouldRender:w,transitionClassNames:b}=(0,de.Z)(P||!v,void 0,C),{shouldRenderThumb:M,transitionClassNames:S}=(0,is.Z)(f,"slow"),[E,k]=(0,o.eJ)(!1),[R,T]=(0,o.eJ)(0);(0,o.d4)((()=>{if(!E)return;const e=188*Math.PI,t=e-R*e,s=c.current,n=i.current,a=n.firstElementChild;a?a.firstElementChild.setAttribute("stroke-dashoffset",t.toString()):n.innerHTML=`\n \n `,T(s.currentTime/s.duration)}),[E,R]);const N=Boolean(f&&u),B=()=>{k(!1),T(0),(0,Zs.Z)(c.current),(0,Z.T2)((()=>{i.current.innerHTML=""}))},x=(A=B,()=>{js&&js(),js=A});var A;(0,o.d4)((()=>{c.current&&(N?(0,Zs.Z)(c.current):c.current.pause())}),[N]),Ps(c,N),ws(c,Boolean(f)),(0,Cs.Z)(c,[f]);const O=(0,o.I4)((()=>{if(!f)return void m((e=>!e));const e=c.current;E?e.paused?(0,Zs.Z)(e):e.pause():(x(),e.pause(),e.currentTime=0,(0,Zs.Z)(e),k(!0))}),[x,E,f]),F=(0,o.I4)((e=>{const t=e.currentTarget;T(t.currentTime/t.duration)}),[]),U=(0,ie.Z)("full-media",S);return o.ZP.createElement("div",{ref:r,className:"RoundVideo media-inner",onClick:O},(M||f)&&o.ZP.createElement("div",{className:"thumbnail-wrapper"},o.ZP.createElement("canvas",{ref:I,className:"thumbnail",style:`width: ${pt.vw}px; height: ${pt.vw}px`})),f&&o.ZP.createElement("div",{className:"video-wrapper"},o.ZP.createElement("video",Hs({ref:c,className:U,width:pt.vw,height:pt.vw,autoPlay:!0,muted:!E,loop:!E,playsInline:!0,onEnded:E?B:void 0},y,{onTimeUpdate:E?F:void 0}),o.ZP.createElement("source",{src:f}))),o.ZP.createElement("div",{className:"progress",ref:i}),w&&o.ZP.createElement("div",{className:`media-loading ${b}`},o.ZP.createElement(Is.Z,{progress:p})),!f&&!h&&o.ZP.createElement("i",{className:"icon-large-play"}),o.ZP.createElement("div",{className:"message-media-duration"},E?(0,L.k9)(c.current.currentTime):(0,L.k9)(l.duration),(!E||c.current.paused)&&o.ZP.createElement("i",{className:"icon-muted-chat"})))},Vs=({message:e,onClick:t})=>{const s=(0,Ze.Z)();return o.ZP.createElement("div",{className:"InlineButtons"},e.inlineButtons.map((e=>o.ZP.createElement("div",{className:"row"},e.map((e=>o.ZP.createElement(be.Z,{size:"tiny",ripple:!0,disabled:"NOT_SUPPORTED"===e.type,onClick:()=>t({button:e})},(0,It.Z)(s(e.text)),"buy"===e.type&&o.ZP.createElement("i",{className:"icon-card"}),"url"===e.type&&!e.value.match(a.FS)&&o.ZP.createElement("i",{className:"icon-arrow-right"}))))))))},Ws=(0,o.X$)((0,n.c$)(((e,{message:t})=>{const{threadId:s,chatId:n}=t.threadInfo,a=(0,i.tZ)(e,n,s)||t.threadInfo,{byId:o}=e.users,{byId:r}=e.chats;return{threadInfo:a,usersById:o,chatsById:r}}),((e,t)=>(0,g.ei)(t,["openChat"])))((({disabled:e,threadInfo:t,usersById:s,chatsById:n,openChat:a})=>{const r=(0,Ze.Z)(),{threadId:i,chatId:c,messagesCount:l,lastMessageId:u,lastReadInboxMessageId:h,recentReplierIds:m}=t,g=(0,o.I4)((()=>{a({id:c,threadId:i})}),[a,c,i]);if(void 0===l)return;const f=m&&m.map((e=>(0,d.YA)(e)?s[e]:n[e])).filter(Boolean),p=Boolean(h&&u&&h0&&o.ZP.createElement("div",{className:"recent-repliers",dir:r.isRtl?"rtl":"ltr"},f.map((e=>o.ZP.createElement(zt.Z,{key:e.id,size:"small",user:(0,d.YA)(e.id)?e:void 0,chat:(0,d.YA)(e.id)?void 0:e})))),o.ZP.createElement("div",{className:"label",dir:"auto"},l?r("Comments",l,"i"):r("LeaveAComment")),o.ZP.createElement("i",{className:"icon-next"}))}))),Ks="data-is-document-group-hover";function Xs(e){const t=zs(e.currentTarget);t&&t.setAttribute(Ks,"")}function Ys(e){const t=zs(e.currentTarget);t&&t.removeAttribute(Ks)}function zs(e){let t=e;do{t=t.nextElementSibling}while(t&&!t.classList.contains("last-in-document-group"));return t}const Js=(0,o.X$)((0,n.c$)(((e,t)=>{const{focusedMessage:s,forwardMessages:n,lastSyncTime:a}=e,{message:o,album:r,withSenderName:c,withAvatar:l,threadId:u,messageListType:h}=t,{id:m,chatId:g,viaBotId:f,replyToMessageId:p,isOutgoing:I}=o,v=(0,i.Z1)(e,g),y=(0,i.FM)(e,g),Z=v&&(0,d.eA)(v),P=null==v?void 0:v.username,C=!y&&(0,d.Ul)(o),w=c||l||C?(0,i.Ur)(e,o):void 0,b=(0,i.cv)(e,o),M=f?(0,i.dy)(e,f):void 0,S=u?(0,i.qS)(e,g,u):void 0,E=o.id===S,k=p===S,R=p&&!k?(0,i.hj)(e,g,p):void 0,T=R&&(0,i.Ur)(e,R),N=(0,i.uZ)(e,o),B="thread"===h&&(r?r.messages.some((t=>(0,i._X)(e,t))):(0,i._X)(e,o)),{direction:x,noHighlight:A,isResizingContainer:L}=B&&s||{},O=n.messageIds&&n.messageIds.includes(m),{query:F}=(0,i.n5)(e)||{},U=(0,d._O)(o);let $;$=null!=r&&r.messages?r.messages.every((({id:t})=>(0,i.vk)(e,t))):(0,i.vk)(e,m);const{canReply:Q}="thread"===h&&(0,i._k)(e,o,u)||{};return{theme:(0,i.Pu)(e),chatUsername:P,forceSenderName:C,sender:w,originSender:b,botSender:M,shouldHideReply:k,isThreadTop:E,replyMessage:R,replyMessageSender:T,isFocused:B,isForwarding:O,isChatWithSelf:y,isChannel:Z,canReply:Q,lastSyncTime:a,highlight:F,isSingleEmoji:Boolean(U),animatedEmoji:U?(0,i.zB)(e,U):void 0,isInSelectMode:(0,i.CA)(e),isSelected:$,isGroupSelected:!!o.groupedId&&!o.isInAlbum&&(0,i.a6)(e,g,o.groupedId),threadId:u,isPinnedList:"pinned"===h,shouldAutoLoadMedia:v?(0,i.TD)(e,o,v,w):void 0,shouldAutoPlayMedia:(0,i.pv)(e,o),shouldLoopStickers:(0,i.yB)(e),...I&&{outgoingStatus:(0,i.dT)(e,o,"scheduled"===h)},..."number"==typeof N&&{uploadProgress:N},...B&&{focusDirection:x,noFocusHighlight:A,isResizingContainer:L}}}),((e,t)=>(0,g.ei)(t,["toggleMessageSelection","clickInlineButton","disableContextMenuHint"])))((({message:e,chatUsername:t,observeIntersectionForBottom:s,observeIntersectionForMedia:a,observeIntersectionForAnimatedStickers:r,album:i,noAvatars:c,withAvatar:l,withSenderName:g,noComments:f,appearanceOrder:p,isFirstInGroup:I,isLastInGroup:v,isFirstInDocumentGroup:y,isLastInDocumentGroup:Z,isLastInList:P,theme:C,forceSenderName:w,sender:b,originSender:M,botSender:S,isThreadTop:E,shouldHideReply:k,replyMessage:R,replyMessageSender:T,outgoingStatus:N,uploadProgress:B,isFocused:x,focusDirection:A,noFocusHighlight:L,isResizingContainer:O,isForwarding:F,isChatWithSelf:U,isChannel:$,canReply:Q,lastSyncTime:D,highlight:q,animatedEmoji:G,isInSelectMode:H,isSelected:j,isGroupSelected:_,threadId:V,messageListType:W,isPinnedList:K,shouldAutoLoadMedia:X,shouldAutoPlayMedia:Y,shouldLoopStickers:z,toggleMessageSelection:J,clickInlineButton:ee,disableContextMenuHint:te})=>{const se=(0,o.sO)(null),ne=(0,o.sO)(null),ae=(0,o.sO)(null),oe=(0,Ze.Z)();(0,Ft._N)(ne,s);const{isContextMenuOpen:re,contextMenuPosition:ce,handleBeforeContextMenu:le,handleContextMenu:ue,handleContextMenuClose:he,handleContextMenuHide:me}=(0,Qt.Z)(se,m.$b&&H,!0,m.wZ);(0,o.d4)((()=>{re&&te()}),[re,te]);const ge=p<=0,[fe,pe]=(0,ye.Z)(ge);(0,o.d4)((()=>{ge||setTimeout(pe,10*p)}),[p,pe,ge]);const{transitionClassNames:Ie}=(0,de.Z)(fe,void 0,ge,!1),{id:ve,chatId:Pe,threadInfo:Ce}=e,we=(0,d.CI)(e),Me=(0,d.B4)(e),Se="scheduled"===W||e.isScheduled,Ee=(0,d.ss)(e)&&!k,ke=Boolean(Ce)&&"thread"===W,{forwardInfo:Re,viaBotId:Te}=e,Ne=Re&&!U&&!Re.isLinkedChannelPost,xe=Boolean(e.groupedId)&&!e.isInAlbum,Ae=Boolean(i)&&i.messages.length>1,{text:Le,photo:Oe,video:Fe,audio:Ue,voice:$e,document:Qe,sticker:De,contact:qe,poll:Ge,webPage:He,invoice:je}=(0,d.qp)(e),_e=(0,d.$D)(e),Ve=(0,Dt.X)(e,q,qt(_e)),We=void 0!==ce,Ke=$&&e.adminTitle||Re&&!Ne&&Re.adminTitle||void 0,Xe=(0,o.Ye)((()=>Ke?Xt(Ke):void 0),[Ke]),Ye=!(We||H||F)&&(!xe||Z),ze=$&&!Se,Je=Boolean(K||Re&&(Re.isChannelPost||U&&!Me)&&Re.fromMessageId),et=!Re||!U&&b?b:M,tt=Re?M:b,st=(0,o.I4)(((e,t)=>{we||J({messageId:ve,groupedId:t,...(null==e?void 0:e.shiftKey)&&{withShift:!0},...Ae&&{childMessageIds:i.messages.map((({id:e})=>e))}})}),[we,J,ve,Ae,i]),{handleMouseDown:at,handleClick:ot,handleContextMenu:rt,handleDoubleClick:it,handleContentDoubleClick:ct,isSwiped:lt}=function(e,t,s,a,r,i,c,d,l){const{setReplyingToId:u}=(0,n.uC)(),[h,g,f]=(0,ye.Z)();return(0,o.d4)((()=>{if(!m.$b||i||!c)return;let e;return(0,Be.s)(t.current,{selectorToPreventScroll:".MessageList",onSwipe:(t,s)=>s===Be.e.Left&&(e||(e=Date.now()),g(),!0),onRelease:()=>{e&&(u({messageId:s}),setTimeout(f,Math.max(0,150-(Date.now()-e))),e=void 0)}})}),[t,i,s,u,g,f,c]),{handleMouseDown:i?void 0:function(e){(0,At.q)(e),a||l(e)},handleClick:function(t){if(i&&!a)e(t);else if(m.wZ){const e=t.target;if(!e.classList.contains("text-content")&&!e.classList.contains("Message"))return;nt.Z.getIsKeyboardVisible()?setTimeout((()=>{d(t)}),350):d(t)}},handleContextMenu:i||a?void 0:function(t){if(m.wZ){if(t.target.matches("a[href]"))return;t.preventDefault(),e()}else d(t)},handleDoubleClick:i?void 0:function(){u({messageId:s})},handleContentDoubleClick:m.$b?void 0:function(e){e.stopPropagation()},isSwiped:h}}(st,se,ve,we,0,Boolean(H),Boolean(Q),ue,le),{handleAvatarClick:ut,handleSenderClick:ht,handleViaBotClick:mt,handleReplyClick:gt,handleMediaClick:ft,handleAudioPlay:vt,handleAlbumMediaClick:yt,handleMetaClick:Zt,handleReadMedia:Pt,handleCancelUpload:Ct,handleVoteSend:wt,handleGroupForward:bt,handleForward:Mt,handleFocus:St,handleFocusForwarded:Et,handleDocumentGroupSelectAll:kt}=function(e,t,s,a,r,i,c,l,m,g,f){const{openUserInfo:p,openChat:I,showNotification:v,focusMessage:y,openMediaViewer:Z,openAudioPlayer:P,markMessagesRead:C,cancelSendingMessage:w,sendPollVote:b,openForwardMenu:M}=(0,n.uC)(),{id:S,forwardInfo:E,replyToMessageId:k,groupedId:R}=s,T=(0,o.I4)((()=>{m&&((0,d.YA)(m.id)?p({id:m.id}):I({id:m.id}))}),[m,p,I]),N=(0,o.I4)((()=>{g?(0,d.YA)(g.id)?p({id:g.id}):I({id:g.id}):v({message:e("HidAccount")})}),[g,v,e,p,I]),B=(0,o.I4)((()=>{f&&p({id:f.id})}),[f,p]),x=(0,o.I4)((()=>{y({chatId:a,threadId:r,messageId:k,replyMessageId:S})}),[y,a,r,k,S]),A=(0,o.I4)((()=>{Z({chatId:a,threadId:r,messageId:S,origin:c?h.bZ.ScheduledInline:h.bZ.Inline})}),[a,r,S,Z,c]),L=(0,o.I4)((()=>{P({chatId:a,messageId:S})}),[a,S,P]),O=(0,o.I4)((e=>{Z({chatId:a,threadId:r,messageId:e,origin:c?h.bZ.ScheduledAlbum:h.bZ.Album})}),[a,r,Z,c]),F=(0,o.I4)((()=>{C({messageIds:[S]})}),[S,C]),U=(0,o.I4)((()=>{w({chatId:a,messageId:S})}),[w,a,S]),$=(0,o.I4)((e=>{b({chatId:a,messageId:S,options:e})}),[a,S,b]),Q=(0,o.I4)((()=>{M({fromChatId:a,groupedId:R})}),[M,a,R]),D=(0,o.I4)((()=>{if(l&&l.messages){const e=l.messages.map((({id:e})=>e));M({fromChatId:a,messageIds:e})}else M({fromChatId:a,messageIds:[S]})}),[l,M,a,S]),q=(0,o.I4)((()=>{y({chatId:a,threadId:u._f,messageId:S})}),[y,a,S]),G=(0,o.I4)((()=>{y(i?{chatId:E.fromChatId,groupedId:R,groupedChatId:a}:{chatId:E.fromChatId,messageId:E.fromMessageId})}),[i,y,E,R,a]),H=(0,o.I4)((e=>{e.stopPropagation(),t(e,R)}),[t,R]);return{handleAvatarClick:T,handleSenderClick:N,handleViaBotClick:B,handleReplyClick:x,handleMediaClick:A,handleAudioPlay:L,handleAlbumMediaClick:O,handleMetaClick:H,handleReadMedia:F,handleCancelUpload:U,handleVoteSend:$,handleGroupForward:Q,handleForward:D,handleFocus:q,handleFocusForwarded:G,handleDocumentGroupSelectAll:H}}(oe,st,e,Pe,V,xe,Boolean(Se),i,et,tt,S),Rt=(0,ie.Z)("Message message-list-item",I&&"first-in-group",v&&"last-in-group",y&&"first-in-document-group",Z&&"last-in-document-group",P&&"last-in-list",Me&&"own",Boolean(e.views)&&"has-views",e.isEdited&&"was-edited",Ee&&"has-reply",We&&"has-menu-open",x&&!L&&"focused",F&&"is-forwarding",e.isDeleting&&"is-deleting",xe&&"is-in-document-group",Ae&&"is-album",e.hasUnreadMention&&"has-unread-mention",j&&"is-selected",H&&"is-in-selection-mode",E&&"is-thread-top",Boolean(e.inlineButtons)&&"has-inline-buttons",lt&&"is-swiped",Ie),Tt=function(e,{hasReply:t,customShape:s,isLastInGroup:n,asForwarded:a,hasThread:o,forceSenderName:r,hasComments:i,hasActionButton:c}={}){const{text:l,photo:u,video:h,audio:m,voice:g,document:f,poll:p,webPage:I,contact:v}=(0,d.qp)(e),y=["message-content"],Z=u||h,P=Z&&!l,C=Boolean(e.viaBotId);return qt(s)?y.push(`emoji-only emoji-only-${s}`):l&&y.push("text"),c&&y.push("has-action-button"),s&&(y.push("custom-shape"),null!=h&&h.isRound&&y.push("round"),i&&y.push("has-comments")),u||h?y.push("media"):m?y.push("audio"):g?y.push("voice"):f?y.push("document"):v?y.push("contact"):p?y.push("poll"):I&&(y.push("web-page"),(I.photo||I.video)&&y.push("media")),a&&!s&&y.push("is-forwarded"),t&&y.push("is-reply"),o&&y.push("has-replies"),C&&y.push("is-via-bot"),r&&y.push("force-sender-name"),s||(y.push("has-shadow"),Z&&i&&y.push("has-background"),(t||a||!P||C||r)&&y.push("has-solid-background"),!n||!u&&P||y.push("has-appendix")),y.join(" ")}(e,{hasReply:Ee,customShape:_e,isLastInGroup:v,asForwarded:Ne,hasThread:ke,forceSenderName:w,hasComments:e.threadInfo&&e.threadInfo.messagesCount>0,hasActionButton:ze||Je}),Nt=e.threadInfo&&(!xe||Z)&&"thread"===W&&!f,Bt=Tt.includes("has-appendix");(0,dt.Z)(Pe,Ee?e.replyToMessageId:void 0,R,e.id),Yt(se,Pe,x,A,L,O),(0,o.bt)((()=>{ae.current&&(ae.current.innerHTML=Me?'':'')}),[Me,Bt]);let xt,Lt="",Ot=!1;const Ut=(0,o.Ye)((()=>Ae?Wt(Me,Boolean(Ne),Boolean(c),i):void 0),[Ae,Me,Ne,c,i]),$t=Ne?28:0;if(Ae||!Oe&&!Fe)Ut&&(xt=Math.max(Gt(Boolean(Le),Nt),Ut.containerStyle.width),xt-Ut.containerStyle.width>18&&(Ot=!0));else{let t;Oe?t=Ht(e,c).width:Fe&&(t=Fe.isRound?pt.vw:Ht(e,c).width),t&&(xt=Math.max(Gt(Boolean(Le),Nt),t),xt-t>18&&(Ot=!0))}return xt&&(Lt=`width: ${xt+$t}px`),o.ZP.createElement("div",{ref:se,id:`message${ve}`,className:Rt,style:Xe?`--meta-safe-author-width: ${Xe}px`:void 0,"data-message-id":ve,onMouseDown:at,onClick:ot,onContextMenu:rt,onDoubleClick:it,onMouseEnter:xe&&!Z?Xs:void 0,onMouseLeave:xe&&!Z?Ys:void 0},o.ZP.createElement("div",{ref:ne,className:"bottom-marker","data-message-id":ve,"data-last-message-id":i?i.messages[i.messages.length-1].id:void 0,"data-has-unread-mention":e.hasUnreadMention}),!we&&!xe&&o.ZP.createElement("div",{className:"message-select-control"},j&&o.ZP.createElement("i",{className:"icon-select"})),!we&&Z&&o.ZP.createElement("div",{className:(0,ie.Z)("message-select-control group-select",_&&"is-selected"),onClick:kt},_&&o.ZP.createElement("i",{className:"icon-select"})),l&&function(){const e=et&&(0,d.YA)(et.id),t=et&&e?et:void 0,s=et&&!e?et:void 0,n=!et&&Re?Re.hiddenUserName:void 0;return o.ZP.createElement(zt.Z,{size:"small",user:t,chat:s,text:n,lastSyncTime:D,onClick:t||s?ut:void 0})}(),o.ZP.createElement("div",{className:(0,ie.Z)("message-content-wrapper",Tt.includes("text")&&"can-select-text")},o.ZP.createElement("div",{className:Tt,style:Lt,dir:"auto"},Ne&&!_e&&(!xe||y)&&o.ZP.createElement("div",{className:"message-title"},oe("ForwardedMessage")),function(){const t=(0,ie.Z)("content-inner",Ne&&!_e&&"forwarded-message",Ee&&"reply-message",Ot&&"no-media-corners"),s=v&&!Ve&&!Ne&&!ke,n=!He&&!G&&Ve,l=(0,ie.Z)("text-content",n&&"with-meta",N&&"with-outgoing-icon");return o.ZP.createElement("div",{className:t,onDoubleClick:ct,dir:"auto"},function(){if(_e&&!Te||!(g&&!Oe&&!Fe||Ne||Te||w)||xe&&!y)return;let t,s;return!tt||_e&&Te?null!=Re&&Re.hiddenUserName&&(t=Re.hiddenUserName):(t=(0,d.OU)(oe,tt),Ne||(s=`color-${(0,d.Rs)(tt)}`)),o.ZP.createElement("div",{className:"message-title",dir:"ltr"},t?o.ZP.createElement("span",{className:(0,ie.Z)("interactive",s),onClick:ht,dir:"auto"},(0,It.Z)(t)):S?void 0:" ",S&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("span",{className:"via"},oe("ViaBot")),o.ZP.createElement("span",{className:"interactive",onClick:mt},(0,It.Z)(`@${S.username}`))),null!=Re&&Re.isLinkedChannelPost?o.ZP.createElement("span",{className:"admin-title",dir:"auto"},oe("DiscussChannel")):e.adminTitle&&!$?o.ZP.createElement("span",{className:"admin-title",dir:"auto"},e.adminTitle):void 0)}(),Ee&&o.ZP.createElement(ss,{message:R,sender:T,observeIntersection:a,onClick:gt}),De&&o.ZP.createElement(ls,{message:e,observeIntersection:a,observeIntersectionForPlaying:r,shouldLoop:z,lastSyncTime:D}),G&&o.ZP.createElement(us.Z,{size:"small",sticker:G,observeIntersection:a,lastSyncTime:D,forceLoadPreview:we}),Ae&&o.ZP.createElement(Gs,{album:i,albumLayout:Ut,observeIntersection:a,shouldAutoLoad:X,shouldAutoPlay:Y,isOwn:Me,hasCustomAppendix:s,lastSyncTime:D,onMediaClick:yt}),!Ae&&Oe&&o.ZP.createElement(vs,{message:e,observeIntersection:a,noAvatars:c,shouldAutoLoad:X,uploadProgress:B,shouldAffectAppendix:s,onClick:ft,onCancelUpload:Ct}),!Ae&&Fe&&Fe.isRound&&o.ZP.createElement(_s,{message:e,observeIntersection:a,shouldAutoLoad:X,shouldAutoPlay:Y,lastSyncTime:D}),!Ae&&Fe&&!Fe.isRound&&o.ZP.createElement(Ms,{message:e,observeIntersection:a,noAvatars:c,shouldAutoLoad:X,shouldAutoPlay:Y,uploadProgress:B,lastSyncTime:D,onClick:ft,onCancelUpload:Ct}),(Ue||$e)&&o.ZP.createElement(as.Z,{theme:C,message:e,uploadProgress:B,lastSyncTime:D,isSelectable:xe,isSelected:j,onPlay:vt,onReadMedia:!$e||Me&&!U?void 0:Pt,onCancelUpload:Ct}),Qe&&o.ZP.createElement(ns.Z,{message:e,observeIntersection:a,uploadProgress:B,isSelectable:xe,isSelected:j,onMediaClick:ft,onCancelUpload:Ct}),qe&&o.ZP.createElement(Es,{contact:qe}),Ge&&o.ZP.createElement(As,{message:e,poll:Ge,onSendVote:wt}),!G&&Ve&&o.ZP.createElement("p",{className:l,dir:"auto"},Ve,n&&o.ZP.createElement(rs,{message:e,outgoingStatus:N,signature:Ke,onClick:Zt})),He&&o.ZP.createElement(Fs,{message:e,observeIntersection:a,noAvatars:c,shouldAutoLoad:X,shouldAutoPlay:Y,lastSyncTime:D,onMediaClick:ft,onCancelMediaTransfer:Ct}),je&&o.ZP.createElement($s,{message:e}))}(),(!xe||Z)&&!(!He&&!G&&Ve)&&o.ZP.createElement(rs,{message:e,outgoingStatus:N,signature:Ke,onClick:Zt}),Ye&&ze?o.ZP.createElement(be.Z,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:oe("lng_context_forward_msg"),onClick:Z?bt:Mt},o.ZP.createElement("i",{className:"icon-share-filled"})):Ye&&Je?o.ZP.createElement(be.Z,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:"Focus message",onClick:K?St:Et},o.ZP.createElement("i",{className:"icon-arrow-right"})):void 0,Nt&&o.ZP.createElement(Ws,{message:e,disabled:f}),Bt&&o.ZP.createElement("div",{className:"svg-appendix",ref:ae})),e.inlineButtons&&o.ZP.createElement(Vs,{message:e,onClick:ee})),ce&&o.ZP.createElement(es,{isOpen:re,anchor:ce,message:e,album:i,chatUsername:t,messageListType:W,onClose:he,onCloseAnimationEnd:me}))}))),en=(0,o.X$)((({messageIds:e,messageGroups:t,isViewportNewest:s,isUnread:r,withUsers:i,noAvatars:c,containerRef:l,anchorIdRef:u,memoUnreadDividerBeforeIdRef:m,memoFirstUnreadIdRef:f,threadId:p,type:I,isActive:v,threadTopMessageId:y,hasLinkedChat:P,isSchedule:C,noAppearanceAnimation:w,onFabToggle:b,onNotchToggle:M,openHistoryCalendar:S})=>{const{observeIntersectionForMedia:E,observeIntersectionForReading:k,observeIntersectionForAnimatedStickers:R}=function(e,t,s){const{markMessageListRead:a,markMessagesRead:o}=(0,n.uC)(),{observe:r}=(0,Ft.S1)({rootRef:t,throttleMs:Ut,margin:$t}),{observe:i,freeze:c,unfreeze:d}=(0,Ft.S1)({rootRef:t,throttleMs:150},(t=>{if("thread"!==e)return;let n=0;const r=[];t.forEach((e=>{const{isIntersecting:t,target:s}=e;if(!t)return;const{dataset:a}=s,o=Number(a.lastMessageId||a.messageId);o>n&&(n=o),a.hasUnreadMention&&r.push(o)})),s.current&&n>=s.current&&a({maxId:n}),r.length&&o({messageIds:r})}));(0,le.Z)(c,d);const{observe:l}=(0,Ft.S1)({rootRef:t,throttleMs:Ut});return{observeIntersectionForMedia:r,observeIntersectionForReading:i,observeIntersectionForAnimatedStickers:l}}(I,l,f),{backwardsTriggerRef:T,forwardsTriggerRef:N,fabTriggerRef:B}=function(e,t,s,r,i,c,d,l){const{loadViewportMessages:u}=(0,n.uC)(),[m,g]=(0,o.Ye)((()=>"thread"===e?[(0,Z.Ds)((()=>u({direction:h.Uq.Backwards})),1e3,!0,!1),(0,Z.Ds)((()=>u({direction:h.Uq.Forwards})),1e3,!0,!1)]:[]),[u,s]),f=(0,o.sO)(null),p=(0,o.sO)(null),I=(0,o.sO)(null);function v(){if(!l)return;if(!s||!s.length)return c(!1),void d(!1);if(!r)return c(!0),void d(!0);const{offsetHeight:e,scrollHeight:n,scrollTop:a}=t.current,o=Math.round(n-a-e),u=o<=0;c(i?!u:!(o<=50)),d(!u)}const{observe:y}=(0,Ft.S1)({rootRef:t,margin:a.gZ},(e=>{if(!g||!m)return;if(s[0]>=a.AE)return;const n=e.find((({isIntersecting:e})=>e));if(!n)return;const{target:o}=n;"backwards-trigger"===o.className?((0,Lt.Z)(t.current),m()):"forwards-trigger"===o.className&&((0,Lt.Z)(t.current),g())}));(0,Ft._N)(f,y),(0,Ft._N)(p,y);const{observe:P,freeze:C,unfreeze:w}=(0,Ft.S1)({rootRef:t,margin:50},v);(0,Ft._N)(I,P);const{observe:b,freeze:M,unfreeze:S}=(0,Ft.S1)({rootRef:t},v);return(0,Ft._N)(I,b),(0,he.Z)((()=>{C(),M(),setTimeout((()=>{S(),w()}),100)}),[s]),{backwardsTriggerRef:f,forwardsTriggerRef:p,fabTriggerRef:I}}(I,l,e,s,r,b,M,v),x=(0,Ze.Z)(),A=o.ZP.createElement("div",{className:(0,ie.Z)("unread-divider","local-action-message"),key:"unread-messages"},o.ZP.createElement("span",null,x("UnreadMessages"))),O=w?0:t.reduce(((e,t)=>e+(0,g.xH)(t.senderGroups).length),0);let F=0;const U=t.map(((e,t,s)=>{const n=e.senderGroups.map(((e,n,a)=>{if(1===e.length&&!Bt(e[0])&&(0,d.Lo)(e[0])){const r=e[0],i=n===a.length-1&&t===s.length-1;return(0,g.oA)([r.id===m.current&&A,o.ZP.createElement(ts,{key:r.id,message:r,observeIntersection:k,appearanceOrder:O-++F,isLastInList:i})])}let r;return(0,g.xH)(e.map(((l,h)=>{const f=Bt(l)?l.mainMessage:l,v=Bt(l)?l:void 0,Z=(0,d.B4)(f),C=Bt(l),w=e[h+1];f.previousLocalId&&u.current===`message${f.previousLocalId}`&&(u.current=`message${f.id}`);const b=!C&&f.groupedId?f.groupedId:void 0,M=w&&!Bt(w)?w.groupedId:void 0,S={isFirstInGroup:0===h,isLastInGroup:h===e.length-1,isFirstInDocumentGroup:Boolean(b&&b!==r),isLastInDocumentGroup:Boolean(b&&b!==M),isLastInList:h===e.length-1&&n===a.length-1&&t===s.length-1};r=b;const T=(0,d.KK)(f),N="scheduled"!==I?T:`${f.date}_${T}`;return(0,g.oA)([f.id===m.current&&A,o.ZP.createElement(Js,{key:N,message:f,observeIntersectionForBottom:k,observeIntersectionForMedia:E,observeIntersectionForAnimatedStickers:R,album:v,noAvatars:c,withAvatar:S.isLastInGroup&&i&&!Z&&!(f.id===y),withSenderName:S.isFirstInGroup&&i&&!Z,threadId:p,messageListType:I,noComments:!1===P,appearanceOrder:O-++F,isFirstInGroup:S.isFirstInGroup,isLastInGroup:S.isLastInGroup,isFirstInDocumentGroup:S.isFirstInDocumentGroup,isLastInDocumentGroup:S.isLastInDocumentGroup,isLastInList:S.isLastInList}),f.id===y&&o.ZP.createElement("div",{className:"local-action-message",key:"discussion-started"},o.ZP.createElement("span",null,x("DiscussionStarted")))])})))}));return o.ZP.createElement("div",{className:"message-date-group",key:e.datetime,onMouseDown:At.q,teactFastList:!0},o.ZP.createElement("div",{className:(0,ie.Z)("sticky-date",!C&&"interactive"),key:"date-header",onMouseDown:At.q,onClick:C?void 0:()=>S({selectedAt:e.datetime})},o.ZP.createElement("span",{dir:"auto"},C&&e.originalDate===a.t4&&x("MessageScheduledUntilOnline"),C&&e.originalDate!==a.t4&&x("MessageScheduledOn",(0,L.j1)(x,e.datetime,void 0,!0)),!C&&(0,L.j1)(x,e.datetime))),(0,g.xH)(n))}));return o.ZP.createElement("div",{className:"messages-container",teactFastList:!0},o.ZP.createElement("div",{ref:T,key:"backwards-trigger",className:"backwards-trigger"}),(0,g.xH)(U),o.ZP.createElement("div",{ref:N,key:"forwards-trigger",className:"forwards-trigger"}),o.ZP.createElement("div",{ref:B,key:"fab-trigger",className:"fab-trigger"}))}));var tn=s(3547);const sn=(0,o.X$)((0,n.c$)(((e,{userId:t})=>{const{stickers:s}=e.stickers.greeting,n=null!=s&&s.length?s[t%s.length]:void 0,a=(0,i.Z1)(e,t);return a?{sticker:n,lastUnreadMessageId:a.lastMessage&&a.lastMessage.id!==a.lastReadInboxMessageId?a.lastMessage.id:void 0,connectionState:e.connectionState}:{}}),((e,t)=>(0,g.ei)(t,["loadGreetingStickers","sendMessage","markMessageListRead"])))((({sticker:e,connectionState:t,lastUnreadMessageId:s,loadGreetingStickers:n,sendMessage:a,markMessageListRead:r})=>{const i=(0,Ze.Z)(),c=(0,o.sO)(null),{observe:d}=(0,Ft.S1)({rootRef:c,debounceMs:200});(0,o.d4)((()=>{e||"connectionStateReady"!==t||n()}),[t,n,e]),(0,o.d4)((()=>{"connectionStateReady"===t&&s&&r({maxId:s})}),[t,r,s]);const l=(0,o.I4)((e=>{e={...e,isPreloadedGlobally:!0},a({sticker:e})}),[a]);return o.ZP.createElement("div",{className:"ContactGreeting",ref:c},o.ZP.createElement("div",{className:"wrapper"},o.ZP.createElement("p",{className:"title",dir:"auto"},i("Conversation.EmptyPlaceholder")),o.ZP.createElement("p",{className:"description",dir:"auto"},i("Conversation.GreetingText")),o.ZP.createElement("div",{className:"sticker"},e&&o.ZP.createElement(tn.Z,{sticker:e,onClick:l,clickArg:e,observeIntersection:d,size:160,className:"large"}))))}))),nn=(0,o.X$)((({isChatWithSelf:e,type:t,isGroupChatJustCreated:s})=>{const n=(0,Ze.Z)();return"scheduled"===t?function(e){return o.ZP.createElement("div",{className:"empty"},o.ZP.createElement("span",null,e("ScheduledMessages.EmptyPlaceholder")))}(n):e?function(e){return o.ZP.createElement("div",{className:"NoMessages"},o.ZP.createElement("div",{className:"wrapper"},o.ZP.createElement("i",{className:"icon icon-cloud-download"}),o.ZP.createElement("h3",{className:"title"},e("Conversation.CloudStorageInfo.Title")),o.ZP.createElement("ul",{className:"description"},o.ZP.createElement("li",null,e("Conversation.ClousStorageInfo.Description1")),o.ZP.createElement("li",null,e("Conversation.ClousStorageInfo.Description2")),o.ZP.createElement("li",null,e("Conversation.ClousStorageInfo.Description3")),o.ZP.createElement("li",null,e("Conversation.ClousStorageInfo.Description4")))))}(n):s?function(e){return o.ZP.createElement("div",{className:"NoMessages"},o.ZP.createElement("div",{className:"wrapper",dir:e.isRtl?"rtl":void 0},o.ZP.createElement("h3",{className:"title"},e("EmptyGroupInfo.Title")),o.ZP.createElement("p",{className:"description"},e("EmptyGroupInfo.Subtitle")),o.ZP.createElement("ul",{className:"list-checkmarks"},o.ZP.createElement("li",null,e("EmptyGroupInfo.Line1")),o.ZP.createElement("li",null,e("EmptyGroupInfo.Line2")),o.ZP.createElement("li",null,e("EmptyGroupInfo.Line3")),o.ZP.createElement("li",null,e("EmptyGroupInfo.Line4")))))}(n):o.ZP.createElement("div",{className:"empty"},o.ZP.createElement("span",null,n("NoMessages")))})),an=(0,Z.Ds)((e=>e()),200,!1),on=(0,o.X$)((0,n.c$)(((e,{chatId:t,threadId:s,type:n})=>{const a=(0,i.Z1)(e,t);if(!a)return{};const o=(0,i.$W)(e,t,s,n),r="scheduled"===n?(0,i.Fn)(e,t):(0,i.Zw)(e,t),c=(0,i.qS)(e,t,s);if(s!==u._f&&!(r&&c&&r[c]))return{};const{isRestricted:l,restrictionReason:h,lastMessage:m}=a,g=(0,i.G$)(e,t),f=s===u._f&&!o&&!a.unreadCount&&!g&&m&&!m.groupedId,p=(0,i.IK)(e,t);let I;return(0,i.pk)(e,t)&&(I=p.fullInfo?p.fullInfo.botDescription||"NoMessages":"Updating bot info..."),{isChatLoaded:!0,isRestricted:l,restrictionReason:h,isChannelChat:(0,d.eA)(a),isGroupChat:(0,d.Bf)(a),isCreator:a.isCreator,isChatWithSelf:(0,i.FM)(e,t),isBot:Boolean(p),messageIds:o,messagesById:r,firstUnreadId:(0,i.It)(e,t,s),isViewportNewest:"thread"!==n||(0,i.b9)(e,t,s),threadFirstMessageId:(0,i.yZ)(e,t,s),focusingId:g,isSelectModeActive:(0,i.CA)(e),botDescription:I,threadTopMessageId:c,hasLinkedChat:a.fullInfo&&"linkedChatId"in a.fullInfo?Boolean(a.fullInfo.linkedChatId):void 0,...f&&{lastMessage:m}}}),((e,t)=>(0,g.ei)(t,["loadViewportMessages","setScrollOffset","openHistoryCalendar"])))((({chatId:e,threadId:t,type:s,hasTools:r,onFabToggle:c,onNotchToggle:l,isChatLoaded:u,isChannelChat:m,isGroupChat:f,canPost:p,isReady:I,isActive:v,isChatWithSelf:y,isCreator:P,isBot:C,messageIds:w,messagesById:b,firstUnreadId:M,isViewportNewest:S,threadFirstMessageId:E,isRestricted:k,restrictionReason:R,focusingId:T,isSelectModeActive:N,loadViewportMessages:B,setScrollOffset:x,lastMessage:A,botDescription:L,threadTopMessageId:O,hasLinkedChat:F,openHistoryCalendar:U})=>{var $,Q,D,q,G,H;const j=(0,o.sO)(null),_=(0,o.sO)("thread"===s&&(0,i.Vt)((0,n.Rd)(),e,t)||0),V=(0,o.sO)(),W=(0,o.sO)(),K=(0,o.sO)(),X=(0,o.sO)(),Y=(0,o.sO)(),z=(0,o.sO)(),J=(0,o.sO)(!1),ee=(0,o.sO)(Boolean(A)),[te,se]=(0,o.eJ)(),ne=Boolean(w);(0,he.Z)((()=>{ne&&(0,Z.R3)((()=>{ee.current=!1}))}),[ne]),(0,he.Z)((()=>{X.current=M}),[M]),(0,he.Z)((()=>{ne&&(Y.current=X.current)}),[ne]),(0,he.Z)((()=>{z.current=T}),[T]);const ae=(0,o.Ye)((()=>{if(!w||!b)return;const e=!O||w[0]&&E!==w[0]?w:[O,...w];if(!e.length)return;const t=e.map((e=>b[e])).filter(Boolean);return xt((0,g.Xo)(t,["date","id"]),Y.current)}),[w,b,E,O]),oe=(0,o.Ye)((()=>{if("thread"===s)return(0,Z.Ds)((()=>B({direction:h.Uq.Around})),1e3,!0,!1)}),[B,w]),{isScrolled:ce,updateStickyDates:de}=function(){const[e,t]=(0,ye.Z)(!1),s=(0,o.Ye)((()=>(0,Z.Ds)((e=>e()),1e3,!1,n)),[1e3,!1,n]);var n;return{isScrolled:e,updateStickyDates:(0,o.I4)(((e,n)=>{t(),document.body.classList.contains("is-scrolling-messages")||(0,Z.T2)((()=>{document.body.classList.add("is-scrolling-messages")})),s((()=>{(0,Z.T2)((()=>{const t=document.querySelector(".stuck");t&&t.classList.remove("stuck");const s=function(e,t){const s=e.querySelectorAll(".sticky-date"),n=e.scrollTop;return Array.from(s).find((e=>{const{offsetTop:s,offsetHeight:a}=e,o=s-n;return-a<=o&&o<=(t?60:10)}))}(e,n);s&&s.classList.add("stuck"),document.body.classList.remove("is-scrolling-messages")}))}))}),[t,s])}}(),le=(0,o.I4)((()=>{if(J.current)return void(J.current=!1);const n=j.current;z.current||de(n,r),an((()=>{(0,Z.T2)((()=>{n.parentElement&&(_.current=n.scrollHeight-n.scrollTop,"thread"===s&&x({chatId:e,threadId:t,scrollOffset:_.current}))}))}))}),[de,r,s,x,e,t]);(0,o.d4)((()=>{if(!("ResizeObserver"in window))return;const e=new ResizeObserver((([e])=>{e.target.offsetParent&&se(e.contentRect.height)}));return e.observe(j.current),()=>{e.disconnect()}}),[]);const{height:ue}=at();(0,o.d4)((()=>{I&&(j.current.dataset.normalHeight=String(j.current.offsetHeight))}),[ue,I,p]),(0,o.d4)((()=>{if(!oe||!u||k||T)return;if(w&&w[0]>=a.AE)return;const e=j.current;(!w||w.length{if(!w||!K.current||!I)return;const e=K.current.filter((e=>w.includes(Number(e.dataset.messageId)))),t=e[1]||e[0];t&&(V.current=t.id,W.current=t.getBoundingClientRect().top)}),[w,S,te,r,I]),(0,Tt.Z)((([e,t,s])=>{const n=j.current;if(K.current=Array.from(n.querySelectorAll(".message-list-item")),!n.offsetParent)return;const o=S&&w&&w.length{n.parentElement&&n.parentElement.classList.remove("force-messages-scroll")}),1e3));const i=w&&e&&w[w.length-1]!==e[e.length-1],c=(null==w?void 0:w[0])!==(null==e?void 0:e[0])&&(null==w?void 0:w.length)===a.hT/2+1,d=i&&!c,l=w&&z.current===w[w.length-1],{scrollTop:u,scrollHeight:h,offsetHeight:m}=n,g=_.current,f=K.current[K.current.length-1];let p=g-(s||m);d&&(p-=f?f.offsetHeight:0);const I=S&&t&&p<=20;let v;if(d&&I&&!l&&(f&&(0,Z.T2)((()=>{(0,Ot.Z)(n,f,"end",20)})),v=h-m,_.current=Math.max(h-v,m),!o))return;const y=void 0!==s&&s!==te,P=V.current&&n.querySelector(`#${V.current}`),C=!P&&Y.current&&n.querySelector(".unread-divider");if(I&&y){if((0,Ot.N)())return;v=h-m}else v=P?u+(P.getBoundingClientRect().top-(W.current||0)):C?Math.min(C.offsetTop-(r?60:10),h-g):h-g;(0,Lt.Z)(n,v),z.current||(J.current=!0,(0,Z.T2)((()=>{J.current=!1}))),_.current=Math.max(h-v,m)}),[w,S,te,r]),(0,Nt.Z)((([e])=>{void 0!==e&&(0,re.YW)(200+a.fK)}),[N]);const me=(0,Ze.Z)(),ge=Boolean(e&&(0,d.YA)(e)),fe=Boolean(!ge&&!m||y),pe=Boolean(!fe||m),Ie=(0,d.YA)(e)&&!y&&!C&&(!ae&&!A&&w&&(!K.current||0===K.current.length)||1===(null==w?void 0:w.length)&&"contactSignUp"===(null==b||null===($=b[w[0]])||void 0===$||null===(Q=$.content.action)||void 0===Q?void 0:Q.type)||"contactSignUp"===(null==A||null===(D=A.content)||void 0===D||null===(q=D.action)||void 0===q?void 0:q.type)),ve=f&&P&&1===(null==w?void 0:w.length)&&"chatCreate"===(null==b||null===(G=b[w[0]])||void 0===G||null===(H=G.content.action)||void 0===H?void 0:H.type),Pe=(0,ie.Z)("MessageList custom-scroll",pe&&"no-avatars",!p&&"no-composer","pinned"===s&&"type-pinned",N&&"select-mode-active",ce&&"scrolled",!I&&"is-animating");return o.ZP.createElement("div",{ref:j,className:Pe,onScroll:le,onMouseDown:At.q},k?o.ZP.createElement("div",{className:"empty"},o.ZP.createElement("span",null,R?R.text:"This is a private "+(m?"channel":"chat"))):L?o.ZP.createElement("div",{className:"empty rich"},o.ZP.createElement("span",null,(0,It.Z)(me(L),["br","emoji","links"]))):Ie?o.ZP.createElement(sn,{userId:e}):!w||ae&&!ve?w&&ae||A?o.ZP.createElement(en,{messageIds:w||[A.id],messageGroups:ae||xt([A]),isViewportNewest:Boolean(S),isUnread:Boolean(M),withUsers:fe,noAvatars:pe,containerRef:j,anchorIdRef:V,memoUnreadDividerBeforeIdRef:Y,memoFirstUnreadIdRef:X,threadId:t,type:s,isActive:v,threadTopMessageId:O,hasLinkedChat:F,isSchedule:!!ae&&"scheduled"===s,noAppearanceAnimation:!ae||!ee.current,onFabToggle:c,onNotchToggle:l,openHistoryCalendar:U}):o.ZP.createElement(Ue.Z,{color:"white"}):o.ZP.createElement(nn,{chatId:e,type:s,isChatWithSelf:y,isGroupChatJustCreated:ve}))}))),rn=(0,o.X$)((0,n.c$)((e=>{const t=(0,i.Bt)(e);if(!t)return{};const{chatId:s,threadId:n,type:a}=t,o=(0,i.Z1)(e,s);return{messageListType:a,unreadCount:o&&n===u._f&&"thread"===a?o.unreadCount:void 0}}),((e,t)=>(0,g.ei)(t,["focusNextReply"])))((({isShown:e,canPost:t,messageListType:s,unreadCount:n,focusNextReply:a})=>{const r=(0,Ze.Z)(),i=(0,o.sO)(null),c=(0,o.I4)((()=>{if(e)if("thread"===s)a();else{const e=i.current.parentElement.querySelector(".MessageList"),t=e.querySelectorAll(".message-list-item"),s=t[t.length-1];if(!s)return;(0,Ot.Z)(e,s,"end",20)}}),[e,s,a]),d=(0,ie.Z)("ScrollDownButton",e&&"revealed",!t&&"no-composer");return o.ZP.createElement("div",{ref:i,className:d},o.ZP.createElement("div",{className:"ScrollDownButton-inner"},o.ZP.createElement(be.Z,{color:"secondary",round:!0,onClick:c,ariaLabel:r("AccDescrPageDown")},o.ZP.createElement("i",{className:"icon-arrow-down"})),Boolean(n)&&o.ZP.createElement("div",{className:"unread-count"},(0,ut.bi)(n))))})));var cn=s(5723),dn=s(6980);const ln=1280;async function un(e,t,s,n){const a=URL.createObjectURL(t),{type:o,size:r}=t;let i,c;if(o.startsWith("image/"))if(s){const s=await(0,st.pt)(a),{width:r,height:c}=s;if(r>ln||c>ln||"image/jpeg"!==o){const o=await function(e){return new Promise((t=>{const s=document.createElement("canvas"),n=s.getContext("2d");let{width:a,height:o}=e;(a>ln||o>ln)&&(a>=o?(o*=ln/a,a=ln):(a*=ln/o,o=ln)),s.width=a,s.height=o,n.drawImage(e,0,0,e.width,e.height,0,0,a,o),s.toBlob(t,"image/jpeg",100)}))}(s);return o?(URL.revokeObjectURL(a),un(e,o,!0,n)):un(e,t,!1,n)}i={width:r,height:c}}else c=a;else if(o.startsWith("video/")){if(r<10485760){const{videoWidth:e,videoHeight:t,duration:s}=await(0,st.jj)(a);i={width:e,height:t,duration:s}}c=await(0,st.ud)(a)}return{blobUrl:a,filename:e,mimeType:o,size:r,quick:i,previewBlobUrl:c,...n}}var hn=s(6391);let mn;function gn(e){mn.focus(),e.focus()}m.cj&&(mn=document.createElement("input"),mn.classList.add("for-ios-autocapitalization-fix"),document.body.appendChild(mn));const fn={encoderPath:s.p+"c0155344d336103c2b6a0b28cc510750.js",reuseWorker:!0},pn={type:"audio/ogg"};let In,vn,yn;async function Zn(){return In||(In=s.e(161).then(s.t.bind(s,1161,23)),vn=(await In).default,yn=new vn(fn)),In}async function Pn(e){await async function(){await Zn(),await yn.start()}();const t=Date.now();let s;const n=[],a=[];yn.ondataavailable=e=>{n.push(e)};const o=function(t,s){const n=t.sourceNode,o=n.context.createAnalyser();o.fftSize=64,n.connect(o);const r=o.frequencyBinCount,i=new Uint8Array(r);let c=!1;return function t(){if(c)return;o.getByteFrequencyData(i);const s=i.reduce(((e,t)=>e+t),0)/r/255;(t=>{a.push(255*t),e(t)})(s<.1?0:s),requestAnimationFrame(t)}(),()=>{c=!0}}(yn);return{stop:()=>new Promise(((e,r)=>{yn.onstop=()=>{e({blob:new Blob(n,pn),duration:Math.round(((s||Date.now())-t)/1e3),waveform:a})},yn.onerror=r;const i=Math.max(0,t+1e3-Date.now());setTimeout((()=>{yn.stop(),o()}),i)})),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout((()=>{yn.pause(),s=Date.now(),o()}),e)}}}const Cn=["image/png","image/jpeg","image/gif"];function wn(e){const{text:t,entities:s}=e||{};if(!t)return"";const n=(0,Dt.H)(t,s,void 0,void 0,!0);return Array.isArray(n)?n.join(""):n}let bn,Mn;var Sn=s(4784),En=s(8353),kn=s(2365);const Rn=document.createElement("div"),Tn=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/i,Nn=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+\n{2,}/i;const Bn=(0,Z.P2)((e=>e()),500,!0),xn=/[\w\d_-]*/i,An=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"DeleteMessageModal",!t);return s?o.ZP.createElement(s,e):void 0}));function Ln(){return(Ln=Object.assign||function(e){for(var t=1;t{const s=(0,o.sO)(!1),n=(0,o.I4)((()=>{if(s.current=!0,Fn)return Fn=!1,void e();On&&(clearTimeout(On),On=void 0),On=window.setTimeout((()=>{s.current&&e()}),200)}),[e]),a=(0,o.I4)((()=>{s.current=!1}),[]);return o.ZP.createElement(be.Z,Ln({},t,{onMouseEnter:m.$b?void 0:n,onMouseLeave:m.$b?void 0:a,onClick:m.$b?e:void 0}))})),$n=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"AttachMenu",!t);return s?o.ZP.createElement(s,e):void 0})),Qn=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"SymbolMenu",!t);return s?o.ZP.createElement(s,e):void 0})),Dn=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"InlineBotTooltip",!t);return s?o.ZP.createElement(s,e):void 0})),qn=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"MentionTooltip",!t);return s?o.ZP.createElement(s,e):void 0})),Gn=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"CustomSendMenu",!t);return s?o.ZP.createElement(s,e):void 0})),Hn=e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"StickerTooltip",!t);return s?o.ZP.createElement(s,e):void 0};var jn=s(9830);const _n=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"BotCommandTooltip",!t);return s?o.ZP.createElement(s,e):void 0}));var Vn=s(6503);const Wn=(0,o.X$)((0,n.c$)(((e,{messageId:t})=>{const{chatId:s}=(0,i.Bt)(e)||{};return s?{message:(0,i.hj)(e,s,t)}:{}}),((e,t)=>(0,g.ei)(t,["clickInlineButton"])))((({isOpen:e,message:t,onClose:s,clickInlineButton:n})=>{const[a,r]=(0,Vn.Z)(e,s),{isKeyboardSingleUse:i}=t||{},[c,d,l]=(0,ye.Z)(!0),u=()=>{l(),s()};if((0,o.d4)((()=>{d()}),[d,t]),t&&t.keyboardButtons)return o.ZP.createElement(De.Z,{isOpen:e||c,autoClose:i,positionX:"right",positionY:"bottom",onClose:u,className:"BotKeyboardMenu",onCloseAnimationEnd:u,onMouseEnter:m.$b?void 0:a,onMouseLeave:m.$b?void 0:r},o.ZP.createElement("div",{className:"content"},t.keyboardButtons.map((e=>o.ZP.createElement("div",{className:"row"},e.map((e=>o.ZP.createElement(be.Z,{ripple:!0,disabled:"NOT_SUPPORTED"===e.type,onClick:()=>n({button:e})},e.text))))))))})));var Kn=s(3616),Xn=s(7891);const Yn=(0,o.X$)((0,n.c$)((e=>{const{chatId:t,threadId:s,type:n}=(0,i.Bt)(e)||{};if(!t||!s||!n)return{};const{currentUserId:a,forwardMessages:{fromChatId:o,toChatId:r,messageIds:c}}=e,l=(0,i.Yy)(e,t,s),u="scheduled"===n?(0,i.wU)(e,t):(0,i._$)(e,t,s),h=e.settings.byKey.animationLevel>=1,m=r===t;let g,f;if(l?g=(0,i.hj)(e,t,l):u?g=(0,i.kK)(e,t,s,n):m&&1===c.length&&(g=(0,i.hj)(e,o,c[0])),l&&g){const{forwardInfo:s}=g,n=t===a;s&&(s.isChannelPost||n)&&(f=(0,i.cv)(e,g)),f||(f=(0,i.Ur)(e,g))}else m&&(f=(0,d.YA)(o)?(0,i.dy)(e,o):(0,i.Z1)(e,o));return{replyingToId:l,editingId:u,message:g,sender:f,shouldAnimate:h,forwardedMessagesCount:m?c.length:void 0}}),((e,t)=>(0,g.ei)(t,["setReplyingToId","setEditingId","focusMessage","exitForwardMode"])))((({replyingToId:e,editingId:t,message:s,sender:n,shouldAnimate:a,forwardedMessagesCount:r,setReplyingToId:i,setEditingId:c,focusMessage:d,exitForwardMode:l})=>{const u=Boolean((e||t)&&s||n&&r),h=(0,Xn.Z)([r],r?300:void 0),{shouldRender:m,transitionClassNames:g}=(0,de.Z)(h&&u,void 0,!a,void 0,!a),f=(0,o.I4)((()=>{e?i({messageId:void 0}):t?c({messageId:void 0}):r&&l()}),[e,t,r,i,c,l]);(0,o.d4)((()=>u?(0,fe.Z)(f):void 0),[u,f]);const p=(0,o.I4)((()=>{d({chatId:s.chatId,messageId:s.id})}),[d,s]),I=(0,ie.Z)("ComposerEmbeddedMessage",g),v=r&&r>1?`${r} forwarded messages`:void 0;if(m)return o.ZP.createElement("div",{className:I},o.ZP.createElement("div",null,o.ZP.createElement(be.Z,{round:!0,faded:!0,color:"translucent",ariaLabel:"Cancel replying",onClick:f},o.ZP.createElement("i",{className:"icon-close"})),o.ZP.createElement(ss,{className:"inside-input",message:s,sender:n,customText:v,title:t?"Edit Message":void 0,onClick:p})))}))),zn=(0,o.X$)((e=>{const{attachments:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"AttachmentModal",!t.length);return s?o.ZP.createElement(s,e):void 0})),Jn=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"BotCommandMenu",!t);return s?o.ZP.createElement(s,e):void 0})),ea=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"PollModal",!t);return s?o.ZP.createElement(s,e):void 0})),ta=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"DropArea",!t);return s?o.ZP.createElement(s,e):void 0})),sa=new RegExp(a.FM,"i"),na=(0,o.X$)((0,n.c$)(((e,{chatId:t,threadId:s})=>{const n=(0,i.tV)(e,t,s);return{webPagePreview:e.webPagePreview,noWebPage:n}}),((e,t)=>(0,g.ei)(t,["loadWebPagePreview","clearWebPagePreview","toggleMessageWebPage"])))((({chatId:e,threadId:t,messageText:s,disabled:n,webPagePreview:a,noWebPage:r,loadWebPagePreview:i,clearWebPagePreview:c,toggleMessageWebPage:d})=>{const l=(0,o.Ye)((()=>{const{text:e,entities:t}=(0,dn.Z)(s),n=t&&t.find((({type:e})=>e===u.Vv.TextUrl));if(n)return n.url;const a=e.match(sa);return a?a[0]:void 0}),[s]);(0,o.d4)((()=>{l?i({text:l}):(c(),d({chatId:e,threadId:t}))}),[e,d,c,l,i,t]),(0,he.Z)((()=>{c(),d({chatId:e,threadId:t})}),[e]);const h=Boolean(a&&s.length&&!r&&!n),{shouldRender:m,transitionClassNames:g}=(0,de.Z)(h),f=(0,lt.Z)(a);if(!m||!f)return;const{photo:p,...I}=f,v={content:{webPage:I}};return o.ZP.createElement("div",{className:(0,ie.Z)("WebPagePreview",g)},o.ZP.createElement("div",null,o.ZP.createElement(be.Z,{round:!0,faded:!0,color:"translucent",ariaLabel:"Clear Webpage Preview",onClick:()=>{d({chatId:e,threadId:t,noWebPage:!0})}},o.ZP.createElement("i",{className:"icon-close"})),o.ZP.createElement(Fs,{message:v,inPreview:!0})))})));var aa=s(2898);const oa=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"CalendarModal",!t);return s?o.ZP.createElement(s,e):void 0})),ra=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"PaymentModal",!t);return s?o.ZP.createElement(s,e):void 0})),ia=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"ReceiptModal",!t);return s?o.ZP.createElement(s,e):void 0}));var ca;!function(e){e.Send="send",e.Record="record",e.Edit="edit"}(ca||(ca={}));const da=(0,o.X$)((0,n.c$)(((e,{chatId:t,threadId:s,messageListType:n})=>{var o,r;const c=(0,i.Z1)(e,t),l=c&&(0,i.Dg)(e,c),h=t!==a.FV?(0,i.IK)(e,t):void 0,m=Boolean(h),g=(0,i.FM)(e,t),f=m&&(0,i.FT)(e,t),p=(0,i.qy)(e,t),{language:I}=e.settings.byKey,v=e.emojiKeywords[a.pR],y=I!==a.pR?e.emojiKeywords[I]:void 0,Z=f?f.id:void 0,P=Z?(0,i.hj)(e,t,Z):void 0;return{editingMessage:(0,i.kK)(e,t,s,n),connectionState:e.connectionState,draft:(0,i.Ms)(e,t,s),chat:c,isChatWithBot:m,isChatWithSelf:g,canScheduleUntilOnline:!g&&!m&&c&&l&&(0,d.YA)(t)&&l.status&&Boolean(l.status.wasOnline),isRightColumnShown:(0,i.Jf)(e),isSelectModeActive:(0,i.CA)(e),withScheduledButton:s===u._f&&"thread"===n&&Boolean(null==p?void 0:p.length),shouldSchedule:"scheduled"===n,botKeyboardMessageId:Z,botKeyboardPlaceholder:null==P?void 0:P.keyboardPlaceholder,isForwarding:t===e.forwardMessages.toChatId,isPollModalOpen:e.isPollModalOpen,stickersForEmoji:e.stickers.forEmoji.stickers,groupChatMembers:null==c||null===(o=c.fullInfo)||void 0===o?void 0:o.members,topInlineBotIds:null===(r=e.topInlineBots)||void 0===r?void 0:r.userIds,currentUserId:e.currentUserId,usersById:e.users.byId,lastSyncTime:e.lastSyncTime,contentToBeScheduled:e.messages.contentToBeScheduled,isPaymentModalOpen:e.payment.isPaymentModalOpen,isReceiptModalOpen:Boolean(e.payment.receipt),shouldSuggestStickers:e.settings.byKey.shouldSuggestStickers,recentEmojis:e.recentEmojis,baseEmojiKeywords:null==v?void 0:v.keywords,emojiKeywords:null==y?void 0:y.keywords,serverTimeOffset:e.serverTimeOffset,inlineBots:e.inlineBots.byUsername,isInlineBotLoading:e.inlineBots.isLoading,chatBotCommands:c&&c.fullInfo&&c.fullInfo.botCommands,botCommands:h&&h.fullInfo?h.fullInfo.botCommands||!1:void 0}}),((e,t)=>(0,g.ei)(t,["sendMessage","editMessage","saveDraft","clearDraft","showDialog","setStickerSearchQuery","setGifSearchQuery","forwardMessages","openPollModal","closePollModal","closePaymentModal","clearReceipt","loadScheduledHistory","openChat","addRecentEmoji","sendInlineBotResult"])))((({dropAreaState:e,shouldSchedule:t,canScheduleUntilOnline:s,isReady:r,onDropHide:i,editingMessage:c,chatId:l,threadId:h,messageListType:g,draft:f,chat:p,connectionState:I,isChatWithBot:v,isChatWithSelf:y,isRightColumnShown:P,isSelectModeActive:C,isForwarding:w,isPollModalOpen:b,isPaymentModalOpen:M,isReceiptModalOpen:S,botKeyboardMessageId:E,botKeyboardPlaceholder:k,withScheduledButton:R,stickersForEmoji:T,groupChatMembers:N,topInlineBotIds:B,currentUserId:x,usersById:A,lastSyncTime:O,contentToBeScheduled:F,shouldSuggestStickers:U,baseEmojiKeywords:$,emojiKeywords:Q,serverTimeOffset:q,recentEmojis:G,inlineBots:H,isInlineBotLoading:j,botCommands:_,chatBotCommands:V,sendMessage:W,editMessage:K,saveDraft:X,clearDraft:Y,showDialog:z,setStickerSearchQuery:J,setGifSearchQuery:ee,forwardMessages:te,openPollModal:se,closePollModal:ne,loadScheduledHistory:ae,closePaymentModal:oe,openChat:re,clearReceipt:ce,addRecentEmoji:de,sendInlineBotResult:he})=>{const me=(0,Ze.Z)(),ge=(0,o.sO)(null),[pe,Ie]=(0,o.eJ)(""),ve=(0,o.sO)(),Pe=(0,fs.Z)(e),[Ce,we,Me]=(0,ye.Z)(),[Se,Ee]=(0,o.eJ)(),{width:ke}=nt.Z.get(),Re=(0,o.sO)(pe);(0,o.d4)((()=>{Re.current=pe}),[pe]),(0,o.d4)((()=>{ve.current=void 0}),[l]),(0,o.d4)((()=>{l&&O&&h===u._f&&r&&ae()}),[r,l,ae,O,h]),(0,o.bt)((()=>{ge.current&&(ge.current.innerHTML='')}),[]),(0,o.d4)((()=>{F&&(Ee(F),we())}),[F,we]);const[Ne,Be]=(0,o.eJ)([]),[xe,Ae,Le]=(0,ye.Z)(),[Oe,Fe,Ue]=(0,ye.Z)(),[$e,Qe,De]=(0,ye.Z)(),[qe,Ge,He]=(0,ye.Z)(),[je,_e,Ve]=(0,ye.Z)(),[We,Ke]=(0,ye.Z)(),[Xe,Ye,ze]=(0,ye.Z)(),{startRecordingVoice:Je,stopRecordingVoice:tt,pauseRecordingVoice:st,activeVoiceRecording:at,currentRecordTime:ot,recordButtonRef:rt,startRecordTimeRef:it}=(()=>{const e=(0,o.sO)(null),[t,s]=(0,o.eJ)(),n=(0,o.sO)(),[a,r]=(0,o.eJ)();(0,o.d4)((()=>{m.cj&&m.mh&&Zn()}),[]);const i=(0,o.I4)((async()=>{try{const{stop:t,pause:a}=await Pn((t=>{e.current&&(n.current&&Date.now()%4==0&&(e.current.style.boxShadow=`0 0 0 ${50*(t||0)}px rgba(0,0,0,.15)`),r(Date.now()))}));n.current=Date.now(),r(Date.now()),s({stop:t,pause:a})}catch(e){console.error(e)}}),[]),c=(0,o.I4)((()=>{if(t){e.current&&(e.current.style.boxShadow="none");try{return t.pause()}catch(e){return void console.error(e)}}}),[t]),d=(0,o.I4)((()=>{if(t){s(void 0),n.current=void 0,r(void 0),e.current&&(e.current.style.boxShadow="none");try{return t.stop()}catch(e){return void console.error(e)}}}),[t]);return(0,o.d4)((()=>t?(0,fe.Z)(d):void 0),[t,d]),{startRecordingVoice:i,pauseRecordingVoice:c,stopRecordingVoice:d,activeVoiceRecording:t,currentRecordTime:a,recordButtonRef:e,startRecordTimeRef:n}})(),ct=c?ca.Edit:!m.mh||at||pe&&!Ne.length||w?ca.Send:ca.Record,dt=!t,{isMentionTooltipOpen:lt,closeMentionTooltip:ut,insertMention:ht,mentionFilteredUsers:mt}=(0,kn.Z)(!Ne.length,pe,Ie,void 0,N,B,x,A),{isOpen:gt,id:ft,isGallery:pt,switchPm:vt,results:yt,closeTooltip:Zt,help:Pt,loadMore:Ct}=function(e,t,s,a){const[r,i,c]=(0,ye.Z)(),d=function(e){return Rn.innerHTML=e.replace(/
/g,"\n"),Rn.innerText}(s),{queryInlineBot:l,resetInlineBot:u}=(0,n.uC)(),{username:h,query:m,canShowHelp:g}=function(e){const t=e.match(Tn);return t?{username:t[1],query:t[2],canShowHelp:""===t[2]&&!e.match(Nn)}:{username:"",query:"",canShowHelp:!1}}(d),f=h.toLowerCase(),p=(0,fs.Z)(m),I=(0,fs.Z)(h),v=null==a?void 0:a[f],{id:y,switchPm:Z,offset:P,results:C,isGallery:w,help:b}=v||{};(0,o.d4)((()=>{p!==m&&c()}),[p,m,c]),(0,o.d4)((()=>{e&&f&&t&&l({chatId:t,username:f,query:m})}),[m,e,l,t,f]);const M=(0,o.I4)((()=>{l({chatId:t,username:f,query:m,offset:P})}),[P,t,m,l,f]);return(0,o.d4)((()=>{e&&y&&(Z||null!=C&&C.length)?i():c()}),[y,e,i,C,Z,c]),I!==h&&u({username:I}),{isOpen:r,closeTooltip:c,loadMore:M,username:h,id:y,isGallery:w,switchPm:Z,results:C,help:g&&b?`@${h} ${b}`:void 0}}(Boolean(!Ne.length&&O),l,pe,H),{isOpen:wt,close:bt,filteredBotCommands:Mt}=function(e,t,s,n){const[a,r,i]=(0,ye.Z)(),[c,d]=(0,o.eJ)(),l=(0,o.I4)((e=>{s||n?Bn((()=>{const t=(s||n||[]).filter((({command:t})=>!e||t.includes(e)));d(t&&t.length?t:void 0)})):d(void 0)}),[s,n]);return(0,o.d4)((()=>{if(e&&t.length)if(t.startsWith("/")){const e=t.substr(1).match(xn);l(e?e[0]:"")}else i();else i()}),[l,t,e,i]),(0,o.d4)((()=>{c&&c.length?r():i()}),[c,r,i]),{isOpen:a,close:i,filteredBotCommands:c}}(Boolean(_&&_.length||V&&V.length),pe,_,V),{isContextMenuOpen:St,handleContextMenu:Et,handleContextMenuClose:kt,handleContextMenuHide:Rt}=(0,Qt.Z)(rt,!(ct===ca.Send&&dt)),Tt=(0,o.Ye)((()=>(0,d.H5)(p,v)),[p,v]),Nt=p&&(0,d.Nl)(p),Bt=(0,d.Hd)(p),{isStickerTooltipOpen:xt,closeStickerTooltip:At}=function(e,t,s,a=!1){const{loadStickersForEmoji:r,clearStickersForEmoji:i}=(0,n.uC)(),c=m.op&&1===(0,Sn.Z)(t)||!m.op&&Boolean(t.match(/^]*?>$/g)),d=Boolean(s)&&c;return(0,o.d4)((()=>{a||(e&&c?r({emoji:t}):!d&&c||i())}),[t,c,i,r,e,a]),{isStickerTooltipOpen:d,closeStickerTooltip:i}}(Boolean(U&&Tt.canSendStickers&&!Ne.length),pe,T,!r),{isEmojiTooltipOpen:Lt,closeEmojiTooltip:Ot,filteredEmojis:Ft,insertEmoji:Ut}=(0,En.Z)(Boolean(U&&Tt.canSendStickers&&!Ne.length),pe,G,void 0,Ie,$,Q,!r),$t=(0,o.I4)(((e,t=a.R2)=>{const s=window.getSelection(),n=document.getElementById(t),o=(0,It.Z)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"​");if(s.rangeCount){const e=s.getRangeAt(0);if((0,hn.R)(e,t))return function(e){const t=window.getSelection();if(null!=t&&t.getRangeAt&&t.rangeCount){const s=t.getRangeAt(0);s.deleteContents();const n=s.createContextualFragment(e),a=n.lastChild;s.insertNode(n),a?(s.setStartAfter(a),s.setEndAfter(a)):s.collapse(!1),t.removeAllRanges(),t.addRange(s)}}(o),void n.dispatchEvent(new Event("input",{bubbles:!0}))}Ie(`${Re.current}${o}`),requestAnimationFrame((()=>{(0,cn.Z)(n)}))}),[]),Dt=(0,o.I4)((()=>{const e=window.getSelection();if(e.rangeCount){const t=e.getRangeAt(0);if((0,hn.R)(t,a.R2))return void document.execCommand("delete",!1)}Ie(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,document.body.appendChild(t);let s=t.lastChild;if(s.lastChild)for(;s.lastChild;)s=s.lastChild;const n=s.textContent.length,a=document.createRange(),o=window.getSelection();a.setStart(s,n),a.setEnd(s,n),o.removeAllRanges(),o.addRange(a),document.execCommand("delete",!1);const r=t.innerHTML;return document.body.removeChild(t),r}(Re.current))}),[]),qt=(0,o.I4)(((e=!1)=>{e||Ie(""),Be([]),At(),Me(),Ee(void 0),ut(),Ot(),m.wB?setTimeout((()=>He()),350):He()}),[At,Me,ut,Ot,He]),Gt=(0,o.sO)();Gt.current=tt,(0,o.d4)((()=>()=>{Gt.current(),qt()}),[l,qt,Gt]);const Ht=((e,t,s,n,r,i)=>((0,o.d4)((()=>{s?(t(wn(s.content.text)),requestAnimationFrame((()=>{const e=document.getElementById(a.R2);(0,cn.Z)(e,!0)}))):t("")}),[s,t]),(0,o.I4)((()=>{const{text:t,entities:a}=(0,dn.Z)(e.current);s&&(t||(0,d.u8)(s)?(i({messageId:s.id,text:t,entities:a}),n()):r())}),[i,s,e,r,n])))(Re,Ie,c,qt,_e,K);((e,t,s,n,r,i,c,d,l)=>{const u=(0,o.I4)(((e,t)=>{r.current.length&&!c?d({chatId:e,threadId:t,draft:(0,dn.Z)(r.current)}):l({chatId:e,threadId:t})}),[l,c,r,d]),h=(0,o.Ye)((()=>(0,Z.Ds)((e=>e()),a.r_,!1)),[t]),g=(0,fs.Z)(t),f=(0,fs.Z)(s);(0,o.d4)((()=>(bn=t,Mn=s,()=>{bn=void 0,Mn=void 0,u(t,s)})),[t,s,u]),(0,o.d4)((()=>{t===g&&s===f||e&&(i(wn(e)),m.$b||requestAnimationFrame((()=>{const e=document.getElementById(a.R2);(0,cn.Z)(e,!0)})))}),[t,s,e,i,u,g,f]);const p=(0,fs.Z)(n);(0,o.d4)((()=>{t&&s&&g===t&&f===s&&p!==n&&(n.length?h((()=>{bn===t&&Mn===s&&u(t,s)})):u(t,s))}),[t,n,g,p,f,h,s,u]);const I=(0,o.I4)((()=>{t&&s&&u(t,s)}),[t,s,u]);(0,le.Z)(I),ue(I)})(f,l,h,pe,Re,Ie,c,X,Y),((e,t,s)=>{(0,o.d4)((()=>{async function n(n){if(!n.clipboardData)return;const o=document.activeElement;if(o&&![a.R2,a.nY].includes(o.id))return;const{items:r}=n.clipboardData,i=Array.from(r).find((e=>Cn.includes(e.type))),c=i&&i.getAsFile(),d=n.clipboardData.getData("text").substring(0,4096);if(c||d){if(n.preventDefault(),c&&!s){const e=await un(c.name,c,!0);t((t=>[...t,e]))}d&&e(d,null==o?void 0:o.id)}}return document.addEventListener("paste",n,!1),()=>{document.removeEventListener("paste",n,!1)}}),[e,s,t])})($t,Be,c);const jt=(0,o.I4)((async(e,t)=>{Be(await Promise.all(e.map((e=>un(e.name,e,t)))))}),[]),_t=(0,o.I4)((async(e,t)=>{Be([...Ne,...await Promise.all(e.map((e=>un(e.name,e,t))))])}),[Ne]),Vt=(0,o.I4)((()=>{Be([])}),[]),Wt=(0,o.I4)((async(e=!1,t)=>{if("connectionStateReady"!==I)return;let s=Ne;if(at){const e=await tt();if(e){const{blob:t,duration:n,waveform:a}=e;s=[await un("wonderful-voice-message.ogg",t,!1,{voice:{duration:n,waveform:a}})]}}const{text:n,entities:o}=(0,dn.Z)(Re.current);if(!s.length&&!n&&!w)return;const r=s.length?1024:4096;if((null==n?void 0:n.length)>r){const e=n.length-r;return void z({data:{message:"MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS",textParams:{"{EXTRA_CHARS_COUNT}":e,"{PLURAL_S}":e>1?"s":""},hasErrorKey:!0}})}const i=document.getElementById(a.R2);if(s.length||n){if(Bt&&!Nt){const e=(0,D.b)(q),t=ve.current&&Math.floor(e-ve.current),s=Bt.nextSendDate&&Bt.nextSendDate>e;if(t&&t{qt()}))}),[I,Ne,at,w,Y,l,q,qt,tt,z,Bt,Nt,W,te,me]),Kt=(0,o.I4)((()=>{He(),Fe()}),[He,Fe]),Xt=(0,o.I4)((()=>{Ue(),Ge()}),[Ue,Ge]),Yt=(0,o.I4)(((e,s=!1)=>{e={...e,isPreloadedGlobally:!0},t?(Ee({sticker:e}),we()):(W({sticker:e}),requestAnimationFrame((()=>{qt(s)})))}),[t,we,W,qt]),zt=(0,o.I4)((e=>{t?(Ee({gif:e}),we()):(W({gif:e}),requestAnimationFrame((()=>{qt(!0)})))}),[t,we,W,qt]),Jt=(0,o.I4)((e=>{if("connectionStateReady"!==I)return;he({id:e.id,queryId:e.queryId});const t=document.getElementById(a.R2);m.cj&&t===document.activeElement&&gn(t),Y({chatId:l,localOnly:!0}),requestAnimationFrame((()=>{qt()}))}),[l,Y,I,qt,he]),es=(0,o.I4)((()=>{Y({chatId:l,localOnly:!0}),requestAnimationFrame((()=>{qt()}))}),[l,Y,qt]),ts=(0,o.I4)((e=>{t?(Ee({poll:e}),ne(),we()):(W({poll:e}),ne())}),[ne,we,W,t]),ss=(0,o.I4)((()=>{t?(Ee({isSilent:!0}),we()):Wt(!0)}),[Wt,we,t]),ns=(0,o.I4)(((e,t=!1)=>{const{isSilent:s,...n}=Se||{},a=Math.round(Math.max(e.getTime(),Date.now()+6e4)/1e3)+(t?0:q);Se&&0!==Object.keys(n).length?(W({...Se,scheduledAt:a}),requestAnimationFrame((()=>{qt()}))):Wt(!!s,a),Me()}),[Me,Wt,qt,Se,W,q]),as=(0,o.I4)((()=>{ns(new Date(1e3*a.t4),!0)}),[ns]),os=(0,o.I4)((()=>{Me(),Ee(void 0)}),[Me]),rs=(0,o.I4)((e=>{"stickers"===e?(J({query:""}),ee({query:void 0})):(ee({query:""}),J({query:void 0}))}),[J,ee]),is=(0,o.I4)((()=>{const e=document.getElementById(a.R2);m.wB&&e===document.activeElement?(e.blur(),setTimeout((()=>{Ue(),Ge()}),100)):Ge()}),[Ge,Ue]),cs=(0,o.I4)((()=>{re({id:l,threadId:h,type:"scheduled"})}),[re,l,h]);(0,o.d4)((()=>{P&&m.wB&&He()}),[P,He]),(0,o.d4)((()=>{r&&(C?Ye():setTimeout((()=>{ze()}),200))}),[C,ze,Ye,r]);const ds=(0,o.I4)((()=>{switch(ct){case ca.Send:t?(at&&st(),we()):Wt();break;case ca.Record:Je();break;case ca.Edit:Ht()}}),[ct,t,Je,Ht,at,we,st,Wt]),ls=ct===ca.Record&&!Tt.canAttachMedia,us=(0,fs.Z)(c,!0),hs=c||us,ms=new Date;ms.setSeconds(0),ms.setMilliseconds(0);const gs=new Date;gs.setFullYear(gs.getFullYear()+1);let ps="SendMessage";switch(ct){case ca.Edit:ps="Save edited message";break;case ca.Record:ps=ls?"Conversation.DefaultRestrictedMedia":"AccDescrVoiceMessage"}const Is=(0,ie.Z)("Composer",!C&&"shown",Xe&&"hover-disabled"),vs=(0,ie.Z)("mobile-symbol-menu-button",!r&&"not-ready",We?qe&&"menu-opened":qe&&"is-loading"),ys=ct===ca.Edit?Ht:t?we:Wt;return o.ZP.createElement("div",{className:Is},Tt.canAttachMedia&&r&&o.ZP.createElement(aa.Z,{containerId:"#middle-column-portals"},o.ZP.createElement(ta,{isOpen:e!==et.t.None,withQuick:[e,Pe].includes(et.t.QuickFile),onHide:i,onFileSelect:jt})),o.ZP.createElement(zn,{attachments:Ne,caption:Ne.length?pe:"",groupChatMembers:N,currentUserId:x,usersById:A,recentEmojis:G,isReady:r,onCaptionUpdate:Ie,baseEmojiKeywords:$,emojiKeywords:Q,addRecentEmoji:de,onSend:t?we:Wt,onFileAppend:_t,onClear:Vt}),o.ZP.createElement(ea,{isOpen:Boolean(b),onClear:ne,onSend:ts}),o.ZP.createElement(ra,{isOpen:Boolean(M),onClose:oe}),o.ZP.createElement(ia,{isOpen:Boolean(S),onClose:ce}),hs&&o.ZP.createElement(An,{isOpen:je,isSchedule:"scheduled"===g,onClose:Ve,message:hs}),o.ZP.createElement(qn,{isOpen:lt,onClose:ut,onInsertUserName:ht,filteredUsers:mt,usersById:A}),o.ZP.createElement(Dn,{isOpen:gt,botId:ft,allowedAttachmentOptions:Tt,isGallery:pt,inlineBotResults:yt,switchPm:vt,onSelectResult:Jt,loadMore:Ct,onClose:Zt}),o.ZP.createElement(_n,{isOpen:wt,withUsername:Boolean(V),botCommands:Mt,onClick:es,onClose:bt}),o.ZP.createElement("div",{id:"message-compose"},o.ZP.createElement("div",{className:"svg-appendix",ref:ge}),o.ZP.createElement(Yn,null),o.ZP.createElement(na,{chatId:l,threadId:h,messageText:Ne.length?"":pe,disabled:!Tt.canAttachEmbedLinks}),o.ZP.createElement("div",{className:"message-input-wrapper"},v&&!1!==_&&!at&&!c&&o.ZP.createElement(Un,{className:(0,ie.Z)("bot-commands",Oe&&"activated"),round:!0,faded:!0,disabled:void 0===_,color:"translucent",onActivate:Kt,ariaLabel:"Open bot command keyboard"},o.ZP.createElement("i",{className:"icon-bot-commands-filled"})),m.wB?o.ZP.createElement(be.Z,{className:vs,round:!0,faded:!0,color:"translucent",onClick:qe?He:is,ariaLabel:"Choose emoji, sticker or GIF"},o.ZP.createElement("i",{className:"icon-smile"}),o.ZP.createElement("i",{className:"icon-keyboard"}),qe&&!We&&o.ZP.createElement(Te.Z,{color:"gray"})):o.ZP.createElement(Un,{className:qe?"activated":"",round:!0,faded:!0,color:"translucent",onActivate:Xt,ariaLabel:"Choose emoji, sticker or GIF"},o.ZP.createElement("i",{className:"icon-smile"})),o.ZP.createElement(Kn.Z,{id:"message-input-text",html:Ne.length?"":pe,placeholder:at&&ke<=600?"":k||me("Message"),forcedPlaceholder:Pt,shouldSetFocus:!Ne.length,shouldSuppressFocus:m.wB&&qe,shouldSuppressTextFormatter:Lt||lt||gt,onUpdate:Ie,onSend:ys,onSuppressedFocus:He}),j&&Boolean(ft)&&o.ZP.createElement(Te.Z,{color:"gray"}),R&&o.ZP.createElement(be.Z,{round:!0,faded:!0,className:"scheduled-button",color:"translucent",onClick:cs,ariaLabel:"Open scheduled messages"},o.ZP.createElement("i",{className:"icon-schedule"})),E&&!at&&!c&&o.ZP.createElement(Un,{className:xe?"activated":"",round:!0,faded:!0,color:"translucent",onActivate:Ae,ariaLabel:"Open bot command keyboard"},o.ZP.createElement("i",{className:"icon-bot-command"})),!at&&!c&&o.ZP.createElement(Un,{className:$e?"activated":"",round:!0,faded:!0,color:"translucent",onActivate:Qe,ariaLabel:"Add an attachment"},o.ZP.createElement("i",{className:"icon-attach"})),at&&ot&&o.ZP.createElement("span",{className:"recording-state"},(0,L.rM)(ot-it.current)),o.ZP.createElement(Hn,{isOpen:xt,onStickerSelect:Yt}),o.ZP.createElement(jn.Z,{isOpen:Lt,emojis:Ft,onClose:Ot,onEmojiSelect:Ut,addRecentEmoji:de}),o.ZP.createElement($n,{isOpen:$e,allowedAttachmentOptions:Tt,onFileSelect:jt,onPollCreate:se,onClose:De}),E&&o.ZP.createElement(Wn,{messageId:E,isOpen:xe,onClose:Le}),_&&o.ZP.createElement(Jn,{isOpen:Oe,botCommands:_,onClose:Ue}),o.ZP.createElement(Qn,{isOpen:qe,allowedAttachmentOptions:Tt,onLoad:Ke,onClose:He,onEmojiSelect:$t,onStickerSelect:Yt,onGifSelect:zt,onRemoveSymbol:Dt,onSearchOpen:rs,addRecentEmoji:de}))),at&&o.ZP.createElement(be.Z,{round:!0,color:"danger",className:"cancel",onClick:tt,ariaLabel:"Cancel voice recording"},o.ZP.createElement("i",{className:"icon-delete"})),o.ZP.createElement(be.Z,{ref:rt,round:!0,color:"secondary",className:(0,ie.Z)(ct,!r&&"not-ready",at&&"recording"),disabled:ls,ariaLabel:me(ps),onClick:ds,onContextMenu:ct===ca.Send&&dt?Et:void 0},o.ZP.createElement("i",{className:"icon-send"}),o.ZP.createElement("i",{className:"icon-microphone-alt"}),o.ZP.createElement("i",{className:"icon-check"})),dt&&o.ZP.createElement(Gn,{isOpen:St,onSilentSend:y?void 0:ss,onScheduleSend:t?void 0:we,onClose:kt,onCloseAnimationEnd:Rt}),o.ZP.createElement(oa,{isOpen:Ce,withTimePicker:!0,selectedAt:ms.getTime(),maxAt:(0,L._F)(gs),isFutureMode:!0,secondButtonLabel:s?"Send When Online":void 0,onClose:os,onSubmit:ns,onSecondButtonClick:s?as:void 0}))}))),la=(0,o.X$)((e=>{const{isActive:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"MobileSearch",!t,!0);return s?o.ZP.createElement(s,e):void 0})),ua=(0,o.X$)((e=>{const{isActive:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"MessageSelectToolbar",!t);return s?o.ZP.createElement(s,e):void 0})),ha=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"UnpinAllMessagesModal",!t);return s?o.ZP.createElement(s,e):void 0})),ma=m.wB?450+a.fK:void 0;function ga(e){return"file"===e.kind&&e.type&&a.AK.has(e.type)}const fa=(0,o.X$)((0,n.c$)((e=>{const t=(0,i.Pu)(e),{isBlurred:s,background:n,backgroundColor:a,patternColor:o}=e.settings.themes[t]||{},{messageLists:r}=e.messages,c=(0,i.Bt)(e),{isLeftColumnShown:l,chats:{listIds:h}}=e,g={theme:t,customBackground:n,backgroundColor:a,patternColor:o,isLeftColumnShown:l,isRightColumnShown:(0,i.Jf)(e),isBackgroundBlurred:s,isMobileSearchActive:Boolean(m.wB&&(0,i.n5)(e)),isSelectModeActive:(0,i.CA)(e),animationLevel:e.settings.byKey.animationLevel,currentTransitionKey:Math.max(0,e.messages.messageLists.length-1)};if(!c||!h.active)return g;const{chatId:f,threadId:p,type:I}=c,v=(0,i.Z1)(e,f),y=(0,i.KB)(e,f),{chatId:Z,messageId:P}=e.audioPlayer,C=v&&(0,d.Qm)(v,p),w=(0,i.pk)(e,f),b="pinned"===I,M="scheduled"===I;return{...g,chatId:f,threadId:p,messageListType:I,isPrivate:(0,d.YA)(f),canPost:!b&&(!v||C)&&!w,isPinnedMessageList:b,isScheduledMessageList:M,currentUserBannedRights:null==v?void 0:v.currentUserBannedRights,defaultBannedRights:null==v?void 0:v.defaultBannedRights,hasPinnedOrAudioMessage:p!==u._f||Boolean(null==y?void 0:y.length)||Boolean(Z&&P),pinnedMessagesCount:y?y.length:0,shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations,messageLists:r}}),((e,t)=>(0,g.ei)(t,["openChat","unpinAllMessages","loadUser","closeLocalTextSearch","exitMessageSelectMode"])))((({chatId:e,threadId:t,messageListType:s,isPrivate:n,isPinnedMessageList:r,messageLists:i,canPost:c,currentUserBannedRights:l,defaultBannedRights:u,hasPinnedOrAudioMessage:h,pinnedMessagesCount:g,customBackground:f,theme:p,backgroundColor:I,patternColor:v,isLeftColumnShown:y,isRightColumnShown:Z,isBackgroundBlurred:P,isMobileSearchActive:C,isSelectModeActive:w,animationLevel:b,shouldSkipHistoryAnimations:M,currentTransitionKey:S,openChat:E,unpinAllMessages:k,loadUser:R,closeLocalTextSearch:T,exitMessageSelectMode:N})=>{const{width:B}=at(),x=(0,Ze.Z)(),[A,L]=(0,o.eJ)(et.t.None),[O,F]=(0,o.eJ)(),[U,$]=(0,o.eJ)(),[Q,D]=(0,o.eJ)(!1),[q,G]=(0,o.eJ)(!m.wB||b===a.oB),H=h&&(Ba._m&&B=a.ks&&Be?(0,fe.Z)((()=>{E({id:void 0})})):void 0),[e,E]),(0,o.d4)((()=>{L(et.t.None),F(void 0),$(void 0)}),[e]),(0,o.d4)((()=>{b===a.oB&&G(!0)}),[b]),(0,o.d4)((()=>{n&&R({userId:e})}),[e,n,R]);const Y=(0,o.I4)((e=>{if(m.$b)return;const{items:t}=e.dataTransfer||{},s=t&&Array.from(t).filter((e=>"text/uri-list"!==e.type)).every(ga);L(s?et.t.QuickFile:et.t.Document)}),[]),z=(0,o.I4)((()=>{L(et.t.None)}),[]),J=(0,o.I4)((()=>{D(!0)}),[]),ee=(0,o.I4)((()=>{D(!1)}),[]),te=(0,o.I4)((()=>{k({chatId:e}),ee(),E({id:e})}),[k,E,ee,e]),se=(0,o.I4)((()=>{E({id:e})}),[E,e]),ne=((e,t)=>{const[s,n]=(0,o.eJ)(t);return(0,o.d4)((()=>{t&&(t.startsWith("#")?n(t):tt.fetch(a.fo,e,tt.Type.Blob).then((e=>{const t=URL.createObjectURL(e);(0,st.pt)(t).then((()=>{n(`url(${t})`)}))})))}),[t,e]),t?s:void 0})(p,f),ae=(0,ie.Z)(K&&"has-header-tools",f&&"custom-bg-image",I&&"custom-bg-color",f&&P&&"blurred",m.aZ?"mask-image-disabled":"mask-image-enabled"),oe=(0,ie.Z)("messaging-disabled",!w&&"shown"),re=(0,d.q8)(x,l,u),{composerHiddenScale:ce,toolbarHiddenScale:de,composerTranslateX:le,toolbarTranslateX:ue,unpinHiddenScale:he,toolbarForUnpinHiddenScale:me}=(0,o.Ye)((()=>function(e,t){const s=e<=a.l3?16:32,n=function(e){if(e>a._m){const t=Math.min(Math.max(.25*e,288),424),s=Math.min(.25*e,424);return Math.min(e-t-s,rt)}if(e>a.ks){const t=Math.min(Math.max(.4*e,288),424);return Math.min(e-t,rt)}return e>rt?rt:e}(e),o=e<=a.l3?54:64,r=t?n-s-o:n-s,i=e>a.l3?Math.min(n-s,512):n-s,c=i/r,d=r/i;return{composerHiddenScale:c,toolbarHiddenScale:d,composerTranslateX:t?o/2*d:0,toolbarTranslateX:t?o/2*-1*c:0,unpinHiddenScale:i/258,toolbarForUnpinHiddenScale:258/i}}(B,W)),[W,B]),pe=(0,ie.Z)("middle-column-footer",!W&&"no-composer",W&&U&&!w&&"with-notch");return(0,ge.ZP)(j&&_,(()=>{E({id:void 0},!0)}),void 0,void 0,void 0,i?i.map(it):[]),(0,ge.ZP)(C,T),(0,ge.ZP)(w,N),o.ZP.createElement("div",{id:"MiddleColumn",className:ae,onTransitionEnd:t=>{"transform"===t.propertyName&&t.target===t.currentTarget&&G(Boolean(e))},style:`\n --composer-hidden-scale: ${ce};\n --toolbar-hidden-scale: ${de};\n --unpin-hidden-scale: ${he};\n --toolbar-unpin-hidden-scale: ${me};\n --composer-translate-x: ${le}px;\n --toolbar-translate-x: ${ue}px;\n --pattern-color: ${v};\n --theme-background-color:\n ${I||("dark"===p?a.It:a.p3)};\n `,onClick:m.p7&&y?se:void 0},o.ZP.createElement("div",{id:"middle-column-bg",style:ne?`--custom-background: ${ne}`:void 0}),o.ZP.createElement("div",{id:"middle-column-portals"}),j&&_&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("div",{className:"messages-layout",onDragEnter:W?Y:void 0},o.ZP.createElement(Rt,{chatId:j,threadId:_,messageListType:V,isReady:q}),o.ZP.createElement(Ie.Z,{name:M?"none":b===a.zy?"slide":"fade",activeKey:S,shouldCleanup:!0},(e=>o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(on,{key:`${j}-${_}-${V}`,chatId:j,threadId:_,type:V,canPost:W,hasTools:K,onFabToggle:F,onNotchToggle:$,isReady:q,isActive:e}),o.ZP.createElement("div",{className:pe},W&&o.ZP.createElement(da,{chatId:j,threadId:_,messageListType:V,dropAreaState:A,onDropHide:z,isReady:q}),r&&o.ZP.createElement("div",{className:"unpin-button-container",dir:x.isRtl?"rtl":void 0},o.ZP.createElement(be.Z,{size:"tiny",fluid:!0,color:"secondary",className:"unpin-all-button",onClick:J},o.ZP.createElement("i",{className:"icon-unpin"}),o.ZP.createElement("span",null,x("Chat.Pinned.UnpinAll",g,"i")))),!r&&!W&&re&&o.ZP.createElement("div",{className:oe},o.ZP.createElement("div",{className:"messaging-disabled-inner"},o.ZP.createElement("span",null,re))),o.ZP.createElement(ua,{messageListType:V,isActive:w,canPost:W}))))),o.ZP.createElement(rn,{isShown:X,canPost:W})),m.wB&&o.ZP.createElement(la,{isActive:Boolean(C)})),e&&o.ZP.createElement(ha,{isOpen:Q,chatId:e,pinnedMessagesCount:g,onClose:ee,onUnpin:te}))}))),pa=(0,Z.Ds)((e=>e()),200,!1);var Ia;!function(e){e[e.Profile=0]="Profile",e[e.MemberList=1]="MemberList",e[e.SharedMedia=2]="SharedMedia",e[e.Search=3]="Search",e[e.Management=4]="Management",e[e.ManageInitial=5]="ManageInitial",e[e.ManageChannelSubscribers=6]="ManageChannelSubscribers",e[e.ManageChatAdministrators=7]="ManageChatAdministrators",e[e.ManageChatPrivacyType=8]="ManageChatPrivacyType",e[e.ManageDiscussion=9]="ManageDiscussion",e[e.ManageGroupPermissions=10]="ManageGroupPermissions",e[e.ManageGroupRemovedUsers=11]="ManageGroupRemovedUsers",e[e.ManageGroupUserPermissionsCreate=12]="ManageGroupUserPermissionsCreate",e[e.ManageGroupUserPermissions=13]="ManageGroupUserPermissions",e[e.ManageGroupRecentActions=14]="ManageGroupRecentActions",e[e.ManageGroupAdminRights=15]="ManageGroupAdminRights",e[e.ManageGroupMembers=16]="ManageGroupMembers",e[e.StickerSearch=17]="StickerSearch",e[e.GifSearch=18]="GifSearch",e[e.PollResults=19]="PollResults",e[e.AddingMembers=20]="AddingMembers"}(Ia||(Ia={}));const va=(0,o.X$)((0,n.c$)(((e,{chatId:t,isProfile:s,isManagement:n})=>{const{query:a}=(0,i.n5)(e)||{},{query:o}=(0,i.y5)(e)||{},{query:r}=(0,i.yN)(e)||{},c=t?(0,i.Z1)(e,t):void 0,l=c&&(0,d.eA)(c);return{canManage:Boolean(!n&&s&&c&&!(0,i.FM)(e,c.id)&&((0,d.YA)(c.id)||((0,d.Nl)(c)||c.isCreator)&&!c.isNotJoined)),isChannel:l,messageSearchQuery:a,stickerSearchQuery:o,gifSearchQuery:r}}),((e,t)=>(0,g.ei)(t,["setLocalTextSearchQuery","setStickerSearchQuery","setGifSearchQuery","searchTextMessagesLocal","toggleManagement","openHistoryCalendar"])))((({isColumnOpen:e,isProfile:t,isSearch:s,isManagement:n,isStickerSearch:a,isGifSearch:r,isPollResults:i,isAddingChatMembers:c,profileState:d,managementScreen:l,canManage:u,isChannel:g,onClose:f,messageSearchQuery:p,stickerSearchQuery:I,gifSearchQuery:v,setLocalTextSearchQuery:y,setStickerSearchQuery:Z,setGifSearchQuery:P,searchTextMessagesLocal:C,toggleManagement:w,openHistoryCalendar:b,shouldSkipAnimation:M})=>{var S;const E=(0,o.sO)(null),k=(0,o.I4)((e=>{y({query:e}),e.length&&pa(C)}),[C,y]),R=(0,o.I4)((e=>{Z({query:e})}),[Z]),T=(0,o.I4)((e=>{P({query:e})}),[P]),[N,B]=(0,o.eJ)(!e);(0,o.d4)((()=>{setTimeout((()=>{B(!e)}),300)}),[e]);const x=(0,Ze.Z)(),A=t?d===h.vi.Profile?Ia.Profile:d===h.vi.SharedMedia?Ia.SharedMedia:d===h.vi.MemberList?Ia.MemberList:-1:s?Ia.Search:i?Ia.PollResults:a?Ia.StickerSearch:r?Ia.GifSearch:c?Ia.AddingMembers:n?l===h.u1.Initial?Ia.ManageInitial:l===h.u1.ChatPrivacyType?Ia.ManageChatPrivacyType:l===h.u1.Discussion?Ia.ManageDiscussion:l===h.u1.ChannelSubscribers?Ia.ManageChannelSubscribers:l===h.u1.GroupPermissions?Ia.ManageGroupPermissions:l===h.u1.ChatAdministrators?Ia.ManageChatAdministrators:l===h.u1.GroupRemovedUsers?Ia.ManageGroupRemovedUsers:l===h.u1.GroupUserPermissionsCreate?Ia.ManageGroupUserPermissionsCreate:l===h.u1.GroupUserPermissions?Ia.ManageGroupUserPermissions:l===h.u1.GroupRecentActions?Ia.ManageGroupRecentActions:l===h.u1.ChatAdminRights?Ia.ManageGroupAdminRights:l===h.u1.GroupMembers?Ia.ManageGroupMembers:void 0:void 0,O=null!==(S=(0,lt.Z)(A,!0))&&void 0!==S?S:-1;function F(){if(-1!==O)switch(O){case Ia.PollResults:return o.ZP.createElement("h3",null,x("PollResults"));case Ia.Search:return o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(Me.Z,{parentContainerClassName:"RightSearch",value:p,onChange:k}),o.ZP.createElement(be.Z,{round:!0,size:"smaller",color:"translucent",onClick:()=>b({selectedAt:(0,L._F)(Date.now())}),ariaLabel:"Search messages by date"},o.ZP.createElement("i",{className:"icon-calendar"})));case Ia.AddingMembers:return o.ZP.createElement("h3",null,x("GroupAddMembers"));case Ia.ManageInitial:return o.ZP.createElement("h3",null,x("Edit"));case Ia.ManageChatPrivacyType:return o.ZP.createElement("h3",null,x(g?"ChannelTypeHeader":"GroupTypeHeader"));case Ia.ManageDiscussion:return o.ZP.createElement("h3",null,x("Discussion"));case Ia.ManageChatAdministrators:return o.ZP.createElement("h3",null,x("ChannelAdministrators"));case Ia.ManageGroupRecentActions:return o.ZP.createElement("h3",null,x("Group.Info.AdminLog"));case Ia.ManageGroupAdminRights:return o.ZP.createElement("h3",null,x("EditAdminRights"));case Ia.ManageGroupPermissions:return o.ZP.createElement("h3",null,x("ChannelPermissions"));case Ia.ManageGroupRemovedUsers:return o.ZP.createElement("h3",null,x("ChannelBlockedUsers"));case Ia.ManageGroupUserPermissionsCreate:return o.ZP.createElement("h3",null,x("ChannelAddException"));case Ia.ManageGroupUserPermissions:return o.ZP.createElement("h3",null,x("UserRestrictions"));case Ia.StickerSearch:return o.ZP.createElement(Me.Z,{value:I,placeholder:x("SearchStickersHint"),onChange:R});case Ia.GifSearch:return o.ZP.createElement(Me.Z,{value:v,placeholder:x("SearchGifsTitle"),onChange:T});case Ia.SharedMedia:return o.ZP.createElement("h3",null,x("SharedMedia"));case Ia.ManageChannelSubscribers:return o.ZP.createElement("h3",null,x("ChannelSubscribers"));case Ia.MemberList:case Ia.ManageGroupMembers:return o.ZP.createElement("h3",null,x("GroupMembers"));default:return o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("h3",null,"Profile"),o.ZP.createElement("section",{className:"tools"},u&&o.ZP.createElement(be.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:x("Edit"),onClick:w},o.ZP.createElement("i",{className:"icon-edit"}))))}}const U=m.wB||A===Ia.SharedMedia||A===Ia.MemberList||A===Ia.AddingMembers||n,$=(0,ie.Z)("animated-close-icon",U&&"state-back",(N||M)&&"no-transition");return o.ZP.createElement("div",{className:"RightHeader"},o.ZP.createElement(be.Z,{className:"close-button",round:!0,color:"translucent",size:"smaller",onClick:f,ariaLabel:x(U?"Common.Back":"Common.Close")},o.ZP.createElement("div",{ref:E,className:$})),o.ZP.createElement(Ie.Z,{name:N||M?"none":"slide-fade",activeKey:O},F))})));var ya=s(7407);function Za(e,t,s,n,r,i){const c=(0,o.sO)();(0,he.Z)((()=>{t===e&&r&&i&&(c.current=(0,d.R5)(r,i,e).reverse())}),[r,i,t,e]);const[l,u]=(0,ya.Z)(n?s:void 0,c.current,void 0,"media"===e?a.EN:a.pn);return[l,u,!(!l||!c.current||l[0]===c.current[0])]}const Pa=(0,Z.P2)((e=>e()),250,!1);let Ca=!1;var wa=s(1273),ba=s(1876),Ma=s(787),Sa=s(180),Ea=s(3709),ka=s(5418),Ra=s(7262),Ta=s(1151),Na=s(3103);const Ba=(0,o.X$)((0,n.c$)(((e,{userId:t})=>{const s=(0,i.jr)(e),n=t&&(0,i.dy)(e,t);return{chat:s,contactName:n?(0,d.Vl)(n):void 0}}),((e,t)=>(0,g.ei)(t,["deleteChatMember"])))((({isOpen:e,chat:t,userId:s,contactName:n,onClose:a,deleteChatMember:r})=>{const i=(0,Ze.Z)(),c=(0,o.I4)((()=>{r({chatId:t.id,userId:s}),a()}),[t,r,a,s]);if(t&&s)return o.ZP.createElement(Na.Z,{isOpen:e,onClose:a,onEnter:c,className:"delete",title:i("GroupRemoved.Remove")},o.ZP.createElement("p",null,(0,It.Z)(i("PeerInfo.Confirm.RemovePeer",n))),o.ZP.createElement(be.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:c},i("lng_box_remove")),o.ZP.createElement(be.Z,{className:"confirm-dialog-button",isText:!0,onClick:a},i("Cancel")))}))),xa=[{type:"media",title:"SharedMediaTab2"},{type:"documents",title:"SharedFilesTab2"},{type:"links",title:"SharedLinksTab2"},{type:"audio",title:"SharedMusicTab2"}];function Aa(e){return[`.shared-media-transition > div:only-child > .${e}-list > .scroll-item`,`.shared-media-transition > div.active > .${e}-list > .scroll-item`].join(", ")}const La=(0,o.X$)((0,n.c$)(((e,{chatId:t,userId:s})=>{var n;const a=(0,i.Z1)(e,t),o=(0,i.Zw)(e,s||t),{currentType:r,resultsByType:c}=(0,i.we)(e)||{},{foundIds:l}=c&&r&&c[r]||{},{byId:u}=e.users,h=a&&(0,d.Bf)(a),m=a&&(0,d.eA)(a),g=h||m&&(0,d.Nl)(a),f=null==a||null===(n=a.fullInfo)||void 0===n?void 0:n.members,p=g&&a&&a.fullInfo&&!a.fullInfo.canViewMembers,I=g&&a&&((0,d.VE)(a,"inviteUsers")||a.isCreator),v=g&&a&&((0,d.VE)(a,"banUsers")||a.isCreator);let y;return s?y=s:(0,d.YA)(t)&&(y=t),{theme:(0,i.Pu)(e),isChannel:m,resolvedUserId:y,chatMessages:o,foundIds:l,mediaSearchType:r,hasMembersTab:g,areMembersHidden:p,canAddMembers:I,canDeleteMembers:v,currentUserId:e.currentUserId,isRightColumnShown:(0,i.Jf)(e),isRestricted:null==a?void 0:a.isRestricted,lastSyncTime:e.lastSyncTime,serverTimeOffset:e.serverTimeOffset,...g&&f&&{members:f,usersById:u}}}),((e,t)=>(0,g.ei)(t,["setLocalMediaSearchType","loadMoreMembers","searchMediaMessagesLocal","openMediaViewer","openAudioPlayer","openUserInfo","focusMessage","loadProfilePhotos","setNewChatMembersDialogState"])))((({chatId:e,profileState:t,onProfileStateChange:s,theme:n,isChannel:r,resolvedUserId:i,currentUserId:c,chatMessages:l,foundIds:g,mediaSearchType:f,hasMembersTab:p,areMembersHidden:I,canAddMembers:v,canDeleteMembers:y,members:Z,usersById:P,isRightColumnShown:C,isRestricted:w,lastSyncTime:b,setLocalMediaSearchType:M,loadMoreMembers:S,searchMediaMessagesLocal:E,openMediaViewer:k,openAudioPlayer:R,openUserInfo:T,focusMessage:N,loadProfilePhotos:B,setNewChatMembersDialogState:x,serverTimeOffset:A})=>{const L=(0,o.sO)(null),O=(0,o.sO)(null),F=(0,Ze.Z)(),[U,$]=(0,o.eJ)(0),[Q,D]=(0,o.eJ)(),q=(0,o.Ye)((()=>[...p?[{type:"members",title:r?"ChannelSubscribers":"GroupMembers"}]:[],...xa]),[p,r]),G=q[U].type,[H,j,_,V]=function(e,t,s,n,r,i,c,l,u,h,m,g=0){const f="members"!==n&&r?r:n,p=(0,o.Ye)((()=>{if(i&&c)return(0,d.Z0)(i.map((({userId:e})=>e)),c,void 0,g)}),[i,g,c]),[I,v,y]=function(e,t,s,n){const[o,r]=(0,ya.Z)(s?t:void 0,n,void 0,a.Vk);return[o,r,!(!o||!n||o[0]===n[0])]}(0,t,m,p),[Z,P,C]=Za("media",f,s,m,l,u),[w,b,M]=Za("documents",f,s,m,l,u),[S,E,k]=Za("links",f,s,m,l,u),[R,T,N]=Za("audio",f,s,m,l,u);let B,x,A=!1;switch(f){case"members":B=I,x=v,A=y;break;case"media":B=Z,x=P,A=C;break;case"documents":B=w,x=b,A=M;break;case"links":B=S,x=E,A=k;break;case"audio":B=R,x=T,A=N}return[f,B,x,A]}(0,S,E,G,f,Z,P,l,g,0,b,A),W=q.findIndex((({type:e})=>e===H)),{handleScroll:K}=function(e,t,s,n){(0,Nt.Z)((([s])=>{if(s&&s!==t){const s=e.current,a=s.querySelector(".TabList");s.scrollTop{Ca=!1}),350))}}),[t,n]),(0,Nt.Z)((([t])=>{if(s!==h.vi.Profile||s===t)return;const a=e.current;a&&a.querySelector(".TabList")&&(Ca=!0,(0,Ot.Z)(a,a.firstElementChild,"start",void 0,2*a.offsetHeight),setTimeout((()=>{Ca=!1}),350),n(s))}),[s]);const a=(0,o.I4)((()=>{const s=e.current;if(!s)return;const a=s.querySelector(".TabList");if(!a)return;let o=h.vi.Profile;s.scrollTop>=a.offsetTop&&(o="members"===t?h.vi.MemberList:h.vi.SharedMedia),n(o)}),[e,n,t]);return(0,o.d4)((()=>{Ca||a()}),[a,t]),{handleScroll:(0,o.I4)((()=>{Ca||Pa(a)}),[a])}}(L,G,t,s),{applyTransitionFix:X,releaseTransitionFix:Y}=function(e,t=".Transition.shared-media-transition"){return(0,o.d4)((()=>{function s(){const s=e.current,n=s.querySelector(t),a=s.querySelector(".TabList");n&&a&&(n.style.minHeight=s.offsetHeight-a.offsetHeight+"px")}return s(),window.addEventListener("resize",s,!1),()=>{window.removeEventListener("resize",s,!1)}}),[e,t]),{applyTransitionFix:(0,o.I4)((()=>{const t=e.current;if("hidden"!==t.style.overflowY){const e=t.offsetWidth-t.clientWidth;t.style.overflowY="hidden",t.style.marginRight=`${e}px`}}),[e]),releaseTransitionFix:(0,o.I4)((()=>{const t=e.current;t.style.overflowY="scroll",t.style.marginRight="0"}),[e])}}(L),[z,J]=(()=>{const[e,t]=(0,o.eJ)(!1);return[e,(0,o.I4)((()=>{t((e=>!e))}),[])]})(),ee=(0,o.I4)((()=>{Y(),J()}),[Y,J]),te=(0,o.I4)((()=>{x(h.WB.InProgress)}),[x]);(0,o.d4)((()=>{M({mediaType:G})}),[M,G]);const se=i||e;(0,o.d4)((()=>{b&&B({profileId:se})}),[B,se,b]);const ne=(0,o.I4)((e=>{k({chatId:se,threadId:u._f,messageId:e,origin:h.bZ.SharedMedia})}),[se,k]),ae=(0,o.I4)((e=>{R({chatId:se,messageId:e})}),[se,R]),oe=(0,o.I4)((e=>{T({id:e})}),[T]),re=(0,o.I4)((e=>{N({chatId:se,messageId:e})}),[se,N]),ie=(0,o.I4)((()=>{D(void 0)}),[]);let ce;(0,o.d4)((()=>{if(O.current&&m.$b)return(0,Be.s)(O.current,{selectorToPreventScroll:".Profile",onSwipe:(e,t)=>t===Be.e.Left?($(Math.min(U+1,q.length-1)),!0):t===Be.e.Right&&($(Math.max(0,U-1)),!0)})}),[U,q.length]);const de="members"===H||!p&&"media"===H;de?ce=C?0:1e3:j||(ce=a.Y);const le=(0,Xn.Z)([e,H],ce);function ue(e){return e!==c&&y?[{title:F("lng_context_remove_from_group"),icon:"stop",handler:()=>{D(e)}}]:void 0}function he(){if(!j||!le||!l){const e=de&&j&&!le;return o.ZP.createElement("div",{className:"content empty-list"},!e&&o.ZP.createElement(Te.Z,null))}if(!j.length){let e;switch(H){case"members":e=I?"You have no access to group members list.":"No members found";break;case"documents":e=F("lng_media_file_empty_search");break;case"links":e=F("lng_media_link_empty_search");break;case"audio":e=F("lng_media_song_empty_search");break;default:e=F("SharedMedia.EmptyTitle")}return o.ZP.createElement("div",{className:"content empty-list"},o.ZP.createElement(Ra.Z,{text:e}))}return o.ZP.createElement("div",{className:`content ${H}-list`,dir:F.isRtl&&"media"===H?"rtl":void 0,teactFastList:!0},"media"===H?j.map((e=>l[e]&&o.ZP.createElement(Ea.Z,{key:e,message:l[e],onClick:ne}))):"documents"===H?j.map((e=>l[e]&&o.ZP.createElement(ns.Z,{key:e,message:l[e],withDate:!0,smaller:!0,className:"scroll-item",onDateClick:re}))):"links"===H?j.map((e=>l[e]&&o.ZP.createElement(ka.Z,{key:e,message:l[e],onMessageClick:re}))):"audio"===H?j.map((e=>l[e]&&o.ZP.createElement(as.Z,{key:e,theme:n,message:l[e],target:"sharedMedia",date:l[e].date,lastSyncTime:b,className:"scroll-item",onPlay:ae,onDateClick:re}))):"members"===H?j.map(((e,t)=>o.ZP.createElement(ba.Z,{key:e,teactOrderKey:t,className:"chat-item-clickable scroll-item small-icon",onClick:()=>oe(e),contextActions:ue(e)},o.ZP.createElement(ht.Z,{userId:e,forceShowSelf:!0})))):void 0)}return o.ZP.createElement(wa.Z,{ref:L,className:"Profile custom-scroll",itemSelector:Aa(H),items:le?j:void 0,cacheBuster:z,sensitiveArea:a.qU,preloadBackwards:le?"members"===H?a.Vk:a.EN:0,noScrollRestoreOnTop:!0,noFastList:!0,onLoadMore:_,onScroll:K},!V&&function(e,t){return o.ZP.createElement("div",{className:"profile-info"},o.ZP.createElement(Ma.Z,{userId:t||e}),o.ZP.createElement(Sa.Z,{chatOrUserId:t||e}))}(e,i),!w&&o.ZP.createElement("div",{className:"shared-media"},o.ZP.createElement(Ie.Z,{ref:O,name:F.isRtl?"slide-reversed":"slide",activeKey:W,renderCount:q.length,shouldRestoreHeight:!0,className:"shared-media-transition",onStart:X,onStop:ee},he),o.ZP.createElement(xe.Z,{big:!0,activeTab:U,tabs:q,onSwitchTab:$})),v&&o.ZP.createElement(Ta.Z,{isShown:"members"===H,onClick:te,ariaLabel:F("lng_channel_add_users")},o.ZP.createElement("i",{className:"icon-add-user-filled"})),y&&o.ZP.createElement(Ba,{isOpen:Boolean(Q),userId:Q,onClose:ie}))}))),Oa=(0,o.X$)((e=>{const t=(0,Fe.Z)(Oe.gl.Extra,"RightSearch");return t?o.ZP.createElement(t,e):o.ZP.createElement(Ue.Z,null)})),Fa=(0,o.X$)((e=>{const t=(0,Fe.Z)(Oe.gl.Extra,"Management");return t?o.ZP.createElement(t,e):o.ZP.createElement(Ue.Z,null)})),Ua=(0,o.X$)((()=>{const e=(0,Fe.Z)(Oe.gl.Extra,"StickerSearch");return e?o.ZP.createElement(e,null):o.ZP.createElement(Ue.Z,null)})),$a=(0,o.X$)((()=>{const e=(0,Fe.Z)(Oe.gl.Extra,"GifSearch");return e?o.ZP.createElement(e,null):o.ZP.createElement(Ue.Z,null)})),Qa=(0,o.X$)((()=>{const e=(0,Fe.Z)(Oe.gl.Extra,"PollResults");return e?o.ZP.createElement(e,null):o.ZP.createElement(Ue.Z,null)}));var Da=s(1820);const qa=(0,o.X$)((0,n.c$)(((e,{chatId:t})=>{var s;const n=(0,i.Z1)(e,t),{userIds:a}=e.contactList||{},{byId:o}=e.users,{byId:r}=e.chats,{currentUserId:c,newChatMembersProgress:l,connectionState:u}=e,m=n&&(0,d.eA)(n),{query:g,fetchingStatus:f,globalUserIds:p,localUserIds:I}=e.userSearch;return{isChannel:m,members:null==n||null===(s=n.fullInfo)||void 0===s?void 0:s.members,currentUserId:c,usersById:o,chatsById:r,localContactIds:a,searchQuery:g,isSearching:f,isLoading:l===h.WB.Loading,globalUserIds:p,localUserIds:I,connectionState:u}}),((e,t)=>(0,g.ei)(t,["loadContactList","setUserSearchQuery"])))((({isChannel:e,connectionState:t,members:s,onNextStep:n,currentUserId:a,usersById:r,chatsById:i,localContactIds:c,isLoading:l,searchQuery:u,isSearching:h,localUserIds:m,globalUserIds:f,setUserSearchQuery:p,onClose:I,isActive:v,loadContactList:y})=>{const Z=(0,Ze.Z)(),[P,C]=(0,o.eJ)([]),w=(0,fs.Z)(P)===P;(0,o.d4)((()=>{v&&"connectionStateReady"===t&&y()}),[t,v,y]),(0,ge.ZP)(v,I);const b=(0,o.Ye)((()=>s?s.map((e=>e.userId)):[]),[s]),M=(0,o.I4)((e=>{p({query:e})}),[p]),S=(0,o.Ye)((()=>{const t=c?(0,d.ih)(c.filter((e=>e!==a)),i):[];if(!u)return t.filter((e=>!b.includes(e)));const s=t.filter((e=>{const t=r[e];if(!t)return!1;const s=(0,d.Js)(t);return s&&(0,B.Z)(s,u)}));return(0,d.ih)((0,g.Tw)([...s,...m||[],...f||[]]).filter((t=>{const s=r[t];return!b.includes(t)&&(!s||!(0,d.cS)(s)||!e&&s.canBeInvitedToGroup)})),i)}),[c,i,u,m,f,a,r,b,e]),E=(0,o.I4)((()=>{P.length&&(p({query:""}),n(P))}),[P,p,n]);return o.ZP.createElement("div",{className:"AddChatMembers"},o.ZP.createElement("div",{className:"AddChatMembers-inner"},o.ZP.createElement(Da.Z,{itemIds:S,selectedIds:P,filterValue:u,filterPlaceholder:Z("lng_channel_add_users"),searchInputId:"new-members-picker-search",isLoading:h,onSelectedIdsChange:C,onFilterChange:M,noScrollRestore:w}),o.ZP.createElement(Ta.Z,{isShown:Boolean(P.length),disabled:l,ariaLabel:Z("lng_channel_add_users"),onClick:E},l?o.ZP.createElement(Te.Z,{color:"white"}):o.ZP.createElement("i",{className:"icon-arrow-right"}))))}))),Ga=Object.keys(h.qt).length/2,Ha=Object.keys(h.u1).length/2;function ja(){const e=document.querySelector(".RightHeader .SearchInput input");e&&e.blur()}const _a=(0,o.X$)((0,n.c$)((e=>{const{chatId:t,threadId:s}=(0,i.Bt)(e)||{},n=(0,i.g4)(e);return{contentKey:(0,i.Wq)(e),chatId:t,threadId:s,currentProfileUserId:e.users.selectedId,isChatSelected:Boolean(t&&n),shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations}}),((e,t)=>(0,g.ei)(t,["openUserInfo","toggleChatInfo","toggleManagement","closeLocalTextSearch","setStickerSearchQuery","setGifSearchQuery","closePollResults","addChatMembers","setNewChatMembersDialogState"])))((({contentKey:e,chatId:t,threadId:s,currentProfileUserId:n,isChatSelected:r,toggleChatInfo:i,toggleManagement:c,openUserInfo:d,closeLocalTextSearch:l,setStickerSearchQuery:u,setGifSearchQuery:m,closePollResults:g,addChatMembers:f,setNewChatMembersDialogState:p,shouldSkipHistoryAnimations:I})=>{var v;const{width:y}=at(),[Z,P]=(0,o.eJ)(h.vi.Profile),[C,w]=(0,o.eJ)(h.u1.Initial),[b,M]=(0,o.eJ)(),[S,E]=(0,o.eJ)(),k=Z!==h.vi.Profile,R=void 0!==e,T=e===h.qt.ChatInfo||e===h.qt.UserInfo,N=e===h.qt.Search,B=e===h.qt.Management,x=e===h.qt.StickerSearch,A=e===h.qt.GifSearch,L=e===h.qt.PollResults,O=e===h.qt.AddingMembers,F=y<=a._m,[U,$]=(0,o.eJ)(!R),Q=null!==(v=(0,lt.Z)(e,!0,!r))&&void 0!==v?v:-1,D=(0,o.I4)(((t=!0)=>{switch(e){case h.qt.AddingMembers:p(h.WB.Closed);break;case h.qt.ChatInfo:if(k&&t){P(h.vi.Profile);break}i(void 0,!0);break;case h.qt.UserInfo:if(k&&t){P(h.vi.Profile);break}d({id:void 0},!0);break;case h.qt.Management:switch(C){case h.u1.Initial:c();break;case h.u1.ChatPrivacyType:case h.u1.Discussion:case h.u1.GroupPermissions:case h.u1.GroupType:case h.u1.ChatAdministrators:case h.u1.ChannelSubscribers:case h.u1.GroupMembers:w(h.u1.Initial);break;case h.u1.GroupUserPermissionsCreate:case h.u1.GroupRemovedUsers:case h.u1.GroupUserPermissions:w(h.u1.GroupPermissions),M(void 0),E(void 0);break;case h.u1.ChatAdminRights:case h.u1.GroupRecentActions:w(h.u1.ChatAdministrators)}break;case h.qt.Search:ja(),l();break;case h.qt.StickerSearch:ja(),u({query:void 0});break;case h.qt.GifSearch:ja(),m({query:void 0});break;case h.qt.PollResults:g()}}),[e,k,i,d,g,p,C,c,l,u,m]),q=(0,o.I4)(((e,t)=>{M(e),E(t)}),[]),G=(0,o.I4)((e=>{f({chatId:t,memberIds:e})}),[f,t]);function H(e){if(-1!==Q)switch(Q){case h.qt.AddingMembers:return o.ZP.createElement(qa,{chatId:t,onNextStep:G,isActive:R&&e,onClose:D});case h.qt.ChatInfo:case h.qt.UserInfo:return o.ZP.createElement(La,{key:n||t,chatId:t,userId:n,profileState:Z,onProfileStateChange:P});case h.qt.Search:return o.ZP.createElement(Oa,{chatId:t,threadId:s,onClose:D,isActive:R&&e});case h.qt.Management:return o.ZP.createElement(Fa,{chatId:t,currentScreen:C,isPromotedByCurrentUser:S,selectedChatMemberId:b,onScreenSelect:w,onChatMemberSelect:q,isActive:R&&e,onClose:D});case h.qt.StickerSearch:return o.ZP.createElement(Ua,{onClose:D,isActive:R&&e});case h.qt.GifSearch:return o.ZP.createElement($a,{onClose:D,isActive:R&&e});case h.qt.PollResults:return o.ZP.createElement(Qa,{onClose:D,isActive:R&&e})}}return(0,o.d4)((()=>R?(0,fe.Z)(D):void 0),[R,D]),(0,o.d4)((()=>{setTimeout((()=>{$(!R)}),300)}),[R]),(0,o.d4)((()=>{R&&F&&D()}),[F]),(0,Tt.Z)((([s,n])=>{(s===h.qt.ChatInfo&&e===h.qt.UserInfo||s===h.qt.UserInfo&&e===h.qt.ChatInfo||n!==t)&&(P(h.vi.Profile),w(h.u1.Initial))}),[e,t]),(0,ge.ZP)(r&&(e===h.qt.ChatInfo||e===h.qt.UserInfo||e===h.qt.Management||e===h.qt.AddingMembers),(()=>D(!1)),i),o.ZP.createElement("div",{id:"RightColumn-wrapper",className:r?void 0:"is-hidden"},F&&o.ZP.createElement("div",{className:"overlay-backdrop",onClick:D}),o.ZP.createElement("div",{id:"RightColumn"},o.ZP.createElement(va,{chatId:t,isColumnOpen:R,isProfile:T,isSearch:N,isManagement:B,isStickerSearch:x,isGifSearch:A,isPollResults:L,isAddingChatMembers:O,profileState:Z,managementScreen:C,onClose:D,shouldSkipAnimation:U||I}),o.ZP.createElement(Ie.Z,{name:U||I?"none":"zoom-fade",renderCount:Ga+Ha,activeKey:B?Ga+C:Q,shouldCleanup:!0,cleanupExceptionKey:h.qt.ChatInfo},H)))}))),Va=(0,o.X$)((({isOpen:e})=>{const t=(0,Fe.Z)(Oe.gl.Extra,"MediaViewer",!e);return t?o.ZP.createElement(t,null):void 0})),Wa=(0,o.X$)((({isOpen:e})=>{const t=(0,Fe.Z)(Oe.gl.Extra,"Notifications",!e);return t?o.ZP.createElement(t,null):void 0})),Ka=(0,o.X$)((({isOpen:e})=>{const t=(0,Fe.Z)(Oe.gl.Extra,"Dialogs",!e);return t?o.ZP.createElement(t,null):void 0})),Xa=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"ForwardPicker",!t);return s?o.ZP.createElement(s,e):void 0})),Ya=(0,o.X$)((e=>{const{url:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"SafeLinkModal",!t);return s?o.ZP.createElement(s,e):void 0})),za=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"HistoryCalendar",!t);return s?o.ZP.createElement(s,e):void 0}));let Ja,eo=!1;function to(e){document.querySelectorAll('link[rel="icon"]').forEach((t=>{e?t.href.includes("favicon-unread")||(t.href=t.href.replace("favicon","favicon-unread")):t.href=t.href.replace("favicon-unread","favicon")}))}function so(e){document.title!==e&&(document.title=e)}const no=(0,o.X$)((0,n.c$)((e=>{const{chatId:t,messageId:s}=e.audioPlayer,n=t&&s?(0,i.hj)(e,t,s):void 0;return{animationLevel:e.settings.byKey.animationLevel,lastSyncTime:e.lastSyncTime,isLeftColumnShown:e.isLeftColumnShown,isRightColumnShown:(0,i.Jf)(e),isMediaViewerOpen:(0,i.zQ)(e),isForwardModalOpen:(0,i.Ev)(e),hasNotifications:Boolean(e.notifications.length),hasDialogs:Boolean(e.dialogs.length),audioMessage:n,safeLinkModalUrl:e.safeLinkModalUrl,isHistoryCalendarOpen:Boolean(e.historyCalendarSelectedAt),shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations,language:e.settings.byKey.language,openedStickerSetShortName:e.openedStickerSetShortName}}),((e,t)=>(0,g.ei)(t,["loadAnimatedEmojis","loadNotificationSettings","loadNotificationExceptions","updateIsOnline","loadTopInlineBots","loadEmojiKeywords","openStickerSetShortName"])))((({lastSyncTime:e,isLeftColumnShown:t,isRightColumnShown:s,isMediaViewerOpen:r,isForwardModalOpen:c,animationLevel:d,hasNotifications:l,hasDialogs:u,audioMessage:h,safeLinkModalUrl:g,isHistoryCalendarOpen:f,shouldSkipHistoryAnimations:p,language:I,openedStickerSetShortName:v,loadAnimatedEmojis:y,loadNotificationSettings:P,loadNotificationExceptions:C,updateIsOnline:w,loadTopInlineBots:b,loadEmojiKeywords:M,openStickerSetShortName:S})=>{a.eM&&!eo&&(eo=!0,console.log(">>> RENDER MAIN")),(0,o.d4)((()=>{e&&(w(!0),y(),P(),C(),b(),M({language:a.pR}),I!==a.pR&&M({language:I}))}),[e,y,C,P,w,b,M,I]),(0,o.d4)((()=>{e&&ge.Oy.startsWith("#?tgaddr=")&&(e=>{const{protocol:t,searchParams:s,pathname:a}=new URL(e);if("tg:"!==t)return;const{openChatByUsername:o,openStickerSetShortName:r}=(0,n.uC)(),i=a.replace(/^\/\//,""),c={};switch(s.forEach(((e,t)=>{c[t]=e})),i){case"resolve":{const{domain:e}=c;"telegrampassport"!==e&&o({username:e});break}case"privatepost":case"bg":case"join":break;case"addstickers":{const{set:e}=c;r({stickerSetShortName:e});break}}})(decodeURIComponent(ge.Oy.substr("#?tgaddr=".length)))}),[e]);const{transitionClassNames:E}=(0,de.Z)(!t,void 0,!0,void 0,p),{transitionClassNames:k}=(0,de.Z)(s,void 0,!0,void 0,p),R=(0,ie.Z)(E.replace(/([\w-]+)/g,"middle-column-$1"),k.replace(/([\w-]+)/g,"right-column-$1"),p&&"history-animation-disabled");(0,he.Z)((([e])=>{if(void 0===e||0===d)return;const t=(0,re.YW)();(0,ce.L)(document.getElementById("MiddleColumn"),t)}),[t]),(0,he.Z)((([e])=>{if(void 0===e||0===d)return;(0,Z.T2)((()=>{document.body.classList.add("animating-right-column")}));const t=(0,re.YW)();(0,ce.L)(document.getElementById("RightColumn"),(()=>{t(),(0,Z.T2)((()=>{document.body.classList.remove("animating-right-column")}))}))}),[s]);const T=(0,o.I4)((()=>{w(!1);const e=(0,i.A1)((0,n.Rd)());let t=0;clearInterval(Ja),Ja=window.setInterval((()=>{if(document.title.includes(a.ou))to(!1);else{if(t%2==0){const t=(0,i.A1)((0,n.Rd)())-e;t>0&&(so(`${t} notification${t>1?"s":""}`),to(!0))}else so(a.Ti),to(!1);t++}}),1e3)}),[w]),N=(0,o.I4)((()=>{w(!0),clearInterval(Ja),Ja=void 0,document.title.includes(a.ou)||so(a.Ti),to(!1)}),[w]),B=(0,o.I4)((()=>{S({stickerSetShortName:void 0})}),[S]);function x(e){e.preventDefault(),e.stopPropagation()}return(0,le.Z)(T,N),ue(T),function(e=!1){(0,o.d4)((()=>{if(m.cj&&!e)return document.addEventListener("gesturestart",me),()=>{document.removeEventListener("gesturestart",me)}}),[e])}(r),o.ZP.createElement("div",{id:"Main",className:R,onDrop:x,onDragOver:x},o.ZP.createElement(Je,null),o.ZP.createElement(fa,null),o.ZP.createElement(_a,null),o.ZP.createElement(Va,{isOpen:r}),o.ZP.createElement(Xa,{isOpen:c}),o.ZP.createElement(Wa,{isOpen:l}),o.ZP.createElement(Ka,{isOpen:u}),h&&o.ZP.createElement(kt,{key:h.id,message:h,noUi:!0}),o.ZP.createElement(Ya,{url:g}),o.ZP.createElement(za,{isOpen:f}),o.ZP.createElement(ds.Z,{isOpen:Boolean(v),onClose:B,stickerSetShortName:v}))})));a.eM&&console.log(">>> FINISH LOAD MAIN BUNDLE"),(0,n.Rd)().connectionState||(0,n.uC)().initApi()}}]); -//# sourceMappingURL=433.29f542772c88e944d938.js.map \ No newline at end of file diff --git a/dist/433.29f542772c88e944d938.js.map b/dist/433.29f542772c88e944d938.js.map deleted file mode 100644 index 5bcc9b86..00000000 --- a/dist/433.29f542772c88e944d938.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"433.29f542772c88e944d938.js","mappings":"sNAoDO,SAASA,EAAqBC,GACnC,MAAM,OAAEC,EAAF,SAAUC,IAAaC,EAAAA,EAAAA,IAAyBH,IAAW,GACjE,OAAKC,GAAWC,GAIhBF,GAASI,EAAAA,EAAAA,IAAsBJ,EAAQC,EAAQC,GAAU,GACzDF,GAASK,EAAAA,EAAAA,IAA8BL,EAAQC,EAAQC,OAAUI,IAJxDN,GA3CXO,EAAAA,EAAAA,IAAW,uBAAwBP,IACjC,MAAM,OAAEC,EAAF,SAAUC,IAAaC,EAAAA,EAAAA,IAAyBH,IAAW,GACjE,GAAKC,GAAWC,EAIhB,OAAOE,EAAAA,EAAAA,IAAsBJ,EAAQC,EAAQC,GAAU,OAGzDK,EAAAA,EAAAA,IAAW,uBAAwBR,IAEnCQ,EAAAA,EAAAA,IAAW,2BAA2B,CAACP,EAAQQ,EAASC,KACtD,MAAM,OAAER,EAAF,SAAUC,IAAaC,EAAAA,EAAAA,IAAyBH,IAAW,GACjE,IAAKC,IAAWC,EACd,OAGF,MAAM,MAAEQ,GAAUD,EACZE,GAAgBC,EAAAA,EAAAA,IAAmBX,EAAQC,IACzCQ,MAAOG,GAAiBb,EAAOc,gBAAgBC,gBAAgBJ,IAAkB,GAQzF,OANID,IAAUG,IACZb,GAASK,EAAAA,EAAAA,IAA8BL,EAAQC,EAAQC,EAAUc,EAAAA,KAG1DZ,EAAAA,EAAAA,IAAsBJ,EAAQC,EAAQC,GAAU,EAAMQ,OAKjEH,EAAAA,EAAAA,IAAW,2BAA2B,CAACP,EAAQQ,EAASC,KACtD,MAAM,OAAER,IAAWE,E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BAAC,GAAD,MACA,mBAAC,GAAD,MACA,mBAAC,GAAD,CAAat4D,OAAQq2D,IACrB,mBAAC,GAAD,CAAer2D,OAAQu2D,IACvB,mBAAC,GAAD,CAAev2D,OAAQy2D,IACvB,mBAAC,GAAD,CAASz2D,OAAQ02D,IAChB/gD,GAAgB,mBAAC,GAAD,CAAatZ,IAAKsZ,EAAaruC,GAAIwG,QAAS6nC,EAAcnB,MAAI,IAC/E,mBAAC,GAAD,CAAe9iC,IAAKC,IACpB,mBAAC,GAAD,CAAiBquB,OAAQ22D,IACzB,mBAAC,KAAD,CACE32D,OAAQx2B,QAAQ2d,GAChBmiB,QAAS+uD,EACT/yE,oBAAqB6B,SEjPzBoD,EAAAA,IAEFC,QAAQC,IAAI,gCAGThf,EAAAA,EAAAA,MAAYg+B,kBACfhyB,EAAAA,EAAAA,MAAcihF","sources":["webpack://telegram-t/./src/modules/actions/ui/localSearch.ts","webpack://telegram-t/./src/modules/actions/ui/chats.ts","webpack://telegram-t/./src/modules/actions/ui/messages.ts","webpack://telegram-t/./src/modules/actions/ui/globalSearch.ts","webpack://telegram-t/./src/modules/actions/ui/stickerSearch.ts","webpack://telegram-t/./src/modules/actions/ui/users.ts","webpack://telegram-t/./src/modules/actions/ui/misc.ts","webpack://telegram-t/./src/modules/actions/ui/payments.ts","webpack://telegram-t/./src/modules/actions/api/chats.ts","webpack://telegram-t/./src/modules/actions/api/messages.ts","webpack://telegram-t/./src/modules/actions/api/symbols.ts","webpack://telegram-t/./src/modules/actions/api/globalSearch.ts","webpack://telegram-t/./src/modules/actions/api/sync.ts","webpack://telegram-t/./src/modules/actions/api/localSearch.ts","webpack://telegram-t/./src/modules/actions/api/management.ts","webpack://telegram-t/./src/modules/actions/api/users.ts","webpack://telegram-t/./src/modules/reducers/bots.ts","webpack://telegram-t/./src/modules/actions/api/bots.ts","webpack://telegram-t/./src/modules/actions/api/twoFaSettings.ts","webpack://telegram-t/./src/modules/actions/api/payments.ts","webpack://telegram-t/./src/util/requestQuery.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/chats.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/messages.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/users.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/symbols.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/misc.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/settings.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/twoFaSettings.ts","webpack://telegram-t/./src/hooks/useBeforeUnload.ts","webpack://telegram-t/./src/hooks/usePreventIosPinchZoom.ts","webpack://telegram-t/./src/hooks/useBrowserOnline.ts","webpack://telegram-t/./src/components/left/main/LeftMainHeader.tsx","webpack://telegram-t/./src/components/left/ConnectionState.tsx","webpack://telegram-t/./src/components/left/main/ChatFolders.tsx","webpack://telegram-t/./src/hooks/useThrottledMemo.ts","webpack://telegram-t/./src/hooks/useThrottle.ts","webpack://telegram-t/./src/components/left/search/LeftSearch.async.tsx","webpack://telegram-t/./src/components/left/main/ContactList.async.tsx","webpack://telegram-t/./src/components/left/NewChatButton.tsx","webpack://telegram-t/./src/components/left/main/LeftMain.tsx","webpack://telegram-t/./src/components/left/settings/Settings.async.tsx","webpack://telegram-t/./src/components/left/newChat/NewChat.async.tsx","webpack://telegram-t/./src/components/left/ArchivedChats.async.tsx","webpack://telegram-t/./src/components/left/LeftColumn.tsx","webpack://telegram-t/./src/hooks/useWindowSize.ts","webpack://telegram-t/./src/components/middle/helpers/calculateMiddleFooterTransforms.ts","webpack://telegram-t/./src/util/routing.ts","webpack://telegram-t/./src/components/middle/HeaderMenuContainer.async.tsx","webpack://telegram-t/./src/components/middle/HeaderActions.tsx","webpack://telegram-t/./src/hooks/useWebpThumbnail.ts","webpack://telegram-t/./src/components/middle/PinnedMessageNavigation.tsx","webpack://telegram-t/./src/components/middle/HeaderPinnedMessage.tsx","webpack://telegram-t/./src/components/middle/AudioPlayer.tsx","webpack://telegram-t/./src/components/middle/MiddleHeader.tsx","webpack://telegram-t/./src/components/middle/helpers/groupMessages.ts","webpack://telegram-t/./src/components/middle/hooks/useMessageObservers.ts","webpack://telegram-t/./src/components/middle/message/helpers/buildContentClassName.ts","webpack://telegram-t/./src/components/middle/message/helpers/mediaDimensions.ts","webpack://telegram-t/./src/components/middle/message/helpers/calculateAlbumLayout.ts","webpack://telegram-t/./src/components/middle/message/helpers/calculateAuthorWidth.ts","webpack://telegram-t/./src/components/middle/message/hooks/useFocusMessage.ts","webpack://telegram-t/./src/components/middle/message/ContextMenuContainer.async.tsx","webpack://telegram-t/./src/components/middle/ActionMessage.tsx","webpack://telegram-t/./src/components/common/EmbeddedMessage.tsx","webpack://telegram-t/./src/components/middle/message/MessageMeta.tsx","webpack://telegram-t/./src/components/middle/message/Sticker.tsx","webpack://telegram-t/./src/components/middle/message/hooks/useBlurredMediaThumbRef.ts","webpack://telegram-t/./src/components/middle/message/helpers/getCustomAppendixBg.ts","webpack://telegram-t/./src/components/middle/message/Photo.tsx","webpack://telegram-t/./src/hooks/useHeavyAnimationCheckForVideo.ts","webpack://telegram-t/./src/components/middle/message/hooks/usePauseOnInactive.ts","webpack://telegram-t/./src/components/middle/message/Video.tsx","webpack://telegram-t/./src/components/middle/message/Contact.tsx","webpack://telegram-t/./src/components/ui/CheckboxGroup.tsx","webpack://telegram-t/./src/components/middle/message/PollOption.tsx","webpack://telegram-t/./src/components/middle/message/Poll.tsx","webpack://telegram-t/./src/components/middle/message/WebPage.tsx","webpack://telegram-t/./src/components/middle/message/Invoice.tsx","webpack://telegram-t/./src/components/middle/message/hocs/withSelectControl.tsx","webpack://telegram-t/./src/components/middle/message/Album.tsx","webpack://telegram-t/./src/components/middle/message/RoundVideo.tsx","webpack://telegram-t/./src/components/middle/message/InlineButtons.tsx","webpack://telegram-t/./src/components/middle/message/CommentButton.tsx","webpack://telegram-t/./src/components/middle/message/Message.tsx","webpack://telegram-t/./src/components/middle/message/hooks/useOuterHandlers.ts","webpack://telegram-t/./src/components/middle/message/hooks/useInnerHandlers.ts","webpack://telegram-t/./src/components/middle/MessageListContent.tsx","webpack://telegram-t/./src/components/middle/hooks/useScrollHooks.ts","webpack://telegram-t/./src/components/middle/ContactGreeting.tsx","webpack://telegram-t/./src/components/middle/NoMessages.tsx","webpack://telegram-t/./src/components/middle/MessageList.tsx","webpack://telegram-t/./src/components/middle/hooks/useStickyDates.ts","webpack://telegram-t/./src/hooks/useDebounce.ts","webpack://telegram-t/./src/components/middle/ScrollDownButton.tsx","webpack://telegram-t/./src/components/middle/composer/helpers/buildAttachment.ts","webpack://telegram-t/./src/components/middle/composer/helpers/applyIosAutoCapitalizationFix.ts","webpack://telegram-t/./node_modules/opus-recorder/dist/encoderWorker.min.js","webpack://telegram-t/./src/util/voiceRecording.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useVoiceRecording.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useClipboardPaste.ts","webpack://telegram-t/./src/components/middle/composer/helpers/getMessageTextAsHtml.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useDraft.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useInlineBotTooltip.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useBotCommandTooltip.ts","webpack://telegram-t/./src/components/common/DeleteMessageModal.async.tsx","webpack://telegram-t/./src/components/ui/ResponsiveHoverButton.tsx","webpack://telegram-t/./src/components/middle/composer/AttachMenu.async.tsx","webpack://telegram-t/./src/components/middle/composer/SymbolMenu.async.tsx","webpack://telegram-t/./src/components/middle/composer/InlineBotTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/MentionTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/CustomSendMenu.async.tsx","webpack://telegram-t/./src/components/middle/composer/StickerTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/BotCommandTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/BotKeyboardMenu.tsx","webpack://telegram-t/./src/components/middle/composer/ComposerEmbeddedMessage.tsx","webpack://telegram-t/./src/components/middle/composer/AttachmentModal.async.tsx","webpack://telegram-t/./src/components/middle/composer/BotCommandMenu.async.tsx","webpack://telegram-t/./src/components/middle/composer/PollModal.async.tsx","webpack://telegram-t/./src/components/middle/composer/DropArea.async.tsx","webpack://telegram-t/./src/components/middle/composer/WebPagePreview.tsx","webpack://telegram-t/./src/components/common/CalendarModal.async.tsx","webpack://telegram-t/./src/components/payment/PaymentModal.async.tsx","webpack://telegram-t/./src/components/payment/ReceiptModal.async.tsx","webpack://telegram-t/./src/components/middle/composer/Composer.tsx","webpack://telegram-t/./src/components/middle/composer/hooks/useStickerTooltip.ts","webpack://telegram-t/./src/util/insertHtmlInSelection.ts","webpack://telegram-t/./src/util/deleteLastCharacterOutsideSelection.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useEditing.ts","webpack://telegram-t/./src/components/middle/MobileSearch.async.tsx","webpack://telegram-t/./src/components/middle/MessageSelectToolbar.async.tsx","webpack://telegram-t/./src/components/common/UnpinAllMessagesModal.async.tsx","webpack://telegram-t/./src/components/middle/MiddleColumn.tsx","webpack://telegram-t/./src/hooks/useCustomBackground.ts","webpack://telegram-t/./src/components/right/RightHeader.tsx","webpack://telegram-t/./src/components/right/hooks/useProfileViewportIds.ts","webpack://telegram-t/./src/components/right/hooks/useProfileState.ts","webpack://telegram-t/./src/components/right/DeleteMemberModal.tsx","webpack://telegram-t/./src/components/right/Profile.tsx","webpack://telegram-t/./src/components/right/hooks/useTransitionFixes.ts","webpack://telegram-t/./src/hooks/useCacheBuster.ts","webpack://telegram-t/./src/components/right/RightSearch.async.tsx","webpack://telegram-t/./src/components/right/management/Management.async.tsx","webpack://telegram-t/./src/components/right/StickerSearch.async.tsx","webpack://telegram-t/./src/components/right/GifSearch.async.tsx","webpack://telegram-t/./src/components/right/PollResults.async.tsx","webpack://telegram-t/./src/components/right/AddChatMembers.tsx","webpack://telegram-t/./src/components/right/RightColumn.tsx","webpack://telegram-t/./src/components/mediaViewer/MediaViewer.async.tsx","webpack://telegram-t/./src/components/main/Notifications.async.tsx","webpack://telegram-t/./src/components/main/Dialogs.async.tsx","webpack://telegram-t/./src/components/main/ForwardPicker.async.tsx","webpack://telegram-t/./src/components/main/SafeLinkModal.async.tsx","webpack://telegram-t/./src/components/main/HistoryCalendar.async.tsx","webpack://telegram-t/./src/components/main/Main.tsx","webpack://telegram-t/./src/util/deeplink.ts","webpack://telegram-t/./src/bundles/main.ts"],"sourcesContent":["import { addReducer } from '../../../lib/teact/teactn';\n\nimport {\n updateLocalTextSearch,\n replaceLocalTextSearchResults,\n updateLocalMediaSearchType,\n} from '../../reducers';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { selectCurrentMessageList } from '../../selectors';\nimport { buildChatThreadKey } from '../../helpers';\nimport { GlobalState } from '../../../global/types';\n\naddReducer('openLocalTextSearch', (global) => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n return updateLocalTextSearch(global, chatId, threadId, true);\n});\n\naddReducer('closeLocalTextSearch', closeLocalTextSearch);\n\naddReducer('setLocalTextSearchQuery', (global, actions, payload) => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n const { query } = payload!;\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n const { query: currentQuery } = global.localTextSearch.byChatThreadKey[chatThreadKey] || {};\n\n if (query !== currentQuery) {\n global = replaceLocalTextSearchResults(global, chatId, threadId, MEMO_EMPTY_ARRAY);\n }\n\n global = updateLocalTextSearch(global, chatId, threadId, true, query);\n\n return global;\n});\n\naddReducer('setLocalMediaSearchType', (global, actions, payload) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return undefined;\n }\n\n const { mediaType } = payload!;\n return updateLocalMediaSearchType(global, chatId, mediaType);\n});\n\nexport function closeLocalTextSearch(global: GlobalState): GlobalState {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return global;\n }\n\n global = updateLocalTextSearch(global, chatId, threadId, false);\n global = replaceLocalTextSearchResults(global, chatId, threadId, undefined);\n return global;\n}\n","import { addReducer, setGlobal } from '../../../lib/teact/teactn';\n\nimport {\n exitMessageSelectMode, replaceThreadParam, updateCurrentMessageList,\n} from '../../reducers';\nimport { selectCurrentMessageList } from '../../selectors';\nimport { closeLocalTextSearch } from './localSearch';\n\naddReducer('openChat', (global, actions, payload) => {\n const {\n id, threadId = -1, type = 'thread', shouldReplaceHistory = false,\n } = payload!;\n\n const currentMessageList = selectCurrentMessageList(global);\n\n if (!currentMessageList\n || (\n currentMessageList.chatId !== id\n || currentMessageList.threadId !== threadId\n || currentMessageList.type !== type\n )) {\n global = replaceThreadParam(global, id, threadId, 'replyStack', []);\n global = exitMessageSelectMode(global);\n global = closeLocalTextSearch(global);\n\n global = {\n ...global,\n messages: {\n ...global.messages,\n contentToBeScheduled: undefined,\n },\n ...(id !== global.forwardMessages.toChatId && {\n forwardMessages: {},\n }),\n };\n\n setGlobal(global);\n }\n\n return updateCurrentMessageList(global, id, threadId, type, shouldReplaceHistory);\n});\n\naddReducer('openPreviousChat', (global) => {\n return updateCurrentMessageList(global, undefined);\n});\n\naddReducer('openChatWithInfo', (global, actions, payload) => {\n setGlobal({\n ...global,\n isChatInfoShown: true,\n });\n\n actions.openChat(payload);\n});\n\naddReducer('resetChatCreation', (global) => {\n return {\n ...global,\n chatCreation: undefined,\n };\n});\n\naddReducer('setNewChatMembersDialogState', (global, actions, payload) => {\n return {\n ...global,\n newChatMembersProgress: payload,\n };\n});\n\naddReducer('openNextChat', (global, actions, payload) => {\n const { targetIndexDelta, orderedIds } = payload;\n\n const { chatId } = selectCurrentMessageList(global) || {};\n\n if (!chatId) {\n actions.openChat({ id: orderedIds[0] });\n return;\n }\n\n const position = orderedIds.indexOf(chatId);\n\n if (position === -1) {\n return;\n }\n const nextId = orderedIds[position + targetIndexDelta];\n\n actions.openChat({ id: nextId, shouldReplaceHistory: true });\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { MAIN_THREAD_ID } from '../../../api/types';\nimport { FocusDirection } from '../../../types';\n\nimport { ANIMATION_END_DELAY, FAST_SMOOTH_MAX_DURATION } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport {\n enterMessageSelectMode,\n toggleMessageSelection,\n exitMessageSelectMode,\n replaceThreadParam,\n updateFocusDirection,\n updateFocusedMessage,\n} from '../../reducers';\nimport {\n selectCurrentChat,\n selectViewportIds,\n selectIsRightColumnShown,\n selectCurrentMessageList,\n selectChat,\n selectThreadInfo,\n selectChatMessages,\n selectAllowedMessageActions,\n selectMessageIdsByGroupId,\n selectForwardedMessageIdsByGroupId,\n selectIsViewportNewest,\n selectReplyingToId,\n selectReplyStack,\n} from '../../selectors';\nimport { findLast } from '../../../util/iteratees';\n\nconst FOCUS_DURATION = 1500;\nconst FOCUS_NO_HIGHLIGHT_DURATION = FAST_SMOOTH_MAX_DURATION + ANIMATION_END_DELAY;\nconst POLL_RESULT_OPEN_DELAY_MS = 450;\n\nlet blurTimeout: number | undefined;\n\naddReducer('setScrollOffset', (global, actions, payload) => {\n const { chatId, threadId, scrollOffset } = payload!;\n\n return replaceThreadParam(global, chatId, threadId, 'scrollOffset', scrollOffset);\n});\n\naddReducer('setReplyingToId', (global, actions, payload) => {\n const { messageId } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n const { chatId, threadId } = currentMessageList;\n\n return replaceThreadParam(global, chatId, threadId, 'replyingToId', messageId);\n});\n\naddReducer('setEditingId', (global, actions, payload) => {\n const { messageId } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n const { chatId, threadId, type } = currentMessageList;\n const paramName = type === 'scheduled' ? 'editingScheduledId' : 'editingId';\n\n return replaceThreadParam(global, chatId, threadId, paramName, messageId);\n});\n\naddReducer('editLastMessage', (global) => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n const chatMessages = selectChatMessages(global, chatId);\n const viewportIds = selectViewportIds(global, chatId, threadId);\n if (!chatMessages || !viewportIds) {\n return undefined;\n }\n\n const lastOwnEditableMessageId = findLast(viewportIds, (id) => {\n return Boolean(chatMessages[id] && selectAllowedMessageActions(global, chatMessages[id], threadId).canEdit);\n });\n\n if (!lastOwnEditableMessageId) {\n return undefined;\n }\n\n return replaceThreadParam(global, chatId, threadId, 'editingId', lastOwnEditableMessageId);\n});\n\naddReducer('replyToNextMessage', (global, actions, payload) => {\n const { targetIndexDelta } = payload;\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return;\n }\n\n const chatMessages = selectChatMessages(global, chatId);\n const viewportIds = selectViewportIds(global, chatId, threadId);\n if (!chatMessages || !viewportIds) {\n return;\n }\n\n const replyingToId = selectReplyingToId(global, chatId, threadId);\n const isLatest = selectIsViewportNewest(global, chatId, threadId);\n\n let messageId: number | undefined;\n\n if (!isLatest || !replyingToId) {\n if (threadId === MAIN_THREAD_ID) {\n const chat = selectChat(global, chatId);\n\n messageId = chat?.lastMessage?.id;\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n\n messageId = threadInfo?.lastMessageId;\n }\n } else {\n const chatMessageKeys = Object.keys(chatMessages);\n const indexOfCurrent = chatMessageKeys.indexOf(replyingToId.toString());\n const newIndex = indexOfCurrent + targetIndexDelta;\n messageId = newIndex <= chatMessageKeys.length + 1 && newIndex >= 0\n ? Number(chatMessageKeys[newIndex])\n : undefined;\n }\n actions.setReplyingToId({ messageId });\n actions.focusMessage({\n chatId, threadId, messageId,\n });\n});\n\naddReducer('openMediaViewer', (global, actions, payload) => {\n const {\n chatId, threadId, messageId, avatarOwnerId, profilePhotoIndex, origin,\n } = payload!;\n\n return {\n ...global,\n mediaViewer: {\n chatId,\n threadId,\n messageId,\n avatarOwnerId,\n profilePhotoIndex,\n origin,\n },\n forwardMessages: {},\n };\n});\n\naddReducer('closeMediaViewer', (global) => {\n return {\n ...global,\n mediaViewer: {},\n };\n});\n\naddReducer('openAudioPlayer', (global, actions, payload) => {\n const {\n chatId, threadId, messageId,\n } = payload!;\n\n return {\n ...global,\n audioPlayer: {\n chatId,\n threadId,\n messageId,\n },\n };\n});\n\naddReducer('closeAudioPlayer', (global) => {\n return {\n ...global,\n audioPlayer: {},\n };\n});\n\naddReducer('openPollResults', (global, actions, payload) => {\n const { chatId, messageId } = payload!;\n\n const shouldOpenInstantly = selectIsRightColumnShown(global);\n\n if (!shouldOpenInstantly) {\n window.setTimeout(() => {\n const newGlobal = getGlobal();\n\n setGlobal({\n ...newGlobal,\n pollResults: {\n chatId,\n messageId,\n voters: {},\n },\n });\n }, POLL_RESULT_OPEN_DELAY_MS);\n } else if (chatId !== global.pollResults.chatId || messageId !== global.pollResults.messageId) {\n setGlobal({\n ...global,\n pollResults: {\n chatId,\n messageId,\n voters: {},\n },\n });\n }\n});\n\naddReducer('closePollResults', (global) => {\n setGlobal({\n ...global,\n pollResults: {},\n });\n});\n\naddReducer('focusLastMessage', (global, actions) => {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId, threadId } = currentMessageList;\n\n let lastMessageId: number | undefined;\n if (threadId === MAIN_THREAD_ID) {\n const chat = selectChat(global, chatId);\n\n lastMessageId = chat?.lastMessage?.id;\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n\n lastMessageId = threadInfo?.lastMessageId;\n }\n\n if (!lastMessageId) {\n return;\n }\n\n actions.focusMessage({\n chatId, threadId, messageId: lastMessageId, noHighlight: true,\n });\n});\n\naddReducer('focusNextReply', (global, actions) => {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n const { chatId, threadId } = currentMessageList;\n\n const replyStack = selectReplyStack(global, chatId, threadId);\n\n if (!replyStack || replyStack.length === 0) {\n actions.focusLastMessage();\n } else {\n const messageId = replyStack.pop();\n\n global = replaceThreadParam(global, chatId, threadId, 'replyStack', [...replyStack]);\n\n setGlobal(global);\n\n actions.focusMessage({\n chatId,\n threadId,\n messageId,\n });\n }\n\n return undefined;\n});\n\naddReducer('focusMessage', (global, actions, payload) => {\n const {\n chatId, threadId = MAIN_THREAD_ID, messageListType = 'thread', noHighlight, groupedId, groupedChatId,\n replyMessageId, isResizingContainer,\n } = payload!;\n\n let { messageId } = payload!;\n\n if (groupedId !== undefined) {\n const ids = selectForwardedMessageIdsByGroupId(global, groupedChatId, groupedId);\n if (ids?.length) {\n ([messageId] = ids);\n }\n }\n\n const currentMessageList = selectCurrentMessageList(global);\n const shouldSwitchChat = !currentMessageList || (\n chatId !== currentMessageList.chatId\n || threadId !== currentMessageList.threadId\n || messageListType !== currentMessageList.type\n );\n\n if (blurTimeout) {\n clearTimeout(blurTimeout);\n blurTimeout = undefined;\n }\n blurTimeout = window.setTimeout(() => {\n let newGlobal = getGlobal();\n newGlobal = updateFocusedMessage(newGlobal);\n newGlobal = updateFocusDirection(newGlobal);\n setGlobal(newGlobal);\n }, noHighlight ? FOCUS_NO_HIGHLIGHT_DURATION : FOCUS_DURATION);\n\n global = updateFocusedMessage(global, chatId, messageId, noHighlight, isResizingContainer);\n global = updateFocusDirection(global, undefined);\n\n if (replyMessageId) {\n const replyStack = selectReplyStack(global, chatId, threadId) || [];\n global = replaceThreadParam(global, chatId, threadId, 'replyStack', [...replyStack, replyMessageId]);\n }\n\n if (shouldSwitchChat) {\n global = updateFocusDirection(global, FocusDirection.Static);\n }\n\n const viewportIds = selectViewportIds(global, chatId, threadId);\n if (viewportIds && viewportIds.includes(messageId)) {\n setGlobal(global);\n actions.openChat({ id: chatId, threadId });\n return undefined;\n }\n\n if (shouldSwitchChat) {\n global = replaceThreadParam(global, chatId, threadId, 'viewportIds', undefined);\n }\n\n global = replaceThreadParam(global, chatId, threadId, 'outlyingIds', undefined);\n\n if (viewportIds && !shouldSwitchChat) {\n const direction = messageId > viewportIds[0] ? FocusDirection.Down : FocusDirection.Up;\n global = updateFocusDirection(global, direction);\n }\n\n setGlobal(global);\n\n actions.openChat({ id: chatId, threadId });\n actions.loadViewportMessages();\n return undefined;\n});\n\naddReducer('openForwardMenu', (global, actions, payload) => {\n const { fromChatId, messageIds, groupedId } = payload!;\n let groupedMessageIds;\n if (groupedId) {\n groupedMessageIds = selectMessageIdsByGroupId(global, fromChatId, groupedId);\n }\n return {\n ...global,\n forwardMessages: {\n fromChatId,\n messageIds: groupedMessageIds || messageIds,\n isModalShown: true,\n },\n };\n});\n\naddReducer('exitForwardMode', (global) => {\n setGlobal({\n ...global,\n forwardMessages: {},\n });\n});\n\naddReducer('setForwardChatId', (global, actions, payload) => {\n const { id } = payload!;\n\n setGlobal({\n ...global,\n forwardMessages: {\n ...global.forwardMessages,\n toChatId: id,\n isModalShown: false,\n },\n });\n\n actions.openChat({ id });\n actions.closeMediaViewer();\n actions.exitMessageSelectMode();\n});\n\naddReducer('openForwardMenuForSelectedMessages', (global, actions) => {\n if (!global.selectedMessages) {\n return;\n }\n\n const { chatId: fromChatId, messageIds } = global.selectedMessages;\n\n actions.openForwardMenu({ fromChatId, messageIds });\n});\n\naddReducer('enterMessageSelectMode', (global, actions, payload) => {\n const { messageId } = payload || {};\n const openChat = selectCurrentChat(global);\n if (!openChat) {\n return global;\n }\n\n return enterMessageSelectMode(global, openChat.id, messageId);\n});\n\naddReducer('toggleMessageSelection', (global, actions, payload) => {\n const {\n messageId,\n groupedId,\n childMessageIds,\n withShift,\n } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId, threadId, type: messageListType } = currentMessageList;\n\n global = toggleMessageSelection(\n global, chatId, threadId, messageListType, messageId, groupedId, childMessageIds, withShift,\n );\n\n setGlobal(global);\n\n if (global.shouldShowContextMenuHint) {\n actions.disableContextMenuHint();\n actions.showNotification({\n // eslint-disable-next-line max-len\n message: `To **edit** or **reply**, close this menu. Then ${IS_TOUCH_ENV ? 'long tap' : 'right click'} on a message.`,\n });\n }\n});\n\naddReducer('disableContextMenuHint', (global) => {\n if (!global.shouldShowContextMenuHint) {\n return undefined;\n }\n\n return {\n ...global,\n shouldShowContextMenuHint: false,\n };\n});\n\naddReducer('exitMessageSelectMode', exitMessageSelectMode);\n\naddReducer('openPollModal', (global) => {\n return {\n ...global,\n isPollModalOpen: true,\n };\n});\n\naddReducer('closePollModal', (global) => {\n return {\n ...global,\n isPollModalOpen: false,\n };\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { updateGlobalSearch, updateGlobalSearchContent } from '../../reducers';\n\nconst MAX_RECENTLY_FOUND_IDS = 10;\n\naddReducer('setGlobalSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n const { chatId } = global.globalSearch;\n\n return updateGlobalSearch(global, {\n globalResults: {},\n localResults: {},\n resultsByType: undefined,\n ...(query ? { fetchingStatus: { chats: !chatId, messages: true } } : { fetchingStatus: undefined }),\n query,\n });\n});\n\naddReducer('addRecentlyFoundChatId', (global, actions, payload) => {\n const { id } = payload!;\n const { recentlyFoundChatIds } = global.globalSearch;\n\n if (!recentlyFoundChatIds) {\n return updateGlobalSearch(global, { recentlyFoundChatIds: [id] });\n }\n\n const newRecentIds = recentlyFoundChatIds.filter((chatId) => chatId !== id);\n newRecentIds.unshift(id);\n if (newRecentIds.length > MAX_RECENTLY_FOUND_IDS) {\n newRecentIds.pop();\n }\n\n return updateGlobalSearch(global, { recentlyFoundChatIds: newRecentIds });\n});\n\naddReducer('clearRecentlyFoundChats', (global) => {\n return updateGlobalSearch(global, { recentlyFoundChatIds: undefined });\n});\n\naddReducer('setGlobalSearchContent', (global, actions, payload) => {\n const { content } = payload!;\n\n return updateGlobalSearchContent(global, content);\n});\n\naddReducer('setGlobalSearchChatId', (global, actions, payload) => {\n const { id } = payload!;\n\n return updateGlobalSearch(global, { chatId: id, query: undefined, resultsByType: undefined });\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\naddReducer('setStickerSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n search: {\n query,\n resultIds: undefined,\n },\n },\n };\n});\n\naddReducer('setGifSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n return {\n ...global,\n gifs: {\n ...global.gifs,\n search: {\n query,\n offsetId: undefined,\n results: undefined,\n },\n },\n };\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\n\nimport { updateSelectedUserId, updateUserSearch } from '../../reducers';\n\naddReducer('openUserInfo', (global, actions, payload) => {\n const { id } = payload!;\n\n actions.openChat({ id });\n});\n\nconst clearSelectedUserId = (global: GlobalState) => updateSelectedUserId(global, undefined);\n\naddReducer('openChat', clearSelectedUserId);\n\naddReducer('setUserSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n return updateUserSearch(global, {\n globalUserIds: undefined,\n localUserIds: undefined,\n fetchingStatus: Boolean(query),\n query,\n });\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\nimport { ApiError } from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TABLET_COLUMN_LAYOUT } from '../../../util/environment';\nimport getReadableErrorText from '../../../util/getReadableErrorText';\nimport { selectCurrentMessageList } from '../../selectors';\nimport generateIdFor from '../../../util/generateIdFor';\n\nconst MAX_STORED_EMOJIS = 18; // Represents two rows of recent emojis\n\naddReducer('toggleChatInfo', (global) => {\n return {\n ...global,\n isChatInfoShown: !global.isChatInfoShown,\n };\n});\n\naddReducer('toggleManagement', (global): GlobalState | undefined => {\n const { chatId } = selectCurrentMessageList(global) || {};\n\n if (!chatId) {\n return undefined;\n }\n\n return {\n ...global,\n management: {\n byChatId: {\n ...global.management.byChatId,\n [chatId]: {\n ...global.management.byChatId[chatId],\n isActive: !(global.management.byChatId[chatId] || {}).isActive,\n },\n },\n },\n };\n});\n\naddReducer('closeManagement', (global): GlobalState | undefined => {\n const { chatId } = selectCurrentMessageList(global) || {};\n\n if (!chatId) {\n return undefined;\n }\n\n return {\n ...global,\n management: {\n byChatId: {\n ...global.management.byChatId,\n [chatId]: {\n ...global.management.byChatId[chatId],\n isActive: false,\n },\n },\n },\n };\n});\n\naddReducer('openChat', (global) => {\n if (!IS_SINGLE_COLUMN_LAYOUT && !IS_TABLET_COLUMN_LAYOUT) {\n return undefined;\n }\n\n return {\n ...global,\n isLeftColumnShown: global.messages.messageLists.length === 0,\n };\n});\n\naddReducer('toggleLeftColumn', (global) => {\n return {\n ...global,\n isLeftColumnShown: !global.isLeftColumnShown,\n };\n});\n\naddReducer('addRecentEmoji', (global, action, payload) => {\n const { emoji } = payload!;\n const { recentEmojis } = global;\n if (!recentEmojis) {\n return {\n ...global,\n recentEmojis: [emoji],\n };\n }\n\n const newEmojis = recentEmojis.filter((e) => e !== emoji);\n newEmojis.unshift(emoji);\n if (newEmojis.length > MAX_STORED_EMOJIS) {\n newEmojis.pop();\n }\n\n return {\n ...global,\n recentEmojis: newEmojis,\n };\n});\n\naddReducer('addRecentSticker', (global, action, payload) => {\n const { sticker } = payload!;\n const { recent } = global.stickers;\n if (!recent) {\n return {\n ...global,\n stickers: {\n ...global.stickers,\n recent: {\n hash: 0,\n stickers: [sticker],\n },\n },\n };\n }\n\n const newStickers = recent.stickers.filter((s) => s.id !== sticker.id);\n newStickers.unshift(sticker);\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n recent: {\n ...recent,\n stickers: newStickers,\n },\n },\n };\n});\n\naddReducer('showNotification', (global, actions, payload) => {\n const notification = payload!;\n notification.localId = generateIdFor({});\n\n const newNotifications = [...global.notifications];\n const existingNotificationIndex = newNotifications.findIndex((n) => n.message === notification.message);\n if (existingNotificationIndex !== -1) {\n newNotifications.splice(existingNotificationIndex, 1);\n }\n\n newNotifications.push(notification);\n\n return {\n ...global,\n notifications: newNotifications,\n };\n});\n\naddReducer('dismissNotification', (global, actions, payload) => {\n const newNotifications = global.notifications.filter(({ localId }) => localId !== payload.localId);\n\n return {\n ...global,\n notifications: newNotifications,\n };\n});\n\naddReducer('showDialog', (global, actions, payload) => {\n const { data } = payload!;\n\n // Filter out errors that we don't want to show to the user\n if ('message' in data && data.hasErrorKey && !getReadableErrorText(data)) {\n return global;\n }\n\n const newDialogs = [...global.dialogs];\n if ('message' in data) {\n const existingErrorIndex = newDialogs.findIndex((err) => (err as ApiError).message === data.message);\n if (existingErrorIndex !== -1) {\n newDialogs.splice(existingErrorIndex, 1);\n }\n }\n\n newDialogs.push(data);\n\n return {\n ...global,\n dialogs: newDialogs,\n };\n});\n\naddReducer('dismissDialog', (global) => {\n const newDialogs = [...global.dialogs];\n\n newDialogs.pop();\n\n return {\n ...global,\n dialogs: newDialogs,\n };\n});\n\naddReducer('toggleSafeLinkModal', (global, actions, payload) => {\n const { url: safeLinkModalUrl } = payload;\n\n return {\n ...global,\n safeLinkModalUrl,\n };\n});\n\naddReducer('openHistoryCalendar', (global, actions, payload) => {\n const { selectedAt } = payload;\n\n return {\n ...global,\n historyCalendarSelectedAt: selectedAt,\n };\n});\n\naddReducer('closeHistoryCalendar', (global) => {\n return {\n ...global,\n historyCalendarSelectedAt: undefined,\n };\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { clearPayment, closeInvoice } from '../../reducers';\n\naddReducer('openPaymentModal', (global, actions, payload) => {\n const { chatId, messageId } = payload;\n return {\n ...global,\n payment: {\n ...global.payment,\n chatId,\n messageId,\n isPaymentModalOpen: true,\n },\n };\n});\n\naddReducer('closePaymentModal', (global) => {\n const newGlobal = clearPayment(global);\n return closeInvoice(newGlobal);\n});\n\naddReducer('addPaymentError', (global, actions, payload) => {\n const { error } = payload!;\n\n return {\n ...global,\n payment: {\n ...global.payment,\n error,\n },\n };\n});\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiUser, ApiChatFolder, MAIN_THREAD_ID,\n} from '../../../api/types';\nimport { NewChatMembersProgress, ChatCreationProgress, ManagementProgress } from '../../../types';\nimport { GlobalActions } from '../../../global/types';\n\nimport {\n ARCHIVED_FOLDER_ID,\n TOP_CHAT_MESSAGES_PRELOAD_LIMIT,\n CHAT_LIST_LOAD_SLICE,\n RE_TME_INVITE_LINK,\n RE_TME_LINK,\n TIPS_USERNAME,\n LOCALIZED_TIPS,\n} from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport {\n addChats,\n addUsers,\n replaceThreadParam,\n updateChatListIds,\n updateChats,\n updateChat,\n updateChatListSecondaryInfo,\n updateManagementProgress,\n} from '../../reducers';\nimport {\n selectChat,\n selectCurrentChat,\n selectUser,\n selectChatListType,\n selectIsChatPinned,\n selectChatFolder,\n selectSupportChat,\n selectChatByUsername,\n selectThreadTopMessageId,\n selectCurrentMessageList,\n} from '../../selectors';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { debounce, pause, throttle } from '../../../util/schedulers';\nimport {\n isChatSummaryOnly, isChatArchived, prepareChatList, isChatBasicGroup,\n} from '../../helpers';\n\nconst TOP_CHATS_PRELOAD_PAUSE = 100;\n// We expect this ID does not exist\nconst TMP_CHAT_ID = -1;\n\nconst runThrottledForLoadChats = throttle((cb) => cb(), 1000, true);\nconst runThrottledForLoadTopChats = throttle((cb) => cb(), 3000, true);\nconst runDebouncedForLoadFullChat = debounce((cb) => cb(), 500, false, true);\n\naddReducer('preloadTopChatMessages', (global, actions) => {\n (async () => {\n const preloadedChatIds: number[] = [];\n\n for (let i = 0; i < TOP_CHAT_MESSAGES_PRELOAD_LIMIT; i++) {\n await pause(TOP_CHATS_PRELOAD_PAUSE);\n\n const {\n byId,\n listIds: { active: listIds },\n orderedPinnedIds: { active: orderedPinnedIds },\n } = getGlobal().chats;\n if (!listIds) {\n return;\n }\n\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n const { pinnedChats, otherChats } = prepareChatList(byId, listIds, orderedPinnedIds);\n const topChats = [...pinnedChats, ...otherChats];\n const chatToPreload = topChats.find(({ id }) => id !== currentChatId && !preloadedChatIds.includes(id));\n if (!chatToPreload) {\n return;\n }\n\n preloadedChatIds.push(chatToPreload.id);\n\n actions.loadViewportMessages({ chatId: chatToPreload.id, threadId: MAIN_THREAD_ID });\n }\n })();\n});\n\naddReducer('openChat', (global, actions, payload) => {\n const { id, threadId } = payload!;\n const { currentUserId } = global;\n const chat = selectChat(global, id);\n\n if (chat?.hasUnreadMark) {\n actions.toggleChatUnread({ id });\n }\n\n // Please telegram send us some updates about linked chat 🙏\n if (chat && chat.lastMessage && chat.lastMessage.threadInfo) {\n actions.requestThreadInfoUpdate({\n chatId: chat.lastMessage.threadInfo.chatId,\n threadId: chat.lastMessage.threadInfo.threadId,\n });\n }\n\n if (!chat) {\n if (id === currentUserId) {\n void callApi('fetchChat', { type: 'self' });\n } else {\n const user = selectUser(global, id);\n if (user) {\n void callApi('fetchChat', { type: 'user', user });\n }\n }\n } else if (isChatSummaryOnly(chat) && !chat.isMin) {\n actions.requestChatUpdate({ chatId: id });\n }\n\n if (threadId !== MAIN_THREAD_ID) {\n const topMessageId = selectThreadTopMessageId(global, id, threadId);\n if (!topMessageId) {\n actions.requestThreadInfoUpdate({ chatId: id, threadId });\n }\n }\n});\n\naddReducer('openSupportChat', (global, actions) => {\n const chat = selectSupportChat(global);\n\n actions.openChat({ id: chat ? chat.id : TMP_CHAT_ID });\n\n if (chat) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchChat', { type: 'support' });\n if (result) {\n actions.openChat({ id: result.chatId });\n }\n })();\n});\n\naddReducer('openTipsChat', (global, actions, payload) => {\n const { langCode } = payload;\n\n const usernamePostfix = langCode === 'pt-br'\n ? 'BR'\n : LOCALIZED_TIPS.includes(langCode) ? (langCode as string).toUpperCase() : '';\n\n actions.openChatByUsername({ username: `${TIPS_USERNAME}${usernamePostfix}` });\n});\n\naddReducer('loadMoreChats', (global, actions, payload) => {\n const { listType = 'active' } = payload!;\n const listIds = global.chats.listIds[listType as ('active' | 'archived')];\n const isFullyLoaded = global.chats.isFullyLoaded[listType as ('active' | 'archived')];\n\n if (isFullyLoaded) {\n return;\n }\n\n const oldestChat = listIds\n ? listIds\n .map((id) => global.chats.byId[id])\n .filter((chat) => Boolean(chat?.lastMessage) && !selectIsChatPinned(global, chat.id))\n .sort((chat1, chat2) => (chat1.lastMessage!.date - chat2.lastMessage!.date))[0]\n : undefined;\n\n if (oldestChat) {\n runThrottledForLoadChats(() => loadChats(listType, oldestChat.id, oldestChat.lastMessage!.date));\n } else {\n runThrottledForLoadChats(() => loadChats(listType));\n }\n});\n\naddReducer('loadFullChat', (global, actions, payload) => {\n const { chatId, force } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n if (force) {\n loadFullChat(chat);\n } else {\n runDebouncedForLoadFullChat(() => loadFullChat(chat));\n }\n});\n\naddReducer('loadTopChats', () => {\n runThrottledForLoadTopChats(() => loadChats('active'));\n});\n\naddReducer('requestChatUpdate', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n void callApi('requestChatUpdate', {\n chat,\n serverTimeOffset,\n });\n});\n\naddReducer('updateChatMutedState', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const { chatId, isMuted } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n setGlobal(updateChat(global, chatId, { isMuted }));\n void callApi('updateChatMutedState', { chat, isMuted, serverTimeOffset });\n});\n\naddReducer('createChannel', (global, actions, payload) => {\n const {\n title, about, photo, memberIds,\n } = payload!;\n\n const members = (memberIds as number[])\n .map((id: number) => selectUser(global, id))\n .filter(Boolean as any);\n\n void createChannel(title, members, about, photo);\n});\n\naddReducer('joinChannel', (global, actions, payload) => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n const { id: channelId, accessHash } = chat;\n\n if (channelId && accessHash) {\n void callApi('joinChannel', { channelId, accessHash });\n }\n});\n\naddReducer('deleteChatUser', (global, actions, payload) => {\n (async () => {\n const { chatId, userId } : { chatId: number; userId: number } = payload!;\n const chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n if (!chat || !user) {\n return;\n }\n await callApi('deleteChatUser', { chat, user });\n\n const activeChat = selectCurrentMessageList(global);\n if (activeChat && activeChat.chatId === chatId && global.currentUserId === userId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('deleteChat', (global, actions, payload) => {\n (async () => {\n const { chatId } : { chatId: number } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n await callApi('deleteChat', { chatId: chat.id });\n\n const activeChat = selectCurrentMessageList(global);\n if (activeChat && activeChat.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('leaveChannel', (global, actions, payload) => {\n (async () => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n const { id: channelId, accessHash } = chat;\n\n if (channelId && accessHash) {\n await callApi('leaveChannel', { channelId, accessHash });\n }\n\n const activeChannel = selectCurrentMessageList(global);\n if (activeChannel && activeChannel.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('deleteChannel', (global, actions, payload) => {\n (async () => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n const { id: channelId, accessHash } = chat;\n\n if (channelId && accessHash) {\n await callApi('deleteChannel', { channelId, accessHash });\n }\n\n const activeChannel = selectCurrentMessageList(global);\n if (activeChannel && activeChannel.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('createGroupChat', (global, actions, payload) => {\n const { title, memberIds, photo } = payload!;\n const members = (memberIds as number[])\n .map((id: number) => selectUser(global, id))\n .filter(Boolean as any);\n\n void createGroupChat(title, members, photo);\n});\n\naddReducer('toggleChatPinned', (global, actions, payload) => {\n const { id, folderId } = payload!;\n const chat = selectChat(global, id);\n if (!chat) {\n return;\n }\n\n if (folderId) {\n const folder = selectChatFolder(global, folderId);\n if (folder) {\n const shouldBePinned = !selectIsChatPinned(global, id, folderId);\n\n const { pinnedChatIds, includedChatIds } = folder;\n const newPinnedIds = shouldBePinned\n ? [id, ...(pinnedChatIds || [])]\n : (pinnedChatIds || []).filter((pinnedId) => pinnedId !== id);\n\n // With both Pin and Unpin we need to re-add a user to the included group\n const newIncludedChatIds = [id, ...includedChatIds];\n\n void callApi('editChatFolder', {\n id: folderId,\n folderUpdate: {\n ...folder,\n pinnedChatIds: newPinnedIds,\n includedChatIds: newIncludedChatIds,\n },\n });\n }\n } else {\n const listType = selectChatListType(global, id);\n const isPinned = selectIsChatPinned(global, id, listType === 'archived' ? ARCHIVED_FOLDER_ID : undefined);\n void callApi('toggleChatPinned', { chat, shouldBePinned: !isPinned });\n }\n});\n\naddReducer('toggleChatArchived', (global, actions, payload) => {\n const { id } = payload!;\n const chat = selectChat(global, id);\n if (chat) {\n void callApi('toggleChatArchived', {\n chat,\n folderId: isChatArchived(chat) ? 0 : ARCHIVED_FOLDER_ID,\n });\n }\n});\n\naddReducer('loadChatFolders', () => {\n void loadChatFolders();\n});\n\naddReducer('loadRecommendedChatFolders', () => {\n void loadRecommendedChatFolders();\n});\n\naddReducer('editChatFolder', (global, actions, payload) => {\n const { id, folderUpdate } = payload!;\n const folder = selectChatFolder(global, id);\n\n if (folder) {\n void callApi('editChatFolder', {\n id,\n folderUpdate: {\n id,\n emoticon: folder.emoticon,\n pinnedChatIds: folder.pinnedChatIds,\n ...folderUpdate,\n },\n });\n }\n});\n\naddReducer('addChatFolder', (global, actions, payload) => {\n const { folder } = payload!;\n const { orderedIds } = global.chatFolders;\n const maxId = orderedIds?.length ? Math.max.apply(Math.max, orderedIds) : ARCHIVED_FOLDER_ID;\n\n void createChatFolder(folder, maxId);\n});\n\naddReducer('deleteChatFolder', (global, actions, payload) => {\n const { id } = payload!;\n const folder = selectChatFolder(global, id);\n\n if (folder) {\n void deleteChatFolder(id);\n }\n});\n\naddReducer('toggleChatUnread', (global, actions, payload) => {\n const { id } = payload!;\n const { serverTimeOffset } = global;\n const chat = selectChat(global, id);\n if (chat) {\n if (chat.unreadCount) {\n void callApi('markMessageListRead', { serverTimeOffset, chat, threadId: MAIN_THREAD_ID });\n } else {\n void callApi('toggleDialogUnread', {\n chat,\n hasUnreadMark: !chat.hasUnreadMark,\n });\n }\n }\n});\n\naddReducer('openTelegramLink', (global, actions, payload) => {\n const { url } = payload!;\n let match = RE_TME_INVITE_LINK.exec(url);\n\n if (match) {\n const hash = match[1];\n\n (async () => {\n const result = await callApi('openChatByInvite', hash);\n if (!result) {\n return;\n }\n\n actions.openChat({ id: result.chatId });\n })();\n } else {\n match = RE_TME_LINK.exec(url)!;\n\n const username = match[1];\n const chatOrChannelPostId = match[2] ? Number(match[2]) : undefined;\n const messageId = match[3] ? Number(match[3]) : undefined;\n\n // Open message in private chat\n if (username === 'c' && chatOrChannelPostId && messageId) {\n actions.focusMessage({ chatId: -chatOrChannelPostId, messageId });\n } else {\n void openChatByUsername(actions, username, chatOrChannelPostId);\n }\n }\n});\n\naddReducer('acceptInviteConfirmation', (global, actions, payload) => {\n const { hash } = payload!;\n (async () => {\n const result = await callApi('importChatInvite', { hash });\n if (!result) {\n return;\n }\n\n actions.openChat({ id: result.id });\n })();\n});\n\naddReducer('openChatByUsername', (global, actions, payload) => {\n const { username } = payload!;\n\n void openChatByUsername(actions, username);\n});\n\naddReducer('togglePreHistoryHidden', (global, actions, payload) => {\n const { chatId, isEnabled } = payload!;\n let chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n void callApi('togglePreHistoryHidden', { chat, isEnabled });\n })();\n});\n\naddReducer('updateChatDefaultBannedRights', (global, actions, payload) => {\n const { chatId, bannedRights } = payload!;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('updateChatDefaultBannedRights', { chat, bannedRights });\n});\n\naddReducer('updateChatMemberBannedRights', (global, actions, payload) => {\n const { chatId, userId, bannedRights } = payload!;\n let chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n\n if (!chat || !user) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n await callApi('updateChatMemberBannedRights', { chat, user, bannedRights });\n\n const newGlobal = getGlobal();\n const chatAfterUpdate = selectChat(newGlobal, chatId);\n\n if (!chatAfterUpdate || !chatAfterUpdate.fullInfo) {\n return;\n }\n\n const { members, kickedMembers } = chatAfterUpdate.fullInfo;\n\n const isBanned = !!bannedRights.viewMessages;\n const isUnblocked = !Object.keys(bannedRights).length;\n\n setGlobal(updateChat(newGlobal, chatId, {\n fullInfo: {\n ...chatAfterUpdate.fullInfo,\n ...(members && isBanned && {\n members: members.filter((m) => m.userId !== userId),\n }),\n ...(members && !isBanned && {\n members: members.map((m) => (\n m.userId === userId\n ? { ...m, bannedRights }\n : m\n )),\n }),\n ...(isUnblocked && kickedMembers && {\n kickedMembers: kickedMembers.filter((m) => m.userId !== userId),\n }),\n },\n }));\n })();\n});\n\naddReducer('updateChatAdmin', (global, actions, payload) => {\n const {\n chatId, userId, adminRights, customTitle,\n } = payload!;\n let chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n\n if (!chat || !user) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n await callApi('updateChatAdmin', {\n chat, user, adminRights, customTitle,\n });\n\n const newGlobal = getGlobal();\n const chatAfterUpdate = selectChat(newGlobal, chatId);\n\n if (!chatAfterUpdate || !chatAfterUpdate.fullInfo) {\n return;\n }\n\n const { adminMembers } = chatAfterUpdate.fullInfo;\n\n const isDismissed = !Object.keys(adminRights).length;\n\n setGlobal(updateChat(newGlobal, chatId, {\n fullInfo: {\n ...chatAfterUpdate.fullInfo,\n ...(adminMembers && isDismissed && {\n adminMembers: adminMembers.filter((m) => m.userId !== userId),\n }),\n ...(adminMembers && !isDismissed && {\n adminMembers: adminMembers.map((m) => (\n m.userId === userId\n ? { ...m, adminRights, customTitle }\n : m\n )),\n }),\n },\n }));\n })();\n});\n\naddReducer('updateChat', (global, actions, payload) => {\n const {\n chatId, title, about, photo,\n } = payload!;\n\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n (async () => {\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.InProgress));\n\n await Promise.all([\n chat.title !== title\n ? callApi('updateChatTitle', chat, title)\n : undefined,\n chat.fullInfo && chat.fullInfo.about !== about\n ? callApi('updateChatAbout', chat, about)\n : undefined,\n photo\n ? callApi('editChatPhoto', { chatId, accessHash: chat.accessHash, photo })\n : undefined,\n ]);\n\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.Complete));\n })();\n});\n\naddReducer('toggleSignatures', (global, actions, payload) => {\n const { chatId, isEnabled } = payload!;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('toggleSignatures', { chat, isEnabled });\n});\n\naddReducer('loadGroupsForDiscussion', () => {\n (async () => {\n const groups = await callApi('fetchGroupsForDiscussion');\n if (!groups) {\n return;\n }\n\n const addedById = groups.reduce((result, group) => {\n if (group) {\n result[group.id] = group;\n }\n\n return result;\n }, {} as Record);\n\n const global = addChats(getGlobal(), addedById);\n setGlobal({\n ...global,\n chats: {\n ...global.chats,\n forDiscussionIds: Object.keys(addedById).map(Number),\n },\n });\n })();\n});\n\naddReducer('linkDiscussionGroup', (global, actions, payload) => {\n const { channelId, chatId } = payload!;\n\n const channel = selectChat(global, channelId);\n let chat = selectChat(global, chatId);\n if (!channel || !chat) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n let { fullInfo } = chat;\n if (!fullInfo) {\n const fullChat = await callApi('fetchFullChat', chat);\n if (!fullChat) {\n return;\n }\n\n fullInfo = fullChat.fullInfo;\n }\n\n if (fullInfo.isPreHistoryHidden) {\n await callApi('togglePreHistoryHidden', { chat, isEnabled: false });\n }\n\n void callApi('setDiscussionGroup', { channel, chat });\n })();\n});\n\naddReducer('unlinkDiscussionGroup', (global, actions, payload) => {\n const { channelId } = payload!;\n\n const channel = selectChat(global, channelId);\n if (!channel) {\n return;\n }\n\n let chat: ApiChat | undefined;\n if (channel.fullInfo?.linkedChatId) {\n chat = selectChat(global, channel.fullInfo.linkedChatId);\n }\n\n (async () => {\n await callApi('setDiscussionGroup', { channel });\n if (chat) {\n loadFullChat(chat);\n }\n })();\n});\n\naddReducer('setActiveChatFolder', (global, actions, payload) => {\n return {\n ...global,\n chatFolders: {\n ...global.chatFolders,\n activeChatFolder: payload,\n },\n };\n});\n\naddReducer('loadMoreMembers', (global) => {\n (async () => {\n const { chatId } = selectCurrentMessageList(global) || {};\n const chat = chatId ? selectChat(global, chatId) : undefined;\n if (!chat || isChatBasicGroup(chat)) {\n return;\n }\n\n const offset = (chat.fullInfo?.members?.length) || undefined;\n const result = await callApi('fetchMembers', chat.id, chat.accessHash!, 'recent', offset);\n if (!result) {\n return;\n }\n\n const { members, users } = result;\n if (!members || !members.length) {\n return;\n }\n\n global = getGlobal();\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = updateChat(global, chat.id, {\n fullInfo: {\n ...chat.fullInfo,\n members: [\n ...((chat.fullInfo || {}).members || []),\n ...(members || []),\n ],\n },\n });\n setGlobal(global);\n })();\n});\n\naddReducer('addChatMembers', (global, actions, payload) => {\n const { chatId, memberIds } = payload;\n const chat = selectChat(global, chatId);\n const users = (memberIds as number[]).map((userId) => selectUser(global, userId)).filter(Boolean as any);\n\n if (!chat || !users.length) {\n return;\n }\n\n actions.setNewChatMembersDialogState(NewChatMembersProgress.Loading);\n (async () => {\n await callApi('addChatMembers', chat, users);\n actions.setNewChatMembersDialogState(NewChatMembersProgress.Closed);\n loadFullChat(chat);\n })();\n});\n\naddReducer('deleteChatMember', (global, actions, payload) => {\n const { chatId, userId } = payload;\n const chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n\n if (!chat || !user) {\n return;\n }\n\n (async () => {\n await callApi('deleteChatMember', chat, user);\n loadFullChat(chat);\n })();\n});\n\nasync function loadChats(listType: 'active' | 'archived', offsetId?: number, offsetDate?: number) {\n const result = await callApi('fetchChats', {\n limit: CHAT_LIST_LOAD_SLICE,\n offsetDate,\n archived: listType === 'archived',\n withPinned: getGlobal().chats.orderedPinnedIds[listType] === undefined,\n serverTimeOffset: getGlobal().serverTimeOffset,\n });\n\n if (!result) {\n return;\n }\n\n const { chatIds } = result;\n\n if (chatIds.length > 0 && chatIds[0] === offsetId) {\n chatIds.shift();\n }\n\n let global = getGlobal();\n\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = updateChatListIds(global, listType, chatIds);\n global = updateChatListSecondaryInfo(global, listType, result);\n\n Object.keys(result.draftsById).map(Number).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'draft', result.draftsById[chatId],\n );\n });\n\n Object.keys(result.replyingToById).map(Number).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'replyingToId', result.replyingToById[chatId],\n );\n });\n\n if (chatIds.length === 0 && !global.chats.isFullyLoaded[listType]) {\n global = {\n ...global,\n chats: {\n ...global.chats,\n isFullyLoaded: {\n ...global.chats.isFullyLoaded,\n [listType]: true,\n },\n },\n };\n }\n\n setGlobal(global);\n}\n\nasync function loadFullChat(chat: ApiChat) {\n const result = await callApi('fetchFullChat', chat);\n if (!result) {\n return;\n }\n\n const { users, fullInfo } = result;\n\n let global = getGlobal();\n if (users) {\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n }\n global = updateChat(global, chat.id, { fullInfo });\n\n setGlobal(global);\n}\n\nasync function createChannel(title: string, users: ApiUser[], about?: string, photo?: File) {\n setGlobal({\n ...getGlobal(),\n chatCreation: {\n progress: ChatCreationProgress.InProgress,\n },\n });\n\n const createdChannel = await callApi('createChannel', { title, about, users });\n if (!createdChannel) {\n return;\n }\n\n const { id: channelId, accessHash } = createdChannel;\n\n let global = getGlobal();\n global = updateChat(global, channelId, createdChannel);\n global = {\n ...global,\n chatCreation: {\n ...global.chatCreation,\n progress: createdChannel ? ChatCreationProgress.Complete : ChatCreationProgress.Error,\n },\n };\n setGlobal(global);\n getDispatch().openChat({ id: channelId });\n\n if (channelId && accessHash && photo) {\n await callApi('editChatPhoto', { chatId: channelId, accessHash, photo });\n }\n}\n\nasync function createGroupChat(title: string, users: ApiUser[], photo?: File) {\n setGlobal({\n ...getGlobal(),\n chatCreation: {\n progress: ChatCreationProgress.InProgress,\n },\n });\n\n const createdChat = await callApi('createGroupChat', { title, users });\n if (!createdChat) {\n return;\n }\n\n const { id: chatId } = createdChat;\n\n let global = getGlobal();\n global = updateChat(global, chatId, createdChat);\n global = {\n ...global,\n chatCreation: {\n ...global.chatCreation,\n progress: createdChat ? ChatCreationProgress.Complete : ChatCreationProgress.Error,\n },\n };\n setGlobal(global);\n getDispatch().openChat({ id: chatId });\n\n if (chatId && photo) {\n await callApi('editChatPhoto', { chatId, photo });\n }\n}\n\nasync function loadChatFolders() {\n const chatFolders = await callApi('fetchChatFolders');\n\n if (chatFolders) {\n const global = getGlobal();\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n ...chatFolders,\n },\n });\n }\n}\n\nasync function loadRecommendedChatFolders() {\n const recommendedChatFolders = await callApi('fetchRecommendedChatFolders');\n\n if (recommendedChatFolders) {\n const global = getGlobal();\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n recommended: recommendedChatFolders,\n },\n });\n }\n}\n\nasync function createChatFolder(folder: ApiChatFolder, maxId: number) {\n // Clear fields from recommended folders\n const { id: recommendedId, description, ...newFolder } = folder;\n\n await callApi('editChatFolder', {\n id: maxId + 1,\n folderUpdate: {\n id: maxId + 1,\n ...newFolder,\n },\n });\n\n if (!description) {\n return;\n }\n\n const global = getGlobal();\n const { recommended } = global.chatFolders;\n\n if (recommended) {\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n recommended: recommended.filter(({ id }) => id !== recommendedId),\n },\n });\n }\n}\n\nasync function deleteChatFolder(id: number) {\n await callApi('deleteChatFolder', id);\n}\n\nasync function openChatByUsername(\n actions: GlobalActions,\n username: string,\n channelPostId?: number,\n) {\n const global = getGlobal();\n const localChat = selectChatByUsername(global, username);\n if (localChat && !localChat.isMin) {\n if (channelPostId) {\n actions.focusMessage({ chatId: localChat.id, messageId: channelPostId });\n } else {\n actions.openChat({ id: localChat.id });\n }\n return;\n }\n\n const previousChat = selectCurrentChat(global);\n // Open temporary empty chat to make the click response feel faster\n actions.openChat({ id: TMP_CHAT_ID });\n\n const chat = await callApi('getChatByUsername', username);\n if (!chat) {\n if (previousChat) {\n actions.openChat({ id: previousChat.id });\n }\n\n actions.showNotification({ message: 'User does not exist' });\n\n return;\n }\n\n setGlobal(updateChat(getGlobal(), chat.id, chat));\n\n if (channelPostId) {\n actions.focusMessage({ chatId: chat.id, messageId: channelPostId });\n } else {\n actions.openChat({ id: chat.id });\n }\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport {\n ApiAttachment,\n ApiChat,\n ApiMessage,\n ApiMessageEntity,\n ApiNewPoll,\n ApiOnProgress,\n ApiSticker,\n ApiVideo,\n MAIN_THREAD_ID,\n MESSAGE_DELETED,\n} from '../../../api/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { MAX_MEDIA_FILES_FOR_ALBUM, MESSAGE_LIST_SLICE } from '../../../config';\nimport { callApi, cancelApiProgress } from '../../../api/gramjs';\nimport { areSortedArraysIntersecting, buildCollectionByKey, split } from '../../../util/iteratees';\nimport {\n addUsers,\n addChatMessagesById,\n replaceThreadParam,\n safeReplaceViewportIds,\n updateChatMessage,\n addChats,\n updateListedIds,\n updateOutlyingIds,\n replaceScheduledMessages,\n updateThreadInfos,\n updateChat,\n updateThreadUnreadFromForwardedMessage,\n} from '../../reducers';\nimport {\n selectChat,\n selectChatMessage,\n selectCurrentMessageList,\n selectFocusedMessageId,\n selectCurrentChat,\n selectListedIds,\n selectOutlyingIds,\n selectViewportIds,\n selectRealLastReadId,\n selectReplyingToId,\n selectEditingId,\n selectDraft,\n selectThreadOriginChat,\n selectThreadTopMessageId,\n selectEditingScheduledId,\n selectEditingMessage,\n selectScheduledMessage,\n selectNoWebPage,\n selectFirstUnreadId,\n} from '../../selectors';\nimport { debounce, rafPromise } from '../../../util/schedulers';\nimport { IS_IOS } from '../../../util/environment';\n\nconst uploadProgressCallbacks = new Map();\n\nconst runDebouncedForMarkRead = debounce((cb) => cb(), 500, false);\n\naddReducer('loadViewportMessages', (global, actions, payload) => {\n const {\n direction = LoadMoreDirection.Around,\n isBudgetPreload = false,\n } = payload || {};\n\n let { chatId, threadId } = payload || {};\n\n if (!chatId) {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n chatId = currentMessageList.chatId;\n threadId = currentMessageList.threadId;\n }\n\n const chat = selectChat(global, chatId);\n // TODO Revise if `chat.isRestricted` check is needed\n if (!chat || chat.isRestricted) {\n return undefined;\n }\n\n const viewportIds = selectViewportIds(global, chatId, threadId);\n const listedIds = selectListedIds(global, chatId, threadId);\n const outlyingIds = selectOutlyingIds(global, chatId, threadId);\n\n if (!viewportIds || !viewportIds.length || direction === LoadMoreDirection.Around) {\n const offsetId = selectFocusedMessageId(global, chatId) || selectRealLastReadId(global, chatId, threadId);\n const isOutlying = Boolean(offsetId && listedIds && !listedIds.includes(offsetId));\n const historyIds = (isOutlying ? outlyingIds : listedIds) || [];\n const {\n newViewportIds, areSomeLocal, areAllLocal,\n } = getViewportSlice(historyIds, offsetId, LoadMoreDirection.Around);\n\n if (areSomeLocal && newViewportIds.length >= MESSAGE_LIST_SLICE) {\n global = safeReplaceViewportIds(global, chatId, threadId, newViewportIds);\n }\n\n if (!areAllLocal) {\n void loadViewportMessages(chat, threadId, offsetId, LoadMoreDirection.Around, isOutlying, isBudgetPreload);\n }\n } else {\n const offsetId = direction === LoadMoreDirection.Backwards ? viewportIds[0] : viewportIds[viewportIds.length - 1];\n const isOutlying = Boolean(outlyingIds);\n const historyIds = (isOutlying ? outlyingIds : listedIds)!;\n const {\n newViewportIds, areSomeLocal, areAllLocal,\n } = getViewportSlice(historyIds, offsetId, direction);\n\n if (areSomeLocal) {\n global = safeReplaceViewportIds(global, chatId, threadId, newViewportIds);\n }\n\n void loadWithBudget(actions, areAllLocal, isOutlying, isBudgetPreload, chat, threadId, direction, offsetId);\n\n if (isBudgetPreload) {\n return undefined;\n }\n }\n\n return global;\n});\n\nasync function loadWithBudget(\n actions: GlobalActions,\n areAllLocal: boolean, isOutlying: boolean, isBudgetPreload: boolean,\n chat: ApiChat, threadId: number, direction: LoadMoreDirection, offsetId?: number,\n) {\n if (!areAllLocal) {\n await loadViewportMessages(\n chat, threadId, offsetId, direction, isOutlying, isBudgetPreload,\n );\n }\n\n if (!isBudgetPreload) {\n // Let reducer return and update global\n await Promise.resolve();\n actions.loadViewportMessages({\n chatId: chat.id, threadId, direction, isBudgetPreload: true,\n });\n }\n}\n\naddReducer('loadMessage', (global, actions, payload) => {\n const {\n chatId, messageId, replyOriginForId, threadUpdate,\n } = payload!;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n (async () => {\n const message = await loadMessage(chat, messageId, replyOriginForId);\n if (message && threadUpdate) {\n const { lastMessageId, isDeleting } = threadUpdate;\n\n setGlobal(updateThreadUnreadFromForwardedMessage(\n getGlobal(),\n message,\n chatId,\n lastMessageId,\n isDeleting,\n ));\n }\n })();\n});\n\naddReducer('sendMessage', (global, actions, payload) => {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n const { chatId, threadId, type } = currentMessageList;\n\n if (type === 'scheduled' && !payload.scheduledAt) {\n return {\n ...global,\n messages: {\n ...global.messages,\n contentToBeScheduled: payload,\n },\n };\n }\n\n const chat = selectChat(global, chatId)!;\n\n actions.setReplyingToId({ messageId: undefined });\n actions.clearWebPagePreview({ chatId, threadId, value: false });\n\n const params = {\n ...payload,\n chat,\n replyingTo: selectReplyingToId(global, chatId, threadId),\n noWebPage: selectNoWebPage(global, chatId, threadId),\n };\n\n const isSingle = !payload.attachments || payload.attachments.length <= 1;\n const isGrouped = !isSingle && payload.attachments && payload.attachments.length > 1;\n\n if (isSingle) {\n const { attachments, ...restParams } = params;\n sendMessage({\n ...restParams,\n attachment: attachments ? attachments[0] : undefined,\n });\n } else if (isGrouped) {\n const {\n text, entities, attachments, ...commonParams\n } = params;\n const groupedAttachments = split(attachments, MAX_MEDIA_FILES_FOR_ALBUM);\n for (let i = 0; i < groupedAttachments.length; i++) {\n const [firstAttachment, ...restAttachments] = groupedAttachments[i];\n const groupedId = `${Date.now()}${i}`;\n\n sendMessage({\n ...commonParams,\n text: i === 0 ? text : undefined,\n entities: i === 0 ? entities : undefined,\n attachment: firstAttachment,\n groupedId: restAttachments.length > 0 ? groupedId : undefined,\n });\n\n restAttachments.forEach((attachment: ApiAttachment) => {\n sendMessage({\n ...commonParams,\n attachment,\n groupedId,\n });\n });\n }\n } else {\n const {\n text, entities, attachments, replyingTo, ...commonParams\n } = params;\n\n if (text) {\n sendMessage({\n ...commonParams,\n text,\n entities,\n replyingTo,\n });\n }\n\n attachments.forEach((attachment: ApiAttachment) => {\n sendMessage({\n ...commonParams,\n attachment,\n });\n });\n }\n\n return undefined;\n});\n\naddReducer('editMessage', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const { text, entities } = payload!;\n\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId, threadId, type: messageListType } = currentMessageList;\n const chat = selectChat(global, chatId);\n const message = selectEditingMessage(global, chatId, threadId, messageListType);\n if (!chat || !message) {\n return;\n }\n\n void callApi('editMessage', {\n chat, message, text, entities, noWebPage: selectNoWebPage(global, chatId, threadId), serverTimeOffset,\n });\n\n actions.setEditingId({ messageId: undefined });\n});\n\naddReducer('cancelSendingMessage', (global, actions, payload) => {\n const { chatId, messageId } = payload!;\n const message = selectChatMessage(global, chatId, messageId);\n const progressCallback = message && uploadProgressCallbacks.get(message.previousLocalId || message.id);\n if (progressCallback) {\n cancelApiProgress(progressCallback);\n }\n\n actions.apiUpdate({\n '@type': 'deleteMessages',\n ids: [messageId],\n chatId,\n });\n});\n\naddReducer('saveDraft', (global, actions, payload) => {\n const { chatId, threadId, draft } = payload!;\n if (!draft) {\n return undefined;\n }\n\n const { text, entities } = draft;\n const chat = selectChat(global, chatId)!;\n\n if (threadId === MAIN_THREAD_ID) {\n void callApi('saveDraft', {\n chat,\n text,\n entities,\n replyToMsgId: selectReplyingToId(global, chatId, threadId),\n });\n }\n\n global = replaceThreadParam(global, chatId, threadId, 'draft', draft);\n global = updateChat(global, chatId, { draftDate: Math.round(Date.now() / 1000) });\n\n return global;\n});\n\naddReducer('clearDraft', (global, actions, payload) => {\n const { chatId, threadId, localOnly } = payload!;\n if (!selectDraft(global, chatId, threadId)) {\n return undefined;\n }\n\n const chat = selectChat(global, chatId)!;\n\n if (!localOnly && threadId === MAIN_THREAD_ID) {\n void callApi('clearDraft', chat);\n }\n\n global = replaceThreadParam(global, chatId, threadId, 'draft', undefined);\n global = updateChat(global, chatId, { draftDate: undefined });\n\n return global;\n});\n\naddReducer('toggleMessageWebPage', (global, actions, payload) => {\n const { chatId, threadId, noWebPage } = payload!;\n\n return replaceThreadParam(global, chatId, threadId, 'noWebPage', noWebPage);\n});\n\naddReducer('pinMessage', (global, actions, payload) => {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return;\n }\n\n const {\n messageId, isUnpin, isOneSide, isSilent,\n } = payload!;\n\n void callApi('pinMessage', {\n chat, messageId, isUnpin, isOneSide, isSilent,\n });\n});\n\naddReducer('unpinAllMessages', (global, actions, payload) => {\n const chat = selectChat(global, payload.chatId);\n if (!chat) {\n return;\n }\n\n void unpinAllMessages(chat);\n});\n\nasync function unpinAllMessages(chat: ApiChat) {\n await callApi('unpinAllMessages', { chat });\n let global = getGlobal();\n global = replaceThreadParam(global, chat.id, MAIN_THREAD_ID, 'pinnedIds', []);\n setGlobal(global);\n}\n\naddReducer('deleteMessages', (global, actions, payload) => {\n const { messageIds, shouldDeleteForAll } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n const { chatId, threadId } = currentMessageList;\n const chat = selectChat(global, chatId)!;\n\n void callApi('deleteMessages', { chat, messageIds, shouldDeleteForAll });\n\n const editingId = selectEditingId(global, chatId, threadId);\n if (messageIds.includes(editingId)) {\n actions.setEditingId({ messageId: undefined });\n }\n});\n\naddReducer('deleteScheduledMessages', (global, actions, payload) => {\n const { messageIds } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId } = currentMessageList;\n const chat = selectChat(global, chatId)!;\n\n void callApi('deleteScheduledMessages', { chat, messageIds });\n\n const editingId = selectEditingScheduledId(global, chatId);\n if (messageIds.includes(editingId)) {\n actions.setEditingId({ messageId: undefined });\n }\n});\n\naddReducer('deleteHistory', (global, actions, payload) => {\n (async () => {\n const { chatId, shouldDeleteForAll } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n const maxId = chat.lastMessage?.id;\n\n await callApi('deleteHistory', { chat, shouldDeleteForAll, maxId });\n\n const activeChat = selectCurrentMessageList(global);\n if (activeChat && activeChat.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('reportMessages', (global, actions, payload) => {\n (async () => {\n const {\n messageIds, reason, description,\n } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId } = currentMessageList;\n const chat = selectChat(global, chatId)!;\n\n const result = await callApi('reportMessages', {\n peer: chat, messageIds, reason, description,\n });\n\n actions.showNotification({\n message: result\n ? 'Thank you! Your report will be reviewed by our team.'\n : 'Error occured while submiting report. Please, try again later.',\n });\n })();\n});\n\naddReducer('markMessageListRead', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n const { chatId, threadId } = currentMessageList;\n const chat = selectThreadOriginChat(global, chatId, threadId);\n if (!chat) {\n return undefined;\n }\n\n const { maxId } = payload!;\n\n runDebouncedForMarkRead(() => {\n void callApi('markMessageListRead', {\n serverTimeOffset, chat, threadId, maxId,\n });\n });\n\n // TODO Support local marking read for threads\n if (threadId !== MAIN_THREAD_ID) {\n return undefined;\n }\n\n const viewportIds = selectViewportIds(global, chatId, threadId);\n const minId = selectFirstUnreadId(global, chatId, threadId);\n if (!viewportIds || !minId || !chat.unreadCount) {\n return undefined;\n }\n\n const readCount = countSortedIds(viewportIds!, minId, maxId);\n if (!readCount) {\n return undefined;\n }\n\n return updateChat(global, chatId, {\n lastReadInboxMessageId: maxId,\n unreadCount: Math.max(0, chat.unreadCount - readCount),\n });\n});\n\naddReducer('markMessagesRead', (global, actions, payload) => {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return;\n }\n\n const { messageIds } = payload!;\n\n void callApi('markMessagesRead', { chat, messageIds });\n});\n\naddReducer('loadWebPagePreview', (global, actions, payload) => {\n const { text } = payload!;\n void loadWebPagePreview(text);\n});\n\naddReducer('clearWebPagePreview', (global) => {\n if (!global.webPagePreview) {\n return undefined;\n }\n\n return {\n ...global,\n webPagePreview: undefined,\n };\n});\n\naddReducer('sendPollVote', (global, actions, payload) => {\n const { chatId, messageId, options } = payload!;\n const chat = selectChat(global, chatId);\n\n if (chat) {\n void callApi('sendPollVote', { chat, messageId, options });\n }\n});\n\naddReducer('loadPollOptionResults', (global, actions, payload) => {\n const {\n chat, messageId, option, offset, limit, shouldResetVoters,\n } = payload!;\n\n void loadPollOptionResults(chat, messageId, option, offset, limit, shouldResetVoters);\n});\n\naddReducer('forwardMessages', (global) => {\n const { fromChatId, messageIds, toChatId } = global.forwardMessages;\n const fromChat = fromChatId ? selectChat(global, fromChatId) : undefined;\n const toChat = toChatId ? selectChat(global, toChatId) : undefined;\n const messages = fromChatId && messageIds\n ? messageIds\n .sort((a, b) => a - b)\n .map((id) => selectChatMessage(global, fromChatId, id)).filter(Boolean as any)\n : undefined;\n\n if (fromChat && toChat && messages && messages.length) {\n void forwardMessages(fromChat, toChat, messages);\n }\n});\n\naddReducer('loadScheduledHistory', (global) => {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return;\n }\n\n const { hash } = global.scheduledMessages.byChatId[chat.id] || {};\n\n void loadScheduledHistory(chat, hash);\n});\n\naddReducer('sendScheduledMessages', (global, actions, payload) => {\n const {\n chatId, id,\n } = payload!;\n\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('sendScheduledMessages', {\n chat,\n ids: [id],\n });\n});\n\naddReducer('rescheduleMessage', (global, actions, payload) => {\n const {\n chatId, messageId, scheduledAt,\n } = payload!;\n\n const chat = selectChat(global, chatId);\n const message = chat && selectScheduledMessage(global, chat.id, messageId);\n if (!chat || !message) {\n return;\n }\n\n void callApi('rescheduleMessage', {\n chat,\n message,\n scheduledAt,\n });\n});\n\naddReducer('requestThreadInfoUpdate', (global, actions, payload) => {\n const { chatId, threadId } = payload;\n const chat = selectThreadOriginChat(global, chatId, threadId);\n if (!chat) {\n return;\n }\n\n void callApi('requestThreadInfoUpdate', { chat, threadId });\n});\n\nasync function loadWebPagePreview(message: string) {\n const webPagePreview = await callApi('fetchWebPagePreview', { message });\n\n setGlobal({\n ...getGlobal(),\n webPagePreview,\n });\n}\n\nasync function loadViewportMessages(\n chat: ApiChat,\n threadId: number,\n offsetId: number | undefined,\n direction: LoadMoreDirection,\n isOutlying = false,\n isBudgetPreload = false,\n) {\n const chatId = chat.id;\n\n let addOffset: number | undefined;\n switch (direction) {\n case LoadMoreDirection.Backwards:\n addOffset = undefined;\n break;\n case LoadMoreDirection.Around:\n addOffset = -(Math.round(MESSAGE_LIST_SLICE / 2) + 1);\n break;\n case LoadMoreDirection.Forwards:\n addOffset = -(MESSAGE_LIST_SLICE + 1);\n break;\n }\n\n const result = await callApi('fetchMessages', {\n chat: selectThreadOriginChat(getGlobal(), chatId, threadId)!,\n offsetId,\n addOffset,\n limit: MESSAGE_LIST_SLICE,\n threadId,\n });\n\n if (!result) {\n return;\n }\n\n const {\n messages, users, chats, threadInfos,\n } = result;\n\n const byId = buildCollectionByKey(messages, 'id');\n const ids = Object.keys(byId).map(Number);\n\n let global = getGlobal();\n\n global = addChatMessagesById(global, chatId, byId);\n global = isOutlying\n ? updateOutlyingIds(global, chatId, threadId, ids)\n : updateListedIds(global, chatId, threadId, ids);\n\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = addChats(global, buildCollectionByKey(chats, 'id'));\n global = updateThreadInfos(global, chatId, threadInfos);\n\n let listedIds = selectListedIds(global, chatId, threadId);\n const outlyingIds = selectOutlyingIds(global, chatId, threadId);\n\n if (isOutlying && listedIds && outlyingIds) {\n if (!outlyingIds.length || areSortedArraysIntersecting(listedIds, outlyingIds)) {\n global = updateListedIds(global, chatId, threadId, outlyingIds);\n listedIds = selectListedIds(global, chatId, threadId);\n global = replaceThreadParam(global, chatId, threadId, 'outlyingIds', undefined);\n isOutlying = false;\n }\n }\n\n if (!isBudgetPreload) {\n const historyIds = isOutlying ? outlyingIds! : listedIds!;\n const { newViewportIds } = getViewportSlice(historyIds, offsetId, direction);\n global = safeReplaceViewportIds(global, chatId, threadId, newViewportIds!);\n }\n\n setGlobal(global);\n}\n\nasync function loadMessage(chat: ApiChat, messageId: number, replyOriginForId: number) {\n const result = await callApi('fetchMessage', { chat, messageId });\n if (!result) {\n return undefined;\n }\n\n if (result === MESSAGE_DELETED) {\n if (replyOriginForId) {\n let global = getGlobal();\n const replyMessage = selectChatMessage(global, chat.id, replyOriginForId);\n global = updateChatMessage(global, chat.id, replyOriginForId, {\n ...replyMessage,\n replyToMessageId: undefined,\n });\n setGlobal(global);\n }\n\n return undefined;\n }\n\n let global = getGlobal();\n global = updateChatMessage(global, chat.id, messageId, result.message);\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n setGlobal(global);\n\n return result.message;\n}\n\nfunction findClosestIndex(sourceIds: number[], offsetId: number) {\n if (offsetId < sourceIds[0]) {\n return 0;\n }\n\n if (offsetId > sourceIds[sourceIds.length - 1]) {\n return sourceIds.length - 1;\n }\n\n return sourceIds.findIndex((id, i) => (\n id === offsetId\n || (id < offsetId && sourceIds[i + 1] > offsetId)\n ));\n}\n\nfunction getViewportSlice(\n sourceIds: number[],\n offsetId: number | undefined,\n direction: LoadMoreDirection,\n) {\n const { length } = sourceIds;\n const index = offsetId ? findClosestIndex(sourceIds, offsetId) : -1;\n const isBackwards = direction === LoadMoreDirection.Backwards;\n const indexForDirection = isBackwards ? index : (index + 1) || length;\n const from = indexForDirection - MESSAGE_LIST_SLICE;\n const to = indexForDirection + MESSAGE_LIST_SLICE - 1;\n const newViewportIds = sourceIds.slice(Math.max(0, from), to + 1);\n\n let areSomeLocal;\n let areAllLocal;\n switch (direction) {\n case LoadMoreDirection.Backwards:\n areSomeLocal = indexForDirection > 0;\n areAllLocal = from >= 0;\n break;\n case LoadMoreDirection.Forwards:\n areSomeLocal = indexForDirection < length;\n areAllLocal = to <= length - 1;\n break;\n case LoadMoreDirection.Around:\n default:\n areSomeLocal = newViewportIds.length > 0;\n areAllLocal = newViewportIds.length === MESSAGE_LIST_SLICE;\n break;\n }\n\n return { newViewportIds, areSomeLocal, areAllLocal };\n}\n\nasync function sendMessage(params: {\n chat: ApiChat;\n text: string;\n entities: ApiMessageEntity[];\n replyingTo: number;\n attachment: ApiAttachment;\n sticker: ApiSticker;\n gif: ApiVideo;\n poll: ApiNewPoll;\n serverTimeOffset?: number;\n}) {\n let localId: number | undefined;\n const progressCallback = params.attachment ? (progress: number, messageLocalId: number) => {\n if (!uploadProgressCallbacks.has(messageLocalId)) {\n localId = messageLocalId;\n uploadProgressCallbacks.set(messageLocalId, progressCallback!);\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n fileUploads: {\n byMessageLocalId: {\n ...global.fileUploads.byMessageLocalId,\n [messageLocalId]: { progress },\n },\n },\n });\n } : undefined;\n\n // @optimization\n if (params.replyingTo || IS_IOS) {\n await rafPromise();\n }\n\n const global = getGlobal();\n params.serverTimeOffset = global.serverTimeOffset;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n const { threadId } = currentMessageList;\n\n if (!params.replyingTo && threadId !== MAIN_THREAD_ID) {\n params.replyingTo = selectThreadTopMessageId(global, params.chat.id, threadId)!;\n }\n\n await callApi('sendMessage', params, progressCallback);\n\n if (progressCallback && localId) {\n uploadProgressCallbacks.delete(localId);\n }\n}\n\nfunction forwardMessages(\n fromChat: ApiChat,\n toChat: ApiChat,\n messages: ApiMessage[],\n) {\n callApi('forwardMessages', {\n fromChat,\n toChat,\n messages,\n serverTimeOffset: getGlobal().serverTimeOffset,\n });\n\n setGlobal({\n ...getGlobal(),\n forwardMessages: {},\n });\n}\n\nasync function loadPollOptionResults(\n chat: ApiChat,\n messageId: number,\n option: string,\n offset?: string,\n limit?: number,\n shouldResetVoters?: boolean,\n) {\n const result = await callApi('loadPollOptionResults', {\n chat, messageId, option, offset, limit,\n });\n\n if (!result) {\n return;\n }\n\n const isUnique = (v: number, i: number, a: number[]) => a.indexOf(v) === i;\n let global = getGlobal();\n\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n const { voters } = global.pollResults;\n\n setGlobal({\n ...global,\n pollResults: {\n ...global.pollResults,\n voters: {\n ...voters,\n [option]: [\n ...(!shouldResetVoters && voters && voters[option] ? voters[option] : []),\n ...(result && result.users.map((user) => user.id)),\n ].filter(isUnique),\n },\n offsets: {\n ...(global.pollResults.offsets ? global.pollResults.offsets : {}),\n [option]: result.nextOffset || '',\n },\n },\n });\n}\n\naddReducer('loadPinnedMessages', (global, actions, payload) => {\n const { chatId } = payload;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n void loadPinnedMessages(chat);\n});\n\nasync function loadPinnedMessages(chat: ApiChat) {\n const result = await callApi('fetchPinnedMessages', { chat });\n if (!result) {\n return;\n }\n\n const { messages, chats, users } = result;\n\n const byId = buildCollectionByKey(messages, 'id');\n const ids = Object.keys(byId).map(Number).sort((a, b) => b - a);\n\n let global = getGlobal();\n global = addChatMessagesById(global, chat.id, byId);\n global = replaceThreadParam(global, chat.id, MAIN_THREAD_ID, 'pinnedIds', ids);\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = addChats(global, buildCollectionByKey(chats, 'id'));\n setGlobal(global);\n}\n\nasync function loadScheduledHistory(chat: ApiChat, historyHash?: number) {\n const result = await callApi('fetchScheduledHistory', { chat, hash: historyHash });\n if (!result) {\n return;\n }\n\n const { hash, messages } = result;\n\n const byId = buildCollectionByKey(messages, 'id');\n const ids = Object.keys(byId).map(Number).sort((a, b) => b - a);\n\n let global = getGlobal();\n global = replaceScheduledMessages(global, chat.id, byId, hash);\n global = replaceThreadParam(global, chat.id, MAIN_THREAD_ID, 'scheduledIds', ids);\n setGlobal(global);\n}\n\nfunction countSortedIds(ids: number[], from: number, to: number) {\n let count = 0;\n\n for (let i = 0, l = ids.length; i < l; i++) {\n if (ids[i] >= from && ids[i] <= to) {\n count++;\n }\n\n if (ids[i] >= to) {\n break;\n }\n }\n\n return count;\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../api/types';\nimport { LangCode } from '../../../types';\nimport { callApi } from '../../../api/gramjs';\nimport { pause, throttle } from '../../../util/schedulers';\nimport {\n updateStickerSets,\n updateStickerSet,\n replaceAnimatedEmojis,\n updateGifSearch,\n updateStickersForEmoji,\n rebuildStickersForEmoji,\n} from '../../reducers';\nimport searchWords from '../../../util/searchWords';\nimport { selectStickerSet } from '../../selectors';\n\nconst ADDED_SETS_THROTTLE = 500;\nconst ADDED_SETS_THROTTLE_CHUNK = 50;\n\nconst searchThrottled = throttle((cb) => cb(), 500, false);\n\naddReducer('loadStickerSets', (global) => {\n const { hash } = global.stickers.added || {};\n void loadStickerSets(hash);\n});\n\naddReducer('loadAddedStickers', (global, actions) => {\n const { setIds: addedSetIds } = global.stickers.added;\n if (!addedSetIds || !addedSetIds.length) {\n return;\n }\n\n (async () => {\n for (let i = 0; i < addedSetIds.length; i++) {\n actions.loadStickers({ stickerSetId: addedSetIds[i] });\n\n if (i % ADDED_SETS_THROTTLE_CHUNK === 0 && i > 0) {\n await pause(ADDED_SETS_THROTTLE);\n }\n }\n })();\n});\n\naddReducer('loadRecentStickers', (global) => {\n const { hash } = global.stickers.recent || {};\n void loadRecentStickers(hash);\n});\n\naddReducer('loadFavoriteStickers', (global) => {\n const { hash } = global.stickers.favorite || {};\n void loadFavoriteStickers(hash);\n});\n\naddReducer('loadGreetingStickers', (global) => {\n const { hash } = global.stickers.greeting || {};\n\n (async () => {\n const greeting = await callApi('fetchStickersForEmoji', { emoji: '👋⭐️', hash });\n\n if (!greeting) {\n return;\n }\n\n const newGlobal = getGlobal();\n\n setGlobal({\n ...newGlobal,\n stickers: {\n ...newGlobal.stickers,\n greeting: {\n hash: greeting.hash,\n stickers: greeting.stickers.filter((sticker) => sticker.emoji === '👋'),\n },\n },\n });\n })();\n});\n\naddReducer('loadFeaturedStickers', (global) => {\n const { hash } = global.stickers.featured || {};\n void loadFeaturedStickers(hash);\n});\n\naddReducer('loadStickers', (global, actions, payload) => {\n const { stickerSetId, stickerSetShortName } = payload!;\n let { stickerSetAccessHash } = payload!;\n\n if (!stickerSetAccessHash && !stickerSetShortName) {\n const stickerSet = selectStickerSet(global, stickerSetId);\n if (!stickerSet) {\n return;\n }\n\n stickerSetAccessHash = stickerSet.accessHash;\n }\n\n void loadStickers(stickerSetId, stickerSetAccessHash, stickerSetShortName);\n});\n\naddReducer('loadAnimatedEmojis', () => {\n void loadAnimatedEmojis();\n});\n\naddReducer('loadSavedGifs', (global) => {\n const { hash } = global.gifs.saved;\n void loadSavedGifs(hash);\n});\n\naddReducer('faveSticker', (global, actions, payload) => {\n const { sticker } = payload!;\n\n if (sticker) {\n void callApi('faveSticker', { sticker });\n }\n});\n\naddReducer('unfaveSticker', (global, actions, payload) => {\n const { sticker } = payload!;\n\n if (sticker) {\n void unfaveSticker(sticker);\n }\n});\n\naddReducer('toggleStickerSet', (global, actions, payload) => {\n const { stickerSetId } = payload!;\n const stickerSet = selectStickerSet(global, stickerSetId);\n if (!stickerSet) {\n return;\n }\n\n const { accessHash, installedDate } = stickerSet;\n\n void callApi(!installedDate ? 'installStickerSet' : 'uninstallStickerSet', { stickerSetId, accessHash });\n});\n\naddReducer('loadEmojiKeywords', (global, actions, payload: { language: LangCode }) => {\n const { language } = payload;\n\n let currentEmojiKeywords = global.emojiKeywords[language];\n if (currentEmojiKeywords?.isLoading) {\n return;\n }\n\n setGlobal({\n ...global,\n emojiKeywords: {\n ...global.emojiKeywords,\n [language]: {\n ...currentEmojiKeywords,\n isLoading: true,\n },\n },\n });\n\n (async () => {\n const emojiKeywords = await callApi('fetchEmojiKeywords', {\n language,\n fromVersion: currentEmojiKeywords ? currentEmojiKeywords.version : 0,\n });\n\n global = getGlobal();\n currentEmojiKeywords = global.emojiKeywords[language];\n\n if (!emojiKeywords) {\n setGlobal({\n ...global,\n emojiKeywords: {\n ...global.emojiKeywords,\n [language]: {\n ...currentEmojiKeywords,\n isLoading: false,\n },\n },\n });\n\n return;\n }\n\n setGlobal({\n ...global,\n emojiKeywords: {\n ...global.emojiKeywords,\n [language]: {\n isLoading: false,\n version: emojiKeywords.version,\n keywords: {\n ...(currentEmojiKeywords?.keywords),\n ...emojiKeywords.keywords,\n },\n },\n },\n });\n })();\n});\n\nasync function loadStickerSets(hash = 0) {\n const addedStickers = await callApi('fetchStickerSets', { hash });\n if (!addedStickers) {\n return;\n }\n\n setGlobal(updateStickerSets(\n getGlobal(),\n 'added',\n addedStickers.hash,\n addedStickers.sets,\n ));\n}\n\nasync function loadRecentStickers(hash = 0) {\n const recentStickers = await callApi('fetchRecentStickers', { hash });\n if (!recentStickers) {\n return;\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n stickers: {\n ...global.stickers,\n recent: recentStickers,\n },\n });\n}\n\nasync function loadFavoriteStickers(hash = 0) {\n const favoriteStickers = await callApi('fetchFavoriteStickers', { hash });\n if (!favoriteStickers) {\n return;\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n stickers: {\n ...global.stickers,\n favorite: favoriteStickers,\n },\n });\n}\n\nasync function loadFeaturedStickers(hash = 0) {\n const featuredStickers = await callApi('fetchFeaturedStickers', { hash });\n if (!featuredStickers) {\n return;\n }\n\n setGlobal(updateStickerSets(\n getGlobal(),\n 'featured',\n featuredStickers.hash,\n featuredStickers.sets,\n ));\n}\n\nasync function loadStickers(stickerSetId: string, accessHash: string, stickerSetShortName?: string) {\n const stickerSet = await callApi('fetchStickers',\n { stickerSetShortName, stickerSetId, accessHash });\n if (!stickerSet) {\n return;\n }\n\n const { set, stickers, packs } = stickerSet;\n\n let global = getGlobal();\n\n global = updateStickerSet(global, set.id, { ...set, stickers, packs });\n\n const currentEmoji = global.stickers.forEmoji.emoji;\n if (currentEmoji && packs[currentEmoji]) {\n global = rebuildStickersForEmoji(global);\n }\n\n setGlobal(global);\n}\n\nasync function loadAnimatedEmojis() {\n const stickerSet = await callApi('fetchAnimatedEmojis');\n if (!stickerSet) {\n return;\n }\n\n const { set, stickers } = stickerSet;\n\n setGlobal(replaceAnimatedEmojis(getGlobal(), { ...set, stickers }));\n}\n\nfunction unfaveSticker(sticker: ApiSticker) {\n const global = getGlobal();\n\n // Remove sticker preemptively to get instant feedback when user removes sticker\n // from favorites while in Sticker Picker\n setGlobal({\n ...global,\n stickers: {\n ...global.stickers,\n favorite: {\n ...global.stickers.favorite,\n stickers: global.stickers.favorite.stickers.filter(({ id }) => id !== sticker.id),\n },\n },\n });\n\n void callApi('faveSticker', { sticker, unfave: true });\n}\n\naddReducer('setStickerSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n if (query) {\n void searchThrottled(() => {\n searchStickers(query);\n });\n }\n});\n\naddReducer('setGifSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n if (typeof query === 'string') {\n void searchThrottled(() => {\n searchGifs(query);\n });\n }\n});\n\naddReducer('searchMoreGifs', (global) => {\n const { query, offset } = global.gifs.search;\n\n if (typeof query === 'string') {\n void searchThrottled(() => {\n searchGifs(query, offset);\n });\n }\n});\n\naddReducer('loadStickersForEmoji', (global, actions, payload) => {\n const { emoji } = payload!;\n const { hash } = global.stickers.forEmoji;\n\n void searchThrottled(() => {\n loadStickersForEmoji(emoji, hash);\n });\n});\n\naddReducer('clearStickersForEmoji', (global) => {\n return {\n ...global,\n stickers: {\n ...global.stickers,\n forEmoji: {},\n },\n };\n});\n\naddReducer('openStickerSetShortName', (global, actions, payload) => {\n const { stickerSetShortName } = payload!;\n return {\n ...global,\n openedStickerSetShortName: stickerSetShortName,\n };\n});\n\nasync function searchStickers(query: string, hash = 0) {\n const result = await callApi('searchStickers', { query, hash });\n\n if (!result) {\n return;\n }\n\n const global = getGlobal();\n const { setsById, added } = global.stickers;\n\n const resultIds = result.sets.map(({ id }) => id);\n\n if (added.setIds) {\n added.setIds.forEach((id) => {\n if (!resultIds.includes(id)) {\n const { title } = setsById[id] || {};\n if (title && searchWords(title, query)) {\n resultIds.unshift(id);\n }\n }\n });\n }\n\n setGlobal(updateStickerSets(\n global,\n 'search',\n result.hash,\n result.sets,\n resultIds,\n ));\n}\n\nasync function searchGifs(query: string, offset?: string) {\n const result = await callApi('searchGifs', { query, offset });\n if (!result) {\n return;\n }\n\n setGlobal(updateGifSearch(getGlobal(), !offset, result.gifs, result.nextOffset));\n}\n\nasync function loadSavedGifs(hash = 0) {\n const savedGifs = await callApi('fetchSavedGifs', { hash });\n if (!savedGifs) {\n return;\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n gifs: {\n ...global.gifs,\n saved: savedGifs,\n },\n });\n}\n\nasync function loadStickersForEmoji(emoji: string, hash = 0) {\n let global = getGlobal();\n setGlobal({\n ...global,\n stickers: {\n ...global.stickers,\n forEmoji: {\n ...global.stickers.forEmoji,\n emoji,\n },\n },\n });\n\n const result = await callApi('fetchStickersForEmoji', { emoji, hash });\n\n global = getGlobal();\n\n if (!result || global.stickers.forEmoji.emoji !== emoji) {\n return;\n }\n\n global = updateStickersForEmoji(global, emoji, result.stickers, result.hash);\n\n setGlobal(global);\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { callApi } from '../../../api/gramjs';\nimport { ApiChat, ApiGlobalMessageSearchType } from '../../../api/types';\n\nimport {\n addChats,\n addMessages,\n addUsers,\n updateGlobalSearch,\n updateGlobalSearchFetchingStatus,\n updateGlobalSearchResults,\n} from '../../reducers';\nimport { throttle } from '../../../util/schedulers';\nimport { selectChat, selectCurrentGlobalSearchQuery } from '../../selectors';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { GLOBAL_SEARCH_SLICE } from '../../../config';\nimport { timestampPlusDay } from '../../../util/dateFormat';\n\nconst searchThrottled = throttle((cb) => cb(), 500, false);\n\naddReducer('setGlobalSearchQuery', (global, actions, payload) => {\n const { chatId } = global.globalSearch;\n const { query } = payload!;\n\n if (query && !chatId) {\n void searchThrottled(() => {\n searchChats(query);\n });\n }\n});\n\naddReducer('setGlobalSearchDate', (global, actions, payload) => {\n const { date } = payload!;\n const maxDate = date ? timestampPlusDay(date) : date;\n const newGlobal = updateGlobalSearch(global, {\n date,\n query: '',\n resultsByType: {\n ...global.globalSearch.resultsByType,\n text: {\n totalCount: undefined,\n foundIds: [],\n nextOffsetId: 0,\n },\n },\n });\n setGlobal(newGlobal);\n const { chatId } = global.globalSearch;\n const chat = chatId ? selectChat(global, chatId) : undefined;\n searchMessagesGlobal('', 'text', undefined, chat, maxDate, date);\n});\n\naddReducer('searchMessagesGlobal', (global, actions, payload) => {\n const {\n query, resultsByType, chatId, date,\n } = global.globalSearch;\n const maxDate = date ? timestampPlusDay(date) : date;\n const { type } = payload;\n const nextOffsetId = (resultsByType?.[type as ApiGlobalMessageSearchType])?.nextOffsetId;\n\n const chat = chatId ? selectChat(global, chatId) : undefined;\n\n searchMessagesGlobal(query, type, nextOffsetId, chat, maxDate, date);\n});\n\nasync function searchChats(query: string) {\n const result = await callApi('searchChats', { query });\n\n let global = getGlobal();\n const currentSearchQuery = selectCurrentGlobalSearchQuery(global);\n if (!result || !currentSearchQuery || (query !== currentSearchQuery)) {\n setGlobal(updateGlobalSearchFetchingStatus(global, { chats: false }));\n return;\n }\n\n const {\n localChats, localUsers, globalChats, globalUsers,\n } = result;\n\n if (localChats.length || globalChats.length) {\n global = addChats(global, buildCollectionByKey([...localChats, ...globalChats], 'id'));\n }\n\n if (localUsers.length || globalUsers.length) {\n global = addUsers(global, buildCollectionByKey([...localUsers, ...globalUsers], 'id'));\n }\n\n global = updateGlobalSearchFetchingStatus(global, { chats: false });\n global = updateGlobalSearch(global, {\n localResults: {\n chatIds: localChats.map(({ id }) => id),\n userIds: localUsers.map(({ id }) => id),\n },\n globalResults: {\n ...global.globalSearch.globalResults,\n chatIds: globalUsers.map(({ id }) => id),\n userIds: globalChats.map(({ id }) => id),\n },\n });\n\n setGlobal(global);\n}\n\nasync function searchMessagesGlobal(\n query = '', type: ApiGlobalMessageSearchType, offsetRate?: number, chat?: ApiChat, maxDate?: number, minDate?: number,\n) {\n let result;\n\n if (chat) {\n const localResult = await callApi('searchMessagesLocal', {\n chatOrUser: chat,\n query,\n type,\n limit: GLOBAL_SEARCH_SLICE,\n offsetId: offsetRate,\n minDate,\n maxDate,\n });\n\n if (localResult) {\n const {\n messages, users, totalCount, nextOffsetId,\n } = localResult;\n\n result = {\n messages,\n users,\n chats: [],\n totalCount,\n nextRate: nextOffsetId,\n };\n }\n } else {\n result = await callApi('searchMessagesGlobal', {\n query,\n offsetRate,\n limit: GLOBAL_SEARCH_SLICE,\n type,\n maxDate,\n minDate,\n });\n }\n\n let global = getGlobal();\n const currentSearchQuery = selectCurrentGlobalSearchQuery(global);\n if (!result || (query !== '' && query !== currentSearchQuery)) {\n setGlobal(updateGlobalSearchFetchingStatus(global, { messages: false }));\n return;\n }\n\n const {\n messages, users, chats, totalCount, nextRate,\n } = result;\n\n if (chats.length) {\n global = addChats(global, buildCollectionByKey(chats, 'id'));\n }\n\n if (users.length) {\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n }\n\n if (messages.length) {\n global = addMessages(global, messages);\n }\n\n global = updateGlobalSearchResults(\n global,\n messages,\n totalCount,\n type,\n nextRate,\n );\n\n setGlobal(global);\n}\n","import {\n addReducer, getGlobal, setGlobal, getDispatch,\n} from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiFormattedText, ApiUser, MAIN_THREAD_ID,\n} from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport {\n CHAT_LIST_LOAD_SLICE, DEBUG, MESSAGE_LIST_SLICE,\n} from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport {\n replaceChatListIds,\n replaceChats,\n replaceUsers,\n updateUsers,\n updateChats,\n updateChatListSecondaryInfo,\n updateThreadInfos,\n replaceThreadParam,\n} from '../../reducers';\nimport {\n selectUser, selectChat, selectCurrentMessageList, selectDraft, selectChatMessage, selectThreadInfo,\n} from '../../selectors';\nimport { isChatPrivate } from '../../helpers';\n\naddReducer('sync', (global, actions) => {\n void sync(actions.afterSync);\n});\n\naddReducer('afterSync', (global, actions) => {\n void afterSync(actions);\n});\n\nasync function sync(afterSyncCallback: () => void) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START SYNC');\n }\n\n await callApi('fetchCurrentUser');\n\n // This fetches only active chats and clears archived chats, which will be fetched in `afterSync`\n const savedUsers = await loadAndReplaceChats();\n await loadAndReplaceMessages(savedUsers);\n\n setGlobal({\n ...getGlobal(),\n lastSyncTime: Date.now(),\n });\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH SYNC');\n }\n\n afterSyncCallback();\n}\n\nasync function afterSync(actions: GlobalActions) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START AFTER-SYNC');\n }\n\n actions.loadFavoriteStickers();\n\n await Promise.all([\n loadAndUpdateUsers(),\n loadAndReplaceArchivedChats(),\n ]);\n\n await callApi('fetchCurrentUser');\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH AFTER-SYNC');\n }\n}\n\nasync function loadAndReplaceChats() {\n const result = await callApi('fetchChats', {\n limit: CHAT_LIST_LOAD_SLICE,\n withPinned: true,\n serverTimeOffset: getGlobal().serverTimeOffset,\n });\n if (!result) {\n return undefined;\n }\n\n let global = getGlobal();\n\n const { recentlyFoundChatIds } = global.globalSearch;\n const { userIds: contactIds } = global.contactList || {};\n const { currentUserId } = global;\n\n const savedPrivateChatIds = [\n ...(recentlyFoundChatIds || []),\n ...(contactIds || []),\n ...(currentUserId ? [currentUserId] : []),\n ];\n\n const savedUsers = savedPrivateChatIds\n .map((id) => selectUser(global, id))\n .filter(Boolean as any);\n\n const savedChats = savedPrivateChatIds\n .map((id) => selectChat(global, id))\n .filter(Boolean as any);\n\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n if (currentChatId) {\n const selectedChat = selectChat(global, currentChatId);\n if (selectedChat && !savedPrivateChatIds.includes(currentChatId)) {\n savedChats.push(selectedChat);\n }\n\n if (isChatPrivate(currentChatId)) {\n const selectedChatUser = selectUser(global, currentChatId);\n if (selectedChatUser && !savedPrivateChatIds.includes(currentChatId)) {\n savedUsers.push(selectedChatUser);\n }\n }\n }\n\n savedUsers.push(...result.users);\n savedChats.push(...result.chats);\n\n global = replaceChats(global, buildCollectionByKey(savedChats, 'id'));\n global = replaceChatListIds(global, 'active', result.chatIds);\n\n global = {\n ...global,\n chats: {\n ...global.chats,\n },\n };\n\n global = updateChatListSecondaryInfo(global, 'active', result);\n\n Object.keys(result.draftsById).map(Number).forEach((chatId) => {\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'draft', result.draftsById[chatId]);\n });\n\n Object.keys(result.replyingToById).map(Number).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'replyingToId', result.replyingToById[chatId],\n );\n });\n\n setGlobal(global);\n\n if (currentChatId && !global.chats.byId[currentChatId]) {\n getDispatch().openChat({ id: undefined });\n }\n\n return savedUsers;\n}\n\nasync function loadAndReplaceArchivedChats() {\n const result = await callApi('fetchChats', {\n limit: CHAT_LIST_LOAD_SLICE,\n archived: true,\n withPinned: true,\n serverTimeOffset: getGlobal().serverTimeOffset,\n });\n\n if (!result) {\n return;\n }\n\n let global = getGlobal();\n global = updateUsers(global, buildCollectionByKey(result.users, 'id'));\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = replaceChatListIds(global, 'archived', result.chatIds);\n global = updateChatListSecondaryInfo(global, 'archived', result);\n setGlobal(global);\n}\n\nasync function loadAndReplaceMessages(savedUsers?: ApiUser[]) {\n let areMessagesLoaded = false;\n let users = savedUsers || [];\n\n let global = getGlobal();\n const { chatId: currentChatId, threadId: currentThreadId } = selectCurrentMessageList(global) || {};\n\n // Memoize drafts\n const draftChatIds = Object.keys(global.messages.byChatId).map(Number);\n const draftsByChatId = draftChatIds.reduce>((acc, chatId) => {\n const draft = selectDraft(global, chatId, MAIN_THREAD_ID);\n return draft ? { ...acc, [chatId]: draft } : acc;\n }, {});\n\n if (currentChatId) {\n const result = await loadTopMessages(global.chats.byId[currentChatId]);\n global = getGlobal();\n const { chatId: newCurrentChatId } = selectCurrentMessageList(global) || {};\n const threadInfo = currentThreadId && selectThreadInfo(global, currentChatId, currentThreadId);\n\n if (result && newCurrentChatId === currentChatId) {\n const currentMessageListInfo = global.messages.byChatId[currentChatId];\n const byId = buildCollectionByKey(result.messages, 'id');\n const listedIds = Object.keys(byId).map(Number);\n\n global = {\n ...global,\n messages: {\n ...global.messages,\n byChatId: {\n [currentChatId]: {\n byId,\n threadsById: {\n [MAIN_THREAD_ID]: {\n ...(currentMessageListInfo?.threadsById[MAIN_THREAD_ID]),\n listedIds,\n viewportIds: listedIds,\n outlyingIds: undefined,\n },\n },\n },\n },\n },\n };\n\n if (currentThreadId && threadInfo && threadInfo.originChannelId) {\n const { originChannelId } = threadInfo;\n const currentMessageListInfoOrigin = global.messages.byChatId[originChannelId];\n const resultOrigin = await loadTopMessages(global.chats.byId[originChannelId]);\n if (resultOrigin) {\n const byIdOrigin = buildCollectionByKey(resultOrigin.messages, 'id');\n const listedIdsOrigin = Object.keys(byIdOrigin)\n .map(Number);\n\n global = {\n ...global,\n messages: {\n ...global.messages,\n byChatId: {\n ...global.messages.byChatId,\n [threadInfo.originChannelId]: {\n byId: byIdOrigin,\n threadsById: {\n [MAIN_THREAD_ID]: {\n ...(currentMessageListInfoOrigin?.threadsById[MAIN_THREAD_ID]),\n listedIds: listedIdsOrigin,\n viewportIds: listedIdsOrigin,\n outlyingIds: undefined,\n },\n },\n },\n [currentChatId]: {\n ...global.messages.byChatId[currentChatId],\n threadsById: {\n ...global.messages.byChatId[currentChatId].threadsById,\n [currentThreadId]: {\n ...(currentMessageListInfo?.threadsById[currentThreadId]),\n outlyingIds: undefined,\n },\n },\n },\n },\n },\n };\n }\n }\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = updateThreadInfos(global, currentChatId, result.threadInfos);\n\n areMessagesLoaded = true;\n users = Array.prototype.concat(users, result.users);\n }\n }\n\n if (!areMessagesLoaded) {\n global = {\n ...global,\n messages: {\n ...global.messages,\n byChatId: {},\n },\n };\n }\n\n // Restore drafts\n Object.keys(draftsByChatId).map(Number).forEach((chatId) => {\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'draft', draftsByChatId[chatId]);\n });\n\n if (savedUsers) {\n global = replaceUsers(global, buildCollectionByKey(users, 'id'));\n } else if (users) {\n // If `fetchChats` has failed for some reason, we don't have saved chats, thus we can not replace\n global = updateUsers(global, buildCollectionByKey(users, 'id'));\n }\n\n setGlobal(global);\n\n const { chatId: audioChatId, messageId: audioMessageId } = global.audioPlayer;\n if (audioChatId && audioMessageId && !selectChatMessage(global, audioChatId, audioMessageId)) {\n getDispatch().closeAudioPlayer();\n }\n}\n\nasync function loadAndUpdateUsers() {\n let global = getGlobal();\n const { recentlyFoundChatIds } = global.globalSearch;\n const { userIds: contactIds } = global.contactList || {};\n if (\n (!contactIds || !contactIds.length)\n && (!recentlyFoundChatIds || !recentlyFoundChatIds.length)\n ) {\n return;\n }\n\n const users = [\n ...(recentlyFoundChatIds || []),\n ...(contactIds || []),\n ].map((id) => selectUser(global, id)).filter(Boolean as any);\n\n const updatedUsers = await callApi('fetchUsers', { users });\n if (!updatedUsers) {\n return;\n }\n\n global = getGlobal();\n global = updateUsers(global, buildCollectionByKey(updatedUsers, 'id'));\n setGlobal(global);\n}\n\nfunction loadTopMessages(chat: ApiChat) {\n return callApi('fetchMessages', {\n chat,\n threadId: MAIN_THREAD_ID,\n offsetId: chat.lastReadInboxMessageId,\n addOffset: -(Math.round(MESSAGE_LIST_SLICE / 2) + 1),\n limit: MESSAGE_LIST_SLICE,\n });\n}\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser, MAIN_THREAD_ID } from '../../../api/types';\n\nimport { MESSAGE_SEARCH_SLICE, SHARED_MEDIA_SLICE } from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport {\n selectCurrentTextSearch,\n selectCurrentMediaSearchPeerId,\n selectCurrentMediaSearch, selectCurrentMessageList, selectChat, selectThreadInfo,\n} from '../../selectors';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport {\n addChatMessagesById,\n addUsers,\n updateLocalMediaSearchResults,\n updateLocalTextSearchResults,\n} from '../../reducers';\nimport { SharedMediaType } from '../../../types';\n\naddReducer('searchTextMessagesLocal', (global) => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n const chat = chatId ? selectChat(global, chatId) : undefined;\n const currentSearch = selectCurrentTextSearch(global);\n if (!chat || !currentSearch || !threadId) {\n return;\n }\n\n const { query, results } = currentSearch;\n const offsetId = results?.nextOffsetId;\n\n let topMessageId: number | undefined;\n if (threadId !== MAIN_THREAD_ID) {\n const threadInfo = selectThreadInfo(global, chatId!, threadId);\n topMessageId = threadInfo?.topMessageId;\n }\n\n void searchTextMessages(chat, threadId, topMessageId, query, offsetId);\n});\n\naddReducer('searchMediaMessagesLocal', (global) => {\n const peerId = selectCurrentMediaSearchPeerId(global);\n const chatOrUser = peerId\n ? global.users.byId[peerId] || global.chats.byId[peerId]\n : undefined;\n const currentSearch = selectCurrentMediaSearch(global);\n\n if (!chatOrUser || !currentSearch) {\n return;\n }\n\n const { currentType: type, resultsByType } = currentSearch;\n const currentResults = type && resultsByType && resultsByType[type];\n const offsetId = currentResults?.nextOffsetId;\n\n if (!type) {\n return;\n }\n\n void searchSharedMedia(chatOrUser, type, offsetId);\n});\n\naddReducer('searchMessagesByDate', (global, actions, payload) => {\n const { timestamp } = payload!;\n\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return;\n }\n\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n void searchMessagesByDate(chat, timestamp);\n});\n\nasync function searchTextMessages(\n chatOrUser: ApiChat,\n threadId: number,\n topMessageId?: number,\n query?: string,\n offsetId?: number,\n) {\n const result = await callApi('searchMessagesLocal', {\n chatOrUser,\n type: 'text',\n query,\n topMessageId,\n limit: MESSAGE_SEARCH_SLICE,\n offsetId,\n });\n\n if (!result) {\n return;\n }\n\n const {\n messages, users, totalCount, nextOffsetId,\n } = result;\n\n const byId = buildCollectionByKey(messages, 'id');\n const newFoundIds = Object.keys(byId).map(Number);\n\n let global = getGlobal();\n\n const currentSearch = selectCurrentTextSearch(global);\n if (!currentSearch || (query && query !== currentSearch.query)) {\n return;\n }\n\n global = addChatMessagesById(global, chatOrUser.id, byId);\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = updateLocalTextSearchResults(global, chatOrUser.id, threadId, newFoundIds, totalCount, nextOffsetId);\n setGlobal(global);\n}\n\nasync function searchSharedMedia(\n chatOrUser: ApiChat | ApiUser,\n type: SharedMediaType,\n offsetId?: number,\n) {\n const result = await callApi('searchMessagesLocal', {\n chatOrUser,\n type,\n limit: SHARED_MEDIA_SLICE,\n offsetId,\n });\n\n if (!result) {\n return;\n }\n\n const {\n messages, users, totalCount, nextOffsetId,\n } = result;\n\n const byId = buildCollectionByKey(messages, 'id');\n const newFoundIds = Object.keys(byId).map(Number);\n\n let global = getGlobal();\n\n const currentSearch = selectCurrentMediaSearch(global);\n if (!currentSearch) {\n return;\n }\n\n global = addChatMessagesById(global, chatOrUser.id, byId);\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = updateLocalMediaSearchResults(global, chatOrUser.id, type, newFoundIds, totalCount, nextOffsetId);\n setGlobal(global);\n}\n\n/**\n * @param timestamp start of target date in seconds\n */\nasync function searchMessagesByDate(chat: ApiChat, timestamp: number) {\n const messageId = await callApi('findFirstMessageIdAfterDate', {\n chat,\n timestamp,\n });\n\n if (!messageId) {\n return;\n }\n\n getDispatch().focusMessage({\n chatId: chat.id,\n messageId,\n });\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementProgress } from '../../../types';\nimport { callApi } from '../../../api/gramjs';\nimport { updateManagement, updateManagementProgress } from '../../reducers';\nimport { selectChat, selectCurrentMessageList } from '../../selectors';\nimport { isChatBasicGroup } from '../../helpers';\n\naddReducer('checkPublicLink', (global, actions, payload) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return;\n }\n\n // No need to check the username if already in progress\n if (global.management.progress === ManagementProgress.InProgress) {\n return;\n }\n\n const { username } = payload!;\n\n (async () => {\n global = updateManagementProgress(global, ManagementProgress.InProgress);\n global = updateManagement(global, chatId, { isUsernameAvailable: undefined });\n setGlobal(global);\n\n const isUsernameAvailable = await callApi('checkChatUsername', { username })!;\n\n global = getGlobal();\n global = updateManagementProgress(\n global, isUsernameAvailable ? ManagementProgress.Complete : ManagementProgress.Error,\n );\n global = updateManagement(global, chatId, { isUsernameAvailable });\n setGlobal(global);\n })();\n});\n\naddReducer('updatePublicLink', (global, actions, payload) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n let chat = chatId && selectChat(global, chatId);\n if (!chatId || !chat) {\n return;\n }\n\n const { username } = payload!;\n\n (async () => {\n global = updateManagementProgress(global, ManagementProgress.InProgress);\n setGlobal(global);\n\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n const result = await callApi('setChatUsername', { chat, username });\n\n global = getGlobal();\n global = updateManagementProgress(global, result ? ManagementProgress.Complete : ManagementProgress.Error);\n global = updateManagement(global, chatId, { isUsernameAvailable: undefined });\n setGlobal(global);\n })();\n});\n\naddReducer('updatePrivateLink', (global) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n const chat = chatId && selectChat(global, chatId);\n if (!chatId || !chat) {\n return;\n }\n\n callApi('updatePrivateLink', { chat });\n});\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { ApiUser } from '../../../api/types';\nimport { ManagementProgress } from '../../../types';\n\nimport { debounce, throttle } from '../../../util/schedulers';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { isChatPrivate } from '../../helpers';\nimport { callApi } from '../../../api/gramjs';\nimport { selectChat, selectUser } from '../../selectors';\nimport {\n addChats, addUsers, updateChat, updateManagementProgress, updateUser, updateUsers,\n updateUserSearch, updateUserSearchFetchingStatus,\n} from '../../reducers';\nimport { getServerTime } from '../../../util/serverTime';\n\nconst runDebouncedForFetchFullUser = debounce((cb) => cb(), 500, false, true);\nconst TOP_PEERS_REQUEST_COOLDOWN = 60; // 1 min\nconst runThrottledForSearch = throttle((cb) => cb(), 500, false);\n\naddReducer('loadFullUser', (global, actions, payload) => {\n const { userId } = payload!;\n const user = selectUser(global, userId);\n if (!user) {\n return;\n }\n\n const { id, accessHash } = user;\n\n runDebouncedForFetchFullUser(() => callApi('fetchFullUser', { id, accessHash }));\n});\n\naddReducer('loadUser', (global, actions, payload) => {\n const { userId } = payload!;\n const user = selectUser(global, userId);\n if (!user) {\n return;\n }\n\n (async () => {\n const updatedUsers = await callApi('fetchUsers', { users: [user] });\n if (!updatedUsers) {\n return;\n }\n\n global = getGlobal();\n global = updateUsers(global, buildCollectionByKey(updatedUsers, 'id'));\n setGlobal(global);\n })();\n});\n\naddReducer('loadTopUsers', (global) => {\n const {\n topPeers: {\n hash, lastRequestedAt,\n },\n } = global;\n\n if (!lastRequestedAt || getServerTime(global.serverTimeOffset) - lastRequestedAt > TOP_PEERS_REQUEST_COOLDOWN) {\n void loadTopUsers(hash);\n }\n});\n\naddReducer('loadContactList', (global) => {\n const { hash } = global.contactList || {};\n void loadContactList(hash);\n});\n\naddReducer('loadCurrentUser', () => {\n void callApi('fetchCurrentUser');\n});\n\naddReducer('updateContact', (global, actions, payload) => {\n const {\n userId, isMuted, firstName, lastName,\n } = payload!;\n\n void updateContact(userId, isMuted, firstName, lastName);\n});\n\naddReducer('deleteUser', (global, actions, payload) => {\n const { userId } = payload!;\n\n void deleteUser(userId);\n});\n\nasync function loadTopUsers(usersHash?: number) {\n const result = await callApi('fetchTopUsers', { hash: usersHash });\n if (!result) {\n return;\n }\n\n const { hash, ids, users } = result;\n\n let global = getGlobal();\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = {\n ...global,\n topPeers: {\n ...global.topPeers,\n hash,\n userIds: ids,\n lastRequestedAt: getServerTime(global.serverTimeOffset),\n },\n };\n setGlobal(global);\n}\n\nasync function loadContactList(hash?: number) {\n const contactList = await callApi('fetchContactList', { hash });\n if (!contactList) {\n return;\n }\n\n let global = addUsers(getGlobal(), buildCollectionByKey(contactList.users, 'id'));\n global = addChats(global, buildCollectionByKey(contactList.chats, 'id'));\n\n // Sort contact list by Last Name (or First Name), with latin names being placed first\n const getCompareString = (user: ApiUser) => (user.lastName || user.firstName || '');\n const collator = new Intl.Collator('en-US');\n\n const sortedUsers = contactList.users.sort((a, b) => (\n collator.compare(getCompareString(a), getCompareString(b))\n )).filter((user) => !user.isSelf);\n\n setGlobal({\n ...global,\n contactList: {\n hash: contactList.hash,\n userIds: sortedUsers.map((user) => user.id),\n },\n });\n}\n\nasync function updateContact(\n userId: number,\n isMuted: boolean,\n firstName: string,\n lastName?: string,\n) {\n const global = getGlobal();\n const user = selectUser(global, userId);\n if (!user) {\n return;\n }\n\n getDispatch().updateChatMutedState({ chatId: userId, isMuted });\n\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.InProgress));\n\n const result = await callApi('updateContact', { phone: user.phoneNumber, firstName, lastName });\n\n if (result) {\n setGlobal(updateUser(\n getGlobal(),\n user.id,\n {\n firstName,\n lastName,\n },\n ));\n }\n\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.Complete));\n}\n\nasync function deleteUser(userId: number) {\n const global = getGlobal();\n const user = selectUser(global, userId);\n\n if (!user) {\n return;\n }\n\n const { id, accessHash } = user;\n\n await callApi('deleteUser', { id, accessHash });\n}\n\naddReducer('loadProfilePhotos', (global, actions, payload) => {\n const { profileId } = payload!;\n const isPrivate = isChatPrivate(profileId);\n const user = isPrivate ? selectUser(global, profileId) : undefined;\n const chat = !isPrivate ? selectChat(global, profileId) : undefined;\n\n (async () => {\n const result = await callApi('fetchProfilePhotos', user, chat);\n if (!result || !result.photos) {\n return;\n }\n\n let newGlobal = getGlobal();\n if (isPrivate) {\n newGlobal = updateUser(newGlobal, profileId, { photos: result.photos });\n } else {\n newGlobal = addUsers(newGlobal, buildCollectionByKey(result.users!, 'id'));\n newGlobal = updateChat(newGlobal, profileId, { photos: result.photos });\n }\n\n setGlobal(newGlobal);\n })();\n});\n\naddReducer('setUserSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n if (!query) return;\n\n void runThrottledForSearch(() => {\n searchUsers(query);\n });\n});\n\nasync function searchUsers(query: string) {\n const result = await callApi('searchChats', { query });\n\n let global = getGlobal();\n const currentSearchQuery = global.userSearch.query;\n\n if (!result || !currentSearchQuery || (query !== currentSearchQuery)) {\n setGlobal(updateUserSearchFetchingStatus(global, false));\n return;\n }\n\n const { localUsers, globalUsers } = result;\n\n let localUserIds;\n let globalUserIds;\n if (localUsers.length) {\n global = addUsers(global, buildCollectionByKey(localUsers, 'id'));\n localUserIds = localUsers.map(({ id }) => id);\n }\n if (globalUsers.length) {\n global = addUsers(global, buildCollectionByKey(globalUsers, 'id'));\n globalUserIds = globalUsers.map(({ id }) => id);\n }\n\n global = updateUserSearchFetchingStatus(global, false);\n global = updateUserSearch(global, { localUserIds, globalUserIds });\n\n setGlobal(global);\n}\n","import { GlobalState } from '../../global/types';\nimport { InlineBotSettings } from '../../types';\n\nexport function replaceInlineBotSettings(\n global: GlobalState, username: string, inlineBotSettings: InlineBotSettings | false,\n): GlobalState {\n return {\n ...global,\n inlineBots: {\n ...global.inlineBots,\n byUsername: {\n ...global.inlineBots.byUsername,\n [username]: inlineBotSettings,\n },\n },\n };\n}\n\nexport function replaceInlineBotsIsLoading(global: GlobalState, isLoading: boolean): GlobalState {\n return {\n ...global,\n inlineBots: {\n ...global.inlineBots,\n isLoading,\n },\n };\n}\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { ApiChat } from '../../../api/types';\nimport { InlineBotSettings } from '../../../types';\n\nimport { RE_TME_INVITE_LINK, RE_TME_LINK } from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport {\n selectChat, selectChatBot, selectChatMessage, selectCurrentChat, selectCurrentMessageList,\n selectReplyingToId, selectUser,\n} from '../../selectors';\nimport { addChats, addUsers, removeBlockedContact } from '../../reducers';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { debounce } from '../../../util/schedulers';\nimport { replaceInlineBotSettings, replaceInlineBotsIsLoading } from '../../reducers/bots';\nimport { getServerTime } from '../../../util/serverTime';\n\nconst TOP_PEERS_REQUEST_COOLDOWN = 60; // 1 min\nconst runDebouncedForSearch = debounce((cb) => cb(), 500, false);\n\naddReducer('clickInlineButton', (global, actions, payload) => {\n const { button } = payload;\n\n switch (button.type) {\n case 'command':\n actions.sendBotCommand({ command: button.value });\n break;\n case 'url':\n if (button.value.match(RE_TME_INVITE_LINK) || button.value.match(RE_TME_LINK)) {\n actions.openTelegramLink({ url: button.value });\n } else {\n actions.toggleSafeLinkModal({ url: button.value });\n }\n break;\n case 'callback': {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return;\n }\n\n void answerCallbackButton(chat, button.messageId, button.value);\n break;\n }\n case 'requestPoll':\n actions.openPollModal();\n break;\n case 'buy': {\n const chat = selectCurrentChat(global);\n const { messageId, value } = button;\n if (!chat) {\n return;\n }\n\n if (value) {\n actions.getReceipt({ receiptMessageId: value, chatId: chat.id, messageId });\n } else {\n actions.getPaymentForm({ chat, messageId });\n actions.setInvoiceMessageInfo(selectChatMessage(global, chat.id, messageId));\n actions.openPaymentModal({ chatId: chat.id, messageId });\n }\n break;\n }\n }\n});\n\naddReducer('sendBotCommand', (global, actions, payload) => {\n const { command, chatId } = payload;\n const { currentUserId } = global;\n const chat = chatId ? selectChat(global, chatId) : selectCurrentChat(global);\n if (!currentUserId || !chat) {\n return;\n }\n\n void sendBotCommand(chat, currentUserId, command);\n});\n\naddReducer('restartBot', (global, actions, payload) => {\n const { chatId } = payload;\n const { currentUserId } = global;\n const chat = selectCurrentChat(global);\n const bot = currentUserId && selectChatBot(global, chatId);\n if (!currentUserId || !chat || !bot) {\n return;\n }\n\n (async () => {\n const result = await callApi('unblockContact', bot.id, bot.accessHash);\n if (!result) {\n return;\n }\n\n setGlobal(removeBlockedContact(getGlobal(), bot.id));\n void sendBotCommand(chat, currentUserId, '/start');\n })();\n});\n\naddReducer('loadTopInlineBots', (global) => {\n const { hash, lastRequestedAt } = global.topInlineBots;\n\n if (lastRequestedAt && getServerTime(global.serverTimeOffset) - lastRequestedAt < TOP_PEERS_REQUEST_COOLDOWN) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchTopInlineBots', { hash });\n if (!result) {\n return;\n }\n\n const { hash: newHash, ids, users } = result;\n\n let newGlobal = getGlobal();\n newGlobal = addUsers(newGlobal, buildCollectionByKey(users, 'id'));\n newGlobal = {\n ...newGlobal,\n topInlineBots: {\n ...newGlobal.topInlineBots,\n hash: newHash,\n userIds: ids,\n lastRequestedAt: getServerTime(global.serverTimeOffset),\n },\n };\n setGlobal(newGlobal);\n })();\n});\n\naddReducer('queryInlineBot', ((global, actions, payload) => {\n const {\n chatId, username, query, offset,\n } = payload;\n\n (async () => {\n let inlineBotData = global.inlineBots.byUsername[username];\n\n if (inlineBotData === false) {\n return;\n }\n\n if (inlineBotData === undefined) {\n const { user: inlineBot, chat } = await callApi('fetchInlineBot', { username }) || {};\n global = getGlobal();\n if (!inlineBot || !chat) {\n setGlobal(replaceInlineBotSettings(global, username, false));\n return;\n }\n\n global = addUsers(global, { [inlineBot.id]: inlineBot });\n global = addChats(global, { [chat.id]: chat });\n inlineBotData = {\n id: inlineBot.id,\n query: '',\n offset: '',\n switchPm: undefined,\n canLoadMore: true,\n results: [],\n };\n\n global = replaceInlineBotSettings(global, username, inlineBotData);\n setGlobal(global);\n }\n\n if (query === inlineBotData.query && !inlineBotData.canLoadMore) {\n return;\n }\n\n void runDebouncedForSearch(() => {\n searchInlineBot({\n username,\n inlineBotData: inlineBotData as InlineBotSettings,\n chatId,\n query,\n offset,\n });\n });\n })();\n}));\n\naddReducer('sendInlineBotResult', (global, actions, payload) => {\n const { id, queryId } = payload;\n const currentMessageList = selectCurrentMessageList(global);\n\n if (!currentMessageList || !id) {\n return;\n }\n\n const { chatId, threadId } = currentMessageList;\n\n const chat = selectChat(global, chatId)!;\n\n actions.setReplyingToId({ messageId: undefined });\n actions.clearWebPagePreview({ chatId, threadId, value: false });\n\n void callApi('sendInlineBotResult', {\n chat,\n resultId: id,\n queryId,\n replyingTo: selectReplyingToId(global, chatId, threadId),\n });\n});\n\naddReducer('resetInlineBot', (global, actions, payload) => {\n const { username } = payload;\n\n let inlineBotData = global.inlineBots.byUsername[username];\n\n if (!inlineBotData) {\n return;\n }\n\n inlineBotData = {\n id: inlineBotData.id,\n query: '',\n offset: '',\n switchPm: undefined,\n canLoadMore: true,\n results: [],\n };\n\n setGlobal(replaceInlineBotSettings(global, username, inlineBotData));\n});\n\naddReducer('startBot', (global, actions, payload) => {\n const { botId, param } = payload;\n\n const bot = selectUser(global, botId);\n if (!bot) {\n return;\n }\n\n (async () => {\n await callApi('startBot', {\n bot,\n startParam: param,\n });\n })();\n});\n\nasync function searchInlineBot({\n username,\n inlineBotData,\n chatId,\n query,\n offset,\n}: {\n username: string;\n inlineBotData: InlineBotSettings;\n chatId: number;\n query: string;\n offset?: string;\n}) {\n let global = getGlobal();\n const bot = selectUser(global, inlineBotData.id);\n const chat = selectChat(global, chatId);\n if (!bot || !chat) {\n return;\n }\n\n const shouldReplaceSettings = inlineBotData.query !== query;\n global = replaceInlineBotsIsLoading(global, true);\n global = replaceInlineBotSettings(global, username, {\n ...inlineBotData,\n query,\n ...(shouldReplaceSettings && { offset: undefined, results: [] }),\n });\n setGlobal(global);\n\n const result = await callApi('fetchInlineBotResults', {\n bot,\n chat,\n query,\n offset: shouldReplaceSettings ? undefined : offset,\n });\n\n const newInlineBotData = global.inlineBots.byUsername[username];\n global = replaceInlineBotsIsLoading(getGlobal(), false);\n if (!result || !newInlineBotData || query !== newInlineBotData.query) {\n setGlobal(global);\n return;\n }\n\n const currentIds = new Set((newInlineBotData.results || []).map((data) => data.id));\n const newResults = result.results.filter((data) => !currentIds.has(data.id));\n\n global = replaceInlineBotSettings(global, username, {\n ...newInlineBotData,\n help: result.help,\n ...(newResults.length && { isGallery: result.isGallery }),\n ...(result.switchPm && { switchPm: result.switchPm }),\n canLoadMore: result.results.length > 0 && Boolean(result.nextOffset),\n results: newInlineBotData.offset === '' || newInlineBotData.offset === result.nextOffset\n ? result.results\n : (newInlineBotData.results || []).concat(newResults),\n offset: newResults.length ? result.nextOffset : '',\n });\n\n setGlobal(global);\n}\n\nasync function sendBotCommand(chat: ApiChat, currentUserId: number, command: string) {\n await callApi('sendMessage', {\n chat,\n text: command,\n });\n}\n\nasync function answerCallbackButton(chat: ApiChat, messageId: number, data: string) {\n const result = await callApi('answerCallbackButton', {\n chatId: chat.id,\n accessHash: chat.accessHash,\n messageId,\n data,\n });\n\n if (!result) {\n return;\n }\n\n const { showDialog, showNotification, toggleSafeLinkModal } = getDispatch();\n const { message, alert: isError, url } = result;\n\n if (isError) {\n showDialog({ data: { message: message || 'Error' } });\n } else if (message) {\n showNotification({ message });\n } else if (url) {\n toggleSafeLinkModal({ url });\n }\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { callApi } from '../../../api/gramjs';\nimport { replaceSettings, updateTwoFaSettings } from '../../reducers';\n\naddReducer('loadPasswordInfo', () => {\n (async () => {\n const result = await callApi('getPasswordInfo');\n if (!result) {\n return;\n }\n\n let global = getGlobal();\n global = replaceSettings(global, { hasPassword: result.hasPassword });\n global = updateTwoFaSettings(global, { hint: result.hint });\n setGlobal(global);\n })();\n});\n\naddReducer('checkPassword', (global, actions, payload) => {\n const { currentPassword, onSuccess } = payload;\n\n setGlobal(updateTwoFaSettings(global, { isLoading: true, error: undefined }));\n\n (async () => {\n const isSuccess = await callApi('checkPassword', currentPassword);\n\n setGlobal(updateTwoFaSettings(getGlobal(), { isLoading: false }));\n\n if (isSuccess) {\n onSuccess();\n }\n })();\n});\n\naddReducer('clearPassword', (global, actions, payload) => {\n const { currentPassword, onSuccess } = payload;\n\n setGlobal(updateTwoFaSettings(global, { isLoading: true, error: undefined }));\n\n (async () => {\n const isSuccess = await callApi('clearPassword', currentPassword);\n\n setGlobal(updateTwoFaSettings(getGlobal(), { isLoading: false }));\n\n if (isSuccess) {\n onSuccess();\n }\n })();\n});\n\naddReducer('updatePassword', (global, actions, payload) => {\n const {\n currentPassword, password, hint, email, onSuccess,\n } = payload;\n\n setGlobal(updateTwoFaSettings(global, { isLoading: true, error: undefined }));\n\n (async () => {\n const isSuccess = await callApi('updatePassword', currentPassword, password, hint, email);\n\n setGlobal(updateTwoFaSettings(getGlobal(), { isLoading: false }));\n\n if (isSuccess) {\n onSuccess();\n }\n })();\n});\n\naddReducer('updateRecoveryEmail', (global, actions, payload) => {\n const {\n currentPassword, email, onSuccess,\n } = payload;\n\n setGlobal(updateTwoFaSettings(global, { isLoading: true, error: undefined }));\n\n (async () => {\n const isSuccess = await callApi('updateRecoveryEmail', currentPassword, email);\n\n setGlobal(updateTwoFaSettings(getGlobal(), { isLoading: false, waitingEmailCodeLength: undefined }));\n\n if (isSuccess) {\n onSuccess();\n }\n })();\n});\n\naddReducer('provideTwoFaEmailCode', (global, actions, payload) => {\n const { code } = payload;\n\n void callApi('provideRecoveryEmailCode', code);\n});\n\naddReducer('clearTwoFaError', (global) => {\n return updateTwoFaSettings(global, { error: undefined });\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { PaymentStep } from '../../../types';\nimport { ApiChat } from '../../../api/types';\n\nimport {\n selectPaymentMessageId,\n selectPaymentRequestId,\n selectProviderPublishableKey,\n selectStripeCredentials,\n selectChatMessage,\n selectPaymentChatId,\n selectChat,\n selectPaymentFormId,\n} from '../../selectors';\nimport { callApi } from '../../../api/gramjs';\nimport { getStripeError } from '../../helpers';\nimport { buildQueryString } from '../../../util/requestQuery';\n\nimport {\n updateShippingOptions,\n setPaymentStep,\n setRequestInfoId,\n setPaymentForm,\n setStripeCardInfo,\n setInvoiceMessageInfo,\n setReceipt,\n clearPayment,\n closeInvoice,\n} from '../../reducers';\n\naddReducer('validateRequestedInfo', (global, actions, payload) => {\n const { requestInfo, saveInfo } = payload;\n const chatId = selectPaymentChatId(global);\n const chat = chatId && selectChat(global, chatId);\n const messageId = selectPaymentMessageId(global);\n if (!chat || !messageId) {\n return;\n }\n void validateRequestedInfo(chat, messageId, requestInfo, saveInfo);\n});\n\nasync function validateRequestedInfo(chat: ApiChat, messageId: number, requestInfo: any, shouldSave?: true) {\n const result = await callApi('validateRequestedInfo', {\n chat, messageId, requestInfo, shouldSave,\n });\n if (!result) {\n return;\n }\n\n const { id, shippingOptions } = result;\n if (!id) {\n return;\n }\n\n let global = setRequestInfoId(getGlobal(), id);\n if (shippingOptions) {\n global = updateShippingOptions(global, shippingOptions);\n global = setPaymentStep(global, PaymentStep.Shipping);\n } else {\n global = setPaymentStep(global, PaymentStep.PaymentInfo);\n }\n setGlobal(global);\n}\n\naddReducer('getPaymentForm', (global, actions, payload) => {\n const { chat, messageId } = payload;\n if (!chat || !messageId) {\n return;\n }\n void getPaymentForm(chat, messageId);\n});\n\nasync function getPaymentForm(chat: ApiChat, messageId: number) {\n const result = await callApi('getPaymentForm', { chat, messageId });\n if (!result) {\n return;\n }\n let global = setPaymentForm(getGlobal(), result);\n let step = PaymentStep.PaymentInfo;\n if (global.payment.invoice\n && (global.payment.invoice.shippingAddressRequested\n || global.payment.invoice.nameRequested\n || global.payment.invoice.phoneRequested\n || global.payment.invoice.emailRequested)) {\n step = PaymentStep.ShippingInfo;\n }\n global = setPaymentStep(global, step);\n setGlobal(global);\n}\n\naddReducer('getReceipt', (global, actions, payload) => {\n const { receiptMessageId, chatId, messageId } = payload;\n const chat = chatId && selectChat(global, chatId);\n if (!messageId || !receiptMessageId || !chat) {\n return;\n }\n\n void getReceipt(chat, messageId, receiptMessageId);\n});\n\nasync function getReceipt(chat: ApiChat, messageId: number, receiptMessageId: number) {\n const result = await callApi('getReceipt', chat, receiptMessageId);\n if (!result) {\n return;\n }\n\n let global = getGlobal();\n const message = selectChatMessage(global, chat.id, messageId);\n global = setReceipt(global, result, message);\n setGlobal(global);\n}\n\naddReducer('clearPaymentError', (global) => {\n setGlobal({\n ...global,\n payment: {\n ...global.payment,\n error: undefined,\n },\n });\n});\n\naddReducer('clearReceipt', (global) => {\n setGlobal({\n ...global,\n payment: {\n ...global.payment,\n receipt: undefined,\n },\n });\n});\n\naddReducer('sendCredentialsInfo', (global, actions, payload) => {\n const publishableKey = selectProviderPublishableKey(global);\n if (!publishableKey) {\n return;\n }\n const { credentials } = payload;\n const { data } = credentials;\n void sendStripeCredentials(data, publishableKey);\n});\n\naddReducer('sendPaymentForm', (global, actions, payload) => {\n const { shippingOptionId, saveCredentials } = payload;\n const chatId = selectPaymentChatId(global);\n const chat = chatId && selectChat(global, chatId);\n const messageId = selectPaymentMessageId(global);\n const formId = selectPaymentFormId(global);\n const requestInfoId = selectPaymentRequestId(global);\n const publishableKey = selectProviderPublishableKey(global);\n const stripeCredentials = selectStripeCredentials(global);\n if (!chat || !messageId || !publishableKey || !formId) {\n return;\n }\n\n void sendPaymentForm(chat, messageId, formId, {\n save: saveCredentials,\n data: stripeCredentials,\n }, requestInfoId, shippingOptionId);\n});\n\nasync function sendStripeCredentials(\n data: {\n cardNumber: string;\n cardholder?: string;\n expiryMonth: string;\n expiryYear: string;\n cvv: string;\n country: string;\n zip: string;\n },\n publishableKey: string,\n) {\n const query = buildQueryString({\n 'card[number]': data.cardNumber,\n 'card[exp_month]': data.expiryMonth,\n 'card[exp_year]': data.expiryYear,\n 'card[cvc]': data.cvv,\n 'card[address_zip]': data.zip,\n 'card[address_country]': data.country,\n });\n\n const response = await fetch(`https://api.stripe.com/v1/tokens${query}`, {\n method: 'POST',\n credentials: 'same-origin',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Authorization: `Bearer ${publishableKey}`,\n },\n });\n const result = await response.json();\n if (result.error) {\n const error = getStripeError(result.error);\n const global = getGlobal();\n setGlobal({\n ...global,\n payment: {\n ...global.payment,\n error: {\n ...error,\n },\n },\n });\n return;\n }\n let global = setStripeCardInfo(getGlobal(), {\n type: result.type,\n id: result.id,\n });\n global = setPaymentStep(global, PaymentStep.Checkout);\n setGlobal(global);\n}\n\nasync function sendPaymentForm(\n chat: ApiChat,\n messageId: number,\n formId: string,\n credentials: any,\n requestedInfoId?: string,\n shippingOptionId?: string,\n) {\n const result = await callApi('sendPaymentForm', {\n chat, messageId, formId, credentials, requestedInfoId, shippingOptionId,\n });\n if (result) {\n const global = clearPayment(getGlobal());\n setGlobal(closeInvoice(global));\n }\n}\n\naddReducer('setPaymentStep', (global, actions, payload = {}) => {\n return setPaymentStep(global, payload.step || PaymentStep.ShippingInfo);\n});\n\naddReducer('setInvoiceMessageInfo', (global, actions, payload) => {\n return setInvoiceMessageInfo(global, payload);\n});\n","export function buildQueryString(data: Record) {\n const query = Object.keys(data).map((k) => `${k}=${data[k]}`).join('&');\n return query.length > 0 ? `?${query}` : '';\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate, MAIN_THREAD_ID } from '../../../api/types';\n\nimport { ARCHIVED_FOLDER_ID, MAX_ACTIVE_PINNED_CHATS } from '../../../config';\nimport { pick } from '../../../util/iteratees';\nimport { closeMessageNotifications, showNewMessageNotification } from '../../../util/notifications';\nimport { updateAppBadge } from '../../../util/appBadge';\nimport {\n updateChat,\n replaceChatListIds,\n updateChatListIds,\n updateChatListType,\n replaceThreadParam,\n} from '../../reducers';\nimport {\n selectChat,\n selectCommonBoxChatId,\n selectIsChatListed,\n selectChatListType,\n selectCurrentMessageList,\n selectCountNotMutedUnread,\n selectNotifySettings,\n} from '../../selectors';\nimport { throttle } from '../../../util/schedulers';\n\nconst TYPING_STATUS_CLEAR_DELAY = 6000; // 6 seconds\n// Enough to animate and mark as read in Message List\nconst CURRENT_CHAT_UNREAD_DELAY = 1500;\n\nconst runThrottledForUpdateAppBadge = throttle((cb) => cb(), 500, true);\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'updateChat': {\n if (!update.noTopChatsRequest && !selectIsChatListed(global, update.id)) {\n // Chat can appear in dialogs list.\n actions.loadTopChats();\n }\n\n const newGlobal = updateChat(global, update.id, update.chat, update.newProfilePhoto);\n setGlobal(newGlobal);\n\n runThrottledForUpdateAppBadge(() => updateAppBadge(selectCountNotMutedUnread(getGlobal())));\n\n if (update.chat.id) {\n closeMessageNotifications({\n chatId: update.chat.id,\n lastReadInboxMessageId: update.chat.lastReadInboxMessageId,\n });\n }\n break;\n }\n\n case 'updateChatJoin': {\n const listType = selectChatListType(global, update.id);\n if (!listType) {\n break;\n }\n\n global = updateChatListIds(global, listType, [update.id]);\n global = updateChat(global, update.id, { isNotJoined: false });\n setGlobal(global);\n\n const chat = selectChat(global, update.id);\n if (chat) {\n actions.requestChatUpdate({ chatId: chat.id });\n }\n break;\n }\n\n case 'updateChatLeave': {\n const listType = selectChatListType(global, update.id);\n if (!listType) {\n break;\n }\n\n const { [listType]: listIds } = global.chats.listIds;\n\n if (listIds) {\n global = replaceChatListIds(global, listType, listIds.filter((listId) => listId !== update.id));\n }\n\n global = updateChat(global, update.id, { isNotJoined: true });\n setGlobal(global);\n\n break;\n }\n\n case 'updateChatInbox': {\n setGlobal(updateChat(global, update.id, update.chat));\n\n runThrottledForUpdateAppBadge(() => updateAppBadge(selectCountNotMutedUnread(getGlobal())));\n\n break;\n }\n\n case 'updateChatTypingStatus': {\n const { id, typingStatus } = update;\n setGlobal(updateChat(global, id, { typingStatus }));\n\n setTimeout(() => {\n const newGlobal = getGlobal();\n const chat = selectChat(newGlobal, id);\n if (chat && typingStatus && chat.typingStatus && chat.typingStatus.timestamp === typingStatus.timestamp) {\n setGlobal(updateChat(newGlobal, id, { typingStatus: undefined }));\n }\n }, TYPING_STATUS_CLEAR_DELAY);\n\n break;\n }\n\n case 'newMessage': {\n const { message } = update;\n const { chatId: currentChatId, threadId, type: messageListType } = selectCurrentMessageList(global) || {};\n\n if (message.senderId === global.currentUserId && !message.isFromScheduled) {\n return;\n }\n\n const chat = selectChat(global, update.chatId);\n if (!chat) {\n return;\n }\n\n const isActiveChat = (\n messageListType === 'thread'\n && threadId === MAIN_THREAD_ID\n && update.chatId === currentChatId\n );\n\n if (isActiveChat) {\n setTimeout(() => {\n actions.requestChatUpdate({ chatId: update.chatId });\n }, CURRENT_CHAT_UNREAD_DELAY);\n } else {\n setGlobal(updateChat(global, update.chatId, {\n unreadCount: chat.unreadCount ? chat.unreadCount + 1 : 1,\n ...(update.message.hasUnreadMention && {\n unreadMentionsCount: chat.unreadMentionsCount ? chat.unreadMentionsCount + 1 : 1,\n }),\n }));\n }\n\n updateAppBadge(selectCountNotMutedUnread(getGlobal()));\n\n const { hasWebNotifications } = selectNotifySettings(global);\n if (hasWebNotifications) {\n showNewMessageNotification({\n chat,\n message,\n isActiveChat,\n });\n }\n\n break;\n }\n\n case 'updateCommonBoxMessages':\n case 'updateChannelMessages': {\n const { ids, messageUpdate } = update;\n if (messageUpdate.hasUnreadMention !== false) {\n return;\n }\n\n ids.forEach((id) => {\n const chatId = 'channelId' in update ? update.channelId : selectCommonBoxChatId(global, id);\n const chat = selectChat(global, chatId);\n if (chat?.unreadMentionsCount) {\n global = updateChat(global, chatId, {\n unreadMentionsCount: chat.unreadMentionsCount - 1,\n });\n }\n });\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateChatFullInfo': {\n const { fullInfo } = update;\n const targetChat = global.chats.byId[update.id];\n if (!targetChat) {\n return;\n }\n\n setGlobal(updateChat(global, update.id, {\n fullInfo: {\n ...targetChat.fullInfo,\n ...fullInfo,\n },\n }));\n\n break;\n }\n\n case 'updatePinnedChatIds': {\n const { ids, folderId } = update;\n\n const listType = folderId === ARCHIVED_FOLDER_ID ? 'archived' : 'active';\n\n global = {\n ...global,\n chats: {\n ...global.chats,\n orderedPinnedIds: {\n ...global.chats.orderedPinnedIds,\n [listType]: ids.length ? ids : undefined,\n },\n },\n };\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateChatPinned': {\n const { id, isPinned } = update;\n const listType = selectChatListType(global, id);\n if (listType) {\n const { [listType]: orderedPinnedIds } = global.chats.orderedPinnedIds;\n\n let newOrderedPinnedIds = orderedPinnedIds || [];\n if (!isPinned) {\n newOrderedPinnedIds = newOrderedPinnedIds.filter((pinnedId) => pinnedId !== id);\n } else if (!newOrderedPinnedIds.includes(id)) {\n // When moving pinned chats to archive, active ordered pinned ids don't get updated\n // (to preserve chat pinned state when it returns from archive)\n // If user already has max pinned chats, we should check for orderedIds\n // that don't point to listed chats\n if (listType === 'active' && newOrderedPinnedIds.length >= MAX_ACTIVE_PINNED_CHATS) {\n const listIds = global.chats.listIds.active;\n newOrderedPinnedIds = newOrderedPinnedIds.filter((pinnedId) => listIds && listIds.includes(pinnedId));\n }\n\n newOrderedPinnedIds = [id, ...newOrderedPinnedIds];\n }\n\n global = {\n ...global,\n chats: {\n ...global.chats,\n orderedPinnedIds: {\n ...global.chats.orderedPinnedIds,\n [listType]: newOrderedPinnedIds.length ? newOrderedPinnedIds : undefined,\n },\n },\n };\n }\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateChatListType': {\n const { id, folderId } = update;\n\n setGlobal(updateChatListType(global, id, folderId));\n\n break;\n }\n\n case 'updateChatFolder': {\n const { id, folder } = update;\n const { byId: chatFoldersById, orderedIds } = global.chatFolders;\n\n const newChatFoldersById = folder\n ? { ...chatFoldersById, [id]: folder }\n : pick(\n chatFoldersById,\n Object.keys(chatFoldersById).map(Number).filter((folderId) => folderId !== id),\n );\n\n const newOrderedIds = folder\n ? orderedIds && orderedIds.includes(id) ? orderedIds : [...(orderedIds || []), id]\n : orderedIds ? orderedIds.filter((orderedId) => orderedId !== id) : undefined;\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n byId: newChatFoldersById,\n orderedIds: newOrderedIds,\n },\n });\n\n break;\n }\n\n case 'updateChatFoldersOrder': {\n const { orderedIds } = update;\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n orderedIds,\n },\n });\n\n break;\n }\n\n case 'updateRecommendedChatFolders': {\n const { folders } = update;\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n recommended: folders,\n },\n });\n\n break;\n }\n\n case 'updateChatMembers': {\n const targetChat = global.chats.byId[update.id];\n const { replacedMembers, addedMember, deletedMemberId } = update;\n if (!targetChat) {\n return;\n }\n\n let shouldUpdate = false;\n let members = targetChat.fullInfo?.members\n ? [...targetChat.fullInfo.members]\n : [];\n\n if (replacedMembers) {\n members = replacedMembers;\n shouldUpdate = true;\n } else if (addedMember) {\n if (\n !members.length\n || !members.some((m) => m.userId === addedMember.userId)\n ) {\n members.push(addedMember);\n shouldUpdate = true;\n }\n } else if (members.length && deletedMemberId) {\n const deleteIndex = members.findIndex((m) => m.userId === deletedMemberId);\n if (deleteIndex > -1) {\n members.slice(deleteIndex, 1);\n shouldUpdate = true;\n }\n }\n\n if (shouldUpdate) {\n const adminMembers = members.filter(({ isOwner, isAdmin }) => isOwner || isAdmin);\n // TODO Kicked members?\n\n setGlobal(updateChat(global, update.id, {\n membersCount: members.length,\n fullInfo: {\n ...targetChat.fullInfo,\n members,\n adminMembers,\n },\n }));\n }\n\n break;\n }\n\n case 'deleteProfilePhotos': {\n const { chatId, ids } = update;\n const chat = global.chats.byId[chatId];\n\n if (chat?.photos) {\n setGlobal(updateChat(global, chatId, {\n photos: chat.photos.filter((photo) => !ids.includes(photo.id)),\n }));\n }\n break;\n }\n\n case 'draftMessage': {\n const {\n chatId, formattedText, date, replyingToId,\n } = update;\n const chat = global.chats.byId[chatId];\n\n if (chat) {\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'draft', formattedText);\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'replyingToId', replyingToId);\n global = updateChat(global, chatId, { draftDate: date });\n\n setGlobal(global);\n }\n break;\n }\n\n case 'showInvite': {\n const { data } = update;\n\n actions.showDialog({ data });\n break;\n }\n }\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport {\n ApiUpdate, ApiMessage, ApiPollResult, ApiThreadInfo, MAIN_THREAD_ID,\n} from '../../../api/types';\n\nimport { unique } from '../../../util/iteratees';\nimport {\n updateChat,\n deleteChatMessages,\n updateChatMessage,\n updateListedIds,\n addViewportId,\n updateThreadInfo,\n replaceThreadParam,\n updateScheduledMessage,\n deleteChatScheduledMessages,\n updateThreadUnreadFromForwardedMessage,\n} from '../../reducers';\nimport { GlobalActions, GlobalState } from '../../../global/types';\nimport {\n selectChatMessage,\n selectChatMessages,\n selectIsViewportNewest,\n selectListedIds,\n selectChatMessageByPollId,\n selectCommonBoxChatId,\n selectIsChatListed,\n selectThreadInfo,\n selectThreadByMessage,\n selectPinnedIds,\n selectScheduledMessage,\n selectScheduledMessages,\n isMessageInCurrentMessageList,\n selectScheduledIds,\n selectCurrentMessageList,\n selectViewportIds,\n selectFirstUnreadId,\n selectChat,\n selectIsChatWithBot,\n} from '../../selectors';\nimport { getMessageContent, isChatPrivate, isMessageLocal } from '../../helpers';\n\nconst ANIMATION_DELAY = 350;\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'newMessage': {\n const { chatId, id, message } = update;\n global = updateWithLocalMedia(global, chatId, id, message);\n global = updateListedAndViewportIds(global, actions, message as ApiMessage);\n\n if (message.threadInfo) {\n global = updateThreadInfo(\n global,\n message.threadInfo.chatId,\n message.threadInfo.threadId,\n message.threadInfo,\n );\n }\n\n setGlobal(global);\n\n const newMessage = selectChatMessage(global, chatId, id)!;\n\n if (isMessageInCurrentMessageList(global, chatId, message as ApiMessage)) {\n if (message.isOutgoing && !(message.content?.action)) {\n const currentMessageList = selectCurrentMessageList(global);\n if (currentMessageList) {\n // We do not use `actions.focusLastMessage` as it may be set with a delay (see below)\n actions.focusMessage({\n chatId,\n threadId: currentMessageList.threadId,\n messageId: message.id,\n noHighlight: true,\n isResizingContainer: true,\n });\n }\n }\n\n const { threadInfo } = selectThreadByMessage(global, chatId, message as ApiMessage) || {};\n if (threadInfo) {\n actions.requestThreadInfoUpdate({ chatId, threadId: threadInfo.threadId });\n }\n\n // @perf Wait until scroll animation finishes or simply rely on delivery status update (which is itself delayed)\n if (!isMessageLocal(message as ApiMessage)) {\n setTimeout(() => {\n setGlobal(updateChatLastMessage(getGlobal(), chatId, newMessage));\n }, ANIMATION_DELAY);\n }\n } else {\n setGlobal(updateChatLastMessage(getGlobal(), chatId, newMessage));\n }\n\n // Edge case: New message in an old (not loaded) chat.\n if (!selectIsChatListed(global, chatId)) {\n actions.loadTopChats();\n }\n\n break;\n }\n\n case 'newScheduledMessage': {\n const { chatId, id, message } = update;\n\n global = updateWithLocalMedia(global, chatId, id, message, true);\n\n const scheduledIds = selectScheduledIds(global, chatId) || [];\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds', unique([...scheduledIds, id]));\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateMessage': {\n const { chatId, id, message } = update;\n\n const currentMessage = selectChatMessage(global, chatId, id);\n if (!currentMessage) {\n return;\n }\n\n global = updateWithLocalMedia(global, chatId, id, message);\n\n const newMessage = selectChatMessage(global, chatId, id)!;\n if (message.threadInfo) {\n global = updateThreadInfo(\n global,\n message.threadInfo.chatId,\n message.threadInfo.threadId,\n message.threadInfo,\n );\n }\n global = updateChatLastMessage(global, chatId, newMessage);\n\n setGlobal(global);\n\n // Scroll down if bot message height is changed with an updated inline keyboard.\n // A drawback: this will scroll down even if the previous scroll was not at bottom.\n const chat = selectChat(global, chatId);\n if (\n chat\n && !message.isOutgoing\n && chat.lastMessage?.id === message.id\n && selectIsChatWithBot(global, chat)\n && isMessageInCurrentMessageList(global, chatId, message as ApiMessage)\n && selectIsViewportNewest(global, chatId, message.threadInfo?.threadId || MAIN_THREAD_ID)\n ) {\n actions.focusLastMessage();\n }\n\n break;\n }\n\n case 'updateScheduledMessage': {\n const { chatId, id, message } = update;\n\n const currentMessage = selectScheduledMessage(global, chatId, id);\n if (!currentMessage) {\n return;\n }\n\n global = updateWithLocalMedia(global, chatId, id, message, true);\n const ids = Object.keys(selectScheduledMessages(global, chatId) || {}).map(Number).sort((a, b) => b - a);\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds', ids);\n setGlobal(global);\n\n break;\n }\n\n case 'updateMessageSendSucceeded': {\n const { chatId, localId, message } = update;\n\n global = updateListedAndViewportIds(global, actions, message as ApiMessage);\n\n const currentMessage = selectChatMessage(global, chatId, localId);\n\n global = deleteChatMessages(global, chatId, [localId]);\n\n // Edge case for \"Send When Online\"\n if (message.isScheduled) {\n global = deleteChatScheduledMessages(global, chatId, [localId]);\n }\n\n global = updateChatMessage(global, chatId, message.id, {\n ...currentMessage,\n ...message,\n previousLocalId: localId,\n });\n\n const newMessage = selectChatMessage(global, chatId, message.id)!;\n global = updateChatLastMessage(global, chatId, newMessage);\n\n const thread = selectThreadByMessage(global, chatId, message);\n // For some reason Telegram requires to manually mark outgoing thread messages read\n if (thread?.threadInfo) {\n actions.markMessageListRead({ maxId: message.id });\n\n global = replaceThreadParam(global, chatId, thread.threadInfo.threadId, 'threadInfo', {\n ...thread.threadInfo,\n lastMessageId: message.id,\n lastReadInboxMessageId: message.id,\n });\n }\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateScheduledMessageSendSucceeded': {\n const { chatId, localId, message } = update;\n const scheduledIds = selectScheduledIds(global, chatId) || [];\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds', [...scheduledIds, message.id]);\n\n const currentMessage = selectScheduledMessage(global, chatId, localId);\n\n global = deleteChatScheduledMessages(global, chatId, [localId]);\n global = updateScheduledMessage(global, chatId, message.id, {\n ...currentMessage,\n ...message,\n previousLocalId: localId,\n });\n\n setGlobal(global);\n break;\n }\n\n case 'updatePinnedIds': {\n const { chatId, isPinned, messageIds } = update;\n\n const currentPinnedIds = selectPinnedIds(global, chatId) || [];\n const newPinnedIds = isPinned\n ? [...currentPinnedIds, ...messageIds].sort((a, b) => b - a)\n : currentPinnedIds.filter((id) => !messageIds.includes(id));\n\n setGlobal(replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'pinnedIds', newPinnedIds));\n\n break;\n }\n\n case 'updateThreadInfo': {\n const {\n chatId, threadId, threadInfo, firstMessageId,\n } = update;\n\n const currentThreadInfo = selectThreadInfo(global, chatId, threadId);\n const newTheadInfo = {\n ...currentThreadInfo,\n ...threadInfo,\n };\n\n if (!newTheadInfo.threadId) {\n return;\n }\n\n global = updateThreadInfo(global, chatId, threadId, newTheadInfo as ApiThreadInfo);\n\n if (firstMessageId) {\n global = replaceThreadParam(global, chatId, threadId, 'firstMessageId', firstMessageId);\n }\n\n setGlobal(global);\n\n break;\n }\n\n case 'resetMessages': {\n const { id: chatId } = update;\n const messagesById = selectChatMessages(global, chatId);\n\n if (messagesById && !isChatPrivate(chatId)) {\n global = deleteChatMessages(global, chatId, Object.keys(messagesById).map(Number));\n setGlobal(global);\n actions.loadFullChat({ chatId, force: true });\n }\n\n break;\n }\n\n case 'deleteMessages': {\n const { ids, chatId } = update;\n\n deleteMessages(chatId, ids, actions, global);\n break;\n }\n\n case 'deleteScheduledMessages': {\n const { ids, chatId } = update;\n\n deleteScheduledMessages(chatId, ids, actions, global);\n break;\n }\n\n case 'deleteHistory': {\n const { chatId } = update;\n const chatMessages = global.messages.byChatId[chatId];\n if (chatMessages) {\n const ids = Object.keys(chatMessages.byId).map(Number);\n deleteMessages(chatId, ids, actions, global);\n } else {\n actions.requestChatUpdate({ chatId });\n }\n\n break;\n }\n\n case 'updateCommonBoxMessages': {\n const { ids, messageUpdate } = update;\n\n ids.forEach((id) => {\n const chatId = selectCommonBoxChatId(global, id);\n if (chatId) {\n global = updateChatMessage(global, chatId, id, messageUpdate);\n }\n });\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateChannelMessages': {\n const { channelId, ids, messageUpdate } = update;\n\n ids.forEach((id) => {\n global = updateChatMessage(global, channelId, id, messageUpdate);\n });\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateMessagePoll': {\n const { pollId, pollUpdate } = update;\n\n const message = selectChatMessageByPollId(global, pollId);\n\n if (message?.content.poll) {\n const updatedPoll = { ...message.content.poll, ...pollUpdate };\n\n // Workaround for poll update bug: `chosen` option gets reset when someone votes after current user\n const { results: updatedResults } = updatedPoll.results || {};\n if (updatedResults && !updatedResults.some(((result) => result.isChosen))) {\n const { results } = message.content.poll.results;\n const chosenAnswers = results && results.filter((result) => result.isChosen);\n if (chosenAnswers) {\n chosenAnswers.forEach((chosenAnswer) => {\n const chosenAnswerIndex = updatedResults.findIndex((result) => result.option === chosenAnswer.option);\n if (chosenAnswerIndex >= 0) {\n updatedPoll.results.results![chosenAnswerIndex].isChosen = true;\n }\n });\n }\n }\n\n setGlobal(updateChatMessage(\n global,\n message.chatId,\n message.id,\n {\n content: {\n ...message.content,\n poll: updatedPoll,\n },\n },\n ));\n }\n break;\n }\n\n case 'updateMessagePollVote': {\n const { pollId, userId, options } = update;\n const message = selectChatMessageByPollId(global, pollId);\n if (!message || !message.content.poll || !message.content.poll.results) {\n break;\n }\n\n const { poll } = message.content;\n\n const { recentVoterIds, totalVoters, results } = poll.results;\n const newRecentVoterIds = recentVoterIds ? [...recentVoterIds] : [];\n const newTotalVoters = totalVoters ? totalVoters + 1 : 1;\n const newResults = results ? [...results] : [];\n\n newRecentVoterIds.push(userId);\n\n options.forEach((option) => {\n const targetOption = newResults.find((result) => result.option === option);\n const targetOptionIndex = newResults.findIndex((result) => result.option === option);\n const updatedOption: ApiPollResult = targetOption ? { ...targetOption } : { option, votersCount: 0 };\n\n updatedOption.votersCount += 1;\n if (userId === global.currentUserId) {\n updatedOption.isChosen = true;\n }\n\n if (targetOptionIndex) {\n newResults[targetOptionIndex] = updatedOption;\n } else {\n newResults.push(updatedOption);\n }\n });\n\n setGlobal(updateChatMessage(\n global,\n message.chatId,\n message.id,\n {\n content: {\n ...message.content,\n poll: {\n ...poll,\n results: {\n ...poll.results,\n recentVoterIds: newRecentVoterIds,\n totalVoters: newTotalVoters,\n results: newResults,\n },\n },\n },\n },\n ));\n\n break;\n }\n }\n});\n\nfunction updateWithLocalMedia(\n global: GlobalState, chatId: number, id: number, message: Partial, isScheduled = false,\n) {\n // Preserve locally uploaded media.\n const currentMessage = isScheduled\n ? selectScheduledMessage(global, chatId, id)\n : selectChatMessage(global, chatId, id);\n if (currentMessage && message.content) {\n const {\n photo, video, sticker, document,\n } = getMessageContent(currentMessage);\n if (photo && message.content.photo) {\n message.content.photo.blobUrl = photo.blobUrl;\n message.content.photo.thumbnail = photo.thumbnail;\n } else if (video && message.content.video) {\n message.content.video.blobUrl = video.blobUrl;\n } else if (sticker && message.content.sticker) {\n message.content.sticker.isPreloadedGlobally = sticker.isPreloadedGlobally;\n } else if (document && message.content.document) {\n message.content.document.previewBlobUrl = document.previewBlobUrl;\n }\n }\n\n return isScheduled\n ? updateScheduledMessage(global, chatId, id, message)\n : updateChatMessage(global, chatId, id, message);\n}\n\nfunction updateThreadUnread(global: GlobalState, actions: GlobalActions, message: ApiMessage, isDeleting?: boolean) {\n const { chatId } = message;\n\n const { threadInfo } = selectThreadByMessage(global, chatId, message) || {};\n\n if (!threadInfo && message.replyToMessageId) {\n const originMessage = selectChatMessage(global, chatId, message.replyToMessageId);\n if (originMessage) {\n global = updateThreadUnreadFromForwardedMessage(global, originMessage, chatId, message.id, isDeleting);\n } else {\n actions.loadMessage({\n chatId,\n messageId: message.replyToMessageId,\n threadUpdate: {\n isDeleting,\n lastMessageId: message.id,\n },\n });\n }\n }\n\n return global;\n}\n\nfunction updateListedAndViewportIds(global: GlobalState, actions: GlobalActions, message: ApiMessage) {\n const { id, chatId } = message;\n\n const { threadInfo, firstMessageId } = selectThreadByMessage(global, chatId, message) || {};\n\n const chat = selectChat(global, chatId);\n const isUnreadChatNotLoaded = chat?.unreadCount && !selectListedIds(global, chatId, MAIN_THREAD_ID);\n\n global = updateThreadUnread(global, actions, message);\n\n if (threadInfo) {\n if (firstMessageId || !isMessageLocal(message)) {\n global = updateListedIds(global, chatId, threadInfo.threadId, [id]);\n\n if (selectIsViewportNewest(global, chatId, threadInfo.threadId)) {\n global = addViewportId(global, chatId, threadInfo.threadId, id);\n\n if (!firstMessageId) {\n global = replaceThreadParam(global, chatId, threadInfo.threadId, 'firstMessageId', message.id);\n }\n }\n }\n\n global = replaceThreadParam(global, chatId, threadInfo.threadId, 'threadInfo', {\n ...threadInfo,\n lastMessageId: message.id,\n messagesCount: threadInfo.messagesCount + 1,\n });\n }\n\n if (isUnreadChatNotLoaded) {\n return global;\n }\n\n global = updateListedIds(global, chatId, MAIN_THREAD_ID, [id]);\n\n if (selectIsViewportNewest(global, chatId, MAIN_THREAD_ID)) {\n // Always keep the first unread message in the viewport list\n const firstUnreadId = selectFirstUnreadId(global, chatId, MAIN_THREAD_ID);\n const newGlobal = addViewportId(global, chatId, MAIN_THREAD_ID, id);\n const newViewportIds = selectViewportIds(newGlobal, chatId, MAIN_THREAD_ID);\n\n if (!firstUnreadId || newViewportIds!.includes(firstUnreadId)) {\n global = newGlobal;\n }\n }\n\n return global;\n}\n\nfunction updateChatLastMessage(\n global: GlobalState,\n chatId: number,\n message: ApiMessage,\n force = false,\n) {\n const { chats } = global;\n const currentLastMessage = chats.byId[chatId]?.lastMessage;\n\n if (currentLastMessage && !force) {\n const isSameOrNewer = (\n currentLastMessage.id === message.id || currentLastMessage.id === message.previousLocalId\n ) || message.id > currentLastMessage.id;\n\n if (!isSameOrNewer) {\n return global;\n }\n }\n\n return updateChat(global, chatId, { lastMessage: message });\n}\n\nfunction findLastMessage(global: GlobalState, chatId: number) {\n const byId = selectChatMessages(global, chatId);\n const listedIds = selectListedIds(global, chatId, MAIN_THREAD_ID);\n\n if (!byId || !listedIds) {\n return undefined;\n }\n\n let i = listedIds.length;\n while (i--) {\n const message = byId[listedIds[i]];\n if (!message.isDeleting) {\n return message;\n }\n }\n\n return undefined;\n}\n\nfunction deleteMessages(chatId: number | undefined, ids: number[], actions: GlobalActions, global: GlobalState) {\n // Channel update\n\n if (chatId) {\n ids.forEach((id) => {\n global = updateChatMessage(global, chatId, id, {\n isDeleting: true,\n });\n\n const newLastMessage = findLastMessage(global, chatId);\n if (newLastMessage) {\n global = updateChatLastMessage(global, chatId, newLastMessage, true);\n }\n });\n\n setGlobal(global);\n\n actions.requestChatUpdate({ chatId });\n\n const threadIdsToUpdate: number[] = [];\n\n ids.forEach((id) => {\n const message = selectChatMessage(global, chatId, id);\n if (!message) {\n return;\n }\n\n global = updateThreadUnread(global, actions, message, true);\n\n const { threadInfo } = selectThreadByMessage(global, chatId, message) || {};\n if (threadInfo) {\n threadIdsToUpdate.push(threadInfo.threadId);\n }\n });\n\n setGlobal(global);\n\n setTimeout(() => {\n setGlobal(deleteChatMessages(getGlobal(), chatId, ids));\n\n unique(threadIdsToUpdate).forEach((threadId) => {\n actions.requestThreadInfoUpdate({ chatId, threadId });\n });\n }, ANIMATION_DELAY);\n\n return;\n }\n\n // Common box update\n\n const chatsIdsToUpdate: number[] = [];\n\n ids.forEach((id) => {\n const commonBoxChatId = selectCommonBoxChatId(global, id);\n if (commonBoxChatId) {\n chatsIdsToUpdate.push(commonBoxChatId);\n\n global = updateChatMessage(global, commonBoxChatId, id, {\n isDeleting: true,\n });\n\n const newLastMessage = findLastMessage(global, commonBoxChatId);\n if (newLastMessage) {\n global = updateChatLastMessage(global, commonBoxChatId, newLastMessage, true);\n }\n\n setTimeout(() => {\n setGlobal(deleteChatMessages(getGlobal(), commonBoxChatId, [id]));\n }, ANIMATION_DELAY);\n }\n });\n\n setGlobal(global);\n\n unique(chatsIdsToUpdate).forEach((id) => {\n actions.requestChatUpdate({ chatId: id });\n });\n}\n\nfunction deleteScheduledMessages(\n chatId: number | undefined, ids: number[], actions: GlobalActions, global: GlobalState,\n) {\n if (!chatId) {\n return;\n }\n\n ids.forEach((id) => {\n global = updateScheduledMessage(global, chatId, id, {\n isDeleting: true,\n });\n });\n\n setGlobal(global);\n\n setTimeout(() => {\n global = deleteChatScheduledMessages(getGlobal(), chatId, ids);\n const scheduledMessages = selectScheduledMessages(global, chatId);\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'scheduledIds', Object.keys(scheduledMessages || {}).map(Number),\n );\n setGlobal(global);\n }, ANIMATION_DELAY);\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate, ApiUserStatus } from '../../../api/types';\n\nimport { deleteUser, updateUser } from '../../reducers';\nimport { throttle } from '../../../util/schedulers';\n\nconst STATUS_UPDATE_THROTTLE = 3000;\n\nconst flushStatusUpdatesThrottled = throttle(flushStatusUpdates, STATUS_UPDATE_THROTTLE, true);\n\nlet pendingStatusUpdates: [number, ApiUserStatus][] = [];\n\nfunction scheduleStatusUpdate(userId: number, statusUpdate: ApiUserStatus) {\n pendingStatusUpdates.push([userId, statusUpdate]);\n flushStatusUpdatesThrottled();\n}\n\nfunction flushStatusUpdates() {\n let global = getGlobal();\n pendingStatusUpdates.forEach(([userId, statusUpdate]) => {\n global = updateUser(global, userId, {\n status: statusUpdate,\n });\n });\n setGlobal(global);\n\n pendingStatusUpdates = [];\n}\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'deleteUser': {\n return deleteUser(global, update.id);\n }\n\n case 'updateUser': {\n return updateUser(global, update.id, update.user);\n }\n\n case 'updateUserStatus': {\n // Status updates come very often so we throttle them\n scheduleStatusUpdate(update.userId, update.status);\n return undefined;\n }\n\n case 'updateUserFullInfo': {\n const { id, fullInfo } = update;\n const targetUser = global.users.byId[id];\n if (!targetUser) {\n return undefined;\n }\n\n return updateUser(global, id, {\n fullInfo: {\n ...targetUser.fullInfo,\n ...fullInfo,\n },\n });\n }\n }\n\n return undefined;\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\n\nimport { updateStickerSet } from '../../reducers';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'updateStickerSet': {\n return updateStickerSet(global, update.id, update.stickerSet);\n }\n }\n\n return undefined;\n});\n","import {\n addReducer, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\nimport { ApiPrivacyKey } from '../../../types';\n\nimport { addBlockedContact, removeBlockedContact } from '../../reducers';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'updatePeerBlocked':\n if (update.isBlocked) {\n return addBlockedContact(getGlobal(), update.id);\n } else {\n return removeBlockedContact(getGlobal(), update.id);\n }\n\n case 'updateResetContactList':\n setGlobal({\n ...getGlobal(),\n contactList: {\n hash: 0,\n userIds: [],\n },\n });\n break;\n\n case 'updateFavoriteStickers':\n actions.loadFavoriteStickers();\n break;\n\n case 'updatePrivacy':\n global.settings.privacy[update.key as ApiPrivacyKey] = update.rules;\n break;\n }\n\n return undefined;\n});\n","import { addReducer, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\nimport { GlobalState } from '../../../global/types';\nimport { addNotifyException, updateChat, updateNotifySettings } from '../../reducers';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate): GlobalState | undefined => {\n switch (update['@type']) {\n case 'updateNotifySettings': {\n return updateNotifySettings(global, update.peerType, update.isSilent, update.shouldShowPreviews);\n }\n\n case 'updateNotifyExceptions': {\n const {\n chatId, isMuted, isSilent, shouldShowPreviews,\n } = update;\n const chat = global.chats.byId[chatId];\n\n if (chat) {\n global = updateChat(global, chatId, { isMuted });\n }\n\n setGlobal(addNotifyException(global, chatId, { isMuted, isSilent, shouldShowPreviews }));\n break;\n }\n }\n\n return undefined;\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\nimport { GlobalState } from '../../../global/types';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate): GlobalState | undefined => {\n switch (update['@type']) {\n case 'updateTwoFaStateWaitCode': {\n return {\n ...global,\n twoFaSettings: {\n ...global.twoFaSettings,\n isLoading: false,\n waitingEmailCodeLength: update.length,\n },\n };\n }\n\n case 'updateTwoFaError': {\n return {\n ...global,\n twoFaSettings: {\n ...global.twoFaSettings,\n error: update.message,\n },\n };\n }\n }\n\n return undefined;\n});\n","import { useEffect } from '../lib/teact/teact';\n\nimport { onBeforeUnload } from '../util/schedulers';\n\nexport default function useBeforeUnload(callback: AnyToVoidFunction) {\n useEffect(() => {\n return onBeforeUnload(callback);\n }, [callback]);\n}\n","import { useEffect } from '../lib/teact/teact';\nimport { IS_IOS } from '../util/environment';\n\nexport default function usePreventIosPinchZoom(isDisabled = false) {\n // Disable viewport zooming on iOS Safari\n useEffect(() => {\n if (!IS_IOS || isDisabled) {\n return undefined;\n }\n\n document.addEventListener('gesturestart', preventEvent);\n\n return () => {\n document.removeEventListener('gesturestart', preventEvent);\n };\n }, [isDisabled]);\n}\n\nfunction preventEvent(e: Event) {\n e.preventDefault();\n}\n","import { useEffect, useState } from '../lib/teact/teact';\n\nexport default function useBrowserOnline() {\n const [isOnline, setIsOnline] = useState(window.navigator.onLine);\n\n useEffect(() => {\n function handleChange() {\n setIsOnline(window.navigator.onLine);\n }\n\n window.addEventListener('online', handleChange);\n window.addEventListener('offline', handleChange);\n\n return () => {\n window.removeEventListener('offline', handleChange);\n window.removeEventListener('online', handleChange);\n };\n }, []);\n\n return isOnline;\n}\n","import React, {\n FC, useCallback, useMemo, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { LeftColumnContent, ISettings } from '../../../types';\nimport { ApiChat } from '../../../api/types';\n\nimport {\n ANIMATION_LEVEL_MAX, APP_NAME, APP_VERSION, FEEDBACK_URL,\n} from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport { pick } from '../../../util/iteratees';\nimport { isChatArchived } from '../../../modules/helpers';\nimport { formatDateToString } from '../../../util/dateFormat';\nimport { selectTheme } from '../../../modules/selectors';\nimport switchTheme from '../../../util/switchTheme';\nimport useLang from '../../../hooks/useLang';\nimport { disableHistoryBack } from '../../../hooks/useHistoryBack';\n\nimport DropdownMenu from '../../ui/DropdownMenu';\nimport MenuItem from '../../ui/MenuItem';\nimport Button from '../../ui/Button';\nimport SearchInput from '../../ui/SearchInput';\nimport PickerSelectedItem from '../../common/PickerSelectedItem';\nimport Switcher from '../../ui/Switcher';\n\nimport './LeftMainHeader.scss';\n\ntype OwnProps = {\n content: LeftColumnContent;\n contactsFilter: string;\n shouldSkipTransition?: boolean;\n onSearchQuery: (query: string) => void;\n onSelectSettings: () => void;\n onSelectContacts: () => void;\n onSelectArchived: () => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n searchQuery?: string;\n isLoading: boolean;\n currentUserId?: number;\n globalSearchChatId?: number;\n searchDate?: number;\n theme: ISettings['theme'];\n animationLevel: 0 | 1 | 2;\n chatsById?: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst ANIMATION_LEVEL_OPTIONS = [0, 1, 2];\n\nconst PRODUCTION_HOSTNAME = 'web.telegram.org';\nconst LEGACY_VERSION_URL = 'https://web.telegram.org/?legacy=1';\nconst WEBK_VERSION_URL = 'https://web.telegram.org/k/';\nconst PERMANENT_VERSION_KEY = 'kz_version';\n\nconst LeftMainHeader: FC = ({\n content,\n contactsFilter,\n onSearchQuery,\n onSelectSettings,\n onSelectContacts,\n onSelectArchived,\n setGlobalSearchChatId,\n onReset,\n searchQuery,\n isLoading,\n shouldSkipTransition,\n currentUserId,\n globalSearchChatId,\n searchDate,\n theme,\n animationLevel,\n chatsById,\n openChat,\n openTipsChat,\n setGlobalSearchDate,\n setSettingOption,\n}) => {\n const lang = useLang();\n const hasMenu = content === LeftColumnContent.ChatList;\n const clearedDateSearchParam = { date: undefined };\n const clearedChatSearchParam = { id: undefined };\n const selectedSearchDate = useMemo(() => {\n return searchDate\n ? formatDateToString(new Date(searchDate * 1000))\n : undefined;\n }, [searchDate]);\n const archivedUnreadChatsCount = useMemo(() => {\n if (!hasMenu || !chatsById) {\n return 0;\n }\n\n return Object.values(chatsById).reduce((total, chat) => {\n if (!isChatArchived(chat)) {\n return total;\n }\n\n return chat.unreadCount ? total + 1 : total;\n }, 0);\n }, [hasMenu, chatsById]);\n\n const withOtherVersions = window.location.hostname === PRODUCTION_HOSTNAME;\n\n const MainButton: FC<{ onTrigger: () => void; isOpen?: boolean }> = useMemo(() => {\n return ({ onTrigger, isOpen }) => (\n onReset()}\n ariaLabel={hasMenu ? lang('AccDescrOpenMenu2') : 'Return to chat list'}\n >\n
\n \n );\n }, [hasMenu, lang, onReset, shouldSkipTransition]);\n\n const handleSearchFocus = useCallback(() => {\n if (!searchQuery) {\n onSearchQuery('');\n }\n }, [searchQuery, onSearchQuery]);\n\n const handleSelectSaved = useCallback(() => {\n openChat({ id: currentUserId, shouldReplaceHistory: true });\n }, [currentUserId, openChat]);\n\n const handleDarkModeToggle = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n const newTheme = theme === 'light' ? 'dark' : 'light';\n\n setSettingOption({ theme: newTheme });\n setSettingOption({ shouldUseSystemTheme: false });\n switchTheme(newTheme, animationLevel === ANIMATION_LEVEL_MAX);\n }, [animationLevel, setSettingOption, theme]);\n\n const handleAnimationLevelChange = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n\n const newLevel = animationLevel === 0 ? 2 : 0;\n ANIMATION_LEVEL_OPTIONS.forEach((_, i) => {\n document.body.classList.toggle(`animation-level-${i}`, newLevel === i);\n });\n\n setSettingOption({ animationLevel: newLevel });\n }, [animationLevel, setSettingOption]);\n\n const handleSwitchToWebK = () => {\n localStorage.setItem(PERMANENT_VERSION_KEY, JSON.stringify('K'));\n disableHistoryBack();\n };\n\n const handleOpenTipsChat = () => {\n openTipsChat({ langCode: lang.code });\n };\n\n const isSearchFocused = (\n Boolean(globalSearchChatId)\n || content === LeftColumnContent.GlobalSearch\n || content === LeftColumnContent.Contacts\n );\n\n const searchInputPlaceholder = content === LeftColumnContent.Contacts\n ? lang('SearchFriends')\n : lang('Search');\n\n return (\n
\n
\n \n \n {lang('SavedMessages')}\n \n \n {lang('ArchivedChats')}\n {archivedUnreadChatsCount > 0 && (\n
{archivedUnreadChatsCount}
\n )}\n \n \n {lang('Contacts')}\n \n \n {lang('Settings')}\n \n \n {lang('lng_menu_night_mode')}\n \n \n \n {lang('Appearance.Animations').toLowerCase()}\n 0}\n />\n \n \n {lang('TelegramFeatures')}\n \n \n Report Bug\n \n {withOtherVersions && (\n <>\n \n Switch to K Version\n \n \n Switch to Old Version\n \n \n )}\n \n \n {selectedSearchDate && (\n \n )}\n {globalSearchChatId && (\n \n )}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n query: searchQuery, fetchingStatus, chatId, date,\n } = global.globalSearch;\n const { currentUserId } = global;\n const { byId: chatsById } = global.chats;\n const { animationLevel } = global.settings.byKey;\n\n return {\n searchQuery,\n isLoading: fetchingStatus ? Boolean(fetchingStatus.chats || fetchingStatus.messages) : false,\n currentUserId,\n chatsById,\n globalSearchChatId: chatId,\n searchDate: date,\n theme: selectTheme(global),\n animationLevel,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat',\n 'openTipsChat',\n 'setGlobalSearchDate',\n 'setGlobalSearchChatId',\n 'setSettingOption',\n ]),\n)(LeftMainHeader));\n","import React, { memo, FC } from '../../lib/teact/teact';\n\nimport { GlobalState } from '../../global/types';\n\nimport useLang from '../../hooks/useLang';\n\nimport Spinner from '../ui/Spinner';\n\nimport './ConnectionState.scss';\n\ntype StateProps = Pick;\n\nconst ConnectionState: FC = () => {\n const lang = useLang();\n\n return (\n
\n \n
{lang('WaitingForNetwork')}
\n
\n );\n};\n\nexport default memo(ConnectionState);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatFolder, ApiUser } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { NotifyException, NotifySettings, SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { buildCollectionByKey, pick } from '../../../util/iteratees';\nimport { captureEvents, SwipeDirection } from '../../../util/captureEvents';\nimport { getFolderUnreadDialogs } from '../../../modules/helpers';\nimport { selectNotifyExceptions, selectNotifySettings } from '../../../modules/selectors';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\nimport useThrottledMemo from '../../../hooks/useThrottledMemo';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\n\nimport Transition from '../../ui/Transition';\nimport TabList from '../../ui/TabList';\nimport ChatList from './ChatList';\n\ntype OwnProps = {\n onScreenSelect: (screen: SettingsScreens) => void;\n foldersDispatch: FolderEditDispatch;\n};\n\ntype StateProps = {\n chatsById: Record;\n usersById: Record;\n chatFoldersById: Record;\n notifySettings: NotifySettings;\n notifyExceptions?: Record;\n orderedFolderIds?: number[];\n activeChatFolder: number;\n currentUserId?: number;\n lastSyncTime?: number;\n shouldSkipHistoryAnimations?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst INFO_THROTTLE = 3000;\nconst SAVED_MESSAGES_HOTKEY = '0';\n\nconst ChatFolders: FC = ({\n chatsById,\n usersById,\n chatFoldersById,\n notifySettings,\n notifyExceptions,\n orderedFolderIds,\n activeChatFolder,\n currentUserId,\n lastSyncTime,\n shouldSkipHistoryAnimations,\n foldersDispatch,\n onScreenSelect,\n loadChatFolders,\n setActiveChatFolder,\n openChat,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const transitionRef = useRef(null);\n\n const lang = useLang();\n\n useEffect(() => {\n if (lastSyncTime) {\n loadChatFolders();\n }\n }, [lastSyncTime, loadChatFolders]);\n\n const displayedFolders = useMemo(() => {\n return orderedFolderIds\n ? orderedFolderIds.map((id) => chatFoldersById[id] || {}).filter(Boolean)\n : undefined;\n }, [chatFoldersById, orderedFolderIds]);\n\n const folderCountersById = useThrottledMemo(() => {\n if (!displayedFolders || !displayedFolders.length) {\n return undefined;\n }\n\n const chatIds = Object.keys(chatsById).map(Number);\n const counters = displayedFolders.map((folder) => {\n const {\n unreadDialogsCount, hasActiveDialogs,\n } = getFolderUnreadDialogs(chatsById, usersById, folder, chatIds, notifySettings, notifyExceptions) || {};\n\n return {\n id: folder.id,\n badgeCount: unreadDialogsCount,\n isBadgeActive: hasActiveDialogs,\n };\n });\n\n return buildCollectionByKey(counters, 'id');\n }, INFO_THROTTLE, [displayedFolders, chatsById, usersById, notifySettings, notifyExceptions]);\n\n const folderTabs = useMemo(() => {\n if (!displayedFolders || !displayedFolders.length) {\n return undefined;\n }\n\n return [\n { title: lang.code === 'en' ? 'All' : lang('FilterAllChats') },\n ...displayedFolders.map((folder) => ({\n title: folder.title,\n ...(folderCountersById?.[folder.id]),\n })),\n ];\n }, [displayedFolders, folderCountersById, lang]);\n\n const handleSwitchTab = useCallback((index: number) => {\n setActiveChatFolder(index);\n }, [setActiveChatFolder]);\n\n // Prevent `activeTab` pointing at non-existing folder after update\n useEffect(() => {\n if (!folderTabs || !folderTabs.length) {\n return;\n }\n\n if (activeChatFolder >= folderTabs.length) {\n setActiveChatFolder(0);\n }\n }, [activeChatFolder, folderTabs, setActiveChatFolder]);\n\n useEffect(() => {\n if (!transitionRef.current || !IS_TOUCH_ENV || !folderTabs || !folderTabs.length) {\n return undefined;\n }\n\n return captureEvents(transitionRef.current, {\n selectorToPreventScroll: '.chat-list',\n onSwipe: ((e, direction) => {\n if (direction === SwipeDirection.Left) {\n setActiveChatFolder(Math.min(activeChatFolder + 1, folderTabs.length - 1));\n return true;\n } else if (direction === SwipeDirection.Right) {\n setActiveChatFolder(Math.max(0, activeChatFolder - 1));\n return true;\n }\n\n return false;\n }),\n });\n }, [activeChatFolder, folderTabs, setActiveChatFolder]);\n\n const isNotInAllTabRef = useRef();\n isNotInAllTabRef.current = activeChatFolder !== 0;\n useEffect(() => (isNotInAllTabRef.current ? captureEscKeyListener(() => {\n if (isNotInAllTabRef.current) {\n setActiveChatFolder(0);\n }\n }) : undefined), [activeChatFolder, setActiveChatFolder]);\n\n useHistoryBack(activeChatFolder !== 0, () => setActiveChatFolder(0));\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.ctrlKey && e.shiftKey && e.code.startsWith('Digit') && folderTabs) {\n const [, digit] = e.code.match(/Digit(\\d)/) || [];\n if (!digit) return;\n\n if (digit === SAVED_MESSAGES_HOTKEY) {\n openChat({ id: currentUserId, shouldReplaceHistory: true });\n return;\n }\n\n const folder = Number(digit) - 1;\n if (folder > folderTabs.length - 1) return;\n\n setActiveChatFolder(folder);\n e.preventDefault();\n }\n };\n\n document.addEventListener('keydown', handleKeyDown, true);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, true);\n };\n });\n\n const {\n shouldRender: shouldRenderPlaceholder, transitionClassNames,\n } = useShowTransition(!orderedFolderIds, undefined, true);\n\n function renderCurrentTab(isActive: boolean) {\n const activeFolder = Object.values(chatFoldersById)\n .find(({ title }) => title === folderTabs![activeChatFolder].title);\n\n if (!activeFolder || activeChatFolder === 0) {\n return (\n \n );\n }\n\n return (\n \n );\n }\n\n return (\n
\n {folderTabs?.length ? (\n \n ) : shouldRenderPlaceholder ? (\n
\n ) : undefined}\n \n {renderCurrentTab}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chats: { byId: chatsById },\n users: { byId: usersById },\n chatFolders: {\n byId: chatFoldersById,\n orderedIds: orderedFolderIds,\n activeChatFolder,\n },\n currentUserId,\n lastSyncTime,\n shouldSkipHistoryAnimations,\n } = global;\n\n return {\n chatsById,\n usersById,\n chatFoldersById,\n orderedFolderIds,\n lastSyncTime,\n notifySettings: selectNotifySettings(global),\n notifyExceptions: selectNotifyExceptions(global),\n activeChatFolder,\n currentUserId,\n shouldSkipHistoryAnimations,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadChatFolders',\n 'setActiveChatFolder',\n 'openChat',\n ]),\n)(ChatFolders));\n","import { useState } from '../lib/teact/teact';\n\nimport useThrottle from './useThrottle';\nimport useOnChange from './useOnChange';\nimport useHeavyAnimationCheck from './useHeavyAnimationCheck';\nimport useFlag from './useFlag';\n\nexport default (resolverFn: () => R, ms: number, dependencies: D) => {\n const runThrottled = useThrottle(ms, true);\n const [value, setValue] = useState();\n const [isFrozen, freeze, unfreeze] = useFlag();\n\n useHeavyAnimationCheck(freeze, unfreeze);\n\n useOnChange(() => {\n if (isFrozen) {\n return;\n }\n\n runThrottled(() => {\n setValue(resolverFn());\n });\n }, dependencies.concat([isFrozen]));\n\n return value;\n};\n","import { useMemo } from '../lib/teact/teact';\n\nimport { throttle } from '../util/schedulers';\n\nexport default (ms: number, noFirst = false) => {\n return useMemo(() => {\n return throttle((cb) => cb(), ms, !noFirst);\n }, [ms, noFirst]);\n};\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\nimport { OwnProps } from './LeftSearch';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\nimport Loading from '../../ui/Loading';\n\nconst LeftSearchAsync: FC = (props) => {\n const LeftSearch = useModuleLoader(Bundles.Extra, 'LeftSearch');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return LeftSearch ? : ;\n};\n\nexport default memo(LeftSearchAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\nimport { OwnProps } from './ContactList';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\nimport Loading from '../../ui/Loading';\n\nconst ContactListAsync: FC = (props) => {\n const ContactList = useModuleLoader(Bundles.Extra, 'ContactList');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ContactList ? : ;\n};\n\nexport default memo(ContactListAsync);\n","import React, {\n FC, useCallback, useState, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport Menu from '../ui/Menu';\nimport MenuItem from '../ui/MenuItem';\n\nimport './NewChatButton.scss';\n\nconst MENU_CLOSE_DELAY_MS = 750;\nlet closeTimeout: number | undefined;\n\ntype OwnProps = {\n isShown: boolean;\n onNewPrivateChat: () => void;\n onNewChannel: () => void;\n onNewGroup: () => void;\n};\n\nconst NewChatButton: FC = ({\n isShown,\n onNewPrivateChat,\n onNewChannel,\n onNewGroup,\n}) => {\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n\n useEffect(() => {\n if (!isShown) {\n setIsMenuOpen(false);\n }\n }, [isShown]);\n\n const lang = useLang();\n\n const fabClassName = buildClassName(\n 'NewChatButton',\n isShown && 'revealed',\n isMenuOpen && 'menu-is-open',\n );\n\n const toggleIsMenuOpen = () => {\n setIsMenuOpen(!isMenuOpen);\n };\n\n const handleClose = () => {\n setIsMenuOpen(false);\n };\n\n const handleMouseEnter = useCallback(() => {\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n\n closeTimeout = window.setTimeout(() => {\n setIsMenuOpen(false);\n }, MENU_CLOSE_DELAY_MS);\n }, []);\n\n return (\n \n \n \n \n \n \n {lang('NewChannel')}\n {lang('NewGroup')}\n {lang('NewMessageTitle')}\n \n
\n );\n};\n\nexport default memo(NewChatButton);\n","import React, {\n FC, useState, useRef, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\nimport { LeftColumnContent, SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\nimport buildClassName from '../../../util/buildClassName';\nimport useBrowserOnline from '../../../hooks/useBrowserOnline';\nimport useFlag from '../../../hooks/useFlag';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useLang from '../../../hooks/useLang';\n\nimport Transition from '../../ui/Transition';\nimport LeftMainHeader from './LeftMainHeader';\nimport ConnectionState from '../ConnectionState';\nimport ChatFolders from './ChatFolders';\nimport LeftSearch from '../search/LeftSearch.async';\nimport ContactList from './ContactList.async';\nimport NewChatButton from '../NewChatButton';\nimport ShowTransition from '../../ui/ShowTransition';\nimport Button from '../../ui/Button';\n\nimport './LeftMain.scss';\n\ntype OwnProps = {\n content: LeftColumnContent;\n searchQuery?: string;\n searchDate?: number;\n contactsFilter: string;\n shouldSkipTransition?: boolean;\n foldersDispatch: FolderEditDispatch;\n onSearchQuery: (query: string) => void;\n onContentChange: (content: LeftColumnContent) => void;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = Pick;\n\nconst TRANSITION_RENDER_COUNT = Object.keys(LeftColumnContent).length / 2;\nconst BUTTON_CLOSE_DELAY_MS = 250;\nconst APP_OUTDATED_TIMEOUT = 3 * 24 * 60 * 60 * 1000; // 3 days\n\nlet closeTimeout: number | undefined;\n\nconst LeftMain: FC = ({\n content,\n searchQuery,\n searchDate,\n contactsFilter,\n shouldSkipTransition,\n foldersDispatch,\n onSearchQuery,\n onContentChange,\n onScreenSelect,\n onReset,\n connectionState,\n}) => {\n const [isNewChatButtonShown, setIsNewChatButtonShown] = useState(IS_TOUCH_ENV);\n\n const isBrowserOnline = useBrowserOnline();\n const isConnecting = !isBrowserOnline || connectionState === 'connectionStateConnecting';\n\n const isMouseInside = useRef(false);\n\n const handleSelectSettings = useCallback(() => {\n onContentChange(LeftColumnContent.Settings);\n }, [onContentChange]);\n\n const handleSelectContacts = useCallback(() => {\n onContentChange(LeftColumnContent.Contacts);\n }, [onContentChange]);\n\n const handleSelectNewChannel = useCallback(() => {\n onContentChange(LeftColumnContent.NewChannelStep1);\n }, [onContentChange]);\n\n const handleSelectNewGroup = useCallback(() => {\n onContentChange(LeftColumnContent.NewGroupStep1);\n }, [onContentChange]);\n\n const handleSelectArchived = useCallback(() => {\n onContentChange(LeftColumnContent.Archived);\n }, [onContentChange]);\n\n const handleMouseEnter = useCallback(() => {\n if (content !== LeftColumnContent.ChatList) {\n return;\n }\n isMouseInside.current = true;\n setIsNewChatButtonShown(true);\n }, [content]);\n\n const handleMouseLeave = useCallback(() => {\n isMouseInside.current = false;\n\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n\n closeTimeout = window.setTimeout(() => {\n if (!isMouseInside.current) {\n setIsNewChatButtonShown(false);\n }\n }, BUTTON_CLOSE_DELAY_MS);\n }, []);\n\n useEffect(() => {\n let autoCloseTimeout: number | undefined;\n if (content !== LeftColumnContent.ChatList) {\n autoCloseTimeout = window.setTimeout(() => {\n setIsNewChatButtonShown(false);\n }, BUTTON_CLOSE_DELAY_MS);\n } else if (isMouseInside.current || IS_TOUCH_ENV) {\n setIsNewChatButtonShown(true);\n }\n\n return () => {\n if (autoCloseTimeout) {\n clearTimeout(autoCloseTimeout);\n autoCloseTimeout = undefined;\n }\n };\n }, [content]);\n\n const [shouldRenderUpdateButton, updateButtonClassNames, handleUpdateClick] = useAppOutdatedCheck();\n\n const lang = useLang();\n\n return (\n \n \n \n {() => }\n \n \n {(isActive) => {\n switch (content) {\n case LeftColumnContent.ChatList:\n return ;\n case LeftColumnContent.GlobalSearch:\n return (\n \n );\n case LeftColumnContent.Contacts:\n return ;\n default:\n return undefined;\n }\n }}\n \n {shouldRenderUpdateButton && (\n \n {lang('lng_update_telegram')}\n \n )}\n \n
\n );\n};\n\nfunction useAppOutdatedCheck() {\n const [isAppOutdated, markIsAppOutdated] = useFlag(false);\n\n useEffect(() => {\n const timeout = window.setTimeout(markIsAppOutdated, APP_OUTDATED_TIMEOUT);\n\n return () => {\n clearTimeout(timeout);\n };\n }, [markIsAppOutdated]);\n\n const { shouldRender, transitionClassNames } = useShowTransition(isAppOutdated);\n\n const handleUpdateClick = () => {\n window.location.reload();\n };\n\n return [shouldRender, transitionClassNames, handleUpdateClick] as const;\n}\n\nexport default withGlobal(\n (global): StateProps => pick(global, ['connectionState']),\n)(LeftMain);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport { OwnProps } from './Settings';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\nimport Loading from '../../ui/Loading';\n\nconst SettingsAsync: FC = (props) => {\n const Settings = useModuleLoader(Bundles.Extra, 'Settings');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return Settings ? : ;\n};\n\nexport default memo(SettingsAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport { OwnProps } from './NewChat';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\nimport Loading from '../../ui/Loading';\n\nconst NewChatAsync: FC = (props) => {\n const NewChat = useModuleLoader(Bundles.Extra, 'NewChat');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return NewChat ? : ;\n};\n\nexport default memo(NewChatAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './ArchivedChats';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst ArchivedChatsAsync: FC = (props) => {\n const ArchivedChats = useModuleLoader(Bundles.Extra, 'ArchivedChats');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ArchivedChats ? : ;\n};\n\nexport default memo(ArchivedChatsAsync);\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { LeftColumnContent, SettingsScreens } from '../../types';\n\nimport { LAYERS_ANIMATION_NAME } from '../../util/environment';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport { pick } from '../../util/iteratees';\nimport useFoldersReducer from '../../hooks/reducers/useFoldersReducer';\n\nimport Transition from '../ui/Transition';\nimport LeftMain from './main/LeftMain';\nimport Settings from './settings/Settings.async';\nimport NewChat from './newChat/NewChat.async';\nimport ArchivedChats from './ArchivedChats.async';\n\nimport './LeftColumn.scss';\n\ntype StateProps = {\n searchQuery?: string;\n searchDate?: number;\n activeChatFolder: number;\n shouldSkipHistoryAnimations?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nenum ContentType {\n Main,\n // eslint-disable-next-line @typescript-eslint/no-shadow\n Settings,\n Archived,\n // eslint-disable-next-line no-shadow\n NewGroup,\n // eslint-disable-next-line no-shadow\n NewChannel,\n}\n\nconst RENDER_COUNT = Object.keys(ContentType).length / 2;\nconst RESET_TRANSITION_DELAY_MS = 250;\n\nconst LeftColumn: FC = ({\n searchQuery,\n searchDate,\n activeChatFolder,\n shouldSkipHistoryAnimations,\n setGlobalSearchQuery,\n setGlobalSearchChatId,\n resetChatCreation,\n setGlobalSearchDate,\n loadPasswordInfo,\n clearTwoFaError,\n}) => {\n const [content, setContent] = useState(LeftColumnContent.ChatList);\n const [settingsScreen, setSettingsScreen] = useState(SettingsScreens.Main);\n const [contactsFilter, setContactsFilter] = useState('');\n const [foldersState, foldersDispatch] = useFoldersReducer();\n\n // Used to reset child components in background.\n const [lastResetTime, setLastResetTime] = useState(0);\n\n let contentType: ContentType = ContentType.Main;\n switch (content) {\n case LeftColumnContent.Archived:\n contentType = ContentType.Archived;\n break;\n case LeftColumnContent.Settings:\n contentType = ContentType.Settings;\n break;\n case LeftColumnContent.NewChannelStep1:\n case LeftColumnContent.NewChannelStep2:\n contentType = ContentType.NewChannel;\n break;\n case LeftColumnContent.NewGroupStep1:\n case LeftColumnContent.NewGroupStep2:\n contentType = ContentType.NewGroup;\n break;\n }\n\n const handleReset = useCallback((forceReturnToChatList?: boolean) => {\n if (content === LeftColumnContent.NewGroupStep2\n && !forceReturnToChatList\n ) {\n setContent(LeftColumnContent.NewGroupStep1);\n return;\n }\n\n if (content === LeftColumnContent.NewChannelStep2\n && !forceReturnToChatList\n ) {\n setContent(LeftColumnContent.NewChannelStep1);\n return;\n }\n\n if (content === LeftColumnContent.NewGroupStep1) {\n const pickerSearchInput = document.getElementById('new-group-picker-search');\n if (pickerSearchInput) {\n pickerSearchInput.blur();\n }\n }\n\n if (content === LeftColumnContent.Settings) {\n switch (settingsScreen) {\n case SettingsScreens.EditProfile:\n case SettingsScreens.Folders:\n case SettingsScreens.General:\n case SettingsScreens.Notifications:\n case SettingsScreens.Privacy:\n case SettingsScreens.Language:\n setSettingsScreen(SettingsScreens.Main);\n return;\n\n case SettingsScreens.GeneralChatBackground:\n setSettingsScreen(SettingsScreens.General);\n return;\n case SettingsScreens.GeneralChatBackgroundColor:\n setSettingsScreen(SettingsScreens.GeneralChatBackground);\n return;\n\n case SettingsScreens.PrivacyPhoneNumber:\n case SettingsScreens.PrivacyLastSeen:\n case SettingsScreens.PrivacyProfilePhoto:\n case SettingsScreens.PrivacyForwarding:\n case SettingsScreens.PrivacyGroupChats:\n case SettingsScreens.PrivacyActiveSessions:\n case SettingsScreens.PrivacyBlockedUsers:\n case SettingsScreens.TwoFaDisabled:\n case SettingsScreens.TwoFaEnabled:\n case SettingsScreens.TwoFaCongratulations:\n setSettingsScreen(SettingsScreens.Privacy);\n return;\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyPhoneNumber);\n return;\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyLastSeen);\n return;\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyProfilePhoto);\n return;\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyForwarding);\n return;\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyGroupChats);\n return;\n case SettingsScreens.TwoFaNewPassword:\n setSettingsScreen(SettingsScreens.TwoFaDisabled);\n return;\n case SettingsScreens.TwoFaNewPasswordConfirm:\n setSettingsScreen(SettingsScreens.TwoFaNewPassword);\n return;\n case SettingsScreens.TwoFaNewPasswordHint:\n setSettingsScreen(SettingsScreens.TwoFaNewPasswordConfirm);\n return;\n case SettingsScreens.TwoFaNewPasswordEmail:\n setSettingsScreen(SettingsScreens.TwoFaNewPasswordHint);\n return;\n case SettingsScreens.TwoFaNewPasswordEmailCode:\n setSettingsScreen(SettingsScreens.TwoFaNewPasswordEmail);\n return;\n case SettingsScreens.TwoFaChangePasswordCurrent:\n case SettingsScreens.TwoFaTurnOff:\n case SettingsScreens.TwoFaRecoveryEmailCurrentPassword:\n setSettingsScreen(SettingsScreens.TwoFaEnabled);\n return;\n case SettingsScreens.TwoFaChangePasswordNew:\n setSettingsScreen(SettingsScreens.TwoFaChangePasswordCurrent);\n return;\n case SettingsScreens.TwoFaChangePasswordConfirm:\n setSettingsScreen(SettingsScreens.TwoFaChangePasswordNew);\n return;\n case SettingsScreens.TwoFaChangePasswordHint:\n setSettingsScreen(SettingsScreens.TwoFaChangePasswordConfirm);\n return;\n case SettingsScreens.TwoFaRecoveryEmail:\n setSettingsScreen(SettingsScreens.TwoFaRecoveryEmailCurrentPassword);\n return;\n case SettingsScreens.TwoFaRecoveryEmailCode:\n setSettingsScreen(SettingsScreens.TwoFaRecoveryEmail);\n return;\n\n case SettingsScreens.FoldersCreateFolder:\n case SettingsScreens.FoldersEditFolder:\n setSettingsScreen(SettingsScreens.Folders);\n return;\n\n case SettingsScreens.FoldersIncludedChatsFromChatList:\n case SettingsScreens.FoldersExcludedChatsFromChatList:\n setSettingsScreen(SettingsScreens.FoldersEditFolderFromChatList);\n return;\n\n case SettingsScreens.FoldersEditFolderFromChatList:\n setContent(LeftColumnContent.ChatList);\n setSettingsScreen(SettingsScreens.Main);\n return;\n default:\n break;\n }\n }\n\n if (content === LeftColumnContent.ChatList && activeChatFolder === 0) {\n setContent(LeftColumnContent.GlobalSearch);\n return;\n }\n\n setContent(LeftColumnContent.ChatList);\n setContactsFilter('');\n setGlobalSearchQuery({ query: '' });\n setGlobalSearchDate({ date: undefined });\n setGlobalSearchChatId({ id: undefined });\n resetChatCreation();\n setTimeout(() => {\n setLastResetTime(Date.now());\n }, RESET_TRANSITION_DELAY_MS);\n }, [\n content, activeChatFolder, settingsScreen, setGlobalSearchQuery, setGlobalSearchDate, setGlobalSearchChatId,\n resetChatCreation,\n ]);\n\n const handleSearchQuery = useCallback((query: string) => {\n if (content === LeftColumnContent.Contacts) {\n setContactsFilter(query);\n return;\n }\n\n setContent(LeftColumnContent.GlobalSearch);\n\n if (query !== searchQuery) {\n setGlobalSearchQuery({ query });\n }\n }, [content, searchQuery, setGlobalSearchQuery]);\n\n useEffect(\n () => (content !== LeftColumnContent.ChatList || activeChatFolder === 0\n ? captureEscKeyListener(() => handleReset())\n : undefined),\n [activeChatFolder, content, handleReset],\n );\n\n useEffect(() => {\n clearTwoFaError();\n\n if (settingsScreen === SettingsScreens.Privacy) {\n loadPasswordInfo();\n }\n }, [clearTwoFaError, loadPasswordInfo, settingsScreen]);\n\n const handleSettingsScreenSelect = (screen: SettingsScreens) => {\n setContent(LeftColumnContent.Settings);\n setSettingsScreen(screen);\n };\n\n return (\n \n {(isActive) => {\n switch (contentType) {\n case ContentType.Archived:\n return (\n \n );\n case ContentType.Settings:\n return (\n \n );\n case ContentType.NewChannel:\n return (\n \n );\n case ContentType.NewGroup:\n return (\n \n );\n default:\n return (\n \n );\n }\n }}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n globalSearch: {\n query,\n date,\n },\n chatFolders: {\n activeChatFolder,\n },\n shouldSkipHistoryAnimations,\n } = global;\n return {\n searchQuery: query, searchDate: date, activeChatFolder, shouldSkipHistoryAnimations,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setGlobalSearchQuery', 'setGlobalSearchChatId', 'resetChatCreation', 'setGlobalSearchDate',\n 'loadPasswordInfo', 'clearTwoFaError',\n ]),\n)(LeftColumn));\n","import { useEffect, useState } from '../lib/teact/teact';\n\nimport { throttle } from '../util/schedulers';\nimport windowSize from '../util/windowSize';\nimport { ApiDimensions } from '../api/types';\n\nconst THROTTLE = 250;\n\nexport default () => {\n const [size, setSize] = useState(windowSize.get());\n\n useEffect(() => {\n const handleResize = throttle(() => {\n setSize(windowSize.get());\n }, THROTTLE, false);\n\n window.addEventListener('resize', handleResize);\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, []);\n\n return size;\n};\n","import {\n MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n MOBILE_SCREEN_MAX_WIDTH,\n} from '../../../config';\n\nconst REM = 16; // px\nconst MAX_TOOLBAR_WIDTH = 32 * REM;\nconst MAX_MESSAGES_LIST_WIDTH = 45.5 * REM;\nconst SIDE_COLUMN_MAX_WIDTH = 26.5 * REM;\nconst MIN_LEFT_COLUMN_WIDTH = 18 * REM;\nconst UNPIN_BUTTON_WIDTH = 16.125 * REM;\n\nexport default function calculateMiddleFooterTransforms(windowWidth: number, canPost?: boolean) {\n const sidePadding = windowWidth <= MOBILE_SCREEN_MAX_WIDTH\n ? REM\n : 2 * REM;\n const messageListWidth = getMessageListWidth(windowWidth);\n const sendButtonWidth = windowWidth <= MOBILE_SCREEN_MAX_WIDTH\n ? 3.375 * REM\n : 4 * REM;\n\n const composerWidth = canPost\n ? messageListWidth - sidePadding - sendButtonWidth\n : messageListWidth - sidePadding;\n const toolbarWidth = windowWidth > MOBILE_SCREEN_MAX_WIDTH\n ? Math.min(messageListWidth - sidePadding, MAX_TOOLBAR_WIDTH)\n : messageListWidth - sidePadding;\n\n const composerHiddenScale = toolbarWidth / composerWidth;\n const toolbarHiddenScale = composerWidth / toolbarWidth;\n const unpinHiddenScale = toolbarWidth / UNPIN_BUTTON_WIDTH;\n const toolbarForUnpinHiddenScale = UNPIN_BUTTON_WIDTH / toolbarWidth;\n\n const composerTranslateX = canPost\n ? (sendButtonWidth / 2) * toolbarHiddenScale\n : 0;\n\n const toolbarTranslateX = canPost\n ? (sendButtonWidth / 2) * -1 * composerHiddenScale\n : 0;\n\n return {\n composerHiddenScale,\n toolbarHiddenScale,\n composerTranslateX,\n toolbarTranslateX,\n unpinHiddenScale,\n toolbarForUnpinHiddenScale,\n };\n}\n\nfunction getMessageListWidth(windowWidth: number) {\n if (windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN) {\n const leftColumnWidth = Math.min(\n Math.max(windowWidth * 0.25, MIN_LEFT_COLUMN_WIDTH),\n SIDE_COLUMN_MAX_WIDTH,\n );\n\n const rightColumnWidth = Math.min(\n windowWidth * 0.25,\n SIDE_COLUMN_MAX_WIDTH,\n );\n\n return Math.min(\n windowWidth - leftColumnWidth - rightColumnWidth,\n MAX_MESSAGES_LIST_WIDTH,\n );\n }\n\n if (windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN) {\n const leftColumnWidth = Math.min(\n Math.max(windowWidth * 0.4, MIN_LEFT_COLUMN_WIDTH),\n SIDE_COLUMN_MAX_WIDTH,\n );\n\n return Math.min(\n windowWidth - leftColumnWidth,\n MAX_MESSAGES_LIST_WIDTH,\n );\n }\n\n if (windowWidth > MAX_MESSAGES_LIST_WIDTH) {\n return MAX_MESSAGES_LIST_WIDTH;\n }\n\n return windowWidth;\n}\n","import { MessageList, MessageListType } from '../global/types';\nimport { MAIN_THREAD_ID } from '../api/types';\n\nexport const createMessageHash = (messageList: MessageList): string => (\n messageList.chatId.toString()\n + (messageList.type !== 'thread' ? `_${messageList.type}`\n : (messageList.threadId !== -1 ? `_${messageList.threadId}` : ''))\n);\n\nexport const parseMessageHash = (value: string): MessageList => {\n const [chatId, typeOrThreadId] = value.split('_');\n const isType = ['thread', 'pinned', 'scheduled'].includes(typeOrThreadId);\n\n return {\n chatId: Number(chatId),\n type: !!typeOrThreadId && isType ? (typeOrThreadId as MessageListType) : 'thread',\n threadId: !!typeOrThreadId && !isType ? Number(typeOrThreadId) : MAIN_THREAD_ID,\n };\n};\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './HeaderMenuContainer';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst HeaderMenuContainerAsync: FC = (props) => {\n const { isOpen } = props;\n const HeaderMenuContainer = useModuleLoader(Bundles.Extra, 'HeaderMenuContainer', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return HeaderMenuContainer ? : undefined;\n};\n\nexport default memo(HeaderMenuContainerAsync);\n","import React, {\n FC,\n memo,\n useRef,\n useCallback,\n useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, MessageListType } from '../../global/types';\nimport { MAIN_THREAD_ID } from '../../api/types';\nimport { IAnchorPosition } from '../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { pick } from '../../util/iteratees';\nimport { isChatChannel, isChatSuperGroup } from '../../modules/helpers';\nimport {\n selectChat,\n selectChatBot,\n selectIsUserBlocked,\n selectIsChatBotNotStarted,\n selectIsChatWithSelf,\n selectIsInSelectMode,\n selectIsRightColumnShown,\n} from '../../modules/selectors';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport HeaderMenuContainer from './HeaderMenuContainer.async';\n\ninterface OwnProps {\n chatId: number;\n threadId: number;\n messageListType: MessageListType;\n}\n\ninterface StateProps {\n noMenu?: boolean;\n isChannel?: boolean;\n isRightColumnShown?: boolean;\n canStartBot?: boolean;\n canRestartBot?: boolean;\n canSubscribe?: boolean;\n canSearch?: boolean;\n canMute?: boolean;\n canLeave?: boolean;\n}\n\ntype DispatchProps = Pick;\n\n// Chrome breaks layout when focusing input during transition\nconst SEARCH_FOCUS_DELAY_MS = 400;\n\nconst HeaderActions: FC = ({\n chatId,\n threadId,\n noMenu,\n isChannel,\n canStartBot,\n canRestartBot,\n canSubscribe,\n canSearch,\n canMute,\n canLeave,\n isRightColumnShown,\n joinChannel,\n sendBotCommand,\n openLocalTextSearch,\n restartBot,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const menuButtonRef = useRef(null);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const [menuPosition, setMenuPosition] = useState(undefined);\n\n const handleHeaderMenuOpen = useCallback(() => {\n setIsMenuOpen(true);\n const rect = menuButtonRef.current!.getBoundingClientRect();\n setMenuPosition({ x: rect.right, y: rect.bottom });\n }, []);\n\n const handleHeaderMenuClose = useCallback(() => {\n setIsMenuOpen(false);\n }, []);\n\n const handleHeaderMenuHide = useCallback(() => {\n setMenuPosition(undefined);\n }, []);\n\n const handleSubscribeClick = useCallback(() => {\n joinChannel({ chatId });\n }, [joinChannel, chatId]);\n\n const handleStartBot = useCallback(() => {\n sendBotCommand({ command: '/start' });\n }, [sendBotCommand]);\n\n const handleRestartBot = useCallback(() => {\n restartBot({ chatId });\n }, [chatId, restartBot]);\n\n const handleSearchClick = useCallback(() => {\n openLocalTextSearch();\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n // iOS requires synchronous focus on user event.\n const searchInput = document.querySelector('#MobileSearch input')!;\n searchInput.focus();\n } else {\n setTimeout(() => {\n const searchInput = document.querySelector('.RightHeader .SearchInput input');\n if (searchInput) {\n searchInput.focus();\n }\n }, SEARCH_FOCUS_DELAY_MS);\n }\n }, [openLocalTextSearch]);\n\n const lang = useLang();\n\n return (\n
\n {!IS_SINGLE_COLUMN_LAYOUT && canSubscribe && (\n \n {lang(isChannel ? 'Subscribe' : 'Join Group')}\n \n )}\n {!IS_SINGLE_COLUMN_LAYOUT && canStartBot && (\n \n {lang('BotStart')}\n \n )}\n {!IS_SINGLE_COLUMN_LAYOUT && canRestartBot && (\n \n {lang('BotRestart')}\n \n )}\n {!IS_SINGLE_COLUMN_LAYOUT && canSearch && (\n \n \n \n )}\n {(IS_SINGLE_COLUMN_LAYOUT || !canSubscribe) && (\n \n \n \n )}\n {menuPosition && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId, messageListType }): StateProps => {\n const chat = selectChat(global, chatId);\n const isChannel = Boolean(chat && isChatChannel(chat));\n\n if (chat?.isRestricted || selectIsInSelectMode(global)) {\n return {\n noMenu: true,\n };\n }\n\n const bot = selectChatBot(global, chatId);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const isMainThread = messageListType === 'thread' && threadId === MAIN_THREAD_ID;\n const isDiscussionThread = messageListType === 'thread' && threadId !== MAIN_THREAD_ID;\n const isRightColumnShown = selectIsRightColumnShown(global);\n\n const canRestartBot = Boolean(bot && selectIsUserBlocked(global, bot.id));\n const canStartBot = !canRestartBot && Boolean(selectIsChatBotNotStarted(global, chatId));\n const canSubscribe = Boolean(\n isMainThread && chat && (isChannel || isChatSuperGroup(chat)) && chat.isNotJoined,\n );\n const canSearch = isMainThread || isDiscussionThread;\n const canMute = isMainThread && !isChatWithSelf && !canSubscribe;\n const canLeave = isMainThread && !canSubscribe;\n\n const noMenu = !(\n (IS_SINGLE_COLUMN_LAYOUT && canSubscribe)\n || (IS_SINGLE_COLUMN_LAYOUT && canSearch)\n || canMute\n || canLeave\n );\n\n return {\n noMenu,\n isChannel,\n isRightColumnShown,\n canStartBot,\n canRestartBot,\n canSubscribe,\n canSearch,\n canMute,\n canLeave,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'joinChannel', 'sendBotCommand', 'openLocalTextSearch', 'restartBot',\n ]),\n)(HeaderActions));\n","import { useLayoutEffect, useState } from '../lib/teact/teact';\n\nimport { ApiMessage } from '../api/types';\n\nimport { DEBUG } from '../config';\nimport { isWebpSupported } from '../util/environment';\nimport { EMPTY_IMAGE_DATA_URI, webpToPngBase64 } from '../util/webpToPng';\nimport { getMessageMediaThumbDataUri } from '../modules/helpers';\n\nexport default function useWebpThumbnail(message?: ApiMessage) {\n const thumbnail = message && getMessageMediaThumbDataUri(message);\n const sticker = message?.content?.sticker;\n const shouldDecodeThumbnail = thumbnail && sticker && !isWebpSupported() && thumbnail.includes('image/webp');\n const [thumbnailDecoded, setThumbnailDecoded] = useState(EMPTY_IMAGE_DATA_URI);\n const messageId = message?.id;\n\n useLayoutEffect(() => {\n if (!shouldDecodeThumbnail) {\n return;\n }\n\n webpToPngBase64(`b64-${messageId}`, thumbnail!)\n .then(setThumbnailDecoded)\n .catch((err) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n });\n }, [messageId, shouldDecodeThumbnail, thumbnail]);\n\n return shouldDecodeThumbnail ? thumbnailDecoded : thumbnail;\n}\n","import React, {\n FC,\n useRef,\n useEffect,\n useMemo,\n memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\ntype OwnProps = {\n count: number;\n index: number;\n};\n\nconst BORDER_MASK_LEVEL = 4;\n\nconst PinnedMessageNavigation: FC = ({\n count, index,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const markupParams = useMemo(() => {\n return calculateMarkup(count, index);\n }, [count, index]);\n\n useEffect(() => {\n if (!containerRef.current) {\n return;\n }\n\n const {\n trackHeight,\n trackTranslateY,\n markHeight,\n markTranslateY,\n clipPathId,\n clipPath,\n } = markupParams;\n\n const firstChild = containerRef.current.firstElementChild;\n if (containerRef?.current) {\n const currentElement = containerRef.current;\n const { style } = currentElement;\n style.height = `${trackHeight}px`;\n style.transform = `translateY(-${trackTranslateY}px)`;\n style.clipPath = `url(\"#${clipPathId}\")`;\n const svg = currentElement.querySelector('svg');\n const div = currentElement.querySelector('div');\n const defs = currentElement.querySelector('defs');\n if (!svg) {\n if (firstChild) {\n firstChild.innerHTML = ` ${clipPath} `;\n }\n }\n if (defs) {\n defs.innerHTML = clipPath;\n }\n if (div) {\n div.style.height = `${markHeight}px`;\n div.style.transform = `translateY(${markTranslateY}px)`;\n }\n }\n }, [markupParams]);\n\n if (count === 1) {\n return (\n
\n \n
\n );\n }\n\n const {\n trackHeight, trackTranslateY, markHeight, markTranslateY, clipPathId,\n } = markupParams;\n\n return (\n
BORDER_MASK_LEVEL && 'pinned-message-border-mask')}>\n \n \n \n
\n
\n );\n};\n\nfunction calculateMarkup(count: number, index: number) {\n const reverseIndex = count - index - 1;\n const barHeight = getBarHeight(count);\n const markHeight = getMarkHeight(count, reverseIndex);\n const trackHeight = getTrackHeight(count, barHeight);\n\n const clipPathId = `clipPath${count}`;\n const clipPath = getClipPath(clipPathId, barHeight, count);\n\n const markTranslateY = getMarkTranslateY(reverseIndex, barHeight, count);\n const trackTranslateY = getTrackTranslateY(reverseIndex, count, barHeight, trackHeight);\n return {\n markHeight,\n clipPath,\n markTranslateY,\n trackTranslateY,\n trackHeight,\n clipPathId,\n };\n}\n\nfunction getBarHeight(count: number): number {\n let barHeight = 8;\n if (count === 1) {\n barHeight = 36;\n } else if (count === 2) {\n barHeight = 17;\n } else if (count === 3) {\n barHeight = 11;\n } else if (count === 4) {\n barHeight = 7.5;\n } else if (count > 3) {\n barHeight = 7.5;\n }\n\n return barHeight;\n}\n\nfunction getMarkHeight(count: number, index: number) {\n let barHeight = 36;\n if (count === 1) {\n barHeight = 36;\n } else if (count === 2) {\n barHeight = 17;\n } else if (count === 3) {\n barHeight = index === 1 ? 12 : 11;\n } else if (count === 4) {\n barHeight = 7.5;\n } else if (count > 3) {\n barHeight = 7.5;\n }\n\n return barHeight;\n}\n\nfunction getTrackHeight(count: number, barHeight: number) {\n return count <= 3 ? 36 : barHeight * count + 2 * (count - 1);\n}\n\nfunction getClipPath(id: string, barHeight: number, count: number) {\n const radius = 1;\n\n let d = '';\n if (count === 3) {\n d = drawRect(0, 0, 2, barHeight, radius)\n + drawRect(0, 12, 2, barHeight + 1, radius)\n + drawRect(0, 25, 2, barHeight, radius);\n } else {\n for (let i = 0; i < count; i++) {\n d += drawRect(0, (barHeight + 2) * i, 2, barHeight, radius);\n }\n }\n\n return (\n `\n \n `\n );\n}\n\nfunction drawRect(x: number, y: number, width: number, height: number, radius: number) {\n return `M${x},${y + radius}a${radius},${radius},0,0,1,\n ${width},0v${height - 2 * radius}a${radius},${radius},0,0,1,${-width},0Z`;\n}\n\nfunction getMarkTranslateY(index: number, barHeight: number, count: number) {\n if (count === 1) {\n return 0;\n } else if (count === 2) {\n return index === 0 ? 0 : barHeight + 2;\n }\n\n if (count === 3) {\n if (index === 0) {\n return 0;\n } else if (index === 1) {\n return 12;\n }\n\n return 25;\n } else {\n return (barHeight + 2) * index;\n }\n}\n\nfunction getTrackTranslateY(index: number, count: number, barHeight: number, trackHeight: number) {\n if (count <= 4) {\n return 0;\n }\n\n if (index <= 1) {\n return 0;\n } else if (index >= count - 2) {\n return trackHeight - 36;\n }\n\n return (barHeight + 4) / 2 + (index - 2) * (barHeight + 2);\n}\n\nexport default memo(PinnedMessageNavigation);\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport { ApiMessage } from '../../api/types';\n\nimport { getPictogramDimensions } from '../common/helpers/mediaDimensions';\nimport { getMessageMediaHash, getMessageSummaryText } from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport useMedia from '../../hooks/useMedia';\nimport useWebpThumbnail from '../../hooks/useWebpThumbnail';\n\nimport ConfirmDialog from '../ui/ConfirmDialog';\nimport Button from '../ui/Button';\nimport RippleEffect from '../ui/RippleEffect';\nimport buildClassName from '../../util/buildClassName';\nimport useFlag from '../../hooks/useFlag';\nimport useLang from '../../hooks/useLang';\n\nimport PinnedMessageNavigation from './PinnedMessageNavigation';\n\ntype OwnProps = {\n message: ApiMessage;\n index: number;\n count: number;\n customTitle?: string;\n className?: string;\n onUnpinMessage?: (id: number) => void;\n onClick?: () => void;\n onAllPinnedClick?: () => void;\n};\n\nconst HeaderPinnedMessage: FC = ({\n message, count, index, customTitle, className, onUnpinMessage, onClick, onAllPinnedClick,\n}) => {\n const lang = useLang();\n const mediaThumbnail = useWebpThumbnail(message);\n const mediaBlobUrl = useMedia(getMessageMediaHash(message, 'pictogram'));\n\n const text = getMessageSummaryText(lang, message, Boolean(mediaThumbnail));\n const [isUnpinDialogOpen, openUnpinDialog, closeUnpinDialog] = useFlag();\n\n const handleUnpinMessage = useCallback(() => {\n closeUnpinDialog();\n\n if (onUnpinMessage) {\n onUnpinMessage(message.id);\n }\n }, [closeUnpinDialog, onUnpinMessage, message.id]);\n\n return (\n
\n {count > 1 && (\n \n \n \n )}\n {onUnpinMessage && (\n \n \n \n )}\n \n
\n \n {mediaThumbnail && renderPictogram(mediaThumbnail, mediaBlobUrl)}\n
\n
\n {customTitle || `${lang('PinnedMessage')} ${index > 0 ? `#${count - index}` : ''}`}\n
\n

{renderText(text)}

\n
\n\n \n
\n
\n );\n};\n\nfunction renderPictogram(thumbDataUri: string, blobUrl?: string) {\n const { width, height } = getPictogramDimensions();\n\n return (\n \"\"\n );\n}\n\nexport default memo(HeaderPinnedMessage);\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport {\n ApiAudio, ApiChat, ApiMessage, ApiUser,\n} from '../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport * as mediaLoader from '../../util/mediaLoader';\nimport {\n getMediaDuration, getMessageAudio, getMessageKey, getMessageMediaHash, getSenderTitle,\n} from '../../modules/helpers';\nimport { selectSender } from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\nimport renderText from '../common/helpers/renderText';\nimport useAudioPlayer from '../../hooks/useAudioPlayer';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport RippleEffect from '../ui/RippleEffect';\nimport Button from '../ui/Button';\n\nimport './AudioPlayer.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n className?: string;\n noUi?: boolean;\n};\n\ntype StateProps = {\n sender?: ApiChat | ApiUser;\n};\n\ntype DispatchProps = Pick;\n\nconst AudioPlayer: FC = ({\n message, className, noUi, sender, focusMessage, closeAudioPlayer,\n}) => {\n const lang = useLang();\n\n const senderName = sender ? getSenderTitle(lang, sender) : undefined;\n const mediaData = mediaLoader.getFromMemory(getMessageMediaHash(message, 'inline')!) as (string | undefined);\n const { playPause, isPlaying } = useAudioPlayer(\n getMessageKey(message), getMediaDuration(message)!, mediaData, undefined, undefined, true,\n );\n\n const handleClick = useCallback(() => {\n focusMessage({ chatId: message.chatId, messageId: message.id });\n }, [focusMessage, message.chatId, message.id]);\n\n const handleClose = useCallback(() => {\n if (isPlaying) {\n playPause();\n }\n closeAudioPlayer();\n }, [closeAudioPlayer, isPlaying, playPause]);\n\n if (noUi) {\n return undefined;\n }\n\n const audio = getMessageAudio(message);\n\n return (\n
\n \n \n \n \n\n
\n {audio ? renderAudio(audio) : renderVoice(lang('AttachAudio'), senderName)}\n \n
\n\n \n \n \n
\n );\n};\n\nfunction renderAudio(audio: ApiAudio) {\n const { title, performer, fileName } = audio;\n\n return (\n <>\n
{renderText(title || fileName)}
\n {performer && (\n
{renderText(performer)}
\n )}\n \n );\n}\n\nfunction renderVoice(subtitle: string, senderName?: string) {\n return (\n <>\n
{senderName && renderText(senderName)}
\n
{subtitle}
\n \n );\n}\n\nexport default withGlobal(\n (global, { message }): StateProps => {\n const sender = selectSender(global, message);\n\n return { sender };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['focusMessage', 'closeAudioPlayer']),\n)(AudioPlayer);\n","import React, {\n FC, useCallback, useMemo, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../lib/teact/teactn';\nimport cycleRestrict from '../../util/cycleRestrict';\n\nimport { GlobalActions, MessageListType } from '../../global/types';\nimport {\n ApiMessage,\n ApiChat,\n ApiUser,\n ApiTypingStatus,\n MAIN_THREAD_ID, ApiUpdateConnectionStateType,\n} from '../../api/types';\n\nimport {\n MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,\n MOBILE_SCREEN_MAX_WIDTH,\n EDITABLE_INPUT_ID,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n SAFE_SCREEN_WIDTH_FOR_CHAT_INFO,\n} from '../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TABLET_COLUMN_LAYOUT } from '../../util/environment';\nimport {\n isChatPrivate,\n getMessageKey,\n getChatTitle,\n getSenderTitle,\n} from '../../modules/helpers';\nimport {\n selectChat,\n selectChatMessage,\n selectAllowedMessageActions,\n selectIsRightColumnShown,\n selectThreadTopMessageId,\n selectThreadInfo,\n selectChatMessages,\n selectPinnedIds,\n selectIsChatWithSelf,\n selectForwardedSender,\n selectScheduledIds,\n selectIsInSelectMode,\n selectIsChatWithBot,\n selectCountNotMutedUnread,\n} from '../../modules/selectors';\nimport useEnsureMessage from '../../hooks/useEnsureMessage';\nimport useWindowSize from '../../hooks/useWindowSize';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\nimport { pick } from '../../util/iteratees';\nimport { formatIntegerCompact } from '../../util/textFormat';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\nimport useBrowserOnline from '../../hooks/useBrowserOnline';\n\nimport PrivateChatInfo from '../common/PrivateChatInfo';\nimport GroupChatInfo from '../common/GroupChatInfo';\nimport Transition from '../ui/Transition';\nimport Button from '../ui/Button';\nimport HeaderActions from './HeaderActions';\nimport HeaderPinnedMessage from './HeaderPinnedMessage';\nimport AudioPlayer from './AudioPlayer';\n\nimport './MiddleHeader.scss';\n\nconst ANIMATION_DURATION = 350;\n\ntype OwnProps = {\n chatId: number;\n threadId: number;\n messageListType: MessageListType;\n isReady?: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n pinnedMessageIds?: number[] | number;\n messagesById?: Record;\n canUnpin?: boolean;\n topMessageSender?: ApiChat | ApiUser;\n typingStatus?: ApiTypingStatus;\n isSelectModeActive?: boolean;\n isLeftColumnShown?: boolean;\n isRightColumnShown?: boolean;\n audioMessage?: ApiMessage;\n chatsById?: Record;\n messagesCount?: number;\n isChatWithSelf?: boolean;\n isChatWithBot?: boolean;\n lastSyncTime?: number;\n shouldSkipHistoryAnimations?: boolean;\n currentTransitionKey: number;\n connectionState?: ApiUpdateConnectionStateType;\n};\n\ntype DispatchProps = Pick;\n\nconst MiddleHeader: FC = ({\n chatId,\n threadId,\n messageListType,\n isReady,\n pinnedMessageIds,\n messagesById,\n canUnpin,\n topMessageSender,\n typingStatus,\n isSelectModeActive,\n isLeftColumnShown,\n isRightColumnShown,\n audioMessage,\n chat,\n chatsById,\n messagesCount,\n isChatWithSelf,\n isChatWithBot,\n lastSyncTime,\n shouldSkipHistoryAnimations,\n currentTransitionKey,\n connectionState,\n openChatWithInfo,\n pinMessage,\n focusMessage,\n openChat,\n openPreviousChat,\n loadPinnedMessages,\n toggleLeftColumn,\n exitMessageSelectMode,\n}) => {\n const lang = useLang();\n\n const [pinnedMessageIndex, setPinnedMessageIndex] = useState(0);\n const pinnedMessageId = Array.isArray(pinnedMessageIds) ? pinnedMessageIds[pinnedMessageIndex] : pinnedMessageIds;\n const pinnedMessage = messagesById && pinnedMessageId ? messagesById[pinnedMessageId] : undefined;\n const pinnedMessagesCount = Array.isArray(pinnedMessageIds) ? pinnedMessageIds.length : (pinnedMessageIds ? 1 : 0);\n const chatTitleLength = chat && getChatTitle(lang, chat).length;\n const topMessageTitle = topMessageSender ? getSenderTitle(lang, topMessageSender) : undefined;\n\n useEffect(() => {\n if (threadId === MAIN_THREAD_ID && lastSyncTime && isReady) {\n loadPinnedMessages({ chatId });\n }\n }, [chatId, loadPinnedMessages, lastSyncTime, threadId, isReady]);\n\n // Reset pinned index when switching chats and pinning/unpinning\n useEffect(() => {\n setPinnedMessageIndex(0);\n }, [pinnedMessageIds]);\n\n useEnsureMessage(chatId, pinnedMessageId, pinnedMessage);\n\n const { width: windowWidth } = useWindowSize();\n\n const isLeftColumnHideable = windowWidth <= MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN;\n const shouldShowCloseButton = IS_TABLET_COLUMN_LAYOUT && isLeftColumnShown;\n\n // eslint-disable-next-line no-null/no-null\n const componentRef = useRef(null);\n const shouldAnimateTools = useRef(true);\n\n const handleHeaderClick = useCallback(() => {\n openChatWithInfo({ id: chatId });\n }, [openChatWithInfo, chatId]);\n\n const handleUnpinMessage = useCallback((messageId: number) => {\n pinMessage({ chatId, messageId, isUnpin: true });\n }, [pinMessage, chatId]);\n\n const handlePinnedMessageClick = useCallback((): void => {\n if (pinnedMessage) {\n focusMessage({ chatId: pinnedMessage.chatId, threadId, messageId: pinnedMessage.id });\n\n const newIndex = cycleRestrict(pinnedMessagesCount, pinnedMessageIndex + 1);\n setPinnedMessageIndex(newIndex);\n }\n }, [pinnedMessage, focusMessage, threadId, pinnedMessagesCount, pinnedMessageIndex]);\n\n const handleAllPinnedClick = useCallback(() => {\n openChat({ id: chatId, threadId: MAIN_THREAD_ID, type: 'pinned' });\n }, [openChat, chatId]);\n\n const handleBackClick = useCallback((e: React.MouseEvent) => {\n if (IS_SINGLE_COLUMN_LAYOUT) {\n const messageInput = document.getElementById(EDITABLE_INPUT_ID);\n if (messageInput) {\n messageInput.blur();\n }\n }\n\n if (isSelectModeActive) {\n exitMessageSelectMode();\n return;\n }\n\n if (threadId === MAIN_THREAD_ID && messageListType === 'thread' && currentTransitionKey === 0) {\n if (IS_SINGLE_COLUMN_LAYOUT || shouldShowCloseButton) {\n e.stopPropagation(); // Stop propagation to prevent chat re-opening on tablets\n openChat({ id: undefined });\n } else {\n toggleLeftColumn();\n }\n\n return;\n }\n\n openPreviousChat();\n }, [\n threadId, messageListType, currentTransitionKey, isSelectModeActive, openPreviousChat, shouldShowCloseButton,\n openChat, toggleLeftColumn, exitMessageSelectMode,\n ]);\n\n const unreadCount = useMemo(() => {\n if (!isLeftColumnHideable || !chatsById) {\n return undefined;\n }\n\n return selectCountNotMutedUnread(getGlobal()) || undefined;\n }, [isLeftColumnHideable, chatsById]);\n\n const canToolsCollideWithChatInfo = (\n windowWidth >= MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN\n && windowWidth < SAFE_SCREEN_WIDTH_FOR_CHAT_INFO\n ) || (\n windowWidth > MOBILE_SCREEN_MAX_WIDTH\n && windowWidth < MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN\n && (!chatTitleLength || chatTitleLength > 30)\n );\n const shouldUseStackedToolsClass = canToolsCollideWithChatInfo || (\n windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n && windowWidth < SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n );\n\n const {\n shouldRender: shouldRenderAudioPlayer,\n transitionClassNames: audioPlayerClassNames,\n } = useShowTransition(Boolean(audioMessage));\n\n const renderingAudioMessage = useCurrentOrPrev(audioMessage);\n\n const {\n shouldRender: shouldRenderPinnedMessage,\n transitionClassNames: pinnedMessageClassNames,\n } = useShowTransition(pinnedMessage && !shouldRenderAudioPlayer);\n\n const renderingPinnedMessage = useCurrentOrPrev(pinnedMessage);\n const renderingPinnedMessageTitle = useCurrentOrPrev(topMessageTitle);\n\n const canRevealTools = (shouldRenderPinnedMessage && renderingPinnedMessage)\n || (shouldRenderAudioPlayer && renderingAudioMessage);\n\n // Logic for transition to and from custom display of AudioPlayer/PinnedMessage on smaller screens\n useEffect(() => {\n const componentEl = componentRef.current;\n if (!componentEl) {\n return;\n }\n\n if (!shouldUseStackedToolsClass || !canRevealTools) {\n componentEl.classList.remove('tools-stacked', 'animated');\n shouldAnimateTools.current = true;\n return;\n }\n\n if (isRightColumnShown || canToolsCollideWithChatInfo) {\n if (shouldAnimateTools.current) {\n componentEl.classList.add('tools-stacked', 'animated');\n shouldAnimateTools.current = false;\n }\n\n // Remove animation class to prevent it messing up the show transitions\n setTimeout(() => {\n componentEl.classList.remove('animated');\n }, ANIMATION_DURATION);\n } else {\n componentEl.classList.remove('tools-stacked');\n shouldAnimateTools.current = true;\n }\n }, [shouldUseStackedToolsClass, canRevealTools, canToolsCollideWithChatInfo, isRightColumnShown]);\n\n const isBrowserOnline = useBrowserOnline();\n const isConnecting = (!isBrowserOnline || connectionState === 'connectionStateConnecting')\n && (IS_SINGLE_COLUMN_LAYOUT || (IS_TABLET_COLUMN_LAYOUT && !shouldShowCloseButton));\n\n function renderInfo() {\n if (isConnecting) {\n return (\n <>\n {renderBackButton()}\n

\n {lang('WaitingForNetwork')}\n

\n \n );\n }\n return (\n messageListType === 'thread' && threadId === MAIN_THREAD_ID ? (\n renderMainThreadInfo()\n ) : messageListType === 'thread' ? (\n <>\n {renderBackButton()}\n

\n {lang('CommentsCount', messagesCount)}\n

\n \n ) : messageListType === 'pinned' ? (\n <>\n {renderBackButton()}\n

\n {lang('PinnedMessagesCount', messagesCount)}\n

\n \n ) : messageListType === 'scheduled' ? (\n <>\n {renderBackButton()}\n

\n {isChatWithSelf ? lang('Reminders') : lang('messages', messagesCount, 'i')}\n

\n \n ) : undefined\n );\n }\n\n function renderMainThreadInfo() {\n return (\n <>\n {(isLeftColumnHideable || currentTransitionKey > 0) && renderBackButton(shouldShowCloseButton, true)}\n
\n {isChatPrivate(chatId) ? (\n \n ) : (\n \n )}\n
\n \n );\n }\n\n function renderBackButton(asClose = false, withUnreadCount = false) {\n return (\n
\n \n
\n \n {withUnreadCount && unreadCount && (\n
\n {formatIntegerCompact(unreadCount)}\n
\n )}\n
\n );\n }\n\n return (\n
\n \n {renderInfo}\n \n\n
\n {shouldRenderPinnedMessage && renderingPinnedMessage && !shouldRenderAudioPlayer && (\n \n )}\n {shouldRenderAudioPlayer && renderingAudioMessage && (\n \n )}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId, messageListType }): StateProps => {\n const { isLeftColumnShown, lastSyncTime, shouldSkipHistoryAnimations } = global;\n const { byId: chatsById } = global.chats;\n const chat = selectChat(global, chatId);\n\n const { typingStatus } = chat || {};\n\n const { chatId: audioChatId, messageId: audioMessageId } = global.audioPlayer;\n const audioMessage = audioChatId && audioMessageId\n ? selectChatMessage(global, audioChatId, audioMessageId)\n : undefined;\n\n let messagesCount: number | undefined;\n if (messageListType === 'pinned') {\n const pinnedIds = selectPinnedIds(global, chatId);\n messagesCount = pinnedIds?.length;\n } else if (messageListType === 'scheduled') {\n const scheduledIds = selectScheduledIds(global, chatId);\n messagesCount = scheduledIds?.length;\n } else if (messageListType === 'thread' && threadId !== MAIN_THREAD_ID) {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (threadInfo) {\n messagesCount = threadInfo.messagesCount;\n }\n }\n\n const state: StateProps = {\n typingStatus,\n isLeftColumnShown,\n isRightColumnShown: selectIsRightColumnShown(global),\n isSelectModeActive: selectIsInSelectMode(global),\n audioMessage,\n chat,\n chatsById,\n messagesCount,\n isChatWithSelf: selectIsChatWithSelf(global, chatId),\n isChatWithBot: chat && selectIsChatWithBot(global, chat),\n lastSyncTime,\n shouldSkipHistoryAnimations,\n currentTransitionKey: Math.max(0, global.messages.messageLists.length - 1),\n connectionState: global.connectionState,\n };\n\n const messagesById = selectChatMessages(global, chatId);\n if (messageListType !== 'thread' || !messagesById) {\n return state;\n }\n\n Object.assign(state, { messagesById });\n\n if (threadId !== MAIN_THREAD_ID) {\n const pinnedMessageId = selectThreadTopMessageId(global, chatId, threadId);\n const message = pinnedMessageId ? selectChatMessage(global, chatId, pinnedMessageId) : undefined;\n const topMessageSender = message ? selectForwardedSender(global, message) : undefined;\n\n return {\n ...state,\n pinnedMessageIds: pinnedMessageId,\n canUnpin: false,\n topMessageSender,\n };\n }\n\n const pinnedMessageIds = selectPinnedIds(global, chatId);\n if (pinnedMessageIds?.length) {\n const firstPinnedMessage = messagesById[pinnedMessageIds[0]];\n const {\n canUnpin,\n } = (firstPinnedMessage && selectAllowedMessageActions(global, firstPinnedMessage, threadId)) || {};\n\n return {\n ...state,\n pinnedMessageIds,\n canUnpin,\n };\n }\n\n return state;\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChatWithInfo',\n 'pinMessage',\n 'focusMessage',\n 'openChat',\n 'openPreviousChat',\n 'loadPinnedMessages',\n 'toggleLeftColumn',\n 'exitMessageSelectMode',\n ]),\n)(MiddleHeader));\n","import { ApiMessage } from '../../../api/types';\nimport { IAlbum } from '../../../types';\n\nimport { getDayStart } from '../../../util/dateFormat';\nimport { isActionMessage } from '../../../modules/helpers';\n\ntype SenderGroup = (ApiMessage | IAlbum)[];\n\nconst GROUP_INTERVAL_SECONDS = 600; // 10 minutes\n\nexport type MessageDateGroup = {\n originalDate: number;\n datetime: number;\n senderGroups: SenderGroup[];\n};\n\nexport function isAlbum(messageOrAlbum: ApiMessage | IAlbum): messageOrAlbum is IAlbum {\n return 'albumId' in messageOrAlbum;\n}\n\nexport function groupMessages(messages: ApiMessage[], firstUnreadId?: number) {\n let currentSenderGroup: SenderGroup = [];\n let currentDateGroup = {\n originalDate: messages[0].date,\n datetime: Number(getDayStart(messages[0].date * 1000)),\n senderGroups: [currentSenderGroup],\n };\n let currentAlbum: IAlbum | undefined;\n\n const dateGroups: MessageDateGroup[] = [currentDateGroup];\n\n messages.forEach((message, index) => {\n if (message.isInAlbum) {\n if (!currentAlbum) {\n currentAlbum = {\n albumId: message.groupedId!,\n messages: [message],\n mainMessage: message,\n };\n } else {\n currentAlbum.messages.push(message);\n if (message.content.text) {\n currentAlbum.mainMessage = message;\n }\n }\n } else {\n currentSenderGroup.push(message);\n }\n\n const nextMessage = messages[index + 1];\n\n if (\n currentAlbum\n && (!nextMessage || !nextMessage.groupedId || nextMessage.groupedId !== currentAlbum.albumId)\n ) {\n currentSenderGroup.push(currentAlbum);\n currentAlbum = undefined;\n }\n if (nextMessage) {\n const nextMessageDayStartsAt = Number(getDayStart(nextMessage.date * 1000));\n if (currentDateGroup.datetime !== nextMessageDayStartsAt) {\n currentDateGroup = {\n originalDate: nextMessage.date,\n datetime: nextMessageDayStartsAt,\n senderGroups: [],\n };\n dateGroups.push(currentDateGroup);\n\n currentSenderGroup = [];\n currentDateGroup.senderGroups.push(currentSenderGroup);\n } else if (\n nextMessage.id === firstUnreadId\n || message.senderId !== nextMessage.senderId\n || message.isOutgoing !== nextMessage.isOutgoing\n || isActionMessage(message)\n || isActionMessage(nextMessage)\n || (\n message.forwardInfo && nextMessage.forwardInfo\n && (\n message.forwardInfo.senderUserId !== nextMessage.forwardInfo.senderUserId\n || message.forwardInfo.fromChatId !== nextMessage.forwardInfo.fromChatId\n || message.forwardInfo.hiddenUserName !== nextMessage.forwardInfo.hiddenUserName\n )\n )\n || message.inlineButtons\n || nextMessage.inlineButtons\n || (nextMessage.date - message.date) > GROUP_INTERVAL_SECONDS\n ) {\n currentSenderGroup = [];\n currentDateGroup.senderGroups.push(currentSenderGroup);\n }\n }\n });\n\n return dateGroups;\n}\n","import { RefObject } from 'react';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { MessageListType } from '../../../global/types';\n\nimport { IS_ANDROID, IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useBackgroundMode from '../../../hooks/useBackgroundMode';\n\nconst INTERSECTION_THROTTLE_FOR_MEDIA = IS_ANDROID ? 1000 : 350;\nconst INTERSECTION_MARGIN_FOR_MEDIA = IS_SINGLE_COLUMN_LAYOUT ? 300 : 500;\nconst INTERSECTION_THROTTLE_FOR_READING = 150;\n\nexport default function useMessageObservers(\n type: MessageListType,\n containerRef: RefObject,\n memoFirstUnreadIdRef: { current: number | undefined },\n) {\n const { markMessageListRead, markMessagesRead } = getDispatch();\n\n const {\n observe: observeIntersectionForMedia,\n } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE_FOR_MEDIA,\n margin: INTERSECTION_MARGIN_FOR_MEDIA,\n });\n\n const {\n observe: observeIntersectionForReading, freeze: freezeForReading, unfreeze: unfreezeForReading,\n } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE_FOR_READING,\n }, (entries) => {\n if (type !== 'thread') {\n return;\n }\n\n let maxId = 0;\n const mentionIds: number[] = [];\n\n entries.forEach((entry) => {\n const { isIntersecting, target } = entry;\n\n if (!isIntersecting) {\n return;\n }\n\n const { dataset } = target as HTMLDivElement;\n\n const messageId = Number(dataset.lastMessageId || dataset.messageId);\n if (messageId > maxId) {\n maxId = messageId;\n }\n\n if (dataset.hasUnreadMention) {\n mentionIds.push(messageId);\n }\n });\n\n if (memoFirstUnreadIdRef.current && maxId >= memoFirstUnreadIdRef.current) {\n markMessageListRead({ maxId });\n }\n\n if (mentionIds.length) {\n markMessagesRead({ messageIds: mentionIds });\n }\n });\n\n useBackgroundMode(freezeForReading, unfreezeForReading);\n\n const { observe: observeIntersectionForAnimatedStickers } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE_FOR_MEDIA,\n });\n\n return {\n observeIntersectionForMedia,\n observeIntersectionForReading,\n observeIntersectionForAnimatedStickers,\n };\n}\n","import { ApiMessage } from '../../../../api/types';\n\nimport { getMessageContent } from '../../../../modules/helpers';\n\nexport function isEmojiOnlyMessage(customShape?: boolean | number) {\n return typeof customShape === 'number';\n}\n\nexport function buildContentClassName(\n message: ApiMessage,\n {\n hasReply,\n customShape,\n isLastInGroup,\n asForwarded,\n hasThread,\n forceSenderName,\n hasComments,\n hasActionButton,\n }: {\n hasReply?: boolean;\n customShape?: boolean | number;\n isLastInGroup?: boolean;\n asForwarded?: boolean;\n hasThread?: boolean;\n forceSenderName?: boolean;\n hasComments?: boolean;\n hasActionButton?: boolean;\n } = {},\n) {\n const {\n text, photo, video, audio, voice, document, poll, webPage, contact,\n } = getMessageContent(message);\n\n const classNames = ['message-content'];\n const isMedia = photo || video;\n const isMediaWithNoText = isMedia && !text;\n const isViaBot = Boolean(message.viaBotId);\n\n if (isEmojiOnlyMessage(customShape)) {\n classNames.push(`emoji-only emoji-only-${customShape}`);\n } else if (text) {\n classNames.push('text');\n }\n\n if (hasActionButton) {\n classNames.push('has-action-button');\n }\n\n if (customShape) {\n classNames.push('custom-shape');\n if (video?.isRound) {\n classNames.push('round');\n }\n\n if (hasComments) {\n classNames.push('has-comments');\n }\n }\n if (photo || video) {\n classNames.push('media');\n } else if (audio) {\n classNames.push('audio');\n } else if (voice) {\n classNames.push('voice');\n } else if (document) {\n classNames.push('document');\n } else if (contact) {\n classNames.push('contact');\n } else if (poll) {\n classNames.push('poll');\n } else if (webPage) {\n classNames.push('web-page');\n\n if (webPage.photo || webPage.video) {\n classNames.push('media');\n }\n }\n\n if (asForwarded && !customShape) {\n classNames.push('is-forwarded');\n }\n\n if (hasReply) {\n classNames.push('is-reply');\n }\n\n if (hasThread) {\n classNames.push('has-replies');\n }\n\n if (isViaBot) {\n classNames.push('is-via-bot');\n }\n\n if (forceSenderName) {\n classNames.push('force-sender-name');\n }\n\n if (!customShape) {\n classNames.push('has-shadow');\n\n if (isMedia && hasComments) {\n classNames.push('has-background');\n }\n\n if (hasReply || asForwarded || !isMediaWithNoText || isViaBot || forceSenderName) {\n classNames.push('has-solid-background');\n }\n\n if (isLastInGroup && (photo || !isMediaWithNoText)) {\n classNames.push('has-appendix');\n }\n }\n\n return classNames.join(' ');\n}\n","import { ApiMessage } from '../../../../api/types';\nimport { calculateInlineImageDimensions, calculateVideoDimensions } from '../../../common/helpers/mediaDimensions';\nimport {\n getMessageText,\n getMessagePhoto,\n getMessageWebPagePhoto,\n isForwardedMessage,\n isOwnMessage,\n getMessageVideo,\n} from '../../../../modules/helpers';\n\nconst MIN_MEDIA_WIDTH = 100;\nconst MIN_MEDIA_WIDTH_WITH_COMMENTS = 238;\nconst MIN_MEDIA_WIDTH_WITH_TEXT = 175;\nconst MIN_MEDIA_WIDTH_WITH_TEXT_AND_COMMENTS = 238;\nconst MIN_MEDIA_HEIGHT = 90;\nconst SMALL_IMAGE_THRESHOLD = 12;\n\nexport function getMinMediaWidth(hasText?: boolean, hasCommentButton?: boolean) {\n return hasText\n ? (hasCommentButton ? MIN_MEDIA_WIDTH_WITH_TEXT_AND_COMMENTS : MIN_MEDIA_WIDTH_WITH_TEXT)\n : (hasCommentButton ? MIN_MEDIA_WIDTH_WITH_COMMENTS : MIN_MEDIA_WIDTH);\n}\n\nexport function calculateMediaDimensions(message: ApiMessage, noAvatars?: boolean) {\n const isOwn = isOwnMessage(message);\n const isForwarded = isForwardedMessage(message);\n const photo = getMessagePhoto(message) || getMessageWebPagePhoto(message);\n const video = getMessageVideo(message);\n\n const isWebPagePhoto = Boolean(getMessageWebPagePhoto(message));\n const { width, height } = photo\n ? calculateInlineImageDimensions(photo, isOwn, isForwarded, isWebPagePhoto, noAvatars)\n : calculateVideoDimensions(video!, isOwn, isForwarded, noAvatars);\n\n const hasText = Boolean(getMessageText(message));\n const minMediaWidth = getMinMediaWidth(hasText);\n\n let stretchFactor = 1;\n if (width < minMediaWidth && minMediaWidth - width < SMALL_IMAGE_THRESHOLD) {\n stretchFactor = minMediaWidth / width;\n }\n if (height * stretchFactor < MIN_MEDIA_HEIGHT && MIN_MEDIA_HEIGHT - height * stretchFactor < SMALL_IMAGE_THRESHOLD) {\n stretchFactor = MIN_MEDIA_HEIGHT / height;\n }\n\n const finalWidth = Math.round(width * stretchFactor);\n const finalHeight = Math.round(height * stretchFactor);\n\n return {\n width: finalWidth,\n height: finalHeight,\n isSmall: finalWidth < minMediaWidth || finalHeight < MIN_MEDIA_HEIGHT,\n };\n}\n","/* eslint-disable no-bitwise */\n// Based on\n// https://github.com/telegramdesktop/tdesktop/blob/dev/Telegram/SourceFiles/ui/grouped_layout.cpp\n// https://github.com/overtake/TelegramSwift/blob/master/Telegram-Mac/GroupedLayout.swift#L83\n\nimport { IAlbum } from '../../../../types';\nimport { ApiMessage, ApiDimensions } from '../../../../api/types';\n\nimport { getAvailableWidth, REM } from '../../../common/helpers/mediaDimensions';\nimport { calculateMediaDimensions } from './mediaDimensions';\n\nexport const AlbumRectPart = {\n None: 0,\n Top: 1,\n Right: 2,\n Bottom: 4,\n Left: 8,\n};\n\ntype IAttempt = {\n lineCounts: number[];\n heights: number[];\n};\nexport type IMediaDimensions = {\n width: number;\n height: number;\n x: number;\n y: number;\n};\ntype IMediaLayout = {\n dimensions: IMediaDimensions;\n sides: number;\n};\ntype ILayoutParams = {\n ratios: number[];\n proportions: string;\n averageRatio: number;\n maxWidth: number;\n minWidth: number;\n maxHeight: number;\n spacing: number;\n};\nexport type IAlbumLayout = {\n layout: IMediaLayout[];\n containerStyle: ApiDimensions;\n};\n\nfunction getRatios(messages: ApiMessage[]) {\n return messages.map(\n (message) => {\n const dimensions = calculateMediaDimensions(message) as ApiDimensions;\n\n return dimensions.width / dimensions.height;\n },\n );\n}\n\nfunction getProportions(ratios: number[]) {\n return ratios.map((ratio) => (ratio > 1.2 ? 'w' : (ratio < 0.8 ? 'n' : 'q'))).join('');\n}\n\nfunction getAverageRatio(ratios: number[]) {\n return ratios.reduce((result, ratio) => ratio + result, 1) / ratios.length;\n}\n\nfunction accumulate(list: number[], initValue: number) {\n return list.reduce((accumulator, item) => accumulator + item, initValue);\n}\n\nfunction clamp(num: number, low: number, high: number) {\n return num < low ? low : (num > high ? high : num);\n}\n\nfunction cropRatios(ratios: number[], averageRatio: number) {\n return ratios.map((ratio) => (averageRatio > 1.1 ? clamp(ratio, 1, 2.75) : clamp(ratio, 0.6667, 1)));\n}\n\nfunction calculateContainerSize(layout: IMediaLayout[]) {\n const styles: ApiDimensions = { width: 0, height: 0 };\n layout.forEach(({\n dimensions,\n sides,\n }) => {\n if (sides & AlbumRectPart.Right) {\n styles.width = dimensions.width + dimensions.x;\n }\n if (sides & AlbumRectPart.Bottom) {\n styles.height = dimensions.height + dimensions.y;\n }\n });\n\n return styles;\n}\n\nexport function calculateAlbumLayout(\n isOwn: boolean,\n isForwarded: boolean,\n noAvatars: boolean,\n album: IAlbum,\n): IAlbumLayout {\n const spacing = 2;\n const ratios = getRatios(album.messages);\n const proportions = getProportions(ratios);\n const averageRatio = getAverageRatio(ratios);\n const albumCount = ratios.length;\n const forceCalc = ratios.some((ratio) => ratio > 2);\n const maxWidth = getAvailableWidth(isOwn, isForwarded, false, noAvatars) - (isForwarded ? 2.5 : 0) * REM;\n const maxHeight = maxWidth;\n\n let layout;\n\n const params = {\n ratios,\n proportions,\n averageRatio,\n maxWidth,\n minWidth: 100,\n maxHeight,\n spacing,\n };\n\n if (albumCount >= 5 || forceCalc) {\n layout = layoutWithComplexLayouter(params);\n } else if (albumCount === 2) {\n layout = layoutTwo(params);\n } else if (albumCount === 3) {\n layout = layoutThree(params);\n } else {\n layout = layoutFour(params);\n }\n\n return {\n layout,\n containerStyle: calculateContainerSize(layout),\n };\n}\n\nfunction layoutWithComplexLayouter({\n ratios: originalRatios,\n averageRatio,\n maxWidth,\n minWidth,\n spacing,\n maxHeight = (4 * maxWidth) / 3,\n}: ILayoutParams) {\n const ratios = cropRatios(originalRatios, averageRatio);\n const count = originalRatios.length;\n const result = new Array(count);\n const attempts: IAttempt[] = [];\n\n const multiHeight = (offset: number, attemptCount: number) => {\n const attemptRatios = ratios.slice(offset, offset + attemptCount);\n const sum = accumulate(attemptRatios, 0);\n\n return (maxWidth - (attemptCount - 1) * spacing) / sum;\n };\n\n const pushAttempt = (lineCounts: number[]) => {\n const heights: number[] = [];\n let offset = 0;\n lineCounts.forEach((currentCount) => {\n heights.push(multiHeight(offset, currentCount));\n offset += currentCount;\n });\n\n attempts.push({\n lineCounts,\n heights,\n });\n };\n\n for (let first = 1; first !== count; ++first) {\n const second = count - first;\n if (first <= 3 && second <= 3) {\n pushAttempt([first, second]);\n }\n }\n\n for (let first = 1; first !== count - 1; ++first) {\n for (let second = 1; second !== count - first; ++second) {\n const third = count - first - second;\n if (first <= 3 && second <= (averageRatio < 0.85 ? 4 : 3) && third <= 3) {\n pushAttempt([first, second, third]);\n }\n }\n }\n\n for (let first = 1; first !== count - 1; ++first) {\n for (let second = 1; second !== count - first; ++second) {\n for (let third = 1; third !== count - first - second; ++third) {\n const fourth = count - first - second - third;\n if (first <= 3 && second <= 3 && third <= 3 && fourth <= 4) {\n pushAttempt([first, second, third, fourth]);\n }\n }\n }\n }\n\n let optimalAttempt: IAttempt | undefined;\n let optimalDiff = 0;\n for (let i = 0; i < attempts.length; i++) {\n const {\n heights,\n lineCounts,\n } = attempts[i];\n const lineCount = lineCounts.length;\n const totalHeight = accumulate(heights, 0) + spacing * (lineCount - 1);\n const minLineHeight = Math.min(...heights);\n const bad1 = minLineHeight < minWidth ? 1.5 : 1;\n const bad2 = (() => {\n for (let line = 1; line !== lineCount; ++line) {\n if (lineCounts[line - 1] > lineCounts[line]) {\n return 1.5;\n }\n }\n\n return 1;\n })();\n const diff = Math.abs(totalHeight - maxHeight) * bad1 * bad2;\n\n if (!optimalAttempt || diff < optimalDiff) {\n optimalAttempt = attempts[i];\n optimalDiff = diff;\n }\n }\n\n const optimalCounts = optimalAttempt!.lineCounts;\n const optimalHeights = optimalAttempt!.heights;\n const rowCount = optimalCounts.length;\n let index = 0;\n let y = 0;\n for (let row = 0; row !== rowCount; ++row) {\n const colCount = optimalCounts[row];\n const lineHeight = optimalHeights[row];\n const height = Math.round(lineHeight);\n let x = 0;\n\n for (let col = 0; col !== colCount; ++col) {\n const sides = AlbumRectPart.None\n | (row === 0 ? AlbumRectPart.Top : AlbumRectPart.None)\n | (row === rowCount - 1 ? AlbumRectPart.Bottom : AlbumRectPart.None)\n | (col === 0 ? AlbumRectPart.Left : AlbumRectPart.None)\n | (col === colCount - 1 ? AlbumRectPart.Right : AlbumRectPart.None);\n const ratio = ratios[index];\n const width = col === colCount - 1 ? maxWidth - x : Math.round(ratio * lineHeight);\n result[index] = {\n dimensions: {\n x,\n y,\n width,\n height,\n },\n sides,\n };\n x += width + spacing;\n ++index;\n }\n y += height + spacing;\n }\n\n return result;\n}\n\nfunction layoutTwo(params: ILayoutParams) {\n const {\n ratios,\n proportions,\n averageRatio,\n } = params;\n return proportions === 'ww' && averageRatio > 1.4 && ratios[1] - ratios[0] < 0.2\n ? layoutTwoTopBottom(params)\n : proportions === 'ww' || proportions === 'qq'\n ? layoutTwoLeftRightEqual(params)\n : layoutTwoLeftRight(params);\n}\n\nfunction layoutTwoTopBottom(params: ILayoutParams) {\n const {\n ratios,\n maxWidth,\n spacing,\n maxHeight,\n } = params;\n const height = Math.round(Math.min(maxWidth / ratios[0], Math.min(maxWidth / ratios[1], (maxHeight - spacing) / 2)));\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: maxWidth,\n height,\n },\n sides: AlbumRectPart.Left | AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: 0,\n y: height + spacing,\n width: maxWidth,\n height,\n },\n sides: AlbumRectPart.Left | AlbumRectPart.Bottom | AlbumRectPart.Right,\n }];\n}\n\nfunction layoutTwoLeftRightEqual(params: ILayoutParams) {\n const {\n ratios,\n maxWidth,\n spacing,\n maxHeight,\n } = params;\n const width = (maxWidth - spacing) / 2;\n const height = Math.round(Math.min(width / ratios[0], Math.min(width / ratios[1], maxHeight)));\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width,\n height,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Left | AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: width + spacing,\n y: 0,\n width,\n height,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Right | AlbumRectPart.Bottom,\n }];\n}\n\nfunction layoutTwoLeftRight(params: ILayoutParams) {\n const {\n ratios,\n minWidth,\n maxWidth,\n spacing,\n maxHeight,\n } = params;\n const minimalWidth = Math.round(1.5 * minWidth);\n const secondWidth = Math.min(\n Math.round(\n Math.max(\n 0.4 * (maxWidth - spacing),\n (maxWidth - spacing) / ratios[0] / (1 / ratios[0] + 1 / ratios[1]),\n ),\n ),\n maxWidth - spacing - minimalWidth,\n );\n const firstWidth = maxWidth - secondWidth - spacing;\n const height = Math.min(maxHeight, Math.round(Math.min(firstWidth / ratios[0], secondWidth / ratios[1])));\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: firstWidth,\n height,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Left | AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: firstWidth + spacing,\n y: 0,\n width: secondWidth,\n height,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Right | AlbumRectPart.Bottom,\n }];\n}\n\nfunction layoutThree(params: ILayoutParams) {\n const { proportions } = params;\n\n return proportions[0] === 'n'\n ? layoutThreeLeftAndOther(params)\n : layoutThreeTopAndOther(params);\n}\n\nfunction layoutThreeLeftAndOther(params: ILayoutParams) {\n const {\n maxHeight,\n spacing,\n ratios,\n maxWidth,\n minWidth,\n } = params;\n const firstHeight = maxHeight;\n const thirdHeight = Math.round(\n Math.min(\n (maxHeight - spacing) / 2,\n (ratios[1] * (maxWidth - spacing)) / (ratios[2] + ratios[1]),\n ),\n );\n const secondHeight = firstHeight - thirdHeight - spacing;\n const rightWidth = Math.max(\n minWidth,\n Math.round(\n Math.min(\n (maxWidth - spacing) / 2,\n Math.min(\n thirdHeight * ratios[2],\n secondHeight * ratios[1],\n ),\n ),\n ),\n );\n const leftWidth = Math.min(Math.round(firstHeight * ratios[0]), maxWidth - spacing - rightWidth);\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: leftWidth,\n height: firstHeight,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Left | AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: leftWidth + spacing,\n y: 0,\n width: rightWidth,\n height: secondHeight,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: leftWidth + spacing,\n y: secondHeight + spacing,\n width: rightWidth,\n height: thirdHeight,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Right,\n }];\n}\n\nfunction layoutThreeTopAndOther(params: ILayoutParams) {\n const {\n maxWidth,\n ratios,\n maxHeight,\n spacing,\n } = params;\n const firstWidth = maxWidth;\n const firstHeight = Math.round(Math.min(firstWidth / ratios[0], 0.66 * (maxHeight - spacing)));\n const secondWidth = (maxWidth - spacing) / 2;\n const secondHeight = Math.min(\n maxHeight - firstHeight - spacing,\n Math.round(Math.min(\n secondWidth / ratios[1],\n secondWidth / ratios[2],\n )),\n );\n const thirdWidth = firstWidth - secondWidth - spacing;\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: firstWidth,\n height: firstHeight,\n },\n sides: AlbumRectPart.Left | AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: 0,\n y: firstHeight + spacing,\n width: secondWidth,\n height: secondHeight,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Left,\n }, {\n dimensions: {\n x: secondWidth + spacing,\n y: firstHeight + spacing,\n width: thirdWidth,\n height: secondHeight,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Right,\n }];\n}\n\nfunction layoutFour(params: ILayoutParams) {\n const { proportions } = params;\n\n return proportions[0] === 'w'\n ? layoutFourTopAndOther(params)\n : layoutFourLeftAndOther(params);\n}\n\nfunction layoutFourTopAndOther({\n maxWidth,\n ratios,\n spacing,\n maxHeight,\n minWidth,\n}: ILayoutParams) {\n const w = maxWidth;\n const h0 = Math.round(Math.min(w / ratios[0], 0.66 * (maxHeight - spacing)));\n const h = Math.round((maxWidth - 2 * spacing) / (ratios[1] + ratios[2] + ratios[3]));\n const w0 = Math.max(minWidth, Math.round(Math.min(0.4 * (maxWidth - 2 * spacing), h * ratios[1])));\n const w2 = Math.round(Math.max(Math.max(minWidth, 0.33 * (maxWidth - 2 * spacing)), h * ratios[3]));\n const w1 = w - w0 - w2 - 2 * spacing;\n const h1 = Math.min(maxHeight - h0 - spacing, h);\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: w,\n height: h0,\n },\n sides: AlbumRectPart.Left | AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: 0,\n y: h0 + spacing,\n width: w0,\n height: h1,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Left,\n }, {\n dimensions: {\n x: w0 + spacing,\n y: h0 + spacing,\n width: w1,\n height: h1,\n },\n sides: AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: w0 + spacing + w1 + spacing,\n y: h0 + spacing,\n width: w2,\n height: h1,\n },\n sides: AlbumRectPart.Right | AlbumRectPart.Bottom,\n }];\n}\n\nfunction layoutFourLeftAndOther({\n maxHeight,\n ratios,\n maxWidth,\n spacing,\n minWidth,\n}: ILayoutParams) {\n const h = maxHeight;\n const w0 = Math.round(Math.min(h * ratios[0], 0.6 * (maxWidth - spacing)));\n const w = Math.round((maxHeight - 2 * spacing) / (1 / ratios[1] + 1 / ratios[2] + 1 / ratios[3]));\n const h0 = Math.round(w / ratios[1]);\n const h1 = Math.round(w / ratios[2]);\n const h2 = h - h0 - h1 - 2 * spacing;\n const w1 = Math.max(minWidth, Math.min(maxWidth - w0 - spacing, w));\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: w0,\n height: h,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Left | AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: w0 + spacing,\n y: 0,\n width: w1,\n height: h0,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: w0 + spacing,\n y: h0 + spacing,\n width: w1,\n height: h1,\n },\n sides: AlbumRectPart.Right,\n }, {\n dimensions: {\n x: w0 + spacing,\n y: h0 + h1 + 2 * spacing,\n width: w1,\n height: h2,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Right,\n }];\n}\n","import { IS_IOS } from '../../../../util/environment';\n\nlet element: HTMLSpanElement | undefined;\n\nexport default function calculateAuthorWidth(text: string) {\n if (!element) {\n element = document.createElement('span');\n // eslint-disable-next-line max-len\n element.style.font = IS_IOS\n // eslint-disable-next-line max-len\n ? '400 12px system-ui, -apple-system, BlinkMacSystemFont, \"Roboto\", \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif'\n : '400 12px \"Roboto\", -apple-system, \"Apple Color Emoji\", BlinkMacSystemFont, \"Helvetica Neue\", sans-serif';\n element.style.whiteSpace = 'nowrap';\n element.style.position = 'absolute';\n element.style.left = '-999px';\n element.style.opacity = '.01';\n document.body.appendChild(element);\n }\n\n element.innerHTML = text;\n\n return element.offsetWidth;\n}\n","import { FocusDirection } from '../../../../types';\n\nimport { useLayoutEffect } from '../../../../lib/teact/teact';\nimport fastSmoothScroll from '../../../../util/fastSmoothScroll';\n\n// This is used when the viewport was replaced.\nconst RELOCATED_FOCUS_OFFSET = 1000;\nconst FOCUS_MARGIN = 20;\n\nexport default function useFocusMessage(\n elementRef: { current: HTMLDivElement | null },\n chatId: number,\n isFocused?: boolean,\n focusDirection?: FocusDirection,\n noFocusHighlight?: boolean,\n isResizingContainer?: boolean,\n) {\n useLayoutEffect(() => {\n if (isFocused && elementRef.current) {\n const messagesContainer = elementRef.current.closest('.MessageList')!;\n\n fastSmoothScroll(\n messagesContainer,\n elementRef.current,\n // `noFocusHighlight` always called from “scroll-to-bottom” buttons\n noFocusHighlight ? 'end' : 'centerOrTop',\n FOCUS_MARGIN,\n focusDirection !== undefined ? RELOCATED_FOCUS_OFFSET : undefined,\n focusDirection,\n undefined,\n isResizingContainer,\n );\n }\n }, [elementRef, chatId, isFocused, focusDirection, noFocusHighlight, isResizingContainer]);\n}\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './ContextMenuContainer';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst ContextMenuContainerAsync: FC = (props) => {\n const { isOpen } = props;\n const ContextMenuContainer = useModuleLoader(Bundles.Extra, 'ContextMenuContainer', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ContextMenuContainer ? : undefined;\n};\n\nexport default memo(ContextMenuContainerAsync);\n","import React, {\n FC, memo, useEffect, useMemo, useRef,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiMessage, ApiChat } from '../../api/types';\nimport { FocusDirection } from '../../types';\n\nimport {\n selectUser,\n selectChatMessage,\n selectIsMessageFocused,\n selectChat,\n} from '../../modules/selectors';\nimport { isChatChannel } from '../../modules/helpers';\nimport buildClassName from '../../util/buildClassName';\nimport renderText from '../common/helpers/renderText';\nimport { renderActionMessageText } from '../common/helpers/renderActionMessageText';\nimport useEnsureMessage from '../../hooks/useEnsureMessage';\nimport useContextMenuHandlers from '../../hooks/useContextMenuHandlers';\nimport { ObserveFn, useOnIntersect } from '../../hooks/useIntersectionObserver';\nimport useFocusMessage from './message/hooks/useFocusMessage';\nimport useLang from '../../hooks/useLang';\n\nimport ContextMenuContainer from './message/ContextMenuContainer.async';\nimport useFlag from '../../hooks/useFlag';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport { preventMessageInputBlur } from './helpers/preventMessageInputBlur';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection?: ObserveFn;\n isEmbedded?: boolean;\n appearanceOrder?: number;\n isLastInList?: boolean;\n};\n\ntype StateProps = {\n usersById: Record;\n sender?: ApiUser | ApiChat;\n targetUserIds?: number[];\n targetMessage?: ApiMessage;\n targetChatId?: number;\n isFocused: boolean;\n focusDirection?: FocusDirection;\n noFocusHighlight?: boolean;\n};\n\nconst APPEARANCE_DELAY = 10;\n\nconst ActionMessage: FC = ({\n message,\n observeIntersection,\n isEmbedded,\n appearanceOrder = 0,\n isLastInList,\n usersById,\n sender,\n targetUserIds,\n targetMessage,\n targetChatId,\n isFocused,\n focusDirection,\n noFocusHighlight,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n useOnIntersect(ref, observeIntersection);\n useEnsureMessage(message.chatId, message.replyToMessageId, targetMessage);\n useFocusMessage(ref, message.chatId, isFocused, focusDirection, noFocusHighlight);\n\n const lang = useLang();\n\n const noAppearanceAnimation = appearanceOrder <= 0;\n const [isShown, markShown] = useFlag(noAppearanceAnimation);\n useEffect(() => {\n if (noAppearanceAnimation) {\n return;\n }\n\n setTimeout(markShown, appearanceOrder * APPEARANCE_DELAY);\n }, [appearanceOrder, markShown, noAppearanceAnimation]);\n const { transitionClassNames } = useShowTransition(isShown, undefined, noAppearanceAnimation, false);\n\n const targetUsers = useMemo(() => {\n return targetUserIds\n ? targetUserIds.map((userId) => usersById?.[userId]).filter(Boolean as any)\n : undefined;\n }, [targetUserIds, usersById]);\n\n const content = renderActionMessageText(\n lang,\n message,\n sender,\n targetUsers,\n targetMessage,\n targetChatId,\n isEmbedded ? { isEmbedded: true, asPlain: true } : undefined,\n );\n const {\n isContextMenuOpen, contextMenuPosition,\n handleBeforeContextMenu, handleContextMenu,\n handleContextMenuClose, handleContextMenuHide,\n } = useContextMenuHandlers(ref);\n const isContextMenuShown = contextMenuPosition !== undefined;\n\n const handleMouseDown = (e: React.MouseEvent) => {\n preventMessageInputBlur(e);\n handleBeforeContextMenu(e);\n };\n\n if (isEmbedded) {\n return {renderText(content as string)};\n }\n\n const className = buildClassName(\n 'ActionMessage message-list-item',\n isFocused && !noFocusHighlight && 'focused',\n isContextMenuShown && 'has-menu-open',\n isLastInList && 'last-in-list',\n transitionClassNames,\n );\n\n return (\n \n {content}\n {contextMenuPosition && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { message }): StateProps => {\n const { byId: usersById } = global.users;\n const userId = message.senderId;\n const { targetUserIds, targetChatId } = message.content.action || {};\n const targetMessageId = message.replyToMessageId;\n const targetMessage = targetMessageId\n ? selectChatMessage(global, message.chatId, targetMessageId)\n : undefined;\n\n const isFocused = selectIsMessageFocused(global, message);\n const { direction: focusDirection, noHighlight: noFocusHighlight } = (isFocused && global.focusedMessage) || {};\n\n const chat = selectChat(global, message.chatId);\n const sender = chat && (isChatChannel(chat) || userId === message.chatId)\n ? chat\n : userId ? selectUser(global, userId) : undefined;\n\n return {\n usersById,\n sender,\n targetChatId,\n targetUserIds,\n targetMessage,\n isFocused,\n ...(isFocused && { focusDirection, noFocusHighlight }),\n };\n },\n)(ActionMessage));\n","import React, { FC, useRef } from '../../lib/teact/teact';\n\nimport { ApiUser, ApiMessage, ApiChat } from '../../api/types';\n\nimport {\n getMessageMediaHash,\n isActionMessage,\n getMessageSummaryText,\n getSenderTitle,\n getMessageRoundVideo,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { getPictogramDimensions } from './helpers/mediaDimensions';\nimport buildClassName from '../../util/buildClassName';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport useMedia from '../../hooks/useMedia';\nimport useWebpThumbnail from '../../hooks/useWebpThumbnail';\nimport useLang from '../../hooks/useLang';\n\nimport ActionMessage from '../middle/ActionMessage';\n\nimport './EmbeddedMessage.scss';\n\ntype OwnProps = {\n observeIntersection?: ObserveFn;\n className?: string;\n message?: ApiMessage;\n sender?: ApiUser | ApiChat;\n title?: string;\n customText?: string;\n onClick: NoneToVoidFunction;\n};\n\nconst NBSP = '\\u00A0';\n\nconst EmbeddedMessage: FC = ({\n className,\n message,\n sender,\n title,\n customText,\n observeIntersection,\n onClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const mediaBlobUrl = useMedia(message && getMessageMediaHash(message, 'pictogram'), !isIntersecting);\n const pictogramId = message && `sticker-reply-thumb${message.id}`;\n const mediaThumbnail = useWebpThumbnail(message);\n const isRoundVideo = Boolean(message && getMessageRoundVideo(message));\n\n const lang = useLang();\n\n const senderTitle = sender && getSenderTitle(lang, sender);\n\n return (\n \n {mediaThumbnail && renderPictogram(pictogramId, mediaThumbnail, mediaBlobUrl, isRoundVideo)}\n
\n

\n {!message ? (\n customText || NBSP\n ) : isActionMessage(message) ? (\n \n ) : (\n renderText(getMessageSummaryText(lang, message, Boolean(mediaThumbnail)))\n )}\n

\n
{renderText(senderTitle || title || NBSP)}
\n
\n
\n );\n};\n\nfunction renderPictogram(\n id: string | undefined,\n thumbDataUri: string,\n blobUrl?: string,\n isRoundVideo?: boolean,\n) {\n const { width, height } = getPictogramDimensions();\n\n return (\n \n );\n}\n\nexport default EmbeddedMessage;\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { ApiMessage, ApiMessageOutgoingStatus } from '../../../api/types';\n\nimport { formatTime } from '../../../util/dateFormat';\nimport { formatIntegerCompact } from '../../../util/textFormat';\n\nimport MessageOutgoingStatus from '../../common/MessageOutgoingStatus';\nimport renderText from '../../common/helpers/renderText';\nimport useLang from '../../../hooks/useLang';\n\nimport './MessageMeta.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n outgoingStatus?: ApiMessageOutgoingStatus;\n signature?: string;\n onClick: (e: React.MouseEvent) => void;\n};\n\nconst MessageMeta: FC = ({\n message, outgoingStatus, signature, onClick,\n}) => {\n const lang = useLang();\n\n return (\n \n {Boolean(message.views) && (\n <>\n \n {formatIntegerCompact(message.views!)}\n \n \n \n )}\n {signature && (\n {renderText(signature)}\n )}\n \n {message.isEdited && `${lang('EditedMessage')} `}\n {formatTime(message.date * 1000)}\n \n {outgoingStatus && (\n \n )}\n \n );\n};\n\nexport default memo(MessageMeta);\n","import React, { FC, useRef } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\n\nimport { MEMOJI_STICKER_ID } from '../../../config';\nimport { getStickerDimensions } from '../../common/helpers/mediaDimensions';\nimport { getMessageMediaFormat, getMessageMediaHash } from '../../../modules/helpers';\nimport useMedia from '../../../hooks/useMedia';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport buildClassName from '../../../util/buildClassName';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useFlag from '../../../hooks/useFlag';\nimport useWebpThumbnail from '../../../hooks/useWebpThumbnail';\n\nimport AnimatedSticker from '../../common/AnimatedSticker';\nimport StickerSetModal from '../../common/StickerSetModal.async';\n\nimport './Sticker.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection: ObserveFn;\n observeIntersectionForPlaying: ObserveFn;\n shouldLoop?: boolean;\n lastSyncTime?: number;\n};\n\nconst Sticker: FC = ({\n message, observeIntersection, observeIntersectionForPlaying, shouldLoop, lastSyncTime,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const [isModalOpen, openModal, closeModal] = useFlag();\n\n const sticker = message.content.sticker!;\n const { isAnimated, stickerSetId } = sticker;\n const isMemojiSticker = stickerSetId === MEMOJI_STICKER_ID;\n\n const shouldLoad = useIsIntersecting(ref, observeIntersection);\n const shouldPlay = useIsIntersecting(ref, observeIntersectionForPlaying);\n\n const mediaHash = sticker.isPreloadedGlobally ? `sticker${sticker.id}` : getMessageMediaHash(message, 'inline')!;\n const thumbDataUri = useWebpThumbnail(message);\n const mediaData = useMedia(\n mediaHash,\n !shouldLoad,\n getMessageMediaFormat(message, 'inline', true),\n lastSyncTime,\n );\n\n const isMediaLoaded = Boolean(mediaData);\n const [isAnimationLoaded, markAnimationLoaded] = useFlag(isMediaLoaded);\n const isMediaReady = isAnimated ? isAnimationLoaded : isMediaLoaded;\n const { shouldRenderFullMedia, transitionClassNames } = useTransitionForMedia(isMediaReady, 'slow');\n\n const { width, height } = getStickerDimensions(sticker);\n const thumbClassName = buildClassName('thumbnail', !thumbDataUri && 'empty');\n\n const stickerClassName = buildClassName(\n 'Sticker media-inner',\n isMemojiSticker && 'inactive',\n );\n\n return (\n
\n {!isMediaReady && (\n \n )}\n {!isAnimated && shouldRenderFullMedia && (\n \n )}\n {isAnimated && isMediaLoaded && (\n \n )}\n \n
\n );\n};\n\nexport default Sticker;\n","import { ApiMessage } from '../../../../api/types';\n\nimport { IS_CANVAS_FILTER_SUPPORTED, IS_SINGLE_COLUMN_LAYOUT } from '../../../../util/environment';\nimport { getMessageMediaThumbDataUri } from '../../../../modules/helpers';\nimport useCanvasBlur from '../../../../hooks/useCanvasBlur';\n\nexport default function useBlurredMediaThumbRef(message: ApiMessage, fullMediaData?: string) {\n return useCanvasBlur(\n getMessageMediaThumbDataUri(message),\n Boolean(fullMediaData),\n IS_SINGLE_COLUMN_LAYOUT && !IS_CANVAS_FILTER_SUPPORTED,\n );\n}\n","const SELECTED_APPENDIX_BACKGROUND = Promise.resolve('rgba(255,255,255,1)');\n\nexport default function getCustomAppendixBg(src: string, isOwn: boolean, inSelectMode?: boolean, isSelected?: boolean) {\n return isSelected ? SELECTED_APPENDIX_BACKGROUND : getAppendixColorFromImage(src, isOwn);\n}\n\nasync function getAppendixColorFromImage(src: string, isOwn: boolean) {\n const img = new Image();\n img.src = src;\n\n if (!img.width) {\n await new Promise((resolve) => {\n img.onload = resolve;\n });\n }\n\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d')!;\n\n canvas.width = img.width;\n canvas.height = img.height;\n\n ctx.drawImage(img, 0, 0, img.width, img.height);\n\n const x = isOwn ? img.width - 1 : 0;\n const y = img.height - 1;\n\n const pixel = Array.from(ctx.getImageData(x, y, 1, 1).data);\n return `rgba(${pixel.join(',')})`;\n}\n","import React, {\n FC, useCallback, useLayoutEffect, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\nimport { IMediaDimensions } from './helpers/calculateAlbumLayout';\n\nimport {\n getMessagePhoto,\n getMessageWebPagePhoto,\n getMessageMediaHash,\n getMediaTransferState,\n isOwnMessage,\n} from '../../../modules/helpers';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMediaWithDownloadProgress from '../../../hooks/useMediaWithDownloadProgress';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useBlurredMediaThumbRef from './hooks/useBlurredMediaThumbRef';\nimport usePrevious from '../../../hooks/usePrevious';\nimport buildClassName from '../../../util/buildClassName';\nimport getCustomAppendixBg from './helpers/getCustomAppendixBg';\nimport { calculateMediaDimensions } from './helpers/mediaDimensions';\n\nimport ProgressSpinner from '../../ui/ProgressSpinner';\n\nexport type OwnProps = {\n id?: string;\n message: ApiMessage;\n observeIntersection?: ObserveFn;\n noAvatars?: boolean;\n shouldAutoLoad?: boolean;\n isInSelectMode?: boolean;\n isSelected?: boolean;\n uploadProgress?: number;\n size?: 'inline' | 'pictogram';\n shouldAffectAppendix?: boolean;\n dimensions?: IMediaDimensions & { isSmall?: boolean };\n nonInteractive?: boolean;\n onClick?: (id: number) => void;\n onCancelUpload?: (message: ApiMessage) => void;\n};\n\nconst CUSTOM_APPENDIX_ATTRIBUTE = 'data-has-custom-appendix';\n\nconst Photo: FC = ({\n id,\n message,\n observeIntersection,\n noAvatars,\n shouldAutoLoad,\n isInSelectMode,\n isSelected,\n uploadProgress,\n size = 'inline',\n dimensions,\n nonInteractive,\n shouldAffectAppendix,\n onClick,\n onCancelUpload,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const photo = (getMessagePhoto(message) || getMessageWebPagePhoto(message))!;\n const localBlobUrl = photo.blobUrl;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const [isDownloadAllowed, setIsDownloadAllowed] = useState(shouldAutoLoad);\n const shouldDownload = isDownloadAllowed && isIntersecting;\n const {\n mediaData, downloadProgress,\n } = useMediaWithDownloadProgress(getMessageMediaHash(message, size), !shouldDownload);\n const fullMediaData = localBlobUrl || mediaData;\n const thumbRef = useBlurredMediaThumbRef(message, fullMediaData);\n\n const {\n isUploading, isTransferring, transferProgress,\n } = getMediaTransferState(message, uploadProgress || downloadProgress, shouldDownload && !fullMediaData);\n const wasDownloadDisabled = usePrevious(isDownloadAllowed) === false;\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring, undefined, wasDownloadDisabled, 'slow');\n const {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(fullMediaData, 'slow');\n\n const handleClick = useCallback(() => {\n if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload(message);\n }\n } else if (!fullMediaData) {\n setIsDownloadAllowed((isAllowed) => !isAllowed);\n } else if (onClick) {\n onClick(message.id);\n }\n }, [fullMediaData, isUploading, message, onCancelUpload, onClick]);\n\n const isOwn = isOwnMessage(message);\n useLayoutEffect(() => {\n if (!shouldAffectAppendix) {\n return;\n }\n\n const contentEl = ref.current!.closest('.message-content')!;\n\n if (fullMediaData) {\n getCustomAppendixBg(fullMediaData, isOwn, isInSelectMode, isSelected).then((appendixBg) => {\n contentEl.style.setProperty('--appendix-bg', appendixBg);\n contentEl.setAttribute(CUSTOM_APPENDIX_ATTRIBUTE, '');\n });\n } else {\n contentEl.classList.add('has-appendix-thumb');\n }\n }, [fullMediaData, isOwn, shouldAffectAppendix, isInSelectMode, isSelected]);\n\n const { width, height, isSmall } = dimensions || calculateMediaDimensions(message, noAvatars);\n\n const className = buildClassName(\n 'media-inner',\n !isUploading && !nonInteractive && 'interactive',\n isSmall && 'small-image',\n width === height && 'square-image',\n );\n\n const style = dimensions\n ? `width: ${width}px; height: ${height}px; left: ${dimensions.x}px; top: ${dimensions.y}px;`\n : '';\n\n return (\n \n {shouldRenderThumb && (\n \n )}\n {shouldRenderFullMedia && (\n \n )}\n {shouldRenderSpinner && (\n
\n \n
\n )}\n {!fullMediaData && !isDownloadAllowed && (\n \n )}\n {isTransferring && (\n {Math.round(transferProgress * 100)}%\n )}\n \n );\n};\n\nexport default Photo;\n","import { RefObject } from 'react';\nimport { useCallback, useRef } from '../lib/teact/teact';\n\nimport useHeavyAnimationCheck from './useHeavyAnimationCheck';\nimport safePlay from '../util/safePlay';\n\nexport default function useHeavyAnimationCheckForVideo(playerRef: RefObject, shouldPlay: boolean) {\n const shouldPlayRef = useRef();\n shouldPlayRef.current = shouldPlay;\n\n const pause = useCallback(() => {\n if (playerRef.current) {\n playerRef.current.pause();\n }\n }, [playerRef]);\n\n const play = useCallback(() => {\n if (playerRef.current && shouldPlayRef.current) {\n safePlay(playerRef.current);\n }\n }, [playerRef]);\n\n useHeavyAnimationCheck(pause, play);\n}\n","import { useCallback, useRef } from '../../../../lib/teact/teact';\nimport { fastRaf } from '../../../../util/schedulers';\nimport useBackgroundMode from '../../../../hooks/useBackgroundMode';\nimport safePlay from '../../../../util/safePlay';\n\nexport default (playerRef: { current: HTMLVideoElement | null }, isPlayAllowed = false) => {\n const wasPlaying = useRef(false);\n const isFrozen = useRef(false);\n\n const freezePlaying = useCallback(() => {\n isFrozen.current = true;\n\n if (!isPlayAllowed || !playerRef.current) {\n return;\n }\n\n if (!wasPlaying.current) {\n wasPlaying.current = !playerRef.current.paused;\n }\n\n playerRef.current.pause();\n }, [isPlayAllowed, playerRef]);\n\n const unfreezePlaying = useCallback(() => {\n // At this point HTMLVideoElement can be unmounted from the DOM\n if (isPlayAllowed && playerRef.current && wasPlaying.current && document.body.contains(playerRef.current)) {\n safePlay(playerRef.current);\n }\n\n wasPlaying.current = false;\n isFrozen.current = false;\n }, [isPlayAllowed, playerRef]);\n\n const unfreezePlayingOnRaf = useCallback(() => {\n fastRaf(unfreezePlaying);\n }, [unfreezePlaying]);\n\n if (!document.hasFocus()) {\n freezePlaying();\n }\n\n useBackgroundMode(freezePlaying, unfreezePlayingOnRaf);\n};\n","import React, {\n FC, useCallback, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\nimport { IMediaDimensions } from './helpers/calculateAlbumLayout';\n\nimport { formatMediaDuration } from '../../../util/dateFormat';\nimport buildClassName from '../../../util/buildClassName';\nimport { calculateVideoDimensions } from '../../common/helpers/mediaDimensions';\nimport {\n getMediaTransferState,\n getMessageMediaFormat,\n getMessageMediaHash,\n getMessageVideo,\n getMessageWebPageVideo,\n isForwardedMessage,\n isOwnMessage,\n} from '../../../modules/helpers';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMediaWithDownloadProgress from '../../../hooks/useMediaWithDownloadProgress';\nimport useMedia from '../../../hooks/useMedia';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useBuffering from '../../../hooks/useBuffering';\nimport useHeavyAnimationCheckForVideo from '../../../hooks/useHeavyAnimationCheckForVideo';\nimport useVideoCleanup from '../../../hooks/useVideoCleanup';\nimport usePauseOnInactive from './hooks/usePauseOnInactive';\nimport useBlurredMediaThumbRef from './hooks/useBlurredMediaThumbRef';\n\nimport ProgressSpinner from '../../ui/ProgressSpinner';\n\nexport type OwnProps = {\n id?: string;\n message: ApiMessage;\n observeIntersection: ObserveFn;\n noAvatars?: boolean;\n shouldAutoLoad?: boolean;\n shouldAutoPlay?: boolean;\n uploadProgress?: number;\n dimensions?: IMediaDimensions;\n lastSyncTime?: number;\n onClick?: (id: number) => void;\n onCancelUpload?: (message: ApiMessage) => void;\n};\n\nconst Video: FC = ({\n id,\n message,\n observeIntersection,\n noAvatars,\n shouldAutoLoad,\n shouldAutoPlay,\n uploadProgress,\n lastSyncTime,\n dimensions,\n onClick,\n onCancelUpload,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const videoRef = useRef(null);\n\n const video = (getMessageVideo(message) || getMessageWebPageVideo(message))!;\n const localBlobUrl = video.blobUrl;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const [isDownloadAllowed, setIsDownloadAllowed] = useState(shouldAutoLoad);\n const shouldDownload = Boolean(isDownloadAllowed && isIntersecting && lastSyncTime);\n const [isPlayAllowed, setIsPlayAllowed] = useState(shouldAutoPlay);\n\n const previewBlobUrl = useMedia(\n getMessageMediaHash(message, 'pictogram'),\n !(isIntersecting && lastSyncTime),\n getMessageMediaFormat(message, 'pictogram'),\n lastSyncTime,\n );\n const { mediaData, downloadProgress } = useMediaWithDownloadProgress(\n getMessageMediaHash(message, 'inline'),\n !shouldDownload,\n getMessageMediaFormat(message, 'inline'),\n lastSyncTime,\n );\n const fullMediaData = localBlobUrl || mediaData;\n const isInline = Boolean(isIntersecting && fullMediaData);\n // Thumbnail is always rendered so we can only disable blur if we have preview\n const thumbRef = useBlurredMediaThumbRef(message, previewBlobUrl);\n\n const { isBuffered, bufferingHandlers } = useBuffering(!shouldAutoLoad);\n const { isUploading, isTransferring, transferProgress } = getMediaTransferState(\n message,\n uploadProgress || downloadProgress,\n shouldDownload && !isBuffered,\n );\n const wasDownloadDisabled = usePrevious(isDownloadAllowed) === false;\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring, undefined, wasDownloadDisabled);\n const { transitionClassNames } = useTransitionForMedia(fullMediaData, 'slow');\n\n const [playProgress, setPlayProgress] = useState(0);\n const handleTimeUpdate = useCallback((e: React.SyntheticEvent) => {\n setPlayProgress(Math.max(0, e.currentTarget.currentTime - 1));\n }, []);\n\n const duration = (videoRef.current?.duration) || video.duration || 0;\n\n const isOwn = isOwnMessage(message);\n const isForwarded = isForwardedMessage(message);\n const { width, height } = dimensions || calculateVideoDimensions(video, isOwn, isForwarded, noAvatars);\n\n useHeavyAnimationCheckForVideo(videoRef, Boolean(isInline && shouldAutoPlay));\n usePauseOnInactive(videoRef, isPlayAllowed);\n useVideoCleanup(videoRef, [isInline]);\n\n const handleClick = useCallback(() => {\n if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload(message);\n }\n } else if (!fullMediaData) {\n setIsDownloadAllowed((isAllowed) => !isAllowed);\n } else if (fullMediaData && !isPlayAllowed) {\n setIsPlayAllowed(true);\n videoRef.current!.play();\n } else if (onClick) {\n onClick(message.id);\n }\n }, [isUploading, fullMediaData, isPlayAllowed, onClick, onCancelUpload, message]);\n\n const className = buildClassName('media-inner dark', !isUploading && 'interactive');\n const videoClassName = buildClassName('full-media', transitionClassNames);\n\n const style = dimensions\n ? `width: ${width}px; height: ${height}px; left: ${dimensions.x}px; top: ${dimensions.y}px;`\n : '';\n\n return (\n \n {!previewBlobUrl && (\n \n )}\n {previewBlobUrl && (\n \n )}\n {isInline && (\n \n \n \n )}\n {(isDownloadAllowed && !isPlayAllowed && !shouldRenderSpinner) && (\n \n )}\n {shouldRenderSpinner && (\n
\n \n
\n )}\n {!isDownloadAllowed && (\n \n )}\n {isTransferring ? (\n ...\n ) : (\n
\n {video.isGif ? 'GIF' : formatMediaDuration(Math.max(duration - playProgress, 0))}\n
\n )}\n \n );\n};\n\nexport default Video;\n","import React, { FC, useCallback } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiUser, ApiContact } from '../../../api/types';\n\nimport { selectUser } from '../../../modules/selectors';\nimport { formatPhoneNumberWithCode } from '../../../util/phoneNumber';\n\nimport Avatar from '../../common/Avatar';\n\nimport './Contact.scss';\nimport { pick } from '../../../util/iteratees';\nimport buildClassName from '../../../util/buildClassName';\n\ntype OwnProps = {\n contact: ApiContact;\n};\n\ntype StateProps = {\n user?: ApiUser;\n};\n\ntype DispatchProps = Pick;\n\nconst Contact: FC = ({\n contact, user, openUserInfo,\n}) => {\n const {\n firstName,\n lastName,\n phoneNumber,\n userId,\n } = contact;\n\n const handleClick = useCallback(() => {\n openUserInfo({ id: userId });\n }, [openUserInfo, userId]);\n\n return (\n \n \n
\n
{firstName} {lastName}
\n
{formatPhoneNumberWithCode(phoneNumber)}
\n
\n \n );\n};\n\nexport default withGlobal(\n (global, { contact }): StateProps => {\n return {\n user: selectUser(global, contact.userId),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openUserInfo',\n ]),\n)(Contact);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useCallback, memo, useState,\n} from '../../lib/teact/teact';\n\nimport Checkbox from './Checkbox';\n\ntype IRadioOption = {\n label: string;\n subLabel?: string;\n value: string;\n};\n\ntype OwnProps = {\n id?: string;\n options: IRadioOption[];\n selected?: string[];\n disabled?: boolean;\n round?: boolean;\n loadingOptions?: string[];\n onChange: (value: string[]) => void;\n};\n\nconst CheckboxGroup: FC = ({\n id,\n options,\n selected = [],\n disabled,\n round,\n loadingOptions,\n onChange,\n}) => {\n const [values, setValues] = useState([]);\n\n const handleChange = useCallback((event: ChangeEvent) => {\n const { value, checked } = event.currentTarget;\n let newValues: string[];\n if (checked) {\n newValues = [...values, value];\n } else {\n newValues = values.filter((v) => v !== value);\n }\n\n setValues(newValues);\n onChange(newValues);\n }, [onChange, values]);\n\n return (\n
\n {options.map((option) => (\n \n ))}\n
\n );\n};\n\nexport default memo(CheckboxGroup);\n","import React, {\n FC, useState, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiPollAnswer, ApiPollResult } from '../../../api/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport renderText from '../../common/helpers/renderText';\n\nimport './PollOption.scss';\n\ntype OwnProps = {\n answer: ApiPollAnswer;\n voteResults?: ApiPollResult[];\n totalVoters?: number;\n maxVotersCount?: number;\n correctResults: string[];\n shouldAnimate: boolean;\n};\n\nconst PollOption: FC = ({\n answer,\n voteResults,\n totalVoters,\n maxVotersCount,\n correctResults,\n shouldAnimate,\n}) => {\n const result = voteResults && voteResults.find((r) => r.option === answer.option);\n const correctAnswer = correctResults.length === 0 || correctResults.indexOf(answer.option) !== -1;\n const showIcon = (correctResults.length > 0 && correctAnswer) || (result?.isChosen);\n const answerPercent = result ? getPercentage(result.votersCount, totalVoters || 0) : 0;\n const [finalPercent, setFinalPercent] = useState(shouldAnimate ? 0 : answerPercent);\n // eslint-disable-next-line no-null/no-null\n const lineRef = useRef(null);\n const lineWidth = result ? getPercentage(result.votersCount, maxVotersCount || 0) : 0;\n const isAnimationDoesNotStart = finalPercent < answerPercent;\n\n useEffect(() => {\n if (shouldAnimate) {\n setFinalPercent(answerPercent);\n }\n }, [shouldAnimate, answerPercent]);\n\n useEffect(() => {\n const lineEl = lineRef.current;\n\n if (lineEl && shouldAnimate) {\n const svgEl = lineEl.firstElementChild;\n\n const style = isAnimationDoesNotStart ? '' : 'stroke-dasharray: 100% 200%; stroke-dashoffset: -44';\n if (!svgEl) {\n lineEl.innerHTML = `\n \n \n `;\n } else {\n svgEl.setAttribute('style', style);\n }\n }\n }, [isAnimationDoesNotStart, shouldAnimate]);\n\n if (!voteResults || !result) {\n return undefined;\n }\n\n const lineStyle = `width: ${lineWidth}%; transform:scaleX(${isAnimationDoesNotStart ? 0 : 1})`;\n\n return (\n
\n
\n {answerPercent}%\n {showIcon && (\n \n \n \n )}\n
\n
\n
\n {renderText(answer.text)}\n
\n
\n
\n \n
\n
\n
\n );\n};\n\nfunction getPercentage(value: number, total: number) {\n return total > 0 ? ((value / total) * 100).toFixed() : 0;\n}\n\nexport default PollOption;\n","import React, {\n FC,\n useCallback,\n useEffect,\n useState,\n memo,\n useMemo,\n useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport {\n ApiMessage, ApiPoll, ApiUser, ApiPollAnswer,\n} from '../../../api/types';\n\nimport { pick } from '../../../util/iteratees';\nimport renderText from '../../common/helpers/renderText';\nimport { renderTextWithEntities } from '../../common/helpers/renderMessageText';\nimport { formatMediaDuration } from '../../../util/dateFormat';\nimport useLang, { LangFn } from '../../../hooks/useLang';\n\nimport CheckboxGroup from '../../ui/CheckboxGroup';\nimport RadioGroup from '../../ui/RadioGroup';\nimport Avatar from '../../common/Avatar';\nimport Button from '../../ui/Button';\nimport Notification from '../../ui/Notification';\nimport PollOption from './PollOption';\n\nimport './Poll.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n poll: ApiPoll;\n onSendVote: (options: string[]) => void;\n};\n\ntype StateProps = {\n recentVoterIds?: number[];\n usersById: Record;\n serverTimeOffset: number;\n};\n\ntype DispatchProps = Pick;\n\nconst SOLUTION_CONTAINER_ID = '#middle-column-portals';\nconst SOLUTION_DURATION = 5000;\nconst NBSP = '\\u00A0';\n\nconst Poll: FC = ({\n message,\n poll,\n recentVoterIds,\n usersById,\n loadMessage,\n onSendVote,\n openPollResults,\n serverTimeOffset,\n}) => {\n const { id: messageId, chatId } = message;\n const { summary, results } = poll;\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [chosenOptions, setChosenOptions] = useState([]);\n const [isSolutionShown, setIsSolutionShown] = useState(false);\n const [wasSubmitted, setWasSubmitted] = useState(false);\n const [closePeriod, setClosePeriod] = useState(\n !summary.closed && summary.closeDate && summary.closeDate > 0\n ? Math.min(summary.closeDate - Math.floor(Date.now() / 1000) + serverTimeOffset, summary.closePeriod!)\n : 0,\n );\n // eslint-disable-next-line no-null/no-null\n const countdownRef = useRef(null);\n const { results: voteResults, totalVoters } = results;\n const hasVoted = voteResults && voteResults.some((r) => r.isChosen);\n const canVote = !summary.closed && !hasVoted;\n const canViewResult = !canVote && summary.isPublic && Number(results.totalVoters) > 0;\n const isMultiple = canVote && summary.multipleChoice;\n const maxVotersCount = voteResults ? Math.max(...voteResults.map((r) => r.votersCount)) : totalVoters;\n const correctResults = voteResults ? voteResults.reduce((answers: string[], r) => {\n if (r.isCorrect) {\n answers.push(r.option);\n }\n\n return answers;\n }, []) : [];\n const answers = summary.answers.map((a) => ({\n label: a.text,\n value: a.option,\n hidden: Boolean(summary.quiz && summary.closePeriod && closePeriod <= 0),\n }));\n\n useEffect(() => {\n if (\n isSubmitting\n && poll.results.results\n && poll.results.results.some((result) => result.isChosen)\n ) {\n setIsSubmitting(false);\n }\n }, [isSubmitting, poll.results.results]);\n\n useEffect(() => {\n if (closePeriod > 0) {\n setTimeout(() => setClosePeriod(closePeriod - 1), 1000);\n }\n\n const countdownEl = countdownRef.current;\n\n if (countdownEl) {\n const circumference = 6 * 2 * Math.PI;\n const svgEl = countdownEl.lastElementChild;\n const timerEl = countdownEl.firstElementChild;\n if (closePeriod <= 5) {\n countdownEl.classList.add('hurry-up');\n }\n\n if (!svgEl || !timerEl) {\n countdownEl.innerHTML = `\n ${formatMediaDuration(closePeriod)}\n \n \n `;\n } else {\n const strokeDashOffset = ((summary.closePeriod! - closePeriod) / summary.closePeriod!) * circumference;\n timerEl.textContent = formatMediaDuration(closePeriod);\n (svgEl.firstElementChild as SVGElement).setAttribute('stroke-dashoffset', `-${strokeDashOffset}`);\n }\n }\n }, [closePeriod, summary.closePeriod]);\n\n useEffect(() => {\n if (summary.quiz && (closePeriod <= 0 || (hasVoted && !summary.closed))) {\n loadMessage({ chatId, messageId });\n }\n }, [chatId, closePeriod, hasVoted, loadMessage, messageId, summary.closed, summary.quiz]);\n\n // If the client time is not synchronized, the poll must be updated after the closePeriod time has expired.\n useEffect(() => {\n let timer: number | undefined;\n\n if (summary.quiz && !summary.closed && summary.closePeriod && summary.closePeriod > 0) {\n timer = window.setTimeout(() => {\n loadMessage({ chatId, messageId });\n }, summary.closePeriod * 1000);\n }\n\n return () => {\n if (timer) {\n window.clearTimeout(timer);\n }\n };\n }, [canVote, chatId, loadMessage, messageId, summary.closePeriod, summary.closed, summary.quiz]);\n\n const recentVoters = useMemo(() => {\n return recentVoterIds ? recentVoterIds.reduce((result: ApiUser[], id) => {\n const user = usersById[id];\n if (user) {\n result.push(user);\n }\n\n return result;\n }, []) : [];\n }, [usersById, recentVoterIds]);\n\n const handleRadioChange = useCallback(\n (option: string) => {\n setChosenOptions([option]);\n setIsSubmitting(true);\n setWasSubmitted(true);\n onSendVote([option]);\n }, [onSendVote],\n );\n\n const handleCheckboxChange = useCallback(\n (options: string[]) => {\n setChosenOptions(options);\n }, [],\n );\n\n const handleVoteClick = useCallback(\n () => {\n setIsSubmitting(true);\n setWasSubmitted(true);\n onSendVote(chosenOptions);\n }, [onSendVote, chosenOptions],\n );\n\n const handleViewResultsClick = useCallback(\n () => {\n openPollResults({ chatId, messageId });\n }, [chatId, messageId, openPollResults],\n );\n\n const handleSolutionShow = useCallback(() => {\n setIsSolutionShown(true);\n }, []);\n\n const handleSolutionHide = useCallback(() => {\n setIsSolutionShown(false);\n setWasSubmitted(false);\n }, []);\n\n // Show the solution to quiz if the answer was incorrect\n useEffect(() => {\n if (wasSubmitted && hasVoted && summary.quiz && results.results && poll.results.solution) {\n const correctResult = results.results.find((r) => r.isChosen && r.isCorrect);\n if (!correctResult) {\n setIsSolutionShown(true);\n }\n }\n }, [hasVoted, wasSubmitted, results.results, summary.quiz, poll.results.solution]);\n\n const lang = useLang();\n\n function renderResultOption(answer: ApiPollAnswer) {\n return (\n \n );\n }\n\n function renderRecentVoters() {\n return (\n recentVoters.length > 0 && (\n
\n {recentVoters.map((user) => (\n \n ))}\n
\n )\n );\n }\n\n function renderSolution() {\n return (\n isSolutionShown && poll.results.solution && (\n \n )\n );\n }\n\n return (\n
\n {renderSolution()}\n
{renderText(summary.question)}
\n
\n {lang(getPollTypeString(summary))}\n {renderRecentVoters()}\n {closePeriod > 0 && canVote &&
}\n {summary.quiz && poll.results.solution && !canVote && (\n \n \n \n )}\n
\n {canVote && (\n
\n {isMultiple\n ? (\n \n )\n : (\n \n )}\n
\n )}\n {!canVote && (\n
\n {summary.answers.map(renderResultOption)}\n
\n )}\n {!canViewResult && !isMultiple && (\n
{getReadableVotersCount(lang, summary.quiz, results.totalVoters)}
\n )}\n {isMultiple && (\n \n {lang('PollSubmitVotes')}\n \n )}\n {canViewResult && (\n \n {lang('PollViewResults')}\n \n )}\n
\n );\n};\n\nfunction getPollTypeString(summary: ApiPoll['summary']) {\n // When we just created the poll, some properties don't exist.\n if (typeof summary.isPublic === 'undefined') {\n return NBSP;\n }\n\n if (summary.quiz) {\n return summary.isPublic ? 'QuizPoll' : 'AnonymousQuizPoll';\n }\n\n if (summary.closed) {\n return 'FinalResults';\n }\n\n return summary.isPublic ? 'PublicPoll' : 'AnonymousPoll';\n}\n\nfunction getReadableVotersCount(lang: LangFn, isQuiz: true | undefined, count?: number) {\n if (!count) {\n return lang(isQuiz ? 'Chat.Quiz.TotalVotesEmpty' : 'Chat.Poll.TotalVotesResultEmpty');\n }\n\n return lang(isQuiz ? 'Answer' : 'Vote', count, 'i');\n}\n\nexport default memo(withGlobal(\n (global, { poll }) => {\n const { recentVoterIds } = poll.results;\n const { serverTimeOffset, users: { byId: usersById } } = global;\n if (!recentVoterIds || recentVoterIds.length === 0) {\n return {};\n }\n\n return {\n recentVoterIds,\n usersById,\n serverTimeOffset,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadMessage', 'openPollResults']),\n)(Poll));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\nimport { ObserveFn } from '../../../hooks/useIntersectionObserver';\n\nimport { getMessageWebPage } from '../../../modules/helpers';\nimport { calculateMediaDimensions } from './helpers/mediaDimensions';\nimport renderText from '../../common/helpers/renderText';\nimport trimText from '../../../util/trimText';\nimport buildClassName from '../../../util/buildClassName';\n\nimport SafeLink from '../../common/SafeLink';\nimport Photo from './Photo';\nimport Video from './Video';\n\nimport './WebPage.scss';\n\nconst MAX_TEXT_LENGTH = 170; // symbols\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection?: ObserveFn;\n noAvatars?: boolean;\n shouldAutoLoad?: boolean;\n shouldAutoPlay?: boolean;\n inPreview?: boolean;\n lastSyncTime?: number;\n onMediaClick?: () => void;\n onCancelMediaTransfer?: () => void;\n};\n\nconst WebPage: FC = ({\n message,\n observeIntersection,\n noAvatars,\n shouldAutoLoad,\n shouldAutoPlay,\n inPreview,\n lastSyncTime,\n onMediaClick,\n onCancelMediaTransfer,\n}) => {\n const webPage = getMessageWebPage(message);\n\n let isSquarePhoto = false;\n if (webPage?.photo && !webPage.video) {\n const { width, height } = calculateMediaDimensions(message);\n isSquarePhoto = width === height;\n }\n\n const handleMediaClick = useCallback(() => {\n onMediaClick!();\n }, [onMediaClick]);\n\n if (!webPage) {\n return undefined;\n }\n\n const {\n siteName,\n url,\n displayUrl,\n title,\n description,\n photo,\n video,\n } = webPage;\n const isMediaInteractive = (photo || video) && onMediaClick && !isSquarePhoto;\n const truncatedDescription = trimText(description, MAX_TEXT_LENGTH);\n\n const className = buildClassName(\n 'WebPage',\n isSquarePhoto && 'with-square-photo',\n !photo && !video && !inPreview && 'without-media',\n video && 'with-video',\n );\n\n return (\n \n {photo && !video && (\n \n )}\n
\n \n {!inPreview && title && (\n

{renderText(title)}

\n )}\n {truncatedDescription && (\n

{renderText(truncatedDescription, ['emoji', 'br'])}

\n )}\n
\n {!inPreview && video && (\n \n )}\n
\n );\n};\n\nexport default memo(WebPage);\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\n\nimport { getMessageInvoice } from '../../../modules/helpers';\nimport { formatCurrency } from '../../../util/formatCurrency';\nimport renderText from '../../common/helpers/renderText';\nimport useLang from '../../../hooks/useLang';\n\nimport './Invoice.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n};\n\nconst Invoice: FC = ({\n message,\n}) => {\n const lang = useLang();\n const invoice = getMessageInvoice(message);\n\n const {\n title,\n text,\n amount,\n currency,\n isTest,\n photoUrl,\n } = invoice!;\n\n return (\n \n {title && (\n

{renderText(title)}

\n )}\n {text && (\n

{renderText(text, ['emoji', 'br'])}

\n )}\n
\n {photoUrl && (\n \n )}\n

\n {formatCurrency(amount, currency, lang.code)}\n {isTest && {lang('PaymentTestInvoice')}}\n

\n
\n
\n );\n};\n\nexport default memo(Invoice);\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC,\n useCallback,\n useMemo,\n memo,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { OwnProps as PhotoProps } from '../Photo';\nimport { OwnProps as VideoProps } from '../Video';\n\nimport buildClassName from '../../../../util/buildClassName';\nimport { GlobalActions } from '../../../../global/types';\nimport {\n selectIsInSelectMode,\n selectIsMessageSelected,\n} from '../../../../modules/selectors';\n\nimport { pick } from '../../../../util/iteratees';\n\ntype OwnProps = PhotoProps & VideoProps;\n\ntype StateProps = {\n isInSelectMode?: boolean;\n isSelected?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nexport default function withSelectControl(WrappedComponent: FC) {\n const ComponentWithSelectControl: FC = (props) => {\n const {\n isInSelectMode,\n isSelected,\n message,\n toggleMessageSelection,\n dimensions,\n } = props;\n\n const handleMessageSelect = useCallback((e: ReactMouseEvent) => {\n e.stopPropagation();\n toggleMessageSelection({ messageId: message.id, withShift: e?.shiftKey });\n }, [toggleMessageSelection, message]);\n\n const newProps = useMemo(() => {\n return {\n ...props,\n isInSelectMode,\n isSelected,\n dimensions: {\n ...props.dimensions,\n x: 0,\n y: 0,\n },\n onClick: isInSelectMode ? undefined : props.onClick,\n };\n }, [props, isInSelectMode, isSelected]);\n\n return (\n \n {isInSelectMode && (\n
\n {isSelected && (\n \n )}\n
\n )}\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n \n \n );\n };\n\n return memo(withGlobal(\n (global, ownProps) => {\n const { message } = ownProps;\n return {\n isInSelectMode: selectIsInSelectMode(global),\n isSelected: selectIsMessageSelected(global, message.id),\n };\n },\n (setGlobal, actions) => pick(actions, [\n 'toggleMessageSelection',\n ]),\n )(ComponentWithSelectControl));\n}\n","import React, { FC, useCallback } from '../../../lib/teact/teact';\n\nimport { GlobalActions, GlobalState } from '../../../global/types';\nimport { ApiMessage } from '../../../api/types';\nimport { IAlbum } from '../../../types';\nimport { AlbumRectPart, IAlbumLayout } from './helpers/calculateAlbumLayout';\n\nimport { getMessageContent } from '../../../modules/helpers';\nimport { withGlobal } from '../../../lib/teact/teactn';\nimport { pick } from '../../../util/iteratees';\nimport withSelectControl from './hocs/withSelectControl';\nimport { ObserveFn } from '../../../hooks/useIntersectionObserver';\n\nimport Photo from './Photo';\nimport Video from './Video';\n\nimport './Album.scss';\n\nconst PhotoWithSelect = withSelectControl(Photo);\nconst VideoWithSelect = withSelectControl(Video);\n\ntype OwnProps = {\n album: IAlbum;\n observeIntersection: ObserveFn;\n shouldAutoLoad?: boolean;\n shouldAutoPlay?: boolean;\n hasCustomAppendix?: boolean;\n lastSyncTime?: number;\n isOwn: boolean;\n albumLayout: IAlbumLayout;\n onMediaClick: (messageId: number) => void;\n};\n\ntype StateProps = {\n uploadsById: GlobalState['fileUploads']['byMessageLocalId'];\n};\n\ntype DispatchProps = Pick;\n\nconst Album: FC = ({\n album,\n observeIntersection,\n shouldAutoLoad,\n shouldAutoPlay,\n hasCustomAppendix,\n lastSyncTime,\n isOwn,\n albumLayout,\n onMediaClick,\n uploadsById,\n cancelSendingMessage,\n}) => {\n const mediaCount = album.messages.length;\n\n const handleCancelUpload = useCallback((message: ApiMessage) => {\n cancelSendingMessage({ chatId: message.chatId, messageId: message.id });\n }, [cancelSendingMessage]);\n\n function renderAlbumMessage(message: ApiMessage, index: number) {\n const { photo, video } = getMessageContent(message);\n const fileUpload = uploadsById[message.previousLocalId || message.id];\n const uploadProgress = fileUpload?.progress;\n const { dimensions, sides } = albumLayout.layout[index];\n\n if (photo) {\n const shouldAffectAppendix = hasCustomAppendix && (\n // eslint-disable-next-line no-bitwise\n (isOwn ? index === mediaCount - 1 : Boolean(sides & AlbumRectPart.Left && sides & AlbumRectPart.Bottom))\n );\n\n return (\n \n );\n } else if (video) {\n return (\n \n );\n }\n\n return undefined;\n }\n\n const { width: containerWidth, height: containerHeight } = albumLayout.containerStyle;\n\n return (\n \n {album.messages.map(renderAlbumMessage)}\n \n );\n};\n\nexport default withGlobal(\n (global): StateProps => {\n return {\n uploadsById: global.fileUploads.byMessageLocalId,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'cancelSendingMessage',\n ]),\n)(Album);\n","import React, {\n FC,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\n\nimport { ROUND_VIDEO_DIMENSIONS } from '../../common/helpers/mediaDimensions';\nimport { formatMediaDuration } from '../../../util/dateFormat';\nimport { getMessageMediaFormat, getMessageMediaHash } from '../../../modules/helpers';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMediaWithDownloadProgress from '../../../hooks/useMediaWithDownloadProgress';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useBuffering from '../../../hooks/useBuffering';\nimport buildClassName from '../../../util/buildClassName';\nimport useHeavyAnimationCheckForVideo from '../../../hooks/useHeavyAnimationCheckForVideo';\nimport useVideoCleanup from '../../../hooks/useVideoCleanup';\nimport usePauseOnInactive from './hooks/usePauseOnInactive';\nimport useBlurredMediaThumbRef from './hooks/useBlurredMediaThumbRef';\nimport safePlay from '../../../util/safePlay';\nimport { fastRaf } from '../../../util/schedulers';\n\nimport ProgressSpinner from '../../ui/ProgressSpinner';\n\nimport './RoundVideo.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection: ObserveFn;\n shouldAutoLoad?: boolean;\n shouldAutoPlay?: boolean;\n lastSyncTime?: number;\n};\n\nlet currentOnRelease: NoneToVoidFunction;\n\nfunction createCapture(onRelease: NoneToVoidFunction) {\n return () => {\n if (currentOnRelease) {\n currentOnRelease();\n }\n\n currentOnRelease = onRelease;\n };\n}\n\nconst RoundVideo: FC = ({\n message,\n observeIntersection,\n shouldAutoLoad,\n shouldAutoPlay,\n lastSyncTime,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const playingProgressRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const playerRef = useRef(null);\n\n const video = message.content.video!;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const [isDownloadAllowed, setIsDownloadAllowed] = useState(shouldAutoLoad && shouldAutoPlay);\n const shouldDownload = Boolean(isDownloadAllowed && isIntersecting && lastSyncTime);\n const { mediaData, downloadProgress } = useMediaWithDownloadProgress(\n getMessageMediaHash(message, 'inline'),\n !shouldDownload,\n getMessageMediaFormat(message, 'inline'),\n lastSyncTime,\n );\n const thumbRef = useBlurredMediaThumbRef(message, mediaData);\n\n const { isBuffered, bufferingHandlers } = useBuffering();\n const isTransferring = isDownloadAllowed && !isBuffered;\n const wasDownloadDisabled = usePrevious(isDownloadAllowed) === false;\n const {\n shouldRender: shouldSpinnerRender,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring || !isBuffered, undefined, wasDownloadDisabled);\n const { shouldRenderThumb, transitionClassNames } = useTransitionForMedia(mediaData, 'slow');\n\n const [isActivated, setIsActivated] = useState(false);\n const [progress, setProgress] = useState(0);\n\n useEffect(() => {\n if (!isActivated) {\n return;\n }\n\n const circumference = 94 * 2 * Math.PI;\n const strokeDashOffset = circumference - progress * circumference;\n\n const playerEl = playerRef.current!;\n const playingProgressEl = playingProgressRef.current!;\n const svgEl = playingProgressEl.firstElementChild;\n\n if (!svgEl) {\n playingProgressEl.innerHTML = `\n \n `;\n } else {\n (svgEl.firstElementChild as SVGElement).setAttribute('stroke-dashoffset', strokeDashOffset.toString());\n }\n\n setProgress(playerEl.currentTime / playerEl.duration);\n }, [isActivated, progress]);\n\n const shouldPlay = Boolean(mediaData && isIntersecting);\n\n const stopPlaying = () => {\n setIsActivated(false);\n setProgress(0);\n safePlay(playerRef.current!);\n\n fastRaf(() => {\n playingProgressRef.current!.innerHTML = '';\n });\n };\n\n const capturePlaying = createCapture(stopPlaying);\n\n useEffect(() => {\n if (!playerRef.current) {\n return;\n }\n\n if (shouldPlay) {\n safePlay(playerRef.current);\n } else {\n playerRef.current.pause();\n }\n }, [shouldPlay]);\n\n useHeavyAnimationCheckForVideo(playerRef, shouldPlay);\n usePauseOnInactive(playerRef, Boolean(mediaData));\n useVideoCleanup(playerRef, [mediaData]);\n\n const handleClick = useCallback(() => {\n if (!mediaData) {\n setIsDownloadAllowed((isAllowed) => !isAllowed);\n\n return;\n }\n\n const playerEl = playerRef.current!;\n if (isActivated) {\n if (playerEl.paused) {\n safePlay(playerEl);\n } else {\n playerEl.pause();\n }\n } else {\n capturePlaying();\n // Pause is a workaround for iOS Safari – otherwise it stops video after several frames\n playerEl.pause();\n playerEl.currentTime = 0;\n safePlay(playerEl);\n\n setIsActivated(true);\n }\n }, [capturePlaying, isActivated, mediaData]);\n\n const handleTimeUpdate = useCallback((e: React.UIEvent) => {\n const playerEl = e.currentTarget;\n\n setProgress(playerEl.currentTime / playerEl.duration);\n }, []);\n\n const videoClassName = buildClassName('full-media', transitionClassNames);\n\n return (\n \n {(shouldRenderThumb || mediaData) && (\n
\n \n
\n )}\n {mediaData && (\n
\n {/* eslint-disable-next-line jsx-a11y/media-has-caption */}\n \n \n \n
\n )}\n
\n {shouldSpinnerRender && (\n
\n \n
\n )}\n {!mediaData && !isDownloadAllowed && (\n \n )}\n
\n {isActivated ? formatMediaDuration(playerRef.current!.currentTime) : formatMediaDuration(video.duration)}\n {(!isActivated || playerRef.current!.paused) && }\n
\n
\n );\n};\n\nexport default RoundVideo;\n","import React, { FC } from '../../../lib/teact/teact';\n\nimport { ApiKeyboardButton, ApiMessage } from '../../../api/types';\n\nimport { RE_TME_LINK } from '../../../config';\nimport renderText from '../../common/helpers/renderText';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\n\nimport './InlineButtons.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n onClick: ({ button }: { button: ApiKeyboardButton }) => void;\n};\n\nconst InlineButtons: FC = ({ message, onClick }) => {\n const lang = useLang();\n\n return (\n
\n {message.inlineButtons!.map((row) => (\n
\n {row.map((button) => (\n onClick({ button })}\n >\n {renderText(lang(button.text))}\n {button.type === 'buy' && }\n {button.type === 'url' && !button.value!.match(RE_TME_LINK) && }\n \n ))}\n
\n ))}\n
\n );\n};\n\nexport default InlineButtons;\n","import React, {\n FC, memo, useCallback,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiMessage, ApiThreadInfo, ApiUser,\n} from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { pick } from '../../../util/iteratees';\nimport { isChatPrivate } from '../../../modules/helpers';\nimport { formatIntegerCompact } from '../../../util/textFormat';\nimport buildClassName from '../../../util/buildClassName';\nimport { selectThreadInfo } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\n\nimport Avatar from '../../common/Avatar';\n\nimport './CommentButton.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n disabled?: boolean;\n};\n\ntype StateProps = {\n threadInfo: ApiThreadInfo;\n usersById?: Record;\n chatsById?: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst CommentButton: FC = ({\n disabled,\n threadInfo,\n usersById,\n chatsById,\n openChat,\n}) => {\n const lang = useLang();\n const {\n threadId, chatId, messagesCount, lastMessageId, lastReadInboxMessageId, recentReplierIds,\n } = threadInfo;\n\n const handleClick = useCallback(() => {\n openChat({ id: chatId, threadId });\n }, [openChat, chatId, threadId]);\n\n if (messagesCount === undefined) {\n return undefined;\n }\n\n const recentRepliers = recentReplierIds && recentReplierIds.map((peerId) => {\n return isChatPrivate(peerId) ? usersById![peerId] : chatsById![peerId];\n }).filter(Boolean);\n\n function renderRecentRepliers() {\n return (\n recentRepliers && recentRepliers.length > 0 && (\n
\n {recentRepliers.map((user) => (\n \n ))}\n
\n )\n );\n }\n\n const hasUnread = Boolean(lastReadInboxMessageId && lastMessageId && lastReadInboxMessageId < lastMessageId);\n\n return (\n \n \n {(!recentRepliers || recentRepliers.length === 0) && }\n {renderRecentRepliers()}\n
\n {messagesCount ? lang('Comments', messagesCount, 'i') : lang('LeaveAComment')}\n
\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { message }) => {\n const { threadId, chatId } = message.threadInfo!;\n\n const threadInfo = selectThreadInfo(global, chatId, threadId) || message.threadInfo!;\n const { byId: usersById } = global.users;\n const { byId: chatsById } = global.chats;\n\n return {\n threadInfo,\n usersById,\n chatsById,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat',\n ]),\n)(CommentButton));\n","import React, {\n FC,\n memo,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions, MessageListType } from '../../../global/types';\nimport {\n ApiMessage,\n ApiMessageOutgoingStatus,\n ApiUser,\n ApiChat,\n ApiSticker,\n} from '../../../api/types';\nimport { FocusDirection, IAlbum, ISettings } from '../../../types';\n\nimport { IS_ANDROID, IS_TOUCH_ENV } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\nimport {\n selectChat,\n selectChatMessage,\n selectUploadProgress,\n selectIsChatWithSelf,\n selectOutgoingStatus,\n selectUser,\n selectIsMessageFocused,\n selectCurrentTextSearch,\n selectAnimatedEmoji,\n selectIsInSelectMode,\n selectIsMessageSelected,\n selectIsDocumentGroupSelected,\n selectSender,\n selectForwardedSender,\n selectThreadTopMessageId,\n selectShouldAutoLoadMedia,\n selectShouldAutoPlayMedia,\n selectShouldLoopStickers,\n selectTheme,\n selectAllowedMessageActions,\n} from '../../../modules/selectors';\nimport {\n getMessageContent,\n isOwnMessage,\n isReplyMessage,\n isAnonymousOwnMessage,\n isMessageLocal,\n isChatPrivate,\n getMessageCustomShape,\n isChatChannel,\n getMessageSingleEmoji,\n getSenderTitle,\n getUserColorKey,\n} from '../../../modules/helpers';\nimport buildClassName from '../../../util/buildClassName';\nimport useEnsureMessage from '../../../hooks/useEnsureMessage';\nimport useContextMenuHandlers from '../../../hooks/useContextMenuHandlers';\nimport { renderMessageText } from '../../common/helpers/renderMessageText';\nimport { ROUND_VIDEO_DIMENSIONS } from '../../common/helpers/mediaDimensions';\nimport { buildContentClassName, isEmojiOnlyMessage } from './helpers/buildContentClassName';\nimport { getMinMediaWidth, calculateMediaDimensions } from './helpers/mediaDimensions';\nimport { calculateAlbumLayout } from './helpers/calculateAlbumLayout';\nimport renderText from '../../common/helpers/renderText';\nimport calculateAuthorWidth from './helpers/calculateAuthorWidth';\nimport { ObserveFn, useOnIntersect } from '../../../hooks/useIntersectionObserver';\nimport useLang from '../../../hooks/useLang';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useFlag from '../../../hooks/useFlag';\nimport useFocusMessage from './hooks/useFocusMessage';\nimport useOuterHandlers from './hooks/useOuterHandlers';\nimport useInnerHandlers from './hooks/useInnerHandlers';\n\nimport Button from '../../ui/Button';\nimport Avatar from '../../common/Avatar';\nimport EmbeddedMessage from '../../common/EmbeddedMessage';\nimport Document from '../../common/Document';\nimport Audio from '../../common/Audio';\nimport MessageMeta from './MessageMeta';\nimport ContextMenuContainer from './ContextMenuContainer.async';\nimport Sticker from './Sticker';\nimport AnimatedEmoji from '../../common/AnimatedEmoji';\nimport Photo from './Photo';\nimport Video from './Video';\nimport Contact from './Contact';\nimport Poll from './Poll';\nimport WebPage from './WebPage';\nimport Invoice from './Invoice';\nimport Album from './Album';\nimport RoundVideo from './RoundVideo';\nimport InlineButtons from './InlineButtons';\nimport CommentButton from './CommentButton';\n\nimport './Message.scss';\n\ntype MessagePositionProperties = {\n isFirstInGroup: boolean;\n isLastInGroup: boolean;\n isFirstInDocumentGroup: boolean;\n isLastInDocumentGroup: boolean;\n isLastInList: boolean;\n};\n\ntype OwnProps =\n {\n message: ApiMessage;\n observeIntersectionForBottom: ObserveFn;\n observeIntersectionForMedia: ObserveFn;\n observeIntersectionForAnimatedStickers: ObserveFn;\n album?: IAlbum;\n noAvatars?: boolean;\n withAvatar?: boolean;\n withSenderName?: boolean;\n threadId: number;\n messageListType: MessageListType;\n noComments: boolean;\n appearanceOrder: number;\n }\n & MessagePositionProperties;\n\ntype StateProps = {\n theme: ISettings['theme'];\n forceSenderName?: boolean;\n chatUsername?: string;\n sender?: ApiUser | ApiChat;\n originSender?: ApiUser | ApiChat;\n botSender?: ApiUser;\n isThreadTop?: boolean;\n shouldHideReply?: boolean;\n replyMessage?: ApiMessage;\n replyMessageSender?: ApiUser | ApiChat;\n outgoingStatus?: ApiMessageOutgoingStatus;\n uploadProgress?: number;\n isFocused?: boolean;\n focusDirection?: FocusDirection;\n noFocusHighlight?: boolean;\n isResizingContainer?: boolean;\n isForwarding?: boolean;\n isChatWithSelf?: boolean;\n isChannel?: boolean;\n canReply?: boolean;\n lastSyncTime?: number;\n highlight?: string;\n isSingleEmoji?: boolean;\n animatedEmoji?: ApiSticker;\n isInSelectMode?: boolean;\n isSelected?: boolean;\n isGroupSelected?: boolean;\n threadId?: number;\n isPinnedList?: boolean;\n shouldAutoLoadMedia?: boolean;\n shouldAutoPlayMedia?: boolean;\n shouldLoopStickers?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst NBSP = '\\u00A0';\nconst GROUP_MESSAGE_HOVER_ATTRIBUTE = 'data-is-document-group-hover';\n// eslint-disable-next-line max-len\nconst APPENDIX_OWN = '';\n// eslint-disable-next-line max-len\nconst APPENDIX_NOT_OWN = '';\nconst APPEARANCE_DELAY = 10;\nconst NO_MEDIA_CORNERS_THRESHOLD = 18;\n\nconst Message: FC = ({\n message,\n chatUsername,\n observeIntersectionForBottom,\n observeIntersectionForMedia,\n observeIntersectionForAnimatedStickers,\n album,\n noAvatars,\n withAvatar,\n withSenderName,\n noComments,\n appearanceOrder,\n isFirstInGroup,\n isLastInGroup,\n isFirstInDocumentGroup,\n isLastInDocumentGroup,\n isLastInList,\n theme,\n forceSenderName,\n sender,\n originSender,\n botSender,\n isThreadTop,\n shouldHideReply,\n replyMessage,\n replyMessageSender,\n outgoingStatus,\n uploadProgress,\n isFocused,\n focusDirection,\n noFocusHighlight,\n isResizingContainer,\n isForwarding,\n isChatWithSelf,\n isChannel,\n canReply,\n lastSyncTime,\n highlight,\n animatedEmoji,\n isInSelectMode,\n isSelected,\n isGroupSelected,\n threadId,\n messageListType,\n isPinnedList,\n shouldAutoLoadMedia,\n shouldAutoPlayMedia,\n shouldLoopStickers,\n toggleMessageSelection,\n clickInlineButton,\n disableContextMenuHint,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const bottomMarkerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const appendixRef = useRef(null);\n const lang = useLang();\n\n useOnIntersect(bottomMarkerRef, observeIntersectionForBottom);\n\n const {\n isContextMenuOpen, contextMenuPosition,\n handleBeforeContextMenu, handleContextMenu: onContextMenu,\n handleContextMenuClose, handleContextMenuHide,\n } = useContextMenuHandlers(ref, IS_TOUCH_ENV && isInSelectMode, true, IS_ANDROID);\n\n useEffect(() => {\n if (isContextMenuOpen) {\n disableContextMenuHint();\n }\n }, [isContextMenuOpen, disableContextMenuHint]);\n\n const noAppearanceAnimation = appearanceOrder <= 0;\n const [isShown, markShown] = useFlag(noAppearanceAnimation);\n useEffect(() => {\n if (noAppearanceAnimation) {\n return;\n }\n\n setTimeout(markShown, appearanceOrder * APPEARANCE_DELAY);\n }, [appearanceOrder, markShown, noAppearanceAnimation]);\n const { transitionClassNames } = useShowTransition(isShown, undefined, noAppearanceAnimation, false);\n\n const { id: messageId, chatId, threadInfo } = message;\n\n const isLocal = isMessageLocal(message);\n const isOwn = isOwnMessage(message);\n const isScheduled = messageListType === 'scheduled' || message.isScheduled;\n const hasReply = isReplyMessage(message) && !shouldHideReply;\n const hasThread = Boolean(threadInfo) && messageListType === 'thread';\n const { forwardInfo, viaBotId } = message;\n const asForwarded = forwardInfo && !isChatWithSelf && !forwardInfo.isLinkedChannelPost;\n const isInDocumentGroup = Boolean(message.groupedId) && !message.isInAlbum;\n const isAlbum = Boolean(album) && album!.messages.length > 1;\n const {\n text, photo, video, audio, voice, document, sticker, contact, poll, webPage, invoice,\n } = getMessageContent(message);\n const customShape = getMessageCustomShape(message);\n const textParts = renderMessageText(message, highlight, isEmojiOnlyMessage(customShape));\n const isContextMenuShown = contextMenuPosition !== undefined;\n const signature = (\n (isChannel && message.adminTitle) || (forwardInfo && !asForwarded && forwardInfo.adminTitle) || undefined\n );\n const metaSafeAuthorWidth = useMemo(() => {\n return signature ? calculateAuthorWidth(signature) : undefined;\n }, [signature]);\n const canShowActionButton = (\n !(isContextMenuShown || isInSelectMode || isForwarding)\n && (!isInDocumentGroup || isLastInDocumentGroup)\n );\n const canForward = isChannel && !isScheduled;\n const canFocus = Boolean(isPinnedList\n || (forwardInfo && (forwardInfo.isChannelPost || (isChatWithSelf && !isOwn)) && forwardInfo.fromMessageId));\n const avatarPeer = forwardInfo && (isChatWithSelf || !sender) ? originSender : sender;\n const senderPeer = forwardInfo ? originSender : sender;\n\n const selectMessage = useCallback((e?: React.MouseEvent, groupedId?: string) => {\n if (isLocal) {\n return;\n }\n\n toggleMessageSelection({\n messageId,\n groupedId,\n ...(e?.shiftKey && { withShift: true }),\n ...(isAlbum && { childMessageIds: album!.messages.map(({ id }) => id) }),\n });\n }, [isLocal, toggleMessageSelection, messageId, isAlbum, album]);\n\n const {\n handleMouseDown,\n handleClick,\n handleContextMenu,\n handleDoubleClick,\n handleContentDoubleClick,\n isSwiped,\n } = useOuterHandlers(\n selectMessage,\n ref,\n messageId,\n isLocal,\n isAlbum,\n Boolean(isInSelectMode),\n Boolean(canReply),\n onContextMenu,\n handleBeforeContextMenu,\n );\n\n const {\n handleAvatarClick,\n handleSenderClick,\n handleViaBotClick,\n handleReplyClick,\n handleMediaClick,\n handleAudioPlay,\n handleAlbumMediaClick,\n handleMetaClick,\n handleReadMedia,\n handleCancelUpload,\n handleVoteSend,\n handleGroupForward,\n handleForward,\n handleFocus,\n handleFocusForwarded,\n handleDocumentGroupSelectAll,\n } = useInnerHandlers(\n lang,\n selectMessage,\n message,\n chatId,\n threadId,\n isInDocumentGroup,\n Boolean(isScheduled),\n album,\n avatarPeer,\n senderPeer,\n botSender,\n );\n\n const containerClassName = buildClassName(\n 'Message message-list-item',\n isFirstInGroup && 'first-in-group',\n isLastInGroup && 'last-in-group',\n isFirstInDocumentGroup && 'first-in-document-group',\n isLastInDocumentGroup && 'last-in-document-group',\n isLastInList && 'last-in-list',\n isOwn && 'own',\n Boolean(message.views) && 'has-views',\n message.isEdited && 'was-edited',\n hasReply && 'has-reply',\n isContextMenuShown && 'has-menu-open',\n isFocused && !noFocusHighlight && 'focused',\n isForwarding && 'is-forwarding',\n message.isDeleting && 'is-deleting',\n isInDocumentGroup && 'is-in-document-group',\n isAlbum && 'is-album',\n message.hasUnreadMention && 'has-unread-mention',\n isSelected && 'is-selected',\n isInSelectMode && 'is-in-selection-mode',\n isThreadTop && 'is-thread-top',\n Boolean(message.inlineButtons) && 'has-inline-buttons',\n isSwiped && 'is-swiped',\n transitionClassNames,\n );\n const contentClassName = buildContentClassName(message, {\n hasReply,\n customShape,\n isLastInGroup,\n asForwarded,\n hasThread,\n forceSenderName,\n hasComments: message.threadInfo && message.threadInfo.messagesCount > 0,\n hasActionButton: canForward || canFocus,\n });\n const withCommentButton = message.threadInfo && (!isInDocumentGroup || isLastInDocumentGroup)\n && messageListType === 'thread' && !noComments;\n const withAppendix = contentClassName.includes('has-appendix');\n\n useEnsureMessage(chatId, hasReply ? message.replyToMessageId : undefined, replyMessage, message.id);\n useFocusMessage(ref, chatId, isFocused, focusDirection, noFocusHighlight, isResizingContainer);\n useLayoutEffect(() => {\n if (!appendixRef.current) {\n return;\n }\n\n appendixRef.current.innerHTML = isOwn ? APPENDIX_OWN : APPENDIX_NOT_OWN;\n }, [isOwn, withAppendix]);\n\n let style = '';\n let calculatedWidth;\n let noMediaCorners = false;\n const albumLayout = useMemo(() => {\n return isAlbum ? calculateAlbumLayout(isOwn, Boolean(asForwarded), Boolean(noAvatars), album!) : undefined;\n }, [isAlbum, isOwn, asForwarded, noAvatars, album]);\n\n const extraPadding = asForwarded ? 28 : 0;\n if (!isAlbum && (photo || video)) {\n let width: number | undefined;\n if (photo) {\n width = calculateMediaDimensions(message, noAvatars).width;\n } else if (video) {\n if (video.isRound) {\n width = ROUND_VIDEO_DIMENSIONS;\n } else {\n width = calculateMediaDimensions(message, noAvatars).width;\n }\n }\n\n if (width) {\n calculatedWidth = Math.max(getMinMediaWidth(Boolean(text), withCommentButton), width);\n if (calculatedWidth - width > NO_MEDIA_CORNERS_THRESHOLD) {\n noMediaCorners = true;\n }\n }\n } else if (albumLayout) {\n calculatedWidth = Math.max(getMinMediaWidth(Boolean(text), withCommentButton), albumLayout.containerStyle.width);\n if (calculatedWidth - albumLayout.containerStyle.width > NO_MEDIA_CORNERS_THRESHOLD) {\n noMediaCorners = true;\n }\n }\n\n if (calculatedWidth) {\n style = `width: ${calculatedWidth + extraPadding}px`;\n }\n\n function renderAvatar() {\n const isAvatarPeerUser = avatarPeer && isChatPrivate(avatarPeer.id);\n const avatarUser = (avatarPeer && isAvatarPeerUser) ? avatarPeer as ApiUser : undefined;\n const avatarChat = (avatarPeer && !isAvatarPeerUser) ? avatarPeer as ApiChat : undefined;\n const hiddenName = (!avatarPeer && forwardInfo) ? forwardInfo.hiddenUserName : undefined;\n\n return (\n \n );\n }\n\n function renderContent() {\n const className = buildClassName(\n 'content-inner',\n asForwarded && !customShape && 'forwarded-message',\n hasReply && 'reply-message',\n noMediaCorners && 'no-media-corners',\n );\n const hasCustomAppendix = isLastInGroup && !textParts && !asForwarded && !hasThread;\n const shouldInlineMeta = !webPage && !animatedEmoji && textParts;\n const textContentClass = buildClassName(\n 'text-content',\n shouldInlineMeta && 'with-meta',\n outgoingStatus && 'with-outgoing-icon',\n );\n\n return (\n
\n {renderSenderName()}\n {hasReply && (\n \n )}\n {sticker && (\n \n )}\n {animatedEmoji && (\n \n )}\n {isAlbum && (\n \n )}\n {!isAlbum && photo && (\n \n )}\n {!isAlbum && video && video.isRound && (\n \n )}\n {!isAlbum && video && !video.isRound && (\n \n )}\n {(audio || voice) && (\n \n )}\n {document && (\n \n )}\n {contact && (\n \n )}\n {poll && (\n \n )}\n {!animatedEmoji && textParts && (\n

\n {textParts}\n {shouldInlineMeta && (\n \n )}\n

\n )}\n {webPage && (\n \n )}\n {invoice && }\n
\n );\n }\n\n function renderSenderName() {\n const shouldRender = !(customShape && !viaBotId) && (\n (withSenderName && !photo && !video) || asForwarded || viaBotId || forceSenderName\n ) && (!isInDocumentGroup || isFirstInDocumentGroup);\n\n if (!shouldRender) {\n return undefined;\n }\n\n let senderTitle;\n let senderColor;\n if (senderPeer && !(customShape && viaBotId)) {\n senderTitle = getSenderTitle(lang, senderPeer);\n\n if (!asForwarded) {\n senderColor = `color-${getUserColorKey(senderPeer)}`;\n }\n } else if (forwardInfo?.hiddenUserName) {\n senderTitle = forwardInfo.hiddenUserName;\n }\n\n return (\n
\n {senderTitle ? (\n \n {renderText(senderTitle)}\n \n ) : !botSender ? (\n NBSP\n ) : undefined}\n {botSender && (\n <>\n {lang('ViaBot')}\n \n {renderText(`@${botSender.username}`)}\n \n \n )}\n {forwardInfo?.isLinkedChannelPost ? (\n {lang('DiscussChannel')}\n ) : message.adminTitle && !isChannel ? (\n {message.adminTitle}\n ) : undefined}\n
\n );\n }\n\n return (\n \n \n {!isLocal && !isInDocumentGroup && (\n
\n {isSelected && }\n
\n )}\n {!isLocal && isLastInDocumentGroup && (\n \n {isGroupSelected && (\n \n )}\n \n )}\n {withAvatar && renderAvatar()}\n \n \n {asForwarded && !customShape && (!isInDocumentGroup || isFirstInDocumentGroup) && (\n
{lang('ForwardedMessage')}
\n )}\n {renderContent()}\n {(!isInDocumentGroup || isLastInDocumentGroup) && !(!webPage && !animatedEmoji && textParts) && (\n \n )}\n {canShowActionButton && canForward ? (\n \n \n \n ) : canShowActionButton && canFocus ? (\n \n \n \n ) : undefined}\n {withCommentButton && }\n {withAppendix &&
}\n
\n {message.inlineButtons && (\n \n )}\n \n {contextMenuPosition && (\n \n )}\n \n );\n};\n\nfunction handleDocumentGroupMouseEnter(e: React.MouseEvent) {\n const lastGroupElement = getLastElementInDocumentGroup(e.currentTarget);\n if (lastGroupElement) {\n lastGroupElement.setAttribute(GROUP_MESSAGE_HOVER_ATTRIBUTE, '');\n }\n}\n\nfunction handleDocumentGroupMouseLeave(e: React.MouseEvent) {\n const lastGroupElement = getLastElementInDocumentGroup(e.currentTarget);\n if (lastGroupElement) {\n lastGroupElement.removeAttribute(GROUP_MESSAGE_HOVER_ATTRIBUTE);\n }\n}\n\nfunction getLastElementInDocumentGroup(element: Element) {\n let current: Element | null = element;\n\n do {\n current = current.nextElementSibling;\n } while (current && !current.classList.contains('last-in-document-group'));\n\n return current;\n}\n\nexport default memo(withGlobal(\n (global, ownProps): StateProps => {\n const { focusedMessage, forwardMessages, lastSyncTime } = global;\n const {\n message, album, withSenderName, withAvatar, threadId, messageListType,\n } = ownProps;\n const {\n id, chatId, viaBotId, replyToMessageId, isOutgoing,\n } = message;\n\n const chat = selectChat(global, chatId);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const isChannel = chat && isChatChannel(chat);\n const chatUsername = chat?.username;\n\n const forceSenderName = !isChatWithSelf && isAnonymousOwnMessage(message);\n const canShowSender = withSenderName || withAvatar || forceSenderName;\n const sender = canShowSender ? selectSender(global, message) : undefined;\n const originSender = selectForwardedSender(global, message);\n const botSender = viaBotId ? selectUser(global, viaBotId) : undefined;\n\n const threadTopMessageId = threadId ? selectThreadTopMessageId(global, chatId, threadId) : undefined;\n const isThreadTop = message.id === threadTopMessageId;\n\n const shouldHideReply = replyToMessageId === threadTopMessageId;\n const replyMessage = replyToMessageId && !shouldHideReply\n ? selectChatMessage(global, chatId, replyToMessageId)\n : undefined;\n const replyMessageSender = replyMessage && selectSender(global, replyMessage);\n\n const uploadProgress = selectUploadProgress(global, message);\n const isFocused = messageListType === 'thread' && (\n album\n ? album.messages.some((m) => selectIsMessageFocused(global, m))\n : selectIsMessageFocused(global, message)\n );\n\n const {\n direction: focusDirection, noHighlight: noFocusHighlight, isResizingContainer,\n } = (isFocused && focusedMessage) || {};\n\n const isForwarding = forwardMessages.messageIds && forwardMessages.messageIds.includes(id);\n\n const { query: highlight } = selectCurrentTextSearch(global) || {};\n\n const singleEmoji = getMessageSingleEmoji(message);\n let isSelected: boolean;\n\n if (album?.messages) {\n isSelected = album.messages.every(({ id: messageId }) => selectIsMessageSelected(global, messageId));\n } else {\n isSelected = selectIsMessageSelected(global, id);\n }\n\n const { canReply } = (messageListType === 'thread' && selectAllowedMessageActions(global, message, threadId)) || {};\n\n return {\n theme: selectTheme(global),\n chatUsername,\n forceSenderName,\n sender,\n originSender,\n botSender,\n shouldHideReply,\n isThreadTop,\n replyMessage,\n replyMessageSender,\n isFocused,\n isForwarding,\n isChatWithSelf,\n isChannel,\n canReply,\n lastSyncTime,\n highlight,\n isSingleEmoji: Boolean(singleEmoji),\n animatedEmoji: singleEmoji ? selectAnimatedEmoji(global, singleEmoji) : undefined,\n isInSelectMode: selectIsInSelectMode(global),\n isSelected,\n isGroupSelected: (\n !!message.groupedId && !message.isInAlbum && selectIsDocumentGroupSelected(global, chatId, message.groupedId)\n ),\n threadId,\n isPinnedList: messageListType === 'pinned',\n shouldAutoLoadMedia: chat ? selectShouldAutoLoadMedia(global, message, chat, sender) : undefined,\n shouldAutoPlayMedia: selectShouldAutoPlayMedia(global, message),\n shouldLoopStickers: selectShouldLoopStickers(global),\n ...(isOutgoing && { outgoingStatus: selectOutgoingStatus(global, message, messageListType === 'scheduled') }),\n ...(typeof uploadProgress === 'number' && { uploadProgress }),\n ...(isFocused && { focusDirection, noFocusHighlight, isResizingContainer }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'toggleMessageSelection',\n 'clickInlineButton',\n 'disableContextMenuHint',\n ]),\n)(Message));\n","import { RefObject } from 'react';\nimport React, { useEffect } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\n\nimport { IS_ANDROID, IS_TOUCH_ENV } from '../../../../util/environment';\nimport windowSize from '../../../../util/windowSize';\nimport { captureEvents, SwipeDirection } from '../../../../util/captureEvents';\nimport useFlag from '../../../../hooks/useFlag';\nimport { preventMessageInputBlur } from '../../helpers/preventMessageInputBlur';\n\nconst ANDROID_KEYBOARD_HIDE_DELAY_MS = 350;\nconst SWIPE_ANIMATION_DURATION = 150;\n\nexport default function useOuterHandlers(\n selectMessage: (e?: React.MouseEvent, groupedId?: string) => void,\n containerRef: RefObject,\n messageId: number,\n isLocal: boolean,\n isAlbum: boolean,\n isInSelectMode: boolean,\n canReply: boolean,\n onContextMenu: (e: React.MouseEvent) => void,\n handleBeforeContextMenu: (e: React.MouseEvent) => void,\n) {\n const { setReplyingToId } = getDispatch();\n\n const [isSwiped, markSwiped, unmarkSwiped] = useFlag();\n\n function handleMouseDown(e: React.MouseEvent) {\n preventMessageInputBlur(e);\n\n if (!isLocal) {\n handleBeforeContextMenu(e);\n }\n }\n\n function handleClick(e: React.MouseEvent) {\n if (isInSelectMode && !isLocal) {\n selectMessage(e);\n } else if (IS_ANDROID) {\n const target = e.target as HTMLDivElement;\n if (!target.classList.contains('text-content') && !target.classList.contains('Message')) {\n return;\n }\n\n if (windowSize.getIsKeyboardVisible()) {\n setTimeout(() => {\n onContextMenu(e);\n }, ANDROID_KEYBOARD_HIDE_DELAY_MS);\n } else {\n onContextMenu(e);\n }\n }\n }\n\n function handleContextMenu(e: React.MouseEvent) {\n if (IS_ANDROID) {\n if ((e.target as HTMLElement).matches('a[href]')) {\n return;\n }\n\n e.preventDefault();\n selectMessage();\n } else {\n onContextMenu(e);\n }\n }\n\n function handleContainerDoubleClick() {\n setReplyingToId({ messageId });\n }\n\n function stopPropagation(e: React.MouseEvent) {\n e.stopPropagation();\n }\n\n useEffect(() => {\n if (!IS_TOUCH_ENV || isInSelectMode || !canReply) {\n return undefined;\n }\n\n let startedAt: number | undefined;\n return captureEvents(containerRef.current!, {\n selectorToPreventScroll: '.MessageList',\n onSwipe: ((e, direction) => {\n if (direction === SwipeDirection.Left) {\n if (!startedAt) {\n startedAt = Date.now();\n }\n\n markSwiped();\n\n return true;\n }\n\n return false;\n }),\n onRelease: () => {\n if (!startedAt) {\n return;\n }\n\n setReplyingToId({ messageId });\n\n setTimeout(unmarkSwiped, Math.max(0, SWIPE_ANIMATION_DURATION - (Date.now() - startedAt)));\n startedAt = undefined;\n },\n });\n }, [containerRef, isInSelectMode, messageId, setReplyingToId, markSwiped, unmarkSwiped, canReply]);\n\n return {\n handleMouseDown: !isInSelectMode ? handleMouseDown : undefined,\n handleClick,\n handleContextMenu: !isInSelectMode && !isLocal ? handleContextMenu : undefined,\n handleDoubleClick: !isInSelectMode ? handleContainerDoubleClick : undefined,\n handleContentDoubleClick: !IS_TOUCH_ENV ? stopPropagation : undefined,\n isSwiped,\n };\n}\n","import React, { useCallback } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\n\nimport { isChatPrivate } from '../../../../modules/helpers';\nimport { IAlbum, MediaViewerOrigin } from '../../../../types';\nimport {\n ApiChat, ApiMessage, ApiUser, MAIN_THREAD_ID,\n} from '../../../../api/types';\nimport { LangFn } from '../../../../hooks/useLang';\n\nexport default function useInnerHandlers(\n lang: LangFn,\n selectMessage: (e: React.MouseEvent, groupedId?: string) => void,\n message: ApiMessage,\n chatId: number,\n threadId: number,\n isInDocumentGroup: boolean,\n isScheduled?: boolean,\n album?: IAlbum,\n avatarPeer?: ApiUser | ApiChat,\n senderPeer?: ApiUser | ApiChat,\n botSender?: ApiUser,\n) {\n const {\n openUserInfo, openChat, showNotification, focusMessage, openMediaViewer, openAudioPlayer,\n markMessagesRead, cancelSendingMessage, sendPollVote, openForwardMenu,\n } = getDispatch();\n\n const {\n id: messageId, forwardInfo, replyToMessageId, groupedId,\n } = message;\n\n const handleAvatarClick = useCallback(() => {\n if (!avatarPeer) {\n return;\n }\n\n if (isChatPrivate(avatarPeer.id)) {\n openUserInfo({ id: avatarPeer.id });\n } else {\n openChat({ id: avatarPeer.id });\n }\n }, [avatarPeer, openUserInfo, openChat]);\n\n const handleSenderClick = useCallback(() => {\n if (!senderPeer) {\n showNotification({ message: lang('HidAccount') });\n\n return;\n }\n\n if (isChatPrivate(senderPeer.id)) {\n openUserInfo({ id: senderPeer.id });\n } else {\n openChat({ id: senderPeer.id });\n }\n }, [senderPeer, showNotification, lang, openUserInfo, openChat]);\n\n const handleViaBotClick = useCallback(() => {\n if (!botSender) {\n return;\n }\n\n openUserInfo({ id: botSender.id });\n }, [botSender, openUserInfo]);\n\n const handleReplyClick = useCallback((): void => {\n focusMessage({\n chatId, threadId, messageId: replyToMessageId, replyMessageId: messageId,\n });\n }, [focusMessage, chatId, threadId, replyToMessageId, messageId]);\n\n const handleMediaClick = useCallback((): void => {\n openMediaViewer({\n chatId, threadId, messageId, origin: isScheduled ? MediaViewerOrigin.ScheduledInline : MediaViewerOrigin.Inline,\n });\n }, [chatId, threadId, messageId, openMediaViewer, isScheduled]);\n\n const handleAudioPlay = useCallback((): void => {\n openAudioPlayer({ chatId, messageId });\n }, [chatId, messageId, openAudioPlayer]);\n\n const handleAlbumMediaClick = useCallback((albumMessageId: number): void => {\n openMediaViewer({\n chatId,\n threadId,\n messageId: albumMessageId,\n origin: isScheduled ? MediaViewerOrigin.ScheduledAlbum : MediaViewerOrigin.Album,\n });\n }, [chatId, threadId, openMediaViewer, isScheduled]);\n\n const handleReadMedia = useCallback((): void => {\n markMessagesRead({ messageIds: [messageId] });\n }, [messageId, markMessagesRead]);\n\n const handleCancelUpload = useCallback(() => {\n cancelSendingMessage({ chatId, messageId });\n }, [cancelSendingMessage, chatId, messageId]);\n\n const handleVoteSend = useCallback((options: string[]) => {\n sendPollVote({ chatId, messageId, options });\n }, [chatId, messageId, sendPollVote]);\n\n const handleGroupForward = useCallback(() => {\n openForwardMenu({ fromChatId: chatId, groupedId });\n }, [openForwardMenu, chatId, groupedId]);\n\n const handleForward = useCallback(() => {\n if (album && album.messages) {\n const messageIds = album.messages.map(({ id }) => id);\n openForwardMenu({ fromChatId: chatId, messageIds });\n } else {\n openForwardMenu({ fromChatId: chatId, messageIds: [messageId] });\n }\n }, [album, openForwardMenu, chatId, messageId]);\n\n const handleFocus = useCallback(() => {\n focusMessage({\n chatId, threadId: MAIN_THREAD_ID, messageId,\n });\n }, [focusMessage, chatId, messageId]);\n\n const handleFocusForwarded = useCallback(() => {\n if (isInDocumentGroup) {\n focusMessage({\n chatId: forwardInfo!.fromChatId, groupedId, groupedChatId: chatId,\n });\n return;\n }\n focusMessage({\n chatId: forwardInfo!.fromChatId, messageId: forwardInfo!.fromMessageId,\n });\n }, [isInDocumentGroup, focusMessage, forwardInfo, groupedId, chatId]);\n\n const selectWithGroupedId = useCallback((e: React.MouseEvent) => {\n e.stopPropagation();\n\n selectMessage(e, groupedId);\n }, [selectMessage, groupedId]);\n\n return {\n handleAvatarClick,\n handleSenderClick,\n handleViaBotClick,\n handleReplyClick,\n handleMediaClick,\n handleAudioPlay,\n handleAlbumMediaClick,\n handleMetaClick: selectWithGroupedId,\n handleReadMedia,\n handleCancelUpload,\n handleVoteSend,\n handleGroupForward,\n handleForward,\n handleFocus,\n handleFocusForwarded,\n handleDocumentGroupSelectAll: selectWithGroupedId,\n };\n}\n","import { RefObject } from 'react';\nimport React, { FC, memo } from '../../lib/teact/teact';\n\nimport { MessageListType } from '../../global/types';\n\nimport { SCHEDULED_WHEN_ONLINE } from '../../config';\nimport buildClassName from '../../util/buildClassName';\nimport { compact, flatten } from '../../util/iteratees';\nimport { formatHumanDate } from '../../util/dateFormat';\nimport { getMessageOriginalId, isActionMessage, isOwnMessage } from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport { isAlbum, MessageDateGroup } from './helpers/groupMessages';\nimport { preventMessageInputBlur } from './helpers/preventMessageInputBlur';\nimport useScrollHooks from './hooks/useScrollHooks';\nimport useMessageObservers from './hooks/useMessageObservers';\n\nimport Message from './message/Message';\nimport ActionMessage from './ActionMessage';\n\ninterface OwnProps {\n messageIds: number[];\n messageGroups: MessageDateGroup[];\n isViewportNewest: boolean;\n isUnread: boolean;\n withUsers: boolean;\n noAvatars: boolean;\n containerRef: RefObject;\n anchorIdRef: { current: string | undefined };\n memoUnreadDividerBeforeIdRef: { current: number | undefined };\n memoFirstUnreadIdRef: { current: number | undefined };\n threadId: number;\n type: MessageListType;\n isActive: boolean;\n threadTopMessageId: number | undefined;\n hasLinkedChat: boolean | undefined;\n isSchedule: boolean;\n noAppearanceAnimation: boolean;\n onFabToggle: AnyToVoidFunction;\n onNotchToggle: AnyToVoidFunction;\n openHistoryCalendar: Function;\n}\n\nconst UNREAD_DIVIDER_CLASS = 'unread-divider';\n\nconst MessageListContent: FC = ({\n messageIds,\n messageGroups,\n isViewportNewest,\n isUnread,\n withUsers,\n noAvatars,\n containerRef,\n anchorIdRef,\n memoUnreadDividerBeforeIdRef,\n memoFirstUnreadIdRef,\n threadId,\n type,\n isActive,\n threadTopMessageId,\n hasLinkedChat,\n isSchedule,\n noAppearanceAnimation,\n onFabToggle,\n onNotchToggle,\n openHistoryCalendar,\n}) => {\n const {\n observeIntersectionForMedia,\n observeIntersectionForReading,\n observeIntersectionForAnimatedStickers,\n } = useMessageObservers(type, containerRef, memoFirstUnreadIdRef);\n\n const {\n backwardsTriggerRef,\n forwardsTriggerRef,\n fabTriggerRef,\n } = useScrollHooks(\n type,\n containerRef,\n messageIds,\n isViewportNewest,\n isUnread,\n onFabToggle,\n onNotchToggle,\n isActive,\n );\n\n const lang = useLang();\n\n const unreadDivider = (\n
\n {lang('UnreadMessages')}\n
\n );\n\n const messageCountToAnimate = noAppearanceAnimation ? 0 : messageGroups.reduce((acc, messageGroup) => {\n return acc + flatten(messageGroup.senderGroups).length;\n }, 0);\n let appearanceIndex = 0;\n\n const dateGroups = messageGroups.map((\n dateGroup: MessageDateGroup,\n dateGroupIndex: number,\n dateGroupsArray: MessageDateGroup[],\n ) => {\n const senderGroups = dateGroup.senderGroups.map((\n senderGroup,\n senderGroupIndex,\n senderGroupsArray,\n ) => {\n if (senderGroup.length === 1 && !isAlbum(senderGroup[0]) && isActionMessage(senderGroup[0])) {\n const message = senderGroup[0];\n const isLastInList = (\n senderGroupIndex === senderGroupsArray.length - 1\n && dateGroupIndex === dateGroupsArray.length - 1\n );\n\n return compact([\n message.id === memoUnreadDividerBeforeIdRef.current && unreadDivider,\n ,\n ]);\n }\n\n let currentDocumentGroupId: string | undefined;\n\n return flatten(senderGroup.map((\n messageOrAlbum,\n messageIndex,\n ) => {\n const message = isAlbum(messageOrAlbum) ? messageOrAlbum.mainMessage : messageOrAlbum;\n const album = isAlbum(messageOrAlbum) ? messageOrAlbum : undefined;\n const isOwn = isOwnMessage(message);\n const isMessageAlbum = isAlbum(messageOrAlbum);\n const nextMessage = senderGroup[messageIndex + 1];\n\n if (message.previousLocalId && anchorIdRef.current === `message${message.previousLocalId}`) {\n anchorIdRef.current = `message${message.id}`;\n }\n\n const documentGroupId = !isMessageAlbum && message.groupedId ? message.groupedId : undefined;\n const nextDocumentGroupId = nextMessage && !isAlbum(nextMessage) ? nextMessage.groupedId : undefined;\n\n const position = {\n isFirstInGroup: messageIndex === 0,\n isLastInGroup: messageIndex === senderGroup.length - 1,\n isFirstInDocumentGroup: Boolean(documentGroupId && documentGroupId !== currentDocumentGroupId),\n isLastInDocumentGroup: Boolean(documentGroupId && documentGroupId !== nextDocumentGroupId),\n isLastInList: (\n messageIndex === senderGroup.length - 1\n && senderGroupIndex === senderGroupsArray.length - 1\n && dateGroupIndex === dateGroupsArray.length - 1\n ),\n };\n\n currentDocumentGroupId = documentGroupId;\n\n const originalId = getMessageOriginalId(message);\n // Scheduled messages can have local IDs in the middle of the list,\n // and keys should be ordered, so we prefix it with a date.\n // However, this may lead to issues if server date is not synchronized with the local one.\n const key = type !== 'scheduled' ? originalId : `${message.date}_${originalId}`;\n\n return compact([\n message.id === memoUnreadDividerBeforeIdRef.current && unreadDivider,\n ,\n message.id === threadTopMessageId && (\n
\n {lang('DiscussionStarted')}\n
\n ),\n ]);\n }));\n });\n\n return (\n \n openHistoryCalendar({ selectedAt: dateGroup.datetime }) : undefined}\n >\n \n {isSchedule && dateGroup.originalDate === SCHEDULED_WHEN_ONLINE && (\n lang('MessageScheduledUntilOnline')\n )}\n {isSchedule && dateGroup.originalDate !== SCHEDULED_WHEN_ONLINE && (\n lang('MessageScheduledOn', formatHumanDate(lang, dateGroup.datetime, undefined, true))\n )}\n {!isSchedule && formatHumanDate(lang, dateGroup.datetime)}\n \n \n {flatten(senderGroups)}\n \n );\n });\n\n return (\n
\n
\n {flatten(dateGroups)}\n \n \n
\n );\n};\n\nexport default memo(MessageListContent);\n","import { RefObject } from 'react';\nimport { getDispatch } from '../../../lib/teact/teactn';\nimport { useMemo, useRef } from '../../../lib/teact/teact';\n\nimport { LoadMoreDirection } from '../../../types';\nimport { MessageListType } from '../../../global/types';\n\nimport { debounce } from '../../../util/schedulers';\nimport { useIntersectionObserver, useOnIntersect } from '../../../hooks/useIntersectionObserver';\nimport { LOCAL_MESSAGE_ID_BASE, MESSAGE_LIST_SENSITIVE_AREA } from '../../../config';\nimport resetScroll from '../../../util/resetScroll';\nimport useOnChange from '../../../hooks/useOnChange';\n\nconst FAB_THRESHOLD = 50;\nconst TOOLS_FREEZE_TIMEOUT = 100;\n\nexport default function useScrollHooks(\n type: MessageListType,\n containerRef: RefObject,\n messageIds: number[],\n isViewportNewest: boolean,\n isUnread: boolean,\n onFabToggle: AnyToVoidFunction,\n onNotchToggle: AnyToVoidFunction,\n isActive: boolean,\n) {\n const { loadViewportMessages } = getDispatch();\n\n const [loadMoreBackwards, loadMoreForwards] = useMemo(\n () => (type === 'thread' ? [\n debounce(() => loadViewportMessages({ direction: LoadMoreDirection.Backwards }), 1000, true, false),\n debounce(() => loadViewportMessages({ direction: LoadMoreDirection.Forwards }), 1000, true, false),\n ] : []),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [loadViewportMessages, messageIds],\n );\n\n // eslint-disable-next-line no-null/no-null\n const backwardsTriggerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const forwardsTriggerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const fabTriggerRef = useRef(null);\n\n function toggleScrollTools() {\n if (!isActive) return;\n\n if (!messageIds || !messageIds.length) {\n onFabToggle(false);\n onNotchToggle(false);\n return;\n }\n\n if (!isViewportNewest) {\n onFabToggle(true);\n onNotchToggle(true);\n return;\n }\n\n const { offsetHeight, scrollHeight, scrollTop } = containerRef.current!;\n const scrollBottom = Math.round(scrollHeight - scrollTop - offsetHeight);\n const isNearBottom = scrollBottom <= FAB_THRESHOLD;\n const isAtBottom = scrollBottom <= 0;\n\n onFabToggle(isUnread ? !isAtBottom : !isNearBottom);\n onNotchToggle(!isAtBottom);\n }\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({\n rootRef: containerRef,\n margin: MESSAGE_LIST_SENSITIVE_AREA,\n }, (entries) => {\n if (!loadMoreForwards || !loadMoreBackwards) {\n return;\n }\n\n // Loading history while sending a message can return the same message and cause ambiguity\n const isFirstMessageLocal = messageIds[0] >= LOCAL_MESSAGE_ID_BASE;\n if (isFirstMessageLocal) {\n return;\n }\n\n const triggerEntry = entries.find(({ isIntersecting }) => isIntersecting);\n if (!triggerEntry) {\n return;\n }\n\n const { target } = triggerEntry;\n\n if (target.className === 'backwards-trigger') {\n resetScroll(containerRef.current!);\n loadMoreBackwards();\n } else if (target.className === 'forwards-trigger') {\n resetScroll(containerRef.current!);\n loadMoreForwards();\n }\n });\n\n useOnIntersect(backwardsTriggerRef, observeIntersection);\n useOnIntersect(forwardsTriggerRef, observeIntersection);\n\n const {\n observe: observeIntersectionForFab,\n freeze: freezeForFab,\n unfreeze: unfreezeForFab,\n } = useIntersectionObserver({\n rootRef: containerRef,\n margin: FAB_THRESHOLD,\n }, toggleScrollTools);\n\n useOnIntersect(fabTriggerRef, observeIntersectionForFab);\n\n const {\n observe: observeIntersectionForNotch,\n freeze: freezeForNotch,\n unfreeze: unfreezeForNotch,\n } = useIntersectionObserver({\n rootRef: containerRef,\n }, toggleScrollTools);\n\n useOnIntersect(fabTriggerRef, observeIntersectionForNotch);\n\n // Workaround for FAB and notch flickering with tall incoming message\n useOnChange(() => {\n freezeForFab();\n freezeForNotch();\n\n setTimeout(() => {\n unfreezeForNotch();\n unfreezeForFab();\n }, TOOLS_FREEZE_TIMEOUT);\n }, [messageIds]);\n\n return { backwardsTriggerRef, forwardsTriggerRef, fabTriggerRef };\n}\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiSticker, ApiUpdateConnectionStateType } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport { selectChat } from '../../modules/selectors';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\n\nimport StickerButton from '../common/StickerButton';\n\nimport './ContactGreeting.scss';\n\ntype OwnProps = {\n userId: number;\n};\n\ntype StateProps = {\n sticker?: ApiSticker;\n lastUnreadMessageId?: number;\n connectionState?: ApiUpdateConnectionStateType;\n};\n\ntype DispatchProps = Pick;\n\nconst INTERSECTION_DEBOUNCE_MS = 200;\n\nconst ContactGreeting: FC = ({\n sticker,\n connectionState,\n lastUnreadMessageId,\n loadGreetingStickers,\n sendMessage,\n markMessageListRead,\n}) => {\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({\n rootRef: containerRef,\n debounceMs: INTERSECTION_DEBOUNCE_MS,\n });\n useEffect(() => {\n if (sticker || connectionState !== 'connectionStateReady') {\n return;\n }\n\n loadGreetingStickers();\n }, [connectionState, loadGreetingStickers, sticker]);\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady' && lastUnreadMessageId) {\n markMessageListRead({ maxId: lastUnreadMessageId });\n }\n }, [connectionState, markMessageListRead, lastUnreadMessageId]);\n\n const handleStickerSelect = useCallback((selectedSticker: ApiSticker) => {\n selectedSticker = {\n ...selectedSticker,\n isPreloadedGlobally: true,\n };\n sendMessage({ sticker: selectedSticker });\n }, [sendMessage]);\n\n return (\n
\n
\n

{lang('Conversation.EmptyPlaceholder')}

\n

{lang('Conversation.GreetingText')}

\n\n
\n {sticker && (\n \n )}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { userId }): StateProps => {\n const { stickers } = global.stickers.greeting;\n const sticker = stickers?.length ? stickers[userId % stickers.length] : undefined;\n const chat = selectChat(global, userId);\n if (!chat) {\n return {};\n }\n\n return {\n sticker,\n lastUnreadMessageId: chat.lastMessage && chat.lastMessage.id !== chat.lastReadInboxMessageId\n ? chat.lastMessage.id\n : undefined,\n connectionState: global.connectionState,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadGreetingStickers', 'sendMessage', 'markMessageListRead',\n ]),\n\n)(ContactGreeting));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport { MessageListType } from '../../global/types';\n\nimport useLang, { LangFn } from '../../hooks/useLang';\n\nimport './NoMessages.scss';\n\ntype OwnProps = {\n chatId: number;\n isChatWithSelf?: boolean;\n type: MessageListType;\n isGroupChatJustCreated?: boolean;\n};\n\nconst NoMessages: FC = ({\n isChatWithSelf, type, isGroupChatJustCreated,\n}) => {\n const lang = useLang();\n\n if (type === 'scheduled') {\n return renderScheduled(lang);\n }\n\n if (isChatWithSelf) {\n return renderSavedMessages(lang);\n }\n\n if (isGroupChatJustCreated) {\n return renderGroup(lang);\n }\n\n return (\n
{lang('NoMessages')}
\n );\n};\n\nfunction renderScheduled(lang: LangFn) {\n return (\n
{lang('ScheduledMessages.EmptyPlaceholder')}
\n );\n}\n\nfunction renderSavedMessages(lang: LangFn) {\n return (\n
\n
\n \n

{lang('Conversation.CloudStorageInfo.Title')}

\n
    \n
  • {lang('Conversation.ClousStorageInfo.Description1')}
  • \n
  • {lang('Conversation.ClousStorageInfo.Description2')}
  • \n
  • {lang('Conversation.ClousStorageInfo.Description3')}
  • \n
  • {lang('Conversation.ClousStorageInfo.Description4')}
  • \n
\n
\n
\n );\n}\n\nfunction renderGroup(lang: LangFn) {\n return (\n
\n
\n

{lang('EmptyGroupInfo.Title')}

\n

{lang('EmptyGroupInfo.Subtitle')}

\n
    \n
  • {lang('EmptyGroupInfo.Line1')}
  • \n
  • {lang('EmptyGroupInfo.Line2')}
  • \n
  • {lang('EmptyGroupInfo.Line3')}
  • \n
  • {lang('EmptyGroupInfo.Line4')}
  • \n
\n
\n
\n );\n}\n\nexport default memo(NoMessages);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiMessage, ApiRestrictionReason, MAIN_THREAD_ID,\n} from '../../api/types';\nimport { GlobalActions, MessageListType } from '../../global/types';\nimport { LoadMoreDirection } from '../../types';\n\nimport { ANIMATION_END_DELAY, LOCAL_MESSAGE_ID_BASE, MESSAGE_LIST_SLICE } from '../../config';\nimport {\n selectChatMessages,\n selectIsViewportNewest,\n selectFirstUnreadId,\n selectFocusedMessageId,\n selectChat,\n selectIsInSelectMode,\n selectIsChatWithSelf,\n selectChatBot,\n selectIsChatBotNotStarted,\n selectScrollOffset,\n selectThreadTopMessageId,\n selectFirstMessageId,\n selectScheduledMessages,\n selectCurrentMessageIds,\n} from '../../modules/selectors';\nimport { isChatChannel, isChatGroup, isChatPrivate } from '../../modules/helpers';\nimport { orderBy, pick } from '../../util/iteratees';\nimport { fastRaf, debounce, onTickEnd } from '../../util/schedulers';\nimport useLayoutEffectWithPrevDeps from '../../hooks/useLayoutEffectWithPrevDeps';\nimport useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';\nimport buildClassName from '../../util/buildClassName';\nimport { groupMessages } from './helpers/groupMessages';\nimport { preventMessageInputBlur } from './helpers/preventMessageInputBlur';\nimport useOnChange from '../../hooks/useOnChange';\nimport useStickyDates from './hooks/useStickyDates';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport resetScroll from '../../util/resetScroll';\nimport fastSmoothScroll, { isAnimatingScroll } from '../../util/fastSmoothScroll';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport useWindowSize from '../../hooks/useWindowSize';\n\nimport Loading from '../ui/Loading';\nimport MessageListContent from './MessageListContent';\nimport ContactGreeting from './ContactGreeting';\nimport NoMessages from './NoMessages';\n\nimport './MessageList.scss';\n\ntype OwnProps = {\n chatId: number;\n threadId: number;\n type: MessageListType;\n canPost: boolean;\n isReady: boolean;\n isActive: boolean;\n onFabToggle: (shouldShow: boolean) => void;\n onNotchToggle: (shouldShow: boolean) => void;\n hasTools?: boolean;\n};\n\ntype StateProps = {\n isChatLoaded?: boolean;\n isChannelChat?: boolean;\n isGroupChat?: boolean;\n isChatWithSelf?: boolean;\n isCreator?: boolean;\n isBot?: boolean;\n messageIds?: number[];\n messagesById?: Record;\n firstUnreadId?: number;\n isViewportNewest?: boolean;\n isRestricted?: boolean;\n restrictionReason?: ApiRestrictionReason;\n focusingId?: number;\n isSelectModeActive?: boolean;\n animationLevel?: number;\n lastMessage?: ApiMessage;\n botDescription?: string;\n threadTopMessageId?: number;\n threadFirstMessageId?: number;\n hasLinkedChat?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst BOTTOM_THRESHOLD = 20;\nconst UNREAD_DIVIDER_TOP = 10;\nconst UNREAD_DIVIDER_TOP_WITH_TOOLS = 60;\nconst SCROLL_DEBOUNCE = 200;\nconst FOCUSING_DURATION = 1000;\nconst BOTTOM_FOCUS_MARGIN = 20;\nconst SELECT_MODE_ANIMATION_DURATION = 200;\nconst UNREAD_DIVIDER_CLASS = 'unread-divider';\n\nconst runDebouncedForScroll = debounce((cb) => cb(), SCROLL_DEBOUNCE, false);\n\nconst MessageList: FC = ({\n chatId,\n threadId,\n type,\n hasTools,\n onFabToggle,\n onNotchToggle,\n isChatLoaded,\n isChannelChat,\n isGroupChat,\n canPost,\n isReady,\n isActive,\n isChatWithSelf,\n isCreator,\n isBot,\n messageIds,\n messagesById,\n firstUnreadId,\n isViewportNewest,\n threadFirstMessageId,\n isRestricted,\n restrictionReason,\n focusingId,\n isSelectModeActive,\n loadViewportMessages,\n setScrollOffset,\n lastMessage,\n botDescription,\n threadTopMessageId,\n hasLinkedChat,\n openHistoryCalendar,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n // We update local cached `scrollOffsetRef` when opening chat.\n // Then we update global version every second on scrolling.\n const scrollOffsetRef = useRef((type === 'thread' && selectScrollOffset(getGlobal(), chatId, threadId)) || 0);\n const anchorIdRef = useRef();\n const anchorTopRef = useRef();\n const listItemElementsRef = useRef();\n const memoFirstUnreadIdRef = useRef();\n const memoUnreadDividerBeforeIdRef = useRef();\n const memoFocusingIdRef = useRef();\n const isScrollTopJustUpdatedRef = useRef(false);\n const shouldAnimateAppearanceRef = useRef(Boolean(lastMessage));\n\n const [containerHeight, setContainerHeight] = useState();\n\n const areMessagesLoaded = Boolean(messageIds);\n\n useOnChange(() => {\n // We only need it first time when message list appears\n if (areMessagesLoaded) {\n onTickEnd(() => {\n shouldAnimateAppearanceRef.current = false;\n });\n }\n }, [areMessagesLoaded]);\n\n // Updated every time (to be used from intersection callback closure)\n useOnChange(() => {\n memoFirstUnreadIdRef.current = firstUnreadId;\n }, [firstUnreadId]);\n\n // Updated only once when messages are loaded (as we want the unread divider to keep its position)\n useOnChange(() => {\n if (areMessagesLoaded) {\n memoUnreadDividerBeforeIdRef.current = memoFirstUnreadIdRef.current;\n }\n }, [areMessagesLoaded]);\n\n useOnChange(() => {\n memoFocusingIdRef.current = focusingId;\n }, [focusingId]);\n\n const messageGroups = useMemo(() => {\n if (!messageIds || !messagesById) {\n return undefined;\n }\n\n const viewportIds = threadTopMessageId && (!messageIds[0] || threadFirstMessageId === messageIds[0])\n ? [threadTopMessageId, ...messageIds]\n : messageIds;\n\n if (!viewportIds.length) {\n return undefined;\n }\n\n const listedMessages = viewportIds.map((id) => messagesById[id]).filter(Boolean);\n return groupMessages(orderBy(listedMessages, ['date', 'id']), memoUnreadDividerBeforeIdRef.current);\n }, [messageIds, messagesById, threadFirstMessageId, threadTopMessageId]);\n\n const loadMoreAround = useMemo(() => {\n if (type !== 'thread') {\n return undefined;\n }\n\n return debounce(() => loadViewportMessages({ direction: LoadMoreDirection.Around }), 1000, true, false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [loadViewportMessages, messageIds]);\n\n const { isScrolled, updateStickyDates } = useStickyDates();\n\n const handleScroll = useCallback(() => {\n if (isScrollTopJustUpdatedRef.current) {\n isScrollTopJustUpdatedRef.current = false;\n return;\n }\n\n const container = containerRef.current!;\n\n if (!memoFocusingIdRef.current) {\n updateStickyDates(container, hasTools);\n }\n\n runDebouncedForScroll(() => {\n fastRaf(() => {\n if (!container.parentElement) {\n return;\n }\n\n scrollOffsetRef.current = container.scrollHeight - container.scrollTop;\n\n if (type === 'thread') {\n setScrollOffset({ chatId, threadId, scrollOffset: scrollOffsetRef.current });\n }\n });\n });\n }, [updateStickyDates, hasTools, type, setScrollOffset, chatId, threadId]);\n\n // Container resize observer (caused by Composer reply/webpage panels)\n useEffect(() => {\n if (!('ResizeObserver' in window) || process.env.APP_ENV === 'perf') {\n return undefined;\n }\n\n const observer = new ResizeObserver(([entry]) => {\n // During animation\n if (!(entry.target as HTMLDivElement).offsetParent) {\n return;\n }\n\n setContainerHeight(entry.contentRect.height);\n });\n\n observer.observe(containerRef.current!);\n\n return () => {\n observer.disconnect();\n };\n }, []);\n\n // Memorize height for scroll animation\n const { height: windowHeight } = useWindowSize();\n\n useEffect(() => {\n if (isReady) {\n containerRef.current!.dataset.normalHeight = String(containerRef.current!.offsetHeight);\n }\n }, [windowHeight, isReady, canPost]);\n\n // Initial message loading\n useEffect(() => {\n if (!loadMoreAround || !isChatLoaded || isRestricted || focusingId) {\n return;\n }\n\n // Loading history while sending a message can return the same message and cause ambiguity\n const isFirstMessageLocal = messageIds && messageIds[0] >= LOCAL_MESSAGE_ID_BASE;\n if (isFirstMessageLocal) {\n return;\n }\n\n const container = containerRef.current!;\n\n if (!messageIds || (\n messageIds.length < MESSAGE_LIST_SLICE / 2\n && (container.firstElementChild as HTMLDivElement).clientHeight <= container.offsetHeight\n )) {\n loadMoreAround();\n }\n }, [isChatLoaded, messageIds, loadMoreAround, focusingId, isRestricted]);\n\n // Remember scroll position before repositioning it\n useOnChange(() => {\n if (!messageIds || !listItemElementsRef.current || !isReady) {\n return;\n }\n\n const preservedItemElements = listItemElementsRef.current\n .filter((element) => messageIds.includes(Number(element.dataset.messageId)));\n\n // We avoid the very first item as it may be a partly-loaded album\n // and also because it may be removed when messages limit is reached\n const anchor = preservedItemElements[1] || preservedItemElements[0];\n if (!anchor) {\n return;\n }\n\n anchorIdRef.current = anchor.id;\n anchorTopRef.current = anchor.getBoundingClientRect().top;\n // This should match deps for `useLayoutEffectWithPrevDeps` below\n }, [messageIds, isViewportNewest, containerHeight, hasTools, isReady]);\n\n // Handles updated message list, takes care of scroll repositioning\n useLayoutEffectWithPrevDeps(([\n prevMessageIds, prevIsViewportNewest, prevContainerHeight,\n ]: [\n typeof messageIds, typeof isViewportNewest, typeof containerHeight,\n ]) => {\n const container = containerRef.current!;\n listItemElementsRef.current = Array.from(container.querySelectorAll('.message-list-item'));\n\n // During animation\n if (!container.offsetParent) {\n return;\n }\n\n // Add extra height when few messages to allow smooth scroll animation. Uses assumption that `parentElement`\n // is a Transition slide and its CSS class can not be reset in a declarative way.\n const shouldForceScroll = (\n isViewportNewest\n && (messageIds && messageIds.length < MESSAGE_LIST_SLICE / 2)\n && !container.parentElement!.classList.contains('force-messages-scroll')\n && (container.firstElementChild as HTMLDivElement)!.clientHeight <= container.offsetHeight * 2\n );\n\n if (shouldForceScroll) {\n container.parentElement!.classList.add('force-messages-scroll');\n\n setTimeout(() => {\n if (container.parentElement) {\n container.parentElement.classList.remove('force-messages-scroll');\n }\n }, FOCUSING_DURATION);\n }\n\n const hasLastMessageChanged = (\n messageIds && prevMessageIds && messageIds[messageIds.length - 1] !== prevMessageIds[prevMessageIds.length - 1]\n );\n const hasViewportShifted = (\n messageIds?.[0] !== prevMessageIds?.[0] && messageIds?.length === (MESSAGE_LIST_SLICE / 2 + 1)\n );\n const wasMessageAdded = hasLastMessageChanged && !hasViewportShifted;\n const isAlreadyFocusing = messageIds && memoFocusingIdRef.current === messageIds[messageIds.length - 1];\n\n const { scrollTop, scrollHeight, offsetHeight } = container;\n const scrollOffset = scrollOffsetRef.current!;\n const lastItemElement = listItemElementsRef.current[listItemElementsRef.current.length - 1];\n\n let bottomOffset = scrollOffset - (prevContainerHeight || offsetHeight);\n if (wasMessageAdded) {\n // If two new messages come at once (e.g. when bot responds) then the first message will update `scrollOffset`\n // right away (before animation) which creates inconsistency until the animation completes. To workaround that,\n // we calculate `isAtBottom` with a \"buffer\" of the latest message height (this is approximate).\n const lastItemHeight = lastItemElement ? lastItemElement.offsetHeight : 0;\n bottomOffset -= lastItemHeight;\n }\n const isAtBottom = isViewportNewest && prevIsViewportNewest && bottomOffset <= BOTTOM_THRESHOLD;\n\n let newScrollTop!: number;\n\n if (wasMessageAdded && isAtBottom && !isAlreadyFocusing) {\n if (lastItemElement) {\n fastRaf(() => {\n fastSmoothScroll(\n container,\n lastItemElement,\n 'end',\n BOTTOM_FOCUS_MARGIN,\n );\n });\n }\n\n newScrollTop = scrollHeight - offsetHeight;\n scrollOffsetRef.current = Math.max(scrollHeight - newScrollTop, offsetHeight);\n\n // Scroll still needs to be restored after container resize\n if (!shouldForceScroll) {\n return;\n }\n }\n\n if (process.env.APP_ENV === 'perf') {\n // eslint-disable-next-line no-console\n console.time('scrollTop');\n }\n\n const isResized = prevContainerHeight !== undefined && prevContainerHeight !== containerHeight;\n const anchor = anchorIdRef.current && container.querySelector(`#${anchorIdRef.current}`);\n const unreadDivider = (\n !anchor\n && memoUnreadDividerBeforeIdRef.current\n && container.querySelector(`.${UNREAD_DIVIDER_CLASS}`)\n );\n\n if (isAtBottom && isResized) {\n if (isAnimatingScroll()) {\n return;\n }\n\n newScrollTop = scrollHeight - offsetHeight;\n } else if (anchor) {\n const newAnchorTop = anchor.getBoundingClientRect().top;\n newScrollTop = scrollTop + (newAnchorTop - (anchorTopRef.current || 0));\n } else if (unreadDivider) {\n newScrollTop = Math.min(\n unreadDivider.offsetTop - (hasTools ? UNREAD_DIVIDER_TOP_WITH_TOOLS : UNREAD_DIVIDER_TOP),\n scrollHeight - scrollOffset,\n );\n } else {\n newScrollTop = scrollHeight - scrollOffset;\n }\n\n resetScroll(container, newScrollTop);\n\n if (!memoFocusingIdRef.current) {\n isScrollTopJustUpdatedRef.current = true;\n fastRaf(() => {\n isScrollTopJustUpdatedRef.current = false;\n });\n }\n\n scrollOffsetRef.current = Math.max(scrollHeight - newScrollTop, offsetHeight);\n\n if (process.env.APP_ENV === 'perf') {\n // eslint-disable-next-line no-console\n console.timeEnd('scrollTop');\n }\n // This should match deps for `useOnChange` above\n }, [messageIds, isViewportNewest, containerHeight, hasTools]);\n\n useEffectWithPrevDeps(([prevIsSelectModeActive]) => {\n if (prevIsSelectModeActive !== undefined) {\n dispatchHeavyAnimationEvent(SELECT_MODE_ANIMATION_DURATION + ANIMATION_END_DELAY);\n }\n }, [isSelectModeActive]);\n\n const lang = useLang();\n\n const isPrivate = Boolean(chatId && isChatPrivate(chatId));\n const withUsers = Boolean((!isPrivate && !isChannelChat) || isChatWithSelf);\n const noAvatars = Boolean(!withUsers || isChannelChat);\n const shouldRenderGreeting = isChatPrivate(chatId) && !isChatWithSelf && !isBot\n && (\n (\n !messageGroups && !lastMessage && messageIds\n // Used to avoid flickering when deleting a greeting that has just been sent\n && (!listItemElementsRef.current || listItemElementsRef.current.length === 0)\n )\n || (messageIds?.length === 1 && messagesById?.[messageIds[0]]?.content.action?.type === 'contactSignUp')\n || (lastMessage?.content?.action?.type === 'contactSignUp')\n );\n\n const isGroupChatJustCreated = isGroupChat && isCreator\n && messageIds?.length === 1 && messagesById?.[messageIds[0]]?.content.action?.type === 'chatCreate';\n\n const className = buildClassName(\n 'MessageList custom-scroll',\n noAvatars && 'no-avatars',\n !canPost && 'no-composer',\n type === 'pinned' && 'type-pinned',\n isSelectModeActive && 'select-mode-active',\n isScrolled && 'scrolled',\n !isReady && 'is-animating',\n );\n\n return (\n \n {isRestricted ? (\n
\n \n {restrictionReason ? restrictionReason.text : `This is a private ${isChannelChat ? 'channel' : 'chat'}`}\n \n
\n ) : botDescription ? (\n
{renderText(lang(botDescription), ['br', 'emoji', 'links'])}
\n ) : shouldRenderGreeting ? (\n \n ) : messageIds && (!messageGroups || isGroupChatJustCreated) ? (\n \n ) : ((messageIds && messageGroups) || lastMessage) ? (\n \n ) : (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId, type }): StateProps => {\n const chat = selectChat(global, chatId);\n if (!chat) {\n return {};\n }\n\n const messageIds = selectCurrentMessageIds(global, chatId, threadId, type);\n const messagesById = type === 'scheduled'\n ? selectScheduledMessages(global, chatId)\n : selectChatMessages(global, chatId);\n const threadTopMessageId = selectThreadTopMessageId(global, chatId, threadId);\n\n if (\n threadId !== MAIN_THREAD_ID\n && !(messagesById && threadTopMessageId && messagesById[threadTopMessageId])\n ) {\n return {};\n }\n\n const { isRestricted, restrictionReason, lastMessage } = chat;\n const focusingId = selectFocusedMessageId(global, chatId);\n\n const withLastMessageWhenPreloading = (\n threadId === MAIN_THREAD_ID\n && !messageIds && !chat.unreadCount && !focusingId && lastMessage && !lastMessage.groupedId\n );\n\n const chatBot = selectChatBot(global, chatId)!;\n let botDescription: string | undefined;\n if (selectIsChatBotNotStarted(global, chatId)) {\n if (chatBot.fullInfo) {\n botDescription = chatBot.fullInfo.botDescription || 'NoMessages';\n } else {\n botDescription = 'Updating bot info...';\n }\n }\n\n return {\n isChatLoaded: true,\n isRestricted,\n restrictionReason,\n isChannelChat: isChatChannel(chat),\n isGroupChat: isChatGroup(chat),\n isCreator: chat.isCreator,\n isChatWithSelf: selectIsChatWithSelf(global, chatId),\n isBot: Boolean(chatBot),\n messageIds,\n messagesById,\n firstUnreadId: selectFirstUnreadId(global, chatId, threadId),\n isViewportNewest: type !== 'thread' || selectIsViewportNewest(global, chatId, threadId),\n threadFirstMessageId: selectFirstMessageId(global, chatId, threadId),\n focusingId,\n isSelectModeActive: selectIsInSelectMode(global),\n botDescription,\n threadTopMessageId,\n hasLinkedChat: chat.fullInfo && ('linkedChatId' in chat.fullInfo)\n ? Boolean(chat.fullInfo.linkedChatId)\n : undefined,\n ...(withLastMessageWhenPreloading && { lastMessage }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadViewportMessages',\n 'setScrollOffset',\n 'openHistoryCalendar',\n ]),\n)(MessageList));\n","import { useCallback } from '../../../lib/teact/teact';\n\nimport { fastRaf } from '../../../util/schedulers';\nimport useDebounce from '../../../hooks/useDebounce';\nimport useFlag from '../../../hooks/useFlag';\n\nconst DEBOUNCE = 1000;\nconst STICKY_TOP = 10;\nconst STICKY_TOP_WITH_TOOLS = 60;\n\nexport default function useStickyDates() {\n // For some reason we can not synchronously hide a sticky element (from `useLayoutEffect`) when chat opens\n // so we will add `position: sticky` only after first scroll. There would be no animation on the first show though.\n const [isScrolled, markIsScrolled] = useFlag(false);\n\n const runDebounced = useDebounce(DEBOUNCE, false);\n\n const updateStickyDates = useCallback((container: HTMLDivElement, hasTools?: boolean) => {\n markIsScrolled();\n\n if (!document.body.classList.contains('is-scrolling-messages')) {\n fastRaf(() => {\n document.body.classList.add('is-scrolling-messages');\n });\n }\n\n runDebounced(() => {\n fastRaf(() => {\n const currentStuck = document.querySelector('.stuck');\n if (currentStuck) {\n currentStuck.classList.remove('stuck');\n }\n\n const stuckDateEl = findStuckDate(container, hasTools);\n if (stuckDateEl) {\n stuckDateEl.classList.add('stuck');\n }\n\n document.body.classList.remove('is-scrolling-messages');\n });\n });\n }, [markIsScrolled, runDebounced]);\n\n return {\n isScrolled,\n updateStickyDates,\n };\n}\n\nfunction findStuckDate(container: HTMLElement, hasTools?: boolean) {\n const allElements = container.querySelectorAll('.sticky-date');\n const containerTop = container.scrollTop;\n\n return Array.from(allElements).find((el) => {\n const { offsetTop, offsetHeight } = el;\n const top = offsetTop - containerTop;\n return -offsetHeight <= top && top <= (hasTools ? STICKY_TOP_WITH_TOOLS : STICKY_TOP);\n });\n}\n","import { useMemo } from '../lib/teact/teact';\n\nimport { debounce } from '../util/schedulers';\n\nexport default function useDebounce(ms: number, shouldRunFirst?: boolean, shouldRunLast?: boolean) {\n return useMemo(() => {\n return debounce((cb) => cb(), ms, shouldRunFirst, shouldRunLast);\n }, [ms, shouldRunFirst, shouldRunLast]);\n}\n","import React, {\n FC, useCallback, memo, useRef,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, MessageListType } from '../../global/types';\nimport { MAIN_THREAD_ID } from '../../api/types';\n\nimport { selectChat, selectCurrentMessageList } from '../../modules/selectors';\nimport { formatIntegerCompact } from '../../util/textFormat';\nimport buildClassName from '../../util/buildClassName';\nimport { pick } from '../../util/iteratees';\nimport fastSmoothScroll from '../../util/fastSmoothScroll';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\n\nimport './ScrollDownButton.scss';\n\ntype OwnProps = {\n isShown: boolean;\n canPost?: boolean;\n};\n\ntype StateProps = {\n messageListType?: MessageListType;\n unreadCount?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst FOCUS_MARGIN = 20;\n\nconst ScrollDownButton: FC = ({\n isShown,\n canPost,\n messageListType,\n unreadCount,\n focusNextReply,\n}) => {\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const elementRef = useRef(null);\n\n const handleClick = useCallback(() => {\n if (!isShown) {\n return;\n }\n\n if (messageListType === 'thread') {\n focusNextReply();\n } else {\n const messagesContainer = elementRef.current!.parentElement!.querySelector('.MessageList')!;\n const messageElements = messagesContainer.querySelectorAll('.message-list-item');\n const lastMessageElement = messageElements[messageElements.length - 1];\n if (!lastMessageElement) {\n return;\n }\n\n fastSmoothScroll(messagesContainer, lastMessageElement, 'end', FOCUS_MARGIN);\n }\n }, [isShown, messageListType, focusNextReply]);\n\n const fabClassName = buildClassName(\n 'ScrollDownButton',\n isShown && 'revealed',\n !canPost && 'no-composer',\n );\n\n return (\n
\n
\n \n \n \n {Boolean(unreadCount) && (\n
{formatIntegerCompact(unreadCount!)}
\n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return {};\n }\n\n const { chatId, threadId, type: messageListType } = currentMessageList;\n const chat = selectChat(global, chatId);\n\n return {\n messageListType,\n unreadCount: chat && threadId === MAIN_THREAD_ID && messageListType === 'thread' ? chat.unreadCount : undefined,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['focusNextReply']),\n)(ScrollDownButton));\n","import { ApiAttachment } from '../../../../api/types';\nimport { preloadImage, preloadVideo, createPosterForVideo } from '../../../../util/files';\n\nconst MAX_QUICK_VIDEO_SIZE = 10 * 1024 ** 2; // 10 MB\nconst MAX_QUICK_IMG_SIZE = 1280; // px\n\nexport default async function buildAttachment(\n filename: string, blob: Blob, isQuick: boolean, options?: Partial,\n): Promise {\n const blobUrl = URL.createObjectURL(blob);\n const { type: mimeType, size } = blob;\n let quick;\n let previewBlobUrl;\n\n if (mimeType.startsWith('image/')) {\n if (isQuick) {\n const img = await preloadImage(blobUrl);\n const { width, height } = img;\n\n if (width > MAX_QUICK_IMG_SIZE || height > MAX_QUICK_IMG_SIZE || mimeType !== 'image/jpeg') {\n const newBlob = await squeezeImage(img);\n if (newBlob) {\n URL.revokeObjectURL(blobUrl);\n return buildAttachment(filename, newBlob, true, options);\n } else {\n return buildAttachment(filename, blob, false, options);\n }\n }\n\n quick = { width, height };\n } else {\n previewBlobUrl = blobUrl;\n }\n } else if (mimeType.startsWith('video/')) {\n // Videos < 10 MB are always sent in quick mode (in other clients).\n // Quick mode for videos > 10 MB is not supported until client-side video squeezing is implemented.\n if (size < MAX_QUICK_VIDEO_SIZE) {\n const { videoWidth: width, videoHeight: height, duration } = await preloadVideo(blobUrl);\n quick = { width, height, duration };\n }\n\n previewBlobUrl = await createPosterForVideo(blobUrl);\n }\n\n return {\n blobUrl,\n filename,\n mimeType,\n size,\n quick,\n previewBlobUrl,\n ...options,\n };\n}\n\nfunction squeezeImage(img: HTMLImageElement): Promise {\n return new Promise((resolve) => {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d')!;\n\n let { width, height } = img;\n\n if (width > MAX_QUICK_IMG_SIZE || height > MAX_QUICK_IMG_SIZE) {\n if (width >= height) {\n height *= MAX_QUICK_IMG_SIZE / width;\n width = MAX_QUICK_IMG_SIZE;\n } else {\n width *= MAX_QUICK_IMG_SIZE / height;\n height = MAX_QUICK_IMG_SIZE;\n }\n }\n\n canvas.width = width;\n canvas.height = height;\n\n ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, width, height);\n canvas.toBlob(resolve, 'image/jpeg', 100);\n });\n}\n","import { IS_IOS } from '../../../../util/environment';\n\nlet resetInput: HTMLInputElement;\n\nif (IS_IOS) {\n resetInput = document.createElement('input');\n resetInput.classList.add('for-ios-autocapitalization-fix');\n document.body.appendChild(resetInput);\n}\n\n// https://stackoverflow.com/a/55652503\nexport default function applyIosAutoCapitalizationFix(inputEl: HTMLElement) {\n resetInput.focus();\n inputEl.focus();\n}\n","export default __webpack_public_path__ + \"c0155344d336103c2b6a0b28cc510750.js\";","// @ts-ignore\nimport encoderPath from 'file-loader!opus-recorder/dist/encoderWorker.min';\n\nexport type Result = { blob: Blob; duration: number; waveform: number[] };\n\ninterface IOpusRecorder extends Omit {\n new(options: AnyLiteral): IOpusRecorder;\n\n start(stream?: MediaStreamAudioSourceNode): void;\n\n sourceNode: MediaStreamAudioSourceNode;\n\n ondataavailable: (typedArray: Uint8Array) => void;\n}\n\nconst MIN_RECORDING_TIME = 1000;\nconst POLYFILL_OPTIONS = { encoderPath, reuseWorker: true };\nconst BLOB_PARAMS = { type: 'audio/ogg' };\nconst FFT_SIZE = 64;\nconst MIN_VOLUME = 0.1;\n\nlet opusRecorderPromise: Promise<{ default: IOpusRecorder }>;\nlet OpusRecorder: IOpusRecorder;\nlet mediaRecorder: IOpusRecorder;\n\nexport async function init() {\n if (!opusRecorderPromise) {\n // @ts-ignore\n opusRecorderPromise = import('opus-recorder');\n OpusRecorder = (await opusRecorderPromise).default;\n mediaRecorder = new OpusRecorder(POLYFILL_OPTIONS);\n }\n\n return opusRecorderPromise;\n}\n\nexport async function start(analyzerCallback: Function) {\n await startMediaRecorder();\n\n const startedAt = Date.now();\n let pausedAt: number;\n const chunks: Uint8Array[] = [];\n const waveform: number[] = [];\n\n mediaRecorder.ondataavailable = (typedArray) => {\n chunks.push(typedArray);\n };\n\n const releaseAnalyzer = subscribeToAnalyzer(mediaRecorder, (volume: number) => {\n waveform.push(volume * 255);\n analyzerCallback(volume);\n });\n\n return {\n stop: () => new Promise((resolve, reject) => {\n mediaRecorder.onstop = () => {\n resolve({\n blob: new Blob(chunks, BLOB_PARAMS),\n duration: Math.round(((pausedAt || Date.now()) - startedAt) / 1000),\n waveform,\n });\n };\n mediaRecorder.onerror = reject;\n\n const delayStop = Math.max(0, startedAt + MIN_RECORDING_TIME - Date.now());\n setTimeout(() => {\n mediaRecorder.stop();\n releaseAnalyzer();\n }, delayStop);\n }),\n pause: () => {\n const delayStop = Math.max(0, startedAt + MIN_RECORDING_TIME - Date.now());\n setTimeout(() => {\n mediaRecorder.pause();\n pausedAt = Date.now();\n releaseAnalyzer();\n }, delayStop);\n },\n };\n}\n\nasync function startMediaRecorder() {\n await init();\n await mediaRecorder.start();\n}\n\nfunction subscribeToAnalyzer(recorder: IOpusRecorder, cb: Function) {\n const source = recorder.sourceNode;\n const analyser = source.context.createAnalyser();\n analyser.fftSize = FFT_SIZE;\n source.connect(analyser);\n\n const dataLength = analyser.frequencyBinCount;\n const dataArray = new Uint8Array(dataLength);\n let isDestroyed = false;\n\n function tick() {\n if (isDestroyed) {\n return;\n }\n\n analyser.getByteFrequencyData(dataArray);\n\n const sum = dataArray.reduce((acc, current) => acc + current, 0);\n const mean = (sum / dataLength);\n const volume = mean / 255;\n\n cb(volume < MIN_VOLUME ? 0 : volume);\n\n requestAnimationFrame(tick);\n }\n\n tick();\n\n return () => {\n isDestroyed = true;\n };\n}\n","import {\n useCallback, useEffect, useRef, useState,\n} from '../../../../lib/teact/teact';\n\nimport { IS_IOS, IS_VOICE_RECORDING_SUPPORTED } from '../../../../util/environment';\nimport * as voiceRecording from '../../../../util/voiceRecording';\nimport captureEscKeyListener from '../../../../util/captureEscKeyListener';\n\ntype ActiveVoiceRecording = { stop: () => Promise; pause: NoneToVoidFunction } | undefined;\n\nexport default () => {\n // eslint-disable-next-line no-null/no-null\n const recordButtonRef = useRef(null);\n const [activeVoiceRecording, setActiveVoiceRecording] = useState();\n const startRecordTimeRef = useRef();\n const [currentRecordTime, setCurrentRecordTime] = useState();\n\n useEffect(() => {\n // Preloading worker fixes silent first record on iOS\n if (IS_IOS && IS_VOICE_RECORDING_SUPPORTED) {\n void voiceRecording.init();\n }\n }, []);\n\n const startRecordingVoice = useCallback(async () => {\n try {\n const { stop, pause } = await voiceRecording.start((tickVolume: number) => {\n if (recordButtonRef.current) {\n if (startRecordTimeRef.current && Date.now() % 4 === 0) {\n recordButtonRef.current.style.boxShadow = `0 0 0 ${(tickVolume || 0) * 50}px rgba(0,0,0,.15)`;\n }\n setCurrentRecordTime(Date.now());\n }\n });\n startRecordTimeRef.current = Date.now();\n setCurrentRecordTime(Date.now());\n\n setActiveVoiceRecording({ stop, pause });\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n }, []);\n\n const pauseRecordingVoice = useCallback(() => {\n if (!activeVoiceRecording) {\n return undefined;\n }\n\n if (recordButtonRef.current) {\n recordButtonRef.current.style.boxShadow = 'none';\n }\n\n try {\n return activeVoiceRecording!.pause();\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n return undefined;\n }\n }, [activeVoiceRecording]);\n\n const stopRecordingVoice = useCallback(() => {\n if (!activeVoiceRecording) {\n return undefined;\n }\n\n setActiveVoiceRecording(undefined);\n startRecordTimeRef.current = undefined;\n setCurrentRecordTime(undefined);\n if (recordButtonRef.current) {\n recordButtonRef.current.style.boxShadow = 'none';\n }\n try {\n return activeVoiceRecording!.stop();\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n return undefined;\n }\n }, [activeVoiceRecording]);\n\n useEffect(() => {\n return activeVoiceRecording ? captureEscKeyListener(stopRecordingVoice) : undefined;\n }, [activeVoiceRecording, stopRecordingVoice]);\n\n return {\n startRecordingVoice,\n pauseRecordingVoice,\n stopRecordingVoice,\n activeVoiceRecording,\n currentRecordTime,\n recordButtonRef,\n startRecordTimeRef,\n };\n};\n","import { StateHookSetter, useEffect } from '../../../../lib/teact/teact';\nimport { ApiAttachment, ApiMessage } from '../../../../api/types';\n\nimport buildAttachment from '../helpers/buildAttachment';\nimport { EDITABLE_INPUT_ID, EDITABLE_INPUT_MODAL_ID } from '../../../../config';\n\nconst CLIPBOARD_ACCEPTED_TYPES = ['image/png', 'image/jpeg', 'image/gif'];\nconst MAX_MESSAGE_LENGTH = 4096;\n\nexport default (\n insertTextAndUpdateCursor: (text: string, inputId?: string) => void,\n setAttachments: StateHookSetter,\n editedMessage: ApiMessage | undefined,\n) => {\n useEffect(() => {\n async function handlePaste(e: ClipboardEvent) {\n if (!e.clipboardData) {\n return;\n }\n\n const input = document.activeElement;\n if (input && ![EDITABLE_INPUT_ID, EDITABLE_INPUT_MODAL_ID].includes(input.id)) {\n return;\n }\n\n const { items } = e.clipboardData;\n const media = Array.from(items).find((item) => CLIPBOARD_ACCEPTED_TYPES.includes(item.type));\n const file = media && media.getAsFile();\n const pastedText = e.clipboardData.getData('text').substring(0, MAX_MESSAGE_LENGTH);\n\n if (!file && !pastedText) {\n return;\n }\n\n e.preventDefault();\n\n if (file && !editedMessage) {\n const attachment = await buildAttachment(file.name, file, true);\n setAttachments((attachments) => [\n ...attachments,\n attachment,\n ]);\n }\n\n if (pastedText) {\n insertTextAndUpdateCursor(pastedText, input?.id);\n }\n }\n\n document.addEventListener('paste', handlePaste, false);\n\n return () => {\n document.removeEventListener('paste', handlePaste, false);\n };\n }, [insertTextAndUpdateCursor, editedMessage, setAttachments]);\n};\n","import { ApiFormattedText } from '../../../../api/types';\nimport { renderTextWithEntities } from '../../../common/helpers/renderMessageText';\n\nexport default function getMessageTextAsHtml(formattedText?: ApiFormattedText) {\n const { text, entities } = formattedText || {};\n if (!text) {\n return '';\n }\n\n const result = renderTextWithEntities(\n text,\n entities,\n undefined,\n undefined,\n true,\n );\n\n if (Array.isArray(result)) {\n return result.join('');\n }\n\n return result;\n}\n","import { useCallback, useEffect, useMemo } from '../../../../lib/teact/teact';\n\nimport { ApiFormattedText, ApiMessage } from '../../../../api/types';\nimport { GlobalActions } from '../../../../global/types';\n\nimport { DRAFT_DEBOUNCE, EDITABLE_INPUT_ID } from '../../../../config';\nimport usePrevious from '../../../../hooks/usePrevious';\nimport { debounce } from '../../../../util/schedulers';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport parseMessageInput from '../helpers/parseMessageInput';\nimport getMessageTextAsHtml from '../helpers/getMessageTextAsHtml';\nimport useBackgroundMode from '../../../../hooks/useBackgroundMode';\nimport useBeforeUnload from '../../../../hooks/useBeforeUnload';\nimport { IS_TOUCH_ENV } from '../../../../util/environment';\n\n// Used to avoid running debounced callbacks when chat changes.\nlet currentChatId: number | undefined;\nlet currentThreadId: number | undefined;\n\nexport default (\n draft: ApiFormattedText | undefined,\n chatId: number,\n threadId: number,\n html: string,\n htmlRef: { current: string },\n setHtml: (html: string) => void,\n editedMessage: ApiMessage | undefined,\n saveDraft: GlobalActions['saveDraft'],\n clearDraft: GlobalActions['clearDraft'],\n) => {\n const updateDraft = useCallback((draftChatId: number, draftThreadId: number) => {\n if (htmlRef.current.length && !editedMessage) {\n saveDraft({ chatId: draftChatId, threadId: draftThreadId, draft: parseMessageInput(htmlRef.current!) });\n } else {\n clearDraft({ chatId: draftChatId, threadId: draftThreadId });\n }\n }, [clearDraft, editedMessage, htmlRef, saveDraft]);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const runDebouncedForSaveDraft = useMemo(() => debounce((cb) => cb(), DRAFT_DEBOUNCE, false), [chatId]);\n\n const prevChatId = usePrevious(chatId);\n const prevThreadId = usePrevious(threadId);\n\n // Save draft on chat change\n useEffect(() => {\n currentChatId = chatId;\n currentThreadId = threadId;\n\n return () => {\n currentChatId = undefined;\n currentThreadId = undefined;\n\n updateDraft(chatId, threadId);\n };\n }, [chatId, threadId, updateDraft]);\n\n // Restore draft on chat change\n useEffect(() => {\n if (chatId === prevChatId && threadId === prevThreadId) {\n return;\n }\n\n if (!draft) {\n return;\n }\n\n setHtml(getMessageTextAsHtml(draft));\n\n if (!IS_TOUCH_ENV) {\n requestAnimationFrame(() => {\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n focusEditableElement(messageInput, true);\n });\n }\n }, [chatId, threadId, draft, setHtml, updateDraft, prevChatId, prevThreadId]);\n\n // Update draft when input changes\n const prevHtml = usePrevious(html);\n useEffect(() => {\n if (!chatId || !threadId || prevChatId !== chatId || prevThreadId !== threadId || prevHtml === html) {\n return;\n }\n\n if (html.length) {\n runDebouncedForSaveDraft(() => {\n if (currentChatId !== chatId || currentThreadId !== threadId) {\n return;\n }\n\n updateDraft(chatId, threadId);\n });\n } else {\n updateDraft(chatId, threadId);\n }\n }, [chatId, html, prevChatId, prevHtml, prevThreadId, runDebouncedForSaveDraft, threadId, updateDraft]);\n\n const handleBlur = useCallback(() => {\n if (chatId && threadId) {\n updateDraft(chatId, threadId);\n }\n }, [chatId, threadId, updateDraft]);\n\n useBackgroundMode(handleBlur);\n useBeforeUnload(handleBlur);\n};\n","import { useCallback, useEffect } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\nimport { InlineBotSettings } from '../../../../types';\nimport useFlag from '../../../../hooks/useFlag';\nimport usePrevious from '../../../../hooks/usePrevious';\n\nconst tempEl = document.createElement('div');\nconst INLINE_BOT_QUERY_REGEXP = /^@([a-z0-9_]{1,32})[\\u00A0\\u0020]+(.*)/i;\nconst HAS_NEW_LINE = /^@([a-z0-9_]{1,32})[\\u00A0\\u0020]+\\n{2,}/i;\n\nexport default function useInlineBotTooltip(\n isAllowed: boolean,\n chatId: number,\n html: string,\n inlineBots?: Record,\n) {\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n const text = getPlainText(html);\n const { queryInlineBot, resetInlineBot } = getDispatch();\n const { username, query, canShowHelp } = parseStartWithUsernameString(text);\n const usernameLowered = username.toLowerCase();\n const prevQuery = usePrevious(query);\n const prevUsername = usePrevious(username);\n const inlineBotData = inlineBots?.[usernameLowered];\n const {\n id: botId,\n switchPm,\n offset,\n results,\n isGallery,\n help,\n } = inlineBotData || {};\n\n useEffect(() => {\n if (prevQuery !== query) {\n unmarkIsOpen();\n }\n }, [prevQuery, query, unmarkIsOpen]);\n\n useEffect(() => {\n if (isAllowed && usernameLowered && chatId) {\n queryInlineBot({ chatId, username: usernameLowered, query });\n }\n }, [query, isAllowed, queryInlineBot, chatId, usernameLowered]);\n\n const loadMore = useCallback(() => {\n queryInlineBot({\n chatId, username: usernameLowered, query, offset,\n });\n }, [offset, chatId, query, queryInlineBot, usernameLowered]);\n\n useEffect(() => {\n if (isAllowed && botId && (switchPm || (results?.length))) {\n markIsOpen();\n } else {\n unmarkIsOpen();\n }\n }, [botId, isAllowed, markIsOpen, results, switchPm, unmarkIsOpen]);\n\n if (prevUsername !== username) {\n resetInlineBot({ username: prevUsername });\n }\n\n return {\n isOpen,\n closeTooltip: unmarkIsOpen,\n loadMore,\n username,\n id: botId,\n isGallery,\n switchPm,\n results,\n help: canShowHelp && help ? `@${username} ${help}` : undefined,\n };\n}\n\nfunction getPlainText(html: string) {\n tempEl.innerHTML = html.replace(/
/g, '\\n');\n\n return tempEl.innerText;\n}\n\nfunction parseStartWithUsernameString(text: string) {\n const result = text.match(INLINE_BOT_QUERY_REGEXP);\n if (!result) {\n return { username: '', query: '', canShowHelp: false };\n }\n\n return {\n username: result[1],\n query: result[2],\n canShowHelp: result[2] === '' && !text.match(HAS_NEW_LINE),\n };\n}\n","import {\n useCallback, useEffect, useState,\n} from '../../../../lib/teact/teact';\n\nimport { ApiBotCommand } from '../../../../api/types';\n\nimport { throttle } from '../../../../util/schedulers';\nimport useFlag from '../../../../hooks/useFlag';\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\nconst RE_COMMAND = /[\\w\\d_-]*/i;\n\nexport default function useBotCommandTooltip(\n isAllowed: boolean,\n html: string,\n botCommands?: ApiBotCommand[] | false,\n chatBotCommands?: ApiBotCommand[],\n) {\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n const [filteredBotCommands, setFilteredBotCommands] = useState();\n\n const getFilteredCommands = useCallback((filter) => {\n if (!botCommands && !chatBotCommands) {\n setFilteredBotCommands(undefined);\n\n return;\n }\n\n runThrottled(() => {\n const nextFilteredBotCommands = (botCommands || chatBotCommands || [])\n .filter(({ command }) => !filter || command.includes(filter));\n setFilteredBotCommands(\n nextFilteredBotCommands && nextFilteredBotCommands.length ? nextFilteredBotCommands : undefined,\n );\n });\n }, [botCommands, chatBotCommands]);\n\n useEffect(() => {\n if (!isAllowed || !html.length) {\n unmarkIsOpen();\n return;\n }\n\n const shouldShowCommands = html.startsWith('/');\n\n if (shouldShowCommands) {\n const filter = html.substr(1).match(RE_COMMAND);\n getFilteredCommands(filter ? filter[0] : '');\n } else {\n unmarkIsOpen();\n }\n }, [getFilteredCommands, html, isAllowed, unmarkIsOpen]);\n\n useEffect(() => {\n if (filteredBotCommands && filteredBotCommands.length) {\n markIsOpen();\n } else {\n unmarkIsOpen();\n }\n }, [filteredBotCommands, markIsOpen, unmarkIsOpen]);\n\n return {\n isOpen,\n close: unmarkIsOpen,\n filteredBotCommands,\n };\n}\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './DeleteMessageModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst DeleteMessageModalAsync: FC = (props) => {\n const { isOpen } = props;\n const DeleteMessageModal = useModuleLoader(Bundles.Extra, 'DeleteMessageModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return DeleteMessageModal ? : undefined;\n};\n\nexport default memo(DeleteMessageModalAsync);\n","import React, {\n FC, useRef, useCallback, memo,\n} from '../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\n\nimport Button, { OwnProps as ButtonProps } from './Button';\n\ntype OwnProps = {\n onActivate: NoneToVoidFunction;\n} & Omit;\n\nconst BUTTON_ACTIVATE_DELAY = 200;\nlet openTimeout: number | undefined;\nlet isFirstTimeActivation = true;\n\nconst ResponsiveHoverButton: FC = ({ onActivate, ...buttonProps }) => {\n const isMouseInside = useRef(false);\n\n const handleMouseEnter = useCallback(() => {\n isMouseInside.current = true;\n\n // This is used to counter additional delay caused by asynchronous module loading\n if (isFirstTimeActivation) {\n isFirstTimeActivation = false;\n onActivate();\n return;\n }\n\n if (openTimeout) {\n clearTimeout(openTimeout);\n openTimeout = undefined;\n }\n openTimeout = window.setTimeout(() => {\n if (isMouseInside.current) {\n onActivate();\n }\n }, BUTTON_ACTIVATE_DELAY);\n }, [onActivate]);\n\n const handleMouseLeave = useCallback(() => {\n isMouseInside.current = false;\n }, []);\n\n return (\n \n );\n};\n\nexport default memo(ResponsiveHoverButton);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './AttachMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst AttachMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const AttachMenu = useModuleLoader(Bundles.Extra, 'AttachMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return AttachMenu ? : undefined;\n};\n\nexport default memo(AttachMenuAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './SymbolMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst SymbolMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const SymbolMenu = useModuleLoader(Bundles.Extra, 'SymbolMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return SymbolMenu ? : undefined;\n};\n\nexport default memo(SymbolMenuAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './InlineBotTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst InlineBotTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const InlineBotTooltip = useModuleLoader(Bundles.Extra, 'InlineBotTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return InlineBotTooltip ? : undefined;\n};\n\nexport default memo(InlineBotTooltipAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './MentionTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst MentionTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const MentionTooltip = useModuleLoader(Bundles.Extra, 'MentionTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return MentionTooltip ? : undefined;\n};\n\nexport default memo(MentionTooltipAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './CustomSendMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst CustomSendMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const CustomSend = useModuleLoader(Bundles.Extra, 'CustomSendMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return CustomSend ? : undefined;\n};\n\nexport default memo(CustomSendMenuAsync);\n","import React, { FC } from '../../../lib/teact/teact';\nimport { OwnProps } from './StickerTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst StickerTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const StickerTooltip = useModuleLoader(Bundles.Extra, 'StickerTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return StickerTooltip ? : undefined;\n};\n\nexport default StickerTooltipAsync;\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './BotCommandTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst BotCommandTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const BotCommandTooltip = useModuleLoader(Bundles.Extra, 'BotCommandTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return BotCommandTooltip ? : undefined;\n};\n\nexport default memo(BotCommandTooltipAsync);\n","import React, { FC, memo, useEffect } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiMessage } from '../../../api/types';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\nimport { selectChatMessage, selectCurrentMessageList } from '../../../modules/selectors';\nimport useMouseInside from '../../../hooks/useMouseInside';\nimport useFlag from '../../../hooks/useFlag';\n\nimport Menu from '../../ui/Menu';\nimport Button from '../../ui/Button';\n\nimport './BotKeyboardMenu.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n messageId: number;\n onClose: NoneToVoidFunction;\n};\n\ntype StateProps = {\n message?: ApiMessage;\n};\n\ntype DispatchProps = Pick;\n\nconst BotKeyboardMenu: FC = ({\n isOpen, message, onClose, clickInlineButton,\n}) => {\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose);\n const { isKeyboardSingleUse } = message || {};\n const [forceOpen, markForceOpen, unmarkForceOpen] = useFlag(true);\n\n const handleClose = () => {\n unmarkForceOpen();\n onClose();\n };\n\n useEffect(() => {\n markForceOpen();\n }, [markForceOpen, message]);\n\n if (!message || !message.keyboardButtons) {\n return undefined;\n }\n\n return (\n \n
\n {message.keyboardButtons.map((row) => (\n
\n {row.map((button) => (\n clickInlineButton({ button })}\n >\n {button.text}\n \n ))}\n
\n ))}\n
\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { messageId }): StateProps => {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return {};\n }\n\n return { message: selectChatMessage(global, chatId, messageId) };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'clickInlineButton',\n ]),\n)(BotKeyboardMenu));\n","import React, {\n FC, memo, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiMessage, ApiUser } from '../../../api/types';\n\nimport {\n selectChat,\n selectChatMessage,\n selectSender,\n selectForwardedSender,\n selectUser,\n selectCurrentMessageList,\n selectReplyingToId,\n selectEditingId,\n selectEditingScheduledId,\n selectEditingMessage,\n} from '../../../modules/selectors';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport { pick } from '../../../util/iteratees';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\nimport { isChatPrivate } from '../../../modules/helpers';\n\nimport Button from '../../ui/Button';\nimport EmbeddedMessage from '../../common/EmbeddedMessage';\n\nimport './ComposerEmbeddedMessage.scss';\n\ntype StateProps = {\n replyingToId?: number;\n editingId?: number;\n message?: ApiMessage;\n sender?: ApiUser | ApiChat;\n shouldAnimate?: boolean;\n forwardedMessagesCount?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst FORWARD_RENDERING_DELAY = 300;\n\nconst ComposerEmbeddedMessage: FC = ({\n replyingToId,\n editingId,\n message,\n sender,\n shouldAnimate,\n forwardedMessagesCount,\n setReplyingToId,\n setEditingId,\n focusMessage,\n exitForwardMode,\n}) => {\n const isShown = Boolean(\n ((replyingToId || editingId) && message)\n || (sender && forwardedMessagesCount),\n );\n const canAnimate = useAsyncRendering(\n [forwardedMessagesCount],\n forwardedMessagesCount ? FORWARD_RENDERING_DELAY : undefined,\n );\n\n const {\n shouldRender, transitionClassNames,\n } = useShowTransition(canAnimate && isShown, undefined, !shouldAnimate, undefined, !shouldAnimate);\n\n const clearEmbedded = useCallback(() => {\n if (replyingToId) {\n setReplyingToId({ messageId: undefined });\n } else if (editingId) {\n setEditingId({ messageId: undefined });\n } else if (forwardedMessagesCount) {\n exitForwardMode();\n }\n }, [replyingToId, editingId, forwardedMessagesCount, setReplyingToId, setEditingId, exitForwardMode]);\n\n useEffect(() => (isShown ? captureEscKeyListener(clearEmbedded) : undefined), [isShown, clearEmbedded]);\n\n const handleMessageClick = useCallback((): void => {\n focusMessage({ chatId: message!.chatId, messageId: message!.id });\n }, [focusMessage, message]);\n\n const className = buildClassName('ComposerEmbeddedMessage', transitionClassNames);\n\n const customText = forwardedMessagesCount && forwardedMessagesCount > 1\n ? `${forwardedMessagesCount} forwarded messages`\n : undefined;\n\n if (!shouldRender) {\n return undefined;\n }\n\n return (\n
\n
\n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { chatId, threadId, type: messageListType } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId || !messageListType) {\n return {};\n }\n\n const {\n currentUserId,\n forwardMessages: { fromChatId, toChatId, messageIds: forwardMessageIds },\n } = global;\n\n const replyingToId = selectReplyingToId(global, chatId, threadId);\n const editingId = messageListType === 'scheduled'\n ? selectEditingScheduledId(global, chatId)\n : selectEditingId(global, chatId, threadId);\n const shouldAnimate = global.settings.byKey.animationLevel >= 1;\n const isForwarding = toChatId === chatId;\n\n let message;\n if (replyingToId) {\n message = selectChatMessage(global, chatId, replyingToId);\n } else if (editingId) {\n message = selectEditingMessage(global, chatId, threadId, messageListType);\n } else if (isForwarding && forwardMessageIds!.length === 1) {\n message = selectChatMessage(global, fromChatId!, forwardMessageIds![0]);\n }\n\n let sender: ApiChat | ApiUser | undefined;\n if (replyingToId && message) {\n const { forwardInfo } = message;\n const isChatWithSelf = chatId === currentUserId;\n\n if (forwardInfo && (forwardInfo.isChannelPost || isChatWithSelf)) {\n sender = selectForwardedSender(global, message);\n }\n\n if (!sender) {\n sender = selectSender(global, message);\n }\n } else if (isForwarding) {\n sender = isChatPrivate(fromChatId!) ? selectUser(global, fromChatId!) : selectChat(global, fromChatId!);\n }\n\n return {\n replyingToId,\n editingId,\n message,\n sender,\n shouldAnimate,\n forwardedMessagesCount: isForwarding ? forwardMessageIds!.length : undefined,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setReplyingToId',\n 'setEditingId',\n 'focusMessage',\n 'exitForwardMode',\n ]),\n)(ComposerEmbeddedMessage));\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './AttachmentModal';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst AttachmentModalAsync: FC = (props) => {\n const { attachments } = props;\n const AttachmentModal = useModuleLoader(Bundles.Extra, 'AttachmentModal', !attachments.length);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return AttachmentModal ? : undefined;\n};\n\nexport default memo(AttachmentModalAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './BotCommandMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst BotCommandMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const BotCommandMenu = useModuleLoader(Bundles.Extra, 'BotCommandMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return BotCommandMenu ? : undefined;\n};\n\nexport default memo(BotCommandMenuAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './PollModal';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst PollModalAsync: FC = (props) => {\n const { isOpen } = props;\n const PollModal = useModuleLoader(Bundles.Extra, 'PollModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return PollModal ? : undefined;\n};\n\nexport default memo(PollModalAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './DropArea';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst DropAreaAsync: FC = (props) => {\n const { isOpen } = props;\n const DropArea = useModuleLoader(Bundles.Extra, 'DropArea', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return DropArea ? : undefined;\n};\n\nexport default memo(DropAreaAsync);\nexport { DropAreaState } from './DropArea';\n","import React, {\n FC, memo, useEffect, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiMessage, ApiMessageEntityTypes, ApiWebPage } from '../../../api/types';\n\nimport { RE_LINK_TEMPLATE } from '../../../config';\nimport { selectNoWebPage } from '../../../modules/selectors';\nimport { pick } from '../../../util/iteratees';\nimport parseMessageInput from './helpers/parseMessageInput';\nimport useOnChange from '../../../hooks/useOnChange';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useCurrentOrPrev from '../../../hooks/useCurrentOrPrev';\nimport buildClassName from '../../../util/buildClassName';\n\nimport WebPage from '../message/WebPage';\nimport Button from '../../ui/Button';\n\nimport './WebPagePreview.scss';\n\ntype OwnProps = {\n chatId: number;\n threadId: number;\n messageText: string;\n disabled?: boolean;\n};\n\ntype StateProps = {\n webPagePreview?: ApiWebPage;\n noWebPage?: boolean;\n};\ntype DispatchProps = Pick;\n\nconst RE_LINK = new RegExp(RE_LINK_TEMPLATE, 'i');\n\nconst WebPagePreview: FC = ({\n chatId,\n threadId,\n messageText,\n disabled,\n webPagePreview,\n noWebPage,\n loadWebPagePreview,\n clearWebPagePreview,\n toggleMessageWebPage,\n}) => {\n const link = useMemo(() => {\n const { text, entities } = parseMessageInput(messageText);\n\n const linkEntity = entities && entities.find(({ type }) => type === ApiMessageEntityTypes.TextUrl);\n if (linkEntity) {\n return linkEntity.url;\n }\n\n const textMatch = text.match(RE_LINK);\n if (textMatch) {\n return textMatch[0];\n }\n\n return undefined;\n }, [messageText]);\n\n useEffect(() => {\n if (link) {\n loadWebPagePreview({ text: link });\n } else {\n clearWebPagePreview();\n toggleMessageWebPage({ chatId, threadId });\n }\n }, [chatId, toggleMessageWebPage, clearWebPagePreview, link, loadWebPagePreview, threadId]);\n\n useOnChange(() => {\n clearWebPagePreview();\n toggleMessageWebPage({ chatId, threadId });\n }, [chatId]);\n\n const isShown = Boolean(webPagePreview && messageText.length && !noWebPage && !disabled);\n const { shouldRender, transitionClassNames } = useShowTransition(isShown);\n\n const renderingWebPage = useCurrentOrPrev(webPagePreview);\n\n if (!shouldRender || !renderingWebPage) {\n return undefined;\n }\n\n const handleClearWebpagePreview = () => {\n toggleMessageWebPage({ chatId, threadId, noWebPage: true });\n };\n\n // TODO Refactor so `WebPage` can be used without message\n const { photo, ...webPageWithoutPhoto } = renderingWebPage;\n const messageStub = {\n content: {\n webPage: webPageWithoutPhoto,\n },\n } as ApiMessage;\n\n return (\n
\n
\n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId }): StateProps => {\n const noWebPage = selectNoWebPage(global, chatId, threadId);\n return {\n webPagePreview: global.webPagePreview,\n noWebPage,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadWebPagePreview', 'clearWebPagePreview', 'toggleMessageWebPage',\n ]),\n)(WebPagePreview));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './CalendarModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst CalendarModalAsync: FC = (props) => {\n const { isOpen } = props;\n const CalendarModal = useModuleLoader(Bundles.Extra, 'CalendarModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return CalendarModal ? : undefined;\n};\n\nexport default memo(CalendarModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './PaymentModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst PaymentModalAsync: FC = (props) => {\n const { isOpen } = props;\n const PaymentModal = useModuleLoader(Bundles.Extra, 'PaymentModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return PaymentModal ? : undefined;\n};\n\nexport default memo(PaymentModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './ReceiptModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst ReceiptModalAsync: FC = (props) => {\n const { isOpen } = props;\n const ReceiptModal = useModuleLoader(Bundles.Extra, 'ReceiptModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ReceiptModal ? : undefined;\n};\n\nexport default memo(ReceiptModalAsync);\n","import React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState, MessageListType } from '../../../global/types';\nimport {\n ApiAttachment,\n ApiBotInlineResult,\n ApiBotInlineMediaResult,\n ApiSticker,\n ApiVideo,\n ApiNewPoll,\n ApiMessage,\n ApiFormattedText,\n ApiChat,\n ApiChatMember,\n ApiUser,\n MAIN_THREAD_ID,\n ApiBotCommand,\n} from '../../../api/types';\nimport { InlineBotSettings } from '../../../types';\n\nimport {\n BASE_EMOJI_KEYWORD_LANG, EDITABLE_INPUT_ID, REPLIES_USER_ID, SCHEDULED_WHEN_ONLINE,\n} from '../../../config';\nimport { IS_VOICE_RECORDING_SUPPORTED, IS_SINGLE_COLUMN_LAYOUT, IS_IOS } from '../../../util/environment';\nimport {\n selectChat,\n selectIsRightColumnShown,\n selectIsInSelectMode,\n selectNewestMessageWithBotKeyboardButtons,\n selectDraft,\n selectScheduledIds,\n selectEditingMessage,\n selectIsChatWithSelf,\n selectChatBot,\n selectChatUser,\n selectChatMessage,\n} from '../../../modules/selectors';\nimport {\n getAllowedAttachmentOptions,\n getChatSlowModeOptions,\n isChatPrivate,\n isChatAdmin,\n} from '../../../modules/helpers';\nimport { formatMediaDuration, formatVoiceRecordDuration, getDayStartAt } from '../../../util/dateFormat';\nimport focusEditableElement from '../../../util/focusEditableElement';\nimport parseMessageInput from './helpers/parseMessageInput';\nimport buildAttachment from './helpers/buildAttachment';\nimport renderText from '../../common/helpers/renderText';\nimport insertHtmlInSelection from '../../../util/insertHtmlInSelection';\nimport deleteLastCharacterOutsideSelection from '../../../util/deleteLastCharacterOutsideSelection';\nimport { pick } from '../../../util/iteratees';\nimport buildClassName from '../../../util/buildClassName';\nimport windowSize from '../../../util/windowSize';\nimport { isSelectionInsideInput } from './helpers/selection';\nimport applyIosAutoCapitalizationFix from './helpers/applyIosAutoCapitalizationFix';\nimport { getServerTime } from '../../../util/serverTime';\n\nimport useFlag from '../../../hooks/useFlag';\nimport useVoiceRecording from './hooks/useVoiceRecording';\nimport useClipboardPaste from './hooks/useClipboardPaste';\nimport useDraft from './hooks/useDraft';\nimport useEditing from './hooks/useEditing';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useStickerTooltip from './hooks/useStickerTooltip';\nimport useEmojiTooltip from './hooks/useEmojiTooltip';\nimport useMentionTooltip from './hooks/useMentionTooltip';\nimport useContextMenuHandlers from '../../../hooks/useContextMenuHandlers';\nimport useLang from '../../../hooks/useLang';\nimport useInlineBotTooltip from './hooks/useInlineBotTooltip';\nimport useBotCommandTooltip from './hooks/useBotCommandTooltip';\n\nimport DeleteMessageModal from '../../common/DeleteMessageModal.async';\nimport Button from '../../ui/Button';\nimport ResponsiveHoverButton from '../../ui/ResponsiveHoverButton';\nimport Spinner from '../../ui/Spinner';\nimport AttachMenu from './AttachMenu.async';\nimport SymbolMenu from './SymbolMenu.async';\nimport InlineBotTooltip from './InlineBotTooltip.async';\nimport MentionTooltip from './MentionTooltip.async';\nimport CustomSendMenu from './CustomSendMenu.async';\nimport StickerTooltip from './StickerTooltip.async';\nimport EmojiTooltip from './EmojiTooltip.async';\nimport BotCommandTooltip from './BotCommandTooltip.async';\nimport BotKeyboardMenu from './BotKeyboardMenu';\nimport MessageInput from './MessageInput';\nimport ComposerEmbeddedMessage from './ComposerEmbeddedMessage';\nimport AttachmentModal from './AttachmentModal.async';\nimport BotCommandMenu from './BotCommandMenu.async';\nimport PollModal from './PollModal.async';\nimport DropArea, { DropAreaState } from './DropArea.async';\nimport WebPagePreview from './WebPagePreview';\nimport Portal from '../../ui/Portal';\nimport CalendarModal from '../../common/CalendarModal.async';\nimport PaymentModal from '../../payment/PaymentModal.async';\nimport ReceiptModal from '../../payment/ReceiptModal.async';\n\nimport './Composer.scss';\n\ntype OwnProps = {\n chatId: number;\n threadId: number;\n messageListType: MessageListType;\n dropAreaState: string;\n isReady: boolean;\n onDropHide: NoneToVoidFunction;\n};\n\ntype StateProps = {\n editingMessage?: ApiMessage;\n chat?: ApiChat;\n draft?: ApiFormattedText;\n isChatWithBot?: boolean;\n isChatWithSelf?: boolean;\n isRightColumnShown?: boolean;\n isSelectModeActive?: boolean;\n isForwarding?: boolean;\n isPollModalOpen?: boolean;\n isPaymentModalOpen?: boolean;\n isReceiptModalOpen?: boolean;\n botKeyboardMessageId?: number;\n botKeyboardPlaceholder?: string;\n withScheduledButton?: boolean;\n shouldSchedule?: boolean;\n canScheduleUntilOnline?: boolean;\n stickersForEmoji?: ApiSticker[];\n groupChatMembers?: ApiChatMember[];\n currentUserId?: number;\n usersById?: Record;\n recentEmojis: string[];\n lastSyncTime?: number;\n contentToBeScheduled?: GlobalState['messages']['contentToBeScheduled'];\n shouldSuggestStickers?: boolean;\n baseEmojiKeywords?: Record;\n emojiKeywords?: Record;\n serverTimeOffset: number;\n topInlineBotIds?: number[];\n isInlineBotLoading: boolean;\n inlineBots?: Record;\n botCommands?: ApiBotCommand[] | false;\n chatBotCommands?: ApiBotCommand[];\n} & Pick;\n\ntype DispatchProps = Pick;\n\nenum MainButtonState {\n Send = 'send',\n Record = 'record',\n Edit = 'edit',\n}\n\nconst VOICE_RECORDING_FILENAME = 'wonderful-voice-message.ogg';\n// When voice recording is active, composer placeholder will hide to prevent overlapping\nconst SCREEN_WIDTH_TO_HIDE_PLACEHOLDER = 600; // px\n\nconst MOBILE_KEYBOARD_HIDE_DELAY_MS = 100;\nconst SELECT_MODE_TRANSITION_MS = 200;\nconst MESSAGE_MAX_LENGTH = 4096;\nconst CAPTION_MAX_LENGTH = 1024;\nconst SENDING_ANIMATION_DURATION = 350;\n// eslint-disable-next-line max-len\nconst APPENDIX = '';\n\nconst Composer: FC = ({\n dropAreaState,\n shouldSchedule,\n canScheduleUntilOnline,\n isReady,\n onDropHide,\n editingMessage,\n chatId,\n threadId,\n messageListType,\n draft,\n chat,\n connectionState,\n isChatWithBot,\n isChatWithSelf,\n isRightColumnShown,\n isSelectModeActive,\n isForwarding,\n isPollModalOpen,\n isPaymentModalOpen,\n isReceiptModalOpen,\n botKeyboardMessageId,\n botKeyboardPlaceholder,\n withScheduledButton,\n stickersForEmoji,\n groupChatMembers,\n topInlineBotIds,\n currentUserId,\n usersById,\n lastSyncTime,\n contentToBeScheduled,\n shouldSuggestStickers,\n baseEmojiKeywords,\n emojiKeywords,\n serverTimeOffset,\n recentEmojis,\n inlineBots,\n isInlineBotLoading,\n botCommands,\n chatBotCommands,\n sendMessage,\n editMessage,\n saveDraft,\n clearDraft,\n showDialog,\n setStickerSearchQuery,\n setGifSearchQuery,\n forwardMessages,\n openPollModal,\n closePollModal,\n loadScheduledHistory,\n closePaymentModal,\n openChat,\n clearReceipt,\n addRecentEmoji,\n sendInlineBotResult,\n}) => {\n const lang = useLang();\n\n // eslint-disable-next-line no-null/no-null\n const appendixRef = useRef(null);\n const [html, setHtml] = useState('');\n const lastMessageSendTimeSeconds = useRef();\n const prevDropAreaState = usePrevious(dropAreaState);\n const [isCalendarOpen, openCalendar, closeCalendar] = useFlag();\n const [\n scheduledMessageArgs, setScheduledMessageArgs,\n ] = useState();\n const { width: windowWidth } = windowSize.get();\n\n // Cache for frequently updated state\n const htmlRef = useRef(html);\n useEffect(() => {\n htmlRef.current = html;\n }, [html]);\n\n useEffect(() => {\n lastMessageSendTimeSeconds.current = undefined;\n }, [chatId]);\n\n useEffect(() => {\n if (chatId && lastSyncTime && threadId === MAIN_THREAD_ID && isReady) {\n loadScheduledHistory();\n }\n }, [isReady, chatId, loadScheduledHistory, lastSyncTime, threadId]);\n\n useLayoutEffect(() => {\n if (!appendixRef.current) return;\n\n appendixRef.current.innerHTML = APPENDIX;\n }, []);\n\n useEffect(() => {\n if (contentToBeScheduled) {\n setScheduledMessageArgs(contentToBeScheduled);\n openCalendar();\n }\n }, [contentToBeScheduled, openCalendar]);\n\n const [attachments, setAttachments] = useState([]);\n\n const [isBotKeyboardOpen, openBotKeyboard, closeBotKeyboard] = useFlag();\n const [isBotCommandMenuOpen, openBotCommandMenu, closeBotCommandMenu] = useFlag();\n const [isAttachMenuOpen, openAttachMenu, closeAttachMenu] = useFlag();\n const [isSymbolMenuOpen, openSymbolMenu, closeSymbolMenu] = useFlag();\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n const [isSymbolMenuLoaded, onSymbolMenuLoadingComplete] = useFlag();\n const [isHoverDisabled, disableHover, enableHover] = useFlag();\n\n const {\n startRecordingVoice,\n stopRecordingVoice,\n pauseRecordingVoice,\n activeVoiceRecording,\n currentRecordTime,\n recordButtonRef: mainButtonRef,\n startRecordTimeRef,\n } = useVoiceRecording();\n\n const mainButtonState = editingMessage\n ? MainButtonState.Edit\n : !IS_VOICE_RECORDING_SUPPORTED || activeVoiceRecording || (html && !attachments.length) || isForwarding\n ? MainButtonState.Send\n : MainButtonState.Record;\n const canShowCustomSendMenu = !shouldSchedule;\n\n const {\n isMentionTooltipOpen, closeMentionTooltip, insertMention, mentionFilteredUsers,\n } = useMentionTooltip(\n !attachments.length,\n html,\n setHtml,\n undefined,\n groupChatMembers,\n topInlineBotIds,\n currentUserId,\n usersById,\n );\n\n const {\n isOpen: isInlineBotTooltipOpen,\n id: inlineBotId,\n isGallery: isInlineBotTooltipGallery,\n switchPm: inlineBotSwitchPm,\n results: inlineBotResults,\n closeTooltip: closeInlineBotTooltip,\n help: inlineBotHelp,\n loadMore: loadMoreForInlineBot,\n } = useInlineBotTooltip(\n Boolean(!attachments.length && lastSyncTime),\n chatId,\n html,\n inlineBots,\n );\n\n const {\n isOpen: isBotCommandTooltipOpen,\n close: closeBotCommandTooltip,\n filteredBotCommands: botTooltipCommands,\n } = useBotCommandTooltip(\n Boolean((botCommands && botCommands.length) || (chatBotCommands && chatBotCommands.length)),\n html,\n botCommands,\n chatBotCommands,\n );\n\n const {\n isContextMenuOpen: isCustomSendMenuOpen,\n handleContextMenu,\n handleContextMenuClose,\n handleContextMenuHide,\n } = useContextMenuHandlers(mainButtonRef, !(mainButtonState === MainButtonState.Send && canShowCustomSendMenu));\n\n const allowedAttachmentOptions = useMemo(() => {\n return getAllowedAttachmentOptions(chat, isChatWithBot);\n }, [chat, isChatWithBot]);\n\n const isAdmin = chat && isChatAdmin(chat);\n const slowMode = getChatSlowModeOptions(chat);\n\n const { isStickerTooltipOpen, closeStickerTooltip } = useStickerTooltip(\n Boolean(shouldSuggestStickers && allowedAttachmentOptions.canSendStickers && !attachments.length),\n html,\n stickersForEmoji,\n !isReady,\n );\n const {\n isEmojiTooltipOpen, closeEmojiTooltip, filteredEmojis, insertEmoji,\n } = useEmojiTooltip(\n Boolean(shouldSuggestStickers && allowedAttachmentOptions.canSendStickers && !attachments.length),\n html,\n recentEmojis,\n undefined,\n setHtml,\n baseEmojiKeywords,\n emojiKeywords,\n !isReady,\n );\n\n const insertTextAndUpdateCursor = useCallback((text: string, inputId: string = EDITABLE_INPUT_ID) => {\n const selection = window.getSelection()!;\n const messageInput = document.getElementById(inputId)!;\n const newHtml = renderText(text, ['escape_html', 'emoji_html', 'br_html'])\n .join('')\n .replace(/\\u200b+/g, '\\u200b');\n\n if (selection.rangeCount) {\n const selectionRange = selection.getRangeAt(0);\n if (isSelectionInsideInput(selectionRange, inputId)) {\n insertHtmlInSelection(newHtml);\n messageInput.dispatchEvent(new Event('input', { bubbles: true }));\n return;\n }\n }\n\n setHtml(`${htmlRef.current!}${newHtml}`);\n\n // If selection is outside of input, set cursor at the end of input\n requestAnimationFrame(() => {\n focusEditableElement(messageInput);\n });\n }, []);\n\n const removeSymbol = useCallback(() => {\n const selection = window.getSelection()!;\n\n if (selection.rangeCount) {\n const selectionRange = selection.getRangeAt(0);\n if (isSelectionInsideInput(selectionRange, EDITABLE_INPUT_ID)) {\n document.execCommand('delete', false);\n return;\n }\n }\n\n setHtml(deleteLastCharacterOutsideSelection(htmlRef.current!));\n }, []);\n\n const resetComposer = useCallback((shouldPreserveInput = false) => {\n if (!shouldPreserveInput) {\n setHtml('');\n }\n setAttachments([]);\n closeStickerTooltip();\n closeCalendar();\n setScheduledMessageArgs(undefined);\n closeMentionTooltip();\n closeEmojiTooltip();\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n // @perf\n setTimeout(() => closeSymbolMenu(), SENDING_ANIMATION_DURATION);\n } else {\n closeSymbolMenu();\n }\n }, [closeStickerTooltip, closeCalendar, closeMentionTooltip, closeEmojiTooltip, closeSymbolMenu]);\n\n // Handle chat change (ref is used to avoid redundant effect calls)\n const stopRecordingVoiceRef = useRef();\n stopRecordingVoiceRef.current = stopRecordingVoice;\n useEffect(() => {\n return () => {\n stopRecordingVoiceRef.current!();\n resetComposer();\n };\n }, [chatId, resetComposer, stopRecordingVoiceRef]);\n\n const handleEditComplete = useEditing(htmlRef, setHtml, editingMessage, resetComposer, openDeleteModal, editMessage);\n useDraft(draft, chatId, threadId, html, htmlRef, setHtml, editingMessage, saveDraft, clearDraft);\n useClipboardPaste(insertTextAndUpdateCursor, setAttachments, editingMessage);\n\n const handleFileSelect = useCallback(async (files: File[], isQuick: boolean) => {\n setAttachments(await Promise.all(files.map((file) => buildAttachment(file.name, file, isQuick))));\n }, []);\n\n const handleAppendFiles = useCallback(async (files: File[], isQuick: boolean) => {\n setAttachments([\n ...attachments,\n ...await Promise.all(files.map((file) => buildAttachment(file.name, file, isQuick))),\n ]);\n }, [attachments]);\n\n const handleClearAttachment = useCallback(() => {\n setAttachments([]);\n }, []);\n\n const handleSend = useCallback(async (isSilent = false, scheduledAt?: number) => {\n if (connectionState !== 'connectionStateReady') {\n return;\n }\n\n let currentAttachments = attachments;\n\n if (activeVoiceRecording) {\n const record = await stopRecordingVoice();\n if (record) {\n const { blob, duration, waveform } = record;\n currentAttachments = [await buildAttachment(\n VOICE_RECORDING_FILENAME,\n blob,\n false,\n { voice: { duration, waveform } },\n )];\n }\n }\n\n const { text, entities } = parseMessageInput(htmlRef.current!);\n\n if (!currentAttachments.length && !text && !isForwarding) {\n return;\n }\n\n const maxLength = currentAttachments.length ? CAPTION_MAX_LENGTH : MESSAGE_MAX_LENGTH;\n if (text?.length > maxLength) {\n const extraLength = text.length - maxLength;\n showDialog({\n data: {\n message: 'MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS',\n textParams: {\n '{EXTRA_CHARS_COUNT}': extraLength,\n '{PLURAL_S}': extraLength > 1 ? 's' : '',\n },\n hasErrorKey: true,\n },\n });\n\n return;\n }\n\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n\n if (currentAttachments.length || text) {\n if (slowMode && !isAdmin) {\n const nowSeconds = getServerTime(serverTimeOffset);\n const secondsSinceLastMessage = lastMessageSendTimeSeconds.current\n && Math.floor(nowSeconds - lastMessageSendTimeSeconds.current);\n const nextSendDateNotReached = slowMode.nextSendDate && slowMode.nextSendDate > nowSeconds;\n\n if (\n (secondsSinceLastMessage && secondsSinceLastMessage < slowMode.seconds)\n || nextSendDateNotReached\n ) {\n const secondsRemaining = nextSendDateNotReached\n ? slowMode.nextSendDate! - nowSeconds\n : slowMode.seconds - secondsSinceLastMessage!;\n showDialog({\n data: {\n message: lang('SlowModeHint', formatMediaDuration(secondsRemaining)),\n isSlowMode: true,\n hasErrorKey: false,\n },\n });\n\n messageInput.blur();\n\n return;\n }\n }\n\n sendMessage({\n text,\n entities,\n attachments: currentAttachments,\n scheduledAt,\n isSilent,\n });\n }\n if (isForwarding) {\n forwardMessages();\n }\n\n lastMessageSendTimeSeconds.current = getServerTime(serverTimeOffset);\n\n clearDraft({ chatId, localOnly: true });\n\n if (IS_IOS && messageInput === document.activeElement) {\n applyIosAutoCapitalizationFix(messageInput);\n }\n\n // Wait until message animation starts\n requestAnimationFrame(() => {\n resetComposer();\n });\n }, [\n connectionState, attachments, activeVoiceRecording, isForwarding, clearDraft, chatId, serverTimeOffset,\n resetComposer, stopRecordingVoice, showDialog, slowMode, isAdmin, sendMessage, forwardMessages, lang,\n ]);\n\n const handleActivateBotCommandMenu = useCallback(() => {\n closeSymbolMenu();\n openBotCommandMenu();\n }, [closeSymbolMenu, openBotCommandMenu]);\n\n const handleActivateSymbolMenu = useCallback(() => {\n closeBotCommandMenu();\n openSymbolMenu();\n }, [closeBotCommandMenu, openSymbolMenu]);\n\n const handleStickerSelect = useCallback((sticker: ApiSticker, shouldPreserveInput = false) => {\n sticker = {\n ...sticker,\n isPreloadedGlobally: true,\n };\n\n if (shouldSchedule) {\n setScheduledMessageArgs({ sticker });\n openCalendar();\n } else {\n sendMessage({ sticker });\n requestAnimationFrame(() => {\n resetComposer(shouldPreserveInput);\n });\n }\n }, [shouldSchedule, openCalendar, sendMessage, resetComposer]);\n\n const handleGifSelect = useCallback((gif: ApiVideo) => {\n if (shouldSchedule) {\n setScheduledMessageArgs({ gif });\n openCalendar();\n } else {\n sendMessage({ gif });\n requestAnimationFrame(() => {\n resetComposer(true);\n });\n }\n }, [shouldSchedule, openCalendar, sendMessage, resetComposer]);\n\n const handleInlineBotSelect = useCallback((inlineResult: ApiBotInlineResult | ApiBotInlineMediaResult) => {\n if (connectionState !== 'connectionStateReady') {\n return;\n }\n\n sendInlineBotResult({\n id: inlineResult.id,\n queryId: inlineResult.queryId,\n });\n\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n if (IS_IOS && messageInput === document.activeElement) {\n applyIosAutoCapitalizationFix(messageInput);\n }\n\n clearDraft({ chatId, localOnly: true });\n requestAnimationFrame(() => {\n resetComposer();\n });\n }, [chatId, clearDraft, connectionState, resetComposer, sendInlineBotResult]);\n\n const handleBotCommandSelect = useCallback(() => {\n clearDraft({ chatId, localOnly: true });\n requestAnimationFrame(() => {\n resetComposer();\n });\n }, [chatId, clearDraft, resetComposer]);\n\n const handlePollSend = useCallback((poll: ApiNewPoll) => {\n if (shouldSchedule) {\n setScheduledMessageArgs({ poll });\n closePollModal();\n openCalendar();\n } else {\n sendMessage({ poll });\n closePollModal();\n }\n }, [closePollModal, openCalendar, sendMessage, shouldSchedule]);\n\n const handleSilentSend = useCallback(() => {\n if (shouldSchedule) {\n setScheduledMessageArgs({ isSilent: true });\n openCalendar();\n } else {\n void handleSend(true);\n }\n }, [handleSend, openCalendar, shouldSchedule]);\n\n const handleMessageSchedule = useCallback((date: Date, isWhenOnline = false) => {\n const { isSilent, ...restArgs } = scheduledMessageArgs || {};\n\n // Scheduled time can not be less than 10 seconds in future\n const scheduledAt = Math.round(Math.max(date.getTime(), Date.now() + 60 * 1000) / 1000)\n + (isWhenOnline ? 0 : serverTimeOffset);\n\n if (!scheduledMessageArgs || Object.keys(restArgs).length === 0) {\n void handleSend(!!isSilent, scheduledAt);\n } else {\n sendMessage({\n ...scheduledMessageArgs,\n scheduledAt,\n });\n requestAnimationFrame(() => {\n resetComposer();\n });\n }\n closeCalendar();\n }, [closeCalendar, handleSend, resetComposer, scheduledMessageArgs, sendMessage, serverTimeOffset]);\n\n const handleMessageScheduleUntilOnline = useCallback(() => {\n handleMessageSchedule(new Date(SCHEDULED_WHEN_ONLINE * 1000), true);\n }, [handleMessageSchedule]);\n\n const handleCloseCalendar = useCallback(() => {\n closeCalendar();\n setScheduledMessageArgs(undefined);\n }, [closeCalendar]);\n\n const handleSearchOpen = useCallback((type: 'stickers' | 'gifs') => {\n if (type === 'stickers') {\n setStickerSearchQuery({ query: '' });\n setGifSearchQuery({ query: undefined });\n } else {\n setGifSearchQuery({ query: '' });\n setStickerSearchQuery({ query: undefined });\n }\n }, [setStickerSearchQuery, setGifSearchQuery]);\n\n const handleSymbolMenuOpen = useCallback(() => {\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n\n if (!IS_SINGLE_COLUMN_LAYOUT || messageInput !== document.activeElement) {\n openSymbolMenu();\n return;\n }\n\n messageInput.blur();\n setTimeout(() => {\n closeBotCommandMenu();\n openSymbolMenu();\n }, MOBILE_KEYBOARD_HIDE_DELAY_MS);\n }, [openSymbolMenu, closeBotCommandMenu]);\n\n const handleAllScheduledClick = useCallback(() => {\n openChat({ id: chatId, threadId, type: 'scheduled' });\n }, [openChat, chatId, threadId]);\n\n useEffect(() => {\n if (isRightColumnShown && IS_SINGLE_COLUMN_LAYOUT) {\n closeSymbolMenu();\n }\n }, [isRightColumnShown, closeSymbolMenu]);\n\n useEffect(() => {\n if (!isReady) return;\n\n if (isSelectModeActive) {\n disableHover();\n } else {\n setTimeout(() => {\n enableHover();\n }, SELECT_MODE_TRANSITION_MS);\n }\n }, [isSelectModeActive, enableHover, disableHover, isReady]);\n\n const mainButtonHandler = useCallback(() => {\n switch (mainButtonState) {\n case MainButtonState.Send:\n if (shouldSchedule) {\n if (activeVoiceRecording) {\n pauseRecordingVoice();\n }\n openCalendar();\n } else {\n void handleSend();\n }\n break;\n case MainButtonState.Record:\n void startRecordingVoice();\n break;\n case MainButtonState.Edit:\n handleEditComplete();\n break;\n default:\n break;\n }\n }, [\n mainButtonState, shouldSchedule, startRecordingVoice, handleEditComplete,\n activeVoiceRecording, openCalendar, pauseRecordingVoice, handleSend,\n ]);\n\n const areVoiceMessagesNotAllowed = mainButtonState === MainButtonState.Record\n && !allowedAttachmentOptions.canAttachMedia;\n\n const prevEditedMessage = usePrevious(editingMessage, true);\n const renderedEditedMessage = editingMessage || prevEditedMessage;\n\n const scheduledDefaultDate = new Date();\n scheduledDefaultDate.setSeconds(0);\n scheduledDefaultDate.setMilliseconds(0);\n\n const scheduledMaxDate = new Date();\n scheduledMaxDate.setFullYear(scheduledMaxDate.getFullYear() + 1);\n\n let sendButtonAriaLabel = 'SendMessage';\n switch (mainButtonState) {\n case MainButtonState.Edit:\n sendButtonAriaLabel = 'Save edited message';\n break;\n case MainButtonState.Record:\n sendButtonAriaLabel = areVoiceMessagesNotAllowed\n ? 'Conversation.DefaultRestrictedMedia'\n : 'AccDescrVoiceMessage';\n }\n\n const className = buildClassName(\n 'Composer',\n !isSelectModeActive && 'shown',\n isHoverDisabled && 'hover-disabled',\n );\n\n const symbolMenuButtonClassName = buildClassName(\n 'mobile-symbol-menu-button',\n !isReady && 'not-ready',\n isSymbolMenuLoaded\n ? (isSymbolMenuOpen && 'menu-opened')\n : (isSymbolMenuOpen && 'is-loading'),\n );\n\n const onSend = mainButtonState === MainButtonState.Edit\n ? handleEditComplete\n : (shouldSchedule ? openCalendar : handleSend);\n\n return (\n
\n {allowedAttachmentOptions.canAttachMedia && isReady && (\n \n \n \n )}\n \n \n \n \n {renderedEditedMessage && (\n \n )}\n \n \n \n
\n
\n \n \n
\n {isChatWithBot && botCommands !== false && !activeVoiceRecording && !editingMessage && (\n \n \n \n )}\n {IS_SINGLE_COLUMN_LAYOUT ? (\n \n \n \n {isSymbolMenuOpen && !isSymbolMenuLoaded && }\n \n ) : (\n \n \n \n )}\n \n {isInlineBotLoading && Boolean(inlineBotId) && (\n \n )}\n {withScheduledButton && (\n \n \n \n )}\n {botKeyboardMessageId && !activeVoiceRecording && !editingMessage && (\n \n \n \n )}\n {!activeVoiceRecording && !editingMessage && (\n \n \n \n )}\n {activeVoiceRecording && currentRecordTime && (\n \n {formatVoiceRecordDuration(currentRecordTime - startRecordTimeRef.current!)}\n \n )}\n \n \n \n {botKeyboardMessageId && (\n \n )}\n {botCommands && (\n \n )}\n \n
\n
\n {activeVoiceRecording && (\n \n \n \n )}\n \n \n \n \n \n {canShowCustomSendMenu && (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId, messageListType }): StateProps => {\n const chat = selectChat(global, chatId);\n const chatUser = chat && selectChatUser(global, chat);\n const chatBot = chatId !== REPLIES_USER_ID ? selectChatBot(global, chatId) : undefined;\n const isChatWithBot = Boolean(chatBot);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const messageWithActualBotKeyboard = isChatWithBot && selectNewestMessageWithBotKeyboardButtons(global, chatId);\n const scheduledIds = selectScheduledIds(global, chatId);\n const { language } = global.settings.byKey;\n const baseEmojiKeywords = global.emojiKeywords[BASE_EMOJI_KEYWORD_LANG];\n const emojiKeywords = language !== BASE_EMOJI_KEYWORD_LANG ? global.emojiKeywords[language] : undefined;\n const botKeyboardMessageId = messageWithActualBotKeyboard ? messageWithActualBotKeyboard.id : undefined;\n const keyboardMessage = botKeyboardMessageId ? selectChatMessage(global, chatId, botKeyboardMessageId) : undefined;\n\n return {\n editingMessage: selectEditingMessage(global, chatId, threadId, messageListType),\n connectionState: global.connectionState,\n draft: selectDraft(global, chatId, threadId),\n chat,\n isChatWithBot,\n isChatWithSelf,\n canScheduleUntilOnline: (\n !isChatWithSelf && !isChatWithBot\n && (chat && chatUser && isChatPrivate(chatId) && chatUser.status && Boolean(chatUser.status.wasOnline))\n ),\n isRightColumnShown: selectIsRightColumnShown(global),\n isSelectModeActive: selectIsInSelectMode(global),\n withScheduledButton: (\n threadId === MAIN_THREAD_ID\n && messageListType === 'thread'\n && Boolean(scheduledIds?.length)\n ),\n shouldSchedule: messageListType === 'scheduled',\n botKeyboardMessageId,\n botKeyboardPlaceholder: keyboardMessage?.keyboardPlaceholder,\n isForwarding: chatId === global.forwardMessages.toChatId,\n isPollModalOpen: global.isPollModalOpen,\n stickersForEmoji: global.stickers.forEmoji.stickers,\n groupChatMembers: chat?.fullInfo?.members,\n topInlineBotIds: global.topInlineBots?.userIds,\n currentUserId: global.currentUserId,\n usersById: global.users.byId,\n lastSyncTime: global.lastSyncTime,\n contentToBeScheduled: global.messages.contentToBeScheduled,\n isPaymentModalOpen: global.payment.isPaymentModalOpen,\n isReceiptModalOpen: Boolean(global.payment.receipt),\n shouldSuggestStickers: global.settings.byKey.shouldSuggestStickers,\n recentEmojis: global.recentEmojis,\n baseEmojiKeywords: baseEmojiKeywords?.keywords,\n emojiKeywords: emojiKeywords?.keywords,\n serverTimeOffset: global.serverTimeOffset,\n inlineBots: global.inlineBots.byUsername,\n isInlineBotLoading: global.inlineBots.isLoading,\n chatBotCommands: chat && chat.fullInfo && chat.fullInfo.botCommands,\n botCommands: chatBot && chatBot.fullInfo ? (chatBot.fullInfo.botCommands || false) : undefined,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'sendMessage',\n 'editMessage',\n 'saveDraft',\n 'clearDraft',\n 'showDialog',\n 'setStickerSearchQuery',\n 'setGifSearchQuery',\n 'forwardMessages',\n 'openPollModal',\n 'closePollModal',\n 'closePaymentModal',\n 'clearReceipt',\n 'loadScheduledHistory',\n 'openChat',\n 'addRecentEmoji',\n 'sendInlineBotResult',\n ]),\n)(Composer));\n","import { useEffect } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\n\nimport { IS_EMOJI_SUPPORTED } from '../../../../util/environment';\n\nimport parseEmojiOnlyString from '../../../common/helpers/parseEmojiOnlyString';\n\nexport default function useStickerTooltip(\n isAllowed: boolean,\n html: string,\n stickers?: ApiSticker[],\n isDisabled = false,\n) {\n const { loadStickersForEmoji, clearStickersForEmoji } = getDispatch();\n const isSingleEmoji = (\n (IS_EMOJI_SUPPORTED && parseEmojiOnlyString(html) === 1)\n || (!IS_EMOJI_SUPPORTED && Boolean(html.match(/^]*?>$/g)))\n );\n const hasStickers = Boolean(stickers) && isSingleEmoji;\n\n useEffect(() => {\n if (isDisabled) return;\n\n if (isAllowed && isSingleEmoji) {\n loadStickersForEmoji({ emoji: html });\n } else if (hasStickers || !isSingleEmoji) {\n clearStickersForEmoji();\n }\n // We omit `hasStickers` here to prevent re-fetching after manually closing tooltip (via ).\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [html, isSingleEmoji, clearStickersForEmoji, loadStickersForEmoji, isAllowed, isDisabled]);\n\n return {\n isStickerTooltipOpen: hasStickers,\n closeStickerTooltip: clearStickersForEmoji,\n };\n}\n","export default function insertHtmlInSelection(html: string) {\n const selection = window.getSelection();\n\n if (selection?.getRangeAt && selection.rangeCount) {\n const range = selection.getRangeAt(0);\n range.deleteContents();\n\n const fragment = range.createContextualFragment(html);\n const lastInsertedNode = fragment.lastChild;\n range.insertNode(fragment);\n if (lastInsertedNode) {\n range.setStartAfter(lastInsertedNode);\n range.setEndAfter(lastInsertedNode);\n } else {\n range.collapse(false);\n }\n selection.removeAllRanges();\n selection.addRange(range);\n }\n}\n","export default function deleteLastCharacterOutsideSelection(html: string) {\n const tempInput = document.createElement('div');\n tempInput.contentEditable = 'true';\n tempInput.style.position = 'absolute';\n tempInput.style.left = '-10000px';\n tempInput.style.top = '-10000px';\n tempInput.innerHTML = html;\n document.body.appendChild(tempInput);\n let element = tempInput.lastChild!;\n\n if (element.lastChild) {\n // Selects the last and the deepest child of the element.\n while (element.lastChild) {\n element = element.lastChild;\n }\n }\n\n // Gets length of the element's content.\n const textLength = element.textContent!.length;\n const range = document.createRange();\n const selection = window.getSelection()!;\n\n // Sets selection position to the end of the element.\n range.setStart(element, textLength);\n range.setEnd(element, textLength);\n selection.removeAllRanges();\n selection.addRange(range);\n document.execCommand('delete', false);\n\n const result = tempInput.innerHTML;\n document.body.removeChild(tempInput);\n\n return result;\n}\n","import { useCallback, useEffect } from '../../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../../api/types';\nimport { GlobalActions } from '../../../../global/types';\n\nimport { EDITABLE_INPUT_ID } from '../../../../config';\nimport parseMessageInput from '../helpers/parseMessageInput';\nimport getMessageTextAsHtml from '../helpers/getMessageTextAsHtml';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport { hasMessageMedia } from '../../../../modules/helpers';\n\nexport default (\n htmlRef: { current: string },\n setHtml: (html: string) => void,\n editedMessage: ApiMessage | undefined,\n resetComposer: () => void,\n openDeleteModal: () => void,\n editMessage: GlobalActions['editMessage'],\n) => {\n // TODO useOnChange\n // Handle editing message\n useEffect(() => {\n if (!editedMessage) {\n setHtml('');\n return;\n }\n\n setHtml(getMessageTextAsHtml(editedMessage.content.text));\n\n requestAnimationFrame(() => {\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n focusEditableElement(messageInput, true);\n });\n }, [editedMessage, setHtml]);\n\n const handleEditComplete = useCallback(() => {\n const { text, entities } = parseMessageInput(htmlRef.current!);\n\n if (!editedMessage) {\n return;\n }\n\n if (!text && !hasMessageMedia(editedMessage)) {\n openDeleteModal();\n return;\n }\n\n editMessage({\n messageId: editedMessage.id,\n text,\n entities,\n });\n\n resetComposer();\n }, [editMessage, editedMessage, htmlRef, openDeleteModal, resetComposer]);\n\n return handleEditComplete;\n};\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './MobileSearch';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst MobileSearchAsync: FC = (props) => {\n const { isActive } = props;\n const MobileSearch = useModuleLoader(Bundles.Extra, 'MobileSearch', !isActive, true);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return MobileSearch ? : undefined;\n};\n\nexport default memo(MobileSearchAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\nimport { OwnProps } from './MessageSelectToolbar';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst MessageSelectToolbarAsync: FC = (props) => {\n const { isActive } = props;\n const MessageSelectToolbar = useModuleLoader(Bundles.Extra, 'MessageSelectToolbar', !isActive);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return MessageSelectToolbar ? : undefined;\n};\n\nexport default memo(MessageSelectToolbarAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './UnpinAllMessagesModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst UnpinAllMessagesModalAsync: FC = (props) => {\n const { isOpen } = props;\n const UnpinAllMessagesModal = useModuleLoader(Bundles.Extra, 'UnpinAllMessagesModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return UnpinAllMessagesModal ? : undefined;\n};\n\nexport default memo(UnpinAllMessagesModalAsync);\n","import React, {\n FC, useEffect, useState, memo, useMemo, useCallback,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChatBannedRights, MAIN_THREAD_ID } from '../../api/types';\nimport { GlobalActions, MessageListType, MessageList as GlobalMessageList } from '../../global/types';\nimport { ThemeKey } from '../../types';\n\nimport {\n MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,\n MOBILE_SCREEN_MAX_WIDTH,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n SAFE_SCREEN_WIDTH_FOR_CHAT_INFO,\n CONTENT_TYPES_FOR_QUICK_UPLOAD,\n ANIMATION_LEVEL_MAX,\n ANIMATION_END_DELAY,\n DARK_THEME_BG_COLOR,\n LIGHT_THEME_BG_COLOR,\n ANIMATION_LEVEL_MIN,\n} from '../../config';\nimport {\n IS_SINGLE_COLUMN_LAYOUT,\n IS_TABLET_COLUMN_LAYOUT,\n IS_TOUCH_ENV,\n MASK_IMAGE_DISABLED,\n} from '../../util/environment';\nimport { DropAreaState } from './composer/DropArea';\nimport {\n selectChat,\n selectCurrentMessageList,\n selectCurrentTextSearch,\n selectIsChatBotNotStarted,\n selectIsInSelectMode,\n selectIsRightColumnShown,\n selectPinnedIds,\n selectTheme,\n} from '../../modules/selectors';\nimport { getCanPostInChat, getMessageSendingRestrictionReason, isChatPrivate } from '../../modules/helpers';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\nimport useCustomBackground from '../../hooks/useCustomBackground';\nimport useWindowSize from '../../hooks/useWindowSize';\nimport usePrevDuringAnimation from '../../hooks/usePrevDuringAnimation';\nimport calculateMiddleFooterTransforms from './helpers/calculateMiddleFooterTransforms';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport { createMessageHash } from '../../util/routing';\n\nimport Transition from '../ui/Transition';\nimport MiddleHeader from './MiddleHeader';\nimport MessageList from './MessageList';\nimport ScrollDownButton from './ScrollDownButton';\nimport Composer from './composer/Composer';\nimport Button from '../ui/Button';\nimport MobileSearch from './MobileSearch.async';\nimport MessageSelectToolbar from './MessageSelectToolbar.async';\nimport UnpinAllMessagesModal from '../common/UnpinAllMessagesModal.async';\n\nimport './MiddleColumn.scss';\n\ntype StateProps = {\n chatId?: number;\n threadId?: number;\n messageListType?: MessageListType;\n isPrivate?: boolean;\n isPinnedMessageList?: boolean;\n isScheduledMessageList?: boolean;\n canPost?: boolean;\n currentUserBannedRights?: ApiChatBannedRights;\n defaultBannedRights?: ApiChatBannedRights;\n hasPinnedOrAudioMessage?: boolean;\n pinnedMessagesCount?: number;\n theme: ThemeKey;\n customBackground?: string;\n backgroundColor?: string;\n patternColor?: string;\n isLeftColumnShown?: boolean;\n isRightColumnShown?: boolean;\n isBackgroundBlurred?: boolean;\n isMobileSearchActive?: boolean;\n isSelectModeActive?: boolean;\n animationLevel?: number;\n shouldSkipHistoryAnimations?: boolean;\n currentTransitionKey: number;\n messageLists?: GlobalMessageList[];\n};\n\ntype DispatchProps = Pick;\n\nconst CLOSE_ANIMATION_DURATION = IS_SINGLE_COLUMN_LAYOUT ? 450 + ANIMATION_END_DELAY : undefined;\n\nfunction canBeQuicklyUploaded(item: DataTransferItem) {\n return item.kind === 'file' && item.type && CONTENT_TYPES_FOR_QUICK_UPLOAD.has(item.type);\n}\n\nconst MiddleColumn: FC = ({\n chatId,\n threadId,\n messageListType,\n isPrivate,\n isPinnedMessageList,\n messageLists,\n canPost,\n currentUserBannedRights,\n defaultBannedRights,\n hasPinnedOrAudioMessage,\n pinnedMessagesCount,\n customBackground,\n theme,\n backgroundColor,\n patternColor,\n isLeftColumnShown,\n isRightColumnShown,\n isBackgroundBlurred,\n isMobileSearchActive,\n isSelectModeActive,\n animationLevel,\n shouldSkipHistoryAnimations,\n currentTransitionKey,\n openChat,\n unpinAllMessages,\n loadUser,\n closeLocalTextSearch,\n exitMessageSelectMode,\n}) => {\n const { width: windowWidth } = useWindowSize();\n\n const lang = useLang();\n const [dropAreaState, setDropAreaState] = useState(DropAreaState.None);\n const [isFabShown, setIsFabShown] = useState();\n const [isNotchShown, setIsNotchShown] = useState();\n const [isUnpinModalOpen, setIsUnpinModalOpen] = useState(false);\n const [isReady, setIsReady] = useState(!IS_SINGLE_COLUMN_LAYOUT || animationLevel === ANIMATION_LEVEL_MIN);\n\n const hasTools = hasPinnedOrAudioMessage && (\n windowWidth < MOBILE_SCREEN_MAX_WIDTH\n || (\n isRightColumnShown && windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n && windowWidth < SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n ) || (\n windowWidth >= MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN\n && windowWidth < SAFE_SCREEN_WIDTH_FOR_CHAT_INFO\n )\n );\n\n const renderingChatId = usePrevDuringAnimation(chatId, CLOSE_ANIMATION_DURATION);\n const renderingThreadId = usePrevDuringAnimation(threadId, CLOSE_ANIMATION_DURATION);\n const renderingMessageListType = usePrevDuringAnimation(messageListType, CLOSE_ANIMATION_DURATION);\n const renderingCanPost = usePrevDuringAnimation(canPost, CLOSE_ANIMATION_DURATION);\n const renderingHasTools = usePrevDuringAnimation(hasTools, CLOSE_ANIMATION_DURATION);\n const renderingIsFabShown = usePrevDuringAnimation(isFabShown, CLOSE_ANIMATION_DURATION);\n\n useEffect(() => {\n return chatId\n ? captureEscKeyListener(() => {\n openChat({ id: undefined });\n })\n : undefined;\n }, [chatId, openChat]);\n\n useEffect(() => {\n setDropAreaState(DropAreaState.None);\n setIsFabShown(undefined);\n setIsNotchShown(undefined);\n }, [chatId]);\n\n useEffect(() => {\n if (animationLevel === ANIMATION_LEVEL_MIN) {\n setIsReady(true);\n }\n }, [animationLevel]);\n\n const handleTransitionEnd = (e: React.TransitionEvent) => {\n if (e.propertyName === 'transform' && e.target === e.currentTarget) {\n setIsReady(Boolean(chatId));\n }\n };\n\n useEffect(() => {\n if (isPrivate) {\n loadUser({ userId: chatId });\n }\n }, [chatId, isPrivate, loadUser]);\n\n const handleDragEnter = useCallback((e: React.DragEvent) => {\n if (IS_TOUCH_ENV) {\n return;\n }\n\n const { items } = e.dataTransfer || {};\n const shouldDrawQuick = items && Array.from(items)\n // Filter unnecessary element for drag and drop images in Firefox (https://github.com/Ajaxy/telegram-tt/issues/49)\n // https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#image\n .filter((item) => item.type !== 'text/uri-list')\n .every(canBeQuicklyUploaded);\n\n setDropAreaState(shouldDrawQuick ? DropAreaState.QuickFile : DropAreaState.Document);\n }, []);\n\n const handleHideDropArea = useCallback(() => {\n setDropAreaState(DropAreaState.None);\n }, []);\n\n const handleOpenUnpinModal = useCallback(() => {\n setIsUnpinModalOpen(true);\n }, []);\n\n const closeUnpinModal = useCallback(() => {\n setIsUnpinModalOpen(false);\n }, []);\n\n const handleUnpinAllMessages = useCallback(() => {\n unpinAllMessages({ chatId });\n closeUnpinModal();\n openChat({ id: chatId });\n }, [unpinAllMessages, openChat, closeUnpinModal, chatId]);\n\n const handleTabletFocus = useCallback(() => {\n openChat({ id: chatId });\n }, [openChat, chatId]);\n\n const customBackgroundValue = useCustomBackground(theme, customBackground);\n\n const className = buildClassName(\n renderingHasTools && 'has-header-tools',\n customBackground && 'custom-bg-image',\n backgroundColor && 'custom-bg-color',\n customBackground && isBackgroundBlurred && 'blurred',\n MASK_IMAGE_DISABLED ? 'mask-image-disabled' : 'mask-image-enabled',\n );\n\n const messagingDisabledClassName = buildClassName(\n 'messaging-disabled',\n !isSelectModeActive && 'shown',\n );\n\n const messageSendingRestrictionReason = getMessageSendingRestrictionReason(\n lang, currentUserBannedRights, defaultBannedRights,\n );\n\n // CSS Variables calculation doesn't work properly with transforms, so we calculate transform values in JS\n const {\n composerHiddenScale, toolbarHiddenScale,\n composerTranslateX, toolbarTranslateX,\n unpinHiddenScale, toolbarForUnpinHiddenScale,\n } = useMemo(\n () => calculateMiddleFooterTransforms(windowWidth, renderingCanPost),\n [renderingCanPost, windowWidth],\n );\n\n const footerClassName = buildClassName(\n 'middle-column-footer',\n !renderingCanPost && 'no-composer',\n renderingCanPost && isNotchShown && !isSelectModeActive && 'with-notch',\n );\n\n const closeChat = () => {\n openChat({ id: undefined }, true);\n };\n\n useHistoryBack(renderingChatId && renderingThreadId,\n closeChat, undefined, undefined, undefined,\n messageLists ? messageLists.map(createMessageHash) : []);\n\n useHistoryBack(isMobileSearchActive, closeLocalTextSearch);\n useHistoryBack(isSelectModeActive, exitMessageSelectMode);\n\n return (\n \n \n
\n {renderingChatId && renderingThreadId && (\n <>\n
\n \n \n {(isActive) => (\n <>\n \n
\n {renderingCanPost && (\n \n )}\n {isPinnedMessageList && (\n
\n \n \n {lang('Chat.Pinned.UnpinAll', pinnedMessagesCount, 'i')}\n \n
\n )}\n {!isPinnedMessageList && !renderingCanPost && messageSendingRestrictionReason && (\n
\n
\n \n {messageSendingRestrictionReason}\n \n
\n
\n )}\n \n
\n \n )}\n \n\n \n
\n {IS_SINGLE_COLUMN_LAYOUT && }\n \n )}\n {chatId && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const theme = selectTheme(global);\n const {\n isBlurred: isBackgroundBlurred, background: customBackground, backgroundColor, patternColor,\n } = global.settings.themes[theme] || {};\n\n const { messageLists } = global.messages;\n const currentMessageList = selectCurrentMessageList(global);\n const { isLeftColumnShown, chats: { listIds } } = global;\n\n const state: StateProps = {\n theme,\n customBackground,\n backgroundColor,\n patternColor,\n isLeftColumnShown,\n isRightColumnShown: selectIsRightColumnShown(global),\n isBackgroundBlurred,\n isMobileSearchActive: Boolean(IS_SINGLE_COLUMN_LAYOUT && selectCurrentTextSearch(global)),\n isSelectModeActive: selectIsInSelectMode(global),\n animationLevel: global.settings.byKey.animationLevel,\n currentTransitionKey: Math.max(0, global.messages.messageLists.length - 1),\n };\n\n if (!currentMessageList || !listIds.active) {\n return state;\n }\n\n const { chatId, threadId, type: messageListType } = currentMessageList;\n const chat = selectChat(global, chatId);\n const pinnedIds = selectPinnedIds(global, chatId);\n const { chatId: audioChatId, messageId: audioMessageId } = global.audioPlayer;\n\n const canPost = chat && getCanPostInChat(chat, threadId);\n const isBotNotStarted = selectIsChatBotNotStarted(global, chatId);\n const isPinnedMessageList = messageListType === 'pinned';\n const isScheduledMessageList = messageListType === 'scheduled';\n\n return {\n ...state,\n chatId,\n threadId,\n messageListType,\n isPrivate: isChatPrivate(chatId),\n canPost: !isPinnedMessageList && (!chat || canPost) && !isBotNotStarted,\n isPinnedMessageList,\n isScheduledMessageList,\n currentUserBannedRights: chat?.currentUserBannedRights,\n defaultBannedRights: chat?.defaultBannedRights,\n hasPinnedOrAudioMessage: (\n threadId !== MAIN_THREAD_ID\n || Boolean(pinnedIds?.length)\n || Boolean(audioChatId && audioMessageId)\n ),\n pinnedMessagesCount: pinnedIds ? pinnedIds.length : 0,\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n messageLists,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat', 'unpinAllMessages', 'loadUser', 'closeLocalTextSearch', 'exitMessageSelectMode',\n ]),\n)(MiddleColumn));\n","import { useEffect, useState } from '../lib/teact/teact';\n\nimport { ThemeKey } from '../types';\n\nimport { CUSTOM_BG_CACHE_NAME } from '../config';\nimport * as cacheApi from '../util/cacheApi';\nimport { preloadImage } from '../util/files';\n\nexport default (theme: ThemeKey, settingValue?: string) => {\n const [value, setValue] = useState(settingValue);\n\n useEffect(() => {\n if (!settingValue) {\n return;\n }\n\n if (settingValue.startsWith('#')) {\n setValue(settingValue);\n } else {\n cacheApi.fetch(CUSTOM_BG_CACHE_NAME, theme, cacheApi.Type.Blob)\n .then((blob) => {\n const url = URL.createObjectURL(blob);\n preloadImage(url)\n .then(() => {\n setValue(`url(${url})`);\n });\n });\n }\n }, [settingValue, theme]);\n\n return settingValue ? value : undefined;\n};\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ManagementScreens, ProfileState } from '../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { debounce } from '../../util/schedulers';\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\nimport {\n selectChat,\n selectCurrentGifSearch,\n selectCurrentStickerSearch,\n selectCurrentTextSearch,\n selectIsChatWithSelf,\n} from '../../modules/selectors';\nimport { isChatAdmin, isChatChannel, isChatPrivate } from '../../modules/helpers';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\nimport useLang from '../../hooks/useLang';\n\nimport SearchInput from '../ui/SearchInput';\nimport Button from '../ui/Button';\nimport Transition from '../ui/Transition';\nimport './RightHeader.scss';\nimport { getDayStartAt } from '../../util/dateFormat';\n\ntype OwnProps = {\n chatId?: number;\n isColumnOpen?: boolean;\n isProfile?: boolean;\n isSearch?: boolean;\n isManagement?: boolean;\n isStickerSearch?: boolean;\n isGifSearch?: boolean;\n isPollResults?: boolean;\n isAddingChatMembers?: boolean;\n shouldSkipAnimation?: boolean;\n profileState?: ProfileState;\n managementScreen?: ManagementScreens;\n onClose: () => void;\n};\n\ntype StateProps = {\n canManage?: boolean;\n isChannel?: boolean;\n messageSearchQuery?: string;\n stickerSearchQuery?: string;\n gifSearchQuery?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst COLUMN_CLOSE_DELAY_MS = 300;\nconst runDebouncedForSearch = debounce((cb) => cb(), 200, false);\n\nenum HeaderContent {\n Profile,\n MemberList,\n SharedMedia,\n Search,\n Management,\n ManageInitial,\n ManageChannelSubscribers,\n ManageChatAdministrators,\n ManageChatPrivacyType,\n ManageDiscussion,\n ManageGroupPermissions,\n ManageGroupRemovedUsers,\n ManageGroupUserPermissionsCreate,\n ManageGroupUserPermissions,\n ManageGroupRecentActions,\n ManageGroupAdminRights,\n ManageGroupMembers,\n StickerSearch,\n GifSearch,\n PollResults,\n AddingMembers,\n}\n\nconst RightHeader: FC = ({\n isColumnOpen,\n isProfile,\n isSearch,\n isManagement,\n isStickerSearch,\n isGifSearch,\n isPollResults,\n isAddingChatMembers,\n profileState,\n managementScreen,\n canManage,\n isChannel,\n onClose,\n messageSearchQuery,\n stickerSearchQuery,\n gifSearchQuery,\n setLocalTextSearchQuery,\n setStickerSearchQuery,\n setGifSearchQuery,\n searchTextMessagesLocal,\n toggleManagement,\n openHistoryCalendar,\n shouldSkipAnimation,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const backButtonRef = useRef(null);\n\n const handleMessageSearchQueryChange = useCallback((query: string) => {\n setLocalTextSearchQuery({ query });\n\n if (query.length) {\n runDebouncedForSearch(searchTextMessagesLocal);\n }\n }, [searchTextMessagesLocal, setLocalTextSearchQuery]);\n\n const handleStickerSearchQueryChange = useCallback((query: string) => {\n setStickerSearchQuery({ query });\n }, [setStickerSearchQuery]);\n\n const handleGifSearchQueryChange = useCallback((query: string) => {\n setGifSearchQuery({ query });\n }, [setGifSearchQuery]);\n\n const [shouldSkipTransition, setShouldSkipTransition] = useState(!isColumnOpen);\n\n useEffect(() => {\n setTimeout(() => {\n setShouldSkipTransition(!isColumnOpen);\n }, COLUMN_CLOSE_DELAY_MS);\n }, [isColumnOpen]);\n\n const lang = useLang();\n const contentKey = isProfile ? (\n profileState === ProfileState.Profile ? (\n HeaderContent.Profile\n ) : profileState === ProfileState.SharedMedia ? (\n HeaderContent.SharedMedia\n ) : profileState === ProfileState.MemberList ? (\n HeaderContent.MemberList\n ) : -1 // Never reached\n ) : isSearch ? (\n HeaderContent.Search\n ) : isPollResults ? (\n HeaderContent.PollResults\n ) : isStickerSearch ? (\n HeaderContent.StickerSearch\n ) : isGifSearch ? (\n HeaderContent.GifSearch\n ) : isAddingChatMembers ? (\n HeaderContent.AddingMembers\n ) : isManagement ? (\n managementScreen === ManagementScreens.Initial ? (\n HeaderContent.ManageInitial\n ) : managementScreen === ManagementScreens.ChatPrivacyType ? (\n HeaderContent.ManageChatPrivacyType\n ) : managementScreen === ManagementScreens.Discussion ? (\n HeaderContent.ManageDiscussion\n ) : managementScreen === ManagementScreens.ChannelSubscribers ? (\n HeaderContent.ManageChannelSubscribers\n ) : managementScreen === ManagementScreens.GroupPermissions ? (\n HeaderContent.ManageGroupPermissions\n ) : managementScreen === ManagementScreens.ChatAdministrators ? (\n HeaderContent.ManageChatAdministrators\n ) : managementScreen === ManagementScreens.GroupRemovedUsers ? (\n HeaderContent.ManageGroupRemovedUsers\n ) : managementScreen === ManagementScreens.GroupUserPermissionsCreate ? (\n HeaderContent.ManageGroupUserPermissionsCreate\n ) : managementScreen === ManagementScreens.GroupUserPermissions ? (\n HeaderContent.ManageGroupUserPermissions\n ) : managementScreen === ManagementScreens.GroupRecentActions ? (\n HeaderContent.ManageGroupRecentActions\n ) : managementScreen === ManagementScreens.ChatAdminRights ? (\n HeaderContent.ManageGroupAdminRights\n ) : managementScreen === ManagementScreens.GroupMembers ? (\n HeaderContent.ManageGroupMembers\n ) : undefined // Never reached\n ) : undefined; // When column is closed\n\n const renderingContentKey = useCurrentOrPrev(contentKey, true) ?? -1;\n\n function renderHeaderContent() {\n if (renderingContentKey === -1) {\n return undefined;\n }\n\n switch (renderingContentKey) {\n case HeaderContent.PollResults:\n return

{lang('PollResults')}

;\n case HeaderContent.Search:\n return (\n <>\n \n openHistoryCalendar({ selectedAt: getDayStartAt(Date.now()) })}\n ariaLabel=\"Search messages by date\"\n >\n \n \n \n );\n case HeaderContent.AddingMembers:\n return

{lang('GroupAddMembers')}

;\n case HeaderContent.ManageInitial:\n return

{lang('Edit')}

;\n case HeaderContent.ManageChatPrivacyType:\n return

{lang(isChannel ? 'ChannelTypeHeader' : 'GroupTypeHeader')}

;\n case HeaderContent.ManageDiscussion:\n return

{lang('Discussion')}

;\n case HeaderContent.ManageChatAdministrators:\n return

{lang('ChannelAdministrators')}

;\n case HeaderContent.ManageGroupRecentActions:\n return

{lang('Group.Info.AdminLog')}

;\n case HeaderContent.ManageGroupAdminRights:\n return

{lang('EditAdminRights')}

;\n case HeaderContent.ManageGroupPermissions:\n return

{lang('ChannelPermissions')}

;\n case HeaderContent.ManageGroupRemovedUsers:\n return

{lang('ChannelBlockedUsers')}

;\n case HeaderContent.ManageGroupUserPermissionsCreate:\n return

{lang('ChannelAddException')}

;\n case HeaderContent.ManageGroupUserPermissions:\n return

{lang('UserRestrictions')}

;\n case HeaderContent.StickerSearch:\n return (\n \n );\n case HeaderContent.GifSearch:\n return (\n \n );\n case HeaderContent.SharedMedia:\n return

{lang('SharedMedia')}

;\n case HeaderContent.ManageChannelSubscribers:\n return

{lang('ChannelSubscribers')}

;\n case HeaderContent.MemberList:\n case HeaderContent.ManageGroupMembers:\n return

{lang('GroupMembers')}

;\n default:\n return (\n <>\n

Profile

\n
\n {canManage && (\n \n \n \n )}\n
\n \n );\n }\n }\n\n const isBackButton = (\n IS_SINGLE_COLUMN_LAYOUT\n || contentKey === HeaderContent.SharedMedia\n || contentKey === HeaderContent.MemberList\n || contentKey === HeaderContent.AddingMembers\n || isManagement\n );\n\n const buttonClassName = buildClassName(\n 'animated-close-icon',\n isBackButton && 'state-back',\n (shouldSkipTransition || shouldSkipAnimation) && 'no-transition',\n );\n\n return (\n
\n \n
\n \n \n {renderHeaderContent}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, isProfile, isManagement }): StateProps => {\n const { query: messageSearchQuery } = selectCurrentTextSearch(global) || {};\n const { query: stickerSearchQuery } = selectCurrentStickerSearch(global) || {};\n const { query: gifSearchQuery } = selectCurrentGifSearch(global) || {};\n const chat = chatId ? selectChat(global, chatId) : undefined;\n const isChannel = chat && isChatChannel(chat);\n\n const canManage = Boolean(\n !isManagement\n && isProfile\n && chat\n && !selectIsChatWithSelf(global, chat.id)\n // chat.isCreator is for Basic Groups\n && (isChatPrivate(chat.id) || ((isChatAdmin(chat) || chat.isCreator) && !chat.isNotJoined)),\n );\n\n return {\n canManage,\n isChannel,\n messageSearchQuery,\n stickerSearchQuery,\n gifSearchQuery,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setLocalTextSearchQuery',\n 'setStickerSearchQuery',\n 'setGifSearchQuery',\n 'searchTextMessagesLocal',\n 'toggleManagement',\n 'openHistoryCalendar',\n ]),\n)(RightHeader));\n","import { useMemo, useRef } from '../../../lib/teact/teact';\n\nimport { ApiChatMember, ApiMessage, ApiUser } from '../../../api/types';\nimport { ProfileTabType, SharedMediaType } from '../../../types';\n\nimport { MEMBERS_SLICE, MESSAGE_SEARCH_SLICE, SHARED_MEDIA_SLICE } from '../../../config';\nimport { getMessageContentIds, sortUserIds } from '../../../modules/helpers';\nimport useOnChange from '../../../hooks/useOnChange';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\n\nexport default function useProfileViewportIds(\n isRightColumnShown: boolean,\n loadMoreMembers: AnyToVoidFunction,\n searchMessages: AnyToVoidFunction,\n tabType: ProfileTabType,\n mediaSearchType?: SharedMediaType,\n groupChatMembers?: ApiChatMember[],\n usersById?: Record,\n chatMessages?: Record,\n foundIds?: number[],\n chatId?: number,\n lastSyncTime?: number,\n serverTimeOffset = 0,\n) {\n const resultType = tabType === 'members' || !mediaSearchType ? tabType : mediaSearchType;\n\n const memberIds = useMemo(() => {\n if (!groupChatMembers || !usersById) {\n return undefined;\n }\n\n return sortUserIds(groupChatMembers.map(({ userId }) => userId), usersById, undefined, serverTimeOffset);\n }, [groupChatMembers, serverTimeOffset, usersById]);\n\n const [memberViewportIds, getMoreMembers, noProfileInfoForMembers] = useInfiniteScrollForMembers(\n resultType, loadMoreMembers, lastSyncTime, memberIds,\n );\n\n const [mediaViewportIds, getMoreMedia, noProfileInfoForMedia] = useInfiniteScrollForSharedMedia(\n 'media', resultType, searchMessages, lastSyncTime, chatMessages, foundIds,\n );\n\n const [documentViewportIds, getMoreDocuments, noProfileInfoForDocuments] = useInfiniteScrollForSharedMedia(\n 'documents', resultType, searchMessages, lastSyncTime, chatMessages, foundIds,\n );\n\n const [linkViewportIds, getMoreLinks, noProfileInfoForLinks] = useInfiniteScrollForSharedMedia(\n 'links', resultType, searchMessages, lastSyncTime, chatMessages, foundIds,\n );\n\n const [audioViewportIds, getMoreAudio, noProfileInfoForAudio] = useInfiniteScrollForSharedMedia(\n 'audio', resultType, searchMessages, lastSyncTime, chatMessages, foundIds,\n );\n\n let viewportIds: number[] | undefined;\n let getMore: AnyToVoidFunction | undefined;\n let noProfileInfo = false;\n\n switch (resultType) {\n case 'members':\n viewportIds = memberViewportIds;\n getMore = getMoreMembers;\n noProfileInfo = noProfileInfoForMembers;\n break;\n case 'media':\n viewportIds = mediaViewportIds;\n getMore = getMoreMedia;\n noProfileInfo = noProfileInfoForMedia;\n break;\n case 'documents':\n viewportIds = documentViewportIds;\n getMore = getMoreDocuments;\n noProfileInfo = noProfileInfoForDocuments;\n break;\n case 'links':\n viewportIds = linkViewportIds;\n getMore = getMoreLinks;\n noProfileInfo = noProfileInfoForLinks;\n break;\n case 'audio':\n viewportIds = audioViewportIds;\n getMore = getMoreAudio;\n noProfileInfo = noProfileInfoForAudio;\n break;\n }\n\n return [resultType, viewportIds, getMore, noProfileInfo] as const;\n}\n\nfunction useInfiniteScrollForMembers(\n currentResultType?: ProfileTabType,\n handleLoadMore?: AnyToVoidFunction,\n lastSyncTime?: number,\n memberIds?: number[],\n) {\n const [viewportIds, getMore] = useInfiniteScroll(\n lastSyncTime ? handleLoadMore : undefined,\n memberIds,\n undefined,\n MEMBERS_SLICE,\n );\n\n const isOnTop = !viewportIds || !memberIds || viewportIds[0] === memberIds[0];\n\n return [viewportIds, getMore, !isOnTop] as const;\n}\n\nfunction useInfiniteScrollForSharedMedia(\n forSharedMediaType: SharedMediaType,\n currentResultType?: ProfileTabType,\n handleLoadMore?: AnyToVoidFunction,\n lastSyncTime?: number,\n chatMessages?: Record,\n foundIds?: number[],\n) {\n const messageIdsRef = useRef();\n\n useOnChange(() => {\n if (currentResultType === forSharedMediaType && chatMessages && foundIds) {\n messageIdsRef.current = getMessageContentIds(\n chatMessages,\n foundIds,\n forSharedMediaType,\n ).reverse();\n }\n }, [chatMessages, foundIds, currentResultType, forSharedMediaType]);\n\n const [viewportIds, getMore] = useInfiniteScroll(\n lastSyncTime ? handleLoadMore : undefined,\n messageIdsRef.current,\n undefined,\n forSharedMediaType === 'media' ? SHARED_MEDIA_SLICE : MESSAGE_SEARCH_SLICE,\n );\n\n const isOnTop = !viewportIds || !messageIdsRef.current || viewportIds[0] === messageIdsRef.current[0];\n\n return [viewportIds, getMore, !isOnTop] as const;\n}\n","import { useCallback, useEffect } from '../../../lib/teact/teact';\n\nimport { ProfileState } from '../../../types';\n\nimport fastSmoothScroll from '../../../util/fastSmoothScroll';\nimport { throttle } from '../../../util/schedulers';\nimport useEffectWithPrevDeps from '../../../hooks/useEffectWithPrevDeps';\n\nconst TRANSITION_DURATION = 300;\nconst PROGRAMMATIC_SCROLL_TIMEOUT_MS = 350;\n\nconst runThrottledForScroll = throttle((cb) => cb(), 250, false);\n\nlet isScrollingProgrammatically = false;\n\nexport default function useProfileState(\n containerRef: { current: HTMLDivElement | null },\n tabType: string,\n profileState: ProfileState,\n onProfileStateChange: (state: ProfileState) => void,\n) {\n // Scroll to tabs if needed\n useEffectWithPrevDeps(([prevTabType]) => {\n if (prevTabType && prevTabType !== tabType) {\n const container = containerRef.current!;\n const tabsEl = container.querySelector('.TabList')!;\n if (container.scrollTop < tabsEl.offsetTop) {\n onProfileStateChange(tabType === 'members' ? ProfileState.MemberList : ProfileState.SharedMedia);\n isScrollingProgrammatically = true;\n fastSmoothScroll(container, tabsEl, 'start', undefined, undefined, undefined, TRANSITION_DURATION);\n setTimeout(() => {\n isScrollingProgrammatically = false;\n }, PROGRAMMATIC_SCROLL_TIMEOUT_MS);\n }\n }\n }, [tabType, onProfileStateChange]);\n\n // Scroll to top\n useEffectWithPrevDeps(([prevProfileState]) => {\n if (profileState !== ProfileState.Profile || profileState === prevProfileState) {\n return;\n }\n\n const container = containerRef.current;\n if (!container) {\n return;\n }\n\n const tabListEl = container.querySelector('.TabList');\n if (!tabListEl) {\n return;\n }\n\n isScrollingProgrammatically = true;\n fastSmoothScroll(\n container,\n container.firstElementChild as HTMLElement,\n 'start',\n undefined,\n container.offsetHeight * 2,\n );\n\n setTimeout(() => {\n isScrollingProgrammatically = false;\n }, PROGRAMMATIC_SCROLL_TIMEOUT_MS);\n\n onProfileStateChange(profileState);\n }, [profileState]);\n\n const determineProfileState = useCallback(() => {\n const container = containerRef.current;\n if (!container) {\n return;\n }\n\n const tabListEl = container.querySelector('.TabList');\n if (!tabListEl) {\n return;\n }\n\n let state: ProfileState = ProfileState.Profile;\n if (container.scrollTop >= tabListEl.offsetTop) {\n state = tabType === 'members'\n ? ProfileState.MemberList\n : ProfileState.SharedMedia;\n }\n\n onProfileStateChange(state);\n }, [containerRef, onProfileStateChange, tabType]);\n\n // Determine profile state when switching tabs\n useEffect(() => {\n if (isScrollingProgrammatically) {\n return;\n }\n\n determineProfileState();\n }, [determineProfileState, tabType]);\n\n // Determine profile state when scrolling\n const handleScroll = useCallback(() => {\n if (isScrollingProgrammatically) {\n return;\n }\n\n runThrottledForScroll(determineProfileState);\n }, [determineProfileState]);\n\n return { handleScroll };\n}\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport { selectCurrentChat, selectUser } from '../../modules/selectors';\nimport { getUserFirstOrLastName } from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n userId?: number;\n onClose: () => void;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n contactName?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst DeleteMemberModal: FC = ({\n isOpen,\n chat,\n userId,\n contactName,\n onClose,\n deleteChatMember,\n}) => {\n const lang = useLang();\n\n const handleDeleteChatMember = useCallback(() => {\n deleteChatMember({ chatId: chat!.id, userId });\n onClose();\n }, [chat, deleteChatMember, onClose, userId]);\n\n if (!chat || !userId) {\n return undefined;\n }\n\n return (\n \n

{renderText(lang('PeerInfo.Confirm.RemovePeer', contactName))}

\n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { userId }): StateProps => {\n const chat = selectCurrentChat(global);\n const user = userId && selectUser(global, userId);\n const contactName = user ? getUserFirstOrLastName(user) : undefined;\n\n return {\n chat,\n contactName,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['deleteChatMember']),\n)(DeleteMemberModal));\n","import React, {\n FC, useCallback, useEffect, useMemo, useRef, useState, memo,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiMessage,\n ApiChatMember,\n ApiUser,\n MAIN_THREAD_ID,\n} from '../../api/types';\nimport { GlobalActions } from '../../global/types';\nimport {\n NewChatMembersProgress, ISettings, MediaViewerOrigin, ProfileState, ProfileTabType, SharedMediaType,\n} from '../../types';\n\nimport {\n MEMBERS_SLICE,\n PROFILE_SENSITIVE_AREA,\n SHARED_MEDIA_SLICE,\n SLIDE_TRANSITION_DURATION,\n} from '../../config';\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport {\n getHasAdminRight, isChatAdmin, isChatChannel, isChatGroup, isChatPrivate,\n} from '../../modules/helpers';\nimport {\n selectChatMessages,\n selectChat,\n selectCurrentMediaSearch,\n selectIsRightColumnShown,\n selectTheme,\n} from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\nimport { captureEvents, SwipeDirection } from '../../util/captureEvents';\nimport useCacheBuster from '../../hooks/useCacheBuster';\nimport useProfileViewportIds from './hooks/useProfileViewportIds';\nimport useProfileState from './hooks/useProfileState';\nimport useTransitionFixes from './hooks/useTransitionFixes';\nimport useAsyncRendering from './hooks/useAsyncRendering';\nimport useLang from '../../hooks/useLang';\n\nimport Transition from '../ui/Transition';\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport TabList from '../ui/TabList';\nimport Spinner from '../ui/Spinner';\nimport ListItem from '../ui/ListItem';\nimport PrivateChatInfo from '../common/PrivateChatInfo';\nimport ProfileInfo from '../common/ProfileInfo';\nimport Document from '../common/Document';\nimport Audio from '../common/Audio';\nimport ChatExtra from '../common/ChatExtra';\nimport Media from '../common/Media';\nimport WebLink from '../common/WebLink';\nimport NothingFound from '../common/NothingFound';\nimport FloatingActionButton from '../ui/FloatingActionButton';\nimport DeleteMemberModal from './DeleteMemberModal';\n\nimport './Profile.scss';\n\ntype OwnProps = {\n chatId: number;\n userId?: number;\n profileState: ProfileState;\n onProfileStateChange: (state: ProfileState) => void;\n};\n\ntype StateProps = {\n theme: ISettings['theme'];\n isChannel?: boolean;\n currentUserId?: number;\n resolvedUserId?: number;\n chatMessages?: Record;\n foundIds?: number[];\n mediaSearchType?: SharedMediaType;\n hasMembersTab?: boolean;\n areMembersHidden?: boolean;\n canAddMembers?: boolean;\n canDeleteMembers?: boolean;\n members?: ApiChatMember[];\n usersById?: Record;\n isRightColumnShown: boolean;\n isRestricted?: boolean;\n lastSyncTime?: number;\n serverTimeOffset: number;\n};\n\ntype DispatchProps = Pick;\n\nconst TABS = [\n { type: 'media', title: 'SharedMediaTab2' },\n { type: 'documents', title: 'SharedFilesTab2' },\n { type: 'links', title: 'SharedLinksTab2' },\n { type: 'audio', title: 'SharedMusicTab2' },\n];\n\nconst HIDDEN_RENDER_DELAY = 1000;\n\nconst Profile: FC = ({\n chatId,\n profileState,\n onProfileStateChange,\n theme,\n isChannel,\n resolvedUserId,\n currentUserId,\n chatMessages,\n foundIds,\n mediaSearchType,\n hasMembersTab,\n areMembersHidden,\n canAddMembers,\n canDeleteMembers,\n members,\n usersById,\n isRightColumnShown,\n isRestricted,\n lastSyncTime,\n setLocalMediaSearchType,\n loadMoreMembers,\n searchMediaMessagesLocal,\n openMediaViewer,\n openAudioPlayer,\n openUserInfo,\n focusMessage,\n loadProfilePhotos,\n setNewChatMembersDialogState,\n serverTimeOffset,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const transitionRef = useRef(null);\n const lang = useLang();\n const [activeTab, setActiveTab] = useState(0);\n const [deletingUserId, setDeletingUserId] = useState();\n\n const tabs = useMemo(() => ([\n ...(hasMembersTab ? [{\n type: 'members', title: isChannel ? 'ChannelSubscribers' : 'GroupMembers',\n }] : []),\n ...TABS,\n ]), [hasMembersTab, isChannel]);\n const tabType = tabs[activeTab].type as ProfileTabType;\n\n const [resultType, viewportIds, getMore, noProfileInfo] = useProfileViewportIds(\n isRightColumnShown, loadMoreMembers, searchMediaMessagesLocal, tabType, mediaSearchType, members,\n usersById, chatMessages, foundIds, chatId, lastSyncTime, serverTimeOffset,\n );\n const activeKey = tabs.findIndex(({ type }) => type === resultType);\n\n const { handleScroll } = useProfileState(containerRef, tabType, profileState, onProfileStateChange);\n\n const { applyTransitionFix, releaseTransitionFix } = useTransitionFixes(containerRef);\n\n const [cacheBuster, resetCacheBuster] = useCacheBuster();\n\n const handleTransitionStop = useCallback(() => {\n releaseTransitionFix();\n resetCacheBuster();\n }, [releaseTransitionFix, resetCacheBuster]);\n\n const handleNewMemberDialogOpen = useCallback(() => {\n setNewChatMembersDialogState(NewChatMembersProgress.InProgress);\n }, [setNewChatMembersDialogState]);\n\n // Update search type when switching tabs\n useEffect(() => {\n setLocalMediaSearchType({ mediaType: tabType });\n }, [setLocalMediaSearchType, tabType]);\n\n const profileId = resolvedUserId || chatId;\n\n useEffect(() => {\n if (lastSyncTime) {\n loadProfilePhotos({ profileId });\n }\n }, [loadProfilePhotos, profileId, lastSyncTime]);\n\n const handleSelectMedia = useCallback((messageId: number) => {\n openMediaViewer({\n chatId: profileId,\n threadId: MAIN_THREAD_ID,\n messageId,\n origin: MediaViewerOrigin.SharedMedia,\n });\n }, [profileId, openMediaViewer]);\n\n const handlePlayAudio = useCallback((messageId: number) => {\n openAudioPlayer({ chatId: profileId, messageId });\n }, [profileId, openAudioPlayer]);\n\n const handleMemberClick = useCallback((id: number) => {\n openUserInfo({ id });\n }, [openUserInfo]);\n\n const handleMessageFocus = useCallback((messageId: number) => {\n focusMessage({ chatId: profileId, messageId });\n }, [profileId, focusMessage]);\n\n const handleDeleteMembersModalClose = useCallback(() => {\n setDeletingUserId(undefined);\n }, []);\n\n useEffect(() => {\n if (!transitionRef.current || !IS_TOUCH_ENV) {\n return undefined;\n }\n\n return captureEvents(transitionRef.current, {\n selectorToPreventScroll: '.Profile',\n onSwipe: ((e, direction) => {\n if (direction === SwipeDirection.Left) {\n setActiveTab(Math.min(activeTab + 1, tabs.length - 1));\n return true;\n } else if (direction === SwipeDirection.Right) {\n setActiveTab(Math.max(0, activeTab - 1));\n return true;\n }\n\n return false;\n }),\n });\n }, [activeTab, tabs.length]);\n\n let renderingDelay;\n const isFirstTab = resultType === 'members' || (!hasMembersTab && resultType === 'media');\n // @optimization Used to unparallelize rendering of message list and profile media\n if (isFirstTab) {\n renderingDelay = !isRightColumnShown ? HIDDEN_RENDER_DELAY : 0;\n // @optimization Used to delay first render of secondary tabs while animating\n } else if (!viewportIds) {\n renderingDelay = SLIDE_TRANSITION_DURATION;\n }\n const canRenderContents = useAsyncRendering([chatId, resultType], renderingDelay);\n\n function getMemberContextAction(id: number) {\n return id === currentUserId || !canDeleteMembers ? undefined : [{\n title: lang('lng_context_remove_from_group'),\n icon: 'stop',\n handler: () => {\n setDeletingUserId(id);\n },\n }];\n }\n\n function renderSharedMedia() {\n if (!viewportIds || !canRenderContents || !chatMessages) {\n // This is just a single-frame delay, so we do not show spinner\n const noSpinner = isFirstTab && viewportIds && !canRenderContents;\n\n return (\n
\n {!noSpinner && }\n
\n );\n }\n\n if (!viewportIds.length) {\n let text: string;\n\n switch (resultType) {\n case 'members':\n text = areMembersHidden ? 'You have no access to group members list.' : 'No members found';\n break;\n case 'documents':\n text = lang('lng_media_file_empty_search');\n break;\n case 'links':\n text = lang('lng_media_link_empty_search');\n break;\n case 'audio':\n text = lang('lng_media_song_empty_search');\n break;\n default:\n text = lang('SharedMedia.EmptyTitle');\n }\n\n return (\n
\n \n
\n );\n }\n\n return (\n \n {resultType === 'media' ? (\n viewportIds!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'documents' ? (\n viewportIds!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'links' ? (\n viewportIds!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'audio' ? (\n viewportIds!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'members' ? (\n viewportIds!.map((id, i) => (\n handleMemberClick(id)}\n contextActions={getMemberContextAction(id)}\n >\n \n \n ))\n ) : undefined}\n
\n );\n }\n\n return (\n \n {!noProfileInfo && renderProfileInfo(chatId, resolvedUserId)}\n {!isRestricted && (\n \n \n {renderSharedMedia}\n \n \n\n
\n )}\n\n {canAddMembers && (\n \n \n \n )}\n {canDeleteMembers && (\n \n )}\n \n );\n};\n\nfunction renderProfileInfo(chatId: number, resolvedUserId?: number) {\n return (\n
\n \n \n
\n );\n}\n\nfunction buildInfiniteScrollItemSelector(resultType: string) {\n return [\n // Used on first render\n `.shared-media-transition > div:only-child > .${resultType}-list > .scroll-item`,\n // Used after transition\n `.shared-media-transition > div.active > .${resultType}-list > .scroll-item`,\n ].join(', ');\n}\n\nexport default memo(withGlobal(\n (global, { chatId, userId }): StateProps => {\n const chat = selectChat(global, chatId);\n\n const chatMessages = selectChatMessages(global, userId || chatId);\n const { currentType: mediaSearchType, resultsByType } = selectCurrentMediaSearch(global) || {};\n const { foundIds } = (resultsByType && mediaSearchType && resultsByType[mediaSearchType]) || {};\n\n const { byId: usersById } = global.users;\n\n const isGroup = chat && isChatGroup(chat);\n const isChannel = chat && isChatChannel(chat);\n const hasMembersTab = isGroup || (isChannel && isChatAdmin(chat!));\n const members = chat?.fullInfo?.members;\n const areMembersHidden = hasMembersTab && chat && chat.fullInfo && !chat.fullInfo.canViewMembers;\n const canAddMembers = hasMembersTab && chat && (getHasAdminRight(chat, 'inviteUsers') || chat.isCreator);\n const canDeleteMembers = hasMembersTab && chat && (getHasAdminRight(chat, 'banUsers') || chat.isCreator);\n\n let resolvedUserId;\n if (userId) {\n resolvedUserId = userId;\n } else if (isChatPrivate(chatId)) {\n resolvedUserId = chatId;\n }\n\n return {\n theme: selectTheme(global),\n isChannel,\n resolvedUserId,\n chatMessages,\n foundIds,\n mediaSearchType,\n hasMembersTab,\n areMembersHidden,\n canAddMembers,\n canDeleteMembers,\n currentUserId: global.currentUserId,\n isRightColumnShown: selectIsRightColumnShown(global),\n isRestricted: chat?.isRestricted,\n lastSyncTime: global.lastSyncTime,\n serverTimeOffset: global.serverTimeOffset,\n ...(hasMembersTab && members && {\n members,\n usersById,\n }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setLocalMediaSearchType',\n 'loadMoreMembers',\n 'searchMediaMessagesLocal',\n 'openMediaViewer',\n 'openAudioPlayer',\n 'openUserInfo',\n 'focusMessage',\n 'loadProfilePhotos',\n 'setNewChatMembersDialogState',\n ]),\n)(Profile));\n","import { useCallback, useEffect } from '../../../lib/teact/teact';\n\nexport default function useTransitionFixes(\n containerRef: { current: HTMLDivElement | null },\n transitionElSelector = '.Transition.shared-media-transition',\n) {\n // Set `min-height` for shared media container to prevent jumping when switching tabs\n useEffect(() => {\n function setMinHeight() {\n const container = containerRef.current!;\n const transitionEl = container.querySelector(transitionElSelector);\n const tabsEl = container.querySelector('.TabList');\n if (transitionEl && tabsEl) {\n transitionEl.style.minHeight = `${container.offsetHeight - tabsEl.offsetHeight}px`;\n }\n }\n\n setMinHeight();\n\n window.addEventListener('resize', setMinHeight, false);\n\n return () => {\n window.removeEventListener('resize', setMinHeight, false);\n };\n }, [containerRef, transitionElSelector]);\n\n // Workaround for scrollable content flickering during animation.\n const applyTransitionFix = useCallback(() => {\n const container = containerRef.current!;\n if (container.style.overflowY !== 'hidden') {\n const scrollBarWidth = container.offsetWidth - container.clientWidth;\n container.style.overflowY = 'hidden';\n container.style.marginRight = `${scrollBarWidth}px`;\n }\n }, [containerRef]);\n\n const releaseTransitionFix = useCallback(() => {\n const container = containerRef.current!;\n container.style.overflowY = 'scroll';\n container.style.marginRight = '0';\n }, [containerRef]);\n\n return { applyTransitionFix, releaseTransitionFix };\n}\n","import { useCallback, useState } from '../lib/teact/teact';\n\nexport default () => {\n const [cacheBuster, setCacheBuster] = useState(false);\n\n const updateCacheBuster = useCallback(() => {\n setCacheBuster((current) => !current);\n }, []);\n\n return [cacheBuster, updateCacheBuster] as const;\n};\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './RightSearch';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst RightSearchAsync: FC = (props) => {\n const RightSearch = useModuleLoader(Bundles.Extra, 'RightSearch');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return RightSearch ? : ;\n};\n\nexport default memo(RightSearchAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport { OwnProps } from './Management';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nimport Loading from '../../ui/Loading';\n\nconst ManagementAsync: FC = (props) => {\n const Management = useModuleLoader(Bundles.Extra, 'Management');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return Management ? : ;\n};\n\nexport default memo(ManagementAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst StickerSearchAsync: FC = () => {\n const StickerSearch = useModuleLoader(Bundles.Extra, 'StickerSearch');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return StickerSearch ? : ;\n};\n\nexport default memo(StickerSearchAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst GifSearchAsync: FC = () => {\n const GifSearch = useModuleLoader(Bundles.Extra, 'GifSearch');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return GifSearch ? : ;\n};\n\nexport default memo(GifSearchAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst PollResultsAsync: FC = () => {\n const PollResults = useModuleLoader(Bundles.Extra, 'PollResults');\n\n return PollResults ? : ;\n};\n\nexport default memo(PollResultsAsync);\n","import React, {\n FC, useCallback, useMemo, memo, useState, useEffect,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport {\n ApiChat, ApiChatMember, ApiUpdateConnectionStateType, ApiUser,\n} from '../../api/types';\nimport { NewChatMembersProgress } from '../../types';\n\nimport { pick, unique } from '../../util/iteratees';\nimport { selectChat } from '../../modules/selectors';\nimport searchWords from '../../util/searchWords';\nimport {\n getUserFullName, isChatChannel, isUserBot, sortChatIds,\n} from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport usePrevious from '../../hooks/usePrevious';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Picker from '../common/Picker';\nimport FloatingActionButton from '../ui/FloatingActionButton';\nimport Spinner from '../ui/Spinner';\n\nimport './AddChatMembers.scss';\n\nexport type OwnProps = {\n chatId: number;\n isActive: boolean;\n onNextStep: (memberIds: number[]) => void;\n onClose: NoneToVoidFunction;\n};\n\ntype StateProps = {\n connectionState?: ApiUpdateConnectionStateType;\n isChannel?: boolean;\n members?: ApiChatMember[];\n currentUserId?: number;\n usersById: Record;\n chatsById: Record;\n localContactIds?: number[];\n searchQuery?: string;\n isLoading: boolean;\n isSearching?: boolean;\n localUserIds?: number[];\n globalUserIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst AddChatMembers: FC = ({\n isChannel,\n connectionState,\n members,\n onNextStep,\n currentUserId,\n usersById,\n chatsById,\n localContactIds,\n isLoading,\n searchQuery,\n isSearching,\n localUserIds,\n globalUserIds,\n setUserSearchQuery,\n onClose,\n isActive,\n loadContactList,\n}) => {\n const lang = useLang();\n const [selectedMemberIds, setSelectedMemberIds] = useState([]);\n const prevSelectedMemberIds = usePrevious(selectedMemberIds);\n const noPickerScrollRestore = prevSelectedMemberIds === selectedMemberIds;\n\n useEffect(() => {\n if (isActive && connectionState === 'connectionStateReady') {\n loadContactList();\n }\n }, [connectionState, isActive, loadContactList]);\n\n useHistoryBack(isActive, onClose);\n\n const memberIds = useMemo(() => {\n return members ? members.map((member) => member.userId) : [];\n }, [members]);\n\n const handleFilterChange = useCallback((query: string) => {\n setUserSearchQuery({ query });\n }, [setUserSearchQuery]);\n\n const displayedIds = useMemo(() => {\n const contactIds = localContactIds\n ? sortChatIds(localContactIds.filter((id) => id !== currentUserId), chatsById)\n : [];\n\n if (!searchQuery) {\n return contactIds.filter((id) => !memberIds.includes(id));\n }\n\n const foundContactIds = contactIds.filter((id) => {\n const user = usersById[id];\n if (!user) {\n return false;\n }\n const fullName = getUserFullName(user);\n return fullName && searchWords(fullName, searchQuery);\n });\n\n return sortChatIds(\n unique([\n ...foundContactIds,\n ...(localUserIds || []),\n ...(globalUserIds || []),\n ]).filter((contactId) => {\n const user = usersById[contactId];\n\n // The user can be added to the chat if the following conditions are met:\n // the user has not yet been added to the current chat\n // AND (it is not found (user from global search) OR it is not a bot OR it is a bot,\n // but the current chat is not a channel AND the appropriate permission is set).\n return !memberIds.includes(contactId)\n && (!user || !isUserBot(user) || (!isChannel && user.canBeInvitedToGroup));\n }),\n chatsById,\n );\n }, [\n localContactIds, chatsById, searchQuery, localUserIds, globalUserIds,\n currentUserId, usersById, memberIds, isChannel,\n ]);\n\n const handleNextStep = useCallback(() => {\n if (selectedMemberIds.length) {\n setUserSearchQuery({ query: '' });\n onNextStep(selectedMemberIds);\n }\n }, [selectedMemberIds, setUserSearchQuery, onNextStep]);\n\n return (\n
\n
\n \n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { userIds: localContactIds } = global.contactList || {};\n const { byId: usersById } = global.users;\n const { byId: chatsById } = global.chats;\n const { currentUserId, newChatMembersProgress, connectionState } = global;\n const isChannel = chat && isChatChannel(chat);\n\n const {\n query: searchQuery,\n fetchingStatus,\n globalUserIds,\n localUserIds,\n } = global.userSearch;\n\n return {\n isChannel,\n members: chat?.fullInfo?.members,\n currentUserId,\n usersById,\n chatsById,\n localContactIds,\n searchQuery,\n isSearching: fetchingStatus,\n isLoading: newChatMembersProgress === NewChatMembersProgress.Loading,\n globalUserIds,\n localUserIds,\n connectionState,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadContactList', 'setUserSearchQuery']),\n)(AddChatMembers));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport {\n ManagementScreens, NewChatMembersProgress, ProfileState, RightColumnContent,\n} from '../../types';\n\nimport { MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN } from '../../config';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport { pick } from '../../util/iteratees';\nimport {\n selectAreActiveChatsLoaded,\n selectCurrentMessageList,\n selectRightColumnContentKey,\n} from '../../modules/selectors';\nimport useLayoutEffectWithPrevDeps from '../../hooks/useLayoutEffectWithPrevDeps';\nimport useWindowSize from '../../hooks/useWindowSize';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport RightHeader from './RightHeader';\nimport Profile from './Profile';\nimport Transition from '../ui/Transition';\nimport RightSearch from './RightSearch.async';\nimport Management from './management/Management.async';\nimport StickerSearch from './StickerSearch.async';\nimport GifSearch from './GifSearch.async';\nimport PollResults from './PollResults.async';\nimport AddChatMembers from './AddChatMembers';\n\nimport './RightColumn.scss';\n\ntype StateProps = {\n contentKey?: RightColumnContent;\n chatId?: number;\n threadId?: number;\n currentProfileUserId?: number;\n isChatSelected: boolean;\n shouldSkipHistoryAnimations?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst COLUMN_CLOSE_DELAY_MS = 300;\nconst MAIN_SCREENS_COUNT = Object.keys(RightColumnContent).length / 2;\nconst MANAGEMENT_SCREENS_COUNT = Object.keys(ManagementScreens).length / 2;\n\nfunction blurSearchInput() {\n const searchInput = document.querySelector('.RightHeader .SearchInput input') as HTMLInputElement;\n if (searchInput) {\n searchInput.blur();\n }\n}\n\nconst RightColumn: FC = ({\n contentKey,\n chatId,\n threadId,\n currentProfileUserId,\n isChatSelected,\n toggleChatInfo,\n toggleManagement,\n openUserInfo,\n closeLocalTextSearch,\n setStickerSearchQuery,\n setGifSearchQuery,\n closePollResults,\n addChatMembers,\n setNewChatMembersDialogState,\n shouldSkipHistoryAnimations,\n}) => {\n const { width: windowWidth } = useWindowSize();\n const [profileState, setProfileState] = useState(ProfileState.Profile);\n const [managementScreen, setManagementScreen] = useState(ManagementScreens.Initial);\n const [selectedChatMemberId, setSelectedChatMemberId] = useState();\n const [isPromotedByCurrentUser, setIsPromotedByCurrentUser] = useState();\n const isScrolledDown = profileState !== ProfileState.Profile;\n\n const isOpen = contentKey !== undefined;\n const isProfile = contentKey === RightColumnContent.ChatInfo || contentKey === RightColumnContent.UserInfo;\n const isSearch = contentKey === RightColumnContent.Search;\n const isManagement = contentKey === RightColumnContent.Management;\n const isStickerSearch = contentKey === RightColumnContent.StickerSearch;\n const isGifSearch = contentKey === RightColumnContent.GifSearch;\n const isPollResults = contentKey === RightColumnContent.PollResults;\n const isAddingChatMembers = contentKey === RightColumnContent.AddingMembers;\n const isOverlaying = windowWidth <= MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN;\n\n const [shouldSkipTransition, setShouldSkipTransition] = useState(!isOpen);\n\n const renderingContentKey = useCurrentOrPrev(contentKey, true, !isChatSelected) ?? -1;\n\n const close = useCallback((shouldScrollUp = true) => {\n switch (contentKey) {\n case RightColumnContent.AddingMembers:\n setNewChatMembersDialogState(NewChatMembersProgress.Closed);\n break;\n case RightColumnContent.ChatInfo:\n if (isScrolledDown && shouldScrollUp) {\n setProfileState(ProfileState.Profile);\n break;\n }\n toggleChatInfo(undefined, true);\n break;\n case RightColumnContent.UserInfo:\n if (isScrolledDown && shouldScrollUp) {\n setProfileState(ProfileState.Profile);\n break;\n }\n openUserInfo({ id: undefined }, true);\n break;\n case RightColumnContent.Management: {\n switch (managementScreen) {\n case ManagementScreens.Initial:\n toggleManagement();\n break;\n case ManagementScreens.ChatPrivacyType:\n case ManagementScreens.Discussion:\n case ManagementScreens.GroupPermissions:\n case ManagementScreens.GroupType:\n case ManagementScreens.ChatAdministrators:\n case ManagementScreens.ChannelSubscribers:\n case ManagementScreens.GroupMembers:\n setManagementScreen(ManagementScreens.Initial);\n break;\n case ManagementScreens.GroupUserPermissionsCreate:\n case ManagementScreens.GroupRemovedUsers:\n case ManagementScreens.GroupUserPermissions:\n setManagementScreen(ManagementScreens.GroupPermissions);\n setSelectedChatMemberId(undefined);\n setIsPromotedByCurrentUser(undefined);\n break;\n case ManagementScreens.ChatAdminRights:\n case ManagementScreens.GroupRecentActions:\n setManagementScreen(ManagementScreens.ChatAdministrators);\n break;\n }\n\n break;\n }\n case RightColumnContent.Search: {\n blurSearchInput();\n closeLocalTextSearch();\n break;\n }\n case RightColumnContent.StickerSearch:\n blurSearchInput();\n setStickerSearchQuery({ query: undefined });\n break;\n case RightColumnContent.GifSearch: {\n blurSearchInput();\n setGifSearchQuery({ query: undefined });\n break;\n }\n case RightColumnContent.PollResults:\n closePollResults();\n break;\n }\n }, [\n contentKey, isScrolledDown, toggleChatInfo, openUserInfo, closePollResults, setNewChatMembersDialogState,\n managementScreen, toggleManagement, closeLocalTextSearch, setStickerSearchQuery, setGifSearchQuery,\n ]);\n\n const handleSelectChatMember = useCallback((memberId, isPromoted) => {\n setSelectedChatMemberId(memberId);\n setIsPromotedByCurrentUser(isPromoted);\n }, []);\n\n const handleAppendingChatMembers = useCallback((memberIds: number[]) => {\n addChatMembers({ chatId, memberIds });\n }, [addChatMembers, chatId]);\n\n useEffect(() => (isOpen ? captureEscKeyListener(close) : undefined), [isOpen, close]);\n\n useEffect(() => {\n setTimeout(() => {\n setShouldSkipTransition(!isOpen);\n }, COLUMN_CLOSE_DELAY_MS);\n }, [isOpen]);\n\n // Close Right Column when it transforms into overlayed state on screen resize\n useEffect(() => {\n if (isOpen && isOverlaying) {\n close();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOverlaying]);\n\n // We need to clear profile state and management screen state, when changing chats\n useLayoutEffectWithPrevDeps(([prevContentKey, prevChatId]) => {\n if (\n (prevContentKey === RightColumnContent.ChatInfo && contentKey === RightColumnContent.UserInfo)\n || (prevContentKey === RightColumnContent.UserInfo && contentKey === RightColumnContent.ChatInfo)\n || (prevChatId !== chatId)\n ) {\n setProfileState(ProfileState.Profile);\n setManagementScreen(ManagementScreens.Initial);\n }\n }, [contentKey, chatId]);\n\n useHistoryBack(isChatSelected && (contentKey === RightColumnContent.ChatInfo\n || contentKey === RightColumnContent.UserInfo || contentKey === RightColumnContent.Management\n || contentKey === RightColumnContent.AddingMembers),\n () => close(false), toggleChatInfo);\n\n // eslint-disable-next-line consistent-return\n function renderContent(isActive: boolean) {\n if (renderingContentKey === -1) {\n return undefined;\n }\n\n switch (renderingContentKey) {\n case RightColumnContent.AddingMembers:\n return (\n \n );\n case RightColumnContent.ChatInfo:\n case RightColumnContent.UserInfo:\n return (\n \n );\n case RightColumnContent.Search:\n return ;\n case RightColumnContent.Management:\n return (\n \n );\n\n case RightColumnContent.StickerSearch:\n return ;\n case RightColumnContent.GifSearch:\n return ;\n case RightColumnContent.PollResults:\n return ;\n }\n }\n\n return (\n \n {isOverlaying && (\n
\n )}\n
\n \n \n {renderContent}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n const areActiveChatsLoaded = selectAreActiveChatsLoaded(global);\n\n return {\n contentKey: selectRightColumnContentKey(global),\n chatId,\n threadId,\n currentProfileUserId: global.users.selectedId,\n isChatSelected: Boolean(chatId && areActiveChatsLoaded),\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openUserInfo',\n 'toggleChatInfo',\n 'toggleManagement',\n 'closeLocalTextSearch',\n 'setStickerSearchQuery',\n 'setGifSearchQuery',\n 'closePollResults',\n 'addChatMembers',\n 'setNewChatMembersDialogState',\n ]),\n)(RightColumn));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport { Bundles } from '../../util/moduleLoader';\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\ninterface OwnProps {\n isOpen: boolean;\n}\n\nconst MediaViewerAsync: FC = ({ isOpen }) => {\n const MediaViewer = useModuleLoader(Bundles.Extra, 'MediaViewer', !isOpen);\n\n return MediaViewer ? : undefined;\n};\n\nexport default memo(MediaViewerAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst NotificationsAsync: FC = ({ isOpen }) => {\n const Notifications = useModuleLoader(Bundles.Extra, 'Notifications', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return Notifications ? : undefined;\n};\n\nexport default memo(NotificationsAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst DialogsAsync: FC = ({ isOpen }) => {\n const Dialogs = useModuleLoader(Bundles.Extra, 'Dialogs', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return Dialogs ? : undefined;\n};\n\nexport default memo(DialogsAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\nimport { OwnProps } from './ForwardPicker';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst ForwardPickerAsync: FC = (props) => {\n const { isOpen } = props;\n const ForwardPicker = useModuleLoader(Bundles.Extra, 'ForwardPicker', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ForwardPicker ? : undefined;\n};\n\nexport default memo(ForwardPickerAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport { OwnProps } from './SafeLinkModal';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst SafeLinkModalAsync: FC = (props) => {\n const { url } = props;\n const SafeLinkModal = useModuleLoader(Bundles.Extra, 'SafeLinkModal', !url);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return SafeLinkModal ? : undefined;\n};\n\nexport default memo(SafeLinkModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport { OwnProps } from './HistoryCalendar';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst HistoryCalendarAsync: FC = (props) => {\n const { isOpen } = props;\n const HistoryCalendar = useModuleLoader(Bundles.Extra, 'HistoryCalendar', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return HistoryCalendar ? : undefined;\n};\n\nexport default memo(HistoryCalendarAsync);\n","import React, {\n FC, useEffect, memo, useCallback,\n} from '../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiMessage } from '../../api/types';\nimport { LangCode } from '../../types';\n\nimport '../../modules/actions/all';\nimport {\n BASE_EMOJI_KEYWORD_LANG, DEBUG, INACTIVE_MARKER, PAGE_TITLE,\n} from '../../config';\nimport { pick } from '../../util/iteratees';\nimport {\n selectChatMessage,\n selectCountNotMutedUnread,\n selectIsForwardModalOpen,\n selectIsMediaViewerOpen,\n selectIsRightColumnShown,\n} from '../../modules/selectors';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport buildClassName from '../../util/buildClassName';\nimport { fastRaf } from '../../util/schedulers';\nimport { waitForTransitionEnd } from '../../util/cssAnimationEndListeners';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useBackgroundMode from '../../hooks/useBackgroundMode';\nimport useBeforeUnload from '../../hooks/useBeforeUnload';\nimport useOnChange from '../../hooks/useOnChange';\nimport usePreventIosPinchZoom from '../../hooks/usePreventIosPinchZoom';\nimport { processDeepLink } from '../../util/deeplink';\nimport { LOCATION_HASH } from '../../hooks/useHistoryBack';\n\nimport LeftColumn from '../left/LeftColumn';\nimport MiddleColumn from '../middle/MiddleColumn';\nimport RightColumn from '../right/RightColumn';\nimport MediaViewer from '../mediaViewer/MediaViewer.async';\nimport AudioPlayer from '../middle/AudioPlayer';\nimport Notifications from './Notifications.async';\nimport Dialogs from './Dialogs.async';\nimport ForwardPicker from './ForwardPicker.async';\nimport SafeLinkModal from './SafeLinkModal.async';\nimport HistoryCalendar from './HistoryCalendar.async';\nimport StickerSetModal from '../common/StickerSetModal.async';\n\nimport './Main.scss';\n\ntype StateProps = {\n animationLevel: number;\n lastSyncTime?: number;\n isLeftColumnShown: boolean;\n isRightColumnShown: boolean;\n isMediaViewerOpen: boolean;\n isForwardModalOpen: boolean;\n hasNotifications: boolean;\n hasDialogs: boolean;\n audioMessage?: ApiMessage;\n safeLinkModalUrl?: string;\n isHistoryCalendarOpen: boolean;\n shouldSkipHistoryAnimations?: boolean;\n language?: LangCode;\n openedStickerSetShortName?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst NOTIFICATION_INTERVAL = 1000;\n\nlet notificationInterval: number | undefined;\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nlet DEBUG_isLogged = false;\n\nconst Main: FC = ({\n lastSyncTime,\n isLeftColumnShown,\n isRightColumnShown,\n isMediaViewerOpen,\n isForwardModalOpen,\n animationLevel,\n hasNotifications,\n hasDialogs,\n audioMessage,\n safeLinkModalUrl,\n isHistoryCalendarOpen,\n shouldSkipHistoryAnimations,\n language,\n openedStickerSetShortName,\n loadAnimatedEmojis,\n loadNotificationSettings,\n loadNotificationExceptions,\n updateIsOnline,\n loadTopInlineBots,\n loadEmojiKeywords,\n openStickerSetShortName,\n}) => {\n if (DEBUG && !DEBUG_isLogged) {\n DEBUG_isLogged = true;\n // eslint-disable-next-line no-console\n console.log('>>> RENDER MAIN');\n }\n\n // Initial API calls\n useEffect(() => {\n if (lastSyncTime) {\n updateIsOnline(true);\n loadAnimatedEmojis();\n loadNotificationSettings();\n loadNotificationExceptions();\n loadTopInlineBots();\n\n loadEmojiKeywords({ language: BASE_EMOJI_KEYWORD_LANG });\n if (language !== BASE_EMOJI_KEYWORD_LANG) {\n loadEmojiKeywords({ language });\n }\n }\n }, [\n lastSyncTime, loadAnimatedEmojis, loadNotificationExceptions, loadNotificationSettings, updateIsOnline,\n loadTopInlineBots, loadEmojiKeywords, language,\n ]);\n\n useEffect(() => {\n if (lastSyncTime && LOCATION_HASH.startsWith('#?tgaddr=')) {\n processDeepLink(decodeURIComponent(LOCATION_HASH.substr('#?tgaddr='.length)));\n }\n }, [lastSyncTime]);\n\n const {\n transitionClassNames: middleColumnTransitionClassNames,\n } = useShowTransition(!isLeftColumnShown, undefined, true, undefined, shouldSkipHistoryAnimations);\n\n const {\n transitionClassNames: rightColumnTransitionClassNames,\n } = useShowTransition(isRightColumnShown, undefined, true, undefined, shouldSkipHistoryAnimations);\n\n const className = buildClassName(\n middleColumnTransitionClassNames.replace(/([\\w-]+)/g, 'middle-column-$1'),\n rightColumnTransitionClassNames.replace(/([\\w-]+)/g, 'right-column-$1'),\n shouldSkipHistoryAnimations && 'history-animation-disabled',\n );\n\n // Dispatch heavy transition event when opening middle column\n useOnChange(([prevIsLeftColumnShown]) => {\n if (prevIsLeftColumnShown === undefined || animationLevel === 0) {\n return;\n }\n\n const dispatchHeavyAnimationEnd = dispatchHeavyAnimationEvent();\n\n waitForTransitionEnd(document.getElementById('MiddleColumn')!, dispatchHeavyAnimationEnd);\n }, [isLeftColumnShown]);\n\n // Dispatch heavy transition event and add body class when opening right column\n useOnChange(([prevIsRightColumnShown]) => {\n if (prevIsRightColumnShown === undefined || animationLevel === 0) {\n return;\n }\n\n fastRaf(() => {\n document.body.classList.add('animating-right-column');\n });\n\n const dispatchHeavyAnimationEnd = dispatchHeavyAnimationEvent();\n\n waitForTransitionEnd(document.getElementById('RightColumn')!, () => {\n dispatchHeavyAnimationEnd();\n\n fastRaf(() => {\n document.body.classList.remove('animating-right-column');\n });\n });\n }, [isRightColumnShown]);\n\n const handleBlur = useCallback(() => {\n updateIsOnline(false);\n\n const initialUnread = selectCountNotMutedUnread(getGlobal());\n let index = 0;\n\n clearInterval(notificationInterval);\n notificationInterval = window.setInterval(() => {\n if (document.title.includes(INACTIVE_MARKER)) {\n updateIcon(false);\n return;\n }\n\n if (index % 2 === 0) {\n const newUnread = selectCountNotMutedUnread(getGlobal()) - initialUnread;\n if (newUnread > 0) {\n updatePageTitle(`${newUnread} notification${newUnread > 1 ? 's' : ''}`);\n updateIcon(true);\n }\n } else {\n updatePageTitle(PAGE_TITLE);\n updateIcon(false);\n }\n\n index++;\n }, NOTIFICATION_INTERVAL);\n }, [updateIsOnline]);\n\n const handleFocus = useCallback(() => {\n updateIsOnline(true);\n\n clearInterval(notificationInterval);\n notificationInterval = undefined;\n\n if (!document.title.includes(INACTIVE_MARKER)) {\n updatePageTitle(PAGE_TITLE);\n }\n\n updateIcon(false);\n }, [updateIsOnline]);\n\n const handleStickerSetModalClose = useCallback(() => {\n openStickerSetShortName({ stickerSetShortName: undefined });\n }, [openStickerSetShortName]);\n\n // Online status and browser tab indicators\n useBackgroundMode(handleBlur, handleFocus);\n useBeforeUnload(handleBlur);\n\n usePreventIosPinchZoom(isMediaViewerOpen);\n\n function stopEvent(e: React.MouseEvent) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n return (\n
\n \n \n \n \n \n \n \n {audioMessage && }\n \n \n \n
\n );\n};\n\nfunction updateIcon(asUnread: boolean) {\n document.querySelectorAll('link[rel=\"icon\"]')\n .forEach((link) => {\n if (asUnread) {\n if (!link.href.includes('favicon-unread')) {\n link.href = link.href.replace('favicon', 'favicon-unread');\n }\n } else {\n link.href = link.href.replace('favicon-unread', 'favicon');\n }\n });\n}\n\n// For some reason setting `document.title` to the same value\n// causes increment of Chrome Dev Tools > Performance Monitor > DOM Nodes counter\nfunction updatePageTitle(nextTitle: string) {\n if (document.title !== nextTitle) {\n document.title = nextTitle;\n }\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { chatId: audioChatId, messageId: audioMessageId } = global.audioPlayer;\n const audioMessage = audioChatId && audioMessageId\n ? selectChatMessage(global, audioChatId, audioMessageId)\n : undefined;\n\n return {\n animationLevel: global.settings.byKey.animationLevel,\n lastSyncTime: global.lastSyncTime,\n isLeftColumnShown: global.isLeftColumnShown,\n isRightColumnShown: selectIsRightColumnShown(global),\n isMediaViewerOpen: selectIsMediaViewerOpen(global),\n isForwardModalOpen: selectIsForwardModalOpen(global),\n hasNotifications: Boolean(global.notifications.length),\n hasDialogs: Boolean(global.dialogs.length),\n audioMessage,\n safeLinkModalUrl: global.safeLinkModalUrl,\n isHistoryCalendarOpen: Boolean(global.historyCalendarSelectedAt),\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n language: global.settings.byKey.language,\n openedStickerSetShortName: global.openedStickerSetShortName,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadAnimatedEmojis', 'loadNotificationSettings', 'loadNotificationExceptions', 'updateIsOnline',\n 'loadTopInlineBots', 'loadEmojiKeywords', 'openStickerSetShortName',\n ]),\n)(Main));\n","import { getDispatch } from '../lib/teact/teactn';\n\nexport const processDeepLink = (url: string) => {\n const { protocol, searchParams, pathname } = new URL(url);\n\n if (protocol !== 'tg:') return;\n\n const { openChatByUsername, openStickerSetShortName } = getDispatch();\n\n const method = pathname.replace(/^\\/\\//, '');\n const params: Record = {};\n searchParams.forEach((value, key) => {\n params[key] = value;\n });\n\n switch (method) {\n case 'resolve': {\n const {\n domain,\n } = params;\n\n if (domain !== 'telegrampassport') {\n openChatByUsername({\n username: domain,\n });\n }\n break;\n }\n case 'privatepost':\n\n break;\n case 'bg':\n\n break;\n case 'join':\n\n break;\n case 'addstickers': {\n const { set } = params;\n\n openStickerSetShortName({\n stickerSetShortName: set,\n });\n break;\n }\n case 'msg':\n\n break;\n default:\n // Unsupported deeplink\n\n break;\n }\n};\n","import { getDispatch, getGlobal } from '../lib/teact/teactn';\n\nimport { DEBUG } from '../config';\n\nexport { default as Main } from '../components/main/Main';\n\nif (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH LOAD MAIN BUNDLE');\n}\n\nif (!getGlobal().connectionState) {\n getDispatch().initApi();\n}\n"],"names":["closeLocalTextSearch","global","chatId","threadId","selectCurrentMessageList","updateLocalTextSearch","replaceLocalTextSearchResults","undefined","addReducer","actions","payload","query","chatThreadKey","buildChatThreadKey","currentQuery","localTextSearch","byChatThreadKey","MEMO_EMPTY_ARRAY","mediaType","updateLocalMediaSearchType","id","type","shouldReplaceHistory","currentMessageList","replaceThreadParam","exitMessageSelectMode","messages","contentToBeScheduled","forwardMessages","toChatId","setGlobal","updateCurrentMessageList","isChatInfoShown","openChat","chatCreation","newChatMembersProgress","targetIndexDelta","orderedIds","position","indexOf","nextId","FOCUS_NO_HIGHLIGHT_DURATION","FAST_SMOOTH_MAX_DURATION","ANIMATION_END_DELAY","blurTimeout","scrollOffset","messageId","paramName","chatMessages","selectChatMessages","viewportIds","selectViewportIds","lastOwnEditableMessageId","findLast","Boolean","selectAllowedMessageActions","canEdit","replyingToId","selectReplyingToId","selectIsViewportNewest","chatMessageKeys","Object","keys","newIndex","toString","length","Number","MAIN_THREAD_ID","chat","selectChat","lastMessage","threadInfo","selectThreadInfo","lastMessageId","setReplyingToId","focusMessage","avatarOwnerId","profilePhotoIndex","origin","mediaViewer","audioPlayer","selectIsRightColumnShown","pollResults","voters","window","setTimeout","newGlobal","getGlobal","noHighlight","replyStack","selectReplyStack","pop","focusLastMessage","messageListType","groupedId","groupedChatId","replyMessageId","isResizingContainer","ids","selectForwardedMessageIdsByGroupId","shouldSwitchChat","clearTimeout","updateFocusedMessage","updateFocusDirection","FocusDirection","includes","direction","loadViewportMessages","fromChatId","messageIds","groupedMessageIds","selectMessageIdsByGroupId","isModalShown","closeMediaViewer","selectedMessages","openForwardMenu","selectCurrentChat","enterMessageSelectMode","childMessageIds","withShift","toggleMessageSelection","shouldShowContextMenuHint","disableContextMenuHint","showNotification","message","IS_TOUCH_ENV","isPollModalOpen","globalSearch","updateGlobalSearch","globalResults","localResults","resultsByType","fetchingStatus","chats","recentlyFoundChatIds","newRecentIds","filter","unshift","content","updateGlobalSearchContent","stickers","search","resultIds","gifs","offsetId","results","updateSelectedUserId","updateUserSearch","globalUserIds","localUserIds","management","byChatId","isActive","IS_SINGLE_COLUMN_LAYOUT","IS_TABLET_COLUMN_LAYOUT","isLeftColumnShown","messageLists","action","emoji","recentEmojis","newEmojis","e","sticker","recent","hash","newStickers","s","notification","localId","generateIdFor","newNotifications","notifications","existingNotificationIndex","findIndex","n","splice","push","data","hasErrorKey","getReadableErrorText","newDialogs","dialogs","existingErrorIndex","err","url","safeLinkModalUrl","selectedAt","historyCalendarSelectedAt","payment","isPaymentModalOpen","clearPayment","closeInvoice","error","runThrottledForLoadChats","throttle","cb","runThrottledForLoadTopChats","runDebouncedForLoadFullChat","debounce","async","loadChats","listType","offsetDate","result","callApi","limit","CHAT_LIST_LOAD_SLICE","archived","withPinned","orderedPinnedIds","serverTimeOffset","chatIds","shift","addUsers","buildCollectionByKey","users","updateChats","updateChatListIds","updateChatListSecondaryInfo","draftsById","map","forEach","replyingToById","isFullyLoaded","loadFullChat","fullInfo","updateChat","openChatByUsername","username","channelPostId","localChat","selectChatByUsername","isMin","previousChat","preloadedChatIds","i","TOP_CHAT_MESSAGES_PRELOAD_LIMIT","pause","byId","listIds","active","currentChatId","pinnedChats","otherChats","prepareChatList","chatToPreload","find","currentUserId","hasUnreadMark","toggleChatUnread","requestThreadInfoUpdate","isChatSummaryOnly","requestChatUpdate","user","selectUser","selectThreadTopMessageId","selectSupportChat","langCode","usernamePostfix","LOCALIZED_TIPS","toUpperCase","TIPS_USERNAME","oldestChat","selectIsChatPinned","sort","chat1","chat2","date","force","isMuted","title","about","photo","memberIds","progress","ChatCreationProgress","createdChannel","channelId","accessHash","getDispatch","createChannel","userId","activeChat","activeChannel","createdChat","createGroupChat","folderId","folder","selectChatFolder","shouldBePinned","pinnedChatIds","includedChatIds","newPinnedIds","pinnedId","newIncludedChatIds","folderUpdate","selectChatListType","isPinned","ARCHIVED_FOLDER_ID","isChatArchived","chatFolders","loadChatFolders","recommendedChatFolders","recommended","loadRecommendedChatFolders","emoticon","maxId","recommendedId","description","newFolder","createChatFolder","Math","max","apply","deleteChatFolder","unreadCount","match","RE_TME_INVITE_LINK","RE_TME_LINK","chatOrChannelPostId","isEnabled","isChatBasicGroup","bannedRights","chatAfterUpdate","members","kickedMembers","isBanned","viewMessages","isUnblocked","m","adminRights","customTitle","adminMembers","isDismissed","updateManagementProgress","ManagementProgress","Promise","all","groups","addedById","reduce","group","addChats","forDiscussionIds","channel","fullChat","isPreHistoryHidden","linkedChatId","activeChatFolder","offset","setNewChatMembersDialogState","NewChatMembersProgress","uploadProgressCallbacks","Map","runDebouncedForMarkRead","isOutlying","isBudgetPreload","addOffset","LoadMoreDirection","round","MESSAGE_LIST_SLICE","selectThreadOriginChat","threadInfos","addChatMessagesById","updateOutlyingIds","updateListedIds","updateThreadInfos","listedIds","selectListedIds","outlyingIds","selectOutlyingIds","areSortedArraysIntersecting","historyIds","newViewportIds","getViewportSlice","safeReplaceViewportIds","sourceIds","index","findClosestIndex","indexForDirection","from","to","slice","areSomeLocal","areAllLocal","sendMessage","params","progressCallback","attachment","messageLocalId","has","set","fileUploads","byMessageLocalId","replyingTo","IS_IOS","rafPromise","delete","isRestricted","resolve","loadWithBudget","selectFocusedMessageId","selectRealLastReadId","replyOriginForId","threadUpdate","MESSAGE_DELETED","replyMessage","selectChatMessage","updateChatMessage","replyToMessageId","loadMessage","isDeleting","updateThreadUnreadFromForwardedMessage","scheduledAt","clearWebPagePreview","value","noWebPage","selectNoWebPage","isSingle","attachments","isGrouped","restParams","text","entities","commonParams","groupedAttachments","split","MAX_MEDIA_FILES_FOR_ALBUM","firstAttachment","restAttachments","Date","now","selectEditingMessage","setEditingId","get","previousLocalId","cancelApiProgress","apiUpdate","draft","replyToMsgId","draftDate","localOnly","selectDraft","isUnpin","isOneSide","isSilent","unpinAllMessages","shouldDeleteForAll","editingId","selectEditingId","selectEditingScheduledId","reason","peer","minId","selectFirstUnreadId","readCount","count","l","countSortedIds","lastReadInboxMessageId","webPagePreview","loadWebPagePreview","options","option","shouldResetVoters","v","a","offsets","nextOffset","loadPollOptionResults","fromChat","toChat","b","scheduledMessages","historyHash","replaceScheduledMessages","loadScheduledHistory","selectScheduledMessage","loadPinnedMessages","searchThrottled","searchGifs","updateGifSearch","added","addedStickers","updateStickerSets","sets","loadStickerSets","setIds","addedSetIds","loadStickers","stickerSetId","recentStickers","loadRecentStickers","favorite","favoriteStickers","loadFavoriteStickers","greeting","featured","featuredStickers","loadFeaturedStickers","stickerSetShortName","stickerSetAccessHash","stickerSet","selectStickerSet","packs","updateStickerSet","currentEmoji","forEmoji","rebuildStickersForEmoji","replaceAnimatedEmojis","loadAnimatedEmojis","saved","savedGifs","loadSavedGifs","unfave","unfaveSticker","installedDate","language","currentEmojiKeywords","emojiKeywords","isLoading","fromVersion","version","keywords","setsById","searchWords","searchStickers","updateStickersForEmoji","loadStickersForEmoji","openedStickerSetShortName","searchMessagesGlobal","offsetRate","maxDate","minDate","localResult","chatOrUser","GLOBAL_SEARCH_SLICE","totalCount","nextOffsetId","nextRate","currentSearchQuery","selectCurrentGlobalSearchQuery","updateGlobalSearchFetchingStatus","addMessages","updateGlobalSearchResults","loadAndReplaceArchivedChats","updateUsers","replaceChatListIds","loadAndUpdateUsers","userIds","contactIds","contactList","updatedUsers","loadTopMessages","localChats","localUsers","globalChats","globalUsers","searchChats","timestampPlusDay","foundIds","currentSearch","selectCurrentTextSearch","topMessageId","MESSAGE_SEARCH_SLICE","newFoundIds","updateLocalTextSearchResults","searchTextMessages","peerId","selectCurrentMediaSearchPeerId","selectCurrentMediaSearch","currentType","currentResults","SHARED_MEDIA_SLICE","updateLocalMediaSearchResults","searchSharedMedia","timestamp","searchMessagesByDate","updateManagement","isUsernameAvailable","afterSyncCallback","DEBUG","console","log","savedUsers","savedPrivateChatIds","savedChats","selectedChat","isChatPrivate","selectedChatUser","replaceChats","loadAndReplaceChats","areMessagesLoaded","currentThreadId","draftsByChatId","acc","newCurrentChatId","currentMessageListInfo","threadsById","originChannelId","currentMessageListInfoOrigin","resultOrigin","byIdOrigin","listedIdsOrigin","Array","prototype","concat","replaceUsers","audioChatId","audioMessageId","closeAudioPlayer","loadAndReplaceMessages","lastSyncTime","sync","afterSync","runDebouncedForFetchFullUser","runThrottledForSearch","replaceInlineBotSettings","inlineBotSettings","inlineBots","byUsername","replaceInlineBotsIsLoading","topPeers","lastRequestedAt","getServerTime","usersHash","loadTopUsers","getCompareString","lastName","firstName","collator","Intl","Collator","sortedUsers","compare","isSelf","loadContactList","updateChatMutedState","phone","phoneNumber","updateUser","updateContact","deleteUser","profileId","isPrivate","photos","userSearch","updateUserSearchFetchingStatus","searchUsers","runDebouncedForSearch","sendBotCommand","command","button","openTelegramLink","toggleSafeLinkModal","showDialog","alert","isError","answerCallbackButton","openPollModal","getReceipt","receiptMessageId","getPaymentForm","setInvoiceMessageInfo","openPaymentModal","bot","selectChatBot","removeBlockedContact","topInlineBots","newHash","inlineBotData","inlineBot","switchPm","canLoadMore","shouldReplaceSettings","newInlineBotData","currentIds","Set","newResults","help","isGallery","searchInlineBot","queryId","resultId","botId","param","startParam","replaceSettings","hasPassword","updateTwoFaSettings","hint","currentPassword","onSuccess","isSuccess","password","email","waitingEmailCodeLength","code","requestInfo","saveInfo","selectPaymentChatId","selectPaymentMessageId","shouldSave","shippingOptions","setRequestInfoId","updateShippingOptions","setPaymentStep","PaymentStep","validateRequestedInfo","setPaymentForm","step","invoice","shippingAddressRequested","nameRequested","phoneRequested","emailRequested","setReceipt","receipt","publishableKey","selectProviderPublishableKey","credentials","k","join","buildQueryString","cardNumber","expiryMonth","expiryYear","cvv","zip","country","response","fetch","method","headers","Authorization","json","getStripeError","setStripeCardInfo","sendStripeCredentials","shippingOptionId","saveCredentials","formId","selectPaymentFormId","requestInfoId","selectPaymentRequestId","stripeCredentials","selectStripeCredentials","requestedInfoId","sendPaymentForm","save","runThrottledForUpdateAppBadge","update","noTopChatsRequest","selectIsChatListed","loadTopChats","newProfilePhoto","updateAppBadge","selectCountNotMutedUnread","closeMessageNotifications","isNotJoined","listId","typingStatus","senderId","isFromScheduled","isActiveChat","hasUnreadMention","unreadMentionsCount","hasWebNotifications","selectNotifySettings","showNewMessageNotification","messageUpdate","selectCommonBoxChatId","targetChat","newOrderedPinnedIds","MAX_ACTIVE_PINNED_CHATS","updateChatListType","chatFoldersById","newChatFoldersById","pick","newOrderedIds","orderedId","folders","replacedMembers","addedMember","deletedMemberId","shouldUpdate","some","deleteIndex","isOwner","isAdmin","membersCount","formattedText","ANIMATION_DELAY","updateWithLocalMedia","isScheduled","currentMessage","video","document","getMessageContent","blobUrl","thumbnail","isPreloadedGlobally","previewBlobUrl","updateScheduledMessage","updateThreadUnread","selectThreadByMessage","originMessage","updateListedAndViewportIds","firstMessageId","isUnreadChatNotLoaded","isMessageLocal","addViewportId","messagesCount","firstUnreadId","updateChatLastMessage","currentLastMessage","findLastMessage","deleteMessages","newLastMessage","threadIdsToUpdate","deleteChatMessages","unique","chatsIdsToUpdate","commonBoxChatId","updateThreadInfo","newMessage","isMessageInCurrentMessageList","isOutgoing","scheduledIds","selectScheduledIds","selectIsChatWithBot","selectScheduledMessages","deleteChatScheduledMessages","thread","markMessageListRead","currentPinnedIds","selectPinnedIds","newTheadInfo","messagesById","deleteScheduledMessages","pollId","pollUpdate","selectChatMessageByPollId","poll","updatedPoll","updatedResults","isChosen","chosenAnswers","chosenAnswer","chosenAnswerIndex","recentVoterIds","totalVoters","newRecentVoterIds","newTotalVoters","targetOption","targetOptionIndex","updatedOption","votersCount","flushStatusUpdatesThrottled","pendingStatusUpdates","statusUpdate","status","targetUser","isBlocked","addBlockedContact","settings","privacy","key","rules","updateNotifySettings","peerType","shouldShowPreviews","addNotifyException","twoFaSettings","useBeforeUnload","callback","useEffect","onBeforeUnload","preventEvent","preventDefault","useBrowserOnline","isOnline","setIsOnline","useState","navigator","onLine","handleChange","addEventListener","removeEventListener","ANIMATION_LEVEL_OPTIONS","memo","withGlobal","searchQuery","chatsById","animationLevel","byKey","globalSearchChatId","searchDate","theme","selectTheme","contactsFilter","onSearchQuery","onSelectSettings","onSelectContacts","onSelectArchived","setGlobalSearchChatId","onReset","shouldSkipTransition","openTipsChat","setGlobalSearchDate","setSettingOption","lang","useLang","hasMenu","LeftColumnContent","selectedSearchDate","useMemo","formatDateToString","archivedUnreadChatsCount","values","total","withOtherVersions","location","hostname","MainButton","onTrigger","isOpen","Button","ripple","size","color","className","onClick","ariaLabel","buildClassName","handleSearchFocus","useCallback","handleSelectSaved","handleDarkModeToggle","stopPropagation","newTheme","shouldUseSystemTheme","switchTheme","ANIMATION_LEVEL_MAX","handleAnimationLevelChange","newLevel","_","body","classList","toggle","isSearchFocused","searchInputPlaceholder","DropdownMenu","trigger","footer","APP_NAME","APP_VERSION","MenuItem","icon","Switcher","label","checked","noAnimation","toLowerCase","href","FEEDBACK_URL","localStorage","setItem","JSON","stringify","disableHistoryBack","SearchInput","inputId","parentContainerClassName","focused","placeholder","autoComplete","canClose","onChange","onFocus","PickerSelectedItem","isMinimized","clickArg","chatOrUserId","dir","isRtl","Spinner","usersById","orderedFolderIds","shouldSkipHistoryAnimations","notifySettings","notifyExceptions","selectNotifyExceptions","foldersDispatch","onScreenSelect","setActiveChatFolder","transitionRef","useRef","displayedFolders","folderCountersById","resolverFn","ms","dependencies","runThrottled","noFirst","useThrottle","setValue","isFrozen","freeze","unfreeze","useFlag","useHeavyAnimationCheck","useOnChange","useThrottledMemo","counters","unreadDialogsCount","hasActiveDialogs","getFolderUnreadDialogs","badgeCount","isBadgeActive","folderTabs","handleSwitchTab","current","captureEvents","selectorToPreventScroll","onSwipe","SwipeDirection","min","isNotInAllTabRef","captureEscKeyListener","useHistoryBack","handleKeyDown","ctrlKey","shiftKey","startsWith","digit","shouldRender","shouldRenderPlaceholder","transitionClassNames","useShowTransition","renderCurrentTab","activeFolder","ChatList","folderType","TabList","tabs","activeTab","onSwitchTab","Transition","ref","name","activeKey","renderCount","props","LeftSearch","useModuleLoader","Bundles","Loading","ContactList","closeTimeout","isShown","onNewPrivateChat","onNewChannel","onNewGroup","isMenuOpen","setIsMenuOpen","fabClassName","handleMouseEnter","handleMouseLeave","onMouseEnter","onMouseLeave","tabIndex","Menu","positionX","positionY","autoClose","onClose","TRANSITION_RENDER_COUNT","onContentChange","connectionState","isNewChatButtonShown","setIsNewChatButtonShown","isConnecting","isMouseInside","handleSelectSettings","handleSelectContacts","handleSelectNewChannel","handleSelectNewGroup","handleSelectArchived","autoCloseTimeout","shouldRenderUpdateButton","updateButtonClassNames","handleUpdateClick","isAppOutdated","markIsAppOutdated","timeout","reload","useAppOutdatedCheck","ShowTransition","isCustom","shouldCleanup","cleanupExceptionKey","fluid","pill","Settings","NewChat","ArchivedChats","ContentType","RENDER_COUNT","setGlobalSearchQuery","resetChatCreation","loadPasswordInfo","clearTwoFaError","setContent","settingsScreen","setSettingsScreen","SettingsScreens","setContactsFilter","foldersState","useFoldersReducer","lastResetTime","setLastResetTime","contentType","Main","Archived","NewChannel","NewGroup","handleReset","forceReturnToChatList","pickerSearchInput","getElementById","blur","handleSearchQuery","handleSettingsScreenSelect","screen","LAYERS_ANIMATION_NAME","currentScreen","isChannel","setSize","windowSize","handleResize","MAX_MESSAGES_LIST_WIDTH","createMessageHash","messageList","HeaderMenuContainer","isChatChannel","selectIsInSelectMode","noMenu","isChatWithSelf","selectIsChatWithSelf","isMainThread","isDiscussionThread","isRightColumnShown","canRestartBot","selectIsUserBlocked","canStartBot","selectIsChatBotNotStarted","canSubscribe","isChatSuperGroup","canSearch","canMute","canLeave","joinChannel","openLocalTextSearch","restartBot","menuButtonRef","menuPosition","setMenuPosition","handleHeaderMenuOpen","rect","getBoundingClientRect","x","right","y","bottom","handleHeaderMenuClose","handleHeaderMenuHide","handleSubscribeClick","handleStartBot","handleRestartBot","handleSearchClick","querySelector","focus","searchInput","disabled","anchor","onSubscribeChannel","onSearchClick","onCloseAnimationEnd","useWebpThumbnail","getMessageMediaThumbDataUri","shouldDecodeThumbnail","isWebpSupported","thumbnailDecoded","setThumbnailDecoded","EMPTY_IMAGE_DATA_URI","useLayoutEffect","webpToPngBase64","then","catch","drawRect","width","height","radius","containerRef","markupParams","reverseIndex","barHeight","getBarHeight","markHeight","getMarkHeight","trackHeight","getTrackHeight","clipPathId","clipPath","d","getClipPath","markTranslateY","getMarkTranslateY","trackTranslateY","getTrackTranslateY","calculateMarkup","firstChild","firstElementChild","currentElement","style","transform","svg","div","defs","innerHTML","onUnpinMessage","onAllPinnedClick","mediaThumbnail","mediaBlobUrl","useMedia","getMessageMediaHash","getMessageSummaryText","isUnpinDialogOpen","openUnpinDialog","closeUnpinDialog","handleUnpinMessage","ConfirmDialog","confirmLabel","confirmHandler","thumbDataUri","getPictogramDimensions","src","alt","renderPictogram","renderText","RippleEffect","sender","selectSender","noUi","senderName","getSenderTitle","mediaData","mediaLoader","playPause","isPlaying","useAudioPlayer","getMessageKey","getMediaDuration","handleClick","handleClose","audio","getMessageAudio","performer","fileName","renderAudio","subtitle","renderVoice","audioMessage","pinnedIds","state","isSelectModeActive","isChatWithBot","currentTransitionKey","assign","pinnedMessageId","topMessageSender","selectForwardedSender","pinnedMessageIds","canUnpin","firstPinnedMessage","isReady","openChatWithInfo","pinMessage","openPreviousChat","toggleLeftColumn","pinnedMessageIndex","setPinnedMessageIndex","isArray","pinnedMessage","pinnedMessagesCount","chatTitleLength","getChatTitle","topMessageTitle","useEnsureMessage","windowWidth","useWindowSize","isLeftColumnHideable","MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN","shouldShowCloseButton","componentRef","shouldAnimateTools","handleHeaderClick","handlePinnedMessageClick","cycleRestrict","handleAllPinnedClick","handleBackClick","messageInput","EDITABLE_INPUT_ID","canToolsCollideWithChatInfo","SAFE_SCREEN_WIDTH_FOR_CHAT_INFO","MOBILE_SCREEN_MAX_WIDTH","shouldUseStackedToolsClass","MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","shouldRenderAudioPlayer","audioPlayerClassNames","renderingAudioMessage","useCurrentOrPrev","shouldRenderPinnedMessage","pinnedMessageClassNames","renderingPinnedMessage","renderingPinnedMessageTitle","canRevealTools","componentEl","add","remove","renderInfo","renderBackButton","PrivateChatInfo","withFullInfo","withMediaViewer","withUpdatingStatus","noRtl","GroupChatInfo","asClose","withUnreadCount","formatIntegerCompact","Infinity","isAlbum","messageOrAlbum","groupMessages","currentAlbum","currentSenderGroup","currentDateGroup","originalDate","datetime","getDayStart","senderGroups","dateGroups","isInAlbum","mainMessage","albumId","nextMessage","nextMessageDayStartsAt","isActionMessage","forwardInfo","senderUserId","hiddenUserName","inlineButtons","INTERSECTION_THROTTLE_FOR_MEDIA","IS_ANDROID","INTERSECTION_MARGIN_FOR_MEDIA","isEmojiOnlyMessage","customShape","getMinMediaWidth","hasText","hasCommentButton","calculateMediaDimensions","noAvatars","isOwn","isOwnMessage","isForwarded","isForwardedMessage","getMessagePhoto","getMessageWebPagePhoto","getMessageVideo","isWebPagePhoto","calculateInlineImageDimensions","calculateVideoDimensions","minMediaWidth","getMessageText","stretchFactor","finalWidth","finalHeight","isSmall","accumulate","list","initValue","accumulator","item","clamp","num","low","high","calculateContainerSize","layout","styles","dimensions","sides","calculateAlbumLayout","album","ratios","proportions","ratio","getProportions","averageRatio","getAverageRatio","albumCount","forceCalc","maxWidth","getAvailableWidth","REM","minWidth","maxHeight","spacing","originalRatios","cropRatios","attempts","pushAttempt","lineCounts","heights","currentCount","attemptCount","sum","multiHeight","first","second","third","fourth","optimalAttempt","optimalDiff","lineCount","totalHeight","bad1","bad2","line","diff","abs","optimalCounts","optimalHeights","rowCount","row","colCount","lineHeight","col","layoutWithComplexLayouter","AlbumRectPart","layoutTwoTopBottom","layoutTwoLeftRightEqual","minimalWidth","secondWidth","firstWidth","layoutTwoLeftRight","layoutTwo","firstHeight","thirdHeight","secondHeight","rightWidth","leftWidth","layoutThreeLeftAndOther","layoutThreeTopAndOther","layoutThree","w","h0","h","w0","w2","w1","h1","layoutFourTopAndOther","h2","layoutFourLeftAndOther","layoutFour","containerStyle","element","calculateAuthorWidth","createElement","font","whiteSpace","left","opacity","appendChild","offsetWidth","useFocusMessage","elementRef","isFocused","focusDirection","noFocusHighlight","messagesContainer","closest","fastSmoothScroll","ContextMenuContainer","targetUserIds","targetChatId","targetMessageId","targetMessage","selectIsMessageFocused","focusedMessage","observeIntersection","isEmbedded","appearanceOrder","isLastInList","useOnIntersect","noAppearanceAnimation","markShown","targetUsers","renderActionMessageText","asPlain","isContextMenuOpen","contextMenuPosition","handleBeforeContextMenu","handleContextMenu","handleContextMenuClose","handleContextMenuHide","useContextMenuHandlers","isContextMenuShown","onMouseDown","preventMessageInputBlur","onContextMenu","customText","isIntersecting","useIsIntersecting","pictogramId","isRoundVideo","getMessageRoundVideo","senderTitle","outgoingStatus","signature","views","isEdited","formatTime","MessageOutgoingStatus","observeIntersectionForPlaying","shouldLoop","isModalOpen","openModal","closeModal","isAnimated","isMemojiSticker","MEMOJI_STICKER_ID","shouldLoad","shouldPlay","mediaHash","getMessageMediaFormat","isMediaLoaded","isAnimationLoaded","markAnimationLoaded","isMediaReady","shouldRenderFullMedia","useTransitionForMedia","getStickerDimensions","thumbClassName","stickerClassName","AnimatedSticker","animationData","play","noLoop","onLoad","fromSticker","useBlurredMediaThumbRef","fullMediaData","useCanvasBlur","IS_CANVAS_FILTER_SUPPORTED","SELECTED_APPENDIX_BACKGROUND","shouldAutoLoad","isInSelectMode","isSelected","uploadProgress","nonInteractive","shouldAffectAppendix","onCancelUpload","localBlobUrl","isDownloadAllowed","setIsDownloadAllowed","shouldDownload","downloadProgress","useMediaWithDownloadProgress","thumbRef","isUploading","isTransferring","transferProgress","getMediaTransferState","wasDownloadDisabled","usePrevious","shouldRenderSpinner","spinnerClassNames","shouldRenderThumb","isAllowed","contentEl","inSelectMode","img","Image","onload","canvas","ctx","getContext","drawImage","getImageData","getAppendixColorFromImage","getCustomAppendixBg","appendixBg","setProperty","setAttribute","ProgressSpinner","useHeavyAnimationCheckForVideo","playerRef","shouldPlayRef","safePlay","isPlayAllowed","wasPlaying","freezePlaying","paused","unfreezePlaying","contains","unfreezePlayingOnRaf","fastRaf","hasFocus","useBackgroundMode","shouldAutoPlay","videoRef","getMessageWebPageVideo","setIsPlayAllowed","isInline","isBuffered","bufferingHandlers","useBuffering","playProgress","setPlayProgress","handleTimeUpdate","currentTarget","currentTime","duration","usePauseOnInactive","useVideoCleanup","videoClassName","autoPlay","muted","loop","playsInline","onTimeUpdate","isGif","formatMediaDuration","contact","openUserInfo","Avatar","formatPhoneNumberWithCode","selected","loadingOptions","setValues","event","newValues","Checkbox","subLabel","getPercentage","toFixed","answer","voteResults","maxVotersCount","correctResults","shouldAnimate","r","correctAnswer","showIcon","answerPercent","finalPercent","setFinalPercent","lineRef","lineWidth","isAnimationDoesNotStart","lineEl","svgEl","lineStyle","onSendVote","openPollResults","summary","isSubmitting","setIsSubmitting","chosenOptions","setChosenOptions","isSolutionShown","setIsSolutionShown","wasSubmitted","setWasSubmitted","closePeriod","setClosePeriod","closed","closeDate","floor","countdownRef","hasVoted","canVote","canViewResult","isPublic","isMultiple","multipleChoice","answers","isCorrect","hidden","quiz","countdownEl","circumference","PI","lastElementChild","timerEl","strokeDashOffset","textContent","timer","recentVoters","handleRadioChange","handleCheckboxChange","handleVoteClick","handleViewResultsClick","handleSolutionShow","handleSolutionHide","solution","Notification","renderTextWithEntities","solutionEntities","onDismiss","containerId","question","getPollTypeString","RadioGroup","loadingOption","isQuiz","getReadableVotersCount","isText","inPreview","onMediaClick","onCancelMediaTransfer","webPage","getMessageWebPage","isSquarePhoto","handleMediaClick","siteName","displayUrl","isMediaInteractive","truncatedDescription","trimText","SafeLink","getMessageInvoice","amount","currency","isTest","photoUrl","formatCurrency","withSelectControl","WrappedComponent","ownProps","selectIsMessageSelected","handleMessageSelect","newProps","PhotoWithSelect","Photo","VideoWithSelect","Video","uploadsById","hasCustomAppendix","albumLayout","cancelSendingMessage","mediaCount","handleCancelUpload","containerWidth","containerHeight","fileUpload","currentOnRelease","playingProgressRef","shouldSpinnerRender","isActivated","setIsActivated","setProgress","playerEl","playingProgressEl","stopPlaying","capturePlaying","onRelease","ROUND_VIDEO_DIMENSIONS","onEnded","recentReplierIds","recentRepliers","hasUnread","GROUP_MESSAGE_HOVER_ATTRIBUTE","handleDocumentGroupMouseEnter","lastGroupElement","getLastElementInDocumentGroup","handleDocumentGroupMouseLeave","removeAttribute","nextElementSibling","withSenderName","withAvatar","viaBotId","chatUsername","forceSenderName","isAnonymousOwnMessage","originSender","botSender","threadTopMessageId","isThreadTop","shouldHideReply","replyMessageSender","selectUploadProgress","isForwarding","highlight","singleEmoji","getMessageSingleEmoji","every","canReply","isSingleEmoji","animatedEmoji","selectAnimatedEmoji","isGroupSelected","selectIsDocumentGroupSelected","isPinnedList","shouldAutoLoadMedia","selectShouldAutoLoadMedia","shouldAutoPlayMedia","selectShouldAutoPlayMedia","shouldLoopStickers","selectShouldLoopStickers","selectOutgoingStatus","observeIntersectionForBottom","observeIntersectionForMedia","observeIntersectionForAnimatedStickers","noComments","isFirstInGroup","isLastInGroup","isFirstInDocumentGroup","isLastInDocumentGroup","clickInlineButton","bottomMarkerRef","appendixRef","isLocal","hasReply","isReplyMessage","hasThread","asForwarded","isLinkedChannelPost","isInDocumentGroup","voice","getMessageCustomShape","textParts","renderMessageText","adminTitle","metaSafeAuthorWidth","canShowActionButton","canForward","canFocus","isChannelPost","fromMessageId","avatarPeer","senderPeer","selectMessage","handleMouseDown","handleDoubleClick","handleContentDoubleClick","isSwiped","markSwiped","unmarkSwiped","startedAt","target","matches","useOuterHandlers","handleAvatarClick","handleSenderClick","handleViaBotClick","handleReplyClick","handleAudioPlay","handleAlbumMediaClick","handleMetaClick","handleReadMedia","handleVoteSend","handleGroupForward","handleForward","handleFocus","handleFocusForwarded","handleDocumentGroupSelectAll","openMediaViewer","openAudioPlayer","markMessagesRead","sendPollVote","MediaViewerOrigin","albumMessageId","selectWithGroupedId","useInnerHandlers","containerClassName","contentClassName","hasComments","hasActionButton","classNames","isMedia","isMediaWithNoText","isViaBot","isRound","buildContentClassName","withCommentButton","withAppendix","calculatedWidth","noMediaCorners","extraPadding","onDoubleClick","isAvatarPeerUser","avatarUser","avatarChat","hiddenName","renderAvatar","shouldInlineMeta","textContentClass","senderColor","getUserColorKey","renderSenderName","AnimatedEmoji","forceLoadPreview","Audio","isSelectable","onPlay","onReadMedia","Document","renderContent","messageGroups","isViewportNewest","isUnread","withUsers","anchorIdRef","memoUnreadDividerBeforeIdRef","memoFirstUnreadIdRef","hasLinkedChat","isSchedule","onFabToggle","onNotchToggle","openHistoryCalendar","observeIntersectionForReading","observe","useIntersectionObserver","rootRef","throttleMs","margin","freezeForReading","unfreezeForReading","entries","mentionIds","entry","dataset","useMessageObservers","backwardsTriggerRef","forwardsTriggerRef","fabTriggerRef","loadMoreBackwards","loadMoreForwards","toggleScrollTools","offsetHeight","scrollHeight","scrollTop","scrollBottom","isAtBottom","MESSAGE_LIST_SENSITIVE_AREA","LOCAL_MESSAGE_ID_BASE","triggerEntry","resetScroll","observeIntersectionForFab","freezeForFab","unfreezeForFab","observeIntersectionForNotch","freezeForNotch","unfreezeForNotch","useScrollHooks","unreadDivider","messageCountToAnimate","messageGroup","flatten","appearanceIndex","dateGroup","dateGroupIndex","dateGroupsArray","senderGroup","senderGroupIndex","senderGroupsArray","compact","currentDocumentGroupId","messageIndex","isMessageAlbum","documentGroupId","nextDocumentGroupId","originalId","getMessageOriginalId","teactFastList","SCHEDULED_WHEN_ONLINE","formatHumanDate","lastUnreadMessageId","loadGreetingStickers","debounceMs","handleStickerSelect","selectedSticker","StickerButton","isGroupChatJustCreated","renderScheduled","renderSavedMessages","renderGroup","runDebouncedForScroll","selectCurrentMessageIds","restrictionReason","focusingId","withLastMessageWhenPreloading","chatBot","botDescription","isChatLoaded","isChannelChat","isGroupChat","isChatGroup","isCreator","isBot","threadFirstMessageId","selectFirstMessageId","hasTools","canPost","setScrollOffset","scrollOffsetRef","selectScrollOffset","anchorTopRef","listItemElementsRef","memoFocusingIdRef","isScrollTopJustUpdatedRef","shouldAnimateAppearanceRef","setContainerHeight","onTickEnd","listedMessages","orderBy","loadMoreAround","isScrolled","updateStickyDates","markIsScrolled","runDebounced","shouldRunLast","container","currentStuck","stuckDateEl","allElements","querySelectorAll","containerTop","el","offsetTop","top","findStuckDate","useStickyDates","handleScroll","parentElement","observer","ResizeObserver","offsetParent","contentRect","disconnect","windowHeight","normalHeight","String","clientHeight","preservedItemElements","useLayoutEffectWithPrevDeps","prevMessageIds","prevIsViewportNewest","prevContainerHeight","shouldForceScroll","hasLastMessageChanged","hasViewportShifted","wasMessageAdded","isAlreadyFocusing","lastItemElement","bottomOffset","newScrollTop","isResized","isAnimatingScroll","useEffectWithPrevDeps","prevIsSelectModeActive","dispatchHeavyAnimationEvent","shouldRenderGreeting","onScroll","focusNextReply","messageElements","lastMessageElement","MAX_QUICK_IMG_SIZE","buildAttachment","filename","blob","isQuick","URL","createObjectURL","mimeType","quick","preloadImage","newBlob","toBlob","squeezeImage","revokeObjectURL","videoWidth","videoHeight","preloadVideo","createPosterForVideo","resetInput","applyIosAutoCapitalizationFix","inputEl","POLYFILL_OPTIONS","encoderPath","reuseWorker","BLOB_PARAMS","opusRecorderPromise","OpusRecorder","mediaRecorder","init","default","start","analyzerCallback","startMediaRecorder","pausedAt","chunks","waveform","ondataavailable","typedArray","releaseAnalyzer","recorder","source","sourceNode","analyser","context","createAnalyser","fftSize","connect","dataLength","frequencyBinCount","dataArray","Uint8Array","isDestroyed","tick","getByteFrequencyData","volume","requestAnimationFrame","subscribeToAnalyzer","stop","reject","onstop","Blob","onerror","delayStop","CLIPBOARD_ACCEPTED_TYPES","getMessageTextAsHtml","tempEl","INLINE_BOT_QUERY_REGEXP","HAS_NEW_LINE","RE_COMMAND","DeleteMessageModal","openTimeout","isFirstTimeActivation","onActivate","buttonProps","AttachMenu","SymbolMenu","InlineBotTooltip","MentionTooltip","CustomSend","StickerTooltip","BotCommandTooltip","useMouseInside","isKeyboardSingleUse","forceOpen","markForceOpen","unmarkForceOpen","keyboardButtons","forwardMessageIds","forwardedMessagesCount","exitForwardMode","canAnimate","useAsyncRendering","clearEmbedded","handleMessageClick","faded","AttachmentModal","BotCommandMenu","PollModal","DropArea","RE_LINK","RegExp","RE_LINK_TEMPLATE","messageText","toggleMessageWebPage","link","parseMessageInput","linkEntity","ApiMessageEntityTypes","textMatch","renderingWebPage","webPageWithoutPhoto","messageStub","CalendarModal","PaymentModal","ReceiptModal","MainButtonState","chatUser","selectChatUser","REPLIES_USER_ID","messageWithActualBotKeyboard","selectNewestMessageWithBotKeyboardButtons","baseEmojiKeywords","BASE_EMOJI_KEYWORD_LANG","botKeyboardMessageId","keyboardMessage","editingMessage","canScheduleUntilOnline","wasOnline","withScheduledButton","shouldSchedule","botKeyboardPlaceholder","keyboardPlaceholder","stickersForEmoji","groupChatMembers","topInlineBotIds","isReceiptModalOpen","shouldSuggestStickers","isInlineBotLoading","chatBotCommands","botCommands","dropAreaState","onDropHide","editMessage","saveDraft","clearDraft","setStickerSearchQuery","setGifSearchQuery","closePollModal","closePaymentModal","clearReceipt","addRecentEmoji","sendInlineBotResult","html","setHtml","lastMessageSendTimeSeconds","prevDropAreaState","isCalendarOpen","openCalendar","closeCalendar","scheduledMessageArgs","setScheduledMessageArgs","htmlRef","setAttachments","isBotKeyboardOpen","openBotKeyboard","closeBotKeyboard","isBotCommandMenuOpen","openBotCommandMenu","closeBotCommandMenu","isAttachMenuOpen","openAttachMenu","closeAttachMenu","isSymbolMenuOpen","openSymbolMenu","closeSymbolMenu","isDeleteModalOpen","openDeleteModal","closeDeleteModal","isSymbolMenuLoaded","onSymbolMenuLoadingComplete","isHoverDisabled","disableHover","enableHover","startRecordingVoice","stopRecordingVoice","pauseRecordingVoice","activeVoiceRecording","currentRecordTime","recordButtonRef","mainButtonRef","startRecordTimeRef","setActiveVoiceRecording","setCurrentRecordTime","IS_VOICE_RECORDING_SUPPORTED","voiceRecording","tickVolume","boxShadow","useVoiceRecording","mainButtonState","Edit","Send","Record","canShowCustomSendMenu","isMentionTooltipOpen","closeMentionTooltip","insertMention","mentionFilteredUsers","useMentionTooltip","isInlineBotTooltipOpen","inlineBotId","isInlineBotTooltipGallery","inlineBotSwitchPm","inlineBotResults","closeTooltip","closeInlineBotTooltip","inlineBotHelp","loadMore","loadMoreForInlineBot","markIsOpen","unmarkIsOpen","replace","innerText","getPlainText","queryInlineBot","resetInlineBot","canShowHelp","parseStartWithUsernameString","usernameLowered","prevQuery","prevUsername","useInlineBotTooltip","isBotCommandTooltipOpen","close","closeBotCommandTooltip","filteredBotCommands","botTooltipCommands","setFilteredBotCommands","getFilteredCommands","nextFilteredBotCommands","substr","useBotCommandTooltip","isCustomSendMenuOpen","allowedAttachmentOptions","getAllowedAttachmentOptions","isChatAdmin","slowMode","getChatSlowModeOptions","isStickerTooltipOpen","closeStickerTooltip","isDisabled","clearStickersForEmoji","IS_EMOJI_SUPPORTED","parseEmojiOnlyString","hasStickers","useStickerTooltip","canSendStickers","isEmojiTooltipOpen","closeEmojiTooltip","filteredEmojis","insertEmoji","useEmojiTooltip","insertTextAndUpdateCursor","selection","getSelection","newHtml","rangeCount","selectionRange","getRangeAt","isSelectionInsideInput","range","deleteContents","fragment","createContextualFragment","lastInsertedNode","lastChild","insertNode","setStartAfter","setEndAfter","collapse","removeAllRanges","addRange","insertHtmlInSelection","dispatchEvent","Event","bubbles","focusEditableElement","removeSymbol","execCommand","tempInput","contentEditable","textLength","createRange","setStart","setEnd","removeChild","deleteLastCharacterOutsideSelection","resetComposer","shouldPreserveInput","stopRecordingVoiceRef","handleEditComplete","editedMessage","hasMessageMedia","useEditing","updateDraft","draftChatId","draftThreadId","runDebouncedForSaveDraft","DRAFT_DEBOUNCE","prevChatId","prevThreadId","prevHtml","handleBlur","useDraft","handlePaste","clipboardData","input","activeElement","EDITABLE_INPUT_MODAL_ID","items","media","file","getAsFile","pastedText","getData","substring","useClipboardPaste","handleFileSelect","files","handleAppendFiles","handleClearAttachment","handleSend","currentAttachments","record","maxLength","extraLength","textParams","nowSeconds","secondsSinceLastMessage","nextSendDateNotReached","nextSendDate","seconds","secondsRemaining","isSlowMode","handleActivateBotCommandMenu","handleActivateSymbolMenu","handleGifSelect","gif","handleInlineBotSelect","inlineResult","handleBotCommandSelect","handlePollSend","handleSilentSend","handleMessageSchedule","isWhenOnline","restArgs","getTime","handleMessageScheduleUntilOnline","handleCloseCalendar","handleSearchOpen","handleSymbolMenuOpen","handleAllScheduledClick","mainButtonHandler","areVoiceMessagesNotAllowed","canAttachMedia","prevEditedMessage","renderedEditedMessage","scheduledDefaultDate","setSeconds","setMilliseconds","scheduledMaxDate","setFullYear","getFullYear","sendButtonAriaLabel","symbolMenuButtonClassName","onSend","Portal","DropAreaState","withQuick","onHide","onFileSelect","caption","onCaptionUpdate","onFileAppend","onClear","onInsertUserName","filteredUsers","onSelectResult","withUsername","canAttachEmbedLinks","MessageInput","forcedPlaceholder","shouldSetFocus","shouldSuppressFocus","shouldSuppressTextFormatter","onUpdate","onSuppressedFocus","formatVoiceRecordDuration","onStickerSelect","emojis","onEmojiSelect","onPollCreate","onGifSelect","onRemoveSymbol","onSearchOpen","onSilentSend","onScheduleSend","withTimePicker","maxAt","getDayStartAt","isFutureMode","secondButtonLabel","onSubmit","onSecondButtonClick","MobileSearch","MessageSelectToolbar","UnpinAllMessagesModal","CLOSE_ANIMATION_DURATION","canBeQuicklyUploaded","kind","CONTENT_TYPES_FOR_QUICK_UPLOAD","isBlurred","isBackgroundBlurred","background","customBackground","backgroundColor","patternColor","themes","isMobileSearchActive","getCanPostInChat","isBotNotStarted","isPinnedMessageList","isScheduledMessageList","currentUserBannedRights","defaultBannedRights","hasPinnedOrAudioMessage","loadUser","setDropAreaState","isFabShown","setIsFabShown","isNotchShown","setIsNotchShown","isUnpinModalOpen","setIsUnpinModalOpen","setIsReady","ANIMATION_LEVEL_MIN","renderingChatId","usePrevDuringAnimation","renderingThreadId","renderingMessageListType","renderingCanPost","renderingHasTools","renderingIsFabShown","handleDragEnter","dataTransfer","shouldDrawQuick","handleHideDropArea","handleOpenUnpinModal","closeUnpinModal","handleUnpinAllMessages","handleTabletFocus","customBackgroundValue","settingValue","cacheApi","CUSTOM_BG_CACHE_NAME","Type","useCustomBackground","MASK_IMAGE_DISABLED","messagingDisabledClassName","messageSendingRestrictionReason","getMessageSendingRestrictionReason","composerHiddenScale","toolbarHiddenScale","composerTranslateX","toolbarTranslateX","unpinHiddenScale","toolbarForUnpinHiddenScale","sidePadding","messageListWidth","leftColumnWidth","rightColumnWidth","getMessageListWidth","sendButtonWidth","composerWidth","toolbarWidth","calculateMiddleFooterTransforms","footerClassName","onTransitionEnd","propertyName","DARK_THEME_BG_COLOR","LIGHT_THEME_BG_COLOR","onDragEnter","onUnpin","HeaderContent","isProfile","isManagement","messageSearchQuery","stickerSearchQuery","selectCurrentStickerSearch","gifSearchQuery","selectCurrentGifSearch","canManage","isColumnOpen","isSearch","isStickerSearch","isGifSearch","isPollResults","isAddingChatMembers","profileState","managementScreen","setLocalTextSearchQuery","searchTextMessagesLocal","toggleManagement","shouldSkipAnimation","backButtonRef","handleMessageSearchQueryChange","handleStickerSearchQueryChange","handleGifSearchQueryChange","setShouldSkipTransition","contentKey","ProfileState","Profile","SharedMedia","MemberList","Search","PollResults","StickerSearch","GifSearch","AddingMembers","ManagementScreens","ManageInitial","ManageChatPrivacyType","ManageDiscussion","ManageChannelSubscribers","ManageGroupPermissions","ManageChatAdministrators","ManageGroupRemovedUsers","ManageGroupUserPermissionsCreate","ManageGroupUserPermissions","ManageGroupRecentActions","ManageGroupAdminRights","ManageGroupMembers","renderingContentKey","renderHeaderContent","isBackButton","buttonClassName","useInfiniteScrollForSharedMedia","forSharedMediaType","currentResultType","handleLoadMore","messageIdsRef","getMessageContentIds","reverse","getMore","useInfiniteScroll","runThrottledForScroll","isScrollingProgrammatically","contactName","getUserFirstOrLastName","deleteChatMember","handleDeleteChatMember","Modal","onEnter","TABS","buildInfiniteScrollItemSelector","resultType","mediaSearchType","isGroup","hasMembersTab","areMembersHidden","canViewMembers","canAddMembers","getHasAdminRight","canDeleteMembers","resolvedUserId","onProfileStateChange","setLocalMediaSearchType","loadMoreMembers","searchMediaMessagesLocal","loadProfilePhotos","setActiveTab","deletingUserId","setDeletingUserId","tabType","noProfileInfo","searchMessages","sortUserIds","memberViewportIds","getMoreMembers","noProfileInfoForMembers","MEMBERS_SLICE","useInfiniteScrollForMembers","mediaViewportIds","getMoreMedia","noProfileInfoForMedia","documentViewportIds","getMoreDocuments","noProfileInfoForDocuments","linkViewportIds","getMoreLinks","noProfileInfoForLinks","audioViewportIds","getMoreAudio","noProfileInfoForAudio","useProfileViewportIds","prevTabType","tabsEl","prevProfileState","determineProfileState","tabListEl","useProfileState","applyTransitionFix","releaseTransitionFix","transitionElSelector","setMinHeight","transitionEl","minHeight","overflowY","scrollBarWidth","clientWidth","marginRight","useTransitionFixes","cacheBuster","resetCacheBuster","setCacheBuster","useCacheBuster","handleTransitionStop","handleNewMemberDialogOpen","handleSelectMedia","handlePlayAudio","handleMemberClick","handleMessageFocus","handleDeleteMembersModalClose","renderingDelay","isFirstTab","SLIDE_TRANSITION_DURATION","canRenderContents","getMemberContextAction","handler","renderSharedMedia","noSpinner","NothingFound","Media","withDate","smaller","onDateClick","WebLink","onMessageClick","ListItem","teactOrderKey","contextActions","forceShowSelf","InfiniteScroll","itemSelector","sensitiveArea","PROFILE_SENSITIVE_AREA","preloadBackwards","noScrollRestoreOnTop","noFastList","onLoadMore","ProfileInfo","ChatExtra","renderProfileInfo","shouldRestoreHeight","onStart","onStop","big","FloatingActionButton","RightSearch","Management","localContactIds","isSearching","onNextStep","setUserSearchQuery","selectedMemberIds","setSelectedMemberIds","noPickerScrollRestore","member","handleFilterChange","displayedIds","sortChatIds","foundContactIds","fullName","getUserFullName","contactId","isUserBot","canBeInvitedToGroup","handleNextStep","Picker","itemIds","selectedIds","filterValue","filterPlaceholder","searchInputId","onSelectedIdsChange","onFilterChange","noScrollRestore","MAIN_SCREENS_COUNT","RightColumnContent","MANAGEMENT_SCREENS_COUNT","blurSearchInput","areActiveChatsLoaded","selectAreActiveChatsLoaded","selectRightColumnContentKey","currentProfileUserId","selectedId","isChatSelected","toggleChatInfo","closePollResults","addChatMembers","setProfileState","setManagementScreen","selectedChatMemberId","setSelectedChatMemberId","isPromotedByCurrentUser","setIsPromotedByCurrentUser","isScrolledDown","isOverlaying","shouldScrollUp","handleSelectChatMember","memberId","isPromoted","handleAppendingChatMembers","onChatMemberSelect","prevContentKey","MediaViewer","Notifications","Dialogs","ForwardPicker","SafeLinkModal","HistoryCalendar","notificationInterval","DEBUG_isLogged","updateIcon","asUnread","updatePageTitle","nextTitle","isMediaViewerOpen","selectIsMediaViewerOpen","isForwardModalOpen","selectIsForwardModalOpen","hasNotifications","hasDialogs","isHistoryCalendarOpen","loadNotificationSettings","loadNotificationExceptions","updateIsOnline","loadTopInlineBots","loadEmojiKeywords","openStickerSetShortName","LOCATION_HASH","protocol","searchParams","pathname","domain","processDeepLink","decodeURIComponent","middleColumnTransitionClassNames","rightColumnTransitionClassNames","prevIsLeftColumnShown","dispatchHeavyAnimationEnd","waitForTransitionEnd","prevIsRightColumnShown","initialUnread","clearInterval","setInterval","INACTIVE_MARKER","newUnread","PAGE_TITLE","handleStickerSetModalClose","stopEvent","usePreventIosPinchZoom","onDrop","onDragOver","initApi"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/433.29f542772c88e944d938.css b/dist/433.c66cb5158ff9fdb2297f.css similarity index 94% rename from dist/433.29f542772c88e944d938.css rename to dist/433.c66cb5158ff9fdb2297f.css index 582d3bc8..b238bb48 100644 --- a/dist/433.29f542772c88e944d938.css +++ b/dist/433.c66cb5158ff9fdb2297f.css @@ -20,17 +20,17 @@ .Message{display:flex;align-items:flex-end;margin-bottom:.375rem;position:relative;--background-color: var(--color-background);--hover-color: var(--color-reply-hover);--active-color: var(--color-reply-active);--max-width: 29rem;--accent-color: var(--color-primary);--accent-shade-color: var(--color-primary-shade);--secondary-color: var(--color-text-secondary);--meta-safe-area-base: 2.25rem;--meta-safe-author-width: 0px;--meta-safe-area-extra-width: 0px;--meta-safe-area-size: calc(var(--meta-safe-area-base) + var(--meta-safe-author-width) + var(--meta-safe-area-extra-width));--deleting-translate-x: -50%;--select-message-scale: 0.9;--select-background-color: white}.Message.is-swiped{transform:translateX(-2.5rem) !important}.Message>.Avatar,.Message>.message-content-wrapper{opacity:1;transform:scale(1) translateX(0);transition:transform var(--select-transition)}body.animation-level-0 .Message>.Avatar,body.animation-level-0 .Message>.message-content-wrapper{transition:none !important}.Message>.Avatar{position:absolute;bottom:0;left:0}@media(max-width: 600px){.Message>.Avatar{width:2.5rem;height:2.5rem}}.Message.last-in-group{margin-bottom:.625rem}.Message.last-in-list{margin-bottom:.375rem}.Message.is-in-selection-mode .Album{border:1px var(--select-background-color) solid;background-color:var(--select-background-color)}body.is-android .Message.is-in-selection-mode .can-select-text{z-index:var(--z-message-select-control)}body.is-android .Message.is-in-selection-mode .media-inner{pointer-events:none}.Message.has-inline-buttons .message-content{border-bottom-right-radius:var(--border-radius-messages-small)}.Message:not(.own){padding-left:2.5rem}.no-avatars .Message:not(.own),.Message:not(.own).is-thread-top{padding-left:0}@media(max-width: 600px){.Message:not(.own){padding-left:2.875rem}.no-avatars .Message:not(.own),.Message:not(.own).is-thread-top{padding-left:.25rem}}.Message.own{flex-direction:row-reverse;--background-color: var(--color-background-own);--hover-color: var(--color-reply-own-hover);--active-color: var(--color-reply-own-active);--max-width: 30rem;--accent-color: var(--color-accent-own);--accent-shade-color: var(--color-green);--secondary-color: var(--color-accent-own);--color-code: var(--color-code-own);--color-code-bg: var(--color-code-own-bg);--color-links: var(--color-own-links);--color-links-hover: var(--color-own-links);--meta-safe-area-base: 3.5rem;--deleting-translate-x: 50%;--color-text-green: var(--color-accent-own)}body.is-ios .Message.own,body.is-macos .Message.own{--color-background-own: var(--color-background-own-apple);--color-reply-own-hover: var(--color-reply-own-hover-apple);--color-reply-own-active: var(--color-reply-own-active-apple)}@media(max-width: 600px){.Message.own{padding-right:.25rem}}.Message.is-deleting>.Avatar,.Message.is-deleting>.message-content-wrapper{transition:opacity .2s ease,transform .2s ease-in;opacity:0;transform:scale(0.3) translateX(var(--deleting-translate-x));transform-origin:bottom}.Message.has-views{--meta-safe-area-extra-width: 4rem}.Message.was-edited{--meta-safe-area-extra-width: 2.5rem}.Message.was-edited.has-views{--meta-safe-area-extra-width: 7.5rem}html[lang=ru] .Message.was-edited{--meta-safe-area-extra-width: 3.5rem}html[lang=ru] .Message.was-edited.has-views{--meta-safe-area-extra-width: 8.5rem}.select-mode-active .Message{cursor:pointer}@media(min-width: 600px){.select-mode-active .Message{-webkit-user-select:none;user-select:none}}.select-mode-active .Message:not(.own)>.Avatar,.select-mode-active .Message:not(.own)>.message-content-wrapper{transform:translateX(2.5rem)}.select-mode-active .Message:not(.is-album)::after{content:"";position:absolute;top:-0.25rem;bottom:-0.25rem;left:-4rem;right:-4rem;z-index:var(--z-message-select-area)}.select-mode-active .Message.is-album .message-select-control,.select-mode-active .Message.is-in-document-group .message-select-control{pointer-events:unset}.select-mode-active .Message .message-select-control{opacity:1}.Message.is-selected .message-select-control{background:var(--color-green)}.Message.is-selected .message-select-control.group-select{background:transparent}.Message.is-selected .message-select-control.group-select.is-selected{background:var(--color-green)}.Message .File.file-is-selected .message-select-control{background:var(--color-green)}.Message.is-in-document-group .File.file-is-selected .file-icon,.Message.has-menu-open.is-in-document-group .File .file-icon{--background-color: var(--color-background-selected)}.Message.own.is-in-document-group .File.file-is-selected .file-icon,.Message.own.has-menu-open.is-in-document-group .File .file-icon{--background-color: var(--color-background-own-selected)}.Message .Audio .message-select-control{left:1.0625rem;top:1.375rem}html.theme-dark .Message.own .Audio .ProgressSpinner{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTguMjE4IDcuNWw1LjYzMy01LjYzM2EuNTA4LjUwOCAwIDEwLS43MTgtLjcxOEw3LjUgNi43ODIgMS44NjcgMS4xNDlhLjUwOC41MDggMCAxMC0uNzE4LjcxOEw2Ljc4MiA3LjVsLTUuNjMzIDUuNjMzYS41MDguNTA4IDAgMTAuNzE4LjcxOEw3LjUgOC4yMThsNS42MzMgNS42MzNhLjUwNi41MDYgMCAwMC43MTggMCAuNTA4LjUwOCAwIDAwMC0uNzE4TDguMjE4IDcuNXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjODA3QkQ1IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+);background-position:center;background-size:1rem}html.theme-dark .Message.own .Audio .ProgressSpinner circle{stroke:var(--background-color)}.Message .File{position:relative}.Message .File .message-select-control{position:absolute;top:2rem;left:2rem;z-index:2}.Message.own .Message .album-item-select-wrapper{background:var(--color-background-own)}.Message .album-item-select-wrapper .message-select-control{position:absolute;top:.438rem;right:.438rem;left:unset}.Message .album-item-select-wrapper .media-inner{border:0 var(--select-background-color) solid;transition:border-width var(--select-transition)}.Message .album-item-select-wrapper img,.Message .album-item-select-wrapper video{transition:transform var(--select-transition),opacity ease 300ms}.Message .album-item-select-wrapper.is-selected .message-select-control{background:var(--color-green)}.Message .album-item-select-wrapper.is-selected img,.Message .album-item-select-wrapper.is-selected video{transform:scale(var(--select-message-scale))}.Message.is-selected .message-select-control,.Message.is-forwarding .message-select-control{background:var(--color-green)}.Message.is-selected .Menu .bubble,.Message.is-forwarding .Menu .bubble{transition:none !important}.Message.is-in-document-group:not(.first-in-document-group)::before{top:0 !important}.Message.is-in-document-group:not(.first-in-document-group) .message-content{box-shadow:none;border-top-left-radius:0 !important;border-top-right-radius:0 !important}.Message.is-in-document-group:not(.first-in-document-group) .forwarded-message::before{top:-1.5rem}.Message.is-in-document-group:not(.last-in-document-group){margin-bottom:0}.Message.is-in-document-group:not(.last-in-document-group)::before{bottom:0 !important}.Message.is-in-document-group:not(.last-in-document-group) .message-content{border-bottom-left-radius:0 !important;border-bottom-right-radius:0 !important}.Message.is-in-document-group.is-in-selection-mode .Audio:not(.audio-is-selected) .message-select-control:not(.group-select),.Message.is-in-document-group.is-in-selection-mode .File:not(.file-is-selected) .message-select-control:not(.group-select){background:#fff}.Message.is-in-document-group.is-in-selection-mode .Audio:not(.audio-is-selected) .message-select-control:not(.group-select)::after,.Message.is-in-document-group.is-in-selection-mode .File:not(.file-is-selected) .message-select-control:not(.group-select)::after{content:"";width:1.25rem;height:1.25rem;border-radius:.688rem;background:#fff;border:.125rem rgba(0,0,0,.2) solid;position:absolute}.Message.is-in-document-group.is-in-selection-mode.own .message-content .Audio:not(.audio-is-selected) .message-select-control:not(.group-select),.Message.is-in-document-group.is-in-selection-mode.own .message-content .File:not(.file-is-selected) .message-select-control:not(.group-select){background:var(--background-color);border-color:var(--background-color)}.Message.is-in-document-group.is-in-selection-mode.own .message-content .Audio:not(.audio-is-selected) .message-select-control:not(.group-select)::after,.Message.is-in-document-group.is-in-selection-mode.own .message-content .File:not(.file-is-selected) .message-select-control:not(.group-select)::after{background:var(--background-color);border-color:var(--color-message-meta-own)}.Message.is-in-document-group.focused .message-content,.Message.is-in-document-group.has-menu-open .message-content,.Message.is-in-document-group.is-forwarding .message-content,.Message.is-in-document-group.is-selected .message-content{background:var(--color-background-selected)}.Message.is-in-document-group.focused.own .message-content,.Message.is-in-document-group.has-menu-open.own .message-content,.Message.is-in-document-group.is-forwarding.own .message-content,.Message.is-in-document-group.is-selected.own .message-content{--background-color: var(--color-background-own-selected);background:var(--color-background-own-selected)}.Message.is-in-document-group .message-content-wrapper{width:17.1875rem}.Message.is-in-document-group .message-content{transition:background-color var(--select-transition)}.Message.is-in-document-group.own .message-content-wrapper{display:flex;justify-content:flex-end}.Message.is-in-document-group.own .message-content-wrapper .message-content{width:100%}.Message .album-item-select-wrapper{position:absolute}.Message .album-item-select-wrapper .message-select-control{position:absolute;z-index:2}.Message .message-select-control{position:absolute;left:0;bottom:.25rem;width:1.5rem;height:1.5rem;border:2px solid #fff;border-radius:50%;z-index:var(--z-message-select-control);display:flex;align-items:center;justify-content:center;color:#fff;font-size:1rem;opacity:0;pointer-events:none;transition:opacity var(--select-transition)}.Message .message-select-control .icon-select{position:absolute;left:-3px;top:-3px;font-size:1.625rem}.theme-dark .Message .message-select-control{border-color:#ffffff80}.Message .Avatar{margin-right:.3rem}.Message.is-in-document-group .message-content.document{padding:.25rem .5rem !important}.Message.is-in-document-group.last-in-document-group .message-content.document{padding-bottom:.5rem !important}.Message.is-in-document-group.first-in-document-group .message-content.document{padding-top:.5rem !important}.message-content,.Album,.media-inner,.message-content.media .media-inner img,.message-content.media .media-inner video,.message-content.custom-shape .media-inner img{border-top-left-radius:var(--border-top-left-radius);border-top-right-radius:var(--border-top-right-radius);border-bottom-left-radius:var(--border-bottom-left-radius);border-bottom-right-radius:var(--border-bottom-right-radius)}.media-inner video.full-media{background:transparent !important}.media-inner{overflow:hidden}.media-inner.small-image img{border-radius:0 !important}.Message{--border-top-left-radius: var(--border-radius-messages);--border-top-right-radius: var(--border-radius-messages);--border-bottom-left-radius: var(--border-radius-messages);--border-bottom-right-radius: var(--border-radius-messages)}.Message:not(.own).first-in-group:not(.last-in-group){--border-bottom-left-radius: var(--border-radius-messages-small)}.Message:not(.own):not(.first-in-group):not(.last-in-group){--border-top-left-radius: var(--border-radius-messages-small);--border-bottom-left-radius: var(--border-radius-messages-small)}.Message:not(.own).last-in-group:not(.first-in-group){--border-top-left-radius: var(--border-radius-messages-small)}.Message:not(.own).last-in-group{--border-bottom-left-radius: var(--border-radius-messages-small)}.Message:not(.own).last-in-group .message-content.has-appendix{--border-bottom-left-radius: 0}.Message.own.first-in-group:not(.last-in-group){--border-bottom-right-radius: var(--border-radius-messages-small)}.Message.own:not(.first-in-group):not(.last-in-group){--border-top-right-radius: var(--border-radius-messages-small);--border-bottom-right-radius: var(--border-radius-messages-small)}.Message.own.last-in-group:not(.first-in-group){--border-top-right-radius: var(--border-radius-messages-small)}.Message.own.last-in-group{--border-bottom-right-radius: var(--border-radius-messages-small)}.Message.own.last-in-group .message-content.has-appendix{--border-bottom-right-radius: 0}.Message .message-content.has-replies:not(.custom-shape) .media-inner,.Message .message-content.has-replies:not(.custom-shape) .Album,.Message .message-content.text .media-inner,.Message .message-content.text .Album{--border-bottom-left-radius: 0;--border-bottom-right-radius: 0}.Message .message-content.is-reply .EmbeddedMessage+.Album,.Message .message-content.is-reply .EmbeddedMessage+.Audio,.Message .message-content.is-reply .EmbeddedMessage+.File{margin-top:.375rem}.Message .message-content:not(.custom-shape).is-reply .media-inner,.Message .message-content:not(.custom-shape).is-reply .Album,.Message .message-content:not(.custom-shape).force-sender-name .Album,.Message .message-content:not(.is-forwarded) .message-title~.media-inner{--border-top-left-radius: 0;--border-top-right-radius: 0}.Message .message-content.is-forwarded .content-inner .message-title{margin-bottom:.25rem}.Message .message-action-button{position:absolute;bottom:0;color:#fff;background-color:rgba(0,0,0,.2);opacity:0;transition:opacity .2s ease}@media(pointer: coarse){.Message .message-action-button{opacity:1 !important}}.Message .message-action-button:hover,.Message .message-action-button:active,.Message .message-action-button:focus{background-color:rgba(0,0,0,.28) !important}.Message:hover .message-action-button,.Message[data-is-document-group-hover] .message-action-button{opacity:1}.Message.own .message-action-button{left:-3rem}.Message:not(.own) .message-action-button{right:-3rem}.Message .bottom-marker{height:1px;width:1px;visibility:hidden}.Message .custom-shape .message-action-button{bottom:.25rem}.message-content{position:relative;max-width:var(--max-width)}@media(max-width: 600px){.message-content{max-width:calc(100vw - 6.25rem)}.Message.own .message-content,.MessageList.no-avatars .message-content{max-width:calc(100vw - 3.75rem)}@supports(max-width: min(29rem, 100vw - 6.25rem)){.message-content{max-width:min(29rem, 100vw - 6.25rem)}.MessageList.no-avatars .message-content{max-width:min(29rem, 100vw - 3.75rem)}.Message.own .message-content{max-width:min(30rem, 100vw - 3.75rem)}}.message-content.has-action-button{max-width:calc(100vw - 7rem)}.Message.own .message-content.has-action-button,.MessageList.no-avatars .message-content.has-action-button{max-width:calc(100vw - 4.5rem)}@supports(max-width: min(29rem, 100vw - 5.5rem)){.message-content.has-action-button{max-width:min(29rem, 100vw - 7rem)}.MessageList.no-avatars .message-content.has-action-button{max-width:min(29rem, 100vw - 4.5rem)}.Message.own .message-content.has-action-button{max-width:min(30rem, 100vw - 4.5rem)}}}.message-content img{-webkit-touch-callout:none;-webkit-user-select:none}.message-content .text-content{margin:0;word-break:break-word;line-height:1.3125;text-align:initial;display:flow-root;unicode-bidi:plaintext}.message-content .text-entity-link{unicode-bidi:plaintext}.message-content:not(.custom-shape) .text-content>.MessageMeta,.message-content.document>.MessageMeta{position:relative;top:.375rem;bottom:auto !important;float:right;line-height:1;height:calc(var(--message-meta-height, 1rem));margin-left:.4375rem;margin-right:-0.5rem}.message-content:not(.custom-shape) .text-content>.MessageMeta .MessageOutgoingStatus .Transition,.message-content.document>.MessageMeta .MessageOutgoingStatus .Transition{max-height:calc(var(--message-meta-height, 1rem));overflow:hidden}html[data-message-text-size="12"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size="12"] .message-content.document>.MessageMeta{top:.25rem}html[data-message-text-size="17"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size="17"] .message-content.document>.MessageMeta{top:.4375rem}html[data-message-text-size="18"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size="19"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size="18"] .message-content.document>.MessageMeta,html[data-message-text-size="19"] .message-content.document>.MessageMeta{top:.5rem}html[data-message-text-size="20"] .message-content:not(.custom-shape) .text-content>.MessageMeta,html[data-message-text-size="20"] .message-content.document>.MessageMeta{top:.5625rem}.message-content:not(.custom-shape) .text-content:dir(rtl)>.MessageMeta,.message-content.document:dir(rtl)>.MessageMeta{float:left;margin-left:-0.25rem;margin-right:.4375rem}.message-content.document:not(.text)::after{content:"";display:block;clear:both}.message-content.document:not(.text)>.MessageMeta{top:auto !important;bottom:-0.5rem !important;margin-top:-0.25rem}.message-content.document:not(.text)>.MessageMeta:not([dir=rtl]){margin-top:-1.25rem}.theme-dark .Message.own .message-content .text-entity-link{text-decoration:underline}.theme-dark .Message.own .message-content .text-entity-link:hover{text-decoration:none}.message-content:not(.custom-shape){font-size:var(--message-text-size, 1rem)}body.is-ios .message-content:not(.custom-shape){font-size:var(--message-text-size, 1.0625rem)}.message-content:not(.custom-shape)>.content-inner{min-width:0}.message-content .matching-text-highlight{background:#cae3f7;border-radius:.25rem;padding:0 .125rem}.message-content .message-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:calc(var(--message-text-size, 1rem) - .125rem);font-weight:500;line-height:1.25rem;color:var(--accent-color);unicode-bidi:plaintext;display:flex}.message-content .message-title>.interactive{overflow:hidden;text-overflow:ellipsis}.message-content .message-title.interactive,.message-content .message-title>.interactive{cursor:pointer}.message-content .message-title.interactive:hover,.message-content .message-title>.interactive:hover{opacity:.85}.message-content .message-title>.color-1{color:var(--color-user-1)}.message-content .message-title>.color-2{color:var(--color-user-2)}.message-content .message-title>.color-4{color:var(--color-user-4)}.message-content .message-title>.color-5{color:var(--color-user-5)}.message-content .message-title>.color-6{color:var(--color-user-6)}.message-content .message-title>.color-7{color:var(--color-user-7)}.message-content .message-title>.color-8{color:var(--color-user-8)}.theme-dark .Message.own .message-content .message-title>.color-1{color:var(--accent-color)}.message-content .message-title+.File{margin-top:.25rem}.message-content .message-title .via{padding-right:.25rem;font-weight:400}.message-content .message-title span+.via{padding-left:.25rem}.message-content .message-title .admin-title{flex:1;margin-left:1rem;text-align:right;font-weight:400;font-size:.75rem;margin-top:-0.1rem;color:rgba(var(--color-text-meta-rgb), 0.75)}.Message.own .message-content .message-title .admin-title{color:var(--accent-color)}.message-content.has-shadow{box-shadow:0 1px 2px var(--color-default-shadow)}.message-content.has-solid-background,.message-content.has-background,.is-album .message-content{background:var(--background-color)}.message-content.has-solid-background{padding:.3125rem .5rem .375rem}.message-content.has-solid-background .forwarded-message>.text-content:not(.with-meta):last-child::after{content:"";display:inline-block;width:var(--meta-safe-area-size);height:1rem}.message-content:not(.has-appendix) .svg-appendix{display:none}.message-content .svg-appendix{overflow:hidden;position:absolute;bottom:-0.0625rem;width:.5625rem;height:1.125rem;font-size:1rem !important}.message-content .svg-appendix .corner{fill:var(--background-color)}.Message.own .message-content .svg-appendix{right:-0.551rem}.Message:not(.own) .message-content .svg-appendix{left:-0.562rem}.message-content[data-has-custom-appendix] .svg-appendix .corner{fill:var(--appendix-bg)}.Message .message-content.has-appendix-thumb .svg-appendix{--background-color: #ccc;opacity:1;transition:opacity 500ms ease}.message-content.document{padding:.5rem !important}.theme-dark .message-content.document .File{--color-primary: var(--color-selection-highlight)}.message-content.document .File+.text-content{margin-top:.3125rem}.message-content.voice .message-title,.message-content.voice .Embedded,.message-content.audio .message-title,.message-content.audio .Embedded{margin-top:-0.1875rem;margin-bottom:.1875rem}.message-content.voice{padding:.5rem !important}.message-content.voice .Voice+.text-content{margin-top:.5rem}.message-content.audio{min-width:17.1875rem;padding:.5rem .5rem .8125rem !important}.message-content.audio .Audio+.text-content{margin-top:.25rem}.message-content.audio:not(.has-replies) .Audio+.text-content{margin-bottom:-0.4375rem}.message-content:not(.custom-shape) .emoji{display:inline-block;width:1.25rem;background-size:1.25rem;color:transparent;margin-inline-end:1px;vertical-align:text-bottom}.message-content:not(.custom-shape) .emoji::selection{background-color:var(--color-selection-highlight-emoji);color:transparent}.message-content:not(.custom-shape) .text-content .emoji{width:calc(1.25 * var(--message-text-size, 1rem));height:calc(1.25 * var(--message-text-size, 1rem));background-size:calc(1.25 * var(--message-text-size, 1rem))}.message-content .no-media-corners{--border-top-left-radius: 0;--border-top-right-radius: 0}.message-content.custom-shape.is-via-bot{font-size:inherit !important}.message-content.custom-shape.is-via-bot .content-inner>.message-title{display:inline-flex;position:relative;top:.125rem;max-width:calc(100% - 3rem);margin-left:calc(100% - 3rem);padding:0 .5rem;background-color:var(--background-color);border-radius:var(--border-radius-messages)}.Message.own .message-content.custom-shape.is-via-bot .content-inner>.message-title{margin-left:-3rem}.message-content.custom-shape.is-via-bot .media-inner{margin-top:.375rem}.message-content.media .media-inner,.WebPage .media-inner{display:flex;justify-content:center;align-items:center}.message-content.media .media-inner.interactive,.WebPage .media-inner.interactive{cursor:pointer}.message-content.media .media-inner.interactive.dark video,.WebPage .media-inner.interactive.dark video{background-color:#232323}.message-content.media.round.is-reply,.WebPage.round.is-reply{width:auto !important}.message-content.media.force-sender-name .media-inner,.message-content.media.force-sender-name .Album,.message-content.media.text .media-inner,.message-content.media.is-via-bot .media-inner,.message-content.media.is-reply .media-inner,.message-content.media.is-reply .Album,.WebPage.force-sender-name .media-inner,.WebPage.force-sender-name .Album,.WebPage.text .media-inner,.WebPage.is-via-bot .media-inner,.WebPage.is-reply .media-inner,.WebPage.is-reply .Album{margin-left:-0.5rem;margin-right:-0.5rem}.message-content.media.text .media-inner,.WebPage.text .media-inner{margin-top:-0.3125rem}.message-content.media.is-reply .media-inner,.message-content.media.force-sender-name .Album,.message-content.media.is-reply .Album,.message-content.media .message-title~.media-inner,.WebPage.is-reply .media-inner,.WebPage.force-sender-name .Album,.WebPage.is-reply .Album,.WebPage .message-title~.media-inner{margin-top:.375rem;margin-bottom:-0.375rem}.message-content.media.text .media-inner,.message-content.media.text .Album,.WebPage.text .media-inner,.WebPage.text .Album{margin-bottom:.375rem}.message-content.media .media-loading,.WebPage .media-loading{display:flex;align-items:center;justify-content:center}.message-content.media .media-loading:not(.open),.WebPage .media-loading:not(.open){opacity:.5;transform:scale(0);transition:opacity .3s ease,transform .3s ease}.message-content.media .icon-large-play,.message-content.media .icon-download,.WebPage .icon-large-play,.WebPage .icon-download{position:absolute;display:flex;align-items:center;justify-content:center;color:#fff;opacity:.7;transition:opacity 150ms}.message-content.media .icon-large-play:hover,.message-content.media .icon-download:hover,.WebPage .icon-large-play:hover,.WebPage .icon-download:hover{opacity:1}.message-content.media .icon-large-play:before,.message-content.media .icon-download:before,.WebPage .icon-large-play:before,.WebPage .icon-download:before{display:flex;align-items:center;justify-content:center;width:3.375rem;height:3.375rem;border-radius:50%;background:rgba(0,0,0,.25)}.message-content.media .icon-download,.WebPage .icon-download{font-size:1.5rem}.message-content.media .icon-large-play,.WebPage .icon-large-play{font-size:2.5rem}.message-content.media .message-media-duration,.message-content.media .message-upload-progress,.WebPage .message-media-duration,.WebPage .message-upload-progress{background:rgba(0,0,0,.25);color:#fff;font-size:.75rem;position:absolute;left:.1875rem;top:.1875rem;z-index:1;padding:0 .375rem;border-radius:.75rem;line-height:1.125rem}.message-content.media .message-media-duration .icon-muted-chat,.WebPage .message-media-duration .icon-muted-chat{vertical-align:-0.1875rem;margin-left:.375rem;font-size:1.0625rem}.message-content.custom-shape{line-height:1.2;font-size:10rem;display:flex;flex-wrap:wrap;align-items:flex-end}.message-content.custom-shape.has-comments{min-height:5.25rem;margin-top:0 !important}.message-content.custom-shape.has-comments.has-replies{min-height:6.5rem}.message-content.custom-shape.is-reply{max-width:100%}.message-content.custom-shape .reply-message{display:flex;align-items:flex-start;flex-direction:row-reverse;direction:ltr}.message-content.custom-shape .reply-message>p{margin-bottom:0}.message-content.custom-shape .reply-message .EmbeddedMessage{margin-left:.5rem;border-radius:var(--border-radius-messages)}@media(max-width: 600px){.message-content.custom-shape .reply-message .EmbeddedMessage{max-width:calc(90vw - 13rem)}}@media(max-width: 340px){.message-content.custom-shape .reply-message .EmbeddedMessage{margin-left:-1rem;z-index:1;max-width:calc(90vw - 12rem)}}.message-content.custom-shape .text-content{margin-bottom:1rem}.message-content.custom-shape .media-inner{line-height:1;font-size:1rem;flex-shrink:0}.message-content.custom-shape .media-inner .full-media{top:0;left:0;bottom:0;right:0}.message-content.custom-shape .emoji{display:inline-block;color:transparent}.message-content.custom-shape .emoji::selection{background-color:var(--color-selection-highlight-emoji);color:transparent}.message-content.custom-shape.emoji-only .text-content{margin-bottom:0}.message-content.custom-shape.emoji-only-1{min-width:8rem;font-size:4.5rem}.message-content.custom-shape.emoji-only-1 .content-inner{height:7rem}.message-content.custom-shape.emoji-only-1 .text-content{line-height:1.5;text-align:center}.Message.was-edited .message-content.custom-shape.emoji-only-1{min-width:10rem}.message-content.custom-shape.emoji-only-1 .emoji{width:5rem;height:5rem}.message-content.custom-shape.emoji-only-2{font-size:4rem;margin-top:.5rem;min-width:10rem}.message-content.custom-shape.emoji-only-2.has-comments{margin-top:1.25rem}.Message.was-edited .message-content.custom-shape.emoji-only-2{min-width:12rem}.message-content.custom-shape.emoji-only-2 .emoji{width:4rem;height:4rem}.message-content.custom-shape.emoji-only-3{font-size:3rem;margin-top:1.75rem;min-width:12rem}.message-content.custom-shape.emoji-only-3.has-comments{margin-top:2.5rem}.Message.was-edited .message-content.custom-shape.emoji-only-3{min-width:14rem}.message-content.custom-shape.emoji-only-3 .emoji{width:3rem;height:3rem}.Message:not(.own) .message-content.custom-shape{--hover-color: var(--color-reply-hover);--active-color: var(--color-reply-active)}.Message.own .message-content.custom-shape{--hover-color: var(--color-reply-own-hover);--active-color: var(--color-reply-own-active)}.Message.own .message-content.custom-shape .reply-message{flex-direction:row}.Message.own .message-content.custom-shape .reply-message .EmbeddedMessage{margin-right:.5rem}@media(max-width: 340px){.Message.own .message-content.custom-shape .reply-message .EmbeddedMessage{margin-left:0;z-index:1;max-width:calc(90vw - 11.5rem)}}.forwarded-message{--border-top-left-radius: var(--border-radius-messages-small);--border-top-right-radius: var(--border-radius-messages-small);--border-bottom-left-radius: var(--border-radius-messages-small);--border-bottom-right-radius: var(--border-radius-messages-small)}.message-content.poll .forwarded-message{margin-bottom:.5rem}.message-content:not(.custom-shape) .forwarded-message{position:relative;margin-top:.25rem;padding-left:.625rem}.message-content:not(.custom-shape) .forwarded-message::before{content:"";display:block;position:absolute;top:0;bottom:0;left:.05rem;width:2px;background:var(--accent-color);border-radius:2px}.message-content:not(.custom-shape) .forwarded-message:dir(rtl){padding-inline-start:.625rem}.message-content:not(.custom-shape) .forwarded-message:dir(rtl)::before{left:auto;right:.05rem}.forwarded-message>.media-inner{margin:0 !important;margin-bottom:.25rem !important}.long-word-break-all{word-break:break-all}.text-entity-link{color:var(--color-links) !important;text-decoration:none;word-break:break-word;cursor:pointer;unicode-bidi:initial}.text-entity-link:hover,.text-entity-link:active,.text-entity-link:visited{color:var(--color-links-hover) !important;text-decoration:underline}.text-entity-code,.text-entity-pre{color:var(--color-code);background:var(--color-code-bg);white-space:pre-wrap;margin:0;padding:1px 2px;border-radius:4px;font-size:calc(var(--message-text-size, 1rem) - 0.0625rem)} .ContactGreeting{width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center}.ContactGreeting .wrapper{display:inline-flex;flex-direction:column;align-items:center;background:var(--pattern-color);width:14.5rem;padding:.75rem 1rem;border-radius:1.5rem;color:#fff}.ContactGreeting .title{font-weight:500;margin-bottom:0}.ContactGreeting .description{font-size:.9375rem;margin-bottom:0}.ContactGreeting .sticker{margin:2rem 0 1rem;height:10rem;width:10rem;cursor:pointer}.ContactGreeting .sticker .thumbnail{height:10rem;width:10rem} .NoMessages{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.NoMessages .icon{font-size:5rem;margin:0 auto 1rem}.NoMessages .wrapper{display:inline-flex;flex-direction:column;background:var(--pattern-color);max-width:20rem;padding:.75rem 1rem;border-radius:1.5rem;color:#fff}.NoMessages .wrapper[dir=rtl]{text-align:right}.NoMessages .title{font-weight:500;font-size:1rem;margin-bottom:.25rem;text-align:center;unicode-bidi:plaintext}.NoMessages .description{font-size:.9375rem;margin:0;padding:0;list-style:none;unicode-bidi:plaintext}.NoMessages .list-checkmarks{font-size:.9375rem;margin:.25rem 0 0;padding:0;list-style:none;unicode-bidi:plaintext;line-height:1.8}.NoMessages .list-checkmarks li::before{content:"✓";margin-inline-end:.5rem} -.MessageList{flex:1;width:100%;margin-bottom:.5rem;overflow-anchor:none;overflow:scroll;overflow-x:hidden;overflow-y:auto}@supports(overflow-y: overlay){.MessageList{overflow-y:overlay;overflow-x:hidden}}.mask-image-enabled .MessageList{-webkit-mask-image:linear-gradient(to top, transparent 0, #000 0.5rem);mask-image:linear-gradient(to top, transparent 0, #000 0.5rem)}@media(pointer: coarse){.MessageList{-webkit-user-select:none;user-select:none;touch-callout:none}.MessageList.select-mode-active{-webkit-user-select:auto;user-select:auto;touch-callout:default}}.MessageList.no-avatars .Message>.Avatar{display:none}.MessageList .messages-container{width:100%;max-width:var(--messages-container-width);min-height:100%;margin:0 auto;display:flex;justify-content:flex-end;flex-direction:column;padding:1rem 1rem 0 1.125rem}.force-messages-scroll .MessageList .messages-container{margin-top:100vh !important}@media(max-width: 600px){.MessageList .messages-container{width:100vw;padding:2.75rem .5rem 0;margin:0}}.MessageList.no-composer{margin-bottom:0}.MessageList.no-composer .last-in-list{margin-bottom:1rem}.MessageList.select-mode-active,.MessageList.type-pinned{margin-bottom:0}.MessageList.select-mode-active .last-in-list,.MessageList.type-pinned .last-in-list{margin-bottom:5.625rem}@media(max-width: 600px){.MessageList.select-mode-active .last-in-list,.MessageList.type-pinned .last-in-list{margin-bottom:4.25rem}}.MessageList.select-mode-active .last-in-list.ActionMessage,.MessageList.type-pinned .last-in-list.ActionMessage{padding-bottom:.125rem}.MessageList .Message,.MessageList .ActionMessage{position:relative;opacity:1;transform:scale(1);transition:opacity .2s ease,transform .2s ease}.MessageList .Message:not(.open),.MessageList .ActionMessage:not(.open){transform:scale(0.8);opacity:0}.MessageList .Message.open.shown,.MessageList .ActionMessage.open.shown{transform:none}.MessageList .Message::before,.MessageList .ActionMessage::before{content:"";position:absolute;top:-0.1875rem;bottom:-0.1875rem;left:-50vw;right:-50vw;background:#000;z-index:-1;opacity:0;transition:opacity var(--select-transition)}body.animation-level-0 .MessageList .Message::before,body.animation-level-0 .MessageList .ActionMessage::before{transition:none !important}.MessageList .Message:not(.last-in-group)::before,.MessageList .ActionMessage:not(.last-in-group)::before{bottom:-0.1875rem}.MessageList .Message:not(.first-in-group)::before,.MessageList .ActionMessage:not(.first-in-group)::before{top:-0.1875rem}.MessageList .Message.focused::before,.MessageList .ActionMessage.focused::before{transition:none !important}.MessageList .Message.focused::before,.MessageList .Message.is-forwarding::before,.MessageList .Message.is-selected::before,.MessageList .Message.has-menu-open::before,.MessageList .ActionMessage.focused::before,.MessageList .ActionMessage.is-forwarding::before,.MessageList .ActionMessage.is-selected::before,.MessageList .ActionMessage.has-menu-open::before{opacity:.1}.MessageList>.empty{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.MessageList .sticky-date,.MessageList .local-action-message,.MessageList .ActionMessage,.MessageList .empty{text-align:center}.MessageList .sticky-date>span,.MessageList .local-action-message>span,.MessageList .ActionMessage>span,.MessageList .empty>span{display:inline-block;background:var(--pattern-color);color:#fff;font-size:calc(var(--message-text-size, 1rem) - .0625rem);font-weight:500;line-height:1.75;padding:0 .5rem;border-radius:2rem;word-break:break-word}body.is-ios .MessageList .sticky-date>span,body.is-macos .MessageList .sticky-date>span,body.is-ios .MessageList .local-action-message>span,body.is-macos .MessageList .local-action-message>span,body.is-ios .MessageList .ActionMessage>span,body.is-macos .MessageList .ActionMessage>span,body.is-ios .MessageList .empty>span,body.is-macos .MessageList .empty>span{font-size:calc(var(--message-text-size, 1rem) - .125rem)}.MessageList .sticky-date>span .emoji-small,.MessageList .local-action-message>span .emoji-small,.MessageList .ActionMessage>span .emoji-small,.MessageList .empty>span .emoji-small{vertical-align:text-bottom;width:calc(1.25 * var(--message-text-size, 1rem));height:calc(1.25 * var(--message-text-size, 1rem));background-size:calc(1.25 * var(--message-text-size, 1rem))}.MessageList .sticky-date.rich>span,.MessageList .local-action-message.rich>span,.MessageList .ActionMessage.rich>span,.MessageList .empty.rich>span{max-width:80%;text-align:left}.MessageList .sticky-date.rich a,.MessageList .sticky-date.rich a:visited,.MessageList .local-action-message.rich a,.MessageList .local-action-message.rich a:visited,.MessageList .ActionMessage.rich a,.MessageList .ActionMessage.rich a:visited,.MessageList .empty.rich a,.MessageList .empty.rich a:visited{color:var(--color-links-darker) !important}.MessageList .sticky-date.rich a:hover,.MessageList .sticky-date.rich a:active,.MessageList .local-action-message.rich a:hover,.MessageList .local-action-message.rich a:active,.MessageList .ActionMessage.rich a:hover,.MessageList .ActionMessage.rich a:active,.MessageList .empty.rich a:hover,.MessageList .empty.rich a:active{color:var(--color-links-darker-hover) !important}.MessageList .sticky-date{margin-top:1rem;margin-bottom:1rem;z-index:var(--z-sticky-date);pointer-events:none;opacity:1;transition:opacity .3s ease}body:not(.is-scrolling-messages) .MessageList .sticky-date.stuck{opacity:0}body:not(.is-scrolling-messages) .MessageList .sticky-date.stuck span{pointer-events:none}body.animation-level-0 .MessageList .sticky-date{transition:none}.MessageList .sticky-date.interactive{cursor:pointer}.MessageList .sticky-date span{pointer-events:auto}.MessageList.scrolled:not(.is-animating) .sticky-date{position:sticky;top:.625rem}.MessageList.is-animating{overflow:hidden}.MessageList.is-animating .message-select-control{display:none !important}.has-header-tools .MessageList .sticky-date{top:3.75rem}.MessageList .local-action-message,.MessageList .ActionMessage{margin-top:.5rem;margin-bottom:.5rem}.MessageList .ActionMessage .action-link{cursor:pointer}.MessageList .ActionMessage .action-link:hover{text-decoration:underline}.MessageList .sticky-date+.ActionMessage{margin-top:-0.5rem}@media(min-width: 1276px){.MessageList{width:100%;transform:translate3d(0, 0, 0);transition:transform var(--layer-transition)}.MessageList .messages-container{width:calc(100% - var(--right-column-width))}body.animation-level-0 .MessageList{transition:none}#Main.right-column-open .MessageList{transform:translate3d(calc(var(--right-column-width) / -2), 0, 0)}body:not(.animating-right-column) #Main.right-column-open .MessageList.select-mode-active,#Main.right-column-open .MessageList:not(.select-mode-active),body.animating-right-column .MessageList:not(.select-mode-active){width:calc(100% - var(--right-column-width))}body:not(.animating-right-column) #Main.right-column-open .MessageList.select-mode-active .messages-container,#Main.right-column-open .MessageList:not(.select-mode-active) .messages-container,body.animating-right-column .MessageList:not(.select-mode-active) .messages-container{width:100%}}@media(max-width: 600px){.MessageList{transition:transform var(--layer-transition)}body.enable-symbol-menu-transforms .MessageList{transform:translate3d(0, 0, 0)}body.is-symbol-menu-open .MessageList{transform:translate3d(0, calc(-1 * (var(--symbol-menu-height) + var(--symbol-menu-footer-height))), 0)}}.animating>div>.MessageList::-webkit-scrollbar{width:0}@supports(scrollbar-width: none){.animating>div>.MessageList{padding-right:.6875rem;scrollbar-width:none}} -.ScrollDownButton{--base-bottom-pos: 6rem;position:absolute;bottom:var(--base-bottom-pos);right:1rem;opacity:0;transform:translateY(4.5rem);transition:transform .25s cubic-bezier(0.34, 1.56, 0.64, 1),opacity .2s ease;z-index:var(--z-scroll-down-button);pointer-events:none}body.animation-level-0 .ScrollDownButton{transform:none !important;transition:opacity .15s}@media(max-width: 600px){.ScrollDownButton{right:.5rem;bottom:4.5rem}}.ScrollDownButton-inner{display:flex;flex-direction:column;align-items:center}.ScrollDownButton-inner>.Button{box-shadow:0 1px 2px var(--color-default-shadow)}.ScrollDownButton-inner>.Button i{font-size:1.75rem}@media(min-width: 1276px){.ScrollDownButton-inner{transform:translateX(0);transition:transform var(--layer-transition)}body.animation-level-0 .ScrollDownButton-inner{transition:none !important}#Main.right-column-open .ScrollDownButton-inner{transform:translateX(calc(-1 * var(--right-column-width)))}}@media(max-width: 600px){.ScrollDownButton-inner>.Button{width:2.875rem;height:2.875rem}}.ScrollDownButton.revealed{transform:translateY(0);opacity:1;pointer-events:all}.ScrollDownButton.revealed.no-composer{transform:translateY(4rem)}.ScrollDownButton .unread-count{min-width:1.5rem;height:1.5rem;padding:0 .45rem;border-radius:.75rem;font-size:.875rem;line-height:1.5rem;font-weight:500;text-align:center;position:absolute;top:-0.3rem;right:-0.3rem;background:var(--color-green);color:#fff;pointer-events:none}@media(max-width: 600px){.ScrollDownButton .unread-count{top:-0.7rem;right:auto}}@media(max-width: 600px){body.is-symbol-menu-open .ScrollDownButton{bottom:calc(var(--base-bottom-pos) + var(--symbol-menu-height) + var(--symbol-menu-footer-height))}} +.MessageList{flex:1;width:100%;margin-bottom:.5rem;overflow-anchor:none;overflow:scroll;overflow-x:hidden;overflow-y:auto}@supports(overflow-y: overlay){.MessageList{overflow-y:overlay;overflow-x:hidden}}.mask-image-enabled .MessageList{-webkit-mask-image:linear-gradient(to top, transparent 0, #000 0.5rem);mask-image:linear-gradient(to top, transparent 0, #000 0.5rem)}@media(pointer: coarse){.MessageList{-webkit-user-select:none;user-select:none;touch-callout:none}.MessageList.select-mode-active{-webkit-user-select:auto;user-select:auto;touch-callout:default}}.MessageList.no-avatars .Message>.Avatar{display:none}.MessageList .messages-container{width:100%;max-width:var(--messages-container-width);min-height:100%;margin:0 auto;display:flex;justify-content:flex-end;flex-direction:column;padding:1rem 1rem 0 1.125rem}.force-messages-scroll .MessageList .messages-container{margin-top:100vh !important}@media(max-width: 600px){.MessageList .messages-container{width:100vw;padding:2.75rem .5rem 0;margin:0}}.MessageList.no-composer{margin-bottom:0}.MessageList.no-composer .last-in-list{margin-bottom:1rem}.MessageList.select-mode-active,.MessageList.type-pinned{margin-bottom:0}.MessageList.select-mode-active .last-in-list,.MessageList.type-pinned .last-in-list{margin-bottom:5.625rem}@media(max-width: 600px){.MessageList.select-mode-active .last-in-list,.MessageList.type-pinned .last-in-list{margin-bottom:4.25rem}}.MessageList.select-mode-active .last-in-list.ActionMessage,.MessageList.type-pinned .last-in-list.ActionMessage{padding-bottom:.125rem}.MessageList .Message,.MessageList .ActionMessage{position:relative;opacity:1;transform:scale(1);transition:opacity .2s ease,transform .2s ease}.MessageList .Message:not(.open),.MessageList .ActionMessage:not(.open){transform:scale(0.8);opacity:0}.MessageList .Message.open.shown,.MessageList .ActionMessage.open.shown{transform:none}.MessageList .Message::before,.MessageList .ActionMessage::before{content:"";position:absolute;top:-0.1875rem;bottom:-0.1875rem;left:-50vw;right:-50vw;background:#000;z-index:-1;opacity:0;transition:opacity var(--select-transition)}body.animation-level-0 .MessageList .Message::before,body.animation-level-0 .MessageList .ActionMessage::before{transition:none !important}.MessageList .Message:not(.last-in-group)::before,.MessageList .ActionMessage:not(.last-in-group)::before{bottom:-0.1875rem}.MessageList .Message:not(.first-in-group)::before,.MessageList .ActionMessage:not(.first-in-group)::before{top:-0.1875rem}.MessageList .Message.focused::before,.MessageList .ActionMessage.focused::before{transition:none !important}.MessageList .Message.focused::before,.MessageList .Message.is-forwarding::before,.MessageList .Message.is-selected::before,.MessageList .Message.has-menu-open::before,.MessageList .ActionMessage.focused::before,.MessageList .ActionMessage.is-forwarding::before,.MessageList .ActionMessage.is-selected::before,.MessageList .ActionMessage.has-menu-open::before{opacity:.1}.MessageList>.empty{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.MessageList>.empty>span{max-width:80%;text-align:left}.MessageList>.empty .text-entity-link{color:inherit !important;text-decoration:underline}.MessageList>.empty .text-entity-link:hover,.MessageList>.empty .text-entity-link:focus{text-decoration:none}.MessageList .sticky-date,.MessageList .local-action-message,.MessageList .ActionMessage,.MessageList .empty{text-align:center}.MessageList .sticky-date>span,.MessageList .local-action-message>span,.MessageList .ActionMessage>span,.MessageList .empty>span{display:inline-block;background:var(--pattern-color);color:#fff;font-size:calc(var(--message-text-size, 1rem) - .0625rem);font-weight:500;line-height:1.75;padding:0 .5rem;border-radius:var(--border-radius-messages);word-break:break-word}body.is-ios .MessageList .sticky-date>span,body.is-macos .MessageList .sticky-date>span,body.is-ios .MessageList .local-action-message>span,body.is-macos .MessageList .local-action-message>span,body.is-ios .MessageList .ActionMessage>span,body.is-macos .MessageList .ActionMessage>span,body.is-ios .MessageList .empty>span,body.is-macos .MessageList .empty>span{font-size:calc(var(--message-text-size, 1rem) - .125rem)}.MessageList .sticky-date>span .emoji-small,.MessageList .local-action-message>span .emoji-small,.MessageList .ActionMessage>span .emoji-small,.MessageList .empty>span .emoji-small{vertical-align:text-bottom;width:calc(1.25 * var(--message-text-size, 1rem));height:calc(1.25 * var(--message-text-size, 1rem));background-size:calc(1.25 * var(--message-text-size, 1rem))}.MessageList .sticky-date{margin-top:1rem;margin-bottom:1rem;z-index:var(--z-sticky-date);pointer-events:none;opacity:1;transition:opacity .3s ease}body:not(.is-scrolling-messages) .MessageList .sticky-date.stuck{opacity:0}body:not(.is-scrolling-messages) .MessageList .sticky-date.stuck span{pointer-events:none}body.animation-level-0 .MessageList .sticky-date{transition:none}.MessageList .sticky-date.interactive{cursor:pointer}.MessageList .sticky-date span{pointer-events:auto}.MessageList.scrolled:not(.is-animating) .sticky-date{position:sticky;top:.625rem}.MessageList.is-animating{overflow:hidden}.MessageList.is-animating .message-select-control{display:none !important}.has-header-tools .MessageList .sticky-date{top:3.75rem}.MessageList .local-action-message,.MessageList .ActionMessage{margin-top:.5rem;margin-bottom:.5rem}.MessageList .ActionMessage .action-link{cursor:pointer}.MessageList .ActionMessage .action-link:hover{text-decoration:underline}.MessageList .sticky-date+.ActionMessage{margin-top:-0.5rem}@media(min-width: 1276px){.MessageList{width:100%;transform:translate3d(0, 0, 0);transition:transform var(--layer-transition)}.MessageList .messages-container{width:calc(100% - var(--right-column-width))}body.animation-level-0 .MessageList{transition:none}#Main.right-column-open .MessageList{transform:translate3d(calc(var(--right-column-width) / -2), 0, 0)}body:not(.animating-right-column) #Main.right-column-open .MessageList.select-mode-active,#Main.right-column-open .MessageList:not(.select-mode-active),body.animating-right-column .MessageList:not(.select-mode-active){width:calc(100% - var(--right-column-width))}body:not(.animating-right-column) #Main.right-column-open .MessageList.select-mode-active .messages-container,#Main.right-column-open .MessageList:not(.select-mode-active) .messages-container,body.animating-right-column .MessageList:not(.select-mode-active) .messages-container{width:100%}}@media(max-width: 600px){.MessageList{transition:transform var(--layer-transition)}body.enable-symbol-menu-transforms .MessageList{transform:translate3d(0, 0, 0)}body.is-symbol-menu-open .MessageList{transform:translate3d(0, calc(-1 * (var(--symbol-menu-height) + var(--symbol-menu-footer-height))), 0)}}.animating>div>.MessageList::-webkit-scrollbar{width:0}@supports(scrollbar-width: none){.animating>div>.MessageList{padding-right:.6875rem;scrollbar-width:none}} +.ScrollDownButton{--base-bottom-pos: 6rem;position:absolute;bottom:var(--base-bottom-pos);right:1rem;opacity:0;transform:translateY(4.5rem);transition:transform .25s cubic-bezier(0.34, 1.56, 0.64, 1),opacity .2s ease;z-index:var(--z-scroll-down-button);pointer-events:none}body.animation-level-0 .ScrollDownButton{transform:none !important;transition:opacity .15s}@media(max-width: 600px){.ScrollDownButton{right:.5rem;bottom:4.5rem}}.ScrollDownButton-inner{display:flex;flex-direction:column;align-items:center}.ScrollDownButton-inner>.Button{box-shadow:0 1px 2px var(--color-default-shadow)}.ScrollDownButton-inner>.Button i{font-size:1.75rem}@media(min-width: 1276px){.ScrollDownButton-inner{transform:translateX(0);transition:transform var(--layer-transition)}body.animation-level-0 .ScrollDownButton-inner{transition:none !important}#Main.right-column-open .ScrollDownButton-inner{transform:translateX(calc(-1 * var(--right-column-width)))}}@media(max-width: 600px){.ScrollDownButton-inner>.Button{width:2.875rem;height:2.875rem}}.ScrollDownButton.revealed{transform:translateY(0);opacity:1;pointer-events:all}.ScrollDownButton.revealed.no-composer:not(.with-extra-shift){transform:translateY(4rem)}.ScrollDownButton .unread-count{min-width:1.5rem;height:1.5rem;padding:0 .45rem;border-radius:.75rem;font-size:.875rem;line-height:1.5rem;font-weight:500;text-align:center;position:absolute;top:-0.3rem;right:-0.3rem;background:var(--color-green);color:#fff;pointer-events:none}@media(max-width: 600px){.ScrollDownButton .unread-count{top:-0.7rem;right:auto}}@media(max-width: 600px){body.is-symbol-menu-open .ScrollDownButton{bottom:calc(var(--base-bottom-pos) + var(--symbol-menu-height) + var(--symbol-menu-footer-height))}} .BotKeyboardMenu .bubble{width:100% !important;max-width:27rem;border-radius:var(--border-radius-default-small)}.BotKeyboardMenu .content{display:flex;flex-direction:column;padding:.1875rem .625rem;max-height:80vh;overflow:auto}@media(max-width: 600px){.BotKeyboardMenu .content{max-height:75vh}}.BotKeyboardMenu .content .row{display:flex;flex-direction:row}.BotKeyboardMenu .content .row+.row{margin-top:.375rem}.BotKeyboardMenu .content .Button{flex:1;width:auto;height:auto;min-height:3.0625rem;border-radius:var(--border-radius-messages-small);border:2px solid var(--color-primary);background:var(--color-background);color:var(--color-primary);font-weight:500;text-transform:none}.BotKeyboardMenu .content .Button:hover{color:#fff;border-color:var(--color-primary-shade);background:var(--color-primary-shade)}.BotKeyboardMenu .content .Button+.Button{margin-left:.375rem} .ComposerEmbeddedMessage{height:2.625rem;transition:height 150ms ease-out,opacity 150ms ease-out}.select-mode-active+.middle-column-footer .ComposerEmbeddedMessage{display:none}.ComposerEmbeddedMessage:not(.open){height:0 !important}body.animation-level-0 .ComposerEmbeddedMessage{transition:none !important}.ComposerEmbeddedMessage>div{display:flex;align-items:center;padding-right:.625rem;padding-top:.1875rem}.ComposerEmbeddedMessage>div>.Button{flex-shrink:0;background:none !important;width:3.5rem;height:2.875rem;margin:0 -0.0625rem 0 0;padding:0;align-self:center}@media(max-width: 600px){.ComposerEmbeddedMessage>div>.Button{width:2.875rem}} .WebPagePreview{height:2.625rem;transition:height 150ms ease-out,opacity 150ms ease-out;--accent-color: var(--color-primary)}body.animation-level-0 .WebPagePreview{transition:none !important}.select-mode-active+.middle-column-footer .WebPagePreview{display:none}.WebPagePreview:not(.open){height:0 !important}.WebPagePreview>div{display:flex;align-items:center;padding-right:.625rem;padding-top:.1875rem}.ComposerEmbeddedMessage+.WebPagePreview{margin-top:.75rem}.WebPagePreview>div>.Button{flex-shrink:0;background:none !important;width:3.5rem;height:2.875rem;margin:0 -0.0625rem 0 0;padding:0;align-self:center}@media(max-width: 600px){.WebPagePreview>div>.Button{width:2.875rem}}.WebPagePreview .WebPage{flex-grow:1;margin:.1875rem 0 .1875rem .125rem;max-width:calc(100% - 3.375rem)}.WebPagePreview .WebPage::before{top:.1rem;bottom:.05rem}.WebPagePreview .WebPage.with-video .media-inner{display:none}.WebPagePreview .WebPage .site-title,.WebPagePreview .WebPage .site-description{flex:1;max-width:100%;max-height:1rem}.WebPagePreview .WebPage .site-title{margin-top:.125rem;margin-bottom:.1875rem}.WebPagePreview .WebPage .site-description{overflow:hidden;white-space:nowrap;text-overflow:ellipsis} .Composer{align-items:flex-end}.select-mode-active+.middle-column-footer .Composer{position:absolute;padding-right:2rem;bottom:0}@media(max-width: 600px){.select-mode-active+.middle-column-footer .Composer{padding-right:1rem}}.select-mode-active+.middle-column-footer .Composer::before{right:2.125rem}@media(max-width: 600px){.select-mode-active+.middle-column-footer .Composer::before{right:1rem}}.select-mode-active+.middle-column-footer .Composer .svg-appendix{opacity:0}.Composer .form-control{--border-width: 0}.Composer>.Button{flex-shrink:0;margin-left:.5rem}@media(max-width: 600px){.Composer>.Button{width:2.875rem;height:2.875rem}}.Composer>.Button .icon-send,.Composer>.Button .icon-microphone-alt,.Composer>.Button .icon-check{position:absolute}.Composer>.Button:not(:active):not(:focus):not(:hover) .icon-send,.Composer>.Button:not(:active):not(:focus):not(:hover) .icon-check{color:var(--color-primary)}.Composer>.Button.cancel{position:relative;z-index:1}.Composer>.Button.cancel:hover,.Composer>.Button.cancel.active{background:var(--color-chat-hover)}.Composer>.Button.recording{position:relative;z-index:0;transition:box-shadow .1s}.Composer>.Button.send .icon-send{animation:grow-icon .4s ease-out}.Composer>.Button.send .icon-microphone-alt,.Composer>.Button.send .icon-check{animation:hide-icon .4s forwards ease-out}.Composer>.Button.record .icon-microphone-alt{animation:grow-icon .4s ease-out}.Composer>.Button.record .icon-send,.Composer>.Button.record .icon-check{animation:hide-icon .4s forwards ease-out}.Composer>.Button.edit .icon-send,.Composer>.Button.edit .icon-microphone-alt{animation:hide-icon .4s forwards ease-out}.Composer>.Button.edit .icon-check{animation:grow-icon .4s ease-out}.Composer>.Button.not-ready>i{animation-duration:0ms !important}body.animation-level-0 .Composer>.Button .icon-send,body.animation-level-0 .Composer>.Button .icon-microphone-alt,body.animation-level-0 .Composer>.Button .icon-check,body.animation-level-1 .Composer>.Button .icon-send,body.animation-level-1 .Composer>.Button .icon-microphone-alt,body.animation-level-1 .Composer>.Button .icon-check{animation-duration:0ms !important}.Composer .mobile-symbol-menu-button{width:2.875rem;height:2.875rem;position:relative}.Composer .mobile-symbol-menu-button .icon-smile,.Composer .mobile-symbol-menu-button .icon-keyboard,.Composer .mobile-symbol-menu-button .Spinner{position:absolute}.Composer .mobile-symbol-menu-button .Spinner{--spinner-size: 1.5rem}.Composer .mobile-symbol-menu-button .icon-smile{animation:grow-icon .4s ease-out}.Composer .mobile-symbol-menu-button .icon-keyboard,.Composer .mobile-symbol-menu-button .Spinner{animation:hide-icon .4s forwards ease-out}.Composer .mobile-symbol-menu-button.not-ready>i{animation-duration:0ms !important}.Composer .mobile-symbol-menu-button.is-loading .Spinner{animation:grow-icon .4s ease-out}.Composer .mobile-symbol-menu-button.is-loading .icon-keyboard,.Composer .mobile-symbol-menu-button.is-loading .icon-smile{animation:hide-icon .4s forwards ease-out}.Composer .mobile-symbol-menu-button.menu-opened .icon-keyboard{animation:grow-icon .4s ease-out}.Composer .mobile-symbol-menu-button.menu-opened .icon-smile,.Composer .mobile-symbol-menu-button.menu-opened .Spinner{animation:hide-icon .4s forwards ease-out}#message-compose{flex-grow:1;max-width:calc(100% - 4rem);background:var(--color-background);border-radius:var(--border-radius-messages);border-bottom-right-radius:0;box-shadow:0 1px 2px var(--color-default-shadow);position:relative;z-index:1}#message-compose .svg-appendix{position:absolute;bottom:-0.1875rem;right:-0.551rem;width:.5625rem;height:1.25rem;transition:opacity 200ms;font-size:1rem !important}#message-compose .svg-appendix .corner{fill:var(--color-background)}@media(max-width: 600px){#message-compose{max-width:calc(100% - 3rem)}}.message-input-wrapper{display:flex}.message-input-wrapper>.Spinner{align-self:center;--spinner-size: 1.5rem;margin-right:-0.5rem}.message-input-wrapper>.Button{flex-shrink:0;background:none !important;width:3.5rem;height:3.5rem;margin:0;padding:0;align-self:flex-end}.message-input-wrapper>.Button+.Button{margin-left:-1rem}@media(max-width: 600px){.message-input-wrapper>.Button{width:2.875rem;height:2.875rem}.message-input-wrapper>.Button+.Button{margin-left:-0.6875rem}}.message-input-wrapper>.Button.bot-commands{color:var(--color-primary) !important}body.is-touch-env .message-input-wrapper>.Button.bot-commands.activated+.Button.mobile-symbol-menu-button{z-index:calc(var(--z-menu-backdrop) + 1)}.message-input-wrapper>.Button.scheduled-button i::after{content:"";position:absolute;top:.75rem;right:.75rem;border:.1875rem solid var(--color-background);box-sizing:content-box;width:.5rem;height:.5rem;border-radius:50%;background:var(--color-green-darker);box-shadow:-0.375rem -0.25rem 0 -0.1875rem var(--color-background)}@media(max-width: 600px){.message-input-wrapper>.Button.scheduled-button i::after{top:.5rem;right:.5rem}}.message-input-wrapper>.input-group{flex-grow:1;margin-bottom:0}.message-input-wrapper .recording-state{display:inline-block;position:relative;line-height:3.5rem;height:3.5rem;padding:0 3.125rem 0 1rem}.message-input-wrapper .recording-state::after{content:"";width:10px;height:10px;background:var(--color-error);border-radius:5px;position:absolute;top:50%;margin-top:-5px;right:1.375rem}@media(max-width: 600px){.message-input-wrapper .recording-state{height:2.875rem;line-height:2.875rem}}#message-input-text,#caption-input-text{position:relative}#message-input-text .form-control,#caption-input-text .form-control{padding:calc((3.25rem - var(--composer-text-size, 1rem) * 1.375) / 2 - var(--border-width, 0) * 2) calc(.9rem - var(--border-width));overflow:hidden;line-height:1.375;font-family:Roboto,-apple-system,"Apple Color Emoji","Helvetica Neue",sans-serif;unicode-bidi:plaintext;text-align:initial;font-size:var(--composer-text-size, 1rem)}body.is-ios #message-input-text .form-control,body.is-macos #message-input-text .form-control,body.is-ios #caption-input-text .form-control,body.is-macos #caption-input-text .form-control{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Roboto","Apple Color Emoji","Helvetica Neue",sans-serif}#message-input-text .form-control.overflown,#caption-input-text .form-control.overflown{overflow-y:auto;overflow-x:hidden}#message-input-text .form-control.touched+.placeholder-text,#message-input-text .form-control:focus+.placeholder-text,#caption-input-text .form-control.touched+.placeholder-text,#caption-input-text .form-control:focus+.placeholder-text{display:none}#message-input-text .form-control.focus-disabled,#caption-input-text .form-control.focus-disabled{pointer-events:none}#message-input-text .forced-placeholder,#message-input-text .placeholder-text,#caption-input-text .forced-placeholder,#caption-input-text .placeholder-text{position:absolute;color:var(--color-placeholders);pointer-events:none;unicode-bidi:plaintext;text-align:initial;line-height:1.3125;font-size:var(--composer-text-size, 1rem);top:calc((3.25rem - var(--composer-text-size, 1rem) * 1.375) / 2);bottom:auto}#message-input-text .forced-placeholder,#caption-input-text .forced-placeholder{z-index:var(--z-below);left:0;white-space:nowrap;overflow:hidden;max-width:100%;text-overflow:ellipsis}#message-input-text[dir=rtl] .placeholder-text,#caption-input-text[dir=rtl] .placeholder-text{right:0}#message-input-text .text-entity-link,#caption-input-text .text-entity-link{color:var(--color-links) !important;cursor:default;text-decoration:none}#message-input-text .text-entity-link:hover,#message-input-text .text-entity-link:active,#message-input-text .text-entity-link:visited,#caption-input-text .text-entity-link:hover,#caption-input-text .text-entity-link:active,#caption-input-text .text-entity-link:visited{color:var(--color-links-hover) !important}#message-input-text .clone,#caption-input-text .clone{position:absolute;top:0;left:0;opacity:0;pointer-events:none;z-index:-10;unicode-bidi:plaintext;text-align:initial}#message-input-text{flex-grow:1}#message-input-text .form-control{margin-bottom:0;background:transparent !important;border:none !important;border-radius:0 !important;box-shadow:none !important;caret-color:var(--color-text);min-height:3.5rem;max-height:26rem;line-height:1.3125;padding:calc((3.5rem - var(--composer-text-size, 1rem) * 1.3125) / 2) 0;transition:height 100ms ease}@media(max-width: 600px){#message-input-text .form-control{height:2.875rem;min-height:2.875rem;max-height:16rem;padding:calc((2.875rem - var(--composer-text-size, 1rem) * 1.3125) / 2) 0;overflow:auto}}body.animation-level-0 #message-input-text .form-control{transition:none !important}#message-input-text .forced-placeholder,#message-input-text .placeholder-text{top:calc((3.5rem - var(--composer-text-size, 1rem) * 1.3125) / 2)}@media(max-width: 600px){#message-input-text .forced-placeholder,#message-input-text .placeholder-text{top:calc((2.875rem - var(--composer-text-size, 1rem) * 1.3125) / 2)}}#message-input-text:not(:only-child) .form-control{padding-left:0;padding-right:0}.ComposerEmbeddedMessage+.message-input-wrapper #message-input-text .form-control.overflown,.WebPagePreview+.message-input-wrapper #message-input-text .form-control.overflown{margin-top:.75rem}#message-input-text .emoji{width:1.25rem;height:1.25rem;margin:0 1px -5px;vertical-align:0;pointer-events:none}#caption-input-text .form-control{height:3.25rem;min-height:3.25rem;max-height:15rem}#caption-input-text .placeholder-text{bottom:.8125rem;left:.90625rem}.composer-tooltip{position:absolute;bottom:calc(100% + .5rem);left:0;width:100%;background:var(--color-background);border-radius:var(--border-radius-messages);padding:.5rem 0;max-height:15rem;overflow-x:hidden;overflow-y:auto;box-shadow:0 1px 2px var(--color-default-shadow);opacity:0;transform:translateY(1.5rem);transform-origin:bottom;transition:opacity var(--layer-transition),transform var(--layer-transition)}@supports(overflow-y: overlay){.composer-tooltip{overflow-y:overlay;overflow-x:hidden}}.composer-tooltip:not(.shown){display:none}.composer-tooltip.open{opacity:1;transform:translateY(0)}.composer-tooltip .Loading{margin:1rem 0} -#middle-column-bg{position:absolute;top:0;left:0;bottom:0;right:0;overflow:hidden;z-index:-1}#middle-column-bg::before,#middle-column-bg::after{content:"";display:block;position:absolute;top:0;left:0;bottom:0;right:0;background-color:var(--theme-background-color)}#middle-column-bg::after{background-position:center;background-repeat:no-repeat;background-size:cover}.theme-light #middle-column-bg::after{background-image:url(chat-bg.f607e788298d8a7de37a..jpg)}@media(max-width: 600px){.theme-light #middle-column-bg::after{background-image:url(chat-bg-mobile.3ebe59c803c10092f223..jpg)}}body:not(.animation-level-0) #root #middle-column-bg::after{transition:transform var(--layer-transition),opacity .2s !important}body.animation-level-0 #middle-column-bg::after{transition:none}.custom-bg-color:not(.custom-bg-image)>#middle-column-bg::after{opacity:0}.custom-bg-image>#middle-column-bg::after{background-image:var(--custom-background) !important;filter:none;transform:scale(1.1)}.custom-bg-image.blurred>#middle-column-bg::after{filter:blur(12px)}@media screen and (min-width: 1276px){body.animation-level-2 #middle-column-bg::after{margin:-16rem -5rem -20rem 0;overflow:hidden;transform:scale(1);transform-origin:left center;transition:transform var(--layer-transition)}body.animation-level-2 #Main.right-column-open #middle-column-bg::after{transform:scale(0.67) !important}}#MiddleColumn{display:flex;justify-content:center;height:100%;position:relative;z-index:1}@media(max-width: 600px){#MiddleColumn{overflow:hidden}}#MiddleColumn .messages-layout{--slide-transition: 450ms cubic-bezier(0.25, 1, 0.5, 1);display:flex;flex-direction:column;align-items:center;width:100%;height:100%;position:relative;overflow:hidden}#MiddleColumn .messages-layout>.Transition{width:100%;height:100%;overflow:hidden}#MiddleColumn .messages-layout>.Transition>div{display:flex;flex-direction:column;align-items:center}#MiddleColumn .messaging-disabled-inner{width:100%;padding:1rem;border-radius:var(--border-radius-messages);background:var(--color-background);color:var(--color-text-secondary);text-align:center;box-shadow:0 1px 2px var(--color-default-shadow)}#MiddleColumn .Composer #message-compose{transform:scaleX(1) translateX(0);transition:transform var(--select-transition),border-bottom-right-radius var(--select-transition)}#MiddleColumn .Composer #message-compose::before{transform:scaleX(-1) translateX(0);transition:transform var(--select-transition)}body.animation-level-0 #MiddleColumn .Composer #message-compose,body.animation-level-0 #MiddleColumn .Composer #message-compose::before{transition:none !important}#MiddleColumn .Composer .message-input-wrapper,#MiddleColumn .Composer::before{opacity:1;transition:opacity var(--select-transition)}body.animation-level-0 #MiddleColumn .Composer .message-input-wrapper,body.animation-level-0 #MiddleColumn .Composer::before{transition:none !important}#MiddleColumn .Composer>.Button{opacity:1;transform:scale(1);transition:opacity var(--select-transition),transform var(--select-transition)}body.animation-level-0 #MiddleColumn .Composer>.Button{transition:none !important}#MiddleColumn .Composer.hover-disabled,#MiddleColumn .Composer:not(.shown){pointer-events:none}#MiddleColumn .Composer:not(.shown) .ComposerEmbeddedMessage{height:0}#MiddleColumn .Composer:not(.shown) #message-compose{transform:scaleX(var(--composer-hidden-scale, 1)) translateX(var(--composer-translate-x, 0));border-bottom-right-radius:var(--border-radius-messages)}#MiddleColumn .Composer:not(.shown) #message-compose::before{transform:scaleX(-1) translateX(200%)}#MiddleColumn .Composer:not(.shown) #editable-message-text{height:3.5rem !important}@media(max-width: 600px){#MiddleColumn .Composer:not(.shown) #editable-message-text{height:2.5rem !important}}#MiddleColumn .Composer:not(.shown) .message-input-wrapper,#MiddleColumn .Composer:not(.shown)::before{opacity:0}#MiddleColumn .Composer:not(.shown)>.Button{opacity:0 !important;transform:scale(0.5)}#MiddleColumn .messaging-disabled{transform:scaleX(1);transition:transform var(--select-transition)}#MiddleColumn .messaging-disabled .messaging-disabled-inner span{opacity:1;transition:opacity var(--select-transition)}body.animation-level-0 #MiddleColumn .messaging-disabled .messaging-disabled-inner span{transition:none !important}body.animation-level-0 #MiddleColumn .messaging-disabled{transition:none !important}#MiddleColumn .messaging-disabled:not(.shown){transform:scaleX(var(--composer-hidden-scale, 1));pointer-events:none}#MiddleColumn .messaging-disabled:not(.shown) .messaging-disabled-inner span{opacity:0}#MiddleColumn .middle-column-footer{width:100%;max-width:var(--messages-container-width);padding:0 1rem;position:relative;display:flex;align-items:flex-end;z-index:var(--z-middle-footer);transform:translate3d(0, 0, 0);transition:transform var(--layer-transition)}body.animation-level-0 #MiddleColumn .middle-column-footer{transition:none !important}@media(min-width: 1276px){#MiddleColumn .middle-column-footer{width:calc(100% - var(--right-column-width))}#Main.right-column-open #MiddleColumn .middle-column-footer{transform:translate3d(calc(var(--right-column-width) / -2), 0, 0)}}@media(max-width: 600px){#MiddleColumn .middle-column-footer{padding:0 .5rem}body.is-symbol-menu-open #MiddleColumn .middle-column-footer{transform:translate3d(0, calc(-1 * (var(--symbol-menu-height) + var(--symbol-menu-footer-height))), 0)}}#MiddleColumn .middle-column-footer::before{content:"";position:absolute;top:-0.5625rem;left:0;right:0;height:1px;background:linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 2%, rgba(255, 255, 255, 0.4) 98%, rgba(255, 255, 255, 0) 100%);opacity:0;transition:opacity 350ms ease}@media(max-width: 600px){#MiddleColumn .middle-column-footer::before{left:-2%;right:-2%}}#MiddleColumn .middle-column-footer.with-notch::before{opacity:1}html.theme-dark #MiddleColumn .middle-column-footer::before{background:linear-gradient(90deg, rgba(127, 127, 127, 0) 0%, rgba(127, 127, 127, 0.4) 2%, rgba(127, 127, 127, 0.4) 98%, rgba(127, 127, 127, 0) 100%)}.Composer,.MessageSelectToolbar,.messaging-disabled{margin-bottom:1.25rem}@media(max-width: 600px){.Composer,.MessageSelectToolbar,.messaging-disabled{margin-bottom:.5rem}}.Composer,.MessageSelectToolbar,.unpin-all-button,.messaging-disabled{width:100%;display:flex;justify-content:center;position:relative}.mask-image-disabled .MessageSelectToolbar-inner,.mask-image-disabled .unpin-all-button,.mask-image-disabled .messaging-disabled{box-shadow:0 .25rem .5rem .125rem var(--color-default-shadow)}.unpin-button-container{width:100%;display:flex;justify-content:center;position:absolute;padding-bottom:1.25rem}.unpin-button-container .unpin-all-button{text-transform:capitalize;color:var(--color-black);height:3.5rem;overflow:visible;transform:scaleX(1);transition:transform var(--select-transition),background-color .15s,color .15s}.unpin-button-container .unpin-all-button:hover .icon-unpin{color:var(--color-white)}.select-mode-active+.middle-column-footer .unpin-button-container .unpin-all-button{box-shadow:none;transform:scaleX(var(--unpin-hidden-scale))}@media(max-width: 600px){.unpin-button-container .unpin-all-button{height:2.5rem}}.unpin-button-container .unpin-all-button .icon-unpin{margin-inline-start:-0.4375rem;margin-inline-end:.75rem;color:var(--color-text-secondary);font-size:1.5rem;transition:color .15s}@media(max-width: 600px){.unpin-button-container{padding-bottom:.75rem}}.mask-image-disabled .unpin-button-container::before{background:unset} +#middle-column-bg{position:absolute;top:0;left:0;bottom:0;right:0;overflow:hidden;z-index:-1}#middle-column-bg::before,#middle-column-bg::after{content:"";display:block;position:absolute;top:0;left:0;bottom:0;right:0;background-color:var(--theme-background-color)}#middle-column-bg::after{background-position:center;background-repeat:no-repeat;background-size:cover}.theme-light #middle-column-bg::after{background-image:url(chat-bg.f607e788298d8a7de37a..jpg)}@media(max-width: 600px){.theme-light #middle-column-bg::after{background-image:url(chat-bg-mobile.3ebe59c803c10092f223..jpg)}}body:not(.animation-level-0) #root #middle-column-bg::after{transition:transform var(--layer-transition),opacity .2s !important}body.animation-level-0 #middle-column-bg::after{transition:none}.custom-bg-color:not(.custom-bg-image)>#middle-column-bg::after{opacity:0}.custom-bg-image>#middle-column-bg::after{background-image:var(--custom-background) !important;filter:none;transform:scale(1.1)}.custom-bg-image.blurred>#middle-column-bg::after{filter:blur(12px)}@media screen and (min-width: 1276px){body.animation-level-2 #middle-column-bg::after{margin:-16rem -5rem -20rem 0;overflow:hidden;transform:scale(1);transform-origin:left center;transition:transform var(--layer-transition)}body.animation-level-2 #Main.right-column-open #middle-column-bg::after{transform:scale(0.67) !important}}#MiddleColumn{display:flex;justify-content:center;height:100%;position:relative;z-index:1}@media(max-width: 600px){#MiddleColumn{overflow:hidden}}#MiddleColumn .messages-layout{--slide-transition: 450ms cubic-bezier(0.25, 1, 0.5, 1);display:flex;flex-direction:column;align-items:center;width:100%;height:100%;position:relative;overflow:hidden}#MiddleColumn .messages-layout>.Transition{width:100%;height:100%;overflow:hidden}#MiddleColumn .messages-layout>.Transition>div{display:flex;flex-direction:column;align-items:center}#MiddleColumn .messaging-disabled-inner{width:100%;padding:1rem;border-radius:var(--border-radius-messages);background:var(--color-background);color:var(--color-text-secondary);text-align:center;box-shadow:0 1px 2px var(--color-default-shadow)}#MiddleColumn .Composer #message-compose{transform:scaleX(1) translateX(0);transition:transform var(--select-transition),border-bottom-right-radius var(--select-transition)}#MiddleColumn .Composer #message-compose::before{transform:scaleX(-1) translateX(0);transition:transform var(--select-transition)}body.animation-level-0 #MiddleColumn .Composer #message-compose,body.animation-level-0 #MiddleColumn .Composer #message-compose::before{transition:none !important}#MiddleColumn .Composer .message-input-wrapper,#MiddleColumn .Composer::before{opacity:1;transition:opacity var(--select-transition)}body.animation-level-0 #MiddleColumn .Composer .message-input-wrapper,body.animation-level-0 #MiddleColumn .Composer::before{transition:none !important}#MiddleColumn .Composer>.Button{opacity:1;transform:scale(1);transition:opacity var(--select-transition),transform var(--select-transition)}body.animation-level-0 #MiddleColumn .Composer>.Button{transition:none !important}#MiddleColumn .Composer.hover-disabled,#MiddleColumn .Composer:not(.shown){pointer-events:none}#MiddleColumn .Composer:not(.shown) .ComposerEmbeddedMessage{height:0}#MiddleColumn .Composer:not(.shown) #message-compose{transform:scaleX(var(--composer-hidden-scale, 1)) translateX(var(--composer-translate-x, 0));border-bottom-right-radius:var(--border-radius-messages)}#MiddleColumn .Composer:not(.shown) #message-compose::before{transform:scaleX(-1) translateX(200%)}#MiddleColumn .Composer:not(.shown) #editable-message-text{height:3.5rem !important}@media(max-width: 600px){#MiddleColumn .Composer:not(.shown) #editable-message-text{height:2.5rem !important}}#MiddleColumn .Composer:not(.shown) .message-input-wrapper,#MiddleColumn .Composer:not(.shown)::before{opacity:0}#MiddleColumn .Composer:not(.shown)>.Button{opacity:0 !important;transform:scale(0.5)}#MiddleColumn .messaging-disabled{transform:scaleX(1);transition:transform var(--select-transition)}#MiddleColumn .messaging-disabled .messaging-disabled-inner span{opacity:1;transition:opacity var(--select-transition)}body.animation-level-0 #MiddleColumn .messaging-disabled .messaging-disabled-inner span{transition:none !important}body.animation-level-0 #MiddleColumn .messaging-disabled{transition:none !important}#MiddleColumn .messaging-disabled:not(.shown){transform:scaleX(var(--composer-hidden-scale, 1));pointer-events:none}#MiddleColumn .messaging-disabled:not(.shown) .messaging-disabled-inner span{opacity:0}#MiddleColumn .middle-column-footer{width:100%;max-width:var(--messages-container-width);padding:0 1rem;position:relative;display:flex;align-items:flex-end;z-index:var(--z-middle-footer);transform:translate3d(0, 0, 0);transition:transform var(--layer-transition)}body.animation-level-0 #MiddleColumn .middle-column-footer{transition:none !important}@media(min-width: 1276px){#MiddleColumn .middle-column-footer{width:calc(100% - var(--right-column-width))}#Main.right-column-open #MiddleColumn .middle-column-footer{transform:translate3d(calc(var(--right-column-width) / -2), 0, 0)}}@media(max-width: 600px){#MiddleColumn .middle-column-footer{padding:0 .5rem}body.is-symbol-menu-open #MiddleColumn .middle-column-footer{transform:translate3d(0, calc(-1 * (var(--symbol-menu-height) + var(--symbol-menu-footer-height))), 0)}}#MiddleColumn .middle-column-footer::before{content:"";position:absolute;top:-0.5625rem;left:0;right:0;height:1px;background:linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 2%, rgba(255, 255, 255, 0.4) 98%, rgba(255, 255, 255, 0) 100%);opacity:0;transition:opacity 350ms ease}@media(max-width: 600px){#MiddleColumn .middle-column-footer::before{left:-2%;right:-2%}}#MiddleColumn .middle-column-footer.with-notch::before{opacity:1}html.theme-dark #MiddleColumn .middle-column-footer::before{background:linear-gradient(90deg, rgba(127, 127, 127, 0) 0%, rgba(127, 127, 127, 0.4) 2%, rgba(127, 127, 127, 0.4) 98%, rgba(127, 127, 127, 0) 100%)}.Composer,.MessageSelectToolbar,.messaging-disabled{margin-bottom:1.25rem}@media(max-width: 600px){.Composer,.MessageSelectToolbar,.messaging-disabled{margin-bottom:.5rem}}.Composer,.MessageSelectToolbar,.unpin-all-button,.messaging-disabled{width:100%;display:flex;justify-content:center;position:relative}.mask-image-disabled .MessageSelectToolbar-inner,.mask-image-disabled .unpin-all-button,.mask-image-disabled .messaging-disabled{box-shadow:0 .25rem .5rem .125rem var(--color-default-shadow);border-radius:var(--border-radius-messages)}.unpin-button-container{width:100%;display:flex;justify-content:center;position:absolute;padding-bottom:1.25rem}.unpin-button-container .unpin-all-button{text-transform:capitalize;color:var(--color-black);height:3.5rem;overflow:visible;transform:scaleX(1);transition:transform var(--select-transition),background-color .15s,color .15s}.unpin-button-container .unpin-all-button:hover .icon-unpin{color:var(--color-white)}.select-mode-active+.middle-column-footer .unpin-button-container .unpin-all-button{box-shadow:none;transform:scaleX(var(--unpin-hidden-scale))}@media(max-width: 600px){.unpin-button-container .unpin-all-button{height:2.5rem}}.unpin-button-container .unpin-all-button .icon-unpin{margin-inline-start:-0.4375rem;margin-inline-end:.75rem;color:var(--color-text-secondary);font-size:1.5rem;transition:color .15s}@media(max-width: 600px){.unpin-button-container{padding-bottom:.75rem}}.mask-image-disabled .unpin-button-container::before{background:unset} .RightHeader{display:flex;align-items:center;height:var(--header-height);padding:.5rem .8125rem;pointer-events:auto}@media(max-width: 600px){.RightHeader{padding:.5rem}}.RightHeader .close-button{flex-shrink:0}.RightHeader>.Transition{flex:1;height:100%}.RightHeader>.Transition>div{display:flex;align-items:center}.RightHeader h3{margin-bottom:0;font-size:1.25rem;font-weight:500;margin-left:1.375rem}.RightHeader .tools{display:flex;margin-left:auto}.RightHeader .SearchInput{margin-left:1rem}@media(min-width: 600px){.RightHeader .SearchInput{margin-right:1rem}}.RightHeader .DropdownMenu{margin-left:auto} .Profile{height:100%;display:flex;flex-direction:column;overflow-x:hidden;overflow-y:scroll}@supports(overflow-y: overlay){.Profile{overflow-y:overlay;overflow-x:hidden}}.Profile>.profile-info>.ChatInfo{grid-area:chat_info}.Profile>.profile-info>.ChatInfo .status.online{color:var(--color-primary)}.Profile>.profile-info>.ChatExtra{padding:.875rem .5rem .5rem;box-shadow:inset 0 -0.0625rem 0 0 var(--color-background-secondary-accent);border-bottom:.625rem solid var(--color-background-secondary)}.Profile>.profile-info>.ChatExtra .narrow{margin-bottom:0}.Profile>.profile-info>.ChatExtra .inactive.no-selection{user-select:auto;-webkit-user-select:auto !important}.Profile>.profile-info>.ChatExtra .Switcher{margin-left:auto}.Profile>.profile-info>.ChatExtra [dir=rtl] .Switcher{margin-left:0;margin-right:auto}.Profile .FloatingActionButton{z-index:1}.shared-media{display:flex;flex-direction:column-reverse}.shared-media .TabList{background:var(--color-background);top:-1px;z-index:1}.shared-media .TabList .Tab{padding:1rem .25rem}.shared-media .TabList .Tab i{bottom:-1rem}.shared-media .Transition{flex:1}.shared-media .content.empty-list{height:100%;padding-top:5rem;display:flex;align-items:flex-start;justify-content:center}.shared-media .content.empty-list .Spinner{--spinner-size: 2.75rem}.shared-media .content.media-list{display:grid;grid-template-columns:repeat(3, 1fr);grid-auto-rows:1fr;grid-gap:.0625rem}.shared-media .content.documents-list{padding:1.25rem}.shared-media .content.documents-list .File+.File{margin-top:1.25rem}.shared-media .content.links-list{padding:1.25rem}.shared-media .content.links-list .ProgressSpinner,.shared-media .content.links-list .message-upload-progress{display:none}.shared-media .content.audio-list{padding:1.25rem}.shared-media .content.audio-list .Audio .media-loading{top:0;left:0;display:flex;align-items:center;justify-content:center}.shared-media .content.audio-list .Audio+.Audio{margin-top:1.6875rem}.shared-media .content.members-list{padding:.5rem 1rem}@media(max-width: 600px){.shared-media .content.members-list{padding:.5rem 0}.shared-media .content.members-list .ListItem.chat-item-clickable{margin:0}} .AddChatMembers{height:100%;overflow:hidden;position:relative}.AddChatMembers-inner{height:100%;overflow:hidden} #RightColumn{position:absolute;top:0;right:0;width:var(--right-column-width);height:100%;transform:translate3d(var(--right-column-width), 0, 0);background:var(--color-background);border-left:1px solid var(--color-borders);z-index:var(--z-right-column);transition:transform var(--layer-transition)}body.animation-level-0 #RightColumn{transition:none}#RightColumn:not(:hover) .chat-item-clickable:not(.picker-list-item):nth-child(n+18){display:none !important}@media(max-width: 1275px){#RightColumn{box-shadow:0 .25rem .5rem .125rem var(--color-default-shadow);border-left:none}}@media(max-width: 600px){#RightColumn{width:100vw;transform:translate3d(110vw, 0, 0)}}#RightColumn>.Transition{height:calc(100% - var(--header-height));overflow:hidden}#RightColumn .Management .section>.ChatInfo{padding:0 1.5rem;margin:1rem 0;text-align:center}#RightColumn .Management .section>.ChatInfo .Avatar{margin:0 auto .5rem}#RightColumn .Management .section>.ChatInfo .Avatar.no-photo{cursor:default !important}#RightColumn .Management .section>.ChatInfo .title{display:flex;justify-content:center;align-items:center}#RightColumn .Management .section>.ChatInfo .title h3{font-weight:500;font-size:1.25rem;line-height:2rem;white-space:pre-wrap;word-break:break-word}#RightColumn .Management .section>.ChatInfo .title .VerifiedIcon{margin-left:.25rem;margin-bottom:.5rem}#RightColumn .Management .section>.ChatInfo .title .emoji{width:1.5rem;height:1.5rem;background-size:1.5rem}#RightColumn .Management .section>.ChatInfo .status{font-size:.875rem;color:#868e96}#RightColumn-wrapper{position:absolute;top:0;left:0;right:0;bottom:0;z-index:var(--z-right-column);overflow:hidden;visibility:hidden;pointer-events:none}@media(max-width: 1275px){#RightColumn-wrapper{position:fixed}}#RightColumn-wrapper.is-hidden{display:none}#RightColumn-wrapper .overlay-backdrop{position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;background:#000;opacity:0}@media(max-width: 600px){#RightColumn-wrapper .overlay-backdrop{transition:opacity var(--layer-transition)}body.animation-level-0 #RightColumn-wrapper .overlay-backdrop{transition:none}}#Main.right-column-open #RightColumn-wrapper,body.animating-right-column #RightColumn-wrapper{visibility:visible}@media(max-width: 600px){#Main.right-column-open #RightColumn-wrapper .overlay-backdrop{opacity:var(--layer-blackout-opacity)}}#Main.right-column-open #RightColumn-wrapper #RightColumn{pointer-events:auto;transform:translate3d(0, 0, 0)} #Main{display:flex;height:100%;text-align:left;overflow:hidden}@media(min-width: 1276px){#Main{position:relative}}@media(max-width: 600px){#Main{height:calc(var(--vh, 1vh) * 100)}}#LeftColumn{flex:1;min-width:18rem;max-width:26.5rem;height:100%}@media(max-width: 600px){#LeftColumn{height:calc(var(--vh, 1vh) * 100)}}@media(min-width: 1680px){#LeftColumn{border-left:1px solid var(--color-borders)}}@media(max-width: 1275px){#LeftColumn{flex:2}}@media(max-width: 925px){#LeftColumn{position:fixed;left:0;top:0;height:calc(var(--vh, 1vh) * 100);width:26.5rem;transform:translate3d(-5rem, 0, 0);transition:transform var(--layer-transition)}body.animation-level-0 #LeftColumn{transition:none}#LeftColumn::after{content:"";display:block;position:absolute;left:0;top:0;right:0;bottom:0;background:#000;opacity:var(--layer-blackout-opacity);transition:opacity var(--layer-transition);z-index:1}body.animation-level-0 #LeftColumn::after{transition:none}body.is-android #LeftColumn::after{display:none}body.is-android .middle-column-shown #LeftColumn::after{display:block}#Main:not(.middle-column-open) #LeftColumn{transform:translate3d(0, 0, 0)}#Main:not(.middle-column-open) #LeftColumn::after{opacity:0;pointer-events:none}#Main.history-animation-disabled #LeftColumn{transition:none}#Main.history-animation-disabled #LeftColumn:after{transition:none}}@media(max-width: 600px){#LeftColumn{max-width:none;width:100vw;transform:translate3d(-20vw, 0, 0)}}@media(min-width: 1680px){#RightColumn{border-right:1px solid var(--color-borders)}}@media(max-width: 600px){#RightColumn{height:calc(var(--vh, 1vh) * 100 + 1px)}}#Main.history-animation-disabled #RightColumn{transition:none}#Main.history-animation-disabled #RightColumn .overlay-backdrop{transition:none}#Main.history-animation-disabled .overlay-backdrop{transition:none}#MiddleColumn{flex:3;border-left:1px solid var(--color-borders);max-width:75vw}@media(max-width: 1275px){#MiddleColumn{max-width:calc(100vw - 26.5rem)}}@media(max-width: 66.25rem){#MiddleColumn{max-width:60vw}}@media(min-width: 1680px){#MiddleColumn{border-right:1px solid var(--color-borders);max-width:calc(1680px - 26.5rem)}}@media(max-width: 925px){#MiddleColumn{max-width:none;position:fixed;left:0;top:0;bottom:0;right:0;transform:translate3d(0, 0, 0);transition:transform var(--layer-transition)}body.animation-level-0 #MiddleColumn{transition:none}#Main:not(.middle-column-open) #MiddleColumn{transform:translate3d(26.5rem, 0, 0)}}@media(max-width: 600px){#MiddleColumn{border-left:none}#Main:not(.middle-column-open) #MiddleColumn{transform:translate3d(100vw, 0, 0)}#Main.right-column-open #MiddleColumn{transform:translate3d(-20vw, 0, 0)}}#Main.history-animation-disabled #MiddleColumn{transition:none}#Main.history-animation-disabled #MiddleColumn:after{transition:none}body.is-android.animation-level-1{--layer-transition: 250ms ease-in-out}body.is-android.animation-level-1 #LeftColumn,body.is-android.animation-level-1 #MiddleColumn,body.is-android.animation-level-1 #RightColumn{transition:transform var(--layer-transition),opacity var(--layer-transition)}body.is-android.animation-level-1 #Main:not(.middle-column-shown) #MiddleColumn{display:none}body.is-android.animation-level-1 #Main:not(.middle-column-open) #MiddleColumn{transform:translate3d(10vw, 0, 0);opacity:0}body.is-android.animation-level-1 #Main.middle-column-open #LeftColumn{transform:translate3d(0, 0, 0);opacity:0}body.is-android.animation-level-1 #Main:not(.right-column-shown) #RightColumn{display:none}body.is-android.animation-level-1 #Main:not(.right-column-open) #RightColumn{transform:translate3d(10vw, 0, 0);opacity:0}body.is-android.animation-level-1 #Main.right-column-open #MiddleColumn{transform:translate3d(0, 0, 0);opacity:0} -/*# sourceMappingURL=433.29f542772c88e944d938.css.map*/ \ No newline at end of file +/*# sourceMappingURL=433.c66cb5158ff9fdb2297f.css.map*/ \ No newline at end of file diff --git a/dist/433.c66cb5158ff9fdb2297f.css.map b/dist/433.c66cb5158ff9fdb2297f.css.map new file mode 100644 index 00000000..9910977c --- /dev/null +++ b/dist/433.c66cb5158ff9fdb2297f.css.map @@ -0,0 +1 @@ +{"version":3,"file":"433.c66cb5158ff9fdb2297f.css","mappings":"AAEA,gBACE,kBAEA,oCACE,kBAEA,2HACE,eACA,eACA,sBACA,6CACA,0BACA,oBAGF,uFACE,kBACA,OACA,WAGF,4CACE,eAGF,2CACE,aAGF,+CACE,yBAEA,uDACE,qEAGF,sDACE,qEAIJ,iDACE,gBAEA,iHACE,gBAKN,gCACE,iBACA,cACA,iBACA,6BACA,qBACA,iBACA,WACA,kBACA,mBACA,gBACA,kBACA,cAGF,0CACE,cACA,kBAGF,8BACE,gBACA,2CAEA,gBCpEF,+BDgEA,8BC/DE,mBAGA,mBDsEA,qHACE,2B;AEnFN,iBACE,cACA,aACA,mBACA,qBACA,eACA,+BACA,2CAEA,0BACE,wBAGF,6BACE,gCACA,gBACA,iBACA,6BACA,mBAGF,yBACE,6BACE,6B;ACvBN,eACE,kBACA,WACA,YACA,2BAEA,4DAEA,sCACE,0BACA,UAEA,wBAEA,+CACE,UAIJ,wBACE,wBACA,yBAFF,wBAII,kCACA,6BAKF,oCACE,WACA,cACA,kBACA,WACA,YACA,YACA,aACA,WAKF,6CACE,kBACA,YACA,aACA,WACA,cAKF,gFAEE,kBAIA,0DACE,iCAGF,gDACE,0CAKF,0CACE,iCAGF,oDACE,0C;ACzER,iBACE,YACA,kBACA,aACA,sBACA,gBACA,UAEA,2CACE,kBACA,YACA,WAGF,6BACE,OACA,gBACA,gCAEA,uCACE,8BAIJ,8BACE,YACA,aACA,sBACA,gBAEA,gDACE,gBACA,6BAEA,2DACE,SAIJ,uCACE,2BACA,sBACA,mBACA,gBACA,UAGF,mCACE,cACA,qBACA,sBAEA,wCACE,mBACA,oBAIJ,0CACE,OACA,gBAIJ,+FACE,YACA,gBAGF,6BACE,kBACA,YACA,UACA,WACA,c;AC1EJ,YACE,gBAGF,SACE,YAGF,aACE,4BACA,uCACA,aACA,mBACA,cACA,yCAEA,gBACE,gBACA,kBACA,gBACA,qBACA,kBAGF,0BACE,oBACA,gCAEA,yBAJF,0BAKI,iCAIJ,yBAzBF,aA0BI,eAGF,6BACE,aACA,cAEA,2CACE,mB;AC1CN,aACE,aACA,iBACA,oBACA,uBAEA,oCACE,2BAGF,qBACE,cACA,eAGF,0BACE,6CACA,2DACA,0CACA,2CAGF,0CACE,mBAIA,kCACE,WACA,YAEA,oCACE,mBACA,qBAIJ,4BACE,kBACA,oBACA,oBAEA,sCACE,kBAIJ,2EACE,UACA,mBACA,uEAGF,iLAIE,UACA,qBAIJ,qBACE,aACA,uBACA,sBACA,cACA,qBACA,kBACA,gBACA,eACA,gBACA,kDAEA,2BACE,wDAGF,iDAhBF,qBAiBI,iBAGF,yCACE,cACA,gBACA,6BACA,iBACA,YACA,mBACA,gBACA,uBAEA,qDACE,8BACA,qBAIJ,+BACE,4BACA,kCACA,qBACA,gBACA,mBACA,gBACA,uBACA,mBAEA,2CACE,8B;ACrCR,cACE,aACA,mBACA,WACA,+CACA,mCACA,oCACA,kBACA,+BAEA,yBAVF,cAWI,cACA,kBAEA,kCACA,6BAGF,0BACE,WAGA,YAEA,8BACE,aACA,mBACA,WAIJ,2BACE,oBACA,mBACA,kBAEA,yBALF,2BAMI,eAGF,yCACE,kBACA,eACA,kBACA,sBACA,iBACA,oBACA,gBACA,kBAEA,kBACA,aACA,cAEA,6BACA,WACA,oBAEA,gDACE,gCAKN,iCACE,YACA,gBAGF,4BACE,aACA,mBACA,yBACA,iBACA,cAGE,qQAIE,2BAIJ,iDACE,2CACE,+BACA,6CAEA,mEACE,mEAKN,0BA3BF,4BA4BI,+BACA,6CAEA,oDACE,mEN3KN,iHMiLI,oBAIJ,iDAEI,0IAEE,UAEA,0LACE,WA3LR,8HAEE,kBACA,SACA,OACA,QACA,gBACA,gBACA,+CAEA,aACA,2BACA,sBACA,oBACA,mCAEA,8IACE,WACA,cACA,kBACA,eACA,OACA,QACA,eACA,uDAGF,wKACE,gBACA,sBAIJ,uDACE,eAEA,mBACA,sBAEA,+DACE,gBACA,YAGF,+DACE,SAGF,qEACE,iBAIJ,+DACE,YACA,cACA,iBAEA,uEACE,YACA,eAGF,6EACE,eAoIF,0BAEI,8KAEE,wDAON,gJAEE,mDAEA,8LACE,eAKN,iBACE,gBACA,mBACA,qBACA,gBACA,SACA,gBACA,uBACA,uBAEA,4DAEE,oBACA,gBAGF,yBAhBF,iBAiBI,cACA,gBACA,wBAGF,0BACE,yCACE,kDAKN,wBACE,eACA,aACA,mBAEA,8BACE,aACA,sBACA,uBACA,YACA,gBAGF,+BACE,aACA,mBAEA,6CACE,cACA,eACA,mBACA,kBAIJ,qEACE,uBAIJ,sBACE,qBACA,aACA,cACA,oBAGF,mDACE,kBACA,qBACA,SACA,kCACA,gBACA,mBACA,uBACA,qBAEA,uEACE,oBAGF,iEACE,2BAGF,2EACE,iBAIJ,8BACE,aACA,cAGF,2CACE,aACA,mBACA,iBACA,eACA,2BAGE,oFACE,aAIJ,gEACE,gBAGF,mDACE,cAIJ,mCACE,aACA,cACA,oBACA,uBACA,eACA,qBACA,kDACA,kBACA,gBACA,eAEA,yCACE,wDAGF,0DACE,kBACA,eACA,iBACA,cACA,kBACA,gBAEA,2FACE,eACA,cACA,uBACA,gCAGF,yFACE,8CACA,kBACA,sBACA,sCAGF,sFACE,kBACA,OACA,MACA,cACA,gCACA,uBACA,sBACA,sCAIJ,iDACE,gBACA,4BACA,mBACA,gBAEA,iDANF,iDAOI,iBAGF,wDACE,gBACA,kBACA,iBACA,YACA,2BACA,sBACA,gBACA,mBAEA,oEACE,mBAIJ,mDACE,kBACA,qBACA,gBACA,mBACA,gBACA,uBACA,SAEA,+DACE,mBAKN,gDACE,WACA,YAGF,uCACE,cACA,eACA,iBACA,qBACA,4BACA,mBACA,cAEA,qDACE,gBAKN,6BACE,cACA,iBACA,aACA,mBACA,yBAGE,8DACE,2BACA,UAMJ,wFACE,mBAEA,kGACE,qBAKN,yBApdA,sEAEE,kBACA,SACA,OACA,QACA,gBACA,gBACA,+CAEA,aACA,2BACA,sBACA,oBACA,mCAEA,sFACE,WACA,cACA,kBACA,eACA,OACA,QACA,eACA,uDAGF,gHACE,gBACA,sBAIJ,2BACE,eAEA,mBACA,sBAEA,mCACE,gBACA,YAGF,mCACE,SAGF,yCACE,iBAIJ,mCACE,YACA,cACA,iBAEA,2CACE,YACA,eAGF,iDACE,eAuZF,sEAGE,gCAIJ,kDACE,sEAEE,mBAKN,mBACE,KACE,UAEF,GACE,W;AC9eJ,iBACE,aACA,mBACA,yDACA,qBACA,2BACA,0CACA,kDACA,kBACA,gBACA,eACA,cAGE,0DACE,aAIJ,+BACE,gBACA,cACA,SACA,yCACA,iDAEA,uCACE,aACA,YACA,eAGF,+CACE,0BAGF,wCACE,cAIJ,yBACE,WACA,cACA,kBACA,aACA,gBACA,cACA,UACA,+BACA,kBAGF,uBACE,oCAGF,wBACE,qCAGF,gCACE,yDAGF,+BACE,gBACA,0BACA,aACA,8BAEA,8CACE,mBACA,gBACA,uBACA,sBACA,OACA,cAGF,iCACE,mBACA,gBACA,uBACA,gBACA,gBACA,OAEA,wCACE,aACA,aAIJ,sCACE,8DACA,+DACA,sCAIJ,0CACE,0BACA,YAGF,iCACE,WACA,YACA,iBACA,qBACA,mBACA,cAEA,uCACE,mBAIJ,8BACE,8BACA,gCACA,aACA,+BACA,uBACA,WACA,qCACA,sDAEA,sCACE,gBAGF,8CACE,oBAGF,4CACE,4BAGF,6CACE,gBACA,0B;AC/IN,aACE,kBACA,eACA,SACA,QACA,aACA,mBACA,gCACA,sBACA,iBACA,WACA,eACA,eAEA,uFAGE,iBACA,mBAGF,2BACE,sBAGF,4BACE,qBAGF,gCACE,gBACA,uBACA,qBAGF,gCACE,oBACA,qBACA,mBACA,kBACA,eAGF,mCACE,6CACA,gBAGF,mEAEE,0BACA,0BACA,sBACA,sBACA,UACA,cACA,aACA,UACA,gBACA,6BAEA,qHACE,uBAIJ,qFAEE,sBACA,YACA,6BAGF,+GAEE,cAGF,4CACE,eACA,eAGF,yBACE,QAGF,gDACE,oCAGF,oCACE,uBACA,oBACA,sBAEA,iDACE,8BAIJ,6DACE,gBAGF,kEACE,iBAKF,6DACE,WACA,aACA,cAGF,6DACE,YAGF,6DACE,YAGF,6DACE,Y;AC7HF,wBACE,eAGF,kBACE,oB;ACNJ,SACE,aACA,mBACA,eAEA,qBACE,eAGF,iBACE,mBAGF,uBACE,cACA,eACA,mBACA,gBAEA,qCACE,eACA,iBACA,qBACA,gBAGF,sCACE,iBACA,6B;AC5BN,YACE,aACA,qBACA,qBAEA,uBACE,gBAGF,8BACE,sBAGF,+BACE,kBACA,mBACA,cACA,wBACA,cACA,gBACA,kBACA,iBAEA,2CACE,oBACA,uBACA,iBAIJ,gCACE,kBACA,QACA,YACA,WACA,YACA,+BACA,8BACA,oBACA,iBACA,kBAEA,sCACE,8BAGF,gDACE,gBAGF,wCACE,UACA,qCACA,qBACA,uBACA,6BAIJ,+BACE,YAGF,gCACE,kBAGF,8BACE,kBACA,QACA,cACA,gBACA,sBACA,iBACA,+BAEA,qBACA,yBACA,sBAIF,uBACE,WACA,YACA,kBACA,WACA,YACA,sDACA,oBACA,wBAGF,4BACE,iBACA,qBACA,2BACA,UAIA,qCACE,8BAGF,mCACE,0BAKN,iCACE,aACA,gB;ACjHF,MACE,gBACA,mBAEA,yBAJF,MAKI,gBAGF,qBACE,gBACA,oBACA,iBACA,sBAGF,0CAEE,6BACA,kBAGF,iBACE,oBACA,aACA,mBACA,oBAGF,yBACE,2BACA,kBAGF,oBACE,mBACA,oBAGF,6BAEE,qBAEA,mDACE,qBAGF,+CACE,qBACA,mBAKA,gJACE,aACA,yCAEA,gMACE,4CAGF,oMACE,qCAIJ,4IACE,cACA,qCAMF,wMACE,iCAIJ,+CACE,aAMA,sCACE,aACA,sCAEA,mDACE,qCAMR,mBAEE,0CAEA,+BACE,2CAGF,gCAEE,2CACA,4CACE,2CAKN,0BACE,oBACA,mBACA,2BACA,oBACA,mBACA,gBAEA,kCACE,oCACA,eACA,uBAEA,oDACE,iBAKN,sBACE,iBACA,iBACA,qBAEA,+BACE,yBAEA,wDACE,0BAIJ,0BACE,oBAIJ,+BACE,4BACA,iBACA,eACA,qBACA,2CAGF,sBACE,kCACA,yCACE,2BAIJ,wCAEE,mBACA,qBAGF,cACE,oBACA,eAEA,2BACE,0BACA,mDAIJ,cACE,qBACA,yB;ACxLJ,SACE,kBACA,sBACA,qBACA,yDACA,qBACA,gBACA,kBAEA,iBACE,WACA,cACA,kBACA,MACA,SACA,OACA,cACA,+BACA,sBAGF,cACE,aACA,sBACA,uBAGF,sBACE,oBACA,iCAEA,sFACE,6DAGF,mCACE,WACA,YACA,aACA,2BAEA,uCACE,WACA,YAKN,iCACE,4BACA,8BAGF,2BACE,aACA,mBAEA,yCACE,QACA,mBAGF,wCACE,QACA,cAIA,kDACE,wBASF,kMACE,WACA,qBACA,iCACA,cACA,YAKN,oEAGE,sBACA,eAGF,oBACE,0BACA,gBACA,sBAGF,qBACE,gBACA,sBAGF,2BACE,iBACA,gBAEA,uCACE,qBAIJ,kBACE,6BAEA,0BACE,UACA,Q;ACvHJ,gBACE,0BACA,gBAGF,sBACE,kBAGE,+CACE,eACA,aAEA,yBAJF,+CAKI,cAIJ,kDACE,kBACA,MACA,qBACA,cACA,oCACA,kDACA,wBACA,gBAEA,uDACE,kB;AC9BV,OACE,kBACA,gBAEA,mCACE,mCAGF,0BACE,sBAEA,sDACE,oBACA,qCACA,sCAMF,0HACE,oBAKF,uJACE,2BACA,iB;AC5BN,YACE,kBACA,YACA,aACA,eAEA,+BACE,YACA,aACA,kBACA,gBAGF,2BACE,kBACA,OACA,MACA,kBACA,gBAGF,sBACE,kBACA,MACA,OACA,WACA,YACA,oBAGF,6BACE,YACA,iBACA,eACA,mBACA,qBAGF,kKAGE,a;ACzCJ,eACE,aACA,sBAEA,oBACE,aACA,mBAGF,uBACE,OACA,WACA,eACA,gCACA,kDACA,gBACA,oBAEA,+BACE,WACA,oCACA,UAEA,kBACA,MACA,OACA,QACA,SACA,kDACA,uBACA,yBAGF,6BACE,2CAEA,qCACE,WAIJ,qCACE,cAGF,oCACE,eAGF,yBACE,kBACA,kBACA,eACA,aACA,cAEA,0CACE,iBACA,YACA,cACA,yBAKN,0CACE,6BAGF,yCACE,gBAEA,uDACE,wDAGF,sDACE,yD;AC7EN,eACE,4CACA,uCAEA,aACA,WACA,mBACA,yCACA,6BACA,0BACA,mCACA,6DACA,2DACA,mBACA,gBACA,iBACA,0BACA,mBACA,eACA,4CAEA,sCACE,2BAGF,8CACE,WACA,cACA,kBACA,kBACA,gBACA,eACA,eACA,gCACA,yDACA,UACA,oCAEA,gEACE,oBAGF,qEACE,2BAIJ,6BACE,kBACA,YACA,cACA,YACA,gBACA,uBACA,gCACA,uBACA,WACA,gCAEA,UACA,4BAEA,wBAfF,6BAgBI,sBAGF,mCACE,iCAGF,4CACE,UAGF,oCACE,uBACA,kBACA,kBACA,OACA,WACA,kBACA,eACA,cAGF,2CACE,eACA,kDACE,aAIJ,oDACE,cACA,iBACA,cAGF,sKAIE,aAIJ,qBACE,8BAEA,oDACE,UAGF,6BACE,2CAIJ,mHAKE,0CAGF,qDACE,iCAGF,sCACE,sBAGF,sCACE,yBAGF,6OAKE,wBAGF,sCACE,aAGF,8BACE,oBACA,iBACA,0BAGF,0BACE,yBACA,iBAGF,gCACE,oBACA,mBACA,wBACA,8BAEA,wCACE,uBACA,yCACA,oBACA,UACA,gBAEA,+CACE,WACA,qBAGF,gDACE,UAEA,wDACE,UAIJ,0DACE,6BAKN,iCACE,kBAEA,wCACE,WACA,qBACA,YACA,aACA,kBACA,+BACA,2BAIJ,wBACE,eACA,q2B;AChNJ,SACE,aACA,qBACA,sBACA,kBAEA,4CACA,wCACA,0CACA,mBACA,qCACA,iDACA,+CACA,+BACA,8BACA,kCACA,4HACA,6BACA,4BACA,iCAEA,mBACE,yCAGF,mDAEE,UACA,iCACA,8CAEA,iGACE,2BAIJ,iBACE,kBACA,SACA,OAEA,yBALF,iBAMI,aACA,eAIJ,uBACE,sBAGF,sBAGE,sBAIA,qCACE,gDACA,gDAIA,+DACE,wCAIF,2DACE,oBAMJ,6CACE,+DAIJ,mBACE,oBAEA,gEACE,eAGF,yBAPF,mBAQI,sBAEA,gEACE,qBAKN,aACE,2BACA,gDACA,4CACA,8CACA,mBACA,wCACA,yCACA,2CACA,oCACA,0CACA,sCACA,4CACA,8BACA,4BACA,4CAEA,oDAEE,0DACA,4DACA,8DAGF,yBAxBF,aAyBI,sBAKF,2EAEE,kDACA,UACA,6DACA,wBAIJ,mBACE,mCAGF,oBACE,qCAEA,8BACE,qCAGF,kCACE,qCAEA,4CACE,qCAKN,6BACE,eAEA,yBAHF,6BAII,2CAIA,+GAEE,6BAIJ,mDACE,WACA,kBACA,aACA,gBACA,WACA,YACA,qCAKA,wIACE,qBAIJ,qDACE,UAKF,6CACE,8BAEA,0DACE,uBAEA,sEACE,8BAON,wDACE,8BAIJ,6HAEE,qDAGF,qIAEE,yDAGF,wCACE,eACA,aAGF,qDACE,yDACA,2BACA,qBAEA,4DACE,+BAKJ,eACE,kBAEA,uCACE,kBACA,SACA,UACA,UAKF,iDACE,uCAGF,4DACE,kBACA,YACA,cACA,WAGF,iDACE,8CACA,iDAGF,kFACE,iEAIA,wEACE,8BAGF,0GACE,6CAOJ,4FACE,8BAGF,wEACE,2BAMA,oEACE,iBAGF,6EACE,gBACA,oCACA,qCAGF,uFACE,YAIJ,2DACE,gBAEA,mEACE,oBAGF,4EACE,uCACA,wCAOA,wPACE,gBAEA,sQACE,WACA,cACA,eACA,sBACA,gBACA,oCACA,kBASA,kSACE,mCACA,qCAEA,gTACE,mCACA,2CAaV,4OACE,4CAIA,4PACE,yDACA,gDAKN,uDACE,iBAGF,+CACE,qDAIA,2DACE,aACA,yBAEA,4EACE,WAMR,oCACE,kBAEA,4DACE,kBACA,UAIJ,iCACE,kBACA,OACA,cACA,aACA,cACA,sBACA,kBACA,wCAEA,aACA,mBACA,uBAEA,WACA,eAEA,UACA,oBACA,4CAEA,8CACE,kBACA,UACA,SACA,mBAGF,6CACE,uBAIJ,iBACE,mBAIA,wDACE,gCAIA,+EACE,gCAKF,gFACE,6BAOR,sKAME,qDACA,uDACA,2DACA,6DAGF,8BACE,kCAGF,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6CACE,OACA,iBACA,iBACA,gBACA,iBACA,mBACA,6CAEA,0DACE,0BAKN,4BACE,iDAGF,iGACE,mCAGF,sCACE,+BAEA,yGACE,WACA,qBACA,iCACA,YAIJ,kDACE,aAGF,+BACE,gBACA,kBACA,kBACA,eACA,gBACA,0BAEA,uCACE,6BAGF,4CACE,gBAGF,kDACE,eAKF,iEACE,wBAMA,2DACE,yBACA,UACA,8BAKN,0BACE,yBAGE,4CACE,kDAIJ,8CACE,oBAMF,8IAEE,sBACA,uBAIJ,uBACE,yBAEA,4CACE,iBAIJ,uBACE,qBACA,wCAEA,4CACE,kBAIA,8DACE,yBAKN,2CACE,qBACA,cACA,wBACA,kBACA,sBACA,2BAEA,sDACE,wDACA,kBAIJ,yDACE,kDACA,mDACA,4DAGF,mCACE,4BACA,6BAGF,yCACE,6BAEA,uEACE,oBACA,kBACA,YACA,4BACA,8BACA,gBACA,yCACA,4CAEA,oFACE,kBAIJ,sDACE,mBAOJ,0DACE,aACA,uBACA,mBAEA,kFACE,eAEA,wGACE,yBAKN,8DACE,sBAGF,gdAME,oBACA,qBAGF,oEACE,sBAGF,sTAIE,mBACA,wBAIF,4HAEE,sBAGF,8DACE,aACA,mBACA,uBAEA,oFACE,WACA,mBACA,+CAIJ,gIACE,kBACA,aACA,mBACA,uBACA,WACA,WACA,yBAEA,wJACE,UAGF,4JACE,aACA,mBACA,uBACA,eACA,gBACA,kBACA,2BAIJ,8DACE,iBAGF,kEACE,iBAGF,kKAEE,2BACA,WACA,iBACA,kBACA,cACA,aACA,UACA,kBACA,qBACA,qBAGF,kHACE,0BACA,oBACA,oBAIJ,8BACE,gBACA,gBACA,aACA,eACA,qBAEA,2CACE,mBACA,wBAEA,uDACE,kBAIJ,uCACE,eAGF,6CACE,aACA,uBACA,2BACA,cAEA,+CACE,gBAGF,8DACE,kBACA,4CAEA,yBAJF,8DAKI,8BAGF,yBARF,8DASI,kBACA,UACA,8BAKN,4CACE,mBAGF,2CACE,cACA,eACA,cAEA,uDACE,MACA,OACA,SACA,QAIJ,qCACE,qBACA,kBAEA,gDACE,wDACA,kBAKF,uDACE,gBAIJ,2CACE,eACA,iBAEA,0DACE,YAGF,yDACE,gBACA,kBAGF,+DACE,gBAGF,kDACE,WACA,YAIJ,2CACE,eACA,iBACA,gBAEA,wDACE,mBAGF,+DACE,gBAGF,kDACE,WACA,YAIJ,2CACE,eACA,mBACA,gBAEA,wDACE,kBAGF,+DACE,gBAGF,kDACE,WACA,YAIJ,iDACE,wCACA,0CAGF,2CACE,4CACA,8CAEA,0DACE,mBAEA,2EACE,mBAEA,yBAHF,2EAII,cACA,UACA,gCAOV,mBAiCE,8DACA,+DACA,iEACA,kEAnCA,yCAEE,oBAGF,uDACE,kBACA,kBACA,qBAEA,+DACE,WACA,cACA,kBACA,MACA,SACA,YACA,UACA,+BACA,kBAGF,gEACE,6BAEA,wEACE,UACA,aAUN,gCACE,oBACA,gCAIJ,qBACE,qBAGF,kBACE,oCACA,qBACA,sBACA,eACA,qBAEA,2EACE,0CACA,0BAIJ,mCACE,wBACA,gCACA,qBACA,SACA,gBACA,kBACA,uhB;ACjuBF,iBACE,WACA,YACA,aACA,mBACA,uBACA,kBAEA,0BACE,oBACA,sBACA,mBACA,gCACA,cACA,oBACA,qBACA,WAGF,wBACE,gBACA,gBAGF,8BACE,mBACA,gBAGF,0BACE,mBACA,aACA,YACA,eAEA,qCACE,aACA,Y;ACrCN,sBACE,YACA,aACA,mBACA,uBACA,mBAEA,cACE,mBACA,sBAGF,mBACE,sBACA,gCACA,gBACA,oBACA,qBACA,WACA,+BAEA,gBACE,oBAIJ,eACE,eACA,qBACA,kBACA,uBACA,0BAGF,kBACE,SACA,UACA,gBACA,uBACA,8BAGF,kBACE,kBACA,UACA,gBACA,uBACA,gBACA,yCAEA,WACE,wBACA,C;AClDN,aACE,OACA,WACA,oBAEA,qBACA,gBACA,kBACA,gBvBFA,+BuBNF,avBOI,mBAGA,mBuBCF,iCACE,sIAGF,wBAfF,aAgBI,0CAC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,2BAGF,gDACE,4DAIJ,yBACE,gCACE,eACA,iBAKN,2BACE,wBACA,UACA,mBAEA,8DACE,2BAIJ,gCACE,iBACA,cACA,iBACA,qBACA,kBACA,mBACA,gBACA,kBAEA,kBACA,YACA,cAEA,8BACA,WAEA,oBAEA,yBAnBF,gCAoBI,YACA,YAIJ,yBACE,2CACE,oG;AC9FJ,yBACE,sBACA,gBACA,iDAGF,0BACE,aACA,sBACA,yBACA,gBACA,cAEA,yBAPF,0BAQI,iBAGF,+BACE,aACA,mBAGF,oCACE,mBAGF,kCACE,OACA,WACA,YACA,qBACA,kDACA,sCACA,mCACA,2BACA,gBACA,oBAEA,wCACE,WACA,wCACA,sCAIJ,0CACE,oB;AC/CN,yBACE,gBACA,wDAEA,mEACE,aAGF,oCACE,oBAGF,gDACE,2BAGF,6BACE,aACA,mBACA,sBACA,qBAGF,qCACE,cACA,2BACA,aACA,gBACA,wBACA,UACA,kBAEA,yBATF,qCAUI,gB;ACjCN,gBACE,gBACA,wDAsBA,qCApBA,uCACE,2BAGF,0DACE,aAGF,2BACE,oBAIF,oBACE,aACA,mBACA,sBACA,qBAKF,yCACE,kBAGF,4BACE,cACA,2BACA,aACA,gBACA,wBACA,UACA,kBAEA,yBATF,4BAUI,gBAIJ,yBACE,YACA,mCACA,gCAEA,iCACE,UACA,cAGF,iDACE,aAGF,gFAEE,OACA,eACA,gBAGF,qCACE,mBACA,uBAGF,2CACE,gBACA,mBACA,uB;ACvEN,UACE,qBAEA,oDACE,kBACA,mBACA,SAEA,yBALF,oDAMI,oBAGF,4DACE,eAEA,yBAHF,4DAII,YAIJ,kEACE,UAIJ,wBACE,kBAGF,kBACE,cACA,kBAEA,yBAJF,kBAKI,eACA,iBAGF,kGAGE,kBAIA,qIAEE,2BAIJ,yBACE,kBACA,UAEA,+DACE,mCAIJ,4BACE,kBACA,UACA,0BAIA,kCACE,iCAGF,+EAEE,0CAKF,8CACE,iCAGF,yEAEE,0CAKF,8EAEE,0CAGF,mCACE,iCAIJ,8BACE,kCAIA,8UACE,kCAKN,qCACE,eACA,gBACA,kBAEA,mJAGE,kBAGF,8CACE,uBAGF,iDACE,iCAGF,kGACE,0CAGF,iDACE,kCAIA,yDACE,iCAGF,2HACE,0CAKF,gEACE,iCAGF,uHACE,0CAMR,iBACE,YACA,4BACA,mCACA,4CACA,6BACA,iDACA,kBACA,UAEA,+BACE,kBACA,kBACA,gBACA,eACA,eACA,yBACA,0BAEA,uCACE,6BAIJ,yBAxBF,iBAyBI,6BAIJ,uBACE,aAEA,gCACE,kBACA,uBACA,qBAGF,+BACE,cACA,2BACA,aACA,cACA,SACA,UACA,oBAEA,uCACE,kBAGF,yBAbF,+BAcI,eACA,gBAEA,uCACE,wBAIJ,4CACE,sCAGA,0GACE,yCAIJ,yDACE,WACA,kBACA,WACA,aACA,8CACA,uBACA,YACA,aACA,kBACA,qCACA,mEACA,yBAZF,yDAaI,UACA,aAKN,oCACE,YACA,gBAGF,wCACE,qBACA,kBACA,mBACA,cACA,0BAEA,+CACE,WACA,WACA,YACA,8BACA,kBACA,kBACA,QACA,gBACA,eAGF,yBAnBF,wCAoBI,gBACA,sBAKN,wCAEE,kBAEA,oEACE,qIACA,gBACA,kBACA,iFACA,uBACA,mBACA,0CAEA,4LAEE,gHAGF,wFACE,gBACA,kBAIA,4OACE,aAIJ,kGACE,oBAIJ,4JAEE,kBACA,gCACA,oBACA,uBACA,mBACA,mBACA,0CACA,kEACA,YAGF,gFACE,uBACA,OACA,mBACA,gBACA,eACA,uBAGF,8FACE,QAGF,4EACE,oCACA,eACA,qBAEA,8QACE,0CAIJ,sDACE,kBACA,MACA,OACA,UACA,oBACA,YACA,uBACA,mBAIJ,oBACE,YAEA,kCACE,gBACA,kCACA,uBACA,2BACA,2BACA,8BACA,kBACA,iBACA,mBACA,wEAUA,6BARA,yBAZF,kCAaI,gBACA,oBACA,iBACA,0EACA,eAKF,yDACE,2BAIJ,8EAEE,kEAEA,yBAJF,8EAKI,qEAKF,mDACE,eACA,gBAMF,+KACE,kBAIJ,2BACE,cACA,eACA,kBACA,iBACA,oBAKF,kCACE,eACA,mBACA,iBAGF,sCACE,gBACA,eAIJ,kBACE,kBACA,0BACA,OACA,WACA,mCACA,4CACA,gBACA,iBAEA,kBACA,gBAGA,iDAEA,UACA,6BACA,wBACA,6E5BhcA,+B4B6aF,kB5B5aI,mBAGA,mB4B8bF,8BACE,aAGF,uBACE,UACA,wBAGF,2BACE,c;ACpdJ,kBACE,kBACA,MACA,OACA,SACA,QACA,gBACA,WAEA,mDAEE,WACA,cACA,kBACA,MACA,OACA,SACA,QACA,+CAGF,yBASE,2BACA,4BACA,sBAVA,sCACE,yDAEA,yBAHF,sCAII,0DAQJ,4DACE,oEAGF,gDACE,gBAIJ,gEACE,UAGF,0CACE,qDACA,YACA,qBAGF,kDACE,kBAGF,sCACE,gDACE,6BACA,gBACA,mBACA,6BACA,6CAGF,wEACE,kCAKN,cACE,aACA,uBACA,YACA,kBACA,UAEA,yBAPF,cAQI,iBAGF,+BACE,wDAEA,aACA,sBACA,mBACA,WACA,YACA,kBACA,gBAEA,2CACE,WACA,YACA,gBAEA,+CACE,aACA,sBACA,mBAMJ,wCACE,WACA,aACA,4CACA,mCACA,kCACA,kBACA,iDAKF,yCACE,kCACA,kGAEA,iDACE,mCACA,8CAIA,wIACE,2BAKN,+EACE,UACA,4CAEA,6HACE,2BAIJ,gCACE,UACA,mBACA,+EAEA,uDACE,2BAIJ,2EACE,oBAIA,6DACE,SAGF,qDACE,6FACA,yDAEA,6DACE,sCAIJ,2DACE,yBAEA,yBAHF,2DAII,0BAIJ,uGACE,UAGF,4CACE,qBACA,qBAKN,kCACE,oBACA,8CAEA,iEACE,UACA,4CAEA,wFACE,2BAIJ,yDACE,2BAGF,8CACE,kDACA,oBAEA,6EACE,UAKN,oCACE,WACA,0CACA,eACA,kBACA,aACA,qBACA,+BAEA,+BACA,6CAEA,2DACE,2BAGF,0BAhBF,oCAiBI,6CAEA,4DACE,mEAIJ,yBAxBF,oCAyBI,gBAEA,6DACE,wGAIJ,4CACE,WACA,kBACA,eACA,OACA,QACA,WACA,qJACA,UACA,8BAEA,yBAXF,4CAYI,SACA,WAIJ,uDACE,UAGF,4DACE,qJAMN,oDAGE,sBAEA,yBALF,oDAMI,qBAIJ,sEAIE,WACA,aACA,uBACA,kBAMA,iIACE,8DACA,4CAIJ,wBACE,WACA,aACA,uBACA,kBACA,uBAEA,0CACE,0BACA,yBACA,cACA,iBACA,oBACA,+EAGE,4DACE,yBAIJ,oFACE,gBACA,4CAGF,yBAnBF,0CAoBI,eAGF,sDACE,+BACA,yBACA,kCACA,iBACA,sBAIJ,yBAvCF,wBAwCI,uBAGF,qDACE,sB;AChWJ,aACE,aACA,mBACA,4BACA,uBACA,oBAEA,yBAPF,aAQI,eAGF,2BACE,cAGF,yBACE,OACA,YAEA,6BACE,aACA,mBAIJ,gBACE,gBACA,kBACA,gBACA,qBAGF,oBACE,aACA,iBAGF,0BACE,iBAEA,yBAHF,0BAII,mBAIJ,2BACE,iB;AC5CJ,SACE,YACA,aACA,sBAEA,kBACA,iDANF,S/BOI,mBAGA,mB+BDF,iCACE,oBAEA,gDACE,2BAIJ,kCACE,4BACA,2EACA,8DAEA,0CACE,gBAGF,yDACE,iBACA,oCAGF,4CACE,iBAGA,sDACE,cACA,kBAKN,+BACE,UAIJ,cACE,aACA,8BAEA,uBACE,mCACA,SACA,UAEA,4BACE,oBACA,8BACE,aAKN,0BACE,OAIA,kCACE,YACA,iBACA,aACA,uBACA,uBAEA,2CACE,wBAIJ,kCACE,aACA,qCACA,mBACA,kBAGF,sCACE,gBAEA,kDACE,mBAIJ,kCACE,gBAEA,8GAEE,aAIJ,kCACE,gBAGE,wDACE,MACA,OACA,aACA,mBACA,uBAGF,gDACE,qBAKN,oCACE,mBAEA,yBAHF,oCAII,gBACA,kEACE,U;ACnIV,gBACE,YACA,gBACA,kBAEA,sBACE,YACA,gB;ACPJ,aACE,kBACA,MACA,QACA,gCACA,YACA,uDACA,mCAC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AGF,sCACE,oCAIJ,+CACE,gBAEA,qDACE,gBAKN,kCACE,sCAEA,6IACE,6EAIA,gFACE,aAKF,+EACE,kCACA,UAKF,uEACE,+BACA,UAKF,8EACE,aAKF,6EACE,kCACA,UAKF,wEACE,+BACA,U","sources":["webpack://telegram-t/./src/components/left/main/LeftMainHeader.scss","webpack://telegram-t/./src/styles/_mixins.scss","webpack://telegram-t/./src/components/left/ConnectionState.scss","webpack://telegram-t/./src/components/left/NewChatButton.scss","webpack://telegram-t/./src/components/left/main/LeftMain.scss","webpack://telegram-t/./src/components/left/LeftColumn.scss","webpack://telegram-t/./src/components/middle/AudioPlayer.scss","webpack://telegram-t/./src/components/middle/MiddleHeader.scss","webpack://telegram-t/./src/components/common/EmbeddedMessage.scss","webpack://telegram-t/./src/components/middle/message/MessageMeta.scss","webpack://telegram-t/./src/components/middle/message/Sticker.scss","webpack://telegram-t/./src/components/middle/message/Contact.scss","webpack://telegram-t/./src/components/middle/message/PollOption.scss","webpack://telegram-t/./src/components/middle/message/Poll.scss","webpack://telegram-t/./src/components/middle/message/WebPage.scss","webpack://telegram-t/./src/components/middle/message/Invoice.scss","webpack://telegram-t/./src/components/middle/message/Album.scss","webpack://telegram-t/./src/components/middle/message/RoundVideo.scss","webpack://telegram-t/./src/components/middle/message/InlineButtons.scss","webpack://telegram-t/./src/components/middle/message/CommentButton.scss","webpack://telegram-t/./src/components/middle/message/Message.scss","webpack://telegram-t/./src/components/middle/message/_message-content.scss","webpack://telegram-t/./src/components/middle/ContactGreeting.scss","webpack://telegram-t/./src/components/middle/NoMessages.scss","webpack://telegram-t/./src/components/middle/MessageList.scss","webpack://telegram-t/./src/components/middle/ScrollDownButton.scss","webpack://telegram-t/./src/components/middle/composer/BotKeyboardMenu.scss","webpack://telegram-t/./src/components/middle/composer/ComposerEmbeddedMessage.scss","webpack://telegram-t/./src/components/middle/composer/WebPagePreview.scss","webpack://telegram-t/./src/components/middle/composer/Composer.scss","webpack://telegram-t/./src/components/middle/MiddleColumn.scss","webpack://telegram-t/./src/components/right/RightHeader.scss","webpack://telegram-t/./src/components/right/Profile.scss","webpack://telegram-t/./src/components/right/AddChatMembers.scss","webpack://telegram-t/./src/components/right/RightColumn.scss","webpack://telegram-t/./src/components/main/Main.scss"],"sourcesContent":["@import '../../../styles/mixins';\n\n#LeftMainHeader {\n position: relative;\n\n .animated-menu-icon {\n position: absolute;\n\n &, &::before, &::after {\n width: 1.125rem;\n height: 0.125rem;\n border-radius: 0.125rem;\n background-color: var(--color-text-secondary);\n transition: transform .25s;\n transform: rotate(0);\n }\n\n &::before, &::after {\n position: absolute;\n left: 0;\n content: '';\n }\n\n &::before {\n top: -0.3125rem;\n }\n\n &::after {\n top: 0.3125rem;\n }\n\n &.state-back {\n transform: rotate(180deg);\n\n &::before {\n transform: rotate(45deg) scaleX(0.75) translate(0.375rem, -0.1875rem);\n }\n\n &::after {\n transform: rotate(-45deg) scaleX(0.75) translate(0.375rem, 0.1875rem);\n }\n }\n\n &.no-animation {\n transition: none;\n\n &::before, &::after {\n transition: none;\n }\n }\n }\n\n .archived-badge {\n min-width: 1.5rem;\n height: 1.5rem;\n margin-left: auto;\n background: var(--color-gray);\n border-radius: 0.75rem;\n padding: 0 .45rem;\n color: white;\n font-size: 0.875rem;\n line-height: 1.5rem;\n font-weight: 500;\n text-align: center;\n flex-shrink: 0;\n }\n\n [dir=rtl] .archived-badge {\n margin-left: 0;\n margin-right: auto;\n }\n\n .Menu .bubble {\n min-width: 17rem;\n max-height: calc(100 * var(--vh) - 3.75rem);\n\n overflow-y: auto;\n @include overflow-y-overlay();\n }\n\n // @optimization\n @include while-transition() {\n .Menu .bubble {\n transition: none !important;\n }\n }\n}\n","// @optimization\n@mixin while-transition() {\n .Transition > div:not(.active) &, body.animating-right-column & {\n @content;\n }\n}\n\n@mixin overflow-y-overlay() {\n @supports (overflow-y: overlay) {\n overflow-y: overlay;\n\n //Workaround for Android <= 9\n overflow-x: hidden;\n }\n}\n","#ConnectionState {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n margin: 0 0.5rem 0.5rem;\n padding: 0.75rem;\n background: var(--color-yellow);\n border-radius: var(--border-radius-default);\n\n > .Spinner {\n --spinner-size: 1.75rem;\n }\n\n > .state-text {\n color: var(--color-text-lighter);\n font-weight: 500;\n line-height: 2rem;\n margin-inline-start: 1.875rem;\n white-space: nowrap;\n }\n\n @media (max-width: 950px) {\n > .state-text {\n margin-inline-start: 1.25rem;\n }\n }\n}\n",".NewChatButton {\n position: absolute;\n right: 1rem;\n bottom: 1rem;\n transform: translateY(5rem);\n\n transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);\n\n body.animation-level-0 & {\n transform: none !important;\n opacity: 0;\n\n transition: opacity .15s;\n\n &.revealed {\n opacity: 1;\n }\n }\n\n &.revealed {\n transform: translateY(0);\n @media (max-width: 600px) {\n // Force rendering in the composite layer to fix the z-index rendering issue\n transform: translate3d(0,0,10px);\n transform-style: preserve-3d;\n }\n }\n\n &.menu-is-open {\n &::before {\n content: '';\n display: block;\n position: absolute;\n top: -13rem;\n left: -11rem;\n right: -1rem;\n bottom: -1rem;\n z-index: -1;\n }\n }\n\n .is-touch-env & {\n .Menu > .backdrop {\n position: absolute;\n left: -100vw;\n right: -100vw;\n top: -100vh;\n bottom: -100vh;\n }\n }\n\n > .Button {\n .icon-new-chat-filled,\n .icon-close {\n position: absolute;\n }\n\n &:not(.active) {\n .icon-new-chat-filled {\n animation: grow-icon .4s ease-out;\n }\n\n .icon-close {\n animation: hide-icon .4s forwards ease-out;\n }\n }\n\n &.active {\n .icon-close {\n animation: grow-icon .4s ease-out;\n }\n\n .icon-new-chat-filled {\n animation: hide-icon .4s forwards ease-out;\n }\n }\n }\n}\n","#LeftColumn-main {\n height: 100%;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n z-index: 1;\n\n .connection-state-wrapper {\n position: absolute;\n top: 3.75rem;\n width: 100%;\n }\n\n > .Transition {\n flex: 1;\n overflow: hidden;\n transition: transform 300ms ease;\n\n &.pull-down {\n transform: translateY(3.75rem);\n }\n }\n\n .ChatFolders {\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n\n .tabs-placeholder {\n height: 2.625rem;\n transition: height 150ms ease;\n\n &:not(.open) {\n height: 0;\n }\n }\n\n .TabList {\n justify-content: flex-start;\n padding-left: .5625rem;\n padding-bottom: 1px;\n border-bottom: 0;\n z-index: 1;\n }\n\n .Tab {\n flex: 0 0 auto;\n padding-left: 0.625rem;\n padding-right: 0.625rem;\n\n > span {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n }\n }\n\n > .Transition {\n flex: 1;\n overflow: hidden;\n }\n }\n\n .RecentContacts, .LeftSearch, .search-content {\n height: 100%;\n overflow-y: auto;\n }\n\n .btn-update {\n position: absolute;\n bottom: 1rem;\n left: 1rem;\n right: 1rem;\n margin: 0 auto;\n }\n}\n","#LeftColumn {\n overflow: hidden;\n}\n\n#NewChat {\n height: 100%;\n}\n\n.left-header {\n height: var(--header-height);\n padding: 0.375rem 1.25rem .5rem 0.8125rem;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n background-color: var(--color-background);\n\n h3 {\n margin-bottom: 0;\n font-size: 1.25rem;\n font-weight: 500;\n margin-left: 1.375rem;\n margin-right: auto;\n }\n\n .SearchInput {\n margin-left: 0.875rem;\n max-width: calc(100% - 3.625rem);\n\n @media (max-width: 600px) {\n max-width: calc(100% - 3.375rem);\n }\n }\n\n @media (max-width: 600px) {\n padding: 0.5rem;\n }\n\n .Button.smaller {\n width: 2.5rem;\n height: 2.5rem;\n\n + .DropdownMenu {\n margin-left: .25rem;\n }\n }\n}\n",".AudioPlayer {\n display: flex;\n margin-left: auto;\n margin-top: -.25rem;\n margin-bottom: -.25rem;\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n > .Button {\n flex-shrink: 0;\n margin: .125rem;\n }\n\n > .toggle-play {\n --color-text-secondary: var(--color-primary);\n --color-text-secondary-rgb: var(--color-primary-shade-rgb);\n --color-primary-shade: var(--color-green);\n --color-white: var(--color-background-own);\n }\n\n .MiddleHeader & + .HeaderActions {\n margin-left: 1.5rem;\n }\n\n .toggle-play {\n &.smaller {\n width: 3rem;\n height: 3rem;\n\n i {\n font-size: 1.625rem;\n margin-top: -.025rem;\n }\n }\n\n i {\n position: absolute;\n font-size: 1.9375rem;\n margin-top: -.05rem;\n\n &.icon-play {\n margin-left: .1rem;\n }\n }\n\n .icon-play, .icon-pause {\n opacity: 1;\n transform: scale(1);\n transition: opacity .4s, transform .6s cubic-bezier(0.34, 1.56, 0.64, 1);\n }\n\n &.play .icon-pause,\n &.pause .icon-play,\n &.loading .icon-play,\n &.loading .icon-pause {\n opacity: 0;\n transform: scale(.5);\n }\n }\n\n &-content {\n display: flex;\n justify-content: center;\n flex-direction: column;\n flex-shrink: 1;\n padding: .25rem .5rem;\n position: relative;\n overflow: hidden;\n cursor: pointer;\n max-width: 15rem;\n border-radius: var(--border-radius-messages-small);\n\n &:hover {\n background-color: var(--color-interactive-element-hover);\n }\n\n @media (min-width: 1440px) and (max-width: 1500px) {\n max-width: 14rem;\n }\n\n .AudioPlayer & .title {\n display: block;\n font-weight: 500;\n font-size: 0.875rem !important;\n line-height: 1rem;\n height: 1rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n body.is-ios & {\n font-size: .9375rem !important;\n line-height: .8125rem;\n }\n }\n\n .subtitle {\n font-size: 0.85rem !important;\n color: var(--color-text-secondary);\n line-height: 1.125rem;\n height: 1.125rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: .125rem 0 0;\n\n body.is-ios & {\n font-size: .9375rem !important;\n }\n }\n }\n}\n","@import '../../styles/mixins';\n\n@mixin mobile-header-styles() {\n .HeaderPinnedMessage-wrapper,\n .AudioPlayer {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n height: 2.875rem;\n overflow: hidden;\n box-shadow: 0 2px 2px var(--color-light-shadow);\n\n display: flex;\n flex-direction: row-reverse;\n padding: 0.375rem 0.5rem;\n padding-left: 0.75rem;\n background: var(--color-background);\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: -.1875rem;\n left: 0;\n right: 0;\n height: .125rem;\n box-shadow: 0 .125rem .125rem var(--color-light-shadow);\n }\n\n .HeaderPinnedMessage {\n max-width: unset;\n margin-top: -0.1875rem;\n }\n }\n\n .AudioPlayer {\n height: 3.25rem;\n\n flex-direction: row;\n padding: 0.375rem 0.5rem;\n\n &-content {\n padding: 0 0.5rem;\n flex-grow: 1\n }\n\n > .Button {\n margin: 0;\n }\n\n > .player-close {\n margin-left: auto;\n }\n }\n\n .HeaderPinnedMessage {\n flex-grow: 1;\n padding-top: 0;\n padding-bottom: 0;\n\n &::before {\n top: 0.125rem;\n bottom: 0.125rem;\n }\n\n .message-text {\n max-width: none;\n }\n }\n}\n\n.MiddleHeader {\n display: flex;\n align-items: center;\n width: 100%;\n box-shadow: 0 2px 2px var(--color-light-shadow);\n background: var(--color-background);\n padding: .5rem .8125rem .5rem 1.5rem;\n position: relative;\n z-index: var(--z-middle-header);\n\n @media (max-width: 600px) {\n padding: 0.5rem;\n position: relative;\n // Force rendering in the composite layer to fix the z-index rendering issue\n transform: translate3d(0, 0, 10px);\n transform-style: preserve-3d;\n }\n\n .Transition {\n width: 100%;\n // https://dfmcphee.com/flex-items-and-min-width-0/\n // https://stackoverflow.com/questions/36247140/why-dont-flex-items-shrink-past-content-size\n min-width: 0;\n\n > div {\n display: flex;\n align-items: center;\n width: 100%;\n }\n }\n\n .back-button {\n margin-left: -0.5rem;\n margin-right: 0.5rem;\n position: relative;\n\n @media (max-width: 600px) {\n margin-left: 0;\n }\n\n .unread-count {\n min-width: 1.25rem;\n height: 1.25rem;\n padding: 0 0.375rem;\n border-radius: 0.625rem;\n font-size: 0.75rem;\n line-height: 1.25rem;\n font-weight: 500;\n text-align: center;\n\n position: absolute;\n top: -0.25rem;\n right: -0.5rem;\n\n background: var(--color-gray);\n color: white;\n pointer-events: none;\n\n &.active {\n background: var(--color-primary);\n }\n }\n }\n\n .chat-info-wrapper {\n flex-grow: 1;\n overflow: hidden;\n }\n\n .header-tools {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-left: auto;\n flex-shrink: 0;\n\n body.animation-level-0 & {\n &,\n .HeaderPinnedMessage-wrapper,\n .AudioPlayer,\n .HeaderActions {\n transition: none !important;\n }\n }\n\n @media (min-width: 1276px) and (max-width: 1439px) {\n .HeaderActions {\n transform: translate3d(0, 0, 0);\n transition: transform var(--layer-transition);\n\n #Main.right-column-open & {\n transform: translate3d(calc(var(--right-column-width) * -1), 0, 0);\n }\n }\n }\n\n @media (min-width: 1440px) {\n transform: translate3d(0, 0, 0);\n transition: transform var(--layer-transition);\n\n #Main.right-column-open & {\n transform: translate3d(calc(var(--right-column-width) * -1), 0, 0);\n }\n }\n\n // @optimization\n @include while-transition() {\n pointer-events: none;\n }\n }\n\n @media (min-width: 1276px) and (max-width: 1439px) {\n &:not(.tools-stacked) .header-tools {\n .HeaderPinnedMessage-wrapper,\n .AudioPlayer {\n opacity: 1;\n\n #Main.right-column-open & {\n opacity: 0;\n }\n }\n }\n }\n\n &.tools-stacked .header-tools {\n @include mobile-header-styles();\n\n @media (min-width: 1150px) {\n #Main.right-column-open & {\n .HeaderPinnedMessage-wrapper,\n .AudioPlayer {\n padding-right: calc(0.5rem + var(--right-column-width));\n }\n }\n }\n }\n\n &.tools-stacked.animated .header-tools {\n .HeaderPinnedMessage-wrapper,\n .AudioPlayer {\n animation: fade-in var(--layer-transition) forwards;\n\n body.animation-level-0 & {\n animation: none;\n }\n }\n }\n\n h3 {\n font-weight: 500;\n font-size: 1.125rem;\n line-height: 1.375rem;\n white-space: pre;\n margin: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n unicode-bidi: plaintext;\n\n body.is-ios &,\n body.is-macos & {\n font-size: 1.0625rem;\n font-weight: 600;\n }\n\n @media (max-width: 600px) {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n @media (min-width: 1275px) {\n #Main.right-column-open & {\n max-width: calc(100% - var(--right-column-width));\n }\n }\n }\n\n .ChatInfo {\n cursor: pointer;\n display: flex;\n align-items: center;\n\n .info {\n display: flex;\n flex-direction: column;\n justify-content: center;\n flex-grow: 1;\n overflow: hidden;\n }\n\n .title {\n display: flex;\n align-items: center;\n\n .VerifiedIcon {\n width: 1.25rem;\n height: 1.25rem;\n margin-left: 0.25rem;\n margin-top: 0.05rem;\n }\n }\n\n .user-status, .status {\n unicode-bidi: plaintext;\n }\n }\n\n .Avatar {\n margin-right: .625rem;\n width: 2.5rem;\n height: 2.5rem;\n font-size: 1.0625rem;\n }\n\n .status, .typing-status {\n font-size: 0.875rem;\n line-height: 1.125rem;\n margin: 0;\n color: var(--color-text-secondary);\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n display: inline-block;\n\n .ellipsis {\n display: inline-flex;\n }\n\n &.online {\n color: var(--color-primary);\n }\n\n .font-emoji {\n line-height: 1rem;\n }\n }\n\n .Button.smaller {\n width: 2.5rem;\n height: 2.5rem;\n }\n\n .HeaderPinnedMessage-wrapper {\n display: flex;\n align-items: center;\n margin-left: auto;\n cursor: default;\n flex-direction: row-reverse;\n\n body.animation-level-1 & {\n .ripple-container {\n display: none;\n }\n }\n\n .HeaderPinnedMessage {\n min-width: 16rem;\n }\n\n > .Button {\n flex-shrink: 0;\n }\n }\n\n .HeaderPinnedMessage {\n display: flex;\n flex-shrink: 1;\n margin-top: -0.25rem;\n margin-bottom: -0.25rem;\n padding: 0.25rem;\n padding-left: 0.375rem;\n border-radius: var(--border-radius-messages-small);\n position: relative;\n overflow: hidden;\n cursor: pointer;\n\n &:hover {\n background-color: var(--color-interactive-element-hover);\n }\n\n .pinned-message-border {\n position: relative;\n height: 2.25rem;\n margin: 0.125rem 0;\n width: 0.125rem;\n min-width: 0.125rem;\n overflow: hidden;\n\n .pinned-message-border-wrapper-1 {\n height: 2.25rem;\n width: 0.125rem;\n border-radius: 0.0625rem;\n background: var(--color-primary);\n }\n\n .pinned-message-border-wrapper {\n background-color: var(--color-primary-opacity);\n position: relative;\n will-change: transform;\n transition: transform .25s ease-in-out;\n }\n\n .pinned-message-border-mark {\n position: absolute;\n left: 0;\n top: 0;\n width: 0.125rem;\n background: var(--color-primary);\n border-radius: 0.0625rem;\n will-change: transform;\n transition: transform .25s ease-in-out;\n }\n }\n\n .message-text {\n overflow: hidden;\n margin-inline-start: 0.375rem;\n margin-top: 0.125rem;\n max-width: 15rem;\n\n @media (min-width: 1440px) and (max-width: 1500px) {\n max-width: 14rem;\n }\n\n .title {\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1rem;\n height: 1rem;\n color: var(--color-primary);\n margin-bottom: 0.125rem;\n white-space: pre;\n text-align: initial;\n\n body.is-ios & {\n font-size: .9375rem;\n }\n }\n\n p {\n font-size: 0.875rem;\n line-height: 1.125rem;\n height: 1.125rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0;\n\n body.is-ios & {\n font-size: .9375rem;\n }\n }\n }\n\n .emoji-small {\n width: 1rem;\n height: 1rem;\n }\n\n & > img {\n width: 2.25rem;\n height: 2.25rem;\n object-fit: cover;\n border-radius: 0.25rem;\n margin-inline-start: 0.375rem;\n margin-top: 0.125rem;\n flex-shrink: 0;\n\n & + .message-text {\n max-width: 12rem;\n }\n }\n }\n\n .HeaderActions {\n flex-shrink: 0;\n margin-left: auto;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n\n .toggle-right-pane-button {\n &.active {\n color: var(--color-primary);\n opacity: 1;\n }\n }\n }\n\n .HeaderPinnedMessage-wrapper, .HeaderActions {\n .Button {\n margin-left: 0.25rem;\n\n &.tiny {\n margin-right: .625rem;\n }\n }\n }\n\n @media (max-width: 600px) {\n @include mobile-header-styles();\n\n .HeaderPinnedMessage-wrapper,\n .AudioPlayer {\n // Force rendering in the composite layer to fix the z-index rendering issue\n transform: translate3d(0, 0, 0);\n }\n }\n\n @media (min-width: 925px) and (max-width: 1149.9px) {\n .HeaderPinnedMessage-wrapper,\n .AudioPlayer {\n position: absolute;\n }\n }\n}\n\n@keyframes fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n",".EmbeddedMessage {\n display: flex;\n align-items: center;\n font-size: calc(var(--message-text-size, 1rem) - .125rem);\n line-height: 1.125rem;\n margin: 0 -0.25rem .0625rem;\n padding: .1875rem 0.25rem .1875rem .4375rem;\n border-radius: var(--border-radius-messages-small);\n position: relative;\n overflow: hidden;\n cursor: pointer;\n direction: ltr;\n\n body.animation-level-1 & {\n .ripple-container {\n display: none;\n }\n }\n\n .custom-shape & {\n max-width: 15rem;\n padding: 0.5rem;\n margin: 0;\n background-color: var(--background-color);\n box-shadow: 0 1px 2px var(--color-default-shadow);\n\n &::before {\n left: .625rem;\n top: .625rem;\n bottom: .625rem;\n }\n\n img:not(.emoji) {\n margin-inline-start: .5rem;\n }\n\n &:dir(rtl) {\n padding: 0.5rem;\n }\n }\n\n &::before {\n content: '';\n display: block;\n position: absolute;\n top: .3125rem;\n bottom: .3125rem;\n left: .3125rem;\n width: 2px;\n background: var(--accent-color);\n border-radius: 2px;\n }\n\n &:hover {\n background-color: var(--hover-color);\n }\n\n &:active {\n background-color: var(--active-color);\n }\n\n .message-title {\n font-size: calc(var(--message-text-size, 1rem) - .125rem);\n }\n\n .message-text {\n overflow: hidden;\n margin-inline-start: 0.5rem;\n display: flex;\n flex-direction: column-reverse;\n\n .message-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 0.125rem;\n flex: 1;\n display: block;\n }\n\n p {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n height: 1.125rem;\n margin-bottom: 0;\n flex: 1;\n\n &::after {\n content: none;\n display: none;\n }\n }\n\n .emoji {\n width: calc(1.125 * var(--message-text-size, 1rem)) !important;\n height: calc(1.125 * var(--message-text-size, 1rem)) !important;\n vertical-align: text-bottom !important;\n }\n }\n\n .embedded-action-message {\n color: var(--accent-color);\n opacity: 0.75;\n }\n\n img:not(.emoji) {\n width: 2rem;\n height: 2rem;\n object-fit: cover;\n border-radius: .25rem;\n margin-left: .25rem;\n flex-shrink: 0;\n\n &.round {\n border-radius: 1rem;\n }\n }\n\n &.inside-input {\n padding-inline-start: 0.5625rem;\n margin: 0 0 -.125rem -0.1875rem;\n display: grid;\n grid-template-columns: auto 1fr;\n grid-template-rows: 1fr;\n width: 100%;\n --accent-color: var(--color-primary);\n --hover-color: var(--color-interactive-element-hover);\n\n &::before {\n bottom: .3125rem;\n }\n\n img:not(.emoji) {\n margin-left: .125rem;\n }\n\n .message-text {\n margin-inline-start: .375rem;\n }\n\n .message-title {\n font-weight: 500;\n color: var(--accent-color);\n }\n }\n}\n",".MessageMeta {\n position: absolute;\n height: 1.25rem;\n bottom: 0;\n right: 0;\n display: flex;\n align-items: center;\n background: rgba(#999999, 0.6);\n border-radius: .625rem;\n padding: 0 .25rem;\n color: white;\n cursor: pointer;\n max-width: 100%;\n\n .message-time,\n .message-signature,\n .message-views {\n font-size: .75rem;\n white-space: nowrap;\n }\n\n .message-time {\n margin-right: .1875rem;\n }\n\n .message-views {\n margin-left: .1875rem;\n }\n\n .message-signature {\n overflow: hidden;\n text-overflow: ellipsis;\n margin-right: 0.375rem;\n }\n\n .icon-channelviews {\n margin-left: 0.125rem;\n margin-right: 0.375rem;\n font-size: 1.125rem;\n position: relative;\n top: -0.0625rem;\n }\n\n .has-solid-background & {\n color: rgba(var(--color-text-meta-rgb), 0.75);\n background: none;\n }\n\n .media:not(.text) &,\n .Message .custom-shape & {\n background: rgba(0,0,0, 0.2);\n --color-accent-own: white;\n --color-accent: white;\n color: white !important;\n opacity: 1;\n bottom: .25rem;\n right: .25rem;\n left: auto;\n height: 1.125rem;\n padding: 0 .3125rem 0 .375rem;\n\n .MessageOutgoingStatus i {\n background: transparent;\n }\n }\n\n .media:not(.text):dir(rtl) &,\n .Message .custom-shape:dir(rtl) & {\n right: auto !important;\n left: .25rem;\n padding: 0 .375rem 0 .3125rem;\n }\n\n .is-forwarded.media:not(.text):dir(rtl) &,\n .Message .is-forwarded.custom-shape:dir(rtl) & {\n left: .8125rem;\n }\n\n .is-forwarded.media:not(.text) & {\n bottom: 0.935rem;\n right: 0.8125rem;\n }\n\n .emoji-only & {\n right: 0;\n }\n\n .Message.own .has-solid-background & {\n color: var(--color-message-meta-own);\n }\n\n .MessageOutgoingStatus {\n margin-left: -.1875rem;\n font-size: 1.1875rem;\n border-radius: .625rem;\n\n .Message.own & {\n color: var(--color-accent-own);\n }\n }\n\n .message-content.has-replies:not(.custom-shape) & {\n bottom: 3.375rem;\n }\n\n .message-content.has-replies.text:not(.custom-shape) & {\n bottom: 3.4375rem;\n }\n}\n\n.Message:not(.own) {\n .custom-shape .reply-message + .MessageMeta {\n right: auto;\n left: 13.2rem;\n bottom: 0.25rem;\n }\n\n .emoji-only-1 .reply-message + .MessageMeta {\n left: 2.5rem;\n }\n\n .emoji-only-2 .reply-message + .MessageMeta {\n left: 5.5rem;\n }\n\n .emoji-only-3 .reply-message + .MessageMeta {\n left: 6.5rem;\n }\n}\n",".Sticker {\n &:not(.inactive) {\n cursor: pointer;\n }\n\n &.inactive {\n pointer-events: none;\n }\n}\n",".Contact {\n display: flex;\n align-items: center;\n padding: 0.25rem;\n\n &.interactive {\n cursor: pointer;\n }\n\n .Avatar {\n margin-right: 0.8rem;\n }\n\n .contact-info {\n padding: 0.5rem;\n padding-left: 0;\n white-space: nowrap;\n overflow: hidden;\n\n .contact-name {\n font-size: 1rem;\n line-height: 1rem;\n margin-bottom: 0.25rem;\n font-weight: 500;\n }\n\n .contact-phone {\n line-height: 1rem;\n color: var(--secondary-color);\n }\n }\n}\n\n\n",".PollOption {\n display: flex;\n flex-flow: row nowrap;\n margin-bottom: 0.75rem;\n\n &:last-child {\n margin-bottom: 0;\n }\n\n .poll-option-text {\n word-break: break-word;\n }\n\n .poll-option-share {\n position: relative;\n margin-top: .125rem;\n width: 1.75rem;\n margin-inline-end: .5rem;\n flex-shrink: 0;\n font-weight: 500;\n font-size: .875rem;\n text-align: right;\n\n &.limit-width {\n display: inline-flex;\n justify-content: center;\n font-size: .75rem;\n }\n }\n\n .poll-option-chosen {\n position: absolute;\n right: 0;\n bottom: -5px;\n width: 1rem;\n height: 1rem;\n background: var(--accent-color);\n color: var(--background-color);\n border-radius: .5rem;\n font-size: .75rem;\n text-align: center;\n\n &.wrong {\n background: var(--color-error);\n }\n\n .is-forwarded & > i {\n margin-left: 1px;\n }\n\n &.animate {\n opacity: 0;\n animation-name: PollOptionIconAnimate;\n animation-delay: .09s;\n animation-duration: .3s;\n animation-fill-mode: forwards;\n }\n }\n\n .poll-option-right {\n flex-grow: 1;\n }\n\n .poll-option-answer {\n position: relative;\n }\n\n .poll-option-line {\n position: relative;\n width: 0;\n height: 0.25rem;\n min-width: 0.5rem;\n border-radius: 0.125rem;\n margin-top: 0.5rem;\n background: var(--accent-color);\n\n transform-origin: 0 0;\n transition: transform .3s;\n transition-delay: .09s;\n\n }\n\n .poll-line {\n width: 30px;\n height: 35px;\n position: absolute;\n left: -27px;\n bottom: -5px;\n transition: stroke-dashoffset .3s, stroke-dasharray .3s;\n stroke-dashoffset: 0;\n stroke-dasharray: 0, 200%\n }\n\n .poll-line path {\n stroke-width: 4px;\n stroke-linecap: round;\n stroke: var(--accent-color);\n fill:none\n }\n\n .wrong {\n .poll-option-line {\n background: var(--color-error);\n }\n\n .poll-line path {\n stroke: var(--color-error);\n }\n }\n}\n\n@keyframes PollOptionIconAnimate {\n 0% { opacity: 0 }\n 100% { opacity: 1 }\n}\n",".Poll {\n min-width: 15rem;\n text-align: initial;\n\n @media (max-width: 600px) {\n min-width: 50vw;\n }\n\n .poll-question {\n font-weight: 500;\n line-height: 1.25rem;\n margin: 0.125rem 0;\n word-break: break-word;\n }\n\n .poll-type,\n .poll-voters-count {\n color: var(--secondary-color);\n font-size: 0.875rem;\n }\n\n .poll-type {\n margin-bottom: 0.5rem;\n display: flex;\n align-items: center;\n min-height: 1.375rem;\n }\n\n .poll-voters-count {\n margin: .4375rem 0 .3125rem;\n text-align: center;\n }\n\n .poll-answers {\n padding-top: 0.25rem;\n padding-bottom: 1rem;\n }\n\n .Checkbox,\n .Radio {\n padding-left: 2.25rem;\n\n &:last-child {\n margin-bottom: .75rem;\n }\n\n &.disabled {\n opacity: 1 !important;\n cursor: not-allowed;\n }\n\n .Checkbox-main,\n .Radio-main {\n &::before {\n left: 0.125rem;\n background-color: var(--background-color);\n\n .theme-dark & {\n --color-borders: var(--color-borders-input);\n }\n\n .Message.own & {\n --color-borders: var(--accent-color);\n }\n }\n\n &::after {\n left: 0.4375rem;\n background-color: var(--accent-color);\n }\n }\n\n input:checked ~ .Radio-main,\n input:checked ~ .Checkbox-main {\n &::before {\n border-color: var(--accent-color);\n }\n }\n\n .Spinner {\n left: 0.125rem;\n }\n }\n\n .Checkbox {\n .Checkbox-main {\n &::after {\n left: 0.125rem;\n background-color: var(--color-primary);\n\n .Message.own & {\n background-color: var(--accent-color);\n }\n }\n }\n }\n\n .Spinner > div {\n // gray spinner\n background-image: var(--spinner-gray-data);\n\n .theme-dark & {\n background-image: var(--spinner-white-data);\n }\n\n .Message.own & {\n // green spinner\n background-image: var(--spinner-green-data);\n .theme-dark & {\n background-image: var(--spinner-white-data);\n }\n }\n }\n\n .poll-recent-voters {\n display: inline-flex;\n align-items: center;\n vertical-align: text-bottom;\n margin-left: .875rem;\n margin-right: .5rem;\n margin-top: -2px;\n\n .Avatar {\n border: 1px solid var(--color-white);\n margin-right: 0;\n box-sizing: content-box;\n\n &:not(:first-child) {\n margin-left: -3px;\n }\n }\n }\n\n .poll-countdown {\n margin-left: auto;\n font-size: .75rem;\n transition: color .2s;\n\n &.hurry-up {\n color: var(--color-error);\n\n .poll-countdown-progress {\n stroke: var(--color-error);\n }\n }\n\n svg {\n vertical-align: -3px;\n }\n }\n\n .poll-countdown-progress {\n stroke: var(--color-primary);\n fill: transparent;\n stroke-width: 2;\n stroke-linecap: round;\n transition: stroke-dashoffset 2s, stroke .2s;\n }\n\n .poll-quiz-help {\n margin: -.625rem 0 -.625rem auto;\n .Message:not(.own) & {\n color: var(--color-primary);\n }\n }\n\n .poll-results,\n .poll-answers {\n padding-top: 0.25rem;\n padding-bottom: 0.5rem;\n }\n\n .Button {\n text-transform: none;\n font-size: 1rem;\n\n .Message.own & {\n color: var(--accent-color);\n --color-primary-shade-rgb: var(--color-accent-own);\n }\n }\n\n > .Button {\n margin-top: -.125rem;\n margin-bottom: -.0625rem;\n }\n}\n",".WebPage {\n margin-top: 0.25rem;\n margin-bottom: 0.125rem;\n padding-left: .625rem;\n font-size: calc(var(--message-text-size, 1rem) - .125rem);\n line-height: 1.125rem;\n max-width: 29rem;\n position: relative;\n\n &::before {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: .125rem;\n background: var(--accent-color);\n border-radius: .125rem;\n }\n\n &-text {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n }\n\n .media-inner {\n margin: 0 !important;\n margin-bottom: 0.375rem !important;\n\n &, & img, &.small-image img {\n border-radius: var(--border-radius-messages-small) !important;\n }\n\n &.square-image {\n width: 5rem;\n height: 5rem;\n min-height: 0;\n margin-bottom: 0 !important;\n\n img {\n width: 100%;\n height: 100%;\n }\n }\n }\n\n &.with-video .media-inner{\n margin-top: 0.5rem !important;\n margin-bottom: 1rem !important;\n }\n\n &.with-square-photo {\n display: flex;\n margin-bottom: 1rem;\n\n .WebPage-text {\n order: 1;\n padding-right: 1rem;\n }\n\n .media-inner {\n order: 2;\n flex-shrink: 0;\n }\n\n &:dir(rtl) {\n .WebPage-text {\n padding-inline-end: 1rem;\n }\n }\n }\n\n &:not(.with-square-photo) {\n .site-name,\n .site-title,\n .site-description {\n &:last-child::after {\n content: '';\n display: inline-block;\n width: var(--meta-safe-area-size);\n height: 0.75rem;\n float: right;\n }\n }\n }\n\n .site-name,\n .site-description,\n .site-title {\n word-break: break-word;\n max-width: 100%;\n }\n\n .site-name {\n color: var(--accent-color);\n font-weight: 500;\n margin-bottom: 0.125rem;\n }\n\n .site-title {\n font-weight: 500;\n margin-bottom: 0.125rem;\n }\n\n .site-description {\n line-height: 1.25;\n margin-bottom: 0;\n\n body.is-ios & {\n line-height: 1.125rem;\n }\n }\n\n &:dir(rtl) {\n padding-inline-start: .625rem;\n\n &::before {\n left: auto;\n right: 0;\n }\n }\n}\n\n\n",".Invoice {\n .title {\n color: var(--accent-color);\n font-weight: 500;\n }\n\n .description {\n position: relative;\n\n &.has-image {\n .invoice-image {\n max-width: 100%;\n height: 20rem;\n\n @media (max-width: 600px) {\n height: 10rem;\n }\n }\n\n .description-text {\n position: absolute;\n top: 0;\n padding: .25rem .5rem;\n margin: .25rem;\n background-color: rgba(90, 110, 70, 0.6);\n border-radius: var(--border-radius-messages-small);\n color: var(--color-text);\n font-weight: 500;\n\n span {\n margin-left: .5rem;\n }\n }\n }\n\n }\n}\n",".Album {\n position: relative;\n overflow: hidden;\n\n .message-content.media.text & {\n margin: -0.3125rem -0.5rem 0.3125rem;\n }\n\n .forwarded-message & {\n margin-bottom: .125rem;\n\n .message-content.media.text & {\n margin: 0 0 0.3125rem;\n --border-bottom-left-radius: inherit;\n --border-bottom-right-radius: inherit;\n }\n }\n\n &,\n .message-content.media.text & {\n > .album-item-select-wrapper .media-inner {\n margin: 0 !important;\n }\n }\n\n > .album-item-select-wrapper .media-inner {\n &, & img, & video {\n border-radius: 0 !important;\n object-fit: cover;\n }\n }\n}\n",".RoundVideo {\n position: relative;\n width: 200px;\n height: 200px;\n cursor: pointer;\n\n .thumbnail-wrapper {\n width: 200px;\n height: 200px;\n border-radius: 50%;\n overflow: hidden;\n }\n\n .video-wrapper {\n position: absolute;\n left: 0;\n top: 0;\n border-radius: 50%;\n overflow: hidden;\n }\n\n .progress {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n }\n\n .progress-circle {\n stroke: white;\n fill: transparent;\n stroke-width: 4;\n stroke-opacity: .35;\n stroke-linecap: round;\n }\n\n video::-internal-media-controls-cast-button,\n video::-webkit-media-controls,\n video::-webkit-media-controls-start-playback-button {\n display: none;\n }\n}\n",".InlineButtons {\n display: flex;\n flex-direction: column;\n\n .row {\n display: flex;\n flex-direction: row;\n }\n\n .Button {\n flex: 1;\n width: auto;\n margin: 0.125rem;\n background: var(--pattern-color);\n border-radius: var(--border-radius-messages-small);\n font-weight: 500;\n text-transform: none;\n\n &::before {\n content: '';\n background-color: var(--color-white);\n opacity: 0;\n\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: var(--border-radius-messages-small);\n z-index: var(--z-below);\n transition: opacity 200ms;\n }\n\n &:hover {\n background: var(--pattern-color) !important;\n\n &::before {\n opacity: .4;\n }\n }\n\n &:first-of-type {\n margin-left: 0;\n }\n\n &:last-of-type {\n margin-right: 0;\n }\n\n i {\n font-size: .875rem;\n position: absolute;\n right: .1875rem;\n top: .1875rem;\n display: block;\n\n &.icon-arrow-right {\n font-size: .75rem;\n top: .125rem;\n right: .125rem;\n transform: rotate(-45deg);\n }\n }\n }\n\n .row:first-of-type .Button {\n margin-top: 0.25rem !important;\n }\n\n .row:last-of-type .Button {\n margin-bottom: 0;\n\n &:first-of-type {\n border-bottom-left-radius: var(--border-radius-messages);\n }\n\n &:last-of-type {\n border-bottom-right-radius: var(--border-radius-messages);\n }\n }\n}\n",".CommentButton {\n --background-color: var(--color-background);\n --hover-color: var(--color-chat-hover);\n\n display: flex;\n width: 100%;\n align-items: center;\n padding: .5625rem .25rem .5625rem .625rem;\n padding-inline-start: .625rem;\n padding-inline-end: .25rem;\n background: var(--background-color);\n border-bottom-right-radius: var(--border-bottom-right-radius);\n border-bottom-left-radius: var(--border-bottom-left-radius);\n font-size: .9375rem;\n font-weight: 500;\n line-height: 2rem;\n color: var(--accent-color);\n white-space: nowrap;\n cursor: pointer;\n transition: background-color .15s, color .15s;\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n .Message .has-appendix &::before {\n content: '';\n display: block;\n position: absolute;\n bottom: -.1875rem;\n left: -.5625rem;\n width: .5625rem;\n height: 1.25rem;\n background-position: bottom left;\n background-image: url('data:image/svg+xml,%3Csvg width=\"9\" height=\"20\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"%3E%3Cdefs%3E%3Cfilter x=\"-50%25\" y=\"-14.7%25\" width=\"200%25\" height=\"141.2%25\" filterUnits=\"objectBoundingBox\" id=\"a\"%3E%3CfeOffset dy=\"1\" in=\"SourceAlpha\" result=\"shadowOffsetOuter1\"/%3E%3CfeGaussianBlur stdDeviation=\"1\" in=\"shadowOffsetOuter1\" result=\"shadowBlurOuter1\"/%3E%3CfeColorMatrix 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\"/%3E%3C/filter%3E%3Cpath d=\"M3 17h6V0c-.193 2.84-.876 5.767-2.05 8.782-.904 2.325-2.446 4.485-4.625 6.48A1 1 0 003 17z\" id=\"b\"/%3E%3C/defs%3E%3Cg fill=\"none\" fill-rule=\"evenodd\"%3E%3Cuse fill=\"%23000\" filter=\"url(%23a)\" xlink:href=\"%23b\"/%3E%3Cuse fill=\"%23FFF\" xlink:href=\"%23b\"/%3E%3C/g%3E%3C/svg%3E');\n opacity: 0;\n transition: opacity .15s, filter .15s;\n\n .theme-dark #root & {\n filter: invert(.83);\n }\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n .custom-shape & {\n position: absolute;\n right: -3rem;\n width: 2.25rem;\n bottom: 3rem;\n height: 3.375rem;\n border-radius: 1.375rem;\n padding: 0.375rem .3125rem .25rem;\n align-items: flex-start;\n color: white;\n background-color: rgba(0, 0, 0, .2);\n\n opacity: 0;\n transition: opacity .2s ease;\n\n @media (pointer: coarse) {\n opacity: 1 !important;\n }\n\n &:hover {\n background-color: rgba(0, 0, 0, .28);\n }\n\n .Message:hover & {\n opacity: 1;\n }\n\n &::after {\n content: attr(data-cnt);\n position: absolute;\n bottom: -.0625rem;\n left: 0;\n width: 100%;\n text-align: center;\n font-size: 12px;\n display: block;\n }\n\n &[data-cnt=\"0\"] {\n height: 2.25rem;\n &::after {\n display: none;\n }\n }\n\n .icon-comments-sticker {\n display: block;\n font-size: 1.5rem;\n margin: 0 auto;\n }\n\n .recent-repliers,\n .icon-comments,\n .label,\n .icon-next {\n display: none;\n }\n }\n\n &:hover {\n background: var(--hover-color);\n\n .Message .has-appendix &::before {\n opacity: 1;\n }\n\n .Avatar {\n border-color: var(--hover-color) !important;\n }\n }\n\n .is-forwarded &,\n .audio &,\n .voice &,\n .poll &,\n .text & {\n border-top: 1px solid var(--color-borders);\n }\n\n .message-content.has-solid-background & {\n margin: .375rem -.5rem -.375rem;\n }\n\n .message-content.voice & {\n margin-bottom: -.5rem;\n }\n\n .message-content.audio & {\n margin-bottom: -.8125rem;\n }\n\n .message-content.audio &,\n .message-content.voice &,\n .message-content.poll &,\n .message-content.has-solid-background.text &,\n .message-content.has-solid-background.is-forwarded & {\n width: calc(100% + 1rem);\n }\n\n .icon-comments-sticker {\n display: none;\n }\n\n .icon-comments {\n font-size: 1.5625rem;\n line-height: 2rem;\n margin-inline-end: .875rem;\n }\n\n .icon-next {\n margin-inline-start: auto;\n font-size: 1.5rem;\n }\n\n .recent-repliers {\n display: inline-flex;\n align-items: center;\n margin-inline-end: .5rem;\n margin-inline-start: -.125rem;\n\n .Avatar {\n transition: border .15s;\n border: 2px solid var(--color-background);\n margin-inline-end: 0;\n z-index: 3;\n overflow: hidden;\n\n .emoji {\n width: 1rem;\n background-size: 1rem;\n }\n\n + .Avatar {\n z-index: 2;\n\n + .Avatar {\n z-index: 1;\n }\n }\n\n &:not(:first-child) {\n margin-inline-start: -.75rem;\n }\n }\n }\n\n &.has-unread .label {\n position: relative;\n\n &::after {\n content: '';\n display: inline-block;\n width: .5rem;\n height: .5rem;\n border-radius: 50%;\n background: var(--accent-color);\n margin-inline-start: \t.75rem;\n }\n }\n\n &.disabled {\n cursor: default;\n pointer-events: none;\n }\n}\n","// General styles\n.Message {\n display: flex;\n align-items: flex-end;\n margin-bottom: 0.375rem;\n position: relative;\n\n --background-color: var(--color-background);\n --hover-color: var(--color-reply-hover);\n --active-color: var(--color-reply-active);\n --max-width: 29rem;\n --accent-color: var(--color-primary);\n --accent-shade-color: var(--color-primary-shade);\n --secondary-color: var(--color-text-secondary);\n --meta-safe-area-base: 2.25rem;\n --meta-safe-author-width: 0px;\n --meta-safe-area-extra-width: 0px;\n --meta-safe-area-size: calc(var(--meta-safe-area-base) + var(--meta-safe-author-width) + var(--meta-safe-area-extra-width));\n --deleting-translate-x: -50%;\n --select-message-scale: 0.9;\n --select-background-color: white;\n\n &.is-swiped {\n transform: translateX(-2.5rem) !important;\n }\n\n > .Avatar,\n > .message-content-wrapper {\n opacity: 1;\n transform: scale(1) translateX(0);\n transition: transform var(--select-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n > .Avatar {\n position: absolute;\n bottom: 0;\n left: 0;\n\n @media (max-width: 600px) {\n width: 2.5rem;\n height: 2.5rem;\n }\n }\n\n &.last-in-group {\n margin-bottom: 0.625rem;\n }\n\n &.last-in-list {\n // Forcing extra space which is taken by the appendix and causes incorrect container height calculation.\n // This value is accurately crafted as a minimum possible.\n margin-bottom: 0.375rem;\n }\n\n &.is-in-selection-mode {\n .Album {\n border: 1px var(--select-background-color) solid;\n background-color: var(--select-background-color);\n }\n\n body.is-android & {\n .can-select-text {\n z-index: var(--z-message-select-control);\n }\n\n // Prevent media viewer from opening\n .media-inner {\n pointer-events: none;\n }\n }\n }\n\n &.has-inline-buttons {\n .message-content {\n border-bottom-right-radius: var(--border-radius-messages-small);\n }\n }\n\n &:not(.own) {\n padding-left: 2.5rem;\n\n .no-avatars &, &.is-thread-top {\n padding-left: 0;\n }\n\n @media (max-width: 600px) {\n padding-left: 2.875rem;\n\n .no-avatars &, &.is-thread-top {\n padding-left: 0.25rem;\n }\n }\n }\n\n &.own {\n flex-direction: row-reverse;\n --background-color: var(--color-background-own);\n --hover-color: var(--color-reply-own-hover);\n --active-color: var(--color-reply-own-active);\n --max-width: 30rem;\n --accent-color: var(--color-accent-own);\n --accent-shade-color: var(--color-green);\n --secondary-color: var(--color-accent-own);\n --color-code: var(--color-code-own);\n --color-code-bg: var(--color-code-own-bg);\n --color-links: var(--color-own-links);\n --color-links-hover: var(--color-own-links);\n --meta-safe-area-base: 3.5rem;\n --deleting-translate-x: 50%;\n --color-text-green: var(--color-accent-own);\n\n body.is-ios &,\n body.is-macos & {\n --color-background-own: var(--color-background-own-apple);\n --color-reply-own-hover: var(--color-reply-own-hover-apple);\n --color-reply-own-active: var(--color-reply-own-active-apple);\n }\n\n @media (max-width: 600px) {\n padding-right: 0.25rem;\n }\n }\n\n &.is-deleting {\n > .Avatar,\n > .message-content-wrapper {\n transition: opacity .2s ease, transform .2s ease-in;\n opacity: 0;\n transform: scale(0.3) translateX(var(--deleting-translate-x));\n transform-origin: bottom;\n }\n }\n\n &.has-views {\n --meta-safe-area-extra-width: 4rem;\n }\n\n &.was-edited {\n --meta-safe-area-extra-width: 2.5rem;\n\n &.has-views {\n --meta-safe-area-extra-width: 7.5rem;\n }\n\n html[lang=ru] & {\n --meta-safe-area-extra-width: 3.5rem;\n\n &.has-views {\n --meta-safe-area-extra-width: 8.5rem;\n }\n }\n }\n\n .select-mode-active & {\n cursor: pointer;\n\n @media (min-width: 600px) {\n user-select: none;\n }\n\n &:not(.own) {\n > .Avatar,\n > .message-content-wrapper {\n transform: translateX(2.5rem);\n }\n }\n\n &:not(.is-album)::after {\n content: \"\";\n position: absolute;\n top: -0.25rem;\n bottom: -0.25rem;\n left: -4rem;\n right: -4rem;\n z-index: var(--z-message-select-area);\n }\n\n &.is-album,\n &.is-in-document-group {\n .message-select-control {\n pointer-events: unset;\n }\n }\n\n .message-select-control {\n opacity: 1;\n }\n }\n\n &.is-selected {\n .message-select-control {\n background: var(--color-green);\n\n &.group-select {\n background: transparent;\n\n &.is-selected {\n background: var(--color-green);\n }\n }\n }\n }\n\n .File.file-is-selected {\n .message-select-control {\n background: var(--color-green);\n }\n }\n\n &.is-in-document-group .File.file-is-selected .file-icon,\n &.has-menu-open.is-in-document-group .File .file-icon {\n --background-color: var(--color-background-selected);\n }\n\n &.own.is-in-document-group .File.file-is-selected .file-icon,\n &.own.has-menu-open.is-in-document-group .File .file-icon {\n --background-color: var(--color-background-own-selected);\n }\n\n .Audio .message-select-control {\n left: 1.0625rem;\n top: 1.375rem;\n }\n\n html.theme-dark &.own .Audio .ProgressSpinner {\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTguMjE4IDcuNWw1LjYzMy01LjYzM2EuNTA4LjUwOCAwIDEwLS43MTgtLjcxOEw3LjUgNi43ODIgMS44NjcgMS4xNDlhLjUwOC41MDggMCAxMC0uNzE4LjcxOEw2Ljc4MiA3LjVsLTUuNjMzIDUuNjMzYS41MDguNTA4IDAgMTAuNzE4LjcxOEw3LjUgOC4yMThsNS42MzMgNS42MzNhLjUwNi41MDYgMCAwMC43MTggMCAuNTA4LjUwOCAwIDAwMC0uNzE4TDguMjE4IDcuNXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjODA3QkQ1IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+);\n background-position: center;\n background-size: 1rem;\n\n circle {\n stroke: var(--background-color);\n }\n }\n\n\n .File {\n position: relative;\n\n .message-select-control {\n position: absolute;\n top: 2rem;\n left: 2rem;\n z-index: 2;\n }\n }\n\n .album-item-select-wrapper {\n .Message.own & {\n background: var(--color-background-own);\n }\n\n .message-select-control {\n position: absolute;\n top: 0.438rem;\n right: 0.438rem;\n left: unset;\n }\n\n .media-inner {\n border: 0 var(--select-background-color) solid;\n transition: border-width var(--select-transition);\n }\n\n img, video {\n transition: transform var(--select-transition), opacity ease 300ms;\n }\n\n &.is-selected {\n .message-select-control {\n background: var(--color-green);\n }\n\n img, video {\n transform: scale(var(--select-message-scale));\n }\n }\n\n }\n\n &.is-selected, &.is-forwarding {\n .message-select-control {\n background: var(--color-green);\n }\n\n .Menu .bubble {\n transition: none !important;\n }\n }\n\n &.is-in-document-group {\n &:not(.first-in-document-group) {\n &::before {\n top: 0 !important;\n }\n\n .message-content {\n box-shadow: none;\n border-top-left-radius: 0 !important;\n border-top-right-radius: 0 !important;\n }\n\n .forwarded-message::before {\n top: -1.5rem;\n }\n }\n\n &:not(.last-in-document-group) {\n margin-bottom: 0;\n\n &::before {\n bottom: 0 !important;\n }\n\n .message-content {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n }\n\n &.is-in-selection-mode {\n .Audio:not(.audio-is-selected),\n .File:not(.file-is-selected) {\n .message-select-control:not(.group-select) {\n background: white;\n\n &::after {\n content: '';\n width: 1.25rem;\n height: 1.25rem;\n border-radius: 0.688rem;\n background: white;\n border: 0.125rem rgba(0, 0, 0, 0.2) solid;\n position: absolute;\n }\n }\n }\n\n &.own {\n .message-content {\n .Audio:not(.audio-is-selected),\n .File:not(.file-is-selected) {\n .message-select-control:not(.group-select) {\n background: var(--background-color);\n border-color: var(--background-color);\n\n &::after {\n background: var(--background-color);\n border-color: var(--color-message-meta-own);\n }\n }\n }\n }\n }\n\n }\n\n &.focused,\n &.has-menu-open,\n &.is-forwarding,\n &.is-selected {\n .message-content {\n background: var(--color-background-selected);\n }\n\n &.own {\n .message-content {\n --background-color: var(--color-background-own-selected);\n background: var(--color-background-own-selected);\n }\n }\n }\n\n .message-content-wrapper {\n width: 17.1875rem;\n }\n\n .message-content {\n transition: background-color var(--select-transition);\n }\n\n &.own {\n .message-content-wrapper {\n display: flex;\n justify-content: flex-end;\n\n .message-content {\n width: 100%;\n }\n }\n }\n }\n\n .album-item-select-wrapper {\n position: absolute;\n\n .message-select-control {\n position: absolute;\n z-index: 2;\n }\n }\n\n .message-select-control {\n position: absolute;\n left: 0;\n bottom: 0.25rem;\n width: 1.5rem;\n height: 1.5rem;\n border: 2px solid white;\n border-radius: 50%;\n z-index: var(--z-message-select-control);\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n color: white;\n font-size: 1rem;\n\n opacity: 0;\n pointer-events: none;\n transition: opacity var(--select-transition);\n\n .icon-select {\n position: absolute;\n left: -3px;\n top: -3px;\n font-size: 1.625rem;\n }\n\n .theme-dark & {\n border-color: #ffffff80;\n }\n }\n\n .Avatar {\n margin-right: 0.3rem;\n }\n\n &.is-in-document-group {\n .message-content.document {\n padding: .25rem .5rem !important;\n }\n\n &.last-in-document-group {\n .message-content.document {\n padding-bottom: .5rem !important\n }\n }\n\n &.first-in-document-group {\n .message-content.document {\n padding-top: .5rem !important\n }\n }\n }\n}\n\n// Border-radius styles\n.message-content,\n.Album,\n.media-inner,\n.message-content.media .media-inner img,\n.message-content.media .media-inner video,\n.message-content.custom-shape .media-inner img {\n border-top-left-radius: var(--border-top-left-radius);\n border-top-right-radius: var(--border-top-right-radius);\n border-bottom-left-radius: var(--border-bottom-left-radius);\n border-bottom-right-radius: var(--border-bottom-right-radius);\n}\n\n.media-inner video.full-media {\n background: transparent !important;\n}\n\n.media-inner {\n overflow: hidden;\n\n &.small-image img {\n border-radius: 0 !important;\n }\n}\n\n.Message {\n --border-top-left-radius: var(--border-radius-messages);\n --border-top-right-radius: var(--border-radius-messages);\n --border-bottom-left-radius: var(--border-radius-messages);\n --border-bottom-right-radius: var(--border-radius-messages);\n\n &:not(.own) {\n &.first-in-group:not(.last-in-group) {\n --border-bottom-left-radius: var(--border-radius-messages-small);\n }\n\n &:not(.first-in-group):not(.last-in-group) {\n --border-top-left-radius: var(--border-radius-messages-small);\n --border-bottom-left-radius: var(--border-radius-messages-small);\n }\n\n &.last-in-group:not(.first-in-group) {\n --border-top-left-radius: var(--border-radius-messages-small);\n }\n\n &.last-in-group {\n --border-bottom-left-radius: var(--border-radius-messages-small);\n\n .message-content.has-appendix {\n --border-bottom-left-radius: 0;\n }\n }\n }\n\n &.own {\n &.first-in-group:not(.last-in-group) {\n --border-bottom-right-radius: var(--border-radius-messages-small);\n }\n\n &:not(.first-in-group):not(.last-in-group) {\n --border-top-right-radius: var(--border-radius-messages-small);\n --border-bottom-right-radius: var(--border-radius-messages-small);\n }\n\n &.last-in-group:not(.first-in-group) {\n --border-top-right-radius: var(--border-radius-messages-small);\n }\n\n &.last-in-group {\n --border-bottom-right-radius: var(--border-radius-messages-small);\n\n .message-content.has-appendix {\n --border-bottom-right-radius: 0;\n }\n }\n }\n\n .message-content {\n &.has-replies:not(.custom-shape),\n &.text {\n .media-inner,\n .Album {\n --border-bottom-left-radius: 0;\n --border-bottom-right-radius: 0;\n }\n }\n\n &.is-reply .EmbeddedMessage {\n & + .Album,\n & + .Audio,\n & + .File {\n margin-top: .375rem;\n }\n }\n\n &:not(.custom-shape).is-reply .media-inner,\n &:not(.custom-shape).is-reply .Album,\n &:not(.custom-shape).force-sender-name .Album,\n &:not(.is-forwarded) .message-title ~ .media-inner {\n --border-top-left-radius: 0;\n --border-top-right-radius: 0;\n }\n\n &.is-forwarded .content-inner .message-title {\n margin-bottom: 0.25rem;\n }\n }\n\n .message-action-button {\n position: absolute;\n bottom: 0;\n color: white;\n background-color: rgba(0, 0, 0, .2);\n\n opacity: 0;\n transition: opacity .2s ease;\n\n @media (pointer: coarse) {\n opacity: 1 !important;\n }\n\n &:hover,\n &:active,\n &:focus {\n background-color: rgba(0, 0, 0, .28) !important;\n }\n }\n\n &:hover,\n &[data-is-document-group-hover] {\n .message-action-button {\n opacity: 1;\n }\n }\n\n &.own .message-action-button {\n left: -3rem;\n }\n\n &:not(.own) .message-action-button {\n right: -3rem;\n }\n\n .bottom-marker {\n height: 1px;\n width: 1px;\n visibility: hidden;\n }\n}\n\n.Message .custom-shape .message-action-button {\n bottom: .25rem;\n}\n\n@import 'message-content';\n",".message-content {\n position: relative;\n max-width: var(--max-width);\n\n @media (max-width: 600px) {\n max-width: calc(100vw - 6.25rem);\n\n .Message.own &,\n .MessageList.no-avatars & {\n max-width: calc(100vw - 3.75rem);\n }\n\n // Workaround for sass function override - we should use CSS min() here\n @supports (max-width: #{\"min(29rem, 100vw - 6.25rem)\"}) {\n max-width: #{\"min(29rem, 100vw - 6.25rem)\"};\n .MessageList.no-avatars & {\n max-width: #{\"min(29rem, 100vw - 3.75rem)\"};\n }\n .Message.own & {\n max-width: #{\"min(30rem, 100vw - 3.75rem)\"};\n }\n }\n\n &.has-action-button {\n max-width: calc(100vw - 7rem);\n\n .Message.own &,\n .MessageList.no-avatars & {\n max-width: calc(100vw - 4.5rem);\n }\n\n // Workaround for sass function override - we should use CSS min() here\n @supports (max-width: #{\"min(29rem, 100vw - 5.5rem)\"}) {\n max-width: #{\"min(29rem, 100vw - 7rem)\"};\n .MessageList.no-avatars & {\n max-width: #{\"min(29rem, 100vw - 4.5rem)\"};\n }\n .Message.own & {\n max-width: #{\"min(30rem, 100vw - 4.5rem)\"};\n }\n }\n }\n }\n\n img {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n }\n\n .text-content {\n margin: 0;\n word-break: break-word;\n line-height: 1.3125;\n text-align: initial;\n display: flow-root;\n unicode-bidi: plaintext;\n }\n\n .text-entity-link {\n unicode-bidi: plaintext;\n }\n\n &:not(.custom-shape) .text-content,\n &.document {\n & > .MessageMeta {\n position: relative;\n top: .375rem;\n bottom: auto !important;\n float: right;\n line-height: 1;\n height: calc(var(--message-meta-height, 1rem));\n margin-left: .4375rem;\n margin-right: -.5rem;\n\n .MessageOutgoingStatus .Transition {\n max-height: calc(var(--message-meta-height, 1rem));\n overflow: hidden;\n }\n\n html[data-message-text-size=\"12\"] & {\n top: .25rem;\n }\n\n html[data-message-text-size=\"17\"] & {\n top: .4375rem;\n }\n\n html[data-message-text-size=\"18\"] &,\n html[data-message-text-size=\"19\"] & {\n top: .5rem;\n }\n\n html[data-message-text-size=\"20\"] & {\n top: .5625rem;\n }\n }\n\n &:dir(rtl) {\n & > .MessageMeta {\n float: left;\n margin-left: -.25rem;\n margin-right: .4375rem;\n }\n }\n }\n\n &.document:not(.text) {\n &::after {\n content: \"\";\n display: block;\n clear: both;\n }\n\n & > .MessageMeta {\n top: auto !important;\n bottom: -.5rem !important;\n margin-top: -.25rem;\n\n &:not([dir=rtl]) {\n margin-top: -1.25rem;\n }\n }\n }\n\n .theme-dark .Message.own & {\n .text-entity-link {\n text-decoration: underline;\n\n &:hover {\n text-decoration: none;\n }\n }\n }\n\n &:not(.custom-shape) {\n font-size: var(--message-text-size, 1rem);\n\n body.is-ios & {\n font-size: var(--message-text-size, 1.0625rem);\n }\n\n & > .content-inner {\n min-width: 0;\n }\n }\n\n .matching-text-highlight {\n background: #CAE3F7;\n border-radius: 0.25rem;\n padding: 0 0.125rem;\n }\n\n .message-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: calc(var(--message-text-size, 1rem) - .125rem);\n font-weight: 500;\n line-height: 1.25rem;\n color: var(--accent-color);\n unicode-bidi: plaintext;\n display: flex;\n\n & > .interactive {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &.interactive, & > .interactive {\n cursor: pointer;\n\n &:hover {\n opacity: 0.85;\n }\n }\n\n & > .color-1 {\n color: var(--color-user-1);\n }\n\n & > .color-2 {\n color: var(--color-user-2);\n }\n\n & > .color-4 {\n color: var(--color-user-4);\n }\n\n & > .color-5 {\n color: var(--color-user-5);\n }\n\n & > .color-6 {\n color: var(--color-user-6);\n }\n\n & > .color-7 {\n color: var(--color-user-7);\n }\n\n & > .color-8 {\n color: var(--color-user-8);\n }\n\n .theme-dark .Message.own & > .color-1 {\n color: var(--accent-color);\n }\n\n & + .File {\n margin-top: .25rem;\n }\n\n .via {\n padding-right: .25rem;\n font-weight: 400;\n }\n\n span + .via {\n padding-left: .25rem;\n }\n\n .admin-title {\n flex: 1;\n margin-left: 1rem;\n text-align: right;\n font-weight: 400;\n font-size: 0.75rem;\n margin-top: -0.1rem;\n color: rgba(var(--color-text-meta-rgb), 0.75);\n\n .Message.own & {\n color: var(--accent-color);\n }\n }\n }\n\n &.has-shadow {\n box-shadow: 0 1px 2px var(--color-default-shadow);\n }\n\n &.has-solid-background, &.has-background, .is-album & {\n background: var(--background-color);\n }\n\n &.has-solid-background {\n padding: .3125rem .5rem .375rem;\n\n .forwarded-message > .text-content:not(.with-meta):last-child::after {\n content: '';\n display: inline-block;\n width: var(--meta-safe-area-size);\n height: 1rem;\n }\n }\n\n &:not(.has-appendix) .svg-appendix {\n display: none;\n }\n\n .svg-appendix {\n overflow: hidden;\n position: absolute;\n bottom: -.0625rem;\n width: .5625rem;\n height: 1.125rem;\n font-size: 1rem !important;\n\n .corner {\n fill: var(--background-color);\n }\n\n .Message.own & {\n right: -.551rem; // This value is correct. Safari fix\n }\n\n .Message:not(.own) & {\n left: -.562rem; // This value is correct. Safari fix\n }\n }\n\n &[data-has-custom-appendix] {\n .svg-appendix .corner {\n fill: var(--appendix-bg);\n }\n }\n\n &.has-appendix-thumb {\n .Message & {\n .svg-appendix {\n --background-color: #ccc;\n opacity: 1;\n transition: opacity 500ms ease;\n }\n }\n }\n\n &.document {\n padding: .5rem !important;\n\n .File {\n .theme-dark & {\n --color-primary: var(--color-selection-highlight);\n }\n }\n\n .File + .text-content {\n margin-top: .3125rem;\n }\n }\n\n &.voice,\n &.audio {\n .message-title,\n .Embedded {\n margin-top: -.1875rem;\n margin-bottom: .1875rem;\n }\n }\n\n &.voice {\n padding: .5rem !important;\n\n .Voice + .text-content {\n margin-top: .5rem;\n }\n }\n\n &.audio {\n min-width: 17.1875rem;\n padding: .5rem .5rem .8125rem !important;\n\n .Audio + .text-content {\n margin-top: .25rem;\n }\n\n &:not(.has-replies) {\n .Audio + .text-content {\n margin-bottom: -0.4375rem;\n }\n }\n }\n\n &:not(.custom-shape) .emoji {\n display: inline-block;\n width: 1.25rem;\n background-size: 1.25rem;\n color: transparent;\n margin-inline-end: 1px;\n vertical-align: text-bottom;\n\n &::selection {\n background-color: var(--color-selection-highlight-emoji);\n color: transparent;\n }\n }\n\n &:not(.custom-shape) .text-content .emoji {\n width: calc(1.25 * var(--message-text-size, 1rem));\n height: calc(1.25 * var(--message-text-size, 1rem));\n background-size: calc(1.25 * var(--message-text-size, 1rem));\n }\n\n .no-media-corners {\n --border-top-left-radius: 0;\n --border-top-right-radius: 0;\n }\n\n &.custom-shape.is-via-bot {\n font-size: inherit !important;\n\n .content-inner > .message-title {\n display: inline-flex;\n position: relative;\n top: .125rem;\n max-width: calc(100% - 3rem);\n margin-left: calc(100% - 3rem);\n padding: 0 .5rem;\n background-color: var(--background-color);\n border-radius: var(--border-radius-messages);\n\n .Message.own & {\n margin-left: -3rem;\n }\n }\n\n .media-inner {\n margin-top: 0.375rem;\n }\n }\n\n}\n\n.message-content.media, .WebPage {\n .media-inner {\n display: flex;\n justify-content: center;\n align-items: center;\n\n &.interactive {\n cursor: pointer;\n\n &.dark video {\n background-color: #232323;\n }\n }\n }\n\n &.round.is-reply {\n width: auto !important;\n }\n\n &.force-sender-name .media-inner,\n &.force-sender-name .Album,\n &.text .media-inner,\n &.is-via-bot .media-inner,\n &.is-reply .media-inner,\n &.is-reply .Album {\n margin-left: -0.5rem;\n margin-right: -0.5rem;\n }\n\n &.text .media-inner {\n margin-top: -0.3125rem;\n }\n\n &.is-reply .media-inner,\n &.force-sender-name .Album,\n &.is-reply .Album,\n .message-title ~ .media-inner {\n margin-top: 0.375rem;\n margin-bottom: -0.375rem;\n }\n\n // Moved below .is-reply to overwrite its styles\n &.text .media-inner,\n &.text .Album {\n margin-bottom: 0.375rem;\n }\n\n .media-loading {\n display: flex;\n align-items: center;\n justify-content: center;\n\n &:not(.open) {\n opacity: 0.5;\n transform: scale(0);\n transition: opacity .3s ease, transform .3s ease;\n }\n }\n\n .icon-large-play, .icon-download {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n opacity: 0.7;\n transition: opacity 150ms;\n\n &:hover {\n opacity: 1;\n }\n\n &:before {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 3.375rem;\n height: 3.375rem;\n border-radius: 50%;\n background: rgba(black, 0.25);\n }\n }\n\n .icon-download {\n font-size: 1.5rem;\n }\n\n .icon-large-play {\n font-size: 2.5rem;\n }\n\n .message-media-duration,\n .message-upload-progress {\n background: rgba(0, 0, 0, .25);\n color: #fff;\n font-size: 0.75rem;\n position: absolute;\n left: .1875rem;\n top: .1875rem;\n z-index: 1;\n padding: 0 .375rem;\n border-radius: .75rem;\n line-height: 1.125rem;\n }\n\n .message-media-duration .icon-muted-chat {\n vertical-align: -.1875rem;\n margin-left: .375rem;\n font-size: 1.0625rem;\n }\n}\n\n.message-content.custom-shape {\n line-height: 1.2;\n font-size: 10rem;\n display: flex;\n flex-wrap: wrap;\n align-items: flex-end;\n\n &.has-comments {\n min-height: 5.25rem;\n margin-top: 0 !important;\n\n &.has-replies {\n min-height: 6.5rem;\n }\n }\n\n &.is-reply {\n max-width: 100%;\n }\n\n .reply-message {\n display: flex;\n align-items: flex-start;\n flex-direction: row-reverse;\n direction: ltr;\n\n > p {\n margin-bottom: 0;\n }\n\n .EmbeddedMessage {\n margin-left: 0.5rem;\n border-radius: var(--border-radius-messages);\n\n @media (max-width: 600px) {\n max-width: calc(90vw - 13rem);\n }\n\n @media (max-width: 340px) {\n margin-left: -1rem;\n z-index: 1;\n max-width: calc(90vw - 12rem);\n }\n }\n }\n\n .text-content {\n margin-bottom: 1rem;\n }\n\n .media-inner {\n line-height: 1;\n font-size: 1rem;\n flex-shrink: 0;\n\n .full-media {\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n }\n }\n\n .emoji {\n display: inline-block;\n color: transparent;\n\n &::selection {\n background-color: var(--color-selection-highlight-emoji);\n color: transparent;\n }\n }\n\n &.emoji-only {\n .text-content {\n margin-bottom: 0;\n }\n }\n\n &.emoji-only-1 {\n min-width: 8rem;\n font-size: 4.5rem;\n\n .content-inner {\n height: 7rem;\n }\n\n .text-content {\n line-height: 1.5;\n text-align: center;\n }\n\n .Message.was-edited & {\n min-width: 10rem;\n }\n\n .emoji {\n width: 5rem;\n height: 5rem;\n }\n }\n\n &.emoji-only-2 {\n font-size: 4rem;\n margin-top: .5rem;\n min-width: 10rem;\n\n &.has-comments {\n margin-top: 1.25rem;\n }\n\n .Message.was-edited & {\n min-width: 12rem;\n }\n\n .emoji {\n width: 4rem;\n height: 4rem;\n }\n }\n\n &.emoji-only-3 {\n font-size: 3rem;\n margin-top: 1.75rem;\n min-width: 12rem;\n\n &.has-comments {\n margin-top: 2.5rem;\n }\n\n .Message.was-edited & {\n min-width: 14rem;\n }\n\n .emoji {\n width: 3rem;\n height: 3rem;\n }\n }\n\n .Message:not(.own) & {\n --hover-color: var(--color-reply-hover);\n --active-color: var(--color-reply-active);\n }\n\n .Message.own & {\n --hover-color: var(--color-reply-own-hover);\n --active-color: var(--color-reply-own-active);\n\n .reply-message {\n flex-direction: row;\n\n .EmbeddedMessage {\n margin-right: 0.5rem;\n\n @media (max-width: 340px) {\n margin-left: 0;\n z-index: 1;\n max-width: calc(90vw - 11.5rem);\n }\n }\n }\n }\n}\n\n.forwarded-message {\n .message-content.poll & {\n // MessageOutgoingStatus's icon needs more space\n margin-bottom: 0.5rem;\n }\n\n .message-content:not(.custom-shape) & {\n position: relative;\n margin-top: 0.25rem;\n padding-left: 0.625rem;\n\n &::before {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0.05rem;\n width: 2px;\n background: var(--accent-color);\n border-radius: 2px;\n }\n\n &:dir(rtl) {\n padding-inline-start: 0.625rem;\n\n &::before {\n left: auto;\n right: 0.05rem;\n }\n }\n }\n\n --border-top-left-radius: var(--border-radius-messages-small);\n --border-top-right-radius: var(--border-radius-messages-small);\n --border-bottom-left-radius: var(--border-radius-messages-small);\n --border-bottom-right-radius: var(--border-radius-messages-small);\n\n > .media-inner {\n margin: 0 !important;\n margin-bottom: 0.25rem !important;\n }\n}\n\n.long-word-break-all {\n word-break: break-all;\n}\n\n.text-entity-link {\n color: var(--color-links) !important;\n text-decoration: none;\n word-break: break-word;\n cursor: pointer;\n unicode-bidi: initial;\n\n &:hover, &:active, &:visited {\n color: var(--color-links-hover) !important;\n text-decoration: underline;\n }\n}\n\n.text-entity-code, .text-entity-pre {\n color: var(--color-code);\n background: var(--color-code-bg);\n white-space: pre-wrap;\n margin: 0;\n padding: 1px 2px;\n border-radius: 4px;\n font-size: calc(var(--message-text-size, 1rem) - 0.0625rem);\n}\n",".ContactGreeting {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n\n .wrapper {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n background: var(--pattern-color);\n width: 14.5rem;\n padding: .75rem 1rem;\n border-radius: 1.5rem;\n color: #fff;\n }\n\n .title {\n font-weight: 500;\n margin-bottom: 0;\n }\n\n .description {\n font-size: .9375rem;\n margin-bottom: 0;\n }\n\n .sticker {\n margin: 2rem 0 1rem;\n height: 10rem;\n width: 10rem;\n cursor: pointer;\n\n .thumbnail {\n height: 10rem;\n width: 10rem;\n }\n }\n}\n",".NoMessages {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n\n .icon {\n font-size: 5rem;\n margin: 0 auto 1rem;\n }\n\n .wrapper {\n display: inline-flex;\n flex-direction: column;\n background: var(--pattern-color);\n max-width: 20rem;\n padding: .75rem 1rem;\n border-radius: 1.5rem;\n color: #fff;\n\n &[dir=rtl] {\n text-align: right;\n }\n }\n\n .title {\n font-weight: 500;\n font-size: 1rem;\n margin-bottom: .25rem;\n text-align: center;\n unicode-bidi: plaintext;\n }\n\n .description {\n font-size: .9375rem;\n margin: 0;\n padding: 0;\n list-style: none;\n unicode-bidi: plaintext;\n }\n\n .list-checkmarks {\n font-size: .9375rem;\n margin: .25rem 0 0;\n padding: 0;\n list-style: none;\n unicode-bidi: plaintext;\n line-height: 1.8;\n\n li::before {\n content: '✓';\n margin-inline-end: .5rem;\n }\n }\n}\n","@import '../../styles/mixins';\n\n.MessageList {\n flex: 1;\n width: 100%;\n margin-bottom: .5rem;\n\n overflow-anchor: none;\n overflow: scroll;\n overflow-x: hidden;\n overflow-y: auto;\n @include overflow-y-overlay();\n\n .mask-image-enabled & {\n mask-image: linear-gradient(to top, transparent 0, #000 0.5rem);\n }\n\n @media (pointer: coarse) {\n user-select: none;\n touch-callout: none;\n\n &.select-mode-active {\n user-select: auto;\n touch-callout: default;\n }\n }\n\n &.no-avatars .Message > .Avatar {\n display: none;\n }\n\n .messages-container {\n width: 100%;\n max-width: var(--messages-container-width);\n min-height: 100%;\n margin: 0 auto;\n display: flex;\n justify-content: flex-end;\n flex-direction: column;\n padding: 1rem 1rem 0 1.125rem;\n\n .force-messages-scroll & {\n margin-top: 100vh !important;\n }\n\n @media (max-width: 600px) {\n width: 100vw;\n padding: 2.75rem 0.5rem 0;\n // Patch for an issue on Android when rotating device\n margin: 0;\n }\n }\n\n &.no-composer {\n margin-bottom: 0;\n\n .last-in-list {\n margin-bottom: 1rem;\n }\n }\n\n &.select-mode-active, &.type-pinned {\n margin-bottom: 0;\n\n .last-in-list {\n margin-bottom: 5.625rem;\n\n @media (max-width: 600px) {\n margin-bottom: 4.25rem;\n }\n\n &.ActionMessage {\n padding-bottom: 0.125rem;\n }\n }\n }\n\n .Message,\n .ActionMessage {\n position: relative;\n\n opacity: 1;\n transform: scale(1);\n transition: opacity .2s ease, transform .2s ease;\n\n &:not(.open) {\n transform: scale(0.8);\n opacity: 0;\n }\n\n // Restore stacking context\n // https://developer.mozilla.org/ru/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n &.open.shown {\n transform: none;\n }\n\n &::before {\n content: \"\";\n position: absolute;\n top: -0.1875rem;\n bottom: -0.1875rem;\n left: -50vw;\n right: -50vw;\n background: black;\n z-index: -1;\n\n opacity: 0;\n transition: opacity var(--select-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n &:not(.last-in-group) {\n &::before {\n bottom: -0.1875rem;\n }\n }\n\n &:not(.first-in-group) {\n &::before {\n top: -0.1875rem;\n }\n }\n\n &.focused::before {\n // @optimization\n transition: none !important;\n }\n\n &.focused,\n &.is-forwarding,\n &.is-selected,\n &.has-menu-open {\n &::before {\n opacity: 0.1;\n }\n }\n }\n\n > .empty {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n\n & > span {\n max-width: 80%;\n text-align: left;\n }\n\n .text-entity-link {\n color: inherit !important;\n text-decoration: underline;\n\n &:hover, &:focus {\n text-decoration: none;\n }\n }\n }\n\n .sticky-date,\n .local-action-message,\n .ActionMessage,\n .empty {\n text-align: center;\n\n > span {\n display: inline-block;\n background: var(--pattern-color);\n color: white;\n font-size: calc(var(--message-text-size, 1rem) - .0625rem);\n font-weight: 500;\n line-height: 1.75;\n padding: 0 .5rem;\n border-radius: var(--border-radius-messages);\n word-break: break-word;\n\n body.is-ios &,\n body.is-macos & {\n font-size: calc(var(--message-text-size, 1rem) - .125rem);\n }\n\n .emoji-small {\n vertical-align: text-bottom;\n width: calc(1.25 * var(--message-text-size, 1rem));\n height: calc(1.25 * var(--message-text-size, 1rem));\n background-size: calc(1.25 * var(--message-text-size, 1rem));\n }\n }\n }\n\n .sticky-date {\n margin-top: 1rem;\n margin-bottom: 1rem;\n z-index: var(--z-sticky-date);\n pointer-events: none;\n opacity: 1;\n transition: opacity .3s ease;\n\n body:not(.is-scrolling-messages) &.stuck {\n opacity: 0;\n\n span {\n pointer-events: none;\n }\n }\n\n body.animation-level-0 & {\n transition: none;\n }\n\n &.interactive {\n cursor: pointer;\n }\n\n span {\n pointer-events: auto;\n }\n }\n\n &.scrolled:not(.is-animating) .sticky-date {\n position: sticky;\n top: 0.625rem;\n }\n\n &.is-animating {\n overflow: hidden;\n }\n\n &.is-animating .message-select-control {\n display: none !important;\n }\n\n .has-header-tools & .sticky-date {\n top: 3.75rem;\n }\n\n .local-action-message,\n .ActionMessage {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n }\n\n .ActionMessage {\n .action-link {\n cursor: pointer;\n\n &:hover {\n text-decoration: underline;\n }\n }\n }\n\n .sticky-date + .ActionMessage {\n margin-top: -0.5rem;\n }\n\n @media (min-width: 1276px) {\n width: 100%;\n transform: translate3d(0, 0, 0);\n transition: transform var(--layer-transition);\n\n .messages-container {\n width: calc(100% - var(--right-column-width));\n }\n\n body.animation-level-0 & {\n transition: none;\n }\n\n #Main.right-column-open & {\n transform: translate3d(calc(var(--right-column-width) / -2), 0, 0);\n }\n\n body:not(.animating-right-column) #Main.right-column-open &.select-mode-active,\n #Main.right-column-open &:not(.select-mode-active),\n body.animating-right-column &:not(.select-mode-active) {\n width: calc(100% - var(--right-column-width));\n\n .messages-container {\n width: 100%;\n }\n }\n }\n\n @media (max-width: 600px) {\n transition: transform var(--layer-transition);\n\n body.enable-symbol-menu-transforms & {\n transform: translate3d(0, 0, 0);\n }\n\n body.is-symbol-menu-open & {\n transform: translate3d(0, calc(-1 * (var(--symbol-menu-height) + var(--symbol-menu-footer-height))), 0);\n }\n }\n\n .animating > div > & {\n &::-webkit-scrollbar {\n width: 0;\n }\n\n /* Styles for Firefox */\n @supports (scrollbar-width: none) {\n padding-right: .6875rem;\n scrollbar-width: none;\n }\n }\n}\n",".ScrollDownButton {\n --base-bottom-pos: 6rem;\n\n position: absolute;\n bottom: var(--base-bottom-pos);\n right: 1rem;\n opacity: 0;\n transform: translateY(4.5rem);\n transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity .2s ease;\n z-index: var(--z-scroll-down-button);\n pointer-events: none;\n\n body.animation-level-0 & {\n transform: none !important;\n\n transition: opacity .15s;\n }\n\n @media (max-width: 600px) {\n right: 0.5rem;\n bottom: 4.5rem;\n }\n\n &-inner {\n display: flex;\n flex-direction: column;\n align-items: center;\n\n > .Button {\n box-shadow: 0 1px 2px var(--color-default-shadow);\n\n i {\n font-size: 1.75rem;\n }\n }\n\n @media (min-width: 1276px) {\n transform: translateX(0);\n\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n #Main.right-column-open & {\n transform: translateX(calc(-1 * var(--right-column-width)));\n }\n }\n\n @media (max-width: 600px) {\n > .Button {\n width: 2.875rem;\n height: 2.875rem;\n }\n }\n }\n\n &.revealed {\n transform: translateY(0);\n opacity: 1;\n pointer-events: all;\n\n &.no-composer:not(.with-extra-shift) {\n transform: translateY(4rem);\n }\n }\n\n .unread-count {\n min-width: 1.5rem;\n height: 1.5rem;\n padding: 0 .45rem;\n border-radius: 0.75rem;\n font-size: 0.875rem;\n line-height: 1.5rem;\n font-weight: 500;\n text-align: center;\n\n position: absolute;\n top: -0.3rem;\n right: -0.3rem;\n\n background: var(--color-green);\n color: white;\n\n pointer-events: none;\n\n @media (max-width: 600px) {\n top: -0.7rem;\n right: auto;\n }\n }\n\n @media (max-width: 600px) {\n body.is-symbol-menu-open & {\n bottom: calc(var(--base-bottom-pos) + var(--symbol-menu-height) + var(--symbol-menu-footer-height));\n }\n }\n}\n",".BotKeyboardMenu {\n .bubble {\n width: 100% !important;\n max-width: 27rem;\n border-radius: var(--border-radius-default-small);\n }\n\n .content {\n display: flex;\n flex-direction: column;\n padding: .1875rem .625rem;\n max-height: 80vh;\n overflow: auto;\n\n @media (max-width: 600px) {\n max-height: 75vh;\n }\n\n .row {\n display: flex;\n flex-direction: row;\n }\n\n .row + .row {\n margin-top: .375rem;\n }\n\n .Button {\n flex: 1;\n width: auto;\n height: auto;\n min-height: 3.0625rem;\n border-radius: var(--border-radius-messages-small);\n border: 2px solid var(--color-primary);\n background: var(--color-background);\n color: var(--color-primary);\n font-weight: 500;\n text-transform: none;\n\n &:hover {\n color: #fff;\n border-color: var(--color-primary-shade);\n background: var(--color-primary-shade);\n }\n }\n\n .Button + .Button {\n margin-left: .375rem;\n }\n }\n}\n",".ComposerEmbeddedMessage {\n height: 2.625rem;\n transition: height 150ms ease-out, opacity 150ms ease-out;\n\n .select-mode-active + .middle-column-footer & {\n display: none;\n }\n\n &:not(.open) {\n height: 0 !important;\n }\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n & > div {\n display: flex;\n align-items: center;\n padding-right: 0.625rem;\n padding-top: 0.1875rem;\n }\n\n & > div > .Button {\n flex-shrink: 0;\n background: none !important;\n width: 3.5rem;\n height: 2.875rem;\n margin: 0 -0.0625rem 0 0;\n padding: 0;\n align-self: center;\n\n @media (max-width: 600px) {\n width: 2.875rem;\n }\n }\n}\n",".WebPagePreview {\n height: 2.625rem;\n transition: height 150ms ease-out, opacity 150ms ease-out;\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n .select-mode-active + .middle-column-footer & {\n display: none;\n }\n\n &:not(.open) {\n height: 0 !important;\n }\n\n // TODO Remove duplication with `.ComposerEmbeddedMessage`\n & > div {\n display: flex;\n align-items: center;\n padding-right: 0.625rem;\n padding-top: 0.1875rem;\n }\n\n --accent-color: var(--color-primary);\n\n .ComposerEmbeddedMessage + & {\n margin-top: 0.75rem;\n }\n\n & > div > .Button {\n flex-shrink: 0;\n background: none !important;\n width: 3.5rem;\n height: 2.875rem;\n margin: 0 -0.0625rem 0 0;\n padding: 0;\n align-self: center;\n\n @media (max-width: 600px) {\n width: 2.875rem;\n }\n }\n\n .WebPage {\n flex-grow: 1;\n margin: 0.1875rem 0 0.1875rem 0.125rem;\n max-width: calc(100% - 3.375rem);\n\n &::before {\n top: .1rem;\n bottom: .05rem;\n }\n\n &.with-video .media-inner { // TODO add support for video in previews in composer\n display: none;\n }\n\n .site-title,\n .site-description {\n flex: 1;\n max-width: 100%;\n max-height: 1rem;\n }\n\n .site-title {\n margin-top: .125rem;\n margin-bottom: 0.1875rem;\n }\n\n .site-description {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n }\n}\n","@import '../../../styles/mixins';\n\n.Composer {\n align-items: flex-end;\n\n .select-mode-active + .middle-column-footer & {\n position: absolute;\n padding-right: 2rem;\n bottom: 0;\n\n @media (max-width: 600px) {\n padding-right: 1rem;\n }\n\n &::before {\n right: 2.125rem;\n\n @media (max-width: 600px) {\n right: 1rem;\n }\n }\n\n .svg-appendix {\n opacity: 0;\n }\n }\n\n .form-control {\n --border-width: 0;\n }\n\n > .Button {\n flex-shrink: 0;\n margin-left: .5rem;\n\n @media (max-width: 600px) {\n width: 2.875rem;\n height: 2.875rem;\n }\n\n .icon-send,\n .icon-microphone-alt,\n .icon-check {\n position: absolute;\n }\n\n &:not(:active):not(:focus):not(:hover) {\n .icon-send,\n .icon-check {\n color: var(--color-primary);\n }\n }\n\n &.cancel {\n position: relative;\n z-index: 1;\n\n &:hover, &.active {\n background: var(--color-chat-hover);\n }\n }\n\n &.recording {\n position: relative;\n z-index: 0;\n transition: box-shadow .1s;\n }\n\n &.send {\n .icon-send {\n animation: grow-icon .4s ease-out;\n }\n\n .icon-microphone-alt,\n .icon-check {\n animation: hide-icon .4s forwards ease-out;\n }\n }\n\n &.record {\n .icon-microphone-alt {\n animation: grow-icon .4s ease-out;\n }\n\n .icon-send,\n .icon-check {\n animation: hide-icon .4s forwards ease-out;\n }\n }\n\n &.edit {\n .icon-send,\n .icon-microphone-alt {\n animation: hide-icon .4s forwards ease-out;\n }\n\n .icon-check {\n animation: grow-icon .4s ease-out;\n }\n }\n\n &.not-ready > i {\n animation-duration: 0ms !important;\n }\n\n body.animation-level-0 &, body.animation-level-1 & {\n .icon-send, .icon-microphone-alt, .icon-check {\n animation-duration: 0ms !important;\n }\n }\n }\n\n .mobile-symbol-menu-button {\n width: 2.875rem;\n height: 2.875rem;\n position: relative;\n\n .icon-smile,\n .icon-keyboard,\n .Spinner {\n position: absolute;\n }\n\n .Spinner {\n --spinner-size: 1.5rem;\n }\n\n .icon-smile {\n animation: grow-icon .4s ease-out;\n }\n\n .icon-keyboard, .Spinner {\n animation: hide-icon .4s forwards ease-out;\n }\n\n &.not-ready > i {\n animation-duration: 0ms !important;\n }\n\n &.is-loading {\n .Spinner {\n animation: grow-icon .4s ease-out;\n }\n\n .icon-keyboard, .icon-smile {\n animation: hide-icon .4s forwards ease-out;\n }\n }\n\n &.menu-opened {\n .icon-keyboard {\n animation: grow-icon .4s ease-out;\n }\n\n .icon-smile, .Spinner {\n animation: hide-icon .4s forwards ease-out;\n }\n }\n }\n}\n\n#message-compose {\n flex-grow: 1;\n max-width: calc(100% - 4rem);\n background: var(--color-background);\n border-radius: var(--border-radius-messages);\n border-bottom-right-radius: 0;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n position: relative;\n z-index: 1;\n\n .svg-appendix {\n position: absolute;\n bottom: -.1875rem;\n right: -.551rem; // This value is correct. Safari fix\n width: .5625rem;\n height: 1.25rem;\n transition: opacity 200ms;\n font-size: 1rem !important;\n\n .corner {\n fill: var(--color-background);\n }\n }\n\n @media (max-width: 600px) {\n max-width: calc(100% - 3rem);\n }\n}\n\n.message-input-wrapper {\n display: flex;\n\n > .Spinner {\n align-self: center;\n --spinner-size: 1.5rem;\n margin-right: -.5rem;\n }\n\n > .Button {\n flex-shrink: 0;\n background: none !important;\n width: 3.5rem;\n height: 3.5rem;\n margin: 0;\n padding: 0;\n align-self: flex-end;\n\n + .Button {\n margin-left: -1rem;\n }\n\n @media (max-width: 600px) {\n width: 2.875rem;\n height: 2.875rem;\n\n + .Button {\n margin-left: -0.6875rem;\n }\n }\n\n &.bot-commands {\n color: var(--color-primary) !important;\n\n // SymbolMenu button should be accessible if BotCommandsMenu opened\n body.is-touch-env &.activated + .Button.mobile-symbol-menu-button {\n z-index: calc(var(--z-menu-backdrop) + 1);\n }\n }\n\n &.scheduled-button i::after {\n content: '';\n position: absolute;\n top: .75rem;\n right: .75rem;\n border: .1875rem solid var(--color-background);\n box-sizing: content-box;\n width: .5rem;\n height: .5rem;\n border-radius: 50%;\n background: var(--color-green-darker);\n box-shadow: -.375rem -.25rem 0 -.1875rem var(--color-background);\n @media (max-width: 600px) {\n top: .5rem;\n right: .5rem;\n }\n }\n }\n\n > .input-group {\n flex-grow: 1;\n margin-bottom: 0;\n }\n\n .recording-state {\n display: inline-block;\n position: relative;\n line-height: 3.5rem;\n height: 3.5rem;\n padding: 0 3.125rem 0 1rem;\n\n &::after {\n content: '';\n width: 10px;\n height: 10px;\n background: var(--color-error);\n border-radius: 5px;\n position: absolute;\n top: 50%;\n margin-top: -5px;\n right: 1.375rem;\n }\n\n @media (max-width: 600px) {\n height: 2.875rem;\n line-height: 2.875rem;\n }\n }\n}\n\n#message-input-text,\n#caption-input-text {\n position: relative;\n\n .form-control {\n padding: calc((3.25rem - var(--composer-text-size, 1rem) * 1.375) / 2 - var(--border-width, 0) * 2) calc(.9rem - var(--border-width));\n overflow: hidden;\n line-height: 1.375;\n font-family: Roboto, -apple-system, \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;\n unicode-bidi: plaintext;\n text-align: initial;\n font-size: var(--composer-text-size, 1rem);\n\n body.is-ios &,\n body.is-macos & {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, \"Roboto\", \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;\n }\n\n &.overflown {\n overflow-y: auto;\n overflow-x: hidden;\n }\n\n &.touched, &:focus {\n & + .placeholder-text {\n display: none;\n }\n }\n\n &.focus-disabled {\n pointer-events: none;\n }\n }\n\n .forced-placeholder,\n .placeholder-text {\n position: absolute;\n color: var(--color-placeholders);\n pointer-events: none;\n unicode-bidi: plaintext;\n text-align: initial;\n line-height: 1.3125;\n font-size: var(--composer-text-size, 1rem);\n top: calc((3.25rem - var(--composer-text-size, 1rem) * 1.375) / 2);\n bottom: auto;\n }\n\n .forced-placeholder {\n z-index: var(--z-below);\n left: 0;\n white-space: nowrap;\n overflow: hidden;\n max-width: 100%;\n text-overflow: ellipsis;\n }\n\n &[dir=rtl] .placeholder-text {\n right: 0;\n }\n\n .text-entity-link {\n color: var(--color-links) !important;\n cursor: default;\n text-decoration: none;\n\n &:hover, &:active, &:visited {\n color: var(--color-links-hover) !important;\n }\n }\n\n .clone {\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n pointer-events: none;\n z-index: -10;\n unicode-bidi: plaintext;\n text-align: initial;\n }\n}\n\n#message-input-text {\n flex-grow: 1;\n\n .form-control {\n margin-bottom: 0;\n background: transparent !important;\n border: none !important;\n border-radius: 0 !important;\n box-shadow: none !important;\n caret-color: var(--color-text);\n min-height: 3.5rem;\n max-height: 26rem;\n line-height: 1.3125;\n padding: calc((3.5rem - var(--composer-text-size, 1rem) * 1.3125) / 2) 0;\n\n @media (max-width: 600px) {\n height: 2.875rem;\n min-height: 2.875rem;\n max-height: 16rem;\n padding: calc((2.875rem - var(--composer-text-size, 1rem) * 1.3125) / 2) 0;\n overflow: auto;\n }\n\n transition: height 100ms ease;\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n .forced-placeholder,\n .placeholder-text {\n top: calc((3.5rem - var(--composer-text-size, 1rem) * 1.3125) / 2);\n\n @media (max-width: 600px) {\n top: calc((2.875rem - var(--composer-text-size, 1rem) * 1.3125) / 2);\n }\n }\n\n &:not(:only-child) {\n .form-control {\n padding-left: 0;\n padding-right: 0;\n }\n }\n\n .ComposerEmbeddedMessage + .message-input-wrapper &,\n .WebPagePreview + .message-input-wrapper & {\n .form-control.overflown {\n margin-top: 0.75rem;\n }\n }\n\n .emoji {\n width: 1.25rem;\n height: 1.25rem;\n margin: 0 1px -5px;\n vertical-align: 0;\n pointer-events: none;\n }\n}\n\n#caption-input-text {\n .form-control {\n height: 3.25rem;\n min-height: 3.25rem;\n max-height: 15rem;\n }\n\n .placeholder-text {\n bottom: .8125rem;\n left: .90625rem;\n }\n}\n\n.composer-tooltip {\n position: absolute;\n bottom: calc(100% + .5rem);\n left: 0;\n width: 100%;\n background: var(--color-background);\n border-radius: var(--border-radius-messages);\n padding: 0.5rem 0;\n max-height: 15rem;\n\n overflow-x: hidden;\n overflow-y: auto;\n @include overflow-y-overlay();\n\n box-shadow: 0 1px 2px var(--color-default-shadow);\n\n opacity: 0;\n transform: translateY(1.5rem);\n transform-origin: bottom;\n transition: opacity var(--layer-transition), transform var(--layer-transition);\n\n &:not(.shown) {\n display: none;\n }\n\n &.open {\n opacity: 1;\n transform: translateY(0);\n }\n\n .Loading {\n margin: 1rem 0;\n }\n}\n","#middle-column-bg {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n overflow: hidden;\n z-index: -1;\n\n &::before,\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n background-color: var(--theme-background-color);\n }\n\n &::after {\n .theme-light & {\n background-image: url('../../assets/chat-bg.jpg');\n\n @media (max-width: 600px) {\n background-image: url('../../assets/chat-bg-mobile.jpg');\n }\n }\n\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n\n body:not(.animation-level-0) #root & {\n transition: transform var(--layer-transition), opacity .2s !important;\n }\n\n body.animation-level-0 & {\n transition: none;\n }\n }\n\n .custom-bg-color:not(.custom-bg-image) > &::after {\n opacity: 0;\n }\n\n .custom-bg-image > &::after {\n background-image: var(--custom-background) !important;\n filter: none;\n transform: scale(1.1);\n }\n\n .custom-bg-image.blurred > &::after {\n filter: blur(12px);\n }\n\n @media screen and (min-width: 1276px) {\n body.animation-level-2 &::after {\n margin: -16rem -5rem -20rem 0;\n overflow: hidden;\n transform: scale(1);\n transform-origin: left center;\n transition: transform var(--layer-transition);\n }\n\n body.animation-level-2 #Main.right-column-open &::after {\n transform: scale(0.67) !important;\n }\n }\n}\n\n#MiddleColumn {\n display: flex;\n justify-content: center;\n height: 100%;\n position: relative;\n z-index: 1;\n\n @media (max-width: 600px) {\n overflow: hidden;\n }\n\n .messages-layout {\n --slide-transition: 450ms cubic-bezier(0.25, 1, 0.5, 1);\n\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n\n > .Transition {\n width: 100%;\n height: 100%;\n overflow: hidden;\n\n > div {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n }\n }\n\n .messaging-disabled {\n &-inner {\n width: 100%;\n padding: 1rem;\n border-radius: var(--border-radius-messages);\n background: var(--color-background);\n color: var(--color-text-secondary);\n text-align: center;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n }\n }\n\n .Composer {\n #message-compose {\n transform: scaleX(1) translateX(0);\n transition: transform var(--select-transition), border-bottom-right-radius var(--select-transition);\n\n &::before {\n transform: scaleX(-1) translateX(0);\n transition: transform var(--select-transition);\n }\n\n body.animation-level-0 & {\n &, &::before {\n transition: none !important;\n }\n }\n }\n\n .message-input-wrapper, &::before {\n opacity: 1;\n transition: opacity var(--select-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n > .Button {\n opacity: 1;\n transform: scale(1);\n transition: opacity var(--select-transition), transform var(--select-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n &.hover-disabled, &:not(.shown) {\n pointer-events: none;\n }\n\n &:not(.shown) {\n .ComposerEmbeddedMessage {\n height: 0;\n }\n\n #message-compose {\n transform: scaleX(var(--composer-hidden-scale, 1)) translateX(var(--composer-translate-x, 0));\n border-bottom-right-radius: var(--border-radius-messages);\n\n &::before {\n transform: scaleX(-1) translateX(200%);\n }\n }\n\n #editable-message-text {\n height: 3.5rem !important;\n\n @media (max-width: 600px) {\n height: 2.5rem !important;\n }\n }\n\n .message-input-wrapper, &::before {\n opacity: 0;\n }\n\n > .Button {\n opacity: 0 !important;\n transform: scale(0.5);\n }\n }\n }\n\n .messaging-disabled {\n transform: scaleX(1);\n transition: transform var(--select-transition);\n\n .messaging-disabled-inner span {\n opacity: 1;\n transition: opacity var(--select-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n &:not(.shown) {\n transform: scaleX(var(--composer-hidden-scale, 1));\n pointer-events: none;\n\n .messaging-disabled-inner span {\n opacity: 0;\n }\n }\n }\n\n .middle-column-footer {\n width: 100%;\n max-width: var(--messages-container-width);\n padding: 0 1rem;\n position: relative;\n display: flex;\n align-items: flex-end;\n z-index: var(--z-middle-footer);\n\n transform: translate3d(0, 0, 0);\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n @media (min-width: 1276px) {\n width: calc(100% - var(--right-column-width));\n\n #Main.right-column-open & {\n transform: translate3d(calc(var(--right-column-width) / -2), 0, 0);\n }\n }\n\n @media (max-width: 600px) {\n padding: 0 0.5rem;\n\n body.is-symbol-menu-open & {\n transform: translate3d(0, calc(-1 * (var(--symbol-menu-height) + var(--symbol-menu-footer-height))), 0);\n }\n }\n\n &::before {\n content: \"\";\n position: absolute;\n top: -.5625rem;\n left: 0;\n right: 0;\n height: 1px;\n background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 2%, rgba(255, 255, 255, 0.4) 98%, rgba(255, 255, 255, 0) 100%);\n opacity: 0;\n transition: opacity 350ms ease;\n\n @media (max-width: 600px) {\n left: -2%;\n right: -2%;\n }\n }\n\n &.with-notch::before {\n opacity: 1;\n }\n\n html.theme-dark &::before {\n background: linear-gradient(90deg, rgba(127, 127, 127, 0) 0%, rgba(127, 127, 127, 0.4) 2%, rgba(127, 127, 127, 0.4) 98%, rgba(127, 127, 127, 0) 100%);\n }\n }\n}\n\n/* Common styles for message list fade-out shadow */\n.Composer,\n.MessageSelectToolbar,\n.messaging-disabled {\n margin-bottom: 1.25rem;\n\n @media (max-width: 600px) {\n margin-bottom: 0.5rem;\n }\n}\n\n.Composer,\n.MessageSelectToolbar,\n.unpin-all-button,\n.messaging-disabled {\n width: 100%;\n display: flex;\n justify-content: center;\n position: relative;\n}\n\n.MessageSelectToolbar-inner,\n.unpin-all-button,\n.messaging-disabled {\n .mask-image-disabled & {\n box-shadow: 0 .25rem .5rem .125rem var(--color-default-shadow);\n border-radius: var(--border-radius-messages);\n }\n}\n\n.unpin-button-container {\n width: 100%;\n display: flex;\n justify-content: center;\n position: absolute;\n padding-bottom: 1.25rem;\n\n .unpin-all-button {\n text-transform: capitalize;\n color: var(--color-black);\n height: 3.5rem;\n overflow: visible;\n transform: scaleX(1);\n transition: transform var(--select-transition), background-color .15s, color .15s;\n\n &:hover {\n .icon-unpin {\n color: var(--color-white);\n }\n }\n\n .select-mode-active + .middle-column-footer & {\n box-shadow: none;\n transform: scaleX(var(--unpin-hidden-scale));\n }\n\n @media (max-width: 600px) {\n height: 2.5rem;\n }\n\n .icon-unpin {\n margin-inline-start: -0.4375rem;\n margin-inline-end: .75rem;\n color: var(--color-text-secondary);\n font-size: 1.5rem;\n transition: color .15s\n }\n }\n\n @media (max-width: 600px) {\n padding-bottom: 0.75rem;\n }\n\n .mask-image-disabled &::before {\n background: unset;\n }\n}\n",".RightHeader {\n display: flex;\n align-items: center;\n height: var(--header-height);\n padding: 0.5rem .8125rem;\n pointer-events: auto;\n\n @media (max-width: 600px) {\n padding: 0.5rem;\n }\n\n .close-button {\n flex-shrink: 0;\n }\n\n > .Transition {\n flex: 1;\n height: 100%;\n\n > div {\n display: flex;\n align-items: center;\n }\n }\n\n h3 {\n margin-bottom: 0;\n font-size: 1.25rem;\n font-weight: 500;\n margin-left: 1.375rem;\n }\n\n .tools {\n display: flex;\n margin-left: auto;\n }\n\n .SearchInput {\n margin-left: 1rem;\n\n @media (min-width: 600px) {\n margin-right: 1rem;\n }\n }\n\n .DropdownMenu {\n margin-left: auto;\n }\n}\n","@import '../../styles/mixins';\n\n.Profile {\n height: 100%;\n display: flex;\n flex-direction: column;\n\n overflow-x: hidden;\n overflow-y: scroll;\n @include overflow-y-overlay();\n\n > .profile-info > .ChatInfo {\n grid-area: chat_info;\n\n .status.online {\n color: var(--color-primary);\n }\n }\n\n > .profile-info > .ChatExtra {\n padding: .875rem .5rem .5rem;\n box-shadow: inset 0 -.0625rem 0 0 var(--color-background-secondary-accent);\n border-bottom: .625rem solid var(--color-background-secondary);\n\n .narrow {\n margin-bottom: 0;\n }\n\n .inactive.no-selection {\n user-select: auto;\n -webkit-user-select: auto !important;\n }\n\n .Switcher {\n margin-left: auto;\n }\n [dir=rtl] {\n .Switcher {\n margin-left: 0;\n margin-right: auto;\n }\n }\n }\n\n .FloatingActionButton {\n z-index: 1;\n }\n}\n\n.shared-media {\n display: flex;\n flex-direction: column-reverse;\n\n .TabList {\n background: var(--color-background);\n top: -1px;\n z-index: 1;\n\n .Tab {\n padding: 1rem .25rem;\n i {\n bottom: -1rem;\n }\n }\n }\n\n .Transition {\n flex: 1;\n }\n\n .content {\n &.empty-list {\n height: 100%;\n padding-top: 5rem;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n\n .Spinner {\n --spinner-size: 2.75rem;\n }\n }\n\n &.media-list {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-auto-rows: 1fr;\n grid-gap: .0625rem;\n }\n\n &.documents-list {\n padding: 1.25rem;\n\n & .File + .File {\n margin-top: 1.25rem;\n }\n }\n\n &.links-list {\n padding: 1.25rem;\n\n .ProgressSpinner,\n .message-upload-progress {\n display: none;\n }\n }\n\n &.audio-list {\n padding: 1.25rem;\n\n & .Audio {\n .media-loading {\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n & + .Audio {\n margin-top: 1.6875rem;\n }\n }\n }\n\n &.members-list {\n padding: 0.5rem 1rem;\n\n @media (max-width: 600px) {\n padding: .5rem 0;\n .ListItem.chat-item-clickable {\n margin: 0;\n }\n }\n }\n }\n}\n",".AddChatMembers {\n height: 100%;\n overflow: hidden;\n position: relative;\n\n &-inner {\n height: 100%;\n overflow: hidden;\n }\n}\n","#RightColumn {\n position: absolute;\n top: 0;\n right: 0;\n width: var(--right-column-width);\n height: 100%;\n transform: translate3d(var(--right-column-width), 0, 0);\n background: var(--color-background);\n border-left: 1px solid var(--color-borders);\n z-index: var(--z-right-column);\n\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none;\n }\n\n // @optimization\n &:not(:hover) {\n .chat-item-clickable:not(.picker-list-item):nth-child(n + 18) {\n display: none !important;\n }\n }\n\n @media (max-width: 1275px) {\n box-shadow: 0 .25rem .5rem .125rem var(--color-default-shadow);\n border-left: none;\n }\n\n @media (max-width: 600px) {\n width: 100vw;\n transform: translate3d(110vw, 0, 0);\n }\n\n > .Transition {\n height: calc(100% - var(--header-height));\n overflow: hidden;\n }\n\n .Management .section > .ChatInfo {\n padding: 0 1.5rem;\n margin: 1rem 0;\n text-align: center;\n\n .Avatar {\n margin: 0 auto .5rem;\n\n &.no-photo {\n cursor: default !important;\n }\n }\n\n .title {\n display: flex;\n justify-content: center;\n align-items: center;\n\n h3 {\n font-weight: 500;\n font-size: 1.25rem;\n line-height: 2rem;\n white-space: pre-wrap;\n word-break: break-word;\n }\n\n .VerifiedIcon {\n margin-left: 0.25rem;\n margin-bottom: .5rem;\n }\n\n .emoji {\n width: 1.5rem;\n height: 1.5rem;\n background-size: 1.5rem;\n }\n }\n\n .status {\n font-size: 0.875rem;\n color: #868e96;\n }\n }\n}\n\n#RightColumn-wrapper {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: var(--z-right-column);\n overflow: hidden;\n visibility: hidden;\n pointer-events: none;\n\n @media (max-width: 1275px) {\n position: fixed;\n }\n\n &.is-hidden {\n display: none;\n }\n\n .overlay-backdrop {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n background: black;\n opacity: 0;\n\n @media (max-width: 600px) {\n transition: opacity var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none;\n }\n }\n }\n\n #Main.right-column-open &, body.animating-right-column & {\n visibility: visible;\n }\n\n #Main.right-column-open & {\n @media (max-width: 600px) {\n .overlay-backdrop {\n opacity: var(--layer-blackout-opacity);\n }\n }\n\n #RightColumn {\n pointer-events: auto;\n transform: translate3d(0, 0, 0);\n }\n }\n}\n","#Main {\n display: flex;\n height: 100%;\n text-align: left;\n overflow: hidden;\n\n @media (min-width: 1276px) {\n position: relative;\n }\n\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n}\n\n#LeftColumn {\n flex: 1;\n min-width: 18rem;\n max-width: 26.5rem;\n height: 100%;\n\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n\n @media (min-width: 1680px) {\n border-left: 1px solid var(--color-borders);\n }\n\n @media (max-width: 1275px) {\n flex: 2;\n }\n\n @media (max-width: 925px) {\n position: fixed;\n left: 0;\n top: 0;\n height: calc(var(--vh, 1vh) * 100);\n width: 26.5rem;\n\n transform: translate3d(-5rem, 0, 0);\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none;\n }\n\n &::after {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n background: black;\n opacity: var(--layer-blackout-opacity);\n transition: opacity var(--layer-transition);\n z-index: 1;\n\n body.animation-level-0 & {\n transition: none;\n }\n\n // @optimization\n body.is-android & {\n display: none;\n }\n\n body.is-android .middle-column-shown & {\n display: block;\n }\n }\n\n #Main:not(.middle-column-open) & {\n transform: translate3d(0, 0, 0);\n\n &::after {\n opacity: 0;\n pointer-events: none;\n }\n }\n\n #Main.history-animation-disabled & {\n transition: none;\n\n &:after {\n transition: none;\n }\n }\n }\n\n @media (max-width: 600px) {\n max-width: none;\n width: 100vw;\n transform: translate3d(-20vw, 0, 0);\n }\n}\n\n#RightColumn {\n @media (min-width: 1680px) {\n border-right: 1px solid var(--color-borders);\n }\n\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100 + 1px);\n }\n\n #Main.history-animation-disabled & {\n transition: none;\n\n .overlay-backdrop {\n transition: none;\n }\n }\n}\n\n#Main.history-animation-disabled .overlay-backdrop {\n transition: none;\n}\n\n#MiddleColumn {\n flex: 3;\n border-left: 1px solid var(--color-borders);\n max-width: 75vw;\n\n @media (max-width: 1275px) {\n max-width: calc(100vw - 26.5rem);\n }\n\n @media (max-width: 66.25rem) {\n max-width: 60vw;\n }\n\n @media (min-width: 1680px) {\n border-right: 1px solid var(--color-borders);\n max-width: calc(1680px - 26.5rem);\n }\n\n @media (max-width: 925px) {\n max-width: none;\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n\n transform: translate3d(0, 0, 0);\n transition: transform var(--layer-transition);\n\n body.animation-level-0 & {\n transition: none;\n }\n\n #Main:not(.middle-column-open) & {\n transform: translate3d(26.5rem, 0, 0);\n }\n }\n\n @media (max-width: 600px) {\n border-left: none;\n\n #Main:not(.middle-column-open) & {\n transform: translate3d(100vw, 0, 0);\n }\n\n #Main.right-column-open & {\n transform: translate3d(-20vw, 0, 0);\n }\n }\n\n #Main.history-animation-disabled & {\n transition: none;\n\n &:after {\n transition: none;\n }\n }\n}\n\nbody.is-android.animation-level-1 {\n --layer-transition: 250ms ease-in-out;\n\n #LeftColumn, #MiddleColumn, #RightColumn {\n transition: transform var(--layer-transition), opacity var(--layer-transition);\n }\n\n #Main:not(.middle-column-shown) {\n #MiddleColumn {\n display: none;\n }\n }\n\n #Main:not(.middle-column-open) {\n #MiddleColumn {\n transform: translate3d(10vw, 0, 0);\n opacity: 0;\n }\n }\n\n #Main.middle-column-open {\n #LeftColumn {\n transform: translate3d(0, 0, 0);\n opacity: 0;\n }\n }\n\n #Main:not(.right-column-shown) {\n #RightColumn {\n display: none;\n }\n }\n\n #Main:not(.right-column-open) {\n #RightColumn {\n transform: translate3d(10vw, 0, 0);\n opacity: 0;\n }\n }\n\n #Main.right-column-open {\n #MiddleColumn {\n transform: translate3d(0, 0, 0);\n opacity: 0;\n }\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/433.c66cb5158ff9fdb2297f.js b/dist/433.c66cb5158ff9fdb2297f.js new file mode 100644 index 00000000..79e72f1a --- /dev/null +++ b/dist/433.c66cb5158ff9fdb2297f.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[433],{8065:(e,t,s)=>{s.r(t),s.d(t,{Main:()=>ao});var n=s(5116),a=s(3716),o=s(4050),r=(s(7895),s(1752)),i=s(8085),c=s(735),d=s(2858);function l(e){const{chatId:t,threadId:s}=(0,i.Bt)(e)||{};return t&&s?(e=(0,r.qr)(e,t,s,!1),e=(0,r.Pb)(e,t,s,void 0)):e}(0,n.Q6)("openLocalTextSearch",(e=>{const{chatId:t,threadId:s}=(0,i.Bt)(e)||{};if(t&&s)return(0,r.qr)(e,t,s,!0)})),(0,n.Q6)("closeLocalTextSearch",l),(0,n.Q6)("setLocalTextSearchQuery",((e,t,s)=>{const{chatId:n,threadId:a}=(0,i.Bt)(e)||{};if(!n||!a)return;const{query:o}=s,l=(0,d.uw)(n,a),{query:u}=e.localTextSearch.byChatThreadKey[l]||{};return o!==u&&(e=(0,r.Pb)(e,n,a,c.D)),(0,r.qr)(e,n,a,!0,o)})),(0,n.Q6)("setLocalMediaSearchType",((e,t,s)=>{const{chatId:n}=(0,i.Bt)(e)||{};if(!n)return;const{mediaType:a}=s;return(0,r.z5)(e,n,a)})),(0,n.Q6)("openChat",((e,t,s)=>{const{id:a,threadId:o=-1,type:c="thread",shouldReplaceHistory:d=!1}=s,u=(0,i.Bt)(e);return u&&u.chatId===a&&u.threadId===o&&u.type===c||(e=(0,r.pf)(e,a,o,"replyStack",[]),e=l(e=(0,r.i9)(e)),e={...e,messages:{...e.messages,contentToBeScheduled:void 0},...a!==e.forwardMessages.toChatId&&{forwardMessages:{}}},(0,n.R3)(e)),(0,r.Wy)(e,a,o,c,d)})),(0,n.Q6)("openPreviousChat",(e=>(0,r.Wy)(e,void 0))),(0,n.Q6)("openChatWithInfo",((e,t,s)=>{(0,n.R3)({...e,isChatInfoShown:!0}),t.openChat(s)})),(0,n.Q6)("resetChatCreation",(e=>({...e,chatCreation:void 0}))),(0,n.Q6)("setNewChatMembersDialogState",((e,t,s)=>({...e,newChatMembersProgress:s}))),(0,n.Q6)("openNextChat",((e,t,s)=>{const{targetIndexDelta:n,orderedIds:a}=s,{chatId:o}=(0,i.Bt)(e)||{};if(!o)return void t.openChat({id:a[0]});const r=a.indexOf(o);if(-1===r)return;const c=a[r+n];t.openChat({id:c,shouldReplaceHistory:!0})}));var u=s(6137),h=s(1713),m=s(7361),g=s(782);const f=a.ck+a.fK;let p;(0,n.Q6)("setScrollOffset",((e,t,s)=>{const{chatId:n,threadId:a,scrollOffset:o}=s;return(0,r.pf)(e,n,a,"scrollOffset",o)})),(0,n.Q6)("setReplyingToId",((e,t,s)=>{const{messageId:n}=s,a=(0,i.Bt)(e);if(!a)return;const{chatId:o,threadId:c}=a;return(0,r.pf)(e,o,c,"replyingToId",n)})),(0,n.Q6)("setEditingId",((e,t,s)=>{const{messageId:n}=s,a=(0,i.Bt)(e);if(!a)return;const{chatId:o,threadId:c,type:d}=a,l="scheduled"===d?"editingScheduledId":"editingId";return(0,r.pf)(e,o,c,l,n)})),(0,n.Q6)("editLastMessage",(e=>{const{chatId:t,threadId:s}=(0,i.Bt)(e)||{};if(!t||!s)return;const n=(0,i.Zw)(e,t),a=(0,i.Cb)(e,t,s);if(!n||!a)return;const o=(0,g.dF)(a,(t=>Boolean(n[t]&&(0,i._k)(e,n[t],s).canEdit)));return o?(0,r.pf)(e,t,s,"editingId",o):void 0})),(0,n.Q6)("replyToNextMessage",((e,t,s)=>{const{targetIndexDelta:n}=s,{chatId:a,threadId:o}=(0,i.Bt)(e)||{};if(!a||!o)return;const r=(0,i.Zw)(e,a),c=(0,i.Cb)(e,a,o);if(!r||!c)return;const d=(0,i.Yy)(e,a,o);let l;if((0,i.b9)(e,a,o)&&d){const e=Object.keys(r),t=e.indexOf(d.toString())+n;l=t<=e.length+1&&t>=0?Number(e[t]):void 0}else if(o===u._f){var h;const t=(0,i.Z1)(e,a);l=null==t||null===(h=t.lastMessage)||void 0===h?void 0:h.id}else{const t=(0,i.tZ)(e,a,o);l=null==t?void 0:t.lastMessageId}t.setReplyingToId({messageId:l}),t.focusMessage({chatId:a,threadId:o,messageId:l})})),(0,n.Q6)("openMediaViewer",((e,t,s)=>{const{chatId:n,threadId:a,messageId:o,avatarOwnerId:r,profilePhotoIndex:i,origin:c}=s;return{...e,mediaViewer:{chatId:n,threadId:a,messageId:o,avatarOwnerId:r,profilePhotoIndex:i,origin:c},forwardMessages:{}}})),(0,n.Q6)("closeMediaViewer",(e=>({...e,mediaViewer:{}}))),(0,n.Q6)("openAudioPlayer",((e,t,s)=>{const{chatId:n,threadId:a,messageId:o}=s;return{...e,audioPlayer:{chatId:n,threadId:a,messageId:o}}})),(0,n.Q6)("closeAudioPlayer",(e=>({...e,audioPlayer:{}}))),(0,n.Q6)("openPollResults",((e,t,s)=>{const{chatId:a,messageId:o}=s;(0,i.Jf)(e)?a===e.pollResults.chatId&&o===e.pollResults.messageId||(0,n.R3)({...e,pollResults:{chatId:a,messageId:o,voters:{}}}):window.setTimeout((()=>{const e=(0,n.Rd)();(0,n.R3)({...e,pollResults:{chatId:a,messageId:o,voters:{}}})}),450)})),(0,n.Q6)("closePollResults",(e=>{(0,n.R3)({...e,pollResults:{}})})),(0,n.Q6)("focusLastMessage",((e,t)=>{const s=(0,i.Bt)(e);if(!s)return;const{chatId:n,threadId:a}=s;let o;if(a===u._f){var r;const t=(0,i.Z1)(e,n);o=null==t||null===(r=t.lastMessage)||void 0===r?void 0:r.id}else{const t=(0,i.tZ)(e,n,a);o=null==t?void 0:t.lastMessageId}o&&t.focusMessage({chatId:n,threadId:a,messageId:o,noHighlight:!0})})),(0,n.Q6)("focusNextReply",((e,t)=>{const s=(0,i.Bt)(e);if(!s)return;const{chatId:a,threadId:o}=s,c=(0,i.p9)(e,a,o);if(c&&0!==c.length){const s=c.pop();e=(0,r.pf)(e,a,o,"replyStack",[...c]),(0,n.R3)(e),t.focusMessage({chatId:a,threadId:o,messageId:s})}else t.focusLastMessage()})),(0,n.Q6)("focusMessage",((e,t,s)=>{const{chatId:a,threadId:o=u._f,messageListType:c="thread",noHighlight:d,groupedId:l,groupedChatId:m,replyMessageId:g,isResizingContainer:I}=s;let{messageId:v}=s;if(void 0!==l){const t=(0,i.y8)(e,m,l);null!=t&&t.length&&([v]=t)}const y=(0,i.Bt)(e),Z=!y||a!==y.chatId||o!==y.threadId||c!==y.type;if(p&&(clearTimeout(p),p=void 0),p=window.setTimeout((()=>{let e=(0,n.Rd)();e=(0,r.cq)(e),e=(0,r.wV)(e),(0,n.R3)(e)}),d?f:1500),e=(0,r.cq)(e,a,v,d,I),e=(0,r.wV)(e,void 0),g){const t=(0,i.p9)(e,a,o)||[];e=(0,r.pf)(e,a,o,"replyStack",[...t,g])}Z&&(e=(0,r.wV)(e,h.fo.Static));const P=(0,i.Cb)(e,a,o);if(P&&P.includes(v))return(0,n.R3)(e),void t.openChat({id:a,threadId:o});if(Z&&(e=(0,r.pf)(e,a,o,"viewportIds",void 0)),e=(0,r.pf)(e,a,o,"outlyingIds",void 0),P&&!Z){const t=v>P[0]?h.fo.Down:h.fo.Up;e=(0,r.wV)(e,t)}(0,n.R3)(e),t.openChat({id:a,threadId:o}),t.loadViewportMessages()})),(0,n.Q6)("openForwardMenu",((e,t,s)=>{const{fromChatId:n,messageIds:a,groupedId:o}=s;let r;return o&&(r=(0,i.xH)(e,n,o)),{...e,forwardMessages:{fromChatId:n,messageIds:r||a,isModalShown:!0}}})),(0,n.Q6)("exitForwardMode",(e=>{(0,n.R3)({...e,forwardMessages:{}})})),(0,n.Q6)("setForwardChatId",((e,t,s)=>{const{id:a}=s;(0,n.R3)({...e,forwardMessages:{...e.forwardMessages,toChatId:a,isModalShown:!1}}),t.openChat({id:a}),t.closeMediaViewer(),t.exitMessageSelectMode()})),(0,n.Q6)("openForwardMenuForSelectedMessages",((e,t)=>{if(!e.selectedMessages)return;const{chatId:s,messageIds:n}=e.selectedMessages;t.openForwardMenu({fromChatId:s,messageIds:n})})),(0,n.Q6)("enterMessageSelectMode",((e,t,s)=>{const{messageId:n}=s||{},a=(0,i.jr)(e);return a?(0,r.M6)(e,a.id,n):e})),(0,n.Q6)("toggleMessageSelection",((e,t,s)=>{const{messageId:a,groupedId:o,childMessageIds:c,withShift:d}=s,l=(0,i.Bt)(e);if(!l)return;const{chatId:u,threadId:h,type:g}=l;e=(0,r.Ob)(e,u,h,g,a,o,c,d),(0,n.R3)(e),e.shouldShowContextMenuHint&&(t.disableContextMenuHint(),t.showNotification({message:`To **edit** or **reply**, close this menu. Then ${m.$b?"long tap":"right click"} on a message.`}))})),(0,n.Q6)("disableContextMenuHint",(e=>{if(e.shouldShowContextMenuHint)return{...e,shouldShowContextMenuHint:!1}})),(0,n.Q6)("exitMessageSelectMode",r.i9),(0,n.Q6)("openPollModal",(e=>({...e,isPollModalOpen:!0}))),(0,n.Q6)("closePollModal",(e=>({...e,isPollModalOpen:!1}))),(0,n.Q6)("setGlobalSearchQuery",((e,t,s)=>{const{query:n}=s,{chatId:a}=e.globalSearch;return(0,r.No)(e,{globalResults:{},localResults:{},resultsByType:void 0,...n?{fetchingStatus:{chats:!a,messages:!0}}:{fetchingStatus:void 0},query:n})})),(0,n.Q6)("addRecentlyFoundChatId",((e,t,s)=>{const{id:n}=s,{recentlyFoundChatIds:a}=e.globalSearch;if(!a)return(0,r.No)(e,{recentlyFoundChatIds:[n]});const o=a.filter((e=>e!==n));return o.unshift(n),o.length>10&&o.pop(),(0,r.No)(e,{recentlyFoundChatIds:o})})),(0,n.Q6)("clearRecentlyFoundChats",(e=>(0,r.No)(e,{recentlyFoundChatIds:void 0}))),(0,n.Q6)("setGlobalSearchContent",((e,t,s)=>{const{content:n}=s;return(0,r.Og)(e,n)})),(0,n.Q6)("setGlobalSearchChatId",((e,t,s)=>{const{id:n}=s;return(0,r.No)(e,{chatId:n,query:void 0,resultsByType:void 0})})),(0,n.Q6)("setStickerSearchQuery",((e,t,s)=>{const{query:n}=s;return{...e,stickers:{...e.stickers,search:{query:n,resultIds:void 0}}}})),(0,n.Q6)("setGifSearchQuery",((e,t,s)=>{const{query:n}=s;return{...e,gifs:{...e.gifs,search:{query:n,offsetId:void 0,results:void 0}}}})),(0,n.Q6)("openUserInfo",((e,t,s)=>{const{id:n}=s;t.openChat({id:n})})),(0,n.Q6)("openChat",(e=>(0,r.x1)(e,void 0))),(0,n.Q6)("setUserSearchQuery",((e,t,s)=>{const{query:n}=s;return(0,r.Lm)(e,{globalUserIds:void 0,localUserIds:void 0,fetchingStatus:Boolean(n),query:n})})),s(3781);var I=s(1947),v=s(6926);(0,n.Q6)("toggleChatInfo",(e=>({...e,isChatInfoShown:!e.isChatInfoShown}))),(0,n.Q6)("toggleManagement",(e=>{const{chatId:t}=(0,i.Bt)(e)||{};if(t)return{...e,management:{byChatId:{...e.management.byChatId,[t]:{...e.management.byChatId[t],isActive:!(e.management.byChatId[t]||{}).isActive}}}}})),(0,n.Q6)("closeManagement",(e=>{const{chatId:t}=(0,i.Bt)(e)||{};if(t)return{...e,management:{byChatId:{...e.management.byChatId,[t]:{...e.management.byChatId[t],isActive:!1}}}}})),(0,n.Q6)("openChat",(e=>{if(m.wB||m.p7)return{...e,isLeftColumnShown:0===e.messages.messageLists.length}})),(0,n.Q6)("toggleLeftColumn",(e=>({...e,isLeftColumnShown:!e.isLeftColumnShown}))),(0,n.Q6)("addRecentEmoji",((e,t,s)=>{const{emoji:n}=s,{recentEmojis:a}=e;if(!a)return{...e,recentEmojis:[n]};const o=a.filter((e=>e!==n));return o.unshift(n),o.length>18&&o.pop(),{...e,recentEmojis:o}})),(0,n.Q6)("addRecentSticker",((e,t,s)=>{const{sticker:n}=s,{recent:a}=e.stickers;if(!a)return{...e,stickers:{...e.stickers,recent:{hash:0,stickers:[n]}}};const o=a.stickers.filter((e=>e.id!==n.id));return o.unshift(n),{...e,stickers:{...e.stickers,recent:{...a,stickers:o}}}})),(0,n.Q6)("showNotification",((e,t,s)=>{const n=s;n.localId=(0,v.Z)({});const a=[...e.notifications],o=a.findIndex((e=>e.message===n.message));return-1!==o&&a.splice(o,1),a.push(n),{...e,notifications:a}})),(0,n.Q6)("dismissNotification",((e,t,s)=>{const n=e.notifications.filter((({localId:e})=>e!==s.localId));return{...e,notifications:n}})),(0,n.Q6)("showDialog",((e,t,s)=>{const{data:n}=s;if("message"in n&&n.hasErrorKey&&!(0,I.ZP)(n))return e;const a=[...e.dialogs];if("message"in n){const e=a.findIndex((e=>e.message===n.message));-1!==e&&a.splice(e,1)}return a.push(n),{...e,dialogs:a}})),(0,n.Q6)("dismissDialog",(e=>{const t=[...e.dialogs];return t.pop(),{...e,dialogs:t}})),(0,n.Q6)("toggleSafeLinkModal",((e,t,s)=>{const{url:n}=s;return{...e,safeLinkModalUrl:n}})),(0,n.Q6)("openHistoryCalendar",((e,t,s)=>{const{selectedAt:n}=s;return{...e,historyCalendarSelectedAt:n}})),(0,n.Q6)("closeHistoryCalendar",(e=>({...e,historyCalendarSelectedAt:void 0}))),(0,n.Q6)("openPaymentModal",((e,t,s)=>{const{chatId:n,messageId:a}=s;return{...e,payment:{...e.payment,chatId:n,messageId:a,isPaymentModalOpen:!0}}})),(0,n.Q6)("closePaymentModal",(e=>{const t=(0,r.bp)(e);return(0,r.WY)(t)})),(0,n.Q6)("addPaymentError",((e,t,s)=>{const{error:n}=s;return{...e,payment:{...e.payment,error:n}}})),s(1363);var y=s(1226),Z=s(9118);const P=(0,Z.P2)((e=>e()),1e3,!0),C=(0,Z.P2)((e=>e()),3e3,!0),w=(0,Z.Ds)((e=>e()),500,!1,!0);async function b(e,t,s){const o=await(0,y.t9)("fetchChats",{limit:a.Ov,offsetDate:s,archived:"archived"===e,withPinned:void 0===(0,n.Rd)().chats.orderedPinnedIds[e],serverTimeOffset:(0,n.Rd)().serverTimeOffset});if(!o)return;const{chatIds:i}=o;i.length>0&&i[0]===t&&i.shift();let c=(0,n.Rd)();c=(0,r.Sh)(c,(0,g.ee)(o.users,"id")),c=(0,r.GL)(c,(0,g.ee)(o.chats,"id")),c=(0,r.B1)(c,e,i),c=(0,r.vv)(c,e,o),Object.keys(o.draftsById).map(Number).forEach((e=>{c=(0,r.pf)(c,e,u._f,"draft",o.draftsById[e])})),Object.keys(o.replyingToById).map(Number).forEach((e=>{c=(0,r.pf)(c,e,u._f,"replyingToId",o.replyingToById[e])})),0!==i.length||c.chats.isFullyLoaded[e]||(c={...c,chats:{...c.chats,isFullyLoaded:{...c.chats.isFullyLoaded,[e]:!0}}}),(0,n.R3)(c)}async function M(e){const t=await(0,y.t9)("fetchFullChat",e);if(!t)return;const{users:s,fullInfo:a}=t;let o=(0,n.Rd)();s&&(o=(0,r.Sh)(o,(0,g.ee)(s,"id"))),o=(0,r.a4)(o,e.id,{fullInfo:a}),(0,n.R3)(o)}async function S(e,t,s){const a=(0,n.Rd)(),o=(0,i.DI)(a,t);if(o&&!o.isMin)return void(s?e.focusMessage({chatId:o.id,messageId:s}):e.openChat({id:o.id}));const c=(0,i.jr)(a);e.openChat({id:-1});const d=await(0,y.t9)("getChatByUsername",t);if(!d)return c&&e.openChat({id:c.id}),void e.showNotification({message:"User does not exist"});(0,n.R3)((0,r.a4)((0,n.Rd)(),d.id,d)),s?e.focusMessage({chatId:d.id,messageId:s}):e.openChat({id:d.id})}(0,n.Q6)("preloadTopChatMessages",((e,t)=>{(async()=>{const s=[];for(let o=0;oe!==c&&!s.includes(e)));if(!m)return;s.push(m.id),t.loadViewportMessages({chatId:m.id,threadId:u._f})}})()})),(0,n.Q6)("openChat",((e,t,s)=>{const{id:n,threadId:a}=s,{currentUserId:o}=e,r=(0,i.Z1)(e,n);if(null!=r&&r.hasUnreadMark&&t.toggleChatUnread({id:n}),r&&r.lastMessage&&r.lastMessage.threadInfo&&t.requestThreadInfoUpdate({chatId:r.lastMessage.threadInfo.chatId,threadId:r.lastMessage.threadInfo.threadId}),r)(0,d.Hp)(r)&&!r.isMin&&t.requestChatUpdate({chatId:n});else if(n===o)(0,y.t9)("fetchChat",{type:"self"});else{const t=(0,i.dy)(e,n);t&&(0,y.t9)("fetchChat",{type:"user",user:t})}a!==u._f&&((0,i.qS)(e,n,a)||t.requestThreadInfoUpdate({chatId:n,threadId:a}))})),(0,n.Q6)("openSupportChat",((e,t)=>{const s=(0,i.P_)(e);t.openChat({id:s?s.id:-1}),s||(async()=>{const e=await(0,y.t9)("fetchChat",{type:"support"});e&&t.openChat({id:e.chatId})})()})),(0,n.Q6)("openTipsChat",((e,t,s)=>{const{langCode:n}=s,o="pt-br"===n?"BR":a.Db.includes(n)?n.toUpperCase():"";t.openChatByUsername({username:`${a.vi}${o}`})})),(0,n.Q6)("loadMoreChats",((e,t,s)=>{const{listType:n="active"}=s,a=e.chats.listIds[n];if(e.chats.isFullyLoaded[n])return;const o=a?a.map((t=>e.chats.byId[t])).filter((t=>Boolean(null==t?void 0:t.lastMessage)&&!(0,i.ep)(e,t.id))).sort(((e,t)=>e.lastMessage.date-t.lastMessage.date))[0]:void 0;P(o?()=>b(n,o.id,o.lastMessage.date):()=>b(n))})),(0,n.Q6)("loadFullChat",((e,t,s)=>{const{chatId:n,force:a}=s,o=(0,i.Z1)(e,n);o&&(a?M(o):w((()=>M(o))))})),(0,n.Q6)("loadTopChats",(()=>{C((()=>b("active")))})),(0,n.Q6)("requestChatUpdate",((e,t,s)=>{const{serverTimeOffset:n}=e,{chatId:a}=s,o=(0,i.Z1)(e,a);o&&(0,y.t9)("requestChatUpdate",{chat:o,serverTimeOffset:n})})),(0,n.Q6)("updateChatMutedState",((e,t,s)=>{const{serverTimeOffset:a}=e,{chatId:o,isMuted:c}=s,d=(0,i.Z1)(e,o);d&&((0,n.R3)((0,r.a4)(e,o,{isMuted:c})),(0,y.t9)("updateChatMutedState",{chat:d,isMuted:c,serverTimeOffset:a}))})),(0,n.Q6)("createChannel",((e,t,s)=>{const{title:a,about:o,photo:c,memberIds:d}=s;!async function(e,t,s,a){(0,n.R3)({...(0,n.Rd)(),chatCreation:{progress:h.Nh.InProgress}});const o=await(0,y.t9)("createChannel",{title:e,about:s,users:t});if(!o)return;const{id:i,accessHash:c}=o;let d=(0,n.Rd)();d=(0,r.a4)(d,i,o),d={...d,chatCreation:{...d.chatCreation,progress:o?h.Nh.Complete:h.Nh.Error}},(0,n.R3)(d),(0,n.uC)().openChat({id:i}),i&&c&&a&&await(0,y.t9)("editChatPhoto",{chatId:i,accessHash:c,photo:a})}(a,d.map((t=>(0,i.dy)(e,t))).filter(Boolean),o,c)})),(0,n.Q6)("joinChannel",((e,t,s)=>{const{chatId:n}=s,a=(0,i.Z1)(e,n);if(!a)return;const{id:o,accessHash:r}=a;o&&r&&(0,y.t9)("joinChannel",{channelId:o,accessHash:r})})),(0,n.Q6)("deleteChatUser",((e,t,s)=>{(async()=>{const{chatId:n,userId:a}=s,o=(0,i.Z1)(e,n),r=(0,i.dy)(e,a);if(!o||!r)return;await(0,y.t9)("deleteChatUser",{chat:o,user:r});const c=(0,i.Bt)(e);c&&c.chatId===n&&e.currentUserId===a&&t.openChat({id:void 0})})()})),(0,n.Q6)("deleteChat",((e,t,s)=>{(async()=>{const{chatId:n}=s,a=(0,i.Z1)(e,n);if(!a)return;await(0,y.t9)("deleteChat",{chatId:a.id});const o=(0,i.Bt)(e);o&&o.chatId===n&&t.openChat({id:void 0})})()})),(0,n.Q6)("leaveChannel",((e,t,s)=>{(async()=>{const{chatId:n}=s,a=(0,i.Z1)(e,n);if(!a)return;const{id:o,accessHash:r}=a;o&&r&&await(0,y.t9)("leaveChannel",{channelId:o,accessHash:r});const c=(0,i.Bt)(e);c&&c.chatId===n&&t.openChat({id:void 0})})()})),(0,n.Q6)("deleteChannel",((e,t,s)=>{(async()=>{const{chatId:n}=s,a=(0,i.Z1)(e,n);if(!a)return;const{id:o,accessHash:r}=a;o&&r&&await(0,y.t9)("deleteChannel",{channelId:o,accessHash:r});const c=(0,i.Bt)(e);c&&c.chatId===n&&t.openChat({id:void 0})})()})),(0,n.Q6)("createGroupChat",((e,t,s)=>{const{title:a,memberIds:o,photo:c}=s;!async function(e,t,s){(0,n.R3)({...(0,n.Rd)(),chatCreation:{progress:h.Nh.InProgress}});const a=await(0,y.t9)("createGroupChat",{title:e,users:t});if(!a)return;const{id:o}=a;let i=(0,n.Rd)();i=(0,r.a4)(i,o,a),i={...i,chatCreation:{...i.chatCreation,progress:a?h.Nh.Complete:h.Nh.Error}},(0,n.R3)(i),(0,n.uC)().openChat({id:o}),o&&s&&await(0,y.t9)("editChatPhoto",{chatId:o,photo:s})}(a,o.map((t=>(0,i.dy)(e,t))).filter(Boolean),c)})),(0,n.Q6)("toggleChatPinned",((e,t,s)=>{const{id:n,folderId:o}=s,r=(0,i.Z1)(e,n);if(r)if(o){const t=(0,i.Mw)(e,o);if(t){const s=!(0,i.ep)(e,n,o),{pinnedChatIds:a,includedChatIds:r}=t,c=s?[n,...a||[]]:(a||[]).filter((e=>e!==n)),d=[n,...r];(0,y.t9)("editChatFolder",{id:o,folderUpdate:{...t,pinnedChatIds:c,includedChatIds:d}})}}else{const t=(0,i.Ek)(e,n),s=(0,i.ep)(e,n,"archived"===t?a.WS:void 0);(0,y.t9)("toggleChatPinned",{chat:r,shouldBePinned:!s})}})),(0,n.Q6)("toggleChatArchived",((e,t,s)=>{const{id:n}=s,o=(0,i.Z1)(e,n);o&&(0,y.t9)("toggleChatArchived",{chat:o,folderId:(0,d.pE)(o)?0:a.WS})})),(0,n.Q6)("loadChatFolders",(()=>{!async function(){const e=await(0,y.t9)("fetchChatFolders");if(e){const t=(0,n.Rd)();(0,n.R3)({...t,chatFolders:{...t.chatFolders,...e}})}}()})),(0,n.Q6)("loadRecommendedChatFolders",(()=>{!async function(){const e=await(0,y.t9)("fetchRecommendedChatFolders");if(e){const t=(0,n.Rd)();(0,n.R3)({...t,chatFolders:{...t.chatFolders,recommended:e}})}}()})),(0,n.Q6)("editChatFolder",((e,t,s)=>{const{id:n,folderUpdate:a}=s,o=(0,i.Mw)(e,n);o&&(0,y.t9)("editChatFolder",{id:n,folderUpdate:{id:n,emoticon:o.emoticon,pinnedChatIds:o.pinnedChatIds,...a}})})),(0,n.Q6)("addChatFolder",((e,t,s)=>{const{folder:o}=s,{orderedIds:r}=e.chatFolders;!async function(e,t){const{id:s,description:a,...o}=e;if(await(0,y.t9)("editChatFolder",{id:t+1,folderUpdate:{id:t+1,...o}}),!a)return;const r=(0,n.Rd)(),{recommended:i}=r.chatFolders;i&&(0,n.R3)({...r,chatFolders:{...r.chatFolders,recommended:i.filter((({id:e})=>e!==s))}})}(o,null!=r&&r.length?Math.max.apply(Math.max,r):a.WS)})),(0,n.Q6)("deleteChatFolder",((e,t,s)=>{const{id:n}=s;(0,i.Mw)(e,n)&&async function(e){await(0,y.t9)("deleteChatFolder",e)}(n)})),(0,n.Q6)("toggleChatUnread",((e,t,s)=>{const{id:n}=s,{serverTimeOffset:a}=e,o=(0,i.Z1)(e,n);o&&(o.unreadCount?(0,y.t9)("markMessageListRead",{serverTimeOffset:a,chat:o,threadId:u._f}):(0,y.t9)("toggleDialogUnread",{chat:o,hasUnreadMark:!o.hasUnreadMark}))})),(0,n.Q6)("openTelegramLink",((e,t,s)=>{const{url:n}=s;let o=a.Lj.exec(n);if(o){const e=o[1];(async()=>{const s=await(0,y.t9)("openChatByInvite",e);s&&t.openChat({id:s.chatId})})()}else{o=a.FS.exec(n);const e=o[1],s=o[2]?Number(o[2]):void 0,r=o[3]?Number(o[3]):void 0;"c"===e&&s&&r?t.focusMessage({chatId:-s,messageId:r}):S(t,e,s)}})),(0,n.Q6)("acceptInviteConfirmation",((e,t,s)=>{const{hash:n}=s;(async()=>{const e=await(0,y.t9)("importChatInvite",{hash:n});e&&t.openChat({id:e.id})})()})),(0,n.Q6)("openChatByUsername",((e,t,s)=>{const{username:n}=s;S(t,n)})),(0,n.Q6)("togglePreHistoryHidden",((e,t,s)=>{const{chatId:n,isEnabled:a}=s;let o=(0,i.Z1)(e,n);o&&(async()=>{if((0,d.G9)(o)){if(o=await(0,y.t9)("migrateChat",o),!o)return;t.openChat({id:o.id})}(0,y.t9)("togglePreHistoryHidden",{chat:o,isEnabled:a})})()})),(0,n.Q6)("updateChatDefaultBannedRights",((e,t,s)=>{const{chatId:n,bannedRights:a}=s,o=(0,i.Z1)(e,n);o&&(0,y.t9)("updateChatDefaultBannedRights",{chat:o,bannedRights:a})})),(0,n.Q6)("updateChatMemberBannedRights",((e,t,s)=>{const{chatId:a,userId:o,bannedRights:c}=s;let l=(0,i.Z1)(e,a);const u=(0,i.dy)(e,o);l&&u&&(async()=>{if((0,d.G9)(l)){if(l=await(0,y.t9)("migrateChat",l),!l)return;t.openChat({id:l.id})}await(0,y.t9)("updateChatMemberBannedRights",{chat:l,user:u,bannedRights:c});const e=(0,n.Rd)(),s=(0,i.Z1)(e,a);if(!s||!s.fullInfo)return;const{members:h,kickedMembers:m}=s.fullInfo,g=!!c.viewMessages,f=!Object.keys(c).length;(0,n.R3)((0,r.a4)(e,a,{fullInfo:{...s.fullInfo,...h&&g&&{members:h.filter((e=>e.userId!==o))},...h&&!g&&{members:h.map((e=>e.userId===o?{...e,bannedRights:c}:e))},...f&&m&&{kickedMembers:m.filter((e=>e.userId!==o))}}}))})()})),(0,n.Q6)("updateChatAdmin",((e,t,s)=>{const{chatId:a,userId:o,adminRights:c,customTitle:l}=s;let u=(0,i.Z1)(e,a);const h=(0,i.dy)(e,o);u&&h&&(async()=>{if((0,d.G9)(u)){if(u=await(0,y.t9)("migrateChat",u),!u)return;t.openChat({id:u.id})}await(0,y.t9)("updateChatAdmin",{chat:u,user:h,adminRights:c,customTitle:l});const e=(0,n.Rd)(),s=(0,i.Z1)(e,a);if(!s||!s.fullInfo)return;const{adminMembers:m}=s.fullInfo,g=!Object.keys(c).length;(0,n.R3)((0,r.a4)(e,a,{fullInfo:{...s.fullInfo,...m&&g&&{adminMembers:m.filter((e=>e.userId!==o))},...m&&!g&&{adminMembers:m.map((e=>e.userId===o?{...e,adminRights:c,customTitle:l}:e))}}}))})()})),(0,n.Q6)("updateChat",((e,t,s)=>{const{chatId:a,title:o,about:c,photo:d}=s,l=(0,i.Z1)(e,a);l&&(async()=>{(0,n.R3)((0,r.H9)((0,n.Rd)(),h.wv.InProgress)),await Promise.all([l.title!==o?(0,y.t9)("updateChatTitle",l,o):void 0,l.fullInfo&&l.fullInfo.about!==c?(0,y.t9)("updateChatAbout",l,c):void 0,d?(0,y.t9)("editChatPhoto",{chatId:a,accessHash:l.accessHash,photo:d}):void 0]),(0,n.R3)((0,r.H9)((0,n.Rd)(),h.wv.Complete))})()})),(0,n.Q6)("toggleSignatures",((e,t,s)=>{const{chatId:n,isEnabled:a}=s,o=(0,i.Z1)(e,n);o&&(0,y.t9)("toggleSignatures",{chat:o,isEnabled:a})})),(0,n.Q6)("loadGroupsForDiscussion",(()=>{(async()=>{const e=await(0,y.t9)("fetchGroupsForDiscussion");if(!e)return;const t=e.reduce(((e,t)=>(t&&(e[t.id]=t),e)),{}),s=(0,r.fZ)((0,n.Rd)(),t);(0,n.R3)({...s,chats:{...s.chats,forDiscussionIds:Object.keys(t).map(Number)}})})()})),(0,n.Q6)("linkDiscussionGroup",((e,t,s)=>{const{channelId:n,chatId:a}=s,o=(0,i.Z1)(e,n);let r=(0,i.Z1)(e,a);o&&r&&(async()=>{if((0,d.G9)(r)){if(r=await(0,y.t9)("migrateChat",r),!r)return;t.openChat({id:r.id})}let{fullInfo:e}=r;if(!e){const t=await(0,y.t9)("fetchFullChat",r);if(!t)return;e=t.fullInfo}e.isPreHistoryHidden&&await(0,y.t9)("togglePreHistoryHidden",{chat:r,isEnabled:!1}),(0,y.t9)("setDiscussionGroup",{channel:o,chat:r})})()})),(0,n.Q6)("unlinkDiscussionGroup",((e,t,s)=>{var n;const{channelId:a}=s,o=(0,i.Z1)(e,a);if(!o)return;let r;null!==(n=o.fullInfo)&&void 0!==n&&n.linkedChatId&&(r=(0,i.Z1)(e,o.fullInfo.linkedChatId)),(async()=>{await(0,y.t9)("setDiscussionGroup",{channel:o}),r&&M(r)})()})),(0,n.Q6)("setActiveChatFolder",((e,t,s)=>({...e,chatFolders:{...e.chatFolders,activeChatFolder:s}}))),(0,n.Q6)("loadMoreMembers",(e=>{(async()=>{var t,s;const{chatId:a}=(0,i.Bt)(e)||{},o=a?(0,i.Z1)(e,a):void 0;if(!o||(0,d.G9)(o))return;const c=(null===(t=o.fullInfo)||void 0===t||null===(s=t.members)||void 0===s?void 0:s.length)||void 0,l=await(0,y.t9)("fetchMembers",o.id,o.accessHash,"recent",c);if(!l)return;const{members:u,users:h}=l;u&&u.length&&(e=(0,n.Rd)(),e=(0,r.Sh)(e,(0,g.ee)(h,"id")),e=(0,r.a4)(e,o.id,{fullInfo:{...o.fullInfo,members:[...(o.fullInfo||{}).members||[],...u||[]]}}),(0,n.R3)(e))})()})),(0,n.Q6)("addChatMembers",((e,t,s)=>{const{chatId:n,memberIds:a}=s,o=(0,i.Z1)(e,n),r=a.map((t=>(0,i.dy)(e,t))).filter(Boolean);o&&r.length&&(t.setNewChatMembersDialogState(h.WB.Loading),(async()=>{await(0,y.t9)("addChatMembers",o,r),t.setNewChatMembersDialogState(h.WB.Closed),M(o)})())})),(0,n.Q6)("deleteChatMember",((e,t,s)=>{const{chatId:n,userId:a}=s,o=(0,i.Z1)(e,n),r=(0,i.dy)(e,a);o&&r&&(async()=>{await(0,y.t9)("deleteChatMember",o,r),M(o)})()}));const E=new Map,k=(0,Z.Ds)((e=>e()),500,!1);async function R(e,t,s,o,c=!1,d=!1){const l=e.id;let u;switch(o){case h.Uq.Backwards:u=void 0;break;case h.Uq.Around:u=-(Math.round(a.hT/2)+1);break;case h.Uq.Forwards:u=-(a.hT+1)}const m=await(0,y.t9)("fetchMessages",{chat:(0,i.Cm)((0,n.Rd)(),l,t),offsetId:s,addOffset:u,limit:a.hT,threadId:t});if(!m)return;const{messages:f,users:p,chats:I,threadInfos:v}=m,Z=(0,g.ee)(f,"id"),P=Object.keys(Z).map(Number);let C=(0,n.Rd)();C=(0,r.c_)(C,l,Z),C=c?(0,r.ff)(C,l,t,P):(0,r.xj)(C,l,t,P),C=(0,r.Sh)(C,(0,g.ee)(p,"id")),C=(0,r.fZ)(C,(0,g.ee)(I,"id")),C=(0,r.j6)(C,l,v);let w=(0,i.gb)(C,l,t);const b=(0,i.qC)(C,l,t);if(c&&w&&b&&(b.length&&!(0,g.YE)(w,b)||(C=(0,r.xj)(C,l,t,b),w=(0,i.gb)(C,l,t),C=(0,r.pf)(C,l,t,"outlyingIds",void 0),c=!1)),!d){const e=c?b:w,{newViewportIds:n}=T(e,s,o);C=(0,r.y9)(C,l,t,n)}(0,n.R3)(C)}function T(e,t,s){const{length:n}=e,o=t?function(e,t){return te[e.length-1]?e.length-1:e.findIndex(((s,n)=>s===t||st))}(e,t):-1,r=s===h.Uq.Backwards?o:o+1||n,i=r-a.hT,c=r+a.hT-1,d=e.slice(Math.max(0,i),c+1);let l,u;switch(s){case h.Uq.Backwards:l=r>0,u=i>=0;break;case h.Uq.Forwards:l=r0,u=d.length===a.hT}return{newViewportIds:d,areSomeLocal:l,areAllLocal:u}}async function N(e){let t;const s=e.attachment?(e,a)=>{E.has(a)||(t=a,E.set(a,s));const o=(0,n.Rd)();(0,n.R3)({...o,fileUploads:{byMessageLocalId:{...o.fileUploads.byMessageLocalId,[a]:{progress:e}}}})}:void 0;(e.replyingTo||m.cj)&&await(0,Z.Pn)();const a=(0,n.Rd)();e.serverTimeOffset=a.serverTimeOffset;const o=(0,i.Bt)(a);if(!o)return;const{threadId:r}=o;e.replyingTo||r===u._f||(e.replyingTo=(0,i.qS)(a,e.chat.id,r)),await(0,y.t9)("sendMessage",e,s),s&&t&&E.delete(t)}(0,n.Q6)("loadViewportMessages",((e,t,s)=>{const{direction:n=h.Uq.Around,isBudgetPreload:o=!1}=s||{};let{chatId:c,threadId:d}=s||{};if(!c){const t=(0,i.Bt)(e);if(!t)return;c=t.chatId,d=t.threadId}const l=(0,i.Z1)(e,c);if(!l||l.isRestricted)return;const u=(0,i.Cb)(e,c,d),m=(0,i.gb)(e,c,d),g=(0,i.qC)(e,c,d);if(u&&u.length&&n!==h.Uq.Around){const s=n===h.Uq.Backwards?u[0]:u[u.length-1],a=Boolean(g),i=a?g:m,{newViewportIds:f,areSomeLocal:p,areAllLocal:I}=T(i,s,n);if(p&&(e=(0,r.y9)(e,c,d,f)),async function(e,t,s,n,a,o,r,i){t||await R(a,o,i,r,s,n),n||(await Promise.resolve(),e.loadViewportMessages({chatId:a.id,threadId:o,direction:r,isBudgetPreload:!0}))}(t,I,a,o,l,d,n,s),o)return}else{const t=(0,i.G$)(e,c)||(0,i.rd)(e,c,d),s=Boolean(t&&m&&!m.includes(t)),n=(s?g:m)||[],{newViewportIds:u,areSomeLocal:f,areAllLocal:p}=T(n,t,h.Uq.Around);f&&u.length>=a.hT&&(e=(0,r.y9)(e,c,d,u)),p||R(l,d,t,h.Uq.Around,s,o)}return e})),(0,n.Q6)("loadMessage",((e,t,s)=>{const{chatId:a,messageId:o,replyOriginForId:c,threadUpdate:d}=s,l=(0,i.Z1)(e,a);l&&(async()=>{const e=await async function(e,t,s){const a=await(0,y.t9)("fetchMessage",{chat:e,messageId:t});if(!a)return;if(a===u._Q){if(s){let t=(0,n.Rd)();const a=(0,i.hj)(t,e.id,s);t=(0,r.cY)(t,e.id,s,{...a,replyToMessageId:void 0}),(0,n.R3)(t)}return}let o=(0,n.Rd)();return o=(0,r.cY)(o,e.id,t,a.message),o=(0,r.Sh)(o,(0,g.ee)(a.users,"id")),(0,n.R3)(o),a.message}(l,o,c);if(e&&d){const{lastMessageId:t,isDeleting:s}=d;(0,n.R3)((0,r.lG)((0,n.Rd)(),e,a,t,s))}})()})),(0,n.Q6)("sendMessage",((e,t,s)=>{const n=(0,i.Bt)(e);if(!n)return;const{chatId:o,threadId:r,type:c}=n;if("scheduled"===c&&!s.scheduledAt)return{...e,messages:{...e.messages,contentToBeScheduled:s}};const d=(0,i.Z1)(e,o);t.setReplyingToId({messageId:void 0}),t.clearWebPagePreview({chatId:o,threadId:r,value:!1});const l={...s,chat:d,replyingTo:(0,i.Yy)(e,o,r),noWebPage:(0,i.tV)(e,o,r)},u=!s.attachments||s.attachments.length<=1,h=!u&&s.attachments&&s.attachments.length>1;if(u){const{attachments:e,...t}=l;N({...t,attachment:e?e[0]:void 0})}else if(h){const{text:e,entities:t,attachments:s,...n}=l,o=(0,g.Vl)(s,a.DU);for(let s=0;s0?i:void 0}),r.forEach((e=>{N({...n,attachment:e,groupedId:i})}))}}else{const{text:e,entities:t,attachments:s,replyingTo:n,...a}=l;e&&N({...a,text:e,entities:t,replyingTo:n}),s.forEach((e=>{N({...a,attachment:e})}))}})),(0,n.Q6)("editMessage",((e,t,s)=>{const{serverTimeOffset:n}=e,{text:a,entities:o}=s,r=(0,i.Bt)(e);if(!r)return;const{chatId:c,threadId:d,type:l}=r,u=(0,i.Z1)(e,c),h=(0,i.kK)(e,c,d,l);u&&h&&((0,y.t9)("editMessage",{chat:u,message:h,text:a,entities:o,noWebPage:(0,i.tV)(e,c,d),serverTimeOffset:n}),t.setEditingId({messageId:void 0}))})),(0,n.Q6)("cancelSendingMessage",((e,t,s)=>{const{chatId:n,messageId:a}=s,o=(0,i.hj)(e,n,a),r=o&&E.get(o.previousLocalId||o.id);r&&(0,y.u3)(r),t.apiUpdate({"@type":"deleteMessages",ids:[a],chatId:n})})),(0,n.Q6)("saveDraft",((e,t,s)=>{const{chatId:n,threadId:a,draft:o}=s;if(!o)return;const{text:c,entities:d}=o,l=(0,i.Z1)(e,n);return a===u._f&&(0,y.t9)("saveDraft",{chat:l,text:c,entities:d,replyToMsgId:(0,i.Yy)(e,n,a)}),e=(0,r.pf)(e,n,a,"draft",o),(0,r.a4)(e,n,{draftDate:Math.round(Date.now()/1e3)})})),(0,n.Q6)("clearDraft",((e,t,s)=>{const{chatId:n,threadId:a,localOnly:o}=s;if(!(0,i.Ms)(e,n,a))return;const c=(0,i.Z1)(e,n);return o||a!==u._f||(0,y.t9)("clearDraft",c),e=(0,r.pf)(e,n,a,"draft",void 0),(0,r.a4)(e,n,{draftDate:void 0})})),(0,n.Q6)("toggleMessageWebPage",((e,t,s)=>{const{chatId:n,threadId:a,noWebPage:o}=s;return(0,r.pf)(e,n,a,"noWebPage",o)})),(0,n.Q6)("pinMessage",((e,t,s)=>{const n=(0,i.jr)(e);if(!n)return;const{messageId:a,isUnpin:o,isOneSide:r,isSilent:c}=s;(0,y.t9)("pinMessage",{chat:n,messageId:a,isUnpin:o,isOneSide:r,isSilent:c})})),(0,n.Q6)("unpinAllMessages",((e,t,s)=>{const a=(0,i.Z1)(e,s.chatId);a&&async function(e){await(0,y.t9)("unpinAllMessages",{chat:e});let t=(0,n.Rd)();t=(0,r.pf)(t,e.id,u._f,"pinnedIds",[]),(0,n.R3)(t)}(a)})),(0,n.Q6)("deleteMessages",((e,t,s)=>{const{messageIds:n,shouldDeleteForAll:a}=s,o=(0,i.Bt)(e);if(!o)return;const{chatId:r,threadId:c}=o,d=(0,i.Z1)(e,r);(0,y.t9)("deleteMessages",{chat:d,messageIds:n,shouldDeleteForAll:a});const l=(0,i._$)(e,r,c);n.includes(l)&&t.setEditingId({messageId:void 0})})),(0,n.Q6)("deleteScheduledMessages",((e,t,s)=>{const{messageIds:n}=s,a=(0,i.Bt)(e);if(!a)return;const{chatId:o}=a,r=(0,i.Z1)(e,o);(0,y.t9)("deleteScheduledMessages",{chat:r,messageIds:n});const c=(0,i.wU)(e,o);n.includes(c)&&t.setEditingId({messageId:void 0})})),(0,n.Q6)("deleteHistory",((e,t,s)=>{(async()=>{var n;const{chatId:a,shouldDeleteForAll:o}=s,r=(0,i.Z1)(e,a);if(!r)return;const c=null===(n=r.lastMessage)||void 0===n?void 0:n.id;await(0,y.t9)("deleteHistory",{chat:r,shouldDeleteForAll:o,maxId:c});const d=(0,i.Bt)(e);d&&d.chatId===a&&t.openChat({id:void 0})})()})),(0,n.Q6)("reportMessages",((e,t,s)=>{(async()=>{const{messageIds:n,reason:a,description:o}=s,r=(0,i.Bt)(e);if(!r)return;const{chatId:c}=r,d=(0,i.Z1)(e,c),l=await(0,y.t9)("reportMessages",{peer:d,messageIds:n,reason:a,description:o});t.showNotification({message:l?"Thank you! Your report will be reviewed by our team.":"Error occured while submiting report. Please, try again later."})})()})),(0,n.Q6)("markMessageListRead",((e,t,s)=>{const{serverTimeOffset:n}=e,a=(0,i.Bt)(e);if(!a)return;const{chatId:o,threadId:c}=a,d=(0,i.Cm)(e,o,c);if(!d)return;const{maxId:l}=s;if(k((()=>{(0,y.t9)("markMessageListRead",{serverTimeOffset:n,chat:d,threadId:c,maxId:l})})),c!==u._f)return;const h=(0,i.Cb)(e,o,c),m=(0,i.It)(e,o,c);if(!h||!m||!d.unreadCount)return;const g=function(e,t,s){let n=0;for(let a=0,o=e.length;a=t&&e[a]<=s&&n++,!(e[a]>=s));a++);return n}(h,m,l);return g?(0,r.a4)(e,o,{lastReadInboxMessageId:l,unreadCount:Math.max(0,d.unreadCount-g)}):void 0})),(0,n.Q6)("markMessagesRead",((e,t,s)=>{const n=(0,i.jr)(e);if(!n)return;const{messageIds:a}=s;(0,y.t9)("markMessagesRead",{chat:n,messageIds:a})})),(0,n.Q6)("loadWebPagePreview",((e,t,s)=>{const{text:a}=s;!async function(e){const t=await(0,y.t9)("fetchWebPagePreview",{message:e});(0,n.R3)({...(0,n.Rd)(),webPagePreview:t})}(a)})),(0,n.Q6)("clearWebPagePreview",(e=>{if(e.webPagePreview)return{...e,webPagePreview:void 0}})),(0,n.Q6)("sendPollVote",((e,t,s)=>{const{chatId:n,messageId:a,options:o}=s,r=(0,i.Z1)(e,n);r&&(0,y.t9)("sendPollVote",{chat:r,messageId:a,options:o})})),(0,n.Q6)("loadPollOptionResults",((e,t,s)=>{const{chat:a,messageId:o,option:i,offset:c,limit:d,shouldResetVoters:l}=s;!async function(e,t,s,a,o,i){const c=await(0,y.t9)("loadPollOptionResults",{chat:e,messageId:t,option:s,offset:a,limit:o});if(!c)return;let d=(0,n.Rd)();d=(0,r.Sh)(d,(0,g.ee)(c.users,"id"));const{voters:l}=d.pollResults;(0,n.R3)({...d,pollResults:{...d.pollResults,voters:{...l,[s]:[...!i&&l&&l[s]?l[s]:[],...c&&c.users.map((e=>e.id))].filter(((e,t,s)=>s.indexOf(e)===t))},offsets:{...d.pollResults.offsets?d.pollResults.offsets:{},[s]:c.nextOffset||""}}})}(a,o,i,c,d,l)})),(0,n.Q6)("forwardMessages",(e=>{const{fromChatId:t,messageIds:s,toChatId:a}=e.forwardMessages,o=t?(0,i.Z1)(e,t):void 0,r=a?(0,i.Z1)(e,a):void 0,c=t&&s?s.sort(((e,t)=>e-t)).map((s=>(0,i.hj)(e,t,s))).filter(Boolean):void 0;o&&r&&c&&c.length&&function(e,t,s){(0,y.t9)("forwardMessages",{fromChat:e,toChat:t,messages:s,serverTimeOffset:(0,n.Rd)().serverTimeOffset}),(0,n.R3)({...(0,n.Rd)(),forwardMessages:{}})}(o,r,c)})),(0,n.Q6)("loadScheduledHistory",(e=>{const t=(0,i.jr)(e);if(!t)return;const{hash:s}=e.scheduledMessages.byChatId[t.id]||{};!async function(e,t){const s=await(0,y.t9)("fetchScheduledHistory",{chat:e,hash:t});if(!s)return;const{hash:a,messages:o}=s,i=(0,g.ee)(o,"id"),c=Object.keys(i).map(Number).sort(((e,t)=>t-e));let d=(0,n.Rd)();d=(0,r.w3)(d,e.id,i,a),d=(0,r.pf)(d,e.id,u._f,"scheduledIds",c),(0,n.R3)(d)}(t,s)})),(0,n.Q6)("sendScheduledMessages",((e,t,s)=>{const{chatId:n,id:a}=s,o=(0,i.Z1)(e,n);o&&(0,y.t9)("sendScheduledMessages",{chat:o,ids:[a]})})),(0,n.Q6)("rescheduleMessage",((e,t,s)=>{const{chatId:n,messageId:a,scheduledAt:o}=s,r=(0,i.Z1)(e,n),c=r&&(0,i.Tm)(e,r.id,a);r&&c&&(0,y.t9)("rescheduleMessage",{chat:r,message:c,scheduledAt:o})})),(0,n.Q6)("requestThreadInfoUpdate",((e,t,s)=>{const{chatId:n,threadId:a}=s,o=(0,i.Cm)(e,n,a);o&&(0,y.t9)("requestThreadInfoUpdate",{chat:o,threadId:a})})),(0,n.Q6)("loadPinnedMessages",((e,t,s)=>{const{chatId:a}=s,o=(0,i.Z1)(e,a);o&&async function(e){const t=await(0,y.t9)("fetchPinnedMessages",{chat:e});if(!t)return;const{messages:s,chats:a,users:o}=t,i=(0,g.ee)(s,"id"),c=Object.keys(i).map(Number).sort(((e,t)=>t-e));let d=(0,n.Rd)();d=(0,r.c_)(d,e.id,i),d=(0,r.pf)(d,e.id,u._f,"pinnedIds",c),d=(0,r.Sh)(d,(0,g.ee)(o,"id")),d=(0,r.fZ)(d,(0,g.ee)(a,"id")),(0,n.R3)(d)}(o)}));var B=s(5765);const x=(0,Z.P2)((e=>e()),500,!1);async function A(e,t){const s=await(0,y.t9)("searchGifs",{query:e,offset:t});s&&(0,n.R3)((0,r.rq)((0,n.Rd)(),!t,s.gifs,s.nextOffset))}(0,n.Q6)("loadStickerSets",(e=>{const{hash:t}=e.stickers.added||{};!async function(e=0){const t=await(0,y.t9)("fetchStickerSets",{hash:e});t&&(0,n.R3)((0,r.z3)((0,n.Rd)(),"added",t.hash,t.sets))}(t)})),(0,n.Q6)("loadAddedStickers",((e,t)=>{const{setIds:s}=e.stickers.added;s&&s.length&&(async()=>{for(let e=0;e0&&await(0,Z.wO)(500)})()})),(0,n.Q6)("loadRecentStickers",(e=>{const{hash:t}=e.stickers.recent||{};!async function(e=0){const t=await(0,y.t9)("fetchRecentStickers",{hash:e});if(!t)return;const s=(0,n.Rd)();(0,n.R3)({...s,stickers:{...s.stickers,recent:t}})}(t)})),(0,n.Q6)("loadFavoriteStickers",(e=>{const{hash:t}=e.stickers.favorite||{};!async function(e=0){const t=await(0,y.t9)("fetchFavoriteStickers",{hash:e});if(!t)return;const s=(0,n.Rd)();(0,n.R3)({...s,stickers:{...s.stickers,favorite:t}})}(t)})),(0,n.Q6)("loadGreetingStickers",(e=>{const{hash:t}=e.stickers.greeting||{};(async()=>{const e=await(0,y.t9)("fetchStickersForEmoji",{emoji:"👋⭐️",hash:t});if(!e)return;const s=(0,n.Rd)();(0,n.R3)({...s,stickers:{...s.stickers,greeting:{hash:e.hash,stickers:e.stickers.filter((e=>"👋"===e.emoji))}}})})()})),(0,n.Q6)("loadFeaturedStickers",(e=>{const{hash:t}=e.stickers.featured||{};!async function(e=0){const t=await(0,y.t9)("fetchFeaturedStickers",{hash:e});t&&(0,n.R3)((0,r.z3)((0,n.Rd)(),"featured",t.hash,t.sets))}(t)})),(0,n.Q6)("loadStickers",((e,t,s)=>{const{stickerSetId:a,stickerSetShortName:o}=s;let{stickerSetAccessHash:c}=s;if(!c&&!o){const t=(0,i.Ny)(e,a);if(!t)return;c=t.accessHash}!async function(e,t,s){const a=await(0,y.t9)("fetchStickers",{stickerSetShortName:s,stickerSetId:e,accessHash:t});if(!a)return;const{set:o,stickers:i,packs:c}=a;let d=(0,n.Rd)();d=(0,r.Rg)(d,o.id,{...o,stickers:i,packs:c});const l=d.stickers.forEmoji.emoji;l&&c[l]&&(d=(0,r.vy)(d)),(0,n.R3)(d)}(a,c,o)})),(0,n.Q6)("loadAnimatedEmojis",(()=>{!async function(){const e=await(0,y.t9)("fetchAnimatedEmojis");if(!e)return;const{set:t,stickers:s}=e;(0,n.R3)((0,r.g_)((0,n.Rd)(),{...t,stickers:s}))}()})),(0,n.Q6)("loadSavedGifs",(e=>{const{hash:t}=e.gifs.saved;!async function(e=0){const t=await(0,y.t9)("fetchSavedGifs",{hash:e});if(!t)return;const s=(0,n.Rd)();(0,n.R3)({...s,gifs:{...s.gifs,saved:t}})}(t)})),(0,n.Q6)("faveSticker",((e,t,s)=>{const{sticker:n}=s;n&&(0,y.t9)("faveSticker",{sticker:n})})),(0,n.Q6)("unfaveSticker",((e,t,s)=>{const{sticker:a}=s;a&&function(e){const t=(0,n.Rd)();(0,n.R3)({...t,stickers:{...t.stickers,favorite:{...t.stickers.favorite,stickers:t.stickers.favorite.stickers.filter((({id:t})=>t!==e.id))}}}),(0,y.t9)("faveSticker",{sticker:e,unfave:!0})}(a)})),(0,n.Q6)("toggleStickerSet",((e,t,s)=>{const{stickerSetId:n}=s,a=(0,i.Ny)(e,n);if(!a)return;const{accessHash:o,installedDate:r}=a;(0,y.t9)(r?"uninstallStickerSet":"installStickerSet",{stickerSetId:n,accessHash:o})})),(0,n.Q6)("loadEmojiKeywords",((e,t,s)=>{var a;const{language:o}=s;let r=e.emojiKeywords[o];null!==(a=r)&&void 0!==a&&a.isLoading||((0,n.R3)({...e,emojiKeywords:{...e.emojiKeywords,[o]:{...r,isLoading:!0}}}),(async()=>{var t;const s=await(0,y.t9)("fetchEmojiKeywords",{language:o,fromVersion:r?r.version:0});e=(0,n.Rd)(),r=e.emojiKeywords[o],s?(0,n.R3)({...e,emojiKeywords:{...e.emojiKeywords,[o]:{isLoading:!1,version:s.version,keywords:{...null===(t=r)||void 0===t?void 0:t.keywords,...s.keywords}}}}):(0,n.R3)({...e,emojiKeywords:{...e.emojiKeywords,[o]:{...r,isLoading:!1}}})})())})),(0,n.Q6)("setStickerSearchQuery",((e,t,s)=>{const{query:a}=s;a&&x((()=>{!async function(e,t=0){const s=await(0,y.t9)("searchStickers",{query:e,hash:t});if(!s)return;const a=(0,n.Rd)(),{setsById:o,added:i}=a.stickers,c=s.sets.map((({id:e})=>e));i.setIds&&i.setIds.forEach((t=>{if(!c.includes(t)){const{title:s}=o[t]||{};s&&(0,B.Z)(s,e)&&c.unshift(t)}})),(0,n.R3)((0,r.z3)(a,"search",s.hash,s.sets,c))}(a)}))})),(0,n.Q6)("setGifSearchQuery",((e,t,s)=>{const{query:n}=s;"string"==typeof n&&x((()=>{A(n)}))})),(0,n.Q6)("searchMoreGifs",(e=>{const{query:t,offset:s}=e.gifs.search;"string"==typeof t&&x((()=>{A(t,s)}))})),(0,n.Q6)("loadStickersForEmoji",((e,t,s)=>{const{emoji:a}=s,{hash:o}=e.stickers.forEmoji;x((()=>{!async function(e,t=0){let s=(0,n.Rd)();(0,n.R3)({...s,stickers:{...s.stickers,forEmoji:{...s.stickers.forEmoji,emoji:e}}});const a=await(0,y.t9)("fetchStickersForEmoji",{emoji:e,hash:t});s=(0,n.Rd)(),a&&s.stickers.forEmoji.emoji===e&&(s=(0,r.IM)(s,e,a.stickers,a.hash),(0,n.R3)(s))}(a,o)}))})),(0,n.Q6)("clearStickersForEmoji",(e=>({...e,stickers:{...e.stickers,forEmoji:{}}}))),(0,n.Q6)("openStickerSetShortName",((e,t,s)=>{const{stickerSetShortName:n}=s;return{...e,openedStickerSetShortName:n}}));var L=s(790);const O=(0,Z.P2)((e=>e()),500,!1);async function F(e="",t,s,o,c,d){let l;if(o){const n=await(0,y.t9)("searchMessagesLocal",{chatOrUser:o,query:e,type:t,limit:a.Hk,offsetId:s,minDate:d,maxDate:c});if(n){const{messages:e,users:t,totalCount:s,nextOffsetId:a}=n;l={messages:e,users:t,chats:[],totalCount:s,nextRate:a}}}else l=await(0,y.t9)("searchMessagesGlobal",{query:e,offsetRate:s,limit:a.Hk,type:t,maxDate:c,minDate:d});let u=(0,n.Rd)();const h=(0,i.JX)(u);if(!l||""!==e&&e!==h)return void(0,n.R3)((0,r.xv)(u,{messages:!1}));const{messages:m,users:f,chats:p,totalCount:I,nextRate:v}=l;p.length&&(u=(0,r.fZ)(u,(0,g.ee)(p,"id"))),f.length&&(u=(0,r.Sh)(u,(0,g.ee)(f,"id"))),m.length&&(u=(0,r.m6)(u,m)),u=(0,r.px)(u,m,I,t,v),(0,n.R3)(u)}async function U(){const e=await(0,y.t9)("fetchChats",{limit:a.Ov,archived:!0,withPinned:!0,serverTimeOffset:(0,n.Rd)().serverTimeOffset});if(!e)return;let t=(0,n.Rd)();t=(0,r.eD)(t,(0,g.ee)(e.users,"id")),t=(0,r.GL)(t,(0,g.ee)(e.chats,"id")),t=(0,r.Mg)(t,"archived",e.chatIds),t=(0,r.vv)(t,"archived",e),(0,n.R3)(t)}async function $(){let e=(0,n.Rd)();const{recentlyFoundChatIds:t}=e.globalSearch,{userIds:s}=e.contactList||{};if(!(s&&s.length||t&&t.length))return;const a=[...t||[],...s||[]].map((t=>(0,i.dy)(e,t))).filter(Boolean),o=await(0,y.t9)("fetchUsers",{users:a});o&&(e=(0,n.Rd)(),e=(0,r.eD)(e,(0,g.ee)(o,"id")),(0,n.R3)(e))}function Q(e){return(0,y.t9)("fetchMessages",{chat:e,threadId:u._f,offsetId:e.lastReadInboxMessageId,addOffset:-(Math.round(a.hT/2)+1),limit:a.hT})}(0,n.Q6)("setGlobalSearchQuery",((e,t,s)=>{const{chatId:a}=e.globalSearch,{query:o}=s;o&&!a&&O((()=>{!async function(e){const t=await(0,y.t9)("searchChats",{query:e});let s=(0,n.Rd)();const a=(0,i.JX)(s);if(!t||!a||e!==a)return void(0,n.R3)((0,r.xv)(s,{chats:!1}));const{localChats:o,localUsers:c,globalChats:d,globalUsers:l}=t;(o.length||d.length)&&(s=(0,r.fZ)(s,(0,g.ee)([...o,...d],"id"))),(c.length||l.length)&&(s=(0,r.Sh)(s,(0,g.ee)([...c,...l],"id"))),s=(0,r.xv)(s,{chats:!1}),s=(0,r.No)(s,{localResults:{chatIds:o.map((({id:e})=>e)),userIds:c.map((({id:e})=>e))},globalResults:{...s.globalSearch.globalResults,chatIds:l.map((({id:e})=>e)),userIds:d.map((({id:e})=>e))}}),(0,n.R3)(s)}(o)}))})),(0,n.Q6)("setGlobalSearchDate",((e,t,s)=>{const{date:a}=s,o=a?(0,L.IS)(a):a,c=(0,r.No)(e,{date:a,query:"",resultsByType:{...e.globalSearch.resultsByType,text:{totalCount:void 0,foundIds:[],nextOffsetId:0}}});(0,n.R3)(c);const{chatId:d}=e.globalSearch;F("","text",void 0,d?(0,i.Z1)(e,d):void 0,o,a)})),(0,n.Q6)("searchMessagesGlobal",((e,t,s)=>{var n;const{query:a,resultsByType:o,chatId:r,date:c}=e.globalSearch,d=c?(0,L.IS)(c):c,{type:l}=s;F(a,l,null==o||null===(n=o[l])||void 0===n?void 0:n.nextOffsetId,r?(0,i.Z1)(e,r):void 0,d,c)})),(0,n.Q6)("searchTextMessagesLocal",(e=>{const{chatId:t,threadId:s}=(0,i.Bt)(e)||{},o=t?(0,i.Z1)(e,t):void 0,c=(0,i.n5)(e);if(!o||!c||!s)return;const{query:d,results:l}=c,h=null==l?void 0:l.nextOffsetId;let m;if(s!==u._f){const n=(0,i.tZ)(e,t,s);m=null==n?void 0:n.topMessageId}!async function(e,t,s,o,c){const d=await(0,y.t9)("searchMessagesLocal",{chatOrUser:e,type:"text",query:o,topMessageId:s,limit:a.pn,offsetId:c});if(!d)return;const{messages:l,users:u,totalCount:h,nextOffsetId:m}=d,f=(0,g.ee)(l,"id"),p=Object.keys(f).map(Number);let I=(0,n.Rd)();const v=(0,i.n5)(I);!v||o&&o!==v.query||(I=(0,r.c_)(I,e.id,f),I=(0,r.Sh)(I,(0,g.ee)(u,"id")),I=(0,r.dx)(I,e.id,t,p,h,m),(0,n.R3)(I))}(o,s,m,d,h)})),(0,n.Q6)("searchMediaMessagesLocal",(e=>{const t=(0,i.og)(e),s=t?e.users.byId[t]||e.chats.byId[t]:void 0,o=(0,i.we)(e);if(!s||!o)return;const{currentType:c,resultsByType:d}=o,l=c&&d&&d[c],u=null==l?void 0:l.nextOffsetId;c&&async function(e,t,s){const o=await(0,y.t9)("searchMessagesLocal",{chatOrUser:e,type:t,limit:a.EN,offsetId:s});if(!o)return;const{messages:c,users:d,totalCount:l,nextOffsetId:u}=o,h=(0,g.ee)(c,"id"),m=Object.keys(h).map(Number);let f=(0,n.Rd)();(0,i.we)(f)&&(f=(0,r.c_)(f,e.id,h),f=(0,r.Sh)(f,(0,g.ee)(d,"id")),f=(0,r.c1)(f,e.id,t,m,l,u),(0,n.R3)(f))}(s,c,u)})),(0,n.Q6)("searchMessagesByDate",((e,t,s)=>{const{timestamp:a}=s,{chatId:o}=(0,i.Bt)(e)||{};if(!o)return;const r=(0,i.Z1)(e,o);r&&async function(e,t){const s=await(0,y.t9)("findFirstMessageIdAfterDate",{chat:e,timestamp:t});s&&(0,n.uC)().focusMessage({chatId:e.id,messageId:s})}(r,a)})),(0,n.Q6)("checkPublicLink",((e,t,s)=>{const{chatId:a}=(0,i.Bt)(e)||{};if(!a)return;if(e.management.progress===h.wv.InProgress)return;const{username:o}=s;(async()=>{e=(0,r.H9)(e,h.wv.InProgress),e=(0,r.fw)(e,a,{isUsernameAvailable:void 0}),(0,n.R3)(e);const t=await(0,y.t9)("checkChatUsername",{username:o});e=(0,n.Rd)(),e=(0,r.H9)(e,t?h.wv.Complete:h.wv.Error),e=(0,r.fw)(e,a,{isUsernameAvailable:t}),(0,n.R3)(e)})()})),(0,n.Q6)("updatePublicLink",((e,t,s)=>{const{chatId:a}=(0,i.Bt)(e)||{};let o=a&&(0,i.Z1)(e,a);if(!a||!o)return;const{username:c}=s;(async()=>{if(e=(0,r.H9)(e,h.wv.InProgress),(0,n.R3)(e),(0,d.G9)(o)){if(o=await(0,y.t9)("migrateChat",o),!o)return;t.openChat({id:o.id})}const s=await(0,y.t9)("setChatUsername",{chat:o,username:c});e=(0,n.Rd)(),e=(0,r.H9)(e,s?h.wv.Complete:h.wv.Error),e=(0,r.fw)(e,a,{isUsernameAvailable:void 0}),(0,n.R3)(e)})()})),(0,n.Q6)("updatePrivateLink",(e=>{const{chatId:t}=(0,i.Bt)(e)||{},s=t&&(0,i.Z1)(e,t);t&&s&&(0,y.t9)("updatePrivateLink",{chat:s})})),(0,n.Q6)("sync",((e,t)=>{!async function(e){a.eM&&console.log(">>> START SYNC"),await(0,y.t9)("fetchCurrentUser");const t=await async function(){const e=await(0,y.t9)("fetchChats",{limit:a.Ov,withPinned:!0,serverTimeOffset:(0,n.Rd)().serverTimeOffset});if(!e)return;let t=(0,n.Rd)();const{recentlyFoundChatIds:s}=t.globalSearch,{userIds:o}=t.contactList||{},{currentUserId:c}=t,l=[...s||[],...o||[],...c?[c]:[]],h=l.map((e=>(0,i.dy)(t,e))).filter(Boolean),m=l.map((e=>(0,i.Z1)(t,e))).filter(Boolean),{chatId:f}=(0,i.Bt)(t)||{};if(f){const e=(0,i.Z1)(t,f);if(e&&!l.includes(f)&&m.push(e),(0,d.YA)(f)){const e=(0,i.dy)(t,f);e&&!l.includes(f)&&h.push(e)}}return h.push(...e.users),m.push(...e.chats),t=(0,r.SL)(t,(0,g.ee)(m,"id")),t=(0,r.Mg)(t,"active",e.chatIds),t={...t,chats:{...t.chats}},t=(0,r.vv)(t,"active",e),Object.keys(e.draftsById).map(Number).forEach((s=>{t=(0,r.pf)(t,s,u._f,"draft",e.draftsById[s])})),Object.keys(e.replyingToById).map(Number).forEach((s=>{t=(0,r.pf)(t,s,u._f,"replyingToId",e.replyingToById[s])})),(0,n.R3)(t),f&&!t.chats.byId[f]&&(0,n.uC)().openChat({id:void 0}),h}();await async function(e){let t=!1,s=e||[],a=(0,n.Rd)();const{chatId:o,threadId:c}=(0,i.Bt)(a)||{},d=Object.keys(a.messages.byChatId).map(Number).reduce(((e,t)=>{const s=(0,i.Ms)(a,t,u._f);return s?{...e,[t]:s}:e}),{});if(o){const e=await Q(a.chats.byId[o]);a=(0,n.Rd)();const{chatId:d}=(0,i.Bt)(a)||{},l=c&&(0,i.tZ)(a,o,c);if(e&&d===o){const n=a.messages.byChatId[o],i=(0,g.ee)(e.messages,"id"),d=Object.keys(i).map(Number);if(a={...a,messages:{...a.messages,byChatId:{[o]:{byId:i,threadsById:{[u._f]:{...null==n?void 0:n.threadsById[u._f],listedIds:d,viewportIds:d,outlyingIds:void 0}}}}}},c&&l&&l.originChannelId){const{originChannelId:e}=l,t=a.messages.byChatId[e],s=await Q(a.chats.byId[e]);if(s){const e=(0,g.ee)(s.messages,"id"),r=Object.keys(e).map(Number);a={...a,messages:{...a.messages,byChatId:{...a.messages.byChatId,[l.originChannelId]:{byId:e,threadsById:{[u._f]:{...null==t?void 0:t.threadsById[u._f],listedIds:r,viewportIds:r,outlyingIds:void 0}}},[o]:{...a.messages.byChatId[o],threadsById:{...a.messages.byChatId[o].threadsById,[c]:{...null==n?void 0:n.threadsById[c],outlyingIds:void 0}}}}}}}}a=(0,r.GL)(a,(0,g.ee)(e.chats,"id")),a=(0,r.j6)(a,o,e.threadInfos),t=!0,s=Array.prototype.concat(s,e.users)}}t||(a={...a,messages:{...a.messages,byChatId:{}}}),Object.keys(d).map(Number).forEach((e=>{a=(0,r.pf)(a,e,u._f,"draft",d[e])})),e?a=(0,r.s5)(a,(0,g.ee)(s,"id")):s&&(a=(0,r.eD)(a,(0,g.ee)(s,"id"))),(0,n.R3)(a);const{chatId:l,messageId:h}=a.audioPlayer;l&&h&&!(0,i.hj)(a,l,h)&&(0,n.uC)().closeAudioPlayer()}(t),(0,n.R3)({...(0,n.Rd)(),lastSyncTime:Date.now()}),a.eM&&console.log(">>> FINISH SYNC"),e()}(t.afterSync)})),(0,n.Q6)("afterSync",((e,t)=>{!async function(e){a.eM&&console.log(">>> START AFTER-SYNC"),e.loadFavoriteStickers(),await Promise.all([$(),U()]),await(0,y.t9)("fetchCurrentUser"),a.eM&&console.log(">>> FINISH AFTER-SYNC")}(t)}));var D=s(2267);const q=(0,Z.Ds)((e=>e()),500,!1,!0),G=(0,Z.P2)((e=>e()),500,!1);function H(e,t,s){return{...e,inlineBots:{...e.inlineBots,byUsername:{...e.inlineBots.byUsername,[t]:s}}}}function j(e,t){return{...e,inlineBots:{...e.inlineBots,isLoading:t}}}(0,n.Q6)("loadFullUser",((e,t,s)=>{const{userId:n}=s,a=(0,i.dy)(e,n);if(!a)return;const{id:o,accessHash:r}=a;q((()=>(0,y.t9)("fetchFullUser",{id:o,accessHash:r})))})),(0,n.Q6)("loadUser",((e,t,s)=>{const{userId:a}=s,o=(0,i.dy)(e,a);o&&(async()=>{const t=await(0,y.t9)("fetchUsers",{users:[o]});t&&(e=(0,n.Rd)(),e=(0,r.eD)(e,(0,g.ee)(t,"id")),(0,n.R3)(e))})()})),(0,n.Q6)("loadTopUsers",(e=>{const{topPeers:{hash:t,lastRequestedAt:s}}=e;(!s||(0,D.b)(e.serverTimeOffset)-s>60)&&async function(e){const t=await(0,y.t9)("fetchTopUsers",{hash:e});if(!t)return;const{hash:s,ids:a,users:o}=t;let i=(0,n.Rd)();i=(0,r.Sh)(i,(0,g.ee)(o,"id")),i={...i,topPeers:{...i.topPeers,hash:s,userIds:a,lastRequestedAt:(0,D.b)(i.serverTimeOffset)}},(0,n.R3)(i)}(t)})),(0,n.Q6)("loadContactList",(e=>{const{hash:t}=e.contactList||{};!async function(e){const t=await(0,y.t9)("fetchContactList",{hash:e});if(!t)return;let s=(0,r.Sh)((0,n.Rd)(),(0,g.ee)(t.users,"id"));s=(0,r.fZ)(s,(0,g.ee)(t.chats,"id"));const a=e=>e.lastName||e.firstName||"",o=new Intl.Collator("en-US"),i=t.users.sort(((e,t)=>o.compare(a(e),a(t)))).filter((e=>!e.isSelf));(0,n.R3)({...s,contactList:{hash:t.hash,userIds:i.map((e=>e.id))}})}(t)})),(0,n.Q6)("loadCurrentUser",(()=>{(0,y.t9)("fetchCurrentUser")})),(0,n.Q6)("updateContact",((e,t,s)=>{const{userId:a,isMuted:o,firstName:c,lastName:d}=s;!async function(e,t,s,a){const o=(0,n.Rd)(),c=(0,i.dy)(o,e);c&&((0,n.uC)().updateChatMutedState({chatId:e,isMuted:t}),(0,n.R3)((0,r.H9)((0,n.Rd)(),h.wv.InProgress)),await(0,y.t9)("updateContact",{phone:c.phoneNumber,firstName:s,lastName:a})&&(0,n.R3)((0,r.Nq)((0,n.Rd)(),c.id,{firstName:s,lastName:a})),(0,n.R3)((0,r.H9)((0,n.Rd)(),h.wv.Complete)))}(a,o,c,d)})),(0,n.Q6)("deleteUser",((e,t,s)=>{const{userId:a}=s;!async function(e){const t=(0,n.Rd)(),s=(0,i.dy)(t,e);if(!s)return;const{id:a,accessHash:o}=s;await(0,y.t9)("deleteUser",{id:a,accessHash:o})}(a)})),(0,n.Q6)("loadProfilePhotos",((e,t,s)=>{const{profileId:a}=s,o=(0,d.YA)(a),c=o?(0,i.dy)(e,a):void 0,l=o?void 0:(0,i.Z1)(e,a);(async()=>{const e=await(0,y.t9)("fetchProfilePhotos",c,l);if(!e||!e.photos)return;let t=(0,n.Rd)();o?t=(0,r.Nq)(t,a,{photos:e.photos}):(t=(0,r.Sh)(t,(0,g.ee)(e.users,"id")),t=(0,r.a4)(t,a,{photos:e.photos})),(0,n.R3)(t)})()})),(0,n.Q6)("setUserSearchQuery",((e,t,s)=>{const{query:a}=s;a&&G((()=>{!async function(e){const t=await(0,y.t9)("searchChats",{query:e});let s=(0,n.Rd)();const a=s.userSearch.query;if(!t||!a||e!==a)return void(0,n.R3)((0,r.Q3)(s,!1));const{localUsers:o,globalUsers:i}=t;let c,d;o.length&&(s=(0,r.Sh)(s,(0,g.ee)(o,"id")),c=o.map((({id:e})=>e))),i.length&&(s=(0,r.Sh)(s,(0,g.ee)(i,"id")),d=i.map((({id:e})=>e))),s=(0,r.Q3)(s,!1),s=(0,r.Lm)(s,{localUserIds:c,globalUserIds:d}),(0,n.R3)(s)}(a)}))}));const _=(0,Z.Ds)((e=>e()),500,!1);async function V(e,t,s,n){await(0,y.t9)("sendMessage",{chat:e,text:s,replyingTo:n})}(0,n.Q6)("clickInlineButton",((e,t,s)=>{const{button:o}=s;switch(o.type){case"command":t.sendBotCommand({command:o.value});break;case"url":o.value.match(a.Lj)||o.value.match(a.FS)?t.openTelegramLink({url:o.value}):t.toggleSafeLinkModal({url:o.value});break;case"callback":{const t=(0,i.jr)(e);if(!t)return;!async function(e,t,s){const a=await(0,y.t9)("answerCallbackButton",{chatId:e.id,accessHash:e.accessHash,messageId:t,data:s});if(!a)return;const{showDialog:o,showNotification:r,toggleSafeLinkModal:i}=(0,n.uC)(),{message:c,alert:d,url:l}=a;d?o({data:{message:c||"Error"}}):c?r({message:c}):l&&i({url:l})}(t,o.messageId,o.value);break}case"requestPoll":t.openPollModal();break;case"buy":{const s=(0,i.jr)(e),{messageId:n,value:a}=o;if(!s)return;a?t.getReceipt({receiptMessageId:a,chatId:s.id,messageId:n}):(t.getPaymentForm({chat:s,messageId:n}),t.setInvoiceMessageInfo((0,i.hj)(e,s.id,n)),t.openPaymentModal({chatId:s.id,messageId:n}));break}}})),(0,n.Q6)("sendBotCommand",((e,t,s)=>{const{command:n,chatId:a}=s,{currentUserId:o}=e,r=a?(0,i.Z1)(e,a):(0,i.jr)(e),c=(0,i.Bt)(e);if(!o||!r||!c)return;const{threadId:d}=c;t.setReplyingToId({messageId:void 0}),t.clearWebPagePreview({chatId:r.id,threadId:d,value:!1}),V(r,0,n,(0,i.Yy)(e,r.id,d))})),(0,n.Q6)("restartBot",((e,t,s)=>{const{chatId:a}=s,{currentUserId:o}=e,c=(0,i.jr)(e),d=o&&(0,i.IK)(e,a);o&&c&&d&&(async()=>{await(0,y.t9)("unblockContact",d.id,d.accessHash)&&((0,n.R3)((0,r.rB)((0,n.Rd)(),d.id)),V(c,0,"/start"))})()})),(0,n.Q6)("loadTopInlineBots",(e=>{const{hash:t,lastRequestedAt:s}=e.topInlineBots;s&&(0,D.b)(e.serverTimeOffset)-s<60||(async()=>{const s=await(0,y.t9)("fetchTopInlineBots",{hash:t});if(!s)return;const{hash:a,ids:o,users:i}=s;let c=(0,n.Rd)();c=(0,r.Sh)(c,(0,g.ee)(i,"id")),c={...c,topInlineBots:{...c.topInlineBots,hash:a,userIds:o,lastRequestedAt:(0,D.b)(e.serverTimeOffset)}},(0,n.R3)(c)})()})),(0,n.Q6)("queryInlineBot",((e,t,s)=>{const{chatId:a,username:o,query:c,offset:d}=s;(async()=>{let t=e.inlineBots.byUsername[o];if(!1!==t){if(void 0===t){const{user:s,chat:a}=await(0,y.t9)("fetchInlineBot",{username:o})||{};if(e=(0,n.Rd)(),!s||!a)return void(0,n.R3)(H(e,o,!1));e=(0,r.Sh)(e,{[s.id]:s}),e=(0,r.fZ)(e,{[a.id]:a}),t={id:s.id,query:"",offset:"",switchPm:void 0,canLoadMore:!0,results:[]},e=H(e,o,t),(0,n.R3)(e)}(c!==t.query||t.canLoadMore)&&_((()=>{!async function({username:e,inlineBotData:t,chatId:s,query:a,offset:o}){let r=(0,n.Rd)();const c=(0,i.dy)(r,t.id),d=(0,i.Z1)(r,s);if(!c||!d)return;const l=t.query!==a;r=j(r,!0),r=H(r,e,{...t,query:a,...l&&{offset:void 0,results:[]}}),(0,n.R3)(r);const u=await(0,y.t9)("fetchInlineBotResults",{bot:c,chat:d,query:a,offset:l?void 0:o}),h=r.inlineBots.byUsername[e];if(r=j((0,n.Rd)(),!1),!u||!h||a!==h.query)return void(0,n.R3)(r);const m=new Set((h.results||[]).map((e=>e.id))),g=u.results.filter((e=>!m.has(e.id)));r=H(r,e,{...h,help:u.help,...g.length&&{isGallery:u.isGallery},...u.switchPm&&{switchPm:u.switchPm},canLoadMore:u.results.length>0&&Boolean(u.nextOffset),results:""===h.offset||h.offset===u.nextOffset?u.results:(h.results||[]).concat(g),offset:g.length?u.nextOffset:""}),(0,n.R3)(r)}({username:o,inlineBotData:t,chatId:a,query:c,offset:d})}))}})()})),(0,n.Q6)("sendInlineBotResult",((e,t,s)=>{const{id:n,queryId:a}=s,o=(0,i.Bt)(e);if(!o||!n)return;const{chatId:r,threadId:c}=o,d=(0,i.Z1)(e,r);t.setReplyingToId({messageId:void 0}),t.clearWebPagePreview({chatId:r,threadId:c,value:!1}),(0,y.t9)("sendInlineBotResult",{chat:d,resultId:n,queryId:a,replyingTo:(0,i.Yy)(e,r,c)})})),(0,n.Q6)("resetInlineBot",((e,t,s)=>{const{username:a}=s;let o=e.inlineBots.byUsername[a];o&&(o={id:o.id,query:"",offset:"",switchPm:void 0,canLoadMore:!0,results:[]},(0,n.R3)(H(e,a,o)))})),(0,n.Q6)("startBot",((e,t,s)=>{const{botId:n,param:a}=s,o=(0,i.dy)(e,n);o&&(async()=>{await(0,y.t9)("startBot",{bot:o,startParam:a})})()})),s(9667),(0,n.Q6)("loadPasswordInfo",(()=>{(async()=>{const e=await(0,y.t9)("getPasswordInfo");if(!e)return;let t=(0,n.Rd)();t=(0,r.BI)(t,{hasPassword:e.hasPassword}),t=(0,r.IE)(t,{hint:e.hint}),(0,n.R3)(t)})()})),(0,n.Q6)("checkPassword",((e,t,s)=>{const{currentPassword:a,onSuccess:o}=s;(0,n.R3)((0,r.IE)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await(0,y.t9)("checkPassword",a);(0,n.R3)((0,r.IE)((0,n.Rd)(),{isLoading:!1})),e&&o()})()})),(0,n.Q6)("clearPassword",((e,t,s)=>{const{currentPassword:a,onSuccess:o}=s;(0,n.R3)((0,r.IE)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await(0,y.t9)("clearPassword",a);(0,n.R3)((0,r.IE)((0,n.Rd)(),{isLoading:!1})),e&&o()})()})),(0,n.Q6)("updatePassword",((e,t,s)=>{const{currentPassword:a,password:o,hint:i,email:c,onSuccess:d}=s;(0,n.R3)((0,r.IE)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await(0,y.t9)("updatePassword",a,o,i,c);(0,n.R3)((0,r.IE)((0,n.Rd)(),{isLoading:!1})),e&&d()})()})),(0,n.Q6)("updateRecoveryEmail",((e,t,s)=>{const{currentPassword:a,email:o,onSuccess:i}=s;(0,n.R3)((0,r.IE)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await(0,y.t9)("updateRecoveryEmail",a,o);(0,n.R3)((0,r.IE)((0,n.Rd)(),{isLoading:!1,waitingEmailCodeLength:void 0})),e&&i()})()})),(0,n.Q6)("provideTwoFaEmailCode",((e,t,s)=>{const{code:n}=s;(0,y.t9)("provideRecoveryEmailCode",n)})),(0,n.Q6)("clearTwoFaError",(e=>(0,r.IE)(e,{error:void 0}))),(0,n.Q6)("validateRequestedInfo",((e,t,s)=>{const{requestInfo:a,saveInfo:o}=s,c=(0,i.gx)(e),d=c&&(0,i.Z1)(e,c),l=(0,i.Mz)(e);d&&l&&async function(e,t,s,a){const o=await(0,y.t9)("validateRequestedInfo",{chat:e,messageId:t,requestInfo:s,shouldSave:a});if(!o)return;const{id:i,shippingOptions:c}=o;if(!i)return;let d=(0,r.vT)((0,n.Rd)(),i);c?(d=(0,r.TM)(d,c),d=(0,r.Q$)(d,h.KB.Shipping)):d=(0,r.Q$)(d,h.KB.PaymentInfo),(0,n.R3)(d)}(d,l,a,o)})),(0,n.Q6)("getPaymentForm",((e,t,s)=>{const{chat:a,messageId:o}=s;a&&o&&async function(e,t){const s=await(0,y.t9)("getPaymentForm",{chat:e,messageId:t});if(!s)return;let a=(0,r._7)((0,n.Rd)(),s),o=h.KB.PaymentInfo;a.payment.invoice&&(a.payment.invoice.shippingAddressRequested||a.payment.invoice.nameRequested||a.payment.invoice.phoneRequested||a.payment.invoice.emailRequested)&&(o=h.KB.ShippingInfo),a=(0,r.Q$)(a,o),(0,n.R3)(a)}(a,o)})),(0,n.Q6)("getReceipt",((e,t,s)=>{const{receiptMessageId:a,chatId:o,messageId:c}=s,d=o&&(0,i.Z1)(e,o);c&&a&&d&&async function(e,t,s){const a=await(0,y.t9)("getReceipt",e,s);if(!a)return;let o=(0,n.Rd)();const c=(0,i.hj)(o,e.id,t);o=(0,r.Dq)(o,a,c),(0,n.R3)(o)}(d,c,a)})),(0,n.Q6)("clearPaymentError",(e=>{(0,n.R3)({...e,payment:{...e.payment,error:void 0}})})),(0,n.Q6)("clearReceipt",(e=>{(0,n.R3)({...e,payment:{...e.payment,receipt:void 0}})})),(0,n.Q6)("sendCredentialsInfo",((e,t,s)=>{const a=(0,i.$$)(e);if(!a)return;const{credentials:o}=s,{data:c}=o;!async function(e,t){const s=function(e){const t=Object.keys(e).map((t=>`${t}=${e[t]}`)).join("&");return t.length>0?`?${t}`:""}({"card[number]":e.cardNumber,"card[exp_month]":e.expiryMonth,"card[exp_year]":e.expiryYear,"card[cvc]":e.cvv,"card[address_zip]":e.zip,"card[address_country]":e.country}),a=await fetch(`https://api.stripe.com/v1/tokens${s}`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:`Bearer ${t}`}}),o=await a.json();if(o.error){const e=(0,d.Ow)(o.error),t=(0,n.Rd)();return void(0,n.R3)({...t,payment:{...t.payment,error:{...e}}})}let i=(0,r.QH)((0,n.Rd)(),{type:o.type,id:o.id});i=(0,r.Q$)(i,h.KB.Checkout),(0,n.R3)(i)}(c,a)})),(0,n.Q6)("sendPaymentForm",((e,t,s)=>{const{shippingOptionId:a,saveCredentials:o}=s,c=(0,i.gx)(e),d=c&&(0,i.Z1)(e,c),l=(0,i.Mz)(e),u=(0,i.eh)(e),h=(0,i.sp)(e),m=(0,i.$$)(e),g=(0,i.i3)(e);d&&l&&m&&u&&async function(e,t,s,a,o,i){if(await(0,y.t9)("sendPaymentForm",{chat:e,messageId:t,formId:s,credentials:a,requestedInfoId:o,shippingOptionId:i})){const e=(0,r.bp)((0,n.Rd)());(0,n.R3)((0,r.WY)(e))}}(d,l,u,{save:o,data:g},h,a)})),(0,n.Q6)("setPaymentStep",((e,t,s={})=>(0,r.Q$)(e,s.step||h.KB.ShippingInfo))),(0,n.Q6)("setInvoiceMessageInfo",((e,t,s)=>(0,r.nA)(e,s))),s(4907);var W=s(8406),K=s(7358);const X=(0,Z.P2)((e=>e()),500,!0);(0,n.Q6)("apiUpdate",((e,t,s)=>{switch(s["@type"]){case"updateChat":{s.noTopChatsRequest||(0,i.N)(e,s.id)||t.loadTopChats();const a=(0,r.a4)(e,s.id,s.chat,s.newProfilePhoto);(0,n.R3)(a),X((()=>(0,K.w)((0,i.A1)((0,n.Rd)())))),s.chat.id&&(0,W.Vr)({chatId:s.chat.id,lastReadInboxMessageId:s.chat.lastReadInboxMessageId});break}case"updateChatJoin":{const a=(0,i.Ek)(e,s.id);if(!a)break;e=(0,r.B1)(e,a,[s.id]),e=(0,r.a4)(e,s.id,{isNotJoined:!1}),(0,n.R3)(e);const o=(0,i.Z1)(e,s.id);o&&t.requestChatUpdate({chatId:o.id});break}case"updateChatLeave":{const t=(0,i.Ek)(e,s.id);if(!t)break;const{[t]:a}=e.chats.listIds;a&&(e=(0,r.Mg)(e,t,a.filter((e=>e!==s.id)))),e=(0,r.a4)(e,s.id,{isNotJoined:!0}),(0,n.R3)(e);break}case"updateChatInbox":(0,n.R3)((0,r.a4)(e,s.id,s.chat)),X((()=>(0,K.w)((0,i.A1)((0,n.Rd)()))));break;case"updateChatTypingStatus":{const{id:t,typingStatus:a}=s;(0,n.R3)((0,r.a4)(e,t,{typingStatus:a})),setTimeout((()=>{const e=(0,n.Rd)(),s=(0,i.Z1)(e,t);s&&a&&s.typingStatus&&s.typingStatus.timestamp===a.timestamp&&(0,n.R3)((0,r.a4)(e,t,{typingStatus:void 0}))}),6e3);break}case"newMessage":{const{message:a}=s,{chatId:o,threadId:c,type:d}=(0,i.Bt)(e)||{};if(a.senderId===e.currentUserId&&!a.isFromScheduled)return;const l=(0,i.Z1)(e,s.chatId);if(!l)return;const h="thread"===d&&c===u._f&&s.chatId===o;h?setTimeout((()=>{t.requestChatUpdate({chatId:s.chatId})}),1500):(0,n.R3)((0,r.a4)(e,s.chatId,{unreadCount:l.unreadCount?l.unreadCount+1:1,...s.message.hasUnreadMention&&{unreadMentionsCount:l.unreadMentionsCount?l.unreadMentionsCount+1:1}})),(0,K.w)((0,i.A1)((0,n.Rd)()));const{hasWebNotifications:m}=(0,i.dZ)(e);m&&(0,W.VL)({chat:l,message:a,isActiveChat:h});break}case"updateCommonBoxMessages":case"updateChannelMessages":{const{ids:t,messageUpdate:a}=s;if(!1!==a.hasUnreadMention)return;t.forEach((t=>{const n="channelId"in s?s.channelId:(0,i.X5)(e,t),a=(0,i.Z1)(e,n);null!=a&&a.unreadMentionsCount&&(e=(0,r.a4)(e,n,{unreadMentionsCount:a.unreadMentionsCount-1}))})),(0,n.R3)(e);break}case"updateChatFullInfo":{const{fullInfo:t}=s,a=e.chats.byId[s.id];if(!a)return;(0,n.R3)((0,r.a4)(e,s.id,{fullInfo:{...a.fullInfo,...t}}));break}case"updatePinnedChatIds":{const{ids:t,folderId:o}=s,r=o===a.WS?"archived":"active";e={...e,chats:{...e.chats,orderedPinnedIds:{...e.chats.orderedPinnedIds,[r]:t.length?t:void 0}}},(0,n.R3)(e);break}case"updateChatPinned":{const{id:t,isPinned:o}=s,r=(0,i.Ek)(e,t);if(r){const{[r]:s}=e.chats.orderedPinnedIds;let n=s||[];if(o){if(!n.includes(t)){if("active"===r&&n.length>=a.EG){const t=e.chats.listIds.active;n=n.filter((e=>t&&t.includes(e)))}n=[t,...n]}}else n=n.filter((e=>e!==t));e={...e,chats:{...e.chats,orderedPinnedIds:{...e.chats.orderedPinnedIds,[r]:n.length?n:void 0}}}}(0,n.R3)(e);break}case"updateChatListType":{const{id:t,folderId:a}=s;(0,n.R3)((0,r.Pi)(e,t,a));break}case"updateChatFolder":{const{id:t,folder:a}=s,{byId:o,orderedIds:r}=e.chatFolders,i=a?{...o,[t]:a}:(0,g.ei)(o,Object.keys(o).map(Number).filter((e=>e!==t))),c=a?r&&r.includes(t)?r:[...r||[],t]:r?r.filter((e=>e!==t)):void 0;(0,n.R3)({...e,chatFolders:{...e.chatFolders,byId:i,orderedIds:c}});break}case"updateChatFoldersOrder":{const{orderedIds:t}=s;(0,n.R3)({...e,chatFolders:{...e.chatFolders,orderedIds:t}});break}case"updateRecommendedChatFolders":{const{folders:t}=s;(0,n.R3)({...e,chatFolders:{...e.chatFolders,recommended:t}});break}case"updateChatMembers":{var o;const t=e.chats.byId[s.id],{replacedMembers:a,addedMember:i,deletedMemberId:c}=s;if(!t)return;let d=!1,l=null!==(o=t.fullInfo)&&void 0!==o&&o.members?[...t.fullInfo.members]:[];if(a)l=a,d=!0;else if(i)l.length&&l.some((e=>e.userId===i.userId))||(l.push(i),d=!0);else if(l.length&&c){const e=l.findIndex((e=>e.userId===c));e>-1&&(l.slice(e,1),d=!0)}if(d){const a=l.filter((({isOwner:e,isAdmin:t})=>e||t));(0,n.R3)((0,r.a4)(e,s.id,{membersCount:l.length,fullInfo:{...t.fullInfo,members:l,adminMembers:a}}))}break}case"deleteProfilePhotos":{const{chatId:t,ids:a}=s,o=e.chats.byId[t];null!=o&&o.photos&&(0,n.R3)((0,r.a4)(e,t,{photos:o.photos.filter((e=>!a.includes(e.id)))}));break}case"draftMessage":{const{chatId:t,formattedText:a,date:o,replyingToId:i}=s;e.chats.byId[t]&&(e=(0,r.pf)(e,t,u._f,"draft",a),e=(0,r.pf)(e,t,u._f,"replyingToId",i),e=(0,r.a4)(e,t,{draftDate:o}),(0,n.R3)(e));break}case"showInvite":{const{data:e}=s;t.showDialog({data:e});break}}}));const Y=350;function z(e,t,s,n,a=!1){const o=a?(0,i.Tm)(e,t,s):(0,i.hj)(e,t,s);if(o&&n.content){const{photo:e,video:t,sticker:s,document:a}=(0,d.qp)(o);e&&n.content.photo?(n.content.photo.blobUrl=e.blobUrl,n.content.photo.thumbnail=e.thumbnail):t&&n.content.video?n.content.video.blobUrl=t.blobUrl:s&&n.content.sticker?n.content.sticker.isPreloadedGlobally=s.isPreloadedGlobally:a&&n.content.document&&(n.content.document.previewBlobUrl=a.previewBlobUrl)}return a?(0,r.P4)(e,t,s,n):(0,r.cY)(e,t,s,n)}function J(e,t,s,n){const{chatId:a}=s,{threadInfo:o}=(0,i.Db)(e,a,s)||{};if(!o&&s.replyToMessageId){const o=(0,i.hj)(e,a,s.replyToMessageId);o?e=(0,r.lG)(e,o,a,s.id,n):t.loadMessage({chatId:a,messageId:s.replyToMessageId,threadUpdate:{isDeleting:n,lastMessageId:s.id}})}return e}function ee(e,t,s){const{id:n,chatId:a}=s,{threadInfo:o,firstMessageId:c}=(0,i.Db)(e,a,s)||{},l=(0,i.Z1)(e,a),h=(null==l?void 0:l.unreadCount)&&!(0,i.gb)(e,a,u._f);if(e=J(e,t,s),o&&(!c&&(0,d.CI)(s)||(e=(0,r.xj)(e,a,o.threadId,[n]),(0,i.b9)(e,a,o.threadId)&&(e=(0,r.$S)(e,a,o.threadId,n),c||(e=(0,r.pf)(e,a,o.threadId,"firstMessageId",s.id)))),e=(0,r.pf)(e,a,o.threadId,"threadInfo",{...o,lastMessageId:s.id,messagesCount:o.messagesCount+1})),h)return e;if(e=(0,r.xj)(e,a,u._f,[n]),(0,i.b9)(e,a,u._f)){const t=(0,i.It)(e,a,u._f),s=(0,r.$S)(e,a,u._f,n),o=(0,i.Cb)(s,a,u._f);t&&!o.includes(t)||(e=s)}return e}function te(e,t,s,n=!1){var a;const{chats:o}=e,i=null===(a=o.byId[t])||void 0===a?void 0:a.lastMessage;return!i||n||i.id===s.id||i.id===s.previousLocalId||s.id>i.id?(0,r.a4)(e,t,{lastMessage:s}):e}function se(e,t){const s=(0,i.Zw)(e,t),n=(0,i.gb)(e,t,u._f);if(!s||!n)return;let a=n.length;for(;a--;){const e=s[n[a]];if(!e.isDeleting)return e}}function ne(e,t,s,a){if(e){t.forEach((t=>{const s=se(a=(0,r.cY)(a,e,t,{isDeleting:!0}),e);s&&(a=te(a,e,s,!0))})),(0,n.R3)(a),s.requestChatUpdate({chatId:e});const o=[];return t.forEach((t=>{const n=(0,i.hj)(a,e,t);if(!n)return;a=J(a,s,n,!0);const{threadInfo:r}=(0,i.Db)(a,e,n)||{};r&&o.push(r.threadId)})),(0,n.R3)(a),void setTimeout((()=>{(0,n.R3)((0,r.K4)((0,n.Rd)(),e,t)),(0,g.Tw)(o).forEach((t=>{s.requestThreadInfoUpdate({chatId:e,threadId:t})}))}),Y)}const o=[];t.forEach((e=>{const t=(0,i.X5)(a,e);if(t){o.push(t);const s=se(a=(0,r.cY)(a,t,e,{isDeleting:!0}),t);s&&(a=te(a,t,s,!0)),setTimeout((()=>{(0,n.R3)((0,r.K4)((0,n.Rd)(),t,[e]))}),Y)}})),(0,n.R3)(a),(0,g.Tw)(o).forEach((e=>{s.requestChatUpdate({chatId:e})}))}(0,n.Q6)("apiUpdate",((e,t,s)=>{switch(s["@type"]){case"newMessage":{const{chatId:o,id:c,message:l}=s;e=ee(e=z(e,o,c,l),t,l),l.threadInfo&&(e=(0,r.Xg)(e,l.threadInfo.chatId,l.threadInfo.threadId,l.threadInfo)),(0,n.R3)(e);const u=(0,i.hj)(e,o,c);if((0,i.hg)(e,o,l)){var a;if(l.isOutgoing&&(null===(a=l.content)||void 0===a||!a.action)){const s=(0,i.Bt)(e);s&&t.focusMessage({chatId:o,threadId:s.threadId,messageId:l.id,noHighlight:!0,isResizingContainer:!0})}const{threadInfo:s}=(0,i.Db)(e,o,l)||{};s&&t.requestThreadInfoUpdate({chatId:o,threadId:s.threadId}),(0,d.CI)(l)||setTimeout((()=>{(0,n.R3)(te((0,n.Rd)(),o,u))}),Y)}else(0,n.R3)(te((0,n.Rd)(),o,u));(0,i.N)(e,o)||t.loadTopChats();break}case"newScheduledMessage":{const{chatId:t,id:a,message:o}=s;e=z(e,t,a,o,!0);const c=(0,i.qy)(e,t)||[];e=(0,r.pf)(e,t,u._f,"scheduledIds",(0,g.Tw)([...c,a])),(0,n.R3)(e);break}case"updateMessage":{var o,c;const{chatId:a,id:d,message:l}=s;if(!(0,i.hj)(e,a,d))return;e=z(e,a,d,l);const h=(0,i.hj)(e,a,d);l.threadInfo&&(e=(0,r.Xg)(e,l.threadInfo.chatId,l.threadInfo.threadId,l.threadInfo)),e=te(e,a,h),(0,n.R3)(e);const m=(0,i.Z1)(e,a);m&&!l.isOutgoing&&(null===(o=m.lastMessage)||void 0===o?void 0:o.id)===l.id&&(0,i.xo)(e,m)&&(0,i.hg)(e,a,l)&&(0,i.b9)(e,a,(null===(c=l.threadInfo)||void 0===c?void 0:c.threadId)||u._f)&&t.focusLastMessage();break}case"updateScheduledMessage":{const{chatId:t,id:a,message:o}=s;if(!(0,i.Tm)(e,t,a))return;e=z(e,t,a,o,!0);const c=Object.keys((0,i.Fn)(e,t)||{}).map(Number).sort(((e,t)=>t-e));e=(0,r.pf)(e,t,u._f,"scheduledIds",c),(0,n.R3)(e);break}case"updateMessageSendSucceeded":{const{chatId:a,localId:o,message:c}=s;e=ee(e,t,c);const d=(0,i.hj)(e,a,o);e=(0,r.K4)(e,a,[o]),c.isScheduled&&(e=(0,r.bV)(e,a,[o])),e=(0,r.cY)(e,a,c.id,{...d,...c,previousLocalId:o});const l=(0,i.hj)(e,a,c.id);e=te(e,a,l);const u=(0,i.Db)(e,a,c);null!=u&&u.threadInfo&&(t.markMessageListRead({maxId:c.id}),e=(0,r.pf)(e,a,u.threadInfo.threadId,"threadInfo",{...u.threadInfo,lastMessageId:c.id,lastReadInboxMessageId:c.id})),(0,n.R3)(e);break}case"updateScheduledMessageSendSucceeded":{const{chatId:t,localId:a,message:o}=s,c=(0,i.qy)(e,t)||[];e=(0,r.pf)(e,t,u._f,"scheduledIds",[...c,o.id]);const d=(0,i.Tm)(e,t,a);e=(0,r.bV)(e,t,[a]),e=(0,r.P4)(e,t,o.id,{...d,...o,previousLocalId:a}),(0,n.R3)(e);break}case"updatePinnedIds":{const{chatId:t,isPinned:a,messageIds:o}=s,c=(0,i.KB)(e,t)||[],d=a?[...c,...o].sort(((e,t)=>t-e)):c.filter((e=>!o.includes(e)));(0,n.R3)((0,r.pf)(e,t,u._f,"pinnedIds",d));break}case"updateThreadInfo":{const{chatId:t,threadId:a,threadInfo:o,firstMessageId:c}=s,d={...(0,i.tZ)(e,t,a),...o};if(!d.threadId)return;e=(0,r.Xg)(e,t,a,d),c&&(e=(0,r.pf)(e,t,a,"firstMessageId",c)),(0,n.R3)(e);break}case"resetMessages":{const{id:a}=s,o=(0,i.Zw)(e,a);o&&!(0,d.YA)(a)&&(e=(0,r.K4)(e,a,Object.keys(o).map(Number)),(0,n.R3)(e),t.loadFullChat({chatId:a,force:!0}));break}case"deleteMessages":{const{ids:n,chatId:a}=s;ne(a,n,t,e);break}case"deleteScheduledMessages":{const{ids:t,chatId:a}=s;!function(e,t,s,a){e&&(t.forEach((t=>{a=(0,r.P4)(a,e,t,{isDeleting:!0})})),(0,n.R3)(a),setTimeout((()=>{a=(0,r.bV)((0,n.Rd)(),e,t);const s=(0,i.Fn)(a,e);a=(0,r.pf)(a,e,u._f,"scheduledIds",Object.keys(s||{}).map(Number)),(0,n.R3)(a)}),Y))}(a,t,0,e);break}case"deleteHistory":{const{chatId:n}=s,a=e.messages.byChatId[n];a?ne(n,Object.keys(a.byId).map(Number),t,e):t.requestChatUpdate({chatId:n});break}case"updateCommonBoxMessages":{const{ids:t,messageUpdate:a}=s;t.forEach((t=>{const s=(0,i.X5)(e,t);s&&(e=(0,r.cY)(e,s,t,a))})),(0,n.R3)(e);break}case"updateChannelMessages":{const{channelId:t,ids:a,messageUpdate:o}=s;a.forEach((s=>{e=(0,r.cY)(e,t,s,o)})),(0,n.R3)(e);break}case"updateMessagePoll":{const{pollId:t,pollUpdate:a}=s,o=(0,i.ZB)(e,t);if(null!=o&&o.content.poll){const t={...o.content.poll,...a},{results:s}=t.results||{};if(s&&!s.some((e=>e.isChosen))){const{results:e}=o.content.poll.results,n=e&&e.filter((e=>e.isChosen));n&&n.forEach((e=>{const n=s.findIndex((t=>t.option===e.option));n>=0&&(t.results.results[n].isChosen=!0)}))}(0,n.R3)((0,r.cY)(e,o.chatId,o.id,{content:{...o.content,poll:t}}))}break}case"updateMessagePollVote":{const{pollId:t,userId:a,options:o}=s,c=(0,i.ZB)(e,t);if(!c||!c.content.poll||!c.content.poll.results)break;const{poll:d}=c.content,{recentVoterIds:l,totalVoters:u,results:h}=d.results,m=l?[...l]:[],g=u?u+1:1,f=h?[...h]:[];m.push(a),o.forEach((t=>{const s=f.find((e=>e.option===t)),n=f.findIndex((e=>e.option===t)),o=s?{...s}:{option:t,votersCount:0};o.votersCount+=1,a===e.currentUserId&&(o.isChosen=!0),n?f[n]=o:f.push(o)})),(0,n.R3)((0,r.cY)(e,c.chatId,c.id,{content:{...c.content,poll:{...d,results:{...d.results,recentVoterIds:m,totalVoters:g,results:f}}}}));break}}}));const ae=(0,Z.P2)((function(){let e=(0,n.Rd)();oe.forEach((([t,s])=>{e=(0,r.Nq)(e,t,{status:s})})),(0,n.R3)(e),oe=[]}),3e3,!0);let oe=[];(0,n.Q6)("apiUpdate",((e,t,s)=>{switch(s["@type"]){case"deleteUser":return(0,r.h8)(e,s.id);case"updateUser":return(0,r.Nq)(e,s.id,s.user);case"updateUserStatus":return n=s.userId,a=s.status,oe.push([n,a]),void ae();case"updateUserFullInfo":{const{id:t,fullInfo:n}=s,a=e.users.byId[t];if(!a)return;return(0,r.Nq)(e,t,{fullInfo:{...a.fullInfo,...n}})}}var n,a})),(0,n.Q6)("apiUpdate",((e,t,s)=>{switch(s["@type"]){case"updateStickerSet":return(0,r.Rg)(e,s.id,s.stickerSet)}})),(0,n.Q6)("apiUpdate",((e,t,s)=>{switch(s["@type"]){case"updatePeerBlocked":return s.isBlocked?(0,r.O4)((0,n.Rd)(),s.id):(0,r.rB)((0,n.Rd)(),s.id);case"updateResetContactList":(0,n.R3)({...(0,n.Rd)(),contactList:{hash:0,userIds:[]}});break;case"updateFavoriteStickers":t.loadFavoriteStickers();break;case"updatePrivacy":e.settings.privacy[s.key]=s.rules}})),(0,n.Q6)("apiUpdate",((e,t,s)=>{switch(s["@type"]){case"updateNotifySettings":return(0,r.HN)(e,s.peerType,s.isSilent,s.shouldShowPreviews);case"updateNotifyExceptions":{const{chatId:t,isMuted:a,isSilent:o,shouldShowPreviews:i}=s;e.chats.byId[t]&&(e=(0,r.a4)(e,t,{isMuted:a})),(0,n.R3)((0,r.aK)(e,t,{isMuted:a,isSilent:o,shouldShowPreviews:i}));break}}})),(0,n.Q6)("apiUpdate",((e,t,s)=>{switch(s["@type"]){case"updateTwoFaStateWaitCode":return{...e,twoFaSettings:{...e.twoFaSettings,isLoading:!1,waitingEmailCodeLength:s.length}};case"updateTwoFaError":return{...e,twoFaSettings:{...e.twoFaSettings,error:s.message}}}}));var re=s(8674),ie=s(6752),ce=s(1279),de=s(1212),le=s(5332);function ue(e){(0,o.d4)((()=>(0,Z.Gq)(e)),[e])}var he=s(9290);function me(e){e.preventDefault()}var ge=s(6590),fe=s(3989),pe=s(3455),Ie=s(2255);function ve(){const[e,t]=(0,o.eJ)(window.navigator.onLine);return(0,o.d4)((()=>{function e(){t(window.navigator.onLine)}return window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("offline",e),window.removeEventListener("online",e)}}),[]),e}var ye=s(706),Ze=s(9107),Pe=s(6917),Ce=s(3106),we=s(8964),be=s(231),Me=s(9589),Se=s(9187),Ee=s(3321);const ke=[0,1,2],Re=(0,o.X$)((0,n.c$)((e=>{const{query:t,fetchingStatus:s,chatId:n,date:a}=e.globalSearch,{currentUserId:o}=e,{byId:r}=e.chats,{animationLevel:c}=e.settings.byKey;return{searchQuery:t,isLoading:!!s&&Boolean(s.chats||s.messages),currentUserId:o,chatsById:r,globalSearchChatId:n,searchDate:a,theme:(0,i.Pu)(e),animationLevel:c}}),((e,t)=>(0,g.ei)(t,["openChat","openTipsChat","setGlobalSearchDate","setGlobalSearchChatId","setSettingOption"])))((({content:e,contactsFilter:t,onSearchQuery:s,onSelectSettings:n,onSelectContacts:r,onSelectArchived:i,setGlobalSearchChatId:c,onReset:l,searchQuery:u,isLoading:g,shouldSkipTransition:f,currentUserId:p,globalSearchChatId:I,searchDate:v,theme:y,animationLevel:Z,chatsById:P,openChat:C,openTipsChat:w,setGlobalSearchDate:b,setSettingOption:M})=>{const S=(0,Ze.Z)(),E=e===h.du.ChatList,k=(0,o.Ye)((()=>v?(0,L.xH)(new Date(1e3*v)):void 0),[v]),R=(0,o.Ye)((()=>E&&P?Object.values(P).reduce(((e,t)=>(0,d.pE)(t)&&t.unreadCount?e+1:e),0):0),[E,P]),T="web.telegram.org"===window.location.hostname,N=(0,o.Ye)((()=>({onTrigger:e,isOpen:t})=>o.ZP.createElement(be.Z,{round:!0,ripple:E&&!m.wB,size:"smaller",color:"translucent",className:t?"active":"",onClick:E?e:()=>l(),ariaLabel:E?S("AccDescrOpenMenu2"):"Return to chat list"},o.ZP.createElement("div",{className:(0,ie.Z)("animated-menu-icon",!E&&"state-back",f&&"no-animation")}))),[E,S,l,f]),B=(0,o.I4)((()=>{u||s("")}),[u,s]),x=(0,o.I4)((()=>{C({id:p,shouldReplaceHistory:!0})}),[p,C]),A=(0,o.I4)((e=>{e.stopPropagation();const t="light"===y?"dark":"light";M({theme:t}),M({shouldUseSystemTheme:!1}),(0,Pe.Z)(t,Z===a.zy)}),[Z,M,y]),O=(0,o.I4)((e=>{e.stopPropagation();const t=0===Z?2:0;ke.forEach(((e,s)=>{document.body.classList.toggle(`animation-level-${s}`,t===s)})),M({animationLevel:t})}),[Z,M]),F=Boolean(I)||e===h.du.GlobalSearch||e===h.du.Contacts,U=e===h.du.Contacts?S("SearchFriends"):S("Search");return o.ZP.createElement("div",{className:"LeftMainHeader"},o.ZP.createElement("div",{id:"LeftMainHeader",className:"left-header"},o.ZP.createElement(Ce.Z,{trigger:N,footer:`${a.iC} alpha ${a.Ji}`},o.ZP.createElement(we.Z,{icon:"saved-messages",onClick:x},S("SavedMessages")),o.ZP.createElement(we.Z,{icon:"archive",onClick:i},o.ZP.createElement("span",{className:"menu-item-name"},S("ArchivedChats")),R>0&&o.ZP.createElement("div",{className:"archived-badge"},R)),o.ZP.createElement(we.Z,{icon:"user",onClick:r},S("Contacts")),o.ZP.createElement(we.Z,{icon:"settings",onClick:n},S("Settings")),o.ZP.createElement(we.Z,{icon:"darkmode",onClick:A},o.ZP.createElement("span",{className:"menu-item-name"},S("lng_menu_night_mode")),o.ZP.createElement(Ee.Z,{id:"darkmode",label:S("dark"===y?"lng_settings_disable_night_theme":"lng_settings_enable_night_theme"),checked:"dark"===y,noAnimation:!0})),o.ZP.createElement(we.Z,{icon:"animations",onClick:O},o.ZP.createElement("span",{className:"menu-item-name capitalize"},S("Appearance.Animations").toLowerCase()),o.ZP.createElement(Ee.Z,{id:"animations",label:"Toggle Animations",checked:Z>0})),o.ZP.createElement(we.Z,{icon:"help",onClick:()=>{w({langCode:S.code})}},S("TelegramFeatures")),o.ZP.createElement(we.Z,{icon:"bug",href:a.mU},"Report Bug"),T&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(we.Z,{icon:"char-K",href:"https://web.telegram.org/k/",onClick:()=>{localStorage.setItem("kz_version",JSON.stringify("K")),(0,ge.Wv)()}},"Switch to K Version"),o.ZP.createElement(we.Z,{icon:"char-W",href:"https://web.telegram.org/?legacy=1",onClick:ge.Wv},"Switch to Old Version"))),o.ZP.createElement(Me.Z,{inputId:"telegram-search-input",parentContainerClassName:"LeftSearch",className:I||v?"with-picker-item":"",value:t||u,focused:F,isLoading:g,placeholder:U,autoComplete:"off",canClose:Boolean(I||v),onChange:s,onReset:l,onFocus:B},k&&o.ZP.createElement(Se.Z,{icon:"calendar",title:k,canClose:!0,isMinimized:Boolean(I),className:"search-date",onClick:b,clickArg:{date:void 0}}),I&&o.ZP.createElement(Se.Z,{chatOrUserId:I,onClick:c,canClose:!0,clickArg:{id:void 0}}))))})));var Te=s(9204);const Ne=(0,o.X$)((()=>{const e=(0,Ze.Z)();return o.ZP.createElement("div",{id:"ConnectionState",dir:e.isRtl?"rtl":void 0},o.ZP.createElement(Te.Z,{color:"black"}),o.ZP.createElement("div",{className:"state-text"},e("WaitingForNetwork")))}));var Be=s(1174);var xe=s(3133),Ae=s(9359);const Le=(0,o.X$)((0,n.c$)((e=>{const{chats:{byId:t},users:{byId:s},chatFolders:{byId:n,orderedIds:a,activeChatFolder:o},currentUserId:r,lastSyncTime:c,shouldSkipHistoryAnimations:d}=e;return{chatsById:t,usersById:s,chatFoldersById:n,orderedFolderIds:a,lastSyncTime:c,notifySettings:(0,i.dZ)(e),notifyExceptions:(0,i.NJ)(e),activeChatFolder:o,currentUserId:r,shouldSkipHistoryAnimations:d}}),((e,t)=>(0,g.ei)(t,["loadChatFolders","setActiveChatFolder","openChat"])))((({chatsById:e,usersById:t,chatFoldersById:s,notifySettings:n,notifyExceptions:a,orderedFolderIds:r,activeChatFolder:i,currentUserId:c,lastSyncTime:l,shouldSkipHistoryAnimations:u,foldersDispatch:h,onScreenSelect:f,loadChatFolders:p,setActiveChatFolder:I,openChat:v})=>{const y=(0,o.sO)(null),P=(0,Ze.Z)();(0,o.d4)((()=>{l&&p()}),[l,p]);const C=(0,o.Ye)((()=>r?r.map((e=>s[e]||{})).filter(Boolean):void 0),[s,r]),w=((e,t,s)=>{const n=((e,t=!1)=>(0,o.Ye)((()=>(0,Z.P2)((e=>e()),e,!t)),[e,t]))(t,!0),[a,r]=(0,o.eJ)(),[i,c,d]=(0,ye.Z)();return(0,re.ZP)(c,d),(0,he.Z)((()=>{i||n((()=>{r(e())}))}),s.concat([i])),a})((()=>{if(!C||!C.length)return;const s=Object.keys(e).map(Number),o=C.map((o=>{const{unreadDialogsCount:r,hasActiveDialogs:i}=(0,d.Fu)(e,t,o,s,n,a)||{};return{id:o.id,badgeCount:r,isBadgeActive:i}}));return(0,g.ee)(o,"id")}),3e3,[C,e,t,n,a]),b=(0,o.Ye)((()=>{if(C&&C.length)return[{title:"en"===P.code?"All":P("FilterAllChats")},...C.map((e=>({title:e.title,...null==w?void 0:w[e.id]})))]}),[C,w,P]),M=(0,o.I4)((e=>{I(e)}),[I]);(0,o.d4)((()=>{b&&b.length&&i>=b.length&&I(0)}),[i,b,I]),(0,o.d4)((()=>{if(y.current&&m.$b&&b&&b.length)return(0,Be.s)(y.current,{selectorToPreventScroll:".chat-list",onSwipe:(e,t)=>t===Be.e.Left?(I(Math.min(i+1,b.length-1)),!0):t===Be.e.Right&&(I(Math.max(0,i-1)),!0)})}),[i,b,I]);const S=(0,o.sO)();S.current=0!==i,(0,o.d4)((()=>S.current?(0,fe.Z)((()=>{S.current&&I(0)})):void 0),[i,I]),(0,ge.ZP)(0!==i,(()=>I(0))),(0,o.d4)((()=>{const e=e=>{if(e.ctrlKey&&e.shiftKey&&e.code.startsWith("Digit")&&b){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t)return;if("0"===t)return void v({id:c,shouldReplaceHistory:!0});const s=Number(t)-1;if(s>b.length-1)return;I(s),e.preventDefault()}};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}}));const{shouldRender:E,transitionClassNames:k}=(0,de.Z)(!r,void 0,!0);function R(e){const t=Object.values(s).find((({title:e})=>e===b[i].title));return t&&0!==i?o.ZP.createElement(Ae.Z,{folderType:"folder",folderId:t.id,isActive:e,onScreenSelect:f,foldersDispatch:h}):o.ZP.createElement(Ae.Z,{folderType:"all",isActive:e,foldersDispatch:h,onScreenSelect:f})}return o.ZP.createElement("div",{className:"ChatFolders"},null!=b&&b.length?o.ZP.createElement(xe.Z,{tabs:b,activeTab:i,onSwitchTab:M}):E?o.ZP.createElement("div",{className:(0,ie.Z)("tabs-placeholder",k)}):void 0,o.ZP.createElement(Ie.Z,{ref:y,name:u?"none":P.isRtl?"slide-reversed":"slide",activeKey:i,renderCount:b?b.length:void 0},R))})));var Oe=s(9203),Fe=s(8778),Ue=s(4288);const $e=(0,o.X$)((e=>{const t=(0,Fe.Z)(Oe.gl.Extra,"LeftSearch");return t?o.ZP.createElement(t,e):o.ZP.createElement(Ue.Z,null)})),Qe=(0,o.X$)((e=>{const t=(0,Fe.Z)(Oe.gl.Extra,"ContactList");return t?o.ZP.createElement(t,e):o.ZP.createElement(Ue.Z,null)}));var De=s(2328);let qe;const Ge=(0,o.X$)((({isShown:e,onNewPrivateChat:t,onNewChannel:s,onNewGroup:n})=>{const[a,r]=(0,o.eJ)(!1);(0,o.d4)((()=>{e||r(!1)}),[e]);const i=(0,Ze.Z)(),c=(0,ie.Z)("NewChatButton",e&&"revealed",a&&"menu-is-open"),d=(0,o.I4)((()=>{qe&&(clearTimeout(qe),qe=void 0)}),[]),l=(0,o.I4)((()=>{qe&&(clearTimeout(qe),qe=void 0),qe=window.setTimeout((()=>{r(!1)}),750)}),[]);return o.ZP.createElement("div",{className:c,onMouseEnter:d,onMouseLeave:l},o.ZP.createElement(be.Z,{round:!0,color:"primary",className:a?"active":"",onClick:()=>{r(!a)},ariaLabel:i(a?"Close":"NewMessageTitle"),tabIndex:-1},o.ZP.createElement("i",{className:"icon-new-chat-filled"}),o.ZP.createElement("i",{className:"icon-close"})),o.ZP.createElement(De.Z,{isOpen:a,positionX:"right",positionY:"bottom",autoClose:!0,onClose:()=>{r(!1)}},o.ZP.createElement(we.Z,{icon:"channel",onClick:s},i("NewChannel")),o.ZP.createElement(we.Z,{icon:"group",onClick:n},i("NewGroup")),o.ZP.createElement(we.Z,{icon:"user",onClick:t},i("NewMessageTitle"))))}));var He=s(126);const je=Object.keys(h.du).length/2;let _e;const Ve=(0,n.c$)((e=>(0,g.ei)(e,["connectionState"])))((({content:e,searchQuery:t,searchDate:s,contactsFilter:n,shouldSkipTransition:a,foldersDispatch:r,onSearchQuery:i,onContentChange:c,onScreenSelect:d,onReset:l,connectionState:u})=>{const[g,f]=(0,o.eJ)(m.$b),p=!ve()||"connectionStateConnecting"===u,I=(0,o.sO)(!1),v=(0,o.I4)((()=>{c(h.du.Settings)}),[c]),y=(0,o.I4)((()=>{c(h.du.Contacts)}),[c]),Z=(0,o.I4)((()=>{c(h.du.NewChannelStep1)}),[c]),P=(0,o.I4)((()=>{c(h.du.NewGroupStep1)}),[c]),C=(0,o.I4)((()=>{c(h.du.Archived)}),[c]),w=(0,o.I4)((()=>{e===h.du.ChatList&&(I.current=!0,f(!0))}),[e]),b=(0,o.I4)((()=>{I.current=!1,_e&&(clearTimeout(_e),_e=void 0),_e=window.setTimeout((()=>{I.current||f(!1)}),250)}),[]);(0,o.d4)((()=>{let t;return e!==h.du.ChatList?t=window.setTimeout((()=>{f(!1)}),250):(I.current||m.$b)&&f(!0),()=>{t&&(clearTimeout(t),t=void 0)}}),[e]);const[M,S,E]=function(){const[e,t]=(0,ye.Z)(!1);(0,o.d4)((()=>{const e=window.setTimeout(t,2592e5);return()=>{clearTimeout(e)}}),[t]);const{shouldRender:s,transitionClassNames:n}=(0,de.Z)(e);return[s,n,()=>{window.location.reload()}]}(),k=(0,Ze.Z)();return o.ZP.createElement("div",{id:"LeftColumn-main",onMouseEnter:m.$b?void 0:w,onMouseLeave:m.$b?void 0:b},o.ZP.createElement(Re,{content:e,contactsFilter:n,onSearchQuery:i,onSelectSettings:v,onSelectContacts:y,onSelectArchived:C,onReset:l,shouldSkipTransition:a}),o.ZP.createElement(He.Z,{isOpen:p,isCustom:!0,className:"connection-state-wrapper opacity-transition slow"},(()=>o.ZP.createElement(Ne,null))),o.ZP.createElement(Ie.Z,{name:a?"none":"zoom-fade",renderCount:je,activeKey:e,shouldCleanup:!0,cleanupExceptionKey:h.du.ChatList,className:p?"pull-down":void 0},(a=>{switch(e){case h.du.ChatList:return o.ZP.createElement(Le,{onScreenSelect:d,foldersDispatch:r});case h.du.GlobalSearch:return o.ZP.createElement($e,{searchQuery:t,searchDate:s,isActive:a,onReset:l});case h.du.Contacts:return o.ZP.createElement(Qe,{filter:n,isActive:a,onReset:l});default:return}})),M&&o.ZP.createElement(be.Z,{fluid:!0,pill:!0,className:(0,ie.Z)("btn-update",S),onClick:E},k("lng_update_telegram")),o.ZP.createElement(Ge,{isShown:g,onNewPrivateChat:y,onNewChannel:Z,onNewGroup:P}))})),We=(0,o.X$)((e=>{const t=(0,Fe.Z)(Oe.gl.Extra,"Settings");return t?o.ZP.createElement(t,e):o.ZP.createElement(Ue.Z,null)})),Ke=(0,o.X$)((e=>{const t=(0,Fe.Z)(Oe.gl.Extra,"NewChat");return t?o.ZP.createElement(t,e):o.ZP.createElement(Ue.Z,null)})),Xe=(0,o.X$)((e=>{const t=(0,Fe.Z)(Oe.gl.Extra,"ArchivedChats");return t?o.ZP.createElement(t,e):o.ZP.createElement(Ue.Z,null)}));var Ye;!function(e){e[e.Main=0]="Main",e[e.Settings=1]="Settings",e[e.Archived=2]="Archived",e[e.NewGroup=3]="NewGroup",e[e.NewChannel=4]="NewChannel"}(Ye||(Ye={}));const ze=Object.keys(Ye).length/2,Je=(0,o.X$)((0,n.c$)((e=>{const{globalSearch:{query:t,date:s},chatFolders:{activeChatFolder:n},shouldSkipHistoryAnimations:a}=e;return{searchQuery:t,searchDate:s,activeChatFolder:n,shouldSkipHistoryAnimations:a}}),((e,t)=>(0,g.ei)(t,["setGlobalSearchQuery","setGlobalSearchChatId","resetChatCreation","setGlobalSearchDate","loadPasswordInfo","clearTwoFaError"])))((({searchQuery:e,searchDate:t,activeChatFolder:s,shouldSkipHistoryAnimations:n,setGlobalSearchQuery:a,setGlobalSearchChatId:r,resetChatCreation:i,setGlobalSearchDate:c,loadPasswordInfo:d,clearTwoFaError:l})=>{const[u,g]=(0,o.eJ)(h.du.ChatList),[f,p]=(0,o.eJ)(h.MT.Main),[I,v]=(0,o.eJ)(""),[y,Z]=(0,pe.ZP)(),[P,C]=(0,o.eJ)(0);let w=Ye.Main;switch(u){case h.du.Archived:w=Ye.Archived;break;case h.du.Settings:w=Ye.Settings;break;case h.du.NewChannelStep1:case h.du.NewChannelStep2:w=Ye.NewChannel;break;case h.du.NewGroupStep1:case h.du.NewGroupStep2:w=Ye.NewGroup}const b=(0,o.I4)((e=>{if(u!==h.du.NewGroupStep2||e)if(u!==h.du.NewChannelStep2||e){if(u===h.du.NewGroupStep1){const e=document.getElementById("new-group-picker-search");e&&e.blur()}if(u===h.du.Settings)switch(f){case h.MT.EditProfile:case h.MT.Folders:case h.MT.General:case h.MT.Notifications:case h.MT.Privacy:case h.MT.Language:return void p(h.MT.Main);case h.MT.GeneralChatBackground:return void p(h.MT.General);case h.MT.GeneralChatBackgroundColor:return void p(h.MT.GeneralChatBackground);case h.MT.PrivacyPhoneNumber:case h.MT.PrivacyLastSeen:case h.MT.PrivacyProfilePhoto:case h.MT.PrivacyForwarding:case h.MT.PrivacyGroupChats:case h.MT.PrivacyActiveSessions:case h.MT.PrivacyBlockedUsers:case h.MT.TwoFaDisabled:case h.MT.TwoFaEnabled:case h.MT.TwoFaCongratulations:return void p(h.MT.Privacy);case h.MT.PrivacyPhoneNumberAllowedContacts:case h.MT.PrivacyPhoneNumberDeniedContacts:return void p(h.MT.PrivacyPhoneNumber);case h.MT.PrivacyLastSeenAllowedContacts:case h.MT.PrivacyLastSeenDeniedContacts:return void p(h.MT.PrivacyLastSeen);case h.MT.PrivacyProfilePhotoAllowedContacts:case h.MT.PrivacyProfilePhotoDeniedContacts:return void p(h.MT.PrivacyProfilePhoto);case h.MT.PrivacyForwardingAllowedContacts:case h.MT.PrivacyForwardingDeniedContacts:return void p(h.MT.PrivacyForwarding);case h.MT.PrivacyGroupChatsAllowedContacts:case h.MT.PrivacyGroupChatsDeniedContacts:return void p(h.MT.PrivacyGroupChats);case h.MT.TwoFaNewPassword:return void p(h.MT.TwoFaDisabled);case h.MT.TwoFaNewPasswordConfirm:return void p(h.MT.TwoFaNewPassword);case h.MT.TwoFaNewPasswordHint:return void p(h.MT.TwoFaNewPasswordConfirm);case h.MT.TwoFaNewPasswordEmail:return void p(h.MT.TwoFaNewPasswordHint);case h.MT.TwoFaNewPasswordEmailCode:return void p(h.MT.TwoFaNewPasswordEmail);case h.MT.TwoFaChangePasswordCurrent:case h.MT.TwoFaTurnOff:case h.MT.TwoFaRecoveryEmailCurrentPassword:return void p(h.MT.TwoFaEnabled);case h.MT.TwoFaChangePasswordNew:return void p(h.MT.TwoFaChangePasswordCurrent);case h.MT.TwoFaChangePasswordConfirm:return void p(h.MT.TwoFaChangePasswordNew);case h.MT.TwoFaChangePasswordHint:return void p(h.MT.TwoFaChangePasswordConfirm);case h.MT.TwoFaRecoveryEmail:return void p(h.MT.TwoFaRecoveryEmailCurrentPassword);case h.MT.TwoFaRecoveryEmailCode:return void p(h.MT.TwoFaRecoveryEmail);case h.MT.FoldersCreateFolder:case h.MT.FoldersEditFolder:return void p(h.MT.Folders);case h.MT.FoldersIncludedChatsFromChatList:case h.MT.FoldersExcludedChatsFromChatList:return void p(h.MT.FoldersEditFolderFromChatList);case h.MT.FoldersEditFolderFromChatList:return g(h.du.ChatList),void p(h.MT.Main)}u!==h.du.ChatList||0!==s?(g(h.du.ChatList),v(""),a({query:""}),c({date:void 0}),r({id:void 0}),i(),setTimeout((()=>{C(Date.now())}),250)):g(h.du.GlobalSearch)}else g(h.du.NewChannelStep1);else g(h.du.NewGroupStep1)}),[u,s,f,a,c,r,i]),M=(0,o.I4)((t=>{u!==h.du.Contacts?(g(h.du.GlobalSearch),t!==e&&a({query:t})):v(t)}),[u,e,a]);(0,o.d4)((()=>u!==h.du.ChatList||0===s?(0,fe.Z)((()=>b())):void 0),[s,u,b]),(0,o.d4)((()=>{l(),f===h.MT.Privacy&&d()}),[l,d,f]);const S=e=>{g(h.du.Settings),p(e)};return o.ZP.createElement(Ie.Z,{id:"LeftColumn",name:n?"none":m.s0,renderCount:ze,activeKey:w,shouldCleanup:!0,cleanupExceptionKey:Ye.Main},(s=>{switch(w){case Ye.Archived:return o.ZP.createElement(Xe,{isActive:s,onReset:b,onContentChange:g});case Ye.Settings:return o.ZP.createElement(We,{isActive:s,currentScreen:f,foldersState:y,foldersDispatch:Z,onScreenSelect:S,onReset:b,shouldSkipTransition:n});case Ye.NewChannel:return o.ZP.createElement(Ke,{key:P,isActive:s,isChannel:!0,content:u,onContentChange:g,onReset:b});case Ye.NewGroup:return o.ZP.createElement(Ke,{key:P,isActive:s,content:u,onContentChange:g,onReset:b});default:return o.ZP.createElement(Ve,{content:u,searchQuery:e,searchDate:t,contactsFilter:I,foldersDispatch:Z,onContentChange:g,onSearchQuery:M,onScreenSelect:S,onReset:b,shouldSkipTransition:n})}}))})));var et=s(2420),tt=s(9524),st=s(1394),nt=s(3858);const at=()=>{const[e,t]=(0,o.eJ)(nt.Z.get());return(0,o.d4)((()=>{const e=(0,Z.P2)((()=>{t(nt.Z.get())}),250,!1);return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),e};var ot=s(2678);const rt=728;const it=e=>e.chatId.toString()+("thread"!==e.type?`_${e.type}`:-1!==e.threadId?`_${e.threadId}`:"");var ct=s(3570),dt=s(5790),lt=s(8360),ut=s(2155),ht=s(6058),mt=s(8799);const gt=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"HeaderMenuContainer",!t);return s?o.ZP.createElement(s,e):void 0})),ft=(0,o.X$)((0,n.c$)(((e,{chatId:t,threadId:s,messageListType:n})=>{const a=(0,i.Z1)(e,t),o=Boolean(a&&(0,d.eA)(a));if(null!=a&&a.isRestricted||(0,i.CA)(e))return{noMenu:!0};const r=(0,i.IK)(e,t),c=(0,i.FM)(e,t),l="thread"===n&&s===u._f,h="thread"===n&&s!==u._f,g=(0,i.Jf)(e),f=Boolean(r&&(0,i.s4)(e,r.id)),p=!f&&Boolean((0,i.pk)(e,t)),I=Boolean(l&&a&&(o||(0,d.ZV)(a))&&a.isNotJoined),v=l||h,y=l&&!c&&!I,Z=l&&!I;return{noMenu:!(m.wB&&I||m.wB&&v||y||Z),isChannel:o,isRightColumnShown:g,canStartBot:p,canRestartBot:f,canSubscribe:I,canSearch:v,canMute:y,canLeave:Z}}),((e,t)=>(0,g.ei)(t,["joinChannel","sendBotCommand","openLocalTextSearch","restartBot"])))((({chatId:e,threadId:t,noMenu:s,isChannel:n,canStartBot:a,canRestartBot:r,canSubscribe:i,canSearch:c,canMute:d,canLeave:l,isRightColumnShown:u,joinChannel:h,sendBotCommand:g,openLocalTextSearch:f,restartBot:p})=>{const I=(0,o.sO)(null),[v,y]=(0,o.eJ)(!1),[Z,P]=(0,o.eJ)(void 0),C=(0,o.I4)((()=>{y(!0);const e=I.current.getBoundingClientRect();P({x:e.right,y:e.bottom})}),[]),w=(0,o.I4)((()=>{y(!1)}),[]),b=(0,o.I4)((()=>{P(void 0)}),[]),M=(0,o.I4)((()=>{h({chatId:e})}),[h,e]),S=(0,o.I4)((()=>{g({command:"/start"})}),[g]),E=(0,o.I4)((()=>{p({chatId:e})}),[e,p]),k=(0,o.I4)((()=>{f(),m.wB?document.querySelector("#MobileSearch input").focus():setTimeout((()=>{const e=document.querySelector(".RightHeader .SearchInput input");e&&e.focus()}),400)}),[f]),R=(0,Ze.Z)();return o.ZP.createElement("div",{className:"HeaderActions"},!m.wB&&i&&o.ZP.createElement(be.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:M},R(n?"Subscribe":"Join Group")),!m.wB&&a&&o.ZP.createElement(be.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:S},R("BotStart")),!m.wB&&r&&o.ZP.createElement(be.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:E},R("BotRestart")),!m.wB&&c&&o.ZP.createElement(be.Z,{round:!0,ripple:u,color:"translucent",size:"smaller",onClick:k,ariaLabel:"Search in this chat"},o.ZP.createElement("i",{className:"icon-search"})),(m.wB||!i)&&o.ZP.createElement(be.Z,{ref:I,className:v?"active":"",round:!0,ripple:!m.wB,size:"smaller",color:"translucent",disabled:s,ariaLabel:"More actions",onClick:C},o.ZP.createElement("i",{className:"icon-more"})),Z&&o.ZP.createElement(gt,{chatId:e,threadId:t,isOpen:v,anchor:Z,isChannel:n,canStartBot:a,canRestartBot:r,canSubscribe:i,canSearch:c,canMute:d,canLeave:l,onSubscribeChannel:M,onSearchClick:k,onClose:w,onCloseAnimationEnd:b}))})));var pt=s(4399),It=s(2340),vt=s(6202),yt=s(862);function Zt(e){var t;const s=e&&(0,d.DH)(e),n=null==e||null===(t=e.content)||void 0===t?void 0:t.sticker,r=s&&n&&!(0,m.on)()&&s.includes("image/webp"),[i,c]=(0,o.eJ)(yt.Hu),l=null==e?void 0:e.id;return(0,o.bt)((()=>{r&&(0,yt.p6)(`b64-${l}`,s).then(c).catch((e=>{a.eM&&console.error(e)}))}),[l,r,s]),r?i:s}var Pt=s(7551),Ct=s(8512);function wt(e,t,s,n,a){return`M${e},${t+a}a${a},${a},0,0,1,\n ${s},0v${n-2*a}a${a},${a},0,0,1,${-s},0Z`}const bt=(0,o.X$)((({count:e,index:t})=>{const s=(0,o.sO)(null),n=(0,o.Ye)((()=>function(e,t){const s=e-t-1,n=function(e){let t=8;return 1===e?t=36:2===e?t=17:3===e?t=11:(4===e||e>3)&&(t=7.5),t}(e),a=function(e,t){let s=36;return 1===e?s=36:2===e?s=17:3===e?s=1===t?12:11:(4===e||e>3)&&(s=7.5),s}(e,s),o=function(e,t){return e<=3?36:t*e+2*(e-1)}(e,n),r=`clipPath${e}`;return{markHeight:a,clipPath:function(e,t,s){let n="";if(3===s)n=wt(0,0,2,t,1)+wt(0,12,2,t+1,1)+wt(0,25,2,t,1);else for(let e=0;e\n \n `}(r,n,e),markTranslateY:function(e,t,s){return 1===s?0:2===s?0===e?0:t+2:3===s?0===e?0:1===e?12:25:(t+2)*e}(s,n,e),trackTranslateY:function(e,t,s,n){return t<=4||e<=1?0:e>=t-2?n-36:(s+4)/2+(e-2)*(s+2)}(s,e,n,o),trackHeight:o,clipPathId:r}}(e,t)),[e,t]);if((0,o.d4)((()=>{if(!s.current)return;const{trackHeight:e,trackTranslateY:t,markHeight:a,markTranslateY:o,clipPathId:r,clipPath:i}=n,c=s.current.firstElementChild;if(null!=s&&s.current){const n=s.current,{style:d}=n;d.height=`${e}px`,d.transform=`translateY(-${t}px)`,d.clipPath=`url("#${r}")`;const l=n.querySelector("svg"),u=n.querySelector("div"),h=n.querySelector("defs");l||c&&(c.innerHTML=` ${i} `),h&&(h.innerHTML=i),u&&(u.style.height=`${a}px`,u.style.transform=`translateY(${o}px)`)}}),[n]),1===e)return o.ZP.createElement("div",{className:"pinned-message-border"},o.ZP.createElement("div",{className:"pinned-message-border-wrapper-1",ref:s}));const{trackHeight:a,trackTranslateY:r,markHeight:i,markTranslateY:c,clipPathId:d}=n;return o.ZP.createElement("div",{className:(0,ie.Z)("pinned-message-border",e>4&&"pinned-message-border-mask")},o.ZP.createElement("div",{className:"pinned-message-border-wrapper",ref:s,style:`clip-path: url("#${d}"); width: 2px;\n height: ${a}px; transform: translateY(-${r}px);`},o.ZP.createElement("span",null),o.ZP.createElement("div",{className:"pinned-message-border-mark",style:`height: ${i}px; transform: translateY(${c}px);`})))})),Mt=(0,o.X$)((({message:e,count:t,index:s,customTitle:n,className:a,onUnpinMessage:r,onClick:i,onAllPinnedClick:c})=>{const l=(0,Ze.Z)(),u=Zt(e),h=(0,vt.Z)((0,d.Ti)(e,"pictogram")),m=(0,d.MK)(l,e,Boolean(u)),[g,f,p]=(0,ye.Z)(),I=(0,o.I4)((()=>{p(),r&&r(e.id)}),[p,r,e.id]);return o.ZP.createElement("div",{className:(0,ie.Z)("HeaderPinnedMessage-wrapper",a)},t>1&&o.ZP.createElement(be.Z,{round:!0,size:"smaller",color:"translucent",className:"pin-list-button",ariaLabel:l("EventLogFilterPinnedMessages"),onClick:c},o.ZP.createElement("i",{className:"icon-pin-list"})),r&&o.ZP.createElement(be.Z,{round:!0,size:"smaller",color:"translucent",ariaLabel:l("UnpinMessageAlertTitle"),className:"unpin-button",onClick:f},o.ZP.createElement("i",{className:"icon-close"})),o.ZP.createElement(Pt.Z,{isOpen:g,onClose:p,text:"Would you like to unpin this message?",confirmLabel:"Unpin",confirmHandler:I}),o.ZP.createElement("div",{className:"HeaderPinnedMessage",onClick:i,dir:l.isRtl?"rtl":void 0},o.ZP.createElement(bt,{count:t,index:s}),u&&function(e,t){const{width:s,height:n}=(0,pt.W7)();return o.ZP.createElement("img",{src:t||e,width:s,height:n,alt:""})}(u,h),o.ZP.createElement("div",{className:"message-text"},o.ZP.createElement("div",{className:"title",dir:"auto"},n||`${l("PinnedMessage")} ${s>0?"#"+(t-s):""}`),o.ZP.createElement("p",{dir:"auto"},(0,It.Z)(m))),o.ZP.createElement(Ct.Z,null)))}));var St=s(647),Et=s(3186);const kt=(0,n.c$)(((e,{message:t})=>({sender:(0,i.Ur)(e,t)})),((e,t)=>(0,g.ei)(t,["focusMessage","closeAudioPlayer"])))((({message:e,className:t,noUi:s,sender:n,focusMessage:a,closeAudioPlayer:r})=>{const i=(0,Ze.Z)(),c=n?(0,d.OU)(i,n):void 0,l=St.UV((0,d.Ti)(e,"inline")),{playPause:u,isPlaying:h}=(0,Et.Z)((0,d.Tp)(e),(0,d.XV)(e),l,void 0,void 0,!0),g=(0,o.I4)((()=>{a({chatId:e.chatId,messageId:e.id})}),[a,e.chatId,e.id]),f=(0,o.I4)((()=>{h&&u(),r()}),[r,h,u]);if(s)return;const p=(0,d.oP)(e);return o.ZP.createElement("div",{className:(0,ie.Z)("AudioPlayer",t),dir:i.isRtl?"rtl":void 0},o.ZP.createElement(be.Z,{round:!0,ripple:!m.wB,color:"translucent",size:"smaller",className:(0,ie.Z)("toggle-play",h?"pause":"play"),onClick:u,ariaLabel:h?"Pause audio":"Play audio"},o.ZP.createElement("i",{className:"icon-play"}),o.ZP.createElement("i",{className:"icon-pause"})),o.ZP.createElement("div",{className:"AudioPlayer-content",onClick:g},p?function(e){const{title:t,performer:s,fileName:n}=e;return o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("div",{className:"title",dir:"auto"},(0,It.Z)(t||n)),s&&o.ZP.createElement("div",{className:"subtitle",dir:"auto"},(0,It.Z)(s)))}(p):function(e,t){return o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("div",{className:"title",dir:"auto"},t&&(0,It.Z)(t)),o.ZP.createElement("div",{className:"subtitle",dir:"auto"},e))}(i("AttachAudio"),c),o.ZP.createElement(Ct.Z,null)),o.ZP.createElement(be.Z,{round:!0,className:"player-close",color:"translucent",size:"smaller",onClick:f,ariaLabel:"Close player"},o.ZP.createElement("i",{className:"icon-close"})))})),Rt=(0,o.X$)((0,n.c$)(((e,{chatId:t,threadId:s,messageListType:n})=>{const{isLeftColumnShown:a,lastSyncTime:o,shouldSkipHistoryAnimations:r}=e,{byId:c}=e.chats,d=(0,i.Z1)(e,t),{typingStatus:l}=d||{},{chatId:h,messageId:m}=e.audioPlayer,g=h&&m?(0,i.hj)(e,h,m):void 0;let f;if("pinned"===n){const s=(0,i.KB)(e,t);f=null==s?void 0:s.length}else if("scheduled"===n){const s=(0,i.qy)(e,t);f=null==s?void 0:s.length}else if("thread"===n&&s!==u._f){const n=(0,i.tZ)(e,t,s);n&&(f=n.messagesCount)}const p={typingStatus:l,isLeftColumnShown:a,isRightColumnShown:(0,i.Jf)(e),isSelectModeActive:(0,i.CA)(e),audioMessage:g,chat:d,chatsById:c,messagesCount:f,isChatWithSelf:(0,i.FM)(e,t),isChatWithBot:d&&(0,i.xo)(e,d),lastSyncTime:o,shouldSkipHistoryAnimations:r,currentTransitionKey:Math.max(0,e.messages.messageLists.length-1),connectionState:e.connectionState},I=(0,i.Zw)(e,t);if("thread"!==n||!I)return p;if(Object.assign(p,{messagesById:I}),s!==u._f){const n=(0,i.qS)(e,t,s),a=n?(0,i.hj)(e,t,n):void 0,o=a?(0,i.cv)(e,a):void 0;return{...p,pinnedMessageIds:n,canUnpin:!1,topMessageSender:o}}const v=(0,i.KB)(e,t);if(null!=v&&v.length){const t=I[v[0]],{canUnpin:n}=t&&(0,i._k)(e,t,s)||{};return{...p,pinnedMessageIds:v,canUnpin:n}}return p}),((e,t)=>(0,g.ei)(t,["openChatWithInfo","pinMessage","focusMessage","openChat","openPreviousChat","loadPinnedMessages","toggleLeftColumn","exitMessageSelectMode"])))((({chatId:e,threadId:t,messageListType:s,isReady:r,pinnedMessageIds:c,messagesById:l,canUnpin:h,topMessageSender:g,typingStatus:f,isSelectModeActive:p,isLeftColumnShown:I,isRightColumnShown:v,audioMessage:y,chat:Z,chatsById:P,messagesCount:C,isChatWithSelf:w,isChatWithBot:b,lastSyncTime:M,shouldSkipHistoryAnimations:S,currentTransitionKey:E,connectionState:k,openChatWithInfo:R,pinMessage:T,focusMessage:N,openChat:B,openPreviousChat:x,loadPinnedMessages:A,toggleLeftColumn:L,exitMessageSelectMode:O})=>{const F=(0,Ze.Z)(),[U,$]=(0,o.eJ)(0),Q=Array.isArray(c)?c[U]:c,D=l&&Q?l[Q]:void 0,q=Array.isArray(c)?c.length:c?1:0,G=Z&&(0,d.U)(F,Z).length,H=g?(0,d.OU)(F,g):void 0;(0,o.d4)((()=>{t===u._f&&M&&r&&A({chatId:e})}),[e,A,M,t,r]),(0,o.d4)((()=>{$(0)}),[c]),(0,dt.Z)(e,Q,D);const{width:j}=at(),_=j<=a.ks,V=m.p7&&I,W=(0,o.sO)(null),K=(0,o.sO)(!0),X=(0,o.I4)((()=>{R({id:e})}),[R,e]),Y=(0,o.I4)((t=>{T({chatId:e,messageId:t,isUnpin:!0})}),[T,e]),z=(0,o.I4)((()=>{if(D){N({chatId:D.chatId,threadId:t,messageId:D.id});const e=(0,ct.Z)(q,U+1);$(e)}}),[D,N,t,q,U]),J=(0,o.I4)((()=>{B({id:e,threadId:u._f,type:"pinned"})}),[B,e]),ee=(0,o.I4)((e=>{if(m.wB){const e=document.getElementById(a.R2);e&&e.blur()}p?O():t!==u._f||"thread"!==s||0!==E?x():m.wB||V?(e.stopPropagation(),B({id:void 0})):L()}),[t,s,E,p,x,V,B,L,O]),te=(0,o.Ye)((()=>{if(_&&P)return(0,i.A1)((0,n.Rd)())||void 0}),[_,P]),se=j>=a.ks&&ja.l3&&j30),ne=se||j>a._m&&j{const e=W.current;if(e)return ne&&me?void(v||se?(K.current&&(e.classList.add("tools-stacked","animated"),K.current=!1),setTimeout((()=>{e.classList.remove("animated")}),350)):(e.classList.remove("tools-stacked"),K.current=!0)):(e.classList.remove("tools-stacked","animated"),void(K.current=!0))}),[ne,me,se,v]);const ge=(!ve()||"connectionStateConnecting"===k)&&(m.wB||m.p7&&!V);function fe(){return ge?o.ZP.createElement(o.ZP.Fragment,null,pe(),o.ZP.createElement("h3",null,F("WaitingForNetwork"))):"thread"===s&&t===u._f?o.ZP.createElement(o.ZP.Fragment,null,(_||E>0)&&pe(V,!0),o.ZP.createElement("div",{className:"chat-info-wrapper",onClick:X},(0,d.YA)(e)?o.ZP.createElement(ht.Z,{userId:e,typingStatus:f,withFullInfo:b,withMediaViewer:!0,withUpdatingStatus:!0,noRtl:!0}):o.ZP.createElement(mt.Z,{chatId:e,typingStatus:f,noRtl:!0,withMediaViewer:!0,withFullInfo:!0,withUpdatingStatus:!0}))):"thread"===s?o.ZP.createElement(o.ZP.Fragment,null,pe(),o.ZP.createElement("h3",null,F("CommentsCount",C))):"pinned"===s?o.ZP.createElement(o.ZP.Fragment,null,pe(),o.ZP.createElement("h3",null,F("PinnedMessagesCount",C))):"scheduled"===s?o.ZP.createElement(o.ZP.Fragment,null,pe(),o.ZP.createElement("h3",null,w?F("Reminders"):F("messages",C,"i"))):void 0}function pe(e=!1,t=!1){return o.ZP.createElement("div",{className:"back-button"},o.ZP.createElement(be.Z,{round:!0,size:"smaller",color:"translucent",onClick:ee,ariaLabel:e?"Close":"Back"},o.ZP.createElement("div",{className:(0,ie.Z)("animated-close-icon",!e&&"state-back")})),t&&te&&o.ZP.createElement("div",{className:"unread-count active"},(0,ut.bi)(te)))}return o.ZP.createElement("div",{className:"MiddleHeader",ref:W},o.ZP.createElement(Ie.Z,{name:S?"none":"slide-fade",activeKey:ge?1/0:E},fe),o.ZP.createElement("div",{className:"header-tools"},ce&&ue&&!ae&&o.ZP.createElement(Mt,{key:e,message:ue,count:q,index:U,customTitle:he,className:le,onUnpinMessage:h?Y:void 0,onClick:z,onAllPinnedClick:J}),ae&&re&&o.ZP.createElement(kt,{key:(0,d.Tp)(re),message:re,className:oe}),o.ZP.createElement(ft,{chatId:e,threadId:t,messageListType:s})))})));var Tt=s(2645),Nt=s(274);function Bt(e){return"albumId"in e}function xt(e,t){let s,n=[],a={originalDate:e[0].date,datetime:Number((0,L.$Y)(1e3*e[0].date)),senderGroups:[n]};const o=[a];return e.forEach(((r,i)=>{r.isInAlbum?s?(s.messages.push(r),r.content.text&&(s.mainMessage=r)):s={albumId:r.groupedId,messages:[r],mainMessage:r}:n.push(r);const c=e[i+1];if(!s||c&&c.groupedId&&c.groupedId===s.albumId||(n.push(s),s=void 0),c){const e=Number((0,L.$Y)(1e3*c.date));a.datetime!==e?(a={originalDate:c.date,datetime:e,senderGroups:[]},o.push(a),n=[],a.senderGroups.push(n)):(c.id===t||r.senderId!==c.senderId||r.isOutgoing!==c.isOutgoing||(0,d.Lo)(r)||(0,d.Lo)(c)||r.forwardInfo&&c.forwardInfo&&(r.forwardInfo.senderUserId!==c.forwardInfo.senderUserId||r.forwardInfo.fromChatId!==c.forwardInfo.fromChatId||r.forwardInfo.hiddenUserName!==c.forwardInfo.hiddenUserName)||r.inlineButtons||c.inlineButtons||c.date-r.date>600)&&(n=[],a.senderGroups.push(n))}})),o}var At=s(386);var Lt=s(7675),Ot=s(539),Ft=s(3657);const Ut=m.wZ?1e3:350,$t=m.wB?300:500;var Qt=s(7240),Dt=s(935);function qt(e){return"number"==typeof e}function Gt(e,t){return e?t?238:175:t?238:100}function Ht(e,t){const s=(0,d.B4)(e),n=(0,d.MF)(e),a=(0,d.O$)(e)||(0,d.F$)(e),o=(0,d.b7)(e),r=Boolean((0,d.F$)(e)),{width:i,height:c}=a?(0,pt.Eh)(a,s,n,r,t):(0,pt.GC)(o,s,n,t),l=Gt(Boolean((0,d.UD)(e)));let u=1;ie+t),t)}function _t(e,t,s){return es?s:e}function Vt(e){const t={width:0,height:0};return e.forEach((({dimensions:e,sides:s})=>{2&s&&(t.width=e.width+e.x),4&s&&(t.height=e.height+e.y)})),t}function Wt(e,t,s,n){const a=n.messages.map((e=>{const t=Ht(e);return t.width/t.height})),o=function(e){return e.map((e=>e>1.2?"w":e<.8?"n":"q")).join("")}(a),r=function(e){return e.reduce(((e,t)=>t+e),1)/e.length}(a),i=a.length,c=a.some((e=>e>2)),d=(0,pt.kc)(e,t,!1,s)-(t?2.5:0)*pt.Gw;let l;const u={ratios:a,proportions:o,averageRatio:r,maxWidth:d,minWidth:100,maxHeight:d,spacing:2};return l=i>=5||c?function({ratios:e,averageRatio:t,maxWidth:s,minWidth:n,spacing:a,maxHeight:o=4*s/3}){const r=function(e,t){return e.map((e=>t>1.1?_t(e,1,2.75):_t(e,.6667,1)))}(e,t),i=e.length,c=new Array(i),d=[],l=e=>{const t=[];let n=0;e.forEach((e=>{t.push(((e,t)=>{const n=jt(r.slice(e,e+t),0);return(s-(t-1)*a)/n})(n,e)),n+=e})),d.push({lineCounts:e,heights:t})};for(let e=1;e!==i;++e){const t=i-e;e<=3&&t<=3&&l([e,t])}for(let e=1;e!==i-1;++e)for(let s=1;s!==i-e;++s){const n=i-e-s;e<=3&&s<=(t<.85?4:3)&&n<=3&&l([e,s,n])}for(let e=1;e!==i-1;++e)for(let t=1;t!==i-e;++t)for(let s=1;s!==i-e-t;++s){const n=i-e-t-s;e<=3&&t<=3&&s<=3&&n<=4&&l([e,t,s,n])}let u,h=0;for(let e=0;e{for(let e=1;e!==r;++e)if(s[e-1]>s[e])return 1.5;return 1})(),m=Math.abs(i-o)*c*l;(!u||m1.4&&t[1]-t[0]<.2?function(e){const{ratios:t,maxWidth:s,spacing:n,maxHeight:a}=e,o=Math.round(Math.min(s/t[0],Math.min(s/t[1],(a-n)/2)));return[{dimensions:{x:0,y:0,width:s,height:o},sides:11},{dimensions:{x:0,y:o+n,width:s,height:o},sides:14}]}(e):"ww"===s||"qq"===s?function(e){const{ratios:t,maxWidth:s,spacing:n,maxHeight:a}=e,o=(s-n)/2,r=Math.round(Math.min(o/t[0],Math.min(o/t[1],a)));return[{dimensions:{x:0,y:0,width:o,height:r},sides:13},{dimensions:{x:o+n,y:0,width:o,height:r},sides:7}]}(e):function(e){const{ratios:t,minWidth:s,maxWidth:n,spacing:a,maxHeight:o}=e,r=Math.round(1.5*s),i=Math.min(Math.round(Math.max(.4*(n-a),(n-a)/t[0]/(1/t[0]+1/t[1]))),n-a-r),c=n-i-a,d=Math.min(o,Math.round(Math.min(c/t[0],i/t[1])));return[{dimensions:{x:0,y:0,width:c,height:d},sides:13},{dimensions:{x:c+a,y:0,width:i,height:d},sides:7}]}(e)}(u):3===i?function(e){const{proportions:t}=e;return"n"===t[0]?function(e){const{maxHeight:t,spacing:s,ratios:n,maxWidth:a,minWidth:o}=e,r=t,i=Math.round(Math.min((t-s)/2,n[1]*(a-s)/(n[2]+n[1]))),c=r-i-s,d=Math.max(o,Math.round(Math.min((a-s)/2,Math.min(i*n[2],c*n[1])))),l=Math.min(Math.round(r*n[0]),a-s-d);return[{dimensions:{x:0,y:0,width:l,height:r},sides:13},{dimensions:{x:l+s,y:0,width:d,height:c},sides:3},{dimensions:{x:l+s,y:c+s,width:d,height:i},sides:6}]}(e):function(e){const{maxWidth:t,ratios:s,maxHeight:n,spacing:a}=e,o=t,r=Math.round(Math.min(o/s[0],.66*(n-a))),i=(t-a)/2,c=Math.min(n-r-a,Math.round(Math.min(i/s[1],i/s[2])));return[{dimensions:{x:0,y:0,width:o,height:r},sides:11},{dimensions:{x:0,y:r+a,width:i,height:c},sides:12},{dimensions:{x:i+a,y:r+a,width:o-i-a,height:c},sides:6}]}(e)}(u):function(e){const{proportions:t}=e;return"w"===t[0]?function({maxWidth:e,ratios:t,spacing:s,maxHeight:n,minWidth:a}){const o=e,r=Math.round(Math.min(o/t[0],.66*(n-s))),i=Math.round((e-2*s)/(t[1]+t[2]+t[3])),c=Math.max(a,Math.round(Math.min(.4*(e-2*s),i*t[1]))),d=Math.round(Math.max(Math.max(a,.33*(e-2*s)),i*t[3])),l=o-c-d-2*s,u=Math.min(n-r-s,i);return[{dimensions:{x:0,y:0,width:o,height:r},sides:11},{dimensions:{x:0,y:r+s,width:c,height:u},sides:12},{dimensions:{x:c+s,y:r+s,width:l,height:u},sides:4},{dimensions:{x:c+s+l+s,y:r+s,width:d,height:u},sides:6}]}(e):function({maxHeight:e,ratios:t,maxWidth:s,spacing:n,minWidth:a}){const o=e,r=Math.round(Math.min(o*t[0],.6*(s-n))),i=Math.round((e-2*n)/(1/t[1]+1/t[2]+1/t[3])),c=Math.round(i/t[1]),d=Math.round(i/t[2]),l=o-c-d-2*n,u=Math.max(a,Math.min(s-r-n,i));return[{dimensions:{x:0,y:0,width:r,height:o},sides:13},{dimensions:{x:r+n,y:0,width:u,height:c},sides:3},{dimensions:{x:r+n,y:c+n,width:u,height:d},sides:2},{dimensions:{x:r+n,y:c+d+2*n,width:u,height:l},sides:6}]}(e)}(u),{layout:l,containerStyle:Vt(l)}}let Kt;function Xt(e){return Kt||(Kt=document.createElement("span"),Kt.style.font=m.cj?'400 12px system-ui, -apple-system, BlinkMacSystemFont, "Roboto", "Apple Color Emoji", "Helvetica Neue", sans-serif':'400 12px "Roboto", -apple-system, "Apple Color Emoji", BlinkMacSystemFont, "Helvetica Neue", sans-serif',Kt.style.whiteSpace="nowrap",Kt.style.position="absolute",Kt.style.left="-999px",Kt.style.opacity=".01",document.body.appendChild(Kt)),Kt.innerHTML=e,Kt.offsetWidth}function Yt(e,t,s,n,a,r){(0,o.bt)((()=>{if(s&&e.current){const t=e.current.closest(".MessageList");(0,Ot.Z)(t,e.current,a?"end":"centerOrTop",20,void 0!==n?1e3:void 0,n,void 0,r)}}),[e,t,s,n,a,r])}var zt=s(172),Jt=s(2864);const es=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"ContextMenuContainer",!t);return s?o.ZP.createElement(s,e):void 0})),ts=(0,o.X$)((0,n.c$)(((e,{message:t})=>{const{byId:s}=e.users,n=t.senderId,{targetUserIds:a,targetChatId:o}=t.content.action||{},r=t.replyToMessageId,c=r?(0,i.hj)(e,t.chatId,r):void 0,l=(0,i._X)(e,t),{direction:u,noHighlight:h}=l&&e.focusedMessage||{},m=(0,i.Z1)(e,t.chatId);return{usersById:s,sender:m&&((0,d.eA)(m)||n===t.chatId)?m:n?(0,i.dy)(e,n):void 0,targetChatId:o,targetUserIds:a,targetMessage:c,isFocused:l,...l&&{focusDirection:u,noFocusHighlight:h}}}))((({message:e,observeIntersection:t,isEmbedded:s,appearanceOrder:n=0,isLastInList:a,usersById:r,sender:i,targetUserIds:c,targetMessage:d,targetChatId:l,isFocused:u,focusDirection:h,noFocusHighlight:m})=>{const g=(0,o.sO)(null);(0,Ft._N)(g,t),(0,dt.Z)(e.chatId,e.replyToMessageId,d),Yt(g,e.chatId,u,h,m);const f=(0,Ze.Z)(),p=n<=0,[I,v]=(0,ye.Z)(p);(0,o.d4)((()=>{p||setTimeout(v,10*n)}),[n,v,p]);const{transitionClassNames:y}=(0,de.Z)(I,void 0,p,!1),Z=(0,o.Ye)((()=>c?c.map((e=>null==r?void 0:r[e])).filter(Boolean):void 0),[c,r]),P=(0,Jt.D)(f,e,i,Z,d,l,s?{isEmbedded:!0,asPlain:!0}:void 0),{isContextMenuOpen:C,contextMenuPosition:w,handleBeforeContextMenu:b,handleContextMenu:M,handleContextMenuClose:S,handleContextMenuHide:E}=(0,Qt.Z)(g),k=void 0!==w;if(s)return o.ZP.createElement("span",{className:"embedded-action-message"},(0,It.Z)(P));const R=(0,ie.Z)("ActionMessage message-list-item",u&&!m&&"focused",k&&"has-menu-open",a&&"last-in-list",y);return o.ZP.createElement("div",{ref:g,id:`message${e.id}`,className:R,"data-message-id":e.id,onMouseDown:e=>{(0,At.q)(e),b(e)},onContextMenu:M},o.ZP.createElement("span",null,P),w&&o.ZP.createElement(es,{isOpen:C,anchor:w,message:e,messageListType:"thread",onClose:S,onCloseAnimationEnd:E}))}))),ss=({className:e,message:t,sender:s,title:n,customText:a,observeIntersection:r,onClick:i})=>{const c=(0,o.sO)(null),l=(0,Ft.Op)(c,r),u=(0,vt.Z)(t&&(0,d.Ti)(t,"pictogram"),!l),h=t&&`sticker-reply-thumb${t.id}`,m=Zt(t),g=Boolean(t&&(0,d.Y5)(t)),f=(0,Ze.Z)(),p=s&&(0,d.OU)(f,s);return o.ZP.createElement("div",{ref:c,className:(0,ie.Z)("EmbeddedMessage",e),onClick:t?i:void 0},m&&function(e,t,s,n){const{width:a,height:r}=(0,pt.W7)();return o.ZP.createElement("img",{id:e,src:s||t,width:a,height:r,alt:"",className:n?"round":""})}(h,m,u,g),o.ZP.createElement("div",{className:"message-text"},o.ZP.createElement("p",{dir:"auto"},t?(0,d.Lo)(t)?o.ZP.createElement(ts,{message:t,isEmbedded:!0}):(0,It.Z)((0,d.MK)(f,t,Boolean(m))):a||" "),o.ZP.createElement("div",{className:"message-title",dir:"auto"},(0,It.Z)(p||n||" "))))};var ns=s(2535),as=s(4752),os=s(8018);const rs=(0,o.X$)((({message:e,outgoingStatus:t,signature:s,onClick:n})=>{const a=(0,Ze.Z)();return o.ZP.createElement("span",{className:"MessageMeta",dir:a.isRtl?"rtl":"ltr",onClick:n},Boolean(e.views)&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("span",{className:"message-views"},(0,ut.bi)(e.views)),o.ZP.createElement("i",{className:"icon-channelviews"})),s&&o.ZP.createElement("span",{className:"message-signature"},(0,It.Z)(s)),o.ZP.createElement("span",{className:"message-time"},e.isEdited&&`${a("EditedMessage")} `,(0,L.mr)(1e3*e.date)),t&&o.ZP.createElement(os.Z,{status:t}))}));var is=s(8835),cs=s(7799),ds=s(4851);const ls=({message:e,observeIntersection:t,observeIntersectionForPlaying:s,shouldLoop:n,lastSyncTime:r})=>{const i=(0,o.sO)(null),[c,l,u]=(0,ye.Z)(),h=e.content.sticker,{isAnimated:m,stickerSetId:g}=h,f=g===a.n,p=(0,Ft.Op)(i,t),I=(0,Ft.Op)(i,s),v=h.isPreloadedGlobally?`sticker${h.id}`:(0,d.Ti)(e,"inline"),y=Zt(e),Z=(0,vt.Z)(v,!p,(0,d.kG)(e,"inline",!0),r),P=Boolean(Z),[C,w]=(0,ye.Z)(P),b=m?C:P,{shouldRenderFullMedia:M,transitionClassNames:S}=(0,is.Z)(b,"slow"),{width:E,height:k}=(0,pt.Wr)(h),R=(0,ie.Z)("thumbnail",!y&&"empty"),T=(0,ie.Z)("Sticker media-inner",f&&"inactive");return o.ZP.createElement("div",{ref:i,className:T,onClick:f?void 0:l},!b&&o.ZP.createElement("img",{id:`sticker-thumb-${e.id}`,src:y,width:E,height:k,alt:"",className:R}),!m&&M&&o.ZP.createElement("img",{id:`sticker-${e.id}`,src:Z,width:E,height:k,alt:"",className:(0,ie.Z)("full-media",S)}),m&&P&&o.ZP.createElement(cs.Z,{key:v,className:(0,ie.Z)("full-media",S),id:v,animationData:Z,size:E,play:I,noLoop:!n,onLoad:w}),o.ZP.createElement(ds.Z,{isOpen:c,fromSticker:h,onClose:u}))};var us=s(7854),hs=s(2761),ms=s(5866);function gs(e,t){return(0,ms.Z)((0,d.DH)(e),Boolean(t),m.wB&&!m.vX)}var fs=s(7204);const ps=Promise.resolve("rgba(255,255,255,1)");var Is=s(9196);const vs=({id:e,message:t,observeIntersection:s,noAvatars:n,shouldAutoLoad:a,isInSelectMode:r,isSelected:i,uploadProgress:c,size:l="inline",dimensions:u,nonInteractive:h,shouldAffectAppendix:m,onClick:g,onCancelUpload:f})=>{const p=(0,o.sO)(null),I=((0,d.O$)(t)||(0,d.F$)(t)).blobUrl,v=(0,Ft.Op)(p,s),[y,Z]=(0,o.eJ)(a),P=y&&v,{mediaData:C,downloadProgress:w}=(0,hs.Z)((0,d.Ti)(t,l),!P),b=I||C,M=gs(t,b),{isUploading:S,isTransferring:E,transferProgress:k}=(0,d.Sc)(t,c||w,P&&!b),R=!1===(0,fs.Z)(y),{shouldRender:T,transitionClassNames:N}=(0,de.Z)(E,void 0,R,"slow"),{shouldRenderThumb:B,shouldRenderFullMedia:x,transitionClassNames:A}=(0,is.Z)(b,"slow"),L=(0,o.I4)((()=>{S?f&&f(t):b?g&&g(t.id):Z((e=>!e))}),[b,S,t,f,g]),O=(0,d.B4)(t);(0,o.bt)((()=>{if(!m)return;const e=p.current.closest(".message-content");b?function(e,t,s,n){return n?ps:async function(e,t){const s=new Image;s.src=e,s.width||await new Promise((e=>{s.onload=e}));const n=document.createElement("canvas"),a=n.getContext("2d");n.width=s.width,n.height=s.height,a.drawImage(s,0,0,s.width,s.height);const o=t?s.width-1:0,r=s.height-1;return`rgba(${Array.from(a.getImageData(o,r,1,1).data).join(",")})`}(e,t)}(b,O,0,i).then((t=>{e.style.setProperty("--appendix-bg",t),e.setAttribute("data-has-custom-appendix","")})):e.classList.add("has-appendix-thumb")}),[b,O,m,r,i]);const{width:F,height:U,isSmall:$}=u||Ht(t,n),Q=(0,ie.Z)("media-inner",!S&&!h&&"interactive",$&&"small-image",F===U&&"square-image"),D=u?`width: ${F}px; height: ${U}px; left: ${u.x}px; top: ${u.y}px;`:"";return o.ZP.createElement("div",{id:e,ref:p,className:Q,style:D,onClick:S?void 0:L},B&&o.ZP.createElement("canvas",{ref:M,className:"thumbnail",style:`width: ${F}px; height: ${U}px`}),x&&o.ZP.createElement("img",{src:b,className:`full-media ${A}`,width:F,height:U,alt:""}),T&&o.ZP.createElement("div",{className:`media-loading ${N}`},o.ZP.createElement(Is.Z,{progress:k,onClick:S?L:void 0})),!b&&!y&&o.ZP.createElement("i",{className:"icon-download"}),E&&o.ZP.createElement("span",{className:"message-upload-progress"},Math.round(100*k),"%"))};var ys=s(2019),Zs=s(4753);function Ps(e,t){const s=(0,o.sO)();s.current=t;const n=(0,o.I4)((()=>{e.current&&e.current.pause()}),[e]),a=(0,o.I4)((()=>{e.current&&s.current&&(0,Zs.Z)(e.current)}),[e]);(0,re.ZP)(n,a)}var Cs=s(6898);const ws=(e,t=!1)=>{const s=(0,o.sO)(!1),n=(0,o.sO)(!1),a=(0,o.I4)((()=>{n.current=!0,t&&e.current&&(s.current||(s.current=!e.current.paused),e.current.pause())}),[t,e]),r=(0,o.I4)((()=>{t&&e.current&&s.current&&document.body.contains(e.current)&&(0,Zs.Z)(e.current),s.current=!1,n.current=!1}),[t,e]),i=(0,o.I4)((()=>{(0,Z.T2)(r)}),[r]);document.hasFocus()||a(),(0,le.Z)(a,i)};function bs(){return(bs=Object.assign||function(e){for(var t=1;t{var m;const g=(0,o.sO)(null),f=(0,o.sO)(null),p=(0,d.b7)(t)||(0,d.Cg)(t),I=p.blobUrl,v=(0,Ft.Op)(g,s),[y,Z]=(0,o.eJ)(a),P=Boolean(y&&v&&c),[C,w]=(0,o.eJ)(r),b=(0,vt.Z)((0,d.Ti)(t,"pictogram"),!(v&&c),(0,d.kG)(t,"pictogram"),c),{mediaData:M,downloadProgress:S}=(0,hs.Z)((0,d.Ti)(t,"inline"),!P,(0,d.kG)(t,"inline"),c),E=I||M,k=Boolean(v&&E),R=gs(t,b),{isBuffered:T,bufferingHandlers:N}=(0,ys.Z)(!a),{isUploading:B,isTransferring:x,transferProgress:A}=(0,d.Sc)(t,i||S,P&&!T),O=!1===(0,fs.Z)(y),{shouldRender:F,transitionClassNames:U}=(0,de.Z)(x,void 0,O),{transitionClassNames:$}=(0,is.Z)(E,"slow"),[Q,D]=(0,o.eJ)(0),q=(0,o.I4)((e=>{D(Math.max(0,e.currentTarget.currentTime-1))}),[]),G=(null===(m=f.current)||void 0===m?void 0:m.duration)||p.duration||0,H=(0,d.B4)(t),j=(0,d.MF)(t),{width:_,height:V}=l||(0,pt.GC)(p,H,j,n);Ps(f,Boolean(k&&r)),ws(f,C),(0,Cs.Z)(f,[k]);const W=(0,o.I4)((()=>{B?h&&h(t):E?E&&!C?(w(!0),f.current.play()):u&&u(t.id):Z((e=>!e))}),[B,E,C,u,h,t]),K=(0,ie.Z)("media-inner dark",!B&&"interactive"),X=(0,ie.Z)("full-media",$),Y=l?`width: ${_}px; height: ${V}px; left: ${l.x}px; top: ${l.y}px;`:"";return o.ZP.createElement("div",{ref:g,id:e,className:K,style:Y,onClick:B?void 0:W},!b&&o.ZP.createElement("canvas",{ref:R,className:"thumbnail",style:`width: ${_}px; height: ${V}px;`}),b&&o.ZP.createElement("img",{src:b,className:"thumbnail",style:`width: ${_}px; height: ${V}px;`,alt:""}),k&&o.ZP.createElement("video",bs({ref:f,className:X,width:_,height:V,autoPlay:C,muted:!0,loop:!0,playsInline:!0},N,{onTimeUpdate:q}),o.ZP.createElement("source",{src:E})),y&&!C&&!F&&o.ZP.createElement("i",{className:"icon-large-play"}),F&&o.ZP.createElement("div",{className:`media-loading ${U}`},o.ZP.createElement(Is.Z,{progress:A,onClick:B?W:void 0})),!y&&o.ZP.createElement("i",{className:"icon-download"}),x?o.ZP.createElement("span",{className:"message-upload-progress"},"..."):o.ZP.createElement("div",{className:"message-media-duration"},p.isGif?"GIF":(0,L.k9)(Math.max(G-Q,0))))};var Ss=s(6272);const Es=(0,n.c$)(((e,{contact:t})=>{const{countryList:{phoneCodes:s}}=e;return{user:(0,i.dy)(e,t.userId),phoneCodeList:s}}),((e,t)=>(0,g.ei)(t,["openUserInfo"])))((({contact:e,user:t,openUserInfo:s,phoneCodeList:n})=>{const{firstName:a,lastName:r,phoneNumber:i,userId:c}=e,d=(0,o.I4)((()=>{s({id:c})}),[s,c]);return o.ZP.createElement("div",{className:(0,ie.Z)("Contact",Boolean(c)&&"interactive"),onClick:c?d:void 0},o.ZP.createElement(zt.Z,{size:"large",user:t,text:a||r}),o.ZP.createElement("div",{className:"contact-info"},o.ZP.createElement("div",{className:"contact-name"},a," ",r),o.ZP.createElement("div",{className:"contact-phone"},(0,Ss.WZ)(n,i))))}));var ks=s(4605);const Rs=(0,o.X$)((({id:e,options:t,selected:s=[],disabled:n,round:a,loadingOptions:r,onChange:i})=>{const[c,d]=(0,o.eJ)([]),l=(0,o.I4)((e=>{const{value:t,checked:s}=e.currentTarget;let n;n=s?[...c,t]:c.filter((e=>e!==t)),d(n),i(n)}),[i,c]);return o.ZP.createElement("div",{id:e,className:"radio-group"},t.map((e=>o.ZP.createElement(ks.Z,{label:e.label,subLabel:e.subLabel,value:e.value,checked:-1!==s.indexOf(e.value),disabled:n,round:a,isLoading:r?-1!==r.indexOf(e.value):void 0,onChange:l}))))}));var Ts=s(4434),Ns=s(6937);function Bs(e,t){return t>0?(e/t*100).toFixed():0}const xs=({answer:e,voteResults:t,totalVoters:s,maxVotersCount:n,correctResults:a,shouldAnimate:r})=>{const i=t&&t.find((t=>t.option===e.option)),c=0===a.length||-1!==a.indexOf(e.option),d=a.length>0&&c||(null==i?void 0:i.isChosen),l=i?Bs(i.votersCount,s||0):0,[u,h]=(0,o.eJ)(r?0:l),m=(0,o.sO)(null),g=i?Bs(i.votersCount,n||0):0,f=u{r&&h(l)}),[r,l]),(0,o.d4)((()=>{const e=m.current;if(e&&r){const t=e.firstElementChild,s=f?"":"stroke-dasharray: 100% 200%; stroke-dashoffset: -44";t?t.setAttribute("style",s):e.innerHTML=`\n \n \n `}}),[f,r]),!t||!i)return;const p=`width: ${g}%; transform:scaleX(${f?0:1})`;return o.ZP.createElement("div",{className:"PollOption",dir:"ltr"},o.ZP.createElement("div",{className:"poll-option-share "+("100"===l?"limit-width":"")},l,"%",d&&o.ZP.createElement("span",{className:(0,ie.Z)("poll-option-chosen",!c&&"wrong",r&&"animate")},o.ZP.createElement("i",{className:c?"icon-check":"icon-close"}))),o.ZP.createElement("div",{className:"poll-option-right"},o.ZP.createElement("div",{className:"poll-option-text",dir:"auto"},(0,It.Z)(e.text)),o.ZP.createElement("div",{className:(0,ie.Z)("poll-option-answer",d&&!c&&"wrong")},o.ZP.createElement("div",{className:"poll-option-corner",ref:m}),o.ZP.createElement("div",{className:"poll-option-line",style:p}))))},As=(0,o.X$)((0,n.c$)(((e,{poll:t})=>{const{recentVoterIds:s}=t.results,{serverTimeOffset:n,users:{byId:a}}=e;return s&&0!==s.length?{recentVoterIds:s,usersById:a,serverTimeOffset:n}:{}}),((e,t)=>(0,g.ei)(t,["loadMessage","openPollResults"])))((({message:e,poll:t,recentVoterIds:s,usersById:n,loadMessage:a,onSendVote:r,openPollResults:i,serverTimeOffset:c})=>{const{id:d,chatId:l}=e,{summary:u,results:h}=t,[m,g]=(0,o.eJ)(!1),[f,p]=(0,o.eJ)([]),[I,v]=(0,o.eJ)(!1),[y,Z]=(0,o.eJ)(!1),[P,C]=(0,o.eJ)(!u.closed&&u.closeDate&&u.closeDate>0?Math.min(u.closeDate-Math.floor(Date.now()/1e3)+c,u.closePeriod):0),w=(0,o.sO)(null),{results:b,totalVoters:M}=h,S=b&&b.some((e=>e.isChosen)),E=!u.closed&&!S,k=!E&&u.isPublic&&Number(h.totalVoters)>0,R=E&&u.multipleChoice,T=b?Math.max(...b.map((e=>e.votersCount))):M,N=b?b.reduce(((e,t)=>(t.isCorrect&&e.push(t.option),e)),[]):[],B=u.answers.map((e=>({label:e.text,value:e.option,hidden:Boolean(u.quiz&&u.closePeriod&&P<=0)})));(0,o.d4)((()=>{m&&t.results.results&&t.results.results.some((e=>e.isChosen))&&g(!1)}),[m,t.results.results]),(0,o.d4)((()=>{P>0&&setTimeout((()=>C(P-1)),1e3);const e=w.current;if(e){const t=12*Math.PI,s=e.lastElementChild,n=e.firstElementChild;if(P<=5&&e.classList.add("hurry-up"),s&&n){const e=(u.closePeriod-P)/u.closePeriod*t;n.textContent=(0,L.k9)(P),s.firstElementChild.setAttribute("stroke-dashoffset",`-${e}`)}else e.innerHTML=`\n ${(0,L.k9)(P)}\n \n \n `}}),[P,u.closePeriod]),(0,o.d4)((()=>{u.quiz&&(P<=0||S&&!u.closed)&&a({chatId:l,messageId:d})}),[l,P,S,a,d,u.closed,u.quiz]),(0,o.d4)((()=>{let e;return u.quiz&&!u.closed&&u.closePeriod&&u.closePeriod>0&&(e=window.setTimeout((()=>{a({chatId:l,messageId:d})}),1e3*u.closePeriod)),()=>{e&&window.clearTimeout(e)}}),[E,l,a,d,u.closePeriod,u.closed,u.quiz]);const x=(0,o.Ye)((()=>s?s.reduce(((e,t)=>{const s=n[t];return s&&e.push(s),e}),[]):[]),[n,s]),A=(0,o.I4)((e=>{p([e]),g(!0),Z(!0),r([e])}),[r]),O=(0,o.I4)((e=>{p(e)}),[]),F=(0,o.I4)((()=>{g(!0),Z(!0),r(f)}),[r,f]),U=(0,o.I4)((()=>{i({chatId:l,messageId:d})}),[l,d,i]),$=(0,o.I4)((()=>{v(!0)}),[]),Q=(0,o.I4)((()=>{v(!1),Z(!1)}),[]);(0,o.d4)((()=>{y&&S&&u.quiz&&h.results&&t.results.solution&&(h.results.find((e=>e.isChosen&&e.isCorrect))||v(!0))}),[S,y,h.results,u.quiz,t.results.solution]);const D=(0,Ze.Z)();return o.ZP.createElement("div",{className:"Poll",dir:D.isRtl?"auto":"ltr"},I&&t.results.solution&&o.ZP.createElement(Ns.Z,{message:(0,Dt.H)(t.results.solution,t.results.solutionEntities),duration:5e3,onDismiss:Q,containerId:"#middle-column-portals"}),o.ZP.createElement("div",{className:"poll-question"},(0,It.Z)(u.question)),o.ZP.createElement("div",{className:"poll-type"},D(function(e){return void 0===e.isPublic?" ":e.quiz?e.isPublic?"QuizPoll":"AnonymousQuizPoll":e.closed?"FinalResults":e.isPublic?"PublicPoll":"AnonymousPoll"}(u)),x.length>0&&o.ZP.createElement("div",{className:"poll-recent-voters"},x.map((e=>o.ZP.createElement(zt.Z,{size:"micro",user:e})))),P>0&&E&&o.ZP.createElement("div",{ref:w,className:"poll-countdown"}),u.quiz&&t.results.solution&&!E&&o.ZP.createElement(be.Z,{round:!0,size:"tiny",color:"translucent",className:"poll-quiz-help",disabled:I,onClick:$,ariaLabel:"Show Solution"},o.ZP.createElement("i",{className:"icon-lamp"}))),E&&o.ZP.createElement("div",{className:"poll-answers"},R?o.ZP.createElement(Rs,{options:B,onChange:O,disabled:e.isScheduled||m,loadingOptions:m?f:void 0,round:!0}):o.ZP.createElement(Ts.Z,{name:`poll-${d}`,options:B,onChange:A,disabled:e.isScheduled||m,loadingOption:m?f[0]:void 0})),!E&&o.ZP.createElement("div",{className:"poll-results"},u.answers.map((function(e){return o.ZP.createElement(xs,{key:e.option,shouldAnimate:y,answer:e,voteResults:b,totalVoters:M,maxVotersCount:T,correctResults:N})}))),!k&&!R&&o.ZP.createElement("div",{className:"poll-voters-count"},function(e,t,s){return s?e(t?"Answer":"Vote",s,"i"):e(t?"Chat.Quiz.TotalVotesEmpty":"Chat.Poll.TotalVotesResultEmpty")}(D,u.quiz,h.totalVoters)),R&&o.ZP.createElement(be.Z,{isText:!0,disabled:0===f.length,size:"tiny",onClick:F},D("PollSubmitVotes")),k&&o.ZP.createElement(be.Z,{isText:!0,size:"tiny",onClick:U},D("PollViewResults")))})));var Ls=s(8035),Os=s(88);const Fs=(0,o.X$)((({message:e,observeIntersection:t,noAvatars:s,shouldAutoLoad:n,shouldAutoPlay:a,inPreview:r,lastSyncTime:i,onMediaClick:c,onCancelMediaTransfer:l})=>{const u=(0,d.s1)(e);let h=!1;if(null!=u&&u.photo&&!u.video){const{width:t,height:s}=Ht(e);h=t===s}const m=(0,o.I4)((()=>{c()}),[c]);if(!u)return;const{siteName:g,url:f,displayUrl:p,title:I,description:v,photo:y,video:Z}=u,P=(y||Z)&&c&&!h,C=(0,Ls.Z)(v,170),w=(0,ie.Z)("WebPage",h&&"with-square-photo",!y&&!Z&&!r&&"without-media",Z&&"with-video");return o.ZP.createElement("div",{className:w,"data-initial":(g||p)[0],dir:"auto"},y&&!Z&&o.ZP.createElement(vs,{message:e,observeIntersection:t,noAvatars:s,shouldAutoLoad:n,size:h?"pictogram":"inline",nonInteractive:!P,onClick:P?m:void 0,onCancelUpload:l}),o.ZP.createElement("div",{className:"WebPage-text"},o.ZP.createElement(Os.Z,{className:"site-name",url:f,text:g||p}),!r&&I&&o.ZP.createElement("p",{className:"site-title"},(0,It.Z)(I)),C&&o.ZP.createElement("p",{className:"site-description"},(0,It.Z)(C,["emoji","br"]))),!r&&Z&&o.ZP.createElement(Ms,{message:e,observeIntersection:t,noAvatars:s,shouldAutoLoad:n,shouldAutoPlay:a,lastSyncTime:i,onClick:P?m:void 0,onCancelUpload:l}))}));var Us=s(9937);const $s=(0,o.X$)((({message:e})=>{const t=(0,Ze.Z)(),s=(0,d.eO)(e),{title:n,text:a,amount:r,currency:i,isTest:c,photoUrl:l}=s;return o.ZP.createElement("div",{className:"Invoice"},n&&o.ZP.createElement("p",{className:"title"},(0,It.Z)(n)),a&&o.ZP.createElement("p",null,(0,It.Z)(a,["emoji","br"])),o.ZP.createElement("div",{className:"description "+(l?"has-image":"")},l&&o.ZP.createElement("img",{className:"invoice-image",src:l,alt:""}),o.ZP.createElement("p",{className:"description-text"},(0,Us.x)(r,i,t.code),c&&o.ZP.createElement("span",null,t("PaymentTestInvoice")))))}));function Qs(e){return(0,o.X$)((0,n.c$)(((e,t)=>{const{message:s}=t;return{isInSelectMode:(0,i.CA)(e),isSelected:(0,i.vk)(e,s.id)}}),((e,t)=>(0,g.ei)(t,["toggleMessageSelection"])))((t=>{const{isInSelectMode:s,isSelected:n,message:a,toggleMessageSelection:r,dimensions:i}=t,c=(0,o.I4)((e=>{e.stopPropagation(),r({messageId:a.id,withShift:null==e?void 0:e.shiftKey})}),[r,a]),d=(0,o.Ye)((()=>({...t,isInSelectMode:s,isSelected:n,dimensions:{...t.dimensions,x:0,y:0},onClick:s?void 0:t.onClick})),[t,s,n]);return o.ZP.createElement("div",{className:(0,ie.Z)("album-item-select-wrapper",n&&"is-selected"),style:i?`left: ${i.x}px; top: ${i.y}px;`:"",onClick:s?c:void 0},s&&o.ZP.createElement("div",{className:"message-select-control"},n&&o.ZP.createElement("i",{className:"icon-select"})),o.ZP.createElement(e,d))})))}const Ds=Qs(vs),qs=Qs(Ms),Gs=(0,n.c$)((e=>({uploadsById:e.fileUploads.byMessageLocalId})),((e,t)=>(0,g.ei)(t,["cancelSendingMessage"])))((({album:e,observeIntersection:t,shouldAutoLoad:s,shouldAutoPlay:n,hasCustomAppendix:a,lastSyncTime:r,isOwn:i,albumLayout:c,onMediaClick:l,uploadsById:u,cancelSendingMessage:h})=>{const m=e.messages.length,g=(0,o.I4)((e=>{h({chatId:e.chatId,messageId:e.id})}),[h]),{width:f,height:p}=c.containerStyle;return o.ZP.createElement("div",{className:"Album",style:`width: ${f}px; height: ${p}px;`},e.messages.map((function(e,h){const{photo:f,video:p}=(0,d.qp)(e),I=u[e.previousLocalId||e.id],v=null==I?void 0:I.progress,{dimensions:y,sides:Z}=c.layout[h];if(f){const n=a&&(i?h===m-1:Boolean(8&Z&&4&Z));return o.ZP.createElement(Ds,{id:`album-media-${e.id}`,message:e,observeIntersection:t,shouldAutoLoad:s,shouldAffectAppendix:n,uploadProgress:v,dimensions:y,onClick:l,onCancelUpload:g})}if(p)return o.ZP.createElement(qs,{id:`album-media-${e.id}`,message:e,observeIntersection:t,shouldAutoLoad:s,shouldAutoPlay:n,uploadProgress:v,lastSyncTime:r,dimensions:y,onClick:l,onCancelUpload:g})})))}));function Hs(){return(Hs=Object.assign||function(e){for(var t=1;t{const r=(0,o.sO)(null),i=(0,o.sO)(null),c=(0,o.sO)(null),l=e.content.video,u=(0,Ft.Op)(r,t),[h,m]=(0,o.eJ)(s&&n),g=Boolean(h&&u&&a),{mediaData:f,downloadProgress:p}=(0,hs.Z)((0,d.Ti)(e,"inline"),!g,(0,d.kG)(e,"inline"),a),I=gs(e,f),{isBuffered:v,bufferingHandlers:y}=(0,ys.Z)(),P=h&&!v,C=!1===(0,fs.Z)(h),{shouldRender:w,transitionClassNames:b}=(0,de.Z)(P||!v,void 0,C),{shouldRenderThumb:M,transitionClassNames:S}=(0,is.Z)(f,"slow"),[E,k]=(0,o.eJ)(!1),[R,T]=(0,o.eJ)(0);(0,o.d4)((()=>{if(!E)return;const e=188*Math.PI,t=e-R*e,s=c.current,n=i.current,a=n.firstElementChild;a?a.firstElementChild.setAttribute("stroke-dashoffset",t.toString()):n.innerHTML=`\n \n `,T(s.currentTime/s.duration)}),[E,R]);const N=Boolean(f&&u),B=()=>{k(!1),T(0),(0,Zs.Z)(c.current),(0,Z.T2)((()=>{i.current.innerHTML=""}))},x=(A=B,()=>{js&&js(),js=A});var A;(0,o.d4)((()=>{c.current&&(N?(0,Zs.Z)(c.current):c.current.pause())}),[N]),Ps(c,N),ws(c,Boolean(f)),(0,Cs.Z)(c,[f]);const O=(0,o.I4)((()=>{if(!f)return void m((e=>!e));const e=c.current;E?e.paused?(0,Zs.Z)(e):e.pause():(x(),e.pause(),e.currentTime=0,(0,Zs.Z)(e),k(!0))}),[x,E,f]),F=(0,o.I4)((e=>{const t=e.currentTarget;T(t.currentTime/t.duration)}),[]),U=(0,ie.Z)("full-media",S);return o.ZP.createElement("div",{ref:r,className:"RoundVideo media-inner",onClick:O},(M||f)&&o.ZP.createElement("div",{className:"thumbnail-wrapper"},o.ZP.createElement("canvas",{ref:I,className:"thumbnail",style:`width: ${pt.vw}px; height: ${pt.vw}px`})),f&&o.ZP.createElement("div",{className:"video-wrapper"},o.ZP.createElement("video",Hs({ref:c,className:U,width:pt.vw,height:pt.vw,autoPlay:!0,muted:!E,loop:!E,playsInline:!0,onEnded:E?B:void 0},y,{onTimeUpdate:E?F:void 0}),o.ZP.createElement("source",{src:f}))),o.ZP.createElement("div",{className:"progress",ref:i}),w&&o.ZP.createElement("div",{className:`media-loading ${b}`},o.ZP.createElement(Is.Z,{progress:p})),!f&&!h&&o.ZP.createElement("i",{className:"icon-large-play"}),o.ZP.createElement("div",{className:"message-media-duration"},E?(0,L.k9)(c.current.currentTime):(0,L.k9)(l.duration),(!E||c.current.paused)&&o.ZP.createElement("i",{className:"icon-muted-chat"})))},Vs=({message:e,onClick:t})=>{const s=(0,Ze.Z)();return o.ZP.createElement("div",{className:"InlineButtons"},e.inlineButtons.map((e=>o.ZP.createElement("div",{className:"row"},e.map((e=>o.ZP.createElement(be.Z,{size:"tiny",ripple:!0,disabled:"NOT_SUPPORTED"===e.type,onClick:()=>t({button:e})},(0,It.Z)(s(e.text)),"buy"===e.type&&o.ZP.createElement("i",{className:"icon-card"}),"url"===e.type&&!e.value.match(a.FS)&&o.ZP.createElement("i",{className:"icon-arrow-right"}))))))))},Ws=(0,o.X$)((0,n.c$)(((e,{message:t})=>{const{threadId:s,chatId:n}=t.threadInfo,a=(0,i.tZ)(e,n,s)||t.threadInfo,{byId:o}=e.users,{byId:r}=e.chats;return{threadInfo:a,usersById:o,chatsById:r}}),((e,t)=>(0,g.ei)(t,["openChat"])))((({disabled:e,threadInfo:t,usersById:s,chatsById:n,openChat:a})=>{const r=(0,Ze.Z)(),{threadId:i,chatId:c,messagesCount:l,lastMessageId:u,lastReadInboxMessageId:h,recentReplierIds:m}=t,g=(0,o.I4)((()=>{a({id:c,threadId:i})}),[a,c,i]);if(void 0===l)return;const f=m&&m.map((e=>(0,d.YA)(e)?s[e]:n[e])).filter(Boolean),p=Boolean(h&&u&&h0&&o.ZP.createElement("div",{className:"recent-repliers",dir:r.isRtl?"rtl":"ltr"},f.map((e=>o.ZP.createElement(zt.Z,{key:e.id,size:"small",user:(0,d.YA)(e.id)?e:void 0,chat:(0,d.YA)(e.id)?void 0:e})))),o.ZP.createElement("div",{className:"label",dir:"auto"},l?r("Comments",l,"i"):r("LeaveAComment")),o.ZP.createElement("i",{className:"icon-next"}))}))),Ks="data-is-document-group-hover";function Xs(e){const t=zs(e.currentTarget);t&&t.setAttribute(Ks,"")}function Ys(e){const t=zs(e.currentTarget);t&&t.removeAttribute(Ks)}function zs(e){let t=e;do{t=t.nextElementSibling}while(t&&!t.classList.contains("last-in-document-group"));return t}const Js=(0,o.X$)((0,n.c$)(((e,t)=>{const{focusedMessage:s,forwardMessages:n,lastSyncTime:a}=e,{message:o,album:r,withSenderName:c,withAvatar:l,threadId:u,messageListType:h}=t,{id:m,chatId:g,viaBotId:f,replyToMessageId:p,isOutgoing:I}=o,v=(0,i.Z1)(e,g),y=(0,i.FM)(e,g),Z=v&&(0,d.eA)(v),P=null==v?void 0:v.username,C=!y&&(0,d.Ul)(o),w=c||l||C?(0,i.Ur)(e,o):void 0,b=(0,i.cv)(e,o),M=f?(0,i.dy)(e,f):void 0,S=u?(0,i.qS)(e,g,u):void 0,E=o.id===S,k=p===S,R=p&&!k?(0,i.hj)(e,g,p):void 0,T=R&&(0,i.Ur)(e,R),N=(0,i.uZ)(e,o),B="thread"===h&&(r?r.messages.some((t=>(0,i._X)(e,t))):(0,i._X)(e,o)),{direction:x,noHighlight:A,isResizingContainer:L}=B&&s||{},O=n.messageIds&&n.messageIds.includes(m),{query:F}=(0,i.n5)(e)||{},U=(0,d._O)(o);let $;$=null!=r&&r.messages?r.messages.every((({id:t})=>(0,i.vk)(e,t))):(0,i.vk)(e,m);const{canReply:Q}="thread"===h&&(0,i._k)(e,o,u)||{};return{theme:(0,i.Pu)(e),chatUsername:P,forceSenderName:C,sender:w,originSender:b,botSender:M,shouldHideReply:k,isThreadTop:E,replyMessage:R,replyMessageSender:T,isFocused:B,isForwarding:O,isChatWithSelf:y,isChannel:Z,canReply:Q,lastSyncTime:a,highlight:F,isSingleEmoji:Boolean(U),animatedEmoji:U?(0,i.zB)(e,U):void 0,isInSelectMode:(0,i.CA)(e),isSelected:$,isGroupSelected:!!o.groupedId&&!o.isInAlbum&&(0,i.a6)(e,g,o.groupedId),threadId:u,isPinnedList:"pinned"===h,shouldAutoLoadMedia:v?(0,i.TD)(e,o,v,w):void 0,shouldAutoPlayMedia:(0,i.pv)(e,o),shouldLoopStickers:(0,i.yB)(e),...I&&{outgoingStatus:(0,i.dT)(e,o,"scheduled"===h)},..."number"==typeof N&&{uploadProgress:N},...B&&{focusDirection:x,noFocusHighlight:A,isResizingContainer:L}}}),((e,t)=>(0,g.ei)(t,["toggleMessageSelection","clickInlineButton","disableContextMenuHint"])))((({message:e,chatUsername:t,observeIntersectionForBottom:s,observeIntersectionForMedia:a,observeIntersectionForAnimatedStickers:r,album:i,noAvatars:c,withAvatar:l,withSenderName:g,noComments:f,appearanceOrder:p,isFirstInGroup:I,isLastInGroup:v,isFirstInDocumentGroup:y,isLastInDocumentGroup:Z,isLastInList:P,theme:C,forceSenderName:w,sender:b,originSender:M,botSender:S,isThreadTop:E,shouldHideReply:k,replyMessage:R,replyMessageSender:T,outgoingStatus:N,uploadProgress:B,isFocused:x,focusDirection:A,noFocusHighlight:L,isResizingContainer:O,isForwarding:F,isChatWithSelf:U,isChannel:$,canReply:Q,lastSyncTime:D,highlight:q,animatedEmoji:G,isInSelectMode:H,isSelected:j,isGroupSelected:_,threadId:V,messageListType:W,isPinnedList:K,shouldAutoLoadMedia:X,shouldAutoPlayMedia:Y,shouldLoopStickers:z,toggleMessageSelection:J,clickInlineButton:ee,disableContextMenuHint:te})=>{const se=(0,o.sO)(null),ne=(0,o.sO)(null),ae=(0,o.sO)(null),oe=(0,Ze.Z)();(0,Ft._N)(ne,s);const{isContextMenuOpen:re,contextMenuPosition:ce,handleBeforeContextMenu:le,handleContextMenu:ue,handleContextMenuClose:he,handleContextMenuHide:me}=(0,Qt.Z)(se,m.$b&&H,!0,m.wZ);(0,o.d4)((()=>{re&&te()}),[re,te]);const ge=p<=0,[fe,pe]=(0,ye.Z)(ge);(0,o.d4)((()=>{ge||setTimeout(pe,10*p)}),[p,pe,ge]);const{transitionClassNames:Ie}=(0,de.Z)(fe,void 0,ge,!1),{id:ve,chatId:Pe,threadInfo:Ce}=e,we=(0,d.CI)(e),Me=(0,d.B4)(e),Se="scheduled"===W||e.isScheduled,Ee=(0,d.ss)(e)&&!k,ke=Boolean(Ce)&&"thread"===W,{forwardInfo:Re,viaBotId:Te}=e,Ne=Re&&!U&&!Re.isLinkedChannelPost,xe=Boolean(e.groupedId)&&!e.isInAlbum,Ae=Boolean(i)&&i.messages.length>1,{text:Le,photo:Oe,video:Fe,audio:Ue,voice:$e,document:Qe,sticker:De,contact:qe,poll:Ge,webPage:He,invoice:je}=(0,d.qp)(e),_e=(0,d.$D)(e),Ve=(0,Dt.X)(e,q,qt(_e)),We=void 0!==ce,Ke=$&&e.adminTitle||Re&&!Ne&&Re.adminTitle||void 0,Xe=(0,o.Ye)((()=>Ke?Xt(Ke):void 0),[Ke]),Ye=!(We||H||F)&&(!xe||Z),ze=$&&!Se,Je=Boolean(K||Re&&(Re.isChannelPost||U&&!Me)&&Re.fromMessageId),et=!Re||!U&&b?b:M,tt=Re?M:b,st=(0,o.I4)(((e,t)=>{we||J({messageId:ve,groupedId:t,...(null==e?void 0:e.shiftKey)&&{withShift:!0},...Ae&&{childMessageIds:i.messages.map((({id:e})=>e))}})}),[we,J,ve,Ae,i]),{handleMouseDown:at,handleClick:ot,handleContextMenu:rt,handleDoubleClick:it,handleContentDoubleClick:ct,isSwiped:lt}=function(e,t,s,a,r,i,c,d,l){const{setReplyingToId:u}=(0,n.uC)(),[h,g,f]=(0,ye.Z)();return(0,o.d4)((()=>{if(!m.$b||i||!c)return;let e;return(0,Be.s)(t.current,{selectorToPreventScroll:".MessageList",onSwipe:(t,s)=>s===Be.e.Left&&(e||(e=Date.now()),g(),!0),onRelease:()=>{e&&(u({messageId:s}),setTimeout(f,Math.max(0,150-(Date.now()-e))),e=void 0)}})}),[t,i,s,u,g,f,c]),{handleMouseDown:i?void 0:function(e){(0,At.q)(e),a||l(e)},handleClick:function(t){if(i&&!a)e(t);else if(m.wZ){const e=t.target;if(!e.classList.contains("text-content")&&!e.classList.contains("Message"))return;nt.Z.getIsKeyboardVisible()?setTimeout((()=>{d(t)}),350):d(t)}},handleContextMenu:i||a?void 0:function(t){if(m.wZ){if(t.target.matches("a[href]"))return;t.preventDefault(),e()}else d(t)},handleDoubleClick:i?void 0:function(){u({messageId:s})},handleContentDoubleClick:m.$b?void 0:function(e){e.stopPropagation()},isSwiped:h}}(st,se,ve,we,0,Boolean(H),Boolean(Q),ue,le),{handleAvatarClick:ut,handleSenderClick:ht,handleViaBotClick:mt,handleReplyClick:gt,handleMediaClick:ft,handleAudioPlay:vt,handleAlbumMediaClick:yt,handleMetaClick:Zt,handleReadMedia:Pt,handleCancelUpload:Ct,handleVoteSend:wt,handleGroupForward:bt,handleForward:Mt,handleFocus:St,handleFocusForwarded:Et,handleDocumentGroupSelectAll:kt}=function(e,t,s,a,r,i,c,l,m,g,f){const{openUserInfo:p,openChat:I,showNotification:v,focusMessage:y,openMediaViewer:Z,openAudioPlayer:P,markMessagesRead:C,cancelSendingMessage:w,sendPollVote:b,openForwardMenu:M}=(0,n.uC)(),{id:S,forwardInfo:E,replyToMessageId:k,groupedId:R}=s,T=(0,o.I4)((()=>{m&&((0,d.YA)(m.id)?p({id:m.id}):I({id:m.id}))}),[m,p,I]),N=(0,o.I4)((()=>{g?(0,d.YA)(g.id)?p({id:g.id}):I({id:g.id}):v({message:e("HidAccount")})}),[g,v,e,p,I]),B=(0,o.I4)((()=>{f&&p({id:f.id})}),[f,p]),x=(0,o.I4)((()=>{y({chatId:a,threadId:r,messageId:k,replyMessageId:S})}),[y,a,r,k,S]),A=(0,o.I4)((()=>{Z({chatId:a,threadId:r,messageId:S,origin:c?h.bZ.ScheduledInline:h.bZ.Inline})}),[a,r,S,Z,c]),L=(0,o.I4)((()=>{P({chatId:a,messageId:S})}),[a,S,P]),O=(0,o.I4)((e=>{Z({chatId:a,threadId:r,messageId:e,origin:c?h.bZ.ScheduledAlbum:h.bZ.Album})}),[a,r,Z,c]),F=(0,o.I4)((()=>{C({messageIds:[S]})}),[S,C]),U=(0,o.I4)((()=>{w({chatId:a,messageId:S})}),[w,a,S]),$=(0,o.I4)((e=>{b({chatId:a,messageId:S,options:e})}),[a,S,b]),Q=(0,o.I4)((()=>{M({fromChatId:a,groupedId:R})}),[M,a,R]),D=(0,o.I4)((()=>{if(l&&l.messages){const e=l.messages.map((({id:e})=>e));M({fromChatId:a,messageIds:e})}else M({fromChatId:a,messageIds:[S]})}),[l,M,a,S]),q=(0,o.I4)((()=>{y({chatId:a,threadId:u._f,messageId:S})}),[y,a,S]),G=(0,o.I4)((()=>{y(i?{chatId:E.fromChatId,groupedId:R,groupedChatId:a}:{chatId:E.fromChatId,messageId:E.fromMessageId})}),[i,y,E,R,a]),H=(0,o.I4)((e=>{e.stopPropagation(),t(e,R)}),[t,R]);return{handleAvatarClick:T,handleSenderClick:N,handleViaBotClick:B,handleReplyClick:x,handleMediaClick:A,handleAudioPlay:L,handleAlbumMediaClick:O,handleMetaClick:H,handleReadMedia:F,handleCancelUpload:U,handleVoteSend:$,handleGroupForward:Q,handleForward:D,handleFocus:q,handleFocusForwarded:G,handleDocumentGroupSelectAll:H}}(oe,st,e,Pe,V,xe,Boolean(Se),i,et,tt,S),Rt=(0,ie.Z)("Message message-list-item",I&&"first-in-group",v&&"last-in-group",y&&"first-in-document-group",Z&&"last-in-document-group",P&&"last-in-list",Me&&"own",Boolean(e.views)&&"has-views",e.isEdited&&"was-edited",Ee&&"has-reply",We&&"has-menu-open",x&&!L&&"focused",F&&"is-forwarding",e.isDeleting&&"is-deleting",xe&&"is-in-document-group",Ae&&"is-album",e.hasUnreadMention&&"has-unread-mention",j&&"is-selected",H&&"is-in-selection-mode",E&&"is-thread-top",Boolean(e.inlineButtons)&&"has-inline-buttons",lt&&"is-swiped",Ie),Tt=function(e,{hasReply:t,customShape:s,isLastInGroup:n,asForwarded:a,hasThread:o,forceSenderName:r,hasComments:i,hasActionButton:c}={}){const{text:l,photo:u,video:h,audio:m,voice:g,document:f,poll:p,webPage:I,contact:v}=(0,d.qp)(e),y=["message-content"],Z=u||h,P=Z&&!l,C=Boolean(e.viaBotId);return qt(s)?y.push(`emoji-only emoji-only-${s}`):l&&y.push("text"),c&&y.push("has-action-button"),s&&(y.push("custom-shape"),null!=h&&h.isRound&&y.push("round"),i&&y.push("has-comments")),u||h?y.push("media"):m?y.push("audio"):g?y.push("voice"):f?y.push("document"):v?y.push("contact"):p?y.push("poll"):I&&(y.push("web-page"),(I.photo||I.video)&&y.push("media")),a&&!s&&y.push("is-forwarded"),t&&y.push("is-reply"),o&&y.push("has-replies"),C&&y.push("is-via-bot"),r&&y.push("force-sender-name"),s||(y.push("has-shadow"),Z&&i&&y.push("has-background"),(t||a||!P||C||r)&&y.push("has-solid-background"),!n||!u&&P||y.push("has-appendix")),y.join(" ")}(e,{hasReply:Ee,customShape:_e,isLastInGroup:v,asForwarded:Ne,hasThread:ke,forceSenderName:w,hasComments:e.threadInfo&&e.threadInfo.messagesCount>0,hasActionButton:ze||Je}),Nt=e.threadInfo&&(!xe||Z)&&"thread"===W&&!f,Bt=Tt.includes("has-appendix");(0,dt.Z)(Pe,Ee?e.replyToMessageId:void 0,R,e.id),Yt(se,Pe,x,A,L,O),(0,o.bt)((()=>{ae.current&&(ae.current.innerHTML=Me?'':'')}),[Me,Bt]);let xt,Lt="",Ot=!1;const Ut=(0,o.Ye)((()=>Ae?Wt(Me,Boolean(Ne),Boolean(c),i):void 0),[Ae,Me,Ne,c,i]),$t=Ne?28:0;if(Ae||!Oe&&!Fe)Ut&&(xt=Math.max(Gt(Boolean(Le),Nt),Ut.containerStyle.width),xt-Ut.containerStyle.width>18&&(Ot=!0));else{let t;Oe?t=Ht(e,c).width:Fe&&(t=Fe.isRound?pt.vw:Ht(e,c).width),t&&(xt=Math.max(Gt(Boolean(Le),Nt),t),xt-t>18&&(Ot=!0))}return xt&&(Lt=`width: ${xt+$t}px`),o.ZP.createElement("div",{ref:se,id:`message${ve}`,className:Rt,style:Xe?`--meta-safe-author-width: ${Xe}px`:void 0,"data-message-id":ve,onMouseDown:at,onClick:ot,onContextMenu:rt,onDoubleClick:it,onMouseEnter:xe&&!Z?Xs:void 0,onMouseLeave:xe&&!Z?Ys:void 0},o.ZP.createElement("div",{ref:ne,className:"bottom-marker","data-message-id":ve,"data-last-message-id":i?i.messages[i.messages.length-1].id:void 0,"data-has-unread-mention":e.hasUnreadMention}),!we&&!xe&&o.ZP.createElement("div",{className:"message-select-control"},j&&o.ZP.createElement("i",{className:"icon-select"})),!we&&Z&&o.ZP.createElement("div",{className:(0,ie.Z)("message-select-control group-select",_&&"is-selected"),onClick:kt},_&&o.ZP.createElement("i",{className:"icon-select"})),l&&function(){const e=et&&(0,d.YA)(et.id),t=et&&e?et:void 0,s=et&&!e?et:void 0,n=!et&&Re?Re.hiddenUserName:void 0;return o.ZP.createElement(zt.Z,{size:"small",user:t,chat:s,text:n,lastSyncTime:D,onClick:t||s?ut:void 0})}(),o.ZP.createElement("div",{className:(0,ie.Z)("message-content-wrapper",Tt.includes("text")&&"can-select-text")},o.ZP.createElement("div",{className:Tt,style:Lt,dir:"auto"},Ne&&!_e&&(!xe||y)&&o.ZP.createElement("div",{className:"message-title"},oe("ForwardedMessage")),function(){const t=(0,ie.Z)("content-inner",Ne&&!_e&&"forwarded-message",Ee&&"reply-message",Ot&&"no-media-corners"),s=v&&!Ve&&!Ne&&!ke,n=!He&&!G&&Ve,l=(0,ie.Z)("text-content",n&&"with-meta",N&&"with-outgoing-icon");return o.ZP.createElement("div",{className:t,onDoubleClick:ct,dir:"auto"},function(){if(_e&&!Te||!(g&&!Oe&&!Fe||Ne||Te||w)||xe&&!y)return;let t,s;return!tt||_e&&Te?null!=Re&&Re.hiddenUserName&&(t=Re.hiddenUserName):(t=(0,d.OU)(oe,tt),Ne||(s=`color-${(0,d.Rs)(tt)}`)),o.ZP.createElement("div",{className:"message-title",dir:"ltr"},t?o.ZP.createElement("span",{className:(0,ie.Z)("interactive",s),onClick:ht,dir:"auto"},(0,It.Z)(t)):S?void 0:" ",S&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("span",{className:"via"},oe("ViaBot")),o.ZP.createElement("span",{className:"interactive",onClick:mt},(0,It.Z)(`@${S.username}`))),null!=Re&&Re.isLinkedChannelPost?o.ZP.createElement("span",{className:"admin-title",dir:"auto"},oe("DiscussChannel")):e.adminTitle&&!$?o.ZP.createElement("span",{className:"admin-title",dir:"auto"},e.adminTitle):void 0)}(),Ee&&o.ZP.createElement(ss,{message:R,sender:T,observeIntersection:a,onClick:gt}),De&&o.ZP.createElement(ls,{message:e,observeIntersection:a,observeIntersectionForPlaying:r,shouldLoop:z,lastSyncTime:D}),G&&o.ZP.createElement(us.Z,{size:"small",sticker:G,observeIntersection:a,lastSyncTime:D,forceLoadPreview:we}),Ae&&o.ZP.createElement(Gs,{album:i,albumLayout:Ut,observeIntersection:a,shouldAutoLoad:X,shouldAutoPlay:Y,isOwn:Me,hasCustomAppendix:s,lastSyncTime:D,onMediaClick:yt}),!Ae&&Oe&&o.ZP.createElement(vs,{message:e,observeIntersection:a,noAvatars:c,shouldAutoLoad:X,uploadProgress:B,shouldAffectAppendix:s,onClick:ft,onCancelUpload:Ct}),!Ae&&Fe&&Fe.isRound&&o.ZP.createElement(_s,{message:e,observeIntersection:a,shouldAutoLoad:X,shouldAutoPlay:Y,lastSyncTime:D}),!Ae&&Fe&&!Fe.isRound&&o.ZP.createElement(Ms,{message:e,observeIntersection:a,noAvatars:c,shouldAutoLoad:X,shouldAutoPlay:Y,uploadProgress:B,lastSyncTime:D,onClick:ft,onCancelUpload:Ct}),(Ue||$e)&&o.ZP.createElement(as.Z,{theme:C,message:e,uploadProgress:B,lastSyncTime:D,isSelectable:xe,isSelected:j,onPlay:vt,onReadMedia:!$e||Me&&!U?void 0:Pt,onCancelUpload:Ct}),Qe&&o.ZP.createElement(ns.Z,{message:e,observeIntersection:a,uploadProgress:B,isSelectable:xe,isSelected:j,onMediaClick:ft,onCancelUpload:Ct}),qe&&o.ZP.createElement(Es,{contact:qe}),Ge&&o.ZP.createElement(As,{message:e,poll:Ge,onSendVote:wt}),!G&&Ve&&o.ZP.createElement("p",{className:l,dir:"auto"},Ve,n&&o.ZP.createElement(rs,{message:e,outgoingStatus:N,signature:Ke,onClick:Zt})),He&&o.ZP.createElement(Fs,{message:e,observeIntersection:a,noAvatars:c,shouldAutoLoad:X,shouldAutoPlay:Y,lastSyncTime:D,onMediaClick:ft,onCancelMediaTransfer:Ct}),je&&o.ZP.createElement($s,{message:e}))}(),(!xe||Z)&&!(!He&&!G&&Ve)&&o.ZP.createElement(rs,{message:e,outgoingStatus:N,signature:Ke,onClick:Zt}),Ye&&ze?o.ZP.createElement(be.Z,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:oe("lng_context_forward_msg"),onClick:Z?bt:Mt},o.ZP.createElement("i",{className:"icon-share-filled"})):Ye&&Je?o.ZP.createElement(be.Z,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:"Focus message",onClick:K?St:Et},o.ZP.createElement("i",{className:"icon-arrow-right"})):void 0,Nt&&o.ZP.createElement(Ws,{message:e,disabled:f}),Bt&&o.ZP.createElement("div",{className:"svg-appendix",ref:ae})),e.inlineButtons&&o.ZP.createElement(Vs,{message:e,onClick:ee})),ce&&o.ZP.createElement(es,{isOpen:re,anchor:ce,message:e,album:i,chatUsername:t,messageListType:W,onClose:he,onCloseAnimationEnd:me}))}))),en=(0,o.X$)((({messageIds:e,messageGroups:t,isViewportNewest:s,isUnread:r,withUsers:i,noAvatars:c,containerRef:l,anchorIdRef:u,memoUnreadDividerBeforeIdRef:m,memoFirstUnreadIdRef:f,threadId:p,type:I,isActive:v,threadTopMessageId:y,hasLinkedChat:P,isSchedule:C,noAppearanceAnimation:w,onFabToggle:b,onNotchToggle:M,openHistoryCalendar:S})=>{const{observeIntersectionForMedia:E,observeIntersectionForReading:k,observeIntersectionForAnimatedStickers:R}=function(e,t,s){const{markMessageListRead:a,markMessagesRead:o}=(0,n.uC)(),{observe:r}=(0,Ft.S1)({rootRef:t,throttleMs:Ut,margin:$t}),{observe:i,freeze:c,unfreeze:d}=(0,Ft.S1)({rootRef:t,throttleMs:150},(t=>{if("thread"!==e)return;let n=0;const r=[];t.forEach((e=>{const{isIntersecting:t,target:s}=e;if(!t)return;const{dataset:a}=s,o=Number(a.lastMessageId||a.messageId);o>n&&(n=o),a.hasUnreadMention&&r.push(o)})),s.current&&n>=s.current&&a({maxId:n}),r.length&&o({messageIds:r})}));(0,le.Z)(c,d);const{observe:l}=(0,Ft.S1)({rootRef:t,throttleMs:Ut});return{observeIntersectionForMedia:r,observeIntersectionForReading:i,observeIntersectionForAnimatedStickers:l}}(I,l,f),{backwardsTriggerRef:T,forwardsTriggerRef:N,fabTriggerRef:B}=function(e,t,s,r,i,c,d,l){const{loadViewportMessages:u}=(0,n.uC)(),[m,g]=(0,o.Ye)((()=>"thread"===e?[(0,Z.Ds)((()=>u({direction:h.Uq.Backwards})),1e3,!0,!1),(0,Z.Ds)((()=>u({direction:h.Uq.Forwards})),1e3,!0,!1)]:[]),[u,s]),f=(0,o.sO)(null),p=(0,o.sO)(null),I=(0,o.sO)(null);function v(){if(!l)return;if(!s||!s.length)return c(!1),void d(!1);if(!r)return c(!0),void d(!0);const{offsetHeight:e,scrollHeight:n,scrollTop:a}=t.current,o=Math.round(n-a-e),u=o<=0;c(i?!u:!(o<=50)),d(!u)}const{observe:y}=(0,Ft.S1)({rootRef:t,margin:a.gZ},(e=>{if(!g||!m)return;if(s[0]>=a.AE)return;const n=e.find((({isIntersecting:e})=>e));if(!n)return;const{target:o}=n;"backwards-trigger"===o.className?((0,Lt.Z)(t.current),m()):"forwards-trigger"===o.className&&((0,Lt.Z)(t.current),g())}));(0,Ft._N)(f,y),(0,Ft._N)(p,y);const{observe:P,freeze:C,unfreeze:w}=(0,Ft.S1)({rootRef:t,margin:50},v);(0,Ft._N)(I,P);const{observe:b,freeze:M,unfreeze:S}=(0,Ft.S1)({rootRef:t},v);return(0,Ft._N)(I,b),(0,he.Z)((()=>{C(),M(),setTimeout((()=>{S(),w()}),100)}),[s]),{backwardsTriggerRef:f,forwardsTriggerRef:p,fabTriggerRef:I}}(I,l,e,s,r,b,M,v),x=(0,Ze.Z)(),A=o.ZP.createElement("div",{className:(0,ie.Z)("unread-divider","local-action-message"),key:"unread-messages"},o.ZP.createElement("span",null,x("UnreadMessages"))),O=w?0:t.reduce(((e,t)=>e+(0,g.xH)(t.senderGroups).length),0);let F=0;const U=t.map(((e,t,s)=>{const n=e.senderGroups.map(((e,n,a)=>{if(1===e.length&&!Bt(e[0])&&(0,d.Lo)(e[0])){const r=e[0],i=n===a.length-1&&t===s.length-1;return(0,g.oA)([r.id===m.current&&A,o.ZP.createElement(ts,{key:r.id,message:r,observeIntersection:k,appearanceOrder:O-++F,isLastInList:i})])}let r;return(0,g.xH)(e.map(((l,h)=>{const f=Bt(l)?l.mainMessage:l,v=Bt(l)?l:void 0,Z=(0,d.B4)(f),C=Bt(l),w=e[h+1];f.previousLocalId&&u.current===`message${f.previousLocalId}`&&(u.current=`message${f.id}`);const b=!C&&f.groupedId?f.groupedId:void 0,M=w&&!Bt(w)?w.groupedId:void 0,S={isFirstInGroup:0===h,isLastInGroup:h===e.length-1,isFirstInDocumentGroup:Boolean(b&&b!==r),isLastInDocumentGroup:Boolean(b&&b!==M),isLastInList:h===e.length-1&&n===a.length-1&&t===s.length-1};r=b;const T=(0,d.KK)(f),N="scheduled"!==I?T:`${f.date}_${T}`;return(0,g.oA)([f.id===m.current&&A,o.ZP.createElement(Js,{key:N,message:f,observeIntersectionForBottom:k,observeIntersectionForMedia:E,observeIntersectionForAnimatedStickers:R,album:v,noAvatars:c,withAvatar:S.isLastInGroup&&i&&!Z&&!(f.id===y),withSenderName:S.isFirstInGroup&&i&&!Z,threadId:p,messageListType:I,noComments:!1===P,appearanceOrder:O-++F,isFirstInGroup:S.isFirstInGroup,isLastInGroup:S.isLastInGroup,isFirstInDocumentGroup:S.isFirstInDocumentGroup,isLastInDocumentGroup:S.isLastInDocumentGroup,isLastInList:S.isLastInList}),f.id===y&&o.ZP.createElement("div",{className:"local-action-message",key:"discussion-started"},o.ZP.createElement("span",null,x("DiscussionStarted")))])})))}));return o.ZP.createElement("div",{className:"message-date-group",key:e.datetime,onMouseDown:At.q,teactFastList:!0},o.ZP.createElement("div",{className:(0,ie.Z)("sticky-date",!C&&"interactive"),key:"date-header",onMouseDown:At.q,onClick:C?void 0:()=>S({selectedAt:e.datetime})},o.ZP.createElement("span",{dir:"auto"},C&&e.originalDate===a.t4&&x("MessageScheduledUntilOnline"),C&&e.originalDate!==a.t4&&x("MessageScheduledOn",(0,L.j1)(x,e.datetime,void 0,!0)),!C&&(0,L.j1)(x,e.datetime))),(0,g.xH)(n))}));return o.ZP.createElement("div",{className:"messages-container",teactFastList:!0},o.ZP.createElement("div",{ref:T,key:"backwards-trigger",className:"backwards-trigger"}),(0,g.xH)(U),o.ZP.createElement("div",{ref:N,key:"forwards-trigger",className:"forwards-trigger"}),o.ZP.createElement("div",{ref:B,key:"fab-trigger",className:"fab-trigger"}))}));var tn=s(3547);const sn=(0,o.X$)((0,n.c$)(((e,{userId:t})=>{const{stickers:s}=e.stickers.greeting,n=null!=s&&s.length?s[t%s.length]:void 0,a=(0,i.Z1)(e,t);return a?{sticker:n,lastUnreadMessageId:a.lastMessage&&a.lastMessage.id!==a.lastReadInboxMessageId?a.lastMessage.id:void 0,connectionState:e.connectionState}:{}}),((e,t)=>(0,g.ei)(t,["loadGreetingStickers","sendMessage","markMessageListRead"])))((({sticker:e,connectionState:t,lastUnreadMessageId:s,loadGreetingStickers:n,sendMessage:a,markMessageListRead:r})=>{const i=(0,Ze.Z)(),c=(0,o.sO)(null),{observe:d}=(0,Ft.S1)({rootRef:c,debounceMs:200});(0,o.d4)((()=>{e||"connectionStateReady"!==t||n()}),[t,n,e]),(0,o.d4)((()=>{"connectionStateReady"===t&&s&&r({maxId:s})}),[t,r,s]);const l=(0,o.I4)((e=>{e={...e,isPreloadedGlobally:!0},a({sticker:e})}),[a]);return o.ZP.createElement("div",{className:"ContactGreeting",ref:c},o.ZP.createElement("div",{className:"wrapper"},o.ZP.createElement("p",{className:"title",dir:"auto"},i("Conversation.EmptyPlaceholder")),o.ZP.createElement("p",{className:"description",dir:"auto"},i("Conversation.GreetingText")),o.ZP.createElement("div",{className:"sticker"},e&&o.ZP.createElement(tn.Z,{sticker:e,onClick:l,clickArg:e,observeIntersection:d,size:160,className:"large"}))))}))),nn=(0,o.X$)((({isChatWithSelf:e,type:t,isGroupChatJustCreated:s})=>{const n=(0,Ze.Z)();return"scheduled"===t?function(e){return o.ZP.createElement("div",{className:"empty"},o.ZP.createElement("span",null,e("ScheduledMessages.EmptyPlaceholder")))}(n):e?function(e){return o.ZP.createElement("div",{className:"NoMessages"},o.ZP.createElement("div",{className:"wrapper"},o.ZP.createElement("i",{className:"icon icon-cloud-download"}),o.ZP.createElement("h3",{className:"title"},e("Conversation.CloudStorageInfo.Title")),o.ZP.createElement("ul",{className:"description"},o.ZP.createElement("li",null,e("Conversation.ClousStorageInfo.Description1")),o.ZP.createElement("li",null,e("Conversation.ClousStorageInfo.Description2")),o.ZP.createElement("li",null,e("Conversation.ClousStorageInfo.Description3")),o.ZP.createElement("li",null,e("Conversation.ClousStorageInfo.Description4")))))}(n):s?function(e){return o.ZP.createElement("div",{className:"NoMessages"},o.ZP.createElement("div",{className:"wrapper",dir:e.isRtl?"rtl":void 0},o.ZP.createElement("h3",{className:"title"},e("EmptyGroupInfo.Title")),o.ZP.createElement("p",{className:"description"},e("EmptyGroupInfo.Subtitle")),o.ZP.createElement("ul",{className:"list-checkmarks"},o.ZP.createElement("li",null,e("EmptyGroupInfo.Line1")),o.ZP.createElement("li",null,e("EmptyGroupInfo.Line2")),o.ZP.createElement("li",null,e("EmptyGroupInfo.Line3")),o.ZP.createElement("li",null,e("EmptyGroupInfo.Line4")))))}(n):o.ZP.createElement("div",{className:"empty"},o.ZP.createElement("span",null,n("NoMessages")))})),an=(0,Z.Ds)((e=>e()),200,!1),on=(0,o.X$)((0,n.c$)(((e,{chatId:t,threadId:s,type:n})=>{const a=(0,i.Z1)(e,t);if(!a)return{};const o=(0,i.$W)(e,t,s,n),r="scheduled"===n?(0,i.Fn)(e,t):(0,i.Zw)(e,t),c=(0,i.qS)(e,t,s);if(s!==u._f&&!(r&&c&&r[c]))return{};const{isRestricted:l,restrictionReason:h,lastMessage:m}=a,g=(0,i.G$)(e,t),f=s===u._f&&!o&&!a.unreadCount&&!g&&m&&!m.groupedId,p=(0,i.IK)(e,t);let I;return(0,i.pk)(e,t)&&(I=p.fullInfo?p.fullInfo.botDescription||"NoMessages":"Updating bot info..."),{isChatLoaded:!0,isRestricted:l,restrictionReason:h,isChannelChat:(0,d.eA)(a),isGroupChat:(0,d.Bf)(a),isCreator:a.isCreator,isChatWithSelf:(0,i.FM)(e,t),isBot:Boolean(p),messageIds:o,messagesById:r,firstUnreadId:(0,i.It)(e,t,s),isViewportNewest:"thread"!==n||(0,i.b9)(e,t,s),threadFirstMessageId:(0,i.yZ)(e,t,s),focusingId:g,isSelectModeActive:(0,i.CA)(e),botDescription:I,threadTopMessageId:c,hasLinkedChat:a.fullInfo&&"linkedChatId"in a.fullInfo?Boolean(a.fullInfo.linkedChatId):void 0,...f&&{lastMessage:m}}}),((e,t)=>(0,g.ei)(t,["loadViewportMessages","setScrollOffset","openHistoryCalendar"])))((({chatId:e,threadId:t,type:s,hasTools:r,onFabToggle:c,onNotchToggle:l,isChatLoaded:u,isChannelChat:m,isGroupChat:f,canPost:p,isReady:I,isActive:v,isChatWithSelf:y,isCreator:P,isBot:C,messageIds:w,messagesById:b,firstUnreadId:M,isViewportNewest:S,threadFirstMessageId:E,isRestricted:k,restrictionReason:R,focusingId:T,isSelectModeActive:N,loadViewportMessages:B,setScrollOffset:x,lastMessage:A,botDescription:L,threadTopMessageId:O,hasLinkedChat:F,openHistoryCalendar:U})=>{var $,Q,D,q,G,H;const j=(0,o.sO)(null),_=(0,o.sO)("thread"===s&&(0,i.Vt)((0,n.Rd)(),e,t)||0),V=(0,o.sO)(),W=(0,o.sO)(),K=(0,o.sO)(),X=(0,o.sO)(),Y=(0,o.sO)(),z=(0,o.sO)(),J=(0,o.sO)(!1),ee=(0,o.sO)(Boolean(A)),[te,se]=(0,o.eJ)(),ne=Boolean(w);(0,he.Z)((()=>{ne&&(0,Z.R3)((()=>{ee.current=!1}))}),[ne]),(0,he.Z)((()=>{X.current=M}),[M]),(0,he.Z)((()=>{ne&&(Y.current=X.current)}),[ne]),(0,he.Z)((()=>{z.current=T}),[T]);const ae=(0,o.Ye)((()=>{if(!w||!b)return;const e=!O||w[0]&&E!==w[0]?w:[O,...w];if(!e.length)return;const t=e.map((e=>b[e])).filter(Boolean);return xt((0,g.Xo)(t,["date","id"]),Y.current)}),[w,b,E,O]),oe=(0,o.Ye)((()=>{if("thread"===s)return(0,Z.Ds)((()=>B({direction:h.Uq.Around})),1e3,!0,!1)}),[B,w]),{isScrolled:ce,updateStickyDates:de}=function(){const[e,t]=(0,ye.Z)(!1),s=(0,o.Ye)((()=>(0,Z.Ds)((e=>e()),1e3,!1,n)),[1e3,!1,n]);var n;return{isScrolled:e,updateStickyDates:(0,o.I4)(((e,n)=>{t(),document.body.classList.contains("is-scrolling-messages")||(0,Z.T2)((()=>{document.body.classList.add("is-scrolling-messages")})),s((()=>{(0,Z.T2)((()=>{const t=document.querySelector(".stuck");t&&t.classList.remove("stuck");const s=function(e,t){const s=e.querySelectorAll(".sticky-date"),n=e.scrollTop;return Array.from(s).find((e=>{const{offsetTop:s,offsetHeight:a}=e,o=s-n;return-a<=o&&o<=(t?60:10)}))}(e,n);s&&s.classList.add("stuck"),document.body.classList.remove("is-scrolling-messages")}))}))}),[t,s])}}(),le=(0,o.I4)((()=>{if(J.current)return void(J.current=!1);const n=j.current;z.current||de(n,r),an((()=>{(0,Z.T2)((()=>{n.parentElement&&(_.current=n.scrollHeight-n.scrollTop,"thread"===s&&x({chatId:e,threadId:t,scrollOffset:_.current}))}))}))}),[de,r,s,x,e,t]);(0,o.d4)((()=>{if(!("ResizeObserver"in window))return;const e=new ResizeObserver((([e])=>{e.target.offsetParent&&se(e.contentRect.height)}));return e.observe(j.current),()=>{e.disconnect()}}),[]);const{height:ue}=at();(0,o.d4)((()=>{I&&(j.current.dataset.normalHeight=String(j.current.offsetHeight))}),[ue,I,p]),(0,o.d4)((()=>{if(!oe||!u||k||T)return;if(w&&w[0]>=a.AE)return;const e=j.current;(!w||w.length{if(!w||!K.current||!I)return;const e=K.current.filter((e=>w.includes(Number(e.dataset.messageId)))),t=e[1]||e[0];t&&(V.current=t.id,W.current=t.getBoundingClientRect().top)}),[w,S,te,r,I]),(0,Tt.Z)((([e,t,s])=>{const n=j.current;if(K.current=Array.from(n.querySelectorAll(".message-list-item")),!n.offsetParent)return;const o=S&&w&&w.length{n.parentElement&&n.parentElement.classList.remove("force-messages-scroll")}),1e3));const i=w&&e&&w[w.length-1]!==e[e.length-1],c=(null==w?void 0:w[0])!==(null==e?void 0:e[0])&&(null==w?void 0:w.length)===a.hT/2+1,d=i&&!c,l=w&&z.current===w[w.length-1],{scrollTop:u,scrollHeight:h,offsetHeight:m}=n,g=_.current,f=K.current[K.current.length-1];let p=g-(s||m);d&&(p-=f?f.offsetHeight:0);const I=S&&t&&p<=20;let v;if(d&&I&&!l&&(f&&(0,Z.T2)((()=>{(0,Ot.Z)(n,f,"end",20)})),v=h-m,_.current=Math.max(h-v,m),!o))return;const y=void 0!==s&&s!==te,P=V.current&&n.querySelector(`#${V.current}`),C=!P&&Y.current&&n.querySelector(".unread-divider");if(I&&y){if((0,Ot.N)())return;v=h-m}else v=P?u+(P.getBoundingClientRect().top-(W.current||0)):C?Math.min(C.offsetTop-(r?60:10),h-g):h-g;(0,Lt.Z)(n,v),z.current||(J.current=!0,(0,Z.T2)((()=>{J.current=!1}))),_.current=Math.max(h-v,m)}),[w,S,te,r]),(0,Nt.Z)((([e])=>{void 0!==e&&(0,re.YW)(200+a.fK)}),[N]);const me=(0,Ze.Z)(),ge=Boolean(e&&(0,d.YA)(e)),fe=Boolean(!ge&&!m||y),pe=Boolean(!fe||m),Ie=(0,d.YA)(e)&&!y&&!C&&(!ae&&!A&&w&&(!K.current||0===K.current.length)||1===(null==w?void 0:w.length)&&"contactSignUp"===(null==b||null===($=b[w[0]])||void 0===$||null===(Q=$.content.action)||void 0===Q?void 0:Q.type)||"contactSignUp"===(null==A||null===(D=A.content)||void 0===D||null===(q=D.action)||void 0===q?void 0:q.type)),ve=f&&P&&1===(null==w?void 0:w.length)&&"chatCreate"===(null==b||null===(G=b[w[0]])||void 0===G||null===(H=G.content.action)||void 0===H?void 0:H.type),Pe=(0,ie.Z)("MessageList custom-scroll",pe&&"no-avatars",!p&&"no-composer","pinned"===s&&"type-pinned",N&&"select-mode-active",ce&&"scrolled",!I&&"is-animating");return o.ZP.createElement("div",{ref:j,className:Pe,onScroll:le,onMouseDown:At.q},k?o.ZP.createElement("div",{className:"empty"},o.ZP.createElement("span",null,R?R.text:"This is a private "+(m?"channel":"chat"))):L?o.ZP.createElement("div",{className:"empty"},o.ZP.createElement("span",null,(0,It.Z)(me(L),["br","emoji","links"]))):Ie?o.ZP.createElement(sn,{userId:e}):!w||ae&&!ve?w&&ae||A?o.ZP.createElement(en,{messageIds:w||[A.id],messageGroups:ae||xt([A]),isViewportNewest:Boolean(S),isUnread:Boolean(M),withUsers:fe,noAvatars:pe,containerRef:j,anchorIdRef:V,memoUnreadDividerBeforeIdRef:Y,memoFirstUnreadIdRef:X,threadId:t,type:s,isActive:v,threadTopMessageId:O,hasLinkedChat:F,isSchedule:!!ae&&"scheduled"===s,noAppearanceAnimation:!ae||!ee.current,onFabToggle:c,onNotchToggle:l,openHistoryCalendar:U}):o.ZP.createElement(Ue.Z,{color:"white"}):o.ZP.createElement(nn,{chatId:e,type:s,isChatWithSelf:y,isGroupChatJustCreated:ve}))}))),rn=(0,o.X$)((0,n.c$)((e=>{const t=(0,i.Bt)(e);if(!t)return{};const{chatId:s,threadId:n,type:a}=t,o=(0,i.Z1)(e,s);return{messageListType:a,unreadCount:o&&n===u._f&&"thread"===a?o.unreadCount:void 0}}),((e,t)=>(0,g.ei)(t,["focusNextReply"])))((({isShown:e,canPost:t,messageListType:s,unreadCount:n,withExtraShift:a,focusNextReply:r})=>{const i=(0,Ze.Z)(),c=(0,o.sO)(null),d=(0,o.I4)((()=>{if(e)if("thread"===s)r();else{const e=c.current.parentElement.querySelector(".MessageList"),t=e.querySelectorAll(".message-list-item"),s=t[t.length-1];if(!s)return;(0,Ot.Z)(e,s,"end",20)}}),[e,s,r]),l=(0,ie.Z)("ScrollDownButton",e&&"revealed",!t&&"no-composer",a&&"with-extra-shift");return o.ZP.createElement("div",{ref:c,className:l},o.ZP.createElement("div",{className:"ScrollDownButton-inner"},o.ZP.createElement(be.Z,{color:"secondary",round:!0,onClick:d,ariaLabel:i("AccDescrPageDown")},o.ZP.createElement("i",{className:"icon-arrow-down"})),Boolean(n)&&o.ZP.createElement("div",{className:"unread-count"},(0,ut.bi)(n))))})));var cn=s(5723),dn=s(6980);const ln=1280;async function un(e,t,s,n){const a=URL.createObjectURL(t),{type:o,size:r}=t;let i,c;if(o.startsWith("image/"))if(s){const s=await(0,st.pt)(a),{width:r,height:c}=s;if(r>ln||c>ln||"image/jpeg"!==o){const o=await function(e){return new Promise((t=>{const s=document.createElement("canvas"),n=s.getContext("2d");let{width:a,height:o}=e;(a>ln||o>ln)&&(a>=o?(o*=ln/a,a=ln):(a*=ln/o,o=ln)),s.width=a,s.height=o,n.drawImage(e,0,0,e.width,e.height,0,0,a,o),s.toBlob(t,"image/jpeg",100)}))}(s);return o?(URL.revokeObjectURL(a),un(e,o,!0,n)):un(e,t,!1,n)}i={width:r,height:c}}else c=a;else if(o.startsWith("video/")){if(r<10485760){const{videoWidth:e,videoHeight:t,duration:s}=await(0,st.jj)(a);i={width:e,height:t,duration:s}}c=await(0,st.ud)(a)}return{blobUrl:a,filename:e,mimeType:o,size:r,quick:i,previewBlobUrl:c,...n}}var hn=s(6391);let mn;function gn(e){mn.focus(),e.focus()}m.cj&&(mn=document.createElement("input"),mn.classList.add("for-ios-autocapitalization-fix"),document.body.appendChild(mn));const fn={encoderPath:s.p+"c0155344d336103c2b6a0b28cc510750.js",reuseWorker:!0},pn={type:"audio/ogg"};let In,vn,yn;async function Zn(){return In||(In=s.e(161).then(s.t.bind(s,1161,23)),vn=(await In).default,yn=new vn(fn)),In}async function Pn(e){await async function(){await Zn(),await yn.start()}();const t=Date.now();let s;const n=[],a=[];yn.ondataavailable=e=>{n.push(e)};const o=function(t,s){const n=t.sourceNode,o=n.context.createAnalyser();o.fftSize=64,n.connect(o);const r=o.frequencyBinCount,i=new Uint8Array(r);let c=!1;return function t(){if(c)return;o.getByteFrequencyData(i);const s=i.reduce(((e,t)=>e+t),0)/r/255;(t=>{a.push(255*t),e(t)})(s<.1?0:s),requestAnimationFrame(t)}(),()=>{c=!0}}(yn);return{stop:()=>new Promise(((e,r)=>{yn.onstop=()=>{e({blob:new Blob(n,pn),duration:Math.round(((s||Date.now())-t)/1e3),waveform:a})},yn.onerror=r;const i=Math.max(0,t+1e3-Date.now());setTimeout((()=>{yn.stop(),o()}),i)})),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout((()=>{yn.pause(),s=Date.now(),o()}),e)}}}const Cn=["image/png","image/jpeg","image/gif"];function wn(e){const{text:t,entities:s}=e||{};if(!t)return"";const n=(0,Dt.H)(t,s,void 0,void 0,!0);return Array.isArray(n)?n.join(""):n}let bn,Mn;var Sn=s(4784),En=s(8353),kn=s(2365);const Rn=document.createElement("div"),Tn=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/i,Nn=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+\n{2,}/i;var Bn=s(2400);const xn=(0,Z.P2)((e=>e()),500,!0),An=/^[\w@]{1,32}\s?/i,Ln=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"DeleteMessageModal",!t);return s?o.ZP.createElement(s,e):void 0}));function On(){return(On=Object.assign||function(e){for(var t=1;t{const s=(0,o.sO)(!1),n=(0,o.I4)((()=>{if(s.current=!0,Un)return Un=!1,void e();Fn&&(clearTimeout(Fn),Fn=void 0),Fn=window.setTimeout((()=>{s.current&&e()}),200)}),[e]),a=(0,o.I4)((()=>{s.current=!1}),[]);return o.ZP.createElement(be.Z,On({},t,{onMouseEnter:m.$b?void 0:n,onMouseLeave:m.$b?void 0:a,onClick:m.$b?e:void 0}))})),Qn=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"AttachMenu",!t);return s?o.ZP.createElement(s,e):void 0})),Dn=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"SymbolMenu",!t);return s?o.ZP.createElement(s,e):void 0})),qn=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"InlineBotTooltip",!t);return s?o.ZP.createElement(s,e):void 0})),Gn=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"MentionTooltip",!t);return s?o.ZP.createElement(s,e):void 0})),Hn=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"CustomSendMenu",!t);return s?o.ZP.createElement(s,e):void 0})),jn=e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"StickerTooltip",!t);return s?o.ZP.createElement(s,e):void 0};var _n=s(9830);const Vn=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"BotCommandTooltip",!t);return s?o.ZP.createElement(s,e):void 0}));var Wn=s(6503);const Kn=(0,o.X$)((0,n.c$)(((e,{messageId:t})=>{const{chatId:s}=(0,i.Bt)(e)||{};return s?{message:(0,i.hj)(e,s,t)}:{}}),((e,t)=>(0,g.ei)(t,["clickInlineButton"])))((({isOpen:e,message:t,onClose:s,clickInlineButton:n})=>{const[a,r]=(0,Wn.Z)(e,s),{isKeyboardSingleUse:i}=t||{},[c,d,l]=(0,ye.Z)(!0),u=()=>{l(),s()};if((0,o.d4)((()=>{d()}),[d,t]),t&&t.keyboardButtons)return o.ZP.createElement(De.Z,{isOpen:e||c,autoClose:i,positionX:"right",positionY:"bottom",onClose:u,className:"BotKeyboardMenu",onCloseAnimationEnd:u,onMouseEnter:m.$b?void 0:a,onMouseLeave:m.$b?void 0:r},o.ZP.createElement("div",{className:"content"},t.keyboardButtons.map((e=>o.ZP.createElement("div",{className:"row"},e.map((e=>o.ZP.createElement(be.Z,{ripple:!0,disabled:"NOT_SUPPORTED"===e.type,onClick:()=>n({button:e})},e.text))))))))})));var Xn=s(3616),Yn=s(7891);const zn=(0,o.X$)((0,n.c$)((e=>{const{chatId:t,threadId:s,type:n}=(0,i.Bt)(e)||{};if(!t||!s||!n)return{};const{currentUserId:a,forwardMessages:{fromChatId:o,toChatId:r,messageIds:c}}=e,l=(0,i.Yy)(e,t,s),u="scheduled"===n?(0,i.wU)(e,t):(0,i._$)(e,t,s),h=e.settings.byKey.animationLevel>=1,m=r===t;let g,f;if(l?g=(0,i.hj)(e,t,l):u?g=(0,i.kK)(e,t,s,n):m&&1===c.length&&(g=(0,i.hj)(e,o,c[0])),l&&g){const{forwardInfo:s}=g,n=t===a;s&&(s.isChannelPost||n)&&(f=(0,i.cv)(e,g)),f||(f=(0,i.Ur)(e,g))}else m&&(f=(0,d.YA)(o)?(0,i.dy)(e,o):(0,i.Z1)(e,o));return{replyingToId:l,editingId:u,message:g,sender:f,shouldAnimate:h,forwardedMessagesCount:m?c.length:void 0}}),((e,t)=>(0,g.ei)(t,["setReplyingToId","setEditingId","focusMessage","exitForwardMode"])))((({replyingToId:e,editingId:t,message:s,sender:n,shouldAnimate:a,forwardedMessagesCount:r,setReplyingToId:i,setEditingId:c,focusMessage:d,exitForwardMode:l})=>{const u=Boolean((e||t)&&s||n&&r),h=(0,Yn.Z)([r],r?300:void 0),{shouldRender:m,transitionClassNames:g}=(0,de.Z)(h&&u,void 0,!a,void 0,!a),f=(0,o.I4)((()=>{e?i({messageId:void 0}):t?c({messageId:void 0}):r&&l()}),[e,t,r,i,c,l]);(0,o.d4)((()=>u?(0,fe.Z)(f):void 0),[u,f]);const p=(0,o.I4)((()=>{d({chatId:s.chatId,messageId:s.id})}),[d,s]),I=(0,ie.Z)("ComposerEmbeddedMessage",g),v=r&&r>1?`${r} forwarded messages`:void 0;if(m)return o.ZP.createElement("div",{className:I},o.ZP.createElement("div",null,o.ZP.createElement(be.Z,{round:!0,faded:!0,color:"translucent",ariaLabel:"Cancel replying",onClick:f},o.ZP.createElement("i",{className:"icon-close"})),o.ZP.createElement(ss,{className:"inside-input",message:s,sender:n,customText:v,title:t?"Edit Message":void 0,onClick:p})))}))),Jn=(0,o.X$)((e=>{const{attachments:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"AttachmentModal",!t.length);return s?o.ZP.createElement(s,e):void 0})),ea=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"BotCommandMenu",!t);return s?o.ZP.createElement(s,e):void 0})),ta=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"PollModal",!t);return s?o.ZP.createElement(s,e):void 0})),sa=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"DropArea",!t);return s?o.ZP.createElement(s,e):void 0})),na=new RegExp(a.FM,"i"),aa=(0,o.X$)((0,n.c$)(((e,{chatId:t,threadId:s})=>{const n=(0,i.tV)(e,t,s);return{webPagePreview:e.webPagePreview,noWebPage:n}}),((e,t)=>(0,g.ei)(t,["loadWebPagePreview","clearWebPagePreview","toggleMessageWebPage"])))((({chatId:e,threadId:t,messageText:s,disabled:n,webPagePreview:a,noWebPage:r,loadWebPagePreview:i,clearWebPagePreview:c,toggleMessageWebPage:d})=>{const l=(0,o.Ye)((()=>{const{text:e,entities:t}=(0,dn.Z)(s),n=t&&t.find((({type:e})=>e===u.Vv.TextUrl));if(n)return n.url;const a=e.match(na);return a?a[0]:void 0}),[s]);(0,o.d4)((()=>{l?i({text:l}):(c(),d({chatId:e,threadId:t}))}),[e,d,c,l,i,t]),(0,he.Z)((()=>{c(),d({chatId:e,threadId:t})}),[e]);const h=Boolean(a&&s.length&&!r&&!n),{shouldRender:m,transitionClassNames:g}=(0,de.Z)(h),f=(0,lt.Z)(a);if(!m||!f)return;const{photo:p,...I}=f,v={content:{webPage:I}};return o.ZP.createElement("div",{className:(0,ie.Z)("WebPagePreview",g)},o.ZP.createElement("div",null,o.ZP.createElement(be.Z,{round:!0,faded:!0,color:"translucent",ariaLabel:"Clear Webpage Preview",onClick:()=>{d({chatId:e,threadId:t,noWebPage:!0})}},o.ZP.createElement("i",{className:"icon-close"})),o.ZP.createElement(Fs,{message:v,inPreview:!0})))})));var oa=s(2898);const ra=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"CalendarModal",!t);return s?o.ZP.createElement(s,e):void 0})),ia=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"PaymentModal",!t);return s?o.ZP.createElement(s,e):void 0})),ca=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"ReceiptModal",!t);return s?o.ZP.createElement(s,e):void 0}));var da;!function(e){e.Send="send",e.Record="record",e.Edit="edit"}(da||(da={}));const la=(0,o.X$)((0,n.c$)(((e,{chatId:t,threadId:s,messageListType:n})=>{var o,r;const c=(0,i.Z1)(e,t),l=c&&(0,i.Dg)(e,c),h=t!==a.FV?(0,i.IK)(e,t):void 0,m=Boolean(h),g=(0,i.FM)(e,t),f=m&&(0,i.FT)(e,t),p=(0,i.qy)(e,t),{language:I}=e.settings.byKey,v=e.emojiKeywords[a.pR],y=I!==a.pR?e.emojiKeywords[I]:void 0,Z=f?f.id:void 0,P=Z?(0,i.hj)(e,t,Z):void 0;return{editingMessage:(0,i.kK)(e,t,s,n),connectionState:e.connectionState,draft:(0,i.Ms)(e,t,s),chat:c,isChatWithBot:m,isChatWithSelf:g,canScheduleUntilOnline:!g&&!m&&c&&l&&(0,d.YA)(t)&&l.status&&Boolean(l.status.wasOnline),isRightColumnShown:(0,i.Jf)(e),isSelectModeActive:(0,i.CA)(e),withScheduledButton:s===u._f&&"thread"===n&&Boolean(null==p?void 0:p.length),shouldSchedule:"scheduled"===n,botKeyboardMessageId:Z,botKeyboardPlaceholder:null==P?void 0:P.keyboardPlaceholder,isForwarding:t===e.forwardMessages.toChatId,isPollModalOpen:e.isPollModalOpen,stickersForEmoji:e.stickers.forEmoji.stickers,groupChatMembers:null==c||null===(o=c.fullInfo)||void 0===o?void 0:o.members,topInlineBotIds:null===(r=e.topInlineBots)||void 0===r?void 0:r.userIds,currentUserId:e.currentUserId,usersById:e.users.byId,lastSyncTime:e.lastSyncTime,contentToBeScheduled:e.messages.contentToBeScheduled,isPaymentModalOpen:e.payment.isPaymentModalOpen,isReceiptModalOpen:Boolean(e.payment.receipt),shouldSuggestStickers:e.settings.byKey.shouldSuggestStickers,recentEmojis:e.recentEmojis,baseEmojiKeywords:null==v?void 0:v.keywords,emojiKeywords:null==y?void 0:y.keywords,serverTimeOffset:e.serverTimeOffset,inlineBots:e.inlineBots.byUsername,isInlineBotLoading:e.inlineBots.isLoading,chatBotCommands:c&&c.fullInfo&&c.fullInfo.botCommands,botCommands:h&&h.fullInfo?h.fullInfo.botCommands||!1:void 0}}),((e,t)=>(0,g.ei)(t,["sendMessage","editMessage","saveDraft","clearDraft","showDialog","setStickerSearchQuery","setGifSearchQuery","forwardMessages","openPollModal","closePollModal","closePaymentModal","clearReceipt","loadScheduledHistory","openChat","addRecentEmoji","sendInlineBotResult"])))((({dropAreaState:e,shouldSchedule:t,canScheduleUntilOnline:s,isReady:r,onDropHide:i,editingMessage:c,chatId:l,threadId:h,messageListType:g,draft:f,chat:p,connectionState:I,isChatWithBot:v,isChatWithSelf:y,isRightColumnShown:P,isSelectModeActive:C,isForwarding:w,isPollModalOpen:b,isPaymentModalOpen:M,isReceiptModalOpen:S,botKeyboardMessageId:E,botKeyboardPlaceholder:k,withScheduledButton:R,stickersForEmoji:T,groupChatMembers:N,topInlineBotIds:B,currentUserId:x,usersById:A,lastSyncTime:O,contentToBeScheduled:F,shouldSuggestStickers:U,baseEmojiKeywords:$,emojiKeywords:Q,serverTimeOffset:q,recentEmojis:G,inlineBots:H,isInlineBotLoading:j,botCommands:_,chatBotCommands:V,sendMessage:W,editMessage:K,saveDraft:X,clearDraft:Y,showDialog:z,setStickerSearchQuery:J,setGifSearchQuery:ee,forwardMessages:te,openPollModal:se,closePollModal:ne,loadScheduledHistory:ae,closePaymentModal:oe,openChat:re,clearReceipt:ce,addRecentEmoji:de,sendInlineBotResult:he})=>{const me=(0,Ze.Z)(),ge=(0,o.sO)(null),[pe,Ie]=(0,o.eJ)(""),ve=(0,o.sO)(),Pe=(0,fs.Z)(e),[Ce,we,Me]=(0,ye.Z)(),[Se,Ee]=(0,o.eJ)(),{width:ke}=nt.Z.get(),Re=(0,o.sO)(pe);(0,o.d4)((()=>{Re.current=pe}),[pe]),(0,o.d4)((()=>{ve.current=void 0}),[l]),(0,o.d4)((()=>{l&&O&&h===u._f&&r&&ae()}),[r,l,ae,O,h]),(0,o.bt)((()=>{ge.current&&(ge.current.innerHTML='')}),[]),(0,o.d4)((()=>{F&&(Ee(F),we())}),[F,we]);const[Ne,Be]=(0,o.eJ)([]),[xe,Ae,Le]=(0,ye.Z)(),[Oe,Fe,Ue]=(0,ye.Z)(),[$e,Qe,De]=(0,ye.Z)(),[qe,Ge,He]=(0,ye.Z)(),[je,_e,Ve]=(0,ye.Z)(),[We,Ke]=(0,ye.Z)(),[Xe,Ye,ze]=(0,ye.Z)(),{startRecordingVoice:Je,stopRecordingVoice:tt,pauseRecordingVoice:st,activeVoiceRecording:at,currentRecordTime:ot,recordButtonRef:rt,startRecordTimeRef:it}=(()=>{const e=(0,o.sO)(null),[t,s]=(0,o.eJ)(),n=(0,o.sO)(),[a,r]=(0,o.eJ)();(0,o.d4)((()=>{m.cj&&m.mh&&Zn()}),[]);const i=(0,o.I4)((async()=>{try{const{stop:t,pause:a}=await Pn((t=>{e.current&&(n.current&&Date.now()%4==0&&(e.current.style.boxShadow=`0 0 0 ${50*(t||0)}px rgba(0,0,0,.15)`),r(Date.now()))}));n.current=Date.now(),r(Date.now()),s({stop:t,pause:a})}catch(e){console.error(e)}}),[]),c=(0,o.I4)((()=>{if(t){e.current&&(e.current.style.boxShadow="none");try{return t.pause()}catch(e){return void console.error(e)}}}),[t]),d=(0,o.I4)((()=>{if(t){s(void 0),n.current=void 0,r(void 0),e.current&&(e.current.style.boxShadow="none");try{return t.stop()}catch(e){return void console.error(e)}}}),[t]);return(0,o.d4)((()=>t?(0,fe.Z)(d):void 0),[t,d]),{startRecordingVoice:i,pauseRecordingVoice:c,stopRecordingVoice:d,activeVoiceRecording:t,currentRecordTime:a,recordButtonRef:e,startRecordTimeRef:n}})(),ct=c?da.Edit:!m.mh||at||pe&&!Ne.length||w?da.Send:da.Record,dt=!t,{isMentionTooltipOpen:lt,closeMentionTooltip:ut,insertMention:ht,mentionFilteredUsers:mt}=(0,kn.Z)(!Ne.length,pe,Ie,void 0,N,B,x,A),{isOpen:gt,id:ft,isGallery:pt,switchPm:vt,results:yt,closeTooltip:Zt,help:Pt,loadMore:Ct}=function(e,t,s,a){const[r,i,c]=(0,ye.Z)(),d=function(e){return Rn.innerHTML=e.replace(/
/g,"\n"),Rn.innerText}(s),{queryInlineBot:l,resetInlineBot:u}=(0,n.uC)(),{username:h,query:m,canShowHelp:g}=function(e){const t=e.match(Tn);return t?{username:t[1],query:t[2],canShowHelp:""===t[2]&&!e.match(Nn)}:{username:"",query:"",canShowHelp:!1}}(d),f=h.toLowerCase(),p=(0,fs.Z)(m),I=(0,fs.Z)(h),v=null==a?void 0:a[f],{id:y,switchPm:Z,offset:P,results:C,isGallery:w,help:b}=v||{};(0,o.d4)((()=>{p!==m&&c()}),[p,m,c]),(0,o.d4)((()=>{e&&f&&t&&l({chatId:t,username:f,query:m})}),[m,e,l,t,f]);const M=(0,o.I4)((()=>{l({chatId:t,username:f,query:m,offset:P})}),[P,t,m,l,f]);return(0,o.d4)((()=>{e&&y&&(Z||null!=C&&C.length)?i():c()}),[y,e,i,C,Z,c]),I!==h&&u({username:I}),{isOpen:r,closeTooltip:c,loadMore:M,username:h,id:y,isGallery:w,switchPm:Z,results:C,help:g&&b?`@${h} ${b}`:void 0}}(Boolean(!Ne.length&&O),l,pe,H),{isOpen:wt,close:bt,filteredBotCommands:Mt}=function(e,t,s,n){const[a,r,i]=(0,ye.Z)(),[c,d]=(0,o.eJ)(),l=(0,o.I4)((e=>{s||n?xn((()=>{const t=(s||n||[]).filter((({command:t})=>!e||t.includes(e)));d(t&&t.length?t:void 0)})):d(void 0)}),[s,n]);return(0,o.d4)((()=>{if(e&&t.length)if(t.startsWith("/")){const e=(0,Bn._)(t.substr(1)).match(An);l(e?e[0]:"")}else i();else i()}),[l,t,e,i]),(0,o.d4)((()=>{c&&c.length?r():i()}),[c,r,i]),{isOpen:a,close:i,filteredBotCommands:c}}(Boolean(_&&_.length||V&&V.length),pe,_,V),{isContextMenuOpen:St,handleContextMenu:Et,handleContextMenuClose:kt,handleContextMenuHide:Rt}=(0,Qt.Z)(rt,!(ct===da.Send&&dt)),Tt=(0,o.Ye)((()=>(0,d.H5)(p,v)),[p,v]),Nt=p&&(0,d.Nl)(p),Bt=(0,d.Hd)(p),{isStickerTooltipOpen:xt,closeStickerTooltip:At}=function(e,t,s,a=!1){const{loadStickersForEmoji:r,clearStickersForEmoji:i}=(0,n.uC)(),c=m.op&&1===(0,Sn.Z)(t)||!m.op&&Boolean(t.match(/^]*?>$/g)),d=Boolean(s)&&c;return(0,o.d4)((()=>{a||(e&&c?r({emoji:t}):!d&&c||i())}),[t,c,i,r,e,a]),{isStickerTooltipOpen:d,closeStickerTooltip:i}}(Boolean(U&&Tt.canSendStickers&&!Ne.length),pe,T,!r),{isEmojiTooltipOpen:Lt,closeEmojiTooltip:Ot,filteredEmojis:Ft,insertEmoji:Ut}=(0,En.Z)(Boolean(U&&Tt.canSendStickers&&!Ne.length),pe,G,void 0,Ie,$,Q,!r),$t=(0,o.I4)(((e,t=a.R2)=>{const s=window.getSelection(),n=document.getElementById(t),o=(0,It.Z)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"​");if(s.rangeCount){const e=s.getRangeAt(0);if((0,hn.R)(e,t))return function(e){const t=window.getSelection();if(null!=t&&t.getRangeAt&&t.rangeCount){const s=t.getRangeAt(0);s.deleteContents();const n=s.createContextualFragment(e),a=n.lastChild;s.insertNode(n),a?(s.setStartAfter(a),s.setEndAfter(a)):s.collapse(!1),t.removeAllRanges(),t.addRange(s)}}(o),void n.dispatchEvent(new Event("input",{bubbles:!0}))}Ie(`${Re.current}${o}`),requestAnimationFrame((()=>{(0,cn.Z)(n)}))}),[]),Dt=(0,o.I4)((()=>{const e=window.getSelection();if(e.rangeCount){const t=e.getRangeAt(0);if((0,hn.R)(t,a.R2))return void document.execCommand("delete",!1)}Ie(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,document.body.appendChild(t);let s=t.lastChild;if(s.lastChild)for(;s.lastChild;)s=s.lastChild;const n=s.textContent.length,a=document.createRange(),o=window.getSelection();a.setStart(s,n),a.setEnd(s,n),o.removeAllRanges(),o.addRange(a),document.execCommand("delete",!1);const r=t.innerHTML;return document.body.removeChild(t),r}(Re.current))}),[]),qt=(0,o.I4)(((e=!1)=>{e||Ie(""),Be([]),At(),Me(),Ee(void 0),ut(),Ot(),m.wB?setTimeout((()=>He()),350):He()}),[At,Me,ut,Ot,He]),Gt=(0,o.sO)();Gt.current=tt,(0,o.d4)((()=>()=>{Gt.current(),qt()}),[l,qt,Gt]);const Ht=((e,t,s,n,r,i)=>((0,o.d4)((()=>{s?(t(wn(s.content.text)),requestAnimationFrame((()=>{const e=document.getElementById(a.R2);(0,cn.Z)(e,!0)}))):t("")}),[s,t]),(0,o.I4)((()=>{const{text:t,entities:a}=(0,dn.Z)(e.current);s&&(t||(0,d.u8)(s)?(i({messageId:s.id,text:t,entities:a}),n()):r())}),[i,s,e,r,n])))(Re,Ie,c,qt,_e,K);((e,t,s,n,r,i,c,d,l)=>{const u=(0,o.I4)(((e,t)=>{r.current.length&&!c?d({chatId:e,threadId:t,draft:(0,dn.Z)(r.current)}):l({chatId:e,threadId:t})}),[l,c,r,d]),h=(0,o.Ye)((()=>(0,Z.Ds)((e=>e()),a.r_,!1)),[t]),g=(0,fs.Z)(t),f=(0,fs.Z)(s);(0,o.d4)((()=>(bn=t,Mn=s,()=>{bn=void 0,Mn=void 0,u(t,s)})),[t,s,u]),(0,o.d4)((()=>{t===g&&s===f||e&&(i(wn(e)),m.$b||requestAnimationFrame((()=>{const e=document.getElementById(a.R2);(0,cn.Z)(e,!0)})))}),[t,s,e,i,u,g,f]);const p=(0,fs.Z)(n);(0,o.d4)((()=>{t&&s&&g===t&&f===s&&p!==n&&(n.length?h((()=>{bn===t&&Mn===s&&u(t,s)})):u(t,s))}),[t,n,g,p,f,h,s,u]);const I=(0,o.I4)((()=>{t&&s&&u(t,s)}),[t,s,u]);(0,le.Z)(I),ue(I)})(f,l,h,pe,Re,Ie,c,X,Y),((e,t,s)=>{(0,o.d4)((()=>{async function n(n){if(!n.clipboardData)return;const o=document.activeElement;if(o&&![a.R2,a.nY].includes(o.id))return;const{items:r}=n.clipboardData,i=Array.from(r).find((e=>Cn.includes(e.type))),c=i&&i.getAsFile(),d=n.clipboardData.getData("text").substring(0,4096);if(c||d){if(n.preventDefault(),c&&!s){const e=await un(c.name,c,!0);t((t=>[...t,e]))}d&&e(d,null==o?void 0:o.id)}}return document.addEventListener("paste",n,!1),()=>{document.removeEventListener("paste",n,!1)}}),[e,s,t])})($t,Be,c);const jt=(0,o.I4)((async(e,t)=>{Be(await Promise.all(e.map((e=>un(e.name,e,t)))))}),[]),_t=(0,o.I4)((async(e,t)=>{Be([...Ne,...await Promise.all(e.map((e=>un(e.name,e,t))))])}),[Ne]),Vt=(0,o.I4)((()=>{Be([])}),[]),Wt=(0,o.I4)((async(e=!1,t)=>{if("connectionStateReady"!==I)return;let s=Ne;if(at){const e=await tt();if(e){const{blob:t,duration:n,waveform:a}=e;s=[await un("wonderful-voice-message.ogg",t,!1,{voice:{duration:n,waveform:a}})]}}const{text:n,entities:o}=(0,dn.Z)(Re.current);if(!s.length&&!n&&!w)return;const r=s.length?1024:4096;if((null==n?void 0:n.length)>r){const e=n.length-r;return void z({data:{message:"MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS",textParams:{"{EXTRA_CHARS_COUNT}":e,"{PLURAL_S}":e>1?"s":""},hasErrorKey:!0}})}const i=document.getElementById(a.R2);if(s.length||n){if(Bt&&!Nt){const e=(0,D.b)(q),t=ve.current&&Math.floor(e-ve.current),s=Bt.nextSendDate&&Bt.nextSendDate>e;if(t&&t{qt()}))}),[I,Ne,at,w,Y,l,q,qt,tt,z,Bt,Nt,W,te,me]),Kt=(0,o.I4)((()=>{He(),Fe()}),[He,Fe]),Xt=(0,o.I4)((()=>{Ue(),Ge()}),[Ue,Ge]),Yt=(0,o.I4)(((e,s=!1)=>{e={...e,isPreloadedGlobally:!0},t?(Ee({sticker:e}),we()):(W({sticker:e}),requestAnimationFrame((()=>{qt(s)})))}),[t,we,W,qt]),zt=(0,o.I4)((e=>{t?(Ee({gif:e}),we()):(W({gif:e}),requestAnimationFrame((()=>{qt(!0)})))}),[t,we,W,qt]),Jt=(0,o.I4)((e=>{if("connectionStateReady"!==I)return;he({id:e.id,queryId:e.queryId});const t=document.getElementById(a.R2);m.cj&&t===document.activeElement&&gn(t),Y({chatId:l,localOnly:!0}),requestAnimationFrame((()=>{qt()}))}),[l,Y,I,qt,he]),es=(0,o.I4)((()=>{Y({chatId:l,localOnly:!0}),requestAnimationFrame((()=>{qt()}))}),[l,Y,qt]),ts=(0,o.I4)((e=>{t?(Ee({poll:e}),ne(),we()):(W({poll:e}),ne())}),[ne,we,W,t]),ss=(0,o.I4)((()=>{t?(Ee({isSilent:!0}),we()):Wt(!0)}),[Wt,we,t]),ns=(0,o.I4)(((e,t=!1)=>{const{isSilent:s,...n}=Se||{},a=Math.round(Math.max(e.getTime(),Date.now()+6e4)/1e3)+(t?0:q);Se&&0!==Object.keys(n).length?(W({...Se,scheduledAt:a}),requestAnimationFrame((()=>{qt()}))):Wt(!!s,a),Me()}),[Me,Wt,qt,Se,W,q]),as=(0,o.I4)((()=>{ns(new Date(1e3*a.t4),!0)}),[ns]),os=(0,o.I4)((()=>{Me(),Ee(void 0)}),[Me]),rs=(0,o.I4)((e=>{"stickers"===e?(J({query:""}),ee({query:void 0})):(ee({query:""}),J({query:void 0}))}),[J,ee]),is=(0,o.I4)((()=>{const e=document.getElementById(a.R2);m.wB&&e===document.activeElement?(e.blur(),setTimeout((()=>{Ue(),Ge()}),100)):Ge()}),[Ge,Ue]),cs=(0,o.I4)((()=>{re({id:l,threadId:h,type:"scheduled"})}),[re,l,h]);(0,o.d4)((()=>{P&&m.wB&&He()}),[P,He]),(0,o.d4)((()=>{r&&(C?Ye():setTimeout((()=>{ze()}),200))}),[C,ze,Ye,r]);const ds=(0,o.I4)((()=>{switch(ct){case da.Send:t?(at&&st(),we()):Wt();break;case da.Record:Je();break;case da.Edit:Ht()}}),[ct,t,Je,Ht,at,we,st,Wt]),ls=ct===da.Record&&!Tt.canAttachMedia,us=(0,fs.Z)(c,!0),hs=c||us,ms=new Date;ms.setSeconds(0),ms.setMilliseconds(0);const gs=new Date;gs.setFullYear(gs.getFullYear()+1);let ps="SendMessage";switch(ct){case da.Edit:ps="Save edited message";break;case da.Record:ps=ls?"Conversation.DefaultRestrictedMedia":"AccDescrVoiceMessage"}const Is=(0,ie.Z)("Composer",!C&&"shown",Xe&&"hover-disabled"),vs=(0,ie.Z)("mobile-symbol-menu-button",!r&&"not-ready",We?qe&&"menu-opened":qe&&"is-loading"),ys=ct===da.Edit?Ht:t?we:Wt;return o.ZP.createElement("div",{className:Is},Tt.canAttachMedia&&r&&o.ZP.createElement(oa.Z,{containerId:"#middle-column-portals"},o.ZP.createElement(sa,{isOpen:e!==et.t.None,withQuick:[e,Pe].includes(et.t.QuickFile),onHide:i,onFileSelect:jt})),o.ZP.createElement(Jn,{attachments:Ne,caption:Ne.length?pe:"",groupChatMembers:N,currentUserId:x,usersById:A,recentEmojis:G,isReady:r,onCaptionUpdate:Ie,baseEmojiKeywords:$,emojiKeywords:Q,addRecentEmoji:de,onSend:t?we:Wt,onFileAppend:_t,onClear:Vt}),o.ZP.createElement(ta,{isOpen:Boolean(b),onClear:ne,onSend:ts}),o.ZP.createElement(ia,{isOpen:Boolean(M),onClose:oe}),o.ZP.createElement(ca,{isOpen:Boolean(S),onClose:ce}),hs&&o.ZP.createElement(Ln,{isOpen:je,isSchedule:"scheduled"===g,onClose:Ve,message:hs}),o.ZP.createElement(Gn,{isOpen:lt,onClose:ut,onInsertUserName:ht,filteredUsers:mt,usersById:A}),o.ZP.createElement(qn,{isOpen:gt,botId:ft,allowedAttachmentOptions:Tt,isGallery:pt,inlineBotResults:yt,switchPm:vt,onSelectResult:Jt,loadMore:Ct,onClose:Zt}),o.ZP.createElement(Vn,{isOpen:wt,withUsername:Boolean(V),botCommands:Mt,onClick:es,onClose:bt}),o.ZP.createElement("div",{id:"message-compose"},o.ZP.createElement("div",{className:"svg-appendix",ref:ge}),o.ZP.createElement(zn,null),o.ZP.createElement(aa,{chatId:l,threadId:h,messageText:Ne.length?"":pe,disabled:!Tt.canAttachEmbedLinks}),o.ZP.createElement("div",{className:"message-input-wrapper"},v&&!1!==_&&!at&&!c&&o.ZP.createElement($n,{className:(0,ie.Z)("bot-commands",Oe&&"activated"),round:!0,faded:!0,disabled:void 0===_,color:"translucent",onActivate:Kt,ariaLabel:"Open bot command keyboard"},o.ZP.createElement("i",{className:"icon-bot-commands-filled"})),m.wB?o.ZP.createElement(be.Z,{className:vs,round:!0,faded:!0,color:"translucent",onClick:qe?He:is,ariaLabel:"Choose emoji, sticker or GIF"},o.ZP.createElement("i",{className:"icon-smile"}),o.ZP.createElement("i",{className:"icon-keyboard"}),qe&&!We&&o.ZP.createElement(Te.Z,{color:"gray"})):o.ZP.createElement($n,{className:qe?"activated":"",round:!0,faded:!0,color:"translucent",onActivate:Xt,ariaLabel:"Choose emoji, sticker or GIF"},o.ZP.createElement("i",{className:"icon-smile"})),o.ZP.createElement(Xn.Z,{id:"message-input-text",html:Ne.length?"":pe,placeholder:at&&ke<=600?"":k||me("Message"),forcedPlaceholder:Pt,shouldSetFocus:!Ne.length,shouldSuppressFocus:m.wB&&qe,shouldSuppressTextFormatter:Lt||lt||gt,onUpdate:Ie,onSend:ys,onSuppressedFocus:He}),j&&Boolean(ft)&&o.ZP.createElement(Te.Z,{color:"gray"}),R&&o.ZP.createElement(be.Z,{round:!0,faded:!0,className:"scheduled-button",color:"translucent",onClick:cs,ariaLabel:"Open scheduled messages"},o.ZP.createElement("i",{className:"icon-schedule"})),E&&!at&&!c&&o.ZP.createElement($n,{className:xe?"activated":"",round:!0,faded:!0,color:"translucent",onActivate:Ae,ariaLabel:"Open bot command keyboard"},o.ZP.createElement("i",{className:"icon-bot-command"})),!at&&!c&&o.ZP.createElement($n,{className:$e?"activated":"",round:!0,faded:!0,color:"translucent",onActivate:Qe,ariaLabel:"Add an attachment"},o.ZP.createElement("i",{className:"icon-attach"})),at&&ot&&o.ZP.createElement("span",{className:"recording-state"},(0,L.rM)(ot-it.current)),o.ZP.createElement(jn,{isOpen:xt,onStickerSelect:Yt}),o.ZP.createElement(_n.Z,{isOpen:Lt,emojis:Ft,onClose:Ot,onEmojiSelect:Ut,addRecentEmoji:de}),o.ZP.createElement(Qn,{isOpen:$e,allowedAttachmentOptions:Tt,onFileSelect:jt,onPollCreate:se,onClose:De}),E&&o.ZP.createElement(Kn,{messageId:E,isOpen:xe,onClose:Le}),_&&o.ZP.createElement(ea,{isOpen:Oe,botCommands:_,onClose:Ue}),o.ZP.createElement(Dn,{isOpen:qe,allowedAttachmentOptions:Tt,onLoad:Ke,onClose:He,onEmojiSelect:$t,onStickerSelect:Yt,onGifSelect:zt,onRemoveSymbol:Dt,onSearchOpen:rs,addRecentEmoji:de}))),at&&o.ZP.createElement(be.Z,{round:!0,color:"danger",className:"cancel",onClick:tt,ariaLabel:"Cancel voice recording"},o.ZP.createElement("i",{className:"icon-delete"})),o.ZP.createElement(be.Z,{ref:rt,round:!0,color:"secondary",className:(0,ie.Z)(ct,!r&&"not-ready",at&&"recording"),disabled:ls,ariaLabel:me(ps),onClick:ds,onContextMenu:ct===da.Send&&dt?Et:void 0},o.ZP.createElement("i",{className:"icon-send"}),o.ZP.createElement("i",{className:"icon-microphone-alt"}),o.ZP.createElement("i",{className:"icon-check"})),dt&&o.ZP.createElement(Hn,{isOpen:St,onSilentSend:y?void 0:ss,onScheduleSend:t?void 0:we,onClose:kt,onCloseAnimationEnd:Rt}),o.ZP.createElement(ra,{isOpen:Ce,withTimePicker:!0,selectedAt:ms.getTime(),maxAt:(0,L._F)(gs),isFutureMode:!0,secondButtonLabel:s?"Send When Online":void 0,onClose:os,onSubmit:ns,onSecondButtonClick:s?as:void 0}))}))),ua=(0,o.X$)((e=>{const{isActive:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"MobileSearch",!t,!0);return s?o.ZP.createElement(s,e):void 0})),ha=(0,o.X$)((e=>{const{isActive:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"MessageSelectToolbar",!t);return s?o.ZP.createElement(s,e):void 0})),ma=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"UnpinAllMessagesModal",!t);return s?o.ZP.createElement(s,e):void 0})),ga=m.wB?450+a.fK:void 0;function fa(e){return"file"===e.kind&&e.type&&a.AK.has(e.type)}const pa=(0,o.X$)((0,n.c$)((e=>{const t=(0,i.Pu)(e),{isBlurred:s,background:n,backgroundColor:a,patternColor:o}=e.settings.themes[t]||{},{messageLists:r}=e.messages,c=(0,i.Bt)(e),{isLeftColumnShown:l,chats:{listIds:h}}=e,g={theme:t,customBackground:n,backgroundColor:a,patternColor:o,isLeftColumnShown:l,isRightColumnShown:(0,i.Jf)(e),isBackgroundBlurred:s,isMobileSearchActive:Boolean(m.wB&&(0,i.n5)(e)),isSelectModeActive:(0,i.CA)(e),animationLevel:e.settings.byKey.animationLevel,currentTransitionKey:Math.max(0,e.messages.messageLists.length-1)};if(!c||!h.active)return g;const{chatId:f,threadId:p,type:I}=c,v=(0,i.Z1)(e,f),y=(0,i.KB)(e,f),{chatId:Z,messageId:P}=e.audioPlayer,C=v&&(0,d.Qm)(v,p),w=(0,i.pk)(e,f),b="pinned"===I,M="scheduled"===I;return{...g,chatId:f,threadId:p,messageListType:I,isPrivate:(0,d.YA)(f),canPost:!b&&(!v||C)&&!w,isPinnedMessageList:b,isScheduledMessageList:M,currentUserBannedRights:null==v?void 0:v.currentUserBannedRights,defaultBannedRights:null==v?void 0:v.defaultBannedRights,hasPinnedOrAudioMessage:p!==u._f||Boolean(null==y?void 0:y.length)||Boolean(Z&&P),pinnedMessagesCount:y?y.length:0,shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations,messageLists:r}}),((e,t)=>(0,g.ei)(t,["openChat","unpinAllMessages","loadUser","closeLocalTextSearch","exitMessageSelectMode"])))((({chatId:e,threadId:t,messageListType:s,isPrivate:n,isPinnedMessageList:r,messageLists:i,canPost:c,currentUserBannedRights:l,defaultBannedRights:u,hasPinnedOrAudioMessage:h,pinnedMessagesCount:g,customBackground:f,theme:p,backgroundColor:I,patternColor:v,isLeftColumnShown:y,isRightColumnShown:Z,isBackgroundBlurred:P,isMobileSearchActive:C,isSelectModeActive:w,animationLevel:b,shouldSkipHistoryAnimations:M,currentTransitionKey:S,openChat:E,unpinAllMessages:k,loadUser:R,closeLocalTextSearch:T,exitMessageSelectMode:N})=>{const{width:B}=at(),x=(0,Ze.Z)(),[A,L]=(0,o.eJ)(et.t.None),[O,F]=(0,o.eJ)(),[U,$]=(0,o.eJ)(),[Q,D]=(0,o.eJ)(!1),[q,G]=(0,o.eJ)(!m.wB||b===a.oB),H=h&&(Ba._m&&B=a.ks&&Be?(0,fe.Z)((()=>{E({id:void 0})})):void 0),[e,E]),(0,o.d4)((()=>{L(et.t.None),F(void 0),$(void 0)}),[e]),(0,o.d4)((()=>{b===a.oB&&G(!0)}),[b]),(0,o.d4)((()=>{n&&R({userId:e})}),[e,n,R]);const Y=(0,o.I4)((e=>{if(m.$b)return;const{items:t}=e.dataTransfer||{},s=t&&Array.from(t).filter((e=>"text/uri-list"!==e.type)).every(fa);L(s?et.t.QuickFile:et.t.Document)}),[]),z=(0,o.I4)((()=>{L(et.t.None)}),[]),J=(0,o.I4)((()=>{D(!0)}),[]),ee=(0,o.I4)((()=>{D(!1)}),[]),te=(0,o.I4)((()=>{k({chatId:e}),ee(),E({id:e})}),[k,E,ee,e]),se=(0,o.I4)((()=>{E({id:e})}),[E,e]),ne=((e,t)=>{const[s,n]=(0,o.eJ)(t);return(0,o.d4)((()=>{t&&(t.startsWith("#")?n(t):tt.fetch(a.fo,e,tt.Type.Blob).then((e=>{const t=URL.createObjectURL(e);(0,st.pt)(t).then((()=>{n(`url(${t})`)}))})))}),[t,e]),t?s:void 0})(p,f),ae=(0,ie.Z)(K&&"has-header-tools",f&&"custom-bg-image",I&&"custom-bg-color",f&&P&&"blurred",m.aZ?"mask-image-disabled":"mask-image-enabled"),oe=(0,ie.Z)("messaging-disabled",!w&&"shown"),re=(0,d.q8)(x,l,u),{composerHiddenScale:ce,toolbarHiddenScale:de,composerTranslateX:le,toolbarTranslateX:ue,unpinHiddenScale:he,toolbarForUnpinHiddenScale:me}=(0,o.Ye)((()=>function(e,t){const s=e<=a.l3?16:32,n=function(e){if(e>a._m){const t=Math.min(Math.max(.25*e,288),424),s=Math.min(.25*e,424);return Math.min(e-t-s,rt)}if(e>a.ks){const t=Math.min(Math.max(.4*e,288),424);return Math.min(e-t,rt)}return e>rt?rt:e}(e),o=e<=a.l3?54:64,r=t?n-s-o:n-s,i=e>a.l3?Math.min(n-s,512):n-s,c=i/r,d=r/i;return{composerHiddenScale:c,toolbarHiddenScale:d,composerTranslateX:t?o/2*d:0,toolbarTranslateX:t?o/2*-1*c:0,unpinHiddenScale:i/258,toolbarForUnpinHiddenScale:258/i}}(B,W)),[W,B]),pe=(0,ie.Z)("middle-column-footer",!W&&"no-composer",W&&U&&!w&&"with-notch");(0,ge.ZP)(j&&_,(()=>{E({id:void 0},!0)}),void 0,void 0,void 0,i?i.map(it):[]),(0,ge.ZP)(C,T),(0,ge.ZP)(w,N);const ve=Boolean(!r&&!W&&re);return o.ZP.createElement("div",{id:"MiddleColumn",className:ae,onTransitionEnd:t=>{"transform"===t.propertyName&&t.target===t.currentTarget&&G(Boolean(e))},style:`\n --composer-hidden-scale: ${ce};\n --toolbar-hidden-scale: ${de};\n --unpin-hidden-scale: ${he};\n --toolbar-unpin-hidden-scale: ${me};\n --composer-translate-x: ${le}px;\n --toolbar-translate-x: ${ue}px;\n --pattern-color: ${v};\n --theme-background-color:\n ${I||("dark"===p?a.It:a.p3)};\n `,onClick:m.p7&&y?se:void 0},o.ZP.createElement("div",{id:"middle-column-bg",style:ne?`--custom-background: ${ne}`:void 0}),o.ZP.createElement("div",{id:"middle-column-portals"}),j&&_&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("div",{className:"messages-layout",onDragEnter:W?Y:void 0},o.ZP.createElement(Rt,{chatId:j,threadId:_,messageListType:V,isReady:q}),o.ZP.createElement(Ie.Z,{name:M?"none":b===a.zy?"slide":"fade",activeKey:S,shouldCleanup:!0},(e=>o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(on,{key:`${j}-${_}-${V}`,chatId:j,threadId:_,type:V,canPost:W,hasTools:K,onFabToggle:F,onNotchToggle:$,isReady:q,isActive:e}),o.ZP.createElement("div",{className:pe},W&&o.ZP.createElement(la,{chatId:j,threadId:_,messageListType:V,dropAreaState:A,onDropHide:z,isReady:q}),r&&o.ZP.createElement("div",{className:"unpin-button-container",dir:x.isRtl?"rtl":void 0},o.ZP.createElement(be.Z,{size:"tiny",fluid:!0,color:"secondary",className:"unpin-all-button",onClick:J},o.ZP.createElement("i",{className:"icon-unpin"}),o.ZP.createElement("span",null,x("Chat.Pinned.UnpinAll",g,"i")))),ve&&o.ZP.createElement("div",{className:oe},o.ZP.createElement("div",{className:"messaging-disabled-inner"},o.ZP.createElement("span",null,re))),o.ZP.createElement(ha,{messageListType:V,isActive:w,canPost:W}))))),o.ZP.createElement(rn,{isShown:X,canPost:W,withExtraShift:ve||w||r})),m.wB&&o.ZP.createElement(ua,{isActive:Boolean(C)})),e&&o.ZP.createElement(ma,{isOpen:Q,chatId:e,pinnedMessagesCount:g,onClose:ee,onUnpin:te}))}))),Ia=(0,Z.Ds)((e=>e()),200,!1);var va;!function(e){e[e.Profile=0]="Profile",e[e.MemberList=1]="MemberList",e[e.SharedMedia=2]="SharedMedia",e[e.Search=3]="Search",e[e.Management=4]="Management",e[e.ManageInitial=5]="ManageInitial",e[e.ManageChannelSubscribers=6]="ManageChannelSubscribers",e[e.ManageChatAdministrators=7]="ManageChatAdministrators",e[e.ManageChatPrivacyType=8]="ManageChatPrivacyType",e[e.ManageDiscussion=9]="ManageDiscussion",e[e.ManageGroupPermissions=10]="ManageGroupPermissions",e[e.ManageGroupRemovedUsers=11]="ManageGroupRemovedUsers",e[e.ManageGroupUserPermissionsCreate=12]="ManageGroupUserPermissionsCreate",e[e.ManageGroupUserPermissions=13]="ManageGroupUserPermissions",e[e.ManageGroupRecentActions=14]="ManageGroupRecentActions",e[e.ManageGroupAdminRights=15]="ManageGroupAdminRights",e[e.ManageGroupMembers=16]="ManageGroupMembers",e[e.StickerSearch=17]="StickerSearch",e[e.GifSearch=18]="GifSearch",e[e.PollResults=19]="PollResults",e[e.AddingMembers=20]="AddingMembers"}(va||(va={}));const ya=(0,o.X$)((0,n.c$)(((e,{chatId:t,isProfile:s,isManagement:n})=>{const{query:a}=(0,i.n5)(e)||{},{query:o}=(0,i.y5)(e)||{},{query:r}=(0,i.yN)(e)||{},c=t?(0,i.Z1)(e,t):void 0,l=c&&(0,d.eA)(c);return{canManage:Boolean(!n&&s&&c&&!(0,i.FM)(e,c.id)&&((0,d.YA)(c.id)||((0,d.Nl)(c)||c.isCreator)&&!c.isNotJoined)),isChannel:l,messageSearchQuery:a,stickerSearchQuery:o,gifSearchQuery:r}}),((e,t)=>(0,g.ei)(t,["setLocalTextSearchQuery","setStickerSearchQuery","setGifSearchQuery","searchTextMessagesLocal","toggleManagement","openHistoryCalendar"])))((({isColumnOpen:e,isProfile:t,isSearch:s,isManagement:n,isStickerSearch:a,isGifSearch:r,isPollResults:i,isAddingChatMembers:c,profileState:d,managementScreen:l,canManage:u,isChannel:g,onClose:f,messageSearchQuery:p,stickerSearchQuery:I,gifSearchQuery:v,setLocalTextSearchQuery:y,setStickerSearchQuery:Z,setGifSearchQuery:P,searchTextMessagesLocal:C,toggleManagement:w,openHistoryCalendar:b,shouldSkipAnimation:M})=>{var S;const E=(0,o.sO)(null),k=(0,o.I4)((e=>{y({query:e}),e.length&&Ia(C)}),[C,y]),R=(0,o.I4)((e=>{Z({query:e})}),[Z]),T=(0,o.I4)((e=>{P({query:e})}),[P]),[N,B]=(0,o.eJ)(!e);(0,o.d4)((()=>{setTimeout((()=>{B(!e)}),300)}),[e]);const x=(0,Ze.Z)(),A=t?d===h.vi.Profile?va.Profile:d===h.vi.SharedMedia?va.SharedMedia:d===h.vi.MemberList?va.MemberList:-1:s?va.Search:i?va.PollResults:a?va.StickerSearch:r?va.GifSearch:c?va.AddingMembers:n?l===h.u1.Initial?va.ManageInitial:l===h.u1.ChatPrivacyType?va.ManageChatPrivacyType:l===h.u1.Discussion?va.ManageDiscussion:l===h.u1.ChannelSubscribers?va.ManageChannelSubscribers:l===h.u1.GroupPermissions?va.ManageGroupPermissions:l===h.u1.ChatAdministrators?va.ManageChatAdministrators:l===h.u1.GroupRemovedUsers?va.ManageGroupRemovedUsers:l===h.u1.GroupUserPermissionsCreate?va.ManageGroupUserPermissionsCreate:l===h.u1.GroupUserPermissions?va.ManageGroupUserPermissions:l===h.u1.GroupRecentActions?va.ManageGroupRecentActions:l===h.u1.ChatAdminRights?va.ManageGroupAdminRights:l===h.u1.GroupMembers?va.ManageGroupMembers:void 0:void 0,O=null!==(S=(0,lt.Z)(A,!0))&&void 0!==S?S:-1;function F(){if(-1!==O)switch(O){case va.PollResults:return o.ZP.createElement("h3",null,x("PollResults"));case va.Search:return o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(Me.Z,{parentContainerClassName:"RightSearch",value:p,onChange:k}),o.ZP.createElement(be.Z,{round:!0,size:"smaller",color:"translucent",onClick:()=>b({selectedAt:(0,L._F)(Date.now())}),ariaLabel:"Search messages by date"},o.ZP.createElement("i",{className:"icon-calendar"})));case va.AddingMembers:return o.ZP.createElement("h3",null,x("GroupAddMembers"));case va.ManageInitial:return o.ZP.createElement("h3",null,x("Edit"));case va.ManageChatPrivacyType:return o.ZP.createElement("h3",null,x(g?"ChannelTypeHeader":"GroupTypeHeader"));case va.ManageDiscussion:return o.ZP.createElement("h3",null,x("Discussion"));case va.ManageChatAdministrators:return o.ZP.createElement("h3",null,x("ChannelAdministrators"));case va.ManageGroupRecentActions:return o.ZP.createElement("h3",null,x("Group.Info.AdminLog"));case va.ManageGroupAdminRights:return o.ZP.createElement("h3",null,x("EditAdminRights"));case va.ManageGroupPermissions:return o.ZP.createElement("h3",null,x("ChannelPermissions"));case va.ManageGroupRemovedUsers:return o.ZP.createElement("h3",null,x("ChannelBlockedUsers"));case va.ManageGroupUserPermissionsCreate:return o.ZP.createElement("h3",null,x("ChannelAddException"));case va.ManageGroupUserPermissions:return o.ZP.createElement("h3",null,x("UserRestrictions"));case va.StickerSearch:return o.ZP.createElement(Me.Z,{value:I,placeholder:x("SearchStickersHint"),onChange:R});case va.GifSearch:return o.ZP.createElement(Me.Z,{value:v,placeholder:x("SearchGifsTitle"),onChange:T});case va.SharedMedia:return o.ZP.createElement("h3",null,x("SharedMedia"));case va.ManageChannelSubscribers:return o.ZP.createElement("h3",null,x("ChannelSubscribers"));case va.MemberList:case va.ManageGroupMembers:return o.ZP.createElement("h3",null,x("GroupMembers"));default:return o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("h3",null,"Profile"),o.ZP.createElement("section",{className:"tools"},u&&o.ZP.createElement(be.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:x("Edit"),onClick:w},o.ZP.createElement("i",{className:"icon-edit"}))))}}const U=m.wB||A===va.SharedMedia||A===va.MemberList||A===va.AddingMembers||n,$=(0,ie.Z)("animated-close-icon",U&&"state-back",(N||M)&&"no-transition");return o.ZP.createElement("div",{className:"RightHeader"},o.ZP.createElement(be.Z,{className:"close-button",round:!0,color:"translucent",size:"smaller",onClick:f,ariaLabel:x(U?"Common.Back":"Common.Close")},o.ZP.createElement("div",{ref:E,className:$})),o.ZP.createElement(Ie.Z,{name:N||M?"none":"slide-fade",activeKey:O},F))})));var Za=s(7407);function Pa(e,t,s,n,r,i){const c=(0,o.sO)();(0,he.Z)((()=>{t===e&&r&&i&&(c.current=(0,d.R5)(r,i,e).reverse())}),[r,i,t,e]);const[l,u]=(0,Za.Z)(n?s:void 0,c.current,void 0,"media"===e?a.EN:a.pn);return[l,u,!(!l||!c.current||l[0]===c.current[0])]}const Ca=(0,Z.P2)((e=>e()),250,!1);let wa=!1;var ba=s(1273),Ma=s(1876),Sa=s(787),Ea=s(180),ka=s(3709),Ra=s(5418),Ta=s(7262),Na=s(1151),Ba=s(3103);const xa=(0,o.X$)((0,n.c$)(((e,{userId:t})=>{const s=(0,i.jr)(e),n=t&&(0,i.dy)(e,t);return{chat:s,contactName:n?(0,d.Vl)(n):void 0}}),((e,t)=>(0,g.ei)(t,["deleteChatMember"])))((({isOpen:e,chat:t,userId:s,contactName:n,onClose:a,deleteChatMember:r})=>{const i=(0,Ze.Z)(),c=(0,o.I4)((()=>{r({chatId:t.id,userId:s}),a()}),[t,r,a,s]);if(t&&s)return o.ZP.createElement(Ba.Z,{isOpen:e,onClose:a,onEnter:c,className:"delete",title:i("GroupRemoved.Remove")},o.ZP.createElement("p",null,(0,It.Z)(i("PeerInfo.Confirm.RemovePeer",n))),o.ZP.createElement(be.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:c},i("lng_box_remove")),o.ZP.createElement(be.Z,{className:"confirm-dialog-button",isText:!0,onClick:a},i("Cancel")))}))),Aa=[{type:"media",title:"SharedMediaTab2"},{type:"documents",title:"SharedFilesTab2"},{type:"links",title:"SharedLinksTab2"},{type:"audio",title:"SharedMusicTab2"}];function La(e){return[`.shared-media-transition > div:only-child > .${e}-list > .scroll-item`,`.shared-media-transition > div.active > .${e}-list > .scroll-item`].join(", ")}const Oa=(0,o.X$)((0,n.c$)(((e,{chatId:t,userId:s})=>{var n;const a=(0,i.Z1)(e,t),o=(0,i.Zw)(e,s||t),{currentType:r,resultsByType:c}=(0,i.we)(e)||{},{foundIds:l}=c&&r&&c[r]||{},{byId:u}=e.users,h=a&&(0,d.Bf)(a),m=a&&(0,d.eA)(a),g=h||m&&(0,d.Nl)(a),f=null==a||null===(n=a.fullInfo)||void 0===n?void 0:n.members,p=g&&a&&a.fullInfo&&!a.fullInfo.canViewMembers,I=g&&a&&((0,d.VE)(a,"inviteUsers")||a.isCreator),v=g&&a&&((0,d.VE)(a,"banUsers")||a.isCreator);let y;return s?y=s:(0,d.YA)(t)&&(y=t),{theme:(0,i.Pu)(e),isChannel:m,resolvedUserId:y,chatMessages:o,foundIds:l,mediaSearchType:r,hasMembersTab:g,areMembersHidden:p,canAddMembers:I,canDeleteMembers:v,currentUserId:e.currentUserId,isRightColumnShown:(0,i.Jf)(e),isRestricted:null==a?void 0:a.isRestricted,lastSyncTime:e.lastSyncTime,serverTimeOffset:e.serverTimeOffset,...g&&f&&{members:f,usersById:u}}}),((e,t)=>(0,g.ei)(t,["setLocalMediaSearchType","loadMoreMembers","searchMediaMessagesLocal","openMediaViewer","openAudioPlayer","openUserInfo","focusMessage","loadProfilePhotos","setNewChatMembersDialogState"])))((({chatId:e,profileState:t,onProfileStateChange:s,theme:n,isChannel:r,resolvedUserId:i,currentUserId:c,chatMessages:l,foundIds:g,mediaSearchType:f,hasMembersTab:p,areMembersHidden:I,canAddMembers:v,canDeleteMembers:y,members:Z,usersById:P,isRightColumnShown:C,isRestricted:w,lastSyncTime:b,setLocalMediaSearchType:M,loadMoreMembers:S,searchMediaMessagesLocal:E,openMediaViewer:k,openAudioPlayer:R,openUserInfo:T,focusMessage:N,loadProfilePhotos:B,setNewChatMembersDialogState:x,serverTimeOffset:A})=>{const L=(0,o.sO)(null),O=(0,o.sO)(null),F=(0,Ze.Z)(),[U,$]=(0,o.eJ)(0),[Q,D]=(0,o.eJ)(),q=(0,o.Ye)((()=>[...p?[{type:"members",title:r?"ChannelSubscribers":"GroupMembers"}]:[],...Aa]),[p,r]),G=q[U].type,[H,j,_,V]=function(e,t,s,n,r,i,c,l,u,h,m,g=0){const f="members"!==n&&r?r:n,p=(0,o.Ye)((()=>{if(i&&c)return(0,d.Z0)(i.map((({userId:e})=>e)),c,void 0,g)}),[i,g,c]),[I,v,y]=function(e,t,s,n){const[o,r]=(0,Za.Z)(s?t:void 0,n,void 0,a.Vk);return[o,r,!(!o||!n||o[0]===n[0])]}(0,t,m,p),[Z,P,C]=Pa("media",f,s,m,l,u),[w,b,M]=Pa("documents",f,s,m,l,u),[S,E,k]=Pa("links",f,s,m,l,u),[R,T,N]=Pa("audio",f,s,m,l,u);let B,x,A=!1;switch(f){case"members":B=I,x=v,A=y;break;case"media":B=Z,x=P,A=C;break;case"documents":B=w,x=b,A=M;break;case"links":B=S,x=E,A=k;break;case"audio":B=R,x=T,A=N}return[f,B,x,A]}(0,S,E,G,f,Z,P,l,g,0,b,A),W=q.findIndex((({type:e})=>e===H)),{handleScroll:K}=function(e,t,s,n){(0,Nt.Z)((([s])=>{if(s&&s!==t){const s=e.current,a=s.querySelector(".TabList");s.scrollTop{wa=!1}),350))}}),[t,n]),(0,Nt.Z)((([t])=>{if(s!==h.vi.Profile||s===t)return;const a=e.current;a&&a.querySelector(".TabList")&&(wa=!0,(0,Ot.Z)(a,a.firstElementChild,"start",void 0,2*a.offsetHeight),setTimeout((()=>{wa=!1}),350),n(s))}),[s]);const a=(0,o.I4)((()=>{const s=e.current;if(!s)return;const a=s.querySelector(".TabList");if(!a)return;let o=h.vi.Profile;s.scrollTop>=a.offsetTop&&(o="members"===t?h.vi.MemberList:h.vi.SharedMedia),n(o)}),[e,n,t]);return(0,o.d4)((()=>{wa||a()}),[a,t]),{handleScroll:(0,o.I4)((()=>{wa||Ca(a)}),[a])}}(L,G,t,s),{applyTransitionFix:X,releaseTransitionFix:Y}=function(e,t=".Transition.shared-media-transition"){return(0,o.d4)((()=>{function s(){const s=e.current,n=s.querySelector(t),a=s.querySelector(".TabList");n&&a&&(n.style.minHeight=s.offsetHeight-a.offsetHeight+"px")}return s(),window.addEventListener("resize",s,!1),()=>{window.removeEventListener("resize",s,!1)}}),[e,t]),{applyTransitionFix:(0,o.I4)((()=>{const t=e.current;if("hidden"!==t.style.overflowY){const e=t.offsetWidth-t.clientWidth;t.style.overflowY="hidden",t.style.marginRight=`${e}px`}}),[e]),releaseTransitionFix:(0,o.I4)((()=>{const t=e.current;t.style.overflowY="scroll",t.style.marginRight="0"}),[e])}}(L),[z,J]=(()=>{const[e,t]=(0,o.eJ)(!1);return[e,(0,o.I4)((()=>{t((e=>!e))}),[])]})(),ee=(0,o.I4)((()=>{Y(),J()}),[Y,J]),te=(0,o.I4)((()=>{x(h.WB.InProgress)}),[x]);(0,o.d4)((()=>{M({mediaType:G})}),[M,G]);const se=i||e;(0,o.d4)((()=>{b&&B({profileId:se})}),[B,se,b]);const ne=(0,o.I4)((e=>{k({chatId:se,threadId:u._f,messageId:e,origin:h.bZ.SharedMedia})}),[se,k]),ae=(0,o.I4)((e=>{R({chatId:se,messageId:e})}),[se,R]),oe=(0,o.I4)((e=>{T({id:e})}),[T]),re=(0,o.I4)((e=>{N({chatId:se,messageId:e})}),[se,N]),ie=(0,o.I4)((()=>{D(void 0)}),[]);let ce;(0,o.d4)((()=>{if(O.current&&m.$b)return(0,Be.s)(O.current,{selectorToPreventScroll:".Profile",onSwipe:(e,t)=>t===Be.e.Left?($(Math.min(U+1,q.length-1)),!0):t===Be.e.Right&&($(Math.max(0,U-1)),!0)})}),[U,q.length]);const de="members"===H||!p&&"media"===H;de?ce=C?0:1e3:j||(ce=a.Y);const le=(0,Yn.Z)([e,H],ce);function ue(e){return e!==c&&y?[{title:F("lng_context_remove_from_group"),icon:"stop",handler:()=>{D(e)}}]:void 0}function he(){if(!j||!le||!l){const e=de&&j&&!le;return o.ZP.createElement("div",{className:"content empty-list"},!e&&o.ZP.createElement(Te.Z,null))}if(!j.length){let e;switch(H){case"members":e=I?"You have no access to group members list.":"No members found";break;case"documents":e=F("lng_media_file_empty_search");break;case"links":e=F("lng_media_link_empty_search");break;case"audio":e=F("lng_media_song_empty_search");break;default:e=F("SharedMedia.EmptyTitle")}return o.ZP.createElement("div",{className:"content empty-list"},o.ZP.createElement(Ta.Z,{text:e}))}return o.ZP.createElement("div",{className:`content ${H}-list`,dir:F.isRtl&&"media"===H?"rtl":void 0,teactFastList:!0},"media"===H?j.map((e=>l[e]&&o.ZP.createElement(ka.Z,{key:e,message:l[e],onClick:ne}))):"documents"===H?j.map((e=>l[e]&&o.ZP.createElement(ns.Z,{key:e,message:l[e],withDate:!0,smaller:!0,className:"scroll-item",onDateClick:re}))):"links"===H?j.map((e=>l[e]&&o.ZP.createElement(Ra.Z,{key:e,message:l[e],onMessageClick:re}))):"audio"===H?j.map((e=>l[e]&&o.ZP.createElement(as.Z,{key:e,theme:n,message:l[e],target:"sharedMedia",date:l[e].date,lastSyncTime:b,className:"scroll-item",onPlay:ae,onDateClick:re}))):"members"===H?j.map(((e,t)=>o.ZP.createElement(Ma.Z,{key:e,teactOrderKey:t,className:"chat-item-clickable scroll-item small-icon",onClick:()=>oe(e),contextActions:ue(e)},o.ZP.createElement(ht.Z,{userId:e,forceShowSelf:!0})))):void 0)}return o.ZP.createElement(ba.Z,{ref:L,className:"Profile custom-scroll",itemSelector:La(H),items:le?j:void 0,cacheBuster:z,sensitiveArea:a.qU,preloadBackwards:le?"members"===H?a.Vk:a.EN:0,noScrollRestoreOnTop:!0,noFastList:!0,onLoadMore:_,onScroll:K},!V&&function(e,t){return o.ZP.createElement("div",{className:"profile-info"},o.ZP.createElement(Sa.Z,{userId:t||e}),o.ZP.createElement(Ea.Z,{chatOrUserId:t||e}))}(e,i),!w&&o.ZP.createElement("div",{className:"shared-media"},o.ZP.createElement(Ie.Z,{ref:O,name:F.isRtl?"slide-reversed":"slide",activeKey:W,renderCount:q.length,shouldRestoreHeight:!0,className:"shared-media-transition",onStart:X,onStop:ee},he),o.ZP.createElement(xe.Z,{big:!0,activeTab:U,tabs:q,onSwitchTab:$})),v&&o.ZP.createElement(Na.Z,{isShown:"members"===H,onClick:te,ariaLabel:F("lng_channel_add_users")},o.ZP.createElement("i",{className:"icon-add-user-filled"})),y&&o.ZP.createElement(xa,{isOpen:Boolean(Q),userId:Q,onClose:ie}))}))),Fa=(0,o.X$)((e=>{const t=(0,Fe.Z)(Oe.gl.Extra,"RightSearch");return t?o.ZP.createElement(t,e):o.ZP.createElement(Ue.Z,null)})),Ua=(0,o.X$)((e=>{const t=(0,Fe.Z)(Oe.gl.Extra,"Management");return t?o.ZP.createElement(t,e):o.ZP.createElement(Ue.Z,null)})),$a=(0,o.X$)((()=>{const e=(0,Fe.Z)(Oe.gl.Extra,"StickerSearch");return e?o.ZP.createElement(e,null):o.ZP.createElement(Ue.Z,null)})),Qa=(0,o.X$)((()=>{const e=(0,Fe.Z)(Oe.gl.Extra,"GifSearch");return e?o.ZP.createElement(e,null):o.ZP.createElement(Ue.Z,null)})),Da=(0,o.X$)((()=>{const e=(0,Fe.Z)(Oe.gl.Extra,"PollResults");return e?o.ZP.createElement(e,null):o.ZP.createElement(Ue.Z,null)}));var qa=s(1820);const Ga=(0,o.X$)((0,n.c$)(((e,{chatId:t})=>{var s;const n=(0,i.Z1)(e,t),{userIds:a}=e.contactList||{},{byId:o}=e.users,{byId:r}=e.chats,{currentUserId:c,newChatMembersProgress:l,connectionState:u}=e,m=n&&(0,d.eA)(n),{query:g,fetchingStatus:f,globalUserIds:p,localUserIds:I}=e.userSearch;return{isChannel:m,members:null==n||null===(s=n.fullInfo)||void 0===s?void 0:s.members,currentUserId:c,usersById:o,chatsById:r,localContactIds:a,searchQuery:g,isSearching:f,isLoading:l===h.WB.Loading,globalUserIds:p,localUserIds:I,connectionState:u}}),((e,t)=>(0,g.ei)(t,["loadContactList","setUserSearchQuery"])))((({isChannel:e,connectionState:t,members:s,onNextStep:n,currentUserId:a,usersById:r,chatsById:i,localContactIds:c,isLoading:l,searchQuery:u,isSearching:h,localUserIds:m,globalUserIds:f,setUserSearchQuery:p,onClose:I,isActive:v,loadContactList:y})=>{const Z=(0,Ze.Z)(),[P,C]=(0,o.eJ)([]),w=(0,fs.Z)(P)===P;(0,o.d4)((()=>{v&&"connectionStateReady"===t&&y()}),[t,v,y]),(0,ge.ZP)(v,I);const b=(0,o.Ye)((()=>s?s.map((e=>e.userId)):[]),[s]),M=(0,o.I4)((e=>{p({query:e})}),[p]),S=(0,o.Ye)((()=>{const t=c?(0,d.ih)(c.filter((e=>e!==a)),i):[];if(!u)return t.filter((e=>!b.includes(e)));const s=t.filter((e=>{const t=r[e];if(!t)return!1;const s=(0,d.Js)(t);return s&&(0,B.Z)(s,u)}));return(0,d.ih)((0,g.Tw)([...s,...m||[],...f||[]]).filter((t=>{const s=r[t];return!b.includes(t)&&(!s||!(0,d.cS)(s)||!e&&s.canBeInvitedToGroup)})),i)}),[c,i,u,m,f,a,r,b,e]),E=(0,o.I4)((()=>{P.length&&(p({query:""}),n(P))}),[P,p,n]);return o.ZP.createElement("div",{className:"AddChatMembers"},o.ZP.createElement("div",{className:"AddChatMembers-inner"},o.ZP.createElement(qa.Z,{itemIds:S,selectedIds:P,filterValue:u,filterPlaceholder:Z("lng_channel_add_users"),searchInputId:"new-members-picker-search",isLoading:h,onSelectedIdsChange:C,onFilterChange:M,noScrollRestore:w}),o.ZP.createElement(Na.Z,{isShown:Boolean(P.length),disabled:l,ariaLabel:Z("lng_channel_add_users"),onClick:E},l?o.ZP.createElement(Te.Z,{color:"white"}):o.ZP.createElement("i",{className:"icon-arrow-right"}))))}))),Ha=Object.keys(h.qt).length/2,ja=Object.keys(h.u1).length/2;function _a(){const e=document.querySelector(".RightHeader .SearchInput input");e&&e.blur()}const Va=(0,o.X$)((0,n.c$)((e=>{const{chatId:t,threadId:s}=(0,i.Bt)(e)||{},n=(0,i.g4)(e);return{contentKey:(0,i.Wq)(e),chatId:t,threadId:s,currentProfileUserId:e.users.selectedId,isChatSelected:Boolean(t&&n),shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations}}),((e,t)=>(0,g.ei)(t,["openUserInfo","toggleChatInfo","toggleManagement","closeLocalTextSearch","setStickerSearchQuery","setGifSearchQuery","closePollResults","addChatMembers","setNewChatMembersDialogState"])))((({contentKey:e,chatId:t,threadId:s,currentProfileUserId:n,isChatSelected:r,toggleChatInfo:i,toggleManagement:c,openUserInfo:d,closeLocalTextSearch:l,setStickerSearchQuery:u,setGifSearchQuery:m,closePollResults:g,addChatMembers:f,setNewChatMembersDialogState:p,shouldSkipHistoryAnimations:I})=>{var v;const{width:y}=at(),[Z,P]=(0,o.eJ)(h.vi.Profile),[C,w]=(0,o.eJ)(h.u1.Initial),[b,M]=(0,o.eJ)(),[S,E]=(0,o.eJ)(),k=Z!==h.vi.Profile,R=void 0!==e,T=e===h.qt.ChatInfo||e===h.qt.UserInfo,N=e===h.qt.Search,B=e===h.qt.Management,x=e===h.qt.StickerSearch,A=e===h.qt.GifSearch,L=e===h.qt.PollResults,O=e===h.qt.AddingMembers,F=y<=a._m,[U,$]=(0,o.eJ)(!R),Q=null!==(v=(0,lt.Z)(e,!0,!r))&&void 0!==v?v:-1,D=(0,o.I4)(((t=!0)=>{switch(e){case h.qt.AddingMembers:p(h.WB.Closed);break;case h.qt.ChatInfo:if(k&&t){P(h.vi.Profile);break}i(void 0,!0);break;case h.qt.UserInfo:if(k&&t){P(h.vi.Profile);break}d({id:void 0},!0);break;case h.qt.Management:switch(C){case h.u1.Initial:c();break;case h.u1.ChatPrivacyType:case h.u1.Discussion:case h.u1.GroupPermissions:case h.u1.GroupType:case h.u1.ChatAdministrators:case h.u1.ChannelSubscribers:case h.u1.GroupMembers:w(h.u1.Initial);break;case h.u1.GroupUserPermissionsCreate:case h.u1.GroupRemovedUsers:case h.u1.GroupUserPermissions:w(h.u1.GroupPermissions),M(void 0),E(void 0);break;case h.u1.ChatAdminRights:case h.u1.GroupRecentActions:w(h.u1.ChatAdministrators)}break;case h.qt.Search:_a(),l();break;case h.qt.StickerSearch:_a(),u({query:void 0});break;case h.qt.GifSearch:_a(),m({query:void 0});break;case h.qt.PollResults:g()}}),[e,k,i,d,g,p,C,c,l,u,m]),q=(0,o.I4)(((e,t)=>{M(e),E(t)}),[]),G=(0,o.I4)((e=>{f({chatId:t,memberIds:e})}),[f,t]);function H(e){if(-1!==Q)switch(Q){case h.qt.AddingMembers:return o.ZP.createElement(Ga,{chatId:t,onNextStep:G,isActive:R&&e,onClose:D});case h.qt.ChatInfo:case h.qt.UserInfo:return o.ZP.createElement(Oa,{key:n||t,chatId:t,userId:n,profileState:Z,onProfileStateChange:P});case h.qt.Search:return o.ZP.createElement(Fa,{chatId:t,threadId:s,onClose:D,isActive:R&&e});case h.qt.Management:return o.ZP.createElement(Ua,{chatId:t,currentScreen:C,isPromotedByCurrentUser:S,selectedChatMemberId:b,onScreenSelect:w,onChatMemberSelect:q,isActive:R&&e,onClose:D});case h.qt.StickerSearch:return o.ZP.createElement($a,{onClose:D,isActive:R&&e});case h.qt.GifSearch:return o.ZP.createElement(Qa,{onClose:D,isActive:R&&e});case h.qt.PollResults:return o.ZP.createElement(Da,{onClose:D,isActive:R&&e})}}return(0,o.d4)((()=>R?(0,fe.Z)(D):void 0),[R,D]),(0,o.d4)((()=>{setTimeout((()=>{$(!R)}),300)}),[R]),(0,o.d4)((()=>{R&&F&&D()}),[F]),(0,Tt.Z)((([s,n])=>{(s===h.qt.ChatInfo&&e===h.qt.UserInfo||s===h.qt.UserInfo&&e===h.qt.ChatInfo||n!==t)&&(P(h.vi.Profile),w(h.u1.Initial))}),[e,t]),(0,ge.ZP)(r&&(e===h.qt.ChatInfo||e===h.qt.UserInfo||e===h.qt.Management||e===h.qt.AddingMembers),(()=>D(!1)),i),o.ZP.createElement("div",{id:"RightColumn-wrapper",className:r?void 0:"is-hidden"},F&&o.ZP.createElement("div",{className:"overlay-backdrop",onClick:D}),o.ZP.createElement("div",{id:"RightColumn"},o.ZP.createElement(ya,{chatId:t,isColumnOpen:R,isProfile:T,isSearch:N,isManagement:B,isStickerSearch:x,isGifSearch:A,isPollResults:L,isAddingChatMembers:O,profileState:Z,managementScreen:C,onClose:D,shouldSkipAnimation:U||I}),o.ZP.createElement(Ie.Z,{name:U||I?"none":"zoom-fade",renderCount:Ha+ja,activeKey:B?Ha+C:Q,shouldCleanup:!0,cleanupExceptionKey:h.qt.ChatInfo},H)))}))),Wa=(0,o.X$)((({isOpen:e})=>{const t=(0,Fe.Z)(Oe.gl.Extra,"MediaViewer",!e);return t?o.ZP.createElement(t,null):void 0})),Ka=(0,o.X$)((({isOpen:e})=>{const t=(0,Fe.Z)(Oe.gl.Extra,"Notifications",!e);return t?o.ZP.createElement(t,null):void 0})),Xa=(0,o.X$)((({isOpen:e})=>{const t=(0,Fe.Z)(Oe.gl.Extra,"Dialogs",!e);return t?o.ZP.createElement(t,null):void 0})),Ya=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"ForwardPicker",!t);return s?o.ZP.createElement(s,e):void 0})),za=(0,o.X$)((e=>{const{url:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"SafeLinkModal",!t);return s?o.ZP.createElement(s,e):void 0})),Ja=(0,o.X$)((e=>{const{isOpen:t}=e,s=(0,Fe.Z)(Oe.gl.Extra,"HistoryCalendar",!t);return s?o.ZP.createElement(s,e):void 0}));let eo,to=!1;function so(e){document.querySelectorAll('link[rel="icon"]').forEach((t=>{e?t.href.includes("favicon-unread")||(t.href=t.href.replace("favicon","favicon-unread")):t.href=t.href.replace("favicon-unread","favicon")}))}function no(e){document.title!==e&&(document.title=e)}const ao=(0,o.X$)((0,n.c$)((e=>{const{chatId:t,messageId:s}=e.audioPlayer,n=t&&s?(0,i.hj)(e,t,s):void 0;return{animationLevel:e.settings.byKey.animationLevel,lastSyncTime:e.lastSyncTime,isLeftColumnShown:e.isLeftColumnShown,isRightColumnShown:(0,i.Jf)(e),isMediaViewerOpen:(0,i.zQ)(e),isForwardModalOpen:(0,i.Ev)(e),hasNotifications:Boolean(e.notifications.length),hasDialogs:Boolean(e.dialogs.length),audioMessage:n,safeLinkModalUrl:e.safeLinkModalUrl,isHistoryCalendarOpen:Boolean(e.historyCalendarSelectedAt),shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations,language:e.settings.byKey.language,openedStickerSetShortName:e.openedStickerSetShortName}}),((e,t)=>(0,g.ei)(t,["loadAnimatedEmojis","loadNotificationSettings","loadNotificationExceptions","updateIsOnline","loadTopInlineBots","loadEmojiKeywords","openStickerSetShortName","loadCountryList"])))((({lastSyncTime:e,isLeftColumnShown:t,isRightColumnShown:s,isMediaViewerOpen:r,isForwardModalOpen:c,animationLevel:d,hasNotifications:l,hasDialogs:u,audioMessage:h,safeLinkModalUrl:g,isHistoryCalendarOpen:f,shouldSkipHistoryAnimations:p,language:I,openedStickerSetShortName:v,loadAnimatedEmojis:y,loadNotificationSettings:P,loadNotificationExceptions:C,updateIsOnline:w,loadTopInlineBots:b,loadEmojiKeywords:M,loadCountryList:S,openStickerSetShortName:E})=>{a.eM&&!to&&(to=!0,console.log(">>> RENDER MAIN")),(0,o.d4)((()=>{e&&(w(!0),y(),P(),C(),b(),M({language:a.pR}),I!==a.pR&&M({language:I}),S({langCode:I}))}),[e,y,C,P,w,b,M,S,I]),(0,o.d4)((()=>{e&&ge.Oy.startsWith("#?tgaddr=")&&(e=>{const{protocol:t,searchParams:s,pathname:a}=new URL(e);if("tg:"!==t)return;const{openChatByUsername:o,openStickerSetShortName:r}=(0,n.uC)(),i=a.replace(/^\/\//,""),c={};switch(s.forEach(((e,t)=>{c[t]=e})),i){case"resolve":{const{domain:e}=c;"telegrampassport"!==e&&o({username:e});break}case"privatepost":case"bg":case"join":break;case"addstickers":{const{set:e}=c;r({stickerSetShortName:e});break}}})(decodeURIComponent(ge.Oy.substr("#?tgaddr=".length)))}),[e]);const{transitionClassNames:k}=(0,de.Z)(!t,void 0,!0,void 0,p),{transitionClassNames:R}=(0,de.Z)(s,void 0,!0,void 0,p),T=(0,ie.Z)(k.replace(/([\w-]+)/g,"middle-column-$1"),R.replace(/([\w-]+)/g,"right-column-$1"),p&&"history-animation-disabled");(0,he.Z)((([e])=>{if(void 0===e||0===d)return;const t=(0,re.YW)();(0,ce.L)(document.getElementById("MiddleColumn"),t)}),[t]),(0,he.Z)((([e])=>{if(void 0===e||0===d)return;(0,Z.T2)((()=>{document.body.classList.add("animating-right-column")}));const t=(0,re.YW)();(0,ce.L)(document.getElementById("RightColumn"),(()=>{t(),(0,Z.T2)((()=>{document.body.classList.remove("animating-right-column")}))}))}),[s]);const N=(0,o.I4)((()=>{w(!1);const e=(0,i.A1)((0,n.Rd)());let t=0;clearInterval(eo),eo=window.setInterval((()=>{if(document.title.includes(a.ou))so(!1);else{if(t%2==0){const t=(0,i.A1)((0,n.Rd)())-e;t>0&&(no(`${t} notification${t>1?"s":""}`),so(!0))}else no(a.Ti),so(!1);t++}}),1e3)}),[w]),B=(0,o.I4)((()=>{w(!0),clearInterval(eo),eo=void 0,document.title.includes(a.ou)||no(a.Ti),so(!1)}),[w]),x=(0,o.I4)((()=>{E({stickerSetShortName:void 0})}),[E]);function A(e){e.preventDefault(),e.stopPropagation()}return(0,le.Z)(N,B),ue(N),function(e=!1){(0,o.d4)((()=>{if(m.cj&&!e)return document.addEventListener("gesturestart",me),()=>{document.removeEventListener("gesturestart",me)}}),[e])}(r),o.ZP.createElement("div",{id:"Main",className:T,onDrop:A,onDragOver:A},o.ZP.createElement(Je,null),o.ZP.createElement(pa,null),o.ZP.createElement(Va,null),o.ZP.createElement(Wa,{isOpen:r}),o.ZP.createElement(Ya,{isOpen:c}),o.ZP.createElement(Ka,{isOpen:l}),o.ZP.createElement(Xa,{isOpen:u}),h&&o.ZP.createElement(kt,{key:h.id,message:h,noUi:!0}),o.ZP.createElement(za,{url:g}),o.ZP.createElement(Ja,{isOpen:f}),o.ZP.createElement(ds.Z,{isOpen:Boolean(v),onClose:x,stickerSetShortName:v}))})));a.eM&&console.log(">>> FINISH LOAD MAIN BUNDLE"),(0,n.Rd)().connectionState||(0,n.uC)().initApi()}}]); +//# sourceMappingURL=433.c66cb5158ff9fdb2297f.js.map \ No newline at end of file diff --git a/dist/433.c66cb5158ff9fdb2297f.js.map b/dist/433.c66cb5158ff9fdb2297f.js.map new file mode 100644 index 00000000..c43ce1cb --- /dev/null +++ b/dist/433.c66cb5158ff9fdb2297f.js.map @@ -0,0 +1 @@ +{"version":3,"file":"433.c66cb5158ff9fdb2297f.js","mappings":"sNAoDO,SAASA,EAAqBC,GACnC,MAAM,OAAEC,EAAF,SAAUC,IAAaC,EAAAA,EAAAA,IAAyBH,IAAW,GACjE,OAAKC,GAAWC,GAIhBF,GAASI,EAAAA,EAAAA,IAAsBJ,EAAQC,EA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,SAAS0F,iBAAiB,eAAgBT,IAEnC,KACLjF,SAAS2F,oBAAoB,eAAgBV,OAE9C,CAACm7C,I4HqNJ2gB,CAAuBnC,GAQrB,0BAAKrvF,GAAG,OAAO+4B,UAAWA,EAAW04D,OAAQF,EAAWG,WAAYH,GAClE,mBAAC,GAAD,MACA,mBAAC,GAAD,MACA,mBAAC,GAAD,MACA,mBAAC,GAAD,CAAa74D,OAAQ22D,IACrB,mBAAC,GAAD,CAAe32D,OAAQ62D,IACvB,mBAAC,GAAD,CAAe72D,OAAQ+2D,IACvB,mBAAC,GAAD,CAAS/2D,OAAQg3D,IAChBrhD,GAAgB,mBAAC,GAAD,CAAatZ,IAAKsZ,EAAaruC,GAAIwG,QAAS6nC,EAAcnB,MAAI,IAC/E,mBAAC,GAAD,CAAe9iC,IAAKC,IACpB,mBAAC,GAAD,CAAiBquB,OAAQi3D,IACzB,mBAAC,KAAD,CACEj3D,OAAQx2B,QAAQ2d,GAChBmiB,QAASsvD,EACTtzE,oBAAqB6B,SEpPzBoD,EAAAA,IAEFC,QAAQC,IAAI,gCAGThf,EAAAA,EAAAA,MAAYg+B,kBACfhyB,EAAAA,EAAAA,MAAcwhF","sources":["webpack://telegram-t/./src/modules/actions/ui/localSearch.ts","webpack://telegram-t/./src/modules/actions/ui/chats.ts","webpack://telegram-t/./src/modules/actions/ui/messages.ts","webpack://telegram-t/./src/modules/actions/ui/globalSearch.ts","webpack://telegram-t/./src/modules/actions/ui/stickerSearch.ts","webpack://telegram-t/./src/modules/actions/ui/users.ts","webpack://telegram-t/./src/modules/actions/ui/misc.ts","webpack://telegram-t/./src/modules/actions/ui/payments.ts","webpack://telegram-t/./src/modules/actions/api/chats.ts","webpack://telegram-t/./src/modules/actions/api/messages.ts","webpack://telegram-t/./src/modules/actions/api/symbols.ts","webpack://telegram-t/./src/modules/actions/api/globalSearch.ts","webpack://telegram-t/./src/modules/actions/api/sync.ts","webpack://telegram-t/./src/modules/actions/api/localSearch.ts","webpack://telegram-t/./src/modules/actions/api/management.ts","webpack://telegram-t/./src/modules/actions/api/users.ts","webpack://telegram-t/./src/modules/reducers/bots.ts","webpack://telegram-t/./src/modules/actions/api/bots.ts","webpack://telegram-t/./src/modules/actions/api/twoFaSettings.ts","webpack://telegram-t/./src/modules/actions/api/payments.ts","webpack://telegram-t/./src/util/requestQuery.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/chats.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/messages.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/users.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/symbols.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/misc.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/settings.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/twoFaSettings.ts","webpack://telegram-t/./src/hooks/useBeforeUnload.ts","webpack://telegram-t/./src/hooks/usePreventIosPinchZoom.ts","webpack://telegram-t/./src/hooks/useBrowserOnline.ts","webpack://telegram-t/./src/components/left/main/LeftMainHeader.tsx","webpack://telegram-t/./src/components/left/ConnectionState.tsx","webpack://telegram-t/./src/components/left/main/ChatFolders.tsx","webpack://telegram-t/./src/hooks/useThrottledMemo.ts","webpack://telegram-t/./src/hooks/useThrottle.ts","webpack://telegram-t/./src/components/left/search/LeftSearch.async.tsx","webpack://telegram-t/./src/components/left/main/ContactList.async.tsx","webpack://telegram-t/./src/components/left/NewChatButton.tsx","webpack://telegram-t/./src/components/left/main/LeftMain.tsx","webpack://telegram-t/./src/components/left/settings/Settings.async.tsx","webpack://telegram-t/./src/components/left/newChat/NewChat.async.tsx","webpack://telegram-t/./src/components/left/ArchivedChats.async.tsx","webpack://telegram-t/./src/components/left/LeftColumn.tsx","webpack://telegram-t/./src/hooks/useWindowSize.ts","webpack://telegram-t/./src/components/middle/helpers/calculateMiddleFooterTransforms.ts","webpack://telegram-t/./src/util/routing.ts","webpack://telegram-t/./src/components/middle/HeaderMenuContainer.async.tsx","webpack://telegram-t/./src/components/middle/HeaderActions.tsx","webpack://telegram-t/./src/hooks/useWebpThumbnail.ts","webpack://telegram-t/./src/components/middle/PinnedMessageNavigation.tsx","webpack://telegram-t/./src/components/middle/HeaderPinnedMessage.tsx","webpack://telegram-t/./src/components/middle/AudioPlayer.tsx","webpack://telegram-t/./src/components/middle/MiddleHeader.tsx","webpack://telegram-t/./src/components/middle/helpers/groupMessages.ts","webpack://telegram-t/./src/components/middle/hooks/useMessageObservers.ts","webpack://telegram-t/./src/components/middle/message/helpers/buildContentClassName.ts","webpack://telegram-t/./src/components/middle/message/helpers/mediaDimensions.ts","webpack://telegram-t/./src/components/middle/message/helpers/calculateAlbumLayout.ts","webpack://telegram-t/./src/components/middle/message/helpers/calculateAuthorWidth.ts","webpack://telegram-t/./src/components/middle/message/hooks/useFocusMessage.ts","webpack://telegram-t/./src/components/middle/message/ContextMenuContainer.async.tsx","webpack://telegram-t/./src/components/middle/ActionMessage.tsx","webpack://telegram-t/./src/components/common/EmbeddedMessage.tsx","webpack://telegram-t/./src/components/middle/message/MessageMeta.tsx","webpack://telegram-t/./src/components/middle/message/Sticker.tsx","webpack://telegram-t/./src/components/middle/message/hooks/useBlurredMediaThumbRef.ts","webpack://telegram-t/./src/components/middle/message/helpers/getCustomAppendixBg.ts","webpack://telegram-t/./src/components/middle/message/Photo.tsx","webpack://telegram-t/./src/hooks/useHeavyAnimationCheckForVideo.ts","webpack://telegram-t/./src/components/middle/message/hooks/usePauseOnInactive.ts","webpack://telegram-t/./src/components/middle/message/Video.tsx","webpack://telegram-t/./src/components/middle/message/Contact.tsx","webpack://telegram-t/./src/components/ui/CheckboxGroup.tsx","webpack://telegram-t/./src/components/middle/message/PollOption.tsx","webpack://telegram-t/./src/components/middle/message/Poll.tsx","webpack://telegram-t/./src/components/middle/message/WebPage.tsx","webpack://telegram-t/./src/components/middle/message/Invoice.tsx","webpack://telegram-t/./src/components/middle/message/hocs/withSelectControl.tsx","webpack://telegram-t/./src/components/middle/message/Album.tsx","webpack://telegram-t/./src/components/middle/message/RoundVideo.tsx","webpack://telegram-t/./src/components/middle/message/InlineButtons.tsx","webpack://telegram-t/./src/components/middle/message/CommentButton.tsx","webpack://telegram-t/./src/components/middle/message/Message.tsx","webpack://telegram-t/./src/components/middle/message/hooks/useOuterHandlers.ts","webpack://telegram-t/./src/components/middle/message/hooks/useInnerHandlers.ts","webpack://telegram-t/./src/components/middle/MessageListContent.tsx","webpack://telegram-t/./src/components/middle/hooks/useScrollHooks.ts","webpack://telegram-t/./src/components/middle/ContactGreeting.tsx","webpack://telegram-t/./src/components/middle/NoMessages.tsx","webpack://telegram-t/./src/components/middle/MessageList.tsx","webpack://telegram-t/./src/components/middle/hooks/useStickyDates.ts","webpack://telegram-t/./src/hooks/useDebounce.ts","webpack://telegram-t/./src/components/middle/ScrollDownButton.tsx","webpack://telegram-t/./src/components/middle/composer/helpers/buildAttachment.ts","webpack://telegram-t/./src/components/middle/composer/helpers/applyIosAutoCapitalizationFix.ts","webpack://telegram-t/./node_modules/opus-recorder/dist/encoderWorker.min.js","webpack://telegram-t/./src/util/voiceRecording.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useVoiceRecording.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useClipboardPaste.ts","webpack://telegram-t/./src/components/middle/composer/helpers/getMessageTextAsHtml.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useDraft.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useInlineBotTooltip.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useBotCommandTooltip.ts","webpack://telegram-t/./src/components/common/DeleteMessageModal.async.tsx","webpack://telegram-t/./src/components/ui/ResponsiveHoverButton.tsx","webpack://telegram-t/./src/components/middle/composer/AttachMenu.async.tsx","webpack://telegram-t/./src/components/middle/composer/SymbolMenu.async.tsx","webpack://telegram-t/./src/components/middle/composer/InlineBotTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/MentionTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/CustomSendMenu.async.tsx","webpack://telegram-t/./src/components/middle/composer/StickerTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/BotCommandTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/BotKeyboardMenu.tsx","webpack://telegram-t/./src/components/middle/composer/ComposerEmbeddedMessage.tsx","webpack://telegram-t/./src/components/middle/composer/AttachmentModal.async.tsx","webpack://telegram-t/./src/components/middle/composer/BotCommandMenu.async.tsx","webpack://telegram-t/./src/components/middle/composer/PollModal.async.tsx","webpack://telegram-t/./src/components/middle/composer/DropArea.async.tsx","webpack://telegram-t/./src/components/middle/composer/WebPagePreview.tsx","webpack://telegram-t/./src/components/common/CalendarModal.async.tsx","webpack://telegram-t/./src/components/payment/PaymentModal.async.tsx","webpack://telegram-t/./src/components/payment/ReceiptModal.async.tsx","webpack://telegram-t/./src/components/middle/composer/Composer.tsx","webpack://telegram-t/./src/components/middle/composer/hooks/useStickerTooltip.ts","webpack://telegram-t/./src/util/insertHtmlInSelection.ts","webpack://telegram-t/./src/util/deleteLastCharacterOutsideSelection.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useEditing.ts","webpack://telegram-t/./src/components/middle/MobileSearch.async.tsx","webpack://telegram-t/./src/components/middle/MessageSelectToolbar.async.tsx","webpack://telegram-t/./src/components/common/UnpinAllMessagesModal.async.tsx","webpack://telegram-t/./src/components/middle/MiddleColumn.tsx","webpack://telegram-t/./src/hooks/useCustomBackground.ts","webpack://telegram-t/./src/components/right/RightHeader.tsx","webpack://telegram-t/./src/components/right/hooks/useProfileViewportIds.ts","webpack://telegram-t/./src/components/right/hooks/useProfileState.ts","webpack://telegram-t/./src/components/right/DeleteMemberModal.tsx","webpack://telegram-t/./src/components/right/Profile.tsx","webpack://telegram-t/./src/components/right/hooks/useTransitionFixes.ts","webpack://telegram-t/./src/hooks/useCacheBuster.ts","webpack://telegram-t/./src/components/right/RightSearch.async.tsx","webpack://telegram-t/./src/components/right/management/Management.async.tsx","webpack://telegram-t/./src/components/right/StickerSearch.async.tsx","webpack://telegram-t/./src/components/right/GifSearch.async.tsx","webpack://telegram-t/./src/components/right/PollResults.async.tsx","webpack://telegram-t/./src/components/right/AddChatMembers.tsx","webpack://telegram-t/./src/components/right/RightColumn.tsx","webpack://telegram-t/./src/components/mediaViewer/MediaViewer.async.tsx","webpack://telegram-t/./src/components/main/Notifications.async.tsx","webpack://telegram-t/./src/components/main/Dialogs.async.tsx","webpack://telegram-t/./src/components/main/ForwardPicker.async.tsx","webpack://telegram-t/./src/components/main/SafeLinkModal.async.tsx","webpack://telegram-t/./src/components/main/HistoryCalendar.async.tsx","webpack://telegram-t/./src/components/main/Main.tsx","webpack://telegram-t/./src/util/deeplink.ts","webpack://telegram-t/./src/bundles/main.ts"],"sourcesContent":["import { addReducer } from '../../../lib/teact/teactn';\n\nimport {\n updateLocalTextSearch,\n replaceLocalTextSearchResults,\n updateLocalMediaSearchType,\n} from '../../reducers';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { selectCurrentMessageList } from '../../selectors';\nimport { buildChatThreadKey } from '../../helpers';\nimport { GlobalState } from '../../../global/types';\n\naddReducer('openLocalTextSearch', (global) => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n return updateLocalTextSearch(global, chatId, threadId, true);\n});\n\naddReducer('closeLocalTextSearch', closeLocalTextSearch);\n\naddReducer('setLocalTextSearchQuery', (global, actions, payload) => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n const { query } = payload!;\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n const { query: currentQuery } = global.localTextSearch.byChatThreadKey[chatThreadKey] || {};\n\n if (query !== currentQuery) {\n global = replaceLocalTextSearchResults(global, chatId, threadId, MEMO_EMPTY_ARRAY);\n }\n\n global = updateLocalTextSearch(global, chatId, threadId, true, query);\n\n return global;\n});\n\naddReducer('setLocalMediaSearchType', (global, actions, payload) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return undefined;\n }\n\n const { mediaType } = payload!;\n return updateLocalMediaSearchType(global, chatId, mediaType);\n});\n\nexport function closeLocalTextSearch(global: GlobalState): GlobalState {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return global;\n }\n\n global = updateLocalTextSearch(global, chatId, threadId, false);\n global = replaceLocalTextSearchResults(global, chatId, threadId, undefined);\n return global;\n}\n","import { addReducer, setGlobal } from '../../../lib/teact/teactn';\n\nimport {\n exitMessageSelectMode, replaceThreadParam, updateCurrentMessageList,\n} from '../../reducers';\nimport { selectCurrentMessageList } from '../../selectors';\nimport { closeLocalTextSearch } from './localSearch';\n\naddReducer('openChat', (global, actions, payload) => {\n const {\n id, threadId = -1, type = 'thread', shouldReplaceHistory = false,\n } = payload!;\n\n const currentMessageList = selectCurrentMessageList(global);\n\n if (!currentMessageList\n || (\n currentMessageList.chatId !== id\n || currentMessageList.threadId !== threadId\n || currentMessageList.type !== type\n )) {\n global = replaceThreadParam(global, id, threadId, 'replyStack', []);\n global = exitMessageSelectMode(global);\n global = closeLocalTextSearch(global);\n\n global = {\n ...global,\n messages: {\n ...global.messages,\n contentToBeScheduled: undefined,\n },\n ...(id !== global.forwardMessages.toChatId && {\n forwardMessages: {},\n }),\n };\n\n setGlobal(global);\n }\n\n return updateCurrentMessageList(global, id, threadId, type, shouldReplaceHistory);\n});\n\naddReducer('openPreviousChat', (global) => {\n return updateCurrentMessageList(global, undefined);\n});\n\naddReducer('openChatWithInfo', (global, actions, payload) => {\n setGlobal({\n ...global,\n isChatInfoShown: true,\n });\n\n actions.openChat(payload);\n});\n\naddReducer('resetChatCreation', (global) => {\n return {\n ...global,\n chatCreation: undefined,\n };\n});\n\naddReducer('setNewChatMembersDialogState', (global, actions, payload) => {\n return {\n ...global,\n newChatMembersProgress: payload,\n };\n});\n\naddReducer('openNextChat', (global, actions, payload) => {\n const { targetIndexDelta, orderedIds } = payload;\n\n const { chatId } = selectCurrentMessageList(global) || {};\n\n if (!chatId) {\n actions.openChat({ id: orderedIds[0] });\n return;\n }\n\n const position = orderedIds.indexOf(chatId);\n\n if (position === -1) {\n return;\n }\n const nextId = orderedIds[position + targetIndexDelta];\n\n actions.openChat({ id: nextId, shouldReplaceHistory: true });\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { MAIN_THREAD_ID } from '../../../api/types';\nimport { FocusDirection } from '../../../types';\n\nimport { ANIMATION_END_DELAY, FAST_SMOOTH_MAX_DURATION } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport {\n enterMessageSelectMode,\n toggleMessageSelection,\n exitMessageSelectMode,\n replaceThreadParam,\n updateFocusDirection,\n updateFocusedMessage,\n} from '../../reducers';\nimport {\n selectCurrentChat,\n selectViewportIds,\n selectIsRightColumnShown,\n selectCurrentMessageList,\n selectChat,\n selectThreadInfo,\n selectChatMessages,\n selectAllowedMessageActions,\n selectMessageIdsByGroupId,\n selectForwardedMessageIdsByGroupId,\n selectIsViewportNewest,\n selectReplyingToId,\n selectReplyStack,\n} from '../../selectors';\nimport { findLast } from '../../../util/iteratees';\n\nconst FOCUS_DURATION = 1500;\nconst FOCUS_NO_HIGHLIGHT_DURATION = FAST_SMOOTH_MAX_DURATION + ANIMATION_END_DELAY;\nconst POLL_RESULT_OPEN_DELAY_MS = 450;\n\nlet blurTimeout: number | undefined;\n\naddReducer('setScrollOffset', (global, actions, payload) => {\n const { chatId, threadId, scrollOffset } = payload!;\n\n return replaceThreadParam(global, chatId, threadId, 'scrollOffset', scrollOffset);\n});\n\naddReducer('setReplyingToId', (global, actions, payload) => {\n const { messageId } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n const { chatId, threadId } = currentMessageList;\n\n return replaceThreadParam(global, chatId, threadId, 'replyingToId', messageId);\n});\n\naddReducer('setEditingId', (global, actions, payload) => {\n const { messageId } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n const { chatId, threadId, type } = currentMessageList;\n const paramName = type === 'scheduled' ? 'editingScheduledId' : 'editingId';\n\n return replaceThreadParam(global, chatId, threadId, paramName, messageId);\n});\n\naddReducer('editLastMessage', (global) => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n const chatMessages = selectChatMessages(global, chatId);\n const viewportIds = selectViewportIds(global, chatId, threadId);\n if (!chatMessages || !viewportIds) {\n return undefined;\n }\n\n const lastOwnEditableMessageId = findLast(viewportIds, (id) => {\n return Boolean(chatMessages[id] && selectAllowedMessageActions(global, chatMessages[id], threadId).canEdit);\n });\n\n if (!lastOwnEditableMessageId) {\n return undefined;\n }\n\n return replaceThreadParam(global, chatId, threadId, 'editingId', lastOwnEditableMessageId);\n});\n\naddReducer('replyToNextMessage', (global, actions, payload) => {\n const { targetIndexDelta } = payload;\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return;\n }\n\n const chatMessages = selectChatMessages(global, chatId);\n const viewportIds = selectViewportIds(global, chatId, threadId);\n if (!chatMessages || !viewportIds) {\n return;\n }\n\n const replyingToId = selectReplyingToId(global, chatId, threadId);\n const isLatest = selectIsViewportNewest(global, chatId, threadId);\n\n let messageId: number | undefined;\n\n if (!isLatest || !replyingToId) {\n if (threadId === MAIN_THREAD_ID) {\n const chat = selectChat(global, chatId);\n\n messageId = chat?.lastMessage?.id;\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n\n messageId = threadInfo?.lastMessageId;\n }\n } else {\n const chatMessageKeys = Object.keys(chatMessages);\n const indexOfCurrent = chatMessageKeys.indexOf(replyingToId.toString());\n const newIndex = indexOfCurrent + targetIndexDelta;\n messageId = newIndex <= chatMessageKeys.length + 1 && newIndex >= 0\n ? Number(chatMessageKeys[newIndex])\n : undefined;\n }\n actions.setReplyingToId({ messageId });\n actions.focusMessage({\n chatId, threadId, messageId,\n });\n});\n\naddReducer('openMediaViewer', (global, actions, payload) => {\n const {\n chatId, threadId, messageId, avatarOwnerId, profilePhotoIndex, origin,\n } = payload!;\n\n return {\n ...global,\n mediaViewer: {\n chatId,\n threadId,\n messageId,\n avatarOwnerId,\n profilePhotoIndex,\n origin,\n },\n forwardMessages: {},\n };\n});\n\naddReducer('closeMediaViewer', (global) => {\n return {\n ...global,\n mediaViewer: {},\n };\n});\n\naddReducer('openAudioPlayer', (global, actions, payload) => {\n const {\n chatId, threadId, messageId,\n } = payload!;\n\n return {\n ...global,\n audioPlayer: {\n chatId,\n threadId,\n messageId,\n },\n };\n});\n\naddReducer('closeAudioPlayer', (global) => {\n return {\n ...global,\n audioPlayer: {},\n };\n});\n\naddReducer('openPollResults', (global, actions, payload) => {\n const { chatId, messageId } = payload!;\n\n const shouldOpenInstantly = selectIsRightColumnShown(global);\n\n if (!shouldOpenInstantly) {\n window.setTimeout(() => {\n const newGlobal = getGlobal();\n\n setGlobal({\n ...newGlobal,\n pollResults: {\n chatId,\n messageId,\n voters: {},\n },\n });\n }, POLL_RESULT_OPEN_DELAY_MS);\n } else if (chatId !== global.pollResults.chatId || messageId !== global.pollResults.messageId) {\n setGlobal({\n ...global,\n pollResults: {\n chatId,\n messageId,\n voters: {},\n },\n });\n }\n});\n\naddReducer('closePollResults', (global) => {\n setGlobal({\n ...global,\n pollResults: {},\n });\n});\n\naddReducer('focusLastMessage', (global, actions) => {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId, threadId } = currentMessageList;\n\n let lastMessageId: number | undefined;\n if (threadId === MAIN_THREAD_ID) {\n const chat = selectChat(global, chatId);\n\n lastMessageId = chat?.lastMessage?.id;\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n\n lastMessageId = threadInfo?.lastMessageId;\n }\n\n if (!lastMessageId) {\n return;\n }\n\n actions.focusMessage({\n chatId, threadId, messageId: lastMessageId, noHighlight: true,\n });\n});\n\naddReducer('focusNextReply', (global, actions) => {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n const { chatId, threadId } = currentMessageList;\n\n const replyStack = selectReplyStack(global, chatId, threadId);\n\n if (!replyStack || replyStack.length === 0) {\n actions.focusLastMessage();\n } else {\n const messageId = replyStack.pop();\n\n global = replaceThreadParam(global, chatId, threadId, 'replyStack', [...replyStack]);\n\n setGlobal(global);\n\n actions.focusMessage({\n chatId,\n threadId,\n messageId,\n });\n }\n\n return undefined;\n});\n\naddReducer('focusMessage', (global, actions, payload) => {\n const {\n chatId, threadId = MAIN_THREAD_ID, messageListType = 'thread', noHighlight, groupedId, groupedChatId,\n replyMessageId, isResizingContainer,\n } = payload!;\n\n let { messageId } = payload!;\n\n if (groupedId !== undefined) {\n const ids = selectForwardedMessageIdsByGroupId(global, groupedChatId, groupedId);\n if (ids?.length) {\n ([messageId] = ids);\n }\n }\n\n const currentMessageList = selectCurrentMessageList(global);\n const shouldSwitchChat = !currentMessageList || (\n chatId !== currentMessageList.chatId\n || threadId !== currentMessageList.threadId\n || messageListType !== currentMessageList.type\n );\n\n if (blurTimeout) {\n clearTimeout(blurTimeout);\n blurTimeout = undefined;\n }\n blurTimeout = window.setTimeout(() => {\n let newGlobal = getGlobal();\n newGlobal = updateFocusedMessage(newGlobal);\n newGlobal = updateFocusDirection(newGlobal);\n setGlobal(newGlobal);\n }, noHighlight ? FOCUS_NO_HIGHLIGHT_DURATION : FOCUS_DURATION);\n\n global = updateFocusedMessage(global, chatId, messageId, noHighlight, isResizingContainer);\n global = updateFocusDirection(global, undefined);\n\n if (replyMessageId) {\n const replyStack = selectReplyStack(global, chatId, threadId) || [];\n global = replaceThreadParam(global, chatId, threadId, 'replyStack', [...replyStack, replyMessageId]);\n }\n\n if (shouldSwitchChat) {\n global = updateFocusDirection(global, FocusDirection.Static);\n }\n\n const viewportIds = selectViewportIds(global, chatId, threadId);\n if (viewportIds && viewportIds.includes(messageId)) {\n setGlobal(global);\n actions.openChat({ id: chatId, threadId });\n return undefined;\n }\n\n if (shouldSwitchChat) {\n global = replaceThreadParam(global, chatId, threadId, 'viewportIds', undefined);\n }\n\n global = replaceThreadParam(global, chatId, threadId, 'outlyingIds', undefined);\n\n if (viewportIds && !shouldSwitchChat) {\n const direction = messageId > viewportIds[0] ? FocusDirection.Down : FocusDirection.Up;\n global = updateFocusDirection(global, direction);\n }\n\n setGlobal(global);\n\n actions.openChat({ id: chatId, threadId });\n actions.loadViewportMessages();\n return undefined;\n});\n\naddReducer('openForwardMenu', (global, actions, payload) => {\n const { fromChatId, messageIds, groupedId } = payload!;\n let groupedMessageIds;\n if (groupedId) {\n groupedMessageIds = selectMessageIdsByGroupId(global, fromChatId, groupedId);\n }\n return {\n ...global,\n forwardMessages: {\n fromChatId,\n messageIds: groupedMessageIds || messageIds,\n isModalShown: true,\n },\n };\n});\n\naddReducer('exitForwardMode', (global) => {\n setGlobal({\n ...global,\n forwardMessages: {},\n });\n});\n\naddReducer('setForwardChatId', (global, actions, payload) => {\n const { id } = payload!;\n\n setGlobal({\n ...global,\n forwardMessages: {\n ...global.forwardMessages,\n toChatId: id,\n isModalShown: false,\n },\n });\n\n actions.openChat({ id });\n actions.closeMediaViewer();\n actions.exitMessageSelectMode();\n});\n\naddReducer('openForwardMenuForSelectedMessages', (global, actions) => {\n if (!global.selectedMessages) {\n return;\n }\n\n const { chatId: fromChatId, messageIds } = global.selectedMessages;\n\n actions.openForwardMenu({ fromChatId, messageIds });\n});\n\naddReducer('enterMessageSelectMode', (global, actions, payload) => {\n const { messageId } = payload || {};\n const openChat = selectCurrentChat(global);\n if (!openChat) {\n return global;\n }\n\n return enterMessageSelectMode(global, openChat.id, messageId);\n});\n\naddReducer('toggleMessageSelection', (global, actions, payload) => {\n const {\n messageId,\n groupedId,\n childMessageIds,\n withShift,\n } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId, threadId, type: messageListType } = currentMessageList;\n\n global = toggleMessageSelection(\n global, chatId, threadId, messageListType, messageId, groupedId, childMessageIds, withShift,\n );\n\n setGlobal(global);\n\n if (global.shouldShowContextMenuHint) {\n actions.disableContextMenuHint();\n actions.showNotification({\n // eslint-disable-next-line max-len\n message: `To **edit** or **reply**, close this menu. Then ${IS_TOUCH_ENV ? 'long tap' : 'right click'} on a message.`,\n });\n }\n});\n\naddReducer('disableContextMenuHint', (global) => {\n if (!global.shouldShowContextMenuHint) {\n return undefined;\n }\n\n return {\n ...global,\n shouldShowContextMenuHint: false,\n };\n});\n\naddReducer('exitMessageSelectMode', exitMessageSelectMode);\n\naddReducer('openPollModal', (global) => {\n return {\n ...global,\n isPollModalOpen: true,\n };\n});\n\naddReducer('closePollModal', (global) => {\n return {\n ...global,\n isPollModalOpen: false,\n };\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { updateGlobalSearch, updateGlobalSearchContent } from '../../reducers';\n\nconst MAX_RECENTLY_FOUND_IDS = 10;\n\naddReducer('setGlobalSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n const { chatId } = global.globalSearch;\n\n return updateGlobalSearch(global, {\n globalResults: {},\n localResults: {},\n resultsByType: undefined,\n ...(query ? { fetchingStatus: { chats: !chatId, messages: true } } : { fetchingStatus: undefined }),\n query,\n });\n});\n\naddReducer('addRecentlyFoundChatId', (global, actions, payload) => {\n const { id } = payload!;\n const { recentlyFoundChatIds } = global.globalSearch;\n\n if (!recentlyFoundChatIds) {\n return updateGlobalSearch(global, { recentlyFoundChatIds: [id] });\n }\n\n const newRecentIds = recentlyFoundChatIds.filter((chatId) => chatId !== id);\n newRecentIds.unshift(id);\n if (newRecentIds.length > MAX_RECENTLY_FOUND_IDS) {\n newRecentIds.pop();\n }\n\n return updateGlobalSearch(global, { recentlyFoundChatIds: newRecentIds });\n});\n\naddReducer('clearRecentlyFoundChats', (global) => {\n return updateGlobalSearch(global, { recentlyFoundChatIds: undefined });\n});\n\naddReducer('setGlobalSearchContent', (global, actions, payload) => {\n const { content } = payload!;\n\n return updateGlobalSearchContent(global, content);\n});\n\naddReducer('setGlobalSearchChatId', (global, actions, payload) => {\n const { id } = payload!;\n\n return updateGlobalSearch(global, { chatId: id, query: undefined, resultsByType: undefined });\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\naddReducer('setStickerSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n search: {\n query,\n resultIds: undefined,\n },\n },\n };\n});\n\naddReducer('setGifSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n return {\n ...global,\n gifs: {\n ...global.gifs,\n search: {\n query,\n offsetId: undefined,\n results: undefined,\n },\n },\n };\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\n\nimport { updateSelectedUserId, updateUserSearch } from '../../reducers';\n\naddReducer('openUserInfo', (global, actions, payload) => {\n const { id } = payload!;\n\n actions.openChat({ id });\n});\n\nconst clearSelectedUserId = (global: GlobalState) => updateSelectedUserId(global, undefined);\n\naddReducer('openChat', clearSelectedUserId);\n\naddReducer('setUserSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n return updateUserSearch(global, {\n globalUserIds: undefined,\n localUserIds: undefined,\n fetchingStatus: Boolean(query),\n query,\n });\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\nimport { ApiError } from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TABLET_COLUMN_LAYOUT } from '../../../util/environment';\nimport getReadableErrorText from '../../../util/getReadableErrorText';\nimport { selectCurrentMessageList } from '../../selectors';\nimport generateIdFor from '../../../util/generateIdFor';\n\nconst MAX_STORED_EMOJIS = 18; // Represents two rows of recent emojis\n\naddReducer('toggleChatInfo', (global) => {\n return {\n ...global,\n isChatInfoShown: !global.isChatInfoShown,\n };\n});\n\naddReducer('toggleManagement', (global): GlobalState | undefined => {\n const { chatId } = selectCurrentMessageList(global) || {};\n\n if (!chatId) {\n return undefined;\n }\n\n return {\n ...global,\n management: {\n byChatId: {\n ...global.management.byChatId,\n [chatId]: {\n ...global.management.byChatId[chatId],\n isActive: !(global.management.byChatId[chatId] || {}).isActive,\n },\n },\n },\n };\n});\n\naddReducer('closeManagement', (global): GlobalState | undefined => {\n const { chatId } = selectCurrentMessageList(global) || {};\n\n if (!chatId) {\n return undefined;\n }\n\n return {\n ...global,\n management: {\n byChatId: {\n ...global.management.byChatId,\n [chatId]: {\n ...global.management.byChatId[chatId],\n isActive: false,\n },\n },\n },\n };\n});\n\naddReducer('openChat', (global) => {\n if (!IS_SINGLE_COLUMN_LAYOUT && !IS_TABLET_COLUMN_LAYOUT) {\n return undefined;\n }\n\n return {\n ...global,\n isLeftColumnShown: global.messages.messageLists.length === 0,\n };\n});\n\naddReducer('toggleLeftColumn', (global) => {\n return {\n ...global,\n isLeftColumnShown: !global.isLeftColumnShown,\n };\n});\n\naddReducer('addRecentEmoji', (global, action, payload) => {\n const { emoji } = payload!;\n const { recentEmojis } = global;\n if (!recentEmojis) {\n return {\n ...global,\n recentEmojis: [emoji],\n };\n }\n\n const newEmojis = recentEmojis.filter((e) => e !== emoji);\n newEmojis.unshift(emoji);\n if (newEmojis.length > MAX_STORED_EMOJIS) {\n newEmojis.pop();\n }\n\n return {\n ...global,\n recentEmojis: newEmojis,\n };\n});\n\naddReducer('addRecentSticker', (global, action, payload) => {\n const { sticker } = payload!;\n const { recent } = global.stickers;\n if (!recent) {\n return {\n ...global,\n stickers: {\n ...global.stickers,\n recent: {\n hash: 0,\n stickers: [sticker],\n },\n },\n };\n }\n\n const newStickers = recent.stickers.filter((s) => s.id !== sticker.id);\n newStickers.unshift(sticker);\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n recent: {\n ...recent,\n stickers: newStickers,\n },\n },\n };\n});\n\naddReducer('showNotification', (global, actions, payload) => {\n const notification = payload!;\n notification.localId = generateIdFor({});\n\n const newNotifications = [...global.notifications];\n const existingNotificationIndex = newNotifications.findIndex((n) => n.message === notification.message);\n if (existingNotificationIndex !== -1) {\n newNotifications.splice(existingNotificationIndex, 1);\n }\n\n newNotifications.push(notification);\n\n return {\n ...global,\n notifications: newNotifications,\n };\n});\n\naddReducer('dismissNotification', (global, actions, payload) => {\n const newNotifications = global.notifications.filter(({ localId }) => localId !== payload.localId);\n\n return {\n ...global,\n notifications: newNotifications,\n };\n});\n\naddReducer('showDialog', (global, actions, payload) => {\n const { data } = payload!;\n\n // Filter out errors that we don't want to show to the user\n if ('message' in data && data.hasErrorKey && !getReadableErrorText(data)) {\n return global;\n }\n\n const newDialogs = [...global.dialogs];\n if ('message' in data) {\n const existingErrorIndex = newDialogs.findIndex((err) => (err as ApiError).message === data.message);\n if (existingErrorIndex !== -1) {\n newDialogs.splice(existingErrorIndex, 1);\n }\n }\n\n newDialogs.push(data);\n\n return {\n ...global,\n dialogs: newDialogs,\n };\n});\n\naddReducer('dismissDialog', (global) => {\n const newDialogs = [...global.dialogs];\n\n newDialogs.pop();\n\n return {\n ...global,\n dialogs: newDialogs,\n };\n});\n\naddReducer('toggleSafeLinkModal', (global, actions, payload) => {\n const { url: safeLinkModalUrl } = payload;\n\n return {\n ...global,\n safeLinkModalUrl,\n };\n});\n\naddReducer('openHistoryCalendar', (global, actions, payload) => {\n const { selectedAt } = payload;\n\n return {\n ...global,\n historyCalendarSelectedAt: selectedAt,\n };\n});\n\naddReducer('closeHistoryCalendar', (global) => {\n return {\n ...global,\n historyCalendarSelectedAt: undefined,\n };\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { clearPayment, closeInvoice } from '../../reducers';\n\naddReducer('openPaymentModal', (global, actions, payload) => {\n const { chatId, messageId } = payload;\n return {\n ...global,\n payment: {\n ...global.payment,\n chatId,\n messageId,\n isPaymentModalOpen: true,\n },\n };\n});\n\naddReducer('closePaymentModal', (global) => {\n const newGlobal = clearPayment(global);\n return closeInvoice(newGlobal);\n});\n\naddReducer('addPaymentError', (global, actions, payload) => {\n const { error } = payload!;\n\n return {\n ...global,\n payment: {\n ...global.payment,\n error,\n },\n };\n});\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiUser, ApiChatFolder, MAIN_THREAD_ID,\n} from '../../../api/types';\nimport { NewChatMembersProgress, ChatCreationProgress, ManagementProgress } from '../../../types';\nimport { GlobalActions } from '../../../global/types';\n\nimport {\n ARCHIVED_FOLDER_ID,\n TOP_CHAT_MESSAGES_PRELOAD_LIMIT,\n CHAT_LIST_LOAD_SLICE,\n RE_TME_INVITE_LINK,\n RE_TME_LINK,\n TIPS_USERNAME,\n LOCALIZED_TIPS,\n} from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport {\n addChats,\n addUsers,\n replaceThreadParam,\n updateChatListIds,\n updateChats,\n updateChat,\n updateChatListSecondaryInfo,\n updateManagementProgress,\n} from '../../reducers';\nimport {\n selectChat,\n selectCurrentChat,\n selectUser,\n selectChatListType,\n selectIsChatPinned,\n selectChatFolder,\n selectSupportChat,\n selectChatByUsername,\n selectThreadTopMessageId,\n selectCurrentMessageList,\n} from '../../selectors';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { debounce, pause, throttle } from '../../../util/schedulers';\nimport {\n isChatSummaryOnly, isChatArchived, prepareChatList, isChatBasicGroup,\n} from '../../helpers';\n\nconst TOP_CHATS_PRELOAD_PAUSE = 100;\n// We expect this ID does not exist\nconst TMP_CHAT_ID = -1;\n\nconst runThrottledForLoadChats = throttle((cb) => cb(), 1000, true);\nconst runThrottledForLoadTopChats = throttle((cb) => cb(), 3000, true);\nconst runDebouncedForLoadFullChat = debounce((cb) => cb(), 500, false, true);\n\naddReducer('preloadTopChatMessages', (global, actions) => {\n (async () => {\n const preloadedChatIds: number[] = [];\n\n for (let i = 0; i < TOP_CHAT_MESSAGES_PRELOAD_LIMIT; i++) {\n await pause(TOP_CHATS_PRELOAD_PAUSE);\n\n const {\n byId,\n listIds: { active: listIds },\n orderedPinnedIds: { active: orderedPinnedIds },\n } = getGlobal().chats;\n if (!listIds) {\n return;\n }\n\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n const { pinnedChats, otherChats } = prepareChatList(byId, listIds, orderedPinnedIds);\n const topChats = [...pinnedChats, ...otherChats];\n const chatToPreload = topChats.find(({ id }) => id !== currentChatId && !preloadedChatIds.includes(id));\n if (!chatToPreload) {\n return;\n }\n\n preloadedChatIds.push(chatToPreload.id);\n\n actions.loadViewportMessages({ chatId: chatToPreload.id, threadId: MAIN_THREAD_ID });\n }\n })();\n});\n\naddReducer('openChat', (global, actions, payload) => {\n const { id, threadId } = payload!;\n const { currentUserId } = global;\n const chat = selectChat(global, id);\n\n if (chat?.hasUnreadMark) {\n actions.toggleChatUnread({ id });\n }\n\n // Please telegram send us some updates about linked chat 🙏\n if (chat && chat.lastMessage && chat.lastMessage.threadInfo) {\n actions.requestThreadInfoUpdate({\n chatId: chat.lastMessage.threadInfo.chatId,\n threadId: chat.lastMessage.threadInfo.threadId,\n });\n }\n\n if (!chat) {\n if (id === currentUserId) {\n void callApi('fetchChat', { type: 'self' });\n } else {\n const user = selectUser(global, id);\n if (user) {\n void callApi('fetchChat', { type: 'user', user });\n }\n }\n } else if (isChatSummaryOnly(chat) && !chat.isMin) {\n actions.requestChatUpdate({ chatId: id });\n }\n\n if (threadId !== MAIN_THREAD_ID) {\n const topMessageId = selectThreadTopMessageId(global, id, threadId);\n if (!topMessageId) {\n actions.requestThreadInfoUpdate({ chatId: id, threadId });\n }\n }\n});\n\naddReducer('openSupportChat', (global, actions) => {\n const chat = selectSupportChat(global);\n\n actions.openChat({ id: chat ? chat.id : TMP_CHAT_ID });\n\n if (chat) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchChat', { type: 'support' });\n if (result) {\n actions.openChat({ id: result.chatId });\n }\n })();\n});\n\naddReducer('openTipsChat', (global, actions, payload) => {\n const { langCode } = payload;\n\n const usernamePostfix = langCode === 'pt-br'\n ? 'BR'\n : LOCALIZED_TIPS.includes(langCode) ? (langCode as string).toUpperCase() : '';\n\n actions.openChatByUsername({ username: `${TIPS_USERNAME}${usernamePostfix}` });\n});\n\naddReducer('loadMoreChats', (global, actions, payload) => {\n const { listType = 'active' } = payload!;\n const listIds = global.chats.listIds[listType as ('active' | 'archived')];\n const isFullyLoaded = global.chats.isFullyLoaded[listType as ('active' | 'archived')];\n\n if (isFullyLoaded) {\n return;\n }\n\n const oldestChat = listIds\n ? listIds\n .map((id) => global.chats.byId[id])\n .filter((chat) => Boolean(chat?.lastMessage) && !selectIsChatPinned(global, chat.id))\n .sort((chat1, chat2) => (chat1.lastMessage!.date - chat2.lastMessage!.date))[0]\n : undefined;\n\n if (oldestChat) {\n runThrottledForLoadChats(() => loadChats(listType, oldestChat.id, oldestChat.lastMessage!.date));\n } else {\n runThrottledForLoadChats(() => loadChats(listType));\n }\n});\n\naddReducer('loadFullChat', (global, actions, payload) => {\n const { chatId, force } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n if (force) {\n loadFullChat(chat);\n } else {\n runDebouncedForLoadFullChat(() => loadFullChat(chat));\n }\n});\n\naddReducer('loadTopChats', () => {\n runThrottledForLoadTopChats(() => loadChats('active'));\n});\n\naddReducer('requestChatUpdate', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n void callApi('requestChatUpdate', {\n chat,\n serverTimeOffset,\n });\n});\n\naddReducer('updateChatMutedState', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const { chatId, isMuted } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n setGlobal(updateChat(global, chatId, { isMuted }));\n void callApi('updateChatMutedState', { chat, isMuted, serverTimeOffset });\n});\n\naddReducer('createChannel', (global, actions, payload) => {\n const {\n title, about, photo, memberIds,\n } = payload!;\n\n const members = (memberIds as number[])\n .map((id: number) => selectUser(global, id))\n .filter(Boolean as any);\n\n void createChannel(title, members, about, photo);\n});\n\naddReducer('joinChannel', (global, actions, payload) => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n const { id: channelId, accessHash } = chat;\n\n if (channelId && accessHash) {\n void callApi('joinChannel', { channelId, accessHash });\n }\n});\n\naddReducer('deleteChatUser', (global, actions, payload) => {\n (async () => {\n const { chatId, userId } : { chatId: number; userId: number } = payload!;\n const chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n if (!chat || !user) {\n return;\n }\n await callApi('deleteChatUser', { chat, user });\n\n const activeChat = selectCurrentMessageList(global);\n if (activeChat && activeChat.chatId === chatId && global.currentUserId === userId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('deleteChat', (global, actions, payload) => {\n (async () => {\n const { chatId } : { chatId: number } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n await callApi('deleteChat', { chatId: chat.id });\n\n const activeChat = selectCurrentMessageList(global);\n if (activeChat && activeChat.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('leaveChannel', (global, actions, payload) => {\n (async () => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n const { id: channelId, accessHash } = chat;\n\n if (channelId && accessHash) {\n await callApi('leaveChannel', { channelId, accessHash });\n }\n\n const activeChannel = selectCurrentMessageList(global);\n if (activeChannel && activeChannel.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('deleteChannel', (global, actions, payload) => {\n (async () => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n const { id: channelId, accessHash } = chat;\n\n if (channelId && accessHash) {\n await callApi('deleteChannel', { channelId, accessHash });\n }\n\n const activeChannel = selectCurrentMessageList(global);\n if (activeChannel && activeChannel.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('createGroupChat', (global, actions, payload) => {\n const { title, memberIds, photo } = payload!;\n const members = (memberIds as number[])\n .map((id: number) => selectUser(global, id))\n .filter(Boolean as any);\n\n void createGroupChat(title, members, photo);\n});\n\naddReducer('toggleChatPinned', (global, actions, payload) => {\n const { id, folderId } = payload!;\n const chat = selectChat(global, id);\n if (!chat) {\n return;\n }\n\n if (folderId) {\n const folder = selectChatFolder(global, folderId);\n if (folder) {\n const shouldBePinned = !selectIsChatPinned(global, id, folderId);\n\n const { pinnedChatIds, includedChatIds } = folder;\n const newPinnedIds = shouldBePinned\n ? [id, ...(pinnedChatIds || [])]\n : (pinnedChatIds || []).filter((pinnedId) => pinnedId !== id);\n\n // With both Pin and Unpin we need to re-add a user to the included group\n const newIncludedChatIds = [id, ...includedChatIds];\n\n void callApi('editChatFolder', {\n id: folderId,\n folderUpdate: {\n ...folder,\n pinnedChatIds: newPinnedIds,\n includedChatIds: newIncludedChatIds,\n },\n });\n }\n } else {\n const listType = selectChatListType(global, id);\n const isPinned = selectIsChatPinned(global, id, listType === 'archived' ? ARCHIVED_FOLDER_ID : undefined);\n void callApi('toggleChatPinned', { chat, shouldBePinned: !isPinned });\n }\n});\n\naddReducer('toggleChatArchived', (global, actions, payload) => {\n const { id } = payload!;\n const chat = selectChat(global, id);\n if (chat) {\n void callApi('toggleChatArchived', {\n chat,\n folderId: isChatArchived(chat) ? 0 : ARCHIVED_FOLDER_ID,\n });\n }\n});\n\naddReducer('loadChatFolders', () => {\n void loadChatFolders();\n});\n\naddReducer('loadRecommendedChatFolders', () => {\n void loadRecommendedChatFolders();\n});\n\naddReducer('editChatFolder', (global, actions, payload) => {\n const { id, folderUpdate } = payload!;\n const folder = selectChatFolder(global, id);\n\n if (folder) {\n void callApi('editChatFolder', {\n id,\n folderUpdate: {\n id,\n emoticon: folder.emoticon,\n pinnedChatIds: folder.pinnedChatIds,\n ...folderUpdate,\n },\n });\n }\n});\n\naddReducer('addChatFolder', (global, actions, payload) => {\n const { folder } = payload!;\n const { orderedIds } = global.chatFolders;\n const maxId = orderedIds?.length ? Math.max.apply(Math.max, orderedIds) : ARCHIVED_FOLDER_ID;\n\n void createChatFolder(folder, maxId);\n});\n\naddReducer('deleteChatFolder', (global, actions, payload) => {\n const { id } = payload!;\n const folder = selectChatFolder(global, id);\n\n if (folder) {\n void deleteChatFolder(id);\n }\n});\n\naddReducer('toggleChatUnread', (global, actions, payload) => {\n const { id } = payload!;\n const { serverTimeOffset } = global;\n const chat = selectChat(global, id);\n if (chat) {\n if (chat.unreadCount) {\n void callApi('markMessageListRead', { serverTimeOffset, chat, threadId: MAIN_THREAD_ID });\n } else {\n void callApi('toggleDialogUnread', {\n chat,\n hasUnreadMark: !chat.hasUnreadMark,\n });\n }\n }\n});\n\naddReducer('openTelegramLink', (global, actions, payload) => {\n const { url } = payload!;\n let match = RE_TME_INVITE_LINK.exec(url);\n\n if (match) {\n const hash = match[1];\n\n (async () => {\n const result = await callApi('openChatByInvite', hash);\n if (!result) {\n return;\n }\n\n actions.openChat({ id: result.chatId });\n })();\n } else {\n match = RE_TME_LINK.exec(url)!;\n\n const username = match[1];\n const chatOrChannelPostId = match[2] ? Number(match[2]) : undefined;\n const messageId = match[3] ? Number(match[3]) : undefined;\n\n // Open message in private chat\n if (username === 'c' && chatOrChannelPostId && messageId) {\n actions.focusMessage({ chatId: -chatOrChannelPostId, messageId });\n } else {\n void openChatByUsername(actions, username, chatOrChannelPostId);\n }\n }\n});\n\naddReducer('acceptInviteConfirmation', (global, actions, payload) => {\n const { hash } = payload!;\n (async () => {\n const result = await callApi('importChatInvite', { hash });\n if (!result) {\n return;\n }\n\n actions.openChat({ id: result.id });\n })();\n});\n\naddReducer('openChatByUsername', (global, actions, payload) => {\n const { username } = payload!;\n\n void openChatByUsername(actions, username);\n});\n\naddReducer('togglePreHistoryHidden', (global, actions, payload) => {\n const { chatId, isEnabled } = payload!;\n let chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n void callApi('togglePreHistoryHidden', { chat, isEnabled });\n })();\n});\n\naddReducer('updateChatDefaultBannedRights', (global, actions, payload) => {\n const { chatId, bannedRights } = payload!;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('updateChatDefaultBannedRights', { chat, bannedRights });\n});\n\naddReducer('updateChatMemberBannedRights', (global, actions, payload) => {\n const { chatId, userId, bannedRights } = payload!;\n let chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n\n if (!chat || !user) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n await callApi('updateChatMemberBannedRights', { chat, user, bannedRights });\n\n const newGlobal = getGlobal();\n const chatAfterUpdate = selectChat(newGlobal, chatId);\n\n if (!chatAfterUpdate || !chatAfterUpdate.fullInfo) {\n return;\n }\n\n const { members, kickedMembers } = chatAfterUpdate.fullInfo;\n\n const isBanned = !!bannedRights.viewMessages;\n const isUnblocked = !Object.keys(bannedRights).length;\n\n setGlobal(updateChat(newGlobal, chatId, {\n fullInfo: {\n ...chatAfterUpdate.fullInfo,\n ...(members && isBanned && {\n members: members.filter((m) => m.userId !== userId),\n }),\n ...(members && !isBanned && {\n members: members.map((m) => (\n m.userId === userId\n ? { ...m, bannedRights }\n : m\n )),\n }),\n ...(isUnblocked && kickedMembers && {\n kickedMembers: kickedMembers.filter((m) => m.userId !== userId),\n }),\n },\n }));\n })();\n});\n\naddReducer('updateChatAdmin', (global, actions, payload) => {\n const {\n chatId, userId, adminRights, customTitle,\n } = payload!;\n let chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n\n if (!chat || !user) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n await callApi('updateChatAdmin', {\n chat, user, adminRights, customTitle,\n });\n\n const newGlobal = getGlobal();\n const chatAfterUpdate = selectChat(newGlobal, chatId);\n\n if (!chatAfterUpdate || !chatAfterUpdate.fullInfo) {\n return;\n }\n\n const { adminMembers } = chatAfterUpdate.fullInfo;\n\n const isDismissed = !Object.keys(adminRights).length;\n\n setGlobal(updateChat(newGlobal, chatId, {\n fullInfo: {\n ...chatAfterUpdate.fullInfo,\n ...(adminMembers && isDismissed && {\n adminMembers: adminMembers.filter((m) => m.userId !== userId),\n }),\n ...(adminMembers && !isDismissed && {\n adminMembers: adminMembers.map((m) => (\n m.userId === userId\n ? { ...m, adminRights, customTitle }\n : m\n )),\n }),\n },\n }));\n })();\n});\n\naddReducer('updateChat', (global, actions, payload) => {\n const {\n chatId, title, about, photo,\n } = payload!;\n\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n (async () => {\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.InProgress));\n\n await Promise.all([\n chat.title !== title\n ? callApi('updateChatTitle', chat, title)\n : undefined,\n chat.fullInfo && chat.fullInfo.about !== about\n ? callApi('updateChatAbout', chat, about)\n : undefined,\n photo\n ? callApi('editChatPhoto', { chatId, accessHash: chat.accessHash, photo })\n : undefined,\n ]);\n\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.Complete));\n })();\n});\n\naddReducer('toggleSignatures', (global, actions, payload) => {\n const { chatId, isEnabled } = payload!;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('toggleSignatures', { chat, isEnabled });\n});\n\naddReducer('loadGroupsForDiscussion', () => {\n (async () => {\n const groups = await callApi('fetchGroupsForDiscussion');\n if (!groups) {\n return;\n }\n\n const addedById = groups.reduce((result, group) => {\n if (group) {\n result[group.id] = group;\n }\n\n return result;\n }, {} as Record);\n\n const global = addChats(getGlobal(), addedById);\n setGlobal({\n ...global,\n chats: {\n ...global.chats,\n forDiscussionIds: Object.keys(addedById).map(Number),\n },\n });\n })();\n});\n\naddReducer('linkDiscussionGroup', (global, actions, payload) => {\n const { channelId, chatId } = payload!;\n\n const channel = selectChat(global, channelId);\n let chat = selectChat(global, chatId);\n if (!channel || !chat) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n let { fullInfo } = chat;\n if (!fullInfo) {\n const fullChat = await callApi('fetchFullChat', chat);\n if (!fullChat) {\n return;\n }\n\n fullInfo = fullChat.fullInfo;\n }\n\n if (fullInfo.isPreHistoryHidden) {\n await callApi('togglePreHistoryHidden', { chat, isEnabled: false });\n }\n\n void callApi('setDiscussionGroup', { channel, chat });\n })();\n});\n\naddReducer('unlinkDiscussionGroup', (global, actions, payload) => {\n const { channelId } = payload!;\n\n const channel = selectChat(global, channelId);\n if (!channel) {\n return;\n }\n\n let chat: ApiChat | undefined;\n if (channel.fullInfo?.linkedChatId) {\n chat = selectChat(global, channel.fullInfo.linkedChatId);\n }\n\n (async () => {\n await callApi('setDiscussionGroup', { channel });\n if (chat) {\n loadFullChat(chat);\n }\n })();\n});\n\naddReducer('setActiveChatFolder', (global, actions, payload) => {\n return {\n ...global,\n chatFolders: {\n ...global.chatFolders,\n activeChatFolder: payload,\n },\n };\n});\n\naddReducer('loadMoreMembers', (global) => {\n (async () => {\n const { chatId } = selectCurrentMessageList(global) || {};\n const chat = chatId ? selectChat(global, chatId) : undefined;\n if (!chat || isChatBasicGroup(chat)) {\n return;\n }\n\n const offset = (chat.fullInfo?.members?.length) || undefined;\n const result = await callApi('fetchMembers', chat.id, chat.accessHash!, 'recent', offset);\n if (!result) {\n return;\n }\n\n const { members, users } = result;\n if (!members || !members.length) {\n return;\n }\n\n global = getGlobal();\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = updateChat(global, chat.id, {\n fullInfo: {\n ...chat.fullInfo,\n members: [\n ...((chat.fullInfo || {}).members || []),\n ...(members || []),\n ],\n },\n });\n setGlobal(global);\n })();\n});\n\naddReducer('addChatMembers', (global, actions, payload) => {\n const { chatId, memberIds } = payload;\n const chat = selectChat(global, chatId);\n const users = (memberIds as number[]).map((userId) => selectUser(global, userId)).filter(Boolean as any);\n\n if (!chat || !users.length) {\n return;\n }\n\n actions.setNewChatMembersDialogState(NewChatMembersProgress.Loading);\n (async () => {\n await callApi('addChatMembers', chat, users);\n actions.setNewChatMembersDialogState(NewChatMembersProgress.Closed);\n loadFullChat(chat);\n })();\n});\n\naddReducer('deleteChatMember', (global, actions, payload) => {\n const { chatId, userId } = payload;\n const chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n\n if (!chat || !user) {\n return;\n }\n\n (async () => {\n await callApi('deleteChatMember', chat, user);\n loadFullChat(chat);\n })();\n});\n\nasync function loadChats(listType: 'active' | 'archived', offsetId?: number, offsetDate?: number) {\n const result = await callApi('fetchChats', {\n limit: CHAT_LIST_LOAD_SLICE,\n offsetDate,\n archived: listType === 'archived',\n withPinned: getGlobal().chats.orderedPinnedIds[listType] === undefined,\n serverTimeOffset: getGlobal().serverTimeOffset,\n });\n\n if (!result) {\n return;\n }\n\n const { chatIds } = result;\n\n if (chatIds.length > 0 && chatIds[0] === offsetId) {\n chatIds.shift();\n }\n\n let global = getGlobal();\n\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = updateChatListIds(global, listType, chatIds);\n global = updateChatListSecondaryInfo(global, listType, result);\n\n Object.keys(result.draftsById).map(Number).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'draft', result.draftsById[chatId],\n );\n });\n\n Object.keys(result.replyingToById).map(Number).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'replyingToId', result.replyingToById[chatId],\n );\n });\n\n if (chatIds.length === 0 && !global.chats.isFullyLoaded[listType]) {\n global = {\n ...global,\n chats: {\n ...global.chats,\n isFullyLoaded: {\n ...global.chats.isFullyLoaded,\n [listType]: true,\n },\n },\n };\n }\n\n setGlobal(global);\n}\n\nasync function loadFullChat(chat: ApiChat) {\n const result = await callApi('fetchFullChat', chat);\n if (!result) {\n return;\n }\n\n const { users, fullInfo } = result;\n\n let global = getGlobal();\n if (users) {\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n }\n global = updateChat(global, chat.id, { fullInfo });\n\n setGlobal(global);\n}\n\nasync function createChannel(title: string, users: ApiUser[], about?: string, photo?: File) {\n setGlobal({\n ...getGlobal(),\n chatCreation: {\n progress: ChatCreationProgress.InProgress,\n },\n });\n\n const createdChannel = await callApi('createChannel', { title, about, users });\n if (!createdChannel) {\n return;\n }\n\n const { id: channelId, accessHash } = createdChannel;\n\n let global = getGlobal();\n global = updateChat(global, channelId, createdChannel);\n global = {\n ...global,\n chatCreation: {\n ...global.chatCreation,\n progress: createdChannel ? ChatCreationProgress.Complete : ChatCreationProgress.Error,\n },\n };\n setGlobal(global);\n getDispatch().openChat({ id: channelId });\n\n if (channelId && accessHash && photo) {\n await callApi('editChatPhoto', { chatId: channelId, accessHash, photo });\n }\n}\n\nasync function createGroupChat(title: string, users: ApiUser[], photo?: File) {\n setGlobal({\n ...getGlobal(),\n chatCreation: {\n progress: ChatCreationProgress.InProgress,\n },\n });\n\n const createdChat = await callApi('createGroupChat', { title, users });\n if (!createdChat) {\n return;\n }\n\n const { id: chatId } = createdChat;\n\n let global = getGlobal();\n global = updateChat(global, chatId, createdChat);\n global = {\n ...global,\n chatCreation: {\n ...global.chatCreation,\n progress: createdChat ? ChatCreationProgress.Complete : ChatCreationProgress.Error,\n },\n };\n setGlobal(global);\n getDispatch().openChat({ id: chatId });\n\n if (chatId && photo) {\n await callApi('editChatPhoto', { chatId, photo });\n }\n}\n\nasync function loadChatFolders() {\n const chatFolders = await callApi('fetchChatFolders');\n\n if (chatFolders) {\n const global = getGlobal();\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n ...chatFolders,\n },\n });\n }\n}\n\nasync function loadRecommendedChatFolders() {\n const recommendedChatFolders = await callApi('fetchRecommendedChatFolders');\n\n if (recommendedChatFolders) {\n const global = getGlobal();\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n recommended: recommendedChatFolders,\n },\n });\n }\n}\n\nasync function createChatFolder(folder: ApiChatFolder, maxId: number) {\n // Clear fields from recommended folders\n const { id: recommendedId, description, ...newFolder } = folder;\n\n await callApi('editChatFolder', {\n id: maxId + 1,\n folderUpdate: {\n id: maxId + 1,\n ...newFolder,\n },\n });\n\n if (!description) {\n return;\n }\n\n const global = getGlobal();\n const { recommended } = global.chatFolders;\n\n if (recommended) {\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n recommended: recommended.filter(({ id }) => id !== recommendedId),\n },\n });\n }\n}\n\nasync function deleteChatFolder(id: number) {\n await callApi('deleteChatFolder', id);\n}\n\nasync function openChatByUsername(\n actions: GlobalActions,\n username: string,\n channelPostId?: number,\n) {\n const global = getGlobal();\n const localChat = selectChatByUsername(global, username);\n if (localChat && !localChat.isMin) {\n if (channelPostId) {\n actions.focusMessage({ chatId: localChat.id, messageId: channelPostId });\n } else {\n actions.openChat({ id: localChat.id });\n }\n return;\n }\n\n const previousChat = selectCurrentChat(global);\n // Open temporary empty chat to make the click response feel faster\n actions.openChat({ id: TMP_CHAT_ID });\n\n const chat = await callApi('getChatByUsername', username);\n if (!chat) {\n if (previousChat) {\n actions.openChat({ id: previousChat.id });\n }\n\n actions.showNotification({ message: 'User does not exist' });\n\n return;\n }\n\n setGlobal(updateChat(getGlobal(), chat.id, chat));\n\n if (channelPostId) {\n actions.focusMessage({ chatId: chat.id, messageId: channelPostId });\n } else {\n actions.openChat({ id: chat.id });\n }\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport {\n ApiAttachment,\n ApiChat,\n ApiMessage,\n ApiMessageEntity,\n ApiNewPoll,\n ApiOnProgress,\n ApiSticker,\n ApiVideo,\n MAIN_THREAD_ID,\n MESSAGE_DELETED,\n} from '../../../api/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { MAX_MEDIA_FILES_FOR_ALBUM, MESSAGE_LIST_SLICE } from '../../../config';\nimport { callApi, cancelApiProgress } from '../../../api/gramjs';\nimport { areSortedArraysIntersecting, buildCollectionByKey, split } from '../../../util/iteratees';\nimport {\n addUsers,\n addChatMessagesById,\n replaceThreadParam,\n safeReplaceViewportIds,\n updateChatMessage,\n addChats,\n updateListedIds,\n updateOutlyingIds,\n replaceScheduledMessages,\n updateThreadInfos,\n updateChat,\n updateThreadUnreadFromForwardedMessage,\n} from '../../reducers';\nimport {\n selectChat,\n selectChatMessage,\n selectCurrentMessageList,\n selectFocusedMessageId,\n selectCurrentChat,\n selectListedIds,\n selectOutlyingIds,\n selectViewportIds,\n selectRealLastReadId,\n selectReplyingToId,\n selectEditingId,\n selectDraft,\n selectThreadOriginChat,\n selectThreadTopMessageId,\n selectEditingScheduledId,\n selectEditingMessage,\n selectScheduledMessage,\n selectNoWebPage,\n selectFirstUnreadId,\n} from '../../selectors';\nimport { debounce, rafPromise } from '../../../util/schedulers';\nimport { IS_IOS } from '../../../util/environment';\n\nconst uploadProgressCallbacks = new Map();\n\nconst runDebouncedForMarkRead = debounce((cb) => cb(), 500, false);\n\naddReducer('loadViewportMessages', (global, actions, payload) => {\n const {\n direction = LoadMoreDirection.Around,\n isBudgetPreload = false,\n } = payload || {};\n\n let { chatId, threadId } = payload || {};\n\n if (!chatId) {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n chatId = currentMessageList.chatId;\n threadId = currentMessageList.threadId;\n }\n\n const chat = selectChat(global, chatId);\n // TODO Revise if `chat.isRestricted` check is needed\n if (!chat || chat.isRestricted) {\n return undefined;\n }\n\n const viewportIds = selectViewportIds(global, chatId, threadId);\n const listedIds = selectListedIds(global, chatId, threadId);\n const outlyingIds = selectOutlyingIds(global, chatId, threadId);\n\n if (!viewportIds || !viewportIds.length || direction === LoadMoreDirection.Around) {\n const offsetId = selectFocusedMessageId(global, chatId) || selectRealLastReadId(global, chatId, threadId);\n const isOutlying = Boolean(offsetId && listedIds && !listedIds.includes(offsetId));\n const historyIds = (isOutlying ? outlyingIds : listedIds) || [];\n const {\n newViewportIds, areSomeLocal, areAllLocal,\n } = getViewportSlice(historyIds, offsetId, LoadMoreDirection.Around);\n\n if (areSomeLocal && newViewportIds.length >= MESSAGE_LIST_SLICE) {\n global = safeReplaceViewportIds(global, chatId, threadId, newViewportIds);\n }\n\n if (!areAllLocal) {\n void loadViewportMessages(chat, threadId, offsetId, LoadMoreDirection.Around, isOutlying, isBudgetPreload);\n }\n } else {\n const offsetId = direction === LoadMoreDirection.Backwards ? viewportIds[0] : viewportIds[viewportIds.length - 1];\n const isOutlying = Boolean(outlyingIds);\n const historyIds = (isOutlying ? outlyingIds : listedIds)!;\n const {\n newViewportIds, areSomeLocal, areAllLocal,\n } = getViewportSlice(historyIds, offsetId, direction);\n\n if (areSomeLocal) {\n global = safeReplaceViewportIds(global, chatId, threadId, newViewportIds);\n }\n\n void loadWithBudget(actions, areAllLocal, isOutlying, isBudgetPreload, chat, threadId, direction, offsetId);\n\n if (isBudgetPreload) {\n return undefined;\n }\n }\n\n return global;\n});\n\nasync function loadWithBudget(\n actions: GlobalActions,\n areAllLocal: boolean, isOutlying: boolean, isBudgetPreload: boolean,\n chat: ApiChat, threadId: number, direction: LoadMoreDirection, offsetId?: number,\n) {\n if (!areAllLocal) {\n await loadViewportMessages(\n chat, threadId, offsetId, direction, isOutlying, isBudgetPreload,\n );\n }\n\n if (!isBudgetPreload) {\n // Let reducer return and update global\n await Promise.resolve();\n actions.loadViewportMessages({\n chatId: chat.id, threadId, direction, isBudgetPreload: true,\n });\n }\n}\n\naddReducer('loadMessage', (global, actions, payload) => {\n const {\n chatId, messageId, replyOriginForId, threadUpdate,\n } = payload!;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n (async () => {\n const message = await loadMessage(chat, messageId, replyOriginForId);\n if (message && threadUpdate) {\n const { lastMessageId, isDeleting } = threadUpdate;\n\n setGlobal(updateThreadUnreadFromForwardedMessage(\n getGlobal(),\n message,\n chatId,\n lastMessageId,\n isDeleting,\n ));\n }\n })();\n});\n\naddReducer('sendMessage', (global, actions, payload) => {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n const { chatId, threadId, type } = currentMessageList;\n\n if (type === 'scheduled' && !payload.scheduledAt) {\n return {\n ...global,\n messages: {\n ...global.messages,\n contentToBeScheduled: payload,\n },\n };\n }\n\n const chat = selectChat(global, chatId)!;\n\n actions.setReplyingToId({ messageId: undefined });\n actions.clearWebPagePreview({ chatId, threadId, value: false });\n\n const params = {\n ...payload,\n chat,\n replyingTo: selectReplyingToId(global, chatId, threadId),\n noWebPage: selectNoWebPage(global, chatId, threadId),\n };\n\n const isSingle = !payload.attachments || payload.attachments.length <= 1;\n const isGrouped = !isSingle && payload.attachments && payload.attachments.length > 1;\n\n if (isSingle) {\n const { attachments, ...restParams } = params;\n sendMessage({\n ...restParams,\n attachment: attachments ? attachments[0] : undefined,\n });\n } else if (isGrouped) {\n const {\n text, entities, attachments, ...commonParams\n } = params;\n const groupedAttachments = split(attachments, MAX_MEDIA_FILES_FOR_ALBUM);\n for (let i = 0; i < groupedAttachments.length; i++) {\n const [firstAttachment, ...restAttachments] = groupedAttachments[i];\n const groupedId = `${Date.now()}${i}`;\n\n sendMessage({\n ...commonParams,\n text: i === 0 ? text : undefined,\n entities: i === 0 ? entities : undefined,\n attachment: firstAttachment,\n groupedId: restAttachments.length > 0 ? groupedId : undefined,\n });\n\n restAttachments.forEach((attachment: ApiAttachment) => {\n sendMessage({\n ...commonParams,\n attachment,\n groupedId,\n });\n });\n }\n } else {\n const {\n text, entities, attachments, replyingTo, ...commonParams\n } = params;\n\n if (text) {\n sendMessage({\n ...commonParams,\n text,\n entities,\n replyingTo,\n });\n }\n\n attachments.forEach((attachment: ApiAttachment) => {\n sendMessage({\n ...commonParams,\n attachment,\n });\n });\n }\n\n return undefined;\n});\n\naddReducer('editMessage', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const { text, entities } = payload!;\n\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId, threadId, type: messageListType } = currentMessageList;\n const chat = selectChat(global, chatId);\n const message = selectEditingMessage(global, chatId, threadId, messageListType);\n if (!chat || !message) {\n return;\n }\n\n void callApi('editMessage', {\n chat, message, text, entities, noWebPage: selectNoWebPage(global, chatId, threadId), serverTimeOffset,\n });\n\n actions.setEditingId({ messageId: undefined });\n});\n\naddReducer('cancelSendingMessage', (global, actions, payload) => {\n const { chatId, messageId } = payload!;\n const message = selectChatMessage(global, chatId, messageId);\n const progressCallback = message && uploadProgressCallbacks.get(message.previousLocalId || message.id);\n if (progressCallback) {\n cancelApiProgress(progressCallback);\n }\n\n actions.apiUpdate({\n '@type': 'deleteMessages',\n ids: [messageId],\n chatId,\n });\n});\n\naddReducer('saveDraft', (global, actions, payload) => {\n const { chatId, threadId, draft } = payload!;\n if (!draft) {\n return undefined;\n }\n\n const { text, entities } = draft;\n const chat = selectChat(global, chatId)!;\n\n if (threadId === MAIN_THREAD_ID) {\n void callApi('saveDraft', {\n chat,\n text,\n entities,\n replyToMsgId: selectReplyingToId(global, chatId, threadId),\n });\n }\n\n global = replaceThreadParam(global, chatId, threadId, 'draft', draft);\n global = updateChat(global, chatId, { draftDate: Math.round(Date.now() / 1000) });\n\n return global;\n});\n\naddReducer('clearDraft', (global, actions, payload) => {\n const { chatId, threadId, localOnly } = payload!;\n if (!selectDraft(global, chatId, threadId)) {\n return undefined;\n }\n\n const chat = selectChat(global, chatId)!;\n\n if (!localOnly && threadId === MAIN_THREAD_ID) {\n void callApi('clearDraft', chat);\n }\n\n global = replaceThreadParam(global, chatId, threadId, 'draft', undefined);\n global = updateChat(global, chatId, { draftDate: undefined });\n\n return global;\n});\n\naddReducer('toggleMessageWebPage', (global, actions, payload) => {\n const { chatId, threadId, noWebPage } = payload!;\n\n return replaceThreadParam(global, chatId, threadId, 'noWebPage', noWebPage);\n});\n\naddReducer('pinMessage', (global, actions, payload) => {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return;\n }\n\n const {\n messageId, isUnpin, isOneSide, isSilent,\n } = payload!;\n\n void callApi('pinMessage', {\n chat, messageId, isUnpin, isOneSide, isSilent,\n });\n});\n\naddReducer('unpinAllMessages', (global, actions, payload) => {\n const chat = selectChat(global, payload.chatId);\n if (!chat) {\n return;\n }\n\n void unpinAllMessages(chat);\n});\n\nasync function unpinAllMessages(chat: ApiChat) {\n await callApi('unpinAllMessages', { chat });\n let global = getGlobal();\n global = replaceThreadParam(global, chat.id, MAIN_THREAD_ID, 'pinnedIds', []);\n setGlobal(global);\n}\n\naddReducer('deleteMessages', (global, actions, payload) => {\n const { messageIds, shouldDeleteForAll } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n const { chatId, threadId } = currentMessageList;\n const chat = selectChat(global, chatId)!;\n\n void callApi('deleteMessages', { chat, messageIds, shouldDeleteForAll });\n\n const editingId = selectEditingId(global, chatId, threadId);\n if (messageIds.includes(editingId)) {\n actions.setEditingId({ messageId: undefined });\n }\n});\n\naddReducer('deleteScheduledMessages', (global, actions, payload) => {\n const { messageIds } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId } = currentMessageList;\n const chat = selectChat(global, chatId)!;\n\n void callApi('deleteScheduledMessages', { chat, messageIds });\n\n const editingId = selectEditingScheduledId(global, chatId);\n if (messageIds.includes(editingId)) {\n actions.setEditingId({ messageId: undefined });\n }\n});\n\naddReducer('deleteHistory', (global, actions, payload) => {\n (async () => {\n const { chatId, shouldDeleteForAll } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n const maxId = chat.lastMessage?.id;\n\n await callApi('deleteHistory', { chat, shouldDeleteForAll, maxId });\n\n const activeChat = selectCurrentMessageList(global);\n if (activeChat && activeChat.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n })();\n});\n\naddReducer('reportMessages', (global, actions, payload) => {\n (async () => {\n const {\n messageIds, reason, description,\n } = payload!;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n\n const { chatId } = currentMessageList;\n const chat = selectChat(global, chatId)!;\n\n const result = await callApi('reportMessages', {\n peer: chat, messageIds, reason, description,\n });\n\n actions.showNotification({\n message: result\n ? 'Thank you! Your report will be reviewed by our team.'\n : 'Error occured while submiting report. Please, try again later.',\n });\n })();\n});\n\naddReducer('markMessageListRead', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return undefined;\n }\n\n const { chatId, threadId } = currentMessageList;\n const chat = selectThreadOriginChat(global, chatId, threadId);\n if (!chat) {\n return undefined;\n }\n\n const { maxId } = payload!;\n\n runDebouncedForMarkRead(() => {\n void callApi('markMessageListRead', {\n serverTimeOffset, chat, threadId, maxId,\n });\n });\n\n // TODO Support local marking read for threads\n if (threadId !== MAIN_THREAD_ID) {\n return undefined;\n }\n\n const viewportIds = selectViewportIds(global, chatId, threadId);\n const minId = selectFirstUnreadId(global, chatId, threadId);\n if (!viewportIds || !minId || !chat.unreadCount) {\n return undefined;\n }\n\n const readCount = countSortedIds(viewportIds!, minId, maxId);\n if (!readCount) {\n return undefined;\n }\n\n return updateChat(global, chatId, {\n lastReadInboxMessageId: maxId,\n unreadCount: Math.max(0, chat.unreadCount - readCount),\n });\n});\n\naddReducer('markMessagesRead', (global, actions, payload) => {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return;\n }\n\n const { messageIds } = payload!;\n\n void callApi('markMessagesRead', { chat, messageIds });\n});\n\naddReducer('loadWebPagePreview', (global, actions, payload) => {\n const { text } = payload!;\n void loadWebPagePreview(text);\n});\n\naddReducer('clearWebPagePreview', (global) => {\n if (!global.webPagePreview) {\n return undefined;\n }\n\n return {\n ...global,\n webPagePreview: undefined,\n };\n});\n\naddReducer('sendPollVote', (global, actions, payload) => {\n const { chatId, messageId, options } = payload!;\n const chat = selectChat(global, chatId);\n\n if (chat) {\n void callApi('sendPollVote', { chat, messageId, options });\n }\n});\n\naddReducer('loadPollOptionResults', (global, actions, payload) => {\n const {\n chat, messageId, option, offset, limit, shouldResetVoters,\n } = payload!;\n\n void loadPollOptionResults(chat, messageId, option, offset, limit, shouldResetVoters);\n});\n\naddReducer('forwardMessages', (global) => {\n const { fromChatId, messageIds, toChatId } = global.forwardMessages;\n const fromChat = fromChatId ? selectChat(global, fromChatId) : undefined;\n const toChat = toChatId ? selectChat(global, toChatId) : undefined;\n const messages = fromChatId && messageIds\n ? messageIds\n .sort((a, b) => a - b)\n .map((id) => selectChatMessage(global, fromChatId, id)).filter(Boolean as any)\n : undefined;\n\n if (fromChat && toChat && messages && messages.length) {\n void forwardMessages(fromChat, toChat, messages);\n }\n});\n\naddReducer('loadScheduledHistory', (global) => {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return;\n }\n\n const { hash } = global.scheduledMessages.byChatId[chat.id] || {};\n\n void loadScheduledHistory(chat, hash);\n});\n\naddReducer('sendScheduledMessages', (global, actions, payload) => {\n const {\n chatId, id,\n } = payload!;\n\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('sendScheduledMessages', {\n chat,\n ids: [id],\n });\n});\n\naddReducer('rescheduleMessage', (global, actions, payload) => {\n const {\n chatId, messageId, scheduledAt,\n } = payload!;\n\n const chat = selectChat(global, chatId);\n const message = chat && selectScheduledMessage(global, chat.id, messageId);\n if (!chat || !message) {\n return;\n }\n\n void callApi('rescheduleMessage', {\n chat,\n message,\n scheduledAt,\n });\n});\n\naddReducer('requestThreadInfoUpdate', (global, actions, payload) => {\n const { chatId, threadId } = payload;\n const chat = selectThreadOriginChat(global, chatId, threadId);\n if (!chat) {\n return;\n }\n\n void callApi('requestThreadInfoUpdate', { chat, threadId });\n});\n\nasync function loadWebPagePreview(message: string) {\n const webPagePreview = await callApi('fetchWebPagePreview', { message });\n\n setGlobal({\n ...getGlobal(),\n webPagePreview,\n });\n}\n\nasync function loadViewportMessages(\n chat: ApiChat,\n threadId: number,\n offsetId: number | undefined,\n direction: LoadMoreDirection,\n isOutlying = false,\n isBudgetPreload = false,\n) {\n const chatId = chat.id;\n\n let addOffset: number | undefined;\n switch (direction) {\n case LoadMoreDirection.Backwards:\n addOffset = undefined;\n break;\n case LoadMoreDirection.Around:\n addOffset = -(Math.round(MESSAGE_LIST_SLICE / 2) + 1);\n break;\n case LoadMoreDirection.Forwards:\n addOffset = -(MESSAGE_LIST_SLICE + 1);\n break;\n }\n\n const result = await callApi('fetchMessages', {\n chat: selectThreadOriginChat(getGlobal(), chatId, threadId)!,\n offsetId,\n addOffset,\n limit: MESSAGE_LIST_SLICE,\n threadId,\n });\n\n if (!result) {\n return;\n }\n\n const {\n messages, users, chats, threadInfos,\n } = result;\n\n const byId = buildCollectionByKey(messages, 'id');\n const ids = Object.keys(byId).map(Number);\n\n let global = getGlobal();\n\n global = addChatMessagesById(global, chatId, byId);\n global = isOutlying\n ? updateOutlyingIds(global, chatId, threadId, ids)\n : updateListedIds(global, chatId, threadId, ids);\n\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = addChats(global, buildCollectionByKey(chats, 'id'));\n global = updateThreadInfos(global, chatId, threadInfos);\n\n let listedIds = selectListedIds(global, chatId, threadId);\n const outlyingIds = selectOutlyingIds(global, chatId, threadId);\n\n if (isOutlying && listedIds && outlyingIds) {\n if (!outlyingIds.length || areSortedArraysIntersecting(listedIds, outlyingIds)) {\n global = updateListedIds(global, chatId, threadId, outlyingIds);\n listedIds = selectListedIds(global, chatId, threadId);\n global = replaceThreadParam(global, chatId, threadId, 'outlyingIds', undefined);\n isOutlying = false;\n }\n }\n\n if (!isBudgetPreload) {\n const historyIds = isOutlying ? outlyingIds! : listedIds!;\n const { newViewportIds } = getViewportSlice(historyIds, offsetId, direction);\n global = safeReplaceViewportIds(global, chatId, threadId, newViewportIds!);\n }\n\n setGlobal(global);\n}\n\nasync function loadMessage(chat: ApiChat, messageId: number, replyOriginForId: number) {\n const result = await callApi('fetchMessage', { chat, messageId });\n if (!result) {\n return undefined;\n }\n\n if (result === MESSAGE_DELETED) {\n if (replyOriginForId) {\n let global = getGlobal();\n const replyMessage = selectChatMessage(global, chat.id, replyOriginForId);\n global = updateChatMessage(global, chat.id, replyOriginForId, {\n ...replyMessage,\n replyToMessageId: undefined,\n });\n setGlobal(global);\n }\n\n return undefined;\n }\n\n let global = getGlobal();\n global = updateChatMessage(global, chat.id, messageId, result.message);\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n setGlobal(global);\n\n return result.message;\n}\n\nfunction findClosestIndex(sourceIds: number[], offsetId: number) {\n if (offsetId < sourceIds[0]) {\n return 0;\n }\n\n if (offsetId > sourceIds[sourceIds.length - 1]) {\n return sourceIds.length - 1;\n }\n\n return sourceIds.findIndex((id, i) => (\n id === offsetId\n || (id < offsetId && sourceIds[i + 1] > offsetId)\n ));\n}\n\nfunction getViewportSlice(\n sourceIds: number[],\n offsetId: number | undefined,\n direction: LoadMoreDirection,\n) {\n const { length } = sourceIds;\n const index = offsetId ? findClosestIndex(sourceIds, offsetId) : -1;\n const isBackwards = direction === LoadMoreDirection.Backwards;\n const indexForDirection = isBackwards ? index : (index + 1) || length;\n const from = indexForDirection - MESSAGE_LIST_SLICE;\n const to = indexForDirection + MESSAGE_LIST_SLICE - 1;\n const newViewportIds = sourceIds.slice(Math.max(0, from), to + 1);\n\n let areSomeLocal;\n let areAllLocal;\n switch (direction) {\n case LoadMoreDirection.Backwards:\n areSomeLocal = indexForDirection > 0;\n areAllLocal = from >= 0;\n break;\n case LoadMoreDirection.Forwards:\n areSomeLocal = indexForDirection < length;\n areAllLocal = to <= length - 1;\n break;\n case LoadMoreDirection.Around:\n default:\n areSomeLocal = newViewportIds.length > 0;\n areAllLocal = newViewportIds.length === MESSAGE_LIST_SLICE;\n break;\n }\n\n return { newViewportIds, areSomeLocal, areAllLocal };\n}\n\nasync function sendMessage(params: {\n chat: ApiChat;\n text: string;\n entities: ApiMessageEntity[];\n replyingTo: number;\n attachment: ApiAttachment;\n sticker: ApiSticker;\n gif: ApiVideo;\n poll: ApiNewPoll;\n serverTimeOffset?: number;\n}) {\n let localId: number | undefined;\n const progressCallback = params.attachment ? (progress: number, messageLocalId: number) => {\n if (!uploadProgressCallbacks.has(messageLocalId)) {\n localId = messageLocalId;\n uploadProgressCallbacks.set(messageLocalId, progressCallback!);\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n fileUploads: {\n byMessageLocalId: {\n ...global.fileUploads.byMessageLocalId,\n [messageLocalId]: { progress },\n },\n },\n });\n } : undefined;\n\n // @optimization\n if (params.replyingTo || IS_IOS) {\n await rafPromise();\n }\n\n const global = getGlobal();\n params.serverTimeOffset = global.serverTimeOffset;\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return;\n }\n const { threadId } = currentMessageList;\n\n if (!params.replyingTo && threadId !== MAIN_THREAD_ID) {\n params.replyingTo = selectThreadTopMessageId(global, params.chat.id, threadId)!;\n }\n\n await callApi('sendMessage', params, progressCallback);\n\n if (progressCallback && localId) {\n uploadProgressCallbacks.delete(localId);\n }\n}\n\nfunction forwardMessages(\n fromChat: ApiChat,\n toChat: ApiChat,\n messages: ApiMessage[],\n) {\n callApi('forwardMessages', {\n fromChat,\n toChat,\n messages,\n serverTimeOffset: getGlobal().serverTimeOffset,\n });\n\n setGlobal({\n ...getGlobal(),\n forwardMessages: {},\n });\n}\n\nasync function loadPollOptionResults(\n chat: ApiChat,\n messageId: number,\n option: string,\n offset?: string,\n limit?: number,\n shouldResetVoters?: boolean,\n) {\n const result = await callApi('loadPollOptionResults', {\n chat, messageId, option, offset, limit,\n });\n\n if (!result) {\n return;\n }\n\n const isUnique = (v: number, i: number, a: number[]) => a.indexOf(v) === i;\n let global = getGlobal();\n\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n const { voters } = global.pollResults;\n\n setGlobal({\n ...global,\n pollResults: {\n ...global.pollResults,\n voters: {\n ...voters,\n [option]: [\n ...(!shouldResetVoters && voters && voters[option] ? voters[option] : []),\n ...(result && result.users.map((user) => user.id)),\n ].filter(isUnique),\n },\n offsets: {\n ...(global.pollResults.offsets ? global.pollResults.offsets : {}),\n [option]: result.nextOffset || '',\n },\n },\n });\n}\n\naddReducer('loadPinnedMessages', (global, actions, payload) => {\n const { chatId } = payload;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n void loadPinnedMessages(chat);\n});\n\nasync function loadPinnedMessages(chat: ApiChat) {\n const result = await callApi('fetchPinnedMessages', { chat });\n if (!result) {\n return;\n }\n\n const { messages, chats, users } = result;\n\n const byId = buildCollectionByKey(messages, 'id');\n const ids = Object.keys(byId).map(Number).sort((a, b) => b - a);\n\n let global = getGlobal();\n global = addChatMessagesById(global, chat.id, byId);\n global = replaceThreadParam(global, chat.id, MAIN_THREAD_ID, 'pinnedIds', ids);\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = addChats(global, buildCollectionByKey(chats, 'id'));\n setGlobal(global);\n}\n\nasync function loadScheduledHistory(chat: ApiChat, historyHash?: number) {\n const result = await callApi('fetchScheduledHistory', { chat, hash: historyHash });\n if (!result) {\n return;\n }\n\n const { hash, messages } = result;\n\n const byId = buildCollectionByKey(messages, 'id');\n const ids = Object.keys(byId).map(Number).sort((a, b) => b - a);\n\n let global = getGlobal();\n global = replaceScheduledMessages(global, chat.id, byId, hash);\n global = replaceThreadParam(global, chat.id, MAIN_THREAD_ID, 'scheduledIds', ids);\n setGlobal(global);\n}\n\nfunction countSortedIds(ids: number[], from: number, to: number) {\n let count = 0;\n\n for (let i = 0, l = ids.length; i < l; i++) {\n if (ids[i] >= from && ids[i] <= to) {\n count++;\n }\n\n if (ids[i] >= to) {\n break;\n }\n }\n\n return count;\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../api/types';\nimport { LangCode } from '../../../types';\nimport { callApi } from '../../../api/gramjs';\nimport { pause, throttle } from '../../../util/schedulers';\nimport {\n updateStickerSets,\n updateStickerSet,\n replaceAnimatedEmojis,\n updateGifSearch,\n updateStickersForEmoji,\n rebuildStickersForEmoji,\n} from '../../reducers';\nimport searchWords from '../../../util/searchWords';\nimport { selectStickerSet } from '../../selectors';\n\nconst ADDED_SETS_THROTTLE = 500;\nconst ADDED_SETS_THROTTLE_CHUNK = 50;\n\nconst searchThrottled = throttle((cb) => cb(), 500, false);\n\naddReducer('loadStickerSets', (global) => {\n const { hash } = global.stickers.added || {};\n void loadStickerSets(hash);\n});\n\naddReducer('loadAddedStickers', (global, actions) => {\n const { setIds: addedSetIds } = global.stickers.added;\n if (!addedSetIds || !addedSetIds.length) {\n return;\n }\n\n (async () => {\n for (let i = 0; i < addedSetIds.length; i++) {\n actions.loadStickers({ stickerSetId: addedSetIds[i] });\n\n if (i % ADDED_SETS_THROTTLE_CHUNK === 0 && i > 0) {\n await pause(ADDED_SETS_THROTTLE);\n }\n }\n })();\n});\n\naddReducer('loadRecentStickers', (global) => {\n const { hash } = global.stickers.recent || {};\n void loadRecentStickers(hash);\n});\n\naddReducer('loadFavoriteStickers', (global) => {\n const { hash } = global.stickers.favorite || {};\n void loadFavoriteStickers(hash);\n});\n\naddReducer('loadGreetingStickers', (global) => {\n const { hash } = global.stickers.greeting || {};\n\n (async () => {\n const greeting = await callApi('fetchStickersForEmoji', { emoji: '👋⭐️', hash });\n\n if (!greeting) {\n return;\n }\n\n const newGlobal = getGlobal();\n\n setGlobal({\n ...newGlobal,\n stickers: {\n ...newGlobal.stickers,\n greeting: {\n hash: greeting.hash,\n stickers: greeting.stickers.filter((sticker) => sticker.emoji === '👋'),\n },\n },\n });\n })();\n});\n\naddReducer('loadFeaturedStickers', (global) => {\n const { hash } = global.stickers.featured || {};\n void loadFeaturedStickers(hash);\n});\n\naddReducer('loadStickers', (global, actions, payload) => {\n const { stickerSetId, stickerSetShortName } = payload!;\n let { stickerSetAccessHash } = payload!;\n\n if (!stickerSetAccessHash && !stickerSetShortName) {\n const stickerSet = selectStickerSet(global, stickerSetId);\n if (!stickerSet) {\n return;\n }\n\n stickerSetAccessHash = stickerSet.accessHash;\n }\n\n void loadStickers(stickerSetId, stickerSetAccessHash, stickerSetShortName);\n});\n\naddReducer('loadAnimatedEmojis', () => {\n void loadAnimatedEmojis();\n});\n\naddReducer('loadSavedGifs', (global) => {\n const { hash } = global.gifs.saved;\n void loadSavedGifs(hash);\n});\n\naddReducer('faveSticker', (global, actions, payload) => {\n const { sticker } = payload!;\n\n if (sticker) {\n void callApi('faveSticker', { sticker });\n }\n});\n\naddReducer('unfaveSticker', (global, actions, payload) => {\n const { sticker } = payload!;\n\n if (sticker) {\n void unfaveSticker(sticker);\n }\n});\n\naddReducer('toggleStickerSet', (global, actions, payload) => {\n const { stickerSetId } = payload!;\n const stickerSet = selectStickerSet(global, stickerSetId);\n if (!stickerSet) {\n return;\n }\n\n const { accessHash, installedDate } = stickerSet;\n\n void callApi(!installedDate ? 'installStickerSet' : 'uninstallStickerSet', { stickerSetId, accessHash });\n});\n\naddReducer('loadEmojiKeywords', (global, actions, payload: { language: LangCode }) => {\n const { language } = payload;\n\n let currentEmojiKeywords = global.emojiKeywords[language];\n if (currentEmojiKeywords?.isLoading) {\n return;\n }\n\n setGlobal({\n ...global,\n emojiKeywords: {\n ...global.emojiKeywords,\n [language]: {\n ...currentEmojiKeywords,\n isLoading: true,\n },\n },\n });\n\n (async () => {\n const emojiKeywords = await callApi('fetchEmojiKeywords', {\n language,\n fromVersion: currentEmojiKeywords ? currentEmojiKeywords.version : 0,\n });\n\n global = getGlobal();\n currentEmojiKeywords = global.emojiKeywords[language];\n\n if (!emojiKeywords) {\n setGlobal({\n ...global,\n emojiKeywords: {\n ...global.emojiKeywords,\n [language]: {\n ...currentEmojiKeywords,\n isLoading: false,\n },\n },\n });\n\n return;\n }\n\n setGlobal({\n ...global,\n emojiKeywords: {\n ...global.emojiKeywords,\n [language]: {\n isLoading: false,\n version: emojiKeywords.version,\n keywords: {\n ...(currentEmojiKeywords?.keywords),\n ...emojiKeywords.keywords,\n },\n },\n },\n });\n })();\n});\n\nasync function loadStickerSets(hash = 0) {\n const addedStickers = await callApi('fetchStickerSets', { hash });\n if (!addedStickers) {\n return;\n }\n\n setGlobal(updateStickerSets(\n getGlobal(),\n 'added',\n addedStickers.hash,\n addedStickers.sets,\n ));\n}\n\nasync function loadRecentStickers(hash = 0) {\n const recentStickers = await callApi('fetchRecentStickers', { hash });\n if (!recentStickers) {\n return;\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n stickers: {\n ...global.stickers,\n recent: recentStickers,\n },\n });\n}\n\nasync function loadFavoriteStickers(hash = 0) {\n const favoriteStickers = await callApi('fetchFavoriteStickers', { hash });\n if (!favoriteStickers) {\n return;\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n stickers: {\n ...global.stickers,\n favorite: favoriteStickers,\n },\n });\n}\n\nasync function loadFeaturedStickers(hash = 0) {\n const featuredStickers = await callApi('fetchFeaturedStickers', { hash });\n if (!featuredStickers) {\n return;\n }\n\n setGlobal(updateStickerSets(\n getGlobal(),\n 'featured',\n featuredStickers.hash,\n featuredStickers.sets,\n ));\n}\n\nasync function loadStickers(stickerSetId: string, accessHash: string, stickerSetShortName?: string) {\n const stickerSet = await callApi('fetchStickers',\n { stickerSetShortName, stickerSetId, accessHash });\n if (!stickerSet) {\n return;\n }\n\n const { set, stickers, packs } = stickerSet;\n\n let global = getGlobal();\n\n global = updateStickerSet(global, set.id, { ...set, stickers, packs });\n\n const currentEmoji = global.stickers.forEmoji.emoji;\n if (currentEmoji && packs[currentEmoji]) {\n global = rebuildStickersForEmoji(global);\n }\n\n setGlobal(global);\n}\n\nasync function loadAnimatedEmojis() {\n const stickerSet = await callApi('fetchAnimatedEmojis');\n if (!stickerSet) {\n return;\n }\n\n const { set, stickers } = stickerSet;\n\n setGlobal(replaceAnimatedEmojis(getGlobal(), { ...set, stickers }));\n}\n\nfunction unfaveSticker(sticker: ApiSticker) {\n const global = getGlobal();\n\n // Remove sticker preemptively to get instant feedback when user removes sticker\n // from favorites while in Sticker Picker\n setGlobal({\n ...global,\n stickers: {\n ...global.stickers,\n favorite: {\n ...global.stickers.favorite,\n stickers: global.stickers.favorite.stickers.filter(({ id }) => id !== sticker.id),\n },\n },\n });\n\n void callApi('faveSticker', { sticker, unfave: true });\n}\n\naddReducer('setStickerSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n if (query) {\n void searchThrottled(() => {\n searchStickers(query);\n });\n }\n});\n\naddReducer('setGifSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n if (typeof query === 'string') {\n void searchThrottled(() => {\n searchGifs(query);\n });\n }\n});\n\naddReducer('searchMoreGifs', (global) => {\n const { query, offset } = global.gifs.search;\n\n if (typeof query === 'string') {\n void searchThrottled(() => {\n searchGifs(query, offset);\n });\n }\n});\n\naddReducer('loadStickersForEmoji', (global, actions, payload) => {\n const { emoji } = payload!;\n const { hash } = global.stickers.forEmoji;\n\n void searchThrottled(() => {\n loadStickersForEmoji(emoji, hash);\n });\n});\n\naddReducer('clearStickersForEmoji', (global) => {\n return {\n ...global,\n stickers: {\n ...global.stickers,\n forEmoji: {},\n },\n };\n});\n\naddReducer('openStickerSetShortName', (global, actions, payload) => {\n const { stickerSetShortName } = payload!;\n return {\n ...global,\n openedStickerSetShortName: stickerSetShortName,\n };\n});\n\nasync function searchStickers(query: string, hash = 0) {\n const result = await callApi('searchStickers', { query, hash });\n\n if (!result) {\n return;\n }\n\n const global = getGlobal();\n const { setsById, added } = global.stickers;\n\n const resultIds = result.sets.map(({ id }) => id);\n\n if (added.setIds) {\n added.setIds.forEach((id) => {\n if (!resultIds.includes(id)) {\n const { title } = setsById[id] || {};\n if (title && searchWords(title, query)) {\n resultIds.unshift(id);\n }\n }\n });\n }\n\n setGlobal(updateStickerSets(\n global,\n 'search',\n result.hash,\n result.sets,\n resultIds,\n ));\n}\n\nasync function searchGifs(query: string, offset?: string) {\n const result = await callApi('searchGifs', { query, offset });\n if (!result) {\n return;\n }\n\n setGlobal(updateGifSearch(getGlobal(), !offset, result.gifs, result.nextOffset));\n}\n\nasync function loadSavedGifs(hash = 0) {\n const savedGifs = await callApi('fetchSavedGifs', { hash });\n if (!savedGifs) {\n return;\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n gifs: {\n ...global.gifs,\n saved: savedGifs,\n },\n });\n}\n\nasync function loadStickersForEmoji(emoji: string, hash = 0) {\n let global = getGlobal();\n setGlobal({\n ...global,\n stickers: {\n ...global.stickers,\n forEmoji: {\n ...global.stickers.forEmoji,\n emoji,\n },\n },\n });\n\n const result = await callApi('fetchStickersForEmoji', { emoji, hash });\n\n global = getGlobal();\n\n if (!result || global.stickers.forEmoji.emoji !== emoji) {\n return;\n }\n\n global = updateStickersForEmoji(global, emoji, result.stickers, result.hash);\n\n setGlobal(global);\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { callApi } from '../../../api/gramjs';\nimport { ApiChat, ApiGlobalMessageSearchType } from '../../../api/types';\n\nimport {\n addChats,\n addMessages,\n addUsers,\n updateGlobalSearch,\n updateGlobalSearchFetchingStatus,\n updateGlobalSearchResults,\n} from '../../reducers';\nimport { throttle } from '../../../util/schedulers';\nimport { selectChat, selectCurrentGlobalSearchQuery } from '../../selectors';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { GLOBAL_SEARCH_SLICE } from '../../../config';\nimport { timestampPlusDay } from '../../../util/dateFormat';\n\nconst searchThrottled = throttle((cb) => cb(), 500, false);\n\naddReducer('setGlobalSearchQuery', (global, actions, payload) => {\n const { chatId } = global.globalSearch;\n const { query } = payload!;\n\n if (query && !chatId) {\n void searchThrottled(() => {\n searchChats(query);\n });\n }\n});\n\naddReducer('setGlobalSearchDate', (global, actions, payload) => {\n const { date } = payload!;\n const maxDate = date ? timestampPlusDay(date) : date;\n const newGlobal = updateGlobalSearch(global, {\n date,\n query: '',\n resultsByType: {\n ...global.globalSearch.resultsByType,\n text: {\n totalCount: undefined,\n foundIds: [],\n nextOffsetId: 0,\n },\n },\n });\n setGlobal(newGlobal);\n const { chatId } = global.globalSearch;\n const chat = chatId ? selectChat(global, chatId) : undefined;\n searchMessagesGlobal('', 'text', undefined, chat, maxDate, date);\n});\n\naddReducer('searchMessagesGlobal', (global, actions, payload) => {\n const {\n query, resultsByType, chatId, date,\n } = global.globalSearch;\n const maxDate = date ? timestampPlusDay(date) : date;\n const { type } = payload;\n const nextOffsetId = (resultsByType?.[type as ApiGlobalMessageSearchType])?.nextOffsetId;\n\n const chat = chatId ? selectChat(global, chatId) : undefined;\n\n searchMessagesGlobal(query, type, nextOffsetId, chat, maxDate, date);\n});\n\nasync function searchChats(query: string) {\n const result = await callApi('searchChats', { query });\n\n let global = getGlobal();\n const currentSearchQuery = selectCurrentGlobalSearchQuery(global);\n if (!result || !currentSearchQuery || (query !== currentSearchQuery)) {\n setGlobal(updateGlobalSearchFetchingStatus(global, { chats: false }));\n return;\n }\n\n const {\n localChats, localUsers, globalChats, globalUsers,\n } = result;\n\n if (localChats.length || globalChats.length) {\n global = addChats(global, buildCollectionByKey([...localChats, ...globalChats], 'id'));\n }\n\n if (localUsers.length || globalUsers.length) {\n global = addUsers(global, buildCollectionByKey([...localUsers, ...globalUsers], 'id'));\n }\n\n global = updateGlobalSearchFetchingStatus(global, { chats: false });\n global = updateGlobalSearch(global, {\n localResults: {\n chatIds: localChats.map(({ id }) => id),\n userIds: localUsers.map(({ id }) => id),\n },\n globalResults: {\n ...global.globalSearch.globalResults,\n chatIds: globalUsers.map(({ id }) => id),\n userIds: globalChats.map(({ id }) => id),\n },\n });\n\n setGlobal(global);\n}\n\nasync function searchMessagesGlobal(\n query = '', type: ApiGlobalMessageSearchType, offsetRate?: number, chat?: ApiChat, maxDate?: number, minDate?: number,\n) {\n let result;\n\n if (chat) {\n const localResult = await callApi('searchMessagesLocal', {\n chatOrUser: chat,\n query,\n type,\n limit: GLOBAL_SEARCH_SLICE,\n offsetId: offsetRate,\n minDate,\n maxDate,\n });\n\n if (localResult) {\n const {\n messages, users, totalCount, nextOffsetId,\n } = localResult;\n\n result = {\n messages,\n users,\n chats: [],\n totalCount,\n nextRate: nextOffsetId,\n };\n }\n } else {\n result = await callApi('searchMessagesGlobal', {\n query,\n offsetRate,\n limit: GLOBAL_SEARCH_SLICE,\n type,\n maxDate,\n minDate,\n });\n }\n\n let global = getGlobal();\n const currentSearchQuery = selectCurrentGlobalSearchQuery(global);\n if (!result || (query !== '' && query !== currentSearchQuery)) {\n setGlobal(updateGlobalSearchFetchingStatus(global, { messages: false }));\n return;\n }\n\n const {\n messages, users, chats, totalCount, nextRate,\n } = result;\n\n if (chats.length) {\n global = addChats(global, buildCollectionByKey(chats, 'id'));\n }\n\n if (users.length) {\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n }\n\n if (messages.length) {\n global = addMessages(global, messages);\n }\n\n global = updateGlobalSearchResults(\n global,\n messages,\n totalCount,\n type,\n nextRate,\n );\n\n setGlobal(global);\n}\n","import {\n addReducer, getGlobal, setGlobal, getDispatch,\n} from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiFormattedText, ApiUser, MAIN_THREAD_ID,\n} from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport {\n CHAT_LIST_LOAD_SLICE, DEBUG, MESSAGE_LIST_SLICE,\n} from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport {\n replaceChatListIds,\n replaceChats,\n replaceUsers,\n updateUsers,\n updateChats,\n updateChatListSecondaryInfo,\n updateThreadInfos,\n replaceThreadParam,\n} from '../../reducers';\nimport {\n selectUser, selectChat, selectCurrentMessageList, selectDraft, selectChatMessage, selectThreadInfo,\n} from '../../selectors';\nimport { isChatPrivate } from '../../helpers';\n\naddReducer('sync', (global, actions) => {\n void sync(actions.afterSync);\n});\n\naddReducer('afterSync', (global, actions) => {\n void afterSync(actions);\n});\n\nasync function sync(afterSyncCallback: () => void) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START SYNC');\n }\n\n await callApi('fetchCurrentUser');\n\n // This fetches only active chats and clears archived chats, which will be fetched in `afterSync`\n const savedUsers = await loadAndReplaceChats();\n await loadAndReplaceMessages(savedUsers);\n\n setGlobal({\n ...getGlobal(),\n lastSyncTime: Date.now(),\n });\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH SYNC');\n }\n\n afterSyncCallback();\n}\n\nasync function afterSync(actions: GlobalActions) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START AFTER-SYNC');\n }\n\n actions.loadFavoriteStickers();\n\n await Promise.all([\n loadAndUpdateUsers(),\n loadAndReplaceArchivedChats(),\n ]);\n\n await callApi('fetchCurrentUser');\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH AFTER-SYNC');\n }\n}\n\nasync function loadAndReplaceChats() {\n const result = await callApi('fetchChats', {\n limit: CHAT_LIST_LOAD_SLICE,\n withPinned: true,\n serverTimeOffset: getGlobal().serverTimeOffset,\n });\n if (!result) {\n return undefined;\n }\n\n let global = getGlobal();\n\n const { recentlyFoundChatIds } = global.globalSearch;\n const { userIds: contactIds } = global.contactList || {};\n const { currentUserId } = global;\n\n const savedPrivateChatIds = [\n ...(recentlyFoundChatIds || []),\n ...(contactIds || []),\n ...(currentUserId ? [currentUserId] : []),\n ];\n\n const savedUsers = savedPrivateChatIds\n .map((id) => selectUser(global, id))\n .filter(Boolean as any);\n\n const savedChats = savedPrivateChatIds\n .map((id) => selectChat(global, id))\n .filter(Boolean as any);\n\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n if (currentChatId) {\n const selectedChat = selectChat(global, currentChatId);\n if (selectedChat && !savedPrivateChatIds.includes(currentChatId)) {\n savedChats.push(selectedChat);\n }\n\n if (isChatPrivate(currentChatId)) {\n const selectedChatUser = selectUser(global, currentChatId);\n if (selectedChatUser && !savedPrivateChatIds.includes(currentChatId)) {\n savedUsers.push(selectedChatUser);\n }\n }\n }\n\n savedUsers.push(...result.users);\n savedChats.push(...result.chats);\n\n global = replaceChats(global, buildCollectionByKey(savedChats, 'id'));\n global = replaceChatListIds(global, 'active', result.chatIds);\n\n global = {\n ...global,\n chats: {\n ...global.chats,\n },\n };\n\n global = updateChatListSecondaryInfo(global, 'active', result);\n\n Object.keys(result.draftsById).map(Number).forEach((chatId) => {\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'draft', result.draftsById[chatId]);\n });\n\n Object.keys(result.replyingToById).map(Number).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'replyingToId', result.replyingToById[chatId],\n );\n });\n\n setGlobal(global);\n\n if (currentChatId && !global.chats.byId[currentChatId]) {\n getDispatch().openChat({ id: undefined });\n }\n\n return savedUsers;\n}\n\nasync function loadAndReplaceArchivedChats() {\n const result = await callApi('fetchChats', {\n limit: CHAT_LIST_LOAD_SLICE,\n archived: true,\n withPinned: true,\n serverTimeOffset: getGlobal().serverTimeOffset,\n });\n\n if (!result) {\n return;\n }\n\n let global = getGlobal();\n global = updateUsers(global, buildCollectionByKey(result.users, 'id'));\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = replaceChatListIds(global, 'archived', result.chatIds);\n global = updateChatListSecondaryInfo(global, 'archived', result);\n setGlobal(global);\n}\n\nasync function loadAndReplaceMessages(savedUsers?: ApiUser[]) {\n let areMessagesLoaded = false;\n let users = savedUsers || [];\n\n let global = getGlobal();\n const { chatId: currentChatId, threadId: currentThreadId } = selectCurrentMessageList(global) || {};\n\n // Memoize drafts\n const draftChatIds = Object.keys(global.messages.byChatId).map(Number);\n const draftsByChatId = draftChatIds.reduce>((acc, chatId) => {\n const draft = selectDraft(global, chatId, MAIN_THREAD_ID);\n return draft ? { ...acc, [chatId]: draft } : acc;\n }, {});\n\n if (currentChatId) {\n const result = await loadTopMessages(global.chats.byId[currentChatId]);\n global = getGlobal();\n const { chatId: newCurrentChatId } = selectCurrentMessageList(global) || {};\n const threadInfo = currentThreadId && selectThreadInfo(global, currentChatId, currentThreadId);\n\n if (result && newCurrentChatId === currentChatId) {\n const currentMessageListInfo = global.messages.byChatId[currentChatId];\n const byId = buildCollectionByKey(result.messages, 'id');\n const listedIds = Object.keys(byId).map(Number);\n\n global = {\n ...global,\n messages: {\n ...global.messages,\n byChatId: {\n [currentChatId]: {\n byId,\n threadsById: {\n [MAIN_THREAD_ID]: {\n ...(currentMessageListInfo?.threadsById[MAIN_THREAD_ID]),\n listedIds,\n viewportIds: listedIds,\n outlyingIds: undefined,\n },\n },\n },\n },\n },\n };\n\n if (currentThreadId && threadInfo && threadInfo.originChannelId) {\n const { originChannelId } = threadInfo;\n const currentMessageListInfoOrigin = global.messages.byChatId[originChannelId];\n const resultOrigin = await loadTopMessages(global.chats.byId[originChannelId]);\n if (resultOrigin) {\n const byIdOrigin = buildCollectionByKey(resultOrigin.messages, 'id');\n const listedIdsOrigin = Object.keys(byIdOrigin)\n .map(Number);\n\n global = {\n ...global,\n messages: {\n ...global.messages,\n byChatId: {\n ...global.messages.byChatId,\n [threadInfo.originChannelId]: {\n byId: byIdOrigin,\n threadsById: {\n [MAIN_THREAD_ID]: {\n ...(currentMessageListInfoOrigin?.threadsById[MAIN_THREAD_ID]),\n listedIds: listedIdsOrigin,\n viewportIds: listedIdsOrigin,\n outlyingIds: undefined,\n },\n },\n },\n [currentChatId]: {\n ...global.messages.byChatId[currentChatId],\n threadsById: {\n ...global.messages.byChatId[currentChatId].threadsById,\n [currentThreadId]: {\n ...(currentMessageListInfo?.threadsById[currentThreadId]),\n outlyingIds: undefined,\n },\n },\n },\n },\n },\n };\n }\n }\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = updateThreadInfos(global, currentChatId, result.threadInfos);\n\n areMessagesLoaded = true;\n users = Array.prototype.concat(users, result.users);\n }\n }\n\n if (!areMessagesLoaded) {\n global = {\n ...global,\n messages: {\n ...global.messages,\n byChatId: {},\n },\n };\n }\n\n // Restore drafts\n Object.keys(draftsByChatId).map(Number).forEach((chatId) => {\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'draft', draftsByChatId[chatId]);\n });\n\n if (savedUsers) {\n global = replaceUsers(global, buildCollectionByKey(users, 'id'));\n } else if (users) {\n // If `fetchChats` has failed for some reason, we don't have saved chats, thus we can not replace\n global = updateUsers(global, buildCollectionByKey(users, 'id'));\n }\n\n setGlobal(global);\n\n const { chatId: audioChatId, messageId: audioMessageId } = global.audioPlayer;\n if (audioChatId && audioMessageId && !selectChatMessage(global, audioChatId, audioMessageId)) {\n getDispatch().closeAudioPlayer();\n }\n}\n\nasync function loadAndUpdateUsers() {\n let global = getGlobal();\n const { recentlyFoundChatIds } = global.globalSearch;\n const { userIds: contactIds } = global.contactList || {};\n if (\n (!contactIds || !contactIds.length)\n && (!recentlyFoundChatIds || !recentlyFoundChatIds.length)\n ) {\n return;\n }\n\n const users = [\n ...(recentlyFoundChatIds || []),\n ...(contactIds || []),\n ].map((id) => selectUser(global, id)).filter(Boolean as any);\n\n const updatedUsers = await callApi('fetchUsers', { users });\n if (!updatedUsers) {\n return;\n }\n\n global = getGlobal();\n global = updateUsers(global, buildCollectionByKey(updatedUsers, 'id'));\n setGlobal(global);\n}\n\nfunction loadTopMessages(chat: ApiChat) {\n return callApi('fetchMessages', {\n chat,\n threadId: MAIN_THREAD_ID,\n offsetId: chat.lastReadInboxMessageId,\n addOffset: -(Math.round(MESSAGE_LIST_SLICE / 2) + 1),\n limit: MESSAGE_LIST_SLICE,\n });\n}\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser, MAIN_THREAD_ID } from '../../../api/types';\n\nimport { MESSAGE_SEARCH_SLICE, SHARED_MEDIA_SLICE } from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport {\n selectCurrentTextSearch,\n selectCurrentMediaSearchPeerId,\n selectCurrentMediaSearch, selectCurrentMessageList, selectChat, selectThreadInfo,\n} from '../../selectors';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport {\n addChatMessagesById,\n addUsers,\n updateLocalMediaSearchResults,\n updateLocalTextSearchResults,\n} from '../../reducers';\nimport { SharedMediaType } from '../../../types';\n\naddReducer('searchTextMessagesLocal', (global) => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n const chat = chatId ? selectChat(global, chatId) : undefined;\n const currentSearch = selectCurrentTextSearch(global);\n if (!chat || !currentSearch || !threadId) {\n return;\n }\n\n const { query, results } = currentSearch;\n const offsetId = results?.nextOffsetId;\n\n let topMessageId: number | undefined;\n if (threadId !== MAIN_THREAD_ID) {\n const threadInfo = selectThreadInfo(global, chatId!, threadId);\n topMessageId = threadInfo?.topMessageId;\n }\n\n void searchTextMessages(chat, threadId, topMessageId, query, offsetId);\n});\n\naddReducer('searchMediaMessagesLocal', (global) => {\n const peerId = selectCurrentMediaSearchPeerId(global);\n const chatOrUser = peerId\n ? global.users.byId[peerId] || global.chats.byId[peerId]\n : undefined;\n const currentSearch = selectCurrentMediaSearch(global);\n\n if (!chatOrUser || !currentSearch) {\n return;\n }\n\n const { currentType: type, resultsByType } = currentSearch;\n const currentResults = type && resultsByType && resultsByType[type];\n const offsetId = currentResults?.nextOffsetId;\n\n if (!type) {\n return;\n }\n\n void searchSharedMedia(chatOrUser, type, offsetId);\n});\n\naddReducer('searchMessagesByDate', (global, actions, payload) => {\n const { timestamp } = payload!;\n\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return;\n }\n\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n void searchMessagesByDate(chat, timestamp);\n});\n\nasync function searchTextMessages(\n chatOrUser: ApiChat,\n threadId: number,\n topMessageId?: number,\n query?: string,\n offsetId?: number,\n) {\n const result = await callApi('searchMessagesLocal', {\n chatOrUser,\n type: 'text',\n query,\n topMessageId,\n limit: MESSAGE_SEARCH_SLICE,\n offsetId,\n });\n\n if (!result) {\n return;\n }\n\n const {\n messages, users, totalCount, nextOffsetId,\n } = result;\n\n const byId = buildCollectionByKey(messages, 'id');\n const newFoundIds = Object.keys(byId).map(Number);\n\n let global = getGlobal();\n\n const currentSearch = selectCurrentTextSearch(global);\n if (!currentSearch || (query && query !== currentSearch.query)) {\n return;\n }\n\n global = addChatMessagesById(global, chatOrUser.id, byId);\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = updateLocalTextSearchResults(global, chatOrUser.id, threadId, newFoundIds, totalCount, nextOffsetId);\n setGlobal(global);\n}\n\nasync function searchSharedMedia(\n chatOrUser: ApiChat | ApiUser,\n type: SharedMediaType,\n offsetId?: number,\n) {\n const result = await callApi('searchMessagesLocal', {\n chatOrUser,\n type,\n limit: SHARED_MEDIA_SLICE,\n offsetId,\n });\n\n if (!result) {\n return;\n }\n\n const {\n messages, users, totalCount, nextOffsetId,\n } = result;\n\n const byId = buildCollectionByKey(messages, 'id');\n const newFoundIds = Object.keys(byId).map(Number);\n\n let global = getGlobal();\n\n const currentSearch = selectCurrentMediaSearch(global);\n if (!currentSearch) {\n return;\n }\n\n global = addChatMessagesById(global, chatOrUser.id, byId);\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = updateLocalMediaSearchResults(global, chatOrUser.id, type, newFoundIds, totalCount, nextOffsetId);\n setGlobal(global);\n}\n\n/**\n * @param timestamp start of target date in seconds\n */\nasync function searchMessagesByDate(chat: ApiChat, timestamp: number) {\n const messageId = await callApi('findFirstMessageIdAfterDate', {\n chat,\n timestamp,\n });\n\n if (!messageId) {\n return;\n }\n\n getDispatch().focusMessage({\n chatId: chat.id,\n messageId,\n });\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementProgress } from '../../../types';\nimport { callApi } from '../../../api/gramjs';\nimport { updateManagement, updateManagementProgress } from '../../reducers';\nimport { selectChat, selectCurrentMessageList } from '../../selectors';\nimport { isChatBasicGroup } from '../../helpers';\n\naddReducer('checkPublicLink', (global, actions, payload) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return;\n }\n\n // No need to check the username if already in progress\n if (global.management.progress === ManagementProgress.InProgress) {\n return;\n }\n\n const { username } = payload!;\n\n (async () => {\n global = updateManagementProgress(global, ManagementProgress.InProgress);\n global = updateManagement(global, chatId, { isUsernameAvailable: undefined });\n setGlobal(global);\n\n const isUsernameAvailable = await callApi('checkChatUsername', { username })!;\n\n global = getGlobal();\n global = updateManagementProgress(\n global, isUsernameAvailable ? ManagementProgress.Complete : ManagementProgress.Error,\n );\n global = updateManagement(global, chatId, { isUsernameAvailable });\n setGlobal(global);\n })();\n});\n\naddReducer('updatePublicLink', (global, actions, payload) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n let chat = chatId && selectChat(global, chatId);\n if (!chatId || !chat) {\n return;\n }\n\n const { username } = payload!;\n\n (async () => {\n global = updateManagementProgress(global, ManagementProgress.InProgress);\n setGlobal(global);\n\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n const result = await callApi('setChatUsername', { chat, username });\n\n global = getGlobal();\n global = updateManagementProgress(global, result ? ManagementProgress.Complete : ManagementProgress.Error);\n global = updateManagement(global, chatId, { isUsernameAvailable: undefined });\n setGlobal(global);\n })();\n});\n\naddReducer('updatePrivateLink', (global) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n const chat = chatId && selectChat(global, chatId);\n if (!chatId || !chat) {\n return;\n }\n\n callApi('updatePrivateLink', { chat });\n});\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { ApiUser } from '../../../api/types';\nimport { ManagementProgress } from '../../../types';\n\nimport { debounce, throttle } from '../../../util/schedulers';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { isChatPrivate } from '../../helpers';\nimport { callApi } from '../../../api/gramjs';\nimport { selectChat, selectUser } from '../../selectors';\nimport {\n addChats, addUsers, updateChat, updateManagementProgress, updateUser, updateUsers,\n updateUserSearch, updateUserSearchFetchingStatus,\n} from '../../reducers';\nimport { getServerTime } from '../../../util/serverTime';\n\nconst runDebouncedForFetchFullUser = debounce((cb) => cb(), 500, false, true);\nconst TOP_PEERS_REQUEST_COOLDOWN = 60; // 1 min\nconst runThrottledForSearch = throttle((cb) => cb(), 500, false);\n\naddReducer('loadFullUser', (global, actions, payload) => {\n const { userId } = payload!;\n const user = selectUser(global, userId);\n if (!user) {\n return;\n }\n\n const { id, accessHash } = user;\n\n runDebouncedForFetchFullUser(() => callApi('fetchFullUser', { id, accessHash }));\n});\n\naddReducer('loadUser', (global, actions, payload) => {\n const { userId } = payload!;\n const user = selectUser(global, userId);\n if (!user) {\n return;\n }\n\n (async () => {\n const updatedUsers = await callApi('fetchUsers', { users: [user] });\n if (!updatedUsers) {\n return;\n }\n\n global = getGlobal();\n global = updateUsers(global, buildCollectionByKey(updatedUsers, 'id'));\n setGlobal(global);\n })();\n});\n\naddReducer('loadTopUsers', (global) => {\n const {\n topPeers: {\n hash, lastRequestedAt,\n },\n } = global;\n\n if (!lastRequestedAt || getServerTime(global.serverTimeOffset) - lastRequestedAt > TOP_PEERS_REQUEST_COOLDOWN) {\n void loadTopUsers(hash);\n }\n});\n\naddReducer('loadContactList', (global) => {\n const { hash } = global.contactList || {};\n void loadContactList(hash);\n});\n\naddReducer('loadCurrentUser', () => {\n void callApi('fetchCurrentUser');\n});\n\naddReducer('updateContact', (global, actions, payload) => {\n const {\n userId, isMuted, firstName, lastName,\n } = payload!;\n\n void updateContact(userId, isMuted, firstName, lastName);\n});\n\naddReducer('deleteUser', (global, actions, payload) => {\n const { userId } = payload!;\n\n void deleteUser(userId);\n});\n\nasync function loadTopUsers(usersHash?: number) {\n const result = await callApi('fetchTopUsers', { hash: usersHash });\n if (!result) {\n return;\n }\n\n const { hash, ids, users } = result;\n\n let global = getGlobal();\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = {\n ...global,\n topPeers: {\n ...global.topPeers,\n hash,\n userIds: ids,\n lastRequestedAt: getServerTime(global.serverTimeOffset),\n },\n };\n setGlobal(global);\n}\n\nasync function loadContactList(hash?: number) {\n const contactList = await callApi('fetchContactList', { hash });\n if (!contactList) {\n return;\n }\n\n let global = addUsers(getGlobal(), buildCollectionByKey(contactList.users, 'id'));\n global = addChats(global, buildCollectionByKey(contactList.chats, 'id'));\n\n // Sort contact list by Last Name (or First Name), with latin names being placed first\n const getCompareString = (user: ApiUser) => (user.lastName || user.firstName || '');\n const collator = new Intl.Collator('en-US');\n\n const sortedUsers = contactList.users.sort((a, b) => (\n collator.compare(getCompareString(a), getCompareString(b))\n )).filter((user) => !user.isSelf);\n\n setGlobal({\n ...global,\n contactList: {\n hash: contactList.hash,\n userIds: sortedUsers.map((user) => user.id),\n },\n });\n}\n\nasync function updateContact(\n userId: number,\n isMuted: boolean,\n firstName: string,\n lastName?: string,\n) {\n const global = getGlobal();\n const user = selectUser(global, userId);\n if (!user) {\n return;\n }\n\n getDispatch().updateChatMutedState({ chatId: userId, isMuted });\n\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.InProgress));\n\n const result = await callApi('updateContact', { phone: user.phoneNumber, firstName, lastName });\n\n if (result) {\n setGlobal(updateUser(\n getGlobal(),\n user.id,\n {\n firstName,\n lastName,\n },\n ));\n }\n\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.Complete));\n}\n\nasync function deleteUser(userId: number) {\n const global = getGlobal();\n const user = selectUser(global, userId);\n\n if (!user) {\n return;\n }\n\n const { id, accessHash } = user;\n\n await callApi('deleteUser', { id, accessHash });\n}\n\naddReducer('loadProfilePhotos', (global, actions, payload) => {\n const { profileId } = payload!;\n const isPrivate = isChatPrivate(profileId);\n const user = isPrivate ? selectUser(global, profileId) : undefined;\n const chat = !isPrivate ? selectChat(global, profileId) : undefined;\n\n (async () => {\n const result = await callApi('fetchProfilePhotos', user, chat);\n if (!result || !result.photos) {\n return;\n }\n\n let newGlobal = getGlobal();\n if (isPrivate) {\n newGlobal = updateUser(newGlobal, profileId, { photos: result.photos });\n } else {\n newGlobal = addUsers(newGlobal, buildCollectionByKey(result.users!, 'id'));\n newGlobal = updateChat(newGlobal, profileId, { photos: result.photos });\n }\n\n setGlobal(newGlobal);\n })();\n});\n\naddReducer('setUserSearchQuery', (global, actions, payload) => {\n const { query } = payload!;\n\n if (!query) return;\n\n void runThrottledForSearch(() => {\n searchUsers(query);\n });\n});\n\nasync function searchUsers(query: string) {\n const result = await callApi('searchChats', { query });\n\n let global = getGlobal();\n const currentSearchQuery = global.userSearch.query;\n\n if (!result || !currentSearchQuery || (query !== currentSearchQuery)) {\n setGlobal(updateUserSearchFetchingStatus(global, false));\n return;\n }\n\n const { localUsers, globalUsers } = result;\n\n let localUserIds;\n let globalUserIds;\n if (localUsers.length) {\n global = addUsers(global, buildCollectionByKey(localUsers, 'id'));\n localUserIds = localUsers.map(({ id }) => id);\n }\n if (globalUsers.length) {\n global = addUsers(global, buildCollectionByKey(globalUsers, 'id'));\n globalUserIds = globalUsers.map(({ id }) => id);\n }\n\n global = updateUserSearchFetchingStatus(global, false);\n global = updateUserSearch(global, { localUserIds, globalUserIds });\n\n setGlobal(global);\n}\n","import { GlobalState } from '../../global/types';\nimport { InlineBotSettings } from '../../types';\n\nexport function replaceInlineBotSettings(\n global: GlobalState, username: string, inlineBotSettings: InlineBotSettings | false,\n): GlobalState {\n return {\n ...global,\n inlineBots: {\n ...global.inlineBots,\n byUsername: {\n ...global.inlineBots.byUsername,\n [username]: inlineBotSettings,\n },\n },\n };\n}\n\nexport function replaceInlineBotsIsLoading(global: GlobalState, isLoading: boolean): GlobalState {\n return {\n ...global,\n inlineBots: {\n ...global.inlineBots,\n isLoading,\n },\n };\n}\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { ApiChat } from '../../../api/types';\nimport { InlineBotSettings } from '../../../types';\n\nimport { RE_TME_INVITE_LINK, RE_TME_LINK } from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport {\n selectChat, selectChatBot, selectChatMessage, selectCurrentChat, selectCurrentMessageList,\n selectReplyingToId, selectUser,\n} from '../../selectors';\nimport { addChats, addUsers, removeBlockedContact } from '../../reducers';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { debounce } from '../../../util/schedulers';\nimport { replaceInlineBotSettings, replaceInlineBotsIsLoading } from '../../reducers/bots';\nimport { getServerTime } from '../../../util/serverTime';\n\nconst TOP_PEERS_REQUEST_COOLDOWN = 60; // 1 min\nconst runDebouncedForSearch = debounce((cb) => cb(), 500, false);\n\naddReducer('clickInlineButton', (global, actions, payload) => {\n const { button } = payload;\n\n switch (button.type) {\n case 'command':\n actions.sendBotCommand({ command: button.value });\n break;\n case 'url':\n if (button.value.match(RE_TME_INVITE_LINK) || button.value.match(RE_TME_LINK)) {\n actions.openTelegramLink({ url: button.value });\n } else {\n actions.toggleSafeLinkModal({ url: button.value });\n }\n break;\n case 'callback': {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return;\n }\n\n void answerCallbackButton(chat, button.messageId, button.value);\n break;\n }\n case 'requestPoll':\n actions.openPollModal();\n break;\n case 'buy': {\n const chat = selectCurrentChat(global);\n const { messageId, value } = button;\n if (!chat) {\n return;\n }\n\n if (value) {\n actions.getReceipt({ receiptMessageId: value, chatId: chat.id, messageId });\n } else {\n actions.getPaymentForm({ chat, messageId });\n actions.setInvoiceMessageInfo(selectChatMessage(global, chat.id, messageId));\n actions.openPaymentModal({ chatId: chat.id, messageId });\n }\n break;\n }\n }\n});\n\naddReducer('sendBotCommand', (global, actions, payload) => {\n const { command, chatId } = payload;\n const { currentUserId } = global;\n const chat = chatId ? selectChat(global, chatId) : selectCurrentChat(global);\n const currentMessageList = selectCurrentMessageList(global);\n\n if (!currentUserId || !chat || !currentMessageList) {\n return;\n }\n\n const { threadId } = currentMessageList;\n actions.setReplyingToId({ messageId: undefined });\n actions.clearWebPagePreview({ chatId: chat.id, threadId, value: false });\n\n void sendBotCommand(chat, currentUserId, command, selectReplyingToId(global, chat.id, threadId));\n});\n\naddReducer('restartBot', (global, actions, payload) => {\n const { chatId } = payload;\n const { currentUserId } = global;\n const chat = selectCurrentChat(global);\n const bot = currentUserId && selectChatBot(global, chatId);\n if (!currentUserId || !chat || !bot) {\n return;\n }\n\n (async () => {\n const result = await callApi('unblockContact', bot.id, bot.accessHash);\n if (!result) {\n return;\n }\n\n setGlobal(removeBlockedContact(getGlobal(), bot.id));\n void sendBotCommand(chat, currentUserId, '/start');\n })();\n});\n\naddReducer('loadTopInlineBots', (global) => {\n const { hash, lastRequestedAt } = global.topInlineBots;\n\n if (lastRequestedAt && getServerTime(global.serverTimeOffset) - lastRequestedAt < TOP_PEERS_REQUEST_COOLDOWN) {\n return;\n }\n\n (async () => {\n const result = await callApi('fetchTopInlineBots', { hash });\n if (!result) {\n return;\n }\n\n const { hash: newHash, ids, users } = result;\n\n let newGlobal = getGlobal();\n newGlobal = addUsers(newGlobal, buildCollectionByKey(users, 'id'));\n newGlobal = {\n ...newGlobal,\n topInlineBots: {\n ...newGlobal.topInlineBots,\n hash: newHash,\n userIds: ids,\n lastRequestedAt: getServerTime(global.serverTimeOffset),\n },\n };\n setGlobal(newGlobal);\n })();\n});\n\naddReducer('queryInlineBot', ((global, actions, payload) => {\n const {\n chatId, username, query, offset,\n } = payload;\n\n (async () => {\n let inlineBotData = global.inlineBots.byUsername[username];\n\n if (inlineBotData === false) {\n return;\n }\n\n if (inlineBotData === undefined) {\n const { user: inlineBot, chat } = await callApi('fetchInlineBot', { username }) || {};\n global = getGlobal();\n if (!inlineBot || !chat) {\n setGlobal(replaceInlineBotSettings(global, username, false));\n return;\n }\n\n global = addUsers(global, { [inlineBot.id]: inlineBot });\n global = addChats(global, { [chat.id]: chat });\n inlineBotData = {\n id: inlineBot.id,\n query: '',\n offset: '',\n switchPm: undefined,\n canLoadMore: true,\n results: [],\n };\n\n global = replaceInlineBotSettings(global, username, inlineBotData);\n setGlobal(global);\n }\n\n if (query === inlineBotData.query && !inlineBotData.canLoadMore) {\n return;\n }\n\n void runDebouncedForSearch(() => {\n searchInlineBot({\n username,\n inlineBotData: inlineBotData as InlineBotSettings,\n chatId,\n query,\n offset,\n });\n });\n })();\n}));\n\naddReducer('sendInlineBotResult', (global, actions, payload) => {\n const { id, queryId } = payload;\n const currentMessageList = selectCurrentMessageList(global);\n\n if (!currentMessageList || !id) {\n return;\n }\n\n const { chatId, threadId } = currentMessageList;\n\n const chat = selectChat(global, chatId)!;\n\n actions.setReplyingToId({ messageId: undefined });\n actions.clearWebPagePreview({ chatId, threadId, value: false });\n\n void callApi('sendInlineBotResult', {\n chat,\n resultId: id,\n queryId,\n replyingTo: selectReplyingToId(global, chatId, threadId),\n });\n});\n\naddReducer('resetInlineBot', (global, actions, payload) => {\n const { username } = payload;\n\n let inlineBotData = global.inlineBots.byUsername[username];\n\n if (!inlineBotData) {\n return;\n }\n\n inlineBotData = {\n id: inlineBotData.id,\n query: '',\n offset: '',\n switchPm: undefined,\n canLoadMore: true,\n results: [],\n };\n\n setGlobal(replaceInlineBotSettings(global, username, inlineBotData));\n});\n\naddReducer('startBot', (global, actions, payload) => {\n const { botId, param } = payload;\n\n const bot = selectUser(global, botId);\n if (!bot) {\n return;\n }\n\n (async () => {\n await callApi('startBot', {\n bot,\n startParam: param,\n });\n })();\n});\n\nasync function searchInlineBot({\n username,\n inlineBotData,\n chatId,\n query,\n offset,\n}: {\n username: string;\n inlineBotData: InlineBotSettings;\n chatId: number;\n query: string;\n offset?: string;\n}) {\n let global = getGlobal();\n const bot = selectUser(global, inlineBotData.id);\n const chat = selectChat(global, chatId);\n if (!bot || !chat) {\n return;\n }\n\n const shouldReplaceSettings = inlineBotData.query !== query;\n global = replaceInlineBotsIsLoading(global, true);\n global = replaceInlineBotSettings(global, username, {\n ...inlineBotData,\n query,\n ...(shouldReplaceSettings && { offset: undefined, results: [] }),\n });\n setGlobal(global);\n\n const result = await callApi('fetchInlineBotResults', {\n bot,\n chat,\n query,\n offset: shouldReplaceSettings ? undefined : offset,\n });\n\n const newInlineBotData = global.inlineBots.byUsername[username];\n global = replaceInlineBotsIsLoading(getGlobal(), false);\n if (!result || !newInlineBotData || query !== newInlineBotData.query) {\n setGlobal(global);\n return;\n }\n\n const currentIds = new Set((newInlineBotData.results || []).map((data) => data.id));\n const newResults = result.results.filter((data) => !currentIds.has(data.id));\n\n global = replaceInlineBotSettings(global, username, {\n ...newInlineBotData,\n help: result.help,\n ...(newResults.length && { isGallery: result.isGallery }),\n ...(result.switchPm && { switchPm: result.switchPm }),\n canLoadMore: result.results.length > 0 && Boolean(result.nextOffset),\n results: newInlineBotData.offset === '' || newInlineBotData.offset === result.nextOffset\n ? result.results\n : (newInlineBotData.results || []).concat(newResults),\n offset: newResults.length ? result.nextOffset : '',\n });\n\n setGlobal(global);\n}\n\nasync function sendBotCommand(chat: ApiChat, currentUserId: number, command: string, replyingTo?: number) {\n await callApi('sendMessage', {\n chat,\n text: command,\n replyingTo,\n });\n}\n\nasync function answerCallbackButton(chat: ApiChat, messageId: number, data: string) {\n const result = await callApi('answerCallbackButton', {\n chatId: chat.id,\n accessHash: chat.accessHash,\n messageId,\n data,\n });\n\n if (!result) {\n return;\n }\n\n const { showDialog, showNotification, toggleSafeLinkModal } = getDispatch();\n const { message, alert: isError, url } = result;\n\n if (isError) {\n showDialog({ data: { message: message || 'Error' } });\n } else if (message) {\n showNotification({ message });\n } else if (url) {\n toggleSafeLinkModal({ url });\n }\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { callApi } from '../../../api/gramjs';\nimport { replaceSettings, updateTwoFaSettings } from '../../reducers';\n\naddReducer('loadPasswordInfo', () => {\n (async () => {\n const result = await callApi('getPasswordInfo');\n if (!result) {\n return;\n }\n\n let global = getGlobal();\n global = replaceSettings(global, { hasPassword: result.hasPassword });\n global = updateTwoFaSettings(global, { hint: result.hint });\n setGlobal(global);\n })();\n});\n\naddReducer('checkPassword', (global, actions, payload) => {\n const { currentPassword, onSuccess } = payload;\n\n setGlobal(updateTwoFaSettings(global, { isLoading: true, error: undefined }));\n\n (async () => {\n const isSuccess = await callApi('checkPassword', currentPassword);\n\n setGlobal(updateTwoFaSettings(getGlobal(), { isLoading: false }));\n\n if (isSuccess) {\n onSuccess();\n }\n })();\n});\n\naddReducer('clearPassword', (global, actions, payload) => {\n const { currentPassword, onSuccess } = payload;\n\n setGlobal(updateTwoFaSettings(global, { isLoading: true, error: undefined }));\n\n (async () => {\n const isSuccess = await callApi('clearPassword', currentPassword);\n\n setGlobal(updateTwoFaSettings(getGlobal(), { isLoading: false }));\n\n if (isSuccess) {\n onSuccess();\n }\n })();\n});\n\naddReducer('updatePassword', (global, actions, payload) => {\n const {\n currentPassword, password, hint, email, onSuccess,\n } = payload;\n\n setGlobal(updateTwoFaSettings(global, { isLoading: true, error: undefined }));\n\n (async () => {\n const isSuccess = await callApi('updatePassword', currentPassword, password, hint, email);\n\n setGlobal(updateTwoFaSettings(getGlobal(), { isLoading: false }));\n\n if (isSuccess) {\n onSuccess();\n }\n })();\n});\n\naddReducer('updateRecoveryEmail', (global, actions, payload) => {\n const {\n currentPassword, email, onSuccess,\n } = payload;\n\n setGlobal(updateTwoFaSettings(global, { isLoading: true, error: undefined }));\n\n (async () => {\n const isSuccess = await callApi('updateRecoveryEmail', currentPassword, email);\n\n setGlobal(updateTwoFaSettings(getGlobal(), { isLoading: false, waitingEmailCodeLength: undefined }));\n\n if (isSuccess) {\n onSuccess();\n }\n })();\n});\n\naddReducer('provideTwoFaEmailCode', (global, actions, payload) => {\n const { code } = payload;\n\n void callApi('provideRecoveryEmailCode', code);\n});\n\naddReducer('clearTwoFaError', (global) => {\n return updateTwoFaSettings(global, { error: undefined });\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { PaymentStep } from '../../../types';\nimport { ApiChat } from '../../../api/types';\n\nimport {\n selectPaymentMessageId,\n selectPaymentRequestId,\n selectProviderPublishableKey,\n selectStripeCredentials,\n selectChatMessage,\n selectPaymentChatId,\n selectChat,\n selectPaymentFormId,\n} from '../../selectors';\nimport { callApi } from '../../../api/gramjs';\nimport { getStripeError } from '../../helpers';\nimport { buildQueryString } from '../../../util/requestQuery';\n\nimport {\n updateShippingOptions,\n setPaymentStep,\n setRequestInfoId,\n setPaymentForm,\n setStripeCardInfo,\n setInvoiceMessageInfo,\n setReceipt,\n clearPayment,\n closeInvoice,\n} from '../../reducers';\n\naddReducer('validateRequestedInfo', (global, actions, payload) => {\n const { requestInfo, saveInfo } = payload;\n const chatId = selectPaymentChatId(global);\n const chat = chatId && selectChat(global, chatId);\n const messageId = selectPaymentMessageId(global);\n if (!chat || !messageId) {\n return;\n }\n void validateRequestedInfo(chat, messageId, requestInfo, saveInfo);\n});\n\nasync function validateRequestedInfo(chat: ApiChat, messageId: number, requestInfo: any, shouldSave?: true) {\n const result = await callApi('validateRequestedInfo', {\n chat, messageId, requestInfo, shouldSave,\n });\n if (!result) {\n return;\n }\n\n const { id, shippingOptions } = result;\n if (!id) {\n return;\n }\n\n let global = setRequestInfoId(getGlobal(), id);\n if (shippingOptions) {\n global = updateShippingOptions(global, shippingOptions);\n global = setPaymentStep(global, PaymentStep.Shipping);\n } else {\n global = setPaymentStep(global, PaymentStep.PaymentInfo);\n }\n setGlobal(global);\n}\n\naddReducer('getPaymentForm', (global, actions, payload) => {\n const { chat, messageId } = payload;\n if (!chat || !messageId) {\n return;\n }\n void getPaymentForm(chat, messageId);\n});\n\nasync function getPaymentForm(chat: ApiChat, messageId: number) {\n const result = await callApi('getPaymentForm', { chat, messageId });\n if (!result) {\n return;\n }\n let global = setPaymentForm(getGlobal(), result);\n let step = PaymentStep.PaymentInfo;\n if (global.payment.invoice\n && (global.payment.invoice.shippingAddressRequested\n || global.payment.invoice.nameRequested\n || global.payment.invoice.phoneRequested\n || global.payment.invoice.emailRequested)) {\n step = PaymentStep.ShippingInfo;\n }\n global = setPaymentStep(global, step);\n setGlobal(global);\n}\n\naddReducer('getReceipt', (global, actions, payload) => {\n const { receiptMessageId, chatId, messageId } = payload;\n const chat = chatId && selectChat(global, chatId);\n if (!messageId || !receiptMessageId || !chat) {\n return;\n }\n\n void getReceipt(chat, messageId, receiptMessageId);\n});\n\nasync function getReceipt(chat: ApiChat, messageId: number, receiptMessageId: number) {\n const result = await callApi('getReceipt', chat, receiptMessageId);\n if (!result) {\n return;\n }\n\n let global = getGlobal();\n const message = selectChatMessage(global, chat.id, messageId);\n global = setReceipt(global, result, message);\n setGlobal(global);\n}\n\naddReducer('clearPaymentError', (global) => {\n setGlobal({\n ...global,\n payment: {\n ...global.payment,\n error: undefined,\n },\n });\n});\n\naddReducer('clearReceipt', (global) => {\n setGlobal({\n ...global,\n payment: {\n ...global.payment,\n receipt: undefined,\n },\n });\n});\n\naddReducer('sendCredentialsInfo', (global, actions, payload) => {\n const publishableKey = selectProviderPublishableKey(global);\n if (!publishableKey) {\n return;\n }\n const { credentials } = payload;\n const { data } = credentials;\n void sendStripeCredentials(data, publishableKey);\n});\n\naddReducer('sendPaymentForm', (global, actions, payload) => {\n const { shippingOptionId, saveCredentials } = payload;\n const chatId = selectPaymentChatId(global);\n const chat = chatId && selectChat(global, chatId);\n const messageId = selectPaymentMessageId(global);\n const formId = selectPaymentFormId(global);\n const requestInfoId = selectPaymentRequestId(global);\n const publishableKey = selectProviderPublishableKey(global);\n const stripeCredentials = selectStripeCredentials(global);\n if (!chat || !messageId || !publishableKey || !formId) {\n return;\n }\n\n void sendPaymentForm(chat, messageId, formId, {\n save: saveCredentials,\n data: stripeCredentials,\n }, requestInfoId, shippingOptionId);\n});\n\nasync function sendStripeCredentials(\n data: {\n cardNumber: string;\n cardholder?: string;\n expiryMonth: string;\n expiryYear: string;\n cvv: string;\n country: string;\n zip: string;\n },\n publishableKey: string,\n) {\n const query = buildQueryString({\n 'card[number]': data.cardNumber,\n 'card[exp_month]': data.expiryMonth,\n 'card[exp_year]': data.expiryYear,\n 'card[cvc]': data.cvv,\n 'card[address_zip]': data.zip,\n 'card[address_country]': data.country,\n });\n\n const response = await fetch(`https://api.stripe.com/v1/tokens${query}`, {\n method: 'POST',\n credentials: 'same-origin',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Authorization: `Bearer ${publishableKey}`,\n },\n });\n const result = await response.json();\n if (result.error) {\n const error = getStripeError(result.error);\n const global = getGlobal();\n setGlobal({\n ...global,\n payment: {\n ...global.payment,\n error: {\n ...error,\n },\n },\n });\n return;\n }\n let global = setStripeCardInfo(getGlobal(), {\n type: result.type,\n id: result.id,\n });\n global = setPaymentStep(global, PaymentStep.Checkout);\n setGlobal(global);\n}\n\nasync function sendPaymentForm(\n chat: ApiChat,\n messageId: number,\n formId: string,\n credentials: any,\n requestedInfoId?: string,\n shippingOptionId?: string,\n) {\n const result = await callApi('sendPaymentForm', {\n chat, messageId, formId, credentials, requestedInfoId, shippingOptionId,\n });\n if (result) {\n const global = clearPayment(getGlobal());\n setGlobal(closeInvoice(global));\n }\n}\n\naddReducer('setPaymentStep', (global, actions, payload = {}) => {\n return setPaymentStep(global, payload.step || PaymentStep.ShippingInfo);\n});\n\naddReducer('setInvoiceMessageInfo', (global, actions, payload) => {\n return setInvoiceMessageInfo(global, payload);\n});\n","export function buildQueryString(data: Record) {\n const query = Object.keys(data).map((k) => `${k}=${data[k]}`).join('&');\n return query.length > 0 ? `?${query}` : '';\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate, MAIN_THREAD_ID } from '../../../api/types';\n\nimport { ARCHIVED_FOLDER_ID, MAX_ACTIVE_PINNED_CHATS } from '../../../config';\nimport { pick } from '../../../util/iteratees';\nimport { closeMessageNotifications, showNewMessageNotification } from '../../../util/notifications';\nimport { updateAppBadge } from '../../../util/appBadge';\nimport {\n updateChat,\n replaceChatListIds,\n updateChatListIds,\n updateChatListType,\n replaceThreadParam,\n} from '../../reducers';\nimport {\n selectChat,\n selectCommonBoxChatId,\n selectIsChatListed,\n selectChatListType,\n selectCurrentMessageList,\n selectCountNotMutedUnread,\n selectNotifySettings,\n} from '../../selectors';\nimport { throttle } from '../../../util/schedulers';\n\nconst TYPING_STATUS_CLEAR_DELAY = 6000; // 6 seconds\n// Enough to animate and mark as read in Message List\nconst CURRENT_CHAT_UNREAD_DELAY = 1500;\n\nconst runThrottledForUpdateAppBadge = throttle((cb) => cb(), 500, true);\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'updateChat': {\n if (!update.noTopChatsRequest && !selectIsChatListed(global, update.id)) {\n // Chat can appear in dialogs list.\n actions.loadTopChats();\n }\n\n const newGlobal = updateChat(global, update.id, update.chat, update.newProfilePhoto);\n setGlobal(newGlobal);\n\n runThrottledForUpdateAppBadge(() => updateAppBadge(selectCountNotMutedUnread(getGlobal())));\n\n if (update.chat.id) {\n closeMessageNotifications({\n chatId: update.chat.id,\n lastReadInboxMessageId: update.chat.lastReadInboxMessageId,\n });\n }\n break;\n }\n\n case 'updateChatJoin': {\n const listType = selectChatListType(global, update.id);\n if (!listType) {\n break;\n }\n\n global = updateChatListIds(global, listType, [update.id]);\n global = updateChat(global, update.id, { isNotJoined: false });\n setGlobal(global);\n\n const chat = selectChat(global, update.id);\n if (chat) {\n actions.requestChatUpdate({ chatId: chat.id });\n }\n break;\n }\n\n case 'updateChatLeave': {\n const listType = selectChatListType(global, update.id);\n if (!listType) {\n break;\n }\n\n const { [listType]: listIds } = global.chats.listIds;\n\n if (listIds) {\n global = replaceChatListIds(global, listType, listIds.filter((listId) => listId !== update.id));\n }\n\n global = updateChat(global, update.id, { isNotJoined: true });\n setGlobal(global);\n\n break;\n }\n\n case 'updateChatInbox': {\n setGlobal(updateChat(global, update.id, update.chat));\n\n runThrottledForUpdateAppBadge(() => updateAppBadge(selectCountNotMutedUnread(getGlobal())));\n\n break;\n }\n\n case 'updateChatTypingStatus': {\n const { id, typingStatus } = update;\n setGlobal(updateChat(global, id, { typingStatus }));\n\n setTimeout(() => {\n const newGlobal = getGlobal();\n const chat = selectChat(newGlobal, id);\n if (chat && typingStatus && chat.typingStatus && chat.typingStatus.timestamp === typingStatus.timestamp) {\n setGlobal(updateChat(newGlobal, id, { typingStatus: undefined }));\n }\n }, TYPING_STATUS_CLEAR_DELAY);\n\n break;\n }\n\n case 'newMessage': {\n const { message } = update;\n const { chatId: currentChatId, threadId, type: messageListType } = selectCurrentMessageList(global) || {};\n\n if (message.senderId === global.currentUserId && !message.isFromScheduled) {\n return;\n }\n\n const chat = selectChat(global, update.chatId);\n if (!chat) {\n return;\n }\n\n const isActiveChat = (\n messageListType === 'thread'\n && threadId === MAIN_THREAD_ID\n && update.chatId === currentChatId\n );\n\n if (isActiveChat) {\n setTimeout(() => {\n actions.requestChatUpdate({ chatId: update.chatId });\n }, CURRENT_CHAT_UNREAD_DELAY);\n } else {\n setGlobal(updateChat(global, update.chatId, {\n unreadCount: chat.unreadCount ? chat.unreadCount + 1 : 1,\n ...(update.message.hasUnreadMention && {\n unreadMentionsCount: chat.unreadMentionsCount ? chat.unreadMentionsCount + 1 : 1,\n }),\n }));\n }\n\n updateAppBadge(selectCountNotMutedUnread(getGlobal()));\n\n const { hasWebNotifications } = selectNotifySettings(global);\n if (hasWebNotifications) {\n showNewMessageNotification({\n chat,\n message,\n isActiveChat,\n });\n }\n\n break;\n }\n\n case 'updateCommonBoxMessages':\n case 'updateChannelMessages': {\n const { ids, messageUpdate } = update;\n if (messageUpdate.hasUnreadMention !== false) {\n return;\n }\n\n ids.forEach((id) => {\n const chatId = 'channelId' in update ? update.channelId : selectCommonBoxChatId(global, id);\n const chat = selectChat(global, chatId);\n if (chat?.unreadMentionsCount) {\n global = updateChat(global, chatId, {\n unreadMentionsCount: chat.unreadMentionsCount - 1,\n });\n }\n });\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateChatFullInfo': {\n const { fullInfo } = update;\n const targetChat = global.chats.byId[update.id];\n if (!targetChat) {\n return;\n }\n\n setGlobal(updateChat(global, update.id, {\n fullInfo: {\n ...targetChat.fullInfo,\n ...fullInfo,\n },\n }));\n\n break;\n }\n\n case 'updatePinnedChatIds': {\n const { ids, folderId } = update;\n\n const listType = folderId === ARCHIVED_FOLDER_ID ? 'archived' : 'active';\n\n global = {\n ...global,\n chats: {\n ...global.chats,\n orderedPinnedIds: {\n ...global.chats.orderedPinnedIds,\n [listType]: ids.length ? ids : undefined,\n },\n },\n };\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateChatPinned': {\n const { id, isPinned } = update;\n const listType = selectChatListType(global, id);\n if (listType) {\n const { [listType]: orderedPinnedIds } = global.chats.orderedPinnedIds;\n\n let newOrderedPinnedIds = orderedPinnedIds || [];\n if (!isPinned) {\n newOrderedPinnedIds = newOrderedPinnedIds.filter((pinnedId) => pinnedId !== id);\n } else if (!newOrderedPinnedIds.includes(id)) {\n // When moving pinned chats to archive, active ordered pinned ids don't get updated\n // (to preserve chat pinned state when it returns from archive)\n // If user already has max pinned chats, we should check for orderedIds\n // that don't point to listed chats\n if (listType === 'active' && newOrderedPinnedIds.length >= MAX_ACTIVE_PINNED_CHATS) {\n const listIds = global.chats.listIds.active;\n newOrderedPinnedIds = newOrderedPinnedIds.filter((pinnedId) => listIds && listIds.includes(pinnedId));\n }\n\n newOrderedPinnedIds = [id, ...newOrderedPinnedIds];\n }\n\n global = {\n ...global,\n chats: {\n ...global.chats,\n orderedPinnedIds: {\n ...global.chats.orderedPinnedIds,\n [listType]: newOrderedPinnedIds.length ? newOrderedPinnedIds : undefined,\n },\n },\n };\n }\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateChatListType': {\n const { id, folderId } = update;\n\n setGlobal(updateChatListType(global, id, folderId));\n\n break;\n }\n\n case 'updateChatFolder': {\n const { id, folder } = update;\n const { byId: chatFoldersById, orderedIds } = global.chatFolders;\n\n const newChatFoldersById = folder\n ? { ...chatFoldersById, [id]: folder }\n : pick(\n chatFoldersById,\n Object.keys(chatFoldersById).map(Number).filter((folderId) => folderId !== id),\n );\n\n const newOrderedIds = folder\n ? orderedIds && orderedIds.includes(id) ? orderedIds : [...(orderedIds || []), id]\n : orderedIds ? orderedIds.filter((orderedId) => orderedId !== id) : undefined;\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n byId: newChatFoldersById,\n orderedIds: newOrderedIds,\n },\n });\n\n break;\n }\n\n case 'updateChatFoldersOrder': {\n const { orderedIds } = update;\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n orderedIds,\n },\n });\n\n break;\n }\n\n case 'updateRecommendedChatFolders': {\n const { folders } = update;\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n recommended: folders,\n },\n });\n\n break;\n }\n\n case 'updateChatMembers': {\n const targetChat = global.chats.byId[update.id];\n const { replacedMembers, addedMember, deletedMemberId } = update;\n if (!targetChat) {\n return;\n }\n\n let shouldUpdate = false;\n let members = targetChat.fullInfo?.members\n ? [...targetChat.fullInfo.members]\n : [];\n\n if (replacedMembers) {\n members = replacedMembers;\n shouldUpdate = true;\n } else if (addedMember) {\n if (\n !members.length\n || !members.some((m) => m.userId === addedMember.userId)\n ) {\n members.push(addedMember);\n shouldUpdate = true;\n }\n } else if (members.length && deletedMemberId) {\n const deleteIndex = members.findIndex((m) => m.userId === deletedMemberId);\n if (deleteIndex > -1) {\n members.slice(deleteIndex, 1);\n shouldUpdate = true;\n }\n }\n\n if (shouldUpdate) {\n const adminMembers = members.filter(({ isOwner, isAdmin }) => isOwner || isAdmin);\n // TODO Kicked members?\n\n setGlobal(updateChat(global, update.id, {\n membersCount: members.length,\n fullInfo: {\n ...targetChat.fullInfo,\n members,\n adminMembers,\n },\n }));\n }\n\n break;\n }\n\n case 'deleteProfilePhotos': {\n const { chatId, ids } = update;\n const chat = global.chats.byId[chatId];\n\n if (chat?.photos) {\n setGlobal(updateChat(global, chatId, {\n photos: chat.photos.filter((photo) => !ids.includes(photo.id)),\n }));\n }\n break;\n }\n\n case 'draftMessage': {\n const {\n chatId, formattedText, date, replyingToId,\n } = update;\n const chat = global.chats.byId[chatId];\n\n if (chat) {\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'draft', formattedText);\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'replyingToId', replyingToId);\n global = updateChat(global, chatId, { draftDate: date });\n\n setGlobal(global);\n }\n break;\n }\n\n case 'showInvite': {\n const { data } = update;\n\n actions.showDialog({ data });\n break;\n }\n }\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport {\n ApiUpdate, ApiMessage, ApiPollResult, ApiThreadInfo, MAIN_THREAD_ID,\n} from '../../../api/types';\n\nimport { unique } from '../../../util/iteratees';\nimport {\n updateChat,\n deleteChatMessages,\n updateChatMessage,\n updateListedIds,\n addViewportId,\n updateThreadInfo,\n replaceThreadParam,\n updateScheduledMessage,\n deleteChatScheduledMessages,\n updateThreadUnreadFromForwardedMessage,\n} from '../../reducers';\nimport { GlobalActions, GlobalState } from '../../../global/types';\nimport {\n selectChatMessage,\n selectChatMessages,\n selectIsViewportNewest,\n selectListedIds,\n selectChatMessageByPollId,\n selectCommonBoxChatId,\n selectIsChatListed,\n selectThreadInfo,\n selectThreadByMessage,\n selectPinnedIds,\n selectScheduledMessage,\n selectScheduledMessages,\n isMessageInCurrentMessageList,\n selectScheduledIds,\n selectCurrentMessageList,\n selectViewportIds,\n selectFirstUnreadId,\n selectChat,\n selectIsChatWithBot,\n} from '../../selectors';\nimport { getMessageContent, isChatPrivate, isMessageLocal } from '../../helpers';\n\nconst ANIMATION_DELAY = 350;\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'newMessage': {\n const { chatId, id, message } = update;\n global = updateWithLocalMedia(global, chatId, id, message);\n global = updateListedAndViewportIds(global, actions, message as ApiMessage);\n\n if (message.threadInfo) {\n global = updateThreadInfo(\n global,\n message.threadInfo.chatId,\n message.threadInfo.threadId,\n message.threadInfo,\n );\n }\n\n setGlobal(global);\n\n const newMessage = selectChatMessage(global, chatId, id)!;\n\n if (isMessageInCurrentMessageList(global, chatId, message as ApiMessage)) {\n if (message.isOutgoing && !(message.content?.action)) {\n const currentMessageList = selectCurrentMessageList(global);\n if (currentMessageList) {\n // We do not use `actions.focusLastMessage` as it may be set with a delay (see below)\n actions.focusMessage({\n chatId,\n threadId: currentMessageList.threadId,\n messageId: message.id,\n noHighlight: true,\n isResizingContainer: true,\n });\n }\n }\n\n const { threadInfo } = selectThreadByMessage(global, chatId, message as ApiMessage) || {};\n if (threadInfo) {\n actions.requestThreadInfoUpdate({ chatId, threadId: threadInfo.threadId });\n }\n\n // @perf Wait until scroll animation finishes or simply rely on delivery status update (which is itself delayed)\n if (!isMessageLocal(message as ApiMessage)) {\n setTimeout(() => {\n setGlobal(updateChatLastMessage(getGlobal(), chatId, newMessage));\n }, ANIMATION_DELAY);\n }\n } else {\n setGlobal(updateChatLastMessage(getGlobal(), chatId, newMessage));\n }\n\n // Edge case: New message in an old (not loaded) chat.\n if (!selectIsChatListed(global, chatId)) {\n actions.loadTopChats();\n }\n\n break;\n }\n\n case 'newScheduledMessage': {\n const { chatId, id, message } = update;\n\n global = updateWithLocalMedia(global, chatId, id, message, true);\n\n const scheduledIds = selectScheduledIds(global, chatId) || [];\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds', unique([...scheduledIds, id]));\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateMessage': {\n const { chatId, id, message } = update;\n\n const currentMessage = selectChatMessage(global, chatId, id);\n if (!currentMessage) {\n return;\n }\n\n global = updateWithLocalMedia(global, chatId, id, message);\n\n const newMessage = selectChatMessage(global, chatId, id)!;\n if (message.threadInfo) {\n global = updateThreadInfo(\n global,\n message.threadInfo.chatId,\n message.threadInfo.threadId,\n message.threadInfo,\n );\n }\n global = updateChatLastMessage(global, chatId, newMessage);\n\n setGlobal(global);\n\n // Scroll down if bot message height is changed with an updated inline keyboard.\n // A drawback: this will scroll down even if the previous scroll was not at bottom.\n const chat = selectChat(global, chatId);\n if (\n chat\n && !message.isOutgoing\n && chat.lastMessage?.id === message.id\n && selectIsChatWithBot(global, chat)\n && isMessageInCurrentMessageList(global, chatId, message as ApiMessage)\n && selectIsViewportNewest(global, chatId, message.threadInfo?.threadId || MAIN_THREAD_ID)\n ) {\n actions.focusLastMessage();\n }\n\n break;\n }\n\n case 'updateScheduledMessage': {\n const { chatId, id, message } = update;\n\n const currentMessage = selectScheduledMessage(global, chatId, id);\n if (!currentMessage) {\n return;\n }\n\n global = updateWithLocalMedia(global, chatId, id, message, true);\n const ids = Object.keys(selectScheduledMessages(global, chatId) || {}).map(Number).sort((a, b) => b - a);\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds', ids);\n setGlobal(global);\n\n break;\n }\n\n case 'updateMessageSendSucceeded': {\n const { chatId, localId, message } = update;\n\n global = updateListedAndViewportIds(global, actions, message as ApiMessage);\n\n const currentMessage = selectChatMessage(global, chatId, localId);\n\n global = deleteChatMessages(global, chatId, [localId]);\n\n // Edge case for \"Send When Online\"\n if (message.isScheduled) {\n global = deleteChatScheduledMessages(global, chatId, [localId]);\n }\n\n global = updateChatMessage(global, chatId, message.id, {\n ...currentMessage,\n ...message,\n previousLocalId: localId,\n });\n\n const newMessage = selectChatMessage(global, chatId, message.id)!;\n global = updateChatLastMessage(global, chatId, newMessage);\n\n const thread = selectThreadByMessage(global, chatId, message);\n // For some reason Telegram requires to manually mark outgoing thread messages read\n if (thread?.threadInfo) {\n actions.markMessageListRead({ maxId: message.id });\n\n global = replaceThreadParam(global, chatId, thread.threadInfo.threadId, 'threadInfo', {\n ...thread.threadInfo,\n lastMessageId: message.id,\n lastReadInboxMessageId: message.id,\n });\n }\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateScheduledMessageSendSucceeded': {\n const { chatId, localId, message } = update;\n const scheduledIds = selectScheduledIds(global, chatId) || [];\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds', [...scheduledIds, message.id]);\n\n const currentMessage = selectScheduledMessage(global, chatId, localId);\n\n global = deleteChatScheduledMessages(global, chatId, [localId]);\n global = updateScheduledMessage(global, chatId, message.id, {\n ...currentMessage,\n ...message,\n previousLocalId: localId,\n });\n\n setGlobal(global);\n break;\n }\n\n case 'updatePinnedIds': {\n const { chatId, isPinned, messageIds } = update;\n\n const currentPinnedIds = selectPinnedIds(global, chatId) || [];\n const newPinnedIds = isPinned\n ? [...currentPinnedIds, ...messageIds].sort((a, b) => b - a)\n : currentPinnedIds.filter((id) => !messageIds.includes(id));\n\n setGlobal(replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'pinnedIds', newPinnedIds));\n\n break;\n }\n\n case 'updateThreadInfo': {\n const {\n chatId, threadId, threadInfo, firstMessageId,\n } = update;\n\n const currentThreadInfo = selectThreadInfo(global, chatId, threadId);\n const newTheadInfo = {\n ...currentThreadInfo,\n ...threadInfo,\n };\n\n if (!newTheadInfo.threadId) {\n return;\n }\n\n global = updateThreadInfo(global, chatId, threadId, newTheadInfo as ApiThreadInfo);\n\n if (firstMessageId) {\n global = replaceThreadParam(global, chatId, threadId, 'firstMessageId', firstMessageId);\n }\n\n setGlobal(global);\n\n break;\n }\n\n case 'resetMessages': {\n const { id: chatId } = update;\n const messagesById = selectChatMessages(global, chatId);\n\n if (messagesById && !isChatPrivate(chatId)) {\n global = deleteChatMessages(global, chatId, Object.keys(messagesById).map(Number));\n setGlobal(global);\n actions.loadFullChat({ chatId, force: true });\n }\n\n break;\n }\n\n case 'deleteMessages': {\n const { ids, chatId } = update;\n\n deleteMessages(chatId, ids, actions, global);\n break;\n }\n\n case 'deleteScheduledMessages': {\n const { ids, chatId } = update;\n\n deleteScheduledMessages(chatId, ids, actions, global);\n break;\n }\n\n case 'deleteHistory': {\n const { chatId } = update;\n const chatMessages = global.messages.byChatId[chatId];\n if (chatMessages) {\n const ids = Object.keys(chatMessages.byId).map(Number);\n deleteMessages(chatId, ids, actions, global);\n } else {\n actions.requestChatUpdate({ chatId });\n }\n\n break;\n }\n\n case 'updateCommonBoxMessages': {\n const { ids, messageUpdate } = update;\n\n ids.forEach((id) => {\n const chatId = selectCommonBoxChatId(global, id);\n if (chatId) {\n global = updateChatMessage(global, chatId, id, messageUpdate);\n }\n });\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateChannelMessages': {\n const { channelId, ids, messageUpdate } = update;\n\n ids.forEach((id) => {\n global = updateChatMessage(global, channelId, id, messageUpdate);\n });\n\n setGlobal(global);\n\n break;\n }\n\n case 'updateMessagePoll': {\n const { pollId, pollUpdate } = update;\n\n const message = selectChatMessageByPollId(global, pollId);\n\n if (message?.content.poll) {\n const updatedPoll = { ...message.content.poll, ...pollUpdate };\n\n // Workaround for poll update bug: `chosen` option gets reset when someone votes after current user\n const { results: updatedResults } = updatedPoll.results || {};\n if (updatedResults && !updatedResults.some(((result) => result.isChosen))) {\n const { results } = message.content.poll.results;\n const chosenAnswers = results && results.filter((result) => result.isChosen);\n if (chosenAnswers) {\n chosenAnswers.forEach((chosenAnswer) => {\n const chosenAnswerIndex = updatedResults.findIndex((result) => result.option === chosenAnswer.option);\n if (chosenAnswerIndex >= 0) {\n updatedPoll.results.results![chosenAnswerIndex].isChosen = true;\n }\n });\n }\n }\n\n setGlobal(updateChatMessage(\n global,\n message.chatId,\n message.id,\n {\n content: {\n ...message.content,\n poll: updatedPoll,\n },\n },\n ));\n }\n break;\n }\n\n case 'updateMessagePollVote': {\n const { pollId, userId, options } = update;\n const message = selectChatMessageByPollId(global, pollId);\n if (!message || !message.content.poll || !message.content.poll.results) {\n break;\n }\n\n const { poll } = message.content;\n\n const { recentVoterIds, totalVoters, results } = poll.results;\n const newRecentVoterIds = recentVoterIds ? [...recentVoterIds] : [];\n const newTotalVoters = totalVoters ? totalVoters + 1 : 1;\n const newResults = results ? [...results] : [];\n\n newRecentVoterIds.push(userId);\n\n options.forEach((option) => {\n const targetOption = newResults.find((result) => result.option === option);\n const targetOptionIndex = newResults.findIndex((result) => result.option === option);\n const updatedOption: ApiPollResult = targetOption ? { ...targetOption } : { option, votersCount: 0 };\n\n updatedOption.votersCount += 1;\n if (userId === global.currentUserId) {\n updatedOption.isChosen = true;\n }\n\n if (targetOptionIndex) {\n newResults[targetOptionIndex] = updatedOption;\n } else {\n newResults.push(updatedOption);\n }\n });\n\n setGlobal(updateChatMessage(\n global,\n message.chatId,\n message.id,\n {\n content: {\n ...message.content,\n poll: {\n ...poll,\n results: {\n ...poll.results,\n recentVoterIds: newRecentVoterIds,\n totalVoters: newTotalVoters,\n results: newResults,\n },\n },\n },\n },\n ));\n\n break;\n }\n }\n});\n\nfunction updateWithLocalMedia(\n global: GlobalState, chatId: number, id: number, message: Partial, isScheduled = false,\n) {\n // Preserve locally uploaded media.\n const currentMessage = isScheduled\n ? selectScheduledMessage(global, chatId, id)\n : selectChatMessage(global, chatId, id);\n if (currentMessage && message.content) {\n const {\n photo, video, sticker, document,\n } = getMessageContent(currentMessage);\n if (photo && message.content.photo) {\n message.content.photo.blobUrl = photo.blobUrl;\n message.content.photo.thumbnail = photo.thumbnail;\n } else if (video && message.content.video) {\n message.content.video.blobUrl = video.blobUrl;\n } else if (sticker && message.content.sticker) {\n message.content.sticker.isPreloadedGlobally = sticker.isPreloadedGlobally;\n } else if (document && message.content.document) {\n message.content.document.previewBlobUrl = document.previewBlobUrl;\n }\n }\n\n return isScheduled\n ? updateScheduledMessage(global, chatId, id, message)\n : updateChatMessage(global, chatId, id, message);\n}\n\nfunction updateThreadUnread(global: GlobalState, actions: GlobalActions, message: ApiMessage, isDeleting?: boolean) {\n const { chatId } = message;\n\n const { threadInfo } = selectThreadByMessage(global, chatId, message) || {};\n\n if (!threadInfo && message.replyToMessageId) {\n const originMessage = selectChatMessage(global, chatId, message.replyToMessageId);\n if (originMessage) {\n global = updateThreadUnreadFromForwardedMessage(global, originMessage, chatId, message.id, isDeleting);\n } else {\n actions.loadMessage({\n chatId,\n messageId: message.replyToMessageId,\n threadUpdate: {\n isDeleting,\n lastMessageId: message.id,\n },\n });\n }\n }\n\n return global;\n}\n\nfunction updateListedAndViewportIds(global: GlobalState, actions: GlobalActions, message: ApiMessage) {\n const { id, chatId } = message;\n\n const { threadInfo, firstMessageId } = selectThreadByMessage(global, chatId, message) || {};\n\n const chat = selectChat(global, chatId);\n const isUnreadChatNotLoaded = chat?.unreadCount && !selectListedIds(global, chatId, MAIN_THREAD_ID);\n\n global = updateThreadUnread(global, actions, message);\n\n if (threadInfo) {\n if (firstMessageId || !isMessageLocal(message)) {\n global = updateListedIds(global, chatId, threadInfo.threadId, [id]);\n\n if (selectIsViewportNewest(global, chatId, threadInfo.threadId)) {\n global = addViewportId(global, chatId, threadInfo.threadId, id);\n\n if (!firstMessageId) {\n global = replaceThreadParam(global, chatId, threadInfo.threadId, 'firstMessageId', message.id);\n }\n }\n }\n\n global = replaceThreadParam(global, chatId, threadInfo.threadId, 'threadInfo', {\n ...threadInfo,\n lastMessageId: message.id,\n messagesCount: threadInfo.messagesCount + 1,\n });\n }\n\n if (isUnreadChatNotLoaded) {\n return global;\n }\n\n global = updateListedIds(global, chatId, MAIN_THREAD_ID, [id]);\n\n if (selectIsViewportNewest(global, chatId, MAIN_THREAD_ID)) {\n // Always keep the first unread message in the viewport list\n const firstUnreadId = selectFirstUnreadId(global, chatId, MAIN_THREAD_ID);\n const newGlobal = addViewportId(global, chatId, MAIN_THREAD_ID, id);\n const newViewportIds = selectViewportIds(newGlobal, chatId, MAIN_THREAD_ID);\n\n if (!firstUnreadId || newViewportIds!.includes(firstUnreadId)) {\n global = newGlobal;\n }\n }\n\n return global;\n}\n\nfunction updateChatLastMessage(\n global: GlobalState,\n chatId: number,\n message: ApiMessage,\n force = false,\n) {\n const { chats } = global;\n const currentLastMessage = chats.byId[chatId]?.lastMessage;\n\n if (currentLastMessage && !force) {\n const isSameOrNewer = (\n currentLastMessage.id === message.id || currentLastMessage.id === message.previousLocalId\n ) || message.id > currentLastMessage.id;\n\n if (!isSameOrNewer) {\n return global;\n }\n }\n\n return updateChat(global, chatId, { lastMessage: message });\n}\n\nfunction findLastMessage(global: GlobalState, chatId: number) {\n const byId = selectChatMessages(global, chatId);\n const listedIds = selectListedIds(global, chatId, MAIN_THREAD_ID);\n\n if (!byId || !listedIds) {\n return undefined;\n }\n\n let i = listedIds.length;\n while (i--) {\n const message = byId[listedIds[i]];\n if (!message.isDeleting) {\n return message;\n }\n }\n\n return undefined;\n}\n\nfunction deleteMessages(chatId: number | undefined, ids: number[], actions: GlobalActions, global: GlobalState) {\n // Channel update\n\n if (chatId) {\n ids.forEach((id) => {\n global = updateChatMessage(global, chatId, id, {\n isDeleting: true,\n });\n\n const newLastMessage = findLastMessage(global, chatId);\n if (newLastMessage) {\n global = updateChatLastMessage(global, chatId, newLastMessage, true);\n }\n });\n\n setGlobal(global);\n\n actions.requestChatUpdate({ chatId });\n\n const threadIdsToUpdate: number[] = [];\n\n ids.forEach((id) => {\n const message = selectChatMessage(global, chatId, id);\n if (!message) {\n return;\n }\n\n global = updateThreadUnread(global, actions, message, true);\n\n const { threadInfo } = selectThreadByMessage(global, chatId, message) || {};\n if (threadInfo) {\n threadIdsToUpdate.push(threadInfo.threadId);\n }\n });\n\n setGlobal(global);\n\n setTimeout(() => {\n setGlobal(deleteChatMessages(getGlobal(), chatId, ids));\n\n unique(threadIdsToUpdate).forEach((threadId) => {\n actions.requestThreadInfoUpdate({ chatId, threadId });\n });\n }, ANIMATION_DELAY);\n\n return;\n }\n\n // Common box update\n\n const chatsIdsToUpdate: number[] = [];\n\n ids.forEach((id) => {\n const commonBoxChatId = selectCommonBoxChatId(global, id);\n if (commonBoxChatId) {\n chatsIdsToUpdate.push(commonBoxChatId);\n\n global = updateChatMessage(global, commonBoxChatId, id, {\n isDeleting: true,\n });\n\n const newLastMessage = findLastMessage(global, commonBoxChatId);\n if (newLastMessage) {\n global = updateChatLastMessage(global, commonBoxChatId, newLastMessage, true);\n }\n\n setTimeout(() => {\n setGlobal(deleteChatMessages(getGlobal(), commonBoxChatId, [id]));\n }, ANIMATION_DELAY);\n }\n });\n\n setGlobal(global);\n\n unique(chatsIdsToUpdate).forEach((id) => {\n actions.requestChatUpdate({ chatId: id });\n });\n}\n\nfunction deleteScheduledMessages(\n chatId: number | undefined, ids: number[], actions: GlobalActions, global: GlobalState,\n) {\n if (!chatId) {\n return;\n }\n\n ids.forEach((id) => {\n global = updateScheduledMessage(global, chatId, id, {\n isDeleting: true,\n });\n });\n\n setGlobal(global);\n\n setTimeout(() => {\n global = deleteChatScheduledMessages(getGlobal(), chatId, ids);\n const scheduledMessages = selectScheduledMessages(global, chatId);\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'scheduledIds', Object.keys(scheduledMessages || {}).map(Number),\n );\n setGlobal(global);\n }, ANIMATION_DELAY);\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate, ApiUserStatus } from '../../../api/types';\n\nimport { deleteUser, updateUser } from '../../reducers';\nimport { throttle } from '../../../util/schedulers';\n\nconst STATUS_UPDATE_THROTTLE = 3000;\n\nconst flushStatusUpdatesThrottled = throttle(flushStatusUpdates, STATUS_UPDATE_THROTTLE, true);\n\nlet pendingStatusUpdates: [number, ApiUserStatus][] = [];\n\nfunction scheduleStatusUpdate(userId: number, statusUpdate: ApiUserStatus) {\n pendingStatusUpdates.push([userId, statusUpdate]);\n flushStatusUpdatesThrottled();\n}\n\nfunction flushStatusUpdates() {\n let global = getGlobal();\n pendingStatusUpdates.forEach(([userId, statusUpdate]) => {\n global = updateUser(global, userId, {\n status: statusUpdate,\n });\n });\n setGlobal(global);\n\n pendingStatusUpdates = [];\n}\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'deleteUser': {\n return deleteUser(global, update.id);\n }\n\n case 'updateUser': {\n return updateUser(global, update.id, update.user);\n }\n\n case 'updateUserStatus': {\n // Status updates come very often so we throttle them\n scheduleStatusUpdate(update.userId, update.status);\n return undefined;\n }\n\n case 'updateUserFullInfo': {\n const { id, fullInfo } = update;\n const targetUser = global.users.byId[id];\n if (!targetUser) {\n return undefined;\n }\n\n return updateUser(global, id, {\n fullInfo: {\n ...targetUser.fullInfo,\n ...fullInfo,\n },\n });\n }\n }\n\n return undefined;\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\n\nimport { updateStickerSet } from '../../reducers';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'updateStickerSet': {\n return updateStickerSet(global, update.id, update.stickerSet);\n }\n }\n\n return undefined;\n});\n","import {\n addReducer, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\nimport { ApiPrivacyKey } from '../../../types';\n\nimport { addBlockedContact, removeBlockedContact } from '../../reducers';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n switch (update['@type']) {\n case 'updatePeerBlocked':\n if (update.isBlocked) {\n return addBlockedContact(getGlobal(), update.id);\n } else {\n return removeBlockedContact(getGlobal(), update.id);\n }\n\n case 'updateResetContactList':\n setGlobal({\n ...getGlobal(),\n contactList: {\n hash: 0,\n userIds: [],\n },\n });\n break;\n\n case 'updateFavoriteStickers':\n actions.loadFavoriteStickers();\n break;\n\n case 'updatePrivacy':\n global.settings.privacy[update.key as ApiPrivacyKey] = update.rules;\n break;\n }\n\n return undefined;\n});\n","import { addReducer, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\nimport { GlobalState } from '../../../global/types';\nimport { addNotifyException, updateChat, updateNotifySettings } from '../../reducers';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate): GlobalState | undefined => {\n switch (update['@type']) {\n case 'updateNotifySettings': {\n return updateNotifySettings(global, update.peerType, update.isSilent, update.shouldShowPreviews);\n }\n\n case 'updateNotifyExceptions': {\n const {\n chatId, isMuted, isSilent, shouldShowPreviews,\n } = update;\n const chat = global.chats.byId[chatId];\n\n if (chat) {\n global = updateChat(global, chatId, { isMuted });\n }\n\n setGlobal(addNotifyException(global, chatId, { isMuted, isSilent, shouldShowPreviews }));\n break;\n }\n }\n\n return undefined;\n});\n","import { addReducer } from '../../../lib/teact/teactn';\n\nimport { ApiUpdate } from '../../../api/types';\nimport { GlobalState } from '../../../global/types';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate): GlobalState | undefined => {\n switch (update['@type']) {\n case 'updateTwoFaStateWaitCode': {\n return {\n ...global,\n twoFaSettings: {\n ...global.twoFaSettings,\n isLoading: false,\n waitingEmailCodeLength: update.length,\n },\n };\n }\n\n case 'updateTwoFaError': {\n return {\n ...global,\n twoFaSettings: {\n ...global.twoFaSettings,\n error: update.message,\n },\n };\n }\n }\n\n return undefined;\n});\n","import { useEffect } from '../lib/teact/teact';\n\nimport { onBeforeUnload } from '../util/schedulers';\n\nexport default function useBeforeUnload(callback: AnyToVoidFunction) {\n useEffect(() => {\n return onBeforeUnload(callback);\n }, [callback]);\n}\n","import { useEffect } from '../lib/teact/teact';\nimport { IS_IOS } from '../util/environment';\n\nexport default function usePreventIosPinchZoom(isDisabled = false) {\n // Disable viewport zooming on iOS Safari\n useEffect(() => {\n if (!IS_IOS || isDisabled) {\n return undefined;\n }\n\n document.addEventListener('gesturestart', preventEvent);\n\n return () => {\n document.removeEventListener('gesturestart', preventEvent);\n };\n }, [isDisabled]);\n}\n\nfunction preventEvent(e: Event) {\n e.preventDefault();\n}\n","import { useEffect, useState } from '../lib/teact/teact';\n\nexport default function useBrowserOnline() {\n const [isOnline, setIsOnline] = useState(window.navigator.onLine);\n\n useEffect(() => {\n function handleChange() {\n setIsOnline(window.navigator.onLine);\n }\n\n window.addEventListener('online', handleChange);\n window.addEventListener('offline', handleChange);\n\n return () => {\n window.removeEventListener('offline', handleChange);\n window.removeEventListener('online', handleChange);\n };\n }, []);\n\n return isOnline;\n}\n","import React, {\n FC, useCallback, useMemo, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { LeftColumnContent, ISettings } from '../../../types';\nimport { ApiChat } from '../../../api/types';\n\nimport {\n ANIMATION_LEVEL_MAX, APP_NAME, APP_VERSION, FEEDBACK_URL,\n} from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport { pick } from '../../../util/iteratees';\nimport { isChatArchived } from '../../../modules/helpers';\nimport { formatDateToString } from '../../../util/dateFormat';\nimport { selectTheme } from '../../../modules/selectors';\nimport switchTheme from '../../../util/switchTheme';\nimport useLang from '../../../hooks/useLang';\nimport { disableHistoryBack } from '../../../hooks/useHistoryBack';\n\nimport DropdownMenu from '../../ui/DropdownMenu';\nimport MenuItem from '../../ui/MenuItem';\nimport Button from '../../ui/Button';\nimport SearchInput from '../../ui/SearchInput';\nimport PickerSelectedItem from '../../common/PickerSelectedItem';\nimport Switcher from '../../ui/Switcher';\n\nimport './LeftMainHeader.scss';\n\ntype OwnProps = {\n content: LeftColumnContent;\n contactsFilter: string;\n shouldSkipTransition?: boolean;\n onSearchQuery: (query: string) => void;\n onSelectSettings: () => void;\n onSelectContacts: () => void;\n onSelectArchived: () => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n searchQuery?: string;\n isLoading: boolean;\n currentUserId?: number;\n globalSearchChatId?: number;\n searchDate?: number;\n theme: ISettings['theme'];\n animationLevel: 0 | 1 | 2;\n chatsById?: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst ANIMATION_LEVEL_OPTIONS = [0, 1, 2];\n\nconst PRODUCTION_HOSTNAME = 'web.telegram.org';\nconst LEGACY_VERSION_URL = 'https://web.telegram.org/?legacy=1';\nconst WEBK_VERSION_URL = 'https://web.telegram.org/k/';\nconst PERMANENT_VERSION_KEY = 'kz_version';\n\nconst LeftMainHeader: FC = ({\n content,\n contactsFilter,\n onSearchQuery,\n onSelectSettings,\n onSelectContacts,\n onSelectArchived,\n setGlobalSearchChatId,\n onReset,\n searchQuery,\n isLoading,\n shouldSkipTransition,\n currentUserId,\n globalSearchChatId,\n searchDate,\n theme,\n animationLevel,\n chatsById,\n openChat,\n openTipsChat,\n setGlobalSearchDate,\n setSettingOption,\n}) => {\n const lang = useLang();\n const hasMenu = content === LeftColumnContent.ChatList;\n const clearedDateSearchParam = { date: undefined };\n const clearedChatSearchParam = { id: undefined };\n const selectedSearchDate = useMemo(() => {\n return searchDate\n ? formatDateToString(new Date(searchDate * 1000))\n : undefined;\n }, [searchDate]);\n const archivedUnreadChatsCount = useMemo(() => {\n if (!hasMenu || !chatsById) {\n return 0;\n }\n\n return Object.values(chatsById).reduce((total, chat) => {\n if (!isChatArchived(chat)) {\n return total;\n }\n\n return chat.unreadCount ? total + 1 : total;\n }, 0);\n }, [hasMenu, chatsById]);\n\n const withOtherVersions = window.location.hostname === PRODUCTION_HOSTNAME;\n\n const MainButton: FC<{ onTrigger: () => void; isOpen?: boolean }> = useMemo(() => {\n return ({ onTrigger, isOpen }) => (\n onReset()}\n ariaLabel={hasMenu ? lang('AccDescrOpenMenu2') : 'Return to chat list'}\n >\n
\n \n );\n }, [hasMenu, lang, onReset, shouldSkipTransition]);\n\n const handleSearchFocus = useCallback(() => {\n if (!searchQuery) {\n onSearchQuery('');\n }\n }, [searchQuery, onSearchQuery]);\n\n const handleSelectSaved = useCallback(() => {\n openChat({ id: currentUserId, shouldReplaceHistory: true });\n }, [currentUserId, openChat]);\n\n const handleDarkModeToggle = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n const newTheme = theme === 'light' ? 'dark' : 'light';\n\n setSettingOption({ theme: newTheme });\n setSettingOption({ shouldUseSystemTheme: false });\n switchTheme(newTheme, animationLevel === ANIMATION_LEVEL_MAX);\n }, [animationLevel, setSettingOption, theme]);\n\n const handleAnimationLevelChange = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n\n const newLevel = animationLevel === 0 ? 2 : 0;\n ANIMATION_LEVEL_OPTIONS.forEach((_, i) => {\n document.body.classList.toggle(`animation-level-${i}`, newLevel === i);\n });\n\n setSettingOption({ animationLevel: newLevel });\n }, [animationLevel, setSettingOption]);\n\n const handleSwitchToWebK = () => {\n localStorage.setItem(PERMANENT_VERSION_KEY, JSON.stringify('K'));\n disableHistoryBack();\n };\n\n const handleOpenTipsChat = () => {\n openTipsChat({ langCode: lang.code });\n };\n\n const isSearchFocused = (\n Boolean(globalSearchChatId)\n || content === LeftColumnContent.GlobalSearch\n || content === LeftColumnContent.Contacts\n );\n\n const searchInputPlaceholder = content === LeftColumnContent.Contacts\n ? lang('SearchFriends')\n : lang('Search');\n\n return (\n
\n
\n \n \n {lang('SavedMessages')}\n \n \n {lang('ArchivedChats')}\n {archivedUnreadChatsCount > 0 && (\n
{archivedUnreadChatsCount}
\n )}\n \n \n {lang('Contacts')}\n \n \n {lang('Settings')}\n \n \n {lang('lng_menu_night_mode')}\n \n \n \n {lang('Appearance.Animations').toLowerCase()}\n 0}\n />\n \n \n {lang('TelegramFeatures')}\n \n \n Report Bug\n \n {withOtherVersions && (\n <>\n \n Switch to K Version\n \n \n Switch to Old Version\n \n \n )}\n \n \n {selectedSearchDate && (\n \n )}\n {globalSearchChatId && (\n \n )}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n query: searchQuery, fetchingStatus, chatId, date,\n } = global.globalSearch;\n const { currentUserId } = global;\n const { byId: chatsById } = global.chats;\n const { animationLevel } = global.settings.byKey;\n\n return {\n searchQuery,\n isLoading: fetchingStatus ? Boolean(fetchingStatus.chats || fetchingStatus.messages) : false,\n currentUserId,\n chatsById,\n globalSearchChatId: chatId,\n searchDate: date,\n theme: selectTheme(global),\n animationLevel,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat',\n 'openTipsChat',\n 'setGlobalSearchDate',\n 'setGlobalSearchChatId',\n 'setSettingOption',\n ]),\n)(LeftMainHeader));\n","import React, { memo, FC } from '../../lib/teact/teact';\n\nimport { GlobalState } from '../../global/types';\n\nimport useLang from '../../hooks/useLang';\n\nimport Spinner from '../ui/Spinner';\n\nimport './ConnectionState.scss';\n\ntype StateProps = Pick;\n\nconst ConnectionState: FC = () => {\n const lang = useLang();\n\n return (\n
\n \n
{lang('WaitingForNetwork')}
\n
\n );\n};\n\nexport default memo(ConnectionState);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatFolder, ApiUser } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { NotifyException, NotifySettings, SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { buildCollectionByKey, pick } from '../../../util/iteratees';\nimport { captureEvents, SwipeDirection } from '../../../util/captureEvents';\nimport { getFolderUnreadDialogs } from '../../../modules/helpers';\nimport { selectNotifyExceptions, selectNotifySettings } from '../../../modules/selectors';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\nimport useThrottledMemo from '../../../hooks/useThrottledMemo';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\n\nimport Transition from '../../ui/Transition';\nimport TabList from '../../ui/TabList';\nimport ChatList from './ChatList';\n\ntype OwnProps = {\n onScreenSelect: (screen: SettingsScreens) => void;\n foldersDispatch: FolderEditDispatch;\n};\n\ntype StateProps = {\n chatsById: Record;\n usersById: Record;\n chatFoldersById: Record;\n notifySettings: NotifySettings;\n notifyExceptions?: Record;\n orderedFolderIds?: number[];\n activeChatFolder: number;\n currentUserId?: number;\n lastSyncTime?: number;\n shouldSkipHistoryAnimations?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst INFO_THROTTLE = 3000;\nconst SAVED_MESSAGES_HOTKEY = '0';\n\nconst ChatFolders: FC = ({\n chatsById,\n usersById,\n chatFoldersById,\n notifySettings,\n notifyExceptions,\n orderedFolderIds,\n activeChatFolder,\n currentUserId,\n lastSyncTime,\n shouldSkipHistoryAnimations,\n foldersDispatch,\n onScreenSelect,\n loadChatFolders,\n setActiveChatFolder,\n openChat,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const transitionRef = useRef(null);\n\n const lang = useLang();\n\n useEffect(() => {\n if (lastSyncTime) {\n loadChatFolders();\n }\n }, [lastSyncTime, loadChatFolders]);\n\n const displayedFolders = useMemo(() => {\n return orderedFolderIds\n ? orderedFolderIds.map((id) => chatFoldersById[id] || {}).filter(Boolean)\n : undefined;\n }, [chatFoldersById, orderedFolderIds]);\n\n const folderCountersById = useThrottledMemo(() => {\n if (!displayedFolders || !displayedFolders.length) {\n return undefined;\n }\n\n const chatIds = Object.keys(chatsById).map(Number);\n const counters = displayedFolders.map((folder) => {\n const {\n unreadDialogsCount, hasActiveDialogs,\n } = getFolderUnreadDialogs(chatsById, usersById, folder, chatIds, notifySettings, notifyExceptions) || {};\n\n return {\n id: folder.id,\n badgeCount: unreadDialogsCount,\n isBadgeActive: hasActiveDialogs,\n };\n });\n\n return buildCollectionByKey(counters, 'id');\n }, INFO_THROTTLE, [displayedFolders, chatsById, usersById, notifySettings, notifyExceptions]);\n\n const folderTabs = useMemo(() => {\n if (!displayedFolders || !displayedFolders.length) {\n return undefined;\n }\n\n return [\n { title: lang.code === 'en' ? 'All' : lang('FilterAllChats') },\n ...displayedFolders.map((folder) => ({\n title: folder.title,\n ...(folderCountersById?.[folder.id]),\n })),\n ];\n }, [displayedFolders, folderCountersById, lang]);\n\n const handleSwitchTab = useCallback((index: number) => {\n setActiveChatFolder(index);\n }, [setActiveChatFolder]);\n\n // Prevent `activeTab` pointing at non-existing folder after update\n useEffect(() => {\n if (!folderTabs || !folderTabs.length) {\n return;\n }\n\n if (activeChatFolder >= folderTabs.length) {\n setActiveChatFolder(0);\n }\n }, [activeChatFolder, folderTabs, setActiveChatFolder]);\n\n useEffect(() => {\n if (!transitionRef.current || !IS_TOUCH_ENV || !folderTabs || !folderTabs.length) {\n return undefined;\n }\n\n return captureEvents(transitionRef.current, {\n selectorToPreventScroll: '.chat-list',\n onSwipe: ((e, direction) => {\n if (direction === SwipeDirection.Left) {\n setActiveChatFolder(Math.min(activeChatFolder + 1, folderTabs.length - 1));\n return true;\n } else if (direction === SwipeDirection.Right) {\n setActiveChatFolder(Math.max(0, activeChatFolder - 1));\n return true;\n }\n\n return false;\n }),\n });\n }, [activeChatFolder, folderTabs, setActiveChatFolder]);\n\n const isNotInAllTabRef = useRef();\n isNotInAllTabRef.current = activeChatFolder !== 0;\n useEffect(() => (isNotInAllTabRef.current ? captureEscKeyListener(() => {\n if (isNotInAllTabRef.current) {\n setActiveChatFolder(0);\n }\n }) : undefined), [activeChatFolder, setActiveChatFolder]);\n\n useHistoryBack(activeChatFolder !== 0, () => setActiveChatFolder(0));\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.ctrlKey && e.shiftKey && e.code.startsWith('Digit') && folderTabs) {\n const [, digit] = e.code.match(/Digit(\\d)/) || [];\n if (!digit) return;\n\n if (digit === SAVED_MESSAGES_HOTKEY) {\n openChat({ id: currentUserId, shouldReplaceHistory: true });\n return;\n }\n\n const folder = Number(digit) - 1;\n if (folder > folderTabs.length - 1) return;\n\n setActiveChatFolder(folder);\n e.preventDefault();\n }\n };\n\n document.addEventListener('keydown', handleKeyDown, true);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, true);\n };\n });\n\n const {\n shouldRender: shouldRenderPlaceholder, transitionClassNames,\n } = useShowTransition(!orderedFolderIds, undefined, true);\n\n function renderCurrentTab(isActive: boolean) {\n const activeFolder = Object.values(chatFoldersById)\n .find(({ title }) => title === folderTabs![activeChatFolder].title);\n\n if (!activeFolder || activeChatFolder === 0) {\n return (\n \n );\n }\n\n return (\n \n );\n }\n\n return (\n
\n {folderTabs?.length ? (\n \n ) : shouldRenderPlaceholder ? (\n
\n ) : undefined}\n \n {renderCurrentTab}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chats: { byId: chatsById },\n users: { byId: usersById },\n chatFolders: {\n byId: chatFoldersById,\n orderedIds: orderedFolderIds,\n activeChatFolder,\n },\n currentUserId,\n lastSyncTime,\n shouldSkipHistoryAnimations,\n } = global;\n\n return {\n chatsById,\n usersById,\n chatFoldersById,\n orderedFolderIds,\n lastSyncTime,\n notifySettings: selectNotifySettings(global),\n notifyExceptions: selectNotifyExceptions(global),\n activeChatFolder,\n currentUserId,\n shouldSkipHistoryAnimations,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadChatFolders',\n 'setActiveChatFolder',\n 'openChat',\n ]),\n)(ChatFolders));\n","import { useState } from '../lib/teact/teact';\n\nimport useThrottle from './useThrottle';\nimport useOnChange from './useOnChange';\nimport useHeavyAnimationCheck from './useHeavyAnimationCheck';\nimport useFlag from './useFlag';\n\nexport default (resolverFn: () => R, ms: number, dependencies: D) => {\n const runThrottled = useThrottle(ms, true);\n const [value, setValue] = useState();\n const [isFrozen, freeze, unfreeze] = useFlag();\n\n useHeavyAnimationCheck(freeze, unfreeze);\n\n useOnChange(() => {\n if (isFrozen) {\n return;\n }\n\n runThrottled(() => {\n setValue(resolverFn());\n });\n }, dependencies.concat([isFrozen]));\n\n return value;\n};\n","import { useMemo } from '../lib/teact/teact';\n\nimport { throttle } from '../util/schedulers';\n\nexport default (ms: number, noFirst = false) => {\n return useMemo(() => {\n return throttle((cb) => cb(), ms, !noFirst);\n }, [ms, noFirst]);\n};\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\nimport { OwnProps } from './LeftSearch';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\nimport Loading from '../../ui/Loading';\n\nconst LeftSearchAsync: FC = (props) => {\n const LeftSearch = useModuleLoader(Bundles.Extra, 'LeftSearch');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return LeftSearch ? : ;\n};\n\nexport default memo(LeftSearchAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\nimport { OwnProps } from './ContactList';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\nimport Loading from '../../ui/Loading';\n\nconst ContactListAsync: FC = (props) => {\n const ContactList = useModuleLoader(Bundles.Extra, 'ContactList');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ContactList ? : ;\n};\n\nexport default memo(ContactListAsync);\n","import React, {\n FC, useCallback, useState, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport Menu from '../ui/Menu';\nimport MenuItem from '../ui/MenuItem';\n\nimport './NewChatButton.scss';\n\nconst MENU_CLOSE_DELAY_MS = 750;\nlet closeTimeout: number | undefined;\n\ntype OwnProps = {\n isShown: boolean;\n onNewPrivateChat: () => void;\n onNewChannel: () => void;\n onNewGroup: () => void;\n};\n\nconst NewChatButton: FC = ({\n isShown,\n onNewPrivateChat,\n onNewChannel,\n onNewGroup,\n}) => {\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n\n useEffect(() => {\n if (!isShown) {\n setIsMenuOpen(false);\n }\n }, [isShown]);\n\n const lang = useLang();\n\n const fabClassName = buildClassName(\n 'NewChatButton',\n isShown && 'revealed',\n isMenuOpen && 'menu-is-open',\n );\n\n const toggleIsMenuOpen = () => {\n setIsMenuOpen(!isMenuOpen);\n };\n\n const handleClose = () => {\n setIsMenuOpen(false);\n };\n\n const handleMouseEnter = useCallback(() => {\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n\n closeTimeout = window.setTimeout(() => {\n setIsMenuOpen(false);\n }, MENU_CLOSE_DELAY_MS);\n }, []);\n\n return (\n \n \n \n \n \n \n {lang('NewChannel')}\n {lang('NewGroup')}\n {lang('NewMessageTitle')}\n \n
\n );\n};\n\nexport default memo(NewChatButton);\n","import React, {\n FC, useState, useRef, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\nimport { LeftColumnContent, SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\nimport buildClassName from '../../../util/buildClassName';\nimport useBrowserOnline from '../../../hooks/useBrowserOnline';\nimport useFlag from '../../../hooks/useFlag';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useLang from '../../../hooks/useLang';\n\nimport Transition from '../../ui/Transition';\nimport LeftMainHeader from './LeftMainHeader';\nimport ConnectionState from '../ConnectionState';\nimport ChatFolders from './ChatFolders';\nimport LeftSearch from '../search/LeftSearch.async';\nimport ContactList from './ContactList.async';\nimport NewChatButton from '../NewChatButton';\nimport ShowTransition from '../../ui/ShowTransition';\nimport Button from '../../ui/Button';\n\nimport './LeftMain.scss';\n\ntype OwnProps = {\n content: LeftColumnContent;\n searchQuery?: string;\n searchDate?: number;\n contactsFilter: string;\n shouldSkipTransition?: boolean;\n foldersDispatch: FolderEditDispatch;\n onSearchQuery: (query: string) => void;\n onContentChange: (content: LeftColumnContent) => void;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = Pick;\n\nconst TRANSITION_RENDER_COUNT = Object.keys(LeftColumnContent).length / 2;\nconst BUTTON_CLOSE_DELAY_MS = 250;\nconst APP_OUTDATED_TIMEOUT = 3 * 24 * 60 * 60 * 1000; // 3 days\n\nlet closeTimeout: number | undefined;\n\nconst LeftMain: FC = ({\n content,\n searchQuery,\n searchDate,\n contactsFilter,\n shouldSkipTransition,\n foldersDispatch,\n onSearchQuery,\n onContentChange,\n onScreenSelect,\n onReset,\n connectionState,\n}) => {\n const [isNewChatButtonShown, setIsNewChatButtonShown] = useState(IS_TOUCH_ENV);\n\n const isBrowserOnline = useBrowserOnline();\n const isConnecting = !isBrowserOnline || connectionState === 'connectionStateConnecting';\n\n const isMouseInside = useRef(false);\n\n const handleSelectSettings = useCallback(() => {\n onContentChange(LeftColumnContent.Settings);\n }, [onContentChange]);\n\n const handleSelectContacts = useCallback(() => {\n onContentChange(LeftColumnContent.Contacts);\n }, [onContentChange]);\n\n const handleSelectNewChannel = useCallback(() => {\n onContentChange(LeftColumnContent.NewChannelStep1);\n }, [onContentChange]);\n\n const handleSelectNewGroup = useCallback(() => {\n onContentChange(LeftColumnContent.NewGroupStep1);\n }, [onContentChange]);\n\n const handleSelectArchived = useCallback(() => {\n onContentChange(LeftColumnContent.Archived);\n }, [onContentChange]);\n\n const handleMouseEnter = useCallback(() => {\n if (content !== LeftColumnContent.ChatList) {\n return;\n }\n isMouseInside.current = true;\n setIsNewChatButtonShown(true);\n }, [content]);\n\n const handleMouseLeave = useCallback(() => {\n isMouseInside.current = false;\n\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n\n closeTimeout = window.setTimeout(() => {\n if (!isMouseInside.current) {\n setIsNewChatButtonShown(false);\n }\n }, BUTTON_CLOSE_DELAY_MS);\n }, []);\n\n useEffect(() => {\n let autoCloseTimeout: number | undefined;\n if (content !== LeftColumnContent.ChatList) {\n autoCloseTimeout = window.setTimeout(() => {\n setIsNewChatButtonShown(false);\n }, BUTTON_CLOSE_DELAY_MS);\n } else if (isMouseInside.current || IS_TOUCH_ENV) {\n setIsNewChatButtonShown(true);\n }\n\n return () => {\n if (autoCloseTimeout) {\n clearTimeout(autoCloseTimeout);\n autoCloseTimeout = undefined;\n }\n };\n }, [content]);\n\n const [shouldRenderUpdateButton, updateButtonClassNames, handleUpdateClick] = useAppOutdatedCheck();\n\n const lang = useLang();\n\n return (\n \n \n \n {() => }\n \n \n {(isActive) => {\n switch (content) {\n case LeftColumnContent.ChatList:\n return ;\n case LeftColumnContent.GlobalSearch:\n return (\n \n );\n case LeftColumnContent.Contacts:\n return ;\n default:\n return undefined;\n }\n }}\n \n {shouldRenderUpdateButton && (\n \n {lang('lng_update_telegram')}\n \n )}\n \n
\n );\n};\n\nfunction useAppOutdatedCheck() {\n const [isAppOutdated, markIsAppOutdated] = useFlag(false);\n\n useEffect(() => {\n const timeout = window.setTimeout(markIsAppOutdated, APP_OUTDATED_TIMEOUT);\n\n return () => {\n clearTimeout(timeout);\n };\n }, [markIsAppOutdated]);\n\n const { shouldRender, transitionClassNames } = useShowTransition(isAppOutdated);\n\n const handleUpdateClick = () => {\n window.location.reload();\n };\n\n return [shouldRender, transitionClassNames, handleUpdateClick] as const;\n}\n\nexport default withGlobal(\n (global): StateProps => pick(global, ['connectionState']),\n)(LeftMain);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport { OwnProps } from './Settings';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\nimport Loading from '../../ui/Loading';\n\nconst SettingsAsync: FC = (props) => {\n const Settings = useModuleLoader(Bundles.Extra, 'Settings');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return Settings ? : ;\n};\n\nexport default memo(SettingsAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport { OwnProps } from './NewChat';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\nimport Loading from '../../ui/Loading';\n\nconst NewChatAsync: FC = (props) => {\n const NewChat = useModuleLoader(Bundles.Extra, 'NewChat');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return NewChat ? : ;\n};\n\nexport default memo(NewChatAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './ArchivedChats';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst ArchivedChatsAsync: FC = (props) => {\n const ArchivedChats = useModuleLoader(Bundles.Extra, 'ArchivedChats');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ArchivedChats ? : ;\n};\n\nexport default memo(ArchivedChatsAsync);\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { LeftColumnContent, SettingsScreens } from '../../types';\n\nimport { LAYERS_ANIMATION_NAME } from '../../util/environment';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport { pick } from '../../util/iteratees';\nimport useFoldersReducer from '../../hooks/reducers/useFoldersReducer';\n\nimport Transition from '../ui/Transition';\nimport LeftMain from './main/LeftMain';\nimport Settings from './settings/Settings.async';\nimport NewChat from './newChat/NewChat.async';\nimport ArchivedChats from './ArchivedChats.async';\n\nimport './LeftColumn.scss';\n\ntype StateProps = {\n searchQuery?: string;\n searchDate?: number;\n activeChatFolder: number;\n shouldSkipHistoryAnimations?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nenum ContentType {\n Main,\n // eslint-disable-next-line @typescript-eslint/no-shadow\n Settings,\n Archived,\n // eslint-disable-next-line no-shadow\n NewGroup,\n // eslint-disable-next-line no-shadow\n NewChannel,\n}\n\nconst RENDER_COUNT = Object.keys(ContentType).length / 2;\nconst RESET_TRANSITION_DELAY_MS = 250;\n\nconst LeftColumn: FC = ({\n searchQuery,\n searchDate,\n activeChatFolder,\n shouldSkipHistoryAnimations,\n setGlobalSearchQuery,\n setGlobalSearchChatId,\n resetChatCreation,\n setGlobalSearchDate,\n loadPasswordInfo,\n clearTwoFaError,\n}) => {\n const [content, setContent] = useState(LeftColumnContent.ChatList);\n const [settingsScreen, setSettingsScreen] = useState(SettingsScreens.Main);\n const [contactsFilter, setContactsFilter] = useState('');\n const [foldersState, foldersDispatch] = useFoldersReducer();\n\n // Used to reset child components in background.\n const [lastResetTime, setLastResetTime] = useState(0);\n\n let contentType: ContentType = ContentType.Main;\n switch (content) {\n case LeftColumnContent.Archived:\n contentType = ContentType.Archived;\n break;\n case LeftColumnContent.Settings:\n contentType = ContentType.Settings;\n break;\n case LeftColumnContent.NewChannelStep1:\n case LeftColumnContent.NewChannelStep2:\n contentType = ContentType.NewChannel;\n break;\n case LeftColumnContent.NewGroupStep1:\n case LeftColumnContent.NewGroupStep2:\n contentType = ContentType.NewGroup;\n break;\n }\n\n const handleReset = useCallback((forceReturnToChatList?: boolean) => {\n if (content === LeftColumnContent.NewGroupStep2\n && !forceReturnToChatList\n ) {\n setContent(LeftColumnContent.NewGroupStep1);\n return;\n }\n\n if (content === LeftColumnContent.NewChannelStep2\n && !forceReturnToChatList\n ) {\n setContent(LeftColumnContent.NewChannelStep1);\n return;\n }\n\n if (content === LeftColumnContent.NewGroupStep1) {\n const pickerSearchInput = document.getElementById('new-group-picker-search');\n if (pickerSearchInput) {\n pickerSearchInput.blur();\n }\n }\n\n if (content === LeftColumnContent.Settings) {\n switch (settingsScreen) {\n case SettingsScreens.EditProfile:\n case SettingsScreens.Folders:\n case SettingsScreens.General:\n case SettingsScreens.Notifications:\n case SettingsScreens.Privacy:\n case SettingsScreens.Language:\n setSettingsScreen(SettingsScreens.Main);\n return;\n\n case SettingsScreens.GeneralChatBackground:\n setSettingsScreen(SettingsScreens.General);\n return;\n case SettingsScreens.GeneralChatBackgroundColor:\n setSettingsScreen(SettingsScreens.GeneralChatBackground);\n return;\n\n case SettingsScreens.PrivacyPhoneNumber:\n case SettingsScreens.PrivacyLastSeen:\n case SettingsScreens.PrivacyProfilePhoto:\n case SettingsScreens.PrivacyForwarding:\n case SettingsScreens.PrivacyGroupChats:\n case SettingsScreens.PrivacyActiveSessions:\n case SettingsScreens.PrivacyBlockedUsers:\n case SettingsScreens.TwoFaDisabled:\n case SettingsScreens.TwoFaEnabled:\n case SettingsScreens.TwoFaCongratulations:\n setSettingsScreen(SettingsScreens.Privacy);\n return;\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyPhoneNumber);\n return;\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyLastSeen);\n return;\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyProfilePhoto);\n return;\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyForwarding);\n return;\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n setSettingsScreen(SettingsScreens.PrivacyGroupChats);\n return;\n case SettingsScreens.TwoFaNewPassword:\n setSettingsScreen(SettingsScreens.TwoFaDisabled);\n return;\n case SettingsScreens.TwoFaNewPasswordConfirm:\n setSettingsScreen(SettingsScreens.TwoFaNewPassword);\n return;\n case SettingsScreens.TwoFaNewPasswordHint:\n setSettingsScreen(SettingsScreens.TwoFaNewPasswordConfirm);\n return;\n case SettingsScreens.TwoFaNewPasswordEmail:\n setSettingsScreen(SettingsScreens.TwoFaNewPasswordHint);\n return;\n case SettingsScreens.TwoFaNewPasswordEmailCode:\n setSettingsScreen(SettingsScreens.TwoFaNewPasswordEmail);\n return;\n case SettingsScreens.TwoFaChangePasswordCurrent:\n case SettingsScreens.TwoFaTurnOff:\n case SettingsScreens.TwoFaRecoveryEmailCurrentPassword:\n setSettingsScreen(SettingsScreens.TwoFaEnabled);\n return;\n case SettingsScreens.TwoFaChangePasswordNew:\n setSettingsScreen(SettingsScreens.TwoFaChangePasswordCurrent);\n return;\n case SettingsScreens.TwoFaChangePasswordConfirm:\n setSettingsScreen(SettingsScreens.TwoFaChangePasswordNew);\n return;\n case SettingsScreens.TwoFaChangePasswordHint:\n setSettingsScreen(SettingsScreens.TwoFaChangePasswordConfirm);\n return;\n case SettingsScreens.TwoFaRecoveryEmail:\n setSettingsScreen(SettingsScreens.TwoFaRecoveryEmailCurrentPassword);\n return;\n case SettingsScreens.TwoFaRecoveryEmailCode:\n setSettingsScreen(SettingsScreens.TwoFaRecoveryEmail);\n return;\n\n case SettingsScreens.FoldersCreateFolder:\n case SettingsScreens.FoldersEditFolder:\n setSettingsScreen(SettingsScreens.Folders);\n return;\n\n case SettingsScreens.FoldersIncludedChatsFromChatList:\n case SettingsScreens.FoldersExcludedChatsFromChatList:\n setSettingsScreen(SettingsScreens.FoldersEditFolderFromChatList);\n return;\n\n case SettingsScreens.FoldersEditFolderFromChatList:\n setContent(LeftColumnContent.ChatList);\n setSettingsScreen(SettingsScreens.Main);\n return;\n default:\n break;\n }\n }\n\n if (content === LeftColumnContent.ChatList && activeChatFolder === 0) {\n setContent(LeftColumnContent.GlobalSearch);\n return;\n }\n\n setContent(LeftColumnContent.ChatList);\n setContactsFilter('');\n setGlobalSearchQuery({ query: '' });\n setGlobalSearchDate({ date: undefined });\n setGlobalSearchChatId({ id: undefined });\n resetChatCreation();\n setTimeout(() => {\n setLastResetTime(Date.now());\n }, RESET_TRANSITION_DELAY_MS);\n }, [\n content, activeChatFolder, settingsScreen, setGlobalSearchQuery, setGlobalSearchDate, setGlobalSearchChatId,\n resetChatCreation,\n ]);\n\n const handleSearchQuery = useCallback((query: string) => {\n if (content === LeftColumnContent.Contacts) {\n setContactsFilter(query);\n return;\n }\n\n setContent(LeftColumnContent.GlobalSearch);\n\n if (query !== searchQuery) {\n setGlobalSearchQuery({ query });\n }\n }, [content, searchQuery, setGlobalSearchQuery]);\n\n useEffect(\n () => (content !== LeftColumnContent.ChatList || activeChatFolder === 0\n ? captureEscKeyListener(() => handleReset())\n : undefined),\n [activeChatFolder, content, handleReset],\n );\n\n useEffect(() => {\n clearTwoFaError();\n\n if (settingsScreen === SettingsScreens.Privacy) {\n loadPasswordInfo();\n }\n }, [clearTwoFaError, loadPasswordInfo, settingsScreen]);\n\n const handleSettingsScreenSelect = (screen: SettingsScreens) => {\n setContent(LeftColumnContent.Settings);\n setSettingsScreen(screen);\n };\n\n return (\n \n {(isActive) => {\n switch (contentType) {\n case ContentType.Archived:\n return (\n \n );\n case ContentType.Settings:\n return (\n \n );\n case ContentType.NewChannel:\n return (\n \n );\n case ContentType.NewGroup:\n return (\n \n );\n default:\n return (\n \n );\n }\n }}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n globalSearch: {\n query,\n date,\n },\n chatFolders: {\n activeChatFolder,\n },\n shouldSkipHistoryAnimations,\n } = global;\n return {\n searchQuery: query, searchDate: date, activeChatFolder, shouldSkipHistoryAnimations,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setGlobalSearchQuery', 'setGlobalSearchChatId', 'resetChatCreation', 'setGlobalSearchDate',\n 'loadPasswordInfo', 'clearTwoFaError',\n ]),\n)(LeftColumn));\n","import { useEffect, useState } from '../lib/teact/teact';\n\nimport { throttle } from '../util/schedulers';\nimport windowSize from '../util/windowSize';\nimport { ApiDimensions } from '../api/types';\n\nconst THROTTLE = 250;\n\nexport default () => {\n const [size, setSize] = useState(windowSize.get());\n\n useEffect(() => {\n const handleResize = throttle(() => {\n setSize(windowSize.get());\n }, THROTTLE, false);\n\n window.addEventListener('resize', handleResize);\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, []);\n\n return size;\n};\n","import {\n MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n MOBILE_SCREEN_MAX_WIDTH,\n} from '../../../config';\n\nconst REM = 16; // px\nconst MAX_TOOLBAR_WIDTH = 32 * REM;\nconst MAX_MESSAGES_LIST_WIDTH = 45.5 * REM;\nconst SIDE_COLUMN_MAX_WIDTH = 26.5 * REM;\nconst MIN_LEFT_COLUMN_WIDTH = 18 * REM;\nconst UNPIN_BUTTON_WIDTH = 16.125 * REM;\n\nexport default function calculateMiddleFooterTransforms(windowWidth: number, canPost?: boolean) {\n const sidePadding = windowWidth <= MOBILE_SCREEN_MAX_WIDTH\n ? REM\n : 2 * REM;\n const messageListWidth = getMessageListWidth(windowWidth);\n const sendButtonWidth = windowWidth <= MOBILE_SCREEN_MAX_WIDTH\n ? 3.375 * REM\n : 4 * REM;\n\n const composerWidth = canPost\n ? messageListWidth - sidePadding - sendButtonWidth\n : messageListWidth - sidePadding;\n const toolbarWidth = windowWidth > MOBILE_SCREEN_MAX_WIDTH\n ? Math.min(messageListWidth - sidePadding, MAX_TOOLBAR_WIDTH)\n : messageListWidth - sidePadding;\n\n const composerHiddenScale = toolbarWidth / composerWidth;\n const toolbarHiddenScale = composerWidth / toolbarWidth;\n const unpinHiddenScale = toolbarWidth / UNPIN_BUTTON_WIDTH;\n const toolbarForUnpinHiddenScale = UNPIN_BUTTON_WIDTH / toolbarWidth;\n\n const composerTranslateX = canPost\n ? (sendButtonWidth / 2) * toolbarHiddenScale\n : 0;\n\n const toolbarTranslateX = canPost\n ? (sendButtonWidth / 2) * -1 * composerHiddenScale\n : 0;\n\n return {\n composerHiddenScale,\n toolbarHiddenScale,\n composerTranslateX,\n toolbarTranslateX,\n unpinHiddenScale,\n toolbarForUnpinHiddenScale,\n };\n}\n\nfunction getMessageListWidth(windowWidth: number) {\n if (windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN) {\n const leftColumnWidth = Math.min(\n Math.max(windowWidth * 0.25, MIN_LEFT_COLUMN_WIDTH),\n SIDE_COLUMN_MAX_WIDTH,\n );\n\n const rightColumnWidth = Math.min(\n windowWidth * 0.25,\n SIDE_COLUMN_MAX_WIDTH,\n );\n\n return Math.min(\n windowWidth - leftColumnWidth - rightColumnWidth,\n MAX_MESSAGES_LIST_WIDTH,\n );\n }\n\n if (windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN) {\n const leftColumnWidth = Math.min(\n Math.max(windowWidth * 0.4, MIN_LEFT_COLUMN_WIDTH),\n SIDE_COLUMN_MAX_WIDTH,\n );\n\n return Math.min(\n windowWidth - leftColumnWidth,\n MAX_MESSAGES_LIST_WIDTH,\n );\n }\n\n if (windowWidth > MAX_MESSAGES_LIST_WIDTH) {\n return MAX_MESSAGES_LIST_WIDTH;\n }\n\n return windowWidth;\n}\n","import { MessageList, MessageListType } from '../global/types';\nimport { MAIN_THREAD_ID } from '../api/types';\n\nexport const createMessageHash = (messageList: MessageList): string => (\n messageList.chatId.toString()\n + (messageList.type !== 'thread' ? `_${messageList.type}`\n : (messageList.threadId !== -1 ? `_${messageList.threadId}` : ''))\n);\n\nexport const parseMessageHash = (value: string): MessageList => {\n const [chatId, typeOrThreadId] = value.split('_');\n const isType = ['thread', 'pinned', 'scheduled'].includes(typeOrThreadId);\n\n return {\n chatId: Number(chatId),\n type: !!typeOrThreadId && isType ? (typeOrThreadId as MessageListType) : 'thread',\n threadId: !!typeOrThreadId && !isType ? Number(typeOrThreadId) : MAIN_THREAD_ID,\n };\n};\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './HeaderMenuContainer';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst HeaderMenuContainerAsync: FC = (props) => {\n const { isOpen } = props;\n const HeaderMenuContainer = useModuleLoader(Bundles.Extra, 'HeaderMenuContainer', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return HeaderMenuContainer ? : undefined;\n};\n\nexport default memo(HeaderMenuContainerAsync);\n","import React, {\n FC,\n memo,\n useRef,\n useCallback,\n useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, MessageListType } from '../../global/types';\nimport { MAIN_THREAD_ID } from '../../api/types';\nimport { IAnchorPosition } from '../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { pick } from '../../util/iteratees';\nimport { isChatChannel, isChatSuperGroup } from '../../modules/helpers';\nimport {\n selectChat,\n selectChatBot,\n selectIsUserBlocked,\n selectIsChatBotNotStarted,\n selectIsChatWithSelf,\n selectIsInSelectMode,\n selectIsRightColumnShown,\n} from '../../modules/selectors';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport HeaderMenuContainer from './HeaderMenuContainer.async';\n\ninterface OwnProps {\n chatId: number;\n threadId: number;\n messageListType: MessageListType;\n}\n\ninterface StateProps {\n noMenu?: boolean;\n isChannel?: boolean;\n isRightColumnShown?: boolean;\n canStartBot?: boolean;\n canRestartBot?: boolean;\n canSubscribe?: boolean;\n canSearch?: boolean;\n canMute?: boolean;\n canLeave?: boolean;\n}\n\ntype DispatchProps = Pick;\n\n// Chrome breaks layout when focusing input during transition\nconst SEARCH_FOCUS_DELAY_MS = 400;\n\nconst HeaderActions: FC = ({\n chatId,\n threadId,\n noMenu,\n isChannel,\n canStartBot,\n canRestartBot,\n canSubscribe,\n canSearch,\n canMute,\n canLeave,\n isRightColumnShown,\n joinChannel,\n sendBotCommand,\n openLocalTextSearch,\n restartBot,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const menuButtonRef = useRef(null);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const [menuPosition, setMenuPosition] = useState(undefined);\n\n const handleHeaderMenuOpen = useCallback(() => {\n setIsMenuOpen(true);\n const rect = menuButtonRef.current!.getBoundingClientRect();\n setMenuPosition({ x: rect.right, y: rect.bottom });\n }, []);\n\n const handleHeaderMenuClose = useCallback(() => {\n setIsMenuOpen(false);\n }, []);\n\n const handleHeaderMenuHide = useCallback(() => {\n setMenuPosition(undefined);\n }, []);\n\n const handleSubscribeClick = useCallback(() => {\n joinChannel({ chatId });\n }, [joinChannel, chatId]);\n\n const handleStartBot = useCallback(() => {\n sendBotCommand({ command: '/start' });\n }, [sendBotCommand]);\n\n const handleRestartBot = useCallback(() => {\n restartBot({ chatId });\n }, [chatId, restartBot]);\n\n const handleSearchClick = useCallback(() => {\n openLocalTextSearch();\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n // iOS requires synchronous focus on user event.\n const searchInput = document.querySelector('#MobileSearch input')!;\n searchInput.focus();\n } else {\n setTimeout(() => {\n const searchInput = document.querySelector('.RightHeader .SearchInput input');\n if (searchInput) {\n searchInput.focus();\n }\n }, SEARCH_FOCUS_DELAY_MS);\n }\n }, [openLocalTextSearch]);\n\n const lang = useLang();\n\n return (\n
\n {!IS_SINGLE_COLUMN_LAYOUT && canSubscribe && (\n \n {lang(isChannel ? 'Subscribe' : 'Join Group')}\n \n )}\n {!IS_SINGLE_COLUMN_LAYOUT && canStartBot && (\n \n {lang('BotStart')}\n \n )}\n {!IS_SINGLE_COLUMN_LAYOUT && canRestartBot && (\n \n {lang('BotRestart')}\n \n )}\n {!IS_SINGLE_COLUMN_LAYOUT && canSearch && (\n \n \n \n )}\n {(IS_SINGLE_COLUMN_LAYOUT || !canSubscribe) && (\n \n \n \n )}\n {menuPosition && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId, messageListType }): StateProps => {\n const chat = selectChat(global, chatId);\n const isChannel = Boolean(chat && isChatChannel(chat));\n\n if (chat?.isRestricted || selectIsInSelectMode(global)) {\n return {\n noMenu: true,\n };\n }\n\n const bot = selectChatBot(global, chatId);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const isMainThread = messageListType === 'thread' && threadId === MAIN_THREAD_ID;\n const isDiscussionThread = messageListType === 'thread' && threadId !== MAIN_THREAD_ID;\n const isRightColumnShown = selectIsRightColumnShown(global);\n\n const canRestartBot = Boolean(bot && selectIsUserBlocked(global, bot.id));\n const canStartBot = !canRestartBot && Boolean(selectIsChatBotNotStarted(global, chatId));\n const canSubscribe = Boolean(\n isMainThread && chat && (isChannel || isChatSuperGroup(chat)) && chat.isNotJoined,\n );\n const canSearch = isMainThread || isDiscussionThread;\n const canMute = isMainThread && !isChatWithSelf && !canSubscribe;\n const canLeave = isMainThread && !canSubscribe;\n\n const noMenu = !(\n (IS_SINGLE_COLUMN_LAYOUT && canSubscribe)\n || (IS_SINGLE_COLUMN_LAYOUT && canSearch)\n || canMute\n || canLeave\n );\n\n return {\n noMenu,\n isChannel,\n isRightColumnShown,\n canStartBot,\n canRestartBot,\n canSubscribe,\n canSearch,\n canMute,\n canLeave,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'joinChannel', 'sendBotCommand', 'openLocalTextSearch', 'restartBot',\n ]),\n)(HeaderActions));\n","import { useLayoutEffect, useState } from '../lib/teact/teact';\n\nimport { ApiMessage } from '../api/types';\n\nimport { DEBUG } from '../config';\nimport { isWebpSupported } from '../util/environment';\nimport { EMPTY_IMAGE_DATA_URI, webpToPngBase64 } from '../util/webpToPng';\nimport { getMessageMediaThumbDataUri } from '../modules/helpers';\n\nexport default function useWebpThumbnail(message?: ApiMessage) {\n const thumbnail = message && getMessageMediaThumbDataUri(message);\n const sticker = message?.content?.sticker;\n const shouldDecodeThumbnail = thumbnail && sticker && !isWebpSupported() && thumbnail.includes('image/webp');\n const [thumbnailDecoded, setThumbnailDecoded] = useState(EMPTY_IMAGE_DATA_URI);\n const messageId = message?.id;\n\n useLayoutEffect(() => {\n if (!shouldDecodeThumbnail) {\n return;\n }\n\n webpToPngBase64(`b64-${messageId}`, thumbnail!)\n .then(setThumbnailDecoded)\n .catch((err) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n });\n }, [messageId, shouldDecodeThumbnail, thumbnail]);\n\n return shouldDecodeThumbnail ? thumbnailDecoded : thumbnail;\n}\n","import React, {\n FC,\n useRef,\n useEffect,\n useMemo,\n memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\ntype OwnProps = {\n count: number;\n index: number;\n};\n\nconst BORDER_MASK_LEVEL = 4;\n\nconst PinnedMessageNavigation: FC = ({\n count, index,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const markupParams = useMemo(() => {\n return calculateMarkup(count, index);\n }, [count, index]);\n\n useEffect(() => {\n if (!containerRef.current) {\n return;\n }\n\n const {\n trackHeight,\n trackTranslateY,\n markHeight,\n markTranslateY,\n clipPathId,\n clipPath,\n } = markupParams;\n\n const firstChild = containerRef.current.firstElementChild;\n if (containerRef?.current) {\n const currentElement = containerRef.current;\n const { style } = currentElement;\n style.height = `${trackHeight}px`;\n style.transform = `translateY(-${trackTranslateY}px)`;\n style.clipPath = `url(\"#${clipPathId}\")`;\n const svg = currentElement.querySelector('svg');\n const div = currentElement.querySelector('div');\n const defs = currentElement.querySelector('defs');\n if (!svg) {\n if (firstChild) {\n firstChild.innerHTML = ` ${clipPath} `;\n }\n }\n if (defs) {\n defs.innerHTML = clipPath;\n }\n if (div) {\n div.style.height = `${markHeight}px`;\n div.style.transform = `translateY(${markTranslateY}px)`;\n }\n }\n }, [markupParams]);\n\n if (count === 1) {\n return (\n
\n \n
\n );\n }\n\n const {\n trackHeight, trackTranslateY, markHeight, markTranslateY, clipPathId,\n } = markupParams;\n\n return (\n
BORDER_MASK_LEVEL && 'pinned-message-border-mask')}>\n \n \n \n
\n \n );\n};\n\nfunction calculateMarkup(count: number, index: number) {\n const reverseIndex = count - index - 1;\n const barHeight = getBarHeight(count);\n const markHeight = getMarkHeight(count, reverseIndex);\n const trackHeight = getTrackHeight(count, barHeight);\n\n const clipPathId = `clipPath${count}`;\n const clipPath = getClipPath(clipPathId, barHeight, count);\n\n const markTranslateY = getMarkTranslateY(reverseIndex, barHeight, count);\n const trackTranslateY = getTrackTranslateY(reverseIndex, count, barHeight, trackHeight);\n return {\n markHeight,\n clipPath,\n markTranslateY,\n trackTranslateY,\n trackHeight,\n clipPathId,\n };\n}\n\nfunction getBarHeight(count: number): number {\n let barHeight = 8;\n if (count === 1) {\n barHeight = 36;\n } else if (count === 2) {\n barHeight = 17;\n } else if (count === 3) {\n barHeight = 11;\n } else if (count === 4) {\n barHeight = 7.5;\n } else if (count > 3) {\n barHeight = 7.5;\n }\n\n return barHeight;\n}\n\nfunction getMarkHeight(count: number, index: number) {\n let barHeight = 36;\n if (count === 1) {\n barHeight = 36;\n } else if (count === 2) {\n barHeight = 17;\n } else if (count === 3) {\n barHeight = index === 1 ? 12 : 11;\n } else if (count === 4) {\n barHeight = 7.5;\n } else if (count > 3) {\n barHeight = 7.5;\n }\n\n return barHeight;\n}\n\nfunction getTrackHeight(count: number, barHeight: number) {\n return count <= 3 ? 36 : barHeight * count + 2 * (count - 1);\n}\n\nfunction getClipPath(id: string, barHeight: number, count: number) {\n const radius = 1;\n\n let d = '';\n if (count === 3) {\n d = drawRect(0, 0, 2, barHeight, radius)\n + drawRect(0, 12, 2, barHeight + 1, radius)\n + drawRect(0, 25, 2, barHeight, radius);\n } else {\n for (let i = 0; i < count; i++) {\n d += drawRect(0, (barHeight + 2) * i, 2, barHeight, radius);\n }\n }\n\n return (\n `\n \n `\n );\n}\n\nfunction drawRect(x: number, y: number, width: number, height: number, radius: number) {\n return `M${x},${y + radius}a${radius},${radius},0,0,1,\n ${width},0v${height - 2 * radius}a${radius},${radius},0,0,1,${-width},0Z`;\n}\n\nfunction getMarkTranslateY(index: number, barHeight: number, count: number) {\n if (count === 1) {\n return 0;\n } else if (count === 2) {\n return index === 0 ? 0 : barHeight + 2;\n }\n\n if (count === 3) {\n if (index === 0) {\n return 0;\n } else if (index === 1) {\n return 12;\n }\n\n return 25;\n } else {\n return (barHeight + 2) * index;\n }\n}\n\nfunction getTrackTranslateY(index: number, count: number, barHeight: number, trackHeight: number) {\n if (count <= 4) {\n return 0;\n }\n\n if (index <= 1) {\n return 0;\n } else if (index >= count - 2) {\n return trackHeight - 36;\n }\n\n return (barHeight + 4) / 2 + (index - 2) * (barHeight + 2);\n}\n\nexport default memo(PinnedMessageNavigation);\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport { ApiMessage } from '../../api/types';\n\nimport { getPictogramDimensions } from '../common/helpers/mediaDimensions';\nimport { getMessageMediaHash, getMessageSummaryText } from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport useMedia from '../../hooks/useMedia';\nimport useWebpThumbnail from '../../hooks/useWebpThumbnail';\n\nimport ConfirmDialog from '../ui/ConfirmDialog';\nimport Button from '../ui/Button';\nimport RippleEffect from '../ui/RippleEffect';\nimport buildClassName from '../../util/buildClassName';\nimport useFlag from '../../hooks/useFlag';\nimport useLang from '../../hooks/useLang';\n\nimport PinnedMessageNavigation from './PinnedMessageNavigation';\n\ntype OwnProps = {\n message: ApiMessage;\n index: number;\n count: number;\n customTitle?: string;\n className?: string;\n onUnpinMessage?: (id: number) => void;\n onClick?: () => void;\n onAllPinnedClick?: () => void;\n};\n\nconst HeaderPinnedMessage: FC = ({\n message, count, index, customTitle, className, onUnpinMessage, onClick, onAllPinnedClick,\n}) => {\n const lang = useLang();\n const mediaThumbnail = useWebpThumbnail(message);\n const mediaBlobUrl = useMedia(getMessageMediaHash(message, 'pictogram'));\n\n const text = getMessageSummaryText(lang, message, Boolean(mediaThumbnail));\n const [isUnpinDialogOpen, openUnpinDialog, closeUnpinDialog] = useFlag();\n\n const handleUnpinMessage = useCallback(() => {\n closeUnpinDialog();\n\n if (onUnpinMessage) {\n onUnpinMessage(message.id);\n }\n }, [closeUnpinDialog, onUnpinMessage, message.id]);\n\n return (\n
\n {count > 1 && (\n \n \n \n )}\n {onUnpinMessage && (\n \n \n \n )}\n \n
\n \n {mediaThumbnail && renderPictogram(mediaThumbnail, mediaBlobUrl)}\n
\n
\n {customTitle || `${lang('PinnedMessage')} ${index > 0 ? `#${count - index}` : ''}`}\n
\n

{renderText(text)}

\n
\n\n \n
\n
\n );\n};\n\nfunction renderPictogram(thumbDataUri: string, blobUrl?: string) {\n const { width, height } = getPictogramDimensions();\n\n return (\n \"\"\n );\n}\n\nexport default memo(HeaderPinnedMessage);\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport {\n ApiAudio, ApiChat, ApiMessage, ApiUser,\n} from '../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport * as mediaLoader from '../../util/mediaLoader';\nimport {\n getMediaDuration, getMessageAudio, getMessageKey, getMessageMediaHash, getSenderTitle,\n} from '../../modules/helpers';\nimport { selectSender } from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\nimport renderText from '../common/helpers/renderText';\nimport useAudioPlayer from '../../hooks/useAudioPlayer';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport RippleEffect from '../ui/RippleEffect';\nimport Button from '../ui/Button';\n\nimport './AudioPlayer.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n className?: string;\n noUi?: boolean;\n};\n\ntype StateProps = {\n sender?: ApiChat | ApiUser;\n};\n\ntype DispatchProps = Pick;\n\nconst AudioPlayer: FC = ({\n message, className, noUi, sender, focusMessage, closeAudioPlayer,\n}) => {\n const lang = useLang();\n\n const senderName = sender ? getSenderTitle(lang, sender) : undefined;\n const mediaData = mediaLoader.getFromMemory(getMessageMediaHash(message, 'inline')!) as (string | undefined);\n const { playPause, isPlaying } = useAudioPlayer(\n getMessageKey(message), getMediaDuration(message)!, mediaData, undefined, undefined, true,\n );\n\n const handleClick = useCallback(() => {\n focusMessage({ chatId: message.chatId, messageId: message.id });\n }, [focusMessage, message.chatId, message.id]);\n\n const handleClose = useCallback(() => {\n if (isPlaying) {\n playPause();\n }\n closeAudioPlayer();\n }, [closeAudioPlayer, isPlaying, playPause]);\n\n if (noUi) {\n return undefined;\n }\n\n const audio = getMessageAudio(message);\n\n return (\n
\n \n \n \n \n\n
\n {audio ? renderAudio(audio) : renderVoice(lang('AttachAudio'), senderName)}\n \n
\n\n \n \n \n
\n );\n};\n\nfunction renderAudio(audio: ApiAudio) {\n const { title, performer, fileName } = audio;\n\n return (\n <>\n
{renderText(title || fileName)}
\n {performer && (\n
{renderText(performer)}
\n )}\n \n );\n}\n\nfunction renderVoice(subtitle: string, senderName?: string) {\n return (\n <>\n
{senderName && renderText(senderName)}
\n
{subtitle}
\n \n );\n}\n\nexport default withGlobal(\n (global, { message }): StateProps => {\n const sender = selectSender(global, message);\n\n return { sender };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['focusMessage', 'closeAudioPlayer']),\n)(AudioPlayer);\n","import React, {\n FC, useCallback, useMemo, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../lib/teact/teactn';\nimport cycleRestrict from '../../util/cycleRestrict';\n\nimport { GlobalActions, MessageListType } from '../../global/types';\nimport {\n ApiMessage,\n ApiChat,\n ApiUser,\n ApiTypingStatus,\n MAIN_THREAD_ID, ApiUpdateConnectionStateType,\n} from '../../api/types';\n\nimport {\n MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,\n MOBILE_SCREEN_MAX_WIDTH,\n EDITABLE_INPUT_ID,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n SAFE_SCREEN_WIDTH_FOR_CHAT_INFO,\n} from '../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TABLET_COLUMN_LAYOUT } from '../../util/environment';\nimport {\n isChatPrivate,\n getMessageKey,\n getChatTitle,\n getSenderTitle,\n} from '../../modules/helpers';\nimport {\n selectChat,\n selectChatMessage,\n selectAllowedMessageActions,\n selectIsRightColumnShown,\n selectThreadTopMessageId,\n selectThreadInfo,\n selectChatMessages,\n selectPinnedIds,\n selectIsChatWithSelf,\n selectForwardedSender,\n selectScheduledIds,\n selectIsInSelectMode,\n selectIsChatWithBot,\n selectCountNotMutedUnread,\n} from '../../modules/selectors';\nimport useEnsureMessage from '../../hooks/useEnsureMessage';\nimport useWindowSize from '../../hooks/useWindowSize';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\nimport { pick } from '../../util/iteratees';\nimport { formatIntegerCompact } from '../../util/textFormat';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\nimport useBrowserOnline from '../../hooks/useBrowserOnline';\n\nimport PrivateChatInfo from '../common/PrivateChatInfo';\nimport GroupChatInfo from '../common/GroupChatInfo';\nimport Transition from '../ui/Transition';\nimport Button from '../ui/Button';\nimport HeaderActions from './HeaderActions';\nimport HeaderPinnedMessage from './HeaderPinnedMessage';\nimport AudioPlayer from './AudioPlayer';\n\nimport './MiddleHeader.scss';\n\nconst ANIMATION_DURATION = 350;\n\ntype OwnProps = {\n chatId: number;\n threadId: number;\n messageListType: MessageListType;\n isReady?: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n pinnedMessageIds?: number[] | number;\n messagesById?: Record;\n canUnpin?: boolean;\n topMessageSender?: ApiChat | ApiUser;\n typingStatus?: ApiTypingStatus;\n isSelectModeActive?: boolean;\n isLeftColumnShown?: boolean;\n isRightColumnShown?: boolean;\n audioMessage?: ApiMessage;\n chatsById?: Record;\n messagesCount?: number;\n isChatWithSelf?: boolean;\n isChatWithBot?: boolean;\n lastSyncTime?: number;\n shouldSkipHistoryAnimations?: boolean;\n currentTransitionKey: number;\n connectionState?: ApiUpdateConnectionStateType;\n};\n\ntype DispatchProps = Pick;\n\nconst MiddleHeader: FC = ({\n chatId,\n threadId,\n messageListType,\n isReady,\n pinnedMessageIds,\n messagesById,\n canUnpin,\n topMessageSender,\n typingStatus,\n isSelectModeActive,\n isLeftColumnShown,\n isRightColumnShown,\n audioMessage,\n chat,\n chatsById,\n messagesCount,\n isChatWithSelf,\n isChatWithBot,\n lastSyncTime,\n shouldSkipHistoryAnimations,\n currentTransitionKey,\n connectionState,\n openChatWithInfo,\n pinMessage,\n focusMessage,\n openChat,\n openPreviousChat,\n loadPinnedMessages,\n toggleLeftColumn,\n exitMessageSelectMode,\n}) => {\n const lang = useLang();\n\n const [pinnedMessageIndex, setPinnedMessageIndex] = useState(0);\n const pinnedMessageId = Array.isArray(pinnedMessageIds) ? pinnedMessageIds[pinnedMessageIndex] : pinnedMessageIds;\n const pinnedMessage = messagesById && pinnedMessageId ? messagesById[pinnedMessageId] : undefined;\n const pinnedMessagesCount = Array.isArray(pinnedMessageIds) ? pinnedMessageIds.length : (pinnedMessageIds ? 1 : 0);\n const chatTitleLength = chat && getChatTitle(lang, chat).length;\n const topMessageTitle = topMessageSender ? getSenderTitle(lang, topMessageSender) : undefined;\n\n useEffect(() => {\n if (threadId === MAIN_THREAD_ID && lastSyncTime && isReady) {\n loadPinnedMessages({ chatId });\n }\n }, [chatId, loadPinnedMessages, lastSyncTime, threadId, isReady]);\n\n // Reset pinned index when switching chats and pinning/unpinning\n useEffect(() => {\n setPinnedMessageIndex(0);\n }, [pinnedMessageIds]);\n\n useEnsureMessage(chatId, pinnedMessageId, pinnedMessage);\n\n const { width: windowWidth } = useWindowSize();\n\n const isLeftColumnHideable = windowWidth <= MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN;\n const shouldShowCloseButton = IS_TABLET_COLUMN_LAYOUT && isLeftColumnShown;\n\n // eslint-disable-next-line no-null/no-null\n const componentRef = useRef(null);\n const shouldAnimateTools = useRef(true);\n\n const handleHeaderClick = useCallback(() => {\n openChatWithInfo({ id: chatId });\n }, [openChatWithInfo, chatId]);\n\n const handleUnpinMessage = useCallback((messageId: number) => {\n pinMessage({ chatId, messageId, isUnpin: true });\n }, [pinMessage, chatId]);\n\n const handlePinnedMessageClick = useCallback((): void => {\n if (pinnedMessage) {\n focusMessage({ chatId: pinnedMessage.chatId, threadId, messageId: pinnedMessage.id });\n\n const newIndex = cycleRestrict(pinnedMessagesCount, pinnedMessageIndex + 1);\n setPinnedMessageIndex(newIndex);\n }\n }, [pinnedMessage, focusMessage, threadId, pinnedMessagesCount, pinnedMessageIndex]);\n\n const handleAllPinnedClick = useCallback(() => {\n openChat({ id: chatId, threadId: MAIN_THREAD_ID, type: 'pinned' });\n }, [openChat, chatId]);\n\n const handleBackClick = useCallback((e: React.MouseEvent) => {\n if (IS_SINGLE_COLUMN_LAYOUT) {\n const messageInput = document.getElementById(EDITABLE_INPUT_ID);\n if (messageInput) {\n messageInput.blur();\n }\n }\n\n if (isSelectModeActive) {\n exitMessageSelectMode();\n return;\n }\n\n if (threadId === MAIN_THREAD_ID && messageListType === 'thread' && currentTransitionKey === 0) {\n if (IS_SINGLE_COLUMN_LAYOUT || shouldShowCloseButton) {\n e.stopPropagation(); // Stop propagation to prevent chat re-opening on tablets\n openChat({ id: undefined });\n } else {\n toggleLeftColumn();\n }\n\n return;\n }\n\n openPreviousChat();\n }, [\n threadId, messageListType, currentTransitionKey, isSelectModeActive, openPreviousChat, shouldShowCloseButton,\n openChat, toggleLeftColumn, exitMessageSelectMode,\n ]);\n\n const unreadCount = useMemo(() => {\n if (!isLeftColumnHideable || !chatsById) {\n return undefined;\n }\n\n return selectCountNotMutedUnread(getGlobal()) || undefined;\n }, [isLeftColumnHideable, chatsById]);\n\n const canToolsCollideWithChatInfo = (\n windowWidth >= MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN\n && windowWidth < SAFE_SCREEN_WIDTH_FOR_CHAT_INFO\n ) || (\n windowWidth > MOBILE_SCREEN_MAX_WIDTH\n && windowWidth < MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN\n && (!chatTitleLength || chatTitleLength > 30)\n );\n const shouldUseStackedToolsClass = canToolsCollideWithChatInfo || (\n windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n && windowWidth < SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n );\n\n const {\n shouldRender: shouldRenderAudioPlayer,\n transitionClassNames: audioPlayerClassNames,\n } = useShowTransition(Boolean(audioMessage));\n\n const renderingAudioMessage = useCurrentOrPrev(audioMessage);\n\n const {\n shouldRender: shouldRenderPinnedMessage,\n transitionClassNames: pinnedMessageClassNames,\n } = useShowTransition(pinnedMessage && !shouldRenderAudioPlayer);\n\n const renderingPinnedMessage = useCurrentOrPrev(pinnedMessage);\n const renderingPinnedMessageTitle = useCurrentOrPrev(topMessageTitle);\n\n const canRevealTools = (shouldRenderPinnedMessage && renderingPinnedMessage)\n || (shouldRenderAudioPlayer && renderingAudioMessage);\n\n // Logic for transition to and from custom display of AudioPlayer/PinnedMessage on smaller screens\n useEffect(() => {\n const componentEl = componentRef.current;\n if (!componentEl) {\n return;\n }\n\n if (!shouldUseStackedToolsClass || !canRevealTools) {\n componentEl.classList.remove('tools-stacked', 'animated');\n shouldAnimateTools.current = true;\n return;\n }\n\n if (isRightColumnShown || canToolsCollideWithChatInfo) {\n if (shouldAnimateTools.current) {\n componentEl.classList.add('tools-stacked', 'animated');\n shouldAnimateTools.current = false;\n }\n\n // Remove animation class to prevent it messing up the show transitions\n setTimeout(() => {\n componentEl.classList.remove('animated');\n }, ANIMATION_DURATION);\n } else {\n componentEl.classList.remove('tools-stacked');\n shouldAnimateTools.current = true;\n }\n }, [shouldUseStackedToolsClass, canRevealTools, canToolsCollideWithChatInfo, isRightColumnShown]);\n\n const isBrowserOnline = useBrowserOnline();\n const isConnecting = (!isBrowserOnline || connectionState === 'connectionStateConnecting')\n && (IS_SINGLE_COLUMN_LAYOUT || (IS_TABLET_COLUMN_LAYOUT && !shouldShowCloseButton));\n\n function renderInfo() {\n if (isConnecting) {\n return (\n <>\n {renderBackButton()}\n

\n {lang('WaitingForNetwork')}\n

\n \n );\n }\n return (\n messageListType === 'thread' && threadId === MAIN_THREAD_ID ? (\n renderMainThreadInfo()\n ) : messageListType === 'thread' ? (\n <>\n {renderBackButton()}\n

\n {lang('CommentsCount', messagesCount)}\n

\n \n ) : messageListType === 'pinned' ? (\n <>\n {renderBackButton()}\n

\n {lang('PinnedMessagesCount', messagesCount)}\n

\n \n ) : messageListType === 'scheduled' ? (\n <>\n {renderBackButton()}\n

\n {isChatWithSelf ? lang('Reminders') : lang('messages', messagesCount, 'i')}\n

\n \n ) : undefined\n );\n }\n\n function renderMainThreadInfo() {\n return (\n <>\n {(isLeftColumnHideable || currentTransitionKey > 0) && renderBackButton(shouldShowCloseButton, true)}\n
\n {isChatPrivate(chatId) ? (\n \n ) : (\n \n )}\n
\n \n );\n }\n\n function renderBackButton(asClose = false, withUnreadCount = false) {\n return (\n
\n \n
\n \n {withUnreadCount && unreadCount && (\n
\n {formatIntegerCompact(unreadCount)}\n
\n )}\n
\n );\n }\n\n return (\n
\n \n {renderInfo}\n \n\n
\n {shouldRenderPinnedMessage && renderingPinnedMessage && !shouldRenderAudioPlayer && (\n \n )}\n {shouldRenderAudioPlayer && renderingAudioMessage && (\n \n )}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId, messageListType }): StateProps => {\n const { isLeftColumnShown, lastSyncTime, shouldSkipHistoryAnimations } = global;\n const { byId: chatsById } = global.chats;\n const chat = selectChat(global, chatId);\n\n const { typingStatus } = chat || {};\n\n const { chatId: audioChatId, messageId: audioMessageId } = global.audioPlayer;\n const audioMessage = audioChatId && audioMessageId\n ? selectChatMessage(global, audioChatId, audioMessageId)\n : undefined;\n\n let messagesCount: number | undefined;\n if (messageListType === 'pinned') {\n const pinnedIds = selectPinnedIds(global, chatId);\n messagesCount = pinnedIds?.length;\n } else if (messageListType === 'scheduled') {\n const scheduledIds = selectScheduledIds(global, chatId);\n messagesCount = scheduledIds?.length;\n } else if (messageListType === 'thread' && threadId !== MAIN_THREAD_ID) {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (threadInfo) {\n messagesCount = threadInfo.messagesCount;\n }\n }\n\n const state: StateProps = {\n typingStatus,\n isLeftColumnShown,\n isRightColumnShown: selectIsRightColumnShown(global),\n isSelectModeActive: selectIsInSelectMode(global),\n audioMessage,\n chat,\n chatsById,\n messagesCount,\n isChatWithSelf: selectIsChatWithSelf(global, chatId),\n isChatWithBot: chat && selectIsChatWithBot(global, chat),\n lastSyncTime,\n shouldSkipHistoryAnimations,\n currentTransitionKey: Math.max(0, global.messages.messageLists.length - 1),\n connectionState: global.connectionState,\n };\n\n const messagesById = selectChatMessages(global, chatId);\n if (messageListType !== 'thread' || !messagesById) {\n return state;\n }\n\n Object.assign(state, { messagesById });\n\n if (threadId !== MAIN_THREAD_ID) {\n const pinnedMessageId = selectThreadTopMessageId(global, chatId, threadId);\n const message = pinnedMessageId ? selectChatMessage(global, chatId, pinnedMessageId) : undefined;\n const topMessageSender = message ? selectForwardedSender(global, message) : undefined;\n\n return {\n ...state,\n pinnedMessageIds: pinnedMessageId,\n canUnpin: false,\n topMessageSender,\n };\n }\n\n const pinnedMessageIds = selectPinnedIds(global, chatId);\n if (pinnedMessageIds?.length) {\n const firstPinnedMessage = messagesById[pinnedMessageIds[0]];\n const {\n canUnpin,\n } = (firstPinnedMessage && selectAllowedMessageActions(global, firstPinnedMessage, threadId)) || {};\n\n return {\n ...state,\n pinnedMessageIds,\n canUnpin,\n };\n }\n\n return state;\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChatWithInfo',\n 'pinMessage',\n 'focusMessage',\n 'openChat',\n 'openPreviousChat',\n 'loadPinnedMessages',\n 'toggleLeftColumn',\n 'exitMessageSelectMode',\n ]),\n)(MiddleHeader));\n","import { ApiMessage } from '../../../api/types';\nimport { IAlbum } from '../../../types';\n\nimport { getDayStart } from '../../../util/dateFormat';\nimport { isActionMessage } from '../../../modules/helpers';\n\ntype SenderGroup = (ApiMessage | IAlbum)[];\n\nconst GROUP_INTERVAL_SECONDS = 600; // 10 minutes\n\nexport type MessageDateGroup = {\n originalDate: number;\n datetime: number;\n senderGroups: SenderGroup[];\n};\n\nexport function isAlbum(messageOrAlbum: ApiMessage | IAlbum): messageOrAlbum is IAlbum {\n return 'albumId' in messageOrAlbum;\n}\n\nexport function groupMessages(messages: ApiMessage[], firstUnreadId?: number) {\n let currentSenderGroup: SenderGroup = [];\n let currentDateGroup = {\n originalDate: messages[0].date,\n datetime: Number(getDayStart(messages[0].date * 1000)),\n senderGroups: [currentSenderGroup],\n };\n let currentAlbum: IAlbum | undefined;\n\n const dateGroups: MessageDateGroup[] = [currentDateGroup];\n\n messages.forEach((message, index) => {\n if (message.isInAlbum) {\n if (!currentAlbum) {\n currentAlbum = {\n albumId: message.groupedId!,\n messages: [message],\n mainMessage: message,\n };\n } else {\n currentAlbum.messages.push(message);\n if (message.content.text) {\n currentAlbum.mainMessage = message;\n }\n }\n } else {\n currentSenderGroup.push(message);\n }\n\n const nextMessage = messages[index + 1];\n\n if (\n currentAlbum\n && (!nextMessage || !nextMessage.groupedId || nextMessage.groupedId !== currentAlbum.albumId)\n ) {\n currentSenderGroup.push(currentAlbum);\n currentAlbum = undefined;\n }\n if (nextMessage) {\n const nextMessageDayStartsAt = Number(getDayStart(nextMessage.date * 1000));\n if (currentDateGroup.datetime !== nextMessageDayStartsAt) {\n currentDateGroup = {\n originalDate: nextMessage.date,\n datetime: nextMessageDayStartsAt,\n senderGroups: [],\n };\n dateGroups.push(currentDateGroup);\n\n currentSenderGroup = [];\n currentDateGroup.senderGroups.push(currentSenderGroup);\n } else if (\n nextMessage.id === firstUnreadId\n || message.senderId !== nextMessage.senderId\n || message.isOutgoing !== nextMessage.isOutgoing\n || isActionMessage(message)\n || isActionMessage(nextMessage)\n || (\n message.forwardInfo && nextMessage.forwardInfo\n && (\n message.forwardInfo.senderUserId !== nextMessage.forwardInfo.senderUserId\n || message.forwardInfo.fromChatId !== nextMessage.forwardInfo.fromChatId\n || message.forwardInfo.hiddenUserName !== nextMessage.forwardInfo.hiddenUserName\n )\n )\n || message.inlineButtons\n || nextMessage.inlineButtons\n || (nextMessage.date - message.date) > GROUP_INTERVAL_SECONDS\n ) {\n currentSenderGroup = [];\n currentDateGroup.senderGroups.push(currentSenderGroup);\n }\n }\n });\n\n return dateGroups;\n}\n","import { RefObject } from 'react';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { MessageListType } from '../../../global/types';\n\nimport { IS_ANDROID, IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useBackgroundMode from '../../../hooks/useBackgroundMode';\n\nconst INTERSECTION_THROTTLE_FOR_MEDIA = IS_ANDROID ? 1000 : 350;\nconst INTERSECTION_MARGIN_FOR_MEDIA = IS_SINGLE_COLUMN_LAYOUT ? 300 : 500;\nconst INTERSECTION_THROTTLE_FOR_READING = 150;\n\nexport default function useMessageObservers(\n type: MessageListType,\n containerRef: RefObject,\n memoFirstUnreadIdRef: { current: number | undefined },\n) {\n const { markMessageListRead, markMessagesRead } = getDispatch();\n\n const {\n observe: observeIntersectionForMedia,\n } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE_FOR_MEDIA,\n margin: INTERSECTION_MARGIN_FOR_MEDIA,\n });\n\n const {\n observe: observeIntersectionForReading, freeze: freezeForReading, unfreeze: unfreezeForReading,\n } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE_FOR_READING,\n }, (entries) => {\n if (type !== 'thread') {\n return;\n }\n\n let maxId = 0;\n const mentionIds: number[] = [];\n\n entries.forEach((entry) => {\n const { isIntersecting, target } = entry;\n\n if (!isIntersecting) {\n return;\n }\n\n const { dataset } = target as HTMLDivElement;\n\n const messageId = Number(dataset.lastMessageId || dataset.messageId);\n if (messageId > maxId) {\n maxId = messageId;\n }\n\n if (dataset.hasUnreadMention) {\n mentionIds.push(messageId);\n }\n });\n\n if (memoFirstUnreadIdRef.current && maxId >= memoFirstUnreadIdRef.current) {\n markMessageListRead({ maxId });\n }\n\n if (mentionIds.length) {\n markMessagesRead({ messageIds: mentionIds });\n }\n });\n\n useBackgroundMode(freezeForReading, unfreezeForReading);\n\n const { observe: observeIntersectionForAnimatedStickers } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE_FOR_MEDIA,\n });\n\n return {\n observeIntersectionForMedia,\n observeIntersectionForReading,\n observeIntersectionForAnimatedStickers,\n };\n}\n","import { ApiMessage } from '../../../../api/types';\n\nimport { getMessageContent } from '../../../../modules/helpers';\n\nexport function isEmojiOnlyMessage(customShape?: boolean | number) {\n return typeof customShape === 'number';\n}\n\nexport function buildContentClassName(\n message: ApiMessage,\n {\n hasReply,\n customShape,\n isLastInGroup,\n asForwarded,\n hasThread,\n forceSenderName,\n hasComments,\n hasActionButton,\n }: {\n hasReply?: boolean;\n customShape?: boolean | number;\n isLastInGroup?: boolean;\n asForwarded?: boolean;\n hasThread?: boolean;\n forceSenderName?: boolean;\n hasComments?: boolean;\n hasActionButton?: boolean;\n } = {},\n) {\n const {\n text, photo, video, audio, voice, document, poll, webPage, contact,\n } = getMessageContent(message);\n\n const classNames = ['message-content'];\n const isMedia = photo || video;\n const isMediaWithNoText = isMedia && !text;\n const isViaBot = Boolean(message.viaBotId);\n\n if (isEmojiOnlyMessage(customShape)) {\n classNames.push(`emoji-only emoji-only-${customShape}`);\n } else if (text) {\n classNames.push('text');\n }\n\n if (hasActionButton) {\n classNames.push('has-action-button');\n }\n\n if (customShape) {\n classNames.push('custom-shape');\n if (video?.isRound) {\n classNames.push('round');\n }\n\n if (hasComments) {\n classNames.push('has-comments');\n }\n }\n if (photo || video) {\n classNames.push('media');\n } else if (audio) {\n classNames.push('audio');\n } else if (voice) {\n classNames.push('voice');\n } else if (document) {\n classNames.push('document');\n } else if (contact) {\n classNames.push('contact');\n } else if (poll) {\n classNames.push('poll');\n } else if (webPage) {\n classNames.push('web-page');\n\n if (webPage.photo || webPage.video) {\n classNames.push('media');\n }\n }\n\n if (asForwarded && !customShape) {\n classNames.push('is-forwarded');\n }\n\n if (hasReply) {\n classNames.push('is-reply');\n }\n\n if (hasThread) {\n classNames.push('has-replies');\n }\n\n if (isViaBot) {\n classNames.push('is-via-bot');\n }\n\n if (forceSenderName) {\n classNames.push('force-sender-name');\n }\n\n if (!customShape) {\n classNames.push('has-shadow');\n\n if (isMedia && hasComments) {\n classNames.push('has-background');\n }\n\n if (hasReply || asForwarded || !isMediaWithNoText || isViaBot || forceSenderName) {\n classNames.push('has-solid-background');\n }\n\n if (isLastInGroup && (photo || !isMediaWithNoText)) {\n classNames.push('has-appendix');\n }\n }\n\n return classNames.join(' ');\n}\n","import { ApiMessage } from '../../../../api/types';\nimport { calculateInlineImageDimensions, calculateVideoDimensions } from '../../../common/helpers/mediaDimensions';\nimport {\n getMessageText,\n getMessagePhoto,\n getMessageWebPagePhoto,\n isForwardedMessage,\n isOwnMessage,\n getMessageVideo,\n} from '../../../../modules/helpers';\n\nconst MIN_MEDIA_WIDTH = 100;\nconst MIN_MEDIA_WIDTH_WITH_COMMENTS = 238;\nconst MIN_MEDIA_WIDTH_WITH_TEXT = 175;\nconst MIN_MEDIA_WIDTH_WITH_TEXT_AND_COMMENTS = 238;\nconst MIN_MEDIA_HEIGHT = 90;\nconst SMALL_IMAGE_THRESHOLD = 12;\n\nexport function getMinMediaWidth(hasText?: boolean, hasCommentButton?: boolean) {\n return hasText\n ? (hasCommentButton ? MIN_MEDIA_WIDTH_WITH_TEXT_AND_COMMENTS : MIN_MEDIA_WIDTH_WITH_TEXT)\n : (hasCommentButton ? MIN_MEDIA_WIDTH_WITH_COMMENTS : MIN_MEDIA_WIDTH);\n}\n\nexport function calculateMediaDimensions(message: ApiMessage, noAvatars?: boolean) {\n const isOwn = isOwnMessage(message);\n const isForwarded = isForwardedMessage(message);\n const photo = getMessagePhoto(message) || getMessageWebPagePhoto(message);\n const video = getMessageVideo(message);\n\n const isWebPagePhoto = Boolean(getMessageWebPagePhoto(message));\n const { width, height } = photo\n ? calculateInlineImageDimensions(photo, isOwn, isForwarded, isWebPagePhoto, noAvatars)\n : calculateVideoDimensions(video!, isOwn, isForwarded, noAvatars);\n\n const hasText = Boolean(getMessageText(message));\n const minMediaWidth = getMinMediaWidth(hasText);\n\n let stretchFactor = 1;\n if (width < minMediaWidth && minMediaWidth - width < SMALL_IMAGE_THRESHOLD) {\n stretchFactor = minMediaWidth / width;\n }\n if (height * stretchFactor < MIN_MEDIA_HEIGHT && MIN_MEDIA_HEIGHT - height * stretchFactor < SMALL_IMAGE_THRESHOLD) {\n stretchFactor = MIN_MEDIA_HEIGHT / height;\n }\n\n const finalWidth = Math.round(width * stretchFactor);\n const finalHeight = Math.round(height * stretchFactor);\n\n return {\n width: finalWidth,\n height: finalHeight,\n isSmall: finalWidth < minMediaWidth || finalHeight < MIN_MEDIA_HEIGHT,\n };\n}\n","/* eslint-disable no-bitwise */\n// Based on\n// https://github.com/telegramdesktop/tdesktop/blob/dev/Telegram/SourceFiles/ui/grouped_layout.cpp\n// https://github.com/overtake/TelegramSwift/blob/master/Telegram-Mac/GroupedLayout.swift#L83\n\nimport { IAlbum } from '../../../../types';\nimport { ApiMessage, ApiDimensions } from '../../../../api/types';\n\nimport { getAvailableWidth, REM } from '../../../common/helpers/mediaDimensions';\nimport { calculateMediaDimensions } from './mediaDimensions';\n\nexport const AlbumRectPart = {\n None: 0,\n Top: 1,\n Right: 2,\n Bottom: 4,\n Left: 8,\n};\n\ntype IAttempt = {\n lineCounts: number[];\n heights: number[];\n};\nexport type IMediaDimensions = {\n width: number;\n height: number;\n x: number;\n y: number;\n};\ntype IMediaLayout = {\n dimensions: IMediaDimensions;\n sides: number;\n};\ntype ILayoutParams = {\n ratios: number[];\n proportions: string;\n averageRatio: number;\n maxWidth: number;\n minWidth: number;\n maxHeight: number;\n spacing: number;\n};\nexport type IAlbumLayout = {\n layout: IMediaLayout[];\n containerStyle: ApiDimensions;\n};\n\nfunction getRatios(messages: ApiMessage[]) {\n return messages.map(\n (message) => {\n const dimensions = calculateMediaDimensions(message) as ApiDimensions;\n\n return dimensions.width / dimensions.height;\n },\n );\n}\n\nfunction getProportions(ratios: number[]) {\n return ratios.map((ratio) => (ratio > 1.2 ? 'w' : (ratio < 0.8 ? 'n' : 'q'))).join('');\n}\n\nfunction getAverageRatio(ratios: number[]) {\n return ratios.reduce((result, ratio) => ratio + result, 1) / ratios.length;\n}\n\nfunction accumulate(list: number[], initValue: number) {\n return list.reduce((accumulator, item) => accumulator + item, initValue);\n}\n\nfunction clamp(num: number, low: number, high: number) {\n return num < low ? low : (num > high ? high : num);\n}\n\nfunction cropRatios(ratios: number[], averageRatio: number) {\n return ratios.map((ratio) => (averageRatio > 1.1 ? clamp(ratio, 1, 2.75) : clamp(ratio, 0.6667, 1)));\n}\n\nfunction calculateContainerSize(layout: IMediaLayout[]) {\n const styles: ApiDimensions = { width: 0, height: 0 };\n layout.forEach(({\n dimensions,\n sides,\n }) => {\n if (sides & AlbumRectPart.Right) {\n styles.width = dimensions.width + dimensions.x;\n }\n if (sides & AlbumRectPart.Bottom) {\n styles.height = dimensions.height + dimensions.y;\n }\n });\n\n return styles;\n}\n\nexport function calculateAlbumLayout(\n isOwn: boolean,\n isForwarded: boolean,\n noAvatars: boolean,\n album: IAlbum,\n): IAlbumLayout {\n const spacing = 2;\n const ratios = getRatios(album.messages);\n const proportions = getProportions(ratios);\n const averageRatio = getAverageRatio(ratios);\n const albumCount = ratios.length;\n const forceCalc = ratios.some((ratio) => ratio > 2);\n const maxWidth = getAvailableWidth(isOwn, isForwarded, false, noAvatars) - (isForwarded ? 2.5 : 0) * REM;\n const maxHeight = maxWidth;\n\n let layout;\n\n const params = {\n ratios,\n proportions,\n averageRatio,\n maxWidth,\n minWidth: 100,\n maxHeight,\n spacing,\n };\n\n if (albumCount >= 5 || forceCalc) {\n layout = layoutWithComplexLayouter(params);\n } else if (albumCount === 2) {\n layout = layoutTwo(params);\n } else if (albumCount === 3) {\n layout = layoutThree(params);\n } else {\n layout = layoutFour(params);\n }\n\n return {\n layout,\n containerStyle: calculateContainerSize(layout),\n };\n}\n\nfunction layoutWithComplexLayouter({\n ratios: originalRatios,\n averageRatio,\n maxWidth,\n minWidth,\n spacing,\n maxHeight = (4 * maxWidth) / 3,\n}: ILayoutParams) {\n const ratios = cropRatios(originalRatios, averageRatio);\n const count = originalRatios.length;\n const result = new Array(count);\n const attempts: IAttempt[] = [];\n\n const multiHeight = (offset: number, attemptCount: number) => {\n const attemptRatios = ratios.slice(offset, offset + attemptCount);\n const sum = accumulate(attemptRatios, 0);\n\n return (maxWidth - (attemptCount - 1) * spacing) / sum;\n };\n\n const pushAttempt = (lineCounts: number[]) => {\n const heights: number[] = [];\n let offset = 0;\n lineCounts.forEach((currentCount) => {\n heights.push(multiHeight(offset, currentCount));\n offset += currentCount;\n });\n\n attempts.push({\n lineCounts,\n heights,\n });\n };\n\n for (let first = 1; first !== count; ++first) {\n const second = count - first;\n if (first <= 3 && second <= 3) {\n pushAttempt([first, second]);\n }\n }\n\n for (let first = 1; first !== count - 1; ++first) {\n for (let second = 1; second !== count - first; ++second) {\n const third = count - first - second;\n if (first <= 3 && second <= (averageRatio < 0.85 ? 4 : 3) && third <= 3) {\n pushAttempt([first, second, third]);\n }\n }\n }\n\n for (let first = 1; first !== count - 1; ++first) {\n for (let second = 1; second !== count - first; ++second) {\n for (let third = 1; third !== count - first - second; ++third) {\n const fourth = count - first - second - third;\n if (first <= 3 && second <= 3 && third <= 3 && fourth <= 4) {\n pushAttempt([first, second, third, fourth]);\n }\n }\n }\n }\n\n let optimalAttempt: IAttempt | undefined;\n let optimalDiff = 0;\n for (let i = 0; i < attempts.length; i++) {\n const {\n heights,\n lineCounts,\n } = attempts[i];\n const lineCount = lineCounts.length;\n const totalHeight = accumulate(heights, 0) + spacing * (lineCount - 1);\n const minLineHeight = Math.min(...heights);\n const bad1 = minLineHeight < minWidth ? 1.5 : 1;\n const bad2 = (() => {\n for (let line = 1; line !== lineCount; ++line) {\n if (lineCounts[line - 1] > lineCounts[line]) {\n return 1.5;\n }\n }\n\n return 1;\n })();\n const diff = Math.abs(totalHeight - maxHeight) * bad1 * bad2;\n\n if (!optimalAttempt || diff < optimalDiff) {\n optimalAttempt = attempts[i];\n optimalDiff = diff;\n }\n }\n\n const optimalCounts = optimalAttempt!.lineCounts;\n const optimalHeights = optimalAttempt!.heights;\n const rowCount = optimalCounts.length;\n let index = 0;\n let y = 0;\n for (let row = 0; row !== rowCount; ++row) {\n const colCount = optimalCounts[row];\n const lineHeight = optimalHeights[row];\n const height = Math.round(lineHeight);\n let x = 0;\n\n for (let col = 0; col !== colCount; ++col) {\n const sides = AlbumRectPart.None\n | (row === 0 ? AlbumRectPart.Top : AlbumRectPart.None)\n | (row === rowCount - 1 ? AlbumRectPart.Bottom : AlbumRectPart.None)\n | (col === 0 ? AlbumRectPart.Left : AlbumRectPart.None)\n | (col === colCount - 1 ? AlbumRectPart.Right : AlbumRectPart.None);\n const ratio = ratios[index];\n const width = col === colCount - 1 ? maxWidth - x : Math.round(ratio * lineHeight);\n result[index] = {\n dimensions: {\n x,\n y,\n width,\n height,\n },\n sides,\n };\n x += width + spacing;\n ++index;\n }\n y += height + spacing;\n }\n\n return result;\n}\n\nfunction layoutTwo(params: ILayoutParams) {\n const {\n ratios,\n proportions,\n averageRatio,\n } = params;\n return proportions === 'ww' && averageRatio > 1.4 && ratios[1] - ratios[0] < 0.2\n ? layoutTwoTopBottom(params)\n : proportions === 'ww' || proportions === 'qq'\n ? layoutTwoLeftRightEqual(params)\n : layoutTwoLeftRight(params);\n}\n\nfunction layoutTwoTopBottom(params: ILayoutParams) {\n const {\n ratios,\n maxWidth,\n spacing,\n maxHeight,\n } = params;\n const height = Math.round(Math.min(maxWidth / ratios[0], Math.min(maxWidth / ratios[1], (maxHeight - spacing) / 2)));\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: maxWidth,\n height,\n },\n sides: AlbumRectPart.Left | AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: 0,\n y: height + spacing,\n width: maxWidth,\n height,\n },\n sides: AlbumRectPart.Left | AlbumRectPart.Bottom | AlbumRectPart.Right,\n }];\n}\n\nfunction layoutTwoLeftRightEqual(params: ILayoutParams) {\n const {\n ratios,\n maxWidth,\n spacing,\n maxHeight,\n } = params;\n const width = (maxWidth - spacing) / 2;\n const height = Math.round(Math.min(width / ratios[0], Math.min(width / ratios[1], maxHeight)));\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width,\n height,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Left | AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: width + spacing,\n y: 0,\n width,\n height,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Right | AlbumRectPart.Bottom,\n }];\n}\n\nfunction layoutTwoLeftRight(params: ILayoutParams) {\n const {\n ratios,\n minWidth,\n maxWidth,\n spacing,\n maxHeight,\n } = params;\n const minimalWidth = Math.round(1.5 * minWidth);\n const secondWidth = Math.min(\n Math.round(\n Math.max(\n 0.4 * (maxWidth - spacing),\n (maxWidth - spacing) / ratios[0] / (1 / ratios[0] + 1 / ratios[1]),\n ),\n ),\n maxWidth - spacing - minimalWidth,\n );\n const firstWidth = maxWidth - secondWidth - spacing;\n const height = Math.min(maxHeight, Math.round(Math.min(firstWidth / ratios[0], secondWidth / ratios[1])));\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: firstWidth,\n height,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Left | AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: firstWidth + spacing,\n y: 0,\n width: secondWidth,\n height,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Right | AlbumRectPart.Bottom,\n }];\n}\n\nfunction layoutThree(params: ILayoutParams) {\n const { proportions } = params;\n\n return proportions[0] === 'n'\n ? layoutThreeLeftAndOther(params)\n : layoutThreeTopAndOther(params);\n}\n\nfunction layoutThreeLeftAndOther(params: ILayoutParams) {\n const {\n maxHeight,\n spacing,\n ratios,\n maxWidth,\n minWidth,\n } = params;\n const firstHeight = maxHeight;\n const thirdHeight = Math.round(\n Math.min(\n (maxHeight - spacing) / 2,\n (ratios[1] * (maxWidth - spacing)) / (ratios[2] + ratios[1]),\n ),\n );\n const secondHeight = firstHeight - thirdHeight - spacing;\n const rightWidth = Math.max(\n minWidth,\n Math.round(\n Math.min(\n (maxWidth - spacing) / 2,\n Math.min(\n thirdHeight * ratios[2],\n secondHeight * ratios[1],\n ),\n ),\n ),\n );\n const leftWidth = Math.min(Math.round(firstHeight * ratios[0]), maxWidth - spacing - rightWidth);\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: leftWidth,\n height: firstHeight,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Left | AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: leftWidth + spacing,\n y: 0,\n width: rightWidth,\n height: secondHeight,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: leftWidth + spacing,\n y: secondHeight + spacing,\n width: rightWidth,\n height: thirdHeight,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Right,\n }];\n}\n\nfunction layoutThreeTopAndOther(params: ILayoutParams) {\n const {\n maxWidth,\n ratios,\n maxHeight,\n spacing,\n } = params;\n const firstWidth = maxWidth;\n const firstHeight = Math.round(Math.min(firstWidth / ratios[0], 0.66 * (maxHeight - spacing)));\n const secondWidth = (maxWidth - spacing) / 2;\n const secondHeight = Math.min(\n maxHeight - firstHeight - spacing,\n Math.round(Math.min(\n secondWidth / ratios[1],\n secondWidth / ratios[2],\n )),\n );\n const thirdWidth = firstWidth - secondWidth - spacing;\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: firstWidth,\n height: firstHeight,\n },\n sides: AlbumRectPart.Left | AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: 0,\n y: firstHeight + spacing,\n width: secondWidth,\n height: secondHeight,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Left,\n }, {\n dimensions: {\n x: secondWidth + spacing,\n y: firstHeight + spacing,\n width: thirdWidth,\n height: secondHeight,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Right,\n }];\n}\n\nfunction layoutFour(params: ILayoutParams) {\n const { proportions } = params;\n\n return proportions[0] === 'w'\n ? layoutFourTopAndOther(params)\n : layoutFourLeftAndOther(params);\n}\n\nfunction layoutFourTopAndOther({\n maxWidth,\n ratios,\n spacing,\n maxHeight,\n minWidth,\n}: ILayoutParams) {\n const w = maxWidth;\n const h0 = Math.round(Math.min(w / ratios[0], 0.66 * (maxHeight - spacing)));\n const h = Math.round((maxWidth - 2 * spacing) / (ratios[1] + ratios[2] + ratios[3]));\n const w0 = Math.max(minWidth, Math.round(Math.min(0.4 * (maxWidth - 2 * spacing), h * ratios[1])));\n const w2 = Math.round(Math.max(Math.max(minWidth, 0.33 * (maxWidth - 2 * spacing)), h * ratios[3]));\n const w1 = w - w0 - w2 - 2 * spacing;\n const h1 = Math.min(maxHeight - h0 - spacing, h);\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: w,\n height: h0,\n },\n sides: AlbumRectPart.Left | AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: 0,\n y: h0 + spacing,\n width: w0,\n height: h1,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Left,\n }, {\n dimensions: {\n x: w0 + spacing,\n y: h0 + spacing,\n width: w1,\n height: h1,\n },\n sides: AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: w0 + spacing + w1 + spacing,\n y: h0 + spacing,\n width: w2,\n height: h1,\n },\n sides: AlbumRectPart.Right | AlbumRectPart.Bottom,\n }];\n}\n\nfunction layoutFourLeftAndOther({\n maxHeight,\n ratios,\n maxWidth,\n spacing,\n minWidth,\n}: ILayoutParams) {\n const h = maxHeight;\n const w0 = Math.round(Math.min(h * ratios[0], 0.6 * (maxWidth - spacing)));\n const w = Math.round((maxHeight - 2 * spacing) / (1 / ratios[1] + 1 / ratios[2] + 1 / ratios[3]));\n const h0 = Math.round(w / ratios[1]);\n const h1 = Math.round(w / ratios[2]);\n const h2 = h - h0 - h1 - 2 * spacing;\n const w1 = Math.max(minWidth, Math.min(maxWidth - w0 - spacing, w));\n\n return [{\n dimensions: {\n x: 0,\n y: 0,\n width: w0,\n height: h,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Left | AlbumRectPart.Bottom,\n }, {\n dimensions: {\n x: w0 + spacing,\n y: 0,\n width: w1,\n height: h0,\n },\n sides: AlbumRectPart.Top | AlbumRectPart.Right,\n }, {\n dimensions: {\n x: w0 + spacing,\n y: h0 + spacing,\n width: w1,\n height: h1,\n },\n sides: AlbumRectPart.Right,\n }, {\n dimensions: {\n x: w0 + spacing,\n y: h0 + h1 + 2 * spacing,\n width: w1,\n height: h2,\n },\n sides: AlbumRectPart.Bottom | AlbumRectPart.Right,\n }];\n}\n","import { IS_IOS } from '../../../../util/environment';\n\nlet element: HTMLSpanElement | undefined;\n\nexport default function calculateAuthorWidth(text: string) {\n if (!element) {\n element = document.createElement('span');\n // eslint-disable-next-line max-len\n element.style.font = IS_IOS\n // eslint-disable-next-line max-len\n ? '400 12px system-ui, -apple-system, BlinkMacSystemFont, \"Roboto\", \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif'\n : '400 12px \"Roboto\", -apple-system, \"Apple Color Emoji\", BlinkMacSystemFont, \"Helvetica Neue\", sans-serif';\n element.style.whiteSpace = 'nowrap';\n element.style.position = 'absolute';\n element.style.left = '-999px';\n element.style.opacity = '.01';\n document.body.appendChild(element);\n }\n\n element.innerHTML = text;\n\n return element.offsetWidth;\n}\n","import { FocusDirection } from '../../../../types';\n\nimport { useLayoutEffect } from '../../../../lib/teact/teact';\nimport fastSmoothScroll from '../../../../util/fastSmoothScroll';\n\n// This is used when the viewport was replaced.\nconst RELOCATED_FOCUS_OFFSET = 1000;\nconst FOCUS_MARGIN = 20;\n\nexport default function useFocusMessage(\n elementRef: { current: HTMLDivElement | null },\n chatId: number,\n isFocused?: boolean,\n focusDirection?: FocusDirection,\n noFocusHighlight?: boolean,\n isResizingContainer?: boolean,\n) {\n useLayoutEffect(() => {\n if (isFocused && elementRef.current) {\n const messagesContainer = elementRef.current.closest('.MessageList')!;\n\n fastSmoothScroll(\n messagesContainer,\n elementRef.current,\n // `noFocusHighlight` always called from “scroll-to-bottom” buttons\n noFocusHighlight ? 'end' : 'centerOrTop',\n FOCUS_MARGIN,\n focusDirection !== undefined ? RELOCATED_FOCUS_OFFSET : undefined,\n focusDirection,\n undefined,\n isResizingContainer,\n );\n }\n }, [elementRef, chatId, isFocused, focusDirection, noFocusHighlight, isResizingContainer]);\n}\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './ContextMenuContainer';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst ContextMenuContainerAsync: FC = (props) => {\n const { isOpen } = props;\n const ContextMenuContainer = useModuleLoader(Bundles.Extra, 'ContextMenuContainer', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ContextMenuContainer ? : undefined;\n};\n\nexport default memo(ContextMenuContainerAsync);\n","import React, {\n FC, memo, useEffect, useMemo, useRef,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiMessage, ApiChat } from '../../api/types';\nimport { FocusDirection } from '../../types';\n\nimport {\n selectUser,\n selectChatMessage,\n selectIsMessageFocused,\n selectChat,\n} from '../../modules/selectors';\nimport { isChatChannel } from '../../modules/helpers';\nimport buildClassName from '../../util/buildClassName';\nimport renderText from '../common/helpers/renderText';\nimport { renderActionMessageText } from '../common/helpers/renderActionMessageText';\nimport useEnsureMessage from '../../hooks/useEnsureMessage';\nimport useContextMenuHandlers from '../../hooks/useContextMenuHandlers';\nimport { ObserveFn, useOnIntersect } from '../../hooks/useIntersectionObserver';\nimport useFocusMessage from './message/hooks/useFocusMessage';\nimport useLang from '../../hooks/useLang';\n\nimport ContextMenuContainer from './message/ContextMenuContainer.async';\nimport useFlag from '../../hooks/useFlag';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport { preventMessageInputBlur } from './helpers/preventMessageInputBlur';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection?: ObserveFn;\n isEmbedded?: boolean;\n appearanceOrder?: number;\n isLastInList?: boolean;\n};\n\ntype StateProps = {\n usersById: Record;\n sender?: ApiUser | ApiChat;\n targetUserIds?: number[];\n targetMessage?: ApiMessage;\n targetChatId?: number;\n isFocused: boolean;\n focusDirection?: FocusDirection;\n noFocusHighlight?: boolean;\n};\n\nconst APPEARANCE_DELAY = 10;\n\nconst ActionMessage: FC = ({\n message,\n observeIntersection,\n isEmbedded,\n appearanceOrder = 0,\n isLastInList,\n usersById,\n sender,\n targetUserIds,\n targetMessage,\n targetChatId,\n isFocused,\n focusDirection,\n noFocusHighlight,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n useOnIntersect(ref, observeIntersection);\n useEnsureMessage(message.chatId, message.replyToMessageId, targetMessage);\n useFocusMessage(ref, message.chatId, isFocused, focusDirection, noFocusHighlight);\n\n const lang = useLang();\n\n const noAppearanceAnimation = appearanceOrder <= 0;\n const [isShown, markShown] = useFlag(noAppearanceAnimation);\n useEffect(() => {\n if (noAppearanceAnimation) {\n return;\n }\n\n setTimeout(markShown, appearanceOrder * APPEARANCE_DELAY);\n }, [appearanceOrder, markShown, noAppearanceAnimation]);\n const { transitionClassNames } = useShowTransition(isShown, undefined, noAppearanceAnimation, false);\n\n const targetUsers = useMemo(() => {\n return targetUserIds\n ? targetUserIds.map((userId) => usersById?.[userId]).filter(Boolean as any)\n : undefined;\n }, [targetUserIds, usersById]);\n\n const content = renderActionMessageText(\n lang,\n message,\n sender,\n targetUsers,\n targetMessage,\n targetChatId,\n isEmbedded ? { isEmbedded: true, asPlain: true } : undefined,\n );\n const {\n isContextMenuOpen, contextMenuPosition,\n handleBeforeContextMenu, handleContextMenu,\n handleContextMenuClose, handleContextMenuHide,\n } = useContextMenuHandlers(ref);\n const isContextMenuShown = contextMenuPosition !== undefined;\n\n const handleMouseDown = (e: React.MouseEvent) => {\n preventMessageInputBlur(e);\n handleBeforeContextMenu(e);\n };\n\n if (isEmbedded) {\n return {renderText(content as string)};\n }\n\n const className = buildClassName(\n 'ActionMessage message-list-item',\n isFocused && !noFocusHighlight && 'focused',\n isContextMenuShown && 'has-menu-open',\n isLastInList && 'last-in-list',\n transitionClassNames,\n );\n\n return (\n \n {content}\n {contextMenuPosition && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { message }): StateProps => {\n const { byId: usersById } = global.users;\n const userId = message.senderId;\n const { targetUserIds, targetChatId } = message.content.action || {};\n const targetMessageId = message.replyToMessageId;\n const targetMessage = targetMessageId\n ? selectChatMessage(global, message.chatId, targetMessageId)\n : undefined;\n\n const isFocused = selectIsMessageFocused(global, message);\n const { direction: focusDirection, noHighlight: noFocusHighlight } = (isFocused && global.focusedMessage) || {};\n\n const chat = selectChat(global, message.chatId);\n const sender = chat && (isChatChannel(chat) || userId === message.chatId)\n ? chat\n : userId ? selectUser(global, userId) : undefined;\n\n return {\n usersById,\n sender,\n targetChatId,\n targetUserIds,\n targetMessage,\n isFocused,\n ...(isFocused && { focusDirection, noFocusHighlight }),\n };\n },\n)(ActionMessage));\n","import React, { FC, useRef } from '../../lib/teact/teact';\n\nimport { ApiUser, ApiMessage, ApiChat } from '../../api/types';\n\nimport {\n getMessageMediaHash,\n isActionMessage,\n getMessageSummaryText,\n getSenderTitle,\n getMessageRoundVideo,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { getPictogramDimensions } from './helpers/mediaDimensions';\nimport buildClassName from '../../util/buildClassName';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport useMedia from '../../hooks/useMedia';\nimport useWebpThumbnail from '../../hooks/useWebpThumbnail';\nimport useLang from '../../hooks/useLang';\n\nimport ActionMessage from '../middle/ActionMessage';\n\nimport './EmbeddedMessage.scss';\n\ntype OwnProps = {\n observeIntersection?: ObserveFn;\n className?: string;\n message?: ApiMessage;\n sender?: ApiUser | ApiChat;\n title?: string;\n customText?: string;\n onClick: NoneToVoidFunction;\n};\n\nconst NBSP = '\\u00A0';\n\nconst EmbeddedMessage: FC = ({\n className,\n message,\n sender,\n title,\n customText,\n observeIntersection,\n onClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const mediaBlobUrl = useMedia(message && getMessageMediaHash(message, 'pictogram'), !isIntersecting);\n const pictogramId = message && `sticker-reply-thumb${message.id}`;\n const mediaThumbnail = useWebpThumbnail(message);\n const isRoundVideo = Boolean(message && getMessageRoundVideo(message));\n\n const lang = useLang();\n\n const senderTitle = sender && getSenderTitle(lang, sender);\n\n return (\n \n {mediaThumbnail && renderPictogram(pictogramId, mediaThumbnail, mediaBlobUrl, isRoundVideo)}\n
\n

\n {!message ? (\n customText || NBSP\n ) : isActionMessage(message) ? (\n \n ) : (\n renderText(getMessageSummaryText(lang, message, Boolean(mediaThumbnail)))\n )}\n

\n
{renderText(senderTitle || title || NBSP)}
\n
\n \n );\n};\n\nfunction renderPictogram(\n id: string | undefined,\n thumbDataUri: string,\n blobUrl?: string,\n isRoundVideo?: boolean,\n) {\n const { width, height } = getPictogramDimensions();\n\n return (\n \n );\n}\n\nexport default EmbeddedMessage;\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { ApiMessage, ApiMessageOutgoingStatus } from '../../../api/types';\n\nimport { formatTime } from '../../../util/dateFormat';\nimport { formatIntegerCompact } from '../../../util/textFormat';\n\nimport MessageOutgoingStatus from '../../common/MessageOutgoingStatus';\nimport renderText from '../../common/helpers/renderText';\nimport useLang from '../../../hooks/useLang';\n\nimport './MessageMeta.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n outgoingStatus?: ApiMessageOutgoingStatus;\n signature?: string;\n onClick: (e: React.MouseEvent) => void;\n};\n\nconst MessageMeta: FC = ({\n message, outgoingStatus, signature, onClick,\n}) => {\n const lang = useLang();\n\n return (\n \n {Boolean(message.views) && (\n <>\n \n {formatIntegerCompact(message.views!)}\n \n \n \n )}\n {signature && (\n {renderText(signature)}\n )}\n \n {message.isEdited && `${lang('EditedMessage')} `}\n {formatTime(message.date * 1000)}\n \n {outgoingStatus && (\n \n )}\n \n );\n};\n\nexport default memo(MessageMeta);\n","import React, { FC, useRef } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\n\nimport { MEMOJI_STICKER_ID } from '../../../config';\nimport { getStickerDimensions } from '../../common/helpers/mediaDimensions';\nimport { getMessageMediaFormat, getMessageMediaHash } from '../../../modules/helpers';\nimport useMedia from '../../../hooks/useMedia';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport buildClassName from '../../../util/buildClassName';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useFlag from '../../../hooks/useFlag';\nimport useWebpThumbnail from '../../../hooks/useWebpThumbnail';\n\nimport AnimatedSticker from '../../common/AnimatedSticker';\nimport StickerSetModal from '../../common/StickerSetModal.async';\n\nimport './Sticker.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection: ObserveFn;\n observeIntersectionForPlaying: ObserveFn;\n shouldLoop?: boolean;\n lastSyncTime?: number;\n};\n\nconst Sticker: FC = ({\n message, observeIntersection, observeIntersectionForPlaying, shouldLoop, lastSyncTime,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const [isModalOpen, openModal, closeModal] = useFlag();\n\n const sticker = message.content.sticker!;\n const { isAnimated, stickerSetId } = sticker;\n const isMemojiSticker = stickerSetId === MEMOJI_STICKER_ID;\n\n const shouldLoad = useIsIntersecting(ref, observeIntersection);\n const shouldPlay = useIsIntersecting(ref, observeIntersectionForPlaying);\n\n const mediaHash = sticker.isPreloadedGlobally ? `sticker${sticker.id}` : getMessageMediaHash(message, 'inline')!;\n const thumbDataUri = useWebpThumbnail(message);\n const mediaData = useMedia(\n mediaHash,\n !shouldLoad,\n getMessageMediaFormat(message, 'inline', true),\n lastSyncTime,\n );\n\n const isMediaLoaded = Boolean(mediaData);\n const [isAnimationLoaded, markAnimationLoaded] = useFlag(isMediaLoaded);\n const isMediaReady = isAnimated ? isAnimationLoaded : isMediaLoaded;\n const { shouldRenderFullMedia, transitionClassNames } = useTransitionForMedia(isMediaReady, 'slow');\n\n const { width, height } = getStickerDimensions(sticker);\n const thumbClassName = buildClassName('thumbnail', !thumbDataUri && 'empty');\n\n const stickerClassName = buildClassName(\n 'Sticker media-inner',\n isMemojiSticker && 'inactive',\n );\n\n return (\n
\n {!isMediaReady && (\n \n )}\n {!isAnimated && shouldRenderFullMedia && (\n \n )}\n {isAnimated && isMediaLoaded && (\n \n )}\n \n
\n );\n};\n\nexport default Sticker;\n","import { ApiMessage } from '../../../../api/types';\n\nimport { IS_CANVAS_FILTER_SUPPORTED, IS_SINGLE_COLUMN_LAYOUT } from '../../../../util/environment';\nimport { getMessageMediaThumbDataUri } from '../../../../modules/helpers';\nimport useCanvasBlur from '../../../../hooks/useCanvasBlur';\n\nexport default function useBlurredMediaThumbRef(message: ApiMessage, fullMediaData?: string) {\n return useCanvasBlur(\n getMessageMediaThumbDataUri(message),\n Boolean(fullMediaData),\n IS_SINGLE_COLUMN_LAYOUT && !IS_CANVAS_FILTER_SUPPORTED,\n );\n}\n","const SELECTED_APPENDIX_BACKGROUND = Promise.resolve('rgba(255,255,255,1)');\n\nexport default function getCustomAppendixBg(src: string, isOwn: boolean, inSelectMode?: boolean, isSelected?: boolean) {\n return isSelected ? SELECTED_APPENDIX_BACKGROUND : getAppendixColorFromImage(src, isOwn);\n}\n\nasync function getAppendixColorFromImage(src: string, isOwn: boolean) {\n const img = new Image();\n img.src = src;\n\n if (!img.width) {\n await new Promise((resolve) => {\n img.onload = resolve;\n });\n }\n\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d')!;\n\n canvas.width = img.width;\n canvas.height = img.height;\n\n ctx.drawImage(img, 0, 0, img.width, img.height);\n\n const x = isOwn ? img.width - 1 : 0;\n const y = img.height - 1;\n\n const pixel = Array.from(ctx.getImageData(x, y, 1, 1).data);\n return `rgba(${pixel.join(',')})`;\n}\n","import React, {\n FC, useCallback, useLayoutEffect, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\nimport { IMediaDimensions } from './helpers/calculateAlbumLayout';\n\nimport {\n getMessagePhoto,\n getMessageWebPagePhoto,\n getMessageMediaHash,\n getMediaTransferState,\n isOwnMessage,\n} from '../../../modules/helpers';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMediaWithDownloadProgress from '../../../hooks/useMediaWithDownloadProgress';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useBlurredMediaThumbRef from './hooks/useBlurredMediaThumbRef';\nimport usePrevious from '../../../hooks/usePrevious';\nimport buildClassName from '../../../util/buildClassName';\nimport getCustomAppendixBg from './helpers/getCustomAppendixBg';\nimport { calculateMediaDimensions } from './helpers/mediaDimensions';\n\nimport ProgressSpinner from '../../ui/ProgressSpinner';\n\nexport type OwnProps = {\n id?: string;\n message: ApiMessage;\n observeIntersection?: ObserveFn;\n noAvatars?: boolean;\n shouldAutoLoad?: boolean;\n isInSelectMode?: boolean;\n isSelected?: boolean;\n uploadProgress?: number;\n size?: 'inline' | 'pictogram';\n shouldAffectAppendix?: boolean;\n dimensions?: IMediaDimensions & { isSmall?: boolean };\n nonInteractive?: boolean;\n onClick?: (id: number) => void;\n onCancelUpload?: (message: ApiMessage) => void;\n};\n\nconst CUSTOM_APPENDIX_ATTRIBUTE = 'data-has-custom-appendix';\n\nconst Photo: FC = ({\n id,\n message,\n observeIntersection,\n noAvatars,\n shouldAutoLoad,\n isInSelectMode,\n isSelected,\n uploadProgress,\n size = 'inline',\n dimensions,\n nonInteractive,\n shouldAffectAppendix,\n onClick,\n onCancelUpload,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const photo = (getMessagePhoto(message) || getMessageWebPagePhoto(message))!;\n const localBlobUrl = photo.blobUrl;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const [isDownloadAllowed, setIsDownloadAllowed] = useState(shouldAutoLoad);\n const shouldDownload = isDownloadAllowed && isIntersecting;\n const {\n mediaData, downloadProgress,\n } = useMediaWithDownloadProgress(getMessageMediaHash(message, size), !shouldDownload);\n const fullMediaData = localBlobUrl || mediaData;\n const thumbRef = useBlurredMediaThumbRef(message, fullMediaData);\n\n const {\n isUploading, isTransferring, transferProgress,\n } = getMediaTransferState(message, uploadProgress || downloadProgress, shouldDownload && !fullMediaData);\n const wasDownloadDisabled = usePrevious(isDownloadAllowed) === false;\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring, undefined, wasDownloadDisabled, 'slow');\n const {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(fullMediaData, 'slow');\n\n const handleClick = useCallback(() => {\n if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload(message);\n }\n } else if (!fullMediaData) {\n setIsDownloadAllowed((isAllowed) => !isAllowed);\n } else if (onClick) {\n onClick(message.id);\n }\n }, [fullMediaData, isUploading, message, onCancelUpload, onClick]);\n\n const isOwn = isOwnMessage(message);\n useLayoutEffect(() => {\n if (!shouldAffectAppendix) {\n return;\n }\n\n const contentEl = ref.current!.closest('.message-content')!;\n\n if (fullMediaData) {\n getCustomAppendixBg(fullMediaData, isOwn, isInSelectMode, isSelected).then((appendixBg) => {\n contentEl.style.setProperty('--appendix-bg', appendixBg);\n contentEl.setAttribute(CUSTOM_APPENDIX_ATTRIBUTE, '');\n });\n } else {\n contentEl.classList.add('has-appendix-thumb');\n }\n }, [fullMediaData, isOwn, shouldAffectAppendix, isInSelectMode, isSelected]);\n\n const { width, height, isSmall } = dimensions || calculateMediaDimensions(message, noAvatars);\n\n const className = buildClassName(\n 'media-inner',\n !isUploading && !nonInteractive && 'interactive',\n isSmall && 'small-image',\n width === height && 'square-image',\n );\n\n const style = dimensions\n ? `width: ${width}px; height: ${height}px; left: ${dimensions.x}px; top: ${dimensions.y}px;`\n : '';\n\n return (\n \n {shouldRenderThumb && (\n \n )}\n {shouldRenderFullMedia && (\n \n )}\n {shouldRenderSpinner && (\n
\n \n
\n )}\n {!fullMediaData && !isDownloadAllowed && (\n \n )}\n {isTransferring && (\n {Math.round(transferProgress * 100)}%\n )}\n \n );\n};\n\nexport default Photo;\n","import { RefObject } from 'react';\nimport { useCallback, useRef } from '../lib/teact/teact';\n\nimport useHeavyAnimationCheck from './useHeavyAnimationCheck';\nimport safePlay from '../util/safePlay';\n\nexport default function useHeavyAnimationCheckForVideo(playerRef: RefObject, shouldPlay: boolean) {\n const shouldPlayRef = useRef();\n shouldPlayRef.current = shouldPlay;\n\n const pause = useCallback(() => {\n if (playerRef.current) {\n playerRef.current.pause();\n }\n }, [playerRef]);\n\n const play = useCallback(() => {\n if (playerRef.current && shouldPlayRef.current) {\n safePlay(playerRef.current);\n }\n }, [playerRef]);\n\n useHeavyAnimationCheck(pause, play);\n}\n","import { useCallback, useRef } from '../../../../lib/teact/teact';\nimport { fastRaf } from '../../../../util/schedulers';\nimport useBackgroundMode from '../../../../hooks/useBackgroundMode';\nimport safePlay from '../../../../util/safePlay';\n\nexport default (playerRef: { current: HTMLVideoElement | null }, isPlayAllowed = false) => {\n const wasPlaying = useRef(false);\n const isFrozen = useRef(false);\n\n const freezePlaying = useCallback(() => {\n isFrozen.current = true;\n\n if (!isPlayAllowed || !playerRef.current) {\n return;\n }\n\n if (!wasPlaying.current) {\n wasPlaying.current = !playerRef.current.paused;\n }\n\n playerRef.current.pause();\n }, [isPlayAllowed, playerRef]);\n\n const unfreezePlaying = useCallback(() => {\n // At this point HTMLVideoElement can be unmounted from the DOM\n if (isPlayAllowed && playerRef.current && wasPlaying.current && document.body.contains(playerRef.current)) {\n safePlay(playerRef.current);\n }\n\n wasPlaying.current = false;\n isFrozen.current = false;\n }, [isPlayAllowed, playerRef]);\n\n const unfreezePlayingOnRaf = useCallback(() => {\n fastRaf(unfreezePlaying);\n }, [unfreezePlaying]);\n\n if (!document.hasFocus()) {\n freezePlaying();\n }\n\n useBackgroundMode(freezePlaying, unfreezePlayingOnRaf);\n};\n","import React, {\n FC, useCallback, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\nimport { IMediaDimensions } from './helpers/calculateAlbumLayout';\n\nimport { formatMediaDuration } from '../../../util/dateFormat';\nimport buildClassName from '../../../util/buildClassName';\nimport { calculateVideoDimensions } from '../../common/helpers/mediaDimensions';\nimport {\n getMediaTransferState,\n getMessageMediaFormat,\n getMessageMediaHash,\n getMessageVideo,\n getMessageWebPageVideo,\n isForwardedMessage,\n isOwnMessage,\n} from '../../../modules/helpers';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMediaWithDownloadProgress from '../../../hooks/useMediaWithDownloadProgress';\nimport useMedia from '../../../hooks/useMedia';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useBuffering from '../../../hooks/useBuffering';\nimport useHeavyAnimationCheckForVideo from '../../../hooks/useHeavyAnimationCheckForVideo';\nimport useVideoCleanup from '../../../hooks/useVideoCleanup';\nimport usePauseOnInactive from './hooks/usePauseOnInactive';\nimport useBlurredMediaThumbRef from './hooks/useBlurredMediaThumbRef';\n\nimport ProgressSpinner from '../../ui/ProgressSpinner';\n\nexport type OwnProps = {\n id?: string;\n message: ApiMessage;\n observeIntersection: ObserveFn;\n noAvatars?: boolean;\n shouldAutoLoad?: boolean;\n shouldAutoPlay?: boolean;\n uploadProgress?: number;\n dimensions?: IMediaDimensions;\n lastSyncTime?: number;\n onClick?: (id: number) => void;\n onCancelUpload?: (message: ApiMessage) => void;\n};\n\nconst Video: FC = ({\n id,\n message,\n observeIntersection,\n noAvatars,\n shouldAutoLoad,\n shouldAutoPlay,\n uploadProgress,\n lastSyncTime,\n dimensions,\n onClick,\n onCancelUpload,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const videoRef = useRef(null);\n\n const video = (getMessageVideo(message) || getMessageWebPageVideo(message))!;\n const localBlobUrl = video.blobUrl;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const [isDownloadAllowed, setIsDownloadAllowed] = useState(shouldAutoLoad);\n const shouldDownload = Boolean(isDownloadAllowed && isIntersecting && lastSyncTime);\n const [isPlayAllowed, setIsPlayAllowed] = useState(shouldAutoPlay);\n\n const previewBlobUrl = useMedia(\n getMessageMediaHash(message, 'pictogram'),\n !(isIntersecting && lastSyncTime),\n getMessageMediaFormat(message, 'pictogram'),\n lastSyncTime,\n );\n const { mediaData, downloadProgress } = useMediaWithDownloadProgress(\n getMessageMediaHash(message, 'inline'),\n !shouldDownload,\n getMessageMediaFormat(message, 'inline'),\n lastSyncTime,\n );\n const fullMediaData = localBlobUrl || mediaData;\n const isInline = Boolean(isIntersecting && fullMediaData);\n // Thumbnail is always rendered so we can only disable blur if we have preview\n const thumbRef = useBlurredMediaThumbRef(message, previewBlobUrl);\n\n const { isBuffered, bufferingHandlers } = useBuffering(!shouldAutoLoad);\n const { isUploading, isTransferring, transferProgress } = getMediaTransferState(\n message,\n uploadProgress || downloadProgress,\n shouldDownload && !isBuffered,\n );\n const wasDownloadDisabled = usePrevious(isDownloadAllowed) === false;\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring, undefined, wasDownloadDisabled);\n const { transitionClassNames } = useTransitionForMedia(fullMediaData, 'slow');\n\n const [playProgress, setPlayProgress] = useState(0);\n const handleTimeUpdate = useCallback((e: React.SyntheticEvent) => {\n setPlayProgress(Math.max(0, e.currentTarget.currentTime - 1));\n }, []);\n\n const duration = (videoRef.current?.duration) || video.duration || 0;\n\n const isOwn = isOwnMessage(message);\n const isForwarded = isForwardedMessage(message);\n const { width, height } = dimensions || calculateVideoDimensions(video, isOwn, isForwarded, noAvatars);\n\n useHeavyAnimationCheckForVideo(videoRef, Boolean(isInline && shouldAutoPlay));\n usePauseOnInactive(videoRef, isPlayAllowed);\n useVideoCleanup(videoRef, [isInline]);\n\n const handleClick = useCallback(() => {\n if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload(message);\n }\n } else if (!fullMediaData) {\n setIsDownloadAllowed((isAllowed) => !isAllowed);\n } else if (fullMediaData && !isPlayAllowed) {\n setIsPlayAllowed(true);\n videoRef.current!.play();\n } else if (onClick) {\n onClick(message.id);\n }\n }, [isUploading, fullMediaData, isPlayAllowed, onClick, onCancelUpload, message]);\n\n const className = buildClassName('media-inner dark', !isUploading && 'interactive');\n const videoClassName = buildClassName('full-media', transitionClassNames);\n\n const style = dimensions\n ? `width: ${width}px; height: ${height}px; left: ${dimensions.x}px; top: ${dimensions.y}px;`\n : '';\n\n return (\n \n {!previewBlobUrl && (\n \n )}\n {previewBlobUrl && (\n \n )}\n {isInline && (\n \n \n \n )}\n {(isDownloadAllowed && !isPlayAllowed && !shouldRenderSpinner) && (\n \n )}\n {shouldRenderSpinner && (\n
\n \n
\n )}\n {!isDownloadAllowed && (\n \n )}\n {isTransferring ? (\n ...\n ) : (\n
\n {video.isGif ? 'GIF' : formatMediaDuration(Math.max(duration - playProgress, 0))}\n
\n )}\n \n );\n};\n\nexport default Video;\n","import React, { FC, useCallback } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiUser, ApiContact, ApiCountryCode } from '../../../api/types';\n\nimport { selectUser } from '../../../modules/selectors';\nimport { formatPhoneNumberWithCode } from '../../../util/phoneNumber';\n\nimport Avatar from '../../common/Avatar';\n\nimport './Contact.scss';\nimport { pick } from '../../../util/iteratees';\nimport buildClassName from '../../../util/buildClassName';\n\ntype OwnProps = {\n contact: ApiContact;\n};\n\ntype StateProps = {\n user?: ApiUser;\n phoneCodeList: ApiCountryCode[];\n};\n\ntype DispatchProps = Pick;\n\nconst Contact: FC = ({\n contact, user, openUserInfo, phoneCodeList,\n}) => {\n const {\n firstName,\n lastName,\n phoneNumber,\n userId,\n } = contact;\n\n const handleClick = useCallback(() => {\n openUserInfo({ id: userId });\n }, [openUserInfo, userId]);\n\n return (\n \n \n
\n
{firstName} {lastName}
\n
{formatPhoneNumberWithCode(phoneCodeList, phoneNumber)}
\n
\n \n );\n};\n\nexport default withGlobal(\n (global, { contact }): StateProps => {\n const { countryList: { phoneCodes: phoneCodeList } } = global;\n return {\n user: selectUser(global, contact.userId),\n phoneCodeList,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openUserInfo',\n ]),\n)(Contact);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useCallback, memo, useState,\n} from '../../lib/teact/teact';\n\nimport Checkbox from './Checkbox';\n\ntype IRadioOption = {\n label: string;\n subLabel?: string;\n value: string;\n};\n\ntype OwnProps = {\n id?: string;\n options: IRadioOption[];\n selected?: string[];\n disabled?: boolean;\n round?: boolean;\n loadingOptions?: string[];\n onChange: (value: string[]) => void;\n};\n\nconst CheckboxGroup: FC = ({\n id,\n options,\n selected = [],\n disabled,\n round,\n loadingOptions,\n onChange,\n}) => {\n const [values, setValues] = useState([]);\n\n const handleChange = useCallback((event: ChangeEvent) => {\n const { value, checked } = event.currentTarget;\n let newValues: string[];\n if (checked) {\n newValues = [...values, value];\n } else {\n newValues = values.filter((v) => v !== value);\n }\n\n setValues(newValues);\n onChange(newValues);\n }, [onChange, values]);\n\n return (\n
\n {options.map((option) => (\n \n ))}\n
\n );\n};\n\nexport default memo(CheckboxGroup);\n","import React, {\n FC, useState, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiPollAnswer, ApiPollResult } from '../../../api/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport renderText from '../../common/helpers/renderText';\n\nimport './PollOption.scss';\n\ntype OwnProps = {\n answer: ApiPollAnswer;\n voteResults?: ApiPollResult[];\n totalVoters?: number;\n maxVotersCount?: number;\n correctResults: string[];\n shouldAnimate: boolean;\n};\n\nconst PollOption: FC = ({\n answer,\n voteResults,\n totalVoters,\n maxVotersCount,\n correctResults,\n shouldAnimate,\n}) => {\n const result = voteResults && voteResults.find((r) => r.option === answer.option);\n const correctAnswer = correctResults.length === 0 || correctResults.indexOf(answer.option) !== -1;\n const showIcon = (correctResults.length > 0 && correctAnswer) || (result?.isChosen);\n const answerPercent = result ? getPercentage(result.votersCount, totalVoters || 0) : 0;\n const [finalPercent, setFinalPercent] = useState(shouldAnimate ? 0 : answerPercent);\n // eslint-disable-next-line no-null/no-null\n const lineRef = useRef(null);\n const lineWidth = result ? getPercentage(result.votersCount, maxVotersCount || 0) : 0;\n const isAnimationDoesNotStart = finalPercent < answerPercent;\n\n useEffect(() => {\n if (shouldAnimate) {\n setFinalPercent(answerPercent);\n }\n }, [shouldAnimate, answerPercent]);\n\n useEffect(() => {\n const lineEl = lineRef.current;\n\n if (lineEl && shouldAnimate) {\n const svgEl = lineEl.firstElementChild;\n\n const style = isAnimationDoesNotStart ? '' : 'stroke-dasharray: 100% 200%; stroke-dashoffset: -44';\n if (!svgEl) {\n lineEl.innerHTML = `\n \n \n `;\n } else {\n svgEl.setAttribute('style', style);\n }\n }\n }, [isAnimationDoesNotStart, shouldAnimate]);\n\n if (!voteResults || !result) {\n return undefined;\n }\n\n const lineStyle = `width: ${lineWidth}%; transform:scaleX(${isAnimationDoesNotStart ? 0 : 1})`;\n\n return (\n
\n
\n {answerPercent}%\n {showIcon && (\n \n \n \n )}\n
\n
\n
\n {renderText(answer.text)}\n
\n
\n
\n \n
\n
\n
\n );\n};\n\nfunction getPercentage(value: number, total: number) {\n return total > 0 ? ((value / total) * 100).toFixed() : 0;\n}\n\nexport default PollOption;\n","import React, {\n FC,\n useCallback,\n useEffect,\n useState,\n memo,\n useMemo,\n useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport {\n ApiMessage, ApiPoll, ApiUser, ApiPollAnswer,\n} from '../../../api/types';\n\nimport { pick } from '../../../util/iteratees';\nimport renderText from '../../common/helpers/renderText';\nimport { renderTextWithEntities } from '../../common/helpers/renderMessageText';\nimport { formatMediaDuration } from '../../../util/dateFormat';\nimport useLang, { LangFn } from '../../../hooks/useLang';\n\nimport CheckboxGroup from '../../ui/CheckboxGroup';\nimport RadioGroup from '../../ui/RadioGroup';\nimport Avatar from '../../common/Avatar';\nimport Button from '../../ui/Button';\nimport Notification from '../../ui/Notification';\nimport PollOption from './PollOption';\n\nimport './Poll.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n poll: ApiPoll;\n onSendVote: (options: string[]) => void;\n};\n\ntype StateProps = {\n recentVoterIds?: number[];\n usersById: Record;\n serverTimeOffset: number;\n};\n\ntype DispatchProps = Pick;\n\nconst SOLUTION_CONTAINER_ID = '#middle-column-portals';\nconst SOLUTION_DURATION = 5000;\nconst NBSP = '\\u00A0';\n\nconst Poll: FC = ({\n message,\n poll,\n recentVoterIds,\n usersById,\n loadMessage,\n onSendVote,\n openPollResults,\n serverTimeOffset,\n}) => {\n const { id: messageId, chatId } = message;\n const { summary, results } = poll;\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [chosenOptions, setChosenOptions] = useState([]);\n const [isSolutionShown, setIsSolutionShown] = useState(false);\n const [wasSubmitted, setWasSubmitted] = useState(false);\n const [closePeriod, setClosePeriod] = useState(\n !summary.closed && summary.closeDate && summary.closeDate > 0\n ? Math.min(summary.closeDate - Math.floor(Date.now() / 1000) + serverTimeOffset, summary.closePeriod!)\n : 0,\n );\n // eslint-disable-next-line no-null/no-null\n const countdownRef = useRef(null);\n const { results: voteResults, totalVoters } = results;\n const hasVoted = voteResults && voteResults.some((r) => r.isChosen);\n const canVote = !summary.closed && !hasVoted;\n const canViewResult = !canVote && summary.isPublic && Number(results.totalVoters) > 0;\n const isMultiple = canVote && summary.multipleChoice;\n const maxVotersCount = voteResults ? Math.max(...voteResults.map((r) => r.votersCount)) : totalVoters;\n const correctResults = voteResults ? voteResults.reduce((answers: string[], r) => {\n if (r.isCorrect) {\n answers.push(r.option);\n }\n\n return answers;\n }, []) : [];\n const answers = summary.answers.map((a) => ({\n label: a.text,\n value: a.option,\n hidden: Boolean(summary.quiz && summary.closePeriod && closePeriod <= 0),\n }));\n\n useEffect(() => {\n if (\n isSubmitting\n && poll.results.results\n && poll.results.results.some((result) => result.isChosen)\n ) {\n setIsSubmitting(false);\n }\n }, [isSubmitting, poll.results.results]);\n\n useEffect(() => {\n if (closePeriod > 0) {\n setTimeout(() => setClosePeriod(closePeriod - 1), 1000);\n }\n\n const countdownEl = countdownRef.current;\n\n if (countdownEl) {\n const circumference = 6 * 2 * Math.PI;\n const svgEl = countdownEl.lastElementChild;\n const timerEl = countdownEl.firstElementChild;\n if (closePeriod <= 5) {\n countdownEl.classList.add('hurry-up');\n }\n\n if (!svgEl || !timerEl) {\n countdownEl.innerHTML = `\n ${formatMediaDuration(closePeriod)}\n \n \n `;\n } else {\n const strokeDashOffset = ((summary.closePeriod! - closePeriod) / summary.closePeriod!) * circumference;\n timerEl.textContent = formatMediaDuration(closePeriod);\n (svgEl.firstElementChild as SVGElement).setAttribute('stroke-dashoffset', `-${strokeDashOffset}`);\n }\n }\n }, [closePeriod, summary.closePeriod]);\n\n useEffect(() => {\n if (summary.quiz && (closePeriod <= 0 || (hasVoted && !summary.closed))) {\n loadMessage({ chatId, messageId });\n }\n }, [chatId, closePeriod, hasVoted, loadMessage, messageId, summary.closed, summary.quiz]);\n\n // If the client time is not synchronized, the poll must be updated after the closePeriod time has expired.\n useEffect(() => {\n let timer: number | undefined;\n\n if (summary.quiz && !summary.closed && summary.closePeriod && summary.closePeriod > 0) {\n timer = window.setTimeout(() => {\n loadMessage({ chatId, messageId });\n }, summary.closePeriod * 1000);\n }\n\n return () => {\n if (timer) {\n window.clearTimeout(timer);\n }\n };\n }, [canVote, chatId, loadMessage, messageId, summary.closePeriod, summary.closed, summary.quiz]);\n\n const recentVoters = useMemo(() => {\n return recentVoterIds ? recentVoterIds.reduce((result: ApiUser[], id) => {\n const user = usersById[id];\n if (user) {\n result.push(user);\n }\n\n return result;\n }, []) : [];\n }, [usersById, recentVoterIds]);\n\n const handleRadioChange = useCallback(\n (option: string) => {\n setChosenOptions([option]);\n setIsSubmitting(true);\n setWasSubmitted(true);\n onSendVote([option]);\n }, [onSendVote],\n );\n\n const handleCheckboxChange = useCallback(\n (options: string[]) => {\n setChosenOptions(options);\n }, [],\n );\n\n const handleVoteClick = useCallback(\n () => {\n setIsSubmitting(true);\n setWasSubmitted(true);\n onSendVote(chosenOptions);\n }, [onSendVote, chosenOptions],\n );\n\n const handleViewResultsClick = useCallback(\n () => {\n openPollResults({ chatId, messageId });\n }, [chatId, messageId, openPollResults],\n );\n\n const handleSolutionShow = useCallback(() => {\n setIsSolutionShown(true);\n }, []);\n\n const handleSolutionHide = useCallback(() => {\n setIsSolutionShown(false);\n setWasSubmitted(false);\n }, []);\n\n // Show the solution to quiz if the answer was incorrect\n useEffect(() => {\n if (wasSubmitted && hasVoted && summary.quiz && results.results && poll.results.solution) {\n const correctResult = results.results.find((r) => r.isChosen && r.isCorrect);\n if (!correctResult) {\n setIsSolutionShown(true);\n }\n }\n }, [hasVoted, wasSubmitted, results.results, summary.quiz, poll.results.solution]);\n\n const lang = useLang();\n\n function renderResultOption(answer: ApiPollAnswer) {\n return (\n \n );\n }\n\n function renderRecentVoters() {\n return (\n recentVoters.length > 0 && (\n
\n {recentVoters.map((user) => (\n \n ))}\n
\n )\n );\n }\n\n function renderSolution() {\n return (\n isSolutionShown && poll.results.solution && (\n \n )\n );\n }\n\n return (\n
\n {renderSolution()}\n
{renderText(summary.question)}
\n
\n {lang(getPollTypeString(summary))}\n {renderRecentVoters()}\n {closePeriod > 0 && canVote &&
}\n {summary.quiz && poll.results.solution && !canVote && (\n \n \n \n )}\n
\n {canVote && (\n
\n {isMultiple\n ? (\n \n )\n : (\n \n )}\n
\n )}\n {!canVote && (\n
\n {summary.answers.map(renderResultOption)}\n
\n )}\n {!canViewResult && !isMultiple && (\n
{getReadableVotersCount(lang, summary.quiz, results.totalVoters)}
\n )}\n {isMultiple && (\n \n {lang('PollSubmitVotes')}\n \n )}\n {canViewResult && (\n \n {lang('PollViewResults')}\n \n )}\n
\n );\n};\n\nfunction getPollTypeString(summary: ApiPoll['summary']) {\n // When we just created the poll, some properties don't exist.\n if (typeof summary.isPublic === 'undefined') {\n return NBSP;\n }\n\n if (summary.quiz) {\n return summary.isPublic ? 'QuizPoll' : 'AnonymousQuizPoll';\n }\n\n if (summary.closed) {\n return 'FinalResults';\n }\n\n return summary.isPublic ? 'PublicPoll' : 'AnonymousPoll';\n}\n\nfunction getReadableVotersCount(lang: LangFn, isQuiz: true | undefined, count?: number) {\n if (!count) {\n return lang(isQuiz ? 'Chat.Quiz.TotalVotesEmpty' : 'Chat.Poll.TotalVotesResultEmpty');\n }\n\n return lang(isQuiz ? 'Answer' : 'Vote', count, 'i');\n}\n\nexport default memo(withGlobal(\n (global, { poll }) => {\n const { recentVoterIds } = poll.results;\n const { serverTimeOffset, users: { byId: usersById } } = global;\n if (!recentVoterIds || recentVoterIds.length === 0) {\n return {};\n }\n\n return {\n recentVoterIds,\n usersById,\n serverTimeOffset,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadMessage', 'openPollResults']),\n)(Poll));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\nimport { ObserveFn } from '../../../hooks/useIntersectionObserver';\n\nimport { getMessageWebPage } from '../../../modules/helpers';\nimport { calculateMediaDimensions } from './helpers/mediaDimensions';\nimport renderText from '../../common/helpers/renderText';\nimport trimText from '../../../util/trimText';\nimport buildClassName from '../../../util/buildClassName';\n\nimport SafeLink from '../../common/SafeLink';\nimport Photo from './Photo';\nimport Video from './Video';\n\nimport './WebPage.scss';\n\nconst MAX_TEXT_LENGTH = 170; // symbols\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection?: ObserveFn;\n noAvatars?: boolean;\n shouldAutoLoad?: boolean;\n shouldAutoPlay?: boolean;\n inPreview?: boolean;\n lastSyncTime?: number;\n onMediaClick?: () => void;\n onCancelMediaTransfer?: () => void;\n};\n\nconst WebPage: FC = ({\n message,\n observeIntersection,\n noAvatars,\n shouldAutoLoad,\n shouldAutoPlay,\n inPreview,\n lastSyncTime,\n onMediaClick,\n onCancelMediaTransfer,\n}) => {\n const webPage = getMessageWebPage(message);\n\n let isSquarePhoto = false;\n if (webPage?.photo && !webPage.video) {\n const { width, height } = calculateMediaDimensions(message);\n isSquarePhoto = width === height;\n }\n\n const handleMediaClick = useCallback(() => {\n onMediaClick!();\n }, [onMediaClick]);\n\n if (!webPage) {\n return undefined;\n }\n\n const {\n siteName,\n url,\n displayUrl,\n title,\n description,\n photo,\n video,\n } = webPage;\n const isMediaInteractive = (photo || video) && onMediaClick && !isSquarePhoto;\n const truncatedDescription = trimText(description, MAX_TEXT_LENGTH);\n\n const className = buildClassName(\n 'WebPage',\n isSquarePhoto && 'with-square-photo',\n !photo && !video && !inPreview && 'without-media',\n video && 'with-video',\n );\n\n return (\n \n {photo && !video && (\n \n )}\n
\n \n {!inPreview && title && (\n

{renderText(title)}

\n )}\n {truncatedDescription && (\n

{renderText(truncatedDescription, ['emoji', 'br'])}

\n )}\n
\n {!inPreview && video && (\n \n )}\n
\n );\n};\n\nexport default memo(WebPage);\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\n\nimport { getMessageInvoice } from '../../../modules/helpers';\nimport { formatCurrency } from '../../../util/formatCurrency';\nimport renderText from '../../common/helpers/renderText';\nimport useLang from '../../../hooks/useLang';\n\nimport './Invoice.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n};\n\nconst Invoice: FC = ({\n message,\n}) => {\n const lang = useLang();\n const invoice = getMessageInvoice(message);\n\n const {\n title,\n text,\n amount,\n currency,\n isTest,\n photoUrl,\n } = invoice!;\n\n return (\n \n {title && (\n

{renderText(title)}

\n )}\n {text && (\n

{renderText(text, ['emoji', 'br'])}

\n )}\n
\n {photoUrl && (\n \n )}\n

\n {formatCurrency(amount, currency, lang.code)}\n {isTest && {lang('PaymentTestInvoice')}}\n

\n
\n
\n );\n};\n\nexport default memo(Invoice);\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC,\n useCallback,\n useMemo,\n memo,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { OwnProps as PhotoProps } from '../Photo';\nimport { OwnProps as VideoProps } from '../Video';\n\nimport buildClassName from '../../../../util/buildClassName';\nimport { GlobalActions } from '../../../../global/types';\nimport {\n selectIsInSelectMode,\n selectIsMessageSelected,\n} from '../../../../modules/selectors';\n\nimport { pick } from '../../../../util/iteratees';\n\ntype OwnProps = PhotoProps & VideoProps;\n\ntype StateProps = {\n isInSelectMode?: boolean;\n isSelected?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nexport default function withSelectControl(WrappedComponent: FC) {\n const ComponentWithSelectControl: FC = (props) => {\n const {\n isInSelectMode,\n isSelected,\n message,\n toggleMessageSelection,\n dimensions,\n } = props;\n\n const handleMessageSelect = useCallback((e: ReactMouseEvent) => {\n e.stopPropagation();\n toggleMessageSelection({ messageId: message.id, withShift: e?.shiftKey });\n }, [toggleMessageSelection, message]);\n\n const newProps = useMemo(() => {\n return {\n ...props,\n isInSelectMode,\n isSelected,\n dimensions: {\n ...props.dimensions,\n x: 0,\n y: 0,\n },\n onClick: isInSelectMode ? undefined : props.onClick,\n };\n }, [props, isInSelectMode, isSelected]);\n\n return (\n \n {isInSelectMode && (\n
\n {isSelected && (\n \n )}\n
\n )}\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n \n \n );\n };\n\n return memo(withGlobal(\n (global, ownProps) => {\n const { message } = ownProps;\n return {\n isInSelectMode: selectIsInSelectMode(global),\n isSelected: selectIsMessageSelected(global, message.id),\n };\n },\n (setGlobal, actions) => pick(actions, [\n 'toggleMessageSelection',\n ]),\n )(ComponentWithSelectControl));\n}\n","import React, { FC, useCallback } from '../../../lib/teact/teact';\n\nimport { GlobalActions, GlobalState } from '../../../global/types';\nimport { ApiMessage } from '../../../api/types';\nimport { IAlbum } from '../../../types';\nimport { AlbumRectPart, IAlbumLayout } from './helpers/calculateAlbumLayout';\n\nimport { getMessageContent } from '../../../modules/helpers';\nimport { withGlobal } from '../../../lib/teact/teactn';\nimport { pick } from '../../../util/iteratees';\nimport withSelectControl from './hocs/withSelectControl';\nimport { ObserveFn } from '../../../hooks/useIntersectionObserver';\n\nimport Photo from './Photo';\nimport Video from './Video';\n\nimport './Album.scss';\n\nconst PhotoWithSelect = withSelectControl(Photo);\nconst VideoWithSelect = withSelectControl(Video);\n\ntype OwnProps = {\n album: IAlbum;\n observeIntersection: ObserveFn;\n shouldAutoLoad?: boolean;\n shouldAutoPlay?: boolean;\n hasCustomAppendix?: boolean;\n lastSyncTime?: number;\n isOwn: boolean;\n albumLayout: IAlbumLayout;\n onMediaClick: (messageId: number) => void;\n};\n\ntype StateProps = {\n uploadsById: GlobalState['fileUploads']['byMessageLocalId'];\n};\n\ntype DispatchProps = Pick;\n\nconst Album: FC = ({\n album,\n observeIntersection,\n shouldAutoLoad,\n shouldAutoPlay,\n hasCustomAppendix,\n lastSyncTime,\n isOwn,\n albumLayout,\n onMediaClick,\n uploadsById,\n cancelSendingMessage,\n}) => {\n const mediaCount = album.messages.length;\n\n const handleCancelUpload = useCallback((message: ApiMessage) => {\n cancelSendingMessage({ chatId: message.chatId, messageId: message.id });\n }, [cancelSendingMessage]);\n\n function renderAlbumMessage(message: ApiMessage, index: number) {\n const { photo, video } = getMessageContent(message);\n const fileUpload = uploadsById[message.previousLocalId || message.id];\n const uploadProgress = fileUpload?.progress;\n const { dimensions, sides } = albumLayout.layout[index];\n\n if (photo) {\n const shouldAffectAppendix = hasCustomAppendix && (\n // eslint-disable-next-line no-bitwise\n (isOwn ? index === mediaCount - 1 : Boolean(sides & AlbumRectPart.Left && sides & AlbumRectPart.Bottom))\n );\n\n return (\n \n );\n } else if (video) {\n return (\n \n );\n }\n\n return undefined;\n }\n\n const { width: containerWidth, height: containerHeight } = albumLayout.containerStyle;\n\n return (\n \n {album.messages.map(renderAlbumMessage)}\n \n );\n};\n\nexport default withGlobal(\n (global): StateProps => {\n return {\n uploadsById: global.fileUploads.byMessageLocalId,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'cancelSendingMessage',\n ]),\n)(Album);\n","import React, {\n FC,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\n\nimport { ROUND_VIDEO_DIMENSIONS } from '../../common/helpers/mediaDimensions';\nimport { formatMediaDuration } from '../../../util/dateFormat';\nimport { getMessageMediaFormat, getMessageMediaHash } from '../../../modules/helpers';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMediaWithDownloadProgress from '../../../hooks/useMediaWithDownloadProgress';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useBuffering from '../../../hooks/useBuffering';\nimport buildClassName from '../../../util/buildClassName';\nimport useHeavyAnimationCheckForVideo from '../../../hooks/useHeavyAnimationCheckForVideo';\nimport useVideoCleanup from '../../../hooks/useVideoCleanup';\nimport usePauseOnInactive from './hooks/usePauseOnInactive';\nimport useBlurredMediaThumbRef from './hooks/useBlurredMediaThumbRef';\nimport safePlay from '../../../util/safePlay';\nimport { fastRaf } from '../../../util/schedulers';\n\nimport ProgressSpinner from '../../ui/ProgressSpinner';\n\nimport './RoundVideo.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection: ObserveFn;\n shouldAutoLoad?: boolean;\n shouldAutoPlay?: boolean;\n lastSyncTime?: number;\n};\n\nlet currentOnRelease: NoneToVoidFunction;\n\nfunction createCapture(onRelease: NoneToVoidFunction) {\n return () => {\n if (currentOnRelease) {\n currentOnRelease();\n }\n\n currentOnRelease = onRelease;\n };\n}\n\nconst RoundVideo: FC = ({\n message,\n observeIntersection,\n shouldAutoLoad,\n shouldAutoPlay,\n lastSyncTime,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const playingProgressRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const playerRef = useRef(null);\n\n const video = message.content.video!;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const [isDownloadAllowed, setIsDownloadAllowed] = useState(shouldAutoLoad && shouldAutoPlay);\n const shouldDownload = Boolean(isDownloadAllowed && isIntersecting && lastSyncTime);\n const { mediaData, downloadProgress } = useMediaWithDownloadProgress(\n getMessageMediaHash(message, 'inline'),\n !shouldDownload,\n getMessageMediaFormat(message, 'inline'),\n lastSyncTime,\n );\n const thumbRef = useBlurredMediaThumbRef(message, mediaData);\n\n const { isBuffered, bufferingHandlers } = useBuffering();\n const isTransferring = isDownloadAllowed && !isBuffered;\n const wasDownloadDisabled = usePrevious(isDownloadAllowed) === false;\n const {\n shouldRender: shouldSpinnerRender,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring || !isBuffered, undefined, wasDownloadDisabled);\n const { shouldRenderThumb, transitionClassNames } = useTransitionForMedia(mediaData, 'slow');\n\n const [isActivated, setIsActivated] = useState(false);\n const [progress, setProgress] = useState(0);\n\n useEffect(() => {\n if (!isActivated) {\n return;\n }\n\n const circumference = 94 * 2 * Math.PI;\n const strokeDashOffset = circumference - progress * circumference;\n\n const playerEl = playerRef.current!;\n const playingProgressEl = playingProgressRef.current!;\n const svgEl = playingProgressEl.firstElementChild;\n\n if (!svgEl) {\n playingProgressEl.innerHTML = `\n \n `;\n } else {\n (svgEl.firstElementChild as SVGElement).setAttribute('stroke-dashoffset', strokeDashOffset.toString());\n }\n\n setProgress(playerEl.currentTime / playerEl.duration);\n }, [isActivated, progress]);\n\n const shouldPlay = Boolean(mediaData && isIntersecting);\n\n const stopPlaying = () => {\n setIsActivated(false);\n setProgress(0);\n safePlay(playerRef.current!);\n\n fastRaf(() => {\n playingProgressRef.current!.innerHTML = '';\n });\n };\n\n const capturePlaying = createCapture(stopPlaying);\n\n useEffect(() => {\n if (!playerRef.current) {\n return;\n }\n\n if (shouldPlay) {\n safePlay(playerRef.current);\n } else {\n playerRef.current.pause();\n }\n }, [shouldPlay]);\n\n useHeavyAnimationCheckForVideo(playerRef, shouldPlay);\n usePauseOnInactive(playerRef, Boolean(mediaData));\n useVideoCleanup(playerRef, [mediaData]);\n\n const handleClick = useCallback(() => {\n if (!mediaData) {\n setIsDownloadAllowed((isAllowed) => !isAllowed);\n\n return;\n }\n\n const playerEl = playerRef.current!;\n if (isActivated) {\n if (playerEl.paused) {\n safePlay(playerEl);\n } else {\n playerEl.pause();\n }\n } else {\n capturePlaying();\n // Pause is a workaround for iOS Safari – otherwise it stops video after several frames\n playerEl.pause();\n playerEl.currentTime = 0;\n safePlay(playerEl);\n\n setIsActivated(true);\n }\n }, [capturePlaying, isActivated, mediaData]);\n\n const handleTimeUpdate = useCallback((e: React.UIEvent) => {\n const playerEl = e.currentTarget;\n\n setProgress(playerEl.currentTime / playerEl.duration);\n }, []);\n\n const videoClassName = buildClassName('full-media', transitionClassNames);\n\n return (\n \n {(shouldRenderThumb || mediaData) && (\n
\n \n
\n )}\n {mediaData && (\n
\n {/* eslint-disable-next-line jsx-a11y/media-has-caption */}\n \n \n \n
\n )}\n
\n {shouldSpinnerRender && (\n
\n \n
\n )}\n {!mediaData && !isDownloadAllowed && (\n \n )}\n
\n {isActivated ? formatMediaDuration(playerRef.current!.currentTime) : formatMediaDuration(video.duration)}\n {(!isActivated || playerRef.current!.paused) && }\n
\n
\n );\n};\n\nexport default RoundVideo;\n","import React, { FC } from '../../../lib/teact/teact';\n\nimport { ApiKeyboardButton, ApiMessage } from '../../../api/types';\n\nimport { RE_TME_LINK } from '../../../config';\nimport renderText from '../../common/helpers/renderText';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\n\nimport './InlineButtons.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n onClick: ({ button }: { button: ApiKeyboardButton }) => void;\n};\n\nconst InlineButtons: FC = ({ message, onClick }) => {\n const lang = useLang();\n\n return (\n
\n {message.inlineButtons!.map((row) => (\n
\n {row.map((button) => (\n onClick({ button })}\n >\n {renderText(lang(button.text))}\n {button.type === 'buy' && }\n {button.type === 'url' && !button.value!.match(RE_TME_LINK) && }\n \n ))}\n
\n ))}\n
\n );\n};\n\nexport default InlineButtons;\n","import React, {\n FC, memo, useCallback,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiMessage, ApiThreadInfo, ApiUser,\n} from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { pick } from '../../../util/iteratees';\nimport { isChatPrivate } from '../../../modules/helpers';\nimport { formatIntegerCompact } from '../../../util/textFormat';\nimport buildClassName from '../../../util/buildClassName';\nimport { selectThreadInfo } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\n\nimport Avatar from '../../common/Avatar';\n\nimport './CommentButton.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n disabled?: boolean;\n};\n\ntype StateProps = {\n threadInfo: ApiThreadInfo;\n usersById?: Record;\n chatsById?: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst CommentButton: FC = ({\n disabled,\n threadInfo,\n usersById,\n chatsById,\n openChat,\n}) => {\n const lang = useLang();\n const {\n threadId, chatId, messagesCount, lastMessageId, lastReadInboxMessageId, recentReplierIds,\n } = threadInfo;\n\n const handleClick = useCallback(() => {\n openChat({ id: chatId, threadId });\n }, [openChat, chatId, threadId]);\n\n if (messagesCount === undefined) {\n return undefined;\n }\n\n const recentRepliers = recentReplierIds && recentReplierIds.map((peerId) => {\n return isChatPrivate(peerId) ? usersById![peerId] : chatsById![peerId];\n }).filter(Boolean);\n\n function renderRecentRepliers() {\n return (\n recentRepliers && recentRepliers.length > 0 && (\n
\n {recentRepliers.map((user) => (\n \n ))}\n
\n )\n );\n }\n\n const hasUnread = Boolean(lastReadInboxMessageId && lastMessageId && lastReadInboxMessageId < lastMessageId);\n\n return (\n \n \n {(!recentRepliers || recentRepliers.length === 0) && }\n {renderRecentRepliers()}\n
\n {messagesCount ? lang('Comments', messagesCount, 'i') : lang('LeaveAComment')}\n
\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { message }) => {\n const { threadId, chatId } = message.threadInfo!;\n\n const threadInfo = selectThreadInfo(global, chatId, threadId) || message.threadInfo!;\n const { byId: usersById } = global.users;\n const { byId: chatsById } = global.chats;\n\n return {\n threadInfo,\n usersById,\n chatsById,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat',\n ]),\n)(CommentButton));\n","import React, {\n FC,\n memo,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions, MessageListType } from '../../../global/types';\nimport {\n ApiMessage,\n ApiMessageOutgoingStatus,\n ApiUser,\n ApiChat,\n ApiSticker,\n} from '../../../api/types';\nimport { FocusDirection, IAlbum, ISettings } from '../../../types';\n\nimport { IS_ANDROID, IS_TOUCH_ENV } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\nimport {\n selectChat,\n selectChatMessage,\n selectUploadProgress,\n selectIsChatWithSelf,\n selectOutgoingStatus,\n selectUser,\n selectIsMessageFocused,\n selectCurrentTextSearch,\n selectAnimatedEmoji,\n selectIsInSelectMode,\n selectIsMessageSelected,\n selectIsDocumentGroupSelected,\n selectSender,\n selectForwardedSender,\n selectThreadTopMessageId,\n selectShouldAutoLoadMedia,\n selectShouldAutoPlayMedia,\n selectShouldLoopStickers,\n selectTheme,\n selectAllowedMessageActions,\n} from '../../../modules/selectors';\nimport {\n getMessageContent,\n isOwnMessage,\n isReplyMessage,\n isAnonymousOwnMessage,\n isMessageLocal,\n isChatPrivate,\n getMessageCustomShape,\n isChatChannel,\n getMessageSingleEmoji,\n getSenderTitle,\n getUserColorKey,\n} from '../../../modules/helpers';\nimport buildClassName from '../../../util/buildClassName';\nimport useEnsureMessage from '../../../hooks/useEnsureMessage';\nimport useContextMenuHandlers from '../../../hooks/useContextMenuHandlers';\nimport { renderMessageText } from '../../common/helpers/renderMessageText';\nimport { ROUND_VIDEO_DIMENSIONS } from '../../common/helpers/mediaDimensions';\nimport { buildContentClassName, isEmojiOnlyMessage } from './helpers/buildContentClassName';\nimport { getMinMediaWidth, calculateMediaDimensions } from './helpers/mediaDimensions';\nimport { calculateAlbumLayout } from './helpers/calculateAlbumLayout';\nimport renderText from '../../common/helpers/renderText';\nimport calculateAuthorWidth from './helpers/calculateAuthorWidth';\nimport { ObserveFn, useOnIntersect } from '../../../hooks/useIntersectionObserver';\nimport useLang from '../../../hooks/useLang';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useFlag from '../../../hooks/useFlag';\nimport useFocusMessage from './hooks/useFocusMessage';\nimport useOuterHandlers from './hooks/useOuterHandlers';\nimport useInnerHandlers from './hooks/useInnerHandlers';\n\nimport Button from '../../ui/Button';\nimport Avatar from '../../common/Avatar';\nimport EmbeddedMessage from '../../common/EmbeddedMessage';\nimport Document from '../../common/Document';\nimport Audio from '../../common/Audio';\nimport MessageMeta from './MessageMeta';\nimport ContextMenuContainer from './ContextMenuContainer.async';\nimport Sticker from './Sticker';\nimport AnimatedEmoji from '../../common/AnimatedEmoji';\nimport Photo from './Photo';\nimport Video from './Video';\nimport Contact from './Contact';\nimport Poll from './Poll';\nimport WebPage from './WebPage';\nimport Invoice from './Invoice';\nimport Album from './Album';\nimport RoundVideo from './RoundVideo';\nimport InlineButtons from './InlineButtons';\nimport CommentButton from './CommentButton';\n\nimport './Message.scss';\n\ntype MessagePositionProperties = {\n isFirstInGroup: boolean;\n isLastInGroup: boolean;\n isFirstInDocumentGroup: boolean;\n isLastInDocumentGroup: boolean;\n isLastInList: boolean;\n};\n\ntype OwnProps =\n {\n message: ApiMessage;\n observeIntersectionForBottom: ObserveFn;\n observeIntersectionForMedia: ObserveFn;\n observeIntersectionForAnimatedStickers: ObserveFn;\n album?: IAlbum;\n noAvatars?: boolean;\n withAvatar?: boolean;\n withSenderName?: boolean;\n threadId: number;\n messageListType: MessageListType;\n noComments: boolean;\n appearanceOrder: number;\n }\n & MessagePositionProperties;\n\ntype StateProps = {\n theme: ISettings['theme'];\n forceSenderName?: boolean;\n chatUsername?: string;\n sender?: ApiUser | ApiChat;\n originSender?: ApiUser | ApiChat;\n botSender?: ApiUser;\n isThreadTop?: boolean;\n shouldHideReply?: boolean;\n replyMessage?: ApiMessage;\n replyMessageSender?: ApiUser | ApiChat;\n outgoingStatus?: ApiMessageOutgoingStatus;\n uploadProgress?: number;\n isFocused?: boolean;\n focusDirection?: FocusDirection;\n noFocusHighlight?: boolean;\n isResizingContainer?: boolean;\n isForwarding?: boolean;\n isChatWithSelf?: boolean;\n isChannel?: boolean;\n canReply?: boolean;\n lastSyncTime?: number;\n highlight?: string;\n isSingleEmoji?: boolean;\n animatedEmoji?: ApiSticker;\n isInSelectMode?: boolean;\n isSelected?: boolean;\n isGroupSelected?: boolean;\n threadId?: number;\n isPinnedList?: boolean;\n shouldAutoLoadMedia?: boolean;\n shouldAutoPlayMedia?: boolean;\n shouldLoopStickers?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst NBSP = '\\u00A0';\nconst GROUP_MESSAGE_HOVER_ATTRIBUTE = 'data-is-document-group-hover';\n// eslint-disable-next-line max-len\nconst APPENDIX_OWN = '';\n// eslint-disable-next-line max-len\nconst APPENDIX_NOT_OWN = '';\nconst APPEARANCE_DELAY = 10;\nconst NO_MEDIA_CORNERS_THRESHOLD = 18;\n\nconst Message: FC = ({\n message,\n chatUsername,\n observeIntersectionForBottom,\n observeIntersectionForMedia,\n observeIntersectionForAnimatedStickers,\n album,\n noAvatars,\n withAvatar,\n withSenderName,\n noComments,\n appearanceOrder,\n isFirstInGroup,\n isLastInGroup,\n isFirstInDocumentGroup,\n isLastInDocumentGroup,\n isLastInList,\n theme,\n forceSenderName,\n sender,\n originSender,\n botSender,\n isThreadTop,\n shouldHideReply,\n replyMessage,\n replyMessageSender,\n outgoingStatus,\n uploadProgress,\n isFocused,\n focusDirection,\n noFocusHighlight,\n isResizingContainer,\n isForwarding,\n isChatWithSelf,\n isChannel,\n canReply,\n lastSyncTime,\n highlight,\n animatedEmoji,\n isInSelectMode,\n isSelected,\n isGroupSelected,\n threadId,\n messageListType,\n isPinnedList,\n shouldAutoLoadMedia,\n shouldAutoPlayMedia,\n shouldLoopStickers,\n toggleMessageSelection,\n clickInlineButton,\n disableContextMenuHint,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const bottomMarkerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const appendixRef = useRef(null);\n const lang = useLang();\n\n useOnIntersect(bottomMarkerRef, observeIntersectionForBottom);\n\n const {\n isContextMenuOpen, contextMenuPosition,\n handleBeforeContextMenu, handleContextMenu: onContextMenu,\n handleContextMenuClose, handleContextMenuHide,\n } = useContextMenuHandlers(ref, IS_TOUCH_ENV && isInSelectMode, true, IS_ANDROID);\n\n useEffect(() => {\n if (isContextMenuOpen) {\n disableContextMenuHint();\n }\n }, [isContextMenuOpen, disableContextMenuHint]);\n\n const noAppearanceAnimation = appearanceOrder <= 0;\n const [isShown, markShown] = useFlag(noAppearanceAnimation);\n useEffect(() => {\n if (noAppearanceAnimation) {\n return;\n }\n\n setTimeout(markShown, appearanceOrder * APPEARANCE_DELAY);\n }, [appearanceOrder, markShown, noAppearanceAnimation]);\n const { transitionClassNames } = useShowTransition(isShown, undefined, noAppearanceAnimation, false);\n\n const { id: messageId, chatId, threadInfo } = message;\n\n const isLocal = isMessageLocal(message);\n const isOwn = isOwnMessage(message);\n const isScheduled = messageListType === 'scheduled' || message.isScheduled;\n const hasReply = isReplyMessage(message) && !shouldHideReply;\n const hasThread = Boolean(threadInfo) && messageListType === 'thread';\n const { forwardInfo, viaBotId } = message;\n const asForwarded = forwardInfo && !isChatWithSelf && !forwardInfo.isLinkedChannelPost;\n const isInDocumentGroup = Boolean(message.groupedId) && !message.isInAlbum;\n const isAlbum = Boolean(album) && album!.messages.length > 1;\n const {\n text, photo, video, audio, voice, document, sticker, contact, poll, webPage, invoice,\n } = getMessageContent(message);\n const customShape = getMessageCustomShape(message);\n const textParts = renderMessageText(message, highlight, isEmojiOnlyMessage(customShape));\n const isContextMenuShown = contextMenuPosition !== undefined;\n const signature = (\n (isChannel && message.adminTitle) || (forwardInfo && !asForwarded && forwardInfo.adminTitle) || undefined\n );\n const metaSafeAuthorWidth = useMemo(() => {\n return signature ? calculateAuthorWidth(signature) : undefined;\n }, [signature]);\n const canShowActionButton = (\n !(isContextMenuShown || isInSelectMode || isForwarding)\n && (!isInDocumentGroup || isLastInDocumentGroup)\n );\n const canForward = isChannel && !isScheduled;\n const canFocus = Boolean(isPinnedList\n || (forwardInfo && (forwardInfo.isChannelPost || (isChatWithSelf && !isOwn)) && forwardInfo.fromMessageId));\n const avatarPeer = forwardInfo && (isChatWithSelf || !sender) ? originSender : sender;\n const senderPeer = forwardInfo ? originSender : sender;\n\n const selectMessage = useCallback((e?: React.MouseEvent, groupedId?: string) => {\n if (isLocal) {\n return;\n }\n\n toggleMessageSelection({\n messageId,\n groupedId,\n ...(e?.shiftKey && { withShift: true }),\n ...(isAlbum && { childMessageIds: album!.messages.map(({ id }) => id) }),\n });\n }, [isLocal, toggleMessageSelection, messageId, isAlbum, album]);\n\n const {\n handleMouseDown,\n handleClick,\n handleContextMenu,\n handleDoubleClick,\n handleContentDoubleClick,\n isSwiped,\n } = useOuterHandlers(\n selectMessage,\n ref,\n messageId,\n isLocal,\n isAlbum,\n Boolean(isInSelectMode),\n Boolean(canReply),\n onContextMenu,\n handleBeforeContextMenu,\n );\n\n const {\n handleAvatarClick,\n handleSenderClick,\n handleViaBotClick,\n handleReplyClick,\n handleMediaClick,\n handleAudioPlay,\n handleAlbumMediaClick,\n handleMetaClick,\n handleReadMedia,\n handleCancelUpload,\n handleVoteSend,\n handleGroupForward,\n handleForward,\n handleFocus,\n handleFocusForwarded,\n handleDocumentGroupSelectAll,\n } = useInnerHandlers(\n lang,\n selectMessage,\n message,\n chatId,\n threadId,\n isInDocumentGroup,\n Boolean(isScheduled),\n album,\n avatarPeer,\n senderPeer,\n botSender,\n );\n\n const containerClassName = buildClassName(\n 'Message message-list-item',\n isFirstInGroup && 'first-in-group',\n isLastInGroup && 'last-in-group',\n isFirstInDocumentGroup && 'first-in-document-group',\n isLastInDocumentGroup && 'last-in-document-group',\n isLastInList && 'last-in-list',\n isOwn && 'own',\n Boolean(message.views) && 'has-views',\n message.isEdited && 'was-edited',\n hasReply && 'has-reply',\n isContextMenuShown && 'has-menu-open',\n isFocused && !noFocusHighlight && 'focused',\n isForwarding && 'is-forwarding',\n message.isDeleting && 'is-deleting',\n isInDocumentGroup && 'is-in-document-group',\n isAlbum && 'is-album',\n message.hasUnreadMention && 'has-unread-mention',\n isSelected && 'is-selected',\n isInSelectMode && 'is-in-selection-mode',\n isThreadTop && 'is-thread-top',\n Boolean(message.inlineButtons) && 'has-inline-buttons',\n isSwiped && 'is-swiped',\n transitionClassNames,\n );\n const contentClassName = buildContentClassName(message, {\n hasReply,\n customShape,\n isLastInGroup,\n asForwarded,\n hasThread,\n forceSenderName,\n hasComments: message.threadInfo && message.threadInfo.messagesCount > 0,\n hasActionButton: canForward || canFocus,\n });\n const withCommentButton = message.threadInfo && (!isInDocumentGroup || isLastInDocumentGroup)\n && messageListType === 'thread' && !noComments;\n const withAppendix = contentClassName.includes('has-appendix');\n\n useEnsureMessage(chatId, hasReply ? message.replyToMessageId : undefined, replyMessage, message.id);\n useFocusMessage(ref, chatId, isFocused, focusDirection, noFocusHighlight, isResizingContainer);\n useLayoutEffect(() => {\n if (!appendixRef.current) {\n return;\n }\n\n appendixRef.current.innerHTML = isOwn ? APPENDIX_OWN : APPENDIX_NOT_OWN;\n }, [isOwn, withAppendix]);\n\n let style = '';\n let calculatedWidth;\n let noMediaCorners = false;\n const albumLayout = useMemo(() => {\n return isAlbum ? calculateAlbumLayout(isOwn, Boolean(asForwarded), Boolean(noAvatars), album!) : undefined;\n }, [isAlbum, isOwn, asForwarded, noAvatars, album]);\n\n const extraPadding = asForwarded ? 28 : 0;\n if (!isAlbum && (photo || video)) {\n let width: number | undefined;\n if (photo) {\n width = calculateMediaDimensions(message, noAvatars).width;\n } else if (video) {\n if (video.isRound) {\n width = ROUND_VIDEO_DIMENSIONS;\n } else {\n width = calculateMediaDimensions(message, noAvatars).width;\n }\n }\n\n if (width) {\n calculatedWidth = Math.max(getMinMediaWidth(Boolean(text), withCommentButton), width);\n if (calculatedWidth - width > NO_MEDIA_CORNERS_THRESHOLD) {\n noMediaCorners = true;\n }\n }\n } else if (albumLayout) {\n calculatedWidth = Math.max(getMinMediaWidth(Boolean(text), withCommentButton), albumLayout.containerStyle.width);\n if (calculatedWidth - albumLayout.containerStyle.width > NO_MEDIA_CORNERS_THRESHOLD) {\n noMediaCorners = true;\n }\n }\n\n if (calculatedWidth) {\n style = `width: ${calculatedWidth + extraPadding}px`;\n }\n\n function renderAvatar() {\n const isAvatarPeerUser = avatarPeer && isChatPrivate(avatarPeer.id);\n const avatarUser = (avatarPeer && isAvatarPeerUser) ? avatarPeer as ApiUser : undefined;\n const avatarChat = (avatarPeer && !isAvatarPeerUser) ? avatarPeer as ApiChat : undefined;\n const hiddenName = (!avatarPeer && forwardInfo) ? forwardInfo.hiddenUserName : undefined;\n\n return (\n \n );\n }\n\n function renderContent() {\n const className = buildClassName(\n 'content-inner',\n asForwarded && !customShape && 'forwarded-message',\n hasReply && 'reply-message',\n noMediaCorners && 'no-media-corners',\n );\n const hasCustomAppendix = isLastInGroup && !textParts && !asForwarded && !hasThread;\n const shouldInlineMeta = !webPage && !animatedEmoji && textParts;\n const textContentClass = buildClassName(\n 'text-content',\n shouldInlineMeta && 'with-meta',\n outgoingStatus && 'with-outgoing-icon',\n );\n\n return (\n
\n {renderSenderName()}\n {hasReply && (\n \n )}\n {sticker && (\n \n )}\n {animatedEmoji && (\n \n )}\n {isAlbum && (\n \n )}\n {!isAlbum && photo && (\n \n )}\n {!isAlbum && video && video.isRound && (\n \n )}\n {!isAlbum && video && !video.isRound && (\n \n )}\n {(audio || voice) && (\n \n )}\n {document && (\n \n )}\n {contact && (\n \n )}\n {poll && (\n \n )}\n {!animatedEmoji && textParts && (\n

\n {textParts}\n {shouldInlineMeta && (\n \n )}\n

\n )}\n {webPage && (\n \n )}\n {invoice && }\n
\n );\n }\n\n function renderSenderName() {\n const shouldRender = !(customShape && !viaBotId) && (\n (withSenderName && !photo && !video) || asForwarded || viaBotId || forceSenderName\n ) && (!isInDocumentGroup || isFirstInDocumentGroup);\n\n if (!shouldRender) {\n return undefined;\n }\n\n let senderTitle;\n let senderColor;\n if (senderPeer && !(customShape && viaBotId)) {\n senderTitle = getSenderTitle(lang, senderPeer);\n\n if (!asForwarded) {\n senderColor = `color-${getUserColorKey(senderPeer)}`;\n }\n } else if (forwardInfo?.hiddenUserName) {\n senderTitle = forwardInfo.hiddenUserName;\n }\n\n return (\n
\n {senderTitle ? (\n \n {renderText(senderTitle)}\n \n ) : !botSender ? (\n NBSP\n ) : undefined}\n {botSender && (\n <>\n {lang('ViaBot')}\n \n {renderText(`@${botSender.username}`)}\n \n \n )}\n {forwardInfo?.isLinkedChannelPost ? (\n {lang('DiscussChannel')}\n ) : message.adminTitle && !isChannel ? (\n {message.adminTitle}\n ) : undefined}\n
\n );\n }\n\n return (\n \n \n {!isLocal && !isInDocumentGroup && (\n
\n {isSelected && }\n
\n )}\n {!isLocal && isLastInDocumentGroup && (\n \n {isGroupSelected && (\n \n )}\n \n )}\n {withAvatar && renderAvatar()}\n \n \n {asForwarded && !customShape && (!isInDocumentGroup || isFirstInDocumentGroup) && (\n
{lang('ForwardedMessage')}
\n )}\n {renderContent()}\n {(!isInDocumentGroup || isLastInDocumentGroup) && !(!webPage && !animatedEmoji && textParts) && (\n \n )}\n {canShowActionButton && canForward ? (\n \n \n \n ) : canShowActionButton && canFocus ? (\n \n \n \n ) : undefined}\n {withCommentButton && }\n {withAppendix &&
}\n
\n {message.inlineButtons && (\n \n )}\n \n {contextMenuPosition && (\n \n )}\n \n );\n};\n\nfunction handleDocumentGroupMouseEnter(e: React.MouseEvent) {\n const lastGroupElement = getLastElementInDocumentGroup(e.currentTarget);\n if (lastGroupElement) {\n lastGroupElement.setAttribute(GROUP_MESSAGE_HOVER_ATTRIBUTE, '');\n }\n}\n\nfunction handleDocumentGroupMouseLeave(e: React.MouseEvent) {\n const lastGroupElement = getLastElementInDocumentGroup(e.currentTarget);\n if (lastGroupElement) {\n lastGroupElement.removeAttribute(GROUP_MESSAGE_HOVER_ATTRIBUTE);\n }\n}\n\nfunction getLastElementInDocumentGroup(element: Element) {\n let current: Element | null = element;\n\n do {\n current = current.nextElementSibling;\n } while (current && !current.classList.contains('last-in-document-group'));\n\n return current;\n}\n\nexport default memo(withGlobal(\n (global, ownProps): StateProps => {\n const { focusedMessage, forwardMessages, lastSyncTime } = global;\n const {\n message, album, withSenderName, withAvatar, threadId, messageListType,\n } = ownProps;\n const {\n id, chatId, viaBotId, replyToMessageId, isOutgoing,\n } = message;\n\n const chat = selectChat(global, chatId);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const isChannel = chat && isChatChannel(chat);\n const chatUsername = chat?.username;\n\n const forceSenderName = !isChatWithSelf && isAnonymousOwnMessage(message);\n const canShowSender = withSenderName || withAvatar || forceSenderName;\n const sender = canShowSender ? selectSender(global, message) : undefined;\n const originSender = selectForwardedSender(global, message);\n const botSender = viaBotId ? selectUser(global, viaBotId) : undefined;\n\n const threadTopMessageId = threadId ? selectThreadTopMessageId(global, chatId, threadId) : undefined;\n const isThreadTop = message.id === threadTopMessageId;\n\n const shouldHideReply = replyToMessageId === threadTopMessageId;\n const replyMessage = replyToMessageId && !shouldHideReply\n ? selectChatMessage(global, chatId, replyToMessageId)\n : undefined;\n const replyMessageSender = replyMessage && selectSender(global, replyMessage);\n\n const uploadProgress = selectUploadProgress(global, message);\n const isFocused = messageListType === 'thread' && (\n album\n ? album.messages.some((m) => selectIsMessageFocused(global, m))\n : selectIsMessageFocused(global, message)\n );\n\n const {\n direction: focusDirection, noHighlight: noFocusHighlight, isResizingContainer,\n } = (isFocused && focusedMessage) || {};\n\n const isForwarding = forwardMessages.messageIds && forwardMessages.messageIds.includes(id);\n\n const { query: highlight } = selectCurrentTextSearch(global) || {};\n\n const singleEmoji = getMessageSingleEmoji(message);\n let isSelected: boolean;\n\n if (album?.messages) {\n isSelected = album.messages.every(({ id: messageId }) => selectIsMessageSelected(global, messageId));\n } else {\n isSelected = selectIsMessageSelected(global, id);\n }\n\n const { canReply } = (messageListType === 'thread' && selectAllowedMessageActions(global, message, threadId)) || {};\n\n return {\n theme: selectTheme(global),\n chatUsername,\n forceSenderName,\n sender,\n originSender,\n botSender,\n shouldHideReply,\n isThreadTop,\n replyMessage,\n replyMessageSender,\n isFocused,\n isForwarding,\n isChatWithSelf,\n isChannel,\n canReply,\n lastSyncTime,\n highlight,\n isSingleEmoji: Boolean(singleEmoji),\n animatedEmoji: singleEmoji ? selectAnimatedEmoji(global, singleEmoji) : undefined,\n isInSelectMode: selectIsInSelectMode(global),\n isSelected,\n isGroupSelected: (\n !!message.groupedId && !message.isInAlbum && selectIsDocumentGroupSelected(global, chatId, message.groupedId)\n ),\n threadId,\n isPinnedList: messageListType === 'pinned',\n shouldAutoLoadMedia: chat ? selectShouldAutoLoadMedia(global, message, chat, sender) : undefined,\n shouldAutoPlayMedia: selectShouldAutoPlayMedia(global, message),\n shouldLoopStickers: selectShouldLoopStickers(global),\n ...(isOutgoing && { outgoingStatus: selectOutgoingStatus(global, message, messageListType === 'scheduled') }),\n ...(typeof uploadProgress === 'number' && { uploadProgress }),\n ...(isFocused && { focusDirection, noFocusHighlight, isResizingContainer }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'toggleMessageSelection',\n 'clickInlineButton',\n 'disableContextMenuHint',\n ]),\n)(Message));\n","import { RefObject } from 'react';\nimport React, { useEffect } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\n\nimport { IS_ANDROID, IS_TOUCH_ENV } from '../../../../util/environment';\nimport windowSize from '../../../../util/windowSize';\nimport { captureEvents, SwipeDirection } from '../../../../util/captureEvents';\nimport useFlag from '../../../../hooks/useFlag';\nimport { preventMessageInputBlur } from '../../helpers/preventMessageInputBlur';\n\nconst ANDROID_KEYBOARD_HIDE_DELAY_MS = 350;\nconst SWIPE_ANIMATION_DURATION = 150;\n\nexport default function useOuterHandlers(\n selectMessage: (e?: React.MouseEvent, groupedId?: string) => void,\n containerRef: RefObject,\n messageId: number,\n isLocal: boolean,\n isAlbum: boolean,\n isInSelectMode: boolean,\n canReply: boolean,\n onContextMenu: (e: React.MouseEvent) => void,\n handleBeforeContextMenu: (e: React.MouseEvent) => void,\n) {\n const { setReplyingToId } = getDispatch();\n\n const [isSwiped, markSwiped, unmarkSwiped] = useFlag();\n\n function handleMouseDown(e: React.MouseEvent) {\n preventMessageInputBlur(e);\n\n if (!isLocal) {\n handleBeforeContextMenu(e);\n }\n }\n\n function handleClick(e: React.MouseEvent) {\n if (isInSelectMode && !isLocal) {\n selectMessage(e);\n } else if (IS_ANDROID) {\n const target = e.target as HTMLDivElement;\n if (!target.classList.contains('text-content') && !target.classList.contains('Message')) {\n return;\n }\n\n if (windowSize.getIsKeyboardVisible()) {\n setTimeout(() => {\n onContextMenu(e);\n }, ANDROID_KEYBOARD_HIDE_DELAY_MS);\n } else {\n onContextMenu(e);\n }\n }\n }\n\n function handleContextMenu(e: React.MouseEvent) {\n if (IS_ANDROID) {\n if ((e.target as HTMLElement).matches('a[href]')) {\n return;\n }\n\n e.preventDefault();\n selectMessage();\n } else {\n onContextMenu(e);\n }\n }\n\n function handleContainerDoubleClick() {\n setReplyingToId({ messageId });\n }\n\n function stopPropagation(e: React.MouseEvent) {\n e.stopPropagation();\n }\n\n useEffect(() => {\n if (!IS_TOUCH_ENV || isInSelectMode || !canReply) {\n return undefined;\n }\n\n let startedAt: number | undefined;\n return captureEvents(containerRef.current!, {\n selectorToPreventScroll: '.MessageList',\n onSwipe: ((e, direction) => {\n if (direction === SwipeDirection.Left) {\n if (!startedAt) {\n startedAt = Date.now();\n }\n\n markSwiped();\n\n return true;\n }\n\n return false;\n }),\n onRelease: () => {\n if (!startedAt) {\n return;\n }\n\n setReplyingToId({ messageId });\n\n setTimeout(unmarkSwiped, Math.max(0, SWIPE_ANIMATION_DURATION - (Date.now() - startedAt)));\n startedAt = undefined;\n },\n });\n }, [containerRef, isInSelectMode, messageId, setReplyingToId, markSwiped, unmarkSwiped, canReply]);\n\n return {\n handleMouseDown: !isInSelectMode ? handleMouseDown : undefined,\n handleClick,\n handleContextMenu: !isInSelectMode && !isLocal ? handleContextMenu : undefined,\n handleDoubleClick: !isInSelectMode ? handleContainerDoubleClick : undefined,\n handleContentDoubleClick: !IS_TOUCH_ENV ? stopPropagation : undefined,\n isSwiped,\n };\n}\n","import React, { useCallback } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\n\nimport { isChatPrivate } from '../../../../modules/helpers';\nimport { IAlbum, MediaViewerOrigin } from '../../../../types';\nimport {\n ApiChat, ApiMessage, ApiUser, MAIN_THREAD_ID,\n} from '../../../../api/types';\nimport { LangFn } from '../../../../hooks/useLang';\n\nexport default function useInnerHandlers(\n lang: LangFn,\n selectMessage: (e: React.MouseEvent, groupedId?: string) => void,\n message: ApiMessage,\n chatId: number,\n threadId: number,\n isInDocumentGroup: boolean,\n isScheduled?: boolean,\n album?: IAlbum,\n avatarPeer?: ApiUser | ApiChat,\n senderPeer?: ApiUser | ApiChat,\n botSender?: ApiUser,\n) {\n const {\n openUserInfo, openChat, showNotification, focusMessage, openMediaViewer, openAudioPlayer,\n markMessagesRead, cancelSendingMessage, sendPollVote, openForwardMenu,\n } = getDispatch();\n\n const {\n id: messageId, forwardInfo, replyToMessageId, groupedId,\n } = message;\n\n const handleAvatarClick = useCallback(() => {\n if (!avatarPeer) {\n return;\n }\n\n if (isChatPrivate(avatarPeer.id)) {\n openUserInfo({ id: avatarPeer.id });\n } else {\n openChat({ id: avatarPeer.id });\n }\n }, [avatarPeer, openUserInfo, openChat]);\n\n const handleSenderClick = useCallback(() => {\n if (!senderPeer) {\n showNotification({ message: lang('HidAccount') });\n\n return;\n }\n\n if (isChatPrivate(senderPeer.id)) {\n openUserInfo({ id: senderPeer.id });\n } else {\n openChat({ id: senderPeer.id });\n }\n }, [senderPeer, showNotification, lang, openUserInfo, openChat]);\n\n const handleViaBotClick = useCallback(() => {\n if (!botSender) {\n return;\n }\n\n openUserInfo({ id: botSender.id });\n }, [botSender, openUserInfo]);\n\n const handleReplyClick = useCallback((): void => {\n focusMessage({\n chatId, threadId, messageId: replyToMessageId, replyMessageId: messageId,\n });\n }, [focusMessage, chatId, threadId, replyToMessageId, messageId]);\n\n const handleMediaClick = useCallback((): void => {\n openMediaViewer({\n chatId, threadId, messageId, origin: isScheduled ? MediaViewerOrigin.ScheduledInline : MediaViewerOrigin.Inline,\n });\n }, [chatId, threadId, messageId, openMediaViewer, isScheduled]);\n\n const handleAudioPlay = useCallback((): void => {\n openAudioPlayer({ chatId, messageId });\n }, [chatId, messageId, openAudioPlayer]);\n\n const handleAlbumMediaClick = useCallback((albumMessageId: number): void => {\n openMediaViewer({\n chatId,\n threadId,\n messageId: albumMessageId,\n origin: isScheduled ? MediaViewerOrigin.ScheduledAlbum : MediaViewerOrigin.Album,\n });\n }, [chatId, threadId, openMediaViewer, isScheduled]);\n\n const handleReadMedia = useCallback((): void => {\n markMessagesRead({ messageIds: [messageId] });\n }, [messageId, markMessagesRead]);\n\n const handleCancelUpload = useCallback(() => {\n cancelSendingMessage({ chatId, messageId });\n }, [cancelSendingMessage, chatId, messageId]);\n\n const handleVoteSend = useCallback((options: string[]) => {\n sendPollVote({ chatId, messageId, options });\n }, [chatId, messageId, sendPollVote]);\n\n const handleGroupForward = useCallback(() => {\n openForwardMenu({ fromChatId: chatId, groupedId });\n }, [openForwardMenu, chatId, groupedId]);\n\n const handleForward = useCallback(() => {\n if (album && album.messages) {\n const messageIds = album.messages.map(({ id }) => id);\n openForwardMenu({ fromChatId: chatId, messageIds });\n } else {\n openForwardMenu({ fromChatId: chatId, messageIds: [messageId] });\n }\n }, [album, openForwardMenu, chatId, messageId]);\n\n const handleFocus = useCallback(() => {\n focusMessage({\n chatId, threadId: MAIN_THREAD_ID, messageId,\n });\n }, [focusMessage, chatId, messageId]);\n\n const handleFocusForwarded = useCallback(() => {\n if (isInDocumentGroup) {\n focusMessage({\n chatId: forwardInfo!.fromChatId, groupedId, groupedChatId: chatId,\n });\n return;\n }\n focusMessage({\n chatId: forwardInfo!.fromChatId, messageId: forwardInfo!.fromMessageId,\n });\n }, [isInDocumentGroup, focusMessage, forwardInfo, groupedId, chatId]);\n\n const selectWithGroupedId = useCallback((e: React.MouseEvent) => {\n e.stopPropagation();\n\n selectMessage(e, groupedId);\n }, [selectMessage, groupedId]);\n\n return {\n handleAvatarClick,\n handleSenderClick,\n handleViaBotClick,\n handleReplyClick,\n handleMediaClick,\n handleAudioPlay,\n handleAlbumMediaClick,\n handleMetaClick: selectWithGroupedId,\n handleReadMedia,\n handleCancelUpload,\n handleVoteSend,\n handleGroupForward,\n handleForward,\n handleFocus,\n handleFocusForwarded,\n handleDocumentGroupSelectAll: selectWithGroupedId,\n };\n}\n","import { RefObject } from 'react';\nimport React, { FC, memo } from '../../lib/teact/teact';\n\nimport { MessageListType } from '../../global/types';\n\nimport { SCHEDULED_WHEN_ONLINE } from '../../config';\nimport buildClassName from '../../util/buildClassName';\nimport { compact, flatten } from '../../util/iteratees';\nimport { formatHumanDate } from '../../util/dateFormat';\nimport { getMessageOriginalId, isActionMessage, isOwnMessage } from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport { isAlbum, MessageDateGroup } from './helpers/groupMessages';\nimport { preventMessageInputBlur } from './helpers/preventMessageInputBlur';\nimport useScrollHooks from './hooks/useScrollHooks';\nimport useMessageObservers from './hooks/useMessageObservers';\n\nimport Message from './message/Message';\nimport ActionMessage from './ActionMessage';\n\ninterface OwnProps {\n messageIds: number[];\n messageGroups: MessageDateGroup[];\n isViewportNewest: boolean;\n isUnread: boolean;\n withUsers: boolean;\n noAvatars: boolean;\n containerRef: RefObject;\n anchorIdRef: { current: string | undefined };\n memoUnreadDividerBeforeIdRef: { current: number | undefined };\n memoFirstUnreadIdRef: { current: number | undefined };\n threadId: number;\n type: MessageListType;\n isActive: boolean;\n threadTopMessageId: number | undefined;\n hasLinkedChat: boolean | undefined;\n isSchedule: boolean;\n noAppearanceAnimation: boolean;\n onFabToggle: AnyToVoidFunction;\n onNotchToggle: AnyToVoidFunction;\n openHistoryCalendar: Function;\n}\n\nconst UNREAD_DIVIDER_CLASS = 'unread-divider';\n\nconst MessageListContent: FC = ({\n messageIds,\n messageGroups,\n isViewportNewest,\n isUnread,\n withUsers,\n noAvatars,\n containerRef,\n anchorIdRef,\n memoUnreadDividerBeforeIdRef,\n memoFirstUnreadIdRef,\n threadId,\n type,\n isActive,\n threadTopMessageId,\n hasLinkedChat,\n isSchedule,\n noAppearanceAnimation,\n onFabToggle,\n onNotchToggle,\n openHistoryCalendar,\n}) => {\n const {\n observeIntersectionForMedia,\n observeIntersectionForReading,\n observeIntersectionForAnimatedStickers,\n } = useMessageObservers(type, containerRef, memoFirstUnreadIdRef);\n\n const {\n backwardsTriggerRef,\n forwardsTriggerRef,\n fabTriggerRef,\n } = useScrollHooks(\n type,\n containerRef,\n messageIds,\n isViewportNewest,\n isUnread,\n onFabToggle,\n onNotchToggle,\n isActive,\n );\n\n const lang = useLang();\n\n const unreadDivider = (\n
\n {lang('UnreadMessages')}\n
\n );\n\n const messageCountToAnimate = noAppearanceAnimation ? 0 : messageGroups.reduce((acc, messageGroup) => {\n return acc + flatten(messageGroup.senderGroups).length;\n }, 0);\n let appearanceIndex = 0;\n\n const dateGroups = messageGroups.map((\n dateGroup: MessageDateGroup,\n dateGroupIndex: number,\n dateGroupsArray: MessageDateGroup[],\n ) => {\n const senderGroups = dateGroup.senderGroups.map((\n senderGroup,\n senderGroupIndex,\n senderGroupsArray,\n ) => {\n if (senderGroup.length === 1 && !isAlbum(senderGroup[0]) && isActionMessage(senderGroup[0])) {\n const message = senderGroup[0];\n const isLastInList = (\n senderGroupIndex === senderGroupsArray.length - 1\n && dateGroupIndex === dateGroupsArray.length - 1\n );\n\n return compact([\n message.id === memoUnreadDividerBeforeIdRef.current && unreadDivider,\n ,\n ]);\n }\n\n let currentDocumentGroupId: string | undefined;\n\n return flatten(senderGroup.map((\n messageOrAlbum,\n messageIndex,\n ) => {\n const message = isAlbum(messageOrAlbum) ? messageOrAlbum.mainMessage : messageOrAlbum;\n const album = isAlbum(messageOrAlbum) ? messageOrAlbum : undefined;\n const isOwn = isOwnMessage(message);\n const isMessageAlbum = isAlbum(messageOrAlbum);\n const nextMessage = senderGroup[messageIndex + 1];\n\n if (message.previousLocalId && anchorIdRef.current === `message${message.previousLocalId}`) {\n anchorIdRef.current = `message${message.id}`;\n }\n\n const documentGroupId = !isMessageAlbum && message.groupedId ? message.groupedId : undefined;\n const nextDocumentGroupId = nextMessage && !isAlbum(nextMessage) ? nextMessage.groupedId : undefined;\n\n const position = {\n isFirstInGroup: messageIndex === 0,\n isLastInGroup: messageIndex === senderGroup.length - 1,\n isFirstInDocumentGroup: Boolean(documentGroupId && documentGroupId !== currentDocumentGroupId),\n isLastInDocumentGroup: Boolean(documentGroupId && documentGroupId !== nextDocumentGroupId),\n isLastInList: (\n messageIndex === senderGroup.length - 1\n && senderGroupIndex === senderGroupsArray.length - 1\n && dateGroupIndex === dateGroupsArray.length - 1\n ),\n };\n\n currentDocumentGroupId = documentGroupId;\n\n const originalId = getMessageOriginalId(message);\n // Scheduled messages can have local IDs in the middle of the list,\n // and keys should be ordered, so we prefix it with a date.\n // However, this may lead to issues if server date is not synchronized with the local one.\n const key = type !== 'scheduled' ? originalId : `${message.date}_${originalId}`;\n\n return compact([\n message.id === memoUnreadDividerBeforeIdRef.current && unreadDivider,\n ,\n message.id === threadTopMessageId && (\n
\n {lang('DiscussionStarted')}\n
\n ),\n ]);\n }));\n });\n\n return (\n \n openHistoryCalendar({ selectedAt: dateGroup.datetime }) : undefined}\n >\n \n {isSchedule && dateGroup.originalDate === SCHEDULED_WHEN_ONLINE && (\n lang('MessageScheduledUntilOnline')\n )}\n {isSchedule && dateGroup.originalDate !== SCHEDULED_WHEN_ONLINE && (\n lang('MessageScheduledOn', formatHumanDate(lang, dateGroup.datetime, undefined, true))\n )}\n {!isSchedule && formatHumanDate(lang, dateGroup.datetime)}\n \n \n {flatten(senderGroups)}\n \n );\n });\n\n return (\n
\n
\n {flatten(dateGroups)}\n \n \n
\n );\n};\n\nexport default memo(MessageListContent);\n","import { RefObject } from 'react';\nimport { getDispatch } from '../../../lib/teact/teactn';\nimport { useMemo, useRef } from '../../../lib/teact/teact';\n\nimport { LoadMoreDirection } from '../../../types';\nimport { MessageListType } from '../../../global/types';\n\nimport { debounce } from '../../../util/schedulers';\nimport { useIntersectionObserver, useOnIntersect } from '../../../hooks/useIntersectionObserver';\nimport { LOCAL_MESSAGE_ID_BASE, MESSAGE_LIST_SENSITIVE_AREA } from '../../../config';\nimport resetScroll from '../../../util/resetScroll';\nimport useOnChange from '../../../hooks/useOnChange';\n\nconst FAB_THRESHOLD = 50;\nconst TOOLS_FREEZE_TIMEOUT = 100;\n\nexport default function useScrollHooks(\n type: MessageListType,\n containerRef: RefObject,\n messageIds: number[],\n isViewportNewest: boolean,\n isUnread: boolean,\n onFabToggle: AnyToVoidFunction,\n onNotchToggle: AnyToVoidFunction,\n isActive: boolean,\n) {\n const { loadViewportMessages } = getDispatch();\n\n const [loadMoreBackwards, loadMoreForwards] = useMemo(\n () => (type === 'thread' ? [\n debounce(() => loadViewportMessages({ direction: LoadMoreDirection.Backwards }), 1000, true, false),\n debounce(() => loadViewportMessages({ direction: LoadMoreDirection.Forwards }), 1000, true, false),\n ] : []),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [loadViewportMessages, messageIds],\n );\n\n // eslint-disable-next-line no-null/no-null\n const backwardsTriggerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const forwardsTriggerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const fabTriggerRef = useRef(null);\n\n function toggleScrollTools() {\n if (!isActive) return;\n\n if (!messageIds || !messageIds.length) {\n onFabToggle(false);\n onNotchToggle(false);\n return;\n }\n\n if (!isViewportNewest) {\n onFabToggle(true);\n onNotchToggle(true);\n return;\n }\n\n const { offsetHeight, scrollHeight, scrollTop } = containerRef.current!;\n const scrollBottom = Math.round(scrollHeight - scrollTop - offsetHeight);\n const isNearBottom = scrollBottom <= FAB_THRESHOLD;\n const isAtBottom = scrollBottom <= 0;\n\n onFabToggle(isUnread ? !isAtBottom : !isNearBottom);\n onNotchToggle(!isAtBottom);\n }\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({\n rootRef: containerRef,\n margin: MESSAGE_LIST_SENSITIVE_AREA,\n }, (entries) => {\n if (!loadMoreForwards || !loadMoreBackwards) {\n return;\n }\n\n // Loading history while sending a message can return the same message and cause ambiguity\n const isFirstMessageLocal = messageIds[0] >= LOCAL_MESSAGE_ID_BASE;\n if (isFirstMessageLocal) {\n return;\n }\n\n const triggerEntry = entries.find(({ isIntersecting }) => isIntersecting);\n if (!triggerEntry) {\n return;\n }\n\n const { target } = triggerEntry;\n\n if (target.className === 'backwards-trigger') {\n resetScroll(containerRef.current!);\n loadMoreBackwards();\n } else if (target.className === 'forwards-trigger') {\n resetScroll(containerRef.current!);\n loadMoreForwards();\n }\n });\n\n useOnIntersect(backwardsTriggerRef, observeIntersection);\n useOnIntersect(forwardsTriggerRef, observeIntersection);\n\n const {\n observe: observeIntersectionForFab,\n freeze: freezeForFab,\n unfreeze: unfreezeForFab,\n } = useIntersectionObserver({\n rootRef: containerRef,\n margin: FAB_THRESHOLD,\n }, toggleScrollTools);\n\n useOnIntersect(fabTriggerRef, observeIntersectionForFab);\n\n const {\n observe: observeIntersectionForNotch,\n freeze: freezeForNotch,\n unfreeze: unfreezeForNotch,\n } = useIntersectionObserver({\n rootRef: containerRef,\n }, toggleScrollTools);\n\n useOnIntersect(fabTriggerRef, observeIntersectionForNotch);\n\n // Workaround for FAB and notch flickering with tall incoming message\n useOnChange(() => {\n freezeForFab();\n freezeForNotch();\n\n setTimeout(() => {\n unfreezeForNotch();\n unfreezeForFab();\n }, TOOLS_FREEZE_TIMEOUT);\n }, [messageIds]);\n\n return { backwardsTriggerRef, forwardsTriggerRef, fabTriggerRef };\n}\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiSticker, ApiUpdateConnectionStateType } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport { selectChat } from '../../modules/selectors';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\n\nimport StickerButton from '../common/StickerButton';\n\nimport './ContactGreeting.scss';\n\ntype OwnProps = {\n userId: number;\n};\n\ntype StateProps = {\n sticker?: ApiSticker;\n lastUnreadMessageId?: number;\n connectionState?: ApiUpdateConnectionStateType;\n};\n\ntype DispatchProps = Pick;\n\nconst INTERSECTION_DEBOUNCE_MS = 200;\n\nconst ContactGreeting: FC = ({\n sticker,\n connectionState,\n lastUnreadMessageId,\n loadGreetingStickers,\n sendMessage,\n markMessageListRead,\n}) => {\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({\n rootRef: containerRef,\n debounceMs: INTERSECTION_DEBOUNCE_MS,\n });\n useEffect(() => {\n if (sticker || connectionState !== 'connectionStateReady') {\n return;\n }\n\n loadGreetingStickers();\n }, [connectionState, loadGreetingStickers, sticker]);\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady' && lastUnreadMessageId) {\n markMessageListRead({ maxId: lastUnreadMessageId });\n }\n }, [connectionState, markMessageListRead, lastUnreadMessageId]);\n\n const handleStickerSelect = useCallback((selectedSticker: ApiSticker) => {\n selectedSticker = {\n ...selectedSticker,\n isPreloadedGlobally: true,\n };\n sendMessage({ sticker: selectedSticker });\n }, [sendMessage]);\n\n return (\n
\n
\n

{lang('Conversation.EmptyPlaceholder')}

\n

{lang('Conversation.GreetingText')}

\n\n
\n {sticker && (\n \n )}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { userId }): StateProps => {\n const { stickers } = global.stickers.greeting;\n const sticker = stickers?.length ? stickers[userId % stickers.length] : undefined;\n const chat = selectChat(global, userId);\n if (!chat) {\n return {};\n }\n\n return {\n sticker,\n lastUnreadMessageId: chat.lastMessage && chat.lastMessage.id !== chat.lastReadInboxMessageId\n ? chat.lastMessage.id\n : undefined,\n connectionState: global.connectionState,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadGreetingStickers', 'sendMessage', 'markMessageListRead',\n ]),\n\n)(ContactGreeting));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport { MessageListType } from '../../global/types';\n\nimport useLang, { LangFn } from '../../hooks/useLang';\n\nimport './NoMessages.scss';\n\ntype OwnProps = {\n chatId: number;\n isChatWithSelf?: boolean;\n type: MessageListType;\n isGroupChatJustCreated?: boolean;\n};\n\nconst NoMessages: FC = ({\n isChatWithSelf, type, isGroupChatJustCreated,\n}) => {\n const lang = useLang();\n\n if (type === 'scheduled') {\n return renderScheduled(lang);\n }\n\n if (isChatWithSelf) {\n return renderSavedMessages(lang);\n }\n\n if (isGroupChatJustCreated) {\n return renderGroup(lang);\n }\n\n return (\n
{lang('NoMessages')}
\n );\n};\n\nfunction renderScheduled(lang: LangFn) {\n return (\n
{lang('ScheduledMessages.EmptyPlaceholder')}
\n );\n}\n\nfunction renderSavedMessages(lang: LangFn) {\n return (\n
\n
\n \n

{lang('Conversation.CloudStorageInfo.Title')}

\n
    \n
  • {lang('Conversation.ClousStorageInfo.Description1')}
  • \n
  • {lang('Conversation.ClousStorageInfo.Description2')}
  • \n
  • {lang('Conversation.ClousStorageInfo.Description3')}
  • \n
  • {lang('Conversation.ClousStorageInfo.Description4')}
  • \n
\n
\n
\n );\n}\n\nfunction renderGroup(lang: LangFn) {\n return (\n
\n
\n

{lang('EmptyGroupInfo.Title')}

\n

{lang('EmptyGroupInfo.Subtitle')}

\n
    \n
  • {lang('EmptyGroupInfo.Line1')}
  • \n
  • {lang('EmptyGroupInfo.Line2')}
  • \n
  • {lang('EmptyGroupInfo.Line3')}
  • \n
  • {lang('EmptyGroupInfo.Line4')}
  • \n
\n
\n
\n );\n}\n\nexport default memo(NoMessages);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiMessage, ApiRestrictionReason, MAIN_THREAD_ID,\n} from '../../api/types';\nimport { GlobalActions, MessageListType } from '../../global/types';\nimport { LoadMoreDirection } from '../../types';\n\nimport { ANIMATION_END_DELAY, LOCAL_MESSAGE_ID_BASE, MESSAGE_LIST_SLICE } from '../../config';\nimport {\n selectChatMessages,\n selectIsViewportNewest,\n selectFirstUnreadId,\n selectFocusedMessageId,\n selectChat,\n selectIsInSelectMode,\n selectIsChatWithSelf,\n selectChatBot,\n selectIsChatBotNotStarted,\n selectScrollOffset,\n selectThreadTopMessageId,\n selectFirstMessageId,\n selectScheduledMessages,\n selectCurrentMessageIds,\n} from '../../modules/selectors';\nimport { isChatChannel, isChatGroup, isChatPrivate } from '../../modules/helpers';\nimport { orderBy, pick } from '../../util/iteratees';\nimport { fastRaf, debounce, onTickEnd } from '../../util/schedulers';\nimport useLayoutEffectWithPrevDeps from '../../hooks/useLayoutEffectWithPrevDeps';\nimport useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';\nimport buildClassName from '../../util/buildClassName';\nimport { groupMessages } from './helpers/groupMessages';\nimport { preventMessageInputBlur } from './helpers/preventMessageInputBlur';\nimport useOnChange from '../../hooks/useOnChange';\nimport useStickyDates from './hooks/useStickyDates';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport resetScroll from '../../util/resetScroll';\nimport fastSmoothScroll, { isAnimatingScroll } from '../../util/fastSmoothScroll';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport useWindowSize from '../../hooks/useWindowSize';\n\nimport Loading from '../ui/Loading';\nimport MessageListContent from './MessageListContent';\nimport ContactGreeting from './ContactGreeting';\nimport NoMessages from './NoMessages';\n\nimport './MessageList.scss';\n\ntype OwnProps = {\n chatId: number;\n threadId: number;\n type: MessageListType;\n canPost: boolean;\n isReady: boolean;\n isActive: boolean;\n onFabToggle: (shouldShow: boolean) => void;\n onNotchToggle: (shouldShow: boolean) => void;\n hasTools?: boolean;\n};\n\ntype StateProps = {\n isChatLoaded?: boolean;\n isChannelChat?: boolean;\n isGroupChat?: boolean;\n isChatWithSelf?: boolean;\n isCreator?: boolean;\n isBot?: boolean;\n messageIds?: number[];\n messagesById?: Record;\n firstUnreadId?: number;\n isViewportNewest?: boolean;\n isRestricted?: boolean;\n restrictionReason?: ApiRestrictionReason;\n focusingId?: number;\n isSelectModeActive?: boolean;\n animationLevel?: number;\n lastMessage?: ApiMessage;\n botDescription?: string;\n threadTopMessageId?: number;\n threadFirstMessageId?: number;\n hasLinkedChat?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst BOTTOM_THRESHOLD = 20;\nconst UNREAD_DIVIDER_TOP = 10;\nconst UNREAD_DIVIDER_TOP_WITH_TOOLS = 60;\nconst SCROLL_DEBOUNCE = 200;\nconst FOCUSING_DURATION = 1000;\nconst BOTTOM_FOCUS_MARGIN = 20;\nconst SELECT_MODE_ANIMATION_DURATION = 200;\nconst UNREAD_DIVIDER_CLASS = 'unread-divider';\n\nconst runDebouncedForScroll = debounce((cb) => cb(), SCROLL_DEBOUNCE, false);\n\nconst MessageList: FC = ({\n chatId,\n threadId,\n type,\n hasTools,\n onFabToggle,\n onNotchToggle,\n isChatLoaded,\n isChannelChat,\n isGroupChat,\n canPost,\n isReady,\n isActive,\n isChatWithSelf,\n isCreator,\n isBot,\n messageIds,\n messagesById,\n firstUnreadId,\n isViewportNewest,\n threadFirstMessageId,\n isRestricted,\n restrictionReason,\n focusingId,\n isSelectModeActive,\n loadViewportMessages,\n setScrollOffset,\n lastMessage,\n botDescription,\n threadTopMessageId,\n hasLinkedChat,\n openHistoryCalendar,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n // We update local cached `scrollOffsetRef` when opening chat.\n // Then we update global version every second on scrolling.\n const scrollOffsetRef = useRef((type === 'thread' && selectScrollOffset(getGlobal(), chatId, threadId)) || 0);\n const anchorIdRef = useRef();\n const anchorTopRef = useRef();\n const listItemElementsRef = useRef();\n const memoFirstUnreadIdRef = useRef();\n const memoUnreadDividerBeforeIdRef = useRef();\n const memoFocusingIdRef = useRef();\n const isScrollTopJustUpdatedRef = useRef(false);\n const shouldAnimateAppearanceRef = useRef(Boolean(lastMessage));\n\n const [containerHeight, setContainerHeight] = useState();\n\n const areMessagesLoaded = Boolean(messageIds);\n\n useOnChange(() => {\n // We only need it first time when message list appears\n if (areMessagesLoaded) {\n onTickEnd(() => {\n shouldAnimateAppearanceRef.current = false;\n });\n }\n }, [areMessagesLoaded]);\n\n // Updated every time (to be used from intersection callback closure)\n useOnChange(() => {\n memoFirstUnreadIdRef.current = firstUnreadId;\n }, [firstUnreadId]);\n\n // Updated only once when messages are loaded (as we want the unread divider to keep its position)\n useOnChange(() => {\n if (areMessagesLoaded) {\n memoUnreadDividerBeforeIdRef.current = memoFirstUnreadIdRef.current;\n }\n }, [areMessagesLoaded]);\n\n useOnChange(() => {\n memoFocusingIdRef.current = focusingId;\n }, [focusingId]);\n\n const messageGroups = useMemo(() => {\n if (!messageIds || !messagesById) {\n return undefined;\n }\n\n const viewportIds = threadTopMessageId && (!messageIds[0] || threadFirstMessageId === messageIds[0])\n ? [threadTopMessageId, ...messageIds]\n : messageIds;\n\n if (!viewportIds.length) {\n return undefined;\n }\n\n const listedMessages = viewportIds.map((id) => messagesById[id]).filter(Boolean);\n return groupMessages(orderBy(listedMessages, ['date', 'id']), memoUnreadDividerBeforeIdRef.current);\n }, [messageIds, messagesById, threadFirstMessageId, threadTopMessageId]);\n\n const loadMoreAround = useMemo(() => {\n if (type !== 'thread') {\n return undefined;\n }\n\n return debounce(() => loadViewportMessages({ direction: LoadMoreDirection.Around }), 1000, true, false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [loadViewportMessages, messageIds]);\n\n const { isScrolled, updateStickyDates } = useStickyDates();\n\n const handleScroll = useCallback(() => {\n if (isScrollTopJustUpdatedRef.current) {\n isScrollTopJustUpdatedRef.current = false;\n return;\n }\n\n const container = containerRef.current!;\n\n if (!memoFocusingIdRef.current) {\n updateStickyDates(container, hasTools);\n }\n\n runDebouncedForScroll(() => {\n fastRaf(() => {\n if (!container.parentElement) {\n return;\n }\n\n scrollOffsetRef.current = container.scrollHeight - container.scrollTop;\n\n if (type === 'thread') {\n setScrollOffset({ chatId, threadId, scrollOffset: scrollOffsetRef.current });\n }\n });\n });\n }, [updateStickyDates, hasTools, type, setScrollOffset, chatId, threadId]);\n\n // Container resize observer (caused by Composer reply/webpage panels)\n useEffect(() => {\n if (!('ResizeObserver' in window) || process.env.APP_ENV === 'perf') {\n return undefined;\n }\n\n const observer = new ResizeObserver(([entry]) => {\n // During animation\n if (!(entry.target as HTMLDivElement).offsetParent) {\n return;\n }\n\n setContainerHeight(entry.contentRect.height);\n });\n\n observer.observe(containerRef.current!);\n\n return () => {\n observer.disconnect();\n };\n }, []);\n\n // Memorize height for scroll animation\n const { height: windowHeight } = useWindowSize();\n\n useEffect(() => {\n if (isReady) {\n containerRef.current!.dataset.normalHeight = String(containerRef.current!.offsetHeight);\n }\n }, [windowHeight, isReady, canPost]);\n\n // Initial message loading\n useEffect(() => {\n if (!loadMoreAround || !isChatLoaded || isRestricted || focusingId) {\n return;\n }\n\n // Loading history while sending a message can return the same message and cause ambiguity\n const isFirstMessageLocal = messageIds && messageIds[0] >= LOCAL_MESSAGE_ID_BASE;\n if (isFirstMessageLocal) {\n return;\n }\n\n const container = containerRef.current!;\n\n if (!messageIds || (\n messageIds.length < MESSAGE_LIST_SLICE / 2\n && (container.firstElementChild as HTMLDivElement).clientHeight <= container.offsetHeight\n )) {\n loadMoreAround();\n }\n }, [isChatLoaded, messageIds, loadMoreAround, focusingId, isRestricted]);\n\n // Remember scroll position before repositioning it\n useOnChange(() => {\n if (!messageIds || !listItemElementsRef.current || !isReady) {\n return;\n }\n\n const preservedItemElements = listItemElementsRef.current\n .filter((element) => messageIds.includes(Number(element.dataset.messageId)));\n\n // We avoid the very first item as it may be a partly-loaded album\n // and also because it may be removed when messages limit is reached\n const anchor = preservedItemElements[1] || preservedItemElements[0];\n if (!anchor) {\n return;\n }\n\n anchorIdRef.current = anchor.id;\n anchorTopRef.current = anchor.getBoundingClientRect().top;\n // This should match deps for `useLayoutEffectWithPrevDeps` below\n }, [messageIds, isViewportNewest, containerHeight, hasTools, isReady]);\n\n // Handles updated message list, takes care of scroll repositioning\n useLayoutEffectWithPrevDeps(([\n prevMessageIds, prevIsViewportNewest, prevContainerHeight,\n ]: [\n typeof messageIds, typeof isViewportNewest, typeof containerHeight,\n ]) => {\n const container = containerRef.current!;\n listItemElementsRef.current = Array.from(container.querySelectorAll('.message-list-item'));\n\n // During animation\n if (!container.offsetParent) {\n return;\n }\n\n // Add extra height when few messages to allow smooth scroll animation. Uses assumption that `parentElement`\n // is a Transition slide and its CSS class can not be reset in a declarative way.\n const shouldForceScroll = (\n isViewportNewest\n && (messageIds && messageIds.length < MESSAGE_LIST_SLICE / 2)\n && !container.parentElement!.classList.contains('force-messages-scroll')\n && (container.firstElementChild as HTMLDivElement)!.clientHeight <= container.offsetHeight * 2\n );\n\n if (shouldForceScroll) {\n container.parentElement!.classList.add('force-messages-scroll');\n\n setTimeout(() => {\n if (container.parentElement) {\n container.parentElement.classList.remove('force-messages-scroll');\n }\n }, FOCUSING_DURATION);\n }\n\n const hasLastMessageChanged = (\n messageIds && prevMessageIds && messageIds[messageIds.length - 1] !== prevMessageIds[prevMessageIds.length - 1]\n );\n const hasViewportShifted = (\n messageIds?.[0] !== prevMessageIds?.[0] && messageIds?.length === (MESSAGE_LIST_SLICE / 2 + 1)\n );\n const wasMessageAdded = hasLastMessageChanged && !hasViewportShifted;\n const isAlreadyFocusing = messageIds && memoFocusingIdRef.current === messageIds[messageIds.length - 1];\n\n const { scrollTop, scrollHeight, offsetHeight } = container;\n const scrollOffset = scrollOffsetRef.current!;\n const lastItemElement = listItemElementsRef.current[listItemElementsRef.current.length - 1];\n\n let bottomOffset = scrollOffset - (prevContainerHeight || offsetHeight);\n if (wasMessageAdded) {\n // If two new messages come at once (e.g. when bot responds) then the first message will update `scrollOffset`\n // right away (before animation) which creates inconsistency until the animation completes. To workaround that,\n // we calculate `isAtBottom` with a \"buffer\" of the latest message height (this is approximate).\n const lastItemHeight = lastItemElement ? lastItemElement.offsetHeight : 0;\n bottomOffset -= lastItemHeight;\n }\n const isAtBottom = isViewportNewest && prevIsViewportNewest && bottomOffset <= BOTTOM_THRESHOLD;\n\n let newScrollTop!: number;\n\n if (wasMessageAdded && isAtBottom && !isAlreadyFocusing) {\n if (lastItemElement) {\n fastRaf(() => {\n fastSmoothScroll(\n container,\n lastItemElement,\n 'end',\n BOTTOM_FOCUS_MARGIN,\n );\n });\n }\n\n newScrollTop = scrollHeight - offsetHeight;\n scrollOffsetRef.current = Math.max(scrollHeight - newScrollTop, offsetHeight);\n\n // Scroll still needs to be restored after container resize\n if (!shouldForceScroll) {\n return;\n }\n }\n\n if (process.env.APP_ENV === 'perf') {\n // eslint-disable-next-line no-console\n console.time('scrollTop');\n }\n\n const isResized = prevContainerHeight !== undefined && prevContainerHeight !== containerHeight;\n const anchor = anchorIdRef.current && container.querySelector(`#${anchorIdRef.current}`);\n const unreadDivider = (\n !anchor\n && memoUnreadDividerBeforeIdRef.current\n && container.querySelector(`.${UNREAD_DIVIDER_CLASS}`)\n );\n\n if (isAtBottom && isResized) {\n if (isAnimatingScroll()) {\n return;\n }\n\n newScrollTop = scrollHeight - offsetHeight;\n } else if (anchor) {\n const newAnchorTop = anchor.getBoundingClientRect().top;\n newScrollTop = scrollTop + (newAnchorTop - (anchorTopRef.current || 0));\n } else if (unreadDivider) {\n newScrollTop = Math.min(\n unreadDivider.offsetTop - (hasTools ? UNREAD_DIVIDER_TOP_WITH_TOOLS : UNREAD_DIVIDER_TOP),\n scrollHeight - scrollOffset,\n );\n } else {\n newScrollTop = scrollHeight - scrollOffset;\n }\n\n resetScroll(container, newScrollTop);\n\n if (!memoFocusingIdRef.current) {\n isScrollTopJustUpdatedRef.current = true;\n fastRaf(() => {\n isScrollTopJustUpdatedRef.current = false;\n });\n }\n\n scrollOffsetRef.current = Math.max(scrollHeight - newScrollTop, offsetHeight);\n\n if (process.env.APP_ENV === 'perf') {\n // eslint-disable-next-line no-console\n console.timeEnd('scrollTop');\n }\n // This should match deps for `useOnChange` above\n }, [messageIds, isViewportNewest, containerHeight, hasTools]);\n\n useEffectWithPrevDeps(([prevIsSelectModeActive]) => {\n if (prevIsSelectModeActive !== undefined) {\n dispatchHeavyAnimationEvent(SELECT_MODE_ANIMATION_DURATION + ANIMATION_END_DELAY);\n }\n }, [isSelectModeActive]);\n\n const lang = useLang();\n\n const isPrivate = Boolean(chatId && isChatPrivate(chatId));\n const withUsers = Boolean((!isPrivate && !isChannelChat) || isChatWithSelf);\n const noAvatars = Boolean(!withUsers || isChannelChat);\n const shouldRenderGreeting = isChatPrivate(chatId) && !isChatWithSelf && !isBot\n && (\n (\n !messageGroups && !lastMessage && messageIds\n // Used to avoid flickering when deleting a greeting that has just been sent\n && (!listItemElementsRef.current || listItemElementsRef.current.length === 0)\n )\n || (messageIds?.length === 1 && messagesById?.[messageIds[0]]?.content.action?.type === 'contactSignUp')\n || (lastMessage?.content?.action?.type === 'contactSignUp')\n );\n\n const isGroupChatJustCreated = isGroupChat && isCreator\n && messageIds?.length === 1 && messagesById?.[messageIds[0]]?.content.action?.type === 'chatCreate';\n\n const className = buildClassName(\n 'MessageList custom-scroll',\n noAvatars && 'no-avatars',\n !canPost && 'no-composer',\n type === 'pinned' && 'type-pinned',\n isSelectModeActive && 'select-mode-active',\n isScrolled && 'scrolled',\n !isReady && 'is-animating',\n );\n\n return (\n \n {isRestricted ? (\n
\n \n {restrictionReason ? restrictionReason.text : `This is a private ${isChannelChat ? 'channel' : 'chat'}`}\n \n
\n ) : botDescription ? (\n
{renderText(lang(botDescription), ['br', 'emoji', 'links'])}
\n ) : shouldRenderGreeting ? (\n \n ) : messageIds && (!messageGroups || isGroupChatJustCreated) ? (\n \n ) : ((messageIds && messageGroups) || lastMessage) ? (\n \n ) : (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId, type }): StateProps => {\n const chat = selectChat(global, chatId);\n if (!chat) {\n return {};\n }\n\n const messageIds = selectCurrentMessageIds(global, chatId, threadId, type);\n const messagesById = type === 'scheduled'\n ? selectScheduledMessages(global, chatId)\n : selectChatMessages(global, chatId);\n const threadTopMessageId = selectThreadTopMessageId(global, chatId, threadId);\n\n if (\n threadId !== MAIN_THREAD_ID\n && !(messagesById && threadTopMessageId && messagesById[threadTopMessageId])\n ) {\n return {};\n }\n\n const { isRestricted, restrictionReason, lastMessage } = chat;\n const focusingId = selectFocusedMessageId(global, chatId);\n\n const withLastMessageWhenPreloading = (\n threadId === MAIN_THREAD_ID\n && !messageIds && !chat.unreadCount && !focusingId && lastMessage && !lastMessage.groupedId\n );\n\n const chatBot = selectChatBot(global, chatId)!;\n let botDescription: string | undefined;\n if (selectIsChatBotNotStarted(global, chatId)) {\n if (chatBot.fullInfo) {\n botDescription = chatBot.fullInfo.botDescription || 'NoMessages';\n } else {\n botDescription = 'Updating bot info...';\n }\n }\n\n return {\n isChatLoaded: true,\n isRestricted,\n restrictionReason,\n isChannelChat: isChatChannel(chat),\n isGroupChat: isChatGroup(chat),\n isCreator: chat.isCreator,\n isChatWithSelf: selectIsChatWithSelf(global, chatId),\n isBot: Boolean(chatBot),\n messageIds,\n messagesById,\n firstUnreadId: selectFirstUnreadId(global, chatId, threadId),\n isViewportNewest: type !== 'thread' || selectIsViewportNewest(global, chatId, threadId),\n threadFirstMessageId: selectFirstMessageId(global, chatId, threadId),\n focusingId,\n isSelectModeActive: selectIsInSelectMode(global),\n botDescription,\n threadTopMessageId,\n hasLinkedChat: chat.fullInfo && ('linkedChatId' in chat.fullInfo)\n ? Boolean(chat.fullInfo.linkedChatId)\n : undefined,\n ...(withLastMessageWhenPreloading && { lastMessage }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadViewportMessages',\n 'setScrollOffset',\n 'openHistoryCalendar',\n ]),\n)(MessageList));\n","import { useCallback } from '../../../lib/teact/teact';\n\nimport { fastRaf } from '../../../util/schedulers';\nimport useDebounce from '../../../hooks/useDebounce';\nimport useFlag from '../../../hooks/useFlag';\n\nconst DEBOUNCE = 1000;\nconst STICKY_TOP = 10;\nconst STICKY_TOP_WITH_TOOLS = 60;\n\nexport default function useStickyDates() {\n // For some reason we can not synchronously hide a sticky element (from `useLayoutEffect`) when chat opens\n // so we will add `position: sticky` only after first scroll. There would be no animation on the first show though.\n const [isScrolled, markIsScrolled] = useFlag(false);\n\n const runDebounced = useDebounce(DEBOUNCE, false);\n\n const updateStickyDates = useCallback((container: HTMLDivElement, hasTools?: boolean) => {\n markIsScrolled();\n\n if (!document.body.classList.contains('is-scrolling-messages')) {\n fastRaf(() => {\n document.body.classList.add('is-scrolling-messages');\n });\n }\n\n runDebounced(() => {\n fastRaf(() => {\n const currentStuck = document.querySelector('.stuck');\n if (currentStuck) {\n currentStuck.classList.remove('stuck');\n }\n\n const stuckDateEl = findStuckDate(container, hasTools);\n if (stuckDateEl) {\n stuckDateEl.classList.add('stuck');\n }\n\n document.body.classList.remove('is-scrolling-messages');\n });\n });\n }, [markIsScrolled, runDebounced]);\n\n return {\n isScrolled,\n updateStickyDates,\n };\n}\n\nfunction findStuckDate(container: HTMLElement, hasTools?: boolean) {\n const allElements = container.querySelectorAll('.sticky-date');\n const containerTop = container.scrollTop;\n\n return Array.from(allElements).find((el) => {\n const { offsetTop, offsetHeight } = el;\n const top = offsetTop - containerTop;\n return -offsetHeight <= top && top <= (hasTools ? STICKY_TOP_WITH_TOOLS : STICKY_TOP);\n });\n}\n","import { useMemo } from '../lib/teact/teact';\n\nimport { debounce } from '../util/schedulers';\n\nexport default function useDebounce(ms: number, shouldRunFirst?: boolean, shouldRunLast?: boolean) {\n return useMemo(() => {\n return debounce((cb) => cb(), ms, shouldRunFirst, shouldRunLast);\n }, [ms, shouldRunFirst, shouldRunLast]);\n}\n","import React, {\n FC, useCallback, memo, useRef,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, MessageListType } from '../../global/types';\nimport { MAIN_THREAD_ID } from '../../api/types';\n\nimport { selectChat, selectCurrentMessageList } from '../../modules/selectors';\nimport { formatIntegerCompact } from '../../util/textFormat';\nimport buildClassName from '../../util/buildClassName';\nimport { pick } from '../../util/iteratees';\nimport fastSmoothScroll from '../../util/fastSmoothScroll';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\n\nimport './ScrollDownButton.scss';\n\ntype OwnProps = {\n isShown: boolean;\n canPost?: boolean;\n withExtraShift?: boolean;\n};\n\ntype StateProps = {\n messageListType?: MessageListType;\n unreadCount?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst FOCUS_MARGIN = 20;\n\nconst ScrollDownButton: FC = ({\n isShown,\n canPost,\n messageListType,\n unreadCount,\n withExtraShift,\n focusNextReply,\n}) => {\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const elementRef = useRef(null);\n\n const handleClick = useCallback(() => {\n if (!isShown) {\n return;\n }\n\n if (messageListType === 'thread') {\n focusNextReply();\n } else {\n const messagesContainer = elementRef.current!.parentElement!.querySelector('.MessageList')!;\n const messageElements = messagesContainer.querySelectorAll('.message-list-item');\n const lastMessageElement = messageElements[messageElements.length - 1];\n if (!lastMessageElement) {\n return;\n }\n\n fastSmoothScroll(messagesContainer, lastMessageElement, 'end', FOCUS_MARGIN);\n }\n }, [isShown, messageListType, focusNextReply]);\n\n const fabClassName = buildClassName(\n 'ScrollDownButton',\n isShown && 'revealed',\n !canPost && 'no-composer',\n withExtraShift && 'with-extra-shift',\n );\n\n return (\n
\n
\n \n \n \n {Boolean(unreadCount) && (\n
{formatIntegerCompact(unreadCount!)}
\n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return {};\n }\n\n const { chatId, threadId, type: messageListType } = currentMessageList;\n const chat = selectChat(global, chatId);\n\n return {\n messageListType,\n unreadCount: chat && threadId === MAIN_THREAD_ID && messageListType === 'thread' ? chat.unreadCount : undefined,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['focusNextReply']),\n)(ScrollDownButton));\n","import { ApiAttachment } from '../../../../api/types';\nimport { preloadImage, preloadVideo, createPosterForVideo } from '../../../../util/files';\n\nconst MAX_QUICK_VIDEO_SIZE = 10 * 1024 ** 2; // 10 MB\nconst MAX_QUICK_IMG_SIZE = 1280; // px\n\nexport default async function buildAttachment(\n filename: string, blob: Blob, isQuick: boolean, options?: Partial,\n): Promise {\n const blobUrl = URL.createObjectURL(blob);\n const { type: mimeType, size } = blob;\n let quick;\n let previewBlobUrl;\n\n if (mimeType.startsWith('image/')) {\n if (isQuick) {\n const img = await preloadImage(blobUrl);\n const { width, height } = img;\n\n if (width > MAX_QUICK_IMG_SIZE || height > MAX_QUICK_IMG_SIZE || mimeType !== 'image/jpeg') {\n const newBlob = await squeezeImage(img);\n if (newBlob) {\n URL.revokeObjectURL(blobUrl);\n return buildAttachment(filename, newBlob, true, options);\n } else {\n return buildAttachment(filename, blob, false, options);\n }\n }\n\n quick = { width, height };\n } else {\n previewBlobUrl = blobUrl;\n }\n } else if (mimeType.startsWith('video/')) {\n // Videos < 10 MB are always sent in quick mode (in other clients).\n // Quick mode for videos > 10 MB is not supported until client-side video squeezing is implemented.\n if (size < MAX_QUICK_VIDEO_SIZE) {\n const { videoWidth: width, videoHeight: height, duration } = await preloadVideo(blobUrl);\n quick = { width, height, duration };\n }\n\n previewBlobUrl = await createPosterForVideo(blobUrl);\n }\n\n return {\n blobUrl,\n filename,\n mimeType,\n size,\n quick,\n previewBlobUrl,\n ...options,\n };\n}\n\nfunction squeezeImage(img: HTMLImageElement): Promise {\n return new Promise((resolve) => {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d')!;\n\n let { width, height } = img;\n\n if (width > MAX_QUICK_IMG_SIZE || height > MAX_QUICK_IMG_SIZE) {\n if (width >= height) {\n height *= MAX_QUICK_IMG_SIZE / width;\n width = MAX_QUICK_IMG_SIZE;\n } else {\n width *= MAX_QUICK_IMG_SIZE / height;\n height = MAX_QUICK_IMG_SIZE;\n }\n }\n\n canvas.width = width;\n canvas.height = height;\n\n ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, width, height);\n canvas.toBlob(resolve, 'image/jpeg', 100);\n });\n}\n","import { IS_IOS } from '../../../../util/environment';\n\nlet resetInput: HTMLInputElement;\n\nif (IS_IOS) {\n resetInput = document.createElement('input');\n resetInput.classList.add('for-ios-autocapitalization-fix');\n document.body.appendChild(resetInput);\n}\n\n// https://stackoverflow.com/a/55652503\nexport default function applyIosAutoCapitalizationFix(inputEl: HTMLElement) {\n resetInput.focus();\n inputEl.focus();\n}\n","export default __webpack_public_path__ + \"c0155344d336103c2b6a0b28cc510750.js\";","// @ts-ignore\nimport encoderPath from 'file-loader!opus-recorder/dist/encoderWorker.min';\n\nexport type Result = { blob: Blob; duration: number; waveform: number[] };\n\ninterface IOpusRecorder extends Omit {\n new(options: AnyLiteral): IOpusRecorder;\n\n start(stream?: MediaStreamAudioSourceNode): void;\n\n sourceNode: MediaStreamAudioSourceNode;\n\n ondataavailable: (typedArray: Uint8Array) => void;\n}\n\nconst MIN_RECORDING_TIME = 1000;\nconst POLYFILL_OPTIONS = { encoderPath, reuseWorker: true };\nconst BLOB_PARAMS = { type: 'audio/ogg' };\nconst FFT_SIZE = 64;\nconst MIN_VOLUME = 0.1;\n\nlet opusRecorderPromise: Promise<{ default: IOpusRecorder }>;\nlet OpusRecorder: IOpusRecorder;\nlet mediaRecorder: IOpusRecorder;\n\nexport async function init() {\n if (!opusRecorderPromise) {\n // @ts-ignore\n opusRecorderPromise = import('opus-recorder');\n OpusRecorder = (await opusRecorderPromise).default;\n mediaRecorder = new OpusRecorder(POLYFILL_OPTIONS);\n }\n\n return opusRecorderPromise;\n}\n\nexport async function start(analyzerCallback: Function) {\n await startMediaRecorder();\n\n const startedAt = Date.now();\n let pausedAt: number;\n const chunks: Uint8Array[] = [];\n const waveform: number[] = [];\n\n mediaRecorder.ondataavailable = (typedArray) => {\n chunks.push(typedArray);\n };\n\n const releaseAnalyzer = subscribeToAnalyzer(mediaRecorder, (volume: number) => {\n waveform.push(volume * 255);\n analyzerCallback(volume);\n });\n\n return {\n stop: () => new Promise((resolve, reject) => {\n mediaRecorder.onstop = () => {\n resolve({\n blob: new Blob(chunks, BLOB_PARAMS),\n duration: Math.round(((pausedAt || Date.now()) - startedAt) / 1000),\n waveform,\n });\n };\n mediaRecorder.onerror = reject;\n\n const delayStop = Math.max(0, startedAt + MIN_RECORDING_TIME - Date.now());\n setTimeout(() => {\n mediaRecorder.stop();\n releaseAnalyzer();\n }, delayStop);\n }),\n pause: () => {\n const delayStop = Math.max(0, startedAt + MIN_RECORDING_TIME - Date.now());\n setTimeout(() => {\n mediaRecorder.pause();\n pausedAt = Date.now();\n releaseAnalyzer();\n }, delayStop);\n },\n };\n}\n\nasync function startMediaRecorder() {\n await init();\n await mediaRecorder.start();\n}\n\nfunction subscribeToAnalyzer(recorder: IOpusRecorder, cb: Function) {\n const source = recorder.sourceNode;\n const analyser = source.context.createAnalyser();\n analyser.fftSize = FFT_SIZE;\n source.connect(analyser);\n\n const dataLength = analyser.frequencyBinCount;\n const dataArray = new Uint8Array(dataLength);\n let isDestroyed = false;\n\n function tick() {\n if (isDestroyed) {\n return;\n }\n\n analyser.getByteFrequencyData(dataArray);\n\n const sum = dataArray.reduce((acc, current) => acc + current, 0);\n const mean = (sum / dataLength);\n const volume = mean / 255;\n\n cb(volume < MIN_VOLUME ? 0 : volume);\n\n requestAnimationFrame(tick);\n }\n\n tick();\n\n return () => {\n isDestroyed = true;\n };\n}\n","import {\n useCallback, useEffect, useRef, useState,\n} from '../../../../lib/teact/teact';\n\nimport { IS_IOS, IS_VOICE_RECORDING_SUPPORTED } from '../../../../util/environment';\nimport * as voiceRecording from '../../../../util/voiceRecording';\nimport captureEscKeyListener from '../../../../util/captureEscKeyListener';\n\ntype ActiveVoiceRecording = { stop: () => Promise; pause: NoneToVoidFunction } | undefined;\n\nexport default () => {\n // eslint-disable-next-line no-null/no-null\n const recordButtonRef = useRef(null);\n const [activeVoiceRecording, setActiveVoiceRecording] = useState();\n const startRecordTimeRef = useRef();\n const [currentRecordTime, setCurrentRecordTime] = useState();\n\n useEffect(() => {\n // Preloading worker fixes silent first record on iOS\n if (IS_IOS && IS_VOICE_RECORDING_SUPPORTED) {\n void voiceRecording.init();\n }\n }, []);\n\n const startRecordingVoice = useCallback(async () => {\n try {\n const { stop, pause } = await voiceRecording.start((tickVolume: number) => {\n if (recordButtonRef.current) {\n if (startRecordTimeRef.current && Date.now() % 4 === 0) {\n recordButtonRef.current.style.boxShadow = `0 0 0 ${(tickVolume || 0) * 50}px rgba(0,0,0,.15)`;\n }\n setCurrentRecordTime(Date.now());\n }\n });\n startRecordTimeRef.current = Date.now();\n setCurrentRecordTime(Date.now());\n\n setActiveVoiceRecording({ stop, pause });\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n }, []);\n\n const pauseRecordingVoice = useCallback(() => {\n if (!activeVoiceRecording) {\n return undefined;\n }\n\n if (recordButtonRef.current) {\n recordButtonRef.current.style.boxShadow = 'none';\n }\n\n try {\n return activeVoiceRecording!.pause();\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n return undefined;\n }\n }, [activeVoiceRecording]);\n\n const stopRecordingVoice = useCallback(() => {\n if (!activeVoiceRecording) {\n return undefined;\n }\n\n setActiveVoiceRecording(undefined);\n startRecordTimeRef.current = undefined;\n setCurrentRecordTime(undefined);\n if (recordButtonRef.current) {\n recordButtonRef.current.style.boxShadow = 'none';\n }\n try {\n return activeVoiceRecording!.stop();\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n return undefined;\n }\n }, [activeVoiceRecording]);\n\n useEffect(() => {\n return activeVoiceRecording ? captureEscKeyListener(stopRecordingVoice) : undefined;\n }, [activeVoiceRecording, stopRecordingVoice]);\n\n return {\n startRecordingVoice,\n pauseRecordingVoice,\n stopRecordingVoice,\n activeVoiceRecording,\n currentRecordTime,\n recordButtonRef,\n startRecordTimeRef,\n };\n};\n","import { StateHookSetter, useEffect } from '../../../../lib/teact/teact';\nimport { ApiAttachment, ApiMessage } from '../../../../api/types';\n\nimport buildAttachment from '../helpers/buildAttachment';\nimport { EDITABLE_INPUT_ID, EDITABLE_INPUT_MODAL_ID } from '../../../../config';\n\nconst CLIPBOARD_ACCEPTED_TYPES = ['image/png', 'image/jpeg', 'image/gif'];\nconst MAX_MESSAGE_LENGTH = 4096;\n\nexport default (\n insertTextAndUpdateCursor: (text: string, inputId?: string) => void,\n setAttachments: StateHookSetter,\n editedMessage: ApiMessage | undefined,\n) => {\n useEffect(() => {\n async function handlePaste(e: ClipboardEvent) {\n if (!e.clipboardData) {\n return;\n }\n\n const input = document.activeElement;\n if (input && ![EDITABLE_INPUT_ID, EDITABLE_INPUT_MODAL_ID].includes(input.id)) {\n return;\n }\n\n const { items } = e.clipboardData;\n const media = Array.from(items).find((item) => CLIPBOARD_ACCEPTED_TYPES.includes(item.type));\n const file = media && media.getAsFile();\n const pastedText = e.clipboardData.getData('text').substring(0, MAX_MESSAGE_LENGTH);\n\n if (!file && !pastedText) {\n return;\n }\n\n e.preventDefault();\n\n if (file && !editedMessage) {\n const attachment = await buildAttachment(file.name, file, true);\n setAttachments((attachments) => [\n ...attachments,\n attachment,\n ]);\n }\n\n if (pastedText) {\n insertTextAndUpdateCursor(pastedText, input?.id);\n }\n }\n\n document.addEventListener('paste', handlePaste, false);\n\n return () => {\n document.removeEventListener('paste', handlePaste, false);\n };\n }, [insertTextAndUpdateCursor, editedMessage, setAttachments]);\n};\n","import { ApiFormattedText } from '../../../../api/types';\nimport { renderTextWithEntities } from '../../../common/helpers/renderMessageText';\n\nexport default function getMessageTextAsHtml(formattedText?: ApiFormattedText) {\n const { text, entities } = formattedText || {};\n if (!text) {\n return '';\n }\n\n const result = renderTextWithEntities(\n text,\n entities,\n undefined,\n undefined,\n true,\n );\n\n if (Array.isArray(result)) {\n return result.join('');\n }\n\n return result;\n}\n","import { useCallback, useEffect, useMemo } from '../../../../lib/teact/teact';\n\nimport { ApiFormattedText, ApiMessage } from '../../../../api/types';\nimport { GlobalActions } from '../../../../global/types';\n\nimport { DRAFT_DEBOUNCE, EDITABLE_INPUT_ID } from '../../../../config';\nimport usePrevious from '../../../../hooks/usePrevious';\nimport { debounce } from '../../../../util/schedulers';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport parseMessageInput from '../helpers/parseMessageInput';\nimport getMessageTextAsHtml from '../helpers/getMessageTextAsHtml';\nimport useBackgroundMode from '../../../../hooks/useBackgroundMode';\nimport useBeforeUnload from '../../../../hooks/useBeforeUnload';\nimport { IS_TOUCH_ENV } from '../../../../util/environment';\n\n// Used to avoid running debounced callbacks when chat changes.\nlet currentChatId: number | undefined;\nlet currentThreadId: number | undefined;\n\nexport default (\n draft: ApiFormattedText | undefined,\n chatId: number,\n threadId: number,\n html: string,\n htmlRef: { current: string },\n setHtml: (html: string) => void,\n editedMessage: ApiMessage | undefined,\n saveDraft: GlobalActions['saveDraft'],\n clearDraft: GlobalActions['clearDraft'],\n) => {\n const updateDraft = useCallback((draftChatId: number, draftThreadId: number) => {\n if (htmlRef.current.length && !editedMessage) {\n saveDraft({ chatId: draftChatId, threadId: draftThreadId, draft: parseMessageInput(htmlRef.current!) });\n } else {\n clearDraft({ chatId: draftChatId, threadId: draftThreadId });\n }\n }, [clearDraft, editedMessage, htmlRef, saveDraft]);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const runDebouncedForSaveDraft = useMemo(() => debounce((cb) => cb(), DRAFT_DEBOUNCE, false), [chatId]);\n\n const prevChatId = usePrevious(chatId);\n const prevThreadId = usePrevious(threadId);\n\n // Save draft on chat change\n useEffect(() => {\n currentChatId = chatId;\n currentThreadId = threadId;\n\n return () => {\n currentChatId = undefined;\n currentThreadId = undefined;\n\n updateDraft(chatId, threadId);\n };\n }, [chatId, threadId, updateDraft]);\n\n // Restore draft on chat change\n useEffect(() => {\n if (chatId === prevChatId && threadId === prevThreadId) {\n return;\n }\n\n if (!draft) {\n return;\n }\n\n setHtml(getMessageTextAsHtml(draft));\n\n if (!IS_TOUCH_ENV) {\n requestAnimationFrame(() => {\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n focusEditableElement(messageInput, true);\n });\n }\n }, [chatId, threadId, draft, setHtml, updateDraft, prevChatId, prevThreadId]);\n\n // Update draft when input changes\n const prevHtml = usePrevious(html);\n useEffect(() => {\n if (!chatId || !threadId || prevChatId !== chatId || prevThreadId !== threadId || prevHtml === html) {\n return;\n }\n\n if (html.length) {\n runDebouncedForSaveDraft(() => {\n if (currentChatId !== chatId || currentThreadId !== threadId) {\n return;\n }\n\n updateDraft(chatId, threadId);\n });\n } else {\n updateDraft(chatId, threadId);\n }\n }, [chatId, html, prevChatId, prevHtml, prevThreadId, runDebouncedForSaveDraft, threadId, updateDraft]);\n\n const handleBlur = useCallback(() => {\n if (chatId && threadId) {\n updateDraft(chatId, threadId);\n }\n }, [chatId, threadId, updateDraft]);\n\n useBackgroundMode(handleBlur);\n useBeforeUnload(handleBlur);\n};\n","import { useCallback, useEffect } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\nimport { InlineBotSettings } from '../../../../types';\nimport useFlag from '../../../../hooks/useFlag';\nimport usePrevious from '../../../../hooks/usePrevious';\n\nconst tempEl = document.createElement('div');\nconst INLINE_BOT_QUERY_REGEXP = /^@([a-z0-9_]{1,32})[\\u00A0\\u0020]+(.*)/i;\nconst HAS_NEW_LINE = /^@([a-z0-9_]{1,32})[\\u00A0\\u0020]+\\n{2,}/i;\n\nexport default function useInlineBotTooltip(\n isAllowed: boolean,\n chatId: number,\n html: string,\n inlineBots?: Record,\n) {\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n const text = getPlainText(html);\n const { queryInlineBot, resetInlineBot } = getDispatch();\n const { username, query, canShowHelp } = parseStartWithUsernameString(text);\n const usernameLowered = username.toLowerCase();\n const prevQuery = usePrevious(query);\n const prevUsername = usePrevious(username);\n const inlineBotData = inlineBots?.[usernameLowered];\n const {\n id: botId,\n switchPm,\n offset,\n results,\n isGallery,\n help,\n } = inlineBotData || {};\n\n useEffect(() => {\n if (prevQuery !== query) {\n unmarkIsOpen();\n }\n }, [prevQuery, query, unmarkIsOpen]);\n\n useEffect(() => {\n if (isAllowed && usernameLowered && chatId) {\n queryInlineBot({ chatId, username: usernameLowered, query });\n }\n }, [query, isAllowed, queryInlineBot, chatId, usernameLowered]);\n\n const loadMore = useCallback(() => {\n queryInlineBot({\n chatId, username: usernameLowered, query, offset,\n });\n }, [offset, chatId, query, queryInlineBot, usernameLowered]);\n\n useEffect(() => {\n if (isAllowed && botId && (switchPm || (results?.length))) {\n markIsOpen();\n } else {\n unmarkIsOpen();\n }\n }, [botId, isAllowed, markIsOpen, results, switchPm, unmarkIsOpen]);\n\n if (prevUsername !== username) {\n resetInlineBot({ username: prevUsername });\n }\n\n return {\n isOpen,\n closeTooltip: unmarkIsOpen,\n loadMore,\n username,\n id: botId,\n isGallery,\n switchPm,\n results,\n help: canShowHelp && help ? `@${username} ${help}` : undefined,\n };\n}\n\nfunction getPlainText(html: string) {\n tempEl.innerHTML = html.replace(/
/g, '\\n');\n\n return tempEl.innerText;\n}\n\nfunction parseStartWithUsernameString(text: string) {\n const result = text.match(INLINE_BOT_QUERY_REGEXP);\n if (!result) {\n return { username: '', query: '', canShowHelp: false };\n }\n\n return {\n username: result[1],\n query: result[2],\n canShowHelp: result[2] === '' && !text.match(HAS_NEW_LINE),\n };\n}\n","import {\n useCallback, useEffect, useState,\n} from '../../../../lib/teact/teact';\n\nimport { ApiBotCommand } from '../../../../api/types';\n\nimport { prepareForRegExp } from '../helpers/prepareForRegExp';\nimport { throttle } from '../../../../util/schedulers';\nimport useFlag from '../../../../hooks/useFlag';\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\nconst RE_COMMAND = /^[\\w@]{1,32}\\s?/i;\n\nexport default function useBotCommandTooltip(\n isAllowed: boolean,\n html: string,\n botCommands?: ApiBotCommand[] | false,\n chatBotCommands?: ApiBotCommand[],\n) {\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n const [filteredBotCommands, setFilteredBotCommands] = useState();\n\n const getFilteredCommands = useCallback((filter) => {\n if (!botCommands && !chatBotCommands) {\n setFilteredBotCommands(undefined);\n\n return;\n }\n\n runThrottled(() => {\n const nextFilteredBotCommands = (botCommands || chatBotCommands || [])\n .filter(({ command }) => !filter || command.includes(filter));\n setFilteredBotCommands(\n nextFilteredBotCommands && nextFilteredBotCommands.length ? nextFilteredBotCommands : undefined,\n );\n });\n }, [botCommands, chatBotCommands]);\n\n useEffect(() => {\n if (!isAllowed || !html.length) {\n unmarkIsOpen();\n return;\n }\n\n const shouldShowCommands = html.startsWith('/');\n\n if (shouldShowCommands) {\n const filter = prepareForRegExp(html.substr(1)).match(RE_COMMAND);\n getFilteredCommands(filter ? filter[0] : '');\n } else {\n unmarkIsOpen();\n }\n }, [getFilteredCommands, html, isAllowed, unmarkIsOpen]);\n\n useEffect(() => {\n if (filteredBotCommands && filteredBotCommands.length) {\n markIsOpen();\n } else {\n unmarkIsOpen();\n }\n }, [filteredBotCommands, markIsOpen, unmarkIsOpen]);\n\n return {\n isOpen,\n close: unmarkIsOpen,\n filteredBotCommands,\n };\n}\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './DeleteMessageModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst DeleteMessageModalAsync: FC = (props) => {\n const { isOpen } = props;\n const DeleteMessageModal = useModuleLoader(Bundles.Extra, 'DeleteMessageModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return DeleteMessageModal ? : undefined;\n};\n\nexport default memo(DeleteMessageModalAsync);\n","import React, {\n FC, useRef, useCallback, memo,\n} from '../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\n\nimport Button, { OwnProps as ButtonProps } from './Button';\n\ntype OwnProps = {\n onActivate: NoneToVoidFunction;\n} & Omit;\n\nconst BUTTON_ACTIVATE_DELAY = 200;\nlet openTimeout: number | undefined;\nlet isFirstTimeActivation = true;\n\nconst ResponsiveHoverButton: FC = ({ onActivate, ...buttonProps }) => {\n const isMouseInside = useRef(false);\n\n const handleMouseEnter = useCallback(() => {\n isMouseInside.current = true;\n\n // This is used to counter additional delay caused by asynchronous module loading\n if (isFirstTimeActivation) {\n isFirstTimeActivation = false;\n onActivate();\n return;\n }\n\n if (openTimeout) {\n clearTimeout(openTimeout);\n openTimeout = undefined;\n }\n openTimeout = window.setTimeout(() => {\n if (isMouseInside.current) {\n onActivate();\n }\n }, BUTTON_ACTIVATE_DELAY);\n }, [onActivate]);\n\n const handleMouseLeave = useCallback(() => {\n isMouseInside.current = false;\n }, []);\n\n return (\n \n );\n};\n\nexport default memo(ResponsiveHoverButton);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './AttachMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst AttachMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const AttachMenu = useModuleLoader(Bundles.Extra, 'AttachMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return AttachMenu ? : undefined;\n};\n\nexport default memo(AttachMenuAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './SymbolMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst SymbolMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const SymbolMenu = useModuleLoader(Bundles.Extra, 'SymbolMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return SymbolMenu ? : undefined;\n};\n\nexport default memo(SymbolMenuAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './InlineBotTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst InlineBotTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const InlineBotTooltip = useModuleLoader(Bundles.Extra, 'InlineBotTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return InlineBotTooltip ? : undefined;\n};\n\nexport default memo(InlineBotTooltipAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './MentionTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst MentionTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const MentionTooltip = useModuleLoader(Bundles.Extra, 'MentionTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return MentionTooltip ? : undefined;\n};\n\nexport default memo(MentionTooltipAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './CustomSendMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst CustomSendMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const CustomSend = useModuleLoader(Bundles.Extra, 'CustomSendMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return CustomSend ? : undefined;\n};\n\nexport default memo(CustomSendMenuAsync);\n","import React, { FC } from '../../../lib/teact/teact';\nimport { OwnProps } from './StickerTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst StickerTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const StickerTooltip = useModuleLoader(Bundles.Extra, 'StickerTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return StickerTooltip ? : undefined;\n};\n\nexport default StickerTooltipAsync;\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './BotCommandTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst BotCommandTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const BotCommandTooltip = useModuleLoader(Bundles.Extra, 'BotCommandTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return BotCommandTooltip ? : undefined;\n};\n\nexport default memo(BotCommandTooltipAsync);\n","import React, { FC, memo, useEffect } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiMessage } from '../../../api/types';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\nimport { selectChatMessage, selectCurrentMessageList } from '../../../modules/selectors';\nimport useMouseInside from '../../../hooks/useMouseInside';\nimport useFlag from '../../../hooks/useFlag';\n\nimport Menu from '../../ui/Menu';\nimport Button from '../../ui/Button';\n\nimport './BotKeyboardMenu.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n messageId: number;\n onClose: NoneToVoidFunction;\n};\n\ntype StateProps = {\n message?: ApiMessage;\n};\n\ntype DispatchProps = Pick;\n\nconst BotKeyboardMenu: FC = ({\n isOpen, message, onClose, clickInlineButton,\n}) => {\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose);\n const { isKeyboardSingleUse } = message || {};\n const [forceOpen, markForceOpen, unmarkForceOpen] = useFlag(true);\n\n const handleClose = () => {\n unmarkForceOpen();\n onClose();\n };\n\n useEffect(() => {\n markForceOpen();\n }, [markForceOpen, message]);\n\n if (!message || !message.keyboardButtons) {\n return undefined;\n }\n\n return (\n \n
\n {message.keyboardButtons.map((row) => (\n
\n {row.map((button) => (\n clickInlineButton({ button })}\n >\n {button.text}\n \n ))}\n
\n ))}\n
\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { messageId }): StateProps => {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return {};\n }\n\n return { message: selectChatMessage(global, chatId, messageId) };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'clickInlineButton',\n ]),\n)(BotKeyboardMenu));\n","import React, {\n FC, memo, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiMessage, ApiUser } from '../../../api/types';\n\nimport {\n selectChat,\n selectChatMessage,\n selectSender,\n selectForwardedSender,\n selectUser,\n selectCurrentMessageList,\n selectReplyingToId,\n selectEditingId,\n selectEditingScheduledId,\n selectEditingMessage,\n} from '../../../modules/selectors';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport { pick } from '../../../util/iteratees';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\nimport { isChatPrivate } from '../../../modules/helpers';\n\nimport Button from '../../ui/Button';\nimport EmbeddedMessage from '../../common/EmbeddedMessage';\n\nimport './ComposerEmbeddedMessage.scss';\n\ntype StateProps = {\n replyingToId?: number;\n editingId?: number;\n message?: ApiMessage;\n sender?: ApiUser | ApiChat;\n shouldAnimate?: boolean;\n forwardedMessagesCount?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst FORWARD_RENDERING_DELAY = 300;\n\nconst ComposerEmbeddedMessage: FC = ({\n replyingToId,\n editingId,\n message,\n sender,\n shouldAnimate,\n forwardedMessagesCount,\n setReplyingToId,\n setEditingId,\n focusMessage,\n exitForwardMode,\n}) => {\n const isShown = Boolean(\n ((replyingToId || editingId) && message)\n || (sender && forwardedMessagesCount),\n );\n const canAnimate = useAsyncRendering(\n [forwardedMessagesCount],\n forwardedMessagesCount ? FORWARD_RENDERING_DELAY : undefined,\n );\n\n const {\n shouldRender, transitionClassNames,\n } = useShowTransition(canAnimate && isShown, undefined, !shouldAnimate, undefined, !shouldAnimate);\n\n const clearEmbedded = useCallback(() => {\n if (replyingToId) {\n setReplyingToId({ messageId: undefined });\n } else if (editingId) {\n setEditingId({ messageId: undefined });\n } else if (forwardedMessagesCount) {\n exitForwardMode();\n }\n }, [replyingToId, editingId, forwardedMessagesCount, setReplyingToId, setEditingId, exitForwardMode]);\n\n useEffect(() => (isShown ? captureEscKeyListener(clearEmbedded) : undefined), [isShown, clearEmbedded]);\n\n const handleMessageClick = useCallback((): void => {\n focusMessage({ chatId: message!.chatId, messageId: message!.id });\n }, [focusMessage, message]);\n\n const className = buildClassName('ComposerEmbeddedMessage', transitionClassNames);\n\n const customText = forwardedMessagesCount && forwardedMessagesCount > 1\n ? `${forwardedMessagesCount} forwarded messages`\n : undefined;\n\n if (!shouldRender) {\n return undefined;\n }\n\n return (\n
\n
\n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { chatId, threadId, type: messageListType } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId || !messageListType) {\n return {};\n }\n\n const {\n currentUserId,\n forwardMessages: { fromChatId, toChatId, messageIds: forwardMessageIds },\n } = global;\n\n const replyingToId = selectReplyingToId(global, chatId, threadId);\n const editingId = messageListType === 'scheduled'\n ? selectEditingScheduledId(global, chatId)\n : selectEditingId(global, chatId, threadId);\n const shouldAnimate = global.settings.byKey.animationLevel >= 1;\n const isForwarding = toChatId === chatId;\n\n let message;\n if (replyingToId) {\n message = selectChatMessage(global, chatId, replyingToId);\n } else if (editingId) {\n message = selectEditingMessage(global, chatId, threadId, messageListType);\n } else if (isForwarding && forwardMessageIds!.length === 1) {\n message = selectChatMessage(global, fromChatId!, forwardMessageIds![0]);\n }\n\n let sender: ApiChat | ApiUser | undefined;\n if (replyingToId && message) {\n const { forwardInfo } = message;\n const isChatWithSelf = chatId === currentUserId;\n\n if (forwardInfo && (forwardInfo.isChannelPost || isChatWithSelf)) {\n sender = selectForwardedSender(global, message);\n }\n\n if (!sender) {\n sender = selectSender(global, message);\n }\n } else if (isForwarding) {\n sender = isChatPrivate(fromChatId!) ? selectUser(global, fromChatId!) : selectChat(global, fromChatId!);\n }\n\n return {\n replyingToId,\n editingId,\n message,\n sender,\n shouldAnimate,\n forwardedMessagesCount: isForwarding ? forwardMessageIds!.length : undefined,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setReplyingToId',\n 'setEditingId',\n 'focusMessage',\n 'exitForwardMode',\n ]),\n)(ComposerEmbeddedMessage));\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './AttachmentModal';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst AttachmentModalAsync: FC = (props) => {\n const { attachments } = props;\n const AttachmentModal = useModuleLoader(Bundles.Extra, 'AttachmentModal', !attachments.length);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return AttachmentModal ? : undefined;\n};\n\nexport default memo(AttachmentModalAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './BotCommandMenu';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst BotCommandMenuAsync: FC = (props) => {\n const { isOpen } = props;\n const BotCommandMenu = useModuleLoader(Bundles.Extra, 'BotCommandMenu', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return BotCommandMenu ? : undefined;\n};\n\nexport default memo(BotCommandMenuAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './PollModal';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst PollModalAsync: FC = (props) => {\n const { isOpen } = props;\n const PollModal = useModuleLoader(Bundles.Extra, 'PollModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return PollModal ? : undefined;\n};\n\nexport default memo(PollModalAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './DropArea';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst DropAreaAsync: FC = (props) => {\n const { isOpen } = props;\n const DropArea = useModuleLoader(Bundles.Extra, 'DropArea', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return DropArea ? : undefined;\n};\n\nexport default memo(DropAreaAsync);\nexport { DropAreaState } from './DropArea';\n","import React, {\n FC, memo, useEffect, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiMessage, ApiMessageEntityTypes, ApiWebPage } from '../../../api/types';\n\nimport { RE_LINK_TEMPLATE } from '../../../config';\nimport { selectNoWebPage } from '../../../modules/selectors';\nimport { pick } from '../../../util/iteratees';\nimport parseMessageInput from './helpers/parseMessageInput';\nimport useOnChange from '../../../hooks/useOnChange';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useCurrentOrPrev from '../../../hooks/useCurrentOrPrev';\nimport buildClassName from '../../../util/buildClassName';\n\nimport WebPage from '../message/WebPage';\nimport Button from '../../ui/Button';\n\nimport './WebPagePreview.scss';\n\ntype OwnProps = {\n chatId: number;\n threadId: number;\n messageText: string;\n disabled?: boolean;\n};\n\ntype StateProps = {\n webPagePreview?: ApiWebPage;\n noWebPage?: boolean;\n};\ntype DispatchProps = Pick;\n\nconst RE_LINK = new RegExp(RE_LINK_TEMPLATE, 'i');\n\nconst WebPagePreview: FC = ({\n chatId,\n threadId,\n messageText,\n disabled,\n webPagePreview,\n noWebPage,\n loadWebPagePreview,\n clearWebPagePreview,\n toggleMessageWebPage,\n}) => {\n const link = useMemo(() => {\n const { text, entities } = parseMessageInput(messageText);\n\n const linkEntity = entities && entities.find(({ type }) => type === ApiMessageEntityTypes.TextUrl);\n if (linkEntity) {\n return linkEntity.url;\n }\n\n const textMatch = text.match(RE_LINK);\n if (textMatch) {\n return textMatch[0];\n }\n\n return undefined;\n }, [messageText]);\n\n useEffect(() => {\n if (link) {\n loadWebPagePreview({ text: link });\n } else {\n clearWebPagePreview();\n toggleMessageWebPage({ chatId, threadId });\n }\n }, [chatId, toggleMessageWebPage, clearWebPagePreview, link, loadWebPagePreview, threadId]);\n\n useOnChange(() => {\n clearWebPagePreview();\n toggleMessageWebPage({ chatId, threadId });\n }, [chatId]);\n\n const isShown = Boolean(webPagePreview && messageText.length && !noWebPage && !disabled);\n const { shouldRender, transitionClassNames } = useShowTransition(isShown);\n\n const renderingWebPage = useCurrentOrPrev(webPagePreview);\n\n if (!shouldRender || !renderingWebPage) {\n return undefined;\n }\n\n const handleClearWebpagePreview = () => {\n toggleMessageWebPage({ chatId, threadId, noWebPage: true });\n };\n\n // TODO Refactor so `WebPage` can be used without message\n const { photo, ...webPageWithoutPhoto } = renderingWebPage;\n const messageStub = {\n content: {\n webPage: webPageWithoutPhoto,\n },\n } as ApiMessage;\n\n return (\n
\n
\n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId }): StateProps => {\n const noWebPage = selectNoWebPage(global, chatId, threadId);\n return {\n webPagePreview: global.webPagePreview,\n noWebPage,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadWebPagePreview', 'clearWebPagePreview', 'toggleMessageWebPage',\n ]),\n)(WebPagePreview));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './CalendarModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst CalendarModalAsync: FC = (props) => {\n const { isOpen } = props;\n const CalendarModal = useModuleLoader(Bundles.Extra, 'CalendarModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return CalendarModal ? : undefined;\n};\n\nexport default memo(CalendarModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './PaymentModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst PaymentModalAsync: FC = (props) => {\n const { isOpen } = props;\n const PaymentModal = useModuleLoader(Bundles.Extra, 'PaymentModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return PaymentModal ? : undefined;\n};\n\nexport default memo(PaymentModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './ReceiptModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst ReceiptModalAsync: FC = (props) => {\n const { isOpen } = props;\n const ReceiptModal = useModuleLoader(Bundles.Extra, 'ReceiptModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ReceiptModal ? : undefined;\n};\n\nexport default memo(ReceiptModalAsync);\n","import React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState, MessageListType } from '../../../global/types';\nimport {\n ApiAttachment,\n ApiBotInlineResult,\n ApiBotInlineMediaResult,\n ApiSticker,\n ApiVideo,\n ApiNewPoll,\n ApiMessage,\n ApiFormattedText,\n ApiChat,\n ApiChatMember,\n ApiUser,\n MAIN_THREAD_ID,\n ApiBotCommand,\n} from '../../../api/types';\nimport { InlineBotSettings } from '../../../types';\n\nimport {\n BASE_EMOJI_KEYWORD_LANG, EDITABLE_INPUT_ID, REPLIES_USER_ID, SCHEDULED_WHEN_ONLINE,\n} from '../../../config';\nimport { IS_VOICE_RECORDING_SUPPORTED, IS_SINGLE_COLUMN_LAYOUT, IS_IOS } from '../../../util/environment';\nimport {\n selectChat,\n selectIsRightColumnShown,\n selectIsInSelectMode,\n selectNewestMessageWithBotKeyboardButtons,\n selectDraft,\n selectScheduledIds,\n selectEditingMessage,\n selectIsChatWithSelf,\n selectChatBot,\n selectChatUser,\n selectChatMessage,\n} from '../../../modules/selectors';\nimport {\n getAllowedAttachmentOptions,\n getChatSlowModeOptions,\n isChatPrivate,\n isChatAdmin,\n} from '../../../modules/helpers';\nimport { formatMediaDuration, formatVoiceRecordDuration, getDayStartAt } from '../../../util/dateFormat';\nimport focusEditableElement from '../../../util/focusEditableElement';\nimport parseMessageInput from './helpers/parseMessageInput';\nimport buildAttachment from './helpers/buildAttachment';\nimport renderText from '../../common/helpers/renderText';\nimport insertHtmlInSelection from '../../../util/insertHtmlInSelection';\nimport deleteLastCharacterOutsideSelection from '../../../util/deleteLastCharacterOutsideSelection';\nimport { pick } from '../../../util/iteratees';\nimport buildClassName from '../../../util/buildClassName';\nimport windowSize from '../../../util/windowSize';\nimport { isSelectionInsideInput } from './helpers/selection';\nimport applyIosAutoCapitalizationFix from './helpers/applyIosAutoCapitalizationFix';\nimport { getServerTime } from '../../../util/serverTime';\n\nimport useFlag from '../../../hooks/useFlag';\nimport useVoiceRecording from './hooks/useVoiceRecording';\nimport useClipboardPaste from './hooks/useClipboardPaste';\nimport useDraft from './hooks/useDraft';\nimport useEditing from './hooks/useEditing';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useStickerTooltip from './hooks/useStickerTooltip';\nimport useEmojiTooltip from './hooks/useEmojiTooltip';\nimport useMentionTooltip from './hooks/useMentionTooltip';\nimport useContextMenuHandlers from '../../../hooks/useContextMenuHandlers';\nimport useLang from '../../../hooks/useLang';\nimport useInlineBotTooltip from './hooks/useInlineBotTooltip';\nimport useBotCommandTooltip from './hooks/useBotCommandTooltip';\n\nimport DeleteMessageModal from '../../common/DeleteMessageModal.async';\nimport Button from '../../ui/Button';\nimport ResponsiveHoverButton from '../../ui/ResponsiveHoverButton';\nimport Spinner from '../../ui/Spinner';\nimport AttachMenu from './AttachMenu.async';\nimport SymbolMenu from './SymbolMenu.async';\nimport InlineBotTooltip from './InlineBotTooltip.async';\nimport MentionTooltip from './MentionTooltip.async';\nimport CustomSendMenu from './CustomSendMenu.async';\nimport StickerTooltip from './StickerTooltip.async';\nimport EmojiTooltip from './EmojiTooltip.async';\nimport BotCommandTooltip from './BotCommandTooltip.async';\nimport BotKeyboardMenu from './BotKeyboardMenu';\nimport MessageInput from './MessageInput';\nimport ComposerEmbeddedMessage from './ComposerEmbeddedMessage';\nimport AttachmentModal from './AttachmentModal.async';\nimport BotCommandMenu from './BotCommandMenu.async';\nimport PollModal from './PollModal.async';\nimport DropArea, { DropAreaState } from './DropArea.async';\nimport WebPagePreview from './WebPagePreview';\nimport Portal from '../../ui/Portal';\nimport CalendarModal from '../../common/CalendarModal.async';\nimport PaymentModal from '../../payment/PaymentModal.async';\nimport ReceiptModal from '../../payment/ReceiptModal.async';\n\nimport './Composer.scss';\n\ntype OwnProps = {\n chatId: number;\n threadId: number;\n messageListType: MessageListType;\n dropAreaState: string;\n isReady: boolean;\n onDropHide: NoneToVoidFunction;\n};\n\ntype StateProps = {\n editingMessage?: ApiMessage;\n chat?: ApiChat;\n draft?: ApiFormattedText;\n isChatWithBot?: boolean;\n isChatWithSelf?: boolean;\n isRightColumnShown?: boolean;\n isSelectModeActive?: boolean;\n isForwarding?: boolean;\n isPollModalOpen?: boolean;\n isPaymentModalOpen?: boolean;\n isReceiptModalOpen?: boolean;\n botKeyboardMessageId?: number;\n botKeyboardPlaceholder?: string;\n withScheduledButton?: boolean;\n shouldSchedule?: boolean;\n canScheduleUntilOnline?: boolean;\n stickersForEmoji?: ApiSticker[];\n groupChatMembers?: ApiChatMember[];\n currentUserId?: number;\n usersById?: Record;\n recentEmojis: string[];\n lastSyncTime?: number;\n contentToBeScheduled?: GlobalState['messages']['contentToBeScheduled'];\n shouldSuggestStickers?: boolean;\n baseEmojiKeywords?: Record;\n emojiKeywords?: Record;\n serverTimeOffset: number;\n topInlineBotIds?: number[];\n isInlineBotLoading: boolean;\n inlineBots?: Record;\n botCommands?: ApiBotCommand[] | false;\n chatBotCommands?: ApiBotCommand[];\n} & Pick;\n\ntype DispatchProps = Pick;\n\nenum MainButtonState {\n Send = 'send',\n Record = 'record',\n Edit = 'edit',\n}\n\nconst VOICE_RECORDING_FILENAME = 'wonderful-voice-message.ogg';\n// When voice recording is active, composer placeholder will hide to prevent overlapping\nconst SCREEN_WIDTH_TO_HIDE_PLACEHOLDER = 600; // px\n\nconst MOBILE_KEYBOARD_HIDE_DELAY_MS = 100;\nconst SELECT_MODE_TRANSITION_MS = 200;\nconst MESSAGE_MAX_LENGTH = 4096;\nconst CAPTION_MAX_LENGTH = 1024;\nconst SENDING_ANIMATION_DURATION = 350;\n// eslint-disable-next-line max-len\nconst APPENDIX = '';\n\nconst Composer: FC = ({\n dropAreaState,\n shouldSchedule,\n canScheduleUntilOnline,\n isReady,\n onDropHide,\n editingMessage,\n chatId,\n threadId,\n messageListType,\n draft,\n chat,\n connectionState,\n isChatWithBot,\n isChatWithSelf,\n isRightColumnShown,\n isSelectModeActive,\n isForwarding,\n isPollModalOpen,\n isPaymentModalOpen,\n isReceiptModalOpen,\n botKeyboardMessageId,\n botKeyboardPlaceholder,\n withScheduledButton,\n stickersForEmoji,\n groupChatMembers,\n topInlineBotIds,\n currentUserId,\n usersById,\n lastSyncTime,\n contentToBeScheduled,\n shouldSuggestStickers,\n baseEmojiKeywords,\n emojiKeywords,\n serverTimeOffset,\n recentEmojis,\n inlineBots,\n isInlineBotLoading,\n botCommands,\n chatBotCommands,\n sendMessage,\n editMessage,\n saveDraft,\n clearDraft,\n showDialog,\n setStickerSearchQuery,\n setGifSearchQuery,\n forwardMessages,\n openPollModal,\n closePollModal,\n loadScheduledHistory,\n closePaymentModal,\n openChat,\n clearReceipt,\n addRecentEmoji,\n sendInlineBotResult,\n}) => {\n const lang = useLang();\n\n // eslint-disable-next-line no-null/no-null\n const appendixRef = useRef(null);\n const [html, setHtml] = useState('');\n const lastMessageSendTimeSeconds = useRef();\n const prevDropAreaState = usePrevious(dropAreaState);\n const [isCalendarOpen, openCalendar, closeCalendar] = useFlag();\n const [\n scheduledMessageArgs, setScheduledMessageArgs,\n ] = useState();\n const { width: windowWidth } = windowSize.get();\n\n // Cache for frequently updated state\n const htmlRef = useRef(html);\n useEffect(() => {\n htmlRef.current = html;\n }, [html]);\n\n useEffect(() => {\n lastMessageSendTimeSeconds.current = undefined;\n }, [chatId]);\n\n useEffect(() => {\n if (chatId && lastSyncTime && threadId === MAIN_THREAD_ID && isReady) {\n loadScheduledHistory();\n }\n }, [isReady, chatId, loadScheduledHistory, lastSyncTime, threadId]);\n\n useLayoutEffect(() => {\n if (!appendixRef.current) return;\n\n appendixRef.current.innerHTML = APPENDIX;\n }, []);\n\n useEffect(() => {\n if (contentToBeScheduled) {\n setScheduledMessageArgs(contentToBeScheduled);\n openCalendar();\n }\n }, [contentToBeScheduled, openCalendar]);\n\n const [attachments, setAttachments] = useState([]);\n\n const [isBotKeyboardOpen, openBotKeyboard, closeBotKeyboard] = useFlag();\n const [isBotCommandMenuOpen, openBotCommandMenu, closeBotCommandMenu] = useFlag();\n const [isAttachMenuOpen, openAttachMenu, closeAttachMenu] = useFlag();\n const [isSymbolMenuOpen, openSymbolMenu, closeSymbolMenu] = useFlag();\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n const [isSymbolMenuLoaded, onSymbolMenuLoadingComplete] = useFlag();\n const [isHoverDisabled, disableHover, enableHover] = useFlag();\n\n const {\n startRecordingVoice,\n stopRecordingVoice,\n pauseRecordingVoice,\n activeVoiceRecording,\n currentRecordTime,\n recordButtonRef: mainButtonRef,\n startRecordTimeRef,\n } = useVoiceRecording();\n\n const mainButtonState = editingMessage\n ? MainButtonState.Edit\n : !IS_VOICE_RECORDING_SUPPORTED || activeVoiceRecording || (html && !attachments.length) || isForwarding\n ? MainButtonState.Send\n : MainButtonState.Record;\n const canShowCustomSendMenu = !shouldSchedule;\n\n const {\n isMentionTooltipOpen, closeMentionTooltip, insertMention, mentionFilteredUsers,\n } = useMentionTooltip(\n !attachments.length,\n html,\n setHtml,\n undefined,\n groupChatMembers,\n topInlineBotIds,\n currentUserId,\n usersById,\n );\n\n const {\n isOpen: isInlineBotTooltipOpen,\n id: inlineBotId,\n isGallery: isInlineBotTooltipGallery,\n switchPm: inlineBotSwitchPm,\n results: inlineBotResults,\n closeTooltip: closeInlineBotTooltip,\n help: inlineBotHelp,\n loadMore: loadMoreForInlineBot,\n } = useInlineBotTooltip(\n Boolean(!attachments.length && lastSyncTime),\n chatId,\n html,\n inlineBots,\n );\n\n const {\n isOpen: isBotCommandTooltipOpen,\n close: closeBotCommandTooltip,\n filteredBotCommands: botTooltipCommands,\n } = useBotCommandTooltip(\n Boolean((botCommands && botCommands.length) || (chatBotCommands && chatBotCommands.length)),\n html,\n botCommands,\n chatBotCommands,\n );\n\n const {\n isContextMenuOpen: isCustomSendMenuOpen,\n handleContextMenu,\n handleContextMenuClose,\n handleContextMenuHide,\n } = useContextMenuHandlers(mainButtonRef, !(mainButtonState === MainButtonState.Send && canShowCustomSendMenu));\n\n const allowedAttachmentOptions = useMemo(() => {\n return getAllowedAttachmentOptions(chat, isChatWithBot);\n }, [chat, isChatWithBot]);\n\n const isAdmin = chat && isChatAdmin(chat);\n const slowMode = getChatSlowModeOptions(chat);\n\n const { isStickerTooltipOpen, closeStickerTooltip } = useStickerTooltip(\n Boolean(shouldSuggestStickers && allowedAttachmentOptions.canSendStickers && !attachments.length),\n html,\n stickersForEmoji,\n !isReady,\n );\n const {\n isEmojiTooltipOpen, closeEmojiTooltip, filteredEmojis, insertEmoji,\n } = useEmojiTooltip(\n Boolean(shouldSuggestStickers && allowedAttachmentOptions.canSendStickers && !attachments.length),\n html,\n recentEmojis,\n undefined,\n setHtml,\n baseEmojiKeywords,\n emojiKeywords,\n !isReady,\n );\n\n const insertTextAndUpdateCursor = useCallback((text: string, inputId: string = EDITABLE_INPUT_ID) => {\n const selection = window.getSelection()!;\n const messageInput = document.getElementById(inputId)!;\n const newHtml = renderText(text, ['escape_html', 'emoji_html', 'br_html'])\n .join('')\n .replace(/\\u200b+/g, '\\u200b');\n\n if (selection.rangeCount) {\n const selectionRange = selection.getRangeAt(0);\n if (isSelectionInsideInput(selectionRange, inputId)) {\n insertHtmlInSelection(newHtml);\n messageInput.dispatchEvent(new Event('input', { bubbles: true }));\n return;\n }\n }\n\n setHtml(`${htmlRef.current!}${newHtml}`);\n\n // If selection is outside of input, set cursor at the end of input\n requestAnimationFrame(() => {\n focusEditableElement(messageInput);\n });\n }, []);\n\n const removeSymbol = useCallback(() => {\n const selection = window.getSelection()!;\n\n if (selection.rangeCount) {\n const selectionRange = selection.getRangeAt(0);\n if (isSelectionInsideInput(selectionRange, EDITABLE_INPUT_ID)) {\n document.execCommand('delete', false);\n return;\n }\n }\n\n setHtml(deleteLastCharacterOutsideSelection(htmlRef.current!));\n }, []);\n\n const resetComposer = useCallback((shouldPreserveInput = false) => {\n if (!shouldPreserveInput) {\n setHtml('');\n }\n setAttachments([]);\n closeStickerTooltip();\n closeCalendar();\n setScheduledMessageArgs(undefined);\n closeMentionTooltip();\n closeEmojiTooltip();\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n // @perf\n setTimeout(() => closeSymbolMenu(), SENDING_ANIMATION_DURATION);\n } else {\n closeSymbolMenu();\n }\n }, [closeStickerTooltip, closeCalendar, closeMentionTooltip, closeEmojiTooltip, closeSymbolMenu]);\n\n // Handle chat change (ref is used to avoid redundant effect calls)\n const stopRecordingVoiceRef = useRef();\n stopRecordingVoiceRef.current = stopRecordingVoice;\n useEffect(() => {\n return () => {\n stopRecordingVoiceRef.current!();\n resetComposer();\n };\n }, [chatId, resetComposer, stopRecordingVoiceRef]);\n\n const handleEditComplete = useEditing(htmlRef, setHtml, editingMessage, resetComposer, openDeleteModal, editMessage);\n useDraft(draft, chatId, threadId, html, htmlRef, setHtml, editingMessage, saveDraft, clearDraft);\n useClipboardPaste(insertTextAndUpdateCursor, setAttachments, editingMessage);\n\n const handleFileSelect = useCallback(async (files: File[], isQuick: boolean) => {\n setAttachments(await Promise.all(files.map((file) => buildAttachment(file.name, file, isQuick))));\n }, []);\n\n const handleAppendFiles = useCallback(async (files: File[], isQuick: boolean) => {\n setAttachments([\n ...attachments,\n ...await Promise.all(files.map((file) => buildAttachment(file.name, file, isQuick))),\n ]);\n }, [attachments]);\n\n const handleClearAttachment = useCallback(() => {\n setAttachments([]);\n }, []);\n\n const handleSend = useCallback(async (isSilent = false, scheduledAt?: number) => {\n if (connectionState !== 'connectionStateReady') {\n return;\n }\n\n let currentAttachments = attachments;\n\n if (activeVoiceRecording) {\n const record = await stopRecordingVoice();\n if (record) {\n const { blob, duration, waveform } = record;\n currentAttachments = [await buildAttachment(\n VOICE_RECORDING_FILENAME,\n blob,\n false,\n { voice: { duration, waveform } },\n )];\n }\n }\n\n const { text, entities } = parseMessageInput(htmlRef.current!);\n\n if (!currentAttachments.length && !text && !isForwarding) {\n return;\n }\n\n const maxLength = currentAttachments.length ? CAPTION_MAX_LENGTH : MESSAGE_MAX_LENGTH;\n if (text?.length > maxLength) {\n const extraLength = text.length - maxLength;\n showDialog({\n data: {\n message: 'MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS',\n textParams: {\n '{EXTRA_CHARS_COUNT}': extraLength,\n '{PLURAL_S}': extraLength > 1 ? 's' : '',\n },\n hasErrorKey: true,\n },\n });\n\n return;\n }\n\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n\n if (currentAttachments.length || text) {\n if (slowMode && !isAdmin) {\n const nowSeconds = getServerTime(serverTimeOffset);\n const secondsSinceLastMessage = lastMessageSendTimeSeconds.current\n && Math.floor(nowSeconds - lastMessageSendTimeSeconds.current);\n const nextSendDateNotReached = slowMode.nextSendDate && slowMode.nextSendDate > nowSeconds;\n\n if (\n (secondsSinceLastMessage && secondsSinceLastMessage < slowMode.seconds)\n || nextSendDateNotReached\n ) {\n const secondsRemaining = nextSendDateNotReached\n ? slowMode.nextSendDate! - nowSeconds\n : slowMode.seconds - secondsSinceLastMessage!;\n showDialog({\n data: {\n message: lang('SlowModeHint', formatMediaDuration(secondsRemaining)),\n isSlowMode: true,\n hasErrorKey: false,\n },\n });\n\n messageInput.blur();\n\n return;\n }\n }\n\n sendMessage({\n text,\n entities,\n attachments: currentAttachments,\n scheduledAt,\n isSilent,\n });\n }\n if (isForwarding) {\n forwardMessages();\n }\n\n lastMessageSendTimeSeconds.current = getServerTime(serverTimeOffset);\n\n clearDraft({ chatId, localOnly: true });\n\n if (IS_IOS && messageInput === document.activeElement) {\n applyIosAutoCapitalizationFix(messageInput);\n }\n\n // Wait until message animation starts\n requestAnimationFrame(() => {\n resetComposer();\n });\n }, [\n connectionState, attachments, activeVoiceRecording, isForwarding, clearDraft, chatId, serverTimeOffset,\n resetComposer, stopRecordingVoice, showDialog, slowMode, isAdmin, sendMessage, forwardMessages, lang,\n ]);\n\n const handleActivateBotCommandMenu = useCallback(() => {\n closeSymbolMenu();\n openBotCommandMenu();\n }, [closeSymbolMenu, openBotCommandMenu]);\n\n const handleActivateSymbolMenu = useCallback(() => {\n closeBotCommandMenu();\n openSymbolMenu();\n }, [closeBotCommandMenu, openSymbolMenu]);\n\n const handleStickerSelect = useCallback((sticker: ApiSticker, shouldPreserveInput = false) => {\n sticker = {\n ...sticker,\n isPreloadedGlobally: true,\n };\n\n if (shouldSchedule) {\n setScheduledMessageArgs({ sticker });\n openCalendar();\n } else {\n sendMessage({ sticker });\n requestAnimationFrame(() => {\n resetComposer(shouldPreserveInput);\n });\n }\n }, [shouldSchedule, openCalendar, sendMessage, resetComposer]);\n\n const handleGifSelect = useCallback((gif: ApiVideo) => {\n if (shouldSchedule) {\n setScheduledMessageArgs({ gif });\n openCalendar();\n } else {\n sendMessage({ gif });\n requestAnimationFrame(() => {\n resetComposer(true);\n });\n }\n }, [shouldSchedule, openCalendar, sendMessage, resetComposer]);\n\n const handleInlineBotSelect = useCallback((inlineResult: ApiBotInlineResult | ApiBotInlineMediaResult) => {\n if (connectionState !== 'connectionStateReady') {\n return;\n }\n\n sendInlineBotResult({\n id: inlineResult.id,\n queryId: inlineResult.queryId,\n });\n\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n if (IS_IOS && messageInput === document.activeElement) {\n applyIosAutoCapitalizationFix(messageInput);\n }\n\n clearDraft({ chatId, localOnly: true });\n requestAnimationFrame(() => {\n resetComposer();\n });\n }, [chatId, clearDraft, connectionState, resetComposer, sendInlineBotResult]);\n\n const handleBotCommandSelect = useCallback(() => {\n clearDraft({ chatId, localOnly: true });\n requestAnimationFrame(() => {\n resetComposer();\n });\n }, [chatId, clearDraft, resetComposer]);\n\n const handlePollSend = useCallback((poll: ApiNewPoll) => {\n if (shouldSchedule) {\n setScheduledMessageArgs({ poll });\n closePollModal();\n openCalendar();\n } else {\n sendMessage({ poll });\n closePollModal();\n }\n }, [closePollModal, openCalendar, sendMessage, shouldSchedule]);\n\n const handleSilentSend = useCallback(() => {\n if (shouldSchedule) {\n setScheduledMessageArgs({ isSilent: true });\n openCalendar();\n } else {\n void handleSend(true);\n }\n }, [handleSend, openCalendar, shouldSchedule]);\n\n const handleMessageSchedule = useCallback((date: Date, isWhenOnline = false) => {\n const { isSilent, ...restArgs } = scheduledMessageArgs || {};\n\n // Scheduled time can not be less than 10 seconds in future\n const scheduledAt = Math.round(Math.max(date.getTime(), Date.now() + 60 * 1000) / 1000)\n + (isWhenOnline ? 0 : serverTimeOffset);\n\n if (!scheduledMessageArgs || Object.keys(restArgs).length === 0) {\n void handleSend(!!isSilent, scheduledAt);\n } else {\n sendMessage({\n ...scheduledMessageArgs,\n scheduledAt,\n });\n requestAnimationFrame(() => {\n resetComposer();\n });\n }\n closeCalendar();\n }, [closeCalendar, handleSend, resetComposer, scheduledMessageArgs, sendMessage, serverTimeOffset]);\n\n const handleMessageScheduleUntilOnline = useCallback(() => {\n handleMessageSchedule(new Date(SCHEDULED_WHEN_ONLINE * 1000), true);\n }, [handleMessageSchedule]);\n\n const handleCloseCalendar = useCallback(() => {\n closeCalendar();\n setScheduledMessageArgs(undefined);\n }, [closeCalendar]);\n\n const handleSearchOpen = useCallback((type: 'stickers' | 'gifs') => {\n if (type === 'stickers') {\n setStickerSearchQuery({ query: '' });\n setGifSearchQuery({ query: undefined });\n } else {\n setGifSearchQuery({ query: '' });\n setStickerSearchQuery({ query: undefined });\n }\n }, [setStickerSearchQuery, setGifSearchQuery]);\n\n const handleSymbolMenuOpen = useCallback(() => {\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n\n if (!IS_SINGLE_COLUMN_LAYOUT || messageInput !== document.activeElement) {\n openSymbolMenu();\n return;\n }\n\n messageInput.blur();\n setTimeout(() => {\n closeBotCommandMenu();\n openSymbolMenu();\n }, MOBILE_KEYBOARD_HIDE_DELAY_MS);\n }, [openSymbolMenu, closeBotCommandMenu]);\n\n const handleAllScheduledClick = useCallback(() => {\n openChat({ id: chatId, threadId, type: 'scheduled' });\n }, [openChat, chatId, threadId]);\n\n useEffect(() => {\n if (isRightColumnShown && IS_SINGLE_COLUMN_LAYOUT) {\n closeSymbolMenu();\n }\n }, [isRightColumnShown, closeSymbolMenu]);\n\n useEffect(() => {\n if (!isReady) return;\n\n if (isSelectModeActive) {\n disableHover();\n } else {\n setTimeout(() => {\n enableHover();\n }, SELECT_MODE_TRANSITION_MS);\n }\n }, [isSelectModeActive, enableHover, disableHover, isReady]);\n\n const mainButtonHandler = useCallback(() => {\n switch (mainButtonState) {\n case MainButtonState.Send:\n if (shouldSchedule) {\n if (activeVoiceRecording) {\n pauseRecordingVoice();\n }\n openCalendar();\n } else {\n void handleSend();\n }\n break;\n case MainButtonState.Record:\n void startRecordingVoice();\n break;\n case MainButtonState.Edit:\n handleEditComplete();\n break;\n default:\n break;\n }\n }, [\n mainButtonState, shouldSchedule, startRecordingVoice, handleEditComplete,\n activeVoiceRecording, openCalendar, pauseRecordingVoice, handleSend,\n ]);\n\n const areVoiceMessagesNotAllowed = mainButtonState === MainButtonState.Record\n && !allowedAttachmentOptions.canAttachMedia;\n\n const prevEditedMessage = usePrevious(editingMessage, true);\n const renderedEditedMessage = editingMessage || prevEditedMessage;\n\n const scheduledDefaultDate = new Date();\n scheduledDefaultDate.setSeconds(0);\n scheduledDefaultDate.setMilliseconds(0);\n\n const scheduledMaxDate = new Date();\n scheduledMaxDate.setFullYear(scheduledMaxDate.getFullYear() + 1);\n\n let sendButtonAriaLabel = 'SendMessage';\n switch (mainButtonState) {\n case MainButtonState.Edit:\n sendButtonAriaLabel = 'Save edited message';\n break;\n case MainButtonState.Record:\n sendButtonAriaLabel = areVoiceMessagesNotAllowed\n ? 'Conversation.DefaultRestrictedMedia'\n : 'AccDescrVoiceMessage';\n }\n\n const className = buildClassName(\n 'Composer',\n !isSelectModeActive && 'shown',\n isHoverDisabled && 'hover-disabled',\n );\n\n const symbolMenuButtonClassName = buildClassName(\n 'mobile-symbol-menu-button',\n !isReady && 'not-ready',\n isSymbolMenuLoaded\n ? (isSymbolMenuOpen && 'menu-opened')\n : (isSymbolMenuOpen && 'is-loading'),\n );\n\n const onSend = mainButtonState === MainButtonState.Edit\n ? handleEditComplete\n : (shouldSchedule ? openCalendar : handleSend);\n\n return (\n
\n {allowedAttachmentOptions.canAttachMedia && isReady && (\n \n \n \n )}\n \n \n \n \n {renderedEditedMessage && (\n \n )}\n \n \n \n
\n
\n \n \n
\n {isChatWithBot && botCommands !== false && !activeVoiceRecording && !editingMessage && (\n \n \n \n )}\n {IS_SINGLE_COLUMN_LAYOUT ? (\n \n \n \n {isSymbolMenuOpen && !isSymbolMenuLoaded && }\n \n ) : (\n \n \n \n )}\n \n {isInlineBotLoading && Boolean(inlineBotId) && (\n \n )}\n {withScheduledButton && (\n \n \n \n )}\n {botKeyboardMessageId && !activeVoiceRecording && !editingMessage && (\n \n \n \n )}\n {!activeVoiceRecording && !editingMessage && (\n \n \n \n )}\n {activeVoiceRecording && currentRecordTime && (\n \n {formatVoiceRecordDuration(currentRecordTime - startRecordTimeRef.current!)}\n \n )}\n \n \n \n {botKeyboardMessageId && (\n \n )}\n {botCommands && (\n \n )}\n \n
\n
\n {activeVoiceRecording && (\n \n \n \n )}\n \n \n \n \n \n {canShowCustomSendMenu && (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, threadId, messageListType }): StateProps => {\n const chat = selectChat(global, chatId);\n const chatUser = chat && selectChatUser(global, chat);\n const chatBot = chatId !== REPLIES_USER_ID ? selectChatBot(global, chatId) : undefined;\n const isChatWithBot = Boolean(chatBot);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const messageWithActualBotKeyboard = isChatWithBot && selectNewestMessageWithBotKeyboardButtons(global, chatId);\n const scheduledIds = selectScheduledIds(global, chatId);\n const { language } = global.settings.byKey;\n const baseEmojiKeywords = global.emojiKeywords[BASE_EMOJI_KEYWORD_LANG];\n const emojiKeywords = language !== BASE_EMOJI_KEYWORD_LANG ? global.emojiKeywords[language] : undefined;\n const botKeyboardMessageId = messageWithActualBotKeyboard ? messageWithActualBotKeyboard.id : undefined;\n const keyboardMessage = botKeyboardMessageId ? selectChatMessage(global, chatId, botKeyboardMessageId) : undefined;\n\n return {\n editingMessage: selectEditingMessage(global, chatId, threadId, messageListType),\n connectionState: global.connectionState,\n draft: selectDraft(global, chatId, threadId),\n chat,\n isChatWithBot,\n isChatWithSelf,\n canScheduleUntilOnline: (\n !isChatWithSelf && !isChatWithBot\n && (chat && chatUser && isChatPrivate(chatId) && chatUser.status && Boolean(chatUser.status.wasOnline))\n ),\n isRightColumnShown: selectIsRightColumnShown(global),\n isSelectModeActive: selectIsInSelectMode(global),\n withScheduledButton: (\n threadId === MAIN_THREAD_ID\n && messageListType === 'thread'\n && Boolean(scheduledIds?.length)\n ),\n shouldSchedule: messageListType === 'scheduled',\n botKeyboardMessageId,\n botKeyboardPlaceholder: keyboardMessage?.keyboardPlaceholder,\n isForwarding: chatId === global.forwardMessages.toChatId,\n isPollModalOpen: global.isPollModalOpen,\n stickersForEmoji: global.stickers.forEmoji.stickers,\n groupChatMembers: chat?.fullInfo?.members,\n topInlineBotIds: global.topInlineBots?.userIds,\n currentUserId: global.currentUserId,\n usersById: global.users.byId,\n lastSyncTime: global.lastSyncTime,\n contentToBeScheduled: global.messages.contentToBeScheduled,\n isPaymentModalOpen: global.payment.isPaymentModalOpen,\n isReceiptModalOpen: Boolean(global.payment.receipt),\n shouldSuggestStickers: global.settings.byKey.shouldSuggestStickers,\n recentEmojis: global.recentEmojis,\n baseEmojiKeywords: baseEmojiKeywords?.keywords,\n emojiKeywords: emojiKeywords?.keywords,\n serverTimeOffset: global.serverTimeOffset,\n inlineBots: global.inlineBots.byUsername,\n isInlineBotLoading: global.inlineBots.isLoading,\n chatBotCommands: chat && chat.fullInfo && chat.fullInfo.botCommands,\n botCommands: chatBot && chatBot.fullInfo ? (chatBot.fullInfo.botCommands || false) : undefined,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'sendMessage',\n 'editMessage',\n 'saveDraft',\n 'clearDraft',\n 'showDialog',\n 'setStickerSearchQuery',\n 'setGifSearchQuery',\n 'forwardMessages',\n 'openPollModal',\n 'closePollModal',\n 'closePaymentModal',\n 'clearReceipt',\n 'loadScheduledHistory',\n 'openChat',\n 'addRecentEmoji',\n 'sendInlineBotResult',\n ]),\n)(Composer));\n","import { useEffect } from '../../../../lib/teact/teact';\nimport { getDispatch } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\n\nimport { IS_EMOJI_SUPPORTED } from '../../../../util/environment';\n\nimport parseEmojiOnlyString from '../../../common/helpers/parseEmojiOnlyString';\n\nexport default function useStickerTooltip(\n isAllowed: boolean,\n html: string,\n stickers?: ApiSticker[],\n isDisabled = false,\n) {\n const { loadStickersForEmoji, clearStickersForEmoji } = getDispatch();\n const isSingleEmoji = (\n (IS_EMOJI_SUPPORTED && parseEmojiOnlyString(html) === 1)\n || (!IS_EMOJI_SUPPORTED && Boolean(html.match(/^]*?>$/g)))\n );\n const hasStickers = Boolean(stickers) && isSingleEmoji;\n\n useEffect(() => {\n if (isDisabled) return;\n\n if (isAllowed && isSingleEmoji) {\n loadStickersForEmoji({ emoji: html });\n } else if (hasStickers || !isSingleEmoji) {\n clearStickersForEmoji();\n }\n // We omit `hasStickers` here to prevent re-fetching after manually closing tooltip (via ).\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [html, isSingleEmoji, clearStickersForEmoji, loadStickersForEmoji, isAllowed, isDisabled]);\n\n return {\n isStickerTooltipOpen: hasStickers,\n closeStickerTooltip: clearStickersForEmoji,\n };\n}\n","export default function insertHtmlInSelection(html: string) {\n const selection = window.getSelection();\n\n if (selection?.getRangeAt && selection.rangeCount) {\n const range = selection.getRangeAt(0);\n range.deleteContents();\n\n const fragment = range.createContextualFragment(html);\n const lastInsertedNode = fragment.lastChild;\n range.insertNode(fragment);\n if (lastInsertedNode) {\n range.setStartAfter(lastInsertedNode);\n range.setEndAfter(lastInsertedNode);\n } else {\n range.collapse(false);\n }\n selection.removeAllRanges();\n selection.addRange(range);\n }\n}\n","export default function deleteLastCharacterOutsideSelection(html: string) {\n const tempInput = document.createElement('div');\n tempInput.contentEditable = 'true';\n tempInput.style.position = 'absolute';\n tempInput.style.left = '-10000px';\n tempInput.style.top = '-10000px';\n tempInput.innerHTML = html;\n document.body.appendChild(tempInput);\n let element = tempInput.lastChild!;\n\n if (element.lastChild) {\n // Selects the last and the deepest child of the element.\n while (element.lastChild) {\n element = element.lastChild;\n }\n }\n\n // Gets length of the element's content.\n const textLength = element.textContent!.length;\n const range = document.createRange();\n const selection = window.getSelection()!;\n\n // Sets selection position to the end of the element.\n range.setStart(element, textLength);\n range.setEnd(element, textLength);\n selection.removeAllRanges();\n selection.addRange(range);\n document.execCommand('delete', false);\n\n const result = tempInput.innerHTML;\n document.body.removeChild(tempInput);\n\n return result;\n}\n","import { useCallback, useEffect } from '../../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../../api/types';\nimport { GlobalActions } from '../../../../global/types';\n\nimport { EDITABLE_INPUT_ID } from '../../../../config';\nimport parseMessageInput from '../helpers/parseMessageInput';\nimport getMessageTextAsHtml from '../helpers/getMessageTextAsHtml';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport { hasMessageMedia } from '../../../../modules/helpers';\n\nexport default (\n htmlRef: { current: string },\n setHtml: (html: string) => void,\n editedMessage: ApiMessage | undefined,\n resetComposer: () => void,\n openDeleteModal: () => void,\n editMessage: GlobalActions['editMessage'],\n) => {\n // TODO useOnChange\n // Handle editing message\n useEffect(() => {\n if (!editedMessage) {\n setHtml('');\n return;\n }\n\n setHtml(getMessageTextAsHtml(editedMessage.content.text));\n\n requestAnimationFrame(() => {\n const messageInput = document.getElementById(EDITABLE_INPUT_ID)!;\n focusEditableElement(messageInput, true);\n });\n }, [editedMessage, setHtml]);\n\n const handleEditComplete = useCallback(() => {\n const { text, entities } = parseMessageInput(htmlRef.current!);\n\n if (!editedMessage) {\n return;\n }\n\n if (!text && !hasMessageMedia(editedMessage)) {\n openDeleteModal();\n return;\n }\n\n editMessage({\n messageId: editedMessage.id,\n text,\n entities,\n });\n\n resetComposer();\n }, [editMessage, editedMessage, htmlRef, openDeleteModal, resetComposer]);\n\n return handleEditComplete;\n};\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './MobileSearch';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst MobileSearchAsync: FC = (props) => {\n const { isActive } = props;\n const MobileSearch = useModuleLoader(Bundles.Extra, 'MobileSearch', !isActive, true);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return MobileSearch ? : undefined;\n};\n\nexport default memo(MobileSearchAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\nimport { OwnProps } from './MessageSelectToolbar';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst MessageSelectToolbarAsync: FC = (props) => {\n const { isActive } = props;\n const MessageSelectToolbar = useModuleLoader(Bundles.Extra, 'MessageSelectToolbar', !isActive);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return MessageSelectToolbar ? : undefined;\n};\n\nexport default memo(MessageSelectToolbarAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './UnpinAllMessagesModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst UnpinAllMessagesModalAsync: FC = (props) => {\n const { isOpen } = props;\n const UnpinAllMessagesModal = useModuleLoader(Bundles.Extra, 'UnpinAllMessagesModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return UnpinAllMessagesModal ? : undefined;\n};\n\nexport default memo(UnpinAllMessagesModalAsync);\n","import React, {\n FC, useEffect, useState, memo, useMemo, useCallback,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChatBannedRights, MAIN_THREAD_ID } from '../../api/types';\nimport { GlobalActions, MessageListType, MessageList as GlobalMessageList } from '../../global/types';\nimport { ThemeKey } from '../../types';\n\nimport {\n MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,\n MOBILE_SCREEN_MAX_WIDTH,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n SAFE_SCREEN_WIDTH_FOR_CHAT_INFO,\n CONTENT_TYPES_FOR_QUICK_UPLOAD,\n ANIMATION_LEVEL_MAX,\n ANIMATION_END_DELAY,\n DARK_THEME_BG_COLOR,\n LIGHT_THEME_BG_COLOR,\n ANIMATION_LEVEL_MIN,\n} from '../../config';\nimport {\n IS_SINGLE_COLUMN_LAYOUT,\n IS_TABLET_COLUMN_LAYOUT,\n IS_TOUCH_ENV,\n MASK_IMAGE_DISABLED,\n} from '../../util/environment';\nimport { DropAreaState } from './composer/DropArea';\nimport {\n selectChat,\n selectCurrentMessageList,\n selectCurrentTextSearch,\n selectIsChatBotNotStarted,\n selectIsInSelectMode,\n selectIsRightColumnShown,\n selectPinnedIds,\n selectTheme,\n} from '../../modules/selectors';\nimport { getCanPostInChat, getMessageSendingRestrictionReason, isChatPrivate } from '../../modules/helpers';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\nimport useCustomBackground from '../../hooks/useCustomBackground';\nimport useWindowSize from '../../hooks/useWindowSize';\nimport usePrevDuringAnimation from '../../hooks/usePrevDuringAnimation';\nimport calculateMiddleFooterTransforms from './helpers/calculateMiddleFooterTransforms';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport { createMessageHash } from '../../util/routing';\n\nimport Transition from '../ui/Transition';\nimport MiddleHeader from './MiddleHeader';\nimport MessageList from './MessageList';\nimport ScrollDownButton from './ScrollDownButton';\nimport Composer from './composer/Composer';\nimport Button from '../ui/Button';\nimport MobileSearch from './MobileSearch.async';\nimport MessageSelectToolbar from './MessageSelectToolbar.async';\nimport UnpinAllMessagesModal from '../common/UnpinAllMessagesModal.async';\n\nimport './MiddleColumn.scss';\n\ntype StateProps = {\n chatId?: number;\n threadId?: number;\n messageListType?: MessageListType;\n isPrivate?: boolean;\n isPinnedMessageList?: boolean;\n isScheduledMessageList?: boolean;\n canPost?: boolean;\n currentUserBannedRights?: ApiChatBannedRights;\n defaultBannedRights?: ApiChatBannedRights;\n hasPinnedOrAudioMessage?: boolean;\n pinnedMessagesCount?: number;\n theme: ThemeKey;\n customBackground?: string;\n backgroundColor?: string;\n patternColor?: string;\n isLeftColumnShown?: boolean;\n isRightColumnShown?: boolean;\n isBackgroundBlurred?: boolean;\n isMobileSearchActive?: boolean;\n isSelectModeActive?: boolean;\n animationLevel?: number;\n shouldSkipHistoryAnimations?: boolean;\n currentTransitionKey: number;\n messageLists?: GlobalMessageList[];\n};\n\ntype DispatchProps = Pick;\n\nconst CLOSE_ANIMATION_DURATION = IS_SINGLE_COLUMN_LAYOUT ? 450 + ANIMATION_END_DELAY : undefined;\n\nfunction canBeQuicklyUploaded(item: DataTransferItem) {\n return item.kind === 'file' && item.type && CONTENT_TYPES_FOR_QUICK_UPLOAD.has(item.type);\n}\n\nconst MiddleColumn: FC = ({\n chatId,\n threadId,\n messageListType,\n isPrivate,\n isPinnedMessageList,\n messageLists,\n canPost,\n currentUserBannedRights,\n defaultBannedRights,\n hasPinnedOrAudioMessage,\n pinnedMessagesCount,\n customBackground,\n theme,\n backgroundColor,\n patternColor,\n isLeftColumnShown,\n isRightColumnShown,\n isBackgroundBlurred,\n isMobileSearchActive,\n isSelectModeActive,\n animationLevel,\n shouldSkipHistoryAnimations,\n currentTransitionKey,\n openChat,\n unpinAllMessages,\n loadUser,\n closeLocalTextSearch,\n exitMessageSelectMode,\n}) => {\n const { width: windowWidth } = useWindowSize();\n\n const lang = useLang();\n const [dropAreaState, setDropAreaState] = useState(DropAreaState.None);\n const [isFabShown, setIsFabShown] = useState();\n const [isNotchShown, setIsNotchShown] = useState();\n const [isUnpinModalOpen, setIsUnpinModalOpen] = useState(false);\n const [isReady, setIsReady] = useState(!IS_SINGLE_COLUMN_LAYOUT || animationLevel === ANIMATION_LEVEL_MIN);\n\n const hasTools = hasPinnedOrAudioMessage && (\n windowWidth < MOBILE_SCREEN_MAX_WIDTH\n || (\n isRightColumnShown && windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n && windowWidth < SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n ) || (\n windowWidth >= MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN\n && windowWidth < SAFE_SCREEN_WIDTH_FOR_CHAT_INFO\n )\n );\n\n const renderingChatId = usePrevDuringAnimation(chatId, CLOSE_ANIMATION_DURATION);\n const renderingThreadId = usePrevDuringAnimation(threadId, CLOSE_ANIMATION_DURATION);\n const renderingMessageListType = usePrevDuringAnimation(messageListType, CLOSE_ANIMATION_DURATION);\n const renderingCanPost = usePrevDuringAnimation(canPost, CLOSE_ANIMATION_DURATION);\n const renderingHasTools = usePrevDuringAnimation(hasTools, CLOSE_ANIMATION_DURATION);\n const renderingIsFabShown = usePrevDuringAnimation(isFabShown, CLOSE_ANIMATION_DURATION);\n\n useEffect(() => {\n return chatId\n ? captureEscKeyListener(() => {\n openChat({ id: undefined });\n })\n : undefined;\n }, [chatId, openChat]);\n\n useEffect(() => {\n setDropAreaState(DropAreaState.None);\n setIsFabShown(undefined);\n setIsNotchShown(undefined);\n }, [chatId]);\n\n useEffect(() => {\n if (animationLevel === ANIMATION_LEVEL_MIN) {\n setIsReady(true);\n }\n }, [animationLevel]);\n\n const handleTransitionEnd = (e: React.TransitionEvent) => {\n if (e.propertyName === 'transform' && e.target === e.currentTarget) {\n setIsReady(Boolean(chatId));\n }\n };\n\n useEffect(() => {\n if (isPrivate) {\n loadUser({ userId: chatId });\n }\n }, [chatId, isPrivate, loadUser]);\n\n const handleDragEnter = useCallback((e: React.DragEvent) => {\n if (IS_TOUCH_ENV) {\n return;\n }\n\n const { items } = e.dataTransfer || {};\n const shouldDrawQuick = items && Array.from(items)\n // Filter unnecessary element for drag and drop images in Firefox (https://github.com/Ajaxy/telegram-tt/issues/49)\n // https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#image\n .filter((item) => item.type !== 'text/uri-list')\n .every(canBeQuicklyUploaded);\n\n setDropAreaState(shouldDrawQuick ? DropAreaState.QuickFile : DropAreaState.Document);\n }, []);\n\n const handleHideDropArea = useCallback(() => {\n setDropAreaState(DropAreaState.None);\n }, []);\n\n const handleOpenUnpinModal = useCallback(() => {\n setIsUnpinModalOpen(true);\n }, []);\n\n const closeUnpinModal = useCallback(() => {\n setIsUnpinModalOpen(false);\n }, []);\n\n const handleUnpinAllMessages = useCallback(() => {\n unpinAllMessages({ chatId });\n closeUnpinModal();\n openChat({ id: chatId });\n }, [unpinAllMessages, openChat, closeUnpinModal, chatId]);\n\n const handleTabletFocus = useCallback(() => {\n openChat({ id: chatId });\n }, [openChat, chatId]);\n\n const customBackgroundValue = useCustomBackground(theme, customBackground);\n\n const className = buildClassName(\n renderingHasTools && 'has-header-tools',\n customBackground && 'custom-bg-image',\n backgroundColor && 'custom-bg-color',\n customBackground && isBackgroundBlurred && 'blurred',\n MASK_IMAGE_DISABLED ? 'mask-image-disabled' : 'mask-image-enabled',\n );\n\n const messagingDisabledClassName = buildClassName(\n 'messaging-disabled',\n !isSelectModeActive && 'shown',\n );\n\n const messageSendingRestrictionReason = getMessageSendingRestrictionReason(\n lang, currentUserBannedRights, defaultBannedRights,\n );\n\n // CSS Variables calculation doesn't work properly with transforms, so we calculate transform values in JS\n const {\n composerHiddenScale, toolbarHiddenScale,\n composerTranslateX, toolbarTranslateX,\n unpinHiddenScale, toolbarForUnpinHiddenScale,\n } = useMemo(\n () => calculateMiddleFooterTransforms(windowWidth, renderingCanPost),\n [renderingCanPost, windowWidth],\n );\n\n const footerClassName = buildClassName(\n 'middle-column-footer',\n !renderingCanPost && 'no-composer',\n renderingCanPost && isNotchShown && !isSelectModeActive && 'with-notch',\n );\n\n const closeChat = () => {\n openChat({ id: undefined }, true);\n };\n\n useHistoryBack(renderingChatId && renderingThreadId,\n closeChat, undefined, undefined, undefined,\n messageLists ? messageLists.map(createMessageHash) : []);\n\n useHistoryBack(isMobileSearchActive, closeLocalTextSearch);\n useHistoryBack(isSelectModeActive, exitMessageSelectMode);\n\n const isMessagingDisabled = Boolean(!isPinnedMessageList && !renderingCanPost && messageSendingRestrictionReason);\n\n return (\n \n \n
\n {renderingChatId && renderingThreadId && (\n <>\n
\n \n \n {(isActive) => (\n <>\n \n
\n {renderingCanPost && (\n \n )}\n {isPinnedMessageList && (\n
\n \n \n {lang('Chat.Pinned.UnpinAll', pinnedMessagesCount, 'i')}\n \n
\n )}\n {isMessagingDisabled && (\n
\n
\n \n {messageSendingRestrictionReason}\n \n
\n
\n )}\n \n
\n \n )}\n \n\n \n
\n {IS_SINGLE_COLUMN_LAYOUT && }\n \n )}\n {chatId && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const theme = selectTheme(global);\n const {\n isBlurred: isBackgroundBlurred, background: customBackground, backgroundColor, patternColor,\n } = global.settings.themes[theme] || {};\n\n const { messageLists } = global.messages;\n const currentMessageList = selectCurrentMessageList(global);\n const { isLeftColumnShown, chats: { listIds } } = global;\n\n const state: StateProps = {\n theme,\n customBackground,\n backgroundColor,\n patternColor,\n isLeftColumnShown,\n isRightColumnShown: selectIsRightColumnShown(global),\n isBackgroundBlurred,\n isMobileSearchActive: Boolean(IS_SINGLE_COLUMN_LAYOUT && selectCurrentTextSearch(global)),\n isSelectModeActive: selectIsInSelectMode(global),\n animationLevel: global.settings.byKey.animationLevel,\n currentTransitionKey: Math.max(0, global.messages.messageLists.length - 1),\n };\n\n if (!currentMessageList || !listIds.active) {\n return state;\n }\n\n const { chatId, threadId, type: messageListType } = currentMessageList;\n const chat = selectChat(global, chatId);\n const pinnedIds = selectPinnedIds(global, chatId);\n const { chatId: audioChatId, messageId: audioMessageId } = global.audioPlayer;\n\n const canPost = chat && getCanPostInChat(chat, threadId);\n const isBotNotStarted = selectIsChatBotNotStarted(global, chatId);\n const isPinnedMessageList = messageListType === 'pinned';\n const isScheduledMessageList = messageListType === 'scheduled';\n\n return {\n ...state,\n chatId,\n threadId,\n messageListType,\n isPrivate: isChatPrivate(chatId),\n canPost: !isPinnedMessageList && (!chat || canPost) && !isBotNotStarted,\n isPinnedMessageList,\n isScheduledMessageList,\n currentUserBannedRights: chat?.currentUserBannedRights,\n defaultBannedRights: chat?.defaultBannedRights,\n hasPinnedOrAudioMessage: (\n threadId !== MAIN_THREAD_ID\n || Boolean(pinnedIds?.length)\n || Boolean(audioChatId && audioMessageId)\n ),\n pinnedMessagesCount: pinnedIds ? pinnedIds.length : 0,\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n messageLists,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat', 'unpinAllMessages', 'loadUser', 'closeLocalTextSearch', 'exitMessageSelectMode',\n ]),\n)(MiddleColumn));\n","import { useEffect, useState } from '../lib/teact/teact';\n\nimport { ThemeKey } from '../types';\n\nimport { CUSTOM_BG_CACHE_NAME } from '../config';\nimport * as cacheApi from '../util/cacheApi';\nimport { preloadImage } from '../util/files';\n\nexport default (theme: ThemeKey, settingValue?: string) => {\n const [value, setValue] = useState(settingValue);\n\n useEffect(() => {\n if (!settingValue) {\n return;\n }\n\n if (settingValue.startsWith('#')) {\n setValue(settingValue);\n } else {\n cacheApi.fetch(CUSTOM_BG_CACHE_NAME, theme, cacheApi.Type.Blob)\n .then((blob) => {\n const url = URL.createObjectURL(blob);\n preloadImage(url)\n .then(() => {\n setValue(`url(${url})`);\n });\n });\n }\n }, [settingValue, theme]);\n\n return settingValue ? value : undefined;\n};\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ManagementScreens, ProfileState } from '../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { debounce } from '../../util/schedulers';\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\nimport {\n selectChat,\n selectCurrentGifSearch,\n selectCurrentStickerSearch,\n selectCurrentTextSearch,\n selectIsChatWithSelf,\n} from '../../modules/selectors';\nimport { isChatAdmin, isChatChannel, isChatPrivate } from '../../modules/helpers';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\nimport useLang from '../../hooks/useLang';\n\nimport SearchInput from '../ui/SearchInput';\nimport Button from '../ui/Button';\nimport Transition from '../ui/Transition';\nimport './RightHeader.scss';\nimport { getDayStartAt } from '../../util/dateFormat';\n\ntype OwnProps = {\n chatId?: number;\n isColumnOpen?: boolean;\n isProfile?: boolean;\n isSearch?: boolean;\n isManagement?: boolean;\n isStickerSearch?: boolean;\n isGifSearch?: boolean;\n isPollResults?: boolean;\n isAddingChatMembers?: boolean;\n shouldSkipAnimation?: boolean;\n profileState?: ProfileState;\n managementScreen?: ManagementScreens;\n onClose: () => void;\n};\n\ntype StateProps = {\n canManage?: boolean;\n isChannel?: boolean;\n messageSearchQuery?: string;\n stickerSearchQuery?: string;\n gifSearchQuery?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst COLUMN_CLOSE_DELAY_MS = 300;\nconst runDebouncedForSearch = debounce((cb) => cb(), 200, false);\n\nenum HeaderContent {\n Profile,\n MemberList,\n SharedMedia,\n Search,\n Management,\n ManageInitial,\n ManageChannelSubscribers,\n ManageChatAdministrators,\n ManageChatPrivacyType,\n ManageDiscussion,\n ManageGroupPermissions,\n ManageGroupRemovedUsers,\n ManageGroupUserPermissionsCreate,\n ManageGroupUserPermissions,\n ManageGroupRecentActions,\n ManageGroupAdminRights,\n ManageGroupMembers,\n StickerSearch,\n GifSearch,\n PollResults,\n AddingMembers,\n}\n\nconst RightHeader: FC = ({\n isColumnOpen,\n isProfile,\n isSearch,\n isManagement,\n isStickerSearch,\n isGifSearch,\n isPollResults,\n isAddingChatMembers,\n profileState,\n managementScreen,\n canManage,\n isChannel,\n onClose,\n messageSearchQuery,\n stickerSearchQuery,\n gifSearchQuery,\n setLocalTextSearchQuery,\n setStickerSearchQuery,\n setGifSearchQuery,\n searchTextMessagesLocal,\n toggleManagement,\n openHistoryCalendar,\n shouldSkipAnimation,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const backButtonRef = useRef(null);\n\n const handleMessageSearchQueryChange = useCallback((query: string) => {\n setLocalTextSearchQuery({ query });\n\n if (query.length) {\n runDebouncedForSearch(searchTextMessagesLocal);\n }\n }, [searchTextMessagesLocal, setLocalTextSearchQuery]);\n\n const handleStickerSearchQueryChange = useCallback((query: string) => {\n setStickerSearchQuery({ query });\n }, [setStickerSearchQuery]);\n\n const handleGifSearchQueryChange = useCallback((query: string) => {\n setGifSearchQuery({ query });\n }, [setGifSearchQuery]);\n\n const [shouldSkipTransition, setShouldSkipTransition] = useState(!isColumnOpen);\n\n useEffect(() => {\n setTimeout(() => {\n setShouldSkipTransition(!isColumnOpen);\n }, COLUMN_CLOSE_DELAY_MS);\n }, [isColumnOpen]);\n\n const lang = useLang();\n const contentKey = isProfile ? (\n profileState === ProfileState.Profile ? (\n HeaderContent.Profile\n ) : profileState === ProfileState.SharedMedia ? (\n HeaderContent.SharedMedia\n ) : profileState === ProfileState.MemberList ? (\n HeaderContent.MemberList\n ) : -1 // Never reached\n ) : isSearch ? (\n HeaderContent.Search\n ) : isPollResults ? (\n HeaderContent.PollResults\n ) : isStickerSearch ? (\n HeaderContent.StickerSearch\n ) : isGifSearch ? (\n HeaderContent.GifSearch\n ) : isAddingChatMembers ? (\n HeaderContent.AddingMembers\n ) : isManagement ? (\n managementScreen === ManagementScreens.Initial ? (\n HeaderContent.ManageInitial\n ) : managementScreen === ManagementScreens.ChatPrivacyType ? (\n HeaderContent.ManageChatPrivacyType\n ) : managementScreen === ManagementScreens.Discussion ? (\n HeaderContent.ManageDiscussion\n ) : managementScreen === ManagementScreens.ChannelSubscribers ? (\n HeaderContent.ManageChannelSubscribers\n ) : managementScreen === ManagementScreens.GroupPermissions ? (\n HeaderContent.ManageGroupPermissions\n ) : managementScreen === ManagementScreens.ChatAdministrators ? (\n HeaderContent.ManageChatAdministrators\n ) : managementScreen === ManagementScreens.GroupRemovedUsers ? (\n HeaderContent.ManageGroupRemovedUsers\n ) : managementScreen === ManagementScreens.GroupUserPermissionsCreate ? (\n HeaderContent.ManageGroupUserPermissionsCreate\n ) : managementScreen === ManagementScreens.GroupUserPermissions ? (\n HeaderContent.ManageGroupUserPermissions\n ) : managementScreen === ManagementScreens.GroupRecentActions ? (\n HeaderContent.ManageGroupRecentActions\n ) : managementScreen === ManagementScreens.ChatAdminRights ? (\n HeaderContent.ManageGroupAdminRights\n ) : managementScreen === ManagementScreens.GroupMembers ? (\n HeaderContent.ManageGroupMembers\n ) : undefined // Never reached\n ) : undefined; // When column is closed\n\n const renderingContentKey = useCurrentOrPrev(contentKey, true) ?? -1;\n\n function renderHeaderContent() {\n if (renderingContentKey === -1) {\n return undefined;\n }\n\n switch (renderingContentKey) {\n case HeaderContent.PollResults:\n return

{lang('PollResults')}

;\n case HeaderContent.Search:\n return (\n <>\n \n openHistoryCalendar({ selectedAt: getDayStartAt(Date.now()) })}\n ariaLabel=\"Search messages by date\"\n >\n \n \n \n );\n case HeaderContent.AddingMembers:\n return

{lang('GroupAddMembers')}

;\n case HeaderContent.ManageInitial:\n return

{lang('Edit')}

;\n case HeaderContent.ManageChatPrivacyType:\n return

{lang(isChannel ? 'ChannelTypeHeader' : 'GroupTypeHeader')}

;\n case HeaderContent.ManageDiscussion:\n return

{lang('Discussion')}

;\n case HeaderContent.ManageChatAdministrators:\n return

{lang('ChannelAdministrators')}

;\n case HeaderContent.ManageGroupRecentActions:\n return

{lang('Group.Info.AdminLog')}

;\n case HeaderContent.ManageGroupAdminRights:\n return

{lang('EditAdminRights')}

;\n case HeaderContent.ManageGroupPermissions:\n return

{lang('ChannelPermissions')}

;\n case HeaderContent.ManageGroupRemovedUsers:\n return

{lang('ChannelBlockedUsers')}

;\n case HeaderContent.ManageGroupUserPermissionsCreate:\n return

{lang('ChannelAddException')}

;\n case HeaderContent.ManageGroupUserPermissions:\n return

{lang('UserRestrictions')}

;\n case HeaderContent.StickerSearch:\n return (\n \n );\n case HeaderContent.GifSearch:\n return (\n \n );\n case HeaderContent.SharedMedia:\n return

{lang('SharedMedia')}

;\n case HeaderContent.ManageChannelSubscribers:\n return

{lang('ChannelSubscribers')}

;\n case HeaderContent.MemberList:\n case HeaderContent.ManageGroupMembers:\n return

{lang('GroupMembers')}

;\n default:\n return (\n <>\n

Profile

\n
\n {canManage && (\n \n \n \n )}\n
\n \n );\n }\n }\n\n const isBackButton = (\n IS_SINGLE_COLUMN_LAYOUT\n || contentKey === HeaderContent.SharedMedia\n || contentKey === HeaderContent.MemberList\n || contentKey === HeaderContent.AddingMembers\n || isManagement\n );\n\n const buttonClassName = buildClassName(\n 'animated-close-icon',\n isBackButton && 'state-back',\n (shouldSkipTransition || shouldSkipAnimation) && 'no-transition',\n );\n\n return (\n
\n \n
\n \n \n {renderHeaderContent}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, isProfile, isManagement }): StateProps => {\n const { query: messageSearchQuery } = selectCurrentTextSearch(global) || {};\n const { query: stickerSearchQuery } = selectCurrentStickerSearch(global) || {};\n const { query: gifSearchQuery } = selectCurrentGifSearch(global) || {};\n const chat = chatId ? selectChat(global, chatId) : undefined;\n const isChannel = chat && isChatChannel(chat);\n\n const canManage = Boolean(\n !isManagement\n && isProfile\n && chat\n && !selectIsChatWithSelf(global, chat.id)\n // chat.isCreator is for Basic Groups\n && (isChatPrivate(chat.id) || ((isChatAdmin(chat) || chat.isCreator) && !chat.isNotJoined)),\n );\n\n return {\n canManage,\n isChannel,\n messageSearchQuery,\n stickerSearchQuery,\n gifSearchQuery,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setLocalTextSearchQuery',\n 'setStickerSearchQuery',\n 'setGifSearchQuery',\n 'searchTextMessagesLocal',\n 'toggleManagement',\n 'openHistoryCalendar',\n ]),\n)(RightHeader));\n","import { useMemo, useRef } from '../../../lib/teact/teact';\n\nimport { ApiChatMember, ApiMessage, ApiUser } from '../../../api/types';\nimport { ProfileTabType, SharedMediaType } from '../../../types';\n\nimport { MEMBERS_SLICE, MESSAGE_SEARCH_SLICE, SHARED_MEDIA_SLICE } from '../../../config';\nimport { getMessageContentIds, sortUserIds } from '../../../modules/helpers';\nimport useOnChange from '../../../hooks/useOnChange';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\n\nexport default function useProfileViewportIds(\n isRightColumnShown: boolean,\n loadMoreMembers: AnyToVoidFunction,\n searchMessages: AnyToVoidFunction,\n tabType: ProfileTabType,\n mediaSearchType?: SharedMediaType,\n groupChatMembers?: ApiChatMember[],\n usersById?: Record,\n chatMessages?: Record,\n foundIds?: number[],\n chatId?: number,\n lastSyncTime?: number,\n serverTimeOffset = 0,\n) {\n const resultType = tabType === 'members' || !mediaSearchType ? tabType : mediaSearchType;\n\n const memberIds = useMemo(() => {\n if (!groupChatMembers || !usersById) {\n return undefined;\n }\n\n return sortUserIds(groupChatMembers.map(({ userId }) => userId), usersById, undefined, serverTimeOffset);\n }, [groupChatMembers, serverTimeOffset, usersById]);\n\n const [memberViewportIds, getMoreMembers, noProfileInfoForMembers] = useInfiniteScrollForMembers(\n resultType, loadMoreMembers, lastSyncTime, memberIds,\n );\n\n const [mediaViewportIds, getMoreMedia, noProfileInfoForMedia] = useInfiniteScrollForSharedMedia(\n 'media', resultType, searchMessages, lastSyncTime, chatMessages, foundIds,\n );\n\n const [documentViewportIds, getMoreDocuments, noProfileInfoForDocuments] = useInfiniteScrollForSharedMedia(\n 'documents', resultType, searchMessages, lastSyncTime, chatMessages, foundIds,\n );\n\n const [linkViewportIds, getMoreLinks, noProfileInfoForLinks] = useInfiniteScrollForSharedMedia(\n 'links', resultType, searchMessages, lastSyncTime, chatMessages, foundIds,\n );\n\n const [audioViewportIds, getMoreAudio, noProfileInfoForAudio] = useInfiniteScrollForSharedMedia(\n 'audio', resultType, searchMessages, lastSyncTime, chatMessages, foundIds,\n );\n\n let viewportIds: number[] | undefined;\n let getMore: AnyToVoidFunction | undefined;\n let noProfileInfo = false;\n\n switch (resultType) {\n case 'members':\n viewportIds = memberViewportIds;\n getMore = getMoreMembers;\n noProfileInfo = noProfileInfoForMembers;\n break;\n case 'media':\n viewportIds = mediaViewportIds;\n getMore = getMoreMedia;\n noProfileInfo = noProfileInfoForMedia;\n break;\n case 'documents':\n viewportIds = documentViewportIds;\n getMore = getMoreDocuments;\n noProfileInfo = noProfileInfoForDocuments;\n break;\n case 'links':\n viewportIds = linkViewportIds;\n getMore = getMoreLinks;\n noProfileInfo = noProfileInfoForLinks;\n break;\n case 'audio':\n viewportIds = audioViewportIds;\n getMore = getMoreAudio;\n noProfileInfo = noProfileInfoForAudio;\n break;\n }\n\n return [resultType, viewportIds, getMore, noProfileInfo] as const;\n}\n\nfunction useInfiniteScrollForMembers(\n currentResultType?: ProfileTabType,\n handleLoadMore?: AnyToVoidFunction,\n lastSyncTime?: number,\n memberIds?: number[],\n) {\n const [viewportIds, getMore] = useInfiniteScroll(\n lastSyncTime ? handleLoadMore : undefined,\n memberIds,\n undefined,\n MEMBERS_SLICE,\n );\n\n const isOnTop = !viewportIds || !memberIds || viewportIds[0] === memberIds[0];\n\n return [viewportIds, getMore, !isOnTop] as const;\n}\n\nfunction useInfiniteScrollForSharedMedia(\n forSharedMediaType: SharedMediaType,\n currentResultType?: ProfileTabType,\n handleLoadMore?: AnyToVoidFunction,\n lastSyncTime?: number,\n chatMessages?: Record,\n foundIds?: number[],\n) {\n const messageIdsRef = useRef();\n\n useOnChange(() => {\n if (currentResultType === forSharedMediaType && chatMessages && foundIds) {\n messageIdsRef.current = getMessageContentIds(\n chatMessages,\n foundIds,\n forSharedMediaType,\n ).reverse();\n }\n }, [chatMessages, foundIds, currentResultType, forSharedMediaType]);\n\n const [viewportIds, getMore] = useInfiniteScroll(\n lastSyncTime ? handleLoadMore : undefined,\n messageIdsRef.current,\n undefined,\n forSharedMediaType === 'media' ? SHARED_MEDIA_SLICE : MESSAGE_SEARCH_SLICE,\n );\n\n const isOnTop = !viewportIds || !messageIdsRef.current || viewportIds[0] === messageIdsRef.current[0];\n\n return [viewportIds, getMore, !isOnTop] as const;\n}\n","import { useCallback, useEffect } from '../../../lib/teact/teact';\n\nimport { ProfileState } from '../../../types';\n\nimport fastSmoothScroll from '../../../util/fastSmoothScroll';\nimport { throttle } from '../../../util/schedulers';\nimport useEffectWithPrevDeps from '../../../hooks/useEffectWithPrevDeps';\n\nconst TRANSITION_DURATION = 300;\nconst PROGRAMMATIC_SCROLL_TIMEOUT_MS = 350;\n\nconst runThrottledForScroll = throttle((cb) => cb(), 250, false);\n\nlet isScrollingProgrammatically = false;\n\nexport default function useProfileState(\n containerRef: { current: HTMLDivElement | null },\n tabType: string,\n profileState: ProfileState,\n onProfileStateChange: (state: ProfileState) => void,\n) {\n // Scroll to tabs if needed\n useEffectWithPrevDeps(([prevTabType]) => {\n if (prevTabType && prevTabType !== tabType) {\n const container = containerRef.current!;\n const tabsEl = container.querySelector('.TabList')!;\n if (container.scrollTop < tabsEl.offsetTop) {\n onProfileStateChange(tabType === 'members' ? ProfileState.MemberList : ProfileState.SharedMedia);\n isScrollingProgrammatically = true;\n fastSmoothScroll(container, tabsEl, 'start', undefined, undefined, undefined, TRANSITION_DURATION);\n setTimeout(() => {\n isScrollingProgrammatically = false;\n }, PROGRAMMATIC_SCROLL_TIMEOUT_MS);\n }\n }\n }, [tabType, onProfileStateChange]);\n\n // Scroll to top\n useEffectWithPrevDeps(([prevProfileState]) => {\n if (profileState !== ProfileState.Profile || profileState === prevProfileState) {\n return;\n }\n\n const container = containerRef.current;\n if (!container) {\n return;\n }\n\n const tabListEl = container.querySelector('.TabList');\n if (!tabListEl) {\n return;\n }\n\n isScrollingProgrammatically = true;\n fastSmoothScroll(\n container,\n container.firstElementChild as HTMLElement,\n 'start',\n undefined,\n container.offsetHeight * 2,\n );\n\n setTimeout(() => {\n isScrollingProgrammatically = false;\n }, PROGRAMMATIC_SCROLL_TIMEOUT_MS);\n\n onProfileStateChange(profileState);\n }, [profileState]);\n\n const determineProfileState = useCallback(() => {\n const container = containerRef.current;\n if (!container) {\n return;\n }\n\n const tabListEl = container.querySelector('.TabList');\n if (!tabListEl) {\n return;\n }\n\n let state: ProfileState = ProfileState.Profile;\n if (container.scrollTop >= tabListEl.offsetTop) {\n state = tabType === 'members'\n ? ProfileState.MemberList\n : ProfileState.SharedMedia;\n }\n\n onProfileStateChange(state);\n }, [containerRef, onProfileStateChange, tabType]);\n\n // Determine profile state when switching tabs\n useEffect(() => {\n if (isScrollingProgrammatically) {\n return;\n }\n\n determineProfileState();\n }, [determineProfileState, tabType]);\n\n // Determine profile state when scrolling\n const handleScroll = useCallback(() => {\n if (isScrollingProgrammatically) {\n return;\n }\n\n runThrottledForScroll(determineProfileState);\n }, [determineProfileState]);\n\n return { handleScroll };\n}\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport { selectCurrentChat, selectUser } from '../../modules/selectors';\nimport { getUserFirstOrLastName } from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n userId?: number;\n onClose: () => void;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n contactName?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst DeleteMemberModal: FC = ({\n isOpen,\n chat,\n userId,\n contactName,\n onClose,\n deleteChatMember,\n}) => {\n const lang = useLang();\n\n const handleDeleteChatMember = useCallback(() => {\n deleteChatMember({ chatId: chat!.id, userId });\n onClose();\n }, [chat, deleteChatMember, onClose, userId]);\n\n if (!chat || !userId) {\n return undefined;\n }\n\n return (\n \n

{renderText(lang('PeerInfo.Confirm.RemovePeer', contactName))}

\n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { userId }): StateProps => {\n const chat = selectCurrentChat(global);\n const user = userId && selectUser(global, userId);\n const contactName = user ? getUserFirstOrLastName(user) : undefined;\n\n return {\n chat,\n contactName,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['deleteChatMember']),\n)(DeleteMemberModal));\n","import React, {\n FC, useCallback, useEffect, useMemo, useRef, useState, memo,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiMessage,\n ApiChatMember,\n ApiUser,\n MAIN_THREAD_ID,\n} from '../../api/types';\nimport { GlobalActions } from '../../global/types';\nimport {\n NewChatMembersProgress, ISettings, MediaViewerOrigin, ProfileState, ProfileTabType, SharedMediaType,\n} from '../../types';\n\nimport {\n MEMBERS_SLICE,\n PROFILE_SENSITIVE_AREA,\n SHARED_MEDIA_SLICE,\n SLIDE_TRANSITION_DURATION,\n} from '../../config';\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport {\n getHasAdminRight, isChatAdmin, isChatChannel, isChatGroup, isChatPrivate,\n} from '../../modules/helpers';\nimport {\n selectChatMessages,\n selectChat,\n selectCurrentMediaSearch,\n selectIsRightColumnShown,\n selectTheme,\n} from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\nimport { captureEvents, SwipeDirection } from '../../util/captureEvents';\nimport useCacheBuster from '../../hooks/useCacheBuster';\nimport useProfileViewportIds from './hooks/useProfileViewportIds';\nimport useProfileState from './hooks/useProfileState';\nimport useTransitionFixes from './hooks/useTransitionFixes';\nimport useAsyncRendering from './hooks/useAsyncRendering';\nimport useLang from '../../hooks/useLang';\n\nimport Transition from '../ui/Transition';\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport TabList from '../ui/TabList';\nimport Spinner from '../ui/Spinner';\nimport ListItem from '../ui/ListItem';\nimport PrivateChatInfo from '../common/PrivateChatInfo';\nimport ProfileInfo from '../common/ProfileInfo';\nimport Document from '../common/Document';\nimport Audio from '../common/Audio';\nimport ChatExtra from '../common/ChatExtra';\nimport Media from '../common/Media';\nimport WebLink from '../common/WebLink';\nimport NothingFound from '../common/NothingFound';\nimport FloatingActionButton from '../ui/FloatingActionButton';\nimport DeleteMemberModal from './DeleteMemberModal';\n\nimport './Profile.scss';\n\ntype OwnProps = {\n chatId: number;\n userId?: number;\n profileState: ProfileState;\n onProfileStateChange: (state: ProfileState) => void;\n};\n\ntype StateProps = {\n theme: ISettings['theme'];\n isChannel?: boolean;\n currentUserId?: number;\n resolvedUserId?: number;\n chatMessages?: Record;\n foundIds?: number[];\n mediaSearchType?: SharedMediaType;\n hasMembersTab?: boolean;\n areMembersHidden?: boolean;\n canAddMembers?: boolean;\n canDeleteMembers?: boolean;\n members?: ApiChatMember[];\n usersById?: Record;\n isRightColumnShown: boolean;\n isRestricted?: boolean;\n lastSyncTime?: number;\n serverTimeOffset: number;\n};\n\ntype DispatchProps = Pick;\n\nconst TABS = [\n { type: 'media', title: 'SharedMediaTab2' },\n { type: 'documents', title: 'SharedFilesTab2' },\n { type: 'links', title: 'SharedLinksTab2' },\n { type: 'audio', title: 'SharedMusicTab2' },\n];\n\nconst HIDDEN_RENDER_DELAY = 1000;\n\nconst Profile: FC = ({\n chatId,\n profileState,\n onProfileStateChange,\n theme,\n isChannel,\n resolvedUserId,\n currentUserId,\n chatMessages,\n foundIds,\n mediaSearchType,\n hasMembersTab,\n areMembersHidden,\n canAddMembers,\n canDeleteMembers,\n members,\n usersById,\n isRightColumnShown,\n isRestricted,\n lastSyncTime,\n setLocalMediaSearchType,\n loadMoreMembers,\n searchMediaMessagesLocal,\n openMediaViewer,\n openAudioPlayer,\n openUserInfo,\n focusMessage,\n loadProfilePhotos,\n setNewChatMembersDialogState,\n serverTimeOffset,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const transitionRef = useRef(null);\n const lang = useLang();\n const [activeTab, setActiveTab] = useState(0);\n const [deletingUserId, setDeletingUserId] = useState();\n\n const tabs = useMemo(() => ([\n ...(hasMembersTab ? [{\n type: 'members', title: isChannel ? 'ChannelSubscribers' : 'GroupMembers',\n }] : []),\n ...TABS,\n ]), [hasMembersTab, isChannel]);\n const tabType = tabs[activeTab].type as ProfileTabType;\n\n const [resultType, viewportIds, getMore, noProfileInfo] = useProfileViewportIds(\n isRightColumnShown, loadMoreMembers, searchMediaMessagesLocal, tabType, mediaSearchType, members,\n usersById, chatMessages, foundIds, chatId, lastSyncTime, serverTimeOffset,\n );\n const activeKey = tabs.findIndex(({ type }) => type === resultType);\n\n const { handleScroll } = useProfileState(containerRef, tabType, profileState, onProfileStateChange);\n\n const { applyTransitionFix, releaseTransitionFix } = useTransitionFixes(containerRef);\n\n const [cacheBuster, resetCacheBuster] = useCacheBuster();\n\n const handleTransitionStop = useCallback(() => {\n releaseTransitionFix();\n resetCacheBuster();\n }, [releaseTransitionFix, resetCacheBuster]);\n\n const handleNewMemberDialogOpen = useCallback(() => {\n setNewChatMembersDialogState(NewChatMembersProgress.InProgress);\n }, [setNewChatMembersDialogState]);\n\n // Update search type when switching tabs\n useEffect(() => {\n setLocalMediaSearchType({ mediaType: tabType });\n }, [setLocalMediaSearchType, tabType]);\n\n const profileId = resolvedUserId || chatId;\n\n useEffect(() => {\n if (lastSyncTime) {\n loadProfilePhotos({ profileId });\n }\n }, [loadProfilePhotos, profileId, lastSyncTime]);\n\n const handleSelectMedia = useCallback((messageId: number) => {\n openMediaViewer({\n chatId: profileId,\n threadId: MAIN_THREAD_ID,\n messageId,\n origin: MediaViewerOrigin.SharedMedia,\n });\n }, [profileId, openMediaViewer]);\n\n const handlePlayAudio = useCallback((messageId: number) => {\n openAudioPlayer({ chatId: profileId, messageId });\n }, [profileId, openAudioPlayer]);\n\n const handleMemberClick = useCallback((id: number) => {\n openUserInfo({ id });\n }, [openUserInfo]);\n\n const handleMessageFocus = useCallback((messageId: number) => {\n focusMessage({ chatId: profileId, messageId });\n }, [profileId, focusMessage]);\n\n const handleDeleteMembersModalClose = useCallback(() => {\n setDeletingUserId(undefined);\n }, []);\n\n useEffect(() => {\n if (!transitionRef.current || !IS_TOUCH_ENV) {\n return undefined;\n }\n\n return captureEvents(transitionRef.current, {\n selectorToPreventScroll: '.Profile',\n onSwipe: ((e, direction) => {\n if (direction === SwipeDirection.Left) {\n setActiveTab(Math.min(activeTab + 1, tabs.length - 1));\n return true;\n } else if (direction === SwipeDirection.Right) {\n setActiveTab(Math.max(0, activeTab - 1));\n return true;\n }\n\n return false;\n }),\n });\n }, [activeTab, tabs.length]);\n\n let renderingDelay;\n const isFirstTab = resultType === 'members' || (!hasMembersTab && resultType === 'media');\n // @optimization Used to unparallelize rendering of message list and profile media\n if (isFirstTab) {\n renderingDelay = !isRightColumnShown ? HIDDEN_RENDER_DELAY : 0;\n // @optimization Used to delay first render of secondary tabs while animating\n } else if (!viewportIds) {\n renderingDelay = SLIDE_TRANSITION_DURATION;\n }\n const canRenderContents = useAsyncRendering([chatId, resultType], renderingDelay);\n\n function getMemberContextAction(id: number) {\n return id === currentUserId || !canDeleteMembers ? undefined : [{\n title: lang('lng_context_remove_from_group'),\n icon: 'stop',\n handler: () => {\n setDeletingUserId(id);\n },\n }];\n }\n\n function renderSharedMedia() {\n if (!viewportIds || !canRenderContents || !chatMessages) {\n // This is just a single-frame delay, so we do not show spinner\n const noSpinner = isFirstTab && viewportIds && !canRenderContents;\n\n return (\n
\n {!noSpinner && }\n
\n );\n }\n\n if (!viewportIds.length) {\n let text: string;\n\n switch (resultType) {\n case 'members':\n text = areMembersHidden ? 'You have no access to group members list.' : 'No members found';\n break;\n case 'documents':\n text = lang('lng_media_file_empty_search');\n break;\n case 'links':\n text = lang('lng_media_link_empty_search');\n break;\n case 'audio':\n text = lang('lng_media_song_empty_search');\n break;\n default:\n text = lang('SharedMedia.EmptyTitle');\n }\n\n return (\n
\n \n
\n );\n }\n\n return (\n \n {resultType === 'media' ? (\n viewportIds!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'documents' ? (\n viewportIds!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'links' ? (\n viewportIds!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'audio' ? (\n viewportIds!.map((id) => chatMessages[id] && (\n \n ))\n ) : resultType === 'members' ? (\n viewportIds!.map((id, i) => (\n handleMemberClick(id)}\n contextActions={getMemberContextAction(id)}\n >\n \n \n ))\n ) : undefined}\n
\n );\n }\n\n return (\n \n {!noProfileInfo && renderProfileInfo(chatId, resolvedUserId)}\n {!isRestricted && (\n \n \n {renderSharedMedia}\n \n \n\n
\n )}\n\n {canAddMembers && (\n \n \n \n )}\n {canDeleteMembers && (\n \n )}\n \n );\n};\n\nfunction renderProfileInfo(chatId: number, resolvedUserId?: number) {\n return (\n
\n \n \n
\n );\n}\n\nfunction buildInfiniteScrollItemSelector(resultType: string) {\n return [\n // Used on first render\n `.shared-media-transition > div:only-child > .${resultType}-list > .scroll-item`,\n // Used after transition\n `.shared-media-transition > div.active > .${resultType}-list > .scroll-item`,\n ].join(', ');\n}\n\nexport default memo(withGlobal(\n (global, { chatId, userId }): StateProps => {\n const chat = selectChat(global, chatId);\n\n const chatMessages = selectChatMessages(global, userId || chatId);\n const { currentType: mediaSearchType, resultsByType } = selectCurrentMediaSearch(global) || {};\n const { foundIds } = (resultsByType && mediaSearchType && resultsByType[mediaSearchType]) || {};\n\n const { byId: usersById } = global.users;\n\n const isGroup = chat && isChatGroup(chat);\n const isChannel = chat && isChatChannel(chat);\n const hasMembersTab = isGroup || (isChannel && isChatAdmin(chat!));\n const members = chat?.fullInfo?.members;\n const areMembersHidden = hasMembersTab && chat && chat.fullInfo && !chat.fullInfo.canViewMembers;\n const canAddMembers = hasMembersTab && chat && (getHasAdminRight(chat, 'inviteUsers') || chat.isCreator);\n const canDeleteMembers = hasMembersTab && chat && (getHasAdminRight(chat, 'banUsers') || chat.isCreator);\n\n let resolvedUserId;\n if (userId) {\n resolvedUserId = userId;\n } else if (isChatPrivate(chatId)) {\n resolvedUserId = chatId;\n }\n\n return {\n theme: selectTheme(global),\n isChannel,\n resolvedUserId,\n chatMessages,\n foundIds,\n mediaSearchType,\n hasMembersTab,\n areMembersHidden,\n canAddMembers,\n canDeleteMembers,\n currentUserId: global.currentUserId,\n isRightColumnShown: selectIsRightColumnShown(global),\n isRestricted: chat?.isRestricted,\n lastSyncTime: global.lastSyncTime,\n serverTimeOffset: global.serverTimeOffset,\n ...(hasMembersTab && members && {\n members,\n usersById,\n }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setLocalMediaSearchType',\n 'loadMoreMembers',\n 'searchMediaMessagesLocal',\n 'openMediaViewer',\n 'openAudioPlayer',\n 'openUserInfo',\n 'focusMessage',\n 'loadProfilePhotos',\n 'setNewChatMembersDialogState',\n ]),\n)(Profile));\n","import { useCallback, useEffect } from '../../../lib/teact/teact';\n\nexport default function useTransitionFixes(\n containerRef: { current: HTMLDivElement | null },\n transitionElSelector = '.Transition.shared-media-transition',\n) {\n // Set `min-height` for shared media container to prevent jumping when switching tabs\n useEffect(() => {\n function setMinHeight() {\n const container = containerRef.current!;\n const transitionEl = container.querySelector(transitionElSelector);\n const tabsEl = container.querySelector('.TabList');\n if (transitionEl && tabsEl) {\n transitionEl.style.minHeight = `${container.offsetHeight - tabsEl.offsetHeight}px`;\n }\n }\n\n setMinHeight();\n\n window.addEventListener('resize', setMinHeight, false);\n\n return () => {\n window.removeEventListener('resize', setMinHeight, false);\n };\n }, [containerRef, transitionElSelector]);\n\n // Workaround for scrollable content flickering during animation.\n const applyTransitionFix = useCallback(() => {\n const container = containerRef.current!;\n if (container.style.overflowY !== 'hidden') {\n const scrollBarWidth = container.offsetWidth - container.clientWidth;\n container.style.overflowY = 'hidden';\n container.style.marginRight = `${scrollBarWidth}px`;\n }\n }, [containerRef]);\n\n const releaseTransitionFix = useCallback(() => {\n const container = containerRef.current!;\n container.style.overflowY = 'scroll';\n container.style.marginRight = '0';\n }, [containerRef]);\n\n return { applyTransitionFix, releaseTransitionFix };\n}\n","import { useCallback, useState } from '../lib/teact/teact';\n\nexport default () => {\n const [cacheBuster, setCacheBuster] = useState(false);\n\n const updateCacheBuster = useCallback(() => {\n setCacheBuster((current) => !current);\n }, []);\n\n return [cacheBuster, updateCacheBuster] as const;\n};\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './RightSearch';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst RightSearchAsync: FC = (props) => {\n const RightSearch = useModuleLoader(Bundles.Extra, 'RightSearch');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return RightSearch ? : ;\n};\n\nexport default memo(RightSearchAsync);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport { OwnProps } from './Management';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nimport Loading from '../../ui/Loading';\n\nconst ManagementAsync: FC = (props) => {\n const Management = useModuleLoader(Bundles.Extra, 'Management');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return Management ? : ;\n};\n\nexport default memo(ManagementAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst StickerSearchAsync: FC = () => {\n const StickerSearch = useModuleLoader(Bundles.Extra, 'StickerSearch');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return StickerSearch ? : ;\n};\n\nexport default memo(StickerSearchAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst GifSearchAsync: FC = () => {\n const GifSearch = useModuleLoader(Bundles.Extra, 'GifSearch');\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return GifSearch ? : ;\n};\n\nexport default memo(GifSearchAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst PollResultsAsync: FC = () => {\n const PollResults = useModuleLoader(Bundles.Extra, 'PollResults');\n\n return PollResults ? : ;\n};\n\nexport default memo(PollResultsAsync);\n","import React, {\n FC, useCallback, useMemo, memo, useState, useEffect,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport {\n ApiChat, ApiChatMember, ApiUpdateConnectionStateType, ApiUser,\n} from '../../api/types';\nimport { NewChatMembersProgress } from '../../types';\n\nimport { pick, unique } from '../../util/iteratees';\nimport { selectChat } from '../../modules/selectors';\nimport searchWords from '../../util/searchWords';\nimport {\n getUserFullName, isChatChannel, isUserBot, sortChatIds,\n} from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport usePrevious from '../../hooks/usePrevious';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Picker from '../common/Picker';\nimport FloatingActionButton from '../ui/FloatingActionButton';\nimport Spinner from '../ui/Spinner';\n\nimport './AddChatMembers.scss';\n\nexport type OwnProps = {\n chatId: number;\n isActive: boolean;\n onNextStep: (memberIds: number[]) => void;\n onClose: NoneToVoidFunction;\n};\n\ntype StateProps = {\n connectionState?: ApiUpdateConnectionStateType;\n isChannel?: boolean;\n members?: ApiChatMember[];\n currentUserId?: number;\n usersById: Record;\n chatsById: Record;\n localContactIds?: number[];\n searchQuery?: string;\n isLoading: boolean;\n isSearching?: boolean;\n localUserIds?: number[];\n globalUserIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst AddChatMembers: FC = ({\n isChannel,\n connectionState,\n members,\n onNextStep,\n currentUserId,\n usersById,\n chatsById,\n localContactIds,\n isLoading,\n searchQuery,\n isSearching,\n localUserIds,\n globalUserIds,\n setUserSearchQuery,\n onClose,\n isActive,\n loadContactList,\n}) => {\n const lang = useLang();\n const [selectedMemberIds, setSelectedMemberIds] = useState([]);\n const prevSelectedMemberIds = usePrevious(selectedMemberIds);\n const noPickerScrollRestore = prevSelectedMemberIds === selectedMemberIds;\n\n useEffect(() => {\n if (isActive && connectionState === 'connectionStateReady') {\n loadContactList();\n }\n }, [connectionState, isActive, loadContactList]);\n\n useHistoryBack(isActive, onClose);\n\n const memberIds = useMemo(() => {\n return members ? members.map((member) => member.userId) : [];\n }, [members]);\n\n const handleFilterChange = useCallback((query: string) => {\n setUserSearchQuery({ query });\n }, [setUserSearchQuery]);\n\n const displayedIds = useMemo(() => {\n const contactIds = localContactIds\n ? sortChatIds(localContactIds.filter((id) => id !== currentUserId), chatsById)\n : [];\n\n if (!searchQuery) {\n return contactIds.filter((id) => !memberIds.includes(id));\n }\n\n const foundContactIds = contactIds.filter((id) => {\n const user = usersById[id];\n if (!user) {\n return false;\n }\n const fullName = getUserFullName(user);\n return fullName && searchWords(fullName, searchQuery);\n });\n\n return sortChatIds(\n unique([\n ...foundContactIds,\n ...(localUserIds || []),\n ...(globalUserIds || []),\n ]).filter((contactId) => {\n const user = usersById[contactId];\n\n // The user can be added to the chat if the following conditions are met:\n // the user has not yet been added to the current chat\n // AND (it is not found (user from global search) OR it is not a bot OR it is a bot,\n // but the current chat is not a channel AND the appropriate permission is set).\n return !memberIds.includes(contactId)\n && (!user || !isUserBot(user) || (!isChannel && user.canBeInvitedToGroup));\n }),\n chatsById,\n );\n }, [\n localContactIds, chatsById, searchQuery, localUserIds, globalUserIds,\n currentUserId, usersById, memberIds, isChannel,\n ]);\n\n const handleNextStep = useCallback(() => {\n if (selectedMemberIds.length) {\n setUserSearchQuery({ query: '' });\n onNextStep(selectedMemberIds);\n }\n }, [selectedMemberIds, setUserSearchQuery, onNextStep]);\n\n return (\n
\n
\n \n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { userIds: localContactIds } = global.contactList || {};\n const { byId: usersById } = global.users;\n const { byId: chatsById } = global.chats;\n const { currentUserId, newChatMembersProgress, connectionState } = global;\n const isChannel = chat && isChatChannel(chat);\n\n const {\n query: searchQuery,\n fetchingStatus,\n globalUserIds,\n localUserIds,\n } = global.userSearch;\n\n return {\n isChannel,\n members: chat?.fullInfo?.members,\n currentUserId,\n usersById,\n chatsById,\n localContactIds,\n searchQuery,\n isSearching: fetchingStatus,\n isLoading: newChatMembersProgress === NewChatMembersProgress.Loading,\n globalUserIds,\n localUserIds,\n connectionState,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadContactList', 'setUserSearchQuery']),\n)(AddChatMembers));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport {\n ManagementScreens, NewChatMembersProgress, ProfileState, RightColumnContent,\n} from '../../types';\n\nimport { MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN } from '../../config';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport { pick } from '../../util/iteratees';\nimport {\n selectAreActiveChatsLoaded,\n selectCurrentMessageList,\n selectRightColumnContentKey,\n} from '../../modules/selectors';\nimport useLayoutEffectWithPrevDeps from '../../hooks/useLayoutEffectWithPrevDeps';\nimport useWindowSize from '../../hooks/useWindowSize';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport RightHeader from './RightHeader';\nimport Profile from './Profile';\nimport Transition from '../ui/Transition';\nimport RightSearch from './RightSearch.async';\nimport Management from './management/Management.async';\nimport StickerSearch from './StickerSearch.async';\nimport GifSearch from './GifSearch.async';\nimport PollResults from './PollResults.async';\nimport AddChatMembers from './AddChatMembers';\n\nimport './RightColumn.scss';\n\ntype StateProps = {\n contentKey?: RightColumnContent;\n chatId?: number;\n threadId?: number;\n currentProfileUserId?: number;\n isChatSelected: boolean;\n shouldSkipHistoryAnimations?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst COLUMN_CLOSE_DELAY_MS = 300;\nconst MAIN_SCREENS_COUNT = Object.keys(RightColumnContent).length / 2;\nconst MANAGEMENT_SCREENS_COUNT = Object.keys(ManagementScreens).length / 2;\n\nfunction blurSearchInput() {\n const searchInput = document.querySelector('.RightHeader .SearchInput input') as HTMLInputElement;\n if (searchInput) {\n searchInput.blur();\n }\n}\n\nconst RightColumn: FC = ({\n contentKey,\n chatId,\n threadId,\n currentProfileUserId,\n isChatSelected,\n toggleChatInfo,\n toggleManagement,\n openUserInfo,\n closeLocalTextSearch,\n setStickerSearchQuery,\n setGifSearchQuery,\n closePollResults,\n addChatMembers,\n setNewChatMembersDialogState,\n shouldSkipHistoryAnimations,\n}) => {\n const { width: windowWidth } = useWindowSize();\n const [profileState, setProfileState] = useState(ProfileState.Profile);\n const [managementScreen, setManagementScreen] = useState(ManagementScreens.Initial);\n const [selectedChatMemberId, setSelectedChatMemberId] = useState();\n const [isPromotedByCurrentUser, setIsPromotedByCurrentUser] = useState();\n const isScrolledDown = profileState !== ProfileState.Profile;\n\n const isOpen = contentKey !== undefined;\n const isProfile = contentKey === RightColumnContent.ChatInfo || contentKey === RightColumnContent.UserInfo;\n const isSearch = contentKey === RightColumnContent.Search;\n const isManagement = contentKey === RightColumnContent.Management;\n const isStickerSearch = contentKey === RightColumnContent.StickerSearch;\n const isGifSearch = contentKey === RightColumnContent.GifSearch;\n const isPollResults = contentKey === RightColumnContent.PollResults;\n const isAddingChatMembers = contentKey === RightColumnContent.AddingMembers;\n const isOverlaying = windowWidth <= MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN;\n\n const [shouldSkipTransition, setShouldSkipTransition] = useState(!isOpen);\n\n const renderingContentKey = useCurrentOrPrev(contentKey, true, !isChatSelected) ?? -1;\n\n const close = useCallback((shouldScrollUp = true) => {\n switch (contentKey) {\n case RightColumnContent.AddingMembers:\n setNewChatMembersDialogState(NewChatMembersProgress.Closed);\n break;\n case RightColumnContent.ChatInfo:\n if (isScrolledDown && shouldScrollUp) {\n setProfileState(ProfileState.Profile);\n break;\n }\n toggleChatInfo(undefined, true);\n break;\n case RightColumnContent.UserInfo:\n if (isScrolledDown && shouldScrollUp) {\n setProfileState(ProfileState.Profile);\n break;\n }\n openUserInfo({ id: undefined }, true);\n break;\n case RightColumnContent.Management: {\n switch (managementScreen) {\n case ManagementScreens.Initial:\n toggleManagement();\n break;\n case ManagementScreens.ChatPrivacyType:\n case ManagementScreens.Discussion:\n case ManagementScreens.GroupPermissions:\n case ManagementScreens.GroupType:\n case ManagementScreens.ChatAdministrators:\n case ManagementScreens.ChannelSubscribers:\n case ManagementScreens.GroupMembers:\n setManagementScreen(ManagementScreens.Initial);\n break;\n case ManagementScreens.GroupUserPermissionsCreate:\n case ManagementScreens.GroupRemovedUsers:\n case ManagementScreens.GroupUserPermissions:\n setManagementScreen(ManagementScreens.GroupPermissions);\n setSelectedChatMemberId(undefined);\n setIsPromotedByCurrentUser(undefined);\n break;\n case ManagementScreens.ChatAdminRights:\n case ManagementScreens.GroupRecentActions:\n setManagementScreen(ManagementScreens.ChatAdministrators);\n break;\n }\n\n break;\n }\n case RightColumnContent.Search: {\n blurSearchInput();\n closeLocalTextSearch();\n break;\n }\n case RightColumnContent.StickerSearch:\n blurSearchInput();\n setStickerSearchQuery({ query: undefined });\n break;\n case RightColumnContent.GifSearch: {\n blurSearchInput();\n setGifSearchQuery({ query: undefined });\n break;\n }\n case RightColumnContent.PollResults:\n closePollResults();\n break;\n }\n }, [\n contentKey, isScrolledDown, toggleChatInfo, openUserInfo, closePollResults, setNewChatMembersDialogState,\n managementScreen, toggleManagement, closeLocalTextSearch, setStickerSearchQuery, setGifSearchQuery,\n ]);\n\n const handleSelectChatMember = useCallback((memberId, isPromoted) => {\n setSelectedChatMemberId(memberId);\n setIsPromotedByCurrentUser(isPromoted);\n }, []);\n\n const handleAppendingChatMembers = useCallback((memberIds: number[]) => {\n addChatMembers({ chatId, memberIds });\n }, [addChatMembers, chatId]);\n\n useEffect(() => (isOpen ? captureEscKeyListener(close) : undefined), [isOpen, close]);\n\n useEffect(() => {\n setTimeout(() => {\n setShouldSkipTransition(!isOpen);\n }, COLUMN_CLOSE_DELAY_MS);\n }, [isOpen]);\n\n // Close Right Column when it transforms into overlayed state on screen resize\n useEffect(() => {\n if (isOpen && isOverlaying) {\n close();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOverlaying]);\n\n // We need to clear profile state and management screen state, when changing chats\n useLayoutEffectWithPrevDeps(([prevContentKey, prevChatId]) => {\n if (\n (prevContentKey === RightColumnContent.ChatInfo && contentKey === RightColumnContent.UserInfo)\n || (prevContentKey === RightColumnContent.UserInfo && contentKey === RightColumnContent.ChatInfo)\n || (prevChatId !== chatId)\n ) {\n setProfileState(ProfileState.Profile);\n setManagementScreen(ManagementScreens.Initial);\n }\n }, [contentKey, chatId]);\n\n useHistoryBack(isChatSelected && (contentKey === RightColumnContent.ChatInfo\n || contentKey === RightColumnContent.UserInfo || contentKey === RightColumnContent.Management\n || contentKey === RightColumnContent.AddingMembers),\n () => close(false), toggleChatInfo);\n\n // eslint-disable-next-line consistent-return\n function renderContent(isActive: boolean) {\n if (renderingContentKey === -1) {\n return undefined;\n }\n\n switch (renderingContentKey) {\n case RightColumnContent.AddingMembers:\n return (\n \n );\n case RightColumnContent.ChatInfo:\n case RightColumnContent.UserInfo:\n return (\n \n );\n case RightColumnContent.Search:\n return ;\n case RightColumnContent.Management:\n return (\n \n );\n\n case RightColumnContent.StickerSearch:\n return ;\n case RightColumnContent.GifSearch:\n return ;\n case RightColumnContent.PollResults:\n return ;\n }\n }\n\n return (\n \n {isOverlaying && (\n
\n )}\n
\n \n \n {renderContent}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n const areActiveChatsLoaded = selectAreActiveChatsLoaded(global);\n\n return {\n contentKey: selectRightColumnContentKey(global),\n chatId,\n threadId,\n currentProfileUserId: global.users.selectedId,\n isChatSelected: Boolean(chatId && areActiveChatsLoaded),\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openUserInfo',\n 'toggleChatInfo',\n 'toggleManagement',\n 'closeLocalTextSearch',\n 'setStickerSearchQuery',\n 'setGifSearchQuery',\n 'closePollResults',\n 'addChatMembers',\n 'setNewChatMembersDialogState',\n ]),\n)(RightColumn));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport { Bundles } from '../../util/moduleLoader';\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\ninterface OwnProps {\n isOpen: boolean;\n}\n\nconst MediaViewerAsync: FC = ({ isOpen }) => {\n const MediaViewer = useModuleLoader(Bundles.Extra, 'MediaViewer', !isOpen);\n\n return MediaViewer ? : undefined;\n};\n\nexport default memo(MediaViewerAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst NotificationsAsync: FC = ({ isOpen }) => {\n const Notifications = useModuleLoader(Bundles.Extra, 'Notifications', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return Notifications ? : undefined;\n};\n\nexport default memo(NotificationsAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst DialogsAsync: FC = ({ isOpen }) => {\n const Dialogs = useModuleLoader(Bundles.Extra, 'Dialogs', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return Dialogs ? : undefined;\n};\n\nexport default memo(DialogsAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\nimport { OwnProps } from './ForwardPicker';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst ForwardPickerAsync: FC = (props) => {\n const { isOpen } = props;\n const ForwardPicker = useModuleLoader(Bundles.Extra, 'ForwardPicker', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ForwardPicker ? : undefined;\n};\n\nexport default memo(ForwardPickerAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport { OwnProps } from './SafeLinkModal';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst SafeLinkModalAsync: FC = (props) => {\n const { url } = props;\n const SafeLinkModal = useModuleLoader(Bundles.Extra, 'SafeLinkModal', !url);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return SafeLinkModal ? : undefined;\n};\n\nexport default memo(SafeLinkModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport { OwnProps } from './HistoryCalendar';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst HistoryCalendarAsync: FC = (props) => {\n const { isOpen } = props;\n const HistoryCalendar = useModuleLoader(Bundles.Extra, 'HistoryCalendar', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return HistoryCalendar ? : undefined;\n};\n\nexport default memo(HistoryCalendarAsync);\n","import React, {\n FC, useEffect, memo, useCallback,\n} from '../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiMessage } from '../../api/types';\nimport { LangCode } from '../../types';\n\nimport '../../modules/actions/all';\nimport {\n BASE_EMOJI_KEYWORD_LANG, DEBUG, INACTIVE_MARKER, PAGE_TITLE,\n} from '../../config';\nimport { pick } from '../../util/iteratees';\nimport {\n selectChatMessage,\n selectCountNotMutedUnread,\n selectIsForwardModalOpen,\n selectIsMediaViewerOpen,\n selectIsRightColumnShown,\n} from '../../modules/selectors';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport buildClassName from '../../util/buildClassName';\nimport { fastRaf } from '../../util/schedulers';\nimport { waitForTransitionEnd } from '../../util/cssAnimationEndListeners';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useBackgroundMode from '../../hooks/useBackgroundMode';\nimport useBeforeUnload from '../../hooks/useBeforeUnload';\nimport useOnChange from '../../hooks/useOnChange';\nimport usePreventIosPinchZoom from '../../hooks/usePreventIosPinchZoom';\nimport { processDeepLink } from '../../util/deeplink';\nimport { LOCATION_HASH } from '../../hooks/useHistoryBack';\n\nimport LeftColumn from '../left/LeftColumn';\nimport MiddleColumn from '../middle/MiddleColumn';\nimport RightColumn from '../right/RightColumn';\nimport MediaViewer from '../mediaViewer/MediaViewer.async';\nimport AudioPlayer from '../middle/AudioPlayer';\nimport Notifications from './Notifications.async';\nimport Dialogs from './Dialogs.async';\nimport ForwardPicker from './ForwardPicker.async';\nimport SafeLinkModal from './SafeLinkModal.async';\nimport HistoryCalendar from './HistoryCalendar.async';\nimport StickerSetModal from '../common/StickerSetModal.async';\n\nimport './Main.scss';\n\ntype StateProps = {\n animationLevel: number;\n lastSyncTime?: number;\n isLeftColumnShown: boolean;\n isRightColumnShown: boolean;\n isMediaViewerOpen: boolean;\n isForwardModalOpen: boolean;\n hasNotifications: boolean;\n hasDialogs: boolean;\n audioMessage?: ApiMessage;\n safeLinkModalUrl?: string;\n isHistoryCalendarOpen: boolean;\n shouldSkipHistoryAnimations?: boolean;\n language?: LangCode;\n openedStickerSetShortName?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst NOTIFICATION_INTERVAL = 1000;\n\nlet notificationInterval: number | undefined;\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nlet DEBUG_isLogged = false;\n\nconst Main: FC = ({\n lastSyncTime,\n isLeftColumnShown,\n isRightColumnShown,\n isMediaViewerOpen,\n isForwardModalOpen,\n animationLevel,\n hasNotifications,\n hasDialogs,\n audioMessage,\n safeLinkModalUrl,\n isHistoryCalendarOpen,\n shouldSkipHistoryAnimations,\n language,\n openedStickerSetShortName,\n loadAnimatedEmojis,\n loadNotificationSettings,\n loadNotificationExceptions,\n updateIsOnline,\n loadTopInlineBots,\n loadEmojiKeywords,\n loadCountryList,\n openStickerSetShortName,\n}) => {\n if (DEBUG && !DEBUG_isLogged) {\n DEBUG_isLogged = true;\n // eslint-disable-next-line no-console\n console.log('>>> RENDER MAIN');\n }\n\n // Initial API calls\n useEffect(() => {\n if (lastSyncTime) {\n updateIsOnline(true);\n loadAnimatedEmojis();\n loadNotificationSettings();\n loadNotificationExceptions();\n loadTopInlineBots();\n\n loadEmojiKeywords({ language: BASE_EMOJI_KEYWORD_LANG });\n if (language !== BASE_EMOJI_KEYWORD_LANG) {\n loadEmojiKeywords({ language });\n }\n\n loadCountryList({ langCode: language });\n }\n }, [\n lastSyncTime, loadAnimatedEmojis, loadNotificationExceptions, loadNotificationSettings, updateIsOnline,\n loadTopInlineBots, loadEmojiKeywords, loadCountryList, language,\n ]);\n\n useEffect(() => {\n if (lastSyncTime && LOCATION_HASH.startsWith('#?tgaddr=')) {\n processDeepLink(decodeURIComponent(LOCATION_HASH.substr('#?tgaddr='.length)));\n }\n }, [lastSyncTime]);\n\n const {\n transitionClassNames: middleColumnTransitionClassNames,\n } = useShowTransition(!isLeftColumnShown, undefined, true, undefined, shouldSkipHistoryAnimations);\n\n const {\n transitionClassNames: rightColumnTransitionClassNames,\n } = useShowTransition(isRightColumnShown, undefined, true, undefined, shouldSkipHistoryAnimations);\n\n const className = buildClassName(\n middleColumnTransitionClassNames.replace(/([\\w-]+)/g, 'middle-column-$1'),\n rightColumnTransitionClassNames.replace(/([\\w-]+)/g, 'right-column-$1'),\n shouldSkipHistoryAnimations && 'history-animation-disabled',\n );\n\n // Dispatch heavy transition event when opening middle column\n useOnChange(([prevIsLeftColumnShown]) => {\n if (prevIsLeftColumnShown === undefined || animationLevel === 0) {\n return;\n }\n\n const dispatchHeavyAnimationEnd = dispatchHeavyAnimationEvent();\n\n waitForTransitionEnd(document.getElementById('MiddleColumn')!, dispatchHeavyAnimationEnd);\n }, [isLeftColumnShown]);\n\n // Dispatch heavy transition event and add body class when opening right column\n useOnChange(([prevIsRightColumnShown]) => {\n if (prevIsRightColumnShown === undefined || animationLevel === 0) {\n return;\n }\n\n fastRaf(() => {\n document.body.classList.add('animating-right-column');\n });\n\n const dispatchHeavyAnimationEnd = dispatchHeavyAnimationEvent();\n\n waitForTransitionEnd(document.getElementById('RightColumn')!, () => {\n dispatchHeavyAnimationEnd();\n\n fastRaf(() => {\n document.body.classList.remove('animating-right-column');\n });\n });\n }, [isRightColumnShown]);\n\n const handleBlur = useCallback(() => {\n updateIsOnline(false);\n\n const initialUnread = selectCountNotMutedUnread(getGlobal());\n let index = 0;\n\n clearInterval(notificationInterval);\n notificationInterval = window.setInterval(() => {\n if (document.title.includes(INACTIVE_MARKER)) {\n updateIcon(false);\n return;\n }\n\n if (index % 2 === 0) {\n const newUnread = selectCountNotMutedUnread(getGlobal()) - initialUnread;\n if (newUnread > 0) {\n updatePageTitle(`${newUnread} notification${newUnread > 1 ? 's' : ''}`);\n updateIcon(true);\n }\n } else {\n updatePageTitle(PAGE_TITLE);\n updateIcon(false);\n }\n\n index++;\n }, NOTIFICATION_INTERVAL);\n }, [updateIsOnline]);\n\n const handleFocus = useCallback(() => {\n updateIsOnline(true);\n\n clearInterval(notificationInterval);\n notificationInterval = undefined;\n\n if (!document.title.includes(INACTIVE_MARKER)) {\n updatePageTitle(PAGE_TITLE);\n }\n\n updateIcon(false);\n }, [updateIsOnline]);\n\n const handleStickerSetModalClose = useCallback(() => {\n openStickerSetShortName({ stickerSetShortName: undefined });\n }, [openStickerSetShortName]);\n\n // Online status and browser tab indicators\n useBackgroundMode(handleBlur, handleFocus);\n useBeforeUnload(handleBlur);\n\n usePreventIosPinchZoom(isMediaViewerOpen);\n\n function stopEvent(e: React.MouseEvent) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n return (\n
\n \n \n \n \n \n \n \n {audioMessage && }\n \n \n \n
\n );\n};\n\nfunction updateIcon(asUnread: boolean) {\n document.querySelectorAll('link[rel=\"icon\"]')\n .forEach((link) => {\n if (asUnread) {\n if (!link.href.includes('favicon-unread')) {\n link.href = link.href.replace('favicon', 'favicon-unread');\n }\n } else {\n link.href = link.href.replace('favicon-unread', 'favicon');\n }\n });\n}\n\n// For some reason setting `document.title` to the same value\n// causes increment of Chrome Dev Tools > Performance Monitor > DOM Nodes counter\nfunction updatePageTitle(nextTitle: string) {\n if (document.title !== nextTitle) {\n document.title = nextTitle;\n }\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { chatId: audioChatId, messageId: audioMessageId } = global.audioPlayer;\n const audioMessage = audioChatId && audioMessageId\n ? selectChatMessage(global, audioChatId, audioMessageId)\n : undefined;\n\n return {\n animationLevel: global.settings.byKey.animationLevel,\n lastSyncTime: global.lastSyncTime,\n isLeftColumnShown: global.isLeftColumnShown,\n isRightColumnShown: selectIsRightColumnShown(global),\n isMediaViewerOpen: selectIsMediaViewerOpen(global),\n isForwardModalOpen: selectIsForwardModalOpen(global),\n hasNotifications: Boolean(global.notifications.length),\n hasDialogs: Boolean(global.dialogs.length),\n audioMessage,\n safeLinkModalUrl: global.safeLinkModalUrl,\n isHistoryCalendarOpen: Boolean(global.historyCalendarSelectedAt),\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n language: global.settings.byKey.language,\n openedStickerSetShortName: global.openedStickerSetShortName,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadAnimatedEmojis', 'loadNotificationSettings', 'loadNotificationExceptions', 'updateIsOnline',\n 'loadTopInlineBots', 'loadEmojiKeywords', 'openStickerSetShortName', 'loadCountryList',\n ]),\n)(Main));\n","import { getDispatch } from '../lib/teact/teactn';\n\nexport const processDeepLink = (url: string) => {\n const { protocol, searchParams, pathname } = new URL(url);\n\n if (protocol !== 'tg:') return;\n\n const { openChatByUsername, openStickerSetShortName } = getDispatch();\n\n const method = pathname.replace(/^\\/\\//, '');\n const params: Record = {};\n searchParams.forEach((value, key) => {\n params[key] = value;\n });\n\n switch (method) {\n case 'resolve': {\n const {\n domain,\n } = params;\n\n if (domain !== 'telegrampassport') {\n openChatByUsername({\n username: domain,\n });\n }\n break;\n }\n case 'privatepost':\n\n break;\n case 'bg':\n\n break;\n case 'join':\n\n break;\n case 'addstickers': {\n const { set } = params;\n\n openStickerSetShortName({\n stickerSetShortName: set,\n });\n break;\n }\n case 'msg':\n\n break;\n default:\n // Unsupported deeplink\n\n break;\n }\n};\n","import { getDispatch, getGlobal } from '../lib/teact/teactn';\n\nimport { DEBUG } from '../config';\n\nexport { default as Main } from '../components/main/Main';\n\nif (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH LOAD MAIN BUNDLE');\n}\n\nif (!getGlobal().connectionState) {\n getDispatch().initApi();\n}\n"],"names":["closeLocalTextSearch","global","chatId","threadId","selectCurrentMessageList","updateLocalTextSearch","replaceLocalTextSearchResults","undefined","addReducer","actions","payload","query","chatThreadKey","buildChatThreadKey","currentQuery","localTextSearch","byChatThreadKey","MEMO_EMPTY_ARRAY","mediaType","updateLocalMediaSearchType","id","type","shouldReplaceHistory","currentMessageList","replaceThreadParam","exitMessageSelectMode","messages","contentToBeScheduled","forwardMessages","toChatId","setGlobal","updateCurrentMessageList","isChatInfoShown","openChat","chatCreation","newChatMembersProgress","targetIndexDelta","orderedIds","position","indexOf","nextId","FOCUS_NO_HIGHLIGHT_DURATION","FAST_SMOOTH_MAX_DURATION","ANIMATION_END_DELAY","blurTimeout","scrollOffset","messageId","paramName","chatMessages","selectChatMessages","viewportIds","selectViewportIds","lastOwnEditableMessageId","findLast","Boolean","selectAllowedMessageActions","canEdit","replyingToId","selectReplyingToId","selectIsViewportNewest","chatMessageKeys","Object","keys","newIndex","toString","length","Number","MAIN_THREAD_ID","chat","selectChat","lastMessage","threadInfo","selectThreadInfo","lastMessageId","setReplyingToId","focusMessage","avatarOwnerId","profilePhotoIndex","origin","mediaViewer","audioPlayer","selectIsRightColumnShown","pollResults","voters","window","setTimeout","newGlobal","getGlobal","noHighlight","replyStack","selectReplyStack","pop","focusLastMessage","messageListType","groupedId","groupedChatId","replyMessageId","isResizingContainer","ids","selectForwardedMessageIdsByGroupId","shouldSwitchChat","clearTimeout","updateFocusedMessage","updateFocusDirection","FocusDirection","includes","direction","loadViewportMessages","fromChatId","messageIds","groupedMessageIds","selectMessageIdsByGroupId","isModalShown","closeMediaViewer","selectedMessages","openForwardMenu","selectCurrentChat","enterMessageSelectMode","childMessageIds","withShift","toggleMessageSelection","shouldShowContextMenuHint","disableContextMenuHint","showNotification","message","IS_TOUCH_ENV","isPollModalOpen","globalSearch","updateGlobalSearch","globalResults","localResults","resultsByType","fetchingStatus","chats","recentlyFoundChatIds","newRecentIds","filter","unshift","content","updateGlobalSearchContent","stickers","search","resultIds","gifs","offsetId","results","updateSelectedUserId","updateUserSearch","globalUserIds","localUserIds","management","byChatId","isActive","IS_SINGLE_COLUMN_LAYOUT","IS_TABLET_COLUMN_LAYOUT","isLeftColumnShown","messageLists","action","emoji","recentEmojis","newEmojis","e","sticker","recent","hash","newStickers","s","notification","localId","generateIdFor","newNotifications","notifications","existingNotificationIndex","findIndex","n","splice","push","data","hasErrorKey","getReadableErrorText","newDialogs","dialogs","existingErrorIndex","err","url","safeLinkModalUrl","selectedAt","historyCalendarSelectedAt","payment","isPaymentModalOpen","clearPayment","closeInvoice","error","runThrottledForLoadChats","throttle","cb","runThrottledForLoadTopChats","runDebouncedForLoadFullChat","debounce","async","loadChats","listType","offsetDate","result","callApi","limit","CHAT_LIST_LOAD_SLICE","archived","withPinned","orderedPinnedIds","serverTimeOffset","chatIds","shift","addUsers","buildCollectionByKey","users","updateChats","updateChatListIds","updateChatListSecondaryInfo","draftsById","map","forEach","replyingToById","isFullyLoaded","loadFullChat","fullInfo","updateChat","openChatByUsername","username","channelPostId","localChat","selectChatByUsername","isMin","previousChat","preloadedChatIds","i","TOP_CHAT_MESSAGES_PRELOAD_LIMIT","pause","byId","listIds","active","currentChatId","pinnedChats","otherChats","prepareChatList","chatToPreload","find","currentUserId","hasUnreadMark","toggleChatUnread","requestThreadInfoUpdate","isChatSummaryOnly","requestChatUpdate","user","selectUser","selectThreadTopMessageId","selectSupportChat","langCode","usernamePostfix","LOCALIZED_TIPS","toUpperCase","TIPS_USERNAME","oldestChat","selectIsChatPinned","sort","chat1","chat2","date","force","isMuted","title","about","photo","memberIds","progress","ChatCreationProgress","createdChannel","channelId","accessHash","getDispatch","createChannel","userId","activeChat","activeChannel","createdChat","createGroupChat","folderId","folder","selectChatFolder","shouldBePinned","pinnedChatIds","includedChatIds","newPinnedIds","pinnedId","newIncludedChatIds","folderUpdate","selectChatListType","isPinned","ARCHIVED_FOLDER_ID","isChatArchived","chatFolders","loadChatFolders","recommendedChatFolders","recommended","loadRecommendedChatFolders","emoticon","maxId","recommendedId","description","newFolder","createChatFolder","Math","max","apply","deleteChatFolder","unreadCount","match","RE_TME_INVITE_LINK","RE_TME_LINK","chatOrChannelPostId","isEnabled","isChatBasicGroup","bannedRights","chatAfterUpdate","members","kickedMembers","isBanned","viewMessages","isUnblocked","m","adminRights","customTitle","adminMembers","isDismissed","updateManagementProgress","ManagementProgress","Promise","all","groups","addedById","reduce","group","addChats","forDiscussionIds","channel","fullChat","isPreHistoryHidden","linkedChatId","activeChatFolder","offset","setNewChatMembersDialogState","NewChatMembersProgress","uploadProgressCallbacks","Map","runDebouncedForMarkRead","isOutlying","isBudgetPreload","addOffset","LoadMoreDirection","round","MESSAGE_LIST_SLICE","selectThreadOriginChat","threadInfos","addChatMessagesById","updateOutlyingIds","updateListedIds","updateThreadInfos","listedIds","selectListedIds","outlyingIds","selectOutlyingIds","areSortedArraysIntersecting","historyIds","newViewportIds","getViewportSlice","safeReplaceViewportIds","sourceIds","index","findClosestIndex","indexForDirection","from","to","slice","areSomeLocal","areAllLocal","sendMessage","params","progressCallback","attachment","messageLocalId","has","set","fileUploads","byMessageLocalId","replyingTo","IS_IOS","rafPromise","delete","isRestricted","resolve","loadWithBudget","selectFocusedMessageId","selectRealLastReadId","replyOriginForId","threadUpdate","MESSAGE_DELETED","replyMessage","selectChatMessage","updateChatMessage","replyToMessageId","loadMessage","isDeleting","updateThreadUnreadFromForwardedMessage","scheduledAt","clearWebPagePreview","value","noWebPage","selectNoWebPage","isSingle","attachments","isGrouped","restParams","text","entities","commonParams","groupedAttachments","split","MAX_MEDIA_FILES_FOR_ALBUM","firstAttachment","restAttachments","Date","now","selectEditingMessage","setEditingId","get","previousLocalId","cancelApiProgress","apiUpdate","draft","replyToMsgId","draftDate","localOnly","selectDraft","isUnpin","isOneSide","isSilent","unpinAllMessages","shouldDeleteForAll","editingId","selectEditingId","selectEditingScheduledId","reason","peer","minId","selectFirstUnreadId","readCount","count","l","countSortedIds","lastReadInboxMessageId","webPagePreview","loadWebPagePreview","options","option","shouldResetVoters","v","a","offsets","nextOffset","loadPollOptionResults","fromChat","toChat","b","scheduledMessages","historyHash","replaceScheduledMessages","loadScheduledHistory","selectScheduledMessage","loadPinnedMessages","searchThrottled","searchGifs","updateGifSearch","added","addedStickers","updateStickerSets","sets","loadStickerSets","setIds","addedSetIds","loadStickers","stickerSetId","recentStickers","loadRecentStickers","favorite","favoriteStickers","loadFavoriteStickers","greeting","featured","featuredStickers","loadFeaturedStickers","stickerSetShortName","stickerSetAccessHash","stickerSet","selectStickerSet","packs","updateStickerSet","currentEmoji","forEmoji","rebuildStickersForEmoji","replaceAnimatedEmojis","loadAnimatedEmojis","saved","savedGifs","loadSavedGifs","unfave","unfaveSticker","installedDate","language","currentEmojiKeywords","emojiKeywords","isLoading","fromVersion","version","keywords","setsById","searchWords","searchStickers","updateStickersForEmoji","loadStickersForEmoji","openedStickerSetShortName","searchMessagesGlobal","offsetRate","maxDate","minDate","localResult","chatOrUser","GLOBAL_SEARCH_SLICE","totalCount","nextOffsetId","nextRate","currentSearchQuery","selectCurrentGlobalSearchQuery","updateGlobalSearchFetchingStatus","addMessages","updateGlobalSearchResults","loadAndReplaceArchivedChats","updateUsers","replaceChatListIds","loadAndUpdateUsers","userIds","contactIds","contactList","updatedUsers","loadTopMessages","localChats","localUsers","globalChats","globalUsers","searchChats","timestampPlusDay","foundIds","currentSearch","selectCurrentTextSearch","topMessageId","MESSAGE_SEARCH_SLICE","newFoundIds","updateLocalTextSearchResults","searchTextMessages","peerId","selectCurrentMediaSearchPeerId","selectCurrentMediaSearch","currentType","currentResults","SHARED_MEDIA_SLICE","updateLocalMediaSearchResults","searchSharedMedia","timestamp","searchMessagesByDate","updateManagement","isUsernameAvailable","afterSyncCallback","DEBUG","console","log","savedUsers","savedPrivateChatIds","savedChats","selectedChat","isChatPrivate","selectedChatUser","replaceChats","loadAndReplaceChats","areMessagesLoaded","currentThreadId","draftsByChatId","acc","newCurrentChatId","currentMessageListInfo","threadsById","originChannelId","currentMessageListInfoOrigin","resultOrigin","byIdOrigin","listedIdsOrigin","Array","prototype","concat","replaceUsers","audioChatId","audioMessageId","closeAudioPlayer","loadAndReplaceMessages","lastSyncTime","sync","afterSync","runDebouncedForFetchFullUser","runThrottledForSearch","replaceInlineBotSettings","inlineBotSettings","inlineBots","byUsername","replaceInlineBotsIsLoading","topPeers","lastRequestedAt","getServerTime","usersHash","loadTopUsers","getCompareString","lastName","firstName","collator","Intl","Collator","sortedUsers","compare","isSelf","loadContactList","updateChatMutedState","phone","phoneNumber","updateUser","updateContact","deleteUser","profileId","isPrivate","photos","userSearch","updateUserSearchFetchingStatus","searchUsers","runDebouncedForSearch","sendBotCommand","command","button","openTelegramLink","toggleSafeLinkModal","showDialog","alert","isError","answerCallbackButton","openPollModal","getReceipt","receiptMessageId","getPaymentForm","setInvoiceMessageInfo","openPaymentModal","bot","selectChatBot","removeBlockedContact","topInlineBots","newHash","inlineBotData","inlineBot","switchPm","canLoadMore","shouldReplaceSettings","newInlineBotData","currentIds","Set","newResults","help","isGallery","searchInlineBot","queryId","resultId","botId","param","startParam","replaceSettings","hasPassword","updateTwoFaSettings","hint","currentPassword","onSuccess","isSuccess","password","email","waitingEmailCodeLength","code","requestInfo","saveInfo","selectPaymentChatId","selectPaymentMessageId","shouldSave","shippingOptions","setRequestInfoId","updateShippingOptions","setPaymentStep","PaymentStep","validateRequestedInfo","setPaymentForm","step","invoice","shippingAddressRequested","nameRequested","phoneRequested","emailRequested","setReceipt","receipt","publishableKey","selectProviderPublishableKey","credentials","k","join","buildQueryString","cardNumber","expiryMonth","expiryYear","cvv","zip","country","response","fetch","method","headers","Authorization","json","getStripeError","setStripeCardInfo","sendStripeCredentials","shippingOptionId","saveCredentials","formId","selectPaymentFormId","requestInfoId","selectPaymentRequestId","stripeCredentials","selectStripeCredentials","requestedInfoId","sendPaymentForm","save","runThrottledForUpdateAppBadge","update","noTopChatsRequest","selectIsChatListed","loadTopChats","newProfilePhoto","updateAppBadge","selectCountNotMutedUnread","closeMessageNotifications","isNotJoined","listId","typingStatus","senderId","isFromScheduled","isActiveChat","hasUnreadMention","unreadMentionsCount","hasWebNotifications","selectNotifySettings","showNewMessageNotification","messageUpdate","selectCommonBoxChatId","targetChat","newOrderedPinnedIds","MAX_ACTIVE_PINNED_CHATS","updateChatListType","chatFoldersById","newChatFoldersById","pick","newOrderedIds","orderedId","folders","replacedMembers","addedMember","deletedMemberId","shouldUpdate","some","deleteIndex","isOwner","isAdmin","membersCount","formattedText","ANIMATION_DELAY","updateWithLocalMedia","isScheduled","currentMessage","video","document","getMessageContent","blobUrl","thumbnail","isPreloadedGlobally","previewBlobUrl","updateScheduledMessage","updateThreadUnread","selectThreadByMessage","originMessage","updateListedAndViewportIds","firstMessageId","isUnreadChatNotLoaded","isMessageLocal","addViewportId","messagesCount","firstUnreadId","updateChatLastMessage","currentLastMessage","findLastMessage","deleteMessages","newLastMessage","threadIdsToUpdate","deleteChatMessages","unique","chatsIdsToUpdate","commonBoxChatId","updateThreadInfo","newMessage","isMessageInCurrentMessageList","isOutgoing","scheduledIds","selectScheduledIds","selectIsChatWithBot","selectScheduledMessages","deleteChatScheduledMessages","thread","markMessageListRead","currentPinnedIds","selectPinnedIds","newTheadInfo","messagesById","deleteScheduledMessages","pollId","pollUpdate","selectChatMessageByPollId","poll","updatedPoll","updatedResults","isChosen","chosenAnswers","chosenAnswer","chosenAnswerIndex","recentVoterIds","totalVoters","newRecentVoterIds","newTotalVoters","targetOption","targetOptionIndex","updatedOption","votersCount","flushStatusUpdatesThrottled","pendingStatusUpdates","statusUpdate","status","targetUser","isBlocked","addBlockedContact","settings","privacy","key","rules","updateNotifySettings","peerType","shouldShowPreviews","addNotifyException","twoFaSettings","useBeforeUnload","callback","useEffect","onBeforeUnload","preventEvent","preventDefault","useBrowserOnline","isOnline","setIsOnline","useState","navigator","onLine","handleChange","addEventListener","removeEventListener","ANIMATION_LEVEL_OPTIONS","memo","withGlobal","searchQuery","chatsById","animationLevel","byKey","globalSearchChatId","searchDate","theme","selectTheme","contactsFilter","onSearchQuery","onSelectSettings","onSelectContacts","onSelectArchived","setGlobalSearchChatId","onReset","shouldSkipTransition","openTipsChat","setGlobalSearchDate","setSettingOption","lang","useLang","hasMenu","LeftColumnContent","selectedSearchDate","useMemo","formatDateToString","archivedUnreadChatsCount","values","total","withOtherVersions","location","hostname","MainButton","onTrigger","isOpen","Button","ripple","size","color","className","onClick","ariaLabel","buildClassName","handleSearchFocus","useCallback","handleSelectSaved","handleDarkModeToggle","stopPropagation","newTheme","shouldUseSystemTheme","switchTheme","ANIMATION_LEVEL_MAX","handleAnimationLevelChange","newLevel","_","body","classList","toggle","isSearchFocused","searchInputPlaceholder","DropdownMenu","trigger","footer","APP_NAME","APP_VERSION","MenuItem","icon","Switcher","label","checked","noAnimation","toLowerCase","href","FEEDBACK_URL","localStorage","setItem","JSON","stringify","disableHistoryBack","SearchInput","inputId","parentContainerClassName","focused","placeholder","autoComplete","canClose","onChange","onFocus","PickerSelectedItem","isMinimized","clickArg","chatOrUserId","dir","isRtl","Spinner","usersById","orderedFolderIds","shouldSkipHistoryAnimations","notifySettings","notifyExceptions","selectNotifyExceptions","foldersDispatch","onScreenSelect","setActiveChatFolder","transitionRef","useRef","displayedFolders","folderCountersById","resolverFn","ms","dependencies","runThrottled","noFirst","useThrottle","setValue","isFrozen","freeze","unfreeze","useFlag","useHeavyAnimationCheck","useOnChange","useThrottledMemo","counters","unreadDialogsCount","hasActiveDialogs","getFolderUnreadDialogs","badgeCount","isBadgeActive","folderTabs","handleSwitchTab","current","captureEvents","selectorToPreventScroll","onSwipe","SwipeDirection","min","isNotInAllTabRef","captureEscKeyListener","useHistoryBack","handleKeyDown","ctrlKey","shiftKey","startsWith","digit","shouldRender","shouldRenderPlaceholder","transitionClassNames","useShowTransition","renderCurrentTab","activeFolder","ChatList","folderType","TabList","tabs","activeTab","onSwitchTab","Transition","ref","name","activeKey","renderCount","props","LeftSearch","useModuleLoader","Bundles","Loading","ContactList","closeTimeout","isShown","onNewPrivateChat","onNewChannel","onNewGroup","isMenuOpen","setIsMenuOpen","fabClassName","handleMouseEnter","handleMouseLeave","onMouseEnter","onMouseLeave","tabIndex","Menu","positionX","positionY","autoClose","onClose","TRANSITION_RENDER_COUNT","onContentChange","connectionState","isNewChatButtonShown","setIsNewChatButtonShown","isConnecting","isMouseInside","handleSelectSettings","handleSelectContacts","handleSelectNewChannel","handleSelectNewGroup","handleSelectArchived","autoCloseTimeout","shouldRenderUpdateButton","updateButtonClassNames","handleUpdateClick","isAppOutdated","markIsAppOutdated","timeout","reload","useAppOutdatedCheck","ShowTransition","isCustom","shouldCleanup","cleanupExceptionKey","fluid","pill","Settings","NewChat","ArchivedChats","ContentType","RENDER_COUNT","setGlobalSearchQuery","resetChatCreation","loadPasswordInfo","clearTwoFaError","setContent","settingsScreen","setSettingsScreen","SettingsScreens","setContactsFilter","foldersState","useFoldersReducer","lastResetTime","setLastResetTime","contentType","Main","Archived","NewChannel","NewGroup","handleReset","forceReturnToChatList","pickerSearchInput","getElementById","blur","handleSearchQuery","handleSettingsScreenSelect","screen","LAYERS_ANIMATION_NAME","currentScreen","isChannel","setSize","windowSize","handleResize","MAX_MESSAGES_LIST_WIDTH","createMessageHash","messageList","HeaderMenuContainer","isChatChannel","selectIsInSelectMode","noMenu","isChatWithSelf","selectIsChatWithSelf","isMainThread","isDiscussionThread","isRightColumnShown","canRestartBot","selectIsUserBlocked","canStartBot","selectIsChatBotNotStarted","canSubscribe","isChatSuperGroup","canSearch","canMute","canLeave","joinChannel","openLocalTextSearch","restartBot","menuButtonRef","menuPosition","setMenuPosition","handleHeaderMenuOpen","rect","getBoundingClientRect","x","right","y","bottom","handleHeaderMenuClose","handleHeaderMenuHide","handleSubscribeClick","handleStartBot","handleRestartBot","handleSearchClick","querySelector","focus","searchInput","disabled","anchor","onSubscribeChannel","onSearchClick","onCloseAnimationEnd","useWebpThumbnail","getMessageMediaThumbDataUri","shouldDecodeThumbnail","isWebpSupported","thumbnailDecoded","setThumbnailDecoded","EMPTY_IMAGE_DATA_URI","useLayoutEffect","webpToPngBase64","then","catch","drawRect","width","height","radius","containerRef","markupParams","reverseIndex","barHeight","getBarHeight","markHeight","getMarkHeight","trackHeight","getTrackHeight","clipPathId","clipPath","d","getClipPath","markTranslateY","getMarkTranslateY","trackTranslateY","getTrackTranslateY","calculateMarkup","firstChild","firstElementChild","currentElement","style","transform","svg","div","defs","innerHTML","onUnpinMessage","onAllPinnedClick","mediaThumbnail","mediaBlobUrl","useMedia","getMessageMediaHash","getMessageSummaryText","isUnpinDialogOpen","openUnpinDialog","closeUnpinDialog","handleUnpinMessage","ConfirmDialog","confirmLabel","confirmHandler","thumbDataUri","getPictogramDimensions","src","alt","renderPictogram","renderText","RippleEffect","sender","selectSender","noUi","senderName","getSenderTitle","mediaData","mediaLoader","playPause","isPlaying","useAudioPlayer","getMessageKey","getMediaDuration","handleClick","handleClose","audio","getMessageAudio","performer","fileName","renderAudio","subtitle","renderVoice","audioMessage","pinnedIds","state","isSelectModeActive","isChatWithBot","currentTransitionKey","assign","pinnedMessageId","topMessageSender","selectForwardedSender","pinnedMessageIds","canUnpin","firstPinnedMessage","isReady","openChatWithInfo","pinMessage","openPreviousChat","toggleLeftColumn","pinnedMessageIndex","setPinnedMessageIndex","isArray","pinnedMessage","pinnedMessagesCount","chatTitleLength","getChatTitle","topMessageTitle","useEnsureMessage","windowWidth","useWindowSize","isLeftColumnHideable","MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN","shouldShowCloseButton","componentRef","shouldAnimateTools","handleHeaderClick","handlePinnedMessageClick","cycleRestrict","handleAllPinnedClick","handleBackClick","messageInput","EDITABLE_INPUT_ID","canToolsCollideWithChatInfo","SAFE_SCREEN_WIDTH_FOR_CHAT_INFO","MOBILE_SCREEN_MAX_WIDTH","shouldUseStackedToolsClass","MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","shouldRenderAudioPlayer","audioPlayerClassNames","renderingAudioMessage","useCurrentOrPrev","shouldRenderPinnedMessage","pinnedMessageClassNames","renderingPinnedMessage","renderingPinnedMessageTitle","canRevealTools","componentEl","add","remove","renderInfo","renderBackButton","PrivateChatInfo","withFullInfo","withMediaViewer","withUpdatingStatus","noRtl","GroupChatInfo","asClose","withUnreadCount","formatIntegerCompact","Infinity","isAlbum","messageOrAlbum","groupMessages","currentAlbum","currentSenderGroup","currentDateGroup","originalDate","datetime","getDayStart","senderGroups","dateGroups","isInAlbum","mainMessage","albumId","nextMessage","nextMessageDayStartsAt","isActionMessage","forwardInfo","senderUserId","hiddenUserName","inlineButtons","INTERSECTION_THROTTLE_FOR_MEDIA","IS_ANDROID","INTERSECTION_MARGIN_FOR_MEDIA","isEmojiOnlyMessage","customShape","getMinMediaWidth","hasText","hasCommentButton","calculateMediaDimensions","noAvatars","isOwn","isOwnMessage","isForwarded","isForwardedMessage","getMessagePhoto","getMessageWebPagePhoto","getMessageVideo","isWebPagePhoto","calculateInlineImageDimensions","calculateVideoDimensions","minMediaWidth","getMessageText","stretchFactor","finalWidth","finalHeight","isSmall","accumulate","list","initValue","accumulator","item","clamp","num","low","high","calculateContainerSize","layout","styles","dimensions","sides","calculateAlbumLayout","album","ratios","proportions","ratio","getProportions","averageRatio","getAverageRatio","albumCount","forceCalc","maxWidth","getAvailableWidth","REM","minWidth","maxHeight","spacing","originalRatios","cropRatios","attempts","pushAttempt","lineCounts","heights","currentCount","attemptCount","sum","multiHeight","first","second","third","fourth","optimalAttempt","optimalDiff","lineCount","totalHeight","bad1","bad2","line","diff","abs","optimalCounts","optimalHeights","rowCount","row","colCount","lineHeight","col","layoutWithComplexLayouter","AlbumRectPart","layoutTwoTopBottom","layoutTwoLeftRightEqual","minimalWidth","secondWidth","firstWidth","layoutTwoLeftRight","layoutTwo","firstHeight","thirdHeight","secondHeight","rightWidth","leftWidth","layoutThreeLeftAndOther","layoutThreeTopAndOther","layoutThree","w","h0","h","w0","w2","w1","h1","layoutFourTopAndOther","h2","layoutFourLeftAndOther","layoutFour","containerStyle","element","calculateAuthorWidth","createElement","font","whiteSpace","left","opacity","appendChild","offsetWidth","useFocusMessage","elementRef","isFocused","focusDirection","noFocusHighlight","messagesContainer","closest","fastSmoothScroll","ContextMenuContainer","targetUserIds","targetChatId","targetMessageId","targetMessage","selectIsMessageFocused","focusedMessage","observeIntersection","isEmbedded","appearanceOrder","isLastInList","useOnIntersect","noAppearanceAnimation","markShown","targetUsers","renderActionMessageText","asPlain","isContextMenuOpen","contextMenuPosition","handleBeforeContextMenu","handleContextMenu","handleContextMenuClose","handleContextMenuHide","useContextMenuHandlers","isContextMenuShown","onMouseDown","preventMessageInputBlur","onContextMenu","customText","isIntersecting","useIsIntersecting","pictogramId","isRoundVideo","getMessageRoundVideo","senderTitle","outgoingStatus","signature","views","isEdited","formatTime","MessageOutgoingStatus","observeIntersectionForPlaying","shouldLoop","isModalOpen","openModal","closeModal","isAnimated","isMemojiSticker","MEMOJI_STICKER_ID","shouldLoad","shouldPlay","mediaHash","getMessageMediaFormat","isMediaLoaded","isAnimationLoaded","markAnimationLoaded","isMediaReady","shouldRenderFullMedia","useTransitionForMedia","getStickerDimensions","thumbClassName","stickerClassName","AnimatedSticker","animationData","play","noLoop","onLoad","fromSticker","useBlurredMediaThumbRef","fullMediaData","useCanvasBlur","IS_CANVAS_FILTER_SUPPORTED","SELECTED_APPENDIX_BACKGROUND","shouldAutoLoad","isInSelectMode","isSelected","uploadProgress","nonInteractive","shouldAffectAppendix","onCancelUpload","localBlobUrl","isDownloadAllowed","setIsDownloadAllowed","shouldDownload","downloadProgress","useMediaWithDownloadProgress","thumbRef","isUploading","isTransferring","transferProgress","getMediaTransferState","wasDownloadDisabled","usePrevious","shouldRenderSpinner","spinnerClassNames","shouldRenderThumb","isAllowed","contentEl","inSelectMode","img","Image","onload","canvas","ctx","getContext","drawImage","getImageData","getAppendixColorFromImage","getCustomAppendixBg","appendixBg","setProperty","setAttribute","ProgressSpinner","useHeavyAnimationCheckForVideo","playerRef","shouldPlayRef","safePlay","isPlayAllowed","wasPlaying","freezePlaying","paused","unfreezePlaying","contains","unfreezePlayingOnRaf","fastRaf","hasFocus","useBackgroundMode","shouldAutoPlay","videoRef","getMessageWebPageVideo","setIsPlayAllowed","isInline","isBuffered","bufferingHandlers","useBuffering","playProgress","setPlayProgress","handleTimeUpdate","currentTarget","currentTime","duration","usePauseOnInactive","useVideoCleanup","videoClassName","autoPlay","muted","loop","playsInline","onTimeUpdate","isGif","formatMediaDuration","contact","countryList","phoneCodes","phoneCodeList","openUserInfo","Avatar","formatPhoneNumberWithCode","selected","loadingOptions","setValues","event","newValues","Checkbox","subLabel","getPercentage","toFixed","answer","voteResults","maxVotersCount","correctResults","shouldAnimate","r","correctAnswer","showIcon","answerPercent","finalPercent","setFinalPercent","lineRef","lineWidth","isAnimationDoesNotStart","lineEl","svgEl","lineStyle","onSendVote","openPollResults","summary","isSubmitting","setIsSubmitting","chosenOptions","setChosenOptions","isSolutionShown","setIsSolutionShown","wasSubmitted","setWasSubmitted","closePeriod","setClosePeriod","closed","closeDate","floor","countdownRef","hasVoted","canVote","canViewResult","isPublic","isMultiple","multipleChoice","answers","isCorrect","hidden","quiz","countdownEl","circumference","PI","lastElementChild","timerEl","strokeDashOffset","textContent","timer","recentVoters","handleRadioChange","handleCheckboxChange","handleVoteClick","handleViewResultsClick","handleSolutionShow","handleSolutionHide","solution","Notification","renderTextWithEntities","solutionEntities","onDismiss","containerId","question","getPollTypeString","RadioGroup","loadingOption","isQuiz","getReadableVotersCount","isText","inPreview","onMediaClick","onCancelMediaTransfer","webPage","getMessageWebPage","isSquarePhoto","handleMediaClick","siteName","displayUrl","isMediaInteractive","truncatedDescription","trimText","SafeLink","getMessageInvoice","amount","currency","isTest","photoUrl","formatCurrency","withSelectControl","WrappedComponent","ownProps","selectIsMessageSelected","handleMessageSelect","newProps","PhotoWithSelect","Photo","VideoWithSelect","Video","uploadsById","hasCustomAppendix","albumLayout","cancelSendingMessage","mediaCount","handleCancelUpload","containerWidth","containerHeight","fileUpload","currentOnRelease","playingProgressRef","shouldSpinnerRender","isActivated","setIsActivated","setProgress","playerEl","playingProgressEl","stopPlaying","capturePlaying","onRelease","ROUND_VIDEO_DIMENSIONS","onEnded","recentReplierIds","recentRepliers","hasUnread","GROUP_MESSAGE_HOVER_ATTRIBUTE","handleDocumentGroupMouseEnter","lastGroupElement","getLastElementInDocumentGroup","handleDocumentGroupMouseLeave","removeAttribute","nextElementSibling","withSenderName","withAvatar","viaBotId","chatUsername","forceSenderName","isAnonymousOwnMessage","originSender","botSender","threadTopMessageId","isThreadTop","shouldHideReply","replyMessageSender","selectUploadProgress","isForwarding","highlight","singleEmoji","getMessageSingleEmoji","every","canReply","isSingleEmoji","animatedEmoji","selectAnimatedEmoji","isGroupSelected","selectIsDocumentGroupSelected","isPinnedList","shouldAutoLoadMedia","selectShouldAutoLoadMedia","shouldAutoPlayMedia","selectShouldAutoPlayMedia","shouldLoopStickers","selectShouldLoopStickers","selectOutgoingStatus","observeIntersectionForBottom","observeIntersectionForMedia","observeIntersectionForAnimatedStickers","noComments","isFirstInGroup","isLastInGroup","isFirstInDocumentGroup","isLastInDocumentGroup","clickInlineButton","bottomMarkerRef","appendixRef","isLocal","hasReply","isReplyMessage","hasThread","asForwarded","isLinkedChannelPost","isInDocumentGroup","voice","getMessageCustomShape","textParts","renderMessageText","adminTitle","metaSafeAuthorWidth","canShowActionButton","canForward","canFocus","isChannelPost","fromMessageId","avatarPeer","senderPeer","selectMessage","handleMouseDown","handleDoubleClick","handleContentDoubleClick","isSwiped","markSwiped","unmarkSwiped","startedAt","target","matches","useOuterHandlers","handleAvatarClick","handleSenderClick","handleViaBotClick","handleReplyClick","handleAudioPlay","handleAlbumMediaClick","handleMetaClick","handleReadMedia","handleVoteSend","handleGroupForward","handleForward","handleFocus","handleFocusForwarded","handleDocumentGroupSelectAll","openMediaViewer","openAudioPlayer","markMessagesRead","sendPollVote","MediaViewerOrigin","albumMessageId","selectWithGroupedId","useInnerHandlers","containerClassName","contentClassName","hasComments","hasActionButton","classNames","isMedia","isMediaWithNoText","isViaBot","isRound","buildContentClassName","withCommentButton","withAppendix","calculatedWidth","noMediaCorners","extraPadding","onDoubleClick","isAvatarPeerUser","avatarUser","avatarChat","hiddenName","renderAvatar","shouldInlineMeta","textContentClass","senderColor","getUserColorKey","renderSenderName","AnimatedEmoji","forceLoadPreview","Audio","isSelectable","onPlay","onReadMedia","Document","renderContent","messageGroups","isViewportNewest","isUnread","withUsers","anchorIdRef","memoUnreadDividerBeforeIdRef","memoFirstUnreadIdRef","hasLinkedChat","isSchedule","onFabToggle","onNotchToggle","openHistoryCalendar","observeIntersectionForReading","observe","useIntersectionObserver","rootRef","throttleMs","margin","freezeForReading","unfreezeForReading","entries","mentionIds","entry","dataset","useMessageObservers","backwardsTriggerRef","forwardsTriggerRef","fabTriggerRef","loadMoreBackwards","loadMoreForwards","toggleScrollTools","offsetHeight","scrollHeight","scrollTop","scrollBottom","isAtBottom","MESSAGE_LIST_SENSITIVE_AREA","LOCAL_MESSAGE_ID_BASE","triggerEntry","resetScroll","observeIntersectionForFab","freezeForFab","unfreezeForFab","observeIntersectionForNotch","freezeForNotch","unfreezeForNotch","useScrollHooks","unreadDivider","messageCountToAnimate","messageGroup","flatten","appearanceIndex","dateGroup","dateGroupIndex","dateGroupsArray","senderGroup","senderGroupIndex","senderGroupsArray","compact","currentDocumentGroupId","messageIndex","isMessageAlbum","documentGroupId","nextDocumentGroupId","originalId","getMessageOriginalId","teactFastList","SCHEDULED_WHEN_ONLINE","formatHumanDate","lastUnreadMessageId","loadGreetingStickers","debounceMs","handleStickerSelect","selectedSticker","StickerButton","isGroupChatJustCreated","renderScheduled","renderSavedMessages","renderGroup","runDebouncedForScroll","selectCurrentMessageIds","restrictionReason","focusingId","withLastMessageWhenPreloading","chatBot","botDescription","isChatLoaded","isChannelChat","isGroupChat","isChatGroup","isCreator","isBot","threadFirstMessageId","selectFirstMessageId","hasTools","canPost","setScrollOffset","scrollOffsetRef","selectScrollOffset","anchorTopRef","listItemElementsRef","memoFocusingIdRef","isScrollTopJustUpdatedRef","shouldAnimateAppearanceRef","setContainerHeight","onTickEnd","listedMessages","orderBy","loadMoreAround","isScrolled","updateStickyDates","markIsScrolled","runDebounced","shouldRunLast","container","currentStuck","stuckDateEl","allElements","querySelectorAll","containerTop","el","offsetTop","top","findStuckDate","useStickyDates","handleScroll","parentElement","observer","ResizeObserver","offsetParent","contentRect","disconnect","windowHeight","normalHeight","String","clientHeight","preservedItemElements","useLayoutEffectWithPrevDeps","prevMessageIds","prevIsViewportNewest","prevContainerHeight","shouldForceScroll","hasLastMessageChanged","hasViewportShifted","wasMessageAdded","isAlreadyFocusing","lastItemElement","bottomOffset","newScrollTop","isResized","isAnimatingScroll","useEffectWithPrevDeps","prevIsSelectModeActive","dispatchHeavyAnimationEvent","shouldRenderGreeting","onScroll","withExtraShift","focusNextReply","messageElements","lastMessageElement","MAX_QUICK_IMG_SIZE","buildAttachment","filename","blob","isQuick","URL","createObjectURL","mimeType","quick","preloadImage","newBlob","toBlob","squeezeImage","revokeObjectURL","videoWidth","videoHeight","preloadVideo","createPosterForVideo","resetInput","applyIosAutoCapitalizationFix","inputEl","POLYFILL_OPTIONS","encoderPath","reuseWorker","BLOB_PARAMS","opusRecorderPromise","OpusRecorder","mediaRecorder","init","default","start","analyzerCallback","startMediaRecorder","pausedAt","chunks","waveform","ondataavailable","typedArray","releaseAnalyzer","recorder","source","sourceNode","analyser","context","createAnalyser","fftSize","connect","dataLength","frequencyBinCount","dataArray","Uint8Array","isDestroyed","tick","getByteFrequencyData","volume","requestAnimationFrame","subscribeToAnalyzer","stop","reject","onstop","Blob","onerror","delayStop","CLIPBOARD_ACCEPTED_TYPES","getMessageTextAsHtml","tempEl","INLINE_BOT_QUERY_REGEXP","HAS_NEW_LINE","RE_COMMAND","DeleteMessageModal","openTimeout","isFirstTimeActivation","onActivate","buttonProps","AttachMenu","SymbolMenu","InlineBotTooltip","MentionTooltip","CustomSend","StickerTooltip","BotCommandTooltip","useMouseInside","isKeyboardSingleUse","forceOpen","markForceOpen","unmarkForceOpen","keyboardButtons","forwardMessageIds","forwardedMessagesCount","exitForwardMode","canAnimate","useAsyncRendering","clearEmbedded","handleMessageClick","faded","AttachmentModal","BotCommandMenu","PollModal","DropArea","RE_LINK","RegExp","RE_LINK_TEMPLATE","messageText","toggleMessageWebPage","link","parseMessageInput","linkEntity","ApiMessageEntityTypes","textMatch","renderingWebPage","webPageWithoutPhoto","messageStub","CalendarModal","PaymentModal","ReceiptModal","MainButtonState","chatUser","selectChatUser","REPLIES_USER_ID","messageWithActualBotKeyboard","selectNewestMessageWithBotKeyboardButtons","baseEmojiKeywords","BASE_EMOJI_KEYWORD_LANG","botKeyboardMessageId","keyboardMessage","editingMessage","canScheduleUntilOnline","wasOnline","withScheduledButton","shouldSchedule","botKeyboardPlaceholder","keyboardPlaceholder","stickersForEmoji","groupChatMembers","topInlineBotIds","isReceiptModalOpen","shouldSuggestStickers","isInlineBotLoading","chatBotCommands","botCommands","dropAreaState","onDropHide","editMessage","saveDraft","clearDraft","setStickerSearchQuery","setGifSearchQuery","closePollModal","closePaymentModal","clearReceipt","addRecentEmoji","sendInlineBotResult","html","setHtml","lastMessageSendTimeSeconds","prevDropAreaState","isCalendarOpen","openCalendar","closeCalendar","scheduledMessageArgs","setScheduledMessageArgs","htmlRef","setAttachments","isBotKeyboardOpen","openBotKeyboard","closeBotKeyboard","isBotCommandMenuOpen","openBotCommandMenu","closeBotCommandMenu","isAttachMenuOpen","openAttachMenu","closeAttachMenu","isSymbolMenuOpen","openSymbolMenu","closeSymbolMenu","isDeleteModalOpen","openDeleteModal","closeDeleteModal","isSymbolMenuLoaded","onSymbolMenuLoadingComplete","isHoverDisabled","disableHover","enableHover","startRecordingVoice","stopRecordingVoice","pauseRecordingVoice","activeVoiceRecording","currentRecordTime","recordButtonRef","mainButtonRef","startRecordTimeRef","setActiveVoiceRecording","setCurrentRecordTime","IS_VOICE_RECORDING_SUPPORTED","voiceRecording","tickVolume","boxShadow","useVoiceRecording","mainButtonState","Edit","Send","Record","canShowCustomSendMenu","isMentionTooltipOpen","closeMentionTooltip","insertMention","mentionFilteredUsers","useMentionTooltip","isInlineBotTooltipOpen","inlineBotId","isInlineBotTooltipGallery","inlineBotSwitchPm","inlineBotResults","closeTooltip","closeInlineBotTooltip","inlineBotHelp","loadMore","loadMoreForInlineBot","markIsOpen","unmarkIsOpen","replace","innerText","getPlainText","queryInlineBot","resetInlineBot","canShowHelp","parseStartWithUsernameString","usernameLowered","prevQuery","prevUsername","useInlineBotTooltip","isBotCommandTooltipOpen","close","closeBotCommandTooltip","filteredBotCommands","botTooltipCommands","setFilteredBotCommands","getFilteredCommands","nextFilteredBotCommands","prepareForRegExp","substr","useBotCommandTooltip","isCustomSendMenuOpen","allowedAttachmentOptions","getAllowedAttachmentOptions","isChatAdmin","slowMode","getChatSlowModeOptions","isStickerTooltipOpen","closeStickerTooltip","isDisabled","clearStickersForEmoji","IS_EMOJI_SUPPORTED","parseEmojiOnlyString","hasStickers","useStickerTooltip","canSendStickers","isEmojiTooltipOpen","closeEmojiTooltip","filteredEmojis","insertEmoji","useEmojiTooltip","insertTextAndUpdateCursor","selection","getSelection","newHtml","rangeCount","selectionRange","getRangeAt","isSelectionInsideInput","range","deleteContents","fragment","createContextualFragment","lastInsertedNode","lastChild","insertNode","setStartAfter","setEndAfter","collapse","removeAllRanges","addRange","insertHtmlInSelection","dispatchEvent","Event","bubbles","focusEditableElement","removeSymbol","execCommand","tempInput","contentEditable","textLength","createRange","setStart","setEnd","removeChild","deleteLastCharacterOutsideSelection","resetComposer","shouldPreserveInput","stopRecordingVoiceRef","handleEditComplete","editedMessage","hasMessageMedia","useEditing","updateDraft","draftChatId","draftThreadId","runDebouncedForSaveDraft","DRAFT_DEBOUNCE","prevChatId","prevThreadId","prevHtml","handleBlur","useDraft","handlePaste","clipboardData","input","activeElement","EDITABLE_INPUT_MODAL_ID","items","media","file","getAsFile","pastedText","getData","substring","useClipboardPaste","handleFileSelect","files","handleAppendFiles","handleClearAttachment","handleSend","currentAttachments","record","maxLength","extraLength","textParams","nowSeconds","secondsSinceLastMessage","nextSendDateNotReached","nextSendDate","seconds","secondsRemaining","isSlowMode","handleActivateBotCommandMenu","handleActivateSymbolMenu","handleGifSelect","gif","handleInlineBotSelect","inlineResult","handleBotCommandSelect","handlePollSend","handleSilentSend","handleMessageSchedule","isWhenOnline","restArgs","getTime","handleMessageScheduleUntilOnline","handleCloseCalendar","handleSearchOpen","handleSymbolMenuOpen","handleAllScheduledClick","mainButtonHandler","areVoiceMessagesNotAllowed","canAttachMedia","prevEditedMessage","renderedEditedMessage","scheduledDefaultDate","setSeconds","setMilliseconds","scheduledMaxDate","setFullYear","getFullYear","sendButtonAriaLabel","symbolMenuButtonClassName","onSend","Portal","DropAreaState","withQuick","onHide","onFileSelect","caption","onCaptionUpdate","onFileAppend","onClear","onInsertUserName","filteredUsers","onSelectResult","withUsername","canAttachEmbedLinks","MessageInput","forcedPlaceholder","shouldSetFocus","shouldSuppressFocus","shouldSuppressTextFormatter","onUpdate","onSuppressedFocus","formatVoiceRecordDuration","onStickerSelect","emojis","onEmojiSelect","onPollCreate","onGifSelect","onRemoveSymbol","onSearchOpen","onSilentSend","onScheduleSend","withTimePicker","maxAt","getDayStartAt","isFutureMode","secondButtonLabel","onSubmit","onSecondButtonClick","MobileSearch","MessageSelectToolbar","UnpinAllMessagesModal","CLOSE_ANIMATION_DURATION","canBeQuicklyUploaded","kind","CONTENT_TYPES_FOR_QUICK_UPLOAD","isBlurred","isBackgroundBlurred","background","customBackground","backgroundColor","patternColor","themes","isMobileSearchActive","getCanPostInChat","isBotNotStarted","isPinnedMessageList","isScheduledMessageList","currentUserBannedRights","defaultBannedRights","hasPinnedOrAudioMessage","loadUser","setDropAreaState","isFabShown","setIsFabShown","isNotchShown","setIsNotchShown","isUnpinModalOpen","setIsUnpinModalOpen","setIsReady","ANIMATION_LEVEL_MIN","renderingChatId","usePrevDuringAnimation","renderingThreadId","renderingMessageListType","renderingCanPost","renderingHasTools","renderingIsFabShown","handleDragEnter","dataTransfer","shouldDrawQuick","handleHideDropArea","handleOpenUnpinModal","closeUnpinModal","handleUnpinAllMessages","handleTabletFocus","customBackgroundValue","settingValue","cacheApi","CUSTOM_BG_CACHE_NAME","Type","useCustomBackground","MASK_IMAGE_DISABLED","messagingDisabledClassName","messageSendingRestrictionReason","getMessageSendingRestrictionReason","composerHiddenScale","toolbarHiddenScale","composerTranslateX","toolbarTranslateX","unpinHiddenScale","toolbarForUnpinHiddenScale","sidePadding","messageListWidth","leftColumnWidth","rightColumnWidth","getMessageListWidth","sendButtonWidth","composerWidth","toolbarWidth","calculateMiddleFooterTransforms","footerClassName","isMessagingDisabled","onTransitionEnd","propertyName","DARK_THEME_BG_COLOR","LIGHT_THEME_BG_COLOR","onDragEnter","onUnpin","HeaderContent","isProfile","isManagement","messageSearchQuery","stickerSearchQuery","selectCurrentStickerSearch","gifSearchQuery","selectCurrentGifSearch","canManage","isColumnOpen","isSearch","isStickerSearch","isGifSearch","isPollResults","isAddingChatMembers","profileState","managementScreen","setLocalTextSearchQuery","searchTextMessagesLocal","toggleManagement","shouldSkipAnimation","backButtonRef","handleMessageSearchQueryChange","handleStickerSearchQueryChange","handleGifSearchQueryChange","setShouldSkipTransition","contentKey","ProfileState","Profile","SharedMedia","MemberList","Search","PollResults","StickerSearch","GifSearch","AddingMembers","ManagementScreens","ManageInitial","ManageChatPrivacyType","ManageDiscussion","ManageChannelSubscribers","ManageGroupPermissions","ManageChatAdministrators","ManageGroupRemovedUsers","ManageGroupUserPermissionsCreate","ManageGroupUserPermissions","ManageGroupRecentActions","ManageGroupAdminRights","ManageGroupMembers","renderingContentKey","renderHeaderContent","isBackButton","buttonClassName","useInfiniteScrollForSharedMedia","forSharedMediaType","currentResultType","handleLoadMore","messageIdsRef","getMessageContentIds","reverse","getMore","useInfiniteScroll","runThrottledForScroll","isScrollingProgrammatically","contactName","getUserFirstOrLastName","deleteChatMember","handleDeleteChatMember","Modal","onEnter","TABS","buildInfiniteScrollItemSelector","resultType","mediaSearchType","isGroup","hasMembersTab","areMembersHidden","canViewMembers","canAddMembers","getHasAdminRight","canDeleteMembers","resolvedUserId","onProfileStateChange","setLocalMediaSearchType","loadMoreMembers","searchMediaMessagesLocal","loadProfilePhotos","setActiveTab","deletingUserId","setDeletingUserId","tabType","noProfileInfo","searchMessages","sortUserIds","memberViewportIds","getMoreMembers","noProfileInfoForMembers","MEMBERS_SLICE","useInfiniteScrollForMembers","mediaViewportIds","getMoreMedia","noProfileInfoForMedia","documentViewportIds","getMoreDocuments","noProfileInfoForDocuments","linkViewportIds","getMoreLinks","noProfileInfoForLinks","audioViewportIds","getMoreAudio","noProfileInfoForAudio","useProfileViewportIds","prevTabType","tabsEl","prevProfileState","determineProfileState","tabListEl","useProfileState","applyTransitionFix","releaseTransitionFix","transitionElSelector","setMinHeight","transitionEl","minHeight","overflowY","scrollBarWidth","clientWidth","marginRight","useTransitionFixes","cacheBuster","resetCacheBuster","setCacheBuster","useCacheBuster","handleTransitionStop","handleNewMemberDialogOpen","handleSelectMedia","handlePlayAudio","handleMemberClick","handleMessageFocus","handleDeleteMembersModalClose","renderingDelay","isFirstTab","SLIDE_TRANSITION_DURATION","canRenderContents","getMemberContextAction","handler","renderSharedMedia","noSpinner","NothingFound","Media","withDate","smaller","onDateClick","WebLink","onMessageClick","ListItem","teactOrderKey","contextActions","forceShowSelf","InfiniteScroll","itemSelector","sensitiveArea","PROFILE_SENSITIVE_AREA","preloadBackwards","noScrollRestoreOnTop","noFastList","onLoadMore","ProfileInfo","ChatExtra","renderProfileInfo","shouldRestoreHeight","onStart","onStop","big","FloatingActionButton","RightSearch","Management","localContactIds","isSearching","onNextStep","setUserSearchQuery","selectedMemberIds","setSelectedMemberIds","noPickerScrollRestore","member","handleFilterChange","displayedIds","sortChatIds","foundContactIds","fullName","getUserFullName","contactId","isUserBot","canBeInvitedToGroup","handleNextStep","Picker","itemIds","selectedIds","filterValue","filterPlaceholder","searchInputId","onSelectedIdsChange","onFilterChange","noScrollRestore","MAIN_SCREENS_COUNT","RightColumnContent","MANAGEMENT_SCREENS_COUNT","blurSearchInput","areActiveChatsLoaded","selectAreActiveChatsLoaded","selectRightColumnContentKey","currentProfileUserId","selectedId","isChatSelected","toggleChatInfo","closePollResults","addChatMembers","setProfileState","setManagementScreen","selectedChatMemberId","setSelectedChatMemberId","isPromotedByCurrentUser","setIsPromotedByCurrentUser","isScrolledDown","isOverlaying","shouldScrollUp","handleSelectChatMember","memberId","isPromoted","handleAppendingChatMembers","onChatMemberSelect","prevContentKey","MediaViewer","Notifications","Dialogs","ForwardPicker","SafeLinkModal","HistoryCalendar","notificationInterval","DEBUG_isLogged","updateIcon","asUnread","updatePageTitle","nextTitle","isMediaViewerOpen","selectIsMediaViewerOpen","isForwardModalOpen","selectIsForwardModalOpen","hasNotifications","hasDialogs","isHistoryCalendarOpen","loadNotificationSettings","loadNotificationExceptions","updateIsOnline","loadTopInlineBots","loadEmojiKeywords","loadCountryList","openStickerSetShortName","LOCATION_HASH","protocol","searchParams","pathname","domain","processDeepLink","decodeURIComponent","middleColumnTransitionClassNames","rightColumnTransitionClassNames","prevIsLeftColumnShown","dispatchHeavyAnimationEnd","waitForTransitionEnd","prevIsRightColumnShown","initialUnread","clearInterval","setInterval","INACTIVE_MARKER","newUnread","PAGE_TITLE","handleStickerSetModalClose","stopEvent","usePreventIosPinchZoom","onDrop","onDragOver","initApi"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/484.40f6759b976ebb12ec3f.js b/dist/484.40f6759b976ebb12ec3f.js deleted file mode 100644 index 837df026..00000000 --- a/dist/484.40f6759b976ebb12ec3f.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[484],{7854:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(4050),a=n(6137),s=n(4399),o=n(3657),i=n(6202),c=n(8835),l=n(706),d=n(7799);const u={large:160,medium:128,small:104},m=({sticker:e,size:t="medium",observeIntersection:n,lastSyncTime:m,forceLoadPreview:h})=>{var f;const v=(0,r.sO)(null),[p,Z]=(0,l.Z)(),g=`sticker${e.id}`,E=(0,o.Op)(v,n),P=null===(f=e.thumbnail)||void 0===f?void 0:f.dataUri,y=(0,i.Z)(`${g}?size=m`,!E&&!h,a.IU.BlobUrl,m),{transitionClassNames:C}=(0,c.Z)(y,"slow"),b=(0,i.Z)(g,!E,a.IU.Lottie,m),N=Boolean(b),[w,k]=(0,r.eJ)(String(Math.random())),I=(0,r.I4)((()=>{k(String(Math.random()))}),[]),T=u[t],S=`width: ${T}px; height: ${T}px;`;return r.ZP.createElement("div",{ref:v,className:"AnimatedEmoji media-inner",style:S,onClick:I},!p&&P&&r.ZP.createElement("img",{src:P,className:e.id===s.wB?"like-sticker-thumb":void 0,alt:""}),!p&&y&&r.ZP.createElement("img",{src:y,className:C,alt:""}),N&&r.ZP.createElement(d.Z,{key:g,id:g,animationData:b,size:T,quality:1,play:E&&w,noLoop:!0,onLoad:Z}))}},7799:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),a=n(9118),s=n(6752),o=n(8674),i=n(5332);let c,l;async function d(){return c||(c=n.e(941).then(n.bind(n,7941)),l=(await c).default),c}setTimeout(d,5e3);const u=(0,r.X$)((({className:e,id:t,animationData:n,play:c,playSegment:u,speed:m,noLoop:h,size:f,quality:v,isLowPriority:p,onLoad:Z})=>{const[g,E]=(0,r.eJ)(),P=(0,r.sO)(null),y=(0,r.sO)(!1),C=(0,r.sO)(!1),b=(0,r.sO)();b.current=c;const N=(0,r.sO)();N.current=u,(0,r.d4)((()=>{if(g||!n)return;const e=()=>{if(!P.current)return;const e=new l(t,P.current,n,{noLoop:h,size:f,quality:v,isLowPriority:p},Z);m&&e.setSpeed(m),E(e)};l?e():d().then((()=>{(0,a.T2)((()=>{P.current&&e()}))}))}),[g,n,t,p,h,Z,v,f,m]),(0,r.d4)((()=>()=>{g&&g.destroy()}),[g]);const w=(0,r.I4)(((e=!1)=>{g&&(b.current||N.current)&&(N.current?g.playSegment(N.current):e?g.goToAndPlay(0):g.play())}),[g]),k=(0,r.I4)((()=>{g&&g.pause()}),[g]),I=(0,r.I4)((()=>{C.current=!0,g&&(y.current||(y.current=g.isPlaying()),k())}),[g,k]),T=(0,r.I4)((()=>{y.current&&w(),y.current=!1,C.current=!1}),[w]),S=(0,r.I4)((()=>{(0,a.T2)(T)}),[T]);(0,r.d4)((()=>{g&&(c||u?C.current?y.current=!0:w(h):C.current?y.current=!1:k())}),[g,c,u,h,w,k]),(0,o.ZP)(I,T),(0,i.Z)(I,S);const M=(0,s.Z)("AnimatedSticker",e),L=f?`width: ${f}px; height: ${f}px;`:void 0;return r.ZP.createElement("div",{ref:P,className:M,style:L})}))},4752:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(4050),a=n(7361),s=n(790),o=n(2858),i=n(6752),c=n(2340),l=n(2761),d=n(1212),u=n(2019),m=n(3186),h=n(2619),f=n(9107),v=n(231),p=n(9196),Z=n(8033);const g=a.wB?20:25,E=a.wB?50:75;function P(e,t,{handleStartSeek:n,handleSeek:a,handleStopSeek:s}){return r.ZP.createElement("div",{className:"seekline no-selection",onMouseDown:n,onMouseMove:a,onMouseUp:s},r.ZP.createElement("span",{className:"seekline-buffered-progress"},r.ZP.createElement("i",{style:`transform: translateX(${100*t}%)`})),r.ZP.createElement("span",{className:"seekline-play-progress"},r.ZP.createElement("i",{style:`transform: translateX(${100*e}%)`})),r.ZP.createElement("span",{className:"seekline-thumb"},r.ZP.createElement("i",{style:`transform: translateX(${100*e}%)`})))}const y=(0,r.X$)((({theme:e,message:t,senderTitle:n,uploadProgress:y,target:C,date:b,lastSyncTime:N,className:w,isSelectable:k,isSelected:I,onPlay:T,onReadMedia:S,onCancelUpload:M,onDateClick:L})=>{const{content:{audio:x,voice:$},isMediaUnread:A}=t,F=Boolean($),O=(0,r.sO)(!1),D=(0,f.Z)(),[U,R]=(0,r.eJ)(!1),B=N,{mediaData:V,downloadProgress:X}=(0,l.Z)((0,o.Ti)(t,"inline"),!B,(0,o.kG)(t,"inline")),{isBuffered:j,bufferedProgress:H,bufferingHandlers:K,checkBuffering:q}=(0,u.Z)(),{isPlaying:z,playProgress:J,playPause:Y,setCurrentTime:W,duration:_}=(0,m.Z)((0,o.Tp)(t),(0,o.XV)(t),V,K,q,U,(function(){R(!0),T(t.id,t.chatId)}),(0,o.CI)(t));(0,r.d4)((()=>{R(z)}),[z]);const{isDownloadStarted:G,downloadProgress:Q,handleDownloadClick:ee}=(0,h.Z)((0,o.Ti)(t,"download"),(0,o.I3)(t)),te=U&&!j,{isUploading:ne,isTransferring:re,transferProgress:ae}=(0,o.Sc)(t,G?Q:y||X,te||G),{shouldRender:se,transitionClassNames:oe}=(0,d.Z)(re),ie=(0,r.I4)((()=>{ne?M&&M():(z||T(t.id,t.chatId),R(!U),Y())}),[z,ne,t.id,t.chatId,M,T,Y,U]);(0,r.d4)((()=>{z&&S&&A&&S()}),[z,A,S]);const ce=(0,r.I4)((e=>{if(O.current){const t=e.currentTarget.closest(".seekline,.waveform");if(t){const{width:n,left:r}=t.getBoundingClientRect();W(_*((e.clientX-r)/n))}}}),[_,W]),le=(0,r.I4)((e=>{O.current=!0,ce(e)}),[ce]),de=(0,r.I4)((()=>{O.current=!1}),[]),ue=(0,r.I4)((()=>{L(t.id,t.chatId)}),[L,t.id,t.chatId]),me={handleStartSeek:le,handleSeek:ce,handleStopSeek:de},he=(0,o.B4)(t),fe=(0,r.Ye)((()=>$&&function(e,t=0,n=!1,{handleStartSeek:a,handleSeek:s,handleStopSeek:o},i){const{waveform:c,duration:l}=e;if(!c)return;const d="dark"===i?"#494B75":"#CBCBCB",u="dark"===i?"#C0BBED":"#B0DEA6",m="dark"===i?"#868DF5":"#54a3e6",h="dark"===i?"#FFFFFF":"#53ad53",f=Math.min(l/30,1),v=Math.round(g+(E-g)*f),p=function(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const r=Array(n),a=e;for(let e=0,t=n-1;e!==t;++e){const t=Math.floor(5*e/8),n=Math.floor(5*e%8),s=a[t]+(a[t+1]<<8);r[e]=s>>n&31}const s=Math.floor(5*(n-1)/8),o=Math.floor(5*(n-1)%8),i=a[s]+(a[s+1]<<8);return r[n-1]=i>>o&31,r}(new Uint8Array(c)),{data:Z,peak:P}=function(e,t){let n=0;const r=new Array(t),a=e.length/t,s=e[0],o=e[e.length-1];for(let d=0;d{i.globalAlpha=o/e.length>=t?.5:1,i.fillStyle=t>o/e.length?a:r;const c=Math.max(2,s/Math.max(1,n)*23);!function(e,t,n,r,a,s){2<2*s&&(s=1),a<2*s&&(s=a/2),e.beginPath(),e.moveTo(t+s,n),e.arcTo(t+2,n,t+2,n-a,s),e.arcTo(t+2,n-a,t,n-a,s),e.arcTo(t,n-a,t,n,s),e.arcTo(t,n,t+2,n,s),e.closePath()}(i,4*o,23,0,c,1),i.fill()})),{src:o.toDataURL(),width:s,height:23}}(Z,t,{peak:P,fillStyle:n?u:d,progressFillStyle:n?h:m});return r.ZP.createElement("img",{src:y,alt:"",width:C,height:b,className:"waveform",draggable:!1,onMouseDown:a,onMouseMove:s,onMouseUp:o})}($,J,he,{handleStartSeek:le,handleSeek:ce,handleStopSeek:de},e)),[$,J,he,le,ce,de,e]),ve=(0,i.Z)("Audio media-inner",w,he&&!C&&"own",C&&"bigger",I&&"audio-is-selected"),pe=["toggle-play"];te?pe.push("loading"):z?pe.push("pause"):z||pe.push("play");const Ze=z||J>0&&J<1,ge=(0,i.Z)("content",Ze&&"with-seekline");return r.ZP.createElement("div",{className:ve,dir:D.isRtl?"rtl":void 0},k&&r.ZP.createElement("div",{className:"message-select-control"},I&&r.ZP.createElement("i",{className:"icon-select"})),r.ZP.createElement(v.Z,{round:!0,ripple:!a.wB,size:C?"smaller":"tiny",className:pe.join(" "),ariaLabel:z?"Pause audio":"Play audio",onClick:ie,isRtl:D.isRtl},r.ZP.createElement("i",{className:"icon-play"}),r.ZP.createElement("i",{className:"icon-pause"})),se&&r.ZP.createElement("div",{className:(0,i.Z)("media-loading",oe,te&&"interactive")},r.ZP.createElement(p.Z,{progress:ae,transparent:!0,size:C?"m":"s",onClick:te?ie:void 0,noCross:!te})),x&&r.ZP.createElement(v.Z,{round:!0,size:"tiny",className:"download-button",ariaLabel:G?"Cancel download":"Download",onClick:ee},r.ZP.createElement("i",{className:G?"icon-close":"icon-arrow-down"})),"searchResult"===C&&r.ZP.createElement(r.ZP.Fragment,null,r.ZP.createElement("div",{className:ge},r.ZP.createElement("div",{className:"content-row"},r.ZP.createElement("p",{className:"title",dir:"auto"},(0,c.Z)(function(){if(F)return n||"Voice";const{title:e,fileName:t}=x;return e||t}())),r.ZP.createElement("div",{className:"message-date"},b&&r.ZP.createElement(Z.Z,{className:"date",onClick:ue},(0,s.VX)(D,1e3*b)))),Ze&&P(J,H,me),!Ze&&r.ZP.createElement("p",{className:"duration",dir:"auto"},J>0?`${(0,s.k9)(_*J)} / `:void 0,function(){if(F)return(0,s.k9)($.duration);const{performer:e}=x;return r.ZP.createElement(r.ZP.Fragment,null,e&&(0,c.Z)(e),e&&n&&r.ZP.createElement("span",null,"•"),n&&(0,c.Z)(n))}()))),"searchResult"!==C&&x&&function(e,t,n,a,o,i,l,d){const{title:u,performer:m,duration:h,fileName:f}=t,v=n||a>0&&a<1;return r.ZP.createElement("div",{className:"content"},r.ZP.createElement("p",{className:"title",dir:"auto"},(0,c.Z)(u||f)),v&&P(a,o,i),!v&&r.ZP.createElement("div",{className:"meta",dir:"auto"},r.ZP.createElement("span",{className:"performer"},(0,c.Z)(m||"Unknown")),l&&r.ZP.createElement(r.ZP.Fragment,null," ","•"," ",r.ZP.createElement(Z.Z,{className:"date",onClick:d},(0,s.ZK)(e,1e3*l)))),r.ZP.createElement("p",{className:"duration",dir:"auto"},a>0?`${(0,s.k9)(h*a)} / `:void 0,(0,s.k9)(h)))}(D,x,z,J,H,me,b,L?ue:void 0),"searchResult"!==C&&$&&function(e,t,n){return r.ZP.createElement("div",{className:"content"},t,r.ZP.createElement("p",{className:"voice-duration",dir:"auto"},(0,s.k9)(e.duration),n&&r.ZP.createElement("span",null,"•")))}($,fe,A))}))},172:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),a=n(6137),s=n(3716),o=n(2858),i=n(2155),c=n(6752),l=n(2340),d=n(6202),u=n(8835),m=n(9107);const h=(0,r.X$)((({className:e,size:t="large",chat:n,user:h,text:f,withOnlineStatus:v,isSavedMessages:p,lastSyncTime:Z,onClick:g})=>{const E=h&&(0,o.NB)(h);let P;p||E||(h?P=(0,o.RT)(h):n&&(P=(0,o.RT)(n)));const y=(0,d.Z)(P,!1,a.IU.DataUri,Z),{shouldRenderFullMedia:C,transitionClassNames:b}=(0,u.Z)(y,"slow"),N=(0,m.Z)();let w="";if(p)w=r.ZP.createElement("i",{className:"icon-avatar-saved-messages"});else if(E)w=r.ZP.createElement("i",{className:"icon-avatar-deleted-account"});else if(C)w=r.ZP.createElement("img",{src:y,className:`${b} avatar-media`,alt:"",decoding:"async"});else if(h){const e=(0,o.Js)(h);w=e?(0,i.Xv)(e,2):void 0}else if(n){const e=(0,o.U)(N,n);w=e&&(0,i.Xv)(e,(0,o.YA)(n.id)?2:1)}else f&&(w=(0,i.Xv)(f,2));const k=!p&&h&&(0,o.kM)(h),I=(0,c.Z)(`Avatar size-${t}`,e,`color-bg-${(0,o.Rs)(h||n)}`,p&&"saved-messages",E&&"deleted-account",v&&k&&"online",g&&"interactive",!p&&!C&&"no-photo"),T=(0,r.I4)((e=>{g&&g(e,p||C)}),[g,p,C]),S=(h||n)&&(h||n).id;return r.ZP.createElement("div",{className:I,onClick:T,"data-test-sender-id":s.Cg?S:void 0},"string"==typeof w?(0,l.Z)(w,["jumbo"===t?"hq_emoji":"emoji"]):w)}))},180:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),a=n(5116),s=n(8085),o=n(2858),i=n(2340),c=n(782),l=n(4319),d=n(2969),u=n(9107),m=n(1876),h=n(3321);const f=(0,r.X$)((0,a.c$)(((e,{chatOrUserId:t})=>{const{lastSyncTime:n}=e,r=t?(0,s.Z1)(e,t):void 0,a=(0,o.YA)(t)?(0,s.dy)(e,t):void 0,i=r&&(0,o.i4)(r,(0,s.dZ)(e),(0,s.NJ)(e));return{lastSyncTime:n,chat:r,user:a,canInviteUsers:r&&!a&&(!(0,o.eA)(r)&&!(0,o.Mg)(r,"inviteUsers")||(0,o.VE)(r,"inviteUsers")),isMuted:i}}),((e,t)=>(0,c.ei)(t,["loadFullUser","updateChatMutedState","showNotification"])))((({lastSyncTime:e,user:t,chat:n,forceShowSelf:a,canInviteUsers:s,isMuted:c,loadFullUser:f,showNotification:v,updateChatMutedState:p})=>{const{id:Z,fullInfo:g,username:E,phoneNumber:P,isSelf:y}=t||{},{id:C}=n||{},b=(0,u.Z)();(0,r.d4)((()=>{e&&Z&&f({userId:Z})}),[f,Z,e]);const N=(0,r.I4)((()=>{p({chatId:C,isMuted:!c})}),[C,c,p]);if(!n||n.isRestricted||y&&!a)return;function w(e,t){(0,l.TE)(e),v({message:`${t} was copied`})}const k=P&&(0,d.WZ)(P),I=(0,o.hu)(n),T=(null==g?void 0:g.bio)||(0,o.GM)(n);return r.ZP.createElement("div",{className:"ChatExtra"},k&&!!k.length&&r.ZP.createElement(m.Z,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:()=>w(k,b("Phone"))},r.ZP.createElement("span",{className:"title",dir:"auto"},k),r.ZP.createElement("span",{className:"subtitle"},b("Phone"))),E&&r.ZP.createElement(m.Z,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>w(`@${E}`,b("Username"))},r.ZP.createElement("span",{className:"title",dir:"auto"},(0,i.Z)(E)),r.ZP.createElement("span",{className:"subtitle"},b("Username"))),T&&!!T.length&&r.ZP.createElement(m.Z,{icon:"info",multiline:!0,narrow:!0,isStatic:!0},r.ZP.createElement("span",{className:"title",dir:"auto"},(0,i.Z)(T,["br","links","emoji"])),r.ZP.createElement("span",{className:"subtitle"},b(Z?"UserBio":"Info"))),(s||!E)&&I&&r.ZP.createElement(m.Z,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>w(I,b("SetUrlPlaceholder"))},r.ZP.createElement("div",{className:"title"},I),r.ZP.createElement("span",{className:"subtitle"},b("SetUrlPlaceholder"))),!a&&r.ZP.createElement(m.Z,{icon:"unmute",ripple:!0,onClick:N},r.ZP.createElement("span",null,b("Notifications")),r.ZP.createElement(h.Z,{id:"group-notifications",label:Z?"Toggle User Notifications":"Toggle Chat Notifications",checked:!c,inactive:!0})))})))},329:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),a=n(5116),s=n(8085),o=n(2858),i=n(782),c=n(9107),l=n(2340),d=n(172),u=n(3103),m=n(231);const h=(0,r.X$)((0,a.c$)(((e,{chat:t})=>{const n=(0,o.YA)(t.id),r=(0,s.FM)(e,t.id),a=n&&(0,s.dy)(e,(0,o.zX)(t)),i=a&&(0,o.cS)(a)&&!t.isSupport,c=n&&!r&&!i,l=n?(0,o.Vl)((0,s.dy)(e,(0,o.zX)(t))):void 0;return{isPrivateChat:n,isChatWithSelf:r,isBot:i,isChannel:(0,o.eA)(t),isBasicGroup:(0,o.G9)(t),isSuperGroup:(0,o.ZV)(t),currentUserId:e.currentUserId,canDeleteForAll:c,contactName:l}}),((e,t)=>(0,i.ei)(t,["leaveChannel","deleteHistory","deleteChannel","deleteChatUser","blockContact"])))((({isOpen:e,chat:t,isChannel:n,isPrivateChat:a,isChatWithSelf:s,isBot:i,isBasicGroup:h,isSuperGroup:f,currentUserId:v,canDeleteForAll:p,contactName:Z,onClose:g,onCloseAnimationEnd:E,leaveChannel:P,deleteHistory:y,deleteChannel:C,deleteChatUser:b,blockContact:N})=>{const w=(0,c.Z)(),k=(0,o.U)(w,t),I=(0,r.I4)((()=>{y({chatId:t.id,shouldDeleteForAll:!0}),g()}),[y,t.id,g]),T=(0,r.I4)((()=>{y({chatId:t.id,shouldDeleteForAll:!0}),N({contactId:t.id,accessHash:t.accessHash}),g()}),[y,t.id,t.accessHash,N,g]),S=(0,r.I4)((()=>{a?y({chatId:t.id,shouldDeleteForAll:!1}):h?(b({chatId:t.id,userId:v}),y({chatId:t.id,shouldDeleteForAll:!1})):!n&&!f||t.isCreator?(n||f)&&t.isCreator&&C({chatId:t.id}):P({chatId:t.id}),g()}),[a,h,n,f,v,t.isCreator,t.id,g,y,b,P,C]);return r.ZP.createElement(u.Z,{isOpen:e,className:"DeleteChatModal",header:r.ZP.createElement("div",{className:"modal-header",dir:w.isRtl?"rtl":void 0},r.ZP.createElement(d.Z,{size:"tiny",chat:t,isSavedMessages:s}),r.ZP.createElement("h3",{className:"modal-title"},w(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"ChannelDelete":h||f?"Group.LeaveGroup":"DeleteChatUser"))),onClose:g,onCloseAnimationEnd:E},n&&t.isCreator?r.ZP.createElement("p",null,(0,l.Z)(w("ChatList.DeleteAndLeaveGroupConfirmation",k),["simple_markdown"])):n&&!t.isCreator||h||f?r.ZP.createElement("p",null,(0,l.Z)(w("ChannelLeaveAlertWithName",k),["simple_markdown"])):r.ZP.createElement("p",null,(0,l.Z)(w("ChatList.DeleteChatConfirmation",Z),["simple_markdown"])),i&&r.ZP.createElement(m.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:T},w("DeleteAndStop")),p&&r.ZP.createElement(m.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:I},Z?(0,l.Z)(w("ChatList.DeleteForEveryone",Z)):w("DeleteForAll")),r.ZP.createElement(m.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:S},w(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"Chat.Input.Delete":h||f?"Group.LeaveGroup":p?"ChatList.DeleteForCurrentUser":"Delete")),r.ZP.createElement(m.Z,{className:"confirm-dialog-button",isText:!0,onClick:g},w("Cancel")))})))},2535:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),a=n(5376),s=n(2858),o=n(3657),i=n(2761),c=n(6202),l=n(6562),d=n(7002);const u=(0,r.X$)((({message:e,observeIntersection:t,smaller:n,uploadProgress:u,withDate:m,datetime:h,className:f,sender:v,isSelected:p,isSelectable:Z,onCancelUpload:g,onMediaClick:E,onDateClick:P})=>{const y=(0,r.sO)(null),C=e.content.document,b=(0,a.K2)(C)||"",{fileName:N,size:w,timestamp:k}=C,I=E&&Boolean(C.mediaType),T=(0,o.Op)(y,t),[S,M]=(0,r.eJ)(!1),{mediaData:L,downloadProgress:x}=(0,i.Z)((0,s.Ti)(e,"download"),!S,void 0,void 0,void 0,!0),{isUploading:$,isTransferring:A,transferProgress:F}=(0,s.Sc)(e,u||x,S),O=(0,a.v6)(C),D=O?(0,s.DH)(e):void 0,U=O?C.previewBlobUrl:void 0,R=(0,c.Z)((0,s.Ti)(e,"pictogram"),!T),B=(0,r.I4)((()=>{I?E():$?g&&g():M((e=>!e))}),[I,$,g,E]),V=(0,r.I4)((()=>{P(e.id,e.chatId)}),[P,e.id,e.chatId]);return(0,r.d4)((()=>{S&&L&&((0,l.Z)(L,N),M(!1))}),[N,L,S]),r.ZP.createElement(d.Z,{ref:y,name:N,extension:b,size:w,timestamp:m?h||k:void 0,thumbnailDataUri:D,previewData:U||R,smaller:n,isTransferring:A,isUploading:$,transferProgress:F,className:f,sender:v,isSelectable:Z,isSelected:p,actionIcon:I?(0,s.hC)(e)?"icon-play":"icon-eye":"icon-download",onClick:B,onDateClick:P?V:void 0})}))},7002:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),a=n(1212),s=n(8835),o=n(6752),i=n(790),c=n(5376),l=n(4399),d=n(2340),u=n(9107),m=n(9196),h=n(8033);const f=(0,r.X$)((({ref:e,name:t,size:n,extension:f="",timestamp:v,sender:p,thumbnailDataUri:Z,previewData:g,className:E,smaller:P,isTransferring:y,isUploading:C,isSelectable:b,isSelected:N,transferProgress:w,actionIcon:k,onClick:I,onDateClick:T})=>{const S=(0,u.Z)();let M=(0,r.sO)(null);e&&(M=e);const{shouldRender:L,transitionClassNames:x}=(0,a.Z)(y,void 0,!0),$=(0,c.Oh)(f),A=(0,c.yW)(n),{shouldRenderThumb:F,shouldRenderFullMedia:O,transitionClassNames:D}=(0,s.Z)(g,"slow"),{width:U,height:R}=(0,l.lE)(P),B=(0,o.Z)("File",E,P&&"smaller",I&&!C&&"interactive",N&&"file-is-selected");return r.ZP.createElement("div",{ref:M,className:B,dir:S.isRtl?"rtl":void 0},b&&r.ZP.createElement("div",{className:"message-select-control"},N&&r.ZP.createElement("i",{className:"icon-select"})),r.ZP.createElement("div",{className:"file-icon-container",onClick:C?void 0:I},Z||g?r.ZP.createElement("div",{className:"file-preview media-inner"},F&&r.ZP.createElement("img",{src:Z,width:U,height:R,className:"thumbnail",alt:""}),O&&r.ZP.createElement("img",{src:g,className:`full-media ${D}`,width:U,height:R,alt:""})):r.ZP.createElement("div",{className:`file-icon ${$}`},f.length<=4&&r.ZP.createElement("span",{className:"file-ext",dir:"auto"},f)),L&&r.ZP.createElement("div",{className:(0,o.Z)("file-progress",$,x)},r.ZP.createElement(m.Z,{progress:w,size:P?"s":"m",onClick:C?I:void 0})),I&&r.ZP.createElement("i",{className:(0,o.Z)("action-icon",k||"icon-download",L&&"hidden")})),r.ZP.createElement("div",{className:"file-info"},r.ZP.createElement("div",{className:"file-title",dir:"auto"},(0,d.Z)(t)),r.ZP.createElement("div",{className:"file-subtitle",dir:"auto"},r.ZP.createElement("span",null,y&&w?`${Math.round(100*w)}%`:A),p&&r.ZP.createElement("span",{className:"file-sender"},(0,d.Z)(p)),!p&&v&&r.ZP.createElement(r.ZP.Fragment,null," ",r.ZP.createElement(h.Z,{onClick:T},(0,i.ZK)(S,1e3*v))))),p&&v&&r.ZP.createElement(h.Z,{onClick:T},(0,i.VX)(S,1e3*v)))}))},8799:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),a=n(5116),s=n(1713),o=n(2858),i=n(8085),c=n(2340),l=n(782),d=n(9107),u=n(172),m=n(9411),h=n(8729);const f=(0,r.X$)((0,a.c$)(((e,{chatId:t})=>{const{lastSyncTime:n}=e,r=(0,i.Z1)(e,t);return{lastSyncTime:n,chat:r,onlineCount:r?(0,i.YK)(e,r):void 0,areMessagesLoaded:Boolean((0,i.Zw)(e,t))}}),((e,t)=>(0,l.ei)(t,["loadFullChat","openMediaViewer"])))((({typingStatus:e,avatarSize:t="medium",withMediaViewer:n,withUsername:a,withFullInfo:i,withUpdatingStatus:l,withChatType:f,noRtl:v,chat:p,onlineCount:Z,areMessagesLoaded:g,lastSyncTime:E,loadFullChat:P,openMediaViewer:y})=>{const C=p&&(0,o.ZV)(p),{id:b,isMin:N,isRestricted:w}=p||{};(0,r.d4)((()=>{b&&!N&&i&&E&&P({chatId:b})}),[b,N,E,i,P,C]);const k=(0,r.I4)(((e,n)=>{p&&n&&(e.stopPropagation(),y({avatarOwnerId:p.id,origin:"jumbo"===t?s.bZ.ProfileAvatar:s.bZ.MiddleHeaderAvatar}))}),[p,t,y]),I=(0,d.Z)();if(p)return r.ZP.createElement("div",{className:"ChatInfo",dir:!v&&I.isRtl?"rtl":void 0},r.ZP.createElement(u.Z,{key:p.id,size:t,chat:p,onClick:n?k:void 0}),r.ZP.createElement("div",{className:"info"},r.ZP.createElement("div",{className:"title"},r.ZP.createElement("h3",{dir:"auto"},(0,c.Z)((0,o.U)(I,p))),p.isVerified&&r.ZP.createElement(m.Z,null)),function(){if(l&&!g&&!w)return r.ZP.createElement("span",{className:"status",dir:"auto"},I("Updating"));if(!p)return;if(e)return r.ZP.createElement(h.Z,{typingStatus:e});if(f)return r.ZP.createElement("div",{className:"status",dir:"auto"},I((0,o.l6)(p)));const t=a?p.username:void 0,n=function(e,t){const n=e((0,o.l6)(t)),{membersCount:r}=t;return t.isRestricted?"Channel"===n?"channel is inaccessible":"group is inaccessible":r?e("Channel"===n?"Subscribers":"Members",r,"i"):n}(I,p),s=Z?`, ${I("OnlineCount",Z,"i")}`:void 0;return r.ZP.createElement("div",{className:"status"},t&&r.ZP.createElement("span",{className:"handle"},t),r.ZP.createElement("span",{className:"group-status"},n),s&&r.ZP.createElement("span",{className:"online-status"},s))}()))})))},6844:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(790),s=n(9107),o=n(8018);const i=(0,r.X$)((({message:e,outgoingStatus:t})=>{const n=(0,s.Z)();return r.ZP.createElement("div",{className:"LastMessageMeta"},t&&r.ZP.createElement(o.Z,{status:t}),r.ZP.createElement("span",{className:"time"},(0,a.VX)(n,1e3*e.date)))}))},3709:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(4050),a=n(790),s=n(2858),o=n(6202),i=n(8835);const c=(0,r.X$)((({message:e,idPrefix:t="shared-media",onClick:n})=>{const c=(0,r.I4)((()=>{n(e.id,e.chatId)}),[e.id,e.chatId,n]),l=(0,s.DH)(e),d=(0,o.Z)((0,s.Ti)(e,"pictogram")),{shouldRenderThumb:u,shouldRenderFullMedia:m,transitionClassNames:h}=(0,i.Z)(d,"slow"),f=(0,s.b7)(e);return r.ZP.createElement("div",{id:`${t}${e.id}`,className:"Media scroll-item",onClick:n?c:void 0},u&&r.ZP.createElement("img",{src:l,alt:""}),m&&r.ZP.createElement("img",{src:d,className:`${h} full-media`,alt:""}),f&&r.ZP.createElement("span",{className:"video-duration"},f.isGif?"GIF":(0,a.k9)(f.duration)))}))},8018:(e,t,n)=>{n.d(t,{Z:()=>o});var r,a=n(4050),s=n(2255);!function(e){e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read"}(r||(r={}));const o=(0,a.X$)((({status:e})=>a.ZP.createElement("div",{className:"MessageOutgoingStatus"},a.ZP.createElement(s.Z,{name:"reveal",activeKey:r[e]},(()=>a.ZP.createElement("i",{className:`icon-message-${e}`}))))))},7262:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(4050),a=n(6752),s=n(1212),o=n(2340),i=n(9107);const c=(0,r.X$)((({text:e="Nothing found.",description:t})=>{const n=(0,i.Z)(),{transitionClassNames:c}=(0,s.Z)(!0);return r.ZP.createElement("div",{className:(0,a.Z)("NothingFound",c,t&&"with-description")},e,t&&r.ZP.createElement("p",{className:"description"},(0,o.Z)(n(t),["br"])))}))},1820:(e,t,n)=>{n.d(t,{Z:()=>v});var r=n(4050),a=n(2858),s=n(1273),o=n(4605),i=n(7687),c=n(1876),l=n(6058),d=n(8799),u=n(9187),m=n(7407),h=n(9107),f=n(4288);const v=(0,r.X$)((({itemIds:e,selectedIds:t,filterValue:n,filterPlaceholder:v,notFoundText:p,searchInputId:Z,isLoading:g,noScrollRestore:E,onSelectedIdsChange:P,onFilterChange:y,onLoadMore:C})=>{const b=(0,r.sO)(null),N=t.length>10;(0,r.d4)((()=>{setTimeout((()=>{requestAnimationFrame((()=>{b.current.focus()}))}),500)}),[]);const w=(0,r.I4)((e=>{const n=[...t];n.includes(e)?n.splice(n.indexOf(e),1):n.push(e),P(n),y("")}),[t,P,y]),k=(0,r.I4)((e=>{const{value:t}=e.currentTarget;y(t)}),[y]),[I,T]=(0,m.Z)(C,e,Boolean(n)),S=(0,h.Z)();return r.ZP.createElement("div",{className:"Picker"},r.ZP.createElement("div",{className:"picker-header custom-scroll",dir:S.isRtl?"rtl":void 0},t.map(((e,n)=>r.ZP.createElement(u.Z,{chatOrUserId:e,isMinimized:N&&nr.ZP.createElement(c.Z,{key:e,className:"chat-item-clickable picker-list-item",onClick:()=>w(e),ripple:!0},r.ZP.createElement(o.Z,{label:"",checked:t.includes(e)}),(0,a.YA)(e)?r.ZP.createElement(l.Z,{userId:e}):r.ZP.createElement(d.Z,{chatId:e}))))):g||!I||I.length?r.ZP.createElement(f.Z,null):r.ZP.createElement("p",{className:"no-results"},p||"Sorry, nothing found."))}))},9187:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),a=n(5116),s=n(8085),o=n(2858),i=n(2340),c=n(6752),l=n(9107),d=n(172);const u=(0,r.X$)((0,a.c$)(((e,{chatOrUserId:t})=>t?{chat:t?(0,s.Z1)(e,t):void 0,user:(0,o.YA)(t)?(0,s.dy)(e,t):void 0}:{}))((({icon:e,title:t,isMinimized:n,canClose:a,onClick:s,clickArg:u,chat:m,user:h,className:f})=>{const v=(0,l.Z)();let p,Z;if(e&&t)p=r.ZP.createElement("div",{className:"item-icon"},r.ZP.createElement("i",{className:`icon-${e}`})),Z=t;else if(m||h){p=r.ZP.createElement(d.Z,{chat:m,user:h,size:"small",isSavedMessages:null==h?void 0:h.isSelf});const e=!m||h&&!h.isSelf?(0,o.Vl)(h):(0,o.U)(v,m,h);Z=e?(0,i.Z)(e):void 0}const g=(0,c.Z)("PickerSelectedItem",f,n&&"minimized",a&&"closeable");return r.ZP.createElement("div",{className:g,onClick:()=>s(u),title:n?Z:void 0,dir:v.isRtl?"rtl":void 0},p,!n&&r.ZP.createElement("div",{className:"item-name",dir:"auto"},Z),a&&r.ZP.createElement("div",{className:"item-remove"},r.ZP.createElement("i",{className:"icon-close"})))})))},6058:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),a=n(5116),s=n(1713),o=n(8085),i=n(2858),c=n(2340),l=n(782),d=n(9107),u=n(172),m=n(9411),h=n(8729);const f=(0,r.X$)((0,a.c$)(((e,{userId:t,forceShowSelf:n})=>{const{lastSyncTime:r,serverTimeOffset:a}=e,s=(0,o.dy)(e,t);return{lastSyncTime:r,user:s,isSavedMessages:!n&&s&&s.isSelf,areMessagesLoaded:Boolean((0,o.Zw)(e,t)),serverTimeOffset:a}}),((e,t)=>(0,l.ei)(t,["loadFullUser","openMediaViewer"])))((({typingStatus:e,avatarSize:t="medium",status:n,withMediaViewer:a,withUsername:o,withFullInfo:l,withUpdatingStatus:f,noStatusOrTyping:v,noRtl:p,user:Z,isSavedMessages:g,areMessagesLoaded:E,lastSyncTime:P,loadFullUser:y,openMediaViewer:C,serverTimeOffset:b})=>{const{id:N}=Z||{},w=(0,i.Js)(Z);(0,r.d4)((()=>{l&&P&&N&&y({userId:N})}),[N,y,P,l]);const k=(0,r.I4)(((e,n)=>{Z&&n&&(e.stopPropagation(),C({avatarOwnerId:Z.id,origin:"jumbo"===t?s.bZ.ProfileAvatar:s.bZ.MiddleHeaderAvatar}))}),[Z,t,C]),I=(0,d.Z)();if(Z)return r.ZP.createElement("div",{className:"ChatInfo",dir:!p&&I.isRtl?"rtl":void 0},r.ZP.createElement(u.Z,{key:Z.id,size:t,user:Z,isSavedMessages:g,onClick:a?k:void 0}),r.ZP.createElement("div",{className:"info"},g?r.ZP.createElement("div",{className:"title"},r.ZP.createElement("h3",null,I("SavedMessages"))):r.ZP.createElement("div",{className:"title"},r.ZP.createElement("h3",{dir:"auto"},w&&(0,c.Z)(w)),(null==Z?void 0:Z.isVerified)&&r.ZP.createElement(m.Z,null)),(n||!g&&!v)&&(n?r.ZP.createElement("span",{className:"status",dir:"auto"},n):f&&!E?r.ZP.createElement("span",{className:"status",dir:"auto"},I("Updating")):Z?e?r.ZP.createElement(h.Z,{typingStatus:e}):r.ZP.createElement("div",{className:"status "+((0,i.kM)(Z)?"online":"")},o&&Z.username&&r.ZP.createElement("span",{className:"handle"},Z.username),r.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,i.Tq)(I,Z,b))):void 0)))})))},787:(e,t,n)=>{n.d(t,{Z:()=>N});var r=n(4050),a=n(5116),s=n(1713),o=n(7361),i=n(8085),c=n(2858),l=n(2340),d=n(782),u=n(1174),m=n(6752),h=n(6137),f=n(647),v=n(9107),p=n(9411),Z=n(2155),g=n(6202),E=n(2937),P=n(7204),y=n(9204);const C=(0,r.X$)((({chat:e,user:t,photo:n,isFirstPhoto:a,isSavedMessages:s,lastSyncTime:o,onClick:i})=>{const d=(0,v.Z)(),u=t&&(0,c.NB)(t);function f(r="big",a){if(n&&!a)return`photo${n.id}?size=c`;let o;return s||u||(t?o=(0,c.RT)(t,r):e&&(o=(0,c.RT)(e,r))),o}const p=f(),C=(0,g.Z)(p,!1,null!=p&&p.startsWith("avatar")?h.IU.DataUri:h.IU.BlobUrl,o),b=(0,g.Z)(!C&&a?f("normal",!0):void 0,!1,h.IU.DataUri,o),N=(0,E.Z)(!C&&n&&n.thumbnail&&n.thumbnail.dataUri),w=C||b||N,k=(0,P.Z)(w);let I="";if(s)I=r.ZP.createElement("i",{className:"icon-avatar-saved-messages"});else if(u)I=r.ZP.createElement("i",{className:"icon-avatar-deleted-account"});else if(w)I=r.ZP.createElement("img",{src:w,className:"avatar-media",alt:"",decoding:"async"});else if(!w&&t){const e=(0,c.Js)(t);I=e?(0,Z.Xv)(e,2):void 0}else if(!w&&e){const t=(0,c.U)(d,e);I=t&&(0,Z.Xv)(t,(0,c.YA)(e.id)?2:1)}else I=r.ZP.createElement("div",{className:"spinner-wrapper"},r.ZP.createElement(y.Z,{color:"white"}));const T=(0,m.Z)("ProfilePhoto",`color-bg-${(0,c.Rs)(t||e)}`,s&&"saved-messages",u&&"deleted-account",!s&&!w&&"no-photo");return r.ZP.createElement("div",{className:T,onClick:w?i:void 0},k&&w&&k!==w&&r.ZP.createElement("img",{src:k,className:"prev-avatar-media",alt:"",decoding:"async"}),"string"==typeof I?(0,l.Z)(I,["hq_emoji"]):I)}));var b=n(2255);const N=(0,r.X$)((0,a.c$)(((e,{userId:t,forceShowSelf:n})=>{const{connectionState:r,serverTimeOffset:a}=e,s=(0,i.dy)(e,t),o=(0,i.Z1)(e,t),c=!n&&s&&s.isSelf,{animationLevel:l}=e.settings.byKey;return{connectionState:r,user:s,chat:o,isSavedMessages:c,animationLevel:l,serverTimeOffset:a}}),((e,t)=>(0,d.ei)(t,["loadFullUser","openMediaViewer"])))((({forceShowSelf:e,user:t,chat:n,isSavedMessages:a,connectionState:i,animationLevel:d,loadFullUser:Z,openMediaViewer:g,serverTimeOffset:E})=>{var P;const{id:y}=t||{},{id:N}=n||{},w=t?(0,c.Js)(t):n?n.title:"",k=(null==t?void 0:t.photos)||(null==n?void 0:n.photos)||[],I=d>=1?"slide":"none",[T,S]=(0,r.eJ)(0),M=a||k.length<=1||0===T,L=a||k.length<=1||T===k.length-1;(0,r.d4)((()=>{T>k.length&&S(Math.max(0,k.length-1))}),[T,k.length]);const x=(0,v.Z)();(0,r.d4)((()=>{"connectionStateReady"===i&&y&&!e&&Z({userId:y})}),[y,Z,i,e]),function(e,t,n){(0,r.d4)((()=>{t.slice(n,n+4).forEach((e=>{f.UV(`photo${e.id}?size=c`)||f.he(`photo${e.id}?size=c`,h.IU.BlobUrl)}))}),[n,t])}(0,k,T);const $=(0,r.I4)((()=>{g({avatarOwnerId:y||N,profilePhotoIndex:T,origin:e?s.bZ.SettingsAvatar:s.bZ.ProfileAvatar})}),[g,y,N,T,e]),A=(0,r.I4)((()=>{M||S(T-1)}),[T,M]),F=(0,r.I4)((()=>{L||S(T+1)}),[T,L]);if((0,r.d4)((()=>{const e=document.querySelector(".photo-wrapper");if(e)return(0,u.s)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:o.$b?(e,t)=>t===u.e.Right?(A(),!0):t===u.e.Left&&(F(),!0):void 0})}),[F,A]),!t&&!n)return;function O(){const e=!a&&k&&k.length>0?k[T]:void 0;return r.ZP.createElement(C,{key:T,user:t,chat:n,photo:e,isSavedMessages:a,isFirstPhoto:M,onClick:$})}const D=null===(P=t||n)||void 0===P?void 0:P.isVerified;return r.ZP.createElement("div",{className:(0,m.Z)("ProfileInfo",e&&"self"),dir:x.isRtl?"rtl":void 0},r.ZP.createElement("div",{className:"photo-wrapper"},function(){if(!(a||!k||k.length<=1))return r.ZP.createElement("div",{className:"photo-dashes"},k.map(((e,t)=>r.ZP.createElement("span",{className:"photo-dash "+(t===T?"current":"")}))))}(),r.ZP.createElement(b.Z,{activeKey:T,name:I,className:"profile-slide-container"},O),!M&&r.ZP.createElement("button",{type:"button",className:"navigation prev","aria-label":x("AccDescrPrevious"),onClick:A}),!L&&r.ZP.createElement("button",{type:"button",className:"navigation next","aria-label":x("Next"),onClick:F})),r.ZP.createElement("div",{className:"info",dir:x.isRtl?"rtl":"auto"},a?r.ZP.createElement("div",{className:"title"},r.ZP.createElement("h3",{dir:"auto"},x("SavedMessages"))):r.ZP.createElement("div",{className:"title"},r.ZP.createElement("h3",{dir:"auto"},w&&(0,l.Z)(w)),D&&r.ZP.createElement(p.Z,null)),!a&&(t?r.ZP.createElement("div",{className:"status "+((0,c.kM)(t)?"online":"")},r.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,c.Tq)(x,t,E))):r.ZP.createElement("span",{className:"status",dir:"auto"},(0,c.eA)(n)?x("Subscribers",null!==(U=n.membersCount)&&void 0!==U?U:0,"i"):x("Members",null!==(R=n.membersCount)&&void 0!==R?R:0,"i")))));var U,R})))},3547:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),a=n(6137),s=n(3657),o=n(6202),i=n(8835),c=n(706),l=n(6752),d=n(386),u=n(7799),m=n(231);const h=(0,r.X$)((({sticker:e,size:t,observeIntersection:n,noAnimate:h,title:f,className:v,onClick:p,clickArg:Z,onUnfaveClick:g})=>{const E=(0,r.sO)(null),P=`sticker${e.id}`,y=`sticker-button-${e.id}`,C=(0,s.Op)(E,n),b=e.thumbnail?e.thumbnail.dataUri:void 0,N=(0,o.Z)(`${P}?size=m`,!C,a.IU.BlobUrl),w=C&&!h,k=(0,o.Z)(e.isAnimated&&P,!w,a.IU.Lottie),[I,T,S]=(0,c.Z)(Boolean(k)),M=I&&w,{shouldRenderThumb:L,shouldRenderFullMedia:x,transitionClassNames:$}=(0,i.Z)(N||M,"slow");(0,r.d4)((()=>{w||S()}),[S,w]);const A=(0,l.Z)("StickerButton",e.isAnimated&&"animated",y,v),F=L&&b?`background-image: url('${b}');`:"";return r.ZP.createElement("div",{ref:E,className:A,title:f||(null==e?void 0:e.emoji),style:F,"data-sticker-id":e.id,onMouseDown:d.b,onClick:function(){p&&p(Z)}},x&&!M&&r.ZP.createElement("img",{src:N,className:$}),w&&k&&r.ZP.createElement(u.Z,{id:P,animationData:k,play:!0,size:t,isLowPriority:!0,onLoad:T}),g&&r.ZP.createElement(m.Z,{className:"sticker-unfave-button",color:"dark",round:!0,onClick:function(t){t.stopPropagation(),t.preventDefault(),g(e)}},r.ZP.createElement("i",{className:"icon-close"})))}))},4851:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(9203),s=n(8778);const o=(0,r.X$)((e=>{const{isOpen:t}=e,n=(0,s.Z)(a.gl.Extra,"StickerSetModal",!t);return n?r.ZP.createElement(n,e):void 0}))},8729:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(4050),a=n(5116),s=n(8085),o=n(2858),i=n(2340),c=n(9107);const l=(0,r.X$)((0,a.c$)(((e,{typingStatus:t})=>t.userId?{typingUser:(0,s.dy)(e,t.userId)}:{}))((({typingStatus:e,typingUser:t})=>{const n=(0,c.Z)(),a=t&&!t.isSelf&&(0,o.Vl)(t);return r.ZP.createElement("p",{className:"typing-status",dir:n.isRtl?"rtl":"auto"},a&&r.ZP.createElement("span",{className:"sender-name",dir:"auto"},(0,i.Z)(a)),n(e.action).replace("{user}","").trim(),r.ZP.createElement("span",{className:"ellipsis"}))})))},9411:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050);const a=()=>r.ZP.createElement("span",{className:"VerifiedIcon"})},5418:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),a=n(2858),s=n(6752),o=n(8035),i=n(2340),c=n(790),l=n(9107),d=n(3709),u=n(8033),m=n(88);const h=(0,r.X$)((({message:e,senderTitle:t,onMessageClick:n})=>{const h=(0,l.Z)();let f=(0,a.s1)(e);if(!f){const t=(0,a.T7)(e);if(t){const{url:n,domain:r}=t,s=(0,a.MK)(h,e);f={siteName:r.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,description:s!==n?s:void 0}}}const v=(0,r.I4)((()=>{n(e.id,e.chatId)}),[n,e.id,e.chatId]);if(!f)return;const{siteName:p,url:Z,displayUrl:g,title:E,description:P,photo:y,video:C}=f,b=!t&&(0,o.Z)(P,170),N=(0,s.Z)("WebLink scroll-item",!y&&!C&&"without-media");return r.ZP.createElement("div",{className:N,"data-initial":(p||g)[0],dir:h.isRtl?"rtl":void 0},y&&r.ZP.createElement(d.Z,{message:e}),r.ZP.createElement("div",{className:"content"},r.ZP.createElement(u.Z,{isRtl:h.isRtl,className:"site-title",onClick:v},(0,i.Z)(E||p||g)),b&&r.ZP.createElement(u.Z,{isRtl:h.isRtl,className:"site-description",onClick:v},(0,i.Z)(b)),r.ZP.createElement(m.Z,{url:Z,className:"site-name",text:"",isRtl:h.isRtl},Z.replace("mailto:","")||g),t&&r.ZP.createElement("div",{className:"sender-name"},(0,i.Z)(t))),t&&r.ZP.createElement("div",{className:"message-date"},r.ZP.createElement(u.Z,{className:"date",onClick:v,isRtl:h.isRtl},(0,c.VX)(h,1e3*e.date))))}))},4399:(e,t,n)=>{n.d(t,{L6:()=>i,Gw:()=>c,vw:()=>l,vY:()=>d,wB:()=>u,kc:()=>p,fM:()=>g,Eh:()=>E,GC:()=>P,W7:()=>y,lE:()=>C,Wr:()=>b,PA:()=>N,jg:()=>w});var r=n(3716),a=n(7361),s=n(3858),o=n(2858);const i="(max-height: 640px)",c=parseInt(getComputedStyle(document.documentElement).fontSize,10),l=200,d={width:640,height:640},u="1258816259753933",m={width:100,height:100};let h,f,v;function p(e,t,n,r){const o=t||n?1.625:0;return(function(e,t){const n=e?30:29;if(!a.wB)return n;const{width:r}=s.Z.get();return h||(h=Math.min(30,r/c-4.5)),f||(f=Math.min(29,r/c-7)),v||(v=Math.min(29,r/c-4.5)),e?h:t?v:f}(e,r)-o)*c}function Z({width:e,height:t,fromOwnMessage:n,isForwarded:r,isWebPagePhoto:a,isGif:s,noAvatars:o}){const i=t/e;return w(p(n,r,a,o),function(e,t){return e&&t&&t>=.75&&t<=1.25?20*c:27*c}(s,i),e,t)}function g(e,t){const n=window.matchMedia(i),{width:r,height:a}=s.Z.get();let o=t&&n.matches?10:8.25;return e&&(o=n.matches?10:15),{width:r,height:a-o*c}}function E(e,t,n,r,a){const{width:s,height:i}=(0,o.HV)(e)||m;return Z({width:s,height:i,fromOwnMessage:t,isForwarded:n,isWebPagePhoto:r,noAvatars:a})}function P(e,t,n,r){const{width:a,height:s}=(0,o.jC)(e)||m;return Z({width:a,height:s,fromOwnMessage:t,isForwarded:n,isGif:e.isGif,noAvatars:r})}function y(){return{width:2*c,height:2*c}}function C(e){return e?{width:3*c,height:3*c}:{width:3.375*c,height:3.375*c}}function b(e){const{width:t}=e;let{height:n}=e;e.id===u&&(n=t);const s=n&&t&&n/t,o=c*(a.wB?r.w7:r.K7),i=s?o*s:o;return s&&i>o?{width:Math.round(o/s),height:o}:{width:o,height:i}}function N({width:e,height:t},n,r=!1){const{width:a,height:s}=g(n,r);return w(a,s,e,t)}function w(e,t,n,r){const a=r/n,s=Math.min(n,e);return Math.round(s*a)>t?{width:Math.round(t/a),height:t}:{width:s,height:Math.round(s*a)}}},935:(e,t,n)=>{n.d(t,{X:()=>d,H:()=>h});var r=n(4050),a=n(5116),s=n(6137),o=n(2858),i=n(2340),c=n(7373),l=n(88);function d(e,t,n){const r=e.content.text;if(!r||!r.text){const t=(0,o.UD)(e);return t?[t]:void 0}const{text:a,entities:s}=r;return h(a,s,t,n)}function u(e,t,n,r){const{offset:a,length:s}=e,o=new Set([t]);if(r.has(t))return;const i=[];return n.filter(((e,n)=>n>t&&e.offset>=a&&e.offsetu(e,n.indexOf(e),n,r))).filter(Boolean).forEach((e=>{let t=!1;e.organizedIndexes.forEach((e=>{t||o.has(e)||(t=!0),o.add(e)})),t&&i.push(e)})),{entity:e,organizedIndexes:o,nestedEntities:i}}function m(e){const t=new Set,n=[];return e.forEach(((r,a)=>{if(t.has(a))return;const s=u(r,a,e,t);s&&(s.organizedIndexes.forEach((e=>{t.add(e)})),n.push(s))})),n}function h(e,t,n,a,o){if(!t||!t.length)return f(e,n,a,o);const d=[];let u=!1;const h=m(t);function g(t,d,m,h){const E=[],{entity:P,nestedEntities:y}=m,{offset:C,length:b,type:N}=P;let w=e.substring(t,C);const k=w.length;w&&(u&&w.length>0&&"\n"===w[0]&&(w=w.substr(1),u=!1),w&&E.push(...f(w,n,a,o)));const I=t+k,T=I+b;let S=e.substring(C,C+b);const M=[];if(u&&S.length>0&&"\n"===S[0]&&(S=S.substr(1),u=!1),N===s.Vv.Pre&&(u=!0),y.length){let e=I;y.forEach(((t,n)=>{const{renderResult:r,entityEndIndex:a}=g(e,T,t,n===y.length-1);M.push(...r),e=a}))}const L=o?function(e,t,n){const r="string"==typeof t&&t,a=n.length?n.join(""):(0,i.Z)(t,["escape_html","emoji_html","br_html"]).join("");if(!r)return a;switch(e.type){case s.Vv.Bold:return`${a}`;case s.Vv.Italic:return`${a}`;case s.Vv.Underline:return`${a}`;case s.Vv.Code:return`${a}`;case s.Vv.Pre:return`\`\`\`
${a}
\`\`\``;case s.Vv.Strike:return`${a}`;case s.Vv.MentionName:return`${a}`;case s.Vv.Url:case s.Vv.TextUrl:return`${a}`;default:return a}}(P,S,M):function(e,t,n){const a="string"==typeof t&&t,o=n.length?n:t;if(!a)return f(o);switch(e.type){case s.Vv.Bold:return r.ZP.createElement("strong",null,f(o));case s.Vv.Blockquote:return r.ZP.createElement("blockquote",null,f(o));case s.Vv.BotCommand:return r.ZP.createElement("a",{onClick:p,className:"text-entity-link",dir:"auto"},f(o));case s.Vv.Hashtag:case s.Vv.Cashtag:return r.ZP.createElement("a",{onClick:Z,className:"text-entity-link",dir:"auto"},f(o));case s.Vv.Code:return r.ZP.createElement("code",{className:"text-entity-code"},f(o));case s.Vv.Email:return r.ZP.createElement("a",{href:`mailto:${a}`,target:"_blank",rel:"noopener noreferrer",className:"text-entity-link",dir:"auto"},f(o));case s.Vv.Italic:return r.ZP.createElement("em",null,f(o));case s.Vv.MentionName:return r.ZP.createElement(c.Z,{userId:e.userId},f(o));case s.Vv.Mention:return r.ZP.createElement(c.Z,{username:a},f(o));case s.Vv.Phone:return r.ZP.createElement("a",{href:`tel:${a}`,className:"text-entity-link",dir:"auto"},f(o));case s.Vv.Pre:return r.ZP.createElement("pre",{className:"text-entity-pre"},f(o));case s.Vv.Strike:return r.ZP.createElement("del",null,f(o));case s.Vv.TextUrl:case s.Vv.Url:return r.ZP.createElement(l.Z,{url:v(a,e),text:a},f(o));case s.Vv.Underline:return r.ZP.createElement("ins",null,f(o));default:return f(o)}}(P,S,M);if(Array.isArray(L)?E.push(...L):E.push(L),h&&T0&&"\n"===t[0]&&(t=t.substring(1)),t&&E.push(...f(t,n,a,o))}return{renderResult:E,entityEndIndex:T}}let E=0;return h.forEach(((t,n)=>{const{renderResult:r,entityEndIndex:a}=g(E,e.length,t,n===h.length-1);d.push(...r),E=a})),d}function f(e,t,n,r){if(Array.isArray(e)){const a=[];return e.forEach((e=>{a.push(...f(e,t,n,r))})),a}if(r)return(0,i.Z)(e,["escape_html","emoji_html","br_html"]);const a=n?"hq_emoji":"emoji";return t?(0,i.Z)(e,[a,"br","highlight"],{highlight:t}):(0,i.Z)(e,[a,"br"])}function v(e,t){const{type:n,url:r}=t;return n===s.Vv.TextUrl&&r?r:e}function p(e){(0,a.uC)().sendBotCommand({command:e.currentTarget.innerText})}function Z(e){(0,a.uC)().setLocalTextSearchQuery({query:e.currentTarget.innerText}),(0,a.uC)().searchTextMessagesLocal()}},9359:(e,t,n)=>{n.d(t,{Z:()=>B});var r=n(4050),a=n(5116),s=n(3716),o=n(7361),i=n(7204),c=n(782),l=n(2858),d=n(8085),u=n(7407);let m;!function(e){e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None"}(m||(m={}));var h=n(1273),f=n(4288),v=n(9107),p=n(6137),Z=n(2864),g=n(2340),E=n(9118),P=n(6752),y=n(5790),C=n(1470),b=n(706),N=n(6202),w=n(172),k=n(9411),I=n(8729),T=n(6844),S=n(329),M=n(1876),L=n(2155),x=n(126);const $=(0,r.X$)((({chat:e,isPinned:t,isMuted:n})=>{const a=Boolean(e.unreadCount||e.hasUnreadMark||t),s=(0,P.Z)("Badge",n&&"muted",t&&"pinned",Boolean(e.unreadCount||e.hasUnreadMark)&&"unread");function o(){return e.unreadCount?e.unreadMentionsCount?r.ZP.createElement("div",{className:"Badge-wrapper"},r.ZP.createElement("div",{className:"Badge mention"},r.ZP.createElement("i",{className:"icon-mention"})),r.ZP.createElement("div",{className:s},(0,L.bi)(e.unreadCount))):r.ZP.createElement("div",{className:s},(0,L.bi)(e.unreadCount)):e.hasUnreadMark?r.ZP.createElement("div",{className:s}):t?r.ZP.createElement("div",{className:s},r.ZP.createElement("i",{className:"icon-pinned-chat"})):void 0}return r.ZP.createElement(x.Z,{isCustom:!0,className:"Badge-transition",isOpen:a},o)})),A=(0,r.X$)((0,a.c$)(((e,{chatId:t})=>{const n=(0,d.Z1)(e,t);if(!n||!n.lastMessage)return{};const{senderId:r,replyToMessageId:a,isOutgoing:s}=n.lastMessage,o=r?(0,d.dy)(e,r):void 0,i=(0,l.N5)(n.lastMessage),c=i&&a?(0,d.hj)(e,n.id,a):void 0,{targetUserIds:u,targetChatId:m}=i||{},h=(0,l.zX)(n),{byId:f}=e.users,{chatId:v,threadId:Z,type:g}=(0,d.Bt)(e)||{},E=t===v&&Z===p._f;return{chat:n,isMuted:(0,l.i4)(n,(0,d.dZ)(e),(0,d.NJ)(e)),lastMessageSender:o,actionTargetUserIds:u,actionTargetChatId:m,actionTargetMessage:c,draft:(0,d.Ms)(e,t,p._f),animationLevel:e.settings.byKey.animationLevel,isSelected:E,canScrollDown:E&&"thread"===g,lastSyncTime:e.lastSyncTime,...s&&{lastMessageOutgoingStatus:(0,d.dT)(e,n.lastMessage)},...h&&{privateChatUser:(0,d.dy)(e,h)},...u&&{usersById:f}}}),((e,t)=>(0,c.ei)(t,["openChat","focusLastMessage"])))((({style:e,chatId:t,folderId:n,orderDiff:a,animationType:i,isPinned:c,chat:d,isMuted:u,privateChatUser:h,actionTargetUserIds:f,usersById:p,lastMessageSender:L,lastMessageOutgoingStatus:x,actionTargetMessage:A,actionTargetChatId:F,draft:O,animationLevel:D,isSelected:U,canScrollDown:R,lastSyncTime:B,openChat:V,focusLastMessage:X})=>{const j=(0,r.sO)(null),[H,K,q]=(0,b.Z)(),[z,J,Y]=(0,b.Z)(),{lastMessage:W,typingStatus:_}=d||{},G=W&&(0,l.Lo)(W);(0,y.Z)(t,G?W.replyToMessageId:void 0,A);const Q=W&&!(0,l.bf)(W)?(0,l.DH)(W):void 0,ee=(0,N.Z)(W?(0,l.Ti)(W,"micro"):void 0),te=Boolean(W&&(0,l.Y5)(W)),ne=(0,r.Ye)((()=>f?f.map((e=>null==p?void 0:p[e])).filter(Boolean):void 0),[f,p]);(0,r.bt)((()=>{const e=j.current;if(0!==D&&e){if(i===m.Opacity)e.style.opacity="0",(0,E.T2)((()=>{e.classList.add("animate-opacity"),e.style.opacity="1"}));else{if(i!==m.Move)return;e.style.transform=`translate3d(0, ${100*-a}%, 0)`,(0,E.T2)((()=>{e.classList.add("animate-transform"),e.style.transform=""}))}setTimeout((()=>{(0,E.T2)((()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""}))}),200+s.fK)}}),[D,a,i]);const re=(0,r.I4)((()=>{V({id:t,shouldReplaceHistory:!0}),U&&R&&X()}),[U,R,V,t,X]),ae=(0,C.Z)({chat:d,privateChatUser:h,handleDelete:function(){J(),K()},folderId:n,isPinned:c,isMuted:u}),se=(0,v.Z)();if(!d)return;const oe=(0,P.Z)("Chat chat-item-clickable",(0,l.YA)(t)?"private":"group",U&&"selected");return r.ZP.createElement(M.Z,{ref:j,className:oe,style:e,ripple:!o.wB,contextActions:ae,onClick:re},r.ZP.createElement("div",{className:"status"},r.ZP.createElement(w.Z,{chat:d,user:h,withOnlineStatus:!0,isSavedMessages:null==h?void 0:h.isSelf,lastSyncTime:B})),r.ZP.createElement("div",{className:"info"},r.ZP.createElement("div",{className:"title"},r.ZP.createElement("h3",null,(0,g.Z)((0,l.U)(se,d,h))),d.isVerified&&r.ZP.createElement(k.Z,null),u&&r.ZP.createElement("i",{className:"icon-muted-chat"}),d.lastMessage&&r.ZP.createElement(T.Z,{message:d.lastMessage,outgoingStatus:x})),r.ZP.createElement("div",{className:"subtitle"},function(){if(_&&W&&_.timestamp>1e3*W.date)return r.ZP.createElement(I.Z,{typingStatus:_});if(null!=O&&O.text.length)return r.ZP.createElement("p",{className:"last-message",dir:se.isRtl?"auto":"ltr"},r.ZP.createElement("span",{className:"draft"},se("Draft")),(0,g.Z)(O.text));if(!W)return;if(G){const e=d&&((0,l.eA)(d)||W.senderId===W.chatId)?d:L;return r.ZP.createElement("p",{className:"last-message",dir:se.isRtl?"auto":"ltr"},(0,g.Z)((0,Z.D)(se,W,e,ne,A,F,{asPlain:!0})))}const e=(0,l.zF)(se,t,L);return r.ZP.createElement("p",{className:"last-message",dir:se.isRtl?"auto":"ltr"},e&&r.ZP.createElement(r.ZP.Fragment,null,r.ZP.createElement("span",{className:"sender-name"},(0,g.Z)(e)),r.ZP.createElement("span",{className:"colon"},":")),function(e,t,n,a){return n?r.ZP.createElement("span",{className:"media-preview"},r.ZP.createElement("img",{src:n,alt:"",className:a?"round":void 0}),(0,l.b7)(t)&&r.ZP.createElement("i",{className:"icon-play"}),(0,g.Z)((0,l.MK)(e,t,!0))):(0,g.Z)((0,l.MK)(e,t))}(se,W,ee||Q,te))}(),r.ZP.createElement($,{chat:d,isPinned:c,isMuted:u}))),z&&r.ZP.createElement(S.Z,{isOpen:H,onClose:q,onCloseAnimationEnd:Y,chat:d}))})));var F=n(1713),O=n(231),D=n(7854);const U=(0,r.X$)((0,a.c$)(((e,{folderId:t,folderType:n})=>({chatFolder:t&&"folder"===n?(0,d.Mw)(e,t):void 0,animatedEmoji:(0,d.zB)(e,"📂")})))((({chatFolder:e,animatedEmoji:t,foldersDispatch:n,onScreenSelect:a})=>{const s=(0,v.Z)(),i=(0,r.I4)((()=>{n({type:"editFolder",payload:e}),a(F.MT.FoldersEditFolderFromChatList)}),[e,n,a]);return r.ZP.createElement("div",{className:"EmptyFolder"},r.ZP.createElement("div",{className:"sticker"},t&&r.ZP.createElement(D.Z,{sticker:t})),r.ZP.createElement("h3",{className:"title",dir:"auto"},s("FilterNoChatsToDisplay")),r.ZP.createElement("p",{className:"description",dir:"auto"},s(e?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")),e&&n&&a&&r.ZP.createElement(O.Z,{ripple:!o.wB,fluid:!0,pill:!0,onClick:i,size:"smaller",isRtl:s.isRtl},r.ZP.createElement("i",{className:"icon-settings"}),s("ChatList.EmptyChatListEditFilter")))})));var R;!function(e){e.all="active",e.archived="archived"}(R||(R={}));const B=(0,r.X$)((0,a.c$)(((e,{folderType:t,folderId:n})=>{const{chats:{listIds:r,byId:a,orderedPinnedIds:s},users:{byId:o},lastSyncTime:i}=e,c="folder"!==t?R[t]:void 0,l=n?(0,d.Mw)(e,n):void 0;return{chatsById:a,usersById:o,lastSyncTime:i,notifySettings:(0,d.dZ)(e),notifyExceptions:(0,d.NJ)(e),...c?{listIds:r[c],orderedPinnedIds:s[c]}:{chatFolder:l}}}),((e,t)=>(0,c.ei)(t,["loadMoreChats","preloadTopChatMessages","openChat","openNextChat"])))((({folderType:e,folderId:t,isActive:n,chatFolder:a,chatsById:d,usersById:v,listIds:p,orderedPinnedIds:Z,lastSyncTime:g,foldersDispatch:E,notifySettings:P,notifyExceptions:y,onScreenSelect:C,loadMoreChats:b,preloadTopChatMessages:N,openChat:w,openNextChat:k})=>{const[I,T]=(0,r.Ye)((()=>"folder"===e&&a?(0,l.P4)(d,v,a,P,y):[p,Z]),[e,a,d,v,P,y,p,Z]),[S,M]=(0,r.Ye)((()=>{if(!I||"folder"===e&&!a)return[];const t=(0,l.O)(d,I,T,e),n=[...t.pinnedChats,...t.otherChats],r=n.map((({id:e})=>e));return[n.reduce(((e,t,n)=>(e[t.id]=n,e)),{}),r]}),[I,T,e,a,d]),L=(0,i.Z)(S),x=(0,r.Ye)((()=>S&&L?(0,c.Q8)(S,((e,t)=>e-(void 0!==L[t]?L[t]:1/0))):{}),[S,L]),$=(0,r.I4)((()=>{b({listType:"archived"===e?"archived":"active"})}),[b,e]),[F,O]=(0,u.Z)(g?$:void 0,M,void 0,s.t_,"all"===e&&!s.NM),D=F&&(0,l.O)(d,F,T,e);(0,r.d4)((()=>{g&&"all"===e&&N()}),[g,e,N]);const R=function(e){const t=(0,r.I4)((t=>e[t]<0),[e]),n=(0,r.I4)((t=>e[t]>0),[e]),a=Object.keys(e).map(Number),s=a.filter(t).length,o=a.filter(n).length;return(0,r.I4)((r=>{const a=e[r];return 0===a?m.None:a===1/0||a===-1/0||t(r)&&s<=o||n(r)&&o{const e=e=>{if(n&&M){if(o.fl&&(o.jm&&e.metaKey||!o.jm&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t)return;const n=Number(t)-1;if(n>M.length-1)return;w({id:M[n],shouldReplaceHistory:!0})}if(e.altKey){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(!t)return;e.preventDefault(),k({targetIndexDelta:t,orderedIds:M})}}};return document.addEventListener("keydown",e,!1),()=>{document.removeEventListener("keydown",e,!1)}})),r.ZP.createElement(h.Z,{className:"chat-list custom-scroll",items:F,onLoadMore:O,preloadBackwards:s.t_,noFastList:!0,noScrollRestore:!0},null!=F&&F.length&&D?function(){const e=M.indexOf(F[0]),n=e+D.pinnedChats.length;return r.ZP.createElement("div",{className:"scroll-container",style:o.wZ?`height: ${M.length*s.rS}px`:void 0,teactFastList:!0},D.pinnedChats.map((({id:n},a)=>r.ZP.createElement(A,{key:n,teactOrderKey:a,chatId:n,isPinned:!0,folderId:t,animationType:R(n),orderDiff:x[n],style:`top: ${(e+a)*s.rS}px;`}))),D.otherChats.map(((e,a)=>r.ZP.createElement(A,{key:e.id,teactOrderKey:(0,l.OE)(e),chatId:e.id,folderId:t,animationType:R(e.id),orderDiff:x[e.id],style:`top: ${(n+a)*s.rS}px;`}))))}():F&&!F.length?r.ZP.createElement(U,{folderId:t,folderType:e,foldersDispatch:E,onScreenSelect:C}):r.ZP.createElement(f.Z,{key:"loading"}))})))},2420:(e,t,n)=>{n.d(t,{t:()=>d,Z:()=>u});var r=n(4050),a=n(1212),s=n(6752),o=n(3989),i=n(7204),c=n(706);const l=(0,r.X$)((({isQuick:e,onFileSelect:t})=>{const[n,a,o]=(0,c.Z)(),i=(0,s.Z)("DropTarget",n&&"hovered");return r.ZP.createElement("div",{className:i,onDrop:t,onDragEnter:()=>{a()},onDragLeave:e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),o()}},r.ZP.createElement("div",{className:"target-content"},r.ZP.createElement("div",{className:"icon icon-"+(e?"photo":"document")}),r.ZP.createElement("div",{className:"title"},"Drop files here to send them"),r.ZP.createElement("div",{className:"description"},e?"in a quick way":"without compression")))}));let d;!function(e){e.None="none",e.Document="document",e.QuickFile="quick_file"}(d||(d={}));const u=(0,r.X$)((({isOpen:e,withQuick:t,onHide:n,onFileSelect:c})=>{const d=(0,r.sO)(null),u=(0,i.Z)(t),{shouldRender:m,transitionClassNames:h}=(0,a.Z)(e);(0,r.d4)((()=>e?(0,o.Z)(n):void 0),[e,n]);const f=(0,r.I4)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),c(Array.from(t.files),!1))}),[c,n]),v=(0,r.I4)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),c(Array.from(t.files),!0))}),[c,n]),p=(0,r.I4)((e=>{e.stopPropagation();const{target:t,relatedTarget:r}=e;t.matches(".DropTarget, .DropArea")&&!r&&(d.current=window.setTimeout((()=>{n()}),150))}),[n]);if(!m)return;const Z=(0,s.Z)("DropArea",h);return r.ZP.createElement("div",{className:Z,onDragLeave:p,onDragOver:()=>{d.current&&window.clearTimeout(d.current)},onDrop:n},r.ZP.createElement(l,{onFileSelect:f}),(t||u)&&r.ZP.createElement(l,{onFileSelect:v,isQuick:!0}))}))},9830:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(9203),s=n(8778);const o=(0,r.X$)((e=>{const{isOpen:t}=e,n=(0,s.Z)(a.gl.Extra,"EmojiTooltip",!t);return n?r.ZP.createElement(n,e):void 0}))},3616:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(4050),a=n(5116),s=n(3716),o=n(8085),i=n(9118),c=n(5723),l=n(6752),d=n(782),u=n(7361),m=n(517),h=n(2645),f=n(706),v=n(4784),p=n(6391),Z=n(9107),g=n(2340),E=n(3283);const P=u.wB?256:416,y=(0,r.X$)((0,a.c$)((e=>{const{chatId:t,threadId:n}=(0,o.Bt)(e)||{},{messageSendKeyCombo:r}=e.settings.byKey;return{currentChatId:t,messageSendKeyCombo:r,replyingToId:t&&n?(0,o.Yy)(e,t,n):void 0,noTabCapture:e.isPollModalOpen||e.payment.isPaymentModalOpen}}),((e,t)=>(0,d.ei)(t,["editLastMessage","replyToNextMessage"])))((({id:e,isAttachmentModalInput:t,editableInputId:n,html:a,placeholder:o,forcedPlaceholder:d,shouldSetFocus:y,shouldSuppressFocus:C,shouldSuppressTextFormatter:b,onUpdate:N,onSuppressedFocus:w,onSend:k,currentChatId:I,replyingToId:T,noTabCapture:S,messageSendKeyCombo:M,editLastMessage:L,replyToNextMessage:x})=>{const $=(0,r.sO)(null),A=(0,r.sO)(null),F=(0,Z.Z)(),O=(0,r.sO)(!1),[D,U,R]=(0,f.Z)(),[B,V]=(0,r.eJ)(),[X,j]=(0,r.eJ)();(0,r.d4)((()=>{t&&z(!1)}),[t]),(0,h.Z)((([e])=>{a!==$.current.innerHTML&&($.current.innerHTML=a),a!==A.current.innerHTML&&(A.current.innerHTML=a),void 0!==e&&e!==a&&z(!a.length)}),[a]);const H=(0,r.I4)((()=>{$.current.closest(".from, .to")?setTimeout(H,350):(0,c.Z)($.current)}),[]),K=(0,r.I4)((()=>{R(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()}),[R]);function q(){if(u.cj)return;const e=window.getSelection();if(!e||!e.rangeCount||O.current)return void R();const t=e.getRangeAt(0),r=t.toString().trim();if(b||!(0,p.R)(t,n||s.R2)||!r||(0,v.Z)(r)||!t.START_TO_END)return void R();const a=t.getBoundingClientRect(),o=$.current.getBoundingClientRect();let i=a.left+a.width/2-o.left;i<90?i=90:i>o.width-90&&(i=o.width-90),V({x:i,y:a.top-o.top}),j(t),U()}function z(e=!1){const t=$.current,n=A.current,r=Number(t.style.height.replace("px","")),a=Math.min(n.scrollHeight,P);if(a===r)return;const s=Math.round(50*Math.log(Math.abs(a-r))),o=()=>{t.style.height=`${a}px`,t.style.transitionDuration=`${s}ms`,t.classList.toggle("overflown",n.scrollHeight>P)};e?requestAnimationFrame(o):o()}(0,r.d4)((()=>{u.$b||y&&H()}),[I,H,T,y]),(0,r.d4)((()=>{if(S)return;const e=(0,i.Ds)((e=>{"Tab"===e.key&&(e.preventDefault(),requestAnimationFrame(H))}),2e3,!0,!1);return(0,m.Z)({onTab:e})}),[H,S]),(0,r.d4)((()=>{const e=$.current;function t(){e.blur()}return C&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}}),[C]);const J=(0,l.Z)("form-control custom-scroll",a.length>0&&"touched",C&&"focus-disabled");return r.ZP.createElement("div",{id:e,onClick:C?w:void 0,dir:F.isRtl?"rtl":void 0},r.ZP.createElement("div",{ref:$,id:n||s.R2,className:J,contentEditable:!0,dir:"auto",onClick:H,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(N("
"===t?"":t),!(u.$b||n&&n.length)){const e=window.getSelection();e&&($.current.blur(),e.removeAllRanges(),(0,c.Z)($.current,!0))}},onKeyDown:function(e){if(e.metaKey&&!a.length){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void x({targetIndexDelta:t})}"Enter"!==e.key||e.shiftKey?"ArrowUp"!==e.key||a.length||e.metaKey||e.altKey?e.target.addEventListener("keyup",(function t(){q(),e.target.removeEventListener("keyup",t)})):(e.preventDefault(),L()):u.cj||u.wZ||!("enter"===M&&!e.shiftKey||"ctrl-enter"===M&&(e.ctrlKey||e.metaKey))||(e.preventDefault(),R(),k())},onMouseDown:function(e){2===e.button?!0!==O.current&&(O.current=!0,document.addEventListener("mousedown",(function e(){setTimeout((()=>{O.current=!1}),100),window.removeEventListener("mouseup",e)})),document.addEventListener("keydown",(function e(t){"Esc"!==t.key&&"Escape"!==t.key||(setTimeout((()=>{O.current=!1}),100),window.removeEventListener("keydown",e))}))):e.target.addEventListener("mouseup",(function t(){q(),e.target.removeEventListener("mouseup",t)}))},onContextMenu:function(e){u.wZ&&(e.preventDefault(),e.stopPropagation())},onTouchCancel:function(){u.wZ&&q()}}),r.ZP.createElement("div",{ref:A,className:(0,l.Z)(J,"clone"),dir:"auto"}),!d&&r.ZP.createElement("span",{className:"placeholder-text",dir:"auto"},o),r.ZP.createElement(E.Z,{isOpen:D,anchorPosition:B,selectedRange:X,onClose:K}),d&&r.ZP.createElement("span",{className:"forced-placeholder"},(0,g.Z)(d)))})))},3283:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),a=n(3716),s=n(6752),o=n(3989),i=n(1212),c=n(8758),l=n(706),d=n(9107),u=n(231);const m={B:"bold",STRONG:"bold",I:"italic",EM:"italic",U:"underline",DEL:"strikethrough",CODE:"monospace"},h=document.createElement("div"),f=(0,r.X$)((({isOpen:e,anchorPosition:t,selectedRange:n,onClose:f})=>{const v=(0,r.sO)(null),p=(0,r.sO)(null),{shouldRender:Z,transitionClassNames:g}=(0,i.Z)(e),[E,P,y]=(0,l.Z)(),[C,b]=(0,r.eJ)(""),[N,w]=(0,r.eJ)(!1),[k,I]=(0,r.eJ)(),[T,S]=(0,r.eJ)({});(0,r.d4)((()=>e?(0,o.Z)(f):void 0),[e,f]),(0,c.Z)(e,v,f),(0,r.d4)((()=>{E?p.current.focus():(b(""),w(!1))}),[E]),(0,r.d4)((()=>{Z||(y(),S({}),I(void 0))}),[y,Z]),(0,r.d4)((()=>{if(!e||!n)return;const t={};let{parentElement:r}=n.commonAncestorContainer;for(;r&&r.id!==a.R2;){const e=m[r.tagName];e&&(t[e]=!0),r=r.parentElement}S(t)}),[e,n,P]);const M=(0,r.I4)((()=>{if(n)return h.innerText=n.toString(),h.innerHTML}),[n]),L=(0,r.I4)((()=>{if(n)return n.commonAncestorContainer.parentElement}),[n]);function x(){const e=p.current;if(!e)return;const{offsetWidth:t,scrollWidth:n,scrollLeft:r}=e;if(n<=t)return void I(void 0);let a="";r0&&(a+=" mask-left"),I(a)}function $(e){if(T[e])return"active";if("monospace"===e||"strikethrough"===e){if(Object.keys(T).some((t=>t!==e&&!!T[t])))return"disabled"}else if(T.monospace||T.strikethrough)return"disabled"}const A=(0,r.I4)((()=>{S((e=>(document.execCommand(e.bold?"removeFormat":"bold"),Object.keys(e).forEach((t=>{"italic"!==t&&"underline"!==t||!e[t]||document.execCommand(t)})),{...e,bold:!e.bold})))}),[]),F=(0,r.I4)((()=>{document.execCommand("italic"),S((e=>({...e,italic:!e.italic})))}),[]),O=(0,r.I4)((()=>{document.execCommand("underline"),S((e=>({...e,underline:!e.underline})))}),[]),D=(0,r.I4)((()=>{if(T.strikethrough){const e=L();if(!n||!e||"DEL"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void S((e=>({...e,strikethrough:!1})))}const e=M();document.execCommand("insertHTML",!1,`${e}`),f()}),[L,M,f,n,T.strikethrough]),U=(0,r.I4)((()=>{if(T.monospace){const e=L();if(!n||!e||"CODE"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void S((e=>({...e,monospace:!1})))}const e=M();document.execCommand("insertHTML",!1,`${e}`),f()}),[L,M,f,n,T.monospace]);function R(){const e=encodeURI(C.includes("://")?C:`http://${C}`);if(N){const t=L();if(!t||"A"!==t.tagName)return;return t.href=e,void f()}const t=M();!function(){if(!n)return;const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(n))}(),document.execCommand("insertHTML",!1,`${t}`),f()}const B=(0,r.I4)((e=>{const t={KeyK:P,KeyB:A,KeyU:O,KeyI:F,KeyM:U,KeyS:D}[e.code];!e.altKey&&(e.ctrlKey||e.metaKey)&&t&&(e.preventDefault(),e.stopPropagation(),t())}),[A,F,O,U,D,P]);(0,r.d4)((()=>(e&&document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B))),[e,B]);const V=(0,d.Z)();if(!Z)return;const X=(0,s.Z)("TextFormatter",g,E&&"link-control-shown"),j=(0,s.Z)("TextFormatter-link-url-confirm",!!C.length&&"shown"),H=t?`left: ${t.x}px; top: ${t.y}px;--text-formatter-left: ${t.x}px;`:"";return r.ZP.createElement("div",{ref:v,className:X,style:H,onKeyDown:function(e){"Enter"===e.key&&E&&(R(),e.preventDefault())}},r.ZP.createElement("div",{className:"TextFormatter-buttons"},r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:"Bold text",className:$("bold"),onClick:A},r.ZP.createElement("i",{className:"icon-bold"})),r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:"Italic text",className:$("italic"),onClick:F},r.ZP.createElement("i",{className:"icon-italic"})),r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:"Underlined text",className:$("underline"),onClick:O},r.ZP.createElement("i",{className:"icon-underlined"})),r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:"Strikethrough text",className:$("strikethrough"),onClick:D},r.ZP.createElement("i",{className:"icon-strikethrough"})),r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:"Monospace text",className:$("monospace"),onClick:U},r.ZP.createElement("i",{className:"icon-monospace"})),r.ZP.createElement("div",{className:"TextFormatter-divider"}),r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:V("TextFormat.AddLinkTitle"),onClick:P},r.ZP.createElement("i",{className:"icon-link"}))),r.ZP.createElement("div",{className:"TextFormatter-link-control"},r.ZP.createElement("div",{className:"TextFormatter-buttons"},r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:V("Cancel"),onClick:y},r.ZP.createElement("i",{className:"icon-arrow-left"})),r.ZP.createElement("div",{className:"TextFormatter-divider"}),r.ZP.createElement("div",{className:(0,s.Z)("TextFormatter-link-url-input-wrapper",k)},r.ZP.createElement("input",{ref:p,className:"TextFormatter-link-url-input",type:"text",value:C,placeholder:"Enter URL...",autoComplete:"off",inputMode:"url",dir:"auto",onChange:function(e){b(e.target.value),x()},onScroll:x})),r.ZP.createElement("div",{className:j},r.ZP.createElement("div",{className:"TextFormatter-divider"}),r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:V("Save"),className:"color-primary",onClick:R},r.ZP.createElement("i",{className:"icon-check"}))))))}))},6980:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(6137),a=n(7361);const s={B:r.Vv.Bold,STRONG:r.Vv.Bold,I:r.Vv.Italic,EM:r.Vv.Italic,U:r.Vv.Underline,S:r.Vv.Strike,STRIKE:r.Vv.Strike,DEL:r.Vv.Strike,CODE:r.Vv.Code,PRE:r.Vv.Pre,BLOCKQUOTE:r.Vv.Blockquote};function o(e){const t=document.createElement("div");t.innerHTML=function(e){let t=e.slice(0);return a.op||(t=t.replace(/]+alt="([^"]+)"[^>]*>/gm,"$1")),t=t.replace(/<\/?span([^>]*)?>/g,""),t=t.replace(/ /g," "),t=t.replace(/
]*)?><\/div>/g,"\n"),t=t.replace(/]*)?>/g,"\n"),t=t.replace(/<\/div>(\s*)
/g,"\n"),t=t.replace(/
/g,"\n"),t=t.replace(/<\/div>/g,""),t=t.replace(/^`{3}(.*[\n\r][^]*?^)`{3}/gm,"
$1
"),t=t.replace(/[`]{3}([^`]+)[`]{3}/g,"
$1
"),t=t.replace(/[`]{1}([^`\n]+)[`]{1}/g,"$1"),t=t.replace(/[*]{2}([^*\n]+)[*]{2}/g,"$1"),t=t.replace(/[_]{2}([^*\n]+)[_]{2}/g,"$1"),t=t.replace(/[~]{2}([^~\n]+)[~]{2}/g,"$1"),t}(e);const n=t.innerText.trim().replace(/\u200b+/g,"");let o=0,i=0;const c=[];function l(e){const{index:t,entity:a}=function(e,t,n){const a=function(e){if(s[e.nodeName])return s[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===r.Vv.MentionName?r.Vv.MentionName:t.dataset.entityType===r.Vv.Url?r.Vv.Url:t.href.startsWith("mailto:")?r.Vv.Email:t.href.startsWith("tel:")?r.Vv.Phone:t.href!==t.textContent?r.Vv.TextUrl:r.Vv.Url}return"SPAN"===e.nodeName?e.dataset.entityType:void 0}(e);if(!a||!e.textContent)return{index:n,entity:void 0};const o=t.indexOf(e.textContent,n),i=o>=0?o:n,c=t.substring(0,i).length,{length:l}=t.substring(i,i+e.textContent.length);let d,u;return a===r.Vv.TextUrl&&(d=e.href),a===r.Vv.MentionName&&(u=Number(e.dataset.userId)),{index:i,entity:{type:a,offset:c,length:l,...d&&{url:d},...u&&{userId:u}}}}(e,n,o);a?(o=t,c.push(a)):e.textContent&&(o+=e.textContent.length),e.hasChildNodes()&&i<=3&&(i+=1,Array.from(e.childNodes).forEach(l))}return Array.from(t.childNodes).forEach((e=>{i=1,l(e)})),{text:n,entities:c.length?c:void 0}}},6391:(e,t,n)=>{function r(e,t){const{commonAncestorContainer:n}=e;let r=n,a=1;for(;r&&r.id!==t&&a<5;)r=r.parentElement,a++;return Boolean(r&&r.id===t)}n.d(t,{R:()=>r})},8353:(e,t,n)=>{n.d(t,{Z:()=>Z});var r=n(4050),a=n(3716),s=n(735),o=n(4284),i=n(5723),c=n(782),l=n(706);let d,u,m,h;const f=/(
|)/g,v=/ /g,p=/(
|<\/div>)/gi;try{h=new RegExp("(^|\\s):[-+_:\\p{L}\\p{N}]*$","gui")}catch(e){h=new RegExp("(^|\\s):[-+_:\\d\\wа-яё]*$","gi")}function Z(e,t,Z,g=a.R2,E,P,y,C=!1){const[b,N,w]=(0,l.Z)(),[k,I]=(0,r.eJ)(),[T,S]=(0,r.eJ)(),[M,L]=(0,r.eJ)({}),[x,$]=(0,r.eJ)(),[A,F]=(0,r.eJ)({}),[O,D]=(0,r.eJ)(!1),[U,R]=(0,r.eJ)(s.D),B=(0,r.Ye)((()=>k&&Z.length?Object.values((0,c.q0)(k,Z)):[]),[k,Z]);(0,r.d4)((()=>{if(C)return;const e=()=>{I(m.emojis)};m?e():async function(){return d||(d=n.e(501).then(n.t.bind(n,7501,19)),u=(await d).default,m=(0,o.NM)(u)),d}().then(e)}),[C]),(0,r.d4)((()=>{if(!k||C)return;const e=Object.values(k),t=(0,c.ee)(e,"native"),n=P?(0,c.Q8)(P,(e=>Object.values((0,c.q0)(t,e)))):{},r=y?(0,c.Q8)(y,(e=>Object.values((0,c.q0)(t,e)))):{};L({...n,...r}),S([...Object.keys(n),...Object.keys(r)]);const a=e.reduce(((e,t)=>(t.names.forEach((n=>{e[n]||(e[n]=[]),e[n].push(t)})),e)),{});F(a),$(Object.keys(a))}),[C,P,k,y]),(0,r.d4)((()=>{if(!(e&&t&&k&&T&&T.length))return void w();const n=t.includes(":")&&function(e){const t=e.replace(v," ").replace(f,"\n").replace(/\n$/i,"").replace(p,"").match(h);return t?t[0].trim():void 0}(t);if(!n)return R(s.D),void w();const r=n.length>2&&n.endsWith(":"),a=n.substr(1,r?n.length-2:void 0);let o=[];if(D(r),a){if(a.length>=2){const e=T.filter((e=>e.startsWith(a))).sort();o=o.concat((0,c.xH)(Object.values((0,c.q0)(M,e))));const t=x.filter((e=>e.startsWith(a)));o=o.concat((0,c.xH)(Object.values((0,c.q0)(A,t)))),o=(0,c.Tw)(o)}}else o=B;o.length?(r||N(),R(o.slice(0,36))):w()}),[k,M,T,A,x,t,e,N,B,w,D]);const V=(0,r.I4)(((e,n)=>{const r=t.lastIndexOf(":",n?t.lastIndexOf(":")-1:void 0);if(-1!==r){E(`${t.substr(0,r)}${e}`);const n=document.getElementById(g);requestAnimationFrame((()=>{(0,i.Z)(n,!0)}))}w()}),[t,g,E,w]);return(0,r.d4)((()=>{b&&O&&U.length&&V(U[0].native,!0)}),[U,V,b,O]),{isEmojiTooltipOpen:b,closeEmojiTooltip:w,filteredEmojis:U,insertEmoji:V}}},2365:(e,t,n)=>{n.d(t,{Z:()=>Z});var r=n(4050),a=n(6137),s=n(3716),o=n(2858),i=n(5765);function c(e,t){const n=t.username.toLowerCase(),r=(0,o.Js)(t),a=r&&r.toLowerCase(),s=e.toLowerCase();return n.startsWith(s)||a&&(0,i.Z)(a,s)}var l=n(5723),d=n(706),u=n(782);const m=(0,n(9118).P2)((e=>e()),500,!0),h=/(
|)/g,f=/ /g,v=/(
|<\/div>)/gi;let p;try{p=new RegExp("(^|\\s)@[-_\\p{L}\\p{M}\\p{N}]*$","gui")}catch(e){p=new RegExp("(^|\\s)@[-_\\d\\wа-яё]*$","gi")}function Z(e,t,n,i=s.R2,Z,g,E,P){const[y,C,b]=(0,d.Z)(),[N,w]=(0,r.eJ)(),k=(0,r.Ye)((()=>(g||[]).map((e=>null==P?void 0:P[e])).filter(Boolean)),[g,P]),I=(0,r.I4)(((e,t)=>{(Z||g)&&P?m((()=>{const n=(t?k:[]).filter((t=>!e||c(e,t))),r=(Z||[]).map((({userId:e})=>P[e])).filter((t=>!(!t||t.id===E)&&(!e||c(e,t))));w((0,u.Tw)(n.concat(r)))})):w(void 0)}),[E,Z,g,k,P]);(0,r.d4)((()=>{if(!e||!t.length)return void b();const n=t.includes("@")&&function(e){const t=e.replace(f," ").replace(h,"\n").replace(v,"").replace(/\n$/i,"").match(p);return t?t[0].trim():void 0}(t);if(n){const e=n?n.substr(1):"";I(e,function(e){return e.startsWith("@")}(t))}else b()}),[e,t,I,C,b]),(0,r.d4)((()=>{null!=N&&N.length?C():b()}),[C,b,N]);const T=(0,r.I4)(((e,r=!1)=>{if(!e.username&&!(0,o.Vl)(e))return;const s=e.username?`@${e.username}`:`${(0,o.Vl)(e)}`,c=t.lastIndexOf("@");if(-1!==c){n(`${t.substr(0,c)}${s} `);const e=document.getElementById(i);requestAnimationFrame((()=>{(0,l.Z)(e,r)}))}b()}),[t,i,n,b]);return{isMentionTooltipOpen:y,closeMentionTooltip:b,insertMention:T,mentionFilteredUsers:N}}},7891:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(9290),s=n(5326);function o(e,t){const n=void 0===t,o=(0,r.sO)(n),i=(0,r.sO)(),c=(0,s.Z)();return(0,a.Z)((()=>{n||(o.current=!1,i.current&&(clearTimeout(i.current),i.current=void 0))}),e),(0,r.d4)((()=>{if(n||o.current)return;const e=()=>{o.current=!0,c()};t>0?i.current=window.setTimeout(e,t):e()}),e),o.current}},7551:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(9107),s=n(3103),o=n(231);const i=(0,r.X$)((({isOpen:e,onClose:t,onCloseAnimationEnd:n,title:i,header:c,text:l,textParts:d,confirmLabel:u="Confirm",confirmHandler:m,confirmIsDestructive:h,isButtonsInOneRow:f})=>{const v=(0,a.Z)();return r.ZP.createElement(s.Z,{className:"confirm",title:i,header:c,isOpen:e,onClose:t,onCloseAnimationEnd:n,onEnter:m},l&&l.split("\\n").map((e=>r.ZP.createElement("p",null,e))),d,r.ZP.createElement("div",{className:f?"dialog-buttons mt-2":""},r.ZP.createElement(o.Z,{className:"confirm-dialog-button",isText:!0,onClick:m,color:h?"danger":"primary"},u),r.ZP.createElement(o.Z,{className:"confirm-dialog-button",isText:!0,onClick:t},v("Cancel"))))}))},1151:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(6752),s=n(231);const o=({isShown:e,className:t,color:n="primary",ariaLabel:o,disabled:i,onClick:c,children:l})=>{const d=(0,a.Z)("FloatingActionButton",e&&"revealed",t);return r.ZP.createElement(s.Z,{className:d,color:n,round:!0,disabled:i,onClick:e&&!i?c:void 0,ariaLabel:o,tabIndex:-1},l)}},1273:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(1713),a=n(4050),s=n(9118),o=n(7675);const i=({ref:e,className:t,onLoadMore:n,onScroll:i,onKeyDown:c,items:l,itemSelector:d=".ListItem",preloadBackwards:u=20,sensitiveArea:m=800,noScrollRestore:h=!1,noScrollRestoreOnTop:f=!1,noFastList:v,cacheBuster:p,children:Z})=>{let g=(0,a.sO)(null);e&&(g=e);const E=(0,a.sO)({}),[P,y]=(0,a.Ye)((()=>n?[(0,s.Ds)(((e=!1)=>{n({direction:r.Uq.Backwards,noScroll:e})}),1e3,!0,!1),(0,s.Ds)((()=>{n({direction:r.Uq.Forwards})}),1e3,!0,!1)]:[]),[n,l]);(0,a.d4)((()=>{if(!P)return;if(u>0&&(!l||l.length{const e=g.current,t=E.current;let n;if(t.listItemElements=e.querySelectorAll(d),t.currentAnchor&&Array.from(t.listItemElements).includes(t.currentAnchor)){const{scrollTop:r}=e;n=r+(t.currentAnchor.getBoundingClientRect().top-t.currentAnchorTop)}else{const e=t.listItemElements[0];e&&(t.currentAnchor=e,t.currentAnchorTop=e.getBoundingClientRect().top)}h||f&&0===e.scrollTop||((0,o.Z)(e,n),t.isScrollTopJustUpdated=!0)}),[l,d,h,f,p]);const C=(0,a.I4)((e=>{if(y&&P){const{isScrollTopJustUpdated:e,currentAnchor:t,currentAnchorTop:n}=E.current,r=E.current.listItemElements;if(e)return void(E.current.isScrollTopJustUpdated=!1);const a=r.length,s=g.current,{scrollTop:i,scrollHeight:c,offsetHeight:l}=s,d=i<=(a?r[0].offsetTop:0)+m,u=(a?r[a-1].offsetTop+r[a-1].offsetHeight:c)-(i+l)<=m;let h=!1;if(d){const e=r[0];if(e){const r=e.getBoundingClientRect().top,a=null!=t&&t.offsetParent&&t!==e?t.getBoundingClientRect().top:r;t&&void 0!==n&&a>n&&(E.current.currentAnchor=e,E.current.currentAnchorTop=r,h=!0,(0,o.Z)(s),y())}}if(u){const e=r[a-1];if(e){const r=e.getBoundingClientRect().top,a=null!=t&&t.offsetParent&&t!==e?t.getBoundingClientRect().top:r;t&&void 0!==n&&a{n.d(t,{Z:()=>f});var r=n(4050),a=n(7361),s=n(9118),o=n(6752),i=n(7240),c=n(3394),l=n(706),d=n(9107),u=n(8512),m=n(2328),h=n(8964);const f=e=>{const{ref:t,buttonRef:n,icon:f,className:v,style:p,children:Z,disabled:g,ripple:E,narrow:P,inactive:y,focus:C,destructive:b,multiline:N,isStatic:w,contextActions:k,onMouseDown:I,onClick:T}=e;let S=(0,r.sO)(null);t&&(S=t);const[M,L,x]=(0,l.Z)(),{isContextMenuOpen:$,contextMenuPosition:A,handleBeforeContextMenu:F,handleContextMenu:O,handleContextMenuClose:D,handleContextMenuHide:U}=(0,i.Z)(S,!k),R=(0,r.I4)((()=>S.current),[]),B=(0,r.I4)((()=>S.current.closest(".custom-scroll")),[]),V=(0,r.I4)((()=>S.current.querySelector(".ListItem-context-menu .bubble")),[]),{positionX:X,positionY:j,style:H}=(0,c.Z)(A,R,B,V),K=(0,r.I4)((e=>{!g&&T&&(T(e),a.$b&&!E&&(L(),(0,s.T2)(x)))}),[g,L,T,E,x]),q=(0,r.I4)((e=>{y||a.$b||(!k||2!==e.button&&T||F(e),0===e.button&&(T?K(e):O(e)))}),[y,k,T,F,O,K]),z=(0,d.Z)(),J=(0,o.Z)("ListItem",v,!w&&"no-selection",E&&"has-ripple",P&&"narrow",g&&"disabled",y&&"inactive",A&&"has-menu-open",C&&"focus",b&&"destructive",N&&"multiline",w&&"is-static");return r.ZP.createElement("div",{ref:S,className:J,dir:z.isRtl?"rtl":void 0,style:p,onMouseDown:I},r.ZP.createElement("div",{className:(0,o.Z)("ListItem-button",M&&"active"),role:"button",ref:n,tabIndex:0,onClick:!y&&a.$b?K:void 0,onMouseDown:q,onContextMenu:!y&&k?O:void 0},f&&r.ZP.createElement("i",{className:`icon-${f}`}),N&&r.ZP.createElement("div",{className:"multiline-item"},Z),!N&&Z,!g&&!y&&E&&r.ZP.createElement(u.Z,null)),k&&void 0!==A&&r.ZP.createElement(m.Z,{isOpen:$,positionX:X,positionY:j,style:H,className:"ListItem-context-menu",autoClose:!0,onClose:D,onCloseAnimationEnd:U},k.map((e=>r.ZP.createElement(h.Z,{key:e.title,icon:e.icon,destructive:e.destructive,disabled:!e.handler,onClick:e.handler},e.title)))))}},3103:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),a=n(517),s=n(6752),o=n(8674),i=n(1212),c=n(274),l=n(9107),d=n(6590),u=n(231),m=n(2898);const h=({title:e,className:t,isOpen:n,header:h,hasCloseButton:f,noBackdrop:v,children:p,onClose:Z,onCloseAnimationEnd:g,onEnter:E,shouldSkipHistoryAnimations:P})=>{const{shouldRender:y,transitionClassNames:C}=(0,i.Z)(n,g,P,void 0,P),b=(0,r.sO)(null);(0,r.d4)((()=>n?(0,a.Z)({onEsc:Z,onEnter:E}):void 0),[n,Z,E]),(0,r.d4)((()=>n&&b.current?function(e){function t(t){if("Tab"!==t.key)return;t.preventDefault(),t.stopPropagation();const n=Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(!n.length)return;const r=n.findIndex((e=>e.isSameNode(document.activeElement)));let a=0;r>=0&&(a=t.shiftKey?r>0?r-1:n.length-1:r{document.removeEventListener("keydown",t,!1)}}(b.current):void 0),[n]);const{forceClose:N}=(0,d.ZP)(n,Z);(0,r.d4)((()=>()=>{n&&N()}),[]),(0,c.Z)((([e])=>(document.body.classList.toggle("has-open-dialog",n),(n||!n&&void 0!==e)&&(0,o.YW)(200),()=>{document.body.classList.remove("has-open-dialog")})),[n]);const w=(0,l.Z)();if(!y)return;const k=(0,s.Z)("Modal",t,C,v&&"transparent-backdrop");return r.ZP.createElement(m.Z,null,r.ZP.createElement("div",{ref:b,className:k,tabIndex:-1,role:"dialog"},r.ZP.createElement("div",{className:"modal-container"},r.ZP.createElement("div",{className:"modal-backdrop",onClick:Z}),r.ZP.createElement("div",{className:"modal-dialog"},h||(e?r.ZP.createElement("div",{className:"modal-header"},f&&r.ZP.createElement(u.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:w("Close"),onClick:Z},r.ZP.createElement("i",{className:"icon-close"})),r.ZP.createElement("div",{className:"modal-title"},e)):void 0),r.ZP.createElement("div",{className:"modal-content custom-scroll"},p)))))}},6937:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(4050),a=n(3716),s=n(1212),o=n(6752),i=n(3989),c=n(2898);const l=({message:e,duration:t=3e3,containerId:n,onDismiss:l})=>{const[d,u]=(0,r.eJ)(!0),m=(0,r.sO)(null),{transitionClassNames:h}=(0,s.Z)(d),f=(0,r.I4)((()=>{u(!1),setTimeout(l,150+a.fK)}),[l]);(0,r.d4)((()=>d?(0,i.Z)(f):void 0),[d,f]),(0,r.d4)((()=>(m.current=window.setTimeout(f,t),()=>{m.current&&(clearTimeout(m.current),m.current=void 0)})),[t,f]);const v=(0,r.I4)((()=>{m.current&&(clearTimeout(m.current),m.current=void 0)}),[]),p=(0,r.I4)((()=>{m.current=window.setTimeout(f,t)}),[t,f]);return r.ZP.createElement(c.Z,{className:"Notification-container",containerId:n},r.ZP.createElement("div",{className:(0,o.Z)("Notification",h),onClick:f,onMouseEnter:v,onMouseLeave:p},r.ZP.createElement("div",{className:"content"},e)))}},2898:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(4050),a=n(2916);const s=({containerId:e,className:t,children:n})=>{const s=(0,r.sO)();return s.current||(s.current=document.createElement("div")),(0,r.bt)((()=>{const n=document.querySelector(e||"#portals");if(!n)return;const r=s.current;return t&&r.classList.add(t),n.appendChild(r),()=>{a.Z.render(void 0,r),n.removeChild(r)}}),[t,e]),a.Z.render(n,s.current)}},9196:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(6752);const s={s:22,m:25,l:28,xl:20},o=(0,r.X$)((({progress:e=0,size:t="l",square:n,transparent:o,noCross:i,onClick:c})=>{const l=s[t],d=l-4,u=l-1,m=2*d*Math.PI,h=(0,r.sO)(null);(0,r.d4)((()=>{if(!h.current)return;const t=h.current.firstElementChild,n=m-Math.min(Math.max(.05,e),1)*m;t?t.firstElementChild.setAttribute("stroke-dashoffset",n.toString()):h.current.innerHTML=`\n \n `}),[h,m,u,d,e]);const f=(0,a.Z)(`ProgressSpinner size-${t}`,o&&"transparent",n&&"square",i&&"no-cross");return r.ZP.createElement("div",{ref:h,className:f,onClick:c})}))},4434:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(4050),a=n(6752),s=n(9107),o=n(9204);const i=(0,r.X$)((({id:e,label:t,subLabel:n,value:i,name:c,checked:l,disabled:d,hidden:u,isLoading:m,onChange:h})=>{const f=(0,s.Z)(),v=(0,a.Z)("Radio",d&&"disabled",u&&"hidden-widget",m&&"loading");return r.ZP.createElement("label",{className:v,dir:f.isRtl?"rtl":void 0},r.ZP.createElement("input",{type:"radio",name:c,value:i,id:e,checked:l,onChange:h,disabled:d||u}),r.ZP.createElement("div",{className:"Radio-main"},r.ZP.createElement("span",{className:"label",dir:f.isRtl?"auto":void 0},t),n&&r.ZP.createElement("span",{className:"subLabel",dir:f.isRtl?"auto":void 0},n)),m&&r.ZP.createElement(o.Z,null))})),c=(0,r.X$)((({id:e,name:t,options:n,selected:a,disabled:s,loadingOption:o,onChange:c})=>{const l=(0,r.I4)((e=>{const{value:t}=e.currentTarget;c(t)}),[c]);return r.ZP.createElement("div",{id:e,className:"radio-group"},n.map((e=>r.ZP.createElement(i,{name:t,label:e.label,subLabel:e.subLabel,value:e.value,checked:e.value===a,hidden:e.hidden,disabled:s,isLoading:o?o===e.value:void 0,onChange:l}))))}))},9589:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(4050),a=n(6752),s=n(706),o=n(9107),i=n(4288),c=n(231);const l=(0,r.X$)((({ref:e,children:t,parentContainerClassName:n,value:l,inputId:d,className:u,focused:m,isLoading:h,placeholder:f,disabled:v,autoComplete:p,canClose:Z,onChange:g,onReset:E,onFocus:P,onBlur:y})=>{let C=(0,r.sO)(null);e&&(C=e);const[b,N,w]=(0,s.Z)(m);(0,r.d4)((()=>{C.current&&(m?C.current.focus():C.current.blur())}),[m,f]);const k=(0,o.Z)(),I=(0,r.I4)((e=>{if("ArrowDown"===e.key||"Enter"===e.key){const e=document.querySelector(`.${n} .ListItem-button`);e&&e.focus()}}),[n]);return r.ZP.createElement("div",{className:(0,a.Z)("SearchInput",u,b&&"has-focus"),dir:k.isRtl?"rtl":void 0},t,r.ZP.createElement("input",{ref:C,id:d,type:"text",dir:"auto",placeholder:f||k("Search"),className:"form-control",value:l,disabled:v,autoComplete:p,onChange:function(e){const{currentTarget:t}=e;g(t.value)},onFocus:function(){N(),P&&P()},onBlur:function(){w(),y&&y()},onKeyDown:I}),r.ZP.createElement("i",{className:"icon-search"}),h&&r.ZP.createElement(i.Z,null),!h&&(l||Z)&&E&&r.ZP.createElement(c.Z,{round:!0,size:"tiny",color:"translucent",onClick:E},r.ZP.createElement("span",{className:"icon-close"})))}))},126:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(1212),s=n(7204),o=n(6752);const i=({isOpen:e,isCustom:t,id:n,className:i,onClick:c,children:l})=>{const{shouldRender:d,transitionClassNames:u}=(0,a.Z)(e,void 0,void 0,!t&&void 0),m=(0,s.Z)(e),h=(0,s.Z)(l),f=(0,r.sO)();return m&&!e&&(f.current=h),d&&r.ZP.createElement("div",{id:n,className:(0,o.Z)(i,u),onClick:c},e?l():f.current())}},3321:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(4050),a=n(6752);const s=(0,r.X$)((({id:e,name:t,value:n,label:s,checked:o=!1,disabled:i,inactive:c,noAnimation:l,onChange:d,onCheck:u})=>{const m=(0,r.I4)((e=>{d&&d(e),u&&u(e.currentTarget.checked)}),[d,u]),h=(0,a.Z)("Switcher",i&&"disabled",c&&"inactive",l&&"no-animation");return r.ZP.createElement("label",{className:h,title:s},r.ZP.createElement("input",{type:"checkbox",id:e,name:t,value:n,checked:o,disabled:i,onChange:m}),r.ZP.createElement("span",{className:"widget"}))}))},3133:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),a=n(1367),s=n(7204),o=n(8781),i=n(9107),c=n(6752),l=n(2340);const d=(0,r.X$)((({className:e,title:t,active:n,badgeCount:a,isBadgeActive:s,previousActiveTab:o,onClick:i,clickArg:d})=>{const u=(0,r.sO)(null);return(0,r.bt)((()=>{if(!n||void 0===o)return;const e=u.current,t=e.querySelector("i"),r=e.parentElement.children[o];if(!r)return;const a=r.querySelector("i");a.classList.remove("animate"),t.classList.remove("animate");const s=a.parentElement.offsetLeft-t.parentElement.offsetLeft,i=a.clientWidth/t.clientWidth;t.style.transform=`translate3d(${s}px, 0, 0) scale3d(${i}, 1, 1)`,requestAnimationFrame((()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t.classList.add("animate"),t.style.transform="none"}))}))}))}),[n,o]),r.ZP.createElement("button",{type:"button",className:(0,c.Z)("Tab",e,n&&"active"),onClick:()=>i(d),ref:u},r.ZP.createElement("span",null,(0,l.Z)(t),!!a&&r.ZP.createElement("span",{className:(0,c.Z)("badge",s&&"active")},a),r.ZP.createElement("i",null)))})),u=(0,r.X$)((({tabs:e,activeTab:t,big:n,onSwitchTab:c})=>{const l=(0,r.sO)(null),u=(0,s.Z)(t);(0,o.Z)(l.current),(0,r.d4)((()=>{const e=l.current;if(e.scrollWidth<=e.offsetWidth)return;const t=e.querySelector(".Tab.active");if(t){const n=t.offsetLeft-e.offsetWidth/2+t.offsetWidth/2;if(Math.abs(n-e.scrollLeft)<16)return;(0,a.Z)(e,n)}}),[t]);const m=(0,i.Z)();return r.ZP.createElement("div",{className:"TabList no-selection no-scrollbar "+(n?"big":""),ref:l,dir:m.isRtl?"rtl":void 0},e.map(((e,n)=>r.ZP.createElement(d,{key:e.title,title:m(e.title),active:n===t,badgeCount:e.badgeCount,isBadgeActive:e.isBadgeActive,previousActiveTab:u,onClick:c,clickArg:n}))))}))},2255:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),a=n(5116),s=n(5326),o=n(7204),i=n(6752),c=n(8674),l=n(1279);const d=Symbol("CLEANED_UP"),u=({ref:e,activeKey:t,name:n,direction:u="auto",renderCount:m,shouldRestoreHeight:h,shouldCleanup:f,cleanupExceptionKey:v,id:p,className:Z,onStart:g,onStop:E,children:P})=>{const{animationLevel:y}=(0,a.Rd)().settings.byKey,C=(0,r.sO)();let b=(0,r.sO)(null);e&&(b=e);const N=(0,r.sO)({}),w=(0,o.Z)(t),k=(0,s.Z)(),I=void 0!==w&&t!==w;!m&&I&&(N.current={[w]:N.current[w]}),N.current[t]=P,(0,r.bt)((()=>{function e(){!f||void 0!==v&&v===w||(N.current={[w]:d},k())}const r=b.current,a=r.children;if(1===a.length&&!I)return void a[0].classList.add("active");const s=Array.from(r.childNodes);if(!I||!s.length)return;const o=-1===u||"auto"===u&&w>t||"inverse"===u&&w{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle("active",t===Z))})),void e();let P;s.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("active"),e.classList.toggle("from",t===p),e.classList.toggle("through",t>p&&tZ),e.classList.toggle("to",t===Z))})),y>0&&(P=(0,c.YW)()),requestAnimationFrame((()=>{var a;function i(){requestAnimationFrame((()=>{if(t===C.current){if(r.classList.remove("animating","backwards"),s.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle("active",t===Z))})),h){const e=r.querySelector(".active");e&&(e.style.height="auto",r.style.height=`${e.clientHeight}px`)}P&&P(),e(),E&&E()}}))}r.classList.add("animating"),g&&g();const c="mv-slide"===n?null===(a=s[Z])||void 0===a?void 0:a.firstChild:"reveal"===n&&o?s[p]:s[Z];C.current=t,y>0&&c?(0,l.f)(c,i):i()}))}),[t,w,I,u,n,g,E,m,h,f,v,y,k]),(0,r.bt)((()=>{if(h){const e=b.current,t=e.querySelector(".active")||e.querySelector(".from");t&&(t.style.height="auto",e.style.height=`${t.clientHeight}px`,e.style.flexBasis=`${t.clientHeight}px`)}}),[h,P]);const T=N.current,S=Object.keys(m?new Array(m).fill(void 0):T).map(Number).map((e=>{const n=T[e];return"function"==typeof n?r.ZP.createElement("div",{key:e},n(e===t,e===w,t)):void 0})),M=(0,i.Z)("Transition",Z,n);return r.ZP.createElement("div",{ref:b,id:p,className:M},S)}},3455:(e,t,n)=>{n.d(t,{fi:()=>s,Yy:()=>o,vb:()=>l,ZP:()=>h});var r=n(1090),a=n(782);const s=[{icon:"user",title:"FilterContacts",key:"contacts"},{icon:"non-contacts",title:"FilterNonContacts",key:"nonContacts"},{icon:"group",title:"FilterGroups",key:"groups"},{icon:"channel",title:"FilterChannels",key:"channels"},{icon:"bots",title:"FilterBots",key:"bots"}],o=[{icon:"mute",title:"FilterMuted",key:"excludeMuted"},{icon:"archive",title:"FilterArchived",key:"excludeArchived"},{icon:"readchats",title:"FilterRead",key:"excludeRead"}],i=["includedChatIds","bots","channels","groups","contacts","nonContacts"],c=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function l(e,t,n){let r=[],s=[];if("included"===t){const{includedChatIds:t,...o}=n?e.includeFilters||{}:(0,a.ei)(e.folder,i);r=t||[],s=Object.keys(o).filter((e=>Boolean(o[e])))}else{const{excludedChatIds:t,...o}=n?e.excludeFilters||{}:(0,a.ei)(e.folder,c);r=t||[],s=Object.keys(o).filter((e=>Boolean(o[e])))}return{selectedChatIds:r,selectedChatTypes:s}}function d(e){if(e){const{includedChatIds:t,...n}=e;if(Object.values(n).filter(Boolean).length>1||null!=t&&t.length)return"";if(n.bots)return"Bots";if(n.groups)return"Groups";if(n.channels)return"Channels";if(n.contacts)return"Contacts";if(n.nonContacts)return"Non-Contacts"}return""}const u={mode:"create",chatFilter:"",folder:{title:"",includedChatIds:[],excludedChatIds:[]}},m=(e,t)=>{switch(t.type){case"setTitle":return{...e,folder:{...e.folder,title:t.payload},isTouched:!0};case"editIncludeFilters":return{...e,includeFilters:(0,a.ei)(e.folder,i)};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,i),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,...r}=t.payload;return{mode:"edit",folderId:e,folder:r,chatFilter:""}}case"setChatFilter":return{...e,chatFilter:t.payload};case"setIsLoading":return{...e,isLoading:t.payload};case"setError":return{...e,error:t.payload};case"reset":return u;default:return e}},h=()=>(0,r.Z)(m,u)},3186:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(4050),a=n(396),s=n(274),o=n(5266),i=n(9290);const c=(e,t,n,c,l,d=!1,u,m=!1)=>{const h=(0,r.sO)(null),[f,v]=(0,r.eJ)(!1);let p=f;const[Z,g]=(0,r.eJ)(0);(0,i.Z)((()=>{h.current=(0,a.z)(e,((e,n)=>{var r;switch(e){case"onPlay":v(!0);break;case"onPause":v(!1);break;case"onTimeUpdate":{const{proxy:e}=h.current,n=e.duration&&Number.isFinite(e.duration)?e.duration:t;g(e.currentTime/n);break}}null==c||null===(r=c[e])||void 0===r||r.call(c,n)}),u);const{proxy:n}=h.current;f||n.paused||(v(!0),p=!0),l&&l(n)}),[e]);const{play:E,pause:P,setCurrentTime:y,proxy:C,destroy:b}=h.current,N=C.duration&&Number.isFinite(C.duration)?C.duration:t;(0,r.d4)((()=>{N&&!(0,o.z)(C)&&g(C.currentTime/N)}),[N,Z,C]),(0,r.d4)((()=>()=>{b(m)}),[b,m]),(0,s.Z)((([e,t])=>{e===d&&n===t||C.src&&C.paused||d&&n&&!f&&E(n)}),[d,n,f,E,C.src,C.paused]);const w=(0,r.I4)((()=>{f?P():n&&E(n)}),[n,P,E,f]);return{isPlaying:p,playProgress:Z,playPause:w,setCurrentTime:y,audioProxy:C,duration:N}}},5332:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050);function a(e,t){(0,r.d4)((()=>(e&&!document.hasFocus()&&e(),e&&window.addEventListener("blur",e),t&&window.addEventListener("focus",t),()=>{t&&window.removeEventListener("focus",t),e&&window.removeEventListener("blur",e)})),[e,t])}},2937:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(4050),a=n(6264),s=n(9290),o=n(1394),i=n(5326);const c=new Map;function l(e){const t=(0,r.sO)();let n=!1;(0,s.Z)((()=>{if(n=!0,t.current=void 0,!e)return;const r=new Image;if(r.src=e,!r.width)return;const s=(0,o.ao)(r);(0,a.Z)(s.getContext("2d"),0,0,s.width,s.height,2,2),t.current=s.toDataURL()}),[e]);const l=function(e,t=!1,n){const s=(0,r.sO)(e?c.get(e):void 0),l=(0,r.sO)(),d=(0,i.Z)();return l.current&&t&&(clearTimeout(l.current),l.current=void 0),(0,r.d4)((()=>{if(!e||s.current||t)return;const r=new Image;r.onload=()=>{const t=(0,o.ao)(r);(0,a.Z)(t.getContext("2d"),0,0,t.width,t.height,2,2);const n=t.toDataURL();s.current=n,d(),c.size>=1e3&&c.clear(),c.set(e,n)},n?l.current=window.setTimeout((()=>{r.src=e}),n):r.src=e}),[e,n,d,t]),s.current}(e||void 0,Boolean(t.current));return t.current||!n&&l||e||void 0}},2019:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(9118),s=n(5266);const o=(e=!1)=>{const[t,n]=(0,r.eJ)(!e),[o,i]=(0,r.eJ)(0),c=(0,r.Ye)((()=>(0,a.Ds)(n,200,!1,!0)),[]),l=(0,r.I4)((e=>{const t=e.currentTarget;(0,s.z)(t)||(t.buffered.length&&i(t.buffered.end(0)/t.duration),c(t.readyState>=3||t.currentTime>0))}),[c]);return{isBuffered:t,bufferedProgress:o,bufferingHandlers:{onLoadedData:l,onPlaying:l,onLoadStart:l,onPause:l,onTimeUpdate:l,onProgress:l},checkBuffering(e){c(e.readyState>=3)}}}},5866:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(6264),s=n(5326),o=n(7361);function i(e,t=!1,n){const i=(0,r.sO)(null),c=(0,s.Z)();return(0,r.d4)((()=>{const r=i.current;if(!e||!r||t)return;const s=new Image,c=()=>{r.width=s.width,r.height=s.height;const e=r.getContext("2d",{alpha:!1});o.vX&&(e.filter="blur(2px)"),e.drawImage(s,-4,-4,r.width+8,r.height+8),o.vX||(0,a.Z)(e,0,0,r.width,r.height,2,2)};s.onload=()=>{n?requestAnimationFrame(c):c()},s.src=e}),[i,e,c,t,n]),i}},1470:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(5116),s=n(2858),o=n(9107);const i=({chat:e,privateChatUser:t,handleDelete:n,folderId:i,isPinned:c,isMuted:l},d=!1)=>{const u=(0,o.Z)();return(0,r.Ye)((()=>{if(!e)return;const{toggleChatPinned:r,updateChatMutedState:o,toggleChatArchived:m,toggleChatUnread:h}=(0,a.uC)(),f=c?{title:u("UnpinFromTop"),icon:"unpin",handler:()=>r({id:e.id,folderId:i})}:{title:u("PinToTop"),icon:"pin",handler:()=>r({id:e.id,folderId:i})};if(d)return[f];const v=e.unreadCount||e.hasUnreadMark?{title:u("MarkAsRead"),icon:"readchats",handler:()=>h({id:e.id})}:{title:u("MarkAsUnread"),icon:"unread",handler:()=>h({id:e.id})},p=l?{title:u("ChatList.Unmute"),icon:"unmute",handler:()=>o({chatId:e.id,isMuted:!1})}:{title:u("ChatList.Mute"),icon:"mute",handler:()=>o({chatId:e.id,isMuted:!0})},Z=(0,s.pE)(e)?{title:u("Unarchive"),icon:"unarchive",handler:()=>m({id:e.id})}:{title:u("Archive"),icon:"archive",handler:()=>m({id:e.id})},g={title:(0,s.YA)(e.id)?u("Delete"):u((0,s.cc)(e)?"DeleteChat":(0,s.eA)(e)?"LeaveChannel":"Group.LeaveGroup"),icon:"delete",destructive:!0,handler:n};return[v,f,...null!=t&&t.isSelf?[]:[p,Z],g]}),[e,c,u,d,l,n,null==t?void 0:t.isSelf,i])}},7240:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(4050),a=n(7361);const s=(e,t,n,s)=>{const[o,i]=(0,r.eJ)(!1),[c,l]=(0,r.eJ)(void 0),d=(0,r.I4)((e=>{t||2!==e.button||document.body.classList.add("no-selection")}),[t]),u=(0,r.I4)((e=>{document.body.classList.remove("no-selection"),t||n&&e.target.matches("a[href]")||(e.preventDefault(),c||(i(!0),l({x:e.clientX,y:e.clientY})))}),[t,n,c]),m=(0,r.I4)((()=>{i(!1)}),[]),h=(0,r.I4)((()=>{l(void 0),document.body.classList.remove("no-selection")}),[]);return(0,r.d4)((()=>{if(t||!a.$b||s)return;const r=e.current;if(!r)return;let o;const d=()=>{o&&(clearTimeout(o),o=void 0)},u=e=>{t||a.wB&&window.document.body.classList.contains("enable-symbol-menu-transforms")||(d(),o=window.setTimeout((()=>(e=>{d();const{clientX:t,clientY:a,target:s}=e.touches[0];c||n&&s.matches("a[href]")||(r.addEventListener("touchend",(function e(t){r.removeEventListener("touchend",e,!0),t.stopImmediatePropagation(),t.preventDefault(),t.stopPropagation()}),!0),document.body.classList.add("no-selection"),i(!0),l({x:t,y:a}))})(e)),200))};return r.addEventListener("touchstart",u,{passive:!0}),r.addEventListener("touchcancel",d,!0),r.addEventListener("touchend",d,!0),r.addEventListener("touchmove",d,{passive:!0}),()=>{d(),r.removeEventListener("touchstart",u),r.removeEventListener("touchcancel",d,!0),r.removeEventListener("touchend",d,!0),r.removeEventListener("touchmove",d)}}),[c,t,s,e,n]),{isContextMenuOpen:o,contextMenuPosition:c,handleBeforeContextMenu:d,handleContextMenu:u,handleContextMenuClose:m,handleContextMenuHide:h}}},3394:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050);const a=(e,t,n,a,s=0,o=0)=>{const[i,c]=(0,r.eJ)("right"),[l,d]=(0,r.eJ)("bottom"),[u,m]=(0,r.eJ)("");return(0,r.d4)((()=>{const r=t();if(!e||!r)return;let{x:i,y:l}=e;const u={width:0,left:0,height:0,top:0},h=a(),f=n(),v=r.getBoundingClientRect(),p=h?{width:h.offsetWidth,height:h.offsetHeight}:u,Z=f?f.getBoundingClientRect():u;let g;i+p.width+s0?(g="right",i-=3):(g="left",i=16),c(g),l+p.height{n.d(t,{Z:()=>a});var r=n(7204);function a(e,t=!1,n=!1){const a=(0,r.Z)(e,t);return n||null!=e?e:a}},5790:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(5116),s=n(9118);const o=(e,t,n,o)=>{const{loadMessage:i}=(0,a.uC)(),c=(0,r.Ye)((()=>{const n=(0,s.P2)(i,500,!0);return()=>{n({chatId:e,messageId:t,replyOriginForId:o})}}),[i,e,t,o]);(0,r.d4)((()=>{t&&!n&&c()}))}},8781:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050);const a=(e,t)=>{(0,r.d4)((()=>{if(e)return e.addEventListener("wheel",t,{passive:!0}),()=>{e.removeEventListener("wheel",t)};function t(t){t.deltaX||(e.scrollLeft+=t.deltaY/4)}}),[e,t])}},7407:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(4050),a=n(1713),s=n(782),o=n(5326),i=n(7204);const c=(e,t,n=!1,c=30,d=!1)=>{const u=(0,r.sO)(),m=(0,r.sO)((()=>{if(!t||u.current)return;const{newViewportIds:e}=l(t,t[0],a.Uq.Forwards,c);return e})()),h=(0,o.Z)(),f=(0,i.Z)(t),v=(0,i.Z)(n);if(t&&!n&&(t!==f||n!==v)){const{offsetId:e=t[0],direction:n=a.Uq.Forwards}=u.current||{},{newViewportIds:r}=l(t,e,n,c);m.current&&(0,s.et)(m.current,r)||(m.current=r)}(0,r.d4)((()=>{if(t&&!n&&e&&d){const t=m.current;e({offsetId:t[t.length-1]})}}),[t,n,e,d]);const p=(0,r.I4)((({direction:n,noScroll:r})=>{const o=m.current,i=o?n===a.Uq.Backwards?o[o.length-1]:o[0]:void 0;if(!t)return void(e&&e({offsetId:i}));r||(u.current={...u.current,direction:n,offsetId:i});const{newViewportIds:d,areSomeLocal:f,areAllLocal:v}=l(t,i,n,c);!f||o&&(0,s.et)(o,d)||(m.current=d,h()),!v&&e&&e({offsetId:i})}),[t,c,e,h]);return n?[t]:[m.current,p]};function l(e,t=0,n,r){const{length:s}=e,o=e.indexOf(t),i=n===a.Uq.Forwards?o:o+1||s,c=Math.max(0,i-r),l=i+r-1,d=e.slice(Math.max(0,c),l+1);let u,m;switch(n){case a.Uq.Forwards:u=i>0,m=c>=0;break;case a.Uq.Backwards:u=i{n.d(t,{S1:()=>o,_N:()=>i,Op:()=>c});var r=n(4050),a=n(9118),s=n(8674);function o({rootRef:e,throttleMs:t,debounceMs:n,shouldSkipFirst:o,margin:i,threshold:c,isDisabled:l},d){const u=(0,r.sO)(),m=(0,r.sO)(),h=(0,r.sO)(0),f=(0,r.sO)(),v=(0,r.sO)();m.current=d;const p=(0,r.I4)((()=>{h.current&&(h.current--,!h.current&&v.current&&(v.current(),v.current=void 0))}),[]),Z=(0,r.I4)((()=>{h.current++,f.current&&(clearTimeout(f.current),f.current=void 0),f.current=window.setTimeout((()=>{f.current=void 0,h.current&&(h.current=1,p())}),2e3)}),[p]);return(0,s.ZP)(Z,p),(0,r.d4)((()=>{if(!l)return()=>{u.current&&(u.current.observer.disconnect(),u.current.callbacks.clear(),u.current=void 0)}}),[l]),{observe:(0,r.I4)(((r,s)=>{u.current||function(){const r=new Map,s=new Map,l=()=>{const e=Array.from(s.values());e.forEach((t=>{const n=r.get(t.target);n&&n(t,e)})),m.current&&m.current(e),s.clear()},d=t?a.P2:n?a.Ds:void 0,f=d?d(l,t||n,!o):l,p=new IntersectionObserver((e=>{e.forEach((e=>{s.set(e.target,e)})),h.current?v.current=()=>{f()}:f()}),{root:e.current,rootMargin:i?`${i}px`:void 0,threshold:c});u.current={observer:p,callbacks:r}}();const l=u.current;return l.observer.observe(r),s&&l.callbacks.set(r,s),()=>{s&&l.callbacks.delete(r),l.observer.unobserve(r)}}),[l]),freeze:Z,unfreeze:p}}function i(e,t,n){(0,r.d4)((()=>t?t(e.current,n):void 0),[])}function c(e,t,n){const[a,s]=(0,r.eJ)(!t);return i(e,t,(e=>{s(e.isIntersecting),n&&n(e)})),a}},2645:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(4050),a=n(7204);const s=(e,t,n)=>{const s=(0,a.Z)(t);return(0,r.bt)((()=>e(s||[])),t,n)}},6202:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(6137),s=n(647),o=n(5326);const i=(e,t=!1,n=a.IU.BlobUrl,i,c)=>{const l=e?s.UV(e):void 0,d=(0,o.Z)();return(0,r.d4)((()=>{if(!t&&e&&!l){const t=Date.now();s.he(e,n).then((()=>{const e=Date.now()-t;!c||e>=c?d():setTimeout(d,c-e)}))}}),[t,e,l,n,i,d,c]),l}},2619:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(2761),s=n(6562);function o(e,t){const[n,o]=(0,r.eJ)(!1),{mediaData:i,downloadProgress:c}=(0,a.Z)(e,!n);(0,r.d4)((()=>{n&&i&&((0,s.Z)(i,t),o(!1))}),[t,i,n]),(0,r.d4)((()=>{o(!1)}),[e]);const l=(0,r.I4)((e=>{e.stopPropagation(),o((e=>!e))}),[]);return{isDownloadStarted:n,downloadProgress:c,handleDownloadClick:l}}},2761:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(4050),a=n(7361),s=n(6137),o=n(9118),i=n(647),c=n(5326);const l=(e,t=!1,n=s.IU.BlobUrl,l,d,u=!1)=>{const m=e?i.UV(e):void 0,h=n===s.IU.Stream||a.I_&&n===s.IU.Progressive,f=(0,c.Z)(),[v,p]=(0,r.eJ)(m&&!h?1:0),Z=(0,r.sO)(),g=(0,r.Ye)((()=>(0,o.P2)((e=>{(!d||Date.now()-Z.current>d)&&p(e)}),500,!0)),[d]);return(0,r.d4)((()=>{!t&&e&&(m?h&&setTimeout((()=>{p(.75)}),1500):(p(0),Z.current&&i.cC(g),Z.current=Date.now(),i.he(e,n,u,g).then((()=>{const e=Date.now()-Z.current;Z.current=void 0,!d||e>=d?f():setTimeout(f,d-e)}))))}),[t,e,m,n,l,f,h,d,g,u]),(0,r.d4)((()=>{t&&Z.current&&(i.cC(g),p(0))}),[g,t]),{mediaData:m,downloadProgress:v}}},6503:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(7361);let s;function o(e,t,n=250,o=!1){const i=(0,r.sO)(!0);return(0,r.d4)((()=>{e&&(i.current=!0)}),[e]),(0,r.d4)((()=>{s&&(clearTimeout(s),s=void 0),!e||a.$b||o||(s=window.setTimeout((()=>{i.current||t()}),2*n))}),[o,e,n,t]),[(0,r.I4)((()=>{i.current=!0}),[]),(0,r.I4)((()=>{i.current=!1,s&&(clearTimeout(s),s=void 0),s=window.setTimeout((()=>{i.current||t()}),n)}),[n,t])]}},2678:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(7204),s=n(5326),o=n(9290);function i(e,t){const n=(0,a.Z)(e,!0),i=(0,r.sO)(),c=(0,s.Z)(),l=null!=e,d=null!=n;return l&&i.current&&(clearTimeout(i.current),i.current=void 0),(0,o.Z)((()=>{t&&!l&&d&&!i.current&&(i.current=window.setTimeout((()=>{i.current=void 0,c()}),t))}),[e]),i.current&&t&&!l?n:e}},1090:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050);function a(e,t){const n=(0,r.sO)(e),[a,s]=(0,r.eJ)(t);return[a,(0,r.I4)((e=>{s((t=>n.current(t,e)))}),[])]}},8835:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(1212);const s={fast:200,slow:350},o=(e,t="fast",n=!1)=>{const o=Boolean(e),i=!(0,r.sO)(o).current&&!n,[c,l]=(0,r.eJ)(!o),{shouldRender:d,transitionClassNames:u}=(0,a.Z)(o,void 0,!i,t);return(0,r.d4)((()=>{d&&(i?setTimeout((()=>{l(!1)}),s[t]):l(!1))}),[i,d,t]),{shouldRenderThumb:c,shouldRenderFullMedia:d,transitionClassNames:u}}},6898:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(4050),a=n(9118);function s(e,t){(0,r.d4)((()=>{const t=e.current;return()=>{t&&(0,a.T2)((()=>{t.pause(),t.src="",t.load()}))}}),t)}},6264:(e,t,n)=>{n.d(t,{Z:()=>s});const r=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1],a=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18];function s(e,t,n,s,o,i,c){if(Number.isNaN(i)||i<1)return;i|=0,Number.isNaN(c)&&(c=1),(c|=0)>3&&(c=3),c<1&&(c=1);const l=e.getImageData(t,n,s,o),d=l.data;let u,m,h,f,v,p,Z,g,E,P,y,C,b=s-1,N=o-1,w=i+1,k=[],I=[],T=[],S=r[i],M=a[i],L=[],x=[];for(;c-- >0;){for(C=y=0,v=0;vb?b:p)<<2),u+=d[Z++],m+=d[Z++],h+=d[Z++];for(f=0;f0?Z<<2:0),g=C+L[f],E=C+x[f],u+=d[g++]-d[E++],m+=d[g++]-d[E++],h+=d[g++]-d[E++],y++;C+=s<<2}for(f=0;fN?0:s,u+=k[P],m+=I[P],h+=T[P];for(y=f<<2,v=0;v>>M,d[y+1]=m*S>>>M,d[y+2]=h*S>>>M,0==f&&(L[v]=((Z=v+w)0?Z*s:0),g=f+L[v],E=f+x[v],u+=k[g]-k[E],m+=I[g]-I[E],h+=T[g]-T[E],y+=s<<2}}e.putImageData(l,t,n)}},396:(e,t,n)=>{n.d(t,{E:()=>u,z:()=>m});var r=n(7361),a=n(4753),s=n(5266),o=n(5116),i=n(2858);const c=new Map;let l,d=[];function u(){const e=l&&c.get(l);e&&e.audio.pause()}function m(e,t,n){c.has(e)||(c.set(e,function(e,t){const n=new Audio;function r(t){return r=>{c.has(e)&&((0,s.z)(n)||c.get(e).handlers.forEach((e=>{e(t,r)})))}}return n.addEventListener("timeupdate",r("onTimeUpdate")),n.addEventListener("play",r("onPlay")),n.addEventListener("pause",r("onPause")),n.addEventListener("loadstart",r("onLoadStart")),n.addEventListener("loadeddata",r("onLoadedData")),n.addEventListener("playing",r("onPlaying")),n.addEventListener("ended",(()=>{if((0,s.z)(n))return;const t=d[d.indexOf(e)+1];if(!t)return;if(!c.has(t))return void(0,o.uC)().openAudioPlayer((0,i.Ak)(t));const r=c.get(t);r.onForcePlay&&r.onForcePlay(),l=t,r.audio.src&&(0,a.Z)(r.audio)})),{audio:n,proxy:new Proxy(n,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:t}}(e,n)),d.includes(e)||d.push(e));const{audio:u,proxy:m,handlers:h}=c.get(e);return h.push(t),{play(t){l&&l!==e&&c.get(l).audio.pause(),l=e,u.src||(u.src=t,u.preload="auto",t.includes("/progressive/")&&r.s$&&(0,s.B)(u)),(0,a.Z)(u)},pause(){l===e&&u.pause()},setCurrentTime(t){l===e&&(u.currentTime=t)},proxy:m,destroy(n=!1){const r=c.get(e);r&&(r.handlers=r.handlers.filter((e=>e!==t)),r.handlers.length||(r.audio.pause(),c.delete(e),n&&(d=d.filter((t=>t!==e))),e===l&&(l=void 0)))}}}},1174:(e,t,n)=>{n.d(t,{e:()=>a,s:()=>s});var r=n(7361);let a;function s(e,t){let n,s,o=!1,i=!1;function c(e){if(!t.excludedClosestSelector||!e.target.matches(t.excludedClosestSelector)&&!e.target.closest(t.excludedClosestSelector)){if(n=e,"mousedown"===e.type)document.addEventListener("mousemove",d),document.addEventListener("mouseup",l);else if("touchstart"===e.type){const t=e.target;t.addEventListener("touchmove",d,{passive:!0}),t.addEventListener("touchend",l),t.addEventListener("touchcancel",l),"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY))}document.body.classList.add("no-selection"),t.withCursor&&document.body.classList.add("cursor-grabbing"),t.onCapture&&t.onCapture(e)}}function l(e){n&&(t.withCursor&&document.body.classList.remove("cursor-grabbing"),document.body.classList.remove("no-selection"),document.removeEventListener("mouseup",l),document.removeEventListener("mousemove",d),n.target.removeEventListener("touchcancel",l),n.target.removeEventListener("touchend",l),n.target.removeEventListener("touchmove",d),n=void 0,r.cj&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow=""})),o?t.onRelease&&t.onRelease(e):!t.onClick||"button"in e&&0!==e.button||t.onClick(e)),o=!1,i=!1,s=void 0}function d(e){if(n){"touchmove"===e.type&&"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY));const c=e.pageX-n.pageX,l=e.pageY-n.pageY;(Math.abs(c)>=15||Math.abs(l)>=15)&&(o=!0);let d=!1;t.onDrag&&(t.onDrag(e,n,{dragOffsetX:c,dragOffsetY:l}),d=!0),t.onSwipe&&!i&&(i=function(e,n,o){if(r.cj){const t=e.touches[0].pageX;if(t<=20||t>=window.innerWidth-20)return!1}const i=Math.abs(n),c=Math.abs(o);if(n&&o&&Math.max(i,c)/Math.min(i,c)<2)return!1;let l;if(i>=50?l="x":c>=50&&(l="y"),!l)return!1;if(s){if(s!==l)return!1}else s=l;return function(e,t,n,r,s){return"x"===t?s(e,n<0?a.Left:a.Right):"y"===t&&s(e,r<0?a.Up:a.Down)}(e,l,n,o,t.onSwipe)}(e,c,l),d=i),r.cj&&d&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow="hidden"}))}}return e.addEventListener("mousedown",c),e.addEventListener("touchstart",c,{passive:!0}),()=>{e.removeEventListener("mousedown",c),e.removeEventListener("touchstart",c)}}!function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Left=2]="Left",e[e.Right=3]="Right"}(a||(a={}))},4319:(e,t,n)=>{n.d(t,{yl:()=>a,TE:()=>o,VP:()=>i});var r=n(3716);const a=navigator.clipboard&&window.ClipboardItem,s=document.createElement("textarea");s.setAttribute("readonly",""),s.tabIndex=-1,s.className="visually-hidden";const o=e=>{s.value=e,document.body.appendChild(s);const t=document.getSelection();if(t){const e=t.rangeCount>0&&t.getRangeAt(0);s.select(),document.execCommand("copy"),e&&(t.removeAllRanges(),t.addRange(e))}document.body.removeChild(s)},i=e=>{if(!e)return;const t=document.createElement("canvas"),n=t.getContext("2d"),r=new Image;r.onload=e=>{if(n&&e.currentTarget){const r=e.currentTarget;t.width=r.width,t.height=r.height,n.drawImage(r,0,0,r.width,r.height),t.toBlob(c,"image/png",1)}},r.src=e};async function c(e){if(e&&a)try{await navigator.clipboard.write([new window.ClipboardItem({[e.type]:e})])}catch(e){r.eM&&console.error(e)}}},1279:(e,t,n)=>{function r(e,t,n){s("transitionend",e,t,n)}function a(e,t,n){s("animationend",e,t,n)}function s(e,t,n,r){let a=!1;t.addEventListener(e,(function s(o){a||o.target!==o.currentTarget||r&&(o instanceof TransitionEvent&&o.propertyName===r||o instanceof AnimationEvent&&o.animationName===r)||(a=!0,t.removeEventListener(e,s),setTimeout((()=>{n()}),50))}))}n.d(t,{L:()=>r,f:()=>a})},3570:(e,t,n)=>{function r(e,t){return t-Math.floor(t/e)*e}n.d(t,{Z:()=>r})},6562:(e,t,n)=>{function r(e,t){const n=document.createElement("a");n.href=e,n.download=t,n.click()}n.d(t,{Z:()=>r})},539:(e,t,n)=>{n.d(t,{Z:()=>l,N:()=>d});var r=n(5116),a=n(1713),s=n(3716),o=n(8674),i=n(9933);let c=!1;function l(e,t,n,o=0,i=s.V$,c,l,d){const m=function(e,t,n=s.V$,r){const{offsetTop:o}=t,{scrollTop:i}=e;if(void 0===r){const t=o-e.scrollTop;if(t<-n)return i+(t+n);if(t>n)return i+(t-n)}else{if(r===a.fo.Up)return o+n;if(r===a.fo.Down)return Math.max(0,o-n)}return i}(e,t,i,c);c!==a.fo.Static?((0,r.Rd)().settings.byKey.animationLevel===s.oB&&(l=0),u(e,t,m,n,o,l,d)):u(e,t,m,n,o,0)}function d(){return c}function u(e,t,n,r,a=0,l,d){const{offsetTop:u,offsetHeight:f}=t,{scrollTop:v,offsetHeight:p,scrollHeight:Z}=e,g=d&&e.dataset.normalHeight?Number(e.dataset.normalHeight):p;let E;switch(v!==n&&(e.scrollTop=n),r){case"start":E=u-a-n;break;case"end":E=u+f+a-(n+g);break;case"nearest":case"center":case"centerOrTop":E=f0){const e=Z-(n+g);E=Math.min(E,e)}if(0===E)return;const P=n+E;if(0===l)return void(e.scrollTop=P);c=!0;const y=Math.abs(E),C=y{const t=Math.min((Date.now()-N)/b,1),n=E*(1-C(t));return e.scrollTop=Math.round(P-n),c=t<1,c||w(),c}))}function m(e){return 1-(1-e)**5}function h(e){return 1-(1-e)**3.5}},1367:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(5116),a=n(3716),s=n(7361),o=n(9933);function i(e,t,n=300){(0,r.Rd)().settings.byKey.animationLevel===a.oB&&(n=0),s.cj?function(e,t,n){const{scrollLeft:r,offsetWidth:a,scrollWidth:s}=e;let i=t-r;if(i<0){const e=-r;i=Math.max(i,e)}else if(i>0){const e=s-(r+a);i=Math.min(i,e)}if(0===i)return;const c=r+i;if(0===n)return void(e.scrollLeft=c);const l=Date.now();(0,o.j)((()=>{const t=Math.min((Date.now()-l)/n,1),r=i*(1-function(e){return 1-(1-e)**3.5}(t));return e.scrollLeft=Math.round(c-r),t<1}))}(e,t,n):e.scrollTo({left:t,...n&&{behavior:"smooth"}})}},5723:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(7361);function a(e,t){if(!t&&e===document.activeElement)return;const n=window.getSelection(),a=document.createRange(),s=e.lastChild||e;r.$b||s&&s.nodeValue?(a.selectNodeContents(s),a.collapse(!1),n.removeAllRanges(),n.addRange(a)):e.focus()}},5266:(e,t,n)=>{function r(e){e.dataset.patchedForSafari||(e.addEventListener("play",(()=>{const t=e.currentTime;e.addEventListener("progress",(function n(){e.buffered.length&&(e.dataset.patchForSafariInProgress="true",e.currentTime=e.duration-1,e.addEventListener("progress",(()=>{delete e.dataset.patchForSafariInProgress,e.currentTime=t,e.paused&&e.play()}),{once:!0}),e.removeEventListener("progress",n))}))}),{once:!0}),e.dataset.patchedForSafari="true")}function a(e){return Boolean(e.dataset.patchForSafariInProgress)}n.d(t,{B:()=>r,z:()=>a})},7675:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(7361);const a=(e,t)=>{r.cj&&(e.style.overflow="hidden"),void 0!==t&&(e.scrollTop=t),r.cj&&(e.style.overflow="")}},4753:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(3716);const a=e=>{e.play().catch((e=>{r.eM&&console.warn(e)}))}}}]); -//# sourceMappingURL=484.40f6759b976ebb12ec3f.js.map \ No newline at end of file diff --git a/dist/484.40f6759b976ebb12ec3f.js.map b/dist/484.40f6759b976ebb12ec3f.js.map deleted file mode 100644 index bbbd7c62..00000000 --- a/dist/484.40f6759b976ebb12ec3f.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"484.40f6759b976ebb12ec3f.js","mappings":"2MAwBA,MACMA,EAAQ,CACZC,MAAO,IACPC,OAAQ,IACRC,MAAO,KAoET,EAjEoC,EAClCC,QAAAA,EACAC,KAAAA,EAAO,SACPC,oBAAAA,EACAC,aAAAA,EACAC,iBAAAA,MACI,MAEJ,MAAMC,GAAMC,EAAAA,EAAAA,IAAuB,OAE5BC,EAAmBC,IAAuBC,EAAAA,EAAAA,KAC3CC,EAAkB,UAASV,EAAQW,KAEnCC,GAAiBC,EAAAA,EAAAA,IAAkBR,EAAKH,GAExCY,EAAY,UAAGd,EAAQe,iBAAX,aAAG,EAAmBC,QAClCC,GAAiBC,EAAAA,EAAAA,GACpB,GAAER,YACFE,IAAmBR,EACpBe,EAAAA,GAAAA,QACAhB,IAEI,qBAAEiB,IAAyBC,EAAAA,EAAAA,GAAsBJ,EAAgB,QAEjEK,GAAYJ,EAAAA,EAAAA,GAASR,GAAiBE,EAAgBO,EAAAA,GAAAA,OAAuBhB,GAC7EoB,EAAgBC,QAAQF,IAEvBG,EAASC,IAAcC,EAAAA,EAAAA,IAASC,OAAOC,KAAKC,WAC7CC,GAAcC,EAAAA,EAAAA,KAAY,KAC9BN,EAAWE,OAAOC,KAAKC,aACtB,IAEGG,EAAQrC,EAAMK,GACdiC,EAAS,UAASD,gBAAoBA,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ACtCA,EAAQ1pB,QAAQ2pB,mBAIpBD,EAAQx2B,iBAAiB,QAAQ,KAC/B,MAAM21B,EAAIa,EAAQ/U,YAoBlB+U,EAAQx2B,iBAAiB,YAlBzB,SAAS4jB,IACF4S,EAAQpT,SAASnrC,SAItBu+C,EAAQ1pB,QAAQ4pB,yBAA2B,OAC3CF,EAAQ/U,YAAc+U,EAAQrhD,SAAW,EACzCqhD,EAAQx2B,iBAAiB,YAAY,YAC5Bw2B,EAAQ1pB,QAAQ4pB,yBACvBF,EAAQ/U,YAAckU,EAClBa,EAAQ9U,QACV8U,EAAQ3mD,SAET,CAAE8mD,MAAM,IAEXH,EAAQv2B,oBAAoB,WAAY2jB,SAIzC,CAAE+S,MAAM,IAEXH,EAAQ1pB,QAAQ2pB,iBAAmB,QAG9B,SAAS9U,EAAwB6U,GACtC,OAAO/nD,QAAQ+nD,EAAQ1pB,QAAQ4pB,0B,wECnCjC,SAAgB9lD,EAA2B6kC,KACrCtQ,EAAAA,KACFv0B,EAAUzB,MAAM4hD,SAAW,eAGXvhD,IAAdimC,IACF7kC,EAAU6kC,UAAYA,GAGpBtQ,EAAAA,KACFv0B,EAAUzB,MAAM4hD,SAAW,M,8CCV/B,QAAgB6F,IACdA,EAAQ/mD,OAAOgnD,OAAOC,IAChBjE,EAAAA,IAEFC,QAAQiE,KAAKD","sources":["webpack://telegram-t/./src/components/common/AnimatedEmoji.tsx","webpack://telegram-t/./src/components/common/AnimatedSticker.tsx","webpack://telegram-t/./src/components/common/Audio.tsx","webpack://telegram-t/./src/util/waveform.ts","webpack://telegram-t/./src/components/common/helpers/waveform.ts","webpack://telegram-t/./src/components/common/Avatar.tsx","webpack://telegram-t/./src/components/common/ChatExtra.tsx","webpack://telegram-t/./src/components/common/DeleteChatModal.tsx","webpack://telegram-t/./src/components/common/Document.tsx","webpack://telegram-t/./src/components/common/File.tsx","webpack://telegram-t/./src/components/common/GroupChatInfo.tsx","webpack://telegram-t/./src/components/common/LastMessageMeta.tsx","webpack://telegram-t/./src/components/common/Media.tsx","webpack://telegram-t/./src/components/common/MessageOutgoingStatus.tsx","webpack://telegram-t/./src/components/common/NothingFound.tsx","webpack://telegram-t/./src/components/common/Picker.tsx","webpack://telegram-t/./src/components/common/PickerSelectedItem.tsx","webpack://telegram-t/./src/components/common/PrivateChatInfo.tsx","webpack://telegram-t/./src/components/common/ProfilePhoto.tsx","webpack://telegram-t/./src/components/common/ProfileInfo.tsx","webpack://telegram-t/./src/components/common/hooks/usePhotosPreload.ts","webpack://telegram-t/./src/components/common/StickerButton.tsx","webpack://telegram-t/./src/components/common/StickerSetModal.async.tsx","webpack://telegram-t/./src/components/common/TypingStatus.tsx","webpack://telegram-t/./src/components/common/VerifiedIcon.tsx","webpack://telegram-t/./src/components/common/WebLink.tsx","webpack://telegram-t/./src/components/common/helpers/mediaDimensions.ts","webpack://telegram-t/./src/components/common/helpers/renderMessageText.tsx","webpack://telegram-t/./src/components/left/main/hooks/useChatAnimationType.ts","webpack://telegram-t/./src/components/left/main/Badge.tsx","webpack://telegram-t/./src/components/left/main/Chat.tsx","webpack://telegram-t/./src/components/left/main/EmptyFolder.tsx","webpack://telegram-t/./src/components/left/main/ChatList.tsx","webpack://telegram-t/./src/components/middle/composer/DropTarget.tsx","webpack://telegram-t/./src/components/middle/composer/DropArea.tsx","webpack://telegram-t/./src/components/middle/composer/EmojiTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/MessageInput.tsx","webpack://telegram-t/./src/components/middle/composer/TextFormatter.tsx","webpack://telegram-t/./src/components/middle/composer/helpers/parseMessageInput.ts","webpack://telegram-t/./src/components/middle/composer/helpers/selection.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useEmojiTooltip.ts","webpack://telegram-t/./src/components/middle/composer/helpers/searchUserName.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useMentionTooltip.ts","webpack://telegram-t/./src/components/right/hooks/useAsyncRendering.ts","webpack://telegram-t/./src/components/ui/ConfirmDialog.tsx","webpack://telegram-t/./src/components/ui/FloatingActionButton.tsx","webpack://telegram-t/./src/components/ui/InfiniteScroll.tsx","webpack://telegram-t/./src/components/ui/ListItem.tsx","webpack://telegram-t/./src/components/ui/Modal.tsx","webpack://telegram-t/./src/util/trapFocus.ts","webpack://telegram-t/./src/components/ui/Notification.tsx","webpack://telegram-t/./src/components/ui/Portal.ts","webpack://telegram-t/./src/components/ui/ProgressSpinner.tsx","webpack://telegram-t/./src/components/ui/Radio.tsx","webpack://telegram-t/./src/components/ui/RadioGroup.tsx","webpack://telegram-t/./src/components/ui/SearchInput.tsx","webpack://telegram-t/./src/components/ui/ShowTransition.tsx","webpack://telegram-t/./src/components/ui/Switcher.tsx","webpack://telegram-t/./src/components/ui/Tab.tsx","webpack://telegram-t/./src/components/ui/TabList.tsx","webpack://telegram-t/./src/components/ui/Transition.tsx","webpack://telegram-t/./src/hooks/reducers/useFoldersReducer.ts","webpack://telegram-t/./src/hooks/useAudioPlayer.ts","webpack://telegram-t/./src/hooks/useBackgroundMode.ts","webpack://telegram-t/./src/hooks/useBlur.ts","webpack://telegram-t/./src/hooks/useBlurSync.ts","webpack://telegram-t/./src/hooks/useBuffering.ts","webpack://telegram-t/./src/hooks/useCanvasBlur.ts","webpack://telegram-t/./src/hooks/useChatContextActions.ts","webpack://telegram-t/./src/hooks/useContextMenuHandlers.ts","webpack://telegram-t/./src/hooks/useContextMenuPosition.ts","webpack://telegram-t/./src/hooks/useCurrentOrPrev.ts","webpack://telegram-t/./src/hooks/useEnsureMessage.ts","webpack://telegram-t/./src/hooks/useHorizontalScroll.ts","webpack://telegram-t/./src/hooks/useInfiniteScroll.ts","webpack://telegram-t/./src/hooks/useIntersectionObserver.ts","webpack://telegram-t/./src/hooks/useLayoutEffectWithPrevDeps.ts","webpack://telegram-t/./src/hooks/useMedia.ts","webpack://telegram-t/./src/hooks/useMediaDownload.ts","webpack://telegram-t/./src/hooks/useMediaWithDownloadProgress.ts","webpack://telegram-t/./src/hooks/useMouseInside.ts","webpack://telegram-t/./src/hooks/usePrevDuringAnimation.ts","webpack://telegram-t/./src/hooks/useReducer.ts","webpack://telegram-t/./src/hooks/useTransitionForMedia.ts","webpack://telegram-t/./src/hooks/useVideoCleanup.ts","webpack://telegram-t/./src/lib/fastBlur.js","webpack://telegram-t/./src/util/audioPlayer.ts","webpack://telegram-t/./src/util/captureEvents.ts","webpack://telegram-t/./src/util/clipboard.ts","webpack://telegram-t/./src/util/cssAnimationEndListeners.ts","webpack://telegram-t/./src/util/cycleRestrict.ts","webpack://telegram-t/./src/util/download.ts","webpack://telegram-t/./src/util/fastSmoothScroll.ts","webpack://telegram-t/./src/util/fastSmoothScrollHorizontal.ts","webpack://telegram-t/./src/util/focusEditableElement.ts","webpack://telegram-t/./src/util/patchSafariProgressiveAudio.ts","webpack://telegram-t/./src/util/resetScroll.ts","webpack://telegram-t/./src/util/safePlay.ts"],"sourcesContent":["import React, {\n FC, useCallback, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiSticker } from '../../api/types';\n\nimport { LIKE_STICKER_ID } from './helpers/mediaDimensions';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport useMedia from '../../hooks/useMedia';\nimport useTransitionForMedia from '../../hooks/useTransitionForMedia';\nimport useFlag from '../../hooks/useFlag';\n\nimport AnimatedSticker from './AnimatedSticker';\n\nimport './AnimatedEmoji.scss';\n\ntype OwnProps = {\n sticker: ApiSticker;\n observeIntersection?: ObserveFn;\n size?: 'large' | 'medium' | 'small';\n lastSyncTime?: number;\n forceLoadPreview?: boolean;\n};\n\nconst QUALITY = 1;\nconst WIDTH = {\n large: 160,\n medium: 128,\n small: 104,\n};\n\nconst AnimatedEmoji: FC = ({\n sticker,\n size = 'medium',\n observeIntersection,\n lastSyncTime,\n forceLoadPreview,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const [isAnimationLoaded, markAnimationLoaded] = useFlag();\n const localMediaHash = `sticker${sticker.id}`;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const thumbDataUri = sticker.thumbnail?.dataUri;\n const previewBlobUrl = useMedia(\n `${localMediaHash}?size=m`,\n !isIntersecting && !forceLoadPreview,\n ApiMediaFormat.BlobUrl,\n lastSyncTime,\n );\n const { transitionClassNames } = useTransitionForMedia(previewBlobUrl, 'slow');\n\n const mediaData = useMedia(localMediaHash, !isIntersecting, ApiMediaFormat.Lottie, lastSyncTime);\n const isMediaLoaded = Boolean(mediaData);\n\n const [playKey, setPlayKey] = useState(String(Math.random()));\n const handleClick = useCallback(() => {\n setPlayKey(String(Math.random()));\n }, []);\n\n const width = WIDTH[size];\n const style = `width: ${width}px; height: ${width}px;`;\n\n return (\n \n {!isAnimationLoaded && thumbDataUri && (\n \"\"\n )}\n {!isAnimationLoaded && previewBlobUrl && (\n \"\"\n )}\n {isMediaLoaded && (\n \n )}\n
\n );\n};\n\nexport default AnimatedEmoji;\n","import React, {\n FC, useEffect, useRef, memo, useCallback, useState,\n} from '../../lib/teact/teact';\n\nimport { fastRaf } from '../../util/schedulers';\nimport buildClassName from '../../util/buildClassName';\nimport useHeavyAnimationCheck from '../../hooks/useHeavyAnimationCheck';\nimport useBackgroundMode from '../../hooks/useBackgroundMode';\n\ntype OwnProps = {\n className?: string;\n id: string;\n animationData: AnyLiteral;\n play?: boolean | string;\n playSegment?: [number, number];\n speed?: number;\n noLoop?: boolean;\n size: number;\n quality?: number;\n isLowPriority?: boolean;\n onLoad?: NoneToVoidFunction;\n};\n\ntype RLottieClass = typeof import('../../lib/rlottie/RLottie').default;\ntype RLottieInstance = import('../../lib/rlottie/RLottie').default;\nlet lottiePromise: Promise;\nlet RLottie: RLottieClass;\n\n// Time supposed for judges to measure \"Transferred Size\" in Dev Tools\nconst LOTTIE_LOAD_DELAY = 5000;\n\nasync function ensureLottie() {\n if (!lottiePromise) {\n lottiePromise = import('../../lib/rlottie/RLottie') as unknown as Promise;\n RLottie = (await lottiePromise as any).default;\n }\n\n return lottiePromise;\n}\n\nsetTimeout(ensureLottie, LOTTIE_LOAD_DELAY);\n\nconst AnimatedSticker: FC = ({\n className,\n id,\n animationData,\n play,\n playSegment,\n speed,\n noLoop,\n size,\n quality,\n isLowPriority,\n onLoad,\n}) => {\n const [animation, setAnimation] = useState();\n // eslint-disable-next-line no-null/no-null\n const container = useRef(null);\n const wasPlaying = useRef(false);\n const isFrozen = useRef(false);\n\n const playRef = useRef();\n playRef.current = play;\n const playSegmentRef = useRef<[number, number]>();\n playSegmentRef.current = playSegment;\n\n useEffect(() => {\n if (animation || !animationData) {\n return;\n }\n\n const exec = () => {\n if (!container.current) {\n return;\n }\n\n const newAnimation = new RLottie(\n id,\n container.current,\n animationData,\n {\n noLoop,\n size,\n quality,\n isLowPriority,\n },\n onLoad,\n );\n\n if (speed) {\n newAnimation.setSpeed(speed);\n }\n\n setAnimation(newAnimation);\n };\n\n if (RLottie) {\n exec();\n } else {\n ensureLottie().then(() => {\n fastRaf(() => {\n if (container.current) {\n exec();\n }\n });\n });\n }\n }, [animation, animationData, id, isLowPriority, noLoop, onLoad, quality, size, speed]);\n\n useEffect(() => {\n return () => {\n if (animation) {\n animation.destroy();\n }\n };\n }, [animation]);\n\n const playAnimation = useCallback((shouldRestart = false) => {\n if (animation && (playRef.current || playSegmentRef.current)) {\n if (playSegmentRef.current) {\n animation.playSegment(playSegmentRef.current);\n } else if (shouldRestart) {\n animation.goToAndPlay(0);\n } else {\n animation.play();\n }\n }\n }, [animation]);\n\n const pauseAnimation = useCallback(() => {\n if (!animation) {\n return;\n }\n\n animation.pause();\n }, [animation]);\n\n const freezeAnimation = useCallback(() => {\n isFrozen.current = true;\n\n if (!animation) {\n return;\n }\n\n if (!wasPlaying.current) {\n wasPlaying.current = animation.isPlaying();\n }\n\n pauseAnimation();\n }, [animation, pauseAnimation]);\n\n const unfreezeAnimation = useCallback(() => {\n if (wasPlaying.current) {\n playAnimation();\n }\n\n wasPlaying.current = false;\n isFrozen.current = false;\n }, [playAnimation]);\n\n const unfreezeAnimationOnRaf = useCallback(() => {\n fastRaf(unfreezeAnimation);\n }, [unfreezeAnimation]);\n\n useEffect(() => {\n if (!animation) {\n return;\n }\n\n if (play || playSegment) {\n if (isFrozen.current) {\n wasPlaying.current = true;\n } else {\n playAnimation(noLoop);\n }\n } else {\n // eslint-disable-next-line no-lonely-if\n if (isFrozen.current) {\n wasPlaying.current = false;\n } else {\n pauseAnimation();\n }\n }\n }, [animation, play, playSegment, noLoop, playAnimation, pauseAnimation]);\n\n useHeavyAnimationCheck(freezeAnimation, unfreezeAnimation);\n // Pausing frame may not happen in background\n // so we need to make sure it happens right after focusing,\n // then we can play again.\n useBackgroundMode(freezeAnimation, unfreezeAnimationOnRaf);\n\n const fullClassName = buildClassName('AnimatedSticker', className);\n\n const style = size ? `width: ${size}px; height: ${size}px;` : undefined;\n\n return (\n \n );\n};\n\nexport default memo(AnimatedSticker);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport {\n ApiAudio, ApiMessage, ApiVoice,\n} from '../../api/types';\nimport { ISettings } from '../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { formatMediaDateTime, formatMediaDuration, formatPastTimeShort } from '../../util/dateFormat';\nimport {\n getMediaDuration,\n getMediaTransferState,\n getMessageAudioCaption,\n getMessageKey,\n getMessageMediaFormat,\n getMessageMediaHash,\n isMessageLocal,\n isOwnMessage,\n} from '../../modules/helpers';\nimport { renderWaveformToDataUri } from './helpers/waveform';\nimport buildClassName from '../../util/buildClassName';\nimport renderText from './helpers/renderText';\nimport { decodeWaveform, interpolateArray } from '../../util/waveform';\nimport useMediaWithDownloadProgress from '../../hooks/useMediaWithDownloadProgress';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useBuffering from '../../hooks/useBuffering';\nimport useAudioPlayer from '../../hooks/useAudioPlayer';\nimport useMediaDownload from '../../hooks/useMediaDownload';\nimport useLang, { LangFn } from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport ProgressSpinner from '../ui/ProgressSpinner';\nimport Link from '../ui/Link';\n\nimport './Audio.scss';\n\ntype OwnProps = {\n theme: ISettings['theme'];\n message: ApiMessage;\n senderTitle?: string;\n uploadProgress?: number;\n target?: 'searchResult' | 'sharedMedia';\n date?: number;\n lastSyncTime?: number;\n className?: string;\n isSelectable?: boolean;\n isSelected?: boolean;\n onPlay: (messageId: number, chatId: number) => void;\n onReadMedia?: () => void;\n onCancelUpload?: () => void;\n onDateClick?: (messageId: number, chatId: number) => void;\n};\n\ninterface ISeekMethods {\n handleStartSeek: (e: React.MouseEvent) => void;\n handleSeek: (e: React.MouseEvent) => void;\n handleStopSeek: () => void;\n}\n\nconst AVG_VOICE_DURATION = 30;\nconst MIN_SPIKES = IS_SINGLE_COLUMN_LAYOUT ? 20 : 25;\nconst MAX_SPIKES = IS_SINGLE_COLUMN_LAYOUT ? 50 : 75;\n// This is needed for browsers requiring user interaction before playing.\nconst PRELOAD = true;\n\nconst Audio: FC = ({\n theme,\n message,\n senderTitle,\n uploadProgress,\n target,\n date,\n lastSyncTime,\n className,\n isSelectable,\n isSelected,\n onPlay,\n onReadMedia,\n onCancelUpload,\n onDateClick,\n}) => {\n const { content: { audio, voice }, isMediaUnread } = message;\n const isVoice = Boolean(voice);\n const isSeeking = useRef(false);\n const lang = useLang();\n\n const [isActivated, setIsActivated] = useState(false);\n const shouldDownload = (isActivated || PRELOAD) && lastSyncTime;\n\n const { mediaData, downloadProgress } = useMediaWithDownloadProgress(\n getMessageMediaHash(message, 'inline'),\n !shouldDownload,\n getMessageMediaFormat(message, 'inline'),\n );\n\n function handleForcePlay() {\n setIsActivated(true);\n onPlay(message.id, message.chatId);\n }\n\n const {\n isBuffered, bufferedProgress, bufferingHandlers, checkBuffering,\n } = useBuffering();\n\n const {\n isPlaying, playProgress, playPause, setCurrentTime, duration,\n } = useAudioPlayer(\n getMessageKey(message),\n getMediaDuration(message)!,\n mediaData,\n bufferingHandlers,\n checkBuffering,\n isActivated,\n handleForcePlay,\n isMessageLocal(message),\n );\n\n useEffect(() => {\n setIsActivated(isPlaying);\n }, [isPlaying]);\n\n const {\n isDownloadStarted,\n downloadProgress: directDownloadProgress,\n handleDownloadClick,\n } = useMediaDownload(getMessageMediaHash(message, 'download'), getMessageAudioCaption(message));\n\n const isLoadingForPlaying = isActivated && !isBuffered;\n\n const {\n isUploading, isTransferring, transferProgress,\n } = getMediaTransferState(\n message,\n isDownloadStarted ? directDownloadProgress : (uploadProgress || downloadProgress),\n isLoadingForPlaying || isDownloadStarted,\n );\n\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring);\n\n const handleButtonClick = useCallback(() => {\n if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload();\n }\n\n return;\n }\n\n if (!isPlaying) {\n onPlay(message.id, message.chatId);\n }\n\n setIsActivated(!isActivated);\n playPause();\n }, [isPlaying, isUploading, message.id, message.chatId, onCancelUpload, onPlay, playPause, isActivated]);\n\n useEffect(() => {\n if (isPlaying && onReadMedia && isMediaUnread) {\n onReadMedia();\n }\n }, [isPlaying, isMediaUnread, onReadMedia]);\n\n const handleSeek = useCallback((e: React.MouseEvent) => {\n if (isSeeking.current) {\n const seekBar = e.currentTarget.closest('.seekline,.waveform');\n if (seekBar) {\n const { width, left } = seekBar.getBoundingClientRect();\n setCurrentTime(duration * ((e.clientX - left) / width));\n }\n }\n }, [duration, setCurrentTime]);\n\n const handleStartSeek = useCallback((e: React.MouseEvent) => {\n isSeeking.current = true;\n handleSeek(e);\n }, [handleSeek]);\n\n const handleStopSeek = useCallback(() => {\n isSeeking.current = false;\n }, []);\n\n const handleDateClick = useCallback(() => {\n onDateClick!(message.id, message.chatId);\n }, [onDateClick, message.id, message.chatId]);\n\n function getFirstLine() {\n if (isVoice) {\n return senderTitle || 'Voice';\n }\n\n const { title, fileName } = audio!;\n\n return title || fileName;\n }\n\n function getSecondLine() {\n if (isVoice) {\n return formatMediaDuration(voice!.duration);\n }\n\n const { performer } = audio!;\n\n return (\n <>\n {performer && renderText(performer)}\n {performer && senderTitle && }\n {senderTitle && renderText(senderTitle)}\n \n );\n }\n\n const seekHandlers = { handleStartSeek, handleSeek, handleStopSeek };\n const isOwn = isOwnMessage(message);\n const renderedWaveform = useMemo(\n () => voice && renderWaveform(voice, playProgress, isOwn, { handleStartSeek, handleSeek, handleStopSeek }, theme),\n [voice, playProgress, isOwn, handleStartSeek, handleSeek, handleStopSeek, theme],\n );\n\n const fullClassName = buildClassName(\n 'Audio media-inner',\n className,\n isOwn && !target && 'own',\n target && 'bigger',\n isSelected && 'audio-is-selected',\n );\n\n const buttonClassNames = ['toggle-play'];\n if (isLoadingForPlaying) {\n buttonClassNames.push('loading');\n } else if (isPlaying) {\n buttonClassNames.push('pause');\n } else if (!isPlaying) {\n buttonClassNames.push('play');\n }\n\n const showSeekline = isPlaying || (playProgress > 0 && playProgress < 1);\n const contentClassName = buildClassName('content', showSeekline && 'with-seekline');\n\n function renderSearchResult() {\n return (\n <>\n
\n
\n

{renderText(getFirstLine())}

\n\n
\n {date && (\n \n {formatPastTimeShort(lang, date * 1000)}\n \n )}\n
\n
\n\n {showSeekline && renderSeekline(playProgress, bufferedProgress, seekHandlers)}\n {!showSeekline && (\n

\n {playProgress > 0 ? `${formatMediaDuration(duration * playProgress)} / ` : undefined}\n {getSecondLine()}\n

\n )}\n
\n \n );\n }\n\n return (\n
\n {isSelectable && (\n
\n {isSelected && }\n
\n )}\n \n \n \n \n {shouldRenderSpinner && (\n
\n \n
\n )}\n {audio && (\n \n \n \n )}\n {target === 'searchResult' && renderSearchResult()}\n {target !== 'searchResult' && audio && renderAudio(\n lang, audio, isPlaying, playProgress, bufferedProgress, seekHandlers, date,\n onDateClick ? handleDateClick : undefined,\n )}\n {target !== 'searchResult' && voice && renderVoice(voice, renderedWaveform, isMediaUnread)}\n
\n );\n};\n\nfunction renderAudio(\n lang: LangFn,\n audio: ApiAudio,\n isPlaying: boolean,\n playProgress: number,\n bufferedProgress: number,\n seekHandlers: ISeekMethods,\n date?: number,\n handleDateClick?: NoneToVoidFunction,\n) {\n const {\n title, performer, duration, fileName,\n } = audio;\n const showSeekline = isPlaying || (playProgress > 0 && playProgress < 1);\n\n return (\n
\n

{renderText(title || fileName)}

\n {showSeekline && renderSeekline(playProgress, bufferedProgress, seekHandlers)}\n {!showSeekline && (\n
\n {renderText(performer || 'Unknown')}\n {date && (\n <>\n {' '}\n •\n {' '}\n {formatMediaDateTime(lang, date * 1000)}\n \n )}\n
\n )}\n

\n {playProgress > 0 ? `${formatMediaDuration(duration * playProgress)} / ` : undefined}\n {formatMediaDuration(duration)}\n

\n
\n );\n}\n\nfunction renderVoice(voice: ApiVoice, renderedWaveform: any, isMediaUnread?: boolean) {\n return (\n
\n {renderedWaveform}\n

\n {formatMediaDuration(voice.duration)}\n {isMediaUnread && }\n

\n
\n );\n}\n\nfunction renderWaveform(\n voice: ApiVoice,\n playProgress = 0,\n isOwn = false,\n { handleStartSeek, handleSeek, handleStopSeek }: ISeekMethods,\n theme: ISettings['theme'],\n) {\n const { waveform, duration } = voice;\n\n if (!waveform) {\n return undefined;\n }\n\n const fillColor = theme === 'dark' ? '#494B75' : '#CBCBCB';\n const fillOwnColor = theme === 'dark' ? '#C0BBED' : '#B0DEA6';\n const progressFillColor = theme === 'dark' ? '#868DF5' : '#54a3e6';\n const progressFillOwnColor = theme === 'dark' ? '#FFFFFF' : '#53ad53';\n const durationFactor = Math.min(duration / AVG_VOICE_DURATION, 1);\n const spikesCount = Math.round(MIN_SPIKES + (MAX_SPIKES - MIN_SPIKES) * durationFactor);\n const decodedWaveform = decodeWaveform(new Uint8Array(waveform));\n const { data: spikes, peak } = interpolateArray(decodedWaveform, spikesCount);\n const { src, width, height } = renderWaveformToDataUri(spikes, playProgress, {\n peak,\n fillStyle: isOwn ? fillOwnColor : fillColor,\n progressFillStyle: isOwn ? progressFillOwnColor : progressFillColor,\n });\n\n return (\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n \n );\n}\n\nfunction renderSeekline(\n playProgress: number,\n bufferedProgress: number,\n { handleStartSeek, handleSeek, handleStopSeek }: ISeekMethods,\n) {\n return (\n \n \n \n \n \n \n \n \n \n \n
\n );\n}\n\nexport default memo(Audio);\n","/* eslint-disable no-bitwise */\n\n// eslint-disable-next-line max-len\n// Ref: https://github.com/telegramdesktop/tdesktop/blob/0743e71ab6b928d2ee5bae1aed991849b1e2b291/Telegram/SourceFiles/data/data_document.cpp#L1018\nexport function decodeWaveform(encoded5bit: Uint8Array) {\n const bitsCount = encoded5bit.length * 8;\n const valuesCount = Math.floor(bitsCount / 5);\n if (!valuesCount) {\n return [];\n }\n\n // Read each 5 bit of encoded5bit as 0-31 unsigned char.\n // We count the index of the byte in which the desired 5-bit sequence starts.\n // And then we read a uint16 starting from that byte to guarantee to get all of those 5 bits.\n //\n // BUT! if it is the last byte we have, we're not allowed to read a uint16 starting with it.\n // Because it will be an overflow (we'll access one byte after the available memory).\n // We see, that only the last 5 bits could start in the last available byte and be problematic.\n // So we read in a general way all the entries in a general way except the last one.\n const result = Array(valuesCount);\n const bitsData = encoded5bit;\n for (let i = 0, l = valuesCount - 1; i !== l; ++i) {\n const byteIndex = Math.floor((i * 5) / 8);\n const bitShift = Math.floor((i * 5) % 8);\n const value = bitsData[byteIndex] + (bitsData[byteIndex + 1] << 8);\n result[i] = ((value >> bitShift) & 0x1F);\n }\n const lastByteIndex = Math.floor(((valuesCount - 1) * 5) / 8);\n const lastBitShift = Math.floor(((valuesCount - 1) * 5) % 8);\n const lastValue = bitsData[lastByteIndex] + (bitsData[lastByteIndex + 1] << 8);\n result[valuesCount - 1] = (lastValue >> lastBitShift) & 0x1F;\n\n return result;\n}\n\nexport function interpolateArray(data: number[], fitCount: number) {\n let peak = 0;\n const newData = new Array(fitCount);\n const springFactor = data.length / fitCount;\n const leftFiller = data[0];\n const rightFiller = data[data.length - 1];\n for (let i = 0; i < fitCount; i++) {\n const idx = Math.floor(i * springFactor);\n const val = ((data[idx - 1] ?? leftFiller) + (data[idx] ?? leftFiller) + (data[idx + 1] ?? rightFiller)) / 3;\n newData[i] = val;\n if (peak < val) {\n peak = val;\n }\n }\n return { data: newData, peak };\n}\n","type IWaveformProps = {\n peak: number;\n fillStyle: string;\n progressFillStyle: string;\n};\n\nconst SPIKE_WIDTH = 2;\nconst SPIKE_STEP = 4;\nconst SPIKE_RADIUS = 1;\nconst HEIGHT = 23;\n\nexport function renderWaveformToDataUri(\n spikes: number[],\n progress: number,\n {\n peak, fillStyle, progressFillStyle,\n }: IWaveformProps,\n) {\n const width = spikes.length * SPIKE_STEP;\n const height = HEIGHT;\n\n const canvas = document.createElement('canvas');\n canvas.width = width * 2;\n canvas.height = height * 2;\n canvas.style.width = `${width}px`;\n canvas.style.height = `${height}px`;\n\n const ctx = canvas.getContext('2d')!;\n ctx.scale(2, 2);\n\n spikes.forEach((item, i) => {\n ctx.globalAlpha = (i / spikes.length >= progress) ? 0.5 : 1;\n ctx.fillStyle = progress > i / spikes.length ? progressFillStyle : fillStyle;\n const spikeHeight = Math.max(2, HEIGHT * (item / Math.max(1, peak)));\n roundedRectangle(ctx, i * SPIKE_STEP, height, SPIKE_WIDTH, spikeHeight, SPIKE_RADIUS);\n ctx.fill();\n });\n\n return {\n src: canvas.toDataURL(),\n width,\n height,\n };\n}\n\nfunction roundedRectangle(\n ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, radius: number,\n) {\n if (width < 2 * radius) {\n radius = width / 2;\n }\n if (height < 2 * radius) {\n radius = height / 2;\n }\n\n ctx.beginPath();\n ctx.moveTo(x + radius, y);\n ctx.arcTo(x + width, y, x + width, y - height, radius);\n ctx.arcTo(x + width, y - height, x, y - height, radius);\n ctx.arcTo(x, y - height, x, y, radius);\n ctx.arcTo(x, y, x + width, y, radius);\n ctx.closePath();\n}\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, { FC, useCallback, memo } from '../../lib/teact/teact';\n\nimport { ApiUser, ApiChat, ApiMediaFormat } from '../../api/types';\n\nimport { IS_TEST } from '../../config';\nimport {\n getChatAvatarHash, getChatTitle, isChatPrivate,\n getUserFullName, isUserOnline, isDeletedUser, getUserColorKey,\n} from '../../modules/helpers';\nimport { getFirstLetters } from '../../util/textFormat';\nimport buildClassName from '../../util/buildClassName';\nimport renderText from './helpers/renderText';\nimport useMedia from '../../hooks/useMedia';\nimport useTransitionForMedia from '../../hooks/useTransitionForMedia';\nimport useLang from '../../hooks/useLang';\n\nimport './Avatar.scss';\n\ntype OwnProps = {\n className?: string;\n size?: 'micro' | 'tiny' | 'small' | 'medium' | 'large' | 'jumbo';\n withOnlineStatus?: boolean;\n chat?: ApiChat;\n user?: ApiUser;\n text?: string;\n isSavedMessages?: boolean;\n lastSyncTime?: number;\n onClick?: (e: ReactMouseEvent, hasPhoto: boolean) => void;\n};\n\nconst Avatar: FC = ({\n className,\n size = 'large',\n chat,\n user,\n text,\n withOnlineStatus,\n isSavedMessages,\n lastSyncTime,\n onClick,\n}) => {\n const isDeleted = user && isDeletedUser(user);\n let imageHash: string | undefined;\n\n if (!isSavedMessages && !isDeleted) {\n if (user) {\n imageHash = getChatAvatarHash(user);\n } else if (chat) {\n imageHash = getChatAvatarHash(chat);\n }\n }\n\n const dataUri = useMedia(imageHash, false, ApiMediaFormat.DataUri, lastSyncTime);\n const { shouldRenderFullMedia, transitionClassNames } = useTransitionForMedia(dataUri, 'slow');\n\n const lang = useLang();\n\n let content: string | undefined = '';\n\n if (isSavedMessages) {\n content = ;\n } else if (isDeleted) {\n content = ;\n } else if (shouldRenderFullMedia) {\n content = \"\";\n } else if (user) {\n const userFullName = getUserFullName(user);\n content = userFullName ? getFirstLetters(userFullName, 2) : undefined;\n } else if (chat) {\n const title = getChatTitle(lang, chat);\n content = title && getFirstLetters(title, isChatPrivate(chat.id) ? 2 : 1);\n } else if (text) {\n content = getFirstLetters(text, 2);\n }\n\n const isOnline = !isSavedMessages && user && isUserOnline(user);\n const fullClassName = buildClassName(\n `Avatar size-${size}`,\n className,\n `color-bg-${getUserColorKey(user || chat)}`,\n isSavedMessages && 'saved-messages',\n isDeleted && 'deleted-account',\n withOnlineStatus && isOnline && 'online',\n onClick && 'interactive',\n (!isSavedMessages && !shouldRenderFullMedia) && 'no-photo',\n );\n\n const handleClick = useCallback((e: ReactMouseEvent) => {\n if (onClick) {\n onClick(e, isSavedMessages || shouldRenderFullMedia);\n }\n }, [onClick, isSavedMessages, shouldRenderFullMedia]);\n\n const senderId = (user || chat) && (user || chat)!.id;\n\n return (\n
\n {typeof content === 'string' ? renderText(content, [size === 'jumbo' ? 'hq_emoji' : 'emoji']) : content}\n
\n );\n};\n\nexport default memo(Avatar);\n","import React, {\n FC, memo, useCallback, useEffect,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { ApiChat, ApiUser } from '../../api/types';\n\nimport {\n selectChat, selectNotifyExceptions, selectNotifySettings, selectUser,\n} from '../../modules/selectors';\nimport {\n getChatDescription, getChatLink, getHasAdminRight, isChatChannel, isChatPrivate, isUserRightBanned, selectIsChatMuted,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { pick } from '../../util/iteratees';\nimport { copyTextToClipboard } from '../../util/clipboard';\nimport { formatPhoneNumberWithCode } from '../../util/phoneNumber';\nimport useLang from '../../hooks/useLang';\n\nimport ListItem from '../ui/ListItem';\nimport Switcher from '../ui/Switcher';\n\ntype OwnProps = {\n chatOrUserId: number;\n forceShowSelf?: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat?: ApiChat;\n canInviteUsers?: boolean;\n isMuted?: boolean;\n} & Pick;\n\ntype DispatchProps = Pick;\n\nconst ChatExtra: FC = ({\n lastSyncTime,\n user,\n chat,\n forceShowSelf,\n canInviteUsers,\n isMuted,\n loadFullUser,\n showNotification,\n updateChatMutedState,\n}) => {\n const {\n id: userId,\n fullInfo,\n username,\n phoneNumber,\n isSelf,\n } = user || {};\n const { id: chatId } = chat || {};\n const lang = useLang();\n\n useEffect(() => {\n if (lastSyncTime && userId) {\n loadFullUser({ userId });\n }\n }, [loadFullUser, userId, lastSyncTime]);\n\n const handleNotificationChange = useCallback(() => {\n updateChatMutedState({ chatId, isMuted: !isMuted });\n }, [chatId, isMuted, updateChatMutedState]);\n\n if (!chat || chat.isRestricted || (isSelf && !forceShowSelf)) {\n return undefined;\n }\n\n function copy(text: string, entity: string) {\n copyTextToClipboard(text);\n showNotification({ message: `${entity} was copied` });\n }\n\n const formattedNumber = phoneNumber && formatPhoneNumberWithCode(phoneNumber);\n const link = getChatLink(chat);\n const description = (fullInfo?.bio) || getChatDescription(chat);\n\n return (\n
\n {formattedNumber && !!formattedNumber.length && (\n copy(formattedNumber, lang('Phone'))}>\n {formattedNumber}\n {lang('Phone')}\n \n )}\n {username && (\n copy(`@${username}`, lang('Username'))}\n >\n {renderText(username)}\n {lang('Username')}\n \n )}\n {description && !!description.length && (\n \n \n {renderText(description, ['br', 'links', 'emoji'])}\n \n {lang(userId ? 'UserBio' : 'Info')}\n \n )}\n {(canInviteUsers || !username) && link && (\n copy(link, lang('SetUrlPlaceholder'))}>\n
{link}
\n {lang('SetUrlPlaceholder')}\n
\n )}\n {!forceShowSelf && (\n \n {lang('Notifications')}\n \n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatOrUserId }): StateProps => {\n const { lastSyncTime } = global;\n\n const chat = chatOrUserId ? selectChat(global, chatOrUserId) : undefined;\n const user = isChatPrivate(chatOrUserId) ? selectUser(global, chatOrUserId) : undefined;\n const isMuted = chat && selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global));\n\n const canInviteUsers = chat && !user && (\n (!isChatChannel(chat) && !isUserRightBanned(chat, 'inviteUsers'))\n || getHasAdminRight(chat, 'inviteUsers')\n );\n\n return {\n lastSyncTime, chat, user, canInviteUsers, isMuted,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadFullUser', 'updateChatMutedState', 'showNotification',\n ]),\n)(ChatExtra));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\n\nimport { selectIsChatWithSelf, selectUser } from '../../modules/selectors';\nimport {\n isChatPrivate,\n isUserBot,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n isChatChannel,\n getChatTitle,\n} from '../../modules/helpers';\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\nimport renderText from './helpers/renderText';\n\nimport Avatar from './Avatar';\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nimport './DeleteChatModal.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n chat: ApiChat;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n};\n\ntype StateProps = {\n isChannel: boolean;\n isChatWithSelf?: boolean;\n isBot?: boolean;\n isPrivateChat: boolean;\n isBasicGroup: boolean;\n isSuperGroup: boolean;\n currentUserId: number | undefined;\n canDeleteForAll?: boolean;\n contactName?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst DeleteChatModal: FC = ({\n isOpen,\n chat,\n isChannel,\n isPrivateChat,\n isChatWithSelf,\n isBot,\n isBasicGroup,\n isSuperGroup,\n currentUserId,\n canDeleteForAll,\n contactName,\n onClose,\n onCloseAnimationEnd,\n leaveChannel,\n deleteHistory,\n deleteChannel,\n deleteChatUser,\n blockContact,\n}) => {\n const lang = useLang();\n const chatTitle = getChatTitle(lang, chat);\n\n const handleDeleteMessageForAll = useCallback(() => {\n deleteHistory({ chatId: chat.id, shouldDeleteForAll: true });\n\n onClose();\n }, [deleteHistory, chat.id, onClose]);\n\n const handleDeleteAndStop = useCallback(() => {\n deleteHistory({ chatId: chat.id, shouldDeleteForAll: true });\n blockContact({ contactId: chat.id, accessHash: chat.accessHash });\n\n onClose();\n }, [deleteHistory, chat.id, chat.accessHash, blockContact, onClose]);\n\n const handleDeleteChat = useCallback(() => {\n if (isPrivateChat) {\n deleteHistory({ chatId: chat.id, shouldDeleteForAll: false });\n } else if (isBasicGroup) {\n deleteChatUser({ chatId: chat.id, userId: currentUserId });\n deleteHistory({ chatId: chat.id, shouldDeleteForAll: false });\n } else if ((isChannel || isSuperGroup) && !chat.isCreator) {\n leaveChannel({ chatId: chat.id });\n } else if ((isChannel || isSuperGroup) && chat.isCreator) {\n deleteChannel({ chatId: chat.id });\n }\n onClose();\n }, [\n isPrivateChat,\n isBasicGroup,\n isChannel,\n isSuperGroup,\n currentUserId,\n chat.isCreator,\n chat.id,\n onClose,\n deleteHistory,\n deleteChatUser,\n leaveChannel,\n deleteChannel,\n ]);\n\n function renderHeader() {\n return (\n
\n \n

{lang(renderTitle())}

\n
\n );\n }\n\n function renderTitle() {\n if (isChannel && !chat.isCreator) {\n return 'LeaveChannel';\n }\n\n if (isChannel && chat.isCreator) {\n return 'ChannelDelete';\n }\n\n if (isBasicGroup || isSuperGroup) {\n return 'Group.LeaveGroup';\n }\n\n return 'DeleteChatUser';\n }\n\n function renderMessage() {\n if (isChannel && chat.isCreator) {\n return

{renderText(lang('ChatList.DeleteAndLeaveGroupConfirmation', chatTitle), ['simple_markdown'])}

;\n }\n\n if ((isChannel && !chat.isCreator) || isBasicGroup || isSuperGroup) {\n return

{renderText(lang('ChannelLeaveAlertWithName', chatTitle), ['simple_markdown'])}

;\n }\n\n return

{renderText(lang('ChatList.DeleteChatConfirmation', contactName), ['simple_markdown'])}

;\n }\n\n function renderActionText() {\n if (isChannel && !chat.isCreator) {\n return 'LeaveChannel';\n }\n if (isChannel && chat.isCreator) {\n return 'Chat.Input.Delete';\n }\n\n if (isBasicGroup || isSuperGroup) {\n return 'Group.LeaveGroup';\n }\n\n return canDeleteForAll ? 'ChatList.DeleteForCurrentUser' : 'Delete';\n }\n\n return (\n \n {renderMessage()}\n {isBot && (\n \n )}\n {canDeleteForAll && (\n \n )}\n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chat }): StateProps => {\n const isPrivateChat = isChatPrivate(chat.id);\n const isChatWithSelf = selectIsChatWithSelf(global, chat.id);\n const user = isPrivateChat && selectUser(global, getPrivateChatUserId(chat)!);\n const isBot = user && isUserBot(user) && !chat.isSupport;\n const canDeleteForAll = (isPrivateChat && !isChatWithSelf && !isBot);\n const contactName = isPrivateChat\n ? getUserFirstOrLastName(selectUser(global, getPrivateChatUserId(chat)!))\n : undefined;\n\n return {\n isPrivateChat,\n isChatWithSelf,\n isBot,\n isChannel: isChatChannel(chat),\n isBasicGroup: isChatBasicGroup(chat),\n isSuperGroup: isChatSuperGroup(chat),\n currentUserId: global.currentUserId,\n canDeleteForAll,\n contactName,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions,\n ['leaveChannel', 'deleteHistory', 'deleteChannel', 'deleteChatUser', 'blockContact']),\n)(DeleteChatModal));\n","import React, {\n FC, useCallback, useEffect, useState, memo, useRef,\n} from '../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiMessage } from '../../api/types';\n\nimport { getDocumentExtension, getDocumentHasPreview } from './helpers/documentInfo';\nimport {\n getMediaTransferState,\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n isMessageDocumentVideo,\n} from '../../modules/helpers';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport useMediaWithDownloadProgress from '../../hooks/useMediaWithDownloadProgress';\nimport useMedia from '../../hooks/useMedia';\nimport download from '../../util/download';\n\nimport File from './File';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection?: ObserveFn;\n smaller?: boolean;\n isSelected?: boolean;\n isSelectable?: boolean;\n uploadProgress?: number;\n withDate?: boolean;\n datetime?: number;\n className?: string;\n sender?: string;\n onCancelUpload?: () => void;\n onMediaClick?: () => void;\n onDateClick?: (messageId: number, chatId: number) => void;\n};\n\nconst Document: FC = ({\n message,\n observeIntersection,\n smaller,\n uploadProgress,\n withDate,\n datetime,\n className,\n sender,\n isSelected,\n isSelectable,\n onCancelUpload,\n onMediaClick,\n onDateClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const document = message.content.document!;\n const extension = getDocumentExtension(document) || '';\n const { fileName, size, timestamp } = document;\n const withMediaViewer = onMediaClick && Boolean(document.mediaType);\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const [isDownloadAllowed, setIsDownloadAllowed] = useState(false);\n const {\n mediaData, downloadProgress,\n } = useMediaWithDownloadProgress(\n getMessageMediaHash(message, 'download'), !isDownloadAllowed, undefined, undefined, undefined, true,\n );\n const {\n isUploading, isTransferring, transferProgress,\n } = getMediaTransferState(message, uploadProgress || downloadProgress, isDownloadAllowed);\n\n const hasPreview = getDocumentHasPreview(document);\n const thumbDataUri = hasPreview ? getMessageMediaThumbDataUri(message) : undefined;\n const localBlobUrl = hasPreview ? document.previewBlobUrl : undefined;\n const previewData = useMedia(getMessageMediaHash(message, 'pictogram'), !isIntersecting);\n\n const handleClick = useCallback(() => {\n if (withMediaViewer) {\n onMediaClick!();\n } else if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload();\n }\n } else {\n setIsDownloadAllowed((isAllowed) => !isAllowed);\n }\n }, [withMediaViewer, isUploading, onCancelUpload, onMediaClick]);\n\n const handleDateClick = useCallback(() => {\n onDateClick!(message.id, message.chatId);\n }, [onDateClick, message.id, message.chatId]);\n\n useEffect(() => {\n if (isDownloadAllowed && mediaData) {\n download(mediaData, fileName);\n setIsDownloadAllowed(false);\n }\n }, [fileName, mediaData, isDownloadAllowed]);\n\n return (\n \n );\n};\n\nexport default memo(Document);\n","import { RefObject } from 'react';\nimport React, { FC, memo, useRef } from '../../lib/teact/teact';\n\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useTransitionForMedia from '../../hooks/useTransitionForMedia';\nimport buildClassName from '../../util/buildClassName';\nimport { formatMediaDateTime, formatPastTimeShort } from '../../util/dateFormat';\nimport { getColorFromExtension, getFileSizeString } from './helpers/documentInfo';\nimport { getDocumentThumbnailDimensions } from './helpers/mediaDimensions';\nimport renderText from './helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport ProgressSpinner from '../ui/ProgressSpinner';\nimport Link from '../ui/Link';\n\nimport './File.scss';\n\ntype OwnProps = {\n ref?: RefObject;\n name: string;\n extension?: string;\n size: number;\n timestamp?: number;\n sender?: string;\n thumbnailDataUri?: string;\n previewData?: string;\n className?: string;\n smaller?: boolean;\n isTransferring?: boolean;\n isUploading?: boolean;\n isSelectable?: boolean;\n isSelected?: boolean;\n transferProgress?: number;\n actionIcon?: string;\n onClick?: () => void;\n onDateClick?: (e: React.MouseEvent) => void;\n};\n\nconst File: FC = ({\n ref,\n name,\n size,\n extension = '',\n timestamp,\n sender,\n thumbnailDataUri,\n previewData,\n className,\n smaller,\n isTransferring,\n isUploading,\n isSelectable,\n isSelected,\n transferProgress,\n actionIcon,\n onClick,\n onDateClick,\n}) => {\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n let elementRef = useRef(null);\n if (ref) {\n elementRef = ref;\n }\n\n const {\n shouldRender: shouldSpinnerRender,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring, undefined, true);\n const color = getColorFromExtension(extension);\n const sizeString = getFileSizeString(size);\n\n const {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(previewData, 'slow');\n const { width, height } = getDocumentThumbnailDimensions(smaller);\n\n const fullClassName = buildClassName(\n 'File',\n className,\n smaller && 'smaller',\n onClick && !isUploading && 'interactive',\n isSelected && 'file-is-selected',\n );\n\n return (\n
\n {isSelectable && (\n
\n {isSelected && }\n
\n )}\n
\n {thumbnailDataUri || previewData ? (\n
\n {shouldRenderThumb && (\n \n )}\n {shouldRenderFullMedia && (\n \n )}\n
\n ) : (\n
\n {extension.length <= 4 && (\n {extension}\n )}\n
\n )}\n {shouldSpinnerRender && (\n
\n \n
\n )}\n {onClick && (\n \n )}\n
\n
\n
{renderText(name)}
\n
\n \n {isTransferring && transferProgress ? `${Math.round(transferProgress * 100)}%` : sizeString}\n \n {sender && {renderText(sender)}}\n {!sender && timestamp && (\n <>\n {' '}\n {formatMediaDateTime(lang, timestamp * 1000)}\n \n )}\n
\n
\n {sender && timestamp && (\n {formatPastTimeShort(lang, timestamp * 1000)}\n )}\n
\n );\n};\n\nexport default memo(File);\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat, ApiTypingStatus } from '../../api/types';\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport {\n getChatTypeString,\n getChatTitle,\n isChatSuperGroup,\n} from '../../modules/helpers';\nimport { selectChat, selectChatMessages, selectChatOnlineCount } from '../../modules/selectors';\nimport renderText from './helpers/renderText';\nimport { pick } from '../../util/iteratees';\nimport useLang, { LangFn } from '../../hooks/useLang';\n\nimport Avatar from './Avatar';\nimport VerifiedIcon from './VerifiedIcon';\nimport TypingStatus from './TypingStatus';\n\ntype OwnProps = {\n chatId: number;\n typingStatus?: ApiTypingStatus;\n avatarSize?: 'small' | 'medium' | 'large' | 'jumbo';\n withMediaViewer?: boolean;\n withUsername?: boolean;\n withFullInfo?: boolean;\n withUpdatingStatus?: boolean;\n withChatType?: boolean;\n noRtl?: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n onlineCount?: number;\n areMessagesLoaded: boolean;\n} & Pick;\n\ntype DispatchProps = Pick;\n\nconst GroupChatInfo: FC = ({\n typingStatus,\n avatarSize = 'medium',\n withMediaViewer,\n withUsername,\n withFullInfo,\n withUpdatingStatus,\n withChatType,\n noRtl,\n chat,\n onlineCount,\n areMessagesLoaded,\n lastSyncTime,\n loadFullChat,\n openMediaViewer,\n}) => {\n const isSuperGroup = chat && isChatSuperGroup(chat);\n const { id: chatId, isMin, isRestricted } = chat || {};\n\n useEffect(() => {\n if (chatId && !isMin && withFullInfo && lastSyncTime) {\n loadFullChat({ chatId });\n }\n }, [chatId, isMin, lastSyncTime, withFullInfo, loadFullChat, isSuperGroup]);\n\n const handleAvatarViewerOpen = useCallback((e: ReactMouseEvent, hasPhoto: boolean) => {\n if (chat && hasPhoto) {\n e.stopPropagation();\n openMediaViewer({\n avatarOwnerId: chat.id,\n origin: avatarSize === 'jumbo' ? MediaViewerOrigin.ProfileAvatar : MediaViewerOrigin.MiddleHeaderAvatar,\n });\n }\n }, [chat, avatarSize, openMediaViewer]);\n\n const lang = useLang();\n\n if (!chat) {\n return undefined;\n }\n\n function renderStatusOrTyping() {\n if (withUpdatingStatus && !areMessagesLoaded && !isRestricted) {\n return (\n {lang('Updating')}\n );\n }\n\n if (!chat) {\n return undefined;\n }\n\n if (typingStatus) {\n return ;\n }\n\n if (withChatType) {\n return (\n
{lang(getChatTypeString(chat))}
\n );\n }\n\n const handle = withUsername ? chat.username : undefined;\n const groupStatus = getGroupStatus(lang, chat);\n const onlineStatus = onlineCount ? `, ${lang('OnlineCount', onlineCount, 'i')}` : undefined;\n\n return (\n
\n {handle && {handle}}\n {groupStatus}\n {onlineStatus && {onlineStatus}}\n
\n );\n }\n\n return (\n
\n \n
\n
\n

{renderText(getChatTitle(lang, chat))}

\n {chat.isVerified && }\n
\n {renderStatusOrTyping()}\n
\n
\n );\n};\n\nfunction getGroupStatus(lang: LangFn, chat: ApiChat) {\n const chatTypeString = lang(getChatTypeString(chat));\n const { membersCount } = chat;\n\n if (chat.isRestricted) {\n return chatTypeString === 'Channel' ? 'channel is inaccessible' : 'group is inaccessible';\n }\n\n if (!membersCount) {\n return chatTypeString;\n }\n\n return chatTypeString === 'Channel'\n ? lang('Subscribers', membersCount, 'i')\n : lang('Members', membersCount, 'i');\n}\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const { lastSyncTime } = global;\n const chat = selectChat(global, chatId);\n const onlineCount = chat ? selectChatOnlineCount(global, chat) : undefined;\n const areMessagesLoaded = Boolean(selectChatMessages(global, chatId));\n\n return {\n lastSyncTime, chat, onlineCount, areMessagesLoaded,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadFullChat', 'openMediaViewer']),\n)(GroupChatInfo));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport { ApiMessage, ApiMessageOutgoingStatus } from '../../api/types';\n\nimport { formatPastTimeShort } from '../../util/dateFormat';\nimport useLang from '../../hooks/useLang';\n\nimport MessageOutgoingStatus from './MessageOutgoingStatus';\n\nimport './LastMessageMeta.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n outgoingStatus?: ApiMessageOutgoingStatus;\n};\n\nconst LastMessageMeta: FC = ({ message, outgoingStatus }) => {\n const lang = useLang();\n return (\n
\n {outgoingStatus && (\n \n )}\n {formatPastTimeShort(lang, message.date * 1000)}\n
\n );\n};\n\nexport default memo(LastMessageMeta);\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport { ApiMessage } from '../../api/types';\n\nimport { formatMediaDuration } from '../../util/dateFormat';\nimport {\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n getMessageVideo,\n} from '../../modules/helpers';\nimport useMedia from '../../hooks/useMedia';\nimport useTransitionForMedia from '../../hooks/useTransitionForMedia';\n\nimport './Media.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n idPrefix?: string;\n onClick?: (messageId: number, chatId: number) => void;\n};\n\nconst Media: FC = ({ message, idPrefix = 'shared-media', onClick }) => {\n const handleClick = useCallback(() => {\n onClick!(message.id, message.chatId);\n }, [message.id, message.chatId, onClick]);\n\n const thumbDataUri = getMessageMediaThumbDataUri(message);\n const mediaBlobUrl = useMedia(getMessageMediaHash(message, 'pictogram'));\n const {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(mediaBlobUrl, 'slow');\n\n const video = getMessageVideo(message);\n\n return (\n
\n {shouldRenderThumb && (\n \"\"\n )}\n {shouldRenderFullMedia && (\n \"\"\n )}\n {video && {video.isGif ? 'GIF' : formatMediaDuration(video.duration)}}\n
\n );\n};\n\nexport default memo(Media);\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport { ApiMessageOutgoingStatus } from '../../api/types';\n\nimport Transition from '../ui/Transition';\n\nimport './MessageOutgoingStatus.scss';\n\ntype OwnProps = {\n status: ApiMessageOutgoingStatus;\n};\n\nenum Keys {\n failed, pending, succeeded, read,\n}\n\nconst MessageOutgoingStatus: FC = ({ status }) => {\n return (\n
\n \n {() => (\n \n )}\n \n
\n );\n};\n\nexport default memo(MessageOutgoingStatus);\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport renderText from './helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport './NothingFound.scss';\n\ninterface OwnProps {\n text?: string;\n description?: string;\n}\n\nconst DEFAULT_TEXT = 'Nothing found.';\n\nconst NothingFound: FC = ({ text = DEFAULT_TEXT, description }) => {\n const lang = useLang();\n const { transitionClassNames } = useShowTransition(true);\n\n return (\n
\n {text}\n {description &&

{renderText(lang(description), ['br'])}

}\n
\n );\n};\n\nexport default memo(NothingFound);\n","import React, {\n FC, useCallback, useRef, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport { isChatPrivate } from '../../modules/helpers';\n\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport Checkbox from '../ui/Checkbox';\nimport InputText from '../ui/InputText';\nimport ListItem from '../ui/ListItem';\nimport PrivateChatInfo from './PrivateChatInfo';\nimport GroupChatInfo from './GroupChatInfo';\nimport PickerSelectedItem from './PickerSelectedItem';\nimport useInfiniteScroll from '../../hooks/useInfiniteScroll';\nimport useLang from '../../hooks/useLang';\n\nimport Loading from '../ui/Loading';\n\nimport './Picker.scss';\n\ntype OwnProps = {\n itemIds: number[];\n selectedIds: number[];\n filterValue?: string;\n filterPlaceholder?: string;\n notFoundText?: string;\n searchInputId?: string;\n isLoading?: boolean;\n noScrollRestore?: boolean;\n onSelectedIdsChange: (ids: number[]) => void;\n onFilterChange: (value: string) => void;\n onLoadMore?: () => void;\n};\n\n// Focus slows down animation, also it breaks transition layout in Chrome\nconst FOCUS_DELAY_MS = 500;\n\nconst MAX_FULL_ITEMS = 10;\nconst ALWAYS_FULL_ITEMS_COUNT = 5;\n\nconst Picker: FC = ({\n itemIds,\n selectedIds,\n filterValue,\n filterPlaceholder,\n notFoundText,\n searchInputId,\n isLoading,\n noScrollRestore,\n onSelectedIdsChange,\n onFilterChange,\n onLoadMore,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const shouldMinimize = selectedIds.length > MAX_FULL_ITEMS;\n\n useEffect(() => {\n setTimeout(() => {\n requestAnimationFrame(() => {\n inputRef.current!.focus();\n });\n }, FOCUS_DELAY_MS);\n }, []);\n\n const handleItemClick = useCallback((id: number) => {\n const newSelectedIds = [...selectedIds];\n if (newSelectedIds.includes(id)) {\n newSelectedIds.splice(newSelectedIds.indexOf(id), 1);\n } else {\n newSelectedIds.push(id);\n }\n onSelectedIdsChange(newSelectedIds);\n onFilterChange('');\n }, [selectedIds, onSelectedIdsChange, onFilterChange]);\n\n const handleFilterChange = useCallback((e: React.ChangeEvent) => {\n const { value } = e.currentTarget;\n onFilterChange(value);\n }, [onFilterChange]);\n\n const [viewportIds, getMore] = useInfiniteScroll(onLoadMore, itemIds, Boolean(filterValue));\n\n const lang = useLang();\n\n return (\n
\n
\n {selectedIds.map((id, i) => (\n \n ))}\n \n
\n\n {viewportIds?.length ? (\n \n {viewportIds.map((id) => (\n handleItemClick(id)}\n ripple\n >\n \n {isChatPrivate(id) ? (\n \n ) : (\n \n )}\n \n ))}\n \n ) : !isLoading && viewportIds && !viewportIds.length ? (\n

{notFoundText || 'Sorry, nothing found.'}

\n ) : (\n \n )}\n
\n );\n};\n\nexport default memo(Picker);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../../api/types';\n\nimport { selectChat, selectUser } from '../../modules/selectors';\nimport { getChatTitle, getUserFirstOrLastName, isChatPrivate } from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Avatar from './Avatar';\n\nimport './PickerSelectedItem.scss';\n\ntype OwnProps = {\n chatOrUserId?: number;\n icon?: string;\n title?: string;\n isMinimized?: boolean;\n canClose?: boolean;\n onClick: (arg: any) => void;\n clickArg: any;\n className?: string;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n user?: ApiUser;\n};\n\nconst PickerSelectedItem: FC = ({\n icon,\n title,\n isMinimized,\n canClose,\n onClick,\n clickArg,\n chat,\n user,\n className,\n}) => {\n const lang = useLang();\n\n let iconElement: any;\n let titleText: any;\n\n if (icon && title) {\n iconElement = (\n
\n \n
\n );\n\n titleText = title;\n } else if (chat || user) {\n iconElement = (\n \n );\n\n const name = !chat || (user && !user.isSelf)\n ? getUserFirstOrLastName(user)\n : getChatTitle(lang, chat, user);\n\n titleText = name ? renderText(name) : undefined;\n }\n\n const fullClassName = buildClassName(\n 'PickerSelectedItem',\n className,\n isMinimized && 'minimized',\n canClose && 'closeable',\n );\n\n return (\n onClick(clickArg)}\n title={isMinimized ? titleText : undefined}\n dir={lang.isRtl ? 'rtl' : undefined}\n >\n {iconElement}\n {!isMinimized && (\n
\n {titleText}\n
\n )}\n {canClose && (\n
\n \n
\n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatOrUserId }): StateProps => {\n if (!chatOrUserId) {\n return {};\n }\n\n const chat = chatOrUserId ? selectChat(global, chatOrUserId) : undefined;\n const user = isChatPrivate(chatOrUserId) ? selectUser(global, chatOrUserId) : undefined;\n\n return {\n chat,\n user,\n };\n },\n)(PickerSelectedItem));\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiTypingStatus } from '../../api/types';\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport { selectChatMessages, selectUser } from '../../modules/selectors';\nimport { getUserFullName, getUserStatus, isUserOnline } from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport Avatar from './Avatar';\nimport VerifiedIcon from './VerifiedIcon';\nimport TypingStatus from './TypingStatus';\n\ntype OwnProps = {\n userId: number;\n typingStatus?: ApiTypingStatus;\n avatarSize?: 'tiny' | 'small' | 'medium' | 'large' | 'jumbo';\n forceShowSelf?: boolean;\n status?: string;\n withMediaViewer?: boolean;\n withUsername?: boolean;\n withFullInfo?: boolean;\n withUpdatingStatus?: boolean;\n noStatusOrTyping?: boolean;\n noRtl?: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n isSavedMessages?: boolean;\n areMessagesLoaded: boolean;\n serverTimeOffset: number;\n} & Pick;\n\ntype DispatchProps = Pick;\n\nconst PrivateChatInfo: FC = ({\n typingStatus,\n avatarSize = 'medium',\n status,\n withMediaViewer,\n withUsername,\n withFullInfo,\n withUpdatingStatus,\n noStatusOrTyping,\n noRtl,\n user,\n isSavedMessages,\n areMessagesLoaded,\n lastSyncTime,\n loadFullUser,\n openMediaViewer,\n serverTimeOffset,\n}) => {\n const { id: userId } = user || {};\n const fullName = getUserFullName(user);\n\n useEffect(() => {\n if (withFullInfo && lastSyncTime && userId) {\n loadFullUser({ userId });\n }\n }, [userId, loadFullUser, lastSyncTime, withFullInfo]);\n\n const handleAvatarViewerOpen = useCallback((e: ReactMouseEvent, hasPhoto: boolean) => {\n if (user && hasPhoto) {\n e.stopPropagation();\n openMediaViewer({\n avatarOwnerId: user.id,\n origin: avatarSize === 'jumbo' ? MediaViewerOrigin.ProfileAvatar : MediaViewerOrigin.MiddleHeaderAvatar,\n });\n }\n }, [user, avatarSize, openMediaViewer]);\n\n const lang = useLang();\n\n if (!user) {\n return undefined;\n }\n\n function renderStatusOrTyping() {\n if (status) {\n return (\n {status}\n );\n }\n\n if (withUpdatingStatus && !areMessagesLoaded) {\n return (\n {lang('Updating')}\n );\n }\n\n if (!user) {\n return undefined;\n }\n\n if (typingStatus) {\n return ;\n }\n\n return (\n
\n {withUsername && user.username && {user.username}}\n {getUserStatus(lang, user, serverTimeOffset)}\n
\n );\n }\n\n return (\n
\n \n
\n {isSavedMessages ? (\n
\n

{lang('SavedMessages')}

\n
\n ) : (\n
\n

{fullName && renderText(fullName)}

\n {user?.isVerified && }\n
\n )}\n {(status || (!isSavedMessages && !noStatusOrTyping)) && renderStatusOrTyping()}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { userId, forceShowSelf }): StateProps => {\n const { lastSyncTime, serverTimeOffset } = global;\n const user = selectUser(global, userId);\n const isSavedMessages = !forceShowSelf && user && user.isSelf;\n const areMessagesLoaded = Boolean(selectChatMessages(global, userId));\n\n return {\n lastSyncTime, user, isSavedMessages, areMessagesLoaded, serverTimeOffset,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadFullUser', 'openMediaViewer']),\n)(PrivateChatInfo));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport {\n ApiUser, ApiChat, ApiMediaFormat, ApiPhoto,\n} from '../../api/types';\n\nimport {\n getChatAvatarHash, isDeletedUser, getUserColorKey, getChatTitle, isChatPrivate, getUserFullName,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport buildClassName from '../../util/buildClassName';\nimport { getFirstLetters } from '../../util/textFormat';\nimport useMedia from '../../hooks/useMedia';\nimport useBlurSync from '../../hooks/useBlurSync';\nimport usePrevious from '../../hooks/usePrevious';\nimport useLang from '../../hooks/useLang';\n\nimport Spinner from '../ui/Spinner';\n\nimport './ProfilePhoto.scss';\n\ntype OwnProps = {\n chat?: ApiChat;\n user?: ApiUser;\n isFirstPhoto?: boolean;\n isSavedMessages?: boolean;\n photo?: ApiPhoto;\n lastSyncTime?: number;\n onClick: NoneToVoidFunction;\n};\n\nconst ProfilePhoto: FC = ({\n chat,\n user,\n photo,\n isFirstPhoto,\n isSavedMessages,\n lastSyncTime,\n onClick,\n}) => {\n const lang = useLang();\n const isDeleted = user && isDeletedUser(user);\n\n function getMediaHash(size: 'normal' | 'big' = 'big', forceAvatar?: boolean) {\n if (photo && !forceAvatar) {\n return `photo${photo.id}?size=c`;\n }\n\n let hash: string | undefined;\n if (!isSavedMessages && !isDeleted) {\n if (user) {\n hash = getChatAvatarHash(user, size);\n } else if (chat) {\n hash = getChatAvatarHash(chat, size);\n }\n }\n\n return hash;\n }\n\n const imageHash = getMediaHash();\n const fullMediaData = useMedia(\n imageHash,\n false,\n imageHash?.startsWith('avatar') ? ApiMediaFormat.DataUri : ApiMediaFormat.BlobUrl,\n lastSyncTime,\n );\n const avatarThumbnailData = useMedia(\n !fullMediaData && isFirstPhoto ? getMediaHash('normal', true) : undefined,\n false,\n ApiMediaFormat.DataUri,\n lastSyncTime,\n );\n const thumbDataUri = useBlurSync(!fullMediaData && photo && photo.thumbnail && photo.thumbnail.dataUri);\n const imageSrc = fullMediaData || avatarThumbnailData || thumbDataUri;\n const prevImageSrc = usePrevious(imageSrc);\n\n let content: string | undefined = '';\n\n if (isSavedMessages) {\n content = ;\n } else if (isDeleted) {\n content = ;\n } else if (imageSrc) {\n content = \"\";\n } else if (!imageSrc && user) {\n const userFullName = getUserFullName(user);\n content = userFullName ? getFirstLetters(userFullName, 2) : undefined;\n } else if (!imageSrc && chat) {\n const title = getChatTitle(lang, chat);\n content = title && getFirstLetters(title, isChatPrivate(chat.id) ? 2 : 1);\n } else {\n content = (\n
\n \n
\n );\n }\n\n const fullClassName = buildClassName(\n 'ProfilePhoto',\n `color-bg-${getUserColorKey(user || chat)}`,\n isSavedMessages && 'saved-messages',\n isDeleted && 'deleted-account',\n (!isSavedMessages && !(imageSrc)) && 'no-photo',\n );\n\n return (\n
\n {prevImageSrc && imageSrc && prevImageSrc !== imageSrc && (\n \"\"\n )}\n {typeof content === 'string' ? renderText(content, ['hq_emoji']) : content}\n
\n );\n};\n\nexport default memo(ProfilePhoto);\n","import React, {\n FC, useEffect, useCallback, memo, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiChat } from '../../api/types';\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport { selectChat, selectUser } from '../../modules/selectors';\nimport {\n getUserFullName, getUserStatus, isChatChannel, isUserOnline,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { pick } from '../../util/iteratees';\nimport { captureEvents, SwipeDirection } from '../../util/captureEvents';\nimport buildClassName from '../../util/buildClassName';\nimport usePhotosPreload from './hooks/usePhotosPreload';\nimport useLang from '../../hooks/useLang';\n\nimport VerifiedIcon from './VerifiedIcon';\nimport ProfilePhoto from './ProfilePhoto';\nimport Transition from '../ui/Transition';\n\nimport './ProfileInfo.scss';\n\ntype OwnProps = {\n userId: number;\n forceShowSelf?: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat?: ApiChat;\n isSavedMessages?: boolean;\n animationLevel: 0 | 1 | 2;\n serverTimeOffset: number;\n} & Pick;\n\ntype DispatchProps = Pick;\n\nconst ProfileInfo: FC = ({\n forceShowSelf,\n user,\n chat,\n isSavedMessages,\n connectionState,\n animationLevel,\n loadFullUser,\n openMediaViewer,\n serverTimeOffset,\n}) => {\n const { id: userId } = user || {};\n const { id: chatId } = chat || {};\n const fullName = user ? getUserFullName(user) : (chat ? chat.title : '');\n const photos = user?.photos || chat?.photos || [];\n const slideAnimation = animationLevel >= 1 ? 'slide' : 'none';\n\n const [currentPhotoIndex, setCurrentPhotoIndex] = useState(0);\n const isFirst = isSavedMessages || photos.length <= 1 || currentPhotoIndex === 0;\n const isLast = isSavedMessages || photos.length <= 1 || currentPhotoIndex === photos.length - 1;\n\n // Deleting the last profile photo may result in an error\n useEffect(() => {\n if (currentPhotoIndex > photos.length) {\n setCurrentPhotoIndex(Math.max(0, photos.length - 1));\n }\n }, [currentPhotoIndex, photos.length]);\n\n const lang = useLang();\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady' && userId && !forceShowSelf) {\n loadFullUser({ userId });\n }\n }, [userId, loadFullUser, connectionState, forceShowSelf]);\n\n usePhotosPreload(user || chat, photos, currentPhotoIndex);\n\n const handleProfilePhotoClick = useCallback(() => {\n openMediaViewer({\n avatarOwnerId: userId || chatId,\n profilePhotoIndex: currentPhotoIndex,\n origin: forceShowSelf ? MediaViewerOrigin.SettingsAvatar : MediaViewerOrigin.ProfileAvatar,\n });\n }, [openMediaViewer, userId, chatId, currentPhotoIndex, forceShowSelf]);\n\n const selectPreviousMedia = useCallback(() => {\n if (isFirst) {\n return;\n }\n\n setCurrentPhotoIndex(currentPhotoIndex - 1);\n }, [currentPhotoIndex, isFirst]);\n\n const selectNextMedia = useCallback(() => {\n if (isLast) {\n return;\n }\n\n setCurrentPhotoIndex(currentPhotoIndex + 1);\n }, [currentPhotoIndex, isLast]);\n\n // Support for swipe gestures and closing on click\n useEffect(() => {\n const element = document.querySelector('.photo-wrapper');\n if (!element) {\n return undefined;\n }\n\n return captureEvents(element, {\n selectorToPreventScroll: '.Profile, .settings-content',\n onSwipe: IS_TOUCH_ENV ? (e, direction) => {\n if (direction === SwipeDirection.Right) {\n selectPreviousMedia();\n return true;\n } else if (direction === SwipeDirection.Left) {\n selectNextMedia();\n return true;\n }\n\n return false;\n } : undefined,\n });\n }, [selectNextMedia, selectPreviousMedia]);\n\n if (!user && !chat) {\n return undefined;\n }\n\n function renderPhotoTabs() {\n if (isSavedMessages || !photos || photos.length <= 1) {\n return undefined;\n }\n\n return (\n
\n {photos.map((_, i) => (\n \n ))}\n
\n );\n }\n\n function renderPhoto() {\n const photo = !isSavedMessages && photos && photos.length > 0 ? photos[currentPhotoIndex] : undefined;\n\n return (\n \n );\n }\n\n function renderStatus() {\n if (user) {\n return (\n
\n {getUserStatus(lang, user, serverTimeOffset)}\n
\n );\n }\n\n return (\n {\n isChatChannel(chat!)\n ? lang('Subscribers', chat!.membersCount ?? 0, 'i')\n : lang('Members', chat!.membersCount ?? 0, 'i')\n }\n \n );\n }\n\n const isVerifiedIconShown = (user || chat)?.isVerified;\n\n return (\n
\n
\n {renderPhotoTabs()}\n \n {renderPhoto}\n \n\n {!isFirst && (\n \n )}\n {!isLast && (\n \n )}\n
\n\n
\n {isSavedMessages ? (\n
\n

{lang('SavedMessages')}

\n
\n ) : (\n
\n

{fullName && renderText(fullName)}

\n {isVerifiedIconShown && }\n
\n )}\n {!isSavedMessages && renderStatus()}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { userId, forceShowSelf }): StateProps => {\n const { connectionState, serverTimeOffset } = global;\n const user = selectUser(global, userId);\n const chat = selectChat(global, userId);\n const isSavedMessages = !forceShowSelf && user && user.isSelf;\n const { animationLevel } = global.settings.byKey;\n\n return {\n connectionState, user, chat, isSavedMessages, animationLevel, serverTimeOffset,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadFullUser', 'openMediaViewer']),\n)(ProfileInfo));\n","import {\n ApiChat, ApiMediaFormat, ApiPhoto, ApiUser,\n} from '../../../api/types';\nimport { useEffect } from '../../../lib/teact/teact';\nimport * as mediaLoader from '../../../util/mediaLoader';\n\nconst PHOTOS_TO_PRELOAD = 4;\n\nexport default function usePhotosPreload(\n profile: ApiUser | ApiChat | undefined,\n photos: ApiPhoto[],\n currentIndex: number,\n) {\n useEffect(() => {\n photos.slice(currentIndex, currentIndex + PHOTOS_TO_PRELOAD).forEach((photo) => {\n const mediaData = mediaLoader.getFromMemory(`photo${photo.id}?size=c`);\n if (!mediaData) {\n mediaLoader.fetch(`photo${photo.id}?size=c`, ApiMediaFormat.BlobUrl);\n }\n });\n }, [currentIndex, photos]);\n}\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC, memo, useEffect, useRef,\n} from '../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiSticker } from '../../api/types';\n\nimport { useIsIntersecting, ObserveFn } from '../../hooks/useIntersectionObserver';\nimport useMedia from '../../hooks/useMedia';\nimport useTransitionForMedia from '../../hooks/useTransitionForMedia';\nimport useFlag from '../../hooks/useFlag';\nimport buildClassName from '../../util/buildClassName';\nimport { preventMessageInputBlurWithBubbling } from '../middle/helpers/preventMessageInputBlur';\n\nimport AnimatedSticker from './AnimatedSticker';\nimport Button from '../ui/Button';\n\nimport './StickerButton.scss';\n\ntype OwnProps = {\n sticker: ApiSticker;\n size: number;\n observeIntersection: ObserveFn;\n noAnimate?: boolean;\n title?: string;\n className?: string;\n onClick?: (arg: any) => void;\n clickArg?: any;\n onUnfaveClick?: (sticker: ApiSticker) => void;\n};\n\nconst StickerButton: FC = ({\n sticker, size, observeIntersection, noAnimate, title, className, onClick, clickArg, onUnfaveClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const localMediaHash = `sticker${sticker.id}`;\n const stickerSelector = `sticker-button-${sticker.id}`;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const thumbDataUri = sticker.thumbnail ? sticker.thumbnail.dataUri : undefined;\n const previewBlobUrl = useMedia(`${localMediaHash}?size=m`, !isIntersecting, ApiMediaFormat.BlobUrl);\n\n const shouldPlay = isIntersecting && !noAnimate;\n const lottieData = useMedia(sticker.isAnimated && localMediaHash, !shouldPlay, ApiMediaFormat.Lottie);\n const [isAnimationLoaded, markLoaded, unmarkLoaded] = useFlag(Boolean(lottieData));\n const canAnimatedPlay = isAnimationLoaded && shouldPlay;\n\n const {\n shouldRenderThumb,\n shouldRenderFullMedia: shouldRenderPreview,\n transitionClassNames: previewTransitionClassNames,\n } = useTransitionForMedia(previewBlobUrl || canAnimatedPlay, 'slow');\n\n // To avoid flickering\n useEffect(() => {\n if (!shouldPlay) {\n unmarkLoaded();\n }\n }, [unmarkLoaded, shouldPlay]);\n\n function handleClick() {\n if (onClick) {\n onClick(clickArg);\n }\n }\n\n function handleUnfaveClick(e: ReactMouseEvent) {\n e.stopPropagation();\n e.preventDefault();\n\n onUnfaveClick!(sticker);\n }\n\n const fullClassName = buildClassName(\n 'StickerButton',\n sticker.isAnimated && 'animated',\n stickerSelector,\n className,\n );\n\n const style = shouldRenderThumb && thumbDataUri ? `background-image: url('${thumbDataUri}');` : '';\n\n return (\n \n {shouldRenderPreview && !canAnimatedPlay && (\n // eslint-disable-next-line jsx-a11y/alt-text\n \n )}\n {shouldPlay && lottieData && (\n \n )}\n {onUnfaveClick && (\n \n \n \n )}\n
\n );\n};\n\nexport default memo(StickerButton);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './StickerSetModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst StickerSetModalAsync: FC = (props) => {\n const { isOpen } = props;\n const StickerSetModal = useModuleLoader(Bundles.Extra, 'StickerSetModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return StickerSetModal ? : undefined;\n};\n\nexport default memo(StickerSetModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiTypingStatus } from '../../api/types';\n\nimport { selectUser } from '../../modules/selectors';\nimport { getUserFirstOrLastName } from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport './TypingStatus.scss';\n\ntype OwnProps = {\n typingStatus: ApiTypingStatus;\n};\n\ntype StateProps = {\n typingUser?: ApiUser;\n};\n\nconst TypingStatus: FC = ({ typingStatus, typingUser }) => {\n const lang = useLang();\n const typingUserName = typingUser && !typingUser.isSelf && getUserFirstOrLastName(typingUser);\n\n return (\n

\n {typingUserName && (\n {renderText(typingUserName)}\n )}\n {/* fix for translation \"username _is_ typing\" */}\n {lang(typingStatus.action).replace('{user}', '').trim()}\n \n

\n );\n};\n\nexport default memo(withGlobal(\n (global, { typingStatus }): StateProps => {\n if (!typingStatus.userId) {\n return {};\n }\n\n const typingUser = selectUser(global, typingStatus.userId);\n\n return { typingUser };\n },\n)(TypingStatus));\n","import React, { FC } from '../../lib/teact/teact';\n\nimport './VerifiedIcon.scss';\n\nconst VerifiedIcon: FC = () => {\n return (\n \n );\n};\n\nexport default VerifiedIcon;\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport { ApiMessage, ApiWebPage } from '../../api/types';\n\nimport { getFirstLinkInMessage, getMessageSummaryText, getMessageWebPage } from '../../modules/helpers';\nimport buildClassName from '../../util/buildClassName';\nimport trimText from '../../util/trimText';\nimport renderText from './helpers/renderText';\nimport { formatPastTimeShort } from '../../util/dateFormat';\nimport useLang from '../../hooks/useLang';\n\nimport Media from './Media';\nimport Link from '../ui/Link';\nimport SafeLink from './SafeLink';\n\nimport './WebLink.scss';\n\nconst MAX_TEXT_LENGTH = 170; // symbols\n\ntype OwnProps = {\n message: ApiMessage;\n senderTitle?: string;\n onMessageClick: (messageId: number, chatId: number) => void;\n};\n\nconst WebLink: FC = ({ message, senderTitle, onMessageClick }) => {\n const lang = useLang();\n\n let linkData: ApiWebPage | undefined = getMessageWebPage(message);\n\n if (!linkData) {\n const link = getFirstLinkInMessage(message);\n if (link) {\n const { url, domain } = link;\n const messageText = getMessageSummaryText(lang, message);\n\n linkData = {\n siteName: domain.replace(/^www./, ''),\n url: url.includes('://') ? url : url.includes('@') ? `mailto:${url}` : `http://${url}`,\n description: messageText !== url ? messageText : undefined,\n } as ApiWebPage;\n }\n }\n\n const handleMessageClick = useCallback(() => {\n onMessageClick(message.id, message.chatId);\n }, [onMessageClick, message.id, message.chatId]);\n\n if (!linkData) {\n return undefined;\n }\n\n const {\n siteName,\n url,\n displayUrl,\n title,\n description,\n photo,\n video,\n } = linkData;\n\n const truncatedDescription = !senderTitle && trimText(description, MAX_TEXT_LENGTH);\n\n const className = buildClassName(\n 'WebLink scroll-item',\n (!photo && !video) && 'without-media',\n );\n\n return (\n \n {photo && (\n \n )}\n
\n \n {renderText(title || siteName || displayUrl)}\n \n {truncatedDescription && (\n \n {renderText(truncatedDescription)}\n \n )}\n \n {url.replace('mailto:', '') || displayUrl}\n \n {senderTitle &&
{renderText(senderTitle)}
}\n
\n {senderTitle && (\n
\n \n {formatPastTimeShort(lang, message.date * 1000)}\n \n
\n )}\n
\n );\n};\n\nexport default memo(WebLink);\n","import {\n ApiPhoto, ApiVideo, ApiSticker, ApiDimensions,\n} from '../../../api/types';\n\nimport { STICKER_SIZE_INLINE_DESKTOP_FACTOR, STICKER_SIZE_INLINE_MOBILE_FACTOR } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport windowSize from '../../../util/windowSize';\nimport { getPhotoInlineDimensions, getVideoDimensions } from '../../../modules/helpers';\n\nexport const MEDIA_VIEWER_MEDIA_QUERY = '(max-height: 640px)';\nexport const REM = parseInt(getComputedStyle(document.documentElement).fontSize, 10);\nexport const ROUND_VIDEO_DIMENSIONS = 200;\nexport const AVATAR_FULL_DIMENSIONS = { width: 640, height: 640 };\nexport const LIKE_STICKER_ID = '1258816259753933';\n\nconst DEFAULT_MEDIA_DIMENSIONS: ApiDimensions = { width: 100, height: 100 };\nconst MOBILE_SCREEN_NO_AVATARS_MESSAGE_EXTRA_WIDTH_REM = 4.5;\nconst MOBILE_SCREEN_MESSAGE_EXTRA_WIDTH_REM = 7;\nconst MESSAGE_MAX_WIDTH_REM = 29;\nconst MESSAGE_OWN_MAX_WIDTH_REM = 30;\n\nlet cachedMaxWidthOwn: number | undefined;\nlet cachedMaxWidth: number | undefined;\nlet cachedMaxWidthNoAvatar: number | undefined;\n\nfunction getMaxMessageWidthRem(fromOwnMessage: boolean, noAvatars?: boolean) {\n const regularMaxWidth = fromOwnMessage ? MESSAGE_OWN_MAX_WIDTH_REM : MESSAGE_MAX_WIDTH_REM;\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n return regularMaxWidth;\n }\n\n const { width: windowWidth } = windowSize.get();\n\n // @optimization Limitation: changing device screen width not supported\n if (!cachedMaxWidthOwn) {\n cachedMaxWidthOwn = Math.min(\n MESSAGE_OWN_MAX_WIDTH_REM,\n windowWidth / REM - MOBILE_SCREEN_NO_AVATARS_MESSAGE_EXTRA_WIDTH_REM,\n );\n }\n if (!cachedMaxWidth) {\n cachedMaxWidth = Math.min(\n MESSAGE_MAX_WIDTH_REM,\n windowWidth / REM - MOBILE_SCREEN_MESSAGE_EXTRA_WIDTH_REM,\n );\n }\n if (!cachedMaxWidthNoAvatar) {\n cachedMaxWidthNoAvatar = Math.min(\n MESSAGE_MAX_WIDTH_REM,\n windowWidth / REM - MOBILE_SCREEN_NO_AVATARS_MESSAGE_EXTRA_WIDTH_REM,\n );\n }\n\n return fromOwnMessage\n ? cachedMaxWidthOwn\n : (noAvatars ? cachedMaxWidthNoAvatar : cachedMaxWidth);\n}\n\nexport function getAvailableWidth(\n fromOwnMessage: boolean,\n isForwarded?: boolean,\n isWebPagePhoto?: boolean,\n noAvatars?: boolean,\n) {\n const extraPaddingRem = isForwarded || isWebPagePhoto ? 1.625 : 0;\n const availableWidthRem = getMaxMessageWidthRem(fromOwnMessage, noAvatars) - extraPaddingRem;\n\n return availableWidthRem * REM;\n}\n\nfunction getAvailableHeight(isGif?: boolean, aspectRatio?: number) {\n if (\n isGif && aspectRatio\n && aspectRatio >= 0.75 && aspectRatio <= 1.25\n ) {\n return 20 * REM;\n }\n\n return 27 * REM;\n}\n\nfunction calculateDimensionsForMessageMedia({\n width,\n height,\n fromOwnMessage,\n isForwarded,\n isWebPagePhoto,\n isGif,\n noAvatars,\n}: {\n width: number;\n height: number;\n fromOwnMessage: boolean;\n isForwarded?: boolean;\n isWebPagePhoto?: boolean;\n isGif?: boolean;\n noAvatars?: boolean;\n}): ApiDimensions {\n const aspectRatio = height / width;\n const availableWidth = getAvailableWidth(fromOwnMessage, isForwarded, isWebPagePhoto, noAvatars);\n const availableHeight = getAvailableHeight(isGif, aspectRatio);\n\n return calculateDimensions(availableWidth, availableHeight, width, height);\n}\n\nexport function getMediaViewerAvailableDimensions(withFooter: boolean, isVideo: boolean): ApiDimensions {\n const mql = window.matchMedia(MEDIA_VIEWER_MEDIA_QUERY);\n const { width: windowWidth, height: windowHeight } = windowSize.get();\n let occupiedHeightRem = isVideo && mql.matches ? 10 : 8.25;\n if (withFooter) {\n occupiedHeightRem = mql.matches ? 10 : 15;\n }\n\n return {\n width: windowWidth,\n height: windowHeight - occupiedHeightRem * REM,\n };\n}\n\nexport function calculateInlineImageDimensions(\n photo: ApiPhoto,\n fromOwnMessage: boolean,\n isForwarded?: boolean,\n isWebPagePhoto?: boolean,\n noAvatars?: boolean,\n) {\n const { width, height } = getPhotoInlineDimensions(photo) || DEFAULT_MEDIA_DIMENSIONS;\n\n return calculateDimensionsForMessageMedia({\n width,\n height,\n fromOwnMessage,\n isForwarded,\n isWebPagePhoto,\n noAvatars,\n });\n}\n\nexport function calculateVideoDimensions(\n video: ApiVideo,\n fromOwnMessage: boolean,\n isForwarded?: boolean,\n noAvatars?: boolean,\n) {\n const { width, height } = getVideoDimensions(video) || DEFAULT_MEDIA_DIMENSIONS;\n\n return calculateDimensionsForMessageMedia({\n width,\n height,\n fromOwnMessage,\n isForwarded,\n isGif: video.isGif,\n noAvatars,\n });\n}\n\nexport function getPictogramDimensions(): ApiDimensions {\n return {\n width: 2 * REM,\n height: 2 * REM,\n };\n}\n\nexport function getDocumentThumbnailDimensions(smaller?: boolean): ApiDimensions {\n if (smaller) {\n return {\n width: 3 * REM,\n height: 3 * REM,\n };\n }\n\n return {\n width: 3.375 * REM,\n height: 3.375 * REM,\n };\n}\n\nexport function getStickerDimensions(sticker: ApiSticker): ApiDimensions {\n const { width } = sticker;\n let { height } = sticker;\n\n // For some reason this sticker has some weird `height` value\n if (sticker.id === LIKE_STICKER_ID) {\n height = width;\n }\n\n const aspectRatio = (height && width) && height / width;\n const baseWidth = REM * (\n IS_SINGLE_COLUMN_LAYOUT\n ? STICKER_SIZE_INLINE_MOBILE_FACTOR\n : STICKER_SIZE_INLINE_DESKTOP_FACTOR\n );\n const calculatedHeight = aspectRatio ? baseWidth * aspectRatio : baseWidth;\n\n if (aspectRatio && calculatedHeight > baseWidth) {\n return {\n width: Math.round(baseWidth / aspectRatio),\n height: baseWidth,\n };\n }\n\n return {\n width: baseWidth,\n height: calculatedHeight,\n };\n}\n\nexport function calculateMediaViewerDimensions(\n { width, height }: ApiDimensions, withFooter: boolean, isVideo: boolean = false,\n): ApiDimensions {\n const { width: availableWidth, height: availableHeight } = getMediaViewerAvailableDimensions(withFooter, isVideo);\n\n return calculateDimensions(availableWidth, availableHeight, width, height);\n}\n\nexport function calculateDimensions(\n availableWidth: number,\n availableHeight: number,\n mediaWidth: number,\n mediaHeight: number,\n): ApiDimensions {\n const aspectRatio = mediaHeight / mediaWidth;\n const calculatedWidth = Math.min(mediaWidth, availableWidth);\n const calculatedHeight = Math.round(calculatedWidth * aspectRatio);\n\n if (calculatedHeight > availableHeight) {\n return {\n width: Math.round(availableHeight / aspectRatio),\n height: availableHeight,\n };\n }\n\n return {\n width: calculatedWidth,\n height: Math.round(calculatedWidth * aspectRatio),\n };\n}\n","import { MouseEvent } from 'react';\nimport React from '../../../lib/teact/teact';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { ApiMessageEntity, ApiMessageEntityTypes, ApiMessage } from '../../../api/types';\n\nimport { getMessageText } from '../../../modules/helpers';\nimport renderText from './renderText';\n\nimport MentionLink from '../../middle/message/MentionLink';\nimport SafeLink from '../SafeLink';\n\nexport type TextPart = string | Element;\n\nexport function renderMessageText(message: ApiMessage, highlight?: string, shouldRenderHqEmoji?: boolean) {\n const formattedText = message.content.text;\n\n if (!formattedText || !formattedText.text) {\n const rawText = getMessageText(message);\n return rawText ? [rawText] : undefined;\n }\n const { text, entities } = formattedText;\n\n return renderTextWithEntities(text, entities, highlight, shouldRenderHqEmoji);\n}\n\ninterface IOrganizedEntity {\n entity: ApiMessageEntity;\n organizedIndexes: Set;\n nestedEntities: IOrganizedEntity[];\n}\n\nfunction organizeEntity(\n entity: ApiMessageEntity,\n index: number,\n entities: ApiMessageEntity[],\n organizedEntityIndexes: Set,\n): IOrganizedEntity | undefined {\n const { offset, length } = entity;\n const organizedIndexes = new Set([index]);\n\n if (organizedEntityIndexes.has(index)) {\n return undefined;\n }\n\n // Determine any nested entities inside current entity\n const nestedEntities: IOrganizedEntity[] = [];\n const parsedNestedEntities = entities\n .filter((e, i) => i > index && e.offset >= offset && e.offset < offset + length)\n .map((e) => organizeEntity(e, entities.indexOf(e), entities, organizedEntityIndexes))\n .filter(Boolean as any);\n\n parsedNestedEntities.forEach((parsedEntity) => {\n let isChanged = false;\n\n parsedEntity.organizedIndexes.forEach((organizedIndex) => {\n if (!isChanged && !organizedIndexes.has(organizedIndex)) {\n isChanged = true;\n }\n\n organizedIndexes.add(organizedIndex);\n });\n\n if (isChanged) {\n nestedEntities.push(parsedEntity);\n }\n });\n\n return {\n entity,\n organizedIndexes,\n nestedEntities,\n };\n}\n\n// Organize entities in a tree-like structure to better represent how the text will be displayed\nfunction organizeEntities(entities: ApiMessageEntity[]) {\n const organizedEntityIndexes: Set = new Set();\n const organizedEntities: IOrganizedEntity[] = [];\n\n entities.forEach((entity, index) => {\n if (organizedEntityIndexes.has(index)) {\n return;\n }\n\n const organizedEntity = organizeEntity(entity, index, entities, organizedEntityIndexes);\n if (organizedEntity) {\n organizedEntity.organizedIndexes.forEach((organizedIndex) => {\n organizedEntityIndexes.add(organizedIndex);\n });\n\n organizedEntities.push(organizedEntity);\n }\n });\n\n return organizedEntities;\n}\n\nexport function renderTextWithEntities(\n text: string,\n entities?: ApiMessageEntity[],\n highlight?: string,\n shouldRenderHqEmoji?: boolean,\n shouldRenderAsHtml?: boolean,\n) {\n if (!entities || !entities.length) {\n return renderMessagePart(text, highlight, shouldRenderHqEmoji, shouldRenderAsHtml);\n }\n\n const result: TextPart[] = [];\n let deleteLineBreakAfterPre = false;\n\n const organizedEntities = organizeEntities(entities);\n\n // Recursive function to render regular and nested entities\n function renderEntity(\n textPartStart: number,\n textPartEnd: number,\n organizedEntity: IOrganizedEntity,\n isLastEntity: boolean,\n ) {\n const renderResult: TextPart[] = [];\n const { entity, nestedEntities } = organizedEntity;\n const { offset, length, type } = entity;\n\n // Render text before the entity\n let textBefore = text.substring(textPartStart, offset);\n const textBeforeLength = textBefore.length;\n if (textBefore) {\n if (deleteLineBreakAfterPre && textBefore.length > 0 && textBefore[0] === '\\n') {\n textBefore = textBefore.substr(1);\n deleteLineBreakAfterPre = false;\n }\n if (textBefore) {\n renderResult.push(...renderMessagePart(\n textBefore, highlight, shouldRenderHqEmoji, shouldRenderAsHtml,\n ) as TextPart[]);\n }\n }\n\n const entityStartIndex = textPartStart + textBeforeLength;\n const entityEndIndex = entityStartIndex + length;\n\n let entityContent: TextPart = text.substring(offset, offset + length);\n const nestedEntityContent: TextPart[] = [];\n\n if (deleteLineBreakAfterPre && entityContent.length > 0 && entityContent[0] === '\\n') {\n entityContent = entityContent.substr(1);\n deleteLineBreakAfterPre = false;\n }\n\n if (type === ApiMessageEntityTypes.Pre) {\n deleteLineBreakAfterPre = true;\n }\n\n // Render nested entities, if any\n if (nestedEntities.length) {\n let nestedIndex = entityStartIndex;\n\n nestedEntities.forEach((nestedEntity, nestedEntityIndex) => {\n const {\n renderResult: nestedResult,\n entityEndIndex: nestedEntityEndIndex,\n } = renderEntity(\n nestedIndex,\n entityEndIndex,\n nestedEntity,\n nestedEntityIndex === nestedEntities.length - 1,\n );\n\n nestedEntityContent.push(...nestedResult);\n nestedIndex = nestedEntityEndIndex;\n });\n }\n\n // Render the entity itself\n const newEntity = shouldRenderAsHtml\n ? processEntityAsHtml(entity, entityContent, nestedEntityContent)\n : processEntity(entity, entityContent, nestedEntityContent);\n\n if (Array.isArray(newEntity)) {\n renderResult.push(...newEntity);\n } else {\n renderResult.push(newEntity);\n }\n\n // Render text after the entity, if it is the last entity in the text,\n // or the last nested entity inside of another entity\n if (isLastEntity && entityEndIndex < textPartEnd) {\n let textAfter = text.substring(entityEndIndex, textPartEnd);\n if (deleteLineBreakAfterPre && textAfter.length > 0 && textAfter[0] === '\\n') {\n textAfter = textAfter.substring(1);\n }\n if (textAfter) {\n renderResult.push(...renderMessagePart(\n textAfter, highlight, shouldRenderHqEmoji, shouldRenderAsHtml,\n ) as TextPart[]);\n }\n }\n\n return {\n renderResult,\n entityEndIndex,\n };\n }\n\n // Process highest-level entities\n let index = 0;\n\n organizedEntities.forEach((entity, arrayIndex) => {\n const { renderResult, entityEndIndex } = renderEntity(\n index,\n text.length,\n entity,\n arrayIndex === organizedEntities.length - 1,\n );\n\n result.push(...renderResult);\n index = entityEndIndex;\n });\n\n return result;\n}\n\nfunction processEntity(\n entity: ApiMessageEntity,\n entityContent: TextPart,\n nestedEntityContent: TextPart[],\n) {\n const entityText = typeof entityContent === 'string' && entityContent;\n const renderedContent = nestedEntityContent.length ? nestedEntityContent : entityContent;\n\n if (!entityText) {\n return renderMessagePart(renderedContent);\n }\n\n switch (entity.type) {\n case ApiMessageEntityTypes.Bold:\n return {renderMessagePart(renderedContent)};\n case ApiMessageEntityTypes.Blockquote:\n return
{renderMessagePart(renderedContent)}
;\n case ApiMessageEntityTypes.BotCommand:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Hashtag:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Cashtag:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Code:\n return {renderMessagePart(renderedContent)};\n case ApiMessageEntityTypes.Email:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Italic:\n return {renderMessagePart(renderedContent)};\n case ApiMessageEntityTypes.MentionName:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Mention:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Phone:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Pre:\n return
{renderMessagePart(renderedContent)}
;\n case ApiMessageEntityTypes.Strike:\n return {renderMessagePart(renderedContent)};\n case ApiMessageEntityTypes.TextUrl:\n case ApiMessageEntityTypes.Url:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Underline:\n return {renderMessagePart(renderedContent)};\n default:\n return renderMessagePart(renderedContent);\n }\n}\n\nfunction renderMessagePart(\n content: TextPart | TextPart[],\n highlight?: string,\n shouldRenderHqEmoji?: boolean,\n shouldRenderAsHtml?: boolean,\n) {\n if (Array.isArray(content)) {\n const result: TextPart[] = [];\n\n content.forEach((c) => {\n result.push(...renderMessagePart(c, highlight, shouldRenderHqEmoji, shouldRenderAsHtml));\n });\n\n return result;\n }\n\n if (shouldRenderAsHtml) {\n return renderText(content, ['escape_html', 'emoji_html', 'br_html']);\n }\n\n const emojiFilter = shouldRenderHqEmoji ? 'hq_emoji' : 'emoji';\n\n if (highlight) {\n return renderText(content, [emojiFilter, 'br', 'highlight'], { highlight });\n } else {\n return renderText(content, [emojiFilter, 'br']);\n }\n}\n\nfunction getLinkUrl(entityContent: string, entity: ApiMessageEntity) {\n const { type, url } = entity;\n return type === ApiMessageEntityTypes.TextUrl && url ? url : entityContent;\n}\n\nfunction handleBotCommandClick(e: MouseEvent) {\n getDispatch().sendBotCommand({ command: e.currentTarget.innerText });\n}\n\nfunction handleHashtagClick(e: MouseEvent) {\n getDispatch().setLocalTextSearchQuery({ query: e.currentTarget.innerText });\n getDispatch().searchTextMessagesLocal();\n}\n\nfunction processEntityAsHtml(\n entity: ApiMessageEntity,\n entityContent: TextPart,\n nestedEntityContent: TextPart[],\n) {\n const rawEntityText = typeof entityContent === 'string' && entityContent;\n\n const renderedContent = nestedEntityContent.length\n ? nestedEntityContent.join('')\n : renderText(entityContent, ['escape_html', 'emoji_html', 'br_html']).join('');\n\n if (!rawEntityText) {\n return renderedContent;\n }\n\n switch (entity.type) {\n case ApiMessageEntityTypes.Bold:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Italic:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Underline:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Code:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Pre:\n return `\\`\\`\\`
${renderedContent}
\\`\\`\\``;\n case ApiMessageEntityTypes.Strike:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.MentionName:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Url:\n case ApiMessageEntityTypes.TextUrl:\n return `${renderedContent}`;\n default:\n return renderedContent;\n }\n}\n","import { useCallback } from '../../../../lib/teact/teact';\n\nexport enum ChatAnimationTypes {\n Move,\n Opacity,\n None,\n}\n\nexport function useChatAnimationType(orderDiffById: Record) {\n const movesUp = useCallback((id: number) => orderDiffById[id] < 0, [orderDiffById]);\n const movesDown = useCallback((id: number) => orderDiffById[id] > 0, [orderDiffById]);\n\n const orderDiffIds = Object.keys(orderDiffById).map(Number);\n const numberOfUp = orderDiffIds.filter(movesUp).length;\n const numberOfDown = orderDiffIds.filter(movesDown).length;\n\n return useCallback((chatId: number): ChatAnimationTypes => {\n const orderDiff = orderDiffById[chatId];\n\n if (orderDiff === 0) {\n return ChatAnimationTypes.None;\n }\n\n if (\n orderDiff === Infinity\n || orderDiff === -Infinity\n || (movesUp(chatId) && numberOfUp <= numberOfDown)\n || (movesDown(chatId) && numberOfDown < numberOfUp)\n ) {\n return ChatAnimationTypes.Opacity;\n }\n\n return ChatAnimationTypes.Move;\n }, [movesDown, movesUp, numberOfDown, numberOfUp, orderDiffById]);\n}\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { ApiChat } from '../../../api/types';\n\nimport { formatIntegerCompact } from '../../../util/textFormat';\nimport buildClassName from '../../../util/buildClassName';\n\nimport ShowTransition from '../../ui/ShowTransition';\n\nimport './Badge.scss';\n\ntype OwnProps = {\n chat: ApiChat;\n isPinned?: boolean;\n isMuted?: boolean;\n};\n\nconst Badge: FC = ({ chat, isPinned, isMuted }) => {\n const isShown = Boolean(chat.unreadCount || chat.hasUnreadMark || isPinned);\n const className = buildClassName(\n 'Badge',\n isMuted && 'muted',\n isPinned && 'pinned',\n Boolean(chat.unreadCount || chat.hasUnreadMark) && 'unread',\n );\n\n function renderContent() {\n if (chat.unreadCount) {\n if (chat.unreadMentionsCount) {\n return (\n
\n
\n \n
\n
\n {formatIntegerCompact(chat.unreadCount)}\n
\n
\n );\n }\n\n return (\n
\n {formatIntegerCompact(chat.unreadCount)}\n
\n );\n } else if (chat.hasUnreadMark) {\n return (\n
\n );\n } else if (isPinned) {\n return (\n
\n \n
\n );\n }\n\n return undefined;\n }\n\n return (\n \n {renderContent}\n \n );\n};\n\nexport default memo(Badge);\n","import React, {\n FC, memo, useCallback, useLayoutEffect, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport useLang, { LangFn } from '../../../hooks/useLang';\n\nimport { GlobalActions } from '../../../global/types';\nimport {\n ApiChat, ApiUser, ApiMessage, ApiMessageOutgoingStatus, ApiFormattedText, MAIN_THREAD_ID,\n} from '../../../api/types';\n\nimport { ANIMATION_END_DELAY } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport {\n getChatTitle,\n isChatPrivate,\n isActionMessage,\n getPrivateChatUserId,\n getMessageAction,\n getMessageSenderName,\n isChatChannel,\n getMessageMediaHash,\n getMessageSummaryText,\n getMessageMediaThumbDataUri,\n getMessageVideo,\n getMessageSticker,\n selectIsChatMuted,\n getMessageRoundVideo,\n} from '../../../modules/helpers';\nimport {\n selectChat, selectUser, selectChatMessage, selectOutgoingStatus, selectDraft, selectCurrentMessageList,\n selectNotifySettings, selectNotifyExceptions,\n} from '../../../modules/selectors';\nimport { renderActionMessageText } from '../../common/helpers/renderActionMessageText';\nimport renderText from '../../common/helpers/renderText';\nimport { fastRaf } from '../../../util/schedulers';\nimport buildClassName from '../../../util/buildClassName';\nimport { pick } from '../../../util/iteratees';\nimport useEnsureMessage from '../../../hooks/useEnsureMessage';\nimport useChatContextActions from '../../../hooks/useChatContextActions';\nimport useFlag from '../../../hooks/useFlag';\nimport useMedia from '../../../hooks/useMedia';\nimport { ChatAnimationTypes } from './hooks';\n\nimport Avatar from '../../common/Avatar';\nimport VerifiedIcon from '../../common/VerifiedIcon';\nimport TypingStatus from '../../common/TypingStatus';\nimport LastMessageMeta from '../../common/LastMessageMeta';\nimport DeleteChatModal from '../../common/DeleteChatModal';\nimport ListItem from '../../ui/ListItem';\nimport Badge from './Badge';\n\nimport './Chat.scss';\n\ntype OwnProps = {\n style?: string;\n chatId: number;\n folderId?: number;\n orderDiff: number;\n animationType: ChatAnimationTypes;\n isPinned?: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n isMuted?: boolean;\n privateChatUser?: ApiUser;\n actionTargetUserIds?: number[];\n usersById?: Record;\n actionTargetMessage?: ApiMessage;\n actionTargetChatId?: number;\n lastMessageSender?: ApiUser;\n lastMessageOutgoingStatus?: ApiMessageOutgoingStatus;\n draft?: ApiFormattedText;\n animationLevel?: number;\n isSelected?: boolean;\n canScrollDown?: boolean;\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst ANIMATION_DURATION = 200;\n\nconst Chat: FC = ({\n style,\n chatId,\n folderId,\n orderDiff,\n animationType,\n isPinned,\n chat,\n isMuted,\n privateChatUser,\n actionTargetUserIds,\n usersById,\n lastMessageSender,\n lastMessageOutgoingStatus,\n actionTargetMessage,\n actionTargetChatId,\n draft,\n animationLevel,\n isSelected,\n canScrollDown,\n lastSyncTime,\n openChat,\n focusLastMessage,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n const [shouldRenderDeleteModal, markRenderDeleteModal, unmarkRenderDeleteModal] = useFlag();\n\n const { lastMessage, typingStatus } = chat || {};\n const isAction = lastMessage && isActionMessage(lastMessage);\n\n useEnsureMessage(chatId, isAction ? lastMessage!.replyToMessageId : undefined, actionTargetMessage);\n\n const mediaThumbnail = lastMessage && !getMessageSticker(lastMessage)\n ? getMessageMediaThumbDataUri(lastMessage)\n : undefined;\n const mediaBlobUrl = useMedia(lastMessage ? getMessageMediaHash(lastMessage, 'micro') : undefined);\n const isRoundVideo = Boolean(lastMessage && getMessageRoundVideo(lastMessage));\n\n const actionTargetUsers = useMemo(() => {\n return actionTargetUserIds\n ? actionTargetUserIds.map((userId) => usersById?.[userId]).filter(Boolean as any)\n : undefined;\n }, [actionTargetUserIds, usersById]);\n\n // Sets animation excess values when `orderDiff` changes and then resets excess values to animate.\n useLayoutEffect(() => {\n const element = ref.current;\n\n if (animationLevel === 0 || !element) {\n return;\n }\n\n // TODO Refactor animation: create `useListAnimation` that owns `orderDiff` and `animationType`\n if (animationType === ChatAnimationTypes.Opacity) {\n element.style.opacity = '0';\n\n fastRaf(() => {\n element.classList.add('animate-opacity');\n element.style.opacity = '1';\n });\n } else if (animationType === ChatAnimationTypes.Move) {\n element.style.transform = `translate3d(0, ${-orderDiff * 100}%, 0)`;\n\n fastRaf(() => {\n element.classList.add('animate-transform');\n element.style.transform = '';\n });\n } else {\n return;\n }\n\n setTimeout(() => {\n fastRaf(() => {\n element.classList.remove('animate-opacity', 'animate-transform');\n element.style.opacity = '';\n element.style.transform = '';\n });\n }, ANIMATION_DURATION + ANIMATION_END_DELAY);\n }, [animationLevel, orderDiff, animationType]);\n\n const handleClick = useCallback(() => {\n openChat({ id: chatId, shouldReplaceHistory: true });\n\n if (isSelected && canScrollDown) {\n focusLastMessage();\n }\n }, [\n isSelected,\n canScrollDown,\n openChat,\n chatId,\n focusLastMessage,\n ]);\n\n function handleDelete() {\n markRenderDeleteModal();\n openDeleteModal();\n }\n\n const contextActions = useChatContextActions({\n chat,\n privateChatUser,\n handleDelete,\n folderId,\n isPinned,\n isMuted,\n });\n\n const lang = useLang();\n\n if (!chat) {\n return undefined;\n }\n\n function renderLastMessageOrTyping() {\n if (typingStatus && lastMessage && typingStatus.timestamp > lastMessage.date * 1000) {\n return ;\n }\n\n if (draft?.text.length) {\n return (\n

\n {lang('Draft')}\n {renderText(draft.text)}\n

\n );\n }\n\n if (!lastMessage) {\n return undefined;\n }\n\n if (isAction) {\n const actionOrigin = chat && (isChatChannel(chat) || lastMessage.senderId === lastMessage.chatId)\n ? chat\n : lastMessageSender;\n\n return (\n

\n {renderText(renderActionMessageText(\n lang,\n lastMessage,\n actionOrigin,\n actionTargetUsers,\n actionTargetMessage,\n actionTargetChatId,\n { asPlain: true },\n ) as string)}\n

\n );\n }\n\n const senderName = getMessageSenderName(lang, chatId, lastMessageSender);\n\n return (\n

\n {senderName && (\n <>\n {renderText(senderName)}\n :\n \n )}\n {renderMessageSummary(lang, lastMessage!, mediaBlobUrl || mediaThumbnail, isRoundVideo)}\n

\n );\n }\n\n const className = buildClassName(\n 'Chat chat-item-clickable',\n isChatPrivate(chatId) ? 'private' : 'group',\n isSelected && 'selected',\n );\n\n return (\n \n
\n \n
\n
\n
\n

{renderText(getChatTitle(lang, chat, privateChatUser))}

\n {chat.isVerified && }\n {isMuted && }\n {chat.lastMessage && (\n \n )}\n
\n
\n {renderLastMessageOrTyping()}\n \n
\n
\n {shouldRenderDeleteModal && (\n \n )}\n \n );\n};\n\nfunction renderMessageSummary(lang: LangFn, message: ApiMessage, blobUrl?: string, isRoundVideo?: boolean) {\n if (!blobUrl) {\n return renderText(getMessageSummaryText(lang, message));\n }\n\n return (\n \n \"\"\n {getMessageVideo(message) && }\n {renderText(getMessageSummaryText(lang, message, true))}\n \n );\n}\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n if (!chat || !chat.lastMessage) {\n return {};\n }\n\n const { senderId, replyToMessageId, isOutgoing } = chat.lastMessage;\n const lastMessageSender = senderId ? selectUser(global, senderId) : undefined;\n const lastMessageAction = getMessageAction(chat.lastMessage);\n const actionTargetMessage = lastMessageAction && replyToMessageId\n ? selectChatMessage(global, chat.id, replyToMessageId)\n : undefined;\n const { targetUserIds: actionTargetUserIds, targetChatId: actionTargetChatId } = lastMessageAction || {};\n const privateChatUserId = getPrivateChatUserId(chat);\n const { byId: usersById } = global.users;\n const {\n chatId: currentChatId,\n threadId: currentThreadId,\n type: messageListType,\n } = selectCurrentMessageList(global) || {};\n const isSelected = chatId === currentChatId && currentThreadId === MAIN_THREAD_ID;\n\n return {\n chat,\n isMuted: selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global)),\n lastMessageSender,\n actionTargetUserIds,\n actionTargetChatId,\n actionTargetMessage,\n draft: selectDraft(global, chatId, MAIN_THREAD_ID),\n animationLevel: global.settings.byKey.animationLevel,\n isSelected,\n canScrollDown: isSelected && messageListType === 'thread',\n lastSyncTime: global.lastSyncTime,\n ...(isOutgoing && { lastMessageOutgoingStatus: selectOutgoingStatus(global, chat.lastMessage) }),\n ...(privateChatUserId && { privateChatUser: selectUser(global, privateChatUserId) }),\n ...(actionTargetUserIds && { usersById }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat',\n 'focusLastMessage',\n ]),\n)(Chat));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChatFolder, ApiSticker } from '../../../api/types';\nimport { SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { selectAnimatedEmoji, selectChatFolder } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\nimport AnimatedEmoji from '../../common/AnimatedEmoji';\n\nimport './EmptyFolder.scss';\n\ntype OwnProps = {\n folderId?: number;\n folderType: 'all' | 'archived' | 'folder';\n foldersDispatch?: FolderEditDispatch;\n onScreenSelect?: (screen: SettingsScreens) => void;\n};\n\ntype StateProps = {\n chatFolder?: ApiChatFolder;\n animatedEmoji?: ApiSticker;\n};\n\nconst EmptyFolder: FC = ({\n chatFolder, animatedEmoji, foldersDispatch, onScreenSelect,\n}) => {\n const lang = useLang();\n\n const handleEditFolder = useCallback(() => {\n foldersDispatch!({ type: 'editFolder', payload: chatFolder });\n onScreenSelect!(SettingsScreens.FoldersEditFolderFromChatList);\n }, [chatFolder, foldersDispatch, onScreenSelect]);\n\n return (\n
\n
{animatedEmoji && }
\n

{lang('FilterNoChatsToDisplay')}

\n

\n {lang(chatFolder ? 'ChatList.EmptyChatListFilterText' : 'Chat.EmptyChat')}\n

\n {chatFolder && foldersDispatch && onScreenSelect && (\n \n \n {lang('ChatList.EmptyChatListEditFilter')}\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal((global, { folderId, folderType }): StateProps => {\n const chatFolder = folderId && folderType === 'folder' ? selectChatFolder(global, folderId) : undefined;\n\n return {\n chatFolder,\n animatedEmoji: selectAnimatedEmoji(global, '📂'),\n };\n})(EmptyFolder));\n","import React, {\n FC, memo, useMemo, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport {\n ApiChat, ApiChatFolder, ApiUser,\n} from '../../../api/types';\nimport { NotifyException, NotifySettings, SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { ALL_CHATS_PRELOAD_DISABLED, CHAT_HEIGHT_PX, CHAT_LIST_SLICE } from '../../../config';\nimport { IS_ANDROID, IS_MAC_OS, IS_PWA } from '../../../util/environment';\nimport usePrevious from '../../../hooks/usePrevious';\nimport { mapValues, pick } from '../../../util/iteratees';\nimport { getChatOrder, prepareChatList, prepareFolderListIds } from '../../../modules/helpers';\nimport {\n selectChatFolder, selectNotifyExceptions, selectNotifySettings,\n} from '../../../modules/selectors';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\nimport { useChatAnimationType } from './hooks';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport Loading from '../../ui/Loading';\nimport Chat from './Chat';\nimport EmptyFolder from './EmptyFolder';\n\ntype OwnProps = {\n folderType: 'all' | 'archived' | 'folder';\n folderId?: number;\n isActive: boolean;\n onScreenSelect?: (screen: SettingsScreens) => void;\n foldersDispatch?: FolderEditDispatch;\n};\n\ntype StateProps = {\n chatsById: Record;\n usersById: Record;\n chatFolder?: ApiChatFolder;\n listIds?: number[];\n orderedPinnedIds?: number[];\n lastSyncTime?: number;\n notifySettings: NotifySettings;\n notifyExceptions?: Record;\n};\n\ntype DispatchProps = Pick;\n\nenum FolderTypeToListType {\n 'all' = 'active',\n 'archived' = 'archived',\n}\n\nconst ChatList: FC = ({\n folderType,\n folderId,\n isActive,\n chatFolder,\n chatsById,\n usersById,\n listIds,\n orderedPinnedIds,\n lastSyncTime,\n foldersDispatch,\n notifySettings,\n notifyExceptions,\n onScreenSelect,\n loadMoreChats,\n preloadTopChatMessages,\n openChat,\n openNextChat,\n}) => {\n const [currentListIds, currentPinnedIds] = useMemo(() => {\n return folderType === 'folder' && chatFolder\n ? prepareFolderListIds(chatsById, usersById, chatFolder, notifySettings, notifyExceptions)\n : [listIds, orderedPinnedIds];\n }, [folderType, chatFolder, chatsById, usersById, notifySettings, notifyExceptions, listIds, orderedPinnedIds]);\n\n const [orderById, orderedIds] = useMemo(() => {\n if (!currentListIds || (folderType === 'folder' && !chatFolder)) {\n return [];\n }\n const newChatArrays = prepareChatList(chatsById, currentListIds, currentPinnedIds, folderType);\n const singleList = [...newChatArrays.pinnedChats, ...newChatArrays.otherChats];\n const newOrderedIds = singleList.map(({ id }) => id);\n const newOrderById = singleList.reduce((acc, chat, i) => {\n acc[chat.id] = i;\n return acc;\n }, {} as Record);\n\n return [newOrderById, newOrderedIds];\n }, [currentListIds, currentPinnedIds, folderType, chatFolder, chatsById]);\n\n const prevOrderById = usePrevious(orderById);\n\n const orderDiffById = useMemo(() => {\n if (!orderById || !prevOrderById) {\n return {};\n }\n\n return mapValues(orderById, (order, id) => {\n return order - (prevOrderById[id] !== undefined ? prevOrderById[id] : Infinity);\n });\n }, [orderById, prevOrderById]);\n\n const loadMoreOfType = useCallback(() => {\n loadMoreChats({ listType: folderType === 'archived' ? 'archived' : 'active' });\n }, [loadMoreChats, folderType]);\n\n const [viewportIds, getMore] = useInfiniteScroll(\n lastSyncTime ? loadMoreOfType : undefined,\n orderedIds,\n undefined,\n CHAT_LIST_SLICE,\n folderType === 'all' && !ALL_CHATS_PRELOAD_DISABLED,\n );\n\n // TODO Refactor to not call `prepareChatList` twice\n const chatArrays = viewportIds && prepareChatList(chatsById, viewportIds, currentPinnedIds, folderType);\n\n useEffect(() => {\n if (lastSyncTime && folderType === 'all') {\n preloadTopChatMessages();\n }\n }, [lastSyncTime, folderType, preloadTopChatMessages]);\n\n const getAnimationType = useChatAnimationType(orderDiffById);\n\n function renderChats() {\n const viewportOffset = orderedIds!.indexOf(viewportIds![0]);\n const pinnedOffset = viewportOffset + chatArrays!.pinnedChats.length;\n\n return (\n \n {chatArrays!.pinnedChats.map(({ id }, i) => (\n \n ))}\n {chatArrays!.otherChats.map((chat, i) => (\n \n ))}\n
\n );\n }\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (isActive && orderedIds) {\n if (IS_PWA && ((IS_MAC_OS && e.metaKey) || (!IS_MAC_OS && e.ctrlKey)) && e.code.startsWith('Digit')) {\n const [, digit] = e.code.match(/Digit(\\d)/) || [];\n if (!digit) return;\n\n const position = Number(digit) - 1;\n if (position > orderedIds.length - 1) return;\n\n openChat({ id: orderedIds[position], shouldReplaceHistory: true });\n }\n\n if (e.altKey) {\n const targetIndexDelta = e.key === 'ArrowDown' ? 1 : e.key === 'ArrowUp' ? -1 : undefined;\n if (!targetIndexDelta) return;\n\n e.preventDefault();\n openNextChat({ targetIndexDelta, orderedIds });\n }\n }\n };\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n });\n\n return (\n \n {viewportIds?.length && chatArrays ? (\n renderChats()\n ) : viewportIds && !viewportIds.length ? (\n (\n \n )\n ) : (\n \n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { folderType, folderId }): StateProps => {\n const {\n chats: {\n listIds,\n byId: chatsById,\n orderedPinnedIds,\n },\n users: { byId: usersById },\n lastSyncTime,\n } = global;\n const listType = folderType !== 'folder' ? FolderTypeToListType[folderType] : undefined;\n const chatFolder = folderId ? selectChatFolder(global, folderId) : undefined;\n\n return {\n chatsById,\n usersById,\n lastSyncTime,\n notifySettings: selectNotifySettings(global),\n notifyExceptions: selectNotifyExceptions(global),\n ...(listType ? {\n listIds: listIds[listType],\n orderedPinnedIds: orderedPinnedIds[listType],\n } : {\n chatFolder,\n }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadMoreChats',\n 'preloadTopChatMessages',\n 'openChat',\n 'openNextChat',\n ]),\n)(ChatList));\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport useFlag from '../../../hooks/useFlag';\nimport buildClassName from '../../../util/buildClassName';\n\nimport './DropTarget.scss';\n\nexport type OwnProps = {\n isQuick?: boolean;\n onFileSelect: (e: React.DragEvent) => void;\n};\n\nconst DropTarget: FC = ({ isQuick, onFileSelect }) => {\n const [isHovered, markHovered, unmarkHovered] = useFlag();\n\n const handleDragEnter = () => { markHovered(); };\n const handleDragLeave = (e: React.DragEvent) => {\n const { relatedTarget: toTarget } = e;\n\n if (toTarget) {\n e.stopPropagation();\n }\n\n unmarkHovered();\n };\n\n const className = buildClassName(\n 'DropTarget',\n isHovered && 'hovered',\n );\n\n return (\n \n
\n
\n
Drop files here to send them
\n
{isQuick ? 'in a quick way' : 'without compression'}
\n
\n
\n );\n};\n\nexport default memo(DropTarget);\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\n\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport usePrevious from '../../../hooks/usePrevious';\n\nimport DropTarget from './DropTarget';\n\nimport './DropArea.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n withQuick?: boolean;\n onHide: NoneToVoidFunction;\n onFileSelect: (files: File[], isQuick: boolean) => void;\n};\n\nexport enum DropAreaState {\n None = 'none',\n Document = 'document',\n QuickFile = 'quick_file',\n}\n\nconst DROP_LEAVE_TIMEOUT_MS = 150;\n\nconst DropArea: FC = ({\n isOpen, withQuick, onHide, onFileSelect,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const hideTimeoutRef = useRef(null);\n const prevWithQuick = usePrevious(withQuick);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen);\n\n useEffect(() => (isOpen ? captureEscKeyListener(onHide) : undefined), [isOpen, onHide]);\n\n const handleFilesDrop = useCallback((e: React.DragEvent) => {\n const { dataTransfer: dt } = e;\n\n if (dt.files && dt.files.length > 0) {\n onHide();\n onFileSelect(Array.from(dt.files), false);\n }\n }, [onFileSelect, onHide]);\n\n const handleQuickFilesDrop = useCallback((e: React.DragEvent) => {\n const { dataTransfer: dt } = e;\n\n if (dt.files && dt.files.length > 0) {\n onHide();\n onFileSelect(Array.from(dt.files), true);\n }\n }, [onFileSelect, onHide]);\n\n const handleDragLeave = useCallback((e: React.DragEvent) => {\n e.stopPropagation();\n\n const { target: fromTarget, relatedTarget: toTarget } = e;\n\n // Esc button pressed during drag event\n if ((fromTarget as HTMLDivElement).matches('.DropTarget, .DropArea') && !toTarget) {\n hideTimeoutRef.current = window.setTimeout(() => {\n onHide();\n }, DROP_LEAVE_TIMEOUT_MS);\n }\n }, [onHide]);\n\n const handleDragOver = () => {\n if (hideTimeoutRef.current) {\n window.clearTimeout(hideTimeoutRef.current);\n }\n };\n\n if (!shouldRender) {\n return undefined;\n }\n\n const className = buildClassName(\n 'DropArea',\n transitionClassNames,\n );\n\n return (\n
\n \n {(withQuick || prevWithQuick) && }\n
\n );\n};\n\nexport default memo(DropArea);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './EmojiTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst EmojiTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const EmojiTooltip = useModuleLoader(Bundles.Extra, 'EmojiTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return EmojiTooltip ? : undefined;\n};\n\nexport default memo(EmojiTooltipAsync);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useEffect, useRef, memo, useState, useCallback,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { IAnchorPosition, ISettings } from '../../../types';\n\nimport { EDITABLE_INPUT_ID } from '../../../config';\nimport { selectCurrentMessageList, selectReplyingToId } from '../../../modules/selectors';\nimport { debounce } from '../../../util/schedulers';\nimport focusEditableElement from '../../../util/focusEditableElement';\nimport buildClassName from '../../../util/buildClassName';\nimport { pick } from '../../../util/iteratees';\nimport {\n IS_ANDROID, IS_IOS, IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV,\n} from '../../../util/environment';\nimport captureKeyboardListeners from '../../../util/captureKeyboardListeners';\nimport useLayoutEffectWithPrevDeps from '../../../hooks/useLayoutEffectWithPrevDeps';\nimport useFlag from '../../../hooks/useFlag';\nimport parseEmojiOnlyString from '../../common/helpers/parseEmojiOnlyString';\nimport { isSelectionInsideInput } from './helpers/selection';\nimport useLang from '../../../hooks/useLang';\nimport renderText from '../../common/helpers/renderText';\n\nimport TextFormatter from './TextFormatter';\n\nconst CONTEXT_MENU_CLOSE_DELAY_MS = 100;\n// Focus slows down animation, also it breaks transition layout in Chrome\nconst FOCUS_DELAY_MS = 350;\nconst TRANSITION_DURATION_FACTOR = 50;\n\ntype OwnProps = {\n id: string;\n isAttachmentModalInput?: boolean;\n editableInputId?: string;\n html: string;\n placeholder: string;\n forcedPlaceholder?: string;\n shouldSetFocus: boolean;\n shouldSuppressFocus?: boolean;\n shouldSuppressTextFormatter?: boolean;\n onUpdate: (html: string) => void;\n onSuppressedFocus?: () => void;\n onSend: () => void;\n};\n\ntype StateProps = {\n currentChatId?: number;\n replyingToId?: number;\n noTabCapture?: boolean;\n messageSendKeyCombo?: ISettings['messageSendKeyCombo'];\n};\n\ntype DispatchProps = Pick;\n\nconst MAX_INPUT_HEIGHT = IS_SINGLE_COLUMN_LAYOUT ? 256 : 416;\nconst TAB_INDEX_PRIORITY_TIMEOUT = 2000;\nconst TEXT_FORMATTER_SAFE_AREA_PX = 90;\n// For some reason Safari inserts `
` after user removes text from input\nconst SAFARI_BR = '
';\n\nfunction clearSelection() {\n const selection = window.getSelection();\n if (!selection) {\n return;\n }\n\n if (selection.removeAllRanges) {\n selection.removeAllRanges();\n } else if (selection.empty) {\n selection.empty();\n }\n}\n\nconst MessageInput: FC = ({\n id,\n isAttachmentModalInput,\n editableInputId,\n html,\n placeholder,\n forcedPlaceholder,\n shouldSetFocus,\n shouldSuppressFocus,\n shouldSuppressTextFormatter,\n onUpdate,\n onSuppressedFocus,\n onSend,\n currentChatId,\n replyingToId,\n noTabCapture,\n messageSendKeyCombo,\n editLastMessage,\n replyToNextMessage,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const cloneRef = useRef(null);\n\n const lang = useLang();\n const isContextMenuOpenRef = useRef(false);\n const [isTextFormatterOpen, openTextFormatter, closeTextFormatter] = useFlag();\n const [textFormatterAnchorPosition, setTextFormatterAnchorPosition] = useState();\n const [selectedRange, setSelectedRange] = useState();\n\n useEffect(() => {\n if (!isAttachmentModalInput) return;\n updateInputHeight(false);\n }, [isAttachmentModalInput]);\n\n useLayoutEffectWithPrevDeps(([prevHtml]) => {\n if (html !== inputRef.current!.innerHTML) {\n inputRef.current!.innerHTML = html;\n }\n\n if (html !== cloneRef.current!.innerHTML) {\n cloneRef.current!.innerHTML = html;\n }\n\n if (prevHtml !== undefined && prevHtml !== html) {\n updateInputHeight(!html.length);\n }\n }, [html]);\n\n const focusInput = useCallback(() => {\n // Avoid focusing during animation\n if (inputRef.current!.closest('.from, .to')) {\n setTimeout(focusInput, FOCUS_DELAY_MS);\n return;\n }\n\n focusEditableElement(inputRef.current!);\n }, []);\n\n const handleCloseTextFormatter = useCallback(() => {\n closeTextFormatter();\n clearSelection();\n }, [closeTextFormatter]);\n\n function checkSelection() {\n // Disable the formatter on iOS devices for now.\n if (IS_IOS) {\n return;\n }\n\n const selection = window.getSelection();\n if (!selection || !selection.rangeCount || isContextMenuOpenRef.current) {\n closeTextFormatter();\n return;\n }\n\n const selectionRange = selection.getRangeAt(0);\n const selectedText = selectionRange.toString().trim();\n if (\n shouldSuppressTextFormatter\n || !isSelectionInsideInput(selectionRange, editableInputId || EDITABLE_INPUT_ID)\n || !selectedText\n || parseEmojiOnlyString(selectedText)\n || !selectionRange.START_TO_END\n ) {\n closeTextFormatter();\n return;\n }\n\n const selectionRect = selectionRange.getBoundingClientRect();\n const inputRect = inputRef.current!.getBoundingClientRect();\n\n let x = (selectionRect.left + selectionRect.width / 2) - inputRect.left;\n\n if (x < TEXT_FORMATTER_SAFE_AREA_PX) {\n x = TEXT_FORMATTER_SAFE_AREA_PX;\n } else if (x > inputRect.width - TEXT_FORMATTER_SAFE_AREA_PX) {\n x = inputRect.width - TEXT_FORMATTER_SAFE_AREA_PX;\n }\n\n setTextFormatterAnchorPosition({\n x,\n y: selectionRect.top - inputRect.top,\n });\n\n setSelectedRange(selectionRange);\n openTextFormatter();\n }\n\n function handleMouseDown(event: React.MouseEvent) {\n function handleMouseUp() {\n checkSelection();\n\n event.target.removeEventListener('mouseup', handleMouseUp);\n }\n\n if (event.button !== 2) {\n event.target.addEventListener('mouseup', handleMouseUp);\n return;\n }\n\n if (isContextMenuOpenRef.current === true) {\n return;\n }\n\n isContextMenuOpenRef.current = true;\n\n function closeContextMenuMouseListener() {\n setTimeout(() => {\n isContextMenuOpenRef.current = false;\n }, CONTEXT_MENU_CLOSE_DELAY_MS);\n\n window.removeEventListener('mouseup', closeContextMenuMouseListener);\n }\n\n function closeContextMenuKeyListener(e: KeyboardEvent) {\n if (e.key !== 'Esc' && e.key !== 'Escape') {\n return;\n }\n\n setTimeout(() => {\n isContextMenuOpenRef.current = false;\n }, CONTEXT_MENU_CLOSE_DELAY_MS);\n\n window.removeEventListener('keydown', closeContextMenuKeyListener);\n }\n\n document.addEventListener('mousedown', closeContextMenuMouseListener);\n document.addEventListener('keydown', closeContextMenuKeyListener);\n }\n\n function handleKeyDown(e: React.KeyboardEvent) {\n function handleKeyUp() {\n checkSelection();\n\n e.target.removeEventListener('keyup', handleKeyUp);\n }\n\n if (e.metaKey && !html.length) {\n const targetIndexDelta = e.key === 'ArrowDown' ? 1 : e.key === 'ArrowUp' ? -1 : undefined;\n if (targetIndexDelta) {\n e.preventDefault();\n\n replyToNextMessage({ targetIndexDelta });\n return;\n }\n }\n\n if (e.key === 'Enter' && !e.shiftKey) {\n if (\n !(IS_IOS || IS_ANDROID)\n && (\n (messageSendKeyCombo === 'enter' && !e.shiftKey)\n || (messageSendKeyCombo === 'ctrl-enter' && (e.ctrlKey || e.metaKey))\n )\n ) {\n e.preventDefault();\n\n closeTextFormatter();\n onSend();\n }\n } else if (e.key === 'ArrowUp' && !html.length && !e.metaKey && !e.altKey) {\n e.preventDefault();\n editLastMessage();\n } else {\n e.target.addEventListener('keyup', handleKeyUp);\n }\n }\n\n function handleTouchSelection() {\n if (!IS_ANDROID) {\n return;\n }\n\n checkSelection();\n }\n\n function handleChange(e: ChangeEvent) {\n const { innerHTML, textContent } = e.currentTarget;\n\n onUpdate(innerHTML === SAFARI_BR ? '' : innerHTML);\n\n // Reset focus on the input to remove any active styling when input is cleared\n if (!IS_TOUCH_ENV && (!textContent || !textContent.length)) {\n const selection = window.getSelection()!;\n if (selection) {\n inputRef.current!.blur();\n selection.removeAllRanges();\n focusEditableElement(inputRef.current!, true);\n }\n }\n }\n\n function stopEvent(e: React.MouseEvent) {\n if (!IS_ANDROID) {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n }\n\n function updateInputHeight(willSend = false) {\n const input = inputRef.current!;\n const clone = cloneRef.current!;\n const currentHeight = Number(input.style.height.replace('px', ''));\n const newHeight = Math.min(clone.scrollHeight, MAX_INPUT_HEIGHT);\n if (newHeight === currentHeight) {\n return;\n }\n\n const transitionDuration = Math.round(\n TRANSITION_DURATION_FACTOR * Math.log(Math.abs(newHeight - currentHeight)),\n );\n\n const exec = () => {\n input.style.height = `${newHeight}px`;\n input.style.transitionDuration = `${transitionDuration}ms`;\n input.classList.toggle('overflown', clone.scrollHeight > MAX_INPUT_HEIGHT);\n };\n\n if (willSend) {\n // Sync with sending animation\n requestAnimationFrame(exec);\n } else {\n exec();\n }\n }\n\n useEffect(() => {\n if (IS_TOUCH_ENV) {\n return;\n }\n\n if (shouldSetFocus) {\n focusInput();\n }\n }, [currentChatId, focusInput, replyingToId, shouldSetFocus]);\n\n useEffect(() => {\n if (noTabCapture) {\n return undefined;\n }\n\n const captureFirstTab = debounce((e: KeyboardEvent) => {\n if (e.key === 'Tab') {\n e.preventDefault();\n requestAnimationFrame(focusInput);\n }\n }, TAB_INDEX_PRIORITY_TIMEOUT, true, false);\n\n return captureKeyboardListeners({ onTab: captureFirstTab });\n }, [focusInput, noTabCapture]);\n\n useEffect(() => {\n const input = inputRef.current!;\n\n function suppressFocus() {\n input.blur();\n }\n\n if (shouldSuppressFocus) {\n input.addEventListener('focus', suppressFocus);\n }\n\n return () => {\n input.removeEventListener('focus', suppressFocus);\n };\n }, [shouldSuppressFocus]);\n\n const className = buildClassName(\n 'form-control custom-scroll',\n html.length > 0 && 'touched',\n shouldSuppressFocus && 'focus-disabled',\n );\n\n return (\n
\n \n
\n {!forcedPlaceholder && {placeholder}}\n \n {forcedPlaceholder && {renderText(forcedPlaceholder!)}}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { chatId: currentChatId, threadId } = selectCurrentMessageList(global) || {};\n const { messageSendKeyCombo } = global.settings.byKey;\n\n return {\n currentChatId,\n messageSendKeyCombo,\n replyingToId: currentChatId && threadId ? selectReplyingToId(global, currentChatId, threadId) : undefined,\n noTabCapture: global.isPollModalOpen || global.payment.isPaymentModalOpen,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['editLastMessage', 'replyToNextMessage']),\n)(MessageInput));\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { IAnchorPosition } from '../../../types';\n\nimport { EDITABLE_INPUT_ID } from '../../../config';\nimport buildClassName from '../../../util/buildClassName';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useVirtualBackdrop from '../../../hooks/useVirtualBackdrop';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\n\nimport './TextFormatter.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n anchorPosition?: IAnchorPosition;\n selectedRange?: Range;\n onClose: () => void;\n};\n\ninterface ISelectedTextFormats {\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n strikethrough?: boolean;\n monospace?: boolean;\n}\n\nconst TEXT_FORMAT_BY_TAG_NAME: Record = {\n B: 'bold',\n STRONG: 'bold',\n I: 'italic',\n EM: 'italic',\n U: 'underline',\n DEL: 'strikethrough',\n CODE: 'monospace',\n};\nconst fragmentEl = document.createElement('div');\n\nconst TextFormatter: FC = ({\n isOpen,\n anchorPosition,\n selectedRange,\n onClose,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const linkUrlInputRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen);\n const [isLinkControlOpen, openLinkControl, closeLinkControl] = useFlag();\n const [linkUrl, setLinkUrl] = useState('');\n const [isEditingLink, setIsEditingLink] = useState(false);\n const [inputClassName, setInputClassName] = useState();\n const [selectedTextFormats, setSelectedTextFormats] = useState({});\n\n useEffect(() => (isOpen ? captureEscKeyListener(onClose) : undefined), [isOpen, onClose]);\n useVirtualBackdrop(\n isOpen,\n containerRef,\n onClose,\n );\n\n useEffect(() => {\n if (isLinkControlOpen) {\n linkUrlInputRef.current!.focus();\n } else {\n setLinkUrl('');\n setIsEditingLink(false);\n }\n }, [isLinkControlOpen]);\n\n useEffect(() => {\n if (!shouldRender) {\n closeLinkControl();\n setSelectedTextFormats({});\n setInputClassName(undefined);\n }\n }, [closeLinkControl, shouldRender]);\n\n useEffect(() => {\n if (!isOpen || !selectedRange) {\n return;\n }\n\n const selectedFormats: ISelectedTextFormats = {};\n let { parentElement } = selectedRange.commonAncestorContainer;\n while (parentElement && parentElement.id !== EDITABLE_INPUT_ID) {\n const textFormat = TEXT_FORMAT_BY_TAG_NAME[parentElement.tagName];\n if (textFormat) {\n selectedFormats[textFormat] = true;\n }\n\n parentElement = parentElement.parentElement;\n }\n\n setSelectedTextFormats(selectedFormats);\n }, [isOpen, selectedRange, openLinkControl]);\n\n function restoreSelection() {\n if (!selectedRange) {\n return;\n }\n\n const selection = window.getSelection();\n if (selection) {\n selection.removeAllRanges();\n selection.addRange(selectedRange);\n }\n }\n\n const getSelectedText = useCallback(() => {\n if (!selectedRange) {\n return undefined;\n }\n fragmentEl.innerText = selectedRange.toString();\n\n return fragmentEl.innerHTML;\n }, [selectedRange]);\n\n const getSelectedElement = useCallback(() => {\n if (!selectedRange) {\n return undefined;\n }\n\n return selectedRange.commonAncestorContainer.parentElement;\n }, [selectedRange]);\n\n function updateInputStyles() {\n const input = linkUrlInputRef.current;\n if (!input) {\n return;\n }\n\n const { offsetWidth, scrollWidth, scrollLeft } = input;\n if (scrollWidth <= offsetWidth) {\n setInputClassName(undefined);\n return;\n }\n\n let className = '';\n if (scrollLeft < scrollWidth - offsetWidth) {\n className = 'mask-right';\n }\n if (scrollLeft > 0) {\n className += ' mask-left';\n }\n\n setInputClassName(className);\n }\n\n function handleLinkUrlChange(e: React.ChangeEvent) {\n setLinkUrl(e.target.value);\n updateInputStyles();\n }\n\n function getFormatButtonClassName(key: keyof ISelectedTextFormats) {\n if (selectedTextFormats[key]) {\n return 'active';\n }\n\n if (key === 'monospace' || key === 'strikethrough') {\n if (Object.keys(selectedTextFormats).some(\n (fKey) => fKey !== key && !!selectedTextFormats[fKey as keyof ISelectedTextFormats],\n )) {\n return 'disabled';\n }\n } else if (selectedTextFormats.monospace || selectedTextFormats.strikethrough) {\n return 'disabled';\n }\n\n return undefined;\n }\n\n const handleBoldText = useCallback(() => {\n setSelectedTextFormats((selectedFormats) => {\n // Somehow re-applying 'bold' command to already bold text doesn't work\n document.execCommand(selectedFormats.bold ? 'removeFormat' : 'bold');\n Object.keys(selectedFormats).forEach((key) => {\n if ((key === 'italic' || key === 'underline') && !!selectedFormats[key]) {\n document.execCommand(key);\n }\n });\n\n return {\n ...selectedFormats,\n bold: !selectedFormats.bold,\n };\n });\n }, []);\n\n const handleItalicText = useCallback(() => {\n document.execCommand('italic');\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n italic: !selectedFormats.italic,\n }));\n }, []);\n\n const handleUnderlineText = useCallback(() => {\n document.execCommand('underline');\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n underline: !selectedFormats.underline,\n }));\n }, []);\n\n const handleStrikethroughText = useCallback(() => {\n if (selectedTextFormats.strikethrough) {\n const element = getSelectedElement();\n if (\n !selectedRange\n || !element\n || element.tagName !== 'DEL'\n || !element.textContent\n ) {\n return;\n }\n\n element.replaceWith(element.textContent);\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n strikethrough: false,\n }));\n\n return;\n }\n\n const text = getSelectedText();\n document.execCommand('insertHTML', false, `${text}`);\n onClose();\n }, [\n getSelectedElement, getSelectedText, onClose,\n selectedRange, selectedTextFormats.strikethrough,\n ]);\n\n const handleMonospaceText = useCallback(() => {\n if (selectedTextFormats.monospace) {\n const element = getSelectedElement();\n if (\n !selectedRange\n || !element\n || element.tagName !== 'CODE'\n || !element.textContent\n ) {\n return;\n }\n\n element.replaceWith(element.textContent);\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n monospace: false,\n }));\n return;\n }\n\n const text = getSelectedText();\n document.execCommand('insertHTML', false, `${text}`);\n onClose();\n }, [\n getSelectedElement, getSelectedText, onClose,\n selectedRange, selectedTextFormats.monospace,\n ]);\n\n function handleLinkUrlConfirm() {\n const formattedLinkUrl = encodeURI(linkUrl.includes('://') ? linkUrl : `http://${linkUrl}`);\n\n if (isEditingLink) {\n const element = getSelectedElement();\n if (!element || element.tagName !== 'A') {\n return;\n }\n\n (element as HTMLAnchorElement).href = formattedLinkUrl;\n\n onClose();\n return;\n }\n\n const text = getSelectedText();\n restoreSelection();\n document.execCommand(\n 'insertHTML',\n false,\n `${text}`,\n );\n onClose();\n }\n\n const handleKeyDown = useCallback((e: KeyboardEvent) => {\n const HANDLERS_BY_KEY_CODE: Record = {\n KeyK: openLinkControl,\n KeyB: handleBoldText,\n KeyU: handleUnderlineText,\n KeyI: handleItalicText,\n KeyM: handleMonospaceText,\n KeyS: handleStrikethroughText,\n };\n\n const handler = HANDLERS_BY_KEY_CODE[e.code];\n\n if (\n e.altKey\n || !(e.ctrlKey || e.metaKey)\n || !handler\n ) {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n handler();\n }, [\n handleBoldText, handleItalicText, handleUnderlineText,\n handleMonospaceText, handleStrikethroughText,\n openLinkControl,\n ]);\n\n useEffect(() => {\n if (isOpen) {\n document.addEventListener('keydown', handleKeyDown);\n }\n\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [isOpen, handleKeyDown]);\n\n const lang = useLang();\n\n function handleContainerKeyDown(e: React.KeyboardEvent) {\n if (e.key === 'Enter' && isLinkControlOpen) {\n handleLinkUrlConfirm();\n e.preventDefault();\n }\n }\n\n if (!shouldRender) {\n return undefined;\n }\n\n const className = buildClassName(\n 'TextFormatter',\n transitionClassNames,\n isLinkControlOpen && 'link-control-shown',\n );\n\n const linkUrlConfirmClassName = buildClassName(\n 'TextFormatter-link-url-confirm',\n !!linkUrl.length && 'shown',\n );\n\n const style = anchorPosition\n ? `left: ${anchorPosition.x}px; top: ${anchorPosition.y}px;--text-formatter-left: ${anchorPosition.x}px;`\n : '';\n\n return (\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n\n
\n
\n \n
\n\n \n \n
\n\n
\n
\n \n \n \n
\n
\n
\n
\n );\n};\n\nexport default memo(TextFormatter);\n","import { ApiMessageEntity, ApiMessageEntityTypes, ApiFormattedText } from '../../../../api/types';\nimport { IS_EMOJI_SUPPORTED } from '../../../../util/environment';\n\nconst ENTITY_CLASS_BY_NODE_NAME: Record = {\n B: ApiMessageEntityTypes.Bold,\n STRONG: ApiMessageEntityTypes.Bold,\n I: ApiMessageEntityTypes.Italic,\n EM: ApiMessageEntityTypes.Italic,\n U: ApiMessageEntityTypes.Underline,\n S: ApiMessageEntityTypes.Strike,\n STRIKE: ApiMessageEntityTypes.Strike,\n DEL: ApiMessageEntityTypes.Strike,\n CODE: ApiMessageEntityTypes.Code,\n PRE: ApiMessageEntityTypes.Pre,\n BLOCKQUOTE: ApiMessageEntityTypes.Blockquote,\n};\n\nconst MAX_TAG_DEEPNESS = 3;\n\nexport default function parseMessageInput(html: string): ApiFormattedText {\n const fragment = document.createElement('div');\n fragment.innerHTML = parseMarkdown(html);\n const text = fragment.innerText.trim().replace(/\\u200b+/g, '');\n let textIndex = 0;\n let recursionDeepness = 0;\n const entities: ApiMessageEntity[] = [];\n\n function addEntity(node: ChildNode) {\n const { index, entity } = getEntityDataFromNode(node, text, textIndex);\n\n if (entity) {\n textIndex = index;\n entities.push(entity);\n } else if (node.textContent) {\n textIndex += node.textContent.length;\n }\n\n if (node.hasChildNodes() && recursionDeepness <= MAX_TAG_DEEPNESS) {\n recursionDeepness += 1;\n Array.from(node.childNodes).forEach(addEntity);\n }\n }\n\n Array.from(fragment.childNodes).forEach((node) => {\n recursionDeepness = 1;\n addEntity(node);\n });\n\n return {\n text,\n entities: entities.length ? entities : undefined,\n };\n}\n\nfunction parseMarkdown(html: string) {\n let parsedHtml = html.slice(0);\n\n if (!IS_EMOJI_SUPPORTED) {\n // Emojis\n parsedHtml = parsedHtml.replace(/]+alt=\"([^\"]+)\"[^>]*>/gm, '$1');\n }\n\n // Strip redundant tags\n parsedHtml = parsedHtml.replace(/<\\/?span([^>]*)?>/g, '');\n\n // Strip redundant nbsp's\n parsedHtml = parsedHtml.replace(/ /g, ' ');\n\n // Replace

with newline (new line in Safari)\n parsedHtml = parsedHtml.replace(/
]*)?><\\/div>/g, '\\n');\n // Replace
with newline\n parsedHtml = parsedHtml.replace(/]*)?>/g, '\\n');\n\n // Strip redundant
tags\n parsedHtml = parsedHtml.replace(/<\\/div>(\\s*)
/g, '\\n');\n parsedHtml = parsedHtml.replace(/
/g, '\\n');\n parsedHtml = parsedHtml.replace(/<\\/div>/g, '');\n\n // Pre\n parsedHtml = parsedHtml.replace(/^`{3}(.*[\\n\\r][^]*?^)`{3}/gm, '
$1
');\n parsedHtml = parsedHtml.replace(/[`]{3}([^`]+)[`]{3}/g, '
$1
');\n\n // Code\n parsedHtml = parsedHtml.replace(/[`]{1}([^`\\n]+)[`]{1}/g, '$1');\n\n // Other simple markdown\n parsedHtml = parsedHtml.replace(/[*]{2}([^*\\n]+)[*]{2}/g, '$1');\n parsedHtml = parsedHtml.replace(/[_]{2}([^*\\n]+)[_]{2}/g, '$1');\n parsedHtml = parsedHtml.replace(/[~]{2}([^~\\n]+)[~]{2}/g, '$1');\n\n return parsedHtml;\n}\n\nfunction getEntityDataFromNode(\n node: ChildNode,\n rawText: string,\n textIndex: number,\n): { index: number; entity?: ApiMessageEntity } {\n const type = getEntityTypeFromNode(node);\n if (!type || !node.textContent) {\n return {\n index: textIndex,\n entity: undefined,\n };\n }\n\n const rawIndex = rawText.indexOf(node.textContent, textIndex);\n // In some cases, last text entity ends with a newline (which gets trimmed from `rawText`).\n // In this case, `rawIndex` would return `-1`, so we use `textIndex` instead.\n const index = rawIndex >= 0 ? rawIndex : textIndex;\n const offset = rawText.substring(0, index).length;\n const { length } = rawText.substring(index, index + node.textContent.length);\n\n let url: string | undefined;\n let userId: number | undefined;\n if (type === ApiMessageEntityTypes.TextUrl) {\n url = (node as HTMLAnchorElement).href;\n }\n if (type === ApiMessageEntityTypes.MentionName) {\n userId = Number((node as HTMLAnchorElement).dataset.userId);\n }\n\n return {\n index,\n entity: {\n type,\n offset,\n length,\n ...(url && { url }),\n ...(userId && { userId }),\n },\n };\n}\n\nfunction getEntityTypeFromNode(node: ChildNode) {\n if (ENTITY_CLASS_BY_NODE_NAME[node.nodeName]) {\n return ENTITY_CLASS_BY_NODE_NAME[node.nodeName];\n }\n\n if (node.nodeName === 'A') {\n const anchor = node as HTMLAnchorElement;\n if (anchor.dataset.entityType === ApiMessageEntityTypes.MentionName) {\n return ApiMessageEntityTypes.MentionName;\n }\n if (anchor.dataset.entityType === ApiMessageEntityTypes.Url) {\n return ApiMessageEntityTypes.Url;\n }\n if (anchor.href.startsWith('mailto:')) {\n return ApiMessageEntityTypes.Email;\n }\n if (anchor.href.startsWith('tel:')) {\n return ApiMessageEntityTypes.Phone;\n }\n if (anchor.href !== anchor.textContent) {\n return ApiMessageEntityTypes.TextUrl;\n }\n\n return ApiMessageEntityTypes.Url;\n }\n\n if (node.nodeName === 'SPAN') {\n return (node as HTMLElement).dataset.entityType;\n }\n\n return undefined;\n}\n","const MAX_NESTING_PARENTS = 5;\n\nexport function isSelectionInsideInput(selectionRange: Range, inputId: string) {\n const { commonAncestorContainer } = selectionRange;\n let parentNode: HTMLElement | null = commonAncestorContainer as HTMLElement;\n let iterations = 1;\n while (parentNode && parentNode.id !== inputId && iterations < MAX_NESTING_PARENTS) {\n parentNode = parentNode.parentElement;\n iterations++;\n }\n\n return Boolean(parentNode && parentNode.id === inputId);\n}\n","import {\n useCallback, useEffect, useMemo, useState,\n} from '../../../../lib/teact/teact';\n\nimport { EDITABLE_INPUT_ID } from '../../../../config';\nimport { MEMO_EMPTY_ARRAY } from '../../../../util/memo';\nimport {\n EmojiData, EmojiModule, EmojiRawData, uncompressEmoji,\n} from '../../../../util/emoji';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport {\n buildCollectionByKey, flatten, mapValues, pickTruthy, unique,\n} from '../../../../util/iteratees';\nimport useFlag from '../../../../hooks/useFlag';\n\nlet emojiDataPromise: Promise;\nlet emojiRawData: EmojiRawData;\nlet emojiData: EmojiData;\n\nlet RE_EMOJI_SEARCH: RegExp;\nconst EMOJIS_LIMIT = 36;\nconst FILTER_MIN_LENGTH = 2;\nconst RE_BR = /(
|)/g;\nconst RE_SPACE = / /g;\nconst RE_CLEAN_HTML = /(
|<\\/div>)/gi;\n\ntry {\n RE_EMOJI_SEARCH = new RegExp('(^|\\\\s):[-+_:\\\\p{L}\\\\p{N}]*$', 'gui');\n} catch (e) {\n // Support for older versions of firefox\n RE_EMOJI_SEARCH = new RegExp('(^|\\\\s):[-+_:\\\\d\\\\wа-яё]*$', 'gi');\n}\n\nexport default function useEmojiTooltip(\n isAllowed: boolean,\n html: string,\n recentEmojiIds: string[],\n inputId = EDITABLE_INPUT_ID,\n onUpdateHtml: (html: string) => void,\n baseEmojiKeywords?: Record,\n emojiKeywords?: Record,\n isDisabled = false,\n) {\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n\n const [byId, setById] = useState | undefined>();\n const [keywords, setKeywords] = useState();\n const [byKeyword, setByKeyword] = useState>({});\n const [names, setNames] = useState();\n const [byName, setByName] = useState>({});\n const [shouldForceInsertEmoji, setShouldForceInsertEmoji] = useState(false);\n\n const [filteredEmojis, setFilteredEmojis] = useState(MEMO_EMPTY_ARRAY);\n\n const recentEmojis = useMemo(\n () => {\n if (!byId || !recentEmojiIds.length) {\n return [];\n }\n\n return Object.values(pickTruthy(byId, recentEmojiIds));\n },\n [byId, recentEmojiIds],\n );\n\n // Initialize data on first render.\n useEffect(() => {\n if (isDisabled) return;\n const exec = () => {\n setById(emojiData.emojis);\n };\n\n if (emojiData) {\n exec();\n } else {\n ensureEmojiData()\n .then(exec);\n }\n }, [isDisabled]);\n\n useEffect(() => {\n if (!byId || isDisabled) {\n return;\n }\n\n const emojis = Object.values(byId);\n\n const byNative = buildCollectionByKey(emojis, 'native');\n const baseEmojisByKeyword = baseEmojiKeywords\n ? mapValues(baseEmojiKeywords, (natives) => {\n return Object.values(pickTruthy(byNative, natives));\n })\n : {};\n const emojisByKeyword = emojiKeywords\n ? mapValues(emojiKeywords, (natives) => {\n return Object.values(pickTruthy(byNative, natives));\n })\n : {};\n\n setByKeyword({ ...baseEmojisByKeyword, ...emojisByKeyword });\n setKeywords([...Object.keys(baseEmojisByKeyword), ...Object.keys(emojisByKeyword)]);\n\n const emojisByName = emojis.reduce((result, emoji) => {\n emoji.names.forEach((name) => {\n if (!result[name]) {\n result[name] = [];\n }\n\n result[name].push(emoji);\n });\n\n return result;\n }, {} as Record);\n setByName(emojisByName);\n setNames(Object.keys(emojisByName));\n }, [isDisabled, baseEmojiKeywords, byId, emojiKeywords]);\n\n useEffect(() => {\n if (!isAllowed || !html || !byId || !keywords || !keywords.length) {\n unmarkIsOpen();\n return;\n }\n\n const code = html.includes(':') && getEmojiCode(html);\n if (!code) {\n setFilteredEmojis(MEMO_EMPTY_ARRAY);\n unmarkIsOpen();\n return;\n }\n\n const forceSend = code.length > 2 && code.endsWith(':');\n const filter = code.substr(1, forceSend ? code.length - 2 : undefined);\n let matched: Emoji[] = [];\n\n setShouldForceInsertEmoji(forceSend);\n\n if (!filter) {\n matched = recentEmojis;\n } else if (filter.length >= FILTER_MIN_LENGTH) {\n const matchedKeywords = keywords.filter((keyword) => keyword.startsWith(filter)).sort();\n matched = matched.concat(flatten(Object.values(pickTruthy(byKeyword, matchedKeywords))));\n\n // Also search by names, which is useful for non-English languages\n const matchedNames = names.filter((name) => name.startsWith(filter));\n matched = matched.concat(flatten(Object.values(pickTruthy(byName, matchedNames))));\n\n matched = unique(matched);\n }\n\n if (matched.length) {\n if (!forceSend) {\n markIsOpen();\n }\n setFilteredEmojis(matched.slice(0, EMOJIS_LIMIT));\n } else {\n unmarkIsOpen();\n }\n }, [\n byId, byKeyword, keywords, byName, names, html, isAllowed, markIsOpen,\n recentEmojis, unmarkIsOpen, setShouldForceInsertEmoji,\n ]);\n\n const insertEmoji = useCallback((textEmoji: string, isForce?: boolean) => {\n const atIndex = html.lastIndexOf(':', isForce ? html.lastIndexOf(':') - 1 : undefined);\n if (atIndex !== -1) {\n onUpdateHtml(`${html.substr(0, atIndex)}${textEmoji}`);\n const messageInput = document.getElementById(inputId)!;\n requestAnimationFrame(() => {\n focusEditableElement(messageInput, true);\n });\n }\n\n unmarkIsOpen();\n }, [html, inputId, onUpdateHtml, unmarkIsOpen]);\n\n useEffect(() => {\n if (isOpen && shouldForceInsertEmoji && filteredEmojis.length) {\n insertEmoji(filteredEmojis[0].native, true);\n }\n }, [filteredEmojis, insertEmoji, isOpen, shouldForceInsertEmoji]);\n\n return {\n isEmojiTooltipOpen: isOpen,\n closeEmojiTooltip: unmarkIsOpen,\n filteredEmojis,\n insertEmoji,\n };\n}\n\nfunction getEmojiCode(html: string) {\n const emojis = html\n .replace(RE_SPACE, ' ')\n .replace(RE_BR, '\\n')\n .replace(/\\n$/i, '')\n .replace(RE_CLEAN_HTML, '')\n .match(RE_EMOJI_SEARCH);\n\n return emojis ? emojis[0].trim() : undefined;\n}\n\nasync function ensureEmojiData() {\n if (!emojiDataPromise) {\n emojiDataPromise = import('emoji-data-ios/emoji-data.json') as unknown as Promise;\n emojiRawData = (await emojiDataPromise).default;\n\n emojiData = uncompressEmoji(emojiRawData);\n }\n\n return emojiDataPromise;\n}\n","import { ApiUser } from '../../../../api/types';\nimport { getUserFullName } from '../../../../modules/helpers';\nimport searchWords from '../../../../util/searchWords';\n\n// TODO: Support cyrillic translit search\nexport default function searchUserName(filter: string, user: ApiUser) {\n const usernameLowered = user.username.toLowerCase();\n const fullName = getUserFullName(user);\n const fullNameLowered = fullName && fullName.toLowerCase();\n const filterLowered = filter.toLowerCase();\n\n return usernameLowered.startsWith(filterLowered) || (\n fullNameLowered && searchWords(fullNameLowered, filterLowered)\n );\n}\n","import {\n useCallback, useEffect, useState, useMemo,\n} from '../../../../lib/teact/teact';\n\nimport { ApiMessageEntityTypes, ApiChatMember, ApiUser } from '../../../../api/types';\nimport { EDITABLE_INPUT_ID } from '../../../../config';\nimport { getUserFirstOrLastName } from '../../../../modules/helpers';\nimport searchUserName from '../helpers/searchUserName';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport useFlag from '../../../../hooks/useFlag';\nimport { unique } from '../../../../util/iteratees';\nimport { throttle } from '../../../../util/schedulers';\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\nconst RE_BR = /(
|)/g;\nconst RE_SPACE = / /g;\nconst RE_CLEAN_HTML = /(
|<\\/div>)/gi;\nlet RE_USERNAME_SEARCH: RegExp;\n\ntry {\n RE_USERNAME_SEARCH = new RegExp('(^|\\\\s)@[-_\\\\p{L}\\\\p{M}\\\\p{N}]*$', 'gui');\n} catch (e) {\n // Support for older versions of firefox\n RE_USERNAME_SEARCH = new RegExp('(^|\\\\s)@[-_\\\\d\\\\wа-яё]*$', 'gi');\n}\n\nexport default function useMentionTooltip(\n canSuggestMembers: boolean | undefined,\n html: string,\n onUpdateHtml: (html: string) => void,\n inputId: string = EDITABLE_INPUT_ID,\n groupChatMembers?: ApiChatMember[],\n topInlineBotIds?: number[],\n currentUserId?: number,\n usersById?: Record,\n) {\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n const [usersToMention, setUsersToMention] = useState();\n\n const topInlineBots = useMemo(() => {\n return (topInlineBotIds || []).map((id) => usersById?.[id]).filter(Boolean as any);\n }, [topInlineBotIds, usersById]);\n\n const getFilteredUsers = useCallback((filter, withInlineBots: boolean) => {\n if (!(groupChatMembers || topInlineBotIds) || !usersById) {\n setUsersToMention(undefined);\n\n return;\n }\n runThrottled(() => {\n const inlineBots = (withInlineBots ? topInlineBots : []).filter((inlineBot) => {\n return !filter || searchUserName(filter, inlineBot);\n });\n\n const chatMembers = (groupChatMembers || [])\n .map(({ userId }) => usersById[userId])\n .filter((user) => {\n if (!user || user.id === currentUserId) {\n return false;\n }\n\n return !filter || searchUserName(filter, user);\n });\n\n setUsersToMention(unique(inlineBots.concat(chatMembers)));\n });\n }, [currentUserId, groupChatMembers, topInlineBotIds, topInlineBots, usersById]);\n\n useEffect(() => {\n if (!canSuggestMembers || !html.length) {\n unmarkIsOpen();\n return;\n }\n\n const usernameFilter = html.includes('@') && getUsernameFilter(html);\n\n if (usernameFilter) {\n const filter = usernameFilter ? usernameFilter.substr(1) : '';\n getFilteredUsers(filter, canSuggestInlineBots(html));\n } else {\n unmarkIsOpen();\n }\n }, [canSuggestMembers, html, getFilteredUsers, markIsOpen, unmarkIsOpen]);\n\n useEffect(() => {\n if (usersToMention?.length) {\n markIsOpen();\n } else {\n unmarkIsOpen();\n }\n }, [markIsOpen, unmarkIsOpen, usersToMention]);\n\n const insertMention = useCallback((user: ApiUser, forceFocus = false) => {\n if (!user.username && !getUserFirstOrLastName(user)) {\n return;\n }\n\n const insertedHtml = user.username\n ? `@${user.username}`\n : `${getUserFirstOrLastName(user)}`;\n\n const atIndex = html.lastIndexOf('@');\n if (atIndex !== -1) {\n onUpdateHtml(`${html.substr(0, atIndex)}${insertedHtml} `);\n const messageInput = document.getElementById(inputId)!;\n requestAnimationFrame(() => {\n focusEditableElement(messageInput, forceFocus);\n });\n }\n\n unmarkIsOpen();\n }, [html, inputId, onUpdateHtml, unmarkIsOpen]);\n\n return {\n isMentionTooltipOpen: isOpen,\n closeMentionTooltip: unmarkIsOpen,\n insertMention,\n mentionFilteredUsers: usersToMention,\n };\n}\n\nfunction getUsernameFilter(html: string) {\n const username = html\n .replace(RE_SPACE, ' ')\n .replace(RE_BR, '\\n')\n .replace(RE_CLEAN_HTML, '')\n .replace(/\\n$/i, '')\n .match(RE_USERNAME_SEARCH);\n\n return username ? username[0].trim() : undefined;\n}\n\nfunction canSuggestInlineBots(html: string) {\n return html.startsWith('@');\n}\n","import { useEffect, useRef } from '../../../lib/teact/teact';\n\nimport useOnChange from '../../../hooks/useOnChange';\nimport useForceUpdate from '../../../hooks/useForceUpdate';\n\nexport default function useAsyncRendering(dependencies: T, delay?: number) {\n const isDisabled = delay === undefined;\n const shouldRenderRef = useRef(isDisabled);\n const timeoutRef = useRef();\n const forceUpdate = useForceUpdate();\n\n useOnChange(() => {\n if (isDisabled) {\n return;\n }\n\n shouldRenderRef.current = false;\n\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n }, dependencies);\n\n useEffect(() => {\n if (isDisabled || shouldRenderRef.current) {\n return;\n }\n\n const exec = () => {\n shouldRenderRef.current = true;\n forceUpdate();\n };\n\n if (delay! > 0) {\n timeoutRef.current = window.setTimeout(exec, delay);\n } else {\n exec();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n\n return shouldRenderRef.current;\n}\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\nimport { TextPart } from '../common/helpers/renderMessageText';\n\nimport Modal from './Modal';\nimport Button from './Button';\n\ntype OwnProps = {\n isOpen: boolean;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n title?: string;\n header?: FC;\n textParts?: TextPart[];\n text?: string;\n confirmLabel?: string;\n confirmHandler: () => void;\n confirmIsDestructive?: boolean;\n isButtonsInOneRow?: boolean;\n};\n\nconst ConfirmDialog: FC = ({\n isOpen,\n onClose,\n onCloseAnimationEnd,\n title,\n header,\n text,\n textParts,\n confirmLabel = 'Confirm',\n confirmHandler,\n confirmIsDestructive,\n isButtonsInOneRow,\n}) => {\n const lang = useLang();\n\n return (\n \n {text && text.split('\\\\n').map((textPart) => (\n

{textPart}

\n ))}\n {textParts}\n
\n \n {confirmLabel}\n \n \n
\n \n );\n};\n\nexport default memo(ConfirmDialog);\n","import React, { FC } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport Button, { OwnProps as ButtonProps } from './Button';\n\nimport './FloatingActionButton.scss';\n\ntype OwnProps = {\n isShown: boolean;\n className?: string;\n color?: ButtonProps['color'];\n ariaLabel?: ButtonProps['ariaLabel'];\n disabled?: boolean;\n onClick: () => void;\n children: any;\n};\n\nconst FloatingActionButton: FC = ({\n isShown,\n className,\n color = 'primary',\n ariaLabel,\n disabled,\n onClick,\n children,\n}) => {\n const buttonClassName = buildClassName(\n 'FloatingActionButton',\n isShown && 'revealed',\n className,\n );\n\n return (\n \n {children}\n \n );\n};\n\nexport default FloatingActionButton;\n","import { RefObject, UIEvent } from 'react';\nimport { LoadMoreDirection } from '../../types';\n\nimport React, {\n FC, useCallback, useEffect, useLayoutEffect, useMemo, useRef,\n} from '../../lib/teact/teact';\n\nimport { debounce } from '../../util/schedulers';\nimport resetScroll from '../../util/resetScroll';\n\ntype OwnProps = {\n ref?: RefObject;\n className?: string;\n onLoadMore?: ({ direction }: { direction: LoadMoreDirection; noScroll?: boolean }) => void;\n onScroll?: (e: UIEvent) => void;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n items?: any[];\n itemSelector?: string;\n preloadBackwards?: number;\n sensitiveArea?: number;\n noScrollRestore?: boolean;\n noScrollRestoreOnTop?: boolean;\n noFastList?: boolean;\n cacheBuster?: any;\n children: any;\n};\n\nconst DEFAULT_LIST_SELECTOR = '.ListItem';\nconst DEFAULT_PRELOAD_BACKWARDS = 20;\nconst DEFAULT_SENSITIVE_AREA = 800;\n\nconst InfiniteScroll: FC = ({\n ref,\n className,\n onLoadMore,\n onScroll,\n onKeyDown,\n items,\n itemSelector = DEFAULT_LIST_SELECTOR,\n preloadBackwards = DEFAULT_PRELOAD_BACKWARDS,\n sensitiveArea = DEFAULT_SENSITIVE_AREA,\n // Used to turn off restoring scroll position (e.g. for frequently re-ordered chat or user lists)\n noScrollRestore = false,\n noScrollRestoreOnTop = false,\n noFastList,\n // Used to re-query `listItemElements` if rendering is delayed by transition\n cacheBuster,\n children,\n}: OwnProps) => {\n // eslint-disable-next-line no-null/no-null\n let containerRef = useRef(null);\n if (ref) {\n containerRef = ref;\n }\n\n const stateRef = useRef<{\n listItemElements?: NodeListOf;\n isScrollTopJustUpdated?: boolean;\n currentAnchor?: HTMLDivElement | undefined;\n currentAnchorTop?: number;\n }>({});\n\n const [loadMoreBackwards, loadMoreForwards] = useMemo(() => {\n if (!onLoadMore) {\n return [];\n }\n\n return [\n debounce((noScroll = false) => {\n onLoadMore({ direction: LoadMoreDirection.Backwards, noScroll });\n }, 1000, true, false),\n debounce(() => {\n onLoadMore({ direction: LoadMoreDirection.Forwards });\n }, 1000, true, false),\n ];\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [onLoadMore, items]);\n\n // Initial preload\n useEffect(() => {\n if (!loadMoreBackwards) {\n return;\n }\n\n if (preloadBackwards > 0 && (!items || items.length < preloadBackwards)) {\n loadMoreBackwards(true);\n return;\n }\n\n const { scrollHeight, clientHeight } = containerRef.current!;\n if (clientHeight && scrollHeight <= clientHeight) {\n loadMoreBackwards();\n }\n }, [items, loadMoreBackwards, preloadBackwards]);\n\n // Restore `scrollTop` after adding items\n useLayoutEffect(() => {\n const container = containerRef.current!;\n const state = stateRef.current;\n\n state.listItemElements = container.querySelectorAll(itemSelector);\n\n let newScrollTop;\n\n if (state.currentAnchor && Array.from(state.listItemElements).includes(state.currentAnchor)) {\n const { scrollTop } = container;\n const newAnchorTop = state.currentAnchor.getBoundingClientRect().top;\n newScrollTop = scrollTop + (newAnchorTop - state.currentAnchorTop!);\n } else {\n const nextAnchor = state.listItemElements[0];\n if (nextAnchor) {\n state.currentAnchor = nextAnchor;\n state.currentAnchorTop = nextAnchor.getBoundingClientRect().top;\n }\n }\n\n if (noScrollRestore) {\n return;\n }\n\n if (noScrollRestoreOnTop && container.scrollTop === 0) {\n return;\n }\n\n resetScroll(container, newScrollTop);\n\n state.isScrollTopJustUpdated = true;\n }, [items, itemSelector, noScrollRestore, noScrollRestoreOnTop, cacheBuster]);\n\n const handleScroll = useCallback((e: UIEvent) => {\n if (loadMoreForwards && loadMoreBackwards) {\n const {\n isScrollTopJustUpdated, currentAnchor, currentAnchorTop,\n } = stateRef.current;\n const listItemElements = stateRef.current.listItemElements!;\n\n if (isScrollTopJustUpdated) {\n stateRef.current.isScrollTopJustUpdated = false;\n return;\n }\n\n const listLength = listItemElements.length;\n const container = containerRef.current!;\n const { scrollTop, scrollHeight, offsetHeight } = container;\n const top = listLength ? listItemElements[0].offsetTop : 0;\n const isNearTop = scrollTop <= top + sensitiveArea;\n const bottom = listLength\n ? listItemElements[listLength - 1].offsetTop + listItemElements[listLength - 1].offsetHeight\n : scrollHeight;\n const isNearBottom = bottom - (scrollTop + offsetHeight) <= sensitiveArea;\n let isUpdated = false;\n\n if (isNearTop) {\n const nextAnchor = listItemElements[0];\n if (nextAnchor) {\n const nextAnchorTop = nextAnchor.getBoundingClientRect().top;\n const newAnchorTop = currentAnchor?.offsetParent && currentAnchor !== nextAnchor\n ? currentAnchor.getBoundingClientRect().top\n : nextAnchorTop;\n const isMovingUp = (\n currentAnchor && currentAnchorTop !== undefined && newAnchorTop > currentAnchorTop\n );\n\n if (isMovingUp) {\n stateRef.current.currentAnchor = nextAnchor;\n stateRef.current.currentAnchorTop = nextAnchorTop;\n isUpdated = true;\n resetScroll(container);\n loadMoreForwards();\n }\n }\n }\n\n if (isNearBottom) {\n const nextAnchor = listItemElements[listLength - 1];\n if (nextAnchor) {\n const nextAnchorTop = nextAnchor.getBoundingClientRect().top;\n const newAnchorTop = currentAnchor?.offsetParent && currentAnchor !== nextAnchor\n ? currentAnchor.getBoundingClientRect().top\n : nextAnchorTop;\n const isMovingDown = (\n currentAnchor && currentAnchorTop !== undefined && newAnchorTop < currentAnchorTop\n );\n\n if (isMovingDown) {\n stateRef.current.currentAnchor = nextAnchor;\n stateRef.current.currentAnchorTop = nextAnchorTop;\n isUpdated = true;\n resetScroll(container);\n loadMoreBackwards();\n }\n }\n }\n\n if (!isUpdated) {\n if (currentAnchor?.offsetParent) {\n stateRef.current.currentAnchorTop = currentAnchor.getBoundingClientRect().top;\n } else {\n const nextAnchor = listItemElements[0];\n\n if (nextAnchor) {\n stateRef.current.currentAnchor = nextAnchor;\n stateRef.current.currentAnchorTop = nextAnchor.getBoundingClientRect().top;\n }\n }\n }\n }\n\n if (onScroll) {\n onScroll(e);\n }\n }, [loadMoreBackwards, loadMoreForwards, onScroll, sensitiveArea]);\n\n return (\n \n {children}\n
\n );\n};\n\nexport default InfiniteScroll;\n","import { RefObject } from 'react';\nimport React, { FC, useRef, useCallback } from '../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport { fastRaf } from '../../util/schedulers';\nimport buildClassName from '../../util/buildClassName';\nimport useContextMenuHandlers from '../../hooks/useContextMenuHandlers';\nimport useContextMenuPosition from '../../hooks/useContextMenuPosition';\nimport useFlag from '../../hooks/useFlag';\nimport useLang from '../../hooks/useLang';\n\nimport RippleEffect from './RippleEffect';\nimport Menu from './Menu';\nimport MenuItem from './MenuItem';\n\nimport './ListItem.scss';\n\ninterface MenuItemContextAction {\n title: string;\n icon: string;\n destructive?: boolean;\n handler?: () => void;\n}\n\ninterface OwnProps {\n ref?: RefObject;\n buttonRef?: RefObject;\n icon?: string;\n className?: string;\n style?: string;\n children: any;\n disabled?: boolean;\n ripple?: boolean;\n narrow?: boolean;\n inactive?: boolean;\n focus?: boolean;\n destructive?: boolean;\n multiline?: boolean;\n isStatic?: boolean;\n contextActions?: MenuItemContextAction[];\n onMouseDown?: (e: React.MouseEvent) => void;\n onClick?: (e: React.MouseEvent) => void;\n}\n\nconst ListItem: FC = (props) => {\n const {\n ref,\n buttonRef,\n icon,\n className,\n style,\n children,\n disabled,\n ripple,\n narrow,\n inactive,\n focus,\n destructive,\n multiline,\n isStatic,\n contextActions,\n onMouseDown,\n onClick,\n } = props;\n\n // eslint-disable-next-line no-null/no-null\n let containerRef = useRef(null);\n if (ref) {\n containerRef = ref;\n }\n const [isTouched, markIsTouched, unmarkIsTouched] = useFlag();\n\n const {\n isContextMenuOpen, contextMenuPosition,\n handleBeforeContextMenu, handleContextMenu,\n handleContextMenuClose, handleContextMenuHide,\n } = useContextMenuHandlers(containerRef, !contextActions);\n\n const getTriggerElement = useCallback(() => containerRef.current, []);\n\n const getRootElement = useCallback(\n () => containerRef.current!.closest('.custom-scroll'),\n [],\n );\n\n const getMenuElement = useCallback(\n () => containerRef.current!.querySelector('.ListItem-context-menu .bubble'),\n [],\n );\n\n const { positionX, positionY, style: menuStyle } = useContextMenuPosition(\n contextMenuPosition,\n getTriggerElement,\n getRootElement,\n getMenuElement,\n );\n\n const handleClick = useCallback((e: React.MouseEvent) => {\n if (disabled || !onClick) {\n return;\n }\n onClick(e);\n\n if (IS_TOUCH_ENV && !ripple) {\n markIsTouched();\n fastRaf(unmarkIsTouched);\n }\n }, [disabled, markIsTouched, onClick, ripple, unmarkIsTouched]);\n\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n if (inactive || IS_TOUCH_ENV) {\n return;\n }\n if (contextActions && (e.button === 2 || !onClick)) {\n handleBeforeContextMenu(e);\n }\n if (e.button === 0) {\n if (!onClick) {\n handleContextMenu(e);\n } else {\n handleClick(e);\n }\n }\n }, [inactive, contextActions, onClick, handleBeforeContextMenu, handleContextMenu, handleClick]);\n\n const lang = useLang();\n\n const fullClassName = buildClassName(\n 'ListItem',\n className,\n !isStatic && 'no-selection',\n ripple && 'has-ripple',\n narrow && 'narrow',\n disabled && 'disabled',\n inactive && 'inactive',\n contextMenuPosition && 'has-menu-open',\n focus && 'focus',\n destructive && 'destructive',\n multiline && 'multiline',\n isStatic && 'is-static',\n );\n\n return (\n \n \n {icon && (\n \n )}\n {multiline && (
{children}
)}\n {!multiline && children}\n {!disabled && !inactive && ripple && (\n \n )}\n
\n {contextActions && contextMenuPosition !== undefined && (\n \n {contextActions.map((action) => (\n \n {action.title}\n \n ))}\n \n )}\n
\n );\n};\n\nexport default ListItem;\n","import React, {\n FC, useEffect, useRef,\n} from '../../lib/teact/teact';\n\nimport { TextPart } from '../common/helpers/renderMessageText';\n\nimport captureKeyboardListeners from '../../util/captureKeyboardListeners';\nimport trapFocus from '../../util/trapFocus';\nimport buildClassName from '../../util/buildClassName';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Button from './Button';\nimport Portal from './Portal';\n\nimport './Modal.scss';\n\nconst ANIMATION_DURATION = 200;\n\ntype OwnProps = {\n title?: string | TextPart[];\n className?: string;\n isOpen?: boolean;\n header?: any;\n hasCloseButton?: boolean;\n noBackdrop?: boolean;\n children: any;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n onEnter?: () => void;\n};\n\ntype StateProps = {\n shouldSkipHistoryAnimations?: boolean;\n};\n\nconst Modal: FC = ({\n title,\n className,\n isOpen,\n header,\n hasCloseButton,\n noBackdrop,\n children,\n onClose,\n onCloseAnimationEnd,\n onEnter,\n shouldSkipHistoryAnimations,\n}) => {\n const {\n shouldRender,\n transitionClassNames,\n } = useShowTransition(\n isOpen, onCloseAnimationEnd, shouldSkipHistoryAnimations, undefined, shouldSkipHistoryAnimations,\n );\n // eslint-disable-next-line no-null/no-null\n const modalRef = useRef(null);\n\n useEffect(() => (isOpen\n ? captureKeyboardListeners({ onEsc: onClose, onEnter })\n : undefined), [isOpen, onClose, onEnter]);\n useEffect(() => (isOpen && modalRef.current ? trapFocus(modalRef.current) : undefined), [isOpen]);\n\n const { forceClose } = useHistoryBack(isOpen, onClose);\n\n // For modals that are closed by unmounting without changing `isOpen` to `false`\n useEffect(() => {\n return () => {\n if (isOpen) {\n forceClose();\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffectWithPrevDeps(([prevIsOpen]) => {\n document.body.classList.toggle('has-open-dialog', isOpen);\n\n if (isOpen || (!isOpen && prevIsOpen !== undefined)) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION);\n }\n\n return () => {\n document.body.classList.remove('has-open-dialog');\n };\n }, [isOpen]);\n\n const lang = useLang();\n\n if (!shouldRender) {\n return undefined;\n }\n\n function renderHeader() {\n if (header) {\n return header;\n }\n\n if (!title) {\n return undefined;\n }\n\n return (\n
\n {hasCloseButton && (\n \n \n \n )}\n
{title}
\n
\n );\n }\n\n const fullClassName = buildClassName(\n 'Modal',\n className,\n transitionClassNames,\n noBackdrop && 'transparent-backdrop',\n );\n\n return (\n \n \n
\n
\n
\n {renderHeader()}\n
\n {children}\n
\n
\n
\n
\n
\n );\n};\n\nexport default Modal;\n","export default function trapFocus(element: HTMLElement) {\n function handleKeyDown(e: KeyboardEvent) {\n if (e.key !== 'Tab') {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n\n const focusableElements = Array.from(\n element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'),\n ) as HTMLElement[];\n if (!focusableElements.length) {\n return;\n }\n\n const currentFocusedIndex = focusableElements.findIndex((em) => em.isSameNode(document.activeElement));\n let newFocusedIndex = 0;\n if (currentFocusedIndex >= 0) {\n if (e.shiftKey) {\n newFocusedIndex = currentFocusedIndex > 0\n ? currentFocusedIndex - 1\n : focusableElements.length - 1;\n } else {\n newFocusedIndex = currentFocusedIndex < focusableElements.length - 1\n ? currentFocusedIndex + 1\n : 0;\n }\n }\n\n focusableElements[newFocusedIndex].focus();\n }\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n}\n","import React, {\n FC,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from '../../lib/teact/teact';\n\nimport { ANIMATION_END_DELAY } from '../../config';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport { TextPart } from '../common/helpers/renderMessageText';\nimport buildClassName from '../../util/buildClassName';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\n\nimport Portal from './Portal';\n\nimport './Notification.scss';\n\ntype OwnProps = {\n containerId?: string;\n message: TextPart[];\n duration?: number;\n onDismiss: () => void;\n};\n\nconst DEFAULT_DURATION = 3000;\nconst ANIMATION_DURATION = 150;\n\nconst Notification: FC = ({\n message, duration = DEFAULT_DURATION, containerId, onDismiss,\n}) => {\n const [isOpen, setIsOpen] = useState(true);\n // eslint-disable-next-line no-null/no-null\n const timerRef = useRef(null);\n\n const { transitionClassNames } = useShowTransition(isOpen);\n\n const closeAndDismiss = useCallback(() => {\n setIsOpen(false);\n setTimeout(onDismiss, ANIMATION_DURATION + ANIMATION_END_DELAY);\n }, [onDismiss]);\n\n useEffect(() => (isOpen ? captureEscKeyListener(closeAndDismiss) : undefined), [isOpen, closeAndDismiss]);\n\n useEffect(() => {\n timerRef.current = window.setTimeout(closeAndDismiss, duration);\n\n return () => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = undefined;\n }\n };\n }, [duration, closeAndDismiss]);\n\n const handleMouseEnter = useCallback(() => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = undefined;\n }\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n timerRef.current = window.setTimeout(closeAndDismiss, duration);\n }, [duration, closeAndDismiss]);\n\n return (\n \n \n
\n {message}\n
\n
\n \n );\n};\n\nexport default Notification;\n","import { FC, useRef, useLayoutEffect } from '../../lib/teact/teact';\nimport TeactDOM from '../../lib/teact/teact-dom';\n\ntype OwnProps = {\n containerId?: string;\n className?: string;\n children: any;\n};\n\nconst Portal: FC = ({ containerId, className, children }) => {\n const elementRef = useRef();\n if (!elementRef.current) {\n elementRef.current = document.createElement('div');\n }\n\n useLayoutEffect(() => {\n const container = document.querySelector(containerId || '#portals');\n if (!container) {\n return undefined;\n }\n\n const element = elementRef.current!;\n if (className) {\n element.classList.add(className);\n }\n\n container.appendChild(element);\n\n return () => {\n TeactDOM.render(undefined, element);\n container.removeChild(element);\n };\n }, [className, containerId]);\n\n return TeactDOM.render(children, elementRef.current);\n};\n\nexport default Portal;\n","import React, {\n FC, useEffect, useRef, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport './ProgressSpinner.scss';\n\nconst RADIUSES = {\n s: 22, m: 25, l: 28, xl: 20,\n};\nconst STROKE_WIDTH = 2;\nconst MIN_PROGRESS = 0.05;\nconst MAX_PROGRESS = 1;\n\nconst ProgressSpinner: FC<{\n progress?: number;\n size?: 's' | 'm' | 'l' | 'xl';\n square?: boolean;\n transparent?: boolean;\n noCross?: boolean;\n onClick?: (e: React.MouseEvent) => void;\n}> = ({\n progress = 0,\n size = 'l',\n square,\n transparent,\n noCross,\n onClick,\n}) => {\n const radius = RADIUSES[size];\n const circleRadius = radius - STROKE_WIDTH * 2;\n const borderRadius = radius - 1;\n const circumference = circleRadius * 2 * Math.PI;\n // eslint-disable-next-line no-null/no-null\n const container = useRef(null);\n\n useEffect(() => {\n if (!container.current) {\n return;\n }\n\n const svg = container.current.firstElementChild;\n const strokeDashOffset = circumference - Math.min(Math.max(MIN_PROGRESS, progress), MAX_PROGRESS) * circumference;\n\n if (!svg) {\n container.current.innerHTML = `\n \n `;\n } else {\n (svg.firstElementChild as SVGElement).setAttribute('stroke-dashoffset', strokeDashOffset.toString());\n }\n }, [container, circumference, borderRadius, circleRadius, progress]);\n\n const className = buildClassName(\n `ProgressSpinner size-${size}`,\n transparent && 'transparent',\n square && 'square',\n noCross && 'no-cross',\n );\n\n return (\n \n );\n};\n\nexport default memo(ProgressSpinner);\n","import { ChangeEvent } from 'react';\nimport React, { FC, memo } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Spinner from './Spinner';\n\nimport './Radio.scss';\n\ntype OwnProps = {\n id?: string;\n name: string;\n label: string;\n subLabel?: string;\n value: string;\n checked: boolean;\n disabled?: boolean;\n hidden?: boolean;\n isLoading?: boolean;\n onChange: (e: ChangeEvent) => void;\n};\n\nconst Radio: FC = ({\n id,\n label,\n subLabel,\n value,\n name,\n checked,\n disabled,\n hidden,\n isLoading,\n onChange,\n}) => {\n const lang = useLang();\n const className = buildClassName(\n 'Radio',\n disabled && 'disabled',\n hidden && 'hidden-widget',\n isLoading && 'loading',\n );\n\n return (\n \n );\n};\n\nexport default memo(Radio);\n","import { ChangeEvent } from 'react';\nimport React, { FC, useCallback, memo } from '../../lib/teact/teact';\n\nimport Radio from './Radio';\n\ntype IRadioOption = {\n label: string;\n subLabel?: string;\n value: string;\n hidden?: boolean;\n};\n\ntype OwnProps = {\n id?: string;\n name: string;\n options: IRadioOption[];\n selected?: string;\n disabled?: boolean;\n loadingOption?: string;\n onChange: (value: string) => void;\n};\n\nconst RadioGroup: FC = ({\n id,\n name,\n options,\n selected,\n disabled,\n loadingOption,\n onChange,\n}) => {\n const handleChange = useCallback((event: ChangeEvent) => {\n const { value } = event.currentTarget;\n onChange(value);\n }, [onChange]);\n\n return (\n
\n {options.map((option) => (\n
\n );\n};\n\nexport default memo(RadioGroup);\n","import { RefObject } from 'react';\nimport React, {\n FC, useRef, useEffect, memo, useCallback,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useFlag from '../../hooks/useFlag';\nimport useLang from '../../hooks/useLang';\n\nimport Loading from './Loading';\nimport Button from './Button';\n\nimport './SearchInput.scss';\n\ntype OwnProps = {\n ref?: RefObject;\n children?: any;\n parentContainerClassName?: string;\n className?: string;\n inputId?: string;\n value?: string;\n focused?: boolean;\n isLoading?: boolean;\n placeholder?: string;\n disabled?: boolean;\n autoComplete?: string;\n canClose?: boolean;\n onChange: (value: string) => void;\n onReset?: NoneToVoidFunction;\n onFocus?: NoneToVoidFunction;\n onBlur?: NoneToVoidFunction;\n};\n\nconst SearchInput: FC = ({\n ref,\n children,\n parentContainerClassName,\n value,\n inputId,\n className,\n focused,\n isLoading,\n placeholder,\n disabled,\n autoComplete,\n canClose,\n onChange,\n onReset,\n onFocus,\n onBlur,\n}) => {\n // eslint-disable-next-line no-null/no-null\n let inputRef = useRef(null);\n if (ref) {\n inputRef = ref;\n }\n\n const [isInputFocused, markInputFocused, unmarkInputFocused] = useFlag(focused);\n\n useEffect(() => {\n if (!inputRef.current) {\n return;\n }\n\n if (focused) {\n inputRef.current.focus();\n } else {\n inputRef.current.blur();\n }\n }, [focused, placeholder]); // Trick for setting focus when selecting a contact to search for\n\n const lang = useLang();\n\n function handleChange(event: React.ChangeEvent) {\n const { currentTarget } = event;\n onChange(currentTarget.value);\n }\n\n function handleFocus() {\n markInputFocused();\n if (onFocus) {\n onFocus();\n }\n }\n\n function handleBlur() {\n unmarkInputFocused();\n if (onBlur) {\n onBlur();\n }\n }\n\n const handleKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.key === 'ArrowDown' || e.key === 'Enter') {\n const element = document.querySelector(`.${parentContainerClassName} .ListItem-button`) as HTMLElement;\n if (element) {\n element.focus();\n }\n }\n }, [parentContainerClassName]);\n\n return (\n \n {children}\n \n \n {isLoading && (\n \n )}\n {!isLoading && (value || canClose) && onReset && (\n \n \n \n )}\n
\n );\n};\n\nexport default memo(SearchInput);\n","import React, { FC, useRef } from '../../lib/teact/teact';\n\nimport useShowTransition from '../../hooks/useShowTransition';\nimport usePrevious from '../../hooks/usePrevious';\nimport buildClassName from '../../util/buildClassName';\n\ntype ChildrenFn = () => any;\n\ntype OwnProps = {\n isOpen: boolean;\n isCustom?: boolean;\n id?: string;\n className?: string;\n onClick?: (e: React.MouseEvent) => void;\n children: ChildrenFn;\n};\n\nconst ShowTransition: FC = ({\n isOpen, isCustom, id, className, onClick, children,\n}) => {\n const { shouldRender, transitionClassNames } = useShowTransition(\n isOpen, undefined, undefined, isCustom ? false : undefined,\n );\n const prevIsOpen = usePrevious(isOpen);\n const prevChildren = usePrevious(children);\n const fromChildrenRef = useRef();\n\n if (prevIsOpen && !isOpen) {\n fromChildrenRef.current = prevChildren;\n }\n\n return (\n shouldRender && (\n
\n {isOpen ? children() : fromChildrenRef.current!()}\n
\n )\n );\n};\n\nexport default ShowTransition;\n","import { ChangeEvent } from 'react';\nimport React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport './Switcher.scss';\n\ntype OwnProps = {\n id?: string;\n name?: string;\n value?: string;\n label: string;\n checked?: boolean;\n disabled?: boolean;\n inactive?: boolean;\n noAnimation?: boolean;\n onChange?: (e: ChangeEvent) => void;\n onCheck?: (isChecked: boolean) => void;\n};\n\nconst Switcher: FC = ({\n id,\n name,\n value,\n label,\n checked = false,\n disabled,\n inactive,\n noAnimation,\n onChange,\n onCheck,\n}) => {\n const handleChange = useCallback((e: ChangeEvent) => {\n if (onChange) {\n onChange(e);\n }\n\n if (onCheck) {\n onCheck(e.currentTarget.checked);\n }\n }, [onChange, onCheck]);\n\n const className = buildClassName(\n 'Switcher',\n disabled && 'disabled',\n inactive && 'inactive',\n noAnimation && 'no-animation',\n );\n\n return (\n \n );\n};\n\nexport default memo(Switcher);\n","import React, {\n FC, useLayoutEffect, useRef, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport renderText from '../common/helpers/renderText';\n\nimport './Tab.scss';\n\ntype OwnProps = {\n className?: string;\n title: string;\n active?: boolean;\n badgeCount?: number;\n isBadgeActive?: boolean;\n previousActiveTab?: number;\n onClick: (arg: number) => void;\n clickArg: number;\n};\n\nconst Tab: FC = ({\n className,\n title,\n active,\n badgeCount,\n isBadgeActive,\n previousActiveTab,\n onClick,\n clickArg,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const tabRef = useRef(null);\n\n useLayoutEffect(() => {\n if (!active || previousActiveTab === undefined) {\n return;\n }\n\n const tab = tabRef.current!;\n const indicator = tab.querySelector('i')!;\n const prevTab = tab.parentElement!.children[previousActiveTab];\n if (!prevTab) {\n return;\n }\n const currentIndicator = prevTab.querySelector('i')!;\n\n currentIndicator.classList.remove('animate');\n indicator.classList.remove('animate');\n\n // We move and resize our indicator so it repeats the position and size of the previous one.\n const shiftLeft = currentIndicator.parentElement!.offsetLeft - indicator.parentElement!.offsetLeft;\n const scaleFactor = currentIndicator.clientWidth / indicator.clientWidth;\n indicator.style.transform = `translate3d(${shiftLeft}px, 0, 0) scale3d(${scaleFactor}, 1, 1)`;\n\n // 3 AFs needed here to synchronize animations with Transition component\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n // Now we remove the transform to let it animate to its own position and size.\n indicator.classList.add('animate');\n indicator.style.transform = 'none';\n });\n });\n });\n }, [active, previousActiveTab]);\n\n return (\n onClick(clickArg)}\n ref={tabRef}\n >\n \n {renderText(title)}\n {!!badgeCount && (\n {badgeCount}\n )}\n \n \n \n );\n};\n\nexport default memo(Tab);\n","import React, {\n FC, memo, useRef, useEffect,\n} from '../../lib/teact/teact';\n\nimport fastSmoothScrollHorizontal from '../../util/fastSmoothScrollHorizontal';\nimport usePrevious from '../../hooks/usePrevious';\nimport useHorizontalScroll from '../../hooks/useHorizontalScroll';\nimport useLang from '../../hooks/useLang';\n\nimport Tab from './Tab';\n\nimport './TabList.scss';\n\nexport type TabWithProperties = {\n title: string;\n badgeCount?: number;\n isBadgeActive?: boolean;\n};\n\ntype OwnProps = {\n tabs: readonly TabWithProperties[];\n activeTab: number;\n big?: boolean;\n onSwitchTab: (index: number) => void;\n};\n\nconst TAB_SCROLL_THRESHOLD_PX = 16;\n\nconst TabList: FC = ({\n tabs, activeTab, big, onSwitchTab,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const previousActiveTab = usePrevious(activeTab);\n\n useHorizontalScroll(containerRef.current);\n\n // Scroll container to place active tab in the center\n useEffect(() => {\n const container = containerRef.current!;\n if (container.scrollWidth <= container.offsetWidth) {\n return;\n }\n\n const activeTabElement = container.querySelector('.Tab.active') as HTMLElement | null;\n if (activeTabElement) {\n const newLeft = activeTabElement.offsetLeft - (container.offsetWidth / 2) + (activeTabElement.offsetWidth / 2);\n\n // Prevent scrolling by only a couple of pixels, which doesn't look smooth\n if (Math.abs(newLeft - container.scrollLeft) < TAB_SCROLL_THRESHOLD_PX) {\n return;\n }\n\n fastSmoothScrollHorizontal(container, newLeft);\n }\n }, [activeTab]);\n\n const lang = useLang();\n\n return (\n \n {tabs.map((tab, i) => (\n \n ))}\n
\n );\n};\n\nexport default memo(TabList);\n","import { RefObject } from 'react';\nimport React, {\n FC, useLayoutEffect, useRef,\n} from '../../lib/teact/teact';\nimport { getGlobal } from '../../lib/teact/teactn';\n\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport usePrevious from '../../hooks/usePrevious';\nimport buildClassName from '../../util/buildClassName';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport { waitForAnimationEnd } from '../../util/cssAnimationEndListeners';\n\nimport './Transition.scss';\n\ntype ChildrenFn = (isActive: boolean, isFrom: boolean, currentKey: number) => any;\ntype OwnProps = {\n ref?: RefObject;\n activeKey: number;\n name: (\n 'none' | 'slide' | 'slide-reversed' | 'mv-slide' | 'slide-fade' | 'zoom-fade' | 'slide-layers'\n | 'fade' | 'push-slide' | 'reveal'\n );\n direction?: 'auto' | 'inverse' | 1 | -1;\n renderCount?: number;\n shouldRestoreHeight?: boolean;\n shouldCleanup?: boolean;\n cleanupExceptionKey?: number;\n id?: string;\n className?: string;\n onStart?: () => void;\n onStop?: () => void;\n children: ChildrenFn;\n};\n\nconst CLEANED_UP = Symbol('CLEANED_UP');\n\nconst Transition: FC = ({\n ref,\n activeKey,\n name,\n direction = 'auto',\n renderCount,\n shouldRestoreHeight,\n shouldCleanup,\n cleanupExceptionKey,\n id,\n className,\n onStart,\n onStop,\n children,\n}) => {\n // No need for a container to update on change\n const { animationLevel } = getGlobal().settings.byKey;\n const currentKeyRef = useRef();\n\n // eslint-disable-next-line no-null/no-null\n let containerRef = useRef(null);\n if (ref) {\n containerRef = ref;\n }\n\n const rendersRef = useRef>({});\n const prevActiveKey = usePrevious(activeKey);\n const forceUpdate = useForceUpdate();\n\n const activeKeyChanged = prevActiveKey !== undefined && activeKey !== prevActiveKey;\n\n if (!renderCount && activeKeyChanged) {\n rendersRef.current = { [prevActiveKey]: rendersRef.current[prevActiveKey] };\n }\n\n rendersRef.current[activeKey] = children;\n\n useLayoutEffect(() => {\n function cleanup() {\n if (!shouldCleanup || (cleanupExceptionKey !== undefined && cleanupExceptionKey === prevActiveKey)) {\n return;\n }\n\n rendersRef.current = { [prevActiveKey]: CLEANED_UP };\n forceUpdate();\n }\n\n const container = containerRef.current!;\n\n const childElements = container.children;\n if (childElements.length === 1 && !activeKeyChanged) {\n childElements[0].classList.add('active');\n\n return;\n }\n\n const childNodes = Array.from(container.childNodes);\n\n if (!activeKeyChanged || !childNodes.length) {\n return;\n }\n\n const isBackwards = (\n direction === -1\n || (direction === 'auto' && prevActiveKey > activeKey)\n || (direction === 'inverse' && prevActiveKey < activeKey)\n );\n\n container.classList.remove('animating');\n container.classList.toggle('backwards', isBackwards);\n\n const keys = Object.keys(rendersRef.current).map(Number);\n const prevActiveIndex = renderCount ? prevActiveKey : keys.indexOf(prevActiveKey);\n const activeIndex = renderCount ? activeKey : keys.indexOf(activeKey);\n\n if (name === 'none' || animationLevel === 0) {\n childNodes.forEach((node, i) => {\n if (node instanceof HTMLElement) {\n node.classList.remove('from', 'through', 'to');\n node.classList.toggle('active', i === activeIndex);\n }\n });\n\n cleanup();\n\n return;\n }\n\n childNodes.forEach((node, i) => {\n if (node instanceof HTMLElement) {\n node.classList.remove('active');\n node.classList.toggle('from', i === prevActiveIndex);\n node.classList.toggle('through', (\n (i > prevActiveIndex && i < activeIndex) || (i < prevActiveIndex && i > activeIndex)\n ));\n node.classList.toggle('to', i === activeIndex);\n }\n });\n\n let dispatchHeavyAnimationStop: NoneToVoidFunction;\n if (animationLevel > 0) {\n dispatchHeavyAnimationStop = dispatchHeavyAnimationEvent();\n }\n\n requestAnimationFrame(() => {\n container.classList.add('animating');\n\n if (onStart) {\n onStart();\n }\n\n function onAnimationEnd() {\n requestAnimationFrame(() => {\n if (activeKey !== currentKeyRef.current) {\n return;\n }\n\n container.classList.remove('animating', 'backwards');\n\n childNodes.forEach((node, i) => {\n if (node instanceof HTMLElement) {\n node.classList.remove('from', 'through', 'to');\n node.classList.toggle('active', i === activeIndex);\n }\n });\n\n if (shouldRestoreHeight) {\n const activeElement = container.querySelector('.active');\n\n if (activeElement) {\n activeElement.style.height = 'auto';\n container.style.height = `${activeElement.clientHeight}px`;\n }\n }\n\n if (dispatchHeavyAnimationStop) {\n dispatchHeavyAnimationStop();\n }\n\n cleanup();\n\n if (onStop) {\n onStop();\n }\n });\n }\n\n const watchedNode = name === 'mv-slide'\n ? childNodes[activeIndex]?.firstChild\n : name === 'reveal' && isBackwards\n ? childNodes[prevActiveIndex]\n : childNodes[activeIndex];\n\n currentKeyRef.current = activeKey;\n\n if (animationLevel > 0 && watchedNode) {\n waitForAnimationEnd(watchedNode, onAnimationEnd);\n } else {\n onAnimationEnd();\n }\n });\n }, [\n activeKey,\n prevActiveKey,\n activeKeyChanged,\n direction,\n name,\n onStart,\n onStop,\n renderCount,\n shouldRestoreHeight,\n shouldCleanup,\n cleanupExceptionKey,\n animationLevel,\n forceUpdate,\n ]);\n\n useLayoutEffect(() => {\n if (shouldRestoreHeight) {\n const container = containerRef.current!;\n const activeElement = container.querySelector('.active')\n || container.querySelector('.from');\n\n if (activeElement) {\n activeElement.style.height = 'auto';\n container.style.height = `${activeElement.clientHeight}px`;\n container.style.flexBasis = `${activeElement.clientHeight}px`;\n }\n }\n }, [shouldRestoreHeight, children]);\n\n const renders = rendersRef.current;\n const collection = Object.keys(renderCount ? new Array(renderCount).fill(undefined) : renders).map(Number);\n const contents = collection.map((key) => {\n const render = renders[key];\n\n return (\n typeof render === 'function'\n ?
{render(key === activeKey, key === prevActiveKey, activeKey)}
\n : undefined\n );\n });\n\n const fullClassName = buildClassName(\n 'Transition',\n className,\n name,\n );\n\n return (\n
\n {contents}\n
\n );\n};\n\nexport default Transition;\n","import useReducer, { StateReducer, Dispatch } from '../useReducer';\nimport { ApiChatFolder } from '../../api/types';\nimport { pick, omit } from '../../util/iteratees';\n\nexport type FolderChatType = {\n icon: string;\n title: string;\n key: keyof Pick;\n};\n\nexport const INCLUDED_CHAT_TYPES: FolderChatType[] = [\n { icon: 'user', title: 'FilterContacts', key: 'contacts' },\n { icon: 'non-contacts', title: 'FilterNonContacts', key: 'nonContacts' },\n { icon: 'group', title: 'FilterGroups', key: 'groups' },\n { icon: 'channel', title: 'FilterChannels', key: 'channels' },\n { icon: 'bots', title: 'FilterBots', key: 'bots' },\n];\n\nexport const EXCLUDED_CHAT_TYPES: FolderChatType[] = [\n { icon: 'mute', title: 'FilterMuted', key: 'excludeMuted' },\n { icon: 'archive', title: 'FilterArchived', key: 'excludeArchived' },\n { icon: 'readchats', title: 'FilterRead', key: 'excludeRead' },\n];\n\nconst INCLUDE_FILTER_FIELDS: Array = [\n 'includedChatIds', 'bots', 'channels', 'groups', 'contacts', 'nonContacts',\n];\nconst EXCLUDE_FILTER_FIELDS: Array = [\n 'excludedChatIds', 'excludeArchived', 'excludeMuted', 'excludeRead',\n];\n\nexport function selectChatFilters(state: FoldersState, mode: 'included' | 'excluded', selectTemp?: boolean) {\n let selectedChatIds: number[] = [];\n let selectedChatTypes: FolderChatType['key'][] = [];\n\n if (mode === 'included') {\n const {\n includedChatIds,\n ...includeFilters\n } = selectTemp\n ? state.includeFilters || {}\n : pick(\n state.folder,\n INCLUDE_FILTER_FIELDS,\n );\n\n selectedChatIds = includedChatIds || [];\n selectedChatTypes = (Object.keys(includeFilters) as Array)\n .filter((key) => Boolean(includeFilters[key]));\n } else {\n const {\n excludedChatIds,\n ...excludeFilters\n } = selectTemp\n ? state.excludeFilters || {}\n : pick(\n state.folder,\n EXCLUDE_FILTER_FIELDS,\n );\n\n selectedChatIds = excludedChatIds || [];\n selectedChatTypes = (Object.keys(excludeFilters) as Array)\n .filter((key) => Boolean(excludeFilters[key]));\n }\n\n return {\n selectedChatIds,\n selectedChatTypes,\n };\n}\n\nfunction getSuggestedFolderName(includeFilters?: FolderIncludeFilters) {\n if (includeFilters) {\n const {\n includedChatIds,\n ...filters\n } = includeFilters;\n\n if (\n Object.values(filters).filter(Boolean).length > 1\n || (includedChatIds?.length)\n ) {\n return '';\n }\n\n if (filters.bots) {\n return 'Bots';\n } else if (filters.groups) {\n return 'Groups';\n } else if (filters.channels) {\n return 'Channels';\n } else if (filters.contacts) {\n return 'Contacts';\n } else if (filters.nonContacts) {\n return 'Non-Contacts';\n }\n }\n\n return '';\n}\n\ntype FolderIncludeFilters = Pick;\ntype FolderExcludeFilters = Pick;\n\nexport type FoldersState = {\n mode: 'create' | 'edit';\n isLoading?: boolean;\n isTouched?: boolean;\n error?: string;\n folderId?: number;\n chatFilter: string;\n folder: Omit;\n includeFilters?: FolderIncludeFilters;\n excludeFilters?: FolderExcludeFilters;\n};\nexport type FoldersActions = (\n 'setTitle' | 'saveFilters' | 'editFolder' | 'reset' | 'setChatFilter' | 'setIsLoading' | 'setError' |\n 'editIncludeFilters' | 'editExcludeFilters' | 'setIncludeFilters' | 'setExcludeFilters'\n);\nexport type FolderEditDispatch = Dispatch;\n\nconst INITIAL_STATE: FoldersState = {\n mode: 'create',\n chatFilter: '',\n folder: {\n title: '',\n includedChatIds: [],\n excludedChatIds: [],\n },\n};\n\nconst foldersReducer: StateReducer = (\n state,\n action,\n) => {\n switch (action.type) {\n case 'setTitle':\n return {\n ...state,\n folder: {\n ...state.folder,\n title: action.payload,\n },\n isTouched: true,\n };\n case 'editIncludeFilters':\n return {\n ...state,\n includeFilters: pick(\n state.folder,\n INCLUDE_FILTER_FIELDS,\n ),\n };\n case 'editExcludeFilters':\n return {\n ...state,\n excludeFilters: pick(\n state.folder,\n EXCLUDE_FILTER_FIELDS,\n ),\n };\n case 'setIncludeFilters':\n return {\n ...state,\n includeFilters: action.payload,\n chatFilter: '',\n };\n case 'setExcludeFilters':\n return {\n ...state,\n excludeFilters: action.payload,\n chatFilter: '',\n };\n case 'saveFilters':\n if (state.includeFilters) {\n return {\n ...state,\n folder: {\n ...omit(state.folder, INCLUDE_FILTER_FIELDS),\n title: state.folder.title ? state.folder.title : getSuggestedFolderName(state.includeFilters),\n ...state.includeFilters,\n },\n includeFilters: undefined,\n chatFilter: '',\n isTouched: true,\n };\n } else if (state.excludeFilters) {\n return {\n ...state,\n folder: {\n ...omit(state.folder, EXCLUDE_FILTER_FIELDS),\n ...state.excludeFilters,\n },\n excludeFilters: undefined,\n chatFilter: '',\n isTouched: true,\n };\n } else {\n return state;\n }\n case 'editFolder': {\n const { id: folderId, description, ...folder } = action.payload;\n\n return {\n mode: 'edit',\n folderId,\n folder,\n chatFilter: '',\n };\n }\n case 'setChatFilter': {\n return {\n ...state,\n chatFilter: action.payload,\n };\n }\n case 'setIsLoading': {\n return {\n ...state,\n isLoading: action.payload,\n };\n }\n case 'setError': {\n return {\n ...state,\n error: action.payload,\n };\n }\n case 'reset':\n return INITIAL_STATE;\n default:\n return state;\n }\n};\n\nexport default () => {\n return useReducer(foldersReducer, INITIAL_STATE);\n};\n","import {\n useCallback, useEffect, useRef, useState,\n} from '../lib/teact/teact';\n\nimport { register } from '../util/audioPlayer';\nimport useEffectWithPrevDeps from './useEffectWithPrevDeps';\nimport { isSafariPatchInProgress } from '../util/patchSafariProgressiveAudio';\nimport useOnChange from './useOnChange';\n\ntype Handler = (e: Event) => void;\n\nexport default (\n trackId: string,\n originalDuration: number, // Sometimes incorrect for voice messages\n src?: string,\n handlers?: Record,\n onInit?: (element: HTMLAudioElement) => void,\n shouldPlay = false,\n onForcePlay?: NoneToVoidFunction,\n noPlaylist = false,\n) => {\n // eslint-disable-next-line no-null/no-null\n const controllerRef = useRef>(null);\n\n const [isPlaying, setIsPlaying] = useState(false);\n let isPlayingSync = isPlaying;\n\n const [playProgress, setPlayProgress] = useState(0);\n\n useOnChange(() => {\n controllerRef.current = register(trackId, (eventName, e) => {\n switch (eventName) {\n case 'onPlay':\n setIsPlaying(true);\n break;\n case 'onPause':\n setIsPlaying(false);\n break;\n case 'onTimeUpdate': {\n const { proxy } = controllerRef.current!;\n const duration = proxy.duration && Number.isFinite(proxy.duration) ? proxy.duration : originalDuration;\n setPlayProgress(proxy.currentTime / duration);\n break;\n }\n }\n\n handlers?.[eventName]?.(e);\n }, onForcePlay);\n\n const { proxy } = controllerRef.current!;\n\n if (!isPlaying && !proxy.paused) {\n setIsPlaying(true);\n isPlayingSync = true;\n }\n\n if (onInit) {\n onInit(proxy);\n }\n }, [trackId]);\n\n const {\n play, pause, setCurrentTime, proxy, destroy,\n } = controllerRef.current!;\n const duration = proxy.duration && Number.isFinite(proxy.duration) ? proxy.duration : originalDuration;\n\n // RAF progress\n useEffect(() => {\n if (duration && !isSafariPatchInProgress(proxy)) {\n setPlayProgress(proxy.currentTime / duration);\n }\n }, [duration, playProgress, proxy]);\n\n // Cleanup\n useEffect(() => () => {\n destroy(noPlaylist);\n }, [destroy, noPlaylist]);\n\n // Autoplay once `src` is present\n useEffectWithPrevDeps(([prevShouldPlay, prevSrc]) => {\n if (prevShouldPlay === shouldPlay && src === prevSrc) {\n return;\n }\n\n // When paused by another player\n if (proxy.src && proxy.paused) {\n return;\n }\n\n if (shouldPlay && src && !isPlaying) {\n play(src);\n }\n }, [shouldPlay, src, isPlaying, play, proxy.src, proxy.paused]);\n\n const playPause = useCallback(() => {\n if (isPlaying) {\n pause();\n } else if (src) {\n play(src);\n }\n }, [src, pause, play, isPlaying]);\n\n return {\n isPlaying: isPlayingSync,\n playProgress,\n playPause,\n setCurrentTime,\n audioProxy: proxy,\n duration,\n };\n};\n","import { useEffect } from '../lib/teact/teact';\n\nexport default function useBackgroundMode(\n onBlur?: AnyToVoidFunction,\n onFocus?: AnyToVoidFunction,\n) {\n useEffect(() => {\n if (onBlur && !document.hasFocus()) {\n onBlur();\n }\n\n if (onBlur) {\n window.addEventListener('blur', onBlur);\n }\n\n if (onFocus) {\n window.addEventListener('focus', onFocus);\n }\n\n return () => {\n if (onFocus) {\n window.removeEventListener('focus', onFocus);\n }\n\n if (onBlur) {\n window.removeEventListener('blur', onBlur);\n }\n };\n }, [onBlur, onFocus]);\n}\n","import { useEffect, useRef } from '../lib/teact/teact';\n\nimport fastBlur from '../lib/fastBlur';\nimport { imgToCanvas } from '../util/files';\nimport useForceUpdate from './useForceUpdate';\n\nconst RADIUS = 2;\nconst ITERATIONS = 2;\nconst MAX_CACHE_SIZE = 1000;\n\nconst cache = new Map();\n\nexport default function useBlur(dataUri?: string, isDisabled = false, delay?: number) {\n const blurredRef = useRef(dataUri ? cache.get(dataUri) : undefined);\n const timeoutRef = useRef();\n const forceUpdate = useForceUpdate();\n\n if (timeoutRef.current && isDisabled) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n\n useEffect(() => {\n if (!dataUri || blurredRef.current || isDisabled) {\n return;\n }\n\n const img = new Image();\n\n img.onload = () => {\n const canvas = imgToCanvas(img);\n fastBlur(canvas.getContext('2d'), 0, 0, canvas.width, canvas.height, RADIUS, ITERATIONS);\n const blurredDataUri = canvas.toDataURL();\n\n blurredRef.current = blurredDataUri;\n forceUpdate();\n\n if (cache.size >= MAX_CACHE_SIZE) {\n cache.clear();\n }\n cache.set(dataUri, blurredDataUri);\n };\n\n if (delay) {\n timeoutRef.current = window.setTimeout(() => {\n img.src = dataUri;\n }, delay);\n } else {\n img.src = dataUri;\n }\n }, [dataUri, delay, forceUpdate, isDisabled]);\n\n return blurredRef.current;\n}\n","import { useRef } from '../lib/teact/teact';\n\nimport fastBlur from '../lib/fastBlur';\nimport useOnChange from './useOnChange';\nimport useBlur from './useBlur';\nimport { imgToCanvas } from '../util/files';\n\nconst RADIUS = 2;\nconst ITERATIONS = 2;\n\nexport default function useBlurSync(dataUri: string | false | undefined) {\n const blurredRef = useRef();\n\n let isChanged = false;\n\n useOnChange(() => {\n isChanged = true;\n\n blurredRef.current = undefined;\n\n if (!dataUri) {\n return;\n }\n\n const img = new Image();\n img.src = dataUri;\n if (!img.width) {\n return;\n }\n\n const canvas = imgToCanvas(img);\n fastBlur(canvas.getContext('2d'), 0, 0, canvas.width, canvas.height, RADIUS, ITERATIONS);\n\n blurredRef.current = canvas.toDataURL();\n }, [dataUri]);\n\n // Sometimes `Image` do not manage to load synchronously,\n // so we fall back the non-blurred variant and prepare the async one at least for the next time\n const blurredAsync = useBlur(dataUri || undefined, Boolean(blurredRef.current));\n\n return blurredRef.current || (!isChanged && blurredAsync) || dataUri || undefined;\n}\n","import React, { useCallback, useMemo, useState } from '../lib/teact/teact';\nimport { debounce } from '../util/schedulers';\nimport { isSafariPatchInProgress } from '../util/patchSafariProgressiveAudio';\n\ntype BufferingEvent = (e: Event | React.SyntheticEvent) => void;\n\nconst MIN_READY_STATE = 3;\n// Avoid flickering when re-mounting previously buffered video\nconst DEBOUNCE = 200;\n\nexport default (noInitiallyBuffered = false) => {\n const [isBuffered, setIsBuffered] = useState(!noInitiallyBuffered);\n const [bufferedProgress, setBufferedProgress] = useState(0);\n\n const setIsBufferedDebounced = useMemo(() => {\n return debounce(setIsBuffered, DEBOUNCE, false, true);\n }, []);\n\n const handleBuffering = useCallback((e) => {\n const media = e.currentTarget as HTMLMediaElement;\n\n if (!isSafariPatchInProgress(media)) {\n if (media.buffered.length) {\n setBufferedProgress(media.buffered.end(0) / media.duration);\n }\n\n setIsBufferedDebounced(media.readyState >= MIN_READY_STATE || media.currentTime > 0);\n }\n }, [setIsBufferedDebounced]);\n\n const bufferingHandlers = {\n onLoadedData: handleBuffering,\n onPlaying: handleBuffering,\n onLoadStart: handleBuffering, // Needed for Safari to start\n onPause: handleBuffering, // Needed for Chrome when seeking\n onTimeUpdate: handleBuffering, // Needed for audio buffering progress\n onProgress: handleBuffering, // Needed for video buffering progress\n };\n\n return {\n isBuffered,\n bufferedProgress,\n bufferingHandlers,\n checkBuffering(element: HTMLMediaElement) {\n setIsBufferedDebounced(element.readyState >= MIN_READY_STATE);\n },\n };\n};\n","import { useEffect, useRef } from '../lib/teact/teact';\n\nimport fastBlur from '../lib/fastBlur';\nimport useForceUpdate from './useForceUpdate';\nimport { IS_CANVAS_FILTER_SUPPORTED } from '../util/environment';\n\nconst RADIUS = 2;\nconst ITERATIONS = 2;\n\nexport default function useCanvasBlur(dataUri?: string, isDisabled = false, withRaf?: boolean) {\n // eslint-disable-next-line no-null/no-null\n const canvasRef = useRef(null);\n const forceUpdate = useForceUpdate();\n\n useEffect(() => {\n const canvas = canvasRef.current;\n\n if (!dataUri || !canvas || isDisabled) {\n return;\n }\n\n const img = new Image();\n\n const processBlur = () => {\n canvas.width = img.width;\n canvas.height = img.height;\n\n const ctx = canvas.getContext('2d', { alpha: false })!;\n\n if (IS_CANVAS_FILTER_SUPPORTED) {\n ctx.filter = `blur(${RADIUS}px)`;\n }\n\n ctx.drawImage(img, -RADIUS * 2, -RADIUS * 2, canvas.width + RADIUS * 4, canvas.height + RADIUS * 4);\n\n if (!IS_CANVAS_FILTER_SUPPORTED) {\n fastBlur(ctx, 0, 0, canvas.width, canvas.height, RADIUS, ITERATIONS);\n }\n };\n\n img.onload = () => {\n if (withRaf) {\n requestAnimationFrame(processBlur);\n } else {\n processBlur();\n }\n };\n\n img.src = dataUri;\n }, [canvasRef, dataUri, forceUpdate, isDisabled, withRaf]);\n\n return canvasRef;\n}\n","import { useMemo } from '../lib/teact/teact';\nimport { getDispatch } from '../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../api/types';\n\nimport {\n isChatArchived, getCanDeleteChat, isChatPrivate, isChatChannel,\n} from '../modules/helpers';\nimport useLang from './useLang';\n\nexport default ({\n chat,\n privateChatUser,\n handleDelete,\n folderId,\n isPinned,\n isMuted,\n}: {\n chat: ApiChat | undefined;\n privateChatUser: ApiUser | undefined;\n handleDelete: () => void;\n folderId?: number;\n isPinned?: boolean;\n isMuted?: boolean;\n}, isInSearch = false) => {\n const lang = useLang();\n\n return useMemo(() => {\n if (!chat) {\n return undefined;\n }\n\n const {\n toggleChatPinned,\n updateChatMutedState,\n toggleChatArchived,\n toggleChatUnread,\n } = getDispatch();\n\n const actionPin = isPinned\n ? {\n title: lang('UnpinFromTop'),\n icon: 'unpin',\n handler: () => toggleChatPinned({ id: chat.id, folderId }),\n }\n : { title: lang('PinToTop'), icon: 'pin', handler: () => toggleChatPinned({ id: chat.id, folderId }) };\n\n if (isInSearch) {\n return [actionPin];\n }\n\n const actionUnreadMark = chat.unreadCount || chat.hasUnreadMark\n ? { title: lang('MarkAsRead'), icon: 'readchats', handler: () => toggleChatUnread({ id: chat.id }) }\n : { title: lang('MarkAsUnread'), icon: 'unread', handler: () => toggleChatUnread({ id: chat.id }) };\n\n const actionMute = isMuted\n ? {\n title: lang('ChatList.Unmute'),\n icon: 'unmute',\n handler: () => updateChatMutedState({ chatId: chat.id, isMuted: false }),\n }\n : {\n title: lang('ChatList.Mute'),\n icon: 'mute',\n handler: () => updateChatMutedState({ chatId: chat.id, isMuted: true }),\n };\n\n const actionArchive = isChatArchived(chat)\n ? { title: lang('Unarchive'), icon: 'unarchive', handler: () => toggleChatArchived({ id: chat.id }) }\n : { title: lang('Archive'), icon: 'archive', handler: () => toggleChatArchived({ id: chat.id }) };\n\n const actionDelete = {\n title: isChatPrivate(chat.id)\n ? lang('Delete')\n : lang(getCanDeleteChat(chat)\n ? 'DeleteChat'\n : (isChatChannel(chat) ? 'LeaveChannel' : 'Group.LeaveGroup')),\n icon: 'delete',\n destructive: true,\n handler: handleDelete,\n };\n\n return [\n actionUnreadMark,\n actionPin,\n ...(!privateChatUser?.isSelf ? [\n actionMute,\n actionArchive,\n ] : []),\n actionDelete,\n ];\n }, [chat, isPinned, lang, isInSearch, isMuted, handleDelete, privateChatUser?.isSelf, folderId]);\n};\n","import { RefObject } from 'react';\nimport { useState, useEffect, useCallback } from '../lib/teact/teact';\n\nimport { IAnchorPosition } from '../types';\nimport { IS_TOUCH_ENV, IS_SINGLE_COLUMN_LAYOUT } from '../util/environment';\n\nconst LONG_TAP_DURATION_MS = 200;\n\nfunction checkIsDisabledForMobile() {\n return IS_SINGLE_COLUMN_LAYOUT\n && window.document.body.classList.contains('enable-symbol-menu-transforms');\n}\n\nexport default (\n elementRef: RefObject,\n isMenuDisabled?: boolean,\n shouldDisableOnLink?: boolean,\n shouldDisableOnLongTap?: boolean,\n) => {\n const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);\n const [contextMenuPosition, setContextMenuPosition] = useState(undefined);\n\n const handleBeforeContextMenu = useCallback((e: React.MouseEvent) => {\n if (!isMenuDisabled && e.button === 2) {\n document.body.classList.add('no-selection');\n }\n }, [isMenuDisabled]);\n\n const handleContextMenu = useCallback((e: React.MouseEvent) => {\n document.body.classList.remove('no-selection');\n\n if (isMenuDisabled || (shouldDisableOnLink && (e.target as HTMLElement).matches('a[href]'))) {\n return;\n }\n e.preventDefault();\n\n if (contextMenuPosition) {\n return;\n }\n\n setIsContextMenuOpen(true);\n setContextMenuPosition({ x: e.clientX, y: e.clientY });\n }, [isMenuDisabled, shouldDisableOnLink, contextMenuPosition]);\n\n const handleContextMenuClose = useCallback(() => {\n setIsContextMenuOpen(false);\n }, []);\n\n const handleContextMenuHide = useCallback(() => {\n setContextMenuPosition(undefined);\n document.body.classList.remove('no-selection');\n }, []);\n\n // Support context menu on touch-devices\n useEffect(() => {\n if (isMenuDisabled || !IS_TOUCH_ENV || shouldDisableOnLongTap) {\n return undefined;\n }\n\n const element = elementRef.current;\n if (!element) {\n return undefined;\n }\n\n let timer: number | undefined;\n\n const clearLongPressTimer = () => {\n if (timer) {\n clearTimeout(timer);\n timer = undefined;\n }\n };\n\n const emulateContextMenuEvent = (originalEvent: TouchEvent) => {\n clearLongPressTimer();\n\n const { clientX, clientY, target } = originalEvent.touches[0];\n\n if (contextMenuPosition || (shouldDisableOnLink && (target as HTMLElement).matches('a[href]'))) {\n return;\n }\n\n // temporarily intercept and clear the next click\n element.addEventListener('touchend', function cancelClickOnce(e) {\n element.removeEventListener('touchend', cancelClickOnce, true);\n e.stopImmediatePropagation();\n e.preventDefault();\n e.stopPropagation();\n }, true);\n\n document.body.classList.add('no-selection');\n setIsContextMenuOpen(true);\n setContextMenuPosition({ x: clientX, y: clientY });\n };\n\n const startLongPressTimer = (e: TouchEvent) => {\n if (isMenuDisabled || checkIsDisabledForMobile()) {\n return;\n }\n clearLongPressTimer();\n\n timer = window.setTimeout(() => emulateContextMenuEvent(e), LONG_TAP_DURATION_MS);\n };\n\n // @perf Consider event delegation\n element.addEventListener('touchstart', startLongPressTimer, { passive: true });\n element.addEventListener('touchcancel', clearLongPressTimer, true);\n element.addEventListener('touchend', clearLongPressTimer, true);\n element.addEventListener('touchmove', clearLongPressTimer, { passive: true });\n\n return () => {\n clearLongPressTimer();\n element.removeEventListener('touchstart', startLongPressTimer);\n element.removeEventListener('touchcancel', clearLongPressTimer, true);\n element.removeEventListener('touchend', clearLongPressTimer, true);\n element.removeEventListener('touchmove', clearLongPressTimer);\n };\n }, [contextMenuPosition, isMenuDisabled, shouldDisableOnLongTap, elementRef, shouldDisableOnLink]);\n\n return {\n isContextMenuOpen,\n contextMenuPosition,\n handleBeforeContextMenu,\n handleContextMenu,\n handleContextMenuClose,\n handleContextMenuHide,\n };\n};\n","import { useState, useEffect } from '../lib/teact/teact';\nimport { IAnchorPosition } from '../types';\n\nconst MENU_POSITION_VISUAL_COMFORT_SPACE_PX = 16;\n\nexport default (\n anchor: IAnchorPosition | undefined,\n getTriggerElement: () => HTMLElement | null,\n getRootElement: () => HTMLElement | null,\n getMenuElement: () => HTMLElement | null,\n extraPaddingX = 0,\n extraTopPadding = 0,\n) => {\n const [positionX, setPositionX] = useState<'right' | 'left'>('right');\n const [positionY, setPositionY] = useState<'top' | 'bottom'>('bottom');\n const [style, setStyle] = useState('');\n\n useEffect(() => {\n const triggerEl = getTriggerElement();\n if (!anchor || !triggerEl) {\n return;\n }\n\n let { x, y } = anchor;\n const emptyRect = {\n width: 0, left: 0, height: 0, top: 0,\n };\n\n const menuEl = getMenuElement();\n const rootEl = getRootElement();\n\n const triggerRect = triggerEl.getBoundingClientRect();\n const menuRect = menuEl ? { width: menuEl.offsetWidth, height: menuEl.offsetHeight } : emptyRect;\n const rootRect = rootEl ? rootEl.getBoundingClientRect() : emptyRect;\n\n let horizontalPostition: 'left' | 'right';\n if (x + menuRect.width + extraPaddingX < rootRect.width + rootRect.left) {\n x += 3;\n horizontalPostition = 'left';\n } else if (x - menuRect.width > 0) {\n horizontalPostition = 'right';\n x -= 3;\n } else {\n horizontalPostition = 'left';\n x = 16;\n }\n setPositionX(horizontalPostition);\n\n if (y + menuRect.height < rootRect.height + rootRect.top) {\n setPositionY('top');\n } else {\n setPositionY('bottom');\n\n if (y - menuRect.height < rootRect.top + extraTopPadding) {\n y = rootRect.top + extraTopPadding + menuRect.height;\n }\n }\n\n const left = horizontalPostition === 'left'\n ? Math.min(x - triggerRect.left, rootRect.width - menuRect.width - MENU_POSITION_VISUAL_COMFORT_SPACE_PX)\n : Math.max((x - triggerRect.left), menuRect.width + MENU_POSITION_VISUAL_COMFORT_SPACE_PX);\n\n setStyle(`left: ${left}px; top: ${y - triggerRect.top}px;`);\n }, [\n anchor, extraPaddingX, extraTopPadding,\n getMenuElement, getRootElement, getTriggerElement,\n ]);\n\n return {\n positionX,\n positionY,\n style,\n };\n};\n","import usePrevious from './usePrevious';\n\nexport default function useCurrentOrPrev(\n current: T, shouldSkipUndefined = false, shouldForceCurrent = false,\n): T | undefined {\n const prev = usePrevious(current, shouldSkipUndefined);\n\n // eslint-disable-next-line no-null/no-null\n return shouldForceCurrent || (current !== null && current !== undefined) ? current : prev;\n}\n","import { useEffect, useMemo } from '../lib/teact/teact';\nimport { getDispatch } from '../lib/teact/teactn';\n\nimport { ApiMessage } from '../api/types';\n\nimport { throttle } from '../util/schedulers';\n\nexport default (\n chatId: number,\n messageId?: number,\n message?: ApiMessage,\n replyOriginForId?: number,\n) => {\n const { loadMessage } = getDispatch();\n const loadMessageThrottled = useMemo(() => {\n const throttled = throttle(loadMessage, 500, true);\n return () => {\n throttled({ chatId, messageId, replyOriginForId });\n };\n }, [loadMessage, chatId, messageId, replyOriginForId]);\n\n useEffect(() => {\n if (messageId && !message) {\n loadMessageThrottled();\n }\n });\n};\n","import { useEffect } from '../lib/teact/teact';\n\nexport default (container: HTMLElement | null, isDisabled?: boolean) => {\n useEffect(() => {\n if (!container) {\n return undefined;\n }\n\n function handleScroll(e: WheelEvent) {\n // Ignore horizontal scroll and let it work natively (e.g. on touchpad)\n if (!e.deltaX) {\n container!.scrollLeft += e.deltaY / 4;\n }\n }\n\n container.addEventListener('wheel', handleScroll, { passive: true });\n\n return () => {\n container.removeEventListener('wheel', handleScroll);\n };\n }, [container, isDisabled]);\n};\n","import { useCallback, useEffect, useRef } from '../lib/teact/teact';\nimport { LoadMoreDirection } from '../types';\n\nimport { areSortedArraysEqual } from '../util/iteratees';\nimport useForceUpdate from './useForceUpdate';\nimport usePrevious from './usePrevious';\n\ntype GetMore = (args: { direction: LoadMoreDirection }) => void;\ntype LoadMoreBackwards = (args: { offsetId?: number }) => void;\n\nconst DEFAULT_LIST_SLICE = 30;\n\nexport default (\n loadMoreBackwards?: LoadMoreBackwards,\n listIds?: number[],\n isDisabled = false,\n listSlice = DEFAULT_LIST_SLICE,\n forceFullPreload = false,\n): [number[]?, GetMore?] => {\n const lastParamsRef = useRef<{\n direction?: LoadMoreDirection;\n offsetId?: number;\n }>();\n\n const viewportIdsRef = useRef((() => {\n // Only run once to initialize\n if (!listIds || lastParamsRef.current) {\n return undefined;\n }\n\n const { newViewportIds } = getViewportSlice(listIds, listIds[0], LoadMoreDirection.Forwards, listSlice);\n return newViewportIds;\n })());\n\n const forceUpdate = useForceUpdate();\n\n const prevListIds = usePrevious(listIds);\n const prevIsDisabled = usePrevious(isDisabled);\n if (listIds && !isDisabled && (listIds !== prevListIds || isDisabled !== prevIsDisabled)) {\n const { offsetId = listIds[0], direction = LoadMoreDirection.Forwards } = lastParamsRef.current || {};\n const { newViewportIds } = getViewportSlice(listIds, offsetId, direction, listSlice);\n\n if (!viewportIdsRef.current || !areSortedArraysEqual(viewportIdsRef.current, newViewportIds)) {\n viewportIdsRef.current = newViewportIds;\n }\n }\n\n useEffect(() => {\n if (listIds && !isDisabled && loadMoreBackwards && forceFullPreload) {\n const viewportIds = viewportIdsRef.current!;\n loadMoreBackwards({ offsetId: viewportIds[viewportIds.length - 1] });\n }\n }, [listIds, isDisabled, loadMoreBackwards, forceFullPreload]);\n\n const getMore: GetMore = useCallback(({\n direction,\n noScroll,\n }: { direction: LoadMoreDirection; noScroll?: boolean }) => {\n const viewportIds = viewportIdsRef.current;\n\n const offsetId = viewportIds\n ? direction === LoadMoreDirection.Backwards ? viewportIds[viewportIds.length - 1] : viewportIds[0]\n : undefined;\n\n if (!listIds) {\n if (loadMoreBackwards) {\n loadMoreBackwards({ offsetId });\n }\n\n return;\n }\n\n if (!noScroll) {\n lastParamsRef.current = { ...lastParamsRef.current, direction, offsetId };\n }\n\n const {\n newViewportIds, areSomeLocal, areAllLocal,\n } = getViewportSlice(listIds, offsetId, direction, listSlice);\n\n if (areSomeLocal && !(viewportIds && areSortedArraysEqual(viewportIds, newViewportIds))) {\n viewportIdsRef.current = newViewportIds;\n forceUpdate();\n }\n\n if (!areAllLocal && loadMoreBackwards) {\n loadMoreBackwards({ offsetId });\n }\n }, [listIds, listSlice, loadMoreBackwards, forceUpdate]);\n\n return isDisabled ? [listIds] : [viewportIdsRef.current, getMore];\n};\n\nfunction getViewportSlice(\n sourceIds: number[],\n offsetId = 0,\n direction: LoadMoreDirection,\n listSlice: number,\n) {\n const { length } = sourceIds;\n const index = sourceIds.indexOf(offsetId);\n const isForwards = direction === LoadMoreDirection.Forwards;\n const indexForDirection = isForwards ? index : (index + 1) || length;\n const from = Math.max(0, indexForDirection - listSlice);\n const to = indexForDirection + listSlice - 1;\n const newViewportIds = sourceIds.slice(Math.max(0, from), to + 1);\n\n let areSomeLocal;\n let areAllLocal;\n switch (direction) {\n case LoadMoreDirection.Forwards:\n areSomeLocal = indexForDirection > 0;\n areAllLocal = from >= 0;\n break;\n case LoadMoreDirection.Backwards:\n areSomeLocal = indexForDirection < length;\n areAllLocal = to <= length - 1;\n break;\n }\n\n return { newViewportIds, areSomeLocal, areAllLocal };\n}\n","import { RefObject } from 'react';\nimport {\n useEffect, useRef, useCallback, useState,\n} from '../lib/teact/teact';\n\nimport { throttle, debounce } from '../util/schedulers';\nimport useHeavyAnimationCheck from './useHeavyAnimationCheck';\n\ntype TargetCallback = (entry: IntersectionObserverEntry) => void;\ntype RootCallback = (entries: IntersectionObserverEntry[]) => void;\ntype ObserveCleanup = NoneToVoidFunction;\nexport type ObserveFn = (target: HTMLElement, targetCallback?: TargetCallback) => ObserveCleanup;\n\ninterface IntersectionController {\n observer: IntersectionObserver;\n callbacks: Map;\n}\n\ninterface Response {\n observe: ObserveFn;\n freeze: NoneToVoidFunction;\n unfreeze: NoneToVoidFunction;\n}\n\nconst AUTO_UNFREEZE_TIMEOUT = 2000;\n\nexport function useIntersectionObserver({\n rootRef,\n throttleMs,\n debounceMs,\n shouldSkipFirst,\n margin,\n threshold,\n isDisabled,\n}: {\n rootRef: RefObject;\n throttleMs?: number;\n debounceMs?: number;\n shouldSkipFirst?: boolean;\n margin?: number;\n threshold?: number | number[];\n isDisabled?: boolean;\n}, rootCallback?: RootCallback): Response {\n const controllerRef = useRef();\n const rootCallbackRef = useRef();\n const freezeFlagsRef = useRef(0);\n const autoUnfreezeTimeoutRef = useRef();\n const onUnfreezeRef = useRef();\n\n rootCallbackRef.current = rootCallback;\n\n const unfreeze = useCallback(() => {\n if (!freezeFlagsRef.current) {\n return;\n }\n\n freezeFlagsRef.current--;\n\n if (!freezeFlagsRef.current && onUnfreezeRef.current) {\n onUnfreezeRef.current();\n onUnfreezeRef.current = undefined;\n }\n }, []);\n\n const freeze = useCallback(() => {\n freezeFlagsRef.current++;\n\n if (autoUnfreezeTimeoutRef.current) {\n clearTimeout(autoUnfreezeTimeoutRef.current);\n autoUnfreezeTimeoutRef.current = undefined;\n }\n\n // Make sure to unfreeze even if unfreeze callback was not called (which was some hardly-reproducible bug)\n autoUnfreezeTimeoutRef.current = window.setTimeout(() => {\n autoUnfreezeTimeoutRef.current = undefined;\n\n if (!freezeFlagsRef.current) {\n return;\n }\n\n freezeFlagsRef.current = 1;\n unfreeze();\n }, AUTO_UNFREEZE_TIMEOUT);\n }, [unfreeze]);\n\n useHeavyAnimationCheck(freeze, unfreeze);\n\n useEffect(() => {\n if (isDisabled) {\n return undefined;\n }\n\n return () => {\n if (controllerRef.current) {\n controllerRef.current.observer.disconnect();\n controllerRef.current.callbacks.clear();\n controllerRef.current = undefined;\n }\n };\n }, [isDisabled]);\n\n function initController() {\n const callbacks = new Map();\n const entriesAccumulator = new Map();\n const observerCallbackSync = () => {\n const entries = Array.from(entriesAccumulator.values());\n\n entries.forEach((entry: IntersectionObserverEntry) => {\n const callback = callbacks.get(entry.target);\n if (callback) {\n callback!(entry, entries);\n }\n });\n\n if (rootCallbackRef.current) {\n rootCallbackRef.current(entries);\n }\n\n entriesAccumulator.clear();\n };\n const scheduler = throttleMs ? throttle : debounceMs ? debounce : undefined;\n const observerCallback = scheduler\n ? scheduler(observerCallbackSync, (throttleMs || debounceMs)!, !shouldSkipFirst)\n : observerCallbackSync;\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n entriesAccumulator.set(entry.target, entry);\n });\n\n if (freezeFlagsRef.current) {\n onUnfreezeRef.current = () => {\n observerCallback();\n };\n } else {\n observerCallback();\n }\n },\n {\n root: rootRef.current,\n rootMargin: margin ? `${margin}px` : undefined,\n threshold,\n },\n );\n\n controllerRef.current = { observer, callbacks };\n }\n\n const observe = useCallback((target, targetCallback) => {\n if (!controllerRef.current) {\n initController();\n }\n\n const controller = controllerRef.current!;\n controller.observer.observe(target);\n\n if (targetCallback) {\n controller.callbacks.set(target, targetCallback);\n }\n\n return () => {\n if (targetCallback) {\n controller.callbacks.delete(target);\n }\n\n controller.observer.unobserve(target);\n };\n // Arguments should never change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isDisabled]);\n\n return { observe, freeze, unfreeze };\n}\n\nexport function useOnIntersect(\n targetRef: RefObject, observe?: ObserveFn, callback?: TargetCallback,\n) {\n useEffect(() => {\n return observe ? observe(targetRef.current!, callback) : undefined;\n // Arguments should never change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n}\n\nexport function useIsIntersecting(\n targetRef: RefObject, observe?: ObserveFn, callback?: TargetCallback,\n) {\n const [isIntersecting, setIsIntersecting] = useState(!observe);\n\n useOnIntersect(targetRef, observe, (entry) => {\n setIsIntersecting(entry.isIntersecting);\n\n if (callback) {\n callback(entry);\n }\n });\n\n return isIntersecting;\n}\n","import { useLayoutEffect } from '../lib/teact/teact';\nimport usePrevious from './usePrevious';\n\nexport default (cb: (args: PT) => void, dependencies: T, debugKey?: string) => {\n const prevDeps = usePrevious(dependencies);\n return useLayoutEffect(() => {\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n return cb(prevDeps || []);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies, debugKey);\n};\n","import { useEffect } from '../lib/teact/teact';\n\nimport { ApiMediaFormat } from '../api/types';\n\nimport * as mediaLoader from '../util/mediaLoader';\nimport useForceUpdate from './useForceUpdate';\n\nexport default (\n mediaHash: string | false | undefined,\n noLoad = false,\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n mediaFormat: T = ApiMediaFormat.BlobUrl,\n cacheBuster?: number,\n delay?: number | false,\n) => {\n const mediaData = mediaHash ? mediaLoader.getFromMemory(mediaHash) : undefined;\n const forceUpdate = useForceUpdate();\n\n useEffect(() => {\n if (!noLoad && mediaHash && !mediaData) {\n const startedAt = Date.now();\n\n mediaLoader.fetch(mediaHash, mediaFormat).then(() => {\n const spentTime = Date.now() - startedAt;\n if (!delay || spentTime >= delay) {\n forceUpdate();\n } else {\n setTimeout(forceUpdate, delay - spentTime);\n }\n });\n }\n }, [noLoad, mediaHash, mediaData, mediaFormat, cacheBuster, forceUpdate, delay]);\n\n return mediaData;\n};\n","import React, { useCallback, useEffect, useState } from '../lib/teact/teact';\n\nimport useMediaWithDownloadProgress from './useMediaWithDownloadProgress';\nimport download from '../util/download';\n\nexport default function useMediaDownload(\n mediaHash?: string,\n fileName?: string,\n) {\n const [isDownloadStarted, setIsDownloadStarted] = useState(false);\n\n const { mediaData, downloadProgress } = useMediaWithDownloadProgress(mediaHash, !isDownloadStarted);\n\n // Download with browser when fully loaded\n useEffect(() => {\n if (isDownloadStarted && mediaData) {\n download(mediaData, fileName!);\n setIsDownloadStarted(false);\n }\n }, [fileName, mediaData, isDownloadStarted]);\n\n // Cancel download on source change\n useEffect(() => {\n setIsDownloadStarted(false);\n }, [mediaHash]);\n\n const handleDownloadClick = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n setIsDownloadStarted((isAllowed) => !isAllowed);\n }, []);\n\n return {\n isDownloadStarted,\n downloadProgress,\n handleDownloadClick,\n };\n}\n","import {\n useEffect, useMemo, useRef, useState,\n} from '../lib/teact/teact';\n\nimport { IS_PROGRESSIVE_SUPPORTED } from '../util/environment';\nimport { ApiMediaFormat } from '../api/types';\nimport { throttle } from '../util/schedulers';\nimport * as mediaLoader from '../util/mediaLoader';\nimport useForceUpdate from './useForceUpdate';\n\nconst STREAMING_PROGRESS = 0.75;\nconst STREAMING_TIMEOUT = 1500;\nconst PROGRESS_THROTTLE = 500;\n\nexport default (\n mediaHash: string | undefined,\n noLoad = false,\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n mediaFormat: T = ApiMediaFormat.BlobUrl,\n cacheBuster?: number,\n delay?: number | false,\n isHtmlAllowed = false,\n) => {\n const mediaData = mediaHash ? mediaLoader.getFromMemory(mediaHash) : undefined;\n const isStreaming = mediaFormat === ApiMediaFormat.Stream || (\n IS_PROGRESSIVE_SUPPORTED && mediaFormat === ApiMediaFormat.Progressive\n );\n const forceUpdate = useForceUpdate();\n const [downloadProgress, setDownloadProgress] = useState(mediaData && !isStreaming ? 1 : 0);\n const startedAtRef = useRef();\n\n const handleProgress = useMemo(() => {\n return throttle((progress: number) => {\n if (!delay || (Date.now() - startedAtRef.current! > delay)) {\n setDownloadProgress(progress);\n }\n }, PROGRESS_THROTTLE, true);\n }, [delay]);\n\n useEffect(() => {\n if (!noLoad && mediaHash) {\n if (!mediaData) {\n setDownloadProgress(0);\n\n if (startedAtRef.current) {\n mediaLoader.cancelProgress(handleProgress);\n }\n\n startedAtRef.current = Date.now();\n\n mediaLoader.fetch(mediaHash, mediaFormat, isHtmlAllowed, handleProgress).then(() => {\n const spentTime = Date.now() - startedAtRef.current!;\n startedAtRef.current = undefined;\n\n if (!delay || spentTime >= delay) {\n forceUpdate();\n } else {\n setTimeout(forceUpdate, delay - spentTime);\n }\n });\n } else if (isStreaming) {\n setTimeout(() => {\n setDownloadProgress(STREAMING_PROGRESS);\n }, STREAMING_TIMEOUT);\n }\n }\n }, [\n noLoad, mediaHash, mediaData, mediaFormat, cacheBuster, forceUpdate, isStreaming, delay, handleProgress,\n isHtmlAllowed,\n ]);\n\n useEffect(() => {\n if (noLoad && startedAtRef.current) {\n mediaLoader.cancelProgress(handleProgress);\n setDownloadProgress(0);\n }\n }, [handleProgress, noLoad]);\n\n return { mediaData, downloadProgress };\n};\n","import { useCallback, useEffect, useRef } from '../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../util/environment';\n\nconst MENU_CLOSE_TIMEOUT = 250;\nlet closeTimeout: number | undefined;\n\nexport default function useMouseInside(\n isOpen: boolean, onClose: NoneToVoidFunction, menuCloseTimeout = MENU_CLOSE_TIMEOUT, isDisabled = false,\n) {\n const isMouseInside = useRef(true);\n\n useEffect(() => {\n if (isOpen) {\n isMouseInside.current = true;\n }\n }, [isOpen]);\n\n useEffect(() => {\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n\n if (isOpen && !IS_TOUCH_ENV && !isDisabled) {\n closeTimeout = window.setTimeout(() => {\n if (!isMouseInside.current) {\n onClose();\n }\n }, menuCloseTimeout * 2);\n }\n }, [isDisabled, isOpen, menuCloseTimeout, onClose]);\n\n const handleMouseEnter = useCallback(() => {\n isMouseInside.current = true;\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n isMouseInside.current = false;\n\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n\n closeTimeout = window.setTimeout(() => {\n if (!isMouseInside.current) {\n onClose();\n }\n }, menuCloseTimeout);\n }, [menuCloseTimeout, onClose]);\n\n return [handleMouseEnter, handleMouseLeave];\n}\n","import { useRef } from '../lib/teact/teact';\n\nimport usePrevious from './usePrevious';\nimport useForceUpdate from './useForceUpdate';\nimport useOnChange from './useOnChange';\n\nexport default function usePrevDuringAnimation(current: any, duration?: number) {\n const prev = usePrevious(current, true);\n const timeoutRef = useRef();\n const forceUpdate = useForceUpdate();\n // eslint-disable-next-line no-null/no-null\n const isCurrentPresent = current !== undefined && current !== null;\n // eslint-disable-next-line no-null/no-null\n const isPrevPresent = prev !== undefined && prev !== null;\n\n if (isCurrentPresent && timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n\n useOnChange(() => {\n // When `current` becomes empty\n if (duration && !isCurrentPresent && isPrevPresent && !timeoutRef.current) {\n timeoutRef.current = window.setTimeout(() => {\n timeoutRef.current = undefined;\n forceUpdate();\n }, duration);\n }\n }, [current]);\n\n return !timeoutRef.current || !duration || isCurrentPresent ? current : prev;\n}\n","import { useState, useCallback, useRef } from '../lib/teact/teact';\n\nexport type ReducerAction = { type: Actions; payload?: any };\nexport type StateReducer = (state: State, action: ReducerAction) => State;\nexport type Dispatch = (action: ReducerAction) => void;\n\nexport default function useReducer(\n reducer: StateReducer,\n initialState: State,\n) {\n const reducerRef = useRef(reducer);\n const [state, setState] = useState(initialState);\n\n const dispatch = useCallback((action: ReducerAction) => {\n setState((currentState) => reducerRef.current(currentState, action));\n }, []);\n\n return [\n state,\n dispatch,\n ] as [State, Dispatch];\n}\n","import { useEffect, useRef, useState } from '../lib/teact/teact';\n\nimport useShowTransition from './useShowTransition';\n\nconst SPEED = {\n fast: 200,\n slow: 350,\n};\n\nexport default (mediaData?: any, speed: keyof typeof SPEED = 'fast', noAnimate = false) => {\n const isMediaLoaded = Boolean(mediaData);\n const willAnimate = !useRef(isMediaLoaded).current && !noAnimate;\n const [shouldRenderThumb, setShouldRenderThumb] = useState(!isMediaLoaded);\n\n const {\n shouldRender: shouldRenderFullMedia,\n transitionClassNames,\n } = useShowTransition(isMediaLoaded, undefined, !willAnimate, speed);\n\n useEffect(() => {\n if (shouldRenderFullMedia) {\n if (willAnimate) {\n setTimeout(() => {\n setShouldRenderThumb(false);\n }, SPEED[speed]);\n } else {\n setShouldRenderThumb(false);\n }\n }\n }, [willAnimate, shouldRenderFullMedia, speed]);\n\n return {\n shouldRenderThumb,\n shouldRenderFullMedia,\n transitionClassNames,\n };\n};\n","import { RefObject } from 'react';\nimport { useEffect } from '../lib/teact/teact';\nimport { fastRaf } from '../util/schedulers';\n\n// Fix for memory leak when unmounting video element\nexport default function useVideoCleanup(videoRef: RefObject, dependencies: any[]) {\n useEffect(() => {\n const videoEl = videoRef.current;\n\n return () => {\n if (videoEl) {\n fastRaf(() => {\n videoEl.pause();\n videoEl.src = '';\n videoEl.load();\n });\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n}\n","/* eslint-disable no-nested-ternary */\n/* eslint-disable no-bitwise */\n/* eslint-disable no-multi-assign */\n/* eslint-disable no-cond-assign */\n/* eslint-disable no-param-reassign */\n/* eslint-disable prefer-const */\n/* eslint-disable eqeqeq */\n\n/*\nSuperfast Blur - a fast Box Blur For Canvas\n\nVersion: 0.5\nAuthor: Mario Klingemann\nContact: mario@quasimondo.com\nWebsite: http://www.quasimondo.com/BoxBlurForCanvas\nTwitter: @quasimondo\n\nIn case you find this class useful - especially in commercial projects -\nI am not totally unhappy for a small donation to my PayPal account\nmario@quasimondo.de\n\nOr support me on flattr:\nhttps://flattr.com/thing/140066/Superfast-Blur-a-pretty-fast-Box-Blur-Effect-for-CanvasJavascript\n\nCopyright (c) 2011 Mario Klingemann\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\n\n// eslint-disable-next-line max-len\nconst mul_table = [1, 57, 41, 21, 203, 34, 97, 73, 227, 91, 149, 62, 105, 45, 39, 137, 241, 107, 3, 173, 39, 71, 65, 238, 219, 101, 187, 87, 81, 151, 141, 133, 249, 117, 221, 209, 197, 187, 177, 169, 5, 153, 73, 139, 133, 127, 243, 233, 223, 107, 103, 99, 191, 23, 177, 171, 165, 159, 77, 149, 9, 139, 135, 131, 253, 245, 119, 231, 224, 109, 211, 103, 25, 195, 189, 23, 45, 175, 171, 83, 81, 79, 155, 151, 147, 9, 141, 137, 67, 131, 129, 251, 123, 30, 235, 115, 113, 221, 217, 53, 13, 51, 50, 49, 193, 189, 185, 91, 179, 175, 43, 169, 83, 163, 5, 79, 155, 19, 75, 147, 145, 143, 35, 69, 17, 67, 33, 65, 255, 251, 247, 243, 239, 59, 29, 229, 113, 111, 219, 27, 213, 105, 207, 51, 201, 199, 49, 193, 191, 47, 93, 183, 181, 179, 11, 87, 43, 85, 167, 165, 163, 161, 159, 157, 155, 77, 19, 75, 37, 73, 145, 143, 141, 35, 138, 137, 135, 67, 33, 131, 129, 255, 63, 250, 247, 61, 121, 239, 237, 117, 29, 229, 227, 225, 111, 55, 109, 216, 213, 211, 209, 207, 205, 203, 201, 199, 197, 195, 193, 48, 190, 47, 93, 185, 183, 181, 179, 178, 176, 175, 173, 171, 85, 21, 167, 165, 41, 163, 161, 5, 79, 157, 78, 154, 153, 19, 75, 149, 74, 147, 73, 144, 143, 71, 141, 140, 139, 137, 17, 135, 134, 133, 66, 131, 65, 129, 1];\n// eslint-disable-next-line max-len\nconst shg_table = [0, 9, 10, 10, 14, 12, 14, 14, 16, 15, 16, 15, 16, 15, 15, 17, 18, 17, 12, 18, 16, 17, 17, 19, 19, 18, 19, 18, 18, 19, 19, 19, 20, 19, 20, 20, 20, 20, 20, 20, 15, 20, 19, 20, 20, 20, 21, 21, 21, 20, 20, 20, 21, 18, 21, 21, 21, 21, 20, 21, 17, 21, 21, 21, 22, 22, 21, 22, 22, 21, 22, 21, 19, 22, 22, 19, 20, 22, 22, 21, 21, 21, 22, 22, 22, 18, 22, 22, 21, 22, 22, 23, 22, 20, 23, 22, 22, 23, 23, 21, 19, 21, 21, 21, 23, 23, 23, 22, 23, 23, 21, 23, 22, 23, 18, 22, 23, 20, 22, 23, 23, 23, 21, 22, 20, 22, 21, 22, 24, 24, 24, 24, 24, 22, 21, 24, 23, 23, 24, 21, 24, 23, 24, 22, 24, 24, 22, 24, 24, 22, 23, 24, 24, 24, 20, 23, 22, 23, 24, 24, 24, 24, 24, 24, 24, 23, 21, 23, 22, 23, 24, 24, 24, 22, 24, 24, 24, 23, 22, 24, 24, 25, 23, 25, 25, 23, 24, 25, 25, 24, 22, 25, 25, 25, 24, 23, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 23, 25, 23, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 24, 22, 25, 25, 23, 25, 25, 20, 24, 25, 24, 25, 25, 22, 24, 25, 24, 25, 24, 25, 25, 24, 25, 25, 25, 25, 22, 25, 25, 25, 24, 25, 24, 25, 18];\n\nexport default function boxBlurCanvasRGB(context, top_x, top_y, width, height, radius, iterations) {\n if (Number.isNaN(radius) || radius < 1) return;\n\n radius |= 0;\n\n if (Number.isNaN(iterations)) iterations = 1;\n iterations |= 0;\n if (iterations > 3) iterations = 3;\n if (iterations < 1) iterations = 1;\n\n const imageData = context.getImageData(top_x, top_y, width, height);\n\n const pixels = imageData.data;\n\n let rsum;\n let gsum;\n let bsum;\n let x;\n let y;\n let i;\n let p;\n let p1;\n let p2;\n let yp;\n let yi;\n let yw;\n let wm = width - 1;\n let hm = height - 1;\n let rad1 = radius + 1;\n\n let r = [];\n let g = [];\n let b = [];\n\n let mul_sum = mul_table[radius];\n let shg_sum = shg_table[radius];\n\n let vmin = [];\n let vmax = [];\n\n while (iterations-- > 0) {\n yw = yi = 0;\n\n for (y = 0; y < height; y++) {\n rsum = pixels[yw] * rad1;\n gsum = pixels[yw + 1] * rad1;\n bsum = pixels[yw + 2] * rad1;\n\n for (i = 1; i <= radius; i++) {\n p = yw + (((i > wm ? wm : i)) << 2);\n rsum += pixels[p++];\n gsum += pixels[p++];\n bsum += pixels[p++];\n }\n\n for (x = 0; x < width; x++) {\n r[yi] = rsum;\n g[yi] = gsum;\n b[yi] = bsum;\n\n if (y == 0) {\n vmin[x] = ((p = x + rad1) < wm ? p : wm) << 2;\n vmax[x] = ((p = x - radius) > 0 ? p << 2 : 0);\n }\n\n p1 = yw + vmin[x];\n p2 = yw + vmax[x];\n\n rsum += pixels[p1++] - pixels[p2++];\n gsum += pixels[p1++] - pixels[p2++];\n bsum += pixels[p1++] - pixels[p2++];\n\n yi++;\n }\n yw += (width << 2);\n }\n\n for (x = 0; x < width; x++) {\n yp = x;\n rsum = r[yp] * rad1;\n gsum = g[yp] * rad1;\n bsum = b[yp] * rad1;\n\n for (i = 1; i <= radius; i++) {\n yp += (i > hm ? 0 : width);\n rsum += r[yp];\n gsum += g[yp];\n bsum += b[yp];\n }\n\n yi = x << 2;\n for (y = 0; y < height; y++) {\n pixels[yi] = (rsum * mul_sum) >>> shg_sum;\n pixels[yi + 1] = (gsum * mul_sum) >>> shg_sum;\n pixels[yi + 2] = (bsum * mul_sum) >>> shg_sum;\n\n if (x == 0) {\n vmin[y] = ((p = y + rad1) < hm ? p : hm) * width;\n vmax[y] = ((p = y - radius) > 0 ? p * width : 0);\n }\n\n p1 = x + vmin[y];\n p2 = x + vmax[y];\n\n rsum += r[p1] - r[p2];\n gsum += g[p1] - g[p2];\n bsum += b[p1] - b[p2];\n\n yi += width << 2;\n }\n }\n }\n\n context.putImageData(imageData, top_x, top_y);\n}\n","import { IS_SAFARI } from './environment';\nimport safePlay from './safePlay';\nimport { patchSafariProgressiveAudio, isSafariPatchInProgress } from './patchSafariProgressiveAudio';\nimport { getDispatch } from '../lib/teact/teactn';\nimport { parseMessageKey } from '../modules/helpers';\n\ntype Handler = (eventName: string, e: Event) => void;\n\ninterface Track {\n audio: HTMLAudioElement;\n proxy: HTMLAudioElement;\n handlers: Handler[];\n onForcePlay?: NoneToVoidFunction;\n}\n\nconst tracks = new Map();\nlet queue: string[] = [];\n\nlet currentTrackId: string | undefined;\n\nfunction createAudio(trackId: string, onForcePlay?: NoneToVoidFunction) {\n const audio = new Audio();\n\n function handleEvent(eventName: string) {\n return (e: Event) => {\n if (!tracks.has(trackId)) {\n return;\n }\n\n if (isSafariPatchInProgress(audio)) {\n return;\n }\n\n tracks.get(trackId)!.handlers.forEach((handler) => {\n handler(eventName, e);\n });\n };\n }\n\n audio.addEventListener('timeupdate', handleEvent('onTimeUpdate'));\n audio.addEventListener('play', handleEvent('onPlay'));\n audio.addEventListener('pause', handleEvent('onPause'));\n audio.addEventListener('loadstart', handleEvent('onLoadStart'));\n audio.addEventListener('loadeddata', handleEvent('onLoadedData'));\n audio.addEventListener('playing', handleEvent('onPlaying'));\n audio.addEventListener('ended', () => {\n if (isSafariPatchInProgress(audio)) {\n return;\n }\n\n const nextTrackId = queue[queue.indexOf(trackId) + 1];\n if (!nextTrackId) {\n return;\n }\n\n if (!tracks.has(nextTrackId)) {\n // A bit hacky way to continue playlist when switching chat\n getDispatch().openAudioPlayer(parseMessageKey(nextTrackId));\n\n return;\n }\n\n const nextTrack = tracks.get(nextTrackId)!;\n\n if (nextTrack.onForcePlay) {\n nextTrack.onForcePlay();\n }\n\n currentTrackId = nextTrackId;\n\n if (nextTrack.audio.src) {\n safePlay(nextTrack.audio);\n }\n });\n\n return {\n audio,\n proxy: new Proxy(audio, {\n get: (origin, key: keyof HTMLAudioElement) => origin[key],\n }),\n handlers: [],\n onForcePlay,\n };\n}\n\nexport function stopCurrentAudio() {\n const currentTrack = currentTrackId && tracks.get(currentTrackId);\n if (currentTrack) {\n currentTrack.audio.pause();\n }\n}\n\nexport function register(trackId: string, handler: Handler, onForcePlay?: NoneToVoidFunction) {\n if (!tracks.has(trackId)) {\n tracks.set(trackId, createAudio(trackId, onForcePlay));\n\n if (!queue.includes(trackId)) {\n queue.push(trackId);\n }\n }\n\n const { audio, proxy, handlers } = tracks.get(trackId)!;\n\n handlers.push(handler);\n\n return {\n play(src: string) {\n if (currentTrackId && currentTrackId !== trackId) {\n tracks.get(currentTrackId)!.audio.pause();\n }\n\n currentTrackId = trackId;\n\n if (!audio.src) {\n audio.src = src;\n audio.preload = 'auto';\n\n if (src.includes('/progressive/') && IS_SAFARI) {\n patchSafariProgressiveAudio(audio);\n }\n }\n\n safePlay(audio);\n },\n\n pause() {\n if (currentTrackId === trackId) {\n audio.pause();\n }\n },\n\n setCurrentTime(time: number) {\n if (currentTrackId === trackId) {\n audio.currentTime = time;\n }\n },\n\n proxy,\n\n destroy(shouldRemoveFromQueue = false) {\n const track = tracks.get(trackId);\n if (!track) {\n return;\n }\n\n track.handlers = track.handlers.filter((h) => h !== handler);\n\n if (!track.handlers.length) {\n track.audio.pause();\n tracks.delete(trackId);\n\n if (shouldRemoveFromQueue) {\n queue = queue.filter((id) => id !== trackId);\n }\n\n if (trackId === currentTrackId) {\n currentTrackId = undefined;\n }\n }\n },\n };\n}\n","import { IS_IOS } from './environment';\n\nexport enum SwipeDirection {\n Up,\n Down,\n Left,\n Right,\n}\n\ninterface CaptureOptions {\n onCapture?: (e: MouseEvent | TouchEvent) => void;\n onRelease?: (e: MouseEvent | TouchEvent) => void;\n onDrag?: (\n e: MouseEvent | TouchEvent,\n captureEvent: MouseEvent | TouchEvent,\n params: {\n dragOffsetX: number;\n dragOffsetY: number;\n },\n ) => void;\n onSwipe?: (e: Event, direction: SwipeDirection) => boolean;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n excludedClosestSelector?: string;\n selectorToPreventScroll?: string;\n withCursor?: boolean;\n}\n\n// https://stackoverflow.com/questions/11287877/how-can-i-get-e-offsetx-on-mobile-ipad\n// Android does not have this value, and iOS has it but as read-only\nexport interface RealTouchEvent extends TouchEvent {\n pageX?: number;\n pageY?: number;\n}\n\ntype TSwipeAxis =\n 'x'\n | 'y'\n | undefined;\n\nconst IOS_SCREEN_EDGE_THRESHOLD = 20;\nconst MOVED_THRESHOLD = 15;\nconst SWIPE_THRESHOLD = 50;\n\nexport function captureEvents(element: HTMLElement, options: CaptureOptions) {\n let captureEvent: MouseEvent | RealTouchEvent | undefined;\n let hasMoved = false;\n let hasSwiped = false;\n let initialSwipeAxis: TSwipeAxis | undefined;\n\n function onCapture(e: MouseEvent | RealTouchEvent) {\n if (options.excludedClosestSelector && (\n (e.target as HTMLElement).matches(options.excludedClosestSelector)\n || (e.target as HTMLElement).closest(options.excludedClosestSelector)\n )) {\n return;\n }\n\n captureEvent = e;\n\n if (e.type === 'mousedown') {\n document.addEventListener('mousemove', onMove);\n document.addEventListener('mouseup', onRelease);\n } else if (e.type === 'touchstart') {\n // We need to always listen on `touchstart` target:\n // https://stackoverflow.com/questions/33298828/touch-move-event-dont-fire-after-touch-start-target-is-removed\n const target = e.target as HTMLElement;\n target.addEventListener('touchmove', onMove, { passive: true });\n target.addEventListener('touchend', onRelease);\n target.addEventListener('touchcancel', onRelease);\n\n if ('touches' in e) {\n if (e.pageX === undefined) {\n e.pageX = e.touches[0].pageX;\n }\n\n if (e.pageY === undefined) {\n e.pageY = e.touches[0].pageY;\n }\n }\n }\n\n document.body.classList.add('no-selection');\n if (options.withCursor) {\n document.body.classList.add('cursor-grabbing');\n }\n\n if (options.onCapture) {\n options.onCapture(e);\n }\n }\n\n function onRelease(e: MouseEvent | TouchEvent) {\n if (captureEvent) {\n if (options.withCursor) {\n document.body.classList.remove('cursor-grabbing');\n }\n document.body.classList.remove('no-selection');\n\n document.removeEventListener('mouseup', onRelease);\n document.removeEventListener('mousemove', onMove);\n (captureEvent.target as HTMLElement).removeEventListener('touchcancel', onRelease);\n (captureEvent.target as HTMLElement).removeEventListener('touchend', onRelease);\n (captureEvent.target as HTMLElement).removeEventListener('touchmove', onMove);\n\n captureEvent = undefined;\n\n if (IS_IOS && options.selectorToPreventScroll) {\n Array.from(document.querySelectorAll(options.selectorToPreventScroll)).forEach((scrollable) => {\n scrollable.style.overflow = '';\n });\n }\n\n if (hasMoved) {\n if (options.onRelease) {\n options.onRelease(e);\n }\n } else if (options.onClick && (!('button' in e) || e.button === 0)) {\n options.onClick(e);\n }\n }\n\n hasMoved = false;\n hasSwiped = false;\n initialSwipeAxis = undefined;\n }\n\n function onMove(e: MouseEvent | RealTouchEvent) {\n if (captureEvent) {\n if (e.type === 'touchmove' && ('touches' in e)) {\n if (e.pageX === undefined) {\n e.pageX = e.touches[0].pageX;\n }\n\n if (e.pageY === undefined) {\n e.pageY = e.touches[0].pageY;\n }\n }\n\n const dragOffsetX = e.pageX! - captureEvent.pageX!;\n const dragOffsetY = e.pageY! - captureEvent.pageY!;\n\n if (Math.abs(dragOffsetX) >= MOVED_THRESHOLD || Math.abs(dragOffsetY) >= MOVED_THRESHOLD) {\n hasMoved = true;\n }\n\n let shouldPreventScroll = false;\n\n if (options.onDrag) {\n options.onDrag(e, captureEvent, { dragOffsetX, dragOffsetY });\n shouldPreventScroll = true;\n }\n\n if (options.onSwipe && !hasSwiped) {\n hasSwiped = onSwipe(e, dragOffsetX, dragOffsetY);\n shouldPreventScroll = hasSwiped;\n }\n\n if (IS_IOS && shouldPreventScroll && options.selectorToPreventScroll) {\n Array.from(document.querySelectorAll(options.selectorToPreventScroll)).forEach((scrollable) => {\n scrollable.style.overflow = 'hidden';\n });\n }\n }\n }\n\n function onSwipe(e: MouseEvent | RealTouchEvent, dragOffsetX: number, dragOffsetY: number) {\n // Avoid conflicts with swipe-to-back gestures\n if (IS_IOS) {\n const x = (e as RealTouchEvent).touches[0].pageX;\n if (x <= IOS_SCREEN_EDGE_THRESHOLD || x >= window.innerWidth - IOS_SCREEN_EDGE_THRESHOLD) {\n return false;\n }\n }\n\n const xAbs = Math.abs(dragOffsetX);\n const yAbs = Math.abs(dragOffsetY);\n\n if (dragOffsetX && dragOffsetY) {\n const ratio = Math.max(xAbs, yAbs) / Math.min(xAbs, yAbs);\n // Diagonal swipe\n if (ratio < 2) {\n return false;\n }\n }\n\n let axis: TSwipeAxis | undefined;\n if (xAbs >= SWIPE_THRESHOLD) {\n axis = 'x';\n } else if (yAbs >= SWIPE_THRESHOLD) {\n axis = 'y';\n }\n\n if (!axis) {\n return false;\n }\n\n if (!initialSwipeAxis) {\n initialSwipeAxis = axis;\n } else if (initialSwipeAxis !== axis) {\n // Prevent horizontal swipe after vertical to prioritize scroll\n return false;\n }\n\n return processSwipe(e, axis, dragOffsetX, dragOffsetY, options.onSwipe!);\n }\n\n element.addEventListener('mousedown', onCapture);\n element.addEventListener('touchstart', onCapture, { passive: true });\n\n return () => {\n element.removeEventListener('mousedown', onCapture);\n element.removeEventListener('touchstart', onCapture);\n };\n}\n\nfunction processSwipe(\n e: Event,\n currentSwipeAxis: TSwipeAxis,\n dragOffsetX: number,\n dragOffsetY: number,\n onSwipe: (e: Event, direction: SwipeDirection) => boolean,\n) {\n if (currentSwipeAxis === 'x') {\n if (dragOffsetX < 0) {\n return onSwipe(e, SwipeDirection.Left);\n } else {\n return onSwipe(e, SwipeDirection.Right);\n }\n } else if (currentSwipeAxis === 'y') {\n if (dragOffsetY < 0) {\n return onSwipe(e, SwipeDirection.Up);\n } else {\n return onSwipe(e, SwipeDirection.Down);\n }\n }\n\n return false;\n}\n","import { DEBUG } from '../config';\n\nexport const CLIPBOARD_ITEM_SUPPORTED = navigator.clipboard && window.ClipboardItem;\n\nconst textCopyEl = document.createElement('textarea');\ntextCopyEl.setAttribute('readonly', '');\ntextCopyEl.tabIndex = -1;\ntextCopyEl.className = 'visually-hidden';\n\nexport const copyTextToClipboard = (str: string): void => {\n textCopyEl.value = str;\n document.body.appendChild(textCopyEl);\n const selection = document.getSelection();\n\n if (selection) {\n // Store previous selection\n const rangeToRestore = selection.rangeCount > 0 && selection.getRangeAt(0);\n textCopyEl.select();\n document.execCommand('copy');\n // Restore the original selection\n if (rangeToRestore) {\n selection.removeAllRanges();\n selection.addRange(rangeToRestore);\n }\n }\n\n document.body.removeChild(textCopyEl);\n};\n\nexport const copyImageToClipboard = (imageUrl?: string) => {\n if (!imageUrl) return;\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n const imageEl = new Image();\n imageEl.onload = (e: Event) => {\n if (ctx && e.currentTarget) {\n const img = e.currentTarget as HTMLImageElement;\n canvas.width = img.width;\n canvas.height = img.height;\n ctx.drawImage(img, 0, 0, img.width, img.height);\n canvas.toBlob(copyBlobToClipboard, 'image/png', 1);\n }\n };\n\n imageEl.src = imageUrl;\n};\n\nasync function copyBlobToClipboard(pngBlob: Blob | null) {\n if (!pngBlob || !CLIPBOARD_ITEM_SUPPORTED) {\n return;\n }\n\n try {\n await navigator.clipboard.write([\n new window.ClipboardItem({\n [pngBlob.type]: pngBlob,\n }),\n ]);\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n }\n}\n","// Sometimes event is fired earlier than animation completes\nconst ANIMATION_END_DELAY = 50;\n\nexport function waitForTransitionEnd(node: Node, handler: NoneToVoidFunction, propertyName?: string) {\n waitForEndEvent('transitionend', node, handler, propertyName);\n}\n\nexport function waitForAnimationEnd(node: Node, handler: NoneToVoidFunction, animationName?: string) {\n waitForEndEvent('animationend', node, handler, animationName);\n}\n\nfunction waitForEndEvent(\n eventType: 'transitionend' | 'animationend',\n node: Node,\n handler: NoneToVoidFunction,\n detailedName?: string,\n) {\n let isHandled = false;\n\n node.addEventListener(eventType, function handleAnimationEnd(e: TransitionEvent | AnimationEvent) {\n if (isHandled || e.target !== e.currentTarget) {\n return;\n }\n\n if (detailedName && (\n (e instanceof TransitionEvent && e.propertyName === detailedName)\n || (e instanceof AnimationEvent && e.animationName === detailedName)\n )) {\n return;\n }\n\n isHandled = true;\n\n node.removeEventListener(eventType, handleAnimationEnd as EventListener);\n\n setTimeout(() => {\n handler();\n }, ANIMATION_END_DELAY);\n } as EventListener);\n}\n","export default function cycleRestrict(length: number, index: number) {\n return index - Math.floor(index / length) * length;\n}\n","export default function download(url: string, filename: string) {\n const link = document.createElement('a');\n link.href = url;\n link.download = filename;\n link.click();\n}\n","import { getGlobal } from '../lib/teact/teactn';\n\nimport { FocusDirection } from '../types';\n\nimport {\n ANIMATION_LEVEL_MIN,\n FAST_SMOOTH_MAX_DISTANCE, FAST_SMOOTH_MAX_DURATION, FAST_SMOOTH_MIN_DURATION,\n FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE,\n} from '../config';\nimport { dispatchHeavyAnimationEvent } from '../hooks/useHeavyAnimationCheck';\nimport { animateSingle } from './animation';\n\nlet isAnimating = false;\n\nexport default function fastSmoothScroll(\n container: HTMLElement,\n element: HTMLElement,\n position: ScrollLogicalPosition | 'centerOrTop',\n margin = 0,\n maxDistance = FAST_SMOOTH_MAX_DISTANCE,\n forceDirection?: FocusDirection,\n forceDuration?: number,\n forceNormalContainerHeight?: boolean,\n) {\n const scrollFrom = calculateScrollFrom(container, element, maxDistance, forceDirection);\n\n if (forceDirection === FocusDirection.Static) {\n scrollWithJs(container, element, scrollFrom, position, margin, 0);\n return;\n }\n\n if (getGlobal().settings.byKey.animationLevel === ANIMATION_LEVEL_MIN) {\n forceDuration = 0;\n }\n\n scrollWithJs(container, element, scrollFrom, position, margin, forceDuration, forceNormalContainerHeight);\n}\n\nexport function isAnimatingScroll() {\n return isAnimating;\n}\n\nfunction calculateScrollFrom(\n container: HTMLElement,\n element: HTMLElement,\n maxDistance = FAST_SMOOTH_MAX_DISTANCE,\n forceDirection?: FocusDirection,\n) {\n const { offsetTop: elementTop } = element;\n const { scrollTop } = container;\n\n if (forceDirection === undefined) {\n const offset = elementTop - container.scrollTop;\n\n if (offset < -maxDistance) {\n return scrollTop + (offset + maxDistance);\n } else if (offset > maxDistance) {\n return scrollTop + (offset - maxDistance);\n }\n } else if (forceDirection === FocusDirection.Up) {\n return elementTop + maxDistance;\n } else if (forceDirection === FocusDirection.Down) {\n return Math.max(0, elementTop - maxDistance);\n }\n\n return scrollTop;\n}\n\nfunction scrollWithJs(\n container: HTMLElement,\n element: HTMLElement,\n scrollFrom: number,\n position: ScrollLogicalPosition | 'centerOrTop',\n margin = 0,\n forceDuration?: number,\n forceNormalContainerHeight?: boolean,\n) {\n const { offsetTop: elementTop, offsetHeight: elementHeight } = element;\n const { scrollTop: currentScrollTop, offsetHeight: containerHeight, scrollHeight } = container;\n const targetContainerHeight = forceNormalContainerHeight && container.dataset.normalHeight\n ? Number(container.dataset.normalHeight)\n : containerHeight;\n\n if (currentScrollTop !== scrollFrom) {\n container.scrollTop = scrollFrom;\n }\n\n let path!: number;\n\n switch (position) {\n case 'start':\n path = (elementTop - margin) - scrollFrom;\n break;\n case 'end':\n path = (elementTop + elementHeight + margin) - (scrollFrom + targetContainerHeight);\n break;\n // 'nearest' is not supported yet\n case 'nearest':\n case 'center':\n case 'centerOrTop':\n path = elementHeight < targetContainerHeight\n ? (elementTop + elementHeight / 2) - (scrollFrom + targetContainerHeight / 2)\n : (elementTop - margin) - scrollFrom;\n break;\n }\n\n if (path < 0) {\n const remainingPath = -scrollFrom;\n path = Math.max(path, remainingPath);\n } else if (path > 0) {\n const remainingPath = scrollHeight - (scrollFrom + targetContainerHeight);\n path = Math.min(path, remainingPath);\n }\n\n if (path === 0) {\n return;\n }\n\n const target = scrollFrom + path;\n\n if (forceDuration === 0) {\n container.scrollTop = target;\n return;\n }\n\n isAnimating = true;\n\n const absPath = Math.abs(path);\n const transition = absPath < FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE ? shortTransition : longTransition;\n const duration = forceDuration || (\n FAST_SMOOTH_MIN_DURATION\n + (absPath / FAST_SMOOTH_MAX_DISTANCE) * (FAST_SMOOTH_MAX_DURATION - FAST_SMOOTH_MIN_DURATION)\n );\n const startAt = Date.now();\n const onHeavyAnimationStop = dispatchHeavyAnimationEvent();\n\n animateSingle(() => {\n const t = Math.min((Date.now() - startAt) / duration, 1);\n const currentPath = path * (1 - transition(t));\n\n container.scrollTop = Math.round(target - currentPath);\n\n isAnimating = t < 1;\n\n if (!isAnimating) {\n onHeavyAnimationStop();\n }\n\n return isAnimating;\n });\n}\n\nfunction longTransition(t: number) {\n return 1 - ((1 - t) ** 5);\n}\n\nfunction shortTransition(t: number) {\n return 1 - ((1 - t) ** 3.5);\n}\n","import { getGlobal } from '../lib/teact/teactn';\n\nimport { ANIMATION_LEVEL_MIN } from '../config';\nimport { IS_IOS } from './environment';\nimport { animate } from './animation';\n\nconst DEFAULT_DURATION = 300;\n\nexport default function fastSmoothScrollHorizontal(container: HTMLElement, left: number, duration = DEFAULT_DURATION) {\n if (getGlobal().settings.byKey.animationLevel === ANIMATION_LEVEL_MIN) {\n duration = 0;\n }\n\n // Native way seems to be smoother in Chrome\n if (!IS_IOS) {\n container.scrollTo({\n left,\n ...(duration && { behavior: 'smooth' }),\n });\n } else {\n scrollWithJs(container, left, duration);\n }\n}\n\nfunction scrollWithJs(container: HTMLElement, left: number, duration: number) {\n const { scrollLeft, offsetWidth: containerWidth, scrollWidth } = container;\n let path = left - scrollLeft;\n\n if (path < 0) {\n const remainingPath = -scrollLeft;\n path = Math.max(path, remainingPath);\n } else if (path > 0) {\n const remainingPath = scrollWidth - (scrollLeft + containerWidth);\n path = Math.min(path, remainingPath);\n }\n\n if (path === 0) {\n return;\n }\n\n const target = scrollLeft + path;\n\n if (duration === 0) {\n container.scrollLeft = target;\n return;\n }\n\n const startAt = Date.now();\n\n animate(() => {\n const t = Math.min((Date.now() - startAt) / duration, 1);\n\n const currentPath = path * (1 - transition(t));\n container.scrollLeft = Math.round(target - currentPath);\n\n return t < 1;\n });\n}\n\nfunction transition(t: number) {\n return 1 - ((1 - t) ** 3.5);\n}\n","import { IS_TOUCH_ENV } from './environment';\n\nexport default function focusEditableElement(element: HTMLElement, force?: boolean) {\n if (!force && element === document.activeElement) {\n return;\n }\n\n const selection = window.getSelection()!;\n const range = document.createRange();\n const lastChild = element.lastChild || element;\n\n if (!IS_TOUCH_ENV && (!lastChild || !lastChild.nodeValue)) {\n element.focus();\n return;\n }\n\n range.selectNodeContents(lastChild);\n // `false` means collapse to the end rather than the start\n range.collapse(false);\n selection.removeAllRanges();\n selection.addRange(range);\n}\n","/*\n * Thanks to Ace Monkey for this mind-blowing patch.\n */\n\nexport function patchSafariProgressiveAudio(audioEl: HTMLAudioElement) {\n if (audioEl.dataset.patchedForSafari) {\n return;\n }\n\n audioEl.addEventListener('play', () => {\n const t = audioEl.currentTime;\n\n function onProgress() {\n if (!audioEl.buffered.length) {\n return;\n }\n\n audioEl.dataset.patchForSafariInProgress = 'true';\n audioEl.currentTime = audioEl.duration - 1;\n audioEl.addEventListener('progress', () => {\n delete audioEl.dataset.patchForSafariInProgress;\n audioEl.currentTime = t;\n if (audioEl.paused) {\n audioEl.play();\n }\n }, { once: true });\n\n audioEl.removeEventListener('progress', onProgress);\n }\n\n audioEl.addEventListener('progress', onProgress);\n }, { once: true });\n\n audioEl.dataset.patchedForSafari = 'true';\n}\n\nexport function isSafariPatchInProgress(audioEl: HTMLAudioElement) {\n return Boolean(audioEl.dataset.patchForSafariInProgress);\n}\n","import { IS_IOS } from './environment';\n\nexport default (container: HTMLDivElement, scrollTop?: number) => {\n if (IS_IOS) {\n container.style.overflow = 'hidden';\n }\n\n if (scrollTop !== undefined) {\n container.scrollTop = scrollTop;\n }\n\n if (IS_IOS) {\n container.style.overflow = '';\n }\n};\n","import { DEBUG } from '../config';\n\nexport default (mediaEl: HTMLMediaElement) => {\n mediaEl.play().catch((err) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn(err);\n }\n });\n};\n"],"names":["WIDTH","large","medium","small","sticker","size","observeIntersection","lastSyncTime","forceLoadPreview","ref","useRef","isAnimationLoaded","markAnimationLoaded","useFlag","localMediaHash","id","isIntersecting","useIsIntersecting","thumbDataUri","thumbnail","dataUri","previewBlobUrl","useMedia","ApiMediaFormat","transitionClassNames","useTransitionForMedia","mediaData","isMediaLoaded","Boolean","playKey","setPlayKey","useState","String","Math","random","handleClick","useCallback","width","style","className","onClick","src","LIKE_STICKER_ID","undefined","alt","key","animationData","quality","play","noLoop","onLoad","lottiePromise","RLottie","async","ensureLottie","default","setTimeout","memo","playSegment","speed","isLowPriority","animation","setAnimation","container","wasPlaying","isFrozen","playRef","current","playSegmentRef","useEffect","exec","newAnimation","setSpeed","then","fastRaf","destroy","playAnimation","shouldRestart","goToAndPlay","pauseAnimation","pause","freezeAnimation","isPlaying","unfreezeAnimation","unfreezeAnimationOnRaf","useHeavyAnimationCheck","useBackgroundMode","fullClassName","buildClassName","MIN_SPIKES","IS_SINGLE_COLUMN_LAYOUT","MAX_SPIKES","renderSeekline","playProgress","bufferedProgress","handleStartSeek","handleSeek","handleStopSeek","onMouseDown","onMouseMove","onMouseUp","theme","message","senderTitle","uploadProgress","target","date","isSelectable","isSelected","onPlay","onReadMedia","onCancelUpload","onDateClick","content","audio","voice","isMediaUnread","isVoice","isSeeking","lang","useLang","isActivated","setIsActivated","shouldDownload","downloadProgress","useMediaWithDownloadProgress","getMessageMediaHash","getMessageMediaFormat","isBuffered","bufferingHandlers","checkBuffering","useBuffering","playPause","setCurrentTime","duration","useAudioPlayer","getMessageKey","getMediaDuration","chatId","isMessageLocal","isDownloadStarted","directDownloadProgress","handleDownloadClick","useMediaDownload","getMessageAudioCaption","isLoadingForPlaying","isUploading","isTransferring","transferProgress","getMediaTransferState","shouldRender","shouldRenderSpinner","spinnerClassNames","useShowTransition","handleButtonClick","e","seekBar","currentTarget","closest","left","getBoundingClientRect","clientX","handleDateClick","seekHandlers","isOwn","isOwnMessage","renderedWaveform","useMemo","waveform","fillColor","fillOwnColor","progressFillColor","progressFillOwnColor","durationFactor","min","spikesCount","round","decodedWaveform","encoded5bit","bitsCount","length","valuesCount","floor","result","Array","bitsData","i","l","byteIndex","bitShift","value","lastByteIndex","lastBitShift","lastValue","decodeWaveform","Uint8Array","data","spikes","peak","fitCount","newData","springFactor","leftFiller","rightFiller","idx","val","interpolateArray","height","progress","fillStyle","progressFillStyle","canvas","document","createElement","ctx","getContext","scale","forEach","item","globalAlpha","spikeHeight","max","x","y","radius","beginPath","moveTo","arcTo","closePath","roundedRectangle","fill","toDataURL","renderWaveformToDataUri","draggable","renderWaveform","buttonClassNames","push","showSeekline","contentClassName","dir","isRtl","Button","ripple","join","ariaLabel","ProgressSpinner","transparent","noCross","renderText","title","fileName","getFirstLine","Link","formatPastTimeShort","formatMediaDuration","performer","getSecondLine","formatMediaDateTime","renderAudio","renderVoice","chat","user","text","withOnlineStatus","isSavedMessages","isDeleted","isDeletedUser","imageHash","getChatAvatarHash","shouldRenderFullMedia","decoding","userFullName","getUserFullName","getFirstLetters","getChatTitle","isChatPrivate","isOnline","isUserOnline","getUserColorKey","senderId","IS_TEST","withGlobal","global","chatOrUserId","selectChat","selectUser","isMuted","selectIsChatMuted","selectNotifySettings","selectNotifyExceptions","canInviteUsers","isChatChannel","isUserRightBanned","getHasAdminRight","setGlobal","actions","pick","forceShowSelf","loadFullUser","showNotification","updateChatMutedState","userId","fullInfo","username","phoneNumber","isSelf","handleNotificationChange","isRestricted","copy","entity","copyTextToClipboard","formattedNumber","formatPhoneNumberWithCode","link","getChatLink","description","bio","getChatDescription","icon","multiline","narrow","isStatic","label","checked","inactive","isPrivateChat","isChatWithSelf","selectIsChatWithSelf","getPrivateChatUserId","isBot","isUserBot","isSupport","canDeleteForAll","contactName","getUserFirstOrLastName","isChannel","isBasicGroup","isChatBasicGroup","isSuperGroup","isChatSuperGroup","currentUserId","isOpen","onClose","onCloseAnimationEnd","leaveChannel","deleteHistory","deleteChannel","deleteChatUser","blockContact","chatTitle","handleDeleteMessageForAll","shouldDeleteForAll","handleDeleteAndStop","contactId","accessHash","handleDeleteChat","isCreator","header","color","isText","smaller","withDate","datetime","sender","onMediaClick","extension","getDocumentExtension","timestamp","withMediaViewer","mediaType","isDownloadAllowed","setIsDownloadAllowed","hasPreview","getDocumentHasPreview","getMessageMediaThumbDataUri","localBlobUrl","previewData","isAllowed","download","name","thumbnailDataUri","actionIcon","isMessageDocumentVideo","elementRef","shouldSpinnerRender","getColorFromExtension","sizeString","getFileSizeString","shouldRenderThumb","getDocumentThumbnailDimensions","onlineCount","selectChatOnlineCount","areMessagesLoaded","selectChatMessages","typingStatus","avatarSize","withUsername","withFullInfo","withUpdatingStatus","withChatType","noRtl","loadFullChat","openMediaViewer","isMin","handleAvatarViewerOpen","hasPhoto","stopPropagation","avatarOwnerId","origin","MediaViewerOrigin","isVerified","getChatTypeString","handle","groupStatus","chatTypeString","membersCount","getGroupStatus","onlineStatus","renderStatusOrTyping","outgoingStatus","status","idPrefix","mediaBlobUrl","video","getMessageVideo","isGif","Keys","activeKey","itemIds","selectedIds","filterValue","filterPlaceholder","notFoundText","searchInputId","isLoading","noScrollRestore","onSelectedIdsChange","onFilterChange","onLoadMore","inputRef","shouldMinimize","requestAnimationFrame","focus","handleItemClick","newSelectedIds","includes","splice","indexOf","handleFilterChange","viewportIds","getMore","useInfiniteScroll","map","isMinimized","canClose","clickArg","onChange","placeholder","items","iconElement","titleText","serverTimeOffset","noStatusOrTyping","fullName","getUserStatus","photo","isFirstPhoto","getMediaHash","forceAvatar","hash","fullMediaData","startsWith","avatarThumbnailData","useBlurSync","imageSrc","prevImageSrc","usePrevious","Spinner","connectionState","animationLevel","settings","byKey","photos","slideAnimation","currentPhotoIndex","setCurrentPhotoIndex","isFirst","isLast","profile","currentIndex","slice","mediaLoader","usePhotosPreload","handleProfilePhotoClick","profilePhotoIndex","selectPreviousMedia","selectNextMedia","element","querySelector","captureEvents","selectorToPreventScroll","onSwipe","IS_TOUCH_ENV","direction","SwipeDirection","renderPhoto","isVerifiedIconShown","_","renderPhotoTabs","Transition","type","VerifiedIcon","noAnimate","onUnfaveClick","stickerSelector","shouldPlay","lottieData","isAnimated","markLoaded","unmarkLoaded","canAnimatedPlay","shouldRenderPreview","previewTransitionClassNames","emoji","preventMessageInputBlurWithBubbling","preventDefault","props","StickerSetModal","useModuleLoader","Bundles","typingUser","typingUserName","action","replace","trim","onMessageClick","linkData","getMessageWebPage","getFirstLinkInMessage","url","domain","messageText","getMessageSummaryText","siteName","handleMessageClick","displayUrl","truncatedDescription","trimText","MEDIA_VIEWER_MEDIA_QUERY","REM","parseInt","getComputedStyle","documentElement","fontSize","ROUND_VIDEO_DIMENSIONS","AVATAR_FULL_DIMENSIONS","DEFAULT_MEDIA_DIMENSIONS","cachedMaxWidthOwn","cachedMaxWidth","cachedMaxWidthNoAvatar","getAvailableWidth","fromOwnMessage","isForwarded","isWebPagePhoto","noAvatars","extraPaddingRem","regularMaxWidth","windowWidth","windowSize","getMaxMessageWidthRem","calculateDimensionsForMessageMedia","aspectRatio","calculateDimensions","getAvailableHeight","getMediaViewerAvailableDimensions","withFooter","isVideo","mql","window","matchMedia","windowHeight","occupiedHeightRem","matches","calculateInlineImageDimensions","getPhotoInlineDimensions","calculateVideoDimensions","getVideoDimensions","getPictogramDimensions","getStickerDimensions","baseWidth","STICKER_SIZE_INLINE_MOBILE_FACTOR","STICKER_SIZE_INLINE_DESKTOP_FACTOR","calculatedHeight","calculateMediaViewerDimensions","availableWidth","availableHeight","mediaWidth","mediaHeight","calculatedWidth","renderMessageText","highlight","shouldRenderHqEmoji","formattedText","rawText","getMessageText","entities","renderTextWithEntities","organizeEntity","index","organizedEntityIndexes","offset","organizedIndexes","Set","has","nestedEntities","filter","parsedEntity","isChanged","organizedIndex","add","organizeEntities","organizedEntities","organizedEntity","shouldRenderAsHtml","renderMessagePart","deleteLineBreakAfterPre","renderEntity","textPartStart","textPartEnd","isLastEntity","renderResult","textBefore","substring","textBeforeLength","substr","entityStartIndex","entityEndIndex","entityContent","nestedEntityContent","ApiMessageEntityTypes","nestedIndex","nestedEntity","nestedEntityIndex","nestedResult","nestedEntityEndIndex","newEntity","rawEntityText","renderedContent","getLinkUrl","processEntityAsHtml","entityText","handleBotCommandClick","handleHashtagClick","href","rel","processEntity","isArray","textAfter","arrayIndex","c","emojiFilter","getDispatch","sendBotCommand","command","innerText","setLocalTextSearchQuery","query","searchTextMessagesLocal","ChatAnimationTypes","isPinned","isShown","unreadCount","hasUnreadMark","renderContent","unreadMentionsCount","formatIntegerCompact","ShowTransition","isCustom","lastMessage","replyToMessageId","isOutgoing","lastMessageSender","lastMessageAction","getMessageAction","actionTargetMessage","selectChatMessage","targetUserIds","actionTargetUserIds","targetChatId","actionTargetChatId","privateChatUserId","byId","usersById","users","currentChatId","threadId","currentThreadId","messageListType","selectCurrentMessageList","MAIN_THREAD_ID","draft","selectDraft","canScrollDown","lastMessageOutgoingStatus","selectOutgoingStatus","privateChatUser","folderId","orderDiff","animationType","openChat","focusLastMessage","isDeleteModalOpen","openDeleteModal","closeDeleteModal","shouldRenderDeleteModal","markRenderDeleteModal","unmarkRenderDeleteModal","isAction","isActionMessage","useEnsureMessage","mediaThumbnail","getMessageSticker","isRoundVideo","getMessageRoundVideo","actionTargetUsers","useLayoutEffect","Opacity","opacity","classList","Move","transform","remove","ANIMATION_END_DELAY","shouldReplaceHistory","contextActions","useChatContextActions","handleDelete","ListItem","Avatar","LastMessageMeta","TypingStatus","actionOrigin","renderActionMessageText","asPlain","senderName","getMessageSenderName","blobUrl","renderMessageSummary","renderLastMessageOrTyping","DeleteChatModal","folderType","chatFolder","selectChatFolder","animatedEmoji","selectAnimatedEmoji","foldersDispatch","onScreenSelect","handleEditFolder","payload","SettingsScreens","AnimatedEmoji","fluid","pill","FolderTypeToListType","chats","listIds","chatsById","orderedPinnedIds","listType","notifySettings","notifyExceptions","isActive","loadMoreChats","preloadTopChatMessages","openNextChat","currentListIds","currentPinnedIds","prepareFolderListIds","orderById","orderedIds","newChatArrays","prepareChatList","singleList","pinnedChats","otherChats","newOrderedIds","reduce","acc","prevOrderById","orderDiffById","mapValues","order","Infinity","loadMoreOfType","CHAT_LIST_SLICE","ALL_CHATS_PRELOAD_DISABLED","chatArrays","getAnimationType","movesUp","movesDown","orderDiffIds","Object","keys","Number","numberOfUp","numberOfDown","None","useChatAnimationType","handleKeyDown","IS_PWA","IS_MAC_OS","metaKey","ctrlKey","code","digit","match","position","altKey","targetIndexDelta","addEventListener","removeEventListener","InfiniteScroll","preloadBackwards","noFastList","viewportOffset","pinnedOffset","IS_ANDROID","CHAT_HEIGHT_PX","teactFastList","teactOrderKey","getChatOrder","renderChats","Loading","isQuick","onFileSelect","isHovered","markHovered","unmarkHovered","onDrop","onDragEnter","onDragLeave","relatedTarget","toTarget","DropAreaState","withQuick","onHide","hideTimeoutRef","prevWithQuick","captureEscKeyListener","handleFilesDrop","dataTransfer","dt","files","from","handleQuickFilesDrop","handleDragLeave","fromTarget","onDragOver","clearTimeout","EmojiTooltip","MAX_INPUT_HEIGHT","messageSendKeyCombo","replyingToId","selectReplyingToId","noTabCapture","isPollModalOpen","payment","isPaymentModalOpen","isAttachmentModalInput","editableInputId","html","forcedPlaceholder","shouldSetFocus","shouldSuppressFocus","shouldSuppressTextFormatter","onUpdate","onSuppressedFocus","onSend","editLastMessage","replyToNextMessage","cloneRef","isContextMenuOpenRef","isTextFormatterOpen","openTextFormatter","closeTextFormatter","textFormatterAnchorPosition","setTextFormatterAnchorPosition","selectedRange","setSelectedRange","updateInputHeight","useLayoutEffectWithPrevDeps","prevHtml","innerHTML","focusInput","focusEditableElement","handleCloseTextFormatter","selection","getSelection","removeAllRanges","empty","clearSelection","checkSelection","IS_IOS","rangeCount","selectionRange","getRangeAt","selectedText","toString","isSelectionInsideInput","EDITABLE_INPUT_ID","parseEmojiOnlyString","START_TO_END","selectionRect","inputRect","top","willSend","input","clone","currentHeight","newHeight","scrollHeight","transitionDuration","log","abs","toggle","captureFirstTab","debounce","captureKeyboardListeners","onTab","suppressFocus","blur","contentEditable","textContent","onKeyDown","shiftKey","handleKeyUp","event","button","closeContextMenuMouseListener","closeContextMenuKeyListener","handleMouseUp","onContextMenu","onTouchCancel","anchorPosition","TEXT_FORMAT_BY_TAG_NAME","B","STRONG","I","EM","U","DEL","CODE","fragmentEl","containerRef","linkUrlInputRef","isLinkControlOpen","openLinkControl","closeLinkControl","linkUrl","setLinkUrl","isEditingLink","setIsEditingLink","inputClassName","setInputClassName","selectedTextFormats","setSelectedTextFormats","useVirtualBackdrop","selectedFormats","parentElement","commonAncestorContainer","textFormat","tagName","getSelectedText","getSelectedElement","updateInputStyles","offsetWidth","scrollWidth","scrollLeft","getFormatButtonClassName","some","fKey","monospace","strikethrough","handleBoldText","execCommand","bold","handleItalicText","italic","handleUnderlineText","underline","handleStrikethroughText","replaceWith","handleMonospaceText","handleLinkUrlConfirm","formattedLinkUrl","encodeURI","addRange","restoreSelection","handler","KeyK","KeyB","KeyU","KeyI","KeyM","KeyS","linkUrlConfirmClassName","autoComplete","inputMode","onScroll","ENTITY_CLASS_BY_NODE_NAME","S","STRIKE","PRE","BLOCKQUOTE","parseMessageInput","fragment","parsedHtml","IS_EMOJI_SUPPORTED","parseMarkdown","textIndex","recursionDeepness","addEntity","node","nodeName","anchor","dataset","entityType","getEntityTypeFromNode","rawIndex","getEntityDataFromNode","hasChildNodes","childNodes","inputId","parentNode","iterations","emojiDataPromise","emojiRawData","emojiData","RE_EMOJI_SEARCH","RE_BR","RE_SPACE","RE_CLEAN_HTML","RegExp","useEmojiTooltip","recentEmojiIds","onUpdateHtml","baseEmojiKeywords","emojiKeywords","isDisabled","markIsOpen","unmarkIsOpen","setById","keywords","setKeywords","byKeyword","setByKeyword","names","setNames","byName","setByName","shouldForceInsertEmoji","setShouldForceInsertEmoji","filteredEmojis","setFilteredEmojis","MEMO_EMPTY_ARRAY","recentEmojis","values","pickTruthy","emojis","uncompressEmoji","ensureEmojiData","byNative","buildCollectionByKey","baseEmojisByKeyword","natives","emojisByKeyword","emojisByName","getEmojiCode","forceSend","endsWith","matched","matchedKeywords","keyword","sort","concat","flatten","matchedNames","unique","insertEmoji","textEmoji","isForce","atIndex","lastIndexOf","messageInput","getElementById","native","isEmojiTooltipOpen","closeEmojiTooltip","searchUserName","usernameLowered","toLowerCase","fullNameLowered","filterLowered","searchWords","runThrottled","throttle","cb","RE_USERNAME_SEARCH","useMentionTooltip","canSuggestMembers","groupChatMembers","topInlineBotIds","usersToMention","setUsersToMention","topInlineBots","getFilteredUsers","withInlineBots","inlineBots","inlineBot","chatMembers","usernameFilter","getUsernameFilter","canSuggestInlineBots","insertMention","forceFocus","insertedHtml","isMentionTooltipOpen","closeMentionTooltip","mentionFilteredUsers","useAsyncRendering","dependencies","delay","shouldRenderRef","timeoutRef","forceUpdate","useForceUpdate","useOnChange","textParts","confirmLabel","confirmHandler","confirmIsDestructive","isButtonsInOneRow","onEnter","split","textPart","disabled","children","buttonClassName","tabIndex","itemSelector","sensitiveArea","noScrollRestoreOnTop","cacheBuster","stateRef","loadMoreBackwards","loadMoreForwards","noScroll","LoadMoreDirection","clientHeight","state","newScrollTop","listItemElements","querySelectorAll","currentAnchor","scrollTop","currentAnchorTop","nextAnchor","resetScroll","isScrollTopJustUpdated","handleScroll","listLength","offsetHeight","isNearTop","offsetTop","isNearBottom","isUpdated","nextAnchorTop","newAnchorTop","offsetParent","buttonRef","destructive","isTouched","markIsTouched","unmarkIsTouched","isContextMenuOpen","contextMenuPosition","handleBeforeContextMenu","handleContextMenu","handleContextMenuClose","handleContextMenuHide","useContextMenuHandlers","getTriggerElement","getRootElement","getMenuElement","positionX","positionY","menuStyle","useContextMenuPosition","handleMouseDown","role","autoClose","hasCloseButton","noBackdrop","shouldSkipHistoryAnimations","modalRef","onEsc","focusableElements","currentFocusedIndex","findIndex","em","isSameNode","activeElement","newFocusedIndex","trapFocus","forceClose","useHistoryBack","useEffectWithPrevDeps","prevIsOpen","body","dispatchHeavyAnimationEvent","Portal","containerId","onDismiss","setIsOpen","timerRef","closeAndDismiss","handleMouseEnter","handleMouseLeave","onMouseEnter","onMouseLeave","appendChild","TeactDOM","removeChild","RADIUSES","s","m","xl","square","circleRadius","STROKE_WIDTH","borderRadius","circumference","PI","svg","firstElementChild","strokeDashOffset","setAttribute","subLabel","hidden","options","selected","loadingOption","handleChange","option","parentContainerClassName","focused","onReset","onFocus","onBlur","isInputFocused","markInputFocused","unmarkInputFocused","prevChildren","fromChildrenRef","noAnimation","onCheck","active","badgeCount","isBadgeActive","previousActiveTab","tabRef","tab","indicator","prevTab","currentIndicator","shiftLeft","offsetLeft","scaleFactor","clientWidth","tabs","activeTab","big","onSwitchTab","useHorizontalScroll","activeTabElement","newLeft","fastSmoothScrollHorizontal","CLEANED_UP","Symbol","renderCount","shouldRestoreHeight","shouldCleanup","cleanupExceptionKey","onStart","onStop","getGlobal","currentKeyRef","rendersRef","prevActiveKey","activeKeyChanged","cleanup","childElements","isBackwards","prevActiveIndex","activeIndex","HTMLElement","dispatchHeavyAnimationStop","onAnimationEnd","watchedNode","firstChild","waitForAnimationEnd","flexBasis","renders","contents","render","INCLUDED_CHAT_TYPES","EXCLUDED_CHAT_TYPES","INCLUDE_FILTER_FIELDS","EXCLUDE_FILTER_FIELDS","selectChatFilters","mode","selectTemp","selectedChatIds","selectedChatTypes","includedChatIds","includeFilters","folder","excludedChatIds","excludeFilters","getSuggestedFolderName","filters","bots","groups","channels","contacts","nonContacts","INITIAL_STATE","chatFilter","foldersReducer","omit","error","useReducer","trackId","originalDuration","handlers","onInit","onForcePlay","noPlaylist","controllerRef","setIsPlaying","isPlayingSync","setPlayProgress","register","eventName","proxy","isFinite","currentTime","paused","isSafariPatchInProgress","prevShouldPlay","prevSrc","audioProxy","hasFocus","cache","Map","blurredRef","img","Image","imgToCanvas","fastBlur","blurredAsync","get","onload","blurredDataUri","clear","set","useBlur","noInitiallyBuffered","setIsBuffered","setBufferedProgress","setIsBufferedDebounced","handleBuffering","media","buffered","end","readyState","onLoadedData","onPlaying","onLoadStart","onPause","onTimeUpdate","onProgress","useCanvasBlur","withRaf","canvasRef","processBlur","alpha","IS_CANVAS_FILTER_SUPPORTED","drawImage","RADIUS","isInSearch","toggleChatPinned","toggleChatArchived","toggleChatUnread","actionPin","actionUnreadMark","actionMute","actionArchive","isChatArchived","actionDelete","getCanDeleteChat","isMenuDisabled","shouldDisableOnLink","shouldDisableOnLongTap","setIsContextMenuOpen","setContextMenuPosition","clientY","timer","clearLongPressTimer","startLongPressTimer","contains","originalEvent","touches","cancelClickOnce","stopImmediatePropagation","emulateContextMenuEvent","passive","extraPaddingX","extraTopPadding","setPositionX","setPositionY","setStyle","triggerEl","emptyRect","menuEl","rootEl","triggerRect","menuRect","rootRect","horizontalPostition","useCurrentOrPrev","shouldSkipUndefined","shouldForceCurrent","prev","messageId","replyOriginForId","loadMessage","loadMessageThrottled","throttled","deltaX","deltaY","listSlice","forceFullPreload","lastParamsRef","viewportIdsRef","newViewportIds","getViewportSlice","prevListIds","prevIsDisabled","offsetId","areSortedArraysEqual","areSomeLocal","areAllLocal","sourceIds","indexForDirection","to","useIntersectionObserver","rootRef","throttleMs","debounceMs","shouldSkipFirst","margin","threshold","rootCallback","rootCallbackRef","freezeFlagsRef","autoUnfreezeTimeoutRef","onUnfreezeRef","unfreeze","freeze","observer","disconnect","callbacks","observe","targetCallback","entriesAccumulator","observerCallbackSync","entries","entry","callback","scheduler","observerCallback","IntersectionObserver","root","rootMargin","initController","controller","delete","unobserve","useOnIntersect","targetRef","setIsIntersecting","debugKey","prevDeps","mediaHash","noLoad","mediaFormat","startedAt","Date","now","spentTime","setIsDownloadStarted","isHtmlAllowed","isStreaming","IS_PROGRESSIVE_SUPPORTED","setDownloadProgress","startedAtRef","handleProgress","closeTimeout","useMouseInside","menuCloseTimeout","isMouseInside","usePrevDuringAnimation","isCurrentPresent","isPrevPresent","reducer","initialState","reducerRef","setState","currentState","SPEED","fast","slow","willAnimate","setShouldRenderThumb","useVideoCleanup","videoRef","videoEl","load","mul_table","shg_table","boxBlurCanvasRGB","context","top_x","top_y","isNaN","imageData","getImageData","pixels","rsum","gsum","bsum","p","p1","p2","yp","yi","yw","wm","hm","rad1","r","g","b","mul_sum","shg_sum","vmin","vmax","putImageData","tracks","currentTrackId","queue","stopCurrentAudio","currentTrack","Audio","handleEvent","nextTrackId","openAudioPlayer","parseMessageKey","nextTrack","safePlay","Proxy","createAudio","preload","IS_SAFARI","patchSafariProgressiveAudio","time","shouldRemoveFromQueue","track","h","captureEvent","initialSwipeAxis","hasMoved","hasSwiped","onCapture","excludedClosestSelector","onMove","onRelease","pageX","pageY","withCursor","scrollable","overflow","dragOffsetX","dragOffsetY","shouldPreventScroll","onDrag","innerWidth","xAbs","yAbs","axis","currentSwipeAxis","Left","Right","Up","Down","processSwipe","CLIPBOARD_ITEM_SUPPORTED","navigator","clipboard","ClipboardItem","textCopyEl","str","rangeToRestore","select","copyImageToClipboard","imageUrl","imageEl","toBlob","copyBlobToClipboard","pngBlob","write","DEBUG","console","waitForTransitionEnd","propertyName","waitForEndEvent","animationName","eventType","detailedName","isHandled","handleAnimationEnd","TransitionEvent","AnimationEvent","cycleRestrict","filename","click","isAnimating","fastSmoothScroll","maxDistance","FAST_SMOOTH_MAX_DISTANCE","forceDirection","forceDuration","forceNormalContainerHeight","scrollFrom","elementTop","FocusDirection","calculateScrollFrom","ANIMATION_LEVEL_MIN","scrollWithJs","isAnimatingScroll","elementHeight","currentScrollTop","containerHeight","targetContainerHeight","normalHeight","path","remainingPath","absPath","transition","FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE","shortTransition","longTransition","FAST_SMOOTH_MIN_DURATION","FAST_SMOOTH_MAX_DURATION","startAt","onHeavyAnimationStop","animateSingle","t","currentPath","containerWidth","animate","scrollTo","behavior","force","range","createRange","lastChild","nodeValue","selectNodeContents","collapse","audioEl","patchedForSafari","patchForSafariInProgress","once","mediaEl","catch","err","warn"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/484.40f6759b976ebb12ec3f.css b/dist/484.87953bd73fba4543a4f6.css similarity index 99% rename from dist/484.40f6759b976ebb12ec3f.css rename to dist/484.87953bd73fba4543a4f6.css index 2c88b598..5e3449bd 100644 --- a/dist/484.40f6759b976ebb12ec3f.css +++ b/dist/484.87953bd73fba4543a4f6.css @@ -33,4 +33,4 @@ .TextFormatter{transform:translate(-50%, -3.25rem)}.TextFormatter,.TextFormatter-link-control{position:absolute;background:var(--color-background);border-radius:var(--border-radius-messages);padding:.5rem .375rem;box-shadow:0 1px 2px var(--color-default-shadow)}.TextFormatter-link-control{left:0;top:0;opacity:0;pointer-events:none;transition:opacity .3s ease}.Modal .TextFormatter-link-control{max-width:100%}@media(max-width: 600px){.TextFormatter-link-control{max-width:calc(100vw - var(--text-formatter-left) + 3rem)}}.TextFormatter-link-control input{border:none !important;outline:none !important;width:100%;color:var(--color-text);background-color:var(--color-background)}.TextFormatter-buttons,.TextFormatter-link-url-confirm{display:flex;flex-wrap:nowrap;align-items:center}.TextFormatter-divider{width:1px;height:1.75rem;margin:0 .25rem;background-color:var(--color-borders)}.TextFormatter-link-url-input-wrapper{width:20rem;position:relative;max-width:100%}@media(max-width: 600px){.TextFormatter-link-url-input-wrapper{max-width:90vw}}.TextFormatter-link-url-input-wrapper::before,.TextFormatter-link-url-input-wrapper::after{content:"";display:block;position:absolute;top:0;bottom:0;width:1rem;z-index:2;opacity:0;transition:opacity .2s ease}.TextFormatter-link-url-input-wrapper::before{left:0;background:linear-gradient(to right, var(--color-background) 0.25rem, transparent 1rem)}.TextFormatter-link-url-input-wrapper::after{right:0;background:linear-gradient(to left, var(--color-background) 0.25rem, transparent 1rem)}.TextFormatter-link-url-input-wrapper.mask-left::before{opacity:1}.TextFormatter-link-url-input-wrapper.mask-right::after{opacity:1}.TextFormatter-link-url-confirm{flex-shrink:0;opacity:0;transition:opacity .3s ease}.TextFormatter-link-url-confirm.shown{opacity:1}.TextFormatter.link-control-shown .TextFormatter-link-control{opacity:1;pointer-events:all}.TextFormatter .Button{width:2rem;height:2rem;padding:.25rem;font-size:1.5rem;margin:0 .125rem;border-radius:var(--border-radius-messages-small);flex-shrink:0;cursor:pointer}.TextFormatter .Button.active{background-color:var(--color-primary) !important;color:#fff}.TextFormatter .Button.disabled{opacity:.5;pointer-events:none} .Picker{height:100%;display:flex;flex-direction:column;overflow:hidden}.Picker .picker-header{padding:0 1rem .25rem .75rem;border-bottom:1px solid var(--color-borders);display:flex;flex-flow:row wrap;flex-shrink:0;overflow-y:auto;max-height:20rem}.Picker .picker-header .input-group{margin-bottom:.5rem;margin-left:.5rem;flex-grow:1}.Picker .picker-header .form-control{height:2rem;border:none;border-radius:0;padding:0;box-shadow:none}.Picker .picker-list{flex-grow:1;overflow-y:auto;overflow-x:hidden;padding:.5rem}@media(max-width: 600px){.Picker .picker-list{padding-left:0 !important;padding-right:0 !important}}.Picker .no-results{height:100%;margin:0;padding:1rem 1rem;display:flex;align-items:center;justify-content:center;color:var(--color-text-secondary)} -/*# sourceMappingURL=484.40f6759b976ebb12ec3f.css.map*/ \ No newline at end of file +/*# sourceMappingURL=484.87953bd73fba4543a4f6.css.map*/ \ No newline at end of file diff --git a/dist/484.40f6759b976ebb12ec3f.css.map b/dist/484.87953bd73fba4543a4f6.css.map similarity index 99% rename from dist/484.40f6759b976ebb12ec3f.css.map rename to dist/484.87953bd73fba4543a4f6.css.map index f59dce70..9cd54630 100644 --- a/dist/484.40f6759b976ebb12ec3f.css.map +++ b/dist/484.87953bd73fba4543a4f6.css.map @@ -1 +1 @@ -{"version":3,"file":"484.40f6759b976ebb12ec3f.css","mappings":"AAAA,YACE,kBAEA,cACE,WACA,YACA,wCACA,gCAEA,oCACE,kBACA,MACA,OAGF,+CACE,wBAKJ,kCACE,2BAQA,sBACE,2BAIA,kCACE,4CAGF,gCAC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E,yBAOJ,8BACE,GACE,6BAEF,KACE,yBAIJ,+BACE,GACE,wBAEF,KACE,+BAIJ,wCACE,GACE,wBAEF,KACE,8BAIJ,yCACE,GACE,8BAEF,KACE,yBAOJ,6BACE,GACE,qBAEF,KACE,oBAIJ,uCACE,GACE,mBAEF,KACE,sBAIJ,wCACE,GACE,sBAEF,KACE,oBAOJ,4BACE,GACE,wBACA,UAEF,KACE,2BACA,iDAIJ,sCACE,GACE,2BACA,gDAEF,KACE,wBACA,WAQJ,oBACE,GACE,mBACA,UAEF,KACE,qBACA,WAIJ,8BACE,GACE,qBACA,UAEF,KACE,mBACA,WAOJ,wBACE,GACE,2BAEF,KACE,yBAIJ,kCACE,GACE,wBAEF,KACE,4BAOJ,qBACE,GACE,gEAEF,KACE,2DAOJ,+BACE,GACE,0DAEF,KACE,iE;AC1pBJ,QACE,mCACA,UACA,mBACA,uBACA,eACA,gBACA,kBACA,wEACA,WACA,iBACA,aACA,mBAEA,wBACE,kBAGF,eACE,WACA,YAGF,UACE,iBAGF,mBACE,WACA,YACA,mBAEA,0BACE,eACA,gBAIJ,kBACE,WACA,YACA,kBAEA,yBACE,cACA,eAIJ,mBACE,eACA,gBACA,kBAEA,0BACE,cACA,eAIJ,oBACE,cACA,eACA,oBAEA,2BACE,WACA,YAIJ,mBACE,oBAEA,qBACE,iBAGF,0BACE,gBACA,iBAIJ,mBACE,aACA,cACA,iBAEA,qBACE,eAGF,0BACE,aACA,cAIJ,eACE,kBAEA,sBACE,WACA,cACA,kBACA,cACA,aACA,cACA,eACA,kBACA,yCACA,yBACA,cAIJ,oBACE,eAGF,wBACE,WACA,Y;AC3HJ,iBACE,kBACA,UACA,eACA,gBACA,qFACA,kBACA,eAEA,0BACE,kCACA,oBAGF,wBACE,sBAEA,+BACE,WACA,kBACA,eACA,gBACA,sBACA,sBACA,SACA,QACA,qCAIJ,gDACE,WACA,YACA,iFAEA,8DACE,sBACA,aACA,cAIJ,yBACE,cACA,eAEA,6BACE,WACA,YACA,eAGF,gCACE,iBAIJ,6BACE,wCAGF,qBACE,cACA,yBACA,yBACA,yDAGF,wBACE,iCAIJ,oCACE,KACE,uBAEF,GACE,0+B;AC9EJ,OACE,kBACA,uBAGE,4IACE,gBAKF,gCACE,gBAKF,4BACE,gBAKF,4BACE,gBAIJ,wBACE,eACA,MACA,SACA,OACA,QACA,aACA,uBACA,mBAGF,uBACE,eACA,MACA,QACA,SACA,OACA,WACA,iCAGF,4CACE,6BAGF,qBACE,kBACA,oBACA,sBACA,WACA,gBACA,kBACA,iBACA,yCACA,8DACA,2CACA,mCAEA,+CAEA,4CACE,gBACA,0BAGF,yBApBF,qBAqBI,yCAIJ,0BACE,+BAGF,6BACE,kCAGF,oDACE,oBACA,aACA,mBACA,cAGF,oBACE,kBACA,gBACA,cACA,gBACA,uBAEA,qCACE,mBAIJ,+BAEE,4CAEA,oDACE,kBACA,eACA,WACA,qBACA,iBACA,qBACA,sBACA,eAIJ,sBACE,WACA,YACA,aACA,gBAEA,qDAEE,sBAIJ,kEAGE,uBACA,mBAGF,uBACE,aACA,qBAEA,qEACE,iBAIJ,8BACE,WACA,YACA,iBACA,iBACA,gBACA,qB;AC3JJ,UACE,kBAGE,oGACE,WACA,kBACA,SACA,YACA,QACA,iBACA,iCAGF,oFACE,cAGF,8EACE,OAMF,oDACE,gBACA,uBAIJ,2BACE,WACA,yCACA,uBACA,2BACA,wBACA,aACA,aACA,kBACA,gBACA,mBACA,mBACA,wBACA,2CACA,mCAEA,6BACE,iBACA,kBACA,kCAIJ,oFACE,mBACA,uBAIA,uCACE,kBACA,WAIJ,mBACE,oBAEA,oCACE,WAKF,0DACE,eAEA,qBACE,gIACE,6CAIJ,yBACE,iEACE,6CAMR,yBAGI,4HACE,yDAKN,yCACE,4CAGF,iBACE,qBAEA,kCACE,mBAIJ,mBACE,oBAGF,gBACE,4CAIA,uCACE,yBAEA,yCACE,cAKN,uBACE,kBAEA,+BACE,WAEA,gDACE,6BACA,8BAKN,8BACE,iBAEA,sFAEE,0DAGF,+CACE,4CAGF,sCACE,cACA,mBAGF,oCACE,YACA,gBAGF,6EACE,gBACA,aACA,2BACA,mBAGF,gKACE,eACA,sBACA,SACA,gBACA,mBACA,uBACA,mBAIA,wCACE,gBAGF,mDACE,cACA,eACA,mBAGF,4CACE,2BACA,wBACA,cAIJ,6FAEE,kBACA,oBACA,kCAGF,wCACE,aACA,mBACA,YACA,gBAEA,uGACE,kBACA,oBACA,kCACA,qBAEA,qHACE,2BAGF,oPAEE,mBACA,WAGF,gTAEE,kBAKN,6PAGE,mBACA,uBAMA,4UAEE,mBAKF,wDACE,4CAGF,+CACE,kBACA,eAGF,qDACE,WAMJ,uCACE,qBAGF,mCACE,cAGF,6EACE,eACA,mBACA,gBACA,mBACA,uBACA,gBAGF,iDACE,iBACA,eAGF,0CACE,kCACA,kBAEA,mEACE,wBACA,mBACA,qBACA,kBAKF,0DACE,cACA,kBAGF,mDACE,eACA,cAKN,2BACE,SAEA,4CACE,eACA,aACA,mBAGF,mCACE,WACA,YAGF,qCACE,cACA,cACA,SACA,kBAIA,8CACE,eACA,mBAKN,0BACE,oBACA,gBAEA,qEACE,cACA,mBAGF,iCACE,oBACA,gBACA,uBAGF,oCACE,kBACA,mBACA,kCAEA,8CACE,oBAGF,0CACE,wBAMJ,sCACE,iBACA,e;AC3XN,cACE,qBACA,cACA,aACA,cACA,yDACA,4BACA,qBACA,gC;ACRF,2BACE,qBACA,oCAGE,WACE,kCACA,0BAIJ,YACE,WACA,gBACA,iCAEA,aACE,uDACA,6FAEA,mCAEE,6BAMR,KACE,2BACE,kCAIJ,KACE,0BACE,E;ACpCJ,wBACE,kBACA,YACA,gBACA,mBACA,8BAEA,0BAPF,wBAQI,8CAGF,sCACE,mBAEA,wDACE,oBAKN,cACE,4FACA,uBACA,2CACA,4CACA,WACA,eAEA,6GAGE,sBACA,0BAGF,uBACE,iBACA,sBACA,+e;ACtCJ,OACE,cACA,kBACA,oBACA,gBACA,qBACA,mBACA,eAEA,gBACE,oBACA,WAGF,qBACE,eAEE,iFACE,kBAKN,aACE,kBACA,uBACA,UAIA,qDACE,WACA,cACA,kBACA,eACA,QACA,cACA,eACA,2BAGF,2BACE,4CACA,kBACA,yCACA,UACA,kDAGF,0BACE,cACA,cACA,eACA,kBACA,gCACA,UACA,4BAGF,0BACE,cACA,sBACA,uBACA,gBAGF,6BACE,cACA,kBACA,iBACA,kCACA,uBAKF,yCACE,kCAGF,wCACE,UAKF,qEAEE,qBAGF,wBACE,kBACA,eACA,QACA,2BACA,UACA,oCACA,wBAIJ,gBACE,eACA,qBAEA,4BACE,iBAEA,oCACE,UACA,gBAGF,mCACE,UACA,eAIJ,iDAEE,iBAGA,iCACA,UACA,gBAKN,mBACE,KACE,UAEF,GACE,W;ACzIJ,KACE,aACA,uBACA,cACA,wCACA,gBACA,WACA,SACA,YACA,uBACA,gBACA,kCACA,eACA,2DACA,4DAEA,4BAGE,aAGF,YACE,eACA,2BAEA,cACE,UAIJ,wBACE,kDAGF,UACE,kBACA,aACA,mBAGF,YACE,kBACA,eACA,0BACA,6BACA,qBACA,mBACA,WACA,kBACA,sBACA,gBACA,kBACA,cAEA,kDAEE,oBAGF,mBACE,gCAIJ,OACE,kBACA,4BACA,OACA,UACA,sCACA,gBACA,WACA,oCACA,oBACA,uBACA,sBAEA,eACE,6CAEA,sCACE,2B;AClFR,SACE,gBACA,MACA,cACA,aACA,8BACA,qBACA,kBACA,iBACA,+CACA,yCACA,gBACA,kBAEA,qBACA,8BAEA,aACE,eACA,kCAGF,4BACE,SAGF,kCACE,+B;AC1BF,+BACE,gBAGF,+BACE,2BAGF,+CACE,oBAGF,gCACE,sBAGF,wCACE,uB;AClBJ,aACE,kBACA,WACA,iDACA,yCACA,yCACA,uBACA,kCAEA,8BACE,aAEA,2CACE,aAGF,oCACE,mBAIA,6CACE,oBACA,eAKN,uBACE,kCACA,iCACA,yCAGE,+BACE,2BAKN,mBACE,cACA,gBACA,uBACA,uBACA,wCACA,2BACA,2JAEA,gCACE,gCAIJ,eACE,kBACA,UACA,YACA,iBAGF,sBACE,kBACA,UACA,YACA,cAEA,+BACE,uBAIJ,qBACE,kBACA,YACA,cACA,eAGF,yBACE,mBACE,cACA,sBACA,kDAGF,eACE,WAKF,4BACE,cAGF,wBACE,UACA,aAGF,+BACE,WACA,WAGF,8BACE,aACA,W;AC5GN,oBACE,aACA,mBACA,mCACA,YACA,eACA,kBACA,oBACA,mBACA,mBACA,eACA,kBACA,gBACA,cACA,sCAEA,6BAEA,8BACE,gBAGF,0BACE,0CAGF,oCACE,oDAEA,iDACE,UAGF,2FACE,UAKF,6CACE,gCAGF,sCACE,mCAGF,2CACE,kBAIJ,iCACE,cACA,kBACA,WACA,eAEA,kCAGF,2DACE,WACA,YACA,UACA,cACA,6BAEA,+DACE,eAIJ,+BACE,aACA,mBACA,uBACA,gBACA,kBACA,sCACA,WAEA,iCACE,kBACA,kBACA,SAIJ,+BACE,kBACA,mBACA,gBACA,uBAEA,kDACE,eACA,gBACA,yBACA,oBAIJ,iCACE,kBACA,OACA,MACA,WACA,YACA,kBACA,aACA,mBACA,uBACA,oCACA,iBACA,WACA,UACA,6BAGF,6BACE,kBACA,gBAEA,uCACE,gBACA,eAGF,0CACE,UACA,gBAGF,wCACE,cACA,mBAGF,0CACE,UACA,Q;AC7IN,UACE,oBACA,mBACA,kBACA,SAEA,mBACE,oBACA,WAGF,mBACE,oBAKA,8JAEE,2BAGF,kGACE,eAIJ,gBACE,SACA,QACA,kBACA,kBACA,uBACA,UAGF,kBACE,eACA,mBACA,eACA,eACA,6BACA,qBACA,oBACA,kBACA,kCAGF,wBACE,WACA,kBACA,cACA,OACA,eACA,gBACA,mCACA,qBACA,wBACA,uCAGF,gCACE,gCAGF,sCACE,2BACA,6CACA,kCAGF,+BACE,c;ACxEJ,uBACE,cACA,eACA,gBACA,qBACA,cACA,oBAEA,yBACE,mCAGF,+CACE,oBAGF,mCACE,WACA,Y;AClBJ,iBACE,mBACA,uBACA,cACA,iBACA,cACA,aACA,mBAEA,wCACE,qCACA,mBACA,kBAEA,oDACE,wBAIJ,uBACE,6BACA,oB;ACrBJ,kBACE,UACA,2DAEA,6BACE,mBACA,UAGF,8BACE,aAGF,0BACE,uDAIJ,eACE,aAEA,sBACE,0BAIJ,OACE,iBACA,cACA,6BACA,qBACA,mBACA,WACA,kBACA,sBACA,gBACA,kBACA,cAEA,qBACE,mBAGF,mBACE,qBACA,mBACA,gBACA,kBAGF,yCACE,8BACA,yBAGF,2BACE,0BACA,uBACA,aACA,UAEA,6BACE,iBAIJ,eACE,aACA,eAEA,iBACE,eACA,qBAGF,2BACE,eACA,eAEA,6BACE,kB;AChFR,MACE,4CAOA,kBACA,MACA,OACA,SACA,WATA,sCAEE,gDASF,sBACE,oBACA,gCAGF,wBACE,sBACA,kCAIA,qFACE,qCAIJ,yBACE,eACE,uDAEA,qCACE,sCAKN,yBACE,oCAEE,wDAEA,gFACE,iDACA,8BAGF,sEACE,wDACA,iCACA,8CACA,sCACA,2CACA,kCACA,mCAGF,sEACE,oCAGF,4EACE,8BACA,gCAKN,yBACE,uBACE,4BAIJ,cACE,cAIA,yCACE,sBAGF,sBACE,qBAGF,eACE,WACA,cAGF,6BACE,kBACA,mBACA,sBACA,cAEA,yCACE,aACA,mBAIJ,6BACE,iBAEA,yCACE,kBACA,eAIJ,qDACE,qBACA,YACA,kCACA,uBAEA,uEACE,gBAGF,+EACE,wBAGF,mEACE,yBAMA,wCACE,aAIJ,iCACE,yBAGF,8BACE,cACA,eACA,iBACA,sBACA,wBACA,yBAEA,0CACE,eACA,gBACA,0BAGF,oCACE,sBAIJ,uCACE,WACA,YACA,yBAGF,qCACE,kBACA,qBACA,iBACA,WACA,6BACA,wBACA,gBAEA,iDACE,8BACA,SAQJ,sCACE,cACA,kBAGF,2DACE,oBACA,gBAGF,sCACE,cACA,oBAGF,uEACE,mBACA,gBACA,iBACA,uB;ACjNR,eACE,qBAEA,mBACE,kBACA,WACA,YAEA,sCACE,qB;ACTN,aACE,WACA,WACA,aACA,mBACA,uBACA,sBAEA,0BARF,aASI,aAGF,sBACE,YACA,uBAGF,oBACE,kBACA,sBAGF,0BACE,kBACA,kCAEA,8EAEE,wCAIJ,0BACE,mBACA,gBACA,4BACA,uBAEA,4BACE,0BACA,iB;ACxCN,cACE,aACA,mBACA,uBACA,6BAEA,+BACE,sBAGF,+BACE,cAGF,2BACE,kCACA,kBACA,kBACA,gBACA,uB;ACnBJ,OACE,SACA,oBACA,gBACA,kBACA,eAEA,uBACE,kBACA,YACA,WACA,2BACA,WACA,iBACA,mBACA,uBACA,qBAGF,WACE,kBACA,OACA,MACA,WACA,YACA,iB;ACzBJ,SACE,gBACA,2BACA,kBACA,qBACA,kBAEA,kBACE,kBAGF,+BACE,2BACA,WACA,YACA,kBACA,OACA,MACA,yDACA,WACA,aACA,mBACA,uBACA,kDACA,yBACA,gBACA,iBAGF,gBACE,kBACA,OACA,MACA,WACA,YACA,0BACA,gCACA,6DAGF,oEAGE,sBACA,mBAGF,oBACE,cACA,yBACA,gBACA,mBACA,gBACA,uBAGF,qBACE,eACA,gBACA,uBACA,sBAGF,iDAEE,gBACA,kCACA,qBACA,mBACA,oBACA,qBACA,4BACA,gBAGF,sBACE,kBAGF,kCACE,sBACA,uBAGF,kBACE,2BAEA,iEAEE,UACA,QAGF,2BACE,iB;AC9FN,oDACE,aAaA,mBACA,oBAZA,0CACE,sBAGF,eACE,0BACA,qBAFF,eAGI,6BAOJ,iBACE,2DAGF,cAGE,gBACA,yBACA,kDACA,gCACA,aACA,mBACA,uBACA,sBAGF,iBACE,MACA,OACA,kBAGF,yBACE,qBACA,cACA,kBACA,WACA,4BAEA,cACE,gBACA,wBACA,yBAGF,UACE,cACA,kBACA,MACA,QACA,iCACA,2BACA,qFACA,mCACA,mBACA,qCACA,qBAIJ,sBACE,gBACA,qEAEA,yBAEE,kDACA,yBAGF,gBACE,oBAIJ,UACE,iBACA,kBACA,MACA,QACA,eACA,gBACA,aACA,mBACA,uBACA,UACA,wBACA,wCAGF,cACE,gEAGE,cACE,2DAGF,SACE,kEAEA,SACE,wDAIJ,SACE,kBAKN,mBACE,qBACA,mBACA,gBACA,YACA,wBAEA,gBACE,kCACA,kBACA,mBACA,mBAIJ,cACE,mBACA,gBACA,gBACA,uBACA,0BAEA,mBACE,sBAIJ,iBACE,qBACA,6BACA,eACA,gBACA,uBACA,wCAGE,aACE,eAKN,2CACE,yCACA,8GAEA,UAIE,YACA,0BAGF,sBACE,iCAEA,0BACE,0BAIJ,oBACE,2BAGF,eACE,8BAGF,gBACE,2KAMF,kBAGE,eACA,qDAGF,gBACE,iEAEA,cACE,mBACA,yDAIJ,SACE,QACA,+CAQJ,mCACE,qDAGF,qCACE,mDAGF,wCACE,C;ACxOJ,OACE,aACA,uBAEA,mBACE,iBAGF,WACE,4CACA,oDACA,qEACA,qEAEA,uBACE,sCACA,uCAGF,mBACE,yCACA,0CACA,wDACA,2CAEA,+BACE,4BACA,mCAKN,oBACE,wBAEA,4BACE,WACA,YACA,yBAEA,8BACE,mBACA,qBAIJ,sBACE,kBAEA,gCACE,oBACA,yBAFF,gCAGI,sBAKN,+DACE,UACA,mBACA,uEAGF,yJAIE,UACA,qBAIJ,sBACE,oBAEA,mCACE,oBAIJ,wBACE,kBACA,0BACA,2BACA,UACA,YACA,WACA,6CACA,UAEA,0BACE,mBAIJ,+BACE,UACA,SACA,6CAGF,gBACE,kBACA,YACA,YACA,mBAGF,oBACE,aACA,8BAGF,cACE,gBACA,SACA,iBACA,gBACA,uBAGF,uBACE,kBACA,kBACA,kCAEA,4BACE,mBACA,iBACA,oBACA,sBAIJ,sCACE,2BAGF,iBACE,eACA,gBAGF,4CAGE,kBACA,cACA,kCACA,SAGF,iBACE,oBACA,kBACA,kCACA,mBACA,gBACA,uBAGF,iBACE,uBACA,iBACA,uBACA,YACA,kBACA,iBACA,QACA,eAEA,yBACE,WACA,kBACA,WACA,SACA,QACA,WACA,mDACA,kBAIJ,kEACE,kBACA,WACA,kBACA,gBACA,WACA,QACA,SAEA,sEACE,kBACA,WACA,iDACA,WACA,kBACA,WAIJ,qCACE,8DAGF,uBACE,kBACA,WACA,QACA,OAEA,yBACE,oBACA,kBACA,WACA,WAEA,gCACE,WACA,kBACA,SACA,YACA,WACA,YACA,kBACA,2CAMJ,uBACE,oBAGF,qBACE,mBACA,gBACA,uBACA,gBACA,mBAGF,iEAGE,sBAGF,wBACE,QACA,oBAGF,wBACE,iBAGF,6BACE,aACA,cAIA,sCACE,qBACA,QAKN,mCACE,cACA,eAIA,6BACE,kBACA,eAEA,qCACE,mBACA,eAIJ,mDAEE,iBAGF,iCACE,UACA,a;ACvSN,cACE,WACA,YACA,eACA,kBAEA,8BACE,WACA,iBAGF,iCACE,kBACA,OACA,MACA,WAGF,+BACE,WACA,YAGF,iHAIE,aACA,mBACA,uBACA,yBACA,wEACA,eAGF,uBACE,gBAGF,2DAEE,gB;ACzCJ,aACE,iBACA,kBAEA,kCACE,qBACE,WACA,iBACA,WAGF,oBACE,cACA,WACA,YAIJ,4BACE,WACA,kBACA,OACA,MACA,SAEA,wCACE,WACA,YAIJ,2BACE,kBACA,WACA,eACA,kBACA,UAEA,aACA,UACA,OAGF,yBACE,cACA,oCACA,WACA,sBACA,iBAEA,iCACE,UAIJ,yBACE,kBACA,MACA,SACA,UACA,YACA,UACA,SACA,wCACA,iCACA,wBACA,YACA,wBACA,aACA,eACA,UAEA,sEACE,UAGF,8BACE,OACA,yDACA,gCAGF,8BACE,QACA,yDACA,6CAIJ,mBACE,kBACA,SACA,OACA,WACA,iBACA,uBACA,+EACA,yBACA,aACA,sBACA,yBACA,oBAGE,oCACE,iBACA,uBAKF,oCACE,iBACA,uBAKN,oBACE,aACA,mBAEA,uBACE,gBACA,kBACA,qBACA,qBACA,sBACA,qBAGF,kCACE,mBACA,qBAGF,2BACE,aACA,cACA,uBAIJ,qBACE,kBACA,WAIA,uCACE,UACA,QACA,qBAGF,uCACE,OACA,WACA,qBAIJ,kBACE,wBACA,gBAEA,wBACE,SAGF,qCACE,UAGF,wBACE,sBAGF,0BACE,+C;ACnLN,YACE,2CACA,mCACA,gBACA,cACA,WACA,mBACA,iBACA,kBACA,uBACA,aACA,cACA,iDAEA,0BAdF,YAeI,gBAGF,oCACE,2BACA,mDAGF,wBACE,oBAGF,uBACE,gBAGF,4BACE,oBACA,2CACA,oBACA,cACA,aACA,sBACA,mBACA,uBACA,oCAGF,kBACE,kBACA,sBACA,sBAEA,0BALF,kBAMI,kBACA,mBACA,oBAGF,0BAXF,kBAYI,eACA,iBACA,oBACA,mBAIJ,mBACE,oBACA,gBACA,uBAEA,0BALF,mBAMI,gBAIJ,yBACE,eACA,oBAEA,0BAJF,yBAKI,mB;AC7EN,sBACE,kBACA,WACA,YACA,2BACA,4DAEA,6CACE,2BAGF,+BACE,wB;ACZJ,UACE,kBACA,MACA,QACA,OACA,aACA,2BACA,uBAEA,aACA,sBAEA,kCACE,iD;ACbJ,eACE,qBACA,WACA,YACA,aACA,kDACA,wCACA,wBACA,eACA,kEACA,kBAEA,yBAZF,eAaI,eAGF,0BACE,yBACA,eACA,eAGF,qBACE,YACA,aACA,SAGF,mDACE,kBACA,MACA,OACA,WACA,YAGF,mBACE,mBAGF,sCACE,kBACA,YACA,cACA,cACA,eACA,gBAMA,UAJA,wCACE,eAMJ,qBACE,wDAEA,4CACE,U;AC3DN,eACE,oCAEA,2CACE,kBACA,mCACA,4CACA,sBACA,iDAGF,4BACE,OACA,MACA,UACA,oBACA,4BAEA,mCACE,eAGF,yBAXF,4BAYI,2DAGF,kCACE,uBACA,wBACA,WACA,wBACA,yCAIJ,uDACE,aACA,iBACA,mBAGF,uBACE,UACA,eACA,gBACA,sCAGF,sCACE,YACA,kBACA,eAEA,yBALF,sCAMI,gBAGF,2FACE,WACA,cACA,kBACA,MACA,SACA,WACA,UACA,UACA,4BAGF,8CACE,OACA,wFAGF,6CACE,QACA,uFAIA,wDACE,UAKF,wDACE,UAKN,gCACE,cACA,UACA,4BAEA,sCACE,UAKF,8DACE,UACA,mBAIJ,uBACE,WACA,YACA,eACA,iBACA,iBACA,kDACA,cACA,eAEA,8BACE,iDACA,WAGF,gCACE,WACA,oB;AC9HN,QACE,YACA,aACA,sBACA,gBAEA,uBACE,6BACA,6CACA,aACA,mBACA,cAEA,gBACA,iBAEA,oCACE,oBACA,kBACA,YAGF,qCACE,YACA,YACA,gBACA,UACA,gBAIJ,qBACE,YACA,gBACA,kBACA,cAEA,yBANF,qBAOI,0BACA,4BAIJ,oBACE,YACA,SACA,kBACA,aACA,mBACA,uBACA,kC","sources":["webpack://telegram-t/./src/components/ui/Transition.scss","webpack://telegram-t/./src/components/common/Avatar.scss","webpack://telegram-t/./src/components/ui/ProgressSpinner.scss","webpack://telegram-t/./src/components/ui/Modal.scss","webpack://telegram-t/./src/components/ui/ListItem.scss","webpack://telegram-t/./src/components/common/VerifiedIcon.scss","webpack://telegram-t/./src/components/common/TypingStatus.scss","webpack://telegram-t/./src/components/ui/Notification.scss","webpack://telegram-t/./src/components/ui/Radio.scss","webpack://telegram-t/./src/components/ui/Tab.scss","webpack://telegram-t/./src/components/ui/TabList.scss","webpack://telegram-t/./src/components/common/DeleteChatModal.scss","webpack://telegram-t/./src/components/ui/SearchInput.scss","webpack://telegram-t/./src/components/common/PickerSelectedItem.scss","webpack://telegram-t/./src/components/ui/Switcher.scss","webpack://telegram-t/./src/components/common/MessageOutgoingStatus.scss","webpack://telegram-t/./src/components/common/LastMessageMeta.scss","webpack://telegram-t/./src/components/left/main/Badge.scss","webpack://telegram-t/./src/components/left/main/Chat.scss","webpack://telegram-t/./src/components/common/AnimatedEmoji.scss","webpack://telegram-t/./src/components/left/main/EmptyFolder.scss","webpack://telegram-t/./src/components/common/NothingFound.scss","webpack://telegram-t/./src/components/common/Media.scss","webpack://telegram-t/./src/components/common/WebLink.scss","webpack://telegram-t/./src/components/common/File.scss","webpack://telegram-t/./src/components/common/Audio.scss","webpack://telegram-t/./src/components/common/ProfilePhoto.scss","webpack://telegram-t/./src/components/common/ProfileInfo.scss","webpack://telegram-t/./src/components/middle/composer/DropTarget.scss","webpack://telegram-t/./src/components/ui/FloatingActionButton.scss","webpack://telegram-t/./src/components/middle/composer/DropArea.scss","webpack://telegram-t/./src/components/common/StickerButton.scss","webpack://telegram-t/./src/components/middle/composer/TextFormatter.scss","webpack://telegram-t/./src/components/common/Picker.scss"],"sourcesContent":[".Transition {\n position: relative;\n\n > * {\n width: 100%;\n height: 100%;\n animation-fill-mode: forwards !important;\n transition: background-color .2s;\n\n &.from, &.to {\n position: absolute;\n top: 0;\n left: 0;\n }\n\n &:not(.active):not(.from):not(.to) {\n display: none !important; // Best performance when animating container\n //transform: scale(0); // Shortest initial delay\n }\n }\n\n &.skip-slide-transition {\n transition: none !important;\n }\n\n /*\n * slide\n */\n\n &.slide {\n > .to {\n transform: translateX(100%);\n }\n\n &.animating {\n > .from {\n animation: slide-out var(--slide-transition);\n }\n\n > .to {\n animation: slide-in var(--slide-transition);\n }\n }\n }\n\n &.slide.backwards {\n > .to {\n transform: translateX(-100%);\n }\n\n &.animating {\n > .from {\n animation: slide-in-backwards var(--slide-transition);\n }\n\n > .to {\n animation: slide-out-backwards var(--slide-transition);\n }\n }\n }\n\n\n &.slide-reversed {\n > .to {\n transform: translateX(-100%);\n }\n\n &.animating {\n > .from {\n animation: slide-out var(--slide-transition);\n }\n\n > .to {\n animation: slide-in var(--slide-transition);\n }\n }\n\n &.backwards {\n > .to {\n transform: translateX(100%);\n }\n\n &.animating {\n > .from {\n animation: slide-in-backwards var(--slide-transition);\n }\n\n > .to {\n animation: slide-out-backwards var(--slide-transition);\n }\n }\n }\n }\n\n /*\n * mv-slide\n */\n\n &.mv-slide {\n > * > div {\n animation-fill-mode: forwards !important;\n }\n\n > .to > div {\n transform: translateX(100vw);\n }\n\n &.animating {\n > .from > div {\n animation: mv-slide-out .4s ease;\n }\n\n > .to > div {\n animation: mv-slide-in .4s ease;\n }\n }\n }\n\n &.mv-slide.backwards {\n > .to > div {\n transform: translateX(-100vw);\n }\n\n &.animating {\n > .from > div {\n animation: mv-slide-in-backwards .4s ease;\n }\n\n > .to > div {\n animation: mv-slide-out-backwards .4s ease;\n }\n }\n }\n\n /*\n * slide-fade\n */\n &.slide-fade {\n > .from {\n transform-origin: left;\n transform: translateX(0);\n opacity: 1;\n }\n\n > .to {\n transform-origin: left;\n transform: translateX(1.5rem);\n opacity: 0;\n }\n\n &.animating {\n > .from {\n animation: fade-out-opacity var(--slide-transition), slide-fade-out-move var(--slide-transition);\n }\n\n > .to {\n animation: fade-in-opacity var(--slide-transition), slide-fade-in-move var(--slide-transition);\n }\n }\n }\n\n &.slide-fade.backwards {\n > .from {\n transform: translateX(0);\n opacity: 1;\n }\n\n > .to {\n transform: translateX(-1.5rem);\n opacity: 0;\n }\n\n &.animating {\n > .from {\n animation: fade-in-backwards-opacity var(--slide-transition), slide-fade-in-backwards-move var(--slide-transition);\n }\n\n > .to {\n animation: fade-out-backwards-opacity var(--slide-transition), slide-fade-out-backwards-move var(--slide-transition);\n }\n }\n }\n\n /*\n * zoom-fade\n */\n &.zoom-fade {\n > .from {\n transform-origin: center;\n transform: scale(1);\n opacity: 1;\n }\n\n > .to {\n transform-origin: center;\n opacity: 0;\n // We can omit `transform: scale(1.1);` here because `opacity` is 0.\n // We need to for proper position calculation in `InfiniteScroll`.\n }\n\n &.animating {\n > .from {\n animation: fade-out-opacity .15s ease;\n }\n\n > .to {\n animation: fade-in-opacity .15s ease, zoom-fade-in-move .15s ease;\n }\n }\n }\n\n &.zoom-fade.backwards {\n > .from {\n transform: scale(1);\n }\n\n > .to {\n transform: scale(0.95);\n }\n\n &.animating {\n > .from {\n animation: fade-in-backwards-opacity .1s ease, zoom-fade-in-backwards-move .15s ease;\n }\n\n > .to {\n animation: fade-out-backwards-opacity .15s ease, zoom-fade-out-backwards-move .15s ease;\n }\n }\n }\n\n /*\n * fade\n */\n &.fade {\n > .from {\n opacity: 1;\n }\n\n > .to {\n opacity: 0;\n }\n\n &.animating {\n > .from {\n animation: fade-out-opacity .15s ease;\n }\n\n > .to {\n animation: fade-in-opacity .15s ease;\n }\n }\n }\n\n /*\n * slide-layers\n */\n\n &.slide-layers {\n --background-color: var(--color-background);\n background: black;\n\n > div {\n background: var(--background-color);\n }\n\n > .to {\n transform: translateX(100%);\n }\n\n &.animating {\n > .from {\n animation: slide-layers-out var(--layer-transition);\n }\n\n > .to {\n animation: slide-in var(--layer-transition);\n }\n }\n }\n\n &.slide-layers.backwards {\n > .to {\n transform: translateX(-20%);\n opacity: 0.75;\n }\n\n &.animating {\n > .from {\n animation: slide-in-backwards var(--layer-transition);\n }\n\n > .to {\n animation: slide-layers-out-backwards var(--layer-transition);\n }\n }\n }\n\n /*\n * push-slide\n */\n\n &.push-slide {\n > div {\n background: var(--color-background);\n }\n\n > .from {\n transform-origin: center;\n transform: scale(1);\n opacity: 1;\n\n .custom-scroll {\n scrollbar-color: transparent !important;\n\n &::-webkit-scrollbar-thumb {\n background-color: transparent !important;\n }\n }\n }\n\n > .to {\n transform: translateX(100%);\n }\n\n &.animating {\n > .from {\n animation: push-out .3s ease-in-out;\n }\n\n > .to {\n animation: slide-in-200 .3s ease-in-out;\n }\n }\n }\n\n &.push-slide.backwards {\n > .to {\n transform: scale(0.7);\n }\n\n &.animating {\n > .from {\n animation: slide-in-200-backwards .3s ease-in-out;\n }\n\n > .to {\n animation: push-out-backwards .3s ease-in-out;\n }\n }\n }\n\n /*\n * slide-fade\n */\n &.reveal {\n > .to {\n clip-path: inset(0 100% 0 0);\n }\n\n &.animating {\n > .to {\n animation: reveal-in 350ms ease-in;\n }\n }\n }\n\n &.reveal.backwards {\n > .from {\n clip-path: inset(0 0 0 0);\n }\n\n > .to {\n clip-path: none;\n }\n\n &.animating {\n > .from {\n animation: reveal-in-backwards 350ms ease-out;\n }\n\n > .to {\n animation: none;\n }\n }\n }\n}\n\n/*\n * common\n */\n@keyframes fade-in-opacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes fade-out-opacity {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n\n@keyframes fade-in-backwards-opacity {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n\n@keyframes fade-out-backwards-opacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n/*\n * slide\n */\n@keyframes slide-in {\n 0% {\n transform: translateX(100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes slide-out {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-100%);\n }\n}\n\n@keyframes slide-in-backwards {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(100%);\n }\n}\n\n@keyframes slide-out-backwards {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n/*\n * mv-slide\n */\n@keyframes mv-slide-in {\n 0% {\n transform: translateX(100vw);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes mv-slide-out {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-100vw);\n }\n}\n\n@keyframes mv-slide-in-backwards {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(100vw);\n }\n}\n\n@keyframes mv-slide-out-backwards {\n 0% {\n transform: translateX(-100vw);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n/*\n * slide-fade\n */\n@keyframes slide-fade-in-move {\n 0% {\n transform: translateX(1.5rem);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes slide-fade-out-move {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-1.5rem);\n }\n}\n\n@keyframes slide-fade-in-backwards-move {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(1.5rem);\n }\n}\n\n@keyframes slide-fade-out-backwards-move {\n 0% {\n transform: translateX(-1.5rem);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n/*\n * zoom-fade\n */\n@keyframes zoom-fade-in-move {\n 0% {\n transform: scale(1.1);\n }\n 100% {\n transform: scale(1);\n }\n}\n\n@keyframes zoom-fade-in-backwards-move {\n 0% {\n transform: scale(1);\n }\n 100% {\n transform: scale(1.1);\n }\n}\n\n@keyframes zoom-fade-out-backwards-move {\n 0% {\n transform: scale(0.95);\n }\n 100% {\n transform: scale(1);\n }\n}\n\n/*\n * slide-layers\n */\n@keyframes slide-layers-out {\n 0% {\n transform: translateX(0);\n opacity: 1;\n }\n 100% {\n transform: translateX(-20%);\n opacity: calc(1 - var(--layer-blackout-opacity));\n }\n}\n\n@keyframes slide-layers-out-backwards {\n 0% {\n transform: translateX(-20%);\n opacity: calc(1 - var(--layer-blackout-opacity));\n }\n 100% {\n transform: translateX(0);\n opacity: 1;\n }\n}\n\n/*\n * push-slide\n */\n\n@keyframes push-out {\n 0% {\n transform: scale(1);\n opacity: 1;\n }\n 100% {\n transform: scale(0.7);\n opacity: 0;\n }\n}\n\n@keyframes push-out-backwards {\n 0% {\n transform: scale(0.7);\n opacity: 0;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n}\n\n/*\n * slide\n */\n@keyframes slide-in-200 {\n 0% {\n transform: translateX(200%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes slide-in-200-backwards {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(200%);\n }\n}\n\n/*\n * slide\n */\n@keyframes reveal-in {\n 0% {\n clip-path: inset(0 100% 0 0);\n }\n 100% {\n clip-path: inset(0 0 0 0);\n }\n}\n\n/*\n * slide\n */\n@keyframes reveal-in-backwards {\n 0% {\n clip-path: inset(0 0 0 0);\n }\n 100% {\n clip-path: inset(0 100% 0 0);\n }\n}\n",".Avatar {\n --color-user: var(--color-primary);\n flex: none;\n align-items: center;\n justify-content: center;\n width: 3.375rem;\n height: 3.375rem;\n border-radius: 50%;\n background: linear-gradient(var(--color-white) -125%, var(--color-user));\n color: white;\n font-weight: bold;\n display: flex;\n white-space: nowrap;\n\n img:not(.emoji) {\n border-radius: 50%;\n }\n\n .emoji {\n width: 1rem;\n height: 1rem;\n }\n\n i {\n font-size: 2.5rem;\n }\n\n &.size-micro {\n width: 1rem;\n height: 1rem;\n font-size: 0.5125rem;\n\n .emoji {\n width: .5625rem;\n height: .5625rem;\n }\n }\n\n &.size-tiny {\n width: 2rem;\n height: 2rem;\n font-size: .875rem;\n\n .emoji {\n width: .875rem;\n height: .875rem;\n }\n }\n\n &.size-small {\n width: 2.125rem;\n height: 2.125rem;\n font-size: 0.875rem;\n\n .emoji {\n width: .875rem;\n height: .875rem;\n }\n }\n\n &.size-medium {\n width: 2.75rem;\n height: 2.75rem;\n font-size: 1.1875rem;\n\n .emoji {\n width: 1rem;\n height: 1rem;\n }\n }\n\n &.size-large {\n font-size: 1.3125rem;\n\n i {\n font-size: 3.5rem;\n }\n\n .emoji {\n width: 1.3125rem;\n height: 1.3125rem;\n }\n }\n\n &.size-jumbo {\n width: 7.5rem;\n height: 7.5rem;\n font-size: 3.5rem;\n\n i {\n font-size: 6rem;\n }\n\n .emoji {\n width: 3.5rem;\n height: 3.5rem;\n }\n }\n\n &.online {\n position: relative;\n\n &::after {\n content: '';\n display: block;\n position: absolute;\n bottom: 0.05rem;\n right: 0.05rem;\n width: 0.875rem;\n height: 0.875rem;\n border-radius: 50%;\n border: 2px solid var(--color-background);\n background-color: #0ac630;\n flex-shrink: 0;\n }\n }\n\n &.interactive {\n cursor: pointer;\n }\n\n img:not(.emoji) {\n width: 100%;\n height: 100%;\n }\n}\n",".ProgressSpinner {\n position: relative;\n z-index: 1;\n width: 3.375rem;\n height: 3.375rem;\n background: rgba(0, 0, 0, .25) url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkiIGhlaWdodD0iMTkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjcxNyA5Ljc1TDE4LjMgMi4xNjdhLjY4NC42ODQgMCAxMC0uOTY3LS45NjdMOS43NSA4Ljc4MyAyLjE2NyAxLjJhLjY4NC42ODQgMCAxMC0uOTY3Ljk2N0w4Ljc4MyA5Ljc1IDEuMiAxNy4zMzNhLjY4NC42ODQgMCAxMC45NjcuOTY3bDcuNTgzLTcuNTgzIDcuNTgzIDcuNTgzYS42ODEuNjgxIDAgMDAuOTY3IDAgLjY4NC42ODQgMCAwMDAtLjk2N0wxMC43MTcgOS43NXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjRkZGIiBzdHJva2Utd2lkdGg9Ii43NSIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==) no-repeat 49% 49%;\n border-radius: 50%;\n cursor: pointer;\n\n &.no-cross {\n background: transparent !important;\n pointer-events: none;\n }\n\n &.square {\n background-image: none;\n\n &::after {\n content: '';\n position: absolute;\n width: .8125rem;\n height: .8125rem;\n border-radius: .125rem;\n background-color: #fff;\n left: 50%;\n top: 50%;\n transform: translate3d(-50%, -50%, 0);\n }\n }\n\n &.size-s, &.size-m {\n width: auto;\n height: auto;\n background: transparent url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTguMjE4IDcuNWw1LjYzMy01LjYzM2EuNTA4LjUwOCAwIDEwLS43MTgtLjcxOEw3LjUgNi43ODIgMS44NjcgMS4xNDlhLjUwOC41MDggMCAxMC0uNzE4LjcxOEw2Ljc4MiA3LjVsLTUuNjMzIDUuNjMzYS41MDguNTA4IDAgMTAuNzE4LjcxOEw3LjUgOC4yMThsNS42MzMgNS42MzNhLjUwNi41MDYgMCAwMC43MTggMCAuNTA4LjUwOCAwIDAwMC0uNzE4TDguMjE4IDcuNXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjRkZGIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+) no-repeat 49% 49%;\n\n &.square {\n background-image: none;\n width: .75rem;\n height: .75rem;\n }\n }\n\n &.size-xl {\n width: 3.25rem;\n height: 3.25rem;\n\n svg {\n width: 3rem;\n height: 3rem;\n margin: .125rem;\n }\n\n circle {\n stroke-width: 3px;\n }\n }\n\n &.transparent {\n background-color: transparent !important;\n }\n\n svg {\n display: block;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n animation: 4s linear 0s infinite ProgressSpinnerAnimation;\n }\n\n circle {\n transition: stroke-dashoffset .5s;\n }\n}\n\n@keyframes ProgressSpinnerAnimation {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n",".Modal {\n position: relative;\n z-index: var(--z-modal);\n\n &.delete, &.error, &.confirm, &.pin, &.unpin-all {\n .modal-dialog {\n max-width: 23rem;\n }\n }\n\n &.error {\n .modal-content > div {\n margin-top: 1rem;\n }\n }\n\n &.narrow {\n .modal-dialog {\n max-width: 20rem;\n }\n }\n\n &.report {\n .modal-dialog {\n max-width: 15rem;\n }\n }\n\n .modal-container {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .modal-backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n background-color: rgba(0, 0, 0, .25);\n }\n\n &.transparent-backdrop .modal-backdrop {\n background-color: transparent;\n }\n\n .modal-dialog {\n position: relative;\n display: inline-flex;\n flex-direction: column;\n width: 100%;\n max-width: 35rem;\n min-width: 17.5rem;\n margin: 2rem auto;\n background-color: var(--color-background);\n box-shadow: 0 .25rem .5rem .125rem var(--color-default-shadow);\n border-radius: var(--border-radius-default);\n transform: translate3d(0, -1rem, 0);\n\n transition: transform .2s ease, opacity .2s ease;\n\n body.animation-level-0 & {\n transition: none;\n transform: none !important;\n }\n\n @media (max-width: 450px) {\n max-width: calc(100vw - 3rem) !important;\n }\n }\n\n &.open .modal-dialog {\n transform: translate3d(0, 0, 0);\n }\n\n &.closing .modal-dialog {\n transform: translate3d(0, 1rem, 0);\n }\n\n .modal-header {\n padding: 1rem 1rem 0;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .modal-title {\n font-size: 1.25rem;\n font-weight: 500;\n flex: 1 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &:not(:only-child) {\n margin: 0 1.3125rem;\n }\n }\n\n .modal-header-condensed {\n @extend .modal-header;\n padding: .5rem 1.25rem 0 .9375rem !important;\n\n .modal-action-button {\n font-size: 0.875rem;\n height: 2.25rem;\n width: auto;\n line-height: 1.625rem;\n margin-left: auto;\n padding-left: 1.25rem;\n padding-right: 1.25rem;\n min-width: 5rem;\n }\n }\n\n .modal-content {\n width: 100%;\n flex-grow: 1;\n padding: 1rem;\n overflow-y: auto;\n\n b,\n strong {\n word-break: break-word;\n }\n }\n\n .modal-title,\n .modal-content,\n .modal-content > p {\n unicode-bidi: plaintext;\n text-align: initial;\n }\n\n .dialog-buttons {\n display: flex;\n align-items: flex-end;\n\n .confirm-dialog-button + .confirm-dialog-button {\n margin-left: 1rem;\n }\n }\n\n .confirm-dialog-button {\n width: auto;\n height: auto;\n margin-left: auto;\n text-align: right;\n font-weight: 500;\n white-space: pre-wrap;\n }\n}\n",".ListItem {\n position: relative;\n\n body.is-ios &, body.is-android & {\n &:not(:last-of-type)::after {\n content: \"\";\n position: absolute;\n bottom: 0;\n left: 4.5rem;\n right: 0;\n height: 0.03125rem;\n background: var(--color-dividers);\n }\n\n &.small-icon::after {\n left: 3.875rem;\n }\n\n &.no-icon::after {\n left: 0;\n }\n }\n\n // Using half-pixel height is efficient on iOS but not supported on Android, so `transform` is used instead\n body.is-android & {\n &:not(:last-of-type)::after {\n height: 0.0625rem;\n transform: scaleY(0.25);\n }\n }\n\n .ListItem-button {\n width: 100%;\n background-color: var(--background-color);\n border: none !important;\n box-shadow: none !important;\n outline: none !important;\n display: flex;\n padding: 1rem;\n position: relative;\n overflow: hidden;\n line-height: 1.5rem;\n white-space: nowrap;\n color: var(--color-text);\n border-radius: var(--border-radius-default);\n --ripple-color: rgba(0, 0, 0, .08);\n\n > i {\n font-size: 1.5rem;\n margin-right: 2rem;\n color: var(--color-text-secondary);\n }\n }\n\n .user-status, .group-status, .title, .subtitle {\n text-align: initial;\n unicode-bidi: plaintext;\n }\n\n &.multiline {\n .ListItem-button > i {\n position: relative;\n top: .25rem;\n }\n }\n\n &.disabled {\n pointer-events: none;\n\n .ListItem-button {\n opacity: 0.5;\n }\n }\n\n &:not(.disabled):not(.is-static) {\n .ListItem-button {\n cursor: pointer;\n\n @media (hover: hover) {\n &:hover, &:focus {\n --background-color: var(--color-chat-hover);\n }\n }\n\n @media (max-width: 600px) {\n &.active {\n --background-color: var(--color-chat-hover);\n }\n }\n }\n }\n\n @media (min-width: 600px) {\n &:not(.has-ripple):not(.is-static),\n body.animation-level-0 & {\n .ListItem-button:active {\n --background-color: var(--color-item-active) !important;\n }\n }\n }\n\n &.has-menu-open .ListItem-button {\n --background-color: var(--color-chat-hover);\n }\n\n &.narrow {\n margin-bottom: 0.75rem;\n\n .ListItem-button {\n padding: 0.5rem 1rem;\n }\n }\n\n &.inactive {\n pointer-events: none;\n }\n\n &.focus {\n --background-color: var(--color-chat-hover);\n }\n\n &.destructive {\n .ListItem-button {\n color: var(--color-error);\n\n i {\n color: inherit;\n }\n }\n }\n\n &-context-menu {\n position: absolute;\n\n .bubble {\n width: auto;\n\n .MenuItem button {\n padding-left: 1rem !important;\n padding-right: 2rem !important;\n }\n }\n }\n\n &.chat-item-clickable {\n margin: 0 -0.5rem;\n\n body.is-ios &,\n body.is-macos & {\n --color-text-secondary: var(--color-text-secondary-apple);\n }\n\n .ListItem-button {\n padding: .5625rem .6975rem .5625rem .5625rem;\n }\n\n .Avatar {\n flex-shrink: 0;\n margin-right: 0.5rem;\n }\n\n .info {\n flex-grow: 1;\n overflow: hidden;\n }\n\n .title, .subtitle {\n overflow: hidden;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n }\n\n h3, .last-message, .status, .typing-status {\n font-size: 1rem;\n line-height: 1.6875rem;\n margin: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-align: initial;\n }\n\n .title {\n h3 {\n font-weight: 500;\n }\n\n .VerifiedIcon {\n width: 1.25rem;\n height: 1.25rem;\n margin-left: 0.25rem;\n }\n\n .emoji {\n vertical-align: text-bottom;\n background-position: 0 0;\n flex-shrink: 0;\n }\n }\n\n .contact-phone,\n .contact-username {\n font-size: 0.875rem;\n line-height: 1.25rem;\n color: var(--color-text-secondary);\n }\n\n .ChatInfo {\n display: flex;\n align-items: center;\n flex-grow: 1;\n overflow: hidden;\n\n .status, .typing-status {\n font-size: 0.875rem;\n line-height: 1.25rem;\n color: var(--color-text-secondary);\n display: inline-block;\n\n &.online {\n color: var(--color-primary);\n }\n\n &[dir=rtl],\n &[dir=auto] {\n text-align: initial;\n width: 100%;\n }\n\n .group-status:only-child,\n .user-status:only-child {\n display: flow-root;\n }\n }\n }\n\n .contact-phone,\n .contact-username,\n h3, .last-message, .status, .typing-status {\n text-align: initial;\n unicode-bidi: plaintext;\n }\n\n .last-message,\n .status,\n .typing-status {\n body.is-ios &,\n body.is-macos & {\n font-size: .9375rem;\n }\n }\n\n &[dir=rtl] {\n .ListItem-button {\n padding: .5625rem .5625rem .5625rem .6975rem;\n }\n\n .Avatar {\n margin-left: 0.5rem;\n margin-right: 0;\n }\n\n .info > .status {\n width: 100%;\n }\n }\n }\n\n &.search-result-message {\n .title {\n padding-right: .15rem;\n }\n\n h3 {\n max-width: 80%;\n }\n\n h3, .subtitle {\n font-size: 1rem;\n line-height: 1.5rem;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-align: left;\n }\n\n .LastMessageMeta {\n margin-left: auto;\n margin-right: 0;\n }\n\n .subtitle {\n color: var(--color-text-secondary);\n margin-right: 2rem;\n\n .matching-text-highlight {\n color: var(--color-text);\n background: #CAE3F7;\n border-radius: 0.25rem;\n padding: 0 0.125rem;\n }\n }\n\n &[dir=rtl] {\n .LastMessageMeta {\n margin-left: 0;\n margin-right: auto;\n }\n\n .subtitle {\n margin-right: 0;\n display: block;\n }\n }\n }\n\n &.picker-list-item {\n margin: 0;\n\n .ListItem-button {\n padding-left: 0;\n display: flex;\n align-items: center;\n }\n\n .Avatar {\n width: 3rem;\n height: 3rem;\n }\n\n .Checkbox {\n flex-shrink: 0;\n height: 1.5rem;\n margin: 0;\n padding-left: 4rem;\n }\n\n &[dir=rtl] {\n .Checkbox {\n padding-left: 0;\n padding-right: 4rem;\n }\n }\n }\n\n .multiline-item {\n white-space: initial;\n overflow: hidden;\n\n .title, .subtitle {\n display: block;\n text-align: initial;\n }\n\n .title {\n line-height: 1.25rem;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .subtitle {\n font-size: 0.875rem;\n line-height: 1.5rem;\n color: var(--color-text-secondary);\n\n & + .subtitle {\n margin-top: -0.25rem;\n }\n\n &.black {\n color: var(--color-text);\n }\n }\n }\n\n &[dir=rtl] {\n .ListItem-button > i {\n margin-left: 2rem;\n margin-right: 0;\n }\n }\n}\n",".VerifiedIcon {\n display: inline-block;\n flex-shrink: 0;\n width: 1.5rem;\n height: 1.5rem;\n background-image: url('../../assets/icon-verified.svg');\n background-repeat: no-repeat;\n background-size: 100%;\n background-position: center;\n}\n",".typing-status {\n display: flex;\n align-items: baseline;\n\n .sender-name {\n &::after {\n content: '\\00a0';\n color: var(--color-text-secondary);\n }\n }\n\n .ellipsis {\n display: flex;\n width: 1rem;\n overflow: hidden;\n\n &::after {\n content: '...';\n animation: typing-animation 1s steps(4, start) infinite;\n\n html[lang=ar] &,\n html[lang=fa] & {\n animation-name: typing-animation-rtl;\n }\n }\n }\n}\n\n@keyframes typing-animation {\n from {\n transform: translateX(-1rem);\n }\n}\n\n@keyframes typing-animation-rtl {\n from {\n transform: translateX(1rem);\n }\n}\n",".Notification-container {\n position: relative;\n width: 24rem;\n max-width: 100vw;\n margin: .25rem auto;\n z-index: var(--z-notification);\n\n @media (min-width: 1276px) {\n transition: transform var(--layer-transition);\n }\n\n &:first-of-type {\n margin-top: 4.25rem;\n\n .has-header-tools & {\n margin-top: 7.375rem;\n }\n }\n}\n\n.Notification {\n background: rgba(32, 32, 32, .8) url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiNGRkYiIGN4PSIxMiIgY3k9IjEyIiByPSIxMiIvPjxjaXJjbGUgZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJub256ZXJvIiBjeD0iMTIiIGN5PSI2LjUiIHI9IjEuNSIvPjxwYXRoIGQ9Ik0xMiA5LjVjLS41NTIgMC0xIC4zNy0xIC44MjZ2Ny4zNDhjMCAuNDU2LjQ0OC44MjYgMSAuODI2czEtLjM3IDEtLjgyNnYtNy4zNDhjMC0uNDU2LS40NDgtLjgyNi0xLS44MjZ6IiBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+\") no-repeat .9375rem 50%;\n background-size: 1.5rem;\n border-radius: var(--border-radius-default);\n padding: .9375rem .9375rem .9375rem 3.375rem;\n color: #fff;\n margin: 0 .5rem;\n\n .text-entity-link,\n .text-entity-link:hover,\n .text-entity-link:active {\n color: #fff !important;\n text-decoration: underline;\n }\n\n .content {\n line-height: 1.25;\n word-break: break-word;\n font-size: .9375rem;\n }\n}\n",".Radio {\n display: block;\n position: relative;\n padding-left: 4.5rem;\n text-align: left;\n margin-bottom: 1.5rem;\n line-height: 1.5rem;\n cursor: pointer;\n\n &.disabled {\n pointer-events: none;\n opacity: 0.5;\n }\n\n &.hidden-widget {\n cursor: default;\n .Radio-main {\n &::before, &::after {\n visibility: hidden;\n }\n }\n }\n\n > input {\n position: absolute;\n z-index: var(--z-below);\n opacity: 0;\n }\n\n .Radio-main {\n &::before, &::after {\n content: '';\n display: block;\n position: absolute;\n left: 1.0625rem;\n top: 50%;\n width: 1.25rem;\n height: 1.25rem;\n transform: translateY(-50%);\n }\n\n &::before {\n border: 2px solid var(--color-borders-input);\n border-radius: 50%;\n background-color: var(--color-background);\n opacity: 1;\n transition: border-color .1s ease, opacity .1s ease;\n }\n\n &::after {\n left: 1.375rem;\n width: 0.625rem;\n height: 0.625rem;\n border-radius: 50%;\n background: var(--color-primary);\n opacity: 0;\n transition: opacity .1s ease;\n }\n\n .label {\n display: block;\n word-break: break-word;\n unicode-bidi: plaintext;\n text-align: left;\n }\n\n .subLabel {\n display: block;\n font-size: 0.875rem;\n line-height: 1rem;\n color: var(--color-text-secondary);\n unicode-bidi: plaintext;\n }\n }\n\n input:checked ~ .Radio-main {\n &::before {\n border-color: var(--color-primary);\n }\n\n &::after {\n opacity: 1;\n }\n }\n\n &.loading {\n .Radio-main::before,\n .Radio-main::after {\n opacity: 0 !important;\n }\n\n .Spinner {\n position: absolute;\n left: 1.0625rem;\n top: 50%;\n transform: translateY(-50%);\n opacity: 0;\n animation: fade-in .2s ease forwards;\n --spinner-size: 1.25rem;\n }\n }\n\n &[dir=rtl] {\n padding-left: 0;\n padding-right: 4.5rem;\n\n .Radio-main {\n text-align: right;\n\n &::before {\n left: auto;\n right: 1.0625rem;\n }\n\n &::after {\n left: auto;\n right: 1.375rem;\n }\n }\n\n .label,\n .subLabel {\n text-align: right;\n }\n\n &.loading .Spinner {\n left: auto;\n right: 1.0625rem;\n }\n }\n}\n\n@keyframes fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n",".Tab {\n display: flex;\n justify-content: center;\n flex: 1 1 auto;\n appearance: none;\n background: none;\n width: auto;\n margin: 0;\n border: none;\n padding: .625rem .25rem;\n font-weight: 500;\n color: var(--color-text-secondary);\n cursor: pointer;\n border-top-left-radius: var(--border-radius-messages-small);\n border-top-right-radius: var(--border-radius-messages-small);\n\n &,\n &:active,\n &:focus {\n outline: none;\n }\n\n &.active {\n cursor: default;\n color: var(--color-primary);\n\n i {\n opacity: 1;\n }\n }\n\n &:not(.active):hover {\n background: var(--color-interactive-element-hover);\n }\n\n > span {\n position: relative;\n display: flex;\n align-items: center;\n }\n\n .badge {\n min-width: 1.25rem;\n height: 1.25rem;\n margin-inline-start: 0.5rem;\n background: var(--color-gray);\n border-radius: 0.75rem;\n padding: 0 .3125rem;\n color: white;\n font-size: 0.875rem;\n line-height: 1.3125rem;\n font-weight: 500;\n text-align: center;\n flex-shrink: 0;\n\n body.is-ios &,\n body.is-macos & {\n line-height: 1.25rem;\n }\n\n &.active {\n background: var(--color-primary);\n }\n }\n\n i {\n position: absolute;\n bottom: calc(-.625rem - 1px);\n left: 0;\n opacity: 0;\n background-color: var(--color-primary);\n height: .1875rem;\n width: 100%;\n border-radius: .1875rem .1875rem 0 0;\n pointer-events: none;\n box-sizing: content-box;\n transform-origin: left;\n\n &.animate {\n transition: transform var(--slide-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n }\n}\n",".TabList {\n position: sticky;\n top: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n font-size: .875rem;\n flex-wrap: nowrap;\n box-shadow: 0 2px 2px var(--color-light-shadow);\n background-color: var(--color-background);\n overflow-x: auto;\n overflow-y: hidden;\n\n scrollbar-width: none;\n scrollbar-color: rgba(0, 0, 0, 0);\n\n &.big {\n font-size: 1rem;\n --border-radius-messages-small: 0;\n }\n\n &::-webkit-scrollbar {\n height: 0;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0);\n }\n}\n",".DeleteChatModal {\n .modal-dialog {\n max-width: 20rem;\n }\n\n .modal-header {\n padding: 1.125rem 1.25rem 0;\n }\n\n .modal-title:not(:only-child) {\n margin: 0 0 0 .75rem;\n }\n\n .modal-content {\n padding: .5rem 1.25rem;\n }\n\n .confirm-dialog-button {\n margin-right: -.625rem;\n }\n}\n",".SearchInput {\n position: relative;\n width: 100%;\n color: rgba(var(--color-text-secondary-rgb), 0.5);\n background-color: var(--color-chat-hover);\n border: 2px solid var(--color-chat-hover);\n border-radius: 1.375rem;\n transition: border-color 0.15s ease;\n\n &.with-picker-item {\n display: flex;\n\n .icon-search {\n display: none;\n }\n\n input {\n padding-left: .5rem;\n }\n\n &[dir=rtl] {\n input {\n padding-right: .5rem;\n padding-left: 0;\n }\n }\n }\n\n &.has-focus {\n border-color: var(--color-primary);\n caret-color: var(--color-primary);\n background-color: var(--color-background);\n\n input {\n & + i {\n color: var(--color-primary);\n }\n }\n }\n\n input {\n height: 2.5rem;\n margin-bottom: 0;\n border: none !important;\n border-radius: 1.375rem;\n background-color: transparent !important;\n box-shadow: none !important;\n padding: calc(0.4375rem - var(--border-width)) calc(2.625rem - var(--border-width)) calc(0.5rem - var(--border-width)) calc(2.625rem - var(--border-width));\n\n &::placeholder {\n color: var(--color-placeholders);\n }\n }\n\n > i {\n position: absolute;\n top: .5rem;\n left: .75rem;\n font-size: 1.5rem;\n }\n\n .Loading {\n position: absolute;\n top: .5rem;\n right: .5rem;\n height: 1.5rem;\n\n .Spinner {\n --spinner-size: 1.5rem;\n }\n }\n\n .Button {\n position: absolute;\n top: .125rem;\n right: .125rem;\n font-size: 1rem;\n }\n\n @media (max-width: 600px) {\n input {\n height: 2.5rem;\n border-radius: 1.25rem;\n padding-left: calc(2.625rem - var(--border-width));\n }\n\n i {\n top: 0.5rem;\n }\n }\n\n &[dir=rtl] {\n input {\n direction: rtl;\n }\n\n > i {\n left: auto;\n right: .75rem;\n }\n\n .Loading {\n left: .5rem;\n right: auto;\n }\n\n .Button {\n left: .125rem;\n right: auto;\n }\n }\n}\n",".PickerSelectedItem {\n display: flex;\n align-items: center;\n background: var(--color-chat-hover);\n height: 2rem;\n min-width: 2rem;\n margin-left: 0.5rem;\n margin-bottom: 0.5rem;\n padding-right: 1rem;\n border-radius: 1rem;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n flex-shrink: 1;\n transition: background-color .15s ease;\n\n max-width: calc(50% - 0.5rem);\n\n &.minimized {\n padding-right: 0;\n }\n\n &:hover {\n background-color: var(--color-item-active);\n }\n\n &.closeable:hover {\n background-color: rgba(var(--color-error-rgb), 0.16);\n\n .item-remove {\n opacity: 1;\n }\n\n .Avatar, .item-icon {\n opacity: 0;\n }\n }\n\n &.search-date {\n .item-remove {\n background: var(--color-primary);\n }\n\n &:hover {\n background: var(--color-chat-hover);\n }\n\n .item-name {\n font-size: 0.875rem;\n }\n }\n\n .SearchInput & {\n flex: 1 0 auto;\n position: relative;\n top: .25rem;\n left: -.125rem;\n\n color: var(--color-text-secondary);\n }\n\n .Avatar, .item-icon {\n width: 2rem;\n height: 2rem;\n opacity: 1;\n flex-shrink: 0;\n transition: opacity .15s ease;\n\n i {\n font-size: 2rem;\n }\n }\n\n .item-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0.375rem;\n border-radius: 50%;\n background-color: var(--color-primary);\n color: white;\n\n i {\n font-size: 1.25rem;\n position: relative;\n top: -1px;\n }\n }\n\n .item-name {\n margin-left: 0.5rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n .emoji.emoji-small {\n width: 1.125rem;\n height: 1.125rem;\n background-size: 1.125rem;\n vertical-align: -2px;\n }\n }\n\n .item-remove {\n position: absolute;\n left: 0;\n top: 0;\n width: 2rem;\n height: 2rem;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--color-error);\n font-size: 1.5rem;\n color: white;\n opacity: 0;\n transition: opacity .15s ease;\n }\n\n &[dir=rtl] {\n padding-left: 1rem;\n padding-right: 0;\n\n &.minimized {\n padding-right: 0;\n padding-left: 0;\n }\n\n .SearchInput & {\n left: auto;\n right: -.125rem;\n }\n\n .item-name {\n margin-left: 0;\n margin-right: 0.5rem;\n }\n\n .item-remove {\n left: auto;\n right: 0;\n }\n }\n}\n",".Switcher {\n display: inline-flex;\n align-items: center;\n position: relative;\n margin: 0;\n\n &.disabled {\n pointer-events: none;\n opacity: 0.5;\n }\n\n &.inactive {\n pointer-events: none;\n }\n\n body.animation-level-0 &,\n &.no-animation {\n .widget,\n .widget::after {\n transition: none !important;\n }\n\n .widget:active:after {\n width: 1.125rem;\n }\n }\n\n input {\n height: 0;\n width: 0;\n visibility: hidden;\n position: absolute;\n z-index: var(--z-below);\n opacity: 0;\n }\n\n .widget {\n cursor: pointer;\n text-indent: -999px;\n width: 2.125rem;\n height: 0.875rem;\n background: var(--color-gray);\n display: inline-block;\n border-radius: .5rem;\n position: relative;\n transition: background .2s ease-in;\n }\n\n .widget:after {\n content: '';\n position: absolute;\n top: -.125rem;\n left: 0;\n width: 1.125rem;\n height: 1.125rem;\n background: var(--color-background);\n border-radius: .75rem;\n transition: 0.2s ease-out;\n border: .125rem solid var(--color-gray);\n }\n\n input:checked + .widget {\n background: var(--color-primary);\n }\n\n input:checked + .widget:after {\n left: calc(100% - 1.125rem);\n transform: translateX(calc(-100% + 1.125rem));\n border-color: var(--color-primary);\n }\n\n .widget:active:after {\n width: 1.25rem;\n }\n}\n",".MessageOutgoingStatus {\n width: 1.19rem;\n height: 1.19rem;\n overflow: hidden;\n display: inline-block;\n line-height: 1;\n font-size: 1.1875rem;\n\n i {\n background: var(--background-color);\n }\n\n .icon-message-succeeded {\n padding-left: 0.13rem;\n }\n\n .Transition {\n width: 100%;\n height: 100%;\n }\n}\n",".LastMessageMeta {\n margin-right: .2rem;\n padding: .3rem 0 .15rem;\n flex-shrink: 0;\n font-size: 0.75rem;\n line-height: 1;\n display: flex;\n align-items: center;\n\n .MessageOutgoingStatus {\n color: var(--color-text-meta-colored);\n margin-right: 0.1rem;\n font-size: 1.15rem;\n\n body.is-ios & {\n margin-bottom: -.125rem;\n }\n }\n\n .time {\n color: var(--color-text-meta);\n line-height: 1.15rem;\n }\n}\n",".Badge-transition {\n opacity: 1;\n transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);\n\n &:not(.open) {\n transform: scale(0);\n opacity: 0;\n }\n\n &:not(.shown) {\n display: none;\n }\n\n &.closing {\n transition: transform .2s ease-out, opacity .2s ease-out;\n }\n}\n\n.Badge-wrapper {\n display: flex;\n\n .Badge {\n margin-inline-start: .5rem;\n }\n}\n\n.Badge {\n min-width: 1.5rem;\n height: 1.5rem;\n background: var(--color-gray);\n border-radius: 0.75rem;\n padding: 0 .4375rem;\n color: white;\n font-size: 0.875rem;\n line-height: 1.5625rem;\n font-weight: 500;\n text-align: center;\n flex-shrink: 0;\n\n body.is-macos & {\n line-height: 1.5rem;\n }\n\n body.is-ios & {\n line-height: 1.375rem;\n min-width: 1.375rem;\n height: 1.375rem;\n padding: 0 .375rem;\n }\n\n &.mention, &.unread:not(.muted) {\n background: var(--color-green);\n color: var(--color-white);\n }\n\n &.pinned:not(.unread) {\n color: var(--color-pinned);\n background: transparent;\n width: 1.5rem;\n padding: 0;\n\n i {\n font-size: 1.5rem;\n }\n }\n\n &.mention {\n width: 1.5rem;\n padding: 0.25rem;\n\n i {\n font-size: 1rem;\n vertical-align: super;\n }\n\n body.is-ios & {\n width: 1.375rem;\n padding: 0.25rem;\n\n i {\n font-size: .875rem;\n }\n }\n }\n}\n\n\n",".Chat {\n --background-color: var(--color-background);\n\n body.is-ios &,\n body.is-macos & {\n --color-text-meta: var(--color-text-meta-apple);\n }\n\n position: absolute;\n top: 0;\n left: 0;\n margin: 0;\n width: 100%;\n\n &.animate-opacity {\n will-change: opacity;\n transition: opacity .2s ease-out;\n }\n\n &.animate-transform {\n will-change: transform;\n transition: transform .2s ease-out;\n }\n\n &:hover, &.ListItem.has-menu-open {\n .Avatar.online::after {\n border-color: var(--color-chat-hover);\n }\n }\n\n @media (max-width: 600px) {\n &.selected {\n --background-color: var(--color-chat-hover) !important;\n\n .Avatar.online::after {\n border-color: var(--color-chat-hover);\n }\n }\n }\n\n @media (min-width: 600px) {\n &.selected,\n &.selected:hover {\n --background-color: var(--color-chat-active) !important;\n\n .Avatar.online::after {\n border-color: var(--color-chat-active) !important;\n background: var(--color-white);\n }\n\n .ListItem-button {\n --background-color: var(--color-chat-active) !important;\n --color-text: var(--color-white);\n --color-text-meta-colored: var(--color-white);\n --color-text-meta: var(--color-white);\n --color-text-secondary: var(--color-white);\n --color-error: var(--color-white);\n --color-pinned: var(--color-white);\n }\n\n .icon-muted-chat {\n color: var(--color-white) !important;\n }\n\n .Badge:not(.pinned) {\n background: var(--color-white);\n color: var(--color-chat-active);\n }\n }\n }\n\n @media (max-width: 600px) {\n .ListItem-button {\n border-radius: 0 !important;\n }\n }\n\n .status {\n flex-shrink: 0;\n }\n\n .info {\n .title, .subtitle {\n padding-right: .125rem;\n }\n\n .subtitle {\n margin-top: -.125rem;\n }\n\n h3 {\n width: auto;\n max-width: 80%;\n }\n\n .icon-muted-chat {\n font-size: 1.25rem;\n margin-left: 0.25rem;\n margin-top: -.0625rem;\n color: #C6C8CA;\n\n body.is-ios & {\n margin-top: 0;\n margin-right: .5rem;\n }\n }\n\n .LastMessageMeta {\n margin-left: auto;\n\n body.is-ios & {\n font-size: .875rem;\n margin-right: 0;\n }\n }\n\n .last-message, .typing-status {\n padding-right: 0.25rem;\n flex-grow: 1;\n color: var(--color-text-secondary);\n unicode-bidi: plaintext;\n\n &[dir=ltr] {\n text-align: left;\n }\n\n .sender-name {\n color: var(--color-text);\n }\n\n .draft {\n color: var(--color-error);\n }\n }\n\n .last-message {\n .draft {\n &::after {\n content: ': ';\n }\n }\n\n .colon {\n margin-inline-end: .25rem;\n }\n\n img {\n width: 1.25rem;\n height: 1.25rem;\n object-fit: cover;\n border-radius: .125rem;\n vertical-align: -.25rem;\n margin-inline-end: .25rem;\n\n body.is-ios & {\n width: 1.125rem;\n height: 1.125rem;\n vertical-align: -.1875rem;\n }\n\n &.round {\n border-radius: .625rem;\n }\n }\n\n .emoji-small {\n width: 1rem;\n height: 1rem;\n vertical-align: -.125rem;\n }\n\n .icon-play {\n position: relative;\n display: inline-block;\n font-size: .75rem;\n color: #fff;\n margin-inline-start: -1.25rem;\n margin-inline-end: 0.5rem;\n bottom: 0.0625rem;\n\n body.is-ios & {\n margin-inline-start: -1.125rem;\n bottom: 0;\n }\n }\n }\n }\n\n &[dir=rtl] {\n .info {\n .LastMessageMeta {\n margin-left: 0;\n margin-right: auto;\n }\n\n .title, .subtitle {\n padding-left: .15rem;\n padding-right: 0;\n }\n\n .icon-muted-chat {\n margin-left: 0;\n margin-right: 0.25rem;\n }\n\n .last-message, .typing-status {\n padding-left: 0.5rem;\n padding-right: 0;\n text-align: right;\n unicode-bidi: plaintext;\n }\n }\n }\n}\n",".AnimatedEmoji {\n margin-bottom: 0.75rem;\n\n img {\n position: absolute;\n width: 100%;\n height: 100%;\n\n &.like-sticker-thumb {\n transform: scale(0.8);\n }\n }\n}\n",".EmptyFolder {\n width: 100%;\n height: 80%;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n\n @media (max-height: 480px) {\n height: 100%;\n }\n\n .sticker {\n height: 8rem;\n margin-bottom: 1.875rem;\n }\n\n .title {\n font-size: 1.25rem;\n margin-bottom: .125rem;\n }\n\n .description {\n font-size: .875rem;\n color: var(--color-text-secondary);\n\n body.is-ios &,\n body.is-macos & {\n color: var(--color-text-secondary-apple);\n }\n }\n\n .Button.pill {\n margin-top: .625rem;\n font-weight: 500;\n padding-inline-start: .75rem;\n unicode-bidi: plaintext;\n\n i {\n margin-inline-end: .625rem;\n font-size: 1.5rem;\n }\n }\n}\n",".NothingFound {\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color-text-meta);\n\n &.with-description {\n flex-direction: column;\n }\n\n .AnimatedSticker {\n margin: 0 auto;\n }\n\n .description {\n color: var(--color-text-secondary);\n font-size: .875rem;\n text-align: center;\n margin: 1rem 0 0;\n unicode-bidi: plaintext;\n }\n}\n",".Media {\n height: 0;\n padding-bottom: 100%;\n overflow: hidden;\n position: relative;\n cursor: pointer;\n\n .video-duration {\n position: absolute;\n left: .25rem;\n top: .25rem;\n background: rgba(0, 0, 0, .25);\n color: #fff;\n font-size: .75rem;\n padding: 0 .3125rem;\n border-radius: .1875rem;\n line-height: 1.125rem;\n }\n\n img {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n}\n",".WebLink {\n min-height: 3rem;\n padding: .25rem 0 0 3.75rem;\n font-size: 0.875rem;\n line-height: 1.125rem;\n position: relative;\n\n & + & {\n margin-top: 1.5rem;\n }\n\n &.without-media::before {\n content: attr(data-initial);\n width: 3rem;\n height: 3rem;\n position: absolute;\n left: 0;\n top: 0;\n background-color: var(--color-webpage-initial-background);\n color: #fff;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--border-radius-messages-small);\n text-transform: uppercase;\n font-weight: 500;\n font-size: 1.5rem;\n }\n\n .Media {\n position: absolute;\n left: 0;\n top: 0;\n width: 3rem;\n height: 3rem;\n cursor: default !important;\n padding-bottom: unset !important;\n border-radius: var(--border-radius-messages-small) !important;\n }\n\n .site-name,\n .site-description,\n .site-title {\n word-break: break-word;\n text-align: initial;\n }\n\n .site-name {\n display: block;\n color: var(--color-links);\n font-weight: 400;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .site-title {\n font-size: 1rem;\n font-weight: 400;\n margin-bottom: .0625rem;\n line-height: 1.3125rem;\n }\n\n .sender-name,\n .site-description {\n margin-bottom: 0;\n color: var(--color-text-secondary);\n line-height: 1.125rem;\n max-height: 2.25rem;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .sender-name {\n margin-top: .25rem;\n }\n\n .site-description .emoji {\n width: 1rem !important;\n height: 1rem !important;\n }\n\n &[dir=rtl] {\n padding: .25rem 3.75rem 0 0;\n\n .Media,\n &.without-media::before {\n left: auto;\n right: 0;\n }\n\n .content {\n text-align: right;\n }\n }\n}\n",".File {\n --secondary-color: var(--color-text-secondary);\n\n .Message.own & {\n --secondary-color: var(--color-text-green);\n }\n\n .content-inner & {\n min-width: 14rem;\n @media (max-width: 340px) {\n min-width: 11rem;\n }\n }\n\n display: flex;\n align-items: center;\n\n .file-icon-container {\n position: relative;\n }\n\n .file-progress,\n .file-icon,\n .file-preview {\n width: 3.375rem;\n height: 3.375rem;\n margin-inline-end: .75rem;\n border-radius: var(--border-radius-messages-small);\n background: var(--color-primary);\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .file-progress {\n position: absolute;\n top: 0;\n left: 0;\n }\n\n .file-icon {\n padding: 1rem .75rem .5rem;\n align-items: flex-end;\n flex-shrink: 0;\n position: relative;\n color: white;\n\n .file-ext {\n font-size: 1rem;\n font-weight: 500;\n transition: opacity .15s;\n }\n\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n right: 0;\n border-bottom-left-radius: 0.25rem;\n background: rgba(black, 0.25);\n border-color: transparent var(--background-color) transparent var(--background-color);\n border-width: 0 1.125rem 1.125rem 0;\n border-style: solid;\n transition: border-width .15s ease-in;\n }\n }\n\n .file-preview {\n background: transparent;\n overflow: hidden;\n\n & + .action-icon,\n & + .file-progress {\n background: rgba(black, 0.5);\n border-radius: var(--border-radius-messages-small);\n }\n\n img {\n object-fit: cover;\n }\n }\n\n .action-icon {\n color: #fff;\n font-size: 1.5rem;\n position: absolute;\n top: 0;\n start: 0;\n width: 3.375rem;\n height: 3.375rem;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity .25s;\n }\n\n &.interactive .file-icon-container {\n cursor: pointer;\n\n &:hover {\n .file-icon::after {\n border-width: 0;\n }\n\n .action-icon {\n opacity: 1;\n\n &.hidden {\n opacity: 0;\n }\n }\n\n .file-ext {\n opacity: 0;\n }\n }\n }\n\n .file-info {\n margin-top: .1875rem;\n margin-right: .125rem;\n white-space: nowrap;\n overflow: hidden;\n flex-grow: 1;\n\n & + .Link {\n font-size: .75rem;\n color: var(--color-text-secondary);\n padding-left: 1rem;\n white-space: nowrap;\n }\n }\n\n .file-title {\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 500;\n overflow: hidden;\n text-overflow: ellipsis;\n\n .emoji {\n vertical-align: -4px;\n }\n }\n\n .file-subtitle {\n font-size: .875rem;\n line-height: .9375rem;\n color: var(--secondary-color);\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n\n span + span {\n &::before {\n content: '\\00a0\\2022\\00a0';\n }\n }\n }\n\n &.smaller {\n --background-color: var(--color-background);\n --border-radius-messages-small: .3125rem;\n\n .action-icon,\n .file-progress,\n .file-icon,\n .file-preview {\n width: 3rem;\n height: 3rem;\n }\n\n .file-icon {\n padding-bottom: .375rem;\n\n &::after {\n border-width: 0 1rem 1rem 0;\n }\n }\n\n .file-info {\n margin-top: -.125rem;\n }\n\n .file-title {\n font-weight: 400;\n }\n\n .file-subtitle {\n line-height: 1rem;\n }\n }\n\n &:dir(rtl),\n &[dir=rtl] {\n .file-progress,\n .file-icon,\n .file-preview {\n margin-left: .75rem;\n margin-right: 0;\n }\n\n .file-info {\n text-align: right;\n\n & + .Link {\n padding-left: 0;\n padding-right: 1rem;\n }\n }\n\n .action-icon {\n left: auto;\n right: 0;\n }\n }\n}\n\n// Document extension colors\n.File .file-progress,\n.File .file-icon {\n &.red {\n background-color: var(--color-error);\n }\n\n &.orange {\n background-color: var(--color-warning);\n }\n\n &.green {\n background-color: var(--color-text-green);\n }\n}\n",".Audio {\n display: flex;\n align-items: flex-start;\n\n &.media-inner {\n overflow: visible;\n }\n\n &.own {\n --color-text-secondary: var(--accent-color);\n --color-interactive-active: var(--color-text-green);\n --color-interactive-inactive: rgba(var(--color-text-green-rgb), 0.4);\n --color-interactive-buffered: rgba(var(--color-text-green-rgb), 0.4); // Overlays underlying inactive color\n\n .theme-dark & {\n --color-text-green-rgb: 255, 255, 255;\n --color-text-green: var(--color-white);\n }\n\n .Button {\n --color-primary: var(--color-text-green);\n --color-primary-shade: var(--color-green);\n --color-primary-shade-darker: var(--color-green-darker);\n --color-white: var(--color-background-own);\n\n .theme-dark & {\n --color-primary-shade: #fff;\n --color-primary-shade-darker: #fff;\n }\n }\n }\n\n .toggle-play {\n margin-inline-end: .5rem;\n\n &.smaller {\n width: 3rem;\n height: 3rem;\n margin-inline-end: .75rem;\n\n i {\n font-size: 1.625rem;\n margin-top: -.025rem;\n }\n }\n\n i {\n position: absolute;\n\n &.icon-play {\n margin-left: .125rem;\n @media (max-width: 600px) {\n margin-left: .0625rem;\n }\n }\n }\n\n .icon-play, .icon-pause {\n opacity: 1;\n transform: scale(1);\n transition: opacity .4s, transform .6s cubic-bezier(0.34, 1.56, 0.64, 1);\n }\n\n &.play .icon-pause,\n &.pause .icon-play,\n &.loading .icon-play,\n &.loading .icon-pause {\n opacity: 0;\n transform: scale(.5);\n }\n }\n\n .media-loading {\n pointer-events: none;\n\n .interactive {\n pointer-events: auto;\n }\n }\n\n .download-button {\n position: absolute;\n width: 1.125rem !important;\n height: 1.125rem !important;\n padding: 0;\n left: 1.5rem;\n top: 1.5rem;\n border: .125rem solid var(--background-color);\n z-index: 1;\n\n i {\n font-size: 0.8125rem;\n }\n }\n\n &.bigger .download-button {\n left: 2rem;\n top: 2rem;\n border: .125rem solid var(--color-background);\n }\n\n .content {\n align-self: center;\n min-width: 0;\n flex-grow: 1;\n text-align: initial;\n }\n\n .content-row {\n display: flex;\n justify-content: space-between;\n }\n\n .title {\n font-weight: 500;\n margin: 0;\n line-height: 1.25;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .voice-duration {\n margin: .25rem 0 0;\n font-size: .875rem;\n color: var(--color-text-secondary);\n\n span {\n margin-left: 0.25rem;\n font-size: 1.5rem;\n line-height: .875rem;\n vertical-align: middle;\n }\n }\n\n &:not(.own) .voice-duration span {\n color: var(--color-primary);\n }\n\n .waveform {\n cursor: pointer;\n margin-left: 1px;\n }\n\n .meta,\n .performer,\n .date {\n font-size: .875rem;\n line-height: 1;\n color: var(--color-text-secondary);\n margin: 0;\n }\n\n .duration {\n margin: .1875rem 0 0;\n font-size: .875rem;\n color: var(--color-text-secondary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .seekline {\n width: calc(100% - 2px);\n padding-left: 6px;\n margin-bottom: .3125rem;\n height: 12px;\n position: relative;\n margin-left: -6px;\n top: 1px;\n cursor: pointer;\n\n &::before {\n content: '';\n position: absolute;\n width: 100%;\n left: 6px;\n top: 6px;\n height: 2px;\n background-color: var(--color-interactive-inactive);\n border-radius: 2px;\n }\n }\n\n .seekline-buffered-progress, .seekline-play-progress {\n position: absolute;\n height: 2px;\n border-radius: 2px;\n overflow: hidden;\n width: 100%;\n top: 6px;\n left: 6px;\n\n i {\n position: absolute;\n width: 100%;\n background-color: var(--color-interactive-active);\n height: 2px;\n border-radius: 2px;\n right: 100%;\n }\n }\n\n .seekline-buffered-progress i {\n background-color: var(--color-interactive-buffered) !important;\n }\n\n .seekline-thumb {\n position: absolute;\n width: 100%;\n top: 7px;\n left: 0;\n\n i {\n pointer-events: none;\n position: absolute;\n width: 100%;\n right: 100%;\n\n &::after {\n content: '';\n position: absolute;\n top: -6px;\n right: -12px;\n width: 12px;\n height: 12px;\n border-radius: 6px;\n background: var(--color-interactive-active);\n }\n }\n }\n\n &.bigger {\n .content {\n margin-top: .1875rem;\n }\n\n .title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-weight: 400;\n line-height: 1.5rem;\n }\n\n .meta,\n .performer,\n .date {\n line-height: 1.0625rem;\n }\n\n .seekline {\n top: 2px;\n margin-bottom: .5rem;\n }\n\n .duration {\n line-height: 1rem;\n }\n\n .media-loading {\n top: 0.1875rem;\n left: 0.1875rem;\n }\n\n &[dir=rtl] {\n .media-loading {\n left: auto !important;\n right: 0;\n }\n }\n }\n\n .ProgressSpinner.size-s svg {\n width: 2.25rem;\n height: 2.25rem;\n }\n\n &[dir=rtl] {\n .toggle-play {\n margin-left: .5rem;\n margin-right: 0;\n\n &.smaller {\n margin-left: .75rem;\n margin-right: 0;\n }\n }\n\n .content,\n .duration {\n text-align: right;\n }\n\n .download-button {\n left: auto;\n right: 1.5rem;\n }\n }\n}\n",".ProfilePhoto {\n width: 100%;\n height: 100%;\n cursor: pointer;\n position: relative;\n\n img:not(.emoji) {\n width: 100%;\n object-fit: cover;\n }\n\n .prev-avatar-media {\n position: absolute;\n left: 0;\n top: 0;\n z-index: -1;\n }\n\n .spinner-wrapper {\n width: 100%;\n height: 100%;\n }\n\n .spinner-wrapper,\n &.deleted-account,\n &.no-photo,\n &.saved-messages {\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color-white);\n background: linear-gradient(var(--color-white) -125%, var(--color-user));\n cursor: default;\n }\n\n &.no-photo {\n font-size: 14rem;\n }\n\n &.deleted-account,\n &.saved-messages {\n font-size: 20rem;\n }\n}\n",".ProfileInfo {\n aspect-ratio: 1 / 1;\n position: relative;\n\n @supports not (aspect-ratio: 1 / 1) {\n &::before {\n float: left;\n padding-top: 100%;\n content: \"\";\n }\n\n &::after {\n display: block;\n content: \"\";\n clear: both;\n }\n }\n\n .photo-wrapper {\n width: 100%;\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n\n > .Transition {\n width: 100%;\n height: 100%;\n }\n }\n\n .photo-dashes {\n position: absolute;\n width: 100%;\n height: .125rem;\n padding: 0 .375rem;\n z-index: 1;\n\n display: flex;\n top: .5rem;\n left: 0;\n }\n\n .photo-dash {\n flex: 1 1 auto;\n background-color: var(--color-white);\n opacity: .5;\n border-radius: .125rem;\n margin: 0 .125rem;\n\n &.current {\n opacity: 1;\n }\n }\n\n .navigation {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 25%;\n border: none;\n padding: 0;\n margin: 0;\n appearance: none;\n background: transparent no-repeat;\n background-size: 1.25rem;\n opacity: .25;\n transition: opacity .15s;\n outline: none;\n cursor: pointer;\n z-index: 1;\n\n &:hover, .is-touch-env & {\n opacity: 1;\n }\n\n &.prev {\n left: 0;\n background-image: url(\"../../assets/media_navigation_previous.svg\");\n background-position: 1.25rem 50%;\n }\n\n &.next {\n right: 0;\n background-image: url(\"../../assets/media_navigation_next.svg\");\n background-position: calc(100% - 1.25rem) 50%;\n }\n }\n\n .info {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n min-height: 100px;\n padding: 0 1.5rem .5rem;\n background: linear-gradient(0deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%);\n color: var(--color-white);\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n pointer-events: none;\n\n &:dir(rtl) {\n .status {\n text-align: right;\n unicode-bidi: plaintext;\n }\n }\n\n &[dir=rtl] {\n .status {\n text-align: right;\n unicode-bidi: plaintext;\n }\n }\n }\n\n .title {\n display: flex;\n align-items: center;\n\n h3 {\n font-weight: 500;\n font-size: 1.25rem;\n line-height: 1.375rem;\n white-space: pre-wrap;\n word-break: break-word;\n margin-bottom: .25rem;\n }\n\n .VerifiedIcon {\n margin-left: 0.25rem;\n margin-top: -0.125rem;\n }\n\n .emoji {\n width: 1.5rem;\n height: 1.5rem;\n background-size: 1.5rem;\n }\n }\n\n .status {\n font-size: 0.875rem;\n opacity: .5;\n }\n\n &[dir=rtl] {\n .navigation.prev {\n left: auto;\n right: 0;\n transform: scaleX(-1);\n }\n\n .navigation.next {\n left: 0;\n right: auto;\n transform: scaleX(-1);\n }\n }\n\n &.self {\n margin: 0 -.5rem .75rem;\n overflow: hidden;\n\n &.ghost {\n margin: 0;\n }\n\n .prev-avatar-media {\n z-index: 0;\n }\n\n .info {\n padding-bottom: .75rem;\n }\n\n .status {\n line-height: 1rem;\n }\n }\n}\n",".DropTarget {\n border-radius: var(--border-radius-default);\n background: var(--color-background);\n padding: 1.25rem;\n flex: 1 1 auto;\n width: 100%;\n max-width: 43.75rem;\n margin-left: auto;\n margin-right: auto;\n margin-bottom: .3125rem;\n display: flex;\n color: #A4ACB3;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n\n @media (max-height: 350px) {\n padding: .75rem;\n }\n\n &.hovered .target-content {\n color: var(--color-primary);\n background-image: var(--drag-target-border-hovered);\n }\n\n & + & {\n margin-top: .3125rem;\n }\n\n &:last-child {\n margin-bottom: 0;\n }\n\n .target-content {\n pointer-events: none;\n background-image: var(--drag-target-border);\n border-radius: .5rem;\n flex: 1 1 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n transition: .2s color, .2s background;\n }\n\n .icon {\n font-size: 6.25rem;\n line-height: 4.6875rem;\n margin-bottom: 2.25rem;\n\n @media (max-height: 520px) {\n font-size: 4.25rem;\n line-height: 3.5rem;\n margin-bottom: 1rem;\n }\n\n @media (max-height: 450px) {\n font-size: 2rem;\n line-height: 1rem;\n margin-bottom: .5rem;\n margin-top: .25rem;\n }\n }\n\n .title {\n font-size: 1.3125rem;\n font-weight: 500;\n letter-spacing: -.18px;\n\n @media (max-height: 450px) {\n font-size: 1rem;\n }\n }\n\n .description {\n font-size: 1rem;\n letter-spacing: .3px;\n\n @media (max-height: 450px) {\n font-size: .875rem;\n }\n }\n}\n",".FloatingActionButton {\n position: absolute;\n right: 1rem;\n bottom: 1rem;\n transform: translateY(5rem);\n transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n &.revealed {\n transform: translateY(0);\n }\n}\n",".DropArea {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n height: 100vh;\n z-index: var(--z-drop-area);\n padding: 80px 20px 20px;\n\n display: flex;\n flex-direction: column;\n\n #Main.right-column-open & {\n max-width: calc(100% - var(--right-column-width));\n }\n}\n",".StickerButton {\n display: inline-block;\n width: 4rem;\n height: 4rem;\n margin: 0.5rem;\n border-radius: var(--border-radius-messages-small);\n background: transparent no-repeat center;\n background-size: contain;\n cursor: pointer;\n transition: background-color .15s ease, opacity .3s ease !important;\n position: relative;\n\n @media (max-width: 600px) {\n margin: 0.25rem;\n }\n\n &.set-button {\n width: 2.75rem !important;\n height: 2.75rem;\n margin: 0 0.5rem;\n }\n\n &.large {\n width: 10rem;\n height: 10rem;\n margin: 0;\n }\n\n .AnimatedSticker, img {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n img {\n object-fit: contain;\n }\n\n .sticker-unfave-button {\n position: absolute;\n top: -0.5rem;\n right: -0.5rem;\n width: 1.25rem;\n height: 1.25rem;\n padding: 0.125rem;\n\n i {\n font-size: 1rem;\n }\n\n opacity: 0;\n }\n\n &:hover {\n background-color: var(--color-interactive-element-hover);\n\n .sticker-unfave-button {\n opacity: 1;\n }\n }\n}\n",".TextFormatter {\n transform: translate(-50%, -3.25rem);\n\n &, &-link-control {\n position: absolute;\n background: var(--color-background);\n border-radius: var(--border-radius-messages);\n padding: 0.5rem 0.375rem;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n }\n\n &-link-control {\n left: 0;\n top: 0;\n opacity: 0;\n pointer-events: none;\n transition: opacity .3s ease;\n\n .Modal & {\n max-width: 100%;\n }\n\n @media (max-width: 600px) {\n max-width: calc(100vw - var(--text-formatter-left) + 3rem);\n }\n\n input {\n border: none !important;\n outline: none !important;\n width: 100%;\n color: var(--color-text);\n background-color: var(--color-background);\n }\n }\n\n &-buttons, &-link-url-confirm {\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n }\n\n &-divider {\n width: 1px;\n height: 1.75rem;\n margin: 0 0.25rem;\n background-color: var(--color-borders);\n }\n\n &-link-url-input-wrapper {\n width: 20rem;\n position: relative;\n max-width: 100%;\n\n @media (max-width: 600px) {\n max-width: 90vw;\n }\n\n &::before, &::after {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n width: 1rem;\n z-index: 2;\n opacity: 0;\n transition: opacity .2s ease;\n }\n\n &::before {\n left: 0;\n background: linear-gradient(to right, var(--color-background) .25rem, transparent 1rem)\n }\n\n &::after {\n right: 0;\n background: linear-gradient(to left, var(--color-background) .25rem, transparent 1rem)\n }\n\n &.mask-left {\n &::before {\n opacity: 1;\n }\n }\n\n &.mask-right {\n &::after {\n opacity: 1;\n }\n }\n }\n\n &-link-url-confirm {\n flex-shrink: 0;\n opacity: 0;\n transition: opacity .3s ease;\n\n &.shown {\n opacity: 1;\n }\n }\n\n &.link-control-shown {\n .TextFormatter-link-control {\n opacity: 1;\n pointer-events: all;\n }\n }\n\n .Button {\n width: 2rem;\n height: 2rem;\n padding: 0.25rem;\n font-size: 1.5rem;\n margin: 0 0.125rem;\n border-radius: var(--border-radius-messages-small);\n flex-shrink: 0;\n cursor: pointer;\n\n &.active {\n background-color: var(--color-primary) !important;\n color: white;\n }\n\n &.disabled {\n opacity: .5;\n pointer-events: none;\n }\n }\n}\n",".Picker {\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n\n .picker-header {\n padding: 0 1rem 0.25rem 0.75rem;\n border-bottom: 1px solid var(--color-borders);\n display: flex;\n flex-flow: row wrap;\n flex-shrink: 0;\n\n overflow-y: auto;\n max-height: 20rem;\n\n .input-group {\n margin-bottom: 0.5rem;\n margin-left: 0.5rem;\n flex-grow: 1;\n }\n\n .form-control {\n height: 2rem;\n border: none;\n border-radius: 0;\n padding: 0;\n box-shadow: none;\n }\n }\n\n .picker-list {\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden;\n padding: 0.5rem;\n\n @media (max-width: 600px) {\n padding-left: 0 !important;\n padding-right: 0 !important;\n }\n }\n\n .no-results {\n height: 100%;\n margin: 0;\n padding: 1rem 1rem;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color-text-secondary);\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"484.87953bd73fba4543a4f6.css","mappings":"AAAA,YACE,kBAEA,cACE,WACA,YACA,wCACA,gCAEA,oCACE,kBACA,MACA,OAGF,+CACE,wBAKJ,kCACE,2BAQA,sBACE,2BAIA,kCACE,4CAGF,gCACE,2CAMJ,gCACE,4BAIA,4CACE,qDAG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BAIJ,+BACE,GACE,wBAEF,KACE,+BAIJ,wCACE,GACE,wBAEF,KACE,8BAIJ,yCACE,GACE,8BAEF,KACE,yBAOJ,6BACE,GACE,qBAEF,KACE,oBAIJ,uCACE,GACE,mBAEF,KACE,sBAIJ,wCACE,GACE,sBAEF,KACE,oBAOJ,4BACE,GACE,wBACA,UAEF,KACE,2BACA,iDAIJ,sCACE,GACE,2BACA,gDAEF,KACE,wBACA,WAQJ,oBACE,GACE,mBACA,UAEF,KACE,qBACA,WAIJ,8BACE,GACE,qBACA,UAEF,KACE,mBACA,WAOJ,wBACE,GACE,2BAEF,KACE,yBAIJ,kCACE,GACE,wBAEF,KACE,4BAOJ,qBACE,GACE,gEAEF,KACE,2DAOJ,+BACE,GACE,0DAEF,KACE,iE;AC1pBJ,QACE,mCACA,UACA,mBACA,uBACA,eACA,gBACA,kBACA,wEACA,WACA,iBACA,aACA,mBAEA,wBACE,kBAGF,eACE,WACA,YAGF,UACE,iBAGF,mBACE,WACA,YACA,mBAEA,0BACE,eACA,gBAIJ,kBACE,WACA,YACA,kBAEA,yBACE,cACA,eAIJ,mBACE,eACA,gBACA,kBAEA,0BACE,cACA,eAIJ,oBACE,cACA,eACA,oBAEA,2BACE,WACA,YAIJ,mBACE,oBAEA,qBACE,iBAGF,0BACE,gBACA,iBAIJ,mBACE,aACA,cACA,iBAEA,qBACE,eAGF,0BACE,aACA,cAIJ,eACE,kBAEA,sBACE,WACA,cACA,kBACA,cACA,aACA,cACA,eACA,kBACA,yCACA,yBACA,cAIJ,oBACE,eAGF,wBACE,WACA,Y;AC3HJ,iBACE,kBACA,UACA,eACA,gBACA,qFACA,kBACA,eAEA,0BACE,kCACA,oBAGF,wBACE,sBAEA,+BACE,WACA,kBACA,eACA,gBACA,sBACA,sBACA,SACA,QACA,qCAIJ,gDACE,WACA,YACA,iFAEA,8DACE,sBACA,aACA,cAIJ,yBACE,cACA,eAEA,6BACE,WACA,YACA,eAGF,gCACE,iBAIJ,6BACE,wCAGF,qBACE,cACA,yBACA,yBACA,yDAGF,wBACE,iCAIJ,oCACE,KACE,uBAEF,GACE,0+B;AC9EJ,OACE,kBACA,uBAGE,4IACE,gBAKF,gCACE,gBAKF,4BACE,gBAKF,4BACE,gBAIJ,wBACE,eACA,MACA,SACA,OACA,QACA,aACA,uBACA,mBAGF,uBACE,eACA,MACA,QACA,SACA,OACA,WACA,iCAGF,4CACE,6BAGF,qBACE,kBACA,oBACA,sBACA,WACA,gBACA,kBACA,iBACA,yCACA,8DACA,2CACA,mCAEA,+CAEA,4CACE,gBACA,0BAGF,yBApBF,qBAqBI,yCAIJ,0BACE,+BAGF,6BACE,kCAGF,oDACE,oBACA,aACA,mBACA,cAGF,oBACE,kBACA,gBACA,cACA,gBACA,uBAEA,qCACE,mBAIJ,+BAEE,4CAEA,oDACE,kBACA,eACA,WACA,qBACA,iBACA,qBACA,sBACA,eAIJ,sBACE,WACA,YACA,aACA,gBAEA,qDAEE,sBAIJ,kEAGE,uBACA,mBAGF,uBACE,aACA,qBAEA,qEACE,iBAIJ,8BACE,WACA,YACA,iBACA,iBACA,gBACA,qB;AC3JJ,UACE,kBAGE,oGACE,WACA,kBACA,SACA,YACA,QACA,iBACA,iCAGF,oFACE,cAGF,8EACE,OAMF,oDACE,gBACA,uBAIJ,2BACE,WACA,yCACA,uBACA,2BACA,wBACA,aACA,aACA,kBACA,gBACA,mBACA,mBACA,wBACA,2CACA,mCAEA,6BACE,iBACA,kBACA,kCAIJ,oFACE,mBACA,uBAIA,uCACE,kBACA,WAIJ,mBACE,oBAEA,oCACE,WAKF,0DACE,eAEA,qBACE,gIACE,6CAIJ,yBACE,iEACE,6CAMR,yBAGI,4HACE,yDAKN,yCACE,4CAGF,iBACE,qBAEA,kCACE,mBAIJ,mBACE,oBAGF,gBACE,4CAIA,uCACE,yBAEA,yCACE,cAKN,uBACE,kBAEA,+BACE,WAEA,gDACE,6BACA,8BAKN,8BACE,iBAEA,sFAEE,0DAGF,+CACE,4CAGF,sCACE,cACA,mBAGF,oCACE,YACA,gBAGF,6EACE,gBACA,aACA,2BACA,mBAGF,gKACE,eACA,sBACA,SACA,gBACA,mBACA,uBACA,mBAIA,wCACE,gBAGF,mDACE,cACA,eACA,mBAGF,4CACE,2BACA,wBACA,cAIJ,6FAEE,kBACA,oBACA,kCAGF,wCACE,aACA,mBACA,YACA,gBAEA,uGACE,kBACA,oBACA,kCACA,qBAEA,qHACE,2BAGF,oPAEE,mBACA,WAGF,gTAEE,kBAKN,6PAGE,mBACA,uBAMA,4UAEE,mBAKF,wDACE,4CAGF,+CACE,kBACA,eAGF,qDACE,WAMJ,uCACE,qBAGF,mCACE,cAGF,6EACE,eACA,mBACA,gBACA,mBACA,uBACA,gBAGF,iDACE,iBACA,eAGF,0CACE,kCACA,kBAEA,mEACE,wBACA,mBACA,qBACA,kBAKF,0DACE,cACA,kBAGF,mDACE,eACA,cAKN,2BACE,SAEA,4CACE,eACA,aACA,mBAGF,mCACE,WACA,YAGF,qCACE,cACA,cACA,SACA,kBAIA,8CACE,eACA,mBAKN,0BACE,oBACA,gBAEA,qEACE,cACA,mBAGF,iCACE,oBACA,gBACA,uBAGF,oCACE,kBACA,mBACA,kCAEA,8CACE,oBAGF,0CACE,wBAMJ,sCACE,iBACA,e;AC3XN,cACE,qBACA,cACA,aACA,cACA,yDACA,4BACA,qBACA,gC;ACRF,2BACE,qBACA,oCAGE,WACE,kCACA,0BAIJ,YACE,WACA,gBACA,iCAEA,aACE,uDACA,6FAEA,mCAEE,6BAMR,KACE,2BACE,kCAIJ,KACE,0BACE,E;ACpCJ,wBACE,kBACA,YACA,gBACA,mBACA,8BAEA,0BAPF,wBAQI,8CAGF,sCACE,mBAEA,wDACE,oBAKN,cACE,4FACA,uBACA,2CACA,4CACA,WACA,eAEA,6GAGE,sBACA,0BAGF,uBACE,iBACA,sBACA,+e;ACtCJ,OACE,cACA,kBACA,oBACA,gBACA,qBACA,mBACA,eAEA,gBACE,oBACA,WAGF,qBACE,eAEE,iFACE,kBAKN,aACE,kBACA,uBACA,UAIA,qDACE,WACA,cACA,kBACA,eACA,QACA,cACA,eACA,2BAGF,2BACE,4CACA,kBACA,yCACA,UACA,kDAGF,0BACE,cACA,cACA,eACA,kBACA,gCACA,UACA,4BAGF,0BACE,cACA,sBACA,uBACA,gBAGF,6BACE,cACA,kBACA,iBACA,kCACA,uBAKF,yCACE,kCAGF,wCACE,UAKF,qEAEE,qBAGF,wBACE,kBACA,eACA,QACA,2BACA,UACA,oCACA,wBAIJ,gBACE,eACA,qBAEA,4BACE,iBAEA,oCACE,UACA,gBAGF,mCACE,UACA,eAIJ,iDAEE,iBAGA,iCACA,UACA,gBAKN,mBACE,KACE,UAEF,GACE,W;ACzIJ,KACE,aACA,uBACA,cACA,wCACA,gBACA,WACA,SACA,YACA,uBACA,gBACA,kCACA,eACA,2DACA,4DAEA,4BAGE,aAGF,YACE,eACA,2BAEA,cACE,UAIJ,wBACE,kDAGF,UACE,kBACA,aACA,mBAGF,YACE,kBACA,eACA,0BACA,6BACA,qBACA,mBACA,WACA,kBACA,sBACA,gBACA,kBACA,cAEA,kDAEE,oBAGF,mBACE,gCAIJ,OACE,kBACA,4BACA,OACA,UACA,sCACA,gBACA,WACA,oCACA,oBACA,uBACA,sBAEA,eACE,6CAEA,sCACE,2B;AClFR,SACE,gBACA,MACA,cACA,aACA,8BACA,qBACA,kBACA,iBACA,+CACA,yCACA,gBACA,kBAEA,qBACA,8BAEA,aACE,eACA,kCAGF,4BACE,SAGF,kCACE,+B;AC1BF,+BACE,gBAGF,+BACE,2BAGF,+CACE,oBAGF,gCACE,sBAGF,wCACE,uB;AClBJ,aACE,kBACA,WACA,iDACA,yCACA,yCACA,uBACA,kCAEA,8BACE,aAEA,2CACE,aAGF,oCACE,mBAIA,6CACE,oBACA,eAKN,uBACE,kCACA,iCACA,yCAGE,+BACE,2BAKN,mBACE,cACA,gBACA,uBACA,uBACA,wCACA,2BACA,2JAEA,gCACE,gCAIJ,eACE,kBACA,UACA,YACA,iBAGF,sBACE,kBACA,UACA,YACA,cAEA,+BACE,uBAIJ,qBACE,kBACA,YACA,cACA,eAGF,yBACE,mBACE,cACA,sBACA,kDAGF,eACE,WAKF,4BACE,cAGF,wBACE,UACA,aAGF,+BACE,WACA,WAGF,8BACE,aACA,W;AC5GN,oBACE,aACA,mBACA,mCACA,YACA,eACA,kBACA,oBACA,mBACA,mBACA,eACA,kBACA,gBACA,cACA,sCAEA,6BAEA,8BACE,gBAGF,0BACE,0CAGF,oCACE,oDAEA,iDACE,UAGF,2FACE,UAKF,6CACE,gCAGF,sCACE,mCAGF,2CACE,kBAIJ,iCACE,cACA,kBACA,WACA,eAEA,kCAGF,2DACE,WACA,YACA,UACA,cACA,6BAEA,+DACE,eAIJ,+BACE,aACA,mBACA,uBACA,gBACA,kBACA,sCACA,WAEA,iCACE,kBACA,kBACA,SAIJ,+BACE,kBACA,mBACA,gBACA,uBAEA,kDACE,eACA,gBACA,yBACA,oBAIJ,iCACE,kBACA,OACA,MACA,WACA,YACA,kBACA,aACA,mBACA,uBACA,oCACA,iBACA,WACA,UACA,6BAGF,6BACE,kBACA,gBAEA,uCACE,gBACA,eAGF,0CACE,UACA,gBAGF,wCACE,cACA,mBAGF,0CACE,UACA,Q;AC7IN,UACE,oBACA,mBACA,kBACA,SAEA,mBACE,oBACA,WAGF,mBACE,oBAKA,8JAEE,2BAGF,kGACE,eAIJ,gBACE,SACA,QACA,kBACA,kBACA,uBACA,UAGF,kBACE,eACA,mBACA,eACA,eACA,6BACA,qBACA,oBACA,kBACA,kCAGF,wBACE,WACA,kBACA,cACA,OACA,eACA,gBACA,mCACA,qBACA,wBACA,uCAGF,gCACE,gCAGF,sCACE,2BACA,6CACA,kCAGF,+BACE,c;ACxEJ,uBACE,cACA,eACA,gBACA,qBACA,cACA,oBAEA,yBACE,mCAGF,+CACE,oBAGF,mCACE,WACA,Y;AClBJ,iBACE,mBACA,uBACA,cACA,iBACA,cACA,aACA,mBAEA,wCACE,qCACA,mBACA,kBAEA,oDACE,wBAIJ,uBACE,6BACA,oB;ACrBJ,kBACE,UACA,2DAEA,6BACE,mBACA,UAGF,8BACE,aAGF,0BACE,uDAIJ,eACE,aAEA,sBACE,0BAIJ,OACE,iBACA,cACA,6BACA,qBACA,mBACA,WACA,kBACA,sBACA,gBACA,kBACA,cAEA,qBACE,mBAGF,mBACE,qBACA,mBACA,gBACA,kBAGF,yCACE,8BACA,yBAGF,2BACE,0BACA,uBACA,aACA,UAEA,6BACE,iBAIJ,eACE,aACA,eAEA,iBACE,eACA,qBAGF,2BACE,eACA,eAEA,6BACE,kB;AChFR,MACE,4CAOA,kBACA,MACA,OACA,SACA,WATA,sCAEE,gDASF,sBACE,oBACA,gCAGF,wBACE,sBACA,kCAIA,qFACE,qCAIJ,yBACE,eACE,uDAEA,qCACE,sCAKN,yBACE,oCAEE,wDAEA,gFACE,iDACA,8BAGF,sEACE,wDACA,iCACA,8CACA,sCACA,2CACA,kCACA,mCAGF,sEACE,oCAGF,4EACE,8BACA,gCAKN,yBACE,uBACE,4BAIJ,cACE,cAIA,yCACE,sBAGF,sBACE,qBAGF,eACE,WACA,cAGF,6BACE,kBACA,mBACA,sBACA,cAEA,yCACE,aACA,mBAIJ,6BACE,iBAEA,yCACE,kBACA,eAIJ,qDACE,qBACA,YACA,kCACA,uBAEA,uEACE,gBAGF,+EACE,wBAGF,mEACE,yBAMA,wCACE,aAIJ,iCACE,yBAGF,8BACE,cACA,eACA,iBACA,sBACA,wBACA,yBAEA,0CACE,eACA,gBACA,0BAGF,oCACE,sBAIJ,uCACE,WACA,YACA,yBAGF,qCACE,kBACA,qBACA,iBACA,WACA,6BACA,wBACA,gBAEA,iDACE,8BACA,SAQJ,sCACE,cACA,kBAGF,2DACE,oBACA,gBAGF,sCACE,cACA,oBAGF,uEACE,mBACA,gBACA,iBACA,uB;ACjNR,eACE,qBAEA,mBACE,kBACA,WACA,YAEA,sCACE,qB;ACTN,aACE,WACA,WACA,aACA,mBACA,uBACA,sBAEA,0BARF,aASI,aAGF,sBACE,YACA,uBAGF,oBACE,kBACA,sBAGF,0BACE,kBACA,kCAEA,8EAEE,wCAIJ,0BACE,mBACA,gBACA,4BACA,uBAEA,4BACE,0BACA,iB;ACxCN,cACE,aACA,mBACA,uBACA,6BAEA,+BACE,sBAGF,+BACE,cAGF,2BACE,kCACA,kBACA,kBACA,gBACA,uB;ACnBJ,OACE,SACA,oBACA,gBACA,kBACA,eAEA,uBACE,kBACA,YACA,WACA,2BACA,WACA,iBACA,mBACA,uBACA,qBAGF,WACE,kBACA,OACA,MACA,WACA,YACA,iB;ACzBJ,SACE,gBACA,2BACA,kBACA,qBACA,kBAEA,kBACE,kBAGF,+BACE,2BACA,WACA,YACA,kBACA,OACA,MACA,yDACA,WACA,aACA,mBACA,uBACA,kDACA,yBACA,gBACA,iBAGF,gBACE,kBACA,OACA,MACA,WACA,YACA,0BACA,gCACA,6DAGF,oEAGE,sBACA,mBAGF,oBACE,cACA,yBACA,gBACA,mBACA,gBACA,uBAGF,qBACE,eACA,gBACA,uBACA,sBAGF,iDAEE,gBACA,kCACA,qBACA,mBACA,oBACA,qBACA,4BACA,gBAGF,sBACE,kBAGF,kCACE,sBACA,uBAGF,kBACE,2BAEA,iEAEE,UACA,QAGF,2BACE,iB;AC9FN,oDACE,aAaA,mBACA,oBAZA,0CACE,sBAGF,eACE,0BACA,qBAFF,eAGI,6BAOJ,iBACE,2DAGF,cAGE,gBACA,yBACA,kDACA,gCACA,aACA,mBACA,uBACA,sBAGF,iBACE,MACA,OACA,kBAGF,yBACE,qBACA,cACA,kBACA,WACA,4BAEA,cACE,gBACA,wBACA,yBAGF,UACE,cACA,kBACA,MACA,QACA,iCACA,2BACA,qFACA,mCACA,mBACA,qCACA,qBAIJ,sBACE,gBACA,qEAEA,yBAEE,kDACA,yBAGF,gBACE,oBAIJ,UACE,iBACA,kBACA,MACA,QACA,eACA,gBACA,aACA,mBACA,uBACA,UACA,wBACA,wCAGF,cACE,gEAGE,cACE,2DAGF,SACE,kEAEA,SACE,wDAIJ,SACE,kBAKN,mBACE,qBACA,mBACA,gBACA,YACA,wBAEA,gBACE,kCACA,kBACA,mBACA,mBAIJ,cACE,mBACA,gBACA,gBACA,uBACA,0BAEA,mBACE,sBAIJ,iBACE,qBACA,6BACA,eACA,gBACA,uBACA,wCAGE,aACE,eAKN,2CACE,yCACA,8GAEA,UAIE,YACA,0BAGF,sBACE,iCAEA,0BACE,0BAIJ,oBACE,2BAGF,eACE,8BAGF,gBACE,2KAMF,kBAGE,eACA,qDAGF,gBACE,iEAEA,cACE,mBACA,yDAIJ,SACE,QACA,+CAQJ,mCACE,qDAGF,qCACE,mDAGF,wCACE,C;ACxOJ,OACE,aACA,uBAEA,mBACE,iBAGF,WACE,4CACA,oDACA,qEACA,qEAEA,uBACE,sCACA,uCAGF,mBACE,yCACA,0CACA,wDACA,2CAEA,+BACE,4BACA,mCAKN,oBACE,wBAEA,4BACE,WACA,YACA,yBAEA,8BACE,mBACA,qBAIJ,sBACE,kBAEA,gCACE,oBACA,yBAFF,gCAGI,sBAKN,+DACE,UACA,mBACA,uEAGF,yJAIE,UACA,qBAIJ,sBACE,oBAEA,mCACE,oBAIJ,wBACE,kBACA,0BACA,2BACA,UACA,YACA,WACA,6CACA,UAEA,0BACE,mBAIJ,+BACE,UACA,SACA,6CAGF,gBACE,kBACA,YACA,YACA,mBAGF,oBACE,aACA,8BAGF,cACE,gBACA,SACA,iBACA,gBACA,uBAGF,uBACE,kBACA,kBACA,kCAEA,4BACE,mBACA,iBACA,oBACA,sBAIJ,sCACE,2BAGF,iBACE,eACA,gBAGF,4CAGE,kBACA,cACA,kCACA,SAGF,iBACE,oBACA,kBACA,kCACA,mBACA,gBACA,uBAGF,iBACE,uBACA,iBACA,uBACA,YACA,kBACA,iBACA,QACA,eAEA,yBACE,WACA,kBACA,WACA,SACA,QACA,WACA,mDACA,kBAIJ,kEACE,kBACA,WACA,kBACA,gBACA,WACA,QACA,SAEA,sEACE,kBACA,WACA,iDACA,WACA,kBACA,WAIJ,qCACE,8DAGF,uBACE,kBACA,WACA,QACA,OAEA,yBACE,oBACA,kBACA,WACA,WAEA,gCACE,WACA,kBACA,SACA,YACA,WACA,YACA,kBACA,2CAMJ,uBACE,oBAGF,qBACE,mBACA,gBACA,uBACA,gBACA,mBAGF,iEAGE,sBAGF,wBACE,QACA,oBAGF,wBACE,iBAGF,6BACE,aACA,cAIA,sCACE,qBACA,QAKN,mCACE,cACA,eAIA,6BACE,kBACA,eAEA,qCACE,mBACA,eAIJ,mDAEE,iBAGF,iCACE,UACA,a;ACvSN,cACE,WACA,YACA,eACA,kBAEA,8BACE,WACA,iBAGF,iCACE,kBACA,OACA,MACA,WAGF,+BACE,WACA,YAGF,iHAIE,aACA,mBACA,uBACA,yBACA,wEACA,eAGF,uBACE,gBAGF,2DAEE,gB;ACzCJ,aACE,iBACA,kBAEA,kCACE,qBACE,WACA,iBACA,WAGF,oBACE,cACA,WACA,YAIJ,4BACE,WACA,kBACA,OACA,MACA,SAEA,wCACE,WACA,YAIJ,2BACE,kBACA,WACA,eACA,kBACA,UAEA,aACA,UACA,OAGF,yBACE,cACA,oCACA,WACA,sBACA,iBAEA,iCACE,UAIJ,yBACE,kBACA,MACA,SACA,UACA,YACA,UACA,SACA,wCACA,iCACA,wBACA,YACA,wBACA,aACA,eACA,UAEA,sEACE,UAGF,8BACE,OACA,yDACA,gCAGF,8BACE,QACA,yDACA,6CAIJ,mBACE,kBACA,SACA,OACA,WACA,iBACA,uBACA,+EACA,yBACA,aACA,sBACA,yBACA,oBAGE,oCACE,iBACA,uBAKF,oCACE,iBACA,uBAKN,oBACE,aACA,mBAEA,uBACE,gBACA,kBACA,qBACA,qBACA,sBACA,qBAGF,kCACE,mBACA,qBAGF,2BACE,aACA,cACA,uBAIJ,qBACE,kBACA,WAIA,uCACE,UACA,QACA,qBAGF,uCACE,OACA,WACA,qBAIJ,kBACE,wBACA,gBAEA,wBACE,SAGF,qCACE,UAGF,wBACE,sBAGF,0BACE,+C;ACnLN,YACE,2CACA,mCACA,gBACA,cACA,WACA,mBACA,iBACA,kBACA,uBACA,aACA,cACA,iDAEA,0BAdF,YAeI,gBAGF,oCACE,2BACA,mDAGF,wBACE,oBAGF,uBACE,gBAGF,4BACE,oBACA,2CACA,oBACA,cACA,aACA,sBACA,mBACA,uBACA,oCAGF,kBACE,kBACA,sBACA,sBAEA,0BALF,kBAMI,kBACA,mBACA,oBAGF,0BAXF,kBAYI,eACA,iBACA,oBACA,mBAIJ,mBACE,oBACA,gBACA,uBAEA,0BALF,mBAMI,gBAIJ,yBACE,eACA,oBAEA,0BAJF,yBAKI,mB;AC7EN,sBACE,kBACA,WACA,YACA,2BACA,4DAEA,6CACE,2BAGF,+BACE,wB;ACZJ,UACE,kBACA,MACA,QACA,OACA,aACA,2BACA,uBAEA,aACA,sBAEA,kCACE,iD;ACbJ,eACE,qBACA,WACA,YACA,aACA,kDACA,wCACA,wBACA,eACA,kEACA,kBAEA,yBAZF,eAaI,eAGF,0BACE,yBACA,eACA,eAGF,qBACE,YACA,aACA,SAGF,mDACE,kBACA,MACA,OACA,WACA,YAGF,mBACE,mBAGF,sCACE,kBACA,YACA,cACA,cACA,eACA,gBAMA,UAJA,wCACE,eAMJ,qBACE,wDAEA,4CACE,U;AC3DN,eACE,oCAEA,2CACE,kBACA,mCACA,4CACA,sBACA,iDAGF,4BACE,OACA,MACA,UACA,oBACA,4BAEA,mCACE,eAGF,yBAXF,4BAYI,2DAGF,kCACE,uBACA,wBACA,WACA,wBACA,yCAIJ,uDACE,aACA,iBACA,mBAGF,uBACE,UACA,eACA,gBACA,sCAGF,sCACE,YACA,kBACA,eAEA,yBALF,sCAMI,gBAGF,2FACE,WACA,cACA,kBACA,MACA,SACA,WACA,UACA,UACA,4BAGF,8CACE,OACA,wFAGF,6CACE,QACA,uFAIA,wDACE,UAKF,wDACE,UAKN,gCACE,cACA,UACA,4BAEA,sCACE,UAKF,8DACE,UACA,mBAIJ,uBACE,WACA,YACA,eACA,iBACA,iBACA,kDACA,cACA,eAEA,8BACE,iDACA,WAGF,gCACE,WACA,oB;AC9HN,QACE,YACA,aACA,sBACA,gBAEA,uBACE,6BACA,6CACA,aACA,mBACA,cAEA,gBACA,iBAEA,oCACE,oBACA,kBACA,YAGF,qCACE,YACA,YACA,gBACA,UACA,gBAIJ,qBACE,YACA,gBACA,kBACA,cAEA,yBANF,qBAOI,0BACA,4BAIJ,oBACE,YACA,SACA,kBACA,aACA,mBACA,uBACA,kC","sources":["webpack://telegram-t/./src/components/ui/Transition.scss","webpack://telegram-t/./src/components/common/Avatar.scss","webpack://telegram-t/./src/components/ui/ProgressSpinner.scss","webpack://telegram-t/./src/components/ui/Modal.scss","webpack://telegram-t/./src/components/ui/ListItem.scss","webpack://telegram-t/./src/components/common/VerifiedIcon.scss","webpack://telegram-t/./src/components/common/TypingStatus.scss","webpack://telegram-t/./src/components/ui/Notification.scss","webpack://telegram-t/./src/components/ui/Radio.scss","webpack://telegram-t/./src/components/ui/Tab.scss","webpack://telegram-t/./src/components/ui/TabList.scss","webpack://telegram-t/./src/components/common/DeleteChatModal.scss","webpack://telegram-t/./src/components/ui/SearchInput.scss","webpack://telegram-t/./src/components/common/PickerSelectedItem.scss","webpack://telegram-t/./src/components/ui/Switcher.scss","webpack://telegram-t/./src/components/common/MessageOutgoingStatus.scss","webpack://telegram-t/./src/components/common/LastMessageMeta.scss","webpack://telegram-t/./src/components/left/main/Badge.scss","webpack://telegram-t/./src/components/left/main/Chat.scss","webpack://telegram-t/./src/components/common/AnimatedEmoji.scss","webpack://telegram-t/./src/components/left/main/EmptyFolder.scss","webpack://telegram-t/./src/components/common/NothingFound.scss","webpack://telegram-t/./src/components/common/Media.scss","webpack://telegram-t/./src/components/common/WebLink.scss","webpack://telegram-t/./src/components/common/File.scss","webpack://telegram-t/./src/components/common/Audio.scss","webpack://telegram-t/./src/components/common/ProfilePhoto.scss","webpack://telegram-t/./src/components/common/ProfileInfo.scss","webpack://telegram-t/./src/components/middle/composer/DropTarget.scss","webpack://telegram-t/./src/components/ui/FloatingActionButton.scss","webpack://telegram-t/./src/components/middle/composer/DropArea.scss","webpack://telegram-t/./src/components/common/StickerButton.scss","webpack://telegram-t/./src/components/middle/composer/TextFormatter.scss","webpack://telegram-t/./src/components/common/Picker.scss"],"sourcesContent":[".Transition {\n position: relative;\n\n > * {\n width: 100%;\n height: 100%;\n animation-fill-mode: forwards !important;\n transition: background-color .2s;\n\n &.from, &.to {\n position: absolute;\n top: 0;\n left: 0;\n }\n\n &:not(.active):not(.from):not(.to) {\n display: none !important; // Best performance when animating container\n //transform: scale(0); // Shortest initial delay\n }\n }\n\n &.skip-slide-transition {\n transition: none !important;\n }\n\n /*\n * slide\n */\n\n &.slide {\n > .to {\n transform: translateX(100%);\n }\n\n &.animating {\n > .from {\n animation: slide-out var(--slide-transition);\n }\n\n > .to {\n animation: slide-in var(--slide-transition);\n }\n }\n }\n\n &.slide.backwards {\n > .to {\n transform: translateX(-100%);\n }\n\n &.animating {\n > .from {\n animation: slide-in-backwards var(--slide-transition);\n }\n\n > .to {\n animation: slide-out-backwards var(--slide-transition);\n }\n }\n }\n\n\n &.slide-reversed {\n > .to {\n transform: translateX(-100%);\n }\n\n &.animating {\n > .from {\n animation: slide-out var(--slide-transition);\n }\n\n > .to {\n animation: slide-in var(--slide-transition);\n }\n }\n\n &.backwards {\n > .to {\n transform: translateX(100%);\n }\n\n &.animating {\n > .from {\n animation: slide-in-backwards var(--slide-transition);\n }\n\n > .to {\n animation: slide-out-backwards var(--slide-transition);\n }\n }\n }\n }\n\n /*\n * mv-slide\n */\n\n &.mv-slide {\n > * > div {\n animation-fill-mode: forwards !important;\n }\n\n > .to > div {\n transform: translateX(100vw);\n }\n\n &.animating {\n > .from > div {\n animation: mv-slide-out .4s ease;\n }\n\n > .to > div {\n animation: mv-slide-in .4s ease;\n }\n }\n }\n\n &.mv-slide.backwards {\n > .to > div {\n transform: translateX(-100vw);\n }\n\n &.animating {\n > .from > div {\n animation: mv-slide-in-backwards .4s ease;\n }\n\n > .to > div {\n animation: mv-slide-out-backwards .4s ease;\n }\n }\n }\n\n /*\n * slide-fade\n */\n &.slide-fade {\n > .from {\n transform-origin: left;\n transform: translateX(0);\n opacity: 1;\n }\n\n > .to {\n transform-origin: left;\n transform: translateX(1.5rem);\n opacity: 0;\n }\n\n &.animating {\n > .from {\n animation: fade-out-opacity var(--slide-transition), slide-fade-out-move var(--slide-transition);\n }\n\n > .to {\n animation: fade-in-opacity var(--slide-transition), slide-fade-in-move var(--slide-transition);\n }\n }\n }\n\n &.slide-fade.backwards {\n > .from {\n transform: translateX(0);\n opacity: 1;\n }\n\n > .to {\n transform: translateX(-1.5rem);\n opacity: 0;\n }\n\n &.animating {\n > .from {\n animation: fade-in-backwards-opacity var(--slide-transition), slide-fade-in-backwards-move var(--slide-transition);\n }\n\n > .to {\n animation: fade-out-backwards-opacity var(--slide-transition), slide-fade-out-backwards-move var(--slide-transition);\n }\n }\n }\n\n /*\n * zoom-fade\n */\n &.zoom-fade {\n > .from {\n transform-origin: center;\n transform: scale(1);\n opacity: 1;\n }\n\n > .to {\n transform-origin: center;\n opacity: 0;\n // We can omit `transform: scale(1.1);` here because `opacity` is 0.\n // We need to for proper position calculation in `InfiniteScroll`.\n }\n\n &.animating {\n > .from {\n animation: fade-out-opacity .15s ease;\n }\n\n > .to {\n animation: fade-in-opacity .15s ease, zoom-fade-in-move .15s ease;\n }\n }\n }\n\n &.zoom-fade.backwards {\n > .from {\n transform: scale(1);\n }\n\n > .to {\n transform: scale(0.95);\n }\n\n &.animating {\n > .from {\n animation: fade-in-backwards-opacity .1s ease, zoom-fade-in-backwards-move .15s ease;\n }\n\n > .to {\n animation: fade-out-backwards-opacity .15s ease, zoom-fade-out-backwards-move .15s ease;\n }\n }\n }\n\n /*\n * fade\n */\n &.fade {\n > .from {\n opacity: 1;\n }\n\n > .to {\n opacity: 0;\n }\n\n &.animating {\n > .from {\n animation: fade-out-opacity .15s ease;\n }\n\n > .to {\n animation: fade-in-opacity .15s ease;\n }\n }\n }\n\n /*\n * slide-layers\n */\n\n &.slide-layers {\n --background-color: var(--color-background);\n background: black;\n\n > div {\n background: var(--background-color);\n }\n\n > .to {\n transform: translateX(100%);\n }\n\n &.animating {\n > .from {\n animation: slide-layers-out var(--layer-transition);\n }\n\n > .to {\n animation: slide-in var(--layer-transition);\n }\n }\n }\n\n &.slide-layers.backwards {\n > .to {\n transform: translateX(-20%);\n opacity: 0.75;\n }\n\n &.animating {\n > .from {\n animation: slide-in-backwards var(--layer-transition);\n }\n\n > .to {\n animation: slide-layers-out-backwards var(--layer-transition);\n }\n }\n }\n\n /*\n * push-slide\n */\n\n &.push-slide {\n > div {\n background: var(--color-background);\n }\n\n > .from {\n transform-origin: center;\n transform: scale(1);\n opacity: 1;\n\n .custom-scroll {\n scrollbar-color: transparent !important;\n\n &::-webkit-scrollbar-thumb {\n background-color: transparent !important;\n }\n }\n }\n\n > .to {\n transform: translateX(100%);\n }\n\n &.animating {\n > .from {\n animation: push-out .3s ease-in-out;\n }\n\n > .to {\n animation: slide-in-200 .3s ease-in-out;\n }\n }\n }\n\n &.push-slide.backwards {\n > .to {\n transform: scale(0.7);\n }\n\n &.animating {\n > .from {\n animation: slide-in-200-backwards .3s ease-in-out;\n }\n\n > .to {\n animation: push-out-backwards .3s ease-in-out;\n }\n }\n }\n\n /*\n * slide-fade\n */\n &.reveal {\n > .to {\n clip-path: inset(0 100% 0 0);\n }\n\n &.animating {\n > .to {\n animation: reveal-in 350ms ease-in;\n }\n }\n }\n\n &.reveal.backwards {\n > .from {\n clip-path: inset(0 0 0 0);\n }\n\n > .to {\n clip-path: none;\n }\n\n &.animating {\n > .from {\n animation: reveal-in-backwards 350ms ease-out;\n }\n\n > .to {\n animation: none;\n }\n }\n }\n}\n\n/*\n * common\n */\n@keyframes fade-in-opacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes fade-out-opacity {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n\n@keyframes fade-in-backwards-opacity {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n\n@keyframes fade-out-backwards-opacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n/*\n * slide\n */\n@keyframes slide-in {\n 0% {\n transform: translateX(100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes slide-out {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-100%);\n }\n}\n\n@keyframes slide-in-backwards {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(100%);\n }\n}\n\n@keyframes slide-out-backwards {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n/*\n * mv-slide\n */\n@keyframes mv-slide-in {\n 0% {\n transform: translateX(100vw);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes mv-slide-out {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-100vw);\n }\n}\n\n@keyframes mv-slide-in-backwards {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(100vw);\n }\n}\n\n@keyframes mv-slide-out-backwards {\n 0% {\n transform: translateX(-100vw);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n/*\n * slide-fade\n */\n@keyframes slide-fade-in-move {\n 0% {\n transform: translateX(1.5rem);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes slide-fade-out-move {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-1.5rem);\n }\n}\n\n@keyframes slide-fade-in-backwards-move {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(1.5rem);\n }\n}\n\n@keyframes slide-fade-out-backwards-move {\n 0% {\n transform: translateX(-1.5rem);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n/*\n * zoom-fade\n */\n@keyframes zoom-fade-in-move {\n 0% {\n transform: scale(1.1);\n }\n 100% {\n transform: scale(1);\n }\n}\n\n@keyframes zoom-fade-in-backwards-move {\n 0% {\n transform: scale(1);\n }\n 100% {\n transform: scale(1.1);\n }\n}\n\n@keyframes zoom-fade-out-backwards-move {\n 0% {\n transform: scale(0.95);\n }\n 100% {\n transform: scale(1);\n }\n}\n\n/*\n * slide-layers\n */\n@keyframes slide-layers-out {\n 0% {\n transform: translateX(0);\n opacity: 1;\n }\n 100% {\n transform: translateX(-20%);\n opacity: calc(1 - var(--layer-blackout-opacity));\n }\n}\n\n@keyframes slide-layers-out-backwards {\n 0% {\n transform: translateX(-20%);\n opacity: calc(1 - var(--layer-blackout-opacity));\n }\n 100% {\n transform: translateX(0);\n opacity: 1;\n }\n}\n\n/*\n * push-slide\n */\n\n@keyframes push-out {\n 0% {\n transform: scale(1);\n opacity: 1;\n }\n 100% {\n transform: scale(0.7);\n opacity: 0;\n }\n}\n\n@keyframes push-out-backwards {\n 0% {\n transform: scale(0.7);\n opacity: 0;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n}\n\n/*\n * slide\n */\n@keyframes slide-in-200 {\n 0% {\n transform: translateX(200%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes slide-in-200-backwards {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(200%);\n }\n}\n\n/*\n * slide\n */\n@keyframes reveal-in {\n 0% {\n clip-path: inset(0 100% 0 0);\n }\n 100% {\n clip-path: inset(0 0 0 0);\n }\n}\n\n/*\n * slide\n */\n@keyframes reveal-in-backwards {\n 0% {\n clip-path: inset(0 0 0 0);\n }\n 100% {\n clip-path: inset(0 100% 0 0);\n }\n}\n",".Avatar {\n --color-user: var(--color-primary);\n flex: none;\n align-items: center;\n justify-content: center;\n width: 3.375rem;\n height: 3.375rem;\n border-radius: 50%;\n background: linear-gradient(var(--color-white) -125%, var(--color-user));\n color: white;\n font-weight: bold;\n display: flex;\n white-space: nowrap;\n\n img:not(.emoji) {\n border-radius: 50%;\n }\n\n .emoji {\n width: 1rem;\n height: 1rem;\n }\n\n i {\n font-size: 2.5rem;\n }\n\n &.size-micro {\n width: 1rem;\n height: 1rem;\n font-size: 0.5125rem;\n\n .emoji {\n width: .5625rem;\n height: .5625rem;\n }\n }\n\n &.size-tiny {\n width: 2rem;\n height: 2rem;\n font-size: .875rem;\n\n .emoji {\n width: .875rem;\n height: .875rem;\n }\n }\n\n &.size-small {\n width: 2.125rem;\n height: 2.125rem;\n font-size: 0.875rem;\n\n .emoji {\n width: .875rem;\n height: .875rem;\n }\n }\n\n &.size-medium {\n width: 2.75rem;\n height: 2.75rem;\n font-size: 1.1875rem;\n\n .emoji {\n width: 1rem;\n height: 1rem;\n }\n }\n\n &.size-large {\n font-size: 1.3125rem;\n\n i {\n font-size: 3.5rem;\n }\n\n .emoji {\n width: 1.3125rem;\n height: 1.3125rem;\n }\n }\n\n &.size-jumbo {\n width: 7.5rem;\n height: 7.5rem;\n font-size: 3.5rem;\n\n i {\n font-size: 6rem;\n }\n\n .emoji {\n width: 3.5rem;\n height: 3.5rem;\n }\n }\n\n &.online {\n position: relative;\n\n &::after {\n content: '';\n display: block;\n position: absolute;\n bottom: 0.05rem;\n right: 0.05rem;\n width: 0.875rem;\n height: 0.875rem;\n border-radius: 50%;\n border: 2px solid var(--color-background);\n background-color: #0ac630;\n flex-shrink: 0;\n }\n }\n\n &.interactive {\n cursor: pointer;\n }\n\n img:not(.emoji) {\n width: 100%;\n height: 100%;\n }\n}\n",".ProgressSpinner {\n position: relative;\n z-index: 1;\n width: 3.375rem;\n height: 3.375rem;\n background: rgba(0, 0, 0, .25) url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkiIGhlaWdodD0iMTkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjcxNyA5Ljc1TDE4LjMgMi4xNjdhLjY4NC42ODQgMCAxMC0uOTY3LS45NjdMOS43NSA4Ljc4MyAyLjE2NyAxLjJhLjY4NC42ODQgMCAxMC0uOTY3Ljk2N0w4Ljc4MyA5Ljc1IDEuMiAxNy4zMzNhLjY4NC42ODQgMCAxMC45NjcuOTY3bDcuNTgzLTcuNTgzIDcuNTgzIDcuNTgzYS42ODEuNjgxIDAgMDAuOTY3IDAgLjY4NC42ODQgMCAwMDAtLjk2N0wxMC43MTcgOS43NXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjRkZGIiBzdHJva2Utd2lkdGg9Ii43NSIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==) no-repeat 49% 49%;\n border-radius: 50%;\n cursor: pointer;\n\n &.no-cross {\n background: transparent !important;\n pointer-events: none;\n }\n\n &.square {\n background-image: none;\n\n &::after {\n content: '';\n position: absolute;\n width: .8125rem;\n height: .8125rem;\n border-radius: .125rem;\n background-color: #fff;\n left: 50%;\n top: 50%;\n transform: translate3d(-50%, -50%, 0);\n }\n }\n\n &.size-s, &.size-m {\n width: auto;\n height: auto;\n background: transparent url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTguMjE4IDcuNWw1LjYzMy01LjYzM2EuNTA4LjUwOCAwIDEwLS43MTgtLjcxOEw3LjUgNi43ODIgMS44NjcgMS4xNDlhLjUwOC41MDggMCAxMC0uNzE4LjcxOEw2Ljc4MiA3LjVsLTUuNjMzIDUuNjMzYS41MDguNTA4IDAgMTAuNzE4LjcxOEw3LjUgOC4yMThsNS42MzMgNS42MzNhLjUwNi41MDYgMCAwMC43MTggMCAuNTA4LjUwOCAwIDAwMC0uNzE4TDguMjE4IDcuNXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjRkZGIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+) no-repeat 49% 49%;\n\n &.square {\n background-image: none;\n width: .75rem;\n height: .75rem;\n }\n }\n\n &.size-xl {\n width: 3.25rem;\n height: 3.25rem;\n\n svg {\n width: 3rem;\n height: 3rem;\n margin: .125rem;\n }\n\n circle {\n stroke-width: 3px;\n }\n }\n\n &.transparent {\n background-color: transparent !important;\n }\n\n svg {\n display: block;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n animation: 4s linear 0s infinite ProgressSpinnerAnimation;\n }\n\n circle {\n transition: stroke-dashoffset .5s;\n }\n}\n\n@keyframes ProgressSpinnerAnimation {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n",".Modal {\n position: relative;\n z-index: var(--z-modal);\n\n &.delete, &.error, &.confirm, &.pin, &.unpin-all {\n .modal-dialog {\n max-width: 23rem;\n }\n }\n\n &.error {\n .modal-content > div {\n margin-top: 1rem;\n }\n }\n\n &.narrow {\n .modal-dialog {\n max-width: 20rem;\n }\n }\n\n &.report {\n .modal-dialog {\n max-width: 15rem;\n }\n }\n\n .modal-container {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .modal-backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n background-color: rgba(0, 0, 0, .25);\n }\n\n &.transparent-backdrop .modal-backdrop {\n background-color: transparent;\n }\n\n .modal-dialog {\n position: relative;\n display: inline-flex;\n flex-direction: column;\n width: 100%;\n max-width: 35rem;\n min-width: 17.5rem;\n margin: 2rem auto;\n background-color: var(--color-background);\n box-shadow: 0 .25rem .5rem .125rem var(--color-default-shadow);\n border-radius: var(--border-radius-default);\n transform: translate3d(0, -1rem, 0);\n\n transition: transform .2s ease, opacity .2s ease;\n\n body.animation-level-0 & {\n transition: none;\n transform: none !important;\n }\n\n @media (max-width: 450px) {\n max-width: calc(100vw - 3rem) !important;\n }\n }\n\n &.open .modal-dialog {\n transform: translate3d(0, 0, 0);\n }\n\n &.closing .modal-dialog {\n transform: translate3d(0, 1rem, 0);\n }\n\n .modal-header {\n padding: 1rem 1rem 0;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .modal-title {\n font-size: 1.25rem;\n font-weight: 500;\n flex: 1 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &:not(:only-child) {\n margin: 0 1.3125rem;\n }\n }\n\n .modal-header-condensed {\n @extend .modal-header;\n padding: .5rem 1.25rem 0 .9375rem !important;\n\n .modal-action-button {\n font-size: 0.875rem;\n height: 2.25rem;\n width: auto;\n line-height: 1.625rem;\n margin-left: auto;\n padding-left: 1.25rem;\n padding-right: 1.25rem;\n min-width: 5rem;\n }\n }\n\n .modal-content {\n width: 100%;\n flex-grow: 1;\n padding: 1rem;\n overflow-y: auto;\n\n b,\n strong {\n word-break: break-word;\n }\n }\n\n .modal-title,\n .modal-content,\n .modal-content > p {\n unicode-bidi: plaintext;\n text-align: initial;\n }\n\n .dialog-buttons {\n display: flex;\n align-items: flex-end;\n\n .confirm-dialog-button + .confirm-dialog-button {\n margin-left: 1rem;\n }\n }\n\n .confirm-dialog-button {\n width: auto;\n height: auto;\n margin-left: auto;\n text-align: right;\n font-weight: 500;\n white-space: pre-wrap;\n }\n}\n",".ListItem {\n position: relative;\n\n body.is-ios &, body.is-android & {\n &:not(:last-of-type)::after {\n content: \"\";\n position: absolute;\n bottom: 0;\n left: 4.5rem;\n right: 0;\n height: 0.03125rem;\n background: var(--color-dividers);\n }\n\n &.small-icon::after {\n left: 3.875rem;\n }\n\n &.no-icon::after {\n left: 0;\n }\n }\n\n // Using half-pixel height is efficient on iOS but not supported on Android, so `transform` is used instead\n body.is-android & {\n &:not(:last-of-type)::after {\n height: 0.0625rem;\n transform: scaleY(0.25);\n }\n }\n\n .ListItem-button {\n width: 100%;\n background-color: var(--background-color);\n border: none !important;\n box-shadow: none !important;\n outline: none !important;\n display: flex;\n padding: 1rem;\n position: relative;\n overflow: hidden;\n line-height: 1.5rem;\n white-space: nowrap;\n color: var(--color-text);\n border-radius: var(--border-radius-default);\n --ripple-color: rgba(0, 0, 0, .08);\n\n > i {\n font-size: 1.5rem;\n margin-right: 2rem;\n color: var(--color-text-secondary);\n }\n }\n\n .user-status, .group-status, .title, .subtitle {\n text-align: initial;\n unicode-bidi: plaintext;\n }\n\n &.multiline {\n .ListItem-button > i {\n position: relative;\n top: .25rem;\n }\n }\n\n &.disabled {\n pointer-events: none;\n\n .ListItem-button {\n opacity: 0.5;\n }\n }\n\n &:not(.disabled):not(.is-static) {\n .ListItem-button {\n cursor: pointer;\n\n @media (hover: hover) {\n &:hover, &:focus {\n --background-color: var(--color-chat-hover);\n }\n }\n\n @media (max-width: 600px) {\n &.active {\n --background-color: var(--color-chat-hover);\n }\n }\n }\n }\n\n @media (min-width: 600px) {\n &:not(.has-ripple):not(.is-static),\n body.animation-level-0 & {\n .ListItem-button:active {\n --background-color: var(--color-item-active) !important;\n }\n }\n }\n\n &.has-menu-open .ListItem-button {\n --background-color: var(--color-chat-hover);\n }\n\n &.narrow {\n margin-bottom: 0.75rem;\n\n .ListItem-button {\n padding: 0.5rem 1rem;\n }\n }\n\n &.inactive {\n pointer-events: none;\n }\n\n &.focus {\n --background-color: var(--color-chat-hover);\n }\n\n &.destructive {\n .ListItem-button {\n color: var(--color-error);\n\n i {\n color: inherit;\n }\n }\n }\n\n &-context-menu {\n position: absolute;\n\n .bubble {\n width: auto;\n\n .MenuItem button {\n padding-left: 1rem !important;\n padding-right: 2rem !important;\n }\n }\n }\n\n &.chat-item-clickable {\n margin: 0 -0.5rem;\n\n body.is-ios &,\n body.is-macos & {\n --color-text-secondary: var(--color-text-secondary-apple);\n }\n\n .ListItem-button {\n padding: .5625rem .6975rem .5625rem .5625rem;\n }\n\n .Avatar {\n flex-shrink: 0;\n margin-right: 0.5rem;\n }\n\n .info {\n flex-grow: 1;\n overflow: hidden;\n }\n\n .title, .subtitle {\n overflow: hidden;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n }\n\n h3, .last-message, .status, .typing-status {\n font-size: 1rem;\n line-height: 1.6875rem;\n margin: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-align: initial;\n }\n\n .title {\n h3 {\n font-weight: 500;\n }\n\n .VerifiedIcon {\n width: 1.25rem;\n height: 1.25rem;\n margin-left: 0.25rem;\n }\n\n .emoji {\n vertical-align: text-bottom;\n background-position: 0 0;\n flex-shrink: 0;\n }\n }\n\n .contact-phone,\n .contact-username {\n font-size: 0.875rem;\n line-height: 1.25rem;\n color: var(--color-text-secondary);\n }\n\n .ChatInfo {\n display: flex;\n align-items: center;\n flex-grow: 1;\n overflow: hidden;\n\n .status, .typing-status {\n font-size: 0.875rem;\n line-height: 1.25rem;\n color: var(--color-text-secondary);\n display: inline-block;\n\n &.online {\n color: var(--color-primary);\n }\n\n &[dir=rtl],\n &[dir=auto] {\n text-align: initial;\n width: 100%;\n }\n\n .group-status:only-child,\n .user-status:only-child {\n display: flow-root;\n }\n }\n }\n\n .contact-phone,\n .contact-username,\n h3, .last-message, .status, .typing-status {\n text-align: initial;\n unicode-bidi: plaintext;\n }\n\n .last-message,\n .status,\n .typing-status {\n body.is-ios &,\n body.is-macos & {\n font-size: .9375rem;\n }\n }\n\n &[dir=rtl] {\n .ListItem-button {\n padding: .5625rem .5625rem .5625rem .6975rem;\n }\n\n .Avatar {\n margin-left: 0.5rem;\n margin-right: 0;\n }\n\n .info > .status {\n width: 100%;\n }\n }\n }\n\n &.search-result-message {\n .title {\n padding-right: .15rem;\n }\n\n h3 {\n max-width: 80%;\n }\n\n h3, .subtitle {\n font-size: 1rem;\n line-height: 1.5rem;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-align: left;\n }\n\n .LastMessageMeta {\n margin-left: auto;\n margin-right: 0;\n }\n\n .subtitle {\n color: var(--color-text-secondary);\n margin-right: 2rem;\n\n .matching-text-highlight {\n color: var(--color-text);\n background: #CAE3F7;\n border-radius: 0.25rem;\n padding: 0 0.125rem;\n }\n }\n\n &[dir=rtl] {\n .LastMessageMeta {\n margin-left: 0;\n margin-right: auto;\n }\n\n .subtitle {\n margin-right: 0;\n display: block;\n }\n }\n }\n\n &.picker-list-item {\n margin: 0;\n\n .ListItem-button {\n padding-left: 0;\n display: flex;\n align-items: center;\n }\n\n .Avatar {\n width: 3rem;\n height: 3rem;\n }\n\n .Checkbox {\n flex-shrink: 0;\n height: 1.5rem;\n margin: 0;\n padding-left: 4rem;\n }\n\n &[dir=rtl] {\n .Checkbox {\n padding-left: 0;\n padding-right: 4rem;\n }\n }\n }\n\n .multiline-item {\n white-space: initial;\n overflow: hidden;\n\n .title, .subtitle {\n display: block;\n text-align: initial;\n }\n\n .title {\n line-height: 1.25rem;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .subtitle {\n font-size: 0.875rem;\n line-height: 1.5rem;\n color: var(--color-text-secondary);\n\n & + .subtitle {\n margin-top: -0.25rem;\n }\n\n &.black {\n color: var(--color-text);\n }\n }\n }\n\n &[dir=rtl] {\n .ListItem-button > i {\n margin-left: 2rem;\n margin-right: 0;\n }\n }\n}\n",".VerifiedIcon {\n display: inline-block;\n flex-shrink: 0;\n width: 1.5rem;\n height: 1.5rem;\n background-image: url('../../assets/icon-verified.svg');\n background-repeat: no-repeat;\n background-size: 100%;\n background-position: center;\n}\n",".typing-status {\n display: flex;\n align-items: baseline;\n\n .sender-name {\n &::after {\n content: '\\00a0';\n color: var(--color-text-secondary);\n }\n }\n\n .ellipsis {\n display: flex;\n width: 1rem;\n overflow: hidden;\n\n &::after {\n content: '...';\n animation: typing-animation 1s steps(4, start) infinite;\n\n html[lang=ar] &,\n html[lang=fa] & {\n animation-name: typing-animation-rtl;\n }\n }\n }\n}\n\n@keyframes typing-animation {\n from {\n transform: translateX(-1rem);\n }\n}\n\n@keyframes typing-animation-rtl {\n from {\n transform: translateX(1rem);\n }\n}\n",".Notification-container {\n position: relative;\n width: 24rem;\n max-width: 100vw;\n margin: .25rem auto;\n z-index: var(--z-notification);\n\n @media (min-width: 1276px) {\n transition: transform var(--layer-transition);\n }\n\n &:first-of-type {\n margin-top: 4.25rem;\n\n .has-header-tools & {\n margin-top: 7.375rem;\n }\n }\n}\n\n.Notification {\n background: rgba(32, 32, 32, .8) url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiNGRkYiIGN4PSIxMiIgY3k9IjEyIiByPSIxMiIvPjxjaXJjbGUgZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJub256ZXJvIiBjeD0iMTIiIGN5PSI2LjUiIHI9IjEuNSIvPjxwYXRoIGQ9Ik0xMiA5LjVjLS41NTIgMC0xIC4zNy0xIC44MjZ2Ny4zNDhjMCAuNDU2LjQ0OC44MjYgMSAuODI2czEtLjM3IDEtLjgyNnYtNy4zNDhjMC0uNDU2LS40NDgtLjgyNi0xLS44MjZ6IiBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+\") no-repeat .9375rem 50%;\n background-size: 1.5rem;\n border-radius: var(--border-radius-default);\n padding: .9375rem .9375rem .9375rem 3.375rem;\n color: #fff;\n margin: 0 .5rem;\n\n .text-entity-link,\n .text-entity-link:hover,\n .text-entity-link:active {\n color: #fff !important;\n text-decoration: underline;\n }\n\n .content {\n line-height: 1.25;\n word-break: break-word;\n font-size: .9375rem;\n }\n}\n",".Radio {\n display: block;\n position: relative;\n padding-left: 4.5rem;\n text-align: left;\n margin-bottom: 1.5rem;\n line-height: 1.5rem;\n cursor: pointer;\n\n &.disabled {\n pointer-events: none;\n opacity: 0.5;\n }\n\n &.hidden-widget {\n cursor: default;\n .Radio-main {\n &::before, &::after {\n visibility: hidden;\n }\n }\n }\n\n > input {\n position: absolute;\n z-index: var(--z-below);\n opacity: 0;\n }\n\n .Radio-main {\n &::before, &::after {\n content: '';\n display: block;\n position: absolute;\n left: 1.0625rem;\n top: 50%;\n width: 1.25rem;\n height: 1.25rem;\n transform: translateY(-50%);\n }\n\n &::before {\n border: 2px solid var(--color-borders-input);\n border-radius: 50%;\n background-color: var(--color-background);\n opacity: 1;\n transition: border-color .1s ease, opacity .1s ease;\n }\n\n &::after {\n left: 1.375rem;\n width: 0.625rem;\n height: 0.625rem;\n border-radius: 50%;\n background: var(--color-primary);\n opacity: 0;\n transition: opacity .1s ease;\n }\n\n .label {\n display: block;\n word-break: break-word;\n unicode-bidi: plaintext;\n text-align: left;\n }\n\n .subLabel {\n display: block;\n font-size: 0.875rem;\n line-height: 1rem;\n color: var(--color-text-secondary);\n unicode-bidi: plaintext;\n }\n }\n\n input:checked ~ .Radio-main {\n &::before {\n border-color: var(--color-primary);\n }\n\n &::after {\n opacity: 1;\n }\n }\n\n &.loading {\n .Radio-main::before,\n .Radio-main::after {\n opacity: 0 !important;\n }\n\n .Spinner {\n position: absolute;\n left: 1.0625rem;\n top: 50%;\n transform: translateY(-50%);\n opacity: 0;\n animation: fade-in .2s ease forwards;\n --spinner-size: 1.25rem;\n }\n }\n\n &[dir=rtl] {\n padding-left: 0;\n padding-right: 4.5rem;\n\n .Radio-main {\n text-align: right;\n\n &::before {\n left: auto;\n right: 1.0625rem;\n }\n\n &::after {\n left: auto;\n right: 1.375rem;\n }\n }\n\n .label,\n .subLabel {\n text-align: right;\n }\n\n &.loading .Spinner {\n left: auto;\n right: 1.0625rem;\n }\n }\n}\n\n@keyframes fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n",".Tab {\n display: flex;\n justify-content: center;\n flex: 1 1 auto;\n appearance: none;\n background: none;\n width: auto;\n margin: 0;\n border: none;\n padding: .625rem .25rem;\n font-weight: 500;\n color: var(--color-text-secondary);\n cursor: pointer;\n border-top-left-radius: var(--border-radius-messages-small);\n border-top-right-radius: var(--border-radius-messages-small);\n\n &,\n &:active,\n &:focus {\n outline: none;\n }\n\n &.active {\n cursor: default;\n color: var(--color-primary);\n\n i {\n opacity: 1;\n }\n }\n\n &:not(.active):hover {\n background: var(--color-interactive-element-hover);\n }\n\n > span {\n position: relative;\n display: flex;\n align-items: center;\n }\n\n .badge {\n min-width: 1.25rem;\n height: 1.25rem;\n margin-inline-start: 0.5rem;\n background: var(--color-gray);\n border-radius: 0.75rem;\n padding: 0 .3125rem;\n color: white;\n font-size: 0.875rem;\n line-height: 1.3125rem;\n font-weight: 500;\n text-align: center;\n flex-shrink: 0;\n\n body.is-ios &,\n body.is-macos & {\n line-height: 1.25rem;\n }\n\n &.active {\n background: var(--color-primary);\n }\n }\n\n i {\n position: absolute;\n bottom: calc(-.625rem - 1px);\n left: 0;\n opacity: 0;\n background-color: var(--color-primary);\n height: .1875rem;\n width: 100%;\n border-radius: .1875rem .1875rem 0 0;\n pointer-events: none;\n box-sizing: content-box;\n transform-origin: left;\n\n &.animate {\n transition: transform var(--slide-transition);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n }\n }\n}\n",".TabList {\n position: sticky;\n top: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n font-size: .875rem;\n flex-wrap: nowrap;\n box-shadow: 0 2px 2px var(--color-light-shadow);\n background-color: var(--color-background);\n overflow-x: auto;\n overflow-y: hidden;\n\n scrollbar-width: none;\n scrollbar-color: rgba(0, 0, 0, 0);\n\n &.big {\n font-size: 1rem;\n --border-radius-messages-small: 0;\n }\n\n &::-webkit-scrollbar {\n height: 0;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0);\n }\n}\n",".DeleteChatModal {\n .modal-dialog {\n max-width: 20rem;\n }\n\n .modal-header {\n padding: 1.125rem 1.25rem 0;\n }\n\n .modal-title:not(:only-child) {\n margin: 0 0 0 .75rem;\n }\n\n .modal-content {\n padding: .5rem 1.25rem;\n }\n\n .confirm-dialog-button {\n margin-right: -.625rem;\n }\n}\n",".SearchInput {\n position: relative;\n width: 100%;\n color: rgba(var(--color-text-secondary-rgb), 0.5);\n background-color: var(--color-chat-hover);\n border: 2px solid var(--color-chat-hover);\n border-radius: 1.375rem;\n transition: border-color 0.15s ease;\n\n &.with-picker-item {\n display: flex;\n\n .icon-search {\n display: none;\n }\n\n input {\n padding-left: .5rem;\n }\n\n &[dir=rtl] {\n input {\n padding-right: .5rem;\n padding-left: 0;\n }\n }\n }\n\n &.has-focus {\n border-color: var(--color-primary);\n caret-color: var(--color-primary);\n background-color: var(--color-background);\n\n input {\n & + i {\n color: var(--color-primary);\n }\n }\n }\n\n input {\n height: 2.5rem;\n margin-bottom: 0;\n border: none !important;\n border-radius: 1.375rem;\n background-color: transparent !important;\n box-shadow: none !important;\n padding: calc(0.4375rem - var(--border-width)) calc(2.625rem - var(--border-width)) calc(0.5rem - var(--border-width)) calc(2.625rem - var(--border-width));\n\n &::placeholder {\n color: var(--color-placeholders);\n }\n }\n\n > i {\n position: absolute;\n top: .5rem;\n left: .75rem;\n font-size: 1.5rem;\n }\n\n .Loading {\n position: absolute;\n top: .5rem;\n right: .5rem;\n height: 1.5rem;\n\n .Spinner {\n --spinner-size: 1.5rem;\n }\n }\n\n .Button {\n position: absolute;\n top: .125rem;\n right: .125rem;\n font-size: 1rem;\n }\n\n @media (max-width: 600px) {\n input {\n height: 2.5rem;\n border-radius: 1.25rem;\n padding-left: calc(2.625rem - var(--border-width));\n }\n\n i {\n top: 0.5rem;\n }\n }\n\n &[dir=rtl] {\n input {\n direction: rtl;\n }\n\n > i {\n left: auto;\n right: .75rem;\n }\n\n .Loading {\n left: .5rem;\n right: auto;\n }\n\n .Button {\n left: .125rem;\n right: auto;\n }\n }\n}\n",".PickerSelectedItem {\n display: flex;\n align-items: center;\n background: var(--color-chat-hover);\n height: 2rem;\n min-width: 2rem;\n margin-left: 0.5rem;\n margin-bottom: 0.5rem;\n padding-right: 1rem;\n border-radius: 1rem;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n flex-shrink: 1;\n transition: background-color .15s ease;\n\n max-width: calc(50% - 0.5rem);\n\n &.minimized {\n padding-right: 0;\n }\n\n &:hover {\n background-color: var(--color-item-active);\n }\n\n &.closeable:hover {\n background-color: rgba(var(--color-error-rgb), 0.16);\n\n .item-remove {\n opacity: 1;\n }\n\n .Avatar, .item-icon {\n opacity: 0;\n }\n }\n\n &.search-date {\n .item-remove {\n background: var(--color-primary);\n }\n\n &:hover {\n background: var(--color-chat-hover);\n }\n\n .item-name {\n font-size: 0.875rem;\n }\n }\n\n .SearchInput & {\n flex: 1 0 auto;\n position: relative;\n top: .25rem;\n left: -.125rem;\n\n color: var(--color-text-secondary);\n }\n\n .Avatar, .item-icon {\n width: 2rem;\n height: 2rem;\n opacity: 1;\n flex-shrink: 0;\n transition: opacity .15s ease;\n\n i {\n font-size: 2rem;\n }\n }\n\n .item-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0.375rem;\n border-radius: 50%;\n background-color: var(--color-primary);\n color: white;\n\n i {\n font-size: 1.25rem;\n position: relative;\n top: -1px;\n }\n }\n\n .item-name {\n margin-left: 0.5rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n .emoji.emoji-small {\n width: 1.125rem;\n height: 1.125rem;\n background-size: 1.125rem;\n vertical-align: -2px;\n }\n }\n\n .item-remove {\n position: absolute;\n left: 0;\n top: 0;\n width: 2rem;\n height: 2rem;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--color-error);\n font-size: 1.5rem;\n color: white;\n opacity: 0;\n transition: opacity .15s ease;\n }\n\n &[dir=rtl] {\n padding-left: 1rem;\n padding-right: 0;\n\n &.minimized {\n padding-right: 0;\n padding-left: 0;\n }\n\n .SearchInput & {\n left: auto;\n right: -.125rem;\n }\n\n .item-name {\n margin-left: 0;\n margin-right: 0.5rem;\n }\n\n .item-remove {\n left: auto;\n right: 0;\n }\n }\n}\n",".Switcher {\n display: inline-flex;\n align-items: center;\n position: relative;\n margin: 0;\n\n &.disabled {\n pointer-events: none;\n opacity: 0.5;\n }\n\n &.inactive {\n pointer-events: none;\n }\n\n body.animation-level-0 &,\n &.no-animation {\n .widget,\n .widget::after {\n transition: none !important;\n }\n\n .widget:active:after {\n width: 1.125rem;\n }\n }\n\n input {\n height: 0;\n width: 0;\n visibility: hidden;\n position: absolute;\n z-index: var(--z-below);\n opacity: 0;\n }\n\n .widget {\n cursor: pointer;\n text-indent: -999px;\n width: 2.125rem;\n height: 0.875rem;\n background: var(--color-gray);\n display: inline-block;\n border-radius: .5rem;\n position: relative;\n transition: background .2s ease-in;\n }\n\n .widget:after {\n content: '';\n position: absolute;\n top: -.125rem;\n left: 0;\n width: 1.125rem;\n height: 1.125rem;\n background: var(--color-background);\n border-radius: .75rem;\n transition: 0.2s ease-out;\n border: .125rem solid var(--color-gray);\n }\n\n input:checked + .widget {\n background: var(--color-primary);\n }\n\n input:checked + .widget:after {\n left: calc(100% - 1.125rem);\n transform: translateX(calc(-100% + 1.125rem));\n border-color: var(--color-primary);\n }\n\n .widget:active:after {\n width: 1.25rem;\n }\n}\n",".MessageOutgoingStatus {\n width: 1.19rem;\n height: 1.19rem;\n overflow: hidden;\n display: inline-block;\n line-height: 1;\n font-size: 1.1875rem;\n\n i {\n background: var(--background-color);\n }\n\n .icon-message-succeeded {\n padding-left: 0.13rem;\n }\n\n .Transition {\n width: 100%;\n height: 100%;\n }\n}\n",".LastMessageMeta {\n margin-right: .2rem;\n padding: .3rem 0 .15rem;\n flex-shrink: 0;\n font-size: 0.75rem;\n line-height: 1;\n display: flex;\n align-items: center;\n\n .MessageOutgoingStatus {\n color: var(--color-text-meta-colored);\n margin-right: 0.1rem;\n font-size: 1.15rem;\n\n body.is-ios & {\n margin-bottom: -.125rem;\n }\n }\n\n .time {\n color: var(--color-text-meta);\n line-height: 1.15rem;\n }\n}\n",".Badge-transition {\n opacity: 1;\n transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);\n\n &:not(.open) {\n transform: scale(0);\n opacity: 0;\n }\n\n &:not(.shown) {\n display: none;\n }\n\n &.closing {\n transition: transform .2s ease-out, opacity .2s ease-out;\n }\n}\n\n.Badge-wrapper {\n display: flex;\n\n .Badge {\n margin-inline-start: .5rem;\n }\n}\n\n.Badge {\n min-width: 1.5rem;\n height: 1.5rem;\n background: var(--color-gray);\n border-radius: 0.75rem;\n padding: 0 .4375rem;\n color: white;\n font-size: 0.875rem;\n line-height: 1.5625rem;\n font-weight: 500;\n text-align: center;\n flex-shrink: 0;\n\n body.is-macos & {\n line-height: 1.5rem;\n }\n\n body.is-ios & {\n line-height: 1.375rem;\n min-width: 1.375rem;\n height: 1.375rem;\n padding: 0 .375rem;\n }\n\n &.mention, &.unread:not(.muted) {\n background: var(--color-green);\n color: var(--color-white);\n }\n\n &.pinned:not(.unread) {\n color: var(--color-pinned);\n background: transparent;\n width: 1.5rem;\n padding: 0;\n\n i {\n font-size: 1.5rem;\n }\n }\n\n &.mention {\n width: 1.5rem;\n padding: 0.25rem;\n\n i {\n font-size: 1rem;\n vertical-align: super;\n }\n\n body.is-ios & {\n width: 1.375rem;\n padding: 0.25rem;\n\n i {\n font-size: .875rem;\n }\n }\n }\n}\n\n\n",".Chat {\n --background-color: var(--color-background);\n\n body.is-ios &,\n body.is-macos & {\n --color-text-meta: var(--color-text-meta-apple);\n }\n\n position: absolute;\n top: 0;\n left: 0;\n margin: 0;\n width: 100%;\n\n &.animate-opacity {\n will-change: opacity;\n transition: opacity .2s ease-out;\n }\n\n &.animate-transform {\n will-change: transform;\n transition: transform .2s ease-out;\n }\n\n &:hover, &.ListItem.has-menu-open {\n .Avatar.online::after {\n border-color: var(--color-chat-hover);\n }\n }\n\n @media (max-width: 600px) {\n &.selected {\n --background-color: var(--color-chat-hover) !important;\n\n .Avatar.online::after {\n border-color: var(--color-chat-hover);\n }\n }\n }\n\n @media (min-width: 600px) {\n &.selected,\n &.selected:hover {\n --background-color: var(--color-chat-active) !important;\n\n .Avatar.online::after {\n border-color: var(--color-chat-active) !important;\n background: var(--color-white);\n }\n\n .ListItem-button {\n --background-color: var(--color-chat-active) !important;\n --color-text: var(--color-white);\n --color-text-meta-colored: var(--color-white);\n --color-text-meta: var(--color-white);\n --color-text-secondary: var(--color-white);\n --color-error: var(--color-white);\n --color-pinned: var(--color-white);\n }\n\n .icon-muted-chat {\n color: var(--color-white) !important;\n }\n\n .Badge:not(.pinned) {\n background: var(--color-white);\n color: var(--color-chat-active);\n }\n }\n }\n\n @media (max-width: 600px) {\n .ListItem-button {\n border-radius: 0 !important;\n }\n }\n\n .status {\n flex-shrink: 0;\n }\n\n .info {\n .title, .subtitle {\n padding-right: .125rem;\n }\n\n .subtitle {\n margin-top: -.125rem;\n }\n\n h3 {\n width: auto;\n max-width: 80%;\n }\n\n .icon-muted-chat {\n font-size: 1.25rem;\n margin-left: 0.25rem;\n margin-top: -.0625rem;\n color: #C6C8CA;\n\n body.is-ios & {\n margin-top: 0;\n margin-right: .5rem;\n }\n }\n\n .LastMessageMeta {\n margin-left: auto;\n\n body.is-ios & {\n font-size: .875rem;\n margin-right: 0;\n }\n }\n\n .last-message, .typing-status {\n padding-right: 0.25rem;\n flex-grow: 1;\n color: var(--color-text-secondary);\n unicode-bidi: plaintext;\n\n &[dir=ltr] {\n text-align: left;\n }\n\n .sender-name {\n color: var(--color-text);\n }\n\n .draft {\n color: var(--color-error);\n }\n }\n\n .last-message {\n .draft {\n &::after {\n content: ': ';\n }\n }\n\n .colon {\n margin-inline-end: .25rem;\n }\n\n img {\n width: 1.25rem;\n height: 1.25rem;\n object-fit: cover;\n border-radius: .125rem;\n vertical-align: -.25rem;\n margin-inline-end: .25rem;\n\n body.is-ios & {\n width: 1.125rem;\n height: 1.125rem;\n vertical-align: -.1875rem;\n }\n\n &.round {\n border-radius: .625rem;\n }\n }\n\n .emoji-small {\n width: 1rem;\n height: 1rem;\n vertical-align: -.125rem;\n }\n\n .icon-play {\n position: relative;\n display: inline-block;\n font-size: .75rem;\n color: #fff;\n margin-inline-start: -1.25rem;\n margin-inline-end: 0.5rem;\n bottom: 0.0625rem;\n\n body.is-ios & {\n margin-inline-start: -1.125rem;\n bottom: 0;\n }\n }\n }\n }\n\n &[dir=rtl] {\n .info {\n .LastMessageMeta {\n margin-left: 0;\n margin-right: auto;\n }\n\n .title, .subtitle {\n padding-left: .15rem;\n padding-right: 0;\n }\n\n .icon-muted-chat {\n margin-left: 0;\n margin-right: 0.25rem;\n }\n\n .last-message, .typing-status {\n padding-left: 0.5rem;\n padding-right: 0;\n text-align: right;\n unicode-bidi: plaintext;\n }\n }\n }\n}\n",".AnimatedEmoji {\n margin-bottom: 0.75rem;\n\n img {\n position: absolute;\n width: 100%;\n height: 100%;\n\n &.like-sticker-thumb {\n transform: scale(0.8);\n }\n }\n}\n",".EmptyFolder {\n width: 100%;\n height: 80%;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n\n @media (max-height: 480px) {\n height: 100%;\n }\n\n .sticker {\n height: 8rem;\n margin-bottom: 1.875rem;\n }\n\n .title {\n font-size: 1.25rem;\n margin-bottom: .125rem;\n }\n\n .description {\n font-size: .875rem;\n color: var(--color-text-secondary);\n\n body.is-ios &,\n body.is-macos & {\n color: var(--color-text-secondary-apple);\n }\n }\n\n .Button.pill {\n margin-top: .625rem;\n font-weight: 500;\n padding-inline-start: .75rem;\n unicode-bidi: plaintext;\n\n i {\n margin-inline-end: .625rem;\n font-size: 1.5rem;\n }\n }\n}\n",".NothingFound {\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color-text-meta);\n\n &.with-description {\n flex-direction: column;\n }\n\n .AnimatedSticker {\n margin: 0 auto;\n }\n\n .description {\n color: var(--color-text-secondary);\n font-size: .875rem;\n text-align: center;\n margin: 1rem 0 0;\n unicode-bidi: plaintext;\n }\n}\n",".Media {\n height: 0;\n padding-bottom: 100%;\n overflow: hidden;\n position: relative;\n cursor: pointer;\n\n .video-duration {\n position: absolute;\n left: .25rem;\n top: .25rem;\n background: rgba(0, 0, 0, .25);\n color: #fff;\n font-size: .75rem;\n padding: 0 .3125rem;\n border-radius: .1875rem;\n line-height: 1.125rem;\n }\n\n img {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n}\n",".WebLink {\n min-height: 3rem;\n padding: .25rem 0 0 3.75rem;\n font-size: 0.875rem;\n line-height: 1.125rem;\n position: relative;\n\n & + & {\n margin-top: 1.5rem;\n }\n\n &.without-media::before {\n content: attr(data-initial);\n width: 3rem;\n height: 3rem;\n position: absolute;\n left: 0;\n top: 0;\n background-color: var(--color-webpage-initial-background);\n color: #fff;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--border-radius-messages-small);\n text-transform: uppercase;\n font-weight: 500;\n font-size: 1.5rem;\n }\n\n .Media {\n position: absolute;\n left: 0;\n top: 0;\n width: 3rem;\n height: 3rem;\n cursor: default !important;\n padding-bottom: unset !important;\n border-radius: var(--border-radius-messages-small) !important;\n }\n\n .site-name,\n .site-description,\n .site-title {\n word-break: break-word;\n text-align: initial;\n }\n\n .site-name {\n display: block;\n color: var(--color-links);\n font-weight: 400;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .site-title {\n font-size: 1rem;\n font-weight: 400;\n margin-bottom: .0625rem;\n line-height: 1.3125rem;\n }\n\n .sender-name,\n .site-description {\n margin-bottom: 0;\n color: var(--color-text-secondary);\n line-height: 1.125rem;\n max-height: 2.25rem;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .sender-name {\n margin-top: .25rem;\n }\n\n .site-description .emoji {\n width: 1rem !important;\n height: 1rem !important;\n }\n\n &[dir=rtl] {\n padding: .25rem 3.75rem 0 0;\n\n .Media,\n &.without-media::before {\n left: auto;\n right: 0;\n }\n\n .content {\n text-align: right;\n }\n }\n}\n",".File {\n --secondary-color: var(--color-text-secondary);\n\n .Message.own & {\n --secondary-color: var(--color-text-green);\n }\n\n .content-inner & {\n min-width: 14rem;\n @media (max-width: 340px) {\n min-width: 11rem;\n }\n }\n\n display: flex;\n align-items: center;\n\n .file-icon-container {\n position: relative;\n }\n\n .file-progress,\n .file-icon,\n .file-preview {\n width: 3.375rem;\n height: 3.375rem;\n margin-inline-end: .75rem;\n border-radius: var(--border-radius-messages-small);\n background: var(--color-primary);\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .file-progress {\n position: absolute;\n top: 0;\n left: 0;\n }\n\n .file-icon {\n padding: 1rem .75rem .5rem;\n align-items: flex-end;\n flex-shrink: 0;\n position: relative;\n color: white;\n\n .file-ext {\n font-size: 1rem;\n font-weight: 500;\n transition: opacity .15s;\n }\n\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n right: 0;\n border-bottom-left-radius: 0.25rem;\n background: rgba(black, 0.25);\n border-color: transparent var(--background-color) transparent var(--background-color);\n border-width: 0 1.125rem 1.125rem 0;\n border-style: solid;\n transition: border-width .15s ease-in;\n }\n }\n\n .file-preview {\n background: transparent;\n overflow: hidden;\n\n & + .action-icon,\n & + .file-progress {\n background: rgba(black, 0.5);\n border-radius: var(--border-radius-messages-small);\n }\n\n img {\n object-fit: cover;\n }\n }\n\n .action-icon {\n color: #fff;\n font-size: 1.5rem;\n position: absolute;\n top: 0;\n start: 0;\n width: 3.375rem;\n height: 3.375rem;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity .25s;\n }\n\n &.interactive .file-icon-container {\n cursor: pointer;\n\n &:hover {\n .file-icon::after {\n border-width: 0;\n }\n\n .action-icon {\n opacity: 1;\n\n &.hidden {\n opacity: 0;\n }\n }\n\n .file-ext {\n opacity: 0;\n }\n }\n }\n\n .file-info {\n margin-top: .1875rem;\n margin-right: .125rem;\n white-space: nowrap;\n overflow: hidden;\n flex-grow: 1;\n\n & + .Link {\n font-size: .75rem;\n color: var(--color-text-secondary);\n padding-left: 1rem;\n white-space: nowrap;\n }\n }\n\n .file-title {\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 500;\n overflow: hidden;\n text-overflow: ellipsis;\n\n .emoji {\n vertical-align: -4px;\n }\n }\n\n .file-subtitle {\n font-size: .875rem;\n line-height: .9375rem;\n color: var(--secondary-color);\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n\n span + span {\n &::before {\n content: '\\00a0\\2022\\00a0';\n }\n }\n }\n\n &.smaller {\n --background-color: var(--color-background);\n --border-radius-messages-small: .3125rem;\n\n .action-icon,\n .file-progress,\n .file-icon,\n .file-preview {\n width: 3rem;\n height: 3rem;\n }\n\n .file-icon {\n padding-bottom: .375rem;\n\n &::after {\n border-width: 0 1rem 1rem 0;\n }\n }\n\n .file-info {\n margin-top: -.125rem;\n }\n\n .file-title {\n font-weight: 400;\n }\n\n .file-subtitle {\n line-height: 1rem;\n }\n }\n\n &:dir(rtl),\n &[dir=rtl] {\n .file-progress,\n .file-icon,\n .file-preview {\n margin-left: .75rem;\n margin-right: 0;\n }\n\n .file-info {\n text-align: right;\n\n & + .Link {\n padding-left: 0;\n padding-right: 1rem;\n }\n }\n\n .action-icon {\n left: auto;\n right: 0;\n }\n }\n}\n\n// Document extension colors\n.File .file-progress,\n.File .file-icon {\n &.red {\n background-color: var(--color-error);\n }\n\n &.orange {\n background-color: var(--color-warning);\n }\n\n &.green {\n background-color: var(--color-text-green);\n }\n}\n",".Audio {\n display: flex;\n align-items: flex-start;\n\n &.media-inner {\n overflow: visible;\n }\n\n &.own {\n --color-text-secondary: var(--accent-color);\n --color-interactive-active: var(--color-text-green);\n --color-interactive-inactive: rgba(var(--color-text-green-rgb), 0.4);\n --color-interactive-buffered: rgba(var(--color-text-green-rgb), 0.4); // Overlays underlying inactive color\n\n .theme-dark & {\n --color-text-green-rgb: 255, 255, 255;\n --color-text-green: var(--color-white);\n }\n\n .Button {\n --color-primary: var(--color-text-green);\n --color-primary-shade: var(--color-green);\n --color-primary-shade-darker: var(--color-green-darker);\n --color-white: var(--color-background-own);\n\n .theme-dark & {\n --color-primary-shade: #fff;\n --color-primary-shade-darker: #fff;\n }\n }\n }\n\n .toggle-play {\n margin-inline-end: .5rem;\n\n &.smaller {\n width: 3rem;\n height: 3rem;\n margin-inline-end: .75rem;\n\n i {\n font-size: 1.625rem;\n margin-top: -.025rem;\n }\n }\n\n i {\n position: absolute;\n\n &.icon-play {\n margin-left: .125rem;\n @media (max-width: 600px) {\n margin-left: .0625rem;\n }\n }\n }\n\n .icon-play, .icon-pause {\n opacity: 1;\n transform: scale(1);\n transition: opacity .4s, transform .6s cubic-bezier(0.34, 1.56, 0.64, 1);\n }\n\n &.play .icon-pause,\n &.pause .icon-play,\n &.loading .icon-play,\n &.loading .icon-pause {\n opacity: 0;\n transform: scale(.5);\n }\n }\n\n .media-loading {\n pointer-events: none;\n\n .interactive {\n pointer-events: auto;\n }\n }\n\n .download-button {\n position: absolute;\n width: 1.125rem !important;\n height: 1.125rem !important;\n padding: 0;\n left: 1.5rem;\n top: 1.5rem;\n border: .125rem solid var(--background-color);\n z-index: 1;\n\n i {\n font-size: 0.8125rem;\n }\n }\n\n &.bigger .download-button {\n left: 2rem;\n top: 2rem;\n border: .125rem solid var(--color-background);\n }\n\n .content {\n align-self: center;\n min-width: 0;\n flex-grow: 1;\n text-align: initial;\n }\n\n .content-row {\n display: flex;\n justify-content: space-between;\n }\n\n .title {\n font-weight: 500;\n margin: 0;\n line-height: 1.25;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .voice-duration {\n margin: .25rem 0 0;\n font-size: .875rem;\n color: var(--color-text-secondary);\n\n span {\n margin-left: 0.25rem;\n font-size: 1.5rem;\n line-height: .875rem;\n vertical-align: middle;\n }\n }\n\n &:not(.own) .voice-duration span {\n color: var(--color-primary);\n }\n\n .waveform {\n cursor: pointer;\n margin-left: 1px;\n }\n\n .meta,\n .performer,\n .date {\n font-size: .875rem;\n line-height: 1;\n color: var(--color-text-secondary);\n margin: 0;\n }\n\n .duration {\n margin: .1875rem 0 0;\n font-size: .875rem;\n color: var(--color-text-secondary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .seekline {\n width: calc(100% - 2px);\n padding-left: 6px;\n margin-bottom: .3125rem;\n height: 12px;\n position: relative;\n margin-left: -6px;\n top: 1px;\n cursor: pointer;\n\n &::before {\n content: '';\n position: absolute;\n width: 100%;\n left: 6px;\n top: 6px;\n height: 2px;\n background-color: var(--color-interactive-inactive);\n border-radius: 2px;\n }\n }\n\n .seekline-buffered-progress, .seekline-play-progress {\n position: absolute;\n height: 2px;\n border-radius: 2px;\n overflow: hidden;\n width: 100%;\n top: 6px;\n left: 6px;\n\n i {\n position: absolute;\n width: 100%;\n background-color: var(--color-interactive-active);\n height: 2px;\n border-radius: 2px;\n right: 100%;\n }\n }\n\n .seekline-buffered-progress i {\n background-color: var(--color-interactive-buffered) !important;\n }\n\n .seekline-thumb {\n position: absolute;\n width: 100%;\n top: 7px;\n left: 0;\n\n i {\n pointer-events: none;\n position: absolute;\n width: 100%;\n right: 100%;\n\n &::after {\n content: '';\n position: absolute;\n top: -6px;\n right: -12px;\n width: 12px;\n height: 12px;\n border-radius: 6px;\n background: var(--color-interactive-active);\n }\n }\n }\n\n &.bigger {\n .content {\n margin-top: .1875rem;\n }\n\n .title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-weight: 400;\n line-height: 1.5rem;\n }\n\n .meta,\n .performer,\n .date {\n line-height: 1.0625rem;\n }\n\n .seekline {\n top: 2px;\n margin-bottom: .5rem;\n }\n\n .duration {\n line-height: 1rem;\n }\n\n .media-loading {\n top: 0.1875rem;\n left: 0.1875rem;\n }\n\n &[dir=rtl] {\n .media-loading {\n left: auto !important;\n right: 0;\n }\n }\n }\n\n .ProgressSpinner.size-s svg {\n width: 2.25rem;\n height: 2.25rem;\n }\n\n &[dir=rtl] {\n .toggle-play {\n margin-left: .5rem;\n margin-right: 0;\n\n &.smaller {\n margin-left: .75rem;\n margin-right: 0;\n }\n }\n\n .content,\n .duration {\n text-align: right;\n }\n\n .download-button {\n left: auto;\n right: 1.5rem;\n }\n }\n}\n",".ProfilePhoto {\n width: 100%;\n height: 100%;\n cursor: pointer;\n position: relative;\n\n img:not(.emoji) {\n width: 100%;\n object-fit: cover;\n }\n\n .prev-avatar-media {\n position: absolute;\n left: 0;\n top: 0;\n z-index: -1;\n }\n\n .spinner-wrapper {\n width: 100%;\n height: 100%;\n }\n\n .spinner-wrapper,\n &.deleted-account,\n &.no-photo,\n &.saved-messages {\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color-white);\n background: linear-gradient(var(--color-white) -125%, var(--color-user));\n cursor: default;\n }\n\n &.no-photo {\n font-size: 14rem;\n }\n\n &.deleted-account,\n &.saved-messages {\n font-size: 20rem;\n }\n}\n",".ProfileInfo {\n aspect-ratio: 1 / 1;\n position: relative;\n\n @supports not (aspect-ratio: 1 / 1) {\n &::before {\n float: left;\n padding-top: 100%;\n content: \"\";\n }\n\n &::after {\n display: block;\n content: \"\";\n clear: both;\n }\n }\n\n .photo-wrapper {\n width: 100%;\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n\n > .Transition {\n width: 100%;\n height: 100%;\n }\n }\n\n .photo-dashes {\n position: absolute;\n width: 100%;\n height: .125rem;\n padding: 0 .375rem;\n z-index: 1;\n\n display: flex;\n top: .5rem;\n left: 0;\n }\n\n .photo-dash {\n flex: 1 1 auto;\n background-color: var(--color-white);\n opacity: .5;\n border-radius: .125rem;\n margin: 0 .125rem;\n\n &.current {\n opacity: 1;\n }\n }\n\n .navigation {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 25%;\n border: none;\n padding: 0;\n margin: 0;\n appearance: none;\n background: transparent no-repeat;\n background-size: 1.25rem;\n opacity: .25;\n transition: opacity .15s;\n outline: none;\n cursor: pointer;\n z-index: 1;\n\n &:hover, .is-touch-env & {\n opacity: 1;\n }\n\n &.prev {\n left: 0;\n background-image: url(\"../../assets/media_navigation_previous.svg\");\n background-position: 1.25rem 50%;\n }\n\n &.next {\n right: 0;\n background-image: url(\"../../assets/media_navigation_next.svg\");\n background-position: calc(100% - 1.25rem) 50%;\n }\n }\n\n .info {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n min-height: 100px;\n padding: 0 1.5rem .5rem;\n background: linear-gradient(0deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%);\n color: var(--color-white);\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n pointer-events: none;\n\n &:dir(rtl) {\n .status {\n text-align: right;\n unicode-bidi: plaintext;\n }\n }\n\n &[dir=rtl] {\n .status {\n text-align: right;\n unicode-bidi: plaintext;\n }\n }\n }\n\n .title {\n display: flex;\n align-items: center;\n\n h3 {\n font-weight: 500;\n font-size: 1.25rem;\n line-height: 1.375rem;\n white-space: pre-wrap;\n word-break: break-word;\n margin-bottom: .25rem;\n }\n\n .VerifiedIcon {\n margin-left: 0.25rem;\n margin-top: -0.125rem;\n }\n\n .emoji {\n width: 1.5rem;\n height: 1.5rem;\n background-size: 1.5rem;\n }\n }\n\n .status {\n font-size: 0.875rem;\n opacity: .5;\n }\n\n &[dir=rtl] {\n .navigation.prev {\n left: auto;\n right: 0;\n transform: scaleX(-1);\n }\n\n .navigation.next {\n left: 0;\n right: auto;\n transform: scaleX(-1);\n }\n }\n\n &.self {\n margin: 0 -.5rem .75rem;\n overflow: hidden;\n\n &.ghost {\n margin: 0;\n }\n\n .prev-avatar-media {\n z-index: 0;\n }\n\n .info {\n padding-bottom: .75rem;\n }\n\n .status {\n line-height: 1rem;\n }\n }\n}\n",".DropTarget {\n border-radius: var(--border-radius-default);\n background: var(--color-background);\n padding: 1.25rem;\n flex: 1 1 auto;\n width: 100%;\n max-width: 43.75rem;\n margin-left: auto;\n margin-right: auto;\n margin-bottom: .3125rem;\n display: flex;\n color: #A4ACB3;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n\n @media (max-height: 350px) {\n padding: .75rem;\n }\n\n &.hovered .target-content {\n color: var(--color-primary);\n background-image: var(--drag-target-border-hovered);\n }\n\n & + & {\n margin-top: .3125rem;\n }\n\n &:last-child {\n margin-bottom: 0;\n }\n\n .target-content {\n pointer-events: none;\n background-image: var(--drag-target-border);\n border-radius: .5rem;\n flex: 1 1 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n transition: .2s color, .2s background;\n }\n\n .icon {\n font-size: 6.25rem;\n line-height: 4.6875rem;\n margin-bottom: 2.25rem;\n\n @media (max-height: 520px) {\n font-size: 4.25rem;\n line-height: 3.5rem;\n margin-bottom: 1rem;\n }\n\n @media (max-height: 450px) {\n font-size: 2rem;\n line-height: 1rem;\n margin-bottom: .5rem;\n margin-top: .25rem;\n }\n }\n\n .title {\n font-size: 1.3125rem;\n font-weight: 500;\n letter-spacing: -.18px;\n\n @media (max-height: 450px) {\n font-size: 1rem;\n }\n }\n\n .description {\n font-size: 1rem;\n letter-spacing: .3px;\n\n @media (max-height: 450px) {\n font-size: .875rem;\n }\n }\n}\n",".FloatingActionButton {\n position: absolute;\n right: 1rem;\n bottom: 1rem;\n transform: translateY(5rem);\n transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n &.revealed {\n transform: translateY(0);\n }\n}\n",".DropArea {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n height: 100vh;\n z-index: var(--z-drop-area);\n padding: 80px 20px 20px;\n\n display: flex;\n flex-direction: column;\n\n #Main.right-column-open & {\n max-width: calc(100% - var(--right-column-width));\n }\n}\n",".StickerButton {\n display: inline-block;\n width: 4rem;\n height: 4rem;\n margin: 0.5rem;\n border-radius: var(--border-radius-messages-small);\n background: transparent no-repeat center;\n background-size: contain;\n cursor: pointer;\n transition: background-color .15s ease, opacity .3s ease !important;\n position: relative;\n\n @media (max-width: 600px) {\n margin: 0.25rem;\n }\n\n &.set-button {\n width: 2.75rem !important;\n height: 2.75rem;\n margin: 0 0.5rem;\n }\n\n &.large {\n width: 10rem;\n height: 10rem;\n margin: 0;\n }\n\n .AnimatedSticker, img {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n img {\n object-fit: contain;\n }\n\n .sticker-unfave-button {\n position: absolute;\n top: -0.5rem;\n right: -0.5rem;\n width: 1.25rem;\n height: 1.25rem;\n padding: 0.125rem;\n\n i {\n font-size: 1rem;\n }\n\n opacity: 0;\n }\n\n &:hover {\n background-color: var(--color-interactive-element-hover);\n\n .sticker-unfave-button {\n opacity: 1;\n }\n }\n}\n",".TextFormatter {\n transform: translate(-50%, -3.25rem);\n\n &, &-link-control {\n position: absolute;\n background: var(--color-background);\n border-radius: var(--border-radius-messages);\n padding: 0.5rem 0.375rem;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n }\n\n &-link-control {\n left: 0;\n top: 0;\n opacity: 0;\n pointer-events: none;\n transition: opacity .3s ease;\n\n .Modal & {\n max-width: 100%;\n }\n\n @media (max-width: 600px) {\n max-width: calc(100vw - var(--text-formatter-left) + 3rem);\n }\n\n input {\n border: none !important;\n outline: none !important;\n width: 100%;\n color: var(--color-text);\n background-color: var(--color-background);\n }\n }\n\n &-buttons, &-link-url-confirm {\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n }\n\n &-divider {\n width: 1px;\n height: 1.75rem;\n margin: 0 0.25rem;\n background-color: var(--color-borders);\n }\n\n &-link-url-input-wrapper {\n width: 20rem;\n position: relative;\n max-width: 100%;\n\n @media (max-width: 600px) {\n max-width: 90vw;\n }\n\n &::before, &::after {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n width: 1rem;\n z-index: 2;\n opacity: 0;\n transition: opacity .2s ease;\n }\n\n &::before {\n left: 0;\n background: linear-gradient(to right, var(--color-background) .25rem, transparent 1rem)\n }\n\n &::after {\n right: 0;\n background: linear-gradient(to left, var(--color-background) .25rem, transparent 1rem)\n }\n\n &.mask-left {\n &::before {\n opacity: 1;\n }\n }\n\n &.mask-right {\n &::after {\n opacity: 1;\n }\n }\n }\n\n &-link-url-confirm {\n flex-shrink: 0;\n opacity: 0;\n transition: opacity .3s ease;\n\n &.shown {\n opacity: 1;\n }\n }\n\n &.link-control-shown {\n .TextFormatter-link-control {\n opacity: 1;\n pointer-events: all;\n }\n }\n\n .Button {\n width: 2rem;\n height: 2rem;\n padding: 0.25rem;\n font-size: 1.5rem;\n margin: 0 0.125rem;\n border-radius: var(--border-radius-messages-small);\n flex-shrink: 0;\n cursor: pointer;\n\n &.active {\n background-color: var(--color-primary) !important;\n color: white;\n }\n\n &.disabled {\n opacity: .5;\n pointer-events: none;\n }\n }\n}\n",".Picker {\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n\n .picker-header {\n padding: 0 1rem 0.25rem 0.75rem;\n border-bottom: 1px solid var(--color-borders);\n display: flex;\n flex-flow: row wrap;\n flex-shrink: 0;\n\n overflow-y: auto;\n max-height: 20rem;\n\n .input-group {\n margin-bottom: 0.5rem;\n margin-left: 0.5rem;\n flex-grow: 1;\n }\n\n .form-control {\n height: 2rem;\n border: none;\n border-radius: 0;\n padding: 0;\n box-shadow: none;\n }\n }\n\n .picker-list {\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden;\n padding: 0.5rem;\n\n @media (max-width: 600px) {\n padding-left: 0 !important;\n padding-right: 0 !important;\n }\n }\n\n .no-results {\n height: 100%;\n margin: 0;\n padding: 1rem 1rem;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color-text-secondary);\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/484.87953bd73fba4543a4f6.js b/dist/484.87953bd73fba4543a4f6.js new file mode 100644 index 00000000..b43a083b --- /dev/null +++ b/dist/484.87953bd73fba4543a4f6.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[484],{7854:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(4050),a=n(6137),s=n(4399),o=n(3657),i=n(6202),c=n(8835),l=n(706),d=n(7799);const u={large:160,medium:128,small:104},m=({sticker:e,size:t="medium",observeIntersection:n,lastSyncTime:m,forceLoadPreview:h})=>{var f;const v=(0,r.sO)(null),[p,Z]=(0,l.Z)(),g=`sticker${e.id}`,E=(0,o.Op)(v,n),P=null===(f=e.thumbnail)||void 0===f?void 0:f.dataUri,y=(0,i.Z)(`${g}?size=m`,!E&&!h,a.IU.BlobUrl,m),{transitionClassNames:C}=(0,c.Z)(y,"slow"),b=(0,i.Z)(g,!E,a.IU.Lottie,m),N=Boolean(b),[w,k]=(0,r.eJ)(String(Math.random())),I=(0,r.I4)((()=>{k(String(Math.random()))}),[]),T=u[t],S=`width: ${T}px; height: ${T}px;`;return r.ZP.createElement("div",{ref:v,className:"AnimatedEmoji media-inner",style:S,onClick:I},!p&&P&&r.ZP.createElement("img",{src:P,className:e.id===s.wB?"like-sticker-thumb":void 0,alt:""}),!p&&y&&r.ZP.createElement("img",{src:y,className:C,alt:""}),N&&r.ZP.createElement(d.Z,{key:g,id:g,animationData:b,size:T,quality:1,play:E&&w,noLoop:!0,onLoad:Z}))}},7799:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),a=n(9118),s=n(6752),o=n(8674),i=n(5332);let c,l;async function d(){return c||(c=n.e(941).then(n.bind(n,7941)),l=(await c).default),c}setTimeout(d,5e3);const u=(0,r.X$)((({className:e,id:t,animationData:n,play:c,playSegment:u,speed:m,noLoop:h,size:f,quality:v,isLowPriority:p,onLoad:Z})=>{const[g,E]=(0,r.eJ)(),P=(0,r.sO)(null),y=(0,r.sO)(!1),C=(0,r.sO)(!1),b=(0,r.sO)();b.current=c;const N=(0,r.sO)();N.current=u,(0,r.d4)((()=>{if(g||!n)return;const e=()=>{if(!P.current)return;const e=new l(t,P.current,n,{noLoop:h,size:f,quality:v,isLowPriority:p},Z);m&&e.setSpeed(m),E(e)};l?e():d().then((()=>{(0,a.T2)((()=>{P.current&&e()}))}))}),[g,n,t,p,h,Z,v,f,m]),(0,r.d4)((()=>()=>{g&&g.destroy()}),[g]);const w=(0,r.I4)(((e=!1)=>{g&&(b.current||N.current)&&(N.current?g.playSegment(N.current):e?g.goToAndPlay(0):g.play())}),[g]),k=(0,r.I4)((()=>{g&&g.pause()}),[g]),I=(0,r.I4)((()=>{C.current=!0,g&&(y.current||(y.current=g.isPlaying()),k())}),[g,k]),T=(0,r.I4)((()=>{y.current&&w(),y.current=!1,C.current=!1}),[w]),S=(0,r.I4)((()=>{(0,a.T2)(T)}),[T]);(0,r.d4)((()=>{g&&(c||u?C.current?y.current=!0:w(h):C.current?y.current=!1:k())}),[g,c,u,h,w,k]),(0,o.ZP)(I,T),(0,i.Z)(I,S);const M=(0,s.Z)("AnimatedSticker",e),L=f?`width: ${f}px; height: ${f}px;`:void 0;return r.ZP.createElement("div",{ref:P,className:M,style:L})}))},4752:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(4050),a=n(7361),s=n(790),o=n(2858),i=n(6752),c=n(2340),l=n(2761),d=n(1212),u=n(2019),m=n(3186),h=n(2619),f=n(9107),v=n(231),p=n(9196),Z=n(8033);const g=a.wB?20:25,E=a.wB?50:75;function P(e,t,{handleStartSeek:n,handleSeek:a,handleStopSeek:s}){return r.ZP.createElement("div",{className:"seekline no-selection",onMouseDown:n,onMouseMove:a,onMouseUp:s},r.ZP.createElement("span",{className:"seekline-buffered-progress"},r.ZP.createElement("i",{style:`transform: translateX(${100*t}%)`})),r.ZP.createElement("span",{className:"seekline-play-progress"},r.ZP.createElement("i",{style:`transform: translateX(${100*e}%)`})),r.ZP.createElement("span",{className:"seekline-thumb"},r.ZP.createElement("i",{style:`transform: translateX(${100*e}%)`})))}const y=(0,r.X$)((({theme:e,message:t,senderTitle:n,uploadProgress:y,target:C,date:b,lastSyncTime:N,className:w,isSelectable:k,isSelected:I,onPlay:T,onReadMedia:S,onCancelUpload:M,onDateClick:L})=>{const{content:{audio:x,voice:$},isMediaUnread:A}=t,F=Boolean($),O=(0,r.sO)(!1),D=(0,f.Z)(),[U,R]=(0,r.eJ)(!1),B=N,{mediaData:V,downloadProgress:X}=(0,l.Z)((0,o.Ti)(t,"inline"),!B,(0,o.kG)(t,"inline")),{isBuffered:j,bufferedProgress:H,bufferingHandlers:K,checkBuffering:q}=(0,u.Z)(),{isPlaying:z,playProgress:J,playPause:Y,setCurrentTime:W,duration:_}=(0,m.Z)((0,o.Tp)(t),(0,o.XV)(t),V,K,q,U,(function(){R(!0),T(t.id,t.chatId)}),(0,o.CI)(t));(0,r.d4)((()=>{R(z)}),[z]);const{isDownloadStarted:G,downloadProgress:Q,handleDownloadClick:ee}=(0,h.Z)((0,o.Ti)(t,"download"),(0,o.I3)(t)),te=U&&!j,{isUploading:ne,isTransferring:re,transferProgress:ae}=(0,o.Sc)(t,G?Q:y||X,te||G),{shouldRender:se,transitionClassNames:oe}=(0,d.Z)(re),ie=(0,r.I4)((()=>{ne?M&&M():(z||T(t.id,t.chatId),R(!U),Y())}),[z,ne,t.id,t.chatId,M,T,Y,U]);(0,r.d4)((()=>{z&&S&&A&&S()}),[z,A,S]);const ce=(0,r.I4)((e=>{if(O.current){const t=e.currentTarget.closest(".seekline,.waveform");if(t){const{width:n,left:r}=t.getBoundingClientRect();W(_*((e.clientX-r)/n))}}}),[_,W]),le=(0,r.I4)((e=>{O.current=!0,ce(e)}),[ce]),de=(0,r.I4)((()=>{O.current=!1}),[]),ue=(0,r.I4)((()=>{L(t.id,t.chatId)}),[L,t.id,t.chatId]),me={handleStartSeek:le,handleSeek:ce,handleStopSeek:de},he=(0,o.B4)(t),fe=(0,r.Ye)((()=>$&&function(e,t=0,n=!1,{handleStartSeek:a,handleSeek:s,handleStopSeek:o},i){const{waveform:c,duration:l}=e;if(!c)return;const d="dark"===i?"#494B75":"#CBCBCB",u="dark"===i?"#C0BBED":"#B0DEA6",m="dark"===i?"#868DF5":"#54a3e6",h="dark"===i?"#FFFFFF":"#53ad53",f=Math.min(l/30,1),v=Math.round(g+(E-g)*f),p=function(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const r=Array(n),a=e;for(let e=0,t=n-1;e!==t;++e){const t=Math.floor(5*e/8),n=Math.floor(5*e%8),s=a[t]+(a[t+1]<<8);r[e]=s>>n&31}const s=Math.floor(5*(n-1)/8),o=Math.floor(5*(n-1)%8),i=a[s]+(a[s+1]<<8);return r[n-1]=i>>o&31,r}(new Uint8Array(c)),{data:Z,peak:P}=function(e,t){let n=0;const r=new Array(t),a=e.length/t,s=e[0],o=e[e.length-1];for(let d=0;d{i.globalAlpha=o/e.length>=t?.5:1,i.fillStyle=t>o/e.length?a:r;const c=Math.max(2,s/Math.max(1,n)*23);!function(e,t,n,r,a,s){2<2*s&&(s=1),a<2*s&&(s=a/2),e.beginPath(),e.moveTo(t+s,n),e.arcTo(t+2,n,t+2,n-a,s),e.arcTo(t+2,n-a,t,n-a,s),e.arcTo(t,n-a,t,n,s),e.arcTo(t,n,t+2,n,s),e.closePath()}(i,4*o,23,0,c,1),i.fill()})),{src:o.toDataURL(),width:s,height:23}}(Z,t,{peak:P,fillStyle:n?u:d,progressFillStyle:n?h:m});return r.ZP.createElement("img",{src:y,alt:"",width:C,height:b,className:"waveform",draggable:!1,onMouseDown:a,onMouseMove:s,onMouseUp:o})}($,J,he,{handleStartSeek:le,handleSeek:ce,handleStopSeek:de},e)),[$,J,he,le,ce,de,e]),ve=(0,i.Z)("Audio media-inner",w,he&&!C&&"own",C&&"bigger",I&&"audio-is-selected"),pe=["toggle-play"];te?pe.push("loading"):z?pe.push("pause"):z||pe.push("play");const Ze=z||J>0&&J<1,ge=(0,i.Z)("content",Ze&&"with-seekline");return r.ZP.createElement("div",{className:ve,dir:D.isRtl?"rtl":void 0},k&&r.ZP.createElement("div",{className:"message-select-control"},I&&r.ZP.createElement("i",{className:"icon-select"})),r.ZP.createElement(v.Z,{round:!0,ripple:!a.wB,size:C?"smaller":"tiny",className:pe.join(" "),ariaLabel:z?"Pause audio":"Play audio",onClick:ie,isRtl:D.isRtl},r.ZP.createElement("i",{className:"icon-play"}),r.ZP.createElement("i",{className:"icon-pause"})),se&&r.ZP.createElement("div",{className:(0,i.Z)("media-loading",oe,te&&"interactive")},r.ZP.createElement(p.Z,{progress:ae,transparent:!0,size:C?"m":"s",onClick:te?ie:void 0,noCross:!te})),x&&r.ZP.createElement(v.Z,{round:!0,size:"tiny",className:"download-button",ariaLabel:G?"Cancel download":"Download",onClick:ee},r.ZP.createElement("i",{className:G?"icon-close":"icon-arrow-down"})),"searchResult"===C&&r.ZP.createElement(r.ZP.Fragment,null,r.ZP.createElement("div",{className:ge},r.ZP.createElement("div",{className:"content-row"},r.ZP.createElement("p",{className:"title",dir:"auto"},(0,c.Z)(function(){if(F)return n||"Voice";const{title:e,fileName:t}=x;return e||t}())),r.ZP.createElement("div",{className:"message-date"},b&&r.ZP.createElement(Z.Z,{className:"date",onClick:ue},(0,s.VX)(D,1e3*b)))),Ze&&P(J,H,me),!Ze&&r.ZP.createElement("p",{className:"duration",dir:"auto"},J>0?`${(0,s.k9)(_*J)} / `:void 0,function(){if(F)return(0,s.k9)($.duration);const{performer:e}=x;return r.ZP.createElement(r.ZP.Fragment,null,e&&(0,c.Z)(e),e&&n&&r.ZP.createElement("span",null,"•"),n&&(0,c.Z)(n))}()))),"searchResult"!==C&&x&&function(e,t,n,a,o,i,l,d){const{title:u,performer:m,duration:h,fileName:f}=t,v=n||a>0&&a<1;return r.ZP.createElement("div",{className:"content"},r.ZP.createElement("p",{className:"title",dir:"auto"},(0,c.Z)(u||f)),v&&P(a,o,i),!v&&r.ZP.createElement("div",{className:"meta",dir:"auto"},r.ZP.createElement("span",{className:"performer"},(0,c.Z)(m||"Unknown")),l&&r.ZP.createElement(r.ZP.Fragment,null," ","•"," ",r.ZP.createElement(Z.Z,{className:"date",onClick:d},(0,s.ZK)(e,1e3*l)))),r.ZP.createElement("p",{className:"duration",dir:"auto"},a>0?`${(0,s.k9)(h*a)} / `:void 0,(0,s.k9)(h)))}(D,x,z,J,H,me,b,L?ue:void 0),"searchResult"!==C&&$&&function(e,t,n){return r.ZP.createElement("div",{className:"content"},t,r.ZP.createElement("p",{className:"voice-duration",dir:"auto"},(0,s.k9)(e.duration),n&&r.ZP.createElement("span",null,"•")))}($,fe,A))}))},172:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),a=n(6137),s=n(3716),o=n(2858),i=n(2155),c=n(6752),l=n(2340),d=n(6202),u=n(8835),m=n(9107);const h=(0,r.X$)((({className:e,size:t="large",chat:n,user:h,text:f,withOnlineStatus:v,isSavedMessages:p,lastSyncTime:Z,onClick:g})=>{const E=h&&(0,o.NB)(h);let P;p||E||(h?P=(0,o.RT)(h):n&&(P=(0,o.RT)(n)));const y=(0,d.Z)(P,!1,a.IU.DataUri,Z),{shouldRenderFullMedia:C,transitionClassNames:b}=(0,u.Z)(y,"slow"),N=(0,m.Z)();let w="";if(p)w=r.ZP.createElement("i",{className:"icon-avatar-saved-messages"});else if(E)w=r.ZP.createElement("i",{className:"icon-avatar-deleted-account"});else if(C)w=r.ZP.createElement("img",{src:y,className:`${b} avatar-media`,alt:"",decoding:"async"});else if(h){const e=(0,o.Js)(h);w=e?(0,i.Xv)(e,2):void 0}else if(n){const e=(0,o.U)(N,n);w=e&&(0,i.Xv)(e,(0,o.YA)(n.id)?2:1)}else f&&(w=(0,i.Xv)(f,2));const k=!p&&h&&(0,o.kM)(h),I=(0,c.Z)(`Avatar size-${t}`,e,`color-bg-${(0,o.Rs)(h||n)}`,p&&"saved-messages",E&&"deleted-account",v&&k&&"online",g&&"interactive",!p&&!C&&"no-photo"),T=(0,r.I4)((e=>{g&&g(e,p||C)}),[g,p,C]),S=(h||n)&&(h||n).id;return r.ZP.createElement("div",{className:I,onClick:T,"data-test-sender-id":s.Cg?S:void 0},"string"==typeof w?(0,l.Z)(w,["jumbo"===t?"hq_emoji":"emoji"]):w)}))},180:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),a=n(5116),s=n(8085),o=n(2858),i=n(2340),c=n(782),l=n(4319),d=n(6272),u=n(9107),m=n(1876),h=n(3321);const f=(0,r.X$)((0,a.c$)(((e,{chatOrUserId:t})=>{const{lastSyncTime:n,countryList:{phoneCodes:r}}=e,a=t?(0,s.Z1)(e,t):void 0,i=(0,o.YA)(t)?(0,s.dy)(e,t):void 0,c=a&&(0,o.i4)(a,(0,s.dZ)(e),(0,s.NJ)(e));return{lastSyncTime:n,phoneCodeList:r,chat:a,user:i,canInviteUsers:a&&!i&&(!(0,o.eA)(a)&&!(0,o.Mg)(a,"inviteUsers")||(0,o.VE)(a,"inviteUsers")),isMuted:c}}),((e,t)=>(0,c.ei)(t,["loadFullUser","updateChatMutedState","showNotification"])))((({lastSyncTime:e,user:t,chat:n,forceShowSelf:a,canInviteUsers:s,isMuted:c,phoneCodeList:f,loadFullUser:v,showNotification:p,updateChatMutedState:Z})=>{const{id:g,fullInfo:E,username:P,phoneNumber:y,isSelf:C}=t||{},{id:b}=n||{},N=(0,u.Z)();(0,r.d4)((()=>{e&&g&&v({userId:g})}),[v,g,e]);const w=(0,r.I4)((()=>{Z({chatId:b,isMuted:!c})}),[b,c,Z]);if(!n||n.isRestricted||C&&!a)return;function k(e,t){(0,l.TE)(e),p({message:`${t} was copied`})}const I=y&&(0,d.WZ)(f,y),T=(0,o.hu)(n),S=(null==E?void 0:E.bio)||(0,o.GM)(n);return r.ZP.createElement("div",{className:"ChatExtra"},I&&!!I.length&&r.ZP.createElement(m.Z,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:()=>k(I,N("Phone"))},r.ZP.createElement("span",{className:"title",dir:"auto"},I),r.ZP.createElement("span",{className:"subtitle"},N("Phone"))),P&&r.ZP.createElement(m.Z,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>k(`@${P}`,N("Username"))},r.ZP.createElement("span",{className:"title",dir:"auto"},(0,i.Z)(P)),r.ZP.createElement("span",{className:"subtitle"},N("Username"))),S&&!!S.length&&r.ZP.createElement(m.Z,{icon:"info",multiline:!0,narrow:!0,isStatic:!0},r.ZP.createElement("span",{className:"title",dir:"auto"},(0,i.Z)(S,["br","links","emoji"])),r.ZP.createElement("span",{className:"subtitle"},N(g?"UserBio":"Info"))),(s||!P)&&T&&r.ZP.createElement(m.Z,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>k(T,N("SetUrlPlaceholder"))},r.ZP.createElement("div",{className:"title"},T),r.ZP.createElement("span",{className:"subtitle"},N("SetUrlPlaceholder"))),!a&&r.ZP.createElement(m.Z,{icon:"unmute",ripple:!0,onClick:w},r.ZP.createElement("span",null,N("Notifications")),r.ZP.createElement(h.Z,{id:"group-notifications",label:g?"Toggle User Notifications":"Toggle Chat Notifications",checked:!c,inactive:!0})))})))},329:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),a=n(5116),s=n(8085),o=n(2858),i=n(782),c=n(9107),l=n(2340),d=n(172),u=n(3103),m=n(231);const h=(0,r.X$)((0,a.c$)(((e,{chat:t})=>{const n=(0,o.YA)(t.id),r=(0,s.FM)(e,t.id),a=n&&(0,s.dy)(e,(0,o.zX)(t)),i=a&&(0,o.cS)(a)&&!t.isSupport,c=n&&!r&&!i,l=n?(0,o.Vl)((0,s.dy)(e,(0,o.zX)(t))):void 0;return{isPrivateChat:n,isChatWithSelf:r,isBot:i,isChannel:(0,o.eA)(t),isBasicGroup:(0,o.G9)(t),isSuperGroup:(0,o.ZV)(t),currentUserId:e.currentUserId,canDeleteForAll:c,contactName:l}}),((e,t)=>(0,i.ei)(t,["leaveChannel","deleteHistory","deleteChannel","deleteChatUser","blockContact"])))((({isOpen:e,chat:t,isChannel:n,isPrivateChat:a,isChatWithSelf:s,isBot:i,isBasicGroup:h,isSuperGroup:f,currentUserId:v,canDeleteForAll:p,contactName:Z,onClose:g,onCloseAnimationEnd:E,leaveChannel:P,deleteHistory:y,deleteChannel:C,deleteChatUser:b,blockContact:N})=>{const w=(0,c.Z)(),k=(0,o.U)(w,t),I=(0,r.I4)((()=>{y({chatId:t.id,shouldDeleteForAll:!0}),g()}),[y,t.id,g]),T=(0,r.I4)((()=>{y({chatId:t.id,shouldDeleteForAll:!0}),N({contactId:t.id,accessHash:t.accessHash}),g()}),[y,t.id,t.accessHash,N,g]),S=(0,r.I4)((()=>{a?y({chatId:t.id,shouldDeleteForAll:!1}):h?(b({chatId:t.id,userId:v}),y({chatId:t.id,shouldDeleteForAll:!1})):!n&&!f||t.isCreator?(n||f)&&t.isCreator&&C({chatId:t.id}):P({chatId:t.id}),g()}),[a,h,n,f,v,t.isCreator,t.id,g,y,b,P,C]);return r.ZP.createElement(u.Z,{isOpen:e,className:"DeleteChatModal",header:r.ZP.createElement("div",{className:"modal-header",dir:w.isRtl?"rtl":void 0},r.ZP.createElement(d.Z,{size:"tiny",chat:t,isSavedMessages:s}),r.ZP.createElement("h3",{className:"modal-title"},w(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"ChannelDelete":h||f?"Group.LeaveGroup":"DeleteChatUser"))),onClose:g,onCloseAnimationEnd:E},n&&t.isCreator?r.ZP.createElement("p",null,(0,l.Z)(w("ChatList.DeleteAndLeaveGroupConfirmation",k),["simple_markdown"])):n&&!t.isCreator||h||f?r.ZP.createElement("p",null,(0,l.Z)(w("ChannelLeaveAlertWithName",k),["simple_markdown"])):r.ZP.createElement("p",null,(0,l.Z)(w("ChatList.DeleteChatConfirmation",Z),["simple_markdown"])),i&&r.ZP.createElement(m.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:T},w("DeleteAndStop")),p&&r.ZP.createElement(m.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:I},Z?(0,l.Z)(w("ChatList.DeleteForEveryone",Z)):w("DeleteForAll")),r.ZP.createElement(m.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:S},w(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"Chat.Input.Delete":h||f?"Group.LeaveGroup":p?"ChatList.DeleteForCurrentUser":"Delete")),r.ZP.createElement(m.Z,{className:"confirm-dialog-button",isText:!0,onClick:g},w("Cancel")))})))},2535:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),a=n(5376),s=n(2858),o=n(3657),i=n(2761),c=n(6202),l=n(6562),d=n(7002);const u=(0,r.X$)((({message:e,observeIntersection:t,smaller:n,uploadProgress:u,withDate:m,datetime:h,className:f,sender:v,isSelected:p,isSelectable:Z,onCancelUpload:g,onMediaClick:E,onDateClick:P})=>{const y=(0,r.sO)(null),C=e.content.document,b=(0,a.K2)(C)||"",{fileName:N,size:w,timestamp:k}=C,I=E&&Boolean(C.mediaType),T=(0,o.Op)(y,t),[S,M]=(0,r.eJ)(!1),{mediaData:L,downloadProgress:x}=(0,i.Z)((0,s.Ti)(e,"download"),!S,void 0,void 0,void 0,!0),{isUploading:$,isTransferring:A,transferProgress:F}=(0,s.Sc)(e,u||x,S),O=(0,a.v6)(C),D=O?(0,s.DH)(e):void 0,U=O?C.previewBlobUrl:void 0,R=(0,c.Z)((0,s.Ti)(e,"pictogram"),!T),B=(0,r.I4)((()=>{I?E():$?g&&g():M((e=>!e))}),[I,$,g,E]),V=(0,r.I4)((()=>{P(e.id,e.chatId)}),[P,e.id,e.chatId]);return(0,r.d4)((()=>{S&&L&&((0,l.Z)(L,N),M(!1))}),[N,L,S]),r.ZP.createElement(d.Z,{ref:y,name:N,extension:b,size:w,timestamp:m?h||k:void 0,thumbnailDataUri:D,previewData:U||R,smaller:n,isTransferring:A,isUploading:$,transferProgress:F,className:f,sender:v,isSelectable:Z,isSelected:p,actionIcon:I?(0,s.hC)(e)?"icon-play":"icon-eye":"icon-download",onClick:B,onDateClick:P?V:void 0})}))},7002:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),a=n(1212),s=n(8835),o=n(6752),i=n(790),c=n(5376),l=n(4399),d=n(2340),u=n(9107),m=n(9196),h=n(8033);const f=(0,r.X$)((({ref:e,name:t,size:n,extension:f="",timestamp:v,sender:p,thumbnailDataUri:Z,previewData:g,className:E,smaller:P,isTransferring:y,isUploading:C,isSelectable:b,isSelected:N,transferProgress:w,actionIcon:k,onClick:I,onDateClick:T})=>{const S=(0,u.Z)();let M=(0,r.sO)(null);e&&(M=e);const{shouldRender:L,transitionClassNames:x}=(0,a.Z)(y,void 0,!0),$=(0,c.Oh)(f),A=(0,c.yW)(n),{shouldRenderThumb:F,shouldRenderFullMedia:O,transitionClassNames:D}=(0,s.Z)(g,"slow"),{width:U,height:R}=(0,l.lE)(P),B=(0,o.Z)("File",E,P&&"smaller",I&&!C&&"interactive",N&&"file-is-selected");return r.ZP.createElement("div",{ref:M,className:B,dir:S.isRtl?"rtl":void 0},b&&r.ZP.createElement("div",{className:"message-select-control"},N&&r.ZP.createElement("i",{className:"icon-select"})),r.ZP.createElement("div",{className:"file-icon-container",onClick:C?void 0:I},Z||g?r.ZP.createElement("div",{className:"file-preview media-inner"},F&&r.ZP.createElement("img",{src:Z,width:U,height:R,className:"thumbnail",alt:""}),O&&r.ZP.createElement("img",{src:g,className:`full-media ${D}`,width:U,height:R,alt:""})):r.ZP.createElement("div",{className:`file-icon ${$}`},f.length<=4&&r.ZP.createElement("span",{className:"file-ext",dir:"auto"},f)),L&&r.ZP.createElement("div",{className:(0,o.Z)("file-progress",$,x)},r.ZP.createElement(m.Z,{progress:w,size:P?"s":"m",onClick:C?I:void 0})),I&&r.ZP.createElement("i",{className:(0,o.Z)("action-icon",k||"icon-download",L&&"hidden")})),r.ZP.createElement("div",{className:"file-info"},r.ZP.createElement("div",{className:"file-title",dir:"auto"},(0,d.Z)(t)),r.ZP.createElement("div",{className:"file-subtitle",dir:"auto"},r.ZP.createElement("span",null,y&&w?`${Math.round(100*w)}%`:A),p&&r.ZP.createElement("span",{className:"file-sender"},(0,d.Z)(p)),!p&&v&&r.ZP.createElement(r.ZP.Fragment,null," ",r.ZP.createElement(h.Z,{onClick:T},(0,i.ZK)(S,1e3*v))))),p&&v&&r.ZP.createElement(h.Z,{onClick:T},(0,i.VX)(S,1e3*v)))}))},8799:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),a=n(5116),s=n(1713),o=n(2858),i=n(8085),c=n(2340),l=n(782),d=n(9107),u=n(172),m=n(9411),h=n(8729);const f=(0,r.X$)((0,a.c$)(((e,{chatId:t})=>{const{lastSyncTime:n}=e,r=(0,i.Z1)(e,t);return{lastSyncTime:n,chat:r,onlineCount:r?(0,i.YK)(e,r):void 0,areMessagesLoaded:Boolean((0,i.Zw)(e,t))}}),((e,t)=>(0,l.ei)(t,["loadFullChat","openMediaViewer"])))((({typingStatus:e,avatarSize:t="medium",withMediaViewer:n,withUsername:a,withFullInfo:i,withUpdatingStatus:l,withChatType:f,noRtl:v,chat:p,onlineCount:Z,areMessagesLoaded:g,lastSyncTime:E,loadFullChat:P,openMediaViewer:y})=>{const C=p&&(0,o.ZV)(p),{id:b,isMin:N,isRestricted:w}=p||{};(0,r.d4)((()=>{b&&!N&&i&&E&&P({chatId:b})}),[b,N,E,i,P,C]);const k=(0,r.I4)(((e,n)=>{p&&n&&(e.stopPropagation(),y({avatarOwnerId:p.id,origin:"jumbo"===t?s.bZ.ProfileAvatar:s.bZ.MiddleHeaderAvatar}))}),[p,t,y]),I=(0,d.Z)();if(p)return r.ZP.createElement("div",{className:"ChatInfo",dir:!v&&I.isRtl?"rtl":void 0},r.ZP.createElement(u.Z,{key:p.id,size:t,chat:p,onClick:n?k:void 0}),r.ZP.createElement("div",{className:"info"},r.ZP.createElement("div",{className:"title"},r.ZP.createElement("h3",{dir:"auto"},(0,c.Z)((0,o.U)(I,p))),p.isVerified&&r.ZP.createElement(m.Z,null)),function(){if(l&&!g&&!w)return r.ZP.createElement("span",{className:"status",dir:"auto"},I("Updating"));if(!p)return;if(e)return r.ZP.createElement(h.Z,{typingStatus:e});if(f)return r.ZP.createElement("div",{className:"status",dir:"auto"},I((0,o.l6)(p)));const t=a?p.username:void 0,n=function(e,t){const n=e((0,o.l6)(t)),{membersCount:r}=t;return t.isRestricted?"Channel"===n?"channel is inaccessible":"group is inaccessible":r?e("Channel"===n?"Subscribers":"Members",r,"i"):n}(I,p),s=Z?`, ${I("OnlineCount",Z,"i")}`:void 0;return r.ZP.createElement("div",{className:"status"},t&&r.ZP.createElement("span",{className:"handle"},t),r.ZP.createElement("span",{className:"group-status"},n),s&&r.ZP.createElement("span",{className:"online-status"},s))}()))})))},6844:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(790),s=n(9107),o=n(8018);const i=(0,r.X$)((({message:e,outgoingStatus:t})=>{const n=(0,s.Z)();return r.ZP.createElement("div",{className:"LastMessageMeta"},t&&r.ZP.createElement(o.Z,{status:t}),r.ZP.createElement("span",{className:"time"},(0,a.VX)(n,1e3*e.date)))}))},3709:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(4050),a=n(790),s=n(2858),o=n(6202),i=n(8835);const c=(0,r.X$)((({message:e,idPrefix:t="shared-media",onClick:n})=>{const c=(0,r.I4)((()=>{n(e.id,e.chatId)}),[e.id,e.chatId,n]),l=(0,s.DH)(e),d=(0,o.Z)((0,s.Ti)(e,"pictogram")),{shouldRenderThumb:u,shouldRenderFullMedia:m,transitionClassNames:h}=(0,i.Z)(d,"slow"),f=(0,s.b7)(e);return r.ZP.createElement("div",{id:`${t}${e.id}`,className:"Media scroll-item",onClick:n?c:void 0},u&&r.ZP.createElement("img",{src:l,alt:""}),m&&r.ZP.createElement("img",{src:d,className:`${h} full-media`,alt:""}),f&&r.ZP.createElement("span",{className:"video-duration"},f.isGif?"GIF":(0,a.k9)(f.duration)))}))},8018:(e,t,n)=>{n.d(t,{Z:()=>o});var r,a=n(4050),s=n(2255);!function(e){e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read"}(r||(r={}));const o=(0,a.X$)((({status:e})=>a.ZP.createElement("div",{className:"MessageOutgoingStatus"},a.ZP.createElement(s.Z,{name:"reveal",activeKey:r[e]},(()=>a.ZP.createElement("i",{className:`icon-message-${e}`}))))))},7262:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(4050),a=n(6752),s=n(1212),o=n(2340),i=n(9107);const c=(0,r.X$)((({text:e="Nothing found.",description:t})=>{const n=(0,i.Z)(),{transitionClassNames:c}=(0,s.Z)(!0);return r.ZP.createElement("div",{className:(0,a.Z)("NothingFound",c,t&&"with-description")},e,t&&r.ZP.createElement("p",{className:"description"},(0,o.Z)(n(t),["br"])))}))},1820:(e,t,n)=>{n.d(t,{Z:()=>v});var r=n(4050),a=n(2858),s=n(1273),o=n(4605),i=n(7687),c=n(1876),l=n(6058),d=n(8799),u=n(9187),m=n(7407),h=n(9107),f=n(4288);const v=(0,r.X$)((({itemIds:e,selectedIds:t,filterValue:n,filterPlaceholder:v,notFoundText:p,searchInputId:Z,isLoading:g,noScrollRestore:E,onSelectedIdsChange:P,onFilterChange:y,onLoadMore:C})=>{const b=(0,r.sO)(null),N=t.length>10;(0,r.d4)((()=>{setTimeout((()=>{requestAnimationFrame((()=>{b.current.focus()}))}),500)}),[]);const w=(0,r.I4)((e=>{const n=[...t];n.includes(e)?n.splice(n.indexOf(e),1):n.push(e),P(n),y("")}),[t,P,y]),k=(0,r.I4)((e=>{const{value:t}=e.currentTarget;y(t)}),[y]),[I,T]=(0,m.Z)(C,e,Boolean(n)),S=(0,h.Z)();return r.ZP.createElement("div",{className:"Picker"},r.ZP.createElement("div",{className:"picker-header custom-scroll",dir:S.isRtl?"rtl":void 0},t.map(((e,n)=>r.ZP.createElement(u.Z,{chatOrUserId:e,isMinimized:N&&nr.ZP.createElement(c.Z,{key:e,className:"chat-item-clickable picker-list-item",onClick:()=>w(e),ripple:!0},r.ZP.createElement(o.Z,{label:"",checked:t.includes(e)}),(0,a.YA)(e)?r.ZP.createElement(l.Z,{userId:e}):r.ZP.createElement(d.Z,{chatId:e}))))):g||!I||I.length?r.ZP.createElement(f.Z,null):r.ZP.createElement("p",{className:"no-results"},p||"Sorry, nothing found."))}))},9187:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),a=n(5116),s=n(8085),o=n(2858),i=n(2340),c=n(6752),l=n(9107),d=n(172);const u=(0,r.X$)((0,a.c$)(((e,{chatOrUserId:t})=>t?{chat:t?(0,s.Z1)(e,t):void 0,user:(0,o.YA)(t)?(0,s.dy)(e,t):void 0}:{}))((({icon:e,title:t,isMinimized:n,canClose:a,onClick:s,clickArg:u,chat:m,user:h,className:f})=>{const v=(0,l.Z)();let p,Z;if(e&&t)p=r.ZP.createElement("div",{className:"item-icon"},r.ZP.createElement("i",{className:`icon-${e}`})),Z=t;else if(m||h){p=r.ZP.createElement(d.Z,{chat:m,user:h,size:"small",isSavedMessages:null==h?void 0:h.isSelf});const e=!m||h&&!h.isSelf?(0,o.Vl)(h):(0,o.U)(v,m,h);Z=e?(0,i.Z)(e):void 0}const g=(0,c.Z)("PickerSelectedItem",f,n&&"minimized",a&&"closeable");return r.ZP.createElement("div",{className:g,onClick:()=>s(u),title:n?Z:void 0,dir:v.isRtl?"rtl":void 0},p,!n&&r.ZP.createElement("div",{className:"item-name",dir:"auto"},Z),a&&r.ZP.createElement("div",{className:"item-remove"},r.ZP.createElement("i",{className:"icon-close"})))})))},6058:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),a=n(5116),s=n(1713),o=n(8085),i=n(2858),c=n(2340),l=n(782),d=n(9107),u=n(172),m=n(9411),h=n(8729);const f=(0,r.X$)((0,a.c$)(((e,{userId:t,forceShowSelf:n})=>{const{lastSyncTime:r,serverTimeOffset:a}=e,s=(0,o.dy)(e,t);return{lastSyncTime:r,user:s,isSavedMessages:!n&&s&&s.isSelf,areMessagesLoaded:Boolean((0,o.Zw)(e,t)),serverTimeOffset:a}}),((e,t)=>(0,l.ei)(t,["loadFullUser","openMediaViewer"])))((({typingStatus:e,avatarSize:t="medium",status:n,withMediaViewer:a,withUsername:o,withFullInfo:l,withUpdatingStatus:f,noStatusOrTyping:v,noRtl:p,user:Z,isSavedMessages:g,areMessagesLoaded:E,lastSyncTime:P,loadFullUser:y,openMediaViewer:C,serverTimeOffset:b})=>{const{id:N}=Z||{},w=(0,i.Js)(Z);(0,r.d4)((()=>{l&&P&&N&&y({userId:N})}),[N,y,P,l]);const k=(0,r.I4)(((e,n)=>{Z&&n&&(e.stopPropagation(),C({avatarOwnerId:Z.id,origin:"jumbo"===t?s.bZ.ProfileAvatar:s.bZ.MiddleHeaderAvatar}))}),[Z,t,C]),I=(0,d.Z)();if(Z)return r.ZP.createElement("div",{className:"ChatInfo",dir:!p&&I.isRtl?"rtl":void 0},r.ZP.createElement(u.Z,{key:Z.id,size:t,user:Z,isSavedMessages:g,onClick:a?k:void 0}),r.ZP.createElement("div",{className:"info"},g?r.ZP.createElement("div",{className:"title"},r.ZP.createElement("h3",null,I("SavedMessages"))):r.ZP.createElement("div",{className:"title"},r.ZP.createElement("h3",{dir:"auto"},w&&(0,c.Z)(w)),(null==Z?void 0:Z.isVerified)&&r.ZP.createElement(m.Z,null)),(n||!g&&!v)&&(n?r.ZP.createElement("span",{className:"status",dir:"auto"},n):f&&!E?r.ZP.createElement("span",{className:"status",dir:"auto"},I("Updating")):Z?e?r.ZP.createElement(h.Z,{typingStatus:e}):r.ZP.createElement("div",{className:"status "+((0,i.kM)(Z)?"online":"")},o&&Z.username&&r.ZP.createElement("span",{className:"handle"},Z.username),r.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,i.Tq)(I,Z,b))):void 0)))})))},787:(e,t,n)=>{n.d(t,{Z:()=>N});var r=n(4050),a=n(5116),s=n(1713),o=n(7361),i=n(8085),c=n(2858),l=n(2340),d=n(782),u=n(1174),m=n(6752),h=n(6137),f=n(647),v=n(9107),p=n(9411),Z=n(2155),g=n(6202),E=n(2937),P=n(7204),y=n(9204);const C=(0,r.X$)((({chat:e,user:t,photo:n,isFirstPhoto:a,isSavedMessages:s,lastSyncTime:o,onClick:i})=>{const d=(0,v.Z)(),u=t&&(0,c.NB)(t);function f(r="big",a){if(n&&!a)return`photo${n.id}?size=c`;let o;return s||u||(t?o=(0,c.RT)(t,r):e&&(o=(0,c.RT)(e,r))),o}const p=f(),C=(0,g.Z)(p,!1,null!=p&&p.startsWith("avatar")?h.IU.DataUri:h.IU.BlobUrl,o),b=(0,g.Z)(!C&&a?f("normal",!0):void 0,!1,h.IU.DataUri,o),N=(0,E.Z)(!C&&n&&n.thumbnail&&n.thumbnail.dataUri),w=C||b||N,k=(0,P.Z)(w);let I="";if(s)I=r.ZP.createElement("i",{className:"icon-avatar-saved-messages"});else if(u)I=r.ZP.createElement("i",{className:"icon-avatar-deleted-account"});else if(w)I=r.ZP.createElement("img",{src:w,className:"avatar-media",alt:"",decoding:"async"});else if(!w&&t){const e=(0,c.Js)(t);I=e?(0,Z.Xv)(e,2):void 0}else if(!w&&e){const t=(0,c.U)(d,e);I=t&&(0,Z.Xv)(t,(0,c.YA)(e.id)?2:1)}else I=r.ZP.createElement("div",{className:"spinner-wrapper"},r.ZP.createElement(y.Z,{color:"white"}));const T=(0,m.Z)("ProfilePhoto",`color-bg-${(0,c.Rs)(t||e)}`,s&&"saved-messages",u&&"deleted-account",!s&&!w&&"no-photo");return r.ZP.createElement("div",{className:T,onClick:w?i:void 0},k&&w&&k!==w&&r.ZP.createElement("img",{src:k,className:"prev-avatar-media",alt:"",decoding:"async"}),"string"==typeof I?(0,l.Z)(I,["hq_emoji"]):I)}));var b=n(2255);const N=(0,r.X$)((0,a.c$)(((e,{userId:t,forceShowSelf:n})=>{const{connectionState:r,serverTimeOffset:a}=e,s=(0,i.dy)(e,t),o=(0,i.Z1)(e,t),c=!n&&s&&s.isSelf,{animationLevel:l}=e.settings.byKey;return{connectionState:r,user:s,chat:o,isSavedMessages:c,animationLevel:l,serverTimeOffset:a}}),((e,t)=>(0,d.ei)(t,["loadFullUser","openMediaViewer"])))((({forceShowSelf:e,user:t,chat:n,isSavedMessages:a,connectionState:i,animationLevel:d,loadFullUser:Z,openMediaViewer:g,serverTimeOffset:E})=>{var P;const{id:y}=t||{},{id:N}=n||{},w=t?(0,c.Js)(t):n?n.title:"",k=(null==t?void 0:t.photos)||(null==n?void 0:n.photos)||[],I=d>=1?"slide":"none",[T,S]=(0,r.eJ)(0),M=a||k.length<=1||0===T,L=a||k.length<=1||T===k.length-1;(0,r.d4)((()=>{T>k.length&&S(Math.max(0,k.length-1))}),[T,k.length]);const x=(0,v.Z)();(0,r.d4)((()=>{"connectionStateReady"===i&&y&&!e&&Z({userId:y})}),[y,Z,i,e]),function(e,t,n){(0,r.d4)((()=>{t.slice(n,n+4).forEach((e=>{f.UV(`photo${e.id}?size=c`)||f.he(`photo${e.id}?size=c`,h.IU.BlobUrl)}))}),[n,t])}(0,k,T);const $=(0,r.I4)((()=>{g({avatarOwnerId:y||N,profilePhotoIndex:T,origin:e?s.bZ.SettingsAvatar:s.bZ.ProfileAvatar})}),[g,y,N,T,e]),A=(0,r.I4)((()=>{M||S(T-1)}),[T,M]),F=(0,r.I4)((()=>{L||S(T+1)}),[T,L]);if((0,r.d4)((()=>{const e=document.querySelector(".photo-wrapper");if(e)return(0,u.s)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:o.$b?(e,t)=>t===u.e.Right?(A(),!0):t===u.e.Left&&(F(),!0):void 0})}),[F,A]),!t&&!n)return;function O(){const e=!a&&k&&k.length>0?k[T]:void 0;return r.ZP.createElement(C,{key:T,user:t,chat:n,photo:e,isSavedMessages:a,isFirstPhoto:M,onClick:$})}const D=null===(P=t||n)||void 0===P?void 0:P.isVerified;return r.ZP.createElement("div",{className:(0,m.Z)("ProfileInfo",e&&"self"),dir:x.isRtl?"rtl":void 0},r.ZP.createElement("div",{className:"photo-wrapper"},function(){if(!(a||!k||k.length<=1))return r.ZP.createElement("div",{className:"photo-dashes"},k.map(((e,t)=>r.ZP.createElement("span",{className:"photo-dash "+(t===T?"current":"")}))))}(),r.ZP.createElement(b.Z,{activeKey:T,name:I,className:"profile-slide-container"},O),!M&&r.ZP.createElement("button",{type:"button",className:"navigation prev","aria-label":x("AccDescrPrevious"),onClick:A}),!L&&r.ZP.createElement("button",{type:"button",className:"navigation next","aria-label":x("Next"),onClick:F})),r.ZP.createElement("div",{className:"info",dir:x.isRtl?"rtl":"auto"},a?r.ZP.createElement("div",{className:"title"},r.ZP.createElement("h3",{dir:"auto"},x("SavedMessages"))):r.ZP.createElement("div",{className:"title"},r.ZP.createElement("h3",{dir:"auto"},w&&(0,l.Z)(w)),D&&r.ZP.createElement(p.Z,null)),!a&&(t?r.ZP.createElement("div",{className:"status "+((0,c.kM)(t)?"online":"")},r.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,c.Tq)(x,t,E))):r.ZP.createElement("span",{className:"status",dir:"auto"},(0,c.eA)(n)?x("Subscribers",null!==(U=n.membersCount)&&void 0!==U?U:0,"i"):x("Members",null!==(R=n.membersCount)&&void 0!==R?R:0,"i")))));var U,R})))},3547:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),a=n(6137),s=n(3657),o=n(6202),i=n(8835),c=n(706),l=n(6752),d=n(386),u=n(7799),m=n(231);const h=(0,r.X$)((({sticker:e,size:t,observeIntersection:n,noAnimate:h,title:f,className:v,onClick:p,clickArg:Z,onUnfaveClick:g})=>{const E=(0,r.sO)(null),P=`sticker${e.id}`,y=`sticker-button-${e.id}`,C=(0,s.Op)(E,n),b=e.thumbnail?e.thumbnail.dataUri:void 0,N=(0,o.Z)(`${P}?size=m`,!C,a.IU.BlobUrl),w=C&&!h,k=(0,o.Z)(e.isAnimated&&P,!w,a.IU.Lottie),[I,T,S]=(0,c.Z)(Boolean(k)),M=I&&w,{shouldRenderThumb:L,shouldRenderFullMedia:x,transitionClassNames:$}=(0,i.Z)(N||M,"slow");(0,r.d4)((()=>{w||S()}),[S,w]);const A=(0,l.Z)("StickerButton",e.isAnimated&&"animated",y,v),F=L&&b?`background-image: url('${b}');`:"";return r.ZP.createElement("div",{ref:E,className:A,title:f||(null==e?void 0:e.emoji),style:F,"data-sticker-id":e.id,onMouseDown:d.b,onClick:function(){p&&p(Z)}},x&&!M&&r.ZP.createElement("img",{src:N,className:$}),w&&k&&r.ZP.createElement(u.Z,{id:P,animationData:k,play:!0,size:t,isLowPriority:!0,onLoad:T}),g&&r.ZP.createElement(m.Z,{className:"sticker-unfave-button",color:"dark",round:!0,onClick:function(t){t.stopPropagation(),t.preventDefault(),g(e)}},r.ZP.createElement("i",{className:"icon-close"})))}))},4851:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(9203),s=n(8778);const o=(0,r.X$)((e=>{const{isOpen:t}=e,n=(0,s.Z)(a.gl.Extra,"StickerSetModal",!t);return n?r.ZP.createElement(n,e):void 0}))},8729:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(4050),a=n(5116),s=n(8085),o=n(2858),i=n(2340),c=n(9107);const l=(0,r.X$)((0,a.c$)(((e,{typingStatus:t})=>t.userId?{typingUser:(0,s.dy)(e,t.userId)}:{}))((({typingStatus:e,typingUser:t})=>{const n=(0,c.Z)(),a=t&&!t.isSelf&&(0,o.Vl)(t);return r.ZP.createElement("p",{className:"typing-status",dir:n.isRtl?"rtl":"auto"},a&&r.ZP.createElement("span",{className:"sender-name",dir:"auto"},(0,i.Z)(a)),n(e.action).replace("{user}","").trim(),r.ZP.createElement("span",{className:"ellipsis"}))})))},9411:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050);const a=()=>r.ZP.createElement("span",{className:"VerifiedIcon"})},5418:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),a=n(2858),s=n(6752),o=n(8035),i=n(2340),c=n(790),l=n(9107),d=n(3709),u=n(8033),m=n(88);const h=(0,r.X$)((({message:e,senderTitle:t,onMessageClick:n})=>{const h=(0,l.Z)();let f=(0,a.s1)(e);if(!f){const t=(0,a.T7)(e);if(t){const{url:n,domain:r}=t,s=(0,a.MK)(h,e);f={siteName:r.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,description:s!==n?s:void 0}}}const v=(0,r.I4)((()=>{n(e.id,e.chatId)}),[n,e.id,e.chatId]);if(!f)return;const{siteName:p,url:Z,displayUrl:g,title:E,description:P,photo:y,video:C}=f,b=!t&&(0,o.Z)(P,170),N=(0,s.Z)("WebLink scroll-item",!y&&!C&&"without-media");return r.ZP.createElement("div",{className:N,"data-initial":(p||g)[0],dir:h.isRtl?"rtl":void 0},y&&r.ZP.createElement(d.Z,{message:e}),r.ZP.createElement("div",{className:"content"},r.ZP.createElement(u.Z,{isRtl:h.isRtl,className:"site-title",onClick:v},(0,i.Z)(E||p||g)),b&&r.ZP.createElement(u.Z,{isRtl:h.isRtl,className:"site-description",onClick:v},(0,i.Z)(b)),r.ZP.createElement(m.Z,{url:Z,className:"site-name",text:"",isRtl:h.isRtl},Z.replace("mailto:","")||g),t&&r.ZP.createElement("div",{className:"sender-name"},(0,i.Z)(t))),t&&r.ZP.createElement("div",{className:"message-date"},r.ZP.createElement(u.Z,{className:"date",onClick:v,isRtl:h.isRtl},(0,c.VX)(h,1e3*e.date))))}))},4399:(e,t,n)=>{n.d(t,{L6:()=>i,Gw:()=>c,vw:()=>l,vY:()=>d,wB:()=>u,kc:()=>p,fM:()=>g,Eh:()=>E,GC:()=>P,W7:()=>y,lE:()=>C,Wr:()=>b,PA:()=>N,jg:()=>w});var r=n(3716),a=n(7361),s=n(3858),o=n(2858);const i="(max-height: 640px)",c=parseInt(getComputedStyle(document.documentElement).fontSize,10),l=200,d={width:640,height:640},u="1258816259753933",m={width:100,height:100};let h,f,v;function p(e,t,n,r){const o=t||n?1.625:0;return(function(e,t){const n=e?30:29;if(!a.wB)return n;const{width:r}=s.Z.get();return h||(h=Math.min(30,r/c-4.5)),f||(f=Math.min(29,r/c-7)),v||(v=Math.min(29,r/c-4.5)),e?h:t?v:f}(e,r)-o)*c}function Z({width:e,height:t,fromOwnMessage:n,isForwarded:r,isWebPagePhoto:a,isGif:s,noAvatars:o}){const i=t/e;return w(p(n,r,a,o),function(e,t){return e&&t&&t>=.75&&t<=1.25?20*c:27*c}(s,i),e,t)}function g(e,t){const n=window.matchMedia(i),{width:r,height:a}=s.Z.get();let o=t&&n.matches?10:8.25;return e&&(o=n.matches?10:15),{width:r,height:a-o*c}}function E(e,t,n,r,a){const{width:s,height:i}=(0,o.HV)(e)||m;return Z({width:s,height:i,fromOwnMessage:t,isForwarded:n,isWebPagePhoto:r,noAvatars:a})}function P(e,t,n,r){const{width:a,height:s}=(0,o.jC)(e)||m;return Z({width:a,height:s,fromOwnMessage:t,isForwarded:n,isGif:e.isGif,noAvatars:r})}function y(){return{width:2*c,height:2*c}}function C(e){return e?{width:3*c,height:3*c}:{width:3.375*c,height:3.375*c}}function b(e){const{width:t}=e;let{height:n}=e;e.id===u&&(n=t);const s=n&&t&&n/t,o=c*(a.wB?r.w7:r.K7),i=s?o*s:o;return s&&i>o?{width:Math.round(o/s),height:o}:{width:o,height:i}}function N({width:e,height:t},n,r=!1){const{width:a,height:s}=g(n,r);return w(a,s,e,t)}function w(e,t,n,r){const a=r/n,s=Math.min(n,e);return Math.round(s*a)>t?{width:Math.round(t/a),height:t}:{width:s,height:Math.round(s*a)}}},935:(e,t,n)=>{n.d(t,{X:()=>d,H:()=>h});var r=n(4050),a=n(5116),s=n(6137),o=n(2858),i=n(2340),c=n(7373),l=n(88);function d(e,t,n){const r=e.content.text;if(!r||!r.text){const t=(0,o.UD)(e);return t?[t]:void 0}const{text:a,entities:s}=r;return h(a,s,t,n)}function u(e,t,n,r){const{offset:a,length:s}=e,o=new Set([t]);if(r.has(t))return;const i=[];return n.filter(((e,n)=>n>t&&e.offset>=a&&e.offsetu(e,n.indexOf(e),n,r))).filter(Boolean).forEach((e=>{let t=!1;e.organizedIndexes.forEach((e=>{t||o.has(e)||(t=!0),o.add(e)})),t&&i.push(e)})),{entity:e,organizedIndexes:o,nestedEntities:i}}function m(e){const t=new Set,n=[];return e.forEach(((r,a)=>{if(t.has(a))return;const s=u(r,a,e,t);s&&(s.organizedIndexes.forEach((e=>{t.add(e)})),n.push(s))})),n}function h(e,t,n,a,o){if(!t||!t.length)return f(e,n,a,o);const d=[];let u=!1;const h=m(t);function g(t,d,m,h){const E=[],{entity:P,nestedEntities:y}=m,{offset:C,length:b,type:N}=P;let w=e.substring(t,C);const k=w.length;w&&(u&&w.length>0&&"\n"===w[0]&&(w=w.substr(1),u=!1),w&&E.push(...f(w,n,a,o)));const I=t+k,T=I+b;let S=e.substring(C,C+b);const M=[];if(u&&S.length>0&&"\n"===S[0]&&(S=S.substr(1),u=!1),N===s.Vv.Pre&&(u=!0),y.length){let e=I;y.forEach(((t,n)=>{const{renderResult:r,entityEndIndex:a}=g(e,T,t,n===y.length-1);M.push(...r),e=a}))}const L=o?function(e,t,n){const r="string"==typeof t&&t,a=n.length?n.join(""):(0,i.Z)(t,["escape_html","emoji_html","br_html"]).join("");if(!r)return a;switch(e.type){case s.Vv.Bold:return`${a}`;case s.Vv.Italic:return`${a}`;case s.Vv.Underline:return`${a}`;case s.Vv.Code:return`${a}`;case s.Vv.Pre:return`\`\`\`
${a}
\`\`\``;case s.Vv.Strike:return`${a}`;case s.Vv.MentionName:return`${a}`;case s.Vv.Url:case s.Vv.TextUrl:return`${a}`;default:return a}}(P,S,M):function(e,t,n){const a="string"==typeof t&&t,o=n.length?n:t;if(!a)return f(o);switch(e.type){case s.Vv.Bold:return r.ZP.createElement("strong",null,f(o));case s.Vv.Blockquote:return r.ZP.createElement("blockquote",null,f(o));case s.Vv.BotCommand:return r.ZP.createElement("a",{onClick:p,className:"text-entity-link",dir:"auto"},f(o));case s.Vv.Hashtag:case s.Vv.Cashtag:return r.ZP.createElement("a",{onClick:Z,className:"text-entity-link",dir:"auto"},f(o));case s.Vv.Code:return r.ZP.createElement("code",{className:"text-entity-code"},f(o));case s.Vv.Email:return r.ZP.createElement("a",{href:`mailto:${a}`,target:"_blank",rel:"noopener noreferrer",className:"text-entity-link",dir:"auto"},f(o));case s.Vv.Italic:return r.ZP.createElement("em",null,f(o));case s.Vv.MentionName:return r.ZP.createElement(c.Z,{userId:e.userId},f(o));case s.Vv.Mention:return r.ZP.createElement(c.Z,{username:a},f(o));case s.Vv.Phone:return r.ZP.createElement("a",{href:`tel:${a}`,className:"text-entity-link",dir:"auto"},f(o));case s.Vv.Pre:return r.ZP.createElement("pre",{className:"text-entity-pre"},f(o));case s.Vv.Strike:return r.ZP.createElement("del",null,f(o));case s.Vv.TextUrl:case s.Vv.Url:return r.ZP.createElement(l.Z,{url:v(a,e),text:a},f(o));case s.Vv.Underline:return r.ZP.createElement("ins",null,f(o));default:return f(o)}}(P,S,M);if(Array.isArray(L)?E.push(...L):E.push(L),h&&T0&&"\n"===t[0]&&(t=t.substring(1)),t&&E.push(...f(t,n,a,o))}return{renderResult:E,entityEndIndex:T}}let E=0;return h.forEach(((t,n)=>{const{renderResult:r,entityEndIndex:a}=g(E,e.length,t,n===h.length-1);d.push(...r),E=a})),d}function f(e,t,n,r){if(Array.isArray(e)){const a=[];return e.forEach((e=>{a.push(...f(e,t,n,r))})),a}if(r)return(0,i.Z)(e,["escape_html","emoji_html","br_html"]);const a=n?"hq_emoji":"emoji";return t?(0,i.Z)(e,[a,"br","highlight"],{highlight:t}):(0,i.Z)(e,[a,"br"])}function v(e,t){const{type:n,url:r}=t;return n===s.Vv.TextUrl&&r?r:e}function p(e){(0,a.uC)().sendBotCommand({command:e.currentTarget.innerText})}function Z(e){(0,a.uC)().setLocalTextSearchQuery({query:e.currentTarget.innerText}),(0,a.uC)().searchTextMessagesLocal()}},9359:(e,t,n)=>{n.d(t,{Z:()=>B});var r=n(4050),a=n(5116),s=n(3716),o=n(7361),i=n(7204),c=n(782),l=n(2858),d=n(8085),u=n(7407);let m;!function(e){e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None"}(m||(m={}));var h=n(1273),f=n(4288),v=n(9107),p=n(6137),Z=n(2864),g=n(2340),E=n(9118),P=n(6752),y=n(5790),C=n(1470),b=n(706),N=n(6202),w=n(172),k=n(9411),I=n(8729),T=n(6844),S=n(329),M=n(1876),L=n(2155),x=n(126);const $=(0,r.X$)((({chat:e,isPinned:t,isMuted:n})=>{const a=Boolean(e.unreadCount||e.hasUnreadMark||t),s=(0,P.Z)("Badge",n&&"muted",t&&"pinned",Boolean(e.unreadCount||e.hasUnreadMark)&&"unread");function o(){return e.unreadCount?e.unreadMentionsCount?r.ZP.createElement("div",{className:"Badge-wrapper"},r.ZP.createElement("div",{className:"Badge mention"},r.ZP.createElement("i",{className:"icon-mention"})),r.ZP.createElement("div",{className:s},(0,L.bi)(e.unreadCount))):r.ZP.createElement("div",{className:s},(0,L.bi)(e.unreadCount)):e.hasUnreadMark?r.ZP.createElement("div",{className:s}):t?r.ZP.createElement("div",{className:s},r.ZP.createElement("i",{className:"icon-pinned-chat"})):void 0}return r.ZP.createElement(x.Z,{isCustom:!0,className:"Badge-transition",isOpen:a},o)})),A=(0,r.X$)((0,a.c$)(((e,{chatId:t})=>{const n=(0,d.Z1)(e,t);if(!n||!n.lastMessage)return{};const{senderId:r,replyToMessageId:a,isOutgoing:s}=n.lastMessage,o=r?(0,d.dy)(e,r):void 0,i=(0,l.N5)(n.lastMessage),c=i&&a?(0,d.hj)(e,n.id,a):void 0,{targetUserIds:u,targetChatId:m}=i||{},h=(0,l.zX)(n),{byId:f}=e.users,{chatId:v,threadId:Z,type:g}=(0,d.Bt)(e)||{},E=t===v&&Z===p._f;return{chat:n,isMuted:(0,l.i4)(n,(0,d.dZ)(e),(0,d.NJ)(e)),lastMessageSender:o,actionTargetUserIds:u,actionTargetChatId:m,actionTargetMessage:c,draft:(0,d.Ms)(e,t,p._f),animationLevel:e.settings.byKey.animationLevel,isSelected:E,canScrollDown:E&&"thread"===g,lastSyncTime:e.lastSyncTime,...s&&{lastMessageOutgoingStatus:(0,d.dT)(e,n.lastMessage)},...h&&{privateChatUser:(0,d.dy)(e,h)},...u&&{usersById:f}}}),((e,t)=>(0,c.ei)(t,["openChat","focusLastMessage"])))((({style:e,chatId:t,folderId:n,orderDiff:a,animationType:i,isPinned:c,chat:d,isMuted:u,privateChatUser:h,actionTargetUserIds:f,usersById:p,lastMessageSender:L,lastMessageOutgoingStatus:x,actionTargetMessage:A,actionTargetChatId:F,draft:O,animationLevel:D,isSelected:U,canScrollDown:R,lastSyncTime:B,openChat:V,focusLastMessage:X})=>{const j=(0,r.sO)(null),[H,K,q]=(0,b.Z)(),[z,J,Y]=(0,b.Z)(),{lastMessage:W,typingStatus:_}=d||{},G=W&&(0,l.Lo)(W);(0,y.Z)(t,G?W.replyToMessageId:void 0,A);const Q=W&&!(0,l.bf)(W)?(0,l.DH)(W):void 0,ee=(0,N.Z)(W?(0,l.Ti)(W,"micro"):void 0),te=Boolean(W&&(0,l.Y5)(W)),ne=(0,r.Ye)((()=>f?f.map((e=>null==p?void 0:p[e])).filter(Boolean):void 0),[f,p]);(0,r.bt)((()=>{const e=j.current;if(0!==D&&e){if(i===m.Opacity)e.style.opacity="0",(0,E.T2)((()=>{e.classList.add("animate-opacity"),e.style.opacity="1"}));else{if(i!==m.Move)return;e.style.transform=`translate3d(0, ${100*-a}%, 0)`,(0,E.T2)((()=>{e.classList.add("animate-transform"),e.style.transform=""}))}setTimeout((()=>{(0,E.T2)((()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""}))}),200+s.fK)}}),[D,a,i]);const re=(0,r.I4)((()=>{V({id:t,shouldReplaceHistory:!0}),U&&R&&X()}),[U,R,V,t,X]),ae=(0,C.Z)({chat:d,privateChatUser:h,handleDelete:function(){J(),K()},folderId:n,isPinned:c,isMuted:u}),se=(0,v.Z)();if(!d)return;const oe=(0,P.Z)("Chat chat-item-clickable",(0,l.YA)(t)?"private":"group",U&&"selected");return r.ZP.createElement(M.Z,{ref:j,className:oe,style:e,ripple:!o.wB,contextActions:ae,onClick:re},r.ZP.createElement("div",{className:"status"},r.ZP.createElement(w.Z,{chat:d,user:h,withOnlineStatus:!0,isSavedMessages:null==h?void 0:h.isSelf,lastSyncTime:B})),r.ZP.createElement("div",{className:"info"},r.ZP.createElement("div",{className:"title"},r.ZP.createElement("h3",null,(0,g.Z)((0,l.U)(se,d,h))),d.isVerified&&r.ZP.createElement(k.Z,null),u&&r.ZP.createElement("i",{className:"icon-muted-chat"}),d.lastMessage&&r.ZP.createElement(T.Z,{message:d.lastMessage,outgoingStatus:x})),r.ZP.createElement("div",{className:"subtitle"},function(){if(_&&W&&_.timestamp>1e3*W.date)return r.ZP.createElement(I.Z,{typingStatus:_});if(null!=O&&O.text.length)return r.ZP.createElement("p",{className:"last-message",dir:se.isRtl?"auto":"ltr"},r.ZP.createElement("span",{className:"draft"},se("Draft")),(0,g.Z)(O.text));if(!W)return;if(G){const e=d&&((0,l.eA)(d)||W.senderId===W.chatId)?d:L;return r.ZP.createElement("p",{className:"last-message",dir:se.isRtl?"auto":"ltr"},(0,g.Z)((0,Z.D)(se,W,e,ne,A,F,{asPlain:!0})))}const e=(0,l.zF)(se,t,L);return r.ZP.createElement("p",{className:"last-message",dir:se.isRtl?"auto":"ltr"},e&&r.ZP.createElement(r.ZP.Fragment,null,r.ZP.createElement("span",{className:"sender-name"},(0,g.Z)(e)),r.ZP.createElement("span",{className:"colon"},":")),function(e,t,n,a){return n?r.ZP.createElement("span",{className:"media-preview"},r.ZP.createElement("img",{src:n,alt:"",className:a?"round":void 0}),(0,l.b7)(t)&&r.ZP.createElement("i",{className:"icon-play"}),(0,g.Z)((0,l.MK)(e,t,!0))):(0,g.Z)((0,l.MK)(e,t))}(se,W,ee||Q,te))}(),r.ZP.createElement($,{chat:d,isPinned:c,isMuted:u}))),z&&r.ZP.createElement(S.Z,{isOpen:H,onClose:q,onCloseAnimationEnd:Y,chat:d}))})));var F=n(1713),O=n(231),D=n(7854);const U=(0,r.X$)((0,a.c$)(((e,{folderId:t,folderType:n})=>({chatFolder:t&&"folder"===n?(0,d.Mw)(e,t):void 0,animatedEmoji:(0,d.zB)(e,"📂")})))((({chatFolder:e,animatedEmoji:t,foldersDispatch:n,onScreenSelect:a})=>{const s=(0,v.Z)(),i=(0,r.I4)((()=>{n({type:"editFolder",payload:e}),a(F.MT.FoldersEditFolderFromChatList)}),[e,n,a]);return r.ZP.createElement("div",{className:"EmptyFolder"},r.ZP.createElement("div",{className:"sticker"},t&&r.ZP.createElement(D.Z,{sticker:t})),r.ZP.createElement("h3",{className:"title",dir:"auto"},s("FilterNoChatsToDisplay")),r.ZP.createElement("p",{className:"description",dir:"auto"},s(e?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")),e&&n&&a&&r.ZP.createElement(O.Z,{ripple:!o.wB,fluid:!0,pill:!0,onClick:i,size:"smaller",isRtl:s.isRtl},r.ZP.createElement("i",{className:"icon-settings"}),s("ChatList.EmptyChatListEditFilter")))})));var R;!function(e){e.all="active",e.archived="archived"}(R||(R={}));const B=(0,r.X$)((0,a.c$)(((e,{folderType:t,folderId:n})=>{const{chats:{listIds:r,byId:a,orderedPinnedIds:s},users:{byId:o},lastSyncTime:i}=e,c="folder"!==t?R[t]:void 0,l=n?(0,d.Mw)(e,n):void 0;return{chatsById:a,usersById:o,lastSyncTime:i,notifySettings:(0,d.dZ)(e),notifyExceptions:(0,d.NJ)(e),...c?{listIds:r[c],orderedPinnedIds:s[c]}:{chatFolder:l}}}),((e,t)=>(0,c.ei)(t,["loadMoreChats","preloadTopChatMessages","openChat","openNextChat"])))((({folderType:e,folderId:t,isActive:n,chatFolder:a,chatsById:d,usersById:v,listIds:p,orderedPinnedIds:Z,lastSyncTime:g,foldersDispatch:E,notifySettings:P,notifyExceptions:y,onScreenSelect:C,loadMoreChats:b,preloadTopChatMessages:N,openChat:w,openNextChat:k})=>{const[I,T]=(0,r.Ye)((()=>"folder"===e&&a?(0,l.P4)(d,v,a,P,y):[p,Z]),[e,a,d,v,P,y,p,Z]),[S,M]=(0,r.Ye)((()=>{if(!I||"folder"===e&&!a)return[];const t=(0,l.O)(d,I,T,e),n=[...t.pinnedChats,...t.otherChats],r=n.map((({id:e})=>e));return[n.reduce(((e,t,n)=>(e[t.id]=n,e)),{}),r]}),[I,T,e,a,d]),L=(0,i.Z)(S),x=(0,r.Ye)((()=>S&&L?(0,c.Q8)(S,((e,t)=>e-(void 0!==L[t]?L[t]:1/0))):{}),[S,L]),$=(0,r.I4)((()=>{b({listType:"archived"===e?"archived":"active"})}),[b,e]),[F,O]=(0,u.Z)(g?$:void 0,M,void 0,s.t_,"all"===e&&!s.NM),D=F&&(0,l.O)(d,F,T,e);(0,r.d4)((()=>{g&&"all"===e&&N()}),[g,e,N]);const R=function(e){const t=(0,r.I4)((t=>e[t]<0),[e]),n=(0,r.I4)((t=>e[t]>0),[e]),a=Object.keys(e).map(Number),s=a.filter(t).length,o=a.filter(n).length;return(0,r.I4)((r=>{const a=e[r];return 0===a?m.None:a===1/0||a===-1/0||t(r)&&s<=o||n(r)&&o{const e=e=>{if(n&&M){if(o.fl&&(o.jm&&e.metaKey||!o.jm&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t)return;const n=Number(t)-1;if(n>M.length-1)return;w({id:M[n],shouldReplaceHistory:!0})}if(e.altKey){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(!t)return;e.preventDefault(),k({targetIndexDelta:t,orderedIds:M})}}};return document.addEventListener("keydown",e,!1),()=>{document.removeEventListener("keydown",e,!1)}})),r.ZP.createElement(h.Z,{className:"chat-list custom-scroll",items:F,onLoadMore:O,preloadBackwards:s.t_,noFastList:!0,noScrollRestore:!0},null!=F&&F.length&&D?function(){const e=M.indexOf(F[0]),n=e+D.pinnedChats.length;return r.ZP.createElement("div",{className:"scroll-container",style:o.wZ?`height: ${M.length*s.rS}px`:void 0,teactFastList:!0},D.pinnedChats.map((({id:n},a)=>r.ZP.createElement(A,{key:n,teactOrderKey:a,chatId:n,isPinned:!0,folderId:t,animationType:R(n),orderDiff:x[n],style:`top: ${(e+a)*s.rS}px;`}))),D.otherChats.map(((e,a)=>r.ZP.createElement(A,{key:e.id,teactOrderKey:(0,l.OE)(e),chatId:e.id,folderId:t,animationType:R(e.id),orderDiff:x[e.id],style:`top: ${(n+a)*s.rS}px;`}))))}():F&&!F.length?r.ZP.createElement(U,{folderId:t,folderType:e,foldersDispatch:E,onScreenSelect:C}):r.ZP.createElement(f.Z,{key:"loading"}))})))},2420:(e,t,n)=>{n.d(t,{t:()=>d,Z:()=>u});var r=n(4050),a=n(1212),s=n(6752),o=n(3989),i=n(7204),c=n(706);const l=(0,r.X$)((({isQuick:e,onFileSelect:t})=>{const[n,a,o]=(0,c.Z)(),i=(0,s.Z)("DropTarget",n&&"hovered");return r.ZP.createElement("div",{className:i,onDrop:t,onDragEnter:()=>{a()},onDragLeave:e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),o()}},r.ZP.createElement("div",{className:"target-content"},r.ZP.createElement("div",{className:"icon icon-"+(e?"photo":"document")}),r.ZP.createElement("div",{className:"title"},"Drop files here to send them"),r.ZP.createElement("div",{className:"description"},e?"in a quick way":"without compression")))}));let d;!function(e){e.None="none",e.Document="document",e.QuickFile="quick_file"}(d||(d={}));const u=(0,r.X$)((({isOpen:e,withQuick:t,onHide:n,onFileSelect:c})=>{const d=(0,r.sO)(null),u=(0,i.Z)(t),{shouldRender:m,transitionClassNames:h}=(0,a.Z)(e);(0,r.d4)((()=>e?(0,o.Z)(n):void 0),[e,n]);const f=(0,r.I4)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),c(Array.from(t.files),!1))}),[c,n]),v=(0,r.I4)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),c(Array.from(t.files),!0))}),[c,n]),p=(0,r.I4)((e=>{e.stopPropagation();const{target:t,relatedTarget:r}=e;t.matches(".DropTarget, .DropArea")&&!r&&(d.current=window.setTimeout((()=>{n()}),150))}),[n]);if(!m)return;const Z=(0,s.Z)("DropArea",h);return r.ZP.createElement("div",{className:Z,onDragLeave:p,onDragOver:()=>{d.current&&window.clearTimeout(d.current)},onDrop:n},r.ZP.createElement(l,{onFileSelect:f}),(t||u)&&r.ZP.createElement(l,{onFileSelect:v,isQuick:!0}))}))},9830:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(9203),s=n(8778);const o=(0,r.X$)((e=>{const{isOpen:t}=e,n=(0,s.Z)(a.gl.Extra,"EmojiTooltip",!t);return n?r.ZP.createElement(n,e):void 0}))},3616:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(4050),a=n(5116),s=n(3716),o=n(8085),i=n(9118),c=n(5723),l=n(6752),d=n(782),u=n(7361),m=n(517),h=n(2645),f=n(706),v=n(4784),p=n(6391),Z=n(9107),g=n(2340),E=n(3283);const P=u.wB?256:416,y=(0,r.X$)((0,a.c$)((e=>{const{chatId:t,threadId:n}=(0,o.Bt)(e)||{},{messageSendKeyCombo:r}=e.settings.byKey;return{currentChatId:t,messageSendKeyCombo:r,replyingToId:t&&n?(0,o.Yy)(e,t,n):void 0,noTabCapture:e.isPollModalOpen||e.payment.isPaymentModalOpen}}),((e,t)=>(0,d.ei)(t,["editLastMessage","replyToNextMessage"])))((({id:e,isAttachmentModalInput:t,editableInputId:n,html:a,placeholder:o,forcedPlaceholder:d,shouldSetFocus:y,shouldSuppressFocus:C,shouldSuppressTextFormatter:b,onUpdate:N,onSuppressedFocus:w,onSend:k,currentChatId:I,replyingToId:T,noTabCapture:S,messageSendKeyCombo:M,editLastMessage:L,replyToNextMessage:x})=>{const $=(0,r.sO)(null),A=(0,r.sO)(null),F=(0,Z.Z)(),O=(0,r.sO)(!1),[D,U,R]=(0,f.Z)(),[B,V]=(0,r.eJ)(),[X,j]=(0,r.eJ)();(0,r.d4)((()=>{t&&J(!1)}),[t]),(0,h.Z)((([e])=>{a!==$.current.innerHTML&&($.current.innerHTML=a),a!==A.current.innerHTML&&(A.current.innerHTML=a),void 0!==e&&e!==a&&J(!a.length)}),[a]);const H=(0,r.I4)((()=>{$.current.closest(".from, .to")?setTimeout(H,350):(0,c.Z)($.current)}),[]),K=(0,r.I4)((()=>{R(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()}),[R]);function q(){if(u.cj)return!1;const e=window.getSelection();if(!e||!e.rangeCount||O.current)return R(),!1;const t=e.getRangeAt(0),r=t.toString().trim();return!(b||!(0,p.R)(t,n||s.R2)||!r||(0,v.Z)(r)||!t.START_TO_END)||(R(),!1)}function z(){if(!q())return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=$.current.getBoundingClientRect();let r=t.left+t.width/2-n.left;r<90?r=90:r>n.width-90&&(r=n.width-90),V({x:r,y:t.top-n.top}),j(e),U()}function J(e=!1){const t=$.current,n=A.current,r=Number(t.style.height.replace("px","")),a=Math.min(n.scrollHeight,P);if(a===r)return;const s=Math.round(50*Math.log(Math.abs(a-r))),o=()=>{t.style.height=`${a}px`,t.style.transitionDuration=`${s}ms`,t.classList.toggle("overflown",n.scrollHeight>P)};e?requestAnimationFrame(o):o()}(0,r.d4)((()=>{u.$b||y&&H()}),[I,H,T,y]),(0,r.d4)((()=>{if(S)return;const e=(0,i.Ds)((e=>{"Tab"===e.key&&(e.preventDefault(),requestAnimationFrame(H))}),2e3,!0,!1);return(0,m.Z)({onTab:e})}),[H,S]),(0,r.d4)((()=>{const e=$.current;function t(){e.blur()}return C&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}}),[C]);const Y=(0,l.Z)("form-control custom-scroll",a.length>0&&"touched",C&&"focus-disabled");return r.ZP.createElement("div",{id:e,onClick:C?w:void 0,dir:F.isRtl?"rtl":void 0},r.ZP.createElement("div",{ref:$,id:n||s.R2,className:Y,contentEditable:!0,dir:"auto",onClick:H,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(N("
"===t?"":t),!(u.$b||n&&n.length)){const e=window.getSelection();e&&($.current.blur(),e.removeAllRanges(),(0,c.Z)($.current,!0))}},onKeyDown:function(e){if(e.metaKey&&!a.length){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void x({targetIndexDelta:t})}"Enter"!==e.key||e.shiftKey?"ArrowUp"!==e.key||a.length||e.metaKey||e.altKey?e.target.addEventListener("keyup",(function t(){z(),e.target.removeEventListener("keyup",t)})):(e.preventDefault(),L()):u.cj||u.wZ||!("enter"===M&&!e.shiftKey||"ctrl-enter"===M&&(e.ctrlKey||e.metaKey))||(e.preventDefault(),R(),k())},onMouseDown:function(e){2===e.button?!0!==O.current&&(O.current=!0,document.addEventListener("mousedown",(function e(){setTimeout((()=>{O.current=!1}),100),window.removeEventListener("mouseup",e)})),document.addEventListener("keydown",(function e(t){"Esc"!==t.key&&"Escape"!==t.key||(setTimeout((()=>{O.current=!1}),100),window.removeEventListener("keydown",e))}))):e.target.addEventListener("mouseup",(function t(){z(),e.target.removeEventListener("mouseup",t)}))},onContextMenu:u.wZ?function(e){q()&&(e.preventDefault(),e.stopPropagation())}:void 0,onTouchCancel:u.wZ?z:void 0}),r.ZP.createElement("div",{ref:A,className:(0,l.Z)(Y,"clone"),dir:"auto"}),!d&&r.ZP.createElement("span",{className:"placeholder-text",dir:"auto"},o),r.ZP.createElement(E.Z,{isOpen:D,anchorPosition:B,selectedRange:X,onClose:K}),d&&r.ZP.createElement("span",{className:"forced-placeholder"},(0,g.Z)(d)))})))},3283:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),a=n(3716),s=n(6752),o=n(3989),i=n(1212),c=n(8758),l=n(706),d=n(9107),u=n(231);const m={B:"bold",STRONG:"bold",I:"italic",EM:"italic",U:"underline",DEL:"strikethrough",CODE:"monospace"},h=document.createElement("div"),f=(0,r.X$)((({isOpen:e,anchorPosition:t,selectedRange:n,onClose:f})=>{const v=(0,r.sO)(null),p=(0,r.sO)(null),{shouldRender:Z,transitionClassNames:g}=(0,i.Z)(e),[E,P,y]=(0,l.Z)(),[C,b]=(0,r.eJ)(""),[N,w]=(0,r.eJ)(!1),[k,I]=(0,r.eJ)(),[T,S]=(0,r.eJ)({});(0,r.d4)((()=>e?(0,o.Z)(f):void 0),[e,f]),(0,c.Z)(e,v,f),(0,r.d4)((()=>{E?p.current.focus():(b(""),w(!1))}),[E]),(0,r.d4)((()=>{Z||(y(),S({}),I(void 0))}),[y,Z]),(0,r.d4)((()=>{if(!e||!n)return;const t={};let{parentElement:r}=n.commonAncestorContainer;for(;r&&r.id!==a.R2;){const e=m[r.tagName];e&&(t[e]=!0),r=r.parentElement}S(t)}),[e,n,P]);const M=(0,r.I4)((()=>{if(n)return h.innerText=n.toString(),h.innerHTML}),[n]),L=(0,r.I4)((()=>{if(n)return n.commonAncestorContainer.parentElement}),[n]);function x(){const e=p.current;if(!e)return;const{offsetWidth:t,scrollWidth:n,scrollLeft:r}=e;if(n<=t)return void I(void 0);let a="";r0&&(a+=" mask-left"),I(a)}function $(e){if(T[e])return"active";if("monospace"===e||"strikethrough"===e){if(Object.keys(T).some((t=>t!==e&&!!T[t])))return"disabled"}else if(T.monospace||T.strikethrough)return"disabled"}const A=(0,r.I4)((()=>{S((e=>(document.execCommand(e.bold?"removeFormat":"bold"),Object.keys(e).forEach((t=>{"italic"!==t&&"underline"!==t||!e[t]||document.execCommand(t)})),{...e,bold:!e.bold})))}),[]),F=(0,r.I4)((()=>{document.execCommand("italic"),S((e=>({...e,italic:!e.italic})))}),[]),O=(0,r.I4)((()=>{document.execCommand("underline"),S((e=>({...e,underline:!e.underline})))}),[]),D=(0,r.I4)((()=>{if(T.strikethrough){const e=L();if(!n||!e||"DEL"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void S((e=>({...e,strikethrough:!1})))}const e=M();document.execCommand("insertHTML",!1,`${e}`),f()}),[L,M,f,n,T.strikethrough]),U=(0,r.I4)((()=>{if(T.monospace){const e=L();if(!n||!e||"CODE"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void S((e=>({...e,monospace:!1})))}const e=M();document.execCommand("insertHTML",!1,`${e}`),f()}),[L,M,f,n,T.monospace]);function R(){const e=encodeURI(C.includes("://")?C:`http://${C}`);if(N){const t=L();if(!t||"A"!==t.tagName)return;return t.href=e,void f()}const t=M();!function(){if(!n)return;const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(n))}(),document.execCommand("insertHTML",!1,`${t}`),f()}const B=(0,r.I4)((e=>{const t={KeyK:P,KeyB:A,KeyU:O,KeyI:F,KeyM:U,KeyS:D}[e.code];!e.altKey&&(e.ctrlKey||e.metaKey)&&t&&(e.preventDefault(),e.stopPropagation(),t())}),[A,F,O,U,D,P]);(0,r.d4)((()=>(e&&document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B))),[e,B]);const V=(0,d.Z)();if(!Z)return;const X=(0,s.Z)("TextFormatter",g,E&&"link-control-shown"),j=(0,s.Z)("TextFormatter-link-url-confirm",!!C.length&&"shown"),H=t?`left: ${t.x}px; top: ${t.y}px;--text-formatter-left: ${t.x}px;`:"";return r.ZP.createElement("div",{ref:v,className:X,style:H,onKeyDown:function(e){"Enter"===e.key&&E&&(R(),e.preventDefault())}},r.ZP.createElement("div",{className:"TextFormatter-buttons"},r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:"Bold text",className:$("bold"),onClick:A},r.ZP.createElement("i",{className:"icon-bold"})),r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:"Italic text",className:$("italic"),onClick:F},r.ZP.createElement("i",{className:"icon-italic"})),r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:"Underlined text",className:$("underline"),onClick:O},r.ZP.createElement("i",{className:"icon-underlined"})),r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:"Strikethrough text",className:$("strikethrough"),onClick:D},r.ZP.createElement("i",{className:"icon-strikethrough"})),r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:"Monospace text",className:$("monospace"),onClick:U},r.ZP.createElement("i",{className:"icon-monospace"})),r.ZP.createElement("div",{className:"TextFormatter-divider"}),r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:V("TextFormat.AddLinkTitle"),onClick:P},r.ZP.createElement("i",{className:"icon-link"}))),r.ZP.createElement("div",{className:"TextFormatter-link-control"},r.ZP.createElement("div",{className:"TextFormatter-buttons"},r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:V("Cancel"),onClick:y},r.ZP.createElement("i",{className:"icon-arrow-left"})),r.ZP.createElement("div",{className:"TextFormatter-divider"}),r.ZP.createElement("div",{className:(0,s.Z)("TextFormatter-link-url-input-wrapper",k)},r.ZP.createElement("input",{ref:p,className:"TextFormatter-link-url-input",type:"text",value:C,placeholder:"Enter URL...",autoComplete:"off",inputMode:"url",dir:"auto",onChange:function(e){b(e.target.value),x()},onScroll:x})),r.ZP.createElement("div",{className:j},r.ZP.createElement("div",{className:"TextFormatter-divider"}),r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:V("Save"),className:"color-primary",onClick:R},r.ZP.createElement("i",{className:"icon-check"}))))))}))},6980:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(6137),a=n(7361);const s={B:r.Vv.Bold,STRONG:r.Vv.Bold,I:r.Vv.Italic,EM:r.Vv.Italic,U:r.Vv.Underline,S:r.Vv.Strike,STRIKE:r.Vv.Strike,DEL:r.Vv.Strike,CODE:r.Vv.Code,PRE:r.Vv.Pre,BLOCKQUOTE:r.Vv.Blockquote};function o(e){const t=document.createElement("div");t.innerHTML=function(e){let t=e.slice(0);return a.op||(t=t.replace(/]+alt="([^"]+)"[^>]*>/gm,"$1")),t=t.replace(/<\/?span([^>]*)?>/g,""),t=t.replace(/ /g," "),t=t.replace(/
]*)?><\/div>/g,"\n"),t=t.replace(/]*)?>/g,"\n"),t=t.replace(/<\/div>(\s*)
/g,"\n"),t=t.replace(/
/g,"\n"),t=t.replace(/<\/div>/g,""),t=t.replace(/^`{3}(.*[\n\r][^]*?^)`{3}/gm,"
$1
"),t=t.replace(/[`]{3}([^`]+)[`]{3}/g,"
$1
"),t=t.replace(/[`]{1}([^`\n]+)[`]{1}/g,"$1"),t=t.replace(/[*]{2}([^*\n]+)[*]{2}/g,"$1"),t=t.replace(/[_]{2}([^*\n]+)[_]{2}/g,"$1"),t=t.replace(/[~]{2}([^~\n]+)[~]{2}/g,"$1"),t}(e);const n=t.innerText.trim().replace(/\u200b+/g,"");let o=0,i=0;const c=[];function l(e){const{index:t,entity:a}=function(e,t,n){const a=function(e){if(s[e.nodeName])return s[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===r.Vv.MentionName?r.Vv.MentionName:t.dataset.entityType===r.Vv.Url?r.Vv.Url:t.href.startsWith("mailto:")?r.Vv.Email:t.href.startsWith("tel:")?r.Vv.Phone:t.href!==t.textContent?r.Vv.TextUrl:r.Vv.Url}return"SPAN"===e.nodeName?e.dataset.entityType:void 0}(e);if(!a||!e.textContent)return{index:n,entity:void 0};const o=t.indexOf(e.textContent,n),i=o>=0?o:n,c=t.substring(0,i).length,{length:l}=t.substring(i,i+e.textContent.length);let d,u;return a===r.Vv.TextUrl&&(d=e.href),a===r.Vv.MentionName&&(u=Number(e.dataset.userId)),{index:i,entity:{type:a,offset:c,length:l,...d&&{url:d},...u&&{userId:u}}}}(e,n,o);a?(o=t,c.push(a)):e.textContent&&(o+=e.textContent.length),e.hasChildNodes()&&i<=3&&(i+=1,Array.from(e.childNodes).forEach(l))}return Array.from(t.childNodes).forEach((e=>{i=1,l(e)})),{text:n,entities:c.length?c:void 0}}},2400:(e,t,n)=>{n.d(t,{_:()=>i});const r=/(
|)/g,a=/( |\u00A0)/g,s=/(
|<\/div>)/gi,o=/\n$/i;function i(e){return e.replace(a," ").replace(r,"\n").replace(s,"").replace(o,"")}},6391:(e,t,n)=>{function r(e,t){const{commonAncestorContainer:n}=e;let r=n,a=1;for(;r&&r.id!==t&&a<5;)r=r.parentElement,a++;return Boolean(r&&r.id===t)}n.d(t,{R:()=>r})},8353:(e,t,n)=>{n.d(t,{Z:()=>v});var r=n(4050),a=n(3716),s=n(735),o=n(2400),i=n(4284),c=n(5723),l=n(782),d=n(706);let u,m,h,f;try{f=new RegExp("(^|\\s):[-+_:\\p{L}\\p{N}]*$","gui")}catch(e){f=new RegExp("(^|\\s):[-+_:\\d\\wа-яё]*$","gi")}function v(e,t,v,p=a.R2,Z,g,E,P=!1){const[y,C,b]=(0,d.Z)(),[N,w]=(0,r.eJ)(),[k,I]=(0,r.eJ)(),[T,S]=(0,r.eJ)({}),[M,L]=(0,r.eJ)(),[x,$]=(0,r.eJ)({}),[A,F]=(0,r.eJ)(!1),[O,D]=(0,r.eJ)(s.D),U=(0,r.Ye)((()=>N&&v.length?Object.values((0,l.q0)(N,v)):[]),[N,v]);(0,r.d4)((()=>{if(P)return;const e=()=>{w(h.emojis)};h?e():async function(){return u||(u=n.e(501).then(n.t.bind(n,7501,19)),m=(await u).default,h=(0,i.NM)(m)),u}().then(e)}),[P]),(0,r.d4)((()=>{if(!N||P)return;const e=Object.values(N),t=(0,l.ee)(e,"native"),n=g?(0,l.Q8)(g,(e=>Object.values((0,l.q0)(t,e)))):{},r=E?(0,l.Q8)(E,(e=>Object.values((0,l.q0)(t,e)))):{};S({...n,...r}),I([...Object.keys(n),...Object.keys(r)]);const a=e.reduce(((e,t)=>(t.names.forEach((n=>{e[n]||(e[n]=[]),e[n].push(t)})),e)),{});$(a),L(Object.keys(a))}),[P,g,N,E]),(0,r.d4)((()=>{if(!(e&&t&&N&&k&&k.length))return void b();const n=t.includes(":")&&function(e){const t=(0,o._)(e).match(f);return t?t[0].trim():void 0}(t);if(!n)return D(s.D),void b();const r=n.length>2&&n.endsWith(":"),a=n.substr(1,r?n.length-2:void 0);let i=[];if(F(r),a){if(a.length>=2){const e=k.filter((e=>e.startsWith(a))).sort();i=i.concat((0,l.xH)(Object.values((0,l.q0)(T,e))));const t=M.filter((e=>e.startsWith(a)));i=i.concat((0,l.xH)(Object.values((0,l.q0)(x,t)))),i=(0,l.Tw)(i)}}else i=U;i.length?(r||C(),D(i.slice(0,36))):b()}),[N,T,k,x,M,t,e,C,U,b,F]);const R=(0,r.I4)(((e,n)=>{const r=t.lastIndexOf(":",n?t.lastIndexOf(":")-1:void 0);if(-1!==r){Z(`${t.substr(0,r)}${e}`);const n=document.getElementById(p);requestAnimationFrame((()=>{(0,c.Z)(n,!0)}))}b()}),[t,p,Z,b]);return(0,r.d4)((()=>{y&&A&&O.length&&R(O[0].native,!0)}),[O,R,y,A]),{isEmojiTooltipOpen:y,closeEmojiTooltip:b,filteredEmojis:O,insertEmoji:R}}},2365:(e,t,n)=>{n.d(t,{Z:()=>v});var r=n(4050),a=n(6137),s=n(3716),o=n(2858),i=n(5765);function c(e,t){const n=t.username.toLowerCase(),r=(0,o.Js)(t),a=r&&r.toLowerCase(),s=e.toLowerCase();return n.startsWith(s)||a&&(0,i.Z)(a,s)}var l=n(2400),d=n(5723),u=n(706),m=n(782);const h=(0,n(9118).P2)((e=>e()),500,!0);let f;try{f=new RegExp("(^|\\s)@[-_\\p{L}\\p{M}\\p{N}]*$","gui")}catch(e){f=new RegExp("(^|\\s)@[-_\\d\\wа-яё]*$","gi")}function v(e,t,n,i=s.R2,v,p,Z,g){const[E,P,y]=(0,u.Z)(),[C,b]=(0,r.eJ)(),N=(0,r.Ye)((()=>(p||[]).map((e=>null==g?void 0:g[e])).filter(Boolean)),[p,g]),w=(0,r.I4)(((e,t)=>{(v||p)&&g?h((()=>{const n=(t?N:[]).filter((t=>!e||c(e,t))),r=(v||[]).map((({userId:e})=>g[e])).filter((t=>!(!t||t.id===Z)&&(!e||c(e,t))));b((0,m.Tw)(n.concat(r)))})):b(void 0)}),[Z,v,p,N,g]);(0,r.d4)((()=>{if(!e||!t.length)return void y();const n=t.includes("@")&&function(e){const t=(0,l._)(e).match(f);return t?t[0].trim():void 0}(t);if(n){const e=n?n.substr(1):"";w(e,function(e){return e.startsWith("@")}(t))}else y()}),[e,t,w,P,y]),(0,r.d4)((()=>{null!=C&&C.length?P():y()}),[P,y,C]);const k=(0,r.I4)(((e,r=!1)=>{if(!e.username&&!(0,o.Vl)(e))return;const s=e.username?`@${e.username}`:`${(0,o.Vl)(e)}`,c=t.lastIndexOf("@");if(-1!==c){n(`${t.substr(0,c)}${s} `);const e=document.getElementById(i);requestAnimationFrame((()=>{(0,d.Z)(e,r)}))}y()}),[t,i,n,y]);return{isMentionTooltipOpen:E,closeMentionTooltip:y,insertMention:k,mentionFilteredUsers:C}}},7891:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(9290),s=n(5326);function o(e,t){const n=void 0===t,o=(0,r.sO)(n),i=(0,r.sO)(),c=(0,s.Z)();return(0,a.Z)((()=>{n||(o.current=!1,i.current&&(clearTimeout(i.current),i.current=void 0))}),e),(0,r.d4)((()=>{if(n||o.current)return;const e=()=>{o.current=!0,c()};t>0?i.current=window.setTimeout(e,t):e()}),e),o.current}},7551:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(9107),s=n(3103),o=n(231);const i=(0,r.X$)((({isOpen:e,onClose:t,onCloseAnimationEnd:n,title:i,header:c,text:l,textParts:d,confirmLabel:u="Confirm",confirmHandler:m,confirmIsDestructive:h,isButtonsInOneRow:f})=>{const v=(0,a.Z)();return r.ZP.createElement(s.Z,{className:"confirm",title:i,header:c,isOpen:e,onClose:t,onCloseAnimationEnd:n,onEnter:m},l&&l.split("\\n").map((e=>r.ZP.createElement("p",null,e))),d,r.ZP.createElement("div",{className:f?"dialog-buttons mt-2":""},r.ZP.createElement(o.Z,{className:"confirm-dialog-button",isText:!0,onClick:m,color:h?"danger":"primary"},u),r.ZP.createElement(o.Z,{className:"confirm-dialog-button",isText:!0,onClick:t},v("Cancel"))))}))},1151:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(6752),s=n(231);const o=({isShown:e,className:t,color:n="primary",ariaLabel:o,disabled:i,onClick:c,children:l})=>{const d=(0,a.Z)("FloatingActionButton",e&&"revealed",t);return r.ZP.createElement(s.Z,{className:d,color:n,round:!0,disabled:i,onClick:e&&!i?c:void 0,ariaLabel:o,tabIndex:-1},l)}},1273:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(1713),a=n(4050),s=n(9118),o=n(7675);const i=({ref:e,className:t,onLoadMore:n,onScroll:i,onKeyDown:c,items:l,itemSelector:d=".ListItem",preloadBackwards:u=20,sensitiveArea:m=800,noScrollRestore:h=!1,noScrollRestoreOnTop:f=!1,noFastList:v,cacheBuster:p,children:Z})=>{let g=(0,a.sO)(null);e&&(g=e);const E=(0,a.sO)({}),[P,y]=(0,a.Ye)((()=>n?[(0,s.Ds)(((e=!1)=>{n({direction:r.Uq.Backwards,noScroll:e})}),1e3,!0,!1),(0,s.Ds)((()=>{n({direction:r.Uq.Forwards})}),1e3,!0,!1)]:[]),[n,l]);(0,a.d4)((()=>{if(!P)return;if(u>0&&(!l||l.length{const e=g.current,t=E.current;let n;if(t.listItemElements=e.querySelectorAll(d),t.currentAnchor&&Array.from(t.listItemElements).includes(t.currentAnchor)){const{scrollTop:r}=e;n=r+(t.currentAnchor.getBoundingClientRect().top-t.currentAnchorTop)}else{const e=t.listItemElements[0];e&&(t.currentAnchor=e,t.currentAnchorTop=e.getBoundingClientRect().top)}h||f&&0===e.scrollTop||((0,o.Z)(e,n),t.isScrollTopJustUpdated=!0)}),[l,d,h,f,p]);const C=(0,a.I4)((e=>{if(y&&P){const{isScrollTopJustUpdated:e,currentAnchor:t,currentAnchorTop:n}=E.current,r=E.current.listItemElements;if(e)return void(E.current.isScrollTopJustUpdated=!1);const a=r.length,s=g.current,{scrollTop:i,scrollHeight:c,offsetHeight:l}=s,d=i<=(a?r[0].offsetTop:0)+m,u=(a?r[a-1].offsetTop+r[a-1].offsetHeight:c)-(i+l)<=m;let h=!1;if(d){const e=r[0];if(e){const r=e.getBoundingClientRect().top,a=null!=t&&t.offsetParent&&t!==e?t.getBoundingClientRect().top:r;t&&void 0!==n&&a>n&&(E.current.currentAnchor=e,E.current.currentAnchorTop=r,h=!0,(0,o.Z)(s),y())}}if(u){const e=r[a-1];if(e){const r=e.getBoundingClientRect().top,a=null!=t&&t.offsetParent&&t!==e?t.getBoundingClientRect().top:r;t&&void 0!==n&&a{n.d(t,{Z:()=>f});var r=n(4050),a=n(7361),s=n(9118),o=n(6752),i=n(7240),c=n(3394),l=n(706),d=n(9107),u=n(8512),m=n(2328),h=n(8964);const f=e=>{const{ref:t,buttonRef:n,icon:f,className:v,style:p,children:Z,disabled:g,ripple:E,narrow:P,inactive:y,focus:C,destructive:b,multiline:N,isStatic:w,contextActions:k,onMouseDown:I,onClick:T}=e;let S=(0,r.sO)(null);t&&(S=t);const[M,L,x]=(0,l.Z)(),{isContextMenuOpen:$,contextMenuPosition:A,handleBeforeContextMenu:F,handleContextMenu:O,handleContextMenuClose:D,handleContextMenuHide:U}=(0,i.Z)(S,!k),R=(0,r.I4)((()=>S.current),[]),B=(0,r.I4)((()=>S.current.closest(".custom-scroll")),[]),V=(0,r.I4)((()=>S.current.querySelector(".ListItem-context-menu .bubble")),[]),{positionX:X,positionY:j,style:H}=(0,c.Z)(A,R,B,V),K=(0,r.I4)((e=>{!g&&T&&(T(e),a.$b&&!E&&(L(),(0,s.T2)(x)))}),[g,L,T,E,x]),q=(0,r.I4)((e=>{y||a.$b||(!k||2!==e.button&&T||F(e),0===e.button&&(T?K(e):O(e)))}),[y,k,T,F,O,K]),z=(0,d.Z)(),J=(0,o.Z)("ListItem",v,!w&&"no-selection",E&&"has-ripple",P&&"narrow",g&&"disabled",y&&"inactive",A&&"has-menu-open",C&&"focus",b&&"destructive",N&&"multiline",w&&"is-static");return r.ZP.createElement("div",{ref:S,className:J,dir:z.isRtl?"rtl":void 0,style:p,onMouseDown:I},r.ZP.createElement("div",{className:(0,o.Z)("ListItem-button",M&&"active"),role:"button",ref:n,tabIndex:0,onClick:!y&&a.$b?K:void 0,onMouseDown:q,onContextMenu:!y&&k?O:void 0},f&&r.ZP.createElement("i",{className:`icon-${f}`}),N&&r.ZP.createElement("div",{className:"multiline-item"},Z),!N&&Z,!g&&!y&&E&&r.ZP.createElement(u.Z,null)),k&&void 0!==A&&r.ZP.createElement(m.Z,{isOpen:$,positionX:X,positionY:j,style:H,className:"ListItem-context-menu",autoClose:!0,onClose:D,onCloseAnimationEnd:U},k.map((e=>r.ZP.createElement(h.Z,{key:e.title,icon:e.icon,destructive:e.destructive,disabled:!e.handler,onClick:e.handler},e.title)))))}},3103:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),a=n(517),s=n(6752),o=n(8674),i=n(1212),c=n(274),l=n(9107),d=n(6590),u=n(231),m=n(2898);const h=({title:e,className:t,isOpen:n,header:h,hasCloseButton:f,noBackdrop:v,children:p,onClose:Z,onCloseAnimationEnd:g,onEnter:E,shouldSkipHistoryAnimations:P})=>{const{shouldRender:y,transitionClassNames:C}=(0,i.Z)(n,g,P,void 0,P),b=(0,r.sO)(null);(0,r.d4)((()=>n?(0,a.Z)({onEsc:Z,onEnter:E}):void 0),[n,Z,E]),(0,r.d4)((()=>n&&b.current?function(e){function t(t){if("Tab"!==t.key)return;t.preventDefault(),t.stopPropagation();const n=Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(!n.length)return;const r=n.findIndex((e=>e.isSameNode(document.activeElement)));let a=0;r>=0&&(a=t.shiftKey?r>0?r-1:n.length-1:r{document.removeEventListener("keydown",t,!1)}}(b.current):void 0),[n]);const{forceClose:N}=(0,d.ZP)(n,Z);(0,r.d4)((()=>()=>{n&&N()}),[]),(0,c.Z)((([e])=>(document.body.classList.toggle("has-open-dialog",n),(n||!n&&void 0!==e)&&(0,o.YW)(200),()=>{document.body.classList.remove("has-open-dialog")})),[n]);const w=(0,l.Z)();if(!y)return;const k=(0,s.Z)("Modal",t,C,v&&"transparent-backdrop");return r.ZP.createElement(m.Z,null,r.ZP.createElement("div",{ref:b,className:k,tabIndex:-1,role:"dialog"},r.ZP.createElement("div",{className:"modal-container"},r.ZP.createElement("div",{className:"modal-backdrop",onClick:Z}),r.ZP.createElement("div",{className:"modal-dialog"},h||(e?r.ZP.createElement("div",{className:"modal-header"},f&&r.ZP.createElement(u.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:w("Close"),onClick:Z},r.ZP.createElement("i",{className:"icon-close"})),r.ZP.createElement("div",{className:"modal-title"},e)):void 0),r.ZP.createElement("div",{className:"modal-content custom-scroll"},p)))))}},6937:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(4050),a=n(3716),s=n(1212),o=n(6752),i=n(3989),c=n(2898);const l=({message:e,duration:t=3e3,containerId:n,onDismiss:l})=>{const[d,u]=(0,r.eJ)(!0),m=(0,r.sO)(null),{transitionClassNames:h}=(0,s.Z)(d),f=(0,r.I4)((()=>{u(!1),setTimeout(l,150+a.fK)}),[l]);(0,r.d4)((()=>d?(0,i.Z)(f):void 0),[d,f]),(0,r.d4)((()=>(m.current=window.setTimeout(f,t),()=>{m.current&&(clearTimeout(m.current),m.current=void 0)})),[t,f]);const v=(0,r.I4)((()=>{m.current&&(clearTimeout(m.current),m.current=void 0)}),[]),p=(0,r.I4)((()=>{m.current=window.setTimeout(f,t)}),[t,f]);return r.ZP.createElement(c.Z,{className:"Notification-container",containerId:n},r.ZP.createElement("div",{className:(0,o.Z)("Notification",h),onClick:f,onMouseEnter:v,onMouseLeave:p},r.ZP.createElement("div",{className:"content"},e)))}},2898:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(4050),a=n(2916);const s=({containerId:e,className:t,children:n})=>{const s=(0,r.sO)();return s.current||(s.current=document.createElement("div")),(0,r.bt)((()=>{const n=document.querySelector(e||"#portals");if(!n)return;const r=s.current;return t&&r.classList.add(t),n.appendChild(r),()=>{a.Z.render(void 0,r),n.removeChild(r)}}),[t,e]),a.Z.render(n,s.current)}},9196:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(6752);const s={s:22,m:25,l:28,xl:20},o=(0,r.X$)((({progress:e=0,size:t="l",square:n,transparent:o,noCross:i,onClick:c})=>{const l=s[t],d=l-4,u=l-1,m=2*d*Math.PI,h=(0,r.sO)(null);(0,r.d4)((()=>{if(!h.current)return;const t=h.current.firstElementChild,n=m-Math.min(Math.max(.05,e),1)*m;t?t.firstElementChild.setAttribute("stroke-dashoffset",n.toString()):h.current.innerHTML=`\n \n `}),[h,m,u,d,e]);const f=(0,a.Z)(`ProgressSpinner size-${t}`,o&&"transparent",n&&"square",i&&"no-cross");return r.ZP.createElement("div",{ref:h,className:f,onClick:c})}))},4434:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(4050),a=n(6752),s=n(9107),o=n(9204);const i=(0,r.X$)((({id:e,label:t,subLabel:n,value:i,name:c,checked:l,disabled:d,hidden:u,isLoading:m,onChange:h})=>{const f=(0,s.Z)(),v=(0,a.Z)("Radio",d&&"disabled",u&&"hidden-widget",m&&"loading");return r.ZP.createElement("label",{className:v,dir:f.isRtl?"rtl":void 0},r.ZP.createElement("input",{type:"radio",name:c,value:i,id:e,checked:l,onChange:h,disabled:d||u}),r.ZP.createElement("div",{className:"Radio-main"},r.ZP.createElement("span",{className:"label",dir:f.isRtl?"auto":void 0},t),n&&r.ZP.createElement("span",{className:"subLabel",dir:f.isRtl?"auto":void 0},n)),m&&r.ZP.createElement(o.Z,null))})),c=(0,r.X$)((({id:e,name:t,options:n,selected:a,disabled:s,loadingOption:o,onChange:c})=>{const l=(0,r.I4)((e=>{const{value:t}=e.currentTarget;c(t)}),[c]);return r.ZP.createElement("div",{id:e,className:"radio-group"},n.map((e=>r.ZP.createElement(i,{name:t,label:e.label,subLabel:e.subLabel,value:e.value,checked:e.value===a,hidden:e.hidden,disabled:s,isLoading:o?o===e.value:void 0,onChange:l}))))}))},9589:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(4050),a=n(6752),s=n(706),o=n(9107),i=n(4288),c=n(231);const l=(0,r.X$)((({ref:e,children:t,parentContainerClassName:n,value:l,inputId:d,className:u,focused:m,isLoading:h,placeholder:f,disabled:v,autoComplete:p,canClose:Z,onChange:g,onReset:E,onFocus:P,onBlur:y})=>{let C=(0,r.sO)(null);e&&(C=e);const[b,N,w]=(0,s.Z)(m);(0,r.d4)((()=>{C.current&&(m?C.current.focus():C.current.blur())}),[m,f]);const k=(0,o.Z)(),I=(0,r.I4)((e=>{if("ArrowDown"===e.key||"Enter"===e.key){const e=document.querySelector(`.${n} .ListItem-button`);e&&e.focus()}}),[n]);return r.ZP.createElement("div",{className:(0,a.Z)("SearchInput",u,b&&"has-focus"),dir:k.isRtl?"rtl":void 0},t,r.ZP.createElement("input",{ref:C,id:d,type:"text",dir:"auto",placeholder:f||k("Search"),className:"form-control",value:l,disabled:v,autoComplete:p,onChange:function(e){const{currentTarget:t}=e;g(t.value)},onFocus:function(){N(),P&&P()},onBlur:function(){w(),y&&y()},onKeyDown:I}),r.ZP.createElement("i",{className:"icon-search"}),h&&r.ZP.createElement(i.Z,null),!h&&(l||Z)&&E&&r.ZP.createElement(c.Z,{round:!0,size:"tiny",color:"translucent",onClick:E},r.ZP.createElement("span",{className:"icon-close"})))}))},126:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(1212),s=n(7204),o=n(6752);const i=({isOpen:e,isCustom:t,id:n,className:i,onClick:c,children:l})=>{const{shouldRender:d,transitionClassNames:u}=(0,a.Z)(e,void 0,void 0,!t&&void 0),m=(0,s.Z)(e),h=(0,s.Z)(l),f=(0,r.sO)();return m&&!e&&(f.current=h),d&&r.ZP.createElement("div",{id:n,className:(0,o.Z)(i,u),onClick:c},e?l():f.current())}},3321:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(4050),a=n(6752);const s=(0,r.X$)((({id:e,name:t,value:n,label:s,checked:o=!1,disabled:i,inactive:c,noAnimation:l,onChange:d,onCheck:u})=>{const m=(0,r.I4)((e=>{d&&d(e),u&&u(e.currentTarget.checked)}),[d,u]),h=(0,a.Z)("Switcher",i&&"disabled",c&&"inactive",l&&"no-animation");return r.ZP.createElement("label",{className:h,title:s},r.ZP.createElement("input",{type:"checkbox",id:e,name:t,value:n,checked:o,disabled:i,onChange:m}),r.ZP.createElement("span",{className:"widget"}))}))},3133:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),a=n(1367),s=n(7204),o=n(8781),i=n(9107),c=n(6752),l=n(2340);const d=(0,r.X$)((({className:e,title:t,active:n,badgeCount:a,isBadgeActive:s,previousActiveTab:o,onClick:i,clickArg:d})=>{const u=(0,r.sO)(null);return(0,r.bt)((()=>{if(!n||void 0===o)return;const e=u.current,t=e.querySelector("i"),r=e.parentElement.children[o];if(!r)return;const a=r.querySelector("i");a.classList.remove("animate"),t.classList.remove("animate");const s=a.parentElement.offsetLeft-t.parentElement.offsetLeft,i=a.clientWidth/t.clientWidth;t.style.transform=`translate3d(${s}px, 0, 0) scale3d(${i}, 1, 1)`,requestAnimationFrame((()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t.classList.add("animate"),t.style.transform="none"}))}))}))}),[n,o]),r.ZP.createElement("button",{type:"button",className:(0,c.Z)("Tab",e,n&&"active"),onClick:()=>i(d),ref:u},r.ZP.createElement("span",null,(0,l.Z)(t),!!a&&r.ZP.createElement("span",{className:(0,c.Z)("badge",s&&"active")},a),r.ZP.createElement("i",null)))})),u=(0,r.X$)((({tabs:e,activeTab:t,big:n,onSwitchTab:c})=>{const l=(0,r.sO)(null),u=(0,s.Z)(t);(0,o.Z)(l.current),(0,r.d4)((()=>{const e=l.current;if(e.scrollWidth<=e.offsetWidth)return;const t=e.querySelector(".Tab.active");if(t){const n=t.offsetLeft-e.offsetWidth/2+t.offsetWidth/2;if(Math.abs(n-e.scrollLeft)<16)return;(0,a.Z)(e,n)}}),[t]);const m=(0,i.Z)();return r.ZP.createElement("div",{className:"TabList no-selection no-scrollbar "+(n?"big":""),ref:l,dir:m.isRtl?"rtl":void 0},e.map(((e,n)=>r.ZP.createElement(d,{key:e.title,title:m(e.title),active:n===t,badgeCount:e.badgeCount,isBadgeActive:e.isBadgeActive,previousActiveTab:u,onClick:c,clickArg:n}))))}))},2255:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),a=n(5116),s=n(5326),o=n(7204),i=n(6752),c=n(8674),l=n(1279);const d=Symbol("CLEANED_UP"),u=({ref:e,activeKey:t,name:n,direction:u="auto",renderCount:m,shouldRestoreHeight:h,shouldCleanup:f,cleanupExceptionKey:v,id:p,className:Z,onStart:g,onStop:E,children:P})=>{const{animationLevel:y}=(0,a.Rd)().settings.byKey,C=(0,r.sO)();let b=(0,r.sO)(null);e&&(b=e);const N=(0,r.sO)({}),w=(0,o.Z)(t),k=(0,s.Z)(),I=void 0!==w&&t!==w;!m&&I&&(N.current={[w]:N.current[w]}),N.current[t]=P,(0,r.bt)((()=>{function e(){!f||void 0!==v&&v===w||(N.current={[w]:d},k())}const r=b.current,a=r.children;if(1===a.length&&!I)return void a[0].classList.add("active");const s=Array.from(r.childNodes);if(!I||!s.length)return;const o=-1===u||"auto"===u&&w>t||"inverse"===u&&w{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle("active",t===Z))})),void e();let P;s.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("active"),e.classList.toggle("from",t===p),e.classList.toggle("through",t>p&&tZ),e.classList.toggle("to",t===Z))})),y>0&&(P=(0,c.YW)()),requestAnimationFrame((()=>{var a;function i(){requestAnimationFrame((()=>{if(t===C.current){if(r.classList.remove("animating","backwards"),s.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle("active",t===Z))})),h){const e=r.querySelector(".active");e&&(e.style.height="auto",r.style.height=`${e.clientHeight}px`)}P&&P(),e(),E&&E()}}))}r.classList.add("animating"),g&&g();const c="mv-slide"===n?null===(a=s[Z])||void 0===a?void 0:a.firstChild:"reveal"===n&&o?s[p]:s[Z];C.current=t,y>0&&c?(0,l.f)(c,i):i()}))}),[t,w,I,u,n,g,E,m,h,f,v,y,k]),(0,r.bt)((()=>{if(h){const e=b.current,t=e.querySelector(".active")||e.querySelector(".from");t&&(t.style.height="auto",e.style.height=`${t.clientHeight}px`,e.style.flexBasis=`${t.clientHeight}px`)}}),[h,P]);const T=N.current,S=Object.keys(m?new Array(m).fill(void 0):T).map(Number).map((e=>{const n=T[e];return"function"==typeof n?r.ZP.createElement("div",{key:e},n(e===t,e===w,t)):void 0})),M=(0,i.Z)("Transition",Z,n);return r.ZP.createElement("div",{ref:b,id:p,className:M},S)}},3455:(e,t,n)=>{n.d(t,{fi:()=>s,Yy:()=>o,vb:()=>l,ZP:()=>h});var r=n(1090),a=n(782);const s=[{icon:"user",title:"FilterContacts",key:"contacts"},{icon:"non-contacts",title:"FilterNonContacts",key:"nonContacts"},{icon:"group",title:"FilterGroups",key:"groups"},{icon:"channel",title:"FilterChannels",key:"channels"},{icon:"bots",title:"FilterBots",key:"bots"}],o=[{icon:"mute",title:"FilterMuted",key:"excludeMuted"},{icon:"archive",title:"FilterArchived",key:"excludeArchived"},{icon:"readchats",title:"FilterRead",key:"excludeRead"}],i=["includedChatIds","bots","channels","groups","contacts","nonContacts"],c=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function l(e,t,n){let r=[],s=[];if("included"===t){const{includedChatIds:t,...o}=n?e.includeFilters||{}:(0,a.ei)(e.folder,i);r=t||[],s=Object.keys(o).filter((e=>Boolean(o[e])))}else{const{excludedChatIds:t,...o}=n?e.excludeFilters||{}:(0,a.ei)(e.folder,c);r=t||[],s=Object.keys(o).filter((e=>Boolean(o[e])))}return{selectedChatIds:r,selectedChatTypes:s}}function d(e){if(e){const{includedChatIds:t,...n}=e;if(Object.values(n).filter(Boolean).length>1||null!=t&&t.length)return"";if(n.bots)return"Bots";if(n.groups)return"Groups";if(n.channels)return"Channels";if(n.contacts)return"Contacts";if(n.nonContacts)return"Non-Contacts"}return""}const u={mode:"create",chatFilter:"",folder:{title:"",includedChatIds:[],excludedChatIds:[]}},m=(e,t)=>{switch(t.type){case"setTitle":return{...e,folder:{...e.folder,title:t.payload},isTouched:!0};case"editIncludeFilters":return{...e,includeFilters:(0,a.ei)(e.folder,i)};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,i),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,...r}=t.payload;return{mode:"edit",folderId:e,folder:r,chatFilter:""}}case"setChatFilter":return{...e,chatFilter:t.payload};case"setIsLoading":return{...e,isLoading:t.payload};case"setError":return{...e,error:t.payload};case"reset":return u;default:return e}},h=()=>(0,r.Z)(m,u)},3186:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(4050),a=n(396),s=n(274),o=n(5266),i=n(9290);const c=(e,t,n,c,l,d=!1,u,m=!1)=>{const h=(0,r.sO)(null),[f,v]=(0,r.eJ)(!1);let p=f;const[Z,g]=(0,r.eJ)(0);(0,i.Z)((()=>{h.current=(0,a.z)(e,((e,n)=>{var r;switch(e){case"onPlay":v(!0);break;case"onPause":v(!1);break;case"onTimeUpdate":{const{proxy:e}=h.current,n=e.duration&&Number.isFinite(e.duration)?e.duration:t;g(e.currentTime/n);break}}null==c||null===(r=c[e])||void 0===r||r.call(c,n)}),u);const{proxy:n}=h.current;f||n.paused||(v(!0),p=!0),l&&l(n)}),[e]);const{play:E,pause:P,setCurrentTime:y,proxy:C,destroy:b}=h.current,N=C.duration&&Number.isFinite(C.duration)?C.duration:t;(0,r.d4)((()=>{N&&!(0,o.z)(C)&&g(C.currentTime/N)}),[N,Z,C]),(0,r.d4)((()=>()=>{b(m)}),[b,m]),(0,s.Z)((([e,t])=>{e===d&&n===t||C.src&&C.paused||d&&n&&!f&&E(n)}),[d,n,f,E,C.src,C.paused]);const w=(0,r.I4)((()=>{f?P():n&&E(n)}),[n,P,E,f]);return{isPlaying:p,playProgress:Z,playPause:w,setCurrentTime:y,audioProxy:C,duration:N}}},5332:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050);function a(e,t){(0,r.d4)((()=>(e&&!document.hasFocus()&&e(),e&&window.addEventListener("blur",e),t&&window.addEventListener("focus",t),()=>{t&&window.removeEventListener("focus",t),e&&window.removeEventListener("blur",e)})),[e,t])}},2937:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(4050),a=n(6264),s=n(9290),o=n(1394),i=n(5326);const c=new Map;function l(e){const t=(0,r.sO)();let n=!1;(0,s.Z)((()=>{if(n=!0,t.current=void 0,!e)return;const r=new Image;if(r.src=e,!r.width)return;const s=(0,o.ao)(r);(0,a.Z)(s.getContext("2d"),0,0,s.width,s.height,2,2),t.current=s.toDataURL()}),[e]);const l=function(e,t=!1,n){const s=(0,r.sO)(e?c.get(e):void 0),l=(0,r.sO)(),d=(0,i.Z)();return l.current&&t&&(clearTimeout(l.current),l.current=void 0),(0,r.d4)((()=>{if(!e||s.current||t)return;const r=new Image;r.onload=()=>{const t=(0,o.ao)(r);(0,a.Z)(t.getContext("2d"),0,0,t.width,t.height,2,2);const n=t.toDataURL();s.current=n,d(),c.size>=1e3&&c.clear(),c.set(e,n)},n?l.current=window.setTimeout((()=>{r.src=e}),n):r.src=e}),[e,n,d,t]),s.current}(e||void 0,Boolean(t.current));return t.current||!n&&l||e||void 0}},2019:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(9118),s=n(5266);const o=(e=!1)=>{const[t,n]=(0,r.eJ)(!e),[o,i]=(0,r.eJ)(0),c=(0,r.Ye)((()=>(0,a.Ds)(n,200,!1,!0)),[]),l=(0,r.I4)((e=>{const t=e.currentTarget;(0,s.z)(t)||(t.buffered.length&&i(t.buffered.end(0)/t.duration),c(t.readyState>=3||t.currentTime>0))}),[c]);return{isBuffered:t,bufferedProgress:o,bufferingHandlers:{onLoadedData:l,onPlaying:l,onLoadStart:l,onPause:l,onTimeUpdate:l,onProgress:l},checkBuffering(e){c(e.readyState>=3)}}}},5866:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(6264),s=n(5326),o=n(7361);function i(e,t=!1,n){const i=(0,r.sO)(null),c=(0,s.Z)();return(0,r.d4)((()=>{const r=i.current;if(!e||!r||t)return;const s=new Image,c=()=>{r.width=s.width,r.height=s.height;const e=r.getContext("2d",{alpha:!1});o.vX&&(e.filter="blur(2px)"),e.drawImage(s,-4,-4,r.width+8,r.height+8),o.vX||(0,a.Z)(e,0,0,r.width,r.height,2,2)};s.onload=()=>{n?requestAnimationFrame(c):c()},s.src=e}),[i,e,c,t,n]),i}},1470:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(5116),s=n(2858),o=n(9107);const i=({chat:e,privateChatUser:t,handleDelete:n,folderId:i,isPinned:c,isMuted:l},d=!1)=>{const u=(0,o.Z)();return(0,r.Ye)((()=>{if(!e)return;const{toggleChatPinned:r,updateChatMutedState:o,toggleChatArchived:m,toggleChatUnread:h}=(0,a.uC)(),f=c?{title:u("UnpinFromTop"),icon:"unpin",handler:()=>r({id:e.id,folderId:i})}:{title:u("PinToTop"),icon:"pin",handler:()=>r({id:e.id,folderId:i})};if(d)return[f];const v=e.unreadCount||e.hasUnreadMark?{title:u("MarkAsRead"),icon:"readchats",handler:()=>h({id:e.id})}:{title:u("MarkAsUnread"),icon:"unread",handler:()=>h({id:e.id})},p=l?{title:u("ChatList.Unmute"),icon:"unmute",handler:()=>o({chatId:e.id,isMuted:!1})}:{title:u("ChatList.Mute"),icon:"mute",handler:()=>o({chatId:e.id,isMuted:!0})},Z=(0,s.pE)(e)?{title:u("Unarchive"),icon:"unarchive",handler:()=>m({id:e.id})}:{title:u("Archive"),icon:"archive",handler:()=>m({id:e.id})},g={title:(0,s.YA)(e.id)?u("Delete"):u((0,s.cc)(e)?"DeleteChat":(0,s.eA)(e)?"LeaveChannel":"Group.LeaveGroup"),icon:"delete",destructive:!0,handler:n};return[v,f,...null!=t&&t.isSelf?[]:[p,Z],g]}),[e,c,u,d,l,n,null==t?void 0:t.isSelf,i])}},7240:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(4050),a=n(7361);const s=(e,t,n,s)=>{const[o,i]=(0,r.eJ)(!1),[c,l]=(0,r.eJ)(void 0),d=(0,r.I4)((e=>{t||2!==e.button||document.body.classList.add("no-selection")}),[t]),u=(0,r.I4)((e=>{document.body.classList.remove("no-selection"),t||n&&e.target.matches("a[href]")||(e.preventDefault(),c||(i(!0),l({x:e.clientX,y:e.clientY})))}),[t,n,c]),m=(0,r.I4)((()=>{i(!1)}),[]),h=(0,r.I4)((()=>{l(void 0),document.body.classList.remove("no-selection")}),[]);return(0,r.d4)((()=>{if(t||!a.$b||s)return;const r=e.current;if(!r)return;let o;const d=()=>{o&&(clearTimeout(o),o=void 0)},u=e=>{t||a.wB&&window.document.body.classList.contains("enable-symbol-menu-transforms")||(d(),o=window.setTimeout((()=>(e=>{d();const{clientX:t,clientY:a,target:s}=e.touches[0];c||n&&s.matches("a[href]")||(r.addEventListener("touchend",(function e(t){r.removeEventListener("touchend",e,!0),t.stopImmediatePropagation(),t.preventDefault(),t.stopPropagation()}),!0),document.body.classList.add("no-selection"),i(!0),l({x:t,y:a}))})(e)),200))};return r.addEventListener("touchstart",u,{passive:!0}),r.addEventListener("touchcancel",d,!0),r.addEventListener("touchend",d,!0),r.addEventListener("touchmove",d,{passive:!0}),()=>{d(),r.removeEventListener("touchstart",u),r.removeEventListener("touchcancel",d,!0),r.removeEventListener("touchend",d,!0),r.removeEventListener("touchmove",d)}}),[c,t,s,e,n]),{isContextMenuOpen:o,contextMenuPosition:c,handleBeforeContextMenu:d,handleContextMenu:u,handleContextMenuClose:m,handleContextMenuHide:h}}},3394:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050);const a=(e,t,n,a,s=0,o=0)=>{const[i,c]=(0,r.eJ)("right"),[l,d]=(0,r.eJ)("bottom"),[u,m]=(0,r.eJ)("");return(0,r.d4)((()=>{const r=t();if(!e||!r)return;let{x:i,y:l}=e;const u={width:0,left:0,height:0,top:0},h=a(),f=n(),v=r.getBoundingClientRect(),p=h?{width:h.offsetWidth,height:h.offsetHeight}:u,Z=f?f.getBoundingClientRect():u;let g;i+p.width+s0?(g="right",i-=3):(g="left",i=16),c(g),l+p.height{n.d(t,{Z:()=>a});var r=n(7204);function a(e,t=!1,n=!1){const a=(0,r.Z)(e,t);return n||null!=e?e:a}},5790:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(5116),s=n(9118);const o=(e,t,n,o)=>{const{loadMessage:i}=(0,a.uC)(),c=(0,r.Ye)((()=>{const n=(0,s.P2)(i,500,!0);return()=>{n({chatId:e,messageId:t,replyOriginForId:o})}}),[i,e,t,o]);(0,r.d4)((()=>{t&&!n&&c()}))}},8781:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050);const a=(e,t)=>{(0,r.d4)((()=>{if(e)return e.addEventListener("wheel",t,{passive:!0}),()=>{e.removeEventListener("wheel",t)};function t(t){t.deltaX||(e.scrollLeft+=t.deltaY/4)}}),[e,t])}},7407:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(4050),a=n(1713),s=n(782),o=n(5326),i=n(7204);const c=(e,t,n=!1,c=30,d=!1)=>{const u=(0,r.sO)(),m=(0,r.sO)((()=>{if(!t||u.current)return;const{newViewportIds:e}=l(t,t[0],a.Uq.Forwards,c);return e})()),h=(0,o.Z)(),f=(0,i.Z)(t),v=(0,i.Z)(n);if(t&&!n&&(t!==f||n!==v)){const{offsetId:e=t[0],direction:n=a.Uq.Forwards}=u.current||{},{newViewportIds:r}=l(t,e,n,c);m.current&&(0,s.et)(m.current,r)||(m.current=r)}(0,r.d4)((()=>{if(t&&!n&&e&&d){const t=m.current;e({offsetId:t[t.length-1]})}}),[t,n,e,d]);const p=(0,r.I4)((({direction:n,noScroll:r})=>{const o=m.current,i=o?n===a.Uq.Backwards?o[o.length-1]:o[0]:void 0;if(!t)return void(e&&e({offsetId:i}));r||(u.current={...u.current,direction:n,offsetId:i});const{newViewportIds:d,areSomeLocal:f,areAllLocal:v}=l(t,i,n,c);!f||o&&(0,s.et)(o,d)||(m.current=d,h()),!v&&e&&e({offsetId:i})}),[t,c,e,h]);return n?[t]:[m.current,p]};function l(e,t=0,n,r){const{length:s}=e,o=e.indexOf(t),i=n===a.Uq.Forwards?o:o+1||s,c=Math.max(0,i-r),l=i+r-1,d=e.slice(Math.max(0,c),l+1);let u,m;switch(n){case a.Uq.Forwards:u=i>0,m=c>=0;break;case a.Uq.Backwards:u=i{n.d(t,{S1:()=>o,_N:()=>i,Op:()=>c});var r=n(4050),a=n(9118),s=n(8674);function o({rootRef:e,throttleMs:t,debounceMs:n,shouldSkipFirst:o,margin:i,threshold:c,isDisabled:l},d){const u=(0,r.sO)(),m=(0,r.sO)(),h=(0,r.sO)(0),f=(0,r.sO)(),v=(0,r.sO)();m.current=d;const p=(0,r.I4)((()=>{h.current&&(h.current--,!h.current&&v.current&&(v.current(),v.current=void 0))}),[]),Z=(0,r.I4)((()=>{h.current++,f.current&&(clearTimeout(f.current),f.current=void 0),f.current=window.setTimeout((()=>{f.current=void 0,h.current&&(h.current=1,p())}),2e3)}),[p]);return(0,s.ZP)(Z,p),(0,r.d4)((()=>{if(!l)return()=>{u.current&&(u.current.observer.disconnect(),u.current.callbacks.clear(),u.current=void 0)}}),[l]),{observe:(0,r.I4)(((r,s)=>{u.current||function(){const r=new Map,s=new Map,l=()=>{const e=Array.from(s.values());e.forEach((t=>{const n=r.get(t.target);n&&n(t,e)})),m.current&&m.current(e),s.clear()},d=t?a.P2:n?a.Ds:void 0,f=d?d(l,t||n,!o):l,p=new IntersectionObserver((e=>{e.forEach((e=>{s.set(e.target,e)})),h.current?v.current=()=>{f()}:f()}),{root:e.current,rootMargin:i?`${i}px`:void 0,threshold:c});u.current={observer:p,callbacks:r}}();const l=u.current;return l.observer.observe(r),s&&l.callbacks.set(r,s),()=>{s&&l.callbacks.delete(r),l.observer.unobserve(r)}}),[l]),freeze:Z,unfreeze:p}}function i(e,t,n){(0,r.d4)((()=>t?t(e.current,n):void 0),[])}function c(e,t,n){const[a,s]=(0,r.eJ)(!t);return i(e,t,(e=>{s(e.isIntersecting),n&&n(e)})),a}},2645:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(4050),a=n(7204);const s=(e,t,n)=>{const s=(0,a.Z)(t);return(0,r.bt)((()=>e(s||[])),t,n)}},6202:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(6137),s=n(647),o=n(5326);const i=(e,t=!1,n=a.IU.BlobUrl,i,c)=>{const l=e?s.UV(e):void 0,d=(0,o.Z)();return(0,r.d4)((()=>{if(!t&&e&&!l){const t=Date.now();s.he(e,n).then((()=>{const e=Date.now()-t;!c||e>=c?d():setTimeout(d,c-e)}))}}),[t,e,l,n,i,d,c]),l}},2619:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(2761),s=n(6562);function o(e,t){const[n,o]=(0,r.eJ)(!1),{mediaData:i,downloadProgress:c}=(0,a.Z)(e,!n);(0,r.d4)((()=>{n&&i&&((0,s.Z)(i,t),o(!1))}),[t,i,n]),(0,r.d4)((()=>{o(!1)}),[e]);const l=(0,r.I4)((e=>{e.stopPropagation(),o((e=>!e))}),[]);return{isDownloadStarted:n,downloadProgress:c,handleDownloadClick:l}}},2761:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(4050),a=n(7361),s=n(6137),o=n(9118),i=n(647),c=n(5326);const l=(e,t=!1,n=s.IU.BlobUrl,l,d,u=!1)=>{const m=e?i.UV(e):void 0,h=n===s.IU.Stream||a.I_&&n===s.IU.Progressive,f=(0,c.Z)(),[v,p]=(0,r.eJ)(m&&!h?1:0),Z=(0,r.sO)(),g=(0,r.Ye)((()=>(0,o.P2)((e=>{(!d||Date.now()-Z.current>d)&&p(e)}),500,!0)),[d]);return(0,r.d4)((()=>{!t&&e&&(m?h&&setTimeout((()=>{p(.75)}),1500):(p(0),Z.current&&i.cC(g),Z.current=Date.now(),i.he(e,n,u,g).then((()=>{const e=Date.now()-Z.current;Z.current=void 0,!d||e>=d?f():setTimeout(f,d-e)}))))}),[t,e,m,n,l,f,h,d,g,u]),(0,r.d4)((()=>{t&&Z.current&&(i.cC(g),p(0))}),[g,t]),{mediaData:m,downloadProgress:v}}},6503:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(7361);let s;function o(e,t,n=250,o=!1){const i=(0,r.sO)(!0);return(0,r.d4)((()=>{e&&(i.current=!0)}),[e]),(0,r.d4)((()=>{s&&(clearTimeout(s),s=void 0),!e||a.$b||o||(s=window.setTimeout((()=>{i.current||t()}),2*n))}),[o,e,n,t]),[(0,r.I4)((()=>{i.current=!0}),[]),(0,r.I4)((()=>{i.current=!1,s&&(clearTimeout(s),s=void 0),s=window.setTimeout((()=>{i.current||t()}),n)}),[n,t])]}},2678:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(7204),s=n(5326),o=n(9290);function i(e,t){const n=(0,a.Z)(e,!0),i=(0,r.sO)(),c=(0,s.Z)(),l=null!=e,d=null!=n;return l&&i.current&&(clearTimeout(i.current),i.current=void 0),(0,o.Z)((()=>{t&&!l&&d&&!i.current&&(i.current=window.setTimeout((()=>{i.current=void 0,c()}),t))}),[e]),i.current&&t&&!l?n:e}},1090:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050);function a(e,t){const n=(0,r.sO)(e),[a,s]=(0,r.eJ)(t);return[a,(0,r.I4)((e=>{s((t=>n.current(t,e)))}),[])]}},8835:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(1212);const s={fast:200,slow:350},o=(e,t="fast",n=!1)=>{const o=Boolean(e),i=!(0,r.sO)(o).current&&!n,[c,l]=(0,r.eJ)(!o),{shouldRender:d,transitionClassNames:u}=(0,a.Z)(o,void 0,!i,t);return(0,r.d4)((()=>{d&&(i?setTimeout((()=>{l(!1)}),s[t]):l(!1))}),[i,d,t]),{shouldRenderThumb:c,shouldRenderFullMedia:d,transitionClassNames:u}}},6898:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(4050),a=n(9118);function s(e,t){(0,r.d4)((()=>{const t=e.current;return()=>{t&&(0,a.T2)((()=>{t.pause(),t.src="",t.load()}))}}),t)}},6264:(e,t,n)=>{n.d(t,{Z:()=>s});const r=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1],a=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18];function s(e,t,n,s,o,i,c){if(Number.isNaN(i)||i<1)return;i|=0,Number.isNaN(c)&&(c=1),(c|=0)>3&&(c=3),c<1&&(c=1);const l=e.getImageData(t,n,s,o),d=l.data;let u,m,h,f,v,p,Z,g,E,P,y,C,b=s-1,N=o-1,w=i+1,k=[],I=[],T=[],S=r[i],M=a[i],L=[],x=[];for(;c-- >0;){for(C=y=0,v=0;vb?b:p)<<2),u+=d[Z++],m+=d[Z++],h+=d[Z++];for(f=0;f0?Z<<2:0),g=C+L[f],E=C+x[f],u+=d[g++]-d[E++],m+=d[g++]-d[E++],h+=d[g++]-d[E++],y++;C+=s<<2}for(f=0;fN?0:s,u+=k[P],m+=I[P],h+=T[P];for(y=f<<2,v=0;v>>M,d[y+1]=m*S>>>M,d[y+2]=h*S>>>M,0==f&&(L[v]=((Z=v+w)0?Z*s:0),g=f+L[v],E=f+x[v],u+=k[g]-k[E],m+=I[g]-I[E],h+=T[g]-T[E],y+=s<<2}}e.putImageData(l,t,n)}},396:(e,t,n)=>{n.d(t,{E:()=>u,z:()=>m});var r=n(7361),a=n(4753),s=n(5266),o=n(5116),i=n(2858);const c=new Map;let l,d=[];function u(){const e=l&&c.get(l);e&&e.audio.pause()}function m(e,t,n){c.has(e)||(c.set(e,function(e,t){const n=new Audio;function r(t){return r=>{c.has(e)&&((0,s.z)(n)||c.get(e).handlers.forEach((e=>{e(t,r)})))}}return n.addEventListener("timeupdate",r("onTimeUpdate")),n.addEventListener("play",r("onPlay")),n.addEventListener("pause",r("onPause")),n.addEventListener("loadstart",r("onLoadStart")),n.addEventListener("loadeddata",r("onLoadedData")),n.addEventListener("playing",r("onPlaying")),n.addEventListener("ended",(()=>{if((0,s.z)(n))return;const t=d[d.indexOf(e)+1];if(!t)return;if(!c.has(t))return void(0,o.uC)().openAudioPlayer((0,i.Ak)(t));const r=c.get(t);r.onForcePlay&&r.onForcePlay(),l=t,r.audio.src&&(0,a.Z)(r.audio)})),{audio:n,proxy:new Proxy(n,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:t}}(e,n)),d.includes(e)||d.push(e));const{audio:u,proxy:m,handlers:h}=c.get(e);return h.push(t),{play(t){l&&l!==e&&c.get(l).audio.pause(),l=e,u.src||(u.src=t,u.preload="auto",t.includes("/progressive/")&&r.s$&&(0,s.B)(u)),(0,a.Z)(u)},pause(){l===e&&u.pause()},setCurrentTime(t){l===e&&(u.currentTime=t)},proxy:m,destroy(n=!1){const r=c.get(e);r&&(r.handlers=r.handlers.filter((e=>e!==t)),r.handlers.length||(r.audio.pause(),c.delete(e),n&&(d=d.filter((t=>t!==e))),e===l&&(l=void 0)))}}}},1174:(e,t,n)=>{n.d(t,{e:()=>a,s:()=>s});var r=n(7361);let a;function s(e,t){let n,s,o=!1,i=!1;function c(e){if(!t.excludedClosestSelector||!e.target.matches(t.excludedClosestSelector)&&!e.target.closest(t.excludedClosestSelector)){if(n=e,"mousedown"===e.type)document.addEventListener("mousemove",d),document.addEventListener("mouseup",l);else if("touchstart"===e.type){const t=e.target;t.addEventListener("touchmove",d,{passive:!0}),t.addEventListener("touchend",l),t.addEventListener("touchcancel",l),"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY))}document.body.classList.add("no-selection"),t.withCursor&&document.body.classList.add("cursor-grabbing"),t.onCapture&&t.onCapture(e)}}function l(e){n&&(t.withCursor&&document.body.classList.remove("cursor-grabbing"),document.body.classList.remove("no-selection"),document.removeEventListener("mouseup",l),document.removeEventListener("mousemove",d),n.target.removeEventListener("touchcancel",l),n.target.removeEventListener("touchend",l),n.target.removeEventListener("touchmove",d),n=void 0,r.cj&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow=""})),o?t.onRelease&&t.onRelease(e):!t.onClick||"button"in e&&0!==e.button||t.onClick(e)),o=!1,i=!1,s=void 0}function d(e){if(n){"touchmove"===e.type&&"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY));const c=e.pageX-n.pageX,l=e.pageY-n.pageY;(Math.abs(c)>=15||Math.abs(l)>=15)&&(o=!0);let d=!1;t.onDrag&&(t.onDrag(e,n,{dragOffsetX:c,dragOffsetY:l}),d=!0),t.onSwipe&&!i&&(i=function(e,n,o){if(r.cj){const t=e.touches[0].pageX;if(t<=20||t>=window.innerWidth-20)return!1}const i=Math.abs(n),c=Math.abs(o);if(n&&o&&Math.max(i,c)/Math.min(i,c)<2)return!1;let l;if(i>=50?l="x":c>=50&&(l="y"),!l)return!1;if(s){if(s!==l)return!1}else s=l;return function(e,t,n,r,s){return"x"===t?s(e,n<0?a.Left:a.Right):"y"===t&&s(e,r<0?a.Up:a.Down)}(e,l,n,o,t.onSwipe)}(e,c,l),d=i),r.cj&&d&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow="hidden"}))}}return e.addEventListener("mousedown",c),e.addEventListener("touchstart",c,{passive:!0}),()=>{e.removeEventListener("mousedown",c),e.removeEventListener("touchstart",c)}}!function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Left=2]="Left",e[e.Right=3]="Right"}(a||(a={}))},4319:(e,t,n)=>{n.d(t,{yl:()=>a,TE:()=>o,VP:()=>i});var r=n(3716);const a=navigator.clipboard&&window.ClipboardItem,s=document.createElement("textarea");s.setAttribute("readonly",""),s.tabIndex=-1,s.className="visually-hidden";const o=e=>{s.value=e,document.body.appendChild(s);const t=document.getSelection();if(t){const e=t.rangeCount>0&&t.getRangeAt(0);s.select(),document.execCommand("copy"),e&&(t.removeAllRanges(),t.addRange(e))}document.body.removeChild(s)},i=e=>{if(!e)return;const t=document.createElement("canvas"),n=t.getContext("2d"),r=new Image;r.onload=e=>{if(n&&e.currentTarget){const r=e.currentTarget;t.width=r.width,t.height=r.height,n.drawImage(r,0,0,r.width,r.height),t.toBlob(c,"image/png",1)}},r.src=e};async function c(e){if(e&&a)try{await navigator.clipboard.write([new window.ClipboardItem({[e.type]:e})])}catch(e){r.eM&&console.error(e)}}},1279:(e,t,n)=>{function r(e,t,n){s("transitionend",e,t,n)}function a(e,t,n){s("animationend",e,t,n)}function s(e,t,n,r){let a=!1;t.addEventListener(e,(function s(o){a||o.target!==o.currentTarget||r&&(o instanceof TransitionEvent&&o.propertyName===r||o instanceof AnimationEvent&&o.animationName===r)||(a=!0,t.removeEventListener(e,s),setTimeout((()=>{n()}),50))}))}n.d(t,{L:()=>r,f:()=>a})},3570:(e,t,n)=>{function r(e,t){return t-Math.floor(t/e)*e}n.d(t,{Z:()=>r})},6562:(e,t,n)=>{function r(e,t){const n=document.createElement("a");n.href=e,n.download=t,n.click()}n.d(t,{Z:()=>r})},539:(e,t,n)=>{n.d(t,{Z:()=>l,N:()=>d});var r=n(5116),a=n(1713),s=n(3716),o=n(8674),i=n(9933);let c=!1;function l(e,t,n,o=0,i=s.V$,c,l,d){const m=function(e,t,n=s.V$,r){const{offsetTop:o}=t,{scrollTop:i}=e;if(void 0===r){const t=o-e.scrollTop;if(t<-n)return i+(t+n);if(t>n)return i+(t-n)}else{if(r===a.fo.Up)return o+n;if(r===a.fo.Down)return Math.max(0,o-n)}return i}(e,t,i,c);c!==a.fo.Static?((0,r.Rd)().settings.byKey.animationLevel===s.oB&&(l=0),u(e,t,m,n,o,l,d)):u(e,t,m,n,o,0)}function d(){return c}function u(e,t,n,r,a=0,l,d){const{offsetTop:u,offsetHeight:f}=t,{scrollTop:v,offsetHeight:p,scrollHeight:Z}=e,g=d&&e.dataset.normalHeight?Number(e.dataset.normalHeight):p;let E;switch(v!==n&&(e.scrollTop=n),r){case"start":E=u-a-n;break;case"end":E=u+f+a-(n+g);break;case"nearest":case"center":case"centerOrTop":E=f0){const e=Z-(n+g);E=Math.min(E,e)}if(0===E)return;const P=n+E;if(0===l)return void(e.scrollTop=P);c=!0;const y=Math.abs(E),C=y{const t=Math.min((Date.now()-N)/b,1),n=E*(1-C(t));return e.scrollTop=Math.round(P-n),c=t<1,c||w(),c}))}function m(e){return 1-(1-e)**5}function h(e){return 1-(1-e)**3.5}},1367:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(5116),a=n(3716),s=n(7361),o=n(9933);function i(e,t,n=300){(0,r.Rd)().settings.byKey.animationLevel===a.oB&&(n=0),s.cj?function(e,t,n){const{scrollLeft:r,offsetWidth:a,scrollWidth:s}=e;let i=t-r;if(i<0){const e=-r;i=Math.max(i,e)}else if(i>0){const e=s-(r+a);i=Math.min(i,e)}if(0===i)return;const c=r+i;if(0===n)return void(e.scrollLeft=c);const l=Date.now();(0,o.j)((()=>{const t=Math.min((Date.now()-l)/n,1),r=i*(1-function(e){return 1-(1-e)**3.5}(t));return e.scrollLeft=Math.round(c-r),t<1}))}(e,t,n):e.scrollTo({left:t,...n&&{behavior:"smooth"}})}},5723:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(7361);function a(e,t){if(!t&&e===document.activeElement)return;const n=window.getSelection(),a=document.createRange(),s=e.lastChild||e;r.$b||s&&s.nodeValue?(a.selectNodeContents(s),a.collapse(!1),n.removeAllRanges(),n.addRange(a)):e.focus()}},5266:(e,t,n)=>{function r(e){e.dataset.patchedForSafari||(e.addEventListener("play",(()=>{const t=e.currentTime;e.addEventListener("progress",(function n(){e.buffered.length&&(e.dataset.patchForSafariInProgress="true",e.currentTime=e.duration-1,e.addEventListener("progress",(()=>{delete e.dataset.patchForSafariInProgress,e.currentTime=t,e.paused&&e.play()}),{once:!0}),e.removeEventListener("progress",n))}))}),{once:!0}),e.dataset.patchedForSafari="true")}function a(e){return Boolean(e.dataset.patchForSafariInProgress)}n.d(t,{B:()=>r,z:()=>a})},7675:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(7361);const a=(e,t)=>{r.cj&&(e.style.overflow="hidden"),void 0!==t&&(e.scrollTop=t),r.cj&&(e.style.overflow="")}},4753:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(3716);const a=e=>{e.play().catch((e=>{r.eM&&console.warn(e)}))}}}]); +//# sourceMappingURL=484.87953bd73fba4543a4f6.js.map \ No newline at end of file diff --git a/dist/484.87953bd73fba4543a4f6.js.map b/dist/484.87953bd73fba4543a4f6.js.map new file mode 100644 index 00000000..044a69e3 --- /dev/null +++ b/dist/484.87953bd73fba4543a4f6.js.map @@ -0,0 +1 @@ +{"version":3,"file":"484.87953bd73fba4543a4f6.js","mappings":"2MAwBA,MACMA,EAAQ,CACZC,MAAO,IACPC,OAAQ,IACRC,MAAO,KAoET,EAjEoC,EAClCC,QAAAA,EACAC,KAAAA,EAAO,SACPC,oBAAAA,EACAC,aAAAA,EACAC,iBAAAA,MACI,MAEJ,MAAMC,GAAMC,EAAAA,EAAAA,IAAuB,OAE5BC,EAAmBC,IAAuBC,EAAAA,EAAAA,KAC3CC,EAAkB,UAASV,EAAQW,KAEnCC,GAAiBC,EAAAA,EAAAA,IAAkBR,EAAKH,GAExCY,EAAY,UAAGd,EAAQe,iBAAX,aAAG,EAAmBC,QAClCC,GAAiBC,EAAAA,EAAAA,GACpB,GAAER,YACFE,IAAmBR,EACpBe,EAAAA,GAAAA,QACAhB,IAEI,qBAAEiB,IAAyBC,EAAAA,EAAAA,GAAsBJ,EAAgB,QAEjEK,GAAYJ,EAAAA,EAAAA,GAASR,GAAiBE,EAAgBO,EAAAA,GAAAA,OAAuBhB,GAC7EoB,EAAgBC,QAAQF,IAEvBG,EAASC,IAAcC,EAAAA,EAAAA,IAASC,OAAOC,KAAKC,WAC7CC,GAAcC,EAAAA,EAAAA,KAAY,KAC9BN,EAAWE,OAAOC,KAAKC,aACtB,IAEG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,mBAAmBF,GAEzBF,EAAMK,UAAS,GACf7xB,EAAUE,kBACVF,EAAUqG,SAASmrB,IARjBvqC,EAAQvD,U,eCRL,SAAS0nC,EAA4B0G,GACtCA,EAAQ5pB,QAAQ6pB,mBAIpBD,EAAQ32B,iBAAiB,QAAQ,KAC/B,MAAM81B,EAAIa,EAAQ/U,YAoBlB+U,EAAQ32B,iBAAiB,YAlBzB,SAAS+jB,IACF4S,EAAQpT,SAASzrC,SAItB6+C,EAAQ5pB,QAAQ8pB,yBAA2B,OAC3CF,EAAQ/U,YAAc+U,EAAQ3hD,SAAW,EACzC2hD,EAAQ32B,iBAAiB,YAAY,YAC5B22B,EAAQ5pB,QAAQ8pB,yBACvBF,EAAQ/U,YAAckU,EAClBa,EAAQ9U,QACV8U,EAAQjnD,SAET,CAAEonD,MAAM,IAEXH,EAAQ12B,oBAAoB,WAAY8jB,SAIzC,CAAE+S,MAAM,IAEXH,EAAQ5pB,QAAQ6pB,iBAAmB,QAG9B,SAAS9U,EAAwB6U,GACtC,OAAOroD,QAAQqoD,EAAQ5pB,QAAQ8pB,0B,wECnCjC,SAAgBpmD,EAA2BmlC,KACrCzQ,EAAAA,KACF10B,EAAUzB,MAAMkiD,SAAW,eAGX7hD,IAAdumC,IACFnlC,EAAUmlC,UAAYA,GAGpBzQ,EAAAA,KACF10B,EAAUzB,MAAMkiD,SAAW,M,8CCV/B,QAAgB6F,IACdA,EAAQrnD,OAAOsnD,OAAOC,IAChBjE,EAAAA,IAEFC,QAAQiE,KAAKD","sources":["webpack://telegram-t/./src/components/common/AnimatedEmoji.tsx","webpack://telegram-t/./src/components/common/AnimatedSticker.tsx","webpack://telegram-t/./src/components/common/Audio.tsx","webpack://telegram-t/./src/util/waveform.ts","webpack://telegram-t/./src/components/common/helpers/waveform.ts","webpack://telegram-t/./src/components/common/Avatar.tsx","webpack://telegram-t/./src/components/common/ChatExtra.tsx","webpack://telegram-t/./src/components/common/DeleteChatModal.tsx","webpack://telegram-t/./src/components/common/Document.tsx","webpack://telegram-t/./src/components/common/File.tsx","webpack://telegram-t/./src/components/common/GroupChatInfo.tsx","webpack://telegram-t/./src/components/common/LastMessageMeta.tsx","webpack://telegram-t/./src/components/common/Media.tsx","webpack://telegram-t/./src/components/common/MessageOutgoingStatus.tsx","webpack://telegram-t/./src/components/common/NothingFound.tsx","webpack://telegram-t/./src/components/common/Picker.tsx","webpack://telegram-t/./src/components/common/PickerSelectedItem.tsx","webpack://telegram-t/./src/components/common/PrivateChatInfo.tsx","webpack://telegram-t/./src/components/common/ProfilePhoto.tsx","webpack://telegram-t/./src/components/common/ProfileInfo.tsx","webpack://telegram-t/./src/components/common/hooks/usePhotosPreload.ts","webpack://telegram-t/./src/components/common/StickerButton.tsx","webpack://telegram-t/./src/components/common/StickerSetModal.async.tsx","webpack://telegram-t/./src/components/common/TypingStatus.tsx","webpack://telegram-t/./src/components/common/VerifiedIcon.tsx","webpack://telegram-t/./src/components/common/WebLink.tsx","webpack://telegram-t/./src/components/common/helpers/mediaDimensions.ts","webpack://telegram-t/./src/components/common/helpers/renderMessageText.tsx","webpack://telegram-t/./src/components/left/main/hooks/useChatAnimationType.ts","webpack://telegram-t/./src/components/left/main/Badge.tsx","webpack://telegram-t/./src/components/left/main/Chat.tsx","webpack://telegram-t/./src/components/left/main/EmptyFolder.tsx","webpack://telegram-t/./src/components/left/main/ChatList.tsx","webpack://telegram-t/./src/components/middle/composer/DropTarget.tsx","webpack://telegram-t/./src/components/middle/composer/DropArea.tsx","webpack://telegram-t/./src/components/middle/composer/EmojiTooltip.async.tsx","webpack://telegram-t/./src/components/middle/composer/MessageInput.tsx","webpack://telegram-t/./src/components/middle/composer/TextFormatter.tsx","webpack://telegram-t/./src/components/middle/composer/helpers/parseMessageInput.ts","webpack://telegram-t/./src/components/middle/composer/helpers/prepareForRegExp.ts","webpack://telegram-t/./src/components/middle/composer/helpers/selection.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useEmojiTooltip.ts","webpack://telegram-t/./src/components/middle/composer/helpers/searchUserName.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useMentionTooltip.ts","webpack://telegram-t/./src/components/right/hooks/useAsyncRendering.ts","webpack://telegram-t/./src/components/ui/ConfirmDialog.tsx","webpack://telegram-t/./src/components/ui/FloatingActionButton.tsx","webpack://telegram-t/./src/components/ui/InfiniteScroll.tsx","webpack://telegram-t/./src/components/ui/ListItem.tsx","webpack://telegram-t/./src/components/ui/Modal.tsx","webpack://telegram-t/./src/util/trapFocus.ts","webpack://telegram-t/./src/components/ui/Notification.tsx","webpack://telegram-t/./src/components/ui/Portal.ts","webpack://telegram-t/./src/components/ui/ProgressSpinner.tsx","webpack://telegram-t/./src/components/ui/Radio.tsx","webpack://telegram-t/./src/components/ui/RadioGroup.tsx","webpack://telegram-t/./src/components/ui/SearchInput.tsx","webpack://telegram-t/./src/components/ui/ShowTransition.tsx","webpack://telegram-t/./src/components/ui/Switcher.tsx","webpack://telegram-t/./src/components/ui/Tab.tsx","webpack://telegram-t/./src/components/ui/TabList.tsx","webpack://telegram-t/./src/components/ui/Transition.tsx","webpack://telegram-t/./src/hooks/reducers/useFoldersReducer.ts","webpack://telegram-t/./src/hooks/useAudioPlayer.ts","webpack://telegram-t/./src/hooks/useBackgroundMode.ts","webpack://telegram-t/./src/hooks/useBlur.ts","webpack://telegram-t/./src/hooks/useBlurSync.ts","webpack://telegram-t/./src/hooks/useBuffering.ts","webpack://telegram-t/./src/hooks/useCanvasBlur.ts","webpack://telegram-t/./src/hooks/useChatContextActions.ts","webpack://telegram-t/./src/hooks/useContextMenuHandlers.ts","webpack://telegram-t/./src/hooks/useContextMenuPosition.ts","webpack://telegram-t/./src/hooks/useCurrentOrPrev.ts","webpack://telegram-t/./src/hooks/useEnsureMessage.ts","webpack://telegram-t/./src/hooks/useHorizontalScroll.ts","webpack://telegram-t/./src/hooks/useInfiniteScroll.ts","webpack://telegram-t/./src/hooks/useIntersectionObserver.ts","webpack://telegram-t/./src/hooks/useLayoutEffectWithPrevDeps.ts","webpack://telegram-t/./src/hooks/useMedia.ts","webpack://telegram-t/./src/hooks/useMediaDownload.ts","webpack://telegram-t/./src/hooks/useMediaWithDownloadProgress.ts","webpack://telegram-t/./src/hooks/useMouseInside.ts","webpack://telegram-t/./src/hooks/usePrevDuringAnimation.ts","webpack://telegram-t/./src/hooks/useReducer.ts","webpack://telegram-t/./src/hooks/useTransitionForMedia.ts","webpack://telegram-t/./src/hooks/useVideoCleanup.ts","webpack://telegram-t/./src/lib/fastBlur.js","webpack://telegram-t/./src/util/audioPlayer.ts","webpack://telegram-t/./src/util/captureEvents.ts","webpack://telegram-t/./src/util/clipboard.ts","webpack://telegram-t/./src/util/cssAnimationEndListeners.ts","webpack://telegram-t/./src/util/cycleRestrict.ts","webpack://telegram-t/./src/util/download.ts","webpack://telegram-t/./src/util/fastSmoothScroll.ts","webpack://telegram-t/./src/util/fastSmoothScrollHorizontal.ts","webpack://telegram-t/./src/util/focusEditableElement.ts","webpack://telegram-t/./src/util/patchSafariProgressiveAudio.ts","webpack://telegram-t/./src/util/resetScroll.ts","webpack://telegram-t/./src/util/safePlay.ts"],"sourcesContent":["import React, {\n FC, useCallback, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiSticker } from '../../api/types';\n\nimport { LIKE_STICKER_ID } from './helpers/mediaDimensions';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport useMedia from '../../hooks/useMedia';\nimport useTransitionForMedia from '../../hooks/useTransitionForMedia';\nimport useFlag from '../../hooks/useFlag';\n\nimport AnimatedSticker from './AnimatedSticker';\n\nimport './AnimatedEmoji.scss';\n\ntype OwnProps = {\n sticker: ApiSticker;\n observeIntersection?: ObserveFn;\n size?: 'large' | 'medium' | 'small';\n lastSyncTime?: number;\n forceLoadPreview?: boolean;\n};\n\nconst QUALITY = 1;\nconst WIDTH = {\n large: 160,\n medium: 128,\n small: 104,\n};\n\nconst AnimatedEmoji: FC = ({\n sticker,\n size = 'medium',\n observeIntersection,\n lastSyncTime,\n forceLoadPreview,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const [isAnimationLoaded, markAnimationLoaded] = useFlag();\n const localMediaHash = `sticker${sticker.id}`;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const thumbDataUri = sticker.thumbnail?.dataUri;\n const previewBlobUrl = useMedia(\n `${localMediaHash}?size=m`,\n !isIntersecting && !forceLoadPreview,\n ApiMediaFormat.BlobUrl,\n lastSyncTime,\n );\n const { transitionClassNames } = useTransitionForMedia(previewBlobUrl, 'slow');\n\n const mediaData = useMedia(localMediaHash, !isIntersecting, ApiMediaFormat.Lottie, lastSyncTime);\n const isMediaLoaded = Boolean(mediaData);\n\n const [playKey, setPlayKey] = useState(String(Math.random()));\n const handleClick = useCallback(() => {\n setPlayKey(String(Math.random()));\n }, []);\n\n const width = WIDTH[size];\n const style = `width: ${width}px; height: ${width}px;`;\n\n return (\n \n {!isAnimationLoaded && thumbDataUri && (\n \"\"\n )}\n {!isAnimationLoaded && previewBlobUrl && (\n \"\"\n )}\n {isMediaLoaded && (\n \n )}\n
\n );\n};\n\nexport default AnimatedEmoji;\n","import React, {\n FC, useEffect, useRef, memo, useCallback, useState,\n} from '../../lib/teact/teact';\n\nimport { fastRaf } from '../../util/schedulers';\nimport buildClassName from '../../util/buildClassName';\nimport useHeavyAnimationCheck from '../../hooks/useHeavyAnimationCheck';\nimport useBackgroundMode from '../../hooks/useBackgroundMode';\n\ntype OwnProps = {\n className?: string;\n id: string;\n animationData: AnyLiteral;\n play?: boolean | string;\n playSegment?: [number, number];\n speed?: number;\n noLoop?: boolean;\n size: number;\n quality?: number;\n isLowPriority?: boolean;\n onLoad?: NoneToVoidFunction;\n};\n\ntype RLottieClass = typeof import('../../lib/rlottie/RLottie').default;\ntype RLottieInstance = import('../../lib/rlottie/RLottie').default;\nlet lottiePromise: Promise;\nlet RLottie: RLottieClass;\n\n// Time supposed for judges to measure \"Transferred Size\" in Dev Tools\nconst LOTTIE_LOAD_DELAY = 5000;\n\nasync function ensureLottie() {\n if (!lottiePromise) {\n lottiePromise = import('../../lib/rlottie/RLottie') as unknown as Promise;\n RLottie = (await lottiePromise as any).default;\n }\n\n return lottiePromise;\n}\n\nsetTimeout(ensureLottie, LOTTIE_LOAD_DELAY);\n\nconst AnimatedSticker: FC = ({\n className,\n id,\n animationData,\n play,\n playSegment,\n speed,\n noLoop,\n size,\n quality,\n isLowPriority,\n onLoad,\n}) => {\n const [animation, setAnimation] = useState();\n // eslint-disable-next-line no-null/no-null\n const container = useRef(null);\n const wasPlaying = useRef(false);\n const isFrozen = useRef(false);\n\n const playRef = useRef();\n playRef.current = play;\n const playSegmentRef = useRef<[number, number]>();\n playSegmentRef.current = playSegment;\n\n useEffect(() => {\n if (animation || !animationData) {\n return;\n }\n\n const exec = () => {\n if (!container.current) {\n return;\n }\n\n const newAnimation = new RLottie(\n id,\n container.current,\n animationData,\n {\n noLoop,\n size,\n quality,\n isLowPriority,\n },\n onLoad,\n );\n\n if (speed) {\n newAnimation.setSpeed(speed);\n }\n\n setAnimation(newAnimation);\n };\n\n if (RLottie) {\n exec();\n } else {\n ensureLottie().then(() => {\n fastRaf(() => {\n if (container.current) {\n exec();\n }\n });\n });\n }\n }, [animation, animationData, id, isLowPriority, noLoop, onLoad, quality, size, speed]);\n\n useEffect(() => {\n return () => {\n if (animation) {\n animation.destroy();\n }\n };\n }, [animation]);\n\n const playAnimation = useCallback((shouldRestart = false) => {\n if (animation && (playRef.current || playSegmentRef.current)) {\n if (playSegmentRef.current) {\n animation.playSegment(playSegmentRef.current);\n } else if (shouldRestart) {\n animation.goToAndPlay(0);\n } else {\n animation.play();\n }\n }\n }, [animation]);\n\n const pauseAnimation = useCallback(() => {\n if (!animation) {\n return;\n }\n\n animation.pause();\n }, [animation]);\n\n const freezeAnimation = useCallback(() => {\n isFrozen.current = true;\n\n if (!animation) {\n return;\n }\n\n if (!wasPlaying.current) {\n wasPlaying.current = animation.isPlaying();\n }\n\n pauseAnimation();\n }, [animation, pauseAnimation]);\n\n const unfreezeAnimation = useCallback(() => {\n if (wasPlaying.current) {\n playAnimation();\n }\n\n wasPlaying.current = false;\n isFrozen.current = false;\n }, [playAnimation]);\n\n const unfreezeAnimationOnRaf = useCallback(() => {\n fastRaf(unfreezeAnimation);\n }, [unfreezeAnimation]);\n\n useEffect(() => {\n if (!animation) {\n return;\n }\n\n if (play || playSegment) {\n if (isFrozen.current) {\n wasPlaying.current = true;\n } else {\n playAnimation(noLoop);\n }\n } else {\n // eslint-disable-next-line no-lonely-if\n if (isFrozen.current) {\n wasPlaying.current = false;\n } else {\n pauseAnimation();\n }\n }\n }, [animation, play, playSegment, noLoop, playAnimation, pauseAnimation]);\n\n useHeavyAnimationCheck(freezeAnimation, unfreezeAnimation);\n // Pausing frame may not happen in background\n // so we need to make sure it happens right after focusing,\n // then we can play again.\n useBackgroundMode(freezeAnimation, unfreezeAnimationOnRaf);\n\n const fullClassName = buildClassName('AnimatedSticker', className);\n\n const style = size ? `width: ${size}px; height: ${size}px;` : undefined;\n\n return (\n \n );\n};\n\nexport default memo(AnimatedSticker);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport {\n ApiAudio, ApiMessage, ApiVoice,\n} from '../../api/types';\nimport { ISettings } from '../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { formatMediaDateTime, formatMediaDuration, formatPastTimeShort } from '../../util/dateFormat';\nimport {\n getMediaDuration,\n getMediaTransferState,\n getMessageAudioCaption,\n getMessageKey,\n getMessageMediaFormat,\n getMessageMediaHash,\n isMessageLocal,\n isOwnMessage,\n} from '../../modules/helpers';\nimport { renderWaveformToDataUri } from './helpers/waveform';\nimport buildClassName from '../../util/buildClassName';\nimport renderText from './helpers/renderText';\nimport { decodeWaveform, interpolateArray } from '../../util/waveform';\nimport useMediaWithDownloadProgress from '../../hooks/useMediaWithDownloadProgress';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useBuffering from '../../hooks/useBuffering';\nimport useAudioPlayer from '../../hooks/useAudioPlayer';\nimport useMediaDownload from '../../hooks/useMediaDownload';\nimport useLang, { LangFn } from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport ProgressSpinner from '../ui/ProgressSpinner';\nimport Link from '../ui/Link';\n\nimport './Audio.scss';\n\ntype OwnProps = {\n theme: ISettings['theme'];\n message: ApiMessage;\n senderTitle?: string;\n uploadProgress?: number;\n target?: 'searchResult' | 'sharedMedia';\n date?: number;\n lastSyncTime?: number;\n className?: string;\n isSelectable?: boolean;\n isSelected?: boolean;\n onPlay: (messageId: number, chatId: number) => void;\n onReadMedia?: () => void;\n onCancelUpload?: () => void;\n onDateClick?: (messageId: number, chatId: number) => void;\n};\n\ninterface ISeekMethods {\n handleStartSeek: (e: React.MouseEvent) => void;\n handleSeek: (e: React.MouseEvent) => void;\n handleStopSeek: () => void;\n}\n\nconst AVG_VOICE_DURATION = 30;\nconst MIN_SPIKES = IS_SINGLE_COLUMN_LAYOUT ? 20 : 25;\nconst MAX_SPIKES = IS_SINGLE_COLUMN_LAYOUT ? 50 : 75;\n// This is needed for browsers requiring user interaction before playing.\nconst PRELOAD = true;\n\nconst Audio: FC = ({\n theme,\n message,\n senderTitle,\n uploadProgress,\n target,\n date,\n lastSyncTime,\n className,\n isSelectable,\n isSelected,\n onPlay,\n onReadMedia,\n onCancelUpload,\n onDateClick,\n}) => {\n const { content: { audio, voice }, isMediaUnread } = message;\n const isVoice = Boolean(voice);\n const isSeeking = useRef(false);\n const lang = useLang();\n\n const [isActivated, setIsActivated] = useState(false);\n const shouldDownload = (isActivated || PRELOAD) && lastSyncTime;\n\n const { mediaData, downloadProgress } = useMediaWithDownloadProgress(\n getMessageMediaHash(message, 'inline'),\n !shouldDownload,\n getMessageMediaFormat(message, 'inline'),\n );\n\n function handleForcePlay() {\n setIsActivated(true);\n onPlay(message.id, message.chatId);\n }\n\n const {\n isBuffered, bufferedProgress, bufferingHandlers, checkBuffering,\n } = useBuffering();\n\n const {\n isPlaying, playProgress, playPause, setCurrentTime, duration,\n } = useAudioPlayer(\n getMessageKey(message),\n getMediaDuration(message)!,\n mediaData,\n bufferingHandlers,\n checkBuffering,\n isActivated,\n handleForcePlay,\n isMessageLocal(message),\n );\n\n useEffect(() => {\n setIsActivated(isPlaying);\n }, [isPlaying]);\n\n const {\n isDownloadStarted,\n downloadProgress: directDownloadProgress,\n handleDownloadClick,\n } = useMediaDownload(getMessageMediaHash(message, 'download'), getMessageAudioCaption(message));\n\n const isLoadingForPlaying = isActivated && !isBuffered;\n\n const {\n isUploading, isTransferring, transferProgress,\n } = getMediaTransferState(\n message,\n isDownloadStarted ? directDownloadProgress : (uploadProgress || downloadProgress),\n isLoadingForPlaying || isDownloadStarted,\n );\n\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring);\n\n const handleButtonClick = useCallback(() => {\n if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload();\n }\n\n return;\n }\n\n if (!isPlaying) {\n onPlay(message.id, message.chatId);\n }\n\n setIsActivated(!isActivated);\n playPause();\n }, [isPlaying, isUploading, message.id, message.chatId, onCancelUpload, onPlay, playPause, isActivated]);\n\n useEffect(() => {\n if (isPlaying && onReadMedia && isMediaUnread) {\n onReadMedia();\n }\n }, [isPlaying, isMediaUnread, onReadMedia]);\n\n const handleSeek = useCallback((e: React.MouseEvent) => {\n if (isSeeking.current) {\n const seekBar = e.currentTarget.closest('.seekline,.waveform');\n if (seekBar) {\n const { width, left } = seekBar.getBoundingClientRect();\n setCurrentTime(duration * ((e.clientX - left) / width));\n }\n }\n }, [duration, setCurrentTime]);\n\n const handleStartSeek = useCallback((e: React.MouseEvent) => {\n isSeeking.current = true;\n handleSeek(e);\n }, [handleSeek]);\n\n const handleStopSeek = useCallback(() => {\n isSeeking.current = false;\n }, []);\n\n const handleDateClick = useCallback(() => {\n onDateClick!(message.id, message.chatId);\n }, [onDateClick, message.id, message.chatId]);\n\n function getFirstLine() {\n if (isVoice) {\n return senderTitle || 'Voice';\n }\n\n const { title, fileName } = audio!;\n\n return title || fileName;\n }\n\n function getSecondLine() {\n if (isVoice) {\n return formatMediaDuration(voice!.duration);\n }\n\n const { performer } = audio!;\n\n return (\n <>\n {performer && renderText(performer)}\n {performer && senderTitle && }\n {senderTitle && renderText(senderTitle)}\n \n );\n }\n\n const seekHandlers = { handleStartSeek, handleSeek, handleStopSeek };\n const isOwn = isOwnMessage(message);\n const renderedWaveform = useMemo(\n () => voice && renderWaveform(voice, playProgress, isOwn, { handleStartSeek, handleSeek, handleStopSeek }, theme),\n [voice, playProgress, isOwn, handleStartSeek, handleSeek, handleStopSeek, theme],\n );\n\n const fullClassName = buildClassName(\n 'Audio media-inner',\n className,\n isOwn && !target && 'own',\n target && 'bigger',\n isSelected && 'audio-is-selected',\n );\n\n const buttonClassNames = ['toggle-play'];\n if (isLoadingForPlaying) {\n buttonClassNames.push('loading');\n } else if (isPlaying) {\n buttonClassNames.push('pause');\n } else if (!isPlaying) {\n buttonClassNames.push('play');\n }\n\n const showSeekline = isPlaying || (playProgress > 0 && playProgress < 1);\n const contentClassName = buildClassName('content', showSeekline && 'with-seekline');\n\n function renderSearchResult() {\n return (\n <>\n
\n
\n

{renderText(getFirstLine())}

\n\n
\n {date && (\n \n {formatPastTimeShort(lang, date * 1000)}\n \n )}\n
\n
\n\n {showSeekline && renderSeekline(playProgress, bufferedProgress, seekHandlers)}\n {!showSeekline && (\n

\n {playProgress > 0 ? `${formatMediaDuration(duration * playProgress)} / ` : undefined}\n {getSecondLine()}\n

\n )}\n
\n \n );\n }\n\n return (\n
\n {isSelectable && (\n
\n {isSelected && }\n
\n )}\n \n \n \n \n {shouldRenderSpinner && (\n
\n \n
\n )}\n {audio && (\n \n \n \n )}\n {target === 'searchResult' && renderSearchResult()}\n {target !== 'searchResult' && audio && renderAudio(\n lang, audio, isPlaying, playProgress, bufferedProgress, seekHandlers, date,\n onDateClick ? handleDateClick : undefined,\n )}\n {target !== 'searchResult' && voice && renderVoice(voice, renderedWaveform, isMediaUnread)}\n
\n );\n};\n\nfunction renderAudio(\n lang: LangFn,\n audio: ApiAudio,\n isPlaying: boolean,\n playProgress: number,\n bufferedProgress: number,\n seekHandlers: ISeekMethods,\n date?: number,\n handleDateClick?: NoneToVoidFunction,\n) {\n const {\n title, performer, duration, fileName,\n } = audio;\n const showSeekline = isPlaying || (playProgress > 0 && playProgress < 1);\n\n return (\n
\n

{renderText(title || fileName)}

\n {showSeekline && renderSeekline(playProgress, bufferedProgress, seekHandlers)}\n {!showSeekline && (\n
\n {renderText(performer || 'Unknown')}\n {date && (\n <>\n {' '}\n •\n {' '}\n {formatMediaDateTime(lang, date * 1000)}\n \n )}\n
\n )}\n

\n {playProgress > 0 ? `${formatMediaDuration(duration * playProgress)} / ` : undefined}\n {formatMediaDuration(duration)}\n

\n
\n );\n}\n\nfunction renderVoice(voice: ApiVoice, renderedWaveform: any, isMediaUnread?: boolean) {\n return (\n
\n {renderedWaveform}\n

\n {formatMediaDuration(voice.duration)}\n {isMediaUnread && }\n

\n
\n );\n}\n\nfunction renderWaveform(\n voice: ApiVoice,\n playProgress = 0,\n isOwn = false,\n { handleStartSeek, handleSeek, handleStopSeek }: ISeekMethods,\n theme: ISettings['theme'],\n) {\n const { waveform, duration } = voice;\n\n if (!waveform) {\n return undefined;\n }\n\n const fillColor = theme === 'dark' ? '#494B75' : '#CBCBCB';\n const fillOwnColor = theme === 'dark' ? '#C0BBED' : '#B0DEA6';\n const progressFillColor = theme === 'dark' ? '#868DF5' : '#54a3e6';\n const progressFillOwnColor = theme === 'dark' ? '#FFFFFF' : '#53ad53';\n const durationFactor = Math.min(duration / AVG_VOICE_DURATION, 1);\n const spikesCount = Math.round(MIN_SPIKES + (MAX_SPIKES - MIN_SPIKES) * durationFactor);\n const decodedWaveform = decodeWaveform(new Uint8Array(waveform));\n const { data: spikes, peak } = interpolateArray(decodedWaveform, spikesCount);\n const { src, width, height } = renderWaveformToDataUri(spikes, playProgress, {\n peak,\n fillStyle: isOwn ? fillOwnColor : fillColor,\n progressFillStyle: isOwn ? progressFillOwnColor : progressFillColor,\n });\n\n return (\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n \n );\n}\n\nfunction renderSeekline(\n playProgress: number,\n bufferedProgress: number,\n { handleStartSeek, handleSeek, handleStopSeek }: ISeekMethods,\n) {\n return (\n \n \n \n \n \n \n \n \n \n \n
\n );\n}\n\nexport default memo(Audio);\n","/* eslint-disable no-bitwise */\n\n// eslint-disable-next-line max-len\n// Ref: https://github.com/telegramdesktop/tdesktop/blob/0743e71ab6b928d2ee5bae1aed991849b1e2b291/Telegram/SourceFiles/data/data_document.cpp#L1018\nexport function decodeWaveform(encoded5bit: Uint8Array) {\n const bitsCount = encoded5bit.length * 8;\n const valuesCount = Math.floor(bitsCount / 5);\n if (!valuesCount) {\n return [];\n }\n\n // Read each 5 bit of encoded5bit as 0-31 unsigned char.\n // We count the index of the byte in which the desired 5-bit sequence starts.\n // And then we read a uint16 starting from that byte to guarantee to get all of those 5 bits.\n //\n // BUT! if it is the last byte we have, we're not allowed to read a uint16 starting with it.\n // Because it will be an overflow (we'll access one byte after the available memory).\n // We see, that only the last 5 bits could start in the last available byte and be problematic.\n // So we read in a general way all the entries in a general way except the last one.\n const result = Array(valuesCount);\n const bitsData = encoded5bit;\n for (let i = 0, l = valuesCount - 1; i !== l; ++i) {\n const byteIndex = Math.floor((i * 5) / 8);\n const bitShift = Math.floor((i * 5) % 8);\n const value = bitsData[byteIndex] + (bitsData[byteIndex + 1] << 8);\n result[i] = ((value >> bitShift) & 0x1F);\n }\n const lastByteIndex = Math.floor(((valuesCount - 1) * 5) / 8);\n const lastBitShift = Math.floor(((valuesCount - 1) * 5) % 8);\n const lastValue = bitsData[lastByteIndex] + (bitsData[lastByteIndex + 1] << 8);\n result[valuesCount - 1] = (lastValue >> lastBitShift) & 0x1F;\n\n return result;\n}\n\nexport function interpolateArray(data: number[], fitCount: number) {\n let peak = 0;\n const newData = new Array(fitCount);\n const springFactor = data.length / fitCount;\n const leftFiller = data[0];\n const rightFiller = data[data.length - 1];\n for (let i = 0; i < fitCount; i++) {\n const idx = Math.floor(i * springFactor);\n const val = ((data[idx - 1] ?? leftFiller) + (data[idx] ?? leftFiller) + (data[idx + 1] ?? rightFiller)) / 3;\n newData[i] = val;\n if (peak < val) {\n peak = val;\n }\n }\n return { data: newData, peak };\n}\n","type IWaveformProps = {\n peak: number;\n fillStyle: string;\n progressFillStyle: string;\n};\n\nconst SPIKE_WIDTH = 2;\nconst SPIKE_STEP = 4;\nconst SPIKE_RADIUS = 1;\nconst HEIGHT = 23;\n\nexport function renderWaveformToDataUri(\n spikes: number[],\n progress: number,\n {\n peak, fillStyle, progressFillStyle,\n }: IWaveformProps,\n) {\n const width = spikes.length * SPIKE_STEP;\n const height = HEIGHT;\n\n const canvas = document.createElement('canvas');\n canvas.width = width * 2;\n canvas.height = height * 2;\n canvas.style.width = `${width}px`;\n canvas.style.height = `${height}px`;\n\n const ctx = canvas.getContext('2d')!;\n ctx.scale(2, 2);\n\n spikes.forEach((item, i) => {\n ctx.globalAlpha = (i / spikes.length >= progress) ? 0.5 : 1;\n ctx.fillStyle = progress > i / spikes.length ? progressFillStyle : fillStyle;\n const spikeHeight = Math.max(2, HEIGHT * (item / Math.max(1, peak)));\n roundedRectangle(ctx, i * SPIKE_STEP, height, SPIKE_WIDTH, spikeHeight, SPIKE_RADIUS);\n ctx.fill();\n });\n\n return {\n src: canvas.toDataURL(),\n width,\n height,\n };\n}\n\nfunction roundedRectangle(\n ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, radius: number,\n) {\n if (width < 2 * radius) {\n radius = width / 2;\n }\n if (height < 2 * radius) {\n radius = height / 2;\n }\n\n ctx.beginPath();\n ctx.moveTo(x + radius, y);\n ctx.arcTo(x + width, y, x + width, y - height, radius);\n ctx.arcTo(x + width, y - height, x, y - height, radius);\n ctx.arcTo(x, y - height, x, y, radius);\n ctx.arcTo(x, y, x + width, y, radius);\n ctx.closePath();\n}\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, { FC, useCallback, memo } from '../../lib/teact/teact';\n\nimport { ApiUser, ApiChat, ApiMediaFormat } from '../../api/types';\n\nimport { IS_TEST } from '../../config';\nimport {\n getChatAvatarHash, getChatTitle, isChatPrivate,\n getUserFullName, isUserOnline, isDeletedUser, getUserColorKey,\n} from '../../modules/helpers';\nimport { getFirstLetters } from '../../util/textFormat';\nimport buildClassName from '../../util/buildClassName';\nimport renderText from './helpers/renderText';\nimport useMedia from '../../hooks/useMedia';\nimport useTransitionForMedia from '../../hooks/useTransitionForMedia';\nimport useLang from '../../hooks/useLang';\n\nimport './Avatar.scss';\n\ntype OwnProps = {\n className?: string;\n size?: 'micro' | 'tiny' | 'small' | 'medium' | 'large' | 'jumbo';\n withOnlineStatus?: boolean;\n chat?: ApiChat;\n user?: ApiUser;\n text?: string;\n isSavedMessages?: boolean;\n lastSyncTime?: number;\n onClick?: (e: ReactMouseEvent, hasPhoto: boolean) => void;\n};\n\nconst Avatar: FC = ({\n className,\n size = 'large',\n chat,\n user,\n text,\n withOnlineStatus,\n isSavedMessages,\n lastSyncTime,\n onClick,\n}) => {\n const isDeleted = user && isDeletedUser(user);\n let imageHash: string | undefined;\n\n if (!isSavedMessages && !isDeleted) {\n if (user) {\n imageHash = getChatAvatarHash(user);\n } else if (chat) {\n imageHash = getChatAvatarHash(chat);\n }\n }\n\n const dataUri = useMedia(imageHash, false, ApiMediaFormat.DataUri, lastSyncTime);\n const { shouldRenderFullMedia, transitionClassNames } = useTransitionForMedia(dataUri, 'slow');\n\n const lang = useLang();\n\n let content: string | undefined = '';\n\n if (isSavedMessages) {\n content = ;\n } else if (isDeleted) {\n content = ;\n } else if (shouldRenderFullMedia) {\n content = \"\";\n } else if (user) {\n const userFullName = getUserFullName(user);\n content = userFullName ? getFirstLetters(userFullName, 2) : undefined;\n } else if (chat) {\n const title = getChatTitle(lang, chat);\n content = title && getFirstLetters(title, isChatPrivate(chat.id) ? 2 : 1);\n } else if (text) {\n content = getFirstLetters(text, 2);\n }\n\n const isOnline = !isSavedMessages && user && isUserOnline(user);\n const fullClassName = buildClassName(\n `Avatar size-${size}`,\n className,\n `color-bg-${getUserColorKey(user || chat)}`,\n isSavedMessages && 'saved-messages',\n isDeleted && 'deleted-account',\n withOnlineStatus && isOnline && 'online',\n onClick && 'interactive',\n (!isSavedMessages && !shouldRenderFullMedia) && 'no-photo',\n );\n\n const handleClick = useCallback((e: ReactMouseEvent) => {\n if (onClick) {\n onClick(e, isSavedMessages || shouldRenderFullMedia);\n }\n }, [onClick, isSavedMessages, shouldRenderFullMedia]);\n\n const senderId = (user || chat) && (user || chat)!.id;\n\n return (\n
\n {typeof content === 'string' ? renderText(content, [size === 'jumbo' ? 'hq_emoji' : 'emoji']) : content}\n
\n );\n};\n\nexport default memo(Avatar);\n","import React, {\n FC, memo, useCallback, useEffect,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { ApiChat, ApiCountryCode, ApiUser } from '../../api/types';\n\nimport {\n selectChat, selectNotifyExceptions, selectNotifySettings, selectUser,\n} from '../../modules/selectors';\nimport {\n getChatDescription, getChatLink, getHasAdminRight, isChatChannel, isChatPrivate, isUserRightBanned, selectIsChatMuted,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { pick } from '../../util/iteratees';\nimport { copyTextToClipboard } from '../../util/clipboard';\nimport { formatPhoneNumberWithCode } from '../../util/phoneNumber';\nimport useLang from '../../hooks/useLang';\n\nimport ListItem from '../ui/ListItem';\nimport Switcher from '../ui/Switcher';\n\ntype OwnProps = {\n chatOrUserId: number;\n forceShowSelf?: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat?: ApiChat;\n canInviteUsers?: boolean;\n isMuted?: boolean;\n phoneCodeList: ApiCountryCode[];\n} & Pick;\n\ntype DispatchProps = Pick;\n\nconst ChatExtra: FC = ({\n lastSyncTime,\n user,\n chat,\n forceShowSelf,\n canInviteUsers,\n isMuted,\n phoneCodeList,\n loadFullUser,\n showNotification,\n updateChatMutedState,\n}) => {\n const {\n id: userId,\n fullInfo,\n username,\n phoneNumber,\n isSelf,\n } = user || {};\n const { id: chatId } = chat || {};\n const lang = useLang();\n\n useEffect(() => {\n if (lastSyncTime && userId) {\n loadFullUser({ userId });\n }\n }, [loadFullUser, userId, lastSyncTime]);\n\n const handleNotificationChange = useCallback(() => {\n updateChatMutedState({ chatId, isMuted: !isMuted });\n }, [chatId, isMuted, updateChatMutedState]);\n\n if (!chat || chat.isRestricted || (isSelf && !forceShowSelf)) {\n return undefined;\n }\n\n function copy(text: string, entity: string) {\n copyTextToClipboard(text);\n showNotification({ message: `${entity} was copied` });\n }\n\n const formattedNumber = phoneNumber && formatPhoneNumberWithCode(phoneCodeList, phoneNumber);\n const link = getChatLink(chat);\n const description = (fullInfo?.bio) || getChatDescription(chat);\n\n return (\n
\n {formattedNumber && !!formattedNumber.length && (\n copy(formattedNumber, lang('Phone'))}>\n {formattedNumber}\n {lang('Phone')}\n \n )}\n {username && (\n copy(`@${username}`, lang('Username'))}\n >\n {renderText(username)}\n {lang('Username')}\n \n )}\n {description && !!description.length && (\n \n \n {renderText(description, ['br', 'links', 'emoji'])}\n \n {lang(userId ? 'UserBio' : 'Info')}\n \n )}\n {(canInviteUsers || !username) && link && (\n copy(link, lang('SetUrlPlaceholder'))}>\n
{link}
\n {lang('SetUrlPlaceholder')}\n
\n )}\n {!forceShowSelf && (\n \n {lang('Notifications')}\n \n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatOrUserId }): StateProps => {\n const { lastSyncTime, countryList: { phoneCodes: phoneCodeList } } = global;\n\n const chat = chatOrUserId ? selectChat(global, chatOrUserId) : undefined;\n const user = isChatPrivate(chatOrUserId) ? selectUser(global, chatOrUserId) : undefined;\n const isMuted = chat && selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global));\n\n const canInviteUsers = chat && !user && (\n (!isChatChannel(chat) && !isUserRightBanned(chat, 'inviteUsers'))\n || getHasAdminRight(chat, 'inviteUsers')\n );\n\n return {\n lastSyncTime, phoneCodeList, chat, user, canInviteUsers, isMuted,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadFullUser', 'updateChatMutedState', 'showNotification',\n ]),\n)(ChatExtra));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\n\nimport { selectIsChatWithSelf, selectUser } from '../../modules/selectors';\nimport {\n isChatPrivate,\n isUserBot,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n isChatChannel,\n getChatTitle,\n} from '../../modules/helpers';\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\nimport renderText from './helpers/renderText';\n\nimport Avatar from './Avatar';\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nimport './DeleteChatModal.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n chat: ApiChat;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n};\n\ntype StateProps = {\n isChannel: boolean;\n isChatWithSelf?: boolean;\n isBot?: boolean;\n isPrivateChat: boolean;\n isBasicGroup: boolean;\n isSuperGroup: boolean;\n currentUserId: number | undefined;\n canDeleteForAll?: boolean;\n contactName?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst DeleteChatModal: FC = ({\n isOpen,\n chat,\n isChannel,\n isPrivateChat,\n isChatWithSelf,\n isBot,\n isBasicGroup,\n isSuperGroup,\n currentUserId,\n canDeleteForAll,\n contactName,\n onClose,\n onCloseAnimationEnd,\n leaveChannel,\n deleteHistory,\n deleteChannel,\n deleteChatUser,\n blockContact,\n}) => {\n const lang = useLang();\n const chatTitle = getChatTitle(lang, chat);\n\n const handleDeleteMessageForAll = useCallback(() => {\n deleteHistory({ chatId: chat.id, shouldDeleteForAll: true });\n\n onClose();\n }, [deleteHistory, chat.id, onClose]);\n\n const handleDeleteAndStop = useCallback(() => {\n deleteHistory({ chatId: chat.id, shouldDeleteForAll: true });\n blockContact({ contactId: chat.id, accessHash: chat.accessHash });\n\n onClose();\n }, [deleteHistory, chat.id, chat.accessHash, blockContact, onClose]);\n\n const handleDeleteChat = useCallback(() => {\n if (isPrivateChat) {\n deleteHistory({ chatId: chat.id, shouldDeleteForAll: false });\n } else if (isBasicGroup) {\n deleteChatUser({ chatId: chat.id, userId: currentUserId });\n deleteHistory({ chatId: chat.id, shouldDeleteForAll: false });\n } else if ((isChannel || isSuperGroup) && !chat.isCreator) {\n leaveChannel({ chatId: chat.id });\n } else if ((isChannel || isSuperGroup) && chat.isCreator) {\n deleteChannel({ chatId: chat.id });\n }\n onClose();\n }, [\n isPrivateChat,\n isBasicGroup,\n isChannel,\n isSuperGroup,\n currentUserId,\n chat.isCreator,\n chat.id,\n onClose,\n deleteHistory,\n deleteChatUser,\n leaveChannel,\n deleteChannel,\n ]);\n\n function renderHeader() {\n return (\n
\n \n

{lang(renderTitle())}

\n
\n );\n }\n\n function renderTitle() {\n if (isChannel && !chat.isCreator) {\n return 'LeaveChannel';\n }\n\n if (isChannel && chat.isCreator) {\n return 'ChannelDelete';\n }\n\n if (isBasicGroup || isSuperGroup) {\n return 'Group.LeaveGroup';\n }\n\n return 'DeleteChatUser';\n }\n\n function renderMessage() {\n if (isChannel && chat.isCreator) {\n return

{renderText(lang('ChatList.DeleteAndLeaveGroupConfirmation', chatTitle), ['simple_markdown'])}

;\n }\n\n if ((isChannel && !chat.isCreator) || isBasicGroup || isSuperGroup) {\n return

{renderText(lang('ChannelLeaveAlertWithName', chatTitle), ['simple_markdown'])}

;\n }\n\n return

{renderText(lang('ChatList.DeleteChatConfirmation', contactName), ['simple_markdown'])}

;\n }\n\n function renderActionText() {\n if (isChannel && !chat.isCreator) {\n return 'LeaveChannel';\n }\n if (isChannel && chat.isCreator) {\n return 'Chat.Input.Delete';\n }\n\n if (isBasicGroup || isSuperGroup) {\n return 'Group.LeaveGroup';\n }\n\n return canDeleteForAll ? 'ChatList.DeleteForCurrentUser' : 'Delete';\n }\n\n return (\n \n {renderMessage()}\n {isBot && (\n \n )}\n {canDeleteForAll && (\n \n )}\n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chat }): StateProps => {\n const isPrivateChat = isChatPrivate(chat.id);\n const isChatWithSelf = selectIsChatWithSelf(global, chat.id);\n const user = isPrivateChat && selectUser(global, getPrivateChatUserId(chat)!);\n const isBot = user && isUserBot(user) && !chat.isSupport;\n const canDeleteForAll = (isPrivateChat && !isChatWithSelf && !isBot);\n const contactName = isPrivateChat\n ? getUserFirstOrLastName(selectUser(global, getPrivateChatUserId(chat)!))\n : undefined;\n\n return {\n isPrivateChat,\n isChatWithSelf,\n isBot,\n isChannel: isChatChannel(chat),\n isBasicGroup: isChatBasicGroup(chat),\n isSuperGroup: isChatSuperGroup(chat),\n currentUserId: global.currentUserId,\n canDeleteForAll,\n contactName,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions,\n ['leaveChannel', 'deleteHistory', 'deleteChannel', 'deleteChatUser', 'blockContact']),\n)(DeleteChatModal));\n","import React, {\n FC, useCallback, useEffect, useState, memo, useRef,\n} from '../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiMessage } from '../../api/types';\n\nimport { getDocumentExtension, getDocumentHasPreview } from './helpers/documentInfo';\nimport {\n getMediaTransferState,\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n isMessageDocumentVideo,\n} from '../../modules/helpers';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport useMediaWithDownloadProgress from '../../hooks/useMediaWithDownloadProgress';\nimport useMedia from '../../hooks/useMedia';\nimport download from '../../util/download';\n\nimport File from './File';\n\ntype OwnProps = {\n message: ApiMessage;\n observeIntersection?: ObserveFn;\n smaller?: boolean;\n isSelected?: boolean;\n isSelectable?: boolean;\n uploadProgress?: number;\n withDate?: boolean;\n datetime?: number;\n className?: string;\n sender?: string;\n onCancelUpload?: () => void;\n onMediaClick?: () => void;\n onDateClick?: (messageId: number, chatId: number) => void;\n};\n\nconst Document: FC = ({\n message,\n observeIntersection,\n smaller,\n uploadProgress,\n withDate,\n datetime,\n className,\n sender,\n isSelected,\n isSelectable,\n onCancelUpload,\n onMediaClick,\n onDateClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const document = message.content.document!;\n const extension = getDocumentExtension(document) || '';\n const { fileName, size, timestamp } = document;\n const withMediaViewer = onMediaClick && Boolean(document.mediaType);\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const [isDownloadAllowed, setIsDownloadAllowed] = useState(false);\n const {\n mediaData, downloadProgress,\n } = useMediaWithDownloadProgress(\n getMessageMediaHash(message, 'download'), !isDownloadAllowed, undefined, undefined, undefined, true,\n );\n const {\n isUploading, isTransferring, transferProgress,\n } = getMediaTransferState(message, uploadProgress || downloadProgress, isDownloadAllowed);\n\n const hasPreview = getDocumentHasPreview(document);\n const thumbDataUri = hasPreview ? getMessageMediaThumbDataUri(message) : undefined;\n const localBlobUrl = hasPreview ? document.previewBlobUrl : undefined;\n const previewData = useMedia(getMessageMediaHash(message, 'pictogram'), !isIntersecting);\n\n const handleClick = useCallback(() => {\n if (withMediaViewer) {\n onMediaClick!();\n } else if (isUploading) {\n if (onCancelUpload) {\n onCancelUpload();\n }\n } else {\n setIsDownloadAllowed((isAllowed) => !isAllowed);\n }\n }, [withMediaViewer, isUploading, onCancelUpload, onMediaClick]);\n\n const handleDateClick = useCallback(() => {\n onDateClick!(message.id, message.chatId);\n }, [onDateClick, message.id, message.chatId]);\n\n useEffect(() => {\n if (isDownloadAllowed && mediaData) {\n download(mediaData, fileName);\n setIsDownloadAllowed(false);\n }\n }, [fileName, mediaData, isDownloadAllowed]);\n\n return (\n \n );\n};\n\nexport default memo(Document);\n","import { RefObject } from 'react';\nimport React, { FC, memo, useRef } from '../../lib/teact/teact';\n\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useTransitionForMedia from '../../hooks/useTransitionForMedia';\nimport buildClassName from '../../util/buildClassName';\nimport { formatMediaDateTime, formatPastTimeShort } from '../../util/dateFormat';\nimport { getColorFromExtension, getFileSizeString } from './helpers/documentInfo';\nimport { getDocumentThumbnailDimensions } from './helpers/mediaDimensions';\nimport renderText from './helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport ProgressSpinner from '../ui/ProgressSpinner';\nimport Link from '../ui/Link';\n\nimport './File.scss';\n\ntype OwnProps = {\n ref?: RefObject;\n name: string;\n extension?: string;\n size: number;\n timestamp?: number;\n sender?: string;\n thumbnailDataUri?: string;\n previewData?: string;\n className?: string;\n smaller?: boolean;\n isTransferring?: boolean;\n isUploading?: boolean;\n isSelectable?: boolean;\n isSelected?: boolean;\n transferProgress?: number;\n actionIcon?: string;\n onClick?: () => void;\n onDateClick?: (e: React.MouseEvent) => void;\n};\n\nconst File: FC = ({\n ref,\n name,\n size,\n extension = '',\n timestamp,\n sender,\n thumbnailDataUri,\n previewData,\n className,\n smaller,\n isTransferring,\n isUploading,\n isSelectable,\n isSelected,\n transferProgress,\n actionIcon,\n onClick,\n onDateClick,\n}) => {\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n let elementRef = useRef(null);\n if (ref) {\n elementRef = ref;\n }\n\n const {\n shouldRender: shouldSpinnerRender,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(isTransferring, undefined, true);\n const color = getColorFromExtension(extension);\n const sizeString = getFileSizeString(size);\n\n const {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(previewData, 'slow');\n const { width, height } = getDocumentThumbnailDimensions(smaller);\n\n const fullClassName = buildClassName(\n 'File',\n className,\n smaller && 'smaller',\n onClick && !isUploading && 'interactive',\n isSelected && 'file-is-selected',\n );\n\n return (\n
\n {isSelectable && (\n
\n {isSelected && }\n
\n )}\n
\n {thumbnailDataUri || previewData ? (\n
\n {shouldRenderThumb && (\n \n )}\n {shouldRenderFullMedia && (\n \n )}\n
\n ) : (\n
\n {extension.length <= 4 && (\n {extension}\n )}\n
\n )}\n {shouldSpinnerRender && (\n
\n \n
\n )}\n {onClick && (\n \n )}\n
\n
\n
{renderText(name)}
\n
\n \n {isTransferring && transferProgress ? `${Math.round(transferProgress * 100)}%` : sizeString}\n \n {sender && {renderText(sender)}}\n {!sender && timestamp && (\n <>\n {' '}\n {formatMediaDateTime(lang, timestamp * 1000)}\n \n )}\n
\n
\n {sender && timestamp && (\n {formatPastTimeShort(lang, timestamp * 1000)}\n )}\n
\n );\n};\n\nexport default memo(File);\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat, ApiTypingStatus } from '../../api/types';\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport {\n getChatTypeString,\n getChatTitle,\n isChatSuperGroup,\n} from '../../modules/helpers';\nimport { selectChat, selectChatMessages, selectChatOnlineCount } from '../../modules/selectors';\nimport renderText from './helpers/renderText';\nimport { pick } from '../../util/iteratees';\nimport useLang, { LangFn } from '../../hooks/useLang';\n\nimport Avatar from './Avatar';\nimport VerifiedIcon from './VerifiedIcon';\nimport TypingStatus from './TypingStatus';\n\ntype OwnProps = {\n chatId: number;\n typingStatus?: ApiTypingStatus;\n avatarSize?: 'small' | 'medium' | 'large' | 'jumbo';\n withMediaViewer?: boolean;\n withUsername?: boolean;\n withFullInfo?: boolean;\n withUpdatingStatus?: boolean;\n withChatType?: boolean;\n noRtl?: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n onlineCount?: number;\n areMessagesLoaded: boolean;\n} & Pick;\n\ntype DispatchProps = Pick;\n\nconst GroupChatInfo: FC = ({\n typingStatus,\n avatarSize = 'medium',\n withMediaViewer,\n withUsername,\n withFullInfo,\n withUpdatingStatus,\n withChatType,\n noRtl,\n chat,\n onlineCount,\n areMessagesLoaded,\n lastSyncTime,\n loadFullChat,\n openMediaViewer,\n}) => {\n const isSuperGroup = chat && isChatSuperGroup(chat);\n const { id: chatId, isMin, isRestricted } = chat || {};\n\n useEffect(() => {\n if (chatId && !isMin && withFullInfo && lastSyncTime) {\n loadFullChat({ chatId });\n }\n }, [chatId, isMin, lastSyncTime, withFullInfo, loadFullChat, isSuperGroup]);\n\n const handleAvatarViewerOpen = useCallback((e: ReactMouseEvent, hasPhoto: boolean) => {\n if (chat && hasPhoto) {\n e.stopPropagation();\n openMediaViewer({\n avatarOwnerId: chat.id,\n origin: avatarSize === 'jumbo' ? MediaViewerOrigin.ProfileAvatar : MediaViewerOrigin.MiddleHeaderAvatar,\n });\n }\n }, [chat, avatarSize, openMediaViewer]);\n\n const lang = useLang();\n\n if (!chat) {\n return undefined;\n }\n\n function renderStatusOrTyping() {\n if (withUpdatingStatus && !areMessagesLoaded && !isRestricted) {\n return (\n {lang('Updating')}\n );\n }\n\n if (!chat) {\n return undefined;\n }\n\n if (typingStatus) {\n return ;\n }\n\n if (withChatType) {\n return (\n
{lang(getChatTypeString(chat))}
\n );\n }\n\n const handle = withUsername ? chat.username : undefined;\n const groupStatus = getGroupStatus(lang, chat);\n const onlineStatus = onlineCount ? `, ${lang('OnlineCount', onlineCount, 'i')}` : undefined;\n\n return (\n
\n {handle && {handle}}\n {groupStatus}\n {onlineStatus && {onlineStatus}}\n
\n );\n }\n\n return (\n
\n \n
\n
\n

{renderText(getChatTitle(lang, chat))}

\n {chat.isVerified && }\n
\n {renderStatusOrTyping()}\n
\n
\n );\n};\n\nfunction getGroupStatus(lang: LangFn, chat: ApiChat) {\n const chatTypeString = lang(getChatTypeString(chat));\n const { membersCount } = chat;\n\n if (chat.isRestricted) {\n return chatTypeString === 'Channel' ? 'channel is inaccessible' : 'group is inaccessible';\n }\n\n if (!membersCount) {\n return chatTypeString;\n }\n\n return chatTypeString === 'Channel'\n ? lang('Subscribers', membersCount, 'i')\n : lang('Members', membersCount, 'i');\n}\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const { lastSyncTime } = global;\n const chat = selectChat(global, chatId);\n const onlineCount = chat ? selectChatOnlineCount(global, chat) : undefined;\n const areMessagesLoaded = Boolean(selectChatMessages(global, chatId));\n\n return {\n lastSyncTime, chat, onlineCount, areMessagesLoaded,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadFullChat', 'openMediaViewer']),\n)(GroupChatInfo));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport { ApiMessage, ApiMessageOutgoingStatus } from '../../api/types';\n\nimport { formatPastTimeShort } from '../../util/dateFormat';\nimport useLang from '../../hooks/useLang';\n\nimport MessageOutgoingStatus from './MessageOutgoingStatus';\n\nimport './LastMessageMeta.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n outgoingStatus?: ApiMessageOutgoingStatus;\n};\n\nconst LastMessageMeta: FC = ({ message, outgoingStatus }) => {\n const lang = useLang();\n return (\n
\n {outgoingStatus && (\n \n )}\n {formatPastTimeShort(lang, message.date * 1000)}\n
\n );\n};\n\nexport default memo(LastMessageMeta);\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport { ApiMessage } from '../../api/types';\n\nimport { formatMediaDuration } from '../../util/dateFormat';\nimport {\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n getMessageVideo,\n} from '../../modules/helpers';\nimport useMedia from '../../hooks/useMedia';\nimport useTransitionForMedia from '../../hooks/useTransitionForMedia';\n\nimport './Media.scss';\n\ntype OwnProps = {\n message: ApiMessage;\n idPrefix?: string;\n onClick?: (messageId: number, chatId: number) => void;\n};\n\nconst Media: FC = ({ message, idPrefix = 'shared-media', onClick }) => {\n const handleClick = useCallback(() => {\n onClick!(message.id, message.chatId);\n }, [message.id, message.chatId, onClick]);\n\n const thumbDataUri = getMessageMediaThumbDataUri(message);\n const mediaBlobUrl = useMedia(getMessageMediaHash(message, 'pictogram'));\n const {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(mediaBlobUrl, 'slow');\n\n const video = getMessageVideo(message);\n\n return (\n
\n {shouldRenderThumb && (\n \"\"\n )}\n {shouldRenderFullMedia && (\n \"\"\n )}\n {video && {video.isGif ? 'GIF' : formatMediaDuration(video.duration)}}\n
\n );\n};\n\nexport default memo(Media);\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport { ApiMessageOutgoingStatus } from '../../api/types';\n\nimport Transition from '../ui/Transition';\n\nimport './MessageOutgoingStatus.scss';\n\ntype OwnProps = {\n status: ApiMessageOutgoingStatus;\n};\n\nenum Keys {\n failed, pending, succeeded, read,\n}\n\nconst MessageOutgoingStatus: FC = ({ status }) => {\n return (\n
\n \n {() => (\n \n )}\n \n
\n );\n};\n\nexport default memo(MessageOutgoingStatus);\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport renderText from './helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport './NothingFound.scss';\n\ninterface OwnProps {\n text?: string;\n description?: string;\n}\n\nconst DEFAULT_TEXT = 'Nothing found.';\n\nconst NothingFound: FC = ({ text = DEFAULT_TEXT, description }) => {\n const lang = useLang();\n const { transitionClassNames } = useShowTransition(true);\n\n return (\n
\n {text}\n {description &&

{renderText(lang(description), ['br'])}

}\n
\n );\n};\n\nexport default memo(NothingFound);\n","import React, {\n FC, useCallback, useRef, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport { isChatPrivate } from '../../modules/helpers';\n\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport Checkbox from '../ui/Checkbox';\nimport InputText from '../ui/InputText';\nimport ListItem from '../ui/ListItem';\nimport PrivateChatInfo from './PrivateChatInfo';\nimport GroupChatInfo from './GroupChatInfo';\nimport PickerSelectedItem from './PickerSelectedItem';\nimport useInfiniteScroll from '../../hooks/useInfiniteScroll';\nimport useLang from '../../hooks/useLang';\n\nimport Loading from '../ui/Loading';\n\nimport './Picker.scss';\n\ntype OwnProps = {\n itemIds: number[];\n selectedIds: number[];\n filterValue?: string;\n filterPlaceholder?: string;\n notFoundText?: string;\n searchInputId?: string;\n isLoading?: boolean;\n noScrollRestore?: boolean;\n onSelectedIdsChange: (ids: number[]) => void;\n onFilterChange: (value: string) => void;\n onLoadMore?: () => void;\n};\n\n// Focus slows down animation, also it breaks transition layout in Chrome\nconst FOCUS_DELAY_MS = 500;\n\nconst MAX_FULL_ITEMS = 10;\nconst ALWAYS_FULL_ITEMS_COUNT = 5;\n\nconst Picker: FC = ({\n itemIds,\n selectedIds,\n filterValue,\n filterPlaceholder,\n notFoundText,\n searchInputId,\n isLoading,\n noScrollRestore,\n onSelectedIdsChange,\n onFilterChange,\n onLoadMore,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const shouldMinimize = selectedIds.length > MAX_FULL_ITEMS;\n\n useEffect(() => {\n setTimeout(() => {\n requestAnimationFrame(() => {\n inputRef.current!.focus();\n });\n }, FOCUS_DELAY_MS);\n }, []);\n\n const handleItemClick = useCallback((id: number) => {\n const newSelectedIds = [...selectedIds];\n if (newSelectedIds.includes(id)) {\n newSelectedIds.splice(newSelectedIds.indexOf(id), 1);\n } else {\n newSelectedIds.push(id);\n }\n onSelectedIdsChange(newSelectedIds);\n onFilterChange('');\n }, [selectedIds, onSelectedIdsChange, onFilterChange]);\n\n const handleFilterChange = useCallback((e: React.ChangeEvent) => {\n const { value } = e.currentTarget;\n onFilterChange(value);\n }, [onFilterChange]);\n\n const [viewportIds, getMore] = useInfiniteScroll(onLoadMore, itemIds, Boolean(filterValue));\n\n const lang = useLang();\n\n return (\n
\n
\n {selectedIds.map((id, i) => (\n \n ))}\n \n
\n\n {viewportIds?.length ? (\n \n {viewportIds.map((id) => (\n handleItemClick(id)}\n ripple\n >\n \n {isChatPrivate(id) ? (\n \n ) : (\n \n )}\n \n ))}\n \n ) : !isLoading && viewportIds && !viewportIds.length ? (\n

{notFoundText || 'Sorry, nothing found.'}

\n ) : (\n \n )}\n
\n );\n};\n\nexport default memo(Picker);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../../api/types';\n\nimport { selectChat, selectUser } from '../../modules/selectors';\nimport { getChatTitle, getUserFirstOrLastName, isChatPrivate } from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Avatar from './Avatar';\n\nimport './PickerSelectedItem.scss';\n\ntype OwnProps = {\n chatOrUserId?: number;\n icon?: string;\n title?: string;\n isMinimized?: boolean;\n canClose?: boolean;\n onClick: (arg: any) => void;\n clickArg: any;\n className?: string;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n user?: ApiUser;\n};\n\nconst PickerSelectedItem: FC = ({\n icon,\n title,\n isMinimized,\n canClose,\n onClick,\n clickArg,\n chat,\n user,\n className,\n}) => {\n const lang = useLang();\n\n let iconElement: any;\n let titleText: any;\n\n if (icon && title) {\n iconElement = (\n
\n \n
\n );\n\n titleText = title;\n } else if (chat || user) {\n iconElement = (\n \n );\n\n const name = !chat || (user && !user.isSelf)\n ? getUserFirstOrLastName(user)\n : getChatTitle(lang, chat, user);\n\n titleText = name ? renderText(name) : undefined;\n }\n\n const fullClassName = buildClassName(\n 'PickerSelectedItem',\n className,\n isMinimized && 'minimized',\n canClose && 'closeable',\n );\n\n return (\n onClick(clickArg)}\n title={isMinimized ? titleText : undefined}\n dir={lang.isRtl ? 'rtl' : undefined}\n >\n {iconElement}\n {!isMinimized && (\n
\n {titleText}\n
\n )}\n {canClose && (\n
\n \n
\n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatOrUserId }): StateProps => {\n if (!chatOrUserId) {\n return {};\n }\n\n const chat = chatOrUserId ? selectChat(global, chatOrUserId) : undefined;\n const user = isChatPrivate(chatOrUserId) ? selectUser(global, chatOrUserId) : undefined;\n\n return {\n chat,\n user,\n };\n },\n)(PickerSelectedItem));\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiTypingStatus } from '../../api/types';\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport { selectChatMessages, selectUser } from '../../modules/selectors';\nimport { getUserFullName, getUserStatus, isUserOnline } from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport Avatar from './Avatar';\nimport VerifiedIcon from './VerifiedIcon';\nimport TypingStatus from './TypingStatus';\n\ntype OwnProps = {\n userId: number;\n typingStatus?: ApiTypingStatus;\n avatarSize?: 'tiny' | 'small' | 'medium' | 'large' | 'jumbo';\n forceShowSelf?: boolean;\n status?: string;\n withMediaViewer?: boolean;\n withUsername?: boolean;\n withFullInfo?: boolean;\n withUpdatingStatus?: boolean;\n noStatusOrTyping?: boolean;\n noRtl?: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n isSavedMessages?: boolean;\n areMessagesLoaded: boolean;\n serverTimeOffset: number;\n} & Pick;\n\ntype DispatchProps = Pick;\n\nconst PrivateChatInfo: FC = ({\n typingStatus,\n avatarSize = 'medium',\n status,\n withMediaViewer,\n withUsername,\n withFullInfo,\n withUpdatingStatus,\n noStatusOrTyping,\n noRtl,\n user,\n isSavedMessages,\n areMessagesLoaded,\n lastSyncTime,\n loadFullUser,\n openMediaViewer,\n serverTimeOffset,\n}) => {\n const { id: userId } = user || {};\n const fullName = getUserFullName(user);\n\n useEffect(() => {\n if (withFullInfo && lastSyncTime && userId) {\n loadFullUser({ userId });\n }\n }, [userId, loadFullUser, lastSyncTime, withFullInfo]);\n\n const handleAvatarViewerOpen = useCallback((e: ReactMouseEvent, hasPhoto: boolean) => {\n if (user && hasPhoto) {\n e.stopPropagation();\n openMediaViewer({\n avatarOwnerId: user.id,\n origin: avatarSize === 'jumbo' ? MediaViewerOrigin.ProfileAvatar : MediaViewerOrigin.MiddleHeaderAvatar,\n });\n }\n }, [user, avatarSize, openMediaViewer]);\n\n const lang = useLang();\n\n if (!user) {\n return undefined;\n }\n\n function renderStatusOrTyping() {\n if (status) {\n return (\n {status}\n );\n }\n\n if (withUpdatingStatus && !areMessagesLoaded) {\n return (\n {lang('Updating')}\n );\n }\n\n if (!user) {\n return undefined;\n }\n\n if (typingStatus) {\n return ;\n }\n\n return (\n
\n {withUsername && user.username && {user.username}}\n {getUserStatus(lang, user, serverTimeOffset)}\n
\n );\n }\n\n return (\n
\n \n
\n {isSavedMessages ? (\n
\n

{lang('SavedMessages')}

\n
\n ) : (\n
\n

{fullName && renderText(fullName)}

\n {user?.isVerified && }\n
\n )}\n {(status || (!isSavedMessages && !noStatusOrTyping)) && renderStatusOrTyping()}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { userId, forceShowSelf }): StateProps => {\n const { lastSyncTime, serverTimeOffset } = global;\n const user = selectUser(global, userId);\n const isSavedMessages = !forceShowSelf && user && user.isSelf;\n const areMessagesLoaded = Boolean(selectChatMessages(global, userId));\n\n return {\n lastSyncTime, user, isSavedMessages, areMessagesLoaded, serverTimeOffset,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadFullUser', 'openMediaViewer']),\n)(PrivateChatInfo));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport {\n ApiUser, ApiChat, ApiMediaFormat, ApiPhoto,\n} from '../../api/types';\n\nimport {\n getChatAvatarHash, isDeletedUser, getUserColorKey, getChatTitle, isChatPrivate, getUserFullName,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport buildClassName from '../../util/buildClassName';\nimport { getFirstLetters } from '../../util/textFormat';\nimport useMedia from '../../hooks/useMedia';\nimport useBlurSync from '../../hooks/useBlurSync';\nimport usePrevious from '../../hooks/usePrevious';\nimport useLang from '../../hooks/useLang';\n\nimport Spinner from '../ui/Spinner';\n\nimport './ProfilePhoto.scss';\n\ntype OwnProps = {\n chat?: ApiChat;\n user?: ApiUser;\n isFirstPhoto?: boolean;\n isSavedMessages?: boolean;\n photo?: ApiPhoto;\n lastSyncTime?: number;\n onClick: NoneToVoidFunction;\n};\n\nconst ProfilePhoto: FC = ({\n chat,\n user,\n photo,\n isFirstPhoto,\n isSavedMessages,\n lastSyncTime,\n onClick,\n}) => {\n const lang = useLang();\n const isDeleted = user && isDeletedUser(user);\n\n function getMediaHash(size: 'normal' | 'big' = 'big', forceAvatar?: boolean) {\n if (photo && !forceAvatar) {\n return `photo${photo.id}?size=c`;\n }\n\n let hash: string | undefined;\n if (!isSavedMessages && !isDeleted) {\n if (user) {\n hash = getChatAvatarHash(user, size);\n } else if (chat) {\n hash = getChatAvatarHash(chat, size);\n }\n }\n\n return hash;\n }\n\n const imageHash = getMediaHash();\n const fullMediaData = useMedia(\n imageHash,\n false,\n imageHash?.startsWith('avatar') ? ApiMediaFormat.DataUri : ApiMediaFormat.BlobUrl,\n lastSyncTime,\n );\n const avatarThumbnailData = useMedia(\n !fullMediaData && isFirstPhoto ? getMediaHash('normal', true) : undefined,\n false,\n ApiMediaFormat.DataUri,\n lastSyncTime,\n );\n const thumbDataUri = useBlurSync(!fullMediaData && photo && photo.thumbnail && photo.thumbnail.dataUri);\n const imageSrc = fullMediaData || avatarThumbnailData || thumbDataUri;\n const prevImageSrc = usePrevious(imageSrc);\n\n let content: string | undefined = '';\n\n if (isSavedMessages) {\n content = ;\n } else if (isDeleted) {\n content = ;\n } else if (imageSrc) {\n content = \"\";\n } else if (!imageSrc && user) {\n const userFullName = getUserFullName(user);\n content = userFullName ? getFirstLetters(userFullName, 2) : undefined;\n } else if (!imageSrc && chat) {\n const title = getChatTitle(lang, chat);\n content = title && getFirstLetters(title, isChatPrivate(chat.id) ? 2 : 1);\n } else {\n content = (\n
\n \n
\n );\n }\n\n const fullClassName = buildClassName(\n 'ProfilePhoto',\n `color-bg-${getUserColorKey(user || chat)}`,\n isSavedMessages && 'saved-messages',\n isDeleted && 'deleted-account',\n (!isSavedMessages && !(imageSrc)) && 'no-photo',\n );\n\n return (\n
\n {prevImageSrc && imageSrc && prevImageSrc !== imageSrc && (\n \"\"\n )}\n {typeof content === 'string' ? renderText(content, ['hq_emoji']) : content}\n
\n );\n};\n\nexport default memo(ProfilePhoto);\n","import React, {\n FC, useEffect, useCallback, memo, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiChat } from '../../api/types';\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport { selectChat, selectUser } from '../../modules/selectors';\nimport {\n getUserFullName, getUserStatus, isChatChannel, isUserOnline,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { pick } from '../../util/iteratees';\nimport { captureEvents, SwipeDirection } from '../../util/captureEvents';\nimport buildClassName from '../../util/buildClassName';\nimport usePhotosPreload from './hooks/usePhotosPreload';\nimport useLang from '../../hooks/useLang';\n\nimport VerifiedIcon from './VerifiedIcon';\nimport ProfilePhoto from './ProfilePhoto';\nimport Transition from '../ui/Transition';\n\nimport './ProfileInfo.scss';\n\ntype OwnProps = {\n userId: number;\n forceShowSelf?: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat?: ApiChat;\n isSavedMessages?: boolean;\n animationLevel: 0 | 1 | 2;\n serverTimeOffset: number;\n} & Pick;\n\ntype DispatchProps = Pick;\n\nconst ProfileInfo: FC = ({\n forceShowSelf,\n user,\n chat,\n isSavedMessages,\n connectionState,\n animationLevel,\n loadFullUser,\n openMediaViewer,\n serverTimeOffset,\n}) => {\n const { id: userId } = user || {};\n const { id: chatId } = chat || {};\n const fullName = user ? getUserFullName(user) : (chat ? chat.title : '');\n const photos = user?.photos || chat?.photos || [];\n const slideAnimation = animationLevel >= 1 ? 'slide' : 'none';\n\n const [currentPhotoIndex, setCurrentPhotoIndex] = useState(0);\n const isFirst = isSavedMessages || photos.length <= 1 || currentPhotoIndex === 0;\n const isLast = isSavedMessages || photos.length <= 1 || currentPhotoIndex === photos.length - 1;\n\n // Deleting the last profile photo may result in an error\n useEffect(() => {\n if (currentPhotoIndex > photos.length) {\n setCurrentPhotoIndex(Math.max(0, photos.length - 1));\n }\n }, [currentPhotoIndex, photos.length]);\n\n const lang = useLang();\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady' && userId && !forceShowSelf) {\n loadFullUser({ userId });\n }\n }, [userId, loadFullUser, connectionState, forceShowSelf]);\n\n usePhotosPreload(user || chat, photos, currentPhotoIndex);\n\n const handleProfilePhotoClick = useCallback(() => {\n openMediaViewer({\n avatarOwnerId: userId || chatId,\n profilePhotoIndex: currentPhotoIndex,\n origin: forceShowSelf ? MediaViewerOrigin.SettingsAvatar : MediaViewerOrigin.ProfileAvatar,\n });\n }, [openMediaViewer, userId, chatId, currentPhotoIndex, forceShowSelf]);\n\n const selectPreviousMedia = useCallback(() => {\n if (isFirst) {\n return;\n }\n\n setCurrentPhotoIndex(currentPhotoIndex - 1);\n }, [currentPhotoIndex, isFirst]);\n\n const selectNextMedia = useCallback(() => {\n if (isLast) {\n return;\n }\n\n setCurrentPhotoIndex(currentPhotoIndex + 1);\n }, [currentPhotoIndex, isLast]);\n\n // Support for swipe gestures and closing on click\n useEffect(() => {\n const element = document.querySelector('.photo-wrapper');\n if (!element) {\n return undefined;\n }\n\n return captureEvents(element, {\n selectorToPreventScroll: '.Profile, .settings-content',\n onSwipe: IS_TOUCH_ENV ? (e, direction) => {\n if (direction === SwipeDirection.Right) {\n selectPreviousMedia();\n return true;\n } else if (direction === SwipeDirection.Left) {\n selectNextMedia();\n return true;\n }\n\n return false;\n } : undefined,\n });\n }, [selectNextMedia, selectPreviousMedia]);\n\n if (!user && !chat) {\n return undefined;\n }\n\n function renderPhotoTabs() {\n if (isSavedMessages || !photos || photos.length <= 1) {\n return undefined;\n }\n\n return (\n
\n {photos.map((_, i) => (\n \n ))}\n
\n );\n }\n\n function renderPhoto() {\n const photo = !isSavedMessages && photos && photos.length > 0 ? photos[currentPhotoIndex] : undefined;\n\n return (\n \n );\n }\n\n function renderStatus() {\n if (user) {\n return (\n
\n {getUserStatus(lang, user, serverTimeOffset)}\n
\n );\n }\n\n return (\n {\n isChatChannel(chat!)\n ? lang('Subscribers', chat!.membersCount ?? 0, 'i')\n : lang('Members', chat!.membersCount ?? 0, 'i')\n }\n \n );\n }\n\n const isVerifiedIconShown = (user || chat)?.isVerified;\n\n return (\n
\n
\n {renderPhotoTabs()}\n \n {renderPhoto}\n \n\n {!isFirst && (\n \n )}\n {!isLast && (\n \n )}\n
\n\n
\n {isSavedMessages ? (\n
\n

{lang('SavedMessages')}

\n
\n ) : (\n
\n

{fullName && renderText(fullName)}

\n {isVerifiedIconShown && }\n
\n )}\n {!isSavedMessages && renderStatus()}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { userId, forceShowSelf }): StateProps => {\n const { connectionState, serverTimeOffset } = global;\n const user = selectUser(global, userId);\n const chat = selectChat(global, userId);\n const isSavedMessages = !forceShowSelf && user && user.isSelf;\n const { animationLevel } = global.settings.byKey;\n\n return {\n connectionState, user, chat, isSavedMessages, animationLevel, serverTimeOffset,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadFullUser', 'openMediaViewer']),\n)(ProfileInfo));\n","import {\n ApiChat, ApiMediaFormat, ApiPhoto, ApiUser,\n} from '../../../api/types';\nimport { useEffect } from '../../../lib/teact/teact';\nimport * as mediaLoader from '../../../util/mediaLoader';\n\nconst PHOTOS_TO_PRELOAD = 4;\n\nexport default function usePhotosPreload(\n profile: ApiUser | ApiChat | undefined,\n photos: ApiPhoto[],\n currentIndex: number,\n) {\n useEffect(() => {\n photos.slice(currentIndex, currentIndex + PHOTOS_TO_PRELOAD).forEach((photo) => {\n const mediaData = mediaLoader.getFromMemory(`photo${photo.id}?size=c`);\n if (!mediaData) {\n mediaLoader.fetch(`photo${photo.id}?size=c`, ApiMediaFormat.BlobUrl);\n }\n });\n }, [currentIndex, photos]);\n}\n","import { MouseEvent as ReactMouseEvent } from 'react';\nimport React, {\n FC, memo, useEffect, useRef,\n} from '../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiSticker } from '../../api/types';\n\nimport { useIsIntersecting, ObserveFn } from '../../hooks/useIntersectionObserver';\nimport useMedia from '../../hooks/useMedia';\nimport useTransitionForMedia from '../../hooks/useTransitionForMedia';\nimport useFlag from '../../hooks/useFlag';\nimport buildClassName from '../../util/buildClassName';\nimport { preventMessageInputBlurWithBubbling } from '../middle/helpers/preventMessageInputBlur';\n\nimport AnimatedSticker from './AnimatedSticker';\nimport Button from '../ui/Button';\n\nimport './StickerButton.scss';\n\ntype OwnProps = {\n sticker: ApiSticker;\n size: number;\n observeIntersection: ObserveFn;\n noAnimate?: boolean;\n title?: string;\n className?: string;\n onClick?: (arg: any) => void;\n clickArg?: any;\n onUnfaveClick?: (sticker: ApiSticker) => void;\n};\n\nconst StickerButton: FC = ({\n sticker, size, observeIntersection, noAnimate, title, className, onClick, clickArg, onUnfaveClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const localMediaHash = `sticker${sticker.id}`;\n const stickerSelector = `sticker-button-${sticker.id}`;\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const thumbDataUri = sticker.thumbnail ? sticker.thumbnail.dataUri : undefined;\n const previewBlobUrl = useMedia(`${localMediaHash}?size=m`, !isIntersecting, ApiMediaFormat.BlobUrl);\n\n const shouldPlay = isIntersecting && !noAnimate;\n const lottieData = useMedia(sticker.isAnimated && localMediaHash, !shouldPlay, ApiMediaFormat.Lottie);\n const [isAnimationLoaded, markLoaded, unmarkLoaded] = useFlag(Boolean(lottieData));\n const canAnimatedPlay = isAnimationLoaded && shouldPlay;\n\n const {\n shouldRenderThumb,\n shouldRenderFullMedia: shouldRenderPreview,\n transitionClassNames: previewTransitionClassNames,\n } = useTransitionForMedia(previewBlobUrl || canAnimatedPlay, 'slow');\n\n // To avoid flickering\n useEffect(() => {\n if (!shouldPlay) {\n unmarkLoaded();\n }\n }, [unmarkLoaded, shouldPlay]);\n\n function handleClick() {\n if (onClick) {\n onClick(clickArg);\n }\n }\n\n function handleUnfaveClick(e: ReactMouseEvent) {\n e.stopPropagation();\n e.preventDefault();\n\n onUnfaveClick!(sticker);\n }\n\n const fullClassName = buildClassName(\n 'StickerButton',\n sticker.isAnimated && 'animated',\n stickerSelector,\n className,\n );\n\n const style = shouldRenderThumb && thumbDataUri ? `background-image: url('${thumbDataUri}');` : '';\n\n return (\n \n {shouldRenderPreview && !canAnimatedPlay && (\n // eslint-disable-next-line jsx-a11y/alt-text\n \n )}\n {shouldPlay && lottieData && (\n \n )}\n {onUnfaveClick && (\n \n \n \n )}\n
\n );\n};\n\nexport default memo(StickerButton);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { OwnProps } from './StickerSetModal';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst StickerSetModalAsync: FC = (props) => {\n const { isOpen } = props;\n const StickerSetModal = useModuleLoader(Bundles.Extra, 'StickerSetModal', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return StickerSetModal ? : undefined;\n};\n\nexport default memo(StickerSetModalAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiUser, ApiTypingStatus } from '../../api/types';\n\nimport { selectUser } from '../../modules/selectors';\nimport { getUserFirstOrLastName } from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport './TypingStatus.scss';\n\ntype OwnProps = {\n typingStatus: ApiTypingStatus;\n};\n\ntype StateProps = {\n typingUser?: ApiUser;\n};\n\nconst TypingStatus: FC = ({ typingStatus, typingUser }) => {\n const lang = useLang();\n const typingUserName = typingUser && !typingUser.isSelf && getUserFirstOrLastName(typingUser);\n\n return (\n

\n {typingUserName && (\n {renderText(typingUserName)}\n )}\n {/* fix for translation \"username _is_ typing\" */}\n {lang(typingStatus.action).replace('{user}', '').trim()}\n \n

\n );\n};\n\nexport default memo(withGlobal(\n (global, { typingStatus }): StateProps => {\n if (!typingStatus.userId) {\n return {};\n }\n\n const typingUser = selectUser(global, typingStatus.userId);\n\n return { typingUser };\n },\n)(TypingStatus));\n","import React, { FC } from '../../lib/teact/teact';\n\nimport './VerifiedIcon.scss';\n\nconst VerifiedIcon: FC = () => {\n return (\n \n );\n};\n\nexport default VerifiedIcon;\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport { ApiMessage, ApiWebPage } from '../../api/types';\n\nimport { getFirstLinkInMessage, getMessageSummaryText, getMessageWebPage } from '../../modules/helpers';\nimport buildClassName from '../../util/buildClassName';\nimport trimText from '../../util/trimText';\nimport renderText from './helpers/renderText';\nimport { formatPastTimeShort } from '../../util/dateFormat';\nimport useLang from '../../hooks/useLang';\n\nimport Media from './Media';\nimport Link from '../ui/Link';\nimport SafeLink from './SafeLink';\n\nimport './WebLink.scss';\n\nconst MAX_TEXT_LENGTH = 170; // symbols\n\ntype OwnProps = {\n message: ApiMessage;\n senderTitle?: string;\n onMessageClick: (messageId: number, chatId: number) => void;\n};\n\nconst WebLink: FC = ({ message, senderTitle, onMessageClick }) => {\n const lang = useLang();\n\n let linkData: ApiWebPage | undefined = getMessageWebPage(message);\n\n if (!linkData) {\n const link = getFirstLinkInMessage(message);\n if (link) {\n const { url, domain } = link;\n const messageText = getMessageSummaryText(lang, message);\n\n linkData = {\n siteName: domain.replace(/^www./, ''),\n url: url.includes('://') ? url : url.includes('@') ? `mailto:${url}` : `http://${url}`,\n description: messageText !== url ? messageText : undefined,\n } as ApiWebPage;\n }\n }\n\n const handleMessageClick = useCallback(() => {\n onMessageClick(message.id, message.chatId);\n }, [onMessageClick, message.id, message.chatId]);\n\n if (!linkData) {\n return undefined;\n }\n\n const {\n siteName,\n url,\n displayUrl,\n title,\n description,\n photo,\n video,\n } = linkData;\n\n const truncatedDescription = !senderTitle && trimText(description, MAX_TEXT_LENGTH);\n\n const className = buildClassName(\n 'WebLink scroll-item',\n (!photo && !video) && 'without-media',\n );\n\n return (\n \n {photo && (\n \n )}\n
\n \n {renderText(title || siteName || displayUrl)}\n \n {truncatedDescription && (\n \n {renderText(truncatedDescription)}\n \n )}\n \n {url.replace('mailto:', '') || displayUrl}\n \n {senderTitle &&
{renderText(senderTitle)}
}\n
\n {senderTitle && (\n
\n \n {formatPastTimeShort(lang, message.date * 1000)}\n \n
\n )}\n
\n );\n};\n\nexport default memo(WebLink);\n","import {\n ApiPhoto, ApiVideo, ApiSticker, ApiDimensions,\n} from '../../../api/types';\n\nimport { STICKER_SIZE_INLINE_DESKTOP_FACTOR, STICKER_SIZE_INLINE_MOBILE_FACTOR } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport windowSize from '../../../util/windowSize';\nimport { getPhotoInlineDimensions, getVideoDimensions } from '../../../modules/helpers';\n\nexport const MEDIA_VIEWER_MEDIA_QUERY = '(max-height: 640px)';\nexport const REM = parseInt(getComputedStyle(document.documentElement).fontSize, 10);\nexport const ROUND_VIDEO_DIMENSIONS = 200;\nexport const AVATAR_FULL_DIMENSIONS = { width: 640, height: 640 };\nexport const LIKE_STICKER_ID = '1258816259753933';\n\nconst DEFAULT_MEDIA_DIMENSIONS: ApiDimensions = { width: 100, height: 100 };\nconst MOBILE_SCREEN_NO_AVATARS_MESSAGE_EXTRA_WIDTH_REM = 4.5;\nconst MOBILE_SCREEN_MESSAGE_EXTRA_WIDTH_REM = 7;\nconst MESSAGE_MAX_WIDTH_REM = 29;\nconst MESSAGE_OWN_MAX_WIDTH_REM = 30;\n\nlet cachedMaxWidthOwn: number | undefined;\nlet cachedMaxWidth: number | undefined;\nlet cachedMaxWidthNoAvatar: number | undefined;\n\nfunction getMaxMessageWidthRem(fromOwnMessage: boolean, noAvatars?: boolean) {\n const regularMaxWidth = fromOwnMessage ? MESSAGE_OWN_MAX_WIDTH_REM : MESSAGE_MAX_WIDTH_REM;\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n return regularMaxWidth;\n }\n\n const { width: windowWidth } = windowSize.get();\n\n // @optimization Limitation: changing device screen width not supported\n if (!cachedMaxWidthOwn) {\n cachedMaxWidthOwn = Math.min(\n MESSAGE_OWN_MAX_WIDTH_REM,\n windowWidth / REM - MOBILE_SCREEN_NO_AVATARS_MESSAGE_EXTRA_WIDTH_REM,\n );\n }\n if (!cachedMaxWidth) {\n cachedMaxWidth = Math.min(\n MESSAGE_MAX_WIDTH_REM,\n windowWidth / REM - MOBILE_SCREEN_MESSAGE_EXTRA_WIDTH_REM,\n );\n }\n if (!cachedMaxWidthNoAvatar) {\n cachedMaxWidthNoAvatar = Math.min(\n MESSAGE_MAX_WIDTH_REM,\n windowWidth / REM - MOBILE_SCREEN_NO_AVATARS_MESSAGE_EXTRA_WIDTH_REM,\n );\n }\n\n return fromOwnMessage\n ? cachedMaxWidthOwn\n : (noAvatars ? cachedMaxWidthNoAvatar : cachedMaxWidth);\n}\n\nexport function getAvailableWidth(\n fromOwnMessage: boolean,\n isForwarded?: boolean,\n isWebPagePhoto?: boolean,\n noAvatars?: boolean,\n) {\n const extraPaddingRem = isForwarded || isWebPagePhoto ? 1.625 : 0;\n const availableWidthRem = getMaxMessageWidthRem(fromOwnMessage, noAvatars) - extraPaddingRem;\n\n return availableWidthRem * REM;\n}\n\nfunction getAvailableHeight(isGif?: boolean, aspectRatio?: number) {\n if (\n isGif && aspectRatio\n && aspectRatio >= 0.75 && aspectRatio <= 1.25\n ) {\n return 20 * REM;\n }\n\n return 27 * REM;\n}\n\nfunction calculateDimensionsForMessageMedia({\n width,\n height,\n fromOwnMessage,\n isForwarded,\n isWebPagePhoto,\n isGif,\n noAvatars,\n}: {\n width: number;\n height: number;\n fromOwnMessage: boolean;\n isForwarded?: boolean;\n isWebPagePhoto?: boolean;\n isGif?: boolean;\n noAvatars?: boolean;\n}): ApiDimensions {\n const aspectRatio = height / width;\n const availableWidth = getAvailableWidth(fromOwnMessage, isForwarded, isWebPagePhoto, noAvatars);\n const availableHeight = getAvailableHeight(isGif, aspectRatio);\n\n return calculateDimensions(availableWidth, availableHeight, width, height);\n}\n\nexport function getMediaViewerAvailableDimensions(withFooter: boolean, isVideo: boolean): ApiDimensions {\n const mql = window.matchMedia(MEDIA_VIEWER_MEDIA_QUERY);\n const { width: windowWidth, height: windowHeight } = windowSize.get();\n let occupiedHeightRem = isVideo && mql.matches ? 10 : 8.25;\n if (withFooter) {\n occupiedHeightRem = mql.matches ? 10 : 15;\n }\n\n return {\n width: windowWidth,\n height: windowHeight - occupiedHeightRem * REM,\n };\n}\n\nexport function calculateInlineImageDimensions(\n photo: ApiPhoto,\n fromOwnMessage: boolean,\n isForwarded?: boolean,\n isWebPagePhoto?: boolean,\n noAvatars?: boolean,\n) {\n const { width, height } = getPhotoInlineDimensions(photo) || DEFAULT_MEDIA_DIMENSIONS;\n\n return calculateDimensionsForMessageMedia({\n width,\n height,\n fromOwnMessage,\n isForwarded,\n isWebPagePhoto,\n noAvatars,\n });\n}\n\nexport function calculateVideoDimensions(\n video: ApiVideo,\n fromOwnMessage: boolean,\n isForwarded?: boolean,\n noAvatars?: boolean,\n) {\n const { width, height } = getVideoDimensions(video) || DEFAULT_MEDIA_DIMENSIONS;\n\n return calculateDimensionsForMessageMedia({\n width,\n height,\n fromOwnMessage,\n isForwarded,\n isGif: video.isGif,\n noAvatars,\n });\n}\n\nexport function getPictogramDimensions(): ApiDimensions {\n return {\n width: 2 * REM,\n height: 2 * REM,\n };\n}\n\nexport function getDocumentThumbnailDimensions(smaller?: boolean): ApiDimensions {\n if (smaller) {\n return {\n width: 3 * REM,\n height: 3 * REM,\n };\n }\n\n return {\n width: 3.375 * REM,\n height: 3.375 * REM,\n };\n}\n\nexport function getStickerDimensions(sticker: ApiSticker): ApiDimensions {\n const { width } = sticker;\n let { height } = sticker;\n\n // For some reason this sticker has some weird `height` value\n if (sticker.id === LIKE_STICKER_ID) {\n height = width;\n }\n\n const aspectRatio = (height && width) && height / width;\n const baseWidth = REM * (\n IS_SINGLE_COLUMN_LAYOUT\n ? STICKER_SIZE_INLINE_MOBILE_FACTOR\n : STICKER_SIZE_INLINE_DESKTOP_FACTOR\n );\n const calculatedHeight = aspectRatio ? baseWidth * aspectRatio : baseWidth;\n\n if (aspectRatio && calculatedHeight > baseWidth) {\n return {\n width: Math.round(baseWidth / aspectRatio),\n height: baseWidth,\n };\n }\n\n return {\n width: baseWidth,\n height: calculatedHeight,\n };\n}\n\nexport function calculateMediaViewerDimensions(\n { width, height }: ApiDimensions, withFooter: boolean, isVideo: boolean = false,\n): ApiDimensions {\n const { width: availableWidth, height: availableHeight } = getMediaViewerAvailableDimensions(withFooter, isVideo);\n\n return calculateDimensions(availableWidth, availableHeight, width, height);\n}\n\nexport function calculateDimensions(\n availableWidth: number,\n availableHeight: number,\n mediaWidth: number,\n mediaHeight: number,\n): ApiDimensions {\n const aspectRatio = mediaHeight / mediaWidth;\n const calculatedWidth = Math.min(mediaWidth, availableWidth);\n const calculatedHeight = Math.round(calculatedWidth * aspectRatio);\n\n if (calculatedHeight > availableHeight) {\n return {\n width: Math.round(availableHeight / aspectRatio),\n height: availableHeight,\n };\n }\n\n return {\n width: calculatedWidth,\n height: Math.round(calculatedWidth * aspectRatio),\n };\n}\n","import { MouseEvent } from 'react';\nimport React from '../../../lib/teact/teact';\nimport { getDispatch } from '../../../lib/teact/teactn';\n\nimport { ApiMessageEntity, ApiMessageEntityTypes, ApiMessage } from '../../../api/types';\n\nimport { getMessageText } from '../../../modules/helpers';\nimport renderText from './renderText';\n\nimport MentionLink from '../../middle/message/MentionLink';\nimport SafeLink from '../SafeLink';\n\nexport type TextPart = string | Element;\n\nexport function renderMessageText(message: ApiMessage, highlight?: string, shouldRenderHqEmoji?: boolean) {\n const formattedText = message.content.text;\n\n if (!formattedText || !formattedText.text) {\n const rawText = getMessageText(message);\n return rawText ? [rawText] : undefined;\n }\n const { text, entities } = formattedText;\n\n return renderTextWithEntities(text, entities, highlight, shouldRenderHqEmoji);\n}\n\ninterface IOrganizedEntity {\n entity: ApiMessageEntity;\n organizedIndexes: Set;\n nestedEntities: IOrganizedEntity[];\n}\n\nfunction organizeEntity(\n entity: ApiMessageEntity,\n index: number,\n entities: ApiMessageEntity[],\n organizedEntityIndexes: Set,\n): IOrganizedEntity | undefined {\n const { offset, length } = entity;\n const organizedIndexes = new Set([index]);\n\n if (organizedEntityIndexes.has(index)) {\n return undefined;\n }\n\n // Determine any nested entities inside current entity\n const nestedEntities: IOrganizedEntity[] = [];\n const parsedNestedEntities = entities\n .filter((e, i) => i > index && e.offset >= offset && e.offset < offset + length)\n .map((e) => organizeEntity(e, entities.indexOf(e), entities, organizedEntityIndexes))\n .filter(Boolean as any);\n\n parsedNestedEntities.forEach((parsedEntity) => {\n let isChanged = false;\n\n parsedEntity.organizedIndexes.forEach((organizedIndex) => {\n if (!isChanged && !organizedIndexes.has(organizedIndex)) {\n isChanged = true;\n }\n\n organizedIndexes.add(organizedIndex);\n });\n\n if (isChanged) {\n nestedEntities.push(parsedEntity);\n }\n });\n\n return {\n entity,\n organizedIndexes,\n nestedEntities,\n };\n}\n\n// Organize entities in a tree-like structure to better represent how the text will be displayed\nfunction organizeEntities(entities: ApiMessageEntity[]) {\n const organizedEntityIndexes: Set = new Set();\n const organizedEntities: IOrganizedEntity[] = [];\n\n entities.forEach((entity, index) => {\n if (organizedEntityIndexes.has(index)) {\n return;\n }\n\n const organizedEntity = organizeEntity(entity, index, entities, organizedEntityIndexes);\n if (organizedEntity) {\n organizedEntity.organizedIndexes.forEach((organizedIndex) => {\n organizedEntityIndexes.add(organizedIndex);\n });\n\n organizedEntities.push(organizedEntity);\n }\n });\n\n return organizedEntities;\n}\n\nexport function renderTextWithEntities(\n text: string,\n entities?: ApiMessageEntity[],\n highlight?: string,\n shouldRenderHqEmoji?: boolean,\n shouldRenderAsHtml?: boolean,\n) {\n if (!entities || !entities.length) {\n return renderMessagePart(text, highlight, shouldRenderHqEmoji, shouldRenderAsHtml);\n }\n\n const result: TextPart[] = [];\n let deleteLineBreakAfterPre = false;\n\n const organizedEntities = organizeEntities(entities);\n\n // Recursive function to render regular and nested entities\n function renderEntity(\n textPartStart: number,\n textPartEnd: number,\n organizedEntity: IOrganizedEntity,\n isLastEntity: boolean,\n ) {\n const renderResult: TextPart[] = [];\n const { entity, nestedEntities } = organizedEntity;\n const { offset, length, type } = entity;\n\n // Render text before the entity\n let textBefore = text.substring(textPartStart, offset);\n const textBeforeLength = textBefore.length;\n if (textBefore) {\n if (deleteLineBreakAfterPre && textBefore.length > 0 && textBefore[0] === '\\n') {\n textBefore = textBefore.substr(1);\n deleteLineBreakAfterPre = false;\n }\n if (textBefore) {\n renderResult.push(...renderMessagePart(\n textBefore, highlight, shouldRenderHqEmoji, shouldRenderAsHtml,\n ) as TextPart[]);\n }\n }\n\n const entityStartIndex = textPartStart + textBeforeLength;\n const entityEndIndex = entityStartIndex + length;\n\n let entityContent: TextPart = text.substring(offset, offset + length);\n const nestedEntityContent: TextPart[] = [];\n\n if (deleteLineBreakAfterPre && entityContent.length > 0 && entityContent[0] === '\\n') {\n entityContent = entityContent.substr(1);\n deleteLineBreakAfterPre = false;\n }\n\n if (type === ApiMessageEntityTypes.Pre) {\n deleteLineBreakAfterPre = true;\n }\n\n // Render nested entities, if any\n if (nestedEntities.length) {\n let nestedIndex = entityStartIndex;\n\n nestedEntities.forEach((nestedEntity, nestedEntityIndex) => {\n const {\n renderResult: nestedResult,\n entityEndIndex: nestedEntityEndIndex,\n } = renderEntity(\n nestedIndex,\n entityEndIndex,\n nestedEntity,\n nestedEntityIndex === nestedEntities.length - 1,\n );\n\n nestedEntityContent.push(...nestedResult);\n nestedIndex = nestedEntityEndIndex;\n });\n }\n\n // Render the entity itself\n const newEntity = shouldRenderAsHtml\n ? processEntityAsHtml(entity, entityContent, nestedEntityContent)\n : processEntity(entity, entityContent, nestedEntityContent);\n\n if (Array.isArray(newEntity)) {\n renderResult.push(...newEntity);\n } else {\n renderResult.push(newEntity);\n }\n\n // Render text after the entity, if it is the last entity in the text,\n // or the last nested entity inside of another entity\n if (isLastEntity && entityEndIndex < textPartEnd) {\n let textAfter = text.substring(entityEndIndex, textPartEnd);\n if (deleteLineBreakAfterPre && textAfter.length > 0 && textAfter[0] === '\\n') {\n textAfter = textAfter.substring(1);\n }\n if (textAfter) {\n renderResult.push(...renderMessagePart(\n textAfter, highlight, shouldRenderHqEmoji, shouldRenderAsHtml,\n ) as TextPart[]);\n }\n }\n\n return {\n renderResult,\n entityEndIndex,\n };\n }\n\n // Process highest-level entities\n let index = 0;\n\n organizedEntities.forEach((entity, arrayIndex) => {\n const { renderResult, entityEndIndex } = renderEntity(\n index,\n text.length,\n entity,\n arrayIndex === organizedEntities.length - 1,\n );\n\n result.push(...renderResult);\n index = entityEndIndex;\n });\n\n return result;\n}\n\nfunction processEntity(\n entity: ApiMessageEntity,\n entityContent: TextPart,\n nestedEntityContent: TextPart[],\n) {\n const entityText = typeof entityContent === 'string' && entityContent;\n const renderedContent = nestedEntityContent.length ? nestedEntityContent : entityContent;\n\n if (!entityText) {\n return renderMessagePart(renderedContent);\n }\n\n switch (entity.type) {\n case ApiMessageEntityTypes.Bold:\n return {renderMessagePart(renderedContent)};\n case ApiMessageEntityTypes.Blockquote:\n return
{renderMessagePart(renderedContent)}
;\n case ApiMessageEntityTypes.BotCommand:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Hashtag:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Cashtag:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Code:\n return {renderMessagePart(renderedContent)};\n case ApiMessageEntityTypes.Email:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Italic:\n return {renderMessagePart(renderedContent)};\n case ApiMessageEntityTypes.MentionName:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Mention:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Phone:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Pre:\n return
{renderMessagePart(renderedContent)}
;\n case ApiMessageEntityTypes.Strike:\n return {renderMessagePart(renderedContent)};\n case ApiMessageEntityTypes.TextUrl:\n case ApiMessageEntityTypes.Url:\n return (\n \n {renderMessagePart(renderedContent)}\n \n );\n case ApiMessageEntityTypes.Underline:\n return {renderMessagePart(renderedContent)};\n default:\n return renderMessagePart(renderedContent);\n }\n}\n\nfunction renderMessagePart(\n content: TextPart | TextPart[],\n highlight?: string,\n shouldRenderHqEmoji?: boolean,\n shouldRenderAsHtml?: boolean,\n) {\n if (Array.isArray(content)) {\n const result: TextPart[] = [];\n\n content.forEach((c) => {\n result.push(...renderMessagePart(c, highlight, shouldRenderHqEmoji, shouldRenderAsHtml));\n });\n\n return result;\n }\n\n if (shouldRenderAsHtml) {\n return renderText(content, ['escape_html', 'emoji_html', 'br_html']);\n }\n\n const emojiFilter = shouldRenderHqEmoji ? 'hq_emoji' : 'emoji';\n\n if (highlight) {\n return renderText(content, [emojiFilter, 'br', 'highlight'], { highlight });\n } else {\n return renderText(content, [emojiFilter, 'br']);\n }\n}\n\nfunction getLinkUrl(entityContent: string, entity: ApiMessageEntity) {\n const { type, url } = entity;\n return type === ApiMessageEntityTypes.TextUrl && url ? url : entityContent;\n}\n\nfunction handleBotCommandClick(e: MouseEvent) {\n getDispatch().sendBotCommand({ command: e.currentTarget.innerText });\n}\n\nfunction handleHashtagClick(e: MouseEvent) {\n getDispatch().setLocalTextSearchQuery({ query: e.currentTarget.innerText });\n getDispatch().searchTextMessagesLocal();\n}\n\nfunction processEntityAsHtml(\n entity: ApiMessageEntity,\n entityContent: TextPart,\n nestedEntityContent: TextPart[],\n) {\n const rawEntityText = typeof entityContent === 'string' && entityContent;\n\n const renderedContent = nestedEntityContent.length\n ? nestedEntityContent.join('')\n : renderText(entityContent, ['escape_html', 'emoji_html', 'br_html']).join('');\n\n if (!rawEntityText) {\n return renderedContent;\n }\n\n switch (entity.type) {\n case ApiMessageEntityTypes.Bold:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Italic:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Underline:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Code:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Pre:\n return `\\`\\`\\`
${renderedContent}
\\`\\`\\``;\n case ApiMessageEntityTypes.Strike:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.MentionName:\n return `${renderedContent}`;\n case ApiMessageEntityTypes.Url:\n case ApiMessageEntityTypes.TextUrl:\n return `${renderedContent}`;\n default:\n return renderedContent;\n }\n}\n","import { useCallback } from '../../../../lib/teact/teact';\n\nexport enum ChatAnimationTypes {\n Move,\n Opacity,\n None,\n}\n\nexport function useChatAnimationType(orderDiffById: Record) {\n const movesUp = useCallback((id: number) => orderDiffById[id] < 0, [orderDiffById]);\n const movesDown = useCallback((id: number) => orderDiffById[id] > 0, [orderDiffById]);\n\n const orderDiffIds = Object.keys(orderDiffById).map(Number);\n const numberOfUp = orderDiffIds.filter(movesUp).length;\n const numberOfDown = orderDiffIds.filter(movesDown).length;\n\n return useCallback((chatId: number): ChatAnimationTypes => {\n const orderDiff = orderDiffById[chatId];\n\n if (orderDiff === 0) {\n return ChatAnimationTypes.None;\n }\n\n if (\n orderDiff === Infinity\n || orderDiff === -Infinity\n || (movesUp(chatId) && numberOfUp <= numberOfDown)\n || (movesDown(chatId) && numberOfDown < numberOfUp)\n ) {\n return ChatAnimationTypes.Opacity;\n }\n\n return ChatAnimationTypes.Move;\n }, [movesDown, movesUp, numberOfDown, numberOfUp, orderDiffById]);\n}\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { ApiChat } from '../../../api/types';\n\nimport { formatIntegerCompact } from '../../../util/textFormat';\nimport buildClassName from '../../../util/buildClassName';\n\nimport ShowTransition from '../../ui/ShowTransition';\n\nimport './Badge.scss';\n\ntype OwnProps = {\n chat: ApiChat;\n isPinned?: boolean;\n isMuted?: boolean;\n};\n\nconst Badge: FC = ({ chat, isPinned, isMuted }) => {\n const isShown = Boolean(chat.unreadCount || chat.hasUnreadMark || isPinned);\n const className = buildClassName(\n 'Badge',\n isMuted && 'muted',\n isPinned && 'pinned',\n Boolean(chat.unreadCount || chat.hasUnreadMark) && 'unread',\n );\n\n function renderContent() {\n if (chat.unreadCount) {\n if (chat.unreadMentionsCount) {\n return (\n
\n
\n \n
\n
\n {formatIntegerCompact(chat.unreadCount)}\n
\n
\n );\n }\n\n return (\n
\n {formatIntegerCompact(chat.unreadCount)}\n
\n );\n } else if (chat.hasUnreadMark) {\n return (\n
\n );\n } else if (isPinned) {\n return (\n
\n \n
\n );\n }\n\n return undefined;\n }\n\n return (\n \n {renderContent}\n \n );\n};\n\nexport default memo(Badge);\n","import React, {\n FC, memo, useCallback, useLayoutEffect, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport useLang, { LangFn } from '../../../hooks/useLang';\n\nimport { GlobalActions } from '../../../global/types';\nimport {\n ApiChat, ApiUser, ApiMessage, ApiMessageOutgoingStatus, ApiFormattedText, MAIN_THREAD_ID,\n} from '../../../api/types';\n\nimport { ANIMATION_END_DELAY } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport {\n getChatTitle,\n isChatPrivate,\n isActionMessage,\n getPrivateChatUserId,\n getMessageAction,\n getMessageSenderName,\n isChatChannel,\n getMessageMediaHash,\n getMessageSummaryText,\n getMessageMediaThumbDataUri,\n getMessageVideo,\n getMessageSticker,\n selectIsChatMuted,\n getMessageRoundVideo,\n} from '../../../modules/helpers';\nimport {\n selectChat, selectUser, selectChatMessage, selectOutgoingStatus, selectDraft, selectCurrentMessageList,\n selectNotifySettings, selectNotifyExceptions,\n} from '../../../modules/selectors';\nimport { renderActionMessageText } from '../../common/helpers/renderActionMessageText';\nimport renderText from '../../common/helpers/renderText';\nimport { fastRaf } from '../../../util/schedulers';\nimport buildClassName from '../../../util/buildClassName';\nimport { pick } from '../../../util/iteratees';\nimport useEnsureMessage from '../../../hooks/useEnsureMessage';\nimport useChatContextActions from '../../../hooks/useChatContextActions';\nimport useFlag from '../../../hooks/useFlag';\nimport useMedia from '../../../hooks/useMedia';\nimport { ChatAnimationTypes } from './hooks';\n\nimport Avatar from '../../common/Avatar';\nimport VerifiedIcon from '../../common/VerifiedIcon';\nimport TypingStatus from '../../common/TypingStatus';\nimport LastMessageMeta from '../../common/LastMessageMeta';\nimport DeleteChatModal from '../../common/DeleteChatModal';\nimport ListItem from '../../ui/ListItem';\nimport Badge from './Badge';\n\nimport './Chat.scss';\n\ntype OwnProps = {\n style?: string;\n chatId: number;\n folderId?: number;\n orderDiff: number;\n animationType: ChatAnimationTypes;\n isPinned?: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n isMuted?: boolean;\n privateChatUser?: ApiUser;\n actionTargetUserIds?: number[];\n usersById?: Record;\n actionTargetMessage?: ApiMessage;\n actionTargetChatId?: number;\n lastMessageSender?: ApiUser;\n lastMessageOutgoingStatus?: ApiMessageOutgoingStatus;\n draft?: ApiFormattedText;\n animationLevel?: number;\n isSelected?: boolean;\n canScrollDown?: boolean;\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst ANIMATION_DURATION = 200;\n\nconst Chat: FC = ({\n style,\n chatId,\n folderId,\n orderDiff,\n animationType,\n isPinned,\n chat,\n isMuted,\n privateChatUser,\n actionTargetUserIds,\n usersById,\n lastMessageSender,\n lastMessageOutgoingStatus,\n actionTargetMessage,\n actionTargetChatId,\n draft,\n animationLevel,\n isSelected,\n canScrollDown,\n lastSyncTime,\n openChat,\n focusLastMessage,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n const [shouldRenderDeleteModal, markRenderDeleteModal, unmarkRenderDeleteModal] = useFlag();\n\n const { lastMessage, typingStatus } = chat || {};\n const isAction = lastMessage && isActionMessage(lastMessage);\n\n useEnsureMessage(chatId, isAction ? lastMessage!.replyToMessageId : undefined, actionTargetMessage);\n\n const mediaThumbnail = lastMessage && !getMessageSticker(lastMessage)\n ? getMessageMediaThumbDataUri(lastMessage)\n : undefined;\n const mediaBlobUrl = useMedia(lastMessage ? getMessageMediaHash(lastMessage, 'micro') : undefined);\n const isRoundVideo = Boolean(lastMessage && getMessageRoundVideo(lastMessage));\n\n const actionTargetUsers = useMemo(() => {\n return actionTargetUserIds\n ? actionTargetUserIds.map((userId) => usersById?.[userId]).filter(Boolean as any)\n : undefined;\n }, [actionTargetUserIds, usersById]);\n\n // Sets animation excess values when `orderDiff` changes and then resets excess values to animate.\n useLayoutEffect(() => {\n const element = ref.current;\n\n if (animationLevel === 0 || !element) {\n return;\n }\n\n // TODO Refactor animation: create `useListAnimation` that owns `orderDiff` and `animationType`\n if (animationType === ChatAnimationTypes.Opacity) {\n element.style.opacity = '0';\n\n fastRaf(() => {\n element.classList.add('animate-opacity');\n element.style.opacity = '1';\n });\n } else if (animationType === ChatAnimationTypes.Move) {\n element.style.transform = `translate3d(0, ${-orderDiff * 100}%, 0)`;\n\n fastRaf(() => {\n element.classList.add('animate-transform');\n element.style.transform = '';\n });\n } else {\n return;\n }\n\n setTimeout(() => {\n fastRaf(() => {\n element.classList.remove('animate-opacity', 'animate-transform');\n element.style.opacity = '';\n element.style.transform = '';\n });\n }, ANIMATION_DURATION + ANIMATION_END_DELAY);\n }, [animationLevel, orderDiff, animationType]);\n\n const handleClick = useCallback(() => {\n openChat({ id: chatId, shouldReplaceHistory: true });\n\n if (isSelected && canScrollDown) {\n focusLastMessage();\n }\n }, [\n isSelected,\n canScrollDown,\n openChat,\n chatId,\n focusLastMessage,\n ]);\n\n function handleDelete() {\n markRenderDeleteModal();\n openDeleteModal();\n }\n\n const contextActions = useChatContextActions({\n chat,\n privateChatUser,\n handleDelete,\n folderId,\n isPinned,\n isMuted,\n });\n\n const lang = useLang();\n\n if (!chat) {\n return undefined;\n }\n\n function renderLastMessageOrTyping() {\n if (typingStatus && lastMessage && typingStatus.timestamp > lastMessage.date * 1000) {\n return ;\n }\n\n if (draft?.text.length) {\n return (\n

\n {lang('Draft')}\n {renderText(draft.text)}\n

\n );\n }\n\n if (!lastMessage) {\n return undefined;\n }\n\n if (isAction) {\n const actionOrigin = chat && (isChatChannel(chat) || lastMessage.senderId === lastMessage.chatId)\n ? chat\n : lastMessageSender;\n\n return (\n

\n {renderText(renderActionMessageText(\n lang,\n lastMessage,\n actionOrigin,\n actionTargetUsers,\n actionTargetMessage,\n actionTargetChatId,\n { asPlain: true },\n ) as string)}\n

\n );\n }\n\n const senderName = getMessageSenderName(lang, chatId, lastMessageSender);\n\n return (\n

\n {senderName && (\n <>\n {renderText(senderName)}\n :\n \n )}\n {renderMessageSummary(lang, lastMessage!, mediaBlobUrl || mediaThumbnail, isRoundVideo)}\n

\n );\n }\n\n const className = buildClassName(\n 'Chat chat-item-clickable',\n isChatPrivate(chatId) ? 'private' : 'group',\n isSelected && 'selected',\n );\n\n return (\n \n
\n \n
\n
\n
\n

{renderText(getChatTitle(lang, chat, privateChatUser))}

\n {chat.isVerified && }\n {isMuted && }\n {chat.lastMessage && (\n \n )}\n
\n
\n {renderLastMessageOrTyping()}\n \n
\n
\n {shouldRenderDeleteModal && (\n \n )}\n \n );\n};\n\nfunction renderMessageSummary(lang: LangFn, message: ApiMessage, blobUrl?: string, isRoundVideo?: boolean) {\n if (!blobUrl) {\n return renderText(getMessageSummaryText(lang, message));\n }\n\n return (\n \n \"\"\n {getMessageVideo(message) && }\n {renderText(getMessageSummaryText(lang, message, true))}\n \n );\n}\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n if (!chat || !chat.lastMessage) {\n return {};\n }\n\n const { senderId, replyToMessageId, isOutgoing } = chat.lastMessage;\n const lastMessageSender = senderId ? selectUser(global, senderId) : undefined;\n const lastMessageAction = getMessageAction(chat.lastMessage);\n const actionTargetMessage = lastMessageAction && replyToMessageId\n ? selectChatMessage(global, chat.id, replyToMessageId)\n : undefined;\n const { targetUserIds: actionTargetUserIds, targetChatId: actionTargetChatId } = lastMessageAction || {};\n const privateChatUserId = getPrivateChatUserId(chat);\n const { byId: usersById } = global.users;\n const {\n chatId: currentChatId,\n threadId: currentThreadId,\n type: messageListType,\n } = selectCurrentMessageList(global) || {};\n const isSelected = chatId === currentChatId && currentThreadId === MAIN_THREAD_ID;\n\n return {\n chat,\n isMuted: selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global)),\n lastMessageSender,\n actionTargetUserIds,\n actionTargetChatId,\n actionTargetMessage,\n draft: selectDraft(global, chatId, MAIN_THREAD_ID),\n animationLevel: global.settings.byKey.animationLevel,\n isSelected,\n canScrollDown: isSelected && messageListType === 'thread',\n lastSyncTime: global.lastSyncTime,\n ...(isOutgoing && { lastMessageOutgoingStatus: selectOutgoingStatus(global, chat.lastMessage) }),\n ...(privateChatUserId && { privateChatUser: selectUser(global, privateChatUserId) }),\n ...(actionTargetUserIds && { usersById }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat',\n 'focusLastMessage',\n ]),\n)(Chat));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChatFolder, ApiSticker } from '../../../api/types';\nimport { SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { selectAnimatedEmoji, selectChatFolder } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\nimport AnimatedEmoji from '../../common/AnimatedEmoji';\n\nimport './EmptyFolder.scss';\n\ntype OwnProps = {\n folderId?: number;\n folderType: 'all' | 'archived' | 'folder';\n foldersDispatch?: FolderEditDispatch;\n onScreenSelect?: (screen: SettingsScreens) => void;\n};\n\ntype StateProps = {\n chatFolder?: ApiChatFolder;\n animatedEmoji?: ApiSticker;\n};\n\nconst EmptyFolder: FC = ({\n chatFolder, animatedEmoji, foldersDispatch, onScreenSelect,\n}) => {\n const lang = useLang();\n\n const handleEditFolder = useCallback(() => {\n foldersDispatch!({ type: 'editFolder', payload: chatFolder });\n onScreenSelect!(SettingsScreens.FoldersEditFolderFromChatList);\n }, [chatFolder, foldersDispatch, onScreenSelect]);\n\n return (\n
\n
{animatedEmoji && }
\n

{lang('FilterNoChatsToDisplay')}

\n

\n {lang(chatFolder ? 'ChatList.EmptyChatListFilterText' : 'Chat.EmptyChat')}\n

\n {chatFolder && foldersDispatch && onScreenSelect && (\n \n \n {lang('ChatList.EmptyChatListEditFilter')}\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal((global, { folderId, folderType }): StateProps => {\n const chatFolder = folderId && folderType === 'folder' ? selectChatFolder(global, folderId) : undefined;\n\n return {\n chatFolder,\n animatedEmoji: selectAnimatedEmoji(global, '📂'),\n };\n})(EmptyFolder));\n","import React, {\n FC, memo, useMemo, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport {\n ApiChat, ApiChatFolder, ApiUser,\n} from '../../../api/types';\nimport { NotifyException, NotifySettings, SettingsScreens } from '../../../types';\nimport { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { ALL_CHATS_PRELOAD_DISABLED, CHAT_HEIGHT_PX, CHAT_LIST_SLICE } from '../../../config';\nimport { IS_ANDROID, IS_MAC_OS, IS_PWA } from '../../../util/environment';\nimport usePrevious from '../../../hooks/usePrevious';\nimport { mapValues, pick } from '../../../util/iteratees';\nimport { getChatOrder, prepareChatList, prepareFolderListIds } from '../../../modules/helpers';\nimport {\n selectChatFolder, selectNotifyExceptions, selectNotifySettings,\n} from '../../../modules/selectors';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\nimport { useChatAnimationType } from './hooks';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport Loading from '../../ui/Loading';\nimport Chat from './Chat';\nimport EmptyFolder from './EmptyFolder';\n\ntype OwnProps = {\n folderType: 'all' | 'archived' | 'folder';\n folderId?: number;\n isActive: boolean;\n onScreenSelect?: (screen: SettingsScreens) => void;\n foldersDispatch?: FolderEditDispatch;\n};\n\ntype StateProps = {\n chatsById: Record;\n usersById: Record;\n chatFolder?: ApiChatFolder;\n listIds?: number[];\n orderedPinnedIds?: number[];\n lastSyncTime?: number;\n notifySettings: NotifySettings;\n notifyExceptions?: Record;\n};\n\ntype DispatchProps = Pick;\n\nenum FolderTypeToListType {\n 'all' = 'active',\n 'archived' = 'archived',\n}\n\nconst ChatList: FC = ({\n folderType,\n folderId,\n isActive,\n chatFolder,\n chatsById,\n usersById,\n listIds,\n orderedPinnedIds,\n lastSyncTime,\n foldersDispatch,\n notifySettings,\n notifyExceptions,\n onScreenSelect,\n loadMoreChats,\n preloadTopChatMessages,\n openChat,\n openNextChat,\n}) => {\n const [currentListIds, currentPinnedIds] = useMemo(() => {\n return folderType === 'folder' && chatFolder\n ? prepareFolderListIds(chatsById, usersById, chatFolder, notifySettings, notifyExceptions)\n : [listIds, orderedPinnedIds];\n }, [folderType, chatFolder, chatsById, usersById, notifySettings, notifyExceptions, listIds, orderedPinnedIds]);\n\n const [orderById, orderedIds] = useMemo(() => {\n if (!currentListIds || (folderType === 'folder' && !chatFolder)) {\n return [];\n }\n const newChatArrays = prepareChatList(chatsById, currentListIds, currentPinnedIds, folderType);\n const singleList = [...newChatArrays.pinnedChats, ...newChatArrays.otherChats];\n const newOrderedIds = singleList.map(({ id }) => id);\n const newOrderById = singleList.reduce((acc, chat, i) => {\n acc[chat.id] = i;\n return acc;\n }, {} as Record);\n\n return [newOrderById, newOrderedIds];\n }, [currentListIds, currentPinnedIds, folderType, chatFolder, chatsById]);\n\n const prevOrderById = usePrevious(orderById);\n\n const orderDiffById = useMemo(() => {\n if (!orderById || !prevOrderById) {\n return {};\n }\n\n return mapValues(orderById, (order, id) => {\n return order - (prevOrderById[id] !== undefined ? prevOrderById[id] : Infinity);\n });\n }, [orderById, prevOrderById]);\n\n const loadMoreOfType = useCallback(() => {\n loadMoreChats({ listType: folderType === 'archived' ? 'archived' : 'active' });\n }, [loadMoreChats, folderType]);\n\n const [viewportIds, getMore] = useInfiniteScroll(\n lastSyncTime ? loadMoreOfType : undefined,\n orderedIds,\n undefined,\n CHAT_LIST_SLICE,\n folderType === 'all' && !ALL_CHATS_PRELOAD_DISABLED,\n );\n\n // TODO Refactor to not call `prepareChatList` twice\n const chatArrays = viewportIds && prepareChatList(chatsById, viewportIds, currentPinnedIds, folderType);\n\n useEffect(() => {\n if (lastSyncTime && folderType === 'all') {\n preloadTopChatMessages();\n }\n }, [lastSyncTime, folderType, preloadTopChatMessages]);\n\n const getAnimationType = useChatAnimationType(orderDiffById);\n\n function renderChats() {\n const viewportOffset = orderedIds!.indexOf(viewportIds![0]);\n const pinnedOffset = viewportOffset + chatArrays!.pinnedChats.length;\n\n return (\n \n {chatArrays!.pinnedChats.map(({ id }, i) => (\n \n ))}\n {chatArrays!.otherChats.map((chat, i) => (\n \n ))}\n
\n );\n }\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (isActive && orderedIds) {\n if (IS_PWA && ((IS_MAC_OS && e.metaKey) || (!IS_MAC_OS && e.ctrlKey)) && e.code.startsWith('Digit')) {\n const [, digit] = e.code.match(/Digit(\\d)/) || [];\n if (!digit) return;\n\n const position = Number(digit) - 1;\n if (position > orderedIds.length - 1) return;\n\n openChat({ id: orderedIds[position], shouldReplaceHistory: true });\n }\n\n if (e.altKey) {\n const targetIndexDelta = e.key === 'ArrowDown' ? 1 : e.key === 'ArrowUp' ? -1 : undefined;\n if (!targetIndexDelta) return;\n\n e.preventDefault();\n openNextChat({ targetIndexDelta, orderedIds });\n }\n }\n };\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n });\n\n return (\n \n {viewportIds?.length && chatArrays ? (\n renderChats()\n ) : viewportIds && !viewportIds.length ? (\n (\n \n )\n ) : (\n \n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { folderType, folderId }): StateProps => {\n const {\n chats: {\n listIds,\n byId: chatsById,\n orderedPinnedIds,\n },\n users: { byId: usersById },\n lastSyncTime,\n } = global;\n const listType = folderType !== 'folder' ? FolderTypeToListType[folderType] : undefined;\n const chatFolder = folderId ? selectChatFolder(global, folderId) : undefined;\n\n return {\n chatsById,\n usersById,\n lastSyncTime,\n notifySettings: selectNotifySettings(global),\n notifyExceptions: selectNotifyExceptions(global),\n ...(listType ? {\n listIds: listIds[listType],\n orderedPinnedIds: orderedPinnedIds[listType],\n } : {\n chatFolder,\n }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadMoreChats',\n 'preloadTopChatMessages',\n 'openChat',\n 'openNextChat',\n ]),\n)(ChatList));\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport useFlag from '../../../hooks/useFlag';\nimport buildClassName from '../../../util/buildClassName';\n\nimport './DropTarget.scss';\n\nexport type OwnProps = {\n isQuick?: boolean;\n onFileSelect: (e: React.DragEvent) => void;\n};\n\nconst DropTarget: FC = ({ isQuick, onFileSelect }) => {\n const [isHovered, markHovered, unmarkHovered] = useFlag();\n\n const handleDragEnter = () => { markHovered(); };\n const handleDragLeave = (e: React.DragEvent) => {\n const { relatedTarget: toTarget } = e;\n\n if (toTarget) {\n e.stopPropagation();\n }\n\n unmarkHovered();\n };\n\n const className = buildClassName(\n 'DropTarget',\n isHovered && 'hovered',\n );\n\n return (\n \n
\n
\n
Drop files here to send them
\n
{isQuick ? 'in a quick way' : 'without compression'}
\n
\n
\n );\n};\n\nexport default memo(DropTarget);\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\n\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport usePrevious from '../../../hooks/usePrevious';\n\nimport DropTarget from './DropTarget';\n\nimport './DropArea.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n withQuick?: boolean;\n onHide: NoneToVoidFunction;\n onFileSelect: (files: File[], isQuick: boolean) => void;\n};\n\nexport enum DropAreaState {\n None = 'none',\n Document = 'document',\n QuickFile = 'quick_file',\n}\n\nconst DROP_LEAVE_TIMEOUT_MS = 150;\n\nconst DropArea: FC = ({\n isOpen, withQuick, onHide, onFileSelect,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const hideTimeoutRef = useRef(null);\n const prevWithQuick = usePrevious(withQuick);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen);\n\n useEffect(() => (isOpen ? captureEscKeyListener(onHide) : undefined), [isOpen, onHide]);\n\n const handleFilesDrop = useCallback((e: React.DragEvent) => {\n const { dataTransfer: dt } = e;\n\n if (dt.files && dt.files.length > 0) {\n onHide();\n onFileSelect(Array.from(dt.files), false);\n }\n }, [onFileSelect, onHide]);\n\n const handleQuickFilesDrop = useCallback((e: React.DragEvent) => {\n const { dataTransfer: dt } = e;\n\n if (dt.files && dt.files.length > 0) {\n onHide();\n onFileSelect(Array.from(dt.files), true);\n }\n }, [onFileSelect, onHide]);\n\n const handleDragLeave = useCallback((e: React.DragEvent) => {\n e.stopPropagation();\n\n const { target: fromTarget, relatedTarget: toTarget } = e;\n\n // Esc button pressed during drag event\n if ((fromTarget as HTMLDivElement).matches('.DropTarget, .DropArea') && !toTarget) {\n hideTimeoutRef.current = window.setTimeout(() => {\n onHide();\n }, DROP_LEAVE_TIMEOUT_MS);\n }\n }, [onHide]);\n\n const handleDragOver = () => {\n if (hideTimeoutRef.current) {\n window.clearTimeout(hideTimeoutRef.current);\n }\n };\n\n if (!shouldRender) {\n return undefined;\n }\n\n const className = buildClassName(\n 'DropArea',\n transitionClassNames,\n );\n\n return (\n
\n \n {(withQuick || prevWithQuick) && }\n
\n );\n};\n\nexport default memo(DropArea);\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { OwnProps } from './EmojiTooltip';\nimport { Bundles } from '../../../util/moduleLoader';\n\nimport useModuleLoader from '../../../hooks/useModuleLoader';\n\nconst EmojiTooltipAsync: FC = (props) => {\n const { isOpen } = props;\n const EmojiTooltip = useModuleLoader(Bundles.Extra, 'EmojiTooltip', !isOpen);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return EmojiTooltip ? : undefined;\n};\n\nexport default memo(EmojiTooltipAsync);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useEffect, useRef, memo, useState, useCallback,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { IAnchorPosition, ISettings } from '../../../types';\n\nimport { EDITABLE_INPUT_ID } from '../../../config';\nimport { selectCurrentMessageList, selectReplyingToId } from '../../../modules/selectors';\nimport { debounce } from '../../../util/schedulers';\nimport focusEditableElement from '../../../util/focusEditableElement';\nimport buildClassName from '../../../util/buildClassName';\nimport { pick } from '../../../util/iteratees';\nimport {\n IS_ANDROID, IS_IOS, IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV,\n} from '../../../util/environment';\nimport captureKeyboardListeners from '../../../util/captureKeyboardListeners';\nimport useLayoutEffectWithPrevDeps from '../../../hooks/useLayoutEffectWithPrevDeps';\nimport useFlag from '../../../hooks/useFlag';\nimport parseEmojiOnlyString from '../../common/helpers/parseEmojiOnlyString';\nimport { isSelectionInsideInput } from './helpers/selection';\nimport useLang from '../../../hooks/useLang';\nimport renderText from '../../common/helpers/renderText';\n\nimport TextFormatter from './TextFormatter';\n\nconst CONTEXT_MENU_CLOSE_DELAY_MS = 100;\n// Focus slows down animation, also it breaks transition layout in Chrome\nconst FOCUS_DELAY_MS = 350;\nconst TRANSITION_DURATION_FACTOR = 50;\n\ntype OwnProps = {\n id: string;\n isAttachmentModalInput?: boolean;\n editableInputId?: string;\n html: string;\n placeholder: string;\n forcedPlaceholder?: string;\n shouldSetFocus: boolean;\n shouldSuppressFocus?: boolean;\n shouldSuppressTextFormatter?: boolean;\n onUpdate: (html: string) => void;\n onSuppressedFocus?: () => void;\n onSend: () => void;\n};\n\ntype StateProps = {\n currentChatId?: number;\n replyingToId?: number;\n noTabCapture?: boolean;\n messageSendKeyCombo?: ISettings['messageSendKeyCombo'];\n};\n\ntype DispatchProps = Pick;\n\nconst MAX_INPUT_HEIGHT = IS_SINGLE_COLUMN_LAYOUT ? 256 : 416;\nconst TAB_INDEX_PRIORITY_TIMEOUT = 2000;\nconst TEXT_FORMATTER_SAFE_AREA_PX = 90;\n// For some reason Safari inserts `
` after user removes text from input\nconst SAFARI_BR = '
';\n\nfunction clearSelection() {\n const selection = window.getSelection();\n if (!selection) {\n return;\n }\n\n if (selection.removeAllRanges) {\n selection.removeAllRanges();\n } else if (selection.empty) {\n selection.empty();\n }\n}\n\nconst MessageInput: FC = ({\n id,\n isAttachmentModalInput,\n editableInputId,\n html,\n placeholder,\n forcedPlaceholder,\n shouldSetFocus,\n shouldSuppressFocus,\n shouldSuppressTextFormatter,\n onUpdate,\n onSuppressedFocus,\n onSend,\n currentChatId,\n replyingToId,\n noTabCapture,\n messageSendKeyCombo,\n editLastMessage,\n replyToNextMessage,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const cloneRef = useRef(null);\n\n const lang = useLang();\n const isContextMenuOpenRef = useRef(false);\n const [isTextFormatterOpen, openTextFormatter, closeTextFormatter] = useFlag();\n const [textFormatterAnchorPosition, setTextFormatterAnchorPosition] = useState();\n const [selectedRange, setSelectedRange] = useState();\n\n useEffect(() => {\n if (!isAttachmentModalInput) return;\n updateInputHeight(false);\n }, [isAttachmentModalInput]);\n\n useLayoutEffectWithPrevDeps(([prevHtml]) => {\n if (html !== inputRef.current!.innerHTML) {\n inputRef.current!.innerHTML = html;\n }\n\n if (html !== cloneRef.current!.innerHTML) {\n cloneRef.current!.innerHTML = html;\n }\n\n if (prevHtml !== undefined && prevHtml !== html) {\n updateInputHeight(!html.length);\n }\n }, [html]);\n\n const focusInput = useCallback(() => {\n // Avoid focusing during animation\n if (inputRef.current!.closest('.from, .to')) {\n setTimeout(focusInput, FOCUS_DELAY_MS);\n return;\n }\n\n focusEditableElement(inputRef.current!);\n }, []);\n\n const handleCloseTextFormatter = useCallback(() => {\n closeTextFormatter();\n clearSelection();\n }, [closeTextFormatter]);\n\n function checkSelection() {\n // Disable the formatter on iOS devices for now.\n if (IS_IOS) {\n return false;\n }\n\n const selection = window.getSelection();\n if (!selection || !selection.rangeCount || isContextMenuOpenRef.current) {\n closeTextFormatter();\n return false;\n }\n\n const selectionRange = selection.getRangeAt(0);\n const selectedText = selectionRange.toString().trim();\n if (\n shouldSuppressTextFormatter\n || !isSelectionInsideInput(selectionRange, editableInputId || EDITABLE_INPUT_ID)\n || !selectedText\n || parseEmojiOnlyString(selectedText)\n || !selectionRange.START_TO_END\n ) {\n closeTextFormatter();\n return false;\n }\n\n return true;\n }\n\n function processSelection() {\n if (!checkSelection()) {\n return;\n }\n\n const selectionRange = window.getSelection()!.getRangeAt(0);\n const selectionRect = selectionRange.getBoundingClientRect();\n const inputRect = inputRef.current!.getBoundingClientRect();\n\n let x = (selectionRect.left + selectionRect.width / 2) - inputRect.left;\n\n if (x < TEXT_FORMATTER_SAFE_AREA_PX) {\n x = TEXT_FORMATTER_SAFE_AREA_PX;\n } else if (x > inputRect.width - TEXT_FORMATTER_SAFE_AREA_PX) {\n x = inputRect.width - TEXT_FORMATTER_SAFE_AREA_PX;\n }\n\n setTextFormatterAnchorPosition({\n x,\n y: selectionRect.top - inputRect.top,\n });\n\n setSelectedRange(selectionRange);\n openTextFormatter();\n }\n\n function handleMouseDown(event: React.MouseEvent) {\n function handleMouseUp() {\n processSelection();\n\n event.target.removeEventListener('mouseup', handleMouseUp);\n }\n\n if (event.button !== 2) {\n event.target.addEventListener('mouseup', handleMouseUp);\n return;\n }\n\n if (isContextMenuOpenRef.current === true) {\n return;\n }\n\n isContextMenuOpenRef.current = true;\n\n function closeContextMenuMouseListener() {\n setTimeout(() => {\n isContextMenuOpenRef.current = false;\n }, CONTEXT_MENU_CLOSE_DELAY_MS);\n\n window.removeEventListener('mouseup', closeContextMenuMouseListener);\n }\n\n function closeContextMenuKeyListener(e: KeyboardEvent) {\n if (e.key !== 'Esc' && e.key !== 'Escape') {\n return;\n }\n\n setTimeout(() => {\n isContextMenuOpenRef.current = false;\n }, CONTEXT_MENU_CLOSE_DELAY_MS);\n\n window.removeEventListener('keydown', closeContextMenuKeyListener);\n }\n\n document.addEventListener('mousedown', closeContextMenuMouseListener);\n document.addEventListener('keydown', closeContextMenuKeyListener);\n }\n\n function handleKeyDown(e: React.KeyboardEvent) {\n function handleKeyUp() {\n processSelection();\n\n e.target.removeEventListener('keyup', handleKeyUp);\n }\n\n if (e.metaKey && !html.length) {\n const targetIndexDelta = e.key === 'ArrowDown' ? 1 : e.key === 'ArrowUp' ? -1 : undefined;\n if (targetIndexDelta) {\n e.preventDefault();\n\n replyToNextMessage({ targetIndexDelta });\n return;\n }\n }\n\n if (e.key === 'Enter' && !e.shiftKey) {\n if (\n !(IS_IOS || IS_ANDROID)\n && (\n (messageSendKeyCombo === 'enter' && !e.shiftKey)\n || (messageSendKeyCombo === 'ctrl-enter' && (e.ctrlKey || e.metaKey))\n )\n ) {\n e.preventDefault();\n\n closeTextFormatter();\n onSend();\n }\n } else if (e.key === 'ArrowUp' && !html.length && !e.metaKey && !e.altKey) {\n e.preventDefault();\n editLastMessage();\n } else {\n e.target.addEventListener('keyup', handleKeyUp);\n }\n }\n\n function handleChange(e: ChangeEvent) {\n const { innerHTML, textContent } = e.currentTarget;\n\n onUpdate(innerHTML === SAFARI_BR ? '' : innerHTML);\n\n // Reset focus on the input to remove any active styling when input is cleared\n if (!IS_TOUCH_ENV && (!textContent || !textContent.length)) {\n const selection = window.getSelection()!;\n if (selection) {\n inputRef.current!.blur();\n selection.removeAllRanges();\n focusEditableElement(inputRef.current!, true);\n }\n }\n }\n\n function stopEvent(e: React.MouseEvent) {\n if (!checkSelection()) {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n }\n\n function updateInputHeight(willSend = false) {\n const input = inputRef.current!;\n const clone = cloneRef.current!;\n const currentHeight = Number(input.style.height.replace('px', ''));\n const newHeight = Math.min(clone.scrollHeight, MAX_INPUT_HEIGHT);\n if (newHeight === currentHeight) {\n return;\n }\n\n const transitionDuration = Math.round(\n TRANSITION_DURATION_FACTOR * Math.log(Math.abs(newHeight - currentHeight)),\n );\n\n const exec = () => {\n input.style.height = `${newHeight}px`;\n input.style.transitionDuration = `${transitionDuration}ms`;\n input.classList.toggle('overflown', clone.scrollHeight > MAX_INPUT_HEIGHT);\n };\n\n if (willSend) {\n // Sync with sending animation\n requestAnimationFrame(exec);\n } else {\n exec();\n }\n }\n\n useEffect(() => {\n if (IS_TOUCH_ENV) {\n return;\n }\n\n if (shouldSetFocus) {\n focusInput();\n }\n }, [currentChatId, focusInput, replyingToId, shouldSetFocus]);\n\n useEffect(() => {\n if (noTabCapture) {\n return undefined;\n }\n\n const captureFirstTab = debounce((e: KeyboardEvent) => {\n if (e.key === 'Tab') {\n e.preventDefault();\n requestAnimationFrame(focusInput);\n }\n }, TAB_INDEX_PRIORITY_TIMEOUT, true, false);\n\n return captureKeyboardListeners({ onTab: captureFirstTab });\n }, [focusInput, noTabCapture]);\n\n useEffect(() => {\n const input = inputRef.current!;\n\n function suppressFocus() {\n input.blur();\n }\n\n if (shouldSuppressFocus) {\n input.addEventListener('focus', suppressFocus);\n }\n\n return () => {\n input.removeEventListener('focus', suppressFocus);\n };\n }, [shouldSuppressFocus]);\n\n const className = buildClassName(\n 'form-control custom-scroll',\n html.length > 0 && 'touched',\n shouldSuppressFocus && 'focus-disabled',\n );\n\n return (\n
\n \n
\n {!forcedPlaceholder && {placeholder}}\n \n {forcedPlaceholder && {renderText(forcedPlaceholder!)}}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { chatId: currentChatId, threadId } = selectCurrentMessageList(global) || {};\n const { messageSendKeyCombo } = global.settings.byKey;\n\n return {\n currentChatId,\n messageSendKeyCombo,\n replyingToId: currentChatId && threadId ? selectReplyingToId(global, currentChatId, threadId) : undefined,\n noTabCapture: global.isPollModalOpen || global.payment.isPaymentModalOpen,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['editLastMessage', 'replyToNextMessage']),\n)(MessageInput));\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { IAnchorPosition } from '../../../types';\n\nimport { EDITABLE_INPUT_ID } from '../../../config';\nimport buildClassName from '../../../util/buildClassName';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useVirtualBackdrop from '../../../hooks/useVirtualBackdrop';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\n\nimport './TextFormatter.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n anchorPosition?: IAnchorPosition;\n selectedRange?: Range;\n onClose: () => void;\n};\n\ninterface ISelectedTextFormats {\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n strikethrough?: boolean;\n monospace?: boolean;\n}\n\nconst TEXT_FORMAT_BY_TAG_NAME: Record = {\n B: 'bold',\n STRONG: 'bold',\n I: 'italic',\n EM: 'italic',\n U: 'underline',\n DEL: 'strikethrough',\n CODE: 'monospace',\n};\nconst fragmentEl = document.createElement('div');\n\nconst TextFormatter: FC = ({\n isOpen,\n anchorPosition,\n selectedRange,\n onClose,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const linkUrlInputRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen);\n const [isLinkControlOpen, openLinkControl, closeLinkControl] = useFlag();\n const [linkUrl, setLinkUrl] = useState('');\n const [isEditingLink, setIsEditingLink] = useState(false);\n const [inputClassName, setInputClassName] = useState();\n const [selectedTextFormats, setSelectedTextFormats] = useState({});\n\n useEffect(() => (isOpen ? captureEscKeyListener(onClose) : undefined), [isOpen, onClose]);\n useVirtualBackdrop(\n isOpen,\n containerRef,\n onClose,\n );\n\n useEffect(() => {\n if (isLinkControlOpen) {\n linkUrlInputRef.current!.focus();\n } else {\n setLinkUrl('');\n setIsEditingLink(false);\n }\n }, [isLinkControlOpen]);\n\n useEffect(() => {\n if (!shouldRender) {\n closeLinkControl();\n setSelectedTextFormats({});\n setInputClassName(undefined);\n }\n }, [closeLinkControl, shouldRender]);\n\n useEffect(() => {\n if (!isOpen || !selectedRange) {\n return;\n }\n\n const selectedFormats: ISelectedTextFormats = {};\n let { parentElement } = selectedRange.commonAncestorContainer;\n while (parentElement && parentElement.id !== EDITABLE_INPUT_ID) {\n const textFormat = TEXT_FORMAT_BY_TAG_NAME[parentElement.tagName];\n if (textFormat) {\n selectedFormats[textFormat] = true;\n }\n\n parentElement = parentElement.parentElement;\n }\n\n setSelectedTextFormats(selectedFormats);\n }, [isOpen, selectedRange, openLinkControl]);\n\n function restoreSelection() {\n if (!selectedRange) {\n return;\n }\n\n const selection = window.getSelection();\n if (selection) {\n selection.removeAllRanges();\n selection.addRange(selectedRange);\n }\n }\n\n const getSelectedText = useCallback(() => {\n if (!selectedRange) {\n return undefined;\n }\n fragmentEl.innerText = selectedRange.toString();\n\n return fragmentEl.innerHTML;\n }, [selectedRange]);\n\n const getSelectedElement = useCallback(() => {\n if (!selectedRange) {\n return undefined;\n }\n\n return selectedRange.commonAncestorContainer.parentElement;\n }, [selectedRange]);\n\n function updateInputStyles() {\n const input = linkUrlInputRef.current;\n if (!input) {\n return;\n }\n\n const { offsetWidth, scrollWidth, scrollLeft } = input;\n if (scrollWidth <= offsetWidth) {\n setInputClassName(undefined);\n return;\n }\n\n let className = '';\n if (scrollLeft < scrollWidth - offsetWidth) {\n className = 'mask-right';\n }\n if (scrollLeft > 0) {\n className += ' mask-left';\n }\n\n setInputClassName(className);\n }\n\n function handleLinkUrlChange(e: React.ChangeEvent) {\n setLinkUrl(e.target.value);\n updateInputStyles();\n }\n\n function getFormatButtonClassName(key: keyof ISelectedTextFormats) {\n if (selectedTextFormats[key]) {\n return 'active';\n }\n\n if (key === 'monospace' || key === 'strikethrough') {\n if (Object.keys(selectedTextFormats).some(\n (fKey) => fKey !== key && !!selectedTextFormats[fKey as keyof ISelectedTextFormats],\n )) {\n return 'disabled';\n }\n } else if (selectedTextFormats.monospace || selectedTextFormats.strikethrough) {\n return 'disabled';\n }\n\n return undefined;\n }\n\n const handleBoldText = useCallback(() => {\n setSelectedTextFormats((selectedFormats) => {\n // Somehow re-applying 'bold' command to already bold text doesn't work\n document.execCommand(selectedFormats.bold ? 'removeFormat' : 'bold');\n Object.keys(selectedFormats).forEach((key) => {\n if ((key === 'italic' || key === 'underline') && !!selectedFormats[key]) {\n document.execCommand(key);\n }\n });\n\n return {\n ...selectedFormats,\n bold: !selectedFormats.bold,\n };\n });\n }, []);\n\n const handleItalicText = useCallback(() => {\n document.execCommand('italic');\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n italic: !selectedFormats.italic,\n }));\n }, []);\n\n const handleUnderlineText = useCallback(() => {\n document.execCommand('underline');\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n underline: !selectedFormats.underline,\n }));\n }, []);\n\n const handleStrikethroughText = useCallback(() => {\n if (selectedTextFormats.strikethrough) {\n const element = getSelectedElement();\n if (\n !selectedRange\n || !element\n || element.tagName !== 'DEL'\n || !element.textContent\n ) {\n return;\n }\n\n element.replaceWith(element.textContent);\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n strikethrough: false,\n }));\n\n return;\n }\n\n const text = getSelectedText();\n document.execCommand('insertHTML', false, `${text}`);\n onClose();\n }, [\n getSelectedElement, getSelectedText, onClose,\n selectedRange, selectedTextFormats.strikethrough,\n ]);\n\n const handleMonospaceText = useCallback(() => {\n if (selectedTextFormats.monospace) {\n const element = getSelectedElement();\n if (\n !selectedRange\n || !element\n || element.tagName !== 'CODE'\n || !element.textContent\n ) {\n return;\n }\n\n element.replaceWith(element.textContent);\n setSelectedTextFormats((selectedFormats) => ({\n ...selectedFormats,\n monospace: false,\n }));\n return;\n }\n\n const text = getSelectedText();\n document.execCommand('insertHTML', false, `${text}`);\n onClose();\n }, [\n getSelectedElement, getSelectedText, onClose,\n selectedRange, selectedTextFormats.monospace,\n ]);\n\n function handleLinkUrlConfirm() {\n const formattedLinkUrl = encodeURI(linkUrl.includes('://') ? linkUrl : `http://${linkUrl}`);\n\n if (isEditingLink) {\n const element = getSelectedElement();\n if (!element || element.tagName !== 'A') {\n return;\n }\n\n (element as HTMLAnchorElement).href = formattedLinkUrl;\n\n onClose();\n return;\n }\n\n const text = getSelectedText();\n restoreSelection();\n document.execCommand(\n 'insertHTML',\n false,\n `${text}`,\n );\n onClose();\n }\n\n const handleKeyDown = useCallback((e: KeyboardEvent) => {\n const HANDLERS_BY_KEY_CODE: Record = {\n KeyK: openLinkControl,\n KeyB: handleBoldText,\n KeyU: handleUnderlineText,\n KeyI: handleItalicText,\n KeyM: handleMonospaceText,\n KeyS: handleStrikethroughText,\n };\n\n const handler = HANDLERS_BY_KEY_CODE[e.code];\n\n if (\n e.altKey\n || !(e.ctrlKey || e.metaKey)\n || !handler\n ) {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n handler();\n }, [\n handleBoldText, handleItalicText, handleUnderlineText,\n handleMonospaceText, handleStrikethroughText,\n openLinkControl,\n ]);\n\n useEffect(() => {\n if (isOpen) {\n document.addEventListener('keydown', handleKeyDown);\n }\n\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [isOpen, handleKeyDown]);\n\n const lang = useLang();\n\n function handleContainerKeyDown(e: React.KeyboardEvent) {\n if (e.key === 'Enter' && isLinkControlOpen) {\n handleLinkUrlConfirm();\n e.preventDefault();\n }\n }\n\n if (!shouldRender) {\n return undefined;\n }\n\n const className = buildClassName(\n 'TextFormatter',\n transitionClassNames,\n isLinkControlOpen && 'link-control-shown',\n );\n\n const linkUrlConfirmClassName = buildClassName(\n 'TextFormatter-link-url-confirm',\n !!linkUrl.length && 'shown',\n );\n\n const style = anchorPosition\n ? `left: ${anchorPosition.x}px; top: ${anchorPosition.y}px;--text-formatter-left: ${anchorPosition.x}px;`\n : '';\n\n return (\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n\n
\n
\n \n
\n\n \n \n
\n\n
\n
\n \n \n \n
\n
\n
\n
\n );\n};\n\nexport default memo(TextFormatter);\n","import { ApiMessageEntity, ApiMessageEntityTypes, ApiFormattedText } from '../../../../api/types';\nimport { IS_EMOJI_SUPPORTED } from '../../../../util/environment';\n\nconst ENTITY_CLASS_BY_NODE_NAME: Record = {\n B: ApiMessageEntityTypes.Bold,\n STRONG: ApiMessageEntityTypes.Bold,\n I: ApiMessageEntityTypes.Italic,\n EM: ApiMessageEntityTypes.Italic,\n U: ApiMessageEntityTypes.Underline,\n S: ApiMessageEntityTypes.Strike,\n STRIKE: ApiMessageEntityTypes.Strike,\n DEL: ApiMessageEntityTypes.Strike,\n CODE: ApiMessageEntityTypes.Code,\n PRE: ApiMessageEntityTypes.Pre,\n BLOCKQUOTE: ApiMessageEntityTypes.Blockquote,\n};\n\nconst MAX_TAG_DEEPNESS = 3;\n\nexport default function parseMessageInput(html: string): ApiFormattedText {\n const fragment = document.createElement('div');\n fragment.innerHTML = parseMarkdown(html);\n const text = fragment.innerText.trim().replace(/\\u200b+/g, '');\n let textIndex = 0;\n let recursionDeepness = 0;\n const entities: ApiMessageEntity[] = [];\n\n function addEntity(node: ChildNode) {\n const { index, entity } = getEntityDataFromNode(node, text, textIndex);\n\n if (entity) {\n textIndex = index;\n entities.push(entity);\n } else if (node.textContent) {\n textIndex += node.textContent.length;\n }\n\n if (node.hasChildNodes() && recursionDeepness <= MAX_TAG_DEEPNESS) {\n recursionDeepness += 1;\n Array.from(node.childNodes).forEach(addEntity);\n }\n }\n\n Array.from(fragment.childNodes).forEach((node) => {\n recursionDeepness = 1;\n addEntity(node);\n });\n\n return {\n text,\n entities: entities.length ? entities : undefined,\n };\n}\n\nfunction parseMarkdown(html: string) {\n let parsedHtml = html.slice(0);\n\n if (!IS_EMOJI_SUPPORTED) {\n // Emojis\n parsedHtml = parsedHtml.replace(/]+alt=\"([^\"]+)\"[^>]*>/gm, '$1');\n }\n\n // Strip redundant tags\n parsedHtml = parsedHtml.replace(/<\\/?span([^>]*)?>/g, '');\n\n // Strip redundant nbsp's\n parsedHtml = parsedHtml.replace(/ /g, ' ');\n\n // Replace

with newline (new line in Safari)\n parsedHtml = parsedHtml.replace(/
]*)?><\\/div>/g, '\\n');\n // Replace
with newline\n parsedHtml = parsedHtml.replace(/]*)?>/g, '\\n');\n\n // Strip redundant
tags\n parsedHtml = parsedHtml.replace(/<\\/div>(\\s*)
/g, '\\n');\n parsedHtml = parsedHtml.replace(/
/g, '\\n');\n parsedHtml = parsedHtml.replace(/<\\/div>/g, '');\n\n // Pre\n parsedHtml = parsedHtml.replace(/^`{3}(.*[\\n\\r][^]*?^)`{3}/gm, '
$1
');\n parsedHtml = parsedHtml.replace(/[`]{3}([^`]+)[`]{3}/g, '
$1
');\n\n // Code\n parsedHtml = parsedHtml.replace(/[`]{1}([^`\\n]+)[`]{1}/g, '$1');\n\n // Other simple markdown\n parsedHtml = parsedHtml.replace(/[*]{2}([^*\\n]+)[*]{2}/g, '$1');\n parsedHtml = parsedHtml.replace(/[_]{2}([^*\\n]+)[_]{2}/g, '$1');\n parsedHtml = parsedHtml.replace(/[~]{2}([^~\\n]+)[~]{2}/g, '$1');\n\n return parsedHtml;\n}\n\nfunction getEntityDataFromNode(\n node: ChildNode,\n rawText: string,\n textIndex: number,\n): { index: number; entity?: ApiMessageEntity } {\n const type = getEntityTypeFromNode(node);\n if (!type || !node.textContent) {\n return {\n index: textIndex,\n entity: undefined,\n };\n }\n\n const rawIndex = rawText.indexOf(node.textContent, textIndex);\n // In some cases, last text entity ends with a newline (which gets trimmed from `rawText`).\n // In this case, `rawIndex` would return `-1`, so we use `textIndex` instead.\n const index = rawIndex >= 0 ? rawIndex : textIndex;\n const offset = rawText.substring(0, index).length;\n const { length } = rawText.substring(index, index + node.textContent.length);\n\n let url: string | undefined;\n let userId: number | undefined;\n if (type === ApiMessageEntityTypes.TextUrl) {\n url = (node as HTMLAnchorElement).href;\n }\n if (type === ApiMessageEntityTypes.MentionName) {\n userId = Number((node as HTMLAnchorElement).dataset.userId);\n }\n\n return {\n index,\n entity: {\n type,\n offset,\n length,\n ...(url && { url }),\n ...(userId && { userId }),\n },\n };\n}\n\nfunction getEntityTypeFromNode(node: ChildNode) {\n if (ENTITY_CLASS_BY_NODE_NAME[node.nodeName]) {\n return ENTITY_CLASS_BY_NODE_NAME[node.nodeName];\n }\n\n if (node.nodeName === 'A') {\n const anchor = node as HTMLAnchorElement;\n if (anchor.dataset.entityType === ApiMessageEntityTypes.MentionName) {\n return ApiMessageEntityTypes.MentionName;\n }\n if (anchor.dataset.entityType === ApiMessageEntityTypes.Url) {\n return ApiMessageEntityTypes.Url;\n }\n if (anchor.href.startsWith('mailto:')) {\n return ApiMessageEntityTypes.Email;\n }\n if (anchor.href.startsWith('tel:')) {\n return ApiMessageEntityTypes.Phone;\n }\n if (anchor.href !== anchor.textContent) {\n return ApiMessageEntityTypes.TextUrl;\n }\n\n return ApiMessageEntityTypes.Url;\n }\n\n if (node.nodeName === 'SPAN') {\n return (node as HTMLElement).dataset.entityType;\n }\n\n return undefined;\n}\n","const RE_BR = /(
|)/g;\nconst RE_SPACE = /( |\\u00A0)/g;\nconst RE_CLEAN_HTML = /(
|<\\/div>)/gi;\nconst RE_EXTRA_NEW_LINE = /\\n$/i;\n\nexport function prepareForRegExp(html: string) {\n return html\n .replace(RE_SPACE, ' ')\n .replace(RE_BR, '\\n')\n .replace(RE_CLEAN_HTML, '')\n .replace(RE_EXTRA_NEW_LINE, '');\n}\n","const MAX_NESTING_PARENTS = 5;\n\nexport function isSelectionInsideInput(selectionRange: Range, inputId: string) {\n const { commonAncestorContainer } = selectionRange;\n let parentNode: HTMLElement | null = commonAncestorContainer as HTMLElement;\n let iterations = 1;\n while (parentNode && parentNode.id !== inputId && iterations < MAX_NESTING_PARENTS) {\n parentNode = parentNode.parentElement;\n iterations++;\n }\n\n return Boolean(parentNode && parentNode.id === inputId);\n}\n","import {\n useCallback, useEffect, useMemo, useState,\n} from '../../../../lib/teact/teact';\n\nimport { EDITABLE_INPUT_ID } from '../../../../config';\nimport { MEMO_EMPTY_ARRAY } from '../../../../util/memo';\nimport { prepareForRegExp } from '../helpers/prepareForRegExp';\nimport {\n EmojiData, EmojiModule, EmojiRawData, uncompressEmoji,\n} from '../../../../util/emoji';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport {\n buildCollectionByKey, flatten, mapValues, pickTruthy, unique,\n} from '../../../../util/iteratees';\nimport useFlag from '../../../../hooks/useFlag';\n\nlet emojiDataPromise: Promise;\nlet emojiRawData: EmojiRawData;\nlet emojiData: EmojiData;\n\nlet RE_EMOJI_SEARCH: RegExp;\nconst EMOJIS_LIMIT = 36;\nconst FILTER_MIN_LENGTH = 2;\n\ntry {\n RE_EMOJI_SEARCH = new RegExp('(^|\\\\s):[-+_:\\\\p{L}\\\\p{N}]*$', 'gui');\n} catch (e) {\n // Support for older versions of firefox\n RE_EMOJI_SEARCH = new RegExp('(^|\\\\s):[-+_:\\\\d\\\\wа-яё]*$', 'gi');\n}\n\nexport default function useEmojiTooltip(\n isAllowed: boolean,\n html: string,\n recentEmojiIds: string[],\n inputId = EDITABLE_INPUT_ID,\n onUpdateHtml: (html: string) => void,\n baseEmojiKeywords?: Record,\n emojiKeywords?: Record,\n isDisabled = false,\n) {\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n\n const [byId, setById] = useState | undefined>();\n const [keywords, setKeywords] = useState();\n const [byKeyword, setByKeyword] = useState>({});\n const [names, setNames] = useState();\n const [byName, setByName] = useState>({});\n const [shouldForceInsertEmoji, setShouldForceInsertEmoji] = useState(false);\n\n const [filteredEmojis, setFilteredEmojis] = useState(MEMO_EMPTY_ARRAY);\n\n const recentEmojis = useMemo(\n () => {\n if (!byId || !recentEmojiIds.length) {\n return [];\n }\n\n return Object.values(pickTruthy(byId, recentEmojiIds));\n },\n [byId, recentEmojiIds],\n );\n\n // Initialize data on first render.\n useEffect(() => {\n if (isDisabled) return;\n const exec = () => {\n setById(emojiData.emojis);\n };\n\n if (emojiData) {\n exec();\n } else {\n ensureEmojiData()\n .then(exec);\n }\n }, [isDisabled]);\n\n useEffect(() => {\n if (!byId || isDisabled) {\n return;\n }\n\n const emojis = Object.values(byId);\n\n const byNative = buildCollectionByKey(emojis, 'native');\n const baseEmojisByKeyword = baseEmojiKeywords\n ? mapValues(baseEmojiKeywords, (natives) => {\n return Object.values(pickTruthy(byNative, natives));\n })\n : {};\n const emojisByKeyword = emojiKeywords\n ? mapValues(emojiKeywords, (natives) => {\n return Object.values(pickTruthy(byNative, natives));\n })\n : {};\n\n setByKeyword({ ...baseEmojisByKeyword, ...emojisByKeyword });\n setKeywords([...Object.keys(baseEmojisByKeyword), ...Object.keys(emojisByKeyword)]);\n\n const emojisByName = emojis.reduce((result, emoji) => {\n emoji.names.forEach((name) => {\n if (!result[name]) {\n result[name] = [];\n }\n\n result[name].push(emoji);\n });\n\n return result;\n }, {} as Record);\n setByName(emojisByName);\n setNames(Object.keys(emojisByName));\n }, [isDisabled, baseEmojiKeywords, byId, emojiKeywords]);\n\n useEffect(() => {\n if (!isAllowed || !html || !byId || !keywords || !keywords.length) {\n unmarkIsOpen();\n return;\n }\n\n const code = html.includes(':') && getEmojiCode(html);\n if (!code) {\n setFilteredEmojis(MEMO_EMPTY_ARRAY);\n unmarkIsOpen();\n return;\n }\n\n const forceSend = code.length > 2 && code.endsWith(':');\n const filter = code.substr(1, forceSend ? code.length - 2 : undefined);\n let matched: Emoji[] = [];\n\n setShouldForceInsertEmoji(forceSend);\n\n if (!filter) {\n matched = recentEmojis;\n } else if (filter.length >= FILTER_MIN_LENGTH) {\n const matchedKeywords = keywords.filter((keyword) => keyword.startsWith(filter)).sort();\n matched = matched.concat(flatten(Object.values(pickTruthy(byKeyword, matchedKeywords))));\n\n // Also search by names, which is useful for non-English languages\n const matchedNames = names.filter((name) => name.startsWith(filter));\n matched = matched.concat(flatten(Object.values(pickTruthy(byName, matchedNames))));\n\n matched = unique(matched);\n }\n\n if (matched.length) {\n if (!forceSend) {\n markIsOpen();\n }\n setFilteredEmojis(matched.slice(0, EMOJIS_LIMIT));\n } else {\n unmarkIsOpen();\n }\n }, [\n byId, byKeyword, keywords, byName, names, html, isAllowed, markIsOpen,\n recentEmojis, unmarkIsOpen, setShouldForceInsertEmoji,\n ]);\n\n const insertEmoji = useCallback((textEmoji: string, isForce?: boolean) => {\n const atIndex = html.lastIndexOf(':', isForce ? html.lastIndexOf(':') - 1 : undefined);\n if (atIndex !== -1) {\n onUpdateHtml(`${html.substr(0, atIndex)}${textEmoji}`);\n const messageInput = document.getElementById(inputId)!;\n requestAnimationFrame(() => {\n focusEditableElement(messageInput, true);\n });\n }\n\n unmarkIsOpen();\n }, [html, inputId, onUpdateHtml, unmarkIsOpen]);\n\n useEffect(() => {\n if (isOpen && shouldForceInsertEmoji && filteredEmojis.length) {\n insertEmoji(filteredEmojis[0].native, true);\n }\n }, [filteredEmojis, insertEmoji, isOpen, shouldForceInsertEmoji]);\n\n return {\n isEmojiTooltipOpen: isOpen,\n closeEmojiTooltip: unmarkIsOpen,\n filteredEmojis,\n insertEmoji,\n };\n}\n\nfunction getEmojiCode(html: string) {\n const emojis = prepareForRegExp(html).match(RE_EMOJI_SEARCH);\n\n return emojis ? emojis[0].trim() : undefined;\n}\n\nasync function ensureEmojiData() {\n if (!emojiDataPromise) {\n emojiDataPromise = import('emoji-data-ios/emoji-data.json') as unknown as Promise;\n emojiRawData = (await emojiDataPromise).default;\n\n emojiData = uncompressEmoji(emojiRawData);\n }\n\n return emojiDataPromise;\n}\n","import { ApiUser } from '../../../../api/types';\nimport { getUserFullName } from '../../../../modules/helpers';\nimport searchWords from '../../../../util/searchWords';\n\n// TODO: Support cyrillic translit search\nexport default function searchUserName(filter: string, user: ApiUser) {\n const usernameLowered = user.username.toLowerCase();\n const fullName = getUserFullName(user);\n const fullNameLowered = fullName && fullName.toLowerCase();\n const filterLowered = filter.toLowerCase();\n\n return usernameLowered.startsWith(filterLowered) || (\n fullNameLowered && searchWords(fullNameLowered, filterLowered)\n );\n}\n","import {\n useCallback, useEffect, useState, useMemo,\n} from '../../../../lib/teact/teact';\n\nimport { ApiMessageEntityTypes, ApiChatMember, ApiUser } from '../../../../api/types';\nimport { EDITABLE_INPUT_ID } from '../../../../config';\nimport { getUserFirstOrLastName } from '../../../../modules/helpers';\nimport searchUserName from '../helpers/searchUserName';\nimport { prepareForRegExp } from '../helpers/prepareForRegExp';\nimport focusEditableElement from '../../../../util/focusEditableElement';\nimport useFlag from '../../../../hooks/useFlag';\nimport { unique } from '../../../../util/iteratees';\nimport { throttle } from '../../../../util/schedulers';\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\nlet RE_USERNAME_SEARCH: RegExp;\n\ntry {\n RE_USERNAME_SEARCH = new RegExp('(^|\\\\s)@[-_\\\\p{L}\\\\p{M}\\\\p{N}]*$', 'gui');\n} catch (e) {\n // Support for older versions of firefox\n RE_USERNAME_SEARCH = new RegExp('(^|\\\\s)@[-_\\\\d\\\\wа-яё]*$', 'gi');\n}\n\nexport default function useMentionTooltip(\n canSuggestMembers: boolean | undefined,\n html: string,\n onUpdateHtml: (html: string) => void,\n inputId: string = EDITABLE_INPUT_ID,\n groupChatMembers?: ApiChatMember[],\n topInlineBotIds?: number[],\n currentUserId?: number,\n usersById?: Record,\n) {\n const [isOpen, markIsOpen, unmarkIsOpen] = useFlag();\n const [usersToMention, setUsersToMention] = useState();\n\n const topInlineBots = useMemo(() => {\n return (topInlineBotIds || []).map((id) => usersById?.[id]).filter(Boolean as any);\n }, [topInlineBotIds, usersById]);\n\n const getFilteredUsers = useCallback((filter, withInlineBots: boolean) => {\n if (!(groupChatMembers || topInlineBotIds) || !usersById) {\n setUsersToMention(undefined);\n\n return;\n }\n runThrottled(() => {\n const inlineBots = (withInlineBots ? topInlineBots : []).filter((inlineBot) => {\n return !filter || searchUserName(filter, inlineBot);\n });\n\n const chatMembers = (groupChatMembers || [])\n .map(({ userId }) => usersById[userId])\n .filter((user) => {\n if (!user || user.id === currentUserId) {\n return false;\n }\n\n return !filter || searchUserName(filter, user);\n });\n\n setUsersToMention(unique(inlineBots.concat(chatMembers)));\n });\n }, [currentUserId, groupChatMembers, topInlineBotIds, topInlineBots, usersById]);\n\n useEffect(() => {\n if (!canSuggestMembers || !html.length) {\n unmarkIsOpen();\n return;\n }\n\n const usernameFilter = html.includes('@') && getUsernameFilter(html);\n\n if (usernameFilter) {\n const filter = usernameFilter ? usernameFilter.substr(1) : '';\n getFilteredUsers(filter, canSuggestInlineBots(html));\n } else {\n unmarkIsOpen();\n }\n }, [canSuggestMembers, html, getFilteredUsers, markIsOpen, unmarkIsOpen]);\n\n useEffect(() => {\n if (usersToMention?.length) {\n markIsOpen();\n } else {\n unmarkIsOpen();\n }\n }, [markIsOpen, unmarkIsOpen, usersToMention]);\n\n const insertMention = useCallback((user: ApiUser, forceFocus = false) => {\n if (!user.username && !getUserFirstOrLastName(user)) {\n return;\n }\n\n const insertedHtml = user.username\n ? `@${user.username}`\n : `${getUserFirstOrLastName(user)}`;\n\n const atIndex = html.lastIndexOf('@');\n if (atIndex !== -1) {\n onUpdateHtml(`${html.substr(0, atIndex)}${insertedHtml} `);\n const messageInput = document.getElementById(inputId)!;\n requestAnimationFrame(() => {\n focusEditableElement(messageInput, forceFocus);\n });\n }\n\n unmarkIsOpen();\n }, [html, inputId, onUpdateHtml, unmarkIsOpen]);\n\n return {\n isMentionTooltipOpen: isOpen,\n closeMentionTooltip: unmarkIsOpen,\n insertMention,\n mentionFilteredUsers: usersToMention,\n };\n}\n\nfunction getUsernameFilter(html: string) {\n const username = prepareForRegExp(html).match(RE_USERNAME_SEARCH);\n\n return username ? username[0].trim() : undefined;\n}\n\nfunction canSuggestInlineBots(html: string) {\n return html.startsWith('@');\n}\n","import { useEffect, useRef } from '../../../lib/teact/teact';\n\nimport useOnChange from '../../../hooks/useOnChange';\nimport useForceUpdate from '../../../hooks/useForceUpdate';\n\nexport default function useAsyncRendering(dependencies: T, delay?: number) {\n const isDisabled = delay === undefined;\n const shouldRenderRef = useRef(isDisabled);\n const timeoutRef = useRef();\n const forceUpdate = useForceUpdate();\n\n useOnChange(() => {\n if (isDisabled) {\n return;\n }\n\n shouldRenderRef.current = false;\n\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n }, dependencies);\n\n useEffect(() => {\n if (isDisabled || shouldRenderRef.current) {\n return;\n }\n\n const exec = () => {\n shouldRenderRef.current = true;\n forceUpdate();\n };\n\n if (delay! > 0) {\n timeoutRef.current = window.setTimeout(exec, delay);\n } else {\n exec();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n\n return shouldRenderRef.current;\n}\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\nimport { TextPart } from '../common/helpers/renderMessageText';\n\nimport Modal from './Modal';\nimport Button from './Button';\n\ntype OwnProps = {\n isOpen: boolean;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n title?: string;\n header?: FC;\n textParts?: TextPart[];\n text?: string;\n confirmLabel?: string;\n confirmHandler: () => void;\n confirmIsDestructive?: boolean;\n isButtonsInOneRow?: boolean;\n};\n\nconst ConfirmDialog: FC = ({\n isOpen,\n onClose,\n onCloseAnimationEnd,\n title,\n header,\n text,\n textParts,\n confirmLabel = 'Confirm',\n confirmHandler,\n confirmIsDestructive,\n isButtonsInOneRow,\n}) => {\n const lang = useLang();\n\n return (\n \n {text && text.split('\\\\n').map((textPart) => (\n

{textPart}

\n ))}\n {textParts}\n
\n \n {confirmLabel}\n \n \n
\n \n );\n};\n\nexport default memo(ConfirmDialog);\n","import React, { FC } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport Button, { OwnProps as ButtonProps } from './Button';\n\nimport './FloatingActionButton.scss';\n\ntype OwnProps = {\n isShown: boolean;\n className?: string;\n color?: ButtonProps['color'];\n ariaLabel?: ButtonProps['ariaLabel'];\n disabled?: boolean;\n onClick: () => void;\n children: any;\n};\n\nconst FloatingActionButton: FC = ({\n isShown,\n className,\n color = 'primary',\n ariaLabel,\n disabled,\n onClick,\n children,\n}) => {\n const buttonClassName = buildClassName(\n 'FloatingActionButton',\n isShown && 'revealed',\n className,\n );\n\n return (\n \n {children}\n \n );\n};\n\nexport default FloatingActionButton;\n","import { RefObject, UIEvent } from 'react';\nimport { LoadMoreDirection } from '../../types';\n\nimport React, {\n FC, useCallback, useEffect, useLayoutEffect, useMemo, useRef,\n} from '../../lib/teact/teact';\n\nimport { debounce } from '../../util/schedulers';\nimport resetScroll from '../../util/resetScroll';\n\ntype OwnProps = {\n ref?: RefObject;\n className?: string;\n onLoadMore?: ({ direction }: { direction: LoadMoreDirection; noScroll?: boolean }) => void;\n onScroll?: (e: UIEvent) => void;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n items?: any[];\n itemSelector?: string;\n preloadBackwards?: number;\n sensitiveArea?: number;\n noScrollRestore?: boolean;\n noScrollRestoreOnTop?: boolean;\n noFastList?: boolean;\n cacheBuster?: any;\n children: any;\n};\n\nconst DEFAULT_LIST_SELECTOR = '.ListItem';\nconst DEFAULT_PRELOAD_BACKWARDS = 20;\nconst DEFAULT_SENSITIVE_AREA = 800;\n\nconst InfiniteScroll: FC = ({\n ref,\n className,\n onLoadMore,\n onScroll,\n onKeyDown,\n items,\n itemSelector = DEFAULT_LIST_SELECTOR,\n preloadBackwards = DEFAULT_PRELOAD_BACKWARDS,\n sensitiveArea = DEFAULT_SENSITIVE_AREA,\n // Used to turn off restoring scroll position (e.g. for frequently re-ordered chat or user lists)\n noScrollRestore = false,\n noScrollRestoreOnTop = false,\n noFastList,\n // Used to re-query `listItemElements` if rendering is delayed by transition\n cacheBuster,\n children,\n}: OwnProps) => {\n // eslint-disable-next-line no-null/no-null\n let containerRef = useRef(null);\n if (ref) {\n containerRef = ref;\n }\n\n const stateRef = useRef<{\n listItemElements?: NodeListOf;\n isScrollTopJustUpdated?: boolean;\n currentAnchor?: HTMLDivElement | undefined;\n currentAnchorTop?: number;\n }>({});\n\n const [loadMoreBackwards, loadMoreForwards] = useMemo(() => {\n if (!onLoadMore) {\n return [];\n }\n\n return [\n debounce((noScroll = false) => {\n onLoadMore({ direction: LoadMoreDirection.Backwards, noScroll });\n }, 1000, true, false),\n debounce(() => {\n onLoadMore({ direction: LoadMoreDirection.Forwards });\n }, 1000, true, false),\n ];\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [onLoadMore, items]);\n\n // Initial preload\n useEffect(() => {\n if (!loadMoreBackwards) {\n return;\n }\n\n if (preloadBackwards > 0 && (!items || items.length < preloadBackwards)) {\n loadMoreBackwards(true);\n return;\n }\n\n const { scrollHeight, clientHeight } = containerRef.current!;\n if (clientHeight && scrollHeight <= clientHeight) {\n loadMoreBackwards();\n }\n }, [items, loadMoreBackwards, preloadBackwards]);\n\n // Restore `scrollTop` after adding items\n useLayoutEffect(() => {\n const container = containerRef.current!;\n const state = stateRef.current;\n\n state.listItemElements = container.querySelectorAll(itemSelector);\n\n let newScrollTop;\n\n if (state.currentAnchor && Array.from(state.listItemElements).includes(state.currentAnchor)) {\n const { scrollTop } = container;\n const newAnchorTop = state.currentAnchor.getBoundingClientRect().top;\n newScrollTop = scrollTop + (newAnchorTop - state.currentAnchorTop!);\n } else {\n const nextAnchor = state.listItemElements[0];\n if (nextAnchor) {\n state.currentAnchor = nextAnchor;\n state.currentAnchorTop = nextAnchor.getBoundingClientRect().top;\n }\n }\n\n if (noScrollRestore) {\n return;\n }\n\n if (noScrollRestoreOnTop && container.scrollTop === 0) {\n return;\n }\n\n resetScroll(container, newScrollTop);\n\n state.isScrollTopJustUpdated = true;\n }, [items, itemSelector, noScrollRestore, noScrollRestoreOnTop, cacheBuster]);\n\n const handleScroll = useCallback((e: UIEvent) => {\n if (loadMoreForwards && loadMoreBackwards) {\n const {\n isScrollTopJustUpdated, currentAnchor, currentAnchorTop,\n } = stateRef.current;\n const listItemElements = stateRef.current.listItemElements!;\n\n if (isScrollTopJustUpdated) {\n stateRef.current.isScrollTopJustUpdated = false;\n return;\n }\n\n const listLength = listItemElements.length;\n const container = containerRef.current!;\n const { scrollTop, scrollHeight, offsetHeight } = container;\n const top = listLength ? listItemElements[0].offsetTop : 0;\n const isNearTop = scrollTop <= top + sensitiveArea;\n const bottom = listLength\n ? listItemElements[listLength - 1].offsetTop + listItemElements[listLength - 1].offsetHeight\n : scrollHeight;\n const isNearBottom = bottom - (scrollTop + offsetHeight) <= sensitiveArea;\n let isUpdated = false;\n\n if (isNearTop) {\n const nextAnchor = listItemElements[0];\n if (nextAnchor) {\n const nextAnchorTop = nextAnchor.getBoundingClientRect().top;\n const newAnchorTop = currentAnchor?.offsetParent && currentAnchor !== nextAnchor\n ? currentAnchor.getBoundingClientRect().top\n : nextAnchorTop;\n const isMovingUp = (\n currentAnchor && currentAnchorTop !== undefined && newAnchorTop > currentAnchorTop\n );\n\n if (isMovingUp) {\n stateRef.current.currentAnchor = nextAnchor;\n stateRef.current.currentAnchorTop = nextAnchorTop;\n isUpdated = true;\n resetScroll(container);\n loadMoreForwards();\n }\n }\n }\n\n if (isNearBottom) {\n const nextAnchor = listItemElements[listLength - 1];\n if (nextAnchor) {\n const nextAnchorTop = nextAnchor.getBoundingClientRect().top;\n const newAnchorTop = currentAnchor?.offsetParent && currentAnchor !== nextAnchor\n ? currentAnchor.getBoundingClientRect().top\n : nextAnchorTop;\n const isMovingDown = (\n currentAnchor && currentAnchorTop !== undefined && newAnchorTop < currentAnchorTop\n );\n\n if (isMovingDown) {\n stateRef.current.currentAnchor = nextAnchor;\n stateRef.current.currentAnchorTop = nextAnchorTop;\n isUpdated = true;\n resetScroll(container);\n loadMoreBackwards();\n }\n }\n }\n\n if (!isUpdated) {\n if (currentAnchor?.offsetParent) {\n stateRef.current.currentAnchorTop = currentAnchor.getBoundingClientRect().top;\n } else {\n const nextAnchor = listItemElements[0];\n\n if (nextAnchor) {\n stateRef.current.currentAnchor = nextAnchor;\n stateRef.current.currentAnchorTop = nextAnchor.getBoundingClientRect().top;\n }\n }\n }\n }\n\n if (onScroll) {\n onScroll(e);\n }\n }, [loadMoreBackwards, loadMoreForwards, onScroll, sensitiveArea]);\n\n return (\n \n {children}\n
\n );\n};\n\nexport default InfiniteScroll;\n","import { RefObject } from 'react';\nimport React, { FC, useRef, useCallback } from '../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport { fastRaf } from '../../util/schedulers';\nimport buildClassName from '../../util/buildClassName';\nimport useContextMenuHandlers from '../../hooks/useContextMenuHandlers';\nimport useContextMenuPosition from '../../hooks/useContextMenuPosition';\nimport useFlag from '../../hooks/useFlag';\nimport useLang from '../../hooks/useLang';\n\nimport RippleEffect from './RippleEffect';\nimport Menu from './Menu';\nimport MenuItem from './MenuItem';\n\nimport './ListItem.scss';\n\ninterface MenuItemContextAction {\n title: string;\n icon: string;\n destructive?: boolean;\n handler?: () => void;\n}\n\ninterface OwnProps {\n ref?: RefObject;\n buttonRef?: RefObject;\n icon?: string;\n className?: string;\n style?: string;\n children: any;\n disabled?: boolean;\n ripple?: boolean;\n narrow?: boolean;\n inactive?: boolean;\n focus?: boolean;\n destructive?: boolean;\n multiline?: boolean;\n isStatic?: boolean;\n contextActions?: MenuItemContextAction[];\n onMouseDown?: (e: React.MouseEvent) => void;\n onClick?: (e: React.MouseEvent) => void;\n}\n\nconst ListItem: FC = (props) => {\n const {\n ref,\n buttonRef,\n icon,\n className,\n style,\n children,\n disabled,\n ripple,\n narrow,\n inactive,\n focus,\n destructive,\n multiline,\n isStatic,\n contextActions,\n onMouseDown,\n onClick,\n } = props;\n\n // eslint-disable-next-line no-null/no-null\n let containerRef = useRef(null);\n if (ref) {\n containerRef = ref;\n }\n const [isTouched, markIsTouched, unmarkIsTouched] = useFlag();\n\n const {\n isContextMenuOpen, contextMenuPosition,\n handleBeforeContextMenu, handleContextMenu,\n handleContextMenuClose, handleContextMenuHide,\n } = useContextMenuHandlers(containerRef, !contextActions);\n\n const getTriggerElement = useCallback(() => containerRef.current, []);\n\n const getRootElement = useCallback(\n () => containerRef.current!.closest('.custom-scroll'),\n [],\n );\n\n const getMenuElement = useCallback(\n () => containerRef.current!.querySelector('.ListItem-context-menu .bubble'),\n [],\n );\n\n const { positionX, positionY, style: menuStyle } = useContextMenuPosition(\n contextMenuPosition,\n getTriggerElement,\n getRootElement,\n getMenuElement,\n );\n\n const handleClick = useCallback((e: React.MouseEvent) => {\n if (disabled || !onClick) {\n return;\n }\n onClick(e);\n\n if (IS_TOUCH_ENV && !ripple) {\n markIsTouched();\n fastRaf(unmarkIsTouched);\n }\n }, [disabled, markIsTouched, onClick, ripple, unmarkIsTouched]);\n\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n if (inactive || IS_TOUCH_ENV) {\n return;\n }\n if (contextActions && (e.button === 2 || !onClick)) {\n handleBeforeContextMenu(e);\n }\n if (e.button === 0) {\n if (!onClick) {\n handleContextMenu(e);\n } else {\n handleClick(e);\n }\n }\n }, [inactive, contextActions, onClick, handleBeforeContextMenu, handleContextMenu, handleClick]);\n\n const lang = useLang();\n\n const fullClassName = buildClassName(\n 'ListItem',\n className,\n !isStatic && 'no-selection',\n ripple && 'has-ripple',\n narrow && 'narrow',\n disabled && 'disabled',\n inactive && 'inactive',\n contextMenuPosition && 'has-menu-open',\n focus && 'focus',\n destructive && 'destructive',\n multiline && 'multiline',\n isStatic && 'is-static',\n );\n\n return (\n \n \n {icon && (\n \n )}\n {multiline && (
{children}
)}\n {!multiline && children}\n {!disabled && !inactive && ripple && (\n \n )}\n
\n {contextActions && contextMenuPosition !== undefined && (\n \n {contextActions.map((action) => (\n \n {action.title}\n \n ))}\n \n )}\n
\n );\n};\n\nexport default ListItem;\n","import React, {\n FC, useEffect, useRef,\n} from '../../lib/teact/teact';\n\nimport { TextPart } from '../common/helpers/renderMessageText';\n\nimport captureKeyboardListeners from '../../util/captureKeyboardListeners';\nimport trapFocus from '../../util/trapFocus';\nimport buildClassName from '../../util/buildClassName';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Button from './Button';\nimport Portal from './Portal';\n\nimport './Modal.scss';\n\nconst ANIMATION_DURATION = 200;\n\ntype OwnProps = {\n title?: string | TextPart[];\n className?: string;\n isOpen?: boolean;\n header?: any;\n hasCloseButton?: boolean;\n noBackdrop?: boolean;\n children: any;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n onEnter?: () => void;\n};\n\ntype StateProps = {\n shouldSkipHistoryAnimations?: boolean;\n};\n\nconst Modal: FC = ({\n title,\n className,\n isOpen,\n header,\n hasCloseButton,\n noBackdrop,\n children,\n onClose,\n onCloseAnimationEnd,\n onEnter,\n shouldSkipHistoryAnimations,\n}) => {\n const {\n shouldRender,\n transitionClassNames,\n } = useShowTransition(\n isOpen, onCloseAnimationEnd, shouldSkipHistoryAnimations, undefined, shouldSkipHistoryAnimations,\n );\n // eslint-disable-next-line no-null/no-null\n const modalRef = useRef(null);\n\n useEffect(() => (isOpen\n ? captureKeyboardListeners({ onEsc: onClose, onEnter })\n : undefined), [isOpen, onClose, onEnter]);\n useEffect(() => (isOpen && modalRef.current ? trapFocus(modalRef.current) : undefined), [isOpen]);\n\n const { forceClose } = useHistoryBack(isOpen, onClose);\n\n // For modals that are closed by unmounting without changing `isOpen` to `false`\n useEffect(() => {\n return () => {\n if (isOpen) {\n forceClose();\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffectWithPrevDeps(([prevIsOpen]) => {\n document.body.classList.toggle('has-open-dialog', isOpen);\n\n if (isOpen || (!isOpen && prevIsOpen !== undefined)) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION);\n }\n\n return () => {\n document.body.classList.remove('has-open-dialog');\n };\n }, [isOpen]);\n\n const lang = useLang();\n\n if (!shouldRender) {\n return undefined;\n }\n\n function renderHeader() {\n if (header) {\n return header;\n }\n\n if (!title) {\n return undefined;\n }\n\n return (\n
\n {hasCloseButton && (\n \n \n \n )}\n
{title}
\n
\n );\n }\n\n const fullClassName = buildClassName(\n 'Modal',\n className,\n transitionClassNames,\n noBackdrop && 'transparent-backdrop',\n );\n\n return (\n \n \n
\n
\n
\n {renderHeader()}\n
\n {children}\n
\n
\n
\n
\n
\n );\n};\n\nexport default Modal;\n","export default function trapFocus(element: HTMLElement) {\n function handleKeyDown(e: KeyboardEvent) {\n if (e.key !== 'Tab') {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n\n const focusableElements = Array.from(\n element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'),\n ) as HTMLElement[];\n if (!focusableElements.length) {\n return;\n }\n\n const currentFocusedIndex = focusableElements.findIndex((em) => em.isSameNode(document.activeElement));\n let newFocusedIndex = 0;\n if (currentFocusedIndex >= 0) {\n if (e.shiftKey) {\n newFocusedIndex = currentFocusedIndex > 0\n ? currentFocusedIndex - 1\n : focusableElements.length - 1;\n } else {\n newFocusedIndex = currentFocusedIndex < focusableElements.length - 1\n ? currentFocusedIndex + 1\n : 0;\n }\n }\n\n focusableElements[newFocusedIndex].focus();\n }\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n}\n","import React, {\n FC,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from '../../lib/teact/teact';\n\nimport { ANIMATION_END_DELAY } from '../../config';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport { TextPart } from '../common/helpers/renderMessageText';\nimport buildClassName from '../../util/buildClassName';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\n\nimport Portal from './Portal';\n\nimport './Notification.scss';\n\ntype OwnProps = {\n containerId?: string;\n message: TextPart[];\n duration?: number;\n onDismiss: () => void;\n};\n\nconst DEFAULT_DURATION = 3000;\nconst ANIMATION_DURATION = 150;\n\nconst Notification: FC = ({\n message, duration = DEFAULT_DURATION, containerId, onDismiss,\n}) => {\n const [isOpen, setIsOpen] = useState(true);\n // eslint-disable-next-line no-null/no-null\n const timerRef = useRef(null);\n\n const { transitionClassNames } = useShowTransition(isOpen);\n\n const closeAndDismiss = useCallback(() => {\n setIsOpen(false);\n setTimeout(onDismiss, ANIMATION_DURATION + ANIMATION_END_DELAY);\n }, [onDismiss]);\n\n useEffect(() => (isOpen ? captureEscKeyListener(closeAndDismiss) : undefined), [isOpen, closeAndDismiss]);\n\n useEffect(() => {\n timerRef.current = window.setTimeout(closeAndDismiss, duration);\n\n return () => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = undefined;\n }\n };\n }, [duration, closeAndDismiss]);\n\n const handleMouseEnter = useCallback(() => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = undefined;\n }\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n timerRef.current = window.setTimeout(closeAndDismiss, duration);\n }, [duration, closeAndDismiss]);\n\n return (\n \n \n
\n {message}\n
\n
\n \n );\n};\n\nexport default Notification;\n","import { FC, useRef, useLayoutEffect } from '../../lib/teact/teact';\nimport TeactDOM from '../../lib/teact/teact-dom';\n\ntype OwnProps = {\n containerId?: string;\n className?: string;\n children: any;\n};\n\nconst Portal: FC = ({ containerId, className, children }) => {\n const elementRef = useRef();\n if (!elementRef.current) {\n elementRef.current = document.createElement('div');\n }\n\n useLayoutEffect(() => {\n const container = document.querySelector(containerId || '#portals');\n if (!container) {\n return undefined;\n }\n\n const element = elementRef.current!;\n if (className) {\n element.classList.add(className);\n }\n\n container.appendChild(element);\n\n return () => {\n TeactDOM.render(undefined, element);\n container.removeChild(element);\n };\n }, [className, containerId]);\n\n return TeactDOM.render(children, elementRef.current);\n};\n\nexport default Portal;\n","import React, {\n FC, useEffect, useRef, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport './ProgressSpinner.scss';\n\nconst RADIUSES = {\n s: 22, m: 25, l: 28, xl: 20,\n};\nconst STROKE_WIDTH = 2;\nconst MIN_PROGRESS = 0.05;\nconst MAX_PROGRESS = 1;\n\nconst ProgressSpinner: FC<{\n progress?: number;\n size?: 's' | 'm' | 'l' | 'xl';\n square?: boolean;\n transparent?: boolean;\n noCross?: boolean;\n onClick?: (e: React.MouseEvent) => void;\n}> = ({\n progress = 0,\n size = 'l',\n square,\n transparent,\n noCross,\n onClick,\n}) => {\n const radius = RADIUSES[size];\n const circleRadius = radius - STROKE_WIDTH * 2;\n const borderRadius = radius - 1;\n const circumference = circleRadius * 2 * Math.PI;\n // eslint-disable-next-line no-null/no-null\n const container = useRef(null);\n\n useEffect(() => {\n if (!container.current) {\n return;\n }\n\n const svg = container.current.firstElementChild;\n const strokeDashOffset = circumference - Math.min(Math.max(MIN_PROGRESS, progress), MAX_PROGRESS) * circumference;\n\n if (!svg) {\n container.current.innerHTML = `\n \n `;\n } else {\n (svg.firstElementChild as SVGElement).setAttribute('stroke-dashoffset', strokeDashOffset.toString());\n }\n }, [container, circumference, borderRadius, circleRadius, progress]);\n\n const className = buildClassName(\n `ProgressSpinner size-${size}`,\n transparent && 'transparent',\n square && 'square',\n noCross && 'no-cross',\n );\n\n return (\n \n );\n};\n\nexport default memo(ProgressSpinner);\n","import { ChangeEvent } from 'react';\nimport React, { FC, memo } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Spinner from './Spinner';\n\nimport './Radio.scss';\n\ntype OwnProps = {\n id?: string;\n name: string;\n label: string;\n subLabel?: string;\n value: string;\n checked: boolean;\n disabled?: boolean;\n hidden?: boolean;\n isLoading?: boolean;\n onChange: (e: ChangeEvent) => void;\n};\n\nconst Radio: FC = ({\n id,\n label,\n subLabel,\n value,\n name,\n checked,\n disabled,\n hidden,\n isLoading,\n onChange,\n}) => {\n const lang = useLang();\n const className = buildClassName(\n 'Radio',\n disabled && 'disabled',\n hidden && 'hidden-widget',\n isLoading && 'loading',\n );\n\n return (\n \n );\n};\n\nexport default memo(Radio);\n","import { ChangeEvent } from 'react';\nimport React, { FC, useCallback, memo } from '../../lib/teact/teact';\n\nimport Radio from './Radio';\n\ntype IRadioOption = {\n label: string;\n subLabel?: string;\n value: string;\n hidden?: boolean;\n};\n\ntype OwnProps = {\n id?: string;\n name: string;\n options: IRadioOption[];\n selected?: string;\n disabled?: boolean;\n loadingOption?: string;\n onChange: (value: string) => void;\n};\n\nconst RadioGroup: FC = ({\n id,\n name,\n options,\n selected,\n disabled,\n loadingOption,\n onChange,\n}) => {\n const handleChange = useCallback((event: ChangeEvent) => {\n const { value } = event.currentTarget;\n onChange(value);\n }, [onChange]);\n\n return (\n
\n {options.map((option) => (\n
\n );\n};\n\nexport default memo(RadioGroup);\n","import { RefObject } from 'react';\nimport React, {\n FC, useRef, useEffect, memo, useCallback,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useFlag from '../../hooks/useFlag';\nimport useLang from '../../hooks/useLang';\n\nimport Loading from './Loading';\nimport Button from './Button';\n\nimport './SearchInput.scss';\n\ntype OwnProps = {\n ref?: RefObject;\n children?: any;\n parentContainerClassName?: string;\n className?: string;\n inputId?: string;\n value?: string;\n focused?: boolean;\n isLoading?: boolean;\n placeholder?: string;\n disabled?: boolean;\n autoComplete?: string;\n canClose?: boolean;\n onChange: (value: string) => void;\n onReset?: NoneToVoidFunction;\n onFocus?: NoneToVoidFunction;\n onBlur?: NoneToVoidFunction;\n};\n\nconst SearchInput: FC = ({\n ref,\n children,\n parentContainerClassName,\n value,\n inputId,\n className,\n focused,\n isLoading,\n placeholder,\n disabled,\n autoComplete,\n canClose,\n onChange,\n onReset,\n onFocus,\n onBlur,\n}) => {\n // eslint-disable-next-line no-null/no-null\n let inputRef = useRef(null);\n if (ref) {\n inputRef = ref;\n }\n\n const [isInputFocused, markInputFocused, unmarkInputFocused] = useFlag(focused);\n\n useEffect(() => {\n if (!inputRef.current) {\n return;\n }\n\n if (focused) {\n inputRef.current.focus();\n } else {\n inputRef.current.blur();\n }\n }, [focused, placeholder]); // Trick for setting focus when selecting a contact to search for\n\n const lang = useLang();\n\n function handleChange(event: React.ChangeEvent) {\n const { currentTarget } = event;\n onChange(currentTarget.value);\n }\n\n function handleFocus() {\n markInputFocused();\n if (onFocus) {\n onFocus();\n }\n }\n\n function handleBlur() {\n unmarkInputFocused();\n if (onBlur) {\n onBlur();\n }\n }\n\n const handleKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.key === 'ArrowDown' || e.key === 'Enter') {\n const element = document.querySelector(`.${parentContainerClassName} .ListItem-button`) as HTMLElement;\n if (element) {\n element.focus();\n }\n }\n }, [parentContainerClassName]);\n\n return (\n \n {children}\n \n \n {isLoading && (\n \n )}\n {!isLoading && (value || canClose) && onReset && (\n \n \n \n )}\n
\n );\n};\n\nexport default memo(SearchInput);\n","import React, { FC, useRef } from '../../lib/teact/teact';\n\nimport useShowTransition from '../../hooks/useShowTransition';\nimport usePrevious from '../../hooks/usePrevious';\nimport buildClassName from '../../util/buildClassName';\n\ntype ChildrenFn = () => any;\n\ntype OwnProps = {\n isOpen: boolean;\n isCustom?: boolean;\n id?: string;\n className?: string;\n onClick?: (e: React.MouseEvent) => void;\n children: ChildrenFn;\n};\n\nconst ShowTransition: FC = ({\n isOpen, isCustom, id, className, onClick, children,\n}) => {\n const { shouldRender, transitionClassNames } = useShowTransition(\n isOpen, undefined, undefined, isCustom ? false : undefined,\n );\n const prevIsOpen = usePrevious(isOpen);\n const prevChildren = usePrevious(children);\n const fromChildrenRef = useRef();\n\n if (prevIsOpen && !isOpen) {\n fromChildrenRef.current = prevChildren;\n }\n\n return (\n shouldRender && (\n
\n {isOpen ? children() : fromChildrenRef.current!()}\n
\n )\n );\n};\n\nexport default ShowTransition;\n","import { ChangeEvent } from 'react';\nimport React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport './Switcher.scss';\n\ntype OwnProps = {\n id?: string;\n name?: string;\n value?: string;\n label: string;\n checked?: boolean;\n disabled?: boolean;\n inactive?: boolean;\n noAnimation?: boolean;\n onChange?: (e: ChangeEvent) => void;\n onCheck?: (isChecked: boolean) => void;\n};\n\nconst Switcher: FC = ({\n id,\n name,\n value,\n label,\n checked = false,\n disabled,\n inactive,\n noAnimation,\n onChange,\n onCheck,\n}) => {\n const handleChange = useCallback((e: ChangeEvent) => {\n if (onChange) {\n onChange(e);\n }\n\n if (onCheck) {\n onCheck(e.currentTarget.checked);\n }\n }, [onChange, onCheck]);\n\n const className = buildClassName(\n 'Switcher',\n disabled && 'disabled',\n inactive && 'inactive',\n noAnimation && 'no-animation',\n );\n\n return (\n \n );\n};\n\nexport default memo(Switcher);\n","import React, {\n FC, useLayoutEffect, useRef, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport renderText from '../common/helpers/renderText';\n\nimport './Tab.scss';\n\ntype OwnProps = {\n className?: string;\n title: string;\n active?: boolean;\n badgeCount?: number;\n isBadgeActive?: boolean;\n previousActiveTab?: number;\n onClick: (arg: number) => void;\n clickArg: number;\n};\n\nconst Tab: FC = ({\n className,\n title,\n active,\n badgeCount,\n isBadgeActive,\n previousActiveTab,\n onClick,\n clickArg,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const tabRef = useRef(null);\n\n useLayoutEffect(() => {\n if (!active || previousActiveTab === undefined) {\n return;\n }\n\n const tab = tabRef.current!;\n const indicator = tab.querySelector('i')!;\n const prevTab = tab.parentElement!.children[previousActiveTab];\n if (!prevTab) {\n return;\n }\n const currentIndicator = prevTab.querySelector('i')!;\n\n currentIndicator.classList.remove('animate');\n indicator.classList.remove('animate');\n\n // We move and resize our indicator so it repeats the position and size of the previous one.\n const shiftLeft = currentIndicator.parentElement!.offsetLeft - indicator.parentElement!.offsetLeft;\n const scaleFactor = currentIndicator.clientWidth / indicator.clientWidth;\n indicator.style.transform = `translate3d(${shiftLeft}px, 0, 0) scale3d(${scaleFactor}, 1, 1)`;\n\n // 3 AFs needed here to synchronize animations with Transition component\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n // Now we remove the transform to let it animate to its own position and size.\n indicator.classList.add('animate');\n indicator.style.transform = 'none';\n });\n });\n });\n }, [active, previousActiveTab]);\n\n return (\n onClick(clickArg)}\n ref={tabRef}\n >\n \n {renderText(title)}\n {!!badgeCount && (\n {badgeCount}\n )}\n \n \n \n );\n};\n\nexport default memo(Tab);\n","import React, {\n FC, memo, useRef, useEffect,\n} from '../../lib/teact/teact';\n\nimport fastSmoothScrollHorizontal from '../../util/fastSmoothScrollHorizontal';\nimport usePrevious from '../../hooks/usePrevious';\nimport useHorizontalScroll from '../../hooks/useHorizontalScroll';\nimport useLang from '../../hooks/useLang';\n\nimport Tab from './Tab';\n\nimport './TabList.scss';\n\nexport type TabWithProperties = {\n title: string;\n badgeCount?: number;\n isBadgeActive?: boolean;\n};\n\ntype OwnProps = {\n tabs: readonly TabWithProperties[];\n activeTab: number;\n big?: boolean;\n onSwitchTab: (index: number) => void;\n};\n\nconst TAB_SCROLL_THRESHOLD_PX = 16;\n\nconst TabList: FC = ({\n tabs, activeTab, big, onSwitchTab,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const previousActiveTab = usePrevious(activeTab);\n\n useHorizontalScroll(containerRef.current);\n\n // Scroll container to place active tab in the center\n useEffect(() => {\n const container = containerRef.current!;\n if (container.scrollWidth <= container.offsetWidth) {\n return;\n }\n\n const activeTabElement = container.querySelector('.Tab.active') as HTMLElement | null;\n if (activeTabElement) {\n const newLeft = activeTabElement.offsetLeft - (container.offsetWidth / 2) + (activeTabElement.offsetWidth / 2);\n\n // Prevent scrolling by only a couple of pixels, which doesn't look smooth\n if (Math.abs(newLeft - container.scrollLeft) < TAB_SCROLL_THRESHOLD_PX) {\n return;\n }\n\n fastSmoothScrollHorizontal(container, newLeft);\n }\n }, [activeTab]);\n\n const lang = useLang();\n\n return (\n \n {tabs.map((tab, i) => (\n \n ))}\n
\n );\n};\n\nexport default memo(TabList);\n","import { RefObject } from 'react';\nimport React, {\n FC, useLayoutEffect, useRef,\n} from '../../lib/teact/teact';\nimport { getGlobal } from '../../lib/teact/teactn';\n\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport usePrevious from '../../hooks/usePrevious';\nimport buildClassName from '../../util/buildClassName';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport { waitForAnimationEnd } from '../../util/cssAnimationEndListeners';\n\nimport './Transition.scss';\n\ntype ChildrenFn = (isActive: boolean, isFrom: boolean, currentKey: number) => any;\ntype OwnProps = {\n ref?: RefObject;\n activeKey: number;\n name: (\n 'none' | 'slide' | 'slide-reversed' | 'mv-slide' | 'slide-fade' | 'zoom-fade' | 'slide-layers'\n | 'fade' | 'push-slide' | 'reveal'\n );\n direction?: 'auto' | 'inverse' | 1 | -1;\n renderCount?: number;\n shouldRestoreHeight?: boolean;\n shouldCleanup?: boolean;\n cleanupExceptionKey?: number;\n id?: string;\n className?: string;\n onStart?: () => void;\n onStop?: () => void;\n children: ChildrenFn;\n};\n\nconst CLEANED_UP = Symbol('CLEANED_UP');\n\nconst Transition: FC = ({\n ref,\n activeKey,\n name,\n direction = 'auto',\n renderCount,\n shouldRestoreHeight,\n shouldCleanup,\n cleanupExceptionKey,\n id,\n className,\n onStart,\n onStop,\n children,\n}) => {\n // No need for a container to update on change\n const { animationLevel } = getGlobal().settings.byKey;\n const currentKeyRef = useRef();\n\n // eslint-disable-next-line no-null/no-null\n let containerRef = useRef(null);\n if (ref) {\n containerRef = ref;\n }\n\n const rendersRef = useRef>({});\n const prevActiveKey = usePrevious(activeKey);\n const forceUpdate = useForceUpdate();\n\n const activeKeyChanged = prevActiveKey !== undefined && activeKey !== prevActiveKey;\n\n if (!renderCount && activeKeyChanged) {\n rendersRef.current = { [prevActiveKey]: rendersRef.current[prevActiveKey] };\n }\n\n rendersRef.current[activeKey] = children;\n\n useLayoutEffect(() => {\n function cleanup() {\n if (!shouldCleanup || (cleanupExceptionKey !== undefined && cleanupExceptionKey === prevActiveKey)) {\n return;\n }\n\n rendersRef.current = { [prevActiveKey]: CLEANED_UP };\n forceUpdate();\n }\n\n const container = containerRef.current!;\n\n const childElements = container.children;\n if (childElements.length === 1 && !activeKeyChanged) {\n childElements[0].classList.add('active');\n\n return;\n }\n\n const childNodes = Array.from(container.childNodes);\n\n if (!activeKeyChanged || !childNodes.length) {\n return;\n }\n\n const isBackwards = (\n direction === -1\n || (direction === 'auto' && prevActiveKey > activeKey)\n || (direction === 'inverse' && prevActiveKey < activeKey)\n );\n\n container.classList.remove('animating');\n container.classList.toggle('backwards', isBackwards);\n\n const keys = Object.keys(rendersRef.current).map(Number);\n const prevActiveIndex = renderCount ? prevActiveKey : keys.indexOf(prevActiveKey);\n const activeIndex = renderCount ? activeKey : keys.indexOf(activeKey);\n\n if (name === 'none' || animationLevel === 0) {\n childNodes.forEach((node, i) => {\n if (node instanceof HTMLElement) {\n node.classList.remove('from', 'through', 'to');\n node.classList.toggle('active', i === activeIndex);\n }\n });\n\n cleanup();\n\n return;\n }\n\n childNodes.forEach((node, i) => {\n if (node instanceof HTMLElement) {\n node.classList.remove('active');\n node.classList.toggle('from', i === prevActiveIndex);\n node.classList.toggle('through', (\n (i > prevActiveIndex && i < activeIndex) || (i < prevActiveIndex && i > activeIndex)\n ));\n node.classList.toggle('to', i === activeIndex);\n }\n });\n\n let dispatchHeavyAnimationStop: NoneToVoidFunction;\n if (animationLevel > 0) {\n dispatchHeavyAnimationStop = dispatchHeavyAnimationEvent();\n }\n\n requestAnimationFrame(() => {\n container.classList.add('animating');\n\n if (onStart) {\n onStart();\n }\n\n function onAnimationEnd() {\n requestAnimationFrame(() => {\n if (activeKey !== currentKeyRef.current) {\n return;\n }\n\n container.classList.remove('animating', 'backwards');\n\n childNodes.forEach((node, i) => {\n if (node instanceof HTMLElement) {\n node.classList.remove('from', 'through', 'to');\n node.classList.toggle('active', i === activeIndex);\n }\n });\n\n if (shouldRestoreHeight) {\n const activeElement = container.querySelector('.active');\n\n if (activeElement) {\n activeElement.style.height = 'auto';\n container.style.height = `${activeElement.clientHeight}px`;\n }\n }\n\n if (dispatchHeavyAnimationStop) {\n dispatchHeavyAnimationStop();\n }\n\n cleanup();\n\n if (onStop) {\n onStop();\n }\n });\n }\n\n const watchedNode = name === 'mv-slide'\n ? childNodes[activeIndex]?.firstChild\n : name === 'reveal' && isBackwards\n ? childNodes[prevActiveIndex]\n : childNodes[activeIndex];\n\n currentKeyRef.current = activeKey;\n\n if (animationLevel > 0 && watchedNode) {\n waitForAnimationEnd(watchedNode, onAnimationEnd);\n } else {\n onAnimationEnd();\n }\n });\n }, [\n activeKey,\n prevActiveKey,\n activeKeyChanged,\n direction,\n name,\n onStart,\n onStop,\n renderCount,\n shouldRestoreHeight,\n shouldCleanup,\n cleanupExceptionKey,\n animationLevel,\n forceUpdate,\n ]);\n\n useLayoutEffect(() => {\n if (shouldRestoreHeight) {\n const container = containerRef.current!;\n const activeElement = container.querySelector('.active')\n || container.querySelector('.from');\n\n if (activeElement) {\n activeElement.style.height = 'auto';\n container.style.height = `${activeElement.clientHeight}px`;\n container.style.flexBasis = `${activeElement.clientHeight}px`;\n }\n }\n }, [shouldRestoreHeight, children]);\n\n const renders = rendersRef.current;\n const collection = Object.keys(renderCount ? new Array(renderCount).fill(undefined) : renders).map(Number);\n const contents = collection.map((key) => {\n const render = renders[key];\n\n return (\n typeof render === 'function'\n ?
{render(key === activeKey, key === prevActiveKey, activeKey)}
\n : undefined\n );\n });\n\n const fullClassName = buildClassName(\n 'Transition',\n className,\n name,\n );\n\n return (\n
\n {contents}\n
\n );\n};\n\nexport default Transition;\n","import useReducer, { StateReducer, Dispatch } from '../useReducer';\nimport { ApiChatFolder } from '../../api/types';\nimport { pick, omit } from '../../util/iteratees';\n\nexport type FolderChatType = {\n icon: string;\n title: string;\n key: keyof Pick;\n};\n\nexport const INCLUDED_CHAT_TYPES: FolderChatType[] = [\n { icon: 'user', title: 'FilterContacts', key: 'contacts' },\n { icon: 'non-contacts', title: 'FilterNonContacts', key: 'nonContacts' },\n { icon: 'group', title: 'FilterGroups', key: 'groups' },\n { icon: 'channel', title: 'FilterChannels', key: 'channels' },\n { icon: 'bots', title: 'FilterBots', key: 'bots' },\n];\n\nexport const EXCLUDED_CHAT_TYPES: FolderChatType[] = [\n { icon: 'mute', title: 'FilterMuted', key: 'excludeMuted' },\n { icon: 'archive', title: 'FilterArchived', key: 'excludeArchived' },\n { icon: 'readchats', title: 'FilterRead', key: 'excludeRead' },\n];\n\nconst INCLUDE_FILTER_FIELDS: Array = [\n 'includedChatIds', 'bots', 'channels', 'groups', 'contacts', 'nonContacts',\n];\nconst EXCLUDE_FILTER_FIELDS: Array = [\n 'excludedChatIds', 'excludeArchived', 'excludeMuted', 'excludeRead',\n];\n\nexport function selectChatFilters(state: FoldersState, mode: 'included' | 'excluded', selectTemp?: boolean) {\n let selectedChatIds: number[] = [];\n let selectedChatTypes: FolderChatType['key'][] = [];\n\n if (mode === 'included') {\n const {\n includedChatIds,\n ...includeFilters\n } = selectTemp\n ? state.includeFilters || {}\n : pick(\n state.folder,\n INCLUDE_FILTER_FIELDS,\n );\n\n selectedChatIds = includedChatIds || [];\n selectedChatTypes = (Object.keys(includeFilters) as Array)\n .filter((key) => Boolean(includeFilters[key]));\n } else {\n const {\n excludedChatIds,\n ...excludeFilters\n } = selectTemp\n ? state.excludeFilters || {}\n : pick(\n state.folder,\n EXCLUDE_FILTER_FIELDS,\n );\n\n selectedChatIds = excludedChatIds || [];\n selectedChatTypes = (Object.keys(excludeFilters) as Array)\n .filter((key) => Boolean(excludeFilters[key]));\n }\n\n return {\n selectedChatIds,\n selectedChatTypes,\n };\n}\n\nfunction getSuggestedFolderName(includeFilters?: FolderIncludeFilters) {\n if (includeFilters) {\n const {\n includedChatIds,\n ...filters\n } = includeFilters;\n\n if (\n Object.values(filters).filter(Boolean).length > 1\n || (includedChatIds?.length)\n ) {\n return '';\n }\n\n if (filters.bots) {\n return 'Bots';\n } else if (filters.groups) {\n return 'Groups';\n } else if (filters.channels) {\n return 'Channels';\n } else if (filters.contacts) {\n return 'Contacts';\n } else if (filters.nonContacts) {\n return 'Non-Contacts';\n }\n }\n\n return '';\n}\n\ntype FolderIncludeFilters = Pick;\ntype FolderExcludeFilters = Pick;\n\nexport type FoldersState = {\n mode: 'create' | 'edit';\n isLoading?: boolean;\n isTouched?: boolean;\n error?: string;\n folderId?: number;\n chatFilter: string;\n folder: Omit;\n includeFilters?: FolderIncludeFilters;\n excludeFilters?: FolderExcludeFilters;\n};\nexport type FoldersActions = (\n 'setTitle' | 'saveFilters' | 'editFolder' | 'reset' | 'setChatFilter' | 'setIsLoading' | 'setError' |\n 'editIncludeFilters' | 'editExcludeFilters' | 'setIncludeFilters' | 'setExcludeFilters'\n);\nexport type FolderEditDispatch = Dispatch;\n\nconst INITIAL_STATE: FoldersState = {\n mode: 'create',\n chatFilter: '',\n folder: {\n title: '',\n includedChatIds: [],\n excludedChatIds: [],\n },\n};\n\nconst foldersReducer: StateReducer = (\n state,\n action,\n) => {\n switch (action.type) {\n case 'setTitle':\n return {\n ...state,\n folder: {\n ...state.folder,\n title: action.payload,\n },\n isTouched: true,\n };\n case 'editIncludeFilters':\n return {\n ...state,\n includeFilters: pick(\n state.folder,\n INCLUDE_FILTER_FIELDS,\n ),\n };\n case 'editExcludeFilters':\n return {\n ...state,\n excludeFilters: pick(\n state.folder,\n EXCLUDE_FILTER_FIELDS,\n ),\n };\n case 'setIncludeFilters':\n return {\n ...state,\n includeFilters: action.payload,\n chatFilter: '',\n };\n case 'setExcludeFilters':\n return {\n ...state,\n excludeFilters: action.payload,\n chatFilter: '',\n };\n case 'saveFilters':\n if (state.includeFilters) {\n return {\n ...state,\n folder: {\n ...omit(state.folder, INCLUDE_FILTER_FIELDS),\n title: state.folder.title ? state.folder.title : getSuggestedFolderName(state.includeFilters),\n ...state.includeFilters,\n },\n includeFilters: undefined,\n chatFilter: '',\n isTouched: true,\n };\n } else if (state.excludeFilters) {\n return {\n ...state,\n folder: {\n ...omit(state.folder, EXCLUDE_FILTER_FIELDS),\n ...state.excludeFilters,\n },\n excludeFilters: undefined,\n chatFilter: '',\n isTouched: true,\n };\n } else {\n return state;\n }\n case 'editFolder': {\n const { id: folderId, description, ...folder } = action.payload;\n\n return {\n mode: 'edit',\n folderId,\n folder,\n chatFilter: '',\n };\n }\n case 'setChatFilter': {\n return {\n ...state,\n chatFilter: action.payload,\n };\n }\n case 'setIsLoading': {\n return {\n ...state,\n isLoading: action.payload,\n };\n }\n case 'setError': {\n return {\n ...state,\n error: action.payload,\n };\n }\n case 'reset':\n return INITIAL_STATE;\n default:\n return state;\n }\n};\n\nexport default () => {\n return useReducer(foldersReducer, INITIAL_STATE);\n};\n","import {\n useCallback, useEffect, useRef, useState,\n} from '../lib/teact/teact';\n\nimport { register } from '../util/audioPlayer';\nimport useEffectWithPrevDeps from './useEffectWithPrevDeps';\nimport { isSafariPatchInProgress } from '../util/patchSafariProgressiveAudio';\nimport useOnChange from './useOnChange';\n\ntype Handler = (e: Event) => void;\n\nexport default (\n trackId: string,\n originalDuration: number, // Sometimes incorrect for voice messages\n src?: string,\n handlers?: Record,\n onInit?: (element: HTMLAudioElement) => void,\n shouldPlay = false,\n onForcePlay?: NoneToVoidFunction,\n noPlaylist = false,\n) => {\n // eslint-disable-next-line no-null/no-null\n const controllerRef = useRef>(null);\n\n const [isPlaying, setIsPlaying] = useState(false);\n let isPlayingSync = isPlaying;\n\n const [playProgress, setPlayProgress] = useState(0);\n\n useOnChange(() => {\n controllerRef.current = register(trackId, (eventName, e) => {\n switch (eventName) {\n case 'onPlay':\n setIsPlaying(true);\n break;\n case 'onPause':\n setIsPlaying(false);\n break;\n case 'onTimeUpdate': {\n const { proxy } = controllerRef.current!;\n const duration = proxy.duration && Number.isFinite(proxy.duration) ? proxy.duration : originalDuration;\n setPlayProgress(proxy.currentTime / duration);\n break;\n }\n }\n\n handlers?.[eventName]?.(e);\n }, onForcePlay);\n\n const { proxy } = controllerRef.current!;\n\n if (!isPlaying && !proxy.paused) {\n setIsPlaying(true);\n isPlayingSync = true;\n }\n\n if (onInit) {\n onInit(proxy);\n }\n }, [trackId]);\n\n const {\n play, pause, setCurrentTime, proxy, destroy,\n } = controllerRef.current!;\n const duration = proxy.duration && Number.isFinite(proxy.duration) ? proxy.duration : originalDuration;\n\n // RAF progress\n useEffect(() => {\n if (duration && !isSafariPatchInProgress(proxy)) {\n setPlayProgress(proxy.currentTime / duration);\n }\n }, [duration, playProgress, proxy]);\n\n // Cleanup\n useEffect(() => () => {\n destroy(noPlaylist);\n }, [destroy, noPlaylist]);\n\n // Autoplay once `src` is present\n useEffectWithPrevDeps(([prevShouldPlay, prevSrc]) => {\n if (prevShouldPlay === shouldPlay && src === prevSrc) {\n return;\n }\n\n // When paused by another player\n if (proxy.src && proxy.paused) {\n return;\n }\n\n if (shouldPlay && src && !isPlaying) {\n play(src);\n }\n }, [shouldPlay, src, isPlaying, play, proxy.src, proxy.paused]);\n\n const playPause = useCallback(() => {\n if (isPlaying) {\n pause();\n } else if (src) {\n play(src);\n }\n }, [src, pause, play, isPlaying]);\n\n return {\n isPlaying: isPlayingSync,\n playProgress,\n playPause,\n setCurrentTime,\n audioProxy: proxy,\n duration,\n };\n};\n","import { useEffect } from '../lib/teact/teact';\n\nexport default function useBackgroundMode(\n onBlur?: AnyToVoidFunction,\n onFocus?: AnyToVoidFunction,\n) {\n useEffect(() => {\n if (onBlur && !document.hasFocus()) {\n onBlur();\n }\n\n if (onBlur) {\n window.addEventListener('blur', onBlur);\n }\n\n if (onFocus) {\n window.addEventListener('focus', onFocus);\n }\n\n return () => {\n if (onFocus) {\n window.removeEventListener('focus', onFocus);\n }\n\n if (onBlur) {\n window.removeEventListener('blur', onBlur);\n }\n };\n }, [onBlur, onFocus]);\n}\n","import { useEffect, useRef } from '../lib/teact/teact';\n\nimport fastBlur from '../lib/fastBlur';\nimport { imgToCanvas } from '../util/files';\nimport useForceUpdate from './useForceUpdate';\n\nconst RADIUS = 2;\nconst ITERATIONS = 2;\nconst MAX_CACHE_SIZE = 1000;\n\nconst cache = new Map();\n\nexport default function useBlur(dataUri?: string, isDisabled = false, delay?: number) {\n const blurredRef = useRef(dataUri ? cache.get(dataUri) : undefined);\n const timeoutRef = useRef();\n const forceUpdate = useForceUpdate();\n\n if (timeoutRef.current && isDisabled) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n\n useEffect(() => {\n if (!dataUri || blurredRef.current || isDisabled) {\n return;\n }\n\n const img = new Image();\n\n img.onload = () => {\n const canvas = imgToCanvas(img);\n fastBlur(canvas.getContext('2d'), 0, 0, canvas.width, canvas.height, RADIUS, ITERATIONS);\n const blurredDataUri = canvas.toDataURL();\n\n blurredRef.current = blurredDataUri;\n forceUpdate();\n\n if (cache.size >= MAX_CACHE_SIZE) {\n cache.clear();\n }\n cache.set(dataUri, blurredDataUri);\n };\n\n if (delay) {\n timeoutRef.current = window.setTimeout(() => {\n img.src = dataUri;\n }, delay);\n } else {\n img.src = dataUri;\n }\n }, [dataUri, delay, forceUpdate, isDisabled]);\n\n return blurredRef.current;\n}\n","import { useRef } from '../lib/teact/teact';\n\nimport fastBlur from '../lib/fastBlur';\nimport useOnChange from './useOnChange';\nimport useBlur from './useBlur';\nimport { imgToCanvas } from '../util/files';\n\nconst RADIUS = 2;\nconst ITERATIONS = 2;\n\nexport default function useBlurSync(dataUri: string | false | undefined) {\n const blurredRef = useRef();\n\n let isChanged = false;\n\n useOnChange(() => {\n isChanged = true;\n\n blurredRef.current = undefined;\n\n if (!dataUri) {\n return;\n }\n\n const img = new Image();\n img.src = dataUri;\n if (!img.width) {\n return;\n }\n\n const canvas = imgToCanvas(img);\n fastBlur(canvas.getContext('2d'), 0, 0, canvas.width, canvas.height, RADIUS, ITERATIONS);\n\n blurredRef.current = canvas.toDataURL();\n }, [dataUri]);\n\n // Sometimes `Image` do not manage to load synchronously,\n // so we fall back the non-blurred variant and prepare the async one at least for the next time\n const blurredAsync = useBlur(dataUri || undefined, Boolean(blurredRef.current));\n\n return blurredRef.current || (!isChanged && blurredAsync) || dataUri || undefined;\n}\n","import React, { useCallback, useMemo, useState } from '../lib/teact/teact';\nimport { debounce } from '../util/schedulers';\nimport { isSafariPatchInProgress } from '../util/patchSafariProgressiveAudio';\n\ntype BufferingEvent = (e: Event | React.SyntheticEvent) => void;\n\nconst MIN_READY_STATE = 3;\n// Avoid flickering when re-mounting previously buffered video\nconst DEBOUNCE = 200;\n\nexport default (noInitiallyBuffered = false) => {\n const [isBuffered, setIsBuffered] = useState(!noInitiallyBuffered);\n const [bufferedProgress, setBufferedProgress] = useState(0);\n\n const setIsBufferedDebounced = useMemo(() => {\n return debounce(setIsBuffered, DEBOUNCE, false, true);\n }, []);\n\n const handleBuffering = useCallback((e) => {\n const media = e.currentTarget as HTMLMediaElement;\n\n if (!isSafariPatchInProgress(media)) {\n if (media.buffered.length) {\n setBufferedProgress(media.buffered.end(0) / media.duration);\n }\n\n setIsBufferedDebounced(media.readyState >= MIN_READY_STATE || media.currentTime > 0);\n }\n }, [setIsBufferedDebounced]);\n\n const bufferingHandlers = {\n onLoadedData: handleBuffering,\n onPlaying: handleBuffering,\n onLoadStart: handleBuffering, // Needed for Safari to start\n onPause: handleBuffering, // Needed for Chrome when seeking\n onTimeUpdate: handleBuffering, // Needed for audio buffering progress\n onProgress: handleBuffering, // Needed for video buffering progress\n };\n\n return {\n isBuffered,\n bufferedProgress,\n bufferingHandlers,\n checkBuffering(element: HTMLMediaElement) {\n setIsBufferedDebounced(element.readyState >= MIN_READY_STATE);\n },\n };\n};\n","import { useEffect, useRef } from '../lib/teact/teact';\n\nimport fastBlur from '../lib/fastBlur';\nimport useForceUpdate from './useForceUpdate';\nimport { IS_CANVAS_FILTER_SUPPORTED } from '../util/environment';\n\nconst RADIUS = 2;\nconst ITERATIONS = 2;\n\nexport default function useCanvasBlur(dataUri?: string, isDisabled = false, withRaf?: boolean) {\n // eslint-disable-next-line no-null/no-null\n const canvasRef = useRef(null);\n const forceUpdate = useForceUpdate();\n\n useEffect(() => {\n const canvas = canvasRef.current;\n\n if (!dataUri || !canvas || isDisabled) {\n return;\n }\n\n const img = new Image();\n\n const processBlur = () => {\n canvas.width = img.width;\n canvas.height = img.height;\n\n const ctx = canvas.getContext('2d', { alpha: false })!;\n\n if (IS_CANVAS_FILTER_SUPPORTED) {\n ctx.filter = `blur(${RADIUS}px)`;\n }\n\n ctx.drawImage(img, -RADIUS * 2, -RADIUS * 2, canvas.width + RADIUS * 4, canvas.height + RADIUS * 4);\n\n if (!IS_CANVAS_FILTER_SUPPORTED) {\n fastBlur(ctx, 0, 0, canvas.width, canvas.height, RADIUS, ITERATIONS);\n }\n };\n\n img.onload = () => {\n if (withRaf) {\n requestAnimationFrame(processBlur);\n } else {\n processBlur();\n }\n };\n\n img.src = dataUri;\n }, [canvasRef, dataUri, forceUpdate, isDisabled, withRaf]);\n\n return canvasRef;\n}\n","import { useMemo } from '../lib/teact/teact';\nimport { getDispatch } from '../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../api/types';\n\nimport {\n isChatArchived, getCanDeleteChat, isChatPrivate, isChatChannel,\n} from '../modules/helpers';\nimport useLang from './useLang';\n\nexport default ({\n chat,\n privateChatUser,\n handleDelete,\n folderId,\n isPinned,\n isMuted,\n}: {\n chat: ApiChat | undefined;\n privateChatUser: ApiUser | undefined;\n handleDelete: () => void;\n folderId?: number;\n isPinned?: boolean;\n isMuted?: boolean;\n}, isInSearch = false) => {\n const lang = useLang();\n\n return useMemo(() => {\n if (!chat) {\n return undefined;\n }\n\n const {\n toggleChatPinned,\n updateChatMutedState,\n toggleChatArchived,\n toggleChatUnread,\n } = getDispatch();\n\n const actionPin = isPinned\n ? {\n title: lang('UnpinFromTop'),\n icon: 'unpin',\n handler: () => toggleChatPinned({ id: chat.id, folderId }),\n }\n : { title: lang('PinToTop'), icon: 'pin', handler: () => toggleChatPinned({ id: chat.id, folderId }) };\n\n if (isInSearch) {\n return [actionPin];\n }\n\n const actionUnreadMark = chat.unreadCount || chat.hasUnreadMark\n ? { title: lang('MarkAsRead'), icon: 'readchats', handler: () => toggleChatUnread({ id: chat.id }) }\n : { title: lang('MarkAsUnread'), icon: 'unread', handler: () => toggleChatUnread({ id: chat.id }) };\n\n const actionMute = isMuted\n ? {\n title: lang('ChatList.Unmute'),\n icon: 'unmute',\n handler: () => updateChatMutedState({ chatId: chat.id, isMuted: false }),\n }\n : {\n title: lang('ChatList.Mute'),\n icon: 'mute',\n handler: () => updateChatMutedState({ chatId: chat.id, isMuted: true }),\n };\n\n const actionArchive = isChatArchived(chat)\n ? { title: lang('Unarchive'), icon: 'unarchive', handler: () => toggleChatArchived({ id: chat.id }) }\n : { title: lang('Archive'), icon: 'archive', handler: () => toggleChatArchived({ id: chat.id }) };\n\n const actionDelete = {\n title: isChatPrivate(chat.id)\n ? lang('Delete')\n : lang(getCanDeleteChat(chat)\n ? 'DeleteChat'\n : (isChatChannel(chat) ? 'LeaveChannel' : 'Group.LeaveGroup')),\n icon: 'delete',\n destructive: true,\n handler: handleDelete,\n };\n\n return [\n actionUnreadMark,\n actionPin,\n ...(!privateChatUser?.isSelf ? [\n actionMute,\n actionArchive,\n ] : []),\n actionDelete,\n ];\n }, [chat, isPinned, lang, isInSearch, isMuted, handleDelete, privateChatUser?.isSelf, folderId]);\n};\n","import { RefObject } from 'react';\nimport { useState, useEffect, useCallback } from '../lib/teact/teact';\n\nimport { IAnchorPosition } from '../types';\nimport { IS_TOUCH_ENV, IS_SINGLE_COLUMN_LAYOUT } from '../util/environment';\n\nconst LONG_TAP_DURATION_MS = 200;\n\nfunction checkIsDisabledForMobile() {\n return IS_SINGLE_COLUMN_LAYOUT\n && window.document.body.classList.contains('enable-symbol-menu-transforms');\n}\n\nexport default (\n elementRef: RefObject,\n isMenuDisabled?: boolean,\n shouldDisableOnLink?: boolean,\n shouldDisableOnLongTap?: boolean,\n) => {\n const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);\n const [contextMenuPosition, setContextMenuPosition] = useState(undefined);\n\n const handleBeforeContextMenu = useCallback((e: React.MouseEvent) => {\n if (!isMenuDisabled && e.button === 2) {\n document.body.classList.add('no-selection');\n }\n }, [isMenuDisabled]);\n\n const handleContextMenu = useCallback((e: React.MouseEvent) => {\n document.body.classList.remove('no-selection');\n\n if (isMenuDisabled || (shouldDisableOnLink && (e.target as HTMLElement).matches('a[href]'))) {\n return;\n }\n e.preventDefault();\n\n if (contextMenuPosition) {\n return;\n }\n\n setIsContextMenuOpen(true);\n setContextMenuPosition({ x: e.clientX, y: e.clientY });\n }, [isMenuDisabled, shouldDisableOnLink, contextMenuPosition]);\n\n const handleContextMenuClose = useCallback(() => {\n setIsContextMenuOpen(false);\n }, []);\n\n const handleContextMenuHide = useCallback(() => {\n setContextMenuPosition(undefined);\n document.body.classList.remove('no-selection');\n }, []);\n\n // Support context menu on touch-devices\n useEffect(() => {\n if (isMenuDisabled || !IS_TOUCH_ENV || shouldDisableOnLongTap) {\n return undefined;\n }\n\n const element = elementRef.current;\n if (!element) {\n return undefined;\n }\n\n let timer: number | undefined;\n\n const clearLongPressTimer = () => {\n if (timer) {\n clearTimeout(timer);\n timer = undefined;\n }\n };\n\n const emulateContextMenuEvent = (originalEvent: TouchEvent) => {\n clearLongPressTimer();\n\n const { clientX, clientY, target } = originalEvent.touches[0];\n\n if (contextMenuPosition || (shouldDisableOnLink && (target as HTMLElement).matches('a[href]'))) {\n return;\n }\n\n // temporarily intercept and clear the next click\n element.addEventListener('touchend', function cancelClickOnce(e) {\n element.removeEventListener('touchend', cancelClickOnce, true);\n e.stopImmediatePropagation();\n e.preventDefault();\n e.stopPropagation();\n }, true);\n\n document.body.classList.add('no-selection');\n setIsContextMenuOpen(true);\n setContextMenuPosition({ x: clientX, y: clientY });\n };\n\n const startLongPressTimer = (e: TouchEvent) => {\n if (isMenuDisabled || checkIsDisabledForMobile()) {\n return;\n }\n clearLongPressTimer();\n\n timer = window.setTimeout(() => emulateContextMenuEvent(e), LONG_TAP_DURATION_MS);\n };\n\n // @perf Consider event delegation\n element.addEventListener('touchstart', startLongPressTimer, { passive: true });\n element.addEventListener('touchcancel', clearLongPressTimer, true);\n element.addEventListener('touchend', clearLongPressTimer, true);\n element.addEventListener('touchmove', clearLongPressTimer, { passive: true });\n\n return () => {\n clearLongPressTimer();\n element.removeEventListener('touchstart', startLongPressTimer);\n element.removeEventListener('touchcancel', clearLongPressTimer, true);\n element.removeEventListener('touchend', clearLongPressTimer, true);\n element.removeEventListener('touchmove', clearLongPressTimer);\n };\n }, [contextMenuPosition, isMenuDisabled, shouldDisableOnLongTap, elementRef, shouldDisableOnLink]);\n\n return {\n isContextMenuOpen,\n contextMenuPosition,\n handleBeforeContextMenu,\n handleContextMenu,\n handleContextMenuClose,\n handleContextMenuHide,\n };\n};\n","import { useState, useEffect } from '../lib/teact/teact';\nimport { IAnchorPosition } from '../types';\n\nconst MENU_POSITION_VISUAL_COMFORT_SPACE_PX = 16;\n\nexport default (\n anchor: IAnchorPosition | undefined,\n getTriggerElement: () => HTMLElement | null,\n getRootElement: () => HTMLElement | null,\n getMenuElement: () => HTMLElement | null,\n extraPaddingX = 0,\n extraTopPadding = 0,\n) => {\n const [positionX, setPositionX] = useState<'right' | 'left'>('right');\n const [positionY, setPositionY] = useState<'top' | 'bottom'>('bottom');\n const [style, setStyle] = useState('');\n\n useEffect(() => {\n const triggerEl = getTriggerElement();\n if (!anchor || !triggerEl) {\n return;\n }\n\n let { x, y } = anchor;\n const emptyRect = {\n width: 0, left: 0, height: 0, top: 0,\n };\n\n const menuEl = getMenuElement();\n const rootEl = getRootElement();\n\n const triggerRect = triggerEl.getBoundingClientRect();\n const menuRect = menuEl ? { width: menuEl.offsetWidth, height: menuEl.offsetHeight } : emptyRect;\n const rootRect = rootEl ? rootEl.getBoundingClientRect() : emptyRect;\n\n let horizontalPostition: 'left' | 'right';\n if (x + menuRect.width + extraPaddingX < rootRect.width + rootRect.left) {\n x += 3;\n horizontalPostition = 'left';\n } else if (x - menuRect.width > 0) {\n horizontalPostition = 'right';\n x -= 3;\n } else {\n horizontalPostition = 'left';\n x = 16;\n }\n setPositionX(horizontalPostition);\n\n if (y + menuRect.height < rootRect.height + rootRect.top) {\n setPositionY('top');\n } else {\n setPositionY('bottom');\n\n if (y - menuRect.height < rootRect.top + extraTopPadding) {\n y = rootRect.top + extraTopPadding + menuRect.height;\n }\n }\n\n const left = horizontalPostition === 'left'\n ? Math.min(x - triggerRect.left, rootRect.width - menuRect.width - MENU_POSITION_VISUAL_COMFORT_SPACE_PX)\n : Math.max((x - triggerRect.left), menuRect.width + MENU_POSITION_VISUAL_COMFORT_SPACE_PX);\n\n setStyle(`left: ${left}px; top: ${y - triggerRect.top}px;`);\n }, [\n anchor, extraPaddingX, extraTopPadding,\n getMenuElement, getRootElement, getTriggerElement,\n ]);\n\n return {\n positionX,\n positionY,\n style,\n };\n};\n","import usePrevious from './usePrevious';\n\nexport default function useCurrentOrPrev(\n current: T, shouldSkipUndefined = false, shouldForceCurrent = false,\n): T | undefined {\n const prev = usePrevious(current, shouldSkipUndefined);\n\n // eslint-disable-next-line no-null/no-null\n return shouldForceCurrent || (current !== null && current !== undefined) ? current : prev;\n}\n","import { useEffect, useMemo } from '../lib/teact/teact';\nimport { getDispatch } from '../lib/teact/teactn';\n\nimport { ApiMessage } from '../api/types';\n\nimport { throttle } from '../util/schedulers';\n\nexport default (\n chatId: number,\n messageId?: number,\n message?: ApiMessage,\n replyOriginForId?: number,\n) => {\n const { loadMessage } = getDispatch();\n const loadMessageThrottled = useMemo(() => {\n const throttled = throttle(loadMessage, 500, true);\n return () => {\n throttled({ chatId, messageId, replyOriginForId });\n };\n }, [loadMessage, chatId, messageId, replyOriginForId]);\n\n useEffect(() => {\n if (messageId && !message) {\n loadMessageThrottled();\n }\n });\n};\n","import { useEffect } from '../lib/teact/teact';\n\nexport default (container: HTMLElement | null, isDisabled?: boolean) => {\n useEffect(() => {\n if (!container) {\n return undefined;\n }\n\n function handleScroll(e: WheelEvent) {\n // Ignore horizontal scroll and let it work natively (e.g. on touchpad)\n if (!e.deltaX) {\n container!.scrollLeft += e.deltaY / 4;\n }\n }\n\n container.addEventListener('wheel', handleScroll, { passive: true });\n\n return () => {\n container.removeEventListener('wheel', handleScroll);\n };\n }, [container, isDisabled]);\n};\n","import { useCallback, useEffect, useRef } from '../lib/teact/teact';\nimport { LoadMoreDirection } from '../types';\n\nimport { areSortedArraysEqual } from '../util/iteratees';\nimport useForceUpdate from './useForceUpdate';\nimport usePrevious from './usePrevious';\n\ntype GetMore = (args: { direction: LoadMoreDirection }) => void;\ntype LoadMoreBackwards = (args: { offsetId?: number }) => void;\n\nconst DEFAULT_LIST_SLICE = 30;\n\nexport default (\n loadMoreBackwards?: LoadMoreBackwards,\n listIds?: number[],\n isDisabled = false,\n listSlice = DEFAULT_LIST_SLICE,\n forceFullPreload = false,\n): [number[]?, GetMore?] => {\n const lastParamsRef = useRef<{\n direction?: LoadMoreDirection;\n offsetId?: number;\n }>();\n\n const viewportIdsRef = useRef((() => {\n // Only run once to initialize\n if (!listIds || lastParamsRef.current) {\n return undefined;\n }\n\n const { newViewportIds } = getViewportSlice(listIds, listIds[0], LoadMoreDirection.Forwards, listSlice);\n return newViewportIds;\n })());\n\n const forceUpdate = useForceUpdate();\n\n const prevListIds = usePrevious(listIds);\n const prevIsDisabled = usePrevious(isDisabled);\n if (listIds && !isDisabled && (listIds !== prevListIds || isDisabled !== prevIsDisabled)) {\n const { offsetId = listIds[0], direction = LoadMoreDirection.Forwards } = lastParamsRef.current || {};\n const { newViewportIds } = getViewportSlice(listIds, offsetId, direction, listSlice);\n\n if (!viewportIdsRef.current || !areSortedArraysEqual(viewportIdsRef.current, newViewportIds)) {\n viewportIdsRef.current = newViewportIds;\n }\n }\n\n useEffect(() => {\n if (listIds && !isDisabled && loadMoreBackwards && forceFullPreload) {\n const viewportIds = viewportIdsRef.current!;\n loadMoreBackwards({ offsetId: viewportIds[viewportIds.length - 1] });\n }\n }, [listIds, isDisabled, loadMoreBackwards, forceFullPreload]);\n\n const getMore: GetMore = useCallback(({\n direction,\n noScroll,\n }: { direction: LoadMoreDirection; noScroll?: boolean }) => {\n const viewportIds = viewportIdsRef.current;\n\n const offsetId = viewportIds\n ? direction === LoadMoreDirection.Backwards ? viewportIds[viewportIds.length - 1] : viewportIds[0]\n : undefined;\n\n if (!listIds) {\n if (loadMoreBackwards) {\n loadMoreBackwards({ offsetId });\n }\n\n return;\n }\n\n if (!noScroll) {\n lastParamsRef.current = { ...lastParamsRef.current, direction, offsetId };\n }\n\n const {\n newViewportIds, areSomeLocal, areAllLocal,\n } = getViewportSlice(listIds, offsetId, direction, listSlice);\n\n if (areSomeLocal && !(viewportIds && areSortedArraysEqual(viewportIds, newViewportIds))) {\n viewportIdsRef.current = newViewportIds;\n forceUpdate();\n }\n\n if (!areAllLocal && loadMoreBackwards) {\n loadMoreBackwards({ offsetId });\n }\n }, [listIds, listSlice, loadMoreBackwards, forceUpdate]);\n\n return isDisabled ? [listIds] : [viewportIdsRef.current, getMore];\n};\n\nfunction getViewportSlice(\n sourceIds: number[],\n offsetId = 0,\n direction: LoadMoreDirection,\n listSlice: number,\n) {\n const { length } = sourceIds;\n const index = sourceIds.indexOf(offsetId);\n const isForwards = direction === LoadMoreDirection.Forwards;\n const indexForDirection = isForwards ? index : (index + 1) || length;\n const from = Math.max(0, indexForDirection - listSlice);\n const to = indexForDirection + listSlice - 1;\n const newViewportIds = sourceIds.slice(Math.max(0, from), to + 1);\n\n let areSomeLocal;\n let areAllLocal;\n switch (direction) {\n case LoadMoreDirection.Forwards:\n areSomeLocal = indexForDirection > 0;\n areAllLocal = from >= 0;\n break;\n case LoadMoreDirection.Backwards:\n areSomeLocal = indexForDirection < length;\n areAllLocal = to <= length - 1;\n break;\n }\n\n return { newViewportIds, areSomeLocal, areAllLocal };\n}\n","import { RefObject } from 'react';\nimport {\n useEffect, useRef, useCallback, useState,\n} from '../lib/teact/teact';\n\nimport { throttle, debounce } from '../util/schedulers';\nimport useHeavyAnimationCheck from './useHeavyAnimationCheck';\n\ntype TargetCallback = (entry: IntersectionObserverEntry) => void;\ntype RootCallback = (entries: IntersectionObserverEntry[]) => void;\ntype ObserveCleanup = NoneToVoidFunction;\nexport type ObserveFn = (target: HTMLElement, targetCallback?: TargetCallback) => ObserveCleanup;\n\ninterface IntersectionController {\n observer: IntersectionObserver;\n callbacks: Map;\n}\n\ninterface Response {\n observe: ObserveFn;\n freeze: NoneToVoidFunction;\n unfreeze: NoneToVoidFunction;\n}\n\nconst AUTO_UNFREEZE_TIMEOUT = 2000;\n\nexport function useIntersectionObserver({\n rootRef,\n throttleMs,\n debounceMs,\n shouldSkipFirst,\n margin,\n threshold,\n isDisabled,\n}: {\n rootRef: RefObject;\n throttleMs?: number;\n debounceMs?: number;\n shouldSkipFirst?: boolean;\n margin?: number;\n threshold?: number | number[];\n isDisabled?: boolean;\n}, rootCallback?: RootCallback): Response {\n const controllerRef = useRef();\n const rootCallbackRef = useRef();\n const freezeFlagsRef = useRef(0);\n const autoUnfreezeTimeoutRef = useRef();\n const onUnfreezeRef = useRef();\n\n rootCallbackRef.current = rootCallback;\n\n const unfreeze = useCallback(() => {\n if (!freezeFlagsRef.current) {\n return;\n }\n\n freezeFlagsRef.current--;\n\n if (!freezeFlagsRef.current && onUnfreezeRef.current) {\n onUnfreezeRef.current();\n onUnfreezeRef.current = undefined;\n }\n }, []);\n\n const freeze = useCallback(() => {\n freezeFlagsRef.current++;\n\n if (autoUnfreezeTimeoutRef.current) {\n clearTimeout(autoUnfreezeTimeoutRef.current);\n autoUnfreezeTimeoutRef.current = undefined;\n }\n\n // Make sure to unfreeze even if unfreeze callback was not called (which was some hardly-reproducible bug)\n autoUnfreezeTimeoutRef.current = window.setTimeout(() => {\n autoUnfreezeTimeoutRef.current = undefined;\n\n if (!freezeFlagsRef.current) {\n return;\n }\n\n freezeFlagsRef.current = 1;\n unfreeze();\n }, AUTO_UNFREEZE_TIMEOUT);\n }, [unfreeze]);\n\n useHeavyAnimationCheck(freeze, unfreeze);\n\n useEffect(() => {\n if (isDisabled) {\n return undefined;\n }\n\n return () => {\n if (controllerRef.current) {\n controllerRef.current.observer.disconnect();\n controllerRef.current.callbacks.clear();\n controllerRef.current = undefined;\n }\n };\n }, [isDisabled]);\n\n function initController() {\n const callbacks = new Map();\n const entriesAccumulator = new Map();\n const observerCallbackSync = () => {\n const entries = Array.from(entriesAccumulator.values());\n\n entries.forEach((entry: IntersectionObserverEntry) => {\n const callback = callbacks.get(entry.target);\n if (callback) {\n callback!(entry, entries);\n }\n });\n\n if (rootCallbackRef.current) {\n rootCallbackRef.current(entries);\n }\n\n entriesAccumulator.clear();\n };\n const scheduler = throttleMs ? throttle : debounceMs ? debounce : undefined;\n const observerCallback = scheduler\n ? scheduler(observerCallbackSync, (throttleMs || debounceMs)!, !shouldSkipFirst)\n : observerCallbackSync;\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n entriesAccumulator.set(entry.target, entry);\n });\n\n if (freezeFlagsRef.current) {\n onUnfreezeRef.current = () => {\n observerCallback();\n };\n } else {\n observerCallback();\n }\n },\n {\n root: rootRef.current,\n rootMargin: margin ? `${margin}px` : undefined,\n threshold,\n },\n );\n\n controllerRef.current = { observer, callbacks };\n }\n\n const observe = useCallback((target, targetCallback) => {\n if (!controllerRef.current) {\n initController();\n }\n\n const controller = controllerRef.current!;\n controller.observer.observe(target);\n\n if (targetCallback) {\n controller.callbacks.set(target, targetCallback);\n }\n\n return () => {\n if (targetCallback) {\n controller.callbacks.delete(target);\n }\n\n controller.observer.unobserve(target);\n };\n // Arguments should never change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isDisabled]);\n\n return { observe, freeze, unfreeze };\n}\n\nexport function useOnIntersect(\n targetRef: RefObject, observe?: ObserveFn, callback?: TargetCallback,\n) {\n useEffect(() => {\n return observe ? observe(targetRef.current!, callback) : undefined;\n // Arguments should never change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n}\n\nexport function useIsIntersecting(\n targetRef: RefObject, observe?: ObserveFn, callback?: TargetCallback,\n) {\n const [isIntersecting, setIsIntersecting] = useState(!observe);\n\n useOnIntersect(targetRef, observe, (entry) => {\n setIsIntersecting(entry.isIntersecting);\n\n if (callback) {\n callback(entry);\n }\n });\n\n return isIntersecting;\n}\n","import { useLayoutEffect } from '../lib/teact/teact';\nimport usePrevious from './usePrevious';\n\nexport default (cb: (args: PT) => void, dependencies: T, debugKey?: string) => {\n const prevDeps = usePrevious(dependencies);\n return useLayoutEffect(() => {\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n return cb(prevDeps || []);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies, debugKey);\n};\n","import { useEffect } from '../lib/teact/teact';\n\nimport { ApiMediaFormat } from '../api/types';\n\nimport * as mediaLoader from '../util/mediaLoader';\nimport useForceUpdate from './useForceUpdate';\n\nexport default (\n mediaHash: string | false | undefined,\n noLoad = false,\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n mediaFormat: T = ApiMediaFormat.BlobUrl,\n cacheBuster?: number,\n delay?: number | false,\n) => {\n const mediaData = mediaHash ? mediaLoader.getFromMemory(mediaHash) : undefined;\n const forceUpdate = useForceUpdate();\n\n useEffect(() => {\n if (!noLoad && mediaHash && !mediaData) {\n const startedAt = Date.now();\n\n mediaLoader.fetch(mediaHash, mediaFormat).then(() => {\n const spentTime = Date.now() - startedAt;\n if (!delay || spentTime >= delay) {\n forceUpdate();\n } else {\n setTimeout(forceUpdate, delay - spentTime);\n }\n });\n }\n }, [noLoad, mediaHash, mediaData, mediaFormat, cacheBuster, forceUpdate, delay]);\n\n return mediaData;\n};\n","import React, { useCallback, useEffect, useState } from '../lib/teact/teact';\n\nimport useMediaWithDownloadProgress from './useMediaWithDownloadProgress';\nimport download from '../util/download';\n\nexport default function useMediaDownload(\n mediaHash?: string,\n fileName?: string,\n) {\n const [isDownloadStarted, setIsDownloadStarted] = useState(false);\n\n const { mediaData, downloadProgress } = useMediaWithDownloadProgress(mediaHash, !isDownloadStarted);\n\n // Download with browser when fully loaded\n useEffect(() => {\n if (isDownloadStarted && mediaData) {\n download(mediaData, fileName!);\n setIsDownloadStarted(false);\n }\n }, [fileName, mediaData, isDownloadStarted]);\n\n // Cancel download on source change\n useEffect(() => {\n setIsDownloadStarted(false);\n }, [mediaHash]);\n\n const handleDownloadClick = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n setIsDownloadStarted((isAllowed) => !isAllowed);\n }, []);\n\n return {\n isDownloadStarted,\n downloadProgress,\n handleDownloadClick,\n };\n}\n","import {\n useEffect, useMemo, useRef, useState,\n} from '../lib/teact/teact';\n\nimport { IS_PROGRESSIVE_SUPPORTED } from '../util/environment';\nimport { ApiMediaFormat } from '../api/types';\nimport { throttle } from '../util/schedulers';\nimport * as mediaLoader from '../util/mediaLoader';\nimport useForceUpdate from './useForceUpdate';\n\nconst STREAMING_PROGRESS = 0.75;\nconst STREAMING_TIMEOUT = 1500;\nconst PROGRESS_THROTTLE = 500;\n\nexport default (\n mediaHash: string | undefined,\n noLoad = false,\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n mediaFormat: T = ApiMediaFormat.BlobUrl,\n cacheBuster?: number,\n delay?: number | false,\n isHtmlAllowed = false,\n) => {\n const mediaData = mediaHash ? mediaLoader.getFromMemory(mediaHash) : undefined;\n const isStreaming = mediaFormat === ApiMediaFormat.Stream || (\n IS_PROGRESSIVE_SUPPORTED && mediaFormat === ApiMediaFormat.Progressive\n );\n const forceUpdate = useForceUpdate();\n const [downloadProgress, setDownloadProgress] = useState(mediaData && !isStreaming ? 1 : 0);\n const startedAtRef = useRef();\n\n const handleProgress = useMemo(() => {\n return throttle((progress: number) => {\n if (!delay || (Date.now() - startedAtRef.current! > delay)) {\n setDownloadProgress(progress);\n }\n }, PROGRESS_THROTTLE, true);\n }, [delay]);\n\n useEffect(() => {\n if (!noLoad && mediaHash) {\n if (!mediaData) {\n setDownloadProgress(0);\n\n if (startedAtRef.current) {\n mediaLoader.cancelProgress(handleProgress);\n }\n\n startedAtRef.current = Date.now();\n\n mediaLoader.fetch(mediaHash, mediaFormat, isHtmlAllowed, handleProgress).then(() => {\n const spentTime = Date.now() - startedAtRef.current!;\n startedAtRef.current = undefined;\n\n if (!delay || spentTime >= delay) {\n forceUpdate();\n } else {\n setTimeout(forceUpdate, delay - spentTime);\n }\n });\n } else if (isStreaming) {\n setTimeout(() => {\n setDownloadProgress(STREAMING_PROGRESS);\n }, STREAMING_TIMEOUT);\n }\n }\n }, [\n noLoad, mediaHash, mediaData, mediaFormat, cacheBuster, forceUpdate, isStreaming, delay, handleProgress,\n isHtmlAllowed,\n ]);\n\n useEffect(() => {\n if (noLoad && startedAtRef.current) {\n mediaLoader.cancelProgress(handleProgress);\n setDownloadProgress(0);\n }\n }, [handleProgress, noLoad]);\n\n return { mediaData, downloadProgress };\n};\n","import { useCallback, useEffect, useRef } from '../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../util/environment';\n\nconst MENU_CLOSE_TIMEOUT = 250;\nlet closeTimeout: number | undefined;\n\nexport default function useMouseInside(\n isOpen: boolean, onClose: NoneToVoidFunction, menuCloseTimeout = MENU_CLOSE_TIMEOUT, isDisabled = false,\n) {\n const isMouseInside = useRef(true);\n\n useEffect(() => {\n if (isOpen) {\n isMouseInside.current = true;\n }\n }, [isOpen]);\n\n useEffect(() => {\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n\n if (isOpen && !IS_TOUCH_ENV && !isDisabled) {\n closeTimeout = window.setTimeout(() => {\n if (!isMouseInside.current) {\n onClose();\n }\n }, menuCloseTimeout * 2);\n }\n }, [isDisabled, isOpen, menuCloseTimeout, onClose]);\n\n const handleMouseEnter = useCallback(() => {\n isMouseInside.current = true;\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n isMouseInside.current = false;\n\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n }\n\n closeTimeout = window.setTimeout(() => {\n if (!isMouseInside.current) {\n onClose();\n }\n }, menuCloseTimeout);\n }, [menuCloseTimeout, onClose]);\n\n return [handleMouseEnter, handleMouseLeave];\n}\n","import { useRef } from '../lib/teact/teact';\n\nimport usePrevious from './usePrevious';\nimport useForceUpdate from './useForceUpdate';\nimport useOnChange from './useOnChange';\n\nexport default function usePrevDuringAnimation(current: any, duration?: number) {\n const prev = usePrevious(current, true);\n const timeoutRef = useRef();\n const forceUpdate = useForceUpdate();\n // eslint-disable-next-line no-null/no-null\n const isCurrentPresent = current !== undefined && current !== null;\n // eslint-disable-next-line no-null/no-null\n const isPrevPresent = prev !== undefined && prev !== null;\n\n if (isCurrentPresent && timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n\n useOnChange(() => {\n // When `current` becomes empty\n if (duration && !isCurrentPresent && isPrevPresent && !timeoutRef.current) {\n timeoutRef.current = window.setTimeout(() => {\n timeoutRef.current = undefined;\n forceUpdate();\n }, duration);\n }\n }, [current]);\n\n return !timeoutRef.current || !duration || isCurrentPresent ? current : prev;\n}\n","import { useState, useCallback, useRef } from '../lib/teact/teact';\n\nexport type ReducerAction = { type: Actions; payload?: any };\nexport type StateReducer = (state: State, action: ReducerAction) => State;\nexport type Dispatch = (action: ReducerAction) => void;\n\nexport default function useReducer(\n reducer: StateReducer,\n initialState: State,\n) {\n const reducerRef = useRef(reducer);\n const [state, setState] = useState(initialState);\n\n const dispatch = useCallback((action: ReducerAction) => {\n setState((currentState) => reducerRef.current(currentState, action));\n }, []);\n\n return [\n state,\n dispatch,\n ] as [State, Dispatch];\n}\n","import { useEffect, useRef, useState } from '../lib/teact/teact';\n\nimport useShowTransition from './useShowTransition';\n\nconst SPEED = {\n fast: 200,\n slow: 350,\n};\n\nexport default (mediaData?: any, speed: keyof typeof SPEED = 'fast', noAnimate = false) => {\n const isMediaLoaded = Boolean(mediaData);\n const willAnimate = !useRef(isMediaLoaded).current && !noAnimate;\n const [shouldRenderThumb, setShouldRenderThumb] = useState(!isMediaLoaded);\n\n const {\n shouldRender: shouldRenderFullMedia,\n transitionClassNames,\n } = useShowTransition(isMediaLoaded, undefined, !willAnimate, speed);\n\n useEffect(() => {\n if (shouldRenderFullMedia) {\n if (willAnimate) {\n setTimeout(() => {\n setShouldRenderThumb(false);\n }, SPEED[speed]);\n } else {\n setShouldRenderThumb(false);\n }\n }\n }, [willAnimate, shouldRenderFullMedia, speed]);\n\n return {\n shouldRenderThumb,\n shouldRenderFullMedia,\n transitionClassNames,\n };\n};\n","import { RefObject } from 'react';\nimport { useEffect } from '../lib/teact/teact';\nimport { fastRaf } from '../util/schedulers';\n\n// Fix for memory leak when unmounting video element\nexport default function useVideoCleanup(videoRef: RefObject, dependencies: any[]) {\n useEffect(() => {\n const videoEl = videoRef.current;\n\n return () => {\n if (videoEl) {\n fastRaf(() => {\n videoEl.pause();\n videoEl.src = '';\n videoEl.load();\n });\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n}\n","/* eslint-disable no-nested-ternary */\n/* eslint-disable no-bitwise */\n/* eslint-disable no-multi-assign */\n/* eslint-disable no-cond-assign */\n/* eslint-disable no-param-reassign */\n/* eslint-disable prefer-const */\n/* eslint-disable eqeqeq */\n\n/*\nSuperfast Blur - a fast Box Blur For Canvas\n\nVersion: 0.5\nAuthor: Mario Klingemann\nContact: mario@quasimondo.com\nWebsite: http://www.quasimondo.com/BoxBlurForCanvas\nTwitter: @quasimondo\n\nIn case you find this class useful - especially in commercial projects -\nI am not totally unhappy for a small donation to my PayPal account\nmario@quasimondo.de\n\nOr support me on flattr:\nhttps://flattr.com/thing/140066/Superfast-Blur-a-pretty-fast-Box-Blur-Effect-for-CanvasJavascript\n\nCopyright (c) 2011 Mario Klingemann\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\n\n// eslint-disable-next-line max-len\nconst mul_table = [1, 57, 41, 21, 203, 34, 97, 73, 227, 91, 149, 62, 105, 45, 39, 137, 241, 107, 3, 173, 39, 71, 65, 238, 219, 101, 187, 87, 81, 151, 141, 133, 249, 117, 221, 209, 197, 187, 177, 169, 5, 153, 73, 139, 133, 127, 243, 233, 223, 107, 103, 99, 191, 23, 177, 171, 165, 159, 77, 149, 9, 139, 135, 131, 253, 245, 119, 231, 224, 109, 211, 103, 25, 195, 189, 23, 45, 175, 171, 83, 81, 79, 155, 151, 147, 9, 141, 137, 67, 131, 129, 251, 123, 30, 235, 115, 113, 221, 217, 53, 13, 51, 50, 49, 193, 189, 185, 91, 179, 175, 43, 169, 83, 163, 5, 79, 155, 19, 75, 147, 145, 143, 35, 69, 17, 67, 33, 65, 255, 251, 247, 243, 239, 59, 29, 229, 113, 111, 219, 27, 213, 105, 207, 51, 201, 199, 49, 193, 191, 47, 93, 183, 181, 179, 11, 87, 43, 85, 167, 165, 163, 161, 159, 157, 155, 77, 19, 75, 37, 73, 145, 143, 141, 35, 138, 137, 135, 67, 33, 131, 129, 255, 63, 250, 247, 61, 121, 239, 237, 117, 29, 229, 227, 225, 111, 55, 109, 216, 213, 211, 209, 207, 205, 203, 201, 199, 197, 195, 193, 48, 190, 47, 93, 185, 183, 181, 179, 178, 176, 175, 173, 171, 85, 21, 167, 165, 41, 163, 161, 5, 79, 157, 78, 154, 153, 19, 75, 149, 74, 147, 73, 144, 143, 71, 141, 140, 139, 137, 17, 135, 134, 133, 66, 131, 65, 129, 1];\n// eslint-disable-next-line max-len\nconst shg_table = [0, 9, 10, 10, 14, 12, 14, 14, 16, 15, 16, 15, 16, 15, 15, 17, 18, 17, 12, 18, 16, 17, 17, 19, 19, 18, 19, 18, 18, 19, 19, 19, 20, 19, 20, 20, 20, 20, 20, 20, 15, 20, 19, 20, 20, 20, 21, 21, 21, 20, 20, 20, 21, 18, 21, 21, 21, 21, 20, 21, 17, 21, 21, 21, 22, 22, 21, 22, 22, 21, 22, 21, 19, 22, 22, 19, 20, 22, 22, 21, 21, 21, 22, 22, 22, 18, 22, 22, 21, 22, 22, 23, 22, 20, 23, 22, 22, 23, 23, 21, 19, 21, 21, 21, 23, 23, 23, 22, 23, 23, 21, 23, 22, 23, 18, 22, 23, 20, 22, 23, 23, 23, 21, 22, 20, 22, 21, 22, 24, 24, 24, 24, 24, 22, 21, 24, 23, 23, 24, 21, 24, 23, 24, 22, 24, 24, 22, 24, 24, 22, 23, 24, 24, 24, 20, 23, 22, 23, 24, 24, 24, 24, 24, 24, 24, 23, 21, 23, 22, 23, 24, 24, 24, 22, 24, 24, 24, 23, 22, 24, 24, 25, 23, 25, 25, 23, 24, 25, 25, 24, 22, 25, 25, 25, 24, 23, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 23, 25, 23, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 24, 22, 25, 25, 23, 25, 25, 20, 24, 25, 24, 25, 25, 22, 24, 25, 24, 25, 24, 25, 25, 24, 25, 25, 25, 25, 22, 25, 25, 25, 24, 25, 24, 25, 18];\n\nexport default function boxBlurCanvasRGB(context, top_x, top_y, width, height, radius, iterations) {\n if (Number.isNaN(radius) || radius < 1) return;\n\n radius |= 0;\n\n if (Number.isNaN(iterations)) iterations = 1;\n iterations |= 0;\n if (iterations > 3) iterations = 3;\n if (iterations < 1) iterations = 1;\n\n const imageData = context.getImageData(top_x, top_y, width, height);\n\n const pixels = imageData.data;\n\n let rsum;\n let gsum;\n let bsum;\n let x;\n let y;\n let i;\n let p;\n let p1;\n let p2;\n let yp;\n let yi;\n let yw;\n let wm = width - 1;\n let hm = height - 1;\n let rad1 = radius + 1;\n\n let r = [];\n let g = [];\n let b = [];\n\n let mul_sum = mul_table[radius];\n let shg_sum = shg_table[radius];\n\n let vmin = [];\n let vmax = [];\n\n while (iterations-- > 0) {\n yw = yi = 0;\n\n for (y = 0; y < height; y++) {\n rsum = pixels[yw] * rad1;\n gsum = pixels[yw + 1] * rad1;\n bsum = pixels[yw + 2] * rad1;\n\n for (i = 1; i <= radius; i++) {\n p = yw + (((i > wm ? wm : i)) << 2);\n rsum += pixels[p++];\n gsum += pixels[p++];\n bsum += pixels[p++];\n }\n\n for (x = 0; x < width; x++) {\n r[yi] = rsum;\n g[yi] = gsum;\n b[yi] = bsum;\n\n if (y == 0) {\n vmin[x] = ((p = x + rad1) < wm ? p : wm) << 2;\n vmax[x] = ((p = x - radius) > 0 ? p << 2 : 0);\n }\n\n p1 = yw + vmin[x];\n p2 = yw + vmax[x];\n\n rsum += pixels[p1++] - pixels[p2++];\n gsum += pixels[p1++] - pixels[p2++];\n bsum += pixels[p1++] - pixels[p2++];\n\n yi++;\n }\n yw += (width << 2);\n }\n\n for (x = 0; x < width; x++) {\n yp = x;\n rsum = r[yp] * rad1;\n gsum = g[yp] * rad1;\n bsum = b[yp] * rad1;\n\n for (i = 1; i <= radius; i++) {\n yp += (i > hm ? 0 : width);\n rsum += r[yp];\n gsum += g[yp];\n bsum += b[yp];\n }\n\n yi = x << 2;\n for (y = 0; y < height; y++) {\n pixels[yi] = (rsum * mul_sum) >>> shg_sum;\n pixels[yi + 1] = (gsum * mul_sum) >>> shg_sum;\n pixels[yi + 2] = (bsum * mul_sum) >>> shg_sum;\n\n if (x == 0) {\n vmin[y] = ((p = y + rad1) < hm ? p : hm) * width;\n vmax[y] = ((p = y - radius) > 0 ? p * width : 0);\n }\n\n p1 = x + vmin[y];\n p2 = x + vmax[y];\n\n rsum += r[p1] - r[p2];\n gsum += g[p1] - g[p2];\n bsum += b[p1] - b[p2];\n\n yi += width << 2;\n }\n }\n }\n\n context.putImageData(imageData, top_x, top_y);\n}\n","import { IS_SAFARI } from './environment';\nimport safePlay from './safePlay';\nimport { patchSafariProgressiveAudio, isSafariPatchInProgress } from './patchSafariProgressiveAudio';\nimport { getDispatch } from '../lib/teact/teactn';\nimport { parseMessageKey } from '../modules/helpers';\n\ntype Handler = (eventName: string, e: Event) => void;\n\ninterface Track {\n audio: HTMLAudioElement;\n proxy: HTMLAudioElement;\n handlers: Handler[];\n onForcePlay?: NoneToVoidFunction;\n}\n\nconst tracks = new Map();\nlet queue: string[] = [];\n\nlet currentTrackId: string | undefined;\n\nfunction createAudio(trackId: string, onForcePlay?: NoneToVoidFunction) {\n const audio = new Audio();\n\n function handleEvent(eventName: string) {\n return (e: Event) => {\n if (!tracks.has(trackId)) {\n return;\n }\n\n if (isSafariPatchInProgress(audio)) {\n return;\n }\n\n tracks.get(trackId)!.handlers.forEach((handler) => {\n handler(eventName, e);\n });\n };\n }\n\n audio.addEventListener('timeupdate', handleEvent('onTimeUpdate'));\n audio.addEventListener('play', handleEvent('onPlay'));\n audio.addEventListener('pause', handleEvent('onPause'));\n audio.addEventListener('loadstart', handleEvent('onLoadStart'));\n audio.addEventListener('loadeddata', handleEvent('onLoadedData'));\n audio.addEventListener('playing', handleEvent('onPlaying'));\n audio.addEventListener('ended', () => {\n if (isSafariPatchInProgress(audio)) {\n return;\n }\n\n const nextTrackId = queue[queue.indexOf(trackId) + 1];\n if (!nextTrackId) {\n return;\n }\n\n if (!tracks.has(nextTrackId)) {\n // A bit hacky way to continue playlist when switching chat\n getDispatch().openAudioPlayer(parseMessageKey(nextTrackId));\n\n return;\n }\n\n const nextTrack = tracks.get(nextTrackId)!;\n\n if (nextTrack.onForcePlay) {\n nextTrack.onForcePlay();\n }\n\n currentTrackId = nextTrackId;\n\n if (nextTrack.audio.src) {\n safePlay(nextTrack.audio);\n }\n });\n\n return {\n audio,\n proxy: new Proxy(audio, {\n get: (origin, key: keyof HTMLAudioElement) => origin[key],\n }),\n handlers: [],\n onForcePlay,\n };\n}\n\nexport function stopCurrentAudio() {\n const currentTrack = currentTrackId && tracks.get(currentTrackId);\n if (currentTrack) {\n currentTrack.audio.pause();\n }\n}\n\nexport function register(trackId: string, handler: Handler, onForcePlay?: NoneToVoidFunction) {\n if (!tracks.has(trackId)) {\n tracks.set(trackId, createAudio(trackId, onForcePlay));\n\n if (!queue.includes(trackId)) {\n queue.push(trackId);\n }\n }\n\n const { audio, proxy, handlers } = tracks.get(trackId)!;\n\n handlers.push(handler);\n\n return {\n play(src: string) {\n if (currentTrackId && currentTrackId !== trackId) {\n tracks.get(currentTrackId)!.audio.pause();\n }\n\n currentTrackId = trackId;\n\n if (!audio.src) {\n audio.src = src;\n audio.preload = 'auto';\n\n if (src.includes('/progressive/') && IS_SAFARI) {\n patchSafariProgressiveAudio(audio);\n }\n }\n\n safePlay(audio);\n },\n\n pause() {\n if (currentTrackId === trackId) {\n audio.pause();\n }\n },\n\n setCurrentTime(time: number) {\n if (currentTrackId === trackId) {\n audio.currentTime = time;\n }\n },\n\n proxy,\n\n destroy(shouldRemoveFromQueue = false) {\n const track = tracks.get(trackId);\n if (!track) {\n return;\n }\n\n track.handlers = track.handlers.filter((h) => h !== handler);\n\n if (!track.handlers.length) {\n track.audio.pause();\n tracks.delete(trackId);\n\n if (shouldRemoveFromQueue) {\n queue = queue.filter((id) => id !== trackId);\n }\n\n if (trackId === currentTrackId) {\n currentTrackId = undefined;\n }\n }\n },\n };\n}\n","import { IS_IOS } from './environment';\n\nexport enum SwipeDirection {\n Up,\n Down,\n Left,\n Right,\n}\n\ninterface CaptureOptions {\n onCapture?: (e: MouseEvent | TouchEvent) => void;\n onRelease?: (e: MouseEvent | TouchEvent) => void;\n onDrag?: (\n e: MouseEvent | TouchEvent,\n captureEvent: MouseEvent | TouchEvent,\n params: {\n dragOffsetX: number;\n dragOffsetY: number;\n },\n ) => void;\n onSwipe?: (e: Event, direction: SwipeDirection) => boolean;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n excludedClosestSelector?: string;\n selectorToPreventScroll?: string;\n withCursor?: boolean;\n}\n\n// https://stackoverflow.com/questions/11287877/how-can-i-get-e-offsetx-on-mobile-ipad\n// Android does not have this value, and iOS has it but as read-only\nexport interface RealTouchEvent extends TouchEvent {\n pageX?: number;\n pageY?: number;\n}\n\ntype TSwipeAxis =\n 'x'\n | 'y'\n | undefined;\n\nconst IOS_SCREEN_EDGE_THRESHOLD = 20;\nconst MOVED_THRESHOLD = 15;\nconst SWIPE_THRESHOLD = 50;\n\nexport function captureEvents(element: HTMLElement, options: CaptureOptions) {\n let captureEvent: MouseEvent | RealTouchEvent | undefined;\n let hasMoved = false;\n let hasSwiped = false;\n let initialSwipeAxis: TSwipeAxis | undefined;\n\n function onCapture(e: MouseEvent | RealTouchEvent) {\n if (options.excludedClosestSelector && (\n (e.target as HTMLElement).matches(options.excludedClosestSelector)\n || (e.target as HTMLElement).closest(options.excludedClosestSelector)\n )) {\n return;\n }\n\n captureEvent = e;\n\n if (e.type === 'mousedown') {\n document.addEventListener('mousemove', onMove);\n document.addEventListener('mouseup', onRelease);\n } else if (e.type === 'touchstart') {\n // We need to always listen on `touchstart` target:\n // https://stackoverflow.com/questions/33298828/touch-move-event-dont-fire-after-touch-start-target-is-removed\n const target = e.target as HTMLElement;\n target.addEventListener('touchmove', onMove, { passive: true });\n target.addEventListener('touchend', onRelease);\n target.addEventListener('touchcancel', onRelease);\n\n if ('touches' in e) {\n if (e.pageX === undefined) {\n e.pageX = e.touches[0].pageX;\n }\n\n if (e.pageY === undefined) {\n e.pageY = e.touches[0].pageY;\n }\n }\n }\n\n document.body.classList.add('no-selection');\n if (options.withCursor) {\n document.body.classList.add('cursor-grabbing');\n }\n\n if (options.onCapture) {\n options.onCapture(e);\n }\n }\n\n function onRelease(e: MouseEvent | TouchEvent) {\n if (captureEvent) {\n if (options.withCursor) {\n document.body.classList.remove('cursor-grabbing');\n }\n document.body.classList.remove('no-selection');\n\n document.removeEventListener('mouseup', onRelease);\n document.removeEventListener('mousemove', onMove);\n (captureEvent.target as HTMLElement).removeEventListener('touchcancel', onRelease);\n (captureEvent.target as HTMLElement).removeEventListener('touchend', onRelease);\n (captureEvent.target as HTMLElement).removeEventListener('touchmove', onMove);\n\n captureEvent = undefined;\n\n if (IS_IOS && options.selectorToPreventScroll) {\n Array.from(document.querySelectorAll(options.selectorToPreventScroll)).forEach((scrollable) => {\n scrollable.style.overflow = '';\n });\n }\n\n if (hasMoved) {\n if (options.onRelease) {\n options.onRelease(e);\n }\n } else if (options.onClick && (!('button' in e) || e.button === 0)) {\n options.onClick(e);\n }\n }\n\n hasMoved = false;\n hasSwiped = false;\n initialSwipeAxis = undefined;\n }\n\n function onMove(e: MouseEvent | RealTouchEvent) {\n if (captureEvent) {\n if (e.type === 'touchmove' && ('touches' in e)) {\n if (e.pageX === undefined) {\n e.pageX = e.touches[0].pageX;\n }\n\n if (e.pageY === undefined) {\n e.pageY = e.touches[0].pageY;\n }\n }\n\n const dragOffsetX = e.pageX! - captureEvent.pageX!;\n const dragOffsetY = e.pageY! - captureEvent.pageY!;\n\n if (Math.abs(dragOffsetX) >= MOVED_THRESHOLD || Math.abs(dragOffsetY) >= MOVED_THRESHOLD) {\n hasMoved = true;\n }\n\n let shouldPreventScroll = false;\n\n if (options.onDrag) {\n options.onDrag(e, captureEvent, { dragOffsetX, dragOffsetY });\n shouldPreventScroll = true;\n }\n\n if (options.onSwipe && !hasSwiped) {\n hasSwiped = onSwipe(e, dragOffsetX, dragOffsetY);\n shouldPreventScroll = hasSwiped;\n }\n\n if (IS_IOS && shouldPreventScroll && options.selectorToPreventScroll) {\n Array.from(document.querySelectorAll(options.selectorToPreventScroll)).forEach((scrollable) => {\n scrollable.style.overflow = 'hidden';\n });\n }\n }\n }\n\n function onSwipe(e: MouseEvent | RealTouchEvent, dragOffsetX: number, dragOffsetY: number) {\n // Avoid conflicts with swipe-to-back gestures\n if (IS_IOS) {\n const x = (e as RealTouchEvent).touches[0].pageX;\n if (x <= IOS_SCREEN_EDGE_THRESHOLD || x >= window.innerWidth - IOS_SCREEN_EDGE_THRESHOLD) {\n return false;\n }\n }\n\n const xAbs = Math.abs(dragOffsetX);\n const yAbs = Math.abs(dragOffsetY);\n\n if (dragOffsetX && dragOffsetY) {\n const ratio = Math.max(xAbs, yAbs) / Math.min(xAbs, yAbs);\n // Diagonal swipe\n if (ratio < 2) {\n return false;\n }\n }\n\n let axis: TSwipeAxis | undefined;\n if (xAbs >= SWIPE_THRESHOLD) {\n axis = 'x';\n } else if (yAbs >= SWIPE_THRESHOLD) {\n axis = 'y';\n }\n\n if (!axis) {\n return false;\n }\n\n if (!initialSwipeAxis) {\n initialSwipeAxis = axis;\n } else if (initialSwipeAxis !== axis) {\n // Prevent horizontal swipe after vertical to prioritize scroll\n return false;\n }\n\n return processSwipe(e, axis, dragOffsetX, dragOffsetY, options.onSwipe!);\n }\n\n element.addEventListener('mousedown', onCapture);\n element.addEventListener('touchstart', onCapture, { passive: true });\n\n return () => {\n element.removeEventListener('mousedown', onCapture);\n element.removeEventListener('touchstart', onCapture);\n };\n}\n\nfunction processSwipe(\n e: Event,\n currentSwipeAxis: TSwipeAxis,\n dragOffsetX: number,\n dragOffsetY: number,\n onSwipe: (e: Event, direction: SwipeDirection) => boolean,\n) {\n if (currentSwipeAxis === 'x') {\n if (dragOffsetX < 0) {\n return onSwipe(e, SwipeDirection.Left);\n } else {\n return onSwipe(e, SwipeDirection.Right);\n }\n } else if (currentSwipeAxis === 'y') {\n if (dragOffsetY < 0) {\n return onSwipe(e, SwipeDirection.Up);\n } else {\n return onSwipe(e, SwipeDirection.Down);\n }\n }\n\n return false;\n}\n","import { DEBUG } from '../config';\n\nexport const CLIPBOARD_ITEM_SUPPORTED = navigator.clipboard && window.ClipboardItem;\n\nconst textCopyEl = document.createElement('textarea');\ntextCopyEl.setAttribute('readonly', '');\ntextCopyEl.tabIndex = -1;\ntextCopyEl.className = 'visually-hidden';\n\nexport const copyTextToClipboard = (str: string): void => {\n textCopyEl.value = str;\n document.body.appendChild(textCopyEl);\n const selection = document.getSelection();\n\n if (selection) {\n // Store previous selection\n const rangeToRestore = selection.rangeCount > 0 && selection.getRangeAt(0);\n textCopyEl.select();\n document.execCommand('copy');\n // Restore the original selection\n if (rangeToRestore) {\n selection.removeAllRanges();\n selection.addRange(rangeToRestore);\n }\n }\n\n document.body.removeChild(textCopyEl);\n};\n\nexport const copyImageToClipboard = (imageUrl?: string) => {\n if (!imageUrl) return;\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n const imageEl = new Image();\n imageEl.onload = (e: Event) => {\n if (ctx && e.currentTarget) {\n const img = e.currentTarget as HTMLImageElement;\n canvas.width = img.width;\n canvas.height = img.height;\n ctx.drawImage(img, 0, 0, img.width, img.height);\n canvas.toBlob(copyBlobToClipboard, 'image/png', 1);\n }\n };\n\n imageEl.src = imageUrl;\n};\n\nasync function copyBlobToClipboard(pngBlob: Blob | null) {\n if (!pngBlob || !CLIPBOARD_ITEM_SUPPORTED) {\n return;\n }\n\n try {\n await navigator.clipboard.write([\n new window.ClipboardItem({\n [pngBlob.type]: pngBlob,\n }),\n ]);\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n }\n}\n","// Sometimes event is fired earlier than animation completes\nconst ANIMATION_END_DELAY = 50;\n\nexport function waitForTransitionEnd(node: Node, handler: NoneToVoidFunction, propertyName?: string) {\n waitForEndEvent('transitionend', node, handler, propertyName);\n}\n\nexport function waitForAnimationEnd(node: Node, handler: NoneToVoidFunction, animationName?: string) {\n waitForEndEvent('animationend', node, handler, animationName);\n}\n\nfunction waitForEndEvent(\n eventType: 'transitionend' | 'animationend',\n node: Node,\n handler: NoneToVoidFunction,\n detailedName?: string,\n) {\n let isHandled = false;\n\n node.addEventListener(eventType, function handleAnimationEnd(e: TransitionEvent | AnimationEvent) {\n if (isHandled || e.target !== e.currentTarget) {\n return;\n }\n\n if (detailedName && (\n (e instanceof TransitionEvent && e.propertyName === detailedName)\n || (e instanceof AnimationEvent && e.animationName === detailedName)\n )) {\n return;\n }\n\n isHandled = true;\n\n node.removeEventListener(eventType, handleAnimationEnd as EventListener);\n\n setTimeout(() => {\n handler();\n }, ANIMATION_END_DELAY);\n } as EventListener);\n}\n","export default function cycleRestrict(length: number, index: number) {\n return index - Math.floor(index / length) * length;\n}\n","export default function download(url: string, filename: string) {\n const link = document.createElement('a');\n link.href = url;\n link.download = filename;\n link.click();\n}\n","import { getGlobal } from '../lib/teact/teactn';\n\nimport { FocusDirection } from '../types';\n\nimport {\n ANIMATION_LEVEL_MIN,\n FAST_SMOOTH_MAX_DISTANCE, FAST_SMOOTH_MAX_DURATION, FAST_SMOOTH_MIN_DURATION,\n FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE,\n} from '../config';\nimport { dispatchHeavyAnimationEvent } from '../hooks/useHeavyAnimationCheck';\nimport { animateSingle } from './animation';\n\nlet isAnimating = false;\n\nexport default function fastSmoothScroll(\n container: HTMLElement,\n element: HTMLElement,\n position: ScrollLogicalPosition | 'centerOrTop',\n margin = 0,\n maxDistance = FAST_SMOOTH_MAX_DISTANCE,\n forceDirection?: FocusDirection,\n forceDuration?: number,\n forceNormalContainerHeight?: boolean,\n) {\n const scrollFrom = calculateScrollFrom(container, element, maxDistance, forceDirection);\n\n if (forceDirection === FocusDirection.Static) {\n scrollWithJs(container, element, scrollFrom, position, margin, 0);\n return;\n }\n\n if (getGlobal().settings.byKey.animationLevel === ANIMATION_LEVEL_MIN) {\n forceDuration = 0;\n }\n\n scrollWithJs(container, element, scrollFrom, position, margin, forceDuration, forceNormalContainerHeight);\n}\n\nexport function isAnimatingScroll() {\n return isAnimating;\n}\n\nfunction calculateScrollFrom(\n container: HTMLElement,\n element: HTMLElement,\n maxDistance = FAST_SMOOTH_MAX_DISTANCE,\n forceDirection?: FocusDirection,\n) {\n const { offsetTop: elementTop } = element;\n const { scrollTop } = container;\n\n if (forceDirection === undefined) {\n const offset = elementTop - container.scrollTop;\n\n if (offset < -maxDistance) {\n return scrollTop + (offset + maxDistance);\n } else if (offset > maxDistance) {\n return scrollTop + (offset - maxDistance);\n }\n } else if (forceDirection === FocusDirection.Up) {\n return elementTop + maxDistance;\n } else if (forceDirection === FocusDirection.Down) {\n return Math.max(0, elementTop - maxDistance);\n }\n\n return scrollTop;\n}\n\nfunction scrollWithJs(\n container: HTMLElement,\n element: HTMLElement,\n scrollFrom: number,\n position: ScrollLogicalPosition | 'centerOrTop',\n margin = 0,\n forceDuration?: number,\n forceNormalContainerHeight?: boolean,\n) {\n const { offsetTop: elementTop, offsetHeight: elementHeight } = element;\n const { scrollTop: currentScrollTop, offsetHeight: containerHeight, scrollHeight } = container;\n const targetContainerHeight = forceNormalContainerHeight && container.dataset.normalHeight\n ? Number(container.dataset.normalHeight)\n : containerHeight;\n\n if (currentScrollTop !== scrollFrom) {\n container.scrollTop = scrollFrom;\n }\n\n let path!: number;\n\n switch (position) {\n case 'start':\n path = (elementTop - margin) - scrollFrom;\n break;\n case 'end':\n path = (elementTop + elementHeight + margin) - (scrollFrom + targetContainerHeight);\n break;\n // 'nearest' is not supported yet\n case 'nearest':\n case 'center':\n case 'centerOrTop':\n path = elementHeight < targetContainerHeight\n ? (elementTop + elementHeight / 2) - (scrollFrom + targetContainerHeight / 2)\n : (elementTop - margin) - scrollFrom;\n break;\n }\n\n if (path < 0) {\n const remainingPath = -scrollFrom;\n path = Math.max(path, remainingPath);\n } else if (path > 0) {\n const remainingPath = scrollHeight - (scrollFrom + targetContainerHeight);\n path = Math.min(path, remainingPath);\n }\n\n if (path === 0) {\n return;\n }\n\n const target = scrollFrom + path;\n\n if (forceDuration === 0) {\n container.scrollTop = target;\n return;\n }\n\n isAnimating = true;\n\n const absPath = Math.abs(path);\n const transition = absPath < FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE ? shortTransition : longTransition;\n const duration = forceDuration || (\n FAST_SMOOTH_MIN_DURATION\n + (absPath / FAST_SMOOTH_MAX_DISTANCE) * (FAST_SMOOTH_MAX_DURATION - FAST_SMOOTH_MIN_DURATION)\n );\n const startAt = Date.now();\n const onHeavyAnimationStop = dispatchHeavyAnimationEvent();\n\n animateSingle(() => {\n const t = Math.min((Date.now() - startAt) / duration, 1);\n const currentPath = path * (1 - transition(t));\n\n container.scrollTop = Math.round(target - currentPath);\n\n isAnimating = t < 1;\n\n if (!isAnimating) {\n onHeavyAnimationStop();\n }\n\n return isAnimating;\n });\n}\n\nfunction longTransition(t: number) {\n return 1 - ((1 - t) ** 5);\n}\n\nfunction shortTransition(t: number) {\n return 1 - ((1 - t) ** 3.5);\n}\n","import { getGlobal } from '../lib/teact/teactn';\n\nimport { ANIMATION_LEVEL_MIN } from '../config';\nimport { IS_IOS } from './environment';\nimport { animate } from './animation';\n\nconst DEFAULT_DURATION = 300;\n\nexport default function fastSmoothScrollHorizontal(container: HTMLElement, left: number, duration = DEFAULT_DURATION) {\n if (getGlobal().settings.byKey.animationLevel === ANIMATION_LEVEL_MIN) {\n duration = 0;\n }\n\n // Native way seems to be smoother in Chrome\n if (!IS_IOS) {\n container.scrollTo({\n left,\n ...(duration && { behavior: 'smooth' }),\n });\n } else {\n scrollWithJs(container, left, duration);\n }\n}\n\nfunction scrollWithJs(container: HTMLElement, left: number, duration: number) {\n const { scrollLeft, offsetWidth: containerWidth, scrollWidth } = container;\n let path = left - scrollLeft;\n\n if (path < 0) {\n const remainingPath = -scrollLeft;\n path = Math.max(path, remainingPath);\n } else if (path > 0) {\n const remainingPath = scrollWidth - (scrollLeft + containerWidth);\n path = Math.min(path, remainingPath);\n }\n\n if (path === 0) {\n return;\n }\n\n const target = scrollLeft + path;\n\n if (duration === 0) {\n container.scrollLeft = target;\n return;\n }\n\n const startAt = Date.now();\n\n animate(() => {\n const t = Math.min((Date.now() - startAt) / duration, 1);\n\n const currentPath = path * (1 - transition(t));\n container.scrollLeft = Math.round(target - currentPath);\n\n return t < 1;\n });\n}\n\nfunction transition(t: number) {\n return 1 - ((1 - t) ** 3.5);\n}\n","import { IS_TOUCH_ENV } from './environment';\n\nexport default function focusEditableElement(element: HTMLElement, force?: boolean) {\n if (!force && element === document.activeElement) {\n return;\n }\n\n const selection = window.getSelection()!;\n const range = document.createRange();\n const lastChild = element.lastChild || element;\n\n if (!IS_TOUCH_ENV && (!lastChild || !lastChild.nodeValue)) {\n element.focus();\n return;\n }\n\n range.selectNodeContents(lastChild);\n // `false` means collapse to the end rather than the start\n range.collapse(false);\n selection.removeAllRanges();\n selection.addRange(range);\n}\n","/*\n * Thanks to Ace Monkey for this mind-blowing patch.\n */\n\nexport function patchSafariProgressiveAudio(audioEl: HTMLAudioElement) {\n if (audioEl.dataset.patchedForSafari) {\n return;\n }\n\n audioEl.addEventListener('play', () => {\n const t = audioEl.currentTime;\n\n function onProgress() {\n if (!audioEl.buffered.length) {\n return;\n }\n\n audioEl.dataset.patchForSafariInProgress = 'true';\n audioEl.currentTime = audioEl.duration - 1;\n audioEl.addEventListener('progress', () => {\n delete audioEl.dataset.patchForSafariInProgress;\n audioEl.currentTime = t;\n if (audioEl.paused) {\n audioEl.play();\n }\n }, { once: true });\n\n audioEl.removeEventListener('progress', onProgress);\n }\n\n audioEl.addEventListener('progress', onProgress);\n }, { once: true });\n\n audioEl.dataset.patchedForSafari = 'true';\n}\n\nexport function isSafariPatchInProgress(audioEl: HTMLAudioElement) {\n return Boolean(audioEl.dataset.patchForSafariInProgress);\n}\n","import { IS_IOS } from './environment';\n\nexport default (container: HTMLDivElement, scrollTop?: number) => {\n if (IS_IOS) {\n container.style.overflow = 'hidden';\n }\n\n if (scrollTop !== undefined) {\n container.scrollTop = scrollTop;\n }\n\n if (IS_IOS) {\n container.style.overflow = '';\n }\n};\n","import { DEBUG } from '../config';\n\nexport default (mediaEl: HTMLMediaElement) => {\n mediaEl.play().catch((err) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn(err);\n }\n });\n};\n"],"names":["WIDTH","large","medium","small","sticker","size","observeIntersection","lastSyncTime","forceLoadPreview","ref","useRef","isAnimationLoaded","markAnimationLoaded","useFlag","localMediaHash","id","isIntersecting","useIsIntersecting","thumbDataUri","thumbnail","dataUri","previewBlobUrl","useMedia","ApiMediaFormat","transitionClassNames","useTransitionForMedia","mediaData","isMediaLoaded","Boolean","playKey","setPlayKey","useState","String","Math","random","handleClick","useCallback","width","style","className","onClick","src","LIKE_STICKER_ID","undefined","alt","key","animationData","quality","play","noLoop","onLoad","lottiePromise","RLottie","async","ensureLottie","default","setTimeout","memo","playSegment","speed","isLowPriority","animation","setAnimation","container","wasPlaying","isFrozen","playRef","current","playSegmentRef","useEffect","exec","newAnimation","setSpeed","then","fastRaf","destroy","playAnimation","shouldRestart","goToAndPlay","pauseAnimation","pause","freezeAnimation","isPlaying","unfreezeAnimation","unfreezeAnimationOnRaf","useHeavyAnimationCheck","useBackgroundMode","fullClassName","buildClassName","MIN_SPIKES","IS_SINGLE_COLUMN_LAYOUT","MAX_SPIKES","renderSeekline","playProgress","bufferedProgress","handleStartSeek","handleSeek","handleStopSeek","onMouseDown","onMouseMove","onMouseUp","theme","message","senderTitle","uploadProgress","target","date","isSelectable","isSelected","onPlay","onReadMedia","onCancelUpload","onDateClick","content","audio","voice","isMediaUnread","isVoice","isSeeking","lang","useLang","isActivated","setIsActivated","shouldDownload","downloadProgress","useMediaWithDownloadProgress","getMessageMediaHash","getMessageMediaFormat","isBuffered","bufferingHandlers","checkBuffering","useBuffering","playPause","setCurrentTime","duration","useAudioPlayer","getMessageKey","getMediaDuration","chatId","isMessageLocal","isDownloadStarted","directDownloadProgress","handleDownloadClick","useMediaDownload","getMessageAudioCaption","isLoadingForPlaying","isUploading","isTransferring","transferProgress","getMediaTransferState","shouldRender","shouldRenderSpinner","spinnerClassNames","useShowTransition","handleButtonClick","e","seekBar","currentTarget","closest","left","getBoundingClientRect","clientX","handleDateClick","seekHandlers","isOwn","isOwnMessage","renderedWaveform","useMemo","waveform","fillColor","fillOwnColor","progressFillColor","progressFillOwnColor","durationFactor","min","spikesCount","round","decodedWaveform","encoded5bit","bitsCount","length","valuesCount","floor","result","Array","bitsData","i","l","byteIndex","bitShift","value","lastByteIndex","lastBitShift","lastValue","decodeWaveform","Uint8Array","data","spikes","peak","fitCount","newData","springFactor","leftFiller","rightFiller","idx","val","interpolateArray","height","progress","fillStyle","progressFillStyle","canvas","document","createElement","ctx","getContext","scale","forEach","item","globalAlpha","spikeHeight","max","x","y","radius","beginPath","moveTo","arcTo","closePath","roundedRectangle","fill","toDataURL","renderWaveformToDataUri","draggable","renderWaveform","buttonClassNames","push","showSeekline","contentClassName","dir","isRtl","Button","ripple","join","ariaLabel","ProgressSpinner","transparent","noCross","renderText","title","fileName","getFirstLine","Link","formatPastTimeShort","formatMediaDuration","performer","getSecondLine","formatMediaDateTime","renderAudio","renderVoice","chat","user","text","withOnlineStatus","isSavedMessages","isDeleted","isDeletedUser","imageHash","getChatAvatarHash","shouldRenderFullMedia","decoding","userFullName","getUserFullName","getFirstLetters","getChatTitle","isChatPrivate","isOnline","isUserOnline","getUserColorKey","senderId","IS_TEST","withGlobal","global","chatOrUserId","countryList","phoneCodes","phoneCodeList","selectChat","selectUser","isMuted","selectIsChatMuted","selectNotifySettings","selectNotifyExceptions","canInviteUsers","isChatChannel","isUserRightBanned","getHasAdminRight","setGlobal","actions","pick","forceShowSelf","loadFullUser","showNotification","updateChatMutedState","userId","fullInfo","username","phoneNumber","isSelf","handleNotificationChange","isRestricted","copy","entity","copyTextToClipboard","formattedNumber","formatPhoneNumberWithCode","link","getChatLink","description","bio","getChatDescription","icon","multiline","narrow","isStatic","label","checked","inactive","isPrivateChat","isChatWithSelf","selectIsChatWithSelf","getPrivateChatUserId","isBot","isUserBot","isSupport","canDeleteForAll","contactName","getUserFirstOrLastName","isChannel","isBasicGroup","isChatBasicGroup","isSuperGroup","isChatSuperGroup","currentUserId","isOpen","onClose","onCloseAnimationEnd","leaveChannel","deleteHistory","deleteChannel","deleteChatUser","blockContact","chatTitle","handleDeleteMessageForAll","shouldDeleteForAll","handleDeleteAndStop","contactId","accessHash","handleDeleteChat","isCreator","header","color","isText","smaller","withDate","datetime","sender","onMediaClick","extension","getDocumentExtension","timestamp","withMediaViewer","mediaType","isDownloadAllowed","setIsDownloadAllowed","hasPreview","getDocumentHasPreview","getMessageMediaThumbDataUri","localBlobUrl","previewData","isAllowed","download","name","thumbnailDataUri","actionIcon","isMessageDocumentVideo","elementRef","shouldSpinnerRender","getColorFromExtension","sizeString","getFileSizeString","shouldRenderThumb","getDocumentThumbnailDimensions","onlineCount","selectChatOnlineCount","areMessagesLoaded","selectChatMessages","typingStatus","avatarSize","withUsername","withFullInfo","withUpdatingStatus","withChatType","noRtl","loadFullChat","openMediaViewer","isMin","handleAvatarViewerOpen","hasPhoto","stopPropagation","avatarOwnerId","origin","MediaViewerOrigin","isVerified","getChatTypeString","handle","groupStatus","chatTypeString","membersCount","getGroupStatus","onlineStatus","renderStatusOrTyping","outgoingStatus","status","idPrefix","mediaBlobUrl","video","getMessageVideo","isGif","Keys","activeKey","itemIds","selectedIds","filterValue","filterPlaceholder","notFoundText","searchInputId","isLoading","noScrollRestore","onSelectedIdsChange","onFilterChange","onLoadMore","inputRef","shouldMinimize","requestAnimationFrame","focus","handleItemClick","newSelectedIds","includes","splice","indexOf","handleFilterChange","viewportIds","getMore","useInfiniteScroll","map","isMinimized","canClose","clickArg","onChange","placeholder","items","iconElement","titleText","serverTimeOffset","noStatusOrTyping","fullName","getUserStatus","photo","isFirstPhoto","getMediaHash","forceAvatar","hash","fullMediaData","startsWith","avatarThumbnailData","useBlurSync","imageSrc","prevImageSrc","usePrevious","Spinner","connectionState","animationLevel","settings","byKey","photos","slideAnimation","currentPhotoIndex","setCurrentPhotoIndex","isFirst","isLast","profile","currentIndex","slice","mediaLoader","usePhotosPreload","handleProfilePhotoClick","profilePhotoIndex","selectPreviousMedia","selectNextMedia","element","querySelector","captureEvents","selectorToPreventScroll","onSwipe","IS_TOUCH_ENV","direction","SwipeDirection","renderPhoto","isVerifiedIconShown","_","renderPhotoTabs","Transition","type","VerifiedIcon","noAnimate","onUnfaveClick","stickerSelector","shouldPlay","lottieData","isAnimated","markLoaded","unmarkLoaded","canAnimatedPlay","shouldRenderPreview","previewTransitionClassNames","emoji","preventMessageInputBlurWithBubbling","preventDefault","props","StickerSetModal","useModuleLoader","Bundles","typingUser","typingUserName","action","replace","trim","onMessageClick","linkData","getMessageWebPage","getFirstLinkInMessage","url","domain","messageText","getMessageSummaryText","siteName","handleMessageClick","displayUrl","truncatedDescription","trimText","MEDIA_VIEWER_MEDIA_QUERY","REM","parseInt","getComputedStyle","documentElement","fontSize","ROUND_VIDEO_DIMENSIONS","AVATAR_FULL_DIMENSIONS","DEFAULT_MEDIA_DIMENSIONS","cachedMaxWidthOwn","cachedMaxWidth","cachedMaxWidthNoAvatar","getAvailableWidth","fromOwnMessage","isForwarded","isWebPagePhoto","noAvatars","extraPaddingRem","regularMaxWidth","windowWidth","windowSize","getMaxMessageWidthRem","calculateDimensionsForMessageMedia","aspectRatio","calculateDimensions","getAvailableHeight","getMediaViewerAvailableDimensions","withFooter","isVideo","mql","window","matchMedia","windowHeight","occupiedHeightRem","matches","calculateInlineImageDimensions","getPhotoInlineDimensions","calculateVideoDimensions","getVideoDimensions","getPictogramDimensions","getStickerDimensions","baseWidth","STICKER_SIZE_INLINE_MOBILE_FACTOR","STICKER_SIZE_INLINE_DESKTOP_FACTOR","calculatedHeight","calculateMediaViewerDimensions","availableWidth","availableHeight","mediaWidth","mediaHeight","calculatedWidth","renderMessageText","highlight","shouldRenderHqEmoji","formattedText","rawText","getMessageText","entities","renderTextWithEntities","organizeEntity","index","organizedEntityIndexes","offset","organizedIndexes","Set","has","nestedEntities","filter","parsedEntity","isChanged","organizedIndex","add","organizeEntities","organizedEntities","organizedEntity","shouldRenderAsHtml","renderMessagePart","deleteLineBreakAfterPre","renderEntity","textPartStart","textPartEnd","isLastEntity","renderResult","textBefore","substring","textBeforeLength","substr","entityStartIndex","entityEndIndex","entityContent","nestedEntityContent","ApiMessageEntityTypes","nestedIndex","nestedEntity","nestedEntityIndex","nestedResult","nestedEntityEndIndex","newEntity","rawEntityText","renderedContent","getLinkUrl","processEntityAsHtml","entityText","handleBotCommandClick","handleHashtagClick","href","rel","processEntity","isArray","textAfter","arrayIndex","c","emojiFilter","getDispatch","sendBotCommand","command","innerText","setLocalTextSearchQuery","query","searchTextMessagesLocal","ChatAnimationTypes","isPinned","isShown","unreadCount","hasUnreadMark","renderContent","unreadMentionsCount","formatIntegerCompact","ShowTransition","isCustom","lastMessage","replyToMessageId","isOutgoing","lastMessageSender","lastMessageAction","getMessageAction","actionTargetMessage","selectChatMessage","targetUserIds","actionTargetUserIds","targetChatId","actionTargetChatId","privateChatUserId","byId","usersById","users","currentChatId","threadId","currentThreadId","messageListType","selectCurrentMessageList","MAIN_THREAD_ID","draft","selectDraft","canScrollDown","lastMessageOutgoingStatus","selectOutgoingStatus","privateChatUser","folderId","orderDiff","animationType","openChat","focusLastMessage","isDeleteModalOpen","openDeleteModal","closeDeleteModal","shouldRenderDeleteModal","markRenderDeleteModal","unmarkRenderDeleteModal","isAction","isActionMessage","useEnsureMessage","mediaThumbnail","getMessageSticker","isRoundVideo","getMessageRoundVideo","actionTargetUsers","useLayoutEffect","Opacity","opacity","classList","Move","transform","remove","ANIMATION_END_DELAY","shouldReplaceHistory","contextActions","useChatContextActions","handleDelete","ListItem","Avatar","LastMessageMeta","TypingStatus","actionOrigin","renderActionMessageText","asPlain","senderName","getMessageSenderName","blobUrl","renderMessageSummary","renderLastMessageOrTyping","DeleteChatModal","folderType","chatFolder","selectChatFolder","animatedEmoji","selectAnimatedEmoji","foldersDispatch","onScreenSelect","handleEditFolder","payload","SettingsScreens","AnimatedEmoji","fluid","pill","FolderTypeToListType","chats","listIds","chatsById","orderedPinnedIds","listType","notifySettings","notifyExceptions","isActive","loadMoreChats","preloadTopChatMessages","openNextChat","currentListIds","currentPinnedIds","prepareFolderListIds","orderById","orderedIds","newChatArrays","prepareChatList","singleList","pinnedChats","otherChats","newOrderedIds","reduce","acc","prevOrderById","orderDiffById","mapValues","order","Infinity","loadMoreOfType","CHAT_LIST_SLICE","ALL_CHATS_PRELOAD_DISABLED","chatArrays","getAnimationType","movesUp","movesDown","orderDiffIds","Object","keys","Number","numberOfUp","numberOfDown","None","useChatAnimationType","handleKeyDown","IS_PWA","IS_MAC_OS","metaKey","ctrlKey","code","digit","match","position","altKey","targetIndexDelta","addEventListener","removeEventListener","InfiniteScroll","preloadBackwards","noFastList","viewportOffset","pinnedOffset","IS_ANDROID","CHAT_HEIGHT_PX","teactFastList","teactOrderKey","getChatOrder","renderChats","Loading","isQuick","onFileSelect","isHovered","markHovered","unmarkHovered","onDrop","onDragEnter","onDragLeave","relatedTarget","toTarget","DropAreaState","withQuick","onHide","hideTimeoutRef","prevWithQuick","captureEscKeyListener","handleFilesDrop","dataTransfer","dt","files","from","handleQuickFilesDrop","handleDragLeave","fromTarget","onDragOver","clearTimeout","EmojiTooltip","MAX_INPUT_HEIGHT","messageSendKeyCombo","replyingToId","selectReplyingToId","noTabCapture","isPollModalOpen","payment","isPaymentModalOpen","isAttachmentModalInput","editableInputId","html","forcedPlaceholder","shouldSetFocus","shouldSuppressFocus","shouldSuppressTextFormatter","onUpdate","onSuppressedFocus","onSend","editLastMessage","replyToNextMessage","cloneRef","isContextMenuOpenRef","isTextFormatterOpen","openTextFormatter","closeTextFormatter","textFormatterAnchorPosition","setTextFormatterAnchorPosition","selectedRange","setSelectedRange","updateInputHeight","useLayoutEffectWithPrevDeps","prevHtml","innerHTML","focusInput","focusEditableElement","handleCloseTextFormatter","selection","getSelection","removeAllRanges","empty","clearSelection","checkSelection","IS_IOS","rangeCount","selectionRange","getRangeAt","selectedText","toString","isSelectionInsideInput","EDITABLE_INPUT_ID","parseEmojiOnlyString","START_TO_END","processSelection","selectionRect","inputRect","top","willSend","input","clone","currentHeight","newHeight","scrollHeight","transitionDuration","log","abs","toggle","captureFirstTab","debounce","captureKeyboardListeners","onTab","suppressFocus","blur","contentEditable","textContent","onKeyDown","shiftKey","handleKeyUp","event","button","closeContextMenuMouseListener","closeContextMenuKeyListener","handleMouseUp","onContextMenu","onTouchCancel","anchorPosition","TEXT_FORMAT_BY_TAG_NAME","B","STRONG","I","EM","U","DEL","CODE","fragmentEl","containerRef","linkUrlInputRef","isLinkControlOpen","openLinkControl","closeLinkControl","linkUrl","setLinkUrl","isEditingLink","setIsEditingLink","inputClassName","setInputClassName","selectedTextFormats","setSelectedTextFormats","useVirtualBackdrop","selectedFormats","parentElement","commonAncestorContainer","textFormat","tagName","getSelectedText","getSelectedElement","updateInputStyles","offsetWidth","scrollWidth","scrollLeft","getFormatButtonClassName","some","fKey","monospace","strikethrough","handleBoldText","execCommand","bold","handleItalicText","italic","handleUnderlineText","underline","handleStrikethroughText","replaceWith","handleMonospaceText","handleLinkUrlConfirm","formattedLinkUrl","encodeURI","addRange","restoreSelection","handler","KeyK","KeyB","KeyU","KeyI","KeyM","KeyS","linkUrlConfirmClassName","autoComplete","inputMode","onScroll","ENTITY_CLASS_BY_NODE_NAME","S","STRIKE","PRE","BLOCKQUOTE","parseMessageInput","fragment","parsedHtml","IS_EMOJI_SUPPORTED","parseMarkdown","textIndex","recursionDeepness","addEntity","node","nodeName","anchor","dataset","entityType","getEntityTypeFromNode","rawIndex","getEntityDataFromNode","hasChildNodes","childNodes","RE_BR","RE_SPACE","RE_CLEAN_HTML","RE_EXTRA_NEW_LINE","prepareForRegExp","inputId","parentNode","iterations","emojiDataPromise","emojiRawData","emojiData","RE_EMOJI_SEARCH","RegExp","useEmojiTooltip","recentEmojiIds","onUpdateHtml","baseEmojiKeywords","emojiKeywords","isDisabled","markIsOpen","unmarkIsOpen","setById","keywords","setKeywords","byKeyword","setByKeyword","names","setNames","byName","setByName","shouldForceInsertEmoji","setShouldForceInsertEmoji","filteredEmojis","setFilteredEmojis","MEMO_EMPTY_ARRAY","recentEmojis","values","pickTruthy","emojis","uncompressEmoji","ensureEmojiData","byNative","buildCollectionByKey","baseEmojisByKeyword","natives","emojisByKeyword","emojisByName","getEmojiCode","forceSend","endsWith","matched","matchedKeywords","keyword","sort","concat","flatten","matchedNames","unique","insertEmoji","textEmoji","isForce","atIndex","lastIndexOf","messageInput","getElementById","native","isEmojiTooltipOpen","closeEmojiTooltip","searchUserName","usernameLowered","toLowerCase","fullNameLowered","filterLowered","searchWords","runThrottled","throttle","cb","RE_USERNAME_SEARCH","useMentionTooltip","canSuggestMembers","groupChatMembers","topInlineBotIds","usersToMention","setUsersToMention","topInlineBots","getFilteredUsers","withInlineBots","inlineBots","inlineBot","chatMembers","usernameFilter","getUsernameFilter","canSuggestInlineBots","insertMention","forceFocus","insertedHtml","isMentionTooltipOpen","closeMentionTooltip","mentionFilteredUsers","useAsyncRendering","dependencies","delay","shouldRenderRef","timeoutRef","forceUpdate","useForceUpdate","useOnChange","textParts","confirmLabel","confirmHandler","confirmIsDestructive","isButtonsInOneRow","onEnter","split","textPart","disabled","children","buttonClassName","tabIndex","itemSelector","sensitiveArea","noScrollRestoreOnTop","cacheBuster","stateRef","loadMoreBackwards","loadMoreForwards","noScroll","LoadMoreDirection","clientHeight","state","newScrollTop","listItemElements","querySelectorAll","currentAnchor","scrollTop","currentAnchorTop","nextAnchor","resetScroll","isScrollTopJustUpdated","handleScroll","listLength","offsetHeight","isNearTop","offsetTop","isNearBottom","isUpdated","nextAnchorTop","newAnchorTop","offsetParent","buttonRef","destructive","isTouched","markIsTouched","unmarkIsTouched","isContextMenuOpen","contextMenuPosition","handleBeforeContextMenu","handleContextMenu","handleContextMenuClose","handleContextMenuHide","useContextMenuHandlers","getTriggerElement","getRootElement","getMenuElement","positionX","positionY","menuStyle","useContextMenuPosition","handleMouseDown","role","autoClose","hasCloseButton","noBackdrop","shouldSkipHistoryAnimations","modalRef","onEsc","focusableElements","currentFocusedIndex","findIndex","em","isSameNode","activeElement","newFocusedIndex","trapFocus","forceClose","useHistoryBack","useEffectWithPrevDeps","prevIsOpen","body","dispatchHeavyAnimationEvent","Portal","containerId","onDismiss","setIsOpen","timerRef","closeAndDismiss","handleMouseEnter","handleMouseLeave","onMouseEnter","onMouseLeave","appendChild","TeactDOM","removeChild","RADIUSES","s","m","xl","square","circleRadius","STROKE_WIDTH","borderRadius","circumference","PI","svg","firstElementChild","strokeDashOffset","setAttribute","subLabel","hidden","options","selected","loadingOption","handleChange","option","parentContainerClassName","focused","onReset","onFocus","onBlur","isInputFocused","markInputFocused","unmarkInputFocused","prevChildren","fromChildrenRef","noAnimation","onCheck","active","badgeCount","isBadgeActive","previousActiveTab","tabRef","tab","indicator","prevTab","currentIndicator","shiftLeft","offsetLeft","scaleFactor","clientWidth","tabs","activeTab","big","onSwitchTab","useHorizontalScroll","activeTabElement","newLeft","fastSmoothScrollHorizontal","CLEANED_UP","Symbol","renderCount","shouldRestoreHeight","shouldCleanup","cleanupExceptionKey","onStart","onStop","getGlobal","currentKeyRef","rendersRef","prevActiveKey","activeKeyChanged","cleanup","childElements","isBackwards","prevActiveIndex","activeIndex","HTMLElement","dispatchHeavyAnimationStop","onAnimationEnd","watchedNode","firstChild","waitForAnimationEnd","flexBasis","renders","contents","render","INCLUDED_CHAT_TYPES","EXCLUDED_CHAT_TYPES","INCLUDE_FILTER_FIELDS","EXCLUDE_FILTER_FIELDS","selectChatFilters","mode","selectTemp","selectedChatIds","selectedChatTypes","includedChatIds","includeFilters","folder","excludedChatIds","excludeFilters","getSuggestedFolderName","filters","bots","groups","channels","contacts","nonContacts","INITIAL_STATE","chatFilter","foldersReducer","omit","error","useReducer","trackId","originalDuration","handlers","onInit","onForcePlay","noPlaylist","controllerRef","setIsPlaying","isPlayingSync","setPlayProgress","register","eventName","proxy","isFinite","currentTime","paused","isSafariPatchInProgress","prevShouldPlay","prevSrc","audioProxy","hasFocus","cache","Map","blurredRef","img","Image","imgToCanvas","fastBlur","blurredAsync","get","onload","blurredDataUri","clear","set","useBlur","noInitiallyBuffered","setIsBuffered","setBufferedProgress","setIsBufferedDebounced","handleBuffering","media","buffered","end","readyState","onLoadedData","onPlaying","onLoadStart","onPause","onTimeUpdate","onProgress","useCanvasBlur","withRaf","canvasRef","processBlur","alpha","IS_CANVAS_FILTER_SUPPORTED","drawImage","RADIUS","isInSearch","toggleChatPinned","toggleChatArchived","toggleChatUnread","actionPin","actionUnreadMark","actionMute","actionArchive","isChatArchived","actionDelete","getCanDeleteChat","isMenuDisabled","shouldDisableOnLink","shouldDisableOnLongTap","setIsContextMenuOpen","setContextMenuPosition","clientY","timer","clearLongPressTimer","startLongPressTimer","contains","originalEvent","touches","cancelClickOnce","stopImmediatePropagation","emulateContextMenuEvent","passive","extraPaddingX","extraTopPadding","setPositionX","setPositionY","setStyle","triggerEl","emptyRect","menuEl","rootEl","triggerRect","menuRect","rootRect","horizontalPostition","useCurrentOrPrev","shouldSkipUndefined","shouldForceCurrent","prev","messageId","replyOriginForId","loadMessage","loadMessageThrottled","throttled","deltaX","deltaY","listSlice","forceFullPreload","lastParamsRef","viewportIdsRef","newViewportIds","getViewportSlice","prevListIds","prevIsDisabled","offsetId","areSortedArraysEqual","areSomeLocal","areAllLocal","sourceIds","indexForDirection","to","useIntersectionObserver","rootRef","throttleMs","debounceMs","shouldSkipFirst","margin","threshold","rootCallback","rootCallbackRef","freezeFlagsRef","autoUnfreezeTimeoutRef","onUnfreezeRef","unfreeze","freeze","observer","disconnect","callbacks","observe","targetCallback","entriesAccumulator","observerCallbackSync","entries","entry","callback","scheduler","observerCallback","IntersectionObserver","root","rootMargin","initController","controller","delete","unobserve","useOnIntersect","targetRef","setIsIntersecting","debugKey","prevDeps","mediaHash","noLoad","mediaFormat","startedAt","Date","now","spentTime","setIsDownloadStarted","isHtmlAllowed","isStreaming","IS_PROGRESSIVE_SUPPORTED","setDownloadProgress","startedAtRef","handleProgress","closeTimeout","useMouseInside","menuCloseTimeout","isMouseInside","usePrevDuringAnimation","isCurrentPresent","isPrevPresent","reducer","initialState","reducerRef","setState","currentState","SPEED","fast","slow","willAnimate","setShouldRenderThumb","useVideoCleanup","videoRef","videoEl","load","mul_table","shg_table","boxBlurCanvasRGB","context","top_x","top_y","isNaN","imageData","getImageData","pixels","rsum","gsum","bsum","p","p1","p2","yp","yi","yw","wm","hm","rad1","r","g","b","mul_sum","shg_sum","vmin","vmax","putImageData","tracks","currentTrackId","queue","stopCurrentAudio","currentTrack","Audio","handleEvent","nextTrackId","openAudioPlayer","parseMessageKey","nextTrack","safePlay","Proxy","createAudio","preload","IS_SAFARI","patchSafariProgressiveAudio","time","shouldRemoveFromQueue","track","h","captureEvent","initialSwipeAxis","hasMoved","hasSwiped","onCapture","excludedClosestSelector","onMove","onRelease","pageX","pageY","withCursor","scrollable","overflow","dragOffsetX","dragOffsetY","shouldPreventScroll","onDrag","innerWidth","xAbs","yAbs","axis","currentSwipeAxis","Left","Right","Up","Down","processSwipe","CLIPBOARD_ITEM_SUPPORTED","navigator","clipboard","ClipboardItem","textCopyEl","str","rangeToRestore","select","copyImageToClipboard","imageUrl","imageEl","toBlob","copyBlobToClipboard","pngBlob","write","DEBUG","console","waitForTransitionEnd","propertyName","waitForEndEvent","animationName","eventType","detailedName","isHandled","handleAnimationEnd","TransitionEvent","AnimationEvent","cycleRestrict","filename","click","isAnimating","fastSmoothScroll","maxDistance","FAST_SMOOTH_MAX_DISTANCE","forceDirection","forceDuration","forceNormalContainerHeight","scrollFrom","elementTop","FocusDirection","calculateScrollFrom","ANIMATION_LEVEL_MIN","scrollWithJs","isAnimatingScroll","elementHeight","currentScrollTop","containerHeight","targetContainerHeight","normalHeight","path","remainingPath","absPath","transition","FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE","shortTransition","longTransition","FAST_SMOOTH_MIN_DURATION","FAST_SMOOTH_MAX_DURATION","startAt","onHeavyAnimationStop","animateSingle","t","currentPath","containerWidth","animate","scrollTo","behavior","force","range","createRange","lastChild","nodeValue","selectNodeContents","collapse","audioEl","patchedForSafari","patchForSafariInProgress","once","mediaEl","catch","err","warn"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/514.c2aea8c517396debc7b4.js b/dist/514.c2aea8c517396debc7b4.js deleted file mode 100644 index b1ebcaa4..00000000 --- a/dist/514.c2aea8c517396debc7b4.js +++ /dev/null @@ -1,2 +0,0 @@ -(()=>{var e,t,n={6514:(e,t,n)=>{"use strict";var s={};n.r(s),n.d(s,{Type:()=>ft,clear:()=>_t,fetch:()=>ht,save:()=>mt});var a={};n.r(a),n.d(a,{addChatMembers:()=>yn,answerCallbackButton:()=>ya,blockContact:()=>Qs,checkChatUsername:()=>Ms,checkPassword:()=>xs,checkUsername:()=>Gs,clearDraft:()=>qt,clearPassword:()=>Vs,createChannel:()=>Gt,createGroupChat:()=>Jt,deleteChannel:()=>$t,deleteChat:()=>Wt,deleteChatFolder:()=>nn,deleteChatMember:()=>bn,deleteChatUser:()=>zt,deleteHistory:()=>Fn,deleteMessages:()=>xn,deleteScheduledMessages:()=>Vn,deleteUser:()=>ds,destroy:()=>vt,disconnect:()=>At,downloadMedia:()=>Rt,editChatFolder:()=>tn,editChatPhoto:()=>Qt,editMessage:()=>Un,faveSticker:()=>hs,fetchAnimatedEmojis:()=>_s,fetchAuthorizations:()=>Zs,fetchBlockedContacts:()=>Js,fetchChat:()=>Nt,fetchChatFolders:()=>Yt,fetchChats:()=>xt,fetchContactList:()=>rs,fetchContentSettings:()=>pa,fetchCurrentUser:()=>Dt,fetchEmojiKeywords:()=>vs,fetchFavoriteStickers:()=>ps,fetchFeaturedStickers:()=>fs,fetchFullChat:()=>Vt,fetchFullUser:()=>ss,fetchGroupsForDiscussion:()=>fn,fetchInlineBot:()=>wa,fetchInlineBotResults:()=>Ia,fetchLangPack:()=>ra,fetchLangStrings:()=>oa,fetchLanguages:()=>ia,fetchMembers:()=>pn,fetchMessage:()=>Sn,fetchMessages:()=>An,fetchNearestCountry:()=>as,fetchNotificationExceptions:()=>ta,fetchNotificationSettings:()=>na,fetchPinnedMessages:()=>Zn,fetchPrivacySettings:()=>ca,fetchProfilePhotos:()=>ls,fetchRecentStickers:()=>gs,fetchRecommendedChatFolders:()=>en,fetchSavedGifs:()=>bs,fetchScheduledHistory:()=>Jn,fetchStickerSets:()=>us,fetchStickers:()=>ms,fetchStickersForEmoji:()=>Ps,fetchTopInlineBots:()=>ba,fetchTopUsers:()=>is,fetchUsers:()=>os,fetchWallpapers:()=>js,fetchWebPagePreview:()=>Kn,findFirstMessageIdAfterDate:()=>$n,forwardMessages:()=>jn,getChatByUsername:()=>an,getPasswordInfo:()=>Ts,getPaymentForm:()=>ka,getReceipt:()=>Ra,importChatInvite:()=>Cn,installStickerSet:()=>ws,joinChannel:()=>Kt,leaveChannel:()=>jt,loadPollOptionResults:()=>Wn,markMessageListRead:()=>On,markMessagesRead:()=>Ln,migrateChat:()=>mn,openChatByInvite:()=>_n,pinMessage:()=>Tn,provideAuthCode:()=>it,provideAuthPassword:()=>rt,provideAuthPhoneNumber:()=>at,provideAuthRegistration:()=>ot,provideRecoveryEmailCode:()=>Os,registerDevice:()=>da,reportMessages:()=>Nn,requestChatUpdate:()=>Ot,requestThreadInfoUpdate:()=>qn,rescheduleMessage:()=>En,restartAuth:()=>ct,restartAuthWithQr:()=>dt,saveDraft:()=>Lt,searchChats:()=>Ft,searchGifs:()=>Cs,searchMessagesGlobal:()=>Gn,searchMessagesLocal:()=>Hn,searchStickers:()=>ys,sendInlineBotResult:()=>Ca,sendMessage:()=>kn,sendPaymentForm:()=>Ma,sendPollVote:()=>zn,sendScheduledMessages:()=>Qn,setChatUsername:()=>ks,setDiscussionGroup:()=>hn,setPrivacySettings:()=>ua,startBot:()=>Pa,terminateAllAuthorizations:()=>ea,terminateAuthorization:()=>Ys,toggleChatArchived:()=>Zt,toggleChatPinned:()=>Xt,toggleDialogUnread:()=>sn,togglePreHistoryHidden:()=>rn,toggleSignatures:()=>gn,unblockContact:()=>Xs,uninstallStickerSet:()=>Is,unpinAllMessages:()=>Bn,unregisterDevice:()=>la,updateChatAbout:()=>un,updateChatAdmin:()=>dn,updateChatDefaultBannedRights:()=>on,updateChatMemberBannedRights:()=>cn,updateChatMutedState:()=>Ht,updateChatTitle:()=>ln,updateContact:()=>cs,updateContactSignUpNotification:()=>sa,updateContentSettings:()=>fa,updateIsOnline:()=>ga,updateNotificationSettings:()=>aa,updatePassword:()=>Fs,updatePrivateLink:()=>Rs,updateProfile:()=>Hs,updateProfilePhoto:()=>zs,updateRecoveryEmail:()=>Ns,updateUsername:()=>Ks,uploadProfilePhoto:()=>Ws,uploadWallpaper:()=>$s,validateRequestedInfo:()=>Sa});const i=("undefined"!=typeof window&&window.innerHeight,Math.round(425)),r=new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory"]);new Set(["image/png","image/gif","image/jpeg","video/mp4","video/avi","video/quicktime"]);var o=n(3522);function c(e,t){return e.reduce(((e,n)=>(e[n[t]]=n,e)),{})}function d(e,t){return t.reduce(((t,n)=>(t[n]=e[n],t)),{})}function l(e){return e.hasOwnProperty("userId")}function u(e){return e.hasOwnProperty("chatId")}function g(e,t=!1,n="image/jpeg"){return`${t?"":`data:${n};base64,`}${btoa(String.fromCharCode(...e))}`}function p(e){if(!e)return;const{flags:t,CONSTRUCTOR_ID:n,SUBCLASS_OF_ID:s,className:a,classType:i,...r}=e;return r}const f=e=>Math.floor(Date.now()/1e3)+e;function h(e,t=!1){const n=Boolean("min"in e&&e.min),s="accessHash"in e&&String(e.accessHash),a="photo"in e&&e.photo&&M(e.photo),i=Boolean("signatures"in e&&e.signatures);return{isMin:n,hasPrivateLink:Boolean("hasLink"in e&&e.hasLink),isSignaturesShown:i,...s&&{accessHash:s},...a&&{avatarHash:a},...(e instanceof o.Api.Channel||e instanceof o.Api.User)&&{username:e.username},..."verified"in e&&{isVerified:e.verified},..."callActive"in e&&{isCallActive:e.callActive},..."callNotEmpty"in e&&{isCallNotEmpty:e.callNotEmpty},...(e instanceof o.Api.Chat||e instanceof o.Api.Channel)&&{...e.participantsCount&&{membersCount:e.participantsCount},joinDate:e.date},...t&&{isSupport:!0},..._(e),..."creator"in e&&{isCreator:e.creator},...y(e),...b(e)}}function m(e,t,n){const{peer:s,folderId:a,unreadMark:i,unreadCount:r,unreadMentionsCount:c,notifySettings:{silent:d,muteUntil:l},readOutboxMaxId:u,readInboxMaxId:g,draft:p}=e,m=d||"number"==typeof l&&f(n)"all"===e));return t?d(t,["reason","text"]):void 0}(e.restrictionReason):void 0;n&&Object.assign(t,{isRestricted:!0,restrictionReason:n})}return e instanceof o.Api.Chat&&Object.assign(t,{isNotJoined:e.left,isRestricted:e.kicked}),e instanceof o.Api.Channel&&Object.assign(t,{isNotJoined:e.left}),t}function b(e){return e instanceof o.Api.Chat&&e.migratedTo&&!(e.migratedTo instanceof o.Api.InputChannelEmpty)?{migratedTo:{chatId:I(e.migratedTo),...e.migratedTo instanceof o.Api.InputChannel&&{accessHash:e.migratedTo.accessHash.toString()}}}:{}}function w(e,t=!1,n=!1){if(e instanceof o.Api.Chat||e instanceof o.Api.Channel||e instanceof o.Api.User||n&&(e instanceof o.Api.ChatForbidden||e instanceof o.Api.ChannelForbidden))return{id:e instanceof o.Api.User?e.id:-e.id,type:P(e),title:e instanceof o.Api.User?S(e):e.title,...h(e,t)}}function I(e){return l(e)?e.userId:u(e)?-e.chatId:-e.channelId}function C(e){return function(e){return e.hasOwnProperty("userId")}(e)?e.userId:function(e){return e.hasOwnProperty("chatId")}(e)?-e.chatId:function(e){return e.hasOwnProperty("channelId")}(e)?-e.channelId:void 0}function P(e){return e instanceof o.Api.User||e instanceof o.Api.UserEmpty?"chatTypePrivate":e instanceof o.Api.Chat||e instanceof o.Api.ChatForbidden||e instanceof o.Api.ChatEmpty?"chatTypeBasicGroup":e.megagroup?"chatTypeSuperGroup":"chatTypeChannel"}function v(e){return l(e)?`user${e.userId}`:u(e)?`chat${e.chatId}`:`chat${e.channelId}`}function A(e,t){return l(e)?S(t):t.title}function S(e){return e.firstName?`${e.firstName}${e.lastName?` ${e.lastName}`:""}`:e.lastName||void 0}function M(e){if("photoId"in e)return e.photoId.toString()}function k(e){return{userId:e instanceof o.Api.ChannelParticipantBanned||e instanceof o.Api.ChannelParticipantLeft?I(e.peer):e.userId,inviterId:"inviterId"in e?e.inviterId:void 0,joinedDate:"date"in e?e.date:void 0,kickedByUserId:"kickedBy"in e?e.kickedBy:void 0,promotedByUserId:"promotedBy"in e?e.promotedBy:void 0,bannedRights:"bannedRights"in e?p(e.bannedRights):void 0,adminRights:"adminRights"in e?p(e.adminRights):void 0,customTitle:"rank"in e?e.rank:void 0,...(e instanceof o.Api.ChannelParticipantAdmin||e instanceof o.Api.ChatParticipantAdmin)&&{isAdmin:!0},...(e instanceof o.Api.ChannelParticipantCreator||e instanceof o.Api.ChatParticipantCreator)&&{isOwner:!0}}}function R(e){return e instanceof o.Api.ChatParticipants||e instanceof o.Api.channels.ChannelParticipants?e.participants.map(k).filter(Boolean):void 0}function U(e,t){let n="";if(!(e.action instanceof o.Api.SendMessageCancelAction))return e.action instanceof o.Api.SendMessageTypingAction?n="lng_user_typing":e.action instanceof o.Api.SendMessageRecordVideoAction?n="lng_send_action_record_video":e.action instanceof o.Api.SendMessageUploadVideoAction?n="lng_send_action_upload_video":e.action instanceof o.Api.SendMessageRecordAudioAction?n="lng_send_action_record_audio":e.action instanceof o.Api.SendMessageUploadAudioAction?n="lng_send_action_upload_audio":e.action instanceof o.Api.SendMessageUploadPhotoAction?n="lng_send_action_upload_photo":e.action instanceof o.Api.SendMessageUploadDocumentAction?n="lng_send_action_upload_file":e.action instanceof o.Api.SendMessageGeoLocationAction?n="selecting a location to share":e.action instanceof o.Api.SendMessageChooseContactAction?n="selecting a contact to share":e.action instanceof o.Api.SendMessageGamePlayAction?n="lng_playing_game":e.action instanceof o.Api.SendMessageRecordRoundAction?n="lng_send_action_record_round":e.action instanceof o.Api.SendMessageUploadRoundAction&&(n="lng_send_action_upload_round"),{action:n,...!(e instanceof o.Api.UpdateUserTyping)&&{userId:I(e.fromId)},timestamp:Date.now()+1e3*t}}function E(e){return{...(t=e,n=["id","title","emoticon","contacts","nonContacts","groups","bots","excludeMuted","excludeRead","excludeArchived"],n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{})),channels:e.broadcasts,pinnedChatIds:e.pinnedPeers.map(C).filter(Boolean),includedChatIds:e.includePeers.map(C).filter(Boolean),excludedChatIds:e.excludePeers.map(C).filter(Boolean)};var t,n}function D({filter:e,description:t}){return{...E(e),description:t}}function T(e){return e.reduce(((e,t)=>e.concat(t.commands.map((e=>({botId:t.userId,...p(e)}))))),[])}var B=n(8960);function x(e,t,n){return''.replace("{{path}}",function(e){let t="M";const n=e.length;for(let s=0;s=192?t+="AACAAAAHAAALMAAAQASTAVAAAZaacaaaahaaalmaaaqastava.az0123456789-,"[n-128-64]:(n>=128?t+=",":n>=64&&(t+="-"),t+=String(63&n))}return t+="z",t}(e)).replace("{{width}}",String(t)).replace("{{height}}",String(n))}const V={w:100,h:100};function F(e,t){if(!e||!e.length)return;const n=e.find((e=>e instanceof o.Api.PhotoStrippedSize));if(!n)return;const s=e.filter((e=>e instanceof o.Api.PhotoSize)),{w:a,h:i}=s.length?s[s.length-1]:V,{bytes:r}=n;return{dataUri:g(t&&"image/jpeg"!==t?r:(0,B.strippedPhotoToJpg)(r),void 0,t),width:a,height:i}}function N(e){const t=e.sizes.filter((e=>e instanceof o.Api.PhotoSize||e instanceof o.Api.PhotoSizeProgressive)).map(O);return{id:String(e.id),thumbnail:F(e.sizes),sizes:t}}function O(e){const{w:t,h:n,type:s}=e;return{width:t,height:n,type:s}}const L={localMessages:{},chats:{},users:{},messages:{},documents:{},stickerSets:{},photos:{},webDocuments:{}},q="application/x-tgsticker";function H(e){if(e instanceof o.Api.DocumentEmpty)return;const t=e.attributes.find((e=>e instanceof o.Api.DocumentAttributeSticker)),n=e.mimeType===q&&e.attributes.find((e=>e instanceof o.Api.DocumentAttributeFilename));if(!t&&!n)return;const s=e.attributes.find((e=>e instanceof o.Api.DocumentAttributeImageSize)),a=t&&t.stickerset instanceof o.Api.InputStickerSetID?t.stickerset:void 0,i=null==t?void 0:t.alt,r=e.mimeType===q,c=e.thumbs&&e.thumbs.find((e=>e instanceof o.Api.PhotoCachedSize)),d=e.thumbs&&e.thumbs.find((e=>e instanceof o.Api.PhotoPathSize)),l=c?function(e){const{w:t,h:n,bytes:s}=e;return{dataUri:g(s,void 0,"image/webp"),width:t,height:n}}(c):d&&s?function(e,t){const{w:n,h:s}=t;return{dataUri:`data:image/svg+xml;utf8,${x(e.bytes,n,s)}`,width:n,height:s}}(d,s):void 0,{w:u,h:p}=c||s||{};return{id:String(e.id),stickerSetId:a?String(a.id):"MEMOJI_STICKER",stickerSetAccessHash:a&&String(a.accessHash),emoji:i,isAnimated:r,width:u,height:p,thumbnail:l}}function G(e){const{archived:t,animated:n,installedDate:s,id:a,accessHash:i,title:r,thumbs:o,count:c,hash:d,shortName:l}=e;return{archived:t,isAnimated:n,installedDate:s,id:String(a),accessHash:String(i),title:r,hasThumbnail:Boolean(null==o?void 0:o.length),count:c,hash:d,shortName:l}}function K(e){const t=G(e.set),n=e instanceof o.Api.StickerSetMultiCovered?e.covers:[e.cover];return t.covers=[],n.forEach((e=>{if(e instanceof o.Api.Document){const n=H(e);n&&(t.covers.push(n),L.documents[String(e.id)]=e)}})),t}function z(e,t){let n=0;const s=new Array(t),a=e.length/t,i=e[0],r=e[e.length-1];for(let l=0;l0?"user":e<=-1e9?"channel":"chat"}function Y(e){return e>0?new o.Api.PeerUser({userId:e}):e<=-1e9?new o.Api.PeerChannel({channelId:-e}):new o.Api.PeerChat({chatId:-e})}function ee(e,t){return e>0||e<=-1e9?e>0?new o.Api.InputPeerUser({userId:e,accessHash:j()(t)}):new o.Api.InputPeerChannel({channelId:-e,accessHash:j()(t)}):new o.Api.InputPeerChat({chatId:-e})}function te(e){if(e>0){const{accessHash:t}=L.users[e]||{};return t?new o.Api.InputPeerUser({userId:e,accessHash:t}):void 0}if(e<=-1e9){const{accessHash:t}=L.chats[-e]||{};return t?new o.Api.InputPeerChannel({channelId:-e,accessHash:t}):void 0}return new o.Api.InputPeerChat({chatId:-e})}function ne(e,t){return e>0?new o.Api.InputUser({userId:e,accessHash:j()(t)}):e<=-1e9?new o.Api.InputChannel({channelId:-e,accessHash:j()(t)}):-e}function se(e,t){return new o.Api.InputStickerSetID({id:j()(e),accessHash:j()(t)})}function ae(e){const t=L.documents[e.id];if(t)return new o.Api.InputDocument(d(t,["id","accessHash","fileReference"]))}function ie(e){const t=ae(e);if(t)return new o.Api.InputMediaDocument({id:t})}function re(){return(0,$.readBigIntFromBuffer)((0,$.generateRandomBytes)(8),!0,!0)}function oe(e,t,n){return new o.Api.Message({id:e,peerId:Y(t),fromId:Y(t),media:n.media})}function ce(e){const{type:t,offset:n,length:s,url:a,userId:i}=e,r=i?L.users[i]:void 0;switch(t){case J.Bold:return new o.Api.MessageEntityBold({offset:n,length:s});case J.Italic:return new o.Api.MessageEntityItalic({offset:n,length:s});case J.Underline:return new o.Api.MessageEntityUnderline({offset:n,length:s});case J.Strike:return new o.Api.MessageEntityStrike({offset:n,length:s});case J.Code:return new o.Api.MessageEntityCode({offset:n,length:s});case J.Pre:return new o.Api.MessageEntityPre({offset:n,length:s,language:""});case J.Blockquote:return new o.Api.MessageEntityBlockquote({offset:n,length:s});case J.TextUrl:return new o.Api.MessageEntityTextUrl({offset:n,length:s,url:a});case J.Url:return new o.Api.MessageEntityUrl({offset:n,length:s});case J.Hashtag:return new o.Api.MessageEntityHashtag({offset:n,length:s});case J.MentionName:return new o.Api.InputMessageEntityMentionName({offset:n,length:s,userId:new o.Api.InputUser({userId:i,accessHash:r.accessHash})});default:return new o.Api.MessageEntityUnknown({offset:n,length:s})}}function de(e){let t=0;return e.forEach((e=>{t=(20261*t&2147483647)+e&2147483647})),t}function le(e){const{media:t}=e;return!!t&&(t instanceof o.Api.MessageMediaPhoto||t instanceof o.Api.MessageMediaDocument||t instanceof o.Api.MessageMediaWebPage&&t.webpage instanceof o.Api.WebPage&&(t.webpage.photo instanceof o.Api.Photo||t.webpage.document instanceof o.Api.Document&&t.webpage.document.mimeType.startsWith("video")))}function ue({phone:e,firstName:t,lastName:n}){return new o.Api.InputPhoneContact({clientId:j()(1),phone:e,firstName:t,lastName:n})}function ge(e,t=0){return new o.Api.ChatBannedRights({...e,untilDate:t})}function pe(e){return new o.Api.ChatAdminRights(e)}function fe(e){const{shippingAddress:t}=e;return new o.Api.PaymentRequestedInfo({...e,shippingAddress:t?new o.Api.PostAddress(t):void 0})}function he(e){switch(e){case"phoneNumber":return new o.Api.InputPrivacyKeyPhoneNumber;case"lastSeen":return new o.Api.InputPrivacyKeyStatusTimestamp;case"profilePhoto":return new o.Api.InputPrivacyKeyProfilePhoto;case"forwards":return new o.Api.InputPrivacyKeyForwards;case"chatInvite":return new o.Api.InputPrivacyKeyChatInvite}}function me(e){switch(e){case"spam":return new o.Api.InputReportReasonSpam;case"violence":return new o.Api.InputReportReasonViolence;case"childAbuse":return new o.Api.InputReportReasonChildAbuse;case"pornography":return new o.Api.InputReportReasonPornography;case"copyright":return new o.Api.InputReportReasonCopyright;case"fake":return new o.Api.InputReportReasonFake;case"geoIrrelevant":return new o.Api.InputReportReasonGeoIrrelevant;case"other":return new o.Api.InputReportReasonOther}}function _e(e){if(e instanceof o.Api.Message||e instanceof o.Api.MessageService)return I(e.peerId)}function ye(e){const t=`${_e(e)}-${e.id}`;L.messages[t]=e,e instanceof o.Api.Message&&e.media instanceof o.Api.MessageMediaDocument&&e.media.document instanceof o.Api.Document&&(L.documents[String(e.media.document.id)]=e.media.document),e instanceof o.Api.Message&&e.media instanceof o.Api.MessageMediaWebPage&&e.media.webpage instanceof o.Api.WebPage&&e.media.webpage.document instanceof o.Api.Document&&(L.documents[String(e.media.webpage.document.id)]=e.media.webpage.document),e instanceof o.Api.MessageService&&"photo"in e.action&&be(e.action.photo)}function be(e){e instanceof o.Api.Photo&&(L.photos[String(e.id)]=e)}let we,Ie,Ce=1e9;function Pe(e){const t=_e(e);if(t&&(e instanceof o.Api.Message||e instanceof o.Api.MessageService))return ve(t,e)}function ve(e,t){const n=t.fromId?I(t.fromId):void 0,s=t.peerId?I(t.peerId):void 0,a=!n&&e===we,i=t.out&&!t.post||a&&!t.fwdFrom;let r={};t.media&&(r={...Me(t.media)}),!t.message||r.sticker||r.poll||r.contact||(r={...r,text:Ae(t.message,t.entities)});const c=t.action&&function(e,t,n,s,a){if(e instanceof o.Api.MessageActionEmpty)return;let i,r,c;const d=[];let l,u="other";const g="users"in e?e.users&&e.users:"userId"in e&&[e.userId]||[];let p;if(e instanceof o.Api.MessageActionChatCreate)c="Notification.CreatedChatWithTitle",d.push("%action_origin%",e.title),u="chatCreate";else if(e instanceof o.Api.MessageActionChatEditTitle)s?(c="Channel.MessageTitleUpdated",d.push(e.title)):(c="Notification.ChangedGroupName",d.push("%action_origin%",e.title));else if(e instanceof o.Api.MessageActionChatEditPhoto)s?c="Channel.MessagePhotoUpdated":(c="Notification.ChangedGroupPhoto",d.push("%action_origin%"));else if(e instanceof o.Api.MessageActionChatDeletePhoto)c=s?"Channel.MessagePhotoRemoved":"Group.MessagePhotoRemoved";else if(e instanceof o.Api.MessageActionChatAddUser)!t||g.includes(t)?(c="Notification.JoinedChat",d.push("%target_user%")):(c="Notification.Invited",d.push("%action_origin%","%target_user%"));else if(e instanceof o.Api.MessageActionChatDeleteUser)!t||g.includes(t)?(c="Notification.LeftChat",d.push("%target_user%")):(c="Notification.Kicked",d.push("%action_origin%","%target_user%"));else if(e instanceof o.Api.MessageActionChatJoinedByLink)c="Notification.JoinedGroupByLink",d.push("%action_origin%");else if(e instanceof o.Api.MessageActionChannelCreate)c="Notification.CreatedChannel";else if(e instanceof o.Api.MessageActionChatMigrateTo)p=I(e),c="Migrated to %target_chat%",d.push("%target_chat%");else if(e instanceof o.Api.MessageActionChannelMigrateFrom)p=I(e),c="Migrated from %target_chat%",d.push("%target_chat%");else if(e instanceof o.Api.MessageActionPinMessage)c="Chat.Service.Group.UpdatedPinnedMessage1",d.push("%action_origin%","%message%");else if(e instanceof o.Api.MessageActionHistoryClear)c="HistoryCleared",u="historyClear";else if(e instanceof o.Api.MessageActionPhoneCall){const t=Boolean(e.duration);if(c=[t?"ChatList.Service":"Chat",e.video?"VideoCall":"Call",a?t?"outgoing":"Outgoing":t?"incoming":"Incoming"].join("."),t){const t=Math.max(Math.round(e.duration/60),1);d.push(`${t} min${t>1?"s":""}`)}}else if(e instanceof o.Api.MessageActionContactSignUp)c="Notification.Joined",d.push("%action_origin%"),u="contactSignUp";else if(e instanceof o.Api.MessageActionPaymentSent)i=Number(e.totalAmount),r=e.currency,c="PaymentSuccessfullyPaid",n&&g.push(n),d.push("%payment_amount%","%target_user%","%product%");else if(e instanceof o.Api.MessageActionGroupCall)if(e.duration){const t=Math.max(Math.round(e.duration/60),1);c="Notification.VoiceChatEnded",d.push(`${t} min${t>1?"s":""}`)}else c="Notification.VoiceChatStartedChannel";else e instanceof o.Api.MessageActionBotAllowed?(c="Chat.Service.BotPermissionAllowed",d.push(e.domain)):c="ChatList.UnsupportedMessage";return"photo"in e&&e.photo instanceof o.Api.Photo&&(be(e.photo),l=N(e.photo)),{text:c,type:u,targetUserIds:g,targetChatId:p,photo:l,amount:i,currency:r,translationValues:d}}(t.action,n,s,Boolean(t.post),i);c&&(r.action=c);const{replyToMsgId:d,replyToTopId:l}=t.replyTo||{},u=t.editDate&&!t.editHide,{inlineButtons:g,keyboardButtons:p,keyboardPlaceholder:f,isKeyboardSingleUse:h}=function(e){const{id:t,replyMarkup:n,media:s}=e;if(!n)return s instanceof o.Api.MessageMediaWebPage&&s.webpage instanceof o.Api.WebPage&&"telegram_message"===s.webpage.type?{inlineButtons:[[{type:"url",text:"Show Message",messageId:t,value:s.webpage.url}]]}:void 0;if(!(n instanceof o.Api.ReplyKeyboardMarkup||n instanceof o.Api.ReplyInlineMarkup))return;const a=n.rows.map((({buttons:e})=>e.map((e=>{let n,a,{text:i}=e;return e instanceof o.Api.KeyboardButton?(n="command",a=i):e instanceof o.Api.KeyboardButtonUrl?(n="url",a=e.url):e instanceof o.Api.KeyboardButtonCallback?(n="callback",a=String(e.data)):e instanceof o.Api.KeyboardButtonRequestPoll?n="requestPoll":e instanceof o.Api.KeyboardButtonBuy?(s instanceof o.Api.MessageMediaInvoice&&s.receiptMsgId&&(i="PaymentReceipt",a=s.receiptMsgId),n="buy"):n="NOT_SUPPORTED",{type:n,text:i,messageId:t,value:a}}))));return{[n instanceof o.Api.ReplyKeyboardMarkup?"keyboardButtons":"inlineButtons"]:a,...n instanceof o.Api.ReplyKeyboardMarkup&&{keyboardPlaceholder:n.placeholder,isKeyboardSingleUse:n.singleUse}}}(t)||{},m=t.fwdFrom&&function(e,t=!1){const n=e.savedFromPeer&&I(e.savedFromPeer),s=e.fromId&&I(e.fromId);return{isChannelPost:Boolean(e.channelPost),channelPostId:e.channelPost,isLinkedChannelPost:Boolean(e.channelPost&&n&&!t),fromChatId:n||s,fromMessageId:e.channelPost||e.savedFromMsgId,senderUserId:s,hiddenUserName:e.fromName,adminTitle:e.postAuthor}}(t.fwdFrom,a),{replies:_,mediaUnread:y,postAuthor:b}=t,w=t.groupedId&&t.groupedId.toString(),C=Boolean(w)&&!(r.document||r.audio),P=t.replyMarkup instanceof o.Api.ReplyKeyboardHide;return{id:t.id,chatId:e,isOutgoing:i,content:r,date:t.date,senderId:n||t.out&&t.post&&we||e,views:t.views,isFromScheduled:t.fromScheduled,...d&&{replyToMessageId:d},...l&&{replyToTopMessageId:l},...m&&{forwardInfo:m},...u&&{isEdited:u},...y&&{isMediaUnread:y},...t.mentioned&&y&&{hasUnreadMention:!0},...w&&{groupedId:w,isInAlbum:C},inlineButtons:g,...p&&{keyboardButtons:p,keyboardPlaceholder:f,isKeyboardSingleUse:h},...P&&{shouldHideKeyboardButtons:P},...t.viaBotId&&{viaBotId:t.viaBotId},...(null==_?void 0:_.comments)&&{threadInfo:Ve(_,t.id,e)},...b&&{adminTitle:b}}}function Ae(e,t){return{text:e,...t&&{entities:t.map(xe)}}}function Se(e){if(e instanceof o.Api.DraftMessageEmpty)return;const{message:t,entities:n,replyToMsgId:s,date:a}=e;return{formattedText:t?Ae(t,n):void 0,replyingToId:s,date:a}}function Me(e){const t=function(e){if(e instanceof o.Api.MessageMediaDocument&&e.document&&e.document instanceof o.Api.Document)return H(e.document)}(e);if(t)return{sticker:t};const n=function(e){if(e instanceof o.Api.MessageMediaPhoto&&e.photo&&e.photo instanceof o.Api.Photo&&!e.ttlSeconds)return N(e.photo)}(e);if(n)return{photo:n};const s=function(e){if(e instanceof o.Api.MessageMediaDocument&&e.document instanceof o.Api.Document&&e.document.mimeType.startsWith("video"))return ke(e.document)}(e);if(s)return{video:s};const a=function(e){if(!(e instanceof o.Api.MessageMediaDocument&&e.document&&e.document instanceof o.Api.Document))return;const t=e.document.attributes.find((e=>e instanceof o.Api.DocumentAttributeAudio));return t&&!t.voice?{fileName:Te(e.document,"audio"),...d(e.document,["size","mimeType"]),...d(t,["duration","performer","title"])}:void 0}(e);if(a)return{audio:a};const i=function(e){if(!(e instanceof o.Api.MessageMediaDocument&&e.document&&e.document instanceof o.Api.Document))return;const t=e.document.attributes.find((e=>e instanceof o.Api.DocumentAttributeAudio));if(!t||!t.voice)return;const{duration:n,waveform:s}=t;return{duration:n,waveform:s?Array.from(s):void 0}}(e);if(i)return{voice:i};const r=function(e){if(e instanceof o.Api.MessageMediaDocument&&e.document&&!e.ttlSeconds)return Re(e.document)}(e);if(r)return{document:r};const c=function(e){if(e instanceof o.Api.MessageMediaContact)return d(e,["firstName","lastName","phoneNumber","userId"])}(e);if(c)return{contact:c};const l=function(e){if(e instanceof o.Api.MessageMediaPoll)return Ue(e.poll,e.results)}(e);if(l)return{poll:l};const u=De(e);if(u)return{webPage:u};const g=function(e){if(e instanceof o.Api.MessageMediaInvoice)return function(e){const{description:t,title:n,photo:s,test:a,totalAmount:i,currency:r,receiptMsgId:o}=e;return{text:t,title:n,photoUrl:null==s?void 0:s.url,receiptMsgId:o,amount:Number(i),currency:r,isTest:a}}(e)}(e);return g?{invoice:g}:void 0}function ke(e){if(e instanceof o.Api.DocumentEmpty)return;const{id:t,mimeType:n,thumbs:s,size:a,attributes:i}=e,r=i.find((e=>e instanceof o.Api.DocumentAttributeVideo));if(!r)return;const c=i.find((e=>e instanceof o.Api.DocumentAttributeAnimated)),{duration:d,w:l,h:u,supportsStreaming:g=!1,roundMessage:p=!1}=r;return{id:String(t),mimeType:n,duration:d,fileName:Te(e,"video"),width:l,height:u,supportsStreaming:g,isRound:p,isGif:Boolean(c),thumbnail:F(s),size:a}}function Re(e){if(!(e instanceof o.Api.Document))return;const{id:t,size:n,mimeType:s,date:a,thumbs:i,attributes:r}=e,c=i&&F(i);let d,l;const u=i&&i.find((e=>e instanceof o.Api.PhotoSize));if(u)if(l={width:u.w,height:u.h},s.startsWith("image/")){d="photo";const e=r.find((e=>e instanceof o.Api.DocumentAttributeImageSize));if(e){const{w:t,h:n}=e;l={width:t,height:n}}}else s.startsWith("video/")&&(d="video");return{id:String(t),size:n,mimeType:s,timestamp:a,fileName:Te(e),thumbnail:c,mediaType:d,mediaSize:l}}function Ue(e,t){const{id:n,answers:s}=e,a=s.map((e=>({text:e.text,option:String.fromCharCode(...e.option)})));return{id:n.toString(),summary:{isPublic:e.publicVoters,...d(e,["closed","multipleChoice","quiz","question","closePeriod","closeDate"]),answers:a},results:Ee(t)}}function Ee(e){const{results:t,totalVoters:n,recentVoters:s,solution:a,solutionEntities:i}=e;return{totalVoters:n,recentVoterIds:s,results:t&&t.map((({option:e,chosen:t,correct:n,voters:s})=>({isChosen:t,isCorrect:n,option:String.fromCharCode(...e),votersCount:s}))),solution:a,...i&&{solutionEntities:i.map(xe)}}}function De(e){if(!(e instanceof o.Api.MessageMediaWebPage&&e.webpage instanceof o.Api.WebPage))return;const{id:t,photo:n,document:s}=e.webpage;let a;return s instanceof o.Api.Document&&s.mimeType.startsWith("video/")&&(a=ke(s)),{id:Number(t),...d(e.webpage,["url","displayUrl","type","siteName","title","description","duration"]),photo:n instanceof o.Api.Photo?N(n):void 0,document:!a&&s?Re(s):void 0,video:a}}function Te(e,t="file"){const{mimeType:n,attributes:s}=e,a=s.find((e=>e instanceof o.Api.DocumentAttributeFilename));if(a)return a.fileName;const i=n.split("/")[1];return`${t}${String(e.id)}.${i}`}function Be(e,t){return{poll:{id:t.toString(),summary:d(e.summary,["question","answers"]),results:{}}}}function xe(e){const{className:t,offset:n,length:s}=e;return{type:t,offset:n,length:s,..."userId"in e&&"number"==typeof e.userId&&{userId:e.userId},..."url"in e&&{url:e.url}}}function Ve(e,t,n){const{channelId:s,replies:a,maxId:i,readMaxId:r,recentRepliers:o}=e;if(777!==s)return{threadId:t,...n!==s?{chatId:I({channelId:s}),originChannelId:n}:{chatId:n},messagesCount:a,lastMessageId:i,lastReadInboxMessageId:r,...o&&{recentReplierIds:o.map(I)}}}function Fe(e){const{about:t,commonChatsCount:n,pinnedMsgId:s,botInfo:a,blocked:i}=e;return{...Ne(e.user),fullInfo:{bio:t,commonChatsCount:n,pinnedMessageId:s,isBlocked:Boolean(i),...a&&{botDescription:a.description},...a&&a.commands.length&&{botCommands:Le(e.user.id,a)}}}}function Ne(e){if(!(e instanceof o.Api.User))return;const{id:t,firstName:n,lastName:s}=e,a=e.photo instanceof o.Api.UserProfilePhoto?String(e.photo.photoId):void 0,i=(r=e).bot?"userTypeBot":r.deleted?"userTypeDeleted":"userTypeRegular";var r;return{id:t,isMin:Boolean(e.min),...e.self&&{isSelf:!0},...e.verified&&{isVerified:!0},...(e.contact||e.mutualContact)&&{isContact:!0},type:i,...n&&{firstName:n},..."userTypeBot"===i&&{canBeInvitedToGroup:!e.botNochats},...s&&{lastName:s},username:e.username||"",phoneNumber:e.phone||"",status:Oe(e.status),...e.accessHash&&{accessHash:String(e.accessHash)},...a&&{avatarHash:a},...e.bot&&e.botInlinePlaceholder&&{botPlaceholder:e.botInlinePlaceholder}}}function Oe(e){return!e||e instanceof o.Api.UserStatusEmpty?{type:"userStatusEmpty"}:e instanceof o.Api.UserStatusOnline?{type:"userStatusOnline",expires:e.expires}:e instanceof o.Api.UserStatusOffline?{type:"userStatusOffline",wasOnline:e.wasOnline}:e instanceof o.Api.UserStatusRecently?{type:"userStatusRecently"}:e instanceof o.Api.UserStatusLastWeek?{type:"userStatusLastWeek"}:{type:"userStatusLastMonth"}}function Le(e,t){return t.commands.map((({command:t,description:n})=>({botId:e,command:t,description:n})))}function qe(e){if(e instanceof o.Api.WallPaperNoFile)return;const{slug:t}=e,n=Re(e.document);return n?{slug:t,document:n}:void 0}function He(e){return{isCurrent:Boolean(e.current),isOfficialApp:Boolean(e.officialApp),isPasswordPending:Boolean(e.passwordPending),hash:String(e.hash),...d(e,["deviceModel","platform","systemVersion","appName","appVersion","dateCreated","dateActive","ip","country","region"])}}function Ge(e){let t,n,s,a,i;return e.forEach((e=>{e instanceof o.Api.PrivacyValueAllowAll?t=t||"everybody":e instanceof o.Api.PrivacyValueAllowContacts?t=t||"contacts":e instanceof o.Api.PrivacyValueDisallowContacts?t=t||"nonContacts":e instanceof o.Api.PrivacyValueDisallowAll?t=t||"nobody":e instanceof o.Api.PrivacyValueAllowUsers?n=e.users:e instanceof o.Api.PrivacyValueDisallowUsers?a=e.users:e instanceof o.Api.PrivacyValueAllowChatParticipants?s=e.chats.map((e=>-e)):e instanceof o.Api.PrivacyValueDisallowChatParticipants&&(i=e.chats.map((e=>-e)))})),t||(t="nobody"),{visibility:t,allowUserIds:n||[],allowChatIds:s||[],blockUserIds:a||[],blockChatIds:i||[]}}function Ke(e,t,n){const{silent:s,muteUntil:a,showPreviews:i,sound:r}=e;return{chatId:I(t),isMuted:s||"number"==typeof a&&f(n)e instanceof o.Api.User)).map(Ne).forEach((e=>{e&&Ie({"@type":"updateUser",id:e.id,user:e})})),s.filter((e=>e instanceof o.Api.Chat||e instanceof o.Api.Channel)).map((e=>w(e))).forEach((e=>{e&&Ie({"@type":"updateChat",id:e.id,chat:e})}))),e instanceof o.Api.UpdateNewScheduledMessage?Ie({"@type":ze.has(t.id)?"updateScheduledMessage":"newScheduledMessage",id:t.id,chatId:t.chatId,message:t}):Ie({"@type":ze.has(t.id)?"updateMessage":"newMessage",id:t.id,chatId:t.chatId,message:t}),e.message instanceof o.Api.MessageService){const{action:n}=e.message;if(n instanceof o.Api.MessageActionChatEditTitle)Ie({"@type":"updateChat",id:t.chatId,chat:{title:n.title}});else if(n instanceof o.Api.MessageActionChatEditPhoto){const s=function(e){if(e instanceof o.Api.PhotoEmpty)return new o.Api.ChatPhotoEmpty;const{dcId:t,id:n}=e;return new o.Api.ChatPhoto({dcId:t,photoId:n})}(n.photo),a=M(s),i=Math.abs(_e(e.message));L.chats[i]&&(L.chats[i].photo=s),be(n.photo),a&&Ie({"@type":"updateChat",id:t.chatId,chat:{avatarHash:a},...n.photo instanceof o.Api.Photo&&{newProfilePhoto:N(n.photo)}})}else if(n instanceof o.Api.MessageActionChatDeletePhoto){const n=Math.abs(_e(e.message));L.chats[n]&&(L.chats[n].photo=new o.Api.ChatPhotoEmpty),Ie({"@type":"updateChat",id:t.chatId,chat:{avatarHash:void 0}})}else n instanceof o.Api.MessageActionChatDeleteUser?e._entities&&e._entities.some((e=>e instanceof o.Api.User&&!!e.self&&e.id===n.userId))&&(Ie({"@type":"updateChat",id:t.chatId,chat:{isRestricted:!0}}),Ie({"@type":"updateChatLeave",id:t.chatId})):n instanceof o.Api.MessageActionChatAddUser&&e._entities&&e._entities.some((e=>e instanceof o.Api.User&&!!e.self&&n.users.includes(e.id)))&&Ie({"@type":"updateChatJoin",id:t.chatId})}}else if(e instanceof o.Api.UpdateEditMessage||e instanceof o.Api.UpdateEditChannelMessage){if(e.message instanceof o.Api.MessageEmpty)return;e.message instanceof o.Api.Message&&le(e.message)&&ye(e.message);const t=Pe(e.message);Ie({"@type":"updateMessage",id:t.id,chatId:t.chatId,message:t})}else if(e instanceof o.Api.UpdateDeleteMessages)Ie({"@type":"deleteMessages",ids:e.messages});else if(e instanceof o.Api.UpdateDeleteScheduledMessages)Ie({"@type":"deleteScheduledMessages",ids:e.messages,chatId:C(e.peer)});else if(e instanceof o.Api.UpdateDeleteChannelMessages){const t=I({channelId:e.channelId}),n=e.messages,s=n.filter((e=>L.messages[`${t}-${e}`])),a=n.filter((e=>!L.messages[`${t}-${e}`])),i=n.map((e=>{const n=L.messages[`${t}-${e}`];return n&&n instanceof o.Api.MessageService&&"photo"in n.action?String(n.action.photo.id):void 0})).filter(Boolean);s.length&&Ie({"@type":"deleteMessages",ids:s,chatId:t}),i.length&&Ie({"@type":"deleteProfilePhotos",ids:i,chatId:t}),a.length&&setTimeout((()=>{Ie({"@type":"deleteMessages",ids:a,chatId:t})}),1e3)}else if((t instanceof o.Api.messages.SendMessage||t instanceof o.Api.messages.SendMedia||t instanceof o.Api.messages.SendMultiMedia||t instanceof o.Api.messages.ForwardMessages)&&(e instanceof o.Api.UpdateMessageID||e instanceof o.Api.UpdateShortSentMessage)){let n;"randomId"in e?n=e.randomId:"randomId"in t&&(n=t.randomId);const s=n&&L.localMessages[n.toString()];if(!s)throw new Error("Local message not found");let a;if(e instanceof o.Api.UpdateShortSentMessage){s.content.text&&e.entities&&(a={text:Ae(s.content.text.text,e.entities)}),e.media&&(a={...a,...Me(e.media)});const t=oe(e.id,s.chatId,e);le(t)&&ye(t)}ze.add(e.id);const i="date"in e&&1e3*e.dateString.fromCharCode(...e)))});else if(e instanceof o.Api.UpdateChannelMessageViews)Ie({"@type":"updateMessage",chatId:I({channelId:e.channelId}),id:e.id,message:{views:e.views}});else if(e instanceof o.Api.UpdateReadHistoryInbox)Ie({"@type":"updateChatInbox",id:I(e.peer),chat:{lastReadInboxMessageId:e.maxId,unreadCount:e.stillUnreadCount}});else if(e instanceof o.Api.UpdateReadHistoryOutbox)Ie({"@type":"updateChat",id:I(e.peer),chat:{lastReadOutboxMessageId:e.maxId}});else if(e instanceof o.Api.UpdateReadChannelInbox)Ie({"@type":"updateChat",id:I({channelId:e.channelId}),chat:{lastReadInboxMessageId:e.maxId,unreadCount:e.stillUnreadCount}});else if(e instanceof o.Api.UpdateReadChannelOutbox)Ie({"@type":"updateChat",id:I({channelId:e.channelId}),chat:{lastReadOutboxMessageId:e.maxId}});else if(e instanceof o.Api.UpdateDialogPinned&&e.peer instanceof o.Api.DialogPeer)Ie({"@type":"updateChatPinned",id:I(e.peer.peer),isPinned:e.pinned||!1});else if(e instanceof o.Api.UpdatePinnedDialogs){const t=e.order?e.order.filter((e=>e instanceof o.Api.DialogPeer)).map((e=>I(e.peer))):[];Ie({"@type":"updatePinnedChatIds",ids:t,folderId:e.folderId||void 0})}else if(e instanceof o.Api.UpdateFolderPeers)e.folderPeers.forEach((e=>{const{folderId:t,peer:n}=e;Ie({"@type":"updateChatListType",id:I(n),folderId:t})}));else if(e instanceof o.Api.UpdateDialogFilter){const{id:t,filter:n}=e,s=n?E(n):void 0;Ie({"@type":"updateChatFolder",id:t,folder:s})}else if(e instanceof o.Api.UpdateDialogFilterOrder)Ie({"@type":"updateChatFoldersOrder",orderedIds:e.order});else if(e instanceof o.Api.UpdateChatParticipants){const t=R(e.participants);Ie({"@type":"updateChatMembers",id:I({chatId:e.participants.chatId}),replacedMembers:t})}else if(e instanceof o.Api.UpdateChatParticipantAdd){const t=k(d(e,["userId","inviterId","date"]));Ie({"@type":"updateChatMembers",id:I({chatId:e.chatId}),addedMember:t})}else if(e instanceof o.Api.UpdateChatParticipantDelete){const{userId:t}=e;Ie({"@type":"updateChatMembers",id:I({chatId:e.chatId}),deletedMemberId:t})}else if(e instanceof o.Api.UpdatePinnedMessages||e instanceof o.Api.UpdatePinnedChannelMessages){const t=I(e instanceof o.Api.UpdatePinnedMessages?e.peer:{channelId:e.channelId});Ie({"@type":"updatePinnedIds",chatId:t,messageIds:e.messages,isPinned:e.pinned})}else if(e instanceof o.Api.UpdateNotifySettings&&e.peer instanceof o.Api.NotifyPeer)Ie({"@type":"updateNotifyExceptions",...Ke(e.notifySettings,e.peer.peer,We)});else if(e instanceof o.Api.UpdateUserTyping||e instanceof o.Api.UpdateChatUserTyping){const t=e instanceof o.Api.UpdateUserTyping?e.userId:I({chatId:e.chatId});Ie({"@type":"updateChatTypingStatus",id:t,typingStatus:U(e,We)})}else if(e instanceof o.Api.UpdateChannelUserTyping){const t=I({channelId:e.channelId});Ie({"@type":"updateChatTypingStatus",id:t,typingStatus:U(e,We)})}else if(e instanceof o.Api.UpdateChannel){const{_entities:t}=e;if(!t)return;const n=t.find((e=>e instanceof o.Api.Channel||e instanceof o.Api.ChannelForbidden));if(n instanceof o.Api.Channel){const t=w(n);t&&(Ie({"@type":"updateChat",id:t.id,chat:t}),Ie({"@type":t.isNotJoined?"updateChatLeave":"updateChatJoin",id:I({channelId:e.channelId})}))}else if(n instanceof o.Api.ChannelForbidden){const t=I({channelId:e.channelId});Ie({"@type":"updateChat",id:t,chat:{isRestricted:!0}}),Ie({"@type":"updateChatLeave",id:t})}else 0===t.length&&Ie({"@type":"resetMessages",id:I({chatId:e.channelId})})}else if(e instanceof o.Api.UpdateDialogUnreadMark&&e.peer instanceof o.Api.DialogPeer)Ie({"@type":"updateChat",id:I(e.peer.peer),chat:{hasUnreadMark:e.unread}});else if(e instanceof o.Api.UpdateChatDefaultBannedRights)Ie({"@type":"updateChat",id:I(e.peer),chat:{defaultBannedRights:p(e.defaultBannedRights)}});else if(e instanceof o.Api.UpdateUserStatus){const{userId:t,status:n}=e;Ie({"@type":"updateUserStatus",userId:t,status:Oe(n)})}else if(e instanceof o.Api.UpdateUserName){const t=L.users[e.userId],n=null!=t&&t.mutualContact&&!t.self?d(e,["username"]):d(e,["firstName","lastName","username"]);Ie({"@type":"updateUser",id:e.userId,user:n})}else if(e instanceof o.Api.UpdateUserPhoto){const{userId:t,photo:n}=e,s=M(n);L.users[t]&&(L.users[t].photo=n),Ie({"@type":"updateUser",id:t,user:{avatarHash:s}})}else if(e instanceof o.Api.UpdateUserPhone){const{userId:t,phone:n}=e;Ie({"@type":"updateUser",id:t,user:{phoneNumber:n}})}else if(e instanceof o.Api.UpdatePeerSettings){const{_entities:t}=e;if(!t)return;null!=t&&t.length&&(t.filter((e=>e instanceof o.Api.User&&!e.contact)).forEach((e=>{Ie({"@type":"deleteUser",id:e.id})})),t.filter((e=>e instanceof o.Api.User&&e.contact)).map(Ne).forEach((e=>{e&&Ie({"@type":"updateUser",id:e.id,user:e})})))}else if(e instanceof o.Api.UpdateNotifySettings){const{notifySettings:{showPreviews:t,silent:n,muteUntil:s},peer:{className:a}}=e,i="NotifyUsers"===a?"contact":"NotifyChats"===a?"group":"NotifyBroadcasts"===a?"broadcast":void 0;if(!i)return;Ie({"@type":"updateNotifySettings",peerType:i,isSilent:Boolean(n||"number"==typeof s&&Date.now()+1e3*We<1e3*s),shouldShowPreviews:Boolean(t)})}else if(e instanceof o.Api.UpdatePeerBlocked)Ie({"@type":"updatePeerBlocked",id:I(e.peerId),isBlocked:e.blocked});else if(e instanceof o.Api.UpdatePrivacy){const t=function(e){switch(e.className){case"PrivacyKeyPhoneNumber":return"phoneNumber";case"PrivacyKeyStatusTimestamp":return"lastSeen";case"PrivacyKeyProfilePhoto":return"profilePhoto";case"PrivacyKeyForwards":return"forwards";case"PrivacyKeyChatInvite":return"chatInvite"}}(e.key);t&&Ie({"@type":"updatePrivacy",key:t,rules:Ge(e.rules)})}else e instanceof o.Api.UpdateDraftMessage?Ie({"@type":"draftMessage",chatId:I(e.peer),...Se(e.draft)}):e instanceof o.Api.UpdateContactsReset?Ie({"@type":"updateResetContactList"}):e instanceof o.Api.UpdateFavedStickers&&Ie({"@type":"updateFavoriteStickers"});var n}const $e={PHONE_NUMBER_INVALID:"PHONE_NUMBER_INVALID",PHONE_CODE_INVALID:"PHONE_CODE_INVALID",PASSWORD_HASH_INVALID:"PASSWORD_HASH_INVALID",PHONE_PASSWORD_FLOOD:"You have tried logging in too many times"},Je={};let Qe;function Xe(){return Qe(st("authorizationStateWaitPhoneNumber")),new Promise(((e,t)=>{Je.resolve=e,Je.reject=t}))}function Ze(e=!1){return Qe({...st("authorizationStateWaitCode"),isCodeViaApp:e}),new Promise(((e,t)=>{Je.resolve=e,Je.reject=t}))}function Ye(e){return Qe({...st("authorizationStateWaitPassword"),hint:e}),new Promise((e=>{Je.resolve=e}))}function et(){return Qe(st("authorizationStateWaitRegistration")),new Promise((e=>{Je.resolve=e}))}function tt(e){return Qe({...st("authorizationStateWaitQrCode"),qrCode:{token:btoa(String.fromCharCode(...e.token)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),expires:e.expires}}),new Promise(((e,t)=>{Je.reject=t}))}function nt(e){let t;if(e instanceof o.errors.FloodWaitError){const n=Math.ceil(Number(e.seconds)/60/60);t="Too many attempts. Try again in "+(n>1?`${n} hours`:"an hour")}else t=$e[e.message];t||(t="Unexpected Error"),Qe({"@type":"updateAuthorizationError",message:t})}function st(e){return{"@type":"updateAuthorizationState",authorizationState:e}}function at(e){Je.resolve&&Je.resolve(e)}function it(e){Je.resolve&&Je.resolve(e)}function rt(e){Je.resolve&&Je.resolve(e)}function ot(e){const{firstName:t,lastName:n}=e;Je.resolve&&Je.resolve([t,n])}function ct(){Je.reject&&Je.reject(new Error("RESTART_AUTH"))}function dt(){Je.reject&&Je.reject(new Error("RESTART_AUTH_WITH_QR"))}var lt=n(9832),ut=n(5802);function gt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}"undefined"==typeof File&&(self.File=class extends Blob{constructor(e,t,n){if(n){const{type:t,...s}=n;super(e,{type:t}),gt(this,"name",void 0),Object.assign(this,s)}else super(e),gt(this,"name",void 0);this.name=t}});const pt=self.caches;let ft;async function ht(e,t,n,s=!1){if(pt)try{const a=new Request(t.replace(/:/g,"_")),i=await pt.open(e),r=await i.match(a);if(!r)return;switch(n){case ft.Text:return await r.text();case ft.Blob:{const e=await r.blob();if("sticker"===t.substr(0,7))return new Blob([e],{type:"image/webp"});if(!e.type){const t=r.headers.get("Content-Type");if(t)return new Blob([e],{type:s?t:t.replace(/html/gi,"")})}return!s&&e.type.includes("html")?new Blob([e],{type:e.type.replace(/html/gi,"")}):e}case ft.Json:return await r.json();default:return}}catch(e){return void console.warn(e)}}async function mt(e,t,n){if(pt)try{const s="string"==typeof n||n instanceof Blob?n:JSON.stringify(n),a=new Request(t.replace(/:/g,"_")),i=new Response(s),r=await pt.open(e);return await r.put(a,i)}catch(e){return void console.warn(e)}}async function _t(e){try{if(!pt)return;return await pt.delete(e)}catch(e){return void console.warn(e)}}!function(e){e[e.Text=0]="Text",e[e.Blob=1]="Blob",e[e.Json=2]="Json"}(ft||(ft={}));const yt=new Set(["msg","sticker","gif","wallpaper","photo","webDocument"]);function bt(e,t="image/jpeg"){if(e.length<4)return t;let n=t;switch(e.subarray(0,4).reduce(((e,t)=>e+t.toString(16)),"")){case"89504e47":n="image/png";break;case"47494638":n="image/gif";break;case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":case"ffd8ffe3":case"ffd8ffe8":n="image/jpeg";break;case"52494646":n="image/webp"}return n}lt.Logger.setLevel("warn");const wt={build:e=>e};let It,Ct,Pt=!1;async function vt(){await kt(new o.Api.auth.LogOut),await Ct.destroy()}async function At(){await Ct.disconnect()}function St(e){It({"@type":"updateSession",sessionData:e})}function Mt(e){e instanceof o.connection.UpdateConnectionState?Pt=e.state===o.connection.UpdateConnectionState.connected:e instanceof o.Api.UpdatesTooLong?async function(){try{await kt(new o.Api.users.GetFullUser({id:new o.Api.InputUserSelf}),void 0,!0)}catch(e){"AUTH_KEY_UNREGISTERED"===e.message&&It({"@type":"updateConnectionState",connectionState:"connectionStateBroken"})}}():e instanceof o.connection.UpdateServerTimeOffset&&It({"@type":"updateServerTimeOffset",serverTimeOffset:e.timeOffset})}async function kt(e,t=!1,n=!1){if(Pt)try{const n=await Ct.invoke(e);if(t){let t;n instanceof o.Api.Updates||n instanceof o.Api.UpdatesCombined?t=n:"updates"in n&&(n.updates instanceof o.Api.Updates||n.updates instanceof o.Api.UpdatesCombined)&&(t=n.updates),t?(function(e){const t=[...e.users,...e.chats];e.updates.forEach((e=>{t&&(e._entities=t)}))}(t),t.updates.forEach((t=>{je(t,e)}))):n instanceof o.Api.UpdatesTooLong||je(n,e)}return n}catch(t){if(function(e,t){const n=e.message.startsWith("A wait of")&&(t instanceof o.Api.messages.SendMessage||t instanceof o.Api.messages.SendMedia||t instanceof o.Api.messages.SendMultiMedia),{message:s}=e;It({"@type":"error",error:{message:s,isSlowMode:n,hasErrorKey:!0}})}(t,e),n)throw t;return}}function Rt(e,t){return async function({url:e,mediaFormat:t,start:n,end:a,isHtmlAllowed:i},r,c,d){const{data:l,mimeType:u,fullSize:g}=await async function(e,t,n,s,a,i,r,c){const d=e.startsWith("webDocument")?e.match(/(webDocument):(.+)/):e.match(/(avatar|profile|photo|msg|stickerSet|sticker|wallpaper|gif|file)([-\d\w./]+)(\?size=\w+)?/);if(!d)return;if("file"===d[1]){const e=await fetch(d[2]);return{data:await e.arrayBuffer()}}if(!n)return Promise.reject(new Error("ERROR: Client is not connected"));let l,u=d[2];const g=d[3]?d[3].replace("?size=",""):void 0;let p;switch("avatar"===d[1]||"profile"===d[1]?(l=Z(Number(u)),u=Math.abs(Number(u))):l=d[1],l){case"channel":case"chat":p=L.chats[u];break;case"user":p=L.users[u];break;case"msg":p=L.messages[u];break;case"sticker":case"gif":case"wallpaper":p=L.documents[u];break;case"photo":p=L.photos[u];break;case"stickerSet":p=L.stickerSets[u];break;case"webDocument":p=L.webDocuments[u]}if(p){if(yt.has(l)){r===Q.Stream&&(s.acceptsBuffer=!0);const e=await t.downloadMedia(p,{sizeType:g,start:a,end:i,progressCallback:s,workers:16});let n,d;return p instanceof o.Api.Message?(n=function(e,t){if(e&&e.media)return e.media instanceof o.Api.MessageMediaPhoto?"image/jpeg":e.media instanceof o.Api.MessageMediaDocument&&e.media.document instanceof o.Api.Document?t?e.media.document.attributes.some((e=>e instanceof o.Api.DocumentAttributeSticker))?"image/webp":"image/jpeg":e.media.document.mimeType:e.media instanceof o.Api.MessageMediaWebPage&&e.media.webpage instanceof o.Api.WebPage&&e.media.webpage.document instanceof o.Api.Document?e.media.webpage.document.mimeType:void 0}(p,g),p.media instanceof o.Api.MessageMediaDocument&&p.media.document instanceof o.Api.Document&&(d=p.media.document.size),p.media instanceof o.Api.MessageMediaWebPage&&p.media.webpage instanceof o.Api.WebPage&&p.media.webpage.document instanceof o.Api.Document&&(d=p.media.webpage.document.size)):p instanceof o.Api.Photo?n="image/jpeg":"sticker"===l&&g?n="image/webp":"webDocument"===l?n=p.mimeType:(n=p.mimeType,d=p.size),!c&&n&&(n=n.replace(/html/gi,"")),{mimeType:n,data:e,fullSize:d}}if("stickerSet"===l){const e=await t.downloadStickerSetThumb(p);return{mimeType:r===Q.Lottie?"application/json":bt(e),data:e}}{const e=await t.downloadProfilePhoto(p,"profile"===d[1]);return{mimeType:bt(e),data:e}}}}(e,r,c,d,n,a,t,i)||{};if(!l)return;const p=await async function(e,t,n){switch(t){case Q.DataUri:return s=new Blob([e],{type:n}),new Promise(((e,t)=>{const n=new FileReader;n.onload=n=>{const{result:s}=n.target||{};"string"==typeof s&&e(s),t(new Error("Failed to read blob"))},n.onerror=t,n.readAsDataURL(s)}));case Q.BlobUrl:return new Blob([e],{type:n});case Q.Lottie:{const t=(0,ut.inflate)(e,{to:"string"});return JSON.parse(t)}case Q.Progressive:return e.buffer}var s}(l,t,u);if(!p)return;const f=t!==Q.Progressive&&(t!==Q.BlobUrl||p.size<=524288);return s&&f&&mt(e.startsWith("avatar")?"tt-media-avatars":"tt-media",e,p),{prepared:t===Q.Progressive?"":(h=p,h instanceof Blob?URL.createObjectURL(h):h),arrayBuffer:t===Q.Progressive?p:void 0,mimeType:u,fullSize:g};var h}(e,Ct,Pt,t)}function Ut(e,t){return Ct.uploadFile({file:e,onProgress:t,workers:16})}function Et(e){return Ct.updateTwoFaSettings(e)}async function Dt(){const e=await kt(new o.Api.users.GetFullUser({id:new o.Api.InputUserSelf}));if(!(e&&e.user instanceof o.Api.User))return;L.users[e.user.id]=e.user;const t=Fe(e);var n;n=t.id,we=n,function(e){Qe({"@type":"updateCurrentUser",currentUser:e})}(t)}const Tt=2**31-1;let Bt;async function xt({limit:e,offsetDate:t,archived:n,withPinned:s,serverTimeOffset:a}){const i=await kt(new o.Api.messages.GetDialogs({offsetPeer:new o.Api.InputPeerEmpty,limit:e,offsetDate:t,folderId:n?1:void 0,...s&&{excludePinned:!0}})),r=s?await kt(new o.Api.messages.GetPinnedDialogs({folderId:n?1:void 0})):void 0;if(!i||i instanceof o.Api.messages.DialogsNotModified)return;r&&In(r),In(i);const d=c((r?r.messages:[]).concat(i.messages).map(Pe).filter(Boolean),"chatId"),l={...r&&wn(r),...wn(i)},u=[],g={},p={},f=(r?r.dialogs:[]).concat(i.dialogs),h=[];f.forEach((e=>{if(!(e instanceof o.Api.Dialog)||!n&&1===e.folderId||n&&1!==e.folderId)return;const t=m(e,l[v(e.peer)],a);if(t.lastMessage=d[t.id],t.isListed=!0,u.push(t),s&&e.pinned&&h.push(t.id),e.draft){const{formattedText:n,replyingToId:s}=Se(e.draft)||{};n&&(g[t.id]=n),s&&(p[t.id]=s)}}));const _=(r?r.users:[]).concat(i.users).map(Ne).filter(Boolean),y=u.map((e=>e.id));let b;return b=i instanceof o.Api.messages.DialogsSlice?i.count:y.length,{chatIds:y,chats:u,users:_,draftsById:g,replyingToById:p,orderedPinnedIds:s?h:void 0,totalChatCount:b}}function Vt(e){const{id:t,accessHash:n,adminRights:s}=e;return ne(t,n)instanceof o.Api.InputChannel?async function(e,t,n){const s=await kt(new o.Api.channels.GetFullChannel({channel:ne(e,t)}));if(!(s&&s.fullChat instanceof o.Api.ChannelFull))return;const{about:a,onlineCount:i,exportedInvite:r,slowmodeSeconds:c,slowmodeNextSendDate:d,migratedFromChatId:l,migratedFromMaxId:u,canViewParticipants:g,linkedChatId:p,hiddenPrehistory:f,call:h,botInfo:m}=s.fullChat,_=r instanceof o.Api.ChatInviteExported?r.link:void 0,{members:y,users:b}=g&&await pn(e,t)||{},{members:w,users:C}=g&&n&&await pn(e,t,"kicked")||{},{members:P,users:v}=g&&n&&await pn(e,t,"admin")||{},A=m?T(m):void 0;return{fullInfo:{about:a,onlineCount:i,inviteLink:_,slowMode:c?{seconds:c,nextSendDate:d}:void 0,migratedFrom:l?{chatId:I({chatId:l}),maxMessageId:u}:void 0,canViewMembers:g,isPreHistoryHidden:f,members:y,kickedMembers:w,adminMembers:P,groupCallId:h?h.id.toString():void 0,linkedChatId:p?I({chatId:p}):void 0,botCommands:A},users:[...b||[],...C||[],...v||[]]}}(t,n,s):async function(e){const t=await kt(new o.Api.messages.GetFullChat({chatId:ne(e)}));if(!(t&&t.fullChat instanceof o.Api.ChatFull))return;In(t);const{about:n,participants:s,exportedInvite:a,botInfo:i}=t.fullChat,r=R(s),c=r?r.filter((({isAdmin:e,isOwner:t})=>e||t)):void 0;return{fullInfo:{about:n,members:r,adminMembers:c,canViewMembers:!0,botCommands:i?T(i):void 0,...a&&{inviteLink:a.link}},users:t.users.map(Ne).filter(Boolean)}}(t)}async function Ft({query:e}){const t=await kt(new o.Api.contacts.Search({q:e}));if(!t)return;In(t);const n=t.myResults.map(I),s=t.chats.concat(t.users).map((e=>w(e))).filter(Boolean),a=t.users.map(Ne).filter((e=>!!e&&!e.isSelf));return{localChats:s.filter((e=>n.includes(e.id))),localUsers:a.filter((e=>n.includes(e.id))),globalChats:s.filter((e=>!n.includes(e.id))),globalUsers:a.filter((e=>!n.includes(e.id)))}}async function Nt({type:e,user:t}){let n;if("self"===e||"user"===e){const s=await kt(new o.Api.users.GetUsers({id:["user"===e&&t?ne(t.id,t.accessHash):new o.Api.InputUserSelf]}));if(!s||!s.length)return;[n]=s}else if("support"===e){const e=await kt(new o.Api.help.GetSupport);if(!e||!e.user)return;n=e.user}const s=w(n,"support"===e);if(s)return Bt({"@type":"updateChat",id:s.id,chat:s}),{chatId:s.id}}async function Ot({chat:e,serverTimeOffset:t}){const{id:n,accessHash:s}=e,a=await kt(new o.Api.messages.GetPeerDialogs({peers:[new o.Api.InputDialogPeer({peer:ee(n,s)})]}));if(!a)return;const i=a.dialogs[0];if(!(i&&i instanceof o.Api.Dialog))return;const r=wn(a)[v(i.peer)];if(!r)return;In(a);const c=Pe(a.messages[0]);Bt({"@type":"updateChat",id:n,chat:{...m(i,r,t),lastMessage:c}})}function Lt({chat:e,text:t,entities:n,replyToMsgId:s}){return kt(new o.Api.messages.SaveDraft({peer:ee(e.id,e.accessHash),message:t,...n&&{entities:n.map(ce)},replyToMsgId:s}))}function qt(e){return kt(new o.Api.messages.SaveDraft({peer:ee(e.id,e.accessHash),message:""}))}async function Ht({chat:e,isMuted:t,serverTimeOffset:n}){await kt(new o.Api.account.UpdateNotifySettings({peer:new o.Api.InputNotifyPeer({peer:ee(e.id,e.accessHash)}),settings:new o.Api.InputPeerNotifySettings({muteUntil:t?Tt:0})})),Bt({"@type":"updateNotifyExceptions",chatId:e.id,isMuted:t}),Ot({chat:e,serverTimeOffset:n})}async function Gt({title:e,about:t,users:n}){const s=await kt(new o.Api.channels.CreateChannel({broadcast:!0,title:e,about:t}),!0);if(!(s instanceof o.Api.Updates))return;const a=s.chats[0];if(!(a&&a instanceof o.Api.Channel))return;const i=w(a);return await kt(new o.Api.channels.InviteToChannel({channel:ne(i.id,i.accessHash),users:n.map((({id:e,accessHash:t})=>ne(e,t)))})),i}function Kt({channelId:e,accessHash:t}){return kt(new o.Api.channels.JoinChannel({channel:ne(e,t)}),!0)}function zt({chat:e,user:t}){if("chatTypeBasicGroup"===e.type)return kt(new o.Api.messages.DeleteChatUser({chatId:ne(e.id,e.accessHash),userId:ne(t.id,t.accessHash)}),!0)}function Wt({chatId:e}){return kt(new o.Api.messages.DeleteChat({chatId:ne(e)}),!0)}function jt({channelId:e,accessHash:t}){return kt(new o.Api.channels.LeaveChannel({channel:ne(e,t)}),!0)}function $t({channelId:e,accessHash:t}){return kt(new o.Api.channels.DeleteChannel({channel:ne(e,t)}),!0)}async function Jt({title:e,users:t}){const n=await kt(new o.Api.messages.CreateChat({title:e,users:t.map((({id:e,accessHash:t})=>ne(e,t)))}),!0);if(!(n instanceof o.Api.Updates))return;const s=n.chats[0];return s&&s instanceof o.Api.Chat?w(s):void 0}async function Qt({chatId:e,accessHash:t,photo:n}){const s=await Ut(n),a=ne(e,t);return kt(a instanceof o.Api.InputChannel?new o.Api.channels.EditPhoto({channel:a,photo:new o.Api.InputChatUploadedPhoto({file:s})}):new o.Api.messages.EditChatPhoto({chatId:a,photo:new o.Api.InputChatUploadedPhoto({file:s})}),!0)}async function Xt({chat:e,shouldBePinned:t}){const{id:n,accessHash:s}=e;await kt(new o.Api.messages.ToggleDialogPin({peer:new o.Api.InputDialogPeer({peer:ee(n,s)}),pinned:t||void 0}))&&Bt({"@type":"updateChatPinned",id:e.id,isPinned:t})}function Zt({chat:e,folderId:t}){const{id:n,accessHash:s}=e;return kt(new o.Api.folders.EditPeerFolders({folderPeers:[new o.Api.InputFolderPeer({peer:ee(n,s),folderId:t})]}),!0)}async function Yt(){const e=await kt(new o.Api.messages.GetDialogFilters);if(e)return{byId:c(e.map(E),"id"),orderedIds:e.map((({id:e})=>e))}}async function en(){const e=await kt(new o.Api.messages.GetSuggestedDialogFilters);if(e)return e.map(D)}async function tn({id:e,folderUpdate:t}){const n=function(e){const{emoticon:t,contacts:n,nonContacts:s,groups:a,channels:i,bots:r,excludeArchived:c,excludeMuted:d,excludeRead:l,pinnedChatIds:u,includedChatIds:g,excludedChatIds:p}=e,f=u?u.map(te).filter(Boolean):[],h=g?g.map(te).filter(Boolean):[],m=p?p.map(te).filter(Boolean):[];return new o.Api.DialogFilter({id:e.id,title:e.title,emoticon:t||void 0,contacts:n||void 0,nonContacts:s||void 0,groups:a||void 0,bots:r||void 0,excludeArchived:c||void 0,excludeMuted:d||void 0,excludeRead:l||void 0,broadcasts:i||void 0,pinnedPeers:f,includePeers:h,excludePeers:m})}(t);await kt(new o.Api.messages.UpdateDialogFilter({id:e,filter:n}))&&Bt({"@type":"updateChatFolder",id:e,folder:t})}async function nn(e){const t=await kt(new o.Api.messages.UpdateDialogFilter({id:e,filter:void 0})),n=await en();t&&Bt({"@type":"updateChatFolder",id:e,folder:void 0}),n&&Bt({"@type":"updateRecommendedChatFolders",folders:n})}async function sn({chat:e,hasUnreadMark:t}){const{id:n,accessHash:s}=e;await kt(new o.Api.messages.MarkDialogUnread({peer:new o.Api.InputDialogPeer({peer:ee(n,s)}),unread:t||void 0}))&&Bt({"@type":"updateChat",id:e.id,chat:{hasUnreadMark:t}})}async function an(e){const t=await kt(new o.Api.contacts.ResolveUsername({username:e}));if(!t)return;const{users:n,chats:s}=t,a=s.length?w(s[0]):w(n[0]);return a?(In(t),a):void 0}function rn({chat:e,isEnabled:t}){const{id:n,accessHash:s}=e,a=ne(n,s);return kt(new o.Api.channels.TogglePreHistoryHidden({channel:a,enabled:t}),!0)}function on({chat:e,bannedRights:t}){const{id:n,accessHash:s}=e,a=ee(n,s);return kt(new o.Api.messages.EditChatDefaultBannedRights({peer:a,bannedRights:ge(t)}),!0)}function cn({chat:e,user:t,bannedRights:n,untilDate:s}){const a=ne(e.id,e.accessHash),i=ee(t.id,t.accessHash);return kt(new o.Api.channels.EditBanned({channel:a,participant:i,bannedRights:ge(n,s)}),!0)}function dn({chat:e,user:t,adminRights:n,customTitle:s=""}){const a=ne(e.id,e.accessHash),i=ne(t.id,t.accessHash);return kt(new o.Api.channels.EditAdmin({channel:a,userId:i,adminRights:pe(n),rank:s}),!0)}async function ln(e,t){const n=ne(e.id,e.accessHash);await kt(n instanceof o.Api.InputChannel?new o.Api.channels.EditTitle({channel:n,title:t}):new o.Api.messages.EditChatTitle({chatId:n,title:t}),!0)}async function un(e,t){await kt(new o.Api.messages.EditChatAbout({peer:ee(e.id,e.accessHash),about:t}))&&Bt({"@type":"updateChatFullInfo",id:e.id,fullInfo:{about:t}})}function gn({chat:e,isEnabled:t}){const{id:n,accessHash:s}=e,a=ne(n,s);return kt(new o.Api.channels.ToggleSignatures({channel:a,enabled:t}),!0)}async function pn(e,t,n="recent",s){let a;switch(n){case"kicked":a=new o.Api.ChannelParticipantsKicked({q:""});break;case"admin":a=new o.Api.ChannelParticipantsAdmins;break;default:a=new o.Api.ChannelParticipantsRecent}const i=await kt(new o.Api.channels.GetParticipants({channel:ne(e,t),filter:a,offset:s,limit:200}));if(i&&!(i instanceof o.Api.channels.ChannelParticipantsNotModified))return In(i),{members:R(i),users:i.users.map(Ne).filter(Boolean)}}async function fn(){const e=await kt(new o.Api.channels.GetGroupsForDiscussion);if(e)return In(e),e.chats.map((e=>w(e)))}function hn({channel:e,chat:t}){return kt(new o.Api.channels.SetDiscussionGroup({broadcast:ee(e.id,e.accessHash),group:t?ee(t.id,t.accessHash):new o.Api.InputChannelEmpty}))}async function mn(e){const t=await kt(new o.Api.messages.MigrateChat({chatId:ne(e.id)}),!0);if(t&&t instanceof o.Api.Updates)return In(t),w(t.chats[1])}async function _n(e){const t=await kt(new o.Api.messages.CheckChatInvite({hash:e}));if(!t)return;let n;return t instanceof o.Api.ChatInvite?Bt({"@type":"showInvite",data:{title:t.title,hash:e,participantsCount:t.participantsCount,isChannel:t.channel}}):(n=w(t.chat),n&&Bt({"@type":"updateChat",id:n.id,chat:n})),n?{chatId:n.id}:void 0}function yn(e,t){return"chatTypeChannel"===e.type||"chatTypeSuperGroup"===e.type?kt(new o.Api.channels.InviteToChannel({channel:ne(e.id,e.accessHash),users:t.map((e=>ne(e.id,e.accessHash)))}),!0):Promise.all(t.map((t=>kt(new o.Api.messages.AddChatUser({chatId:ne(e.id),userId:ne(t.id,t.accessHash)}),!0))))}function bn(e,t){return"chatTypeChannel"===e.type||"chatTypeSuperGroup"===e.type?cn({chat:e,user:t,bannedRights:{viewMessages:!0,sendMessages:!0,sendMedia:!0,sendStickers:!0,sendGifs:!0,sendGames:!0,sendInline:!0,embedLinks:!0,sendPolls:!0,changeInfo:!0,inviteUsers:!0,pinMessages:!0},untilDate:Tt}):kt(new o.Api.messages.DeleteChatUser({chatId:ne(e.id),userId:ne(t.id,t.accessHash)}),!0)}function wn(e){const t={};return e.chats.forEach((e=>{t[`chat${e.id}`]=e})),e.users.forEach((e=>{t[`user${e.id}`]=e})),t}function In(e){"users"in e&&e.users.forEach((e=>{e instanceof o.Api.User&&(L.users[e.id]=e)})),"chats"in e&&e.chats.forEach((e=>{(e instanceof o.Api.Chat||e instanceof o.Api.Channel)&&(L.chats[e.id]=e)})),"messages"in e&&e.messages.forEach((e=>{e instanceof o.Api.Message&&le(e)&&ye(e)}))}async function Cn({hash:e}){const t=await kt(new o.Api.messages.ImportChatInvite({hash:e}),!0);if(t instanceof o.Api.Updates&&t.chats.length)return w(t.chats[0])}var Pn=n(8764).Buffer;let vn;async function An({chat:e,threadId:t,...n}){const s=-1===t?o.Api.messages.GetHistory:o.Api.messages.GetReplies;let a;try{a=await kt(new s({peer:ee(e.id,e.accessHash),...-1!==t&&{msgId:t},...n}),void 0,!0)}catch(t){"CHANNEL_PRIVATE"===t.message&&vn({"@type":"updateChat",id:e.id,chat:{isRestricted:!0}})}if(!a||a instanceof o.Api.messages.MessagesNotModified||!a.messages)return;Xn(a);const i=a.messages.map(Pe).filter(Boolean),r=a.users.map(Ne).filter(Boolean),c=a.chats.map((e=>w(e))).filter(Boolean),d=i.map((({threadInfo:e})=>e)).filter(Boolean);return{messages:i,users:r,chats:c,threadInfos:d}}async function Sn({chat:e,messageId:t}){const n="channel"===Z(e.id),s=await kt(n?new o.Api.channels.GetMessages({channel:ne(e.id,e.accessHash),id:[new o.Api.InputMessageID({id:t})]}):new o.Api.messages.GetMessages({id:[new o.Api.InputMessageID({id:t})]}));if(!s||s instanceof o.Api.messages.MessagesNotModified)return;const a=s.messages[0];if(!a)return;if(a instanceof o.Api.MessageEmpty)return"MESSAGE_DELETED";const i=a&&Pe(a);return i?(a instanceof o.Api.Message&&ye(a),{message:i,users:s.users.map(Ne).filter(Boolean)}):void 0}let Mn=Promise.resolve();function kn({chat:e,text:t,entities:n,replyingTo:s,attachment:a,sticker:i,gif:r,poll:c,isSilent:d,scheduledAt:l,groupedId:u,noWebPage:g,serverTimeOffset:p},f){const h=function(e,t,n,s,a,i,r,o,c,d,l=0){const u=Ce++,g=a&&function(e){const{filename:t,blobUrl:n,previewBlobUrl:s,mimeType:a,size:i}=e;if(e.quick){const{width:r,height:o,duration:c}=e.quick;return a.startsWith("image/")?{photo:{id:"temp",sizes:[],thumbnail:{width:r,height:o,dataUri:""},blobUrl:n}}:{video:{id:"temp",mimeType:a,duration:c||0,fileName:t,width:r,height:o,blobUrl:n,...s&&{thumbnail:{width:r,height:o,dataUri:s}},size:i}}}if(e.voice){const{duration:t,waveform:n}=e.voice,{data:s}=z(n,63);return{voice:{duration:t,waveform:s}}}return a.startsWith("audio/")?{audio:{mimeType:a,fileName:t,size:i,duration:200}}:{document:{mimeType:a,fileName:t,size:i,...s&&{previewBlobUrl:s}}}}(a),p="chatTypeChannel"===e.type;return{id:u,chatId:e.id,content:{...t&&{text:{text:t,entities:n}},...g,...i&&{sticker:i},...r&&{video:r},...o&&Be(o,u)},date:d||Math.round(Date.now()/1e3)+l,isOutgoing:!p,senderId:we,...s&&{replyToMessageId:s},...c&&{groupedId:c,...g&&(g.photo||g.video)&&{isInAlbum:!0}},...d&&{isScheduled:!0}}}(e,t,n,s,a,i,r,c,u,l,p);vn({"@type":h.isScheduled?"newScheduledMessage":"newMessage",id:h.id,chatId:e.id,message:h}),setTimeout((()=>{vn({"@type":h.isScheduled?"updateScheduledMessage":"updateMessage",id:h.id,chatId:e.id,message:{sendingState:"messageSendingStatePending"}})}),1e3);const m=re();if(L.localMessages[m.toString()]=h,u)return function({chat:e,text:t,entities:n,replyingTo:s,attachment:a,groupedId:i,isSilent:r,scheduledAt:c},d,l,u){let g=-1;Rn[i]||(Rn[i]={counter:0,singleMediaByIndex:{}}),g=Rn[i].counter++;const p=Mn;return Mn=(async()=>{let f;try{f=await Dn(l,a,u)}catch(e){return Rn[i].counter--,void await p}const h=await async function(e,t){const n=await kt(new o.Api.messages.UploadMedia({peer:e,media:t}));if(n instanceof o.Api.MessageMediaPhoto&&n.photo&&n.photo instanceof o.Api.Photo){const{photo:{id:e,accessHash:t,fileReference:s}}=n;return new o.Api.InputMediaPhoto({id:new o.Api.InputPhoto({id:e,accessHash:t,fileReference:s})})}if(n instanceof o.Api.MessageMediaDocument&&n.document&&n.document instanceof o.Api.Document){const{document:{id:e,accessHash:t,fileReference:s}}=n;return new o.Api.InputMediaDocument({id:new o.Api.InputDocument({id:e,accessHash:t,fileReference:s})})}}(ee(e.id,e.accessHash),f);if(await p,!h)return void Rn[i].counter--;if(Rn[i].singleMediaByIndex[g]=new o.Api.InputSingleMedia({media:h,randomId:d,message:t||"",entities:n?n.map(ce):void 0}),Object.keys(Rn[i].singleMediaByIndex).length{let u;if(a)try{u=await Dn(h,a,f)}catch(e){return void await _}else i?u=ie(i):r?u=ie(r):c&&(u=function(e,t){const{summary:n,quiz:s}=e,a=new o.Api.Poll({id:t,publicVoters:n.isPublic,question:n.question,answers:n.answers.map((({text:e,option:t})=>new o.Api.PollAnswer({text:e,option:X.from(t)}))),quiz:n.quiz,multipleChoice:n.multipleChoice});if(!s)return new o.Api.InputMediaPoll({poll:a});const i=s.correctAnswers.map((e=>X.from(e))),{solution:r}=s,c=s.solutionEntities?s.solutionEntities.map(ce):[];return new o.Api.InputMediaPoll({poll:a,correctAnswers:i,...r&&{solution:r,solutionEntities:c}})}(c,m));await _;const p=u?o.Api.messages.SendMedia:o.Api.messages.SendMessage;await kt(new p({clearDraft:!0,message:t||"",entities:n?n.map(ce):void 0,peer:ee(e.id,e.accessHash),randomId:m,...d&&{silent:d},...l&&{scheduleDate:l},...s&&{replyToMsgId:s},...u&&{media:u},...g&&{noWebpage:g}}),!0)})(),Mn}const Rn={};async function Un({chat:e,message:t,text:n,entities:s,noWebPage:a,serverTimeOffset:i}){const r=1e3*t.date>Date.now()+1e3*i,c={content:{...t.content,...n&&{text:{text:n,entities:s}}}};vn({"@type":r?"updateScheduledMessage":"updateMessage",id:t.id,chatId:e.id,message:c}),L.localMessages[t.id]={...t,...c};const d=s&&s.map(ce);await kt(new o.Api.messages.EditMessage({message:n||"",entities:d,peer:ee(e.id,e.accessHash),id:t.id,...r&&{scheduleDate:t.date},...a&&{noWebpage:a}}),!0)}async function En({chat:e,message:t,scheduledAt:n}){await kt(new o.Api.messages.EditMessage({peer:ee(e.id,e.accessHash),id:t.id,scheduleDate:n}),!0)}async function Dn(e,t,n){const{filename:s,blobUrl:a,mimeType:i,quick:r,voice:c}=t,d=await async function(e,t){return function(e,t){return new File([e],t,{lastModified:Date.now(),type:e.type})}(await async function(e){return(await fetch(e)).blob()}(e),t)}(a,s),l=t=>{n.isCanceled?l.isCanceled=!0:n(t,e.id)},u=await Ut(d,l),g=[new o.Api.DocumentAttributeFilename({fileName:s})];if(r){if(i.startsWith("image/"))return new o.Api.InputMediaUploadedPhoto({file:u});{const{width:e,height:t,duration:n}=r;void 0!==n&&g.push(new o.Api.DocumentAttributeVideo({duration:n,w:e,h:t}))}}if(c){const{duration:e,waveform:t}=c,{data:n}=z(t,63);g.push(new o.Api.DocumentAttributeAudio({voice:!0,duration:e,waveform:Pn.from(n)}))}return new o.Api.InputMediaUploadedDocument({file:u,mimeType:i,attributes:g})}async function Tn({chat:e,messageId:t,isUnpin:n,isOneSide:s,isSilent:a}){await kt(new o.Api.messages.UpdatePinnedMessage({peer:ee(e.id,e.accessHash),id:t,...n&&{unpin:!0},...s&&{pmOneside:!0},...a&&{silent:!0}}),!0)}async function Bn({chat:e}){await kt(new o.Api.messages.UnpinAllMessages({peer:ee(e.id,e.accessHash)}),!0)}async function xn({chat:e,messageIds:t,shouldDeleteForAll:n}){const s="channel"===Z(e.id);await kt(s?new o.Api.channels.DeleteMessages({channel:ne(e.id,e.accessHash),id:t}):new o.Api.messages.DeleteMessages({id:t,...n&&{revoke:!0}}))&&vn({"@type":"deleteMessages",ids:t,...s&&{chatId:e.id}})}async function Vn({chat:e,messageIds:t}){await kt(new o.Api.messages.DeleteScheduledMessages({peer:ee(e.id,e.accessHash),id:t}))&&vn({"@type":"deleteScheduledMessages",ids:t,chatId:e.id})}async function Fn({chat:e,shouldDeleteForAll:t,maxId:n}){const s="channel"===Z(e.id);await kt(s?new o.Api.channels.DeleteHistory({channel:ne(e.id,e.accessHash),maxId:n}):new o.Api.messages.DeleteHistory({peer:ee(e.id,e.accessHash),...t&&{revoke:!0},...!t&&{just_clear:!0},maxId:n}))&&vn({"@type":"deleteHistory",chatId:e.id})}async function Nn({peer:e,messageIds:t,reason:n,description:s}){return await kt(new o.Api.messages.Report({peer:ee(e.id,e.accessHash),id:t,reason:me(n),message:s}))}async function On({chat:e,threadId:t,maxId:n,serverTimeOffset:s}){const a="channel"===Z(e.id);a&&-1===t?await kt(new o.Api.channels.ReadHistory({channel:ne(e.id,e.accessHash),maxId:n})):a?await kt(new o.Api.messages.ReadDiscussion({peer:ee(e.id,e.accessHash),msgId:t,readMaxId:n})):await kt(new o.Api.messages.ReadHistory({peer:ee(e.id,e.accessHash),maxId:n})),-1===t?Ot({chat:e,serverTimeOffset:s}):qn({chat:e,threadId:t})}async function Ln({chat:e,messageIds:t}){const n="channel"===Z(e.id);await kt(n?new o.Api.channels.ReadMessageContents({channel:ne(e.id,e.accessHash),id:t}):new o.Api.messages.ReadMessageContents({id:t})),vn({...n?{"@type":"updateChannelMessages",channelId:e.id}:{"@type":"updateCommonBoxMessages"},ids:t,messageUpdate:{hasUnreadMention:!1,isMediaUnread:!1}})}async function qn({chat:e,threadId:t}){const[n,s]=await Promise.all([kt(new o.Api.messages.GetDiscussionMessage({peer:ee(e.id,e.accessHash),msgId:t})),kt(new o.Api.messages.GetReplies({peer:ee(e.id,e.accessHash),msgId:t,offsetId:1,addOffset:-1,limit:1}))]);if(!n||!n.messages.length)return;const a=_e(n.messages[0]);a&&(vn({"@type":"updateThreadInfo",chatId:a,threadId:t,threadInfo:{topMessageId:n.messages[n.messages.length-1].id,lastReadInboxMessageId:n.readInboxMaxId,messagesCount:s instanceof o.Api.messages.ChannelMessages?s.count:void 0},firstMessageId:s&&"messages"in s&&s.messages.length?s.messages[0].id:void 0}),n.chats.map((e=>w(e))).filter(Boolean).forEach((e=>{vn({"@type":"updateChat",id:e.id,chat:e,noTopChatsRequest:!0})})))}async function Hn({chatOrUser:e,type:t,query:n,topMessageId:s,minDate:a,maxDate:i,...r}){let c;switch(t){case"media":c=new o.Api.InputMessagesFilterPhotoVideo;break;case"documents":c=new o.Api.InputMessagesFilterDocument;break;case"links":c=new o.Api.InputMessagesFilterUrl;break;case"audio":c=new o.Api.InputMessagesFilterMusic;break;case"voice":c=new o.Api.InputMessagesFilterVoice;break;case"profilePhoto":c=new o.Api.InputMessagesFilterChatPhotos;break;case"text":default:c=new o.Api.InputMessagesFilterEmpty}const d=await kt(new o.Api.messages.Search({peer:ee(e.id,e.accessHash),filter:c,q:n||"",topMsgId:s,minDate:a,maxDate:i,...r}));if(!d||d instanceof o.Api.messages.MessagesNotModified||!d.messages)return;Xn(d);const l=d.messages.map(Pe).filter(Boolean),u=d.users.map(Ne).filter(Boolean);let g,p=l.length;return(d instanceof o.Api.messages.MessagesSlice||d instanceof o.Api.messages.ChannelMessages)&&(p=d.count,l.length&&(g=l[l.length-1].id)),{messages:l,users:u,totalCount:p,nextOffsetId:g}}async function Gn({query:e,offsetRate:t=0,limit:n,type:s="text",minDate:a,maxDate:i}){let r;switch(s){case"media":r=new o.Api.InputMessagesFilterPhotoVideo;break;case"documents":r=new o.Api.InputMessagesFilterDocument;break;case"links":r=new o.Api.InputMessagesFilterUrl;break;case"audio":r=new o.Api.InputMessagesFilterMusic;break;case"voice":r=new o.Api.InputMessagesFilterVoice;break;case"text":default:if(!(e||i&&a))return;r=new o.Api.InputMessagesFilterEmpty}const c=await kt(new o.Api.messages.SearchGlobal({q:e,offsetRate:t,offsetPeer:new o.Api.InputPeerEmpty,limit:n,filter:r,folderId:0,minDate:a,maxDate:i}));if(!c||c instanceof o.Api.messages.MessagesNotModified||!c.messages)return;Xn({chats:c.chats,users:c.users,messages:c.messages});const d=c.chats.map((e=>w(e))).filter(Boolean),l=c.users.map(Ne).filter(Boolean),u=c.messages.map(Pe).filter(Boolean);let g,p=u.length;return(c instanceof o.Api.messages.MessagesSlice||c instanceof o.Api.messages.ChannelMessages)&&(p=c.count,u.length&&(g=u[u.length-1].id)),{messages:u,users:l,chats:d,totalCount:p,nextRate:"nextRate"in c&&c.nextRate?c.nextRate:g}}async function Kn({message:e}){const t=await kt(new o.Api.messages.GetWebPagePreview({message:e}));return t&&De(t)}async function zn({chat:e,messageId:t,options:n}){const{id:s,accessHash:a}=e;await kt(new o.Api.messages.SendVote({peer:ee(s,a),msgId:t,options:n.map((e=>Pn.from(e)))}),!0)}async function Wn({chat:e,messageId:t,option:n,offset:s,limit:a,shouldResetVoters:i}){const{id:r,accessHash:c}=e,d=await kt(new o.Api.messages.GetPollVotes({peer:ee(r,c),id:t,...n&&{option:Pn.from(n)},...s&&{offset:s},...a&&{limit:a}}));if(!d)return;Xn({chats:[],users:d.users,messages:[]});const l=d.users.map(Ne).filter(Boolean),u=d.votes.map((e=>({userId:e.userId,date:e.date})));return{count:d.count,votes:u,users:l,nextOffset:d.nextOffset,shouldResetVoters:i}}async function jn({fromChat:e,toChat:t,messages:n,serverTimeOffset:s}){const a=n.map((({id:e})=>e)),i=n.map(re);n.forEach(((e,n)=>{const a=function(e,t,n){const s=Ce++,{content:a,chatId:i,id:r,senderId:o,groupedId:c,isInAlbum:d}=t,l=a.audio,u=e.id===we&&(i!==e.id||t.forwardInfo)&&!l;return{id:s,chatId:e.id,content:a,date:Math.round(Date.now()/1e3)+n,isOutgoing:!u&&"chatTypeChannel"!==e.type,senderId:we,sendingState:"messageSendingStatePending",...o!==we&&!l&&{forwardInfo:{isChannelPost:!1,fromChatId:i,fromMessageId:r,senderUserId:o}},groupedId:c,isInAlbum:d}}(t,e,s);L.localMessages[String(i[n])]=a,vn({"@type":"newMessage",id:a.id,chatId:t.id,message:a})})),await kt(new o.Api.messages.ForwardMessages({fromPeer:ee(e.id,e.accessHash),toPeer:ee(t.id,t.accessHash),randomId:i,id:a}),!0)}async function $n({chat:e,timestamp:t}){const n=await kt(new o.Api.messages.GetHistory({peer:ee(e.id,e.accessHash),offsetDate:t,addOffset:-1,limit:1}));if(n&&!(n instanceof o.Api.messages.MessagesNotModified)&&n.messages&&n.messages.length)return n.messages[0].id}async function Jn({chat:e,hash:t=0}){const{id:n,accessHash:s}=e,a=await kt(new o.Api.messages.GetScheduledHistory({peer:ee(n,s),hash:t}));if(!a||a instanceof o.Api.messages.MessagesNotModified||!a.messages)return;Xn(a);const i=a.messages.map(Pe).filter(Boolean);return{messages:i,hash:de(i.map((e=>e.id)))}}async function Qn({chat:e,ids:t}){const{id:n,accessHash:s}=e;await kt(new o.Api.messages.SendScheduledMessages({peer:ee(n,s),id:t}),!0)}function Xn(e){e.users.forEach((e=>{e instanceof o.Api.User&&(L.users[e.id]=e)})),e.chats.forEach((e=>{(e instanceof o.Api.Chat||e instanceof o.Api.Channel)&&(L.chats[e.id]=e)})),e.messages.forEach((e=>{(e instanceof o.Api.Message&&le(e)||e instanceof o.Api.MessageService&&function(e){return"photo"in e.action&&e.action.photo instanceof o.Api.Photo}(e))&&ye(e)}))}async function Zn({chat:e}){const t=await kt(new o.Api.messages.Search({peer:ee(e.id,e.accessHash),filter:new o.Api.InputMessagesFilterPinned,q:"",limit:50}));if(t&&!(t instanceof o.Api.messages.MessagesNotModified)&&t.messages)return Xn(t),{messages:t.messages.map(Pe).filter(Boolean),users:t.users.map(Ne).filter(Boolean),chats:t.chats.map((e=>w(e))).filter(Boolean)}}let Yn,es,ts,ns;async function ss({id:e,accessHash:t}){const n=ne(e,t);if(!(n instanceof o.Api.InputUser))return;const s=await kt(new o.Api.users.GetFullUser({id:n}));if(!s)return;const a=Fe(s);Yn({"@type":"updateUser",id:e,user:{fullInfo:a.fullInfo}})}async function as(){const e=await kt(new o.Api.help.GetNearestDc);return null==e?void 0:e.country}async function is({hash:e=0}){const t=await kt(new o.Api.contacts.GetTopPeers({hash:e,correspondents:!0}));if(!(t instanceof o.Api.contacts.TopPeers))return;const n=t.users.map(Ne).filter((e=>!!e&&!e.isSelf)),s=n.map((({id:e})=>e));return{hash:de(s),ids:s,users:n}}async function rs({hash:e=0}){const t=await kt(new o.Api.contacts.GetContacts({hash:e}));if(t&&!(t instanceof o.Api.contacts.ContactsNotModified))return t.users.forEach((e=>{e instanceof o.Api.User&&(L.users[e.id]=e)})),{hash:de([t.savedCount,...t.contacts.map((({userId:e})=>e))]),users:t.users.map(Ne).filter(Boolean),chats:t.users.map((e=>w(e))).filter(Boolean)}}async function os({users:e}){const t=await kt(new o.Api.users.GetUsers({id:e.map((({id:e,accessHash:t})=>ee(e,t)))}));if(t&&t.length)return t.forEach((e=>{e instanceof o.Api.User&&(L.users[e.id]=e)})),t.map(Ne).filter(Boolean)}function cs({phone:e,firstName:t,lastName:n}){return kt(new o.Api.contacts.ImportContacts({contacts:[ue({phone:e||"",firstName:t||"",lastName:n||""})]}))}async function ds({id:e,accessHash:t}){const n=ne(e,t);n instanceof o.Api.InputUser&&await kt(new o.Api.contacts.DeleteContacts({id:[n]}))&&Yn({"@type":"deleteUser",id:e})}async function ls(e,t){if(e){const{id:t,accessHash:n}=e,s=await kt(new o.Api.photos.GetUserPhotos({userId:ne(t,n),limit:40,offset:0,maxId:j()("0")}));if(!s)return;return function(e){e.photos.forEach(be)}(s),{photos:s.photos.filter((e=>e instanceof o.Api.Photo)).map(N)}}const n=await Hn({chatOrUser:t,type:"profilePhoto",limit:40});if(!n)return;const{messages:s,users:a}=n;return{photos:s.map((e=>e.content.action.photo)).filter(Boolean),users:a}}async function us({hash:e}){const t=await kt(new o.Api.messages.GetAllStickers({hash:e}));if(t&&!(t instanceof o.Api.messages.AllStickersNotModified))return t.sets.forEach((e=>{var t;null!==(t=e.thumbs)&&void 0!==t&&t.length&&(L.stickerSets[String(e.id)]=e)})),{hash:t.hash,sets:t.sets.map(G)}}async function gs({hash:e}){const t=await kt(new o.Api.messages.GetRecentStickers({hash:e}));if(t&&!(t instanceof o.Api.messages.RecentStickersNotModified))return{hash:t.hash,stickers:As(t.stickers.slice(0,20))}}async function ps({hash:e}){const t=await kt(new o.Api.messages.GetFavedStickers({hash:e}));if(t&&!(t instanceof o.Api.messages.FavedStickersNotModified))return{hash:t.hash,stickers:As(t.stickers)}}async function fs({hash:e}){const t=await kt(new o.Api.messages.GetFeaturedStickers({hash:e}));if(t&&!(t instanceof o.Api.messages.FeaturedStickersNotModified))return{hash:t.hash,sets:t.sets.map(K)}}async function hs({sticker:e,unfave:t}){const n=new o.Api.messages.FaveSticker({id:ae(e),unfave:t});await kt(n)&&es({"@type":"updateFavoriteStickers"})}async function ms({stickerSetShortName:e,stickerSetId:t,accessHash:n}){const s=await kt(new o.Api.messages.GetStickerSet({stickerset:t?se(t,n):(a=e,new o.Api.InputStickerSetShortName({shortName:a}))}));var a,i;if(s)return{set:G(s.set),stickers:As(s.documents),packs:(i=s.packs,i.reduce(((e,{emoticon:t,documents:n})=>(e[t]=n.map((e=>H(L.documents[String(e)]))).filter(Boolean),e)),{}))}}async function _s(){const e=await kt(new o.Api.messages.GetStickerSet({stickerset:new o.Api.InputStickerSetAnimatedEmoji}));if(e)return{set:G(e.set),stickers:As(e.documents)}}async function ys({query:e,hash:t}){const n=await kt(new o.Api.messages.SearchStickerSets({q:e,hash:t}));if(n&&!(n instanceof o.Api.messages.FoundStickerSetsNotModified))return{hash:n.hash,sets:n.sets.map(K)}}async function bs({hash:e}){const t=await kt(new o.Api.messages.GetSavedGifs({hash:e}));if(t&&!(t instanceof o.Api.messages.SavedGifsNotModified))return{hash:t.hash,gifs:Ss(t.gifs)}}async function ws({stickerSetId:e,accessHash:t}){await kt(new o.Api.messages.InstallStickerSet({stickerset:se(e,t)}))&&es({"@type":"updateStickerSet",id:e,stickerSet:{installedDate:Date.now()}})}async function Is({stickerSetId:e,accessHash:t}){await kt(new o.Api.messages.UninstallStickerSet({stickerset:se(e,t)}))&&es({"@type":"updateStickerSet",id:e,stickerSet:{installedDate:void 0}})}async function Cs({query:e,offset:t=""}){if(!ts){const e=await kt(new o.Api.help.GetConfig);if(!e)return;const t=await kt(new o.Api.contacts.ResolveUsername({username:e.gifSearchUsername}));if(!(t&&t.users[0]instanceof o.Api.User))return;ts=new o.Api.InputUser({userId:t.peer.userId,accessHash:t.users[0].accessHash})}const n=await kt(new o.Api.messages.GetInlineBotResults({bot:ts,peer:new o.Api.InputPeerEmpty,query:e,offset:t}));if(!n)return;const s=n.results.map((e=>{if(e instanceof o.Api.BotInlineMediaResult)return e.document})).filter(Boolean);return{nextOffset:n.nextOffset,gifs:Ss(s)}}async function Ps({emoji:e,hash:t=0}){const n=await kt(new o.Api.messages.GetStickers({emoticon:e,hash:t}));if(n&&!(n instanceof o.Api.messages.StickersNotModified))return{stickers:As(n.stickers),hash:n.hash}}async function vs({language:e,fromVersion:t}){const n=await kt(new o.Api.messages.GetEmojiKeywordsDifference({langCode:e,fromVersion:t}));if(n)return{language:n.langCode,version:n.version,keywords:n.keywords.reduce(((e,t)=>(e[t.keyword]=t.emoticons,e)),{})}}function As(e){return e.map((e=>{if(e instanceof o.Api.Document){const t=H(e);if(t)return L.documents[String(e.id)]=e,t}})).filter(Boolean)}function Ss(e){return e.map((e=>{if(e instanceof o.Api.Document){const t=ke(e);if(t)return L.documents[String(e.id)]=e,t}})).filter(Boolean)}async function Ms({username:e}){try{return await kt(new o.Api.channels.CheckUsername({channel:new o.Api.InputChannelEmpty,username:e}),void 0,!0)}catch(e){return!1}}async function ks({chat:e,username:t}){await kt(new o.Api.channels.UpdateUsername({channel:ne(e.id,e.accessHash),username:t}))&&ns({"@type":"updateChat",id:e.id,chat:{username:t}})}async function Rs({chat:e}){const t=await kt(new o.Api.messages.ExportChatInvite({peer:ee(e.id,e.accessHash)}));t&&t instanceof o.Api.ChatInviteExported&&ns({"@type":"updateChatFullInfo",id:e.id,fullInfo:{inviteLink:t.link}})}const Us={EMAIL_UNCONFIRMED:"Email unconfirmed",EMAIL_HASH_EXPIRED:"Email hash expired",NEW_SALT_INVALID:"The new salt is invalid",NEW_SETTINGS_INVALID:"The new password settings are invalid",CODE_INVALID:"Invalid Code",PASSWORD_HASH_INVALID:"Invalid Password"},Es={};let Ds;async function Ts(){const e=await kt(new o.Api.account.GetPassword);if(!e)return;const{hint:t,hasPassword:n}=e;return{hint:t,hasPassword:n}}function Bs(e){return Ds({"@type":"updateTwoFaStateWaitCode",length:e}),new Promise(((e,t)=>{Es.resolve=e,Es.reject=t}))}async function xs(e){try{return await Et({isCheckPassword:!0,currentPassword:e}),!0}catch(e){return Ls(e),!1}}async function Vs(e){try{return await Et({currentPassword:e}),!0}catch(e){return Ls(e),!1}}async function Fs(e,t,n,s){try{return await Et({currentPassword:e,newPassword:t,hint:n,email:s,emailCodeCallback:Bs,onEmailCodeError:Ls}),!0}catch(e){return Ls(e),!1}}async function Ns(e,t){try{return await Et({currentPassword:e,newPassword:e,email:t,emailCodeCallback:Bs,onEmailCodeError:Ls}),!0}catch(e){return Ls(e),!1}}function Os(e){Es.resolve(e)}function Ls(e){let t;if(e instanceof o.errors.FloodWaitError){const n=Math.ceil(Number(e.seconds)/60/60);t="Too many attempts. Try again in "+(n>1?`${n} hours`:"an hour")}else t=Us[e.message];t||(t="Unexpected Error"),Ds({"@type":"updateTwoFaError",message:t})}const qs=["ar","fa","id","ko","uz"];function Hs({firstName:e,lastName:t,about:n}){return kt(new o.Api.account.UpdateProfile({firstName:e||"",lastName:t||"",about:n||""}))}function Gs(e){return kt(new o.Api.account.CheckUsername({username:e}))}function Ks(e){return kt(new o.Api.account.UpdateUsername({username:e}))}async function zs(e){const t=await Ut(e);return kt(new o.Api.photos.UploadProfilePhoto({file:t}))}async function Ws(e){const t=await Ut(e);await kt(new o.Api.photos.UploadProfilePhoto({file:t}))}async function js(e){const t=await kt(new o.Api.account.GetWallPapers({hash:e}));if(!t||t instanceof o.Api.account.WallPapersNotModified)return;const n=t.wallpapers.filter((e=>e instanceof o.Api.WallPaper&&e.document instanceof o.Api.Document&&!e.pattern&&"application/x-tgwallpattern"!==e.document.mimeType));return n.forEach((e=>{L.documents[String(e.document.id)]=e.document})),{hash:t.hash,wallpapers:n.map(qe).filter(Boolean)}}async function $s(e){const t=await Ut(e),n=await kt(new o.Api.account.UploadWallPaper({file:t,mimeType:e.type,settings:new o.Api.WallPaperSettings}));if(!(n&&n instanceof o.Api.WallPaper))return;const s=qe(n);return s?(L.documents[String(n.document.id)]=n.document,{wallpaper:s}):void 0}async function Js(){const e=await kt(new o.Api.contacts.GetBlocked({limit:100}));if(e)return ha(e),{users:e.users.map(Ne).filter(Boolean),chats:e.chats.map((e=>w(e,void 0,!0))).filter(Boolean),blockedIds:e.blocked.map((e=>I(e.peerId))),totalCount:e instanceof o.Api.contacts.BlockedSlice?e.count:e.blocked.length}}function Qs(e,t){return kt(new o.Api.contacts.Block({id:ee(e,t)}))}function Xs(e,t){return kt(new o.Api.contacts.Unblock({id:ee(e,t)}))}async function Zs(){const e=await kt(new o.Api.account.GetAuthorizations);if(e)return e.authorizations.map(He)}function Ys(e){return kt(new o.Api.account.ResetAuthorization({hash:j()(e)}))}function ea(){return kt(new o.Api.auth.ResetAuthorizations)}async function ta({serverTimeOffset:e}){const t=await kt(new o.Api.account.GetNotifyExceptions({compareSound:!0}));if(t instanceof o.Api.Updates||t instanceof o.Api.UpdatesCombined)return ha(t),t.updates.reduce(((t,n)=>n instanceof o.Api.UpdateNotifySettings&&n.peer instanceof o.Api.NotifyPeer?(t.push(Ke(n.notifySettings,n.peer.peer,e)),t):t),[])}async function na({serverTimeOffset:e}){const[t,n,s,a]=await Promise.all([kt(new o.Api.account.GetContactSignUpNotification),kt(new o.Api.account.GetNotifySettings({peer:new o.Api.InputNotifyUsers})),kt(new o.Api.account.GetNotifySettings({peer:new o.Api.InputNotifyChats})),kt(new o.Api.account.GetNotifySettings({peer:new o.Api.InputNotifyBroadcasts}))]);if(!n||!s||!a)return!1;const{silent:i,muteUntil:r,showPreviews:c}=n,{silent:d,muteUntil:l,showPreviews:u}=s,{silent:g,muteUntil:p,showPreviews:h}=a;return{hasContactJoinedNotifications:!t,hasPrivateChatsNotifications:!(i||"number"==typeof r&&f(e)kt(new o.Api.langpack.GetLangPack({langPack:e,langCode:qs.includes(t)?`${t}-raw`:t})))))).filter(Boolean).map((e=>c(e.strings.map(p),"key")));if(n.length)return{langPack:Object.assign({},...n.reverse())}}async function oa({langPack:e,langCode:t,keys:n}){const s=await kt(new o.Api.langpack.GetStrings({langPack:e,langCode:qs.includes(t)?`${t}-raw`:t,keys:n}));if(s)return s.map(p)}async function ca(e){const t=he(e),n=await kt(new o.Api.account.GetPrivacy({key:t}));if(n)return ha(n),Ge(n.rules)}function da(e){const t=Ct.session.getAuthKey().getKey();return kt(new o.Api.account.RegisterDevice({tokenType:10,secret:t,appSandbox:!1,otherUids:[],token:e}))}function la(e){return kt(new o.Api.account.UnregisterDevice({tokenType:10,otherUids:[],token:e}))}async function ua(e,t){const n=he(e),s=[];switch(t.allowedUsers&&s.push(new o.Api.InputPrivacyValueAllowUsers({users:t.allowedUsers.map((({id:e,accessHash:t})=>ee(e,t)))})),t.allowedChats&&s.push(new o.Api.InputPrivacyValueAllowChatParticipants({chats:t.allowedChats.map((({id:e})=>-e))})),t.blockedUsers&&s.push(new o.Api.InputPrivacyValueDisallowUsers({users:t.blockedUsers.map((({id:e,accessHash:t})=>ee(e,t)))})),t.blockedChats&&s.push(new o.Api.InputPrivacyValueDisallowChatParticipants({chats:t.blockedChats.map((({id:e})=>-e))})),t.visibility){case"everybody":s.push(new o.Api.InputPrivacyValueAllowAll);break;case"contacts":s.push(new o.Api.InputPrivacyValueAllowContacts);break;case"nonContacts":s.push(new o.Api.InputPrivacyValueDisallowContacts);break;case"nobody":s.push(new o.Api.InputPrivacyValueDisallowAll)}const a=await kt(new o.Api.account.SetPrivacy({key:n,rules:s}));if(a)return ha(a),Ge(a.rules)}async function ga(e){await kt(new o.Api.account.UpdateStatus({offline:!e}))}async function pa(){const e=await kt(new o.Api.account.GetContentSettings);if(e)return{isSensitiveEnabled:Boolean(e.sensitiveEnabled),canChangeSensitive:Boolean(e.sensitiveCanChange)}}function fa(e){return kt(new o.Api.account.SetContentSettings({sensitiveEnabled:e||void 0}))}function ha(e){e.users.forEach((e=>{e instanceof o.Api.User&&(L.users[e.id]=e)})),e.chats.forEach((e=>{(e instanceof o.Api.Chat||e instanceof o.Api.Channel)&&(L.chats[e.id]=e)}))}function ma(e){return e?d(e,["url","mimeType"]):void 0}var _a=n(8764).Buffer;function ya({chatId:e,accessHash:t,messageId:n,data:s}){return kt(new o.Api.messages.GetBotCallbackAnswer({peer:ee(e,t),msgId:n,data:_a.from(s)}))}async function ba({hash:e=0}){const t=await kt(new o.Api.contacts.GetTopPeers({hash:e,botsInline:!0}));if(!(t instanceof o.Api.contacts.TopPeers))return;const n=t.users.map(Ne).filter(Boolean),s=n.map((({id:e})=>e));return{hash:de(s),ids:s,users:n}}async function wa({username:e}){const t=await kt(new o.Api.contacts.ResolveUsername({username:e}));if(t&&t.users[0]instanceof o.Api.User&&t.users[0].bot&&t.users[0].botInlinePlaceholder)return va(t.users[0]),{user:Ne(t.users[0]),chat:w(t.users[0])}}async function Ia({bot:e,chat:t,query:n,offset:s=""}){const a=await kt(new o.Api.messages.GetInlineBotResults({bot:ee(e.id,e.accessHash),peer:ee(t.id,t.accessHash),query:n,offset:s}));var i,r,c,l,u;if(a)return a.users.map(va),{isGallery:Boolean(a.gallery),help:e.botPlaceholder,nextOffset:(l=e.username,u=a.nextOffset,"gif"===l&&"0"===u?"":u),switchPm:(c=a.switchPm,c?d(c,["text","startParam"]):void 0),users:a.users.map(Ne).filter(Boolean),results:(i=String(a.queryId),r=a.results,r.map((e=>{return e instanceof o.Api.BotInlineMediaResult?(e.document instanceof o.Api.Document&&(t=e.document,L.documents[String(t.id)]=t),e.photo instanceof o.Api.Photo&&(n=e.photo,L.photos[String(n.id)]=n),function(e,t){const{id:n,type:s,title:a,description:i,photo:r,document:c}=e;return{id:n,queryId:t,type:s,title:a,description:i,..."sticker"===s&&c instanceof o.Api.Document&&{sticker:H(c)},...r instanceof o.Api.Photo&&{photo:N(r)},..."gif"===s&&c instanceof o.Api.Document&&{gif:ke(c)},..."video"===s&&c instanceof o.Api.Document&&{thumbnail:F(c.thumbs)}}}(e,i)):(e.thumb&&(s=e.thumb,L.webDocuments[s.url]=s),function(e,t){const{id:n,type:s,title:a,description:i,url:r,thumb:o}=e;return{id:n,queryId:t,type:s,title:a,description:i,url:r,webThumbnail:ma(o)}}(e,i));var t,n,s})))}}async function Ca({chat:e,resultId:t,queryId:n,replyingTo:s}){const a=re();await kt(new o.Api.messages.SendInlineBotResult({clearDraft:!0,randomId:a,queryId:j()(n),peer:ee(e.id,e.accessHash),id:t,...s&&{replyToMsgId:s}}),!0)}async function Pa({bot:e,startParam:t}){const n=re();await kt(new o.Api.messages.StartBot({bot:ee(e.id,e.accessHash),peer:ee(e.id,e.accessHash),randomId:n,startParam:t}),!0)}function va(e){L.users[e.id]=e}function Aa(e){if(e)return Object.values(e).map((e=>({id:e.id,title:e.title,amount:e.prices.reduce(((e,t)=>e+Number(t.amount.value)),0),prices:e.prices.map((({label:e,amount:t})=>({label:e,amount:Number(t.value)})))})))}async function Sa({chat:e,messageId:t,requestInfo:n,shouldSave:s}){const a=await kt(new o.Api.payments.ValidateRequestedInfo({peer:ee(e.id,e.accessHash),msgId:t,save:s||void 0,info:fe(n)}));if(!a)return;const{id:i,shippingOptions:r}=a;return i?{id:i,shippingOptions:Aa(r)}:void 0}function Ma({chat:e,messageId:t,formId:n,requestedInfoId:s,shippingOptionId:a,credentials:i}){return kt(new o.Api.payments.SendPaymentForm({formId:j()(n),peer:ee(e.id,e.accessHash),msgId:t,requestedInfoId:s,shippingOptionId:a,credentials:new o.Api.InputPaymentCredentials({save:i.save,data:new o.Api.DataJSON({data:JSON.stringify(i.data)})})}),!0)}async function ka({chat:e,messageId:t}){const n=await kt(new o.Api.payments.GetPaymentForm({peer:ee(e.id,e.accessHash),msgId:t}));if(n)return function(e){const{formId:t,canSaveCredentials:n,passwordMissing:s,providerId:a,nativeProvider:i,nativeParams:r,savedInfo:o,invoice:c}=e,{test:d,nameRequested:l,phoneRequested:u,emailRequested:g,shippingAddressRequested:p,flexible:f,phoneToProvider:h,emailToProvider:m,currency:_,prices:y}=c,b=y.map((({label:e,amount:t})=>({label:e,amount:Number(t.value)}))),w=r?JSON.parse(r.data):{};return{canSaveCredentials:n,passwordMissing:s,formId:String(t),providerId:a,nativeProvider:i,savedInfo:o,invoice:{test:d,nameRequested:l,phoneRequested:u,emailRequested:g,shippingAddressRequested:p,flexible:f,phoneToProvider:h,emailToProvider:m,currency:_,prices:b},nativeParams:{needCardholderName:w.need_cardholder_name,needCountry:w.need_country,needZip:w.need_zip,publishableKey:w.publishable_key}}}(n)}async function Ra(e,t){const n=await kt(new o.Api.payments.GetPaymentReceipt({peer:ee(e.id,e.accessHash),msgId:t}));if(n)return function(e){const{invoice:t,info:n,shipping:s,currency:a,totalAmount:i,credentialsTitle:r}=e,{shippingAddress:o,phone:c,name:d}=n||{},{prices:l}=t,u=l.map((({label:e,amount:t})=>({label:e,amount:Number(t.value)})));let g,p;return s&&(g=s.prices.map((({label:e,amount:t})=>({label:e,amount:Number(t.value)}))),p=s.title),{currency:a,prices:u,info:{shippingAddress:o,phone:c,name:d},totalAmount:Number(i.value),credentialsTitle:r,shippingPrices:g,shippingMethod:p}}(n)}let Ua;async function Ea(e,t){Ua=e,function(e){Ie=e}(Va),function(e){Qe=e}(Va),function(e){Bt=e}(Va),function(e){vn=e}(Va),function(e){Yn=e}(Va),function(e){es=e}(Va),function(e){ns=e}(Va),function(e){Ds=e}(Va),await async function(e,t){It=e;const{userAgent:n,platform:s,sessionData:a}=t,i=new o.sessions.CallbackSession(a,St);Ct=new o.TelegramClient(i,"2496","8da85b0d5bfe62527e5b244c209159c3",{deviceModel:navigator.userAgent||n||"Unknown UserAgent",appVersion:"1.11.13 Z",useWSS:!0,additionalDcsDisabled:!1}),Ct.addEventHandler(Mt,wt),Ct.addEventHandler(je,wt);try{try{await Ct.start({phoneNumber:Xe,phoneCode:Ze,password:Ye,firstAndLastNames:et,qrCode:tt,onError:nt,initialMethod:"iOS"===s||"Android"===s?"phoneNumber":"qrCode"})}catch(e){if("Disconnect"!==e.message)return void It({"@type":"updateConnectionState",connectionState:"connectionStateBroken"})}Qe(st("authorizationStateReady")),St(i.getSessionData()),It({"@type":"updateApiReady"}),Dt()}catch(e){throw e}}(Va,t)}const Da=function(e,t){let n,s=!1;return(...a)=>{n=a,s||(s=!0,e((()=>{s=!1,t(...n)})))}}((function(e){Promise.resolve().then(e)}),(function(e){if(!xa||e!==Ba)return;const t=xa;xa=void 0,t.forEach(Ua)}));let Ta,Ba,xa;function Va(e){xa?xa.push(e):xa=[e],Ta&&!r.has(e["@type"])||(Ta=function(e,t,n=!0){let s,a,i;return(...r)=>{a=!0,i=r,s||(n&&(a=!1,e(...i)),s=self.setInterval((()=>{if(!a)return self.clearInterval(s),void(s=void 0);a=!1,e(...i)}),t))}}(Da,i,!0),Ba=Math.random()),Ta(Ba)}self.onerror=e=>{console.error(e),Oa({type:"unhandledError",error:{message:e.error.message||"Uncaught exception in worker"}})},self.addEventListener("unhandledrejection",(e=>{console.error(e),Oa({type:"unhandledError",error:{message:e.reason.message||"Uncaught rejection in worker"}})}));const Fa=new Map;function Na(e){Oa({type:"update",update:e})}function Oa(e,t){t?postMessage(e,[t]):postMessage(e)}onmessage=async e=>{const{data:t}=e;switch(t.type){case"initApi":await Ea(Na,t.args[0]);break;case"callMethod":{const{messageId:e,name:n,args:s}=t;try{if(e){const t=(...t)=>{const n=t[t.length-1];Oa({type:"methodCallback",messageId:e,callbackArgs:t},n instanceof ArrayBuffer?n:void 0)};Fa.set(e,t),s.push(t)}const t=await function(e,...t){return a[e](...t)}(n,...s),{arrayBuffer:i}="object"==typeof t&&"arrayBuffer"in t&&t||{};e&&Oa({type:"methodResponse",messageId:e,response:t},i)}catch(t){e&&Oa({type:"methodResponse",messageId:e,error:{message:t.message}})}e&&Fa.delete(e);break}case"cancelProgress":{const e=Fa.get(t.messageId);e&&(e.isCanceled=!0);break}case"ping":Oa({type:"methodResponse",messageId:t.messageId})}}},9618:(e,t,n)=>{var s=n(8764).Buffer;const a=n(4736),i=n(6842);function r(e,t=!0,n=!1){let i=s.from(e);const r=i.length;t&&(i=i.reverse());let o=a(i.toString("hex"),16);return n&&Math.floor(o.toString("2").length/8)>=r&&(o=o.subtract(a(2).pow(a(8*r)))),o}function o(e,t=8){const n=a(e),i=[];for(let e=0;e>>1:e>>>1;t[n]=e}return t}()),s.isBuffer(e)||(e=s.from(e));let t=-1;for(let n=0;n>>8}return(-1^t)>>>0},generateRandomBytes:d,generateKeyDataFromNonce:async function(e,t){e=o(e,16),t=o(t,32);const[n,a,i]=await Promise.all([l(s.concat([t,e])),l(s.concat([e,t])),l(s.concat([t,t]))]);return{key:s.concat([n,a.slice(0,12)]),iv:s.concat([a.slice(12,20),i,t.slice(0,4)])}},sha1:l,sha256:function(e){const t=i.createHash("sha256");return t.update(e),t.digest()},bigIntMod:function(e,t){return e.remainder(t).add(t).remainder(t)},modExp:function(e,t,n){e=e.remainder(n);let s=a.one,i=e;for(;t.greater(a.zero);){const e=t.remainder(a(2));t=t.divide(a(2)),e.eq(a.one)&&(s=s.multiply(i),s=s.remainder(n)),i=i.multiply(i),i=i.remainder(n)}return s},getRandomInt:function(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e},sleep:e=>new Promise((t=>setTimeout(t,e))),getByteArray:function(e,t=!1){const n=e.toString(2).length,s=Math.floor((n+8-1)/8);return c(a(e),s,!1,t)},toSignedLittleBuffer:o,convertToLittle:function(e){const t=s.alloc(4*e.length);for(let n=0;n{e=t})),resolve:e}}}},9674:(e,t,n)=>{var s=n(8764).Buffer;const a=n(4736),{constructors:i}=n(7404),{readBigIntFromBuffer:r,readBufferFromBigInt:o,sha256:c,bigIntMod:d,modExp:l,generateRandomBytes:u}=n(9618),g=n(6842);function p(e,t){if(!s.from([199,28,174,185,198,177,201,4,142,108,82,47,112,241,63,115,152,13,64,35,142,62,33,193,73,52,208,55,86,61,147,15,72,25,138,10,167,193,64,88,34,148,147,210,37,48,244,219,250,51,111,110,10,201,37,19,149,67,174,212,76,206,124,55,32,253,81,246,148,88,112,90,198,140,212,254,107,107,19,171,220,151,70,81,41,105,50,132,84,241,143,175,140,89,95,100,36,119,254,150,187,42,148,29,91,205,29,74,200,204,73,136,7,8,250,155,55,142,60,79,58,144,96,190,230,124,249,164,164,166,149,129,16,81,144,126,22,39,83,181,107,15,107,65,13,186,116,216,168,75,42,20,179,20,78,14,241,40,71,84,253,23,237,149,13,89,101,180,185,221,70,88,45,177,23,141,22,156,107,196,101,176,214,255,156,163,146,143,239,91,154,228,228,24,252,21,232,62,190,160,248,127,169,255,94,237,112,5,13,237,40,73,244,123,249,89,217,86,133,12,233,41,133,31,13,129,21,246,53,177,5,238,46,78,21,208,75,36,84,191,111,79,173,240,52,177,4,3,17,156,216,227,185,47,204,91]).equals(e)||![3,4,5,7].includes(t))throw new Error("Changing passwords unsupported")}function f(e){return s.concat([s.alloc(256-e.length),e])}function h(e){return o(e,256,!1)}function m(e,t){const n=t.subtract(e);return!(n.lesser(a(0))||n.bitLength()<1984||e.bitLength()<1984||Math.floor((e.bitLength()+7)/8)>256)}function _(e,t){const n=Math.min(e.length,t.length);for(let s=0;s{for(;;){const e=u(256),t=r(e,!1),n=l(a(b),t,g);if(m(n,g)){const e=h(n),i=r(await c(s.concat([e,v])),!1);if(i.greater(a(0)))return[t,e,i]}}})(),E=d(w.subtract(M),g);if(!m(E,g))throw new Error("bad gB");const D=U.multiply(I),T=k.add(D),B=l(E,T,g),[x,V,F,N,O]=await Promise.all([c(h(B)),c(C),c(P),c(n.salt1),c(n.salt2)]),L=await c(s.concat([_(V,F),N,O,R,v,x]));return new i.InputCheckPasswordSRP({srpId:e.srpId,A:s.from(R),M1:L})},computeDigest:async function(e,t){try{p(e.p,e.g)}catch(e){throw new Error("bad p/g in password")}return h(l(a(e.g),r(await y(e,t),!1),r(e.p,!1)))}}},8960:(e,t,n)=>{var s=n(8764).Buffer;const{constructors:a}=n(7404),i=s.from("ffd8ffe000104a46494600010100000100010000ffdb004300281c1e231e19282321232d2b28303c64413c37373c7b585d4964918099968f808c8aa0b4e6c3a0aadaad8a8cc8ffcbdaeef5ffffff9bc1fffffffaffe6fdfff8ffdb0043012b2d2d3c353c76414176f8a58ca5f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8ffc00011080000000003012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffda000c03010002110311003f00","hex"),r=s.from("ffd9","hex");function o(e,t){throw new Error(`Cannot cast ${e.className} to any kind of ${t}`)}e.exports={getMessageId:function(e){if(void 0!==e){if("number"==typeof e)return e;if(2030045667===e.SUBCLASS_OF_ID)return e.id;throw new Error(`Invalid message type: ${e.constructor.name}`)}},getInputPeer:function e(t,n=!0,s=!0){if(void 0===t.SUBCLASS_OF_ID){if(n&&"inputEntity"in t)return t.inputEntity;if("entity"in t)return e(t.entity);o(t,"InputPeer")}if(3374092470===t.SUBCLASS_OF_ID)return t;if(t instanceof a.User){if(t.isSelf&&n)return new a.InputPeerSelf;if(void 0===t.accessHash&&s)throw new Error("User without accessHash or min info cannot be input");return new a.InputPeerUser({userId:t.id,accessHash:t.accessHash})}if(t instanceof a.Chat||t instanceof a.ChatEmpty||t instanceof a.ChatForbidden)return new a.InputPeerChat({chatId:t.id});if(t instanceof a.Channel){if(void 0===t.accessHash&&s)throw new TypeError("Channel without accessHash or min info cannot be input");return new a.InputPeerChannel({channelId:t.id,accessHash:t.accessHash})}return t instanceof a.ChannelForbidden?new a.InputPeerChannel({channelId:t.id,accessHash:t.accessHash}):t instanceof a.InputUser?new a.InputPeerUser({userId:t.userId,accessHash:t.accessHash}):t instanceof a.InputChannel?new a.InputPeerChannel({channelId:t.channelId,accessHash:t.accessHash}):t instanceof a.UserEmpty?new a.InputPeerEmpty:t instanceof a.UserFull?e(t.user):t instanceof a.ChatFull?new a.InputPeerChat({chatId:t.id}):t instanceof a.PeerChat?new a.InputPeerChat(t.chatId):void o(t,"InputPeer")},getDisplayName:function(e){return e instanceof a.User?e.lastName&&e.firstName?`${e.firstName} ${e.lastName}`:e.firstName?e.firstName:e.lastName?e.lastName:"":e instanceof a.Chat||e instanceof a.Channel?e.title:""},getAppropriatedPartSize:function(e){if(e<=104857600)return 128;if(e<=786432e3)return 256;if(e<=2097152e3)return 512;throw new Error("File size too large")},strippedPhotoToJpg:function(e){if(e.length<3||1!==e[0])return e;const t=s.from(i);return t[164]=e[1],t[166]=e[2],s.concat([t,e.slice(3),r])},getDC:function(e,t=!1){switch(e){case 1:return{id:1,ipAddress:`zws1${t?"-1":""}.web.telegram.org`,port:443};case 2:return{id:2,ipAddress:`zws2${t?"-1":""}.web.telegram.org`,port:443};case 3:return{id:3,ipAddress:`zws3${t?"-1":""}.web.telegram.org`,port:443};case 4:return{id:4,ipAddress:`zws4${t?"-1":""}.web.telegram.org`,port:443};case 5:return{id:5,ipAddress:`zws5${t?"-1":""}.web.telegram.org`,port:443};default:throw new Error(`Cannot find the DC with the ID of ${e}`)}}}},1472:e=>{e.exports="0.0.2"},243:(e,t,n)=>{"use strict";n.r(t),n.d(t,{updateTwoFaSettings:()=>l});var s=n(7150),a=n.n(s),i=n(9618),r=n(9674),o=n(7873),c=n.n(o),d=n(8764).Buffer;async function l(e,{isCheckPassword:t,currentPassword:n,newPassword:s,hint:o="",email:l,emailCodeCallback:u,onEmailCodeError:g}){if(!s&&!n)throw new Error("Neither `currentPassword` nor `newPassword` is present");if(l&&(!u||!g))throw new Error("`email` present without `emailCodeCallback` and `onEmailCodeError`");const p=await e.invoke(new(a().account.GetPassword));p.newAlgo instanceof a().PasswordKdfAlgoUnknown||(p.newAlgo.salt1=d.concat([p.newAlgo.salt1,(0,i.generateRandomBytes)(32)])),!p.hasPassword&&n&&(n=void 0);const f=n?await(0,r.computeCheck)(p,n):new(a().InputCheckPasswordEmpty);if(t)await e.invoke(new(a().auth.CheckPassword)({password:f}));else try{await e.invoke(new(a().account.UpdatePasswordSettings)({password:f,newSettings:new(a().account.PasswordInputSettings)({newAlgo:p.newAlgo,newPasswordHash:s?await(0,r.computeDigest)(p.newAlgo,s):d.alloc(0),hint:o,email:l,newSecureSettings:void 0})}))}catch(t){if(!(t instanceof c().EmailUnconfirmedError))throw t;for(;;)try{const n=await u(t.codeLength);if(!n)throw new Error("Code is empty");await e.invoke(new(a().account.ConfirmPasswordEmail)({code:n}));break}catch(e){g(e)}}}},8742:(e,t,n)=>{var s=n(8764).Buffer;const a=n(7435),i=n(6748),{sleep:r}=n(9618),o=n(7873),c=n(3995),d=n(9618),l=n(8960),u=n(9270),{LAYER:g}=n(845),{constructors:p,requests:f}=n(7404),h=n(4046),{ConnectionTCPObfuscated:m}=n(2986),{authFlow:_,checkAuthorization:y}=n(1545),{downloadFile:b}=n(2288),{uploadFile:w}=n(4766),{updateTwoFaSettings:I}=n(243),C=131072,P=["w","y","d","x","c","m","b","a","s"];class v{constructor(e,t,n,s=v.DEFAULT_OPTIONS){if(!t||!n)throw Error('Your API ID or Hash are invalid. Please read "Requirements" on README.md');const r={...v.DEFAULT_OPTIONS,...s};if(this.apiId=t,this.apiHash=n,this._useIPV6=r.useIPV6,"string"==typeof r.baseLogger?this._log=new i:this._log=r.baseLogger,"string"!=typeof e&&e){if(!(e instanceof u))throw new Error("The given session must be str or a session instance")}else try{throw new Error("not implemented")}catch(t){e=new c}this.floodSleepLimit=r.floodSleepLimit,this._eventBuilders=[],this._phoneCodeHash={},this.session=e,this.apiId=parseInt(t,10),this.apiHash=n,this._requestRetries=r.requestRetries,this._connectionRetries=r.connectionRetries,this._retryDelay=r.retryDelay||0,r.proxy&&this._log.warn("proxies are not supported"),this._proxy=r.proxy,this._timeout=r.timeout,this._autoReconnect=r.autoReconnect,this._connection=r.connection,this._floodWaitedRequests={},this._initWith=e=>new f.InvokeWithLayer({layer:g,query:new f.InitConnection({apiId:this.apiId,deviceModel:r.deviceModel||a.type().toString()||"Unknown",systemVersion:r.systemVersion||a.release().toString()||"1.0",appVersion:r.appVersion||"1.0",langCode:r.langCode,langPack:"",systemLangCode:r.systemLangCode,query:e,proxy:void 0})}),this._args=r,this._config=void 0,this.phoneCodeHashes=[],this._exportedSenderPromises={},this._exportedSenderReleaseTimeouts={},this._additionalDcsDisabled=r.additionalDcsDisabled,this._loopStarted=!1,this._reconnecting=!1,this._destroyed=!1}async connect(){await this._initSession(),void 0===this._sender&&(this._sender=new h(this.session.getAuthKey(),{logger:this._log,dcId:this.session.dcId,retries:this._connectionRetries,delay:this._retryDelay,autoReconnect:this._autoReconnect,connectTimeout:this._timeout,authKeyCallback:this._authKeyCallback.bind(this),updateCallback:this._handleUpdate.bind(this),isMainSender:!0})),this._sender.userDisconnected=!1,this._sender._user_connected=!1,this._sender._reconnecting=!1,this._sender._disconnected=!0;const e=new this._connection(this.session.serverAddress,this.session.port,this.session.dcId,this._log);await this._sender.connect(e)?(this.session.setAuthKey(this._sender.authKey),await this._sender.send(this._initWith(new f.help.GetConfig({}))),this._loopStarted||(this._updateLoop(),this._loopStarted=!0),this._reconnecting=!1):this._loopStarted||(this._updateLoop(),this._loopStarted=!0)}async _initSession(){await this.session.load(),this.session.serverAddress&&this.session.serverAddress.includes(":")===this._useIPV6||this.session.setDC(2,this._useIPV6?"[2001:67c:4e8:f002::a]":"zws2.web.telegram.org",this._args.useWSS?443:80)}async _updateLoop(){for(;!this._destroyed;)if(await d.sleep(3e3),!this._reconnecting){try{await k((()=>{return e=this._sender.send(new f.PingDelayDisconnect({pingId:d.getRandomInt(Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),disconnectDelay:6e4})),5e3,Promise.race([e,d.sleep(5e3).then((()=>Promise.reject(new Error("TIMEOUT"))))]);var e}),3,100)}catch(e){if(console.warn(e),this._reconnecting)continue;await this.disconnect(),await this.connect()}if((new Date).getTime()-this._lastRequest>18e5)try{await this.invoke(new f.updates.GetState)}catch(e){}}await this.disconnect()}async disconnect(){this._sender&&await this._sender.disconnect(),await Promise.all(Object.values(this._exportedSenderPromises).map((e=>e&&e.then((e=>{if(e)return e.disconnect()}))))),this._exportedSenderPromises={}}async destroy(){this._destroyed=!0;try{await this.disconnect()}catch(e){}this.session.delete(),this._eventBuilders=[]}async _switchDC(e){this._log.info(`Reconnecting to new data center ${e}`);const t=l.getDC(e);return this.session.setDC(e,t.ipAddress,t.port),await this._sender.authKey.setKey(void 0),this.session.setAuthKey(void 0),this._reconnecting=!0,await this.disconnect(),this.connect()}_authKeyCallback(e,t){this.session.setAuthKey(e,t)}async _cleanupExportedSender(e){this.session.dcId!==e&&this.session.setAuthKey(void 0,e);const t=await this._exportedSenderPromises[e];this._exportedSenderPromises[e]=void 0,await t.disconnect()}async _connectSender(e,t){const n=l.getDC(t,!!e.authKey.getKey());for(;;)try{if(await e.connect(new this._connection(n.ipAddress,n.port,t,this._log)),this.session.dcId!==t&&!e._authenticated){this._log.info(`Exporting authorization for data center ${n.ipAddress}`);const s=await this.invoke(new f.auth.ExportAuthorization({dcId:t})),a=this._initWith(new f.auth.ImportAuthorization({id:s.id,bytes:s.bytes}));await e.send(a),e._authenticated=!0}return e.dcId=t,e.userDisconnected=!1,e}catch(t){console.error(t),await d.sleep(1e3),await e.disconnect()}}async _borrowExportedSender(e,t,n){if(this._additionalDcsDisabled)return;let s;this._exportedSenderPromises[e]&&!t||(this._exportedSenderPromises[e]=this._connectSender(n||this._createExportedSender(e),e));try{if(s=await this._exportedSenderPromises[e],!s.isConnected())return s.isConnecting?(await d.sleep(1e3),this._borrowExportedSender(e,!1,s)):this._borrowExportedSender(e,!0,s)}catch(t){return console.error(t),this._borrowExportedSender(e,!0)}return this._exportedSenderReleaseTimeouts[e]&&(clearTimeout(this._exportedSenderReleaseTimeouts[e]),this._exportedSenderReleaseTimeouts[e]=void 0),this._exportedSenderReleaseTimeouts[e]=setTimeout((()=>{this._exportedSenderReleaseTimeouts[e]=void 0,s.disconnect()}),3e4),s}_createExportedSender(e){return new h(this.session.getAuthKey(e),{logger:this._log,dcId:e,retries:this._connectionRetries,delay:this._retryDelay,autoReconnect:this._autoReconnect,connectTimeout:this._timeout,authKeyCallback:this._authKeyCallback.bind(this),isMainSender:e===this.session.dcId,onConnectionBreak:this._cleanupExportedSender.bind(this)})}getSender(e){return e?this._borrowExportedSender(e):Promise.resolve(this._sender)}downloadFile(e,t={}){return b(this,e,t)}downloadMedia(e,t){let n;if(n=e instanceof p.Message?e.media:e,"string"==typeof n)throw new Error("not implemented");return n instanceof p.MessageMediaWebPage&&n.webpage instanceof p.WebPage&&(n=n.webpage.document||n.webpage.photo),n instanceof p.MessageMediaPhoto||n instanceof p.Photo?this._downloadPhoto(n,t):n instanceof p.MessageMediaDocument||n instanceof p.Document?this._downloadDocument(n,t):n instanceof p.MessageMediaContact?this._downloadContact(n,t):n instanceof p.WebDocument||n instanceof p.WebDocumentNoProxy?this._downloadWebDocument(n,t):void 0}downloadProfilePhoto(e,t=!1){const n=t?"x":"m";let s,a,i;if([765557111,3316604308,524706233,3566872215].includes(e.SUBCLASS_OF_ID)){if(!e.photo){if(!e.chatPhoto)return;return this._downloadPhoto(e.chatPhoto,{sizeType:n})}s=e.photo}else s=e;if(s instanceof p.UserProfilePhoto||s instanceof p.ChatPhoto)return a=s.dcId,i=new p.InputPeerPhotoFileLocation({peer:l.getInputPeer(e),photoId:s.photoId,big:t}),this.downloadFile(i,{dcId:a})}downloadStickerSetThumb(e){if(!e.thumbs||!e.thumbs.length)return;const{thumbVersion:t}=e;return this.downloadFile(new p.InputStickerSetThumb({stickerset:new p.InputStickerSetID({id:e.id,accessHash:e.accessHash}),thumbVersion:t}),{dcId:e.thumbDcId})}_pickFileSize(e,t){if(!t||!e||!e.length)return;let n;for(let s=P.indexOf(t);se.type===P[s])),n)return n}_downloadCachedPhotoSize(e){let t;return t=e instanceof p.PhotoStrippedSize?l.strippedPhotoToJpg(e.bytes):e.bytes,t}_downloadPhoto(e,t){if(e instanceof p.MessageMediaPhoto&&(e=e.photo),!(e instanceof p.Photo))return;const n=this._pickFileSize(e.sizes,t.sizeType);return!n||n instanceof p.PhotoSizeEmpty?void 0:n instanceof p.PhotoCachedSize||n instanceof p.PhotoStrippedSize?this._downloadCachedPhotoSize(n):this.downloadFile(new p.InputPhotoFileLocation({id:e.id,accessHash:e.accessHash,fileReference:e.fileReference,thumbSize:n.type}),{dcId:e.dcId,fileSize:n.size,progressCallback:t.progressCallback})}_downloadDocument(e,t){if(e instanceof p.MessageMediaDocument&&(e=e.document),!(e instanceof p.Document))return;let n;if(t.sizeType){if(n=e.thumbs?this._pickFileSize(e.thumbs,t.sizeType):void 0,!n&&e.mimeType.startsWith("video/"))return;if(n&&(n instanceof p.PhotoCachedSize||n instanceof p.PhotoStrippedSize))return this._downloadCachedPhotoSize(n)}return this.downloadFile(new p.InputDocumentFileLocation({id:e.id,accessHash:e.accessHash,fileReference:e.fileReference,thumbSize:n?n.type:""}),{fileSize:n?n.size:e.size,progressCallback:t.progressCallback,start:t.start,end:t.end,dcId:e.dcId,workers:t.workers})}_downloadContact(e,t){throw new Error("not implemented")}async _downloadWebDocument(e){try{const t=[];let n=0;for(;;){const s=new f.upload.GetWebFile({location:new p.InputWebFileLocation({url:e.url,accessHash:e.accessHash}),offset:n,limit:C}),a=await this._borrowExportedSender(4),i=await a.send(s);if(n+=131072,!i.bytes.length)break;if(t.push(i.bytes),i.bytes.length{"use strict";n.r(t),n.d(t,{authFlow:()=>l,checkAuthorization:()=>u});var s=n(7150),a=n.n(s),i=n(8960),r=n.n(i),o=n(9618),c=n(9674);const d="phoneNumber";async function l(e,t,n){let s;if("botAuthToken"in n)s=await async function(e,t,n){const{apiId:s,apiHash:i}=t,{botAuthToken:r}=n,{user:o}=await e.invoke(new(a().auth.ImportBotAuthorization)({apiId:s,apiHash:i,botAuthToken:r}));return o}(e,t,n);else{const{initialMethod:a=d}=n;s="phoneNumber"===a?await g(e,t,n):await p(e,t,n)}e._log.info("Signed in successfully as",r().getDisplayName(s))}async function u(e){try{return await e.invoke(new(a().updates.GetState)),!0}catch(e){if("Disconnect"===e.message)throw e;return!1}}async function g(e,t,n){let s,i,r,o=!1;for(;;)try{if("function"==typeof n.phoneNumber)try{s=await n.phoneNumber()}catch(s){if("RESTART_AUTH_WITH_QR"===s.message)return p(e,t,n);throw s}else s=n.phoneNumber;const a=await f(e,t,s,n.forceSMS);if(i=a.phoneCodeHash,o=a.isCodeViaApp,"string"!=typeof i)throw new Error("Failed to retrieve phone code hash");break}catch(e){if("function"!=typeof n.phoneNumber)throw e;n.onError(e)}let c,d=!1;for(;;)try{try{r=await n.phoneCode(o)}catch(s){if("RESTART_AUTH"===s.message)return g(e,t,n)}if(!r)throw new Error("Code is empty");const l=await e.invoke(new(a().auth.SignIn)({phoneNumber:s,phoneCodeHash:i,phoneCode:r}));if(l instanceof a().auth.AuthorizationSignUpRequired){d=!0,c=l.termsOfService;break}return l.user}catch(t){if("SESSION_PASSWORD_NEEDED"===t.message)return h(e,0,n);n.onError(t)}if(d)for(;;)try{const[t,r]=await n.firstAndLastNames();if(!t)throw new Error("First name is required");const{user:o}=await e.invoke(new(a().auth.SignUp)({phoneNumber:s,phoneCodeHash:i,firstName:t,lastName:r}));return c&&await e.invoke(new(a().help.AcceptTermsOfService)({id:c.id})),o}catch(e){n.onError(e)}return n.onError(new Error("Auth failed")),g(e,t,n)}async function p(e,t,n){let s=!1;const i=(async()=>{for(;!s;){const t=await e.invoke(new(a().auth.ExportLoginToken)({apiId:Number("2496"),apiHash:"8da85b0d5bfe62527e5b244c209159c3",exceptIds:[]}));if(!(t instanceof a().auth.LoginToken))throw new Error("Unexpected");const{token:s,expires:i}=t;await Promise.race([n.qrCode({token:s,expires:i}),(0,o.sleep)(3e4)])}})(),r=new Promise((t=>{e.addEventHandler((e=>{e instanceof a().UpdateLoginToken&&t()}),{build:e=>e})}));try{await Promise.race([r,i])}catch(s){if("RESTART_AUTH"===s.message)return await g(e,t,n);throw s}finally{s=!0}try{const t=await e.invoke(new(a().auth.ExportLoginToken)({apiId:Number("2496"),apiHash:"8da85b0d5bfe62527e5b244c209159c3",exceptIds:[]}));if(t instanceof a().auth.LoginTokenSuccess&&t.authorization instanceof a().auth.Authorization)return t.authorization.user;if(t instanceof a().auth.LoginTokenMigrateTo){await e._switchDC(t.dcId);const n=await e.invoke(new(a().auth.ImportLoginToken)({token:t.token}));if(n instanceof a().auth.LoginTokenSuccess&&n.authorization instanceof a().auth.Authorization)return n.authorization.user}}catch(t){if("SESSION_PASSWORD_NEEDED"===t.message)return h(e,0,n);throw t}throw void 0}async function f(e,t,n,s=!1){try{const{apiId:i,apiHash:r}=t,o=await e.invoke(new(a().auth.SendCode)({phoneNumber:n,apiId:i,apiHash:r,settings:new(a().CodeSettings)}));if(!s||o.type instanceof a().auth.SentCodeTypeSms)return{phoneCodeHash:o.phoneCodeHash,isCodeViaApp:o.type instanceof a().auth.SentCodeTypeApp};const c=await e.invoke(new(a().auth.ResendCode)({phoneNumber:n,phoneCodeHash:o.phoneCodeHash}));return{phoneCodeHash:c.phoneCodeHash,isCodeViaApp:c.type instanceof a().auth.SentCodeTypeApp}}catch(a){if("AUTH_RESTART"===a.message)return f(e,t,n,s);throw a}}async function h(e,t,n){for(;;)try{const t=await e.invoke(new(a().account.GetPassword)),s=await n.password(t.hint);if(!s)throw new Error("Password is empty");const i=await(0,c.computeCheck)(t,s),{user:r}=await e.invoke(new(a().auth.CheckPassword)({password:i}));return r}catch(e){n.onError(e)}}},2288:(e,t,n)=>{"use strict";n.r(t),n.d(t,{downloadFile:()=>p});var s=n(7150),a=n.n(s),i=n(8960),r=n(9618),o=n(7873),c=n.n(o),d=n(8764).Buffer;function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=1048576;class g{constructor(e){this.maxWorkers=e,l(this,"deferred",void 0),l(this,"activeWorkers",0)}requestWorker(){return this.activeWorkers++,this.activeWorkers>this.maxWorkers?(this.deferred=(0,r.createDeferred)(),this.deferred.promise):Promise.resolve()}releaseWorker(){this.activeWorkers--,this.deferred&&this.activeWorkers<=this.maxWorkers&&this.deferred.resolve()}}async function p(e,t,n){let{partSizeKb:s,end:o}=n;const{fileSize:l,workers:p=1}=n,{dcId:f,progressCallback:h,start:m=0}=n;o=o&&o{for(;;){let d;try{d=await e.getSender(f);const r=await d.send(new(a().upload.GetFile)({location:t,offset:i,limit:n,precise:s||void 0}));if(h){if(h.isCanceled)throw new Error("USER_CANCELED");P+=1/y,h(P)}return!o&&r.bytes.lengtho)break}const v=(await Promise.all(w)).filter(Boolean),A=o?o+1-m:void 0;return d.concat(v,A)}},4766:(e,t,n)=>{"use strict";n.r(t),n.d(t,{uploadFile:()=>l});var s=n(7150),a=n.n(s),i=n(9618),r=n(8960),o=n(7873),c=n.n(o),d=n(8764).Buffer;async function l(e,t){const{file:n,onProgress:s}=t;let{workers:o}=t;const{name:l,size:u}=n,g=(0,i.readBigIntFromBuffer)((0,i.generateRandomBytes)(8),!0,!0),p=u>10485760,f=1024*(0,r.getAppropriatedPartSize)(u),h=Math.floor((u+f-1)/f),m=d.from(await function(e){return new Response(e).arrayBuffer()}(n));await e.getSender(e.session.dcId),o&&u||(o=1),o>=h&&(o=h);let _=0;s&&s(_);for(let t=0;th&&(r=h);for(let o=t;o{for(;;){let r;try{r=await e.getSender(e.session.dcId),await r.send(p?new(a().upload.SaveBigFilePart)({fileId:g,filePart:t,fileTotalParts:h,bytes:n}):new(a().upload.SaveFilePart)({fileId:g,filePart:t,bytes:n}))}catch(e){if(r&&!r.isConnected()){await(0,i.sleep)(1e3);continue}if(e instanceof c().FloodWaitError){await(0,i.sleep)(1e3*e.seconds);continue}throw e}if(s){if(s.isCanceled)throw new Error("USER_CANCELED");_+=1/h,s(_)}break}})(o,t))}await Promise.all(n)}return p?new(a().InputFileBig)({id:g,parts:h,name:l}):new(a().InputFile)({id:g,parts:h,name:l,md5Checksum:""})}},3302:(e,t,n)=>{var s=n(8764).Buffer;const{sha1:a,toSignedLittleBuffer:i,readBufferFromBigInt:r,readBigIntFromBuffer:o}=n(9618),c=n(5544),{sleep:d}=n(9618);class l{constructor(e,t){if(!t||!e)return;this._key=e,this._hash=t;const n=new c(t);this.auxHash=n.readLong(!1),n.read(4),this.keyId=n.readLong(!1)}async setKey(e){if(!e)return this._key=void 0,this.auxHash=void 0,this.keyId=void 0,void(this._hash=void 0);if(e instanceof l)return this._key=e._key,this.auxHash=e.auxHash,this.keyId=e.keyId,void(this._hash=e._hash);this._key=e,this._hash=await a(this._key);const t=new c(this._hash);this.auxHash=t.readLong(!1),t.read(4),this.keyId=t.readLong(!1)}async waitForKey(){for(;!this.keyId;)await d(20)}getKey(){return this._key}async calcNewNonceHash(e,t){e=i(e,32);const n=s.alloc(1);n.writeUInt8(t,0);const c=s.concat([e,s.concat([n,r(this.auxHash,8,!0)])]),d=(await a(c)).slice(4,20);return o(d,!0,!0)}equals(e){return e instanceof this.constructor&&this._key&&e.getKey()&&e.getKey().equals(this._key)}}e.exports=l},5830:(e,t,n)=>{var s=n(8764).Buffer;const a=n(6842);e.exports=class{constructor(e,t){if(!s.isBuffer(e)||!s.isBuffer(t)||16!==t.length)throw new Error("Key and iv need to be a buffer");this.cipher=a.createCipheriv("AES-256-CTR",e,t)}encrypt(e){return s.from(this.cipher.update(e))}}},9636:(e,t,n)=>{const s=n(4736),{modExp:a}=n(9618);class i{static gcd(e,t){for(;t.neq(s.zero);){const n=t;t=e.remainder(t),e=n}return e}static factorize(e){if(e.remainder(2).equals(s.zero))return{p:s(2),q:e.divide(s(2))};let t=s.randBetween(s(1),e.minus(1));const n=s.randBetween(s(1),e.minus(1)),r=s.randBetween(s(1),e.minus(1));let o,c=s.one,d=s.one,l=s.one,u=s.zero,g=s.zero;for(;c.eq(s.one);){u=t;for(let i=0;s(i).lesser(d);i++)t=a(t,s(2),e).add(n).remainder(e);for(o=s.zero;o.lesser(d)&&c.eq(s.one);){g=t;const p=s.min(r,d.minus(o));for(let i=0;s(i).lesser(p);i++)t=a(t,s(2),e).add(n).remainder(e),l=l.multiply(u.minus(t).abs()).remainder(e);c=i.gcd(l,e),o=o.add(r)}d=d.multiply(2)}if(c.eq(e))for(;g=a(g,s(2),e).add(n).remainder(e),c=i.gcd(u.minus(g).abs(),e),!c.greater(1););const p=c;return l=e.divide(c),p{var s=n(8764).Buffer;const{IGE:a}=n(8136),i=n(9618);e.exports=class{constructor(e,t){this.ige=new a(e,t)}decryptIge(e){return i.convertToLittle(this.ige.decrypt(e))}encryptIge(e){const t=e.length%16;return t&&(e=s.concat([e,i.generateRandomBytes(16-t)])),i.convertToLittle(this.ige.encrypt(e))}}},4121:(e,t,n)=>{"use strict";function s(e){const t=new Uint8Array(4*e.length);let n=0;for(let s=0;s>>24,t[n++]=a>>16&255,t[n++]=a>>8&255,t[n++]=255&a}return t.buffer}function a(e){return e.buffer}function i(e){const t=new Uint8Array(e),n=new Uint32Array(t.length/4);for(let e=0;es,i2abBig:()=>a,ab2iLow:()=>i,ab2iBig:()=>r,isBigEndian:()=>o,i2ab:()=>c,ab2i:()=>d});const o=1===new Uint8Array(new Uint32Array([16909060]))[0],c=o?a:s,d=o?r:i},6842:(e,t,n)=>{var s=n(8764).Buffer;const a=n(8136).default,{i2ab:i,ab2i:r}=n(4121),{getWords:o}=n(7760);class c{constructor(e){this.setBytes(e)}setBytes(e){e=s.from(e),this._counter=e}increment(){for(let e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}}}class d{constructor(e,t){t instanceof c||(t=new c(t)),this._counter=t,this._remainingCounter=void 0,this._remainingCounterIndex=16,this._aes=new a(o(e))}update(e){return this.encrypt(e)}encrypt(e){const t=s.from(e);for(let e=0;e{"use strict";function s(e,t){return e.charCodeAt(t)<<24^e.charCodeAt(t+1)<<16^e.charCodeAt(t+2)<<8^e.charCodeAt(t+3)}function a(e){if(e instanceof Uint32Array)return e;if("string"==typeof e){if(e.length%4!=0)for(let t=e.length%4;t<=4;t++)e+="\0x00";const t=new Uint32Array(e.length/4);for(let n=0;ns,getWords:()=>a,xor:()=>i})},8187:e=>{class t extends Error{constructor(){super("The read operation was cancelled.")}}class n extends Error{constructor(e,t){super(`Could not find a matching Constructor ID for the TLObject that was supposed to be\n read with ID ${e}. Most likely, a TLObject was trying to be read when\n it should not be read. Remaining bytes: ${t.length}`),"undefined"!=typeof alert&&alert(`Missing MTProto Entity: Please, make sure to add TL definition for ID ${e}`),this.invalidConstructorId=e,this.remaining=t}}class s extends Error{constructor(e,t){super(`Invalid checksum (${e} when ${t} was expected). This packet should be skipped.`),this.checksum=e,this.validChecksum=t}}class a extends Error{constructor(e){let t;4===e.length?(t=-e.readInt32LE(0),super(`Invalid response buffer (HTTP code ${t})`)):super(`Invalid response buffer (too short ${e})`),this.code=t,this.payload=e}}class i extends Error{constructor(...e){e.length||(e=["A security check failed."]),super(...e)}}class r extends Error{constructor(e,t){let n=r.ErrorMessages[t]||`Unknown error code (this should not happen): ${t}.`;n+=` Caused by ${e.className}`,super(n),this.message=n,this.code=t}}var o,c,d;d={16:"msg_id too low (most likely, client time is wrong it would be worthwhile to synchronize it using msg_id notifications and re-send the original message with the “correct” msg_id or wrap it in a container with a new msg_id if the original message had waited too long on the client to be transmitted).",17:"msg_id too high (similar to the previous case, the client time has to be synchronized, and the message re-sent with the correct msg_id).",18:"Incorrect two lower order msg_id bits (the server expects client message msg_id to be divisible by 4).",19:"Container msg_id is the same as msg_id of a previously received message (this must never happen).",20:"Message too old, and it cannot be verified whether the server has received a message with this msg_id or not.",32:"msg_seqno too low (the server has already received a message with a lower msg_id but with either a higher or an equal and odd seqno).",33:"msg_seqno too high (similarly, there is a message with a higher msg_id but with either a lower or an equal and odd seqno).",34:"An even msg_seqno expected (irrelevant message), but odd received.",35:"Odd msg_seqno expected (relevant message), but even received.",48:"Incorrect server salt (in this case, the bad_server_salt response is received with the correct salt, and the message is to be re-sent with it).",64:"Invalid container."},(c="ErrorMessages")in(o=r)?Object.defineProperty(o,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):o[c]=d,e.exports={ReadCancelledError:t,TypeNotFoundError:n,InvalidChecksumError:s,InvalidBufferError:a,SecurityError:i,CdnFileTamperedError:class extends i{constructor(){super("The CDN file has been altered and its download cancelled.")}},BadMessageError:r}},6952:e=>{function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class n extends Error{constructor(e,t,s){super("RPCError {0}: {1}{2}".replace("{0}",s).replace("{1}",e).replace("{2}",n._fmtRequest(t))),this.code=s,this.message=e}static _fmtRequest(e){return e?` (caused by ${e.className})`:""}}e.exports={RPCError:n,InvalidDCError:class extends n{constructor(e,t,n){super(t,e,n),this.code=n||303,this.message=t||"ERROR_SEE_OTHER"}},BadRequestError:class extends n{constructor(...e){super(...e),t(this,"code",400),t(this,"message","BAD_REQUEST")}},UnauthorizedError:class extends n{constructor(...e){super(...e),t(this,"code",401),t(this,"message","UNAUTHORIZED")}},ForbiddenError:class extends n{constructor(...e){super(...e),t(this,"code",403),t(this,"message","FORBIDDEN")}},NotFoundError:class extends n{constructor(...e){super(...e),t(this,"code",404),t(this,"message","NOT_FOUND")}},AuthKeyError:class extends n{constructor(...e){super(...e),t(this,"code",406),t(this,"message","AUTH_KEY")}},FloodError:class extends n{constructor(...e){super(...e),t(this,"code",420),t(this,"message","FLOOD")}},ServerError:class extends n{constructor(...e){super(...e),t(this,"code",500),t(this,"message","INTERNAL")}},TimedOutError:class extends n{constructor(...e){super(...e),t(this,"code",503),t(this,"message","Timeout")}}}},5651:(e,t,n)=>{const{RPCError:s,InvalidDCError:a,FloodError:i,BadRequestError:r}=n(6952);class o extends a{constructor(e){const t=Number(e.capture||0);super(`The user whose identity is being used to execute queries is associated with DC ${t}${s._fmtRequest(e.request)}`),this.message=`The user whose identity is being used to execute queries is associated with DC ${t}${s._fmtRequest(e.request)}`,this.newDc=t}}class c extends a{constructor(e){const t=Number(e.capture||0);super(`The phone number a user is trying to use for authorization is associated with DC ${t}${s._fmtRequest(e.request)}`),this.message=`The phone number a user is trying to use for authorization is associated with DC ${t}${s._fmtRequest(e.request)}`,this.newDc=t}}class d extends i{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required before sending another message in this chat${s._fmtRequest(e.request)}`),this.message=`A wait of ${t} seconds is required before sending another message in this chat${s._fmtRequest(e.request)}`,this.seconds=t}}class l extends i{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required${s._fmtRequest(e.request)}`),this.message=`A wait of ${t} seconds is required${s._fmtRequest(e.request)}`,this.seconds=t}}class u extends i{constructor(e){super(`Message failed to be sent.${s._fmtRequest(e.request)}`),this.message=`Message failed to be sent.${s._fmtRequest(e.request)}`}}class g extends i{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required in the test servers${s._fmtRequest(e.request)}`),this.message=`A wait of ${t} seconds is required in the test servers${s._fmtRequest(e.request)}`,this.seconds=t}}class p extends a{constructor(e){const t=Number(e.capture||0);super(`The file to be accessed is currently stored in DC ${t}${s._fmtRequest(e.request)}`),this.message=`The file to be accessed is currently stored in DC ${t}${s._fmtRequest(e.request)}`,this.newDc=t}}class f extends a{constructor(e){const t=Number(e.capture||0);super(`The source IP address is associated with DC ${t}${s._fmtRequest(e.request)}`),this.message=`The source IP address is associated with DC ${t}${s._fmtRequest(e.request)}`,this.newDc=t}}class h extends r{constructor(e){const t=Number(e.capture||0);super(`Email unconfirmed, the length of the code must be ${t}${s._fmtRequest(e.request)}`),this.message=`Email unconfirmed, the length of the code must be ${t}${s._fmtRequest(e.request)}`,this.codeLength=t}}const m=[[/FILE_MIGRATE_(\d+)/,p],[/FLOOD_TEST_PHONE_WAIT_(\d+)/,g],[/FLOOD_WAIT_(\d+)/,l],[/MSG_WAIT_(.*)/,u],[/PHONE_MIGRATE_(\d+)/,c],[/SLOWMODE_WAIT_(\d+)/,d],[/USER_MIGRATE_(\d+)/,o],[/NETWORK_MIGRATE_(\d+)/,f],[/EMAIL_UNCONFIRMED_(\d+)/,h]];e.exports={rpcErrorRe:m,FileMigrateError:p,FloodTestPhoneWaitError:g,FloodWaitError:l,PhoneMigrateError:c,SlowModeWaitError:d,UserMigrateError:o,NetworkMigrateError:f,MsgWaitError:u,EmailUnconfirmedError:h}},7873:(e,t,n)=>{const{RPCError:s}=n(6952),{rpcErrorRe:a}=n(5651),i=n(8187),r=n(6952),o=n(5651);e.exports={RPCMessageToError:function(e,t){for(const[n,s]of a){const a=e.errorMessage.match(n);if(a)return new s({request:t,capture:2===a.length?parseInt(a[1],10):void 0})}return new s(e.errorMessage,t)},...i,...r,...o}},6316:()=>{},3903:(e,t,n)=>{const{EventBuilder:s}=n(6172);e.exports=class extends s{constructor(e={types:void 0,func:void 0}){super(),e.types?this.types=e.types:this.types=!0}build(e){return e}}},6172:e=>{e.exports={EventBuilder:class{constructor(e={chats:void 0,blacklistChats:void 0,func:void 0}){this.chats=e.chats,this.blacklistChats=Boolean(e.blacklistChats),this.resolved=!1,this.func=e.func}build(e){}}}},3182:(e,t,n)=>{const s=n(6316),a=n(3903);class i extends Error{}e.exports={NewMessage:s,StopPropagation:i,Raw:a}},6151:e=>{e.exports=class{constructor(){this._queue=[],this.canGet=new Promise((e=>{this.resolveGet=e})),this.canPush=!0}async push(e){await this.canPush,this._queue.push(e),this.resolveGet(!0),this.canPush=new Promise((e=>{this.resolvePush=e}))}async pop(){await this.canGet;const e=this._queue.pop();return this.resolvePush(!0),this.canGet=new Promise((e=>{this.resolveGet=e})),e}}},5544:(e,t,n)=>{const{TypeNotFoundError:s}=n(8187),{coreObjects:a}=n(2058),{tlobjects:i}=n(845),{readBigIntFromBuffer:r}=n(9618);e.exports=class{constructor(e){this.stream=e,this._last=void 0,this.offset=0}readByte(){return this.read(1)[0]}readInt(e=!0){let t;return t=e?this.stream.readInt32LE(this.offset):this.stream.readUInt32LE(this.offset),this.offset+=4,t}readLong(e=!0){return this.readLargeInt(64,e)}readFloat(){return this.read(4).readFloatLE(0)}readDouble(){return this.read(8).readDoubleLE(0)}readLargeInt(e,t=!0){const n=this.read(Math.floor(e/8));return r(n,!0,t)}read(e=-1){-1===e&&(e=this.stream.length-this.offset);const t=this.stream.slice(this.offset,this.offset+e);if(this.offset+=e,t.length!==e)throw Error(`No more data left to read (need ${e}, got ${t.length}: ${t}); last read ${this._last}`);return this._last=t,t}getBuffer(){return this.stream}tgReadBytes(){const e=this.readByte();let t,n;254===e?(n=this.readByte()|this.readByte()<<8|this.readByte()<<16,t=n%4):(n=e,t=(n+1)%4);const s=this.read(n);return t>0&&(t=4-t,this.read(t)),s}tgReadString(){return this.tgReadBytes().toString("utf-8")}tgReadBool(){const e=this.readInt(!1);if(2574415285===e)return!0;if(3162085175===e)return!1;throw new Error(`Invalid boolean code ${e.toString("16")}`)}tgReadDate(){const e=this.readInt();return new Date(1e3*e)}tgReadObject(){const e=this.readInt(!1);let t=i[e];if(void 0===t){if(2574415285===e)return!0;if(3162085175===e)return!1;if(481674261===e){const e=[],t=this.readInt();for(let n=0;n{var s=n(8764).Buffer;e.exports=class{constructor(e){this._stream=e}write(e){this._stream=s.concat([this._stream,e])}getValue(){return this._stream}}},6748:e=>{let t;class n{constructor(e){t||(t=e||"debug"),this.isBrowser="undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs,this.isBrowser?this.colors={start:"%c",warn:"color : #ff00ff",info:"color : #ffff00",debug:"color : #00ffff",error:"color : #ff0000",end:""}:this.colors={start:"",warn:"",info:"",debug:"",error:"",end:""},this.messageFormat="[%t] [%l] - [%m]"}static setLevel(e){t=e}canSend(e){return n.levels.indexOf(t)>=n.levels.indexOf(e)}warn(e){"debug"===t&&console.error((new Error).stack),this._log("warn",e,this.colors.warn)}info(e){this._log("info",e,this.colors.info)}debug(e){this._log("debug",e,this.colors.debug)}error(e){"debug"===t&&console.error((new Error).stack),this._log("error",e,this.colors.error)}format(e,t){return this.messageFormat.replace("%t",(new Date).toISOString()).replace("%l",t.toUpperCase()).replace("%m",e)}_log(e,n,s){t&&this.canSend(e)&&(this.isBrowser?console.log(this.colors.start+this.format(n,e),s):console.log(s+this.format(n,e)+this.colors.end))}}var s,a,i;i=["error","warn","info","debug"],(a="levels")in(s=n)?Object.defineProperty(s,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):s[a]=i,e.exports=n},6411:(e,t,n)=>{var s=n(8764).Buffer;const a=n(3254),i=n(355),r=n(6472),o=["messages.SendMessage","messages.SendMedia","messages.SendMultiMedia","messages.ForwardMessages","messages.SendInlineBotResult"];e.exports=class{constructor(e,t){this._state=e,this._queue=[],this._pendingStates=[],this._ready=new Promise((e=>{this.setReady=e})),this._log=t}values(){return this._queue}append(e){if(e&&o.includes(e.request.className))for(let t=this._queue.length-1;t>=0;t--)if(o.includes(this._queue[t].request.className)){e.after=this._queue[t];break}this._queue.push(e),this.setReady(!0),e&&(this._pendingStates.push(e),e.promise.catch((()=>{})).finally((()=>{this._pendingStates=this._pendingStates.filter((t=>t!==e))})))}extend(e){for(const t of e)this._queue.push(t);this.setReady(!0)}async get(){if(this._queue.length||(this._ready=new Promise((e=>{this.setReady=e})),await this._ready),!this._queue[this._queue.length-1])return void(this._queue=[]);let e,t=new r(s.alloc(0));const n=[];let o=0;for(;this._queue.length&&n.length<=a.MAXIMUM_LENGTH;){const e=this._queue.shift();if(o+=e.data.length+i.SIZE_OVERHEAD,o<=a.MAXIMUM_SIZE){let s;e.after&&(s=e.after.msgId),e.msgId=await this._state.writeDataAsMessage(t,e.data,"request"===e.request.classType,s),this._log.debug(`Assigned msgId = ${e.msgId} to ${e.request.className||e.request.constructor.name}`),n.push(e)}else{if(n.length){this._queue.unshift(e);break}this._log.warn(`Message payload for ${e.request.className||e.request.constructor.name} is too long ${e.data.length} and cannot be sent`),e.reject("Request Payload is too big"),o=0}}if(n.length){if(n.length>1){const i=s.alloc(8);i.writeUInt32LE(a.CONSTRUCTOR_ID,0),i.writeInt32LE(n.length,4),e=s.concat([i,t.getValue()]),t=new r(s.alloc(0));const o=await this._state.writeDataAsMessage(t,e,!1);for(const e of n)e.containerId=o}return e=t.getValue(),{batch:n,data:e}}}rejectAll(){this._pendingStates.forEach((e=>{e.reject(new Error("Disconnect"))}))}}},7214:(e,t,n)=>{var s=n(8764).Buffer;const{Mutex:a}=n(8125),i=new a,r=n(5840).w3cwebsocket,o=new Error("WebSocket was closed");e.exports=class{constructor(e){this.client=void 0,this.closed=!0,this.disconnectedCallback=e}async readExactly(e){let t=s.alloc(0);for(;;){const n=await this.read(e);if(t=s.concat([t,n]),!(e-=n.length))return t}}async read(e){if(this.closed)throw o;if(await this.canRead,this.closed)throw o;const t=this.stream.slice(0,e);return this.stream=this.stream.slice(e),0===this.stream.length&&(this.canRead=new Promise((e=>{this.resolveRead=e}))),t}async readAll(){if(this.closed||!await this.canRead)throw o;const e=this.stream;return this.stream=s.alloc(0),this.canRead=new Promise((e=>{this.resolveRead=e})),e}getWebSocketLink(e,t){return 443===t?`wss://${e}:${t}/apiws`:`ws://${e}:${t}/apiws`}connect(e,t){return this.stream=s.alloc(0),this.canRead=new Promise((e=>{this.resolveRead=e})),this.closed=!1,this.website=this.getWebSocketLink(t,e),this.client=new r(this.website,"binary"),new Promise(((e,n)=>{this.client.onopen=()=>{this.receive(),e(this)},this.client.onerror=e=>{console.error("WebSocket error",e),n(e)},this.client.onclose=e=>{const{code:n,reason:s,wasClean:a}=e;1e3!==n&&console.error(`Socket ${t} closed. Code: ${n}, reason: ${s}, was clean: ${a}`),this.resolveRead(!1),this.closed=!0,this.disconnectedCallback&&this.disconnectedCallback()},self.addEventListener("offline",(async()=>{await this.close(),this.resolveRead(!1)}))}))}write(e){if(this.closed)throw o;this.client.send(e)}async close(){await this.client.close(),this.closed=!0}receive(){this.client.onmessage=async e=>{const t=await i.acquire();try{const n=e.data instanceof ArrayBuffer?s.from(e.data):s.from(await new Response(e.data).arrayBuffer());this.stream=s.concat([this.stream,n]),this.resolveRead(!0)}finally{t()}}}}},9832:(e,t,n)=>{const s=n(6748),a=n(6472),i=n(5544),r=n(7214),o=n(6411),c=n(6151);e.exports={BinaryWriter:a,BinaryReader:i,MessagePacker:o,AsyncQueue:c,Logger:s,PromisedWebSockets:r}},3522:(e,t,n)=>{const s=n(7150),a=n(8742),i=n(8415),r=n(7404),o=n(1472),c=n(3182),d=n(8960),l=n(7873),u=n(5886),g=n(9832),p=n(9618);e.exports={Api:s,TelegramClient:a,sessions:u,connection:i,extensions:g,tl:r,version:o,events:c,utils:d,errors:l,helpers:p}},9870:(e,t,n)=>{"use strict";n.r(t),n.d(t,{doAuthentication:()=>_});var s=n(7150),a=n.n(s),i=n(7873),r=n(4736),o=n.n(r);n(9618),n(8764).Buffer;const c=[{fingerprint:o()("-3414540481677951611"),n:o()("29379598170669337022986177149456128565388431120058863768162556424047512191330847455146576344487764408661701890505066208632169112269581063774293102577308490531282748465986139880977280302242772832972539403531316010870401287642763009136156734339538042419388722777357134487746169093539093850251243897188928735903389451772730245253062963384108812842079887538976360465290946139638691491496062099570836476454855996319192747663615955633778034897140982517446405334423701359108810182097749467210509584293428076654573384828809574217079944388301239431309115013843331317877374435868468779972014486325557807783825502498215169806323"),e:65537}],d=new Map;c.forEach((({fingerprint:e,...t})=>{d.set(e.toString(),t)}));var l=n(8764).Buffer;const u=n(4736),g=n(2608),p=n(3302),f=n(9636),h=n(9618),m=n(5544);async function _(e,t){let n=h.generateRandomBytes(16);const s=h.readBigIntFromBuffer(n,!1,!0),r=await e.send(new(a().ReqPqMulti)({nonce:s}));if(t.debug("Starting authKey generation step 1"),!(r instanceof a().ResPQ))throw new i.SecurityError(`Step 1 answer was ${r}`);if(r.nonce.neq(s))throw new i.SecurityError("Step 1 invalid nonce from server");const o=h.readBigIntFromBuffer(r.pq,!1,!0);t.debug("Finished authKey generation step 1");const{p:c,q:_}=f.factorize(o),y=h.getByteArray(c),b=h.getByteArray(_);n=h.generateRandomBytes(32);const w=h.readBigIntFromBuffer(n,!0,!0),I=new(a().PQInnerData)({pq:h.getByteArray(o),p:y,q:b,nonce:r.nonce,serverNonce:r.serverNonce,newNonce:w}).getBytes();if(I.length>144)throw new i.SecurityError("Step 1 invalid nonce from server");let C,P;for(const e of r.serverPublicKeyFingerprints)if(P=d.get(e.toString()),void 0!==P){C=e;break}if(void 0===C||void 0===P)throw new i.SecurityError("Step 2 could not find a valid key for fingerprints");const v=h.generateRandomBytes(192-I.length),A=l.concat([I,v]),S=l.from(A).reverse();let M;for(let e=0;e<20;e++){const e=h.generateRandomBytes(32),n=await h.sha256(l.concat([e,A])),s=l.concat([S,n]),a=new g(e,l.alloc(32)).encryptIge(s),i=h.bufferXor(e,await h.sha256(a)),r=l.concat([i,a]),o=h.readBigIntFromBuffer(r,!1,!1);if(o.greaterOrEquals(P.n)){t.debug("Aes key greater than RSA. retrying");continue}const c=h.modExp(o,u(P.e),P.n);M=h.readBufferFromBigInt(c,256,!1,!1);break}if(void 0===M)throw new i.SecurityError("Step 2 could create a secure encrypted key");t.debug("Step 2 : Generated a secure aes encrypted data");const k=await e.send(new(a().ReqDHParams)({nonce:r.nonce,serverNonce:r.serverNonce,p:y,q:b,publicKeyFingerprint:C,encryptedData:M}));if(!(k instanceof a().ServerDHParamsOk||k instanceof a().ServerDHParamsFail))throw new Error(`Step 2.1 answer was ${k}`);if(k.nonce.neq(r.nonce))throw new i.SecurityError("Step 2 invalid nonce from server");if(k.serverNonce.neq(r.serverNonce))throw new i.SecurityError("Step 2 invalid server nonce from server");if(k instanceof a().ServerDHParamsFail){const e=await h.sha1(h.toSignedLittleBuffer(w,32).slice(4,20)),t=h.readBigIntFromBuffer(e,!0,!0);if(k.newNonceHash.neq(t))throw new i.SecurityError("Step 2 invalid DH fail nonce from server")}if(!(k instanceof a().ServerDHParamsOk))throw new Error(`Step 2.2 answer was ${k}`);t.debug("Finished authKey generation step 2"),t.debug("Starting authKey generation step 3");const{key:R,iv:U}=await h.generateKeyDataFromNonce(r.serverNonce,w);if(k.encryptedAnswer.length%16!=0)throw new i.SecurityError("Step 3 AES block size mismatch");const E=new g(R,U),D=E.decryptIge(k.encryptedAnswer),T=new m(D);T.read(20);const B=T.tgReadObject();if(!(B instanceof a().ServerDHInnerData))throw new Error(`Step 3 answer was ${B}`);if(B.nonce.neq(r.nonce))throw new i.SecurityError("Step 3 Invalid nonce in encrypted answer");if(B.serverNonce.neq(r.serverNonce))throw new i.SecurityError("Step 3 Invalid server nonce in encrypted answer");const x=h.readBigIntFromBuffer(B.dhPrime,!1,!1),V=h.readBigIntFromBuffer(B.gA,!1,!1),F=B.serverTime-Math.floor((new Date).getTime()/1e3),N=h.readBigIntFromBuffer(h.generateRandomBytes(256),!1,!1),O=h.modExp(u(B.g),N,x),L=h.modExp(V,N,x),q=new(a().ClientDHInnerData)({nonce:r.nonce,serverNonce:r.serverNonce,retryId:u.zero,gB:h.getByteArray(O,!1)}).getBytes(),H=l.concat([await h.sha1(q),q]),G=E.encryptIge(H),K=await e.send(new(a().SetClientDHParams)({nonce:r.nonce,serverNonce:r.serverNonce,encryptedData:G})),z=[a().DhGenOk,a().DhGenRetry,a().DhGenFail];if(!(K instanceof z[0]||K instanceof z[1]||K instanceof z[2]))throw new Error(`Step 3.1 answer was ${K}`);const{name:W}=K.constructor;if(K.nonce.neq(r.nonce))throw new i.SecurityError(`Step 3 invalid ${W} nonce from server`);if(K.serverNonce.neq(r.serverNonce))throw new i.SecurityError(`Step 3 invalid ${W} server nonce from server`);const j=new p;await j.setKey(h.getByteArray(L));const $=1+["DhGenOk","DhGenRetry","DhGenFail"].indexOf(K.className),J=await j.calcNewNonceHash(w,$);if(K[`newNonceHash${$}`].neq(J))throw new i.SecurityError("Step 3 invalid new nonce hash");if(!(K instanceof a().DhGenOk))throw new Error(`Step 3.2 answer was ${K}`);return t.debug("Finished authKey generation step 3"),{authKey:j,timeOffset:F}}},5585:(e,t,n)=>{var s=n(8764).Buffer;const a=n(4736),i=n(9109),r=n(5544),{InvalidBufferError:o}=n(8187),{toSignedLittleBuffer:c}=n(9618);e.exports=class{constructor(e,t){this._state=new i(e,t),this._connection=e}async send(e){let t=e.getBytes(),n=this._state._getNewMsgId();const i=c(n,8),d=s.alloc(4);d.writeInt32LE(t.length,0);const l=s.concat([s.concat([s.alloc(8),i,d]),t]);if(await this._connection.send(l),t=await this._connection.recv(),t.length<8)throw new o(t);const u=new r(t);if(u.readLong().neq(a(0)))throw new Error("Bad authKeyId");if(n=u.readLong(),n.eq(a(0)))throw new Error("Bad msgId");if(u.readInt()<=0)throw new Error("Bad length");return u.tgReadObject()}}},4046:(e,t,n)=>{const s=n(5585),a=n(9109),i=n(9618),r=n(3302),{doAuthentication:o}=n(9870),c=n(2301),d=n(3254),l=n(8963),u=n(4287),{MsgsAck:g,upload:p,MsgsStateInfo:f,Pong:h}=n(7404).constructors,m=n(6411),_=n(5544),{UpdateConnectionState:y,UpdateServerTimeOffset:b}=n(8415),{BadMessageError:w}=n(8187),{BadServerSalt:I,BadMsgNotification:C,MsgDetailedInfo:P,MsgNewDetailedInfo:v,NewSessionCreated:A,FutureSalts:S,MsgsStateReq:M,MsgResendReq:k,MsgsAllInfo:R}=n(7404).constructors,{SecurityError:U}=n(8187),{InvalidBufferError:E}=n(8187),{LogOut:D}=n(7404).requests.auth,{RPCMessageToError:T}=n(7873),{TypeNotFoundError:B}=n(8187);class x{constructor(e,t){const n={...x.DEFAULT_OPTIONS,...t};this._connection=void 0,this._log=n.logger,this._dcId=n.dcId,this._retries=n.retries,this._delay=n.delay,this._autoReconnect=n.autoReconnect,this._connectTimeout=n.connectTimeout,this._authKeyCallback=n.authKeyCallback,this._updateCallback=n.updateCallback,this._autoReconnectCallback=n.autoReconnectCallback,this._isMainSender=n.isMainSender,this._onConnectionBreak=n.onConnectionBreak,this.userDisconnected=!1,this._user_connected=!1,this._reconnecting=!1,this._disconnected=!0,this._send_loop_handle=void 0,this._recv_loop_handle=void 0,this.authKey=e||new r,this._state=new a(this.authKey,this._log),this._send_queue=new m(this._state,this._log),this._pending_state={},this._pending_ack=new Set,this._last_acks=[],this._handlers={[c.CONSTRUCTOR_ID]:this._handleRPCResult.bind(this),[d.CONSTRUCTOR_ID]:this._handleContainer.bind(this),[l.CONSTRUCTOR_ID]:this._handleGzipPacked.bind(this),[h.CONSTRUCTOR_ID]:this._handlePong.bind(this),[I.CONSTRUCTOR_ID]:this._handleBadServerSalt.bind(this),[C.CONSTRUCTOR_ID]:this._handleBadNotification.bind(this),[P.CONSTRUCTOR_ID]:this._handleDetailedInfo.bind(this),[v.CONSTRUCTOR_ID]:this._handleNewDetailedInfo.bind(this),[A.CONSTRUCTOR_ID]:this._handleNewSessionCreated.bind(this),[g.CONSTRUCTOR_ID]:this._handleAck.bind(this),[S.CONSTRUCTOR_ID]:this._handleFutureSalts.bind(this),[M.CONSTRUCTOR_ID]:this._handleStateForgotten.bind(this),[k.CONSTRUCTOR_ID]:this._handleStateForgotten.bind(this),[R.CONSTRUCTOR_ID]:this._handleMsgAll.bind(this)}}async connect(e,t){if(this._user_connected&&!t)return this._log.info("User is already connected!"),!1;this.isConnecting=!0,this._connection=e;for(let e=0;e{this._log.info("Started reconnecting"),this._reconnect()})))}async _reconnect(){this._log.debug("Closing current connection...");try{await this._disconnect()}catch(e){this._log.warn(e)}this._send_queue.append(void 0),this._state.reset();const e=new this._connection.constructor(this._connection._ip,this._connection._port,this._connection._dcId,this._connection._log);await this.connect(e,!0),this._reconnecting=!1;for(const e of Object.values(this._pending_state))e.deferred.resolve();this._pending_state={},this._autoReconnectCallback&&await this._autoReconnectCallback()}}var V,F,N;N={logger:void 0,retries:1/0,delay:2e3,autoReconnect:!0,connectTimeout:void 0,authKeyCallback:void 0,updateCallback:void 0,autoReconnectCallback:void 0,isMainSender:void 0,onConnectionBreak:void 0},(F="DEFAULT_OPTIONS")in(V=x)?Object.defineProperty(V,F,{value:N,enumerable:!0,configurable:!0,writable:!0}):V[F]=N,e.exports=x},9109:(e,t,n)=>{var s=n(8764).Buffer;const a=n(4736),i=n(9618),r=n(2608),o=n(5544),c=n(8963),{TLMessage:d}=n(2058),{SecurityError:l,InvalidBufferError:u}=n(8187),{InvokeAfterMsg:g}=n(7404).requests,{toSignedLittleBuffer:p}=n(9618);e.exports=class{constructor(e,t){this.authKey=e,this._log=t,this.timeOffset=0,this.salt=0,this.id=void 0,this._sequence=void 0,this._lastMsgId=void 0,this.reset()}reset(){this.id=i.generateRandomLong(!0),this._sequence=0,this._lastMsgId=a(0)}updateMessageId(e){e.msgId=this._getNewMsgId()}async _calcKey(e,t,n){const a=!0===n?0:8,[r,o]=await Promise.all([i.sha256(s.concat([t,e.slice(a,a+36)])),i.sha256(s.concat([e.slice(a+40,a+76),t]))]);return{key:s.concat([r.slice(0,8),o.slice(8,24),r.slice(24,32)]),iv:s.concat([o.slice(0,8),r.slice(8,24),o.slice(24,32)])}}async writeDataAsMessage(e,t,n,a){const i=this._getNewMsgId(),r=this._getSeqNo(n);let o;o=a?await c.gzipIfSmaller(n,new g(a,{getBytes:()=>t}).getBytes()):await c.gzipIfSmaller(n,t);const d=s.alloc(4);d.writeInt32LE(r,0);const l=s.alloc(4);l.writeInt32LE(o.length,0);const u=p(i,8);return e.write(s.concat([u,d,l])),e.write(o),i}async encryptMessageData(e){await this.authKey.waitForKey();const t=p(this.salt,8),n=p(this.id,8);e=s.concat([s.concat([t,n]),e]);const a=i.generateRandomBytes(i.mod(-(e.length+12),16)+12),o=(await i.sha256(s.concat([this.authKey.getKey().slice(88,120),e,a]))).slice(8,24),{iv:c,key:d}=await this._calcKey(this.authKey.getKey(),o,!0),l=i.readBufferFromBigInt(this.authKey.keyId,8);return s.concat([l,o,new r(d,c).encryptIge(s.concat([e,a]))])}async decryptMessageData(e){if(e.length<8)throw new u(e);if(e.length<0)throw new l("Server replied with negative length");if(e.length%4!=0)throw new l("Server replied with length not divisible by 4");if(i.readBigIntFromBuffer(e.slice(0,8)).neq(this.authKey.keyId))throw new l("Server replied with an invalid auth key");const t=e.slice(8,24),{iv:n,key:a}=await this._calcKey(this.authKey.getKey(),t,!1);e=new r(a,n).decryptIge(e.slice(24));const c=await i.sha256(s.concat([this.authKey.getKey().slice(96,128),e]));if(!t.equals(c.slice(8,24)))throw new l("Received msg_key doesn't match with expected one");const g=new o(e);if(g.readLong(),!g.readLong().eq(this.id))throw new l("Server replied with a wrong session ID");const p=g.readLong(),f=g.readInt(),h=g.readInt(),m=e.length-h;if(m<12||m>1024)throw new l("Server replied with the wrong message padding");const _=g.tgReadObject();return new d(p,f,_)}_getNewMsgId(){const e=(new Date).getTime()/1e3+this.timeOffset,t=Math.floor(1e9*(e-Math.floor(e)));let n=a(Math.floor(e)).shiftLeft(a(32)).or(a(t).shiftLeft(a(2)));return this._lastMsgId.greaterOrEquals(n)&&(n=this._lastMsgId.add(a(4))),this._lastMsgId=n,n}updateTimeOffset(e){const t=this._getNewMsgId(),n=this.timeOffset,s=Math.floor((new Date).getTime()/1e3),i=e.shiftRight(a(32));return this.timeOffset=i-s,this.timeOffset!==n&&(this._lastMsgId=a(0),this._log.debug(`Updated time offset (old offset ${n}, bad ${t}, good ${e}, new ${this.timeOffset})`)),this.timeOffset}_getSeqNo(e){if(e){const e=2*this._sequence+1;return this._sequence+=1,e}return 2*this._sequence}}},4287:(e,t,n)=>{const{createDeferred:s}=n(9618);e.exports=class{constructor(e,t,n={}){this.containerId=void 0,this.msgId=void 0,this.request=e,this.data=e.getBytes(),this.after=t,this.result=void 0,this.pending=n,this.deferred=s(),this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}isReady(){const e=this.pending[this.after.id];return!e||e.deferred.promise}}},4353:(e,t,n)=>{function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=n(7214),i=n(6151);class r{constructor(e,t,n,r){s(this,"PacketCodecClass",void 0),this._ip=e,this._port=t,this._dcId=n,this._log=r,this._connected=!1,this._sendTask=void 0,this._recvTask=void 0,this._codec=void 0,this._obfuscation=void 0,this._sendArray=new i,this._recvArray=new i,this.socket=new a(this.disconnectCallback.bind(this))}async disconnectCallback(){await this.disconnect(!0)}async _connect(){this._log.debug("Connecting"),this._codec=new this.PacketCodecClass(this),await this.socket.connect(this._port,this._ip,this),this._log.debug("Finished connecting"),await this._initConn()}async connect(){await this._connect(),this._connected=!0,this._sendTask||(this._sendTask=this._sendLoop()),this._recvTask=this._recvLoop()}async disconnect(e=!1){this._connected&&(this._connected=!1,this._recvArray.push(void 0),e||await this.socket.close())}async send(e){if(!this._connected)throw new Error("Not connected");await this._sendArray.push(e)}async recv(){for(;this._connected;){const e=await this._recvArray.pop();if(e)return e}throw new Error("Not connected")}async _sendLoop(){try{for(;this._connected;){const e=await this._sendArray.pop();if(!e)return void(this._sendTask=void 0);await this._send(e)}}catch(e){this._log.info("The server closed the connection while sending")}}async _recvLoop(){let e;for(;this._connected;){try{if(e=await this._recv(),!e)throw new Error("no data received")}catch(e){return this._log.info("connection closed"),void this.disconnect()}await this._recvArray.push(e)}}async _initConn(){this._codec.tag&&await this.socket.write(this._codec.tag)}_send(e){const t=this._codec.encodePacket(e);this.socket.write(t)}_recv(){return this._codec.readPacket(this.socket)}toString(){return`${this._ip}:${this._port}/${this.constructor.name.replace("Connection","")}`}}e.exports={Connection:r,PacketCodec:class{constructor(e){this._conn=e}encodePacket(e){throw new Error("Not Implemented")}readPacket(e){throw new Error("Not Implemented")}},ObfuscatedConnection:class extends r{constructor(...e){super(...e),s(this,"ObfuscatedIO",void 0)}_initConn(){this._obfuscation=new this.ObfuscatedIO(this),this.socket.write(this._obfuscation.header)}_send(e){this._obfuscation.write(this._codec.encodePacket(e))}_recv(){return this._codec.readPacket(this._obfuscation)}}}},6302:(e,t,n)=>{var s=n(8764).Buffer;function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const i=n(4736),{readBufferFromBigInt:r}=n(9618),{Connection:o,PacketCodec:c}=n(4353);class d extends c{constructor(e){super(e),this.tag=d.tag,this.obfuscateTag=d.obfuscateTag}encodePacket(e){let t=e.length>>2;if(t<127){const e=s.alloc(1);e.writeUInt8(t,0),t=e}else t=s.concat([s.from("7f","hex"),r(i(t),3)]);return s.concat([t,e])}async readPacket(e){let t=(await e.read(1))[0];return t>=127&&(t=s.concat([await e.read(3),s.alloc(1)]).readInt32LE(0)),e.read(t<<2)}}a(d,"tag",s.from("ef","hex")),a(d,"obfuscateTag",s.from("efefefef","hex")),e.exports={ConnectionTCPAbridged:class extends o{constructor(...e){super(...e),a(this,"PacketCodecClass",d)}},AbridgedPacketCodec:d}},5484:()=>{},2986:(e,t,n)=>{var s=n(8764).Buffer;function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{generateRandomBytes:i}=n(9618),{ObfuscatedConnection:r}=n(4353),{AbridgedPacketCodec:o}=n(6302),c=n(5830);class d{constructor(e){a(this,"header",void 0),this.connection=e.socket;const t=this.initHeader(e.PacketCodecClass);this.header=t.random,this._encrypt=t.encryptor,this._decrypt=t.decryptor}initHeader(e){const t=[s.from("50567247","hex"),s.from("474554","hex"),s.from("504f5354","hex"),s.from("eeeeeeee","hex")];let n;for(;;)if(n=i(64),239!==n[0]&&!n.slice(4,8).equals(s.alloc(4))){let e=!0;for(const s of t)if(s.equals(n.slice(0,4))){e=!1;break}if(e)break}n=n.toJSON().data;const a=s.from(n.slice(8,56)).reverse(),r=s.from(n.slice(8,40)),o=s.from(n.slice(40,56)),d=s.from(a.slice(0,32)),l=s.from(a.slice(32,48)),u=new c(r,o),g=new c(d,l);return n=s.concat([s.from(n.slice(0,56)),e.obfuscateTag,s.from(n.slice(60))]),n=s.concat([s.from(n.slice(0,56)),s.from(u.encrypt(n).slice(56,64)),s.from(n.slice(64))]),{random:n,encryptor:u,decryptor:g}}async read(e){const t=await this.connection.readExactly(e);return this._decrypt.encrypt(t)}write(e){this.connection.write(this._encrypt.encrypt(e))}}e.exports={ConnectionTCPObfuscated:class extends r{constructor(...e){super(...e),a(this,"ObfuscatedIO",d),a(this,"PacketCodecClass",o)}}}},417:(e,t,n)=>{const{Connection:s}=n(4353),{ConnectionTCPFull:a}=n(5484),{ConnectionTCPAbridged:i}=n(6302),{ConnectionTCPObfuscated:r}=n(2986);e.exports={Connection:s,ConnectionTCPFull:a,ConnectionTCPAbridged:i,ConnectionTCPObfuscated:r}},8415:(e,t,n)=>{function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=n(5585),i=n(4046);class r{constructor(e){this.state=e}}s(r,"disconnected",-1),s(r,"connected",1),s(r,"broken",0);const{Connection:o,ConnectionTCPFull:c,ConnectionTCPAbridged:d,ConnectionTCPObfuscated:l}=n(417);e.exports={Connection:o,ConnectionTCPFull:c,ConnectionTCPAbridged:d,ConnectionTCPObfuscated:l,MTProtoPlainSender:a,MTProtoSender:i,UpdateConnectionState:r,UpdateServerTimeOffset:class{constructor(e){this.timeOffset=e}}}},9270:e=>{e.exports=class{get dcId(){throw new Error("Not Implemented")}get serverAddress(){throw new Error("Not Implemented")}get port(){throw new Error("Not Implemented")}get authKey(){throw new Error("Not Implemented")}set authKey(e){throw new Error("Not Implemented")}setDC(e,t,n){throw new Error("Not implemented")}save(){throw new Error("Not Implemented")}delete(){throw new Error("Not Implemented")}}},926:(e,t,n)=>{const s=n(8753),a="GramJs";e.exports=class extends s{async _delete(){const e=new Request(this._storageKey);return(await self.caches.open(a)).delete(e)}async _fetchFromCache(){const e=new Request(this._storageKey),t=await self.caches.open(a),n=await t.match(e);return n?n.text():void 0}async _saveToCache(e){const t=new Request(this._storageKey),n=new Response(e);return(await self.caches.open(a)).put(t,n)}}},7:(e,t,n)=>{var s=n(8764).Buffer;const a=n(3995),i=n(3302),r=n(8960);e.exports=class extends a{constructor(e,t){super(),this._sessionData=e,this._callback=t,this._authKeys={}}get authKey(){throw new Error("Not supported")}set authKey(e){throw new Error("Not supported")}async load(){if(!this._sessionData)return;const{mainDcId:e,keys:t,hashes:n}=this._sessionData,{ipAddress:a,port:o}=r.getDC(e);this.setDC(e,a,o,!0),await Promise.all(Object.keys(t).map((async e=>{const a="string"==typeof t[e]?s.from(t[e],"hex"):s.from(t[e]);if(n[e]){const t="string"==typeof n[e]?s.from(n[e],"hex"):s.from(n[e]);this._authKeys[e]=new i(a,t)}else this._authKeys[e]=new i,await this._authKeys[e].setKey(a,!0)})))}setDC(e,t,n,s=!1){this._dcId=e,this._serverAddress=t,this._port=n,delete this._authKeys[e],s||this._onUpdate()}getAuthKey(e=this._dcId){return this._authKeys[e]}setAuthKey(e,t=this._dcId){this._authKeys[t]=e,this._onUpdate()}getSessionData(){const e={mainDcId:this._dcId,keys:{},hashes:{}};return Object.keys(this._authKeys).forEach((t=>{const n=this._authKeys[t];n&&n._key&&(e.keys[t]=n._key.toString("hex"),e.hashes[t]=n._hash.toString("hex"))})),e}_onUpdate(){this._callback(this.getSessionData())}delete(){this._callback(void 0)}}},5945:(e,t,n)=>{const s=n(1875),a=n(8753);e.exports=class extends a{_delete(){return s.del(`GramJs:${this._storageKey}`)}_fetchFromCache(){return s.get(`GramJs:${this._storageKey}`)}_saveToCache(e){return s.set(`GramJs:${this._storageKey}`,e)}}},1753:(e,t,n)=>{const s=n(8753);e.exports=class extends s{_delete(){return localStorage.removeItem(this._storageKey)}_fetchFromCache(){return localStorage.getItem(this._storageKey)}_saveToCache(e){return localStorage.setItem(this._storageKey,e)}}},3995:(e,t,n)=>{const s=n(9270);e.exports=class extends s{constructor(){super(),this._serverAddress=void 0,this._dcId=0,this._port=void 0,this._takeoutId=void 0,this._entities=new Set,this._updateStates={}}get dcId(){return this._dcId}get serverAddress(){return this._serverAddress}get port(){return this._port}get authKey(){return this._authKey}set authKey(e){this._authKey=e}setDC(e,t,n){this._dcId=0|e,this._serverAddress=t,this._port=n}}},8753:(e,t,n)=>{var s=n(8764).Buffer;const a=n(3995),i=n(3302),r=n(8960);e.exports=class extends a{constructor(e){super(),this._authKeys={},e&&e.startsWith("session:")?this._sessionString=e:e&&(this._storageKey=e)}get authKey(){throw new Error("Not supported")}set authKey(e){throw new Error("Not supported")}async load(){if(this._sessionString)await this._loadFromSessionString();else if(this._storageKey)try{const e=await this._fetchFromCache(),{mainDcId:t,keys:n,hashes:a}=JSON.parse(e),{ipAddress:o,port:c}=r.getDC(t);this.setDC(t,o,c,!0),Object.keys(n).forEach((e=>{n[e]&&a[e]&&(this._authKeys[e]=new i(s.from(n[e].data),s.from(a[e].data)))}))}catch(e){console.warn("Failed to retrieve or parse session from storage"),console.warn(e)}}setDC(e,t,n,s=!1){this._dcId=e,this._serverAddress=t,this._port=n,delete this._authKeys[e],s||this._updateStorage()}async save(){return this._storageKey||(this._storageKey=`GramJs-session-${Date.now()}`),await this._updateStorage(),this._storageKey}getAuthKey(e=this._dcId){return this._authKeys[e]}setAuthKey(e,t=this._dcId){this._authKeys[t]=e,this._updateStorage()}getSessionData(e){const t={mainDcId:this._dcId,keys:{},hashes:{}};return Object.keys(this._authKeys).forEach((n=>{const s=this._authKeys[n];s._key&&(t.keys[n]=e?s._key.toString("hex"):s._key,t.hashes[n]=e?s._hash.toString("hex"):s._hash)})),t}async _loadFromSessionString(){const[,e,t]=this._sessionString.split(":"),n=Number(e),{ipAddress:a,port:o}=r.getDC(n);this.setDC(n,a,o);const c=new i;await c.setKey(s.from(t,"hex"),!0),this.setAuthKey(c,n)}async _updateStorage(){if(this._storageKey)try{await this._saveToCache(JSON.stringify(this.getSessionData()))}catch(e){console.warn("Failed to update session in storage"),console.warn(e)}}async delete(){try{return await this._delete()}catch(e){console.warn("Failed to delete session from storage"),console.warn(e)}}_delete(){throw new Error("Not Implemented")}_fetchFromCache(){throw new Error("Not Implemented")}_saveToCache(e){throw new Error("Not Implemented")}}},2433:(e,t,n)=>{var s=n(8764).Buffer;const a=n(3995),i=n(3302),r=n(5544);class o extends a{constructor(e){if(super(),e){if("1"!==e[0])throw new Error("Not a valid string");e=e.slice(1);const t=o.decode(e),n=new r(t);this._dcId=n.read(1).readUInt8(0);const s=n.read(2).readInt16BE(0);this._serverAddress=String(n.read(s)),this._port=n.read(2).readInt16BE(0),this._key=n.read(-1)}}static encode(e){return e.toString("base64")}static decode(e){return s.from(e,"base64")}async load(){this._key&&(this._authKey=new i,await this._authKey.setKey(this._key))}save(){if(!this.authKey)return"";const e=s.from([this.dcId]),t=s.from(this.serverAddress),n=s.alloc(2);n.writeInt16BE(t.length,0);const a=s.alloc(2);return a.writeInt16BE(this.port,0),"1"+o.encode(s.concat([e,n,t,a,this.authKey.getKey()]))}getAuthKey(e){if(!e||e===this.dcId)return this.authKey}setAuthKey(e,t){t&&t!==this.dcId||(this.authKey=e)}}e.exports=o},5886:(e,t,n)=>{const s=n(3995),a=n(2433),i=n(926),r=n(1753),o=n(5945),c=n(7);e.exports={Memory:s,StringSession:a,CacheApiSession:i,LocalStorageSession:r,IdbSession:o,CallbackSession:c}},845:(e,t,n)=>{const s=n(7150),a={};for(const e of Object.values(s))if(e.CONSTRUCTOR_ID)a[e.CONSTRUCTOR_ID]=e;else for(const t of Object.values(e))a[t.CONSTRUCTOR_ID]=t;e.exports={LAYER:131,tlobjects:a}},7150:(e,t,n)=>{var s=n(8764).Buffer;function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{parseTl:i,serializeBytes:r,serializeDate:o}=n(1436),{toSignedLittleBuffer:c}=n(9618),d=n(4779),l=n(8106),u="undefined"!=typeof self&&void 0!==self.localStorage,g="GramJs:apiCache";function p(e){const t=i(e,109),n=[],s=[];for(const e of t)e.isFunction?s.push(e):n.push(e);return[n,s]}function f(e,t){switch(t){case"int":{const t=s.alloc(4);return t.writeInt32LE(e,0),t}case"long":return c(e,8);case"int128":return c(e,16);case"int256":return c(e,32);case"double":{const t=s.alloc(8);return t.writeDoubleLE(e,0),t}case"string":return r(e);case"Bool":return e?s.from("b5757299","hex"):s.from("379779bc","hex");case"true":return s.alloc(0);case"bytes":return r(e);case"date":return o(e);default:return e.getBytes()}}function h(e,t){if(t.isVector){t.useVectorId&&e.readInt();const n=[],s=e.readInt();t.isVector=!1;for(let a=0;a{this[e]=t[e]}))}static fromReader(e){const t={};for(const n in c)if(c.hasOwnProperty(n)){const s=c[n];if(s.isFlag){if("true"===s.type){t[n]=Boolean(t.flags&1<f(t,c[e].type)))))}else if(c[e].flagIndicator)if(Object.values(c).some((e=>e.isFlag))){let e=0;for(const t in c)c[t].isFlag&&(!1===this[t]&&"true"===c[t].type||void 0===this[t]?e|=0:e|=1</);if(n){t.readInt();const e=[],s=t.readInt();if("int"===n[1])for(let n=0;n{"function"!=typeof t[e]&&n[e]?Object.assign(n[e],t[e]):n[e]=t[e]})),n}(m("constructor",e.constructors),m("request",e.requests))}()},4779:e=>{e.exports="boolFalse#bc799737 = Bool;\nboolTrue#997275b5 = Bool;\ntrue#3fedd339 = True;\nvector#1cb5c415 {t:Type} # [ t ] = Vector t;\nerror#c4b9f9bb code:int text:string = Error;\nnull#56730bcc = Null;\ninputPeerEmpty#7f3b18ea = InputPeer;\ninputPeerSelf#7da07ec9 = InputPeer;\ninputPeerChat#179be863 chat_id:int = InputPeer;\ninputPeerUser#7b8e7de6 user_id:int access_hash:long = InputPeer;\ninputPeerChannel#20adaef8 channel_id:int access_hash:long = InputPeer;\ninputPeerUserFromMessage#17bae2e6 peer:InputPeer msg_id:int user_id:int = InputPeer;\ninputPeerChannelFromMessage#9c95f7bb peer:InputPeer msg_id:int channel_id:int = InputPeer;\ninputUserEmpty#b98886cf = InputUser;\ninputUserSelf#f7c1b13f = InputUser;\ninputUser#d8292816 user_id:int access_hash:long = InputUser;\ninputUserFromMessage#2d117597 peer:InputPeer msg_id:int user_id:int = InputUser;\ninputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;\ninputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;\ninputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;\ninputMediaEmpty#9664f57f = InputMedia;\ninputMediaUploadedPhoto#1e287d04 flags:# file:InputFile stickers:flags.0?Vector ttl_seconds:flags.1?int = InputMedia;\ninputMediaPhoto#b3ba0635 flags:# id:InputPhoto ttl_seconds:flags.0?int = InputMedia;\ninputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;\ninputMediaContact#f8ab7dfb phone_number:string first_name:string last_name:string vcard:string = InputMedia;\ninputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true force_file:flags.4?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector stickers:flags.0?Vector ttl_seconds:flags.1?int = InputMedia;\ninputMediaDocument#33473058 flags:# id:InputDocument ttl_seconds:flags.0?int query:flags.1?string = InputMedia;\ninputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia;\ninputMediaPhotoExternal#e5bbfe1a flags:# url:string ttl_seconds:flags.0?int = InputMedia;\ninputMediaDocumentExternal#fb52dc99 flags:# url:string ttl_seconds:flags.0?int = InputMedia;\ninputMediaGame#d33f43f3 id:InputGame = InputMedia;\ninputMediaInvoice#d9799874 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:flags.1?string = InputMedia;\ninputMediaGeoLive#971fa843 flags:# stopped:flags.0?true geo_point:InputGeoPoint heading:flags.2?int period:flags.1?int proximity_notification_radius:flags.3?int = InputMedia;\ninputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector solution:flags.1?string solution_entities:flags.1?Vector = InputMedia;\ninputMediaDice#e66fbf7b emoticon:string = InputMedia;\ninputChatPhotoEmpty#1ca48f57 = InputChatPhoto;\ninputChatUploadedPhoto#c642724e flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = InputChatPhoto;\ninputChatPhoto#8953ad37 id:InputPhoto = InputChatPhoto;\ninputGeoPointEmpty#e4c123d6 = InputGeoPoint;\ninputGeoPoint#48222faf flags:# lat:double long:double accuracy_radius:flags.0?int = InputGeoPoint;\ninputPhotoEmpty#1cd7bf0d = InputPhoto;\ninputPhoto#3bb3b94a id:long access_hash:long file_reference:bytes = InputPhoto;\ninputFileLocation#dfdaabe1 volume_id:long local_id:int secret:long file_reference:bytes = InputFileLocation;\ninputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;\ninputDocumentFileLocation#bad07584 id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;\ninputSecureFileLocation#cbc7ee28 id:long access_hash:long = InputFileLocation;\ninputTakeoutFileLocation#29be5899 = InputFileLocation;\ninputPhotoFileLocation#40181ffe id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;\ninputPhotoLegacyFileLocation#d83466f3 id:long access_hash:long file_reference:bytes volume_id:long local_id:int secret:long = InputFileLocation;\ninputPeerPhotoFileLocation#37257e99 flags:# big:flags.0?true peer:InputPeer photo_id:long = InputFileLocation;\ninputStickerSetThumb#9d84f3db stickerset:InputStickerSet thumb_version:int = InputFileLocation;\ninputGroupCallStream#bba51639 call:InputGroupCall time_ms:long scale:int = InputFileLocation;\npeerUser#9db1bc6d user_id:int = Peer;\npeerChat#bad0e5bb chat_id:int = Peer;\npeerChannel#bddde532 channel_id:int = Peer;\nstorage.fileUnknown#aa963b05 = storage.FileType;\nstorage.filePartial#40bc6f52 = storage.FileType;\nstorage.fileJpeg#7efe0e = storage.FileType;\nstorage.fileGif#cae1aadf = storage.FileType;\nstorage.filePng#a4f63c0 = storage.FileType;\nstorage.filePdf#ae1e508d = storage.FileType;\nstorage.fileMp3#528a0677 = storage.FileType;\nstorage.fileMov#4b09ebbc = storage.FileType;\nstorage.fileMp4#b3cea0e4 = storage.FileType;\nstorage.fileWebp#1081464c = storage.FileType;\nuserEmpty#200250ba id:int = User;\nuser#938458c1 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;\nuserProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;\nuserProfilePhoto#82d1f706 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto;\nuserStatusEmpty#9d05049 = UserStatus;\nuserStatusOnline#edb93949 expires:int = UserStatus;\nuserStatusOffline#8c703f was_online:int = UserStatus;\nuserStatusRecently#e26f42f1 = UserStatus;\nuserStatusLastWeek#7bf09fc = UserStatus;\nuserStatusLastMonth#77ebc742 = UserStatus;\nchatEmpty#9ba2d800 id:int = Chat;\nchat#3bda1bde flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat;\nchatForbidden#7328bdb id:int title:string = Chat;\nchannel#d31a961e flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true id:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?Vector admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat;\nchannelForbidden#289da732 flags:# broadcast:flags.5?true megagroup:flags.8?true id:int access_hash:long title:string until_date:flags.16?int = Chat;\nchatFull#8a1e2983 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:int about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer = ChatFull;\nchannelFull#548c3f93 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?int location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector groupcall_default_join_as:flags.26?Peer = ChatFull;\nchatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;\nchatParticipantCreator#da13538a user_id:int = ChatParticipant;\nchatParticipantAdmin#e2d6e436 user_id:int inviter_id:int date:int = ChatParticipant;\nchatParticipantsForbidden#fc900c2b flags:# chat_id:int self_participant:flags.0?ChatParticipant = ChatParticipants;\nchatParticipants#3f460fed chat_id:int participants:Vector version:int = ChatParticipants;\nchatPhotoEmpty#37c1011c = ChatPhoto;\nchatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = ChatPhoto;\nmessageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = Message;\nmessage#bce383d2 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector ttl_period:flags.25?int = Message;\nmessageService#2b085862 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction ttl_period:flags.25?int = Message;\nmessageMediaEmpty#3ded6320 = MessageMedia;\nmessageMediaPhoto#695150d7 flags:# photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia;\nmessageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;\nmessageMediaContact#cbf24940 phone_number:string first_name:string last_name:string vcard:string user_id:int = MessageMedia;\nmessageMediaUnsupported#9f84f49e = MessageMedia;\nmessageMediaDocument#9cb070d7 flags:# document:flags.0?Document ttl_seconds:flags.2?int = MessageMedia;\nmessageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;\nmessageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia;\nmessageMediaGame#fdb19008 game:Game = MessageMedia;\nmessageMediaInvoice#84551347 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string = MessageMedia;\nmessageMediaGeoLive#b940c666 flags:# geo:GeoPoint heading:flags.0?int period:int proximity_notification_radius:flags.1?int = MessageMedia;\nmessageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia;\nmessageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia;\nmessageActionEmpty#b6aef7b0 = MessageAction;\nmessageActionChatCreate#a6638b9a title:string users:Vector = MessageAction;\nmessageActionChatEditTitle#b5a1ce5a title:string = MessageAction;\nmessageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;\nmessageActionChatDeletePhoto#95e3fbef = MessageAction;\nmessageActionChatAddUser#488a7337 users:Vector = MessageAction;\nmessageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;\nmessageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction;\nmessageActionChannelCreate#95d2ac92 title:string = MessageAction;\nmessageActionChatMigrateTo#51bdb021 channel_id:int = MessageAction;\nmessageActionChannelMigrateFrom#b055eaee title:string chat_id:int = MessageAction;\nmessageActionPinMessage#94bd38ed = MessageAction;\nmessageActionHistoryClear#9fbab604 = MessageAction;\nmessageActionGameScore#92a72876 game_id:long score:int = MessageAction;\nmessageActionPaymentSentMe#8f31b327 flags:# currency:string total_amount:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string charge:PaymentCharge = MessageAction;\nmessageActionPaymentSent#40699cd0 currency:string total_amount:long = MessageAction;\nmessageActionPhoneCall#80e11a7f flags:# video:flags.2?true call_id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = MessageAction;\nmessageActionScreenshotTaken#4792929b = MessageAction;\nmessageActionCustomAction#fae69f56 message:string = MessageAction;\nmessageActionBotAllowed#abe9affe domain:string = MessageAction;\nmessageActionSecureValuesSentMe#1b287353 values:Vector credentials:SecureCredentialsEncrypted = MessageAction;\nmessageActionSecureValuesSent#d95c6154 types:Vector = MessageAction;\nmessageActionContactSignUp#f3f25f76 = MessageAction;\nmessageActionGeoProximityReached#98e0d697 from_id:Peer to_id:Peer distance:int = MessageAction;\nmessageActionGroupCall#7a0d7f42 flags:# call:InputGroupCall duration:flags.0?int = MessageAction;\nmessageActionInviteToGroupCall#76b9f11a call:InputGroupCall users:Vector = MessageAction;\nmessageActionSetMessagesTTL#aa1afbfd period:int = MessageAction;\nmessageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction;\ndialog#2c171f72 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int = Dialog;\ndialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;\nphotoEmpty#2331b22d id:long = Photo;\nphoto#fb197a65 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector video_sizes:flags.1?Vector dc_id:int = Photo;\nphotoSizeEmpty#e17e23c type:string = PhotoSize;\nphotoSize#75c78e60 type:string w:int h:int size:int = PhotoSize;\nphotoCachedSize#21e1ad6 type:string w:int h:int bytes:bytes = PhotoSize;\nphotoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize;\nphotoSizeProgressive#fa3efb95 type:string w:int h:int sizes:Vector = PhotoSize;\nphotoPathSize#d8214d41 type:string bytes:bytes = PhotoSize;\ngeoPointEmpty#1117dd5f = GeoPoint;\ngeoPoint#b2a2f663 flags:# long:double lat:double access_hash:long accuracy_radius:flags.0?int = GeoPoint;\nauth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode;\nauth.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Authorization;\nauth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization;\nauth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;\ninputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;\ninputNotifyUsers#193b4417 = InputNotifyPeer;\ninputNotifyChats#4a95e84e = InputNotifyPeer;\ninputNotifyBroadcasts#b1db7c7e = InputNotifyPeer;\ninputPeerNotifySettings#9c3d198e flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = InputPeerNotifySettings;\npeerNotifySettings#af509d20 flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = PeerNotifySettings;\npeerSettings#733f2961 flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true invite_members:flags.8?true geo_distance:flags.6?int = PeerSettings;\nwallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper;\nwallPaperNoFile#e0804116 id:long flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper;\ninputReportReasonSpam#58dbcab8 = ReportReason;\ninputReportReasonViolence#1e22c78d = ReportReason;\ninputReportReasonPornography#2e59d922 = ReportReason;\ninputReportReasonChildAbuse#adf44ee3 = ReportReason;\ninputReportReasonOther#c1e4a2b1 = ReportReason;\ninputReportReasonCopyright#9b89f93a = ReportReason;\ninputReportReasonGeoIrrelevant#dbd4feed = ReportReason;\ninputReportReasonFake#f5ddd6e7 = ReportReason;\nuserFull#139a9a77 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int = UserFull;\ncontact#f911c994 user_id:int mutual:Bool = Contact;\nimportedContact#d0028438 user_id:int client_id:long = ImportedContact;\ncontactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus;\ncontacts.contactsNotModified#b74ba9d2 = contacts.Contacts;\ncontacts.contacts#eae87e42 contacts:Vector saved_count:int users:Vector = contacts.Contacts;\ncontacts.importedContacts#77d01c3b imported:Vector popular_invites:Vector retry_contacts:Vector users:Vector = contacts.ImportedContacts;\ncontacts.blocked#ade1591 blocked:Vector chats:Vector users:Vector = contacts.Blocked;\ncontacts.blockedSlice#e1664194 count:int blocked:Vector chats:Vector users:Vector = contacts.Blocked;\nmessages.dialogs#15ba6c40 dialogs:Vector messages:Vector chats:Vector users:Vector = messages.Dialogs;\nmessages.dialogsSlice#71e094f3 count:int dialogs:Vector messages:Vector chats:Vector users:Vector = messages.Dialogs;\nmessages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs;\nmessages.messages#8c718e87 messages:Vector chats:Vector users:Vector = messages.Messages;\nmessages.messagesSlice#3a54685e flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int messages:Vector chats:Vector users:Vector = messages.Messages;\nmessages.channelMessages#64479808 flags:# inexact:flags.1?true pts:int count:int offset_id_offset:flags.2?int messages:Vector chats:Vector users:Vector = messages.Messages;\nmessages.messagesNotModified#74535f21 count:int = messages.Messages;\nmessages.chats#64ff9fd5 chats:Vector = messages.Chats;\nmessages.chatsSlice#9cd81144 count:int chats:Vector = messages.Chats;\nmessages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector users:Vector = messages.ChatFull;\nmessages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;\ninputMessagesFilterEmpty#57e2f66c = MessagesFilter;\ninputMessagesFilterPhotos#9609a51c = MessagesFilter;\ninputMessagesFilterVideo#9fc00e65 = MessagesFilter;\ninputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;\ninputMessagesFilterDocument#9eddf188 = MessagesFilter;\ninputMessagesFilterUrl#7ef0dd87 = MessagesFilter;\ninputMessagesFilterGif#ffc86587 = MessagesFilter;\ninputMessagesFilterVoice#50f5c392 = MessagesFilter;\ninputMessagesFilterMusic#3751b49e = MessagesFilter;\ninputMessagesFilterChatPhotos#3a20ecb8 = MessagesFilter;\ninputMessagesFilterPhoneCalls#80c99768 flags:# missed:flags.0?true = MessagesFilter;\ninputMessagesFilterRoundVoice#7a7c17a4 = MessagesFilter;\ninputMessagesFilterRoundVideo#b549da53 = MessagesFilter;\ninputMessagesFilterMyMentions#c1f8e69a = MessagesFilter;\ninputMessagesFilterGeo#e7026d0d = MessagesFilter;\ninputMessagesFilterContacts#e062db83 = MessagesFilter;\ninputMessagesFilterPinned#1bb00451 = MessagesFilter;\nupdateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;\nupdateMessageID#4e90bfd6 id:int random_id:long = Update;\nupdateDeleteMessages#a20db0e5 messages:Vector pts:int pts_count:int = Update;\nupdateUserTyping#5c486927 user_id:int action:SendMessageAction = Update;\nupdateChatUserTyping#86cadb6c chat_id:int from_id:Peer action:SendMessageAction = Update;\nupdateChatParticipants#7761198 participants:ChatParticipants = Update;\nupdateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;\nupdateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update;\nupdateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;\nupdateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;\nupdateEncryptedChatTyping#1710f156 chat_id:int = Update;\nupdateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;\nupdateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;\nupdateChatParticipantAdd#ea4b0e5c chat_id:int user_id:int inviter_id:int date:int version:int = Update;\nupdateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;\nupdateDcOptions#8e5e9873 dc_options:Vector = Update;\nupdateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update;\nupdateServiceNotification#ebe46819 flags:# popup:flags.0?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector = Update;\nupdatePrivacy#ee3b272a key:PrivacyKey rules:Vector = Update;\nupdateUserPhone#12b9417b user_id:int phone:string = Update;\nupdateReadHistoryInbox#9c974fdf flags:# folder_id:flags.0?int peer:Peer max_id:int still_unread_count:int pts:int pts_count:int = Update;\nupdateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;\nupdateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update;\nupdateReadMessagesContents#68c13933 messages:Vector pts:int pts_count:int = Update;\nupdateChannelTooLong#eb0467fb flags:# channel_id:int pts:flags.0?int = Update;\nupdateChannel#b6d45656 channel_id:int = Update;\nupdateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update;\nupdateReadChannelInbox#330b5424 flags:# folder_id:flags.0?int channel_id:int max_id:int still_unread_count:int pts:int = Update;\nupdateDeleteChannelMessages#c37521c9 channel_id:int messages:Vector pts:int pts_count:int = Update;\nupdateChannelMessageViews#98a12b4b channel_id:int id:int views:int = Update;\nupdateChatParticipantAdmin#b6901959 chat_id:int user_id:int is_admin:Bool version:int = Update;\nupdateNewStickerSet#688a30aa stickerset:messages.StickerSet = Update;\nupdateStickerSetsOrder#bb2d201 flags:# masks:flags.0?true order:Vector = Update;\nupdateStickerSets#43ae3dec = Update;\nupdateSavedGifs#9375341e = Update;\nupdateBotInlineQuery#3f2038db flags:# query_id:long user_id:int query:string geo:flags.0?GeoPoint peer_type:flags.1?InlineQueryPeerType offset:string = Update;\nupdateBotInlineSend#e48f964 flags:# user_id:int query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update;\nupdateEditChannelMessage#1b3f4df7 message:Message pts:int pts_count:int = Update;\nupdateBotCallbackQuery#e73547e1 flags:# query_id:long user_id:int peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;\nupdateEditMessage#e40370a3 message:Message pts:int pts_count:int = Update;\nupdateInlineBotCallbackQuery#f9d27a5a flags:# query_id:long user_id:int msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;\nupdateReadChannelOutbox#25d6c9c7 channel_id:int max_id:int = Update;\nupdateDraftMessage#ee2bb969 peer:Peer draft:DraftMessage = Update;\nupdateReadFeaturedStickers#571d2742 = Update;\nupdateRecentStickers#9a422c20 = Update;\nupdateConfig#a229dd06 = Update;\nupdatePtsChanged#3354678f = Update;\nupdateChannelWebPage#40771900 channel_id:int webpage:WebPage pts:int pts_count:int = Update;\nupdateDialogPinned#6e6fe51c flags:# pinned:flags.0?true folder_id:flags.1?int peer:DialogPeer = Update;\nupdatePinnedDialogs#fa0f3ca2 flags:# folder_id:flags.1?int order:flags.0?Vector = Update;\nupdateBotWebhookJSON#8317c0c3 data:DataJSON = Update;\nupdateBotWebhookJSONQuery#9b9240a6 query_id:long data:DataJSON timeout:int = Update;\nupdateBotShippingQuery#e0cdc940 query_id:long user_id:int payload:bytes shipping_address:PostAddress = Update;\nupdateBotPrecheckoutQuery#5d2f3aa9 flags:# query_id:long user_id:int payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update;\nupdatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update;\nupdateLangPackTooLong#46560264 lang_code:string = Update;\nupdateLangPack#56022f4d difference:LangPackDifference = Update;\nupdateFavedStickers#e511996d = Update;\nupdateChannelReadMessagesContents#89893b45 channel_id:int messages:Vector = Update;\nupdateContactsReset#7084a7be = Update;\nupdateChannelAvailableMessages#70db6837 channel_id:int available_min_id:int = Update;\nupdateDialogUnreadMark#e16459c3 flags:# unread:flags.0?true peer:DialogPeer = Update;\nupdateMessagePoll#aca1657b flags:# poll_id:long poll:flags.0?Poll results:PollResults = Update;\nupdateChatDefaultBannedRights#54c01850 peer:Peer default_banned_rights:ChatBannedRights version:int = Update;\nupdateFolderPeers#19360dc0 folder_peers:Vector pts:int pts_count:int = Update;\nupdatePeerSettings#6a7e7366 peer:Peer settings:PeerSettings = Update;\nupdatePeerLocated#b4afcfb0 peers:Vector = Update;\nupdateNewScheduledMessage#39a51dfb message:Message = Update;\nupdateDeleteScheduledMessages#90866cee peer:Peer messages:Vector = Update;\nupdateTheme#8216fba3 theme:Theme = Update;\nupdateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update;\nupdateLoginToken#564fe691 = Update;\nupdateMessagePollVote#37f69f0b poll_id:long user_id:int options:Vector qts:int = Update;\nupdateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update;\nupdateDialogFilterOrder#a5d72105 order:Vector = Update;\nupdateDialogFilters#3504914f = Update;\nupdatePhoneCallSignalingData#2661bf09 phone_call_id:long data:bytes = Update;\nupdateChannelMessageForwards#6e8a84df channel_id:int id:int forwards:int = Update;\nupdateReadChannelDiscussionInbox#1cc7de54 flags:# channel_id:int top_msg_id:int read_max_id:int broadcast_id:flags.0?int broadcast_post:flags.0?int = Update;\nupdateReadChannelDiscussionOutbox#4638a26c channel_id:int top_msg_id:int read_max_id:int = Update;\nupdatePeerBlocked#246a4b22 peer_id:Peer blocked:Bool = Update;\nupdateChannelUserTyping#6b171718 flags:# channel_id:int top_msg_id:flags.0?int from_id:Peer action:SendMessageAction = Update;\nupdatePinnedMessages#ed85eab5 flags:# pinned:flags.0?true peer:Peer messages:Vector pts:int pts_count:int = Update;\nupdatePinnedChannelMessages#8588878b flags:# pinned:flags.0?true channel_id:int messages:Vector pts:int pts_count:int = Update;\nupdateChat#1330a196 chat_id:int = Update;\nupdateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector version:int = Update;\nupdateGroupCall#a45eb99b chat_id:int call:GroupCall = Update;\nupdatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update;\nupdateChatParticipant#f3b3781f flags:# chat_id:int date:int actor_id:int user_id:int prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update;\nupdateChannelParticipant#7fecb1ec flags:# channel_id:int date:int actor_id:int user_id:int prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update;\nupdateBotStopped#7f9488a user_id:int date:int stopped:Bool qts:int = Update;\nupdateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update;\nupdateBotCommands#cf7e0873 peer:Peer bot_id:int commands:Vector = Update;\nupdates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;\nupdates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;\nupdates.difference#f49ca0 new_messages:Vector new_encrypted_messages:Vector other_updates:Vector chats:Vector users:Vector state:updates.State = updates.Difference;\nupdates.differenceSlice#a8fb1981 new_messages:Vector new_encrypted_messages:Vector other_updates:Vector chats:Vector users:Vector intermediate_state:updates.State = updates.Difference;\nupdates.differenceTooLong#4afe8f6d pts:int = updates.Difference;\nupdatesTooLong#e317af7e = Updates;\nupdateShortMessage#faeff833 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates;\nupdateShortChatMessage#1157b858 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates;\nupdateShort#78d4dec1 update:Update date:int = Updates;\nupdatesCombined#725b04c3 updates:Vector users:Vector chats:Vector date:int seq_start:int seq:int = Updates;\nupdates#74ae4240 updates:Vector users:Vector chats:Vector date:int seq:int = Updates;\nupdateShortSentMessage#9015e101 flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector ttl_period:flags.25?int = Updates;\nphotos.photos#8dca6aa5 photos:Vector users:Vector = photos.Photos;\nphotos.photosSlice#15051f54 count:int photos:Vector users:Vector = photos.Photos;\nphotos.photo#20212ca8 photo:Photo users:Vector = photos.Photo;\nupload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;\nupload.fileCdnRedirect#f18cda44 dc_id:int file_token:bytes encryption_key:bytes encryption_iv:bytes file_hashes:Vector = upload.File;\ndcOption#18b7a10d flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true cdn:flags.3?true static:flags.4?true id:int ip_address:string port:int secret:flags.10?bytes = DcOption;\nconfig#330b4067 flags:# phonecalls_enabled:flags.1?true default_p2p_contacts:flags.3?true preload_featured_stickers:flags.4?true ignore_phone_entities:flags.5?true revoke_pm_inbox:flags.6?true blocked_mode:flags.8?true pfs_enabled:flags.13?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector dc_txt_domain_name:string chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int revoke_time_limit:int revoke_pm_time_limit:int rating_e_decay:int stickers_recent_limit:int stickers_faved_limit:int channels_read_media_period:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int pinned_infolder_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string autoupdate_url_prefix:flags.7?string gif_search_username:flags.9?string venue_search_username:flags.10?string img_search_username:flags.11?string static_maps_provider:flags.12?string caption_length_max:int message_length_max:int webfile_dc_id:int suggested_lang_code:flags.2?string lang_pack_version:flags.2?int base_lang_pack_version:flags.2?int = Config;\nnearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;\nhelp.appUpdate#ccbbce30 flags:# can_not_skip:flags.0?true id:int version:string text:string entities:Vector document:flags.1?Document url:flags.2?string sticker:flags.3?Document = help.AppUpdate;\nhelp.noAppUpdate#c45a6536 = help.AppUpdate;\nhelp.inviteText#18cb9f78 message:string = help.InviteText;\nencryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;\nencryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;\nencryptedChatRequested#62718a82 flags:# folder_id:flags.0?int id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;\nencryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;\nencryptedChatDiscarded#1e1c7c45 flags:# history_deleted:flags.0?true id:int = EncryptedChat;\ninputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;\nencryptedFileEmpty#c21f497e = EncryptedFile;\nencryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;\ninputEncryptedFileEmpty#1837c364 = InputEncryptedFile;\ninputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;\ninputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;\ninputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;\nencryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;\nencryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;\nmessages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;\nmessages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;\nmessages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;\nmessages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;\ninputDocumentEmpty#72f0eaae = InputDocument;\ninputDocument#1abfb575 id:long access_hash:long file_reference:bytes = InputDocument;\ndocumentEmpty#36f8c871 id:long = Document;\ndocument#1e87342b flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:int thumbs:flags.0?Vector video_thumbs:flags.1?Vector dc_id:int attributes:Vector = Document;\nhelp.support#17c6b5f6 phone_number:string user:User = help.Support;\nnotifyPeer#9fd40bd8 peer:Peer = NotifyPeer;\nnotifyUsers#b4c83b4c = NotifyPeer;\nnotifyChats#c007cec3 = NotifyPeer;\nnotifyBroadcasts#d612e8ef = NotifyPeer;\nsendMessageTypingAction#16bf744e = SendMessageAction;\nsendMessageCancelAction#fd5ec8f5 = SendMessageAction;\nsendMessageRecordVideoAction#a187d66f = SendMessageAction;\nsendMessageUploadVideoAction#e9763aec progress:int = SendMessageAction;\nsendMessageRecordAudioAction#d52f73f7 = SendMessageAction;\nsendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction;\nsendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction;\nsendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction;\nsendMessageGeoLocationAction#176f8ba1 = SendMessageAction;\nsendMessageChooseContactAction#628cbc6f = SendMessageAction;\nsendMessageGamePlayAction#dd6a8f48 = SendMessageAction;\nsendMessageRecordRoundAction#88f27fbc = SendMessageAction;\nsendMessageUploadRoundAction#243e1c66 progress:int = SendMessageAction;\nspeakingInGroupCallAction#d92c2285 = SendMessageAction;\nsendMessageHistoryImportAction#dbda9246 progress:int = SendMessageAction;\ncontacts.found#b3134d9d my_results:Vector results:Vector chats:Vector users:Vector = contacts.Found;\ninputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;\ninputPrivacyKeyChatInvite#bdfb0426 = InputPrivacyKey;\ninputPrivacyKeyPhoneCall#fabadc5f = InputPrivacyKey;\ninputPrivacyKeyPhoneP2P#db9e70d2 = InputPrivacyKey;\ninputPrivacyKeyForwards#a4dd4c08 = InputPrivacyKey;\ninputPrivacyKeyProfilePhoto#5719bacc = InputPrivacyKey;\ninputPrivacyKeyPhoneNumber#352dafa = InputPrivacyKey;\ninputPrivacyKeyAddedByPhone#d1219bdd = InputPrivacyKey;\nprivacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;\nprivacyKeyChatInvite#500e6dfa = PrivacyKey;\nprivacyKeyPhoneCall#3d662b7b = PrivacyKey;\nprivacyKeyPhoneP2P#39491cc8 = PrivacyKey;\nprivacyKeyForwards#69ec56a3 = PrivacyKey;\nprivacyKeyProfilePhoto#96151fed = PrivacyKey;\nprivacyKeyPhoneNumber#d19ae46d = PrivacyKey;\nprivacyKeyAddedByPhone#42ffd42b = PrivacyKey;\ninputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;\ninputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;\ninputPrivacyValueAllowUsers#131cc67f users:Vector = InputPrivacyRule;\ninputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule;\ninputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule;\ninputPrivacyValueDisallowUsers#90110467 users:Vector = InputPrivacyRule;\ninputPrivacyValueAllowChatParticipants#4c81c1ba chats:Vector = InputPrivacyRule;\ninputPrivacyValueDisallowChatParticipants#d82363af chats:Vector = InputPrivacyRule;\nprivacyValueAllowContacts#fffe1bac = PrivacyRule;\nprivacyValueAllowAll#65427b82 = PrivacyRule;\nprivacyValueAllowUsers#4d5bbe0c users:Vector = PrivacyRule;\nprivacyValueDisallowContacts#f888fa1a = PrivacyRule;\nprivacyValueDisallowAll#8b73e763 = PrivacyRule;\nprivacyValueDisallowUsers#c7f49b7 users:Vector = PrivacyRule;\nprivacyValueAllowChatParticipants#18be796b chats:Vector = PrivacyRule;\nprivacyValueDisallowChatParticipants#acae0690 chats:Vector = PrivacyRule;\naccount.privacyRules#50a04e45 rules:Vector chats:Vector users:Vector = account.PrivacyRules;\naccountDaysTTL#b8d0afdf days:int = AccountDaysTTL;\ndocumentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;\ndocumentAttributeAnimated#11b58939 = DocumentAttribute;\ndocumentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute;\ndocumentAttributeVideo#ef02ce6 flags:# round_message:flags.0?true supports_streaming:flags.1?true duration:int w:int h:int = DocumentAttribute;\ndocumentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute;\ndocumentAttributeFilename#15590068 file_name:string = DocumentAttribute;\ndocumentAttributeHasStickers#9801d2f7 = DocumentAttribute;\nmessages.stickersNotModified#f1749a22 = messages.Stickers;\nmessages.stickers#e4599bbd hash:int stickers:Vector = messages.Stickers;\nstickerPack#12b299d4 emoticon:string documents:Vector = StickerPack;\nmessages.allStickersNotModified#e86602c3 = messages.AllStickers;\nmessages.allStickers#edfd405f hash:int sets:Vector = messages.AllStickers;\nmessages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;\nwebPageEmpty#eb1477e8 id:long = WebPage;\nwebPagePending#c586da1c id:long date:int = WebPage;\nwebPage#e89c45b2 flags:# id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page attributes:flags.12?Vector = WebPage;\nwebPageNotModified#7311ca11 flags:# cached_page_views:flags.0?int = WebPage;\nauthorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true hash:long device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;\naccount.authorizations#1250abde authorizations:Vector = account.Authorizations;\naccount.password#185b184f flags:# has_recovery:flags.0?true has_secure_values:flags.1?true has_password:flags.2?true current_algo:flags.2?PasswordKdfAlgo srp_B:flags.2?bytes srp_id:flags.2?long hint:flags.3?string email_unconfirmed_pattern:flags.4?string new_algo:PasswordKdfAlgo new_secure_algo:SecurePasswordKdfAlgo secure_random:bytes pending_reset_date:flags.5?int = account.Password;\naccount.passwordSettings#9a5c33e5 flags:# email:flags.0?string secure_settings:flags.1?SecureSecretSettings = account.PasswordSettings;\naccount.passwordInputSettings#c23727c9 flags:# new_algo:flags.0?PasswordKdfAlgo new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string new_secure_settings:flags.2?SecureSecretSettings = account.PasswordInputSettings;\nauth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;\nreceivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;\nchatInviteExported#6e24fc9d flags:# revoked:flags.0?true permanent:flags.5?true link:string admin_id:int date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int = ExportedChatInvite;\nchatInviteAlready#5a686d7c chat:Chat = ChatInvite;\nchatInvite#dfc2f58e flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true title:string photo:Photo participants_count:int participants:flags.4?Vector = ChatInvite;\nchatInvitePeek#61695cb0 chat:Chat expires:int = ChatInvite;\ninputStickerSetEmpty#ffb62b95 = InputStickerSet;\ninputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;\ninputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;\ninputStickerSetAnimatedEmoji#28703c8 = InputStickerSet;\ninputStickerSetDice#e67f520e emoticon:string = InputStickerSet;\nstickerSet#d7df217a flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector thumb_dc_id:flags.4?int thumb_version:flags.4?int count:int hash:int = StickerSet;\nmessages.stickerSet#b60a24a6 set:StickerSet packs:Vector documents:Vector = messages.StickerSet;\nbotCommand#c27ac8c7 command:string description:string = BotCommand;\nbotInfo#98e81d3a user_id:int description:string commands:Vector = BotInfo;\nkeyboardButton#a2fa4880 text:string = KeyboardButton;\nkeyboardButtonUrl#258aff05 text:string url:string = KeyboardButton;\nkeyboardButtonCallback#35bbdb6b flags:# requires_password:flags.0?true text:string data:bytes = KeyboardButton;\nkeyboardButtonRequestPhone#b16a6c29 text:string = KeyboardButton;\nkeyboardButtonRequestGeoLocation#fc796b3f text:string = KeyboardButton;\nkeyboardButtonSwitchInline#568a748 flags:# same_peer:flags.0?true text:string query:string = KeyboardButton;\nkeyboardButtonGame#50f41ccf text:string = KeyboardButton;\nkeyboardButtonBuy#afd93fbb text:string = KeyboardButton;\nkeyboardButtonUrlAuth#10b78d29 flags:# text:string fwd_text:flags.0?string url:string button_id:int = KeyboardButton;\ninputKeyboardButtonUrlAuth#d02e7fd4 flags:# request_write_access:flags.0?true text:string fwd_text:flags.1?string url:string bot:InputUser = KeyboardButton;\nkeyboardButtonRequestPoll#bbc7515d flags:# quiz:flags.0?Bool text:string = KeyboardButton;\nkeyboardButtonRow#77608b83 buttons:Vector = KeyboardButtonRow;\nreplyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup;\nreplyKeyboardForceReply#86b40b08 flags:# single_use:flags.1?true selective:flags.2?true placeholder:flags.3?string = ReplyMarkup;\nreplyKeyboardMarkup#85dd99d1 flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true rows:Vector placeholder:flags.3?string = ReplyMarkup;\nreplyInlineMarkup#48a30254 rows:Vector = ReplyMarkup;\nmessageEntityUnknown#bb92ba95 offset:int length:int = MessageEntity;\nmessageEntityMention#fa04579d offset:int length:int = MessageEntity;\nmessageEntityHashtag#6f635b0d offset:int length:int = MessageEntity;\nmessageEntityBotCommand#6cef8ac7 offset:int length:int = MessageEntity;\nmessageEntityUrl#6ed02538 offset:int length:int = MessageEntity;\nmessageEntityEmail#64e475c2 offset:int length:int = MessageEntity;\nmessageEntityBold#bd610bc9 offset:int length:int = MessageEntity;\nmessageEntityItalic#826f8b60 offset:int length:int = MessageEntity;\nmessageEntityCode#28a20571 offset:int length:int = MessageEntity;\nmessageEntityPre#73924be0 offset:int length:int language:string = MessageEntity;\nmessageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity;\nmessageEntityMentionName#352dca58 offset:int length:int user_id:int = MessageEntity;\ninputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity;\nmessageEntityPhone#9b69e34b offset:int length:int = MessageEntity;\nmessageEntityCashtag#4c4e743f offset:int length:int = MessageEntity;\nmessageEntityUnderline#9c4e7e8b offset:int length:int = MessageEntity;\nmessageEntityStrike#bf0693d4 offset:int length:int = MessageEntity;\nmessageEntityBlockquote#20df5d0 offset:int length:int = MessageEntity;\nmessageEntityBankCard#761e6af4 offset:int length:int = MessageEntity;\ninputChannelEmpty#ee8c1e86 = InputChannel;\ninputChannel#afeb712e channel_id:int access_hash:long = InputChannel;\ninputChannelFromMessage#2a286531 peer:InputPeer msg_id:int channel_id:int = InputChannel;\ncontacts.resolvedPeer#7f077ad9 peer:Peer chats:Vector users:Vector = contacts.ResolvedPeer;\nmessageRange#ae30253 min_id:int max_id:int = MessageRange;\nupdates.channelDifferenceEmpty#3e11affb flags:# final:flags.0?true pts:int timeout:flags.1?int = updates.ChannelDifference;\nupdates.channelDifferenceTooLong#a4bcc6fe flags:# final:flags.0?true timeout:flags.1?int dialog:Dialog messages:Vector chats:Vector users:Vector = updates.ChannelDifference;\nupdates.channelDifference#2064674e flags:# final:flags.0?true pts:int timeout:flags.1?int new_messages:Vector other_updates:Vector chats:Vector users:Vector = updates.ChannelDifference;\nchannelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter;\nchannelMessagesFilter#cd77d957 flags:# exclude_new_messages:flags.1?true ranges:Vector = ChannelMessagesFilter;\nchannelParticipant#15ebac1d user_id:int date:int = ChannelParticipant;\nchannelParticipantSelf#a3289a6d user_id:int inviter_id:int date:int = ChannelParticipant;\nchannelParticipantCreator#447dca4b flags:# user_id:int admin_rights:ChatAdminRights rank:flags.0?string = ChannelParticipant;\nchannelParticipantAdmin#ccbebbaf flags:# can_edit:flags.0?true self:flags.1?true user_id:int inviter_id:flags.1?int promoted_by:int date:int admin_rights:ChatAdminRights rank:flags.2?string = ChannelParticipant;\nchannelParticipantBanned#50a1dfd6 flags:# left:flags.0?true peer:Peer kicked_by:int date:int banned_rights:ChatBannedRights = ChannelParticipant;\nchannelParticipantLeft#1b03f006 peer:Peer = ChannelParticipant;\nchannelParticipantsRecent#de3f3c79 = ChannelParticipantsFilter;\nchannelParticipantsAdmins#b4608969 = ChannelParticipantsFilter;\nchannelParticipantsKicked#a3b54985 q:string = ChannelParticipantsFilter;\nchannelParticipantsBots#b0d1865b = ChannelParticipantsFilter;\nchannelParticipantsBanned#1427a5e1 q:string = ChannelParticipantsFilter;\nchannelParticipantsSearch#656ac4b q:string = ChannelParticipantsFilter;\nchannelParticipantsContacts#bb6ae88d q:string = ChannelParticipantsFilter;\nchannelParticipantsMentions#e04b5ceb flags:# q:flags.0?string top_msg_id:flags.1?int = ChannelParticipantsFilter;\nchannels.channelParticipants#9ab0feaf count:int participants:Vector chats:Vector users:Vector = channels.ChannelParticipants;\nchannels.channelParticipantsNotModified#f0173fe9 = channels.ChannelParticipants;\nchannels.channelParticipant#dfb80317 participant:ChannelParticipant chats:Vector users:Vector = channels.ChannelParticipant;\nhelp.termsOfService#780a0310 flags:# popup:flags.0?true id:DataJSON text:string entities:Vector min_age_confirm:flags.1?int = help.TermsOfService;\nmessages.savedGifsNotModified#e8025ca2 = messages.SavedGifs;\nmessages.savedGifs#2e0709a5 hash:int gifs:Vector = messages.SavedGifs;\ninputBotInlineMessageMediaAuto#3380c786 flags:# message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaGeo#96929a85 flags:# geo_point:InputGeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaVenue#417bbf11 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaContact#a6edbffd flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaInvoice#d7e78225 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineResult#88bf9319 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?InputWebDocument content:flags.5?InputWebDocument send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultDocument#fff8fdc4 flags:# id:string type:string title:flags.1?string description:flags.2?string document:InputDocument send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultGame#4fa417f2 id:string short_name:string send_message:InputBotInlineMessage = InputBotInlineResult;\nbotInlineMessageMediaAuto#764cf810 flags:# message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaGeo#51846fd flags:# geo:GeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaVenue#8a86659c flags:# geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaContact#18d1cdc2 flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaInvoice#354a9b09 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument currency:string total_amount:long reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineResult#11965f3a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?WebDocument content:flags.5?WebDocument send_message:BotInlineMessage = BotInlineResult;\nbotInlineMediaResult#17db940b flags:# id:string type:string photo:flags.0?Photo document:flags.1?Document title:flags.2?string description:flags.3?string send_message:BotInlineMessage = BotInlineResult;\nmessages.botResults#947ca848 flags:# gallery:flags.0?true query_id:long next_offset:flags.1?string switch_pm:flags.2?InlineBotSwitchPM results:Vector cache_time:int users:Vector = messages.BotResults;\nexportedMessageLink#5dab1af4 link:string html:string = ExportedMessageLink;\nmessageFwdHeader#5f777dce flags:# imported:flags.7?true from_id:flags.0?Peer from_name:flags.5?string date:int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int psa_type:flags.6?string = MessageFwdHeader;\nauth.codeTypeSms#72a3158c = auth.CodeType;\nauth.codeTypeCall#741cd3e3 = auth.CodeType;\nauth.codeTypeFlashCall#226ccefb = auth.CodeType;\nauth.sentCodeTypeApp#3dbb5986 length:int = auth.SentCodeType;\nauth.sentCodeTypeSms#c000bba2 length:int = auth.SentCodeType;\nauth.sentCodeTypeCall#5353e5a7 length:int = auth.SentCodeType;\nauth.sentCodeTypeFlashCall#ab03c6d9 pattern:string = auth.SentCodeType;\nmessages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?true native_ui:flags.4?true message:flags.0?string url:flags.2?string cache_time:int = messages.BotCallbackAnswer;\nmessages.messageEditData#26b5dde6 flags:# caption:flags.0?true = messages.MessageEditData;\ninputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID;\ninlineBotSwitchPM#3c20629f text:string start_param:string = InlineBotSwitchPM;\nmessages.peerDialogs#3371c354 dialogs:Vector messages:Vector chats:Vector users:Vector state:updates.State = messages.PeerDialogs;\ntopPeer#edcdc05b peer:Peer rating:double = TopPeer;\ntopPeerCategoryBotsPM#ab661b5b = TopPeerCategory;\ntopPeerCategoryBotsInline#148677e2 = TopPeerCategory;\ntopPeerCategoryCorrespondents#637b7ed = TopPeerCategory;\ntopPeerCategoryGroups#bd17a14a = TopPeerCategory;\ntopPeerCategoryChannels#161d9628 = TopPeerCategory;\ntopPeerCategoryPhoneCalls#1e76a78c = TopPeerCategory;\ntopPeerCategoryForwardUsers#a8406ca9 = TopPeerCategory;\ntopPeerCategoryForwardChats#fbeec0f0 = TopPeerCategory;\ntopPeerCategoryPeers#fb834291 category:TopPeerCategory count:int peers:Vector = TopPeerCategoryPeers;\ncontacts.topPeersNotModified#de266ef5 = contacts.TopPeers;\ncontacts.topPeers#70b772a8 categories:Vector chats:Vector users:Vector = contacts.TopPeers;\ncontacts.topPeersDisabled#b52c939d = contacts.TopPeers;\ndraftMessageEmpty#1b0c841a flags:# date:flags.0?int = DraftMessage;\ndraftMessage#fd8e711f flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int message:string entities:flags.3?Vector date:int = DraftMessage;\nmessages.featuredStickersNotModified#c6dc0c66 count:int = messages.FeaturedStickers;\nmessages.featuredStickers#b6abc341 hash:int count:int sets:Vector unread:Vector = messages.FeaturedStickers;\nmessages.recentStickersNotModified#b17f890 = messages.RecentStickers;\nmessages.recentStickers#22f3afb3 hash:int packs:Vector stickers:Vector dates:Vector = messages.RecentStickers;\nmessages.archivedStickers#4fcba9c8 count:int sets:Vector = messages.ArchivedStickers;\nmessages.stickerSetInstallResultSuccess#38641628 = messages.StickerSetInstallResult;\nmessages.stickerSetInstallResultArchive#35e410a8 sets:Vector = messages.StickerSetInstallResult;\nstickerSetCovered#6410a5d2 set:StickerSet cover:Document = StickerSetCovered;\nstickerSetMultiCovered#3407e51b set:StickerSet covers:Vector = StickerSetCovered;\nmaskCoords#aed6dbb2 n:int x:double y:double zoom:double = MaskCoords;\ninputStickeredMediaPhoto#4a992157 id:InputPhoto = InputStickeredMedia;\ninputStickeredMediaDocument#438865b id:InputDocument = InputStickeredMedia;\ngame#bdf9653b flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document = Game;\ninputGameID#32c3e77 id:long access_hash:long = InputGame;\ninputGameShortName#c331e80a bot_id:InputUser short_name:string = InputGame;\nhighScore#58fffcd0 pos:int user_id:int score:int = HighScore;\nmessages.highScores#9a3bfd99 scores:Vector users:Vector = messages.HighScores;\ntextEmpty#dc3d824f = RichText;\ntextPlain#744694e0 text:string = RichText;\ntextBold#6724abc4 text:RichText = RichText;\ntextItalic#d912a59c text:RichText = RichText;\ntextUnderline#c12622c4 text:RichText = RichText;\ntextStrike#9bf8bb95 text:RichText = RichText;\ntextFixed#6c3f19b9 text:RichText = RichText;\ntextUrl#3c2884c1 text:RichText url:string webpage_id:long = RichText;\ntextEmail#de5a0dd6 text:RichText email:string = RichText;\ntextConcat#7e6260d7 texts:Vector = RichText;\ntextSubscript#ed6a8504 text:RichText = RichText;\ntextSuperscript#c7fb5e01 text:RichText = RichText;\ntextMarked#34b8621 text:RichText = RichText;\ntextPhone#1ccb966a text:RichText phone:string = RichText;\ntextImage#81ccf4f document_id:long w:int h:int = RichText;\ntextAnchor#35553762 text:RichText name:string = RichText;\npageBlockUnsupported#13567e8a = PageBlock;\npageBlockTitle#70abc3fd text:RichText = PageBlock;\npageBlockSubtitle#8ffa9a1f text:RichText = PageBlock;\npageBlockAuthorDate#baafe5e0 author:RichText published_date:int = PageBlock;\npageBlockHeader#bfd064ec text:RichText = PageBlock;\npageBlockSubheader#f12bb6e1 text:RichText = PageBlock;\npageBlockParagraph#467a0766 text:RichText = PageBlock;\npageBlockPreformatted#c070d93e text:RichText language:string = PageBlock;\npageBlockFooter#48870999 text:RichText = PageBlock;\npageBlockDivider#db20b188 = PageBlock;\npageBlockAnchor#ce0d37b0 name:string = PageBlock;\npageBlockList#e4e88011 items:Vector = PageBlock;\npageBlockBlockquote#263d7c26 text:RichText caption:RichText = PageBlock;\npageBlockPullquote#4f4456d3 text:RichText caption:RichText = PageBlock;\npageBlockPhoto#1759c560 flags:# photo_id:long caption:PageCaption url:flags.0?string webpage_id:flags.0?long = PageBlock;\npageBlockVideo#7c8fe7b6 flags:# autoplay:flags.0?true loop:flags.1?true video_id:long caption:PageCaption = PageBlock;\npageBlockCover#39f23300 cover:PageBlock = PageBlock;\npageBlockEmbed#a8718dc5 flags:# full_width:flags.0?true allow_scrolling:flags.3?true url:flags.1?string html:flags.2?string poster_photo_id:flags.4?long w:flags.5?int h:flags.5?int caption:PageCaption = PageBlock;\npageBlockEmbedPost#f259a80b url:string webpage_id:long author_photo_id:long author:string date:int blocks:Vector caption:PageCaption = PageBlock;\npageBlockCollage#65a0fa4d items:Vector caption:PageCaption = PageBlock;\npageBlockSlideshow#31f9590 items:Vector caption:PageCaption = PageBlock;\npageBlockChannel#ef1751b5 channel:Chat = PageBlock;\npageBlockAudio#804361ea audio_id:long caption:PageCaption = PageBlock;\npageBlockKicker#1e148390 text:RichText = PageBlock;\npageBlockTable#bf4dea82 flags:# bordered:flags.0?true striped:flags.1?true title:RichText rows:Vector = PageBlock;\npageBlockOrderedList#9a8ae1e1 items:Vector = PageBlock;\npageBlockDetails#76768bed flags:# open:flags.0?true blocks:Vector title:RichText = PageBlock;\npageBlockRelatedArticles#16115a96 title:RichText articles:Vector = PageBlock;\npageBlockMap#a44f3ef6 geo:GeoPoint zoom:int w:int h:int caption:PageCaption = PageBlock;\nphoneCallDiscardReasonMissed#85e42301 = PhoneCallDiscardReason;\nphoneCallDiscardReasonDisconnect#e095c1a0 = PhoneCallDiscardReason;\nphoneCallDiscardReasonHangup#57adc690 = PhoneCallDiscardReason;\nphoneCallDiscardReasonBusy#faf7e8c9 = PhoneCallDiscardReason;\ndataJSON#7d748d04 data:string = DataJSON;\nlabeledPrice#cb296bf8 label:string amount:long = LabeledPrice;\ninvoice#cd886e0 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true currency:string prices:Vector max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector = Invoice;\npaymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge;\npostAddress#1e8caaeb street_line1:string street_line2:string city:string state:string country_iso2:string post_code:string = PostAddress;\npaymentRequestedInfo#909c3f94 flags:# name:flags.0?string phone:flags.1?string email:flags.2?string shipping_address:flags.3?PostAddress = PaymentRequestedInfo;\npaymentSavedCredentialsCard#cdc27a1f id:string title:string = PaymentSavedCredentials;\nwebDocument#1c570ed1 url:string access_hash:long size:int mime_type:string attributes:Vector = WebDocument;\nwebDocumentNoProxy#f9c8bcc6 url:string size:int mime_type:string attributes:Vector = WebDocument;\ninputWebDocument#9bed434d url:string size:int mime_type:string attributes:Vector = InputWebDocument;\ninputWebFileLocation#c239d686 url:string access_hash:long = InputWebFileLocation;\ninputWebFileGeoPointLocation#9f2221c9 geo_point:InputGeoPoint access_hash:long w:int h:int zoom:int scale:int = InputWebFileLocation;\nupload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile;\npayments.paymentForm#8d0b2415 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector = payments.PaymentForm;\npayments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector = payments.ValidatedRequestedInfo;\npayments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult;\npayments.paymentVerificationNeeded#d8411139 url:string = payments.PaymentResult;\npayments.paymentReceipt#10b555d0 flags:# date:int bot_id:int provider_id:int title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector = payments.PaymentReceipt;\npayments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo;\ninputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;\ninputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;\ninputPaymentCredentialsApplePay#aa1c39f payment_data:DataJSON = InputPaymentCredentials;\ninputPaymentCredentialsGooglePay#8ac32801 payment_token:DataJSON = InputPaymentCredentials;\naccount.tmpPassword#db64fd34 tmp_password:bytes valid_until:int = account.TmpPassword;\nshippingOption#b6213cdf id:string title:string prices:Vector = ShippingOption;\ninputStickerSetItem#ffa0a496 flags:# document:InputDocument emoji:string mask_coords:flags.0?MaskCoords = InputStickerSetItem;\ninputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall;\nphoneCallEmpty#5366c915 id:long = PhoneCall;\nphoneCallWaiting#1b8f4ad1 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall;\nphoneCallRequested#87eabb53 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall;\nphoneCallAccepted#997c454a flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_b:bytes protocol:PhoneCallProtocol = PhoneCall;\nphoneCall#8742ae7f flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector start_date:int = PhoneCall;\nphoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall;\nphoneConnection#9d4c17c0 id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection;\nphoneConnectionWebrtc#635fe375 flags:# turn:flags.0?true stun:flags.1?true id:long ip:string ipv6:string port:int username:string password:string = PhoneConnection;\nphoneCallProtocol#fc878fc8 flags:# udp_p2p:flags.0?true udp_reflector:flags.1?true min_layer:int max_layer:int library_versions:Vector = PhoneCallProtocol;\nphone.phoneCall#ec82e140 phone_call:PhoneCall users:Vector = phone.PhoneCall;\nupload.cdnFileReuploadNeeded#eea8e46e request_token:bytes = upload.CdnFile;\nupload.cdnFile#a99fca4f bytes:bytes = upload.CdnFile;\ncdnPublicKey#c982eaba dc_id:int public_key:string = CdnPublicKey;\ncdnConfig#5725e40a public_keys:Vector = CdnConfig;\nlangPackString#cad181f6 key:string value:string = LangPackString;\nlangPackStringPluralized#6c47ac9f flags:# key:string zero_value:flags.0?string one_value:flags.1?string two_value:flags.2?string few_value:flags.3?string many_value:flags.4?string other_value:string = LangPackString;\nlangPackStringDeleted#2979eeb2 key:string = LangPackString;\nlangPackDifference#f385c1f6 lang_code:string from_version:int version:int strings:Vector = LangPackDifference;\nlangPackLanguage#eeca5ce3 flags:# official:flags.0?true rtl:flags.2?true beta:flags.3?true name:string native_name:string lang_code:string base_lang_code:flags.1?string plural_code:string strings_count:int translated_count:int translations_url:string = LangPackLanguage;\nchannelAdminLogEventActionChangeTitle#e6dfb825 prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeAbout#55188a2e prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeUsername#6a4afc38 prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangePhoto#434bd2af prev_photo:Photo new_photo:Photo = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleInvites#1b7907ae new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleSignatures#26ae0971 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionUpdatePinned#e9e82c18 message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionEditMessage#709b2405 prev_message:Message new_message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDeleteMessage#42e047bb message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantJoin#183040d3 = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantLeave#f89777f2 = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantInvite#e31c34d8 participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantToggleBan#e6d83d7e prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantToggleAdmin#d5676710 prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeStickerSet#b1c3caa7 prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction;\nchannelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDefaultBannedRights#2df5fc0a prev_banned_rights:ChatBannedRights new_banned_rights:ChatBannedRights = ChannelAdminLogEventAction;\nchannelAdminLogEventActionStopPoll#8f079643 message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeLinkedChat#a26f881b prev_value:int new_value:int = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeLocation#e6b76ae prev_value:ChannelLocation new_value:ChannelLocation = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleSlowMode#53909779 prev_value:int new_value:int = ChannelAdminLogEventAction;\nchannelAdminLogEventActionStartGroupCall#23209745 call:InputGroupCall = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDiscardGroupCall#db9f9140 call:InputGroupCall = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantMute#f92424d2 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantUnmute#e64429c0 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleGroupCallSetting#56d6a247 join_muted:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantJoinByInvite#5cdada77 invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteDelete#5a50fca4 invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantVolume#3e7f6847 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeHistoryTTL#6e941a38 prev_value:int new_value:int = ChannelAdminLogEventAction;\nchannelAdminLogEvent#3b5a3e40 id:long date:int user_id:int action:ChannelAdminLogEventAction = ChannelAdminLogEvent;\nchannels.adminLogResults#ed8af74d events:Vector chats:Vector users:Vector = channels.AdminLogResults;\nchannelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true = ChannelAdminLogEventsFilter;\npopularContact#5ce14175 client_id:long importers:int = PopularContact;\nmessages.favedStickersNotModified#9e8fa6d3 = messages.FavedStickers;\nmessages.favedStickers#f37f2f16 hash:int packs:Vector stickers:Vector = messages.FavedStickers;\nrecentMeUrlUnknown#46e1d13d url:string = RecentMeUrl;\nrecentMeUrlUser#8dbc3336 url:string user_id:int = RecentMeUrl;\nrecentMeUrlChat#a01b22f9 url:string chat_id:int = RecentMeUrl;\nrecentMeUrlChatInvite#eb49081d url:string chat_invite:ChatInvite = RecentMeUrl;\nrecentMeUrlStickerSet#bc0a57dc url:string set:StickerSetCovered = RecentMeUrl;\nhelp.recentMeUrls#e0310d7 urls:Vector chats:Vector users:Vector = help.RecentMeUrls;\ninputSingleMedia#1cc6e91f flags:# media:InputMedia random_id:long message:string entities:flags.0?Vector = InputSingleMedia;\nwebAuthorization#cac943f2 hash:long bot_id:int domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization;\naccount.webAuthorizations#ed56c9fc authorizations:Vector users:Vector = account.WebAuthorizations;\ninputMessageID#a676a322 id:int = InputMessage;\ninputMessageReplyTo#bad88395 id:int = InputMessage;\ninputMessagePinned#86872538 = InputMessage;\ninputMessageCallbackQuery#acfa1a7e id:int query_id:long = InputMessage;\ninputDialogPeer#fcaafeb7 peer:InputPeer = InputDialogPeer;\ninputDialogPeerFolder#64600527 folder_id:int = InputDialogPeer;\ndialogPeer#e56dbf05 peer:Peer = DialogPeer;\ndialogPeerFolder#514519e2 folder_id:int = DialogPeer;\nmessages.foundStickerSetsNotModified#d54b65d = messages.FoundStickerSets;\nmessages.foundStickerSets#5108d648 hash:int sets:Vector = messages.FoundStickerSets;\nfileHash#6242c773 offset:int limit:int hash:bytes = FileHash;\ninputClientProxy#75588b3f address:string port:int = InputClientProxy;\nhelp.termsOfServiceUpdateEmpty#e3309f7f expires:int = help.TermsOfServiceUpdate;\nhelp.termsOfServiceUpdate#28ecf961 expires:int terms_of_service:help.TermsOfService = help.TermsOfServiceUpdate;\ninputSecureFileUploaded#3334b0f0 id:long parts:int md5_checksum:string file_hash:bytes secret:bytes = InputSecureFile;\ninputSecureFile#5367e5be id:long access_hash:long = InputSecureFile;\nsecureFileEmpty#64199744 = SecureFile;\nsecureFile#e0277a62 id:long access_hash:long size:int dc_id:int date:int file_hash:bytes secret:bytes = SecureFile;\nsecureData#8aeabec3 data:bytes data_hash:bytes secret:bytes = SecureData;\nsecurePlainPhone#7d6099dd phone:string = SecurePlainData;\nsecurePlainEmail#21ec5a5f email:string = SecurePlainData;\nsecureValueTypePersonalDetails#9d2a81e3 = SecureValueType;\nsecureValueTypePassport#3dac6a00 = SecureValueType;\nsecureValueTypeDriverLicense#6e425c4 = SecureValueType;\nsecureValueTypeIdentityCard#a0d0744b = SecureValueType;\nsecureValueTypeInternalPassport#99a48f23 = SecureValueType;\nsecureValueTypeAddress#cbe31e26 = SecureValueType;\nsecureValueTypeUtilityBill#fc36954e = SecureValueType;\nsecureValueTypeBankStatement#89137c0d = SecureValueType;\nsecureValueTypeRentalAgreement#8b883488 = SecureValueType;\nsecureValueTypePassportRegistration#99e3806a = SecureValueType;\nsecureValueTypeTemporaryRegistration#ea02ec33 = SecureValueType;\nsecureValueTypePhone#b320aadb = SecureValueType;\nsecureValueTypeEmail#8e3ca7ee = SecureValueType;\nsecureValue#187fa0ca flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?SecureFile reverse_side:flags.2?SecureFile selfie:flags.3?SecureFile translation:flags.6?Vector files:flags.4?Vector plain_data:flags.5?SecurePlainData hash:bytes = SecureValue;\ninputSecureValue#db21d0a7 flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?InputSecureFile reverse_side:flags.2?InputSecureFile selfie:flags.3?InputSecureFile translation:flags.6?Vector files:flags.4?Vector plain_data:flags.5?SecurePlainData = InputSecureValue;\nsecureValueHash#ed1ecdb0 type:SecureValueType hash:bytes = SecureValueHash;\nsecureValueErrorData#e8a40bd9 type:SecureValueType data_hash:bytes field:string text:string = SecureValueError;\nsecureValueErrorFrontSide#be3dfa type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorReverseSide#868a2aa5 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorSelfie#e537ced6 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorFile#7a700873 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorFiles#666220e9 type:SecureValueType file_hash:Vector text:string = SecureValueError;\nsecureValueError#869d758f type:SecureValueType hash:bytes text:string = SecureValueError;\nsecureValueErrorTranslationFile#a1144770 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorTranslationFiles#34636dd8 type:SecureValueType file_hash:Vector text:string = SecureValueError;\nsecureCredentialsEncrypted#33f0ea47 data:bytes hash:bytes secret:bytes = SecureCredentialsEncrypted;\naccount.authorizationForm#ad2e1cd8 flags:# required_types:Vector values:Vector errors:Vector users:Vector privacy_policy_url:flags.0?string = account.AuthorizationForm;\naccount.sentEmailCode#811f854f email_pattern:string length:int = account.SentEmailCode;\nhelp.deepLinkInfoEmpty#66afa166 = help.DeepLinkInfo;\nhelp.deepLinkInfo#6a4ee832 flags:# update_app:flags.0?true message:string entities:flags.1?Vector = help.DeepLinkInfo;\nsavedPhoneContact#1142bd56 phone:string first_name:string last_name:string date:int = SavedContact;\naccount.takeout#4dba4501 id:long = account.Takeout;\npasswordKdfAlgoUnknown#d45ab096 = PasswordKdfAlgo;\npasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow#3a912d4a salt1:bytes salt2:bytes g:int p:bytes = PasswordKdfAlgo;\nsecurePasswordKdfAlgoUnknown#4a8537 = SecurePasswordKdfAlgo;\nsecurePasswordKdfAlgoPBKDF2HMACSHA512iter100000#bbf2dda0 salt:bytes = SecurePasswordKdfAlgo;\nsecurePasswordKdfAlgoSHA512#86471d92 salt:bytes = SecurePasswordKdfAlgo;\nsecureSecretSettings#1527bcac secure_algo:SecurePasswordKdfAlgo secure_secret:bytes secure_secret_id:long = SecureSecretSettings;\ninputCheckPasswordEmpty#9880f658 = InputCheckPasswordSRP;\ninputCheckPasswordSRP#d27ff082 srp_id:long A:bytes M1:bytes = InputCheckPasswordSRP;\nsecureRequiredType#829d99da flags:# native_names:flags.0?true selfie_required:flags.1?true translation_required:flags.2?true type:SecureValueType = SecureRequiredType;\nsecureRequiredTypeOneOf#27477b4 types:Vector = SecureRequiredType;\nhelp.passportConfigNotModified#bfb9f457 = help.PassportConfig;\nhelp.passportConfig#a098d6af hash:int countries_langs:DataJSON = help.PassportConfig;\ninputAppEvent#1d1b1245 time:double type:string peer:long data:JSONValue = InputAppEvent;\njsonObjectValue#c0de1bd9 key:string value:JSONValue = JSONObjectValue;\njsonNull#3f6d7b68 = JSONValue;\njsonBool#c7345e6a value:Bool = JSONValue;\njsonNumber#2be0dfa4 value:double = JSONValue;\njsonString#b71e767a value:string = JSONValue;\njsonArray#f7444763 value:Vector = JSONValue;\njsonObject#99c1d49d value:Vector = JSONValue;\npageTableCell#34566b6a flags:# header:flags.0?true align_center:flags.3?true align_right:flags.4?true valign_middle:flags.5?true valign_bottom:flags.6?true text:flags.7?RichText colspan:flags.1?int rowspan:flags.2?int = PageTableCell;\npageTableRow#e0c0c5e5 cells:Vector = PageTableRow;\npageCaption#6f747657 text:RichText credit:RichText = PageCaption;\npageListItemText#b92fb6cd text:RichText = PageListItem;\npageListItemBlocks#25e073fc blocks:Vector = PageListItem;\npageListOrderedItemText#5e068047 num:string text:RichText = PageListOrderedItem;\npageListOrderedItemBlocks#98dd8936 num:string blocks:Vector = PageListOrderedItem;\npageRelatedArticle#b390dc08 flags:# url:string webpage_id:long title:flags.0?string description:flags.1?string photo_id:flags.2?long author:flags.3?string published_date:flags.4?int = PageRelatedArticle;\npage#98657f0d flags:# part:flags.0?true rtl:flags.1?true v2:flags.2?true url:string blocks:Vector photos:Vector documents:Vector views:flags.3?int = Page;\nhelp.supportName#8c05f1c9 name:string = help.SupportName;\nhelp.userInfoEmpty#f3ae2eed = help.UserInfo;\nhelp.userInfo#1eb3758 message:string entities:Vector author:string date:int = help.UserInfo;\npollAnswer#6ca9c2e9 text:string option:bytes = PollAnswer;\npoll#86e18161 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true question:string answers:Vector close_period:flags.4?int close_date:flags.5?int = Poll;\npollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters;\npollResults#badcc1a3 flags:# min:flags.0?true results:flags.1?Vector total_voters:flags.2?int recent_voters:flags.3?Vector solution:flags.4?string solution_entities:flags.4?Vector = PollResults;\nchatOnlines#f041e250 onlines:int = ChatOnlines;\nstatsURL#47a971e0 url:string = StatsURL;\nchatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true = ChatAdminRights;\nchatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true send_polls:flags.8?true change_info:flags.10?true invite_users:flags.15?true pin_messages:flags.17?true until_date:int = ChatBannedRights;\ninputWallPaper#e630b979 id:long access_hash:long = InputWallPaper;\ninputWallPaperSlug#72091c80 slug:string = InputWallPaper;\ninputWallPaperNoFile#967a462e id:long = InputWallPaper;\naccount.wallPapersNotModified#1c199183 = account.WallPapers;\naccount.wallPapers#702b65a9 hash:int wallpapers:Vector = account.WallPapers;\ncodeSettings#debebe83 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true = CodeSettings;\nwallPaperSettings#1dc1bca4 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int third_background_color:flags.5?int fourth_background_color:flags.6?int intensity:flags.3?int rotation:flags.4?int = WallPaperSettings;\nautoDownloadSettings#e04232f3 flags:# disabled:flags.0?true video_preload_large:flags.1?true audio_preload_next:flags.2?true phonecalls_less_data:flags.3?true photo_size_max:int video_size_max:int file_size_max:int video_upload_maxbitrate:int = AutoDownloadSettings;\naccount.autoDownloadSettings#63cacf26 low:AutoDownloadSettings medium:AutoDownloadSettings high:AutoDownloadSettings = account.AutoDownloadSettings;\nemojiKeyword#d5b3b9f9 keyword:string emoticons:Vector = EmojiKeyword;\nemojiKeywordDeleted#236df622 keyword:string emoticons:Vector = EmojiKeyword;\nemojiKeywordsDifference#5cc761bd lang_code:string from_version:int version:int keywords:Vector = EmojiKeywordsDifference;\nemojiURL#a575739d url:string = EmojiURL;\nemojiLanguage#b3fb5361 lang_code:string = EmojiLanguage;\nfolder#ff544e65 flags:# autofill_new_broadcasts:flags.0?true autofill_public_groups:flags.1?true autofill_new_correspondents:flags.2?true id:int title:string photo:flags.3?ChatPhoto = Folder;\ninputFolderPeer#fbd2c296 peer:InputPeer folder_id:int = InputFolderPeer;\nfolderPeer#e9baa668 peer:Peer folder_id:int = FolderPeer;\nmessages.searchCounter#e844ebff flags:# inexact:flags.1?true filter:MessagesFilter count:int = messages.SearchCounter;\nurlAuthResultRequest#92d33a0e flags:# request_write_access:flags.0?true bot:User domain:string = UrlAuthResult;\nurlAuthResultAccepted#8f8c0e4e url:string = UrlAuthResult;\nurlAuthResultDefault#a9d6db1f = UrlAuthResult;\nchannelLocationEmpty#bfb5ad8b = ChannelLocation;\nchannelLocation#209b82db geo_point:GeoPoint address:string = ChannelLocation;\npeerLocated#ca461b5d peer:Peer expires:int distance:int = PeerLocated;\npeerSelfLocated#f8ec284b expires:int = PeerLocated;\nrestrictionReason#d072acb4 platform:string reason:string text:string = RestrictionReason;\ninputTheme#3c5693e9 id:long access_hash:long = InputTheme;\ninputThemeSlug#f5890df1 slug:string = InputTheme;\ntheme#28f1114 flags:# creator:flags.0?true default:flags.1?true id:long access_hash:long slug:string title:string document:flags.2?Document settings:flags.3?ThemeSettings installs_count:int = Theme;\naccount.themesNotModified#f41eb622 = account.Themes;\naccount.themes#7f676421 hash:int themes:Vector = account.Themes;\nauth.loginToken#629f1980 expires:int token:bytes = auth.LoginToken;\nauth.loginTokenMigrateTo#68e9916 dc_id:int token:bytes = auth.LoginToken;\nauth.loginTokenSuccess#390d5c5e authorization:auth.Authorization = auth.LoginToken;\naccount.contentSettings#57e28221 flags:# sensitive_enabled:flags.0?true sensitive_can_change:flags.1?true = account.ContentSettings;\nmessages.inactiveChats#a927fec5 dates:Vector chats:Vector users:Vector = messages.InactiveChats;\nbaseThemeClassic#c3a12462 = BaseTheme;\nbaseThemeDay#fbd81688 = BaseTheme;\nbaseThemeNight#b7b31ea8 = BaseTheme;\nbaseThemeTinted#6d5f77ee = BaseTheme;\nbaseThemeArctic#5b11125a = BaseTheme;\ninputThemeSettings#bd507cd1 flags:# base_theme:BaseTheme accent_color:int message_top_color:flags.0?int message_bottom_color:flags.0?int wallpaper:flags.1?InputWallPaper wallpaper_settings:flags.1?WallPaperSettings = InputThemeSettings;\nthemeSettings#9c14984a flags:# base_theme:BaseTheme accent_color:int message_top_color:flags.0?int message_bottom_color:flags.0?int wallpaper:flags.1?WallPaper = ThemeSettings;\nwebPageAttributeTheme#54b56617 flags:# documents:flags.0?Vector settings:flags.1?ThemeSettings = WebPageAttribute;\nmessageUserVote#a28e5559 user_id:int option:bytes date:int = MessageUserVote;\nmessageUserVoteInputOption#36377430 user_id:int date:int = MessageUserVote;\nmessageUserVoteMultiple#e8fe0de user_id:int options:Vector date:int = MessageUserVote;\nmessages.votesList#823f649 flags:# count:int votes:Vector users:Vector next_offset:flags.0?string = messages.VotesList;\nbankCardOpenUrl#f568028a url:string name:string = BankCardOpenUrl;\npayments.bankCardData#3e24e573 title:string open_urls:Vector = payments.BankCardData;\ndialogFilter#7438f7e8 flags:# contacts:flags.0?true non_contacts:flags.1?true groups:flags.2?true broadcasts:flags.3?true bots:flags.4?true exclude_muted:flags.11?true exclude_read:flags.12?true exclude_archived:flags.13?true id:int title:string emoticon:flags.25?string pinned_peers:Vector include_peers:Vector exclude_peers:Vector = DialogFilter;\ndialogFilterSuggested#77744d4a filter:DialogFilter description:string = DialogFilterSuggested;\nstatsDateRangeDays#b637edaf min_date:int max_date:int = StatsDateRangeDays;\nstatsAbsValueAndPrev#cb43acde current:double previous:double = StatsAbsValueAndPrev;\nstatsPercentValue#cbce2fe0 part:double total:double = StatsPercentValue;\nstatsGraphAsync#4a27eb2d token:string = StatsGraph;\nstatsGraphError#bedc9822 error:string = StatsGraph;\nstatsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph;\nmessageInteractionCounters#ad4fc9bd msg_id:int views:int forwards:int = MessageInteractionCounters;\nstats.broadcastStats#bdf78394 period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post:StatsAbsValueAndPrev enabled_notifications:StatsPercentValue growth_graph:StatsGraph followers_graph:StatsGraph mute_graph:StatsGraph top_hours_graph:StatsGraph interactions_graph:StatsGraph iv_interactions_graph:StatsGraph views_by_source_graph:StatsGraph new_followers_by_source_graph:StatsGraph languages_graph:StatsGraph recent_message_interactions:Vector = stats.BroadcastStats;\nhelp.promoDataEmpty#98f6ac75 expires:int = help.PromoData;\nhelp.promoData#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:Vector users:Vector psa_type:flags.1?string psa_message:flags.2?string = help.PromoData;\nvideoSize#de33b094 flags:# type:string w:int h:int size:int video_start_ts:flags.0?double = VideoSize;\nstatsGroupTopPoster#18f3d0f7 user_id:int messages:int avg_chars:int = StatsGroupTopPoster;\nstatsGroupTopAdmin#6014f412 user_id:int deleted:int kicked:int banned:int = StatsGroupTopAdmin;\nstatsGroupTopInviter#31962a4c user_id:int invitations:int = StatsGroupTopInviter;\nstats.megagroupStats#ef7ff916 period:StatsDateRangeDays members:StatsAbsValueAndPrev messages:StatsAbsValueAndPrev viewers:StatsAbsValueAndPrev posters:StatsAbsValueAndPrev growth_graph:StatsGraph members_graph:StatsGraph new_members_by_source_graph:StatsGraph languages_graph:StatsGraph messages_graph:StatsGraph actions_graph:StatsGraph top_hours_graph:StatsGraph weekdays_graph:StatsGraph top_posters:Vector top_admins:Vector top_inviters:Vector users:Vector = stats.MegagroupStats;\nglobalPrivacySettings#bea2f424 flags:# archive_and_mute_new_noncontact_peers:flags.0?Bool = GlobalPrivacySettings;\nhelp.countryCode#4203c5ef flags:# country_code:string prefixes:flags.0?Vector patterns:flags.1?Vector = help.CountryCode;\nhelp.country#c3878e23 flags:# hidden:flags.0?true iso2:string default_name:string name:flags.1?string country_codes:Vector = help.Country;\nhelp.countriesListNotModified#93cc1f32 = help.CountriesList;\nhelp.countriesList#87d0759e countries:Vector hash:int = help.CountriesList;\nmessageViews#455b853d flags:# views:flags.0?int forwards:flags.1?int replies:flags.2?MessageReplies = MessageViews;\nmessages.messageViews#b6c4f543 views:Vector chats:Vector users:Vector = messages.MessageViews;\nmessages.discussionMessage#f5dd8f9d flags:# messages:Vector max_id:flags.0?int read_inbox_max_id:flags.1?int read_outbox_max_id:flags.2?int chats:Vector users:Vector = messages.DiscussionMessage;\nmessageReplyHeader#a6d57763 flags:# reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader;\nmessageReplies#4128faac flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector channel_id:flags.0?int max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;\npeerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked;\nstats.messageStats#8999f295 views_graph:StatsGraph = stats.MessageStats;\ngroupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall;\ngroupCall#d597650c flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int = GroupCall;\ninputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;\ngroupCallParticipant#eba636fe flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo = GroupCallParticipant;\nphone.groupCall#9e727aad call:GroupCall participants:Vector participants_next_offset:string chats:Vector users:Vector = phone.GroupCall;\nphone.groupParticipants#f47751b6 count:int participants:Vector next_offset:string chats:Vector users:Vector version:int = phone.GroupParticipants;\ninlineQueryPeerTypeSameBotPM#3081ed9d = InlineQueryPeerType;\ninlineQueryPeerTypePM#833c0fac = InlineQueryPeerType;\ninlineQueryPeerTypeChat#d766c50a = InlineQueryPeerType;\ninlineQueryPeerTypeMegagroup#5ec4be43 = InlineQueryPeerType;\ninlineQueryPeerTypeBroadcast#6334ee9a = InlineQueryPeerType;\nmessages.historyImport#1662af0b id:long = messages.HistoryImport;\nmessages.historyImportParsed#5e0fb7b9 flags:# pm:flags.0?true group:flags.1?true title:flags.2?string = messages.HistoryImportParsed;\nmessages.affectedFoundMessages#ef8d3e6c pts:int pts_count:int offset:int messages:Vector = messages.AffectedFoundMessages;\nchatInviteImporter#1e3e6680 user_id:int date:int = ChatInviteImporter;\nmessages.exportedChatInvites#bdc62dcc count:int invites:Vector users:Vector = messages.ExportedChatInvites;\nmessages.exportedChatInvite#1871be50 invite:ExportedChatInvite users:Vector = messages.ExportedChatInvite;\nmessages.exportedChatInviteReplaced#222600ef invite:ExportedChatInvite new_invite:ExportedChatInvite users:Vector = messages.ExportedChatInvite;\nmessages.chatInviteImporters#81b6b00a count:int importers:Vector users:Vector = messages.ChatInviteImporters;\nchatAdminWithInvites#dfd2330f admin_id:int invites_count:int revoked_invites_count:int = ChatAdminWithInvites;\nmessages.chatAdminsWithInvites#b69b72d7 admins:Vector users:Vector = messages.ChatAdminsWithInvites;\nmessages.checkedHistoryImportPeer#a24de717 confirm_text:string = messages.CheckedHistoryImportPeer;\nphone.joinAsPeers#afe5623f peers:Vector chats:Vector users:Vector = phone.JoinAsPeers;\nphone.exportedGroupCallInvite#204bd158 link:string = phone.ExportedGroupCallInvite;\ngroupCallParticipantVideoSourceGroup#dcb118b7 semantics:string sources:Vector = GroupCallParticipantVideoSourceGroup;\ngroupCallParticipantVideo#67753ac8 flags:# paused:flags.0?true endpoint:string source_groups:Vector audio_source:flags.1?int = GroupCallParticipantVideo;\nstickers.suggestedShortName#85fea03f short_name:string = stickers.SuggestedShortName;\nbotCommandScopeDefault#2f6cb2ab = BotCommandScope;\nbotCommandScopeUsers#3c4f04d8 = BotCommandScope;\nbotCommandScopeChats#6fe1a881 = BotCommandScope;\nbotCommandScopeChatAdmins#b9aa606a = BotCommandScope;\nbotCommandScopePeer#db9d897d peer:InputPeer = BotCommandScope;\nbotCommandScopePeerAdmins#3fd863d1 peer:InputPeer = BotCommandScope;\nbotCommandScopePeerUser#a1321f3 peer:InputPeer user_id:InputUser = BotCommandScope;\naccount.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordResult;\naccount.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult;\naccount.resetPasswordOk#e926d63e = account.ResetPasswordResult;\n---functions---\ninitConnection#c1cd5ea9 {X:Type} flags:# api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string proxy:flags.0?InputClientProxy params:flags.1?JSONValue query:!X = X;\ninvokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;\nauth.sendCode#a677244f phone_number:string api_id:int api_hash:string settings:CodeSettings = auth.SentCode;\nauth.signUp#80eee427 phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization;\nauth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;\nauth.logOut#5717da40 = Bool;\nauth.resetAuthorizations#9fab0d1a = Bool;\nauth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;\nauth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;\nauth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;\nauth.checkPassword#d18b4d16 password:InputCheckPasswordSRP = auth.Authorization;\nauth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery;\nauth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode;\nauth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool;\nauth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector = Bool;\nauth.exportLoginToken#b1b41517 api_id:int api_hash:string except_ids:Vector = auth.LoginToken;\nauth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken;\naccount.registerDevice#68976c6f flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector = Bool;\naccount.unregisterDevice#3076c4bf token_type:int token:string other_uids:Vector = Bool;\naccount.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;\naccount.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;\naccount.updateProfile#78515775 flags:# first_name:flags.0?string last_name:flags.1?string about:flags.2?string = User;\naccount.updateStatus#6628562c offline:Bool = Bool;\naccount.getWallPapers#aabb1763 hash:int = account.WallPapers;\naccount.checkUsername#2714d86c username:string = Bool;\naccount.updateUsername#3e0bdd7c username:string = User;\naccount.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;\naccount.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector = account.PrivacyRules;\naccount.getAuthorizations#e320c158 = account.Authorizations;\naccount.resetAuthorization#df77f3bc hash:long = Bool;\naccount.getPassword#548a30f5 = account.Password;\naccount.getPasswordSettings#9cd4eaf9 password:InputCheckPasswordSRP = account.PasswordSettings;\naccount.updatePasswordSettings#a59b102f password:InputCheckPasswordSRP new_settings:account.PasswordInputSettings = Bool;\naccount.sendConfirmPhoneCode#1b3faa88 hash:string settings:CodeSettings = auth.SentCode;\naccount.confirmPhone#5f2178c3 phone_code_hash:string phone_code:string = Bool;\naccount.getTmpPassword#449e0b51 password:InputCheckPasswordSRP period:int = account.TmpPassword;\naccount.sendVerifyPhoneCode#a5a356f9 phone_number:string settings:CodeSettings = auth.SentCode;\naccount.confirmPasswordEmail#8fdf1920 code:string = Bool;\naccount.getContactSignUpNotification#9f07c728 = Bool;\naccount.setContactSignUpNotification#cff43f61 silent:Bool = Bool;\naccount.getNotifyExceptions#53577479 flags:# compare_sound:flags.1?true peer:flags.0?InputNotifyPeer = Updates;\naccount.uploadWallPaper#dd853661 file:InputFile mime_type:string settings:WallPaperSettings = WallPaper;\naccount.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool;\naccount.getContentSettings#8b9b4dae = account.ContentSettings;\nusers.getUsers#d91a548 id:Vector = Vector;\nusers.getFullUser#ca30a5b1 id:InputUser = UserFull;\ncontacts.getContacts#c023849f hash:int = contacts.Contacts;\ncontacts.importContacts#2c800be5 contacts:Vector = contacts.ImportedContacts;\ncontacts.deleteContacts#96a0e00 id:Vector = Updates;\ncontacts.block#68cc1411 id:InputPeer = Bool;\ncontacts.unblock#bea65d50 id:InputPeer = Bool;\ncontacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;\ncontacts.search#11f812d8 q:string limit:int = contacts.Found;\ncontacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;\ncontacts.getTopPeers#d4982db5 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:int = contacts.TopPeers;\nmessages.getMessages#63c66506 id:Vector = messages.Messages;\nmessages.getDialogs#a0ee3b73 flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:int = messages.Dialogs;\nmessages.getHistory#dcbb8260 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;\nmessages.search#c352eec flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;\nmessages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages;\nmessages.deleteHistory#1c015b09 flags:# just_clear:flags.0?true revoke:flags.1?true peer:InputPeer max_id:int = messages.AffectedHistory;\nmessages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector = messages.AffectedMessages;\nmessages.receivedMessages#5a954c0 max_id:int = Vector;\nmessages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool;\nmessages.sendMessage#520c3870 flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int = Updates;\nmessages.sendMedia#3491eba9 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int = Updates;\nmessages.forwardMessages#d9fee60e flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true from_peer:InputPeer id:Vector random_id:Vector to_peer:InputPeer schedule_date:flags.10?int = Updates;\nmessages.report#8953ab4e peer:InputPeer id:Vector reason:ReportReason message:string = Bool;\nmessages.getChats#3c6aa187 id:Vector = messages.Chats;\nmessages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;\nmessages.editChatTitle#dc452855 chat_id:int title:string = Updates;\nmessages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates;\nmessages.addChatUser#f9a0aa09 chat_id:int user_id:InputUser fwd_limit:int = Updates;\nmessages.deleteChatUser#c534459a flags:# revoke_history:flags.0?true chat_id:int user_id:InputUser = Updates;\nmessages.createChat#9cb126e users:Vector title:string = Updates;\nmessages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;\nmessages.readMessageContents#36a73f77 id:Vector = messages.AffectedMessages;\nmessages.getStickers#43d4f2c emoticon:string hash:int = messages.Stickers;\nmessages.getAllStickers#1c9618b1 hash:int = messages.AllStickers;\nmessages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector = MessageMedia;\nmessages.exportChatInvite#14b9bcd7 flags:# legacy_revoke_permanent:flags.2?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int = ExportedChatInvite;\nmessages.checkChatInvite#3eadb1bb hash:string = ChatInvite;\nmessages.importChatInvite#6c50051c hash:string = Updates;\nmessages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;\nmessages.installStickerSet#c78fe460 stickerset:InputStickerSet archived:Bool = messages.StickerSetInstallResult;\nmessages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;\nmessages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_param:string = Updates;\nmessages.migrateChat#15a3b8e3 chat_id:int = Updates;\nmessages.searchGlobal#4bc6589a flags:# folder_id:flags.0?int q:string filter:MessagesFilter min_date:int max_date:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;\nmessages.getDocumentByHash#338e2464 sha256:bytes size:int mime_type:string = Document;\nmessages.getSavedGifs#83bf3d52 hash:int = messages.SavedGifs;\nmessages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults;\nmessages.sendInlineBotResult#220815b0 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string schedule_date:flags.10?int = Updates;\nmessages.editMessage#48f71778 flags:# no_webpage:flags.1?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.15?int = Updates;\nmessages.getBotCallbackAnswer#9342ca07 flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes password:flags.2?InputCheckPasswordSRP = messages.BotCallbackAnswer;\nmessages.getPeerDialogs#e470bcfd peers:Vector = messages.PeerDialogs;\nmessages.saveDraft#bc39e14b flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int peer:InputPeer message:string entities:flags.3?Vector = Bool;\nmessages.getFeaturedStickers#2dacca4f hash:int = messages.FeaturedStickers;\nmessages.readFeaturedStickers#5b118126 id:Vector = Bool;\nmessages.getRecentStickers#5ea192c9 flags:# attached:flags.0?true hash:int = messages.RecentStickers;\nmessages.getWebPage#32ca8f91 url:string hash:int = WebPage;\nmessages.toggleDialogPin#a731e257 flags:# pinned:flags.0?true peer:InputDialogPeer = Bool;\nmessages.getPinnedDialogs#d6b94df2 folder_id:int = messages.PeerDialogs;\nmessages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia;\nmessages.getFavedStickers#21ce0b0e hash:int = messages.FavedStickers;\nmessages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool;\nmessages.sendMultiMedia#cc0110cb flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector schedule_date:flags.10?int = Updates;\nmessages.searchStickerSets#c2b7d08b flags:# exclude_featured:flags.0?true q:string hash:int = messages.FoundStickerSets;\nmessages.markDialogUnread#c286d98f flags:# unread:flags.0?true peer:InputDialogPeer = Bool;\nmessages.updatePinnedMessage#d2aaf7ec flags:# silent:flags.0?true unpin:flags.1?true pm_oneside:flags.2?true peer:InputPeer id:int = Updates;\nmessages.sendVote#10ea6184 peer:InputPeer msg_id:int options:Vector = Updates;\nmessages.getOnlines#6e2be050 peer:InputPeer = ChatOnlines;\nmessages.editChatAbout#def60797 peer:InputPeer about:string = Bool;\nmessages.editChatDefaultBannedRights#a5866b41 peer:InputPeer banned_rights:ChatBannedRights = Updates;\nmessages.getEmojiKeywordsDifference#1508b6af lang_code:string from_version:int = EmojiKeywordsDifference;\nmessages.getScheduledHistory#e2c2685b peer:InputPeer hash:int = messages.Messages;\nmessages.sendScheduledMessages#bd38850a peer:InputPeer id:Vector = Updates;\nmessages.deleteScheduledMessages#59ae2b16 peer:InputPeer id:Vector = Updates;\nmessages.getPollVotes#b86e380e flags:# peer:InputPeer id:int option:flags.0?bytes offset:flags.1?string limit:int = messages.VotesList;\nmessages.getDialogFilters#f19ed96d = Vector;\nmessages.getSuggestedDialogFilters#a29cd42c = Vector;\nmessages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter = Bool;\nmessages.getReplies#24b581ba peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;\nmessages.getDiscussionMessage#446972fd peer:InputPeer msg_id:int = messages.DiscussionMessage;\nmessages.readDiscussion#f731a9f4 peer:InputPeer msg_id:int read_max_id:int = Bool;\nmessages.unpinAllMessages#f025bc8b peer:InputPeer = messages.AffectedHistory;\nmessages.deleteChat#83247d11 chat_id:int = Bool;\nupdates.getState#edd4882a = updates.State;\nupdates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;\nupdates.getChannelDifference#3173d78 flags:# force:flags.0?true channel:InputChannel filter:ChannelMessagesFilter pts:int limit:int = updates.ChannelDifference;\nphotos.uploadProfilePhoto#89f30f69 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = photos.Photo;\nphotos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int = photos.Photos;\nupload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;\nupload.getFile#b15a9afc flags:# precise:flags.0?true cdn_supported:flags.1?true location:InputFileLocation offset:int limit:int = upload.File;\nupload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;\nupload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile;\nhelp.getConfig#c4f9186b = Config;\nhelp.getNearestDc#1fb33026 = NearestDc;\nhelp.getSupport#9cdf08cd = help.Support;\nhelp.acceptTermsOfService#ee72f79a id:DataJSON = Bool;\nchannels.readHistory#cc104937 channel:InputChannel max_id:int = Bool;\nchannels.deleteMessages#84c1fd4e channel:InputChannel id:Vector = messages.AffectedMessages;\nchannels.getMessages#ad8c9a23 channel:InputChannel id:Vector = messages.Messages;\nchannels.getParticipants#123e05e9 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:int = channels.ChannelParticipants;\nchannels.getParticipant#a0ab6cc6 channel:InputChannel participant:InputPeer = channels.ChannelParticipant;\nchannels.getChannels#a7f6bbb id:Vector = messages.Chats;\nchannels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull;\nchannels.createChannel#3d5fb10f flags:# broadcast:flags.0?true megagroup:flags.1?true for_import:flags.3?true title:string about:string geo_point:flags.2?InputGeoPoint address:flags.2?string = Updates;\nchannels.editAdmin#d33c8902 channel:InputChannel user_id:InputUser admin_rights:ChatAdminRights rank:string = Updates;\nchannels.editTitle#566decd0 channel:InputChannel title:string = Updates;\nchannels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates;\nchannels.checkUsername#10e6bd2c channel:InputChannel username:string = Bool;\nchannels.updateUsername#3514b3de channel:InputChannel username:string = Bool;\nchannels.joinChannel#24b524c5 channel:InputChannel = Updates;\nchannels.leaveChannel#f836aa95 channel:InputChannel = Updates;\nchannels.inviteToChannel#199f3a6c channel:InputChannel users:Vector = Updates;\nchannels.deleteChannel#c0111fe3 channel:InputChannel = Updates;\nchannels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates;\nchannels.editBanned#96e6cd81 channel:InputChannel participant:InputPeer banned_rights:ChatBannedRights = Updates;\nchannels.readMessageContents#eab5dc38 channel:InputChannel id:Vector = Bool;\nchannels.togglePreHistoryHidden#eabbb94c channel:InputChannel enabled:Bool = Updates;\nchannels.getGroupsForDiscussion#f5dad378 = messages.Chats;\nchannels.setDiscussionGroup#40582bb2 broadcast:InputChannel group:InputChannel = Bool;\npayments.getPaymentForm#8a333c8d flags:# peer:InputPeer msg_id:int theme_params:flags.0?DataJSON = payments.PaymentForm;\npayments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt;\npayments.validateRequestedInfo#db103170 flags:# save:flags.0?true peer:InputPeer msg_id:int info:PaymentRequestedInfo = payments.ValidatedRequestedInfo;\npayments.sendPaymentForm#30c3bc9d flags:# form_id:long peer:InputPeer msg_id:int requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials tip_amount:flags.2?long = payments.PaymentResult;\npayments.getSavedInfo#227d824b = payments.SavedInfo;\nlangpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference;\nlangpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector = Vector;\nlangpack.getLanguages#42c6978f lang_pack:string = Vector;\nfolders.editPeerFolders#6847d0ab folder_peers:Vector = Updates;\n"},8963:(e,t,n)=>{var s=n(8764).Buffer;function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{inflate:i}=n(5802),{serializeBytes:r}=n(7404);class o{constructor(e){this.data=e,this.CONSTRUCTOR_ID=812830625,this.classType="constructor"}static async gzipIfSmaller(e,t){if(e&&t.length>512){const e=await new o(t).toBytes();if(e.length{function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=n(355);class i{constructor(e){this.CONSTRUCTOR_ID=1945237724,this.messages=e,this.classType="constructor"}static fromReader(e){const t=[],n=e.readInt();for(let s=0;s{function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{RpcError:a}=n(7404).constructors,i=n(8963);class r{constructor(e,t,n){this.CONSTRUCTOR_ID=4082920705,this.reqMsgId=e,this.body=t,this.error=n,this.classType="constructor"}static async fromReader(e){const t=e.readLong(),n=e.readInt(!1);return n===a.CONSTRUCTOR_ID?new r(t,void 0,a.fromReader(e)):n===i.CONSTRUCTOR_ID?new r(t,(await i.fromReader(e)).data):(e.seek(-4),new r(t,e.read(),void 0))}}s(r,"CONSTRUCTOR_ID",4082920705),s(r,"classType","constructor"),e.exports=r},355:e=>{function t(e,t,n){return t 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.msgId=e,this.seqNo=t,this.obj=n,this.classType="constructor"}}t(n,"SIZE_OVERHEAD",12),t(n,"classType","constructor"),e.exports=n},2058:(e,t,n)=>{const s=n(355),a=n(2301),i=n(3254),r=n(8963),o={[a.CONSTRUCTOR_ID]:a,[r.CONSTRUCTOR_ID]:r,[i.CONSTRUCTOR_ID]:i};e.exports={TLMessage:s,RPCResult:a,MessageContainer:i,GZIPPacked:r,coreObjects:o}},1436:(e,t,n)=>{var s=n(8764).Buffer;const a=e=>e.replace(/(?:^|_)([a-z])/g,((e,t)=>t.toUpperCase())).replace(/_/g,""),i=e=>e.replace(/([-_][a-z])/g,(e=>e.toUpperCase().replace("-","").replace("_",""))),r=new Set([3162085175,2574415285,1072550713,3300522427,1450380236]),o=new Set([85337187,2211011308,2851430293,1013613780,1459478408,3504867164,3045658042,1715713620,3608339646,4110704415,812830625]);let c;function d(e){c||(c=function(){let e;const t=[];for(let n=0;n<256;n++){e=n;for(let t=0;t<8;t++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}()),s.isBuffer(e)||(e=s.from(e));let t=-1;for(let n=0;n>>8}return(-1^t)>>>0}const l=(e,t,n=[])=>{e.flags.includes("g")||(e=new RegExp(e.source,"g"));const s=e.exec(t);return s&&(n.push(s.slice(1)),l(e,t,n)),n},u=(e,t)=>{const n=e.match(/([\w.]+)(?:#([0-9a-fA-F]+))?(?:\s{?\w+:[\w\d<>#.?!]+}?)*\s=\s([\w\d<>#.?]+);$/);if(!n)throw new Error(`Cannot parse TLObject ${e}`);const r=l(/({)?(\w+):([\w\d<>#.?!]+)}?/,e),o={name:n[1],constructorId:parseInt(n[2],16),argsConfig:{},subclassOfId:d(n[3]),result:n[3],isFunction:t,namespace:void 0};if(!o.constructorId){const e="";let t;t=Object.values(o.argsConfig).length?` ${Object.keys(o.argsConfig).map((e=>e.toString())).join(" ")}`:"";const n=`${o.name}${e}${t} = ${o.result}`.replace(/(:|\?)bytes /g,"$1string ").replace(/|{|}/g,"").replace(/ \w+:flags\.\d+\?true/g,"");"inputMediaInvoice"===o.name&&o.name,o.constructorId=d(s.from(n,"utf8"))}for(const[e,t,n]of r)void 0===e&&(o.argsConfig[i(t)]=g(t,n));return o.name.includes(".")&&([o.namespace,o.name]=o.name.split(/\.(.+)/)),o.name=a(o.name),o};function g(e,t){e="self"===e?"is_self":e;const n={isVector:!1,isFlag:!1,skipConstructorId:!1,flagIndex:-1,flagIndicator:!0,type:void 0,useVectorId:void 0};if("#"!==t){n.flagIndicator=!1,n.type=t.replace(/^!+/,"");const e=n.type.match(/flags.(\d+)\?([\w<>.]+)/);e&&(n.isFlag=!0,n.flagIndex=Number(e[1]),[,,n.type]=e);const s=n.type.match(/[Vv]ector<([\w\d.]+)>/);s&&(n.isVector=!0,n.useVectorId="V"===n.type.charAt(0),[,n.type]=s),/^[a-z]$/.test(n.type.split(".").pop().charAt(0))&&(n.skipConstructorId=!0)}return n}e.exports={findAll:l,parseTl:function*(e,t,n=[],s=r){(n||[]).reduce(((e,t)=>({...e,[t.name]:t})),{});const a=[],i={},c={},d=e;let l=!1;for(let e of d.split("\n")){const t=e.indexOf("//");if(-1!==t&&(e=e.slice(0,t)),e=e.trim(),!e)continue;const n=e.match(/---(\w+)---/);if(n){const[,e]=n;l="functions"===e}else try{const t=u(e,l);if(s.has(t.constructorId))continue;a.push(t),t.isFunction||(c[t.result]||(c[t.result]=[]),i[t.name]=t,c[t.result].push(t))}catch(e){if(!e.toString().includes("vector#1cb5c415"))throw e}}for(const e of a)if(o.has(e.constructorId))for(const t in e.argsConfig)"string"===e.argsConfig[t].type&&(e.argsConfig[t].type="bytes");for(const e of a)yield e},buildArgConfig:g,fromLine:u,CORE_TYPES:r,serializeDate:function(e){if(!e)return s.alloc(4).fill(0);if(e instanceof Date&&(e=Math.floor((Date.now()-e.getTime())/1e3)),"number"==typeof e){const t=s.alloc(4);return t.writeInt32LE(e,0),t}throw Error(`Cannot interpret "${e}" as a date`)},serializeBytes:function(e){if(!(e instanceof s)){if("string"!=typeof e)throw Error(`Bytes or str expected, not ${e.constructor.name}`);e=s.from(e)}const t=[];let n;return e.length<254?(n=(e.length+1)%4,0!==n&&(n=4-n),t.push(s.from([e.length])),t.push(e)):(n=e.length%4,0!==n&&(n=4-n),t.push(s.from([254,e.length%256,(e.length>>8)%256,(e.length>>16)%256])),t.push(e)),t.push(s.alloc(n).fill(0)),s.concat(t)},snakeToCamelCase:a,variableSnakeToCamelCase:i}},7404:(e,t,n)=>{const s=n(7150),{serializeBytes:a,serializeDate:i}=n(1436);e.exports={constructors:s,requests:s,serializeBytes:a,serializeDate:i}},8106:e=>{e.exports="resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector = ResPQ;\np_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data;\nserver_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params;\nserver_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;\nserver_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;\nclient_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;\ndh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;\ndh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer;\ndh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;\ndestroy_auth_key_ok#f660e1d4 = DestroyAuthKeyRes;\ndestroy_auth_key_none#0a9f2259 = DestroyAuthKeyRes;\ndestroy_auth_key_fail#ea109b13 = DestroyAuthKeyRes;\n---functions---\nreq_pq#60469778 nonce:int128 = ResPQ;\nreq_pq_multi#be7e8ef1 nonce:int128 = ResPQ;\nreq_pq_multi_new#51b410fd nonce:int128 = ResPQ;\nreq_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;\nset_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;\ndestroy_auth_key#d1435160 = DestroyAuthKeyRes;\n---types---\nmsgs_ack#62d6b459 msg_ids:Vector = MsgsAck;\nbad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int error_code:int = BadMsgNotification;\nbad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_server_salt:long = BadMsgNotification;\nmsgs_state_req#da69fb52 msg_ids:Vector = MsgsStateReq;\nmsgs_state_info#04deb57d req_msg_id:long info:string = MsgsStateInfo;\nmsgs_all_info#8cc0d131 msg_ids:Vector info:string = MsgsAllInfo;\nmsg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\nmsg_new_detailed_info#809db6df answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\nmsg_resend_req#7d861a08 msg_ids:Vector = MsgResendReq;\nrpc_error#2144ca19 error_code:int error_message:string = RpcError;\nfuture_salt#0949d9dc valid_since:int valid_until:int salt:long = FutureSalt;\nfuture_salts#ae500895 req_msg_id:long now:int salts:vector = FutureSalts;\npong#347773c5 msg_id:long ping_id:long = Pong;\ndestroy_session_ok#e22045fc session_id:long = DestroySessionRes;\ndestroy_session_none#62d350c9 session_id:long = DestroySessionRes;\nnew_session_created#9ec20908 first_msg_id:long unique_id:long server_salt:long = NewSession;\n---functions---\nping#7abe77ec ping_id:long = Pong;\nping_delay_disconnect#f3427b8c ping_id:long disconnect_delay:int = Pong;"}},s={};function a(e){var t=s[e];if(void 0!==t)return t.exports;var i=s[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,a),i.loaded=!0,i.exports}a.m=n,a.x=()=>{var e=a.O(void 0,[592],(()=>a(6514)));return a.O(e)},e=[],a.O=(t,n,s,i)=>{if(!n){var r=1/0;for(l=0;l=i)&&Object.keys(a.O).every((e=>a.O[e](n[c])))?n.splice(c--,1):(o=!1,i0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[n,s,i]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,n)=>(a.f[n](e,t),t)),[])),a.u=e=>e+".d7ca037ed9b7d1c6792a.js",a.miniCssF=e=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={514:1};a.f.i=(t,n)=>{e[t]||importScripts(a.p+a.u(t))};var t=self.webpackChunktelegram_t=self.webpackChunktelegram_t||[],n=t.push.bind(t);t.push=t=>{var[s,i,r]=t;for(var o in i)a.o(i,o)&&(a.m[o]=i[o]);for(r&&r(a);s.length;)e[s.pop()]=1;n(t)}})(),t=a.x,a.x=()=>a.e(592).then(t),a.x()})(); -//# sourceMappingURL=514.c2aea8c517396debc7b4.js.map \ No newline at end of file diff --git a/dist/514.c2aea8c517396debc7b4.js.map b/dist/514.c2aea8c517396debc7b4.js.map deleted file mode 100644 index 4e773121..00000000 --- a/dist/514.c2aea8c517396debc7b4.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"514.c2aea8c517396debc7b4.js","mappings":"UAAIA,ECAAC,E,q/GCAG,MAiGMC,GA3DyB,oBAAXC,QAA0BA,OAAOC,YA2DzBC,KAAKC,MAAM,MACjCC,EAA6B,IAAIC,IAAI,CAChD,a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,IAAIM,EAAkB,CACrB,IAAK,GAgBNnC,EAAoBpF,EAAEt8D,EAAI,CAAC4iE,EAASnmB,KAE/BonB,EAAgBjB,IAElBY,cAAc9B,EAAoB32B,EAAI22B,EAAoBv6C,EAAEy7C,KAK/D,IAAIkB,EAAqB9vD,KAA6B,uBAAIA,KAA6B,wBAAK,GACxF+vD,EAA6BD,EAAmBhgE,KAAKmvC,KAAK6wB,GAC9DA,EAAmBhgE,KAvBCG,IACnB,IAAKg+D,EAAU+B,EAAaC,GAAWhgE,EACvC,IAAI,IAAI09D,KAAYqC,EAChBtC,EAAoBX,EAAEiD,EAAarC,KACrCD,EAAoB56B,EAAE66B,GAAYqC,EAAYrC,IAIhD,IADGsC,GAASA,EAAQvC,GACdO,EAASliE,QACd8jE,EAAgB5B,EAAS3c,OAAS,EACnCye,EAA2B9/D,K,GhHnBxBrP,EAAO8sE,EAAoBx5B,EAC/Bw5B,EAAoBx5B,EAAI,IAChBw5B,EAAoBtqD,EAAE,KAAK4rB,KAAKpuC,GiHDd8sE,EAAoBx5B,K","sources":["webpack://telegram-t/webpack/runtime/chunk loaded","webpack://telegram-t/webpack/runtime/startup chunk dependencies","webpack://telegram-t/./src/config.ts","webpack://telegram-t/./src/util/iteratees.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/peers.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/helpers.ts","webpack://telegram-t/./src/util/serverTime.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/chats.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/pathBytesToSvg.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/common.ts","webpack://telegram-t/./src/api/gramjs/localDb.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/symbols.ts","webpack://telegram-t/./src/util/waveform.ts","webpack://telegram-t/./src/api/types/messages.ts","webpack://telegram-t/./src/api/types/media.ts","webpack://telegram-t/./src/api/gramjs/gramjsBuilders/index.ts","webpack://telegram-t/./src/api/gramjs/helpers.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/messages.ts","webpack://telegram-t/./src/api/gramjs/updater.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/users.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/misc.ts","webpack://telegram-t/./src/api/gramjs/methods/auth.ts","webpack://telegram-t/./src/util/files.ts","webpack://telegram-t/./src/util/cacheApi.ts","webpack://telegram-t/./src/api/gramjs/methods/media.ts","webpack://telegram-t/./src/api/gramjs/methods/client.ts","webpack://telegram-t/./src/api/gramjs/methods/chats.ts","webpack://telegram-t/./src/api/gramjs/methods/messages.ts","webpack://telegram-t/./src/api/gramjs/methods/users.ts","webpack://telegram-t/./src/api/gramjs/methods/symbols.ts","webpack://telegram-t/./src/api/gramjs/methods/management.ts","webpack://telegram-t/./src/api/gramjs/methods/twoFaSettings.ts","webpack://telegram-t/./src/api/gramjs/methods/settings.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/bots.ts","webpack://telegram-t/./src/api/gramjs/methods/bots.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/payments.ts","webpack://telegram-t/./src/api/gramjs/methods/payments.ts","webpack://telegram-t/./src/api/gramjs/provider.ts","webpack://telegram-t/./src/util/schedulers.ts","webpack://telegram-t/./src/api/gramjs/worker/worker.ts","webpack://telegram-t/./src/lib/gramjs/Helpers.js","webpack://telegram-t/./src/lib/gramjs/Password.js","webpack://telegram-t/./src/lib/gramjs/Utils.js","webpack://telegram-t/./src/lib/gramjs/Version.js","webpack://telegram-t/./src/lib/gramjs/client/2fa.ts","webpack://telegram-t/./src/lib/gramjs/client/TelegramClient.js","webpack://telegram-t/./src/lib/gramjs/client/auth.ts","webpack://telegram-t/./src/lib/gramjs/client/downloadFile.ts","webpack://telegram-t/./src/lib/gramjs/client/uploadFile.ts","webpack://telegram-t/./src/lib/gramjs/crypto/AuthKey.js","webpack://telegram-t/./src/lib/gramjs/crypto/CTR.js","webpack://telegram-t/./src/lib/gramjs/crypto/Factorizator.js","webpack://telegram-t/./src/lib/gramjs/crypto/IGE.js","webpack://telegram-t/./src/lib/gramjs/crypto/converters.ts","webpack://telegram-t/./src/lib/gramjs/crypto/crypto.js","webpack://telegram-t/./src/lib/gramjs/crypto/words.ts","webpack://telegram-t/./src/lib/gramjs/errors/Common.js","webpack://telegram-t/./src/lib/gramjs/errors/RPCBaseErrors.js","webpack://telegram-t/./src/lib/gramjs/errors/RPCErrorList.js","webpack://telegram-t/./src/lib/gramjs/errors/index.js","webpack://telegram-t/./src/lib/gramjs/events/Raw.js","webpack://telegram-t/./src/lib/gramjs/events/common.js","webpack://telegram-t/./src/lib/gramjs/events/index.js","webpack://telegram-t/./src/lib/gramjs/extensions/AsyncQueue.js","webpack://telegram-t/./src/lib/gramjs/extensions/BinaryReader.js","webpack://telegram-t/./src/lib/gramjs/extensions/BinaryWriter.js","webpack://telegram-t/./src/lib/gramjs/extensions/Logger.js","webpack://telegram-t/./src/lib/gramjs/extensions/MessagePacker.js","webpack://telegram-t/./src/lib/gramjs/extensions/PromisedWebSockets.js","webpack://telegram-t/./src/lib/gramjs/extensions/index.js","webpack://telegram-t/./src/lib/gramjs/index.js","webpack://telegram-t/./src/lib/gramjs/crypto/RSA.ts","webpack://telegram-t/./src/lib/gramjs/network/Authenticator.ts","webpack://telegram-t/./src/lib/gramjs/network/MTProtoPlainSender.js","webpack://telegram-t/./src/lib/gramjs/network/MTProtoSender.js","webpack://telegram-t/./src/lib/gramjs/network/MTProtoState.js","webpack://telegram-t/./src/lib/gramjs/network/RequestState.js","webpack://telegram-t/./src/lib/gramjs/network/connection/Connection.js","webpack://telegram-t/./src/lib/gramjs/network/connection/TCPAbridged.js","webpack://telegram-t/./src/lib/gramjs/network/connection/TCPObfuscated.js","webpack://telegram-t/./src/lib/gramjs/network/connection/index.js","webpack://telegram-t/./src/lib/gramjs/network/index.js","webpack://telegram-t/./src/lib/gramjs/sessions/Abstract.js","webpack://telegram-t/./src/lib/gramjs/sessions/CacheApiSession.js","webpack://telegram-t/./src/lib/gramjs/sessions/CallbackSession.js","webpack://telegram-t/./src/lib/gramjs/sessions/IdbSession.js","webpack://telegram-t/./src/lib/gramjs/sessions/LocalStorageSession.js","webpack://telegram-t/./src/lib/gramjs/sessions/Memory.js","webpack://telegram-t/./src/lib/gramjs/sessions/StorageSession.js","webpack://telegram-t/./src/lib/gramjs/sessions/StringSession.js","webpack://telegram-t/./src/lib/gramjs/sessions/index.js","webpack://telegram-t/./src/lib/gramjs/tl/AllTLObjects.js","webpack://telegram-t/./src/lib/gramjs/tl/api.js","webpack://telegram-t/./src/lib/gramjs/tl/apiTl.js","webpack://telegram-t/./src/lib/gramjs/tl/core/GZIPPacked.js","webpack://telegram-t/./src/lib/gramjs/tl/core/MessageContainer.js","webpack://telegram-t/./src/lib/gramjs/tl/core/RPCResult.js","webpack://telegram-t/./src/lib/gramjs/tl/core/TLMessage.js","webpack://telegram-t/./src/lib/gramjs/tl/core/index.js","webpack://telegram-t/./src/lib/gramjs/tl/generationHelpers.js","webpack://telegram-t/./src/lib/gramjs/tl/index.js","webpack://telegram-t/./src/lib/gramjs/tl/schemaTl.js","webpack://telegram-t/webpack/bootstrap","webpack://telegram-t/webpack/runtime/compat get default export","webpack://telegram-t/webpack/runtime/define property getters","webpack://telegram-t/webpack/runtime/ensure chunk","webpack://telegram-t/webpack/runtime/get javascript chunk filename","webpack://telegram-t/webpack/runtime/get mini-css chunk filename","webpack://telegram-t/webpack/runtime/global","webpack://telegram-t/webpack/runtime/hasOwnProperty shorthand","webpack://telegram-t/webpack/runtime/make namespace object","webpack://telegram-t/webpack/runtime/node module decorator","webpack://telegram-t/webpack/runtime/publicPath","webpack://telegram-t/webpack/runtime/importScripts chunk loading","webpack://telegram-t/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn __webpack_require__.e(592).then(next);\n};","export const PAGE_TITLE = 'Telegram';\nexport const INACTIVE_MARKER = ' [Inactive]';\n\nexport const APP_NAME = process.env.APP_NAME || 'Telegram WebZ';\nexport const APP_VERSION = process.env.APP_VERSION || 'dev';\n\nexport const DEBUG = (\n process.env.APP_ENV !== 'production' && process.env.APP_ENV !== 'perf' && process.env.APP_ENV !== 'test'\n);\nexport const DEBUG_MORE = false;\n\nexport const IS_TEST = process.env.APP_ENV === 'test';\nexport const IS_PERF = process.env.APP_ENV === 'perf';\n\nexport const DEBUG_ALERT_MSG = 'Shoot!\\nSomething went wrong, please see the error details in Dev Tools Console.';\nexport const DEBUG_GRAMJS = false;\n\nexport const SESSION_USER_KEY = 'user_auth';\nexport const LEGACY_SESSION_KEY = 'GramJs:sessionId';\n\nexport const GLOBAL_STATE_CACHE_DISABLED = false;\nexport const GLOBAL_STATE_CACHE_KEY = 'tt-global-state';\nexport const GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT = 30;\nexport const GLOBAL_STATE_CACHE_USER_LIST_LIMIT = 5000;\n\nexport const MEDIA_CACHE_DISABLED = false;\nexport const MEDIA_CACHE_NAME = 'tt-media';\nexport const MEDIA_CACHE_NAME_AVATARS = 'tt-media-avatars';\nexport const MEDIA_PROGRESSIVE_CACHE_DISABLED = false;\nexport const MEDIA_PROGRESSIVE_CACHE_NAME = 'tt-media-progressive';\nexport const MEDIA_CACHE_MAX_BYTES = 512 * 1024; // 512 KB\nexport const CUSTOM_BG_CACHE_NAME = 'tt-custom-bg';\nexport const LANG_CACHE_NAME = 'tt-lang-packs-v5';\nexport const ASSET_CACHE_NAME = 'tt-assets';\n\nexport const DOWNLOAD_WORKERS = 16;\nexport const UPLOAD_WORKERS = 16;\n\nconst isBigScreen = typeof window !== 'undefined' && window.innerHeight >= 900;\n\nexport const MIN_PASSWORD_LENGTH = 1;\n\nexport const MESSAGE_LIST_SENSITIVE_AREA = 750;\nexport const MESSAGE_LIST_SLICE = isBigScreen ? 60 : 40;\nexport const MESSAGE_LIST_VIEWPORT_LIMIT = MESSAGE_LIST_SLICE * 2;\n\nexport const CHAT_HEIGHT_PX = 72;\nexport const CHAT_LIST_SLICE = isBigScreen ? 30 : 25;\nexport const CHAT_LIST_LOAD_SLICE = 100;\nexport const SHARED_MEDIA_SLICE = 42;\nexport const MESSAGE_SEARCH_SLICE = 42;\nexport const GLOBAL_SEARCH_SLICE = 20;\nexport const MEMBERS_SLICE = 30;\nexport const MEMBERS_LOAD_SLICE = 200;\nexport const PINNED_MESSAGES_LIMIT = 50;\nexport const BLOCKED_LIST_LIMIT = 100;\nexport const PROFILE_PHOTOS_LIMIT = 40;\nexport const PROFILE_SENSITIVE_AREA = 500;\n\nexport const TOP_CHAT_MESSAGES_PRELOAD_LIMIT = 20;\nexport const ALL_CHATS_PRELOAD_DISABLED = false;\n\nexport const ANIMATION_LEVEL_MIN = 0;\nexport const ANIMATION_LEVEL_MED = 1;\nexport const ANIMATION_LEVEL_MAX = 2;\nexport const ANIMATION_LEVEL_DEFAULT = ANIMATION_LEVEL_MAX;\n\nexport const DEFAULT_MESSAGE_TEXT_SIZE_PX = 16;\nexport const IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 17;\nexport const MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 15;\n\nexport const DRAFT_DEBOUNCE = 10000; // 10s\n\nexport const EDITABLE_INPUT_ID = 'editable-message-text';\nexport const EDITABLE_INPUT_MODAL_ID = 'editable-message-text-modal';\n\n// Screen width where Pinned Message / Audio Player in the Middle Header can be safely displayed\nexport const SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1440; // px\n// Screen width where Pinned Message / Audio Player in the Middle Header shouldn't collapse with ChatInfo\nexport const SAFE_SCREEN_WIDTH_FOR_CHAT_INFO = 1150; // px\n\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1275; // px\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN = 925; // px\nexport const MOBILE_SCREEN_MAX_WIDTH = 600; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH = 950; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT = 450; // px\n\nexport const LOCAL_MESSAGE_ID_BASE = 1e9;\n\nexport const ANIMATION_END_DELAY = 100;\n\nexport const FAST_SMOOTH_MAX_DISTANCE = 1500;\nexport const FAST_SMOOTH_MIN_DURATION = 250;\nexport const FAST_SMOOTH_MAX_DURATION = 600;\nexport const FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE = 500; // px\n\n// Average duration of message sending animation\nexport const API_UPDATE_THROTTLE = Math.round((FAST_SMOOTH_MIN_DURATION + FAST_SMOOTH_MAX_DURATION) / 2);\nexport const API_THROTTLE_RESET_UPDATES = new Set([\n 'newMessage', 'newScheduledMessage', 'deleteMessages', 'deleteScheduledMessages', 'deleteHistory',\n]);\n\nexport const STICKER_SIZE_INLINE_DESKTOP_FACTOR = 13;\nexport const STICKER_SIZE_INLINE_MOBILE_FACTOR = 11;\nexport const STICKER_SIZE_AUTH = 160;\nexport const STICKER_SIZE_AUTH_MOBILE = 120;\nexport const STICKER_SIZE_PICKER = 64;\nexport const STICKER_SIZE_GENERAL_SETTINGS = 48;\nexport const STICKER_SIZE_PICKER_HEADER = 32;\nexport const STICKER_SIZE_SEARCH = 64;\nexport const STICKER_SIZE_MODAL = 64;\nexport const STICKER_SIZE_TWO_FA = 160;\nexport const STICKER_SIZE_DISCUSSION_GROUPS = 140;\nexport const STICKER_SIZE_FOLDER_SETTINGS = 80;\nexport const STICKER_SIZE_INLINE_BOT_RESULT = 100;\nexport const RECENT_STICKERS_LIMIT = 20;\nexport const MEMOJI_STICKER_ID = 'MEMOJI_STICKER';\n\nexport const BASE_EMOJI_KEYWORD_LANG = 'en';\n\nexport const MENU_TRANSITION_DURATION = 200;\nexport const SLIDE_TRANSITION_DURATION = 450;\n\nexport const CONTENT_TYPES_FOR_QUICK_UPLOAD = new Set([\n 'image/png', 'image/gif', 'image/jpeg', 'video/mp4', 'video/avi', 'video/quicktime',\n]);\n\n// eslint-disable-next-line max-len\nexport const RE_LINK_TEMPLATE = '((ftp|https?):\\\\/\\\\/)?((www\\\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\\\.[a-zA-Z0-9()]{1,63})\\\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)';\nexport const RE_MENTION_TEMPLATE = '(@[\\\\w\\\\d_-]+)';\nexport const RE_TME_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/)([\\d\\w_]+)(?:\\/([\\d]+))?(?:\\/([\\d]+))?$/gm;\nexport const RE_TME_INVITE_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/joinchat\\/)([\\d\\w_-]+)?$/gm;\n\n// MTProto constants\nexport const SERVICE_NOTIFICATIONS_USER_ID = 777000;\nexport const REPLIES_USER_ID = 1271266957;\nexport const ALL_FOLDER_ID = 0;\nexport const ARCHIVED_FOLDER_ID = 1;\nexport const DELETED_COMMENTS_CHANNEL_ID = 777;\nexport const MAX_MEDIA_FILES_FOR_ALBUM = 10;\nexport const MAX_ACTIVE_PINNED_CHATS = 5;\nexport const SCHEDULED_WHEN_ONLINE = 0x7FFFFFFE;\nexport const DEFAULT_LANG_CODE = 'en';\nexport const DEFAULT_LANG_PACK = 'android';\nexport const LANG_PACKS = ['android', 'ios', 'tdesktop', 'macos'] as const;\nexport const TIPS_USERNAME = 'TelegramTips';\nexport const LOCALIZED_TIPS = ['ar', 'pt-br', 'id', 'it', 'ko', 'ms', 'pl', 'es', 'tr'];\nexport const FEEDBACK_URL = 'https://bugs.telegram.org/?tag_ids=41&sort=time';\nexport const LIGHT_THEME_BG_COLOR = '#A2AF8E';\nexport const DARK_THEME_BG_COLOR = '#0F0F0F';\nexport const DARK_THEME_PATTERN_COLOR = '#0a0a0a8c';\nexport const DEFAULT_PATTERN_COLOR = 'rgba(90, 110, 70, 0.6)';\n","type CollectionByKey = Record;\n\ntype OrderDirection = 'asc' | 'desc';\n\ninterface OrderCallback {\n (member: T): any;\n}\n\nexport function buildCollectionByKey(collection: T[], key: keyof T) {\n return collection.reduce((byKey: CollectionByKey, member: T) => {\n byKey[member[key]] = member;\n\n return byKey;\n }, {});\n}\n\nexport function mapValues(\n byKey: CollectionByKey,\n callback: (member: M, key: string, index: number, originalByKey: CollectionByKey) => R,\n): CollectionByKey {\n return Object.keys(byKey).reduce((newByKey: CollectionByKey, key, index) => {\n newByKey[key] = callback(byKey[key], key, index, byKey);\n return newByKey;\n }, {});\n}\n\nexport function pick(object: T, keys: K[]) {\n return keys.reduce((result, key) => {\n result[key] = object[key];\n return result;\n }, {} as Pick);\n}\n\nexport function pickTruthy(object: T, keys: K[]) {\n return keys.reduce((result, key) => {\n if (object[key]) {\n result[key] = object[key];\n }\n\n return result;\n }, {} as Pick);\n}\n\nexport function omit(object: T, keys: K[]) {\n const stringKeys = new Set(keys.map(String));\n const savedKeys = Object.keys(object)\n .filter((key) => !stringKeys.has(key)) as Array>;\n\n return pick(object, savedKeys);\n}\n\nexport function orderBy(\n collection: T[],\n orderKey: (keyof T) | OrderCallback | ((keyof T) | OrderCallback)[],\n mode: OrderDirection | [OrderDirection, OrderDirection] = 'asc',\n): T[] {\n return collection.sort((a, b) => {\n if (Array.isArray(orderKey)) {\n const [mode1, mode2] = Array.isArray(mode) ? mode : [mode, mode];\n const [orderKey1, orderKey2] = orderKey;\n\n let aValue1;\n let bValue1;\n\n if (typeof orderKey1 === 'function') {\n aValue1 = orderKey1(a) || 0;\n bValue1 = orderKey1(b) || 0;\n } else if (typeof orderKey1 === 'string') {\n aValue1 = a[orderKey1] || 0;\n bValue1 = b[orderKey1] || 0;\n }\n\n if (aValue1 !== bValue1) {\n return mode1 === 'asc' ? aValue1 - bValue1 : bValue1 - aValue1;\n } else {\n let aValue2;\n let bValue2;\n\n if (typeof orderKey2 === 'function') {\n aValue2 = orderKey2(a) || 0;\n bValue2 = orderKey2(b) || 0;\n } else if (typeof orderKey2 === 'string') {\n aValue2 = a[orderKey2] || 0;\n bValue2 = b[orderKey2] || 0;\n }\n\n return mode2 === 'asc' ? aValue2 - bValue2 : bValue2 - aValue2;\n }\n }\n\n let aValue;\n let bValue;\n\n if (typeof orderKey === 'function') {\n aValue = orderKey(a) || 0;\n bValue = orderKey(b) || 0;\n } else if (typeof orderKey === 'string') {\n aValue = a[orderKey] || 0;\n bValue = b[orderKey] || 0;\n }\n\n return mode === 'asc' ? aValue - bValue : bValue - aValue;\n });\n}\n\nexport function flatten(array: any[]) {\n return array.reduce((result, member) => {\n if (Array.isArray(member)) {\n return result.concat(member);\n } else {\n result.push(member);\n return result;\n }\n }, []);\n}\n\nexport function unique(array: T[]): T[] {\n return Array.from(new Set(array));\n}\n\nexport function compact(array: any[]) {\n return array.filter(Boolean);\n}\n\nexport function areSortedArraysEqual(array1: any[], array2: any[]) {\n if (array1.length !== array2.length) {\n return false;\n }\n\n return array1.every((item, i) => item === array2[i]);\n}\n\nexport function areSortedArraysIntersecting(array1: any[], array2: any[]) {\n return array1[0] <= array2[array2.length - 1] && array1[array1.length - 1] >= array2[0];\n}\n\nexport function findIntersectionWithSet(array: T[], set: Set): T[] {\n return array.filter((a) => set.has(a));\n}\n\nexport function split(array: any[], chunkSize: number) {\n const result = [];\n for (let i = 0; i < array.length; i += chunkSize) {\n result.push(array.slice(i, i + chunkSize));\n }\n\n return result;\n}\n\nexport function cloneDeep(value: T): T {\n if (typeof value !== 'object') {\n return value;\n }\n\n if (Array.isArray(value)) {\n return value.map(cloneDeep) as typeof value;\n }\n\n return Object.keys(value).reduce((acc, key) => {\n acc[key as keyof T] = cloneDeep(value[key as keyof T]);\n return acc;\n }, {} as T);\n}\n\n/**\n * Returns the index of the last element in the array where predicate is true, and -1 otherwise.\n *\n * @param array The source array to search in\n * @param predicate find calls predicate once for each element of the array, in descending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.\n */\nexport function findLast(array: Array, predicate: (value: T, index: number, obj: T[]) => boolean): T | undefined {\n let cursor = array.length;\n\n while (cursor--) {\n if (predicate(array[cursor], cursor, array)) {\n return array[cursor];\n }\n }\n\n return undefined;\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\n\nexport function isPeerUser(peer: GramJs.TypePeer): peer is GramJs.PeerUser {\n return peer.hasOwnProperty('userId');\n}\n\nexport function isPeerChat(peer: GramJs.TypePeer): peer is GramJs.PeerChat {\n return peer.hasOwnProperty('chatId');\n}\n\nexport function isPeerChannel(peer: GramJs.TypePeer): peer is GramJs.PeerChannel {\n return peer.hasOwnProperty('channelId');\n}\n\nexport function isInputPeerUser(peer: GramJs.TypeInputPeer): peer is GramJs.InputPeerUser {\n return peer.hasOwnProperty('userId');\n}\n\nexport function isInputPeerChat(peer: GramJs.TypeInputPeer): peer is GramJs.InputPeerChat {\n return peer.hasOwnProperty('chatId');\n}\n\nexport function isInputPeerChannel(peer: GramJs.TypeInputPeer): peer is GramJs.InputPeerChannel {\n return peer.hasOwnProperty('channelId');\n}\n","export function bytesToDataUri(bytes: Buffer, shouldOmitPrefix = false, mimeType: string = 'image/jpeg') {\n const prefix = shouldOmitPrefix ? '' : `data:${mimeType};base64,`;\n\n return `${prefix}${btoa(String.fromCharCode(...bytes))}`;\n}\n\nexport function omitVirtualClassFields(instance: any) {\n if (!instance) {\n return undefined;\n }\n\n const {\n flags,\n CONSTRUCTOR_ID,\n SUBCLASS_OF_ID,\n className,\n classType,\n ...rest\n } = instance;\n\n return rest;\n}\n","export const getServerTime = (serverTimeOffset: number) => {\n return Math.floor(Date.now() / 1000) + serverTimeOffset;\n};\n","import { Api as GramJs } from '../../../lib/gramjs';\nimport {\n ApiChat,\n ApiChatAdminRights,\n ApiChatBannedRights,\n ApiBotCommand,\n ApiChatFolder,\n ApiChatMember,\n ApiRestrictionReason,\n} from '../../types';\nimport { pick, pickTruthy } from '../../../util/iteratees';\nimport {\n isInputPeerChannel, isInputPeerChat, isInputPeerUser, isPeerChat, isPeerUser,\n} from './peers';\nimport { omitVirtualClassFields } from './helpers';\nimport { getServerTime } from '../../../util/serverTime';\n\ntype PeerEntityApiChatFields = Omit;\n\nfunction buildApiChatFieldsFromPeerEntity(\n peerEntity: GramJs.TypeUser | GramJs.TypeChat,\n isSupport = false,\n): PeerEntityApiChatFields {\n const isMin = Boolean('min' in peerEntity && peerEntity.min);\n const accessHash = ('accessHash' in peerEntity) && String(peerEntity.accessHash);\n const avatarHash = ('photo' in peerEntity) && peerEntity.photo && buildAvatarHash(peerEntity.photo);\n const isSignaturesShown = Boolean('signatures' in peerEntity && peerEntity.signatures);\n const hasPrivateLink = Boolean('hasLink' in peerEntity && peerEntity.hasLink);\n\n return {\n isMin,\n hasPrivateLink,\n isSignaturesShown,\n ...(accessHash && { accessHash }),\n ...(avatarHash && { avatarHash }),\n ...(\n (peerEntity instanceof GramJs.Channel || peerEntity instanceof GramJs.User)\n && { username: peerEntity.username }\n ),\n ...(('verified' in peerEntity) && { isVerified: peerEntity.verified }),\n ...(('callActive' in peerEntity) && { isCallActive: peerEntity.callActive }),\n ...(('callNotEmpty' in peerEntity) && { isCallNotEmpty: peerEntity.callNotEmpty }),\n ...((peerEntity instanceof GramJs.Chat || peerEntity instanceof GramJs.Channel) && {\n ...(peerEntity.participantsCount && { membersCount: peerEntity.participantsCount }),\n joinDate: peerEntity.date,\n }),\n ...(isSupport && { isSupport: true }),\n ...buildApiChatPermissions(peerEntity),\n ...(('creator' in peerEntity) && { isCreator: peerEntity.creator }),\n ...buildApiChatRestrictions(peerEntity),\n ...buildApiChatMigrationInfo(peerEntity),\n };\n}\n\nexport function buildApiChatFromDialog(\n dialog: GramJs.Dialog,\n peerEntity: GramJs.TypeUser | GramJs.TypeChat,\n serverTimeOffset: number,\n): ApiChat {\n const {\n peer, folderId, unreadMark, unreadCount, unreadMentionsCount, notifySettings: { silent, muteUntil },\n readOutboxMaxId, readInboxMaxId, draft,\n } = dialog;\n const isMuted = silent || (typeof muteUntil === 'number' && getServerTime(serverTimeOffset) < muteUntil);\n\n return {\n id: getApiChatIdFromMtpPeer(peer),\n ...(folderId && { folderId }),\n type: getApiChatTypeFromPeerEntity(peerEntity),\n title: getApiChatTitleFromMtpPeer(peer, peerEntity),\n lastReadOutboxMessageId: readOutboxMaxId,\n lastReadInboxMessageId: readInboxMaxId,\n unreadCount,\n unreadMentionsCount,\n isMuted,\n ...(unreadMark && { hasUnreadMark: true }),\n ...(draft instanceof GramJs.DraftMessage && { draftDate: draft.date }),\n ...buildApiChatFieldsFromPeerEntity(peerEntity),\n };\n}\n\nfunction buildApiChatPermissions(peerEntity: GramJs.TypeUser | GramJs.TypeChat): {\n adminRights?: ApiChatAdminRights;\n currentUserBannedRights?: ApiChatBannedRights;\n defaultBannedRights?: ApiChatBannedRights;\n} {\n if (!(peerEntity instanceof GramJs.Chat || peerEntity instanceof GramJs.Channel)) {\n return {};\n }\n\n return {\n adminRights: omitVirtualClassFields(peerEntity.adminRights),\n currentUserBannedRights: peerEntity instanceof GramJs.Channel\n ? omitVirtualClassFields(peerEntity.bannedRights)\n : undefined,\n defaultBannedRights: omitVirtualClassFields(peerEntity.defaultBannedRights),\n };\n}\n\nfunction buildApiChatRestrictions(peerEntity: GramJs.TypeUser | GramJs.TypeChat): {\n isNotJoined?: boolean;\n isRestricted?: boolean;\n restrictionReason?: ApiRestrictionReason;\n} {\n if (peerEntity instanceof GramJs.ChatForbidden || peerEntity instanceof GramJs.ChannelForbidden) {\n return {\n isRestricted: true,\n };\n }\n\n const restrictions = {};\n\n if ('restricted' in peerEntity) {\n const restrictionReason = peerEntity.restricted\n ? buildApiChatRestrictionReason(peerEntity.restrictionReason)\n : undefined;\n\n if (restrictionReason) {\n Object.assign(restrictions, {\n isRestricted: true,\n restrictionReason,\n });\n }\n }\n\n if (peerEntity instanceof GramJs.Chat) {\n Object.assign(restrictions, {\n isNotJoined: peerEntity.left,\n isRestricted: peerEntity.kicked,\n });\n }\n\n if (peerEntity instanceof GramJs.Channel) {\n Object.assign(restrictions, {\n // `left` is weirdly set to `true` on all channels never joined before\n isNotJoined: peerEntity.left,\n });\n }\n\n return restrictions;\n}\n\nfunction buildApiChatMigrationInfo(peerEntity: GramJs.TypeChat): {\n migratedTo?: {\n chatId: number;\n accessHash?: string;\n };\n} {\n if (\n peerEntity instanceof GramJs.Chat\n && peerEntity.migratedTo\n && !(peerEntity.migratedTo instanceof GramJs.InputChannelEmpty)\n ) {\n return {\n migratedTo: {\n chatId: getApiChatIdFromMtpPeer(peerEntity.migratedTo),\n ...(peerEntity.migratedTo instanceof GramJs.InputChannel && {\n accessHash: peerEntity.migratedTo.accessHash.toString(),\n }),\n },\n };\n }\n\n return {};\n}\n\nfunction buildApiChatRestrictionReason(\n restrictionReasons?: GramJs.RestrictionReason[],\n): ApiRestrictionReason | undefined {\n if (!restrictionReasons) {\n return undefined;\n }\n\n const targetReason = restrictionReasons.find(({ platform }) => platform === 'all');\n return targetReason ? pick(targetReason, ['reason', 'text']) : undefined;\n}\n\nexport function buildApiChatFromPreview(\n preview: GramJs.TypeChat | GramJs.TypeUser,\n isSupport = false,\n withForbidden = false,\n): ApiChat | undefined {\n if (!(\n preview instanceof GramJs.Chat\n || preview instanceof GramJs.Channel\n || preview instanceof GramJs.User\n || (\n withForbidden\n && (\n preview instanceof GramJs.ChatForbidden\n || preview instanceof GramJs.ChannelForbidden\n )\n )\n )) {\n return undefined;\n }\n\n return {\n id: preview instanceof GramJs.User ? preview.id : -preview.id,\n type: getApiChatTypeFromPeerEntity(preview),\n title: preview instanceof GramJs.User ? getUserName(preview) : preview.title,\n ...buildApiChatFieldsFromPeerEntity(preview, isSupport),\n };\n}\n\nexport function getApiChatIdFromMtpPeer(peer: GramJs.TypePeer): number {\n if (isPeerUser(peer)) {\n return peer.userId;\n } else if (isPeerChat(peer)) {\n return -peer.chatId;\n } else {\n return -peer.channelId;\n }\n}\n\nexport function getApiChatIdFromInputMtpPeer(peer: GramJs.TypeInputPeer): number | undefined {\n if (isInputPeerUser(peer)) {\n return peer.userId;\n } else if (isInputPeerChat(peer)) {\n return -peer.chatId;\n } else if (isInputPeerChannel(peer)) {\n return -peer.channelId;\n }\n return undefined;\n}\n\nexport function getApiChatTypeFromPeerEntity(peerEntity: GramJs.TypeChat | GramJs.TypeUser) {\n if (peerEntity instanceof GramJs.User || peerEntity instanceof GramJs.UserEmpty) {\n return 'chatTypePrivate';\n } else if (\n peerEntity instanceof GramJs.Chat\n || peerEntity instanceof GramJs.ChatForbidden\n || peerEntity instanceof GramJs.ChatEmpty\n ) {\n return 'chatTypeBasicGroup';\n } else {\n return peerEntity.megagroup ? 'chatTypeSuperGroup' : 'chatTypeChannel';\n }\n}\n\nexport function getPeerKey(peer: GramJs.TypePeer) {\n if (isPeerUser(peer)) {\n return `user${peer.userId}`;\n } else if (isPeerChat(peer)) {\n return `chat${peer.chatId}`;\n } else {\n return `chat${peer.channelId}`;\n }\n}\n\nexport function getApiChatTitleFromMtpPeer(peer: GramJs.TypePeer, peerEntity: GramJs.User | GramJs.Chat) {\n if (isPeerUser(peer)) {\n return getUserName(peerEntity as GramJs.User);\n } else {\n return (peerEntity as GramJs.Chat).title;\n }\n}\n\nfunction getUserName(user: GramJs.User) {\n return user.firstName\n ? `${user.firstName}${user.lastName ? ` ${user.lastName}` : ''}`\n : (user.lastName || undefined);\n}\n\nexport function buildAvatarHash(photo: GramJs.TypeUserProfilePhoto | GramJs.TypeChatPhoto) {\n if ('photoId' in photo) {\n return photo.photoId.toString();\n }\n\n return undefined;\n}\n\nexport function buildChatMember(\n member: GramJs.TypeChatParticipant | GramJs.TypeChannelParticipant,\n): ApiChatMember | undefined {\n const userId = (member instanceof GramJs.ChannelParticipantBanned || member instanceof GramJs.ChannelParticipantLeft)\n ? getApiChatIdFromMtpPeer(member.peer)\n : member.userId;\n\n return {\n userId,\n inviterId: 'inviterId' in member ? member.inviterId : undefined,\n joinedDate: 'date' in member ? member.date : undefined,\n kickedByUserId: 'kickedBy' in member ? member.kickedBy : undefined,\n promotedByUserId: 'promotedBy' in member ? member.promotedBy : undefined,\n bannedRights: 'bannedRights' in member ? omitVirtualClassFields(member.bannedRights) : undefined,\n adminRights: 'adminRights' in member ? omitVirtualClassFields(member.adminRights) : undefined,\n customTitle: 'rank' in member ? member.rank : undefined,\n ...((member instanceof GramJs.ChannelParticipantAdmin || member instanceof GramJs.ChatParticipantAdmin) && {\n isAdmin: true,\n }),\n ...((member instanceof GramJs.ChannelParticipantCreator || member instanceof GramJs.ChatParticipantCreator) && {\n isOwner: true,\n }),\n };\n}\n\nexport function buildChatMembers(\n participants: GramJs.TypeChatParticipants | GramJs.channels.ChannelParticipants,\n) {\n // Duplicate code because of TS union-type shenanigans\n if (participants instanceof GramJs.ChatParticipants) {\n return participants.participants.map(buildChatMember).filter(Boolean as any);\n }\n if (participants instanceof GramJs.channels.ChannelParticipants) {\n return participants.participants.map(buildChatMember).filter(Boolean as any);\n }\n\n return undefined;\n}\n\nexport function buildChatTypingStatus(\n update: GramJs.UpdateUserTyping | GramJs.UpdateChatUserTyping | GramJs.UpdateChannelUserTyping,\n serverTimeOffset: number,\n) {\n let action: string = '';\n if (update.action instanceof GramJs.SendMessageCancelAction) {\n return undefined;\n } else if (update.action instanceof GramJs.SendMessageTypingAction) {\n action = 'lng_user_typing';\n } else if (update.action instanceof GramJs.SendMessageRecordVideoAction) {\n action = 'lng_send_action_record_video';\n } else if (update.action instanceof GramJs.SendMessageUploadVideoAction) {\n action = 'lng_send_action_upload_video';\n } else if (update.action instanceof GramJs.SendMessageRecordAudioAction) {\n action = 'lng_send_action_record_audio';\n } else if (update.action instanceof GramJs.SendMessageUploadAudioAction) {\n action = 'lng_send_action_upload_audio';\n } else if (update.action instanceof GramJs.SendMessageUploadPhotoAction) {\n action = 'lng_send_action_upload_photo';\n } else if (update.action instanceof GramJs.SendMessageUploadDocumentAction) {\n action = 'lng_send_action_upload_file';\n } else if (update.action instanceof GramJs.SendMessageGeoLocationAction) {\n action = 'selecting a location to share';\n } else if (update.action instanceof GramJs.SendMessageChooseContactAction) {\n action = 'selecting a contact to share';\n } else if (update.action instanceof GramJs.SendMessageGamePlayAction) {\n action = 'lng_playing_game';\n } else if (update.action instanceof GramJs.SendMessageRecordRoundAction) {\n action = 'lng_send_action_record_round';\n } else if (update.action instanceof GramJs.SendMessageUploadRoundAction) {\n action = 'lng_send_action_upload_round';\n }\n\n return {\n action,\n ...(!(update instanceof GramJs.UpdateUserTyping) && { userId: getApiChatIdFromMtpPeer(update.fromId) }),\n timestamp: Date.now() + serverTimeOffset * 1000,\n };\n}\n\nexport function buildApiChatFolder(filter: GramJs.DialogFilter): ApiChatFolder {\n return {\n ...pickTruthy(filter, [\n 'id', 'title', 'emoticon', 'contacts', 'nonContacts', 'groups', 'bots',\n 'excludeMuted', 'excludeRead', 'excludeArchived',\n ]),\n channels: filter.broadcasts,\n pinnedChatIds: filter.pinnedPeers.map(getApiChatIdFromInputMtpPeer).filter(Boolean as any),\n includedChatIds: filter.includePeers.map(getApiChatIdFromInputMtpPeer).filter(Boolean as any),\n excludedChatIds: filter.excludePeers.map(getApiChatIdFromInputMtpPeer).filter(Boolean as any),\n };\n}\n\nexport function buildApiChatFolderFromSuggested({\n filter, description,\n}: {\n filter: GramJs.DialogFilter;\n description: string;\n}): ApiChatFolder {\n return {\n ...buildApiChatFolder(filter),\n description,\n };\n}\n\nexport function buildApiChatBotCommands(botInfos: GramJs.BotInfo[]) {\n return botInfos.reduce((botCommands, botInfo) => {\n botCommands = botCommands.concat(botInfo.commands.map((mtpCommand) => ({\n botId: botInfo.userId,\n ...omitVirtualClassFields(mtpCommand),\n })));\n\n return botCommands;\n }, [] as ApiBotCommand[]);\n}\n","/* eslint-disable no-bitwise */\n\n// eslint-disable-next-line max-len\nconst TEMPLATE = '';\nconst LOOKUP = 'AACAAAAHAAALMAAAQASTAVAAAZaacaaaahaaalmaaaqastava.az0123456789-,';\n\nexport function pathBytesToSvg(bytes: Buffer, width: number, height: number) {\n return TEMPLATE\n .replace('{{path}}', buildPath(bytes))\n .replace('{{width}}', String(width))\n .replace('{{height}}', String(height));\n}\n\nfunction buildPath(bytes: Buffer) {\n let path = 'M';\n\n const len = bytes.length;\n for (let i = 0; i < len; i++) {\n const num = bytes[i];\n if (num >= 128 + 64) {\n path += LOOKUP[num - 128 - 64];\n } else {\n if (num >= 128) {\n path += ',';\n } else if (num >= 64) {\n path += '-';\n }\n path += String(num & 63);\n }\n }\n\n path += 'z';\n\n return path;\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\nimport { strippedPhotoToJpg } from '../../../lib/gramjs/Utils';\n\nimport {\n ApiPhoto, ApiPhotoSize, ApiThumbnail,\n} from '../../types';\nimport { bytesToDataUri } from './helpers';\nimport { pathBytesToSvg } from './pathBytesToSvg';\n\nconst DEFAULT_THUMB_SIZE = { w: 100, h: 100 };\n\nexport function buildApiThumbnailFromStripped(\n sizes?: GramJs.TypePhotoSize[], mimeType?: string,\n): ApiThumbnail | undefined {\n if (!sizes || !sizes.length) {\n return undefined;\n }\n\n const thumb = sizes.find((s: any): s is GramJs.PhotoStrippedSize => s instanceof GramJs.PhotoStrippedSize);\n if (!thumb) {\n return undefined;\n }\n\n const realSizes = sizes.filter((s): s is GramJs.PhotoSize => s instanceof GramJs.PhotoSize);\n const { w, h } = realSizes.length ? realSizes[realSizes.length - 1] : DEFAULT_THUMB_SIZE;\n const { bytes } = thumb;\n const dataUri = bytesToDataUri(\n !mimeType || mimeType === 'image/jpeg' ? strippedPhotoToJpg(bytes) : bytes,\n undefined,\n mimeType,\n );\n\n return {\n dataUri,\n width: w,\n height: h,\n };\n}\n\nexport function buildApiThumbnailFromCached(photoSize: GramJs.PhotoCachedSize): ApiThumbnail | undefined {\n const { w, h, bytes } = photoSize;\n const dataUri = bytesToDataUri(bytes, undefined, 'image/webp');\n\n return {\n dataUri,\n width: w,\n height: h,\n };\n}\n\nexport function buildApiThumbnailFromPath(\n photoSize: GramJs.PhotoPathSize,\n sizeAttribute: GramJs.DocumentAttributeImageSize,\n): ApiThumbnail | undefined {\n const { w, h } = sizeAttribute;\n const dataUri = `data:image/svg+xml;utf8,${pathBytesToSvg(photoSize.bytes, w, h)}`;\n\n return {\n dataUri,\n width: w,\n height: h,\n };\n}\n\nexport function buildApiPhoto(photo: GramJs.Photo): ApiPhoto {\n const sizes = photo.sizes\n .filter((s: any): s is GramJs.PhotoSize => {\n return s instanceof GramJs.PhotoSize || s instanceof GramJs.PhotoSizeProgressive;\n })\n .map(buildApiPhotoSize);\n\n return {\n id: String(photo.id),\n thumbnail: buildApiThumbnailFromStripped(photo.sizes),\n sizes,\n };\n}\n\nexport function buildApiPhotoSize(photoSize: GramJs.PhotoSize): ApiPhotoSize {\n const { w, h, type } = photoSize;\n\n return {\n width: w,\n height: h,\n type: type as ('m' | 'x' | 'y'),\n };\n}\n","import { Api as GramJs } from '../../lib/gramjs';\nimport { ApiMessage } from '../types';\n\ninterface LocalDb {\n localMessages: Record;\n // Used for loading avatars and media through in-memory Gram JS instances.\n chats: Record;\n users: Record;\n messages: Record;\n documents: Record;\n stickerSets: Record;\n photos: Record;\n webDocuments: Record;\n}\n\nexport default {\n localMessages: {},\n chats: {},\n users: {},\n messages: {},\n documents: {},\n stickerSets: {},\n photos: {},\n webDocuments: {},\n} as LocalDb;\n","import { Api as GramJs } from '../../../lib/gramjs';\nimport { ApiSticker, ApiStickerSet } from '../../types';\nimport { MEMOJI_STICKER_ID } from '../../../config';\n\nimport { buildApiThumbnailFromCached, buildApiThumbnailFromPath } from './common';\nimport localDb from '../localDb';\n\nconst ANIMATED_STICKER_MIME_TYPE = 'application/x-tgsticker';\n\nexport function buildStickerFromDocument(document: GramJs.TypeDocument): ApiSticker | undefined {\n if (document instanceof GramJs.DocumentEmpty) {\n return undefined;\n }\n\n const stickerAttribute = document.attributes\n .find((attr: any): attr is GramJs.DocumentAttributeSticker => (\n attr instanceof GramJs.DocumentAttributeSticker\n ));\n\n const fileAttribute = document.mimeType === ANIMATED_STICKER_MIME_TYPE && document.attributes\n .find((attr: any): attr is GramJs.DocumentAttributeFilename => (\n attr instanceof GramJs.DocumentAttributeFilename\n ));\n\n if (!stickerAttribute && !fileAttribute) {\n return undefined;\n }\n\n const sizeAttribute = document.attributes\n .find((attr: any): attr is GramJs.DocumentAttributeImageSize => (\n attr instanceof GramJs.DocumentAttributeImageSize\n ));\n\n const stickerSetInfo = stickerAttribute && stickerAttribute.stickerset instanceof GramJs.InputStickerSetID\n ? stickerAttribute.stickerset\n : undefined;\n const emoji = stickerAttribute?.alt;\n const isAnimated = document.mimeType === ANIMATED_STICKER_MIME_TYPE;\n const cachedThumb = document.thumbs && document.thumbs.find(\n (s): s is GramJs.PhotoCachedSize => s instanceof GramJs.PhotoCachedSize,\n );\n const pathThumb = document.thumbs && document.thumbs.find(\n (s): s is GramJs.PhotoPathSize => s instanceof GramJs.PhotoPathSize,\n );\n const thumbnail = cachedThumb ? (\n buildApiThumbnailFromCached(cachedThumb)\n ) : pathThumb && sizeAttribute ? (\n buildApiThumbnailFromPath(pathThumb, sizeAttribute)\n ) : undefined;\n\n const { w: width, h: height } = cachedThumb as GramJs.PhotoCachedSize || sizeAttribute || {};\n\n return {\n id: String(document.id),\n stickerSetId: stickerSetInfo ? String(stickerSetInfo.id) : MEMOJI_STICKER_ID,\n stickerSetAccessHash: stickerSetInfo && String(stickerSetInfo.accessHash),\n emoji,\n isAnimated,\n width,\n height,\n thumbnail,\n };\n}\n\nexport function buildStickerSet(set: GramJs.StickerSet): ApiStickerSet {\n const {\n archived,\n animated,\n installedDate,\n id,\n accessHash,\n title,\n thumbs,\n count,\n hash,\n shortName,\n } = set;\n\n return {\n archived,\n isAnimated: animated,\n installedDate,\n id: String(id),\n accessHash: String(accessHash),\n title,\n hasThumbnail: Boolean(thumbs?.length),\n count,\n hash,\n shortName,\n };\n}\n\nexport function buildStickerSetCovered(coveredStickerSet: GramJs.TypeStickerSetCovered): ApiStickerSet {\n const stickerSet = buildStickerSet(coveredStickerSet.set);\n\n const stickerSetCovers = (coveredStickerSet instanceof GramJs.StickerSetMultiCovered)\n ? coveredStickerSet.covers\n : [coveredStickerSet.cover];\n\n stickerSet.covers = [];\n stickerSetCovers.forEach((cover) => {\n if (cover instanceof GramJs.Document) {\n const coverSticker = buildStickerFromDocument(cover);\n if (coverSticker) {\n stickerSet.covers!.push(coverSticker);\n localDb.documents[String(cover.id)] = cover;\n }\n }\n });\n\n return stickerSet;\n}\n","/* eslint-disable no-bitwise */\n\n// eslint-disable-next-line max-len\n// Ref: https://github.com/telegramdesktop/tdesktop/blob/0743e71ab6b928d2ee5bae1aed991849b1e2b291/Telegram/SourceFiles/data/data_document.cpp#L1018\nexport function decodeWaveform(encoded5bit: Uint8Array) {\n const bitsCount = encoded5bit.length * 8;\n const valuesCount = Math.floor(bitsCount / 5);\n if (!valuesCount) {\n return [];\n }\n\n // Read each 5 bit of encoded5bit as 0-31 unsigned char.\n // We count the index of the byte in which the desired 5-bit sequence starts.\n // And then we read a uint16 starting from that byte to guarantee to get all of those 5 bits.\n //\n // BUT! if it is the last byte we have, we're not allowed to read a uint16 starting with it.\n // Because it will be an overflow (we'll access one byte after the available memory).\n // We see, that only the last 5 bits could start in the last available byte and be problematic.\n // So we read in a general way all the entries in a general way except the last one.\n const result = Array(valuesCount);\n const bitsData = encoded5bit;\n for (let i = 0, l = valuesCount - 1; i !== l; ++i) {\n const byteIndex = Math.floor((i * 5) / 8);\n const bitShift = Math.floor((i * 5) % 8);\n const value = bitsData[byteIndex] + (bitsData[byteIndex + 1] << 8);\n result[i] = ((value >> bitShift) & 0x1F);\n }\n const lastByteIndex = Math.floor(((valuesCount - 1) * 5) / 8);\n const lastBitShift = Math.floor(((valuesCount - 1) * 5) % 8);\n const lastValue = bitsData[lastByteIndex] + (bitsData[lastByteIndex + 1] << 8);\n result[valuesCount - 1] = (lastValue >> lastBitShift) & 0x1F;\n\n return result;\n}\n\nexport function interpolateArray(data: number[], fitCount: number) {\n let peak = 0;\n const newData = new Array(fitCount);\n const springFactor = data.length / fitCount;\n const leftFiller = data[0];\n const rightFiller = data[data.length - 1];\n for (let i = 0; i < fitCount; i++) {\n const idx = Math.floor(i * springFactor);\n const val = ((data[idx - 1] ?? leftFiller) + (data[idx] ?? leftFiller) + (data[idx + 1] ?? rightFiller)) / 3;\n newData[i] = val;\n if (peak < val) {\n peak = val;\n }\n }\n return { data: newData, peak };\n}\n","export interface ApiDimensions {\n width: number;\n height: number;\n}\n\nexport interface ApiPhotoSize extends ApiDimensions {\n type: 's' | 'm' | 'x' | 'y' | 'z';\n}\n\nexport interface ApiThumbnail extends ApiDimensions {\n dataUri: string;\n}\n\nexport interface ApiPhoto {\n id: string;\n thumbnail?: ApiThumbnail;\n sizes: ApiPhotoSize[];\n blobUrl?: string;\n}\n\nexport interface ApiSticker {\n id: string;\n stickerSetId: string;\n stickerSetAccessHash?: string;\n emoji?: string;\n isAnimated: boolean;\n width?: number;\n height?: number;\n thumbnail?: ApiThumbnail;\n isPreloadedGlobally?: boolean;\n}\n\nexport interface ApiStickerSet {\n archived?: true;\n isAnimated?: true;\n installedDate?: number;\n id: string;\n accessHash: string;\n title: string;\n hasThumbnail?: boolean;\n count: number;\n hash: number;\n stickers?: ApiSticker[];\n packs?: Record;\n covers?: ApiSticker[];\n shortName: string;\n}\n\nexport interface ApiVideo {\n id: string;\n mimeType: string;\n duration: number;\n fileName: string;\n width?: number;\n height?: number;\n supportsStreaming?: boolean;\n isRound?: boolean;\n isGif?: boolean;\n thumbnail?: ApiThumbnail;\n blobUrl?: string;\n size: number;\n}\n\nexport interface ApiAudio {\n size: number;\n mimeType: string;\n fileName: string;\n duration: number;\n performer?: string;\n title?: string;\n}\n\nexport interface ApiVoice {\n duration: number;\n waveform?: number[];\n}\n\nexport interface ApiDocument {\n id?: string;\n fileName: string;\n size: number;\n timestamp?: number;\n mimeType: string;\n thumbnail?: ApiThumbnail;\n previewBlobUrl?: string;\n mediaType?: 'photo' | 'video';\n mediaSize?: ApiDimensions;\n}\n\nexport interface ApiContact {\n firstName: string;\n lastName: string;\n phoneNumber: string;\n userId: number;\n}\n\nexport interface ApiPollAnswer {\n text: string;\n option: string;\n}\n\nexport interface ApiPollResult {\n isChosen?: true;\n isCorrect?: true;\n option: string;\n votersCount: number;\n}\n\nexport interface ApiPoll {\n id: string;\n summary: {\n closed?: true;\n isPublic?: true;\n multipleChoice?: true;\n quiz?: true;\n question: string;\n answers: ApiPollAnswer[];\n closePeriod?: number;\n closeDate?: number;\n };\n results: {\n results?: ApiPollResult[];\n totalVoters?: number;\n recentVoterIds?: number[];\n solution?: string;\n solutionEntities?: ApiMessageEntity[];\n };\n}\n\nexport interface ApiInvoice {\n text: string;\n title: string;\n photoUrl?: string;\n amount: number;\n currency: string;\n receiptMsgId?: number;\n isTest?: boolean;\n}\n\nexport type ApiNewPoll = {\n summary: ApiPoll['summary'];\n quiz?: {\n correctAnswers: string[];\n solution?: string;\n solutionEntities?: ApiMessageEntity[];\n };\n};\n\nexport interface ApiAction {\n text: string;\n targetUserIds?: number[];\n targetChatId?: number;\n type: 'historyClear' | 'contactSignUp' | 'chatCreate' | 'other';\n photo?: ApiPhoto;\n amount?: number;\n currency?: string;\n translationValues: string[];\n}\n\nexport interface ApiWebPage {\n id: number;\n url: string;\n displayUrl: string;\n type?: string;\n siteName?: string;\n title?: string;\n description?: string;\n photo?: ApiPhoto;\n duration?: number;\n document?: ApiDocument;\n video?: ApiVideo;\n}\n\nexport interface ApiMessageForwardInfo {\n isChannelPost: boolean;\n channelPostId?: number;\n isLinkedChannelPost?: boolean;\n fromChatId?: number;\n senderUserId?: number;\n fromMessageId?: number;\n hiddenUserName?: string;\n adminTitle?: string;\n}\n\nexport interface ApiMessageEntity {\n type: string;\n offset: number;\n length: number;\n userId?: number;\n url?: string;\n}\n\nexport enum ApiMessageEntityTypes {\n Bold = 'MessageEntityBold',\n Blockquote = 'MessageEntityBlockquote',\n BotCommand = 'MessageEntityBotCommand',\n Cashtag = 'MessageEntityCashtag',\n Code = 'MessageEntityCode',\n Email = 'MessageEntityEmail',\n Hashtag = 'MessageEntityHashtag',\n Italic = 'MessageEntityItalic',\n MentionName = 'MessageEntityMentionName',\n Mention = 'MessageEntityMention',\n Phone = 'MessageEntityPhone',\n Pre = 'MessageEntityPre',\n Strike = 'MessageEntityStrike',\n TextUrl = 'MessageEntityTextUrl',\n Url = 'MessageEntityUrl',\n Underline = 'MessageEntityUnderline',\n Unknown = 'MessageEntityUnknown',\n}\n\nexport interface ApiFormattedText {\n text: string;\n entities?: ApiMessageEntity[];\n}\n\nexport interface ApiMessage {\n id: number;\n chatId: number;\n content: {\n text?: ApiFormattedText;\n photo?: ApiPhoto;\n video?: ApiVideo;\n document?: ApiDocument;\n sticker?: ApiSticker;\n contact?: ApiContact;\n poll?: ApiPoll;\n action?: ApiAction;\n webPage?: ApiWebPage;\n audio?: ApiAudio;\n voice?: ApiVoice;\n invoice?: ApiInvoice;\n };\n date: number;\n isOutgoing: boolean;\n senderId?: number;\n replyToMessageId?: number;\n replyToTopMessageId?: number;\n sendingState?: 'messageSendingStatePending' | 'messageSendingStateFailed';\n forwardInfo?: ApiMessageForwardInfo;\n isDeleting?: boolean;\n previousLocalId?: number;\n views?: number;\n isEdited?: boolean;\n isMediaUnread?: boolean;\n groupedId?: string;\n isInAlbum?: boolean;\n hasUnreadMention?: boolean;\n inlineButtons?: ApiKeyboardButtons;\n keyboardButtons?: ApiKeyboardButtons;\n keyboardPlaceholder?: string;\n isKeyboardSingleUse?: boolean;\n viaBotId?: number;\n threadInfo?: ApiThreadInfo;\n adminTitle?: string;\n isScheduled?: boolean;\n shouldHideKeyboardButtons?: boolean;\n isFromScheduled?: boolean;\n}\n\nexport interface ApiThreadInfo {\n threadId: number;\n chatId: number;\n topMessageId?: number;\n originChannelId?: number;\n messagesCount: number;\n lastMessageId?: number;\n lastReadInboxMessageId?: number;\n recentReplierIds?: number[];\n}\n\nexport type ApiMessageOutgoingStatus = 'read' | 'succeeded' | 'pending' | 'failed';\n\nexport interface ApiKeyboardButton {\n type: 'command' | 'url' | 'callback' | 'requestPoll' | 'buy' | 'NOT_SUPPORTED';\n text: string;\n messageId: number;\n value?: string;\n}\n\nexport type ApiKeyboardButtons = ApiKeyboardButton[][];\nexport type ApiReplyKeyboard = {\n keyboardPlaceholder?: string;\n isKeyboardSingleUse?: boolean;\n} & {\n [K in 'inlineButtons' | 'keyboardButtons']?: ApiKeyboardButtons;\n};\n\nexport type ApiMessageSearchType = 'text' | 'media' | 'documents' | 'links' | 'audio' | 'profilePhoto';\nexport type ApiGlobalMessageSearchType = 'text' | 'media' | 'documents' | 'links' | 'audio' | 'voice';\n\nexport type ApiReportReason = 'spam' | 'violence' | 'pornography' | 'childAbuse'\n| 'copyright' | 'geoIrrelevant' | 'fake' | 'other';\n\nexport const MAIN_THREAD_ID = -1;\n\n// `Symbol` can not be transferred from worker\nexport const MESSAGE_DELETED = 'MESSAGE_DELETED';\n","// We cache avatars as Data URI for faster initial load\n// and messages media as Blob for smaller size.\n\nexport enum ApiMediaFormat {\n DataUri,\n BlobUrl,\n Lottie,\n Progressive,\n Stream,\n}\n\nexport type ApiParsedMedia = string | Blob | AnyLiteral | ArrayBuffer;\nexport type ApiPreparedMedia = string | AnyLiteral;\nexport type ApiMediaFormatToPrepared = T extends ApiMediaFormat.Lottie ? AnyLiteral : string;\n","import BigInt from 'big-integer';\nimport { Api as GramJs } from '../../../lib/gramjs';\n\nimport { ApiPrivacyKey } from '../../../types';\n\nimport { generateRandomBytes, readBigIntFromBuffer } from '../../../lib/gramjs/Helpers';\nimport {\n ApiSticker,\n ApiVideo,\n ApiNewPoll,\n ApiMessageEntity,\n ApiMessageEntityTypes,\n ApiChatFolder,\n ApiChatBannedRights,\n ApiChatAdminRights,\n ApiReportReason,\n} from '../../types';\nimport localDb from '../localDb';\nimport { pick } from '../../../util/iteratees';\n\nexport function getEntityTypeById(chatOrUserId: number) {\n if (chatOrUserId > 0) {\n return 'user';\n } else if (chatOrUserId <= -1000000000) {\n return 'channel';\n } else {\n return 'chat';\n }\n}\n\nexport function buildPeer(chatOrUserId: number): GramJs.TypePeer {\n if (chatOrUserId > 0) {\n return new GramJs.PeerUser({\n userId: chatOrUserId,\n });\n } else if (chatOrUserId <= -1000000000) {\n return new GramJs.PeerChannel({\n channelId: -chatOrUserId,\n });\n } else {\n return new GramJs.PeerChat({\n chatId: -chatOrUserId,\n });\n }\n}\n\nexport function buildInputPeer(chatOrUserId: number, accessHash?: string): GramJs.TypeInputPeer {\n if (chatOrUserId > 0 || chatOrUserId <= -1000000000) {\n return chatOrUserId > 0\n ? new GramJs.InputPeerUser({\n userId: chatOrUserId,\n accessHash: BigInt(accessHash!),\n })\n : new GramJs.InputPeerChannel({\n channelId: -chatOrUserId,\n accessHash: BigInt(accessHash!),\n });\n } else {\n return new GramJs.InputPeerChat({\n chatId: -chatOrUserId,\n });\n }\n}\n\nexport function buildInputPeerFromLocalDb(chatOrUserId: number): GramJs.TypeInputPeer | undefined {\n if (chatOrUserId > 0) {\n const { accessHash } = localDb.users[chatOrUserId] || {};\n\n return accessHash\n ? new GramJs.InputPeerUser({\n userId: chatOrUserId,\n accessHash,\n })\n : undefined;\n }\n\n if (chatOrUserId <= -1000000000) {\n const { accessHash } = (localDb.chats[-chatOrUserId] as GramJs.Channel) || {};\n\n return accessHash\n ? new GramJs.InputPeerChannel({\n channelId: -chatOrUserId,\n accessHash,\n })\n : undefined;\n }\n\n return new GramJs.InputPeerChat({\n chatId: -chatOrUserId,\n });\n}\n\nexport function buildInputEntity(chatOrUserId: number, accessHash?: string) {\n if (chatOrUserId > 0) {\n return new GramJs.InputUser({\n userId: chatOrUserId,\n accessHash: BigInt(accessHash!),\n });\n } else if (chatOrUserId <= -1000000000) {\n return new GramJs.InputChannel({\n channelId: -chatOrUserId,\n accessHash: BigInt(accessHash!),\n });\n } else {\n return -chatOrUserId;\n }\n}\n\nexport function buildInputStickerSet(id: string, accessHash: string) {\n return new GramJs.InputStickerSetID({\n id: BigInt(id),\n accessHash: BigInt(accessHash),\n });\n}\n\nexport function buildInputStickerSetShortName(shortName: string) {\n return new GramJs.InputStickerSetShortName({\n shortName,\n });\n}\n\nexport function buildInputDocument(media: ApiSticker | ApiVideo) {\n const document = localDb.documents[media.id];\n\n if (!document) {\n return undefined;\n }\n\n return new GramJs.InputDocument(pick(document, [\n 'id',\n 'accessHash',\n 'fileReference',\n ]));\n}\n\nexport function buildInputMediaDocument(media: ApiSticker | ApiVideo) {\n const inputDocument = buildInputDocument(media);\n\n if (!inputDocument) {\n return undefined;\n }\n\n return new GramJs.InputMediaDocument({ id: inputDocument });\n}\n\nexport function buildInputPoll(pollParams: ApiNewPoll, randomId: BigInt.BigInteger) {\n const { summary, quiz } = pollParams;\n\n const poll = new GramJs.Poll({\n id: randomId,\n publicVoters: summary.isPublic,\n question: summary.question,\n answers: summary.answers.map(({ text, option }) => new GramJs.PollAnswer({ text, option: Buffer.from(option) })),\n quiz: summary.quiz,\n multipleChoice: summary.multipleChoice,\n });\n\n if (!quiz) {\n return new GramJs.InputMediaPoll({ poll });\n }\n\n const correctAnswers = quiz.correctAnswers.map((key) => Buffer.from(key));\n const { solution } = quiz;\n const solutionEntities = quiz.solutionEntities ? quiz.solutionEntities.map(buildMtpMessageEntity) : [];\n\n return new GramJs.InputMediaPoll({\n poll,\n correctAnswers,\n ...(solution && {\n solution,\n solutionEntities,\n }),\n });\n}\n\nexport function buildFilterFromApiFolder(folder: ApiChatFolder): GramJs.DialogFilter {\n const {\n emoticon,\n contacts,\n nonContacts,\n groups,\n channels,\n bots,\n excludeArchived,\n excludeMuted,\n excludeRead,\n pinnedChatIds,\n includedChatIds,\n excludedChatIds,\n } = folder;\n\n const pinnedPeers = pinnedChatIds\n ? pinnedChatIds.map(buildInputPeerFromLocalDb).filter(Boolean as any)\n : [];\n\n const includePeers = includedChatIds\n ? includedChatIds.map(buildInputPeerFromLocalDb).filter(Boolean as any)\n : [];\n\n const excludePeers = excludedChatIds\n ? excludedChatIds.map(buildInputPeerFromLocalDb).filter(Boolean as any)\n : [];\n\n return new GramJs.DialogFilter({\n id: folder.id,\n title: folder.title,\n emoticon: emoticon || undefined,\n contacts: contacts || undefined,\n nonContacts: nonContacts || undefined,\n groups: groups || undefined,\n bots: bots || undefined,\n excludeArchived: excludeArchived || undefined,\n excludeMuted: excludeMuted || undefined,\n excludeRead: excludeRead || undefined,\n broadcasts: channels || undefined,\n pinnedPeers,\n includePeers,\n excludePeers,\n });\n}\n\nexport function generateRandomBigInt() {\n return readBigIntFromBuffer(generateRandomBytes(8), true, true);\n}\n\nexport function buildMessageFromUpdate(\n id: number,\n chatId: number,\n update: GramJs.UpdateShortSentMessage | GramJs.UpdateServiceNotification,\n) {\n // This is not a proper message, but we only need these fields for downloading media through `localDb`.\n return new GramJs.Message({\n id,\n peerId: buildPeer(chatId),\n fromId: buildPeer(chatId),\n media: update.media,\n } as GramJs.Message);\n}\n\nexport function buildMtpMessageEntity(entity: ApiMessageEntity): GramJs.TypeMessageEntity {\n const {\n type, offset, length, url, userId,\n } = entity;\n\n const user = userId ? localDb.users[userId] : undefined;\n\n switch (type) {\n case ApiMessageEntityTypes.Bold:\n return new GramJs.MessageEntityBold({ offset, length });\n case ApiMessageEntityTypes.Italic:\n return new GramJs.MessageEntityItalic({ offset, length });\n case ApiMessageEntityTypes.Underline:\n return new GramJs.MessageEntityUnderline({ offset, length });\n case ApiMessageEntityTypes.Strike:\n return new GramJs.MessageEntityStrike({ offset, length });\n case ApiMessageEntityTypes.Code:\n return new GramJs.MessageEntityCode({ offset, length });\n case ApiMessageEntityTypes.Pre:\n return new GramJs.MessageEntityPre({ offset, length, language: '' });\n case ApiMessageEntityTypes.Blockquote:\n return new GramJs.MessageEntityBlockquote({ offset, length });\n case ApiMessageEntityTypes.TextUrl:\n return new GramJs.MessageEntityTextUrl({ offset, length, url: url! });\n case ApiMessageEntityTypes.Url:\n return new GramJs.MessageEntityUrl({ offset, length });\n case ApiMessageEntityTypes.Hashtag:\n return new GramJs.MessageEntityHashtag({ offset, length });\n case ApiMessageEntityTypes.MentionName:\n return new GramJs.InputMessageEntityMentionName({\n offset,\n length,\n userId: new GramJs.InputUser({ userId: userId!, accessHash: user!.accessHash! }),\n });\n default:\n return new GramJs.MessageEntityUnknown({ offset, length });\n }\n}\n\n// TODO: This formula is taken from API docs, but doesn't seem to calculate hash correctly\nexport function calculateResultHash(ids: number[]) {\n let hash = 0;\n ids.forEach((id) => {\n // eslint-disable-next-line no-bitwise\n hash = (((hash * 0x4F25) & 0x7FFFFFFF) + id) & 0x7FFFFFFF;\n });\n\n return hash;\n}\n\nexport function isMessageWithMedia(message: GramJs.Message | GramJs.UpdateServiceNotification) {\n const { media } = message;\n if (!media) {\n return false;\n }\n\n return (\n media instanceof GramJs.MessageMediaPhoto\n || media instanceof GramJs.MessageMediaDocument\n || (\n media instanceof GramJs.MessageMediaWebPage\n && media.webpage instanceof GramJs.WebPage\n && (\n media.webpage.photo instanceof GramJs.Photo || (\n media.webpage.document instanceof GramJs.Document\n && media.webpage.document.mimeType.startsWith('video')\n )\n )\n )\n );\n}\n\nexport function isServiceMessageWithMedia(message: GramJs.MessageService) {\n return 'photo' in message.action && message.action.photo instanceof GramJs.Photo;\n}\n\nexport function buildChatPhotoForLocalDb(photo: GramJs.TypePhoto) {\n if (photo instanceof GramJs.PhotoEmpty) {\n return new GramJs.ChatPhotoEmpty();\n }\n\n const { dcId, id: photoId } = photo;\n\n return new GramJs.ChatPhoto({\n dcId,\n photoId,\n });\n}\n\nexport function buildInputContact({\n phone,\n firstName,\n lastName,\n}: {\n phone: string;\n firstName: string;\n lastName: string;\n}) {\n return new GramJs.InputPhoneContact({\n clientId: BigInt(1),\n phone,\n firstName,\n lastName,\n });\n}\n\nexport function buildChatBannedRights(\n bannedRights: ApiChatBannedRights,\n untilDate = 0,\n) {\n return new GramJs.ChatBannedRights({\n ...bannedRights,\n untilDate,\n });\n}\n\nexport function buildChatAdminRights(\n adminRights: ApiChatAdminRights,\n) {\n return new GramJs.ChatAdminRights(adminRights);\n}\n\nexport function buildShippingInfo(info: GramJs.PaymentRequestedInfo) {\n const { shippingAddress } = info;\n return new GramJs.PaymentRequestedInfo({\n ...info,\n shippingAddress: shippingAddress\n ? new GramJs.PostAddress(shippingAddress)\n : undefined,\n });\n}\n\nexport function buildInputPrivacyKey(privacyKey: ApiPrivacyKey) {\n switch (privacyKey) {\n case 'phoneNumber':\n return new GramJs.InputPrivacyKeyPhoneNumber();\n\n case 'lastSeen':\n return new GramJs.InputPrivacyKeyStatusTimestamp();\n\n case 'profilePhoto':\n return new GramJs.InputPrivacyKeyProfilePhoto();\n\n case 'forwards':\n return new GramJs.InputPrivacyKeyForwards();\n\n case 'chatInvite':\n return new GramJs.InputPrivacyKeyChatInvite();\n }\n\n return undefined;\n}\n\nexport function buildInputReportReason(reason: ApiReportReason) {\n switch (reason) {\n case 'spam':\n return new GramJs.InputReportReasonSpam();\n case 'violence':\n return new GramJs.InputReportReasonViolence();\n case 'childAbuse':\n return new GramJs.InputReportReasonChildAbuse();\n case 'pornography':\n return new GramJs.InputReportReasonPornography();\n case 'copyright':\n return new GramJs.InputReportReasonCopyright();\n case 'fake':\n return new GramJs.InputReportReasonFake();\n case 'geoIrrelevant':\n return new GramJs.InputReportReasonGeoIrrelevant();\n case 'other':\n return new GramJs.InputReportReasonOther();\n }\n\n return undefined;\n}\n","import { Api as GramJs } from '../../lib/gramjs';\nimport localDb from './localDb';\nimport { getApiChatIdFromMtpPeer } from './apiBuilders/chats';\n\nexport function resolveMessageApiChatId(mtpMessage: GramJs.TypeMessage) {\n if (!(mtpMessage instanceof GramJs.Message || mtpMessage instanceof GramJs.MessageService)) {\n return undefined;\n }\n\n return getApiChatIdFromMtpPeer(mtpMessage.peerId);\n}\n\nexport function addMessageToLocalDb(message: GramJs.Message | GramJs.MessageService) {\n const messageFullId = `${resolveMessageApiChatId(message)}-${message.id}`;\n localDb.messages[messageFullId] = message;\n\n if (\n message instanceof GramJs.Message\n && message.media instanceof GramJs.MessageMediaDocument\n && message.media.document instanceof GramJs.Document\n ) {\n localDb.documents[String(message.media.document.id)] = message.media.document;\n }\n\n if (\n message instanceof GramJs.Message\n && message.media instanceof GramJs.MessageMediaWebPage\n && message.media.webpage instanceof GramJs.WebPage\n && message.media.webpage.document instanceof GramJs.Document\n ) {\n localDb.documents[String(message.media.webpage.document.id)] = message.media.webpage.document;\n }\n\n if (message instanceof GramJs.MessageService && 'photo' in message.action) {\n addPhotoToLocalDb(message.action.photo);\n }\n}\n\nexport function addPhotoToLocalDb(photo: GramJs.TypePhoto) {\n if (photo instanceof GramJs.Photo) {\n localDb.photos[String(photo.id)] = photo;\n }\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\nimport {\n ApiMessage,\n ApiMessageForwardInfo,\n ApiPhoto,\n ApiSticker,\n ApiVideo,\n ApiVoice,\n ApiAudio,\n ApiDocument,\n ApiAction,\n ApiContact,\n ApiAttachment,\n ApiPoll,\n ApiNewPoll,\n ApiWebPage,\n ApiMessageEntity,\n ApiFormattedText,\n ApiReplyKeyboard,\n ApiKeyboardButton,\n ApiChat,\n ApiThreadInfo,\n ApiInvoice,\n} from '../../types';\n\nimport { DELETED_COMMENTS_CHANNEL_ID, LOCAL_MESSAGE_ID_BASE, SERVICE_NOTIFICATIONS_USER_ID } from '../../../config';\nimport { pick } from '../../../util/iteratees';\nimport { getApiChatIdFromMtpPeer } from './chats';\nimport { buildStickerFromDocument } from './symbols';\nimport { buildApiPhoto, buildApiThumbnailFromStripped } from './common';\nimport { interpolateArray } from '../../../util/waveform';\nimport { buildPeer } from '../gramjsBuilders';\nimport { addPhotoToLocalDb, resolveMessageApiChatId } from '../helpers';\n\nconst LOCAL_IMAGE_UPLOADING_TEMP_ID = 'temp';\nconst LOCAL_VIDEO_UPLOADING_TEMP_ID = 'temp';\nconst INPUT_WAVEFORM_LENGTH = 63;\n\nlet localMessageCounter = LOCAL_MESSAGE_ID_BASE;\nlet currentUserId!: number;\n\nexport function setMessageBuilderCurrentUserId(_currentUserId: number) {\n currentUserId = _currentUserId;\n}\n\nexport function buildApiMessage(mtpMessage: GramJs.TypeMessage): ApiMessage | undefined {\n const chatId = resolveMessageApiChatId(mtpMessage);\n if (\n !chatId\n || !(mtpMessage instanceof GramJs.Message || mtpMessage instanceof GramJs.MessageService)) {\n return undefined;\n }\n\n return buildApiMessageWithChatId(chatId, mtpMessage);\n}\n\nexport function buildApiMessageFromShort(mtpMessage: GramJs.UpdateShortMessage): ApiMessage {\n const chatId = getApiChatIdFromMtpPeer({ userId: mtpMessage.userId } as GramJs.TypePeer);\n\n return buildApiMessageWithChatId(chatId, {\n ...mtpMessage,\n fromId: buildPeer(mtpMessage.out ? currentUserId : mtpMessage.userId),\n });\n}\n\nexport function buildApiMessageFromShortChat(mtpMessage: GramJs.UpdateShortChatMessage): ApiMessage {\n const chatId = getApiChatIdFromMtpPeer({ chatId: mtpMessage.chatId } as GramJs.TypePeer);\n\n return buildApiMessageWithChatId(chatId, {\n ...mtpMessage,\n fromId: buildPeer(mtpMessage.fromId),\n });\n}\n\nexport function buildApiMessageFromNotification(\n notification: GramJs.UpdateServiceNotification,\n currentDate: number,\n): ApiMessage {\n const localId = localMessageCounter++;\n let content: ApiMessage['content'] = {};\n\n if (notification.media) {\n content = {\n ...buildMessageMediaContent(notification.media),\n };\n }\n\n if (notification.message && !content.sticker && !content.poll && !content.contact) {\n content = {\n ...content,\n text: buildMessageTextContent(notification.message, notification.entities),\n };\n }\n\n return {\n id: localId,\n chatId: SERVICE_NOTIFICATIONS_USER_ID,\n date: notification.inboxDate || currentDate,\n content,\n isOutgoing: false,\n };\n}\n\ntype UniversalMessage = (\n Pick\n & Pick, (\n 'out' | 'message' | 'entities' | 'fromId' | 'peerId' | 'fwdFrom' | 'replyTo' | 'replyMarkup' | 'post' |\n 'media' | 'action' | 'views' | 'editDate' | 'editHide' | 'mediaUnread' | 'groupedId' | 'mentioned' | 'viaBotId' |\n 'replies' | 'fromScheduled' | 'postAuthor'\n )>\n);\n\nexport function buildApiMessageWithChatId(chatId: number, mtpMessage: UniversalMessage): ApiMessage {\n const fromId = mtpMessage.fromId ? getApiChatIdFromMtpPeer(mtpMessage.fromId) : undefined;\n const peerId = mtpMessage.peerId ? getApiChatIdFromMtpPeer(mtpMessage.peerId) : undefined;\n const isChatWithSelf = !fromId && chatId === currentUserId;\n const isOutgoing = (mtpMessage.out && !mtpMessage.post) || (isChatWithSelf && !mtpMessage.fwdFrom);\n\n let content: ApiMessage['content'] = {};\n\n if (mtpMessage.media) {\n content = {\n ...buildMessageMediaContent(mtpMessage.media),\n };\n }\n\n if (mtpMessage.message && !content.sticker && !content.poll && !content.contact) {\n content = {\n ...content,\n text: buildMessageTextContent(mtpMessage.message, mtpMessage.entities),\n };\n }\n\n const action = mtpMessage.action\n && buildAction(mtpMessage.action, fromId, peerId, Boolean(mtpMessage.post), isOutgoing);\n if (action) {\n content.action = action;\n }\n\n const { replyToMsgId, replyToTopId } = mtpMessage.replyTo || {};\n const isEdited = mtpMessage.editDate && !mtpMessage.editHide;\n const {\n inlineButtons, keyboardButtons, keyboardPlaceholder, isKeyboardSingleUse,\n } = buildReplyButtons(mtpMessage) || {};\n const forwardInfo = mtpMessage.fwdFrom && buildApiMessageForwardInfo(mtpMessage.fwdFrom, isChatWithSelf);\n const { replies, mediaUnread: isMediaUnread, postAuthor } = mtpMessage;\n const groupedId = mtpMessage.groupedId && mtpMessage.groupedId.toString();\n const isInAlbum = Boolean(groupedId) && !(content.document || content.audio);\n const shouldHideKeyboardButtons = mtpMessage.replyMarkup instanceof GramJs.ReplyKeyboardHide;\n\n return {\n id: mtpMessage.id,\n chatId,\n isOutgoing,\n content,\n date: mtpMessage.date,\n senderId: fromId || (mtpMessage.out && mtpMessage.post && currentUserId) || chatId,\n views: mtpMessage.views,\n isFromScheduled: mtpMessage.fromScheduled,\n ...(replyToMsgId && { replyToMessageId: replyToMsgId }),\n ...(replyToTopId && { replyToTopMessageId: replyToTopId }),\n ...(forwardInfo && { forwardInfo }),\n ...(isEdited && { isEdited }),\n ...(isMediaUnread && { isMediaUnread }),\n ...(mtpMessage.mentioned && isMediaUnread && { hasUnreadMention: true }),\n ...(groupedId && {\n groupedId,\n isInAlbum,\n }),\n inlineButtons,\n ...(keyboardButtons && { keyboardButtons, keyboardPlaceholder, isKeyboardSingleUse }),\n ...(shouldHideKeyboardButtons && { shouldHideKeyboardButtons }),\n ...(mtpMessage.viaBotId && { viaBotId: mtpMessage.viaBotId }),\n ...(replies?.comments && { threadInfo: buildThreadInfo(replies, mtpMessage.id, chatId) }),\n ...(postAuthor && { adminTitle: postAuthor }),\n };\n}\n\nexport function buildMessageTextContent(\n message: string,\n entities?: GramJs.TypeMessageEntity[],\n): ApiFormattedText {\n return {\n text: message,\n ...(entities && { entities: entities.map(buildApiMessageEntity) }),\n };\n}\n\nexport function buildMessageDraft(draft: GramJs.TypeDraftMessage) {\n if (draft instanceof GramJs.DraftMessageEmpty) {\n return undefined;\n }\n\n const {\n message, entities, replyToMsgId, date,\n } = draft;\n\n return {\n formattedText: message ? buildMessageTextContent(message, entities) : undefined,\n replyingToId: replyToMsgId,\n date,\n };\n}\n\nexport function buildMessageMediaContent(media: GramJs.TypeMessageMedia): ApiMessage['content'] | undefined {\n const sticker = buildSticker(media);\n if (sticker) return { sticker };\n\n const photo = buildPhoto(media);\n if (photo) return { photo };\n\n const video = buildVideo(media);\n if (video) return { video };\n\n const audio = buildAudio(media);\n if (audio) return { audio };\n\n const voice = buildVoice(media);\n if (voice) return { voice };\n\n const document = buildDocumentFromMedia(media);\n if (document) return { document };\n\n const contact = buildContact(media);\n if (contact) return { contact };\n\n const poll = buildPollFromMedia(media);\n if (poll) return { poll };\n\n const webPage = buildWebPage(media);\n if (webPage) return { webPage };\n\n const invoice = buildInvoiceFromMedia(media);\n if (invoice) return { invoice };\n\n return undefined;\n}\n\nfunction buildApiMessageForwardInfo(fwdFrom: GramJs.MessageFwdHeader, isChatWithSelf = false): ApiMessageForwardInfo {\n const savedFromPeerId = fwdFrom.savedFromPeer && getApiChatIdFromMtpPeer(fwdFrom.savedFromPeer);\n const fromId = fwdFrom.fromId && getApiChatIdFromMtpPeer(fwdFrom.fromId);\n\n return {\n isChannelPost: Boolean(fwdFrom.channelPost),\n channelPostId: fwdFrom.channelPost,\n isLinkedChannelPost: Boolean(fwdFrom.channelPost && savedFromPeerId && !isChatWithSelf),\n fromChatId: savedFromPeerId || fromId,\n fromMessageId: fwdFrom.channelPost || fwdFrom.savedFromMsgId,\n senderUserId: fromId,\n hiddenUserName: fwdFrom.fromName,\n adminTitle: fwdFrom.postAuthor,\n };\n}\n\nfunction buildSticker(media: GramJs.TypeMessageMedia): ApiSticker | undefined {\n if (\n !(media instanceof GramJs.MessageMediaDocument)\n || !media.document\n || !(media.document instanceof GramJs.Document)\n ) {\n return undefined;\n }\n\n return buildStickerFromDocument(media.document);\n}\n\nfunction buildPhoto(media: GramJs.TypeMessageMedia): ApiPhoto | undefined {\n if (!(media instanceof GramJs.MessageMediaPhoto) || !media.photo || !(media.photo instanceof GramJs.Photo)) {\n return undefined;\n }\n\n if (media.ttlSeconds) {\n return undefined;\n }\n\n return buildApiPhoto(media.photo);\n}\n\nexport function buildVideoFromDocument(document: GramJs.Document): ApiVideo | undefined {\n if (document instanceof GramJs.DocumentEmpty) {\n return undefined;\n }\n\n const {\n id, mimeType, thumbs, size, attributes,\n } = document;\n\n const videoAttr = attributes\n .find((a: any): a is GramJs.DocumentAttributeVideo => a instanceof GramJs.DocumentAttributeVideo);\n\n if (!videoAttr) {\n return undefined;\n }\n\n const gifAttr = attributes\n .find((a: any): a is GramJs.DocumentAttributeAnimated => a instanceof GramJs.DocumentAttributeAnimated);\n\n const {\n duration,\n w: width,\n h: height,\n supportsStreaming = false,\n roundMessage: isRound = false,\n } = videoAttr;\n\n return {\n id: String(id),\n mimeType,\n duration,\n fileName: getFilenameFromDocument(document, 'video'),\n width,\n height,\n supportsStreaming,\n isRound,\n isGif: Boolean(gifAttr),\n thumbnail: buildApiThumbnailFromStripped(thumbs),\n size,\n };\n}\n\nfunction buildVideo(media: GramJs.TypeMessageMedia): ApiVideo | undefined {\n if (\n !(media instanceof GramJs.MessageMediaDocument)\n || !(media.document instanceof GramJs.Document)\n || !media.document.mimeType.startsWith('video')\n ) {\n return undefined;\n }\n\n return buildVideoFromDocument(media.document);\n}\n\nfunction buildAudio(media: GramJs.TypeMessageMedia): ApiAudio | undefined {\n if (\n !(media instanceof GramJs.MessageMediaDocument)\n || !media.document\n || !(media.document instanceof GramJs.Document)\n ) {\n return undefined;\n }\n\n const audioAttribute = media.document.attributes\n .find((attr: any): attr is GramJs.DocumentAttributeAudio => (\n attr instanceof GramJs.DocumentAttributeAudio\n ));\n\n if (!audioAttribute || audioAttribute.voice) {\n return undefined;\n }\n\n return {\n fileName: getFilenameFromDocument(media.document, 'audio'),\n ...pick(media.document, ['size', 'mimeType']),\n ...pick(audioAttribute, ['duration', 'performer', 'title']),\n };\n}\n\nfunction buildVoice(media: GramJs.TypeMessageMedia): ApiVoice | undefined {\n if (\n !(media instanceof GramJs.MessageMediaDocument)\n || !media.document\n || !(media.document instanceof GramJs.Document)\n ) {\n return undefined;\n }\n\n const audioAttribute = media.document.attributes\n .find((attr: any): attr is GramJs.DocumentAttributeAudio => (\n attr instanceof GramJs.DocumentAttributeAudio\n ));\n\n if (!audioAttribute || !audioAttribute.voice) {\n return undefined;\n }\n\n const { duration, waveform } = audioAttribute;\n\n return {\n duration,\n waveform: waveform ? Array.from(waveform) : undefined,\n };\n}\n\nfunction buildDocumentFromMedia(media: GramJs.TypeMessageMedia) {\n if (!(media instanceof GramJs.MessageMediaDocument) || !media.document) {\n return undefined;\n }\n\n if (media.ttlSeconds) {\n return undefined;\n }\n\n return buildApiDocument(media.document);\n}\n\nexport function buildApiDocument(document: GramJs.TypeDocument): ApiDocument | undefined {\n if (!(document instanceof GramJs.Document)) {\n return undefined;\n }\n\n const {\n id, size, mimeType, date, thumbs, attributes,\n } = document;\n\n const thumbnail = thumbs && buildApiThumbnailFromStripped(thumbs);\n\n let mediaType: ApiDocument['mediaType'] | undefined;\n let mediaSize: ApiDocument['mediaSize'] | undefined;\n const photoSize = thumbs && thumbs.find((s: any): s is GramJs.PhotoSize => s instanceof GramJs.PhotoSize);\n if (photoSize) {\n mediaSize = {\n width: photoSize.w,\n height: photoSize.h,\n };\n\n if (mimeType.startsWith('image/')) {\n mediaType = 'photo';\n\n const imageAttribute = attributes\n .find((a: any): a is GramJs.DocumentAttributeImageSize => a instanceof GramJs.DocumentAttributeImageSize);\n\n if (imageAttribute) {\n const { w: width, h: height } = imageAttribute;\n mediaSize = {\n width,\n height,\n };\n }\n } else if (mimeType.startsWith('video/')) {\n mediaType = 'video';\n }\n }\n\n return {\n id: String(id),\n size,\n mimeType,\n timestamp: date,\n fileName: getFilenameFromDocument(document),\n thumbnail,\n mediaType,\n mediaSize,\n };\n}\n\nfunction buildContact(media: GramJs.TypeMessageMedia): ApiContact | undefined {\n if (!(media instanceof GramJs.MessageMediaContact)) {\n return undefined;\n }\n\n return pick(media, [\n 'firstName',\n 'lastName',\n 'phoneNumber',\n 'userId',\n ]);\n}\n\nfunction buildPollFromMedia(media: GramJs.TypeMessageMedia): ApiPoll | undefined {\n if (!(media instanceof GramJs.MessageMediaPoll)) {\n return undefined;\n }\n\n return buildPoll(media.poll, media.results);\n}\n\nfunction buildInvoiceFromMedia(media: GramJs.TypeMessageMedia): ApiInvoice | undefined {\n if (!(media instanceof GramJs.MessageMediaInvoice)) {\n return undefined;\n }\n\n return buildInvoice(media);\n}\n\nexport function buildPoll(poll: GramJs.Poll, pollResults: GramJs.PollResults): ApiPoll {\n const { id, answers: rawAnswers } = poll;\n const answers = rawAnswers.map((answer) => ({\n text: answer.text,\n option: String.fromCharCode(...answer.option),\n }));\n\n return {\n id: id.toString(),\n summary: {\n isPublic: poll.publicVoters,\n ...pick(poll, [\n 'closed',\n 'multipleChoice',\n 'quiz',\n 'question',\n 'closePeriod',\n 'closeDate',\n ]),\n answers,\n },\n results: buildPollResults(pollResults),\n };\n}\n\nexport function buildInvoice(media: GramJs.MessageMediaInvoice): ApiInvoice {\n const {\n description: text, title, photo, test, totalAmount, currency, receiptMsgId,\n } = media;\n\n return {\n text,\n title,\n photoUrl: photo?.url,\n receiptMsgId,\n amount: Number(totalAmount),\n currency,\n isTest: test,\n };\n}\n\nexport function buildPollResults(pollResults: GramJs.PollResults): ApiPoll['results'] {\n const {\n results: rawResults, totalVoters, recentVoters, solution, solutionEntities: entities,\n } = pollResults;\n const results = rawResults && rawResults.map(({\n option, chosen, correct, voters,\n }) => ({\n isChosen: chosen,\n isCorrect: correct,\n option: String.fromCharCode(...option),\n votersCount: voters,\n }));\n\n return {\n totalVoters,\n recentVoterIds: recentVoters,\n results,\n solution,\n ...(entities && { solutionEntities: entities.map(buildApiMessageEntity) }),\n };\n}\n\nexport function buildWebPage(media: GramJs.TypeMessageMedia): ApiWebPage | undefined {\n if (\n !(media instanceof GramJs.MessageMediaWebPage)\n || !(media.webpage instanceof GramJs.WebPage)\n ) {\n return undefined;\n }\n\n const { id, photo, document } = media.webpage;\n\n let video;\n if (document instanceof GramJs.Document && document.mimeType.startsWith('video/')) {\n video = buildVideoFromDocument(document);\n }\n\n return {\n id: Number(id),\n ...pick(media.webpage, [\n 'url',\n 'displayUrl',\n 'type',\n 'siteName',\n 'title',\n 'description',\n 'duration',\n ]),\n photo: photo instanceof GramJs.Photo ? buildApiPhoto(photo) : undefined,\n document: !video && document ? buildApiDocument(document) : undefined,\n video,\n };\n}\n\nfunction buildAction(\n action: GramJs.TypeMessageAction,\n senderId: number | undefined,\n targetPeerId: number | undefined,\n isChannelPost: boolean,\n isOutgoing: boolean,\n): ApiAction | undefined {\n if (action instanceof GramJs.MessageActionEmpty) {\n return undefined;\n }\n\n let amount: number | undefined;\n let currency: string | undefined;\n let text: string;\n const translationValues = [];\n let type: ApiAction['type'] = 'other';\n let photo: ApiPhoto | undefined;\n\n const targetUserIds = 'users' in action\n ? action.users && action.users\n : ('userId' in action && [action.userId]) || [];\n let targetChatId: number | undefined;\n\n if (action instanceof GramJs.MessageActionChatCreate) {\n text = 'Notification.CreatedChatWithTitle';\n translationValues.push('%action_origin%', action.title);\n type = 'chatCreate';\n } else if (action instanceof GramJs.MessageActionChatEditTitle) {\n if (isChannelPost) {\n text = 'Channel.MessageTitleUpdated';\n translationValues.push(action.title);\n } else {\n text = 'Notification.ChangedGroupName';\n translationValues.push('%action_origin%', action.title);\n }\n } else if (action instanceof GramJs.MessageActionChatEditPhoto) {\n if (isChannelPost) {\n text = 'Channel.MessagePhotoUpdated';\n } else {\n text = 'Notification.ChangedGroupPhoto';\n translationValues.push('%action_origin%');\n }\n } else if (action instanceof GramJs.MessageActionChatDeletePhoto) {\n if (isChannelPost) {\n text = 'Channel.MessagePhotoRemoved';\n } else {\n text = 'Group.MessagePhotoRemoved';\n }\n } else if (action instanceof GramJs.MessageActionChatAddUser) {\n if (!senderId || targetUserIds.includes(senderId)) {\n text = 'Notification.JoinedChat';\n translationValues.push('%target_user%');\n } else {\n text = 'Notification.Invited';\n translationValues.push('%action_origin%', '%target_user%');\n }\n } else if (action instanceof GramJs.MessageActionChatDeleteUser) {\n if (!senderId || targetUserIds.includes(senderId)) {\n text = 'Notification.LeftChat';\n translationValues.push('%target_user%');\n } else {\n text = 'Notification.Kicked';\n translationValues.push('%action_origin%', '%target_user%');\n }\n } else if (action instanceof GramJs.MessageActionChatJoinedByLink) {\n text = 'Notification.JoinedGroupByLink';\n translationValues.push('%action_origin%');\n } else if (action instanceof GramJs.MessageActionChannelCreate) {\n text = 'Notification.CreatedChannel';\n } else if (action instanceof GramJs.MessageActionChatMigrateTo) {\n targetChatId = getApiChatIdFromMtpPeer(action);\n text = 'Migrated to %target_chat%';\n translationValues.push('%target_chat%');\n } else if (action instanceof GramJs.MessageActionChannelMigrateFrom) {\n targetChatId = getApiChatIdFromMtpPeer(action);\n text = 'Migrated from %target_chat%';\n translationValues.push('%target_chat%');\n } else if (action instanceof GramJs.MessageActionPinMessage) {\n text = 'Chat.Service.Group.UpdatedPinnedMessage1';\n translationValues.push('%action_origin%', '%message%');\n } else if (action instanceof GramJs.MessageActionHistoryClear) {\n text = 'HistoryCleared';\n type = 'historyClear';\n } else if (action instanceof GramJs.MessageActionPhoneCall) {\n const withDuration = Boolean(action.duration);\n text = [\n withDuration ? 'ChatList.Service' : 'Chat',\n action.video ? 'VideoCall' : 'Call',\n isOutgoing ? (withDuration ? 'outgoing' : 'Outgoing') : (withDuration ? 'incoming' : 'Incoming'),\n ].join('.');\n\n if (withDuration) {\n const mins = Math.max(Math.round(action.duration! / 60), 1);\n translationValues.push(`${mins} min${mins > 1 ? 's' : ''}`);\n }\n } else if (action instanceof GramJs.MessageActionContactSignUp) {\n text = 'Notification.Joined';\n translationValues.push('%action_origin%');\n type = 'contactSignUp';\n } else if (action instanceof GramJs.MessageActionPaymentSent) {\n amount = Number(action.totalAmount);\n currency = action.currency;\n text = 'PaymentSuccessfullyPaid';\n if (targetPeerId) {\n targetUserIds.push(targetPeerId);\n }\n translationValues.push('%payment_amount%', '%target_user%', '%product%');\n } else if (action instanceof GramJs.MessageActionGroupCall) {\n if (action.duration) {\n const mins = Math.max(Math.round(action.duration / 60), 1);\n text = 'Notification.VoiceChatEnded';\n translationValues.push(`${mins} min${mins > 1 ? 's' : ''}`);\n } else {\n text = 'Notification.VoiceChatStartedChannel';\n }\n } else if (action instanceof GramJs.MessageActionBotAllowed) {\n text = 'Chat.Service.BotPermissionAllowed';\n translationValues.push(action.domain);\n } else {\n text = 'ChatList.UnsupportedMessage';\n }\n\n if ('photo' in action && action.photo instanceof GramJs.Photo) {\n addPhotoToLocalDb(action.photo);\n photo = buildApiPhoto(action.photo);\n }\n\n return {\n text,\n type,\n targetUserIds,\n targetChatId,\n photo, // TODO Only used internally now, will be used for the UI in future\n amount,\n currency,\n translationValues,\n };\n}\n\nfunction buildReplyButtons(message: UniversalMessage): ApiReplyKeyboard | undefined {\n const { id: messageId, replyMarkup, media } = message;\n\n if (!replyMarkup) {\n if (media instanceof GramJs.MessageMediaWebPage && media.webpage instanceof GramJs.WebPage) {\n if (media.webpage.type === 'telegram_message') {\n return {\n inlineButtons: [[{\n type: 'url' as const,\n text: 'Show Message',\n messageId,\n value: media.webpage.url,\n }]],\n };\n }\n }\n\n return undefined;\n }\n\n // TODO\n if (!(replyMarkup instanceof GramJs.ReplyKeyboardMarkup || replyMarkup instanceof GramJs.ReplyInlineMarkup)) {\n return undefined;\n }\n\n const markup = replyMarkup.rows.map(({ buttons }) => {\n return buttons.map((button) => {\n let { text } = button;\n\n let type;\n let value;\n if (button instanceof GramJs.KeyboardButton) {\n type = 'command';\n value = text;\n } else if (button instanceof GramJs.KeyboardButtonUrl) {\n type = 'url';\n value = button.url;\n } else if (button instanceof GramJs.KeyboardButtonCallback) {\n type = 'callback';\n value = String(button.data);\n } else if (button instanceof GramJs.KeyboardButtonRequestPoll) {\n type = 'requestPoll';\n } else if (button instanceof GramJs.KeyboardButtonBuy) {\n if (media instanceof GramJs.MessageMediaInvoice && media.receiptMsgId) {\n text = 'PaymentReceipt';\n value = media.receiptMsgId;\n }\n type = 'buy';\n } else {\n type = 'NOT_SUPPORTED';\n }\n\n return {\n type,\n text,\n messageId,\n value,\n } as ApiKeyboardButton;\n });\n });\n\n return {\n [replyMarkup instanceof GramJs.ReplyKeyboardMarkup ? 'keyboardButtons' : 'inlineButtons']: markup,\n ...(replyMarkup instanceof GramJs.ReplyKeyboardMarkup && {\n keyboardPlaceholder: replyMarkup.placeholder,\n isKeyboardSingleUse: replyMarkup.singleUse,\n }),\n };\n}\n\nfunction getFilenameFromDocument(document: GramJs.Document, defaultBase = 'file') {\n const { mimeType, attributes } = document;\n const filenameAttribute = attributes\n .find((a: any): a is GramJs.DocumentAttributeFilename => a instanceof GramJs.DocumentAttributeFilename);\n\n if (filenameAttribute) {\n return filenameAttribute.fileName;\n }\n\n const extension = mimeType.split('/')[1];\n\n return `${defaultBase}${String(document.id)}.${extension}`;\n}\n\nexport function buildLocalMessage(\n chat: ApiChat,\n text?: string,\n entities?: ApiMessageEntity[],\n replyingTo?: number,\n attachment?: ApiAttachment,\n sticker?: ApiSticker,\n gif?: ApiVideo,\n poll?: ApiNewPoll,\n groupedId?: string,\n scheduledAt?: number,\n serverTimeOffset = 0,\n): ApiMessage {\n const localId = localMessageCounter++;\n const media = attachment && buildUploadingMedia(attachment);\n const isChannel = chat.type === 'chatTypeChannel';\n\n return {\n id: localId,\n chatId: chat.id,\n content: {\n ...(text && {\n text: {\n text,\n entities,\n },\n }),\n ...media,\n ...(sticker && { sticker }),\n ...(gif && { video: gif }),\n ...(poll && buildNewPoll(poll, localId)),\n },\n date: scheduledAt || Math.round(Date.now() / 1000) + serverTimeOffset,\n isOutgoing: !isChannel,\n senderId: currentUserId,\n ...(replyingTo && { replyToMessageId: replyingTo }),\n ...(groupedId && {\n groupedId,\n ...(media && (media.photo || media.video) && { isInAlbum: true }),\n }),\n ...(scheduledAt && { isScheduled: true }),\n };\n}\n\nexport function buildForwardedMessage(\n toChat: ApiChat,\n message: ApiMessage,\n serverTimeOffset: number,\n): ApiMessage {\n const localId = localMessageCounter++;\n const {\n content,\n chatId: fromChatId,\n id: fromMessageId,\n senderId,\n groupedId,\n isInAlbum,\n } = message;\n\n const isAudio = content.audio;\n const asIncomingInChatWithSelf = (\n toChat.id === currentUserId && (fromChatId !== toChat.id || message.forwardInfo) && !isAudio\n );\n\n return {\n id: localId,\n chatId: toChat.id,\n content,\n date: Math.round(Date.now() / 1000) + serverTimeOffset,\n isOutgoing: !asIncomingInChatWithSelf && toChat.type !== 'chatTypeChannel',\n senderId: currentUserId,\n sendingState: 'messageSendingStatePending',\n // Forward info doesn't get added when users forwards his own messages, also when forwarding audio\n ...(senderId !== currentUserId && !isAudio && {\n forwardInfo: {\n isChannelPost: false,\n fromChatId,\n fromMessageId,\n senderUserId: senderId,\n },\n }),\n groupedId,\n isInAlbum,\n };\n}\n\nfunction buildUploadingMedia(\n attachment: ApiAttachment,\n): ApiMessage['content'] {\n const {\n filename: fileName,\n blobUrl,\n previewBlobUrl,\n mimeType,\n size,\n } = attachment;\n\n if (attachment.quick) {\n const { width, height, duration } = attachment.quick;\n\n if (mimeType.startsWith('image/')) {\n return {\n photo: {\n id: LOCAL_IMAGE_UPLOADING_TEMP_ID,\n sizes: [],\n thumbnail: { width, height, dataUri: '' }, // Used only for dimensions\n blobUrl,\n },\n };\n } else {\n return {\n video: {\n id: LOCAL_VIDEO_UPLOADING_TEMP_ID,\n mimeType,\n duration: duration || 0,\n fileName,\n width,\n height,\n blobUrl,\n ...(previewBlobUrl && { thumbnail: { width, height, dataUri: previewBlobUrl } }),\n size,\n },\n };\n }\n } else if (attachment.voice) {\n const { duration, waveform } = attachment.voice;\n const { data: inputWaveform } = interpolateArray(waveform, INPUT_WAVEFORM_LENGTH);\n return {\n voice: {\n duration,\n waveform: inputWaveform,\n },\n };\n } else if (mimeType.startsWith('audio/')) {\n return {\n audio: {\n mimeType,\n fileName,\n size,\n duration: 200, // Arbitrary\n },\n };\n } else {\n return {\n document: {\n mimeType,\n fileName,\n size,\n ...(previewBlobUrl && { previewBlobUrl }),\n },\n };\n }\n}\n\nfunction buildNewPoll(poll: ApiNewPoll, localId: number) {\n return {\n poll: {\n id: localId.toString(),\n summary: pick(poll.summary, ['question', 'answers']),\n results: {},\n },\n };\n}\n\nfunction buildApiMessageEntity(entity: GramJs.TypeMessageEntity): ApiMessageEntity {\n const { className: type, offset, length } = entity;\n return {\n type,\n offset,\n length,\n ...('userId' in entity && typeof entity.userId === 'number' && { userId: entity.userId }),\n ...('url' in entity && { url: entity.url }),\n };\n}\n\nfunction buildThreadInfo(\n messageReplies: GramJs.TypeMessageReplies, messageId: number, chatId: number,\n): ApiThreadInfo | undefined {\n const {\n channelId, replies, maxId, readMaxId, recentRepliers,\n } = messageReplies;\n\n if (channelId === DELETED_COMMENTS_CHANNEL_ID) {\n return undefined;\n }\n\n const isPostThread = chatId !== channelId;\n\n return {\n threadId: messageId,\n ...(isPostThread ? {\n chatId: getApiChatIdFromMtpPeer({ channelId } as GramJs.TypePeer),\n originChannelId: chatId,\n } : {\n chatId,\n }),\n messagesCount: replies,\n lastMessageId: maxId,\n lastReadInboxMessageId: readMaxId,\n ...(recentRepliers && { recentReplierIds: recentRepliers.map(getApiChatIdFromMtpPeer) }),\n };\n}\n","import { Api as GramJs, connection } from '../../lib/gramjs';\nimport { ApiMessage, ApiUpdateConnectionStateType, OnApiUpdate } from '../types';\n\nimport { pick } from '../../util/iteratees';\nimport {\n buildApiMessage,\n buildApiMessageFromShort,\n buildApiMessageFromShortChat,\n buildMessageMediaContent,\n buildMessageTextContent,\n buildPoll,\n buildPollResults,\n buildApiMessageFromNotification,\n buildMessageDraft,\n} from './apiBuilders/messages';\nimport {\n getApiChatIdFromMtpPeer,\n buildChatMember,\n buildChatMembers,\n buildChatTypingStatus,\n buildAvatarHash,\n buildApiChatFromPreview,\n buildApiChatFolder,\n getApiChatIdFromInputMtpPeer,\n} from './apiBuilders/chats';\nimport { buildApiUser, buildApiUserStatus } from './apiBuilders/users';\nimport {\n buildMessageFromUpdate,\n isMessageWithMedia,\n buildChatPhotoForLocalDb,\n} from './gramjsBuilders';\nimport localDb from './localDb';\nimport { omitVirtualClassFields } from './apiBuilders/helpers';\nimport { DEBUG } from '../../config';\nimport { addMessageToLocalDb, addPhotoToLocalDb, resolveMessageApiChatId } from './helpers';\nimport { buildApiNotifyException, buildPrivacyKey, buildPrivacyRules } from './apiBuilders/misc';\nimport { buildApiPhoto } from './apiBuilders/common';\n\ntype Update = (\n (GramJs.TypeUpdate | GramJs.TypeUpdates) & { _entities?: (GramJs.TypeUser | GramJs.TypeChat)[] }\n) | typeof connection.UpdateConnectionState;\n\nconst DELETE_MISSING_CHANNEL_MESSAGE_DELAY = 1000;\n\nlet onUpdate: OnApiUpdate;\n\nexport function init(_onUpdate: OnApiUpdate) {\n onUpdate = _onUpdate;\n}\n\nconst sentMessageIds = new Set();\nlet serverTimeOffset = 0;\n\nexport function updater(update: Update, originRequest?: GramJs.AnyRequest) {\n if (update instanceof connection.UpdateServerTimeOffset) {\n serverTimeOffset = update.timeOffset;\n } else if (update instanceof connection.UpdateConnectionState) {\n let connectionState: ApiUpdateConnectionStateType;\n\n switch (update.state) {\n case connection.UpdateConnectionState.disconnected:\n connectionState = 'connectionStateConnecting';\n break;\n case connection.UpdateConnectionState.broken:\n connectionState = 'connectionStateBroken';\n break;\n case connection.UpdateConnectionState.connected:\n default:\n connectionState = 'connectionStateReady';\n break;\n }\n\n onUpdate({\n '@type': 'updateConnectionState',\n connectionState,\n });\n\n // Messages\n } else if (\n update instanceof GramJs.UpdateNewMessage\n || update instanceof GramJs.UpdateNewScheduledMessage\n || update instanceof GramJs.UpdateNewChannelMessage\n || update instanceof GramJs.UpdateShortChatMessage\n || update instanceof GramJs.UpdateShortMessage\n || update instanceof GramJs.UpdateServiceNotification\n ) {\n let message: ApiMessage | undefined;\n\n if (update instanceof GramJs.UpdateShortChatMessage) {\n message = buildApiMessageFromShortChat(update);\n } else if (update instanceof GramJs.UpdateShortMessage) {\n message = buildApiMessageFromShort(update);\n } else if (update instanceof GramJs.UpdateServiceNotification) {\n const currentDate = Date.now() / 1000 + serverTimeOffset;\n message = buildApiMessageFromNotification(update, currentDate);\n\n if (isMessageWithMedia(update)) {\n addMessageToLocalDb(buildMessageFromUpdate(message.id, message.chatId, update));\n }\n } else {\n // TODO Remove if proven not reproducing\n if (update.message instanceof GramJs.MessageEmpty) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('Unexpected update:', update.className, update);\n }\n\n return;\n }\n\n if (update.message instanceof GramJs.Message && isMessageWithMedia(update.message)) {\n addMessageToLocalDb(update.message);\n }\n\n message = buildApiMessage(update.message)!;\n }\n\n // eslint-disable-next-line no-underscore-dangle\n const entities = update._entities;\n if (entities?.length) {\n entities\n .filter((e) => e instanceof GramJs.User)\n .map(buildApiUser)\n .forEach((user) => {\n if (!user) {\n return;\n }\n\n onUpdate({\n '@type': 'updateUser',\n id: user.id,\n user,\n });\n });\n entities\n .filter((e) => e instanceof GramJs.Chat || e instanceof GramJs.Channel)\n .map((e) => buildApiChatFromPreview(e))\n .forEach((chat) => {\n if (!chat) {\n return;\n }\n\n onUpdate({\n '@type': 'updateChat',\n id: chat.id,\n chat,\n });\n });\n }\n\n if (update instanceof GramJs.UpdateNewScheduledMessage) {\n onUpdate({\n '@type': sentMessageIds.has(message.id) ? 'updateScheduledMessage' : 'newScheduledMessage',\n id: message.id,\n chatId: message.chatId,\n message,\n });\n } else {\n onUpdate({\n '@type': sentMessageIds.has(message.id) ? 'updateMessage' : 'newMessage',\n id: message.id,\n chatId: message.chatId,\n message,\n });\n }\n\n // Some updates to a Chat/Channel don't have a dedicated update class.\n // We can get info on some updates from Service Messages.\n if (update.message instanceof GramJs.MessageService) {\n const { action } = update.message;\n\n if (action instanceof GramJs.MessageActionChatEditTitle) {\n onUpdate({\n '@type': 'updateChat',\n id: message.chatId,\n chat: {\n title: action.title,\n },\n });\n } else if (action instanceof GramJs.MessageActionChatEditPhoto) {\n const photo = buildChatPhotoForLocalDb(action.photo);\n const avatarHash = buildAvatarHash(photo);\n\n const localDbChatId = Math.abs(resolveMessageApiChatId(update.message)!);\n if (localDb.chats[localDbChatId]) {\n localDb.chats[localDbChatId].photo = photo;\n }\n addPhotoToLocalDb(action.photo);\n\n if (avatarHash) {\n onUpdate({\n '@type': 'updateChat',\n id: message.chatId,\n chat: {\n avatarHash,\n },\n ...(action.photo instanceof GramJs.Photo && { newProfilePhoto: buildApiPhoto(action.photo) }),\n });\n }\n } else if (action instanceof GramJs.MessageActionChatDeletePhoto) {\n const localDbChatId = Math.abs(resolveMessageApiChatId(update.message)!);\n if (localDb.chats[localDbChatId]) {\n localDb.chats[localDbChatId].photo = new GramJs.ChatPhotoEmpty();\n }\n\n onUpdate({\n '@type': 'updateChat',\n id: message.chatId,\n chat: { avatarHash: undefined },\n });\n } else if (action instanceof GramJs.MessageActionChatDeleteUser) {\n // eslint-disable-next-line no-underscore-dangle\n if (update._entities && update._entities.some((e): e is GramJs.User => (\n e instanceof GramJs.User && !!e.self && e.id === action.userId\n ))) {\n onUpdate({\n '@type': 'updateChat',\n id: message.chatId,\n chat: {\n isRestricted: true,\n },\n });\n\n onUpdate({\n '@type': 'updateChatLeave',\n id: message.chatId,\n });\n }\n } else if (action instanceof GramJs.MessageActionChatAddUser) {\n // eslint-disable-next-line no-underscore-dangle\n if (update._entities && update._entities.some((e): e is GramJs.User => (\n e instanceof GramJs.User && !!e.self && action.users.includes(e.id)\n ))) {\n onUpdate({\n '@type': 'updateChatJoin',\n id: message.chatId,\n });\n }\n }\n }\n } else if (\n update instanceof GramJs.UpdateEditMessage\n || update instanceof GramJs.UpdateEditChannelMessage\n ) {\n // TODO Remove if proven not reproducing\n if (update.message instanceof GramJs.MessageEmpty) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('Unexpected update:', update.className, update);\n }\n\n return;\n }\n\n if (update.message instanceof GramJs.Message && isMessageWithMedia(update.message)) {\n addMessageToLocalDb(update.message);\n }\n\n const message = buildApiMessage(update.message)!;\n\n onUpdate({\n '@type': 'updateMessage',\n id: message.id,\n chatId: message.chatId,\n message,\n });\n } else if (update instanceof GramJs.UpdateDeleteMessages) {\n onUpdate({\n '@type': 'deleteMessages',\n ids: update.messages,\n });\n } else if (update instanceof GramJs.UpdateDeleteScheduledMessages) {\n onUpdate({\n '@type': 'deleteScheduledMessages',\n ids: update.messages,\n chatId: getApiChatIdFromInputMtpPeer(update.peer),\n });\n } else if (update instanceof GramJs.UpdateDeleteChannelMessages) {\n const chatId = getApiChatIdFromMtpPeer({ channelId: update.channelId } as GramJs.PeerChannel);\n const ids = update.messages;\n const existingIds = ids.filter((id) => localDb.messages[`${chatId}-${id}`]);\n const missingIds = ids.filter((id) => !localDb.messages[`${chatId}-${id}`]);\n const profilePhotoIds = ids.map((id) => {\n const message = localDb.messages[`${chatId}-${id}`];\n\n return message && message instanceof GramJs.MessageService && 'photo' in message.action\n ? String(message.action.photo.id)\n : undefined;\n }).filter(Boolean as any);\n\n if (existingIds.length) {\n onUpdate({\n '@type': 'deleteMessages',\n ids: existingIds,\n chatId,\n });\n }\n\n if (profilePhotoIds.length) {\n onUpdate({\n '@type': 'deleteProfilePhotos',\n ids: profilePhotoIds,\n chatId,\n });\n }\n\n // For some reason delete message update sometimes comes before new message update\n if (missingIds.length) {\n setTimeout(() => {\n onUpdate({\n '@type': 'deleteMessages',\n ids: missingIds,\n chatId,\n });\n }, DELETE_MISSING_CHANNEL_MESSAGE_DELAY);\n }\n } else if ((\n originRequest instanceof GramJs.messages.SendMessage\n || originRequest instanceof GramJs.messages.SendMedia\n || originRequest instanceof GramJs.messages.SendMultiMedia\n || originRequest instanceof GramJs.messages.ForwardMessages\n ) && (\n update instanceof GramJs.UpdateMessageID\n || update instanceof GramJs.UpdateShortSentMessage\n )) {\n let randomId;\n if ('randomId' in update) {\n randomId = update.randomId;\n } else if ('randomId' in originRequest) {\n randomId = originRequest.randomId;\n }\n\n const localMessage = randomId && localDb.localMessages[randomId.toString()];\n if (!localMessage) {\n throw new Error('Local message not found');\n }\n\n let newContent: ApiMessage['content'] | undefined;\n if (update instanceof GramJs.UpdateShortSentMessage) {\n if (localMessage.content.text && update.entities) {\n newContent = {\n text: buildMessageTextContent(localMessage.content.text.text, update.entities),\n };\n }\n if (update.media) {\n newContent = {\n ...newContent,\n ...buildMessageMediaContent(update.media),\n };\n }\n\n const mtpMessage = buildMessageFromUpdate(update.id, localMessage.chatId, update);\n if (isMessageWithMedia(mtpMessage)) {\n addMessageToLocalDb(mtpMessage);\n }\n }\n\n sentMessageIds.add(update.id);\n\n // Edge case for \"Send When Online\"\n const isAlreadySent = 'date' in update && update.date * 1000 < Date.now() + serverTimeOffset * 1000;\n\n onUpdate({\n '@type': localMessage.isScheduled && !isAlreadySent\n ? 'updateScheduledMessageSendSucceeded'\n : 'updateMessageSendSucceeded',\n chatId: localMessage.chatId,\n localId: localMessage.id,\n message: {\n ...localMessage,\n ...(newContent && {\n content: {\n ...localMessage.content,\n ...newContent,\n },\n }),\n id: update.id,\n sendingState: undefined,\n ...('date' in update && { date: update.date }),\n },\n });\n } else if (update instanceof GramJs.UpdateReadMessagesContents) {\n onUpdate({\n '@type': 'updateCommonBoxMessages',\n ids: update.messages,\n messageUpdate: {\n hasUnreadMention: false,\n isMediaUnread: false,\n },\n });\n } else if (update instanceof GramJs.UpdateChannelReadMessagesContents) {\n onUpdate({\n '@type': 'updateChannelMessages',\n channelId: update.channelId,\n ids: update.messages,\n messageUpdate: {\n hasUnreadMention: false,\n isMediaUnread: false,\n },\n });\n } else if (update instanceof GramJs.UpdateMessagePoll) {\n const { pollId, poll, results } = update;\n if (poll) {\n const apiPoll = buildPoll(poll, results);\n\n onUpdate({\n '@type': 'updateMessagePoll',\n pollId: pollId.toString(),\n pollUpdate: apiPoll,\n });\n } else {\n const pollResults = buildPollResults(results);\n onUpdate({\n '@type': 'updateMessagePoll',\n pollId: pollId.toString(),\n pollUpdate: { results: pollResults },\n });\n }\n } else if (update instanceof GramJs.UpdateMessagePollVote) {\n onUpdate({\n '@type': 'updateMessagePollVote',\n pollId: update.pollId.toString(),\n userId: update.userId,\n options: update.options.map((option) => String.fromCharCode(...option)),\n });\n } else if (update instanceof GramJs.UpdateChannelMessageViews) {\n onUpdate({\n '@type': 'updateMessage',\n chatId: getApiChatIdFromMtpPeer({ channelId: update.channelId } as GramJs.PeerChannel),\n id: update.id,\n message: { views: update.views },\n });\n\n // Chats\n } else if (update instanceof GramJs.UpdateReadHistoryInbox) {\n onUpdate({\n '@type': 'updateChatInbox',\n id: getApiChatIdFromMtpPeer(update.peer),\n chat: {\n lastReadInboxMessageId: update.maxId,\n unreadCount: update.stillUnreadCount,\n },\n });\n } else if (update instanceof GramJs.UpdateReadHistoryOutbox) {\n onUpdate({\n '@type': 'updateChat',\n id: getApiChatIdFromMtpPeer(update.peer),\n chat: {\n lastReadOutboxMessageId: update.maxId,\n },\n });\n } else if (update instanceof GramJs.UpdateReadChannelInbox) {\n onUpdate({\n '@type': 'updateChat',\n id: getApiChatIdFromMtpPeer({ channelId: update.channelId } as GramJs.PeerChannel),\n chat: {\n lastReadInboxMessageId: update.maxId,\n unreadCount: update.stillUnreadCount,\n },\n });\n } else if (update instanceof GramJs.UpdateReadChannelOutbox) {\n onUpdate({\n '@type': 'updateChat',\n id: getApiChatIdFromMtpPeer({ channelId: update.channelId } as GramJs.PeerChannel),\n chat: {\n lastReadOutboxMessageId: update.maxId,\n },\n });\n } else if (\n update instanceof GramJs.UpdateDialogPinned\n && update.peer instanceof GramJs.DialogPeer\n ) {\n onUpdate({\n '@type': 'updateChatPinned',\n id: getApiChatIdFromMtpPeer(update.peer.peer),\n isPinned: update.pinned || false,\n });\n } else if (update instanceof GramJs.UpdatePinnedDialogs) {\n const ids = update.order\n ? update.order\n .filter((dp): dp is GramJs.DialogPeer => dp instanceof GramJs.DialogPeer)\n .map((dp) => getApiChatIdFromMtpPeer(dp.peer))\n : [];\n\n onUpdate({\n '@type': 'updatePinnedChatIds',\n ids,\n folderId: update.folderId || undefined,\n });\n } else if (update instanceof GramJs.UpdateFolderPeers) {\n update.folderPeers.forEach((folderPeer) => {\n const { folderId, peer } = folderPeer;\n\n onUpdate({\n '@type': 'updateChatListType',\n id: getApiChatIdFromMtpPeer(peer),\n folderId,\n });\n });\n } else if (update instanceof GramJs.UpdateDialogFilter) {\n const { id, filter } = update;\n const folder = filter ? buildApiChatFolder(filter) : undefined;\n\n onUpdate({\n '@type': 'updateChatFolder',\n id,\n folder,\n });\n } else if (update instanceof GramJs.UpdateDialogFilterOrder) {\n onUpdate({\n '@type': 'updateChatFoldersOrder',\n orderedIds: update.order,\n });\n } else if (update instanceof GramJs.UpdateChatParticipants) {\n const replacedMembers = buildChatMembers(update.participants);\n\n onUpdate({\n '@type': 'updateChatMembers',\n id: getApiChatIdFromMtpPeer({ chatId: update.participants.chatId } as GramJs.TypePeer),\n replacedMembers,\n });\n } else if (update instanceof GramJs.UpdateChatParticipantAdd) {\n const addedMember = buildChatMember(\n pick(update, ['userId', 'inviterId', 'date']) as GramJs.ChatParticipant,\n );\n\n onUpdate({\n '@type': 'updateChatMembers',\n id: getApiChatIdFromMtpPeer({ chatId: update.chatId } as GramJs.PeerChat),\n addedMember,\n });\n } else if (update instanceof GramJs.UpdateChatParticipantDelete) {\n const { userId: deletedMemberId } = update;\n\n onUpdate({\n '@type': 'updateChatMembers',\n id: getApiChatIdFromMtpPeer({ chatId: update.chatId } as GramJs.PeerChat),\n deletedMemberId,\n });\n } else if (\n update instanceof GramJs.UpdatePinnedMessages\n || update instanceof GramJs.UpdatePinnedChannelMessages\n ) {\n const peer = update instanceof GramJs.UpdatePinnedMessages\n ? update.peer\n : { channelId: update.channelId } as GramJs.PeerChannel;\n const chatId = getApiChatIdFromMtpPeer(peer);\n\n onUpdate({\n '@type': 'updatePinnedIds',\n chatId,\n messageIds: update.messages,\n isPinned: update.pinned,\n });\n } else if (\n update instanceof GramJs.UpdateNotifySettings\n && update.peer instanceof GramJs.NotifyPeer\n ) {\n onUpdate({\n '@type': 'updateNotifyExceptions',\n ...buildApiNotifyException(update.notifySettings, update.peer.peer, serverTimeOffset),\n });\n } else if (\n update instanceof GramJs.UpdateUserTyping\n || update instanceof GramJs.UpdateChatUserTyping\n ) {\n const id = update instanceof GramJs.UpdateUserTyping\n ? update.userId\n : getApiChatIdFromMtpPeer({ chatId: update.chatId } as GramJs.PeerChat);\n\n onUpdate({\n '@type': 'updateChatTypingStatus',\n id,\n typingStatus: buildChatTypingStatus(update, serverTimeOffset),\n });\n } else if (update instanceof GramJs.UpdateChannelUserTyping) {\n const id = getApiChatIdFromMtpPeer({ channelId: update.channelId } as GramJs.PeerChannel);\n\n onUpdate({\n '@type': 'updateChatTypingStatus',\n id,\n typingStatus: buildChatTypingStatus(update, serverTimeOffset),\n });\n } else if (update instanceof GramJs.UpdateChannel) {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const { _entities } = update;\n if (!_entities) {\n return;\n }\n\n const channel = _entities.find((e): e is GramJs.Channel | GramJs.ChannelForbidden => (\n e instanceof GramJs.Channel || e instanceof GramJs.ChannelForbidden\n ));\n\n if (channel instanceof GramJs.Channel) {\n const chat = buildApiChatFromPreview(channel);\n if (chat) {\n onUpdate({\n '@type': 'updateChat',\n id: chat.id,\n chat,\n });\n\n onUpdate({\n '@type': chat.isNotJoined ? 'updateChatLeave' : 'updateChatJoin',\n id: getApiChatIdFromMtpPeer({ channelId: update.channelId } as GramJs.PeerChannel),\n });\n }\n } else if (channel instanceof GramJs.ChannelForbidden) {\n const chatId = getApiChatIdFromMtpPeer({ channelId: update.channelId } as GramJs.PeerChannel);\n\n onUpdate({\n '@type': 'updateChat',\n id: chatId,\n chat: {\n isRestricted: true,\n },\n });\n\n onUpdate({\n '@type': 'updateChatLeave',\n id: chatId,\n });\n } else if (_entities.length === 0) {\n // The link to the discussion group may have been changed.\n // No corresponding update available at this moment https://core.telegram.org/type/Updates\n onUpdate({\n '@type': 'resetMessages',\n id: getApiChatIdFromMtpPeer({ chatId: update.channelId } as GramJs.PeerChat),\n });\n }\n } else if (\n update instanceof GramJs.UpdateDialogUnreadMark\n && update.peer instanceof GramJs.DialogPeer\n ) {\n onUpdate({\n '@type': 'updateChat',\n id: getApiChatIdFromMtpPeer(update.peer.peer),\n chat: {\n hasUnreadMark: update.unread,\n },\n });\n } else if (update instanceof GramJs.UpdateChatDefaultBannedRights) {\n onUpdate({\n '@type': 'updateChat',\n id: getApiChatIdFromMtpPeer(update.peer),\n chat: {\n defaultBannedRights: omitVirtualClassFields(update.defaultBannedRights),\n },\n });\n\n // Users\n } else if (update instanceof GramJs.UpdateUserStatus) {\n const { userId, status } = update;\n\n onUpdate({\n '@type': 'updateUserStatus',\n userId,\n status: buildApiUserStatus(status),\n });\n } else if (update instanceof GramJs.UpdateUserName) {\n const updatedUser = localDb.users[update.userId];\n const user = updatedUser?.mutualContact && !updatedUser.self\n ? pick(update, ['username'])\n : pick(update, ['firstName', 'lastName', 'username']);\n\n onUpdate({\n '@type': 'updateUser',\n id: update.userId,\n user,\n });\n } else if (update instanceof GramJs.UpdateUserPhoto) {\n const { userId, photo } = update;\n const avatarHash = buildAvatarHash(photo);\n\n if (localDb.users[userId]) {\n localDb.users[userId].photo = photo;\n }\n\n onUpdate({\n '@type': 'updateUser',\n id: userId,\n user: { avatarHash },\n });\n } else if (update instanceof GramJs.UpdateUserPhone) {\n const { userId, phone } = update;\n\n onUpdate({\n '@type': 'updateUser',\n id: userId,\n user: { phoneNumber: phone },\n });\n } else if (update instanceof GramJs.UpdatePeerSettings) {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const { _entities } = update;\n if (!_entities) {\n return;\n }\n\n if (_entities?.length) {\n _entities\n .filter((e) => e instanceof GramJs.User && !e.contact)\n .forEach((user) => {\n onUpdate({\n '@type': 'deleteUser',\n id: user.id,\n });\n });\n\n _entities\n .filter((e) => e instanceof GramJs.User && e.contact)\n .map(buildApiUser)\n .forEach((user) => {\n if (!user) {\n return;\n }\n\n onUpdate({\n '@type': 'updateUser',\n id: user.id,\n user,\n });\n });\n }\n\n // Settings\n } else if (update instanceof GramJs.UpdateNotifySettings) {\n const {\n notifySettings: {\n showPreviews, silent, muteUntil,\n },\n peer: { className },\n } = update;\n\n const peerType = className === 'NotifyUsers'\n ? 'contact'\n : (className === 'NotifyChats'\n ? 'group'\n : (className === 'NotifyBroadcasts'\n ? 'broadcast'\n : undefined\n )\n );\n\n if (!peerType) {\n return;\n }\n\n onUpdate({\n '@type': 'updateNotifySettings',\n peerType,\n isSilent: Boolean(silent\n || (typeof muteUntil === 'number' && Date.now() + serverTimeOffset * 1000 < muteUntil * 1000)),\n shouldShowPreviews: Boolean(showPreviews),\n });\n } else if (update instanceof GramJs.UpdatePeerBlocked) {\n onUpdate({\n '@type': 'updatePeerBlocked',\n id: getApiChatIdFromMtpPeer(update.peerId),\n isBlocked: update.blocked,\n });\n } else if (update instanceof GramJs.UpdatePrivacy) {\n const key = buildPrivacyKey(update.key);\n if (key) {\n onUpdate({\n '@type': 'updatePrivacy',\n key,\n rules: buildPrivacyRules(update.rules),\n });\n }\n\n // Misc\n } else if (update instanceof GramJs.UpdateDraftMessage) {\n onUpdate({\n '@type': 'draftMessage',\n chatId: getApiChatIdFromMtpPeer(update.peer),\n ...buildMessageDraft(update.draft),\n });\n } else if (update instanceof GramJs.UpdateContactsReset) {\n onUpdate({ '@type': 'updateResetContactList' });\n } else if (update instanceof GramJs.UpdateFavedStickers) {\n onUpdate({ '@type': 'updateFavoriteStickers' });\n } else if (DEBUG) {\n const params = typeof update === 'object' && 'className' in update ? update.className : update;\n // eslint-disable-next-line no-console\n console.warn('[GramJs/updater] Unexpected update:', params);\n }\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\nimport {\n ApiBotCommand, ApiUser, ApiUserStatus, ApiUserType,\n} from '../../types';\n\nexport function buildApiUserFromFull(mtpUserFull: GramJs.UserFull): ApiUser {\n const {\n about, commonChatsCount, pinnedMsgId, botInfo, blocked,\n } = mtpUserFull;\n\n return {\n ...(buildApiUser(mtpUserFull.user) as ApiUser),\n fullInfo: {\n bio: about,\n commonChatsCount,\n pinnedMessageId: pinnedMsgId,\n isBlocked: Boolean(blocked),\n ...(botInfo && { botDescription: botInfo.description }),\n ...(botInfo && botInfo.commands.length && { botCommands: buildApiBotCommands(mtpUserFull.user.id, botInfo) }),\n },\n };\n}\n\nexport function buildApiUser(mtpUser: GramJs.TypeUser): ApiUser | undefined {\n if (!(mtpUser instanceof GramJs.User)) {\n return undefined;\n }\n\n const { id, firstName, lastName } = mtpUser;\n const avatarHash = mtpUser.photo instanceof GramJs.UserProfilePhoto\n ? String(mtpUser.photo.photoId)\n : undefined;\n const userType = buildApiUserType(mtpUser);\n\n return {\n id,\n isMin: Boolean(mtpUser.min),\n ...(mtpUser.self && { isSelf: true }),\n ...(mtpUser.verified && { isVerified: true }),\n ...((mtpUser.contact || mtpUser.mutualContact) && { isContact: true }),\n type: userType,\n ...(firstName && { firstName }),\n ...(userType === 'userTypeBot' && { canBeInvitedToGroup: !mtpUser.botNochats }),\n ...(lastName && { lastName }),\n username: mtpUser.username || '',\n phoneNumber: mtpUser.phone || '',\n status: buildApiUserStatus(mtpUser.status),\n ...(mtpUser.accessHash && { accessHash: String(mtpUser.accessHash) }),\n ...(avatarHash && { avatarHash }),\n ...(mtpUser.bot && mtpUser.botInlinePlaceholder && { botPlaceholder: mtpUser.botInlinePlaceholder }),\n };\n}\n\nfunction buildApiUserType(user: GramJs.User): ApiUserType {\n if (user.bot) {\n return 'userTypeBot';\n }\n if (user.deleted) {\n return 'userTypeDeleted';\n }\n\n return 'userTypeRegular';\n}\n\nexport function buildApiUserStatus(mtpStatus?: GramJs.TypeUserStatus): ApiUserStatus {\n if (!mtpStatus || mtpStatus instanceof GramJs.UserStatusEmpty) {\n return { type: 'userStatusEmpty' };\n } else if (mtpStatus instanceof GramJs.UserStatusOnline) {\n return { type: 'userStatusOnline', expires: mtpStatus.expires };\n } else if (mtpStatus instanceof GramJs.UserStatusOffline) {\n return { type: 'userStatusOffline', wasOnline: mtpStatus.wasOnline };\n } else if (mtpStatus instanceof GramJs.UserStatusRecently) {\n return { type: 'userStatusRecently' };\n } else if (mtpStatus instanceof GramJs.UserStatusLastWeek) {\n return { type: 'userStatusLastWeek' };\n } else {\n return { type: 'userStatusLastMonth' };\n }\n}\n\nfunction buildApiBotCommands(botId: number, botInfo: GramJs.BotInfo) {\n return botInfo.commands.map(({ command, description }) => ({\n botId,\n command,\n description,\n })) as ApiBotCommand[];\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\n\nimport { ApiSession, ApiWallpaper } from '../../types';\nimport { ApiPrivacySettings, ApiPrivacyKey, PrivacyVisibility } from '../../../types';\n\nimport { buildApiDocument } from './messages';\nimport { getApiChatIdFromMtpPeer } from './chats';\nimport { pick } from '../../../util/iteratees';\nimport { getServerTime } from '../../../util/serverTime';\n\nexport function buildApiWallpaper(wallpaper: GramJs.TypeWallPaper): ApiWallpaper | undefined {\n if (wallpaper instanceof GramJs.WallPaperNoFile) {\n // TODO: Plain color wallpapers\n return undefined;\n }\n\n const { slug } = wallpaper;\n\n const document = buildApiDocument(wallpaper.document);\n\n if (!document) {\n return undefined;\n }\n\n return {\n slug,\n document,\n };\n}\n\nexport function buildApiSession(session: GramJs.Authorization): ApiSession {\n return {\n isCurrent: Boolean(session.current),\n isOfficialApp: Boolean(session.officialApp),\n isPasswordPending: Boolean(session.passwordPending),\n hash: String(session.hash),\n ...pick(session, [\n 'deviceModel', 'platform', 'systemVersion', 'appName', 'appVersion', 'dateCreated', 'dateActive',\n 'ip', 'country', 'region',\n ]),\n };\n}\n\nexport function buildPrivacyKey(key: GramJs.TypePrivacyKey): ApiPrivacyKey | undefined {\n switch (key.className) {\n case 'PrivacyKeyPhoneNumber':\n return 'phoneNumber';\n case 'PrivacyKeyStatusTimestamp':\n return 'lastSeen';\n case 'PrivacyKeyProfilePhoto':\n return 'profilePhoto';\n case 'PrivacyKeyForwards':\n return 'forwards';\n case 'PrivacyKeyChatInvite':\n return 'chatInvite';\n }\n\n return undefined;\n}\n\nexport function buildPrivacyRules(rules: GramJs.TypePrivacyRule[]): ApiPrivacySettings {\n let visibility: PrivacyVisibility | undefined;\n let allowUserIds: number[] | undefined;\n let allowChatIds: number[] | undefined;\n let blockUserIds: number[] | undefined;\n let blockChatIds: number[] | undefined;\n\n rules.forEach((rule) => {\n if (rule instanceof GramJs.PrivacyValueAllowAll) {\n visibility = visibility || 'everybody';\n } else if (rule instanceof GramJs.PrivacyValueAllowContacts) {\n visibility = visibility || 'contacts';\n } else if (rule instanceof GramJs.PrivacyValueDisallowContacts) {\n visibility = visibility || 'nonContacts';\n } else if (rule instanceof GramJs.PrivacyValueDisallowAll) {\n visibility = visibility || 'nobody';\n } else if (rule instanceof GramJs.PrivacyValueAllowUsers) {\n allowUserIds = rule.users;\n } else if (rule instanceof GramJs.PrivacyValueDisallowUsers) {\n blockUserIds = rule.users;\n } else if (rule instanceof GramJs.PrivacyValueAllowChatParticipants) {\n allowChatIds = rule.chats.map((id) => -id);\n } else if (rule instanceof GramJs.PrivacyValueDisallowChatParticipants) {\n blockChatIds = rule.chats.map((id) => -id);\n }\n });\n\n if (!visibility) {\n // disallow by default.\n visibility = 'nobody';\n }\n\n return {\n visibility,\n allowUserIds: allowUserIds || [],\n allowChatIds: allowChatIds || [],\n blockUserIds: blockUserIds || [],\n blockChatIds: blockChatIds || [],\n };\n}\n\nexport function buildApiNotifyException(\n notifySettings: GramJs.TypePeerNotifySettings, peer: GramJs.TypePeer, serverTimeOffset: number,\n) {\n const {\n silent, muteUntil, showPreviews, sound,\n } = notifySettings;\n\n return {\n chatId: getApiChatIdFromMtpPeer(peer),\n isMuted: silent || (typeof muteUntil === 'number' && getServerTime(serverTimeOffset) < muteUntil),\n ...(sound === '' && { isSilent: true }),\n ...(showPreviews !== undefined && { shouldShowPreviews: Boolean(showPreviews) }),\n };\n}\n","import { errors } from '../../../lib/gramjs';\nimport {\n ApiUpdateAuthorizationState,\n ApiUpdateAuthorizationStateType,\n OnApiUpdate,\n ApiUser,\n} from '../../types';\n\nimport { DEBUG } from '../../../config';\n\nconst ApiErrors: { [k: string]: string } = {\n PHONE_NUMBER_INVALID: 'PHONE_NUMBER_INVALID',\n PHONE_CODE_INVALID: 'PHONE_CODE_INVALID',\n PASSWORD_HASH_INVALID: 'PASSWORD_HASH_INVALID',\n PHONE_PASSWORD_FLOOD: 'You have tried logging in too many times',\n};\n\nconst authController: {\n resolve?: Function;\n reject?: Function;\n} = {};\n\nlet onUpdate: OnApiUpdate;\n\nexport function init(_onUpdate: OnApiUpdate) {\n onUpdate = _onUpdate;\n}\n\nexport function onRequestPhoneNumber() {\n onUpdate(buildAuthStateUpdate('authorizationStateWaitPhoneNumber'));\n\n return new Promise((resolve, reject) => {\n authController.resolve = resolve;\n authController.reject = reject;\n });\n}\n\nexport function onRequestCode(isCodeViaApp = false) {\n onUpdate({\n ...buildAuthStateUpdate('authorizationStateWaitCode'),\n isCodeViaApp,\n });\n\n return new Promise((resolve, reject) => {\n authController.resolve = resolve;\n authController.reject = reject;\n });\n}\n\nexport function onRequestPassword(hint?: string) {\n onUpdate({\n ...buildAuthStateUpdate('authorizationStateWaitPassword'),\n hint,\n });\n\n return new Promise((resolve) => {\n authController.resolve = resolve;\n });\n}\n\nexport function onRequestRegistration() {\n onUpdate(buildAuthStateUpdate('authorizationStateWaitRegistration'));\n\n return new Promise<[string, string?]>((resolve) => {\n authController.resolve = resolve;\n });\n}\n\nexport function onRequestQrCode(qrCode: { token: Buffer; expires: number }) {\n onUpdate({\n ...buildAuthStateUpdate('authorizationStateWaitQrCode'),\n qrCode: {\n token: btoa(String.fromCharCode(...qrCode.token)).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, ''),\n expires: qrCode.expires,\n },\n });\n\n return new Promise((resolve, reject) => {\n authController.reject = reject;\n });\n}\n\nexport function onAuthError(err: Error) {\n let message: string;\n\n if (err instanceof errors.FloodWaitError) {\n const hours = Math.ceil(Number(err.seconds) / 60 / 60);\n message = `Too many attempts. Try again in ${hours > 1 ? `${hours} hours` : 'an hour'}`;\n } else {\n message = ApiErrors[err.message];\n }\n\n if (!message) {\n message = 'Unexpected Error';\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n }\n\n onUpdate({\n '@type': 'updateAuthorizationError',\n message,\n });\n}\n\nexport function onAuthReady() {\n onUpdate(buildAuthStateUpdate('authorizationStateReady'));\n}\n\nexport function onCurrentUserUpdate(currentUser: ApiUser) {\n onUpdate({\n '@type': 'updateCurrentUser',\n currentUser,\n });\n}\n\nexport function buildAuthStateUpdate(authorizationState: ApiUpdateAuthorizationStateType): ApiUpdateAuthorizationState {\n return {\n '@type': 'updateAuthorizationState',\n authorizationState,\n };\n}\n\nexport function provideAuthPhoneNumber(phoneNumber: string) {\n if (!authController.resolve) {\n return;\n }\n\n authController.resolve(phoneNumber);\n}\n\nexport function provideAuthCode(code: string) {\n if (!authController.resolve) {\n return;\n }\n\n authController.resolve(code);\n}\n\nexport function provideAuthPassword(password: string) {\n if (!authController.resolve) {\n return;\n }\n\n authController.resolve(password);\n}\n\nexport function provideAuthRegistration(registration: { firstName: string; lastName: string }) {\n const { firstName, lastName } = registration;\n\n if (!authController.resolve) {\n return;\n }\n\n authController.resolve([firstName, lastName]);\n}\n\nexport function restartAuth() {\n if (!authController.reject) {\n return;\n }\n\n authController.reject(new Error('RESTART_AUTH'));\n}\n\nexport function restartAuthWithQr() {\n if (!authController.reject) {\n return;\n }\n\n authController.reject(new Error('RESTART_AUTH_WITH_QR'));\n}\n","import { pause } from './schedulers';\n\n// Polyfill for Safari: `File` is not available in web worker\nif (typeof File === 'undefined') {\n // eslint-disable-next-line no-global-assign, no-restricted-globals, func-names\n self.File = class extends Blob {\n name: string;\n\n constructor(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag) {\n if (options) {\n const { type, ...rest } = options;\n super(fileBits, { type });\n Object.assign(this, rest);\n } else {\n super(fileBits);\n }\n\n this.name = fileName;\n }\n } as typeof File;\n}\n\nexport function dataUriToBlob(dataUri: string) {\n const arr = dataUri.split(',');\n const mime = arr[0].match(/:(.*?);/)![1];\n const bstr = atob(arr[1]);\n let n = bstr.length;\n const u8arr = new Uint8Array(n);\n\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n\n return new Blob([u8arr], { type: mime });\n}\n\nexport function blobToDataUri(blob: Blob): Promise {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = (e: ProgressEvent) => {\n const { result } = e.target || {};\n if (typeof result === 'string') {\n resolve(result);\n }\n\n reject(new Error('Failed to read blob'));\n };\n\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n}\n\nexport function blobToFile(blob: Blob, fileName: string) {\n return new File([blob], fileName, {\n lastModified: Date.now(),\n type: blob.type,\n });\n}\n\nexport function preloadImage(url: string): Promise {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = reject;\n img.src = url;\n });\n}\n\nexport function preloadVideo(url: string): Promise {\n return new Promise((resolve, reject) => {\n const video = document.createElement('video');\n video.volume = 0;\n video.onloadedmetadata = () => resolve(video);\n video.onerror = reject;\n video.src = url;\n });\n}\n\nexport async function createPosterForVideo(url: string): Promise {\n const video = await preloadVideo(url);\n\n return Promise.race([\n pause(2000) as Promise,\n new Promise((resolve, reject) => {\n video.onseeked = () => {\n if (!video.videoWidth || !video.videoHeight) {\n resolve(undefined);\n }\n\n const canvas = document.createElement('canvas');\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n const ctx = canvas.getContext('2d')!;\n ctx.drawImage(video, 0, 0);\n resolve(canvas.toDataURL('image/jpeg'));\n };\n video.onerror = reject;\n video.currentTime = Math.min(video.duration, 1);\n }),\n ]);\n}\n\nexport async function fetchBlob(blobUrl: string) {\n const response = await fetch(blobUrl);\n return response.blob();\n}\n\nexport async function fetchFile(blobUrl: string, fileName: string) {\n const blob = await fetchBlob(blobUrl);\n return blobToFile(blob, fileName);\n}\n\nexport function imgToCanvas(img: HTMLImageElement) {\n const canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n\n const ctx = canvas.getContext('2d')!;\n ctx.drawImage(img, 0, 0);\n\n return canvas;\n}\n","// eslint-disable-next-line no-restricted-globals\nconst cacheApi = self.caches;\n\nexport enum Type {\n Text,\n Blob,\n Json,\n}\n\nexport async function fetch(\n cacheName: string, key: string, type: Type, isHtmlAllowed = false,\n) {\n if (!cacheApi) {\n return undefined;\n }\n\n try {\n // To avoid the error \"Request scheme 'webdocument' is unsupported\"\n const request = new Request(key.replace(/:/g, '_'));\n const cache = await cacheApi.open(cacheName);\n const response = await cache.match(request);\n if (!response) {\n return undefined;\n }\n\n switch (type) {\n case Type.Text:\n return await response.text();\n case Type.Blob: {\n const blob = await response.blob();\n\n // Safari does not return correct Content-Type header for webp images.\n if (key.substr(0, 7) === 'sticker') {\n return new Blob([blob], { type: 'image/webp' });\n }\n\n // iOS Safari fails to preserve `type` in cache\n if (!blob.type) {\n const contentType = response.headers.get('Content-Type');\n if (contentType) {\n return new Blob([blob], { type: isHtmlAllowed ? contentType : contentType.replace(/html/gi, '') });\n }\n }\n\n // Prevent HTML-in-video attacks (for files that were cached before fix)\n if (!isHtmlAllowed && blob.type.includes('html')) {\n return new Blob([blob], { type: blob.type.replace(/html/gi, '') });\n }\n\n return blob;\n }\n case Type.Json:\n return await response.json();\n default:\n return undefined;\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n return undefined;\n }\n}\n\nexport async function save(cacheName: string, key: string, data: AnyLiteral | Blob | string) {\n if (!cacheApi) {\n return undefined;\n }\n\n try {\n const cacheData = typeof data === 'string' || data instanceof Blob ? data : JSON.stringify(data);\n // To avoid the error \"Request scheme 'webdocument' is unsupported\"\n const request = new Request(key.replace(/:/g, '_'));\n const response = new Response(cacheData);\n const cache = await cacheApi.open(cacheName);\n return await cache.put(request, response);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n return undefined;\n }\n}\n\nexport async function clear(cacheName: string) {\n try {\n if (!cacheApi) {\n return undefined;\n }\n\n return await cacheApi.delete(cacheName);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n return undefined;\n }\n}\n","import { inflate } from 'pako/dist/pako_inflate';\n\nimport { Api as GramJs, TelegramClient } from '../../../lib/gramjs';\nimport {\n ApiMediaFormat, ApiOnProgress, ApiParsedMedia, ApiPreparedMedia,\n} from '../../types';\n\nimport {\n DOWNLOAD_WORKERS,\n MEDIA_CACHE_DISABLED,\n MEDIA_CACHE_MAX_BYTES,\n MEDIA_CACHE_NAME,\n MEDIA_CACHE_NAME_AVATARS,\n} from '../../../config';\nimport localDb from '../localDb';\nimport { getEntityTypeById } from '../gramjsBuilders';\nimport { blobToDataUri } from '../../../util/files';\nimport * as cacheApi from '../../../util/cacheApi';\n\ntype EntityType = (\n 'msg' | 'sticker' | 'wallpaper' | 'gif' | 'channel' | 'chat' | 'user' | 'photo' | 'stickerSet' | 'webDocument'\n);\nconst MEDIA_ENTITY_TYPES = new Set(['msg', 'sticker', 'gif', 'wallpaper', 'photo', 'webDocument']);\n\nexport default async function downloadMedia(\n {\n url, mediaFormat, start, end, isHtmlAllowed,\n }: {\n url: string; mediaFormat: ApiMediaFormat; start?: number; end?: number; isHtmlAllowed?: boolean;\n },\n client: TelegramClient,\n isConnected: boolean,\n onProgress?: ApiOnProgress,\n) {\n const {\n data, mimeType, fullSize,\n } = await download(url, client, isConnected, onProgress, start, end, mediaFormat, isHtmlAllowed) || {};\n if (!data) {\n return undefined;\n }\n\n const parsed = await parseMedia(data, mediaFormat, mimeType);\n if (!parsed) {\n return undefined;\n }\n\n const canCache = mediaFormat !== ApiMediaFormat.Progressive && (\n mediaFormat !== ApiMediaFormat.BlobUrl || (parsed as Blob).size <= MEDIA_CACHE_MAX_BYTES\n );\n\n if (!MEDIA_CACHE_DISABLED && cacheApi && canCache) {\n const cacheName = url.startsWith('avatar') ? MEDIA_CACHE_NAME_AVATARS : MEDIA_CACHE_NAME;\n void cacheApi.save(cacheName, url, parsed);\n }\n\n const prepared = mediaFormat === ApiMediaFormat.Progressive ? '' : prepareMedia(parsed);\n const arrayBuffer = mediaFormat === ApiMediaFormat.Progressive ? parsed as ArrayBuffer : undefined;\n\n return {\n prepared,\n arrayBuffer,\n mimeType,\n fullSize,\n };\n}\n\nasync function download(\n url: string,\n client: TelegramClient,\n isConnected: boolean,\n onProgress?: ApiOnProgress,\n start?: number,\n end?: number,\n mediaFormat?: ApiMediaFormat,\n isHtmlAllowed?: boolean,\n) {\n const mediaMatch = url.startsWith('webDocument')\n ? url.match(/(webDocument):(.+)/)\n : url.match(/(avatar|profile|photo|msg|stickerSet|sticker|wallpaper|gif|file)([-\\d\\w./]+)(\\?size=\\w+)?/);\n if (!mediaMatch) {\n return undefined;\n }\n\n if (mediaMatch[1] === 'file') {\n const response = await fetch(mediaMatch[2]);\n const data = await response.arrayBuffer();\n return { data };\n }\n\n if (!isConnected) {\n return Promise.reject(new Error('ERROR: Client is not connected'));\n }\n\n let entityType: EntityType;\n let entityId: string | number = mediaMatch[2];\n const sizeType = mediaMatch[3] ? mediaMatch[3].replace('?size=', '') : undefined;\n let entity: (\n GramJs.User | GramJs.Chat | GramJs.Channel | GramJs.Photo |\n GramJs.Message | GramJs.Document | GramJs.StickerSet | GramJs.TypeWebDocument | undefined\n );\n\n if (mediaMatch[1] === 'avatar' || mediaMatch[1] === 'profile') {\n entityType = getEntityTypeById(Number(entityId));\n entityId = Math.abs(Number(entityId));\n } else {\n entityType = mediaMatch[1] as 'msg' | 'sticker' | 'wallpaper' | 'gif' | 'stickerSet' | 'photo' | 'webDocument';\n }\n\n switch (entityType) {\n case 'channel':\n case 'chat':\n entity = localDb.chats[entityId as number];\n break;\n case 'user':\n entity = localDb.users[entityId as number];\n break;\n case 'msg':\n entity = localDb.messages[entityId as string];\n break;\n case 'sticker':\n case 'gif':\n case 'wallpaper':\n entity = localDb.documents[entityId as string];\n break;\n case 'photo':\n entity = localDb.photos[entityId as string];\n break;\n case 'stickerSet':\n entity = localDb.stickerSets[entityId as string];\n break;\n case 'webDocument':\n entity = localDb.webDocuments[entityId as string];\n break;\n }\n\n if (!entity) {\n return undefined;\n }\n\n if (MEDIA_ENTITY_TYPES.has(entityType)) {\n if (mediaFormat === ApiMediaFormat.Stream) {\n onProgress!.acceptsBuffer = true;\n }\n\n const data = await client.downloadMedia(entity, {\n sizeType, start, end, progressCallback: onProgress, workers: DOWNLOAD_WORKERS,\n });\n let mimeType;\n let fullSize;\n\n if (entity instanceof GramJs.Message) {\n mimeType = getMessageMediaMimeType(entity, sizeType);\n if (entity.media instanceof GramJs.MessageMediaDocument && entity.media.document instanceof GramJs.Document) {\n fullSize = entity.media.document.size;\n }\n if (entity.media instanceof GramJs.MessageMediaWebPage\n && entity.media.webpage instanceof GramJs.WebPage\n && entity.media.webpage.document instanceof GramJs.Document) {\n fullSize = entity.media.webpage.document.size;\n }\n } else if (entity instanceof GramJs.Photo) {\n mimeType = 'image/jpeg';\n } else if (entityType === 'sticker' && sizeType) {\n mimeType = 'image/webp';\n } else if (entityType === 'webDocument') {\n mimeType = (entity as GramJs.TypeWebDocument).mimeType;\n } else {\n mimeType = (entity as GramJs.Document).mimeType;\n fullSize = (entity as GramJs.Document).size;\n }\n\n // Prevent HTML-in-video attacks\n if (!isHtmlAllowed && mimeType) {\n mimeType = mimeType.replace(/html/gi, '');\n }\n\n return { mimeType, data, fullSize };\n } else if (entityType === 'stickerSet') {\n const data = await client.downloadStickerSetThumb(entity);\n const mimeType = mediaFormat === ApiMediaFormat.Lottie ? 'application/json' : getMimeType(data);\n\n return { mimeType, data };\n } else {\n const data = await client.downloadProfilePhoto(entity, mediaMatch[1] === 'profile');\n const mimeType = getMimeType(data);\n\n return { mimeType, data };\n }\n}\n\nfunction getMessageMediaMimeType(message: GramJs.Message, sizeType?: string) {\n if (!message || !message.media) {\n return undefined;\n }\n\n if (message.media instanceof GramJs.MessageMediaPhoto) {\n return 'image/jpeg';\n }\n\n if (message.media instanceof GramJs.MessageMediaDocument && message.media.document instanceof GramJs.Document) {\n if (sizeType) {\n return message.media.document!.attributes.some((a) => a instanceof GramJs.DocumentAttributeSticker)\n ? 'image/webp'\n : 'image/jpeg';\n }\n\n return message.media.document!.mimeType;\n }\n\n if (message.media instanceof GramJs.MessageMediaWebPage\n && message.media.webpage instanceof GramJs.WebPage\n && message.media.webpage.document instanceof GramJs.Document) {\n return message.media.webpage.document.mimeType;\n }\n\n return undefined;\n}\n\n// eslint-disable-next-line no-async-without-await/no-async-without-await\nasync function parseMedia(\n data: Buffer, mediaFormat: ApiMediaFormat, mimeType?: string,\n): Promise {\n switch (mediaFormat) {\n case ApiMediaFormat.DataUri:\n return blobToDataUri(new Blob([data], { type: mimeType }));\n case ApiMediaFormat.BlobUrl:\n return new Blob([data], { type: mimeType });\n case ApiMediaFormat.Lottie: {\n const json = inflate(data, { to: 'string' });\n return JSON.parse(json);\n }\n case ApiMediaFormat.Progressive: {\n return data.buffer;\n }\n }\n\n return undefined;\n}\n\nfunction prepareMedia(mediaData: ApiParsedMedia): ApiPreparedMedia {\n if (mediaData instanceof Blob) {\n return URL.createObjectURL(mediaData);\n }\n\n return mediaData;\n}\n\nfunction getMimeType(data: Uint8Array, fallbackMimeType = 'image/jpeg') {\n if (data.length < 4) {\n return fallbackMimeType;\n }\n\n let type = fallbackMimeType;\n const signature = data.subarray(0, 4).reduce((result, byte) => result + byte.toString(16), '');\n\n // https://en.wikipedia.org/wiki/List_of_file_signatures\n switch (signature) {\n case '89504e47':\n type = 'image/png';\n break;\n case '47494638':\n type = 'image/gif';\n break;\n case 'ffd8ffe0':\n case 'ffd8ffe1':\n case 'ffd8ffe2':\n case 'ffd8ffe3':\n case 'ffd8ffe8':\n type = 'image/jpeg';\n break;\n case '52494646':\n // In our case only webp is expected\n type = 'image/webp';\n break;\n }\n\n return type;\n}\n","import {\n TelegramClient, sessions, Api as GramJs, connection,\n} from '../../../lib/gramjs';\nimport { Logger as GramJsLogger } from '../../../lib/gramjs/extensions/index';\nimport { TwoFaParams } from '../../../lib/gramjs/client/2fa';\n\nimport {\n ApiInitialArgs,\n ApiMediaFormat,\n ApiOnProgress,\n ApiSessionData,\n OnApiUpdate,\n} from '../../types';\n\nimport {\n DEBUG, DEBUG_GRAMJS, UPLOAD_WORKERS, IS_TEST, APP_VERSION,\n} from '../../../config';\nimport {\n onRequestPhoneNumber, onRequestCode, onRequestPassword, onRequestRegistration,\n onAuthError, onAuthReady, onCurrentUserUpdate, onRequestQrCode,\n} from './auth';\nimport { updater } from '../updater';\nimport { setMessageBuilderCurrentUserId } from '../apiBuilders/messages';\nimport downloadMediaWithClient from './media';\nimport { buildApiUserFromFull } from '../apiBuilders/users';\nimport localDb from '../localDb';\n\nconst DEFAULT_USER_AGENT = 'Unknown UserAgent';\nconst APP_CODE_NAME = 'Z';\n\nGramJsLogger.setLevel(DEBUG_GRAMJS ? 'debug' : 'warn');\n\nconst gramJsUpdateEventBuilder = { build: (update: object) => update };\n\nlet onUpdate: OnApiUpdate;\nlet client: TelegramClient;\nlet isConnected = false;\n\nexport async function init(_onUpdate: OnApiUpdate, initialArgs: ApiInitialArgs) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START INIT API');\n }\n\n onUpdate = _onUpdate;\n\n const { userAgent, platform, sessionData } = initialArgs;\n const session = new sessions.CallbackSession(sessionData, onSessionUpdate);\n\n client = new TelegramClient(\n session,\n process.env.TELEGRAM_T_API_ID,\n process.env.TELEGRAM_T_API_HASH,\n {\n deviceModel: navigator.userAgent || userAgent || DEFAULT_USER_AGENT,\n appVersion: `${APP_VERSION} ${APP_CODE_NAME}`,\n useWSS: true,\n additionalDcsDisabled: IS_TEST,\n } as any,\n );\n\n client.addEventHandler(handleGramJsUpdate, gramJsUpdateEventBuilder);\n client.addEventHandler(updater, gramJsUpdateEventBuilder);\n\n try {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[GramJs/client] CONNECTING');\n }\n\n try {\n await client.start({\n phoneNumber: onRequestPhoneNumber,\n phoneCode: onRequestCode,\n password: onRequestPassword,\n firstAndLastNames: onRequestRegistration,\n qrCode: onRequestQrCode,\n onError: onAuthError,\n initialMethod: platform === 'iOS' || platform === 'Android' ? 'phoneNumber' : 'qrCode',\n });\n } catch (err) {\n // TODO Investigate which request causes this exception\n if (err.message !== 'Disconnect') {\n onUpdate({\n '@type': 'updateConnectionState',\n connectionState: 'connectionStateBroken',\n });\n\n return;\n }\n }\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH INIT API');\n // eslint-disable-next-line no-console\n console.log('[GramJs/client] CONNECTED');\n\n // eslint-disable-next-line no-restricted-globals\n (self as any).invoke = invokeRequest;\n // eslint-disable-next-line no-restricted-globals\n (self as any).GramJs = GramJs;\n }\n\n onAuthReady();\n onSessionUpdate(session.getSessionData());\n onUpdate({ '@type': 'updateApiReady' });\n\n void fetchCurrentUser();\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[GramJs/client] CONNECTING ERROR', err);\n }\n\n throw err;\n }\n}\n\nexport async function destroy() {\n await invokeRequest(new GramJs.auth.LogOut());\n await client.destroy();\n}\n\nexport async function disconnect() {\n await client.disconnect();\n}\n\nexport function getClient() {\n return client;\n}\n\nfunction onSessionUpdate(sessionData: ApiSessionData) {\n onUpdate({\n '@type': 'updateSession',\n sessionData,\n });\n}\n\nfunction handleGramJsUpdate(update: any) {\n if (update instanceof connection.UpdateConnectionState) {\n isConnected = update.state === connection.UpdateConnectionState.connected;\n } else if (update instanceof GramJs.UpdatesTooLong) {\n void handleTerminatedSession();\n } else if (update instanceof connection.UpdateServerTimeOffset) {\n onUpdate({\n '@type': 'updateServerTimeOffset',\n serverTimeOffset: update.timeOffset,\n });\n }\n}\n\nexport async function invokeRequest(\n request: T,\n shouldHandleUpdates = false,\n shouldThrow = false,\n): Promise {\n if (!isConnected) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn(`[GramJs/client] INVOKE ERROR ${request.className}: Client is not connected`);\n }\n\n return undefined;\n }\n\n try {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log(`[GramJs/client] INVOKE ${request.className}`);\n }\n\n const result = await client.invoke(request);\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log(`[GramJs/client] INVOKE RESPONSE ${request.className}`, result);\n }\n\n if (shouldHandleUpdates) {\n type ResultWithUpdates =\n typeof result\n & { updates?: GramJs.Updates | GramJs.UpdatesCombined };\n\n let updatesContainer;\n if (result instanceof GramJs.Updates || result instanceof GramJs.UpdatesCombined) {\n updatesContainer = result;\n } else if ('updates' in (result as ResultWithUpdates) && (\n (result as ResultWithUpdates).updates instanceof GramJs.Updates\n || (result as ResultWithUpdates).updates instanceof GramJs.UpdatesCombined\n )) {\n updatesContainer = (result as ResultWithUpdates).updates;\n }\n\n if (updatesContainer) {\n injectUpdateEntities(updatesContainer);\n\n updatesContainer.updates.forEach((update) => {\n updater(update, request);\n });\n } else if (result instanceof GramJs.UpdatesTooLong) {\n // TODO Implement\n } else {\n updater(result as GramJs.TypeUpdates, request);\n }\n }\n\n return result;\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log(`[GramJs/client] INVOKE ERROR ${request.className}`);\n // eslint-disable-next-line no-console\n console.error(err);\n }\n\n dispatchErrorUpdate(err, request);\n\n if (shouldThrow) {\n throw err;\n }\n\n return undefined;\n }\n}\n\nexport function downloadMedia(\n args: { url: string; mediaFormat: ApiMediaFormat; start?: number; end?: number; isHtmlAllowed?: boolean },\n onProgress?: ApiOnProgress,\n) {\n return downloadMediaWithClient(args, client, isConnected, onProgress);\n}\n\nexport function uploadFile(file: File, onProgress?: ApiOnProgress) {\n return client.uploadFile({ file, onProgress, workers: UPLOAD_WORKERS });\n}\n\nexport function updateTwoFaSettings(params: TwoFaParams) {\n return client.updateTwoFaSettings(params);\n}\n\nexport async function fetchCurrentUser() {\n const userFull = await invokeRequest(new GramJs.users.GetFullUser({\n id: new GramJs.InputUserSelf(),\n }));\n\n if (!userFull || !(userFull.user instanceof GramJs.User)) {\n return;\n }\n\n localDb.users[userFull.user.id] = userFull.user;\n const currentUser = buildApiUserFromFull(userFull);\n\n setMessageBuilderCurrentUserId(currentUser.id);\n onCurrentUserUpdate(currentUser);\n}\n\nexport function dispatchErrorUpdate(err: Error, request: T) {\n const isSlowMode = err.message.startsWith('A wait of') && (\n request instanceof GramJs.messages.SendMessage\n || request instanceof GramJs.messages.SendMedia\n || request instanceof GramJs.messages.SendMultiMedia\n );\n\n const { message } = err;\n\n onUpdate({\n '@type': 'error',\n error: {\n message,\n isSlowMode,\n hasErrorKey: true,\n },\n });\n}\n\nfunction injectUpdateEntities(result: GramJs.Updates | GramJs.UpdatesCombined) {\n const entities = [...result.users, ...result.chats];\n\n result.updates.forEach((update) => {\n if (entities) {\n // eslint-disable-next-line no-underscore-dangle\n (update as any)._entities = entities;\n }\n });\n}\n\nasync function handleTerminatedSession() {\n try {\n await invokeRequest(new GramJs.users.GetFullUser({\n id: new GramJs.InputUserSelf(),\n }), undefined, true);\n } catch (err) {\n if (err.message === 'AUTH_KEY_UNREGISTERED') {\n onUpdate({\n '@type': 'updateConnectionState',\n connectionState: 'connectionStateBroken',\n });\n }\n }\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\nimport {\n OnApiUpdate,\n ApiChat,\n ApiMessage,\n ApiUser,\n ApiMessageEntity,\n ApiFormattedText,\n ApiChatFullInfo,\n ApiChatFolder,\n ApiChatBannedRights,\n ApiChatAdminRights,\n} from '../../types';\n\nimport { DEBUG, ARCHIVED_FOLDER_ID, MEMBERS_LOAD_SLICE } from '../../../config';\nimport { invokeRequest, uploadFile } from './client';\nimport {\n buildApiChatFromDialog,\n getPeerKey,\n buildChatMembers,\n buildApiChatFromPreview,\n getApiChatIdFromMtpPeer,\n buildApiChatFolder,\n buildApiChatFolderFromSuggested,\n buildApiChatBotCommands,\n} from '../apiBuilders/chats';\nimport { buildApiMessage, buildMessageDraft } from '../apiBuilders/messages';\nimport { buildApiUser } from '../apiBuilders/users';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport localDb from '../localDb';\nimport {\n buildInputEntity,\n buildInputPeer,\n buildMtpMessageEntity,\n buildFilterFromApiFolder,\n isMessageWithMedia,\n buildChatBannedRights,\n buildChatAdminRights,\n} from '../gramjsBuilders';\nimport { addMessageToLocalDb } from '../helpers';\n\nconst MAX_INT_32 = 2 ** 31 - 1;\nlet onUpdate: OnApiUpdate;\n\nexport function init(_onUpdate: OnApiUpdate) {\n onUpdate = _onUpdate;\n}\n\nexport async function fetchChats({\n limit,\n offsetDate,\n archived,\n withPinned,\n serverTimeOffset,\n}: {\n limit: number;\n offsetDate?: number;\n archived?: boolean;\n withPinned?: boolean;\n serverTimeOffset: number;\n}) {\n const result = await invokeRequest(new GramJs.messages.GetDialogs({\n offsetPeer: new GramJs.InputPeerEmpty(),\n limit,\n offsetDate,\n folderId: archived ? ARCHIVED_FOLDER_ID : undefined,\n ...(withPinned && { excludePinned: true }),\n }));\n const resultPinned = withPinned\n ? await invokeRequest(new GramJs.messages.GetPinnedDialogs({\n folderId: archived ? ARCHIVED_FOLDER_ID : undefined,\n }))\n : undefined;\n\n if (!result || result instanceof GramJs.messages.DialogsNotModified) {\n return undefined;\n }\n\n if (resultPinned) {\n updateLocalDb(resultPinned);\n }\n updateLocalDb(result);\n\n const lastMessagesByChatId = buildCollectionByKey(\n (resultPinned ? resultPinned.messages : []).concat(result.messages)\n .map(buildApiMessage)\n .filter(Boolean as any),\n 'chatId',\n );\n const peersByKey: Record = {\n ...(resultPinned && preparePeers(resultPinned)),\n ...preparePeers(result),\n };\n const chats: ApiChat[] = [];\n const draftsById: Record = {};\n const replyingToById: Record = {};\n\n const dialogs = (resultPinned ? resultPinned.dialogs : []).concat(result.dialogs);\n\n const orderedPinnedIds: number[] = [];\n\n dialogs.forEach((dialog) => {\n if (\n !(dialog instanceof GramJs.Dialog)\n // This request can return dialogs not belonging to specified folder\n || (!archived && dialog.folderId === ARCHIVED_FOLDER_ID)\n || (archived && dialog.folderId !== ARCHIVED_FOLDER_ID)\n ) {\n return;\n }\n\n const peerEntity = peersByKey[getPeerKey(dialog.peer)];\n const chat = buildApiChatFromDialog(dialog, peerEntity, serverTimeOffset);\n chat.lastMessage = lastMessagesByChatId[chat.id];\n chat.isListed = true;\n chats.push(chat);\n\n if (withPinned && dialog.pinned) {\n orderedPinnedIds.push(chat.id);\n }\n\n if (dialog.draft) {\n const { formattedText, replyingToId } = buildMessageDraft(dialog.draft) || {};\n if (formattedText) {\n draftsById[chat.id] = formattedText;\n }\n if (replyingToId) {\n replyingToById[chat.id] = replyingToId;\n }\n }\n });\n\n const users = (resultPinned ? resultPinned.users : []).concat(result.users)\n .map(buildApiUser)\n .filter(Boolean as any);\n const chatIds = chats.map((chat) => chat.id);\n\n let totalChatCount: number;\n\n if (result instanceof GramJs.messages.DialogsSlice) {\n totalChatCount = result.count;\n } else {\n totalChatCount = chatIds.length;\n }\n\n return {\n chatIds,\n chats,\n users,\n draftsById,\n replyingToById,\n orderedPinnedIds: withPinned ? orderedPinnedIds : undefined,\n totalChatCount,\n };\n}\n\nexport function fetchFullChat(chat: ApiChat) {\n const { id, accessHash, adminRights } = chat;\n\n const input = buildInputEntity(id, accessHash);\n\n return input instanceof GramJs.InputChannel\n ? getFullChannelInfo(id, accessHash!, adminRights)\n : getFullChatInfo(id);\n}\n\nexport async function searchChats({ query }: { query: string }) {\n const result = await invokeRequest(new GramJs.contacts.Search({ q: query }));\n if (!result) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n const localPeerIds = result.myResults.map(getApiChatIdFromMtpPeer);\n const allChats = result.chats.concat(result.users)\n .map((user) => buildApiChatFromPreview(user))\n .filter(Boolean as any);\n const allUsers = result.users.map(buildApiUser).filter((user) => !!user && !user.isSelf) as ApiUser[];\n\n return {\n localChats: allChats.filter((r) => localPeerIds.includes(r.id)),\n localUsers: allUsers.filter((u) => localPeerIds.includes(u.id)),\n globalChats: allChats.filter((r) => !localPeerIds.includes(r.id)),\n globalUsers: allUsers.filter((u) => !localPeerIds.includes(u.id)),\n };\n}\n\nexport async function fetchChat({\n type, user,\n}: {\n type: 'user' | 'self' | 'support'; user?: ApiUser;\n}) {\n let mtpUser: GramJs.User | undefined;\n\n if (type === 'self' || type === 'user') {\n const result = await invokeRequest(new GramJs.users.GetUsers({\n id: [\n type === 'user' && user\n ? buildInputEntity(user.id, user.accessHash) as GramJs.InputUser\n : new GramJs.InputUserSelf(),\n ],\n }));\n if (!result || !result.length) {\n return undefined;\n }\n\n [mtpUser] = result;\n } else if (type === 'support') {\n const result = await invokeRequest(new GramJs.help.GetSupport());\n if (!result || !result.user) {\n return undefined;\n }\n\n mtpUser = result.user;\n }\n\n const chat = buildApiChatFromPreview(mtpUser!, type === 'support');\n if (!chat) {\n return undefined;\n }\n\n onUpdate({\n '@type': 'updateChat',\n id: chat.id,\n chat,\n });\n\n return { chatId: chat.id };\n}\n\nexport async function requestChatUpdate({\n chat,\n serverTimeOffset,\n}: {\n chat: ApiChat; serverTimeOffset: number;\n}) {\n const { id, accessHash } = chat;\n\n const result = await invokeRequest(new GramJs.messages.GetPeerDialogs({\n peers: [new GramJs.InputDialogPeer({\n peer: buildInputPeer(id, accessHash),\n })],\n }));\n\n if (!result) {\n return;\n }\n\n const dialog = result.dialogs[0];\n if (!dialog || !(dialog instanceof GramJs.Dialog)) {\n return;\n }\n\n const peersByKey = preparePeers(result);\n const peerEntity = peersByKey[getPeerKey(dialog.peer)];\n if (!peerEntity) {\n return;\n }\n\n updateLocalDb(result);\n\n const lastMessage = buildApiMessage(result.messages[0]);\n\n onUpdate({\n '@type': 'updateChat',\n id,\n chat: {\n ...buildApiChatFromDialog(dialog, peerEntity, serverTimeOffset),\n lastMessage,\n },\n });\n}\n\nexport function saveDraft({\n chat,\n text,\n entities,\n replyToMsgId,\n}: {\n chat: ApiChat;\n text: string;\n entities?: ApiMessageEntity[];\n replyToMsgId?: number;\n}) {\n return invokeRequest(new GramJs.messages.SaveDraft({\n peer: buildInputPeer(chat.id, chat.accessHash),\n message: text,\n ...(entities && {\n entities: entities.map(buildMtpMessageEntity),\n }),\n replyToMsgId,\n }));\n}\n\nexport function clearDraft(chat: ApiChat) {\n return invokeRequest(new GramJs.messages.SaveDraft({\n peer: buildInputPeer(chat.id, chat.accessHash),\n message: '',\n }));\n}\n\nasync function getFullChatInfo(chatId: number): Promise<{\n fullInfo: ApiChatFullInfo;\n users?: ApiUser[];\n} | undefined> {\n const result = await invokeRequest(new GramJs.messages.GetFullChat({\n chatId: buildInputEntity(chatId) as number,\n }));\n\n if (!result || !(result.fullChat instanceof GramJs.ChatFull)) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n const {\n about,\n participants,\n exportedInvite,\n botInfo,\n } = result.fullChat;\n\n const members = buildChatMembers(participants);\n const adminMembers = members ? members.filter(({ isAdmin, isOwner }) => isAdmin || isOwner) : undefined;\n const botCommands = botInfo ? buildApiChatBotCommands(botInfo) : undefined;\n\n return {\n fullInfo: {\n about,\n members,\n adminMembers,\n canViewMembers: true,\n botCommands,\n ...(exportedInvite && {\n inviteLink: exportedInvite.link,\n }),\n },\n users: result.users.map(buildApiUser).filter(Boolean as any),\n };\n}\n\nasync function getFullChannelInfo(\n id: number,\n accessHash: string,\n adminRights?: ApiChatAdminRights,\n) {\n const result = await invokeRequest(new GramJs.channels.GetFullChannel({\n channel: buildInputEntity(id, accessHash) as GramJs.InputChannel,\n }));\n\n if (!result || !(result.fullChat instanceof GramJs.ChannelFull)) {\n return undefined;\n }\n\n const {\n about,\n onlineCount,\n exportedInvite,\n slowmodeSeconds,\n slowmodeNextSendDate,\n migratedFromChatId,\n migratedFromMaxId,\n canViewParticipants,\n linkedChatId,\n hiddenPrehistory,\n call,\n botInfo,\n } = result.fullChat;\n\n const inviteLink = exportedInvite instanceof GramJs.ChatInviteExported\n ? exportedInvite.link\n : undefined;\n\n const { members, users } = (canViewParticipants && await fetchMembers(id, accessHash)) || {};\n const { members: kickedMembers, users: bannedUsers } = (\n canViewParticipants && adminRights && await fetchMembers(id, accessHash, 'kicked')\n ) || {};\n const { members: adminMembers, users: adminUsers } = (\n canViewParticipants && adminRights && await fetchMembers(id, accessHash, 'admin')\n ) || {};\n const botCommands = botInfo ? buildApiChatBotCommands(botInfo) : undefined;\n\n return {\n fullInfo: {\n about,\n onlineCount,\n inviteLink,\n slowMode: slowmodeSeconds ? {\n seconds: slowmodeSeconds,\n nextSendDate: slowmodeNextSendDate,\n } : undefined,\n migratedFrom: migratedFromChatId ? {\n chatId: getApiChatIdFromMtpPeer({ chatId: migratedFromChatId } as GramJs.TypePeer),\n maxMessageId: migratedFromMaxId,\n } : undefined,\n canViewMembers: canViewParticipants,\n isPreHistoryHidden: hiddenPrehistory,\n members,\n kickedMembers,\n adminMembers,\n groupCallId: call ? call.id.toString() : undefined,\n linkedChatId: linkedChatId ? getApiChatIdFromMtpPeer({ chatId: linkedChatId } as GramJs.TypePeer) : undefined,\n botCommands,\n },\n users: [...(users || []), ...(bannedUsers || []), ...(adminUsers || [])],\n };\n}\n\nexport async function updateChatMutedState({\n chat, isMuted, serverTimeOffset,\n}: {\n chat: ApiChat; isMuted: boolean; serverTimeOffset: number;\n}) {\n await invokeRequest(new GramJs.account.UpdateNotifySettings({\n peer: new GramJs.InputNotifyPeer({\n peer: buildInputPeer(chat.id, chat.accessHash),\n }),\n settings: new GramJs.InputPeerNotifySettings({ muteUntil: isMuted ? MAX_INT_32 : 0 }),\n }));\n\n onUpdate({\n '@type': 'updateNotifyExceptions',\n chatId: chat.id,\n isMuted,\n });\n\n void requestChatUpdate({\n chat,\n serverTimeOffset,\n });\n}\n\nexport async function createChannel({\n title, about, users,\n}: {\n title: string; about?: string; users: ApiUser[];\n}): Promise {\n const result = await invokeRequest(new GramJs.channels.CreateChannel({\n broadcast: true,\n title,\n about,\n }), true);\n\n // `createChannel` can return a lot of different update types according to docs,\n // but currently channel creation returns only `Updates` type.\n // Errors are added to catch unexpected cases in future testing\n if (!(result instanceof GramJs.Updates)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('Unexpected channel creation update', result);\n }\n return undefined;\n }\n\n const newChannel = result.chats[0];\n if (!newChannel || !(newChannel instanceof GramJs.Channel)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('Created channel not found', result);\n }\n return undefined;\n }\n\n const channel = buildApiChatFromPreview(newChannel)!;\n\n await invokeRequest(new GramJs.channels.InviteToChannel({\n channel: buildInputEntity(channel.id, channel.accessHash) as GramJs.InputChannel,\n users: users.map(({ id, accessHash }) => buildInputEntity(id, accessHash)) as GramJs.InputUser[],\n }));\n\n return channel;\n}\n\nexport function joinChannel({\n channelId, accessHash,\n}: {\n channelId: number; accessHash: string;\n}) {\n return invokeRequest(new GramJs.channels.JoinChannel({\n channel: buildInputEntity(channelId, accessHash) as GramJs.InputChannel,\n }), true);\n}\n\nexport function deleteChatUser({\n chat, user,\n}: {\n chat: ApiChat; user: ApiUser;\n}) {\n if (chat.type !== 'chatTypeBasicGroup') return undefined;\n return invokeRequest(new GramJs.messages.DeleteChatUser({\n chatId: buildInputEntity(chat.id, chat.accessHash) as number,\n userId: buildInputEntity(user.id, user.accessHash) as GramJs.InputUser,\n }), true);\n}\n\nexport function deleteChat({\n chatId,\n}: {\n chatId: number;\n}) {\n return invokeRequest(new GramJs.messages.DeleteChat({\n chatId: buildInputEntity(chatId) as number,\n }), true);\n}\n\nexport function leaveChannel({\n channelId, accessHash,\n}: {\n channelId: number; accessHash: string;\n}) {\n return invokeRequest(new GramJs.channels.LeaveChannel({\n channel: buildInputEntity(channelId, accessHash) as GramJs.InputChannel,\n }), true);\n}\n\nexport function deleteChannel({\n channelId, accessHash,\n}: {\n channelId: number; accessHash: string;\n}) {\n return invokeRequest(new GramJs.channels.DeleteChannel({\n channel: buildInputEntity(channelId, accessHash) as GramJs.InputChannel,\n }), true);\n}\n\nexport async function createGroupChat({\n title, users,\n}: {\n title: string; users: ApiUser[];\n}): Promise {\n const result = await invokeRequest(new GramJs.messages.CreateChat({\n title,\n users: users.map(({ id, accessHash }) => buildInputEntity(id, accessHash)) as GramJs.InputUser[],\n }), true);\n\n // `createChat` can return a lot of different update types according to docs,\n // but currently chat creation returns only `Updates` type.\n // Errors are added to catch unexpected cases in future testing\n if (!(result instanceof GramJs.Updates)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('Unexpected chat creation update', result);\n }\n return undefined;\n }\n\n const newChat = result.chats[0];\n if (!newChat || !(newChat instanceof GramJs.Chat)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('Created chat not found', result);\n }\n return undefined;\n }\n\n return buildApiChatFromPreview(newChat);\n}\n\nexport async function editChatPhoto({\n chatId, accessHash, photo,\n}: {\n chatId: number; accessHash?: string; photo: File;\n}) {\n const uploadedPhoto = await uploadFile(photo);\n const inputEntity = buildInputEntity(chatId, accessHash);\n\n return invokeRequest(\n inputEntity instanceof GramJs.InputChannel\n ? new GramJs.channels.EditPhoto({\n channel: inputEntity as GramJs.InputChannel,\n photo: new GramJs.InputChatUploadedPhoto({\n file: uploadedPhoto,\n }),\n })\n : new GramJs.messages.EditChatPhoto({\n chatId: inputEntity as number,\n photo: new GramJs.InputChatUploadedPhoto({\n file: uploadedPhoto,\n }),\n }),\n true,\n );\n}\n\nexport async function toggleChatPinned({\n chat,\n shouldBePinned,\n}: {\n chat: ApiChat;\n shouldBePinned: boolean;\n}) {\n const { id, accessHash } = chat;\n\n const isActionSuccessful = await invokeRequest(new GramJs.messages.ToggleDialogPin({\n peer: new GramJs.InputDialogPeer({\n peer: buildInputPeer(id, accessHash),\n }),\n pinned: shouldBePinned || undefined,\n }));\n\n if (isActionSuccessful) {\n onUpdate({\n '@type': 'updateChatPinned',\n id: chat.id,\n isPinned: shouldBePinned,\n });\n }\n}\n\nexport function toggleChatArchived({\n chat, folderId,\n}: {\n chat: ApiChat; folderId: number;\n}) {\n const { id, accessHash } = chat;\n\n return invokeRequest(new GramJs.folders.EditPeerFolders({\n folderPeers: [new GramJs.InputFolderPeer({\n peer: buildInputPeer(id, accessHash),\n folderId,\n })],\n }), true);\n}\n\nexport async function fetchChatFolders() {\n const result = await invokeRequest(new GramJs.messages.GetDialogFilters());\n\n if (!result) {\n return undefined;\n }\n\n return {\n byId: buildCollectionByKey(result.map(buildApiChatFolder), 'id') as Record,\n orderedIds: result.map(({ id }) => id),\n };\n}\n\nexport async function fetchRecommendedChatFolders() {\n const results = await invokeRequest(new GramJs.messages.GetSuggestedDialogFilters());\n\n if (!results) {\n return undefined;\n }\n\n return results.map(buildApiChatFolderFromSuggested);\n}\n\nexport async function editChatFolder({\n id,\n folderUpdate,\n}: {\n id: number;\n folderUpdate: ApiChatFolder;\n}) {\n const filter = buildFilterFromApiFolder(folderUpdate);\n\n const isActionSuccessful = await invokeRequest(new GramJs.messages.UpdateDialogFilter({\n id,\n filter,\n }));\n\n if (isActionSuccessful) {\n onUpdate({\n '@type': 'updateChatFolder',\n id,\n folder: folderUpdate,\n });\n }\n}\n\nexport async function deleteChatFolder(id: number) {\n const isActionSuccessful = await invokeRequest(new GramJs.messages.UpdateDialogFilter({\n id,\n filter: undefined,\n }));\n const recommendedChatFolders = await fetchRecommendedChatFolders();\n\n if (isActionSuccessful) {\n onUpdate({\n '@type': 'updateChatFolder',\n id,\n folder: undefined,\n });\n }\n if (recommendedChatFolders) {\n onUpdate({\n '@type': 'updateRecommendedChatFolders',\n folders: recommendedChatFolders,\n });\n }\n}\n\nexport async function toggleDialogUnread({\n chat, hasUnreadMark,\n}: {\n chat: ApiChat; hasUnreadMark: boolean | undefined;\n}) {\n const { id, accessHash } = chat;\n\n const isActionSuccessful = await invokeRequest(new GramJs.messages.MarkDialogUnread({\n peer: new GramJs.InputDialogPeer({\n peer: buildInputPeer(id, accessHash),\n }),\n unread: hasUnreadMark || undefined,\n }));\n\n if (isActionSuccessful) {\n onUpdate({\n '@type': 'updateChat',\n id: chat.id,\n chat: { hasUnreadMark },\n });\n }\n}\n\nexport async function getChatByUsername(username: string) {\n const result = await invokeRequest(new GramJs.contacts.ResolveUsername({\n username,\n }));\n\n if (!result) {\n return undefined;\n }\n\n const { users, chats } = result;\n\n const chat = chats.length\n ? buildApiChatFromPreview(chats[0])\n : buildApiChatFromPreview(users[0]);\n\n if (!chat) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n return chat;\n}\n\nexport function togglePreHistoryHidden({\n chat, isEnabled,\n}: { chat: ApiChat; isEnabled: boolean }) {\n const { id, accessHash } = chat;\n const channel = buildInputEntity(id, accessHash);\n\n return invokeRequest(new GramJs.channels.TogglePreHistoryHidden({\n channel: channel as GramJs.InputChannel,\n enabled: isEnabled,\n }), true);\n}\n\nexport function updateChatDefaultBannedRights({\n chat, bannedRights,\n}: { chat: ApiChat; bannedRights: ApiChatBannedRights }) {\n const { id, accessHash } = chat;\n const peer = buildInputPeer(id, accessHash);\n\n return invokeRequest(new GramJs.messages.EditChatDefaultBannedRights({\n peer,\n bannedRights: buildChatBannedRights(bannedRights),\n }), true);\n}\n\nexport function updateChatMemberBannedRights({\n chat, user, bannedRights, untilDate,\n}: { chat: ApiChat; user: ApiUser; bannedRights: ApiChatBannedRights; untilDate?: number }) {\n const channel = buildInputEntity(chat.id, chat.accessHash) as GramJs.InputChannel;\n const participant = buildInputPeer(user.id, user.accessHash) as GramJs.InputUser;\n\n return invokeRequest(new GramJs.channels.EditBanned({\n channel,\n participant,\n bannedRights: buildChatBannedRights(bannedRights, untilDate),\n }), true);\n}\n\nexport function updateChatAdmin({\n chat, user, adminRights, customTitle = '',\n}: { chat: ApiChat; user: ApiUser; adminRights: ApiChatAdminRights; customTitle: string }) {\n const channel = buildInputEntity(chat.id, chat.accessHash) as GramJs.InputChannel;\n const userId = buildInputEntity(user.id, user.accessHash) as GramJs.InputUser;\n\n return invokeRequest(new GramJs.channels.EditAdmin({\n channel,\n userId,\n adminRights: buildChatAdminRights(adminRights),\n rank: customTitle,\n }), true);\n}\n\nexport async function updateChatTitle(chat: ApiChat, title: string) {\n const inputEntity = buildInputEntity(chat.id, chat.accessHash);\n await invokeRequest(\n inputEntity instanceof GramJs.InputChannel\n ? new GramJs.channels.EditTitle({\n channel: inputEntity as GramJs.InputChannel,\n title,\n }) : new GramJs.messages.EditChatTitle({\n chatId: inputEntity as number,\n title,\n }),\n true,\n );\n}\n\nexport async function updateChatAbout(chat: ApiChat, about: string) {\n const result = await invokeRequest(new GramJs.messages.EditChatAbout({\n peer: buildInputPeer(chat.id, chat.accessHash),\n about,\n }));\n\n if (!result) {\n return;\n }\n\n onUpdate({\n '@type': 'updateChatFullInfo',\n id: chat.id,\n fullInfo: {\n about,\n },\n });\n}\n\nexport function toggleSignatures({\n chat, isEnabled,\n}: { chat: ApiChat; isEnabled: boolean }) {\n const { id, accessHash } = chat;\n const channel = buildInputEntity(id, accessHash);\n\n return invokeRequest(new GramJs.channels.ToggleSignatures({\n channel: channel as GramJs.InputChannel,\n enabled: isEnabled,\n }), true);\n}\n\ntype ChannelMembersFilter =\n 'kicked'\n | 'admin'\n | 'recent';\n\nexport async function fetchMembers(\n chatId: number,\n accessHash: string,\n memberFilter: ChannelMembersFilter = 'recent',\n offset?: number,\n) {\n let filter: GramJs.TypeChannelParticipantsFilter;\n\n switch (memberFilter) {\n case 'kicked':\n filter = new GramJs.ChannelParticipantsKicked({ q: '' });\n break;\n case 'admin':\n filter = new GramJs.ChannelParticipantsAdmins();\n break;\n default:\n filter = new GramJs.ChannelParticipantsRecent();\n break;\n }\n\n const result = await invokeRequest(new GramJs.channels.GetParticipants({\n channel: buildInputEntity(chatId, accessHash) as GramJs.InputChannel,\n filter,\n offset,\n limit: MEMBERS_LOAD_SLICE,\n }));\n\n if (!result || result instanceof GramJs.channels.ChannelParticipantsNotModified) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n return {\n members: buildChatMembers(result),\n users: result.users.map(buildApiUser).filter(Boolean as any),\n };\n}\n\nexport async function fetchGroupsForDiscussion() {\n const result = await invokeRequest(new GramJs.channels.GetGroupsForDiscussion());\n\n if (!result) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n return result.chats.map((chat) => buildApiChatFromPreview(chat));\n}\n\nexport function setDiscussionGroup({\n channel,\n chat,\n}: {\n channel: ApiChat;\n chat?: ApiChat;\n}) {\n return invokeRequest(new GramJs.channels.SetDiscussionGroup({\n broadcast: buildInputPeer(channel.id, channel.accessHash),\n group: chat ? buildInputPeer(chat.id, chat.accessHash) : new GramJs.InputChannelEmpty(),\n }));\n}\n\nexport async function migrateChat(chat: ApiChat) {\n const result = await invokeRequest(\n new GramJs.messages.MigrateChat({ chatId: buildInputEntity(chat.id) as number }), true,\n );\n\n // `migrateChat` can return a lot of different update types according to docs,\n // but currently chat migrations returns only `Updates` type.\n // Errors are added to catch unexpected cases in future testing\n if (!result || !(result instanceof GramJs.Updates)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('Unexpected channel creation update', result);\n }\n\n return undefined;\n }\n\n updateLocalDb(result);\n\n return buildApiChatFromPreview(result.chats[1]);\n}\n\nexport async function openChatByInvite(hash: string) {\n const result = await invokeRequest(new GramJs.messages.CheckChatInvite({ hash }));\n\n if (!result) {\n return undefined;\n }\n\n let chat: ApiChat | undefined;\n\n if (result instanceof GramJs.ChatInvite) {\n onUpdate({\n '@type': 'showInvite',\n data: {\n title: result.title,\n hash,\n participantsCount: result.participantsCount,\n isChannel: result.channel,\n },\n });\n } else {\n chat = buildApiChatFromPreview(result.chat);\n\n if (chat) {\n onUpdate({\n '@type': 'updateChat',\n id: chat.id,\n chat,\n });\n }\n }\n\n if (!chat) {\n return undefined;\n }\n\n return { chatId: chat.id };\n}\n\nexport function addChatMembers(chat: ApiChat, users: ApiUser[]) {\n if (chat.type === 'chatTypeChannel' || chat.type === 'chatTypeSuperGroup') {\n return invokeRequest(new GramJs.channels.InviteToChannel({\n channel: buildInputEntity(chat.id, chat.accessHash) as GramJs.InputChannel,\n users: users.map((user) => buildInputEntity(user.id, user.accessHash)) as GramJs.InputUser[],\n }), true);\n }\n\n return Promise.all(users.map((user) => {\n return invokeRequest(new GramJs.messages.AddChatUser({\n chatId: buildInputEntity(chat.id) as number,\n userId: buildInputEntity(user.id, user.accessHash) as GramJs.InputUser,\n }), true);\n }));\n}\n\nexport function deleteChatMember(chat: ApiChat, user: ApiUser) {\n if (chat.type === 'chatTypeChannel' || chat.type === 'chatTypeSuperGroup') {\n return updateChatMemberBannedRights({\n chat,\n user,\n bannedRights: {\n viewMessages: true,\n sendMessages: true,\n sendMedia: true,\n sendStickers: true,\n sendGifs: true,\n sendGames: true,\n sendInline: true,\n embedLinks: true,\n sendPolls: true,\n changeInfo: true,\n inviteUsers: true,\n pinMessages: true,\n },\n untilDate: MAX_INT_32,\n });\n } else {\n return invokeRequest(new GramJs.messages.DeleteChatUser({\n chatId: buildInputEntity(chat.id) as number,\n userId: buildInputEntity(user.id, user.accessHash) as GramJs.InputUser,\n }), true);\n }\n}\n\nfunction preparePeers(\n result: GramJs.messages.Dialogs | GramJs.messages.DialogsSlice | GramJs.messages.PeerDialogs,\n) {\n const store: Record = {};\n\n result.chats.forEach((chat) => {\n store[`chat${chat.id}`] = chat;\n });\n\n result.users.forEach((user) => {\n store[`user${user.id}`] = user;\n });\n\n return store;\n}\n\nfunction updateLocalDb(result: (\n GramJs.messages.Dialogs | GramJs.messages.DialogsSlice | GramJs.messages.PeerDialogs |\n GramJs.messages.ChatFull | GramJs.contacts.Found |\n GramJs.contacts.ResolvedPeer | GramJs.channels.ChannelParticipants |\n GramJs.messages.Chats | GramJs.messages.ChatsSlice | GramJs.TypeUpdates\n)) {\n if ('users' in result) {\n result.users.forEach((user) => {\n if (user instanceof GramJs.User) {\n localDb.users[user.id] = user;\n }\n });\n }\n\n if ('chats' in result) {\n result.chats.forEach((chat) => {\n if (chat instanceof GramJs.Chat || chat instanceof GramJs.Channel) {\n localDb.chats[chat.id] = chat;\n }\n });\n }\n\n if ('messages' in result) {\n result.messages.forEach((message) => {\n if (message instanceof GramJs.Message && isMessageWithMedia(message)) {\n addMessageToLocalDb(message);\n }\n });\n }\n}\n\nexport async function importChatInvite({ hash }: { hash: string }) {\n const updates = await invokeRequest(new GramJs.messages.ImportChatInvite({ hash }), true);\n if (!(updates instanceof GramJs.Updates) || !updates.chats.length) {\n return undefined;\n }\n\n const chat = buildApiChatFromPreview(updates.chats[0]);\n\n return chat;\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\nimport {\n ApiChat,\n ApiAttachment,\n ApiMessage,\n OnApiUpdate,\n ApiMessageSearchType,\n ApiUser,\n ApiSticker,\n ApiVideo,\n ApiNewPoll,\n ApiMessageEntity,\n ApiOnProgress,\n ApiThreadInfo,\n MAIN_THREAD_ID,\n MESSAGE_DELETED,\n ApiGlobalMessageSearchType,\n ApiReportReason,\n} from '../../types';\n\nimport { ALL_FOLDER_ID, DEBUG, PINNED_MESSAGES_LIMIT } from '../../../config';\nimport { invokeRequest, uploadFile } from './client';\nimport {\n buildApiMessage,\n buildLocalMessage,\n buildWebPage,\n buildForwardedMessage,\n} from '../apiBuilders/messages';\nimport { buildApiUser } from '../apiBuilders/users';\nimport {\n buildInputEntity,\n buildInputPeer,\n generateRandomBigInt,\n getEntityTypeById,\n buildInputMediaDocument,\n buildInputPoll,\n buildMtpMessageEntity,\n isMessageWithMedia,\n isServiceMessageWithMedia,\n calculateResultHash,\n buildInputReportReason,\n} from '../gramjsBuilders';\nimport localDb from '../localDb';\nimport { buildApiChatFromPreview } from '../apiBuilders/chats';\nimport { fetchFile } from '../../../util/files';\nimport { addMessageToLocalDb, resolveMessageApiChatId } from '../helpers';\nimport { interpolateArray } from '../../../util/waveform';\nimport { requestChatUpdate } from './chats';\n\nconst FAST_SEND_TIMEOUT = 1000;\nconst INPUT_WAVEFORM_LENGTH = 63;\n\nlet onUpdate: OnApiUpdate;\n\nexport function init(_onUpdate: OnApiUpdate) {\n onUpdate = _onUpdate;\n}\n\nexport async function fetchMessages({\n chat,\n threadId,\n ...pagination\n}: {\n chat: ApiChat;\n threadId?: number;\n offsetId?: number;\n addOffset?: number;\n limit: number;\n}) {\n const RequestClass = threadId === MAIN_THREAD_ID ? GramJs.messages.GetHistory : GramJs.messages.GetReplies;\n let result;\n\n try {\n result = await invokeRequest(new RequestClass({\n peer: buildInputPeer(chat.id, chat.accessHash),\n ...(threadId !== MAIN_THREAD_ID && {\n msgId: threadId,\n }),\n ...pagination,\n }), undefined, true);\n } catch (err) {\n if (err.message === 'CHANNEL_PRIVATE') {\n onUpdate({\n '@type': 'updateChat',\n id: chat.id,\n chat: {\n isRestricted: true,\n },\n });\n }\n }\n\n if (\n !result\n || result instanceof GramJs.messages.MessagesNotModified\n || !result.messages\n ) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n const messages = result.messages.map(buildApiMessage).filter(Boolean as any);\n const users = result.users.map(buildApiUser).filter(Boolean as any);\n const chats = result.chats.map((c) => buildApiChatFromPreview(c)).filter(Boolean as any);\n const threadInfos = messages.map(({ threadInfo }) => threadInfo).filter(Boolean as any);\n\n return {\n messages,\n users,\n chats,\n threadInfos,\n };\n}\n\nexport async function fetchMessage({ chat, messageId }: { chat: ApiChat; messageId: number }) {\n const isChannel = getEntityTypeById(chat.id) === 'channel';\n\n const result = await invokeRequest(\n isChannel\n ? new GramJs.channels.GetMessages({\n channel: buildInputEntity(chat.id, chat.accessHash) as GramJs.InputChannel,\n id: [new GramJs.InputMessageID({ id: messageId })],\n })\n : new GramJs.messages.GetMessages({\n id: [new GramJs.InputMessageID({ id: messageId })],\n }),\n );\n\n if (!result || result instanceof GramJs.messages.MessagesNotModified) {\n return undefined;\n }\n\n const mtpMessage = result.messages[0];\n if (!mtpMessage) {\n return undefined;\n }\n\n if (mtpMessage instanceof GramJs.MessageEmpty) {\n return MESSAGE_DELETED;\n }\n\n const message = mtpMessage && buildApiMessage(mtpMessage);\n if (!message) {\n return undefined;\n }\n\n if (mtpMessage instanceof GramJs.Message) {\n addMessageToLocalDb(mtpMessage);\n }\n\n const users = result.users.map(buildApiUser).filter(Boolean as any);\n\n return { message, users };\n}\n\nlet queue = Promise.resolve();\n\nexport function sendMessage(\n {\n chat,\n text,\n entities,\n replyingTo,\n attachment,\n sticker,\n gif,\n poll,\n isSilent,\n scheduledAt,\n groupedId,\n noWebPage,\n serverTimeOffset,\n }: {\n chat: ApiChat;\n text?: string;\n entities?: ApiMessageEntity[];\n replyingTo?: number;\n attachment?: ApiAttachment;\n sticker?: ApiSticker;\n gif?: ApiVideo;\n poll?: ApiNewPoll;\n isSilent?: boolean;\n scheduledAt?: number;\n groupedId?: string;\n noWebPage?: boolean;\n serverTimeOffset?: number;\n },\n onProgress?: ApiOnProgress,\n) {\n const localMessage = buildLocalMessage(\n chat, text, entities, replyingTo, attachment, sticker, gif, poll, groupedId, scheduledAt, serverTimeOffset,\n );\n onUpdate({\n '@type': localMessage.isScheduled ? 'newScheduledMessage' : 'newMessage',\n id: localMessage.id,\n chatId: chat.id,\n message: localMessage,\n });\n\n // This is expected to arrive after `updateMessageSendSucceeded` which replaces the local ID,\n // so in most cases this will be simply ignored\n setTimeout(() => {\n onUpdate({\n '@type': localMessage.isScheduled ? 'updateScheduledMessage' : 'updateMessage',\n id: localMessage.id,\n chatId: chat.id,\n message: {\n sendingState: 'messageSendingStatePending',\n },\n });\n }, FAST_SEND_TIMEOUT);\n\n const randomId = generateRandomBigInt();\n localDb.localMessages[randomId.toString()] = localMessage;\n\n if (groupedId) {\n return sendGroupedMedia({\n chat, text, entities, replyingTo, attachment: attachment!, groupedId, isSilent, scheduledAt,\n }, randomId, localMessage, onProgress);\n }\n\n const prevQueue = queue;\n queue = (async () => {\n let media: GramJs.TypeInputMedia | undefined;\n if (attachment) {\n try {\n media = await uploadMedia(localMessage, attachment, onProgress!);\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn(err);\n }\n\n await prevQueue;\n\n return;\n }\n } else if (sticker) {\n media = buildInputMediaDocument(sticker);\n } else if (gif) {\n media = buildInputMediaDocument(gif);\n } else if (poll) {\n media = buildInputPoll(poll, randomId);\n }\n\n await prevQueue;\n\n const RequestClass = media ? GramJs.messages.SendMedia : GramJs.messages.SendMessage;\n\n await invokeRequest(new RequestClass({\n clearDraft: true,\n message: text || '',\n entities: entities ? entities.map(buildMtpMessageEntity) : undefined,\n peer: buildInputPeer(chat.id, chat.accessHash),\n randomId,\n ...(isSilent && { silent: isSilent }),\n ...(scheduledAt && { scheduleDate: scheduledAt }),\n ...(replyingTo && { replyToMsgId: replyingTo }),\n ...(media && { media }),\n ...(noWebPage && { noWebpage: noWebPage }),\n }), true);\n })();\n\n return queue;\n}\n\nconst groupedUploads: Record;\n}> = {};\n\nfunction sendGroupedMedia(\n {\n chat,\n text,\n entities,\n replyingTo,\n attachment,\n groupedId,\n isSilent,\n scheduledAt,\n }: {\n chat: ApiChat;\n text?: string;\n entities?: ApiMessageEntity[];\n replyingTo?: number;\n attachment: ApiAttachment;\n groupedId: string;\n isSilent?: boolean;\n scheduledAt?: number;\n },\n randomId: GramJs.long,\n localMessage: ApiMessage,\n onProgress?: ApiOnProgress,\n) {\n let groupIndex = -1;\n if (!groupedUploads[groupedId]) {\n groupedUploads[groupedId] = {\n counter: 0,\n singleMediaByIndex: {},\n };\n }\n\n groupIndex = groupedUploads[groupedId].counter++;\n\n const prevQueue = queue;\n queue = (async () => {\n let media;\n try {\n media = await uploadMedia(localMessage, attachment, onProgress!);\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn(err);\n }\n\n groupedUploads[groupedId].counter--;\n\n await prevQueue;\n\n return;\n }\n\n const inputMedia = await fetchInputMedia(\n buildInputPeer(chat.id, chat.accessHash),\n media as GramJs.InputMediaUploadedPhoto | GramJs.InputMediaUploadedDocument,\n );\n\n await prevQueue;\n\n if (!inputMedia) {\n groupedUploads[groupedId].counter--;\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('Failed to upload grouped media');\n }\n\n return;\n }\n\n groupedUploads[groupedId].singleMediaByIndex[groupIndex] = new GramJs.InputSingleMedia({\n media: inputMedia,\n randomId,\n message: text || '',\n entities: entities ? entities.map(buildMtpMessageEntity) : undefined,\n });\n\n if (Object.keys(groupedUploads[groupedId].singleMediaByIndex).length < groupedUploads[groupedId].counter) {\n return;\n }\n\n const { singleMediaByIndex } = groupedUploads[groupedId];\n delete groupedUploads[groupedId];\n\n await invokeRequest(new GramJs.messages.SendMultiMedia({\n clearDraft: true,\n peer: buildInputPeer(chat.id, chat.accessHash),\n multiMedia: Object.values(singleMediaByIndex), // Object keys are usually ordered\n replyToMsgId: replyingTo,\n ...(isSilent && { silent: isSilent }),\n ...(scheduledAt && { scheduleDate: scheduledAt }),\n }), true);\n })();\n\n return queue;\n}\n\nasync function fetchInputMedia(\n peer: GramJs.TypeInputPeer,\n uploadedMedia: GramJs.InputMediaUploadedPhoto | GramJs.InputMediaUploadedDocument,\n) {\n const messageMedia = await invokeRequest(new GramJs.messages.UploadMedia({\n peer,\n media: uploadedMedia,\n }));\n\n if ((\n messageMedia instanceof GramJs.MessageMediaPhoto\n && messageMedia.photo\n && messageMedia.photo instanceof GramJs.Photo)\n ) {\n const { photo: { id, accessHash, fileReference } } = messageMedia;\n\n return new GramJs.InputMediaPhoto({\n id: new GramJs.InputPhoto({ id, accessHash, fileReference }),\n });\n }\n\n if ((\n messageMedia instanceof GramJs.MessageMediaDocument\n && messageMedia.document\n && messageMedia.document instanceof GramJs.Document)\n ) {\n const { document: { id, accessHash, fileReference } } = messageMedia;\n\n return new GramJs.InputMediaDocument({\n id: new GramJs.InputDocument({ id, accessHash, fileReference }),\n });\n }\n\n return undefined;\n}\n\nexport async function editMessage({\n chat,\n message,\n text,\n entities,\n noWebPage,\n serverTimeOffset,\n}: {\n chat: ApiChat;\n message: ApiMessage;\n text: string;\n entities?: ApiMessageEntity[];\n noWebPage?: boolean;\n serverTimeOffset: number;\n}) {\n const isScheduled = message.date * 1000 > Date.now() + serverTimeOffset * 1000;\n const messageUpdate: Partial = {\n content: {\n ...message.content,\n ...(text && {\n text: {\n text,\n entities,\n },\n }),\n },\n };\n\n onUpdate({\n '@type': isScheduled ? 'updateScheduledMessage' : 'updateMessage',\n id: message.id,\n chatId: chat.id,\n message: messageUpdate,\n });\n\n // TODO Revise intersecting with scheduled\n localDb.localMessages[message.id] = { ...message, ...messageUpdate };\n\n const mtpEntities = entities && entities.map(buildMtpMessageEntity);\n\n await invokeRequest(new GramJs.messages.EditMessage({\n message: text || '',\n entities: mtpEntities,\n peer: buildInputPeer(chat.id, chat.accessHash),\n id: message.id,\n ...(isScheduled && { scheduleDate: message.date }),\n ...(noWebPage && { noWebpage: noWebPage }),\n }), true);\n}\n\nexport async function rescheduleMessage({\n chat,\n message,\n scheduledAt,\n}: {\n chat: ApiChat;\n message: ApiMessage;\n scheduledAt: number;\n}) {\n await invokeRequest(new GramJs.messages.EditMessage({\n peer: buildInputPeer(chat.id, chat.accessHash),\n id: message.id,\n scheduleDate: scheduledAt,\n }), true);\n}\n\nasync function uploadMedia(localMessage: ApiMessage, attachment: ApiAttachment, onProgress: ApiOnProgress) {\n const {\n filename, blobUrl, mimeType, quick, voice,\n } = attachment;\n\n const file = await fetchFile(blobUrl, filename);\n const patchedOnProgress: ApiOnProgress = (progress) => {\n if (onProgress.isCanceled) {\n patchedOnProgress.isCanceled = true;\n } else {\n onProgress(progress, localMessage.id);\n }\n };\n const inputFile = await uploadFile(file, patchedOnProgress);\n\n const attributes: GramJs.TypeDocumentAttribute[] = [new GramJs.DocumentAttributeFilename({ fileName: filename })];\n if (quick) {\n if (mimeType.startsWith('image/')) {\n return new GramJs.InputMediaUploadedPhoto({ file: inputFile });\n } else {\n const { width, height, duration } = quick;\n if (duration !== undefined) {\n attributes.push(new GramJs.DocumentAttributeVideo({\n duration,\n w: width,\n h: height,\n }));\n }\n }\n }\n\n if (voice) {\n const { duration, waveform } = voice;\n const { data: inputWaveform } = interpolateArray(waveform, INPUT_WAVEFORM_LENGTH);\n attributes.push(new GramJs.DocumentAttributeAudio({\n voice: true,\n duration,\n waveform: Buffer.from(inputWaveform),\n }));\n }\n\n return new GramJs.InputMediaUploadedDocument({\n file: inputFile,\n mimeType,\n attributes,\n });\n}\n\nexport async function pinMessage({\n chat, messageId, isUnpin, isOneSide, isSilent,\n}: { chat: ApiChat; messageId: number; isUnpin: boolean; isOneSide: boolean; isSilent: boolean }) {\n await invokeRequest(new GramJs.messages.UpdatePinnedMessage({\n peer: buildInputPeer(chat.id, chat.accessHash),\n id: messageId,\n ...(isUnpin && { unpin: true }),\n ...(isOneSide && { pmOneside: true }),\n ...(isSilent && { silent: true }),\n }), true);\n}\n\nexport async function unpinAllMessages({ chat }: { chat: ApiChat }) {\n await invokeRequest(new GramJs.messages.UnpinAllMessages({\n peer: buildInputPeer(chat.id, chat.accessHash),\n }), true);\n}\n\nexport async function deleteMessages({\n chat, messageIds, shouldDeleteForAll,\n}: {\n chat: ApiChat; messageIds: number[]; shouldDeleteForAll?: boolean;\n}) {\n const isChannel = getEntityTypeById(chat.id) === 'channel';\n\n const result = await invokeRequest(\n isChannel\n ? new GramJs.channels.DeleteMessages({\n channel: buildInputEntity(chat.id, chat.accessHash) as GramJs.InputChannel,\n id: messageIds,\n })\n : new GramJs.messages.DeleteMessages({\n id: messageIds,\n ...(shouldDeleteForAll && { revoke: true }),\n }),\n );\n\n if (!result) {\n return;\n }\n\n onUpdate({\n '@type': 'deleteMessages',\n ids: messageIds,\n ...(isChannel && { chatId: chat.id }),\n });\n}\n\nexport async function deleteScheduledMessages({\n chat, messageIds,\n}: {\n chat: ApiChat; messageIds: number[];\n}) {\n const result = await invokeRequest(\n new GramJs.messages.DeleteScheduledMessages({\n peer: buildInputPeer(chat.id, chat.accessHash),\n id: messageIds,\n }),\n );\n\n if (!result) {\n return;\n }\n\n onUpdate({\n '@type': 'deleteScheduledMessages',\n ids: messageIds,\n chatId: chat.id,\n });\n}\n\nexport async function deleteHistory({\n chat, shouldDeleteForAll, maxId,\n}: {\n chat: ApiChat; shouldDeleteForAll?: boolean; maxId?: number;\n}) {\n const isChannel = getEntityTypeById(chat.id) === 'channel';\n const result = await invokeRequest(\n isChannel\n ? new GramJs.channels.DeleteHistory({\n channel: buildInputEntity(chat.id, chat.accessHash) as GramJs.InputChannel,\n maxId,\n })\n : new GramJs.messages.DeleteHistory({\n peer: buildInputPeer(chat.id, chat.accessHash),\n ...(shouldDeleteForAll && { revoke: true }),\n ...(!shouldDeleteForAll && { just_clear: true }),\n maxId,\n }),\n );\n\n if (!result) {\n return;\n }\n\n onUpdate({\n '@type': 'deleteHistory',\n chatId: chat.id,\n });\n}\n\nexport async function reportMessages({\n peer, messageIds, reason, description,\n}: {\n peer: ApiChat | ApiUser; messageIds: number[]; reason: ApiReportReason; description?: string;\n}) {\n const result = await invokeRequest(new GramJs.messages.Report({\n peer: buildInputPeer(peer.id, peer.accessHash),\n id: messageIds,\n reason: buildInputReportReason(reason),\n message: description,\n }));\n\n return result;\n}\n\nexport async function markMessageListRead({\n chat, threadId, maxId, serverTimeOffset,\n}: {\n chat: ApiChat; threadId: number; maxId?: number; serverTimeOffset: number;\n}) {\n const isChannel = getEntityTypeById(chat.id) === 'channel';\n\n if (isChannel && threadId === MAIN_THREAD_ID) {\n await invokeRequest(new GramJs.channels.ReadHistory({\n channel: buildInputEntity(chat.id, chat.accessHash) as GramJs.InputChannel,\n maxId,\n }));\n } else if (isChannel) {\n await invokeRequest(new GramJs.messages.ReadDiscussion({\n peer: buildInputPeer(chat.id, chat.accessHash),\n msgId: threadId,\n readMaxId: maxId,\n }));\n } else {\n await invokeRequest(new GramJs.messages.ReadHistory({\n peer: buildInputPeer(chat.id, chat.accessHash),\n maxId,\n }));\n }\n\n if (threadId === MAIN_THREAD_ID) {\n void requestChatUpdate({ chat, serverTimeOffset });\n } else {\n void requestThreadInfoUpdate({ chat, threadId });\n }\n}\n\nexport async function markMessagesRead({\n chat, messageIds,\n}: {\n chat: ApiChat; messageIds: number[];\n}) {\n const isChannel = getEntityTypeById(chat.id) === 'channel';\n\n await invokeRequest(\n isChannel\n ? new GramJs.channels.ReadMessageContents({\n channel: buildInputEntity(chat.id, chat.accessHash) as GramJs.InputChannel,\n id: messageIds,\n })\n : new GramJs.messages.ReadMessageContents({\n id: messageIds,\n }),\n );\n\n onUpdate({\n ...(isChannel ? {\n '@type': 'updateChannelMessages',\n channelId: chat.id,\n } : {\n '@type': 'updateCommonBoxMessages',\n }),\n ids: messageIds,\n messageUpdate: {\n hasUnreadMention: false,\n isMediaUnread: false,\n },\n });\n}\n\nexport async function requestThreadInfoUpdate({\n chat, threadId,\n}: {\n chat: ApiChat; threadId: number;\n}) {\n const [topMessageResult, repliesResult] = await Promise.all([\n invokeRequest(new GramJs.messages.GetDiscussionMessage({\n peer: buildInputPeer(chat.id, chat.accessHash),\n msgId: threadId,\n })),\n invokeRequest(new GramJs.messages.GetReplies({\n peer: buildInputPeer(chat.id, chat.accessHash),\n msgId: threadId,\n offsetId: 1,\n addOffset: -1,\n limit: 1,\n })),\n ]);\n\n if (!topMessageResult || !topMessageResult.messages.length) {\n return;\n }\n\n const discussionChatId = resolveMessageApiChatId(topMessageResult.messages[0]);\n if (!discussionChatId) {\n return;\n }\n\n onUpdate({\n '@type': 'updateThreadInfo',\n chatId: discussionChatId,\n threadId,\n threadInfo: {\n topMessageId: topMessageResult.messages[topMessageResult.messages.length - 1].id,\n lastReadInboxMessageId: topMessageResult.readInboxMaxId,\n messagesCount: (repliesResult instanceof GramJs.messages.ChannelMessages) ? repliesResult.count : undefined,\n },\n firstMessageId: repliesResult && 'messages' in repliesResult && repliesResult.messages.length\n ? repliesResult.messages[0].id\n : undefined,\n });\n\n const chats = topMessageResult.chats.map((c) => buildApiChatFromPreview(c)).filter(Boolean as any);\n chats.forEach((newChat) => {\n onUpdate({\n '@type': 'updateChat',\n id: newChat.id,\n chat: newChat,\n noTopChatsRequest: true,\n });\n });\n}\n\nexport async function searchMessagesLocal({\n chatOrUser, type, query, topMessageId, minDate, maxDate, ...pagination\n}: {\n chatOrUser: ApiChat | ApiUser;\n type?: ApiMessageSearchType | ApiGlobalMessageSearchType;\n query?: string;\n topMessageId?: number;\n offsetId?: number;\n addOffset?: number;\n limit: number;\n minDate?: number;\n maxDate?: number;\n}) {\n let filter;\n switch (type) {\n case 'media':\n filter = new GramJs.InputMessagesFilterPhotoVideo();\n break;\n case 'documents':\n filter = new GramJs.InputMessagesFilterDocument();\n break;\n case 'links':\n filter = new GramJs.InputMessagesFilterUrl();\n break;\n case 'audio':\n filter = new GramJs.InputMessagesFilterMusic();\n break;\n case 'voice':\n filter = new GramJs.InputMessagesFilterVoice();\n break;\n case 'profilePhoto':\n filter = new GramJs.InputMessagesFilterChatPhotos();\n break;\n case 'text':\n default: {\n filter = new GramJs.InputMessagesFilterEmpty();\n }\n }\n\n const result = await invokeRequest(new GramJs.messages.Search({\n peer: buildInputPeer(chatOrUser.id, chatOrUser.accessHash),\n filter,\n q: query || '',\n topMsgId: topMessageId,\n minDate,\n maxDate,\n ...pagination,\n }));\n\n if (\n !result\n || result instanceof GramJs.messages.MessagesNotModified\n || !result.messages\n ) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n const messages = result.messages.map(buildApiMessage).filter(Boolean as any);\n const users = result.users.map(buildApiUser).filter(Boolean as any);\n\n let totalCount = messages.length;\n let nextOffsetId: number | undefined;\n if (result instanceof GramJs.messages.MessagesSlice || result instanceof GramJs.messages.ChannelMessages) {\n totalCount = result.count;\n\n if (messages.length) {\n nextOffsetId = messages[messages.length - 1].id;\n }\n }\n\n return {\n messages,\n users,\n totalCount,\n nextOffsetId,\n };\n}\n\nexport async function searchMessagesGlobal({\n query, offsetRate = 0, limit, type = 'text', minDate, maxDate,\n}: {\n query: string;\n offsetRate?: number;\n limit: number;\n type?: ApiGlobalMessageSearchType;\n minDate?: number;\n maxDate?: number;\n}) {\n let filter;\n switch (type) {\n case 'media':\n filter = new GramJs.InputMessagesFilterPhotoVideo();\n break;\n case 'documents':\n filter = new GramJs.InputMessagesFilterDocument();\n break;\n case 'links':\n filter = new GramJs.InputMessagesFilterUrl();\n break;\n case 'audio':\n filter = new GramJs.InputMessagesFilterMusic();\n break;\n case 'voice':\n filter = new GramJs.InputMessagesFilterVoice();\n break;\n case 'text':\n default: {\n if (!query && !(maxDate && minDate)) {\n return undefined;\n }\n\n filter = new GramJs.InputMessagesFilterEmpty();\n }\n }\n\n const result = await invokeRequest(new GramJs.messages.SearchGlobal({\n q: query,\n offsetRate,\n offsetPeer: new GramJs.InputPeerEmpty(),\n limit,\n filter,\n folderId: ALL_FOLDER_ID,\n minDate,\n maxDate,\n }));\n\n if (\n !result\n || result instanceof GramJs.messages.MessagesNotModified\n || !result.messages\n ) {\n return undefined;\n }\n\n updateLocalDb({\n chats: result.chats,\n users: result.users,\n messages: result.messages,\n } as GramJs.messages.Messages);\n\n const chats = result.chats.map((user) => buildApiChatFromPreview(user)).filter(Boolean as any);\n const users = result.users.map(buildApiUser).filter(Boolean as any);\n const messages = result.messages.map(buildApiMessage).filter(Boolean as any);\n\n let totalCount = messages.length;\n let nextRate: number | undefined;\n if (result instanceof GramJs.messages.MessagesSlice || result instanceof GramJs.messages.ChannelMessages) {\n totalCount = result.count;\n\n if (messages.length) {\n nextRate = messages[messages.length - 1].id;\n }\n }\n\n return {\n messages,\n users,\n chats,\n totalCount,\n nextRate: 'nextRate' in result && result.nextRate ? result.nextRate : nextRate,\n };\n}\n\nexport async function fetchWebPagePreview({ message }: { message: string }) {\n const preview = await invokeRequest(new GramJs.messages.GetWebPagePreview({\n message,\n }));\n\n return preview && buildWebPage(preview);\n}\n\nexport async function sendPollVote({\n chat, messageId, options,\n}: {\n chat: ApiChat;\n messageId: number;\n options: string[];\n}) {\n const { id, accessHash } = chat;\n\n await invokeRequest(new GramJs.messages.SendVote({\n peer: buildInputPeer(id, accessHash),\n msgId: messageId,\n options: options.map((option) => Buffer.from(option)),\n }), true);\n}\n\nexport async function loadPollOptionResults({\n chat, messageId, option, offset, limit, shouldResetVoters,\n}: {\n chat: ApiChat;\n messageId: number;\n option?: string;\n offset?: string;\n limit?: number;\n shouldResetVoters?: boolean;\n}) {\n const { id, accessHash } = chat;\n\n const result = await invokeRequest(new GramJs.messages.GetPollVotes({\n peer: buildInputPeer(id, accessHash),\n id: messageId,\n ...(option && { option: Buffer.from(option) }),\n ...(offset && { offset }),\n ...(limit && { limit }),\n }));\n\n if (!result) {\n return undefined;\n }\n\n updateLocalDb({\n chats: [] as GramJs.TypeChat[],\n users: result.users,\n messages: [] as GramJs.Message[],\n } as GramJs.messages.Messages);\n\n const users = result.users.map(buildApiUser).filter(Boolean as any);\n const votes = result.votes.map((vote) => ({\n userId: vote.userId,\n date: vote.date,\n }));\n\n return {\n count: result.count,\n votes,\n users,\n nextOffset: result.nextOffset,\n shouldResetVoters,\n };\n}\n\nexport async function forwardMessages({\n fromChat,\n toChat,\n messages,\n serverTimeOffset,\n}: {\n fromChat: ApiChat;\n toChat: ApiChat;\n messages: ApiMessage[];\n serverTimeOffset: number;\n}) {\n const messageIds = messages.map(({ id }) => id);\n const randomIds = messages.map(generateRandomBigInt);\n\n messages.forEach((message, index) => {\n const localMessage = buildForwardedMessage(toChat, message, serverTimeOffset);\n localDb.localMessages[String(randomIds[index])] = localMessage;\n\n onUpdate({\n '@type': 'newMessage',\n id: localMessage.id,\n chatId: toChat.id,\n message: localMessage,\n });\n });\n\n await invokeRequest(new GramJs.messages.ForwardMessages({\n fromPeer: buildInputPeer(fromChat.id, fromChat.accessHash),\n toPeer: buildInputPeer(toChat.id, toChat.accessHash),\n randomId: randomIds,\n id: messageIds,\n }), true);\n}\n\nexport async function findFirstMessageIdAfterDate({\n chat,\n timestamp,\n}: {\n chat: ApiChat;\n timestamp: number;\n}) {\n const result = await invokeRequest(new GramJs.messages.GetHistory({\n peer: buildInputPeer(chat.id, chat.accessHash),\n offsetDate: timestamp,\n addOffset: -1,\n limit: 1,\n }));\n\n if (\n !result\n || result instanceof GramJs.messages.MessagesNotModified\n || !result.messages || !result.messages.length\n ) {\n return undefined;\n }\n\n return result.messages[0].id;\n}\n\nexport async function fetchScheduledHistory({ chat, hash = 0 }: { chat: ApiChat; hash?: number }) {\n const { id, accessHash } = chat;\n\n const result = await invokeRequest(new GramJs.messages.GetScheduledHistory({\n peer: buildInputPeer(id, accessHash),\n hash,\n }));\n\n if (\n !result\n || result instanceof GramJs.messages.MessagesNotModified\n || !result.messages\n ) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n const messages = result.messages.map(buildApiMessage).filter(Boolean as any);\n\n return {\n messages,\n hash: calculateResultHash(messages.map((message) => message.id)),\n };\n}\n\nexport async function sendScheduledMessages({ chat, ids }: { chat: ApiChat; ids: number[] }) {\n const { id, accessHash } = chat;\n\n await invokeRequest(new GramJs.messages.SendScheduledMessages({\n peer: buildInputPeer(id, accessHash),\n id: ids,\n }), true);\n}\n\nfunction updateLocalDb(result: (\n GramJs.messages.MessagesSlice | GramJs.messages.Messages | GramJs.messages.ChannelMessages |\n GramJs.messages.DiscussionMessage\n)) {\n result.users.forEach((user) => {\n if (user instanceof GramJs.User) {\n localDb.users[user.id] = user;\n }\n });\n\n result.chats.forEach((chat) => {\n if (chat instanceof GramJs.Chat || chat instanceof GramJs.Channel) {\n localDb.chats[chat.id] = chat;\n }\n });\n\n result.messages.forEach((message) => {\n if ((message instanceof GramJs.Message && isMessageWithMedia(message))\n || (message instanceof GramJs.MessageService && isServiceMessageWithMedia(message))\n ) {\n addMessageToLocalDb(message);\n }\n });\n}\n\nexport async function fetchPinnedMessages({ chat }: { chat: ApiChat }) {\n const result = await invokeRequest(new GramJs.messages.Search(\n {\n peer: buildInputPeer(chat.id, chat.accessHash),\n filter: new GramJs.InputMessagesFilterPinned(),\n q: '',\n limit: PINNED_MESSAGES_LIMIT,\n },\n ));\n\n if (\n !result\n || result instanceof GramJs.messages.MessagesNotModified\n || !result.messages\n ) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n const messages = result.messages.map(buildApiMessage).filter(Boolean as any);\n const users = result.users.map(buildApiUser).filter(Boolean as any);\n const chats = result.chats.map((c) => buildApiChatFromPreview(c)).filter(Boolean as any);\n\n return {\n messages,\n users,\n chats,\n };\n}\n","import BigInt from 'big-integer';\nimport { Api as GramJs } from '../../../lib/gramjs';\nimport {\n OnApiUpdate, ApiUser, ApiChat, ApiPhoto,\n} from '../../types';\n\nimport { PROFILE_PHOTOS_LIMIT } from '../../../config';\nimport { invokeRequest } from './client';\nimport { searchMessagesLocal } from './messages';\nimport {\n buildInputEntity,\n calculateResultHash,\n buildInputPeer,\n buildInputContact,\n} from '../gramjsBuilders';\nimport { buildApiUser, buildApiUserFromFull } from '../apiBuilders/users';\nimport { buildApiChatFromPreview } from '../apiBuilders/chats';\nimport { buildApiPhoto } from '../apiBuilders/common';\nimport localDb from '../localDb';\nimport { addPhotoToLocalDb } from '../helpers';\n\nlet onUpdate: OnApiUpdate;\n\nexport function init(_onUpdate: OnApiUpdate) {\n onUpdate = _onUpdate;\n}\n\nexport async function fetchFullUser({\n id,\n accessHash,\n}: {\n id: number;\n accessHash?: string;\n}) {\n const input = buildInputEntity(id, accessHash);\n if (!(input instanceof GramJs.InputUser)) {\n return;\n }\n\n const fullInfo = await invokeRequest(new GramJs.users.GetFullUser({ id: input }));\n\n if (!fullInfo) {\n return;\n }\n\n const userWithFullInfo = buildApiUserFromFull(fullInfo);\n\n onUpdate({\n '@type': 'updateUser',\n id,\n user: {\n fullInfo: userWithFullInfo.fullInfo,\n },\n });\n}\n\nexport async function fetchNearestCountry() {\n const dcInfo = await invokeRequest(new GramJs.help.GetNearestDc());\n\n return dcInfo?.country;\n}\n\nexport async function fetchTopUsers({ hash = 0 }: { hash?: number }) {\n const topPeers = await invokeRequest(new GramJs.contacts.GetTopPeers({\n hash,\n correspondents: true,\n }));\n if (!(topPeers instanceof GramJs.contacts.TopPeers)) {\n return undefined;\n }\n\n const users = topPeers.users.map(buildApiUser).filter((user) => !!user && !user.isSelf) as ApiUser[];\n const ids = users.map(({ id }) => id);\n\n return {\n hash: calculateResultHash(ids),\n ids,\n users,\n };\n}\n\nexport async function fetchContactList({ hash = 0 }: { hash?: number }) {\n const result = await invokeRequest(new GramJs.contacts.GetContacts({ hash }));\n if (!result || result instanceof GramJs.contacts.ContactsNotModified) {\n return undefined;\n }\n\n result.users.forEach((user) => {\n if (user instanceof GramJs.User) {\n localDb.users[user.id] = user;\n }\n });\n\n return {\n hash: calculateResultHash([\n result.savedCount,\n ...result.contacts.map(({ userId }) => userId),\n ]),\n users: result.users.map(buildApiUser).filter(Boolean as any),\n chats: result.users.map((user) => buildApiChatFromPreview(user)).filter(Boolean as any),\n };\n}\n\nexport async function fetchUsers({ users }: { users: ApiUser[] }) {\n const result = await invokeRequest(new GramJs.users.GetUsers({\n id: users.map(({ id, accessHash }) => buildInputPeer(id, accessHash)),\n }));\n if (!result || !result.length) {\n return undefined;\n }\n\n result.forEach((user) => {\n if (user instanceof GramJs.User) {\n localDb.users[user.id] = user;\n }\n });\n\n return result.map(buildApiUser).filter(Boolean as any);\n}\n\nexport function updateContact({\n phone,\n firstName,\n lastName,\n}: {\n phone?: string;\n firstName?: string;\n lastName?: string;\n}) {\n return invokeRequest(new GramJs.contacts.ImportContacts({\n contacts: [buildInputContact({\n phone: phone || '',\n firstName: firstName || '',\n lastName: lastName || '',\n })],\n }));\n}\n\nexport async function deleteUser({\n id,\n accessHash,\n}: {\n id: number;\n accessHash?: string;\n}) {\n const input = buildInputEntity(id, accessHash);\n if (!(input instanceof GramJs.InputUser)) {\n return;\n }\n\n const result = await invokeRequest(new GramJs.contacts.DeleteContacts({ id: [input] }));\n\n if (!result) {\n return;\n }\n\n onUpdate({\n '@type': 'deleteUser',\n id,\n });\n}\n\nexport async function fetchProfilePhotos(user?: ApiUser, chat?: ApiChat) {\n if (user) {\n const { id, accessHash } = user;\n\n const result = await invokeRequest(new GramJs.photos.GetUserPhotos({\n userId: buildInputEntity(id, accessHash) as GramJs.InputUser,\n limit: PROFILE_PHOTOS_LIMIT,\n offset: 0,\n maxId: BigInt('0'),\n }));\n\n if (!result) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n return {\n photos: result.photos\n .filter((photo): photo is GramJs.Photo => photo instanceof GramJs.Photo)\n .map(buildApiPhoto),\n };\n }\n\n const result = await searchMessagesLocal({\n chatOrUser: chat!,\n type: 'profilePhoto',\n limit: PROFILE_PHOTOS_LIMIT,\n });\n\n if (!result) {\n return undefined;\n }\n\n const { messages, users } = result;\n\n return {\n photos: messages.map((message) => message.content.action!.photo).filter(Boolean as any),\n users,\n };\n}\n\nfunction updateLocalDb(result: (GramJs.photos.Photos | GramJs.photos.PhotosSlice)) {\n result.photos.forEach(addPhotoToLocalDb);\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\nimport { ApiSticker, ApiVideo, OnApiUpdate } from '../../types';\n\nimport { invokeRequest } from './client';\nimport { buildStickerFromDocument, buildStickerSet, buildStickerSetCovered } from '../apiBuilders/symbols';\nimport { buildInputStickerSet, buildInputDocument, buildInputStickerSetShortName } from '../gramjsBuilders';\nimport { buildVideoFromDocument } from '../apiBuilders/messages';\nimport { RECENT_STICKERS_LIMIT } from '../../../config';\n\nimport localDb from '../localDb';\n\nlet onUpdate: OnApiUpdate;\n\nexport function init(_onUpdate: OnApiUpdate) {\n onUpdate = _onUpdate;\n}\n\nexport async function fetchStickerSets({ hash }: { hash: number }) {\n const allStickers = await invokeRequest(new GramJs.messages.GetAllStickers({ hash }));\n\n if (!allStickers || allStickers instanceof GramJs.messages.AllStickersNotModified) {\n return undefined;\n }\n\n allStickers.sets.forEach((stickerSet) => {\n if (stickerSet.thumbs?.length) {\n localDb.stickerSets[String(stickerSet.id)] = stickerSet;\n }\n });\n\n return {\n hash: allStickers.hash,\n sets: allStickers.sets.map(buildStickerSet),\n };\n}\n\nexport async function fetchRecentStickers({ hash }: { hash: number }) {\n const result = await invokeRequest(new GramJs.messages.GetRecentStickers({ hash }));\n\n if (!result || result instanceof GramJs.messages.RecentStickersNotModified) {\n return undefined;\n }\n\n return {\n hash: result.hash,\n stickers: processStickerResult(result.stickers.slice(0, RECENT_STICKERS_LIMIT)),\n };\n}\n\nexport async function fetchFavoriteStickers({ hash }: { hash: number }) {\n const result = await invokeRequest(new GramJs.messages.GetFavedStickers({ hash }));\n\n if (!result || result instanceof GramJs.messages.FavedStickersNotModified) {\n return undefined;\n }\n\n return {\n hash: result.hash,\n stickers: processStickerResult(result.stickers),\n };\n}\n\nexport async function fetchFeaturedStickers({ hash }: { hash: number }) {\n const result = await invokeRequest(new GramJs.messages.GetFeaturedStickers({ hash }));\n\n if (!result || result instanceof GramJs.messages.FeaturedStickersNotModified) {\n return undefined;\n }\n\n return {\n hash: result.hash,\n sets: result.sets.map(buildStickerSetCovered),\n };\n}\n\nexport async function faveSticker({\n sticker,\n unfave,\n}: {\n sticker: ApiSticker;\n unfave?: boolean;\n}) {\n const request = new GramJs.messages.FaveSticker({\n id: buildInputDocument(sticker),\n unfave,\n });\n\n const result = await invokeRequest(request);\n if (result) {\n onUpdate({\n '@type': 'updateFavoriteStickers',\n });\n }\n}\n\nexport async function fetchStickers({ stickerSetShortName, stickerSetId, accessHash }:\n{ stickerSetShortName?: string; stickerSetId?: string; accessHash: string }) {\n const result = await invokeRequest(new GramJs.messages.GetStickerSet({\n stickerset: stickerSetId\n ? buildInputStickerSet(stickerSetId, accessHash)\n : buildInputStickerSetShortName(stickerSetShortName!),\n }));\n\n if (!result) {\n return undefined;\n }\n\n return {\n set: buildStickerSet(result.set),\n stickers: processStickerResult(result.documents),\n packs: processStickerPackResult(result.packs),\n };\n}\n\nexport async function fetchAnimatedEmojis() {\n const result = await invokeRequest(new GramJs.messages.GetStickerSet({\n stickerset: new GramJs.InputStickerSetAnimatedEmoji(),\n }));\n\n if (!result) {\n return undefined;\n }\n\n return {\n set: buildStickerSet(result.set),\n stickers: processStickerResult(result.documents),\n };\n}\n\nexport async function searchStickers({ query, hash }: { query: string; hash: number }) {\n const result = await invokeRequest(new GramJs.messages.SearchStickerSets({\n q: query,\n hash,\n }));\n\n if (!result || result instanceof GramJs.messages.FoundStickerSetsNotModified) {\n return undefined;\n }\n\n return {\n hash: result.hash,\n sets: result.sets.map(buildStickerSetCovered),\n };\n}\n\nexport async function fetchSavedGifs({ hash }: { hash: number }) {\n const result = await invokeRequest(new GramJs.messages.GetSavedGifs({ hash }));\n\n if (!result || result instanceof GramJs.messages.SavedGifsNotModified) {\n return undefined;\n }\n\n return {\n hash: result.hash,\n gifs: processGifResult(result.gifs),\n };\n}\n\nexport async function installStickerSet({ stickerSetId, accessHash }: { stickerSetId: string; accessHash: string }) {\n const result = await invokeRequest(new GramJs.messages.InstallStickerSet({\n stickerset: buildInputStickerSet(stickerSetId, accessHash),\n }));\n\n if (result) {\n onUpdate({\n '@type': 'updateStickerSet',\n id: stickerSetId,\n stickerSet: { installedDate: Date.now() },\n });\n }\n}\n\nexport async function uninstallStickerSet({ stickerSetId, accessHash }: { stickerSetId: string; accessHash: string }) {\n const result = await invokeRequest(new GramJs.messages.UninstallStickerSet({\n stickerset: buildInputStickerSet(stickerSetId, accessHash),\n }));\n\n if (result) {\n onUpdate({\n '@type': 'updateStickerSet',\n id: stickerSetId,\n stickerSet: { installedDate: undefined },\n });\n }\n}\n\nlet inputGifBot: GramJs.InputUser | undefined;\n\nexport async function searchGifs({ query, offset = '' }: { query: string; offset?: string }) {\n if (!inputGifBot) {\n const config = await invokeRequest(new GramJs.help.GetConfig());\n if (!config) {\n return undefined;\n }\n\n const resolvedPeer = await invokeRequest(new GramJs.contacts.ResolveUsername({\n username: config.gifSearchUsername,\n }));\n if (!resolvedPeer || !(resolvedPeer.users[0] instanceof GramJs.User)) {\n return undefined;\n }\n\n inputGifBot = new GramJs.InputUser({\n userId: (resolvedPeer.peer as GramJs.PeerUser).userId,\n accessHash: resolvedPeer.users[0].accessHash!,\n });\n }\n\n const result = await invokeRequest(new GramJs.messages.GetInlineBotResults({\n bot: inputGifBot,\n peer: new GramJs.InputPeerEmpty(),\n query,\n offset,\n }));\n if (!result) {\n return undefined;\n }\n\n const documents = result.results\n .map((foundGif) => {\n if (foundGif instanceof GramJs.BotInlineMediaResult) {\n return foundGif.document;\n }\n\n return undefined;\n })\n .filter(Boolean as any);\n\n return {\n nextOffset: result.nextOffset,\n gifs: processGifResult(documents),\n };\n}\n\nexport async function fetchStickersForEmoji({\n emoji, hash = 0,\n}: { emoji: string; hash?: number }) {\n const result = await invokeRequest(new GramJs.messages.GetStickers({\n emoticon: emoji,\n hash,\n }));\n\n if (!result || result instanceof GramJs.messages.StickersNotModified) {\n return undefined;\n }\n\n return {\n stickers: processStickerResult(result.stickers),\n hash: result.hash,\n };\n}\n\nexport async function fetchEmojiKeywords({ language, fromVersion }: {\n language: string;\n fromVersion?: number;\n}) {\n const result = await invokeRequest(new GramJs.messages.GetEmojiKeywordsDifference({\n langCode: language,\n fromVersion,\n }));\n\n if (!result) {\n return undefined;\n }\n\n return {\n language: result.langCode,\n version: result.version,\n keywords: result.keywords.reduce((acc, emojiKeyword) => {\n acc[emojiKeyword.keyword] = emojiKeyword.emoticons;\n\n return acc;\n }, {} as Record),\n };\n}\n\nfunction processStickerResult(stickers: GramJs.TypeDocument[]) {\n return stickers\n .map((document) => {\n if (document instanceof GramJs.Document) {\n const sticker = buildStickerFromDocument(document);\n if (sticker) {\n localDb.documents[String(document.id)] = document;\n\n return sticker;\n }\n }\n\n return undefined;\n })\n .filter(Boolean as any);\n}\n\nfunction processStickerPackResult(packs: GramJs.StickerPack[]) {\n return packs.reduce((acc, { emoticon, documents }) => {\n acc[emoticon] = documents.map((documentId) => buildStickerFromDocument(\n localDb.documents[String(documentId)],\n )).filter(Boolean as any);\n return acc;\n }, {} as Record);\n}\n\nfunction processGifResult(gifs: GramJs.TypeDocument[]) {\n return gifs\n .map((document) => {\n if (document instanceof GramJs.Document) {\n const gif = buildVideoFromDocument(document);\n if (gif) {\n localDb.documents[String(document.id)] = document;\n\n return gif;\n }\n }\n\n return undefined;\n })\n .filter(Boolean as any);\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\n\nimport { invokeRequest } from './client';\nimport { buildInputEntity, buildInputPeer } from '../gramjsBuilders';\nimport { ApiChat, OnApiUpdate } from '../../types';\n\nlet onUpdate: OnApiUpdate;\n\nexport function init(_onUpdate: OnApiUpdate) {\n onUpdate = _onUpdate;\n}\n\nexport async function checkChatUsername(\n { username }: { username: string },\n) {\n try {\n const result = await invokeRequest(new GramJs.channels.CheckUsername({\n channel: new GramJs.InputChannelEmpty(),\n username,\n }), undefined, true);\n\n return result!;\n } catch (err) {\n return false;\n }\n}\n\nexport async function setChatUsername(\n { chat, username }: { chat: ApiChat; username: string },\n) {\n const result = await invokeRequest(new GramJs.channels.UpdateUsername({\n channel: buildInputEntity(chat.id, chat.accessHash) as GramJs.InputChannel,\n username,\n }));\n\n if (result) {\n onUpdate({\n '@type': 'updateChat',\n id: chat.id,\n chat: { username },\n });\n }\n}\n\nexport async function updatePrivateLink(\n { chat }: { chat: ApiChat },\n) {\n const result = await invokeRequest(new GramJs.messages.ExportChatInvite({\n peer: buildInputPeer(chat.id, chat.accessHash),\n }));\n\n if (!result || !(result instanceof GramJs.ChatInviteExported)) {\n return;\n }\n\n onUpdate({\n '@type': 'updateChatFullInfo',\n id: chat.id,\n fullInfo: {\n inviteLink: result.link,\n },\n });\n}\n","import { Api as GramJs, errors } from '../../../lib/gramjs';\n\nimport { OnApiUpdate } from '../../types';\n\nimport { DEBUG } from '../../../config';\nimport { invokeRequest, updateTwoFaSettings } from './client';\n\nconst ApiErrors: { [k: string]: string } = {\n EMAIL_UNCONFIRMED: 'Email unconfirmed',\n EMAIL_HASH_EXPIRED: 'Email hash expired',\n NEW_SALT_INVALID: 'The new salt is invalid',\n NEW_SETTINGS_INVALID: 'The new password settings are invalid',\n CODE_INVALID: 'Invalid Code',\n PASSWORD_HASH_INVALID: 'Invalid Password',\n};\n\nconst emailCodeController: {\n resolve?: Function;\n reject?: Function;\n} = {};\n\nlet onUpdate: OnApiUpdate;\n\nexport function init(_onUpdate: OnApiUpdate) {\n onUpdate = _onUpdate;\n}\n\nexport async function getPasswordInfo() {\n const result = await invokeRequest(new GramJs.account.GetPassword());\n if (!result) {\n return undefined;\n }\n\n const { hint, hasPassword } = result;\n\n return { hint, hasPassword };\n}\n\nfunction onRequestEmailCode(length: number) {\n onUpdate({\n '@type': 'updateTwoFaStateWaitCode',\n length,\n });\n\n return new Promise((resolve, reject) => {\n emailCodeController.resolve = resolve;\n emailCodeController.reject = reject;\n });\n}\n\nexport async function checkPassword(currentPassword: string) {\n try {\n await updateTwoFaSettings({ isCheckPassword: true, currentPassword });\n\n return true;\n } catch (err) {\n onError(err);\n\n return false;\n }\n}\n\nexport async function clearPassword(currentPassword: string) {\n try {\n await updateTwoFaSettings({ currentPassword });\n\n return true;\n } catch (err) {\n onError(err);\n\n return false;\n }\n}\n\nexport async function updatePassword(currentPassword: string, password: string, hint?: string, email?: string) {\n try {\n await updateTwoFaSettings({\n currentPassword,\n newPassword: password,\n hint,\n email,\n emailCodeCallback: onRequestEmailCode,\n onEmailCodeError: onError,\n });\n\n return true;\n } catch (err) {\n onError(err);\n\n return false;\n }\n}\n\nexport async function updateRecoveryEmail(currentPassword: string, email: string) {\n try {\n await updateTwoFaSettings({\n currentPassword,\n newPassword: currentPassword,\n email,\n emailCodeCallback: onRequestEmailCode,\n onEmailCodeError: onError,\n });\n\n return true;\n } catch (err) {\n onError(err);\n\n return false;\n }\n}\n\nexport function provideRecoveryEmailCode(code: string) {\n emailCodeController.resolve!(code);\n}\n\nfunction onError(err: Error) {\n let message: string;\n\n if (err instanceof errors.FloodWaitError) {\n const hours = Math.ceil(Number(err.seconds) / 60 / 60);\n message = `Too many attempts. Try again in ${hours > 1 ? `${hours} hours` : 'an hour'}`;\n } else {\n message = ApiErrors[err.message];\n }\n\n if (!message) {\n message = 'Unexpected Error';\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n }\n\n onUpdate({\n '@type': 'updateTwoFaError',\n message,\n });\n}\n","import BigInt from 'big-integer';\nimport { Api as GramJs } from '../../../lib/gramjs';\n\nimport {\n ApiChat, ApiLangString, ApiLanguage, ApiNotifyException, ApiUser, ApiWallpaper,\n} from '../../types';\nimport { ApiPrivacyKey, IInputPrivacyRules } from '../../../types';\n\nimport { BLOCKED_LIST_LIMIT, DEFAULT_LANG_PACK, LANG_PACKS } from '../../../config';\nimport {\n buildApiWallpaper, buildApiSession, buildPrivacyRules, buildApiNotifyException,\n} from '../apiBuilders/misc';\n\nimport { buildApiUser } from '../apiBuilders/users';\nimport { buildApiChatFromPreview, getApiChatIdFromMtpPeer } from '../apiBuilders/chats';\nimport { buildInputPrivacyKey, buildInputPeer } from '../gramjsBuilders';\nimport { invokeRequest, uploadFile, getClient } from './client';\nimport { omitVirtualClassFields } from '../apiBuilders/helpers';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport localDb from '../localDb';\nimport { getServerTime } from '../../../util/serverTime';\n\nconst MAX_INT_32 = 2 ** 31 - 1;\nconst BETA_LANG_CODES = ['ar', 'fa', 'id', 'ko', 'uz'];\n\nexport function updateProfile({\n firstName,\n lastName,\n about,\n}: {\n firstName?: string;\n lastName?: string;\n about?: string;\n}) {\n return invokeRequest(new GramJs.account.UpdateProfile({\n firstName: firstName || '',\n lastName: lastName || '',\n about: about || '',\n }));\n}\n\nexport function checkUsername(username: string) {\n return invokeRequest(new GramJs.account.CheckUsername({ username }));\n}\n\nexport function updateUsername(username: string) {\n return invokeRequest(new GramJs.account.UpdateUsername({ username }));\n}\n\nexport async function updateProfilePhoto(file: File) {\n const inputFile = await uploadFile(file);\n return invokeRequest(new GramJs.photos.UploadProfilePhoto({\n file: inputFile,\n }));\n}\n\nexport async function uploadProfilePhoto(file: File) {\n const inputFile = await uploadFile(file);\n await invokeRequest(new GramJs.photos.UploadProfilePhoto({\n file: inputFile,\n }));\n}\n\nexport async function fetchWallpapers(hash: number) {\n const result = await invokeRequest(new GramJs.account.GetWallPapers({ hash }));\n\n if (!result || result instanceof GramJs.account.WallPapersNotModified) {\n return undefined;\n }\n\n const filteredWallpapers = result.wallpapers.filter((wallpaper) => {\n if (\n !(wallpaper instanceof GramJs.WallPaper)\n || !(wallpaper.document instanceof GramJs.Document)\n ) {\n return false;\n }\n\n return !wallpaper.pattern && wallpaper.document.mimeType !== 'application/x-tgwallpattern';\n }) as GramJs.WallPaper[];\n\n filteredWallpapers.forEach((wallpaper) => {\n localDb.documents[String(wallpaper.document.id)] = wallpaper.document as GramJs.Document;\n });\n\n return {\n hash: result.hash,\n wallpapers: filteredWallpapers.map(buildApiWallpaper).filter(Boolean as any),\n };\n}\n\nexport async function uploadWallpaper(file: File) {\n const inputFile = await uploadFile(file);\n\n const result = await invokeRequest(new GramJs.account.UploadWallPaper({\n file: inputFile,\n mimeType: file.type,\n settings: new GramJs.WallPaperSettings(),\n }));\n\n if (!result || !(result instanceof GramJs.WallPaper)) {\n return undefined;\n }\n\n const wallpaper = buildApiWallpaper(result);\n if (!wallpaper) {\n return undefined;\n }\n\n localDb.documents[String(result.document.id)] = result.document as GramJs.Document;\n\n return { wallpaper };\n}\n\nexport async function fetchBlockedContacts() {\n const result = await invokeRequest(new GramJs.contacts.GetBlocked({\n limit: BLOCKED_LIST_LIMIT,\n }));\n if (!result) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n return {\n users: result.users.map(buildApiUser).filter(Boolean as any),\n chats: result.chats.map((chat) => buildApiChatFromPreview(chat, undefined, true)).filter(Boolean as any),\n blockedIds: result.blocked.map((blocked) => getApiChatIdFromMtpPeer(blocked.peerId)),\n totalCount: result instanceof GramJs.contacts.BlockedSlice ? result.count : result.blocked.length,\n };\n}\n\nexport function blockContact(chatOrUserId: number, accessHash?: string) {\n return invokeRequest(new GramJs.contacts.Block({\n id: buildInputPeer(chatOrUserId, accessHash),\n }));\n}\n\nexport function unblockContact(chatOrUserId: number, accessHash?: string) {\n return invokeRequest(new GramJs.contacts.Unblock({\n id: buildInputPeer(chatOrUserId, accessHash),\n }));\n}\n\nexport async function fetchAuthorizations() {\n const result = await invokeRequest(new GramJs.account.GetAuthorizations());\n if (!result) {\n return undefined;\n }\n\n return result.authorizations.map(buildApiSession);\n}\n\nexport function terminateAuthorization(hash: string) {\n return invokeRequest(new GramJs.account.ResetAuthorization({ hash: BigInt(hash) }));\n}\n\nexport function terminateAllAuthorizations() {\n return invokeRequest(new GramJs.auth.ResetAuthorizations());\n}\n\nexport async function fetchNotificationExceptions({\n serverTimeOffset,\n}: { serverTimeOffset: number }) {\n const result = await invokeRequest(new GramJs.account.GetNotifyExceptions({ compareSound: true }));\n\n if (!(result instanceof GramJs.Updates || result instanceof GramJs.UpdatesCombined)) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n return result.updates.reduce((acc, update) => {\n if (!(update instanceof GramJs.UpdateNotifySettings && update.peer instanceof GramJs.NotifyPeer)) {\n return acc;\n }\n\n acc.push(buildApiNotifyException(update.notifySettings, update.peer.peer, serverTimeOffset));\n\n return acc;\n }, [] as ApiNotifyException[]);\n}\n\nexport async function fetchNotificationSettings({\n serverTimeOffset,\n}: { serverTimeOffset: number }) {\n const [\n isMutedContactSignUpNotification,\n privateContactNotificationsSettings,\n groupNotificationsSettings,\n broadcastNotificationsSettings,\n ] = await Promise.all([\n invokeRequest(new GramJs.account.GetContactSignUpNotification()),\n invokeRequest(new GramJs.account.GetNotifySettings({\n peer: new GramJs.InputNotifyUsers(),\n })),\n invokeRequest(new GramJs.account.GetNotifySettings({\n peer: new GramJs.InputNotifyChats(),\n })),\n invokeRequest(new GramJs.account.GetNotifySettings({\n peer: new GramJs.InputNotifyBroadcasts(),\n })),\n ]);\n\n if (!privateContactNotificationsSettings || !groupNotificationsSettings || !broadcastNotificationsSettings) {\n return false;\n }\n\n const {\n silent: privateSilent, muteUntil: privateMuteUntil, showPreviews: privateShowPreviews,\n } = privateContactNotificationsSettings;\n const {\n silent: groupSilent, muteUntil: groupMuteUntil, showPreviews: groupShowPreviews,\n } = groupNotificationsSettings;\n const {\n silent: broadcastSilent, muteUntil: broadcastMuteUntil, showPreviews: broadcastShowPreviews,\n } = broadcastNotificationsSettings;\n\n return {\n hasContactJoinedNotifications: !isMutedContactSignUpNotification,\n hasPrivateChatsNotifications: !(\n privateSilent\n || (typeof privateMuteUntil === 'number' && getServerTime(serverTimeOffset) < privateMuteUntil)\n ),\n hasPrivateChatsMessagePreview: privateShowPreviews,\n hasGroupNotifications: !(\n groupSilent || (typeof groupMuteUntil === 'number'\n && getServerTime(serverTimeOffset) < groupMuteUntil)\n ),\n hasGroupMessagePreview: groupShowPreviews,\n hasBroadcastNotifications: !(\n broadcastSilent || (typeof broadcastMuteUntil === 'number'\n && getServerTime(serverTimeOffset) < broadcastMuteUntil)\n ),\n hasBroadcastMessagePreview: broadcastShowPreviews,\n };\n}\n\nexport function updateContactSignUpNotification(isSilent: boolean) {\n return invokeRequest(new GramJs.account.SetContactSignUpNotification({ silent: isSilent }));\n}\n\nexport function updateNotificationSettings(peerType: 'contact' | 'group' | 'broadcast', {\n isSilent,\n shouldShowPreviews,\n}: {\n isSilent: boolean;\n shouldShowPreviews: boolean;\n}) {\n let peer: GramJs.TypeInputNotifyPeer;\n if (peerType === 'contact') {\n peer = new GramJs.InputNotifyUsers();\n } else if (peerType === 'group') {\n peer = new GramJs.InputNotifyChats();\n } else {\n peer = new GramJs.InputNotifyBroadcasts();\n }\n\n const settings = {\n showPreviews: shouldShowPreviews,\n silent: isSilent,\n muteUntil: isSilent ? MAX_INT_32 : 0,\n };\n\n return invokeRequest(new GramJs.account.UpdateNotifySettings({\n peer,\n settings: new GramJs.InputPeerNotifySettings(settings),\n }));\n}\n\nexport async function fetchLanguages(): Promise {\n const result = await invokeRequest(new GramJs.langpack.GetLanguages({\n langPack: DEFAULT_LANG_PACK,\n }));\n if (!result) {\n return undefined;\n }\n\n return result.map(omitVirtualClassFields);\n}\n\nexport async function fetchLangPack({ sourceLangPacks, langCode }: {\n sourceLangPacks: typeof LANG_PACKS;\n langCode: string;\n}) {\n const results = await Promise.all(sourceLangPacks.map((langPack) => {\n return invokeRequest(new GramJs.langpack.GetLangPack({\n langPack,\n langCode: BETA_LANG_CODES.includes(langCode) ? `${langCode}-raw` : langCode,\n }));\n }));\n\n const collections = results\n .filter(Boolean as any)\n .map((result) => {\n return buildCollectionByKey(result.strings.map(omitVirtualClassFields), 'key');\n });\n\n if (!collections.length) {\n return undefined;\n }\n\n return { langPack: Object.assign({}, ...collections.reverse()) };\n}\n\nexport async function fetchLangStrings({ langPack, langCode, keys }: {\n langPack: string; langCode: string; keys: string[];\n}) {\n const result = await invokeRequest(new GramJs.langpack.GetStrings({\n langPack,\n langCode: BETA_LANG_CODES.includes(langCode) ? `${langCode}-raw` : langCode,\n keys,\n }));\n\n if (!result) {\n return undefined;\n }\n\n return result.map(omitVirtualClassFields);\n}\n\nexport async function fetchPrivacySettings(privacyKey: ApiPrivacyKey) {\n const key = buildInputPrivacyKey(privacyKey);\n const result = await invokeRequest(new GramJs.account.GetPrivacy({ key }));\n\n if (!result) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n return buildPrivacyRules(result.rules);\n}\n\nexport function registerDevice(token: string) {\n const client = getClient();\n const secret = client.session.getAuthKey().getKey();\n return invokeRequest(new GramJs.account.RegisterDevice({\n tokenType: 10,\n secret,\n appSandbox: false,\n otherUids: [],\n token,\n }));\n}\n\nexport function unregisterDevice(token: string) {\n return invokeRequest(new GramJs.account.UnregisterDevice({\n tokenType: 10,\n otherUids: [],\n token,\n }));\n}\n\nexport async function setPrivacySettings(\n privacyKey: ApiPrivacyKey, rules: IInputPrivacyRules,\n) {\n const key = buildInputPrivacyKey(privacyKey);\n const privacyRules: GramJs.TypeInputPrivacyRule[] = [];\n\n if (rules.allowedUsers) {\n privacyRules.push(new GramJs.InputPrivacyValueAllowUsers({\n users: rules.allowedUsers.map(({ id, accessHash }) => buildInputPeer(id, accessHash)),\n }));\n }\n if (rules.allowedChats) {\n privacyRules.push(new GramJs.InputPrivacyValueAllowChatParticipants({\n chats: rules.allowedChats.map(({ id }) => -id),\n }));\n }\n if (rules.blockedUsers) {\n privacyRules.push(new GramJs.InputPrivacyValueDisallowUsers({\n users: rules.blockedUsers.map(({ id, accessHash }) => buildInputPeer(id, accessHash)),\n }));\n }\n if (rules.blockedChats) {\n privacyRules.push(new GramJs.InputPrivacyValueDisallowChatParticipants({\n chats: rules.blockedChats.map(({ id }) => -id),\n }));\n }\n switch (rules.visibility) {\n case 'everybody':\n privacyRules.push(new GramJs.InputPrivacyValueAllowAll());\n break;\n\n case 'contacts':\n privacyRules.push(new GramJs.InputPrivacyValueAllowContacts());\n break;\n\n case 'nonContacts':\n privacyRules.push(new GramJs.InputPrivacyValueDisallowContacts());\n break;\n\n case 'nobody':\n privacyRules.push(new GramJs.InputPrivacyValueDisallowAll());\n break;\n }\n\n const result = await invokeRequest(new GramJs.account.SetPrivacy({ key, rules: privacyRules }));\n\n if (!result) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n return buildPrivacyRules(result.rules);\n}\n\nexport async function updateIsOnline(isOnline: boolean) {\n await invokeRequest(new GramJs.account.UpdateStatus({ offline: !isOnline }));\n}\n\nexport async function fetchContentSettings() {\n const result = await invokeRequest(new GramJs.account.GetContentSettings());\n if (!result) {\n return undefined;\n }\n\n return {\n isSensitiveEnabled: Boolean(result.sensitiveEnabled),\n canChangeSensitive: Boolean(result.sensitiveCanChange),\n };\n}\n\nexport function updateContentSettings(isEnabled: boolean) {\n return invokeRequest(new GramJs.account.SetContentSettings({\n sensitiveEnabled: isEnabled || undefined,\n }));\n}\n\nfunction updateLocalDb(\n result: (\n GramJs.account.PrivacyRules | GramJs.contacts.Blocked | GramJs.contacts.BlockedSlice |\n GramJs.Updates | GramJs.UpdatesCombined\n ),\n) {\n result.users.forEach((user) => {\n if (user instanceof GramJs.User) {\n localDb.users[user.id] = user;\n }\n });\n\n result.chats.forEach((chat) => {\n if (chat instanceof GramJs.Chat || chat instanceof GramJs.Channel) {\n localDb.chats[chat.id] = chat;\n }\n });\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\nimport {\n ApiBotInlineMediaResult, ApiBotInlineResult, ApiBotInlineSwitchPm, ApiInlineResultType, ApiWebDocument,\n} from '../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport { buildApiPhoto, buildApiThumbnailFromStripped } from './common';\nimport { buildVideoFromDocument } from './messages';\nimport { buildStickerFromDocument } from './symbols';\n\nexport function buildApiBotInlineResult(result: GramJs.BotInlineResult, queryId: string): ApiBotInlineResult {\n const {\n id, type, title, description, url, thumb,\n } = result;\n\n return {\n id,\n queryId,\n type: type as ApiInlineResultType,\n title,\n description,\n url,\n webThumbnail: buildApiWebDocument(thumb),\n };\n}\n\nexport function buildApiBotInlineMediaResult(\n result: GramJs.BotInlineMediaResult, queryId: string,\n): ApiBotInlineMediaResult {\n const {\n id, type, title, description, photo, document,\n } = result;\n\n return {\n id,\n queryId,\n type: type as ApiInlineResultType,\n title,\n description,\n ...(type === 'sticker' && document instanceof GramJs.Document && { sticker: buildStickerFromDocument(document) }),\n ...(photo instanceof GramJs.Photo && { photo: buildApiPhoto(photo) }),\n ...(type === 'gif' && document instanceof GramJs.Document && { gif: buildVideoFromDocument(document) }),\n ...(type === 'video' && document instanceof GramJs.Document && {\n thumbnail: buildApiThumbnailFromStripped(document.thumbs),\n }),\n };\n}\n\nexport function buildBotSwitchPm(switchPm?: GramJs.InlineBotSwitchPM) {\n return switchPm ? pick(switchPm, ['text', 'startParam']) as ApiBotInlineSwitchPm : undefined;\n}\n\nfunction buildApiWebDocument(document?: GramJs.TypeWebDocument): ApiWebDocument | undefined {\n return document ? pick(document, ['url', 'mimeType']) : undefined;\n}\n","import BigInt from 'big-integer';\nimport { Api as GramJs } from '../../../lib/gramjs';\n\nimport { ApiChat, ApiUser } from '../../types';\n\nimport localDb from '../localDb';\nimport { invokeRequest } from './client';\nimport { buildInputPeer, calculateResultHash, generateRandomBigInt } from '../gramjsBuilders';\nimport { buildApiUser } from '../apiBuilders/users';\nimport { buildApiBotInlineMediaResult, buildApiBotInlineResult, buildBotSwitchPm } from '../apiBuilders/bots';\nimport { buildApiChatFromPreview } from '../apiBuilders/chats';\n\nexport function init() {\n}\n\nexport function answerCallbackButton(\n {\n chatId, accessHash, messageId, data,\n }: {\n chatId: number; accessHash?: string; messageId: number; data: string;\n },\n) {\n return invokeRequest(new GramJs.messages.GetBotCallbackAnswer({\n peer: buildInputPeer(chatId, accessHash),\n msgId: messageId,\n data: Buffer.from(data),\n }));\n}\n\nexport async function fetchTopInlineBots({ hash = 0 }: { hash?: number }) {\n const topPeers = await invokeRequest(new GramJs.contacts.GetTopPeers({\n hash,\n botsInline: true,\n }));\n\n if (!(topPeers instanceof GramJs.contacts.TopPeers)) {\n return undefined;\n }\n\n const users = topPeers.users.map(buildApiUser).filter(Boolean as any);\n const ids = users.map(({ id }) => id);\n\n return {\n hash: calculateResultHash(ids),\n ids,\n users,\n };\n}\n\nexport async function fetchInlineBot({ username }: { username: string }) {\n const resolvedPeer = await invokeRequest(new GramJs.contacts.ResolveUsername({ username }));\n\n if (\n !resolvedPeer\n || !(\n resolvedPeer.users[0] instanceof GramJs.User\n && resolvedPeer.users[0].bot\n && resolvedPeer.users[0].botInlinePlaceholder\n )\n ) {\n return undefined;\n }\n\n addUserToLocalDb(resolvedPeer.users[0]);\n\n return {\n user: buildApiUser(resolvedPeer.users[0]),\n chat: buildApiChatFromPreview(resolvedPeer.users[0]),\n };\n}\n\nexport async function fetchInlineBotResults({\n bot, chat, query, offset = '',\n}: {\n bot: ApiUser; chat: ApiChat; query: string; offset?: string;\n}) {\n const result = await invokeRequest(new GramJs.messages.GetInlineBotResults({\n bot: buildInputPeer(bot.id, bot.accessHash),\n peer: buildInputPeer(chat.id, chat.accessHash),\n query,\n offset,\n }));\n\n if (!result) {\n return undefined;\n }\n\n result.users.map(addUserToLocalDb);\n\n return {\n isGallery: Boolean(result.gallery),\n help: bot.botPlaceholder,\n nextOffset: getInlineBotResultsNextOffset(bot.username, result.nextOffset),\n switchPm: buildBotSwitchPm(result.switchPm),\n users: result.users.map(buildApiUser).filter(Boolean as any),\n results: processInlineBotResult(String(result.queryId), result.results),\n };\n}\n\nexport async function sendInlineBotResult({\n chat, resultId, queryId, replyingTo,\n}: {\n chat: ApiChat;\n resultId: string;\n queryId: string;\n replyingTo?: number;\n}) {\n const randomId = generateRandomBigInt();\n\n await invokeRequest(new GramJs.messages.SendInlineBotResult({\n clearDraft: true,\n randomId,\n queryId: BigInt(queryId),\n peer: buildInputPeer(chat.id, chat.accessHash),\n id: resultId,\n ...(replyingTo && { replyToMsgId: replyingTo }),\n }), true);\n}\n\nexport async function startBot({\n bot, startParam,\n}: {\n bot: ApiUser;\n startParam?: string;\n}) {\n const randomId = generateRandomBigInt();\n\n await invokeRequest(new GramJs.messages.StartBot({\n bot: buildInputPeer(bot.id, bot.accessHash),\n peer: buildInputPeer(bot.id, bot.accessHash),\n randomId,\n startParam,\n }), true);\n}\n\nfunction processInlineBotResult(queryId: string, results: GramJs.TypeBotInlineResult[]) {\n return results.map((result) => {\n if (result instanceof GramJs.BotInlineMediaResult) {\n if (result.document instanceof GramJs.Document) {\n addDocumentToLocalDb(result.document);\n }\n\n if (result.photo instanceof GramJs.Photo) {\n addPhotoToLocalDb(result.photo);\n }\n\n return buildApiBotInlineMediaResult(result, queryId);\n }\n\n if (result.thumb) {\n addWebDocumentToLocalDb(result.thumb);\n }\n\n return buildApiBotInlineResult(result, queryId);\n });\n}\n\nfunction getInlineBotResultsNextOffset(username: string, nextOffset?: string) {\n return username === 'gif' && nextOffset === '0' ? '' : nextOffset;\n}\n\nfunction addUserToLocalDb(user: GramJs.User) {\n localDb.users[user.id] = user;\n}\n\nfunction addDocumentToLocalDb(document: GramJs.Document) {\n localDb.documents[String(document.id)] = document;\n}\n\nfunction addPhotoToLocalDb(photo: GramJs.Photo) {\n localDb.photos[String(photo.id)] = photo;\n}\n\nfunction addWebDocumentToLocalDb(webDocument: GramJs.TypeWebDocument) {\n localDb.webDocuments[webDocument.url] = webDocument;\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\n\nexport function buildShippingOptions(shippingOptions: GramJs.ShippingOption[] | undefined) {\n if (!shippingOptions) {\n return undefined;\n }\n return Object.values(shippingOptions).map((option) => {\n return {\n id: option.id,\n title: option.title,\n amount: option.prices.reduce((ac, cur) => ac + Number((cur.amount as any).value), 0),\n prices: option.prices.map(({ label, amount }) => {\n return {\n label,\n amount: Number((amount as any).value),\n };\n }),\n };\n });\n}\n\nexport function buildReceipt(receipt: GramJs.payments.PaymentReceipt) {\n const {\n invoice,\n info,\n shipping,\n currency,\n totalAmount,\n credentialsTitle,\n } = receipt;\n\n const { shippingAddress, phone, name } = (info || {});\n\n const { prices } = invoice;\n const mapedPrices = prices.map(({ label, amount }) => ({\n label,\n amount: Number((amount as any).value),\n }));\n\n let shippingPrices;\n let shippingMethod;\n\n if (shipping) {\n shippingPrices = shipping.prices.map(({ label, amount }) => {\n return {\n label,\n amount: Number((amount as any).value),\n };\n });\n shippingMethod = shipping.title;\n }\n\n return {\n currency,\n prices: mapedPrices,\n info: { shippingAddress, phone, name },\n totalAmount: Number((totalAmount as any).value),\n credentialsTitle,\n shippingPrices,\n shippingMethod,\n };\n}\n\nexport function buildPaymentForm(form: GramJs.payments.PaymentForm) {\n const {\n formId,\n canSaveCredentials,\n passwordMissing,\n providerId,\n nativeProvider,\n nativeParams,\n savedInfo,\n invoice,\n } = form;\n\n const {\n test,\n nameRequested,\n phoneRequested,\n emailRequested,\n shippingAddressRequested,\n flexible,\n phoneToProvider,\n emailToProvider,\n currency,\n prices,\n } = invoice;\n\n const mapedPrices = prices.map(({ label, amount }) => ({\n label,\n amount: Number((amount as any).value),\n }));\n\n const nativeData = nativeParams ? JSON.parse(nativeParams.data) : {};\n return {\n canSaveCredentials,\n passwordMissing,\n formId: String(formId),\n providerId,\n nativeProvider,\n savedInfo,\n invoice: {\n test,\n nameRequested,\n phoneRequested,\n emailRequested,\n shippingAddressRequested,\n flexible,\n phoneToProvider,\n emailToProvider,\n currency,\n prices: mapedPrices,\n },\n nativeParams: {\n needCardholderName: nativeData.need_cardholder_name,\n needCountry: nativeData.need_country,\n needZip: nativeData.need_zip,\n publishableKey: nativeData.publishable_key,\n },\n };\n}\n","import BigInt from 'big-integer';\nimport { Api as GramJs } from '../../../lib/gramjs';\nimport { invokeRequest } from './client';\nimport { buildInputPeer, buildShippingInfo } from '../gramjsBuilders';\nimport { buildShippingOptions, buildPaymentForm, buildReceipt } from '../apiBuilders/payments';\nimport { ApiChat } from '../../types';\n\nexport async function validateRequestedInfo({\n chat,\n messageId,\n requestInfo,\n shouldSave,\n}: {\n chat: ApiChat;\n messageId: number;\n requestInfo: GramJs.TypePaymentRequestedInfo;\n shouldSave?: boolean;\n}): Promise<{\n id: string;\n shippingOptions: any;\n } | undefined> {\n const result = await invokeRequest(new GramJs.payments.ValidateRequestedInfo({\n peer: buildInputPeer(chat.id, chat.accessHash),\n msgId: messageId,\n save: shouldSave || undefined,\n info: buildShippingInfo(requestInfo),\n }));\n if (!result) {\n return undefined;\n }\n\n const { id, shippingOptions } = result;\n if (!id) {\n return undefined;\n }\n\n return {\n id,\n shippingOptions: buildShippingOptions(shippingOptions),\n };\n}\n\nexport function sendPaymentForm({\n chat,\n messageId,\n formId,\n requestedInfoId,\n shippingOptionId,\n credentials,\n}: {\n chat: ApiChat;\n messageId: number;\n formId: string;\n credentials: any;\n requestedInfoId?: string;\n shippingOptionId?: string;\n}) {\n return invokeRequest(new GramJs.payments.SendPaymentForm({\n formId: BigInt(formId),\n peer: buildInputPeer(chat.id, chat.accessHash),\n msgId: messageId,\n requestedInfoId,\n shippingOptionId,\n credentials: new GramJs.InputPaymentCredentials({\n save: credentials.save,\n data: new GramJs.DataJSON({ data: JSON.stringify(credentials.data) }),\n }),\n }), true);\n}\n\nexport async function getPaymentForm({\n chat, messageId,\n}: {\n chat: ApiChat;\n messageId: number;\n}) {\n const result = await invokeRequest(new GramJs.payments.GetPaymentForm({\n peer: buildInputPeer(chat.id, chat.accessHash),\n msgId: messageId,\n }));\n\n if (!result) {\n return undefined;\n }\n\n return buildPaymentForm(result);\n}\n\nexport async function getReceipt(chat: ApiChat, msgId: number) {\n const result = await invokeRequest(new GramJs.payments.GetPaymentReceipt({\n peer: buildInputPeer(chat.id, chat.accessHash),\n msgId,\n }));\n if (!result) {\n return undefined;\n }\n\n return buildReceipt(result);\n}\n","import {\n OnApiUpdate,\n ApiInitialArgs,\n ApiUpdate,\n ApiOnProgress,\n} from '../types';\nimport { Methods, MethodArgs, MethodResponse } from './methods/types';\n\nimport { API_THROTTLE_RESET_UPDATES, API_UPDATE_THROTTLE } from '../../config';\nimport { throttle, throttleWithTickEnd } from '../../util/schedulers';\nimport { init as initUpdater } from './updater';\nimport { init as initAuth } from './methods/auth';\nimport { init as initChats } from './methods/chats';\nimport { init as initMessages } from './methods/messages';\nimport { init as initUsers } from './methods/users';\nimport { init as initClient } from './methods/client';\nimport { init as initStickers } from './methods/symbols';\nimport { init as initManagement } from './methods/management';\nimport { init as initTwoFaSettings } from './methods/twoFaSettings';\nimport * as methods from './methods';\n\nlet onUpdate: OnApiUpdate;\n\nexport async function initApi(_onUpdate: OnApiUpdate, initialArgs: ApiInitialArgs) {\n onUpdate = _onUpdate;\n\n initUpdater(handleUpdate);\n initAuth(handleUpdate);\n initChats(handleUpdate);\n initMessages(handleUpdate);\n initUsers(handleUpdate);\n initStickers(handleUpdate);\n initManagement(handleUpdate);\n initTwoFaSettings(handleUpdate);\n\n await initClient(handleUpdate, initialArgs);\n}\n\nexport function callApi(fnName: T, ...args: MethodArgs): MethodResponse {\n // @ts-ignore\n return methods[fnName](...args) as MethodResponse;\n}\n\nexport function cancelApiProgress(progressCallback: ApiOnProgress) {\n progressCallback.isCanceled = true;\n}\n\nconst flushUpdatesOnTickEnd = throttleWithTickEnd(flushUpdates);\n\nlet flushUpdatesThrottled: typeof flushUpdatesOnTickEnd | undefined;\nlet currentThrottleId: number | undefined;\n\nlet pendingUpdates: ApiUpdate[] | undefined;\n\nfunction handleUpdate(update: ApiUpdate) {\n if (!pendingUpdates) {\n pendingUpdates = [update];\n } else {\n pendingUpdates.push(update);\n }\n\n if (!flushUpdatesThrottled || API_THROTTLE_RESET_UPDATES.has(update['@type'])) {\n flushUpdatesThrottled = throttle(flushUpdatesOnTickEnd, API_UPDATE_THROTTLE, true);\n currentThrottleId = Math.random();\n }\n\n flushUpdatesThrottled(currentThrottleId!);\n}\n\nfunction flushUpdates(throttleId: number) {\n if (!pendingUpdates || throttleId !== currentThrottleId) {\n return;\n }\n\n const currentUpdates = pendingUpdates!;\n pendingUpdates = undefined;\n currentUpdates.forEach(onUpdate);\n}\n","type Scheduler =\n typeof requestAnimationFrame\n | typeof onTickEnd\n | typeof runNow;\n\nexport function debounce(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n shouldRunLast = true,\n) {\n let waitingTimeout: number | undefined;\n\n return (...args: Parameters) => {\n if (waitingTimeout) {\n clearTimeout(waitingTimeout);\n waitingTimeout = undefined;\n } else if (shouldRunFirst) {\n // @ts-ignore\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n waitingTimeout = self.setTimeout(() => {\n if (shouldRunLast) {\n // @ts-ignore\n fn(...args);\n }\n\n waitingTimeout = undefined;\n }, ms);\n };\n}\n\nexport function throttle(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n) {\n let interval: number | undefined;\n let isPending: boolean;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n isPending = true;\n args = _args;\n\n if (!interval) {\n if (shouldRunFirst) {\n isPending = false;\n // @ts-ignore\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n interval = self.setInterval(() => {\n if (!isPending) {\n // eslint-disable-next-line no-restricted-globals\n self.clearInterval(interval!);\n interval = undefined;\n return;\n }\n\n isPending = false;\n // @ts-ignore\n fn(...args);\n }, ms);\n }\n };\n}\n\nexport function throttleWithRaf(fn: F) {\n return throttleWith(fastRaf, fn);\n}\n\nexport function throttleWithPrimaryRaf(fn: F) {\n return throttleWith(fastPrimaryRaf, fn);\n}\n\nexport function throttleWithTickEnd(fn: F) {\n return throttleWith(onTickEnd, fn);\n}\n\nexport function throttleWithNow(fn: F) {\n return throttleWith(runNow, fn);\n}\n\nexport function throttleWith(schedulerFn: Scheduler, fn: F) {\n let waiting = false;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n args = _args;\n\n if (!waiting) {\n waiting = true;\n\n schedulerFn(() => {\n waiting = false;\n // @ts-ignore\n fn(...args);\n });\n }\n };\n}\n\nexport function onTickEnd(cb: NoneToVoidFunction) {\n Promise.resolve().then(cb);\n}\n\nexport function onIdle(cb: NoneToVoidFunction) {\n // eslint-disable-next-line no-restricted-globals\n if (self.requestIdleCallback) {\n // eslint-disable-next-line no-restricted-globals\n self.requestIdleCallback(cb);\n } else {\n onTickEnd(cb);\n }\n}\n\nfunction runNow(fn: NoneToVoidFunction) {\n fn();\n}\n\nexport const pause = (ms: number) => new Promise((resolve) => {\n setTimeout(() => resolve(), ms);\n});\n\nexport function rafPromise() {\n return new Promise((resolve) => {\n fastRaf(resolve);\n });\n}\n\nlet fastRafCallbacks: NoneToVoidFunction[] | undefined;\nlet fastRafPrimaryCallbacks: NoneToVoidFunction[] | undefined;\n\n// May result in an immediate execution if called from another `requestAnimationFrame` callback\nexport function fastRaf(callback: NoneToVoidFunction, isPrimary = false) {\n if (!fastRafCallbacks) {\n fastRafCallbacks = isPrimary ? [] : [callback];\n fastRafPrimaryCallbacks = isPrimary ? [callback] : [];\n\n requestAnimationFrame(() => {\n const currentCallbacks = fastRafCallbacks!;\n const currentPrimaryCallbacks = fastRafPrimaryCallbacks!;\n fastRafCallbacks = undefined;\n fastRafPrimaryCallbacks = undefined;\n currentPrimaryCallbacks.forEach((cb) => cb());\n currentCallbacks.forEach((cb) => cb());\n });\n } else if (isPrimary) {\n fastRafPrimaryCallbacks!.push(callback);\n } else {\n fastRafCallbacks.push(callback);\n }\n}\n\nexport function fastPrimaryRaf(callback: NoneToVoidFunction) {\n fastRaf(callback, true);\n}\n\nlet beforeUnloadCallbacks: NoneToVoidFunction[] | undefined;\n\nexport function onBeforeUnload(callback: NoneToVoidFunction, isLast = false) {\n if (!beforeUnloadCallbacks) {\n beforeUnloadCallbacks = [];\n // eslint-disable-next-line no-restricted-globals\n self.addEventListener('beforeunload', () => {\n beforeUnloadCallbacks!.forEach((cb) => cb());\n });\n }\n\n if (isLast) {\n beforeUnloadCallbacks.push(callback);\n } else {\n beforeUnloadCallbacks.unshift(callback);\n }\n\n return () => {\n beforeUnloadCallbacks = beforeUnloadCallbacks!.filter((cb) => cb !== callback);\n };\n}\n","import { ApiOnProgress, ApiUpdate } from '../../types';\nimport { OriginMessageEvent, WorkerMessageData } from './types';\n\nimport { DEBUG } from '../../../config';\nimport { initApi, callApi, cancelApiProgress } from '../provider';\n\ndeclare const self: WorkerGlobalScope;\n\nhandleErrors();\n\n// TODO Re-use `util/createWorkerInterface.ts`\n\nconst callbackState = new Map();\n\nif (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH LOAD WORKER');\n}\n\nonmessage = async (message: OriginMessageEvent) => {\n const { data } = message;\n\n switch (data.type) {\n case 'initApi': {\n await initApi(onUpdate, data.args[0]);\n break;\n }\n case 'callMethod': {\n const { messageId, name, args } = data;\n try {\n if (messageId) {\n const callback = (...callbackArgs: any[]) => {\n const lastArg = callbackArgs[callbackArgs.length - 1];\n\n sendToOrigin({\n type: 'methodCallback',\n messageId,\n callbackArgs,\n }, lastArg instanceof ArrayBuffer ? lastArg : undefined);\n };\n\n callbackState.set(messageId, callback);\n\n args.push(callback as never);\n }\n\n const response = await callApi(name, ...args);\n const { arrayBuffer } = (typeof response === 'object' && 'arrayBuffer' in response && response) || {};\n\n if (messageId) {\n sendToOrigin({\n type: 'methodResponse',\n messageId,\n response,\n }, arrayBuffer);\n }\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n\n if (messageId) {\n sendToOrigin({\n type: 'methodResponse',\n messageId,\n error: { message: error.message },\n });\n }\n }\n\n if (messageId) {\n callbackState.delete(messageId);\n }\n\n break;\n }\n case 'cancelProgress': {\n const callback = callbackState.get(data.messageId);\n if (callback) {\n cancelApiProgress(callback);\n }\n\n break;\n }\n case 'ping': {\n sendToOrigin({\n type: 'methodResponse',\n messageId: data.messageId!,\n });\n\n break;\n }\n }\n};\n\nfunction handleErrors() {\n self.onerror = (e) => {\n // eslint-disable-next-line no-console\n console.error(e);\n sendToOrigin({ type: 'unhandledError', error: { message: e.error.message || 'Uncaught exception in worker' } });\n };\n\n self.addEventListener('unhandledrejection', (e) => {\n // eslint-disable-next-line no-console\n console.error(e);\n sendToOrigin({ type: 'unhandledError', error: { message: e.reason.message || 'Uncaught rejection in worker' } });\n });\n}\n\nfunction onUpdate(update: ApiUpdate) {\n sendToOrigin({\n type: 'update',\n update,\n });\n}\n\nfunction sendToOrigin(data: WorkerMessageData, arrayBuffer?: ArrayBuffer) {\n if (arrayBuffer) {\n postMessage(data, [arrayBuffer]);\n } else {\n postMessage(data);\n }\n}\n","const BigInt = require('big-integer');\nconst crypto = require('./crypto/crypto');\n\n/**\n * converts a buffer to big int\n * @param buffer\n * @param little\n * @param signed\n * @returns {bigInt.BigInteger}\n */\nfunction readBigIntFromBuffer(buffer, little = true, signed = false) {\n let randBuffer = Buffer.from(buffer);\n const bytesNumber = randBuffer.length;\n if (little) {\n randBuffer = randBuffer.reverse();\n }\n let bigInt = BigInt(randBuffer.toString('hex'), 16);\n if (signed && Math.floor(bigInt.toString('2').length / 8) >= bytesNumber) {\n bigInt = bigInt.subtract(BigInt(2)\n .pow(BigInt(bytesNumber * 8)));\n }\n return bigInt;\n}\n\n/**\n * Special case signed little ints\n * @param big\n * @param number\n * @returns {Buffer}\n */\nfunction toSignedLittleBuffer(big, number = 8) {\n const bigNumber = BigInt(big);\n const byteArray = [];\n for (let i = 0; i < number; i++) {\n byteArray[i] = bigNumber.shiftRight(8 * i)\n .and(255);\n }\n return Buffer.from(byteArray);\n}\n\n\n/**\n * converts a big int to a buffer\n * @param bigInt {bigInt.BigInteger}\n * @param bytesNumber\n * @param little\n * @param signed\n * @returns {Buffer}\n */\nfunction readBufferFromBigInt(bigInt, bytesNumber, little = true, signed = false) {\n bigInt = BigInt(bigInt);\n const bitLength = bigInt.bitLength();\n\n const bytes = Math.ceil(bitLength / 8);\n if (bytesNumber < bytes) {\n throw new Error('OverflowError: int too big to convert');\n }\n if (!signed && bigInt.lesser(BigInt(0))) {\n throw new Error('Cannot convert to unsigned');\n }\n let below = false;\n if (bigInt.lesser(BigInt(0))) {\n below = true;\n bigInt = bigInt.abs();\n }\n\n const hex = bigInt.toString('16')\n .padStart(bytesNumber * 2, '0');\n let l = Buffer.from(hex, 'hex');\n if (little) {\n l = l.reverse();\n }\n\n if (signed && below) {\n if (little) {\n let reminder = false;\n if (l[0] !== 0) {\n l[0] -= 1;\n }\n for (let i = 0; i < l.length; i++) {\n if (l[i] === 0) {\n reminder = true;\n continue;\n }\n if (reminder) {\n l[i] -= 1;\n reminder = false;\n }\n l[i] = 255 - l[i];\n }\n } else {\n l[l.length - 1] = 256 - l[l.length - 1];\n for (let i = 0; i < l.length - 1; i++) {\n l[i] = 255 - l[i];\n }\n }\n }\n return l;\n}\n\n/**\n * Generates a random long integer (8 bytes), which is optionally signed\n * @returns {BigInteger}\n */\nfunction generateRandomLong(signed = true) {\n return readBigIntFromBuffer(generateRandomBytes(8), true, signed);\n}\n\n/**\n * .... really javascript\n * @param n {number}\n * @param m {number}\n * @returns {number}\n */\nfunction mod(n, m) {\n return ((n % m) + m) % m;\n}\n\n/**\n * returns a positive bigInt\n * @param n {BigInt}\n * @param m {BigInt}\n * @returns {BigInt}\n */\nfunction bigIntMod(n, m) {\n return ((n.remainder(m)).add(m)).remainder(m);\n}\n\n/**\n * Generates a random bytes array\n * @param count\n * @returns {Buffer}\n */\nfunction generateRandomBytes(count) {\n return Buffer.from(crypto.randomBytes(count));\n}\n\n/**\n * Calculate the key based on Telegram guidelines, specifying whether it's the client or not\n * @param sharedKey\n * @param msgKey\n * @param client\n * @returns {{iv: Buffer, key: Buffer}}\n */\n\n/* CONTEST\nthis is mtproto 1 (mostly used for secret chats)\nasync function calcKey(sharedKey, msgKey, client) {\n const x = client === true ? 0 : 8\n const [sha1a, sha1b, sha1c, sha1d] = await Promise.all([\n sha1(Buffer.concat([msgKey, sharedKey.slice(x, x + 32)])),\n sha1(Buffer.concat([sharedKey.slice(x + 32, x + 48), msgKey, sharedKey.slice(x + 48, x + 64)])),\n sha1(Buffer.concat([sharedKey.slice(x + 64, x + 96), msgKey])),\n sha1(Buffer.concat([msgKey, sharedKey.slice(x + 96, x + 128)]))\n ])\n const key = Buffer.concat([sha1a.slice(0, 8), sha1b.slice(8, 20), sha1c.slice(4, 16)])\n const iv = Buffer.concat([sha1a.slice(8, 20), sha1b.slice(0, 8), sha1c.slice(16, 20), sha1d.slice(0, 8)])\n return {\n key,\n iv\n }\n}\n\n */\n\n/**\n * Generates the key data corresponding to the given nonces\n * @param serverNonce\n * @param newNonce\n * @returns {{key: Buffer, iv: Buffer}}\n */\nasync function generateKeyDataFromNonce(serverNonce, newNonce) {\n serverNonce = toSignedLittleBuffer(serverNonce, 16);\n newNonce = toSignedLittleBuffer(newNonce, 32);\n const [hash1, hash2, hash3] = await Promise.all([\n sha1(Buffer.concat([newNonce, serverNonce])),\n sha1(Buffer.concat([serverNonce, newNonce])),\n sha1(Buffer.concat([newNonce, newNonce])),\n ]);\n const keyBuffer = Buffer.concat([hash1, hash2.slice(0, 12)]);\n const ivBuffer = Buffer.concat([hash2.slice(12, 20), hash3, newNonce.slice(0, 4)]);\n return {\n key: keyBuffer,\n iv: ivBuffer,\n };\n}\n\nfunction convertToLittle(buf) {\n const correct = Buffer.alloc(buf.length * 4);\n\n for (let i = 0; i < buf.length; i++) {\n correct.writeUInt32BE(buf[i], i * 4);\n }\n return correct;\n}\n\n/**\n * Calculates the SHA1 digest for the given data\n * @param data\n * @returns {Promise}\n */\nfunction sha1(data) {\n const shaSum = crypto.createHash('sha1');\n shaSum.update(data);\n return shaSum.digest();\n}\n\n\n/**\n * Calculates the SHA256 digest for the given data\n * @param data\n * @returns {Promise}\n */\nfunction sha256(data) {\n const shaSum = crypto.createHash('sha256');\n shaSum.update(data);\n return shaSum.digest();\n}\n\n/**\n * Fast mod pow for RSA calculation. a^b % n\n * @param a\n * @param b\n * @param n\n * @returns {bigInt.BigInteger}\n */\nfunction modExp(a, b, n) {\n a = a.remainder(n);\n let result = BigInt.one;\n let x = a;\n while (b.greater(BigInt.zero)) {\n const leastSignificantBit = b.remainder(BigInt(2));\n b = b.divide(BigInt(2));\n if (leastSignificantBit.eq(BigInt.one)) {\n result = result.multiply(x);\n result = result.remainder(n);\n }\n x = x.multiply(x);\n x = x.remainder(n);\n }\n return result;\n}\n\n\n/**\n * Gets the arbitrary-length byte array corresponding to the given integer\n * @param integer {number,BigInteger}\n * @param signed {boolean}\n * @returns {Buffer}\n */\nfunction getByteArray(integer, signed = false) {\n const bits = integer.toString(2).length;\n const byteLength = Math.floor((bits + 8 - 1) / 8);\n return readBufferFromBigInt(BigInt(integer), byteLength, false, signed);\n}\n\n/**\n * returns a random int from min (inclusive) and max (inclusive)\n * @param min\n * @param max\n * @returns {number}\n */\nfunction getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}\n\n/**\n * Sleeps a specified amount of time\n * @param ms time in milliseconds\n * @returns {Promise}\n */\nconst sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));\n\n/**\n * Helper to export two buffers of same length\n * @returns {Buffer}\n */\n\nfunction bufferXor(a, b) {\n const res = [];\n for (let i = 0; i < a.length; i++) {\n res.push(a[i] ^ b[i]);\n }\n return Buffer.from(res);\n}\n\n/**\n * Checks if the obj is an array\n * @param obj\n * @returns {boolean}\n */\n/*\nCONTEST\nwe do'nt support array requests anyway\nfunction isArrayLike(obj) {\n if (!obj) return false\n const l = obj.length\n if (typeof l != 'number' || l < 0) return false\n if (Math.floor(l) !== l) return false\n // fast check\n if (l > 0 && !(l - 1 in obj)) return false\n // more complete check (optional)\n for (let i = 0; i < l; ++i) {\n if (!(i in obj)) return false\n }\n return true\n}\n*/\n\n// Taken from https://stackoverflow.com/questions/18638900/javascript-crc32/18639999#18639999\nfunction makeCRCTable() {\n let c;\n const crcTable = [];\n for (let n = 0; n < 256; n++) {\n c = n;\n for (let k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n crcTable[n] = c;\n }\n return crcTable;\n}\n\nlet crcTable;\n\nfunction crc32(buf) {\n if (!crcTable) {\n crcTable = makeCRCTable();\n }\n if (!Buffer.isBuffer(buf)) {\n buf = Buffer.from(buf);\n }\n let crc = -1;\n\n for (let index = 0; index < buf.length; index++) {\n const byte = buf[index];\n crc = crcTable[(crc ^ byte) & 0xff] ^ (crc >>> 8);\n }\n return (crc ^ (-1)) >>> 0;\n}\n\n/**\n * Creates a deferred object\n * @return {Deferred}\n */\nfunction createDeferred() {\n let resolve;\n const promise = new Promise((_resolve) => {\n resolve = _resolve;\n });\n\n return {\n promise,\n resolve,\n };\n}\n\nmodule.exports = {\n readBigIntFromBuffer,\n readBufferFromBigInt,\n generateRandomLong,\n mod,\n crc32,\n generateRandomBytes,\n // calcKey,\n generateKeyDataFromNonce,\n sha1,\n sha256,\n bigIntMod,\n modExp,\n getRandomInt,\n sleep,\n getByteArray,\n // isArrayLike,\n toSignedLittleBuffer,\n convertToLittle,\n bufferXor,\n createDeferred,\n};\n","const BigInt = require('big-integer');\nconst { constructors } = require('./tl');\nconst {\n readBigIntFromBuffer,\n readBufferFromBigInt,\n sha256,\n bigIntMod,\n modExp,\n generateRandomBytes,\n} = require('./Helpers');\nconst crypto = require('./crypto/crypto');\n\nconst SIZE_FOR_HASH = 256;\n\n/**\n *\n *\n * @param prime{BigInteger}\n * @param g{BigInteger}\n */\n\n/*\nWe don't support changing passwords yet\nfunction checkPrimeAndGoodCheck(prime, g) {\n console.error('Unsupported function `checkPrimeAndGoodCheck` call. Arguments:', prime, g)\n\n const goodPrimeBitsCount = 2048\n if (prime < 0 || prime.bitLength() !== goodPrimeBitsCount) {\n throw new Error(`bad prime count ${prime.bitLength()},expected ${goodPrimeBitsCount}`)\n }\n // TODO this is kinda slow\n if (Factorizator.factorize(prime)[0] !== 1) {\n throw new Error('give \"prime\" is not prime')\n }\n if (g.eq(BigInt(2))) {\n if ((prime.remainder(BigInt(8))).neq(BigInt(7))) {\n throw new Error(`bad g ${g}, mod8 ${prime % 8}`)\n }\n } else if (g.eq(BigInt(3))) {\n if ((prime.remainder(BigInt(3))).neq(BigInt(2))) {\n throw new Error(`bad g ${g}, mod3 ${prime % 3}`)\n }\n // eslint-disable-next-line no-empty\n } else if (g.eq(BigInt(4))) {\n\n } else if (g.eq(BigInt(5))) {\n if (!([ BigInt(1), BigInt(4) ].includes(prime.remainder(BigInt(5))))) {\n throw new Error(`bad g ${g}, mod8 ${prime % 5}`)\n }\n } else if (g.eq(BigInt(6))) {\n if (!([ BigInt(19), BigInt(23) ].includes(prime.remainder(BigInt(24))))) {\n throw new Error(`bad g ${g}, mod8 ${prime % 24}`)\n }\n } else if (g.eq(BigInt(7))) {\n if (!([ BigInt(3), BigInt(5), BigInt(6) ].includes(prime.remainder(BigInt(7))))) {\n throw new Error(`bad g ${g}, mod8 ${prime % 7}`)\n }\n } else {\n throw new Error(`bad g ${g}`)\n }\n const primeSub1Div2 = (prime.subtract(BigInt(1))).divide(BigInt(2))\n if (Factorizator.factorize(primeSub1Div2)[0] !== 1) {\n throw new Error('(prime - 1) // 2 is not prime')\n }\n}\n*/\n/**\n *\n * @param primeBytes{Buffer}\n * @param g{number}\n */\nfunction checkPrimeAndGood(primeBytes, g) {\n const goodPrime = Buffer.from([\n 0xC7, 0x1C, 0xAE, 0xB9, 0xC6, 0xB1, 0xC9, 0x04, 0x8E, 0x6C, 0x52, 0x2F, 0x70, 0xF1, 0x3F, 0x73,\n 0x98, 0x0D, 0x40, 0x23, 0x8E, 0x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0x7F, 0xA9, 0xFF, 0x5E, 0xED, 0x70, 0x05,\n 0x0D, 0xED, 0x28, 0x49, 0xF4, 0x7B, 0xF9, 0x59, 0xD9, 0x56, 0x85, 0x0C, 0xE9, 0x29, 0x85, 0x1F,\n 0x0D, 0x81, 0x15, 0xF6, 0x35, 0xB1, 0x05, 0xEE, 0x2E, 0x4E, 0x15, 0xD0, 0x4B, 0x24, 0x54, 0xBF,\n 0x6F, 0x4F, 0xAD, 0xF0, 0x34, 0xB1, 0x04, 0x03, 0x11, 0x9C, 0xD8, 0xE3, 0xB9, 0x2F, 0xCC, 0x5B,\n ]);\n if (goodPrime.equals(primeBytes)) {\n if ([3, 4, 5, 7].includes(g)) {\n return; // It's good\n }\n }\n throw new Error('Changing passwords unsupported');\n // checkPrimeAndGoodCheck(readBigIntFromBuffer(primeBytes, false), g)\n}\n\n/**\n *\n * @param number{BigInteger}\n * @param p{BigInteger}\n * @returns {boolean}\n */\nfunction isGoodLarge(number, p) {\n return (number.greater(BigInt(0)) && (p.subtract(number)\n .greater(BigInt(0))));\n}\n\n/**\n *\n * @param number {Buffer}\n * @returns {Buffer}\n */\nfunction numBytesForHash(number) {\n return Buffer.concat([Buffer.alloc(SIZE_FOR_HASH - number.length), number]);\n}\n\n/**\n *\n * @param g {Buffer}\n * @returns {Buffer}\n */\nfunction bigNumForHash(g) {\n return readBufferFromBigInt(g, SIZE_FOR_HASH, false);\n}\n\n/**\n *\n * @param modexp {BigInteger}\n * @param prime {BigInteger}\n * @returns {Boolean}\n */\nfunction isGoodModExpFirst(modexp, prime) {\n const diff = prime.subtract(modexp);\n\n const minDiffBitsCount = 2048 - 64;\n const maxModExpSize = 256;\n\n return !(diff.lesser(BigInt(0)) || diff.bitLength() < minDiffBitsCount\n || modexp.bitLength() < minDiffBitsCount\n || Math.floor((modexp.bitLength() + 7) / 8) > maxModExpSize);\n}\n\nfunction xor(a, b) {\n const length = Math.min(a.length, b.length);\n\n for (let i = 0; i < length; i++) {\n a[i] ^= b[i];\n }\n\n return a;\n}\n\n/**\n *\n * @param password{Buffer}\n * @param salt{Buffer}\n * @param iterations{number}\n * @returns {*}\n */\n\nfunction pbkdf2sha512(password, salt, iterations) {\n return crypto.pbkdf2(password, salt, iterations, 64, 'sha512');\n}\n\n/**\n *\n * @param algo {constructors.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow}\n * @param password\n * @returns {Buffer|*}\n */\nasync function computeHash(algo, password) {\n const hash1 = await sha256(Buffer.concat([algo.salt1, Buffer.from(password, 'utf-8'), algo.salt1]));\n const hash2 = await sha256(Buffer.concat([algo.salt2, hash1, algo.salt2]));\n const hash3 = await pbkdf2sha512(hash2, algo.salt1, 100000);\n return sha256(Buffer.concat([algo.salt2, hash3, algo.salt2]));\n}\n\n/**\n *\n * @param algo {constructors.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow}\n * @param password\n */\nasync function computeDigest(algo, password) {\n try {\n checkPrimeAndGood(algo.p, algo.g);\n } catch (e) {\n throw new Error('bad p/g in password');\n }\n\n const value = modExp(BigInt(algo.g),\n readBigIntFromBuffer(await computeHash(algo, password), false),\n readBigIntFromBuffer(algo.p, false));\n return bigNumForHash(value);\n}\n\n/**\n *\n * @param request {constructors.account.Password}\n * @param password {string}\n */\nasync function computeCheck(request, password) {\n const algo = request.currentAlgo;\n if (!(algo instanceof constructors.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow)) {\n throw new Error(`Unsupported password algorithm ${algo.className}`);\n }\n\n const pwHash = await computeHash(algo, password);\n const p = readBigIntFromBuffer(algo.p, false);\n const { g } = algo;\n const B = readBigIntFromBuffer(request.srp_B, false);\n try {\n checkPrimeAndGood(algo.p, g);\n } catch (e) {\n throw new Error('bad /g in password');\n }\n if (!isGoodLarge(B, p)) {\n throw new Error('bad b in check');\n }\n const x = readBigIntFromBuffer(pwHash, false);\n const pForHash = numBytesForHash(algo.p);\n const gForHash = bigNumForHash(g);\n const bForHash = numBytesForHash(request.srp_B);\n const gX = modExp(BigInt(g), x, p);\n const k = readBigIntFromBuffer(await sha256(Buffer.concat([pForHash, gForHash])), false);\n const kgX = bigIntMod(k.multiply(gX), p);\n const generateAndCheckRandom = async () => {\n const randomSize = 256;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const random = generateRandomBytes(randomSize);\n const a = readBigIntFromBuffer(random, false);\n const A = modExp(BigInt(g), a, p);\n if (isGoodModExpFirst(A, p)) {\n const aForHash = bigNumForHash(A);\n const u = readBigIntFromBuffer(await sha256(Buffer.concat([aForHash, bForHash])), false);\n if (u.greater(BigInt(0))) {\n return [a, aForHash, u];\n }\n }\n }\n };\n const [a, aForHash, u] = await generateAndCheckRandom();\n const gB = bigIntMod(B.subtract(kgX), p);\n if (!isGoodModExpFirst(gB, p)) {\n throw new Error('bad gB');\n }\n\n const ux = u.multiply(x);\n const aUx = a.add(ux);\n const S = modExp(gB, aUx, p);\n const [K, pSha, gSha, salt1Sha, salt2Sha] = await Promise.all([\n sha256(bigNumForHash(S)),\n sha256(pForHash),\n sha256(gForHash),\n sha256(algo.salt1),\n sha256(algo.salt2),\n ]);\n const M1 = await sha256(Buffer.concat([\n xor(pSha, gSha),\n salt1Sha,\n salt2Sha,\n aForHash,\n bForHash,\n K,\n ]));\n\n\n return new constructors.InputCheckPasswordSRP({\n srpId: request.srpId,\n A: Buffer.from(aForHash),\n M1,\n\n });\n}\n\nmodule.exports = {\n computeCheck,\n computeDigest,\n};\n","const { constructors } = require('./tl');\n\n// eslint-disable-next-line max-len\nconst JPEG_HEADER = Buffer.from('ffd8ffe000104a46494600010100000100010000ffdb004300281c1e231e19282321232d2b28303c64413c37373c7b585d4964918099968f808c8aa0b4e6c3a0aadaad8a8cc8ffcbdaeef5ffffff9bc1fffffffaffe6fdfff8ffdb0043012b2d2d3c353c76414176f8a58ca5f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8ffc00011080000000003012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffda000c03010002110311003f00', 'hex');\nconst JPEG_FOOTER = Buffer.from('ffd9', 'hex');\n\nfunction _raiseCastFail(entity, target) {\n throw new Error(`Cannot cast ${entity.className} to any kind of ${target}`);\n}\n\n/**\n Gets the input peer for the given \"entity\" (user, chat or channel).\n\n A ``TypeError`` is raised if the given entity isn't a supported type\n or if ``check_hash is True`` but the entity's ``accessHash is None``\n *or* the entity contains ``min`` information. In this case, the hash\n cannot be used for general purposes, and thus is not returned to avoid\n any issues which can derive from invalid access hashes.\n\n Note that ``check_hash`` **is ignored** if an input peer is already\n passed since in that case we assume the user knows what they're doing.\n This is key to getting entities by explicitly passing ``hash = 0``.\n\n * @param entity\n * @param allowSelf\n * @param checkHash\n */\nfunction getInputPeer(entity, allowSelf = true, checkHash = true) {\n if (entity.SUBCLASS_OF_ID === undefined) {\n // e.g. custom.Dialog (can't cyclic import).\n\n if (allowSelf && 'inputEntity' in entity) {\n return entity.inputEntity;\n } else if ('entity' in entity) {\n return getInputPeer(entity.entity);\n } else {\n _raiseCastFail(entity, 'InputPeer');\n }\n }\n if (entity.SUBCLASS_OF_ID === 0xc91c90b6) { // crc32(b'InputPeer')\n return entity;\n }\n\n if (entity instanceof constructors.User) {\n if (entity.isSelf && allowSelf) {\n return new constructors.InputPeerSelf();\n } else if (entity.accessHash !== undefined || !checkHash) {\n return new constructors.InputPeerUser({\n userId: entity.id,\n accessHash: entity.accessHash,\n });\n } else {\n throw new Error('User without accessHash or min info cannot be input');\n }\n }\n if (entity instanceof constructors.Chat || entity instanceof constructors.ChatEmpty\n || entity instanceof constructors.ChatForbidden) {\n return new constructors.InputPeerChat({ chatId: entity.id });\n }\n if (entity instanceof constructors.Channel) {\n if (entity.accessHash !== undefined || !checkHash) {\n return new constructors.InputPeerChannel({\n channelId: entity.id,\n accessHash: entity.accessHash,\n });\n } else {\n throw new TypeError('Channel without accessHash or min info cannot be input');\n }\n }\n if (entity instanceof constructors.ChannelForbidden) {\n // \"channelForbidden are never min\", and since their hash is\n // also not optional, we assume that this truly is the case.\n return new constructors.InputPeerChannel({\n channelId: entity.id,\n accessHash: entity.accessHash,\n });\n }\n\n if (entity instanceof constructors.InputUser) {\n return new constructors.InputPeerUser({\n userId: entity.userId,\n accessHash: entity.accessHash,\n });\n }\n if (entity instanceof constructors.InputChannel) {\n return new constructors.InputPeerChannel({\n channelId: entity.channelId,\n accessHash: entity.accessHash,\n });\n }\n if (entity instanceof constructors.UserEmpty) {\n return new constructors.InputPeerEmpty();\n }\n if (entity instanceof constructors.UserFull) {\n return getInputPeer(entity.user);\n }\n\n if (entity instanceof constructors.ChatFull) {\n return new constructors.InputPeerChat({ chatId: entity.id });\n }\n\n if (entity instanceof constructors.PeerChat) {\n return new constructors.InputPeerChat(entity.chatId);\n }\n\n _raiseCastFail(entity, 'InputPeer');\n return undefined;\n}\n\n/**\n Similar to :meth:`get_input_peer`, but for :tl:`InputChannel`'s alone.\n\n .. important::\n\n This method does not validate for invalid general-purpose access\n hashes, unlike `get_input_peer`. Consider using instead:\n ``get_input_channel(get_input_peer(channel))``.\n\n * @param entity\n * @returns {InputChannel|*}\n */\n/* CONTEST\nfunction getInputChannel(entity) {\n if (entity.SUBCLASS_OF_ID === undefined) {\n _raiseCastFail(entity, 'InputChannel')\n }\n\n\n if (entity.SUBCLASS_OF_ID === 0x40f202fd) { // crc32(b'InputChannel')\n return entity\n }\n if (entity instanceof constructors.Channel || entity instanceof constructors.ChannelForbidden) {\n return new constructors.InputChannel({\n channelId: entity.id,\n accessHash: entity.accessHash || 0\n })\n }\n\n if (entity instanceof constructors.InputPeerChannel) {\n return new constructors.InputChannel({\n channelId: entity.channelId,\n accessHash: entity.accessHash\n })\n }\n _raiseCastFail(entity, 'InputChannel')\n}\n*/\n/**\n Similar to :meth:`get_input_peer`, but for :tl:`InputUser`'s alone.\n\n .. important::\n\n This method does not validate for invalid general-purpose access\n hashes, unlike `get_input_peer`. Consider using instead:\n ``get_input_channel(get_input_peer(channel))``.\n\n * @param entity\n */\n/* CONTEST\nfunction getInputUser(entity) {\n if (entity.SUBCLASS_OF_ID === undefined) {\n _raiseCastFail(entity, 'InputUser')\n }\n if (entity.SUBCLASS_OF_ID === 0xe669bf46) { // crc32(b'InputUser')\n return entity\n }\n\n if (entity instanceof constructors.User) {\n if (entity.isSelf) {\n return new constructors.InputPeerSelf()\n } else {\n return new constructors.InputUser({\n userId: entity.id,\n accessHash: entity.accessHash || 0,\n })\n }\n }\n if (entity instanceof constructors.InputPeerSelf) {\n return new constructors.InputPeerSelf()\n }\n if (entity instanceof constructors.UserEmpty || entity instanceof constructors.InputPeerEmpty) {\n return new constructors.InputUserEmpty()\n }\n\n if (entity instanceof constructors.UserFull) {\n return getInputUser(entity.user)\n }\n\n if (entity instanceof constructors.InputPeerUser) {\n return new constructors.InputUser({\n userId: entity.userId,\n accessHash: entity.accessHash\n })\n }\n\n _raiseCastFail(entity, 'InputUser')\n}\n*/\n/**\n Similar to :meth:`get_input_peer`, but for dialogs\n * @param dialog\n */\n/* CONTEST\nfunction getInputDialog(dialog) {\n try {\n if (dialog.SUBCLASS_OF_ID === 0xa21c9795) { // crc32(b'InputDialogPeer')\n return dialog\n }\n if (dialog.SUBCLASS_OF_ID === 0xc91c90b6) { // crc32(b'InputPeer')\n return new constructors.InputDialogPeer({ peer: dialog })\n }\n } catch (e) {\n _raiseCastFail(dialog, 'InputDialogPeer')\n }\n\n try {\n return new constructors.InputDialogPeer(getInputPeer(dialog))\n // eslint-disable-next-line no-empty\n } catch (e) {\n\n }\n _raiseCastFail(dialog, 'InputDialogPeer')\n}\n*/\n\n/* CONTEST\n\nfunction getInputMessage(message) {\n try {\n if (typeof message == 'number') { // This case is really common too\n return new constructors.InputMessageID({\n id: message,\n })\n } else if (message.SUBCLASS_OF_ID === 0x54b6bcc5) { // crc32(b'InputMessage')\n return message\n } else if (message.SUBCLASS_OF_ID === 0x790009e3) { // crc32(b'Message')\n return new constructors.InputMessageID(message.id)\n }\n // eslint-disable-next-line no-empty\n } catch (e) {\n }\n\n _raiseCastFail(message, 'InputMessage')\n}\n*/\n\n/**\n * Adds the JPG header and footer to a stripped image.\n * Ported from https://github.com/telegramdesktop/\n * tdesktop/blob/bec39d89e19670eb436dc794a8f20b657cb87c71/Telegram/SourceFiles/ui/image/image.cpp#L225\n\n * @param stripped{Buffer}\n * @returns {Buffer}\n */\nfunction strippedPhotoToJpg(stripped) {\n // Note: Changes here should update _stripped_real_length\n if (stripped.length < 3 || stripped[0] !== 1) {\n return stripped;\n }\n const header = Buffer.from(JPEG_HEADER);\n // eslint-disable-next-line prefer-destructuring\n header[164] = stripped[1];\n // eslint-disable-next-line prefer-destructuring\n header[166] = stripped[2];\n return Buffer.concat([header, stripped.slice(3), JPEG_FOOTER]);\n}\n\n/* CONTEST\nfunction getInputLocation(location) {\n try {\n if (!location.SUBCLASS_OF_ID) {\n throw new Error()\n }\n if (location.SUBCLASS_OF_ID === 0x1523d462) {\n return {\n dcId: null,\n inputLocation: location\n }\n }\n } catch (e) {\n _raiseCastFail(location, 'InputFileLocation')\n }\n if (location instanceof constructors.Message) {\n location = location.media\n }\n\n if (location instanceof constructors.MessageMediaDocument) {\n location = location.document\n } else if (location instanceof constructors.MessageMediaPhoto) {\n location = location.photo\n }\n\n if (location instanceof constructors.Document) {\n return {\n dcId: location.dcId,\n inputLocation: new constructors.InputDocumentFileLocation({\n id: location.id,\n accessHash: location.accessHash,\n fileReference: location.fileReference,\n thumbSize: '', // Presumably to download one of its thumbnails\n }),\n }\n } else if (location instanceof constructors.Photo) {\n return {\n dcId: location.dcId,\n inputLocation: new constructors.InputPhotoFileLocation({\n id: location.id,\n accessHash: location.accessHash,\n fileReference: location.fileReference,\n thumbSize: location.sizes[location.sizes.length - 1].type,\n }),\n }\n }\n\n if (location instanceof constructors.FileLocationToBeDeprecated) {\n throw new Error('Unavailable location cannot be used as input')\n }\n _raiseCastFail(location, 'InputFileLocation')\n}\n*/\n\n/**\n * Gets the appropriated part size when uploading or downloading files,\n * given an initial file size.\n * @param fileSize\n * @returns {Number}\n */\nfunction getAppropriatedPartSize(fileSize) {\n if (fileSize <= 104857600) { // 100MB\n return 128;\n }\n if (fileSize <= 786432000) { // 750MB\n return 256;\n }\n if (fileSize <= 2097152000) { // 2000MB\n return 512;\n }\n\n throw new Error('File size too large');\n}\n\n/* CONTEST\nfunction getPeer(peer) {\n try {\n if (typeof peer === 'number') {\n const res = resolveId(peer)\n\n if (res[1] === constructors.PeerChannel) {\n return new res[1]({ channelId: res[0] })\n } else if (res[1] === constructors.PeerChat) {\n return new res[1]({ chatId: res[0] })\n } else {\n return new res[1]({ userId: res[0] })\n }\n }\n if (peer.SUBCLASS_OF_ID === undefined) {\n throw new Error()\n }\n if (peer.SUBCLASS_OF_ID === 0x2d45687) {\n return peer\n } else if (peer instanceof constructors.contacts.ResolvedPeer ||\n peer instanceof constructors.InputNotifyPeer || peer instanceof constructors.TopPeer ||\n peer instanceof constructors.Dialog || peer instanceof constructors.DialogPeer) {\n return peer.peer\n } else if (peer instanceof constructors.ChannelFull) {\n return new constructors.PeerChannel({ channelId: peer.id })\n }\n if (peer.SUBCLASS_OF_ID === 0x7d7c6f86 || peer.SUBCLASS_OF_ID === 0xd9c7fc18) {\n // ChatParticipant, ChannelParticipant\n return new constructors.PeerUser({ userId: peer.userId })\n }\n peer = getInputPeer(peer, false, false)\n\n if (peer instanceof constructors.InputPeerUser) {\n return new constructors.PeerUser({ userId: peer.userId })\n } else if (peer instanceof constructors.InputPeerChat) {\n return new constructors.PeerChat({ chatId: peer.chatId })\n } else if (peer instanceof constructors.InputPeerChannel) {\n return new constructors.PeerChannel({ channelId: peer.channelId })\n }\n // eslint-disable-next-line no-empty\n } catch (e) {\n console.log(e)\n }\n _raiseCastFail(peer, 'peer')\n}\n*/\n\n/**\n Convert the given peer into its marked ID by default.\n\n This \"mark\" comes from the \"bot api\" format, and with it the peer type\n can be identified back. User ID is left unmodified, chat ID is negated,\n and channel ID is prefixed with -100:\n\n * ``userId``\n * ``-chatId``\n * ``-100channel_id``\n\n The original ID and the peer type class can be returned with\n a call to :meth:`resolve_id(marked_id)`.\n * @param peer\n * @param addMark\n */\n/* CONTEST\nfunction getPeerId(peer, addMark = true) {\n // First we assert it's a Peer TLObject, or early return for integers\n if (typeof peer == 'number') {\n return addMark ? peer : resolveId(peer)[0]\n }\n\n // Tell the user to use their client to resolve InputPeerSelf if we got one\n if (peer instanceof constructors.InputPeerSelf) {\n _raiseCastFail(peer, 'int (you might want to use client.get_peer_id)')\n }\n\n try {\n peer = getPeer(peer)\n } catch (e) {\n _raiseCastFail(peer, 'int')\n }\n if (peer instanceof constructors.PeerUser) {\n return peer.userId\n } else if (peer instanceof constructors.PeerChat) {\n // Check in case the user mixed things up to avoid blowing up\n if (!(0 < peer.chatId <= 0x7fffffff)) {\n peer.chatId = resolveId(peer.chatId)[0]\n }\n\n return addMark ? -(peer.chatId) : peer.chatId\n } else { // if (peer instanceof constructors.PeerChannel)\n // Check in case the user mixed things up to avoid blowing up\n if (!(0 < peer.channelId <= 0x7fffffff)) {\n peer.channelId = resolveId(peer.channelId)[0]\n }\n if (!addMark) {\n return peer.channelId\n }\n // Concat -100 through math tricks, .to_supergroup() on\n // Madeline IDs will be strictly positive -> log works.\n try {\n return -(peer.channelId + Math.pow(10, Math.floor(Math.log10(peer.channelId) + 3)))\n } catch (e) {\n throw new Error('Cannot get marked ID of a channel unless its ID is strictly positive')\n }\n }\n}\n*/\n/**\n * Given a marked ID, returns the original ID and its :tl:`Peer` type.\n * @param markedId\n */\n/* CONTEST\nfunction resolveId(markedId) {\n if (markedId >= 0) {\n return [markedId, constructors.PeerUser]\n }\n\n // There have been report of chat IDs being 10000xyz, which means their\n // marked version is -10000xyz, which in turn looks like a channel but\n // it becomes 00xyz (= xyz). Hence, we must assert that there are only\n // two zeroes.\n const m = markedId.toString()\n .match(/-100([^0]\\d*)/)\n if (m) {\n return [parseInt(m[1]), constructors.PeerChannel]\n }\n return [-markedId, constructors.PeerChat]\n}\n*/\n\n/**\n * returns an entity pair\n * @param entityId\n * @param entities\n * @param cache\n * @param getInputPeer\n * @returns {{inputEntity: *, entity: *}}\n * @private\n */\n\n/* CONTEST\n\nfunction _getEntityPair(entityId, entities, cache, getInputPeer = getInputPeer) {\n const entity = entities.get(entityId)\n let inputEntity = cache[entityId]\n if (inputEntity === undefined) {\n try {\n inputEntity = getInputPeer(inputEntity)\n } catch (e) {\n inputEntity = null\n }\n }\n return {\n entity,\n inputEntity\n }\n}\n*/\n\nfunction getMessageId(message) {\n if (message === undefined) {\n return undefined;\n }\n if (typeof message === 'number') {\n return message;\n }\n if (message.SUBCLASS_OF_ID === 0x790009e3) { // crc32(b'Message')\n return message.id;\n }\n throw new Error(`Invalid message type: ${message.constructor.name}`);\n}\n\n\n/**\n Parses the given username or channel access hash, given\n a string, username or URL. Returns a tuple consisting of\n both the stripped, lowercase username and whether it is\n a joinchat/ hash (in which case is not lowercase'd).\n\n Returns ``(None, False)`` if the ``username`` or link is not valid.\n\n * @param username {string}\n */\n\n/* CONTEST\n\nfunction parseUsername(username) {\n username = username.trim()\n const m = username.match(USERNAME_RE) || username.match(TG_JOIN_RE)\n if (m) {\n username = username.replace(m[0], '')\n if (m[1]) {\n return {\n username: username,\n isInvite: true\n }\n } else {\n username = rtrim(username, '/')\n }\n }\n if (username.match(VALID_USERNAME_RE)) {\n return {\n username: username.toLowerCase(),\n isInvite: false\n }\n } else {\n return {\n username: null,\n isInvite: false\n }\n }\n}\n\nfunction rtrim(s, mask) {\n while (~mask.indexOf(s[s.length - 1])) {\n s = s.slice(0, -1)\n }\n return s\n}\n\n */\n\n/**\n * Gets the display name for the given :tl:`User`,\n :tl:`Chat` or :tl:`Channel`. Returns an empty string otherwise\n * @param entity\n */\nfunction getDisplayName(entity) {\n if (entity instanceof constructors.User) {\n if (entity.lastName && entity.firstName) {\n return `${entity.firstName} ${entity.lastName}`;\n } else if (entity.firstName) {\n return entity.firstName;\n } else if (entity.lastName) {\n return entity.lastName;\n } else {\n return '';\n }\n } else if (entity instanceof constructors.Chat || entity instanceof constructors.Channel) {\n return entity.title;\n }\n return '';\n}\n\n/**\n * check if a given item is an array like or not\n * @param item\n * @returns {boolean}\n */\n\n/* CONTEST\nDuplicate ?\nfunction isListLike(item) {\n return (\n Array.isArray(item) ||\n (!!item &&\n typeof item === 'object' &&\n typeof (item.length) === 'number' &&\n (item.length === 0 ||\n (item.length > 0 &&\n (item.length - 1) in item)\n )\n )\n )\n}\n*/\n/**\n * Returns the appropriate DC based on the id\n * @param dcId the id of the DC.\n * @param downloadDC whether to use -1 DCs or not\n * (These only support downloading/uploading and not creating a new AUTH key)\n * @return {{port: number, ipAddress: string, id: number}}\n */\nfunction getDC(dcId, downloadDC = false) {\n // TODO Move to external config\n switch (dcId) {\n case 1:\n return {\n id: 1,\n ipAddress: `zws1${downloadDC ? '-1' : ''}.web.telegram.org`,\n port: 443,\n };\n case 2:\n return {\n id: 2,\n ipAddress: `zws2${downloadDC ? '-1' : ''}.web.telegram.org`,\n port: 443,\n };\n case 3:\n return {\n id: 3,\n ipAddress: `zws3${downloadDC ? '-1' : ''}.web.telegram.org`,\n port: 443,\n };\n case 4:\n return {\n id: 4,\n ipAddress: `zws4${downloadDC ? '-1' : ''}.web.telegram.org`,\n port: 443,\n };\n case 5:\n return {\n id: 5,\n ipAddress: `zws5${downloadDC ? '-1' : ''}.web.telegram.org`,\n port: 443,\n };\n default:\n throw new Error(`Cannot find the DC with the ID of ${dcId}`);\n }\n // TODO chose based on current connection method\n /*\n if (!this._config) {\n this._config = await this.invoke(new requests.help.GetConfig())\n }\n if (cdn && !this._cdnConfig) {\n this._cdnConfig = await this.invoke(new requests.help.GetCdnConfig())\n for (const pk of this._cdnConfig.publicKeys) {\n addKey(pk.publicKey)\n }\n }\n for (const DC of this._config.dcOptions) {\n if (DC.id === dcId && Boolean(DC.ipv6) === this._useIPV6 && Boolean(DC.cdn) === cdn) {\n return DC\n }\n } */\n}\n\nmodule.exports = {\n getMessageId,\n // _getEntityPair,\n // getInputMessage,\n // getInputDialog,\n // getInputUser,\n // getInputChannel,\n getInputPeer,\n // parsePhone,\n // parseUsername,\n // getPeer,\n // getPeerId,\n getDisplayName,\n // resolveId,\n // isListLike,\n getAppropriatedPartSize,\n // getInputLocation,\n strippedPhotoToJpg,\n getDC,\n};\n","module.exports = '0.0.2';\n","import TelegramClient from './TelegramClient';\n// eslint-disable-next-line import/no-named-default\nimport { default as Api } from '../tl/api';\nimport { generateRandomBytes } from '../Helpers';\nimport { computeCheck, computeDigest } from '../Password';\nimport errors from '../errors';\n\nexport interface TwoFaParams {\n isCheckPassword?: boolean;\n currentPassword?: string;\n newPassword?: string;\n hint?: string;\n email?: string;\n emailCodeCallback?: (length: number) => Promise;\n onEmailCodeError?: (err: Error) => void;\n}\n\n/**\n * Changes the 2FA settings of the logged in user.\n Note that this method may be *incredibly* slow depending on the\n prime numbers that must be used during the process to make sure\n that everything is safe.\n\n Has no effect if both current and new password are omitted.\n\n * @param client: The telegram client instance\n * @param isCheckPassword: Must be ``true`` if you want to check the current password\n * @param currentPassword: The current password, to authorize changing to ``new_password``.\n Must be set if changing existing 2FA settings.\n Must **not** be set if 2FA is currently disabled.\n Passing this by itself will remove 2FA (if correct).\n * @param newPassword: The password to set as 2FA.\n If 2FA was already enabled, ``currentPassword`` **must** be set.\n Leaving this blank or `undefined` will remove the password.\n * @param hint: Hint to be displayed by Telegram when it asks for 2FA.\n Must be set when changing or creating a new password.\n Has no effect if ``newPassword`` is not set.\n * @param email: Recovery and verification email. If present, you must also\n set `emailCodeCallback`, else it raises an Error.\n * @param emailCodeCallback: If an email is provided, a callback that returns the code sent\n to it must also be set. This callback may be asynchronous.\n It should return a string with the code. The length of the\n code will be passed to the callback as an input parameter.\n\n If the callback returns an invalid code, it will raise an rpc error with the message\n ``CODE_INVALID``\n\n * @returns Promise\n * @throws this method can throw:\n \"PASSWORD_HASH_INVALID\" if you entered a wrong password (or set it to undefined).\n \"EMAIL_INVALID\" if the entered email is wrong\n \"EMAIL_HASH_EXPIRED\" if the user took too long to verify their email\n */\nexport async function updateTwoFaSettings(\n client: TelegramClient,\n {\n isCheckPassword,\n currentPassword,\n newPassword,\n hint = '',\n email,\n emailCodeCallback,\n onEmailCodeError,\n }: TwoFaParams,\n) {\n if (!newPassword && !currentPassword) {\n throw new Error('Neither `currentPassword` nor `newPassword` is present');\n }\n\n if (email && !(emailCodeCallback && onEmailCodeError)) {\n throw new Error('`email` present without `emailCodeCallback` and `onEmailCodeError`');\n }\n\n const pwd = await client.invoke(new Api.account.GetPassword());\n\n if (!(pwd.newAlgo instanceof Api.PasswordKdfAlgoUnknown)) {\n pwd.newAlgo.salt1 = Buffer.concat([pwd.newAlgo.salt1, generateRandomBytes(32)]);\n }\n if (!pwd.hasPassword && currentPassword) {\n currentPassword = undefined;\n }\n\n const password = currentPassword ? await computeCheck(pwd, currentPassword!) : new Api.InputCheckPasswordEmpty();\n\n if (isCheckPassword) {\n await client.invoke(new Api.auth.CheckPassword({ password }));\n return;\n }\n\n try {\n await client.invoke(new Api.account.UpdatePasswordSettings({\n password,\n newSettings: new Api.account.PasswordInputSettings({\n newAlgo: pwd.newAlgo,\n newPasswordHash: newPassword ? await computeDigest(pwd.newAlgo, newPassword) : Buffer.alloc(0),\n hint,\n email,\n // not explained what it does and it seems to always be set to empty in tdesktop\n newSecureSettings: undefined,\n }),\n }));\n } catch (e) {\n if (e instanceof errors.EmailUnconfirmedError) {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n try {\n const code = await emailCodeCallback!(e.codeLength);\n\n if (!code) {\n throw new Error('Code is empty');\n }\n\n await client.invoke(new Api.account.ConfirmPasswordEmail({ code }));\n break;\n } catch (err) {\n onEmailCodeError!(err);\n }\n }\n } else {\n throw e;\n }\n }\n}\n","const os = require('os');\nconst Logger = require('../extensions/Logger');\nconst { sleep } = require('../Helpers');\nconst errors = require('../errors');\nconst MemorySession = require('../sessions/Memory');\nconst Helpers = require('../Helpers');\nconst utils = require('../Utils');\nconst Session = require('../sessions/Abstract');\nconst { LAYER } = require('../tl/AllTLObjects');\nconst {\n constructors,\n requests,\n} = require('../tl');\nconst MTProtoSender = require('../network/MTProtoSender');\nconst { ConnectionTCPObfuscated } = require('../network/connection/TCPObfuscated');\nconst {\n authFlow,\n checkAuthorization,\n} = require('./auth');\nconst { downloadFile } = require('./downloadFile');\nconst { uploadFile } = require('./uploadFile');\nconst { updateTwoFaSettings } = require('./2fa');\n\nconst DEFAULT_DC_ID = 2;\nconst WEBDOCUMENT_DC_ID = 4;\nconst DEFAULT_IPV4_IP = 'zws2.web.telegram.org';\nconst DEFAULT_IPV6_IP = '[2001:67c:4e8:f002::a]';\nconst EXPORTED_SENDER_RECONNECT_TIMEOUT = 1000; // 1 sec\nconst EXPORTED_SENDER_RELEASE_TIMEOUT = 30000; // 30 sec\nconst WEBDOCUMENT_REQUEST_PART_SIZE = 131072; // 128kb\n\nconst PING_INTERVAL = 3000; // 3 sec\nconst PING_TIMEOUT = 5000; // 5 sec\nconst PING_FAIL_ATTEMPTS = 3;\nconst PING_FAIL_INTERVAL = 100; // ms\nconst PING_DISCONNECT_DELAY = 60000; // 1 min\n\n// All types\nconst sizeTypes = ['w', 'y', 'd', 'x', 'c', 'm', 'b', 'a', 's'];\n\n\nclass TelegramClient {\n static DEFAULT_OPTIONS = {\n connection: ConnectionTCPObfuscated,\n useIPV6: false,\n proxy: undefined,\n timeout: 10,\n requestRetries: 5,\n connectionRetries: Infinity,\n retryDelay: 1000,\n autoReconnect: true,\n sequentialUpdates: false,\n floodSleepLimit: 60,\n deviceModel: undefined,\n systemVersion: undefined,\n appVersion: undefined,\n langCode: 'en',\n systemLangCode: 'en',\n baseLogger: 'gramjs',\n useWSS: false,\n additionalDcsDisabled: false,\n };\n\n /**\n *\n * @param session {StringSession|LocalStorageSession}\n * @param apiId\n * @param apiHash\n * @param opts\n */\n constructor(session, apiId, apiHash, opts = TelegramClient.DEFAULT_OPTIONS) {\n if (!apiId || !apiHash) {\n throw Error('Your API ID or Hash are invalid. Please read \"Requirements\" on README.md');\n }\n const args = { ...TelegramClient.DEFAULT_OPTIONS, ...opts };\n this.apiId = apiId;\n this.apiHash = apiHash;\n this._useIPV6 = args.useIPV6;\n // this._entityCache = new Set()\n if (typeof args.baseLogger === 'string') {\n this._log = new Logger();\n } else {\n this._log = args.baseLogger;\n }\n // Determine what session we will use\n if (typeof session === 'string' || !session) {\n try {\n throw new Error('not implemented');\n } catch (e) {\n session = new MemorySession();\n }\n } else if (!(session instanceof Session)) {\n throw new Error('The given session must be str or a session instance');\n }\n\n this.floodSleepLimit = args.floodSleepLimit;\n this._eventBuilders = [];\n\n this._phoneCodeHash = {};\n this.session = session;\n // this._entityCache = EntityCache();\n this.apiId = parseInt(apiId, 10);\n this.apiHash = apiHash;\n\n this._requestRetries = args.requestRetries;\n this._connectionRetries = args.connectionRetries;\n this._retryDelay = args.retryDelay || 0;\n if (args.proxy) {\n this._log.warn('proxies are not supported');\n }\n this._proxy = args.proxy;\n this._timeout = args.timeout;\n this._autoReconnect = args.autoReconnect;\n\n this._connection = args.connection;\n // TODO add proxy support\n\n this._floodWaitedRequests = {};\n\n this._initWith = (x) => {\n return new requests.InvokeWithLayer({\n layer: LAYER,\n query: new requests.InitConnection({\n apiId: this.apiId,\n deviceModel: args.deviceModel || os.type()\n .toString() || 'Unknown',\n systemVersion: args.systemVersion || os.release()\n .toString() || '1.0',\n appVersion: args.appVersion || '1.0',\n langCode: args.langCode,\n langPack: '', // this should be left empty.\n systemLangCode: args.systemLangCode,\n query: x,\n proxy: undefined, // no proxies yet.\n }),\n });\n };\n\n this._args = args;\n // These will be set later\n this._config = undefined;\n this.phoneCodeHashes = [];\n this._exportedSenderPromises = {};\n this._exportedSenderReleaseTimeouts = {};\n this._additionalDcsDisabled = args.additionalDcsDisabled;\n this._loopStarted = false;\n this._reconnecting = false;\n this._destroyed = false;\n }\n\n\n // region Connecting\n\n /**\n * Connects to the Telegram servers, executing authentication if required.\n * Note that authenticating to the Telegram servers is not the same as authenticating\n * the app, which requires to send a code first.\n * @returns {Promise}\n */\n async connect() {\n await this._initSession();\n\n if (this._sender === undefined) {\n // only init sender once to avoid multiple loops.\n this._sender = new MTProtoSender(this.session.getAuthKey(), {\n logger: this._log,\n dcId: this.session.dcId,\n retries: this._connectionRetries,\n delay: this._retryDelay,\n autoReconnect: this._autoReconnect,\n connectTimeout: this._timeout,\n authKeyCallback: this._authKeyCallback.bind(this),\n updateCallback: this._handleUpdate.bind(this),\n isMainSender: true,\n });\n }\n // set defaults vars\n this._sender.userDisconnected = false;\n this._sender._user_connected = false;\n this._sender._reconnecting = false;\n this._sender._disconnected = true;\n\n const connection = new this._connection(\n this.session.serverAddress, this.session.port, this.session.dcId, this._log,\n );\n\n const newConnection = await this._sender.connect(connection);\n if (!newConnection) {\n // we're already connected so no need to reset auth key.\n if (!this._loopStarted) {\n this._updateLoop();\n this._loopStarted = true;\n }\n return;\n }\n\n this.session.setAuthKey(this._sender.authKey);\n await this._sender.send(this._initWith(\n new requests.help.GetConfig({}),\n ));\n\n if (!this._loopStarted) {\n this._updateLoop();\n this._loopStarted = true;\n }\n this._reconnecting = false;\n }\n\n async _initSession() {\n await this.session.load();\n\n if (!this.session.serverAddress || (this.session.serverAddress.includes(':') !== this._useIPV6)) {\n this.session.setDC(DEFAULT_DC_ID, this._useIPV6\n ? DEFAULT_IPV6_IP : DEFAULT_IPV4_IP, this._args.useWSS ? 443 : 80);\n }\n }\n\n async _updateLoop() {\n while (!this._destroyed) {\n await Helpers.sleep(PING_INTERVAL);\n if (this._reconnecting) {\n continue;\n }\n\n try {\n await attempts(() => {\n return timeout(this._sender.send(new requests.PingDelayDisconnect({\n pingId: Helpers.getRandomInt(Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER),\n disconnectDelay: PING_DISCONNECT_DELAY,\n })), PING_TIMEOUT);\n }, PING_FAIL_ATTEMPTS, PING_FAIL_INTERVAL);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n if (this._reconnecting) {\n continue;\n }\n\n await this.disconnect();\n await this.connect();\n }\n\n // We need to send some content-related request at least hourly\n // for Telegram to keep delivering updates, otherwise they will\n // just stop even if we're connected. Do so every 30 minutes.\n\n // TODO Call getDifference instead since it's more relevant\n if (new Date().getTime() - this._lastRequest > 30 * 60 * 1000) {\n try {\n await this.invoke(new requests.updates.GetState());\n } catch (e) {\n // we don't care about errors here\n }\n }\n }\n await this.disconnect();\n }\n\n /**\n * Disconnects from the Telegram server\n * @returns {Promise}\n */\n async disconnect() {\n if (this._sender) {\n await this._sender.disconnect();\n }\n\n await Promise.all(\n Object.values(this._exportedSenderPromises)\n .map((promise) => {\n return promise && promise.then((sender) => {\n if (sender) {\n return sender.disconnect();\n }\n return undefined;\n });\n }),\n );\n\n this._exportedSenderPromises = {};\n }\n\n /**\n * Disconnects all senders and removes all handlers\n * @returns {Promise}\n */\n async destroy() {\n this._destroyed = true;\n\n try {\n await this.disconnect();\n } catch (err) {\n // Do nothing\n }\n\n this.session.delete();\n this._eventBuilders = [];\n }\n\n async _switchDC(newDc) {\n this._log.info(`Reconnecting to new data center ${newDc}`);\n const DC = utils.getDC(newDc);\n this.session.setDC(newDc, DC.ipAddress, DC.port);\n // authKey's are associated with a server, which has now changed\n // so it's not valid anymore. Set to None to force recreating it.\n await this._sender.authKey.setKey(undefined);\n this.session.setAuthKey(undefined);\n this._reconnecting = true;\n await this.disconnect();\n return this.connect();\n }\n\n _authKeyCallback(authKey, dcId) {\n this.session.setAuthKey(authKey, dcId);\n }\n\n // endregion\n // export region\n\n async _cleanupExportedSender(dcId) {\n if (this.session.dcId !== dcId) {\n this.session.setAuthKey(undefined, dcId);\n }\n const sender = await this._exportedSenderPromises[dcId];\n this._exportedSenderPromises[dcId] = undefined;\n await sender.disconnect();\n }\n\n async _connectSender(sender, dcId) {\n // if we don't already have an auth key we want to use normal DCs not -1\n const dc = utils.getDC(dcId, !!sender.authKey.getKey());\n\n while (true) {\n try {\n await sender.connect(new this._connection(\n dc.ipAddress,\n dc.port,\n dcId,\n this._log,\n ));\n\n if (this.session.dcId !== dcId && !sender._authenticated) {\n this._log.info(`Exporting authorization for data center ${dc.ipAddress}`);\n const auth = await this.invoke(new requests.auth.ExportAuthorization({ dcId }));\n const req = this._initWith(new requests.auth.ImportAuthorization({\n id: auth.id,\n bytes: auth.bytes,\n }));\n await sender.send(req);\n sender._authenticated = true;\n }\n sender.dcId = dcId;\n sender.userDisconnected = false;\n\n return sender;\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n\n await Helpers.sleep(1000);\n await sender.disconnect();\n }\n }\n }\n\n async _borrowExportedSender(dcId, shouldReconnect, existingSender) {\n if (this._additionalDcsDisabled) {\n return undefined;\n }\n\n if (!this._exportedSenderPromises[dcId] || shouldReconnect) {\n this._exportedSenderPromises[dcId] = this._connectSender(\n existingSender || this._createExportedSender(dcId),\n dcId,\n );\n }\n\n let sender;\n try {\n sender = await this._exportedSenderPromises[dcId];\n\n if (!sender.isConnected()) {\n if (sender.isConnecting) {\n await Helpers.sleep(EXPORTED_SENDER_RECONNECT_TIMEOUT);\n return this._borrowExportedSender(dcId, false, sender);\n } else {\n return this._borrowExportedSender(dcId, true, sender);\n }\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n\n return this._borrowExportedSender(dcId, true);\n }\n\n if (this._exportedSenderReleaseTimeouts[dcId]) {\n clearTimeout(this._exportedSenderReleaseTimeouts[dcId]);\n this._exportedSenderReleaseTimeouts[dcId] = undefined;\n }\n\n this._exportedSenderReleaseTimeouts[dcId] = setTimeout(() => {\n this._exportedSenderReleaseTimeouts[dcId] = undefined;\n sender.disconnect();\n }, EXPORTED_SENDER_RELEASE_TIMEOUT);\n\n return sender;\n }\n\n _createExportedSender(dcId) {\n return new MTProtoSender(this.session.getAuthKey(dcId), {\n logger: this._log,\n dcId,\n retries: this._connectionRetries,\n delay: this._retryDelay,\n autoReconnect: this._autoReconnect,\n connectTimeout: this._timeout,\n authKeyCallback: this._authKeyCallback.bind(this),\n isMainSender: dcId === this.session.dcId,\n onConnectionBreak: this._cleanupExportedSender.bind(this),\n });\n }\n\n getSender(dcId) {\n return dcId ? this._borrowExportedSender(dcId) : Promise.resolve(this._sender);\n }\n\n // end region\n\n // download region\n\n /**\n * Complete flow to download a file.\n * @param inputLocation {constructors.InputFileLocation}\n * @param [args[partSizeKb] {number}]\n * @param [args[fileSize] {number}]\n * @param [args[progressCallback] {Function}]\n * @param [args[start] {number}]\n * @param [args[end] {number}]\n * @param [args[dcId] {number}]\n * @param [args[workers] {number}]\n * @returns {Promise}\n */\n downloadFile(inputLocation, args = {}) {\n return downloadFile(this, inputLocation, args);\n }\n\n downloadMedia(messageOrMedia, args) {\n let media;\n if (messageOrMedia instanceof constructors.Message) {\n media = messageOrMedia.media;\n } else {\n media = messageOrMedia;\n }\n if (typeof media === 'string') {\n throw new Error('not implemented');\n }\n\n if (media instanceof constructors.MessageMediaWebPage) {\n if (media.webpage instanceof constructors.WebPage) {\n media = media.webpage.document || media.webpage.photo;\n }\n }\n if (media instanceof constructors.MessageMediaPhoto || media instanceof constructors.Photo) {\n return this._downloadPhoto(media, args);\n } else if (media instanceof constructors.MessageMediaDocument || media instanceof constructors.Document) {\n return this._downloadDocument(media, args);\n } else if (media instanceof constructors.MessageMediaContact) {\n return this._downloadContact(media, args);\n } else if (media instanceof constructors.WebDocument || media instanceof constructors.WebDocumentNoProxy) {\n return this._downloadWebDocument(media, args);\n }\n return undefined;\n }\n\n downloadProfilePhoto(entity, isBig = false) {\n // ('User', 'Chat', 'UserFull', 'ChatFull')\n const ENTITIES = [0x2da17977, 0xc5af5d94, 0x1f4661b9, 0xd49a2697];\n // ('InputPeer', 'InputUser', 'InputChannel')\n // const INPUTS = [0xc91c90b6, 0xe669bf46, 0x40f202fd]\n // Todo account for input methods\n const sizeType = isBig ? 'x' : 'm';\n let photo;\n if (!(ENTITIES.includes(entity.SUBCLASS_OF_ID))) {\n photo = entity;\n } else {\n if (!entity.photo) {\n // Special case: may be a ChatFull with photo:Photo\n if (!entity.chatPhoto) {\n return undefined;\n }\n\n return this._downloadPhoto(\n entity.chatPhoto, { sizeType },\n );\n }\n photo = entity.photo;\n }\n\n let dcId;\n let loc;\n if (photo instanceof constructors.UserProfilePhoto || photo instanceof constructors.ChatPhoto) {\n dcId = photo.dcId;\n loc = new constructors.InputPeerPhotoFileLocation({\n peer: utils.getInputPeer(entity),\n photoId: photo.photoId,\n big: isBig,\n });\n } else {\n // It doesn't make any sense to check if `photo` can be used\n // as input location, because then this method would be able\n // to \"download the profile photo of a message\", i.e. its\n // media which should be done with `download_media` instead.\n return undefined;\n }\n return this.downloadFile(loc, {\n dcId,\n });\n }\n\n downloadStickerSetThumb(stickerSet) {\n if (!stickerSet.thumbs || !stickerSet.thumbs.length) {\n return undefined;\n }\n\n const { thumbVersion } = stickerSet;\n return this.downloadFile(\n new constructors.InputStickerSetThumb({\n stickerset: new constructors.InputStickerSetID({\n id: stickerSet.id,\n accessHash: stickerSet.accessHash,\n }),\n thumbVersion,\n }),\n { dcId: stickerSet.thumbDcId },\n );\n }\n\n _pickFileSize(sizes, sizeType) {\n if (!sizeType || !sizes || !sizes.length) {\n return undefined;\n }\n const indexOfSize = sizeTypes.indexOf(sizeType);\n let size;\n for (let i = indexOfSize; i < sizeTypes.length; i++) {\n size = sizes.find((s) => s.type === sizeTypes[i]);\n if (size) {\n return size;\n }\n }\n return undefined;\n }\n\n\n _downloadCachedPhotoSize(size) {\n // No need to download anything, simply write the bytes\n let data;\n if (size instanceof constructors.PhotoStrippedSize) {\n data = utils.strippedPhotoToJpg(size.bytes);\n } else {\n data = size.bytes;\n }\n return data;\n }\n\n _downloadPhoto(photo, args) {\n if (photo instanceof constructors.MessageMediaPhoto) {\n photo = photo.photo;\n }\n if (!(photo instanceof constructors.Photo)) {\n return undefined;\n }\n const size = this._pickFileSize(photo.sizes, args.sizeType);\n if (!size || (size instanceof constructors.PhotoSizeEmpty)) {\n return undefined;\n }\n\n if (size instanceof constructors.PhotoCachedSize || size instanceof constructors.PhotoStrippedSize) {\n return this._downloadCachedPhotoSize(size);\n }\n return this.downloadFile(\n new constructors.InputPhotoFileLocation({\n id: photo.id,\n accessHash: photo.accessHash,\n fileReference: photo.fileReference,\n thumbSize: size.type,\n }),\n {\n dcId: photo.dcId,\n fileSize: size.size,\n progressCallback: args.progressCallback,\n },\n );\n }\n\n _downloadDocument(doc, args) {\n if (doc instanceof constructors.MessageMediaDocument) {\n doc = doc.document;\n }\n if (!(doc instanceof constructors.Document)) {\n return undefined;\n }\n\n let size;\n if (args.sizeType) {\n size = doc.thumbs ? this._pickFileSize(doc.thumbs, args.sizeType) : undefined;\n if (!size && doc.mimeType.startsWith('video/')) {\n return undefined;\n }\n\n if (size && (size instanceof constructors.PhotoCachedSize\n || size instanceof constructors.PhotoStrippedSize)) {\n return this._downloadCachedPhotoSize(size);\n }\n }\n\n return this.downloadFile(\n new constructors.InputDocumentFileLocation({\n id: doc.id,\n accessHash: doc.accessHash,\n fileReference: doc.fileReference,\n thumbSize: size ? size.type : '',\n }),\n {\n fileSize: size ? size.size : doc.size,\n progressCallback: args.progressCallback,\n start: args.start,\n end: args.end,\n dcId: doc.dcId,\n workers: args.workers,\n },\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _downloadContact(media, args) {\n throw new Error('not implemented');\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async _downloadWebDocument(media) {\n try {\n const buff = [];\n let offset = 0;\n while (true) {\n const downloaded = new requests.upload.GetWebFile({\n location: new constructors.InputWebFileLocation({\n url: media.url,\n accessHash: media.accessHash,\n }),\n offset,\n limit: WEBDOCUMENT_REQUEST_PART_SIZE,\n });\n const sender = await this._borrowExportedSender(WEBDOCUMENT_DC_ID);\n const res = await sender.send(downloaded);\n offset += 131072;\n if (res.bytes.length) {\n buff.push(res.bytes);\n if (res.bytes.length < WEBDOCUMENT_REQUEST_PART_SIZE) {\n break;\n }\n } else {\n break;\n }\n }\n return Buffer.concat(buff);\n } catch (e) {\n // the file is no longer saved in telegram's cache.\n if (e.message === 'WEBFILE_NOT_AVAILABLE') {\n return Buffer.alloc(0);\n } else {\n throw e;\n }\n }\n }\n\n // region Invoking Telegram request\n /**\n * Invokes a MTProtoRequest (sends and receives it) and returns its result\n * @param request\n * @returns {Promise}\n */\n\n async invoke(request) {\n if (request.classType !== 'request') {\n throw new Error('You can only invoke MTProtoRequests');\n }\n // This causes issues for now because not enough utils\n // await request.resolve(this, utils)\n\n\n this._lastRequest = new Date().getTime();\n let attempt = 0;\n for (attempt = 0; attempt < this._requestRetries; attempt++) {\n const promise = this._sender.sendWithInvokeSupport(request);\n try {\n const result = await promise.promise;\n return result;\n } catch (e) {\n if (e instanceof errors.ServerError || e.message === 'RPC_CALL_FAIL'\n || e.message === 'RPC_MCGET_FAIL') {\n this._log.warn(`Telegram is having internal issues ${e.constructor.name}`);\n await sleep(2000);\n } else if (e instanceof errors.FloodWaitError || e instanceof errors.FloodTestPhoneWaitError) {\n if (e.seconds <= this.floodSleepLimit) {\n this._log.info(`Sleeping for ${e.seconds}s on flood wait`);\n await sleep(e.seconds * 1000);\n } else {\n throw e;\n }\n } else if (e instanceof errors.PhoneMigrateError || e instanceof errors.NetworkMigrateError\n || e instanceof errors.UserMigrateError) {\n this._log.info(`Phone migrated to ${e.newDc}`);\n const shouldRaise = e instanceof errors.PhoneMigrateError\n || e instanceof errors.NetworkMigrateError;\n if (shouldRaise && await checkAuthorization(this)) {\n throw e;\n }\n await this._switchDC(e.newDc);\n } else if (e instanceof errors.MsgWaitError) {\n // we need to resend this after the old one was confirmed.\n await promise.isReady();\n } else {\n throw e;\n }\n }\n }\n throw new Error(`Request was unsuccessful ${attempt} time(s)`);\n }\n\n async getMe() {\n try {\n return (await this.invoke(new requests.users\n .GetUsers({ id: [new constructors.InputUserSelf()] })))[0];\n } catch (e) {\n this._log.warn('error while getting me');\n this._log.warn(e);\n }\n return undefined;\n }\n\n async start(authParams) {\n if (!this.isConnected()) {\n await this.connect();\n }\n\n if (await checkAuthorization(this)) {\n return;\n }\n\n const apiCredentials = {\n apiId: this.apiId,\n apiHash: this.apiHash,\n };\n\n await authFlow(this, apiCredentials, authParams);\n }\n\n uploadFile(fileParams) {\n return uploadFile(this, fileParams);\n }\n\n updateTwoFaSettings(params) {\n return updateTwoFaSettings(this, params);\n }\n\n // event region\n addEventHandler(callback, event) {\n this._eventBuilders.push([event, callback]);\n }\n\n _handleUpdate(update) {\n // this.session.processEntities(update)\n // this._entityCache.add(update)\n\n if (update instanceof constructors.Updates || update instanceof constructors.UpdatesCombined) {\n // TODO deal with entities\n const entities = [];\n for (const x of [...update.users, ...update.chats]) {\n entities.push(x);\n }\n for (const u of update.updates) {\n this._processUpdate(u, update.updates, entities);\n }\n } else if (update instanceof constructors.UpdateShort) {\n this._processUpdate(update.update, undefined);\n } else {\n this._processUpdate(update, undefined);\n }\n // TODO add caching\n // this._stateCache.update(update)\n }\n\n _processUpdate(update, others, entities) {\n update._entities = entities || [];\n const args = {\n update,\n others,\n };\n this._dispatchUpdate(args);\n }\n\n\n // endregion\n\n // region private methods\n\n /**\n Gets a full entity from the given string, which may be a phone or\n a username, and processes all the found entities on the session.\n The string may also be a user link, or a channel/chat invite link.\n\n This method has the side effect of adding the found users to the\n session database, so it can be queried later without API calls,\n if this option is enabled on the session.\n\n Returns the found entity, or raises TypeError if not found.\n * @param string {string}\n * @returns {Promise}\n * @private\n */\n /* CONTEST\n async _getEntityFromString(string) {\n const phone = utils.parsePhone(string)\n if (phone) {\n try {\n for (const user of (await this.invoke(\n new requests.contacts.GetContacts(0))).users) {\n if (user.phone === phone) {\n return user\n }\n }\n } catch (e) {\n if (e.message === 'BOT_METHOD_INVALID') {\n throw new Error('Cannot get entity by phone number as a ' +\n 'bot (try using integer IDs, not strings)')\n }\n throw e\n }\n } else if (['me', 'this'].includes(string.toLowerCase())) {\n return this.getMe()\n } else {\n const { username, isJoinChat } = utils.parseUsername(string)\n if (isJoinChat) {\n const invite = await this.invoke(new requests.messages.CheckChatInvite({\n 'hash': username,\n }))\n if (invite instanceof constructors.ChatInvite) {\n throw new Error('Cannot get entity from a channel (or group) ' +\n 'that you are not part of. Join the group and retry',\n )\n } else if (invite instanceof constructors.ChatInviteAlready) {\n return invite.chat\n }\n } else if (username) {\n try {\n const result = await this.invoke(\n new requests.contacts.ResolveUsername(username))\n const pid = utils.getPeerId(result.peer, false)\n if (result.peer instanceof constructors.PeerUser) {\n for (const x of result.users) {\n if (x.id === pid) {\n return x\n }\n }\n } else {\n for (const x of result.chats) {\n if (x.id === pid) {\n return x\n }\n }\n }\n } catch (e) {\n if (e.message === 'USERNAME_NOT_OCCUPIED') {\n throw new Error(`No user has \"${username}\" as username`)\n }\n throw e\n }\n }\n }\n throw new Error(`Cannot find any entity corresponding to \"${string}\"`)\n }\n */\n // endregion\n\n\n // users region\n /**\n Turns the given entity into its input entity version.\n\n Most requests use this kind of :tl:`InputPeer`, so this is the most\n suitable call to make for those cases. **Generally you should let the\n library do its job** and don't worry about getting the input entity\n first, but if you're going to use an entity often, consider making the\n call:\n\n Arguments\n entity (`str` | `int` | :tl:`Peer` | :tl:`InputPeer`):\n If a username or invite link is given, **the library will\n use the cache**. This means that it's possible to be using\n a username that *changed* or an old invite link (this only\n happens if an invite link for a small group chat is used\n after it was upgraded to a mega-group).\n\n If the username or ID from the invite link is not found in\n the cache, it will be fetched. The same rules apply to phone\n numbers (``'+34 123456789'``) from people in your contact list.\n\n If an exact name is given, it must be in the cache too. This\n is not reliable as different people can share the same name\n and which entity is returned is arbitrary, and should be used\n only for quick tests.\n\n If a positive integer ID is given, the entity will be searched\n in cached users, chats or channels, without making any call.\n\n If a negative integer ID is given, the entity will be searched\n exactly as either a chat (prefixed with ``-``) or as a channel\n (prefixed with ``-100``).\n\n If a :tl:`Peer` is given, it will be searched exactly in the\n cache as either a user, chat or channel.\n\n If the given object can be turned into an input entity directly,\n said operation will be done.\n\n Unsupported types will raise ``TypeError``.\n\n If the entity can't be found, ``ValueError`` will be raised.\n\n Returns\n :tl:`InputPeerUser`, :tl:`InputPeerChat` or :tl:`InputPeerChannel`\n or :tl:`InputPeerSelf` if the parameter is ``'me'`` or ``'self'``.\n\n If you need to get the ID of yourself, you should use\n `get_me` with ``input_peer=True``) instead.\n\n Example\n .. code-block:: python\n\n // If you're going to use \"username\" often in your code\n // (make a lot of calls), consider getting its input entity\n // once, and then using the \"user\" everywhere instead.\n user = await client.get_input_entity('username')\n\n // The same applies to IDs, chats or channels.\n chat = await client.get_input_entity(-123456789)\n\n * @param peer\n * @returns {Promise<>}\n */\n\n /* CONTEST\n async getInputEntity(peer) {\n // Short-circuit if the input parameter directly maps to an InputPeer\n try {\n return utils.getInputPeer(peer)\n // eslint-disable-next-line no-empty\n } catch (e) {\n }\n // Next in priority is having a peer (or its ID) cached in-memory\n try {\n // 0x2d45687 == crc32(b'Peer')\n if (typeof peer === 'number' || peer.SUBCLASS_OF_ID === 0x2d45687) {\n if (this._entityCache.has(peer)) {\n return this._entityCache[peer]\n }\n }\n // eslint-disable-next-line no-empty\n } catch (e) {\n }\n // Then come known strings that take precedence\n if (['me', 'this'].includes(peer)) {\n return new constructors.InputPeerSelf()\n }\n // No InputPeer, cached peer, or known string. Fetch from disk cache\n try {\n return this.session.getInputEntity(peer)\n // eslint-disable-next-line no-empty\n } catch (e) {\n }\n // Only network left to try\n if (typeof peer === 'string') {\n return utils.getInputPeer(await this._getEntityFromString(peer))\n }\n // If we're a bot and the user has messaged us privately users.getUsers\n // will work with accessHash = 0. Similar for channels.getChannels.\n // If we're not a bot but the user is in our contacts, it seems to work\n // regardless. These are the only two special-cased requests.\n peer = utils.getPeer(peer)\n if (peer instanceof constructors.PeerUser) {\n const users = await this.invoke(new requests.users.GetUsers({\n id: [new constructors.InputUser({\n userId: peer.userId,\n accessHash: 0,\n })],\n }))\n if (users && !(users[0] instanceof constructors.UserEmpty)) {\n // If the user passed a valid ID they expect to work for\n // channels but would be valid for users, we get UserEmpty.\n // Avoid returning the invalid empty input peer for that.\n //\n // We *could* try to guess if it's a channel first, and if\n // it's not, work as a chat and try to validate it through\n // another request, but that becomes too much work.\n return utils.getInputPeer(users[0])\n }\n } else if (peer instanceof constructors.PeerChat) {\n return new constructors.InputPeerChat({\n chatId: peer.chatId,\n })\n } else if (peer instanceof constructors.PeerChannel) {\n try {\n const channels = await this.invoke(new requests.channels.GetChannels({\n id: [new constructors.InputChannel({\n channelId: peer.channelId,\n accessHash: 0,\n })],\n }))\n\n return utils.getInputPeer(channels.chats[0])\n // eslint-disable-next-line no-empty\n } catch (e) {\n console.log(e)\n }\n }\n throw new Error(`Could not find the input entity for ${peer.id || peer.channelId || peer.chatId || peer.userId}.\n Please read https://` +\n 'docs.telethon.dev/en/latest/concepts/entities.html to' +\n ' find out more details.',\n )\n }\n */\n async _dispatchUpdate(args = {\n update: undefined,\n others: undefined,\n channelId: undefined,\n ptsDate: undefined,\n }) {\n for (const [builder, callback] of this._eventBuilders) {\n const event = builder.build(args.update);\n if (event) {\n await callback(event);\n }\n }\n }\n\n isConnected() {\n if (this._sender) {\n if (this._sender.isConnected()) {\n return true;\n }\n }\n return false;\n }\n}\n\nfunction timeout(promise, ms) {\n return Promise.race([\n promise,\n Helpers.sleep(ms)\n .then(() => Promise.reject(new Error('TIMEOUT'))),\n ]);\n}\n\nasync function attempts(cb, times, pause) {\n for (let i = 0; i < times; i++) {\n try {\n // We need to `return await` here so it can be caught locally\n return await cb();\n } catch (err) {\n if (i === times - 1) {\n throw err;\n }\n\n await Helpers.sleep(pause);\n }\n }\n return undefined;\n}\n\nmodule.exports = TelegramClient;\n","// eslint-disable-next-line import/no-named-default\nimport { default as Api } from '../tl/api';\nimport TelegramClient from './TelegramClient';\nimport utils from '../Utils';\nimport { sleep } from '../Helpers';\nimport { computeCheck as computePasswordSrpCheck } from '../Password';\n\nexport interface UserAuthParams {\n phoneNumber: string | (() => Promise);\n phoneCode: (isCodeViaApp?: boolean) => Promise;\n password: (hint?: string) => Promise;\n firstAndLastNames: () => Promise<[string, string?]>;\n qrCode: (qrCode: { token: Buffer; expires: number }) => Promise;\n onError: (err: Error) => void;\n forceSMS?: boolean;\n initialMethod?: 'phoneNumber' | 'qrCode';\n}\n\nexport interface BotAuthParams {\n botAuthToken: string;\n}\n\ninterface ApiCredentials {\n apiId: number;\n apiHash: string;\n}\n\nconst DEFAULT_INITIAL_METHOD = 'phoneNumber';\nconst QR_CODE_TIMEOUT = 30000;\n\nexport async function authFlow(\n client: TelegramClient,\n apiCredentials: ApiCredentials,\n authParams: UserAuthParams | BotAuthParams,\n) {\n let me: Api.TypeUser;\n\n if ('botAuthToken' in authParams) {\n me = await signInBot(client, apiCredentials, authParams);\n } else {\n const { initialMethod = DEFAULT_INITIAL_METHOD } = authParams;\n\n if (initialMethod === 'phoneNumber') {\n me = await signInUser(client, apiCredentials, authParams);\n } else {\n me = await signInUserWithQrCode(client, apiCredentials, authParams);\n }\n }\n\n client._log.info('Signed in successfully as', utils.getDisplayName(me));\n}\n\nexport async function checkAuthorization(client: TelegramClient) {\n try {\n await client.invoke(new Api.updates.GetState());\n return true;\n } catch (e) {\n if (e.message === 'Disconnect') throw e;\n return false;\n }\n}\n\nasync function signInUser(\n client: TelegramClient, apiCredentials: ApiCredentials, authParams: UserAuthParams,\n): Promise {\n let phoneNumber;\n let phoneCodeHash;\n let isCodeViaApp = false;\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n try {\n if (typeof authParams.phoneNumber === 'function') {\n try {\n phoneNumber = await authParams.phoneNumber();\n } catch (err) {\n if (err.message === 'RESTART_AUTH_WITH_QR') {\n return signInUserWithQrCode(client, apiCredentials, authParams);\n }\n\n throw err;\n }\n } else {\n phoneNumber = authParams.phoneNumber;\n }\n const sendCodeResult = await sendCode(client, apiCredentials, phoneNumber, authParams.forceSMS);\n phoneCodeHash = sendCodeResult.phoneCodeHash;\n isCodeViaApp = sendCodeResult.isCodeViaApp;\n\n if (typeof phoneCodeHash !== 'string') {\n throw new Error('Failed to retrieve phone code hash');\n }\n\n break;\n } catch (err) {\n if (typeof authParams.phoneNumber !== 'function') {\n throw err;\n }\n\n authParams.onError(err);\n }\n }\n\n let phoneCode;\n let isRegistrationRequired = false;\n let termsOfService;\n\n // eslint-disable-next-line no-constant-condition\n while (1) {\n try {\n try {\n phoneCode = await authParams.phoneCode(isCodeViaApp);\n } catch (err) {\n // This is the support for changing phone number from the phone code screen.\n if (err.message === 'RESTART_AUTH') {\n return signInUser(client, apiCredentials, authParams);\n }\n }\n\n if (!phoneCode) {\n throw new Error('Code is empty');\n }\n\n // May raise PhoneCodeEmptyError, PhoneCodeExpiredError,\n // PhoneCodeHashEmptyError or PhoneCodeInvalidError.\n const result = await client.invoke(new Api.auth.SignIn({\n phoneNumber,\n phoneCodeHash,\n phoneCode,\n }));\n\n if (result instanceof Api.auth.AuthorizationSignUpRequired) {\n isRegistrationRequired = true;\n termsOfService = result.termsOfService;\n break;\n }\n\n return result.user;\n } catch (err) {\n if (err.message === 'SESSION_PASSWORD_NEEDED') {\n return signInWithPassword(client, apiCredentials, authParams);\n } else {\n authParams.onError(err);\n }\n }\n }\n\n if (isRegistrationRequired) {\n // eslint-disable-next-line no-constant-condition\n while (1) {\n try {\n const [firstName, lastName] = await authParams.firstAndLastNames();\n if (!firstName) {\n throw new Error('First name is required');\n }\n\n const { user } = await client.invoke(new Api.auth.SignUp({\n phoneNumber,\n phoneCodeHash,\n firstName,\n lastName,\n })) as Api.auth.Authorization;\n\n if (termsOfService) {\n // This is a violation of Telegram rules: the user should be presented with and accept TOS.\n await client.invoke(new Api.help.AcceptTermsOfService({ id: termsOfService.id }));\n }\n\n return user;\n } catch (err) {\n authParams.onError(err);\n }\n }\n }\n\n authParams.onError(new Error('Auth failed'));\n return signInUser(client, apiCredentials, authParams);\n}\n\nasync function signInUserWithQrCode(\n client: TelegramClient, apiCredentials: ApiCredentials, authParams: UserAuthParams,\n): Promise {\n let isScanningComplete = false;\n\n const inputPromise = (async () => {\n // eslint-disable-next-line no-constant-condition\n while (1) {\n if (isScanningComplete) {\n break;\n }\n\n const result = await client.invoke(new Api.auth.ExportLoginToken({\n apiId: Number(process.env.TELEGRAM_T_API_ID),\n apiHash: process.env.TELEGRAM_T_API_HASH,\n exceptIds: [],\n }));\n if (!(result instanceof Api.auth.LoginToken)) {\n throw new Error('Unexpected');\n }\n\n const { token, expires } = result;\n\n await Promise.race([\n authParams.qrCode({ token, expires }),\n sleep(QR_CODE_TIMEOUT),\n ]);\n }\n })();\n\n const updatePromise = new Promise((resolve) => {\n client.addEventHandler((update: Api.TypeUpdate) => {\n if (update instanceof Api.UpdateLoginToken) {\n resolve();\n }\n }, { build: (update: object) => update });\n });\n\n try {\n // Either we receive an update that QR is successfully scanned,\n // or we receive a rejection caused by user going back to the regular auth form\n await Promise.race([updatePromise, inputPromise]);\n } catch (err) {\n if (err.message === 'RESTART_AUTH') {\n return await signInUser(client, apiCredentials, authParams);\n }\n\n throw err;\n } finally {\n isScanningComplete = true;\n }\n\n try {\n const result2 = await client.invoke(new Api.auth.ExportLoginToken({\n apiId: Number(process.env.TELEGRAM_T_API_ID),\n apiHash: process.env.TELEGRAM_T_API_HASH,\n exceptIds: [],\n }));\n\n if (result2 instanceof Api.auth.LoginTokenSuccess && result2.authorization instanceof Api.auth.Authorization) {\n return result2.authorization.user;\n } else if (result2 instanceof Api.auth.LoginTokenMigrateTo) {\n await client._switchDC(result2.dcId);\n const migratedResult = await client.invoke(new Api.auth.ImportLoginToken({\n token: result2.token,\n }));\n\n if (migratedResult instanceof Api.auth.LoginTokenSuccess\n && migratedResult.authorization instanceof Api.auth.Authorization) {\n return migratedResult.authorization.user;\n }\n }\n } catch (err) {\n if (err.message === 'SESSION_PASSWORD_NEEDED') {\n return signInWithPassword(client, apiCredentials, authParams);\n }\n\n throw err;\n }\n\n // This is a workaround for TypeScript (never actually reached)\n // eslint-disable-next-line no-throw-literal\n throw undefined;\n}\n\nasync function sendCode(\n client: TelegramClient, apiCredentials: ApiCredentials, phoneNumber: string, forceSMS = false,\n): Promise<{\n phoneCodeHash: string;\n isCodeViaApp: boolean;\n }> {\n try {\n const { apiId, apiHash } = apiCredentials;\n const sendResult = await client.invoke(new Api.auth.SendCode({\n phoneNumber,\n apiId,\n apiHash,\n settings: new Api.CodeSettings(),\n }));\n\n // If we already sent a SMS, do not resend the phoneCode (hash may be empty)\n if (!forceSMS || (sendResult.type instanceof Api.auth.SentCodeTypeSms)) {\n return {\n phoneCodeHash: sendResult.phoneCodeHash,\n isCodeViaApp: sendResult.type instanceof Api.auth.SentCodeTypeApp,\n };\n }\n\n const resendResult = await client.invoke(new Api.auth.ResendCode({\n phoneNumber,\n phoneCodeHash: sendResult.phoneCodeHash,\n }));\n\n return {\n phoneCodeHash: resendResult.phoneCodeHash,\n isCodeViaApp: resendResult.type instanceof Api.auth.SentCodeTypeApp,\n };\n } catch (err) {\n if (err.message === 'AUTH_RESTART') {\n return sendCode(client, apiCredentials, phoneNumber, forceSMS);\n } else {\n throw err;\n }\n }\n}\n\nasync function signInWithPassword(\n client: TelegramClient, apiCredentials: ApiCredentials, authParams: UserAuthParams,\n): Promise {\n // eslint-disable-next-line no-constant-condition\n while (1) {\n try {\n const passwordSrpResult = await client.invoke(new Api.account.GetPassword());\n const password = await authParams.password(passwordSrpResult.hint);\n if (!password) {\n throw new Error('Password is empty');\n }\n\n const passwordSrpCheck = await computePasswordSrpCheck(passwordSrpResult, password);\n const { user } = await client.invoke(new Api.auth.CheckPassword({\n password: passwordSrpCheck,\n })) as Api.auth.Authorization;\n\n return user;\n } catch (err) {\n authParams.onError(err);\n }\n }\n\n // eslint-disable-next-line no-unreachable\n return undefined!; // Never reached (TypeScript fix)\n}\n\nasync function signInBot(client: TelegramClient, apiCredentials: ApiCredentials, authParams: BotAuthParams) {\n const { apiId, apiHash } = apiCredentials;\n const { botAuthToken } = authParams;\n\n const { user } = await client.invoke(new Api.auth.ImportBotAuthorization({\n apiId,\n apiHash,\n botAuthToken,\n })) as Api.auth.Authorization;\n\n return user;\n}\n","// eslint-disable-next-line import/no-named-default\nimport { default as Api } from '../tl/api';\nimport TelegramClient from './TelegramClient';\nimport { getAppropriatedPartSize } from '../Utils';\nimport { sleep, createDeferred } from '../Helpers';\nimport errors from '../errors';\n\nexport interface progressCallback {\n isCanceled?: boolean;\n acceptsBuffer?: boolean;\n\n (\n progress: number, // Float between 0 and 1.\n ...args: any[]\n ): void;\n}\n\nexport interface DownloadFileParams {\n dcId: number;\n fileSize: number;\n workers?: number;\n partSizeKb?: number;\n start?: number;\n end?: number;\n progressCallback?: progressCallback;\n}\n\ninterface Deferred {\n promise: Promise;\n resolve: (value?: any) => void;\n}\n\n// Chunk sizes for `upload.getFile` must be multiple of the smallest size\nconst MIN_CHUNK_SIZE = 4096;\nconst DEFAULT_CHUNK_SIZE = 64; // kb\nconst ONE_MB = 1024 * 1024;\nconst DISCONNECT_SLEEP = 1000;\n\n\nclass Foreman {\n private deferred: Deferred | undefined;\n\n private activeWorkers = 0;\n\n constructor(private maxWorkers: number) {\n }\n\n requestWorker() {\n this.activeWorkers++;\n\n if (this.activeWorkers > this.maxWorkers) {\n this.deferred = createDeferred();\n return this.deferred!.promise;\n }\n\n return Promise.resolve();\n }\n\n releaseWorker() {\n this.activeWorkers--;\n\n if (this.deferred && (this.activeWorkers <= this.maxWorkers)) {\n this.deferred.resolve();\n }\n }\n}\n\nexport async function downloadFile(\n client: TelegramClient,\n inputLocation: Api.InputFileLocation,\n fileParams: DownloadFileParams,\n) {\n let {\n partSizeKb, end,\n } = fileParams;\n const {\n fileSize, workers = 1,\n } = fileParams;\n const { dcId, progressCallback, start = 0 } = fileParams;\n\n end = end && end < fileSize ? end : fileSize - 1;\n\n if (!partSizeKb) {\n partSizeKb = fileSize ? getAppropriatedPartSize(fileSize) : DEFAULT_CHUNK_SIZE;\n }\n\n const partSize = partSizeKb * 1024;\n const partsCount = end ? Math.ceil((end - start) / partSize) : 1;\n\n if (partSize % MIN_CHUNK_SIZE !== 0) {\n throw new Error(`The part size must be evenly divisible by ${MIN_CHUNK_SIZE}`);\n }\n\n client._log.info(`Downloading file in chunks of ${partSize} bytes`);\n\n const foreman = new Foreman(workers);\n const promises: Promise[] = [];\n let offset = start;\n // Used for files with unknown size and for manual cancellations\n let hasEnded = false;\n\n let progress = 0;\n if (progressCallback) {\n progressCallback(progress);\n }\n\n // Preload sender\n await client.getSender(dcId);\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n let limit = partSize;\n let isPrecise = false;\n\n if (Math.floor(offset / ONE_MB) !== Math.floor((offset + limit - 1) / ONE_MB)) {\n limit = ONE_MB - (offset % ONE_MB);\n isPrecise = true;\n }\n\n await foreman.requestWorker();\n\n if (hasEnded) {\n foreman.releaseWorker();\n break;\n }\n\n // eslint-disable-next-line no-loop-func\n promises.push((async (offsetMemo: number) => {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n let sender;\n try {\n sender = await client.getSender(dcId);\n const result = await sender.send(new Api.upload.GetFile({\n location: inputLocation,\n offset: offsetMemo,\n limit,\n precise: isPrecise || undefined,\n }));\n\n if (progressCallback) {\n if (progressCallback.isCanceled) {\n throw new Error('USER_CANCELED');\n }\n\n progress += (1 / partsCount);\n progressCallback(progress);\n }\n\n if (!end && (result.bytes.length < limit)) {\n hasEnded = true;\n }\n\n foreman.releaseWorker();\n\n return result.bytes;\n } catch (err) {\n if (sender && !sender.isConnected()) {\n await sleep(DISCONNECT_SLEEP);\n continue;\n } else if (err instanceof errors.FloodWaitError) {\n await sleep(err.seconds * 1000);\n continue;\n }\n\n foreman.releaseWorker();\n\n hasEnded = true;\n throw err;\n }\n }\n })(offset));\n\n offset += limit;\n\n if (end && (offset > end)) {\n break;\n }\n }\n const results = await Promise.all(promises);\n const buffers = results.filter(Boolean);\n const totalLength = end ? (end + 1) - start : undefined;\n return Buffer.concat(buffers, totalLength);\n}\n","// eslint-disable-next-line import/no-named-default\nimport { default as Api } from '../tl/api';\n\nimport TelegramClient from './TelegramClient';\nimport { generateRandomBytes, readBigIntFromBuffer, sleep } from '../Helpers';\nimport { getAppropriatedPartSize } from '../Utils';\nimport errors from '../errors';\n\ninterface OnProgress {\n isCanceled?: boolean;\n\n // Float between 0 and 1.\n (progress: number): void;\n}\n\nexport interface UploadFileParams {\n file: File;\n workers: number;\n onProgress?: OnProgress;\n}\n\nconst KB_TO_BYTES = 1024;\nconst LARGE_FILE_THRESHOLD = 10 * 1024 * 1024;\nconst DISCONNECT_SLEEP = 1000;\n\nexport async function uploadFile(\n client: TelegramClient,\n fileParams: UploadFileParams,\n): Promise {\n const { file, onProgress } = fileParams;\n let { workers } = fileParams;\n\n const { name, size } = file;\n const fileId = readBigIntFromBuffer(generateRandomBytes(8), true, true);\n const isLarge = size > LARGE_FILE_THRESHOLD;\n\n const partSize = getAppropriatedPartSize(size) * KB_TO_BYTES;\n const partCount = Math.floor((size + partSize - 1) / partSize);\n const buffer = Buffer.from(await fileToBuffer(file));\n\n // Make sure a new sender can be created before starting upload\n await client.getSender(client.session.dcId);\n\n if (!workers || !size) {\n workers = 1;\n }\n if (workers >= partCount) {\n workers = partCount;\n }\n\n let progress = 0;\n if (onProgress) {\n onProgress(progress);\n }\n\n for (let i = 0; i < partCount; i += workers) {\n const sendingParts = [];\n let end = i + workers;\n if (end > partCount) {\n end = partCount;\n }\n\n for (let j = i; j < end; j++) {\n const bytes = buffer.slice(j * partSize, (j + 1) * partSize);\n\n // eslint-disable-next-line no-loop-func\n sendingParts.push((async (jMemo: number, bytesMemo: Buffer) => {\n while (true) {\n let sender;\n try {\n // We always upload from the DC we are in\n sender = await client.getSender(client.session.dcId);\n await sender.send(\n isLarge\n ? new Api.upload.SaveBigFilePart({\n fileId,\n filePart: jMemo,\n fileTotalParts: partCount,\n bytes: bytesMemo,\n })\n : new Api.upload.SaveFilePart({\n fileId,\n filePart: jMemo,\n bytes: bytesMemo,\n }),\n );\n } catch (err) {\n if (sender && !sender.isConnected()) {\n await sleep(DISCONNECT_SLEEP);\n continue;\n } else if (err instanceof errors.FloodWaitError) {\n await sleep(err.seconds * 1000);\n continue;\n }\n throw err;\n }\n\n if (onProgress) {\n if (onProgress.isCanceled) {\n throw new Error('USER_CANCELED');\n }\n\n progress += (1 / partCount);\n onProgress(progress);\n }\n break;\n }\n })(j, bytes));\n }\n\n await Promise.all(sendingParts);\n }\n\n return isLarge\n ? new Api.InputFileBig({\n id: fileId,\n parts: partCount,\n name,\n })\n : new Api.InputFile({\n id: fileId,\n parts: partCount,\n name,\n md5Checksum: '', // This is not a \"flag\", so not sure if we can make it optional.\n });\n}\n\nfunction fileToBuffer(file: File) {\n return new Response(file).arrayBuffer();\n}\n","const {\n sha1,\n toSignedLittleBuffer,\n readBufferFromBigInt,\n readBigIntFromBuffer,\n} = require('../Helpers');\nconst BinaryReader = require('../extensions/BinaryReader');\nconst { sleep } = require('../Helpers');\n\nclass AuthKey {\n constructor(value, hash) {\n if (!hash || !value) {\n return;\n }\n this._key = value;\n this._hash = hash;\n const reader = new BinaryReader(hash);\n this.auxHash = reader.readLong(false);\n reader.read(4);\n this.keyId = reader.readLong(false);\n }\n\n async setKey(value) {\n if (!value) {\n this._key = undefined;\n this.auxHash = undefined;\n this.keyId = undefined;\n this._hash = undefined;\n return;\n }\n if (value instanceof AuthKey) {\n this._key = value._key;\n this.auxHash = value.auxHash;\n this.keyId = value.keyId;\n this._hash = value._hash;\n return;\n }\n this._key = value;\n this._hash = await sha1(this._key);\n const reader = new BinaryReader(this._hash);\n this.auxHash = reader.readLong(false);\n reader.read(4);\n this.keyId = reader.readLong(false);\n }\n\n async waitForKey() {\n while (!this.keyId) {\n await sleep(20);\n }\n }\n\n getKey() {\n return this._key;\n }\n\n // TODO : This doesn't really fit here, it's only used in authentication\n\n /**\n * Calculates the new nonce hash based on the current class fields' values\n * @param newNonce\n * @param number\n * @returns {bigint}\n */\n async calcNewNonceHash(newNonce, number) {\n newNonce = toSignedLittleBuffer(newNonce, 32);\n const n = Buffer.alloc(1);\n n.writeUInt8(number, 0);\n const data = Buffer.concat([newNonce,\n Buffer.concat([n, readBufferFromBigInt(this.auxHash, 8, true)])]);\n\n // Calculates the message key from the given data\n const shaData = (await sha1(data)).slice(4, 20);\n return readBigIntFromBuffer(shaData, true, true);\n }\n\n equals(other) {\n return other instanceof this.constructor && this._key && other.getKey() && other.getKey()\n .equals(this._key);\n }\n}\n\nmodule.exports = AuthKey;\n","const crypto = require('./crypto');\n\nclass CTR {\n constructor(key, iv) {\n if (!Buffer.isBuffer(key) || !Buffer.isBuffer(iv) || iv.length !== 16) {\n throw new Error('Key and iv need to be a buffer');\n }\n\n this.cipher = crypto.createCipheriv('AES-256-CTR', key, iv);\n }\n\n encrypt(data) {\n return Buffer.from(this.cipher.update(data));\n }\n}\n\nmodule.exports = CTR;\n","const BigInt = require('big-integer');\nconst { modExp } = require('../Helpers');\n\nclass Factorizator {\n /**\n * Calculates the greatest common divisor\n * @param a {BigInteger}\n * @param b {BigInteger}\n * @returns {BigInteger}\n */\n static gcd(a, b) {\n while (b.neq(BigInt.zero)) {\n const temp = b;\n b = a.remainder(b);\n a = temp;\n }\n return a;\n }\n\n /**\n * Factorizes the given number and returns both the divisor and the number divided by the divisor\n * @param pq {BigInteger}\n * @returns {{p: *, q: *}}\n */\n static factorize(pq) {\n if (pq.remainder(2)\n .equals(BigInt.zero)) {\n return {\n p: BigInt(2),\n q: pq.divide(BigInt(2)),\n };\n }\n let y = BigInt.randBetween(BigInt(1), pq.minus(1));\n const c = BigInt.randBetween(BigInt(1), pq.minus(1));\n const m = BigInt.randBetween(BigInt(1), pq.minus(1));\n\n let g = BigInt.one;\n let r = BigInt.one;\n let q = BigInt.one;\n let x = BigInt.zero;\n let ys = BigInt.zero;\n let k;\n\n while (g.eq(BigInt.one)) {\n x = y;\n for (let i = 0; BigInt(i)\n .lesser(r); i++) {\n y = (modExp(y, BigInt(2), pq)).add(c)\n .remainder(pq);\n }\n k = BigInt.zero;\n\n while (k.lesser(r) && g.eq(BigInt.one)) {\n ys = y;\n const condition = BigInt.min(m, r.minus(k));\n for (let i = 0; BigInt(i)\n .lesser(condition); i++) {\n y = (modExp(y, BigInt(2), pq)).add(c)\n .remainder(pq);\n q = q.multiply(x.minus(y)\n .abs())\n .remainder(pq);\n }\n g = Factorizator.gcd(q, pq);\n k = k.add(m);\n }\n\n r = r.multiply(2);\n }\n\n\n if (g.eq(pq)) {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n ys = (modExp(ys, BigInt(2), pq)).add(c)\n .remainder(pq);\n g = Factorizator.gcd(x.minus(ys)\n .abs(), pq);\n\n if (g.greater(1)) {\n break;\n }\n }\n }\n const p = g;\n q = pq.divide(g);\n return p < q ? {\n p,\n q,\n } : {\n p: q,\n q: p,\n };\n }\n}\n\nmodule.exports = Factorizator;\n","const { IGE: AESIGE } = require('@cryptography/aes');\nconst Helpers = require('../Helpers');\n\n\nclass IGENEW {\n constructor(key, iv) {\n this.ige = new AESIGE(key, iv);\n }\n\n /**\n * Decrypts the given text in 16-bytes blocks by using the given key and 32-bytes initialization vector\n * @param cipherText {Buffer}\n * @returns {Buffer}\n */\n decryptIge(cipherText) {\n return Helpers.convertToLittle(this.ige.decrypt(cipherText));\n }\n\n /**\n * Encrypts the given text in 16-bytes blocks by using the given key and 32-bytes initialization vector\n * @param plainText {Buffer}\n * @returns {Buffer}\n */\n encryptIge(plainText) {\n const padding = plainText.length % 16;\n if (padding) {\n plainText = Buffer.concat([plainText, Helpers.generateRandomBytes(16 - padding)]);\n }\n\n return Helpers.convertToLittle(this.ige.encrypt(plainText));\n }\n}\n\nmodule.exports = IGENEW;\n","/**\n * Uint32Array -> ArrayBuffer (low-endian os)\n */\nexport function i2abLow(buf: Uint32Array): ArrayBuffer {\n const uint8 = new Uint8Array(buf.length * 4);\n let i = 0;\n\n for (let j = 0; j < buf.length; j++) {\n const int = buf[j];\n\n uint8[i++] = int >>> 24;\n uint8[i++] = (int >> 16) & 0xFF;\n uint8[i++] = (int >> 8) & 0xFF;\n uint8[i++] = int & 0xFF;\n }\n\n return uint8.buffer;\n}\n\n/**\n * Uint32Array -> ArrayBuffer (big-endian os)\n */\nexport function i2abBig(buf: Uint32Array): ArrayBuffer {\n return buf.buffer;\n}\n\n/**\n * ArrayBuffer -> Uint32Array (low-endian os)\n */\nexport function ab2iLow(ab: ArrayBuffer | SharedArrayBuffer | Uint8Array): Uint32Array {\n const uint8 = new Uint8Array(ab);\n const buf = new Uint32Array(uint8.length / 4);\n\n for (let i = 0; i < uint8.length; i += 4) {\n buf[i / 4] = (\n uint8[i] << 24\n ^ uint8[i + 1] << 16\n ^ uint8[i + 2] << 8\n ^ uint8[i + 3]\n );\n }\n\n return buf;\n}\n\n/**\n * ArrayBuffer -> Uint32Array (big-endian os)\n */\nexport function ab2iBig(ab: ArrayBuffer | SharedArrayBuffer | Uint8Array): Uint32Array {\n return new Uint32Array(ab);\n}\n\nexport const isBigEndian = new Uint8Array(new Uint32Array([0x01020304]))[0] === 0x01;\nexport const i2ab = isBigEndian ? i2abBig : i2abLow;\nexport const ab2i = isBigEndian ? ab2iBig : ab2iLow;\n","const AES = require('@cryptography/aes').default;\nconst {\n i2ab,\n ab2i,\n} = require('./converters');\nconst { getWords } = require('./words');\n\nclass Counter {\n constructor(initialValue) {\n this.setBytes(initialValue);\n }\n\n setBytes(bytes) {\n bytes = Buffer.from(bytes);\n this._counter = bytes;\n }\n\n increment() {\n for (let i = 15; i >= 0; i--) {\n if (this._counter[i] === 255) {\n this._counter[i] = 0;\n } else {\n this._counter[i]++;\n break;\n }\n }\n }\n}\n\nclass CTR {\n constructor(key, counter) {\n if (!(counter instanceof Counter)) {\n counter = new Counter(counter);\n }\n\n this._counter = counter;\n\n this._remainingCounter = undefined;\n this._remainingCounterIndex = 16;\n\n this._aes = new AES(getWords(key));\n }\n\n update(plainText) {\n return this.encrypt(plainText);\n }\n\n encrypt(plainText) {\n const encrypted = Buffer.from(plainText);\n\n for (let i = 0; i < encrypted.length; i++) {\n if (this._remainingCounterIndex === 16) {\n this._remainingCounter = Buffer.from(i2ab(this._aes.encrypt(ab2i(this._counter._counter))));\n this._remainingCounterIndex = 0;\n this._counter.increment();\n }\n encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++];\n }\n\n return encrypted;\n }\n}\n\n// endregion\nfunction createDecipheriv(algorithm, key, iv) {\n if (algorithm.includes('ECB')) {\n throw new Error('Not supported');\n } else {\n return new CTR(key, iv);\n }\n}\n\nfunction createCipheriv(algorithm, key, iv) {\n if (algorithm.includes('ECB')) {\n throw new Error('Not supported');\n } else {\n return new CTR(key, iv);\n }\n}\n\nfunction randomBytes(count) {\n const bytes = new Uint8Array(count);\n crypto.getRandomValues(bytes);\n return bytes;\n}\n\nclass Hash {\n constructor(algorithm) {\n this.algorithm = algorithm;\n }\n\n update(data) {\n // We shouldn't be needing new Uint8Array but it doesn't\n // work without it\n this.data = new Uint8Array(data);\n }\n\n\n async digest() {\n if (this.algorithm === 'sha1') {\n // eslint-disable-next-line no-restricted-globals\n return Buffer.from(await self.crypto.subtle.digest('SHA-1', this.data));\n } else if (this.algorithm === 'sha256') {\n // eslint-disable-next-line no-restricted-globals\n return Buffer.from(await self.crypto.subtle.digest('SHA-256', this.data));\n }\n return undefined;\n }\n}\n\nasync function pbkdf2(password, salt, iterations) {\n const passwordKey = await crypto.subtle.importKey('raw', password,\n { name: 'PBKDF2' }, false, ['deriveBits']);\n return Buffer.from(await crypto.subtle.deriveBits({\n name: 'PBKDF2',\n hash: 'SHA-512',\n salt,\n iterations,\n }, passwordKey, 512));\n}\n\nfunction createHash(algorithm) {\n return new Hash(algorithm);\n}\n\nmodule.exports = {\n createCipheriv,\n createDecipheriv,\n randomBytes,\n createHash,\n pbkdf2,\n};\n","/*\n * Imported from https://github.com/spalt08/cryptography/blob/master/packages/aes/src/utils/words.ts\n */\n\nexport function s2i(str: string, pos: number) {\n return (\n str.charCodeAt(pos) << 24\n ^ str.charCodeAt(pos + 1) << 16\n ^ str.charCodeAt(pos + 2) << 8\n ^ str.charCodeAt(pos + 3)\n );\n}\n\n/**\n * Helper function for transforming string key to Uint32Array\n */\nexport function getWords(key: string | Uint8Array | Uint32Array) {\n if (key instanceof Uint32Array) {\n return key;\n }\n\n if (typeof key === 'string') {\n if (key.length % 4 !== 0) for (let i = key.length % 4; i <= 4; i++) key += '\\0x00';\n\n const buf = new Uint32Array(key.length / 4);\n for (let i = 0; i < key.length; i += 4) buf[i / 4] = s2i(key, i);\n\n return buf;\n }\n\n if (key instanceof Uint8Array) {\n const buf = new Uint32Array(key.length / 4);\n\n for (let i = 0; i < key.length; i += 4) {\n buf[i / 4] = (\n key[i] << 24\n ^ key[i + 1] << 16\n ^ key[i + 2] << 8\n ^ key[i + 3]\n );\n }\n\n return buf;\n }\n\n throw new Error('Unable to create 32-bit words');\n}\n\nexport function xor(left: Uint32Array, right: Uint32Array, to = left) {\n for (let i = 0; i < left.length; i++) to[i] = left[i] ^ right[i];\n}\n","/**\n * Errors not related to the Telegram API itself\n */\n\n\n/**\n * Occurs when a read operation was cancelled.\n */\nclass ReadCancelledError extends Error {\n constructor() {\n super('The read operation was cancelled.');\n }\n}\n\n/**\n * Occurs when a type is not found, for example,\n * when trying to read a TLObject with an invalid constructor code.\n */\nclass TypeNotFoundError extends Error {\n constructor(invalidConstructorId, remaining) {\n super(`Could not find a matching Constructor ID for the TLObject that was supposed to be\n read with ID ${invalidConstructorId}. Most likely, a TLObject was trying to be read when\n it should not be read. Remaining bytes: ${remaining.length}`);\n if (typeof alert !== 'undefined') {\n // eslint-disable-next-line no-alert\n alert(`Missing MTProto Entity: Please, make sure to add TL definition for ID ${invalidConstructorId}`);\n }\n this.invalidConstructorId = invalidConstructorId;\n this.remaining = remaining;\n }\n}\n\n/**\n * Occurs when using the TCP full mode and the checksum of a received\n * packet doesn't match the expected checksum.\n */\nclass InvalidChecksumError extends Error {\n constructor(checksum, validChecksum) {\n super(`Invalid checksum (${checksum} when ${validChecksum} was expected). This packet should be skipped.`);\n this.checksum = checksum;\n this.validChecksum = validChecksum;\n }\n}\n\n/**\n * Occurs when the buffer is invalid, and may contain an HTTP error code.\n * For instance, 404 means \"forgotten/broken authorization key\", while\n */\nclass InvalidBufferError extends Error {\n constructor(payload) {\n let code;\n if (payload.length === 4) {\n code = -payload.readInt32LE(0);\n super(`Invalid response buffer (HTTP code ${code})`);\n } else {\n super(`Invalid response buffer (too short ${payload})`);\n }\n this.code = code;\n this.payload = payload;\n }\n}\n\n/**\n * Generic security error, mostly used when generating a new AuthKey.\n */\nclass SecurityError extends Error {\n constructor(...args) {\n if (!args.length) {\n args = ['A security check failed.'];\n }\n super(...args);\n }\n}\n\n/**\n * Occurs when there's a hash mismatch between the decrypted CDN file\n * and its expected hash.\n */\nclass CdnFileTamperedError extends SecurityError {\n constructor() {\n super('The CDN file has been altered and its download cancelled.');\n }\n}\n\n/**\n * Occurs when handling a badMessageNotification\n */\nclass BadMessageError extends Error {\n static ErrorMessages = {\n 16:\n 'msg_id too low (most likely, client time is wrong it would be worthwhile to '\n + 'synchronize it using msg_id notifications and re-send the original message '\n + 'with the “correct” msg_id or wrap it in a container with a new msg_id if the '\n + 'original message had waited too long on the client to be transmitted).',\n\n 17:\n 'msg_id too high (similar to the previous case, the client time has to be '\n + 'synchronized, and the message re-sent with the correct msg_id).',\n\n 18:\n 'Incorrect two lower order msg_id bits (the server expects client message msg_id '\n + 'to be divisible by 4).',\n\n 19: 'Container msg_id is the same as msg_id of a previously received message (this must never happen).',\n\n 20:\n 'Message too old, and it cannot be verified whether the server has received a '\n + 'message with this msg_id or not.',\n\n 32:\n 'msg_seqno too low (the server has already received a message with a lower '\n + 'msg_id but with either a higher or an equal and odd seqno).',\n\n 33:\n 'msg_seqno too high (similarly, there is a message with a higher msg_id but with '\n + 'either a lower or an equal and odd seqno).',\n\n 34: 'An even msg_seqno expected (irrelevant message), but odd received.',\n\n 35: 'Odd msg_seqno expected (relevant message), but even received.',\n\n 48:\n 'Incorrect server salt (in this case, the bad_server_salt response is received with '\n + 'the correct salt, and the message is to be re-sent with it).',\n\n 64: 'Invalid container.',\n };\n\n constructor(request, code) {\n let errorMessage = BadMessageError.ErrorMessages[code]\n || `Unknown error code (this should not happen): ${code}.`;\n errorMessage += ` Caused by ${request.className}`;\n super(errorMessage);\n this.message = errorMessage;\n this.code = code;\n }\n}\n\n// TODO : Support multi errors.\n\nmodule.exports = {\n ReadCancelledError,\n TypeNotFoundError,\n InvalidChecksumError,\n InvalidBufferError,\n SecurityError,\n CdnFileTamperedError,\n BadMessageError,\n};\n","/**\n * Base class for all Remote Procedure Call errors.\n */\nclass RPCError extends Error {\n constructor(message, request, code = undefined) {\n super(\n 'RPCError {0}: {1}{2}'\n .replace('{0}', code)\n .replace('{1}', message)\n .replace('{2}', RPCError._fmtRequest(request)),\n );\n this.code = code;\n this.message = message;\n }\n\n static _fmtRequest(request) {\n // TODO fix this\n if (request) {\n return ` (caused by ${request.className})`;\n } else {\n return '';\n }\n }\n}\n\n/**\n * The request must be repeated, but directed to a different data center.\n */\nclass InvalidDCError extends RPCError {\n constructor(request, message, code) {\n super(message, request, code);\n this.code = code || 303;\n this.message = message || 'ERROR_SEE_OTHER';\n }\n}\n\n/**\n * The query contains errors. In the event that a request was created\n * using a form and contains user generated data, the user should be\n * notified that the data must be corrected before the query is repeated.\n */\nclass BadRequestError extends RPCError {\n code = 400;\n\n message = 'BAD_REQUEST';\n}\n\n/**\n * There was an unauthorized attempt to use functionality available only\n * to authorized users.\n */\nclass UnauthorizedError extends RPCError {\n code = 401;\n\n message = 'UNAUTHORIZED';\n}\n\n/**\n * Privacy violation. For example, an attempt to write a message to\n * someone who has blacklisted the current user.\n */\nclass ForbiddenError extends RPCError {\n code = 403;\n\n message = 'FORBIDDEN';\n}\n\n/**\n * An attempt to invoke a non-existent object, such as a method.\n */\nclass NotFoundError extends RPCError {\n code = 404;\n\n message = 'NOT_FOUND';\n}\n\n/**\n * Errors related to invalid authorization key, like\n * AUTH_KEY_DUPLICATED which can cause the connection to fail.\n */\nclass AuthKeyError extends RPCError {\n code = 406;\n\n message = 'AUTH_KEY';\n}\n\n/**\n * The maximum allowed number of attempts to invoke the given method\n * with the given input parameters has been exceeded. For example, in an\n * attempt to request a large number of text messages (SMS) for the same\n * phone number.\n */\nclass FloodError extends RPCError {\n code = 420;\n\n message = 'FLOOD';\n}\n\n/**\n * An internal server error occurred while a request was being processed\n * for example, there was a disruption while accessing a database or file\n * storage\n */\nclass ServerError extends RPCError {\n code = 500; // Also witnessed as -500\n\n message = 'INTERNAL';\n}\n\n/**\n * Clicking the inline buttons of bots that never (or take to long to)\n * call ``answerCallbackQuery`` will result in this \"special\" RPCError.\n */\nclass TimedOutError extends RPCError {\n code = 503; // Only witnessed as -503\n\n message = 'Timeout';\n}\n\nmodule.exports = {\n RPCError,\n InvalidDCError,\n BadRequestError,\n UnauthorizedError,\n ForbiddenError,\n NotFoundError,\n AuthKeyError,\n FloodError,\n ServerError,\n TimedOutError,\n};\n","const {\n RPCError,\n InvalidDCError,\n FloodError,\n BadRequestError,\n} = require('./RPCBaseErrors');\n\n\nclass UserMigrateError extends InvalidDCError {\n constructor(args) {\n const newDc = Number(args.capture || 0);\n // eslint-disable-next-line max-len\n super(`The user whose identity is being used to execute queries is associated with DC ${newDc}${RPCError._fmtRequest(args.request)}`);\n // eslint-disable-next-line max-len\n this.message = `The user whose identity is being used to execute queries is associated with DC ${newDc}${RPCError._fmtRequest(args.request)}`;\n this.newDc = newDc;\n }\n}\n\n\nclass PhoneMigrateError extends InvalidDCError {\n constructor(args) {\n const newDc = Number(args.capture || 0);\n // eslint-disable-next-line max-len\n super(`The phone number a user is trying to use for authorization is associated with DC ${newDc}${RPCError._fmtRequest(args.request)}`);\n // eslint-disable-next-line max-len\n this.message = `The phone number a user is trying to use for authorization is associated with DC ${newDc}${RPCError._fmtRequest(args.request)}`;\n this.newDc = newDc;\n }\n}\n\nclass SlowModeWaitError extends FloodError {\n constructor(args) {\n const seconds = Number(args.capture || 0);\n // eslint-disable-next-line max-len\n super(`A wait of ${seconds} seconds is required before sending another message in this chat${RPCError._fmtRequest(args.request)}`);\n // eslint-disable-next-line max-len\n this.message = `A wait of ${seconds} seconds is required before sending another message in this chat${RPCError._fmtRequest(args.request)}`;\n this.seconds = seconds;\n }\n}\n\nclass FloodWaitError extends FloodError {\n constructor(args) {\n const seconds = Number(args.capture || 0);\n super(`A wait of ${seconds} seconds is required${RPCError._fmtRequest(args.request)}`);\n this.message = `A wait of ${seconds} seconds is required${RPCError._fmtRequest(args.request)}`;\n this.seconds = seconds;\n }\n}\nclass MsgWaitError extends FloodError {\n constructor(args) {\n super(`Message failed to be sent.${RPCError._fmtRequest(args.request)}`);\n this.message = `Message failed to be sent.${RPCError._fmtRequest(args.request)}`;\n }\n}\n\nclass FloodTestPhoneWaitError extends FloodError {\n constructor(args) {\n const seconds = Number(args.capture || 0);\n super(`A wait of ${seconds} seconds is required in the test servers${RPCError._fmtRequest(args.request)}`);\n // eslint-disable-next-line max-len\n this.message = `A wait of ${seconds} seconds is required in the test servers${RPCError._fmtRequest(args.request)}`;\n this.seconds = seconds;\n }\n}\n\nclass FileMigrateError extends InvalidDCError {\n constructor(args) {\n const newDc = Number(args.capture || 0);\n super(`The file to be accessed is currently stored in DC ${newDc}${RPCError._fmtRequest(args.request)}`);\n // eslint-disable-next-line max-len\n this.message = `The file to be accessed is currently stored in DC ${newDc}${RPCError._fmtRequest(args.request)}`;\n this.newDc = newDc;\n }\n}\n\nclass NetworkMigrateError extends InvalidDCError {\n constructor(args) {\n const newDc = Number(args.capture || 0);\n super(`The source IP address is associated with DC ${newDc}${RPCError._fmtRequest(args.request)}`);\n this.message = `The source IP address is associated with DC ${newDc}${RPCError._fmtRequest(args.request)}`;\n this.newDc = newDc;\n }\n}\n\nclass EmailUnconfirmedError extends BadRequestError {\n constructor(args) {\n const codeLength = Number(args.capture || 0);\n super(`Email unconfirmed, the length of the code must be ${codeLength}${RPCError._fmtRequest(args.request)}`);\n // eslint-disable-next-line max-len\n this.message = `Email unconfirmed, the length of the code must be ${codeLength}${RPCError._fmtRequest(args.request)}`;\n this.codeLength = codeLength;\n }\n}\n\nconst rpcErrorRe = [\n [/FILE_MIGRATE_(\\d+)/, FileMigrateError],\n [/FLOOD_TEST_PHONE_WAIT_(\\d+)/, FloodTestPhoneWaitError],\n [/FLOOD_WAIT_(\\d+)/, FloodWaitError],\n [/MSG_WAIT_(.*)/, MsgWaitError],\n [/PHONE_MIGRATE_(\\d+)/, PhoneMigrateError],\n [/SLOWMODE_WAIT_(\\d+)/, SlowModeWaitError],\n [/USER_MIGRATE_(\\d+)/, UserMigrateError],\n [/NETWORK_MIGRATE_(\\d+)/, NetworkMigrateError],\n [/EMAIL_UNCONFIRMED_(\\d+)/, EmailUnconfirmedError],\n\n];\nmodule.exports = {\n rpcErrorRe,\n FileMigrateError,\n FloodTestPhoneWaitError,\n FloodWaitError,\n PhoneMigrateError,\n SlowModeWaitError,\n UserMigrateError,\n NetworkMigrateError,\n MsgWaitError,\n EmailUnconfirmedError,\n};\n","/**\n * Converts a Telegram's RPC Error to a Python error.\n * @param rpcError the RPCError instance\n * @param request the request that caused this error\n * @constructor the RPCError as a Python exception that represents this error\n */\nconst { RPCError } = require('./RPCBaseErrors');\nconst { rpcErrorRe } = require('./RPCErrorList');\n\nfunction RPCMessageToError(rpcError, request) {\n for (const [msgRegex, Cls] of rpcErrorRe) {\n const m = rpcError.errorMessage.match(msgRegex);\n if (m) {\n const capture = m.length === 2 ? parseInt(m[1], 10) : undefined;\n return new Cls({\n request,\n capture,\n });\n }\n }\n\n return new RPCError(rpcError.errorMessage, request);\n}\n\nconst Common = require('./Common');\nconst RPCBaseErrors = require('./RPCBaseErrors');\nconst RPCErrorList = require('./RPCErrorList');\n\nmodule.exports = {\n RPCMessageToError,\n ...Common,\n ...RPCBaseErrors,\n ...RPCErrorList,\n};\n","const { EventBuilder } = require('./common');\n\nclass Raw extends EventBuilder {\n constructor(args = {\n types: undefined,\n func: undefined,\n }) {\n super();\n if (!args.types) {\n this.types = true;\n } else {\n this.types = args.types;\n }\n }\n\n build(update) {\n return update;\n }\n}\n\nmodule.exports = Raw;\n","class EventBuilder {\n constructor(args = {\n chats: undefined,\n blacklistChats: undefined,\n func: undefined,\n }) {\n this.chats = args.chats;\n this.blacklistChats = Boolean(args.blacklistChats);\n this.resolved = false;\n this.func = args.func;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n build(update) {\n\n }\n}\n\n\nmodule.exports = {\n EventBuilder,\n};\n","const NewMessage = require('./NewMessage');\nconst Raw = require('./Raw');\n\nclass StopPropagation extends Error {\n\n}\n\nmodule.exports = {\n NewMessage,\n StopPropagation,\n Raw,\n};\n","class AsyncQueue {\n constructor() {\n this._queue = [];\n this.canGet = new Promise((resolve) => {\n this.resolveGet = resolve;\n });\n this.canPush = true;\n }\n\n async push(value) {\n await this.canPush;\n this._queue.push(value);\n this.resolveGet(true);\n this.canPush = new Promise((resolve) => {\n this.resolvePush = resolve;\n });\n }\n\n async pop() {\n await this.canGet;\n const returned = this._queue.pop();\n this.resolvePush(true);\n this.canGet = new Promise((resolve) => {\n this.resolveGet = resolve;\n });\n return returned;\n }\n}\n\nmodule.exports = AsyncQueue;\n","const { TypeNotFoundError } = require('../errors/Common');\nconst { coreObjects } = require('../tl/core');\nconst { tlobjects } = require('../tl/AllTLObjects');\nconst { readBigIntFromBuffer } = require('../Helpers');\n\nclass BinaryReader {\n /**\n * Small utility class to read binary data.\n * @param data {Buffer}\n */\n constructor(data) {\n this.stream = data;\n this._last = undefined;\n this.offset = 0;\n }\n\n // region Reading\n\n // \"All numbers are written as little endian.\"\n // https://core.telegram.org/mtproto\n /**\n * Reads a single byte value.\n */\n readByte() {\n return this.read(1)[0];\n }\n\n /**\n * Reads an integer (4 bytes or 32 bits) value.\n * @param signed {Boolean}\n */\n readInt(signed = true) {\n let res;\n if (signed) {\n res = this.stream.readInt32LE(this.offset);\n } else {\n res = this.stream.readUInt32LE(this.offset);\n }\n this.offset += 4;\n return res;\n }\n\n /**\n * Reads a long integer (8 bytes or 64 bits) value.\n * @param signed\n * @returns {BigInteger}\n */\n readLong(signed = true) {\n return this.readLargeInt(64, signed);\n }\n\n /**\n * Reads a real floating point (4 bytes) value.\n * @returns {number}\n */\n readFloat() {\n return this.read(4)\n .readFloatLE(0);\n }\n\n /**\n * Reads a real floating point (8 bytes) value.\n * @returns {BigInteger}\n */\n readDouble() {\n // was this a bug ? it should have been 0) {\n padding = 4 - padding;\n this.read(padding);\n }\n\n return data;\n }\n\n /**\n * Reads a Telegram-encoded string.\n * @returns {string}\n */\n tgReadString() {\n return this.tgReadBytes()\n .toString('utf-8');\n }\n\n /**\n * Reads a Telegram boolean value.\n * @returns {boolean}\n */\n tgReadBool() {\n const value = this.readInt(false);\n if (value === 0x997275b5) {\n // boolTrue\n return true;\n } else if (value === 0xbc799737) {\n // boolFalse\n return false;\n } else {\n throw new Error(`Invalid boolean code ${value.toString('16')}`);\n }\n }\n\n /**\n * Reads and converts Unix time (used by Telegram)\n * into a Javascript {Date} object.\n * @returns {Date}\n */\n tgReadDate() {\n const value = this.readInt();\n return new Date(value * 1000);\n }\n\n /**\n * Reads a Telegram object.\n */\n tgReadObject() {\n const constructorId = this.readInt(false);\n let clazz = tlobjects[constructorId];\n if (clazz === undefined) {\n /**\n * The class was None, but there's still a\n * chance of it being a manually parsed value like bool!\n */\n const value = constructorId;\n if (value === 0x997275b5) {\n // boolTrue\n return true;\n } else if (value === 0xbc799737) {\n // boolFalse\n return false;\n } else if (value === 0x1cb5c415) {\n // Vector\n const temp = [];\n const length = this.readInt();\n for (let i = 0; i < length; i++) {\n temp.push(this.tgReadObject());\n }\n return temp;\n }\n\n clazz = coreObjects[constructorId];\n\n if (clazz === undefined) {\n // If there was still no luck, give up\n this.seek(-4); // Go back\n const pos = this.tellPosition();\n const error = new TypeNotFoundError(constructorId, this.read());\n this.setPosition(pos);\n throw error;\n }\n }\n return clazz.fromReader(this);\n }\n\n /**\n * Reads a vector (a list) of Telegram objects.\n * @returns {[Buffer]}\n */\n tgReadVector() {\n if (this.readInt(false) !== 0x1cb5c415) {\n throw new Error('Invalid constructor code, vector was expected');\n }\n const count = this.readInt();\n const temp = [];\n for (let i = 0; i < count; i++) {\n temp.push(this.tgReadObject());\n }\n return temp;\n }\n\n // endregion\n\n /**\n * Closes the reader.\n */\n close() {\n this.stream = undefined;\n }\n\n // region Position related\n\n /**\n * Tells the current position on the stream.\n * @returns {number}\n */\n tellPosition() {\n return this.offset;\n }\n\n /**\n * Sets the current position on the stream.\n * @param position\n */\n setPosition(position) {\n this.offset = position;\n }\n\n /**\n * Seeks the stream position given an offset from the current position.\n * The offset may be negative.\n * @param offset\n */\n seek(offset) {\n this.offset += offset;\n }\n\n // endregion\n}\n\nmodule.exports = BinaryReader;\n","class BinaryWriter {\n constructor(stream) {\n this._stream = stream;\n }\n\n write(buffer) {\n this._stream = Buffer.concat([this._stream, buffer]);\n }\n\n getValue() {\n return this._stream;\n }\n}\n\nmodule.exports = BinaryWriter;\n","let _level;\n\nclass Logger {\n static levels = ['error', 'warn', 'info', 'debug'];\n\n constructor(level) {\n if (!_level) {\n _level = level || 'debug';\n }\n\n this.isBrowser = typeof process === 'undefined'\n || process.type === 'renderer'\n || process.browser === true\n || process.__nwjs;\n if (!this.isBrowser) {\n this.colors = {\n start: '\\x1b[2m',\n warn: '\\x1b[35m',\n info: '\\x1b[33m',\n debug: '\\x1b[36m',\n error: '\\x1b[31m',\n end: '\\x1b[0m',\n };\n } else {\n this.colors = {\n start: '%c',\n warn: 'color : #ff00ff',\n info: 'color : #ffff00',\n debug: 'color : #00ffff',\n error: 'color : #ff0000',\n end: '',\n };\n }\n this.messageFormat = '[%t] [%l] - [%m]';\n }\n\n static setLevel(level) {\n _level = level;\n }\n\n /**\n *\n * @param level {string}\n * @returns {boolean}\n */\n canSend(level) {\n return (Logger.levels.indexOf(_level) >= Logger.levels.indexOf(level));\n }\n\n /**\n * @param message {string}\n */\n warn(message) {\n // todo remove later\n if (_level === 'debug') {\n // eslint-disable-next-line no-console\n console.error(new Error().stack);\n }\n this._log('warn', message, this.colors.warn);\n }\n\n /**\n * @param message {string}\n */\n info(message) {\n this._log('info', message, this.colors.info);\n }\n\n /**\n * @param message {string}\n */\n debug(message) {\n this._log('debug', message, this.colors.debug);\n }\n\n /**\n * @param message {string}\n */\n error(message) {\n // todo remove later\n if (_level === 'debug') {\n // eslint-disable-next-line no-console\n console.error(new Error().stack);\n }\n this._log('error', message, this.colors.error);\n }\n\n format(message, level) {\n return this.messageFormat.replace('%t', new Date().toISOString())\n .replace('%l', level.toUpperCase())\n .replace('%m', message);\n }\n\n /**\n * @param level {string}\n * @param message {string}\n * @param color {string}\n */\n _log(level, message, color) {\n if (!_level) {\n return;\n }\n if (this.canSend(level)) {\n if (!this.isBrowser) {\n // eslint-disable-next-line no-console\n console.log(color + this.format(message, level) + this.colors.end);\n } else {\n // eslint-disable-next-line no-console\n console.log(this.colors.start + this.format(message, level), color);\n }\n }\n }\n}\n\nmodule.exports = Logger;\n","const MessageContainer = require('../tl/core/MessageContainer');\nconst TLMessage = require('../tl/core/TLMessage');\nconst BinaryWriter = require('../extensions/BinaryWriter');\n\nconst USE_INVOKE_AFTER_WITH = [\n 'messages.SendMessage', 'messages.SendMedia', 'messages.SendMultiMedia',\n 'messages.ForwardMessages', 'messages.SendInlineBotResult',\n];\n\nclass MessagePacker {\n constructor(state, logger) {\n this._state = state;\n this._queue = [];\n this._pendingStates = [];\n this._ready = new Promise(((resolve) => {\n this.setReady = resolve;\n }));\n this._log = logger;\n }\n\n values() {\n return this._queue;\n }\n\n append(state) {\n // we need to check if there is already a request with the same name that we should send after.\n if (state && USE_INVOKE_AFTER_WITH.includes(state.request.className)) {\n // we now need to check if there is any request in queue already.\n // we loop backwards since the latest request is the most recent\n for (let i = this._queue.length - 1; i >= 0; i--) {\n if (USE_INVOKE_AFTER_WITH.includes(this._queue[i].request.className)) {\n state.after = this._queue[i];\n break;\n }\n }\n }\n\n\n this._queue.push(state);\n this.setReady(true);\n\n if (state) {\n this._pendingStates.push(state);\n state.promise\n // Using finally causes triggering `unhandledrejection` event\n .catch(() => {\n })\n .finally(() => {\n this._pendingStates = this._pendingStates.filter((s) => s !== state);\n });\n }\n }\n\n extend(states) {\n for (const state of states) {\n this._queue.push(state);\n }\n this.setReady(true);\n }\n\n async get() {\n if (!this._queue.length) {\n this._ready = new Promise(((resolve) => {\n this.setReady = resolve;\n }));\n await this._ready;\n }\n if (!this._queue[this._queue.length - 1]) {\n this._queue = [];\n return undefined;\n }\n let data;\n let buffer = new BinaryWriter(Buffer.alloc(0));\n\n const batch = [];\n let size = 0;\n\n while (this._queue.length && batch.length <= MessageContainer.MAXIMUM_LENGTH) {\n const state = this._queue.shift();\n size += state.data.length + TLMessage.SIZE_OVERHEAD;\n if (size <= MessageContainer.MAXIMUM_SIZE) {\n let afterId;\n if (state.after) {\n afterId = state.after.msgId;\n }\n state.msgId = await this._state.writeDataAsMessage(\n buffer, state.data, state.request.classType === 'request',\n afterId,\n );\n this._log.debug(`Assigned msgId = ${state.msgId} to ${state.request.className\n || state.request.constructor.name}`);\n batch.push(state);\n continue;\n }\n if (batch.length) {\n this._queue.unshift(state);\n break;\n }\n this._log.warn(`Message payload for ${state.request.className\n || state.request.constructor.name} is too long ${state.data.length} and cannot be sent`);\n state.reject('Request Payload is too big');\n size = 0;\n }\n if (!batch.length) {\n return undefined;\n }\n if (batch.length > 1) {\n const b = Buffer.alloc(8);\n b.writeUInt32LE(MessageContainer.CONSTRUCTOR_ID, 0);\n b.writeInt32LE(batch.length, 4);\n data = Buffer.concat([b, buffer.getValue()]);\n buffer = new BinaryWriter(Buffer.alloc(0));\n const containerId = await this._state.writeDataAsMessage(\n buffer, data, false,\n );\n for (const s of batch) {\n s.containerId = containerId;\n }\n }\n\n data = buffer.getValue();\n return {\n batch,\n data,\n };\n }\n\n rejectAll() {\n this._pendingStates.forEach((requestState) => {\n requestState.reject(new Error('Disconnect'));\n });\n }\n}\n\nmodule.exports = MessagePacker;\n","const { Mutex } = require('async-mutex');\n\nconst mutex = new Mutex();\n\nconst WebSocketClient = require('websocket').w3cwebsocket;\n\nconst closeError = new Error('WebSocket was closed');\n\nclass PromisedWebSockets {\n constructor(disconnectedCallback) {\n /* CONTEST\n this.isBrowser = typeof process === 'undefined' ||\n process.type === 'renderer' ||\n process.browser === true ||\n process.__nwjs\n\n */\n this.client = undefined;\n this.closed = true;\n this.disconnectedCallback = disconnectedCallback;\n }\n\n async readExactly(number) {\n let readData = Buffer.alloc(0);\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const thisTime = await this.read(number);\n readData = Buffer.concat([readData, thisTime]);\n number -= thisTime.length;\n if (!number) {\n return readData;\n }\n }\n }\n\n async read(number) {\n if (this.closed) {\n throw closeError;\n }\n await this.canRead;\n if (this.closed) {\n throw closeError;\n }\n const toReturn = this.stream.slice(0, number);\n this.stream = this.stream.slice(number);\n if (this.stream.length === 0) {\n this.canRead = new Promise((resolve) => {\n this.resolveRead = resolve;\n });\n }\n\n return toReturn;\n }\n\n async readAll() {\n if (this.closed || !await this.canRead) {\n throw closeError;\n }\n const toReturn = this.stream;\n this.stream = Buffer.alloc(0);\n this.canRead = new Promise((resolve) => {\n this.resolveRead = resolve;\n });\n\n return toReturn;\n }\n\n getWebSocketLink(ip, port) {\n if (port === 443) {\n return `wss://${ip}:${port}/apiws`;\n } else {\n return `ws://${ip}:${port}/apiws`;\n }\n }\n\n connect(port, ip) {\n this.stream = Buffer.alloc(0);\n this.canRead = new Promise((resolve) => {\n this.resolveRead = resolve;\n });\n this.closed = false;\n this.website = this.getWebSocketLink(ip, port);\n this.client = new WebSocketClient(this.website, 'binary');\n return new Promise((resolve, reject) => {\n this.client.onopen = () => {\n this.receive();\n resolve(this);\n };\n this.client.onerror = (error) => {\n // eslint-disable-next-line no-console\n console.error('WebSocket error', error);\n reject(error);\n };\n this.client.onclose = (event) => {\n const { code, reason, wasClean } = event;\n if (code !== 1000) {\n // eslint-disable-next-line no-console\n console.error(`Socket ${ip} closed. Code: ${code}, reason: ${reason}, was clean: ${wasClean}`);\n }\n\n this.resolveRead(false);\n this.closed = true;\n if (this.disconnectedCallback) {\n this.disconnectedCallback();\n }\n };\n // CONTEST\n // Seems to not be working, at least in a web worker\n // eslint-disable-next-line no-restricted-globals\n self.addEventListener('offline', async () => {\n await this.close();\n this.resolveRead(false);\n });\n });\n }\n\n write(data) {\n if (this.closed) {\n throw closeError;\n }\n this.client.send(data);\n }\n\n async close() {\n await this.client.close();\n this.closed = true;\n }\n\n receive() {\n this.client.onmessage = async (message) => {\n const release = await mutex.acquire();\n try {\n const data = message.data instanceof ArrayBuffer\n ? Buffer.from(message.data)\n : Buffer.from(await new Response(message.data).arrayBuffer());\n this.stream = Buffer.concat([this.stream, data]);\n this.resolveRead(true);\n } finally {\n release();\n }\n };\n }\n}\n\nmodule.exports = PromisedWebSockets;\n","const Logger = require('./Logger');\nconst BinaryWriter = require('./BinaryWriter');\nconst BinaryReader = require('./BinaryReader');\nconst PromisedWebSockets = require('./PromisedWebSockets');\nconst MessagePacker = require('./MessagePacker');\nconst AsyncQueue = require('./AsyncQueue');\n\nmodule.exports = {\n BinaryWriter,\n BinaryReader,\n MessagePacker,\n AsyncQueue,\n Logger,\n PromisedWebSockets,\n};\n","const Api = require('./tl/api');\nconst TelegramClient = require('./client/TelegramClient');\nconst connection = require('./network');\nconst tl = require('./tl');\nconst version = require('./Version');\nconst events = require('./events');\nconst utils = require('./Utils');\nconst errors = require('./errors');\nconst sessions = require('./sessions');\nconst extensions = require('./extensions');\nconst helpers = require('./Helpers');\n\nmodule.exports = {\n Api,\n TelegramClient,\n sessions,\n connection,\n extensions,\n tl,\n version,\n events,\n utils,\n errors,\n helpers,\n};\n","import bigInt from 'big-integer';\nimport {\n generateRandomBytes,\n modExp,\n readBigIntFromBuffer,\n readBufferFromBigInt,\n sha1,\n} from '../Helpers';\n\nconst PUBLIC_KEYS = [\n {\n fingerprint: bigInt('-3414540481677951611'),\n n: bigInt(\n '2937959817066933702298617714945612856538843112005886376816255642404751219133084745514657634448776440866'\n + '1701890505066208632169112269581063774293102577308490531282748465986139880977280302242772832972539403531'\n + '3160108704012876427630091361567343395380424193887227773571344877461690935390938502512438971889287359033'\n + '8945177273024525306296338410881284207988753897636046529094613963869149149606209957083647645485599631919'\n + '2747663615955633778034897140982517446405334423701359108810182097749467210509584293428076654573384828809'\n + '574217079944388301239431309115013843331317877374435868468779972014486325557807783825502498215169806323',\n ),\n e: 65537,\n },\n];\n\nexport const _serverKeys = new Map();\n\nPUBLIC_KEYS.forEach(({ fingerprint, ...keyInfo }) => {\n _serverKeys.set(fingerprint.toString(),\n keyInfo);\n});\n\n/**\n * Encrypts the given data known the fingerprint to be used\n * in the way Telegram requires us to do so (sha1(data) + data + padding)\n\n * @param fingerprint the fingerprint of the RSA key.\n * @param data the data to be encrypted.\n * @returns {Buffer|*|undefined} the cipher text, or undefined if no key matching this fingerprint is found.\n */\nexport async function encrypt(fingerprint: bigInt.BigInteger, data: Buffer) {\n const key = _serverKeys.get(fingerprint.toString());\n if (!key) {\n return undefined;\n }\n\n // len(sha1.digest) is always 20, so we're left with 255 - 20 - x padding\n const rand = generateRandomBytes(235 - data.length);\n\n const toEncrypt = Buffer.concat([await sha1(data), data, rand]);\n\n // rsa module rsa.encrypt adds 11 bits for padding which we don't want\n // rsa module uses rsa.transform.bytes2int(to_encrypt), easier way:\n const payload = readBigIntFromBuffer(toEncrypt, false);\n const encrypted = modExp(payload, bigInt(key.e), key.n);\n // rsa module uses transform.int2bytes(encrypted, keylength), easier:\n return readBufferFromBigInt(encrypted, 256, false);\n}\n","/**\n * Executes the authentication process with the Telegram servers.\n * @param sender a connected {MTProtoPlainSender}.\n * @param log\n * @returns {Promise<{authKey: *, timeOffset: *}>}\n */\n// eslint-disable-next-line import/no-named-default\nimport { default as Api } from '../tl/api';\nimport { SecurityError } from '../errors';\n// eslint-disable-next-line import/no-named-default\nimport { default as MTProtoPlainSender } from './MTProtoPlainSender';\nimport { _serverKeys } from '../crypto/RSA';\n\nconst bigInt = require('big-integer');\nconst IGE = require('../crypto/IGE');\nconst AuthKey = require('../crypto/AuthKey');\nconst Factorizator = require('../crypto/Factorizator');\nconst Helpers = require('../Helpers');\nconst BinaryReader = require('../extensions/BinaryReader');\n\nconst RETRIES = 20;\n\nexport async function doAuthentication(sender: MTProtoPlainSender, log: any) {\n // Step 1 sending: PQ Request, endianness doesn't matter since it's random\n let bytes = Helpers.generateRandomBytes(16);\n\n const nonce = Helpers.readBigIntFromBuffer(bytes, false, true);\n const resPQ = await sender.send(new Api.ReqPqMulti({ nonce }));\n log.debug('Starting authKey generation step 1');\n\n if (!(resPQ instanceof Api.ResPQ)) {\n throw new SecurityError(`Step 1 answer was ${resPQ}`);\n }\n if (resPQ.nonce.neq(nonce)) {\n throw new SecurityError('Step 1 invalid nonce from server');\n }\n const pq = Helpers.readBigIntFromBuffer(resPQ.pq, false, true);\n log.debug('Finished authKey generation step 1');\n // Step 2 sending: DH Exchange\n const { p, q } = Factorizator.factorize(pq);\n\n const pBuffer = Helpers.getByteArray(p);\n const qBuffer = Helpers.getByteArray(q);\n\n bytes = Helpers.generateRandomBytes(32);\n const newNonce = Helpers.readBigIntFromBuffer(bytes, true, true);\n const pqInnerData = new Api.PQInnerData({\n pq: Helpers.getByteArray(pq), // unsigned\n p: pBuffer,\n q: qBuffer,\n nonce: resPQ.nonce,\n serverNonce: resPQ.serverNonce,\n newNonce,\n }).getBytes();\n if (pqInnerData.length > 144) {\n throw new SecurityError('Step 1 invalid nonce from server');\n }\n let targetFingerprint;\n let targetKey;\n for (const fingerprint of resPQ.serverPublicKeyFingerprints) {\n targetKey = _serverKeys.get(fingerprint.toString());\n if (targetKey !== undefined) {\n targetFingerprint = fingerprint;\n break;\n }\n }\n if (targetFingerprint === undefined || targetKey === undefined) {\n throw new SecurityError(\n 'Step 2 could not find a valid key for fingerprints',\n );\n }\n // Value should be padded to be made 192 exactly\n const padding = Helpers.generateRandomBytes(192 - pqInnerData.length);\n const dataWithPadding = Buffer.concat([pqInnerData, padding]);\n const dataPadReversed = Buffer.from(dataWithPadding).reverse();\n\n let encryptedData;\n for (let i = 0; i < RETRIES; i++) {\n const tempKey = Helpers.generateRandomBytes(32);\n const shaDigestKeyWithData = await Helpers.sha256(Buffer.concat([tempKey, dataWithPadding]));\n const dataWithHash = Buffer.concat([dataPadReversed, shaDigestKeyWithData]);\n\n const ige = new IGE(tempKey, Buffer.alloc(32));\n const aesEncrypted = ige.encryptIge(dataWithHash);\n const tempKeyXor = Helpers.bufferXor(tempKey, await Helpers.sha256(aesEncrypted));\n\n const keyAesEncrypted = Buffer.concat([tempKeyXor, aesEncrypted]);\n const keyAesEncryptedInt = Helpers.readBigIntFromBuffer(keyAesEncrypted, false, false);\n if (keyAesEncryptedInt.greaterOrEquals(targetKey.n)) {\n log.debug('Aes key greater than RSA. retrying');\n continue;\n }\n const encryptedDataBuffer = Helpers.modExp(keyAesEncryptedInt, bigInt(targetKey.e), targetKey.n);\n encryptedData = Helpers.readBufferFromBigInt(encryptedDataBuffer, 256, false, false);\n\n break;\n }\n if (encryptedData === undefined) {\n throw new SecurityError(\n 'Step 2 could create a secure encrypted key',\n );\n }\n log.debug('Step 2 : Generated a secure aes encrypted data');\n\n const serverDhParams = await sender.send(\n new Api.ReqDHParams({\n nonce: resPQ.nonce,\n serverNonce: resPQ.serverNonce,\n p: pBuffer,\n q: qBuffer,\n publicKeyFingerprint: targetFingerprint,\n encryptedData,\n }),\n );\n\n if (\n !(\n serverDhParams instanceof Api.ServerDHParamsOk\n || serverDhParams instanceof Api.ServerDHParamsFail\n )\n ) {\n throw new Error(`Step 2.1 answer was ${serverDhParams}`);\n }\n if (serverDhParams.nonce.neq(resPQ.nonce)) {\n throw new SecurityError('Step 2 invalid nonce from server');\n }\n\n if (serverDhParams.serverNonce.neq(resPQ.serverNonce)) {\n throw new SecurityError('Step 2 invalid server nonce from server');\n }\n\n if (serverDhParams instanceof Api.ServerDHParamsFail) {\n const sh = await Helpers.sha1(\n Helpers.toSignedLittleBuffer(newNonce, 32).slice(4, 20),\n );\n const nnh = Helpers.readBigIntFromBuffer(sh, true, true);\n if (serverDhParams.newNonceHash.neq(nnh)) {\n throw new SecurityError('Step 2 invalid DH fail nonce from server');\n }\n }\n if (!(serverDhParams instanceof Api.ServerDHParamsOk)) {\n throw new Error(`Step 2.2 answer was ${serverDhParams}`);\n }\n log.debug('Finished authKey generation step 2');\n log.debug('Starting authKey generation step 3');\n\n // Step 3 sending: Complete DH Exchange\n const { key, iv } = await Helpers.generateKeyDataFromNonce(\n resPQ.serverNonce,\n newNonce,\n );\n if (serverDhParams.encryptedAnswer.length % 16 !== 0) {\n // See PR#453\n throw new SecurityError('Step 3 AES block size mismatch');\n }\n const ige = new IGE(key, iv);\n const plainTextAnswer = ige.decryptIge(serverDhParams.encryptedAnswer);\n const reader = new BinaryReader(plainTextAnswer);\n reader.read(20); // hash sum\n const serverDhInner = reader.tgReadObject();\n if (!(serverDhInner instanceof Api.ServerDHInnerData)) {\n throw new Error(`Step 3 answer was ${serverDhInner}`);\n }\n\n if (serverDhInner.nonce.neq(resPQ.nonce)) {\n throw new SecurityError('Step 3 Invalid nonce in encrypted answer');\n }\n if (serverDhInner.serverNonce.neq(resPQ.serverNonce)) {\n throw new SecurityError(\n 'Step 3 Invalid server nonce in encrypted answer',\n );\n }\n const dhPrime = Helpers.readBigIntFromBuffer(\n serverDhInner.dhPrime,\n false,\n false,\n );\n const ga = Helpers.readBigIntFromBuffer(serverDhInner.gA, false, false);\n const timeOffset = serverDhInner.serverTime - Math.floor(new Date().getTime() / 1000);\n const b = Helpers.readBigIntFromBuffer(\n Helpers.generateRandomBytes(256),\n false,\n false,\n );\n const gb = Helpers.modExp(bigInt(serverDhInner.g), b, dhPrime);\n const gab = Helpers.modExp(ga, b, dhPrime);\n\n // Prepare client DH Inner Data\n const clientDhInner = new Api.ClientDHInnerData({\n nonce: resPQ.nonce,\n serverNonce: resPQ.serverNonce,\n retryId: bigInt.zero, // TODO Actual retry ID\n gB: Helpers.getByteArray(gb, false),\n }).getBytes();\n\n const clientDdhInnerHashed = Buffer.concat([\n await Helpers.sha1(clientDhInner),\n clientDhInner,\n ]);\n // Encryption\n\n const clientDhEncrypted = ige.encryptIge(clientDdhInnerHashed);\n const dhGen = await sender.send(\n new Api.SetClientDHParams({\n nonce: resPQ.nonce,\n serverNonce: resPQ.serverNonce,\n encryptedData: clientDhEncrypted,\n }),\n );\n const nonceTypes = [Api.DhGenOk, Api.DhGenRetry, Api.DhGenFail];\n // TS being weird again.\n const nonceTypesString = ['DhGenOk', 'DhGenRetry', 'DhGenFail'];\n if (\n !(\n dhGen instanceof nonceTypes[0]\n || dhGen instanceof nonceTypes[1]\n || dhGen instanceof nonceTypes[2]\n )\n ) {\n throw new Error(`Step 3.1 answer was ${dhGen}`);\n }\n const { name } = dhGen.constructor;\n if (dhGen.nonce.neq(resPQ.nonce)) {\n throw new SecurityError(`Step 3 invalid ${name} nonce from server`);\n }\n if (dhGen.serverNonce.neq(resPQ.serverNonce)) {\n throw new SecurityError(\n `Step 3 invalid ${name} server nonce from server`,\n );\n }\n const authKey = new AuthKey();\n await authKey.setKey(Helpers.getByteArray(gab));\n\n const nonceNumber = 1 + nonceTypesString.indexOf(dhGen.className);\n\n const newNonceHash = await authKey.calcNewNonceHash(newNonce, nonceNumber);\n // @ts-ignore\n const dhHash = dhGen[`newNonceHash${nonceNumber}`];\n\n if (dhHash.neq(newNonceHash)) {\n throw new SecurityError('Step 3 invalid new nonce hash');\n }\n\n if (!(dhGen instanceof Api.DhGenOk)) {\n throw new Error(`Step 3.2 answer was ${dhGen}`);\n }\n log.debug('Finished authKey generation step 3');\n\n return { authKey, timeOffset };\n}\n","/**\n * This module contains the class used to communicate with Telegram's servers\n * in plain text, when no authorization key has been created yet.\n */\nconst BigInt = require('big-integer');\nconst MTProtoState = require('./MTProtoState');\nconst BinaryReader = require('../extensions/BinaryReader');\nconst { InvalidBufferError } = require('../errors/Common');\nconst { toSignedLittleBuffer } = require('../Helpers');\n\n/**\n * MTProto Mobile Protocol plain sender (https://core.telegram.org/mtproto/description#unencrypted-messages)\n */\n\nclass MTProtoPlainSender {\n /**\n * Initializes the MTProto plain sender.\n * @param connection connection: the Connection to be used.\n * @param loggers\n */\n constructor(connection, loggers) {\n this._state = new MTProtoState(connection, loggers);\n this._connection = connection;\n }\n\n /**\n * Sends and receives the result for the given request.\n * @param request\n */\n async send(request) {\n let body = request.getBytes();\n let msgId = this._state._getNewMsgId();\n const m = toSignedLittleBuffer(msgId, 8);\n const b = Buffer.alloc(4);\n b.writeInt32LE(body.length, 0);\n\n const res = Buffer.concat([Buffer.concat([Buffer.alloc(8), m, b]), body]);\n\n await this._connection.send(res);\n body = await this._connection.recv();\n if (body.length < 8) {\n throw new InvalidBufferError(body);\n }\n const reader = new BinaryReader(body);\n const authKeyId = reader.readLong();\n if (authKeyId.neq(BigInt(0))) {\n throw new Error('Bad authKeyId');\n }\n msgId = reader.readLong();\n if (msgId.eq(BigInt(0))) {\n throw new Error('Bad msgId');\n }\n /** ^ We should make sure that the read ``msg_id`` is greater\n * than our own ``msg_id``. However, under some circumstances\n * (bad system clock/working behind proxies) this seems to not\n * be the case, which would cause endless assertion errors.\n */\n\n const length = reader.readInt();\n if (length <= 0) {\n throw new Error('Bad length');\n }\n /**\n * We could read length bytes and use those in a new reader to read\n * the next TLObject without including the padding, but since the\n * reader isn't used for anything else after this, it's unnecessary.\n */\n return reader.tgReadObject();\n }\n}\n\nmodule.exports = MTProtoPlainSender;\n","const MtProtoPlainSender = require('./MTProtoPlainSender');\nconst MTProtoState = require('./MTProtoState');\nconst Helpers = require('../Helpers');\nconst AuthKey = require('../crypto/AuthKey');\nconst { doAuthentication } = require('./Authenticator');\nconst RPCResult = require('../tl/core/RPCResult');\nconst MessageContainer = require('../tl/core/MessageContainer');\nconst GZIPPacked = require('../tl/core/GZIPPacked');\nconst RequestState = require('./RequestState');\n\nconst {\n MsgsAck,\n upload,\n MsgsStateInfo,\n Pong,\n} = require('../tl').constructors;\nconst MessagePacker = require('../extensions/MessagePacker');\nconst BinaryReader = require('../extensions/BinaryReader');\nconst { UpdateConnectionState, UpdateServerTimeOffset } = require('./index');\nconst { BadMessageError } = require('../errors/Common');\nconst {\n BadServerSalt,\n BadMsgNotification,\n MsgDetailedInfo,\n MsgNewDetailedInfo,\n NewSessionCreated,\n FutureSalts,\n MsgsStateReq,\n MsgResendReq,\n MsgsAllInfo,\n} = require('../tl').constructors;\nconst { SecurityError } = require('../errors/Common');\nconst { InvalidBufferError } = require('../errors/Common');\nconst { LogOut } = require('../tl').requests.auth;\nconst { RPCMessageToError } = require('../errors');\nconst { TypeNotFoundError } = require('../errors/Common');\n\n\n/**\n * MTProto Mobile Protocol sender\n * (https://core.telegram.org/mtproto/description)\n * This class is responsible for wrapping requests into `TLMessage`'s,\n * sending them over the network and receiving them in a safe manner.\n *\n * Automatic reconnection due to temporary network issues is a concern\n * for this class as well, including retry of messages that could not\n * be sent successfully.\n *\n * A new authorization key will be generated on connection if no other\n * key exists yet.\n */\nclass MTProtoSender {\n static DEFAULT_OPTIONS = {\n logger: undefined,\n retries: Infinity,\n delay: 2000,\n autoReconnect: true,\n connectTimeout: undefined,\n authKeyCallback: undefined,\n updateCallback: undefined,\n autoReconnectCallback: undefined,\n isMainSender: undefined,\n onConnectionBreak: undefined,\n };\n\n /**\n * @param authKey\n * @param opts\n */\n constructor(authKey, opts) {\n const args = { ...MTProtoSender.DEFAULT_OPTIONS, ...opts };\n this._connection = undefined;\n this._log = args.logger;\n this._dcId = args.dcId;\n this._retries = args.retries;\n this._delay = args.delay;\n this._autoReconnect = args.autoReconnect;\n this._connectTimeout = args.connectTimeout;\n this._authKeyCallback = args.authKeyCallback;\n this._updateCallback = args.updateCallback;\n this._autoReconnectCallback = args.autoReconnectCallback;\n this._isMainSender = args.isMainSender;\n this._onConnectionBreak = args.onConnectionBreak;\n\n\n /**\n * whether we disconnected ourself or telegram did it.\n */\n this.userDisconnected = false;\n\n /**\n * Whether the user has explicitly connected or disconnected.\n *\n * If a disconnection happens for any other reason and it\n * was *not* user action then the pending messages won't\n * be cleared but on explicit user disconnection all the\n * pending futures should be cancelled.\n */\n this._user_connected = false;\n this._reconnecting = false;\n this._disconnected = true;\n\n /**\n * We need to join the loops upon disconnection\n */\n this._send_loop_handle = undefined;\n this._recv_loop_handle = undefined;\n\n /**\n * Preserving the references of the AuthKey and state is important\n */\n this.authKey = authKey || new AuthKey();\n this._state = new MTProtoState(this.authKey, this._log);\n\n /**\n * Outgoing messages are put in a queue and sent in a batch.\n * Note that here we're also storing their ``_RequestState``.\n */\n this._send_queue = new MessagePacker(this._state, this._log);\n\n /**\n * Sent states are remembered until a response is received.\n */\n this._pending_state = {};\n\n /**\n * Responses must be acknowledged, and we can also batch these.\n */\n this._pending_ack = new Set();\n\n /**\n * Similar to pending_messages but only for the last acknowledges.\n * These can't go in pending_messages because no acknowledge for them\n * is received, but we may still need to resend their state on bad salts.\n */\n this._last_acks = [];\n\n /**\n * Jump table from response ID to method that handles it\n */\n\n this._handlers = {\n [RPCResult.CONSTRUCTOR_ID]: this._handleRPCResult.bind(this),\n [MessageContainer.CONSTRUCTOR_ID]: this._handleContainer.bind(this),\n [GZIPPacked.CONSTRUCTOR_ID]: this._handleGzipPacked.bind(this),\n [Pong.CONSTRUCTOR_ID]: this._handlePong.bind(this),\n [BadServerSalt.CONSTRUCTOR_ID]: this._handleBadServerSalt.bind(this),\n [BadMsgNotification.CONSTRUCTOR_ID]: this._handleBadNotification.bind(this),\n [MsgDetailedInfo.CONSTRUCTOR_ID]: this._handleDetailedInfo.bind(this),\n [MsgNewDetailedInfo.CONSTRUCTOR_ID]: this._handleNewDetailedInfo.bind(this),\n [NewSessionCreated.CONSTRUCTOR_ID]: this._handleNewSessionCreated.bind(this),\n [MsgsAck.CONSTRUCTOR_ID]: this._handleAck.bind(this),\n [FutureSalts.CONSTRUCTOR_ID]: this._handleFutureSalts.bind(this),\n [MsgsStateReq.CONSTRUCTOR_ID]: this._handleStateForgotten.bind(this),\n [MsgResendReq.CONSTRUCTOR_ID]: this._handleStateForgotten.bind(this),\n [MsgsAllInfo.CONSTRUCTOR_ID]: this._handleMsgAll.bind(this),\n };\n }\n\n // Public API\n\n /**\n * Connects to the specified given connection using the given auth key.\n * @param connection\n * @param [force]\n * @returns {Promise}\n */\n async connect(connection, force) {\n if (this._user_connected && !force) {\n this._log.info('User is already connected!');\n return false;\n }\n this.isConnecting = true;\n this._connection = connection;\n\n for (let attempt = 0; attempt < this._retries; attempt++) {\n try {\n await this._connect();\n if (this._updateCallback) {\n this._updateCallback(new UpdateConnectionState(UpdateConnectionState.connected));\n }\n break;\n } catch (err) {\n if (this._updateCallback && attempt === 0) {\n this._updateCallback(new UpdateConnectionState(UpdateConnectionState.disconnected));\n }\n this._log.error(`WebSocket connection failed attempt: ${attempt + 1}`);\n // eslint-disable-next-line no-console\n console.error(err);\n await Helpers.sleep(this._delay);\n }\n }\n this.isConnecting = false;\n return true;\n }\n\n isConnected() {\n return this._user_connected;\n }\n\n /**\n * Cleanly disconnects the instance from the network, cancels\n * all pending requests, and closes the send and receive loops.\n */\n async disconnect() {\n this.userDisconnected = true;\n await this._disconnect();\n }\n\n /**\n *\n This method enqueues the given request to be sent. Its send\n state will be saved until a response arrives, and a ``Future``\n that will be resolved when the response arrives will be returned:\n\n .. code-block:: javascript\n\n async def method():\n # Sending (enqueued for the send loop)\n future = sender.send(request)\n # Receiving (waits for the receive loop to read the result)\n result = await future\n\n Designed like this because Telegram may send the response at\n any point, and it can send other items while one waits for it.\n Once the response for this future arrives, it is set with the\n received result, quite similar to how a ``receive()`` call\n would otherwise work.\n\n Since the receiving part is \"built in\" the future, it's\n impossible to await receive a result that was never sent.\n * @param request\n * @returns {RequestState}\n */\n send(request) {\n if (!this._user_connected) {\n throw new Error('Cannot send requests while disconnected');\n }\n const state = new RequestState(request);\n this._send_queue.append(state);\n return state.promise;\n }\n\n /**\n * Same as send but returns the full state. usefull for invoke after logic\n * @param request\n * @return {RequestState}\n */\n sendWithInvokeSupport(request) {\n if (!this._user_connected) {\n throw new Error('Cannot send requests while disconnected');\n }\n const state = new RequestState(request, undefined, this._pending_state);\n this._send_queue.append(state);\n return state;\n }\n\n /**\n * Performs the actual connection, retrying, generating the\n * authorization key if necessary, and starting the send and\n * receive loops.\n * @returns {Promise}\n * @private\n */\n async _connect() {\n this._log.info('Connecting to {0}...'.replace('{0}', this._connection));\n await this._connection.connect();\n this._log.debug('Connection success!');\n // process.exit(0)\n if (!this.authKey.getKey()) {\n const plain = new MtProtoPlainSender(this._connection, this._log);\n this._log.debug('New auth_key attempt ...');\n const res = await doAuthentication(plain, this._log);\n this._log.debug('Generated new auth_key successfully');\n await this.authKey.setKey(res.authKey);\n\n this._state.timeOffset = res.timeOffset;\n\n if (this._updateCallback) {\n this._updateCallback(new UpdateServerTimeOffset(this._state.timeOffset));\n }\n\n /**\n * This is *EXTREMELY* important since we don't control\n * external references to the authorization key, we must\n * notify whenever we change it. This is crucial when we\n * switch to different data centers.\n */\n if (this._authKeyCallback) {\n await this._authKeyCallback(this.authKey, this._dcId);\n }\n } else {\n this._authenticated = true;\n this._log.debug('Already have an auth key ...');\n }\n this._user_connected = true;\n this._reconnecting = false;\n\n this._log.debug('Starting send loop');\n this._send_loop_handle = this._sendLoop();\n\n this._log.debug('Starting receive loop');\n this._recv_loop_handle = this._recvLoop();\n\n // _disconnected only completes after manual disconnection\n // or errors after which the sender cannot continue such\n // as failing to reconnect or any unexpected error.\n\n this._log.info('Connection to %s complete!'.replace('%s', this._connection.toString()));\n }\n\n async _disconnect() {\n this._send_queue.rejectAll();\n\n if (this._connection === undefined) {\n this._log.info('Not disconnecting (already have no connection)');\n return;\n }\n if (this._updateCallback) {\n this._updateCallback(new UpdateConnectionState(UpdateConnectionState.disconnected));\n }\n this._log.info('Disconnecting from %s...'.replace('%s', this._connection.toString()));\n this._user_connected = false;\n this._log.debug('Closing current connection...');\n await this._connection.disconnect();\n }\n\n /**\n * This loop is responsible for popping items off the send\n * queue, encrypting them, and sending them over the network.\n * Besides `connect`, only this method ever sends data.\n * @returns {Promise}\n * @private\n */\n async _sendLoop() {\n this._send_queue = new MessagePacker(this._state, this._log);\n\n while (this._user_connected && !this._reconnecting) {\n if (this._pending_ack.size) {\n const ack = new RequestState(new MsgsAck({ msgIds: Array(...this._pending_ack) }));\n this._send_queue.append(ack);\n this._last_acks.push(ack);\n this._pending_ack.clear();\n }\n this._log.debug(`Waiting for messages to send...${this._reconnecting}`);\n // TODO Wait for the connection send queue to be empty?\n // This means that while it's not empty we can wait for\n // more messages to be added to the send queue.\n const res = await this._send_queue.get();\n\n if (this._reconnecting) {\n return;\n }\n\n if (!res) {\n continue;\n }\n let { data } = res;\n const { batch } = res;\n this._log.debug(`Encrypting ${batch.length} message(s) in ${data.length} bytes for sending`);\n\n data = await this._state.encryptMessageData(data);\n\n try {\n await this._connection.send(data);\n } catch (e) {\n this._log.error(e);\n this._log.info('Connection closed while sending data');\n return;\n }\n for (const state of batch) {\n if (!Array.isArray(state)) {\n if (state.request.classType === 'request') {\n this._pending_state[state.msgId] = state;\n }\n } else {\n for (const s of state) {\n if (s.request.classType === 'request') {\n this._pending_state[s.msgId] = s;\n }\n }\n }\n }\n this._log.debug('Encrypted messages put in a queue to be sent');\n }\n }\n\n async _recvLoop() {\n let body;\n let message;\n\n while (this._user_connected && !this._reconnecting) {\n // this._log.debug('Receiving items from the network...');\n this._log.debug('Receiving items from the network...');\n try {\n body = await this._connection.recv();\n } catch (e) {\n // this._log.info('Connection closed while receiving data');\n /** when the server disconnects us we want to reconnect */\n if (!this.userDisconnected) {\n this._log.error(e);\n this._log.warn('Connection closed while receiving data');\n this.reconnect();\n }\n return;\n }\n try {\n message = await this._state.decryptMessageData(body);\n } catch (e) {\n if (e instanceof TypeNotFoundError) {\n // Received object which we don't know how to deserialize\n this._log.info(`Type ${e.invalidConstructorId} not found, remaining data ${e.remaining}`);\n continue;\n } else if (e instanceof SecurityError) {\n // A step while decoding had the incorrect data. This message\n // should not be considered safe and it should be ignored.\n this._log.warn(`Security error while unpacking a received message: ${e}`);\n continue;\n } else if (e instanceof InvalidBufferError) {\n // 404 means that the server has \"forgotten\" our auth key and we need to create a new one.\n if (e.code === 404) {\n this._log.warn(`Broken authorization key for dc ${this._dcId}; resetting`);\n if (this._updateCallback && this._isMainSender) {\n this._updateCallback(new UpdateConnectionState(UpdateConnectionState.broken));\n } else if (this._onConnectionBreak && !this._isMainSender) {\n // Deletes the current sender from the object\n this._onConnectionBreak(this._dcId);\n }\n } else {\n // this happens sometimes when telegram is having some internal issues.\n // reconnecting should be enough usually\n // since the data we sent and received is probably wrong now.\n this._log.warn(`Invalid buffer ${e.code} for dc ${this._dcId}`);\n this.reconnect();\n }\n return;\n } else {\n this._log.error('Unhandled error while receiving data');\n this._log.error(e);\n this.reconnect();\n return;\n }\n }\n try {\n await this._processMessage(message);\n } catch (e) {\n this._log.error('Unhandled error while receiving data');\n this._log.error(e);\n }\n }\n }\n\n // Response Handlers\n\n /**\n * Adds the given message to the list of messages that must be\n * acknowledged and dispatches control to different ``_handle_*``\n * method based on its type.\n * @param message\n * @returns {Promise}\n * @private\n */\n async _processMessage(message) {\n this._pending_ack.add(message.msgId);\n // eslint-disable-next-line require-atomic-updates\n message.obj = await message.obj;\n let handler = this._handlers[message.obj.CONSTRUCTOR_ID];\n if (!handler) {\n handler = this._handleUpdate.bind(this);\n }\n\n await handler(message);\n }\n\n /**\n * Pops the states known to match the given ID from pending messages.\n * This method should be used when the response isn't specific.\n * @param msgId\n * @returns {*[]}\n * @private\n */\n _popStates(msgId) {\n let state = this._pending_state[msgId];\n if (state) {\n this._pending_state[msgId].deferred.resolve();\n delete this._pending_state[msgId];\n return [state];\n }\n\n const toPop = [];\n\n for (state of Object.values(this._pending_state)) {\n if (state.containerId && state.containerId.equals(msgId)) {\n toPop.push(state.msgId);\n }\n }\n\n if (toPop.length) {\n const temp = [];\n for (const x of toPop) {\n temp.push(this._pending_state[x]);\n this._pending_state[x].deferred.resolve();\n delete this._pending_state[x];\n }\n return temp;\n }\n\n for (const ack of this._last_acks) {\n if (ack.msgId === msgId) {\n return [ack];\n }\n }\n\n return [];\n }\n\n /**\n * Handles the result for Remote Procedure Calls:\n * rpc_result#f35c6d01 req_msg_id:long result:bytes = RpcResult;\n * This is where the future results for sent requests are set.\n * @param message\n * @returns {Promise}\n * @private\n */\n _handleRPCResult(message) {\n const result = message.obj;\n const state = this._pending_state[result.reqMsgId];\n if (state) {\n state.deferred.resolve();\n delete this._pending_state[result.reqMsgId];\n }\n this._log.debug(`Handling RPC result for message ${result.reqMsgId}`);\n\n if (!state) {\n // TODO We should not get responses to things we never sent\n // However receiving a File() with empty bytes is \"common\".\n // See #658, #759 and #958. They seem to happen in a container\n // which contain the real response right after.\n try {\n const reader = new BinaryReader(result.body);\n if (!(reader.tgReadObject() instanceof upload.File)) {\n throw new TypeNotFoundError('Not an upload.File');\n }\n } catch (e) {\n this._log.error(e);\n if (e instanceof TypeNotFoundError) {\n this._log.info(`Received response without parent request: ${result.body}`);\n return;\n } else {\n throw e;\n }\n }\n }\n if (result.error) {\n // eslint-disable-next-line new-cap\n const error = RPCMessageToError(result.error, state.request);\n this._send_queue.append(new RequestState(new MsgsAck({ msgIds: [state.msgId] })));\n state.reject(error);\n } else {\n const reader = new BinaryReader(result.body);\n const read = state.request.readResult(reader);\n state.resolve(read);\n }\n }\n\n /**\n * Processes the inner messages of a container with many of them:\n * msg_container#73f1f8dc messages:vector<%Message> = MessageContainer;\n * @param message\n * @returns {Promise}\n * @private\n */\n async _handleContainer(message) {\n this._log.debug('Handling container');\n for (const innerMessage of message.obj.messages) {\n await this._processMessage(innerMessage);\n }\n }\n\n /**\n * Unpacks the data from a gzipped object and processes it:\n * gzip_packed#3072cfa1 packed_data:bytes = Object;\n * @param message\n * @returns {Promise}\n * @private\n */\n async _handleGzipPacked(message) {\n this._log.debug('Handling gzipped data');\n const reader = new BinaryReader(message.obj.data);\n message.obj = reader.tgReadObject();\n await this._processMessage(message);\n }\n\n _handleUpdate(message) {\n if (message.obj.SUBCLASS_OF_ID !== 0x8af52aac) {\n // crc32(b'Updates')\n this._log.warn(`Note: ${message.obj.className} is not an update, not dispatching it`);\n return;\n }\n this._log.debug(`Handling update ${message.obj.className}`);\n if (this._updateCallback) {\n this._updateCallback(message.obj);\n }\n }\n\n /**\n * Handles pong results, which don't come inside a ``RPCResult``\n * but are still sent through a request:\n * pong#347773c5 msg_id:long ping_id:long = Pong;\n * @param message\n * @returns {Promise}\n * @private\n */\n _handlePong(message) {\n const pong = message.obj;\n\n const newTimeOffset = this._state.updateTimeOffset(message.msgId);\n if (this._updateCallback) {\n this._updateCallback(new UpdateServerTimeOffset(newTimeOffset));\n }\n\n this._log.debug(`Handling pong for message ${pong.msgId}`);\n const state = this._pending_state[pong.msgId];\n this._pending_state[pong.msgId].deferred.resolve();\n delete this._pending_state[pong.msgId];\n\n // Todo Check result\n if (state) {\n state.resolve(pong);\n }\n }\n\n /**\n * Corrects the currently used server salt to use the right value\n * before enqueuing the rejected message to be re-sent:\n * bad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int\n * error_code:int new_server_salt:long = BadMsgNotification;\n * @param message\n * @returns {Promise}\n * @private\n */\n _handleBadServerSalt(message) {\n const badSalt = message.obj;\n this._log.debug(`Handling bad salt for message ${badSalt.badMsgId}`);\n this._state.salt = badSalt.newServerSalt;\n const states = this._popStates(badSalt.badMsgId);\n this._send_queue.extend(states);\n this._log.debug(`${states.length} message(s) will be resent`);\n }\n\n /**\n * Adjusts the current state to be correct based on the\n * received bad message notification whenever possible:\n * bad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int\n * error_code:int = BadMsgNotification;\n * @param message\n * @returns {Promise}\n * @private\n */\n _handleBadNotification(message) {\n const badMsg = message.obj;\n const states = this._popStates(badMsg.badMsgId);\n this._log.debug(`Handling bad msg ${JSON.stringify(badMsg)}`);\n if ([16, 17].includes(badMsg.errorCode)) {\n // Sent msg_id too low or too high (respectively).\n // Use the current msg_id to determine the right time offset.\n const newTimeOffset = this._state.updateTimeOffset(message.msgId);\n\n if (this._updateCallback) {\n this._updateCallback(new UpdateServerTimeOffset(newTimeOffset));\n }\n\n this._log.info(`System clock is wrong, set time offset to ${newTimeOffset}s`);\n } else if (badMsg.errorCode === 32) {\n // msg_seqno too low, so just pump it up by some \"large\" amount\n // TODO A better fix would be to start with a new fresh session ID\n this._state._sequence += 64;\n } else if (badMsg.errorCode === 33) {\n // msg_seqno too high never seems to happen but just in case\n this._state._sequence -= 16;\n } else {\n for (const state of states) {\n state.reject(new BadMessageError(state.request, badMsg.errorCode));\n }\n\n return;\n }\n // Messages are to be re-sent once we've corrected the issue\n this._send_queue.extend(states);\n this._log.debug(`${states.length} messages will be resent due to bad msg`);\n }\n\n /**\n * Updates the current status with the received detailed information:\n * msg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long\n * bytes:int status:int = MsgDetailedInfo;\n * @param message\n * @returns {Promise}\n * @private\n */\n _handleDetailedInfo(message) {\n // TODO https://goo.gl/VvpCC6\n const msgId = message.obj.answerMsgId;\n this._log.debug(`Handling detailed info for message ${msgId}`);\n this._pending_ack.add(msgId);\n }\n\n /**\n * Updates the current status with the received detailed information:\n * msg_new_detailed_info#809db6df answer_msg_id:long\n * bytes:int status:int = MsgDetailedInfo;\n * @param message\n * @returns {Promise}\n * @private\n */\n _handleNewDetailedInfo(message) {\n // TODO https://goo.gl/VvpCC6\n const msgId = message.obj.answerMsgId;\n this._log.debug(`Handling new detailed info for message ${msgId}`);\n this._pending_ack.add(msgId);\n }\n\n /**\n * Updates the current status with the received session information:\n * new_session_created#9ec20908 first_msg_id:long unique_id:long\n * server_salt:long = NewSession;\n * @param message\n * @returns {Promise}\n * @private\n */\n _handleNewSessionCreated(message) {\n // TODO https://goo.gl/LMyN7A\n this._log.debug('Handling new session created');\n this._state.salt = message.obj.serverSalt;\n }\n\n /**\n * Handles a server acknowledge about our messages. Normally\n * these can be ignored except in the case of ``auth.logOut``:\n *\n * auth.logOut#5717da40 = Bool;\n *\n * Telegram doesn't seem to send its result so we need to confirm\n * it manually. No other request is known to have this behaviour.\n\n * Since the ID of sent messages consisting of a container is\n * never returned (unless on a bad notification), this method\n * also removes containers messages when any of their inner\n * messages are acknowledged.\n\n * @param message\n * @returns {Promise}\n * @private\n */\n _handleAck(message) {\n const ack = message.obj;\n this._log.debug(`Handling acknowledge for ${ack.msgIds}`);\n for (const msgId of ack.msgIds) {\n const state = this._pending_state[msgId];\n if (state && state.request instanceof LogOut) {\n this._pending_state[msgId].deferred.resolve();\n delete this._pending_state[msgId];\n state.resolve(true);\n }\n }\n }\n\n /**\n * Handles future salt results, which don't come inside a\n * ``rpc_result`` but are still sent through a request:\n * future_salts#ae500895 req_msg_id:long now:int\n * salts:vector = FutureSalts;\n * @param message\n * @returns {Promise}\n * @private\n */\n _handleFutureSalts(message) {\n // TODO save these salts and automatically adjust to the\n // correct one whenever the salt in use expires.\n this._log.debug(`Handling future salts for message ${message.msgId}`);\n const state = this._pending_state[message.msgId];\n\n if (state) {\n this._pending_state[message].deferred.resolve();\n delete this._pending_state[message];\n state.resolve(message.obj);\n }\n }\n\n /**\n * Handles both :tl:`MsgsStateReq` and :tl:`MsgResendReq` by\n * enqueuing a :tl:`MsgsStateInfo` to be sent at a later point.\n * @param message\n * @returns {Promise}\n * @private\n */\n _handleStateForgotten(message) {\n this._send_queue.append(\n new RequestState(new MsgsStateInfo(message.msgId, String.fromCharCode(1)\n .repeat(message.obj.msgIds))),\n );\n }\n\n /**\n * Handles :tl:`MsgsAllInfo` by doing nothing (yet).\n * used as part of the telegram protocol https://core.telegram.org/mtproto/service_messages_about_messages\n * This message does not require an acknowledgment.\n * @param message\n * @returns {Promise}\n * @private\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _handleMsgAll(message) {\n }\n\n reconnect() {\n if (this._user_connected && !this._reconnecting) {\n this._reconnecting = true;\n // TODO Should we set this?\n // this._user_connected = false\n // we want to wait a second between each reconnect try to not flood the server with reconnects\n // in case of internal server issues.\n Helpers.sleep(1000).then(() => {\n this._log.info('Started reconnecting');\n this._reconnect();\n });\n }\n }\n\n async _reconnect() {\n this._log.debug('Closing current connection...');\n try {\n await this._disconnect();\n } catch (err) {\n this._log.warn(err);\n }\n\n this._send_queue.append(undefined);\n this._state.reset();\n\n // For some reason reusing existing connection caused stuck requests\n const newConnection = new this._connection.constructor(\n this._connection._ip,\n this._connection._port,\n this._connection._dcId,\n this._connection._log,\n );\n await this.connect(newConnection, true);\n\n this._reconnecting = false;\n // uncomment this if you want to resend\n // this._send_queue.extend(Object.values(this._pending_state))\n for (const state of Object.values(this._pending_state)) {\n state.deferred.resolve();\n }\n this._pending_state = {};\n if (this._autoReconnectCallback) {\n await this._autoReconnectCallback();\n }\n }\n}\n\nmodule.exports = MTProtoSender;\n","const BigInt = require('big-integer');\n\nconst Helpers = require('../Helpers');\nconst IGE = require('../crypto/IGE');\nconst BinaryReader = require('../extensions/BinaryReader');\nconst GZIPPacked = require('../tl/core/GZIPPacked');\nconst { TLMessage } = require('../tl/core');\nconst {\n SecurityError,\n InvalidBufferError,\n} = require('../errors/Common');\nconst { InvokeAfterMsg } = require('../tl').requests;\nconst {\n toSignedLittleBuffer,\n} = require('../Helpers');\n\nclass MTProtoState {\n /**\n *\n `telethon.network.mtprotosender.MTProtoSender` needs to hold a state\n in order to be able to encrypt and decrypt incoming/outgoing messages,\n as well as generating the message IDs. Instances of this class hold\n together all the required information.\n\n It doesn't make sense to use `telethon.sessions.abstract.Session` for\n the sender because the sender should *not* be concerned about storing\n this information to disk, as one may create as many senders as they\n desire to any other data center, or some CDN. Using the same session\n for all these is not a good idea as each need their own authkey, and\n the concept of \"copying\" sessions with the unnecessary entities or\n updates state for these connections doesn't make sense.\n\n While it would be possible to have a `MTProtoPlainState` that does no\n encryption so that it was usable through the `MTProtoLayer` and thus\n avoid the need for a `MTProtoPlainSender`, the `MTProtoLayer` is more\n focused to efficiency and this state is also more advanced (since it\n supports gzipping and invoking after other message IDs). There are too\n many methods that would be needed to make it convenient to use for the\n authentication process, at which point the `MTProtoPlainSender` is better\n * @param authKey\n * @param loggers\n */\n constructor(authKey, loggers) {\n this.authKey = authKey;\n this._log = loggers;\n this.timeOffset = 0;\n this.salt = 0;\n\n this.id = undefined;\n this._sequence = undefined;\n this._lastMsgId = undefined;\n this.reset();\n }\n\n /**\n * Resets the state\n */\n reset() {\n // Session IDs can be random on every connection\n this.id = Helpers.generateRandomLong(true);\n this._sequence = 0;\n this._lastMsgId = BigInt(0);\n }\n\n /**\n * Updates the message ID to a new one,\n * used when the time offset changed.\n * @param message\n */\n updateMessageId(message) {\n message.msgId = this._getNewMsgId();\n }\n\n /**\n * Calculate the key based on Telegram guidelines, specifying whether it's the client or not\n * @param authKey\n * @param msgKey\n * @param client\n * @returns {{iv: Buffer, key: Buffer}}\n */\n async _calcKey(authKey, msgKey, client) {\n const x = client === true ? 0 : 8;\n const [sha256a, sha256b] = await Promise.all([\n Helpers.sha256(Buffer.concat([msgKey, authKey.slice(x, x + 36)])),\n Helpers.sha256(Buffer.concat([authKey.slice(x + 40, x + 76), msgKey])),\n ]);\n const key = Buffer.concat([sha256a.slice(0, 8), sha256b.slice(8, 24), sha256a.slice(24, 32)]);\n const iv = Buffer.concat([sha256b.slice(0, 8), sha256a.slice(8, 24), sha256b.slice(24, 32)]);\n return {\n key,\n iv,\n };\n }\n\n /**\n * Writes a message containing the given data into buffer.\n * Returns the message id.\n * @param buffer\n * @param data\n * @param contentRelated\n * @param afterId\n */\n async writeDataAsMessage(buffer, data, contentRelated, afterId) {\n const msgId = this._getNewMsgId();\n const seqNo = this._getSeqNo(contentRelated);\n let body;\n if (!afterId) {\n body = await GZIPPacked.gzipIfSmaller(contentRelated, data);\n } else {\n // Invoke query expects a query with a getBytes func\n body = await GZIPPacked.gzipIfSmaller(contentRelated, new InvokeAfterMsg(afterId, {\n getBytes() {\n return data;\n },\n }).getBytes());\n }\n const s = Buffer.alloc(4);\n s.writeInt32LE(seqNo, 0);\n const b = Buffer.alloc(4);\n b.writeInt32LE(body.length, 0);\n const m = toSignedLittleBuffer(msgId, 8);\n buffer.write(Buffer.concat([m, s, b]));\n buffer.write(body);\n return msgId;\n }\n\n /**\n * Encrypts the given message data using the current authorization key\n * following MTProto 2.0 guidelines core.telegram.org/mtproto/description.\n * @param data\n */\n async encryptMessageData(data) {\n await this.authKey.waitForKey();\n const s = toSignedLittleBuffer(this.salt, 8);\n const i = toSignedLittleBuffer(this.id, 8);\n data = Buffer.concat([Buffer.concat([s, i]), data]);\n const padding = Helpers.generateRandomBytes(Helpers.mod(-(data.length + 12), 16) + 12);\n // Being substr(what, offset, length); x = 0 for client\n // \"msg_key_large = SHA256(substr(auth_key, 88+x, 32) + pt + padding)\"\n const msgKeyLarge = await Helpers.sha256(Buffer.concat([this.authKey.getKey()\n .slice(88, 88 + 32), data, padding]));\n // \"msg_key = substr (msg_key_large, 8, 16)\"\n const msgKey = msgKeyLarge.slice(8, 24);\n\n const {\n iv,\n key,\n } = await this._calcKey(this.authKey.getKey(), msgKey, true);\n\n const keyId = Helpers.readBufferFromBigInt(this.authKey.keyId, 8);\n return Buffer.concat([keyId, msgKey, new IGE(key, iv).encryptIge(Buffer.concat([data, padding]))]);\n }\n\n /**\n * Inverse of `encrypt_message_data` for incoming server messages.\n * @param body\n */\n async decryptMessageData(body) {\n if (body.length < 8) {\n throw new InvalidBufferError(body);\n }\n if (body.length < 0) { // length needs to be positive\n throw new SecurityError('Server replied with negative length');\n }\n if (body.length % 4 !== 0) {\n throw new SecurityError('Server replied with length not divisible by 4');\n }\n // TODO Check salt,sessionId, and sequenceNumber\n const keyId = Helpers.readBigIntFromBuffer(body.slice(0, 8));\n if (keyId.neq(this.authKey.keyId)) {\n throw new SecurityError('Server replied with an invalid auth key');\n }\n\n const msgKey = body.slice(8, 24);\n const {\n iv,\n key,\n } = await this._calcKey(this.authKey.getKey(), msgKey, false);\n body = new IGE(key, iv).decryptIge(body.slice(24));\n\n // https://core.telegram.org/mtproto/security_guidelines\n // Sections \"checking sha256 hash\" and \"message length\"\n\n const ourKey = await Helpers.sha256(Buffer.concat([this.authKey.getKey()\n .slice(96, 96 + 32), body]));\n\n if (!msgKey.equals(ourKey.slice(8, 24))) {\n throw new SecurityError('Received msg_key doesn\\'t match with expected one');\n }\n\n const reader = new BinaryReader(body);\n reader.readLong(); // removeSalt\n const serverId = reader.readLong();\n if (!serverId.eq(this.id)) {\n throw new SecurityError('Server replied with a wrong session ID');\n }\n\n const remoteMsgId = reader.readLong();\n const remoteSequence = reader.readInt();\n const containerLen = reader.readInt(); // msgLen for the inner object, padding ignored\n const diff = body.length - containerLen;\n // We want to check if it's between 12 and 1024\n // https://core.telegram.org/mtproto/security_guidelines#checking-message-length\n if (diff < 12 || diff > 1024) {\n throw new SecurityError('Server replied with the wrong message padding');\n }\n\n // We could read msg_len bytes and use those in a new reader to read\n // the next TLObject without including the padding, but since the\n // reader isn't used for anything else after this, it's unnecessary.\n const obj = reader.tgReadObject();\n\n return new TLMessage(remoteMsgId, remoteSequence, obj);\n }\n\n /**\n * Generates a new unique message ID based on the current\n * time (in ms) since epoch, applying a known time offset.\n * @private\n */\n _getNewMsgId() {\n const now = new Date().getTime() / 1000 + this.timeOffset;\n const nanoseconds = Math.floor((now - Math.floor(now)) * 1e9);\n let newMsgId = (BigInt(Math.floor(now))\n .shiftLeft(BigInt(32))).or(BigInt(nanoseconds)\n .shiftLeft(BigInt(2)));\n if (this._lastMsgId.greaterOrEquals(newMsgId)) {\n newMsgId = this._lastMsgId.add(BigInt(4));\n }\n this._lastMsgId = newMsgId;\n return newMsgId;\n }\n\n /**\n * Updates the time offset to the correct\n * one given a known valid message ID.\n * @param correctMsgId {BigInteger}\n */\n updateTimeOffset(correctMsgId) {\n const bad = this._getNewMsgId();\n const old = this.timeOffset;\n const now = Math.floor(new Date().getTime() / 1000);\n const correct = correctMsgId.shiftRight(BigInt(32));\n this.timeOffset = correct - now;\n\n if (this.timeOffset !== old) {\n this._lastMsgId = BigInt(0);\n this._log.debug(\n `Updated time offset (old offset ${old}, bad ${bad}, good ${correctMsgId}, new ${this.timeOffset})`,\n );\n }\n\n return this.timeOffset;\n }\n\n /**\n * Generates the next sequence number depending on whether\n * it should be for a content-related query or not.\n * @param contentRelated\n * @private\n */\n _getSeqNo(contentRelated) {\n if (contentRelated) {\n const result = this._sequence * 2 + 1;\n this._sequence += 1;\n return result;\n } else {\n return this._sequence * 2;\n }\n }\n}\n\nmodule.exports = MTProtoState;\n","const { createDeferred } = require('../Helpers');\n\nclass RequestState {\n constructor(request, after = undefined, pending = {}) {\n this.containerId = undefined;\n this.msgId = undefined;\n this.request = request;\n this.data = request.getBytes();\n this.after = after;\n this.result = undefined;\n this.pending = pending;\n this.deferred = createDeferred();\n this.promise = new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }\n\n isReady() {\n const state = this.pending[this.after.id];\n if (!state) {\n return true;\n }\n return state.deferred.promise;\n }\n}\n\nmodule.exports = RequestState;\n","const PromisedWebSockets = require('../../extensions/PromisedWebSockets');\nconst AsyncQueue = require('../../extensions/AsyncQueue');\n\n/**\n * The `Connection` class is a wrapper around ``asyncio.open_connection``.\n *\n * Subclasses will implement different transport modes as atomic operations,\n * which this class eases doing since the exposed interface simply puts and\n * gets complete data payloads to and from queues.\n *\n * The only error that will raise from send and receive methods is\n * ``ConnectionError``, which will raise when attempting to send if\n * the client is disconnected (includes remote disconnections).\n */\nclass Connection {\n PacketCodecClass = undefined;\n\n constructor(ip, port, dcId, loggers) {\n this._ip = ip;\n this._port = port;\n this._dcId = dcId;\n this._log = loggers;\n this._connected = false;\n this._sendTask = undefined;\n this._recvTask = undefined;\n this._codec = undefined;\n this._obfuscation = undefined; // TcpObfuscated and MTProxy\n this._sendArray = new AsyncQueue();\n this._recvArray = new AsyncQueue();\n // this.socket = new PromiseSocket(new Socket())\n\n this.socket = new PromisedWebSockets(this.disconnectCallback.bind(this));\n }\n\n async disconnectCallback() {\n await this.disconnect(true);\n }\n\n async _connect() {\n this._log.debug('Connecting');\n this._codec = new this.PacketCodecClass(this);\n await this.socket.connect(this._port, this._ip, this);\n this._log.debug('Finished connecting');\n // await this.socket.connect({host: this._ip, port: this._port});\n await this._initConn();\n }\n\n async connect() {\n await this._connect();\n this._connected = true;\n\n if (!this._sendTask) {\n this._sendTask = this._sendLoop();\n }\n this._recvTask = this._recvLoop();\n }\n\n async disconnect(fromCallback = false) {\n if (!this._connected) {\n return;\n }\n\n this._connected = false;\n void this._recvArray.push(undefined);\n if (!fromCallback) {\n await this.socket.close();\n }\n }\n\n async send(data) {\n if (!this._connected) {\n throw new Error('Not connected');\n }\n await this._sendArray.push(data);\n }\n\n async recv() {\n while (this._connected) {\n const result = await this._recvArray.pop();\n // null = sentinel value = keep trying\n if (result) {\n return result;\n }\n }\n throw new Error('Not connected');\n }\n\n async _sendLoop() {\n // TODO handle errors\n try {\n while (this._connected) {\n const data = await this._sendArray.pop();\n if (!data) {\n this._sendTask = undefined;\n return;\n }\n await this._send(data);\n }\n } catch (e) {\n this._log.info('The server closed the connection while sending');\n }\n }\n\n async _recvLoop() {\n let data;\n while (this._connected) {\n try {\n data = await this._recv();\n if (!data) {\n throw new Error('no data received');\n }\n } catch (e) {\n this._log.info('connection closed');\n // await this._recvArray.push()\n\n this.disconnect();\n return;\n }\n await this._recvArray.push(data);\n }\n }\n\n async _initConn() {\n if (this._codec.tag) {\n await this.socket.write(this._codec.tag);\n }\n }\n\n _send(data) {\n const encodedPacket = this._codec.encodePacket(data);\n this.socket.write(encodedPacket);\n }\n\n _recv() {\n return this._codec.readPacket(this.socket);\n }\n\n toString() {\n return `${this._ip}:${this._port}/${this.constructor.name.replace('Connection', '')}`;\n }\n}\n\nclass ObfuscatedConnection extends Connection {\n ObfuscatedIO = undefined;\n\n _initConn() {\n this._obfuscation = new this.ObfuscatedIO(this);\n this.socket.write(this._obfuscation.header);\n }\n\n _send(data) {\n this._obfuscation.write(this._codec.encodePacket(data));\n }\n\n\n _recv() {\n return this._codec.readPacket(this._obfuscation);\n }\n}\n\nclass PacketCodec {\n constructor(connection) {\n this._conn = connection;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n encodePacket(data) {\n throw new Error('Not Implemented');\n\n // Override\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n readPacket(reader) {\n // override\n throw new Error('Not Implemented');\n }\n}\n\nmodule.exports = {\n Connection,\n PacketCodec,\n ObfuscatedConnection,\n};\n","const BigInt = require('big-integer');\nconst { readBufferFromBigInt } = require('../../Helpers');\nconst {\n Connection,\n PacketCodec,\n} = require('./Connection');\n\nclass AbridgedPacketCodec extends PacketCodec {\n static tag = Buffer.from('ef', 'hex');\n\n static obfuscateTag = Buffer.from('efefefef', 'hex');\n\n constructor(props) {\n super(props);\n this.tag = AbridgedPacketCodec.tag;\n this.obfuscateTag = AbridgedPacketCodec.obfuscateTag;\n }\n\n encodePacket(data) {\n let length = data.length >> 2;\n if (length < 127) {\n const b = Buffer.alloc(1);\n b.writeUInt8(length, 0);\n length = b;\n } else {\n length = Buffer.concat([Buffer.from('7f', 'hex'), readBufferFromBigInt(BigInt(length), 3)]);\n }\n return Buffer.concat([length, data]);\n }\n\n async readPacket(reader) {\n const readData = await reader.read(1);\n let length = readData[0];\n if (length >= 127) {\n length = Buffer.concat([await reader.read(3), Buffer.alloc(1)])\n .readInt32LE(0);\n }\n\n return reader.read(length << 2);\n }\n}\n\n/**\n * This is the mode with the lowest overhead, as it will\n * only require 1 byte if the packet length is less than\n * 508 bytes (127 << 2, which is very common).\n */\nclass ConnectionTCPAbridged extends Connection {\n PacketCodecClass = AbridgedPacketCodec;\n}\n\nmodule.exports = {\n ConnectionTCPAbridged,\n AbridgedPacketCodec,\n};\n","const { generateRandomBytes } = require('../../Helpers');\nconst { ObfuscatedConnection } = require('./Connection');\nconst { AbridgedPacketCodec } = require('./TCPAbridged');\nconst CTR = require('../../crypto/CTR');\n\nclass ObfuscatedIO {\n header = undefined;\n\n constructor(connection) {\n this.connection = connection.socket;\n const res = this.initHeader(connection.PacketCodecClass);\n this.header = res.random;\n\n this._encrypt = res.encryptor;\n this._decrypt = res.decryptor;\n }\n\n initHeader(packetCodec) {\n // Obfuscated messages secrets cannot start with any of these\n const keywords = [Buffer.from('50567247', 'hex'), Buffer.from('474554', 'hex'),\n Buffer.from('504f5354', 'hex'), Buffer.from('eeeeeeee', 'hex')];\n let random;\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n random = generateRandomBytes(64);\n if (random[0] !== 0xef && !(random.slice(4, 8)\n .equals(Buffer.alloc(4)))) {\n let ok = true;\n for (const key of keywords) {\n if (key.equals(random.slice(0, 4))) {\n ok = false;\n break;\n }\n }\n if (ok) {\n break;\n }\n }\n }\n random = random.toJSON().data;\n\n const randomReversed = Buffer.from(random.slice(8, 56))\n .reverse();\n // Encryption has \"continuous buffer\" enabled\n const encryptKey = Buffer.from(random.slice(8, 40));\n const encryptIv = Buffer.from(random.slice(40, 56));\n const decryptKey = Buffer.from(randomReversed.slice(0, 32));\n const decryptIv = Buffer.from(randomReversed.slice(32, 48));\n const encryptor = new CTR(encryptKey, encryptIv);\n const decryptor = new CTR(decryptKey, decryptIv);\n\n random = Buffer.concat([\n Buffer.from(random.slice(0, 56)), packetCodec.obfuscateTag, Buffer.from(random.slice(60)),\n ]);\n random = Buffer.concat([\n Buffer.from(random.slice(0, 56)), Buffer.from(encryptor.encrypt(random)\n .slice(56, 64)), Buffer.from(random.slice(64)),\n ]);\n return {\n random,\n encryptor,\n decryptor,\n };\n }\n\n async read(n) {\n const data = await this.connection.readExactly(n);\n return this._decrypt.encrypt(data);\n }\n\n write(data) {\n this.connection.write(this._encrypt.encrypt(data));\n }\n}\n\nclass ConnectionTCPObfuscated extends ObfuscatedConnection {\n ObfuscatedIO = ObfuscatedIO;\n\n PacketCodecClass = AbridgedPacketCodec;\n}\n\nmodule.exports = {\n ConnectionTCPObfuscated,\n};\n","const { Connection } = require('./Connection');\nconst { ConnectionTCPFull } = require('./TCPFull');\nconst { ConnectionTCPAbridged } = require('./TCPAbridged');\nconst { ConnectionTCPObfuscated } = require('./TCPObfuscated');\n\nmodule.exports = {\n Connection,\n ConnectionTCPFull,\n ConnectionTCPAbridged,\n ConnectionTCPObfuscated,\n};\n","const MTProtoPlainSender = require('./MTProtoPlainSender');\nconst MTProtoSender = require('./MTProtoSender');\n\nclass UpdateConnectionState {\n static disconnected = -1;\n\n static connected = 1;\n\n static broken = 0;\n\n constructor(state) {\n this.state = state;\n }\n}\n\nclass UpdateServerTimeOffset {\n constructor(timeOffset) {\n this.timeOffset = timeOffset;\n }\n}\n\nconst {\n Connection,\n ConnectionTCPFull,\n ConnectionTCPAbridged,\n ConnectionTCPObfuscated,\n} = require('./connection');\n\nmodule.exports = {\n Connection,\n ConnectionTCPFull,\n ConnectionTCPAbridged,\n ConnectionTCPObfuscated,\n MTProtoPlainSender,\n MTProtoSender,\n UpdateConnectionState,\n UpdateServerTimeOffset,\n};\n","class Session {\n /**\n * Creates a clone of this session file\n * @param toInstance {Session|null}\n * @returns {Session}\n */\n\n /* CONTEST\n clone(toInstance = null) {\n return toInstance || new this.constructor()\n } */\n\n /**\n * Returns the currently-used data center ID.\n */\n get dcId() {\n throw new Error('Not Implemented');\n }\n\n /**\n * Returns the server address where the library should connect to.\n */\n get serverAddress() {\n throw new Error('Not Implemented');\n }\n\n /**\n * Returns the port to which the library should connect to.\n */\n get port() {\n throw new Error('Not Implemented');\n }\n\n /**\n * Returns an ``AuthKey`` instance associated with the saved\n * data center, or `None` if a new one should be generated.\n */\n get authKey() {\n throw new Error('Not Implemented');\n }\n\n /**\n * Sets the ``AuthKey`` to be used for the saved data center.\n * @param value\n */\n set authKey(value) {\n throw new Error('Not Implemented');\n }\n\n /**\n * Sets the information of the data center address and port that\n * the library should connect to, as well as the data center ID,\n * which is currently unused.\n * @param dcId {number}\n * @param serverAddress {string}\n * @param port {number}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setDC(dcId, serverAddress, port) {\n throw new Error('Not implemented');\n }\n\n /**\n * Returns an ID of the takeout process initialized for this session,\n * or `None` if there's no were any unfinished takeout requests.\n */\n /* CONTEST\n get takeoutId() {\n throw new Error('Not Implemented')\n }\n */\n /**\n * Sets the ID of the unfinished takeout process for this session.\n * @param value\n */\n /* CONTEST\n set takeoutId(value) {\n throw new Error('Not Implemented')\n }\n */\n /**\n * Returns the ``UpdateState`` associated with the given `entity_id`.\n * If the `entity_id` is 0, it should return the ``UpdateState`` for\n * no specific channel (the \"general\" state). If no state is known\n * it should ``return None``.\n * @param entityId\n */\n /* CONTEST\n getUpdateState(entityId) {\n throw new Error('Not Implemented')\n }\n\n */\n\n /**\n * Sets the given ``UpdateState`` for the specified `entity_id`, which\n * should be 0 if the ``UpdateState`` is the \"general\" state (and not\n * for any specific channel).\n * @param entityId\n * @param state\n */\n /* CONTEST\n setUpdateState(entityId, state) {\n throw new Error('Not Implemented')\n }\n\n */\n\n /**\n * Called on client disconnection. Should be used to\n * free any used resources. Can be left empty if none.\n */\n\n /* CONTEST\n close() {\n\n }\n\n */\n\n /**\n * called whenever important properties change. It should\n * make persist the relevant session information to disk.\n */\n save() {\n throw new Error('Not Implemented');\n }\n\n /**\n * Called upon client.log_out(). Should delete the stored\n * information from disk since it's not valid anymore.\n */\n\n delete() {\n throw new Error('Not Implemented');\n }\n\n /**\n * Lists available sessions. Not used by the library itself.\n */\n /* CONTEST\n listSessions() {\n throw new Error('Not Implemented')\n }\n\n */\n\n /**\n * Processes the input ``TLObject`` or ``list`` and saves\n * whatever information is relevant (e.g., ID or access hash).\n * @param tlo\n */\n /* CONTEST\n processEntities(tlo) {\n throw new Error('Not Implemented')\n }\n\n */\n\n /**\n * Turns the given key into an ``InputPeer`` (e.g. ``InputPeerUser``).\n * The library uses this method whenever an ``InputPeer`` is needed\n * to suit several purposes (e.g. user only provided its ID or wishes\n * to use a cached username to avoid extra RPC).\n */\n /* CONTEST\n getInputEntity(key) {\n throw new Error('Not Implemented')\n }\n\n */\n}\n\nmodule.exports = Session;\n","/* eslint-disable no-restricted-globals */\nconst StorageSession = require('./StorageSession');\n\nconst CACHE_NAME = 'GramJs';\n\nclass CacheApiSession extends StorageSession {\n async _delete() {\n const request = new Request(this._storageKey);\n const cache = await self.caches.open(CACHE_NAME);\n return cache.delete(request);\n }\n\n async _fetchFromCache() {\n const request = new Request(this._storageKey);\n const cache = await self.caches.open(CACHE_NAME);\n const cached = await cache.match(request);\n return cached ? cached.text() : undefined;\n }\n\n async _saveToCache(data) {\n const request = new Request(this._storageKey);\n const response = new Response(data);\n const cache = await self.caches.open(CACHE_NAME);\n return cache.put(request, response);\n }\n}\n\nmodule.exports = CacheApiSession;\n","const MemorySession = require('./Memory');\nconst AuthKey = require('../crypto/AuthKey');\nconst utils = require('../Utils');\n\nclass CallbackSession extends MemorySession {\n constructor(sessionData, callback) {\n super();\n\n this._sessionData = sessionData;\n this._callback = callback;\n\n this._authKeys = {};\n }\n\n get authKey() {\n throw new Error('Not supported');\n }\n\n set authKey(value) {\n throw new Error('Not supported');\n }\n\n async load() {\n if (!this._sessionData) {\n return;\n }\n\n const {\n mainDcId,\n keys,\n hashes,\n } = this._sessionData;\n const {\n ipAddress,\n port,\n } = utils.getDC(mainDcId);\n\n this.setDC(mainDcId, ipAddress, port, true);\n\n await Promise.all(Object.keys(keys)\n .map(async (dcId) => {\n const key = typeof keys[dcId] === 'string'\n ? Buffer.from(keys[dcId], 'hex')\n : Buffer.from(keys[dcId]);\n\n if (hashes[dcId]) {\n const hash = typeof hashes[dcId] === 'string'\n ? Buffer.from(hashes[dcId], 'hex')\n : Buffer.from(hashes[dcId]);\n\n this._authKeys[dcId] = new AuthKey(key, hash);\n } else {\n this._authKeys[dcId] = new AuthKey();\n await this._authKeys[dcId].setKey(key, true);\n }\n }));\n }\n\n setDC(dcId, serverAddress, port, skipOnUpdate = false) {\n this._dcId = dcId;\n this._serverAddress = serverAddress;\n this._port = port;\n\n delete this._authKeys[dcId];\n\n if (!skipOnUpdate) {\n void this._onUpdate();\n }\n }\n\n getAuthKey(dcId = this._dcId) {\n return this._authKeys[dcId];\n }\n\n setAuthKey(authKey, dcId = this._dcId) {\n this._authKeys[dcId] = authKey;\n\n void this._onUpdate();\n }\n\n getSessionData() {\n const sessionData = {\n mainDcId: this._dcId,\n keys: {},\n hashes: {},\n };\n\n Object\n .keys(this._authKeys)\n .forEach((dcId) => {\n const authKey = this._authKeys[dcId];\n if (!authKey || !authKey._key) return;\n\n sessionData.keys[dcId] = authKey._key.toString('hex');\n sessionData.hashes[dcId] = authKey._hash.toString('hex');\n });\n\n return sessionData;\n }\n\n _onUpdate() {\n this._callback(this.getSessionData());\n }\n\n delete() {\n this._callback(undefined);\n }\n}\n\nmodule.exports = CallbackSession;\n","const idb = require('idb-keyval');\nconst StorageSession = require('./StorageSession');\n\nconst CACHE_NAME = 'GramJs';\n\nclass IdbSession extends StorageSession {\n _delete() {\n return idb.del(`${CACHE_NAME}:${this._storageKey}`);\n }\n\n _fetchFromCache() {\n return idb.get(`${CACHE_NAME}:${this._storageKey}`);\n }\n\n _saveToCache(data) {\n return idb.set(`${CACHE_NAME}:${this._storageKey}`, data);\n }\n}\n\nmodule.exports = IdbSession;\n","const StorageSession = require('./StorageSession');\n\nclass LocalStorageSession extends StorageSession {\n _delete() {\n return localStorage.removeItem(this._storageKey);\n }\n\n _fetchFromCache() {\n return localStorage.getItem(this._storageKey);\n }\n\n _saveToCache(data) {\n return localStorage.setItem(this._storageKey, data);\n }\n}\n\nmodule.exports = LocalStorageSession;\n","const Session = require('./Abstract');\n\nclass MemorySession extends Session {\n constructor() {\n super();\n\n this._serverAddress = undefined;\n this._dcId = 0;\n this._port = undefined;\n this._takeoutId = undefined;\n\n this._entities = new Set();\n this._updateStates = {};\n }\n\n get dcId() {\n return this._dcId;\n }\n\n get serverAddress() {\n return this._serverAddress;\n }\n\n get port() {\n return this._port;\n }\n\n get authKey() {\n return this._authKey;\n }\n\n set authKey(value) {\n this._authKey = value;\n }\n\n setDC(dcId, serverAddress, port) {\n this._dcId = dcId | 0;\n this._serverAddress = serverAddress;\n this._port = port;\n }\n\n /* CONTEST\n get takeoutId() {\n return this._takeoutId\n }\n\n set takeoutId(value) {\n this._takeoutId = value\n }\n\n\n getUpdateState(entityId) {\n return this._updateStates[entityId]\n }\n\n setUpdateState(entityId, state) {\n return this._updateStates[entityId] = state\n }\n\n close() {\n }\n\n save() {\n }\n\n async load() {\n\n }\n\n delete() {\n }\n\n _entityValuesToRow(id, hash, username, phone, name) {\n // While this is a simple implementation it might be overrode by,\n // other classes so they don't need to implement the plural form\n // of the method. Don't remove.\n return [id, hash, username, phone, name]\n }\n\n _entityToRow(e) {\n if (!(e.classType === \"constructor\")) {\n return\n }\n let p\n let markedId\n try {\n p = utils.getInputPeer(e, false)\n markedId = utils.getPeerId(p)\n } catch (e) {\n // Note: `get_input_peer` already checks for non-zero `accessHash`.\n // See issues #354 and #392. It also checks that the entity\n // is not `min`, because its `accessHash` cannot be used\n // anywhere (since layer 102, there are two access hashes).\n return\n }\n let pHash\n if (p instanceof types.InputPeerUser || p instanceof types.InputPeerChannel) {\n pHash = p.accessHash\n } else if (p instanceof types.InputPeerChat) {\n pHash = 0\n } else {\n return\n }\n\n let username = e.username\n if (username) {\n username = username.toLowerCase()\n }\n const phone = e.phone\n const name = utils.getDisplayName(e)\n return this._entityValuesToRow(markedId, pHash, username, phone, name)\n }\n\n _entitiesToRows(tlo) {\n let entities = []\n if (tlo.classType === \"constructor\" && utils.isListLike(tlo)) {\n // This may be a list of users already for instance\n entities = tlo\n } else {\n if (tlo instanceof Object) {\n if ('user' in tlo) {\n entities.push(tlo.user)\n }\n if ('chats' in tlo && utils.isListLike(tlo.chats)) {\n entities.concat(tlo.chats)\n }\n if ('users' in tlo && utils.isListLike(tlo.users)) {\n entities.concat(tlo.users)\n }\n }\n }\n const rows = [] // Rows to add (id, hash, username, phone, name)\n for (const e of entities) {\n const row = this._entityToRow(e)\n if (row) {\n rows.push(row)\n }\n }\n return rows\n }\n\n processEntities(tlo) {\n const entitiesSet = this._entitiesToRows(tlo)\n for (const e of entitiesSet) {\n this._entities.add(e)\n }\n }\n\n getEntityRowsByPhone(phone) {\n for (const e of this._entities) { // id, hash, username, phone, name\n if (e[3] === phone) {\n return [e[0], e[1]]\n }\n }\n }\n\n getEntityRowsByUsername(username) {\n for (const e of this._entities) { // id, hash, username, phone, name\n if (e[2] === username) {\n return [e[0], e[1]]\n }\n }\n }\n\n getEntityRowsByName(name) {\n for (const e of this._entities) { // id, hash, username, phone, name\n if (e[4] === name) {\n return [e[0], e[1]]\n }\n }\n }\n\n getEntityRowsById(id, exact = true) {\n if (exact) {\n for (const e of this._entities) { // id, hash, username, phone, name\n if (e[0] === id) {\n return [e[0], e[1]]\n }\n }\n } else {\n const ids = [utils.getPeerId(new types.PeerUser({ userId: id })),\n utils.getPeerId(new types.PeerChat({ chatId: id })),\n utils.getPeerId(new types.PeerChannel({ channelId: id })),\n ]\n for (const e of this._entities) { // id, hash, username, phone, name\n if (ids.includes(e[0])) {\n return [e[0], e[1]]\n }\n }\n }\n }\n\n getInputEntity(key) {\n let exact\n if (key.SUBCLASS_OF_ID !== undefined) {\n if ([0xc91c90b6, 0xe669bf46, 0x40f202fd].includes(key.SUBCLASS_OF_ID)) {\n // hex(crc32(b'InputPeer', b'InputUser' and b'InputChannel'))\n // We already have an Input version, so nothing else required\n return key\n }\n // Try to early return if this key can be casted as input peer\n return utils.getInputPeer(key)\n } else {\n // Not a TLObject or can't be cast into InputPeer\n if (key.classType === 'constructor') {\n key = utils.getPeerId(key)\n exact = true\n } else {\n exact = !(typeof key == 'number') || key < 0\n }\n }\n let result = null\n if (typeof key === 'string') {\n const phone = utils.parsePhone(key)\n if (phone) {\n result = this.getEntityRowsByPhone(phone)\n } else {\n const { username, isInvite } = utils.parseUsername(key)\n if (username && !isInvite) {\n result = this.getEntityRowsByUsername(username)\n } else {\n const tup = utils.resolveInviteLink(key)[1]\n if (tup) {\n result = this.getEntityRowsById(tup, false)\n }\n }\n }\n } else if (typeof key === 'number') {\n result = this.getEntityRowsById(key, exact)\n }\n if (!result && typeof key === 'string') {\n result = this.getEntityRowsByName(key)\n }\n\n if (result) {\n let entityId = result[0] // unpack resulting tuple\n const entityHash = result[1]\n const resolved = utils.resolveId(entityId)\n entityId = resolved[0]\n const kind = resolved[1]\n // removes the mark and returns type of entity\n if (kind === types.PeerUser) {\n return new types.InputPeerUser({ userId: entityId, accessHash: entityHash })\n } else if (kind === types.PeerChat) {\n return new types.InputPeerChat({ chatId: entityId })\n } else if (kind === types.PeerChannel) {\n return new types.InputPeerChannel({ channelId: entityId, accessHash: entityHash })\n }\n } else {\n throw new Error('Could not find input entity with key ' + key)\n }\n } */\n}\n\nmodule.exports = MemorySession;\n","const MemorySession = require('./Memory');\nconst AuthKey = require('../crypto/AuthKey');\nconst utils = require('../Utils');\n\nconst STORAGE_KEY_BASE = 'GramJs-session-';\nconst SESSION_DATA_PREFIX = 'session:';\n\nclass StorageSession extends MemorySession {\n constructor(sessionInfo) {\n super();\n\n this._authKeys = {};\n\n if (sessionInfo && sessionInfo.startsWith(SESSION_DATA_PREFIX)) {\n this._sessionString = sessionInfo;\n } else if (sessionInfo) {\n this._storageKey = sessionInfo;\n }\n }\n\n get authKey() {\n throw new Error('Not supported');\n }\n\n set authKey(value) {\n throw new Error('Not supported');\n }\n\n async load() {\n if (this._sessionString) {\n await this._loadFromSessionString();\n return;\n }\n\n if (!this._storageKey) {\n return;\n }\n\n try {\n const json = await this._fetchFromCache();\n const {\n mainDcId,\n keys,\n hashes,\n } = JSON.parse(json);\n const {\n ipAddress,\n port,\n } = utils.getDC(mainDcId);\n\n this.setDC(mainDcId, ipAddress, port, true);\n\n Object.keys(keys)\n .forEach((dcId) => {\n if (keys[dcId] && hashes[dcId]) {\n this._authKeys[dcId] = new AuthKey(\n Buffer.from(keys[dcId].data),\n Buffer.from(hashes[dcId].data),\n );\n }\n });\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn('Failed to retrieve or parse session from storage');\n // eslint-disable-next-line no-console\n console.warn(err);\n }\n }\n\n setDC(dcId, serverAddress, port, skipUpdateStorage = false) {\n this._dcId = dcId;\n this._serverAddress = serverAddress;\n this._port = port;\n\n delete this._authKeys[dcId];\n\n if (!skipUpdateStorage) {\n void this._updateStorage();\n }\n }\n\n async save() {\n if (!this._storageKey) {\n this._storageKey = generateStorageKey();\n }\n\n await this._updateStorage();\n\n return this._storageKey;\n }\n\n getAuthKey(dcId = this._dcId) {\n return this._authKeys[dcId];\n }\n\n setAuthKey(authKey, dcId = this._dcId) {\n this._authKeys[dcId] = authKey;\n\n void this._updateStorage();\n }\n\n getSessionData(asHex) {\n const sessionData = {\n mainDcId: this._dcId,\n keys: {},\n hashes: {},\n };\n\n Object\n .keys(this._authKeys)\n .forEach((dcId) => {\n const authKey = this._authKeys[dcId];\n if (!authKey._key) return;\n\n sessionData.keys[dcId] = asHex ? authKey._key.toString('hex') : authKey._key;\n sessionData.hashes[dcId] = asHex ? authKey._hash.toString('hex') : authKey._hash;\n });\n\n return sessionData;\n }\n\n async _loadFromSessionString() {\n const [, mainDcIdStr, mainDcKey] = this._sessionString.split(':');\n const mainDcId = Number(mainDcIdStr);\n const {\n ipAddress,\n port,\n } = utils.getDC(mainDcId);\n this.setDC(mainDcId, ipAddress, port);\n const authKey = new AuthKey();\n await authKey.setKey(Buffer.from(mainDcKey, 'hex'), true);\n this.setAuthKey(authKey, mainDcId);\n }\n\n async _updateStorage() {\n if (!this._storageKey) {\n return;\n }\n\n try {\n await this._saveToCache(JSON.stringify(this.getSessionData()));\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn('Failed to update session in storage');\n // eslint-disable-next-line no-console\n console.warn(err);\n }\n }\n\n async delete() {\n try {\n return await this._delete();\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn('Failed to delete session from storage');\n // eslint-disable-next-line no-console\n console.warn(err);\n }\n return undefined;\n }\n\n // @abstract\n _delete() {\n throw new Error('Not Implemented');\n }\n\n // @abstract\n _fetchFromCache() {\n throw new Error('Not Implemented');\n }\n\n // @abstract\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _saveToCache(data) {\n throw new Error('Not Implemented');\n }\n}\n\nfunction generateStorageKey() {\n // Creating two sessions at the same moment is not expected nor supported.\n return `${STORAGE_KEY_BASE}${Date.now()}`;\n}\n\nmodule.exports = StorageSession;\n","const MemorySession = require('./Memory');\nconst AuthKey = require('../crypto/AuthKey');\nconst BinaryReader = require('../extensions/BinaryReader');\n\nconst CURRENT_VERSION = '1';\n\n\nclass StringSession extends MemorySession {\n /**\n * This session file can be easily saved and loaded as a string. According\n * to the initial design, it contains only the data that is necessary for\n * successful connection and authentication, so takeout ID is not stored.\n\n * It is thought to be used where you don't want to create any on-disk\n * files but would still like to be able to save and load existing sessions\n * by other means.\n\n * You can use custom `encode` and `decode` functions, if present:\n\n * `encode` definition must be ``function encode(value: Buffer) -> string:``.\n * `decode` definition must be ``function decode(value: string) -> Buffer:``.\n * @param session {string|null}\n */\n constructor(session = undefined) {\n super();\n if (session) {\n if (session[0] !== CURRENT_VERSION) {\n throw new Error('Not a valid string');\n }\n session = session.slice(1);\n const r = StringSession.decode(session);\n const reader = new BinaryReader(r);\n this._dcId = reader.read(1)\n .readUInt8(0);\n const serverAddressLen = reader.read(2)\n .readInt16BE(0);\n this._serverAddress = String(reader.read(serverAddressLen));\n this._port = reader.read(2)\n .readInt16BE(0);\n this._key = reader.read(-1);\n }\n }\n\n /**\n * @param x {Buffer}\n * @returns {string}\n */\n static encode(x) {\n return x.toString('base64');\n }\n\n /**\n * @param x {string}\n * @returns {Buffer}\n */\n static decode(x) {\n return Buffer.from(x, 'base64');\n }\n\n async load() {\n if (this._key) {\n this._authKey = new AuthKey();\n await this._authKey.setKey(this._key);\n }\n }\n\n save() {\n if (!this.authKey) {\n return '';\n }\n const dcBuffer = Buffer.from([this.dcId]);\n const addressBuffer = Buffer.from(this.serverAddress);\n const addressLengthBuffer = Buffer.alloc(2);\n addressLengthBuffer.writeInt16BE(addressBuffer.length, 0);\n const portBuffer = Buffer.alloc(2);\n portBuffer.writeInt16BE(this.port, 0);\n\n return CURRENT_VERSION + StringSession.encode(Buffer.concat([\n dcBuffer,\n addressLengthBuffer,\n addressBuffer,\n portBuffer,\n this.authKey.getKey(),\n ]));\n }\n\n getAuthKey(dcId) {\n if (dcId && dcId !== this.dcId) {\n // Not supported.\n return undefined;\n }\n\n return this.authKey;\n }\n\n setAuthKey(authKey, dcId) {\n if (dcId && dcId !== this.dcId) {\n // Not supported.\n return;\n }\n\n this.authKey = authKey;\n }\n}\n\nmodule.exports = StringSession;\n","const Memory = require('./Memory');\nconst StringSession = require('./StringSession');\nconst CacheApiSession = require('./CacheApiSession');\nconst LocalStorageSession = require('./LocalStorageSession');\nconst IdbSession = require('./IdbSession');\nconst CallbackSession = require('./CallbackSession');\n\nmodule.exports = {\n Memory,\n StringSession,\n CacheApiSession,\n LocalStorageSession,\n IdbSession,\n CallbackSession,\n};\n","const api = require('./api');\n\nconst LAYER = 131;\nconst tlobjects = {};\n\n\nfor (const tl of Object.values(api)) {\n if (tl.CONSTRUCTOR_ID) {\n tlobjects[tl.CONSTRUCTOR_ID] = tl;\n } else {\n for (const sub of Object.values(tl)) {\n tlobjects[sub.CONSTRUCTOR_ID] = sub;\n }\n }\n}\n\nmodule.exports = {\n LAYER,\n tlobjects,\n};\n","const {\n parseTl,\n serializeBytes,\n serializeDate,\n} = require('./generationHelpers');\nconst {\n toSignedLittleBuffer,\n} = require('../Helpers');\n\nconst tlContent = require('./apiTl.js');\nconst schemeContent = require('./schemaTl.js');\n\n/* CONTEST\nconst NAMED_AUTO_CASTS = new Set([\n 'chatId,int'\n])\nconst NAMED_BLACKLIST = new Set([\n 'discardEncryption'\n])\nconst AUTO_CASTS = new Set([\n 'InputPeer',\n 'InputChannel',\n 'InputUser',\n 'InputDialogPeer',\n 'InputNotifyPeer',\n 'InputMedia',\n 'InputPhoto',\n 'InputMessage',\n 'InputDocument',\n 'InputChatPhoto'\n])\n\n */\n// eslint-disable-next-line no-restricted-globals\nconst CACHING_SUPPORTED = typeof self !== 'undefined' && self.localStorage !== undefined;\n\nconst CACHE_KEY = 'GramJs:apiCache';\n\nfunction buildApiFromTlSchema() {\n let definitions;\n const fromCache = CACHING_SUPPORTED && loadFromCache();\n\n if (fromCache) {\n definitions = fromCache;\n } else {\n definitions = loadFromTlSchemas();\n\n if (CACHING_SUPPORTED) {\n localStorage.setItem(CACHE_KEY, JSON.stringify(definitions));\n }\n }\n\n return mergeWithNamespaces(\n createClasses('constructor', definitions.constructors),\n createClasses('request', definitions.requests),\n );\n}\n\nfunction loadFromCache() {\n const jsonCache = localStorage.getItem(CACHE_KEY);\n return jsonCache && JSON.parse(jsonCache);\n}\n\nfunction loadFromTlSchemas() {\n const [constructorParamsApi, functionParamsApi] = extractParams(tlContent);\n const [constructorParamsSchema, functionParamsSchema] = extractParams(schemeContent);\n const constructors = [].concat(constructorParamsApi, constructorParamsSchema);\n const requests = [].concat(functionParamsApi, functionParamsSchema);\n\n return {\n constructors,\n requests,\n };\n}\n\nfunction mergeWithNamespaces(obj1, obj2) {\n const result = { ...obj1 };\n\n Object.keys(obj2)\n .forEach((key) => {\n if (typeof obj2[key] === 'function' || !result[key]) {\n result[key] = obj2[key];\n } else {\n Object.assign(result[key], obj2[key]);\n }\n });\n\n return result;\n}\n\nfunction extractParams(fileContent) {\n const f = parseTl(fileContent, 109);\n const constructors = [];\n const functions = [];\n for (const d of f) {\n if (d.isFunction) {\n functions.push(d);\n } else {\n constructors.push(d);\n }\n }\n return [constructors, functions];\n}\n\nfunction argToBytes(x, type) {\n switch (type) {\n case 'int': {\n const i = Buffer.alloc(4);\n i.writeInt32LE(x, 0);\n return i;\n }\n case 'long':\n return toSignedLittleBuffer(x, 8);\n case 'int128':\n return toSignedLittleBuffer(x, 16);\n case 'int256':\n return toSignedLittleBuffer(x, 32);\n case 'double': {\n const d = Buffer.alloc(8);\n d.writeDoubleLE(x, 0);\n return d;\n }\n case 'string':\n return serializeBytes(x);\n case 'Bool':\n return x ? Buffer.from('b5757299', 'hex') : Buffer.from('379779bc', 'hex');\n case 'true':\n return Buffer.alloc(0);\n case 'bytes':\n return serializeBytes(x);\n case 'date':\n return serializeDate(x);\n default:\n return x.getBytes();\n }\n}\n\n/*\nCONTEST\nasync function getInputFromResolve(utils, client, peer, peerType) {\n switch (peerType) {\n case 'InputPeer':\n return utils.getInputPeer(await client.getInputEntity(peer))\n case 'InputChannel':\n return utils.getInputChannel(await client.getInputEntity(peer))\n case 'InputUser':\n return utils.getInputUser(await client.getInputEntity(peer))\n case 'InputDialogPeer':\n return await client._getInputDialog(peer)\n case 'InputNotifyPeer':\n return await client._getInputNotify(peer)\n case 'InputMedia':\n return utils.getInputMedia(peer)\n case 'InputPhoto':\n return utils.getInputPhoto(peer)\n case 'InputMessage':\n return utils.getInputMessage(peer)\n case 'InputDocument':\n return utils.getInputDocument(peer)\n case 'InputChatPhoto':\n return utils.getInputChatPhoto(peer)\n case 'chatId,int' :\n return await client.getPeerId(peer, false)\n default:\n throw new Error('unsupported peer type : ' + peerType)\n }\n}\n*/\nfunction getArgFromReader(reader, arg) {\n if (arg.isVector) {\n if (arg.useVectorId) {\n reader.readInt();\n }\n const temp = [];\n const len = reader.readInt();\n arg.isVector = false;\n for (let i = 0; i < len; i++) {\n temp.push(getArgFromReader(reader, arg));\n }\n arg.isVector = true;\n return temp;\n } else if (arg.flagIndicator) {\n return reader.readInt();\n } else {\n switch (arg.type) {\n case 'int':\n return reader.readInt();\n case 'long':\n return reader.readLong();\n case 'int128':\n return reader.readLargeInt(128);\n case 'int256':\n return reader.readLargeInt(256);\n case 'double':\n return reader.readDouble();\n case 'string':\n return reader.tgReadString();\n case 'Bool':\n return reader.tgReadBool();\n case 'true':\n return true;\n case 'bytes':\n return reader.tgReadBytes();\n case 'date':\n return reader.tgReadDate();\n default:\n if (!arg.skipConstructorId) {\n return reader.tgReadObject();\n } else {\n throw new Error(`Unknown type ${arg}`);\n }\n }\n }\n}\n\nfunction createClasses(classesType, params) {\n const classes = {};\n for (const classParams of params) {\n const {\n name,\n constructorId,\n subclassOfId,\n argsConfig,\n namespace,\n result,\n } = classParams;\n const fullName = [namespace, name].join('.')\n .replace(/^\\./, '');\n\n class VirtualClass {\n static CONSTRUCTOR_ID = constructorId;\n\n static SUBCLASS_OF_ID = subclassOfId;\n\n static className = fullName;\n\n static classType = classesType;\n\n CONSTRUCTOR_ID = constructorId;\n\n SUBCLASS_OF_ID = subclassOfId;\n\n className = fullName;\n\n classType = classesType;\n\n constructor(args) {\n args = args || {};\n Object.keys(args)\n .forEach((argName) => {\n this[argName] = args[argName];\n });\n }\n\n static fromReader(reader) {\n const args = {};\n\n for (const argName in argsConfig) {\n if (argsConfig.hasOwnProperty(argName)) {\n const arg = argsConfig[argName];\n if (arg.isFlag) {\n if (arg.type === 'true') {\n args[argName] = Boolean(args.flags & (1 << arg.flagIndex));\n continue;\n }\n if (args.flags & (1 << arg.flagIndex)) {\n args[argName] = getArgFromReader(reader, arg);\n } else {\n args[argName] = undefined;\n }\n } else {\n if (arg.flagIndicator) {\n arg.name = 'flags';\n }\n args[argName] = getArgFromReader(reader, arg);\n }\n }\n }\n return new VirtualClass(args);\n }\n\n getBytes() {\n // The next is pseudo-code:\n const idForBytes = this.CONSTRUCTOR_ID;\n const c = Buffer.alloc(4);\n c.writeUInt32LE(idForBytes, 0);\n const buffers = [c];\n for (const arg in argsConfig) {\n if (argsConfig.hasOwnProperty(arg)) {\n if (argsConfig[arg].isFlag) {\n if ((this[arg] === false && argsConfig[arg].type === 'true')\n || this[arg] === undefined) {\n continue;\n }\n }\n if (argsConfig[arg].isVector) {\n if (argsConfig[arg].useVectorId) {\n buffers.push(Buffer.from('15c4b51c', 'hex'));\n }\n const l = Buffer.alloc(4);\n l.writeInt32LE(this[arg].length, 0);\n buffers.push(l, Buffer.concat(this[arg].map((x) => argToBytes(x, argsConfig[arg].type))));\n } else if (argsConfig[arg].flagIndicator) {\n if (!Object.values(argsConfig)\n .some((f) => f.isFlag)) {\n buffers.push(Buffer.alloc(4));\n } else {\n let flagCalculate = 0;\n for (const f in argsConfig) {\n if (argsConfig[f].isFlag) {\n if ((this[f] === false && argsConfig[f].type === 'true')\n || this[f] === undefined) {\n flagCalculate |= 0;\n } else {\n flagCalculate |= 1 << argsConfig[f].flagIndex;\n }\n }\n }\n const f = Buffer.alloc(4);\n f.writeUInt32LE(flagCalculate, 0);\n buffers.push(f);\n }\n } else {\n buffers.push(argToBytes(this[arg], argsConfig[arg].type));\n\n if (this[arg] && typeof this[arg].getBytes === 'function') {\n let boxed = (argsConfig[arg].type.charAt(argsConfig[arg].type.indexOf('.') + 1));\n boxed = boxed === boxed.toUpperCase();\n if (!boxed) {\n buffers.shift();\n }\n }\n }\n }\n }\n return Buffer.concat(buffers);\n }\n\n readResult(reader) {\n if (classesType !== 'request') {\n throw new Error('`readResult()` called for non-request instance');\n }\n\n const m = result.match(/Vector<(int|long)>/);\n if (m) {\n reader.readInt();\n const temp = [];\n const len = reader.readInt();\n if (m[1] === 'int') {\n for (let i = 0; i < len; i++) {\n temp.push(reader.readInt());\n }\n } else {\n for (let i = 0; i < len; i++) {\n temp.push(reader.readLong());\n }\n }\n return temp;\n } else {\n return reader.tgReadObject();\n }\n }\n\n /* CONTEST\n async resolve(client, utils) {\n\n if (classesType !== 'request') {\n throw new Error('`resolve()` called for non-request instance')\n }\n\n for (const arg in argsConfig) {\n if (argsConfig.hasOwnProperty(arg)) {\n if (!AUTO_CASTS.has(argsConfig[arg].type)) {\n if (!NAMED_AUTO_CASTS.has(`${argsConfig[arg].name},${argsConfig[arg].type}`)) {\n continue\n }\n }\n if (argsConfig[arg].isFlag) {\n if (!this[arg]) {\n continue\n }\n }\n if (argsConfig[arg].isVector) {\n const temp = []\n for (const x of this[arg]) {\n temp.push(await getInputFromResolve(utils, client, x, argsConfig[arg].type))\n }\n this[arg] = temp\n } else {\n this[arg] = await getInputFromResolve(utils, client, this[arg], argsConfig[arg].type)\n }\n }\n }\n } */\n }\n\n if (namespace) {\n if (!classes[namespace]) {\n classes[namespace] = {};\n }\n classes[namespace][name] = VirtualClass;\n } else {\n classes[name] = VirtualClass;\n }\n }\n\n return classes;\n}\n\nmodule.exports = buildApiFromTlSchema();\n","module.exports = `boolFalse#bc799737 = Bool;\nboolTrue#997275b5 = Bool;\ntrue#3fedd339 = True;\nvector#1cb5c415 {t:Type} # [ t ] = Vector t;\nerror#c4b9f9bb code:int text:string = Error;\nnull#56730bcc = Null;\ninputPeerEmpty#7f3b18ea = InputPeer;\ninputPeerSelf#7da07ec9 = InputPeer;\ninputPeerChat#179be863 chat_id:int = InputPeer;\ninputPeerUser#7b8e7de6 user_id:int access_hash:long = InputPeer;\ninputPeerChannel#20adaef8 channel_id:int access_hash:long = InputPeer;\ninputPeerUserFromMessage#17bae2e6 peer:InputPeer msg_id:int user_id:int = InputPeer;\ninputPeerChannelFromMessage#9c95f7bb peer:InputPeer msg_id:int channel_id:int = InputPeer;\ninputUserEmpty#b98886cf = InputUser;\ninputUserSelf#f7c1b13f = InputUser;\ninputUser#d8292816 user_id:int access_hash:long = InputUser;\ninputUserFromMessage#2d117597 peer:InputPeer msg_id:int user_id:int = InputUser;\ninputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;\ninputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;\ninputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;\ninputMediaEmpty#9664f57f = InputMedia;\ninputMediaUploadedPhoto#1e287d04 flags:# file:InputFile stickers:flags.0?Vector ttl_seconds:flags.1?int = InputMedia;\ninputMediaPhoto#b3ba0635 flags:# id:InputPhoto ttl_seconds:flags.0?int = InputMedia;\ninputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;\ninputMediaContact#f8ab7dfb phone_number:string first_name:string last_name:string vcard:string = InputMedia;\ninputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true force_file:flags.4?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector stickers:flags.0?Vector ttl_seconds:flags.1?int = InputMedia;\ninputMediaDocument#33473058 flags:# id:InputDocument ttl_seconds:flags.0?int query:flags.1?string = InputMedia;\ninputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia;\ninputMediaPhotoExternal#e5bbfe1a flags:# url:string ttl_seconds:flags.0?int = InputMedia;\ninputMediaDocumentExternal#fb52dc99 flags:# url:string ttl_seconds:flags.0?int = InputMedia;\ninputMediaGame#d33f43f3 id:InputGame = InputMedia;\ninputMediaInvoice#d9799874 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:flags.1?string = InputMedia;\ninputMediaGeoLive#971fa843 flags:# stopped:flags.0?true geo_point:InputGeoPoint heading:flags.2?int period:flags.1?int proximity_notification_radius:flags.3?int = InputMedia;\ninputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector solution:flags.1?string solution_entities:flags.1?Vector = InputMedia;\ninputMediaDice#e66fbf7b emoticon:string = InputMedia;\ninputChatPhotoEmpty#1ca48f57 = InputChatPhoto;\ninputChatUploadedPhoto#c642724e flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = InputChatPhoto;\ninputChatPhoto#8953ad37 id:InputPhoto = InputChatPhoto;\ninputGeoPointEmpty#e4c123d6 = InputGeoPoint;\ninputGeoPoint#48222faf flags:# lat:double long:double accuracy_radius:flags.0?int = InputGeoPoint;\ninputPhotoEmpty#1cd7bf0d = InputPhoto;\ninputPhoto#3bb3b94a id:long access_hash:long file_reference:bytes = InputPhoto;\ninputFileLocation#dfdaabe1 volume_id:long local_id:int secret:long file_reference:bytes = InputFileLocation;\ninputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;\ninputDocumentFileLocation#bad07584 id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;\ninputSecureFileLocation#cbc7ee28 id:long access_hash:long = InputFileLocation;\ninputTakeoutFileLocation#29be5899 = InputFileLocation;\ninputPhotoFileLocation#40181ffe id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;\ninputPhotoLegacyFileLocation#d83466f3 id:long access_hash:long file_reference:bytes volume_id:long local_id:int secret:long = InputFileLocation;\ninputPeerPhotoFileLocation#37257e99 flags:# big:flags.0?true peer:InputPeer photo_id:long = InputFileLocation;\ninputStickerSetThumb#9d84f3db stickerset:InputStickerSet thumb_version:int = InputFileLocation;\ninputGroupCallStream#bba51639 call:InputGroupCall time_ms:long scale:int = InputFileLocation;\npeerUser#9db1bc6d user_id:int = Peer;\npeerChat#bad0e5bb chat_id:int = Peer;\npeerChannel#bddde532 channel_id:int = Peer;\nstorage.fileUnknown#aa963b05 = storage.FileType;\nstorage.filePartial#40bc6f52 = storage.FileType;\nstorage.fileJpeg#7efe0e = storage.FileType;\nstorage.fileGif#cae1aadf = storage.FileType;\nstorage.filePng#a4f63c0 = storage.FileType;\nstorage.filePdf#ae1e508d = storage.FileType;\nstorage.fileMp3#528a0677 = storage.FileType;\nstorage.fileMov#4b09ebbc = storage.FileType;\nstorage.fileMp4#b3cea0e4 = storage.FileType;\nstorage.fileWebp#1081464c = storage.FileType;\nuserEmpty#200250ba id:int = User;\nuser#938458c1 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;\nuserProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;\nuserProfilePhoto#82d1f706 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto;\nuserStatusEmpty#9d05049 = UserStatus;\nuserStatusOnline#edb93949 expires:int = UserStatus;\nuserStatusOffline#8c703f was_online:int = UserStatus;\nuserStatusRecently#e26f42f1 = UserStatus;\nuserStatusLastWeek#7bf09fc = UserStatus;\nuserStatusLastMonth#77ebc742 = UserStatus;\nchatEmpty#9ba2d800 id:int = Chat;\nchat#3bda1bde flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat;\nchatForbidden#7328bdb id:int title:string = Chat;\nchannel#d31a961e flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true id:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?Vector admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat;\nchannelForbidden#289da732 flags:# broadcast:flags.5?true megagroup:flags.8?true id:int access_hash:long title:string until_date:flags.16?int = Chat;\nchatFull#8a1e2983 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:int about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer = ChatFull;\nchannelFull#548c3f93 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?int location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector groupcall_default_join_as:flags.26?Peer = ChatFull;\nchatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;\nchatParticipantCreator#da13538a user_id:int = ChatParticipant;\nchatParticipantAdmin#e2d6e436 user_id:int inviter_id:int date:int = ChatParticipant;\nchatParticipantsForbidden#fc900c2b flags:# chat_id:int self_participant:flags.0?ChatParticipant = ChatParticipants;\nchatParticipants#3f460fed chat_id:int participants:Vector version:int = ChatParticipants;\nchatPhotoEmpty#37c1011c = ChatPhoto;\nchatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = ChatPhoto;\nmessageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = Message;\nmessage#bce383d2 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector ttl_period:flags.25?int = Message;\nmessageService#2b085862 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction ttl_period:flags.25?int = Message;\nmessageMediaEmpty#3ded6320 = MessageMedia;\nmessageMediaPhoto#695150d7 flags:# photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia;\nmessageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;\nmessageMediaContact#cbf24940 phone_number:string first_name:string last_name:string vcard:string user_id:int = MessageMedia;\nmessageMediaUnsupported#9f84f49e = MessageMedia;\nmessageMediaDocument#9cb070d7 flags:# document:flags.0?Document ttl_seconds:flags.2?int = MessageMedia;\nmessageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;\nmessageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia;\nmessageMediaGame#fdb19008 game:Game = MessageMedia;\nmessageMediaInvoice#84551347 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string = MessageMedia;\nmessageMediaGeoLive#b940c666 flags:# geo:GeoPoint heading:flags.0?int period:int proximity_notification_radius:flags.1?int = MessageMedia;\nmessageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia;\nmessageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia;\nmessageActionEmpty#b6aef7b0 = MessageAction;\nmessageActionChatCreate#a6638b9a title:string users:Vector = MessageAction;\nmessageActionChatEditTitle#b5a1ce5a title:string = MessageAction;\nmessageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;\nmessageActionChatDeletePhoto#95e3fbef = MessageAction;\nmessageActionChatAddUser#488a7337 users:Vector = MessageAction;\nmessageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;\nmessageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction;\nmessageActionChannelCreate#95d2ac92 title:string = MessageAction;\nmessageActionChatMigrateTo#51bdb021 channel_id:int = MessageAction;\nmessageActionChannelMigrateFrom#b055eaee title:string chat_id:int = MessageAction;\nmessageActionPinMessage#94bd38ed = MessageAction;\nmessageActionHistoryClear#9fbab604 = MessageAction;\nmessageActionGameScore#92a72876 game_id:long score:int = MessageAction;\nmessageActionPaymentSentMe#8f31b327 flags:# currency:string total_amount:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string charge:PaymentCharge = MessageAction;\nmessageActionPaymentSent#40699cd0 currency:string total_amount:long = MessageAction;\nmessageActionPhoneCall#80e11a7f flags:# video:flags.2?true call_id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = MessageAction;\nmessageActionScreenshotTaken#4792929b = MessageAction;\nmessageActionCustomAction#fae69f56 message:string = MessageAction;\nmessageActionBotAllowed#abe9affe domain:string = MessageAction;\nmessageActionSecureValuesSentMe#1b287353 values:Vector credentials:SecureCredentialsEncrypted = MessageAction;\nmessageActionSecureValuesSent#d95c6154 types:Vector = MessageAction;\nmessageActionContactSignUp#f3f25f76 = MessageAction;\nmessageActionGeoProximityReached#98e0d697 from_id:Peer to_id:Peer distance:int = MessageAction;\nmessageActionGroupCall#7a0d7f42 flags:# call:InputGroupCall duration:flags.0?int = MessageAction;\nmessageActionInviteToGroupCall#76b9f11a call:InputGroupCall users:Vector = MessageAction;\nmessageActionSetMessagesTTL#aa1afbfd period:int = MessageAction;\nmessageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction;\ndialog#2c171f72 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int = Dialog;\ndialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;\nphotoEmpty#2331b22d id:long = Photo;\nphoto#fb197a65 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector video_sizes:flags.1?Vector dc_id:int = Photo;\nphotoSizeEmpty#e17e23c type:string = PhotoSize;\nphotoSize#75c78e60 type:string w:int h:int size:int = PhotoSize;\nphotoCachedSize#21e1ad6 type:string w:int h:int bytes:bytes = PhotoSize;\nphotoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize;\nphotoSizeProgressive#fa3efb95 type:string w:int h:int sizes:Vector = PhotoSize;\nphotoPathSize#d8214d41 type:string bytes:bytes = PhotoSize;\ngeoPointEmpty#1117dd5f = GeoPoint;\ngeoPoint#b2a2f663 flags:# long:double lat:double access_hash:long accuracy_radius:flags.0?int = GeoPoint;\nauth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode;\nauth.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Authorization;\nauth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization;\nauth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;\ninputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;\ninputNotifyUsers#193b4417 = InputNotifyPeer;\ninputNotifyChats#4a95e84e = InputNotifyPeer;\ninputNotifyBroadcasts#b1db7c7e = InputNotifyPeer;\ninputPeerNotifySettings#9c3d198e flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = InputPeerNotifySettings;\npeerNotifySettings#af509d20 flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = PeerNotifySettings;\npeerSettings#733f2961 flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true invite_members:flags.8?true geo_distance:flags.6?int = PeerSettings;\nwallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper;\nwallPaperNoFile#e0804116 id:long flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper;\ninputReportReasonSpam#58dbcab8 = ReportReason;\ninputReportReasonViolence#1e22c78d = ReportReason;\ninputReportReasonPornography#2e59d922 = ReportReason;\ninputReportReasonChildAbuse#adf44ee3 = ReportReason;\ninputReportReasonOther#c1e4a2b1 = ReportReason;\ninputReportReasonCopyright#9b89f93a = ReportReason;\ninputReportReasonGeoIrrelevant#dbd4feed = ReportReason;\ninputReportReasonFake#f5ddd6e7 = ReportReason;\nuserFull#139a9a77 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int = UserFull;\ncontact#f911c994 user_id:int mutual:Bool = Contact;\nimportedContact#d0028438 user_id:int client_id:long = ImportedContact;\ncontactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus;\ncontacts.contactsNotModified#b74ba9d2 = contacts.Contacts;\ncontacts.contacts#eae87e42 contacts:Vector saved_count:int users:Vector = contacts.Contacts;\ncontacts.importedContacts#77d01c3b imported:Vector popular_invites:Vector retry_contacts:Vector users:Vector = contacts.ImportedContacts;\ncontacts.blocked#ade1591 blocked:Vector chats:Vector users:Vector = contacts.Blocked;\ncontacts.blockedSlice#e1664194 count:int blocked:Vector chats:Vector users:Vector = contacts.Blocked;\nmessages.dialogs#15ba6c40 dialogs:Vector messages:Vector chats:Vector users:Vector = messages.Dialogs;\nmessages.dialogsSlice#71e094f3 count:int dialogs:Vector messages:Vector chats:Vector users:Vector = messages.Dialogs;\nmessages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs;\nmessages.messages#8c718e87 messages:Vector chats:Vector users:Vector = messages.Messages;\nmessages.messagesSlice#3a54685e flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int messages:Vector chats:Vector users:Vector = messages.Messages;\nmessages.channelMessages#64479808 flags:# inexact:flags.1?true pts:int count:int offset_id_offset:flags.2?int messages:Vector chats:Vector users:Vector = messages.Messages;\nmessages.messagesNotModified#74535f21 count:int = messages.Messages;\nmessages.chats#64ff9fd5 chats:Vector = messages.Chats;\nmessages.chatsSlice#9cd81144 count:int chats:Vector = messages.Chats;\nmessages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector users:Vector = messages.ChatFull;\nmessages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;\ninputMessagesFilterEmpty#57e2f66c = MessagesFilter;\ninputMessagesFilterPhotos#9609a51c = MessagesFilter;\ninputMessagesFilterVideo#9fc00e65 = MessagesFilter;\ninputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;\ninputMessagesFilterDocument#9eddf188 = MessagesFilter;\ninputMessagesFilterUrl#7ef0dd87 = MessagesFilter;\ninputMessagesFilterGif#ffc86587 = MessagesFilter;\ninputMessagesFilterVoice#50f5c392 = MessagesFilter;\ninputMessagesFilterMusic#3751b49e = MessagesFilter;\ninputMessagesFilterChatPhotos#3a20ecb8 = MessagesFilter;\ninputMessagesFilterPhoneCalls#80c99768 flags:# missed:flags.0?true = MessagesFilter;\ninputMessagesFilterRoundVoice#7a7c17a4 = MessagesFilter;\ninputMessagesFilterRoundVideo#b549da53 = MessagesFilter;\ninputMessagesFilterMyMentions#c1f8e69a = MessagesFilter;\ninputMessagesFilterGeo#e7026d0d = MessagesFilter;\ninputMessagesFilterContacts#e062db83 = MessagesFilter;\ninputMessagesFilterPinned#1bb00451 = MessagesFilter;\nupdateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;\nupdateMessageID#4e90bfd6 id:int random_id:long = Update;\nupdateDeleteMessages#a20db0e5 messages:Vector pts:int pts_count:int = Update;\nupdateUserTyping#5c486927 user_id:int action:SendMessageAction = Update;\nupdateChatUserTyping#86cadb6c chat_id:int from_id:Peer action:SendMessageAction = Update;\nupdateChatParticipants#7761198 participants:ChatParticipants = Update;\nupdateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;\nupdateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update;\nupdateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;\nupdateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;\nupdateEncryptedChatTyping#1710f156 chat_id:int = Update;\nupdateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;\nupdateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;\nupdateChatParticipantAdd#ea4b0e5c chat_id:int user_id:int inviter_id:int date:int version:int = Update;\nupdateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;\nupdateDcOptions#8e5e9873 dc_options:Vector = Update;\nupdateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update;\nupdateServiceNotification#ebe46819 flags:# popup:flags.0?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector = Update;\nupdatePrivacy#ee3b272a key:PrivacyKey rules:Vector = Update;\nupdateUserPhone#12b9417b user_id:int phone:string = Update;\nupdateReadHistoryInbox#9c974fdf flags:# folder_id:flags.0?int peer:Peer max_id:int still_unread_count:int pts:int pts_count:int = Update;\nupdateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;\nupdateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update;\nupdateReadMessagesContents#68c13933 messages:Vector pts:int pts_count:int = Update;\nupdateChannelTooLong#eb0467fb flags:# channel_id:int pts:flags.0?int = Update;\nupdateChannel#b6d45656 channel_id:int = Update;\nupdateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update;\nupdateReadChannelInbox#330b5424 flags:# folder_id:flags.0?int channel_id:int max_id:int still_unread_count:int pts:int = Update;\nupdateDeleteChannelMessages#c37521c9 channel_id:int messages:Vector pts:int pts_count:int = Update;\nupdateChannelMessageViews#98a12b4b channel_id:int id:int views:int = Update;\nupdateChatParticipantAdmin#b6901959 chat_id:int user_id:int is_admin:Bool version:int = Update;\nupdateNewStickerSet#688a30aa stickerset:messages.StickerSet = Update;\nupdateStickerSetsOrder#bb2d201 flags:# masks:flags.0?true order:Vector = Update;\nupdateStickerSets#43ae3dec = Update;\nupdateSavedGifs#9375341e = Update;\nupdateBotInlineQuery#3f2038db flags:# query_id:long user_id:int query:string geo:flags.0?GeoPoint peer_type:flags.1?InlineQueryPeerType offset:string = Update;\nupdateBotInlineSend#e48f964 flags:# user_id:int query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update;\nupdateEditChannelMessage#1b3f4df7 message:Message pts:int pts_count:int = Update;\nupdateBotCallbackQuery#e73547e1 flags:# query_id:long user_id:int peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;\nupdateEditMessage#e40370a3 message:Message pts:int pts_count:int = Update;\nupdateInlineBotCallbackQuery#f9d27a5a flags:# query_id:long user_id:int msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;\nupdateReadChannelOutbox#25d6c9c7 channel_id:int max_id:int = Update;\nupdateDraftMessage#ee2bb969 peer:Peer draft:DraftMessage = Update;\nupdateReadFeaturedStickers#571d2742 = Update;\nupdateRecentStickers#9a422c20 = Update;\nupdateConfig#a229dd06 = Update;\nupdatePtsChanged#3354678f = Update;\nupdateChannelWebPage#40771900 channel_id:int webpage:WebPage pts:int pts_count:int = Update;\nupdateDialogPinned#6e6fe51c flags:# pinned:flags.0?true folder_id:flags.1?int peer:DialogPeer = Update;\nupdatePinnedDialogs#fa0f3ca2 flags:# folder_id:flags.1?int order:flags.0?Vector = Update;\nupdateBotWebhookJSON#8317c0c3 data:DataJSON = Update;\nupdateBotWebhookJSONQuery#9b9240a6 query_id:long data:DataJSON timeout:int = Update;\nupdateBotShippingQuery#e0cdc940 query_id:long user_id:int payload:bytes shipping_address:PostAddress = Update;\nupdateBotPrecheckoutQuery#5d2f3aa9 flags:# query_id:long user_id:int payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update;\nupdatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update;\nupdateLangPackTooLong#46560264 lang_code:string = Update;\nupdateLangPack#56022f4d difference:LangPackDifference = Update;\nupdateFavedStickers#e511996d = Update;\nupdateChannelReadMessagesContents#89893b45 channel_id:int messages:Vector = Update;\nupdateContactsReset#7084a7be = Update;\nupdateChannelAvailableMessages#70db6837 channel_id:int available_min_id:int = Update;\nupdateDialogUnreadMark#e16459c3 flags:# unread:flags.0?true peer:DialogPeer = Update;\nupdateMessagePoll#aca1657b flags:# poll_id:long poll:flags.0?Poll results:PollResults = Update;\nupdateChatDefaultBannedRights#54c01850 peer:Peer default_banned_rights:ChatBannedRights version:int = Update;\nupdateFolderPeers#19360dc0 folder_peers:Vector pts:int pts_count:int = Update;\nupdatePeerSettings#6a7e7366 peer:Peer settings:PeerSettings = Update;\nupdatePeerLocated#b4afcfb0 peers:Vector = Update;\nupdateNewScheduledMessage#39a51dfb message:Message = Update;\nupdateDeleteScheduledMessages#90866cee peer:Peer messages:Vector = Update;\nupdateTheme#8216fba3 theme:Theme = Update;\nupdateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update;\nupdateLoginToken#564fe691 = Update;\nupdateMessagePollVote#37f69f0b poll_id:long user_id:int options:Vector qts:int = Update;\nupdateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update;\nupdateDialogFilterOrder#a5d72105 order:Vector = Update;\nupdateDialogFilters#3504914f = Update;\nupdatePhoneCallSignalingData#2661bf09 phone_call_id:long data:bytes = Update;\nupdateChannelMessageForwards#6e8a84df channel_id:int id:int forwards:int = Update;\nupdateReadChannelDiscussionInbox#1cc7de54 flags:# channel_id:int top_msg_id:int read_max_id:int broadcast_id:flags.0?int broadcast_post:flags.0?int = Update;\nupdateReadChannelDiscussionOutbox#4638a26c channel_id:int top_msg_id:int read_max_id:int = Update;\nupdatePeerBlocked#246a4b22 peer_id:Peer blocked:Bool = Update;\nupdateChannelUserTyping#6b171718 flags:# channel_id:int top_msg_id:flags.0?int from_id:Peer action:SendMessageAction = Update;\nupdatePinnedMessages#ed85eab5 flags:# pinned:flags.0?true peer:Peer messages:Vector pts:int pts_count:int = Update;\nupdatePinnedChannelMessages#8588878b flags:# pinned:flags.0?true channel_id:int messages:Vector pts:int pts_count:int = Update;\nupdateChat#1330a196 chat_id:int = Update;\nupdateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector version:int = Update;\nupdateGroupCall#a45eb99b chat_id:int call:GroupCall = Update;\nupdatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update;\nupdateChatParticipant#f3b3781f flags:# chat_id:int date:int actor_id:int user_id:int prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update;\nupdateChannelParticipant#7fecb1ec flags:# channel_id:int date:int actor_id:int user_id:int prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update;\nupdateBotStopped#7f9488a user_id:int date:int stopped:Bool qts:int = Update;\nupdateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update;\nupdateBotCommands#cf7e0873 peer:Peer bot_id:int commands:Vector = Update;\nupdates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;\nupdates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;\nupdates.difference#f49ca0 new_messages:Vector new_encrypted_messages:Vector other_updates:Vector chats:Vector users:Vector state:updates.State = updates.Difference;\nupdates.differenceSlice#a8fb1981 new_messages:Vector new_encrypted_messages:Vector other_updates:Vector chats:Vector users:Vector intermediate_state:updates.State = updates.Difference;\nupdates.differenceTooLong#4afe8f6d pts:int = updates.Difference;\nupdatesTooLong#e317af7e = Updates;\nupdateShortMessage#faeff833 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates;\nupdateShortChatMessage#1157b858 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates;\nupdateShort#78d4dec1 update:Update date:int = Updates;\nupdatesCombined#725b04c3 updates:Vector users:Vector chats:Vector date:int seq_start:int seq:int = Updates;\nupdates#74ae4240 updates:Vector users:Vector chats:Vector date:int seq:int = Updates;\nupdateShortSentMessage#9015e101 flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector ttl_period:flags.25?int = Updates;\nphotos.photos#8dca6aa5 photos:Vector users:Vector = photos.Photos;\nphotos.photosSlice#15051f54 count:int photos:Vector users:Vector = photos.Photos;\nphotos.photo#20212ca8 photo:Photo users:Vector = photos.Photo;\nupload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;\nupload.fileCdnRedirect#f18cda44 dc_id:int file_token:bytes encryption_key:bytes encryption_iv:bytes file_hashes:Vector = upload.File;\ndcOption#18b7a10d flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true cdn:flags.3?true static:flags.4?true id:int ip_address:string port:int secret:flags.10?bytes = DcOption;\nconfig#330b4067 flags:# phonecalls_enabled:flags.1?true default_p2p_contacts:flags.3?true preload_featured_stickers:flags.4?true ignore_phone_entities:flags.5?true revoke_pm_inbox:flags.6?true blocked_mode:flags.8?true pfs_enabled:flags.13?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector dc_txt_domain_name:string chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int revoke_time_limit:int revoke_pm_time_limit:int rating_e_decay:int stickers_recent_limit:int stickers_faved_limit:int channels_read_media_period:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int pinned_infolder_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string autoupdate_url_prefix:flags.7?string gif_search_username:flags.9?string venue_search_username:flags.10?string img_search_username:flags.11?string static_maps_provider:flags.12?string caption_length_max:int message_length_max:int webfile_dc_id:int suggested_lang_code:flags.2?string lang_pack_version:flags.2?int base_lang_pack_version:flags.2?int = Config;\nnearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;\nhelp.appUpdate#ccbbce30 flags:# can_not_skip:flags.0?true id:int version:string text:string entities:Vector document:flags.1?Document url:flags.2?string sticker:flags.3?Document = help.AppUpdate;\nhelp.noAppUpdate#c45a6536 = help.AppUpdate;\nhelp.inviteText#18cb9f78 message:string = help.InviteText;\nencryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;\nencryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;\nencryptedChatRequested#62718a82 flags:# folder_id:flags.0?int id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;\nencryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;\nencryptedChatDiscarded#1e1c7c45 flags:# history_deleted:flags.0?true id:int = EncryptedChat;\ninputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;\nencryptedFileEmpty#c21f497e = EncryptedFile;\nencryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;\ninputEncryptedFileEmpty#1837c364 = InputEncryptedFile;\ninputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;\ninputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;\ninputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;\nencryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;\nencryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;\nmessages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;\nmessages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;\nmessages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;\nmessages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;\ninputDocumentEmpty#72f0eaae = InputDocument;\ninputDocument#1abfb575 id:long access_hash:long file_reference:bytes = InputDocument;\ndocumentEmpty#36f8c871 id:long = Document;\ndocument#1e87342b flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:int thumbs:flags.0?Vector video_thumbs:flags.1?Vector dc_id:int attributes:Vector = Document;\nhelp.support#17c6b5f6 phone_number:string user:User = help.Support;\nnotifyPeer#9fd40bd8 peer:Peer = NotifyPeer;\nnotifyUsers#b4c83b4c = NotifyPeer;\nnotifyChats#c007cec3 = NotifyPeer;\nnotifyBroadcasts#d612e8ef = NotifyPeer;\nsendMessageTypingAction#16bf744e = SendMessageAction;\nsendMessageCancelAction#fd5ec8f5 = SendMessageAction;\nsendMessageRecordVideoAction#a187d66f = SendMessageAction;\nsendMessageUploadVideoAction#e9763aec progress:int = SendMessageAction;\nsendMessageRecordAudioAction#d52f73f7 = SendMessageAction;\nsendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction;\nsendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction;\nsendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction;\nsendMessageGeoLocationAction#176f8ba1 = SendMessageAction;\nsendMessageChooseContactAction#628cbc6f = SendMessageAction;\nsendMessageGamePlayAction#dd6a8f48 = SendMessageAction;\nsendMessageRecordRoundAction#88f27fbc = SendMessageAction;\nsendMessageUploadRoundAction#243e1c66 progress:int = SendMessageAction;\nspeakingInGroupCallAction#d92c2285 = SendMessageAction;\nsendMessageHistoryImportAction#dbda9246 progress:int = SendMessageAction;\ncontacts.found#b3134d9d my_results:Vector results:Vector chats:Vector users:Vector = contacts.Found;\ninputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;\ninputPrivacyKeyChatInvite#bdfb0426 = InputPrivacyKey;\ninputPrivacyKeyPhoneCall#fabadc5f = InputPrivacyKey;\ninputPrivacyKeyPhoneP2P#db9e70d2 = InputPrivacyKey;\ninputPrivacyKeyForwards#a4dd4c08 = InputPrivacyKey;\ninputPrivacyKeyProfilePhoto#5719bacc = InputPrivacyKey;\ninputPrivacyKeyPhoneNumber#352dafa = InputPrivacyKey;\ninputPrivacyKeyAddedByPhone#d1219bdd = InputPrivacyKey;\nprivacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;\nprivacyKeyChatInvite#500e6dfa = PrivacyKey;\nprivacyKeyPhoneCall#3d662b7b = PrivacyKey;\nprivacyKeyPhoneP2P#39491cc8 = PrivacyKey;\nprivacyKeyForwards#69ec56a3 = PrivacyKey;\nprivacyKeyProfilePhoto#96151fed = PrivacyKey;\nprivacyKeyPhoneNumber#d19ae46d = PrivacyKey;\nprivacyKeyAddedByPhone#42ffd42b = PrivacyKey;\ninputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;\ninputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;\ninputPrivacyValueAllowUsers#131cc67f users:Vector = InputPrivacyRule;\ninputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule;\ninputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule;\ninputPrivacyValueDisallowUsers#90110467 users:Vector = InputPrivacyRule;\ninputPrivacyValueAllowChatParticipants#4c81c1ba chats:Vector = InputPrivacyRule;\ninputPrivacyValueDisallowChatParticipants#d82363af chats:Vector = InputPrivacyRule;\nprivacyValueAllowContacts#fffe1bac = PrivacyRule;\nprivacyValueAllowAll#65427b82 = PrivacyRule;\nprivacyValueAllowUsers#4d5bbe0c users:Vector = PrivacyRule;\nprivacyValueDisallowContacts#f888fa1a = PrivacyRule;\nprivacyValueDisallowAll#8b73e763 = PrivacyRule;\nprivacyValueDisallowUsers#c7f49b7 users:Vector = PrivacyRule;\nprivacyValueAllowChatParticipants#18be796b chats:Vector = PrivacyRule;\nprivacyValueDisallowChatParticipants#acae0690 chats:Vector = PrivacyRule;\naccount.privacyRules#50a04e45 rules:Vector chats:Vector users:Vector = account.PrivacyRules;\naccountDaysTTL#b8d0afdf days:int = AccountDaysTTL;\ndocumentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;\ndocumentAttributeAnimated#11b58939 = DocumentAttribute;\ndocumentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute;\ndocumentAttributeVideo#ef02ce6 flags:# round_message:flags.0?true supports_streaming:flags.1?true duration:int w:int h:int = DocumentAttribute;\ndocumentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute;\ndocumentAttributeFilename#15590068 file_name:string = DocumentAttribute;\ndocumentAttributeHasStickers#9801d2f7 = DocumentAttribute;\nmessages.stickersNotModified#f1749a22 = messages.Stickers;\nmessages.stickers#e4599bbd hash:int stickers:Vector = messages.Stickers;\nstickerPack#12b299d4 emoticon:string documents:Vector = StickerPack;\nmessages.allStickersNotModified#e86602c3 = messages.AllStickers;\nmessages.allStickers#edfd405f hash:int sets:Vector = messages.AllStickers;\nmessages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;\nwebPageEmpty#eb1477e8 id:long = WebPage;\nwebPagePending#c586da1c id:long date:int = WebPage;\nwebPage#e89c45b2 flags:# id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page attributes:flags.12?Vector = WebPage;\nwebPageNotModified#7311ca11 flags:# cached_page_views:flags.0?int = WebPage;\nauthorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true hash:long device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;\naccount.authorizations#1250abde authorizations:Vector = account.Authorizations;\naccount.password#185b184f flags:# has_recovery:flags.0?true has_secure_values:flags.1?true has_password:flags.2?true current_algo:flags.2?PasswordKdfAlgo srp_B:flags.2?bytes srp_id:flags.2?long hint:flags.3?string email_unconfirmed_pattern:flags.4?string new_algo:PasswordKdfAlgo new_secure_algo:SecurePasswordKdfAlgo secure_random:bytes pending_reset_date:flags.5?int = account.Password;\naccount.passwordSettings#9a5c33e5 flags:# email:flags.0?string secure_settings:flags.1?SecureSecretSettings = account.PasswordSettings;\naccount.passwordInputSettings#c23727c9 flags:# new_algo:flags.0?PasswordKdfAlgo new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string new_secure_settings:flags.2?SecureSecretSettings = account.PasswordInputSettings;\nauth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;\nreceivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;\nchatInviteExported#6e24fc9d flags:# revoked:flags.0?true permanent:flags.5?true link:string admin_id:int date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int = ExportedChatInvite;\nchatInviteAlready#5a686d7c chat:Chat = ChatInvite;\nchatInvite#dfc2f58e flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true title:string photo:Photo participants_count:int participants:flags.4?Vector = ChatInvite;\nchatInvitePeek#61695cb0 chat:Chat expires:int = ChatInvite;\ninputStickerSetEmpty#ffb62b95 = InputStickerSet;\ninputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;\ninputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;\ninputStickerSetAnimatedEmoji#28703c8 = InputStickerSet;\ninputStickerSetDice#e67f520e emoticon:string = InputStickerSet;\nstickerSet#d7df217a flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector thumb_dc_id:flags.4?int thumb_version:flags.4?int count:int hash:int = StickerSet;\nmessages.stickerSet#b60a24a6 set:StickerSet packs:Vector documents:Vector = messages.StickerSet;\nbotCommand#c27ac8c7 command:string description:string = BotCommand;\nbotInfo#98e81d3a user_id:int description:string commands:Vector = BotInfo;\nkeyboardButton#a2fa4880 text:string = KeyboardButton;\nkeyboardButtonUrl#258aff05 text:string url:string = KeyboardButton;\nkeyboardButtonCallback#35bbdb6b flags:# requires_password:flags.0?true text:string data:bytes = KeyboardButton;\nkeyboardButtonRequestPhone#b16a6c29 text:string = KeyboardButton;\nkeyboardButtonRequestGeoLocation#fc796b3f text:string = KeyboardButton;\nkeyboardButtonSwitchInline#568a748 flags:# same_peer:flags.0?true text:string query:string = KeyboardButton;\nkeyboardButtonGame#50f41ccf text:string = KeyboardButton;\nkeyboardButtonBuy#afd93fbb text:string = KeyboardButton;\nkeyboardButtonUrlAuth#10b78d29 flags:# text:string fwd_text:flags.0?string url:string button_id:int = KeyboardButton;\ninputKeyboardButtonUrlAuth#d02e7fd4 flags:# request_write_access:flags.0?true text:string fwd_text:flags.1?string url:string bot:InputUser = KeyboardButton;\nkeyboardButtonRequestPoll#bbc7515d flags:# quiz:flags.0?Bool text:string = KeyboardButton;\nkeyboardButtonRow#77608b83 buttons:Vector = KeyboardButtonRow;\nreplyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup;\nreplyKeyboardForceReply#86b40b08 flags:# single_use:flags.1?true selective:flags.2?true placeholder:flags.3?string = ReplyMarkup;\nreplyKeyboardMarkup#85dd99d1 flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true rows:Vector placeholder:flags.3?string = ReplyMarkup;\nreplyInlineMarkup#48a30254 rows:Vector = ReplyMarkup;\nmessageEntityUnknown#bb92ba95 offset:int length:int = MessageEntity;\nmessageEntityMention#fa04579d offset:int length:int = MessageEntity;\nmessageEntityHashtag#6f635b0d offset:int length:int = MessageEntity;\nmessageEntityBotCommand#6cef8ac7 offset:int length:int = MessageEntity;\nmessageEntityUrl#6ed02538 offset:int length:int = MessageEntity;\nmessageEntityEmail#64e475c2 offset:int length:int = MessageEntity;\nmessageEntityBold#bd610bc9 offset:int length:int = MessageEntity;\nmessageEntityItalic#826f8b60 offset:int length:int = MessageEntity;\nmessageEntityCode#28a20571 offset:int length:int = MessageEntity;\nmessageEntityPre#73924be0 offset:int length:int language:string = MessageEntity;\nmessageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity;\nmessageEntityMentionName#352dca58 offset:int length:int user_id:int = MessageEntity;\ninputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity;\nmessageEntityPhone#9b69e34b offset:int length:int = MessageEntity;\nmessageEntityCashtag#4c4e743f offset:int length:int = MessageEntity;\nmessageEntityUnderline#9c4e7e8b offset:int length:int = MessageEntity;\nmessageEntityStrike#bf0693d4 offset:int length:int = MessageEntity;\nmessageEntityBlockquote#20df5d0 offset:int length:int = MessageEntity;\nmessageEntityBankCard#761e6af4 offset:int length:int = MessageEntity;\ninputChannelEmpty#ee8c1e86 = InputChannel;\ninputChannel#afeb712e channel_id:int access_hash:long = InputChannel;\ninputChannelFromMessage#2a286531 peer:InputPeer msg_id:int channel_id:int = InputChannel;\ncontacts.resolvedPeer#7f077ad9 peer:Peer chats:Vector users:Vector = contacts.ResolvedPeer;\nmessageRange#ae30253 min_id:int max_id:int = MessageRange;\nupdates.channelDifferenceEmpty#3e11affb flags:# final:flags.0?true pts:int timeout:flags.1?int = updates.ChannelDifference;\nupdates.channelDifferenceTooLong#a4bcc6fe flags:# final:flags.0?true timeout:flags.1?int dialog:Dialog messages:Vector chats:Vector users:Vector = updates.ChannelDifference;\nupdates.channelDifference#2064674e flags:# final:flags.0?true pts:int timeout:flags.1?int new_messages:Vector other_updates:Vector chats:Vector users:Vector = updates.ChannelDifference;\nchannelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter;\nchannelMessagesFilter#cd77d957 flags:# exclude_new_messages:flags.1?true ranges:Vector = ChannelMessagesFilter;\nchannelParticipant#15ebac1d user_id:int date:int = ChannelParticipant;\nchannelParticipantSelf#a3289a6d user_id:int inviter_id:int date:int = ChannelParticipant;\nchannelParticipantCreator#447dca4b flags:# user_id:int admin_rights:ChatAdminRights rank:flags.0?string = ChannelParticipant;\nchannelParticipantAdmin#ccbebbaf flags:# can_edit:flags.0?true self:flags.1?true user_id:int inviter_id:flags.1?int promoted_by:int date:int admin_rights:ChatAdminRights rank:flags.2?string = ChannelParticipant;\nchannelParticipantBanned#50a1dfd6 flags:# left:flags.0?true peer:Peer kicked_by:int date:int banned_rights:ChatBannedRights = ChannelParticipant;\nchannelParticipantLeft#1b03f006 peer:Peer = ChannelParticipant;\nchannelParticipantsRecent#de3f3c79 = ChannelParticipantsFilter;\nchannelParticipantsAdmins#b4608969 = ChannelParticipantsFilter;\nchannelParticipantsKicked#a3b54985 q:string = ChannelParticipantsFilter;\nchannelParticipantsBots#b0d1865b = ChannelParticipantsFilter;\nchannelParticipantsBanned#1427a5e1 q:string = ChannelParticipantsFilter;\nchannelParticipantsSearch#656ac4b q:string = ChannelParticipantsFilter;\nchannelParticipantsContacts#bb6ae88d q:string = ChannelParticipantsFilter;\nchannelParticipantsMentions#e04b5ceb flags:# q:flags.0?string top_msg_id:flags.1?int = ChannelParticipantsFilter;\nchannels.channelParticipants#9ab0feaf count:int participants:Vector chats:Vector users:Vector = channels.ChannelParticipants;\nchannels.channelParticipantsNotModified#f0173fe9 = channels.ChannelParticipants;\nchannels.channelParticipant#dfb80317 participant:ChannelParticipant chats:Vector users:Vector = channels.ChannelParticipant;\nhelp.termsOfService#780a0310 flags:# popup:flags.0?true id:DataJSON text:string entities:Vector min_age_confirm:flags.1?int = help.TermsOfService;\nmessages.savedGifsNotModified#e8025ca2 = messages.SavedGifs;\nmessages.savedGifs#2e0709a5 hash:int gifs:Vector = messages.SavedGifs;\ninputBotInlineMessageMediaAuto#3380c786 flags:# message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaGeo#96929a85 flags:# geo_point:InputGeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaVenue#417bbf11 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaContact#a6edbffd flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaInvoice#d7e78225 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineResult#88bf9319 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?InputWebDocument content:flags.5?InputWebDocument send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultDocument#fff8fdc4 flags:# id:string type:string title:flags.1?string description:flags.2?string document:InputDocument send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultGame#4fa417f2 id:string short_name:string send_message:InputBotInlineMessage = InputBotInlineResult;\nbotInlineMessageMediaAuto#764cf810 flags:# message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaGeo#51846fd flags:# geo:GeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaVenue#8a86659c flags:# geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaContact#18d1cdc2 flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaInvoice#354a9b09 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument currency:string total_amount:long reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineResult#11965f3a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?WebDocument content:flags.5?WebDocument send_message:BotInlineMessage = BotInlineResult;\nbotInlineMediaResult#17db940b flags:# id:string type:string photo:flags.0?Photo document:flags.1?Document title:flags.2?string description:flags.3?string send_message:BotInlineMessage = BotInlineResult;\nmessages.botResults#947ca848 flags:# gallery:flags.0?true query_id:long next_offset:flags.1?string switch_pm:flags.2?InlineBotSwitchPM results:Vector cache_time:int users:Vector = messages.BotResults;\nexportedMessageLink#5dab1af4 link:string html:string = ExportedMessageLink;\nmessageFwdHeader#5f777dce flags:# imported:flags.7?true from_id:flags.0?Peer from_name:flags.5?string date:int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int psa_type:flags.6?string = MessageFwdHeader;\nauth.codeTypeSms#72a3158c = auth.CodeType;\nauth.codeTypeCall#741cd3e3 = auth.CodeType;\nauth.codeTypeFlashCall#226ccefb = auth.CodeType;\nauth.sentCodeTypeApp#3dbb5986 length:int = auth.SentCodeType;\nauth.sentCodeTypeSms#c000bba2 length:int = auth.SentCodeType;\nauth.sentCodeTypeCall#5353e5a7 length:int = auth.SentCodeType;\nauth.sentCodeTypeFlashCall#ab03c6d9 pattern:string = auth.SentCodeType;\nmessages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?true native_ui:flags.4?true message:flags.0?string url:flags.2?string cache_time:int = messages.BotCallbackAnswer;\nmessages.messageEditData#26b5dde6 flags:# caption:flags.0?true = messages.MessageEditData;\ninputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID;\ninlineBotSwitchPM#3c20629f text:string start_param:string = InlineBotSwitchPM;\nmessages.peerDialogs#3371c354 dialogs:Vector messages:Vector chats:Vector users:Vector state:updates.State = messages.PeerDialogs;\ntopPeer#edcdc05b peer:Peer rating:double = TopPeer;\ntopPeerCategoryBotsPM#ab661b5b = TopPeerCategory;\ntopPeerCategoryBotsInline#148677e2 = TopPeerCategory;\ntopPeerCategoryCorrespondents#637b7ed = TopPeerCategory;\ntopPeerCategoryGroups#bd17a14a = TopPeerCategory;\ntopPeerCategoryChannels#161d9628 = TopPeerCategory;\ntopPeerCategoryPhoneCalls#1e76a78c = TopPeerCategory;\ntopPeerCategoryForwardUsers#a8406ca9 = TopPeerCategory;\ntopPeerCategoryForwardChats#fbeec0f0 = TopPeerCategory;\ntopPeerCategoryPeers#fb834291 category:TopPeerCategory count:int peers:Vector = TopPeerCategoryPeers;\ncontacts.topPeersNotModified#de266ef5 = contacts.TopPeers;\ncontacts.topPeers#70b772a8 categories:Vector chats:Vector users:Vector = contacts.TopPeers;\ncontacts.topPeersDisabled#b52c939d = contacts.TopPeers;\ndraftMessageEmpty#1b0c841a flags:# date:flags.0?int = DraftMessage;\ndraftMessage#fd8e711f flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int message:string entities:flags.3?Vector date:int = DraftMessage;\nmessages.featuredStickersNotModified#c6dc0c66 count:int = messages.FeaturedStickers;\nmessages.featuredStickers#b6abc341 hash:int count:int sets:Vector unread:Vector = messages.FeaturedStickers;\nmessages.recentStickersNotModified#b17f890 = messages.RecentStickers;\nmessages.recentStickers#22f3afb3 hash:int packs:Vector stickers:Vector dates:Vector = messages.RecentStickers;\nmessages.archivedStickers#4fcba9c8 count:int sets:Vector = messages.ArchivedStickers;\nmessages.stickerSetInstallResultSuccess#38641628 = messages.StickerSetInstallResult;\nmessages.stickerSetInstallResultArchive#35e410a8 sets:Vector = messages.StickerSetInstallResult;\nstickerSetCovered#6410a5d2 set:StickerSet cover:Document = StickerSetCovered;\nstickerSetMultiCovered#3407e51b set:StickerSet covers:Vector = StickerSetCovered;\nmaskCoords#aed6dbb2 n:int x:double y:double zoom:double = MaskCoords;\ninputStickeredMediaPhoto#4a992157 id:InputPhoto = InputStickeredMedia;\ninputStickeredMediaDocument#438865b id:InputDocument = InputStickeredMedia;\ngame#bdf9653b flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document = Game;\ninputGameID#32c3e77 id:long access_hash:long = InputGame;\ninputGameShortName#c331e80a bot_id:InputUser short_name:string = InputGame;\nhighScore#58fffcd0 pos:int user_id:int score:int = HighScore;\nmessages.highScores#9a3bfd99 scores:Vector users:Vector = messages.HighScores;\ntextEmpty#dc3d824f = RichText;\ntextPlain#744694e0 text:string = RichText;\ntextBold#6724abc4 text:RichText = RichText;\ntextItalic#d912a59c text:RichText = RichText;\ntextUnderline#c12622c4 text:RichText = RichText;\ntextStrike#9bf8bb95 text:RichText = RichText;\ntextFixed#6c3f19b9 text:RichText = RichText;\ntextUrl#3c2884c1 text:RichText url:string webpage_id:long = RichText;\ntextEmail#de5a0dd6 text:RichText email:string = RichText;\ntextConcat#7e6260d7 texts:Vector = RichText;\ntextSubscript#ed6a8504 text:RichText = RichText;\ntextSuperscript#c7fb5e01 text:RichText = RichText;\ntextMarked#34b8621 text:RichText = RichText;\ntextPhone#1ccb966a text:RichText phone:string = RichText;\ntextImage#81ccf4f document_id:long w:int h:int = RichText;\ntextAnchor#35553762 text:RichText name:string = RichText;\npageBlockUnsupported#13567e8a = PageBlock;\npageBlockTitle#70abc3fd text:RichText = PageBlock;\npageBlockSubtitle#8ffa9a1f text:RichText = PageBlock;\npageBlockAuthorDate#baafe5e0 author:RichText published_date:int = PageBlock;\npageBlockHeader#bfd064ec text:RichText = PageBlock;\npageBlockSubheader#f12bb6e1 text:RichText = PageBlock;\npageBlockParagraph#467a0766 text:RichText = PageBlock;\npageBlockPreformatted#c070d93e text:RichText language:string = PageBlock;\npageBlockFooter#48870999 text:RichText = PageBlock;\npageBlockDivider#db20b188 = PageBlock;\npageBlockAnchor#ce0d37b0 name:string = PageBlock;\npageBlockList#e4e88011 items:Vector = PageBlock;\npageBlockBlockquote#263d7c26 text:RichText caption:RichText = PageBlock;\npageBlockPullquote#4f4456d3 text:RichText caption:RichText = PageBlock;\npageBlockPhoto#1759c560 flags:# photo_id:long caption:PageCaption url:flags.0?string webpage_id:flags.0?long = PageBlock;\npageBlockVideo#7c8fe7b6 flags:# autoplay:flags.0?true loop:flags.1?true video_id:long caption:PageCaption = PageBlock;\npageBlockCover#39f23300 cover:PageBlock = PageBlock;\npageBlockEmbed#a8718dc5 flags:# full_width:flags.0?true allow_scrolling:flags.3?true url:flags.1?string html:flags.2?string poster_photo_id:flags.4?long w:flags.5?int h:flags.5?int caption:PageCaption = PageBlock;\npageBlockEmbedPost#f259a80b url:string webpage_id:long author_photo_id:long author:string date:int blocks:Vector caption:PageCaption = PageBlock;\npageBlockCollage#65a0fa4d items:Vector caption:PageCaption = PageBlock;\npageBlockSlideshow#31f9590 items:Vector caption:PageCaption = PageBlock;\npageBlockChannel#ef1751b5 channel:Chat = PageBlock;\npageBlockAudio#804361ea audio_id:long caption:PageCaption = PageBlock;\npageBlockKicker#1e148390 text:RichText = PageBlock;\npageBlockTable#bf4dea82 flags:# bordered:flags.0?true striped:flags.1?true title:RichText rows:Vector = PageBlock;\npageBlockOrderedList#9a8ae1e1 items:Vector = PageBlock;\npageBlockDetails#76768bed flags:# open:flags.0?true blocks:Vector title:RichText = PageBlock;\npageBlockRelatedArticles#16115a96 title:RichText articles:Vector = PageBlock;\npageBlockMap#a44f3ef6 geo:GeoPoint zoom:int w:int h:int caption:PageCaption = PageBlock;\nphoneCallDiscardReasonMissed#85e42301 = PhoneCallDiscardReason;\nphoneCallDiscardReasonDisconnect#e095c1a0 = PhoneCallDiscardReason;\nphoneCallDiscardReasonHangup#57adc690 = PhoneCallDiscardReason;\nphoneCallDiscardReasonBusy#faf7e8c9 = PhoneCallDiscardReason;\ndataJSON#7d748d04 data:string = DataJSON;\nlabeledPrice#cb296bf8 label:string amount:long = LabeledPrice;\ninvoice#cd886e0 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true currency:string prices:Vector max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector = Invoice;\npaymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge;\npostAddress#1e8caaeb street_line1:string street_line2:string city:string state:string country_iso2:string post_code:string = PostAddress;\npaymentRequestedInfo#909c3f94 flags:# name:flags.0?string phone:flags.1?string email:flags.2?string shipping_address:flags.3?PostAddress = PaymentRequestedInfo;\npaymentSavedCredentialsCard#cdc27a1f id:string title:string = PaymentSavedCredentials;\nwebDocument#1c570ed1 url:string access_hash:long size:int mime_type:string attributes:Vector = WebDocument;\nwebDocumentNoProxy#f9c8bcc6 url:string size:int mime_type:string attributes:Vector = WebDocument;\ninputWebDocument#9bed434d url:string size:int mime_type:string attributes:Vector = InputWebDocument;\ninputWebFileLocation#c239d686 url:string access_hash:long = InputWebFileLocation;\ninputWebFileGeoPointLocation#9f2221c9 geo_point:InputGeoPoint access_hash:long w:int h:int zoom:int scale:int = InputWebFileLocation;\nupload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile;\npayments.paymentForm#8d0b2415 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector = payments.PaymentForm;\npayments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector = payments.ValidatedRequestedInfo;\npayments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult;\npayments.paymentVerificationNeeded#d8411139 url:string = payments.PaymentResult;\npayments.paymentReceipt#10b555d0 flags:# date:int bot_id:int provider_id:int title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector = payments.PaymentReceipt;\npayments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo;\ninputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;\ninputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;\ninputPaymentCredentialsApplePay#aa1c39f payment_data:DataJSON = InputPaymentCredentials;\ninputPaymentCredentialsGooglePay#8ac32801 payment_token:DataJSON = InputPaymentCredentials;\naccount.tmpPassword#db64fd34 tmp_password:bytes valid_until:int = account.TmpPassword;\nshippingOption#b6213cdf id:string title:string prices:Vector = ShippingOption;\ninputStickerSetItem#ffa0a496 flags:# document:InputDocument emoji:string mask_coords:flags.0?MaskCoords = InputStickerSetItem;\ninputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall;\nphoneCallEmpty#5366c915 id:long = PhoneCall;\nphoneCallWaiting#1b8f4ad1 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall;\nphoneCallRequested#87eabb53 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall;\nphoneCallAccepted#997c454a flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_b:bytes protocol:PhoneCallProtocol = PhoneCall;\nphoneCall#8742ae7f flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector start_date:int = PhoneCall;\nphoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall;\nphoneConnection#9d4c17c0 id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection;\nphoneConnectionWebrtc#635fe375 flags:# turn:flags.0?true stun:flags.1?true id:long ip:string ipv6:string port:int username:string password:string = PhoneConnection;\nphoneCallProtocol#fc878fc8 flags:# udp_p2p:flags.0?true udp_reflector:flags.1?true min_layer:int max_layer:int library_versions:Vector = PhoneCallProtocol;\nphone.phoneCall#ec82e140 phone_call:PhoneCall users:Vector = phone.PhoneCall;\nupload.cdnFileReuploadNeeded#eea8e46e request_token:bytes = upload.CdnFile;\nupload.cdnFile#a99fca4f bytes:bytes = upload.CdnFile;\ncdnPublicKey#c982eaba dc_id:int public_key:string = CdnPublicKey;\ncdnConfig#5725e40a public_keys:Vector = CdnConfig;\nlangPackString#cad181f6 key:string value:string = LangPackString;\nlangPackStringPluralized#6c47ac9f flags:# key:string zero_value:flags.0?string one_value:flags.1?string two_value:flags.2?string few_value:flags.3?string many_value:flags.4?string other_value:string = LangPackString;\nlangPackStringDeleted#2979eeb2 key:string = LangPackString;\nlangPackDifference#f385c1f6 lang_code:string from_version:int version:int strings:Vector = LangPackDifference;\nlangPackLanguage#eeca5ce3 flags:# official:flags.0?true rtl:flags.2?true beta:flags.3?true name:string native_name:string lang_code:string base_lang_code:flags.1?string plural_code:string strings_count:int translated_count:int translations_url:string = LangPackLanguage;\nchannelAdminLogEventActionChangeTitle#e6dfb825 prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeAbout#55188a2e prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeUsername#6a4afc38 prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangePhoto#434bd2af prev_photo:Photo new_photo:Photo = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleInvites#1b7907ae new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleSignatures#26ae0971 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionUpdatePinned#e9e82c18 message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionEditMessage#709b2405 prev_message:Message new_message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDeleteMessage#42e047bb message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantJoin#183040d3 = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantLeave#f89777f2 = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantInvite#e31c34d8 participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantToggleBan#e6d83d7e prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantToggleAdmin#d5676710 prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeStickerSet#b1c3caa7 prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction;\nchannelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDefaultBannedRights#2df5fc0a prev_banned_rights:ChatBannedRights new_banned_rights:ChatBannedRights = ChannelAdminLogEventAction;\nchannelAdminLogEventActionStopPoll#8f079643 message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeLinkedChat#a26f881b prev_value:int new_value:int = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeLocation#e6b76ae prev_value:ChannelLocation new_value:ChannelLocation = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleSlowMode#53909779 prev_value:int new_value:int = ChannelAdminLogEventAction;\nchannelAdminLogEventActionStartGroupCall#23209745 call:InputGroupCall = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDiscardGroupCall#db9f9140 call:InputGroupCall = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantMute#f92424d2 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantUnmute#e64429c0 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleGroupCallSetting#56d6a247 join_muted:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantJoinByInvite#5cdada77 invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteDelete#5a50fca4 invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantVolume#3e7f6847 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeHistoryTTL#6e941a38 prev_value:int new_value:int = ChannelAdminLogEventAction;\nchannelAdminLogEvent#3b5a3e40 id:long date:int user_id:int action:ChannelAdminLogEventAction = ChannelAdminLogEvent;\nchannels.adminLogResults#ed8af74d events:Vector chats:Vector users:Vector = channels.AdminLogResults;\nchannelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true = ChannelAdminLogEventsFilter;\npopularContact#5ce14175 client_id:long importers:int = PopularContact;\nmessages.favedStickersNotModified#9e8fa6d3 = messages.FavedStickers;\nmessages.favedStickers#f37f2f16 hash:int packs:Vector stickers:Vector = messages.FavedStickers;\nrecentMeUrlUnknown#46e1d13d url:string = RecentMeUrl;\nrecentMeUrlUser#8dbc3336 url:string user_id:int = RecentMeUrl;\nrecentMeUrlChat#a01b22f9 url:string chat_id:int = RecentMeUrl;\nrecentMeUrlChatInvite#eb49081d url:string chat_invite:ChatInvite = RecentMeUrl;\nrecentMeUrlStickerSet#bc0a57dc url:string set:StickerSetCovered = RecentMeUrl;\nhelp.recentMeUrls#e0310d7 urls:Vector chats:Vector users:Vector = help.RecentMeUrls;\ninputSingleMedia#1cc6e91f flags:# media:InputMedia random_id:long message:string entities:flags.0?Vector = InputSingleMedia;\nwebAuthorization#cac943f2 hash:long bot_id:int domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization;\naccount.webAuthorizations#ed56c9fc authorizations:Vector users:Vector = account.WebAuthorizations;\ninputMessageID#a676a322 id:int = InputMessage;\ninputMessageReplyTo#bad88395 id:int = InputMessage;\ninputMessagePinned#86872538 = InputMessage;\ninputMessageCallbackQuery#acfa1a7e id:int query_id:long = InputMessage;\ninputDialogPeer#fcaafeb7 peer:InputPeer = InputDialogPeer;\ninputDialogPeerFolder#64600527 folder_id:int = InputDialogPeer;\ndialogPeer#e56dbf05 peer:Peer = DialogPeer;\ndialogPeerFolder#514519e2 folder_id:int = DialogPeer;\nmessages.foundStickerSetsNotModified#d54b65d = messages.FoundStickerSets;\nmessages.foundStickerSets#5108d648 hash:int sets:Vector = messages.FoundStickerSets;\nfileHash#6242c773 offset:int limit:int hash:bytes = FileHash;\ninputClientProxy#75588b3f address:string port:int = InputClientProxy;\nhelp.termsOfServiceUpdateEmpty#e3309f7f expires:int = help.TermsOfServiceUpdate;\nhelp.termsOfServiceUpdate#28ecf961 expires:int terms_of_service:help.TermsOfService = help.TermsOfServiceUpdate;\ninputSecureFileUploaded#3334b0f0 id:long parts:int md5_checksum:string file_hash:bytes secret:bytes = InputSecureFile;\ninputSecureFile#5367e5be id:long access_hash:long = InputSecureFile;\nsecureFileEmpty#64199744 = SecureFile;\nsecureFile#e0277a62 id:long access_hash:long size:int dc_id:int date:int file_hash:bytes secret:bytes = SecureFile;\nsecureData#8aeabec3 data:bytes data_hash:bytes secret:bytes = SecureData;\nsecurePlainPhone#7d6099dd phone:string = SecurePlainData;\nsecurePlainEmail#21ec5a5f email:string = SecurePlainData;\nsecureValueTypePersonalDetails#9d2a81e3 = SecureValueType;\nsecureValueTypePassport#3dac6a00 = SecureValueType;\nsecureValueTypeDriverLicense#6e425c4 = SecureValueType;\nsecureValueTypeIdentityCard#a0d0744b = SecureValueType;\nsecureValueTypeInternalPassport#99a48f23 = SecureValueType;\nsecureValueTypeAddress#cbe31e26 = SecureValueType;\nsecureValueTypeUtilityBill#fc36954e = SecureValueType;\nsecureValueTypeBankStatement#89137c0d = SecureValueType;\nsecureValueTypeRentalAgreement#8b883488 = SecureValueType;\nsecureValueTypePassportRegistration#99e3806a = SecureValueType;\nsecureValueTypeTemporaryRegistration#ea02ec33 = SecureValueType;\nsecureValueTypePhone#b320aadb = SecureValueType;\nsecureValueTypeEmail#8e3ca7ee = SecureValueType;\nsecureValue#187fa0ca flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?SecureFile reverse_side:flags.2?SecureFile selfie:flags.3?SecureFile translation:flags.6?Vector files:flags.4?Vector plain_data:flags.5?SecurePlainData hash:bytes = SecureValue;\ninputSecureValue#db21d0a7 flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?InputSecureFile reverse_side:flags.2?InputSecureFile selfie:flags.3?InputSecureFile translation:flags.6?Vector files:flags.4?Vector plain_data:flags.5?SecurePlainData = InputSecureValue;\nsecureValueHash#ed1ecdb0 type:SecureValueType hash:bytes = SecureValueHash;\nsecureValueErrorData#e8a40bd9 type:SecureValueType data_hash:bytes field:string text:string = SecureValueError;\nsecureValueErrorFrontSide#be3dfa type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorReverseSide#868a2aa5 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorSelfie#e537ced6 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorFile#7a700873 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorFiles#666220e9 type:SecureValueType file_hash:Vector text:string = SecureValueError;\nsecureValueError#869d758f type:SecureValueType hash:bytes text:string = SecureValueError;\nsecureValueErrorTranslationFile#a1144770 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorTranslationFiles#34636dd8 type:SecureValueType file_hash:Vector text:string = SecureValueError;\nsecureCredentialsEncrypted#33f0ea47 data:bytes hash:bytes secret:bytes = SecureCredentialsEncrypted;\naccount.authorizationForm#ad2e1cd8 flags:# required_types:Vector values:Vector errors:Vector users:Vector privacy_policy_url:flags.0?string = account.AuthorizationForm;\naccount.sentEmailCode#811f854f email_pattern:string length:int = account.SentEmailCode;\nhelp.deepLinkInfoEmpty#66afa166 = help.DeepLinkInfo;\nhelp.deepLinkInfo#6a4ee832 flags:# update_app:flags.0?true message:string entities:flags.1?Vector = help.DeepLinkInfo;\nsavedPhoneContact#1142bd56 phone:string first_name:string last_name:string date:int = SavedContact;\naccount.takeout#4dba4501 id:long = account.Takeout;\npasswordKdfAlgoUnknown#d45ab096 = PasswordKdfAlgo;\npasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow#3a912d4a salt1:bytes salt2:bytes g:int p:bytes = PasswordKdfAlgo;\nsecurePasswordKdfAlgoUnknown#4a8537 = SecurePasswordKdfAlgo;\nsecurePasswordKdfAlgoPBKDF2HMACSHA512iter100000#bbf2dda0 salt:bytes = SecurePasswordKdfAlgo;\nsecurePasswordKdfAlgoSHA512#86471d92 salt:bytes = SecurePasswordKdfAlgo;\nsecureSecretSettings#1527bcac secure_algo:SecurePasswordKdfAlgo secure_secret:bytes secure_secret_id:long = SecureSecretSettings;\ninputCheckPasswordEmpty#9880f658 = InputCheckPasswordSRP;\ninputCheckPasswordSRP#d27ff082 srp_id:long A:bytes M1:bytes = InputCheckPasswordSRP;\nsecureRequiredType#829d99da flags:# native_names:flags.0?true selfie_required:flags.1?true translation_required:flags.2?true type:SecureValueType = SecureRequiredType;\nsecureRequiredTypeOneOf#27477b4 types:Vector = SecureRequiredType;\nhelp.passportConfigNotModified#bfb9f457 = help.PassportConfig;\nhelp.passportConfig#a098d6af hash:int countries_langs:DataJSON = help.PassportConfig;\ninputAppEvent#1d1b1245 time:double type:string peer:long data:JSONValue = InputAppEvent;\njsonObjectValue#c0de1bd9 key:string value:JSONValue = JSONObjectValue;\njsonNull#3f6d7b68 = JSONValue;\njsonBool#c7345e6a value:Bool = JSONValue;\njsonNumber#2be0dfa4 value:double = JSONValue;\njsonString#b71e767a value:string = JSONValue;\njsonArray#f7444763 value:Vector = JSONValue;\njsonObject#99c1d49d value:Vector = JSONValue;\npageTableCell#34566b6a flags:# header:flags.0?true align_center:flags.3?true align_right:flags.4?true valign_middle:flags.5?true valign_bottom:flags.6?true text:flags.7?RichText colspan:flags.1?int rowspan:flags.2?int = PageTableCell;\npageTableRow#e0c0c5e5 cells:Vector = PageTableRow;\npageCaption#6f747657 text:RichText credit:RichText = PageCaption;\npageListItemText#b92fb6cd text:RichText = PageListItem;\npageListItemBlocks#25e073fc blocks:Vector = PageListItem;\npageListOrderedItemText#5e068047 num:string text:RichText = PageListOrderedItem;\npageListOrderedItemBlocks#98dd8936 num:string blocks:Vector = PageListOrderedItem;\npageRelatedArticle#b390dc08 flags:# url:string webpage_id:long title:flags.0?string description:flags.1?string photo_id:flags.2?long author:flags.3?string published_date:flags.4?int = PageRelatedArticle;\npage#98657f0d flags:# part:flags.0?true rtl:flags.1?true v2:flags.2?true url:string blocks:Vector photos:Vector documents:Vector views:flags.3?int = Page;\nhelp.supportName#8c05f1c9 name:string = help.SupportName;\nhelp.userInfoEmpty#f3ae2eed = help.UserInfo;\nhelp.userInfo#1eb3758 message:string entities:Vector author:string date:int = help.UserInfo;\npollAnswer#6ca9c2e9 text:string option:bytes = PollAnswer;\npoll#86e18161 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true question:string answers:Vector close_period:flags.4?int close_date:flags.5?int = Poll;\npollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters;\npollResults#badcc1a3 flags:# min:flags.0?true results:flags.1?Vector total_voters:flags.2?int recent_voters:flags.3?Vector solution:flags.4?string solution_entities:flags.4?Vector = PollResults;\nchatOnlines#f041e250 onlines:int = ChatOnlines;\nstatsURL#47a971e0 url:string = StatsURL;\nchatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true = ChatAdminRights;\nchatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true send_polls:flags.8?true change_info:flags.10?true invite_users:flags.15?true pin_messages:flags.17?true until_date:int = ChatBannedRights;\ninputWallPaper#e630b979 id:long access_hash:long = InputWallPaper;\ninputWallPaperSlug#72091c80 slug:string = InputWallPaper;\ninputWallPaperNoFile#967a462e id:long = InputWallPaper;\naccount.wallPapersNotModified#1c199183 = account.WallPapers;\naccount.wallPapers#702b65a9 hash:int wallpapers:Vector = account.WallPapers;\ncodeSettings#debebe83 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true = CodeSettings;\nwallPaperSettings#1dc1bca4 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int third_background_color:flags.5?int fourth_background_color:flags.6?int intensity:flags.3?int rotation:flags.4?int = WallPaperSettings;\nautoDownloadSettings#e04232f3 flags:# disabled:flags.0?true video_preload_large:flags.1?true audio_preload_next:flags.2?true phonecalls_less_data:flags.3?true photo_size_max:int video_size_max:int file_size_max:int video_upload_maxbitrate:int = AutoDownloadSettings;\naccount.autoDownloadSettings#63cacf26 low:AutoDownloadSettings medium:AutoDownloadSettings high:AutoDownloadSettings = account.AutoDownloadSettings;\nemojiKeyword#d5b3b9f9 keyword:string emoticons:Vector = EmojiKeyword;\nemojiKeywordDeleted#236df622 keyword:string emoticons:Vector = EmojiKeyword;\nemojiKeywordsDifference#5cc761bd lang_code:string from_version:int version:int keywords:Vector = EmojiKeywordsDifference;\nemojiURL#a575739d url:string = EmojiURL;\nemojiLanguage#b3fb5361 lang_code:string = EmojiLanguage;\nfolder#ff544e65 flags:# autofill_new_broadcasts:flags.0?true autofill_public_groups:flags.1?true autofill_new_correspondents:flags.2?true id:int title:string photo:flags.3?ChatPhoto = Folder;\ninputFolderPeer#fbd2c296 peer:InputPeer folder_id:int = InputFolderPeer;\nfolderPeer#e9baa668 peer:Peer folder_id:int = FolderPeer;\nmessages.searchCounter#e844ebff flags:# inexact:flags.1?true filter:MessagesFilter count:int = messages.SearchCounter;\nurlAuthResultRequest#92d33a0e flags:# request_write_access:flags.0?true bot:User domain:string = UrlAuthResult;\nurlAuthResultAccepted#8f8c0e4e url:string = UrlAuthResult;\nurlAuthResultDefault#a9d6db1f = UrlAuthResult;\nchannelLocationEmpty#bfb5ad8b = ChannelLocation;\nchannelLocation#209b82db geo_point:GeoPoint address:string = ChannelLocation;\npeerLocated#ca461b5d peer:Peer expires:int distance:int = PeerLocated;\npeerSelfLocated#f8ec284b expires:int = PeerLocated;\nrestrictionReason#d072acb4 platform:string reason:string text:string = RestrictionReason;\ninputTheme#3c5693e9 id:long access_hash:long = InputTheme;\ninputThemeSlug#f5890df1 slug:string = InputTheme;\ntheme#28f1114 flags:# creator:flags.0?true default:flags.1?true id:long access_hash:long slug:string title:string document:flags.2?Document settings:flags.3?ThemeSettings installs_count:int = Theme;\naccount.themesNotModified#f41eb622 = account.Themes;\naccount.themes#7f676421 hash:int themes:Vector = account.Themes;\nauth.loginToken#629f1980 expires:int token:bytes = auth.LoginToken;\nauth.loginTokenMigrateTo#68e9916 dc_id:int token:bytes = auth.LoginToken;\nauth.loginTokenSuccess#390d5c5e authorization:auth.Authorization = auth.LoginToken;\naccount.contentSettings#57e28221 flags:# sensitive_enabled:flags.0?true sensitive_can_change:flags.1?true = account.ContentSettings;\nmessages.inactiveChats#a927fec5 dates:Vector chats:Vector users:Vector = messages.InactiveChats;\nbaseThemeClassic#c3a12462 = BaseTheme;\nbaseThemeDay#fbd81688 = BaseTheme;\nbaseThemeNight#b7b31ea8 = BaseTheme;\nbaseThemeTinted#6d5f77ee = BaseTheme;\nbaseThemeArctic#5b11125a = BaseTheme;\ninputThemeSettings#bd507cd1 flags:# base_theme:BaseTheme accent_color:int message_top_color:flags.0?int message_bottom_color:flags.0?int wallpaper:flags.1?InputWallPaper wallpaper_settings:flags.1?WallPaperSettings = InputThemeSettings;\nthemeSettings#9c14984a flags:# base_theme:BaseTheme accent_color:int message_top_color:flags.0?int message_bottom_color:flags.0?int wallpaper:flags.1?WallPaper = ThemeSettings;\nwebPageAttributeTheme#54b56617 flags:# documents:flags.0?Vector settings:flags.1?ThemeSettings = WebPageAttribute;\nmessageUserVote#a28e5559 user_id:int option:bytes date:int = MessageUserVote;\nmessageUserVoteInputOption#36377430 user_id:int date:int = MessageUserVote;\nmessageUserVoteMultiple#e8fe0de user_id:int options:Vector date:int = MessageUserVote;\nmessages.votesList#823f649 flags:# count:int votes:Vector users:Vector next_offset:flags.0?string = messages.VotesList;\nbankCardOpenUrl#f568028a url:string name:string = BankCardOpenUrl;\npayments.bankCardData#3e24e573 title:string open_urls:Vector = payments.BankCardData;\ndialogFilter#7438f7e8 flags:# contacts:flags.0?true non_contacts:flags.1?true groups:flags.2?true broadcasts:flags.3?true bots:flags.4?true exclude_muted:flags.11?true exclude_read:flags.12?true exclude_archived:flags.13?true id:int title:string emoticon:flags.25?string pinned_peers:Vector include_peers:Vector exclude_peers:Vector = DialogFilter;\ndialogFilterSuggested#77744d4a filter:DialogFilter description:string = DialogFilterSuggested;\nstatsDateRangeDays#b637edaf min_date:int max_date:int = StatsDateRangeDays;\nstatsAbsValueAndPrev#cb43acde current:double previous:double = StatsAbsValueAndPrev;\nstatsPercentValue#cbce2fe0 part:double total:double = StatsPercentValue;\nstatsGraphAsync#4a27eb2d token:string = StatsGraph;\nstatsGraphError#bedc9822 error:string = StatsGraph;\nstatsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph;\nmessageInteractionCounters#ad4fc9bd msg_id:int views:int forwards:int = MessageInteractionCounters;\nstats.broadcastStats#bdf78394 period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post:StatsAbsValueAndPrev enabled_notifications:StatsPercentValue growth_graph:StatsGraph followers_graph:StatsGraph mute_graph:StatsGraph top_hours_graph:StatsGraph interactions_graph:StatsGraph iv_interactions_graph:StatsGraph views_by_source_graph:StatsGraph new_followers_by_source_graph:StatsGraph languages_graph:StatsGraph recent_message_interactions:Vector = stats.BroadcastStats;\nhelp.promoDataEmpty#98f6ac75 expires:int = help.PromoData;\nhelp.promoData#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:Vector users:Vector psa_type:flags.1?string psa_message:flags.2?string = help.PromoData;\nvideoSize#de33b094 flags:# type:string w:int h:int size:int video_start_ts:flags.0?double = VideoSize;\nstatsGroupTopPoster#18f3d0f7 user_id:int messages:int avg_chars:int = StatsGroupTopPoster;\nstatsGroupTopAdmin#6014f412 user_id:int deleted:int kicked:int banned:int = StatsGroupTopAdmin;\nstatsGroupTopInviter#31962a4c user_id:int invitations:int = StatsGroupTopInviter;\nstats.megagroupStats#ef7ff916 period:StatsDateRangeDays members:StatsAbsValueAndPrev messages:StatsAbsValueAndPrev viewers:StatsAbsValueAndPrev posters:StatsAbsValueAndPrev growth_graph:StatsGraph members_graph:StatsGraph new_members_by_source_graph:StatsGraph languages_graph:StatsGraph messages_graph:StatsGraph actions_graph:StatsGraph top_hours_graph:StatsGraph weekdays_graph:StatsGraph top_posters:Vector top_admins:Vector top_inviters:Vector users:Vector = stats.MegagroupStats;\nglobalPrivacySettings#bea2f424 flags:# archive_and_mute_new_noncontact_peers:flags.0?Bool = GlobalPrivacySettings;\nhelp.countryCode#4203c5ef flags:# country_code:string prefixes:flags.0?Vector patterns:flags.1?Vector = help.CountryCode;\nhelp.country#c3878e23 flags:# hidden:flags.0?true iso2:string default_name:string name:flags.1?string country_codes:Vector = help.Country;\nhelp.countriesListNotModified#93cc1f32 = help.CountriesList;\nhelp.countriesList#87d0759e countries:Vector hash:int = help.CountriesList;\nmessageViews#455b853d flags:# views:flags.0?int forwards:flags.1?int replies:flags.2?MessageReplies = MessageViews;\nmessages.messageViews#b6c4f543 views:Vector chats:Vector users:Vector = messages.MessageViews;\nmessages.discussionMessage#f5dd8f9d flags:# messages:Vector max_id:flags.0?int read_inbox_max_id:flags.1?int read_outbox_max_id:flags.2?int chats:Vector users:Vector = messages.DiscussionMessage;\nmessageReplyHeader#a6d57763 flags:# reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader;\nmessageReplies#4128faac flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector channel_id:flags.0?int max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;\npeerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked;\nstats.messageStats#8999f295 views_graph:StatsGraph = stats.MessageStats;\ngroupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall;\ngroupCall#d597650c flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int = GroupCall;\ninputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;\ngroupCallParticipant#eba636fe flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo = GroupCallParticipant;\nphone.groupCall#9e727aad call:GroupCall participants:Vector participants_next_offset:string chats:Vector users:Vector = phone.GroupCall;\nphone.groupParticipants#f47751b6 count:int participants:Vector next_offset:string chats:Vector users:Vector version:int = phone.GroupParticipants;\ninlineQueryPeerTypeSameBotPM#3081ed9d = InlineQueryPeerType;\ninlineQueryPeerTypePM#833c0fac = InlineQueryPeerType;\ninlineQueryPeerTypeChat#d766c50a = InlineQueryPeerType;\ninlineQueryPeerTypeMegagroup#5ec4be43 = InlineQueryPeerType;\ninlineQueryPeerTypeBroadcast#6334ee9a = InlineQueryPeerType;\nmessages.historyImport#1662af0b id:long = messages.HistoryImport;\nmessages.historyImportParsed#5e0fb7b9 flags:# pm:flags.0?true group:flags.1?true title:flags.2?string = messages.HistoryImportParsed;\nmessages.affectedFoundMessages#ef8d3e6c pts:int pts_count:int offset:int messages:Vector = messages.AffectedFoundMessages;\nchatInviteImporter#1e3e6680 user_id:int date:int = ChatInviteImporter;\nmessages.exportedChatInvites#bdc62dcc count:int invites:Vector users:Vector = messages.ExportedChatInvites;\nmessages.exportedChatInvite#1871be50 invite:ExportedChatInvite users:Vector = messages.ExportedChatInvite;\nmessages.exportedChatInviteReplaced#222600ef invite:ExportedChatInvite new_invite:ExportedChatInvite users:Vector = messages.ExportedChatInvite;\nmessages.chatInviteImporters#81b6b00a count:int importers:Vector users:Vector = messages.ChatInviteImporters;\nchatAdminWithInvites#dfd2330f admin_id:int invites_count:int revoked_invites_count:int = ChatAdminWithInvites;\nmessages.chatAdminsWithInvites#b69b72d7 admins:Vector users:Vector = messages.ChatAdminsWithInvites;\nmessages.checkedHistoryImportPeer#a24de717 confirm_text:string = messages.CheckedHistoryImportPeer;\nphone.joinAsPeers#afe5623f peers:Vector chats:Vector users:Vector = phone.JoinAsPeers;\nphone.exportedGroupCallInvite#204bd158 link:string = phone.ExportedGroupCallInvite;\ngroupCallParticipantVideoSourceGroup#dcb118b7 semantics:string sources:Vector = GroupCallParticipantVideoSourceGroup;\ngroupCallParticipantVideo#67753ac8 flags:# paused:flags.0?true endpoint:string source_groups:Vector audio_source:flags.1?int = GroupCallParticipantVideo;\nstickers.suggestedShortName#85fea03f short_name:string = stickers.SuggestedShortName;\nbotCommandScopeDefault#2f6cb2ab = BotCommandScope;\nbotCommandScopeUsers#3c4f04d8 = BotCommandScope;\nbotCommandScopeChats#6fe1a881 = BotCommandScope;\nbotCommandScopeChatAdmins#b9aa606a = BotCommandScope;\nbotCommandScopePeer#db9d897d peer:InputPeer = BotCommandScope;\nbotCommandScopePeerAdmins#3fd863d1 peer:InputPeer = BotCommandScope;\nbotCommandScopePeerUser#a1321f3 peer:InputPeer user_id:InputUser = BotCommandScope;\naccount.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordResult;\naccount.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult;\naccount.resetPasswordOk#e926d63e = account.ResetPasswordResult;\n---functions---\ninitConnection#c1cd5ea9 {X:Type} flags:# api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string proxy:flags.0?InputClientProxy params:flags.1?JSONValue query:!X = X;\ninvokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;\nauth.sendCode#a677244f phone_number:string api_id:int api_hash:string settings:CodeSettings = auth.SentCode;\nauth.signUp#80eee427 phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization;\nauth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;\nauth.logOut#5717da40 = Bool;\nauth.resetAuthorizations#9fab0d1a = Bool;\nauth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;\nauth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;\nauth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;\nauth.checkPassword#d18b4d16 password:InputCheckPasswordSRP = auth.Authorization;\nauth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery;\nauth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode;\nauth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool;\nauth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector = Bool;\nauth.exportLoginToken#b1b41517 api_id:int api_hash:string except_ids:Vector = auth.LoginToken;\nauth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken;\naccount.registerDevice#68976c6f flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector = Bool;\naccount.unregisterDevice#3076c4bf token_type:int token:string other_uids:Vector = Bool;\naccount.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;\naccount.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;\naccount.updateProfile#78515775 flags:# first_name:flags.0?string last_name:flags.1?string about:flags.2?string = User;\naccount.updateStatus#6628562c offline:Bool = Bool;\naccount.getWallPapers#aabb1763 hash:int = account.WallPapers;\naccount.checkUsername#2714d86c username:string = Bool;\naccount.updateUsername#3e0bdd7c username:string = User;\naccount.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;\naccount.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector = account.PrivacyRules;\naccount.getAuthorizations#e320c158 = account.Authorizations;\naccount.resetAuthorization#df77f3bc hash:long = Bool;\naccount.getPassword#548a30f5 = account.Password;\naccount.getPasswordSettings#9cd4eaf9 password:InputCheckPasswordSRP = account.PasswordSettings;\naccount.updatePasswordSettings#a59b102f password:InputCheckPasswordSRP new_settings:account.PasswordInputSettings = Bool;\naccount.sendConfirmPhoneCode#1b3faa88 hash:string settings:CodeSettings = auth.SentCode;\naccount.confirmPhone#5f2178c3 phone_code_hash:string phone_code:string = Bool;\naccount.getTmpPassword#449e0b51 password:InputCheckPasswordSRP period:int = account.TmpPassword;\naccount.sendVerifyPhoneCode#a5a356f9 phone_number:string settings:CodeSettings = auth.SentCode;\naccount.confirmPasswordEmail#8fdf1920 code:string = Bool;\naccount.getContactSignUpNotification#9f07c728 = Bool;\naccount.setContactSignUpNotification#cff43f61 silent:Bool = Bool;\naccount.getNotifyExceptions#53577479 flags:# compare_sound:flags.1?true peer:flags.0?InputNotifyPeer = Updates;\naccount.uploadWallPaper#dd853661 file:InputFile mime_type:string settings:WallPaperSettings = WallPaper;\naccount.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool;\naccount.getContentSettings#8b9b4dae = account.ContentSettings;\nusers.getUsers#d91a548 id:Vector = Vector;\nusers.getFullUser#ca30a5b1 id:InputUser = UserFull;\ncontacts.getContacts#c023849f hash:int = contacts.Contacts;\ncontacts.importContacts#2c800be5 contacts:Vector = contacts.ImportedContacts;\ncontacts.deleteContacts#96a0e00 id:Vector = Updates;\ncontacts.block#68cc1411 id:InputPeer = Bool;\ncontacts.unblock#bea65d50 id:InputPeer = Bool;\ncontacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;\ncontacts.search#11f812d8 q:string limit:int = contacts.Found;\ncontacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;\ncontacts.getTopPeers#d4982db5 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:int = contacts.TopPeers;\nmessages.getMessages#63c66506 id:Vector = messages.Messages;\nmessages.getDialogs#a0ee3b73 flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:int = messages.Dialogs;\nmessages.getHistory#dcbb8260 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;\nmessages.search#c352eec flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;\nmessages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages;\nmessages.deleteHistory#1c015b09 flags:# just_clear:flags.0?true revoke:flags.1?true peer:InputPeer max_id:int = messages.AffectedHistory;\nmessages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector = messages.AffectedMessages;\nmessages.receivedMessages#5a954c0 max_id:int = Vector;\nmessages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool;\nmessages.sendMessage#520c3870 flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int = Updates;\nmessages.sendMedia#3491eba9 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int = Updates;\nmessages.forwardMessages#d9fee60e flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true from_peer:InputPeer id:Vector random_id:Vector to_peer:InputPeer schedule_date:flags.10?int = Updates;\nmessages.report#8953ab4e peer:InputPeer id:Vector reason:ReportReason message:string = Bool;\nmessages.getChats#3c6aa187 id:Vector = messages.Chats;\nmessages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;\nmessages.editChatTitle#dc452855 chat_id:int title:string = Updates;\nmessages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates;\nmessages.addChatUser#f9a0aa09 chat_id:int user_id:InputUser fwd_limit:int = Updates;\nmessages.deleteChatUser#c534459a flags:# revoke_history:flags.0?true chat_id:int user_id:InputUser = Updates;\nmessages.createChat#9cb126e users:Vector title:string = Updates;\nmessages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;\nmessages.readMessageContents#36a73f77 id:Vector = messages.AffectedMessages;\nmessages.getStickers#43d4f2c emoticon:string hash:int = messages.Stickers;\nmessages.getAllStickers#1c9618b1 hash:int = messages.AllStickers;\nmessages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector = MessageMedia;\nmessages.exportChatInvite#14b9bcd7 flags:# legacy_revoke_permanent:flags.2?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int = ExportedChatInvite;\nmessages.checkChatInvite#3eadb1bb hash:string = ChatInvite;\nmessages.importChatInvite#6c50051c hash:string = Updates;\nmessages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;\nmessages.installStickerSet#c78fe460 stickerset:InputStickerSet archived:Bool = messages.StickerSetInstallResult;\nmessages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;\nmessages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_param:string = Updates;\nmessages.migrateChat#15a3b8e3 chat_id:int = Updates;\nmessages.searchGlobal#4bc6589a flags:# folder_id:flags.0?int q:string filter:MessagesFilter min_date:int max_date:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;\nmessages.getDocumentByHash#338e2464 sha256:bytes size:int mime_type:string = Document;\nmessages.getSavedGifs#83bf3d52 hash:int = messages.SavedGifs;\nmessages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults;\nmessages.sendInlineBotResult#220815b0 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string schedule_date:flags.10?int = Updates;\nmessages.editMessage#48f71778 flags:# no_webpage:flags.1?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.15?int = Updates;\nmessages.getBotCallbackAnswer#9342ca07 flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes password:flags.2?InputCheckPasswordSRP = messages.BotCallbackAnswer;\nmessages.getPeerDialogs#e470bcfd peers:Vector = messages.PeerDialogs;\nmessages.saveDraft#bc39e14b flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int peer:InputPeer message:string entities:flags.3?Vector = Bool;\nmessages.getFeaturedStickers#2dacca4f hash:int = messages.FeaturedStickers;\nmessages.readFeaturedStickers#5b118126 id:Vector = Bool;\nmessages.getRecentStickers#5ea192c9 flags:# attached:flags.0?true hash:int = messages.RecentStickers;\nmessages.getWebPage#32ca8f91 url:string hash:int = WebPage;\nmessages.toggleDialogPin#a731e257 flags:# pinned:flags.0?true peer:InputDialogPeer = Bool;\nmessages.getPinnedDialogs#d6b94df2 folder_id:int = messages.PeerDialogs;\nmessages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia;\nmessages.getFavedStickers#21ce0b0e hash:int = messages.FavedStickers;\nmessages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool;\nmessages.sendMultiMedia#cc0110cb flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector schedule_date:flags.10?int = Updates;\nmessages.searchStickerSets#c2b7d08b flags:# exclude_featured:flags.0?true q:string hash:int = messages.FoundStickerSets;\nmessages.markDialogUnread#c286d98f flags:# unread:flags.0?true peer:InputDialogPeer = Bool;\nmessages.updatePinnedMessage#d2aaf7ec flags:# silent:flags.0?true unpin:flags.1?true pm_oneside:flags.2?true peer:InputPeer id:int = Updates;\nmessages.sendVote#10ea6184 peer:InputPeer msg_id:int options:Vector = Updates;\nmessages.getOnlines#6e2be050 peer:InputPeer = ChatOnlines;\nmessages.editChatAbout#def60797 peer:InputPeer about:string = Bool;\nmessages.editChatDefaultBannedRights#a5866b41 peer:InputPeer banned_rights:ChatBannedRights = Updates;\nmessages.getEmojiKeywordsDifference#1508b6af lang_code:string from_version:int = EmojiKeywordsDifference;\nmessages.getScheduledHistory#e2c2685b peer:InputPeer hash:int = messages.Messages;\nmessages.sendScheduledMessages#bd38850a peer:InputPeer id:Vector = Updates;\nmessages.deleteScheduledMessages#59ae2b16 peer:InputPeer id:Vector = Updates;\nmessages.getPollVotes#b86e380e flags:# peer:InputPeer id:int option:flags.0?bytes offset:flags.1?string limit:int = messages.VotesList;\nmessages.getDialogFilters#f19ed96d = Vector;\nmessages.getSuggestedDialogFilters#a29cd42c = Vector;\nmessages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter = Bool;\nmessages.getReplies#24b581ba peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;\nmessages.getDiscussionMessage#446972fd peer:InputPeer msg_id:int = messages.DiscussionMessage;\nmessages.readDiscussion#f731a9f4 peer:InputPeer msg_id:int read_max_id:int = Bool;\nmessages.unpinAllMessages#f025bc8b peer:InputPeer = messages.AffectedHistory;\nmessages.deleteChat#83247d11 chat_id:int = Bool;\nupdates.getState#edd4882a = updates.State;\nupdates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;\nupdates.getChannelDifference#3173d78 flags:# force:flags.0?true channel:InputChannel filter:ChannelMessagesFilter pts:int limit:int = updates.ChannelDifference;\nphotos.uploadProfilePhoto#89f30f69 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = photos.Photo;\nphotos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int = photos.Photos;\nupload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;\nupload.getFile#b15a9afc flags:# precise:flags.0?true cdn_supported:flags.1?true location:InputFileLocation offset:int limit:int = upload.File;\nupload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;\nupload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile;\nhelp.getConfig#c4f9186b = Config;\nhelp.getNearestDc#1fb33026 = NearestDc;\nhelp.getSupport#9cdf08cd = help.Support;\nhelp.acceptTermsOfService#ee72f79a id:DataJSON = Bool;\nchannels.readHistory#cc104937 channel:InputChannel max_id:int = Bool;\nchannels.deleteMessages#84c1fd4e channel:InputChannel id:Vector = messages.AffectedMessages;\nchannels.getMessages#ad8c9a23 channel:InputChannel id:Vector = messages.Messages;\nchannels.getParticipants#123e05e9 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:int = channels.ChannelParticipants;\nchannels.getParticipant#a0ab6cc6 channel:InputChannel participant:InputPeer = channels.ChannelParticipant;\nchannels.getChannels#a7f6bbb id:Vector = messages.Chats;\nchannels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull;\nchannels.createChannel#3d5fb10f flags:# broadcast:flags.0?true megagroup:flags.1?true for_import:flags.3?true title:string about:string geo_point:flags.2?InputGeoPoint address:flags.2?string = Updates;\nchannels.editAdmin#d33c8902 channel:InputChannel user_id:InputUser admin_rights:ChatAdminRights rank:string = Updates;\nchannels.editTitle#566decd0 channel:InputChannel title:string = Updates;\nchannels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates;\nchannels.checkUsername#10e6bd2c channel:InputChannel username:string = Bool;\nchannels.updateUsername#3514b3de channel:InputChannel username:string = Bool;\nchannels.joinChannel#24b524c5 channel:InputChannel = Updates;\nchannels.leaveChannel#f836aa95 channel:InputChannel = Updates;\nchannels.inviteToChannel#199f3a6c channel:InputChannel users:Vector = Updates;\nchannels.deleteChannel#c0111fe3 channel:InputChannel = Updates;\nchannels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates;\nchannels.editBanned#96e6cd81 channel:InputChannel participant:InputPeer banned_rights:ChatBannedRights = Updates;\nchannels.readMessageContents#eab5dc38 channel:InputChannel id:Vector = Bool;\nchannels.togglePreHistoryHidden#eabbb94c channel:InputChannel enabled:Bool = Updates;\nchannels.getGroupsForDiscussion#f5dad378 = messages.Chats;\nchannels.setDiscussionGroup#40582bb2 broadcast:InputChannel group:InputChannel = Bool;\npayments.getPaymentForm#8a333c8d flags:# peer:InputPeer msg_id:int theme_params:flags.0?DataJSON = payments.PaymentForm;\npayments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt;\npayments.validateRequestedInfo#db103170 flags:# save:flags.0?true peer:InputPeer msg_id:int info:PaymentRequestedInfo = payments.ValidatedRequestedInfo;\npayments.sendPaymentForm#30c3bc9d flags:# form_id:long peer:InputPeer msg_id:int requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials tip_amount:flags.2?long = payments.PaymentResult;\npayments.getSavedInfo#227d824b = payments.SavedInfo;\nlangpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference;\nlangpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector = Vector;\nlangpack.getLanguages#42c6978f lang_pack:string = Vector;\nfolders.editPeerFolders#6847d0ab folder_peers:Vector = Updates;\n`;","const { inflate } = require('pako/dist/pako_inflate');\nconst { serializeBytes } = require('../index');\n\n// CONTEST const { deflate } = require('pako/dist/pako_deflate')\n\nclass GZIPPacked {\n static CONSTRUCTOR_ID = 0x3072cfa1;\n\n static classType = 'constructor';\n\n constructor(data) {\n this.data = data;\n this.CONSTRUCTOR_ID = 0x3072cfa1;\n this.classType = 'constructor';\n }\n\n static async gzipIfSmaller(contentRelated, data) {\n if (contentRelated && data.length > 512) {\n const gzipped = await (new GZIPPacked(data)).toBytes();\n if (gzipped.length < data.length) {\n return gzipped;\n }\n }\n return data;\n }\n\n static gzip(input) {\n return Buffer.from(input);\n // TODO this usually makes it faster for large requests\n // return Buffer.from(deflate(input, { level: 9, gzip: true }))\n }\n\n static ungzip(input) {\n return Buffer.from(inflate(input));\n }\n\n static read(reader) {\n const constructor = reader.readInt(false);\n if (constructor !== GZIPPacked.CONSTRUCTOR_ID) {\n throw new Error('not equal');\n }\n return GZIPPacked.gzip(reader.tgReadBytes());\n }\n\n static async fromReader(reader) {\n return new GZIPPacked(await GZIPPacked.ungzip(reader.tgReadBytes()));\n }\n\n async toBytes() {\n const g = Buffer.alloc(4);\n g.writeUInt32LE(GZIPPacked.CONSTRUCTOR_ID, 0);\n return Buffer.concat([\n g,\n serializeBytes(await GZIPPacked.gzip(this.data)),\n ]);\n }\n}\n\nmodule.exports = GZIPPacked;\n","const TLMessage = require('./TLMessage');\n\nclass MessageContainer {\n static CONSTRUCTOR_ID = 0x73f1f8dc;\n\n static classType = 'constructor';\n\n // Maximum size in bytes for the inner payload of the container.\n // Telegram will close the connection if the payload is bigger.\n // The overhead of the container itself is subtracted.\n static MAXIMUM_SIZE = 1044456 - 8;\n\n // Maximum amount of messages that can't be sent inside a single\n // container, inclusive. Beyond this limit Telegram will respond\n // with BAD_MESSAGE 64 (invalid container).\n //\n // This limit is not 100% accurate and may in some cases be higher.\n // However, sending up to 100 requests at once in a single container\n // is a reasonable conservative value, since it could also depend on\n // other factors like size per request, but we cannot know this.\n static MAXIMUM_LENGTH = 100;\n\n constructor(messages) {\n this.CONSTRUCTOR_ID = 0x73f1f8dc;\n this.messages = messages;\n this.classType = 'constructor';\n }\n\n static fromReader(reader) {\n const messages = [];\n const length = reader.readInt();\n for (let x = 0; x < length; x++) {\n const msgId = reader.readLong();\n const seqNo = reader.readInt();\n const containerLength = reader.readInt();\n const before = reader.tellPosition();\n const obj = reader.tgReadObject();\n reader.setPosition(before + containerLength);\n const tlMessage = new TLMessage(msgId, seqNo, obj);\n messages.push(tlMessage);\n }\n return new MessageContainer(messages);\n }\n}\n\nmodule.exports = MessageContainer;\n","const { RpcError } = require('../index').constructors;\nconst GZIPPacked = require('./GZIPPacked');\n\nclass RPCResult {\n static CONSTRUCTOR_ID = 0xf35c6d01;\n\n static classType = 'constructor';\n\n constructor(reqMsgId, body, error) {\n this.CONSTRUCTOR_ID = 0xf35c6d01;\n this.reqMsgId = reqMsgId;\n this.body = body;\n this.error = error;\n this.classType = 'constructor';\n }\n\n static async fromReader(reader) {\n const msgId = reader.readLong();\n const innerCode = reader.readInt(false);\n if (innerCode === RpcError.CONSTRUCTOR_ID) {\n return new RPCResult(msgId, undefined, RpcError.fromReader(reader));\n }\n if (innerCode === GZIPPacked.CONSTRUCTOR_ID) {\n return new RPCResult(msgId, (await GZIPPacked.fromReader(reader)).data);\n }\n reader.seek(-4);\n // This reader.read() will read more than necessary, but it's okay.\n // We could make use of MessageContainer's length here, but since\n // it's not necessary we don't need to care about it.\n return new RPCResult(msgId, reader.read(), undefined);\n }\n}\n\nmodule.exports = RPCResult;\n","class TLMessage {\n static SIZE_OVERHEAD = 12;\n\n static classType = 'constructor';\n\n constructor(msgId, seqNo, obj) {\n this.msgId = msgId;\n this.seqNo = seqNo;\n this.obj = obj;\n this.classType = 'constructor';\n }\n}\n\nmodule.exports = TLMessage;\n","const TLMessage = require('./TLMessage');\nconst RPCResult = require('./RPCResult');\nconst MessageContainer = require('./MessageContainer');\nconst GZIPPacked = require('./GZIPPacked');\n\nconst coreObjects = {\n [RPCResult.CONSTRUCTOR_ID]: RPCResult,\n [GZIPPacked.CONSTRUCTOR_ID]: GZIPPacked,\n [MessageContainer.CONSTRUCTOR_ID]: MessageContainer,\n};\n\nmodule.exports = {\n TLMessage,\n RPCResult,\n MessageContainer,\n GZIPPacked,\n coreObjects,\n};\n","const snakeToCamelCase = (name) => {\n const result = name.replace(/(?:^|_)([a-z])/g, (_, g) => g.toUpperCase());\n return result.replace(/_/g, '');\n};\nconst variableSnakeToCamelCase = (str) => str.replace(\n /([-_][a-z])/g,\n (group) => group.toUpperCase()\n .replace('-', '')\n .replace('_', ''),\n);\n\nconst CORE_TYPES = new Set([\n 0xbc799737, // boolFalse#bc799737 = Bool;\n 0x997275b5, // boolTrue#997275b5 = Bool;\n 0x3fedd339, // true#3fedd339 = True;\n 0xc4b9f9bb, // error#c4b9f9bb code:int text:string = Error;\n 0x56730bcc, // null#56730bcc = Null;\n]);\nconst AUTH_KEY_TYPES = new Set([\n 0x05162463, // resPQ,\n 0x83c95aec, // p_q_inner_data\n 0xa9f55f95, // p_q_inner_data_dc\n 0x3c6a84d4, // p_q_inner_data_temp\n 0x56fddf88, // p_q_inner_data_temp_dc\n 0xd0e8075c, // server_DH_params_ok\n 0xb5890dba, // server_DH_inner_data\n 0x6643b654, // client_DH_inner_data\n 0xd712e4be, // req_DH_params\n 0xf5045f1f, // set_client_DH_params\n 0x3072cfa1, // gzip_packed\n]);\n\n// This is copy-pasted from `gramjs/Helpers.js` to not depend on TypeScript modules\nfunction makeCRCTable() {\n let c;\n const crcTable = [];\n for (let n = 0; n < 256; n++) {\n c = n;\n for (let k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n crcTable[n] = c;\n }\n return crcTable;\n}\n\nlet crcTable;\n\nfunction crc32(buf) {\n if (!crcTable) {\n crcTable = makeCRCTable();\n }\n if (!Buffer.isBuffer(buf)) {\n buf = Buffer.from(buf);\n }\n let crc = -1;\n\n for (let index = 0; index < buf.length; index++) {\n const byte = buf[index];\n crc = crcTable[(crc ^ byte) & 0xff] ^ (crc >>> 8);\n }\n return (crc ^ (-1)) >>> 0;\n}\n\nconst findAll = (regex, str, matches = []) => {\n if (!regex.flags.includes('g')) {\n regex = new RegExp(regex.source, 'g');\n }\n\n const res = regex.exec(str);\n\n if (res) {\n matches.push(res.slice(1));\n findAll(regex, str, matches);\n }\n\n return matches;\n};\n\nconst fromLine = (line, isFunction) => {\n const match = line.match(/([\\w.]+)(?:#([0-9a-fA-F]+))?(?:\\s{?\\w+:[\\w\\d<>#.?!]+}?)*\\s=\\s([\\w\\d<>#.?]+);$/);\n if (!match) {\n // Probably \"vector#1cb5c415 {t:Type} # [ t ] = Vector t;\"\n throw new Error(`Cannot parse TLObject ${line}`);\n }\n\n const argsMatch = findAll(/({)?(\\w+):([\\w\\d<>#.?!]+)}?/, line);\n const currentConfig = {\n name: match[1],\n constructorId: parseInt(match[2], 16),\n argsConfig: {},\n subclassOfId: crc32(match[3]),\n result: match[3],\n isFunction,\n namespace: undefined,\n };\n if (!currentConfig.constructorId) {\n const hexId = '';\n let args;\n\n if (Object.values(currentConfig.argsConfig).length) {\n args = ` ${Object.keys(currentConfig.argsConfig)\n .map((arg) => arg.toString())\n .join(' ')}`;\n } else {\n args = '';\n }\n\n const representation = `${currentConfig.name}${hexId}${args} = ${currentConfig.result}`\n .replace(/(:|\\?)bytes /g, '$1string ')\n .replace(/|{|}/g, '')\n .replace(/ \\w+:flags\\.\\d+\\?true/g, '');\n\n if (currentConfig.name === 'inputMediaInvoice') {\n // eslint-disable-next-line no-empty\n if (currentConfig.name === 'inputMediaInvoice') {\n }\n }\n\n currentConfig.constructorId = crc32(Buffer.from(representation, 'utf8'));\n }\n for (const [brace, name, argType] of argsMatch) {\n if (brace === undefined) {\n currentConfig.argsConfig[variableSnakeToCamelCase(name)] = buildArgConfig(name, argType);\n }\n }\n if (currentConfig.name.includes('.')) {\n [currentConfig.namespace, currentConfig.name] = currentConfig.name.split(/\\.(.+)/);\n }\n currentConfig.name = snakeToCamelCase(currentConfig.name);\n /*\n for (const arg in currentConfig.argsConfig){\n if (currentConfig.argsConfig.hasOwnProperty(arg)){\n if (currentConfig.argsConfig[arg].flagIndicator){\n delete currentConfig.argsConfig[arg]\n }\n }\n } */\n return currentConfig;\n};\n\nfunction buildArgConfig(name, argType) {\n name = name === 'self' ? 'is_self' : name;\n // Default values\n const currentConfig = {\n isVector: false,\n isFlag: false,\n skipConstructorId: false,\n flagIndex: -1,\n flagIndicator: true,\n type: undefined,\n useVectorId: undefined,\n };\n\n // The type can be an indicator that other arguments will be flags\n if (argType !== '#') {\n currentConfig.flagIndicator = false;\n // Strip the exclamation mark always to have only the name\n currentConfig.type = argType.replace(/^!+/, '');\n\n // The type may be a flag (flags.IDX?REAL_TYPE)\n // Note that 'flags' is NOT the flags name; this\n // is determined by a previous argument\n // However, we assume that the argument will always be called 'flags'\n // @ts-ignore\n const flagMatch = currentConfig.type.match(/flags.(\\d+)\\?([\\w<>.]+)/);\n\n if (flagMatch) {\n currentConfig.isFlag = true;\n currentConfig.flagIndex = Number(flagMatch[1]);\n // Update the type to match the exact type, not the \"flagged\" one\n [, , currentConfig.type] = flagMatch;\n }\n\n // Then check if the type is a Vector\n // @ts-ignore\n const vectorMatch = currentConfig.type.match(/[Vv]ector<([\\w\\d.]+)>/);\n\n if (vectorMatch) {\n currentConfig.isVector = true;\n\n // If the type's first letter is not uppercase, then\n // it is a constructor and we use (read/write) its ID.\n // @ts-ignore\n currentConfig.useVectorId = currentConfig.type.charAt(0) === 'V';\n\n // Update the type to match the one inside the vector\n [, currentConfig.type] = vectorMatch;\n }\n\n // See use_vector_id. An example of such case is ipPort in\n // help.configSpecial\n // @ts-ignore\n if (/^[a-z]$/.test(currentConfig.type.split('.')\n .pop()\n .charAt(0))\n ) {\n currentConfig.skipConstructorId = true;\n }\n\n // The name may contain \"date\" in it, if this is the case and\n // the type is \"int\", we can safely assume that this should be\n // treated as a \"date\" object. Note that this is not a valid\n // Telegram object, but it's easier to work with\n // if (\n // this.type === 'int' &&\n // (/(\\b|_)([dr]ate|until|since)(\\b|_)/.test(name) ||\n // ['expires', 'expires_at', 'was_online'].includes(name))\n // ) {\n // this.type = 'date';\n // }\n }\n return currentConfig;\n}\n\n\nfunction* parseTl(content, layer, methods = [], ignoreIds = CORE_TYPES) {\n (methods || []).reduce((o, m) => ({\n ...o,\n [m.name]: m,\n }), {});\n const objAll = [];\n const objByName = {};\n const objByType = {};\n\n const file = content;\n\n let isFunction = false;\n\n for (let line of file.split('\\n')) {\n const commentIndex = line.indexOf('//');\n\n if (commentIndex !== -1) {\n line = line.slice(0, commentIndex);\n }\n\n line = line.trim();\n\n if (!line) {\n continue;\n }\n\n const match = line.match(/---(\\w+)---/);\n\n if (match) {\n const [, followingTypes] = match;\n isFunction = followingTypes === 'functions';\n continue;\n }\n\n try {\n const result = fromLine(line, isFunction);\n\n if (ignoreIds.has(result.constructorId)) {\n continue;\n }\n\n objAll.push(result);\n\n if (!result.isFunction) {\n if (!objByType[result.result]) {\n objByType[result.result] = [];\n }\n\n objByName[result.name] = result;\n objByType[result.result].push(result);\n }\n } catch (e) {\n if (!e.toString()\n .includes('vector#1cb5c415')) {\n throw e;\n }\n }\n }\n\n // Once all objects have been parsed, replace the\n // string type from the arguments with references\n for (const obj of objAll) {\n // console.log(obj)\n if (AUTH_KEY_TYPES.has(obj.constructorId)) {\n for (const arg in obj.argsConfig) {\n if (obj.argsConfig[arg].type === 'string') {\n obj.argsConfig[arg].type = 'bytes';\n }\n }\n }\n }\n\n for (const obj of objAll) {\n yield obj;\n }\n}\n\nfunction serializeBytes(data) {\n if (!(data instanceof Buffer)) {\n if (typeof data === 'string') {\n data = Buffer.from(data);\n } else {\n throw Error(`Bytes or str expected, not ${data.constructor.name}`);\n }\n }\n const r = [];\n let padding;\n if (data.length < 254) {\n padding = (data.length + 1) % 4;\n if (padding !== 0) {\n padding = 4 - padding;\n }\n r.push(Buffer.from([data.length]));\n r.push(data);\n } else {\n padding = data.length % 4;\n if (padding !== 0) {\n padding = 4 - padding;\n }\n r.push(Buffer.from([254, data.length % 256, (data.length >> 8) % 256, (data.length >> 16) % 256]));\n r.push(data);\n }\n r.push(Buffer.alloc(padding)\n .fill(0));\n\n return Buffer.concat(r);\n}\n\nfunction serializeDate(dt) {\n if (!dt) {\n return Buffer.alloc(4)\n .fill(0);\n }\n if (dt instanceof Date) {\n dt = Math.floor((Date.now() - dt.getTime()) / 1000);\n }\n if (typeof dt === 'number') {\n const t = Buffer.alloc(4);\n t.writeInt32LE(dt, 0);\n return t;\n }\n throw Error(`Cannot interpret \"${dt}\" as a date`);\n}\n\nmodule.exports = {\n findAll,\n parseTl,\n buildArgConfig,\n fromLine,\n CORE_TYPES,\n serializeDate,\n serializeBytes,\n snakeToCamelCase,\n variableSnakeToCamelCase,\n};\n","const api = require('./api');\nconst {\n serializeBytes,\n serializeDate,\n} = require('./generationHelpers');\n\nmodule.exports = {\n // TODO Refactor internal usages to always use `api`.\n constructors: api,\n requests: api,\n serializeBytes,\n serializeDate,\n};\n","module.exports = `resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector = ResPQ;\np_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data;\nserver_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params;\nserver_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;\nserver_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;\nclient_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;\ndh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;\ndh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer;\ndh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;\ndestroy_auth_key_ok#f660e1d4 = DestroyAuthKeyRes;\ndestroy_auth_key_none#0a9f2259 = DestroyAuthKeyRes;\ndestroy_auth_key_fail#ea109b13 = DestroyAuthKeyRes;\n---functions---\nreq_pq#60469778 nonce:int128 = ResPQ;\nreq_pq_multi#be7e8ef1 nonce:int128 = ResPQ;\nreq_pq_multi_new#51b410fd nonce:int128 = ResPQ;\nreq_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;\nset_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;\ndestroy_auth_key#d1435160 = DestroyAuthKeyRes;\n---types---\nmsgs_ack#62d6b459 msg_ids:Vector = MsgsAck;\nbad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int error_code:int = BadMsgNotification;\nbad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_server_salt:long = BadMsgNotification;\nmsgs_state_req#da69fb52 msg_ids:Vector = MsgsStateReq;\nmsgs_state_info#04deb57d req_msg_id:long info:string = MsgsStateInfo;\nmsgs_all_info#8cc0d131 msg_ids:Vector info:string = MsgsAllInfo;\nmsg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\nmsg_new_detailed_info#809db6df answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\nmsg_resend_req#7d861a08 msg_ids:Vector = MsgResendReq;\nrpc_error#2144ca19 error_code:int error_message:string = RpcError;\nfuture_salt#0949d9dc valid_since:int valid_until:int salt:long = FutureSalt;\nfuture_salts#ae500895 req_msg_id:long now:int salts:vector = FutureSalts;\npong#347773c5 msg_id:long ping_id:long = Pong;\ndestroy_session_ok#e22045fc session_id:long = DestroySessionRes;\ndestroy_session_none#62d350c9 session_id:long = DestroySessionRes;\nnew_session_created#9ec20908 first_msg_id:long unique_id:long server_salt:long = NewSession;\n---functions---\nping#7abe77ec ping_id:long = Pong;\nping_delay_disconnect#f3427b8c ping_id:long disconnect_delay:int = Pong;`;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [592], () => (__webpack_require__(6514)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".\" + \"d7ca037ed9b7d1c6792a\" + \".js\";\n};","// This function allow to reference all chunks\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t514: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = self[\"webpackChunktelegram_t\"] = self[\"webpackChunktelegram_t\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["deferred","next","API_UPDATE_THROTTLE","window","innerHeight","Math","round","API_THROTTLE_RESET_UPDATES","Set","buildCollectionByKey","collection","key","reduce","byKey","member","pick","object","keys","result","isPeerUser","peer","hasOwnProperty","isPeerChat","bytesToDataUri","bytes","shouldOmitPrefix","mimeType","btoa","String","fromCharCode","omitVirtualClassFields","instance","flags","CONSTRUCTOR_ID","SUBCLASS_OF_ID","className","classType","rest","getServerTime","serverTimeOffset","floor","Date","now","buildApiChatFieldsFromPeerEntity","peerEntity","isSupport","isMin","Boolean","min","accessHash","avatarHash","photo","buildAvatarHash","isSignaturesShown","signatures","hasPrivateLink","hasLink","GramJs","username","isVerified","verified","isCallActive","callActive","isCallNotEmpty","callNotEmpty","participantsCount","membersCount","joinDate","date","buildApiChatPermissions","isCreator","creator","buildApiChatRestrictions","buildApiChatMigrationInfo","buildApiChatFromDialog","dialog","folderId","unreadMark","unreadCount","unreadMentionsCount","notifySettings","silent","muteUntil","readOutboxMaxId","readInboxMaxId","draft","isMuted","id","getApiChatIdFromMtpPeer","type","getApiChatTypeFromPeerEntity","title","getApiChatTitleFromMtpPeer","lastReadOutboxMessageId","lastReadInboxMessageId","hasUnreadMark","draftDate","adminRights","currentUserBannedRights","bannedRights","undefined","defaultBannedRights","isRestricted","restrictions","restrictionReason","restricted","restrictionReasons","targetReason","find","platform","buildApiChatRestrictionReason","Object","assign","isNotJoined","left","kicked","migratedTo","chatId","toString","buildApiChatFromPreview","preview","withForbidden","getUserName","userId","channelId","getApiChatIdFromInputMtpPeer","isInputPeerUser","isInputPeerChat","isInputPeerChannel","megagroup","getPeerKey","user","firstName","lastName","photoId","buildChatMember","inviterId","joinedDate","kickedByUserId","kickedBy","promotedByUserId","promotedBy","customTitle","rank","isAdmin","isOwner","buildChatMembers","participants","map","filter","buildChatTypingStatus","update","action","fromId","timestamp","buildApiChatFolder","channels","broadcasts","pinnedChatIds","pinnedPeers","includedChatIds","includePeers","excludedChatIds","excludePeers","buildApiChatFolderFromSuggested","description","buildApiChatBotCommands","botInfos","botCommands","botInfo","concat","commands","mtpCommand","botId","pathBytesToSvg","width","height","replace","path","len","length","i","num","buildPath","DEFAULT_THUMB_SIZE","w","h","buildApiThumbnailFromStripped","sizes","thumb","s","realSizes","dataUri","strippedPhotoToJpg","buildApiPhoto","buildApiPhotoSize","thumbnail","photoSize","localMessages","chats","users","messages","documents","stickerSets","photos","webDocuments","ANIMATED_STICKER_MIME_TYPE","buildStickerFromDocument","document","stickerAttribute","attributes","attr","fileAttribute","sizeAttribute","stickerSetInfo","stickerset","emoji","alt","isAnimated","cachedThumb","thumbs","pathThumb","buildApiThumbnailFromCached","buildApiThumbnailFromPath","stickerSetId","stickerSetAccessHash","buildStickerSet","set","archived","animated","installedDate","count","hash","shortName","hasThumbnail","buildStickerSetCovered","coveredStickerSet","stickerSet","stickerSetCovers","covers","cover","forEach","coverSticker","push","localDb","interpolateArray","data","fitCount","peak","newData","Array","springFactor","leftFiller","rightFiller","idx","val","ApiMessageEntityTypes","ApiMediaFormat","getEntityTypeById","chatOrUserId","buildPeer","buildInputPeer","BigInt","buildInputPeerFromLocalDb","buildInputEntity","buildInputStickerSet","buildInputDocument","media","buildInputMediaDocument","inputDocument","generateRandomBigInt","readBigIntFromBuffer","generateRandomBytes","buildMessageFromUpdate","peerId","buildMtpMessageEntity","entity","offset","url","Bold","Italic","Underline","Strike","Code","Pre","language","Blockquote","TextUrl","Url","Hashtag","MentionName","calculateResultHash","ids","isMessageWithMedia","message","webpage","startsWith","buildInputContact","phone","clientId","buildChatBannedRights","untilDate","buildChatAdminRights","buildShippingInfo","info","shippingAddress","buildInputPrivacyKey","privacyKey","buildInputReportReason","reason","resolveMessageApiChatId","mtpMessage","addMessageToLocalDb","messageFullId","addPhotoToLocalDb","currentUserId","onUpdate","localMessageCounter","buildApiMessage","buildApiMessageWithChatId","isChatWithSelf","isOutgoing","out","post","fwdFrom","content","buildMessageMediaContent","sticker","poll","contact","text","buildMessageTextContent","entities","senderId","targetPeerId","isChannelPost","amount","currency","translationValues","targetUserIds","targetChatId","includes","withDuration","duration","video","join","mins","max","Number","totalAmount","domain","buildAction","replyToMsgId","replyToTopId","replyTo","isEdited","editDate","editHide","inlineButtons","keyboardButtons","keyboardPlaceholder","isKeyboardSingleUse","messageId","replyMarkup","value","markup","rows","buttons","button","receiptMsgId","placeholder","singleUse","buildReplyButtons","forwardInfo","savedFromPeerId","savedFromPeer","channelPost","channelPostId","isLinkedChannelPost","fromChatId","fromMessageId","savedFromMsgId","senderUserId","hiddenUserName","fromName","adminTitle","postAuthor","buildApiMessageForwardInfo","replies","mediaUnread","isMediaUnread","groupedId","isInAlbum","audio","shouldHideKeyboardButtons","views","isFromScheduled","fromScheduled","replyToMessageId","replyToTopMessageId","mentioned","hasUnreadMention","viaBotId","comments","threadInfo","buildThreadInfo","buildApiMessageEntity","buildMessageDraft","formattedText","replyingToId","buildSticker","ttlSeconds","buildPhoto","buildVideoFromDocument","buildVideo","audioAttribute","voice","fileName","getFilenameFromDocument","buildAudio","waveform","from","buildVoice","buildApiDocument","buildDocumentFromMedia","buildContact","buildPoll","results","buildPollFromMedia","webPage","buildWebPage","invoice","test","photoUrl","isTest","buildInvoice","buildInvoiceFromMedia","size","videoAttr","a","gifAttr","supportsStreaming","roundMessage","isRound","isGif","mediaType","mediaSize","imageAttribute","pollResults","answers","rawAnswers","answer","option","summary","isPublic","publicVoters","buildPollResults","rawResults","totalVoters","recentVoters","solution","solutionEntities","recentVoterIds","chosen","correct","voters","isChosen","isCorrect","votersCount","defaultBase","filenameAttribute","extension","split","buildNewPoll","localId","messageReplies","maxId","readMaxId","recentRepliers","threadId","originChannelId","messagesCount","lastMessageId","recentReplierIds","buildApiUserFromFull","mtpUserFull","about","commonChatsCount","pinnedMsgId","blocked","buildApiUser","fullInfo","bio","pinnedMessageId","isBlocked","botDescription","buildApiBotCommands","mtpUser","userType","bot","deleted","self","isSelf","mutualContact","isContact","canBeInvitedToGroup","botNochats","phoneNumber","status","buildApiUserStatus","botInlinePlaceholder","botPlaceholder","mtpStatus","expires","wasOnline","command","buildApiWallpaper","wallpaper","slug","buildApiSession","session","isCurrent","current","isOfficialApp","officialApp","isPasswordPending","passwordPending","buildPrivacyRules","rules","visibility","allowUserIds","allowChatIds","blockUserIds","blockChatIds","rule","buildApiNotifyException","showPreviews","sound","isSilent","shouldShowPreviews","sentMessageIds","updater","originRequest","connection","timeOffset","connectionState","state","buildApiMessageFromShort","notification","currentDate","inboxDate","buildApiMessageFromNotification","_entities","e","chat","has","dcId","buildChatPhotoForLocalDb","localDbChatId","abs","newProfilePhoto","some","existingIds","missingIds","profilePhotoIds","setTimeout","randomId","localMessage","Error","newContent","add","isAlreadySent","isScheduled","sendingState","messageUpdate","pollId","apiPoll","pollUpdate","options","stillUnreadCount","isPinned","pinned","order","dp","folderPeers","folderPeer","folder","orderedIds","replacedMembers","addedMember","deletedMemberId","messageIds","typingStatus","channel","unread","updatedUser","peerType","buildPrivacyKey","ApiErrors","PHONE_NUMBER_INVALID","PHONE_CODE_INVALID","PASSWORD_HASH_INVALID","PHONE_PASSWORD_FLOOD","authController","onRequestPhoneNumber","buildAuthStateUpdate","Promise","resolve","reject","onRequestCode","isCodeViaApp","onRequestPassword","hint","onRequestRegistration","onRequestQrCode","qrCode","token","onAuthError","err","errors","hours","ceil","seconds","authorizationState","provideAuthPhoneNumber","provideAuthCode","code","provideAuthPassword","password","provideAuthRegistration","registration","restartAuth","restartAuthWithQr","File","Blob","constructor","fileBits","super","this","name","cacheApi","caches","Type","async","fetch","cacheName","isHtmlAllowed","request","Request","cache","open","response","match","Text","blob","substr","contentType","headers","get","Json","json","console","warn","save","cacheData","JSON","stringify","Response","put","clear","delete","MEDIA_ENTITY_TYPES","getMimeType","fallbackMimeType","subarray","byte","GramJsLogger","gramJsUpdateEventBuilder","build","client","isConnected","destroy","invokeRequest","disconnect","onSessionUpdate","sessionData","handleGramJsUpdate","handleTerminatedSession","shouldHandleUpdates","shouldThrow","invoke","updatesContainer","updates","injectUpdateEntities","isSlowMode","error","hasErrorKey","dispatchErrorUpdate","downloadMedia","args","onProgress","mediaFormat","start","end","fullSize","mediaMatch","arrayBuffer","entityType","entityId","sizeType","Stream","acceptsBuffer","progressCallback","workers","getMessageMediaMimeType","downloadStickerSetThumb","Lottie","downloadProfilePhoto","download","parsed","DataUri","reader","FileReader","onload","target","onerror","readAsDataURL","BlobUrl","inflate","to","parse","Progressive","buffer","parseMedia","canCache","prepared","mediaData","URL","createObjectURL","downloadMediaWithClient","uploadFile","file","updateTwoFaSettings","params","fetchCurrentUser","userFull","currentUser","_currentUserId","onCurrentUserUpdate","MAX_INT_32","fetchChats","limit","offsetDate","withPinned","offsetPeer","excludePinned","resultPinned","updateLocalDb","lastMessagesByChatId","peersByKey","preparePeers","draftsById","replyingToById","dialogs","orderedPinnedIds","lastMessage","isListed","chatIds","totalChatCount","fetchFullChat","fullChat","onlineCount","exportedInvite","slowmodeSeconds","slowmodeNextSendDate","migratedFromChatId","migratedFromMaxId","canViewParticipants","linkedChatId","hiddenPrehistory","call","inviteLink","link","members","fetchMembers","kickedMembers","bannedUsers","adminMembers","adminUsers","slowMode","nextSendDate","migratedFrom","maxMessageId","canViewMembers","isPreHistoryHidden","groupCallId","getFullChannelInfo","getFullChatInfo","searchChats","query","q","localPeerIds","myResults","allChats","allUsers","localChats","r","localUsers","u","globalChats","globalUsers","fetchChat","requestChatUpdate","peers","saveDraft","clearDraft","updateChatMutedState","settings","createChannel","broadcast","newChannel","joinChannel","deleteChatUser","deleteChat","leaveChannel","deleteChannel","createGroupChat","newChat","editChatPhoto","uploadedPhoto","inputEntity","toggleChatPinned","shouldBePinned","toggleChatArchived","fetchChatFolders","byId","fetchRecommendedChatFolders","editChatFolder","folderUpdate","emoticon","contacts","nonContacts","groups","bots","excludeArchived","excludeMuted","excludeRead","buildFilterFromApiFolder","deleteChatFolder","isActionSuccessful","recommendedChatFolders","folders","toggleDialogUnread","getChatByUsername","togglePreHistoryHidden","isEnabled","enabled","updateChatDefaultBannedRights","updateChatMemberBannedRights","participant","updateChatAdmin","updateChatTitle","updateChatAbout","toggleSignatures","memberFilter","fetchGroupsForDiscussion","setDiscussionGroup","group","migrateChat","openChatByInvite","isChannel","addChatMembers","all","deleteChatMember","viewMessages","sendMessages","sendMedia","sendStickers","sendGifs","sendGames","sendInline","embedLinks","sendPolls","changeInfo","inviteUsers","pinMessages","store","importChatInvite","fetchMessages","pagination","RequestClass","msgId","c","threadInfos","fetchMessage","queue","sendMessage","replyingTo","attachment","gif","scheduledAt","noWebPage","filename","blobUrl","previewBlobUrl","quick","inputWaveform","buildUploadingMedia","buildLocalMessage","groupIndex","groupedUploads","counter","singleMediaByIndex","prevQueue","uploadMedia","inputMedia","uploadedMedia","messageMedia","fileReference","fetchInputMedia","multiMedia","values","scheduleDate","sendGroupedMedia","pollParams","quiz","question","Buffer","multipleChoice","correctAnswers","buildInputPoll","noWebpage","editMessage","mtpEntities","rescheduleMessage","lastModified","blobToFile","fetchBlob","fetchFile","patchedOnProgress","progress","isCanceled","inputFile","pinMessage","isUnpin","isOneSide","unpin","pmOneside","unpinAllMessages","deleteMessages","shouldDeleteForAll","revoke","deleteScheduledMessages","deleteHistory","just_clear","reportMessages","markMessageListRead","requestThreadInfoUpdate","markMessagesRead","topMessageResult","repliesResult","offsetId","addOffset","discussionChatId","topMessageId","firstMessageId","noTopChatsRequest","searchMessagesLocal","chatOrUser","minDate","maxDate","topMsgId","nextOffsetId","totalCount","searchMessagesGlobal","offsetRate","nextRate","fetchWebPagePreview","sendPollVote","loadPollOptionResults","shouldResetVoters","votes","vote","nextOffset","forwardMessages","fromChat","toChat","randomIds","index","isAudio","asIncomingInChatWithSelf","buildForwardedMessage","fromPeer","toPeer","findFirstMessageIdAfterDate","fetchScheduledHistory","sendScheduledMessages","isServiceMessageWithMedia","fetchPinnedMessages","inputGifBot","fetchFullUser","input","userWithFullInfo","fetchNearestCountry","dcInfo","country","fetchTopUsers","topPeers","correspondents","fetchContactList","savedCount","fetchUsers","updateContact","deleteUser","fetchProfilePhotos","fetchStickerSets","allStickers","sets","fetchRecentStickers","stickers","processStickerResult","slice","fetchFavoriteStickers","fetchFeaturedStickers","faveSticker","unfave","fetchStickers","stickerSetShortName","packs","acc","documentId","fetchAnimatedEmojis","searchStickers","fetchSavedGifs","gifs","processGifResult","installStickerSet","uninstallStickerSet","searchGifs","config","resolvedPeer","gifSearchUsername","foundGif","fetchStickersForEmoji","fetchEmojiKeywords","fromVersion","langCode","version","keywords","emojiKeyword","keyword","emoticons","checkChatUsername","setChatUsername","updatePrivateLink","EMAIL_UNCONFIRMED","EMAIL_HASH_EXPIRED","NEW_SALT_INVALID","NEW_SETTINGS_INVALID","CODE_INVALID","emailCodeController","getPasswordInfo","hasPassword","onRequestEmailCode","checkPassword","currentPassword","isCheckPassword","onError","clearPassword","updatePassword","email","newPassword","emailCodeCallback","onEmailCodeError","updateRecoveryEmail","provideRecoveryEmailCode","BETA_LANG_CODES","updateProfile","checkUsername","updateUsername","updateProfilePhoto","uploadProfilePhoto","fetchWallpapers","filteredWallpapers","wallpapers","pattern","uploadWallpaper","fetchBlockedContacts","blockedIds","blockContact","unblockContact","fetchAuthorizations","authorizations","terminateAuthorization","terminateAllAuthorizations","fetchNotificationExceptions","compareSound","fetchNotificationSettings","isMutedContactSignUpNotification","privateContactNotificationsSettings","groupNotificationsSettings","broadcastNotificationsSettings","privateSilent","privateMuteUntil","privateShowPreviews","groupSilent","groupMuteUntil","groupShowPreviews","broadcastSilent","broadcastMuteUntil","broadcastShowPreviews","hasContactJoinedNotifications","hasPrivateChatsNotifications","hasPrivateChatsMessagePreview","hasGroupNotifications","hasGroupMessagePreview","hasBroadcastNotifications","hasBroadcastMessagePreview","updateContactSignUpNotification","updateNotificationSettings","fetchLanguages","langPack","fetchLangPack","sourceLangPacks","collections","strings","reverse","fetchLangStrings","fetchPrivacySettings","registerDevice","secret","getAuthKey","getKey","tokenType","appSandbox","otherUids","unregisterDevice","setPrivacySettings","privacyRules","allowedUsers","allowedChats","blockedUsers","blockedChats","updateIsOnline","isOnline","offline","fetchContentSettings","isSensitiveEnabled","sensitiveEnabled","canChangeSensitive","sensitiveCanChange","updateContentSettings","buildApiWebDocument","answerCallbackButton","fetchTopInlineBots","botsInline","fetchInlineBot","addUserToLocalDb","fetchInlineBotResults","queryId","switchPm","isGallery","gallery","help","buildApiBotInlineMediaResult","webDocument","webThumbnail","buildApiBotInlineResult","sendInlineBotResult","resultId","startBot","startParam","buildShippingOptions","shippingOptions","prices","ac","cur","label","validateRequestedInfo","requestInfo","shouldSave","sendPaymentForm","formId","requestedInfoId","shippingOptionId","credentials","getPaymentForm","form","canSaveCredentials","passwordMissing","providerId","nativeProvider","nativeParams","savedInfo","nameRequested","phoneRequested","emailRequested","shippingAddressRequested","flexible","phoneToProvider","emailToProvider","mapedPrices","nativeData","needCardholderName","need_cardholder_name","needCountry","need_country","needZip","need_zip","publishableKey","publishable_key","buildPaymentForm","getReceipt","receipt","shipping","credentialsTitle","shippingPrices","shippingMethod","buildReceipt","initApi","_onUpdate","initialArgs","initUpdater","handleUpdate","initAuth","initChats","initMessages","initUsers","initStickers","initManagement","initTwoFaSettings","userAgent","sessions","TelegramClient","process","deviceModel","navigator","appVersion","useWSS","additionalDcsDisabled","addEventHandler","phoneCode","firstAndLastNames","initialMethod","getSessionData","initClient","flushUpdatesOnTickEnd","schedulerFn","fn","waiting","_args","throttleWith","cb","then","throttleId","pendingUpdates","currentThrottleId","currentUpdates","flushUpdatesThrottled","ms","shouldRunFirst","interval","isPending","setInterval","clearInterval","throttle","random","sendToOrigin","addEventListener","callbackState","Map","postMessage","onmessage","callback","callbackArgs","lastArg","ArrayBuffer","fnName","methods","callApi","require","crypto","little","signed","randBuffer","bytesNumber","bigInt","subtract","pow","toSignedLittleBuffer","big","number","bigNumber","byteArray","shiftRight","and","readBufferFromBigInt","bitLength","lesser","below","hex","padStart","l","reminder","randomBytes","sha1","shaSum","createHash","digest","crcTable","module","exports","generateRandomLong","mod","n","m","crc32","buf","k","makeCRCTable","isBuffer","crc","generateKeyDataFromNonce","serverNonce","newNonce","hash1","hash2","hash3","iv","sha256","bigIntMod","remainder","modExp","b","one","x","greater","zero","leastSignificantBit","divide","eq","multiply","getRandomInt","sleep","getByteArray","integer","bits","byteLength","convertToLittle","alloc","writeUInt32BE","bufferXor","res","createDeferred","promise","_resolve","constructors","checkPrimeAndGood","primeBytes","g","equals","numBytesForHash","bigNumForHash","isGoodModExpFirst","modexp","prime","diff","xor","computeHash","algo","salt1","salt2","salt","iterations","pbkdf2","pbkdf2sha512","computeCheck","currentAlgo","PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow","pwHash","p","B","srp_B","isGoodLarge","pForHash","gForHash","bForHash","gX","kgX","aForHash","A","generateAndCheckRandom","gB","ux","aUx","S","K","pSha","gSha","salt1Sha","salt2Sha","M1","InputCheckPasswordSRP","srpId","computeDigest","JPEG_HEADER","JPEG_FOOTER","_raiseCastFail","getMessageId","getInputPeer","allowSelf","checkHash","User","InputPeerSelf","InputPeerUser","Chat","ChatEmpty","ChatForbidden","InputPeerChat","Channel","TypeError","InputPeerChannel","ChannelForbidden","InputUser","InputChannel","UserEmpty","InputPeerEmpty","UserFull","ChatFull","PeerChat","getDisplayName","getAppropriatedPartSize","fileSize","stripped","header","getDC","downloadDC","ipAddress","port","pwd","Api","newAlgo","newSettings","newPasswordHash","newSecureSettings","codeLength","os","Logger","MemorySession","Helpers","utils","Session","LAYER","requests","MTProtoSender","ConnectionTCPObfuscated","authFlow","checkAuthorization","downloadFile","WEBDOCUMENT_REQUEST_PART_SIZE","sizeTypes","apiId","apiHash","opts","DEFAULT_OPTIONS","_useIPV6","useIPV6","baseLogger","_log","floodSleepLimit","_eventBuilders","_phoneCodeHash","parseInt","_requestRetries","requestRetries","_connectionRetries","connectionRetries","_retryDelay","retryDelay","proxy","_proxy","_timeout","timeout","_autoReconnect","autoReconnect","_connection","_floodWaitedRequests","_initWith","InvokeWithLayer","layer","InitConnection","systemVersion","release","systemLangCode","_config","phoneCodeHashes","_exportedSenderPromises","_exportedSenderReleaseTimeouts","_additionalDcsDisabled","_loopStarted","_reconnecting","_destroyed","_initSession","_sender","logger","retries","delay","connectTimeout","authKeyCallback","_authKeyCallback","bind","updateCallback","_handleUpdate","isMainSender","userDisconnected","_user_connected","_disconnected","serverAddress","connect","setAuthKey","authKey","send","GetConfig","_updateLoop","load","setDC","attempts","PingDelayDisconnect","pingId","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","disconnectDelay","race","getTime","_lastRequest","GetState","sender","newDc","DC","setKey","dc","_authenticated","auth","ExportAuthorization","req","ImportAuthorization","shouldReconnect","existingSender","_connectSender","_createExportedSender","isConnecting","_borrowExportedSender","clearTimeout","onConnectionBreak","_cleanupExportedSender","getSender","inputLocation","messageOrMedia","Message","MessageMediaWebPage","WebPage","MessageMediaPhoto","Photo","_downloadPhoto","MessageMediaDocument","Document","_downloadDocument","MessageMediaContact","_downloadContact","WebDocument","WebDocumentNoProxy","_downloadWebDocument","isBig","loc","chatPhoto","UserProfilePhoto","ChatPhoto","InputPeerPhotoFileLocation","thumbVersion","InputStickerSetThumb","InputStickerSetID","thumbDcId","_pickFileSize","indexOf","_downloadCachedPhotoSize","PhotoStrippedSize","PhotoSizeEmpty","PhotoCachedSize","InputPhotoFileLocation","thumbSize","doc","InputDocumentFileLocation","buff","downloaded","upload","GetWebFile","location","InputWebFileLocation","attempt","sendWithInvokeSupport","ServerError","FloodWaitError","FloodTestPhoneWaitError","PhoneMigrateError","NetworkMigrateError","UserMigrateError","_switchDC","MsgWaitError","isReady","GetUsers","InputUserSelf","authParams","apiCredentials","fileParams","event","Updates","UpdatesCombined","_processUpdate","UpdateShort","others","_dispatchUpdate","ptsDate","builder","times","pause","Infinity","sequentialUpdates","DEFAULT_INITIAL_METHOD","me","botAuthToken","signInBot","signInUser","signInUserWithQrCode","phoneCodeHash","sendCodeResult","sendCode","forceSMS","termsOfService","isRegistrationRequired","signInWithPassword","isScanningComplete","inputPromise","exceptIds","updatePromise","result2","authorization","migratedResult","sendResult","resendResult","passwordSrpResult","passwordSrpCheck","computePasswordSrpCheck","ONE_MB","Foreman","maxWorkers","requestWorker","activeWorkers","releaseWorker","partSizeKb","partSize","partsCount","foreman","promises","hasEnded","isPrecise","offsetMemo","precise","buffers","totalLength","fileId","isLarge","partCount","fileToBuffer","sendingParts","j","jMemo","bytesMemo","filePart","fileTotalParts","parts","md5Checksum","BinaryReader","AuthKey","_key","_hash","auxHash","readLong","read","keyId","writeUInt8","shaData","other","cipher","createCipheriv","encrypt","Factorizator","neq","temp","pq","y","randBetween","minus","ys","condition","gcd","IGE","AESIGE","ige","decryptIge","cipherText","decrypt","encryptIge","plainText","padding","i2abLow","uint8","Uint8Array","int","i2abBig","ab2iLow","ab","Uint32Array","ab2iBig","isBigEndian","i2ab","ab2i","AES","getWords","Counter","initialValue","setBytes","_counter","increment","CTR","_remainingCounter","_remainingCounterIndex","_aes","encrypted","Hash","algorithm","subtle","createDecipheriv","getRandomValues","passwordKey","importKey","deriveBits","s2i","str","pos","charCodeAt","right","ReadCancelledError","TypeNotFoundError","invalidConstructorId","remaining","alert","InvalidChecksumError","checksum","validChecksum","InvalidBufferError","payload","readInt32LE","SecurityError","BadMessageError","errorMessage","ErrorMessages","CdnFileTamperedError","RPCError","_fmtRequest","InvalidDCError","BadRequestError","UnauthorizedError","ForbiddenError","NotFoundError","AuthKeyError","FloodError","TimedOutError","capture","SlowModeWaitError","FileMigrateError","EmailUnconfirmedError","rpcErrorRe","Common","RPCBaseErrors","RPCErrorList","RPCMessageToError","rpcError","msgRegex","Cls","EventBuilder","types","func","blacklistChats","resolved","NewMessage","Raw","StopPropagation","_queue","canGet","resolveGet","canPush","resolvePush","returned","pop","coreObjects","tlobjects","stream","_last","readByte","readInt","readUInt32LE","readLargeInt","readFloat","readFloatLE","readDouble","readDoubleLE","getBuffer","tgReadBytes","firstByte","tgReadString","tgReadBool","tgReadDate","tgReadObject","constructorId","clazz","seek","tellPosition","setPosition","fromReader","tgReadVector","close","position","_stream","write","getValue","_level","level","isBrowser","browser","__nwjs","colors","debug","messageFormat","canSend","levels","stack","format","toISOString","toUpperCase","color","log","MessageContainer","TLMessage","BinaryWriter","USE_INVOKE_AFTER_WITH","_state","_pendingStates","_ready","setReady","append","after","catch","finally","extend","states","batch","MAXIMUM_LENGTH","shift","SIZE_OVERHEAD","MAXIMUM_SIZE","afterId","writeDataAsMessage","unshift","writeUInt32LE","writeInt32LE","containerId","rejectAll","requestState","Mutex","mutex","WebSocketClient","closeError","disconnectedCallback","closed","readData","thisTime","canRead","toReturn","resolveRead","getWebSocketLink","ip","website","onopen","receive","onclose","wasClean","acquire","PromisedWebSockets","MessagePacker","AsyncQueue","tl","events","extensions","helpers","PUBLIC_KEYS","fingerprint","_serverKeys","keyInfo","doAuthentication","nonce","resPQ","factorize","pBuffer","qBuffer","pqInnerData","getBytes","targetFingerprint","targetKey","serverPublicKeyFingerprints","dataWithPadding","dataPadReversed","encryptedData","tempKey","shaDigestKeyWithData","dataWithHash","aesEncrypted","tempKeyXor","keyAesEncrypted","keyAesEncryptedInt","greaterOrEquals","encryptedDataBuffer","serverDhParams","publicKeyFingerprint","sh","nnh","newNonceHash","encryptedAnswer","plainTextAnswer","serverDhInner","dhPrime","ga","gA","serverTime","gb","gab","clientDhInner","retryId","clientDdhInnerHashed","clientDhEncrypted","dhGen","nonceTypes","nonceNumber","calcNewNonceHash","MTProtoState","loggers","body","_getNewMsgId","recv","MtProtoPlainSender","RPCResult","GZIPPacked","RequestState","MsgsAck","MsgsStateInfo","Pong","UpdateConnectionState","UpdateServerTimeOffset","BadServerSalt","BadMsgNotification","MsgDetailedInfo","MsgNewDetailedInfo","NewSessionCreated","FutureSalts","MsgsStateReq","MsgResendReq","MsgsAllInfo","LogOut","_dcId","_retries","_delay","_connectTimeout","_updateCallback","_autoReconnectCallback","autoReconnectCallback","_isMainSender","_onConnectionBreak","_send_loop_handle","_recv_loop_handle","_send_queue","_pending_state","_pending_ack","_last_acks","_handlers","_handleRPCResult","_handleContainer","_handleGzipPacked","_handlePong","_handleBadServerSalt","_handleBadNotification","_handleDetailedInfo","_handleNewDetailedInfo","_handleNewSessionCreated","_handleAck","_handleFutureSalts","_handleStateForgotten","_handleMsgAll","force","_connect","connected","disconnected","_disconnect","plain","_sendLoop","_recvLoop","ack","msgIds","encryptMessageData","isArray","reconnect","decryptMessageData","broken","_processMessage","obj","handler","_popStates","toPop","reqMsgId","readResult","innerMessage","pong","newTimeOffset","updateTimeOffset","badSalt","badMsgId","newServerSalt","badMsg","errorCode","_sequence","answerMsgId","serverSalt","repeat","_reconnect","reset","newConnection","_ip","_port","InvokeAfterMsg","_lastMsgId","updateMessageId","msgKey","sha256a","sha256b","contentRelated","seqNo","_getSeqNo","gzipIfSmaller","waitForKey","_calcKey","ourKey","remoteMsgId","remoteSequence","containerLen","nanoseconds","newMsgId","shiftLeft","or","correctMsgId","bad","old","pending","Connection","_connected","_sendTask","_recvTask","_codec","_obfuscation","_sendArray","_recvArray","socket","disconnectCallback","PacketCodecClass","_initConn","fromCallback","_send","_recv","tag","encodedPacket","encodePacket","readPacket","PacketCodec","_conn","ObfuscatedConnection","ObfuscatedIO","AbridgedPacketCodec","props","obfuscateTag","ConnectionTCPAbridged","initHeader","_encrypt","encryptor","_decrypt","decryptor","packetCodec","ok","toJSON","randomReversed","encryptKey","encryptIv","decryptKey","decryptIv","readExactly","ConnectionTCPFull","MTProtoPlainSender","StorageSession","CACHE_NAME","_storageKey","cached","_sessionData","_callback","_authKeys","mainDcId","hashes","skipOnUpdate","_serverAddress","idb","_delete","del","_fetchFromCache","_saveToCache","localStorage","removeItem","getItem","setItem","_takeoutId","_updateStates","_authKey","sessionInfo","_sessionString","_loadFromSessionString","skipUpdateStorage","_updateStorage","asHex","mainDcIdStr","mainDcKey","StringSession","decode","readUInt8","serverAddressLen","readInt16BE","dcBuffer","addressBuffer","addressLengthBuffer","writeInt16BE","portBuffer","encode","Memory","CacheApiSession","LocalStorageSession","IdbSession","CallbackSession","api","sub","parseTl","serializeBytes","serializeDate","tlContent","schemeContent","CACHING_SUPPORTED","CACHE_KEY","extractParams","fileContent","f","functions","d","isFunction","argToBytes","writeDoubleLE","getArgFromReader","arg","isVector","useVectorId","flagIndicator","skipConstructorId","createClasses","classesType","classes","classParams","subclassOfId","argsConfig","namespace","fullName","VirtualClass","argName","isFlag","flagIndex","idForBytes","flagCalculate","boxed","charAt","definitions","fromCache","jsonCache","loadFromCache","constructorParamsApi","functionParamsApi","constructorParamsSchema","functionParamsSchema","loadFromTlSchemas","obj1","obj2","mergeWithNamespaces","buildApiFromTlSchema","gzipped","toBytes","gzip","ungzip","containerLength","before","tlMessage","RpcError","innerCode","snakeToCamelCase","_","variableSnakeToCamelCase","CORE_TYPES","AUTH_KEY_TYPES","findAll","regex","matches","RegExp","source","exec","fromLine","line","argsMatch","currentConfig","hexId","representation","brace","argType","buildArgConfig","flagMatch","vectorMatch","ignoreIds","o","objAll","objByName","objByType","commentIndex","trim","followingTypes","dt","fill","t","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","loaded","__webpack_modules__","__webpack_exports__","O","chunkIds","priority","notFulfilled","fulfilled","every","splice","getter","__esModule","definition","defineProperty","enumerable","chunkId","miniCssF","globalThis","Function","prop","prototype","Symbol","toStringTag","nmd","paths","children","scriptUrl","importScripts","currentScript","src","scripts","getElementsByTagName","installedChunks","chunkLoadingGlobal","parentChunkLoadingFunction","moreModules","runtime"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/514.e85ae04366b5ac2cfcb1.js b/dist/514.e85ae04366b5ac2cfcb1.js new file mode 100644 index 00000000..815b8c81 --- /dev/null +++ b/dist/514.e85ae04366b5ac2cfcb1.js @@ -0,0 +1,2 @@ +(()=>{var e,t,n={6514:(e,t,n)=>{"use strict";var s={};n.r(s),n.d(s,{Type:()=>ht,clear:()=>yt,fetch:()=>mt,save:()=>_t});var a={};n.r(a),n.d(a,{addChatMembers:()=>bn,answerCallbackButton:()=>wa,blockContact:()=>Zs,checkChatUsername:()=>Rs,checkPassword:()=>Ns,checkUsername:()=>zs,clearDraft:()=>Ht,clearPassword:()=>Fs,createChannel:()=>Kt,createGroupChat:()=>Qt,deleteChannel:()=>Jt,deleteChat:()=>jt,deleteChatFolder:()=>sn,deleteChatMember:()=>wn,deleteChatUser:()=>Wt,deleteHistory:()=>Fn,deleteMessages:()=>Vn,deleteScheduledMessages:()=>Nn,deleteUser:()=>us,destroy:()=>At,disconnect:()=>St,downloadMedia:()=>Ut,editChatFolder:()=>nn,editChatPhoto:()=>Xt,editMessage:()=>En,faveSticker:()=>_s,fetchAnimatedEmojis:()=>bs,fetchAuthorizations:()=>ea,fetchBlockedContacts:()=>Xs,fetchChat:()=>Ot,fetchChatFolders:()=>en,fetchChats:()=>Vt,fetchContactList:()=>cs,fetchContentSettings:()=>ha,fetchCountryList:()=>os,fetchCurrentUser:()=>Tt,fetchEmojiKeywords:()=>Ss,fetchFavoriteStickers:()=>hs,fetchFeaturedStickers:()=>ms,fetchFullChat:()=>Nt,fetchFullUser:()=>as,fetchGroupsForDiscussion:()=>hn,fetchInlineBot:()=>Ca,fetchInlineBotResults:()=>Pa,fetchLangPack:()=>ca,fetchLangStrings:()=>da,fetchLanguages:()=>ra,fetchMembers:()=>fn,fetchMessage:()=>Mn,fetchMessages:()=>Sn,fetchNearestCountry:()=>is,fetchNotificationExceptions:()=>sa,fetchNotificationSettings:()=>aa,fetchPinnedMessages:()=>Yn,fetchPrivacySettings:()=>la,fetchProfilePhotos:()=>gs,fetchRecentStickers:()=>fs,fetchRecommendedChatFolders:()=>tn,fetchSavedGifs:()=>Is,fetchScheduledHistory:()=>Qn,fetchStickerSets:()=>ps,fetchStickers:()=>ys,fetchStickersForEmoji:()=>As,fetchTopInlineBots:()=>Ia,fetchTopUsers:()=>rs,fetchUsers:()=>ds,fetchWallpapers:()=>Js,fetchWebPagePreview:()=>zn,findFirstMessageIdAfterDate:()=>Jn,forwardMessages:()=>$n,getChatByUsername:()=>on,getPasswordInfo:()=>xs,getPaymentForm:()=>Ua,getReceipt:()=>Ea,importChatInvite:()=>Pn,installStickerSet:()=>Cs,joinChannel:()=>zt,leaveChannel:()=>$t,loadPollOptionResults:()=>jn,markMessageListRead:()=>Ln,markMessagesRead:()=>qn,migrateChat:()=>_n,openChatByInvite:()=>yn,pinMessage:()=>Bn,provideAuthCode:()=>ot,provideAuthPassword:()=>rt,provideAuthPhoneNumber:()=>it,provideAuthRegistration:()=>ct,provideRecoveryEmailCode:()=>qs,registerDevice:()=>ua,reportMessages:()=>On,requestChatUpdate:()=>Lt,requestThreadInfoUpdate:()=>Hn,rescheduleMessage:()=>Dn,restartAuth:()=>dt,restartAuthWithQr:()=>lt,saveDraft:()=>qt,searchChats:()=>Ft,searchGifs:()=>vs,searchMessagesGlobal:()=>Kn,searchMessagesLocal:()=>Gn,searchStickers:()=>ws,sendInlineBotResult:()=>va,sendMessage:()=>Rn,sendPaymentForm:()=>Ra,sendPollVote:()=>Wn,sendScheduledMessages:()=>Xn,setChatUsername:()=>Us,setDiscussionGroup:()=>mn,setPrivacySettings:()=>pa,startBot:()=>Aa,terminateAllAuthorizations:()=>na,terminateAuthorization:()=>ta,toggleChatArchived:()=>Yt,toggleChatPinned:()=>Zt,toggleDialogUnread:()=>an,togglePreHistoryHidden:()=>rn,toggleSignatures:()=>pn,unblockContact:()=>Ys,uninstallStickerSet:()=>Ps,unpinAllMessages:()=>xn,unregisterDevice:()=>ga,updateChatAbout:()=>gn,updateChatAdmin:()=>ln,updateChatDefaultBannedRights:()=>cn,updateChatMemberBannedRights:()=>dn,updateChatMutedState:()=>Gt,updateChatTitle:()=>un,updateContact:()=>ls,updateContactSignUpNotification:()=>ia,updateContentSettings:()=>ma,updateIsOnline:()=>fa,updateNotificationSettings:()=>oa,updatePassword:()=>Os,updatePrivateLink:()=>Es,updateProfile:()=>Ks,updateProfilePhoto:()=>js,updateRecoveryEmail:()=>Ls,updateUsername:()=>Ws,uploadProfilePhoto:()=>$s,uploadWallpaper:()=>Qs,validateRequestedInfo:()=>ka});const i=("undefined"!=typeof window&&window.innerHeight,Math.round(425)),o=new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory"]);new Set(["image/png","image/gif","image/jpeg","video/mp4","video/avi","video/quicktime"]);var r=n(3522);function c(e,t){return e.reduce(((e,n)=>(e[n[t]]=n,e)),{})}function d(e,t){return t.reduce(((t,n)=>(t[n]=e[n],t)),{})}function l(e){return e.hasOwnProperty("userId")}function u(e){return e.hasOwnProperty("chatId")}function g(e,t=!1,n="image/jpeg"){return`${t?"":`data:${n};base64,`}${btoa(String.fromCharCode(...e))}`}function p(e){if(!e)return;const{flags:t,CONSTRUCTOR_ID:n,SUBCLASS_OF_ID:s,className:a,classType:i,...o}=e;return o}const f=e=>Math.floor(Date.now()/1e3)+e;function h(e,t=!1){const n=Boolean("min"in e&&e.min),s="accessHash"in e&&String(e.accessHash),a="photo"in e&&e.photo&&M(e.photo),i=Boolean("signatures"in e&&e.signatures);return{isMin:n,hasPrivateLink:Boolean("hasLink"in e&&e.hasLink),isSignaturesShown:i,...s&&{accessHash:s},...a&&{avatarHash:a},...(e instanceof r.Api.Channel||e instanceof r.Api.User)&&{username:e.username},..."verified"in e&&{isVerified:e.verified},..."callActive"in e&&{isCallActive:e.callActive},..."callNotEmpty"in e&&{isCallNotEmpty:e.callNotEmpty},...(e instanceof r.Api.Chat||e instanceof r.Api.Channel)&&{...e.participantsCount&&{membersCount:e.participantsCount},joinDate:e.date},...t&&{isSupport:!0},..._(e),..."creator"in e&&{isCreator:e.creator},...y(e),...b(e)}}function m(e,t,n){const{peer:s,folderId:a,unreadMark:i,unreadCount:o,unreadMentionsCount:c,notifySettings:{silent:d,muteUntil:l},readOutboxMaxId:u,readInboxMaxId:g,draft:p}=e,m=d||"number"==typeof l&&f(n)"all"===e));return t?d(t,["reason","text"]):void 0}(e.restrictionReason):void 0;n&&Object.assign(t,{isRestricted:!0,restrictionReason:n})}return e instanceof r.Api.Chat&&Object.assign(t,{isNotJoined:e.left,isRestricted:e.kicked}),e instanceof r.Api.Channel&&Object.assign(t,{isNotJoined:e.left}),t}function b(e){return e instanceof r.Api.Chat&&e.migratedTo&&!(e.migratedTo instanceof r.Api.InputChannelEmpty)?{migratedTo:{chatId:I(e.migratedTo),...e.migratedTo instanceof r.Api.InputChannel&&{accessHash:e.migratedTo.accessHash.toString()}}}:{}}function w(e,t=!1,n=!1){if(e instanceof r.Api.Chat||e instanceof r.Api.Channel||e instanceof r.Api.User||n&&(e instanceof r.Api.ChatForbidden||e instanceof r.Api.ChannelForbidden))return{id:e instanceof r.Api.User?e.id:-e.id,type:P(e),title:e instanceof r.Api.User?S(e):e.title,...h(e,t)}}function I(e){return l(e)?e.userId:u(e)?-e.chatId:-e.channelId}function C(e){return function(e){return e.hasOwnProperty("userId")}(e)?e.userId:function(e){return e.hasOwnProperty("chatId")}(e)?-e.chatId:function(e){return e.hasOwnProperty("channelId")}(e)?-e.channelId:void 0}function P(e){return e instanceof r.Api.User||e instanceof r.Api.UserEmpty?"chatTypePrivate":e instanceof r.Api.Chat||e instanceof r.Api.ChatForbidden||e instanceof r.Api.ChatEmpty?"chatTypeBasicGroup":e.megagroup?"chatTypeSuperGroup":"chatTypeChannel"}function v(e){return l(e)?`user${e.userId}`:u(e)?`chat${e.chatId}`:`chat${e.channelId}`}function A(e,t){return l(e)?S(t):t.title}function S(e){return e.firstName?`${e.firstName}${e.lastName?` ${e.lastName}`:""}`:e.lastName||void 0}function M(e){if("photoId"in e)return e.photoId.toString()}function k(e){return{userId:e instanceof r.Api.ChannelParticipantBanned||e instanceof r.Api.ChannelParticipantLeft?I(e.peer):e.userId,inviterId:"inviterId"in e?e.inviterId:void 0,joinedDate:"date"in e?e.date:void 0,kickedByUserId:"kickedBy"in e?e.kickedBy:void 0,promotedByUserId:"promotedBy"in e?e.promotedBy:void 0,bannedRights:"bannedRights"in e?p(e.bannedRights):void 0,adminRights:"adminRights"in e?p(e.adminRights):void 0,customTitle:"rank"in e?e.rank:void 0,...(e instanceof r.Api.ChannelParticipantAdmin||e instanceof r.Api.ChatParticipantAdmin)&&{isAdmin:!0},...(e instanceof r.Api.ChannelParticipantCreator||e instanceof r.Api.ChatParticipantCreator)&&{isOwner:!0}}}function R(e){return e instanceof r.Api.ChatParticipants||e instanceof r.Api.channels.ChannelParticipants?e.participants.map(k).filter(Boolean):void 0}function U(e,t){let n="";if(!(e.action instanceof r.Api.SendMessageCancelAction))return e.action instanceof r.Api.SendMessageTypingAction?n="lng_user_typing":e.action instanceof r.Api.SendMessageRecordVideoAction?n="lng_send_action_record_video":e.action instanceof r.Api.SendMessageUploadVideoAction?n="lng_send_action_upload_video":e.action instanceof r.Api.SendMessageRecordAudioAction?n="lng_send_action_record_audio":e.action instanceof r.Api.SendMessageUploadAudioAction?n="lng_send_action_upload_audio":e.action instanceof r.Api.SendMessageUploadPhotoAction?n="lng_send_action_upload_photo":e.action instanceof r.Api.SendMessageUploadDocumentAction?n="lng_send_action_upload_file":e.action instanceof r.Api.SendMessageGeoLocationAction?n="selecting a location to share":e.action instanceof r.Api.SendMessageChooseContactAction?n="selecting a contact to share":e.action instanceof r.Api.SendMessageGamePlayAction?n="lng_playing_game":e.action instanceof r.Api.SendMessageRecordRoundAction?n="lng_send_action_record_round":e.action instanceof r.Api.SendMessageUploadRoundAction&&(n="lng_send_action_upload_round"),{action:n,...!(e instanceof r.Api.UpdateUserTyping)&&{userId:I(e.fromId)},timestamp:Date.now()+1e3*t}}function E(e){return{...(t=e,n=["id","title","emoticon","contacts","nonContacts","groups","bots","excludeMuted","excludeRead","excludeArchived"],n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{})),channels:e.broadcasts,pinnedChatIds:e.pinnedPeers.map(C).filter(Boolean),includedChatIds:e.includePeers.map(C).filter(Boolean),excludedChatIds:e.excludePeers.map(C).filter(Boolean)};var t,n}function D({filter:e,description:t}){return{...E(e),description:t}}function T(e){return e.reduce(((e,t)=>e.concat(t.commands.map((e=>({botId:t.userId,...p(e)}))))),[])}var B=n(8960);function x(e,t,n){return''.replace("{{path}}",function(e){let t="M";const n=e.length;for(let s=0;s=192?t+="AACAAAAHAAALMAAAQASTAVAAAZaacaaaahaaalmaaaqastava.az0123456789-,"[n-128-64]:(n>=128?t+=",":n>=64&&(t+="-"),t+=String(63&n))}return t+="z",t}(e)).replace("{{width}}",String(t)).replace("{{height}}",String(n))}const V={w:100,h:100};function N(e,t){if(!e||!e.length)return;const n=e.find((e=>e instanceof r.Api.PhotoStrippedSize));if(!n)return;const s=e.filter((e=>e instanceof r.Api.PhotoSize)),{w:a,h:i}=s.length?s[s.length-1]:V,{bytes:o}=n;return{dataUri:g(t&&"image/jpeg"!==t?o:(0,B.strippedPhotoToJpg)(o),void 0,t),width:a,height:i}}function F(e){const t=e.sizes.filter((e=>e instanceof r.Api.PhotoSize||e instanceof r.Api.PhotoSizeProgressive)).map(O);return{id:String(e.id),thumbnail:N(e.sizes),sizes:t}}function O(e){const{w:t,h:n,type:s}=e;return{width:t,height:n,type:s}}const L={localMessages:{},chats:{},users:{},messages:{},documents:{},stickerSets:{},photos:{},webDocuments:{}},q="application/x-tgsticker";function H(e){if(e instanceof r.Api.DocumentEmpty)return;const t=e.attributes.find((e=>e instanceof r.Api.DocumentAttributeSticker)),n=e.mimeType===q&&e.attributes.find((e=>e instanceof r.Api.DocumentAttributeFilename));if(!t&&!n)return;const s=e.attributes.find((e=>e instanceof r.Api.DocumentAttributeImageSize)),a=t&&t.stickerset instanceof r.Api.InputStickerSetID?t.stickerset:void 0,i=null==t?void 0:t.alt,o=e.mimeType===q,c=e.thumbs&&e.thumbs.find((e=>e instanceof r.Api.PhotoCachedSize)),d=e.thumbs&&e.thumbs.find((e=>e instanceof r.Api.PhotoPathSize)),l=c?function(e){const{w:t,h:n,bytes:s}=e;return{dataUri:g(s,void 0,"image/webp"),width:t,height:n}}(c):d&&s?function(e,t){const{w:n,h:s}=t;return{dataUri:`data:image/svg+xml;utf8,${x(e.bytes,n,s)}`,width:n,height:s}}(d,s):void 0,{w:u,h:p}=c||s||{};return{id:String(e.id),stickerSetId:a?String(a.id):"MEMOJI_STICKER",stickerSetAccessHash:a&&String(a.accessHash),emoji:i,isAnimated:o,width:u,height:p,thumbnail:l}}function G(e){const{archived:t,animated:n,installedDate:s,id:a,accessHash:i,title:o,thumbs:r,count:c,hash:d,shortName:l}=e;return{archived:t,isAnimated:n,installedDate:s,id:String(a),accessHash:String(i),title:o,hasThumbnail:Boolean(null==r?void 0:r.length),count:c,hash:d,shortName:l}}function K(e){const t=G(e.set),n=e instanceof r.Api.StickerSetMultiCovered?e.covers:[e.cover];return t.covers=[],n.forEach((e=>{if(e instanceof r.Api.Document){const n=H(e);n&&(t.covers.push(n),L.documents[String(e.id)]=e)}})),t}function z(e,t){let n=0;const s=new Array(t),a=e.length/t,i=e[0],o=e[e.length-1];for(let l=0;l0?"user":e<=-1e9?"channel":"chat"}function Y(e){return e>0?new r.Api.PeerUser({userId:e}):e<=-1e9?new r.Api.PeerChannel({channelId:-e}):new r.Api.PeerChat({chatId:-e})}function ee(e,t){return e>0||e<=-1e9?e>0?new r.Api.InputPeerUser({userId:e,accessHash:j()(t)}):new r.Api.InputPeerChannel({channelId:-e,accessHash:j()(t)}):new r.Api.InputPeerChat({chatId:-e})}function te(e){if(e>0){const{accessHash:t}=L.users[e]||{};return t?new r.Api.InputPeerUser({userId:e,accessHash:t}):void 0}if(e<=-1e9){const{accessHash:t}=L.chats[-e]||{};return t?new r.Api.InputPeerChannel({channelId:-e,accessHash:t}):void 0}return new r.Api.InputPeerChat({chatId:-e})}function ne(e,t){return e>0?new r.Api.InputUser({userId:e,accessHash:j()(t)}):e<=-1e9?new r.Api.InputChannel({channelId:-e,accessHash:j()(t)}):-e}function se(e,t){return new r.Api.InputStickerSetID({id:j()(e),accessHash:j()(t)})}function ae(e){const t=L.documents[e.id];if(t)return new r.Api.InputDocument(d(t,["id","accessHash","fileReference"]))}function ie(e){const t=ae(e);if(t)return new r.Api.InputMediaDocument({id:t})}function oe(){return(0,$.readBigIntFromBuffer)((0,$.generateRandomBytes)(8),!0,!0)}function re(e,t,n){return new r.Api.Message({id:e,peerId:Y(t),fromId:Y(t),media:n.media})}function ce(e){const{type:t,offset:n,length:s,url:a,userId:i}=e,o=i?L.users[i]:void 0;switch(t){case J.Bold:return new r.Api.MessageEntityBold({offset:n,length:s});case J.Italic:return new r.Api.MessageEntityItalic({offset:n,length:s});case J.Underline:return new r.Api.MessageEntityUnderline({offset:n,length:s});case J.Strike:return new r.Api.MessageEntityStrike({offset:n,length:s});case J.Code:return new r.Api.MessageEntityCode({offset:n,length:s});case J.Pre:return new r.Api.MessageEntityPre({offset:n,length:s,language:""});case J.Blockquote:return new r.Api.MessageEntityBlockquote({offset:n,length:s});case J.TextUrl:return new r.Api.MessageEntityTextUrl({offset:n,length:s,url:a});case J.Url:return new r.Api.MessageEntityUrl({offset:n,length:s});case J.Hashtag:return new r.Api.MessageEntityHashtag({offset:n,length:s});case J.MentionName:return new r.Api.InputMessageEntityMentionName({offset:n,length:s,userId:new r.Api.InputUser({userId:i,accessHash:o.accessHash})});default:return new r.Api.MessageEntityUnknown({offset:n,length:s})}}function de(e){let t=0;return e.forEach((e=>{t=(20261*t&2147483647)+e&2147483647})),t}function le(e){const{media:t}=e;return!!t&&(t instanceof r.Api.MessageMediaPhoto||t instanceof r.Api.MessageMediaDocument||t instanceof r.Api.MessageMediaWebPage&&t.webpage instanceof r.Api.WebPage&&(t.webpage.photo instanceof r.Api.Photo||t.webpage.document instanceof r.Api.Document&&t.webpage.document.mimeType.startsWith("video")))}function ue({phone:e,firstName:t,lastName:n}){return new r.Api.InputPhoneContact({clientId:j()(1),phone:e,firstName:t,lastName:n})}function ge(e,t=0){return new r.Api.ChatBannedRights({...e,untilDate:t})}function pe(e){return new r.Api.ChatAdminRights(e)}function fe(e){const{shippingAddress:t}=e;return new r.Api.PaymentRequestedInfo({...e,shippingAddress:t?new r.Api.PostAddress(t):void 0})}function he(e){switch(e){case"phoneNumber":return new r.Api.InputPrivacyKeyPhoneNumber;case"lastSeen":return new r.Api.InputPrivacyKeyStatusTimestamp;case"profilePhoto":return new r.Api.InputPrivacyKeyProfilePhoto;case"forwards":return new r.Api.InputPrivacyKeyForwards;case"chatInvite":return new r.Api.InputPrivacyKeyChatInvite}}function me(e){switch(e){case"spam":return new r.Api.InputReportReasonSpam;case"violence":return new r.Api.InputReportReasonViolence;case"childAbuse":return new r.Api.InputReportReasonChildAbuse;case"pornography":return new r.Api.InputReportReasonPornography;case"copyright":return new r.Api.InputReportReasonCopyright;case"fake":return new r.Api.InputReportReasonFake;case"geoIrrelevant":return new r.Api.InputReportReasonGeoIrrelevant;case"other":return new r.Api.InputReportReasonOther}}function _e(e){if(e instanceof r.Api.Message||e instanceof r.Api.MessageService)return I(e.peerId)}function ye(e){const t=`${_e(e)}-${e.id}`;L.messages[t]=e,e instanceof r.Api.Message&&e.media instanceof r.Api.MessageMediaDocument&&e.media.document instanceof r.Api.Document&&(L.documents[String(e.media.document.id)]=e.media.document),e instanceof r.Api.Message&&e.media instanceof r.Api.MessageMediaWebPage&&e.media.webpage instanceof r.Api.WebPage&&e.media.webpage.document instanceof r.Api.Document&&(L.documents[String(e.media.webpage.document.id)]=e.media.webpage.document),e instanceof r.Api.MessageService&&"photo"in e.action&&be(e.action.photo)}function be(e){e instanceof r.Api.Photo&&(L.photos[String(e.id)]=e)}let we,Ie,Ce=1e9;function Pe(e){const t=_e(e);if(t&&(e instanceof r.Api.Message||e instanceof r.Api.MessageService))return ve(t,e)}function ve(e,t){const n=t.fromId?I(t.fromId):void 0,s=t.peerId?I(t.peerId):void 0,a=!n&&e===we,i=t.out&&!t.post||a&&!t.fwdFrom;let o={};t.media&&(o={...Me(t.media)}),!t.message||o.sticker||o.poll||o.contact||(o={...o,text:Ae(t.message,t.entities)});const c=t.action&&function(e,t,n,s,a){if(e instanceof r.Api.MessageActionEmpty)return;let i,o,c;const d=[];let l,u="other";const g="users"in e?e.users&&e.users:"userId"in e&&[e.userId]||[];let p;if(e instanceof r.Api.MessageActionChatCreate)c="Notification.CreatedChatWithTitle",d.push("%action_origin%",e.title),u="chatCreate";else if(e instanceof r.Api.MessageActionChatEditTitle)s?(c="Channel.MessageTitleUpdated",d.push(e.title)):(c="Notification.ChangedGroupName",d.push("%action_origin%",e.title));else if(e instanceof r.Api.MessageActionChatEditPhoto)s?c="Channel.MessagePhotoUpdated":(c="Notification.ChangedGroupPhoto",d.push("%action_origin%"));else if(e instanceof r.Api.MessageActionChatDeletePhoto)c=s?"Channel.MessagePhotoRemoved":"Group.MessagePhotoRemoved";else if(e instanceof r.Api.MessageActionChatAddUser)!t||g.includes(t)?(c="Notification.JoinedChat",d.push("%target_user%")):(c="Notification.Invited",d.push("%action_origin%","%target_user%"));else if(e instanceof r.Api.MessageActionChatDeleteUser)!t||g.includes(t)?(c="Notification.LeftChat",d.push("%target_user%")):(c="Notification.Kicked",d.push("%action_origin%","%target_user%"));else if(e instanceof r.Api.MessageActionChatJoinedByLink)c="Notification.JoinedGroupByLink",d.push("%action_origin%");else if(e instanceof r.Api.MessageActionChannelCreate)c="Notification.CreatedChannel";else if(e instanceof r.Api.MessageActionChatMigrateTo)p=I(e),c="Migrated to %target_chat%",d.push("%target_chat%");else if(e instanceof r.Api.MessageActionChannelMigrateFrom)p=I(e),c="Migrated from %target_chat%",d.push("%target_chat%");else if(e instanceof r.Api.MessageActionPinMessage)c="Chat.Service.Group.UpdatedPinnedMessage1",d.push("%action_origin%","%message%");else if(e instanceof r.Api.MessageActionHistoryClear)c="HistoryCleared",u="historyClear";else if(e instanceof r.Api.MessageActionPhoneCall){const t=Boolean(e.duration);if(c=[t?"ChatList.Service":"Chat",e.video?"VideoCall":"Call",a?t?"outgoing":"Outgoing":t?"incoming":"Incoming"].join("."),t){const t=Math.max(Math.round(e.duration/60),1);d.push(`${t} min${t>1?"s":""}`)}}else if(e instanceof r.Api.MessageActionContactSignUp)c="Notification.Joined",d.push("%action_origin%"),u="contactSignUp";else if(e instanceof r.Api.MessageActionPaymentSent)i=Number(e.totalAmount),o=e.currency,c="PaymentSuccessfullyPaid",n&&g.push(n),d.push("%payment_amount%","%target_user%","%product%");else if(e instanceof r.Api.MessageActionGroupCall)if(e.duration){const t=Math.max(Math.round(e.duration/60),1);c="Notification.VoiceChatEnded",d.push(`${t} min${t>1?"s":""}`)}else c="Notification.VoiceChatStartedChannel";else e instanceof r.Api.MessageActionBotAllowed?(c="Chat.Service.BotPermissionAllowed",d.push(e.domain)):c="ChatList.UnsupportedMessage";return"photo"in e&&e.photo instanceof r.Api.Photo&&(be(e.photo),l=F(e.photo)),{text:c,type:u,targetUserIds:g,targetChatId:p,photo:l,amount:i,currency:o,translationValues:d}}(t.action,n,s,Boolean(t.post),i);c&&(o.action=c);const{replyToMsgId:d,replyToTopId:l}=t.replyTo||{},u=t.editDate&&!t.editHide,{inlineButtons:g,keyboardButtons:p,keyboardPlaceholder:f,isKeyboardSingleUse:h}=function(e){const{id:t,replyMarkup:n,media:s}=e;if(!n)return s instanceof r.Api.MessageMediaWebPage&&s.webpage instanceof r.Api.WebPage&&"telegram_message"===s.webpage.type?{inlineButtons:[[{type:"url",text:"Show Message",messageId:t,value:s.webpage.url}]]}:void 0;if(!(n instanceof r.Api.ReplyKeyboardMarkup||n instanceof r.Api.ReplyInlineMarkup))return;const a=n.rows.map((({buttons:e})=>e.map((e=>{let n,a,{text:i}=e;return e instanceof r.Api.KeyboardButton?(n="command",a=i):e instanceof r.Api.KeyboardButtonUrl?(n="url",a=e.url):e instanceof r.Api.KeyboardButtonCallback?(n="callback",a=String(e.data)):e instanceof r.Api.KeyboardButtonRequestPoll?n="requestPoll":e instanceof r.Api.KeyboardButtonBuy?(s instanceof r.Api.MessageMediaInvoice&&s.receiptMsgId&&(i="PaymentReceipt",a=s.receiptMsgId),n="buy"):n="NOT_SUPPORTED",{type:n,text:i,messageId:t,value:a}}))));return{[n instanceof r.Api.ReplyKeyboardMarkup?"keyboardButtons":"inlineButtons"]:a,...n instanceof r.Api.ReplyKeyboardMarkup&&{keyboardPlaceholder:n.placeholder,isKeyboardSingleUse:n.singleUse}}}(t)||{},m=t.fwdFrom&&function(e,t=!1){const n=e.savedFromPeer&&I(e.savedFromPeer),s=e.fromId&&I(e.fromId);return{isChannelPost:Boolean(e.channelPost),channelPostId:e.channelPost,isLinkedChannelPost:Boolean(e.channelPost&&n&&!t),fromChatId:n||s,fromMessageId:e.channelPost||e.savedFromMsgId,senderUserId:s,hiddenUserName:e.fromName,adminTitle:e.postAuthor}}(t.fwdFrom,a),{replies:_,mediaUnread:y,postAuthor:b}=t,w=t.groupedId&&t.groupedId.toString(),C=Boolean(w)&&!(o.document||o.audio),P=t.replyMarkup instanceof r.Api.ReplyKeyboardHide;return{id:t.id,chatId:e,isOutgoing:i,content:o,date:t.date,senderId:n||t.out&&t.post&&we||e,views:t.views,isFromScheduled:t.fromScheduled,...d&&{replyToMessageId:d},...l&&{replyToTopMessageId:l},...m&&{forwardInfo:m},...u&&{isEdited:u},...y&&{isMediaUnread:y},...t.mentioned&&y&&{hasUnreadMention:!0},...w&&{groupedId:w,isInAlbum:C},inlineButtons:g,...p&&{keyboardButtons:p,keyboardPlaceholder:f,isKeyboardSingleUse:h},...P&&{shouldHideKeyboardButtons:P},...t.viaBotId&&{viaBotId:t.viaBotId},...(null==_?void 0:_.comments)&&{threadInfo:Ve(_,t.id,e)},...b&&{adminTitle:b}}}function Ae(e,t){return{text:e,...t&&{entities:t.map(xe)}}}function Se(e){if(e instanceof r.Api.DraftMessageEmpty)return;const{message:t,entities:n,replyToMsgId:s,date:a}=e;return{formattedText:t?Ae(t,n):void 0,replyingToId:s,date:a}}function Me(e){const t=function(e){if(e instanceof r.Api.MessageMediaDocument&&e.document&&e.document instanceof r.Api.Document)return H(e.document)}(e);if(t)return{sticker:t};const n=function(e){if(e instanceof r.Api.MessageMediaPhoto&&e.photo&&e.photo instanceof r.Api.Photo&&!e.ttlSeconds)return F(e.photo)}(e);if(n)return{photo:n};const s=function(e){if(e instanceof r.Api.MessageMediaDocument&&e.document instanceof r.Api.Document&&e.document.mimeType.startsWith("video"))return ke(e.document)}(e);if(s)return{video:s};const a=function(e){if(!(e instanceof r.Api.MessageMediaDocument&&e.document&&e.document instanceof r.Api.Document))return;const t=e.document.attributes.find((e=>e instanceof r.Api.DocumentAttributeAudio));return t&&!t.voice?{fileName:Te(e.document,"audio"),...d(e.document,["size","mimeType"]),...d(t,["duration","performer","title"])}:void 0}(e);if(a)return{audio:a};const i=function(e){if(!(e instanceof r.Api.MessageMediaDocument&&e.document&&e.document instanceof r.Api.Document))return;const t=e.document.attributes.find((e=>e instanceof r.Api.DocumentAttributeAudio));if(!t||!t.voice)return;const{duration:n,waveform:s}=t;return{duration:n,waveform:s?Array.from(s):void 0}}(e);if(i)return{voice:i};const o=function(e){if(e instanceof r.Api.MessageMediaDocument&&e.document&&!e.ttlSeconds)return Re(e.document)}(e);if(o)return{document:o};const c=function(e){if(e instanceof r.Api.MessageMediaContact)return d(e,["firstName","lastName","phoneNumber","userId"])}(e);if(c)return{contact:c};const l=function(e){if(e instanceof r.Api.MessageMediaPoll)return Ue(e.poll,e.results)}(e);if(l)return{poll:l};const u=De(e);if(u)return{webPage:u};const g=function(e){if(e instanceof r.Api.MessageMediaInvoice)return function(e){const{description:t,title:n,photo:s,test:a,totalAmount:i,currency:o,receiptMsgId:r}=e;return{text:t,title:n,photoUrl:null==s?void 0:s.url,receiptMsgId:r,amount:Number(i),currency:o,isTest:a}}(e)}(e);return g?{invoice:g}:void 0}function ke(e){if(e instanceof r.Api.DocumentEmpty)return;const{id:t,mimeType:n,thumbs:s,size:a,attributes:i}=e,o=i.find((e=>e instanceof r.Api.DocumentAttributeVideo));if(!o)return;const c=i.find((e=>e instanceof r.Api.DocumentAttributeAnimated)),{duration:d,w:l,h:u,supportsStreaming:g=!1,roundMessage:p=!1}=o;return{id:String(t),mimeType:n,duration:d,fileName:Te(e,"video"),width:l,height:u,supportsStreaming:g,isRound:p,isGif:Boolean(c),thumbnail:N(s),size:a}}function Re(e){if(!(e instanceof r.Api.Document))return;const{id:t,size:n,mimeType:s,date:a,thumbs:i,attributes:o}=e,c=i&&N(i);let d,l;const u=i&&i.find((e=>e instanceof r.Api.PhotoSize));if(u)if(l={width:u.w,height:u.h},s.startsWith("image/")){d="photo";const e=o.find((e=>e instanceof r.Api.DocumentAttributeImageSize));if(e){const{w:t,h:n}=e;l={width:t,height:n}}}else s.startsWith("video/")&&(d="video");return{id:String(t),size:n,mimeType:s,timestamp:a,fileName:Te(e),thumbnail:c,mediaType:d,mediaSize:l}}function Ue(e,t){const{id:n,answers:s}=e,a=s.map((e=>({text:e.text,option:String.fromCharCode(...e.option)})));return{id:n.toString(),summary:{isPublic:e.publicVoters,...d(e,["closed","multipleChoice","quiz","question","closePeriod","closeDate"]),answers:a},results:Ee(t)}}function Ee(e){const{results:t,totalVoters:n,recentVoters:s,solution:a,solutionEntities:i}=e;return{totalVoters:n,recentVoterIds:s,results:t&&t.map((({option:e,chosen:t,correct:n,voters:s})=>({isChosen:t,isCorrect:n,option:String.fromCharCode(...e),votersCount:s}))),solution:a,...i&&{solutionEntities:i.map(xe)}}}function De(e){if(!(e instanceof r.Api.MessageMediaWebPage&&e.webpage instanceof r.Api.WebPage))return;const{id:t,photo:n,document:s}=e.webpage;let a;return s instanceof r.Api.Document&&s.mimeType.startsWith("video/")&&(a=ke(s)),{id:Number(t),...d(e.webpage,["url","displayUrl","type","siteName","title","description","duration"]),photo:n instanceof r.Api.Photo?F(n):void 0,document:!a&&s?Re(s):void 0,video:a}}function Te(e,t="file"){const{mimeType:n,attributes:s}=e,a=s.find((e=>e instanceof r.Api.DocumentAttributeFilename));if(a)return a.fileName;const i=n.split("/")[1];return`${t}${String(e.id)}.${i}`}function Be(e,t){return{poll:{id:t.toString(),summary:d(e.summary,["question","answers"]),results:{}}}}function xe(e){const{className:t,offset:n,length:s}=e;return{type:t,offset:n,length:s,..."userId"in e&&"number"==typeof e.userId&&{userId:e.userId},..."url"in e&&{url:e.url}}}function Ve(e,t,n){const{channelId:s,replies:a,maxId:i,readMaxId:o,recentRepliers:r}=e;if(777!==s)return{threadId:t,...n!==s?{chatId:I({channelId:s}),originChannelId:n}:{chatId:n},messagesCount:a,lastMessageId:i,lastReadInboxMessageId:o,...r&&{recentReplierIds:r.map(I)}}}function Ne(e){const{about:t,commonChatsCount:n,pinnedMsgId:s,botInfo:a,blocked:i}=e;return{...Fe(e.user),fullInfo:{bio:t,commonChatsCount:n,pinnedMessageId:s,isBlocked:Boolean(i),...a&&{botDescription:a.description},...a&&a.commands.length&&{botCommands:Le(e.user.id,a)}}}}function Fe(e){if(!(e instanceof r.Api.User))return;const{id:t,firstName:n,lastName:s}=e,a=e.photo instanceof r.Api.UserProfilePhoto?String(e.photo.photoId):void 0,i=(o=e).bot?"userTypeBot":o.deleted?"userTypeDeleted":"userTypeRegular";var o;return{id:t,isMin:Boolean(e.min),...e.self&&{isSelf:!0},...e.verified&&{isVerified:!0},...(e.contact||e.mutualContact)&&{isContact:!0},type:i,...n&&{firstName:n},..."userTypeBot"===i&&{canBeInvitedToGroup:!e.botNochats},...s&&{lastName:s},username:e.username||"",phoneNumber:e.phone||"",status:Oe(e.status),...e.accessHash&&{accessHash:String(e.accessHash)},...a&&{avatarHash:a},...e.bot&&e.botInlinePlaceholder&&{botPlaceholder:e.botInlinePlaceholder}}}function Oe(e){return!e||e instanceof r.Api.UserStatusEmpty?{type:"userStatusEmpty"}:e instanceof r.Api.UserStatusOnline?{type:"userStatusOnline",expires:e.expires}:e instanceof r.Api.UserStatusOffline?{type:"userStatusOffline",wasOnline:e.wasOnline}:e instanceof r.Api.UserStatusRecently?{type:"userStatusRecently"}:e instanceof r.Api.UserStatusLastWeek?{type:"userStatusLastWeek"}:{type:"userStatusLastMonth"}}function Le(e,t){return t.commands.map((({command:t,description:n})=>({botId:e,command:t,description:n})))}function qe(e){if(e instanceof r.Api.WallPaperNoFile)return;const{slug:t}=e,n=Re(e.document);return n?{slug:t,document:n}:void 0}function He(e){return{isCurrent:Boolean(e.current),isOfficialApp:Boolean(e.officialApp),isPasswordPending:Boolean(e.passwordPending),hash:String(e.hash),...d(e,["deviceModel","platform","systemVersion","appName","appVersion","dateCreated","dateActive","ip","country","region"])}}function Ge(e){let t,n,s,a,i;return e.forEach((e=>{e instanceof r.Api.PrivacyValueAllowAll?t=t||"everybody":e instanceof r.Api.PrivacyValueAllowContacts?t=t||"contacts":e instanceof r.Api.PrivacyValueDisallowContacts?t=t||"nonContacts":e instanceof r.Api.PrivacyValueDisallowAll?t=t||"nobody":e instanceof r.Api.PrivacyValueAllowUsers?n=e.users:e instanceof r.Api.PrivacyValueDisallowUsers?a=e.users:e instanceof r.Api.PrivacyValueAllowChatParticipants?s=e.chats.map((e=>-e)):e instanceof r.Api.PrivacyValueDisallowChatParticipants&&(i=e.chats.map((e=>-e)))})),t||(t="nobody"),{visibility:t,allowUserIds:n||[],allowChatIds:s||[],blockUserIds:a||[],blockChatIds:i||[]}}function Ke(e,t,n){const{silent:s,muteUntil:a,showPreviews:i,sound:o}=e;return{chatId:I(t),isMuted:s||"number"==typeof a&&f(n)e instanceof r.Api.User)).map(Fe).forEach((e=>{e&&Ie({"@type":"updateUser",id:e.id,user:e})})),s.filter((e=>e instanceof r.Api.Chat||e instanceof r.Api.Channel)).map((e=>w(e))).forEach((e=>{e&&Ie({"@type":"updateChat",id:e.id,chat:e})}))),e instanceof r.Api.UpdateNewScheduledMessage?Ie({"@type":We.has(t.id)?"updateScheduledMessage":"newScheduledMessage",id:t.id,chatId:t.chatId,message:t}):Ie({"@type":We.has(t.id)?"updateMessage":"newMessage",id:t.id,chatId:t.chatId,message:t}),e.message instanceof r.Api.MessageService){const{action:n}=e.message;if(n instanceof r.Api.MessageActionChatEditTitle)Ie({"@type":"updateChat",id:t.chatId,chat:{title:n.title}});else if(n instanceof r.Api.MessageActionChatEditPhoto){const s=function(e){if(e instanceof r.Api.PhotoEmpty)return new r.Api.ChatPhotoEmpty;const{dcId:t,id:n}=e;return new r.Api.ChatPhoto({dcId:t,photoId:n})}(n.photo),a=M(s),i=Math.abs(_e(e.message));L.chats[i]&&(L.chats[i].photo=s),be(n.photo),a&&Ie({"@type":"updateChat",id:t.chatId,chat:{avatarHash:a},...n.photo instanceof r.Api.Photo&&{newProfilePhoto:F(n.photo)}})}else if(n instanceof r.Api.MessageActionChatDeletePhoto){const n=Math.abs(_e(e.message));L.chats[n]&&(L.chats[n].photo=new r.Api.ChatPhotoEmpty),Ie({"@type":"updateChat",id:t.chatId,chat:{avatarHash:void 0}})}else n instanceof r.Api.MessageActionChatDeleteUser?e._entities&&e._entities.some((e=>e instanceof r.Api.User&&!!e.self&&e.id===n.userId))&&(Ie({"@type":"updateChat",id:t.chatId,chat:{isRestricted:!0}}),Ie({"@type":"updateChatLeave",id:t.chatId})):n instanceof r.Api.MessageActionChatAddUser&&e._entities&&e._entities.some((e=>e instanceof r.Api.User&&!!e.self&&n.users.includes(e.id)))&&Ie({"@type":"updateChatJoin",id:t.chatId})}}else if(e instanceof r.Api.UpdateEditMessage||e instanceof r.Api.UpdateEditChannelMessage){if(e.message instanceof r.Api.MessageEmpty)return;e.message instanceof r.Api.Message&&le(e.message)&&ye(e.message);const t=Pe(e.message);Ie({"@type":"updateMessage",id:t.id,chatId:t.chatId,message:t})}else if(e instanceof r.Api.UpdateDeleteMessages)Ie({"@type":"deleteMessages",ids:e.messages});else if(e instanceof r.Api.UpdateDeleteScheduledMessages)Ie({"@type":"deleteScheduledMessages",ids:e.messages,chatId:C(e.peer)});else if(e instanceof r.Api.UpdateDeleteChannelMessages){const t=I({channelId:e.channelId}),n=e.messages,s=n.filter((e=>L.messages[`${t}-${e}`])),a=n.filter((e=>!L.messages[`${t}-${e}`])),i=n.map((e=>{const n=L.messages[`${t}-${e}`];return n&&n instanceof r.Api.MessageService&&"photo"in n.action?String(n.action.photo.id):void 0})).filter(Boolean);s.length&&Ie({"@type":"deleteMessages",ids:s,chatId:t}),i.length&&Ie({"@type":"deleteProfilePhotos",ids:i,chatId:t}),a.length&&setTimeout((()=>{Ie({"@type":"deleteMessages",ids:a,chatId:t})}),1e3)}else if((t instanceof r.Api.messages.SendMessage||t instanceof r.Api.messages.SendMedia||t instanceof r.Api.messages.SendMultiMedia||t instanceof r.Api.messages.ForwardMessages)&&(e instanceof r.Api.UpdateMessageID||e instanceof r.Api.UpdateShortSentMessage)){let n;"randomId"in e?n=e.randomId:"randomId"in t&&(n=t.randomId);const s=n&&L.localMessages[n.toString()];if(!s)throw new Error("Local message not found");let a;if(e instanceof r.Api.UpdateShortSentMessage){s.content.text&&e.entities&&(a={text:Ae(s.content.text.text,e.entities)}),e.media&&(a={...a,...Me(e.media)});const t=re(e.id,s.chatId,e);le(t)&&ye(t)}We.add(e.id);const i="date"in e&&1e3*e.dateString.fromCharCode(...e)))});else if(e instanceof r.Api.UpdateChannelMessageViews)Ie({"@type":"updateMessage",chatId:I({channelId:e.channelId}),id:e.id,message:{views:e.views}});else if(e instanceof r.Api.UpdateReadHistoryInbox)Ie({"@type":"updateChatInbox",id:I(e.peer),chat:{lastReadInboxMessageId:e.maxId,unreadCount:e.stillUnreadCount}});else if(e instanceof r.Api.UpdateReadHistoryOutbox)Ie({"@type":"updateChat",id:I(e.peer),chat:{lastReadOutboxMessageId:e.maxId}});else if(e instanceof r.Api.UpdateReadChannelInbox)Ie({"@type":"updateChat",id:I({channelId:e.channelId}),chat:{lastReadInboxMessageId:e.maxId,unreadCount:e.stillUnreadCount}});else if(e instanceof r.Api.UpdateReadChannelOutbox)Ie({"@type":"updateChat",id:I({channelId:e.channelId}),chat:{lastReadOutboxMessageId:e.maxId}});else if(e instanceof r.Api.UpdateDialogPinned&&e.peer instanceof r.Api.DialogPeer)Ie({"@type":"updateChatPinned",id:I(e.peer.peer),isPinned:e.pinned||!1});else if(e instanceof r.Api.UpdatePinnedDialogs){const t=e.order?e.order.filter((e=>e instanceof r.Api.DialogPeer)).map((e=>I(e.peer))):[];Ie({"@type":"updatePinnedChatIds",ids:t,folderId:e.folderId||void 0})}else if(e instanceof r.Api.UpdateFolderPeers)e.folderPeers.forEach((e=>{const{folderId:t,peer:n}=e;Ie({"@type":"updateChatListType",id:I(n),folderId:t})}));else if(e instanceof r.Api.UpdateDialogFilter){const{id:t,filter:n}=e,s=n?E(n):void 0;Ie({"@type":"updateChatFolder",id:t,folder:s})}else if(e instanceof r.Api.UpdateDialogFilterOrder)Ie({"@type":"updateChatFoldersOrder",orderedIds:e.order});else if(e instanceof r.Api.UpdateChatParticipants){const t=R(e.participants);Ie({"@type":"updateChatMembers",id:I({chatId:e.participants.chatId}),replacedMembers:t})}else if(e instanceof r.Api.UpdateChatParticipantAdd){const t=k(d(e,["userId","inviterId","date"]));Ie({"@type":"updateChatMembers",id:I({chatId:e.chatId}),addedMember:t})}else if(e instanceof r.Api.UpdateChatParticipantDelete){const{userId:t}=e;Ie({"@type":"updateChatMembers",id:I({chatId:e.chatId}),deletedMemberId:t})}else if(e instanceof r.Api.UpdatePinnedMessages||e instanceof r.Api.UpdatePinnedChannelMessages){const t=I(e instanceof r.Api.UpdatePinnedMessages?e.peer:{channelId:e.channelId});Ie({"@type":"updatePinnedIds",chatId:t,messageIds:e.messages,isPinned:e.pinned})}else if(e instanceof r.Api.UpdateNotifySettings&&e.peer instanceof r.Api.NotifyPeer)Ie({"@type":"updateNotifyExceptions",...Ke(e.notifySettings,e.peer.peer,je)});else if(e instanceof r.Api.UpdateUserTyping||e instanceof r.Api.UpdateChatUserTyping){const t=e instanceof r.Api.UpdateUserTyping?e.userId:I({chatId:e.chatId});Ie({"@type":"updateChatTypingStatus",id:t,typingStatus:U(e,je)})}else if(e instanceof r.Api.UpdateChannelUserTyping){const t=I({channelId:e.channelId});Ie({"@type":"updateChatTypingStatus",id:t,typingStatus:U(e,je)})}else if(e instanceof r.Api.UpdateChannel){const{_entities:t}=e;if(!t)return;const n=t.find((e=>e instanceof r.Api.Channel||e instanceof r.Api.ChannelForbidden));if(n instanceof r.Api.Channel){const t=w(n);t&&(Ie({"@type":"updateChat",id:t.id,chat:t}),Ie({"@type":t.isNotJoined?"updateChatLeave":"updateChatJoin",id:I({channelId:e.channelId})}))}else if(n instanceof r.Api.ChannelForbidden){const t=I({channelId:e.channelId});Ie({"@type":"updateChat",id:t,chat:{isRestricted:!0}}),Ie({"@type":"updateChatLeave",id:t})}else 0===t.length&&Ie({"@type":"resetMessages",id:I({chatId:e.channelId})})}else if(e instanceof r.Api.UpdateDialogUnreadMark&&e.peer instanceof r.Api.DialogPeer)Ie({"@type":"updateChat",id:I(e.peer.peer),chat:{hasUnreadMark:e.unread}});else if(e instanceof r.Api.UpdateChatDefaultBannedRights)Ie({"@type":"updateChat",id:I(e.peer),chat:{defaultBannedRights:p(e.defaultBannedRights)}});else if(e instanceof r.Api.UpdateUserStatus){const{userId:t,status:n}=e;Ie({"@type":"updateUserStatus",userId:t,status:Oe(n)})}else if(e instanceof r.Api.UpdateUserName){const t=L.users[e.userId],n=null!=t&&t.mutualContact&&!t.self?d(e,["username"]):d(e,["firstName","lastName","username"]);Ie({"@type":"updateUser",id:e.userId,user:n})}else if(e instanceof r.Api.UpdateUserPhoto){const{userId:t,photo:n}=e,s=M(n);L.users[t]&&(L.users[t].photo=n),Ie({"@type":"updateUser",id:t,user:{avatarHash:s}})}else if(e instanceof r.Api.UpdateUserPhone){const{userId:t,phone:n}=e;Ie({"@type":"updateUser",id:t,user:{phoneNumber:n}})}else if(e instanceof r.Api.UpdatePeerSettings){const{_entities:t}=e;if(!t)return;null!=t&&t.length&&(t.filter((e=>e instanceof r.Api.User&&!e.contact)).forEach((e=>{Ie({"@type":"deleteUser",id:e.id})})),t.filter((e=>e instanceof r.Api.User&&e.contact)).map(Fe).forEach((e=>{e&&Ie({"@type":"updateUser",id:e.id,user:e})})))}else if(e instanceof r.Api.UpdateNotifySettings){const{notifySettings:{showPreviews:t,silent:n,muteUntil:s},peer:{className:a}}=e,i="NotifyUsers"===a?"contact":"NotifyChats"===a?"group":"NotifyBroadcasts"===a?"broadcast":void 0;if(!i)return;Ie({"@type":"updateNotifySettings",peerType:i,isSilent:Boolean(n||"number"==typeof s&&Date.now()+1e3*je<1e3*s),shouldShowPreviews:Boolean(t)})}else if(e instanceof r.Api.UpdatePeerBlocked)Ie({"@type":"updatePeerBlocked",id:I(e.peerId),isBlocked:e.blocked});else if(e instanceof r.Api.UpdatePrivacy){const t=function(e){switch(e.className){case"PrivacyKeyPhoneNumber":return"phoneNumber";case"PrivacyKeyStatusTimestamp":return"lastSeen";case"PrivacyKeyProfilePhoto":return"profilePhoto";case"PrivacyKeyForwards":return"forwards";case"PrivacyKeyChatInvite":return"chatInvite"}}(e.key);t&&Ie({"@type":"updatePrivacy",key:t,rules:Ge(e.rules)})}else e instanceof r.Api.UpdateDraftMessage?Ie({"@type":"draftMessage",chatId:I(e.peer),...Se(e.draft)}):e instanceof r.Api.UpdateContactsReset?Ie({"@type":"updateResetContactList"}):e instanceof r.Api.UpdateFavedStickers&&Ie({"@type":"updateFavoriteStickers"});var n}const Je={PHONE_NUMBER_INVALID:"PHONE_NUMBER_INVALID",PHONE_CODE_INVALID:"PHONE_CODE_INVALID",PASSWORD_HASH_INVALID:"PASSWORD_HASH_INVALID",PHONE_PASSWORD_FLOOD:"You have tried logging in too many times"},Qe={};let Xe;function Ze(){return Xe(at("authorizationStateWaitPhoneNumber")),new Promise(((e,t)=>{Qe.resolve=e,Qe.reject=t}))}function Ye(e=!1){return Xe({...at("authorizationStateWaitCode"),isCodeViaApp:e}),new Promise(((e,t)=>{Qe.resolve=e,Qe.reject=t}))}function et(e){return Xe({...at("authorizationStateWaitPassword"),hint:e}),new Promise((e=>{Qe.resolve=e}))}function tt(){return Xe(at("authorizationStateWaitRegistration")),new Promise((e=>{Qe.resolve=e}))}function nt(e){return Xe({...at("authorizationStateWaitQrCode"),qrCode:{token:btoa(String.fromCharCode(...e.token)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),expires:e.expires}}),new Promise(((e,t)=>{Qe.reject=t}))}function st(e){let t;if(e instanceof r.errors.FloodWaitError){const n=Math.ceil(Number(e.seconds)/60/60);t="Too many attempts. Try again in "+(n>1?`${n} hours`:"an hour")}else t=Je[e.message];t||(t="Unexpected Error"),Xe({"@type":"updateAuthorizationError",message:t})}function at(e){return{"@type":"updateAuthorizationState",authorizationState:e}}function it(e){Qe.resolve&&Qe.resolve(e)}function ot(e){Qe.resolve&&Qe.resolve(e)}function rt(e){Qe.resolve&&Qe.resolve(e)}function ct(e){const{firstName:t,lastName:n}=e;Qe.resolve&&Qe.resolve([t,n])}function dt(){Qe.reject&&Qe.reject(new Error("RESTART_AUTH"))}function lt(){Qe.reject&&Qe.reject(new Error("RESTART_AUTH_WITH_QR"))}var ut=n(9832),gt=n(5802);function pt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}"undefined"==typeof File&&(self.File=class extends Blob{constructor(e,t,n){if(n){const{type:t,...s}=n;super(e,{type:t}),pt(this,"name",void 0),Object.assign(this,s)}else super(e),pt(this,"name",void 0);this.name=t}});const ft=self.caches;let ht;async function mt(e,t,n,s=!1){if(ft)try{const a=new Request(t.replace(/:/g,"_")),i=await ft.open(e),o=await i.match(a);if(!o)return;switch(n){case ht.Text:return await o.text();case ht.Blob:{const e=await o.blob();if("sticker"===t.substr(0,7))return new Blob([e],{type:"image/webp"});if(!e.type){const t=o.headers.get("Content-Type");if(t)return new Blob([e],{type:s?t:t.replace(/html/gi,"")})}return!s&&e.type.includes("html")?new Blob([e],{type:e.type.replace(/html/gi,"")}):e}case ht.Json:return await o.json();default:return}}catch(e){return void console.warn(e)}}async function _t(e,t,n){if(ft)try{const s="string"==typeof n||n instanceof Blob?n:JSON.stringify(n),a=new Request(t.replace(/:/g,"_")),i=new Response(s),o=await ft.open(e);return await o.put(a,i)}catch(e){return void console.warn(e)}}async function yt(e){try{if(!ft)return;return await ft.delete(e)}catch(e){return void console.warn(e)}}!function(e){e[e.Text=0]="Text",e[e.Blob=1]="Blob",e[e.Json=2]="Json"}(ht||(ht={}));const bt=new Set(["msg","sticker","gif","wallpaper","photo","webDocument"]);function wt(e,t="image/jpeg"){if(e.length<4)return t;let n=t;switch(e.subarray(0,4).reduce(((e,t)=>e+t.toString(16)),"")){case"89504e47":n="image/png";break;case"47494638":n="image/gif";break;case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":case"ffd8ffe3":case"ffd8ffe8":n="image/jpeg";break;case"52494646":n="image/webp"}return n}ut.Logger.setLevel("warn");const It={build:e=>e};let Ct,Pt,vt=!1;async function At(){await Rt(new r.Api.auth.LogOut),await Pt.destroy()}async function St(){await Pt.disconnect()}function Mt(e){Ct({"@type":"updateSession",sessionData:e})}function kt(e){e instanceof r.connection.UpdateConnectionState?vt=e.state===r.connection.UpdateConnectionState.connected:e instanceof r.Api.UpdatesTooLong?async function(){try{await Rt(new r.Api.users.GetFullUser({id:new r.Api.InputUserSelf}),void 0,!0)}catch(e){"AUTH_KEY_UNREGISTERED"===e.message&&Ct({"@type":"updateConnectionState",connectionState:"connectionStateBroken"})}}():e instanceof r.connection.UpdateServerTimeOffset&&Ct({"@type":"updateServerTimeOffset",serverTimeOffset:e.timeOffset})}async function Rt(e,t=!1,n=!1){if(vt)try{const n=await Pt.invoke(e);if(t){let t;n instanceof r.Api.Updates||n instanceof r.Api.UpdatesCombined?t=n:"updates"in n&&(n.updates instanceof r.Api.Updates||n.updates instanceof r.Api.UpdatesCombined)&&(t=n.updates),t?(function(e){const t=[...e.users,...e.chats];e.updates.forEach((e=>{t&&(e._entities=t)}))}(t),t.updates.forEach((t=>{$e(t,e)}))):n instanceof r.Api.UpdatesTooLong||$e(n,e)}return n}catch(t){if(function(e,t){const n=e.message.startsWith("A wait of")&&(t instanceof r.Api.messages.SendMessage||t instanceof r.Api.messages.SendMedia||t instanceof r.Api.messages.SendMultiMedia),{message:s}=e;Ct({"@type":"error",error:{message:s,isSlowMode:n,hasErrorKey:!0}})}(t,e),n)throw t;return}}function Ut(e,t){return async function({url:e,mediaFormat:t,start:n,end:a,isHtmlAllowed:i},o,c,d){const{data:l,mimeType:u,fullSize:g}=await async function(e,t,n,s,a,i,o,c){const d=e.startsWith("webDocument")?e.match(/(webDocument):(.+)/):e.match(/(avatar|profile|photo|msg|stickerSet|sticker|wallpaper|gif|file)([-\d\w./]+)(\?size=\w+)?/);if(!d)return;if("file"===d[1]){const e=await fetch(d[2]);return{data:await e.arrayBuffer()}}if(!n)return Promise.reject(new Error("ERROR: Client is not connected"));let l,u=d[2];const g=d[3]?d[3].replace("?size=",""):void 0;let p;switch("avatar"===d[1]||"profile"===d[1]?(l=Z(Number(u)),u=Math.abs(Number(u))):l=d[1],l){case"channel":case"chat":p=L.chats[u];break;case"user":p=L.users[u];break;case"msg":p=L.messages[u];break;case"sticker":case"gif":case"wallpaper":p=L.documents[u];break;case"photo":p=L.photos[u];break;case"stickerSet":p=L.stickerSets[u];break;case"webDocument":p=L.webDocuments[u]}if(p){if(bt.has(l)){o===Q.Stream&&(s.acceptsBuffer=!0);const e=await t.downloadMedia(p,{sizeType:g,start:a,end:i,progressCallback:s,workers:16});let n,d;return p instanceof r.Api.Message?(n=function(e,t){if(e&&e.media)return e.media instanceof r.Api.MessageMediaPhoto?"image/jpeg":e.media instanceof r.Api.MessageMediaDocument&&e.media.document instanceof r.Api.Document?t?e.media.document.attributes.some((e=>e instanceof r.Api.DocumentAttributeSticker))?"image/webp":"image/jpeg":e.media.document.mimeType:e.media instanceof r.Api.MessageMediaWebPage&&e.media.webpage instanceof r.Api.WebPage&&e.media.webpage.document instanceof r.Api.Document?e.media.webpage.document.mimeType:void 0}(p,g),p.media instanceof r.Api.MessageMediaDocument&&p.media.document instanceof r.Api.Document&&(d=p.media.document.size),p.media instanceof r.Api.MessageMediaWebPage&&p.media.webpage instanceof r.Api.WebPage&&p.media.webpage.document instanceof r.Api.Document&&(d=p.media.webpage.document.size)):p instanceof r.Api.Photo?n="image/jpeg":"sticker"===l&&g?n="image/webp":"webDocument"===l?n=p.mimeType:(n=p.mimeType,d=p.size),!c&&n&&(n=n.replace(/html/gi,"")),{mimeType:n,data:e,fullSize:d}}if("stickerSet"===l){const e=await t.downloadStickerSetThumb(p);return{mimeType:o===Q.Lottie?"application/json":wt(e),data:e}}{const e=await t.downloadProfilePhoto(p,"profile"===d[1]);return{mimeType:wt(e),data:e}}}}(e,o,c,d,n,a,t,i)||{};if(!l)return;const p=await async function(e,t,n){switch(t){case Q.DataUri:return s=new Blob([e],{type:n}),new Promise(((e,t)=>{const n=new FileReader;n.onload=n=>{const{result:s}=n.target||{};"string"==typeof s&&e(s),t(new Error("Failed to read blob"))},n.onerror=t,n.readAsDataURL(s)}));case Q.BlobUrl:return new Blob([e],{type:n});case Q.Lottie:{const t=(0,gt.inflate)(e,{to:"string"});return JSON.parse(t)}case Q.Progressive:return e.buffer}var s}(l,t,u);if(!p)return;const f=t!==Q.Progressive&&(t!==Q.BlobUrl||p.size<=524288);return s&&f&&_t(e.startsWith("avatar")?"tt-media-avatars":"tt-media",e,p),{prepared:t===Q.Progressive?"":(h=p,h instanceof Blob?URL.createObjectURL(h):h),arrayBuffer:t===Q.Progressive?p:void 0,mimeType:u,fullSize:g};var h}(e,Pt,vt,t)}function Et(e,t){return Pt.uploadFile({file:e,onProgress:t,workers:16})}function Dt(e){return Pt.updateTwoFaSettings(e)}async function Tt(){const e=await Rt(new r.Api.users.GetFullUser({id:new r.Api.InputUserSelf}));if(!(e&&e.user instanceof r.Api.User))return;L.users[e.user.id]=e.user;const t=Ne(e);var n;n=t.id,we=n,function(e){Xe({"@type":"updateCurrentUser",currentUser:e})}(t)}const Bt=2**31-1;let xt;async function Vt({limit:e,offsetDate:t,archived:n,withPinned:s,serverTimeOffset:a}){const i=await Rt(new r.Api.messages.GetDialogs({offsetPeer:new r.Api.InputPeerEmpty,limit:e,offsetDate:t,folderId:n?1:void 0,...s&&{excludePinned:!0}})),o=s?await Rt(new r.Api.messages.GetPinnedDialogs({folderId:n?1:void 0})):void 0;if(!i||i instanceof r.Api.messages.DialogsNotModified)return;o&&Cn(o),Cn(i);const d=c((o?o.messages:[]).concat(i.messages).map(Pe).filter(Boolean),"chatId"),l={...o&&In(o),...In(i)},u=[],g={},p={},f=(o?o.dialogs:[]).concat(i.dialogs),h=[];f.forEach((e=>{if(!(e instanceof r.Api.Dialog)||!n&&1===e.folderId||n&&1!==e.folderId)return;const t=m(e,l[v(e.peer)],a);if(t.lastMessage=d[t.id],t.isListed=!0,u.push(t),s&&e.pinned&&h.push(t.id),e.draft){const{formattedText:n,replyingToId:s}=Se(e.draft)||{};n&&(g[t.id]=n),s&&(p[t.id]=s)}}));const _=(o?o.users:[]).concat(i.users).map(Fe).filter(Boolean),y=u.map((e=>e.id));let b;return b=i instanceof r.Api.messages.DialogsSlice?i.count:y.length,{chatIds:y,chats:u,users:_,draftsById:g,replyingToById:p,orderedPinnedIds:s?h:void 0,totalChatCount:b}}function Nt(e){const{id:t,accessHash:n,adminRights:s}=e;return ne(t,n)instanceof r.Api.InputChannel?async function(e,t,n){const s=await Rt(new r.Api.channels.GetFullChannel({channel:ne(e,t)}));if(!(s&&s.fullChat instanceof r.Api.ChannelFull))return;const{about:a,onlineCount:i,exportedInvite:o,slowmodeSeconds:c,slowmodeNextSendDate:d,migratedFromChatId:l,migratedFromMaxId:u,canViewParticipants:g,linkedChatId:p,hiddenPrehistory:f,call:h,botInfo:m}=s.fullChat,_=o instanceof r.Api.ChatInviteExported?o.link:void 0,{members:y,users:b}=g&&await fn(e,t)||{},{members:w,users:C}=g&&n&&await fn(e,t,"kicked")||{},{members:P,users:v}=g&&n&&await fn(e,t,"admin")||{},A=m?T(m):void 0;return{fullInfo:{about:a,onlineCount:i,inviteLink:_,slowMode:c?{seconds:c,nextSendDate:d}:void 0,migratedFrom:l?{chatId:I({chatId:l}),maxMessageId:u}:void 0,canViewMembers:g,isPreHistoryHidden:f,members:y,kickedMembers:w,adminMembers:P,groupCallId:h?h.id.toString():void 0,linkedChatId:p?I({chatId:p}):void 0,botCommands:A},users:[...b||[],...C||[],...v||[]]}}(t,n,s):async function(e){const t=await Rt(new r.Api.messages.GetFullChat({chatId:ne(e)}));if(!(t&&t.fullChat instanceof r.Api.ChatFull))return;Cn(t);const{about:n,participants:s,exportedInvite:a,botInfo:i}=t.fullChat,o=R(s),c=o?o.filter((({isAdmin:e,isOwner:t})=>e||t)):void 0;return{fullInfo:{about:n,members:o,adminMembers:c,canViewMembers:!0,botCommands:i?T(i):void 0,...a&&{inviteLink:a.link}},users:t.users.map(Fe).filter(Boolean)}}(t)}async function Ft({query:e}){const t=await Rt(new r.Api.contacts.Search({q:e}));if(!t)return;Cn(t);const n=t.myResults.map(I),s=t.chats.concat(t.users).map((e=>w(e))).filter(Boolean),a=t.users.map(Fe).filter((e=>!!e&&!e.isSelf));return{localChats:s.filter((e=>n.includes(e.id))),localUsers:a.filter((e=>n.includes(e.id))),globalChats:s.filter((e=>!n.includes(e.id))),globalUsers:a.filter((e=>!n.includes(e.id)))}}async function Ot({type:e,user:t}){let n;if("self"===e||"user"===e){const s=await Rt(new r.Api.users.GetUsers({id:["user"===e&&t?ne(t.id,t.accessHash):new r.Api.InputUserSelf]}));if(!s||!s.length)return;[n]=s}else if("support"===e){const e=await Rt(new r.Api.help.GetSupport);if(!e||!e.user)return;n=e.user}const s=w(n,"support"===e);if(s)return xt({"@type":"updateChat",id:s.id,chat:s}),{chatId:s.id}}async function Lt({chat:e,serverTimeOffset:t}){const{id:n,accessHash:s}=e,a=await Rt(new r.Api.messages.GetPeerDialogs({peers:[new r.Api.InputDialogPeer({peer:ee(n,s)})]}));if(!a)return;const i=a.dialogs[0];if(!(i&&i instanceof r.Api.Dialog))return;const o=In(a)[v(i.peer)];if(!o)return;Cn(a);const c=Pe(a.messages[0]);xt({"@type":"updateChat",id:n,chat:{...m(i,o,t),lastMessage:c}})}function qt({chat:e,text:t,entities:n,replyToMsgId:s}){return Rt(new r.Api.messages.SaveDraft({peer:ee(e.id,e.accessHash),message:t,...n&&{entities:n.map(ce)},replyToMsgId:s}))}function Ht(e){return Rt(new r.Api.messages.SaveDraft({peer:ee(e.id,e.accessHash),message:""}))}async function Gt({chat:e,isMuted:t,serverTimeOffset:n}){await Rt(new r.Api.account.UpdateNotifySettings({peer:new r.Api.InputNotifyPeer({peer:ee(e.id,e.accessHash)}),settings:new r.Api.InputPeerNotifySettings({muteUntil:t?Bt:0})})),xt({"@type":"updateNotifyExceptions",chatId:e.id,isMuted:t}),Lt({chat:e,serverTimeOffset:n})}async function Kt({title:e,about:t,users:n}){const s=await Rt(new r.Api.channels.CreateChannel({broadcast:!0,title:e,about:t}),!0);if(!(s instanceof r.Api.Updates))return;const a=s.chats[0];if(!(a&&a instanceof r.Api.Channel))return;const i=w(a);return await Rt(new r.Api.channels.InviteToChannel({channel:ne(i.id,i.accessHash),users:n.map((({id:e,accessHash:t})=>ne(e,t)))})),i}function zt({channelId:e,accessHash:t}){return Rt(new r.Api.channels.JoinChannel({channel:ne(e,t)}),!0)}function Wt({chat:e,user:t}){if("chatTypeBasicGroup"===e.type)return Rt(new r.Api.messages.DeleteChatUser({chatId:ne(e.id,e.accessHash),userId:ne(t.id,t.accessHash)}),!0)}function jt({chatId:e}){return Rt(new r.Api.messages.DeleteChat({chatId:ne(e)}),!0)}function $t({channelId:e,accessHash:t}){return Rt(new r.Api.channels.LeaveChannel({channel:ne(e,t)}),!0)}function Jt({channelId:e,accessHash:t}){return Rt(new r.Api.channels.DeleteChannel({channel:ne(e,t)}),!0)}async function Qt({title:e,users:t}){const n=await Rt(new r.Api.messages.CreateChat({title:e,users:t.map((({id:e,accessHash:t})=>ne(e,t)))}),!0);if(!(n instanceof r.Api.Updates))return;const s=n.chats[0];return s&&s instanceof r.Api.Chat?w(s):void 0}async function Xt({chatId:e,accessHash:t,photo:n}){const s=await Et(n),a=ne(e,t);return Rt(a instanceof r.Api.InputChannel?new r.Api.channels.EditPhoto({channel:a,photo:new r.Api.InputChatUploadedPhoto({file:s})}):new r.Api.messages.EditChatPhoto({chatId:a,photo:new r.Api.InputChatUploadedPhoto({file:s})}),!0)}async function Zt({chat:e,shouldBePinned:t}){const{id:n,accessHash:s}=e;await Rt(new r.Api.messages.ToggleDialogPin({peer:new r.Api.InputDialogPeer({peer:ee(n,s)}),pinned:t||void 0}))&&xt({"@type":"updateChatPinned",id:e.id,isPinned:t})}function Yt({chat:e,folderId:t}){const{id:n,accessHash:s}=e;return Rt(new r.Api.folders.EditPeerFolders({folderPeers:[new r.Api.InputFolderPeer({peer:ee(n,s),folderId:t})]}),!0)}async function en(){const e=await Rt(new r.Api.messages.GetDialogFilters);if(e)return{byId:c(e.map(E),"id"),orderedIds:e.map((({id:e})=>e))}}async function tn(){const e=await Rt(new r.Api.messages.GetSuggestedDialogFilters);if(e)return e.map(D)}async function nn({id:e,folderUpdate:t}){const n=function(e){const{emoticon:t,contacts:n,nonContacts:s,groups:a,channels:i,bots:o,excludeArchived:c,excludeMuted:d,excludeRead:l,pinnedChatIds:u,includedChatIds:g,excludedChatIds:p}=e,f=u?u.map(te).filter(Boolean):[],h=g?g.map(te).filter(Boolean):[],m=p?p.map(te).filter(Boolean):[];return new r.Api.DialogFilter({id:e.id,title:e.title,emoticon:t||void 0,contacts:n||void 0,nonContacts:s||void 0,groups:a||void 0,bots:o||void 0,excludeArchived:c||void 0,excludeMuted:d||void 0,excludeRead:l||void 0,broadcasts:i||void 0,pinnedPeers:f,includePeers:h,excludePeers:m})}(t);await Rt(new r.Api.messages.UpdateDialogFilter({id:e,filter:n}))&&xt({"@type":"updateChatFolder",id:e,folder:t})}async function sn(e){const t=await Rt(new r.Api.messages.UpdateDialogFilter({id:e,filter:void 0})),n=await tn();t&&xt({"@type":"updateChatFolder",id:e,folder:void 0}),n&&xt({"@type":"updateRecommendedChatFolders",folders:n})}async function an({chat:e,hasUnreadMark:t}){const{id:n,accessHash:s}=e;await Rt(new r.Api.messages.MarkDialogUnread({peer:new r.Api.InputDialogPeer({peer:ee(n,s)}),unread:t||void 0}))&&xt({"@type":"updateChat",id:e.id,chat:{hasUnreadMark:t}})}async function on(e){const t=await Rt(new r.Api.contacts.ResolveUsername({username:e}));if(!t)return;const{users:n,chats:s}=t,a=s.length?w(s[0]):w(n[0]);return a?(Cn(t),a):void 0}function rn({chat:e,isEnabled:t}){const{id:n,accessHash:s}=e,a=ne(n,s);return Rt(new r.Api.channels.TogglePreHistoryHidden({channel:a,enabled:t}),!0)}function cn({chat:e,bannedRights:t}){const{id:n,accessHash:s}=e,a=ee(n,s);return Rt(new r.Api.messages.EditChatDefaultBannedRights({peer:a,bannedRights:ge(t)}),!0)}function dn({chat:e,user:t,bannedRights:n,untilDate:s}){const a=ne(e.id,e.accessHash),i=ee(t.id,t.accessHash);return Rt(new r.Api.channels.EditBanned({channel:a,participant:i,bannedRights:ge(n,s)}),!0)}function ln({chat:e,user:t,adminRights:n,customTitle:s=""}){const a=ne(e.id,e.accessHash),i=ne(t.id,t.accessHash);return Rt(new r.Api.channels.EditAdmin({channel:a,userId:i,adminRights:pe(n),rank:s}),!0)}async function un(e,t){const n=ne(e.id,e.accessHash);await Rt(n instanceof r.Api.InputChannel?new r.Api.channels.EditTitle({channel:n,title:t}):new r.Api.messages.EditChatTitle({chatId:n,title:t}),!0)}async function gn(e,t){await Rt(new r.Api.messages.EditChatAbout({peer:ee(e.id,e.accessHash),about:t}))&&xt({"@type":"updateChatFullInfo",id:e.id,fullInfo:{about:t}})}function pn({chat:e,isEnabled:t}){const{id:n,accessHash:s}=e,a=ne(n,s);return Rt(new r.Api.channels.ToggleSignatures({channel:a,enabled:t}),!0)}async function fn(e,t,n="recent",s){let a;switch(n){case"kicked":a=new r.Api.ChannelParticipantsKicked({q:""});break;case"admin":a=new r.Api.ChannelParticipantsAdmins;break;default:a=new r.Api.ChannelParticipantsRecent}const i=await Rt(new r.Api.channels.GetParticipants({channel:ne(e,t),filter:a,offset:s,limit:200}));if(i&&!(i instanceof r.Api.channels.ChannelParticipantsNotModified))return Cn(i),{members:R(i),users:i.users.map(Fe).filter(Boolean)}}async function hn(){const e=await Rt(new r.Api.channels.GetGroupsForDiscussion);if(e)return Cn(e),e.chats.map((e=>w(e)))}function mn({channel:e,chat:t}){return Rt(new r.Api.channels.SetDiscussionGroup({broadcast:ee(e.id,e.accessHash),group:t?ee(t.id,t.accessHash):new r.Api.InputChannelEmpty}))}async function _n(e){const t=await Rt(new r.Api.messages.MigrateChat({chatId:ne(e.id)}),!0);if(t&&t instanceof r.Api.Updates)return Cn(t),w(t.chats[1])}async function yn(e){const t=await Rt(new r.Api.messages.CheckChatInvite({hash:e}));if(!t)return;let n;return t instanceof r.Api.ChatInvite?xt({"@type":"showInvite",data:{title:t.title,hash:e,participantsCount:t.participantsCount,isChannel:t.channel}}):(n=w(t.chat),n&&xt({"@type":"updateChat",id:n.id,chat:n})),n?{chatId:n.id}:void 0}function bn(e,t){return"chatTypeChannel"===e.type||"chatTypeSuperGroup"===e.type?Rt(new r.Api.channels.InviteToChannel({channel:ne(e.id,e.accessHash),users:t.map((e=>ne(e.id,e.accessHash)))}),!0):Promise.all(t.map((t=>Rt(new r.Api.messages.AddChatUser({chatId:ne(e.id),userId:ne(t.id,t.accessHash)}),!0))))}function wn(e,t){return"chatTypeChannel"===e.type||"chatTypeSuperGroup"===e.type?dn({chat:e,user:t,bannedRights:{viewMessages:!0,sendMessages:!0,sendMedia:!0,sendStickers:!0,sendGifs:!0,sendGames:!0,sendInline:!0,embedLinks:!0,sendPolls:!0,changeInfo:!0,inviteUsers:!0,pinMessages:!0},untilDate:Bt}):Rt(new r.Api.messages.DeleteChatUser({chatId:ne(e.id),userId:ne(t.id,t.accessHash)}),!0)}function In(e){const t={};return e.chats.forEach((e=>{t[`chat${e.id}`]=e})),e.users.forEach((e=>{t[`user${e.id}`]=e})),t}function Cn(e){"users"in e&&e.users.forEach((e=>{e instanceof r.Api.User&&(L.users[e.id]=e)})),"chats"in e&&e.chats.forEach((e=>{(e instanceof r.Api.Chat||e instanceof r.Api.Channel)&&(L.chats[e.id]=e)})),"messages"in e&&e.messages.forEach((e=>{e instanceof r.Api.Message&&le(e)&&ye(e)}))}async function Pn({hash:e}){const t=await Rt(new r.Api.messages.ImportChatInvite({hash:e}),!0);if(t instanceof r.Api.Updates&&t.chats.length)return w(t.chats[0])}var vn=n(8764).Buffer;let An;async function Sn({chat:e,threadId:t,...n}){const s=-1===t?r.Api.messages.GetHistory:r.Api.messages.GetReplies;let a;try{a=await Rt(new s({peer:ee(e.id,e.accessHash),...-1!==t&&{msgId:t},...n}),void 0,!0)}catch(t){"CHANNEL_PRIVATE"===t.message&&An({"@type":"updateChat",id:e.id,chat:{isRestricted:!0}})}if(!a||a instanceof r.Api.messages.MessagesNotModified||!a.messages)return;Zn(a);const i=a.messages.map(Pe).filter(Boolean),o=a.users.map(Fe).filter(Boolean),c=a.chats.map((e=>w(e))).filter(Boolean),d=i.map((({threadInfo:e})=>e)).filter(Boolean);return{messages:i,users:o,chats:c,threadInfos:d}}async function Mn({chat:e,messageId:t}){const n="channel"===Z(e.id),s=await Rt(n?new r.Api.channels.GetMessages({channel:ne(e.id,e.accessHash),id:[new r.Api.InputMessageID({id:t})]}):new r.Api.messages.GetMessages({id:[new r.Api.InputMessageID({id:t})]}));if(!s||s instanceof r.Api.messages.MessagesNotModified)return;const a=s.messages[0];if(!a)return;if(a instanceof r.Api.MessageEmpty)return"MESSAGE_DELETED";const i=a&&Pe(a);return i?(a instanceof r.Api.Message&&ye(a),{message:i,users:s.users.map(Fe).filter(Boolean)}):void 0}let kn=Promise.resolve();function Rn({chat:e,text:t,entities:n,replyingTo:s,attachment:a,sticker:i,gif:o,poll:c,isSilent:d,scheduledAt:l,groupedId:u,noWebPage:g,serverTimeOffset:p},f){const h=function(e,t,n,s,a,i,o,r,c,d,l=0){const u=Ce++,g=a&&function(e){const{filename:t,blobUrl:n,previewBlobUrl:s,mimeType:a,size:i}=e;if(e.quick){const{width:o,height:r,duration:c}=e.quick;return a.startsWith("image/")?{photo:{id:"temp",sizes:[],thumbnail:{width:o,height:r,dataUri:""},blobUrl:n}}:{video:{id:"temp",mimeType:a,duration:c||0,fileName:t,width:o,height:r,blobUrl:n,...s&&{thumbnail:{width:o,height:r,dataUri:s}},size:i}}}if(e.voice){const{duration:t,waveform:n}=e.voice,{data:s}=z(n,63);return{voice:{duration:t,waveform:s}}}return a.startsWith("audio/")?{audio:{mimeType:a,fileName:t,size:i,duration:200}}:{document:{mimeType:a,fileName:t,size:i,...s&&{previewBlobUrl:s}}}}(a),p="chatTypeChannel"===e.type;return{id:u,chatId:e.id,content:{...t&&{text:{text:t,entities:n}},...g,...i&&{sticker:i},...o&&{video:o},...r&&Be(r,u)},date:d||Math.round(Date.now()/1e3)+l,isOutgoing:!p,senderId:we,...s&&{replyToMessageId:s},...c&&{groupedId:c,...g&&(g.photo||g.video)&&{isInAlbum:!0}},...d&&{isScheduled:!0}}}(e,t,n,s,a,i,o,c,u,l,p);An({"@type":h.isScheduled?"newScheduledMessage":"newMessage",id:h.id,chatId:e.id,message:h}),setTimeout((()=>{An({"@type":h.isScheduled?"updateScheduledMessage":"updateMessage",id:h.id,chatId:e.id,message:{sendingState:"messageSendingStatePending"}})}),1e3);const m=oe();if(L.localMessages[m.toString()]=h,u)return function({chat:e,text:t,entities:n,replyingTo:s,attachment:a,groupedId:i,isSilent:o,scheduledAt:c},d,l,u){let g=-1;Un[i]||(Un[i]={counter:0,singleMediaByIndex:{}}),g=Un[i].counter++;const p=kn;return kn=(async()=>{let f;try{f=await Tn(l,a,u)}catch(e){return Un[i].counter--,void await p}const h=await async function(e,t){const n=await Rt(new r.Api.messages.UploadMedia({peer:e,media:t}));if(n instanceof r.Api.MessageMediaPhoto&&n.photo&&n.photo instanceof r.Api.Photo){const{photo:{id:e,accessHash:t,fileReference:s}}=n;return new r.Api.InputMediaPhoto({id:new r.Api.InputPhoto({id:e,accessHash:t,fileReference:s})})}if(n instanceof r.Api.MessageMediaDocument&&n.document&&n.document instanceof r.Api.Document){const{document:{id:e,accessHash:t,fileReference:s}}=n;return new r.Api.InputMediaDocument({id:new r.Api.InputDocument({id:e,accessHash:t,fileReference:s})})}}(ee(e.id,e.accessHash),f);if(await p,!h)return void Un[i].counter--;if(Un[i].singleMediaByIndex[g]=new r.Api.InputSingleMedia({media:h,randomId:d,message:t||"",entities:n?n.map(ce):void 0}),Object.keys(Un[i].singleMediaByIndex).length{let u;if(a)try{u=await Tn(h,a,f)}catch(e){return void await _}else i?u=ie(i):o?u=ie(o):c&&(u=function(e,t){const{summary:n,quiz:s}=e,a=new r.Api.Poll({id:t,publicVoters:n.isPublic,question:n.question,answers:n.answers.map((({text:e,option:t})=>new r.Api.PollAnswer({text:e,option:X.from(t)}))),quiz:n.quiz,multipleChoice:n.multipleChoice});if(!s)return new r.Api.InputMediaPoll({poll:a});const i=s.correctAnswers.map((e=>X.from(e))),{solution:o}=s,c=s.solutionEntities?s.solutionEntities.map(ce):[];return new r.Api.InputMediaPoll({poll:a,correctAnswers:i,...o&&{solution:o,solutionEntities:c}})}(c,m));await _;const p=u?r.Api.messages.SendMedia:r.Api.messages.SendMessage;await Rt(new p({clearDraft:!0,message:t||"",entities:n?n.map(ce):void 0,peer:ee(e.id,e.accessHash),randomId:m,...d&&{silent:d},...l&&{scheduleDate:l},...s&&{replyToMsgId:s},...u&&{media:u},...g&&{noWebpage:g}}),!0)})(),kn}const Un={};async function En({chat:e,message:t,text:n,entities:s,noWebPage:a,serverTimeOffset:i}){const o=1e3*t.date>Date.now()+1e3*i,c={content:{...t.content,...n&&{text:{text:n,entities:s}}}};An({"@type":o?"updateScheduledMessage":"updateMessage",id:t.id,chatId:e.id,message:c}),L.localMessages[t.id]={...t,...c};const d=s&&s.map(ce);await Rt(new r.Api.messages.EditMessage({message:n||"",entities:d,peer:ee(e.id,e.accessHash),id:t.id,...o&&{scheduleDate:t.date},...a&&{noWebpage:a}}),!0)}async function Dn({chat:e,message:t,scheduledAt:n}){await Rt(new r.Api.messages.EditMessage({peer:ee(e.id,e.accessHash),id:t.id,scheduleDate:n}),!0)}async function Tn(e,t,n){const{filename:s,blobUrl:a,mimeType:i,quick:o,voice:c}=t,d=await async function(e,t){return function(e,t){return new File([e],t,{lastModified:Date.now(),type:e.type})}(await async function(e){return(await fetch(e)).blob()}(e),t)}(a,s),l=t=>{n.isCanceled?l.isCanceled=!0:n(t,e.id)},u=await Et(d,l),g=[new r.Api.DocumentAttributeFilename({fileName:s})];if(o){if(i.startsWith("image/"))return new r.Api.InputMediaUploadedPhoto({file:u});{const{width:e,height:t,duration:n}=o;void 0!==n&&g.push(new r.Api.DocumentAttributeVideo({duration:n,w:e,h:t}))}}if(c){const{duration:e,waveform:t}=c,{data:n}=z(t,63);g.push(new r.Api.DocumentAttributeAudio({voice:!0,duration:e,waveform:vn.from(n)}))}return new r.Api.InputMediaUploadedDocument({file:u,mimeType:i,attributes:g})}async function Bn({chat:e,messageId:t,isUnpin:n,isOneSide:s,isSilent:a}){await Rt(new r.Api.messages.UpdatePinnedMessage({peer:ee(e.id,e.accessHash),id:t,...n&&{unpin:!0},...s&&{pmOneside:!0},...a&&{silent:!0}}),!0)}async function xn({chat:e}){await Rt(new r.Api.messages.UnpinAllMessages({peer:ee(e.id,e.accessHash)}),!0)}async function Vn({chat:e,messageIds:t,shouldDeleteForAll:n}){const s="channel"===Z(e.id);await Rt(s?new r.Api.channels.DeleteMessages({channel:ne(e.id,e.accessHash),id:t}):new r.Api.messages.DeleteMessages({id:t,...n&&{revoke:!0}}))&&An({"@type":"deleteMessages",ids:t,...s&&{chatId:e.id}})}async function Nn({chat:e,messageIds:t}){await Rt(new r.Api.messages.DeleteScheduledMessages({peer:ee(e.id,e.accessHash),id:t}))&&An({"@type":"deleteScheduledMessages",ids:t,chatId:e.id})}async function Fn({chat:e,shouldDeleteForAll:t,maxId:n}){const s="channel"===Z(e.id);await Rt(s?new r.Api.channels.DeleteHistory({channel:ne(e.id,e.accessHash),maxId:n}):new r.Api.messages.DeleteHistory({peer:ee(e.id,e.accessHash),...t&&{revoke:!0},...!t&&{just_clear:!0},maxId:n}))&&An({"@type":"deleteHistory",chatId:e.id})}async function On({peer:e,messageIds:t,reason:n,description:s}){return await Rt(new r.Api.messages.Report({peer:ee(e.id,e.accessHash),id:t,reason:me(n),message:s}))}async function Ln({chat:e,threadId:t,maxId:n,serverTimeOffset:s}){const a="channel"===Z(e.id);a&&-1===t?await Rt(new r.Api.channels.ReadHistory({channel:ne(e.id,e.accessHash),maxId:n})):a?await Rt(new r.Api.messages.ReadDiscussion({peer:ee(e.id,e.accessHash),msgId:t,readMaxId:n})):await Rt(new r.Api.messages.ReadHistory({peer:ee(e.id,e.accessHash),maxId:n})),-1===t?Lt({chat:e,serverTimeOffset:s}):Hn({chat:e,threadId:t})}async function qn({chat:e,messageIds:t}){const n="channel"===Z(e.id);await Rt(n?new r.Api.channels.ReadMessageContents({channel:ne(e.id,e.accessHash),id:t}):new r.Api.messages.ReadMessageContents({id:t})),An({...n?{"@type":"updateChannelMessages",channelId:e.id}:{"@type":"updateCommonBoxMessages"},ids:t,messageUpdate:{hasUnreadMention:!1,isMediaUnread:!1}})}async function Hn({chat:e,threadId:t}){const[n,s]=await Promise.all([Rt(new r.Api.messages.GetDiscussionMessage({peer:ee(e.id,e.accessHash),msgId:t})),Rt(new r.Api.messages.GetReplies({peer:ee(e.id,e.accessHash),msgId:t,offsetId:1,addOffset:-1,limit:1}))]);if(!n||!n.messages.length)return;const a=_e(n.messages[0]);a&&(An({"@type":"updateThreadInfo",chatId:a,threadId:t,threadInfo:{topMessageId:n.messages[n.messages.length-1].id,lastReadInboxMessageId:n.readInboxMaxId,messagesCount:s instanceof r.Api.messages.ChannelMessages?s.count:void 0},firstMessageId:s&&"messages"in s&&s.messages.length?s.messages[0].id:void 0}),n.chats.map((e=>w(e))).filter(Boolean).forEach((e=>{An({"@type":"updateChat",id:e.id,chat:e,noTopChatsRequest:!0})})))}async function Gn({chatOrUser:e,type:t,query:n,topMessageId:s,minDate:a,maxDate:i,...o}){let c;switch(t){case"media":c=new r.Api.InputMessagesFilterPhotoVideo;break;case"documents":c=new r.Api.InputMessagesFilterDocument;break;case"links":c=new r.Api.InputMessagesFilterUrl;break;case"audio":c=new r.Api.InputMessagesFilterMusic;break;case"voice":c=new r.Api.InputMessagesFilterVoice;break;case"profilePhoto":c=new r.Api.InputMessagesFilterChatPhotos;break;case"text":default:c=new r.Api.InputMessagesFilterEmpty}const d=await Rt(new r.Api.messages.Search({peer:ee(e.id,e.accessHash),filter:c,q:n||"",topMsgId:s,minDate:a,maxDate:i,...o}));if(!d||d instanceof r.Api.messages.MessagesNotModified||!d.messages)return;Zn(d);const l=d.messages.map(Pe).filter(Boolean),u=d.users.map(Fe).filter(Boolean);let g,p=l.length;return(d instanceof r.Api.messages.MessagesSlice||d instanceof r.Api.messages.ChannelMessages)&&(p=d.count,l.length&&(g=l[l.length-1].id)),{messages:l,users:u,totalCount:p,nextOffsetId:g}}async function Kn({query:e,offsetRate:t=0,limit:n,type:s="text",minDate:a,maxDate:i}){let o;switch(s){case"media":o=new r.Api.InputMessagesFilterPhotoVideo;break;case"documents":o=new r.Api.InputMessagesFilterDocument;break;case"links":o=new r.Api.InputMessagesFilterUrl;break;case"audio":o=new r.Api.InputMessagesFilterMusic;break;case"voice":o=new r.Api.InputMessagesFilterVoice;break;case"text":default:if(!(e||i&&a))return;o=new r.Api.InputMessagesFilterEmpty}const c=await Rt(new r.Api.messages.SearchGlobal({q:e,offsetRate:t,offsetPeer:new r.Api.InputPeerEmpty,limit:n,filter:o,folderId:0,minDate:a,maxDate:i}));if(!c||c instanceof r.Api.messages.MessagesNotModified||!c.messages)return;Zn({chats:c.chats,users:c.users,messages:c.messages});const d=c.chats.map((e=>w(e))).filter(Boolean),l=c.users.map(Fe).filter(Boolean),u=c.messages.map(Pe).filter(Boolean);let g,p=u.length;return(c instanceof r.Api.messages.MessagesSlice||c instanceof r.Api.messages.ChannelMessages)&&(p=c.count,u.length&&(g=u[u.length-1].id)),{messages:u,users:l,chats:d,totalCount:p,nextRate:"nextRate"in c&&c.nextRate?c.nextRate:g}}async function zn({message:e}){const t=await Rt(new r.Api.messages.GetWebPagePreview({message:e}));return t&&De(t)}async function Wn({chat:e,messageId:t,options:n}){const{id:s,accessHash:a}=e;await Rt(new r.Api.messages.SendVote({peer:ee(s,a),msgId:t,options:n.map((e=>vn.from(e)))}),!0)}async function jn({chat:e,messageId:t,option:n,offset:s,limit:a,shouldResetVoters:i}){const{id:o,accessHash:c}=e,d=await Rt(new r.Api.messages.GetPollVotes({peer:ee(o,c),id:t,...n&&{option:vn.from(n)},...s&&{offset:s},...a&&{limit:a}}));if(!d)return;Zn({chats:[],users:d.users,messages:[]});const l=d.users.map(Fe).filter(Boolean),u=d.votes.map((e=>({userId:e.userId,date:e.date})));return{count:d.count,votes:u,users:l,nextOffset:d.nextOffset,shouldResetVoters:i}}async function $n({fromChat:e,toChat:t,messages:n,serverTimeOffset:s}){const a=n.map((({id:e})=>e)),i=n.map(oe);n.forEach(((e,n)=>{const a=function(e,t,n){const s=Ce++,{content:a,chatId:i,id:o,senderId:r,groupedId:c,isInAlbum:d}=t,l=a.audio,u=e.id===we&&(i!==e.id||t.forwardInfo)&&!l;return{id:s,chatId:e.id,content:a,date:Math.round(Date.now()/1e3)+n,isOutgoing:!u&&"chatTypeChannel"!==e.type,senderId:we,sendingState:"messageSendingStatePending",...r!==we&&!l&&{forwardInfo:{isChannelPost:!1,fromChatId:i,fromMessageId:o,senderUserId:r}},groupedId:c,isInAlbum:d}}(t,e,s);L.localMessages[String(i[n])]=a,An({"@type":"newMessage",id:a.id,chatId:t.id,message:a})})),await Rt(new r.Api.messages.ForwardMessages({fromPeer:ee(e.id,e.accessHash),toPeer:ee(t.id,t.accessHash),randomId:i,id:a}),!0)}async function Jn({chat:e,timestamp:t}){const n=await Rt(new r.Api.messages.GetHistory({peer:ee(e.id,e.accessHash),offsetDate:t,addOffset:-1,limit:1}));if(n&&!(n instanceof r.Api.messages.MessagesNotModified)&&n.messages&&n.messages.length)return n.messages[0].id}async function Qn({chat:e,hash:t=0}){const{id:n,accessHash:s}=e,a=await Rt(new r.Api.messages.GetScheduledHistory({peer:ee(n,s),hash:t}));if(!a||a instanceof r.Api.messages.MessagesNotModified||!a.messages)return;Zn(a);const i=a.messages.map(Pe).filter(Boolean);return{messages:i,hash:de(i.map((e=>e.id)))}}async function Xn({chat:e,ids:t}){const{id:n,accessHash:s}=e;await Rt(new r.Api.messages.SendScheduledMessages({peer:ee(n,s),id:t}),!0)}function Zn(e){e.users.forEach((e=>{e instanceof r.Api.User&&(L.users[e.id]=e)})),e.chats.forEach((e=>{(e instanceof r.Api.Chat||e instanceof r.Api.Channel)&&(L.chats[e.id]=e)})),e.messages.forEach((e=>{(e instanceof r.Api.Message&&le(e)||e instanceof r.Api.MessageService&&function(e){return"photo"in e.action&&e.action.photo instanceof r.Api.Photo}(e))&&ye(e)}))}async function Yn({chat:e}){const t=await Rt(new r.Api.messages.Search({peer:ee(e.id,e.accessHash),filter:new r.Api.InputMessagesFilterPinned,q:"",limit:50}));if(t&&!(t instanceof r.Api.messages.MessagesNotModified)&&t.messages)return Zn(t),{messages:t.messages.map(Pe).filter(Boolean),users:t.users.map(Fe).filter(Boolean),chats:t.chats.map((e=>w(e))).filter(Boolean)}}let es,ts,ns,ss;async function as({id:e,accessHash:t}){const n=ne(e,t);if(!(n instanceof r.Api.InputUser))return;const s=await Rt(new r.Api.users.GetFullUser({id:n}));if(!s)return;const a=Ne(s);es({"@type":"updateUser",id:e,user:{fullInfo:a.fullInfo}})}async function is(){const e=await Rt(new r.Api.help.GetNearestDc);return null==e?void 0:e.country}async function os({langCode:e="en"}){const t=await Rt(new r.Api.help.GetCountriesList({langCode:e}));if(t instanceof r.Api.help.CountriesList)return n=t.countries,{phoneCodes:(s=n.filter((e=>!e.hidden)).map((e=>e.countryCodes.map((t=>ze(e,t))))),s.reduce(((e,t)=>Array.isArray(t)?e.concat(t):(e.push(t),e)),[])).sort(((e,t)=>e.name?e.name.localeCompare(t.name):e.defaultName.localeCompare(t.defaultName))),general:n.filter((e=>!e.hidden)).map((e=>ze(e))).sort(((e,t)=>e.name?e.name.localeCompare(t.name):e.defaultName.localeCompare(t.defaultName)))};var n,s}async function rs({hash:e=0}){const t=await Rt(new r.Api.contacts.GetTopPeers({hash:e,correspondents:!0}));if(!(t instanceof r.Api.contacts.TopPeers))return;const n=t.users.map(Fe).filter((e=>!!e&&!e.isSelf)),s=n.map((({id:e})=>e));return{hash:de(s),ids:s,users:n}}async function cs({hash:e=0}){const t=await Rt(new r.Api.contacts.GetContacts({hash:e}));if(t&&!(t instanceof r.Api.contacts.ContactsNotModified))return t.users.forEach((e=>{e instanceof r.Api.User&&(L.users[e.id]=e)})),{hash:de([t.savedCount,...t.contacts.map((({userId:e})=>e))]),users:t.users.map(Fe).filter(Boolean),chats:t.users.map((e=>w(e))).filter(Boolean)}}async function ds({users:e}){const t=await Rt(new r.Api.users.GetUsers({id:e.map((({id:e,accessHash:t})=>ee(e,t)))}));if(t&&t.length)return t.forEach((e=>{e instanceof r.Api.User&&(L.users[e.id]=e)})),t.map(Fe).filter(Boolean)}function ls({phone:e,firstName:t,lastName:n}){return Rt(new r.Api.contacts.ImportContacts({contacts:[ue({phone:e||"",firstName:t||"",lastName:n||""})]}))}async function us({id:e,accessHash:t}){const n=ne(e,t);n instanceof r.Api.InputUser&&await Rt(new r.Api.contacts.DeleteContacts({id:[n]}))&&es({"@type":"deleteUser",id:e})}async function gs(e,t){if(e){const{id:t,accessHash:n}=e,s=await Rt(new r.Api.photos.GetUserPhotos({userId:ne(t,n),limit:40,offset:0,maxId:j()("0")}));if(!s)return;return function(e){e.photos.forEach(be)}(s),{photos:s.photos.filter((e=>e instanceof r.Api.Photo)).map(F)}}const n=await Gn({chatOrUser:t,type:"profilePhoto",limit:40});if(!n)return;const{messages:s,users:a}=n;return{photos:s.map((e=>e.content.action.photo)).filter(Boolean),users:a}}async function ps({hash:e}){const t=await Rt(new r.Api.messages.GetAllStickers({hash:e}));if(t&&!(t instanceof r.Api.messages.AllStickersNotModified))return t.sets.forEach((e=>{var t;null!==(t=e.thumbs)&&void 0!==t&&t.length&&(L.stickerSets[String(e.id)]=e)})),{hash:t.hash,sets:t.sets.map(G)}}async function fs({hash:e}){const t=await Rt(new r.Api.messages.GetRecentStickers({hash:e}));if(t&&!(t instanceof r.Api.messages.RecentStickersNotModified))return{hash:t.hash,stickers:Ms(t.stickers.slice(0,20))}}async function hs({hash:e}){const t=await Rt(new r.Api.messages.GetFavedStickers({hash:e}));if(t&&!(t instanceof r.Api.messages.FavedStickersNotModified))return{hash:t.hash,stickers:Ms(t.stickers)}}async function ms({hash:e}){const t=await Rt(new r.Api.messages.GetFeaturedStickers({hash:e}));if(t&&!(t instanceof r.Api.messages.FeaturedStickersNotModified))return{hash:t.hash,sets:t.sets.map(K)}}async function _s({sticker:e,unfave:t}){const n=new r.Api.messages.FaveSticker({id:ae(e),unfave:t});await Rt(n)&&ts({"@type":"updateFavoriteStickers"})}async function ys({stickerSetShortName:e,stickerSetId:t,accessHash:n}){const s=await Rt(new r.Api.messages.GetStickerSet({stickerset:t?se(t,n):(a=e,new r.Api.InputStickerSetShortName({shortName:a}))}));var a,i;if(s)return{set:G(s.set),stickers:Ms(s.documents),packs:(i=s.packs,i.reduce(((e,{emoticon:t,documents:n})=>(e[t]=n.map((e=>H(L.documents[String(e)]))).filter(Boolean),e)),{}))}}async function bs(){const e=await Rt(new r.Api.messages.GetStickerSet({stickerset:new r.Api.InputStickerSetAnimatedEmoji}));if(e)return{set:G(e.set),stickers:Ms(e.documents)}}async function ws({query:e,hash:t}){const n=await Rt(new r.Api.messages.SearchStickerSets({q:e,hash:t}));if(n&&!(n instanceof r.Api.messages.FoundStickerSetsNotModified))return{hash:n.hash,sets:n.sets.map(K)}}async function Is({hash:e}){const t=await Rt(new r.Api.messages.GetSavedGifs({hash:e}));if(t&&!(t instanceof r.Api.messages.SavedGifsNotModified))return{hash:t.hash,gifs:ks(t.gifs)}}async function Cs({stickerSetId:e,accessHash:t}){await Rt(new r.Api.messages.InstallStickerSet({stickerset:se(e,t)}))&&ts({"@type":"updateStickerSet",id:e,stickerSet:{installedDate:Date.now()}})}async function Ps({stickerSetId:e,accessHash:t}){await Rt(new r.Api.messages.UninstallStickerSet({stickerset:se(e,t)}))&&ts({"@type":"updateStickerSet",id:e,stickerSet:{installedDate:void 0}})}async function vs({query:e,offset:t=""}){if(!ns){const e=await Rt(new r.Api.help.GetConfig);if(!e)return;const t=await Rt(new r.Api.contacts.ResolveUsername({username:e.gifSearchUsername}));if(!(t&&t.users[0]instanceof r.Api.User))return;ns=new r.Api.InputUser({userId:t.peer.userId,accessHash:t.users[0].accessHash})}const n=await Rt(new r.Api.messages.GetInlineBotResults({bot:ns,peer:new r.Api.InputPeerEmpty,query:e,offset:t}));if(!n)return;const s=n.results.map((e=>{if(e instanceof r.Api.BotInlineMediaResult)return e.document})).filter(Boolean);return{nextOffset:n.nextOffset,gifs:ks(s)}}async function As({emoji:e,hash:t=0}){const n=await Rt(new r.Api.messages.GetStickers({emoticon:e,hash:t}));if(n&&!(n instanceof r.Api.messages.StickersNotModified))return{stickers:Ms(n.stickers),hash:n.hash}}async function Ss({language:e,fromVersion:t}){const n=await Rt(new r.Api.messages.GetEmojiKeywordsDifference({langCode:e,fromVersion:t}));if(n)return{language:n.langCode,version:n.version,keywords:n.keywords.reduce(((e,t)=>(e[t.keyword]=t.emoticons,e)),{})}}function Ms(e){return e.map((e=>{if(e instanceof r.Api.Document){const t=H(e);if(t)return L.documents[String(e.id)]=e,t}})).filter(Boolean)}function ks(e){return e.map((e=>{if(e instanceof r.Api.Document){const t=ke(e);if(t)return L.documents[String(e.id)]=e,t}})).filter(Boolean)}async function Rs({username:e}){try{return await Rt(new r.Api.channels.CheckUsername({channel:new r.Api.InputChannelEmpty,username:e}),void 0,!0)}catch(e){return!1}}async function Us({chat:e,username:t}){await Rt(new r.Api.channels.UpdateUsername({channel:ne(e.id,e.accessHash),username:t}))&&ss({"@type":"updateChat",id:e.id,chat:{username:t}})}async function Es({chat:e}){const t=await Rt(new r.Api.messages.ExportChatInvite({peer:ee(e.id,e.accessHash)}));t&&t instanceof r.Api.ChatInviteExported&&ss({"@type":"updateChatFullInfo",id:e.id,fullInfo:{inviteLink:t.link}})}const Ds={EMAIL_UNCONFIRMED:"Email unconfirmed",EMAIL_HASH_EXPIRED:"Email hash expired",NEW_SALT_INVALID:"The new salt is invalid",NEW_SETTINGS_INVALID:"The new password settings are invalid",CODE_INVALID:"Invalid Code",PASSWORD_HASH_INVALID:"Invalid Password"},Ts={};let Bs;async function xs(){const e=await Rt(new r.Api.account.GetPassword);if(!e)return;const{hint:t,hasPassword:n}=e;return{hint:t,hasPassword:n}}function Vs(e){return Bs({"@type":"updateTwoFaStateWaitCode",length:e}),new Promise(((e,t)=>{Ts.resolve=e,Ts.reject=t}))}async function Ns(e){try{return await Dt({isCheckPassword:!0,currentPassword:e}),!0}catch(e){return Hs(e),!1}}async function Fs(e){try{return await Dt({currentPassword:e}),!0}catch(e){return Hs(e),!1}}async function Os(e,t,n,s){try{return await Dt({currentPassword:e,newPassword:t,hint:n,email:s,emailCodeCallback:Vs,onEmailCodeError:Hs}),!0}catch(e){return Hs(e),!1}}async function Ls(e,t){try{return await Dt({currentPassword:e,newPassword:e,email:t,emailCodeCallback:Vs,onEmailCodeError:Hs}),!0}catch(e){return Hs(e),!1}}function qs(e){Ts.resolve(e)}function Hs(e){let t;if(e instanceof r.errors.FloodWaitError){const n=Math.ceil(Number(e.seconds)/60/60);t="Too many attempts. Try again in "+(n>1?`${n} hours`:"an hour")}else t=Ds[e.message];t||(t="Unexpected Error"),Bs({"@type":"updateTwoFaError",message:t})}const Gs=["ar","fa","id","ko","uz"];function Ks({firstName:e,lastName:t,about:n}){return Rt(new r.Api.account.UpdateProfile({firstName:e||"",lastName:t||"",about:n||""}))}function zs(e){return Rt(new r.Api.account.CheckUsername({username:e}))}function Ws(e){return Rt(new r.Api.account.UpdateUsername({username:e}))}async function js(e){const t=await Et(e);return Rt(new r.Api.photos.UploadProfilePhoto({file:t}))}async function $s(e){const t=await Et(e);await Rt(new r.Api.photos.UploadProfilePhoto({file:t}))}async function Js(e){const t=await Rt(new r.Api.account.GetWallPapers({hash:e}));if(!t||t instanceof r.Api.account.WallPapersNotModified)return;const n=t.wallpapers.filter((e=>e instanceof r.Api.WallPaper&&e.document instanceof r.Api.Document&&!e.pattern&&"application/x-tgwallpattern"!==e.document.mimeType));return n.forEach((e=>{L.documents[String(e.document.id)]=e.document})),{hash:t.hash,wallpapers:n.map(qe).filter(Boolean)}}async function Qs(e){const t=await Et(e),n=await Rt(new r.Api.account.UploadWallPaper({file:t,mimeType:e.type,settings:new r.Api.WallPaperSettings}));if(!(n&&n instanceof r.Api.WallPaper))return;const s=qe(n);return s?(L.documents[String(n.document.id)]=n.document,{wallpaper:s}):void 0}async function Xs(){const e=await Rt(new r.Api.contacts.GetBlocked({limit:100}));if(e)return _a(e),{users:e.users.map(Fe).filter(Boolean),chats:e.chats.map((e=>w(e,void 0,!0))).filter(Boolean),blockedIds:e.blocked.map((e=>I(e.peerId))),totalCount:e instanceof r.Api.contacts.BlockedSlice?e.count:e.blocked.length}}function Zs(e,t){return Rt(new r.Api.contacts.Block({id:ee(e,t)}))}function Ys(e,t){return Rt(new r.Api.contacts.Unblock({id:ee(e,t)}))}async function ea(){const e=await Rt(new r.Api.account.GetAuthorizations);if(e)return e.authorizations.map(He)}function ta(e){return Rt(new r.Api.account.ResetAuthorization({hash:j()(e)}))}function na(){return Rt(new r.Api.auth.ResetAuthorizations)}async function sa({serverTimeOffset:e}){const t=await Rt(new r.Api.account.GetNotifyExceptions({compareSound:!0}));if(t instanceof r.Api.Updates||t instanceof r.Api.UpdatesCombined)return _a(t),t.updates.reduce(((t,n)=>n instanceof r.Api.UpdateNotifySettings&&n.peer instanceof r.Api.NotifyPeer?(t.push(Ke(n.notifySettings,n.peer.peer,e)),t):t),[])}async function aa({serverTimeOffset:e}){const[t,n,s,a]=await Promise.all([Rt(new r.Api.account.GetContactSignUpNotification),Rt(new r.Api.account.GetNotifySettings({peer:new r.Api.InputNotifyUsers})),Rt(new r.Api.account.GetNotifySettings({peer:new r.Api.InputNotifyChats})),Rt(new r.Api.account.GetNotifySettings({peer:new r.Api.InputNotifyBroadcasts}))]);if(!n||!s||!a)return!1;const{silent:i,muteUntil:o,showPreviews:c}=n,{silent:d,muteUntil:l,showPreviews:u}=s,{silent:g,muteUntil:p,showPreviews:h}=a;return{hasContactJoinedNotifications:!t,hasPrivateChatsNotifications:!(i||"number"==typeof o&&f(e)Rt(new r.Api.langpack.GetLangPack({langPack:e,langCode:Gs.includes(t)?`${t}-raw`:t})))))).filter(Boolean).map((e=>c(e.strings.map(p),"key")));if(n.length)return{langPack:Object.assign({},...n.reverse())}}async function da({langPack:e,langCode:t,keys:n}){const s=await Rt(new r.Api.langpack.GetStrings({langPack:e,langCode:Gs.includes(t)?`${t}-raw`:t,keys:n}));if(s)return s.map(p)}async function la(e){const t=he(e),n=await Rt(new r.Api.account.GetPrivacy({key:t}));if(n)return _a(n),Ge(n.rules)}function ua(e){const t=Pt.session.getAuthKey().getKey();return Rt(new r.Api.account.RegisterDevice({tokenType:10,secret:t,appSandbox:!1,otherUids:[],token:e}))}function ga(e){return Rt(new r.Api.account.UnregisterDevice({tokenType:10,otherUids:[],token:e}))}async function pa(e,t){const n=he(e),s=[];switch(t.allowedUsers&&s.push(new r.Api.InputPrivacyValueAllowUsers({users:t.allowedUsers.map((({id:e,accessHash:t})=>ee(e,t)))})),t.allowedChats&&s.push(new r.Api.InputPrivacyValueAllowChatParticipants({chats:t.allowedChats.map((({id:e})=>-e))})),t.blockedUsers&&s.push(new r.Api.InputPrivacyValueDisallowUsers({users:t.blockedUsers.map((({id:e,accessHash:t})=>ee(e,t)))})),t.blockedChats&&s.push(new r.Api.InputPrivacyValueDisallowChatParticipants({chats:t.blockedChats.map((({id:e})=>-e))})),t.visibility){case"everybody":s.push(new r.Api.InputPrivacyValueAllowAll);break;case"contacts":s.push(new r.Api.InputPrivacyValueAllowContacts);break;case"nonContacts":s.push(new r.Api.InputPrivacyValueDisallowContacts);break;case"nobody":s.push(new r.Api.InputPrivacyValueDisallowAll)}const a=await Rt(new r.Api.account.SetPrivacy({key:n,rules:s}));if(a)return _a(a),Ge(a.rules)}async function fa(e){await Rt(new r.Api.account.UpdateStatus({offline:!e}))}async function ha(){const e=await Rt(new r.Api.account.GetContentSettings);if(e)return{isSensitiveEnabled:Boolean(e.sensitiveEnabled),canChangeSensitive:Boolean(e.sensitiveCanChange)}}function ma(e){return Rt(new r.Api.account.SetContentSettings({sensitiveEnabled:e||void 0}))}function _a(e){e.users.forEach((e=>{e instanceof r.Api.User&&(L.users[e.id]=e)})),e.chats.forEach((e=>{(e instanceof r.Api.Chat||e instanceof r.Api.Channel)&&(L.chats[e.id]=e)}))}function ya(e){return e?d(e,["url","mimeType"]):void 0}var ba=n(8764).Buffer;function wa({chatId:e,accessHash:t,messageId:n,data:s}){return Rt(new r.Api.messages.GetBotCallbackAnswer({peer:ee(e,t),msgId:n,data:ba.from(s)}))}async function Ia({hash:e=0}){const t=await Rt(new r.Api.contacts.GetTopPeers({hash:e,botsInline:!0}));if(!(t instanceof r.Api.contacts.TopPeers))return;const n=t.users.map(Fe).filter(Boolean),s=n.map((({id:e})=>e));return{hash:de(s),ids:s,users:n}}async function Ca({username:e}){const t=await Rt(new r.Api.contacts.ResolveUsername({username:e}));if(t&&t.users[0]instanceof r.Api.User&&t.users[0].bot&&t.users[0].botInlinePlaceholder)return Sa(t.users[0]),{user:Fe(t.users[0]),chat:w(t.users[0])}}async function Pa({bot:e,chat:t,query:n,offset:s=""}){const a=await Rt(new r.Api.messages.GetInlineBotResults({bot:ee(e.id,e.accessHash),peer:ee(t.id,t.accessHash),query:n,offset:s}));var i,o,c,l,u;if(a)return a.users.map(Sa),{isGallery:Boolean(a.gallery),help:e.botPlaceholder,nextOffset:(l=e.username,u=a.nextOffset,"gif"===l&&"0"===u?"":u),switchPm:(c=a.switchPm,c?d(c,["text","startParam"]):void 0),users:a.users.map(Fe).filter(Boolean),results:(i=String(a.queryId),o=a.results,o.map((e=>{return e instanceof r.Api.BotInlineMediaResult?(e.document instanceof r.Api.Document&&(t=e.document,L.documents[String(t.id)]=t),e.photo instanceof r.Api.Photo&&(n=e.photo,L.photos[String(n.id)]=n),function(e,t){const{id:n,type:s,title:a,description:i,photo:o,document:c}=e;return{id:n,queryId:t,type:s,title:a,description:i,..."sticker"===s&&c instanceof r.Api.Document&&{sticker:H(c)},...o instanceof r.Api.Photo&&{photo:F(o)},..."gif"===s&&c instanceof r.Api.Document&&{gif:ke(c)},..."video"===s&&c instanceof r.Api.Document&&{thumbnail:N(c.thumbs)}}}(e,i)):(e.thumb&&(s=e.thumb,L.webDocuments[s.url]=s),function(e,t){const{id:n,type:s,title:a,description:i,url:o,thumb:r}=e;return{id:n,queryId:t,type:s,title:a,description:i,url:o,webThumbnail:ya(r)}}(e,i));var t,n,s})))}}async function va({chat:e,resultId:t,queryId:n,replyingTo:s}){const a=oe();await Rt(new r.Api.messages.SendInlineBotResult({clearDraft:!0,randomId:a,queryId:j()(n),peer:ee(e.id,e.accessHash),id:t,...s&&{replyToMsgId:s}}),!0)}async function Aa({bot:e,startParam:t}){const n=oe();await Rt(new r.Api.messages.StartBot({bot:ee(e.id,e.accessHash),peer:ee(e.id,e.accessHash),randomId:n,startParam:t}),!0)}function Sa(e){L.users[e.id]=e}function Ma(e){if(e)return Object.values(e).map((e=>({id:e.id,title:e.title,amount:e.prices.reduce(((e,t)=>e+Number(t.amount.value)),0),prices:e.prices.map((({label:e,amount:t})=>({label:e,amount:Number(t.value)})))})))}async function ka({chat:e,messageId:t,requestInfo:n,shouldSave:s}){const a=await Rt(new r.Api.payments.ValidateRequestedInfo({peer:ee(e.id,e.accessHash),msgId:t,save:s||void 0,info:fe(n)}));if(!a)return;const{id:i,shippingOptions:o}=a;return i?{id:i,shippingOptions:Ma(o)}:void 0}function Ra({chat:e,messageId:t,formId:n,requestedInfoId:s,shippingOptionId:a,credentials:i}){return Rt(new r.Api.payments.SendPaymentForm({formId:j()(n),peer:ee(e.id,e.accessHash),msgId:t,requestedInfoId:s,shippingOptionId:a,credentials:new r.Api.InputPaymentCredentials({save:i.save,data:new r.Api.DataJSON({data:JSON.stringify(i.data)})})}),!0)}async function Ua({chat:e,messageId:t}){const n=await Rt(new r.Api.payments.GetPaymentForm({peer:ee(e.id,e.accessHash),msgId:t}));if(n)return function(e){const{formId:t,canSaveCredentials:n,passwordMissing:s,providerId:a,nativeProvider:i,nativeParams:o,savedInfo:r,invoice:c}=e,{test:d,nameRequested:l,phoneRequested:u,emailRequested:g,shippingAddressRequested:p,flexible:f,phoneToProvider:h,emailToProvider:m,currency:_,prices:y}=c,b=y.map((({label:e,amount:t})=>({label:e,amount:Number(t.value)}))),w=o?JSON.parse(o.data):{};return{canSaveCredentials:n,passwordMissing:s,formId:String(t),providerId:a,nativeProvider:i,savedInfo:r,invoice:{test:d,nameRequested:l,phoneRequested:u,emailRequested:g,shippingAddressRequested:p,flexible:f,phoneToProvider:h,emailToProvider:m,currency:_,prices:b},nativeParams:{needCardholderName:w.need_cardholder_name,needCountry:w.need_country,needZip:w.need_zip,publishableKey:w.publishable_key}}}(n)}async function Ea(e,t){const n=await Rt(new r.Api.payments.GetPaymentReceipt({peer:ee(e.id,e.accessHash),msgId:t}));if(n)return function(e){const{invoice:t,info:n,shipping:s,currency:a,totalAmount:i,credentialsTitle:o}=e,{shippingAddress:r,phone:c,name:d}=n||{},{prices:l}=t,u=l.map((({label:e,amount:t})=>({label:e,amount:Number(t.value)})));let g,p;return s&&(g=s.prices.map((({label:e,amount:t})=>({label:e,amount:Number(t.value)}))),p=s.title),{currency:a,prices:u,info:{shippingAddress:r,phone:c,name:d},totalAmount:Number(i.value),credentialsTitle:o,shippingPrices:g,shippingMethod:p}}(n)}let Da;async function Ta(e,t){Da=e,function(e){Ie=e}(Fa),function(e){Xe=e}(Fa),function(e){xt=e}(Fa),function(e){An=e}(Fa),function(e){es=e}(Fa),function(e){ts=e}(Fa),function(e){ss=e}(Fa),function(e){Bs=e}(Fa),await async function(e,t){Ct=e;const{userAgent:n,platform:s,sessionData:a}=t,i=new r.sessions.CallbackSession(a,Mt);Pt=new r.TelegramClient(i,"2496","8da85b0d5bfe62527e5b244c209159c3",{deviceModel:navigator.userAgent||n||"Unknown UserAgent",appVersion:"1.12.1 Z",useWSS:!0,additionalDcsDisabled:!1}),Pt.addEventHandler(kt,It),Pt.addEventHandler($e,It);try{try{await Pt.start({phoneNumber:Ze,phoneCode:Ye,password:et,firstAndLastNames:tt,qrCode:nt,onError:st,initialMethod:"iOS"===s||"Android"===s?"phoneNumber":"qrCode"})}catch(e){if("Disconnect"!==e.message)return void Ct({"@type":"updateConnectionState",connectionState:"connectionStateBroken"})}Xe(at("authorizationStateReady")),Mt(i.getSessionData()),Ct({"@type":"updateApiReady"}),Tt()}catch(e){throw e}}(Fa,t)}const Ba=function(e,t){let n,s=!1;return(...a)=>{n=a,s||(s=!0,e((()=>{s=!1,t(...n)})))}}((function(e){Promise.resolve().then(e)}),(function(e){if(!Na||e!==Va)return;const t=Na;Na=void 0,t.forEach(Da)}));let xa,Va,Na;function Fa(e){Na?Na.push(e):Na=[e],xa&&!o.has(e["@type"])||(xa=function(e,t,n=!0){let s,a,i;return(...o)=>{a=!0,i=o,s||(n&&(a=!1,e(...i)),s=self.setInterval((()=>{if(!a)return self.clearInterval(s),void(s=void 0);a=!1,e(...i)}),t))}}(Ba,i,!0),Va=Math.random()),xa(Va)}self.onerror=e=>{console.error(e),qa({type:"unhandledError",error:{message:e.error.message||"Uncaught exception in worker"}})},self.addEventListener("unhandledrejection",(e=>{console.error(e),qa({type:"unhandledError",error:{message:e.reason.message||"Uncaught rejection in worker"}})}));const Oa=new Map;function La(e){qa({type:"update",update:e})}function qa(e,t){t?postMessage(e,[t]):postMessage(e)}onmessage=async e=>{const{data:t}=e;switch(t.type){case"initApi":await Ta(La,t.args[0]);break;case"callMethod":{const{messageId:e,name:n,args:s}=t;try{if(e){const t=(...t)=>{const n=t[t.length-1];qa({type:"methodCallback",messageId:e,callbackArgs:t},n instanceof ArrayBuffer?n:void 0)};Oa.set(e,t),s.push(t)}const t=await function(e,...t){return a[e](...t)}(n,...s),{arrayBuffer:i}="object"==typeof t&&"arrayBuffer"in t&&t||{};e&&qa({type:"methodResponse",messageId:e,response:t},i)}catch(t){e&&qa({type:"methodResponse",messageId:e,error:{message:t.message}})}e&&Oa.delete(e);break}case"cancelProgress":{const e=Oa.get(t.messageId);e&&(e.isCanceled=!0);break}case"ping":qa({type:"methodResponse",messageId:t.messageId})}}},9618:(e,t,n)=>{var s=n(8764).Buffer;const a=n(4736),i=n(6842);function o(e,t=!0,n=!1){let i=s.from(e);const o=i.length;t&&(i=i.reverse());let r=a(i.toString("hex"),16);return n&&Math.floor(r.toString("2").length/8)>=o&&(r=r.subtract(a(2).pow(a(8*o)))),r}function r(e,t=8){const n=a(e),i=[];for(let e=0;e>>1:e>>>1;t[n]=e}return t}()),s.isBuffer(e)||(e=s.from(e));let t=-1;for(let n=0;n>>8}return(-1^t)>>>0},generateRandomBytes:d,generateKeyDataFromNonce:async function(e,t){e=r(e,16),t=r(t,32);const[n,a,i]=await Promise.all([l(s.concat([t,e])),l(s.concat([e,t])),l(s.concat([t,t]))]);return{key:s.concat([n,a.slice(0,12)]),iv:s.concat([a.slice(12,20),i,t.slice(0,4)])}},sha1:l,sha256:function(e){const t=i.createHash("sha256");return t.update(e),t.digest()},bigIntMod:function(e,t){return e.remainder(t).add(t).remainder(t)},modExp:function(e,t,n){e=e.remainder(n);let s=a.one,i=e;for(;t.greater(a.zero);){const e=t.remainder(a(2));t=t.divide(a(2)),e.eq(a.one)&&(s=s.multiply(i),s=s.remainder(n)),i=i.multiply(i),i=i.remainder(n)}return s},getRandomInt:function(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e},sleep:e=>new Promise((t=>setTimeout(t,e))),getByteArray:function(e,t=!1){const n=e.toString(2).length,s=Math.floor((n+8-1)/8);return c(a(e),s,!1,t)},toSignedLittleBuffer:r,convertToLittle:function(e){const t=s.alloc(4*e.length);for(let n=0;n{e=t})),resolve:e}}}},9674:(e,t,n)=>{var s=n(8764).Buffer;const a=n(4736),{constructors:i}=n(7404),{readBigIntFromBuffer:o,readBufferFromBigInt:r,sha256:c,bigIntMod:d,modExp:l,generateRandomBytes:u}=n(9618),g=n(6842);function p(e,t){if(!s.from([199,28,174,185,198,177,201,4,142,108,82,47,112,241,63,115,152,13,64,35,142,62,33,193,73,52,208,55,86,61,147,15,72,25,138,10,167,193,64,88,34,148,147,210,37,48,244,219,250,51,111,110,10,201,37,19,149,67,174,212,76,206,124,55,32,253,81,246,148,88,112,90,198,140,212,254,107,107,19,171,220,151,70,81,41,105,50,132,84,241,143,175,140,89,95,100,36,119,254,150,187,42,148,29,91,205,29,74,200,204,73,136,7,8,250,155,55,142,60,79,58,144,96,190,230,124,249,164,164,166,149,129,16,81,144,126,22,39,83,181,107,15,107,65,13,186,116,216,168,75,42,20,179,20,78,14,241,40,71,84,253,23,237,149,13,89,101,180,185,221,70,88,45,177,23,141,22,156,107,196,101,176,214,255,156,163,146,143,239,91,154,228,228,24,252,21,232,62,190,160,248,127,169,255,94,237,112,5,13,237,40,73,244,123,249,89,217,86,133,12,233,41,133,31,13,129,21,246,53,177,5,238,46,78,21,208,75,36,84,191,111,79,173,240,52,177,4,3,17,156,216,227,185,47,204,91]).equals(e)||![3,4,5,7].includes(t))throw new Error("Changing passwords unsupported")}function f(e){return s.concat([s.alloc(256-e.length),e])}function h(e){return r(e,256,!1)}function m(e,t){const n=t.subtract(e);return!(n.lesser(a(0))||n.bitLength()<1984||e.bitLength()<1984||Math.floor((e.bitLength()+7)/8)>256)}function _(e,t){const n=Math.min(e.length,t.length);for(let s=0;s{for(;;){const e=u(256),t=o(e,!1),n=l(a(b),t,g);if(m(n,g)){const e=h(n),i=o(await c(s.concat([e,v])),!1);if(i.greater(a(0)))return[t,e,i]}}})(),E=d(w.subtract(M),g);if(!m(E,g))throw new Error("bad gB");const D=U.multiply(I),T=k.add(D),B=l(E,T,g),[x,V,N,F,O]=await Promise.all([c(h(B)),c(C),c(P),c(n.salt1),c(n.salt2)]),L=await c(s.concat([_(V,N),F,O,R,v,x]));return new i.InputCheckPasswordSRP({srpId:e.srpId,A:s.from(R),M1:L})},computeDigest:async function(e,t){try{p(e.p,e.g)}catch(e){throw new Error("bad p/g in password")}return h(l(a(e.g),o(await y(e,t),!1),o(e.p,!1)))}}},8960:(e,t,n)=>{var s=n(8764).Buffer;const{constructors:a}=n(7404),i=s.from("ffd8ffe000104a46494600010100000100010000ffdb004300281c1e231e19282321232d2b28303c64413c37373c7b585d4964918099968f808c8aa0b4e6c3a0aadaad8a8cc8ffcbdaeef5ffffff9bc1fffffffaffe6fdfff8ffdb0043012b2d2d3c353c76414176f8a58ca5f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8ffc00011080000000003012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffda000c03010002110311003f00","hex"),o=s.from("ffd9","hex");function r(e,t){throw new Error(`Cannot cast ${e.className} to any kind of ${t}`)}e.exports={getMessageId:function(e){if(void 0!==e){if("number"==typeof e)return e;if(2030045667===e.SUBCLASS_OF_ID)return e.id;throw new Error(`Invalid message type: ${e.constructor.name}`)}},getInputPeer:function e(t,n=!0,s=!0){if(void 0===t.SUBCLASS_OF_ID){if(n&&"inputEntity"in t)return t.inputEntity;if("entity"in t)return e(t.entity);r(t,"InputPeer")}if(3374092470===t.SUBCLASS_OF_ID)return t;if(t instanceof a.User){if(t.isSelf&&n)return new a.InputPeerSelf;if(void 0===t.accessHash&&s)throw new Error("User without accessHash or min info cannot be input");return new a.InputPeerUser({userId:t.id,accessHash:t.accessHash})}if(t instanceof a.Chat||t instanceof a.ChatEmpty||t instanceof a.ChatForbidden)return new a.InputPeerChat({chatId:t.id});if(t instanceof a.Channel){if(void 0===t.accessHash&&s)throw new TypeError("Channel without accessHash or min info cannot be input");return new a.InputPeerChannel({channelId:t.id,accessHash:t.accessHash})}return t instanceof a.ChannelForbidden?new a.InputPeerChannel({channelId:t.id,accessHash:t.accessHash}):t instanceof a.InputUser?new a.InputPeerUser({userId:t.userId,accessHash:t.accessHash}):t instanceof a.InputChannel?new a.InputPeerChannel({channelId:t.channelId,accessHash:t.accessHash}):t instanceof a.UserEmpty?new a.InputPeerEmpty:t instanceof a.UserFull?e(t.user):t instanceof a.ChatFull?new a.InputPeerChat({chatId:t.id}):t instanceof a.PeerChat?new a.InputPeerChat(t.chatId):void r(t,"InputPeer")},getDisplayName:function(e){return e instanceof a.User?e.lastName&&e.firstName?`${e.firstName} ${e.lastName}`:e.firstName?e.firstName:e.lastName?e.lastName:"":e instanceof a.Chat||e instanceof a.Channel?e.title:""},getAppropriatedPartSize:function(e){if(e<=104857600)return 128;if(e<=786432e3)return 256;if(e<=2097152e3)return 512;throw new Error("File size too large")},strippedPhotoToJpg:function(e){if(e.length<3||1!==e[0])return e;const t=s.from(i);return t[164]=e[1],t[166]=e[2],s.concat([t,e.slice(3),o])},getDC:function(e,t=!1){switch(e){case 1:return{id:1,ipAddress:`zws1${t?"-1":""}.web.telegram.org`,port:443};case 2:return{id:2,ipAddress:`zws2${t?"-1":""}.web.telegram.org`,port:443};case 3:return{id:3,ipAddress:`zws3${t?"-1":""}.web.telegram.org`,port:443};case 4:return{id:4,ipAddress:`zws4${t?"-1":""}.web.telegram.org`,port:443};case 5:return{id:5,ipAddress:`zws5${t?"-1":""}.web.telegram.org`,port:443};default:throw new Error(`Cannot find the DC with the ID of ${e}`)}}}},1472:e=>{e.exports="0.0.2"},243:(e,t,n)=>{"use strict";n.r(t),n.d(t,{updateTwoFaSettings:()=>l});var s=n(7150),a=n.n(s),i=n(9618),o=n(9674),r=n(7873),c=n.n(r),d=n(8764).Buffer;async function l(e,{isCheckPassword:t,currentPassword:n,newPassword:s,hint:r="",email:l,emailCodeCallback:u,onEmailCodeError:g}){if(!s&&!n)throw new Error("Neither `currentPassword` nor `newPassword` is present");if(l&&(!u||!g))throw new Error("`email` present without `emailCodeCallback` and `onEmailCodeError`");const p=await e.invoke(new(a().account.GetPassword));p.newAlgo instanceof a().PasswordKdfAlgoUnknown||(p.newAlgo.salt1=d.concat([p.newAlgo.salt1,(0,i.generateRandomBytes)(32)])),!p.hasPassword&&n&&(n=void 0);const f=n?await(0,o.computeCheck)(p,n):new(a().InputCheckPasswordEmpty);if(t)await e.invoke(new(a().auth.CheckPassword)({password:f}));else try{await e.invoke(new(a().account.UpdatePasswordSettings)({password:f,newSettings:new(a().account.PasswordInputSettings)({newAlgo:p.newAlgo,newPasswordHash:s?await(0,o.computeDigest)(p.newAlgo,s):d.alloc(0),hint:r,email:l,newSecureSettings:void 0})}))}catch(t){if(!(t instanceof c().EmailUnconfirmedError))throw t;for(;;)try{const n=await u(t.codeLength);if(!n)throw new Error("Code is empty");await e.invoke(new(a().account.ConfirmPasswordEmail)({code:n}));break}catch(e){g(e)}}}},8742:(e,t,n)=>{var s=n(8764).Buffer;const a=n(7435),i=n(6748),{sleep:o}=n(9618),r=n(7873),c=n(3995),d=n(9618),l=n(8960),u=n(9270),{LAYER:g}=n(845),{constructors:p,requests:f}=n(7404),h=n(4046),{ConnectionTCPObfuscated:m}=n(2986),{authFlow:_,checkAuthorization:y}=n(1545),{downloadFile:b}=n(2288),{uploadFile:w}=n(4766),{updateTwoFaSettings:I}=n(243),C=131072,P=["w","y","d","x","c","m","b","a","s"];class v{constructor(e,t,n,s=v.DEFAULT_OPTIONS){if(!t||!n)throw Error('Your API ID or Hash are invalid. Please read "Requirements" on README.md');const o={...v.DEFAULT_OPTIONS,...s};if(this.apiId=t,this.apiHash=n,this._useIPV6=o.useIPV6,"string"==typeof o.baseLogger?this._log=new i:this._log=o.baseLogger,"string"!=typeof e&&e){if(!(e instanceof u))throw new Error("The given session must be str or a session instance")}else try{throw new Error("not implemented")}catch(t){e=new c}this.floodSleepLimit=o.floodSleepLimit,this._eventBuilders=[],this._phoneCodeHash={},this.session=e,this.apiId=parseInt(t,10),this.apiHash=n,this._requestRetries=o.requestRetries,this._connectionRetries=o.connectionRetries,this._retryDelay=o.retryDelay||0,o.proxy&&this._log.warn("proxies are not supported"),this._proxy=o.proxy,this._timeout=o.timeout,this._autoReconnect=o.autoReconnect,this._connection=o.connection,this._floodWaitedRequests={},this._initWith=e=>new f.InvokeWithLayer({layer:g,query:new f.InitConnection({apiId:this.apiId,deviceModel:o.deviceModel||a.type().toString()||"Unknown",systemVersion:o.systemVersion||a.release().toString()||"1.0",appVersion:o.appVersion||"1.0",langCode:o.langCode,langPack:"",systemLangCode:o.systemLangCode,query:e,proxy:void 0})}),this._args=o,this._config=void 0,this.phoneCodeHashes=[],this._exportedSenderPromises={},this._exportedSenderReleaseTimeouts={},this._additionalDcsDisabled=o.additionalDcsDisabled,this._loopStarted=!1,this._reconnecting=!1,this._destroyed=!1}async connect(){await this._initSession(),void 0===this._sender&&(this._sender=new h(this.session.getAuthKey(),{logger:this._log,dcId:this.session.dcId,retries:this._connectionRetries,delay:this._retryDelay,autoReconnect:this._autoReconnect,connectTimeout:this._timeout,authKeyCallback:this._authKeyCallback.bind(this),updateCallback:this._handleUpdate.bind(this),isMainSender:!0})),this._sender.userDisconnected=!1,this._sender._user_connected=!1,this._sender._reconnecting=!1,this._sender._disconnected=!0;const e=new this._connection(this.session.serverAddress,this.session.port,this.session.dcId,this._log);await this._sender.connect(e)?(this.session.setAuthKey(this._sender.authKey),await this._sender.send(this._initWith(new f.help.GetConfig({}))),this._loopStarted||(this._updateLoop(),this._loopStarted=!0),this._reconnecting=!1):this._loopStarted||(this._updateLoop(),this._loopStarted=!0)}async _initSession(){await this.session.load(),this.session.serverAddress&&this.session.serverAddress.includes(":")===this._useIPV6||this.session.setDC(2,this._useIPV6?"[2001:67c:4e8:f002::a]":"zws2.web.telegram.org",this._args.useWSS?443:80)}async _updateLoop(){for(;!this._destroyed;)if(await d.sleep(3e3),!this._reconnecting){try{await k((()=>{return e=this._sender.send(new f.PingDelayDisconnect({pingId:d.getRandomInt(Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),disconnectDelay:6e4})),5e3,Promise.race([e,d.sleep(5e3).then((()=>Promise.reject(new Error("TIMEOUT"))))]);var e}),3,100)}catch(e){if(console.warn(e),this._reconnecting)continue;await this.disconnect(),await this.connect()}if((new Date).getTime()-this._lastRequest>18e5)try{await this.invoke(new f.updates.GetState)}catch(e){}}await this.disconnect()}async disconnect(){this._sender&&await this._sender.disconnect(),await Promise.all(Object.values(this._exportedSenderPromises).map((e=>e&&e.then((e=>{if(e)return e.disconnect()}))))),this._exportedSenderPromises={}}async destroy(){this._destroyed=!0;try{await this.disconnect()}catch(e){}this.session.delete(),this._eventBuilders=[]}async _switchDC(e){this._log.info(`Reconnecting to new data center ${e}`);const t=l.getDC(e);return this.session.setDC(e,t.ipAddress,t.port),await this._sender.authKey.setKey(void 0),this.session.setAuthKey(void 0),this._reconnecting=!0,await this.disconnect(),this.connect()}_authKeyCallback(e,t){this.session.setAuthKey(e,t)}async _cleanupExportedSender(e){this.session.dcId!==e&&this.session.setAuthKey(void 0,e);const t=await this._exportedSenderPromises[e];this._exportedSenderPromises[e]=void 0,await t.disconnect()}async _connectSender(e,t){const n=l.getDC(t,!!e.authKey.getKey());for(;;)try{if(await e.connect(new this._connection(n.ipAddress,n.port,t,this._log)),this.session.dcId!==t&&!e._authenticated){this._log.info(`Exporting authorization for data center ${n.ipAddress}`);const s=await this.invoke(new f.auth.ExportAuthorization({dcId:t})),a=this._initWith(new f.auth.ImportAuthorization({id:s.id,bytes:s.bytes}));await e.send(a),e._authenticated=!0}return e.dcId=t,e.userDisconnected=!1,e}catch(t){console.error(t),await d.sleep(1e3),await e.disconnect()}}async _borrowExportedSender(e,t,n){if(this._additionalDcsDisabled)return;let s;this._exportedSenderPromises[e]&&!t||(this._exportedSenderPromises[e]=this._connectSender(n||this._createExportedSender(e),e));try{if(s=await this._exportedSenderPromises[e],!s.isConnected())return s.isConnecting?(await d.sleep(1e3),this._borrowExportedSender(e,!1,s)):this._borrowExportedSender(e,!0,s)}catch(t){return console.error(t),this._borrowExportedSender(e,!0)}return this._exportedSenderReleaseTimeouts[e]&&(clearTimeout(this._exportedSenderReleaseTimeouts[e]),this._exportedSenderReleaseTimeouts[e]=void 0),this._exportedSenderReleaseTimeouts[e]=setTimeout((()=>{this._exportedSenderReleaseTimeouts[e]=void 0,s.disconnect()}),3e4),s}_createExportedSender(e){return new h(this.session.getAuthKey(e),{logger:this._log,dcId:e,retries:this._connectionRetries,delay:this._retryDelay,autoReconnect:this._autoReconnect,connectTimeout:this._timeout,authKeyCallback:this._authKeyCallback.bind(this),isMainSender:e===this.session.dcId,onConnectionBreak:this._cleanupExportedSender.bind(this)})}getSender(e){return e?this._borrowExportedSender(e):Promise.resolve(this._sender)}downloadFile(e,t={}){return b(this,e,t)}downloadMedia(e,t){let n;if(n=e instanceof p.Message?e.media:e,"string"==typeof n)throw new Error("not implemented");return n instanceof p.MessageMediaWebPage&&n.webpage instanceof p.WebPage&&(n=n.webpage.document||n.webpage.photo),n instanceof p.MessageMediaPhoto||n instanceof p.Photo?this._downloadPhoto(n,t):n instanceof p.MessageMediaDocument||n instanceof p.Document?this._downloadDocument(n,t):n instanceof p.MessageMediaContact?this._downloadContact(n,t):n instanceof p.WebDocument||n instanceof p.WebDocumentNoProxy?this._downloadWebDocument(n,t):void 0}downloadProfilePhoto(e,t=!1){const n=t?"x":"m";let s,a,i;if([765557111,3316604308,524706233,3566872215].includes(e.SUBCLASS_OF_ID)){if(!e.photo){if(!e.chatPhoto)return;return this._downloadPhoto(e.chatPhoto,{sizeType:n})}s=e.photo}else s=e;if(s instanceof p.UserProfilePhoto||s instanceof p.ChatPhoto)return a=s.dcId,i=new p.InputPeerPhotoFileLocation({peer:l.getInputPeer(e),photoId:s.photoId,big:t}),this.downloadFile(i,{dcId:a})}downloadStickerSetThumb(e){if(!e.thumbs||!e.thumbs.length)return;const{thumbVersion:t}=e;return this.downloadFile(new p.InputStickerSetThumb({stickerset:new p.InputStickerSetID({id:e.id,accessHash:e.accessHash}),thumbVersion:t}),{dcId:e.thumbDcId})}_pickFileSize(e,t){if(!t||!e||!e.length)return;let n;for(let s=P.indexOf(t);se.type===P[s])),n)return n}_downloadCachedPhotoSize(e){let t;return t=e instanceof p.PhotoStrippedSize?l.strippedPhotoToJpg(e.bytes):e.bytes,t}_downloadPhoto(e,t){if(e instanceof p.MessageMediaPhoto&&(e=e.photo),!(e instanceof p.Photo))return;const n=this._pickFileSize(e.sizes,t.sizeType);return!n||n instanceof p.PhotoSizeEmpty?void 0:n instanceof p.PhotoCachedSize||n instanceof p.PhotoStrippedSize?this._downloadCachedPhotoSize(n):this.downloadFile(new p.InputPhotoFileLocation({id:e.id,accessHash:e.accessHash,fileReference:e.fileReference,thumbSize:n.type}),{dcId:e.dcId,fileSize:n.size,progressCallback:t.progressCallback})}_downloadDocument(e,t){if(e instanceof p.MessageMediaDocument&&(e=e.document),!(e instanceof p.Document))return;let n;if(t.sizeType){if(n=e.thumbs?this._pickFileSize(e.thumbs,t.sizeType):void 0,!n&&e.mimeType.startsWith("video/"))return;if(n&&(n instanceof p.PhotoCachedSize||n instanceof p.PhotoStrippedSize))return this._downloadCachedPhotoSize(n)}return this.downloadFile(new p.InputDocumentFileLocation({id:e.id,accessHash:e.accessHash,fileReference:e.fileReference,thumbSize:n?n.type:""}),{fileSize:n?n.size:e.size,progressCallback:t.progressCallback,start:t.start,end:t.end,dcId:e.dcId,workers:t.workers})}_downloadContact(e,t){throw new Error("not implemented")}async _downloadWebDocument(e){try{const t=[];let n=0;for(;;){const s=new f.upload.GetWebFile({location:new p.InputWebFileLocation({url:e.url,accessHash:e.accessHash}),offset:n,limit:C}),a=await this._borrowExportedSender(4),i=await a.send(s);if(n+=131072,!i.bytes.length)break;if(t.push(i.bytes),i.bytes.length{"use strict";n.r(t),n.d(t,{authFlow:()=>l,checkAuthorization:()=>u});var s=n(7150),a=n.n(s),i=n(8960),o=n.n(i),r=n(9618),c=n(9674);const d="phoneNumber";async function l(e,t,n){let s;if("botAuthToken"in n)s=await async function(e,t,n){const{apiId:s,apiHash:i}=t,{botAuthToken:o}=n,{user:r}=await e.invoke(new(a().auth.ImportBotAuthorization)({apiId:s,apiHash:i,botAuthToken:o}));return r}(e,t,n);else{const{initialMethod:a=d}=n;s="phoneNumber"===a?await g(e,t,n):await p(e,t,n)}e._log.info("Signed in successfully as",o().getDisplayName(s))}async function u(e){try{return await e.invoke(new(a().updates.GetState)),!0}catch(e){if("Disconnect"===e.message)throw e;return!1}}async function g(e,t,n){let s,i,o,r=!1;for(;;)try{if("function"==typeof n.phoneNumber)try{s=await n.phoneNumber()}catch(s){if("RESTART_AUTH_WITH_QR"===s.message)return p(e,t,n);throw s}else s=n.phoneNumber;const a=await f(e,t,s,n.forceSMS);if(i=a.phoneCodeHash,r=a.isCodeViaApp,"string"!=typeof i)throw new Error("Failed to retrieve phone code hash");break}catch(e){if("function"!=typeof n.phoneNumber)throw e;n.onError(e)}let c,d=!1;for(;;)try{try{o=await n.phoneCode(r)}catch(s){if("RESTART_AUTH"===s.message)return g(e,t,n)}if(!o)throw new Error("Code is empty");const l=await e.invoke(new(a().auth.SignIn)({phoneNumber:s,phoneCodeHash:i,phoneCode:o}));if(l instanceof a().auth.AuthorizationSignUpRequired){d=!0,c=l.termsOfService;break}return l.user}catch(t){if("SESSION_PASSWORD_NEEDED"===t.message)return h(e,0,n);n.onError(t)}if(d)for(;;)try{const[t,o]=await n.firstAndLastNames();if(!t)throw new Error("First name is required");const{user:r}=await e.invoke(new(a().auth.SignUp)({phoneNumber:s,phoneCodeHash:i,firstName:t,lastName:o}));return c&&await e.invoke(new(a().help.AcceptTermsOfService)({id:c.id})),r}catch(e){n.onError(e)}return n.onError(new Error("Auth failed")),g(e,t,n)}async function p(e,t,n){let s=!1;const i=(async()=>{for(;!s;){const t=await e.invoke(new(a().auth.ExportLoginToken)({apiId:Number("2496"),apiHash:"8da85b0d5bfe62527e5b244c209159c3",exceptIds:[]}));if(!(t instanceof a().auth.LoginToken))throw new Error("Unexpected");const{token:s,expires:i}=t;await Promise.race([n.qrCode({token:s,expires:i}),(0,r.sleep)(3e4)])}})(),o=new Promise((t=>{e.addEventHandler((e=>{e instanceof a().UpdateLoginToken&&t()}),{build:e=>e})}));try{await Promise.race([o,i])}catch(s){if("RESTART_AUTH"===s.message)return await g(e,t,n);throw s}finally{s=!0}try{const t=await e.invoke(new(a().auth.ExportLoginToken)({apiId:Number("2496"),apiHash:"8da85b0d5bfe62527e5b244c209159c3",exceptIds:[]}));if(t instanceof a().auth.LoginTokenSuccess&&t.authorization instanceof a().auth.Authorization)return t.authorization.user;if(t instanceof a().auth.LoginTokenMigrateTo){await e._switchDC(t.dcId);const n=await e.invoke(new(a().auth.ImportLoginToken)({token:t.token}));if(n instanceof a().auth.LoginTokenSuccess&&n.authorization instanceof a().auth.Authorization)return n.authorization.user}}catch(t){if("SESSION_PASSWORD_NEEDED"===t.message)return h(e,0,n);throw t}throw void 0}async function f(e,t,n,s=!1){try{const{apiId:i,apiHash:o}=t,r=await e.invoke(new(a().auth.SendCode)({phoneNumber:n,apiId:i,apiHash:o,settings:new(a().CodeSettings)}));if(!s||r.type instanceof a().auth.SentCodeTypeSms)return{phoneCodeHash:r.phoneCodeHash,isCodeViaApp:r.type instanceof a().auth.SentCodeTypeApp};const c=await e.invoke(new(a().auth.ResendCode)({phoneNumber:n,phoneCodeHash:r.phoneCodeHash}));return{phoneCodeHash:c.phoneCodeHash,isCodeViaApp:c.type instanceof a().auth.SentCodeTypeApp}}catch(a){if("AUTH_RESTART"===a.message)return f(e,t,n,s);throw a}}async function h(e,t,n){for(;;)try{const t=await e.invoke(new(a().account.GetPassword)),s=await n.password(t.hint);if(!s)throw new Error("Password is empty");const i=await(0,c.computeCheck)(t,s),{user:o}=await e.invoke(new(a().auth.CheckPassword)({password:i}));return o}catch(e){n.onError(e)}}},2288:(e,t,n)=>{"use strict";n.r(t),n.d(t,{downloadFile:()=>p});var s=n(7150),a=n.n(s),i=n(8960),o=n(9618),r=n(7873),c=n.n(r),d=n(8764).Buffer;function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=1048576;class g{constructor(e){this.maxWorkers=e,l(this,"deferred",void 0),l(this,"activeWorkers",0)}requestWorker(){return this.activeWorkers++,this.activeWorkers>this.maxWorkers?(this.deferred=(0,o.createDeferred)(),this.deferred.promise):Promise.resolve()}releaseWorker(){this.activeWorkers--,this.deferred&&this.activeWorkers<=this.maxWorkers&&this.deferred.resolve()}}async function p(e,t,n){let{partSizeKb:s,end:r}=n;const{fileSize:l,workers:p=1}=n,{dcId:f,progressCallback:h,start:m=0}=n;r=r&&r{for(;;){let d;try{d=await e.getSender(f);const o=await d.send(new(a().upload.GetFile)({location:t,offset:i,limit:n,precise:s||void 0}));if(h){if(h.isCanceled)throw new Error("USER_CANCELED");P+=1/y,h(P)}return!r&&o.bytes.lengthr)break}const v=(await Promise.all(w)).filter(Boolean),A=r?r+1-m:void 0;return d.concat(v,A)}},4766:(e,t,n)=>{"use strict";n.r(t),n.d(t,{uploadFile:()=>l});var s=n(7150),a=n.n(s),i=n(9618),o=n(8960),r=n(7873),c=n.n(r),d=n(8764).Buffer;async function l(e,t){const{file:n,onProgress:s}=t;let{workers:r}=t;const{name:l,size:u}=n,g=(0,i.readBigIntFromBuffer)((0,i.generateRandomBytes)(8),!0,!0),p=u>10485760,f=1024*(0,o.getAppropriatedPartSize)(u),h=Math.floor((u+f-1)/f),m=d.from(await function(e){return new Response(e).arrayBuffer()}(n));await e.getSender(e.session.dcId),r&&u||(r=1),r>=h&&(r=h);let _=0;s&&s(_);for(let t=0;th&&(o=h);for(let r=t;r{for(;;){let o;try{o=await e.getSender(e.session.dcId),await o.send(p?new(a().upload.SaveBigFilePart)({fileId:g,filePart:t,fileTotalParts:h,bytes:n}):new(a().upload.SaveFilePart)({fileId:g,filePart:t,bytes:n}))}catch(e){if(o&&!o.isConnected()){await(0,i.sleep)(1e3);continue}if(e instanceof c().FloodWaitError){await(0,i.sleep)(1e3*e.seconds);continue}throw e}if(s){if(s.isCanceled)throw new Error("USER_CANCELED");_+=1/h,s(_)}break}})(r,t))}await Promise.all(n)}return p?new(a().InputFileBig)({id:g,parts:h,name:l}):new(a().InputFile)({id:g,parts:h,name:l,md5Checksum:""})}},3302:(e,t,n)=>{var s=n(8764).Buffer;const{sha1:a,toSignedLittleBuffer:i,readBufferFromBigInt:o,readBigIntFromBuffer:r}=n(9618),c=n(5544),{sleep:d}=n(9618);class l{constructor(e,t){if(!t||!e)return;this._key=e,this._hash=t;const n=new c(t);this.auxHash=n.readLong(!1),n.read(4),this.keyId=n.readLong(!1)}async setKey(e){if(!e)return this._key=void 0,this.auxHash=void 0,this.keyId=void 0,void(this._hash=void 0);if(e instanceof l)return this._key=e._key,this.auxHash=e.auxHash,this.keyId=e.keyId,void(this._hash=e._hash);this._key=e,this._hash=await a(this._key);const t=new c(this._hash);this.auxHash=t.readLong(!1),t.read(4),this.keyId=t.readLong(!1)}async waitForKey(){for(;!this.keyId;)await d(20)}getKey(){return this._key}async calcNewNonceHash(e,t){e=i(e,32);const n=s.alloc(1);n.writeUInt8(t,0);const c=s.concat([e,s.concat([n,o(this.auxHash,8,!0)])]),d=(await a(c)).slice(4,20);return r(d,!0,!0)}equals(e){return e instanceof this.constructor&&this._key&&e.getKey()&&e.getKey().equals(this._key)}}e.exports=l},5830:(e,t,n)=>{var s=n(8764).Buffer;const a=n(6842);e.exports=class{constructor(e,t){if(!s.isBuffer(e)||!s.isBuffer(t)||16!==t.length)throw new Error("Key and iv need to be a buffer");this.cipher=a.createCipheriv("AES-256-CTR",e,t)}encrypt(e){return s.from(this.cipher.update(e))}}},9636:(e,t,n)=>{const s=n(4736),{modExp:a}=n(9618);class i{static gcd(e,t){for(;t.neq(s.zero);){const n=t;t=e.remainder(t),e=n}return e}static factorize(e){if(e.remainder(2).equals(s.zero))return{p:s(2),q:e.divide(s(2))};let t=s.randBetween(s(1),e.minus(1));const n=s.randBetween(s(1),e.minus(1)),o=s.randBetween(s(1),e.minus(1));let r,c=s.one,d=s.one,l=s.one,u=s.zero,g=s.zero;for(;c.eq(s.one);){u=t;for(let i=0;s(i).lesser(d);i++)t=a(t,s(2),e).add(n).remainder(e);for(r=s.zero;r.lesser(d)&&c.eq(s.one);){g=t;const p=s.min(o,d.minus(r));for(let i=0;s(i).lesser(p);i++)t=a(t,s(2),e).add(n).remainder(e),l=l.multiply(u.minus(t).abs()).remainder(e);c=i.gcd(l,e),r=r.add(o)}d=d.multiply(2)}if(c.eq(e))for(;g=a(g,s(2),e).add(n).remainder(e),c=i.gcd(u.minus(g).abs(),e),!c.greater(1););const p=c;return l=e.divide(c),p{var s=n(8764).Buffer;const{IGE:a}=n(8136),i=n(9618);e.exports=class{constructor(e,t){this.ige=new a(e,t)}decryptIge(e){return i.convertToLittle(this.ige.decrypt(e))}encryptIge(e){const t=e.length%16;return t&&(e=s.concat([e,i.generateRandomBytes(16-t)])),i.convertToLittle(this.ige.encrypt(e))}}},4121:(e,t,n)=>{"use strict";function s(e){const t=new Uint8Array(4*e.length);let n=0;for(let s=0;s>>24,t[n++]=a>>16&255,t[n++]=a>>8&255,t[n++]=255&a}return t.buffer}function a(e){return e.buffer}function i(e){const t=new Uint8Array(e),n=new Uint32Array(t.length/4);for(let e=0;es,i2abBig:()=>a,ab2iLow:()=>i,ab2iBig:()=>o,isBigEndian:()=>r,i2ab:()=>c,ab2i:()=>d});const r=1===new Uint8Array(new Uint32Array([16909060]))[0],c=r?a:s,d=r?o:i},6842:(e,t,n)=>{var s=n(8764).Buffer;const a=n(8136).default,{i2ab:i,ab2i:o}=n(4121),{getWords:r}=n(7760);class c{constructor(e){this.setBytes(e)}setBytes(e){e=s.from(e),this._counter=e}increment(){for(let e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}}}class d{constructor(e,t){t instanceof c||(t=new c(t)),this._counter=t,this._remainingCounter=void 0,this._remainingCounterIndex=16,this._aes=new a(r(e))}update(e){return this.encrypt(e)}encrypt(e){const t=s.from(e);for(let e=0;e{"use strict";function s(e,t){return e.charCodeAt(t)<<24^e.charCodeAt(t+1)<<16^e.charCodeAt(t+2)<<8^e.charCodeAt(t+3)}function a(e){if(e instanceof Uint32Array)return e;if("string"==typeof e){if(e.length%4!=0)for(let t=e.length%4;t<=4;t++)e+="\0x00";const t=new Uint32Array(e.length/4);for(let n=0;ns,getWords:()=>a,xor:()=>i})},8187:e=>{class t extends Error{constructor(){super("The read operation was cancelled.")}}class n extends Error{constructor(e,t){super(`Could not find a matching Constructor ID for the TLObject that was supposed to be\n read with ID ${e}. Most likely, a TLObject was trying to be read when\n it should not be read. Remaining bytes: ${t.length}`),"undefined"!=typeof alert&&alert(`Missing MTProto Entity: Please, make sure to add TL definition for ID ${e}`),this.invalidConstructorId=e,this.remaining=t}}class s extends Error{constructor(e,t){super(`Invalid checksum (${e} when ${t} was expected). This packet should be skipped.`),this.checksum=e,this.validChecksum=t}}class a extends Error{constructor(e){let t;4===e.length?(t=-e.readInt32LE(0),super(`Invalid response buffer (HTTP code ${t})`)):super(`Invalid response buffer (too short ${e})`),this.code=t,this.payload=e}}class i extends Error{constructor(...e){e.length||(e=["A security check failed."]),super(...e)}}class o extends Error{constructor(e,t){let n=o.ErrorMessages[t]||`Unknown error code (this should not happen): ${t}.`;n+=` Caused by ${e.className}`,super(n),this.message=n,this.code=t}}var r,c,d;d={16:"msg_id too low (most likely, client time is wrong it would be worthwhile to synchronize it using msg_id notifications and re-send the original message with the “correct” msg_id or wrap it in a container with a new msg_id if the original message had waited too long on the client to be transmitted).",17:"msg_id too high (similar to the previous case, the client time has to be synchronized, and the message re-sent with the correct msg_id).",18:"Incorrect two lower order msg_id bits (the server expects client message msg_id to be divisible by 4).",19:"Container msg_id is the same as msg_id of a previously received message (this must never happen).",20:"Message too old, and it cannot be verified whether the server has received a message with this msg_id or not.",32:"msg_seqno too low (the server has already received a message with a lower msg_id but with either a higher or an equal and odd seqno).",33:"msg_seqno too high (similarly, there is a message with a higher msg_id but with either a lower or an equal and odd seqno).",34:"An even msg_seqno expected (irrelevant message), but odd received.",35:"Odd msg_seqno expected (relevant message), but even received.",48:"Incorrect server salt (in this case, the bad_server_salt response is received with the correct salt, and the message is to be re-sent with it).",64:"Invalid container."},(c="ErrorMessages")in(r=o)?Object.defineProperty(r,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):r[c]=d,e.exports={ReadCancelledError:t,TypeNotFoundError:n,InvalidChecksumError:s,InvalidBufferError:a,SecurityError:i,CdnFileTamperedError:class extends i{constructor(){super("The CDN file has been altered and its download cancelled.")}},BadMessageError:o}},6952:e=>{function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class n extends Error{constructor(e,t,s){super("RPCError {0}: {1}{2}".replace("{0}",s).replace("{1}",e).replace("{2}",n._fmtRequest(t))),this.code=s,this.message=e}static _fmtRequest(e){return e?` (caused by ${e.className})`:""}}e.exports={RPCError:n,InvalidDCError:class extends n{constructor(e,t,n){super(t,e,n),this.code=n||303,this.message=t||"ERROR_SEE_OTHER"}},BadRequestError:class extends n{constructor(...e){super(...e),t(this,"code",400),t(this,"message","BAD_REQUEST")}},UnauthorizedError:class extends n{constructor(...e){super(...e),t(this,"code",401),t(this,"message","UNAUTHORIZED")}},ForbiddenError:class extends n{constructor(...e){super(...e),t(this,"code",403),t(this,"message","FORBIDDEN")}},NotFoundError:class extends n{constructor(...e){super(...e),t(this,"code",404),t(this,"message","NOT_FOUND")}},AuthKeyError:class extends n{constructor(...e){super(...e),t(this,"code",406),t(this,"message","AUTH_KEY")}},FloodError:class extends n{constructor(...e){super(...e),t(this,"code",420),t(this,"message","FLOOD")}},ServerError:class extends n{constructor(...e){super(...e),t(this,"code",500),t(this,"message","INTERNAL")}},TimedOutError:class extends n{constructor(...e){super(...e),t(this,"code",503),t(this,"message","Timeout")}}}},5651:(e,t,n)=>{const{RPCError:s,InvalidDCError:a,FloodError:i,BadRequestError:o}=n(6952);class r extends a{constructor(e){const t=Number(e.capture||0);super(`The user whose identity is being used to execute queries is associated with DC ${t}${s._fmtRequest(e.request)}`),this.message=`The user whose identity is being used to execute queries is associated with DC ${t}${s._fmtRequest(e.request)}`,this.newDc=t}}class c extends a{constructor(e){const t=Number(e.capture||0);super(`The phone number a user is trying to use for authorization is associated with DC ${t}${s._fmtRequest(e.request)}`),this.message=`The phone number a user is trying to use for authorization is associated with DC ${t}${s._fmtRequest(e.request)}`,this.newDc=t}}class d extends i{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required before sending another message in this chat${s._fmtRequest(e.request)}`),this.message=`A wait of ${t} seconds is required before sending another message in this chat${s._fmtRequest(e.request)}`,this.seconds=t}}class l extends i{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required${s._fmtRequest(e.request)}`),this.message=`A wait of ${t} seconds is required${s._fmtRequest(e.request)}`,this.seconds=t}}class u extends i{constructor(e){super(`Message failed to be sent.${s._fmtRequest(e.request)}`),this.message=`Message failed to be sent.${s._fmtRequest(e.request)}`}}class g extends i{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required in the test servers${s._fmtRequest(e.request)}`),this.message=`A wait of ${t} seconds is required in the test servers${s._fmtRequest(e.request)}`,this.seconds=t}}class p extends a{constructor(e){const t=Number(e.capture||0);super(`The file to be accessed is currently stored in DC ${t}${s._fmtRequest(e.request)}`),this.message=`The file to be accessed is currently stored in DC ${t}${s._fmtRequest(e.request)}`,this.newDc=t}}class f extends a{constructor(e){const t=Number(e.capture||0);super(`The source IP address is associated with DC ${t}${s._fmtRequest(e.request)}`),this.message=`The source IP address is associated with DC ${t}${s._fmtRequest(e.request)}`,this.newDc=t}}class h extends o{constructor(e){const t=Number(e.capture||0);super(`Email unconfirmed, the length of the code must be ${t}${s._fmtRequest(e.request)}`),this.message=`Email unconfirmed, the length of the code must be ${t}${s._fmtRequest(e.request)}`,this.codeLength=t}}const m=[[/FILE_MIGRATE_(\d+)/,p],[/FLOOD_TEST_PHONE_WAIT_(\d+)/,g],[/FLOOD_WAIT_(\d+)/,l],[/MSG_WAIT_(.*)/,u],[/PHONE_MIGRATE_(\d+)/,c],[/SLOWMODE_WAIT_(\d+)/,d],[/USER_MIGRATE_(\d+)/,r],[/NETWORK_MIGRATE_(\d+)/,f],[/EMAIL_UNCONFIRMED_(\d+)/,h]];e.exports={rpcErrorRe:m,FileMigrateError:p,FloodTestPhoneWaitError:g,FloodWaitError:l,PhoneMigrateError:c,SlowModeWaitError:d,UserMigrateError:r,NetworkMigrateError:f,MsgWaitError:u,EmailUnconfirmedError:h}},7873:(e,t,n)=>{const{RPCError:s}=n(6952),{rpcErrorRe:a}=n(5651),i=n(8187),o=n(6952),r=n(5651);e.exports={RPCMessageToError:function(e,t){for(const[n,s]of a){const a=e.errorMessage.match(n);if(a)return new s({request:t,capture:2===a.length?parseInt(a[1],10):void 0})}return new s(e.errorMessage,t)},...i,...o,...r}},6316:()=>{},3903:(e,t,n)=>{const{EventBuilder:s}=n(6172);e.exports=class extends s{constructor(e={types:void 0,func:void 0}){super(),e.types?this.types=e.types:this.types=!0}build(e){return e}}},6172:e=>{e.exports={EventBuilder:class{constructor(e={chats:void 0,blacklistChats:void 0,func:void 0}){this.chats=e.chats,this.blacklistChats=Boolean(e.blacklistChats),this.resolved=!1,this.func=e.func}build(e){}}}},3182:(e,t,n)=>{const s=n(6316),a=n(3903);class i extends Error{}e.exports={NewMessage:s,StopPropagation:i,Raw:a}},6151:e=>{e.exports=class{constructor(){this._queue=[],this.canGet=new Promise((e=>{this.resolveGet=e})),this.canPush=!0}async push(e){await this.canPush,this._queue.push(e),this.resolveGet(!0),this.canPush=new Promise((e=>{this.resolvePush=e}))}async pop(){await this.canGet;const e=this._queue.pop();return this.resolvePush(!0),this.canGet=new Promise((e=>{this.resolveGet=e})),e}}},5544:(e,t,n)=>{const{TypeNotFoundError:s}=n(8187),{coreObjects:a}=n(2058),{tlobjects:i}=n(845),{readBigIntFromBuffer:o}=n(9618);e.exports=class{constructor(e){this.stream=e,this._last=void 0,this.offset=0}readByte(){return this.read(1)[0]}readInt(e=!0){let t;return t=e?this.stream.readInt32LE(this.offset):this.stream.readUInt32LE(this.offset),this.offset+=4,t}readLong(e=!0){return this.readLargeInt(64,e)}readFloat(){return this.read(4).readFloatLE(0)}readDouble(){return this.read(8).readDoubleLE(0)}readLargeInt(e,t=!0){const n=this.read(Math.floor(e/8));return o(n,!0,t)}read(e=-1){-1===e&&(e=this.stream.length-this.offset);const t=this.stream.slice(this.offset,this.offset+e);if(this.offset+=e,t.length!==e)throw Error(`No more data left to read (need ${e}, got ${t.length}: ${t}); last read ${this._last}`);return this._last=t,t}getBuffer(){return this.stream}tgReadBytes(){const e=this.readByte();let t,n;254===e?(n=this.readByte()|this.readByte()<<8|this.readByte()<<16,t=n%4):(n=e,t=(n+1)%4);const s=this.read(n);return t>0&&(t=4-t,this.read(t)),s}tgReadString(){return this.tgReadBytes().toString("utf-8")}tgReadBool(){const e=this.readInt(!1);if(2574415285===e)return!0;if(3162085175===e)return!1;throw new Error(`Invalid boolean code ${e.toString("16")}`)}tgReadDate(){const e=this.readInt();return new Date(1e3*e)}tgReadObject(){const e=this.readInt(!1);let t=i[e];if(void 0===t){if(2574415285===e)return!0;if(3162085175===e)return!1;if(481674261===e){const e=[],t=this.readInt();for(let n=0;n{var s=n(8764).Buffer;e.exports=class{constructor(e){this._stream=e}write(e){this._stream=s.concat([this._stream,e])}getValue(){return this._stream}}},6748:e=>{let t;class n{constructor(e){t||(t=e||"debug"),this.isBrowser="undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs,this.isBrowser?this.colors={start:"%c",warn:"color : #ff00ff",info:"color : #ffff00",debug:"color : #00ffff",error:"color : #ff0000",end:""}:this.colors={start:"",warn:"",info:"",debug:"",error:"",end:""},this.messageFormat="[%t] [%l] - [%m]"}static setLevel(e){t=e}canSend(e){return n.levels.indexOf(t)>=n.levels.indexOf(e)}warn(e){"debug"===t&&console.error((new Error).stack),this._log("warn",e,this.colors.warn)}info(e){this._log("info",e,this.colors.info)}debug(e){this._log("debug",e,this.colors.debug)}error(e){"debug"===t&&console.error((new Error).stack),this._log("error",e,this.colors.error)}format(e,t){return this.messageFormat.replace("%t",(new Date).toISOString()).replace("%l",t.toUpperCase()).replace("%m",e)}_log(e,n,s){t&&this.canSend(e)&&(this.isBrowser?console.log(this.colors.start+this.format(n,e),s):console.log(s+this.format(n,e)+this.colors.end))}}var s,a,i;i=["error","warn","info","debug"],(a="levels")in(s=n)?Object.defineProperty(s,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):s[a]=i,e.exports=n},6411:(e,t,n)=>{var s=n(8764).Buffer;const a=n(3254),i=n(355),o=n(6472),r=["messages.SendMessage","messages.SendMedia","messages.SendMultiMedia","messages.ForwardMessages","messages.SendInlineBotResult"];e.exports=class{constructor(e,t){this._state=e,this._queue=[],this._pendingStates=[],this._ready=new Promise((e=>{this.setReady=e})),this._log=t}values(){return this._queue}append(e){if(e&&r.includes(e.request.className))for(let t=this._queue.length-1;t>=0;t--)if(r.includes(this._queue[t].request.className)){e.after=this._queue[t];break}this._queue.push(e),this.setReady(!0),e&&(this._pendingStates.push(e),e.promise.catch((()=>{})).finally((()=>{this._pendingStates=this._pendingStates.filter((t=>t!==e))})))}extend(e){for(const t of e)this._queue.push(t);this.setReady(!0)}async get(){if(this._queue.length||(this._ready=new Promise((e=>{this.setReady=e})),await this._ready),!this._queue[this._queue.length-1])return void(this._queue=[]);let e,t=new o(s.alloc(0));const n=[];let r=0;for(;this._queue.length&&n.length<=a.MAXIMUM_LENGTH;){const e=this._queue.shift();if(r+=e.data.length+i.SIZE_OVERHEAD,r<=a.MAXIMUM_SIZE){let s;e.after&&(s=e.after.msgId),e.msgId=await this._state.writeDataAsMessage(t,e.data,"request"===e.request.classType,s),this._log.debug(`Assigned msgId = ${e.msgId} to ${e.request.className||e.request.constructor.name}`),n.push(e)}else{if(n.length){this._queue.unshift(e);break}this._log.warn(`Message payload for ${e.request.className||e.request.constructor.name} is too long ${e.data.length} and cannot be sent`),e.reject("Request Payload is too big"),r=0}}if(n.length){if(n.length>1){const i=s.alloc(8);i.writeUInt32LE(a.CONSTRUCTOR_ID,0),i.writeInt32LE(n.length,4),e=s.concat([i,t.getValue()]),t=new o(s.alloc(0));const r=await this._state.writeDataAsMessage(t,e,!1);for(const e of n)e.containerId=r}return e=t.getValue(),{batch:n,data:e}}}rejectAll(){this._pendingStates.forEach((e=>{e.reject(new Error("Disconnect"))}))}}},7214:(e,t,n)=>{var s=n(8764).Buffer;const{Mutex:a}=n(8125),i=new a,o=n(5840).w3cwebsocket,r=new Error("WebSocket was closed");e.exports=class{constructor(e){this.client=void 0,this.closed=!0,this.disconnectedCallback=e}async readExactly(e){let t=s.alloc(0);for(;;){const n=await this.read(e);if(t=s.concat([t,n]),!(e-=n.length))return t}}async read(e){if(this.closed)throw r;if(await this.canRead,this.closed)throw r;const t=this.stream.slice(0,e);return this.stream=this.stream.slice(e),0===this.stream.length&&(this.canRead=new Promise((e=>{this.resolveRead=e}))),t}async readAll(){if(this.closed||!await this.canRead)throw r;const e=this.stream;return this.stream=s.alloc(0),this.canRead=new Promise((e=>{this.resolveRead=e})),e}getWebSocketLink(e,t){return 443===t?`wss://${e}:${t}/apiws`:`ws://${e}:${t}/apiws`}connect(e,t){return this.stream=s.alloc(0),this.canRead=new Promise((e=>{this.resolveRead=e})),this.closed=!1,this.website=this.getWebSocketLink(t,e),this.client=new o(this.website,"binary"),new Promise(((e,n)=>{this.client.onopen=()=>{this.receive(),e(this)},this.client.onerror=e=>{console.error("WebSocket error",e),n(e)},this.client.onclose=e=>{const{code:n,reason:s,wasClean:a}=e;1e3!==n&&console.error(`Socket ${t} closed. Code: ${n}, reason: ${s}, was clean: ${a}`),this.resolveRead(!1),this.closed=!0,this.disconnectedCallback&&this.disconnectedCallback()},self.addEventListener("offline",(async()=>{await this.close(),this.resolveRead(!1)}))}))}write(e){if(this.closed)throw r;this.client.send(e)}async close(){await this.client.close(),this.closed=!0}receive(){this.client.onmessage=async e=>{const t=await i.acquire();try{const n=e.data instanceof ArrayBuffer?s.from(e.data):s.from(await new Response(e.data).arrayBuffer());this.stream=s.concat([this.stream,n]),this.resolveRead(!0)}finally{t()}}}}},9832:(e,t,n)=>{const s=n(6748),a=n(6472),i=n(5544),o=n(7214),r=n(6411),c=n(6151);e.exports={BinaryWriter:a,BinaryReader:i,MessagePacker:r,AsyncQueue:c,Logger:s,PromisedWebSockets:o}},3522:(e,t,n)=>{const s=n(7150),a=n(8742),i=n(8415),o=n(7404),r=n(1472),c=n(3182),d=n(8960),l=n(7873),u=n(5886),g=n(9832),p=n(9618);e.exports={Api:s,TelegramClient:a,sessions:u,connection:i,extensions:g,tl:o,version:r,events:c,utils:d,errors:l,helpers:p}},9870:(e,t,n)=>{"use strict";n.r(t),n.d(t,{doAuthentication:()=>_});var s=n(7150),a=n.n(s),i=n(7873),o=n(4736),r=n.n(o);n(9618),n(8764).Buffer;const c=[{fingerprint:r()("-3414540481677951611"),n:r()("29379598170669337022986177149456128565388431120058863768162556424047512191330847455146576344487764408661701890505066208632169112269581063774293102577308490531282748465986139880977280302242772832972539403531316010870401287642763009136156734339538042419388722777357134487746169093539093850251243897188928735903389451772730245253062963384108812842079887538976360465290946139638691491496062099570836476454855996319192747663615955633778034897140982517446405334423701359108810182097749467210509584293428076654573384828809574217079944388301239431309115013843331317877374435868468779972014486325557807783825502498215169806323"),e:65537}],d=new Map;c.forEach((({fingerprint:e,...t})=>{d.set(e.toString(),t)}));var l=n(8764).Buffer;const u=n(4736),g=n(2608),p=n(3302),f=n(9636),h=n(9618),m=n(5544);async function _(e,t){let n=h.generateRandomBytes(16);const s=h.readBigIntFromBuffer(n,!1,!0),o=await e.send(new(a().ReqPqMulti)({nonce:s}));if(t.debug("Starting authKey generation step 1"),!(o instanceof a().ResPQ))throw new i.SecurityError(`Step 1 answer was ${o}`);if(o.nonce.neq(s))throw new i.SecurityError("Step 1 invalid nonce from server");const r=h.readBigIntFromBuffer(o.pq,!1,!0);t.debug("Finished authKey generation step 1");const{p:c,q:_}=f.factorize(r),y=h.getByteArray(c),b=h.getByteArray(_);n=h.generateRandomBytes(32);const w=h.readBigIntFromBuffer(n,!0,!0),I=new(a().PQInnerData)({pq:h.getByteArray(r),p:y,q:b,nonce:o.nonce,serverNonce:o.serverNonce,newNonce:w}).getBytes();if(I.length>144)throw new i.SecurityError("Step 1 invalid nonce from server");let C,P;for(const e of o.serverPublicKeyFingerprints)if(P=d.get(e.toString()),void 0!==P){C=e;break}if(void 0===C||void 0===P)throw new i.SecurityError("Step 2 could not find a valid key for fingerprints");const v=h.generateRandomBytes(192-I.length),A=l.concat([I,v]),S=l.from(A).reverse();let M;for(let e=0;e<20;e++){const e=h.generateRandomBytes(32),n=await h.sha256(l.concat([e,A])),s=l.concat([S,n]),a=new g(e,l.alloc(32)).encryptIge(s),i=h.bufferXor(e,await h.sha256(a)),o=l.concat([i,a]),r=h.readBigIntFromBuffer(o,!1,!1);if(r.greaterOrEquals(P.n)){t.debug("Aes key greater than RSA. retrying");continue}const c=h.modExp(r,u(P.e),P.n);M=h.readBufferFromBigInt(c,256,!1,!1);break}if(void 0===M)throw new i.SecurityError("Step 2 could create a secure encrypted key");t.debug("Step 2 : Generated a secure aes encrypted data");const k=await e.send(new(a().ReqDHParams)({nonce:o.nonce,serverNonce:o.serverNonce,p:y,q:b,publicKeyFingerprint:C,encryptedData:M}));if(!(k instanceof a().ServerDHParamsOk||k instanceof a().ServerDHParamsFail))throw new Error(`Step 2.1 answer was ${k}`);if(k.nonce.neq(o.nonce))throw new i.SecurityError("Step 2 invalid nonce from server");if(k.serverNonce.neq(o.serverNonce))throw new i.SecurityError("Step 2 invalid server nonce from server");if(k instanceof a().ServerDHParamsFail){const e=await h.sha1(h.toSignedLittleBuffer(w,32).slice(4,20)),t=h.readBigIntFromBuffer(e,!0,!0);if(k.newNonceHash.neq(t))throw new i.SecurityError("Step 2 invalid DH fail nonce from server")}if(!(k instanceof a().ServerDHParamsOk))throw new Error(`Step 2.2 answer was ${k}`);t.debug("Finished authKey generation step 2"),t.debug("Starting authKey generation step 3");const{key:R,iv:U}=await h.generateKeyDataFromNonce(o.serverNonce,w);if(k.encryptedAnswer.length%16!=0)throw new i.SecurityError("Step 3 AES block size mismatch");const E=new g(R,U),D=E.decryptIge(k.encryptedAnswer),T=new m(D);T.read(20);const B=T.tgReadObject();if(!(B instanceof a().ServerDHInnerData))throw new Error(`Step 3 answer was ${B}`);if(B.nonce.neq(o.nonce))throw new i.SecurityError("Step 3 Invalid nonce in encrypted answer");if(B.serverNonce.neq(o.serverNonce))throw new i.SecurityError("Step 3 Invalid server nonce in encrypted answer");const x=h.readBigIntFromBuffer(B.dhPrime,!1,!1),V=h.readBigIntFromBuffer(B.gA,!1,!1),N=B.serverTime-Math.floor((new Date).getTime()/1e3),F=h.readBigIntFromBuffer(h.generateRandomBytes(256),!1,!1),O=h.modExp(u(B.g),F,x),L=h.modExp(V,F,x),q=new(a().ClientDHInnerData)({nonce:o.nonce,serverNonce:o.serverNonce,retryId:u.zero,gB:h.getByteArray(O,!1)}).getBytes(),H=l.concat([await h.sha1(q),q]),G=E.encryptIge(H),K=await e.send(new(a().SetClientDHParams)({nonce:o.nonce,serverNonce:o.serverNonce,encryptedData:G})),z=[a().DhGenOk,a().DhGenRetry,a().DhGenFail];if(!(K instanceof z[0]||K instanceof z[1]||K instanceof z[2]))throw new Error(`Step 3.1 answer was ${K}`);const{name:W}=K.constructor;if(K.nonce.neq(o.nonce))throw new i.SecurityError(`Step 3 invalid ${W} nonce from server`);if(K.serverNonce.neq(o.serverNonce))throw new i.SecurityError(`Step 3 invalid ${W} server nonce from server`);const j=new p;await j.setKey(h.getByteArray(L));const $=1+["DhGenOk","DhGenRetry","DhGenFail"].indexOf(K.className),J=await j.calcNewNonceHash(w,$);if(K[`newNonceHash${$}`].neq(J))throw new i.SecurityError("Step 3 invalid new nonce hash");if(!(K instanceof a().DhGenOk))throw new Error(`Step 3.2 answer was ${K}`);return t.debug("Finished authKey generation step 3"),{authKey:j,timeOffset:N}}},5585:(e,t,n)=>{var s=n(8764).Buffer;const a=n(4736),i=n(9109),o=n(5544),{InvalidBufferError:r}=n(8187),{toSignedLittleBuffer:c}=n(9618);e.exports=class{constructor(e,t){this._state=new i(e,t),this._connection=e}async send(e){let t=e.getBytes(),n=this._state._getNewMsgId();const i=c(n,8),d=s.alloc(4);d.writeInt32LE(t.length,0);const l=s.concat([s.concat([s.alloc(8),i,d]),t]);if(await this._connection.send(l),t=await this._connection.recv(),t.length<8)throw new r(t);const u=new o(t);if(u.readLong().neq(a(0)))throw new Error("Bad authKeyId");if(n=u.readLong(),n.eq(a(0)))throw new Error("Bad msgId");if(u.readInt()<=0)throw new Error("Bad length");return u.tgReadObject()}}},4046:(e,t,n)=>{const s=n(5585),a=n(9109),i=n(9618),o=n(3302),{doAuthentication:r}=n(9870),c=n(2301),d=n(3254),l=n(8963),u=n(4287),{MsgsAck:g,upload:p,MsgsStateInfo:f,Pong:h}=n(7404).constructors,m=n(6411),_=n(5544),{UpdateConnectionState:y,UpdateServerTimeOffset:b}=n(8415),{BadMessageError:w}=n(8187),{BadServerSalt:I,BadMsgNotification:C,MsgDetailedInfo:P,MsgNewDetailedInfo:v,NewSessionCreated:A,FutureSalts:S,MsgsStateReq:M,MsgResendReq:k,MsgsAllInfo:R}=n(7404).constructors,{SecurityError:U}=n(8187),{InvalidBufferError:E}=n(8187),{LogOut:D}=n(7404).requests.auth,{RPCMessageToError:T}=n(7873),{TypeNotFoundError:B}=n(8187);class x{constructor(e,t){const n={...x.DEFAULT_OPTIONS,...t};this._connection=void 0,this._log=n.logger,this._dcId=n.dcId,this._retries=n.retries,this._delay=n.delay,this._autoReconnect=n.autoReconnect,this._connectTimeout=n.connectTimeout,this._authKeyCallback=n.authKeyCallback,this._updateCallback=n.updateCallback,this._autoReconnectCallback=n.autoReconnectCallback,this._isMainSender=n.isMainSender,this._onConnectionBreak=n.onConnectionBreak,this.userDisconnected=!1,this._user_connected=!1,this._reconnecting=!1,this._disconnected=!0,this._send_loop_handle=void 0,this._recv_loop_handle=void 0,this.authKey=e||new o,this._state=new a(this.authKey,this._log),this._send_queue=new m(this._state,this._log),this._pending_state={},this._pending_ack=new Set,this._last_acks=[],this._handlers={[c.CONSTRUCTOR_ID]:this._handleRPCResult.bind(this),[d.CONSTRUCTOR_ID]:this._handleContainer.bind(this),[l.CONSTRUCTOR_ID]:this._handleGzipPacked.bind(this),[h.CONSTRUCTOR_ID]:this._handlePong.bind(this),[I.CONSTRUCTOR_ID]:this._handleBadServerSalt.bind(this),[C.CONSTRUCTOR_ID]:this._handleBadNotification.bind(this),[P.CONSTRUCTOR_ID]:this._handleDetailedInfo.bind(this),[v.CONSTRUCTOR_ID]:this._handleNewDetailedInfo.bind(this),[A.CONSTRUCTOR_ID]:this._handleNewSessionCreated.bind(this),[g.CONSTRUCTOR_ID]:this._handleAck.bind(this),[S.CONSTRUCTOR_ID]:this._handleFutureSalts.bind(this),[M.CONSTRUCTOR_ID]:this._handleStateForgotten.bind(this),[k.CONSTRUCTOR_ID]:this._handleStateForgotten.bind(this),[R.CONSTRUCTOR_ID]:this._handleMsgAll.bind(this)}}async connect(e,t){if(this._user_connected&&!t)return this._log.info("User is already connected!"),!1;this.isConnecting=!0,this._connection=e;for(let e=0;e{this._log.info("Started reconnecting"),this._reconnect()})))}async _reconnect(){this._log.debug("Closing current connection...");try{await this._disconnect()}catch(e){this._log.warn(e)}this._send_queue.append(void 0),this._state.reset();const e=new this._connection.constructor(this._connection._ip,this._connection._port,this._connection._dcId,this._connection._log);await this.connect(e,!0),this._reconnecting=!1;for(const e of Object.values(this._pending_state))e.deferred.resolve();this._pending_state={},this._autoReconnectCallback&&await this._autoReconnectCallback()}}var V,N,F;F={logger:void 0,retries:1/0,delay:2e3,autoReconnect:!0,connectTimeout:void 0,authKeyCallback:void 0,updateCallback:void 0,autoReconnectCallback:void 0,isMainSender:void 0,onConnectionBreak:void 0},(N="DEFAULT_OPTIONS")in(V=x)?Object.defineProperty(V,N,{value:F,enumerable:!0,configurable:!0,writable:!0}):V[N]=F,e.exports=x},9109:(e,t,n)=>{var s=n(8764).Buffer;const a=n(4736),i=n(9618),o=n(2608),r=n(5544),c=n(8963),{TLMessage:d}=n(2058),{SecurityError:l,InvalidBufferError:u}=n(8187),{InvokeAfterMsg:g}=n(7404).requests,{toSignedLittleBuffer:p}=n(9618);e.exports=class{constructor(e,t){this.authKey=e,this._log=t,this.timeOffset=0,this.salt=0,this.id=void 0,this._sequence=void 0,this._lastMsgId=void 0,this.reset()}reset(){this.id=i.generateRandomLong(!0),this._sequence=0,this._lastMsgId=a(0)}updateMessageId(e){e.msgId=this._getNewMsgId()}async _calcKey(e,t,n){const a=!0===n?0:8,[o,r]=await Promise.all([i.sha256(s.concat([t,e.slice(a,a+36)])),i.sha256(s.concat([e.slice(a+40,a+76),t]))]);return{key:s.concat([o.slice(0,8),r.slice(8,24),o.slice(24,32)]),iv:s.concat([r.slice(0,8),o.slice(8,24),r.slice(24,32)])}}async writeDataAsMessage(e,t,n,a){const i=this._getNewMsgId(),o=this._getSeqNo(n);let r;r=a?await c.gzipIfSmaller(n,new g(a,{getBytes:()=>t}).getBytes()):await c.gzipIfSmaller(n,t);const d=s.alloc(4);d.writeInt32LE(o,0);const l=s.alloc(4);l.writeInt32LE(r.length,0);const u=p(i,8);return e.write(s.concat([u,d,l])),e.write(r),i}async encryptMessageData(e){await this.authKey.waitForKey();const t=p(this.salt,8),n=p(this.id,8);e=s.concat([s.concat([t,n]),e]);const a=i.generateRandomBytes(i.mod(-(e.length+12),16)+12),r=(await i.sha256(s.concat([this.authKey.getKey().slice(88,120),e,a]))).slice(8,24),{iv:c,key:d}=await this._calcKey(this.authKey.getKey(),r,!0),l=i.readBufferFromBigInt(this.authKey.keyId,8);return s.concat([l,r,new o(d,c).encryptIge(s.concat([e,a]))])}async decryptMessageData(e){if(e.length<8)throw new u(e);if(e.length<0)throw new l("Server replied with negative length");if(e.length%4!=0)throw new l("Server replied with length not divisible by 4");if(i.readBigIntFromBuffer(e.slice(0,8)).neq(this.authKey.keyId))throw new l("Server replied with an invalid auth key");const t=e.slice(8,24),{iv:n,key:a}=await this._calcKey(this.authKey.getKey(),t,!1);e=new o(a,n).decryptIge(e.slice(24));const c=await i.sha256(s.concat([this.authKey.getKey().slice(96,128),e]));if(!t.equals(c.slice(8,24)))throw new l("Received msg_key doesn't match with expected one");const g=new r(e);if(g.readLong(),!g.readLong().eq(this.id))throw new l("Server replied with a wrong session ID");const p=g.readLong(),f=g.readInt(),h=g.readInt(),m=e.length-h;if(m<12||m>1024)throw new l("Server replied with the wrong message padding");const _=g.tgReadObject();return new d(p,f,_)}_getNewMsgId(){const e=(new Date).getTime()/1e3+this.timeOffset,t=Math.floor(1e9*(e-Math.floor(e)));let n=a(Math.floor(e)).shiftLeft(a(32)).or(a(t).shiftLeft(a(2)));return this._lastMsgId.greaterOrEquals(n)&&(n=this._lastMsgId.add(a(4))),this._lastMsgId=n,n}updateTimeOffset(e){const t=this._getNewMsgId(),n=this.timeOffset,s=Math.floor((new Date).getTime()/1e3),i=e.shiftRight(a(32));return this.timeOffset=i-s,this.timeOffset!==n&&(this._lastMsgId=a(0),this._log.debug(`Updated time offset (old offset ${n}, bad ${t}, good ${e}, new ${this.timeOffset})`)),this.timeOffset}_getSeqNo(e){if(e){const e=2*this._sequence+1;return this._sequence+=1,e}return 2*this._sequence}}},4287:(e,t,n)=>{const{createDeferred:s}=n(9618);e.exports=class{constructor(e,t,n={}){this.containerId=void 0,this.msgId=void 0,this.request=e,this.data=e.getBytes(),this.after=t,this.result=void 0,this.pending=n,this.deferred=s(),this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}isReady(){const e=this.pending[this.after.id];return!e||e.deferred.promise}}},4353:(e,t,n)=>{function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=n(7214),i=n(6151);class o{constructor(e,t,n,o){s(this,"PacketCodecClass",void 0),this._ip=e,this._port=t,this._dcId=n,this._log=o,this._connected=!1,this._sendTask=void 0,this._recvTask=void 0,this._codec=void 0,this._obfuscation=void 0,this._sendArray=new i,this._recvArray=new i,this.socket=new a(this.disconnectCallback.bind(this))}async disconnectCallback(){await this.disconnect(!0)}async _connect(){this._log.debug("Connecting"),this._codec=new this.PacketCodecClass(this),await this.socket.connect(this._port,this._ip,this),this._log.debug("Finished connecting"),await this._initConn()}async connect(){await this._connect(),this._connected=!0,this._sendTask||(this._sendTask=this._sendLoop()),this._recvTask=this._recvLoop()}async disconnect(e=!1){this._connected&&(this._connected=!1,this._recvArray.push(void 0),e||await this.socket.close())}async send(e){if(!this._connected)throw new Error("Not connected");await this._sendArray.push(e)}async recv(){for(;this._connected;){const e=await this._recvArray.pop();if(e)return e}throw new Error("Not connected")}async _sendLoop(){try{for(;this._connected;){const e=await this._sendArray.pop();if(!e)return void(this._sendTask=void 0);await this._send(e)}}catch(e){this._log.info("The server closed the connection while sending")}}async _recvLoop(){let e;for(;this._connected;){try{if(e=await this._recv(),!e)throw new Error("no data received")}catch(e){return this._log.info("connection closed"),void this.disconnect()}await this._recvArray.push(e)}}async _initConn(){this._codec.tag&&await this.socket.write(this._codec.tag)}_send(e){const t=this._codec.encodePacket(e);this.socket.write(t)}_recv(){return this._codec.readPacket(this.socket)}toString(){return`${this._ip}:${this._port}/${this.constructor.name.replace("Connection","")}`}}e.exports={Connection:o,PacketCodec:class{constructor(e){this._conn=e}encodePacket(e){throw new Error("Not Implemented")}readPacket(e){throw new Error("Not Implemented")}},ObfuscatedConnection:class extends o{constructor(...e){super(...e),s(this,"ObfuscatedIO",void 0)}_initConn(){this._obfuscation=new this.ObfuscatedIO(this),this.socket.write(this._obfuscation.header)}_send(e){this._obfuscation.write(this._codec.encodePacket(e))}_recv(){return this._codec.readPacket(this._obfuscation)}}}},6302:(e,t,n)=>{var s=n(8764).Buffer;function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const i=n(4736),{readBufferFromBigInt:o}=n(9618),{Connection:r,PacketCodec:c}=n(4353);class d extends c{constructor(e){super(e),this.tag=d.tag,this.obfuscateTag=d.obfuscateTag}encodePacket(e){let t=e.length>>2;if(t<127){const e=s.alloc(1);e.writeUInt8(t,0),t=e}else t=s.concat([s.from("7f","hex"),o(i(t),3)]);return s.concat([t,e])}async readPacket(e){let t=(await e.read(1))[0];return t>=127&&(t=s.concat([await e.read(3),s.alloc(1)]).readInt32LE(0)),e.read(t<<2)}}a(d,"tag",s.from("ef","hex")),a(d,"obfuscateTag",s.from("efefefef","hex")),e.exports={ConnectionTCPAbridged:class extends r{constructor(...e){super(...e),a(this,"PacketCodecClass",d)}},AbridgedPacketCodec:d}},5484:()=>{},2986:(e,t,n)=>{var s=n(8764).Buffer;function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{generateRandomBytes:i}=n(9618),{ObfuscatedConnection:o}=n(4353),{AbridgedPacketCodec:r}=n(6302),c=n(5830);class d{constructor(e){a(this,"header",void 0),this.connection=e.socket;const t=this.initHeader(e.PacketCodecClass);this.header=t.random,this._encrypt=t.encryptor,this._decrypt=t.decryptor}initHeader(e){const t=[s.from("50567247","hex"),s.from("474554","hex"),s.from("504f5354","hex"),s.from("eeeeeeee","hex")];let n;for(;;)if(n=i(64),239!==n[0]&&!n.slice(4,8).equals(s.alloc(4))){let e=!0;for(const s of t)if(s.equals(n.slice(0,4))){e=!1;break}if(e)break}n=n.toJSON().data;const a=s.from(n.slice(8,56)).reverse(),o=s.from(n.slice(8,40)),r=s.from(n.slice(40,56)),d=s.from(a.slice(0,32)),l=s.from(a.slice(32,48)),u=new c(o,r),g=new c(d,l);return n=s.concat([s.from(n.slice(0,56)),e.obfuscateTag,s.from(n.slice(60))]),n=s.concat([s.from(n.slice(0,56)),s.from(u.encrypt(n).slice(56,64)),s.from(n.slice(64))]),{random:n,encryptor:u,decryptor:g}}async read(e){const t=await this.connection.readExactly(e);return this._decrypt.encrypt(t)}write(e){this.connection.write(this._encrypt.encrypt(e))}}e.exports={ConnectionTCPObfuscated:class extends o{constructor(...e){super(...e),a(this,"ObfuscatedIO",d),a(this,"PacketCodecClass",r)}}}},417:(e,t,n)=>{const{Connection:s}=n(4353),{ConnectionTCPFull:a}=n(5484),{ConnectionTCPAbridged:i}=n(6302),{ConnectionTCPObfuscated:o}=n(2986);e.exports={Connection:s,ConnectionTCPFull:a,ConnectionTCPAbridged:i,ConnectionTCPObfuscated:o}},8415:(e,t,n)=>{function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=n(5585),i=n(4046);class o{constructor(e){this.state=e}}s(o,"disconnected",-1),s(o,"connected",1),s(o,"broken",0);const{Connection:r,ConnectionTCPFull:c,ConnectionTCPAbridged:d,ConnectionTCPObfuscated:l}=n(417);e.exports={Connection:r,ConnectionTCPFull:c,ConnectionTCPAbridged:d,ConnectionTCPObfuscated:l,MTProtoPlainSender:a,MTProtoSender:i,UpdateConnectionState:o,UpdateServerTimeOffset:class{constructor(e){this.timeOffset=e}}}},9270:e=>{e.exports=class{get dcId(){throw new Error("Not Implemented")}get serverAddress(){throw new Error("Not Implemented")}get port(){throw new Error("Not Implemented")}get authKey(){throw new Error("Not Implemented")}set authKey(e){throw new Error("Not Implemented")}setDC(e,t,n){throw new Error("Not implemented")}save(){throw new Error("Not Implemented")}delete(){throw new Error("Not Implemented")}}},926:(e,t,n)=>{const s=n(8753),a="GramJs";e.exports=class extends s{async _delete(){const e=new Request(this._storageKey);return(await self.caches.open(a)).delete(e)}async _fetchFromCache(){const e=new Request(this._storageKey),t=await self.caches.open(a),n=await t.match(e);return n?n.text():void 0}async _saveToCache(e){const t=new Request(this._storageKey),n=new Response(e);return(await self.caches.open(a)).put(t,n)}}},7:(e,t,n)=>{var s=n(8764).Buffer;const a=n(3995),i=n(3302),o=n(8960);e.exports=class extends a{constructor(e,t){super(),this._sessionData=e,this._callback=t,this._authKeys={}}get authKey(){throw new Error("Not supported")}set authKey(e){throw new Error("Not supported")}async load(){if(!this._sessionData)return;const{mainDcId:e,keys:t,hashes:n}=this._sessionData,{ipAddress:a,port:r}=o.getDC(e);this.setDC(e,a,r,!0),await Promise.all(Object.keys(t).map((async e=>{const a="string"==typeof t[e]?s.from(t[e],"hex"):s.from(t[e]);if(n[e]){const t="string"==typeof n[e]?s.from(n[e],"hex"):s.from(n[e]);this._authKeys[e]=new i(a,t)}else this._authKeys[e]=new i,await this._authKeys[e].setKey(a,!0)})))}setDC(e,t,n,s=!1){this._dcId=e,this._serverAddress=t,this._port=n,delete this._authKeys[e],s||this._onUpdate()}getAuthKey(e=this._dcId){return this._authKeys[e]}setAuthKey(e,t=this._dcId){this._authKeys[t]=e,this._onUpdate()}getSessionData(){const e={mainDcId:this._dcId,keys:{},hashes:{}};return Object.keys(this._authKeys).forEach((t=>{const n=this._authKeys[t];n&&n._key&&(e.keys[t]=n._key.toString("hex"),e.hashes[t]=n._hash.toString("hex"))})),e}_onUpdate(){this._callback(this.getSessionData())}delete(){this._callback(void 0)}}},5945:(e,t,n)=>{const s=n(1875),a=n(8753);e.exports=class extends a{_delete(){return s.del(`GramJs:${this._storageKey}`)}_fetchFromCache(){return s.get(`GramJs:${this._storageKey}`)}_saveToCache(e){return s.set(`GramJs:${this._storageKey}`,e)}}},1753:(e,t,n)=>{const s=n(8753);e.exports=class extends s{_delete(){return localStorage.removeItem(this._storageKey)}_fetchFromCache(){return localStorage.getItem(this._storageKey)}_saveToCache(e){return localStorage.setItem(this._storageKey,e)}}},3995:(e,t,n)=>{const s=n(9270);e.exports=class extends s{constructor(){super(),this._serverAddress=void 0,this._dcId=0,this._port=void 0,this._takeoutId=void 0,this._entities=new Set,this._updateStates={}}get dcId(){return this._dcId}get serverAddress(){return this._serverAddress}get port(){return this._port}get authKey(){return this._authKey}set authKey(e){this._authKey=e}setDC(e,t,n){this._dcId=0|e,this._serverAddress=t,this._port=n}}},8753:(e,t,n)=>{var s=n(8764).Buffer;const a=n(3995),i=n(3302),o=n(8960);e.exports=class extends a{constructor(e){super(),this._authKeys={},e&&e.startsWith("session:")?this._sessionString=e:e&&(this._storageKey=e)}get authKey(){throw new Error("Not supported")}set authKey(e){throw new Error("Not supported")}async load(){if(this._sessionString)await this._loadFromSessionString();else if(this._storageKey)try{const e=await this._fetchFromCache(),{mainDcId:t,keys:n,hashes:a}=JSON.parse(e),{ipAddress:r,port:c}=o.getDC(t);this.setDC(t,r,c,!0),Object.keys(n).forEach((e=>{n[e]&&a[e]&&(this._authKeys[e]=new i(s.from(n[e].data),s.from(a[e].data)))}))}catch(e){console.warn("Failed to retrieve or parse session from storage"),console.warn(e)}}setDC(e,t,n,s=!1){this._dcId=e,this._serverAddress=t,this._port=n,delete this._authKeys[e],s||this._updateStorage()}async save(){return this._storageKey||(this._storageKey=`GramJs-session-${Date.now()}`),await this._updateStorage(),this._storageKey}getAuthKey(e=this._dcId){return this._authKeys[e]}setAuthKey(e,t=this._dcId){this._authKeys[t]=e,this._updateStorage()}getSessionData(e){const t={mainDcId:this._dcId,keys:{},hashes:{}};return Object.keys(this._authKeys).forEach((n=>{const s=this._authKeys[n];s._key&&(t.keys[n]=e?s._key.toString("hex"):s._key,t.hashes[n]=e?s._hash.toString("hex"):s._hash)})),t}async _loadFromSessionString(){const[,e,t]=this._sessionString.split(":"),n=Number(e),{ipAddress:a,port:r}=o.getDC(n);this.setDC(n,a,r);const c=new i;await c.setKey(s.from(t,"hex"),!0),this.setAuthKey(c,n)}async _updateStorage(){if(this._storageKey)try{await this._saveToCache(JSON.stringify(this.getSessionData()))}catch(e){console.warn("Failed to update session in storage"),console.warn(e)}}async delete(){try{return await this._delete()}catch(e){console.warn("Failed to delete session from storage"),console.warn(e)}}_delete(){throw new Error("Not Implemented")}_fetchFromCache(){throw new Error("Not Implemented")}_saveToCache(e){throw new Error("Not Implemented")}}},2433:(e,t,n)=>{var s=n(8764).Buffer;const a=n(3995),i=n(3302),o=n(5544);class r extends a{constructor(e){if(super(),e){if("1"!==e[0])throw new Error("Not a valid string");e=e.slice(1);const t=r.decode(e),n=new o(t);this._dcId=n.read(1).readUInt8(0);const s=n.read(2).readInt16BE(0);this._serverAddress=String(n.read(s)),this._port=n.read(2).readInt16BE(0),this._key=n.read(-1)}}static encode(e){return e.toString("base64")}static decode(e){return s.from(e,"base64")}async load(){this._key&&(this._authKey=new i,await this._authKey.setKey(this._key))}save(){if(!this.authKey)return"";const e=s.from([this.dcId]),t=s.from(this.serverAddress),n=s.alloc(2);n.writeInt16BE(t.length,0);const a=s.alloc(2);return a.writeInt16BE(this.port,0),"1"+r.encode(s.concat([e,n,t,a,this.authKey.getKey()]))}getAuthKey(e){if(!e||e===this.dcId)return this.authKey}setAuthKey(e,t){t&&t!==this.dcId||(this.authKey=e)}}e.exports=r},5886:(e,t,n)=>{const s=n(3995),a=n(2433),i=n(926),o=n(1753),r=n(5945),c=n(7);e.exports={Memory:s,StringSession:a,CacheApiSession:i,LocalStorageSession:o,IdbSession:r,CallbackSession:c}},845:(e,t,n)=>{const s=n(7150),a={};for(const e of Object.values(s))if(e.CONSTRUCTOR_ID)a[e.CONSTRUCTOR_ID]=e;else for(const t of Object.values(e))a[t.CONSTRUCTOR_ID]=t;e.exports={LAYER:131,tlobjects:a}},7150:(e,t,n)=>{var s=n(8764).Buffer;function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{parseTl:i,serializeBytes:o,serializeDate:r}=n(1436),{toSignedLittleBuffer:c}=n(9618),d=n(4779),l=n(8106),u="undefined"!=typeof self&&void 0!==self.localStorage,g="GramJs:apiCache";function p(e){const t=i(e,109),n=[],s=[];for(const e of t)e.isFunction?s.push(e):n.push(e);return[n,s]}function f(e,t){switch(t){case"int":{const t=s.alloc(4);return t.writeInt32LE(e,0),t}case"long":return c(e,8);case"int128":return c(e,16);case"int256":return c(e,32);case"double":{const t=s.alloc(8);return t.writeDoubleLE(e,0),t}case"string":return o(e);case"Bool":return e?s.from("b5757299","hex"):s.from("379779bc","hex");case"true":return s.alloc(0);case"bytes":return o(e);case"date":return r(e);default:return e.getBytes()}}function h(e,t){if(t.isVector){t.useVectorId&&e.readInt();const n=[],s=e.readInt();t.isVector=!1;for(let a=0;a{this[e]=t[e]}))}static fromReader(e){const t={};for(const n in c)if(c.hasOwnProperty(n)){const s=c[n];if(s.isFlag){if("true"===s.type){t[n]=Boolean(t.flags&1<f(t,c[e].type)))))}else if(c[e].flagIndicator)if(Object.values(c).some((e=>e.isFlag))){let e=0;for(const t in c)c[t].isFlag&&(!1===this[t]&&"true"===c[t].type||void 0===this[t]?e|=0:e|=1</);if(n){t.readInt();const e=[],s=t.readInt();if("int"===n[1])for(let n=0;n{"function"!=typeof t[e]&&n[e]?Object.assign(n[e],t[e]):n[e]=t[e]})),n}(m("constructor",e.constructors),m("request",e.requests))}()},4779:e=>{e.exports="boolFalse#bc799737 = Bool;\nboolTrue#997275b5 = Bool;\ntrue#3fedd339 = True;\nvector#1cb5c415 {t:Type} # [ t ] = Vector t;\nerror#c4b9f9bb code:int text:string = Error;\nnull#56730bcc = Null;\ninputPeerEmpty#7f3b18ea = InputPeer;\ninputPeerSelf#7da07ec9 = InputPeer;\ninputPeerChat#179be863 chat_id:int = InputPeer;\ninputPeerUser#7b8e7de6 user_id:int access_hash:long = InputPeer;\ninputPeerChannel#20adaef8 channel_id:int access_hash:long = InputPeer;\ninputPeerUserFromMessage#17bae2e6 peer:InputPeer msg_id:int user_id:int = InputPeer;\ninputPeerChannelFromMessage#9c95f7bb peer:InputPeer msg_id:int channel_id:int = InputPeer;\ninputUserEmpty#b98886cf = InputUser;\ninputUserSelf#f7c1b13f = InputUser;\ninputUser#d8292816 user_id:int access_hash:long = InputUser;\ninputUserFromMessage#2d117597 peer:InputPeer msg_id:int user_id:int = InputUser;\ninputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;\ninputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;\ninputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;\ninputMediaEmpty#9664f57f = InputMedia;\ninputMediaUploadedPhoto#1e287d04 flags:# file:InputFile stickers:flags.0?Vector ttl_seconds:flags.1?int = InputMedia;\ninputMediaPhoto#b3ba0635 flags:# id:InputPhoto ttl_seconds:flags.0?int = InputMedia;\ninputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;\ninputMediaContact#f8ab7dfb phone_number:string first_name:string last_name:string vcard:string = InputMedia;\ninputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true force_file:flags.4?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector stickers:flags.0?Vector ttl_seconds:flags.1?int = InputMedia;\ninputMediaDocument#33473058 flags:# id:InputDocument ttl_seconds:flags.0?int query:flags.1?string = InputMedia;\ninputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia;\ninputMediaPhotoExternal#e5bbfe1a flags:# url:string ttl_seconds:flags.0?int = InputMedia;\ninputMediaDocumentExternal#fb52dc99 flags:# url:string ttl_seconds:flags.0?int = InputMedia;\ninputMediaGame#d33f43f3 id:InputGame = InputMedia;\ninputMediaInvoice#d9799874 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:flags.1?string = InputMedia;\ninputMediaGeoLive#971fa843 flags:# stopped:flags.0?true geo_point:InputGeoPoint heading:flags.2?int period:flags.1?int proximity_notification_radius:flags.3?int = InputMedia;\ninputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector solution:flags.1?string solution_entities:flags.1?Vector = InputMedia;\ninputMediaDice#e66fbf7b emoticon:string = InputMedia;\ninputChatPhotoEmpty#1ca48f57 = InputChatPhoto;\ninputChatUploadedPhoto#c642724e flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = InputChatPhoto;\ninputChatPhoto#8953ad37 id:InputPhoto = InputChatPhoto;\ninputGeoPointEmpty#e4c123d6 = InputGeoPoint;\ninputGeoPoint#48222faf flags:# lat:double long:double accuracy_radius:flags.0?int = InputGeoPoint;\ninputPhotoEmpty#1cd7bf0d = InputPhoto;\ninputPhoto#3bb3b94a id:long access_hash:long file_reference:bytes = InputPhoto;\ninputFileLocation#dfdaabe1 volume_id:long local_id:int secret:long file_reference:bytes = InputFileLocation;\ninputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;\ninputDocumentFileLocation#bad07584 id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;\ninputSecureFileLocation#cbc7ee28 id:long access_hash:long = InputFileLocation;\ninputTakeoutFileLocation#29be5899 = InputFileLocation;\ninputPhotoFileLocation#40181ffe id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;\ninputPhotoLegacyFileLocation#d83466f3 id:long access_hash:long file_reference:bytes volume_id:long local_id:int secret:long = InputFileLocation;\ninputPeerPhotoFileLocation#37257e99 flags:# big:flags.0?true peer:InputPeer photo_id:long = InputFileLocation;\ninputStickerSetThumb#9d84f3db stickerset:InputStickerSet thumb_version:int = InputFileLocation;\ninputGroupCallStream#bba51639 call:InputGroupCall time_ms:long scale:int = InputFileLocation;\npeerUser#9db1bc6d user_id:int = Peer;\npeerChat#bad0e5bb chat_id:int = Peer;\npeerChannel#bddde532 channel_id:int = Peer;\nstorage.fileUnknown#aa963b05 = storage.FileType;\nstorage.filePartial#40bc6f52 = storage.FileType;\nstorage.fileJpeg#7efe0e = storage.FileType;\nstorage.fileGif#cae1aadf = storage.FileType;\nstorage.filePng#a4f63c0 = storage.FileType;\nstorage.filePdf#ae1e508d = storage.FileType;\nstorage.fileMp3#528a0677 = storage.FileType;\nstorage.fileMov#4b09ebbc = storage.FileType;\nstorage.fileMp4#b3cea0e4 = storage.FileType;\nstorage.fileWebp#1081464c = storage.FileType;\nuserEmpty#200250ba id:int = User;\nuser#938458c1 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;\nuserProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;\nuserProfilePhoto#82d1f706 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto;\nuserStatusEmpty#9d05049 = UserStatus;\nuserStatusOnline#edb93949 expires:int = UserStatus;\nuserStatusOffline#8c703f was_online:int = UserStatus;\nuserStatusRecently#e26f42f1 = UserStatus;\nuserStatusLastWeek#7bf09fc = UserStatus;\nuserStatusLastMonth#77ebc742 = UserStatus;\nchatEmpty#9ba2d800 id:int = Chat;\nchat#3bda1bde flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat;\nchatForbidden#7328bdb id:int title:string = Chat;\nchannel#d31a961e flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true id:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?Vector admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat;\nchannelForbidden#289da732 flags:# broadcast:flags.5?true megagroup:flags.8?true id:int access_hash:long title:string until_date:flags.16?int = Chat;\nchatFull#8a1e2983 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:int about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer = ChatFull;\nchannelFull#548c3f93 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?int location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector groupcall_default_join_as:flags.26?Peer = ChatFull;\nchatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;\nchatParticipantCreator#da13538a user_id:int = ChatParticipant;\nchatParticipantAdmin#e2d6e436 user_id:int inviter_id:int date:int = ChatParticipant;\nchatParticipantsForbidden#fc900c2b flags:# chat_id:int self_participant:flags.0?ChatParticipant = ChatParticipants;\nchatParticipants#3f460fed chat_id:int participants:Vector version:int = ChatParticipants;\nchatPhotoEmpty#37c1011c = ChatPhoto;\nchatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = ChatPhoto;\nmessageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = Message;\nmessage#bce383d2 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector ttl_period:flags.25?int = Message;\nmessageService#2b085862 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction ttl_period:flags.25?int = Message;\nmessageMediaEmpty#3ded6320 = MessageMedia;\nmessageMediaPhoto#695150d7 flags:# photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia;\nmessageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;\nmessageMediaContact#cbf24940 phone_number:string first_name:string last_name:string vcard:string user_id:int = MessageMedia;\nmessageMediaUnsupported#9f84f49e = MessageMedia;\nmessageMediaDocument#9cb070d7 flags:# document:flags.0?Document ttl_seconds:flags.2?int = MessageMedia;\nmessageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;\nmessageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia;\nmessageMediaGame#fdb19008 game:Game = MessageMedia;\nmessageMediaInvoice#84551347 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string = MessageMedia;\nmessageMediaGeoLive#b940c666 flags:# geo:GeoPoint heading:flags.0?int period:int proximity_notification_radius:flags.1?int = MessageMedia;\nmessageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia;\nmessageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia;\nmessageActionEmpty#b6aef7b0 = MessageAction;\nmessageActionChatCreate#a6638b9a title:string users:Vector = MessageAction;\nmessageActionChatEditTitle#b5a1ce5a title:string = MessageAction;\nmessageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;\nmessageActionChatDeletePhoto#95e3fbef = MessageAction;\nmessageActionChatAddUser#488a7337 users:Vector = MessageAction;\nmessageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;\nmessageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction;\nmessageActionChannelCreate#95d2ac92 title:string = MessageAction;\nmessageActionChatMigrateTo#51bdb021 channel_id:int = MessageAction;\nmessageActionChannelMigrateFrom#b055eaee title:string chat_id:int = MessageAction;\nmessageActionPinMessage#94bd38ed = MessageAction;\nmessageActionHistoryClear#9fbab604 = MessageAction;\nmessageActionGameScore#92a72876 game_id:long score:int = MessageAction;\nmessageActionPaymentSentMe#8f31b327 flags:# currency:string total_amount:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string charge:PaymentCharge = MessageAction;\nmessageActionPaymentSent#40699cd0 currency:string total_amount:long = MessageAction;\nmessageActionPhoneCall#80e11a7f flags:# video:flags.2?true call_id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = MessageAction;\nmessageActionScreenshotTaken#4792929b = MessageAction;\nmessageActionCustomAction#fae69f56 message:string = MessageAction;\nmessageActionBotAllowed#abe9affe domain:string = MessageAction;\nmessageActionSecureValuesSentMe#1b287353 values:Vector credentials:SecureCredentialsEncrypted = MessageAction;\nmessageActionSecureValuesSent#d95c6154 types:Vector = MessageAction;\nmessageActionContactSignUp#f3f25f76 = MessageAction;\nmessageActionGeoProximityReached#98e0d697 from_id:Peer to_id:Peer distance:int = MessageAction;\nmessageActionGroupCall#7a0d7f42 flags:# call:InputGroupCall duration:flags.0?int = MessageAction;\nmessageActionInviteToGroupCall#76b9f11a call:InputGroupCall users:Vector = MessageAction;\nmessageActionSetMessagesTTL#aa1afbfd period:int = MessageAction;\nmessageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction;\ndialog#2c171f72 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int = Dialog;\ndialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;\nphotoEmpty#2331b22d id:long = Photo;\nphoto#fb197a65 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector video_sizes:flags.1?Vector dc_id:int = Photo;\nphotoSizeEmpty#e17e23c type:string = PhotoSize;\nphotoSize#75c78e60 type:string w:int h:int size:int = PhotoSize;\nphotoCachedSize#21e1ad6 type:string w:int h:int bytes:bytes = PhotoSize;\nphotoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize;\nphotoSizeProgressive#fa3efb95 type:string w:int h:int sizes:Vector = PhotoSize;\nphotoPathSize#d8214d41 type:string bytes:bytes = PhotoSize;\ngeoPointEmpty#1117dd5f = GeoPoint;\ngeoPoint#b2a2f663 flags:# long:double lat:double access_hash:long accuracy_radius:flags.0?int = GeoPoint;\nauth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode;\nauth.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Authorization;\nauth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization;\nauth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;\ninputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;\ninputNotifyUsers#193b4417 = InputNotifyPeer;\ninputNotifyChats#4a95e84e = InputNotifyPeer;\ninputNotifyBroadcasts#b1db7c7e = InputNotifyPeer;\ninputPeerNotifySettings#9c3d198e flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = InputPeerNotifySettings;\npeerNotifySettings#af509d20 flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = PeerNotifySettings;\npeerSettings#733f2961 flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true invite_members:flags.8?true geo_distance:flags.6?int = PeerSettings;\nwallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper;\nwallPaperNoFile#e0804116 id:long flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper;\ninputReportReasonSpam#58dbcab8 = ReportReason;\ninputReportReasonViolence#1e22c78d = ReportReason;\ninputReportReasonPornography#2e59d922 = ReportReason;\ninputReportReasonChildAbuse#adf44ee3 = ReportReason;\ninputReportReasonOther#c1e4a2b1 = ReportReason;\ninputReportReasonCopyright#9b89f93a = ReportReason;\ninputReportReasonGeoIrrelevant#dbd4feed = ReportReason;\ninputReportReasonFake#f5ddd6e7 = ReportReason;\nuserFull#139a9a77 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int = UserFull;\ncontact#f911c994 user_id:int mutual:Bool = Contact;\nimportedContact#d0028438 user_id:int client_id:long = ImportedContact;\ncontactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus;\ncontacts.contactsNotModified#b74ba9d2 = contacts.Contacts;\ncontacts.contacts#eae87e42 contacts:Vector saved_count:int users:Vector = contacts.Contacts;\ncontacts.importedContacts#77d01c3b imported:Vector popular_invites:Vector retry_contacts:Vector users:Vector = contacts.ImportedContacts;\ncontacts.blocked#ade1591 blocked:Vector chats:Vector users:Vector = contacts.Blocked;\ncontacts.blockedSlice#e1664194 count:int blocked:Vector chats:Vector users:Vector = contacts.Blocked;\nmessages.dialogs#15ba6c40 dialogs:Vector messages:Vector chats:Vector users:Vector = messages.Dialogs;\nmessages.dialogsSlice#71e094f3 count:int dialogs:Vector messages:Vector chats:Vector users:Vector = messages.Dialogs;\nmessages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs;\nmessages.messages#8c718e87 messages:Vector chats:Vector users:Vector = messages.Messages;\nmessages.messagesSlice#3a54685e flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int messages:Vector chats:Vector users:Vector = messages.Messages;\nmessages.channelMessages#64479808 flags:# inexact:flags.1?true pts:int count:int offset_id_offset:flags.2?int messages:Vector chats:Vector users:Vector = messages.Messages;\nmessages.messagesNotModified#74535f21 count:int = messages.Messages;\nmessages.chats#64ff9fd5 chats:Vector = messages.Chats;\nmessages.chatsSlice#9cd81144 count:int chats:Vector = messages.Chats;\nmessages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector users:Vector = messages.ChatFull;\nmessages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;\ninputMessagesFilterEmpty#57e2f66c = MessagesFilter;\ninputMessagesFilterPhotos#9609a51c = MessagesFilter;\ninputMessagesFilterVideo#9fc00e65 = MessagesFilter;\ninputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;\ninputMessagesFilterDocument#9eddf188 = MessagesFilter;\ninputMessagesFilterUrl#7ef0dd87 = MessagesFilter;\ninputMessagesFilterGif#ffc86587 = MessagesFilter;\ninputMessagesFilterVoice#50f5c392 = MessagesFilter;\ninputMessagesFilterMusic#3751b49e = MessagesFilter;\ninputMessagesFilterChatPhotos#3a20ecb8 = MessagesFilter;\ninputMessagesFilterPhoneCalls#80c99768 flags:# missed:flags.0?true = MessagesFilter;\ninputMessagesFilterRoundVoice#7a7c17a4 = MessagesFilter;\ninputMessagesFilterRoundVideo#b549da53 = MessagesFilter;\ninputMessagesFilterMyMentions#c1f8e69a = MessagesFilter;\ninputMessagesFilterGeo#e7026d0d = MessagesFilter;\ninputMessagesFilterContacts#e062db83 = MessagesFilter;\ninputMessagesFilterPinned#1bb00451 = MessagesFilter;\nupdateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;\nupdateMessageID#4e90bfd6 id:int random_id:long = Update;\nupdateDeleteMessages#a20db0e5 messages:Vector pts:int pts_count:int = Update;\nupdateUserTyping#5c486927 user_id:int action:SendMessageAction = Update;\nupdateChatUserTyping#86cadb6c chat_id:int from_id:Peer action:SendMessageAction = Update;\nupdateChatParticipants#7761198 participants:ChatParticipants = Update;\nupdateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;\nupdateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update;\nupdateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;\nupdateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;\nupdateEncryptedChatTyping#1710f156 chat_id:int = Update;\nupdateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;\nupdateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;\nupdateChatParticipantAdd#ea4b0e5c chat_id:int user_id:int inviter_id:int date:int version:int = Update;\nupdateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;\nupdateDcOptions#8e5e9873 dc_options:Vector = Update;\nupdateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update;\nupdateServiceNotification#ebe46819 flags:# popup:flags.0?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector = Update;\nupdatePrivacy#ee3b272a key:PrivacyKey rules:Vector = Update;\nupdateUserPhone#12b9417b user_id:int phone:string = Update;\nupdateReadHistoryInbox#9c974fdf flags:# folder_id:flags.0?int peer:Peer max_id:int still_unread_count:int pts:int pts_count:int = Update;\nupdateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;\nupdateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update;\nupdateReadMessagesContents#68c13933 messages:Vector pts:int pts_count:int = Update;\nupdateChannelTooLong#eb0467fb flags:# channel_id:int pts:flags.0?int = Update;\nupdateChannel#b6d45656 channel_id:int = Update;\nupdateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update;\nupdateReadChannelInbox#330b5424 flags:# folder_id:flags.0?int channel_id:int max_id:int still_unread_count:int pts:int = Update;\nupdateDeleteChannelMessages#c37521c9 channel_id:int messages:Vector pts:int pts_count:int = Update;\nupdateChannelMessageViews#98a12b4b channel_id:int id:int views:int = Update;\nupdateChatParticipantAdmin#b6901959 chat_id:int user_id:int is_admin:Bool version:int = Update;\nupdateNewStickerSet#688a30aa stickerset:messages.StickerSet = Update;\nupdateStickerSetsOrder#bb2d201 flags:# masks:flags.0?true order:Vector = Update;\nupdateStickerSets#43ae3dec = Update;\nupdateSavedGifs#9375341e = Update;\nupdateBotInlineQuery#3f2038db flags:# query_id:long user_id:int query:string geo:flags.0?GeoPoint peer_type:flags.1?InlineQueryPeerType offset:string = Update;\nupdateBotInlineSend#e48f964 flags:# user_id:int query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update;\nupdateEditChannelMessage#1b3f4df7 message:Message pts:int pts_count:int = Update;\nupdateBotCallbackQuery#e73547e1 flags:# query_id:long user_id:int peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;\nupdateEditMessage#e40370a3 message:Message pts:int pts_count:int = Update;\nupdateInlineBotCallbackQuery#f9d27a5a flags:# query_id:long user_id:int msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;\nupdateReadChannelOutbox#25d6c9c7 channel_id:int max_id:int = Update;\nupdateDraftMessage#ee2bb969 peer:Peer draft:DraftMessage = Update;\nupdateReadFeaturedStickers#571d2742 = Update;\nupdateRecentStickers#9a422c20 = Update;\nupdateConfig#a229dd06 = Update;\nupdatePtsChanged#3354678f = Update;\nupdateChannelWebPage#40771900 channel_id:int webpage:WebPage pts:int pts_count:int = Update;\nupdateDialogPinned#6e6fe51c flags:# pinned:flags.0?true folder_id:flags.1?int peer:DialogPeer = Update;\nupdatePinnedDialogs#fa0f3ca2 flags:# folder_id:flags.1?int order:flags.0?Vector = Update;\nupdateBotWebhookJSON#8317c0c3 data:DataJSON = Update;\nupdateBotWebhookJSONQuery#9b9240a6 query_id:long data:DataJSON timeout:int = Update;\nupdateBotShippingQuery#e0cdc940 query_id:long user_id:int payload:bytes shipping_address:PostAddress = Update;\nupdateBotPrecheckoutQuery#5d2f3aa9 flags:# query_id:long user_id:int payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update;\nupdatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update;\nupdateLangPackTooLong#46560264 lang_code:string = Update;\nupdateLangPack#56022f4d difference:LangPackDifference = Update;\nupdateFavedStickers#e511996d = Update;\nupdateChannelReadMessagesContents#89893b45 channel_id:int messages:Vector = Update;\nupdateContactsReset#7084a7be = Update;\nupdateChannelAvailableMessages#70db6837 channel_id:int available_min_id:int = Update;\nupdateDialogUnreadMark#e16459c3 flags:# unread:flags.0?true peer:DialogPeer = Update;\nupdateMessagePoll#aca1657b flags:# poll_id:long poll:flags.0?Poll results:PollResults = Update;\nupdateChatDefaultBannedRights#54c01850 peer:Peer default_banned_rights:ChatBannedRights version:int = Update;\nupdateFolderPeers#19360dc0 folder_peers:Vector pts:int pts_count:int = Update;\nupdatePeerSettings#6a7e7366 peer:Peer settings:PeerSettings = Update;\nupdatePeerLocated#b4afcfb0 peers:Vector = Update;\nupdateNewScheduledMessage#39a51dfb message:Message = Update;\nupdateDeleteScheduledMessages#90866cee peer:Peer messages:Vector = Update;\nupdateTheme#8216fba3 theme:Theme = Update;\nupdateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update;\nupdateLoginToken#564fe691 = Update;\nupdateMessagePollVote#37f69f0b poll_id:long user_id:int options:Vector qts:int = Update;\nupdateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update;\nupdateDialogFilterOrder#a5d72105 order:Vector = Update;\nupdateDialogFilters#3504914f = Update;\nupdatePhoneCallSignalingData#2661bf09 phone_call_id:long data:bytes = Update;\nupdateChannelMessageForwards#6e8a84df channel_id:int id:int forwards:int = Update;\nupdateReadChannelDiscussionInbox#1cc7de54 flags:# channel_id:int top_msg_id:int read_max_id:int broadcast_id:flags.0?int broadcast_post:flags.0?int = Update;\nupdateReadChannelDiscussionOutbox#4638a26c channel_id:int top_msg_id:int read_max_id:int = Update;\nupdatePeerBlocked#246a4b22 peer_id:Peer blocked:Bool = Update;\nupdateChannelUserTyping#6b171718 flags:# channel_id:int top_msg_id:flags.0?int from_id:Peer action:SendMessageAction = Update;\nupdatePinnedMessages#ed85eab5 flags:# pinned:flags.0?true peer:Peer messages:Vector pts:int pts_count:int = Update;\nupdatePinnedChannelMessages#8588878b flags:# pinned:flags.0?true channel_id:int messages:Vector pts:int pts_count:int = Update;\nupdateChat#1330a196 chat_id:int = Update;\nupdateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector version:int = Update;\nupdateGroupCall#a45eb99b chat_id:int call:GroupCall = Update;\nupdatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update;\nupdateChatParticipant#f3b3781f flags:# chat_id:int date:int actor_id:int user_id:int prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update;\nupdateChannelParticipant#7fecb1ec flags:# channel_id:int date:int actor_id:int user_id:int prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update;\nupdateBotStopped#7f9488a user_id:int date:int stopped:Bool qts:int = Update;\nupdateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update;\nupdateBotCommands#cf7e0873 peer:Peer bot_id:int commands:Vector = Update;\nupdates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;\nupdates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;\nupdates.difference#f49ca0 new_messages:Vector new_encrypted_messages:Vector other_updates:Vector chats:Vector users:Vector state:updates.State = updates.Difference;\nupdates.differenceSlice#a8fb1981 new_messages:Vector new_encrypted_messages:Vector other_updates:Vector chats:Vector users:Vector intermediate_state:updates.State = updates.Difference;\nupdates.differenceTooLong#4afe8f6d pts:int = updates.Difference;\nupdatesTooLong#e317af7e = Updates;\nupdateShortMessage#faeff833 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates;\nupdateShortChatMessage#1157b858 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates;\nupdateShort#78d4dec1 update:Update date:int = Updates;\nupdatesCombined#725b04c3 updates:Vector users:Vector chats:Vector date:int seq_start:int seq:int = Updates;\nupdates#74ae4240 updates:Vector users:Vector chats:Vector date:int seq:int = Updates;\nupdateShortSentMessage#9015e101 flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector ttl_period:flags.25?int = Updates;\nphotos.photos#8dca6aa5 photos:Vector users:Vector = photos.Photos;\nphotos.photosSlice#15051f54 count:int photos:Vector users:Vector = photos.Photos;\nphotos.photo#20212ca8 photo:Photo users:Vector = photos.Photo;\nupload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;\nupload.fileCdnRedirect#f18cda44 dc_id:int file_token:bytes encryption_key:bytes encryption_iv:bytes file_hashes:Vector = upload.File;\ndcOption#18b7a10d flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true cdn:flags.3?true static:flags.4?true id:int ip_address:string port:int secret:flags.10?bytes = DcOption;\nconfig#330b4067 flags:# phonecalls_enabled:flags.1?true default_p2p_contacts:flags.3?true preload_featured_stickers:flags.4?true ignore_phone_entities:flags.5?true revoke_pm_inbox:flags.6?true blocked_mode:flags.8?true pfs_enabled:flags.13?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector dc_txt_domain_name:string chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int revoke_time_limit:int revoke_pm_time_limit:int rating_e_decay:int stickers_recent_limit:int stickers_faved_limit:int channels_read_media_period:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int pinned_infolder_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string autoupdate_url_prefix:flags.7?string gif_search_username:flags.9?string venue_search_username:flags.10?string img_search_username:flags.11?string static_maps_provider:flags.12?string caption_length_max:int message_length_max:int webfile_dc_id:int suggested_lang_code:flags.2?string lang_pack_version:flags.2?int base_lang_pack_version:flags.2?int = Config;\nnearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;\nhelp.appUpdate#ccbbce30 flags:# can_not_skip:flags.0?true id:int version:string text:string entities:Vector document:flags.1?Document url:flags.2?string sticker:flags.3?Document = help.AppUpdate;\nhelp.noAppUpdate#c45a6536 = help.AppUpdate;\nhelp.inviteText#18cb9f78 message:string = help.InviteText;\nencryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;\nencryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;\nencryptedChatRequested#62718a82 flags:# folder_id:flags.0?int id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;\nencryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;\nencryptedChatDiscarded#1e1c7c45 flags:# history_deleted:flags.0?true id:int = EncryptedChat;\ninputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;\nencryptedFileEmpty#c21f497e = EncryptedFile;\nencryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;\ninputEncryptedFileEmpty#1837c364 = InputEncryptedFile;\ninputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;\ninputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;\ninputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;\nencryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;\nencryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;\nmessages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;\nmessages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;\nmessages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;\nmessages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;\ninputDocumentEmpty#72f0eaae = InputDocument;\ninputDocument#1abfb575 id:long access_hash:long file_reference:bytes = InputDocument;\ndocumentEmpty#36f8c871 id:long = Document;\ndocument#1e87342b flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:int thumbs:flags.0?Vector video_thumbs:flags.1?Vector dc_id:int attributes:Vector = Document;\nhelp.support#17c6b5f6 phone_number:string user:User = help.Support;\nnotifyPeer#9fd40bd8 peer:Peer = NotifyPeer;\nnotifyUsers#b4c83b4c = NotifyPeer;\nnotifyChats#c007cec3 = NotifyPeer;\nnotifyBroadcasts#d612e8ef = NotifyPeer;\nsendMessageTypingAction#16bf744e = SendMessageAction;\nsendMessageCancelAction#fd5ec8f5 = SendMessageAction;\nsendMessageRecordVideoAction#a187d66f = SendMessageAction;\nsendMessageUploadVideoAction#e9763aec progress:int = SendMessageAction;\nsendMessageRecordAudioAction#d52f73f7 = SendMessageAction;\nsendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction;\nsendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction;\nsendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction;\nsendMessageGeoLocationAction#176f8ba1 = SendMessageAction;\nsendMessageChooseContactAction#628cbc6f = SendMessageAction;\nsendMessageGamePlayAction#dd6a8f48 = SendMessageAction;\nsendMessageRecordRoundAction#88f27fbc = SendMessageAction;\nsendMessageUploadRoundAction#243e1c66 progress:int = SendMessageAction;\nspeakingInGroupCallAction#d92c2285 = SendMessageAction;\nsendMessageHistoryImportAction#dbda9246 progress:int = SendMessageAction;\ncontacts.found#b3134d9d my_results:Vector results:Vector chats:Vector users:Vector = contacts.Found;\ninputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;\ninputPrivacyKeyChatInvite#bdfb0426 = InputPrivacyKey;\ninputPrivacyKeyPhoneCall#fabadc5f = InputPrivacyKey;\ninputPrivacyKeyPhoneP2P#db9e70d2 = InputPrivacyKey;\ninputPrivacyKeyForwards#a4dd4c08 = InputPrivacyKey;\ninputPrivacyKeyProfilePhoto#5719bacc = InputPrivacyKey;\ninputPrivacyKeyPhoneNumber#352dafa = InputPrivacyKey;\ninputPrivacyKeyAddedByPhone#d1219bdd = InputPrivacyKey;\nprivacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;\nprivacyKeyChatInvite#500e6dfa = PrivacyKey;\nprivacyKeyPhoneCall#3d662b7b = PrivacyKey;\nprivacyKeyPhoneP2P#39491cc8 = PrivacyKey;\nprivacyKeyForwards#69ec56a3 = PrivacyKey;\nprivacyKeyProfilePhoto#96151fed = PrivacyKey;\nprivacyKeyPhoneNumber#d19ae46d = PrivacyKey;\nprivacyKeyAddedByPhone#42ffd42b = PrivacyKey;\ninputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;\ninputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;\ninputPrivacyValueAllowUsers#131cc67f users:Vector = InputPrivacyRule;\ninputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule;\ninputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule;\ninputPrivacyValueDisallowUsers#90110467 users:Vector = InputPrivacyRule;\ninputPrivacyValueAllowChatParticipants#4c81c1ba chats:Vector = InputPrivacyRule;\ninputPrivacyValueDisallowChatParticipants#d82363af chats:Vector = InputPrivacyRule;\nprivacyValueAllowContacts#fffe1bac = PrivacyRule;\nprivacyValueAllowAll#65427b82 = PrivacyRule;\nprivacyValueAllowUsers#4d5bbe0c users:Vector = PrivacyRule;\nprivacyValueDisallowContacts#f888fa1a = PrivacyRule;\nprivacyValueDisallowAll#8b73e763 = PrivacyRule;\nprivacyValueDisallowUsers#c7f49b7 users:Vector = PrivacyRule;\nprivacyValueAllowChatParticipants#18be796b chats:Vector = PrivacyRule;\nprivacyValueDisallowChatParticipants#acae0690 chats:Vector = PrivacyRule;\naccount.privacyRules#50a04e45 rules:Vector chats:Vector users:Vector = account.PrivacyRules;\naccountDaysTTL#b8d0afdf days:int = AccountDaysTTL;\ndocumentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;\ndocumentAttributeAnimated#11b58939 = DocumentAttribute;\ndocumentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute;\ndocumentAttributeVideo#ef02ce6 flags:# round_message:flags.0?true supports_streaming:flags.1?true duration:int w:int h:int = DocumentAttribute;\ndocumentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute;\ndocumentAttributeFilename#15590068 file_name:string = DocumentAttribute;\ndocumentAttributeHasStickers#9801d2f7 = DocumentAttribute;\nmessages.stickersNotModified#f1749a22 = messages.Stickers;\nmessages.stickers#e4599bbd hash:int stickers:Vector = messages.Stickers;\nstickerPack#12b299d4 emoticon:string documents:Vector = StickerPack;\nmessages.allStickersNotModified#e86602c3 = messages.AllStickers;\nmessages.allStickers#edfd405f hash:int sets:Vector = messages.AllStickers;\nmessages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;\nwebPageEmpty#eb1477e8 id:long = WebPage;\nwebPagePending#c586da1c id:long date:int = WebPage;\nwebPage#e89c45b2 flags:# id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page attributes:flags.12?Vector = WebPage;\nwebPageNotModified#7311ca11 flags:# cached_page_views:flags.0?int = WebPage;\nauthorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true hash:long device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;\naccount.authorizations#1250abde authorizations:Vector = account.Authorizations;\naccount.password#185b184f flags:# has_recovery:flags.0?true has_secure_values:flags.1?true has_password:flags.2?true current_algo:flags.2?PasswordKdfAlgo srp_B:flags.2?bytes srp_id:flags.2?long hint:flags.3?string email_unconfirmed_pattern:flags.4?string new_algo:PasswordKdfAlgo new_secure_algo:SecurePasswordKdfAlgo secure_random:bytes pending_reset_date:flags.5?int = account.Password;\naccount.passwordSettings#9a5c33e5 flags:# email:flags.0?string secure_settings:flags.1?SecureSecretSettings = account.PasswordSettings;\naccount.passwordInputSettings#c23727c9 flags:# new_algo:flags.0?PasswordKdfAlgo new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string new_secure_settings:flags.2?SecureSecretSettings = account.PasswordInputSettings;\nauth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;\nreceivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;\nchatInviteExported#6e24fc9d flags:# revoked:flags.0?true permanent:flags.5?true link:string admin_id:int date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int = ExportedChatInvite;\nchatInviteAlready#5a686d7c chat:Chat = ChatInvite;\nchatInvite#dfc2f58e flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true title:string photo:Photo participants_count:int participants:flags.4?Vector = ChatInvite;\nchatInvitePeek#61695cb0 chat:Chat expires:int = ChatInvite;\ninputStickerSetEmpty#ffb62b95 = InputStickerSet;\ninputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;\ninputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;\ninputStickerSetAnimatedEmoji#28703c8 = InputStickerSet;\ninputStickerSetDice#e67f520e emoticon:string = InputStickerSet;\nstickerSet#d7df217a flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector thumb_dc_id:flags.4?int thumb_version:flags.4?int count:int hash:int = StickerSet;\nmessages.stickerSet#b60a24a6 set:StickerSet packs:Vector documents:Vector = messages.StickerSet;\nbotCommand#c27ac8c7 command:string description:string = BotCommand;\nbotInfo#98e81d3a user_id:int description:string commands:Vector = BotInfo;\nkeyboardButton#a2fa4880 text:string = KeyboardButton;\nkeyboardButtonUrl#258aff05 text:string url:string = KeyboardButton;\nkeyboardButtonCallback#35bbdb6b flags:# requires_password:flags.0?true text:string data:bytes = KeyboardButton;\nkeyboardButtonRequestPhone#b16a6c29 text:string = KeyboardButton;\nkeyboardButtonRequestGeoLocation#fc796b3f text:string = KeyboardButton;\nkeyboardButtonSwitchInline#568a748 flags:# same_peer:flags.0?true text:string query:string = KeyboardButton;\nkeyboardButtonGame#50f41ccf text:string = KeyboardButton;\nkeyboardButtonBuy#afd93fbb text:string = KeyboardButton;\nkeyboardButtonUrlAuth#10b78d29 flags:# text:string fwd_text:flags.0?string url:string button_id:int = KeyboardButton;\ninputKeyboardButtonUrlAuth#d02e7fd4 flags:# request_write_access:flags.0?true text:string fwd_text:flags.1?string url:string bot:InputUser = KeyboardButton;\nkeyboardButtonRequestPoll#bbc7515d flags:# quiz:flags.0?Bool text:string = KeyboardButton;\nkeyboardButtonRow#77608b83 buttons:Vector = KeyboardButtonRow;\nreplyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup;\nreplyKeyboardForceReply#86b40b08 flags:# single_use:flags.1?true selective:flags.2?true placeholder:flags.3?string = ReplyMarkup;\nreplyKeyboardMarkup#85dd99d1 flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true rows:Vector placeholder:flags.3?string = ReplyMarkup;\nreplyInlineMarkup#48a30254 rows:Vector = ReplyMarkup;\nmessageEntityUnknown#bb92ba95 offset:int length:int = MessageEntity;\nmessageEntityMention#fa04579d offset:int length:int = MessageEntity;\nmessageEntityHashtag#6f635b0d offset:int length:int = MessageEntity;\nmessageEntityBotCommand#6cef8ac7 offset:int length:int = MessageEntity;\nmessageEntityUrl#6ed02538 offset:int length:int = MessageEntity;\nmessageEntityEmail#64e475c2 offset:int length:int = MessageEntity;\nmessageEntityBold#bd610bc9 offset:int length:int = MessageEntity;\nmessageEntityItalic#826f8b60 offset:int length:int = MessageEntity;\nmessageEntityCode#28a20571 offset:int length:int = MessageEntity;\nmessageEntityPre#73924be0 offset:int length:int language:string = MessageEntity;\nmessageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity;\nmessageEntityMentionName#352dca58 offset:int length:int user_id:int = MessageEntity;\ninputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity;\nmessageEntityPhone#9b69e34b offset:int length:int = MessageEntity;\nmessageEntityCashtag#4c4e743f offset:int length:int = MessageEntity;\nmessageEntityUnderline#9c4e7e8b offset:int length:int = MessageEntity;\nmessageEntityStrike#bf0693d4 offset:int length:int = MessageEntity;\nmessageEntityBlockquote#20df5d0 offset:int length:int = MessageEntity;\nmessageEntityBankCard#761e6af4 offset:int length:int = MessageEntity;\ninputChannelEmpty#ee8c1e86 = InputChannel;\ninputChannel#afeb712e channel_id:int access_hash:long = InputChannel;\ninputChannelFromMessage#2a286531 peer:InputPeer msg_id:int channel_id:int = InputChannel;\ncontacts.resolvedPeer#7f077ad9 peer:Peer chats:Vector users:Vector = contacts.ResolvedPeer;\nmessageRange#ae30253 min_id:int max_id:int = MessageRange;\nupdates.channelDifferenceEmpty#3e11affb flags:# final:flags.0?true pts:int timeout:flags.1?int = updates.ChannelDifference;\nupdates.channelDifferenceTooLong#a4bcc6fe flags:# final:flags.0?true timeout:flags.1?int dialog:Dialog messages:Vector chats:Vector users:Vector = updates.ChannelDifference;\nupdates.channelDifference#2064674e flags:# final:flags.0?true pts:int timeout:flags.1?int new_messages:Vector other_updates:Vector chats:Vector users:Vector = updates.ChannelDifference;\nchannelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter;\nchannelMessagesFilter#cd77d957 flags:# exclude_new_messages:flags.1?true ranges:Vector = ChannelMessagesFilter;\nchannelParticipant#15ebac1d user_id:int date:int = ChannelParticipant;\nchannelParticipantSelf#a3289a6d user_id:int inviter_id:int date:int = ChannelParticipant;\nchannelParticipantCreator#447dca4b flags:# user_id:int admin_rights:ChatAdminRights rank:flags.0?string = ChannelParticipant;\nchannelParticipantAdmin#ccbebbaf flags:# can_edit:flags.0?true self:flags.1?true user_id:int inviter_id:flags.1?int promoted_by:int date:int admin_rights:ChatAdminRights rank:flags.2?string = ChannelParticipant;\nchannelParticipantBanned#50a1dfd6 flags:# left:flags.0?true peer:Peer kicked_by:int date:int banned_rights:ChatBannedRights = ChannelParticipant;\nchannelParticipantLeft#1b03f006 peer:Peer = ChannelParticipant;\nchannelParticipantsRecent#de3f3c79 = ChannelParticipantsFilter;\nchannelParticipantsAdmins#b4608969 = ChannelParticipantsFilter;\nchannelParticipantsKicked#a3b54985 q:string = ChannelParticipantsFilter;\nchannelParticipantsBots#b0d1865b = ChannelParticipantsFilter;\nchannelParticipantsBanned#1427a5e1 q:string = ChannelParticipantsFilter;\nchannelParticipantsSearch#656ac4b q:string = ChannelParticipantsFilter;\nchannelParticipantsContacts#bb6ae88d q:string = ChannelParticipantsFilter;\nchannelParticipantsMentions#e04b5ceb flags:# q:flags.0?string top_msg_id:flags.1?int = ChannelParticipantsFilter;\nchannels.channelParticipants#9ab0feaf count:int participants:Vector chats:Vector users:Vector = channels.ChannelParticipants;\nchannels.channelParticipantsNotModified#f0173fe9 = channels.ChannelParticipants;\nchannels.channelParticipant#dfb80317 participant:ChannelParticipant chats:Vector users:Vector = channels.ChannelParticipant;\nhelp.termsOfService#780a0310 flags:# popup:flags.0?true id:DataJSON text:string entities:Vector min_age_confirm:flags.1?int = help.TermsOfService;\nmessages.savedGifsNotModified#e8025ca2 = messages.SavedGifs;\nmessages.savedGifs#2e0709a5 hash:int gifs:Vector = messages.SavedGifs;\ninputBotInlineMessageMediaAuto#3380c786 flags:# message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaGeo#96929a85 flags:# geo_point:InputGeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaVenue#417bbf11 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaContact#a6edbffd flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaInvoice#d7e78225 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineResult#88bf9319 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?InputWebDocument content:flags.5?InputWebDocument send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultDocument#fff8fdc4 flags:# id:string type:string title:flags.1?string description:flags.2?string document:InputDocument send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultGame#4fa417f2 id:string short_name:string send_message:InputBotInlineMessage = InputBotInlineResult;\nbotInlineMessageMediaAuto#764cf810 flags:# message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaGeo#51846fd flags:# geo:GeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaVenue#8a86659c flags:# geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaContact#18d1cdc2 flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaInvoice#354a9b09 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument currency:string total_amount:long reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineResult#11965f3a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?WebDocument content:flags.5?WebDocument send_message:BotInlineMessage = BotInlineResult;\nbotInlineMediaResult#17db940b flags:# id:string type:string photo:flags.0?Photo document:flags.1?Document title:flags.2?string description:flags.3?string send_message:BotInlineMessage = BotInlineResult;\nmessages.botResults#947ca848 flags:# gallery:flags.0?true query_id:long next_offset:flags.1?string switch_pm:flags.2?InlineBotSwitchPM results:Vector cache_time:int users:Vector = messages.BotResults;\nexportedMessageLink#5dab1af4 link:string html:string = ExportedMessageLink;\nmessageFwdHeader#5f777dce flags:# imported:flags.7?true from_id:flags.0?Peer from_name:flags.5?string date:int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int psa_type:flags.6?string = MessageFwdHeader;\nauth.codeTypeSms#72a3158c = auth.CodeType;\nauth.codeTypeCall#741cd3e3 = auth.CodeType;\nauth.codeTypeFlashCall#226ccefb = auth.CodeType;\nauth.sentCodeTypeApp#3dbb5986 length:int = auth.SentCodeType;\nauth.sentCodeTypeSms#c000bba2 length:int = auth.SentCodeType;\nauth.sentCodeTypeCall#5353e5a7 length:int = auth.SentCodeType;\nauth.sentCodeTypeFlashCall#ab03c6d9 pattern:string = auth.SentCodeType;\nmessages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?true native_ui:flags.4?true message:flags.0?string url:flags.2?string cache_time:int = messages.BotCallbackAnswer;\nmessages.messageEditData#26b5dde6 flags:# caption:flags.0?true = messages.MessageEditData;\ninputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID;\ninlineBotSwitchPM#3c20629f text:string start_param:string = InlineBotSwitchPM;\nmessages.peerDialogs#3371c354 dialogs:Vector messages:Vector chats:Vector users:Vector state:updates.State = messages.PeerDialogs;\ntopPeer#edcdc05b peer:Peer rating:double = TopPeer;\ntopPeerCategoryBotsPM#ab661b5b = TopPeerCategory;\ntopPeerCategoryBotsInline#148677e2 = TopPeerCategory;\ntopPeerCategoryCorrespondents#637b7ed = TopPeerCategory;\ntopPeerCategoryGroups#bd17a14a = TopPeerCategory;\ntopPeerCategoryChannels#161d9628 = TopPeerCategory;\ntopPeerCategoryPhoneCalls#1e76a78c = TopPeerCategory;\ntopPeerCategoryForwardUsers#a8406ca9 = TopPeerCategory;\ntopPeerCategoryForwardChats#fbeec0f0 = TopPeerCategory;\ntopPeerCategoryPeers#fb834291 category:TopPeerCategory count:int peers:Vector = TopPeerCategoryPeers;\ncontacts.topPeersNotModified#de266ef5 = contacts.TopPeers;\ncontacts.topPeers#70b772a8 categories:Vector chats:Vector users:Vector = contacts.TopPeers;\ncontacts.topPeersDisabled#b52c939d = contacts.TopPeers;\ndraftMessageEmpty#1b0c841a flags:# date:flags.0?int = DraftMessage;\ndraftMessage#fd8e711f flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int message:string entities:flags.3?Vector date:int = DraftMessage;\nmessages.featuredStickersNotModified#c6dc0c66 count:int = messages.FeaturedStickers;\nmessages.featuredStickers#b6abc341 hash:int count:int sets:Vector unread:Vector = messages.FeaturedStickers;\nmessages.recentStickersNotModified#b17f890 = messages.RecentStickers;\nmessages.recentStickers#22f3afb3 hash:int packs:Vector stickers:Vector dates:Vector = messages.RecentStickers;\nmessages.archivedStickers#4fcba9c8 count:int sets:Vector = messages.ArchivedStickers;\nmessages.stickerSetInstallResultSuccess#38641628 = messages.StickerSetInstallResult;\nmessages.stickerSetInstallResultArchive#35e410a8 sets:Vector = messages.StickerSetInstallResult;\nstickerSetCovered#6410a5d2 set:StickerSet cover:Document = StickerSetCovered;\nstickerSetMultiCovered#3407e51b set:StickerSet covers:Vector = StickerSetCovered;\nmaskCoords#aed6dbb2 n:int x:double y:double zoom:double = MaskCoords;\ninputStickeredMediaPhoto#4a992157 id:InputPhoto = InputStickeredMedia;\ninputStickeredMediaDocument#438865b id:InputDocument = InputStickeredMedia;\ngame#bdf9653b flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document = Game;\ninputGameID#32c3e77 id:long access_hash:long = InputGame;\ninputGameShortName#c331e80a bot_id:InputUser short_name:string = InputGame;\nhighScore#58fffcd0 pos:int user_id:int score:int = HighScore;\nmessages.highScores#9a3bfd99 scores:Vector users:Vector = messages.HighScores;\ntextEmpty#dc3d824f = RichText;\ntextPlain#744694e0 text:string = RichText;\ntextBold#6724abc4 text:RichText = RichText;\ntextItalic#d912a59c text:RichText = RichText;\ntextUnderline#c12622c4 text:RichText = RichText;\ntextStrike#9bf8bb95 text:RichText = RichText;\ntextFixed#6c3f19b9 text:RichText = RichText;\ntextUrl#3c2884c1 text:RichText url:string webpage_id:long = RichText;\ntextEmail#de5a0dd6 text:RichText email:string = RichText;\ntextConcat#7e6260d7 texts:Vector = RichText;\ntextSubscript#ed6a8504 text:RichText = RichText;\ntextSuperscript#c7fb5e01 text:RichText = RichText;\ntextMarked#34b8621 text:RichText = RichText;\ntextPhone#1ccb966a text:RichText phone:string = RichText;\ntextImage#81ccf4f document_id:long w:int h:int = RichText;\ntextAnchor#35553762 text:RichText name:string = RichText;\npageBlockUnsupported#13567e8a = PageBlock;\npageBlockTitle#70abc3fd text:RichText = PageBlock;\npageBlockSubtitle#8ffa9a1f text:RichText = PageBlock;\npageBlockAuthorDate#baafe5e0 author:RichText published_date:int = PageBlock;\npageBlockHeader#bfd064ec text:RichText = PageBlock;\npageBlockSubheader#f12bb6e1 text:RichText = PageBlock;\npageBlockParagraph#467a0766 text:RichText = PageBlock;\npageBlockPreformatted#c070d93e text:RichText language:string = PageBlock;\npageBlockFooter#48870999 text:RichText = PageBlock;\npageBlockDivider#db20b188 = PageBlock;\npageBlockAnchor#ce0d37b0 name:string = PageBlock;\npageBlockList#e4e88011 items:Vector = PageBlock;\npageBlockBlockquote#263d7c26 text:RichText caption:RichText = PageBlock;\npageBlockPullquote#4f4456d3 text:RichText caption:RichText = PageBlock;\npageBlockPhoto#1759c560 flags:# photo_id:long caption:PageCaption url:flags.0?string webpage_id:flags.0?long = PageBlock;\npageBlockVideo#7c8fe7b6 flags:# autoplay:flags.0?true loop:flags.1?true video_id:long caption:PageCaption = PageBlock;\npageBlockCover#39f23300 cover:PageBlock = PageBlock;\npageBlockEmbed#a8718dc5 flags:# full_width:flags.0?true allow_scrolling:flags.3?true url:flags.1?string html:flags.2?string poster_photo_id:flags.4?long w:flags.5?int h:flags.5?int caption:PageCaption = PageBlock;\npageBlockEmbedPost#f259a80b url:string webpage_id:long author_photo_id:long author:string date:int blocks:Vector caption:PageCaption = PageBlock;\npageBlockCollage#65a0fa4d items:Vector caption:PageCaption = PageBlock;\npageBlockSlideshow#31f9590 items:Vector caption:PageCaption = PageBlock;\npageBlockChannel#ef1751b5 channel:Chat = PageBlock;\npageBlockAudio#804361ea audio_id:long caption:PageCaption = PageBlock;\npageBlockKicker#1e148390 text:RichText = PageBlock;\npageBlockTable#bf4dea82 flags:# bordered:flags.0?true striped:flags.1?true title:RichText rows:Vector = PageBlock;\npageBlockOrderedList#9a8ae1e1 items:Vector = PageBlock;\npageBlockDetails#76768bed flags:# open:flags.0?true blocks:Vector title:RichText = PageBlock;\npageBlockRelatedArticles#16115a96 title:RichText articles:Vector = PageBlock;\npageBlockMap#a44f3ef6 geo:GeoPoint zoom:int w:int h:int caption:PageCaption = PageBlock;\nphoneCallDiscardReasonMissed#85e42301 = PhoneCallDiscardReason;\nphoneCallDiscardReasonDisconnect#e095c1a0 = PhoneCallDiscardReason;\nphoneCallDiscardReasonHangup#57adc690 = PhoneCallDiscardReason;\nphoneCallDiscardReasonBusy#faf7e8c9 = PhoneCallDiscardReason;\ndataJSON#7d748d04 data:string = DataJSON;\nlabeledPrice#cb296bf8 label:string amount:long = LabeledPrice;\ninvoice#cd886e0 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true currency:string prices:Vector max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector = Invoice;\npaymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge;\npostAddress#1e8caaeb street_line1:string street_line2:string city:string state:string country_iso2:string post_code:string = PostAddress;\npaymentRequestedInfo#909c3f94 flags:# name:flags.0?string phone:flags.1?string email:flags.2?string shipping_address:flags.3?PostAddress = PaymentRequestedInfo;\npaymentSavedCredentialsCard#cdc27a1f id:string title:string = PaymentSavedCredentials;\nwebDocument#1c570ed1 url:string access_hash:long size:int mime_type:string attributes:Vector = WebDocument;\nwebDocumentNoProxy#f9c8bcc6 url:string size:int mime_type:string attributes:Vector = WebDocument;\ninputWebDocument#9bed434d url:string size:int mime_type:string attributes:Vector = InputWebDocument;\ninputWebFileLocation#c239d686 url:string access_hash:long = InputWebFileLocation;\ninputWebFileGeoPointLocation#9f2221c9 geo_point:InputGeoPoint access_hash:long w:int h:int zoom:int scale:int = InputWebFileLocation;\nupload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile;\npayments.paymentForm#8d0b2415 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector = payments.PaymentForm;\npayments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector = payments.ValidatedRequestedInfo;\npayments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult;\npayments.paymentVerificationNeeded#d8411139 url:string = payments.PaymentResult;\npayments.paymentReceipt#10b555d0 flags:# date:int bot_id:int provider_id:int title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector = payments.PaymentReceipt;\npayments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo;\ninputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;\ninputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;\ninputPaymentCredentialsApplePay#aa1c39f payment_data:DataJSON = InputPaymentCredentials;\ninputPaymentCredentialsGooglePay#8ac32801 payment_token:DataJSON = InputPaymentCredentials;\naccount.tmpPassword#db64fd34 tmp_password:bytes valid_until:int = account.TmpPassword;\nshippingOption#b6213cdf id:string title:string prices:Vector = ShippingOption;\ninputStickerSetItem#ffa0a496 flags:# document:InputDocument emoji:string mask_coords:flags.0?MaskCoords = InputStickerSetItem;\ninputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall;\nphoneCallEmpty#5366c915 id:long = PhoneCall;\nphoneCallWaiting#1b8f4ad1 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall;\nphoneCallRequested#87eabb53 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall;\nphoneCallAccepted#997c454a flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_b:bytes protocol:PhoneCallProtocol = PhoneCall;\nphoneCall#8742ae7f flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector start_date:int = PhoneCall;\nphoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall;\nphoneConnection#9d4c17c0 id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection;\nphoneConnectionWebrtc#635fe375 flags:# turn:flags.0?true stun:flags.1?true id:long ip:string ipv6:string port:int username:string password:string = PhoneConnection;\nphoneCallProtocol#fc878fc8 flags:# udp_p2p:flags.0?true udp_reflector:flags.1?true min_layer:int max_layer:int library_versions:Vector = PhoneCallProtocol;\nphone.phoneCall#ec82e140 phone_call:PhoneCall users:Vector = phone.PhoneCall;\nupload.cdnFileReuploadNeeded#eea8e46e request_token:bytes = upload.CdnFile;\nupload.cdnFile#a99fca4f bytes:bytes = upload.CdnFile;\ncdnPublicKey#c982eaba dc_id:int public_key:string = CdnPublicKey;\ncdnConfig#5725e40a public_keys:Vector = CdnConfig;\nlangPackString#cad181f6 key:string value:string = LangPackString;\nlangPackStringPluralized#6c47ac9f flags:# key:string zero_value:flags.0?string one_value:flags.1?string two_value:flags.2?string few_value:flags.3?string many_value:flags.4?string other_value:string = LangPackString;\nlangPackStringDeleted#2979eeb2 key:string = LangPackString;\nlangPackDifference#f385c1f6 lang_code:string from_version:int version:int strings:Vector = LangPackDifference;\nlangPackLanguage#eeca5ce3 flags:# official:flags.0?true rtl:flags.2?true beta:flags.3?true name:string native_name:string lang_code:string base_lang_code:flags.1?string plural_code:string strings_count:int translated_count:int translations_url:string = LangPackLanguage;\nchannelAdminLogEventActionChangeTitle#e6dfb825 prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeAbout#55188a2e prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeUsername#6a4afc38 prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangePhoto#434bd2af prev_photo:Photo new_photo:Photo = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleInvites#1b7907ae new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleSignatures#26ae0971 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionUpdatePinned#e9e82c18 message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionEditMessage#709b2405 prev_message:Message new_message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDeleteMessage#42e047bb message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantJoin#183040d3 = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantLeave#f89777f2 = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantInvite#e31c34d8 participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantToggleBan#e6d83d7e prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantToggleAdmin#d5676710 prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeStickerSet#b1c3caa7 prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction;\nchannelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDefaultBannedRights#2df5fc0a prev_banned_rights:ChatBannedRights new_banned_rights:ChatBannedRights = ChannelAdminLogEventAction;\nchannelAdminLogEventActionStopPoll#8f079643 message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeLinkedChat#a26f881b prev_value:int new_value:int = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeLocation#e6b76ae prev_value:ChannelLocation new_value:ChannelLocation = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleSlowMode#53909779 prev_value:int new_value:int = ChannelAdminLogEventAction;\nchannelAdminLogEventActionStartGroupCall#23209745 call:InputGroupCall = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDiscardGroupCall#db9f9140 call:InputGroupCall = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantMute#f92424d2 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantUnmute#e64429c0 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleGroupCallSetting#56d6a247 join_muted:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantJoinByInvite#5cdada77 invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteDelete#5a50fca4 invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantVolume#3e7f6847 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeHistoryTTL#6e941a38 prev_value:int new_value:int = ChannelAdminLogEventAction;\nchannelAdminLogEvent#3b5a3e40 id:long date:int user_id:int action:ChannelAdminLogEventAction = ChannelAdminLogEvent;\nchannels.adminLogResults#ed8af74d events:Vector chats:Vector users:Vector = channels.AdminLogResults;\nchannelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true = ChannelAdminLogEventsFilter;\npopularContact#5ce14175 client_id:long importers:int = PopularContact;\nmessages.favedStickersNotModified#9e8fa6d3 = messages.FavedStickers;\nmessages.favedStickers#f37f2f16 hash:int packs:Vector stickers:Vector = messages.FavedStickers;\nrecentMeUrlUnknown#46e1d13d url:string = RecentMeUrl;\nrecentMeUrlUser#8dbc3336 url:string user_id:int = RecentMeUrl;\nrecentMeUrlChat#a01b22f9 url:string chat_id:int = RecentMeUrl;\nrecentMeUrlChatInvite#eb49081d url:string chat_invite:ChatInvite = RecentMeUrl;\nrecentMeUrlStickerSet#bc0a57dc url:string set:StickerSetCovered = RecentMeUrl;\nhelp.recentMeUrls#e0310d7 urls:Vector chats:Vector users:Vector = help.RecentMeUrls;\ninputSingleMedia#1cc6e91f flags:# media:InputMedia random_id:long message:string entities:flags.0?Vector = InputSingleMedia;\nwebAuthorization#cac943f2 hash:long bot_id:int domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization;\naccount.webAuthorizations#ed56c9fc authorizations:Vector users:Vector = account.WebAuthorizations;\ninputMessageID#a676a322 id:int = InputMessage;\ninputMessageReplyTo#bad88395 id:int = InputMessage;\ninputMessagePinned#86872538 = InputMessage;\ninputMessageCallbackQuery#acfa1a7e id:int query_id:long = InputMessage;\ninputDialogPeer#fcaafeb7 peer:InputPeer = InputDialogPeer;\ninputDialogPeerFolder#64600527 folder_id:int = InputDialogPeer;\ndialogPeer#e56dbf05 peer:Peer = DialogPeer;\ndialogPeerFolder#514519e2 folder_id:int = DialogPeer;\nmessages.foundStickerSetsNotModified#d54b65d = messages.FoundStickerSets;\nmessages.foundStickerSets#5108d648 hash:int sets:Vector = messages.FoundStickerSets;\nfileHash#6242c773 offset:int limit:int hash:bytes = FileHash;\ninputClientProxy#75588b3f address:string port:int = InputClientProxy;\nhelp.termsOfServiceUpdateEmpty#e3309f7f expires:int = help.TermsOfServiceUpdate;\nhelp.termsOfServiceUpdate#28ecf961 expires:int terms_of_service:help.TermsOfService = help.TermsOfServiceUpdate;\ninputSecureFileUploaded#3334b0f0 id:long parts:int md5_checksum:string file_hash:bytes secret:bytes = InputSecureFile;\ninputSecureFile#5367e5be id:long access_hash:long = InputSecureFile;\nsecureFileEmpty#64199744 = SecureFile;\nsecureFile#e0277a62 id:long access_hash:long size:int dc_id:int date:int file_hash:bytes secret:bytes = SecureFile;\nsecureData#8aeabec3 data:bytes data_hash:bytes secret:bytes = SecureData;\nsecurePlainPhone#7d6099dd phone:string = SecurePlainData;\nsecurePlainEmail#21ec5a5f email:string = SecurePlainData;\nsecureValueTypePersonalDetails#9d2a81e3 = SecureValueType;\nsecureValueTypePassport#3dac6a00 = SecureValueType;\nsecureValueTypeDriverLicense#6e425c4 = SecureValueType;\nsecureValueTypeIdentityCard#a0d0744b = SecureValueType;\nsecureValueTypeInternalPassport#99a48f23 = SecureValueType;\nsecureValueTypeAddress#cbe31e26 = SecureValueType;\nsecureValueTypeUtilityBill#fc36954e = SecureValueType;\nsecureValueTypeBankStatement#89137c0d = SecureValueType;\nsecureValueTypeRentalAgreement#8b883488 = SecureValueType;\nsecureValueTypePassportRegistration#99e3806a = SecureValueType;\nsecureValueTypeTemporaryRegistration#ea02ec33 = SecureValueType;\nsecureValueTypePhone#b320aadb = SecureValueType;\nsecureValueTypeEmail#8e3ca7ee = SecureValueType;\nsecureValue#187fa0ca flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?SecureFile reverse_side:flags.2?SecureFile selfie:flags.3?SecureFile translation:flags.6?Vector files:flags.4?Vector plain_data:flags.5?SecurePlainData hash:bytes = SecureValue;\ninputSecureValue#db21d0a7 flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?InputSecureFile reverse_side:flags.2?InputSecureFile selfie:flags.3?InputSecureFile translation:flags.6?Vector files:flags.4?Vector plain_data:flags.5?SecurePlainData = InputSecureValue;\nsecureValueHash#ed1ecdb0 type:SecureValueType hash:bytes = SecureValueHash;\nsecureValueErrorData#e8a40bd9 type:SecureValueType data_hash:bytes field:string text:string = SecureValueError;\nsecureValueErrorFrontSide#be3dfa type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorReverseSide#868a2aa5 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorSelfie#e537ced6 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorFile#7a700873 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorFiles#666220e9 type:SecureValueType file_hash:Vector text:string = SecureValueError;\nsecureValueError#869d758f type:SecureValueType hash:bytes text:string = SecureValueError;\nsecureValueErrorTranslationFile#a1144770 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorTranslationFiles#34636dd8 type:SecureValueType file_hash:Vector text:string = SecureValueError;\nsecureCredentialsEncrypted#33f0ea47 data:bytes hash:bytes secret:bytes = SecureCredentialsEncrypted;\naccount.authorizationForm#ad2e1cd8 flags:# required_types:Vector values:Vector errors:Vector users:Vector privacy_policy_url:flags.0?string = account.AuthorizationForm;\naccount.sentEmailCode#811f854f email_pattern:string length:int = account.SentEmailCode;\nhelp.deepLinkInfoEmpty#66afa166 = help.DeepLinkInfo;\nhelp.deepLinkInfo#6a4ee832 flags:# update_app:flags.0?true message:string entities:flags.1?Vector = help.DeepLinkInfo;\nsavedPhoneContact#1142bd56 phone:string first_name:string last_name:string date:int = SavedContact;\naccount.takeout#4dba4501 id:long = account.Takeout;\npasswordKdfAlgoUnknown#d45ab096 = PasswordKdfAlgo;\npasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow#3a912d4a salt1:bytes salt2:bytes g:int p:bytes = PasswordKdfAlgo;\nsecurePasswordKdfAlgoUnknown#4a8537 = SecurePasswordKdfAlgo;\nsecurePasswordKdfAlgoPBKDF2HMACSHA512iter100000#bbf2dda0 salt:bytes = SecurePasswordKdfAlgo;\nsecurePasswordKdfAlgoSHA512#86471d92 salt:bytes = SecurePasswordKdfAlgo;\nsecureSecretSettings#1527bcac secure_algo:SecurePasswordKdfAlgo secure_secret:bytes secure_secret_id:long = SecureSecretSettings;\ninputCheckPasswordEmpty#9880f658 = InputCheckPasswordSRP;\ninputCheckPasswordSRP#d27ff082 srp_id:long A:bytes M1:bytes = InputCheckPasswordSRP;\nsecureRequiredType#829d99da flags:# native_names:flags.0?true selfie_required:flags.1?true translation_required:flags.2?true type:SecureValueType = SecureRequiredType;\nsecureRequiredTypeOneOf#27477b4 types:Vector = SecureRequiredType;\nhelp.passportConfigNotModified#bfb9f457 = help.PassportConfig;\nhelp.passportConfig#a098d6af hash:int countries_langs:DataJSON = help.PassportConfig;\ninputAppEvent#1d1b1245 time:double type:string peer:long data:JSONValue = InputAppEvent;\njsonObjectValue#c0de1bd9 key:string value:JSONValue = JSONObjectValue;\njsonNull#3f6d7b68 = JSONValue;\njsonBool#c7345e6a value:Bool = JSONValue;\njsonNumber#2be0dfa4 value:double = JSONValue;\njsonString#b71e767a value:string = JSONValue;\njsonArray#f7444763 value:Vector = JSONValue;\njsonObject#99c1d49d value:Vector = JSONValue;\npageTableCell#34566b6a flags:# header:flags.0?true align_center:flags.3?true align_right:flags.4?true valign_middle:flags.5?true valign_bottom:flags.6?true text:flags.7?RichText colspan:flags.1?int rowspan:flags.2?int = PageTableCell;\npageTableRow#e0c0c5e5 cells:Vector = PageTableRow;\npageCaption#6f747657 text:RichText credit:RichText = PageCaption;\npageListItemText#b92fb6cd text:RichText = PageListItem;\npageListItemBlocks#25e073fc blocks:Vector = PageListItem;\npageListOrderedItemText#5e068047 num:string text:RichText = PageListOrderedItem;\npageListOrderedItemBlocks#98dd8936 num:string blocks:Vector = PageListOrderedItem;\npageRelatedArticle#b390dc08 flags:# url:string webpage_id:long title:flags.0?string description:flags.1?string photo_id:flags.2?long author:flags.3?string published_date:flags.4?int = PageRelatedArticle;\npage#98657f0d flags:# part:flags.0?true rtl:flags.1?true v2:flags.2?true url:string blocks:Vector photos:Vector documents:Vector views:flags.3?int = Page;\nhelp.supportName#8c05f1c9 name:string = help.SupportName;\nhelp.userInfoEmpty#f3ae2eed = help.UserInfo;\nhelp.userInfo#1eb3758 message:string entities:Vector author:string date:int = help.UserInfo;\npollAnswer#6ca9c2e9 text:string option:bytes = PollAnswer;\npoll#86e18161 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true question:string answers:Vector close_period:flags.4?int close_date:flags.5?int = Poll;\npollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters;\npollResults#badcc1a3 flags:# min:flags.0?true results:flags.1?Vector total_voters:flags.2?int recent_voters:flags.3?Vector solution:flags.4?string solution_entities:flags.4?Vector = PollResults;\nchatOnlines#f041e250 onlines:int = ChatOnlines;\nstatsURL#47a971e0 url:string = StatsURL;\nchatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true = ChatAdminRights;\nchatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true send_polls:flags.8?true change_info:flags.10?true invite_users:flags.15?true pin_messages:flags.17?true until_date:int = ChatBannedRights;\ninputWallPaper#e630b979 id:long access_hash:long = InputWallPaper;\ninputWallPaperSlug#72091c80 slug:string = InputWallPaper;\ninputWallPaperNoFile#967a462e id:long = InputWallPaper;\naccount.wallPapersNotModified#1c199183 = account.WallPapers;\naccount.wallPapers#702b65a9 hash:int wallpapers:Vector = account.WallPapers;\ncodeSettings#debebe83 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true = CodeSettings;\nwallPaperSettings#1dc1bca4 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int third_background_color:flags.5?int fourth_background_color:flags.6?int intensity:flags.3?int rotation:flags.4?int = WallPaperSettings;\nautoDownloadSettings#e04232f3 flags:# disabled:flags.0?true video_preload_large:flags.1?true audio_preload_next:flags.2?true phonecalls_less_data:flags.3?true photo_size_max:int video_size_max:int file_size_max:int video_upload_maxbitrate:int = AutoDownloadSettings;\naccount.autoDownloadSettings#63cacf26 low:AutoDownloadSettings medium:AutoDownloadSettings high:AutoDownloadSettings = account.AutoDownloadSettings;\nemojiKeyword#d5b3b9f9 keyword:string emoticons:Vector = EmojiKeyword;\nemojiKeywordDeleted#236df622 keyword:string emoticons:Vector = EmojiKeyword;\nemojiKeywordsDifference#5cc761bd lang_code:string from_version:int version:int keywords:Vector = EmojiKeywordsDifference;\nemojiURL#a575739d url:string = EmojiURL;\nemojiLanguage#b3fb5361 lang_code:string = EmojiLanguage;\nfolder#ff544e65 flags:# autofill_new_broadcasts:flags.0?true autofill_public_groups:flags.1?true autofill_new_correspondents:flags.2?true id:int title:string photo:flags.3?ChatPhoto = Folder;\ninputFolderPeer#fbd2c296 peer:InputPeer folder_id:int = InputFolderPeer;\nfolderPeer#e9baa668 peer:Peer folder_id:int = FolderPeer;\nmessages.searchCounter#e844ebff flags:# inexact:flags.1?true filter:MessagesFilter count:int = messages.SearchCounter;\nurlAuthResultRequest#92d33a0e flags:# request_write_access:flags.0?true bot:User domain:string = UrlAuthResult;\nurlAuthResultAccepted#8f8c0e4e url:string = UrlAuthResult;\nurlAuthResultDefault#a9d6db1f = UrlAuthResult;\nchannelLocationEmpty#bfb5ad8b = ChannelLocation;\nchannelLocation#209b82db geo_point:GeoPoint address:string = ChannelLocation;\npeerLocated#ca461b5d peer:Peer expires:int distance:int = PeerLocated;\npeerSelfLocated#f8ec284b expires:int = PeerLocated;\nrestrictionReason#d072acb4 platform:string reason:string text:string = RestrictionReason;\ninputTheme#3c5693e9 id:long access_hash:long = InputTheme;\ninputThemeSlug#f5890df1 slug:string = InputTheme;\ntheme#28f1114 flags:# creator:flags.0?true default:flags.1?true id:long access_hash:long slug:string title:string document:flags.2?Document settings:flags.3?ThemeSettings installs_count:int = Theme;\naccount.themesNotModified#f41eb622 = account.Themes;\naccount.themes#7f676421 hash:int themes:Vector = account.Themes;\nauth.loginToken#629f1980 expires:int token:bytes = auth.LoginToken;\nauth.loginTokenMigrateTo#68e9916 dc_id:int token:bytes = auth.LoginToken;\nauth.loginTokenSuccess#390d5c5e authorization:auth.Authorization = auth.LoginToken;\naccount.contentSettings#57e28221 flags:# sensitive_enabled:flags.0?true sensitive_can_change:flags.1?true = account.ContentSettings;\nmessages.inactiveChats#a927fec5 dates:Vector chats:Vector users:Vector = messages.InactiveChats;\nbaseThemeClassic#c3a12462 = BaseTheme;\nbaseThemeDay#fbd81688 = BaseTheme;\nbaseThemeNight#b7b31ea8 = BaseTheme;\nbaseThemeTinted#6d5f77ee = BaseTheme;\nbaseThemeArctic#5b11125a = BaseTheme;\ninputThemeSettings#bd507cd1 flags:# base_theme:BaseTheme accent_color:int message_top_color:flags.0?int message_bottom_color:flags.0?int wallpaper:flags.1?InputWallPaper wallpaper_settings:flags.1?WallPaperSettings = InputThemeSettings;\nthemeSettings#9c14984a flags:# base_theme:BaseTheme accent_color:int message_top_color:flags.0?int message_bottom_color:flags.0?int wallpaper:flags.1?WallPaper = ThemeSettings;\nwebPageAttributeTheme#54b56617 flags:# documents:flags.0?Vector settings:flags.1?ThemeSettings = WebPageAttribute;\nmessageUserVote#a28e5559 user_id:int option:bytes date:int = MessageUserVote;\nmessageUserVoteInputOption#36377430 user_id:int date:int = MessageUserVote;\nmessageUserVoteMultiple#e8fe0de user_id:int options:Vector date:int = MessageUserVote;\nmessages.votesList#823f649 flags:# count:int votes:Vector users:Vector next_offset:flags.0?string = messages.VotesList;\nbankCardOpenUrl#f568028a url:string name:string = BankCardOpenUrl;\npayments.bankCardData#3e24e573 title:string open_urls:Vector = payments.BankCardData;\ndialogFilter#7438f7e8 flags:# contacts:flags.0?true non_contacts:flags.1?true groups:flags.2?true broadcasts:flags.3?true bots:flags.4?true exclude_muted:flags.11?true exclude_read:flags.12?true exclude_archived:flags.13?true id:int title:string emoticon:flags.25?string pinned_peers:Vector include_peers:Vector exclude_peers:Vector = DialogFilter;\ndialogFilterSuggested#77744d4a filter:DialogFilter description:string = DialogFilterSuggested;\nstatsDateRangeDays#b637edaf min_date:int max_date:int = StatsDateRangeDays;\nstatsAbsValueAndPrev#cb43acde current:double previous:double = StatsAbsValueAndPrev;\nstatsPercentValue#cbce2fe0 part:double total:double = StatsPercentValue;\nstatsGraphAsync#4a27eb2d token:string = StatsGraph;\nstatsGraphError#bedc9822 error:string = StatsGraph;\nstatsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph;\nmessageInteractionCounters#ad4fc9bd msg_id:int views:int forwards:int = MessageInteractionCounters;\nstats.broadcastStats#bdf78394 period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post:StatsAbsValueAndPrev enabled_notifications:StatsPercentValue growth_graph:StatsGraph followers_graph:StatsGraph mute_graph:StatsGraph top_hours_graph:StatsGraph interactions_graph:StatsGraph iv_interactions_graph:StatsGraph views_by_source_graph:StatsGraph new_followers_by_source_graph:StatsGraph languages_graph:StatsGraph recent_message_interactions:Vector = stats.BroadcastStats;\nhelp.promoDataEmpty#98f6ac75 expires:int = help.PromoData;\nhelp.promoData#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:Vector users:Vector psa_type:flags.1?string psa_message:flags.2?string = help.PromoData;\nvideoSize#de33b094 flags:# type:string w:int h:int size:int video_start_ts:flags.0?double = VideoSize;\nstatsGroupTopPoster#18f3d0f7 user_id:int messages:int avg_chars:int = StatsGroupTopPoster;\nstatsGroupTopAdmin#6014f412 user_id:int deleted:int kicked:int banned:int = StatsGroupTopAdmin;\nstatsGroupTopInviter#31962a4c user_id:int invitations:int = StatsGroupTopInviter;\nstats.megagroupStats#ef7ff916 period:StatsDateRangeDays members:StatsAbsValueAndPrev messages:StatsAbsValueAndPrev viewers:StatsAbsValueAndPrev posters:StatsAbsValueAndPrev growth_graph:StatsGraph members_graph:StatsGraph new_members_by_source_graph:StatsGraph languages_graph:StatsGraph messages_graph:StatsGraph actions_graph:StatsGraph top_hours_graph:StatsGraph weekdays_graph:StatsGraph top_posters:Vector top_admins:Vector top_inviters:Vector users:Vector = stats.MegagroupStats;\nglobalPrivacySettings#bea2f424 flags:# archive_and_mute_new_noncontact_peers:flags.0?Bool = GlobalPrivacySettings;\nhelp.countryCode#4203c5ef flags:# country_code:string prefixes:flags.0?Vector patterns:flags.1?Vector = help.CountryCode;\nhelp.country#c3878e23 flags:# hidden:flags.0?true iso2:string default_name:string name:flags.1?string country_codes:Vector = help.Country;\nhelp.countriesListNotModified#93cc1f32 = help.CountriesList;\nhelp.countriesList#87d0759e countries:Vector hash:int = help.CountriesList;\nmessageViews#455b853d flags:# views:flags.0?int forwards:flags.1?int replies:flags.2?MessageReplies = MessageViews;\nmessages.messageViews#b6c4f543 views:Vector chats:Vector users:Vector = messages.MessageViews;\nmessages.discussionMessage#f5dd8f9d flags:# messages:Vector max_id:flags.0?int read_inbox_max_id:flags.1?int read_outbox_max_id:flags.2?int chats:Vector users:Vector = messages.DiscussionMessage;\nmessageReplyHeader#a6d57763 flags:# reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader;\nmessageReplies#4128faac flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector channel_id:flags.0?int max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;\npeerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked;\nstats.messageStats#8999f295 views_graph:StatsGraph = stats.MessageStats;\ngroupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall;\ngroupCall#d597650c flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int = GroupCall;\ninputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;\ngroupCallParticipant#eba636fe flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo = GroupCallParticipant;\nphone.groupCall#9e727aad call:GroupCall participants:Vector participants_next_offset:string chats:Vector users:Vector = phone.GroupCall;\nphone.groupParticipants#f47751b6 count:int participants:Vector next_offset:string chats:Vector users:Vector version:int = phone.GroupParticipants;\ninlineQueryPeerTypeSameBotPM#3081ed9d = InlineQueryPeerType;\ninlineQueryPeerTypePM#833c0fac = InlineQueryPeerType;\ninlineQueryPeerTypeChat#d766c50a = InlineQueryPeerType;\ninlineQueryPeerTypeMegagroup#5ec4be43 = InlineQueryPeerType;\ninlineQueryPeerTypeBroadcast#6334ee9a = InlineQueryPeerType;\nmessages.historyImport#1662af0b id:long = messages.HistoryImport;\nmessages.historyImportParsed#5e0fb7b9 flags:# pm:flags.0?true group:flags.1?true title:flags.2?string = messages.HistoryImportParsed;\nmessages.affectedFoundMessages#ef8d3e6c pts:int pts_count:int offset:int messages:Vector = messages.AffectedFoundMessages;\nchatInviteImporter#1e3e6680 user_id:int date:int = ChatInviteImporter;\nmessages.exportedChatInvites#bdc62dcc count:int invites:Vector users:Vector = messages.ExportedChatInvites;\nmessages.exportedChatInvite#1871be50 invite:ExportedChatInvite users:Vector = messages.ExportedChatInvite;\nmessages.exportedChatInviteReplaced#222600ef invite:ExportedChatInvite new_invite:ExportedChatInvite users:Vector = messages.ExportedChatInvite;\nmessages.chatInviteImporters#81b6b00a count:int importers:Vector users:Vector = messages.ChatInviteImporters;\nchatAdminWithInvites#dfd2330f admin_id:int invites_count:int revoked_invites_count:int = ChatAdminWithInvites;\nmessages.chatAdminsWithInvites#b69b72d7 admins:Vector users:Vector = messages.ChatAdminsWithInvites;\nmessages.checkedHistoryImportPeer#a24de717 confirm_text:string = messages.CheckedHistoryImportPeer;\nphone.joinAsPeers#afe5623f peers:Vector chats:Vector users:Vector = phone.JoinAsPeers;\nphone.exportedGroupCallInvite#204bd158 link:string = phone.ExportedGroupCallInvite;\ngroupCallParticipantVideoSourceGroup#dcb118b7 semantics:string sources:Vector = GroupCallParticipantVideoSourceGroup;\ngroupCallParticipantVideo#67753ac8 flags:# paused:flags.0?true endpoint:string source_groups:Vector audio_source:flags.1?int = GroupCallParticipantVideo;\nstickers.suggestedShortName#85fea03f short_name:string = stickers.SuggestedShortName;\nbotCommandScopeDefault#2f6cb2ab = BotCommandScope;\nbotCommandScopeUsers#3c4f04d8 = BotCommandScope;\nbotCommandScopeChats#6fe1a881 = BotCommandScope;\nbotCommandScopeChatAdmins#b9aa606a = BotCommandScope;\nbotCommandScopePeer#db9d897d peer:InputPeer = BotCommandScope;\nbotCommandScopePeerAdmins#3fd863d1 peer:InputPeer = BotCommandScope;\nbotCommandScopePeerUser#a1321f3 peer:InputPeer user_id:InputUser = BotCommandScope;\naccount.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordResult;\naccount.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult;\naccount.resetPasswordOk#e926d63e = account.ResetPasswordResult;\n---functions---\ninitConnection#c1cd5ea9 {X:Type} flags:# api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string proxy:flags.0?InputClientProxy params:flags.1?JSONValue query:!X = X;\ninvokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;\nauth.sendCode#a677244f phone_number:string api_id:int api_hash:string settings:CodeSettings = auth.SentCode;\nauth.signUp#80eee427 phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization;\nauth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;\nauth.logOut#5717da40 = Bool;\nauth.resetAuthorizations#9fab0d1a = Bool;\nauth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;\nauth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;\nauth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;\nauth.checkPassword#d18b4d16 password:InputCheckPasswordSRP = auth.Authorization;\nauth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery;\nauth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode;\nauth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool;\nauth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector = Bool;\nauth.exportLoginToken#b1b41517 api_id:int api_hash:string except_ids:Vector = auth.LoginToken;\nauth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken;\naccount.registerDevice#68976c6f flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector = Bool;\naccount.unregisterDevice#3076c4bf token_type:int token:string other_uids:Vector = Bool;\naccount.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;\naccount.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;\naccount.updateProfile#78515775 flags:# first_name:flags.0?string last_name:flags.1?string about:flags.2?string = User;\naccount.updateStatus#6628562c offline:Bool = Bool;\naccount.getWallPapers#aabb1763 hash:int = account.WallPapers;\naccount.checkUsername#2714d86c username:string = Bool;\naccount.updateUsername#3e0bdd7c username:string = User;\naccount.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;\naccount.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector = account.PrivacyRules;\naccount.getAuthorizations#e320c158 = account.Authorizations;\naccount.resetAuthorization#df77f3bc hash:long = Bool;\naccount.getPassword#548a30f5 = account.Password;\naccount.getPasswordSettings#9cd4eaf9 password:InputCheckPasswordSRP = account.PasswordSettings;\naccount.updatePasswordSettings#a59b102f password:InputCheckPasswordSRP new_settings:account.PasswordInputSettings = Bool;\naccount.sendConfirmPhoneCode#1b3faa88 hash:string settings:CodeSettings = auth.SentCode;\naccount.confirmPhone#5f2178c3 phone_code_hash:string phone_code:string = Bool;\naccount.getTmpPassword#449e0b51 password:InputCheckPasswordSRP period:int = account.TmpPassword;\naccount.sendVerifyPhoneCode#a5a356f9 phone_number:string settings:CodeSettings = auth.SentCode;\naccount.confirmPasswordEmail#8fdf1920 code:string = Bool;\naccount.getContactSignUpNotification#9f07c728 = Bool;\naccount.setContactSignUpNotification#cff43f61 silent:Bool = Bool;\naccount.getNotifyExceptions#53577479 flags:# compare_sound:flags.1?true peer:flags.0?InputNotifyPeer = Updates;\naccount.uploadWallPaper#dd853661 file:InputFile mime_type:string settings:WallPaperSettings = WallPaper;\naccount.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool;\naccount.getContentSettings#8b9b4dae = account.ContentSettings;\nusers.getUsers#d91a548 id:Vector = Vector;\nusers.getFullUser#ca30a5b1 id:InputUser = UserFull;\ncontacts.getContacts#c023849f hash:int = contacts.Contacts;\ncontacts.importContacts#2c800be5 contacts:Vector = contacts.ImportedContacts;\ncontacts.deleteContacts#96a0e00 id:Vector = Updates;\ncontacts.block#68cc1411 id:InputPeer = Bool;\ncontacts.unblock#bea65d50 id:InputPeer = Bool;\ncontacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;\ncontacts.search#11f812d8 q:string limit:int = contacts.Found;\ncontacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;\ncontacts.getTopPeers#d4982db5 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:int = contacts.TopPeers;\nmessages.getMessages#63c66506 id:Vector = messages.Messages;\nmessages.getDialogs#a0ee3b73 flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:int = messages.Dialogs;\nmessages.getHistory#dcbb8260 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;\nmessages.search#c352eec flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;\nmessages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages;\nmessages.deleteHistory#1c015b09 flags:# just_clear:flags.0?true revoke:flags.1?true peer:InputPeer max_id:int = messages.AffectedHistory;\nmessages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector = messages.AffectedMessages;\nmessages.receivedMessages#5a954c0 max_id:int = Vector;\nmessages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool;\nmessages.sendMessage#520c3870 flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int = Updates;\nmessages.sendMedia#3491eba9 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int = Updates;\nmessages.forwardMessages#d9fee60e flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true from_peer:InputPeer id:Vector random_id:Vector to_peer:InputPeer schedule_date:flags.10?int = Updates;\nmessages.report#8953ab4e peer:InputPeer id:Vector reason:ReportReason message:string = Bool;\nmessages.getChats#3c6aa187 id:Vector = messages.Chats;\nmessages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;\nmessages.editChatTitle#dc452855 chat_id:int title:string = Updates;\nmessages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates;\nmessages.addChatUser#f9a0aa09 chat_id:int user_id:InputUser fwd_limit:int = Updates;\nmessages.deleteChatUser#c534459a flags:# revoke_history:flags.0?true chat_id:int user_id:InputUser = Updates;\nmessages.createChat#9cb126e users:Vector title:string = Updates;\nmessages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;\nmessages.readMessageContents#36a73f77 id:Vector = messages.AffectedMessages;\nmessages.getStickers#43d4f2c emoticon:string hash:int = messages.Stickers;\nmessages.getAllStickers#1c9618b1 hash:int = messages.AllStickers;\nmessages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector = MessageMedia;\nmessages.exportChatInvite#14b9bcd7 flags:# legacy_revoke_permanent:flags.2?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int = ExportedChatInvite;\nmessages.checkChatInvite#3eadb1bb hash:string = ChatInvite;\nmessages.importChatInvite#6c50051c hash:string = Updates;\nmessages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;\nmessages.installStickerSet#c78fe460 stickerset:InputStickerSet archived:Bool = messages.StickerSetInstallResult;\nmessages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;\nmessages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_param:string = Updates;\nmessages.migrateChat#15a3b8e3 chat_id:int = Updates;\nmessages.searchGlobal#4bc6589a flags:# folder_id:flags.0?int q:string filter:MessagesFilter min_date:int max_date:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;\nmessages.getDocumentByHash#338e2464 sha256:bytes size:int mime_type:string = Document;\nmessages.getSavedGifs#83bf3d52 hash:int = messages.SavedGifs;\nmessages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults;\nmessages.sendInlineBotResult#220815b0 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string schedule_date:flags.10?int = Updates;\nmessages.editMessage#48f71778 flags:# no_webpage:flags.1?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.15?int = Updates;\nmessages.getBotCallbackAnswer#9342ca07 flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes password:flags.2?InputCheckPasswordSRP = messages.BotCallbackAnswer;\nmessages.getPeerDialogs#e470bcfd peers:Vector = messages.PeerDialogs;\nmessages.saveDraft#bc39e14b flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int peer:InputPeer message:string entities:flags.3?Vector = Bool;\nmessages.getFeaturedStickers#2dacca4f hash:int = messages.FeaturedStickers;\nmessages.readFeaturedStickers#5b118126 id:Vector = Bool;\nmessages.getRecentStickers#5ea192c9 flags:# attached:flags.0?true hash:int = messages.RecentStickers;\nmessages.getWebPage#32ca8f91 url:string hash:int = WebPage;\nmessages.toggleDialogPin#a731e257 flags:# pinned:flags.0?true peer:InputDialogPeer = Bool;\nmessages.getPinnedDialogs#d6b94df2 folder_id:int = messages.PeerDialogs;\nmessages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia;\nmessages.getFavedStickers#21ce0b0e hash:int = messages.FavedStickers;\nmessages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool;\nmessages.sendMultiMedia#cc0110cb flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector schedule_date:flags.10?int = Updates;\nmessages.searchStickerSets#c2b7d08b flags:# exclude_featured:flags.0?true q:string hash:int = messages.FoundStickerSets;\nmessages.markDialogUnread#c286d98f flags:# unread:flags.0?true peer:InputDialogPeer = Bool;\nmessages.updatePinnedMessage#d2aaf7ec flags:# silent:flags.0?true unpin:flags.1?true pm_oneside:flags.2?true peer:InputPeer id:int = Updates;\nmessages.sendVote#10ea6184 peer:InputPeer msg_id:int options:Vector = Updates;\nmessages.getOnlines#6e2be050 peer:InputPeer = ChatOnlines;\nmessages.editChatAbout#def60797 peer:InputPeer about:string = Bool;\nmessages.editChatDefaultBannedRights#a5866b41 peer:InputPeer banned_rights:ChatBannedRights = Updates;\nmessages.getEmojiKeywordsDifference#1508b6af lang_code:string from_version:int = EmojiKeywordsDifference;\nmessages.getScheduledHistory#e2c2685b peer:InputPeer hash:int = messages.Messages;\nmessages.sendScheduledMessages#bd38850a peer:InputPeer id:Vector = Updates;\nmessages.deleteScheduledMessages#59ae2b16 peer:InputPeer id:Vector = Updates;\nmessages.getPollVotes#b86e380e flags:# peer:InputPeer id:int option:flags.0?bytes offset:flags.1?string limit:int = messages.VotesList;\nmessages.getDialogFilters#f19ed96d = Vector;\nmessages.getSuggestedDialogFilters#a29cd42c = Vector;\nmessages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter = Bool;\nmessages.getReplies#24b581ba peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;\nmessages.getDiscussionMessage#446972fd peer:InputPeer msg_id:int = messages.DiscussionMessage;\nmessages.readDiscussion#f731a9f4 peer:InputPeer msg_id:int read_max_id:int = Bool;\nmessages.unpinAllMessages#f025bc8b peer:InputPeer = messages.AffectedHistory;\nmessages.deleteChat#83247d11 chat_id:int = Bool;\nupdates.getState#edd4882a = updates.State;\nupdates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;\nupdates.getChannelDifference#3173d78 flags:# force:flags.0?true channel:InputChannel filter:ChannelMessagesFilter pts:int limit:int = updates.ChannelDifference;\nphotos.uploadProfilePhoto#89f30f69 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = photos.Photo;\nphotos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int = photos.Photos;\nupload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;\nupload.getFile#b15a9afc flags:# precise:flags.0?true cdn_supported:flags.1?true location:InputFileLocation offset:int limit:int = upload.File;\nupload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;\nupload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile;\nhelp.getConfig#c4f9186b = Config;\nhelp.getNearestDc#1fb33026 = NearestDc;\nhelp.getSupport#9cdf08cd = help.Support;\nhelp.acceptTermsOfService#ee72f79a id:DataJSON = Bool;\nhelp.getCountriesList#735787a8 lang_code:string hash:int = help.CountriesList;\nchannels.readHistory#cc104937 channel:InputChannel max_id:int = Bool;\nchannels.deleteMessages#84c1fd4e channel:InputChannel id:Vector = messages.AffectedMessages;\nchannels.getMessages#ad8c9a23 channel:InputChannel id:Vector = messages.Messages;\nchannels.getParticipants#123e05e9 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:int = channels.ChannelParticipants;\nchannels.getParticipant#a0ab6cc6 channel:InputChannel participant:InputPeer = channels.ChannelParticipant;\nchannels.getChannels#a7f6bbb id:Vector = messages.Chats;\nchannels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull;\nchannels.createChannel#3d5fb10f flags:# broadcast:flags.0?true megagroup:flags.1?true for_import:flags.3?true title:string about:string geo_point:flags.2?InputGeoPoint address:flags.2?string = Updates;\nchannels.editAdmin#d33c8902 channel:InputChannel user_id:InputUser admin_rights:ChatAdminRights rank:string = Updates;\nchannels.editTitle#566decd0 channel:InputChannel title:string = Updates;\nchannels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates;\nchannels.checkUsername#10e6bd2c channel:InputChannel username:string = Bool;\nchannels.updateUsername#3514b3de channel:InputChannel username:string = Bool;\nchannels.joinChannel#24b524c5 channel:InputChannel = Updates;\nchannels.leaveChannel#f836aa95 channel:InputChannel = Updates;\nchannels.inviteToChannel#199f3a6c channel:InputChannel users:Vector = Updates;\nchannels.deleteChannel#c0111fe3 channel:InputChannel = Updates;\nchannels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates;\nchannels.editBanned#96e6cd81 channel:InputChannel participant:InputPeer banned_rights:ChatBannedRights = Updates;\nchannels.readMessageContents#eab5dc38 channel:InputChannel id:Vector = Bool;\nchannels.togglePreHistoryHidden#eabbb94c channel:InputChannel enabled:Bool = Updates;\nchannels.getGroupsForDiscussion#f5dad378 = messages.Chats;\nchannels.setDiscussionGroup#40582bb2 broadcast:InputChannel group:InputChannel = Bool;\npayments.getPaymentForm#8a333c8d flags:# peer:InputPeer msg_id:int theme_params:flags.0?DataJSON = payments.PaymentForm;\npayments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt;\npayments.validateRequestedInfo#db103170 flags:# save:flags.0?true peer:InputPeer msg_id:int info:PaymentRequestedInfo = payments.ValidatedRequestedInfo;\npayments.sendPaymentForm#30c3bc9d flags:# form_id:long peer:InputPeer msg_id:int requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials tip_amount:flags.2?long = payments.PaymentResult;\npayments.getSavedInfo#227d824b = payments.SavedInfo;\nlangpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference;\nlangpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector = Vector;\nlangpack.getLanguages#42c6978f lang_pack:string = Vector;\nfolders.editPeerFolders#6847d0ab folder_peers:Vector = Updates;\n"},8963:(e,t,n)=>{var s=n(8764).Buffer;function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{inflate:i}=n(5802),{serializeBytes:o}=n(7404);class r{constructor(e){this.data=e,this.CONSTRUCTOR_ID=812830625,this.classType="constructor"}static async gzipIfSmaller(e,t){if(e&&t.length>512){const e=await new r(t).toBytes();if(e.length{function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=n(355);class i{constructor(e){this.CONSTRUCTOR_ID=1945237724,this.messages=e,this.classType="constructor"}static fromReader(e){const t=[],n=e.readInt();for(let s=0;s{function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{RpcError:a}=n(7404).constructors,i=n(8963);class o{constructor(e,t,n){this.CONSTRUCTOR_ID=4082920705,this.reqMsgId=e,this.body=t,this.error=n,this.classType="constructor"}static async fromReader(e){const t=e.readLong(),n=e.readInt(!1);return n===a.CONSTRUCTOR_ID?new o(t,void 0,a.fromReader(e)):n===i.CONSTRUCTOR_ID?new o(t,(await i.fromReader(e)).data):(e.seek(-4),new o(t,e.read(),void 0))}}s(o,"CONSTRUCTOR_ID",4082920705),s(o,"classType","constructor"),e.exports=o},355:e=>{function t(e,t,n){return t 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.msgId=e,this.seqNo=t,this.obj=n,this.classType="constructor"}}t(n,"SIZE_OVERHEAD",12),t(n,"classType","constructor"),e.exports=n},2058:(e,t,n)=>{const s=n(355),a=n(2301),i=n(3254),o=n(8963),r={[a.CONSTRUCTOR_ID]:a,[o.CONSTRUCTOR_ID]:o,[i.CONSTRUCTOR_ID]:i};e.exports={TLMessage:s,RPCResult:a,MessageContainer:i,GZIPPacked:o,coreObjects:r}},1436:(e,t,n)=>{var s=n(8764).Buffer;const a=e=>e.replace(/(?:^|_)([a-z])/g,((e,t)=>t.toUpperCase())).replace(/_/g,""),i=e=>e.replace(/([-_][a-z])/g,(e=>e.toUpperCase().replace("-","").replace("_",""))),o=new Set([3162085175,2574415285,1072550713,3300522427,1450380236]),r=new Set([85337187,2211011308,2851430293,1013613780,1459478408,3504867164,3045658042,1715713620,3608339646,4110704415,812830625]);let c;function d(e){c||(c=function(){let e;const t=[];for(let n=0;n<256;n++){e=n;for(let t=0;t<8;t++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}()),s.isBuffer(e)||(e=s.from(e));let t=-1;for(let n=0;n>>8}return(-1^t)>>>0}const l=(e,t,n=[])=>{e.flags.includes("g")||(e=new RegExp(e.source,"g"));const s=e.exec(t);return s&&(n.push(s.slice(1)),l(e,t,n)),n},u=(e,t)=>{const n=e.match(/([\w.]+)(?:#([0-9a-fA-F]+))?(?:\s{?\w+:[\w\d<>#.?!]+}?)*\s=\s([\w\d<>#.?]+);$/);if(!n)throw new Error(`Cannot parse TLObject ${e}`);const o=l(/({)?(\w+):([\w\d<>#.?!]+)}?/,e),r={name:n[1],constructorId:parseInt(n[2],16),argsConfig:{},subclassOfId:d(n[3]),result:n[3],isFunction:t,namespace:void 0};if(!r.constructorId){const e="";let t;t=Object.values(r.argsConfig).length?` ${Object.keys(r.argsConfig).map((e=>e.toString())).join(" ")}`:"";const n=`${r.name}${e}${t} = ${r.result}`.replace(/(:|\?)bytes /g,"$1string ").replace(/|{|}/g,"").replace(/ \w+:flags\.\d+\?true/g,"");"inputMediaInvoice"===r.name&&r.name,r.constructorId=d(s.from(n,"utf8"))}for(const[e,t,n]of o)void 0===e&&(r.argsConfig[i(t)]=g(t,n));return r.name.includes(".")&&([r.namespace,r.name]=r.name.split(/\.(.+)/)),r.name=a(r.name),r};function g(e,t){e="self"===e?"is_self":e;const n={isVector:!1,isFlag:!1,skipConstructorId:!1,flagIndex:-1,flagIndicator:!0,type:void 0,useVectorId:void 0};if("#"!==t){n.flagIndicator=!1,n.type=t.replace(/^!+/,"");const e=n.type.match(/flags.(\d+)\?([\w<>.]+)/);e&&(n.isFlag=!0,n.flagIndex=Number(e[1]),[,,n.type]=e);const s=n.type.match(/[Vv]ector<([\w\d.]+)>/);s&&(n.isVector=!0,n.useVectorId="V"===n.type.charAt(0),[,n.type]=s),/^[a-z]$/.test(n.type.split(".").pop().charAt(0))&&(n.skipConstructorId=!0)}return n}e.exports={findAll:l,parseTl:function*(e,t,n=[],s=o){(n||[]).reduce(((e,t)=>({...e,[t.name]:t})),{});const a=[],i={},c={},d=e;let l=!1;for(let e of d.split("\n")){const t=e.indexOf("//");if(-1!==t&&(e=e.slice(0,t)),e=e.trim(),!e)continue;const n=e.match(/---(\w+)---/);if(n){const[,e]=n;l="functions"===e}else try{const t=u(e,l);if(s.has(t.constructorId))continue;a.push(t),t.isFunction||(c[t.result]||(c[t.result]=[]),i[t.name]=t,c[t.result].push(t))}catch(e){if(!e.toString().includes("vector#1cb5c415"))throw e}}for(const e of a)if(r.has(e.constructorId))for(const t in e.argsConfig)"string"===e.argsConfig[t].type&&(e.argsConfig[t].type="bytes");for(const e of a)yield e},buildArgConfig:g,fromLine:u,CORE_TYPES:o,serializeDate:function(e){if(!e)return s.alloc(4).fill(0);if(e instanceof Date&&(e=Math.floor((Date.now()-e.getTime())/1e3)),"number"==typeof e){const t=s.alloc(4);return t.writeInt32LE(e,0),t}throw Error(`Cannot interpret "${e}" as a date`)},serializeBytes:function(e){if(!(e instanceof s)){if("string"!=typeof e)throw Error(`Bytes or str expected, not ${e.constructor.name}`);e=s.from(e)}const t=[];let n;return e.length<254?(n=(e.length+1)%4,0!==n&&(n=4-n),t.push(s.from([e.length])),t.push(e)):(n=e.length%4,0!==n&&(n=4-n),t.push(s.from([254,e.length%256,(e.length>>8)%256,(e.length>>16)%256])),t.push(e)),t.push(s.alloc(n).fill(0)),s.concat(t)},snakeToCamelCase:a,variableSnakeToCamelCase:i}},7404:(e,t,n)=>{const s=n(7150),{serializeBytes:a,serializeDate:i}=n(1436);e.exports={constructors:s,requests:s,serializeBytes:a,serializeDate:i}},8106:e=>{e.exports="resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector = ResPQ;\np_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data;\nserver_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params;\nserver_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;\nserver_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;\nclient_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;\ndh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;\ndh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer;\ndh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;\ndestroy_auth_key_ok#f660e1d4 = DestroyAuthKeyRes;\ndestroy_auth_key_none#0a9f2259 = DestroyAuthKeyRes;\ndestroy_auth_key_fail#ea109b13 = DestroyAuthKeyRes;\n---functions---\nreq_pq#60469778 nonce:int128 = ResPQ;\nreq_pq_multi#be7e8ef1 nonce:int128 = ResPQ;\nreq_pq_multi_new#51b410fd nonce:int128 = ResPQ;\nreq_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;\nset_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;\ndestroy_auth_key#d1435160 = DestroyAuthKeyRes;\n---types---\nmsgs_ack#62d6b459 msg_ids:Vector = MsgsAck;\nbad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int error_code:int = BadMsgNotification;\nbad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_server_salt:long = BadMsgNotification;\nmsgs_state_req#da69fb52 msg_ids:Vector = MsgsStateReq;\nmsgs_state_info#04deb57d req_msg_id:long info:string = MsgsStateInfo;\nmsgs_all_info#8cc0d131 msg_ids:Vector info:string = MsgsAllInfo;\nmsg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\nmsg_new_detailed_info#809db6df answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\nmsg_resend_req#7d861a08 msg_ids:Vector = MsgResendReq;\nrpc_error#2144ca19 error_code:int error_message:string = RpcError;\nfuture_salt#0949d9dc valid_since:int valid_until:int salt:long = FutureSalt;\nfuture_salts#ae500895 req_msg_id:long now:int salts:vector = FutureSalts;\npong#347773c5 msg_id:long ping_id:long = Pong;\ndestroy_session_ok#e22045fc session_id:long = DestroySessionRes;\ndestroy_session_none#62d350c9 session_id:long = DestroySessionRes;\nnew_session_created#9ec20908 first_msg_id:long unique_id:long server_salt:long = NewSession;\n---functions---\nping#7abe77ec ping_id:long = Pong;\nping_delay_disconnect#f3427b8c ping_id:long disconnect_delay:int = Pong;"}},s={};function a(e){var t=s[e];if(void 0!==t)return t.exports;var i=s[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,a),i.loaded=!0,i.exports}a.m=n,a.x=()=>{var e=a.O(void 0,[592],(()=>a(6514)));return a.O(e)},e=[],a.O=(t,n,s,i)=>{if(!n){var o=1/0;for(l=0;l=i)&&Object.keys(a.O).every((e=>a.O[e](n[c])))?n.splice(c--,1):(r=!1,i0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[n,s,i]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,n)=>(a.f[n](e,t),t)),[])),a.u=e=>e+".d7ca037ed9b7d1c6792a.js",a.miniCssF=e=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={514:1};a.f.i=(t,n)=>{e[t]||importScripts(a.p+a.u(t))};var t=self.webpackChunktelegram_t=self.webpackChunktelegram_t||[],n=t.push.bind(t);t.push=t=>{var[s,i,o]=t;for(var r in i)a.o(i,r)&&(a.m[r]=i[r]);for(o&&o(a);s.length;)e[s.pop()]=1;n(t)}})(),t=a.x,a.x=()=>a.e(592).then(t),a.x()})(); +//# sourceMappingURL=514.e85ae04366b5ac2cfcb1.js.map \ No newline at end of file diff --git a/dist/514.e85ae04366b5ac2cfcb1.js.map b/dist/514.e85ae04366b5ac2cfcb1.js.map new file mode 100644 index 00000000..9087c92a --- /dev/null +++ b/dist/514.e85ae04366b5ac2cfcb1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"514.e85ae04366b5ac2cfcb1.js","mappings":"UAAIA,ECAAC,E,6gHCAG,MAiGMC,GA3DyB,oBAAXC,QAA0BA,OAAOC,YA2DzBC,KAAKC,MAAM,MACjCC,EAA6B,IAAIC,IAAI,CAChD,aAAc,sBAAuB,iBAAkB,0BAA2B,kBAwBtC,IAAIA,IAAI,CACpD,YAAa,YAAa,aAAc,YAAa,YAAa,oB,cCpH7D,SAASC,EAA2CC,EAAiBC,GAC1E,OAAOD,EAAWE,QAAO,CAACC,EAA2BC,KACnDD,EAAMC,EAAOH,IAAQG,EAEdD,IACN,IAaE,SAASE,EAA2BC,EAAWC,GACpD,OAAOA,EAAKL,QAAO,CAACM,EAAQP,KAC1BO,EAAOP,GAAOK,EAAOL,GACdO,IACN,IC5BE,SAASC,EAAWC,GACzB,OAAOA,EAAKC,eAAe,UAGtB,SAASC,EAAWF,GACzB,OAAOA,EAAKC,eAAe,UCPtB,SAASE,EAAeC,EAAeC,GAAmB,EAAOC,EAAmB,cAG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B,IAAKi/D,EAAU+B,EAAaC,GAAWjhE,EACvC,IAAI,IAAI2+D,KAAYqC,EAChBtC,EAAoBX,EAAEiD,EAAarC,KACrCD,EAAoB16B,EAAE26B,GAAYqC,EAAYrC,IAIhD,IADGsC,GAASA,EAAQvC,GACdO,EAASnjE,QACd+kE,EAAgB5B,EAAS1c,OAAS,EACnCwe,EAA2B/gE,K,GhHnBxBrP,EAAO+tE,EAAoBv5B,EAC/Bu5B,EAAoBv5B,EAAI,IAChBu5B,EAAoB5qD,EAAE,KAAKosB,KAAKvvC,GiHDd+tE,EAAoBv5B,K","sources":["webpack://telegram-t/webpack/runtime/chunk loaded","webpack://telegram-t/webpack/runtime/startup chunk dependencies","webpack://telegram-t/./src/config.ts","webpack://telegram-t/./src/util/iteratees.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/peers.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/helpers.ts","webpack://telegram-t/./src/util/serverTime.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/chats.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/pathBytesToSvg.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/common.ts","webpack://telegram-t/./src/api/gramjs/localDb.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/symbols.ts","webpack://telegram-t/./src/util/waveform.ts","webpack://telegram-t/./src/api/types/messages.ts","webpack://telegram-t/./src/api/types/media.ts","webpack://telegram-t/./src/api/gramjs/gramjsBuilders/index.ts","webpack://telegram-t/./src/api/gramjs/helpers.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/messages.ts","webpack://telegram-t/./src/api/gramjs/updater.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/users.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/misc.ts","webpack://telegram-t/./src/api/gramjs/methods/auth.ts","webpack://telegram-t/./src/util/files.ts","webpack://telegram-t/./src/util/cacheApi.ts","webpack://telegram-t/./src/api/gramjs/methods/media.ts","webpack://telegram-t/./src/api/gramjs/methods/client.ts","webpack://telegram-t/./src/api/gramjs/methods/chats.ts","webpack://telegram-t/./src/api/gramjs/methods/messages.ts","webpack://telegram-t/./src/api/gramjs/methods/users.ts","webpack://telegram-t/./src/api/gramjs/methods/symbols.ts","webpack://telegram-t/./src/api/gramjs/methods/management.ts","webpack://telegram-t/./src/api/gramjs/methods/twoFaSettings.ts","webpack://telegram-t/./src/api/gramjs/methods/settings.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/bots.ts","webpack://telegram-t/./src/api/gramjs/methods/bots.ts","webpack://telegram-t/./src/api/gramjs/apiBuilders/payments.ts","webpack://telegram-t/./src/api/gramjs/methods/payments.ts","webpack://telegram-t/./src/api/gramjs/provider.ts","webpack://telegram-t/./src/util/schedulers.ts","webpack://telegram-t/./src/api/gramjs/worker/worker.ts","webpack://telegram-t/./src/lib/gramjs/Helpers.js","webpack://telegram-t/./src/lib/gramjs/Password.js","webpack://telegram-t/./src/lib/gramjs/Utils.js","webpack://telegram-t/./src/lib/gramjs/Version.js","webpack://telegram-t/./src/lib/gramjs/client/2fa.ts","webpack://telegram-t/./src/lib/gramjs/client/TelegramClient.js","webpack://telegram-t/./src/lib/gramjs/client/auth.ts","webpack://telegram-t/./src/lib/gramjs/client/downloadFile.ts","webpack://telegram-t/./src/lib/gramjs/client/uploadFile.ts","webpack://telegram-t/./src/lib/gramjs/crypto/AuthKey.js","webpack://telegram-t/./src/lib/gramjs/crypto/CTR.js","webpack://telegram-t/./src/lib/gramjs/crypto/Factorizator.js","webpack://telegram-t/./src/lib/gramjs/crypto/IGE.js","webpack://telegram-t/./src/lib/gramjs/crypto/converters.ts","webpack://telegram-t/./src/lib/gramjs/crypto/crypto.js","webpack://telegram-t/./src/lib/gramjs/crypto/words.ts","webpack://telegram-t/./src/lib/gramjs/errors/Common.js","webpack://telegram-t/./src/lib/gramjs/errors/RPCBaseErrors.js","webpack://telegram-t/./src/lib/gramjs/errors/RPCErrorList.js","webpack://telegram-t/./src/lib/gramjs/errors/index.js","webpack://telegram-t/./src/lib/gramjs/events/Raw.js","webpack://telegram-t/./src/lib/gramjs/events/common.js","webpack://telegram-t/./src/lib/gramjs/events/index.js","webpack://telegram-t/./src/lib/gramjs/extensions/AsyncQueue.js","webpack://telegram-t/./src/lib/gramjs/extensions/BinaryReader.js","webpack://telegram-t/./src/lib/gramjs/extensions/BinaryWriter.js","webpack://telegram-t/./src/lib/gramjs/extensions/Logger.js","webpack://telegram-t/./src/lib/gramjs/extensions/MessagePacker.js","webpack://telegram-t/./src/lib/gramjs/extensions/PromisedWebSockets.js","webpack://telegram-t/./src/lib/gramjs/extensions/index.js","webpack://telegram-t/./src/lib/gramjs/index.js","webpack://telegram-t/./src/lib/gramjs/crypto/RSA.ts","webpack://telegram-t/./src/lib/gramjs/network/Authenticator.ts","webpack://telegram-t/./src/lib/gramjs/network/MTProtoPlainSender.js","webpack://telegram-t/./src/lib/gramjs/network/MTProtoSender.js","webpack://telegram-t/./src/lib/gramjs/network/MTProtoState.js","webpack://telegram-t/./src/lib/gramjs/network/RequestState.js","webpack://telegram-t/./src/lib/gramjs/network/connection/Connection.js","webpack://telegram-t/./src/lib/gramjs/network/connection/TCPAbridged.js","webpack://telegram-t/./src/lib/gramjs/network/connection/TCPObfuscated.js","webpack://telegram-t/./src/lib/gramjs/network/connection/index.js","webpack://telegram-t/./src/lib/gramjs/network/index.js","webpack://telegram-t/./src/lib/gramjs/sessions/Abstract.js","webpack://telegram-t/./src/lib/gramjs/sessions/CacheApiSession.js","webpack://telegram-t/./src/lib/gramjs/sessions/CallbackSession.js","webpack://telegram-t/./src/lib/gramjs/sessions/IdbSession.js","webpack://telegram-t/./src/lib/gramjs/sessions/LocalStorageSession.js","webpack://telegram-t/./src/lib/gramjs/sessions/Memory.js","webpack://telegram-t/./src/lib/gramjs/sessions/StorageSession.js","webpack://telegram-t/./src/lib/gramjs/sessions/StringSession.js","webpack://telegram-t/./src/lib/gramjs/sessions/index.js","webpack://telegram-t/./src/lib/gramjs/tl/AllTLObjects.js","webpack://telegram-t/./src/lib/gramjs/tl/api.js","webpack://telegram-t/./src/lib/gramjs/tl/apiTl.js","webpack://telegram-t/./src/lib/gramjs/tl/core/GZIPPacked.js","webpack://telegram-t/./src/lib/gramjs/tl/core/MessageContainer.js","webpack://telegram-t/./src/lib/gramjs/tl/core/RPCResult.js","webpack://telegram-t/./src/lib/gramjs/tl/core/TLMessage.js","webpack://telegram-t/./src/lib/gramjs/tl/core/index.js","webpack://telegram-t/./src/lib/gramjs/tl/generationHelpers.js","webpack://telegram-t/./src/lib/gramjs/tl/index.js","webpack://telegram-t/./src/lib/gramjs/tl/schemaTl.js","webpack://telegram-t/webpack/bootstrap","webpack://telegram-t/webpack/runtime/compat get default export","webpack://telegram-t/webpack/runtime/define property getters","webpack://telegram-t/webpack/runtime/ensure chunk","webpack://telegram-t/webpack/runtime/get javascript chunk filename","webpack://telegram-t/webpack/runtime/get mini-css chunk filename","webpack://telegram-t/webpack/runtime/global","webpack://telegram-t/webpack/runtime/hasOwnProperty shorthand","webpack://telegram-t/webpack/runtime/make namespace object","webpack://telegram-t/webpack/runtime/node module decorator","webpack://telegram-t/webpack/runtime/publicPath","webpack://telegram-t/webpack/runtime/importScripts chunk loading","webpack://telegram-t/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn __webpack_require__.e(592).then(next);\n};","export const PAGE_TITLE = 'Telegram';\nexport const INACTIVE_MARKER = ' [Inactive]';\n\nexport const APP_NAME = process.env.APP_NAME || 'Telegram WebZ';\nexport const APP_VERSION = process.env.APP_VERSION || 'dev';\n\nexport const DEBUG = (\n process.env.APP_ENV !== 'production' && process.env.APP_ENV !== 'perf' && process.env.APP_ENV !== 'test'\n);\nexport const DEBUG_MORE = false;\n\nexport const IS_TEST = process.env.APP_ENV === 'test';\nexport const IS_PERF = process.env.APP_ENV === 'perf';\n\nexport const DEBUG_ALERT_MSG = 'Shoot!\\nSomething went wrong, please see the error details in Dev Tools Console.';\nexport const DEBUG_GRAMJS = false;\n\nexport const SESSION_USER_KEY = 'user_auth';\nexport const LEGACY_SESSION_KEY = 'GramJs:sessionId';\n\nexport const GLOBAL_STATE_CACHE_DISABLED = false;\nexport const GLOBAL_STATE_CACHE_KEY = 'tt-global-state';\nexport const GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT = 30;\nexport const GLOBAL_STATE_CACHE_USER_LIST_LIMIT = 5000;\n\nexport const MEDIA_CACHE_DISABLED = false;\nexport const MEDIA_CACHE_NAME = 'tt-media';\nexport const MEDIA_CACHE_NAME_AVATARS = 'tt-media-avatars';\nexport const MEDIA_PROGRESSIVE_CACHE_DISABLED = false;\nexport const MEDIA_PROGRESSIVE_CACHE_NAME = 'tt-media-progressive';\nexport const MEDIA_CACHE_MAX_BYTES = 512 * 1024; // 512 KB\nexport const CUSTOM_BG_CACHE_NAME = 'tt-custom-bg';\nexport const LANG_CACHE_NAME = 'tt-lang-packs-v5';\nexport const ASSET_CACHE_NAME = 'tt-assets';\n\nexport const DOWNLOAD_WORKERS = 16;\nexport const UPLOAD_WORKERS = 16;\n\nconst isBigScreen = typeof window !== 'undefined' && window.innerHeight >= 900;\n\nexport const MIN_PASSWORD_LENGTH = 1;\n\nexport const MESSAGE_LIST_SENSITIVE_AREA = 750;\nexport const MESSAGE_LIST_SLICE = isBigScreen ? 60 : 40;\nexport const MESSAGE_LIST_VIEWPORT_LIMIT = MESSAGE_LIST_SLICE * 2;\n\nexport const CHAT_HEIGHT_PX = 72;\nexport const CHAT_LIST_SLICE = isBigScreen ? 30 : 25;\nexport const CHAT_LIST_LOAD_SLICE = 100;\nexport const SHARED_MEDIA_SLICE = 42;\nexport const MESSAGE_SEARCH_SLICE = 42;\nexport const GLOBAL_SEARCH_SLICE = 20;\nexport const MEMBERS_SLICE = 30;\nexport const MEMBERS_LOAD_SLICE = 200;\nexport const PINNED_MESSAGES_LIMIT = 50;\nexport const BLOCKED_LIST_LIMIT = 100;\nexport const PROFILE_PHOTOS_LIMIT = 40;\nexport const PROFILE_SENSITIVE_AREA = 500;\n\nexport const TOP_CHAT_MESSAGES_PRELOAD_LIMIT = 20;\nexport const ALL_CHATS_PRELOAD_DISABLED = false;\n\nexport const ANIMATION_LEVEL_MIN = 0;\nexport const ANIMATION_LEVEL_MED = 1;\nexport const ANIMATION_LEVEL_MAX = 2;\nexport const ANIMATION_LEVEL_DEFAULT = ANIMATION_LEVEL_MAX;\n\nexport const DEFAULT_MESSAGE_TEXT_SIZE_PX = 16;\nexport const IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 17;\nexport const MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 15;\n\nexport const DRAFT_DEBOUNCE = 10000; // 10s\n\nexport const EDITABLE_INPUT_ID = 'editable-message-text';\nexport const EDITABLE_INPUT_MODAL_ID = 'editable-message-text-modal';\n\n// Screen width where Pinned Message / Audio Player in the Middle Header can be safely displayed\nexport const SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1440; // px\n// Screen width where Pinned Message / Audio Player in the Middle Header shouldn't collapse with ChatInfo\nexport const SAFE_SCREEN_WIDTH_FOR_CHAT_INFO = 1150; // px\n\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1275; // px\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN = 925; // px\nexport const MOBILE_SCREEN_MAX_WIDTH = 600; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH = 950; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT = 450; // px\n\nexport const LOCAL_MESSAGE_ID_BASE = 1e9;\n\nexport const ANIMATION_END_DELAY = 100;\n\nexport const FAST_SMOOTH_MAX_DISTANCE = 1500;\nexport const FAST_SMOOTH_MIN_DURATION = 250;\nexport const FAST_SMOOTH_MAX_DURATION = 600;\nexport const FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE = 500; // px\n\n// Average duration of message sending animation\nexport const API_UPDATE_THROTTLE = Math.round((FAST_SMOOTH_MIN_DURATION + FAST_SMOOTH_MAX_DURATION) / 2);\nexport const API_THROTTLE_RESET_UPDATES = new Set([\n 'newMessage', 'newScheduledMessage', 'deleteMessages', 'deleteScheduledMessages', 'deleteHistory',\n]);\n\nexport const STICKER_SIZE_INLINE_DESKTOP_FACTOR = 13;\nexport const STICKER_SIZE_INLINE_MOBILE_FACTOR = 11;\nexport const STICKER_SIZE_AUTH = 160;\nexport const STICKER_SIZE_AUTH_MOBILE = 120;\nexport const STICKER_SIZE_PICKER = 64;\nexport const STICKER_SIZE_GENERAL_SETTINGS = 48;\nexport const STICKER_SIZE_PICKER_HEADER = 32;\nexport const STICKER_SIZE_SEARCH = 64;\nexport const STICKER_SIZE_MODAL = 64;\nexport const STICKER_SIZE_TWO_FA = 160;\nexport const STICKER_SIZE_DISCUSSION_GROUPS = 140;\nexport const STICKER_SIZE_FOLDER_SETTINGS = 80;\nexport const STICKER_SIZE_INLINE_BOT_RESULT = 100;\nexport const RECENT_STICKERS_LIMIT = 20;\nexport const MEMOJI_STICKER_ID = 'MEMOJI_STICKER';\n\nexport const BASE_EMOJI_KEYWORD_LANG = 'en';\n\nexport const MENU_TRANSITION_DURATION = 200;\nexport const SLIDE_TRANSITION_DURATION = 450;\n\nexport const CONTENT_TYPES_FOR_QUICK_UPLOAD = new Set([\n 'image/png', 'image/gif', 'image/jpeg', 'video/mp4', 'video/avi', 'video/quicktime',\n]);\n\n// eslint-disable-next-line max-len\nexport const RE_LINK_TEMPLATE = '((ftp|https?):\\\\/\\\\/)?((www\\\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\\\.[a-zA-Z0-9()]{1,63})\\\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)';\nexport const RE_MENTION_TEMPLATE = '(@[\\\\w\\\\d_-]+)';\nexport const RE_TME_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/)([\\d\\w_]+)(?:\\/([\\d]+))?(?:\\/([\\d]+))?$/gm;\nexport const RE_TME_INVITE_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/joinchat\\/)([\\d\\w_-]+)?$/gm;\n\n// MTProto constants\nexport const SERVICE_NOTIFICATIONS_USER_ID = 777000;\nexport const REPLIES_USER_ID = 1271266957;\nexport const ALL_FOLDER_ID = 0;\nexport const ARCHIVED_FOLDER_ID = 1;\nexport const DELETED_COMMENTS_CHANNEL_ID = 777;\nexport const MAX_MEDIA_FILES_FOR_ALBUM = 10;\nexport const MAX_ACTIVE_PINNED_CHATS = 5;\nexport const SCHEDULED_WHEN_ONLINE = 0x7FFFFFFE;\nexport const DEFAULT_LANG_CODE = 'en';\nexport const DEFAULT_LANG_PACK = 'android';\nexport const LANG_PACKS = ['android', 'ios', 'tdesktop', 'macos'] as const;\nexport const TIPS_USERNAME = 'TelegramTips';\nexport const LOCALIZED_TIPS = ['ar', 'pt-br', 'id', 'it', 'ko', 'ms', 'pl', 'es', 'tr'];\nexport const FEEDBACK_URL = 'https://bugs.telegram.org/?tag_ids=41&sort=time';\nexport const LIGHT_THEME_BG_COLOR = '#A2AF8E';\nexport const DARK_THEME_BG_COLOR = '#0F0F0F';\nexport const DARK_THEME_PATTERN_COLOR = '#0a0a0a8c';\nexport const DEFAULT_PATTERN_COLOR = 'rgba(90, 110, 70, 0.6)';\n","type CollectionByKey = Record;\n\ntype OrderDirection = 'asc' | 'desc';\n\ninterface OrderCallback {\n (member: T): any;\n}\n\nexport function buildCollectionByKey(collection: T[], key: keyof T) {\n return collection.reduce((byKey: CollectionByKey, member: T) => {\n byKey[member[key]] = member;\n\n return byKey;\n }, {});\n}\n\nexport function mapValues(\n byKey: CollectionByKey,\n callback: (member: M, key: string, index: number, originalByKey: CollectionByKey) => R,\n): CollectionByKey {\n return Object.keys(byKey).reduce((newByKey: CollectionByKey, key, index) => {\n newByKey[key] = callback(byKey[key], key, index, byKey);\n return newByKey;\n }, {});\n}\n\nexport function pick(object: T, keys: K[]) {\n return keys.reduce((result, key) => {\n result[key] = object[key];\n return result;\n }, {} as Pick);\n}\n\nexport function pickTruthy(object: T, keys: K[]) {\n return keys.reduce((result, key) => {\n if (object[key]) {\n result[key] = object[key];\n }\n\n return result;\n }, {} as Pick);\n}\n\nexport function omit(object: T, keys: K[]) {\n const stringKeys = new Set(keys.map(String));\n const savedKeys = Object.keys(object)\n .filter((key) => !stringKeys.has(key)) as Array>;\n\n return pick(object, savedKeys);\n}\n\nexport function orderBy(\n collection: T[],\n orderKey: (keyof T) | OrderCallback | ((keyof T) | OrderCallback)[],\n mode: OrderDirection | [OrderDirection, OrderDirection] = 'asc',\n): T[] {\n return collection.sort((a, b) => {\n if (Array.isArray(orderKey)) {\n const [mode1, mode2] = Array.isArray(mode) ? mode : [mode, mode];\n const [orderKey1, orderKey2] = orderKey;\n\n let aValue1;\n let bValue1;\n\n if (typeof orderKey1 === 'function') {\n aValue1 = orderKey1(a) || 0;\n bValue1 = orderKey1(b) || 0;\n } else if (typeof orderKey1 === 'string') {\n aValue1 = a[orderKey1] || 0;\n bValue1 = b[orderKey1] || 0;\n }\n\n if (aValue1 !== bValue1) {\n return mode1 === 'asc' ? aValue1 - bValue1 : bValue1 - aValue1;\n } else {\n let aValue2;\n let bValue2;\n\n if (typeof orderKey2 === 'function') {\n aValue2 = orderKey2(a) || 0;\n bValue2 = orderKey2(b) || 0;\n } else if (typeof orderKey2 === 'string') {\n aValue2 = a[orderKey2] || 0;\n bValue2 = b[orderKey2] || 0;\n }\n\n return mode2 === 'asc' ? aValue2 - bValue2 : bValue2 - aValue2;\n }\n }\n\n let aValue;\n let bValue;\n\n if (typeof orderKey === 'function') {\n aValue = orderKey(a) || 0;\n bValue = orderKey(b) || 0;\n } else if (typeof orderKey === 'string') {\n aValue = a[orderKey] || 0;\n bValue = b[orderKey] || 0;\n }\n\n return mode === 'asc' ? aValue - bValue : bValue - aValue;\n });\n}\n\nexport function flatten(array: any[]) {\n return array.reduce((result, member) => {\n if (Array.isArray(member)) {\n return result.concat(member);\n } else {\n result.push(member);\n return result;\n }\n }, []);\n}\n\nexport function unique(array: T[]): T[] {\n return Array.from(new Set(array));\n}\n\nexport function compact(array: any[]) {\n return array.filter(Boolean);\n}\n\nexport function areSortedArraysEqual(array1: any[], array2: any[]) {\n if (array1.length !== array2.length) {\n return false;\n }\n\n return array1.every((item, i) => item === array2[i]);\n}\n\nexport function areSortedArraysIntersecting(array1: any[], array2: any[]) {\n return array1[0] <= array2[array2.length - 1] && array1[array1.length - 1] >= array2[0];\n}\n\nexport function findIntersectionWithSet(array: T[], set: Set): T[] {\n return array.filter((a) => set.has(a));\n}\n\nexport function split(array: any[], chunkSize: number) {\n const result = [];\n for (let i = 0; i < array.length; i += chunkSize) {\n result.push(array.slice(i, i + chunkSize));\n }\n\n return result;\n}\n\nexport function cloneDeep(value: T): T {\n if (typeof value !== 'object') {\n return value;\n }\n\n if (Array.isArray(value)) {\n return value.map(cloneDeep) as typeof value;\n }\n\n return Object.keys(value).reduce((acc, key) => {\n acc[key as keyof T] = cloneDeep(value[key as keyof T]);\n return acc;\n }, {} as T);\n}\n\n/**\n * Returns the index of the last element in the array where predicate is true, and -1 otherwise.\n *\n * @param array The source array to search in\n * @param predicate find calls predicate once for each element of the array, in descending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.\n */\nexport function findLast(array: Array, predicate: (value: T, index: number, obj: T[]) => boolean): T | undefined {\n let cursor = array.length;\n\n while (cursor--) {\n if (predicate(array[cursor], cursor, array)) {\n return array[cursor];\n }\n }\n\n return undefined;\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\n\nexport function isPeerUser(peer: GramJs.TypePeer): peer is GramJs.PeerUser {\n return peer.hasOwnProperty('userId');\n}\n\nexport function isPeerChat(peer: GramJs.TypePeer): peer is GramJs.PeerChat {\n return peer.hasOwnProperty('chatId');\n}\n\nexport function isPeerChannel(peer: GramJs.TypePeer): peer is GramJs.PeerChannel {\n return peer.hasOwnProperty('channelId');\n}\n\nexport function isInputPeerUser(peer: GramJs.TypeInputPeer): peer is GramJs.InputPeerUser {\n return peer.hasOwnProperty('userId');\n}\n\nexport function isInputPeerChat(peer: GramJs.TypeInputPeer): peer is GramJs.InputPeerChat {\n return peer.hasOwnProperty('chatId');\n}\n\nexport function isInputPeerChannel(peer: GramJs.TypeInputPeer): peer is GramJs.InputPeerChannel {\n return peer.hasOwnProperty('channelId');\n}\n","export function bytesToDataUri(bytes: Buffer, shouldOmitPrefix = false, mimeType: string = 'image/jpeg') {\n const prefix = shouldOmitPrefix ? '' : `data:${mimeType};base64,`;\n\n return `${prefix}${btoa(String.fromCharCode(...bytes))}`;\n}\n\nexport function omitVirtualClassFields(instance: any) {\n if (!instance) {\n return undefined;\n }\n\n const {\n flags,\n CONSTRUCTOR_ID,\n SUBCLASS_OF_ID,\n className,\n classType,\n ...rest\n } = instance;\n\n return rest;\n}\n","export const getServerTime = (serverTimeOffset: number) => {\n return Math.floor(Date.now() / 1000) + serverTimeOffset;\n};\n","import { Api as GramJs } from '../../../lib/gramjs';\nimport {\n ApiChat,\n ApiChatAdminRights,\n ApiChatBannedRights,\n ApiBotCommand,\n ApiChatFolder,\n ApiChatMember,\n ApiRestrictionReason,\n} from '../../types';\nimport { pick, pickTruthy } from '../../../util/iteratees';\nimport {\n isInputPeerChannel, isInputPeerChat, isInputPeerUser, isPeerChat, isPeerUser,\n} from './peers';\nimport { omitVirtualClassFields } from './helpers';\nimport { getServerTime } from '../../../util/serverTime';\n\ntype PeerEntityApiChatFields = Omit;\n\nfunction buildApiChatFieldsFromPeerEntity(\n peerEntity: GramJs.TypeUser | GramJs.TypeChat,\n isSupport = false,\n): PeerEntityApiChatFields {\n const isMin = Boolean('min' in peerEntity && peerEntity.min);\n const accessHash = ('accessHash' in peerEntity) && String(peerEntity.accessHash);\n const avatarHash = ('photo' in peerEntity) && peerEntity.photo && buildAvatarHash(peerEntity.photo);\n const isSignaturesShown = Boolean('signatures' in peerEntity && peerEntity.signatures);\n const hasPrivateLink = Boolean('hasLink' in peerEntity && peerEntity.hasLink);\n\n return {\n isMin,\n hasPrivateLink,\n isSignaturesShown,\n ...(accessHash && { accessHash }),\n ...(avatarHash && { avatarHash }),\n ...(\n (peerEntity instanceof GramJs.Channel || peerEntity instanceof GramJs.User)\n && { username: peerEntity.username }\n ),\n ...(('verified' in peerEntity) && { isVerified: peerEntity.verified }),\n ...(('callActive' in peerEntity) && { isCallActive: peerEntity.callActive }),\n ...(('callNotEmpty' in peerEntity) && { isCallNotEmpty: peerEntity.callNotEmpty }),\n ...((peerEntity instanceof GramJs.Chat || peerEntity instanceof GramJs.Channel) && {\n ...(peerEntity.participantsCount && { membersCount: peerEntity.participantsCount }),\n joinDate: peerEntity.date,\n }),\n ...(isSupport && { isSupport: true }),\n ...buildApiChatPermissions(peerEntity),\n ...(('creator' in peerEntity) && { isCreator: peerEntity.creator }),\n ...buildApiChatRestrictions(peerEntity),\n ...buildApiChatMigrationInfo(peerEntity),\n };\n}\n\nexport function buildApiChatFromDialog(\n dialog: GramJs.Dialog,\n peerEntity: GramJs.TypeUser | GramJs.TypeChat,\n serverTimeOffset: number,\n): ApiChat {\n const {\n peer, folderId, unreadMark, unreadCount, unreadMentionsCount, notifySettings: { silent, muteUntil },\n readOutboxMaxId, readInboxMaxId, draft,\n } = dialog;\n const isMuted = silent || (typeof muteUntil === 'number' && getServerTime(serverTimeOffset) < muteUntil);\n\n return {\n id: getApiChatIdFromMtpPeer(peer),\n ...(folderId && { folderId }),\n type: getApiChatTypeFromPeerEntity(peerEntity),\n title: getApiChatTitleFromMtpPeer(peer, peerEntity),\n lastReadOutboxMessageId: readOutboxMaxId,\n lastReadInboxMessageId: readInboxMaxId,\n unreadCount,\n unreadMentionsCount,\n isMuted,\n ...(unreadMark && { hasUnreadMark: true }),\n ...(draft instanceof GramJs.DraftMessage && { draftDate: draft.date }),\n ...buildApiChatFieldsFromPeerEntity(peerEntity),\n };\n}\n\nfunction buildApiChatPermissions(peerEntity: GramJs.TypeUser | GramJs.TypeChat): {\n adminRights?: ApiChatAdminRights;\n currentUserBannedRights?: ApiChatBannedRights;\n defaultBannedRights?: ApiChatBannedRights;\n} {\n if (!(peerEntity instanceof GramJs.Chat || peerEntity instanceof GramJs.Channel)) {\n return {};\n }\n\n return {\n adminRights: omitVirtualClassFields(peerEntity.adminRights),\n currentUserBannedRights: peerEntity instanceof GramJs.Channel\n ? omitVirtualClassFields(peerEntity.bannedRights)\n : undefined,\n defaultBannedRights: omitVirtualClassFields(peerEntity.defaultBannedRights),\n };\n}\n\nfunction buildApiChatRestrictions(peerEntity: GramJs.TypeUser | GramJs.TypeChat): {\n isNotJoined?: boolean;\n isRestricted?: boolean;\n restrictionReason?: ApiRestrictionReason;\n} {\n if (peerEntity instanceof GramJs.ChatForbidden || peerEntity instanceof GramJs.ChannelForbidden) {\n return {\n isRestricted: true,\n };\n }\n\n const restrictions = {};\n\n if ('restricted' in peerEntity) {\n const restrictionReason = peerEntity.restricted\n ? buildApiChatRestrictionReason(peerEntity.restrictionReason)\n : undefined;\n\n if (restrictionReason) {\n Object.assign(restrictions, {\n isRestricted: true,\n restrictionReason,\n });\n }\n }\n\n if (peerEntity instanceof GramJs.Chat) {\n Object.assign(restrictions, {\n isNotJoined: peerEntity.left,\n isRestricted: peerEntity.kicked,\n });\n }\n\n if (peerEntity instanceof GramJs.Channel) {\n Object.assign(restrictions, {\n // `left` is weirdly set to `true` on all channels never joined before\n isNotJoined: peerEntity.left,\n });\n }\n\n return restrictions;\n}\n\nfunction buildApiChatMigrationInfo(peerEntity: GramJs.TypeChat): {\n migratedTo?: {\n chatId: number;\n accessHash?: string;\n };\n} {\n if (\n peerEntity instanceof GramJs.Chat\n && peerEntity.migratedTo\n && !(peerEntity.migratedTo instanceof GramJs.InputChannelEmpty)\n ) {\n return {\n migratedTo: {\n chatId: getApiChatIdFromMtpPeer(peerEntity.migratedTo),\n ...(peerEntity.migratedTo instanceof GramJs.InputChannel && {\n accessHash: peerEntity.migratedTo.accessHash.toString(),\n }),\n },\n };\n }\n\n return {};\n}\n\nfunction buildApiChatRestrictionReason(\n restrictionReasons?: GramJs.RestrictionReason[],\n): ApiRestrictionReason | undefined {\n if (!restrictionReasons) {\n return undefined;\n }\n\n const targetReason = restrictionReasons.find(({ platform }) => platform === 'all');\n return targetReason ? pick(targetReason, ['reason', 'text']) : undefined;\n}\n\nexport function buildApiChatFromPreview(\n preview: GramJs.TypeChat | GramJs.TypeUser,\n isSupport = false,\n withForbidden = false,\n): ApiChat | undefined {\n if (!(\n preview instanceof GramJs.Chat\n || preview instanceof GramJs.Channel\n || preview instanceof GramJs.User\n || (\n withForbidden\n && (\n preview instanceof GramJs.ChatForbidden\n || preview instanceof GramJs.ChannelForbidden\n )\n )\n )) {\n return undefined;\n }\n\n return {\n id: preview instanceof GramJs.User ? preview.id : -preview.id,\n type: getApiChatTypeFromPeerEntity(preview),\n title: preview instanceof GramJs.User ? getUserName(preview) : preview.title,\n ...buildApiChatFieldsFromPeerEntity(preview, isSupport),\n };\n}\n\nexport function getApiChatIdFromMtpPeer(peer: GramJs.TypePeer): number {\n if (isPeerUser(peer)) {\n return peer.userId;\n } else if (isPeerChat(peer)) {\n return -peer.chatId;\n } else {\n return -peer.channelId;\n }\n}\n\nexport function getApiChatIdFromInputMtpPeer(peer: GramJs.TypeInputPeer): number | undefined {\n if (isInputPeerUser(peer)) {\n return peer.userId;\n } else if (isInputPeerChat(peer)) {\n return -peer.chatId;\n } else if (isInputPeerChannel(peer)) {\n return -peer.channelId;\n }\n return undefined;\n}\n\nexport function getApiChatTypeFromPeerEntity(peerEntity: GramJs.TypeChat | GramJs.TypeUser) {\n if (peerEntity instanceof GramJs.User || peerEntity instanceof GramJs.UserEmpty) {\n return 'chatTypePrivate';\n } else if (\n peerEntity instanceof GramJs.Chat\n || peerEntity instanceof GramJs.ChatForbidden\n || peerEntity instanceof GramJs.ChatEmpty\n ) {\n return 'chatTypeBasicGroup';\n } else {\n return peerEntity.megagroup ? 'chatTypeSuperGroup' : 'chatTypeChannel';\n }\n}\n\nexport function getPeerKey(peer: GramJs.TypePeer) {\n if (isPeerUser(peer)) {\n return `user${peer.userId}`;\n } else if (isPeerChat(peer)) {\n return `chat${peer.chatId}`;\n } else {\n return `chat${peer.channelId}`;\n }\n}\n\nexport function getApiChatTitleFromMtpPeer(peer: GramJs.TypePeer, peerEntity: GramJs.User | GramJs.Chat) {\n if (isPeerUser(peer)) {\n return getUserName(peerEntity as GramJs.User);\n } else {\n return (peerEntity as GramJs.Chat).title;\n }\n}\n\nfunction getUserName(user: GramJs.User) {\n return user.firstName\n ? `${user.firstName}${user.lastName ? ` ${user.lastName}` : ''}`\n : (user.lastName || undefined);\n}\n\nexport function buildAvatarHash(photo: GramJs.TypeUserProfilePhoto | GramJs.TypeChatPhoto) {\n if ('photoId' in photo) {\n return photo.photoId.toString();\n }\n\n return undefined;\n}\n\nexport function buildChatMember(\n member: GramJs.TypeChatParticipant | GramJs.TypeChannelParticipant,\n): ApiChatMember | undefined {\n const userId = (member instanceof GramJs.ChannelParticipantBanned || member instanceof GramJs.ChannelParticipantLeft)\n ? getApiChatIdFromMtpPeer(member.peer)\n : member.userId;\n\n return {\n userId,\n inviterId: 'inviterId' in member ? member.inviterId : undefined,\n joinedDate: 'date' in member ? member.date : undefined,\n kickedByUserId: 'kickedBy' in member ? member.kickedBy : undefined,\n promotedByUserId: 'promotedBy' in member ? member.promotedBy : undefined,\n bannedRights: 'bannedRights' in member ? omitVirtualClassFields(member.bannedRights) : undefined,\n adminRights: 'adminRights' in member ? omitVirtualClassFields(member.adminRights) : undefined,\n customTitle: 'rank' in member ? member.rank : undefined,\n ...((member instanceof GramJs.ChannelParticipantAdmin || member instanceof GramJs.ChatParticipantAdmin) && {\n isAdmin: true,\n }),\n ...((member instanceof GramJs.ChannelParticipantCreator || member instanceof GramJs.ChatParticipantCreator) && {\n isOwner: true,\n }),\n };\n}\n\nexport function buildChatMembers(\n participants: GramJs.TypeChatParticipants | GramJs.channels.ChannelParticipants,\n) {\n // Duplicate code because of TS union-type shenanigans\n if (participants instanceof GramJs.ChatParticipants) {\n return participants.participants.map(buildChatMember).filter(Boolean as any);\n }\n if (participants instanceof GramJs.channels.ChannelParticipants) {\n return participants.participants.map(buildChatMember).filter(Boolean as any);\n }\n\n return undefined;\n}\n\nexport function buildChatTypingStatus(\n update: GramJs.UpdateUserTyping | GramJs.UpdateChatUserTyping | GramJs.UpdateChannelUserTyping,\n serverTimeOffset: number,\n) {\n let action: string = '';\n if (update.action instanceof GramJs.SendMessageCancelAction) {\n return undefined;\n } else if (update.action instanceof GramJs.SendMessageTypingAction) {\n action = 'lng_user_typing';\n } else if (update.action instanceof GramJs.SendMessageRecordVideoAction) {\n action = 'lng_send_action_record_video';\n } else if (update.action instanceof GramJs.SendMessageUploadVideoAction) {\n action = 'lng_send_action_upload_video';\n } else if (update.action instanceof GramJs.SendMessageRecordAudioAction) {\n action = 'lng_send_action_record_audio';\n } else if (update.action instanceof GramJs.SendMessageUploadAudioAction) {\n action = 'lng_send_action_upload_audio';\n } else if (update.action instanceof GramJs.SendMessageUploadPhotoAction) {\n action = 'lng_send_action_upload_photo';\n } else if (update.action instanceof GramJs.SendMessageUploadDocumentAction) {\n action = 'lng_send_action_upload_file';\n } else if (update.action instanceof GramJs.SendMessageGeoLocationAction) {\n action = 'selecting a location to share';\n } else if (update.action instanceof GramJs.SendMessageChooseContactAction) {\n action = 'selecting a contact to share';\n } else if (update.action instanceof GramJs.SendMessageGamePlayAction) {\n action = 'lng_playing_game';\n } else if (update.action instanceof GramJs.SendMessageRecordRoundAction) {\n action = 'lng_send_action_record_round';\n } else if (update.action instanceof GramJs.SendMessageUploadRoundAction) {\n action = 'lng_send_action_upload_round';\n }\n\n return {\n action,\n ...(!(update instanceof GramJs.UpdateUserTyping) && { userId: getApiChatIdFromMtpPeer(update.fromId) }),\n timestamp: Date.now() + serverTimeOffset * 1000,\n };\n}\n\nexport function buildApiChatFolder(filter: GramJs.DialogFilter): ApiChatFolder {\n return {\n ...pickTruthy(filter, [\n 'id', 'title', 'emoticon', 'contacts', 'nonContacts', 'groups', 'bots',\n 'excludeMuted', 'excludeRead', 'excludeArchived',\n ]),\n channels: filter.broadcasts,\n pinnedChatIds: filter.pinnedPeers.map(getApiChatIdFromInputMtpPeer).filter(Boolean as any),\n includedChatIds: filter.includePeers.map(getApiChatIdFromInputMtpPeer).filter(Boolean as any),\n excludedChatIds: filter.excludePeers.map(getApiChatIdFromInputMtpPeer).filter(Boolean as any),\n };\n}\n\nexport function buildApiChatFolderFromSuggested({\n filter, description,\n}: {\n filter: GramJs.DialogFilter;\n description: string;\n}): ApiChatFolder {\n return {\n ...buildApiChatFolder(filter),\n description,\n };\n}\n\nexport function buildApiChatBotCommands(botInfos: GramJs.BotInfo[]) {\n return botInfos.reduce((botCommands, botInfo) => {\n botCommands = botCommands.concat(botInfo.commands.map((mtpCommand) => ({\n botId: botInfo.userId,\n ...omitVirtualClassFields(mtpCommand),\n })));\n\n return botCommands;\n }, [] as ApiBotCommand[]);\n}\n","/* eslint-disable no-bitwise */\n\n// eslint-disable-next-line max-len\nconst TEMPLATE = '';\nconst LOOKUP = 'AACAAAAHAAALMAAAQASTAVAAAZaacaaaahaaalmaaaqastava.az0123456789-,';\n\nexport function pathBytesToSvg(bytes: Buffer, width: number, height: number) {\n return TEMPLATE\n .replace('{{path}}', buildPath(bytes))\n .replace('{{width}}', String(width))\n .replace('{{height}}', String(height));\n}\n\nfunction buildPath(bytes: Buffer) {\n let path = 'M';\n\n const len = bytes.length;\n for (let i = 0; i < len; i++) {\n const num = bytes[i];\n if (num >= 128 + 64) {\n path += LOOKUP[num - 128 - 64];\n } else {\n if (num >= 128) {\n path += ',';\n } else if (num >= 64) {\n path += '-';\n }\n path += String(num & 63);\n }\n }\n\n path += 'z';\n\n return path;\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\nimport { strippedPhotoToJpg } from '../../../lib/gramjs/Utils';\n\nimport {\n ApiPhoto, ApiPhotoSize, ApiThumbnail,\n} from '../../types';\nimport { bytesToDataUri } from './helpers';\nimport { pathBytesToSvg } from './pathBytesToSvg';\n\nconst DEFAULT_THUMB_SIZE = { w: 100, h: 100 };\n\nexport function buildApiThumbnailFromStripped(\n sizes?: GramJs.TypePhotoSize[], mimeType?: string,\n): ApiThumbnail | undefined {\n if (!sizes || !sizes.length) {\n return undefined;\n }\n\n const thumb = sizes.find((s: any): s is GramJs.PhotoStrippedSize => s instanceof GramJs.PhotoStrippedSize);\n if (!thumb) {\n return undefined;\n }\n\n const realSizes = sizes.filter((s): s is GramJs.PhotoSize => s instanceof GramJs.PhotoSize);\n const { w, h } = realSizes.length ? realSizes[realSizes.length - 1] : DEFAULT_THUMB_SIZE;\n const { bytes } = thumb;\n const dataUri = bytesToDataUri(\n !mimeType || mimeType === 'image/jpeg' ? strippedPhotoToJpg(bytes) : bytes,\n undefined,\n mimeType,\n );\n\n return {\n dataUri,\n width: w,\n height: h,\n };\n}\n\nexport function buildApiThumbnailFromCached(photoSize: GramJs.PhotoCachedSize): ApiThumbnail | undefined {\n const { w, h, bytes } = photoSize;\n const dataUri = bytesToDataUri(bytes, undefined, 'image/webp');\n\n return {\n dataUri,\n width: w,\n height: h,\n };\n}\n\nexport function buildApiThumbnailFromPath(\n photoSize: GramJs.PhotoPathSize,\n sizeAttribute: GramJs.DocumentAttributeImageSize,\n): ApiThumbnail | undefined {\n const { w, h } = sizeAttribute;\n const dataUri = `data:image/svg+xml;utf8,${pathBytesToSvg(photoSize.bytes, w, h)}`;\n\n return {\n dataUri,\n width: w,\n height: h,\n };\n}\n\nexport function buildApiPhoto(photo: GramJs.Photo): ApiPhoto {\n const sizes = photo.sizes\n .filter((s: any): s is GramJs.PhotoSize => {\n return s instanceof GramJs.PhotoSize || s instanceof GramJs.PhotoSizeProgressive;\n })\n .map(buildApiPhotoSize);\n\n return {\n id: String(photo.id),\n thumbnail: buildApiThumbnailFromStripped(photo.sizes),\n sizes,\n };\n}\n\nexport function buildApiPhotoSize(photoSize: GramJs.PhotoSize): ApiPhotoSize {\n const { w, h, type } = photoSize;\n\n return {\n width: w,\n height: h,\n type: type as ('m' | 'x' | 'y'),\n };\n}\n","import { Api as GramJs } from '../../lib/gramjs';\nimport { ApiMessage } from '../types';\n\ninterface LocalDb {\n localMessages: Record;\n // Used for loading avatars and media through in-memory Gram JS instances.\n chats: Record;\n users: Record;\n messages: Record;\n documents: Record;\n stickerSets: Record;\n photos: Record;\n webDocuments: Record;\n}\n\nexport default {\n localMessages: {},\n chats: {},\n users: {},\n messages: {},\n documents: {},\n stickerSets: {},\n photos: {},\n webDocuments: {},\n} as LocalDb;\n","import { Api as GramJs } from '../../../lib/gramjs';\nimport { ApiSticker, ApiStickerSet } from '../../types';\nimport { MEMOJI_STICKER_ID } from '../../../config';\n\nimport { buildApiThumbnailFromCached, buildApiThumbnailFromPath } from './common';\nimport localDb from '../localDb';\n\nconst ANIMATED_STICKER_MIME_TYPE = 'application/x-tgsticker';\n\nexport function buildStickerFromDocument(document: GramJs.TypeDocument): ApiSticker | undefined {\n if (document instanceof GramJs.DocumentEmpty) {\n return undefined;\n }\n\n const stickerAttribute = document.attributes\n .find((attr: any): attr is GramJs.DocumentAttributeSticker => (\n attr instanceof GramJs.DocumentAttributeSticker\n ));\n\n const fileAttribute = document.mimeType === ANIMATED_STICKER_MIME_TYPE && document.attributes\n .find((attr: any): attr is GramJs.DocumentAttributeFilename => (\n attr instanceof GramJs.DocumentAttributeFilename\n ));\n\n if (!stickerAttribute && !fileAttribute) {\n return undefined;\n }\n\n const sizeAttribute = document.attributes\n .find((attr: any): attr is GramJs.DocumentAttributeImageSize => (\n attr instanceof GramJs.DocumentAttributeImageSize\n ));\n\n const stickerSetInfo = stickerAttribute && stickerAttribute.stickerset instanceof GramJs.InputStickerSetID\n ? stickerAttribute.stickerset\n : undefined;\n const emoji = stickerAttribute?.alt;\n const isAnimated = document.mimeType === ANIMATED_STICKER_MIME_TYPE;\n const cachedThumb = document.thumbs && document.thumbs.find(\n (s): s is GramJs.PhotoCachedSize => s instanceof GramJs.PhotoCachedSize,\n );\n const pathThumb = document.thumbs && document.thumbs.find(\n (s): s is GramJs.PhotoPathSize => s instanceof GramJs.PhotoPathSize,\n );\n const thumbnail = cachedThumb ? (\n buildApiThumbnailFromCached(cachedThumb)\n ) : pathThumb && sizeAttribute ? (\n buildApiThumbnailFromPath(pathThumb, sizeAttribute)\n ) : undefined;\n\n const { w: width, h: height } = cachedThumb as GramJs.PhotoCachedSize || sizeAttribute || {};\n\n return {\n id: String(document.id),\n stickerSetId: stickerSetInfo ? String(stickerSetInfo.id) : MEMOJI_STICKER_ID,\n stickerSetAccessHash: stickerSetInfo && String(stickerSetInfo.accessHash),\n emoji,\n isAnimated,\n width,\n height,\n thumbnail,\n };\n}\n\nexport function buildStickerSet(set: GramJs.StickerSet): ApiStickerSet {\n const {\n archived,\n animated,\n installedDate,\n id,\n accessHash,\n title,\n thumbs,\n count,\n hash,\n shortName,\n } = set;\n\n return {\n archived,\n isAnimated: animated,\n installedDate,\n id: String(id),\n accessHash: String(accessHash),\n title,\n hasThumbnail: Boolean(thumbs?.length),\n count,\n hash,\n shortName,\n };\n}\n\nexport function buildStickerSetCovered(coveredStickerSet: GramJs.TypeStickerSetCovered): ApiStickerSet {\n const stickerSet = buildStickerSet(coveredStickerSet.set);\n\n const stickerSetCovers = (coveredStickerSet instanceof GramJs.StickerSetMultiCovered)\n ? coveredStickerSet.covers\n : [coveredStickerSet.cover];\n\n stickerSet.covers = [];\n stickerSetCovers.forEach((cover) => {\n if (cover instanceof GramJs.Document) {\n const coverSticker = buildStickerFromDocument(cover);\n if (coverSticker) {\n stickerSet.covers!.push(coverSticker);\n localDb.documents[String(cover.id)] = cover;\n }\n }\n });\n\n return stickerSet;\n}\n","/* eslint-disable no-bitwise */\n\n// eslint-disable-next-line max-len\n// Ref: https://github.com/telegramdesktop/tdesktop/blob/0743e71ab6b928d2ee5bae1aed991849b1e2b291/Telegram/SourceFiles/data/data_document.cpp#L1018\nexport function decodeWaveform(encoded5bit: Uint8Array) {\n const bitsCount = encoded5bit.length * 8;\n const valuesCount = Math.floor(bitsCount / 5);\n if (!valuesCount) {\n return [];\n }\n\n // Read each 5 bit of encoded5bit as 0-31 unsigned char.\n // We count the index of the byte in which the desired 5-bit sequence starts.\n // And then we read a uint16 starting from that byte to guarantee to get all of those 5 bits.\n //\n // BUT! if it is the last byte we have, we're not allowed to read a uint16 starting with it.\n // Because it will be an overflow (we'll access one byte after the available memory).\n // We see, that only the last 5 bits could start in the last available byte and be problematic.\n // So we read in a general way all the entries in a general way except the last one.\n const result = Array(valuesCount);\n const bitsData = encoded5bit;\n for (let i = 0, l = valuesCount - 1; i !== l; ++i) {\n const byteIndex = Math.floor((i * 5) / 8);\n const bitShift = Math.floor((i * 5) % 8);\n const value = bitsData[byteIndex] + (bitsData[byteIndex + 1] << 8);\n result[i] = ((value >> bitShift) & 0x1F);\n }\n const lastByteIndex = Math.floor(((valuesCount - 1) * 5) / 8);\n const lastBitShift = Math.floor(((valuesCount - 1) * 5) % 8);\n const lastValue = bitsData[lastByteIndex] + (bitsData[lastByteIndex + 1] << 8);\n result[valuesCount - 1] = (lastValue >> lastBitShift) & 0x1F;\n\n return result;\n}\n\nexport function interpolateArray(data: number[], fitCount: number) {\n let peak = 0;\n const newData = new Array(fitCount);\n const springFactor = data.length / fitCount;\n const leftFiller = data[0];\n const rightFiller = data[data.length - 1];\n for (let i = 0; i < fitCount; i++) {\n const idx = Math.floor(i * springFactor);\n const val = ((data[idx - 1] ?? leftFiller) + (data[idx] ?? leftFiller) + (data[idx + 1] ?? rightFiller)) / 3;\n newData[i] = val;\n if (peak < val) {\n peak = val;\n }\n }\n return { data: newData, peak };\n}\n","export interface ApiDimensions {\n width: number;\n height: number;\n}\n\nexport interface ApiPhotoSize extends ApiDimensions {\n type: 's' | 'm' | 'x' | 'y' | 'z';\n}\n\nexport interface ApiThumbnail extends ApiDimensions {\n dataUri: string;\n}\n\nexport interface ApiPhoto {\n id: string;\n thumbnail?: ApiThumbnail;\n sizes: ApiPhotoSize[];\n blobUrl?: string;\n}\n\nexport interface ApiSticker {\n id: string;\n stickerSetId: string;\n stickerSetAccessHash?: string;\n emoji?: string;\n isAnimated: boolean;\n width?: number;\n height?: number;\n thumbnail?: ApiThumbnail;\n isPreloadedGlobally?: boolean;\n}\n\nexport interface ApiStickerSet {\n archived?: true;\n isAnimated?: true;\n installedDate?: number;\n id: string;\n accessHash: string;\n title: string;\n hasThumbnail?: boolean;\n count: number;\n hash: number;\n stickers?: ApiSticker[];\n packs?: Record;\n covers?: ApiSticker[];\n shortName: string;\n}\n\nexport interface ApiVideo {\n id: string;\n mimeType: string;\n duration: number;\n fileName: string;\n width?: number;\n height?: number;\n supportsStreaming?: boolean;\n isRound?: boolean;\n isGif?: boolean;\n thumbnail?: ApiThumbnail;\n blobUrl?: string;\n size: number;\n}\n\nexport interface ApiAudio {\n size: number;\n mimeType: string;\n fileName: string;\n duration: number;\n performer?: string;\n title?: string;\n}\n\nexport interface ApiVoice {\n duration: number;\n waveform?: number[];\n}\n\nexport interface ApiDocument {\n id?: string;\n fileName: string;\n size: number;\n timestamp?: number;\n mimeType: string;\n thumbnail?: ApiThumbnail;\n previewBlobUrl?: string;\n mediaType?: 'photo' | 'video';\n mediaSize?: ApiDimensions;\n}\n\nexport interface ApiContact {\n firstName: string;\n lastName: string;\n phoneNumber: string;\n userId: number;\n}\n\nexport interface ApiPollAnswer {\n text: string;\n option: string;\n}\n\nexport interface ApiPollResult {\n isChosen?: true;\n isCorrect?: true;\n option: string;\n votersCount: number;\n}\n\nexport interface ApiPoll {\n id: string;\n summary: {\n closed?: true;\n isPublic?: true;\n multipleChoice?: true;\n quiz?: true;\n question: string;\n answers: ApiPollAnswer[];\n closePeriod?: number;\n closeDate?: number;\n };\n results: {\n results?: ApiPollResult[];\n totalVoters?: number;\n recentVoterIds?: number[];\n solution?: string;\n solutionEntities?: ApiMessageEntity[];\n };\n}\n\nexport interface ApiInvoice {\n text: string;\n title: string;\n photoUrl?: string;\n amount: number;\n currency: string;\n receiptMsgId?: number;\n isTest?: boolean;\n}\n\nexport type ApiNewPoll = {\n summary: ApiPoll['summary'];\n quiz?: {\n correctAnswers: string[];\n solution?: string;\n solutionEntities?: ApiMessageEntity[];\n };\n};\n\nexport interface ApiAction {\n text: string;\n targetUserIds?: number[];\n targetChatId?: number;\n type: 'historyClear' | 'contactSignUp' | 'chatCreate' | 'other';\n photo?: ApiPhoto;\n amount?: number;\n currency?: string;\n translationValues: string[];\n}\n\nexport interface ApiWebPage {\n id: number;\n url: string;\n displayUrl: string;\n type?: string;\n siteName?: string;\n title?: string;\n description?: string;\n photo?: ApiPhoto;\n duration?: number;\n document?: ApiDocument;\n video?: ApiVideo;\n}\n\nexport interface ApiMessageForwardInfo {\n isChannelPost: boolean;\n channelPostId?: number;\n isLinkedChannelPost?: boolean;\n fromChatId?: number;\n senderUserId?: number;\n fromMessageId?: number;\n hiddenUserName?: string;\n adminTitle?: string;\n}\n\nexport interface ApiMessageEntity {\n type: string;\n offset: number;\n length: number;\n userId?: number;\n url?: string;\n}\n\nexport enum ApiMessageEntityTypes {\n Bold = 'MessageEntityBold',\n Blockquote = 'MessageEntityBlockquote',\n BotCommand = 'MessageEntityBotCommand',\n Cashtag = 'MessageEntityCashtag',\n Code = 'MessageEntityCode',\n Email = 'MessageEntityEmail',\n Hashtag = 'MessageEntityHashtag',\n Italic = 'MessageEntityItalic',\n MentionName = 'MessageEntityMentionName',\n Mention = 'MessageEntityMention',\n Phone = 'MessageEntityPhone',\n Pre = 'MessageEntityPre',\n Strike = 'MessageEntityStrike',\n TextUrl = 'MessageEntityTextUrl',\n Url = 'MessageEntityUrl',\n Underline = 'MessageEntityUnderline',\n Unknown = 'MessageEntityUnknown',\n}\n\nexport interface ApiFormattedText {\n text: string;\n entities?: ApiMessageEntity[];\n}\n\nexport interface ApiMessage {\n id: number;\n chatId: number;\n content: {\n text?: ApiFormattedText;\n photo?: ApiPhoto;\n video?: ApiVideo;\n document?: ApiDocument;\n sticker?: ApiSticker;\n contact?: ApiContact;\n poll?: ApiPoll;\n action?: ApiAction;\n webPage?: ApiWebPage;\n audio?: ApiAudio;\n voice?: ApiVoice;\n invoice?: ApiInvoice;\n };\n date: number;\n isOutgoing: boolean;\n senderId?: number;\n replyToMessageId?: number;\n replyToTopMessageId?: number;\n sendingState?: 'messageSendingStatePending' | 'messageSendingStateFailed';\n forwardInfo?: ApiMessageForwardInfo;\n isDeleting?: boolean;\n previousLocalId?: number;\n views?: number;\n isEdited?: boolean;\n isMediaUnread?: boolean;\n groupedId?: string;\n isInAlbum?: boolean;\n hasUnreadMention?: boolean;\n inlineButtons?: ApiKeyboardButtons;\n keyboardButtons?: ApiKeyboardButtons;\n keyboardPlaceholder?: string;\n isKeyboardSingleUse?: boolean;\n viaBotId?: number;\n threadInfo?: ApiThreadInfo;\n adminTitle?: string;\n isScheduled?: boolean;\n shouldHideKeyboardButtons?: boolean;\n isFromScheduled?: boolean;\n}\n\nexport interface ApiThreadInfo {\n threadId: number;\n chatId: number;\n topMessageId?: number;\n originChannelId?: number;\n messagesCount: number;\n lastMessageId?: number;\n lastReadInboxMessageId?: number;\n recentReplierIds?: number[];\n}\n\nexport type ApiMessageOutgoingStatus = 'read' | 'succeeded' | 'pending' | 'failed';\n\nexport interface ApiKeyboardButton {\n type: 'command' | 'url' | 'callback' | 'requestPoll' | 'buy' | 'NOT_SUPPORTED';\n text: string;\n messageId: number;\n value?: string;\n}\n\nexport type ApiKeyboardButtons = ApiKeyboardButton[][];\nexport type ApiReplyKeyboard = {\n keyboardPlaceholder?: string;\n isKeyboardSingleUse?: boolean;\n} & {\n [K in 'inlineButtons' | 'keyboardButtons']?: ApiKeyboardButtons;\n};\n\nexport type ApiMessageSearchType = 'text' | 'media' | 'documents' | 'links' | 'audio' | 'profilePhoto';\nexport type ApiGlobalMessageSearchType = 'text' | 'media' | 'documents' | 'links' | 'audio' | 'voice';\n\nexport type ApiReportReason = 'spam' | 'violence' | 'pornography' | 'childAbuse'\n| 'copyright' | 'geoIrrelevant' | 'fake' | 'other';\n\nexport const MAIN_THREAD_ID = -1;\n\n// `Symbol` can not be transferred from worker\nexport const MESSAGE_DELETED = 'MESSAGE_DELETED';\n","// We cache avatars as Data URI for faster initial load\n// and messages media as Blob for smaller size.\n\nexport enum ApiMediaFormat {\n DataUri,\n BlobUrl,\n Lottie,\n Progressive,\n Stream,\n}\n\nexport type ApiParsedMedia = string | Blob | AnyLiteral | ArrayBuffer;\nexport type ApiPreparedMedia = string | AnyLiteral;\nexport type ApiMediaFormatToPrepared = T extends ApiMediaFormat.Lottie ? AnyLiteral : string;\n","import BigInt from 'big-integer';\nimport { Api as GramJs } from '../../../lib/gramjs';\n\nimport { ApiPrivacyKey } from '../../../types';\n\nimport { generateRandomBytes, readBigIntFromBuffer } from '../../../lib/gramjs/Helpers';\nimport {\n ApiSticker,\n ApiVideo,\n ApiNewPoll,\n ApiMessageEntity,\n ApiMessageEntityTypes,\n ApiChatFolder,\n ApiChatBannedRights,\n ApiChatAdminRights,\n ApiReportReason,\n} from '../../types';\nimport localDb from '../localDb';\nimport { pick } from '../../../util/iteratees';\n\nexport function getEntityTypeById(chatOrUserId: number) {\n if (chatOrUserId > 0) {\n return 'user';\n } else if (chatOrUserId <= -1000000000) {\n return 'channel';\n } else {\n return 'chat';\n }\n}\n\nexport function buildPeer(chatOrUserId: number): GramJs.TypePeer {\n if (chatOrUserId > 0) {\n return new GramJs.PeerUser({\n userId: chatOrUserId,\n });\n } else if (chatOrUserId <= -1000000000) {\n return new GramJs.PeerChannel({\n channelId: -chatOrUserId,\n });\n } else {\n return new GramJs.PeerChat({\n chatId: -chatOrUserId,\n });\n }\n}\n\nexport function buildInputPeer(chatOrUserId: number, accessHash?: string): GramJs.TypeInputPeer {\n if (chatOrUserId > 0 || chatOrUserId <= -1000000000) {\n return chatOrUserId > 0\n ? new GramJs.InputPeerUser({\n userId: chatOrUserId,\n accessHash: BigInt(accessHash!),\n })\n : new GramJs.InputPeerChannel({\n channelId: -chatOrUserId,\n accessHash: BigInt(accessHash!),\n });\n } else {\n return new GramJs.InputPeerChat({\n chatId: -chatOrUserId,\n });\n }\n}\n\nexport function buildInputPeerFromLocalDb(chatOrUserId: number): GramJs.TypeInputPeer | undefined {\n if (chatOrUserId > 0) {\n const { accessHash } = localDb.users[chatOrUserId] || {};\n\n return accessHash\n ? new GramJs.InputPeerUser({\n userId: chatOrUserId,\n accessHash,\n })\n : undefined;\n }\n\n if (chatOrUserId <= -1000000000) {\n const { accessHash } = (localDb.chats[-chatOrUserId] as GramJs.Channel) || {};\n\n return accessHash\n ? new GramJs.InputPeerChannel({\n channelId: -chatOrUserId,\n accessHash,\n })\n : undefined;\n }\n\n return new GramJs.InputPeerChat({\n chatId: -chatOrUserId,\n });\n}\n\nexport function buildInputEntity(chatOrUserId: number, accessHash?: string) {\n if (chatOrUserId > 0) {\n return new GramJs.InputUser({\n userId: chatOrUserId,\n accessHash: BigInt(accessHash!),\n });\n } else if (chatOrUserId <= -1000000000) {\n return new GramJs.InputChannel({\n channelId: -chatOrUserId,\n accessHash: BigInt(accessHash!),\n });\n } else {\n return -chatOrUserId;\n }\n}\n\nexport function buildInputStickerSet(id: string, accessHash: string) {\n return new GramJs.InputStickerSetID({\n id: BigInt(id),\n accessHash: BigInt(accessHash),\n });\n}\n\nexport function buildInputStickerSetShortName(shortName: string) {\n return new GramJs.InputStickerSetShortName({\n shortName,\n });\n}\n\nexport function buildInputDocument(media: ApiSticker | ApiVideo) {\n const document = localDb.documents[media.id];\n\n if (!document) {\n return undefined;\n }\n\n return new GramJs.InputDocument(pick(document, [\n 'id',\n 'accessHash',\n 'fileReference',\n ]));\n}\n\nexport function buildInputMediaDocument(media: ApiSticker | ApiVideo) {\n const inputDocument = buildInputDocument(media);\n\n if (!inputDocument) {\n return undefined;\n }\n\n return new GramJs.InputMediaDocument({ id: inputDocument });\n}\n\nexport function buildInputPoll(pollParams: ApiNewPoll, randomId: BigInt.BigInteger) {\n const { summary, quiz } = pollParams;\n\n const poll = new GramJs.Poll({\n id: randomId,\n publicVoters: summary.isPublic,\n question: summary.question,\n answers: summary.answers.map(({ text, option }) => new GramJs.PollAnswer({ text, option: Buffer.from(option) })),\n quiz: summary.quiz,\n multipleChoice: summary.multipleChoice,\n });\n\n if (!quiz) {\n return new GramJs.InputMediaPoll({ poll });\n }\n\n const correctAnswers = quiz.correctAnswers.map((key) => Buffer.from(key));\n const { solution } = quiz;\n const solutionEntities = quiz.solutionEntities ? quiz.solutionEntities.map(buildMtpMessageEntity) : [];\n\n return new GramJs.InputMediaPoll({\n poll,\n correctAnswers,\n ...(solution && {\n solution,\n solutionEntities,\n }),\n });\n}\n\nexport function buildFilterFromApiFolder(folder: ApiChatFolder): GramJs.DialogFilter {\n const {\n emoticon,\n contacts,\n nonContacts,\n groups,\n channels,\n bots,\n excludeArchived,\n excludeMuted,\n excludeRead,\n pinnedChatIds,\n includedChatIds,\n excludedChatIds,\n } = folder;\n\n const pinnedPeers = pinnedChatIds\n ? pinnedChatIds.map(buildInputPeerFromLocalDb).filter(Boolean as any)\n : [];\n\n const includePeers = includedChatIds\n ? includedChatIds.map(buildInputPeerFromLocalDb).filter(Boolean as any)\n : [];\n\n const excludePeers = excludedChatIds\n ? excludedChatIds.map(buildInputPeerFromLocalDb).filter(Boolean as any)\n : [];\n\n return new GramJs.DialogFilter({\n id: folder.id,\n title: folder.title,\n emoticon: emoticon || undefined,\n contacts: contacts || undefined,\n nonContacts: nonContacts || undefined,\n groups: groups || undefined,\n bots: bots || undefined,\n excludeArchived: excludeArchived || undefined,\n excludeMuted: excludeMuted || undefined,\n excludeRead: excludeRead || undefined,\n broadcasts: channels || undefined,\n pinnedPeers,\n includePeers,\n excludePeers,\n });\n}\n\nexport function generateRandomBigInt() {\n return readBigIntFromBuffer(generateRandomBytes(8), true, true);\n}\n\nexport function buildMessageFromUpdate(\n id: number,\n chatId: number,\n update: GramJs.UpdateShortSentMessage | GramJs.UpdateServiceNotification,\n) {\n // This is not a proper message, but we only need these fields for downloading media through `localDb`.\n return new GramJs.Message({\n id,\n peerId: buildPeer(chatId),\n fromId: buildPeer(chatId),\n media: update.media,\n } as GramJs.Message);\n}\n\nexport function buildMtpMessageEntity(entity: ApiMessageEntity): GramJs.TypeMessageEntity {\n const {\n type, offset, length, url, userId,\n } = entity;\n\n const user = userId ? localDb.users[userId] : undefined;\n\n switch (type) {\n case ApiMessageEntityTypes.Bold:\n return new GramJs.MessageEntityBold({ offset, length });\n case ApiMessageEntityTypes.Italic:\n return new GramJs.MessageEntityItalic({ offset, length });\n case ApiMessageEntityTypes.Underline:\n return new GramJs.MessageEntityUnderline({ offset, length });\n case ApiMessageEntityTypes.Strike:\n return new GramJs.MessageEntityStrike({ offset, length });\n case ApiMessageEntityTypes.Code:\n return new GramJs.MessageEntityCode({ offset, length });\n case ApiMessageEntityTypes.Pre:\n return new GramJs.MessageEntityPre({ offset, length, language: '' });\n case ApiMessageEntityTypes.Blockquote:\n return new GramJs.MessageEntityBlockquote({ offset, length });\n case ApiMessageEntityTypes.TextUrl:\n return new GramJs.MessageEntityTextUrl({ offset, length, url: url! });\n case ApiMessageEntityTypes.Url:\n return new GramJs.MessageEntityUrl({ offset, length });\n case ApiMessageEntityTypes.Hashtag:\n return new GramJs.MessageEntityHashtag({ offset, length });\n case ApiMessageEntityTypes.MentionName:\n return new GramJs.InputMessageEntityMentionName({\n offset,\n length,\n userId: new GramJs.InputUser({ userId: userId!, accessHash: user!.accessHash! }),\n });\n default:\n return new GramJs.MessageEntityUnknown({ offset, length });\n }\n}\n\n// TODO: This formula is taken from API docs, but doesn't seem to calculate hash correctly\nexport function calculateResultHash(ids: number[]) {\n let hash = 0;\n ids.forEach((id) => {\n // eslint-disable-next-line no-bitwise\n hash = (((hash * 0x4F25) & 0x7FFFFFFF) + id) & 0x7FFFFFFF;\n });\n\n return hash;\n}\n\nexport function isMessageWithMedia(message: GramJs.Message | GramJs.UpdateServiceNotification) {\n const { media } = message;\n if (!media) {\n return false;\n }\n\n return (\n media instanceof GramJs.MessageMediaPhoto\n || media instanceof GramJs.MessageMediaDocument\n || (\n media instanceof GramJs.MessageMediaWebPage\n && media.webpage instanceof GramJs.WebPage\n && (\n media.webpage.photo instanceof GramJs.Photo || (\n media.webpage.document instanceof GramJs.Document\n && media.webpage.document.mimeType.startsWith('video')\n )\n )\n )\n );\n}\n\nexport function isServiceMessageWithMedia(message: GramJs.MessageService) {\n return 'photo' in message.action && message.action.photo instanceof GramJs.Photo;\n}\n\nexport function buildChatPhotoForLocalDb(photo: GramJs.TypePhoto) {\n if (photo instanceof GramJs.PhotoEmpty) {\n return new GramJs.ChatPhotoEmpty();\n }\n\n const { dcId, id: photoId } = photo;\n\n return new GramJs.ChatPhoto({\n dcId,\n photoId,\n });\n}\n\nexport function buildInputContact({\n phone,\n firstName,\n lastName,\n}: {\n phone: string;\n firstName: string;\n lastName: string;\n}) {\n return new GramJs.InputPhoneContact({\n clientId: BigInt(1),\n phone,\n firstName,\n lastName,\n });\n}\n\nexport function buildChatBannedRights(\n bannedRights: ApiChatBannedRights,\n untilDate = 0,\n) {\n return new GramJs.ChatBannedRights({\n ...bannedRights,\n untilDate,\n });\n}\n\nexport function buildChatAdminRights(\n adminRights: ApiChatAdminRights,\n) {\n return new GramJs.ChatAdminRights(adminRights);\n}\n\nexport function buildShippingInfo(info: GramJs.PaymentRequestedInfo) {\n const { shippingAddress } = info;\n return new GramJs.PaymentRequestedInfo({\n ...info,\n shippingAddress: shippingAddress\n ? new GramJs.PostAddress(shippingAddress)\n : undefined,\n });\n}\n\nexport function buildInputPrivacyKey(privacyKey: ApiPrivacyKey) {\n switch (privacyKey) {\n case 'phoneNumber':\n return new GramJs.InputPrivacyKeyPhoneNumber();\n\n case 'lastSeen':\n return new GramJs.InputPrivacyKeyStatusTimestamp();\n\n case 'profilePhoto':\n return new GramJs.InputPrivacyKeyProfilePhoto();\n\n case 'forwards':\n return new GramJs.InputPrivacyKeyForwards();\n\n case 'chatInvite':\n return new GramJs.InputPrivacyKeyChatInvite();\n }\n\n return undefined;\n}\n\nexport function buildInputReportReason(reason: ApiReportReason) {\n switch (reason) {\n case 'spam':\n return new GramJs.InputReportReasonSpam();\n case 'violence':\n return new GramJs.InputReportReasonViolence();\n case 'childAbuse':\n return new GramJs.InputReportReasonChildAbuse();\n case 'pornography':\n return new GramJs.InputReportReasonPornography();\n case 'copyright':\n return new GramJs.InputReportReasonCopyright();\n case 'fake':\n return new GramJs.InputReportReasonFake();\n case 'geoIrrelevant':\n return new GramJs.InputReportReasonGeoIrrelevant();\n case 'other':\n return new GramJs.InputReportReasonOther();\n }\n\n return undefined;\n}\n","import { Api as GramJs } from '../../lib/gramjs';\nimport localDb from './localDb';\nimport { getApiChatIdFromMtpPeer } from './apiBuilders/chats';\n\nexport function resolveMessageApiChatId(mtpMessage: GramJs.TypeMessage) {\n if (!(mtpMessage instanceof GramJs.Message || mtpMessage instanceof GramJs.MessageService)) {\n return undefined;\n }\n\n return getApiChatIdFromMtpPeer(mtpMessage.peerId);\n}\n\nexport function addMessageToLocalDb(message: GramJs.Message | GramJs.MessageService) {\n const messageFullId = `${resolveMessageApiChatId(message)}-${message.id}`;\n localDb.messages[messageFullId] = message;\n\n if (\n message instanceof GramJs.Message\n && message.media instanceof GramJs.MessageMediaDocument\n && message.media.document instanceof GramJs.Document\n ) {\n localDb.documents[String(message.media.document.id)] = message.media.document;\n }\n\n if (\n message instanceof GramJs.Message\n && message.media instanceof GramJs.MessageMediaWebPage\n && message.media.webpage instanceof GramJs.WebPage\n && message.media.webpage.document instanceof GramJs.Document\n ) {\n localDb.documents[String(message.media.webpage.document.id)] = message.media.webpage.document;\n }\n\n if (message instanceof GramJs.MessageService && 'photo' in message.action) {\n addPhotoToLocalDb(message.action.photo);\n }\n}\n\nexport function addPhotoToLocalDb(photo: GramJs.TypePhoto) {\n if (photo instanceof GramJs.Photo) {\n localDb.photos[String(photo.id)] = photo;\n }\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\nimport {\n ApiMessage,\n ApiMessageForwardInfo,\n ApiPhoto,\n ApiSticker,\n ApiVideo,\n ApiVoice,\n ApiAudio,\n ApiDocument,\n ApiAction,\n ApiContact,\n ApiAttachment,\n ApiPoll,\n ApiNewPoll,\n ApiWebPage,\n ApiMessageEntity,\n ApiFormattedText,\n ApiReplyKeyboard,\n ApiKeyboardButton,\n ApiChat,\n ApiThreadInfo,\n ApiInvoice,\n} from '../../types';\n\nimport { DELETED_COMMENTS_CHANNEL_ID, LOCAL_MESSAGE_ID_BASE, SERVICE_NOTIFICATIONS_USER_ID } from '../../../config';\nimport { pick } from '../../../util/iteratees';\nimport { getApiChatIdFromMtpPeer } from './chats';\nimport { buildStickerFromDocument } from './symbols';\nimport { buildApiPhoto, buildApiThumbnailFromStripped } from './common';\nimport { interpolateArray } from '../../../util/waveform';\nimport { buildPeer } from '../gramjsBuilders';\nimport { addPhotoToLocalDb, resolveMessageApiChatId } from '../helpers';\n\nconst LOCAL_IMAGE_UPLOADING_TEMP_ID = 'temp';\nconst LOCAL_VIDEO_UPLOADING_TEMP_ID = 'temp';\nconst INPUT_WAVEFORM_LENGTH = 63;\n\nlet localMessageCounter = LOCAL_MESSAGE_ID_BASE;\nlet currentUserId!: number;\n\nexport function setMessageBuilderCurrentUserId(_currentUserId: number) {\n currentUserId = _currentUserId;\n}\n\nexport function buildApiMessage(mtpMessage: GramJs.TypeMessage): ApiMessage | undefined {\n const chatId = resolveMessageApiChatId(mtpMessage);\n if (\n !chatId\n || !(mtpMessage instanceof GramJs.Message || mtpMessage instanceof GramJs.MessageService)) {\n return undefined;\n }\n\n return buildApiMessageWithChatId(chatId, mtpMessage);\n}\n\nexport function buildApiMessageFromShort(mtpMessage: GramJs.UpdateShortMessage): ApiMessage {\n const chatId = getApiChatIdFromMtpPeer({ userId: mtpMessage.userId } as GramJs.TypePeer);\n\n return buildApiMessageWithChatId(chatId, {\n ...mtpMessage,\n fromId: buildPeer(mtpMessage.out ? currentUserId : mtpMessage.userId),\n });\n}\n\nexport function buildApiMessageFromShortChat(mtpMessage: GramJs.UpdateShortChatMessage): ApiMessage {\n const chatId = getApiChatIdFromMtpPeer({ chatId: mtpMessage.chatId } as GramJs.TypePeer);\n\n return buildApiMessageWithChatId(chatId, {\n ...mtpMessage,\n fromId: buildPeer(mtpMessage.fromId),\n });\n}\n\nexport function buildApiMessageFromNotification(\n notification: GramJs.UpdateServiceNotification,\n currentDate: number,\n): ApiMessage {\n const localId = localMessageCounter++;\n let content: ApiMessage['content'] = {};\n\n if (notification.media) {\n content = {\n ...buildMessageMediaContent(notification.media),\n };\n }\n\n if (notification.message && !content.sticker && !content.poll && !content.contact) {\n content = {\n ...content,\n text: buildMessageTextContent(notification.message, notification.entities),\n };\n }\n\n return {\n id: localId,\n chatId: SERVICE_NOTIFICATIONS_USER_ID,\n date: notification.inboxDate || currentDate,\n content,\n isOutgoing: false,\n };\n}\n\ntype UniversalMessage = (\n Pick\n & Pick, (\n 'out' | 'message' | 'entities' | 'fromId' | 'peerId' | 'fwdFrom' | 'replyTo' | 'replyMarkup' | 'post' |\n 'media' | 'action' | 'views' | 'editDate' | 'editHide' | 'mediaUnread' | 'groupedId' | 'mentioned' | 'viaBotId' |\n 'replies' | 'fromScheduled' | 'postAuthor'\n )>\n);\n\nexport function buildApiMessageWithChatId(chatId: number, mtpMessage: UniversalMessage): ApiMessage {\n const fromId = mtpMessage.fromId ? getApiChatIdFromMtpPeer(mtpMessage.fromId) : undefined;\n const peerId = mtpMessage.peerId ? getApiChatIdFromMtpPeer(mtpMessage.peerId) : undefined;\n const isChatWithSelf = !fromId && chatId === currentUserId;\n const isOutgoing = (mtpMessage.out && !mtpMessage.post) || (isChatWithSelf && !mtpMessage.fwdFrom);\n\n let content: ApiMessage['content'] = {};\n\n if (mtpMessage.media) {\n content = {\n ...buildMessageMediaContent(mtpMessage.media),\n };\n }\n\n if (mtpMessage.message && !content.sticker && !content.poll && !content.contact) {\n content = {\n ...content,\n text: buildMessageTextContent(mtpMessage.message, mtpMessage.entities),\n };\n }\n\n const action = mtpMessage.action\n && buildAction(mtpMessage.action, fromId, peerId, Boolean(mtpMessage.post), isOutgoing);\n if (action) {\n content.action = action;\n }\n\n const { replyToMsgId, replyToTopId } = mtpMessage.replyTo || {};\n const isEdited = mtpMessage.editDate && !mtpMessage.editHide;\n const {\n inlineButtons, keyboardButtons, keyboardPlaceholder, isKeyboardSingleUse,\n } = buildReplyButtons(mtpMessage) || {};\n const forwardInfo = mtpMessage.fwdFrom && buildApiMessageForwardInfo(mtpMessage.fwdFrom, isChatWithSelf);\n const { replies, mediaUnread: isMediaUnread, postAuthor } = mtpMessage;\n const groupedId = mtpMessage.groupedId && mtpMessage.groupedId.toString();\n const isInAlbum = Boolean(groupedId) && !(content.document || content.audio);\n const shouldHideKeyboardButtons = mtpMessage.replyMarkup instanceof GramJs.ReplyKeyboardHide;\n\n return {\n id: mtpMessage.id,\n chatId,\n isOutgoing,\n content,\n date: mtpMessage.date,\n senderId: fromId || (mtpMessage.out && mtpMessage.post && currentUserId) || chatId,\n views: mtpMessage.views,\n isFromScheduled: mtpMessage.fromScheduled,\n ...(replyToMsgId && { replyToMessageId: replyToMsgId }),\n ...(replyToTopId && { replyToTopMessageId: replyToTopId }),\n ...(forwardInfo && { forwardInfo }),\n ...(isEdited && { isEdited }),\n ...(isMediaUnread && { isMediaUnread }),\n ...(mtpMessage.mentioned && isMediaUnread && { hasUnreadMention: true }),\n ...(groupedId && {\n groupedId,\n isInAlbum,\n }),\n inlineButtons,\n ...(keyboardButtons && { keyboardButtons, keyboardPlaceholder, isKeyboardSingleUse }),\n ...(shouldHideKeyboardButtons && { shouldHideKeyboardButtons }),\n ...(mtpMessage.viaBotId && { viaBotId: mtpMessage.viaBotId }),\n ...(replies?.comments && { threadInfo: buildThreadInfo(replies, mtpMessage.id, chatId) }),\n ...(postAuthor && { adminTitle: postAuthor }),\n };\n}\n\nexport function buildMessageTextContent(\n message: string,\n entities?: GramJs.TypeMessageEntity[],\n): ApiFormattedText {\n return {\n text: message,\n ...(entities && { entities: entities.map(buildApiMessageEntity) }),\n };\n}\n\nexport function buildMessageDraft(draft: GramJs.TypeDraftMessage) {\n if (draft instanceof GramJs.DraftMessageEmpty) {\n return undefined;\n }\n\n const {\n message, entities, replyToMsgId, date,\n } = draft;\n\n return {\n formattedText: message ? buildMessageTextContent(message, entities) : undefined,\n replyingToId: replyToMsgId,\n date,\n };\n}\n\nexport function buildMessageMediaContent(media: GramJs.TypeMessageMedia): ApiMessage['content'] | undefined {\n const sticker = buildSticker(media);\n if (sticker) return { sticker };\n\n const photo = buildPhoto(media);\n if (photo) return { photo };\n\n const video = buildVideo(media);\n if (video) return { video };\n\n const audio = buildAudio(media);\n if (audio) return { audio };\n\n const voice = buildVoice(media);\n if (voice) return { voice };\n\n const document = buildDocumentFromMedia(media);\n if (document) return { document };\n\n const contact = buildContact(media);\n if (contact) return { contact };\n\n const poll = buildPollFromMedia(media);\n if (poll) return { poll };\n\n const webPage = buildWebPage(media);\n if (webPage) return { webPage };\n\n const invoice = buildInvoiceFromMedia(media);\n if (invoice) return { invoice };\n\n return undefined;\n}\n\nfunction buildApiMessageForwardInfo(fwdFrom: GramJs.MessageFwdHeader, isChatWithSelf = false): ApiMessageForwardInfo {\n const savedFromPeerId = fwdFrom.savedFromPeer && getApiChatIdFromMtpPeer(fwdFrom.savedFromPeer);\n const fromId = fwdFrom.fromId && getApiChatIdFromMtpPeer(fwdFrom.fromId);\n\n return {\n isChannelPost: Boolean(fwdFrom.channelPost),\n channelPostId: fwdFrom.channelPost,\n isLinkedChannelPost: Boolean(fwdFrom.channelPost && savedFromPeerId && !isChatWithSelf),\n fromChatId: savedFromPeerId || fromId,\n fromMessageId: fwdFrom.channelPost || fwdFrom.savedFromMsgId,\n senderUserId: fromId,\n hiddenUserName: fwdFrom.fromName,\n adminTitle: fwdFrom.postAuthor,\n };\n}\n\nfunction buildSticker(media: GramJs.TypeMessageMedia): ApiSticker | undefined {\n if (\n !(media instanceof GramJs.MessageMediaDocument)\n || !media.document\n || !(media.document instanceof GramJs.Document)\n ) {\n return undefined;\n }\n\n return buildStickerFromDocument(media.document);\n}\n\nfunction buildPhoto(media: GramJs.TypeMessageMedia): ApiPhoto | undefined {\n if (!(media instanceof GramJs.MessageMediaPhoto) || !media.photo || !(media.photo instanceof GramJs.Photo)) {\n return undefined;\n }\n\n if (media.ttlSeconds) {\n return undefined;\n }\n\n return buildApiPhoto(media.photo);\n}\n\nexport function buildVideoFromDocument(document: GramJs.Document): ApiVideo | undefined {\n if (document instanceof GramJs.DocumentEmpty) {\n return undefined;\n }\n\n const {\n id, mimeType, thumbs, size, attributes,\n } = document;\n\n const videoAttr = attributes\n .find((a: any): a is GramJs.DocumentAttributeVideo => a instanceof GramJs.DocumentAttributeVideo);\n\n if (!videoAttr) {\n return undefined;\n }\n\n const gifAttr = attributes\n .find((a: any): a is GramJs.DocumentAttributeAnimated => a instanceof GramJs.DocumentAttributeAnimated);\n\n const {\n duration,\n w: width,\n h: height,\n supportsStreaming = false,\n roundMessage: isRound = false,\n } = videoAttr;\n\n return {\n id: String(id),\n mimeType,\n duration,\n fileName: getFilenameFromDocument(document, 'video'),\n width,\n height,\n supportsStreaming,\n isRound,\n isGif: Boolean(gifAttr),\n thumbnail: buildApiThumbnailFromStripped(thumbs),\n size,\n };\n}\n\nfunction buildVideo(media: GramJs.TypeMessageMedia): ApiVideo | undefined {\n if (\n !(media instanceof GramJs.MessageMediaDocument)\n || !(media.document instanceof GramJs.Document)\n || !media.document.mimeType.startsWith('video')\n ) {\n return undefined;\n }\n\n return buildVideoFromDocument(media.document);\n}\n\nfunction buildAudio(media: GramJs.TypeMessageMedia): ApiAudio | undefined {\n if (\n !(media instanceof GramJs.MessageMediaDocument)\n || !media.document\n || !(media.document instanceof GramJs.Document)\n ) {\n return undefined;\n }\n\n const audioAttribute = media.document.attributes\n .find((attr: any): attr is GramJs.DocumentAttributeAudio => (\n attr instanceof GramJs.DocumentAttributeAudio\n ));\n\n if (!audioAttribute || audioAttribute.voice) {\n return undefined;\n }\n\n return {\n fileName: getFilenameFromDocument(media.document, 'audio'),\n ...pick(media.document, ['size', 'mimeType']),\n ...pick(audioAttribute, ['duration', 'performer', 'title']),\n };\n}\n\nfunction buildVoice(media: GramJs.TypeMessageMedia): ApiVoice | undefined {\n if (\n !(media instanceof GramJs.MessageMediaDocument)\n || !media.document\n || !(media.document instanceof GramJs.Document)\n ) {\n return undefined;\n }\n\n const audioAttribute = media.document.attributes\n .find((attr: any): attr is GramJs.DocumentAttributeAudio => (\n attr instanceof GramJs.DocumentAttributeAudio\n ));\n\n if (!audioAttribute || !audioAttribute.voice) {\n return undefined;\n }\n\n const { duration, waveform } = audioAttribute;\n\n return {\n duration,\n waveform: waveform ? Array.from(waveform) : undefined,\n };\n}\n\nfunction buildDocumentFromMedia(media: GramJs.TypeMessageMedia) {\n if (!(media instanceof GramJs.MessageMediaDocument) || !media.document) {\n return undefined;\n }\n\n if (media.ttlSeconds) {\n return undefined;\n }\n\n return buildApiDocument(media.document);\n}\n\nexport function buildApiDocument(document: GramJs.TypeDocument): ApiDocument | undefined {\n if (!(document instanceof GramJs.Document)) {\n return undefined;\n }\n\n const {\n id, size, mimeType, date, thumbs, attributes,\n } = document;\n\n const thumbnail = thumbs && buildApiThumbnailFromStripped(thumbs);\n\n let mediaType: ApiDocument['mediaType'] | undefined;\n let mediaSize: ApiDocument['mediaSize'] | undefined;\n const photoSize = thumbs && thumbs.find((s: any): s is GramJs.PhotoSize => s instanceof GramJs.PhotoSize);\n if (photoSize) {\n mediaSize = {\n width: photoSize.w,\n height: photoSize.h,\n };\n\n if (mimeType.startsWith('image/')) {\n mediaType = 'photo';\n\n const imageAttribute = attributes\n .find((a: any): a is GramJs.DocumentAttributeImageSize => a instanceof GramJs.DocumentAttributeImageSize);\n\n if (imageAttribute) {\n const { w: width, h: height } = imageAttribute;\n mediaSize = {\n width,\n height,\n };\n }\n } else if (mimeType.startsWith('video/')) {\n mediaType = 'video';\n }\n }\n\n return {\n id: String(id),\n size,\n mimeType,\n timestamp: date,\n fileName: getFilenameFromDocument(document),\n thumbnail,\n mediaType,\n mediaSize,\n };\n}\n\nfunction buildContact(media: GramJs.TypeMessageMedia): ApiContact | undefined {\n if (!(media instanceof GramJs.MessageMediaContact)) {\n return undefined;\n }\n\n return pick(media, [\n 'firstName',\n 'lastName',\n 'phoneNumber',\n 'userId',\n ]);\n}\n\nfunction buildPollFromMedia(media: GramJs.TypeMessageMedia): ApiPoll | undefined {\n if (!(media instanceof GramJs.MessageMediaPoll)) {\n return undefined;\n }\n\n return buildPoll(media.poll, media.results);\n}\n\nfunction buildInvoiceFromMedia(media: GramJs.TypeMessageMedia): ApiInvoice | undefined {\n if (!(media instanceof GramJs.MessageMediaInvoice)) {\n return undefined;\n }\n\n return buildInvoice(media);\n}\n\nexport function buildPoll(poll: GramJs.Poll, pollResults: GramJs.PollResults): ApiPoll {\n const { id, answers: rawAnswers } = poll;\n const answers = rawAnswers.map((answer) => ({\n text: answer.text,\n option: String.fromCharCode(...answer.option),\n }));\n\n return {\n id: id.toString(),\n summary: {\n isPublic: poll.publicVoters,\n ...pick(poll, [\n 'closed',\n 'multipleChoice',\n 'quiz',\n 'question',\n 'closePeriod',\n 'closeDate',\n ]),\n answers,\n },\n results: buildPollResults(pollResults),\n };\n}\n\nexport function buildInvoice(media: GramJs.MessageMediaInvoice): ApiInvoice {\n const {\n description: text, title, photo, test, totalAmount, currency, receiptMsgId,\n } = media;\n\n return {\n text,\n title,\n photoUrl: photo?.url,\n receiptMsgId,\n amount: Number(totalAmount),\n currency,\n isTest: test,\n };\n}\n\nexport function buildPollResults(pollResults: GramJs.PollResults): ApiPoll['results'] {\n const {\n results: rawResults, totalVoters, recentVoters, solution, solutionEntities: entities,\n } = pollResults;\n const results = rawResults && rawResults.map(({\n option, chosen, correct, voters,\n }) => ({\n isChosen: chosen,\n isCorrect: correct,\n option: String.fromCharCode(...option),\n votersCount: voters,\n }));\n\n return {\n totalVoters,\n recentVoterIds: recentVoters,\n results,\n solution,\n ...(entities && { solutionEntities: entities.map(buildApiMessageEntity) }),\n };\n}\n\nexport function buildWebPage(media: GramJs.TypeMessageMedia): ApiWebPage | undefined {\n if (\n !(media instanceof GramJs.MessageMediaWebPage)\n || !(media.webpage instanceof GramJs.WebPage)\n ) {\n return undefined;\n }\n\n const { id, photo, document } = media.webpage;\n\n let video;\n if (document instanceof GramJs.Document && document.mimeType.startsWith('video/')) {\n video = buildVideoFromDocument(document);\n }\n\n return {\n id: Number(id),\n ...pick(media.webpage, [\n 'url',\n 'displayUrl',\n 'type',\n 'siteName',\n 'title',\n 'description',\n 'duration',\n ]),\n photo: photo instanceof GramJs.Photo ? buildApiPhoto(photo) : undefined,\n document: !video && document ? buildApiDocument(document) : undefined,\n video,\n };\n}\n\nfunction buildAction(\n action: GramJs.TypeMessageAction,\n senderId: number | undefined,\n targetPeerId: number | undefined,\n isChannelPost: boolean,\n isOutgoing: boolean,\n): ApiAction | undefined {\n if (action instanceof GramJs.MessageActionEmpty) {\n return undefined;\n }\n\n let amount: number | undefined;\n let currency: string | undefined;\n let text: string;\n const translationValues = [];\n let type: ApiAction['type'] = 'other';\n let photo: ApiPhoto | undefined;\n\n const targetUserIds = 'users' in action\n ? action.users && action.users\n : ('userId' in action && [action.userId]) || [];\n let targetChatId: number | undefined;\n\n if (action instanceof GramJs.MessageActionChatCreate) {\n text = 'Notification.CreatedChatWithTitle';\n translationValues.push('%action_origin%', action.title);\n type = 'chatCreate';\n } else if (action instanceof GramJs.MessageActionChatEditTitle) {\n if (isChannelPost) {\n text = 'Channel.MessageTitleUpdated';\n translationValues.push(action.title);\n } else {\n text = 'Notification.ChangedGroupName';\n translationValues.push('%action_origin%', action.title);\n }\n } else if (action instanceof GramJs.MessageActionChatEditPhoto) {\n if (isChannelPost) {\n text = 'Channel.MessagePhotoUpdated';\n } else {\n text = 'Notification.ChangedGroupPhoto';\n translationValues.push('%action_origin%');\n }\n } else if (action instanceof GramJs.MessageActionChatDeletePhoto) {\n if (isChannelPost) {\n text = 'Channel.MessagePhotoRemoved';\n } else {\n text = 'Group.MessagePhotoRemoved';\n }\n } else if (action instanceof GramJs.MessageActionChatAddUser) {\n if (!senderId || targetUserIds.includes(senderId)) {\n text = 'Notification.JoinedChat';\n translationValues.push('%target_user%');\n } else {\n text = 'Notification.Invited';\n translationValues.push('%action_origin%', '%target_user%');\n }\n } else if (action instanceof GramJs.MessageActionChatDeleteUser) {\n if (!senderId || targetUserIds.includes(senderId)) {\n text = 'Notification.LeftChat';\n translationValues.push('%target_user%');\n } else {\n text = 'Notification.Kicked';\n translationValues.push('%action_origin%', '%target_user%');\n }\n } else if (action instanceof GramJs.MessageActionChatJoinedByLink) {\n text = 'Notification.JoinedGroupByLink';\n translationValues.push('%action_origin%');\n } else if (action instanceof GramJs.MessageActionChannelCreate) {\n text = 'Notification.CreatedChannel';\n } else if (action instanceof GramJs.MessageActionChatMigrateTo) {\n targetChatId = getApiChatIdFromMtpPeer(action);\n text = 'Migrated to %target_chat%';\n translationValues.push('%target_chat%');\n } else if (action instanceof GramJs.MessageActionChannelMigrateFrom) {\n targetChatId = getApiChatIdFromMtpPeer(action);\n text = 'Migrated from %target_chat%';\n translationValues.push('%target_chat%');\n } else if (action instanceof GramJs.MessageActionPinMessage) {\n text = 'Chat.Service.Group.UpdatedPinnedMessage1';\n translationValues.push('%action_origin%', '%message%');\n } else if (action instanceof GramJs.MessageActionHistoryClear) {\n text = 'HistoryCleared';\n type = 'historyClear';\n } else if (action instanceof GramJs.MessageActionPhoneCall) {\n const withDuration = Boolean(action.duration);\n text = [\n withDuration ? 'ChatList.Service' : 'Chat',\n action.video ? 'VideoCall' : 'Call',\n isOutgoing ? (withDuration ? 'outgoing' : 'Outgoing') : (withDuration ? 'incoming' : 'Incoming'),\n ].join('.');\n\n if (withDuration) {\n const mins = Math.max(Math.round(action.duration! / 60), 1);\n translationValues.push(`${mins} min${mins > 1 ? 's' : ''}`);\n }\n } else if (action instanceof GramJs.MessageActionContactSignUp) {\n text = 'Notification.Joined';\n translationValues.push('%action_origin%');\n type = 'contactSignUp';\n } else if (action instanceof GramJs.MessageActionPaymentSent) {\n amount = Number(action.totalAmount);\n currency = action.currency;\n text = 'PaymentSuccessfullyPaid';\n if (targetPeerId) {\n targetUserIds.push(targetPeerId);\n }\n translationValues.push('%payment_amount%', '%target_user%', '%product%');\n } else if (action instanceof GramJs.MessageActionGroupCall) {\n if (action.duration) {\n const mins = Math.max(Math.round(action.duration / 60), 1);\n text = 'Notification.VoiceChatEnded';\n translationValues.push(`${mins} min${mins > 1 ? 's' : ''}`);\n } else {\n text = 'Notification.VoiceChatStartedChannel';\n }\n } else if (action instanceof GramJs.MessageActionBotAllowed) {\n text = 'Chat.Service.BotPermissionAllowed';\n translationValues.push(action.domain);\n } else {\n text = 'ChatList.UnsupportedMessage';\n }\n\n if ('photo' in action && action.photo instanceof GramJs.Photo) {\n addPhotoToLocalDb(action.photo);\n photo = buildApiPhoto(action.photo);\n }\n\n return {\n text,\n type,\n targetUserIds,\n targetChatId,\n photo, // TODO Only used internally now, will be used for the UI in future\n amount,\n currency,\n translationValues,\n };\n}\n\nfunction buildReplyButtons(message: UniversalMessage): ApiReplyKeyboard | undefined {\n const { id: messageId, replyMarkup, media } = message;\n\n if (!replyMarkup) {\n if (media instanceof GramJs.MessageMediaWebPage && media.webpage instanceof GramJs.WebPage) {\n if (media.webpage.type === 'telegram_message') {\n return {\n inlineButtons: [[{\n type: 'url' as const,\n text: 'Show Message',\n messageId,\n value: media.webpage.url,\n }]],\n };\n }\n }\n\n return undefined;\n }\n\n // TODO\n if (!(replyMarkup instanceof GramJs.ReplyKeyboardMarkup || replyMarkup instanceof GramJs.ReplyInlineMarkup)) {\n return undefined;\n }\n\n const markup = replyMarkup.rows.map(({ buttons }) => {\n return buttons.map((button) => {\n let { text } = button;\n\n let type;\n let value;\n if (button instanceof GramJs.KeyboardButton) {\n type = 'command';\n value = text;\n } else if (button instanceof GramJs.KeyboardButtonUrl) {\n type = 'url';\n value = button.url;\n } else if (button instanceof GramJs.KeyboardButtonCallback) {\n type = 'callback';\n value = String(button.data);\n } else if (button instanceof GramJs.KeyboardButtonRequestPoll) {\n type = 'requestPoll';\n } else if (button instanceof GramJs.KeyboardButtonBuy) {\n if (media instanceof GramJs.MessageMediaInvoice && media.receiptMsgId) {\n text = 'PaymentReceipt';\n value = media.receiptMsgId;\n }\n type = 'buy';\n } else {\n type = 'NOT_SUPPORTED';\n }\n\n return {\n type,\n text,\n messageId,\n value,\n } as ApiKeyboardButton;\n });\n });\n\n return {\n [replyMarkup instanceof GramJs.ReplyKeyboardMarkup ? 'keyboardButtons' : 'inlineButtons']: markup,\n ...(replyMarkup instanceof GramJs.ReplyKeyboardMarkup && {\n keyboardPlaceholder: replyMarkup.placeholder,\n isKeyboardSingleUse: replyMarkup.singleUse,\n }),\n };\n}\n\nfunction getFilenameFromDocument(document: GramJs.Document, defaultBase = 'file') {\n const { mimeType, attributes } = document;\n const filenameAttribute = attributes\n .find((a: any): a is GramJs.DocumentAttributeFilename => a instanceof GramJs.DocumentAttributeFilename);\n\n if (filenameAttribute) {\n return filenameAttribute.fileName;\n }\n\n const extension = mimeType.split('/')[1];\n\n return `${defaultBase}${String(document.id)}.${extension}`;\n}\n\nexport function buildLocalMessage(\n chat: ApiChat,\n text?: string,\n entities?: ApiMessageEntity[],\n replyingTo?: number,\n attachment?: ApiAttachment,\n sticker?: ApiSticker,\n gif?: ApiVideo,\n poll?: ApiNewPoll,\n groupedId?: string,\n scheduledAt?: number,\n serverTimeOffset = 0,\n): ApiMessage {\n const localId = localMessageCounter++;\n const media = attachment && buildUploadingMedia(attachment);\n const isChannel = chat.type === 'chatTypeChannel';\n\n return {\n id: localId,\n chatId: chat.id,\n content: {\n ...(text && {\n text: {\n text,\n entities,\n },\n }),\n ...media,\n ...(sticker && { sticker }),\n ...(gif && { video: gif }),\n ...(poll && buildNewPoll(poll, localId)),\n },\n date: scheduledAt || Math.round(Date.now() / 1000) + serverTimeOffset,\n isOutgoing: !isChannel,\n senderId: currentUserId,\n ...(replyingTo && { replyToMessageId: replyingTo }),\n ...(groupedId && {\n groupedId,\n ...(media && (media.photo || media.video) && { isInAlbum: true }),\n }),\n ...(scheduledAt && { isScheduled: true }),\n };\n}\n\nexport function buildForwardedMessage(\n toChat: ApiChat,\n message: ApiMessage,\n serverTimeOffset: number,\n): ApiMessage {\n const localId = localMessageCounter++;\n const {\n content,\n chatId: fromChatId,\n id: fromMessageId,\n senderId,\n groupedId,\n isInAlbum,\n } = message;\n\n const isAudio = content.audio;\n const asIncomingInChatWithSelf = (\n toChat.id === currentUserId && (fromChatId !== toChat.id || message.forwardInfo) && !isAudio\n );\n\n return {\n id: localId,\n chatId: toChat.id,\n content,\n date: Math.round(Date.now() / 1000) + serverTimeOffset,\n isOutgoing: !asIncomingInChatWithSelf && toChat.type !== 'chatTypeChannel',\n senderId: currentUserId,\n sendingState: 'messageSendingStatePending',\n // Forward info doesn't get added when users forwards his own messages, also when forwarding audio\n ...(senderId !== currentUserId && !isAudio && {\n forwardInfo: {\n isChannelPost: false,\n fromChatId,\n fromMessageId,\n senderUserId: senderId,\n },\n }),\n groupedId,\n isInAlbum,\n };\n}\n\nfunction buildUploadingMedia(\n attachment: ApiAttachment,\n): ApiMessage['content'] {\n const {\n filename: fileName,\n blobUrl,\n previewBlobUrl,\n mimeType,\n size,\n } = attachment;\n\n if (attachment.quick) {\n const { width, height, duration } = attachment.quick;\n\n if (mimeType.startsWith('image/')) {\n return {\n photo: {\n id: LOCAL_IMAGE_UPLOADING_TEMP_ID,\n sizes: [],\n thumbnail: { width, height, dataUri: '' }, // Used only for dimensions\n blobUrl,\n },\n };\n } else {\n return {\n video: {\n id: LOCAL_VIDEO_UPLOADING_TEMP_ID,\n mimeType,\n duration: duration || 0,\n fileName,\n width,\n height,\n blobUrl,\n ...(previewBlobUrl && { thumbnail: { width, height, dataUri: previewBlobUrl } }),\n size,\n },\n };\n }\n } else if (attachment.voice) {\n const { duration, waveform } = attachment.voice;\n const { data: inputWaveform } = interpolateArray(waveform, INPUT_WAVEFORM_LENGTH);\n return {\n voice: {\n duration,\n waveform: inputWaveform,\n },\n };\n } else if (mimeType.startsWith('audio/')) {\n return {\n audio: {\n mimeType,\n fileName,\n size,\n duration: 200, // Arbitrary\n },\n };\n } else {\n return {\n document: {\n mimeType,\n fileName,\n size,\n ...(previewBlobUrl && { previewBlobUrl }),\n },\n };\n }\n}\n\nfunction buildNewPoll(poll: ApiNewPoll, localId: number) {\n return {\n poll: {\n id: localId.toString(),\n summary: pick(poll.summary, ['question', 'answers']),\n results: {},\n },\n };\n}\n\nfunction buildApiMessageEntity(entity: GramJs.TypeMessageEntity): ApiMessageEntity {\n const { className: type, offset, length } = entity;\n return {\n type,\n offset,\n length,\n ...('userId' in entity && typeof entity.userId === 'number' && { userId: entity.userId }),\n ...('url' in entity && { url: entity.url }),\n };\n}\n\nfunction buildThreadInfo(\n messageReplies: GramJs.TypeMessageReplies, messageId: number, chatId: number,\n): ApiThreadInfo | undefined {\n const {\n channelId, replies, maxId, readMaxId, recentRepliers,\n } = messageReplies;\n\n if (channelId === DELETED_COMMENTS_CHANNEL_ID) {\n return undefined;\n }\n\n const isPostThread = chatId !== channelId;\n\n return {\n threadId: messageId,\n ...(isPostThread ? {\n chatId: getApiChatIdFromMtpPeer({ channelId } as GramJs.TypePeer),\n originChannelId: chatId,\n } : {\n chatId,\n }),\n messagesCount: replies,\n lastMessageId: maxId,\n lastReadInboxMessageId: readMaxId,\n ...(recentRepliers && { recentReplierIds: recentRepliers.map(getApiChatIdFromMtpPeer) }),\n };\n}\n","import { Api as GramJs, connection } from '../../lib/gramjs';\nimport { ApiMessage, ApiUpdateConnectionStateType, OnApiUpdate } from '../types';\n\nimport { pick } from '../../util/iteratees';\nimport {\n buildApiMessage,\n buildApiMessageFromShort,\n buildApiMessageFromShortChat,\n buildMessageMediaContent,\n buildMessageTextContent,\n buildPoll,\n buildPollResults,\n buildApiMessageFromNotification,\n buildMessageDraft,\n} from './apiBuilders/messages';\nimport {\n getApiChatIdFromMtpPeer,\n buildChatMember,\n buildChatMembers,\n buildChatTypingStatus,\n buildAvatarHash,\n buildApiChatFromPreview,\n buildApiChatFolder,\n getApiChatIdFromInputMtpPeer,\n} from './apiBuilders/chats';\nimport { buildApiUser, buildApiUserStatus } from './apiBuilders/users';\nimport {\n buildMessageFromUpdate,\n isMessageWithMedia,\n buildChatPhotoForLocalDb,\n} from './gramjsBuilders';\nimport localDb from './localDb';\nimport { omitVirtualClassFields } from './apiBuilders/helpers';\nimport { DEBUG } from '../../config';\nimport { addMessageToLocalDb, addPhotoToLocalDb, resolveMessageApiChatId } from './helpers';\nimport { buildApiNotifyException, buildPrivacyKey, buildPrivacyRules } from './apiBuilders/misc';\nimport { buildApiPhoto } from './apiBuilders/common';\n\ntype Update = (\n (GramJs.TypeUpdate | GramJs.TypeUpdates) & { _entities?: (GramJs.TypeUser | GramJs.TypeChat)[] }\n) | typeof connection.UpdateConnectionState;\n\nconst DELETE_MISSING_CHANNEL_MESSAGE_DELAY = 1000;\n\nlet onUpdate: OnApiUpdate;\n\nexport function init(_onUpdate: OnApiUpdate) {\n onUpdate = _onUpdate;\n}\n\nconst sentMessageIds = new Set();\nlet serverTimeOffset = 0;\n\nexport function updater(update: Update, originRequest?: GramJs.AnyRequest) {\n if (update instanceof connection.UpdateServerTimeOffset) {\n serverTimeOffset = update.timeOffset;\n } else if (update instanceof connection.UpdateConnectionState) {\n let connectionState: ApiUpdateConnectionStateType;\n\n switch (update.state) {\n case connection.UpdateConnectionState.disconnected:\n connectionState = 'connectionStateConnecting';\n break;\n case connection.UpdateConnectionState.broken:\n connectionState = 'connectionStateBroken';\n break;\n case connection.UpdateConnectionState.connected:\n default:\n connectionState = 'connectionStateReady';\n break;\n }\n\n onUpdate({\n '@type': 'updateConnectionState',\n connectionState,\n });\n\n // Messages\n } else if (\n update instanceof GramJs.UpdateNewMessage\n || update instanceof GramJs.UpdateNewScheduledMessage\n || update instanceof GramJs.UpdateNewChannelMessage\n || update instanceof GramJs.UpdateShortChatMessage\n || update instanceof GramJs.UpdateShortMessage\n || update instanceof GramJs.UpdateServiceNotification\n ) {\n let message: ApiMessage | undefined;\n\n if (update instanceof GramJs.UpdateShortChatMessage) {\n message = buildApiMessageFromShortChat(update);\n } else if (update instanceof GramJs.UpdateShortMessage) {\n message = buildApiMessageFromShort(update);\n } else if (update instanceof GramJs.UpdateServiceNotification) {\n const currentDate = Date.now() / 1000 + serverTimeOffset;\n message = buildApiMessageFromNotification(update, currentDate);\n\n if (isMessageWithMedia(update)) {\n addMessageToLocalDb(buildMessageFromUpdate(message.id, message.chatId, update));\n }\n } else {\n // TODO Remove if proven not reproducing\n if (update.message instanceof GramJs.MessageEmpty) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('Unexpected update:', update.className, update);\n }\n\n return;\n }\n\n if (update.message instanceof GramJs.Message && isMessageWithMedia(update.message)) {\n addMessageToLocalDb(update.message);\n }\n\n message = buildApiMessage(update.message)!;\n }\n\n // eslint-disable-next-line no-underscore-dangle\n const entities = update._entities;\n if (entities?.length) {\n entities\n .filter((e) => e instanceof GramJs.User)\n .map(buildApiUser)\n .forEach((user) => {\n if (!user) {\n return;\n }\n\n onUpdate({\n '@type': 'updateUser',\n id: user.id,\n user,\n });\n });\n entities\n .filter((e) => e instanceof GramJs.Chat || e instanceof GramJs.Channel)\n .map((e) => buildApiChatFromPreview(e))\n .forEach((chat) => {\n if (!chat) {\n return;\n }\n\n onUpdate({\n '@type': 'updateChat',\n id: chat.id,\n chat,\n });\n });\n }\n\n if (update instanceof GramJs.UpdateNewScheduledMessage) {\n onUpdate({\n '@type': sentMessageIds.has(message.id) ? 'updateScheduledMessage' : 'newScheduledMessage',\n id: message.id,\n chatId: message.chatId,\n message,\n });\n } else {\n onUpdate({\n '@type': sentMessageIds.has(message.id) ? 'updateMessage' : 'newMessage',\n id: message.id,\n chatId: message.chatId,\n message,\n });\n }\n\n // Some updates to a Chat/Channel don't have a dedicated update class.\n // We can get info on some updates from Service Messages.\n if (update.message instanceof GramJs.MessageService) {\n const { action } = update.message;\n\n if (action instanceof GramJs.MessageActionChatEditTitle) {\n onUpdate({\n '@type': 'updateChat',\n id: message.chatId,\n chat: {\n title: action.title,\n },\n });\n } else if (action instanceof GramJs.MessageActionChatEditPhoto) {\n const photo = buildChatPhotoForLocalDb(action.photo);\n const avatarHash = buildAvatarHash(photo);\n\n const localDbChatId = Math.abs(resolveMessageApiChatId(update.message)!);\n if (localDb.chats[localDbChatId]) {\n localDb.chats[localDbChatId].photo = photo;\n }\n addPhotoToLocalDb(action.photo);\n\n if (avatarHash) {\n onUpdate({\n '@type': 'updateChat',\n id: message.chatId,\n chat: {\n avatarHash,\n },\n ...(action.photo instanceof GramJs.Photo && { newProfilePhoto: buildApiPhoto(action.photo) }),\n });\n }\n } else if (action instanceof GramJs.MessageActionChatDeletePhoto) {\n const localDbChatId = Math.abs(resolveMessageApiChatId(update.message)!);\n if (localDb.chats[localDbChatId]) {\n localDb.chats[localDbChatId].photo = new GramJs.ChatPhotoEmpty();\n }\n\n onUpdate({\n '@type': 'updateChat',\n id: message.chatId,\n chat: { avatarHash: undefined },\n });\n } else if (action instanceof GramJs.MessageActionChatDeleteUser) {\n // eslint-disable-next-line no-underscore-dangle\n if (update._entities && update._entities.some((e): e is GramJs.User => (\n e instanceof GramJs.User && !!e.self && e.id === action.userId\n ))) {\n onUpdate({\n '@type': 'updateChat',\n id: message.chatId,\n chat: {\n isRestricted: true,\n },\n });\n\n onUpdate({\n '@type': 'updateChatLeave',\n id: message.chatId,\n });\n }\n } else if (action instanceof GramJs.MessageActionChatAddUser) {\n // eslint-disable-next-line no-underscore-dangle\n if (update._entities && update._entities.some((e): e is GramJs.User => (\n e instanceof GramJs.User && !!e.self && action.users.includes(e.id)\n ))) {\n onUpdate({\n '@type': 'updateChatJoin',\n id: message.chatId,\n });\n }\n }\n }\n } else if (\n update instanceof GramJs.UpdateEditMessage\n || update instanceof GramJs.UpdateEditChannelMessage\n ) {\n // TODO Remove if proven not reproducing\n if (update.message instanceof GramJs.MessageEmpty) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('Unexpected update:', update.className, update);\n }\n\n return;\n }\n\n if (update.message instanceof GramJs.Message && isMessageWithMedia(update.message)) {\n addMessageToLocalDb(update.message);\n }\n\n const message = buildApiMessage(update.message)!;\n\n onUpdate({\n '@type': 'updateMessage',\n id: message.id,\n chatId: message.chatId,\n message,\n });\n } else if (update instanceof GramJs.UpdateDeleteMessages) {\n onUpdate({\n '@type': 'deleteMessages',\n ids: update.messages,\n });\n } else if (update instanceof GramJs.UpdateDeleteScheduledMessages) {\n onUpdate({\n '@type': 'deleteScheduledMessages',\n ids: update.messages,\n chatId: getApiChatIdFromInputMtpPeer(update.peer),\n });\n } else if (update instanceof GramJs.UpdateDeleteChannelMessages) {\n const chatId = getApiChatIdFromMtpPeer({ channelId: update.channelId } as GramJs.PeerChannel);\n const ids = update.messages;\n const existingIds = ids.filter((id) => localDb.messages[`${chatId}-${id}`]);\n const missingIds = ids.filter((id) => !localDb.messages[`${chatId}-${id}`]);\n const profilePhotoIds = ids.map((id) => {\n const message = localDb.messages[`${chatId}-${id}`];\n\n return message && message instanceof GramJs.MessageService && 'photo' in message.action\n ? String(message.action.photo.id)\n : undefined;\n }).filter(Boolean as any);\n\n if (existingIds.length) {\n onUpdate({\n '@type': 'deleteMessages',\n ids: existingIds,\n chatId,\n });\n }\n\n if (profilePhotoIds.length) {\n onUpdate({\n '@type': 'deleteProfilePhotos',\n ids: profilePhotoIds,\n chatId,\n });\n }\n\n // For some reason delete message update sometimes comes before new message update\n if (missingIds.length) {\n setTimeout(() => {\n onUpdate({\n '@type': 'deleteMessages',\n ids: missingIds,\n chatId,\n });\n }, DELETE_MISSING_CHANNEL_MESSAGE_DELAY);\n }\n } else if ((\n originRequest instanceof GramJs.messages.SendMessage\n || originRequest instanceof GramJs.messages.SendMedia\n || originRequest instanceof GramJs.messages.SendMultiMedia\n || originRequest instanceof GramJs.messages.ForwardMessages\n ) && (\n update instanceof GramJs.UpdateMessageID\n || update instanceof GramJs.UpdateShortSentMessage\n )) {\n let randomId;\n if ('randomId' in update) {\n randomId = update.randomId;\n } else if ('randomId' in originRequest) {\n randomId = originRequest.randomId;\n }\n\n const localMessage = randomId && localDb.localMessages[randomId.toString()];\n if (!localMessage) {\n throw new Error('Local message not found');\n }\n\n let newContent: ApiMessage['content'] | undefined;\n if (update instanceof GramJs.UpdateShortSentMessage) {\n if (localMessage.content.text && update.entities) {\n newContent = {\n text: buildMessageTextContent(localMessage.content.text.text, update.entities),\n };\n }\n if (update.media) {\n newContent = {\n ...newContent,\n ...buildMessageMediaContent(update.media),\n };\n }\n\n const mtpMessage = buildMessageFromUpdate(update.id, localMessage.chatId, update);\n if (isMessageWithMedia(mtpMessage)) {\n addMessageToLocalDb(mtpMessage);\n }\n }\n\n sentMessageIds.add(update.id);\n\n // Edge case for \"Send When Online\"\n const isAlreadySent = 'date' in update && update.date * 1000 < Date.now() + serverTimeOffset * 1000;\n\n onUpdate({\n '@type': localMessage.isScheduled && !isAlreadySent\n ? 'updateScheduledMessageSendSucceeded'\n : 'updateMessageSendSucceeded',\n chatId: localMessage.chatId,\n localId: localMessage.id,\n message: {\n ...localMessage,\n ...(newContent && {\n content: {\n ...localMessage.content,\n ...newContent,\n },\n }),\n id: update.id,\n sendingState: undefined,\n ...('date' in update && { date: update.date }),\n },\n });\n } else if (update instanceof GramJs.UpdateReadMessagesContents) {\n onUpdate({\n '@type': 'updateCommonBoxMessages',\n ids: update.messages,\n messageUpdate: {\n hasUnreadMention: false,\n isMediaUnread: false,\n },\n });\n } else if (update instanceof GramJs.UpdateChannelReadMessagesContents) {\n onUpdate({\n '@type': 'updateChannelMessages',\n channelId: update.channelId,\n ids: update.messages,\n messageUpdate: {\n hasUnreadMention: false,\n isMediaUnread: false,\n },\n });\n } else if (update instanceof GramJs.UpdateMessagePoll) {\n const { pollId, poll, results } = update;\n if (poll) {\n const apiPoll = buildPoll(poll, results);\n\n onUpdate({\n '@type': 'updateMessagePoll',\n pollId: pollId.toString(),\n pollUpdate: apiPoll,\n });\n } else {\n const pollResults = buildPollResults(results);\n onUpdate({\n '@type': 'updateMessagePoll',\n pollId: pollId.toString(),\n pollUpdate: { results: pollResults },\n });\n }\n } else if (update instanceof GramJs.UpdateMessagePollVote) {\n onUpdate({\n '@type': 'updateMessagePollVote',\n pollId: update.pollId.toString(),\n userId: update.userId,\n options: update.options.map((option) => String.fromCharCode(...option)),\n });\n } else if (update instanceof GramJs.UpdateChannelMessageViews) {\n onUpdate({\n '@type': 'updateMessage',\n chatId: getApiChatIdFromMtpPeer({ channelId: update.channelId } as GramJs.PeerChannel),\n id: update.id,\n message: { views: update.views },\n });\n\n // Chats\n } else if (update instanceof GramJs.UpdateReadHistoryInbox) {\n onUpdate({\n '@type': 'updateChatInbox',\n id: getApiChatIdFromMtpPeer(update.peer),\n chat: {\n lastReadInboxMessageId: update.maxId,\n unreadCount: update.stillUnreadCount,\n },\n });\n } else if (update instanceof GramJs.UpdateReadHistoryOutbox) {\n onUpdate({\n '@type': 'updateChat',\n id: getApiChatIdFromMtpPeer(update.peer),\n chat: {\n lastReadOutboxMessageId: update.maxId,\n },\n });\n } else if (update instanceof GramJs.UpdateReadChannelInbox) {\n onUpdate({\n '@type': 'updateChat',\n id: getApiChatIdFromMtpPeer({ channelId: update.channelId } as GramJs.PeerChannel),\n chat: {\n lastReadInboxMessageId: update.maxId,\n unreadCount: update.stillUnreadCount,\n },\n });\n } else if (update instanceof GramJs.UpdateReadChannelOutbox) {\n onUpdate({\n '@type': 'updateChat',\n id: getApiChatIdFromMtpPeer({ channelId: update.channelId } as GramJs.PeerChannel),\n chat: {\n lastReadOutboxMessageId: update.maxId,\n },\n });\n } else if (\n update instanceof GramJs.UpdateDialogPinned\n && update.peer instanceof GramJs.DialogPeer\n ) {\n onUpdate({\n '@type': 'updateChatPinned',\n id: getApiChatIdFromMtpPeer(update.peer.peer),\n isPinned: update.pinned || false,\n });\n } else if (update instanceof GramJs.UpdatePinnedDialogs) {\n const ids = update.order\n ? update.order\n .filter((dp): dp is GramJs.DialogPeer => dp instanceof GramJs.DialogPeer)\n .map((dp) => getApiChatIdFromMtpPeer(dp.peer))\n : [];\n\n onUpdate({\n '@type': 'updatePinnedChatIds',\n ids,\n folderId: update.folderId || undefined,\n });\n } else if (update instanceof GramJs.UpdateFolderPeers) {\n update.folderPeers.forEach((folderPeer) => {\n const { folderId, peer } = folderPeer;\n\n onUpdate({\n '@type': 'updateChatListType',\n id: getApiChatIdFromMtpPeer(peer),\n folderId,\n });\n });\n } else if (update instanceof GramJs.UpdateDialogFilter) {\n const { id, filter } = update;\n const folder = filter ? buildApiChatFolder(filter) : undefined;\n\n onUpdate({\n '@type': 'updateChatFolder',\n id,\n folder,\n });\n } else if (update instanceof GramJs.UpdateDialogFilterOrder) {\n onUpdate({\n '@type': 'updateChatFoldersOrder',\n orderedIds: update.order,\n });\n } else if (update instanceof GramJs.UpdateChatParticipants) {\n const replacedMembers = buildChatMembers(update.participants);\n\n onUpdate({\n '@type': 'updateChatMembers',\n id: getApiChatIdFromMtpPeer({ chatId: update.participants.chatId } as GramJs.TypePeer),\n replacedMembers,\n });\n } else if (update instanceof GramJs.UpdateChatParticipantAdd) {\n const addedMember = buildChatMember(\n pick(update, ['userId', 'inviterId', 'date']) as GramJs.ChatParticipant,\n );\n\n onUpdate({\n '@type': 'updateChatMembers',\n id: getApiChatIdFromMtpPeer({ chatId: update.chatId } as GramJs.PeerChat),\n addedMember,\n });\n } else if (update instanceof GramJs.UpdateChatParticipantDelete) {\n const { userId: deletedMemberId } = update;\n\n onUpdate({\n '@type': 'updateChatMembers',\n id: getApiChatIdFromMtpPeer({ chatId: update.chatId } as GramJs.PeerChat),\n deletedMemberId,\n });\n } else if (\n update instanceof GramJs.UpdatePinnedMessages\n || update instanceof GramJs.UpdatePinnedChannelMessages\n ) {\n const peer = update instanceof GramJs.UpdatePinnedMessages\n ? update.peer\n : { channelId: update.channelId } as GramJs.PeerChannel;\n const chatId = getApiChatIdFromMtpPeer(peer);\n\n onUpdate({\n '@type': 'updatePinnedIds',\n chatId,\n messageIds: update.messages,\n isPinned: update.pinned,\n });\n } else if (\n update instanceof GramJs.UpdateNotifySettings\n && update.peer instanceof GramJs.NotifyPeer\n ) {\n onUpdate({\n '@type': 'updateNotifyExceptions',\n ...buildApiNotifyException(update.notifySettings, update.peer.peer, serverTimeOffset),\n });\n } else if (\n update instanceof GramJs.UpdateUserTyping\n || update instanceof GramJs.UpdateChatUserTyping\n ) {\n const id = update instanceof GramJs.UpdateUserTyping\n ? update.userId\n : getApiChatIdFromMtpPeer({ chatId: update.chatId } as GramJs.PeerChat);\n\n onUpdate({\n '@type': 'updateChatTypingStatus',\n id,\n typingStatus: buildChatTypingStatus(update, serverTimeOffset),\n });\n } else if (update instanceof GramJs.UpdateChannelUserTyping) {\n const id = getApiChatIdFromMtpPeer({ channelId: update.channelId } as GramJs.PeerChannel);\n\n onUpdate({\n '@type': 'updateChatTypingStatus',\n id,\n typingStatus: buildChatTypingStatus(update, serverTimeOffset),\n });\n } else if (update instanceof GramJs.UpdateChannel) {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const { _entities } = update;\n if (!_entities) {\n return;\n }\n\n const channel = _entities.find((e): e is GramJs.Channel | GramJs.ChannelForbidden => (\n e instanceof GramJs.Channel || e instanceof GramJs.ChannelForbidden\n ));\n\n if (channel instanceof GramJs.Channel) {\n const chat = buildApiChatFromPreview(channel);\n if (chat) {\n onUpdate({\n '@type': 'updateChat',\n id: chat.id,\n chat,\n });\n\n onUpdate({\n '@type': chat.isNotJoined ? 'updateChatLeave' : 'updateChatJoin',\n id: getApiChatIdFromMtpPeer({ channelId: update.channelId } as GramJs.PeerChannel),\n });\n }\n } else if (channel instanceof GramJs.ChannelForbidden) {\n const chatId = getApiChatIdFromMtpPeer({ channelId: update.channelId } as GramJs.PeerChannel);\n\n onUpdate({\n '@type': 'updateChat',\n id: chatId,\n chat: {\n isRestricted: true,\n },\n });\n\n onUpdate({\n '@type': 'updateChatLeave',\n id: chatId,\n });\n } else if (_entities.length === 0) {\n // The link to the discussion group may have been changed.\n // No corresponding update available at this moment https://core.telegram.org/type/Updates\n onUpdate({\n '@type': 'resetMessages',\n id: getApiChatIdFromMtpPeer({ chatId: update.channelId } as GramJs.PeerChat),\n });\n }\n } else if (\n update instanceof GramJs.UpdateDialogUnreadMark\n && update.peer instanceof GramJs.DialogPeer\n ) {\n onUpdate({\n '@type': 'updateChat',\n id: getApiChatIdFromMtpPeer(update.peer.peer),\n chat: {\n hasUnreadMark: update.unread,\n },\n });\n } else if (update instanceof GramJs.UpdateChatDefaultBannedRights) {\n onUpdate({\n '@type': 'updateChat',\n id: getApiChatIdFromMtpPeer(update.peer),\n chat: {\n defaultBannedRights: omitVirtualClassFields(update.defaultBannedRights),\n },\n });\n\n // Users\n } else if (update instanceof GramJs.UpdateUserStatus) {\n const { userId, status } = update;\n\n onUpdate({\n '@type': 'updateUserStatus',\n userId,\n status: buildApiUserStatus(status),\n });\n } else if (update instanceof GramJs.UpdateUserName) {\n const updatedUser = localDb.users[update.userId];\n const user = updatedUser?.mutualContact && !updatedUser.self\n ? pick(update, ['username'])\n : pick(update, ['firstName', 'lastName', 'username']);\n\n onUpdate({\n '@type': 'updateUser',\n id: update.userId,\n user,\n });\n } else if (update instanceof GramJs.UpdateUserPhoto) {\n const { userId, photo } = update;\n const avatarHash = buildAvatarHash(photo);\n\n if (localDb.users[userId]) {\n localDb.users[userId].photo = photo;\n }\n\n onUpdate({\n '@type': 'updateUser',\n id: userId,\n user: { avatarHash },\n });\n } else if (update instanceof GramJs.UpdateUserPhone) {\n const { userId, phone } = update;\n\n onUpdate({\n '@type': 'updateUser',\n id: userId,\n user: { phoneNumber: phone },\n });\n } else if (update instanceof GramJs.UpdatePeerSettings) {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const { _entities } = update;\n if (!_entities) {\n return;\n }\n\n if (_entities?.length) {\n _entities\n .filter((e) => e instanceof GramJs.User && !e.contact)\n .forEach((user) => {\n onUpdate({\n '@type': 'deleteUser',\n id: user.id,\n });\n });\n\n _entities\n .filter((e) => e instanceof GramJs.User && e.contact)\n .map(buildApiUser)\n .forEach((user) => {\n if (!user) {\n return;\n }\n\n onUpdate({\n '@type': 'updateUser',\n id: user.id,\n user,\n });\n });\n }\n\n // Settings\n } else if (update instanceof GramJs.UpdateNotifySettings) {\n const {\n notifySettings: {\n showPreviews, silent, muteUntil,\n },\n peer: { className },\n } = update;\n\n const peerType = className === 'NotifyUsers'\n ? 'contact'\n : (className === 'NotifyChats'\n ? 'group'\n : (className === 'NotifyBroadcasts'\n ? 'broadcast'\n : undefined\n )\n );\n\n if (!peerType) {\n return;\n }\n\n onUpdate({\n '@type': 'updateNotifySettings',\n peerType,\n isSilent: Boolean(silent\n || (typeof muteUntil === 'number' && Date.now() + serverTimeOffset * 1000 < muteUntil * 1000)),\n shouldShowPreviews: Boolean(showPreviews),\n });\n } else if (update instanceof GramJs.UpdatePeerBlocked) {\n onUpdate({\n '@type': 'updatePeerBlocked',\n id: getApiChatIdFromMtpPeer(update.peerId),\n isBlocked: update.blocked,\n });\n } else if (update instanceof GramJs.UpdatePrivacy) {\n const key = buildPrivacyKey(update.key);\n if (key) {\n onUpdate({\n '@type': 'updatePrivacy',\n key,\n rules: buildPrivacyRules(update.rules),\n });\n }\n\n // Misc\n } else if (update instanceof GramJs.UpdateDraftMessage) {\n onUpdate({\n '@type': 'draftMessage',\n chatId: getApiChatIdFromMtpPeer(update.peer),\n ...buildMessageDraft(update.draft),\n });\n } else if (update instanceof GramJs.UpdateContactsReset) {\n onUpdate({ '@type': 'updateResetContactList' });\n } else if (update instanceof GramJs.UpdateFavedStickers) {\n onUpdate({ '@type': 'updateFavoriteStickers' });\n } else if (DEBUG) {\n const params = typeof update === 'object' && 'className' in update ? update.className : update;\n // eslint-disable-next-line no-console\n console.warn('[GramJs/updater] Unexpected update:', params);\n }\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\nimport {\n ApiBotCommand, ApiUser, ApiUserStatus, ApiUserType,\n} from '../../types';\n\nexport function buildApiUserFromFull(mtpUserFull: GramJs.UserFull): ApiUser {\n const {\n about, commonChatsCount, pinnedMsgId, botInfo, blocked,\n } = mtpUserFull;\n\n return {\n ...(buildApiUser(mtpUserFull.user) as ApiUser),\n fullInfo: {\n bio: about,\n commonChatsCount,\n pinnedMessageId: pinnedMsgId,\n isBlocked: Boolean(blocked),\n ...(botInfo && { botDescription: botInfo.description }),\n ...(botInfo && botInfo.commands.length && { botCommands: buildApiBotCommands(mtpUserFull.user.id, botInfo) }),\n },\n };\n}\n\nexport function buildApiUser(mtpUser: GramJs.TypeUser): ApiUser | undefined {\n if (!(mtpUser instanceof GramJs.User)) {\n return undefined;\n }\n\n const { id, firstName, lastName } = mtpUser;\n const avatarHash = mtpUser.photo instanceof GramJs.UserProfilePhoto\n ? String(mtpUser.photo.photoId)\n : undefined;\n const userType = buildApiUserType(mtpUser);\n\n return {\n id,\n isMin: Boolean(mtpUser.min),\n ...(mtpUser.self && { isSelf: true }),\n ...(mtpUser.verified && { isVerified: true }),\n ...((mtpUser.contact || mtpUser.mutualContact) && { isContact: true }),\n type: userType,\n ...(firstName && { firstName }),\n ...(userType === 'userTypeBot' && { canBeInvitedToGroup: !mtpUser.botNochats }),\n ...(lastName && { lastName }),\n username: mtpUser.username || '',\n phoneNumber: mtpUser.phone || '',\n status: buildApiUserStatus(mtpUser.status),\n ...(mtpUser.accessHash && { accessHash: String(mtpUser.accessHash) }),\n ...(avatarHash && { avatarHash }),\n ...(mtpUser.bot && mtpUser.botInlinePlaceholder && { botPlaceholder: mtpUser.botInlinePlaceholder }),\n };\n}\n\nfunction buildApiUserType(user: GramJs.User): ApiUserType {\n if (user.bot) {\n return 'userTypeBot';\n }\n if (user.deleted) {\n return 'userTypeDeleted';\n }\n\n return 'userTypeRegular';\n}\n\nexport function buildApiUserStatus(mtpStatus?: GramJs.TypeUserStatus): ApiUserStatus {\n if (!mtpStatus || mtpStatus instanceof GramJs.UserStatusEmpty) {\n return { type: 'userStatusEmpty' };\n } else if (mtpStatus instanceof GramJs.UserStatusOnline) {\n return { type: 'userStatusOnline', expires: mtpStatus.expires };\n } else if (mtpStatus instanceof GramJs.UserStatusOffline) {\n return { type: 'userStatusOffline', wasOnline: mtpStatus.wasOnline };\n } else if (mtpStatus instanceof GramJs.UserStatusRecently) {\n return { type: 'userStatusRecently' };\n } else if (mtpStatus instanceof GramJs.UserStatusLastWeek) {\n return { type: 'userStatusLastWeek' };\n } else {\n return { type: 'userStatusLastMonth' };\n }\n}\n\nfunction buildApiBotCommands(botId: number, botInfo: GramJs.BotInfo) {\n return botInfo.commands.map(({ command, description }) => ({\n botId,\n command,\n description,\n })) as ApiBotCommand[];\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\n\nimport { ApiCountry, ApiSession, ApiWallpaper } from '../../types';\nimport { ApiPrivacySettings, ApiPrivacyKey, PrivacyVisibility } from '../../../types';\n\nimport { buildApiDocument } from './messages';\nimport { getApiChatIdFromMtpPeer } from './chats';\nimport { flatten, pick } from '../../../util/iteratees';\nimport { getServerTime } from '../../../util/serverTime';\n\nexport function buildApiWallpaper(wallpaper: GramJs.TypeWallPaper): ApiWallpaper | undefined {\n if (wallpaper instanceof GramJs.WallPaperNoFile) {\n // TODO: Plain color wallpapers\n return undefined;\n }\n\n const { slug } = wallpaper;\n\n const document = buildApiDocument(wallpaper.document);\n\n if (!document) {\n return undefined;\n }\n\n return {\n slug,\n document,\n };\n}\n\nexport function buildApiSession(session: GramJs.Authorization): ApiSession {\n return {\n isCurrent: Boolean(session.current),\n isOfficialApp: Boolean(session.officialApp),\n isPasswordPending: Boolean(session.passwordPending),\n hash: String(session.hash),\n ...pick(session, [\n 'deviceModel', 'platform', 'systemVersion', 'appName', 'appVersion', 'dateCreated', 'dateActive',\n 'ip', 'country', 'region',\n ]),\n };\n}\n\nexport function buildPrivacyKey(key: GramJs.TypePrivacyKey): ApiPrivacyKey | undefined {\n switch (key.className) {\n case 'PrivacyKeyPhoneNumber':\n return 'phoneNumber';\n case 'PrivacyKeyStatusTimestamp':\n return 'lastSeen';\n case 'PrivacyKeyProfilePhoto':\n return 'profilePhoto';\n case 'PrivacyKeyForwards':\n return 'forwards';\n case 'PrivacyKeyChatInvite':\n return 'chatInvite';\n }\n\n return undefined;\n}\n\nexport function buildPrivacyRules(rules: GramJs.TypePrivacyRule[]): ApiPrivacySettings {\n let visibility: PrivacyVisibility | undefined;\n let allowUserIds: number[] | undefined;\n let allowChatIds: number[] | undefined;\n let blockUserIds: number[] | undefined;\n let blockChatIds: number[] | undefined;\n\n rules.forEach((rule) => {\n if (rule instanceof GramJs.PrivacyValueAllowAll) {\n visibility = visibility || 'everybody';\n } else if (rule instanceof GramJs.PrivacyValueAllowContacts) {\n visibility = visibility || 'contacts';\n } else if (rule instanceof GramJs.PrivacyValueDisallowContacts) {\n visibility = visibility || 'nonContacts';\n } else if (rule instanceof GramJs.PrivacyValueDisallowAll) {\n visibility = visibility || 'nobody';\n } else if (rule instanceof GramJs.PrivacyValueAllowUsers) {\n allowUserIds = rule.users;\n } else if (rule instanceof GramJs.PrivacyValueDisallowUsers) {\n blockUserIds = rule.users;\n } else if (rule instanceof GramJs.PrivacyValueAllowChatParticipants) {\n allowChatIds = rule.chats.map((id) => -id);\n } else if (rule instanceof GramJs.PrivacyValueDisallowChatParticipants) {\n blockChatIds = rule.chats.map((id) => -id);\n }\n });\n\n if (!visibility) {\n // disallow by default.\n visibility = 'nobody';\n }\n\n return {\n visibility,\n allowUserIds: allowUserIds || [],\n allowChatIds: allowChatIds || [],\n blockUserIds: blockUserIds || [],\n blockChatIds: blockChatIds || [],\n };\n}\n\nexport function buildApiNotifyException(\n notifySettings: GramJs.TypePeerNotifySettings, peer: GramJs.TypePeer, serverTimeOffset: number,\n) {\n const {\n silent, muteUntil, showPreviews, sound,\n } = notifySettings;\n\n return {\n chatId: getApiChatIdFromMtpPeer(peer),\n isMuted: silent || (typeof muteUntil === 'number' && getServerTime(serverTimeOffset) < muteUntil),\n ...(sound === '' && { isSilent: true }),\n ...(showPreviews !== undefined && { shouldShowPreviews: Boolean(showPreviews) }),\n };\n}\nfunction buildApiCountry(country: GramJs.help.Country, code?: GramJs.help.CountryCode) {\n const {\n hidden, iso2, defaultName, name,\n } = country;\n const { countryCode, prefixes, patterns } = code || {};\n\n return {\n isHidden: hidden,\n iso2,\n defaultName,\n name,\n countryCode,\n prefixes,\n patterns,\n };\n}\n\nexport function buildApiCountryList(countries: GramJs.help.Country[]) {\n const listByCode = flatten(countries\n .filter((country) => !country.hidden)\n .map((country) => (\n country.countryCodes.map((code) => buildApiCountry(country, code))\n ))).sort((a: ApiCountry, b: ApiCountry) => (\n a.name ? a.name.localeCompare(b.name!) : a.defaultName.localeCompare(b.defaultName)\n ));\n\n const generalList = countries\n .filter((country) => !country.hidden)\n .map((country) => buildApiCountry(country))\n .sort((a, b) => (\n a.name ? a.name.localeCompare(b.name!) : a.defaultName.localeCompare(b.defaultName)\n ));\n\n return {\n phoneCodes: listByCode,\n general: generalList,\n };\n}\n","import { errors } from '../../../lib/gramjs';\nimport {\n ApiUpdateAuthorizationState,\n ApiUpdateAuthorizationStateType,\n OnApiUpdate,\n ApiUser,\n} from '../../types';\n\nimport { DEBUG } from '../../../config';\n\nconst ApiErrors: { [k: string]: string } = {\n PHONE_NUMBER_INVALID: 'PHONE_NUMBER_INVALID',\n PHONE_CODE_INVALID: 'PHONE_CODE_INVALID',\n PASSWORD_HASH_INVALID: 'PASSWORD_HASH_INVALID',\n PHONE_PASSWORD_FLOOD: 'You have tried logging in too many times',\n};\n\nconst authController: {\n resolve?: Function;\n reject?: Function;\n} = {};\n\nlet onUpdate: OnApiUpdate;\n\nexport function init(_onUpdate: OnApiUpdate) {\n onUpdate = _onUpdate;\n}\n\nexport function onRequestPhoneNumber() {\n onUpdate(buildAuthStateUpdate('authorizationStateWaitPhoneNumber'));\n\n return new Promise((resolve, reject) => {\n authController.resolve = resolve;\n authController.reject = reject;\n });\n}\n\nexport function onRequestCode(isCodeViaApp = false) {\n onUpdate({\n ...buildAuthStateUpdate('authorizationStateWaitCode'),\n isCodeViaApp,\n });\n\n return new Promise((resolve, reject) => {\n authController.resolve = resolve;\n authController.reject = reject;\n });\n}\n\nexport function onRequestPassword(hint?: string) {\n onUpdate({\n ...buildAuthStateUpdate('authorizationStateWaitPassword'),\n hint,\n });\n\n return new Promise((resolve) => {\n authController.resolve = resolve;\n });\n}\n\nexport function onRequestRegistration() {\n onUpdate(buildAuthStateUpdate('authorizationStateWaitRegistration'));\n\n return new Promise<[string, string?]>((resolve) => {\n authController.resolve = resolve;\n });\n}\n\nexport function onRequestQrCode(qrCode: { token: Buffer; expires: number }) {\n onUpdate({\n ...buildAuthStateUpdate('authorizationStateWaitQrCode'),\n qrCode: {\n token: btoa(String.fromCharCode(...qrCode.token)).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, ''),\n expires: qrCode.expires,\n },\n });\n\n return new Promise((resolve, reject) => {\n authController.reject = reject;\n });\n}\n\nexport function onAuthError(err: Error) {\n let message: string;\n\n if (err instanceof errors.FloodWaitError) {\n const hours = Math.ceil(Number(err.seconds) / 60 / 60);\n message = `Too many attempts. Try again in ${hours > 1 ? `${hours} hours` : 'an hour'}`;\n } else {\n message = ApiErrors[err.message];\n }\n\n if (!message) {\n message = 'Unexpected Error';\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n }\n\n onUpdate({\n '@type': 'updateAuthorizationError',\n message,\n });\n}\n\nexport function onAuthReady() {\n onUpdate(buildAuthStateUpdate('authorizationStateReady'));\n}\n\nexport function onCurrentUserUpdate(currentUser: ApiUser) {\n onUpdate({\n '@type': 'updateCurrentUser',\n currentUser,\n });\n}\n\nexport function buildAuthStateUpdate(authorizationState: ApiUpdateAuthorizationStateType): ApiUpdateAuthorizationState {\n return {\n '@type': 'updateAuthorizationState',\n authorizationState,\n };\n}\n\nexport function provideAuthPhoneNumber(phoneNumber: string) {\n if (!authController.resolve) {\n return;\n }\n\n authController.resolve(phoneNumber);\n}\n\nexport function provideAuthCode(code: string) {\n if (!authController.resolve) {\n return;\n }\n\n authController.resolve(code);\n}\n\nexport function provideAuthPassword(password: string) {\n if (!authController.resolve) {\n return;\n }\n\n authController.resolve(password);\n}\n\nexport function provideAuthRegistration(registration: { firstName: string; lastName: string }) {\n const { firstName, lastName } = registration;\n\n if (!authController.resolve) {\n return;\n }\n\n authController.resolve([firstName, lastName]);\n}\n\nexport function restartAuth() {\n if (!authController.reject) {\n return;\n }\n\n authController.reject(new Error('RESTART_AUTH'));\n}\n\nexport function restartAuthWithQr() {\n if (!authController.reject) {\n return;\n }\n\n authController.reject(new Error('RESTART_AUTH_WITH_QR'));\n}\n","import { pause } from './schedulers';\n\n// Polyfill for Safari: `File` is not available in web worker\nif (typeof File === 'undefined') {\n // eslint-disable-next-line no-global-assign, no-restricted-globals, func-names\n self.File = class extends Blob {\n name: string;\n\n constructor(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag) {\n if (options) {\n const { type, ...rest } = options;\n super(fileBits, { type });\n Object.assign(this, rest);\n } else {\n super(fileBits);\n }\n\n this.name = fileName;\n }\n } as typeof File;\n}\n\nexport function dataUriToBlob(dataUri: string) {\n const arr = dataUri.split(',');\n const mime = arr[0].match(/:(.*?);/)![1];\n const bstr = atob(arr[1]);\n let n = bstr.length;\n const u8arr = new Uint8Array(n);\n\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n\n return new Blob([u8arr], { type: mime });\n}\n\nexport function blobToDataUri(blob: Blob): Promise {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = (e: ProgressEvent) => {\n const { result } = e.target || {};\n if (typeof result === 'string') {\n resolve(result);\n }\n\n reject(new Error('Failed to read blob'));\n };\n\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n}\n\nexport function blobToFile(blob: Blob, fileName: string) {\n return new File([blob], fileName, {\n lastModified: Date.now(),\n type: blob.type,\n });\n}\n\nexport function preloadImage(url: string): Promise {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = reject;\n img.src = url;\n });\n}\n\nexport function preloadVideo(url: string): Promise {\n return new Promise((resolve, reject) => {\n const video = document.createElement('video');\n video.volume = 0;\n video.onloadedmetadata = () => resolve(video);\n video.onerror = reject;\n video.src = url;\n });\n}\n\nexport async function createPosterForVideo(url: string): Promise {\n const video = await preloadVideo(url);\n\n return Promise.race([\n pause(2000) as Promise,\n new Promise((resolve, reject) => {\n video.onseeked = () => {\n if (!video.videoWidth || !video.videoHeight) {\n resolve(undefined);\n }\n\n const canvas = document.createElement('canvas');\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n const ctx = canvas.getContext('2d')!;\n ctx.drawImage(video, 0, 0);\n resolve(canvas.toDataURL('image/jpeg'));\n };\n video.onerror = reject;\n video.currentTime = Math.min(video.duration, 1);\n }),\n ]);\n}\n\nexport async function fetchBlob(blobUrl: string) {\n const response = await fetch(blobUrl);\n return response.blob();\n}\n\nexport async function fetchFile(blobUrl: string, fileName: string) {\n const blob = await fetchBlob(blobUrl);\n return blobToFile(blob, fileName);\n}\n\nexport function imgToCanvas(img: HTMLImageElement) {\n const canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n\n const ctx = canvas.getContext('2d')!;\n ctx.drawImage(img, 0, 0);\n\n return canvas;\n}\n","// eslint-disable-next-line no-restricted-globals\nconst cacheApi = self.caches;\n\nexport enum Type {\n Text,\n Blob,\n Json,\n}\n\nexport async function fetch(\n cacheName: string, key: string, type: Type, isHtmlAllowed = false,\n) {\n if (!cacheApi) {\n return undefined;\n }\n\n try {\n // To avoid the error \"Request scheme 'webdocument' is unsupported\"\n const request = new Request(key.replace(/:/g, '_'));\n const cache = await cacheApi.open(cacheName);\n const response = await cache.match(request);\n if (!response) {\n return undefined;\n }\n\n switch (type) {\n case Type.Text:\n return await response.text();\n case Type.Blob: {\n const blob = await response.blob();\n\n // Safari does not return correct Content-Type header for webp images.\n if (key.substr(0, 7) === 'sticker') {\n return new Blob([blob], { type: 'image/webp' });\n }\n\n // iOS Safari fails to preserve `type` in cache\n if (!blob.type) {\n const contentType = response.headers.get('Content-Type');\n if (contentType) {\n return new Blob([blob], { type: isHtmlAllowed ? contentType : contentType.replace(/html/gi, '') });\n }\n }\n\n // Prevent HTML-in-video attacks (for files that were cached before fix)\n if (!isHtmlAllowed && blob.type.includes('html')) {\n return new Blob([blob], { type: blob.type.replace(/html/gi, '') });\n }\n\n return blob;\n }\n case Type.Json:\n return await response.json();\n default:\n return undefined;\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n return undefined;\n }\n}\n\nexport async function save(cacheName: string, key: string, data: AnyLiteral | Blob | string) {\n if (!cacheApi) {\n return undefined;\n }\n\n try {\n const cacheData = typeof data === 'string' || data instanceof Blob ? data : JSON.stringify(data);\n // To avoid the error \"Request scheme 'webdocument' is unsupported\"\n const request = new Request(key.replace(/:/g, '_'));\n const response = new Response(cacheData);\n const cache = await cacheApi.open(cacheName);\n return await cache.put(request, response);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n return undefined;\n }\n}\n\nexport async function clear(cacheName: string) {\n try {\n if (!cacheApi) {\n return undefined;\n }\n\n return await cacheApi.delete(cacheName);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n return undefined;\n }\n}\n","import { inflate } from 'pako/dist/pako_inflate';\n\nimport { Api as GramJs, TelegramClient } from '../../../lib/gramjs';\nimport {\n ApiMediaFormat, ApiOnProgress, ApiParsedMedia, ApiPreparedMedia,\n} from '../../types';\n\nimport {\n DOWNLOAD_WORKERS,\n MEDIA_CACHE_DISABLED,\n MEDIA_CACHE_MAX_BYTES,\n MEDIA_CACHE_NAME,\n MEDIA_CACHE_NAME_AVATARS,\n} from '../../../config';\nimport localDb from '../localDb';\nimport { getEntityTypeById } from '../gramjsBuilders';\nimport { blobToDataUri } from '../../../util/files';\nimport * as cacheApi from '../../../util/cacheApi';\n\ntype EntityType = (\n 'msg' | 'sticker' | 'wallpaper' | 'gif' | 'channel' | 'chat' | 'user' | 'photo' | 'stickerSet' | 'webDocument'\n);\nconst MEDIA_ENTITY_TYPES = new Set(['msg', 'sticker', 'gif', 'wallpaper', 'photo', 'webDocument']);\n\nexport default async function downloadMedia(\n {\n url, mediaFormat, start, end, isHtmlAllowed,\n }: {\n url: string; mediaFormat: ApiMediaFormat; start?: number; end?: number; isHtmlAllowed?: boolean;\n },\n client: TelegramClient,\n isConnected: boolean,\n onProgress?: ApiOnProgress,\n) {\n const {\n data, mimeType, fullSize,\n } = await download(url, client, isConnected, onProgress, start, end, mediaFormat, isHtmlAllowed) || {};\n if (!data) {\n return undefined;\n }\n\n const parsed = await parseMedia(data, mediaFormat, mimeType);\n if (!parsed) {\n return undefined;\n }\n\n const canCache = mediaFormat !== ApiMediaFormat.Progressive && (\n mediaFormat !== ApiMediaFormat.BlobUrl || (parsed as Blob).size <= MEDIA_CACHE_MAX_BYTES\n );\n\n if (!MEDIA_CACHE_DISABLED && cacheApi && canCache) {\n const cacheName = url.startsWith('avatar') ? MEDIA_CACHE_NAME_AVATARS : MEDIA_CACHE_NAME;\n void cacheApi.save(cacheName, url, parsed);\n }\n\n const prepared = mediaFormat === ApiMediaFormat.Progressive ? '' : prepareMedia(parsed);\n const arrayBuffer = mediaFormat === ApiMediaFormat.Progressive ? parsed as ArrayBuffer : undefined;\n\n return {\n prepared,\n arrayBuffer,\n mimeType,\n fullSize,\n };\n}\n\nasync function download(\n url: string,\n client: TelegramClient,\n isConnected: boolean,\n onProgress?: ApiOnProgress,\n start?: number,\n end?: number,\n mediaFormat?: ApiMediaFormat,\n isHtmlAllowed?: boolean,\n) {\n const mediaMatch = url.startsWith('webDocument')\n ? url.match(/(webDocument):(.+)/)\n : url.match(/(avatar|profile|photo|msg|stickerSet|sticker|wallpaper|gif|file)([-\\d\\w./]+)(\\?size=\\w+)?/);\n if (!mediaMatch) {\n return undefined;\n }\n\n if (mediaMatch[1] === 'file') {\n const response = await fetch(mediaMatch[2]);\n const data = await response.arrayBuffer();\n return { data };\n }\n\n if (!isConnected) {\n return Promise.reject(new Error('ERROR: Client is not connected'));\n }\n\n let entityType: EntityType;\n let entityId: string | number = mediaMatch[2];\n const sizeType = mediaMatch[3] ? mediaMatch[3].replace('?size=', '') : undefined;\n let entity: (\n GramJs.User | GramJs.Chat | GramJs.Channel | GramJs.Photo |\n GramJs.Message | GramJs.Document | GramJs.StickerSet | GramJs.TypeWebDocument | undefined\n );\n\n if (mediaMatch[1] === 'avatar' || mediaMatch[1] === 'profile') {\n entityType = getEntityTypeById(Number(entityId));\n entityId = Math.abs(Number(entityId));\n } else {\n entityType = mediaMatch[1] as 'msg' | 'sticker' | 'wallpaper' | 'gif' | 'stickerSet' | 'photo' | 'webDocument';\n }\n\n switch (entityType) {\n case 'channel':\n case 'chat':\n entity = localDb.chats[entityId as number];\n break;\n case 'user':\n entity = localDb.users[entityId as number];\n break;\n case 'msg':\n entity = localDb.messages[entityId as string];\n break;\n case 'sticker':\n case 'gif':\n case 'wallpaper':\n entity = localDb.documents[entityId as string];\n break;\n case 'photo':\n entity = localDb.photos[entityId as string];\n break;\n case 'stickerSet':\n entity = localDb.stickerSets[entityId as string];\n break;\n case 'webDocument':\n entity = localDb.webDocuments[entityId as string];\n break;\n }\n\n if (!entity) {\n return undefined;\n }\n\n if (MEDIA_ENTITY_TYPES.has(entityType)) {\n if (mediaFormat === ApiMediaFormat.Stream) {\n onProgress!.acceptsBuffer = true;\n }\n\n const data = await client.downloadMedia(entity, {\n sizeType, start, end, progressCallback: onProgress, workers: DOWNLOAD_WORKERS,\n });\n let mimeType;\n let fullSize;\n\n if (entity instanceof GramJs.Message) {\n mimeType = getMessageMediaMimeType(entity, sizeType);\n if (entity.media instanceof GramJs.MessageMediaDocument && entity.media.document instanceof GramJs.Document) {\n fullSize = entity.media.document.size;\n }\n if (entity.media instanceof GramJs.MessageMediaWebPage\n && entity.media.webpage instanceof GramJs.WebPage\n && entity.media.webpage.document instanceof GramJs.Document) {\n fullSize = entity.media.webpage.document.size;\n }\n } else if (entity instanceof GramJs.Photo) {\n mimeType = 'image/jpeg';\n } else if (entityType === 'sticker' && sizeType) {\n mimeType = 'image/webp';\n } else if (entityType === 'webDocument') {\n mimeType = (entity as GramJs.TypeWebDocument).mimeType;\n } else {\n mimeType = (entity as GramJs.Document).mimeType;\n fullSize = (entity as GramJs.Document).size;\n }\n\n // Prevent HTML-in-video attacks\n if (!isHtmlAllowed && mimeType) {\n mimeType = mimeType.replace(/html/gi, '');\n }\n\n return { mimeType, data, fullSize };\n } else if (entityType === 'stickerSet') {\n const data = await client.downloadStickerSetThumb(entity);\n const mimeType = mediaFormat === ApiMediaFormat.Lottie ? 'application/json' : getMimeType(data);\n\n return { mimeType, data };\n } else {\n const data = await client.downloadProfilePhoto(entity, mediaMatch[1] === 'profile');\n const mimeType = getMimeType(data);\n\n return { mimeType, data };\n }\n}\n\nfunction getMessageMediaMimeType(message: GramJs.Message, sizeType?: string) {\n if (!message || !message.media) {\n return undefined;\n }\n\n if (message.media instanceof GramJs.MessageMediaPhoto) {\n return 'image/jpeg';\n }\n\n if (message.media instanceof GramJs.MessageMediaDocument && message.media.document instanceof GramJs.Document) {\n if (sizeType) {\n return message.media.document!.attributes.some((a) => a instanceof GramJs.DocumentAttributeSticker)\n ? 'image/webp'\n : 'image/jpeg';\n }\n\n return message.media.document!.mimeType;\n }\n\n if (message.media instanceof GramJs.MessageMediaWebPage\n && message.media.webpage instanceof GramJs.WebPage\n && message.media.webpage.document instanceof GramJs.Document) {\n return message.media.webpage.document.mimeType;\n }\n\n return undefined;\n}\n\n// eslint-disable-next-line no-async-without-await/no-async-without-await\nasync function parseMedia(\n data: Buffer, mediaFormat: ApiMediaFormat, mimeType?: string,\n): Promise {\n switch (mediaFormat) {\n case ApiMediaFormat.DataUri:\n return blobToDataUri(new Blob([data], { type: mimeType }));\n case ApiMediaFormat.BlobUrl:\n return new Blob([data], { type: mimeType });\n case ApiMediaFormat.Lottie: {\n const json = inflate(data, { to: 'string' });\n return JSON.parse(json);\n }\n case ApiMediaFormat.Progressive: {\n return data.buffer;\n }\n }\n\n return undefined;\n}\n\nfunction prepareMedia(mediaData: ApiParsedMedia): ApiPreparedMedia {\n if (mediaData instanceof Blob) {\n return URL.createObjectURL(mediaData);\n }\n\n return mediaData;\n}\n\nfunction getMimeType(data: Uint8Array, fallbackMimeType = 'image/jpeg') {\n if (data.length < 4) {\n return fallbackMimeType;\n }\n\n let type = fallbackMimeType;\n const signature = data.subarray(0, 4).reduce((result, byte) => result + byte.toString(16), '');\n\n // https://en.wikipedia.org/wiki/List_of_file_signatures\n switch (signature) {\n case '89504e47':\n type = 'image/png';\n break;\n case '47494638':\n type = 'image/gif';\n break;\n case 'ffd8ffe0':\n case 'ffd8ffe1':\n case 'ffd8ffe2':\n case 'ffd8ffe3':\n case 'ffd8ffe8':\n type = 'image/jpeg';\n break;\n case '52494646':\n // In our case only webp is expected\n type = 'image/webp';\n break;\n }\n\n return type;\n}\n","import {\n TelegramClient, sessions, Api as GramJs, connection,\n} from '../../../lib/gramjs';\nimport { Logger as GramJsLogger } from '../../../lib/gramjs/extensions/index';\nimport { TwoFaParams } from '../../../lib/gramjs/client/2fa';\n\nimport {\n ApiInitialArgs,\n ApiMediaFormat,\n ApiOnProgress,\n ApiSessionData,\n OnApiUpdate,\n} from '../../types';\n\nimport {\n DEBUG, DEBUG_GRAMJS, UPLOAD_WORKERS, IS_TEST, APP_VERSION,\n} from '../../../config';\nimport {\n onRequestPhoneNumber, onRequestCode, onRequestPassword, onRequestRegistration,\n onAuthError, onAuthReady, onCurrentUserUpdate, onRequestQrCode,\n} from './auth';\nimport { updater } from '../updater';\nimport { setMessageBuilderCurrentUserId } from '../apiBuilders/messages';\nimport downloadMediaWithClient from './media';\nimport { buildApiUserFromFull } from '../apiBuilders/users';\nimport localDb from '../localDb';\n\nconst DEFAULT_USER_AGENT = 'Unknown UserAgent';\nconst APP_CODE_NAME = 'Z';\n\nGramJsLogger.setLevel(DEBUG_GRAMJS ? 'debug' : 'warn');\n\nconst gramJsUpdateEventBuilder = { build: (update: object) => update };\n\nlet onUpdate: OnApiUpdate;\nlet client: TelegramClient;\nlet isConnected = false;\n\nexport async function init(_onUpdate: OnApiUpdate, initialArgs: ApiInitialArgs) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START INIT API');\n }\n\n onUpdate = _onUpdate;\n\n const { userAgent, platform, sessionData } = initialArgs;\n const session = new sessions.CallbackSession(sessionData, onSessionUpdate);\n\n client = new TelegramClient(\n session,\n process.env.TELEGRAM_T_API_ID,\n process.env.TELEGRAM_T_API_HASH,\n {\n deviceModel: navigator.userAgent || userAgent || DEFAULT_USER_AGENT,\n appVersion: `${APP_VERSION} ${APP_CODE_NAME}`,\n useWSS: true,\n additionalDcsDisabled: IS_TEST,\n } as any,\n );\n\n client.addEventHandler(handleGramJsUpdate, gramJsUpdateEventBuilder);\n client.addEventHandler(updater, gramJsUpdateEventBuilder);\n\n try {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[GramJs/client] CONNECTING');\n\n // eslint-disable-next-line no-restricted-globals\n (self as any).invoke = invokeRequest;\n // eslint-disable-next-line no-restricted-globals\n (self as any).GramJs = GramJs;\n }\n\n try {\n await client.start({\n phoneNumber: onRequestPhoneNumber,\n phoneCode: onRequestCode,\n password: onRequestPassword,\n firstAndLastNames: onRequestRegistration,\n qrCode: onRequestQrCode,\n onError: onAuthError,\n initialMethod: platform === 'iOS' || platform === 'Android' ? 'phoneNumber' : 'qrCode',\n });\n } catch (err) {\n // TODO Investigate which request causes this exception\n if (err.message !== 'Disconnect') {\n onUpdate({\n '@type': 'updateConnectionState',\n connectionState: 'connectionStateBroken',\n });\n\n return;\n }\n }\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH INIT API');\n // eslint-disable-next-line no-console\n console.log('[GramJs/client] CONNECTED');\n }\n\n onAuthReady();\n onSessionUpdate(session.getSessionData());\n onUpdate({ '@type': 'updateApiReady' });\n\n void fetchCurrentUser();\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[GramJs/client] CONNECTING ERROR', err);\n }\n\n throw err;\n }\n}\n\nexport async function destroy() {\n await invokeRequest(new GramJs.auth.LogOut());\n await client.destroy();\n}\n\nexport async function disconnect() {\n await client.disconnect();\n}\n\nexport function getClient() {\n return client;\n}\n\nfunction onSessionUpdate(sessionData: ApiSessionData) {\n onUpdate({\n '@type': 'updateSession',\n sessionData,\n });\n}\n\nfunction handleGramJsUpdate(update: any) {\n if (update instanceof connection.UpdateConnectionState) {\n isConnected = update.state === connection.UpdateConnectionState.connected;\n } else if (update instanceof GramJs.UpdatesTooLong) {\n void handleTerminatedSession();\n } else if (update instanceof connection.UpdateServerTimeOffset) {\n onUpdate({\n '@type': 'updateServerTimeOffset',\n serverTimeOffset: update.timeOffset,\n });\n }\n}\n\nexport async function invokeRequest(\n request: T,\n shouldHandleUpdates = false,\n shouldThrow = false,\n): Promise {\n if (!isConnected) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn(`[GramJs/client] INVOKE ERROR ${request.className}: Client is not connected`);\n }\n\n return undefined;\n }\n\n try {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log(`[GramJs/client] INVOKE ${request.className}`);\n }\n\n const result = await client.invoke(request);\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log(`[GramJs/client] INVOKE RESPONSE ${request.className}`, result);\n }\n\n if (shouldHandleUpdates) {\n type ResultWithUpdates =\n typeof result\n & { updates?: GramJs.Updates | GramJs.UpdatesCombined };\n\n let updatesContainer;\n if (result instanceof GramJs.Updates || result instanceof GramJs.UpdatesCombined) {\n updatesContainer = result;\n } else if ('updates' in (result as ResultWithUpdates) && (\n (result as ResultWithUpdates).updates instanceof GramJs.Updates\n || (result as ResultWithUpdates).updates instanceof GramJs.UpdatesCombined\n )) {\n updatesContainer = (result as ResultWithUpdates).updates;\n }\n\n if (updatesContainer) {\n injectUpdateEntities(updatesContainer);\n\n updatesContainer.updates.forEach((update) => {\n updater(update, request);\n });\n } else if (result instanceof GramJs.UpdatesTooLong) {\n // TODO Implement\n } else {\n updater(result as GramJs.TypeUpdates, request);\n }\n }\n\n return result;\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log(`[GramJs/client] INVOKE ERROR ${request.className}`);\n // eslint-disable-next-line no-console\n console.error(err);\n }\n\n dispatchErrorUpdate(err, request);\n\n if (shouldThrow) {\n throw err;\n }\n\n return undefined;\n }\n}\n\nexport function downloadMedia(\n args: { url: string; mediaFormat: ApiMediaFormat; start?: number; end?: number; isHtmlAllowed?: boolean },\n onProgress?: ApiOnProgress,\n) {\n return downloadMediaWithClient(args, client, isConnected, onProgress);\n}\n\nexport function uploadFile(file: File, onProgress?: ApiOnProgress) {\n return client.uploadFile({ file, onProgress, workers: UPLOAD_WORKERS });\n}\n\nexport function updateTwoFaSettings(params: TwoFaParams) {\n return client.updateTwoFaSettings(params);\n}\n\nexport async function fetchCurrentUser() {\n const userFull = await invokeRequest(new GramJs.users.GetFullUser({\n id: new GramJs.InputUserSelf(),\n }));\n\n if (!userFull || !(userFull.user instanceof GramJs.User)) {\n return;\n }\n\n localDb.users[userFull.user.id] = userFull.user;\n const currentUser = buildApiUserFromFull(userFull);\n\n setMessageBuilderCurrentUserId(currentUser.id);\n onCurrentUserUpdate(currentUser);\n}\n\nexport function dispatchErrorUpdate(err: Error, request: T) {\n const isSlowMode = err.message.startsWith('A wait of') && (\n request instanceof GramJs.messages.SendMessage\n || request instanceof GramJs.messages.SendMedia\n || request instanceof GramJs.messages.SendMultiMedia\n );\n\n const { message } = err;\n\n onUpdate({\n '@type': 'error',\n error: {\n message,\n isSlowMode,\n hasErrorKey: true,\n },\n });\n}\n\nfunction injectUpdateEntities(result: GramJs.Updates | GramJs.UpdatesCombined) {\n const entities = [...result.users, ...result.chats];\n\n result.updates.forEach((update) => {\n if (entities) {\n // eslint-disable-next-line no-underscore-dangle\n (update as any)._entities = entities;\n }\n });\n}\n\nasync function handleTerminatedSession() {\n try {\n await invokeRequest(new GramJs.users.GetFullUser({\n id: new GramJs.InputUserSelf(),\n }), undefined, true);\n } catch (err) {\n if (err.message === 'AUTH_KEY_UNREGISTERED') {\n onUpdate({\n '@type': 'updateConnectionState',\n connectionState: 'connectionStateBroken',\n });\n }\n }\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\nimport {\n OnApiUpdate,\n ApiChat,\n ApiMessage,\n ApiUser,\n ApiMessageEntity,\n ApiFormattedText,\n ApiChatFullInfo,\n ApiChatFolder,\n ApiChatBannedRights,\n ApiChatAdminRights,\n} from '../../types';\n\nimport { DEBUG, ARCHIVED_FOLDER_ID, MEMBERS_LOAD_SLICE } from '../../../config';\nimport { invokeRequest, uploadFile } from './client';\nimport {\n buildApiChatFromDialog,\n getPeerKey,\n buildChatMembers,\n buildApiChatFromPreview,\n getApiChatIdFromMtpPeer,\n buildApiChatFolder,\n buildApiChatFolderFromSuggested,\n buildApiChatBotCommands,\n} from '../apiBuilders/chats';\nimport { buildApiMessage, buildMessageDraft } from '../apiBuilders/messages';\nimport { buildApiUser } from '../apiBuilders/users';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport localDb from '../localDb';\nimport {\n buildInputEntity,\n buildInputPeer,\n buildMtpMessageEntity,\n buildFilterFromApiFolder,\n isMessageWithMedia,\n buildChatBannedRights,\n buildChatAdminRights,\n} from '../gramjsBuilders';\nimport { addMessageToLocalDb } from '../helpers';\n\nconst MAX_INT_32 = 2 ** 31 - 1;\nlet onUpdate: OnApiUpdate;\n\nexport function init(_onUpdate: OnApiUpdate) {\n onUpdate = _onUpdate;\n}\n\nexport async function fetchChats({\n limit,\n offsetDate,\n archived,\n withPinned,\n serverTimeOffset,\n}: {\n limit: number;\n offsetDate?: number;\n archived?: boolean;\n withPinned?: boolean;\n serverTimeOffset: number;\n}) {\n const result = await invokeRequest(new GramJs.messages.GetDialogs({\n offsetPeer: new GramJs.InputPeerEmpty(),\n limit,\n offsetDate,\n folderId: archived ? ARCHIVED_FOLDER_ID : undefined,\n ...(withPinned && { excludePinned: true }),\n }));\n const resultPinned = withPinned\n ? await invokeRequest(new GramJs.messages.GetPinnedDialogs({\n folderId: archived ? ARCHIVED_FOLDER_ID : undefined,\n }))\n : undefined;\n\n if (!result || result instanceof GramJs.messages.DialogsNotModified) {\n return undefined;\n }\n\n if (resultPinned) {\n updateLocalDb(resultPinned);\n }\n updateLocalDb(result);\n\n const lastMessagesByChatId = buildCollectionByKey(\n (resultPinned ? resultPinned.messages : []).concat(result.messages)\n .map(buildApiMessage)\n .filter(Boolean as any),\n 'chatId',\n );\n const peersByKey: Record = {\n ...(resultPinned && preparePeers(resultPinned)),\n ...preparePeers(result),\n };\n const chats: ApiChat[] = [];\n const draftsById: Record = {};\n const replyingToById: Record = {};\n\n const dialogs = (resultPinned ? resultPinned.dialogs : []).concat(result.dialogs);\n\n const orderedPinnedIds: number[] = [];\n\n dialogs.forEach((dialog) => {\n if (\n !(dialog instanceof GramJs.Dialog)\n // This request can return dialogs not belonging to specified folder\n || (!archived && dialog.folderId === ARCHIVED_FOLDER_ID)\n || (archived && dialog.folderId !== ARCHIVED_FOLDER_ID)\n ) {\n return;\n }\n\n const peerEntity = peersByKey[getPeerKey(dialog.peer)];\n const chat = buildApiChatFromDialog(dialog, peerEntity, serverTimeOffset);\n chat.lastMessage = lastMessagesByChatId[chat.id];\n chat.isListed = true;\n chats.push(chat);\n\n if (withPinned && dialog.pinned) {\n orderedPinnedIds.push(chat.id);\n }\n\n if (dialog.draft) {\n const { formattedText, replyingToId } = buildMessageDraft(dialog.draft) || {};\n if (formattedText) {\n draftsById[chat.id] = formattedText;\n }\n if (replyingToId) {\n replyingToById[chat.id] = replyingToId;\n }\n }\n });\n\n const users = (resultPinned ? resultPinned.users : []).concat(result.users)\n .map(buildApiUser)\n .filter(Boolean as any);\n const chatIds = chats.map((chat) => chat.id);\n\n let totalChatCount: number;\n\n if (result instanceof GramJs.messages.DialogsSlice) {\n totalChatCount = result.count;\n } else {\n totalChatCount = chatIds.length;\n }\n\n return {\n chatIds,\n chats,\n users,\n draftsById,\n replyingToById,\n orderedPinnedIds: withPinned ? orderedPinnedIds : undefined,\n totalChatCount,\n };\n}\n\nexport function fetchFullChat(chat: ApiChat) {\n const { id, accessHash, adminRights } = chat;\n\n const input = buildInputEntity(id, accessHash);\n\n return input instanceof GramJs.InputChannel\n ? getFullChannelInfo(id, accessHash!, adminRights)\n : getFullChatInfo(id);\n}\n\nexport async function searchChats({ query }: { query: string }) {\n const result = await invokeRequest(new GramJs.contacts.Search({ q: query }));\n if (!result) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n const localPeerIds = result.myResults.map(getApiChatIdFromMtpPeer);\n const allChats = result.chats.concat(result.users)\n .map((user) => buildApiChatFromPreview(user))\n .filter(Boolean as any);\n const allUsers = result.users.map(buildApiUser).filter((user) => !!user && !user.isSelf) as ApiUser[];\n\n return {\n localChats: allChats.filter((r) => localPeerIds.includes(r.id)),\n localUsers: allUsers.filter((u) => localPeerIds.includes(u.id)),\n globalChats: allChats.filter((r) => !localPeerIds.includes(r.id)),\n globalUsers: allUsers.filter((u) => !localPeerIds.includes(u.id)),\n };\n}\n\nexport async function fetchChat({\n type, user,\n}: {\n type: 'user' | 'self' | 'support'; user?: ApiUser;\n}) {\n let mtpUser: GramJs.User | undefined;\n\n if (type === 'self' || type === 'user') {\n const result = await invokeRequest(new GramJs.users.GetUsers({\n id: [\n type === 'user' && user\n ? buildInputEntity(user.id, user.accessHash) as GramJs.InputUser\n : new GramJs.InputUserSelf(),\n ],\n }));\n if (!result || !result.length) {\n return undefined;\n }\n\n [mtpUser] = result;\n } else if (type === 'support') {\n const result = await invokeRequest(new GramJs.help.GetSupport());\n if (!result || !result.user) {\n return undefined;\n }\n\n mtpUser = result.user;\n }\n\n const chat = buildApiChatFromPreview(mtpUser!, type === 'support');\n if (!chat) {\n return undefined;\n }\n\n onUpdate({\n '@type': 'updateChat',\n id: chat.id,\n chat,\n });\n\n return { chatId: chat.id };\n}\n\nexport async function requestChatUpdate({\n chat,\n serverTimeOffset,\n}: {\n chat: ApiChat; serverTimeOffset: number;\n}) {\n const { id, accessHash } = chat;\n\n const result = await invokeRequest(new GramJs.messages.GetPeerDialogs({\n peers: [new GramJs.InputDialogPeer({\n peer: buildInputPeer(id, accessHash),\n })],\n }));\n\n if (!result) {\n return;\n }\n\n const dialog = result.dialogs[0];\n if (!dialog || !(dialog instanceof GramJs.Dialog)) {\n return;\n }\n\n const peersByKey = preparePeers(result);\n const peerEntity = peersByKey[getPeerKey(dialog.peer)];\n if (!peerEntity) {\n return;\n }\n\n updateLocalDb(result);\n\n const lastMessage = buildApiMessage(result.messages[0]);\n\n onUpdate({\n '@type': 'updateChat',\n id,\n chat: {\n ...buildApiChatFromDialog(dialog, peerEntity, serverTimeOffset),\n lastMessage,\n },\n });\n}\n\nexport function saveDraft({\n chat,\n text,\n entities,\n replyToMsgId,\n}: {\n chat: ApiChat;\n text: string;\n entities?: ApiMessageEntity[];\n replyToMsgId?: number;\n}) {\n return invokeRequest(new GramJs.messages.SaveDraft({\n peer: buildInputPeer(chat.id, chat.accessHash),\n message: text,\n ...(entities && {\n entities: entities.map(buildMtpMessageEntity),\n }),\n replyToMsgId,\n }));\n}\n\nexport function clearDraft(chat: ApiChat) {\n return invokeRequest(new GramJs.messages.SaveDraft({\n peer: buildInputPeer(chat.id, chat.accessHash),\n message: '',\n }));\n}\n\nasync function getFullChatInfo(chatId: number): Promise<{\n fullInfo: ApiChatFullInfo;\n users?: ApiUser[];\n} | undefined> {\n const result = await invokeRequest(new GramJs.messages.GetFullChat({\n chatId: buildInputEntity(chatId) as number,\n }));\n\n if (!result || !(result.fullChat instanceof GramJs.ChatFull)) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n const {\n about,\n participants,\n exportedInvite,\n botInfo,\n } = result.fullChat;\n\n const members = buildChatMembers(participants);\n const adminMembers = members ? members.filter(({ isAdmin, isOwner }) => isAdmin || isOwner) : undefined;\n const botCommands = botInfo ? buildApiChatBotCommands(botInfo) : undefined;\n\n return {\n fullInfo: {\n about,\n members,\n adminMembers,\n canViewMembers: true,\n botCommands,\n ...(exportedInvite && {\n inviteLink: exportedInvite.link,\n }),\n },\n users: result.users.map(buildApiUser).filter(Boolean as any),\n };\n}\n\nasync function getFullChannelInfo(\n id: number,\n accessHash: string,\n adminRights?: ApiChatAdminRights,\n) {\n const result = await invokeRequest(new GramJs.channels.GetFullChannel({\n channel: buildInputEntity(id, accessHash) as GramJs.InputChannel,\n }));\n\n if (!result || !(result.fullChat instanceof GramJs.ChannelFull)) {\n return undefined;\n }\n\n const {\n about,\n onlineCount,\n exportedInvite,\n slowmodeSeconds,\n slowmodeNextSendDate,\n migratedFromChatId,\n migratedFromMaxId,\n canViewParticipants,\n linkedChatId,\n hiddenPrehistory,\n call,\n botInfo,\n } = result.fullChat;\n\n const inviteLink = exportedInvite instanceof GramJs.ChatInviteExported\n ? exportedInvite.link\n : undefined;\n\n const { members, users } = (canViewParticipants && await fetchMembers(id, accessHash)) || {};\n const { members: kickedMembers, users: bannedUsers } = (\n canViewParticipants && adminRights && await fetchMembers(id, accessHash, 'kicked')\n ) || {};\n const { members: adminMembers, users: adminUsers } = (\n canViewParticipants && adminRights && await fetchMembers(id, accessHash, 'admin')\n ) || {};\n const botCommands = botInfo ? buildApiChatBotCommands(botInfo) : undefined;\n\n return {\n fullInfo: {\n about,\n onlineCount,\n inviteLink,\n slowMode: slowmodeSeconds ? {\n seconds: slowmodeSeconds,\n nextSendDate: slowmodeNextSendDate,\n } : undefined,\n migratedFrom: migratedFromChatId ? {\n chatId: getApiChatIdFromMtpPeer({ chatId: migratedFromChatId } as GramJs.TypePeer),\n maxMessageId: migratedFromMaxId,\n } : undefined,\n canViewMembers: canViewParticipants,\n isPreHistoryHidden: hiddenPrehistory,\n members,\n kickedMembers,\n adminMembers,\n groupCallId: call ? call.id.toString() : undefined,\n linkedChatId: linkedChatId ? getApiChatIdFromMtpPeer({ chatId: linkedChatId } as GramJs.TypePeer) : undefined,\n botCommands,\n },\n users: [...(users || []), ...(bannedUsers || []), ...(adminUsers || [])],\n };\n}\n\nexport async function updateChatMutedState({\n chat, isMuted, serverTimeOffset,\n}: {\n chat: ApiChat; isMuted: boolean; serverTimeOffset: number;\n}) {\n await invokeRequest(new GramJs.account.UpdateNotifySettings({\n peer: new GramJs.InputNotifyPeer({\n peer: buildInputPeer(chat.id, chat.accessHash),\n }),\n settings: new GramJs.InputPeerNotifySettings({ muteUntil: isMuted ? MAX_INT_32 : 0 }),\n }));\n\n onUpdate({\n '@type': 'updateNotifyExceptions',\n chatId: chat.id,\n isMuted,\n });\n\n void requestChatUpdate({\n chat,\n serverTimeOffset,\n });\n}\n\nexport async function createChannel({\n title, about, users,\n}: {\n title: string; about?: string; users: ApiUser[];\n}): Promise {\n const result = await invokeRequest(new GramJs.channels.CreateChannel({\n broadcast: true,\n title,\n about,\n }), true);\n\n // `createChannel` can return a lot of different update types according to docs,\n // but currently channel creation returns only `Updates` type.\n // Errors are added to catch unexpected cases in future testing\n if (!(result instanceof GramJs.Updates)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('Unexpected channel creation update', result);\n }\n return undefined;\n }\n\n const newChannel = result.chats[0];\n if (!newChannel || !(newChannel instanceof GramJs.Channel)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('Created channel not found', result);\n }\n return undefined;\n }\n\n const channel = buildApiChatFromPreview(newChannel)!;\n\n await invokeRequest(new GramJs.channels.InviteToChannel({\n channel: buildInputEntity(channel.id, channel.accessHash) as GramJs.InputChannel,\n users: users.map(({ id, accessHash }) => buildInputEntity(id, accessHash)) as GramJs.InputUser[],\n }));\n\n return channel;\n}\n\nexport function joinChannel({\n channelId, accessHash,\n}: {\n channelId: number; accessHash: string;\n}) {\n return invokeRequest(new GramJs.channels.JoinChannel({\n channel: buildInputEntity(channelId, accessHash) as GramJs.InputChannel,\n }), true);\n}\n\nexport function deleteChatUser({\n chat, user,\n}: {\n chat: ApiChat; user: ApiUser;\n}) {\n if (chat.type !== 'chatTypeBasicGroup') return undefined;\n return invokeRequest(new GramJs.messages.DeleteChatUser({\n chatId: buildInputEntity(chat.id, chat.accessHash) as number,\n userId: buildInputEntity(user.id, user.accessHash) as GramJs.InputUser,\n }), true);\n}\n\nexport function deleteChat({\n chatId,\n}: {\n chatId: number;\n}) {\n return invokeRequest(new GramJs.messages.DeleteChat({\n chatId: buildInputEntity(chatId) as number,\n }), true);\n}\n\nexport function leaveChannel({\n channelId, accessHash,\n}: {\n channelId: number; accessHash: string;\n}) {\n return invokeRequest(new GramJs.channels.LeaveChannel({\n channel: buildInputEntity(channelId, accessHash) as GramJs.InputChannel,\n }), true);\n}\n\nexport function deleteChannel({\n channelId, accessHash,\n}: {\n channelId: number; accessHash: string;\n}) {\n return invokeRequest(new GramJs.channels.DeleteChannel({\n channel: buildInputEntity(channelId, accessHash) as GramJs.InputChannel,\n }), true);\n}\n\nexport async function createGroupChat({\n title, users,\n}: {\n title: string; users: ApiUser[];\n}): Promise {\n const result = await invokeRequest(new GramJs.messages.CreateChat({\n title,\n users: users.map(({ id, accessHash }) => buildInputEntity(id, accessHash)) as GramJs.InputUser[],\n }), true);\n\n // `createChat` can return a lot of different update types according to docs,\n // but currently chat creation returns only `Updates` type.\n // Errors are added to catch unexpected cases in future testing\n if (!(result instanceof GramJs.Updates)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('Unexpected chat creation update', result);\n }\n return undefined;\n }\n\n const newChat = result.chats[0];\n if (!newChat || !(newChat instanceof GramJs.Chat)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('Created chat not found', result);\n }\n return undefined;\n }\n\n return buildApiChatFromPreview(newChat);\n}\n\nexport async function editChatPhoto({\n chatId, accessHash, photo,\n}: {\n chatId: number; accessHash?: string; photo: File;\n}) {\n const uploadedPhoto = await uploadFile(photo);\n const inputEntity = buildInputEntity(chatId, accessHash);\n\n return invokeRequest(\n inputEntity instanceof GramJs.InputChannel\n ? new GramJs.channels.EditPhoto({\n channel: inputEntity as GramJs.InputChannel,\n photo: new GramJs.InputChatUploadedPhoto({\n file: uploadedPhoto,\n }),\n })\n : new GramJs.messages.EditChatPhoto({\n chatId: inputEntity as number,\n photo: new GramJs.InputChatUploadedPhoto({\n file: uploadedPhoto,\n }),\n }),\n true,\n );\n}\n\nexport async function toggleChatPinned({\n chat,\n shouldBePinned,\n}: {\n chat: ApiChat;\n shouldBePinned: boolean;\n}) {\n const { id, accessHash } = chat;\n\n const isActionSuccessful = await invokeRequest(new GramJs.messages.ToggleDialogPin({\n peer: new GramJs.InputDialogPeer({\n peer: buildInputPeer(id, accessHash),\n }),\n pinned: shouldBePinned || undefined,\n }));\n\n if (isActionSuccessful) {\n onUpdate({\n '@type': 'updateChatPinned',\n id: chat.id,\n isPinned: shouldBePinned,\n });\n }\n}\n\nexport function toggleChatArchived({\n chat, folderId,\n}: {\n chat: ApiChat; folderId: number;\n}) {\n const { id, accessHash } = chat;\n\n return invokeRequest(new GramJs.folders.EditPeerFolders({\n folderPeers: [new GramJs.InputFolderPeer({\n peer: buildInputPeer(id, accessHash),\n folderId,\n })],\n }), true);\n}\n\nexport async function fetchChatFolders() {\n const result = await invokeRequest(new GramJs.messages.GetDialogFilters());\n\n if (!result) {\n return undefined;\n }\n\n return {\n byId: buildCollectionByKey(result.map(buildApiChatFolder), 'id') as Record,\n orderedIds: result.map(({ id }) => id),\n };\n}\n\nexport async function fetchRecommendedChatFolders() {\n const results = await invokeRequest(new GramJs.messages.GetSuggestedDialogFilters());\n\n if (!results) {\n return undefined;\n }\n\n return results.map(buildApiChatFolderFromSuggested);\n}\n\nexport async function editChatFolder({\n id,\n folderUpdate,\n}: {\n id: number;\n folderUpdate: ApiChatFolder;\n}) {\n const filter = buildFilterFromApiFolder(folderUpdate);\n\n const isActionSuccessful = await invokeRequest(new GramJs.messages.UpdateDialogFilter({\n id,\n filter,\n }));\n\n if (isActionSuccessful) {\n onUpdate({\n '@type': 'updateChatFolder',\n id,\n folder: folderUpdate,\n });\n }\n}\n\nexport async function deleteChatFolder(id: number) {\n const isActionSuccessful = await invokeRequest(new GramJs.messages.UpdateDialogFilter({\n id,\n filter: undefined,\n }));\n const recommendedChatFolders = await fetchRecommendedChatFolders();\n\n if (isActionSuccessful) {\n onUpdate({\n '@type': 'updateChatFolder',\n id,\n folder: undefined,\n });\n }\n if (recommendedChatFolders) {\n onUpdate({\n '@type': 'updateRecommendedChatFolders',\n folders: recommendedChatFolders,\n });\n }\n}\n\nexport async function toggleDialogUnread({\n chat, hasUnreadMark,\n}: {\n chat: ApiChat; hasUnreadMark: boolean | undefined;\n}) {\n const { id, accessHash } = chat;\n\n const isActionSuccessful = await invokeRequest(new GramJs.messages.MarkDialogUnread({\n peer: new GramJs.InputDialogPeer({\n peer: buildInputPeer(id, accessHash),\n }),\n unread: hasUnreadMark || undefined,\n }));\n\n if (isActionSuccessful) {\n onUpdate({\n '@type': 'updateChat',\n id: chat.id,\n chat: { hasUnreadMark },\n });\n }\n}\n\nexport async function getChatByUsername(username: string) {\n const result = await invokeRequest(new GramJs.contacts.ResolveUsername({\n username,\n }));\n\n if (!result) {\n return undefined;\n }\n\n const { users, chats } = result;\n\n const chat = chats.length\n ? buildApiChatFromPreview(chats[0])\n : buildApiChatFromPreview(users[0]);\n\n if (!chat) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n return chat;\n}\n\nexport function togglePreHistoryHidden({\n chat, isEnabled,\n}: { chat: ApiChat; isEnabled: boolean }) {\n const { id, accessHash } = chat;\n const channel = buildInputEntity(id, accessHash);\n\n return invokeRequest(new GramJs.channels.TogglePreHistoryHidden({\n channel: channel as GramJs.InputChannel,\n enabled: isEnabled,\n }), true);\n}\n\nexport function updateChatDefaultBannedRights({\n chat, bannedRights,\n}: { chat: ApiChat; bannedRights: ApiChatBannedRights }) {\n const { id, accessHash } = chat;\n const peer = buildInputPeer(id, accessHash);\n\n return invokeRequest(new GramJs.messages.EditChatDefaultBannedRights({\n peer,\n bannedRights: buildChatBannedRights(bannedRights),\n }), true);\n}\n\nexport function updateChatMemberBannedRights({\n chat, user, bannedRights, untilDate,\n}: { chat: ApiChat; user: ApiUser; bannedRights: ApiChatBannedRights; untilDate?: number }) {\n const channel = buildInputEntity(chat.id, chat.accessHash) as GramJs.InputChannel;\n const participant = buildInputPeer(user.id, user.accessHash) as GramJs.InputUser;\n\n return invokeRequest(new GramJs.channels.EditBanned({\n channel,\n participant,\n bannedRights: buildChatBannedRights(bannedRights, untilDate),\n }), true);\n}\n\nexport function updateChatAdmin({\n chat, user, adminRights, customTitle = '',\n}: { chat: ApiChat; user: ApiUser; adminRights: ApiChatAdminRights; customTitle: string }) {\n const channel = buildInputEntity(chat.id, chat.accessHash) as GramJs.InputChannel;\n const userId = buildInputEntity(user.id, user.accessHash) as GramJs.InputUser;\n\n return invokeRequest(new GramJs.channels.EditAdmin({\n channel,\n userId,\n adminRights: buildChatAdminRights(adminRights),\n rank: customTitle,\n }), true);\n}\n\nexport async function updateChatTitle(chat: ApiChat, title: string) {\n const inputEntity = buildInputEntity(chat.id, chat.accessHash);\n await invokeRequest(\n inputEntity instanceof GramJs.InputChannel\n ? new GramJs.channels.EditTitle({\n channel: inputEntity as GramJs.InputChannel,\n title,\n }) : new GramJs.messages.EditChatTitle({\n chatId: inputEntity as number,\n title,\n }),\n true,\n );\n}\n\nexport async function updateChatAbout(chat: ApiChat, about: string) {\n const result = await invokeRequest(new GramJs.messages.EditChatAbout({\n peer: buildInputPeer(chat.id, chat.accessHash),\n about,\n }));\n\n if (!result) {\n return;\n }\n\n onUpdate({\n '@type': 'updateChatFullInfo',\n id: chat.id,\n fullInfo: {\n about,\n },\n });\n}\n\nexport function toggleSignatures({\n chat, isEnabled,\n}: { chat: ApiChat; isEnabled: boolean }) {\n const { id, accessHash } = chat;\n const channel = buildInputEntity(id, accessHash);\n\n return invokeRequest(new GramJs.channels.ToggleSignatures({\n channel: channel as GramJs.InputChannel,\n enabled: isEnabled,\n }), true);\n}\n\ntype ChannelMembersFilter =\n 'kicked'\n | 'admin'\n | 'recent';\n\nexport async function fetchMembers(\n chatId: number,\n accessHash: string,\n memberFilter: ChannelMembersFilter = 'recent',\n offset?: number,\n) {\n let filter: GramJs.TypeChannelParticipantsFilter;\n\n switch (memberFilter) {\n case 'kicked':\n filter = new GramJs.ChannelParticipantsKicked({ q: '' });\n break;\n case 'admin':\n filter = new GramJs.ChannelParticipantsAdmins();\n break;\n default:\n filter = new GramJs.ChannelParticipantsRecent();\n break;\n }\n\n const result = await invokeRequest(new GramJs.channels.GetParticipants({\n channel: buildInputEntity(chatId, accessHash) as GramJs.InputChannel,\n filter,\n offset,\n limit: MEMBERS_LOAD_SLICE,\n }));\n\n if (!result || result instanceof GramJs.channels.ChannelParticipantsNotModified) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n return {\n members: buildChatMembers(result),\n users: result.users.map(buildApiUser).filter(Boolean as any),\n };\n}\n\nexport async function fetchGroupsForDiscussion() {\n const result = await invokeRequest(new GramJs.channels.GetGroupsForDiscussion());\n\n if (!result) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n return result.chats.map((chat) => buildApiChatFromPreview(chat));\n}\n\nexport function setDiscussionGroup({\n channel,\n chat,\n}: {\n channel: ApiChat;\n chat?: ApiChat;\n}) {\n return invokeRequest(new GramJs.channels.SetDiscussionGroup({\n broadcast: buildInputPeer(channel.id, channel.accessHash),\n group: chat ? buildInputPeer(chat.id, chat.accessHash) : new GramJs.InputChannelEmpty(),\n }));\n}\n\nexport async function migrateChat(chat: ApiChat) {\n const result = await invokeRequest(\n new GramJs.messages.MigrateChat({ chatId: buildInputEntity(chat.id) as number }), true,\n );\n\n // `migrateChat` can return a lot of different update types according to docs,\n // but currently chat migrations returns only `Updates` type.\n // Errors are added to catch unexpected cases in future testing\n if (!result || !(result instanceof GramJs.Updates)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('Unexpected channel creation update', result);\n }\n\n return undefined;\n }\n\n updateLocalDb(result);\n\n return buildApiChatFromPreview(result.chats[1]);\n}\n\nexport async function openChatByInvite(hash: string) {\n const result = await invokeRequest(new GramJs.messages.CheckChatInvite({ hash }));\n\n if (!result) {\n return undefined;\n }\n\n let chat: ApiChat | undefined;\n\n if (result instanceof GramJs.ChatInvite) {\n onUpdate({\n '@type': 'showInvite',\n data: {\n title: result.title,\n hash,\n participantsCount: result.participantsCount,\n isChannel: result.channel,\n },\n });\n } else {\n chat = buildApiChatFromPreview(result.chat);\n\n if (chat) {\n onUpdate({\n '@type': 'updateChat',\n id: chat.id,\n chat,\n });\n }\n }\n\n if (!chat) {\n return undefined;\n }\n\n return { chatId: chat.id };\n}\n\nexport function addChatMembers(chat: ApiChat, users: ApiUser[]) {\n if (chat.type === 'chatTypeChannel' || chat.type === 'chatTypeSuperGroup') {\n return invokeRequest(new GramJs.channels.InviteToChannel({\n channel: buildInputEntity(chat.id, chat.accessHash) as GramJs.InputChannel,\n users: users.map((user) => buildInputEntity(user.id, user.accessHash)) as GramJs.InputUser[],\n }), true);\n }\n\n return Promise.all(users.map((user) => {\n return invokeRequest(new GramJs.messages.AddChatUser({\n chatId: buildInputEntity(chat.id) as number,\n userId: buildInputEntity(user.id, user.accessHash) as GramJs.InputUser,\n }), true);\n }));\n}\n\nexport function deleteChatMember(chat: ApiChat, user: ApiUser) {\n if (chat.type === 'chatTypeChannel' || chat.type === 'chatTypeSuperGroup') {\n return updateChatMemberBannedRights({\n chat,\n user,\n bannedRights: {\n viewMessages: true,\n sendMessages: true,\n sendMedia: true,\n sendStickers: true,\n sendGifs: true,\n sendGames: true,\n sendInline: true,\n embedLinks: true,\n sendPolls: true,\n changeInfo: true,\n inviteUsers: true,\n pinMessages: true,\n },\n untilDate: MAX_INT_32,\n });\n } else {\n return invokeRequest(new GramJs.messages.DeleteChatUser({\n chatId: buildInputEntity(chat.id) as number,\n userId: buildInputEntity(user.id, user.accessHash) as GramJs.InputUser,\n }), true);\n }\n}\n\nfunction preparePeers(\n result: GramJs.messages.Dialogs | GramJs.messages.DialogsSlice | GramJs.messages.PeerDialogs,\n) {\n const store: Record = {};\n\n result.chats.forEach((chat) => {\n store[`chat${chat.id}`] = chat;\n });\n\n result.users.forEach((user) => {\n store[`user${user.id}`] = user;\n });\n\n return store;\n}\n\nfunction updateLocalDb(result: (\n GramJs.messages.Dialogs | GramJs.messages.DialogsSlice | GramJs.messages.PeerDialogs |\n GramJs.messages.ChatFull | GramJs.contacts.Found |\n GramJs.contacts.ResolvedPeer | GramJs.channels.ChannelParticipants |\n GramJs.messages.Chats | GramJs.messages.ChatsSlice | GramJs.TypeUpdates\n)) {\n if ('users' in result) {\n result.users.forEach((user) => {\n if (user instanceof GramJs.User) {\n localDb.users[user.id] = user;\n }\n });\n }\n\n if ('chats' in result) {\n result.chats.forEach((chat) => {\n if (chat instanceof GramJs.Chat || chat instanceof GramJs.Channel) {\n localDb.chats[chat.id] = chat;\n }\n });\n }\n\n if ('messages' in result) {\n result.messages.forEach((message) => {\n if (message instanceof GramJs.Message && isMessageWithMedia(message)) {\n addMessageToLocalDb(message);\n }\n });\n }\n}\n\nexport async function importChatInvite({ hash }: { hash: string }) {\n const updates = await invokeRequest(new GramJs.messages.ImportChatInvite({ hash }), true);\n if (!(updates instanceof GramJs.Updates) || !updates.chats.length) {\n return undefined;\n }\n\n const chat = buildApiChatFromPreview(updates.chats[0]);\n\n return chat;\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\nimport {\n ApiChat,\n ApiAttachment,\n ApiMessage,\n OnApiUpdate,\n ApiMessageSearchType,\n ApiUser,\n ApiSticker,\n ApiVideo,\n ApiNewPoll,\n ApiMessageEntity,\n ApiOnProgress,\n ApiThreadInfo,\n MAIN_THREAD_ID,\n MESSAGE_DELETED,\n ApiGlobalMessageSearchType,\n ApiReportReason,\n} from '../../types';\n\nimport { ALL_FOLDER_ID, DEBUG, PINNED_MESSAGES_LIMIT } from '../../../config';\nimport { invokeRequest, uploadFile } from './client';\nimport {\n buildApiMessage,\n buildLocalMessage,\n buildWebPage,\n buildForwardedMessage,\n} from '../apiBuilders/messages';\nimport { buildApiUser } from '../apiBuilders/users';\nimport {\n buildInputEntity,\n buildInputPeer,\n generateRandomBigInt,\n getEntityTypeById,\n buildInputMediaDocument,\n buildInputPoll,\n buildMtpMessageEntity,\n isMessageWithMedia,\n isServiceMessageWithMedia,\n calculateResultHash,\n buildInputReportReason,\n} from '../gramjsBuilders';\nimport localDb from '../localDb';\nimport { buildApiChatFromPreview } from '../apiBuilders/chats';\nimport { fetchFile } from '../../../util/files';\nimport { addMessageToLocalDb, resolveMessageApiChatId } from '../helpers';\nimport { interpolateArray } from '../../../util/waveform';\nimport { requestChatUpdate } from './chats';\n\nconst FAST_SEND_TIMEOUT = 1000;\nconst INPUT_WAVEFORM_LENGTH = 63;\n\nlet onUpdate: OnApiUpdate;\n\nexport function init(_onUpdate: OnApiUpdate) {\n onUpdate = _onUpdate;\n}\n\nexport async function fetchMessages({\n chat,\n threadId,\n ...pagination\n}: {\n chat: ApiChat;\n threadId?: number;\n offsetId?: number;\n addOffset?: number;\n limit: number;\n}) {\n const RequestClass = threadId === MAIN_THREAD_ID ? GramJs.messages.GetHistory : GramJs.messages.GetReplies;\n let result;\n\n try {\n result = await invokeRequest(new RequestClass({\n peer: buildInputPeer(chat.id, chat.accessHash),\n ...(threadId !== MAIN_THREAD_ID && {\n msgId: threadId,\n }),\n ...pagination,\n }), undefined, true);\n } catch (err) {\n if (err.message === 'CHANNEL_PRIVATE') {\n onUpdate({\n '@type': 'updateChat',\n id: chat.id,\n chat: {\n isRestricted: true,\n },\n });\n }\n }\n\n if (\n !result\n || result instanceof GramJs.messages.MessagesNotModified\n || !result.messages\n ) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n const messages = result.messages.map(buildApiMessage).filter(Boolean as any);\n const users = result.users.map(buildApiUser).filter(Boolean as any);\n const chats = result.chats.map((c) => buildApiChatFromPreview(c)).filter(Boolean as any);\n const threadInfos = messages.map(({ threadInfo }) => threadInfo).filter(Boolean as any);\n\n return {\n messages,\n users,\n chats,\n threadInfos,\n };\n}\n\nexport async function fetchMessage({ chat, messageId }: { chat: ApiChat; messageId: number }) {\n const isChannel = getEntityTypeById(chat.id) === 'channel';\n\n const result = await invokeRequest(\n isChannel\n ? new GramJs.channels.GetMessages({\n channel: buildInputEntity(chat.id, chat.accessHash) as GramJs.InputChannel,\n id: [new GramJs.InputMessageID({ id: messageId })],\n })\n : new GramJs.messages.GetMessages({\n id: [new GramJs.InputMessageID({ id: messageId })],\n }),\n );\n\n if (!result || result instanceof GramJs.messages.MessagesNotModified) {\n return undefined;\n }\n\n const mtpMessage = result.messages[0];\n if (!mtpMessage) {\n return undefined;\n }\n\n if (mtpMessage instanceof GramJs.MessageEmpty) {\n return MESSAGE_DELETED;\n }\n\n const message = mtpMessage && buildApiMessage(mtpMessage);\n if (!message) {\n return undefined;\n }\n\n if (mtpMessage instanceof GramJs.Message) {\n addMessageToLocalDb(mtpMessage);\n }\n\n const users = result.users.map(buildApiUser).filter(Boolean as any);\n\n return { message, users };\n}\n\nlet queue = Promise.resolve();\n\nexport function sendMessage(\n {\n chat,\n text,\n entities,\n replyingTo,\n attachment,\n sticker,\n gif,\n poll,\n isSilent,\n scheduledAt,\n groupedId,\n noWebPage,\n serverTimeOffset,\n }: {\n chat: ApiChat;\n text?: string;\n entities?: ApiMessageEntity[];\n replyingTo?: number;\n attachment?: ApiAttachment;\n sticker?: ApiSticker;\n gif?: ApiVideo;\n poll?: ApiNewPoll;\n isSilent?: boolean;\n scheduledAt?: number;\n groupedId?: string;\n noWebPage?: boolean;\n serverTimeOffset?: number;\n },\n onProgress?: ApiOnProgress,\n) {\n const localMessage = buildLocalMessage(\n chat, text, entities, replyingTo, attachment, sticker, gif, poll, groupedId, scheduledAt, serverTimeOffset,\n );\n onUpdate({\n '@type': localMessage.isScheduled ? 'newScheduledMessage' : 'newMessage',\n id: localMessage.id,\n chatId: chat.id,\n message: localMessage,\n });\n\n // This is expected to arrive after `updateMessageSendSucceeded` which replaces the local ID,\n // so in most cases this will be simply ignored\n setTimeout(() => {\n onUpdate({\n '@type': localMessage.isScheduled ? 'updateScheduledMessage' : 'updateMessage',\n id: localMessage.id,\n chatId: chat.id,\n message: {\n sendingState: 'messageSendingStatePending',\n },\n });\n }, FAST_SEND_TIMEOUT);\n\n const randomId = generateRandomBigInt();\n localDb.localMessages[randomId.toString()] = localMessage;\n\n if (groupedId) {\n return sendGroupedMedia({\n chat, text, entities, replyingTo, attachment: attachment!, groupedId, isSilent, scheduledAt,\n }, randomId, localMessage, onProgress);\n }\n\n const prevQueue = queue;\n queue = (async () => {\n let media: GramJs.TypeInputMedia | undefined;\n if (attachment) {\n try {\n media = await uploadMedia(localMessage, attachment, onProgress!);\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn(err);\n }\n\n await prevQueue;\n\n return;\n }\n } else if (sticker) {\n media = buildInputMediaDocument(sticker);\n } else if (gif) {\n media = buildInputMediaDocument(gif);\n } else if (poll) {\n media = buildInputPoll(poll, randomId);\n }\n\n await prevQueue;\n\n const RequestClass = media ? GramJs.messages.SendMedia : GramJs.messages.SendMessage;\n\n await invokeRequest(new RequestClass({\n clearDraft: true,\n message: text || '',\n entities: entities ? entities.map(buildMtpMessageEntity) : undefined,\n peer: buildInputPeer(chat.id, chat.accessHash),\n randomId,\n ...(isSilent && { silent: isSilent }),\n ...(scheduledAt && { scheduleDate: scheduledAt }),\n ...(replyingTo && { replyToMsgId: replyingTo }),\n ...(media && { media }),\n ...(noWebPage && { noWebpage: noWebPage }),\n }), true);\n })();\n\n return queue;\n}\n\nconst groupedUploads: Record;\n}> = {};\n\nfunction sendGroupedMedia(\n {\n chat,\n text,\n entities,\n replyingTo,\n attachment,\n groupedId,\n isSilent,\n scheduledAt,\n }: {\n chat: ApiChat;\n text?: string;\n entities?: ApiMessageEntity[];\n replyingTo?: number;\n attachment: ApiAttachment;\n groupedId: string;\n isSilent?: boolean;\n scheduledAt?: number;\n },\n randomId: GramJs.long,\n localMessage: ApiMessage,\n onProgress?: ApiOnProgress,\n) {\n let groupIndex = -1;\n if (!groupedUploads[groupedId]) {\n groupedUploads[groupedId] = {\n counter: 0,\n singleMediaByIndex: {},\n };\n }\n\n groupIndex = groupedUploads[groupedId].counter++;\n\n const prevQueue = queue;\n queue = (async () => {\n let media;\n try {\n media = await uploadMedia(localMessage, attachment, onProgress!);\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn(err);\n }\n\n groupedUploads[groupedId].counter--;\n\n await prevQueue;\n\n return;\n }\n\n const inputMedia = await fetchInputMedia(\n buildInputPeer(chat.id, chat.accessHash),\n media as GramJs.InputMediaUploadedPhoto | GramJs.InputMediaUploadedDocument,\n );\n\n await prevQueue;\n\n if (!inputMedia) {\n groupedUploads[groupedId].counter--;\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('Failed to upload grouped media');\n }\n\n return;\n }\n\n groupedUploads[groupedId].singleMediaByIndex[groupIndex] = new GramJs.InputSingleMedia({\n media: inputMedia,\n randomId,\n message: text || '',\n entities: entities ? entities.map(buildMtpMessageEntity) : undefined,\n });\n\n if (Object.keys(groupedUploads[groupedId].singleMediaByIndex).length < groupedUploads[groupedId].counter) {\n return;\n }\n\n const { singleMediaByIndex } = groupedUploads[groupedId];\n delete groupedUploads[groupedId];\n\n await invokeRequest(new GramJs.messages.SendMultiMedia({\n clearDraft: true,\n peer: buildInputPeer(chat.id, chat.accessHash),\n multiMedia: Object.values(singleMediaByIndex), // Object keys are usually ordered\n replyToMsgId: replyingTo,\n ...(isSilent && { silent: isSilent }),\n ...(scheduledAt && { scheduleDate: scheduledAt }),\n }), true);\n })();\n\n return queue;\n}\n\nasync function fetchInputMedia(\n peer: GramJs.TypeInputPeer,\n uploadedMedia: GramJs.InputMediaUploadedPhoto | GramJs.InputMediaUploadedDocument,\n) {\n const messageMedia = await invokeRequest(new GramJs.messages.UploadMedia({\n peer,\n media: uploadedMedia,\n }));\n\n if ((\n messageMedia instanceof GramJs.MessageMediaPhoto\n && messageMedia.photo\n && messageMedia.photo instanceof GramJs.Photo)\n ) {\n const { photo: { id, accessHash, fileReference } } = messageMedia;\n\n return new GramJs.InputMediaPhoto({\n id: new GramJs.InputPhoto({ id, accessHash, fileReference }),\n });\n }\n\n if ((\n messageMedia instanceof GramJs.MessageMediaDocument\n && messageMedia.document\n && messageMedia.document instanceof GramJs.Document)\n ) {\n const { document: { id, accessHash, fileReference } } = messageMedia;\n\n return new GramJs.InputMediaDocument({\n id: new GramJs.InputDocument({ id, accessHash, fileReference }),\n });\n }\n\n return undefined;\n}\n\nexport async function editMessage({\n chat,\n message,\n text,\n entities,\n noWebPage,\n serverTimeOffset,\n}: {\n chat: ApiChat;\n message: ApiMessage;\n text: string;\n entities?: ApiMessageEntity[];\n noWebPage?: boolean;\n serverTimeOffset: number;\n}) {\n const isScheduled = message.date * 1000 > Date.now() + serverTimeOffset * 1000;\n const messageUpdate: Partial = {\n content: {\n ...message.content,\n ...(text && {\n text: {\n text,\n entities,\n },\n }),\n },\n };\n\n onUpdate({\n '@type': isScheduled ? 'updateScheduledMessage' : 'updateMessage',\n id: message.id,\n chatId: chat.id,\n message: messageUpdate,\n });\n\n // TODO Revise intersecting with scheduled\n localDb.localMessages[message.id] = { ...message, ...messageUpdate };\n\n const mtpEntities = entities && entities.map(buildMtpMessageEntity);\n\n await invokeRequest(new GramJs.messages.EditMessage({\n message: text || '',\n entities: mtpEntities,\n peer: buildInputPeer(chat.id, chat.accessHash),\n id: message.id,\n ...(isScheduled && { scheduleDate: message.date }),\n ...(noWebPage && { noWebpage: noWebPage }),\n }), true);\n}\n\nexport async function rescheduleMessage({\n chat,\n message,\n scheduledAt,\n}: {\n chat: ApiChat;\n message: ApiMessage;\n scheduledAt: number;\n}) {\n await invokeRequest(new GramJs.messages.EditMessage({\n peer: buildInputPeer(chat.id, chat.accessHash),\n id: message.id,\n scheduleDate: scheduledAt,\n }), true);\n}\n\nasync function uploadMedia(localMessage: ApiMessage, attachment: ApiAttachment, onProgress: ApiOnProgress) {\n const {\n filename, blobUrl, mimeType, quick, voice,\n } = attachment;\n\n const file = await fetchFile(blobUrl, filename);\n const patchedOnProgress: ApiOnProgress = (progress) => {\n if (onProgress.isCanceled) {\n patchedOnProgress.isCanceled = true;\n } else {\n onProgress(progress, localMessage.id);\n }\n };\n const inputFile = await uploadFile(file, patchedOnProgress);\n\n const attributes: GramJs.TypeDocumentAttribute[] = [new GramJs.DocumentAttributeFilename({ fileName: filename })];\n if (quick) {\n if (mimeType.startsWith('image/')) {\n return new GramJs.InputMediaUploadedPhoto({ file: inputFile });\n } else {\n const { width, height, duration } = quick;\n if (duration !== undefined) {\n attributes.push(new GramJs.DocumentAttributeVideo({\n duration,\n w: width,\n h: height,\n }));\n }\n }\n }\n\n if (voice) {\n const { duration, waveform } = voice;\n const { data: inputWaveform } = interpolateArray(waveform, INPUT_WAVEFORM_LENGTH);\n attributes.push(new GramJs.DocumentAttributeAudio({\n voice: true,\n duration,\n waveform: Buffer.from(inputWaveform),\n }));\n }\n\n return new GramJs.InputMediaUploadedDocument({\n file: inputFile,\n mimeType,\n attributes,\n });\n}\n\nexport async function pinMessage({\n chat, messageId, isUnpin, isOneSide, isSilent,\n}: { chat: ApiChat; messageId: number; isUnpin: boolean; isOneSide: boolean; isSilent: boolean }) {\n await invokeRequest(new GramJs.messages.UpdatePinnedMessage({\n peer: buildInputPeer(chat.id, chat.accessHash),\n id: messageId,\n ...(isUnpin && { unpin: true }),\n ...(isOneSide && { pmOneside: true }),\n ...(isSilent && { silent: true }),\n }), true);\n}\n\nexport async function unpinAllMessages({ chat }: { chat: ApiChat }) {\n await invokeRequest(new GramJs.messages.UnpinAllMessages({\n peer: buildInputPeer(chat.id, chat.accessHash),\n }), true);\n}\n\nexport async function deleteMessages({\n chat, messageIds, shouldDeleteForAll,\n}: {\n chat: ApiChat; messageIds: number[]; shouldDeleteForAll?: boolean;\n}) {\n const isChannel = getEntityTypeById(chat.id) === 'channel';\n\n const result = await invokeRequest(\n isChannel\n ? new GramJs.channels.DeleteMessages({\n channel: buildInputEntity(chat.id, chat.accessHash) as GramJs.InputChannel,\n id: messageIds,\n })\n : new GramJs.messages.DeleteMessages({\n id: messageIds,\n ...(shouldDeleteForAll && { revoke: true }),\n }),\n );\n\n if (!result) {\n return;\n }\n\n onUpdate({\n '@type': 'deleteMessages',\n ids: messageIds,\n ...(isChannel && { chatId: chat.id }),\n });\n}\n\nexport async function deleteScheduledMessages({\n chat, messageIds,\n}: {\n chat: ApiChat; messageIds: number[];\n}) {\n const result = await invokeRequest(\n new GramJs.messages.DeleteScheduledMessages({\n peer: buildInputPeer(chat.id, chat.accessHash),\n id: messageIds,\n }),\n );\n\n if (!result) {\n return;\n }\n\n onUpdate({\n '@type': 'deleteScheduledMessages',\n ids: messageIds,\n chatId: chat.id,\n });\n}\n\nexport async function deleteHistory({\n chat, shouldDeleteForAll, maxId,\n}: {\n chat: ApiChat; shouldDeleteForAll?: boolean; maxId?: number;\n}) {\n const isChannel = getEntityTypeById(chat.id) === 'channel';\n const result = await invokeRequest(\n isChannel\n ? new GramJs.channels.DeleteHistory({\n channel: buildInputEntity(chat.id, chat.accessHash) as GramJs.InputChannel,\n maxId,\n })\n : new GramJs.messages.DeleteHistory({\n peer: buildInputPeer(chat.id, chat.accessHash),\n ...(shouldDeleteForAll && { revoke: true }),\n ...(!shouldDeleteForAll && { just_clear: true }),\n maxId,\n }),\n );\n\n if (!result) {\n return;\n }\n\n onUpdate({\n '@type': 'deleteHistory',\n chatId: chat.id,\n });\n}\n\nexport async function reportMessages({\n peer, messageIds, reason, description,\n}: {\n peer: ApiChat | ApiUser; messageIds: number[]; reason: ApiReportReason; description?: string;\n}) {\n const result = await invokeRequest(new GramJs.messages.Report({\n peer: buildInputPeer(peer.id, peer.accessHash),\n id: messageIds,\n reason: buildInputReportReason(reason),\n message: description,\n }));\n\n return result;\n}\n\nexport async function markMessageListRead({\n chat, threadId, maxId, serverTimeOffset,\n}: {\n chat: ApiChat; threadId: number; maxId?: number; serverTimeOffset: number;\n}) {\n const isChannel = getEntityTypeById(chat.id) === 'channel';\n\n if (isChannel && threadId === MAIN_THREAD_ID) {\n await invokeRequest(new GramJs.channels.ReadHistory({\n channel: buildInputEntity(chat.id, chat.accessHash) as GramJs.InputChannel,\n maxId,\n }));\n } else if (isChannel) {\n await invokeRequest(new GramJs.messages.ReadDiscussion({\n peer: buildInputPeer(chat.id, chat.accessHash),\n msgId: threadId,\n readMaxId: maxId,\n }));\n } else {\n await invokeRequest(new GramJs.messages.ReadHistory({\n peer: buildInputPeer(chat.id, chat.accessHash),\n maxId,\n }));\n }\n\n if (threadId === MAIN_THREAD_ID) {\n void requestChatUpdate({ chat, serverTimeOffset });\n } else {\n void requestThreadInfoUpdate({ chat, threadId });\n }\n}\n\nexport async function markMessagesRead({\n chat, messageIds,\n}: {\n chat: ApiChat; messageIds: number[];\n}) {\n const isChannel = getEntityTypeById(chat.id) === 'channel';\n\n await invokeRequest(\n isChannel\n ? new GramJs.channels.ReadMessageContents({\n channel: buildInputEntity(chat.id, chat.accessHash) as GramJs.InputChannel,\n id: messageIds,\n })\n : new GramJs.messages.ReadMessageContents({\n id: messageIds,\n }),\n );\n\n onUpdate({\n ...(isChannel ? {\n '@type': 'updateChannelMessages',\n channelId: chat.id,\n } : {\n '@type': 'updateCommonBoxMessages',\n }),\n ids: messageIds,\n messageUpdate: {\n hasUnreadMention: false,\n isMediaUnread: false,\n },\n });\n}\n\nexport async function requestThreadInfoUpdate({\n chat, threadId,\n}: {\n chat: ApiChat; threadId: number;\n}) {\n const [topMessageResult, repliesResult] = await Promise.all([\n invokeRequest(new GramJs.messages.GetDiscussionMessage({\n peer: buildInputPeer(chat.id, chat.accessHash),\n msgId: threadId,\n })),\n invokeRequest(new GramJs.messages.GetReplies({\n peer: buildInputPeer(chat.id, chat.accessHash),\n msgId: threadId,\n offsetId: 1,\n addOffset: -1,\n limit: 1,\n })),\n ]);\n\n if (!topMessageResult || !topMessageResult.messages.length) {\n return;\n }\n\n const discussionChatId = resolveMessageApiChatId(topMessageResult.messages[0]);\n if (!discussionChatId) {\n return;\n }\n\n onUpdate({\n '@type': 'updateThreadInfo',\n chatId: discussionChatId,\n threadId,\n threadInfo: {\n topMessageId: topMessageResult.messages[topMessageResult.messages.length - 1].id,\n lastReadInboxMessageId: topMessageResult.readInboxMaxId,\n messagesCount: (repliesResult instanceof GramJs.messages.ChannelMessages) ? repliesResult.count : undefined,\n },\n firstMessageId: repliesResult && 'messages' in repliesResult && repliesResult.messages.length\n ? repliesResult.messages[0].id\n : undefined,\n });\n\n const chats = topMessageResult.chats.map((c) => buildApiChatFromPreview(c)).filter(Boolean as any);\n chats.forEach((newChat) => {\n onUpdate({\n '@type': 'updateChat',\n id: newChat.id,\n chat: newChat,\n noTopChatsRequest: true,\n });\n });\n}\n\nexport async function searchMessagesLocal({\n chatOrUser, type, query, topMessageId, minDate, maxDate, ...pagination\n}: {\n chatOrUser: ApiChat | ApiUser;\n type?: ApiMessageSearchType | ApiGlobalMessageSearchType;\n query?: string;\n topMessageId?: number;\n offsetId?: number;\n addOffset?: number;\n limit: number;\n minDate?: number;\n maxDate?: number;\n}) {\n let filter;\n switch (type) {\n case 'media':\n filter = new GramJs.InputMessagesFilterPhotoVideo();\n break;\n case 'documents':\n filter = new GramJs.InputMessagesFilterDocument();\n break;\n case 'links':\n filter = new GramJs.InputMessagesFilterUrl();\n break;\n case 'audio':\n filter = new GramJs.InputMessagesFilterMusic();\n break;\n case 'voice':\n filter = new GramJs.InputMessagesFilterVoice();\n break;\n case 'profilePhoto':\n filter = new GramJs.InputMessagesFilterChatPhotos();\n break;\n case 'text':\n default: {\n filter = new GramJs.InputMessagesFilterEmpty();\n }\n }\n\n const result = await invokeRequest(new GramJs.messages.Search({\n peer: buildInputPeer(chatOrUser.id, chatOrUser.accessHash),\n filter,\n q: query || '',\n topMsgId: topMessageId,\n minDate,\n maxDate,\n ...pagination,\n }));\n\n if (\n !result\n || result instanceof GramJs.messages.MessagesNotModified\n || !result.messages\n ) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n const messages = result.messages.map(buildApiMessage).filter(Boolean as any);\n const users = result.users.map(buildApiUser).filter(Boolean as any);\n\n let totalCount = messages.length;\n let nextOffsetId: number | undefined;\n if (result instanceof GramJs.messages.MessagesSlice || result instanceof GramJs.messages.ChannelMessages) {\n totalCount = result.count;\n\n if (messages.length) {\n nextOffsetId = messages[messages.length - 1].id;\n }\n }\n\n return {\n messages,\n users,\n totalCount,\n nextOffsetId,\n };\n}\n\nexport async function searchMessagesGlobal({\n query, offsetRate = 0, limit, type = 'text', minDate, maxDate,\n}: {\n query: string;\n offsetRate?: number;\n limit: number;\n type?: ApiGlobalMessageSearchType;\n minDate?: number;\n maxDate?: number;\n}) {\n let filter;\n switch (type) {\n case 'media':\n filter = new GramJs.InputMessagesFilterPhotoVideo();\n break;\n case 'documents':\n filter = new GramJs.InputMessagesFilterDocument();\n break;\n case 'links':\n filter = new GramJs.InputMessagesFilterUrl();\n break;\n case 'audio':\n filter = new GramJs.InputMessagesFilterMusic();\n break;\n case 'voice':\n filter = new GramJs.InputMessagesFilterVoice();\n break;\n case 'text':\n default: {\n if (!query && !(maxDate && minDate)) {\n return undefined;\n }\n\n filter = new GramJs.InputMessagesFilterEmpty();\n }\n }\n\n const result = await invokeRequest(new GramJs.messages.SearchGlobal({\n q: query,\n offsetRate,\n offsetPeer: new GramJs.InputPeerEmpty(),\n limit,\n filter,\n folderId: ALL_FOLDER_ID,\n minDate,\n maxDate,\n }));\n\n if (\n !result\n || result instanceof GramJs.messages.MessagesNotModified\n || !result.messages\n ) {\n return undefined;\n }\n\n updateLocalDb({\n chats: result.chats,\n users: result.users,\n messages: result.messages,\n } as GramJs.messages.Messages);\n\n const chats = result.chats.map((user) => buildApiChatFromPreview(user)).filter(Boolean as any);\n const users = result.users.map(buildApiUser).filter(Boolean as any);\n const messages = result.messages.map(buildApiMessage).filter(Boolean as any);\n\n let totalCount = messages.length;\n let nextRate: number | undefined;\n if (result instanceof GramJs.messages.MessagesSlice || result instanceof GramJs.messages.ChannelMessages) {\n totalCount = result.count;\n\n if (messages.length) {\n nextRate = messages[messages.length - 1].id;\n }\n }\n\n return {\n messages,\n users,\n chats,\n totalCount,\n nextRate: 'nextRate' in result && result.nextRate ? result.nextRate : nextRate,\n };\n}\n\nexport async function fetchWebPagePreview({ message }: { message: string }) {\n const preview = await invokeRequest(new GramJs.messages.GetWebPagePreview({\n message,\n }));\n\n return preview && buildWebPage(preview);\n}\n\nexport async function sendPollVote({\n chat, messageId, options,\n}: {\n chat: ApiChat;\n messageId: number;\n options: string[];\n}) {\n const { id, accessHash } = chat;\n\n await invokeRequest(new GramJs.messages.SendVote({\n peer: buildInputPeer(id, accessHash),\n msgId: messageId,\n options: options.map((option) => Buffer.from(option)),\n }), true);\n}\n\nexport async function loadPollOptionResults({\n chat, messageId, option, offset, limit, shouldResetVoters,\n}: {\n chat: ApiChat;\n messageId: number;\n option?: string;\n offset?: string;\n limit?: number;\n shouldResetVoters?: boolean;\n}) {\n const { id, accessHash } = chat;\n\n const result = await invokeRequest(new GramJs.messages.GetPollVotes({\n peer: buildInputPeer(id, accessHash),\n id: messageId,\n ...(option && { option: Buffer.from(option) }),\n ...(offset && { offset }),\n ...(limit && { limit }),\n }));\n\n if (!result) {\n return undefined;\n }\n\n updateLocalDb({\n chats: [] as GramJs.TypeChat[],\n users: result.users,\n messages: [] as GramJs.Message[],\n } as GramJs.messages.Messages);\n\n const users = result.users.map(buildApiUser).filter(Boolean as any);\n const votes = result.votes.map((vote) => ({\n userId: vote.userId,\n date: vote.date,\n }));\n\n return {\n count: result.count,\n votes,\n users,\n nextOffset: result.nextOffset,\n shouldResetVoters,\n };\n}\n\nexport async function forwardMessages({\n fromChat,\n toChat,\n messages,\n serverTimeOffset,\n}: {\n fromChat: ApiChat;\n toChat: ApiChat;\n messages: ApiMessage[];\n serverTimeOffset: number;\n}) {\n const messageIds = messages.map(({ id }) => id);\n const randomIds = messages.map(generateRandomBigInt);\n\n messages.forEach((message, index) => {\n const localMessage = buildForwardedMessage(toChat, message, serverTimeOffset);\n localDb.localMessages[String(randomIds[index])] = localMessage;\n\n onUpdate({\n '@type': 'newMessage',\n id: localMessage.id,\n chatId: toChat.id,\n message: localMessage,\n });\n });\n\n await invokeRequest(new GramJs.messages.ForwardMessages({\n fromPeer: buildInputPeer(fromChat.id, fromChat.accessHash),\n toPeer: buildInputPeer(toChat.id, toChat.accessHash),\n randomId: randomIds,\n id: messageIds,\n }), true);\n}\n\nexport async function findFirstMessageIdAfterDate({\n chat,\n timestamp,\n}: {\n chat: ApiChat;\n timestamp: number;\n}) {\n const result = await invokeRequest(new GramJs.messages.GetHistory({\n peer: buildInputPeer(chat.id, chat.accessHash),\n offsetDate: timestamp,\n addOffset: -1,\n limit: 1,\n }));\n\n if (\n !result\n || result instanceof GramJs.messages.MessagesNotModified\n || !result.messages || !result.messages.length\n ) {\n return undefined;\n }\n\n return result.messages[0].id;\n}\n\nexport async function fetchScheduledHistory({ chat, hash = 0 }: { chat: ApiChat; hash?: number }) {\n const { id, accessHash } = chat;\n\n const result = await invokeRequest(new GramJs.messages.GetScheduledHistory({\n peer: buildInputPeer(id, accessHash),\n hash,\n }));\n\n if (\n !result\n || result instanceof GramJs.messages.MessagesNotModified\n || !result.messages\n ) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n const messages = result.messages.map(buildApiMessage).filter(Boolean as any);\n\n return {\n messages,\n hash: calculateResultHash(messages.map((message) => message.id)),\n };\n}\n\nexport async function sendScheduledMessages({ chat, ids }: { chat: ApiChat; ids: number[] }) {\n const { id, accessHash } = chat;\n\n await invokeRequest(new GramJs.messages.SendScheduledMessages({\n peer: buildInputPeer(id, accessHash),\n id: ids,\n }), true);\n}\n\nfunction updateLocalDb(result: (\n GramJs.messages.MessagesSlice | GramJs.messages.Messages | GramJs.messages.ChannelMessages |\n GramJs.messages.DiscussionMessage\n)) {\n result.users.forEach((user) => {\n if (user instanceof GramJs.User) {\n localDb.users[user.id] = user;\n }\n });\n\n result.chats.forEach((chat) => {\n if (chat instanceof GramJs.Chat || chat instanceof GramJs.Channel) {\n localDb.chats[chat.id] = chat;\n }\n });\n\n result.messages.forEach((message) => {\n if ((message instanceof GramJs.Message && isMessageWithMedia(message))\n || (message instanceof GramJs.MessageService && isServiceMessageWithMedia(message))\n ) {\n addMessageToLocalDb(message);\n }\n });\n}\n\nexport async function fetchPinnedMessages({ chat }: { chat: ApiChat }) {\n const result = await invokeRequest(new GramJs.messages.Search(\n {\n peer: buildInputPeer(chat.id, chat.accessHash),\n filter: new GramJs.InputMessagesFilterPinned(),\n q: '',\n limit: PINNED_MESSAGES_LIMIT,\n },\n ));\n\n if (\n !result\n || result instanceof GramJs.messages.MessagesNotModified\n || !result.messages\n ) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n const messages = result.messages.map(buildApiMessage).filter(Boolean as any);\n const users = result.users.map(buildApiUser).filter(Boolean as any);\n const chats = result.chats.map((c) => buildApiChatFromPreview(c)).filter(Boolean as any);\n\n return {\n messages,\n users,\n chats,\n };\n}\n","import BigInt from 'big-integer';\nimport { Api as GramJs } from '../../../lib/gramjs';\nimport {\n OnApiUpdate, ApiUser, ApiChat, ApiPhoto,\n} from '../../types';\nimport { LangCode } from '../../../types';\n\nimport { PROFILE_PHOTOS_LIMIT } from '../../../config';\nimport { invokeRequest } from './client';\nimport { searchMessagesLocal } from './messages';\nimport {\n buildInputEntity,\n calculateResultHash,\n buildInputPeer,\n buildInputContact,\n} from '../gramjsBuilders';\nimport { buildApiUser, buildApiUserFromFull } from '../apiBuilders/users';\nimport { buildApiChatFromPreview } from '../apiBuilders/chats';\nimport { buildApiPhoto } from '../apiBuilders/common';\nimport localDb from '../localDb';\nimport { addPhotoToLocalDb } from '../helpers';\nimport { buildApiCountryList } from '../apiBuilders/misc';\n\nlet onUpdate: OnApiUpdate;\n\nexport function init(_onUpdate: OnApiUpdate) {\n onUpdate = _onUpdate;\n}\n\nexport async function fetchFullUser({\n id,\n accessHash,\n}: {\n id: number;\n accessHash?: string;\n}) {\n const input = buildInputEntity(id, accessHash);\n if (!(input instanceof GramJs.InputUser)) {\n return;\n }\n\n const fullInfo = await invokeRequest(new GramJs.users.GetFullUser({ id: input }));\n\n if (!fullInfo) {\n return;\n }\n\n const userWithFullInfo = buildApiUserFromFull(fullInfo);\n\n onUpdate({\n '@type': 'updateUser',\n id,\n user: {\n fullInfo: userWithFullInfo.fullInfo,\n },\n });\n}\n\nexport async function fetchNearestCountry() {\n const dcInfo = await invokeRequest(new GramJs.help.GetNearestDc());\n\n return dcInfo?.country;\n}\n\nexport async function fetchCountryList({ langCode = 'en' }: { langCode?: LangCode }) {\n const countryList = await invokeRequest(new GramJs.help.GetCountriesList({\n langCode,\n }));\n\n if (!(countryList instanceof GramJs.help.CountriesList)) {\n return undefined;\n }\n return buildApiCountryList(countryList.countries);\n}\n\nexport async function fetchTopUsers({ hash = 0 }: { hash?: number }) {\n const topPeers = await invokeRequest(new GramJs.contacts.GetTopPeers({\n hash,\n correspondents: true,\n }));\n if (!(topPeers instanceof GramJs.contacts.TopPeers)) {\n return undefined;\n }\n\n const users = topPeers.users.map(buildApiUser).filter((user) => !!user && !user.isSelf) as ApiUser[];\n const ids = users.map(({ id }) => id);\n\n return {\n hash: calculateResultHash(ids),\n ids,\n users,\n };\n}\n\nexport async function fetchContactList({ hash = 0 }: { hash?: number }) {\n const result = await invokeRequest(new GramJs.contacts.GetContacts({ hash }));\n if (!result || result instanceof GramJs.contacts.ContactsNotModified) {\n return undefined;\n }\n\n result.users.forEach((user) => {\n if (user instanceof GramJs.User) {\n localDb.users[user.id] = user;\n }\n });\n\n return {\n hash: calculateResultHash([\n result.savedCount,\n ...result.contacts.map(({ userId }) => userId),\n ]),\n users: result.users.map(buildApiUser).filter(Boolean as any),\n chats: result.users.map((user) => buildApiChatFromPreview(user)).filter(Boolean as any),\n };\n}\n\nexport async function fetchUsers({ users }: { users: ApiUser[] }) {\n const result = await invokeRequest(new GramJs.users.GetUsers({\n id: users.map(({ id, accessHash }) => buildInputPeer(id, accessHash)),\n }));\n if (!result || !result.length) {\n return undefined;\n }\n\n result.forEach((user) => {\n if (user instanceof GramJs.User) {\n localDb.users[user.id] = user;\n }\n });\n\n return result.map(buildApiUser).filter(Boolean as any);\n}\n\nexport function updateContact({\n phone,\n firstName,\n lastName,\n}: {\n phone?: string;\n firstName?: string;\n lastName?: string;\n}) {\n return invokeRequest(new GramJs.contacts.ImportContacts({\n contacts: [buildInputContact({\n phone: phone || '',\n firstName: firstName || '',\n lastName: lastName || '',\n })],\n }));\n}\n\nexport async function deleteUser({\n id,\n accessHash,\n}: {\n id: number;\n accessHash?: string;\n}) {\n const input = buildInputEntity(id, accessHash);\n if (!(input instanceof GramJs.InputUser)) {\n return;\n }\n\n const result = await invokeRequest(new GramJs.contacts.DeleteContacts({ id: [input] }));\n\n if (!result) {\n return;\n }\n\n onUpdate({\n '@type': 'deleteUser',\n id,\n });\n}\n\nexport async function fetchProfilePhotos(user?: ApiUser, chat?: ApiChat) {\n if (user) {\n const { id, accessHash } = user;\n\n const result = await invokeRequest(new GramJs.photos.GetUserPhotos({\n userId: buildInputEntity(id, accessHash) as GramJs.InputUser,\n limit: PROFILE_PHOTOS_LIMIT,\n offset: 0,\n maxId: BigInt('0'),\n }));\n\n if (!result) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n return {\n photos: result.photos\n .filter((photo): photo is GramJs.Photo => photo instanceof GramJs.Photo)\n .map(buildApiPhoto),\n };\n }\n\n const result = await searchMessagesLocal({\n chatOrUser: chat!,\n type: 'profilePhoto',\n limit: PROFILE_PHOTOS_LIMIT,\n });\n\n if (!result) {\n return undefined;\n }\n\n const { messages, users } = result;\n\n return {\n photos: messages.map((message) => message.content.action!.photo).filter(Boolean as any),\n users,\n };\n}\n\nfunction updateLocalDb(result: (GramJs.photos.Photos | GramJs.photos.PhotosSlice)) {\n result.photos.forEach(addPhotoToLocalDb);\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\nimport { ApiSticker, ApiVideo, OnApiUpdate } from '../../types';\n\nimport { invokeRequest } from './client';\nimport { buildStickerFromDocument, buildStickerSet, buildStickerSetCovered } from '../apiBuilders/symbols';\nimport { buildInputStickerSet, buildInputDocument, buildInputStickerSetShortName } from '../gramjsBuilders';\nimport { buildVideoFromDocument } from '../apiBuilders/messages';\nimport { RECENT_STICKERS_LIMIT } from '../../../config';\n\nimport localDb from '../localDb';\n\nlet onUpdate: OnApiUpdate;\n\nexport function init(_onUpdate: OnApiUpdate) {\n onUpdate = _onUpdate;\n}\n\nexport async function fetchStickerSets({ hash }: { hash: number }) {\n const allStickers = await invokeRequest(new GramJs.messages.GetAllStickers({ hash }));\n\n if (!allStickers || allStickers instanceof GramJs.messages.AllStickersNotModified) {\n return undefined;\n }\n\n allStickers.sets.forEach((stickerSet) => {\n if (stickerSet.thumbs?.length) {\n localDb.stickerSets[String(stickerSet.id)] = stickerSet;\n }\n });\n\n return {\n hash: allStickers.hash,\n sets: allStickers.sets.map(buildStickerSet),\n };\n}\n\nexport async function fetchRecentStickers({ hash }: { hash: number }) {\n const result = await invokeRequest(new GramJs.messages.GetRecentStickers({ hash }));\n\n if (!result || result instanceof GramJs.messages.RecentStickersNotModified) {\n return undefined;\n }\n\n return {\n hash: result.hash,\n stickers: processStickerResult(result.stickers.slice(0, RECENT_STICKERS_LIMIT)),\n };\n}\n\nexport async function fetchFavoriteStickers({ hash }: { hash: number }) {\n const result = await invokeRequest(new GramJs.messages.GetFavedStickers({ hash }));\n\n if (!result || result instanceof GramJs.messages.FavedStickersNotModified) {\n return undefined;\n }\n\n return {\n hash: result.hash,\n stickers: processStickerResult(result.stickers),\n };\n}\n\nexport async function fetchFeaturedStickers({ hash }: { hash: number }) {\n const result = await invokeRequest(new GramJs.messages.GetFeaturedStickers({ hash }));\n\n if (!result || result instanceof GramJs.messages.FeaturedStickersNotModified) {\n return undefined;\n }\n\n return {\n hash: result.hash,\n sets: result.sets.map(buildStickerSetCovered),\n };\n}\n\nexport async function faveSticker({\n sticker,\n unfave,\n}: {\n sticker: ApiSticker;\n unfave?: boolean;\n}) {\n const request = new GramJs.messages.FaveSticker({\n id: buildInputDocument(sticker),\n unfave,\n });\n\n const result = await invokeRequest(request);\n if (result) {\n onUpdate({\n '@type': 'updateFavoriteStickers',\n });\n }\n}\n\nexport async function fetchStickers({ stickerSetShortName, stickerSetId, accessHash }:\n{ stickerSetShortName?: string; stickerSetId?: string; accessHash: string }) {\n const result = await invokeRequest(new GramJs.messages.GetStickerSet({\n stickerset: stickerSetId\n ? buildInputStickerSet(stickerSetId, accessHash)\n : buildInputStickerSetShortName(stickerSetShortName!),\n }));\n\n if (!result) {\n return undefined;\n }\n\n return {\n set: buildStickerSet(result.set),\n stickers: processStickerResult(result.documents),\n packs: processStickerPackResult(result.packs),\n };\n}\n\nexport async function fetchAnimatedEmojis() {\n const result = await invokeRequest(new GramJs.messages.GetStickerSet({\n stickerset: new GramJs.InputStickerSetAnimatedEmoji(),\n }));\n\n if (!result) {\n return undefined;\n }\n\n return {\n set: buildStickerSet(result.set),\n stickers: processStickerResult(result.documents),\n };\n}\n\nexport async function searchStickers({ query, hash }: { query: string; hash: number }) {\n const result = await invokeRequest(new GramJs.messages.SearchStickerSets({\n q: query,\n hash,\n }));\n\n if (!result || result instanceof GramJs.messages.FoundStickerSetsNotModified) {\n return undefined;\n }\n\n return {\n hash: result.hash,\n sets: result.sets.map(buildStickerSetCovered),\n };\n}\n\nexport async function fetchSavedGifs({ hash }: { hash: number }) {\n const result = await invokeRequest(new GramJs.messages.GetSavedGifs({ hash }));\n\n if (!result || result instanceof GramJs.messages.SavedGifsNotModified) {\n return undefined;\n }\n\n return {\n hash: result.hash,\n gifs: processGifResult(result.gifs),\n };\n}\n\nexport async function installStickerSet({ stickerSetId, accessHash }: { stickerSetId: string; accessHash: string }) {\n const result = await invokeRequest(new GramJs.messages.InstallStickerSet({\n stickerset: buildInputStickerSet(stickerSetId, accessHash),\n }));\n\n if (result) {\n onUpdate({\n '@type': 'updateStickerSet',\n id: stickerSetId,\n stickerSet: { installedDate: Date.now() },\n });\n }\n}\n\nexport async function uninstallStickerSet({ stickerSetId, accessHash }: { stickerSetId: string; accessHash: string }) {\n const result = await invokeRequest(new GramJs.messages.UninstallStickerSet({\n stickerset: buildInputStickerSet(stickerSetId, accessHash),\n }));\n\n if (result) {\n onUpdate({\n '@type': 'updateStickerSet',\n id: stickerSetId,\n stickerSet: { installedDate: undefined },\n });\n }\n}\n\nlet inputGifBot: GramJs.InputUser | undefined;\n\nexport async function searchGifs({ query, offset = '' }: { query: string; offset?: string }) {\n if (!inputGifBot) {\n const config = await invokeRequest(new GramJs.help.GetConfig());\n if (!config) {\n return undefined;\n }\n\n const resolvedPeer = await invokeRequest(new GramJs.contacts.ResolveUsername({\n username: config.gifSearchUsername,\n }));\n if (!resolvedPeer || !(resolvedPeer.users[0] instanceof GramJs.User)) {\n return undefined;\n }\n\n inputGifBot = new GramJs.InputUser({\n userId: (resolvedPeer.peer as GramJs.PeerUser).userId,\n accessHash: resolvedPeer.users[0].accessHash!,\n });\n }\n\n const result = await invokeRequest(new GramJs.messages.GetInlineBotResults({\n bot: inputGifBot,\n peer: new GramJs.InputPeerEmpty(),\n query,\n offset,\n }));\n if (!result) {\n return undefined;\n }\n\n const documents = result.results\n .map((foundGif) => {\n if (foundGif instanceof GramJs.BotInlineMediaResult) {\n return foundGif.document;\n }\n\n return undefined;\n })\n .filter(Boolean as any);\n\n return {\n nextOffset: result.nextOffset,\n gifs: processGifResult(documents),\n };\n}\n\nexport async function fetchStickersForEmoji({\n emoji, hash = 0,\n}: { emoji: string; hash?: number }) {\n const result = await invokeRequest(new GramJs.messages.GetStickers({\n emoticon: emoji,\n hash,\n }));\n\n if (!result || result instanceof GramJs.messages.StickersNotModified) {\n return undefined;\n }\n\n return {\n stickers: processStickerResult(result.stickers),\n hash: result.hash,\n };\n}\n\nexport async function fetchEmojiKeywords({ language, fromVersion }: {\n language: string;\n fromVersion?: number;\n}) {\n const result = await invokeRequest(new GramJs.messages.GetEmojiKeywordsDifference({\n langCode: language,\n fromVersion,\n }));\n\n if (!result) {\n return undefined;\n }\n\n return {\n language: result.langCode,\n version: result.version,\n keywords: result.keywords.reduce((acc, emojiKeyword) => {\n acc[emojiKeyword.keyword] = emojiKeyword.emoticons;\n\n return acc;\n }, {} as Record),\n };\n}\n\nfunction processStickerResult(stickers: GramJs.TypeDocument[]) {\n return stickers\n .map((document) => {\n if (document instanceof GramJs.Document) {\n const sticker = buildStickerFromDocument(document);\n if (sticker) {\n localDb.documents[String(document.id)] = document;\n\n return sticker;\n }\n }\n\n return undefined;\n })\n .filter(Boolean as any);\n}\n\nfunction processStickerPackResult(packs: GramJs.StickerPack[]) {\n return packs.reduce((acc, { emoticon, documents }) => {\n acc[emoticon] = documents.map((documentId) => buildStickerFromDocument(\n localDb.documents[String(documentId)],\n )).filter(Boolean as any);\n return acc;\n }, {} as Record);\n}\n\nfunction processGifResult(gifs: GramJs.TypeDocument[]) {\n return gifs\n .map((document) => {\n if (document instanceof GramJs.Document) {\n const gif = buildVideoFromDocument(document);\n if (gif) {\n localDb.documents[String(document.id)] = document;\n\n return gif;\n }\n }\n\n return undefined;\n })\n .filter(Boolean as any);\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\n\nimport { invokeRequest } from './client';\nimport { buildInputEntity, buildInputPeer } from '../gramjsBuilders';\nimport { ApiChat, OnApiUpdate } from '../../types';\n\nlet onUpdate: OnApiUpdate;\n\nexport function init(_onUpdate: OnApiUpdate) {\n onUpdate = _onUpdate;\n}\n\nexport async function checkChatUsername(\n { username }: { username: string },\n) {\n try {\n const result = await invokeRequest(new GramJs.channels.CheckUsername({\n channel: new GramJs.InputChannelEmpty(),\n username,\n }), undefined, true);\n\n return result!;\n } catch (err) {\n return false;\n }\n}\n\nexport async function setChatUsername(\n { chat, username }: { chat: ApiChat; username: string },\n) {\n const result = await invokeRequest(new GramJs.channels.UpdateUsername({\n channel: buildInputEntity(chat.id, chat.accessHash) as GramJs.InputChannel,\n username,\n }));\n\n if (result) {\n onUpdate({\n '@type': 'updateChat',\n id: chat.id,\n chat: { username },\n });\n }\n}\n\nexport async function updatePrivateLink(\n { chat }: { chat: ApiChat },\n) {\n const result = await invokeRequest(new GramJs.messages.ExportChatInvite({\n peer: buildInputPeer(chat.id, chat.accessHash),\n }));\n\n if (!result || !(result instanceof GramJs.ChatInviteExported)) {\n return;\n }\n\n onUpdate({\n '@type': 'updateChatFullInfo',\n id: chat.id,\n fullInfo: {\n inviteLink: result.link,\n },\n });\n}\n","import { Api as GramJs, errors } from '../../../lib/gramjs';\n\nimport { OnApiUpdate } from '../../types';\n\nimport { DEBUG } from '../../../config';\nimport { invokeRequest, updateTwoFaSettings } from './client';\n\nconst ApiErrors: { [k: string]: string } = {\n EMAIL_UNCONFIRMED: 'Email unconfirmed',\n EMAIL_HASH_EXPIRED: 'Email hash expired',\n NEW_SALT_INVALID: 'The new salt is invalid',\n NEW_SETTINGS_INVALID: 'The new password settings are invalid',\n CODE_INVALID: 'Invalid Code',\n PASSWORD_HASH_INVALID: 'Invalid Password',\n};\n\nconst emailCodeController: {\n resolve?: Function;\n reject?: Function;\n} = {};\n\nlet onUpdate: OnApiUpdate;\n\nexport function init(_onUpdate: OnApiUpdate) {\n onUpdate = _onUpdate;\n}\n\nexport async function getPasswordInfo() {\n const result = await invokeRequest(new GramJs.account.GetPassword());\n if (!result) {\n return undefined;\n }\n\n const { hint, hasPassword } = result;\n\n return { hint, hasPassword };\n}\n\nfunction onRequestEmailCode(length: number) {\n onUpdate({\n '@type': 'updateTwoFaStateWaitCode',\n length,\n });\n\n return new Promise((resolve, reject) => {\n emailCodeController.resolve = resolve;\n emailCodeController.reject = reject;\n });\n}\n\nexport async function checkPassword(currentPassword: string) {\n try {\n await updateTwoFaSettings({ isCheckPassword: true, currentPassword });\n\n return true;\n } catch (err) {\n onError(err);\n\n return false;\n }\n}\n\nexport async function clearPassword(currentPassword: string) {\n try {\n await updateTwoFaSettings({ currentPassword });\n\n return true;\n } catch (err) {\n onError(err);\n\n return false;\n }\n}\n\nexport async function updatePassword(currentPassword: string, password: string, hint?: string, email?: string) {\n try {\n await updateTwoFaSettings({\n currentPassword,\n newPassword: password,\n hint,\n email,\n emailCodeCallback: onRequestEmailCode,\n onEmailCodeError: onError,\n });\n\n return true;\n } catch (err) {\n onError(err);\n\n return false;\n }\n}\n\nexport async function updateRecoveryEmail(currentPassword: string, email: string) {\n try {\n await updateTwoFaSettings({\n currentPassword,\n newPassword: currentPassword,\n email,\n emailCodeCallback: onRequestEmailCode,\n onEmailCodeError: onError,\n });\n\n return true;\n } catch (err) {\n onError(err);\n\n return false;\n }\n}\n\nexport function provideRecoveryEmailCode(code: string) {\n emailCodeController.resolve!(code);\n}\n\nfunction onError(err: Error) {\n let message: string;\n\n if (err instanceof errors.FloodWaitError) {\n const hours = Math.ceil(Number(err.seconds) / 60 / 60);\n message = `Too many attempts. Try again in ${hours > 1 ? `${hours} hours` : 'an hour'}`;\n } else {\n message = ApiErrors[err.message];\n }\n\n if (!message) {\n message = 'Unexpected Error';\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n }\n\n onUpdate({\n '@type': 'updateTwoFaError',\n message,\n });\n}\n","import BigInt from 'big-integer';\nimport { Api as GramJs } from '../../../lib/gramjs';\n\nimport {\n ApiChat, ApiLangString, ApiLanguage, ApiNotifyException, ApiUser, ApiWallpaper,\n} from '../../types';\nimport { ApiPrivacyKey, IInputPrivacyRules } from '../../../types';\n\nimport { BLOCKED_LIST_LIMIT, DEFAULT_LANG_PACK, LANG_PACKS } from '../../../config';\nimport {\n buildApiWallpaper, buildApiSession, buildPrivacyRules, buildApiNotifyException,\n} from '../apiBuilders/misc';\n\nimport { buildApiUser } from '../apiBuilders/users';\nimport { buildApiChatFromPreview, getApiChatIdFromMtpPeer } from '../apiBuilders/chats';\nimport { buildInputPrivacyKey, buildInputPeer } from '../gramjsBuilders';\nimport { invokeRequest, uploadFile, getClient } from './client';\nimport { omitVirtualClassFields } from '../apiBuilders/helpers';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport localDb from '../localDb';\nimport { getServerTime } from '../../../util/serverTime';\n\nconst MAX_INT_32 = 2 ** 31 - 1;\nconst BETA_LANG_CODES = ['ar', 'fa', 'id', 'ko', 'uz'];\n\nexport function updateProfile({\n firstName,\n lastName,\n about,\n}: {\n firstName?: string;\n lastName?: string;\n about?: string;\n}) {\n return invokeRequest(new GramJs.account.UpdateProfile({\n firstName: firstName || '',\n lastName: lastName || '',\n about: about || '',\n }));\n}\n\nexport function checkUsername(username: string) {\n return invokeRequest(new GramJs.account.CheckUsername({ username }));\n}\n\nexport function updateUsername(username: string) {\n return invokeRequest(new GramJs.account.UpdateUsername({ username }));\n}\n\nexport async function updateProfilePhoto(file: File) {\n const inputFile = await uploadFile(file);\n return invokeRequest(new GramJs.photos.UploadProfilePhoto({\n file: inputFile,\n }));\n}\n\nexport async function uploadProfilePhoto(file: File) {\n const inputFile = await uploadFile(file);\n await invokeRequest(new GramJs.photos.UploadProfilePhoto({\n file: inputFile,\n }));\n}\n\nexport async function fetchWallpapers(hash: number) {\n const result = await invokeRequest(new GramJs.account.GetWallPapers({ hash }));\n\n if (!result || result instanceof GramJs.account.WallPapersNotModified) {\n return undefined;\n }\n\n const filteredWallpapers = result.wallpapers.filter((wallpaper) => {\n if (\n !(wallpaper instanceof GramJs.WallPaper)\n || !(wallpaper.document instanceof GramJs.Document)\n ) {\n return false;\n }\n\n return !wallpaper.pattern && wallpaper.document.mimeType !== 'application/x-tgwallpattern';\n }) as GramJs.WallPaper[];\n\n filteredWallpapers.forEach((wallpaper) => {\n localDb.documents[String(wallpaper.document.id)] = wallpaper.document as GramJs.Document;\n });\n\n return {\n hash: result.hash,\n wallpapers: filteredWallpapers.map(buildApiWallpaper).filter(Boolean as any),\n };\n}\n\nexport async function uploadWallpaper(file: File) {\n const inputFile = await uploadFile(file);\n\n const result = await invokeRequest(new GramJs.account.UploadWallPaper({\n file: inputFile,\n mimeType: file.type,\n settings: new GramJs.WallPaperSettings(),\n }));\n\n if (!result || !(result instanceof GramJs.WallPaper)) {\n return undefined;\n }\n\n const wallpaper = buildApiWallpaper(result);\n if (!wallpaper) {\n return undefined;\n }\n\n localDb.documents[String(result.document.id)] = result.document as GramJs.Document;\n\n return { wallpaper };\n}\n\nexport async function fetchBlockedContacts() {\n const result = await invokeRequest(new GramJs.contacts.GetBlocked({\n limit: BLOCKED_LIST_LIMIT,\n }));\n if (!result) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n return {\n users: result.users.map(buildApiUser).filter(Boolean as any),\n chats: result.chats.map((chat) => buildApiChatFromPreview(chat, undefined, true)).filter(Boolean as any),\n blockedIds: result.blocked.map((blocked) => getApiChatIdFromMtpPeer(blocked.peerId)),\n totalCount: result instanceof GramJs.contacts.BlockedSlice ? result.count : result.blocked.length,\n };\n}\n\nexport function blockContact(chatOrUserId: number, accessHash?: string) {\n return invokeRequest(new GramJs.contacts.Block({\n id: buildInputPeer(chatOrUserId, accessHash),\n }));\n}\n\nexport function unblockContact(chatOrUserId: number, accessHash?: string) {\n return invokeRequest(new GramJs.contacts.Unblock({\n id: buildInputPeer(chatOrUserId, accessHash),\n }));\n}\n\nexport async function fetchAuthorizations() {\n const result = await invokeRequest(new GramJs.account.GetAuthorizations());\n if (!result) {\n return undefined;\n }\n\n return result.authorizations.map(buildApiSession);\n}\n\nexport function terminateAuthorization(hash: string) {\n return invokeRequest(new GramJs.account.ResetAuthorization({ hash: BigInt(hash) }));\n}\n\nexport function terminateAllAuthorizations() {\n return invokeRequest(new GramJs.auth.ResetAuthorizations());\n}\n\nexport async function fetchNotificationExceptions({\n serverTimeOffset,\n}: { serverTimeOffset: number }) {\n const result = await invokeRequest(new GramJs.account.GetNotifyExceptions({ compareSound: true }));\n\n if (!(result instanceof GramJs.Updates || result instanceof GramJs.UpdatesCombined)) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n return result.updates.reduce((acc, update) => {\n if (!(update instanceof GramJs.UpdateNotifySettings && update.peer instanceof GramJs.NotifyPeer)) {\n return acc;\n }\n\n acc.push(buildApiNotifyException(update.notifySettings, update.peer.peer, serverTimeOffset));\n\n return acc;\n }, [] as ApiNotifyException[]);\n}\n\nexport async function fetchNotificationSettings({\n serverTimeOffset,\n}: { serverTimeOffset: number }) {\n const [\n isMutedContactSignUpNotification,\n privateContactNotificationsSettings,\n groupNotificationsSettings,\n broadcastNotificationsSettings,\n ] = await Promise.all([\n invokeRequest(new GramJs.account.GetContactSignUpNotification()),\n invokeRequest(new GramJs.account.GetNotifySettings({\n peer: new GramJs.InputNotifyUsers(),\n })),\n invokeRequest(new GramJs.account.GetNotifySettings({\n peer: new GramJs.InputNotifyChats(),\n })),\n invokeRequest(new GramJs.account.GetNotifySettings({\n peer: new GramJs.InputNotifyBroadcasts(),\n })),\n ]);\n\n if (!privateContactNotificationsSettings || !groupNotificationsSettings || !broadcastNotificationsSettings) {\n return false;\n }\n\n const {\n silent: privateSilent, muteUntil: privateMuteUntil, showPreviews: privateShowPreviews,\n } = privateContactNotificationsSettings;\n const {\n silent: groupSilent, muteUntil: groupMuteUntil, showPreviews: groupShowPreviews,\n } = groupNotificationsSettings;\n const {\n silent: broadcastSilent, muteUntil: broadcastMuteUntil, showPreviews: broadcastShowPreviews,\n } = broadcastNotificationsSettings;\n\n return {\n hasContactJoinedNotifications: !isMutedContactSignUpNotification,\n hasPrivateChatsNotifications: !(\n privateSilent\n || (typeof privateMuteUntil === 'number' && getServerTime(serverTimeOffset) < privateMuteUntil)\n ),\n hasPrivateChatsMessagePreview: privateShowPreviews,\n hasGroupNotifications: !(\n groupSilent || (typeof groupMuteUntil === 'number'\n && getServerTime(serverTimeOffset) < groupMuteUntil)\n ),\n hasGroupMessagePreview: groupShowPreviews,\n hasBroadcastNotifications: !(\n broadcastSilent || (typeof broadcastMuteUntil === 'number'\n && getServerTime(serverTimeOffset) < broadcastMuteUntil)\n ),\n hasBroadcastMessagePreview: broadcastShowPreviews,\n };\n}\n\nexport function updateContactSignUpNotification(isSilent: boolean) {\n return invokeRequest(new GramJs.account.SetContactSignUpNotification({ silent: isSilent }));\n}\n\nexport function updateNotificationSettings(peerType: 'contact' | 'group' | 'broadcast', {\n isSilent,\n shouldShowPreviews,\n}: {\n isSilent: boolean;\n shouldShowPreviews: boolean;\n}) {\n let peer: GramJs.TypeInputNotifyPeer;\n if (peerType === 'contact') {\n peer = new GramJs.InputNotifyUsers();\n } else if (peerType === 'group') {\n peer = new GramJs.InputNotifyChats();\n } else {\n peer = new GramJs.InputNotifyBroadcasts();\n }\n\n const settings = {\n showPreviews: shouldShowPreviews,\n silent: isSilent,\n muteUntil: isSilent ? MAX_INT_32 : 0,\n };\n\n return invokeRequest(new GramJs.account.UpdateNotifySettings({\n peer,\n settings: new GramJs.InputPeerNotifySettings(settings),\n }));\n}\n\nexport async function fetchLanguages(): Promise {\n const result = await invokeRequest(new GramJs.langpack.GetLanguages({\n langPack: DEFAULT_LANG_PACK,\n }));\n if (!result) {\n return undefined;\n }\n\n return result.map(omitVirtualClassFields);\n}\n\nexport async function fetchLangPack({ sourceLangPacks, langCode }: {\n sourceLangPacks: typeof LANG_PACKS;\n langCode: string;\n}) {\n const results = await Promise.all(sourceLangPacks.map((langPack) => {\n return invokeRequest(new GramJs.langpack.GetLangPack({\n langPack,\n langCode: BETA_LANG_CODES.includes(langCode) ? `${langCode}-raw` : langCode,\n }));\n }));\n\n const collections = results\n .filter(Boolean as any)\n .map((result) => {\n return buildCollectionByKey(result.strings.map(omitVirtualClassFields), 'key');\n });\n\n if (!collections.length) {\n return undefined;\n }\n\n return { langPack: Object.assign({}, ...collections.reverse()) };\n}\n\nexport async function fetchLangStrings({ langPack, langCode, keys }: {\n langPack: string; langCode: string; keys: string[];\n}) {\n const result = await invokeRequest(new GramJs.langpack.GetStrings({\n langPack,\n langCode: BETA_LANG_CODES.includes(langCode) ? `${langCode}-raw` : langCode,\n keys,\n }));\n\n if (!result) {\n return undefined;\n }\n\n return result.map(omitVirtualClassFields);\n}\n\nexport async function fetchPrivacySettings(privacyKey: ApiPrivacyKey) {\n const key = buildInputPrivacyKey(privacyKey);\n const result = await invokeRequest(new GramJs.account.GetPrivacy({ key }));\n\n if (!result) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n return buildPrivacyRules(result.rules);\n}\n\nexport function registerDevice(token: string) {\n const client = getClient();\n const secret = client.session.getAuthKey().getKey();\n return invokeRequest(new GramJs.account.RegisterDevice({\n tokenType: 10,\n secret,\n appSandbox: false,\n otherUids: [],\n token,\n }));\n}\n\nexport function unregisterDevice(token: string) {\n return invokeRequest(new GramJs.account.UnregisterDevice({\n tokenType: 10,\n otherUids: [],\n token,\n }));\n}\n\nexport async function setPrivacySettings(\n privacyKey: ApiPrivacyKey, rules: IInputPrivacyRules,\n) {\n const key = buildInputPrivacyKey(privacyKey);\n const privacyRules: GramJs.TypeInputPrivacyRule[] = [];\n\n if (rules.allowedUsers) {\n privacyRules.push(new GramJs.InputPrivacyValueAllowUsers({\n users: rules.allowedUsers.map(({ id, accessHash }) => buildInputPeer(id, accessHash)),\n }));\n }\n if (rules.allowedChats) {\n privacyRules.push(new GramJs.InputPrivacyValueAllowChatParticipants({\n chats: rules.allowedChats.map(({ id }) => -id),\n }));\n }\n if (rules.blockedUsers) {\n privacyRules.push(new GramJs.InputPrivacyValueDisallowUsers({\n users: rules.blockedUsers.map(({ id, accessHash }) => buildInputPeer(id, accessHash)),\n }));\n }\n if (rules.blockedChats) {\n privacyRules.push(new GramJs.InputPrivacyValueDisallowChatParticipants({\n chats: rules.blockedChats.map(({ id }) => -id),\n }));\n }\n switch (rules.visibility) {\n case 'everybody':\n privacyRules.push(new GramJs.InputPrivacyValueAllowAll());\n break;\n\n case 'contacts':\n privacyRules.push(new GramJs.InputPrivacyValueAllowContacts());\n break;\n\n case 'nonContacts':\n privacyRules.push(new GramJs.InputPrivacyValueDisallowContacts());\n break;\n\n case 'nobody':\n privacyRules.push(new GramJs.InputPrivacyValueDisallowAll());\n break;\n }\n\n const result = await invokeRequest(new GramJs.account.SetPrivacy({ key, rules: privacyRules }));\n\n if (!result) {\n return undefined;\n }\n\n updateLocalDb(result);\n\n return buildPrivacyRules(result.rules);\n}\n\nexport async function updateIsOnline(isOnline: boolean) {\n await invokeRequest(new GramJs.account.UpdateStatus({ offline: !isOnline }));\n}\n\nexport async function fetchContentSettings() {\n const result = await invokeRequest(new GramJs.account.GetContentSettings());\n if (!result) {\n return undefined;\n }\n\n return {\n isSensitiveEnabled: Boolean(result.sensitiveEnabled),\n canChangeSensitive: Boolean(result.sensitiveCanChange),\n };\n}\n\nexport function updateContentSettings(isEnabled: boolean) {\n return invokeRequest(new GramJs.account.SetContentSettings({\n sensitiveEnabled: isEnabled || undefined,\n }));\n}\n\nfunction updateLocalDb(\n result: (\n GramJs.account.PrivacyRules | GramJs.contacts.Blocked | GramJs.contacts.BlockedSlice |\n GramJs.Updates | GramJs.UpdatesCombined\n ),\n) {\n result.users.forEach((user) => {\n if (user instanceof GramJs.User) {\n localDb.users[user.id] = user;\n }\n });\n\n result.chats.forEach((chat) => {\n if (chat instanceof GramJs.Chat || chat instanceof GramJs.Channel) {\n localDb.chats[chat.id] = chat;\n }\n });\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\nimport {\n ApiBotInlineMediaResult, ApiBotInlineResult, ApiBotInlineSwitchPm, ApiInlineResultType, ApiWebDocument,\n} from '../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport { buildApiPhoto, buildApiThumbnailFromStripped } from './common';\nimport { buildVideoFromDocument } from './messages';\nimport { buildStickerFromDocument } from './symbols';\n\nexport function buildApiBotInlineResult(result: GramJs.BotInlineResult, queryId: string): ApiBotInlineResult {\n const {\n id, type, title, description, url, thumb,\n } = result;\n\n return {\n id,\n queryId,\n type: type as ApiInlineResultType,\n title,\n description,\n url,\n webThumbnail: buildApiWebDocument(thumb),\n };\n}\n\nexport function buildApiBotInlineMediaResult(\n result: GramJs.BotInlineMediaResult, queryId: string,\n): ApiBotInlineMediaResult {\n const {\n id, type, title, description, photo, document,\n } = result;\n\n return {\n id,\n queryId,\n type: type as ApiInlineResultType,\n title,\n description,\n ...(type === 'sticker' && document instanceof GramJs.Document && { sticker: buildStickerFromDocument(document) }),\n ...(photo instanceof GramJs.Photo && { photo: buildApiPhoto(photo) }),\n ...(type === 'gif' && document instanceof GramJs.Document && { gif: buildVideoFromDocument(document) }),\n ...(type === 'video' && document instanceof GramJs.Document && {\n thumbnail: buildApiThumbnailFromStripped(document.thumbs),\n }),\n };\n}\n\nexport function buildBotSwitchPm(switchPm?: GramJs.InlineBotSwitchPM) {\n return switchPm ? pick(switchPm, ['text', 'startParam']) as ApiBotInlineSwitchPm : undefined;\n}\n\nfunction buildApiWebDocument(document?: GramJs.TypeWebDocument): ApiWebDocument | undefined {\n return document ? pick(document, ['url', 'mimeType']) : undefined;\n}\n","import BigInt from 'big-integer';\nimport { Api as GramJs } from '../../../lib/gramjs';\n\nimport { ApiChat, ApiUser } from '../../types';\n\nimport localDb from '../localDb';\nimport { invokeRequest } from './client';\nimport { buildInputPeer, calculateResultHash, generateRandomBigInt } from '../gramjsBuilders';\nimport { buildApiUser } from '../apiBuilders/users';\nimport { buildApiBotInlineMediaResult, buildApiBotInlineResult, buildBotSwitchPm } from '../apiBuilders/bots';\nimport { buildApiChatFromPreview } from '../apiBuilders/chats';\n\nexport function init() {\n}\n\nexport function answerCallbackButton(\n {\n chatId, accessHash, messageId, data,\n }: {\n chatId: number; accessHash?: string; messageId: number; data: string;\n },\n) {\n return invokeRequest(new GramJs.messages.GetBotCallbackAnswer({\n peer: buildInputPeer(chatId, accessHash),\n msgId: messageId,\n data: Buffer.from(data),\n }));\n}\n\nexport async function fetchTopInlineBots({ hash = 0 }: { hash?: number }) {\n const topPeers = await invokeRequest(new GramJs.contacts.GetTopPeers({\n hash,\n botsInline: true,\n }));\n\n if (!(topPeers instanceof GramJs.contacts.TopPeers)) {\n return undefined;\n }\n\n const users = topPeers.users.map(buildApiUser).filter(Boolean as any);\n const ids = users.map(({ id }) => id);\n\n return {\n hash: calculateResultHash(ids),\n ids,\n users,\n };\n}\n\nexport async function fetchInlineBot({ username }: { username: string }) {\n const resolvedPeer = await invokeRequest(new GramJs.contacts.ResolveUsername({ username }));\n\n if (\n !resolvedPeer\n || !(\n resolvedPeer.users[0] instanceof GramJs.User\n && resolvedPeer.users[0].bot\n && resolvedPeer.users[0].botInlinePlaceholder\n )\n ) {\n return undefined;\n }\n\n addUserToLocalDb(resolvedPeer.users[0]);\n\n return {\n user: buildApiUser(resolvedPeer.users[0]),\n chat: buildApiChatFromPreview(resolvedPeer.users[0]),\n };\n}\n\nexport async function fetchInlineBotResults({\n bot, chat, query, offset = '',\n}: {\n bot: ApiUser; chat: ApiChat; query: string; offset?: string;\n}) {\n const result = await invokeRequest(new GramJs.messages.GetInlineBotResults({\n bot: buildInputPeer(bot.id, bot.accessHash),\n peer: buildInputPeer(chat.id, chat.accessHash),\n query,\n offset,\n }));\n\n if (!result) {\n return undefined;\n }\n\n result.users.map(addUserToLocalDb);\n\n return {\n isGallery: Boolean(result.gallery),\n help: bot.botPlaceholder,\n nextOffset: getInlineBotResultsNextOffset(bot.username, result.nextOffset),\n switchPm: buildBotSwitchPm(result.switchPm),\n users: result.users.map(buildApiUser).filter(Boolean as any),\n results: processInlineBotResult(String(result.queryId), result.results),\n };\n}\n\nexport async function sendInlineBotResult({\n chat, resultId, queryId, replyingTo,\n}: {\n chat: ApiChat;\n resultId: string;\n queryId: string;\n replyingTo?: number;\n}) {\n const randomId = generateRandomBigInt();\n\n await invokeRequest(new GramJs.messages.SendInlineBotResult({\n clearDraft: true,\n randomId,\n queryId: BigInt(queryId),\n peer: buildInputPeer(chat.id, chat.accessHash),\n id: resultId,\n ...(replyingTo && { replyToMsgId: replyingTo }),\n }), true);\n}\n\nexport async function startBot({\n bot, startParam,\n}: {\n bot: ApiUser;\n startParam?: string;\n}) {\n const randomId = generateRandomBigInt();\n\n await invokeRequest(new GramJs.messages.StartBot({\n bot: buildInputPeer(bot.id, bot.accessHash),\n peer: buildInputPeer(bot.id, bot.accessHash),\n randomId,\n startParam,\n }), true);\n}\n\nfunction processInlineBotResult(queryId: string, results: GramJs.TypeBotInlineResult[]) {\n return results.map((result) => {\n if (result instanceof GramJs.BotInlineMediaResult) {\n if (result.document instanceof GramJs.Document) {\n addDocumentToLocalDb(result.document);\n }\n\n if (result.photo instanceof GramJs.Photo) {\n addPhotoToLocalDb(result.photo);\n }\n\n return buildApiBotInlineMediaResult(result, queryId);\n }\n\n if (result.thumb) {\n addWebDocumentToLocalDb(result.thumb);\n }\n\n return buildApiBotInlineResult(result, queryId);\n });\n}\n\nfunction getInlineBotResultsNextOffset(username: string, nextOffset?: string) {\n return username === 'gif' && nextOffset === '0' ? '' : nextOffset;\n}\n\nfunction addUserToLocalDb(user: GramJs.User) {\n localDb.users[user.id] = user;\n}\n\nfunction addDocumentToLocalDb(document: GramJs.Document) {\n localDb.documents[String(document.id)] = document;\n}\n\nfunction addPhotoToLocalDb(photo: GramJs.Photo) {\n localDb.photos[String(photo.id)] = photo;\n}\n\nfunction addWebDocumentToLocalDb(webDocument: GramJs.TypeWebDocument) {\n localDb.webDocuments[webDocument.url] = webDocument;\n}\n","import { Api as GramJs } from '../../../lib/gramjs';\n\nexport function buildShippingOptions(shippingOptions: GramJs.ShippingOption[] | undefined) {\n if (!shippingOptions) {\n return undefined;\n }\n return Object.values(shippingOptions).map((option) => {\n return {\n id: option.id,\n title: option.title,\n amount: option.prices.reduce((ac, cur) => ac + Number((cur.amount as any).value), 0),\n prices: option.prices.map(({ label, amount }) => {\n return {\n label,\n amount: Number((amount as any).value),\n };\n }),\n };\n });\n}\n\nexport function buildReceipt(receipt: GramJs.payments.PaymentReceipt) {\n const {\n invoice,\n info,\n shipping,\n currency,\n totalAmount,\n credentialsTitle,\n } = receipt;\n\n const { shippingAddress, phone, name } = (info || {});\n\n const { prices } = invoice;\n const mapedPrices = prices.map(({ label, amount }) => ({\n label,\n amount: Number((amount as any).value),\n }));\n\n let shippingPrices;\n let shippingMethod;\n\n if (shipping) {\n shippingPrices = shipping.prices.map(({ label, amount }) => {\n return {\n label,\n amount: Number((amount as any).value),\n };\n });\n shippingMethod = shipping.title;\n }\n\n return {\n currency,\n prices: mapedPrices,\n info: { shippingAddress, phone, name },\n totalAmount: Number((totalAmount as any).value),\n credentialsTitle,\n shippingPrices,\n shippingMethod,\n };\n}\n\nexport function buildPaymentForm(form: GramJs.payments.PaymentForm) {\n const {\n formId,\n canSaveCredentials,\n passwordMissing,\n providerId,\n nativeProvider,\n nativeParams,\n savedInfo,\n invoice,\n } = form;\n\n const {\n test,\n nameRequested,\n phoneRequested,\n emailRequested,\n shippingAddressRequested,\n flexible,\n phoneToProvider,\n emailToProvider,\n currency,\n prices,\n } = invoice;\n\n const mapedPrices = prices.map(({ label, amount }) => ({\n label,\n amount: Number((amount as any).value),\n }));\n\n const nativeData = nativeParams ? JSON.parse(nativeParams.data) : {};\n return {\n canSaveCredentials,\n passwordMissing,\n formId: String(formId),\n providerId,\n nativeProvider,\n savedInfo,\n invoice: {\n test,\n nameRequested,\n phoneRequested,\n emailRequested,\n shippingAddressRequested,\n flexible,\n phoneToProvider,\n emailToProvider,\n currency,\n prices: mapedPrices,\n },\n nativeParams: {\n needCardholderName: nativeData.need_cardholder_name,\n needCountry: nativeData.need_country,\n needZip: nativeData.need_zip,\n publishableKey: nativeData.publishable_key,\n },\n };\n}\n","import BigInt from 'big-integer';\nimport { Api as GramJs } from '../../../lib/gramjs';\nimport { invokeRequest } from './client';\nimport { buildInputPeer, buildShippingInfo } from '../gramjsBuilders';\nimport { buildShippingOptions, buildPaymentForm, buildReceipt } from '../apiBuilders/payments';\nimport { ApiChat } from '../../types';\n\nexport async function validateRequestedInfo({\n chat,\n messageId,\n requestInfo,\n shouldSave,\n}: {\n chat: ApiChat;\n messageId: number;\n requestInfo: GramJs.TypePaymentRequestedInfo;\n shouldSave?: boolean;\n}): Promise<{\n id: string;\n shippingOptions: any;\n } | undefined> {\n const result = await invokeRequest(new GramJs.payments.ValidateRequestedInfo({\n peer: buildInputPeer(chat.id, chat.accessHash),\n msgId: messageId,\n save: shouldSave || undefined,\n info: buildShippingInfo(requestInfo),\n }));\n if (!result) {\n return undefined;\n }\n\n const { id, shippingOptions } = result;\n if (!id) {\n return undefined;\n }\n\n return {\n id,\n shippingOptions: buildShippingOptions(shippingOptions),\n };\n}\n\nexport function sendPaymentForm({\n chat,\n messageId,\n formId,\n requestedInfoId,\n shippingOptionId,\n credentials,\n}: {\n chat: ApiChat;\n messageId: number;\n formId: string;\n credentials: any;\n requestedInfoId?: string;\n shippingOptionId?: string;\n}) {\n return invokeRequest(new GramJs.payments.SendPaymentForm({\n formId: BigInt(formId),\n peer: buildInputPeer(chat.id, chat.accessHash),\n msgId: messageId,\n requestedInfoId,\n shippingOptionId,\n credentials: new GramJs.InputPaymentCredentials({\n save: credentials.save,\n data: new GramJs.DataJSON({ data: JSON.stringify(credentials.data) }),\n }),\n }), true);\n}\n\nexport async function getPaymentForm({\n chat, messageId,\n}: {\n chat: ApiChat;\n messageId: number;\n}) {\n const result = await invokeRequest(new GramJs.payments.GetPaymentForm({\n peer: buildInputPeer(chat.id, chat.accessHash),\n msgId: messageId,\n }));\n\n if (!result) {\n return undefined;\n }\n\n return buildPaymentForm(result);\n}\n\nexport async function getReceipt(chat: ApiChat, msgId: number) {\n const result = await invokeRequest(new GramJs.payments.GetPaymentReceipt({\n peer: buildInputPeer(chat.id, chat.accessHash),\n msgId,\n }));\n if (!result) {\n return undefined;\n }\n\n return buildReceipt(result);\n}\n","import {\n OnApiUpdate,\n ApiInitialArgs,\n ApiUpdate,\n ApiOnProgress,\n} from '../types';\nimport { Methods, MethodArgs, MethodResponse } from './methods/types';\n\nimport { API_THROTTLE_RESET_UPDATES, API_UPDATE_THROTTLE } from '../../config';\nimport { throttle, throttleWithTickEnd } from '../../util/schedulers';\nimport { init as initUpdater } from './updater';\nimport { init as initAuth } from './methods/auth';\nimport { init as initChats } from './methods/chats';\nimport { init as initMessages } from './methods/messages';\nimport { init as initUsers } from './methods/users';\nimport { init as initClient } from './methods/client';\nimport { init as initStickers } from './methods/symbols';\nimport { init as initManagement } from './methods/management';\nimport { init as initTwoFaSettings } from './methods/twoFaSettings';\nimport * as methods from './methods';\n\nlet onUpdate: OnApiUpdate;\n\nexport async function initApi(_onUpdate: OnApiUpdate, initialArgs: ApiInitialArgs) {\n onUpdate = _onUpdate;\n\n initUpdater(handleUpdate);\n initAuth(handleUpdate);\n initChats(handleUpdate);\n initMessages(handleUpdate);\n initUsers(handleUpdate);\n initStickers(handleUpdate);\n initManagement(handleUpdate);\n initTwoFaSettings(handleUpdate);\n\n await initClient(handleUpdate, initialArgs);\n}\n\nexport function callApi(fnName: T, ...args: MethodArgs): MethodResponse {\n // @ts-ignore\n return methods[fnName](...args) as MethodResponse;\n}\n\nexport function cancelApiProgress(progressCallback: ApiOnProgress) {\n progressCallback.isCanceled = true;\n}\n\nconst flushUpdatesOnTickEnd = throttleWithTickEnd(flushUpdates);\n\nlet flushUpdatesThrottled: typeof flushUpdatesOnTickEnd | undefined;\nlet currentThrottleId: number | undefined;\n\nlet pendingUpdates: ApiUpdate[] | undefined;\n\nfunction handleUpdate(update: ApiUpdate) {\n if (!pendingUpdates) {\n pendingUpdates = [update];\n } else {\n pendingUpdates.push(update);\n }\n\n if (!flushUpdatesThrottled || API_THROTTLE_RESET_UPDATES.has(update['@type'])) {\n flushUpdatesThrottled = throttle(flushUpdatesOnTickEnd, API_UPDATE_THROTTLE, true);\n currentThrottleId = Math.random();\n }\n\n flushUpdatesThrottled(currentThrottleId!);\n}\n\nfunction flushUpdates(throttleId: number) {\n if (!pendingUpdates || throttleId !== currentThrottleId) {\n return;\n }\n\n const currentUpdates = pendingUpdates!;\n pendingUpdates = undefined;\n currentUpdates.forEach(onUpdate);\n}\n","type Scheduler =\n typeof requestAnimationFrame\n | typeof onTickEnd\n | typeof runNow;\n\nexport function debounce(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n shouldRunLast = true,\n) {\n let waitingTimeout: number | undefined;\n\n return (...args: Parameters) => {\n if (waitingTimeout) {\n clearTimeout(waitingTimeout);\n waitingTimeout = undefined;\n } else if (shouldRunFirst) {\n // @ts-ignore\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n waitingTimeout = self.setTimeout(() => {\n if (shouldRunLast) {\n // @ts-ignore\n fn(...args);\n }\n\n waitingTimeout = undefined;\n }, ms);\n };\n}\n\nexport function throttle(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n) {\n let interval: number | undefined;\n let isPending: boolean;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n isPending = true;\n args = _args;\n\n if (!interval) {\n if (shouldRunFirst) {\n isPending = false;\n // @ts-ignore\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n interval = self.setInterval(() => {\n if (!isPending) {\n // eslint-disable-next-line no-restricted-globals\n self.clearInterval(interval!);\n interval = undefined;\n return;\n }\n\n isPending = false;\n // @ts-ignore\n fn(...args);\n }, ms);\n }\n };\n}\n\nexport function throttleWithRaf(fn: F) {\n return throttleWith(fastRaf, fn);\n}\n\nexport function throttleWithPrimaryRaf(fn: F) {\n return throttleWith(fastPrimaryRaf, fn);\n}\n\nexport function throttleWithTickEnd(fn: F) {\n return throttleWith(onTickEnd, fn);\n}\n\nexport function throttleWithNow(fn: F) {\n return throttleWith(runNow, fn);\n}\n\nexport function throttleWith(schedulerFn: Scheduler, fn: F) {\n let waiting = false;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n args = _args;\n\n if (!waiting) {\n waiting = true;\n\n schedulerFn(() => {\n waiting = false;\n // @ts-ignore\n fn(...args);\n });\n }\n };\n}\n\nexport function onTickEnd(cb: NoneToVoidFunction) {\n Promise.resolve().then(cb);\n}\n\nexport function onIdle(cb: NoneToVoidFunction) {\n // eslint-disable-next-line no-restricted-globals\n if (self.requestIdleCallback) {\n // eslint-disable-next-line no-restricted-globals\n self.requestIdleCallback(cb);\n } else {\n onTickEnd(cb);\n }\n}\n\nfunction runNow(fn: NoneToVoidFunction) {\n fn();\n}\n\nexport const pause = (ms: number) => new Promise((resolve) => {\n setTimeout(() => resolve(), ms);\n});\n\nexport function rafPromise() {\n return new Promise((resolve) => {\n fastRaf(resolve);\n });\n}\n\nlet fastRafCallbacks: NoneToVoidFunction[] | undefined;\nlet fastRafPrimaryCallbacks: NoneToVoidFunction[] | undefined;\n\n// May result in an immediate execution if called from another `requestAnimationFrame` callback\nexport function fastRaf(callback: NoneToVoidFunction, isPrimary = false) {\n if (!fastRafCallbacks) {\n fastRafCallbacks = isPrimary ? [] : [callback];\n fastRafPrimaryCallbacks = isPrimary ? [callback] : [];\n\n requestAnimationFrame(() => {\n const currentCallbacks = fastRafCallbacks!;\n const currentPrimaryCallbacks = fastRafPrimaryCallbacks!;\n fastRafCallbacks = undefined;\n fastRafPrimaryCallbacks = undefined;\n currentPrimaryCallbacks.forEach((cb) => cb());\n currentCallbacks.forEach((cb) => cb());\n });\n } else if (isPrimary) {\n fastRafPrimaryCallbacks!.push(callback);\n } else {\n fastRafCallbacks.push(callback);\n }\n}\n\nexport function fastPrimaryRaf(callback: NoneToVoidFunction) {\n fastRaf(callback, true);\n}\n\nlet beforeUnloadCallbacks: NoneToVoidFunction[] | undefined;\n\nexport function onBeforeUnload(callback: NoneToVoidFunction, isLast = false) {\n if (!beforeUnloadCallbacks) {\n beforeUnloadCallbacks = [];\n // eslint-disable-next-line no-restricted-globals\n self.addEventListener('beforeunload', () => {\n beforeUnloadCallbacks!.forEach((cb) => cb());\n });\n }\n\n if (isLast) {\n beforeUnloadCallbacks.push(callback);\n } else {\n beforeUnloadCallbacks.unshift(callback);\n }\n\n return () => {\n beforeUnloadCallbacks = beforeUnloadCallbacks!.filter((cb) => cb !== callback);\n };\n}\n","import { ApiOnProgress, ApiUpdate } from '../../types';\nimport { OriginMessageEvent, WorkerMessageData } from './types';\n\nimport { DEBUG } from '../../../config';\nimport { initApi, callApi, cancelApiProgress } from '../provider';\n\ndeclare const self: WorkerGlobalScope;\n\nhandleErrors();\n\n// TODO Re-use `util/createWorkerInterface.ts`\n\nconst callbackState = new Map();\n\nif (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH LOAD WORKER');\n}\n\nonmessage = async (message: OriginMessageEvent) => {\n const { data } = message;\n\n switch (data.type) {\n case 'initApi': {\n await initApi(onUpdate, data.args[0]);\n break;\n }\n case 'callMethod': {\n const { messageId, name, args } = data;\n try {\n if (messageId) {\n const callback = (...callbackArgs: any[]) => {\n const lastArg = callbackArgs[callbackArgs.length - 1];\n\n sendToOrigin({\n type: 'methodCallback',\n messageId,\n callbackArgs,\n }, lastArg instanceof ArrayBuffer ? lastArg : undefined);\n };\n\n callbackState.set(messageId, callback);\n\n args.push(callback as never);\n }\n\n const response = await callApi(name, ...args);\n const { arrayBuffer } = (typeof response === 'object' && 'arrayBuffer' in response && response) || {};\n\n if (messageId) {\n sendToOrigin({\n type: 'methodResponse',\n messageId,\n response,\n }, arrayBuffer);\n }\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n\n if (messageId) {\n sendToOrigin({\n type: 'methodResponse',\n messageId,\n error: { message: error.message },\n });\n }\n }\n\n if (messageId) {\n callbackState.delete(messageId);\n }\n\n break;\n }\n case 'cancelProgress': {\n const callback = callbackState.get(data.messageId);\n if (callback) {\n cancelApiProgress(callback);\n }\n\n break;\n }\n case 'ping': {\n sendToOrigin({\n type: 'methodResponse',\n messageId: data.messageId!,\n });\n\n break;\n }\n }\n};\n\nfunction handleErrors() {\n self.onerror = (e) => {\n // eslint-disable-next-line no-console\n console.error(e);\n sendToOrigin({ type: 'unhandledError', error: { message: e.error.message || 'Uncaught exception in worker' } });\n };\n\n self.addEventListener('unhandledrejection', (e) => {\n // eslint-disable-next-line no-console\n console.error(e);\n sendToOrigin({ type: 'unhandledError', error: { message: e.reason.message || 'Uncaught rejection in worker' } });\n });\n}\n\nfunction onUpdate(update: ApiUpdate) {\n sendToOrigin({\n type: 'update',\n update,\n });\n}\n\nfunction sendToOrigin(data: WorkerMessageData, arrayBuffer?: ArrayBuffer) {\n if (arrayBuffer) {\n postMessage(data, [arrayBuffer]);\n } else {\n postMessage(data);\n }\n}\n","const BigInt = require('big-integer');\nconst crypto = require('./crypto/crypto');\n\n/**\n * converts a buffer to big int\n * @param buffer\n * @param little\n * @param signed\n * @returns {bigInt.BigInteger}\n */\nfunction readBigIntFromBuffer(buffer, little = true, signed = false) {\n let randBuffer = Buffer.from(buffer);\n const bytesNumber = randBuffer.length;\n if (little) {\n randBuffer = randBuffer.reverse();\n }\n let bigInt = BigInt(randBuffer.toString('hex'), 16);\n if (signed && Math.floor(bigInt.toString('2').length / 8) >= bytesNumber) {\n bigInt = bigInt.subtract(BigInt(2)\n .pow(BigInt(bytesNumber * 8)));\n }\n return bigInt;\n}\n\n/**\n * Special case signed little ints\n * @param big\n * @param number\n * @returns {Buffer}\n */\nfunction toSignedLittleBuffer(big, number = 8) {\n const bigNumber = BigInt(big);\n const byteArray = [];\n for (let i = 0; i < number; i++) {\n byteArray[i] = bigNumber.shiftRight(8 * i)\n .and(255);\n }\n return Buffer.from(byteArray);\n}\n\n\n/**\n * converts a big int to a buffer\n * @param bigInt {bigInt.BigInteger}\n * @param bytesNumber\n * @param little\n * @param signed\n * @returns {Buffer}\n */\nfunction readBufferFromBigInt(bigInt, bytesNumber, little = true, signed = false) {\n bigInt = BigInt(bigInt);\n const bitLength = bigInt.bitLength();\n\n const bytes = Math.ceil(bitLength / 8);\n if (bytesNumber < bytes) {\n throw new Error('OverflowError: int too big to convert');\n }\n if (!signed && bigInt.lesser(BigInt(0))) {\n throw new Error('Cannot convert to unsigned');\n }\n let below = false;\n if (bigInt.lesser(BigInt(0))) {\n below = true;\n bigInt = bigInt.abs();\n }\n\n const hex = bigInt.toString('16')\n .padStart(bytesNumber * 2, '0');\n let l = Buffer.from(hex, 'hex');\n if (little) {\n l = l.reverse();\n }\n\n if (signed && below) {\n if (little) {\n let reminder = false;\n if (l[0] !== 0) {\n l[0] -= 1;\n }\n for (let i = 0; i < l.length; i++) {\n if (l[i] === 0) {\n reminder = true;\n continue;\n }\n if (reminder) {\n l[i] -= 1;\n reminder = false;\n }\n l[i] = 255 - l[i];\n }\n } else {\n l[l.length - 1] = 256 - l[l.length - 1];\n for (let i = 0; i < l.length - 1; i++) {\n l[i] = 255 - l[i];\n }\n }\n }\n return l;\n}\n\n/**\n * Generates a random long integer (8 bytes), which is optionally signed\n * @returns {BigInteger}\n */\nfunction generateRandomLong(signed = true) {\n return readBigIntFromBuffer(generateRandomBytes(8), true, signed);\n}\n\n/**\n * .... really javascript\n * @param n {number}\n * @param m {number}\n * @returns {number}\n */\nfunction mod(n, m) {\n return ((n % m) + m) % m;\n}\n\n/**\n * returns a positive bigInt\n * @param n {BigInt}\n * @param m {BigInt}\n * @returns {BigInt}\n */\nfunction bigIntMod(n, m) {\n return ((n.remainder(m)).add(m)).remainder(m);\n}\n\n/**\n * Generates a random bytes array\n * @param count\n * @returns {Buffer}\n */\nfunction generateRandomBytes(count) {\n return Buffer.from(crypto.randomBytes(count));\n}\n\n/**\n * Calculate the key based on Telegram guidelines, specifying whether it's the client or not\n * @param sharedKey\n * @param msgKey\n * @param client\n * @returns {{iv: Buffer, key: Buffer}}\n */\n\n/* CONTEST\nthis is mtproto 1 (mostly used for secret chats)\nasync function calcKey(sharedKey, msgKey, client) {\n const x = client === true ? 0 : 8\n const [sha1a, sha1b, sha1c, sha1d] = await Promise.all([\n sha1(Buffer.concat([msgKey, sharedKey.slice(x, x + 32)])),\n sha1(Buffer.concat([sharedKey.slice(x + 32, x + 48), msgKey, sharedKey.slice(x + 48, x + 64)])),\n sha1(Buffer.concat([sharedKey.slice(x + 64, x + 96), msgKey])),\n sha1(Buffer.concat([msgKey, sharedKey.slice(x + 96, x + 128)]))\n ])\n const key = Buffer.concat([sha1a.slice(0, 8), sha1b.slice(8, 20), sha1c.slice(4, 16)])\n const iv = Buffer.concat([sha1a.slice(8, 20), sha1b.slice(0, 8), sha1c.slice(16, 20), sha1d.slice(0, 8)])\n return {\n key,\n iv\n }\n}\n\n */\n\n/**\n * Generates the key data corresponding to the given nonces\n * @param serverNonce\n * @param newNonce\n * @returns {{key: Buffer, iv: Buffer}}\n */\nasync function generateKeyDataFromNonce(serverNonce, newNonce) {\n serverNonce = toSignedLittleBuffer(serverNonce, 16);\n newNonce = toSignedLittleBuffer(newNonce, 32);\n const [hash1, hash2, hash3] = await Promise.all([\n sha1(Buffer.concat([newNonce, serverNonce])),\n sha1(Buffer.concat([serverNonce, newNonce])),\n sha1(Buffer.concat([newNonce, newNonce])),\n ]);\n const keyBuffer = Buffer.concat([hash1, hash2.slice(0, 12)]);\n const ivBuffer = Buffer.concat([hash2.slice(12, 20), hash3, newNonce.slice(0, 4)]);\n return {\n key: keyBuffer,\n iv: ivBuffer,\n };\n}\n\nfunction convertToLittle(buf) {\n const correct = Buffer.alloc(buf.length * 4);\n\n for (let i = 0; i < buf.length; i++) {\n correct.writeUInt32BE(buf[i], i * 4);\n }\n return correct;\n}\n\n/**\n * Calculates the SHA1 digest for the given data\n * @param data\n * @returns {Promise}\n */\nfunction sha1(data) {\n const shaSum = crypto.createHash('sha1');\n shaSum.update(data);\n return shaSum.digest();\n}\n\n\n/**\n * Calculates the SHA256 digest for the given data\n * @param data\n * @returns {Promise}\n */\nfunction sha256(data) {\n const shaSum = crypto.createHash('sha256');\n shaSum.update(data);\n return shaSum.digest();\n}\n\n/**\n * Fast mod pow for RSA calculation. a^b % n\n * @param a\n * @param b\n * @param n\n * @returns {bigInt.BigInteger}\n */\nfunction modExp(a, b, n) {\n a = a.remainder(n);\n let result = BigInt.one;\n let x = a;\n while (b.greater(BigInt.zero)) {\n const leastSignificantBit = b.remainder(BigInt(2));\n b = b.divide(BigInt(2));\n if (leastSignificantBit.eq(BigInt.one)) {\n result = result.multiply(x);\n result = result.remainder(n);\n }\n x = x.multiply(x);\n x = x.remainder(n);\n }\n return result;\n}\n\n\n/**\n * Gets the arbitrary-length byte array corresponding to the given integer\n * @param integer {number,BigInteger}\n * @param signed {boolean}\n * @returns {Buffer}\n */\nfunction getByteArray(integer, signed = false) {\n const bits = integer.toString(2).length;\n const byteLength = Math.floor((bits + 8 - 1) / 8);\n return readBufferFromBigInt(BigInt(integer), byteLength, false, signed);\n}\n\n/**\n * returns a random int from min (inclusive) and max (inclusive)\n * @param min\n * @param max\n * @returns {number}\n */\nfunction getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}\n\n/**\n * Sleeps a specified amount of time\n * @param ms time in milliseconds\n * @returns {Promise}\n */\nconst sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));\n\n/**\n * Helper to export two buffers of same length\n * @returns {Buffer}\n */\n\nfunction bufferXor(a, b) {\n const res = [];\n for (let i = 0; i < a.length; i++) {\n res.push(a[i] ^ b[i]);\n }\n return Buffer.from(res);\n}\n\n/**\n * Checks if the obj is an array\n * @param obj\n * @returns {boolean}\n */\n/*\nCONTEST\nwe do'nt support array requests anyway\nfunction isArrayLike(obj) {\n if (!obj) return false\n const l = obj.length\n if (typeof l != 'number' || l < 0) return false\n if (Math.floor(l) !== l) return false\n // fast check\n if (l > 0 && !(l - 1 in obj)) return false\n // more complete check (optional)\n for (let i = 0; i < l; ++i) {\n if (!(i in obj)) return false\n }\n return true\n}\n*/\n\n// Taken from https://stackoverflow.com/questions/18638900/javascript-crc32/18639999#18639999\nfunction makeCRCTable() {\n let c;\n const crcTable = [];\n for (let n = 0; n < 256; n++) {\n c = n;\n for (let k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n crcTable[n] = c;\n }\n return crcTable;\n}\n\nlet crcTable;\n\nfunction crc32(buf) {\n if (!crcTable) {\n crcTable = makeCRCTable();\n }\n if (!Buffer.isBuffer(buf)) {\n buf = Buffer.from(buf);\n }\n let crc = -1;\n\n for (let index = 0; index < buf.length; index++) {\n const byte = buf[index];\n crc = crcTable[(crc ^ byte) & 0xff] ^ (crc >>> 8);\n }\n return (crc ^ (-1)) >>> 0;\n}\n\n/**\n * Creates a deferred object\n * @return {Deferred}\n */\nfunction createDeferred() {\n let resolve;\n const promise = new Promise((_resolve) => {\n resolve = _resolve;\n });\n\n return {\n promise,\n resolve,\n };\n}\n\nmodule.exports = {\n readBigIntFromBuffer,\n readBufferFromBigInt,\n generateRandomLong,\n mod,\n crc32,\n generateRandomBytes,\n // calcKey,\n generateKeyDataFromNonce,\n sha1,\n sha256,\n bigIntMod,\n modExp,\n getRandomInt,\n sleep,\n getByteArray,\n // isArrayLike,\n toSignedLittleBuffer,\n convertToLittle,\n bufferXor,\n createDeferred,\n};\n","const BigInt = require('big-integer');\nconst { constructors } = require('./tl');\nconst {\n readBigIntFromBuffer,\n readBufferFromBigInt,\n sha256,\n bigIntMod,\n modExp,\n generateRandomBytes,\n} = require('./Helpers');\nconst crypto = require('./crypto/crypto');\n\nconst SIZE_FOR_HASH = 256;\n\n/**\n *\n *\n * @param prime{BigInteger}\n * @param g{BigInteger}\n */\n\n/*\nWe don't support changing passwords yet\nfunction checkPrimeAndGoodCheck(prime, g) {\n console.error('Unsupported function `checkPrimeAndGoodCheck` call. Arguments:', prime, g)\n\n const goodPrimeBitsCount = 2048\n if (prime < 0 || prime.bitLength() !== goodPrimeBitsCount) {\n throw new Error(`bad prime count ${prime.bitLength()},expected ${goodPrimeBitsCount}`)\n }\n // TODO this is kinda slow\n if (Factorizator.factorize(prime)[0] !== 1) {\n throw new Error('give \"prime\" is not prime')\n }\n if (g.eq(BigInt(2))) {\n if ((prime.remainder(BigInt(8))).neq(BigInt(7))) {\n throw new Error(`bad g ${g}, mod8 ${prime % 8}`)\n }\n } else if (g.eq(BigInt(3))) {\n if ((prime.remainder(BigInt(3))).neq(BigInt(2))) {\n throw new Error(`bad g ${g}, mod3 ${prime % 3}`)\n }\n // eslint-disable-next-line no-empty\n } else if (g.eq(BigInt(4))) {\n\n } else if (g.eq(BigInt(5))) {\n if (!([ BigInt(1), BigInt(4) ].includes(prime.remainder(BigInt(5))))) {\n throw new Error(`bad g ${g}, mod8 ${prime % 5}`)\n }\n } else if (g.eq(BigInt(6))) {\n if (!([ BigInt(19), BigInt(23) ].includes(prime.remainder(BigInt(24))))) {\n throw new Error(`bad g ${g}, mod8 ${prime % 24}`)\n }\n } else if (g.eq(BigInt(7))) {\n if (!([ BigInt(3), BigInt(5), BigInt(6) ].includes(prime.remainder(BigInt(7))))) {\n throw new Error(`bad g ${g}, mod8 ${prime % 7}`)\n }\n } else {\n throw new Error(`bad g ${g}`)\n }\n const primeSub1Div2 = (prime.subtract(BigInt(1))).divide(BigInt(2))\n if (Factorizator.factorize(primeSub1Div2)[0] !== 1) {\n throw new Error('(prime - 1) // 2 is not prime')\n }\n}\n*/\n/**\n *\n * @param primeBytes{Buffer}\n * @param g{number}\n */\nfunction checkPrimeAndGood(primeBytes, g) {\n const goodPrime = Buffer.from([\n 0xC7, 0x1C, 0xAE, 0xB9, 0xC6, 0xB1, 0xC9, 0x04, 0x8E, 0x6C, 0x52, 0x2F, 0x70, 0xF1, 0x3F, 0x73,\n 0x98, 0x0D, 0x40, 0x23, 0x8E, 0x3E, 0x21, 0xC1, 0x49, 0x34, 0xD0, 0x37, 0x56, 0x3D, 0x93, 0x0F,\n 0x48, 0x19, 0x8A, 0x0A, 0xA7, 0xC1, 0x40, 0x58, 0x22, 0x94, 0x93, 0xD2, 0x25, 0x30, 0xF4, 0xDB,\n 0xFA, 0x33, 0x6F, 0x6E, 0x0A, 0xC9, 0x25, 0x13, 0x95, 0x43, 0xAE, 0xD4, 0x4C, 0xCE, 0x7C, 0x37,\n 0x20, 0xFD, 0x51, 0xF6, 0x94, 0x58, 0x70, 0x5A, 0xC6, 0x8C, 0xD4, 0xFE, 0x6B, 0x6B, 0x13, 0xAB,\n 0xDC, 0x97, 0x46, 0x51, 0x29, 0x69, 0x32, 0x84, 0x54, 0xF1, 0x8F, 0xAF, 0x8C, 0x59, 0x5F, 0x64,\n 0x24, 0x77, 0xFE, 0x96, 0xBB, 0x2A, 0x94, 0x1D, 0x5B, 0xCD, 0x1D, 0x4A, 0xC8, 0xCC, 0x49, 0x88,\n 0x07, 0x08, 0xFA, 0x9B, 0x37, 0x8E, 0x3C, 0x4F, 0x3A, 0x90, 0x60, 0xBE, 0xE6, 0x7C, 0xF9, 0xA4,\n 0xA4, 0xA6, 0x95, 0x81, 0x10, 0x51, 0x90, 0x7E, 0x16, 0x27, 0x53, 0xB5, 0x6B, 0x0F, 0x6B, 0x41,\n 0x0D, 0xBA, 0x74, 0xD8, 0xA8, 0x4B, 0x2A, 0x14, 0xB3, 0x14, 0x4E, 0x0E, 0xF1, 0x28, 0x47, 0x54,\n 0xFD, 0x17, 0xED, 0x95, 0x0D, 0x59, 0x65, 0xB4, 0xB9, 0xDD, 0x46, 0x58, 0x2D, 0xB1, 0x17, 0x8D,\n 0x16, 0x9C, 0x6B, 0xC4, 0x65, 0xB0, 0xD6, 0xFF, 0x9C, 0xA3, 0x92, 0x8F, 0xEF, 0x5B, 0x9A, 0xE4,\n 0xE4, 0x18, 0xFC, 0x15, 0xE8, 0x3E, 0xBE, 0xA0, 0xF8, 0x7F, 0xA9, 0xFF, 0x5E, 0xED, 0x70, 0x05,\n 0x0D, 0xED, 0x28, 0x49, 0xF4, 0x7B, 0xF9, 0x59, 0xD9, 0x56, 0x85, 0x0C, 0xE9, 0x29, 0x85, 0x1F,\n 0x0D, 0x81, 0x15, 0xF6, 0x35, 0xB1, 0x05, 0xEE, 0x2E, 0x4E, 0x15, 0xD0, 0x4B, 0x24, 0x54, 0xBF,\n 0x6F, 0x4F, 0xAD, 0xF0, 0x34, 0xB1, 0x04, 0x03, 0x11, 0x9C, 0xD8, 0xE3, 0xB9, 0x2F, 0xCC, 0x5B,\n ]);\n if (goodPrime.equals(primeBytes)) {\n if ([3, 4, 5, 7].includes(g)) {\n return; // It's good\n }\n }\n throw new Error('Changing passwords unsupported');\n // checkPrimeAndGoodCheck(readBigIntFromBuffer(primeBytes, false), g)\n}\n\n/**\n *\n * @param number{BigInteger}\n * @param p{BigInteger}\n * @returns {boolean}\n */\nfunction isGoodLarge(number, p) {\n return (number.greater(BigInt(0)) && (p.subtract(number)\n .greater(BigInt(0))));\n}\n\n/**\n *\n * @param number {Buffer}\n * @returns {Buffer}\n */\nfunction numBytesForHash(number) {\n return Buffer.concat([Buffer.alloc(SIZE_FOR_HASH - number.length), number]);\n}\n\n/**\n *\n * @param g {Buffer}\n * @returns {Buffer}\n */\nfunction bigNumForHash(g) {\n return readBufferFromBigInt(g, SIZE_FOR_HASH, false);\n}\n\n/**\n *\n * @param modexp {BigInteger}\n * @param prime {BigInteger}\n * @returns {Boolean}\n */\nfunction isGoodModExpFirst(modexp, prime) {\n const diff = prime.subtract(modexp);\n\n const minDiffBitsCount = 2048 - 64;\n const maxModExpSize = 256;\n\n return !(diff.lesser(BigInt(0)) || diff.bitLength() < minDiffBitsCount\n || modexp.bitLength() < minDiffBitsCount\n || Math.floor((modexp.bitLength() + 7) / 8) > maxModExpSize);\n}\n\nfunction xor(a, b) {\n const length = Math.min(a.length, b.length);\n\n for (let i = 0; i < length; i++) {\n a[i] ^= b[i];\n }\n\n return a;\n}\n\n/**\n *\n * @param password{Buffer}\n * @param salt{Buffer}\n * @param iterations{number}\n * @returns {*}\n */\n\nfunction pbkdf2sha512(password, salt, iterations) {\n return crypto.pbkdf2(password, salt, iterations, 64, 'sha512');\n}\n\n/**\n *\n * @param algo {constructors.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow}\n * @param password\n * @returns {Buffer|*}\n */\nasync function computeHash(algo, password) {\n const hash1 = await sha256(Buffer.concat([algo.salt1, Buffer.from(password, 'utf-8'), algo.salt1]));\n const hash2 = await sha256(Buffer.concat([algo.salt2, hash1, algo.salt2]));\n const hash3 = await pbkdf2sha512(hash2, algo.salt1, 100000);\n return sha256(Buffer.concat([algo.salt2, hash3, algo.salt2]));\n}\n\n/**\n *\n * @param algo {constructors.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow}\n * @param password\n */\nasync function computeDigest(algo, password) {\n try {\n checkPrimeAndGood(algo.p, algo.g);\n } catch (e) {\n throw new Error('bad p/g in password');\n }\n\n const value = modExp(BigInt(algo.g),\n readBigIntFromBuffer(await computeHash(algo, password), false),\n readBigIntFromBuffer(algo.p, false));\n return bigNumForHash(value);\n}\n\n/**\n *\n * @param request {constructors.account.Password}\n * @param password {string}\n */\nasync function computeCheck(request, password) {\n const algo = request.currentAlgo;\n if (!(algo instanceof constructors.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow)) {\n throw new Error(`Unsupported password algorithm ${algo.className}`);\n }\n\n const pwHash = await computeHash(algo, password);\n const p = readBigIntFromBuffer(algo.p, false);\n const { g } = algo;\n const B = readBigIntFromBuffer(request.srp_B, false);\n try {\n checkPrimeAndGood(algo.p, g);\n } catch (e) {\n throw new Error('bad /g in password');\n }\n if (!isGoodLarge(B, p)) {\n throw new Error('bad b in check');\n }\n const x = readBigIntFromBuffer(pwHash, false);\n const pForHash = numBytesForHash(algo.p);\n const gForHash = bigNumForHash(g);\n const bForHash = numBytesForHash(request.srp_B);\n const gX = modExp(BigInt(g), x, p);\n const k = readBigIntFromBuffer(await sha256(Buffer.concat([pForHash, gForHash])), false);\n const kgX = bigIntMod(k.multiply(gX), p);\n const generateAndCheckRandom = async () => {\n const randomSize = 256;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const random = generateRandomBytes(randomSize);\n const a = readBigIntFromBuffer(random, false);\n const A = modExp(BigInt(g), a, p);\n if (isGoodModExpFirst(A, p)) {\n const aForHash = bigNumForHash(A);\n const u = readBigIntFromBuffer(await sha256(Buffer.concat([aForHash, bForHash])), false);\n if (u.greater(BigInt(0))) {\n return [a, aForHash, u];\n }\n }\n }\n };\n const [a, aForHash, u] = await generateAndCheckRandom();\n const gB = bigIntMod(B.subtract(kgX), p);\n if (!isGoodModExpFirst(gB, p)) {\n throw new Error('bad gB');\n }\n\n const ux = u.multiply(x);\n const aUx = a.add(ux);\n const S = modExp(gB, aUx, p);\n const [K, pSha, gSha, salt1Sha, salt2Sha] = await Promise.all([\n sha256(bigNumForHash(S)),\n sha256(pForHash),\n sha256(gForHash),\n sha256(algo.salt1),\n sha256(algo.salt2),\n ]);\n const M1 = await sha256(Buffer.concat([\n xor(pSha, gSha),\n salt1Sha,\n salt2Sha,\n aForHash,\n bForHash,\n K,\n ]));\n\n\n return new constructors.InputCheckPasswordSRP({\n srpId: request.srpId,\n A: Buffer.from(aForHash),\n M1,\n\n });\n}\n\nmodule.exports = {\n computeCheck,\n computeDigest,\n};\n","const { constructors } = require('./tl');\n\n// eslint-disable-next-line max-len\nconst JPEG_HEADER = Buffer.from('ffd8ffe000104a46494600010100000100010000ffdb004300281c1e231e19282321232d2b28303c64413c37373c7b585d4964918099968f808c8aa0b4e6c3a0aadaad8a8cc8ffcbdaeef5ffffff9bc1fffffffaffe6fdfff8ffdb0043012b2d2d3c353c76414176f8a58ca5f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8ffc00011080000000003012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffda000c03010002110311003f00', 'hex');\nconst JPEG_FOOTER = Buffer.from('ffd9', 'hex');\n\nfunction _raiseCastFail(entity, target) {\n throw new Error(`Cannot cast ${entity.className} to any kind of ${target}`);\n}\n\n/**\n Gets the input peer for the given \"entity\" (user, chat or channel).\n\n A ``TypeError`` is raised if the given entity isn't a supported type\n or if ``check_hash is True`` but the entity's ``accessHash is None``\n *or* the entity contains ``min`` information. In this case, the hash\n cannot be used for general purposes, and thus is not returned to avoid\n any issues which can derive from invalid access hashes.\n\n Note that ``check_hash`` **is ignored** if an input peer is already\n passed since in that case we assume the user knows what they're doing.\n This is key to getting entities by explicitly passing ``hash = 0``.\n\n * @param entity\n * @param allowSelf\n * @param checkHash\n */\nfunction getInputPeer(entity, allowSelf = true, checkHash = true) {\n if (entity.SUBCLASS_OF_ID === undefined) {\n // e.g. custom.Dialog (can't cyclic import).\n\n if (allowSelf && 'inputEntity' in entity) {\n return entity.inputEntity;\n } else if ('entity' in entity) {\n return getInputPeer(entity.entity);\n } else {\n _raiseCastFail(entity, 'InputPeer');\n }\n }\n if (entity.SUBCLASS_OF_ID === 0xc91c90b6) { // crc32(b'InputPeer')\n return entity;\n }\n\n if (entity instanceof constructors.User) {\n if (entity.isSelf && allowSelf) {\n return new constructors.InputPeerSelf();\n } else if (entity.accessHash !== undefined || !checkHash) {\n return new constructors.InputPeerUser({\n userId: entity.id,\n accessHash: entity.accessHash,\n });\n } else {\n throw new Error('User without accessHash or min info cannot be input');\n }\n }\n if (entity instanceof constructors.Chat || entity instanceof constructors.ChatEmpty\n || entity instanceof constructors.ChatForbidden) {\n return new constructors.InputPeerChat({ chatId: entity.id });\n }\n if (entity instanceof constructors.Channel) {\n if (entity.accessHash !== undefined || !checkHash) {\n return new constructors.InputPeerChannel({\n channelId: entity.id,\n accessHash: entity.accessHash,\n });\n } else {\n throw new TypeError('Channel without accessHash or min info cannot be input');\n }\n }\n if (entity instanceof constructors.ChannelForbidden) {\n // \"channelForbidden are never min\", and since their hash is\n // also not optional, we assume that this truly is the case.\n return new constructors.InputPeerChannel({\n channelId: entity.id,\n accessHash: entity.accessHash,\n });\n }\n\n if (entity instanceof constructors.InputUser) {\n return new constructors.InputPeerUser({\n userId: entity.userId,\n accessHash: entity.accessHash,\n });\n }\n if (entity instanceof constructors.InputChannel) {\n return new constructors.InputPeerChannel({\n channelId: entity.channelId,\n accessHash: entity.accessHash,\n });\n }\n if (entity instanceof constructors.UserEmpty) {\n return new constructors.InputPeerEmpty();\n }\n if (entity instanceof constructors.UserFull) {\n return getInputPeer(entity.user);\n }\n\n if (entity instanceof constructors.ChatFull) {\n return new constructors.InputPeerChat({ chatId: entity.id });\n }\n\n if (entity instanceof constructors.PeerChat) {\n return new constructors.InputPeerChat(entity.chatId);\n }\n\n _raiseCastFail(entity, 'InputPeer');\n return undefined;\n}\n\n/**\n Similar to :meth:`get_input_peer`, but for :tl:`InputChannel`'s alone.\n\n .. important::\n\n This method does not validate for invalid general-purpose access\n hashes, unlike `get_input_peer`. Consider using instead:\n ``get_input_channel(get_input_peer(channel))``.\n\n * @param entity\n * @returns {InputChannel|*}\n */\n/* CONTEST\nfunction getInputChannel(entity) {\n if (entity.SUBCLASS_OF_ID === undefined) {\n _raiseCastFail(entity, 'InputChannel')\n }\n\n\n if (entity.SUBCLASS_OF_ID === 0x40f202fd) { // crc32(b'InputChannel')\n return entity\n }\n if (entity instanceof constructors.Channel || entity instanceof constructors.ChannelForbidden) {\n return new constructors.InputChannel({\n channelId: entity.id,\n accessHash: entity.accessHash || 0\n })\n }\n\n if (entity instanceof constructors.InputPeerChannel) {\n return new constructors.InputChannel({\n channelId: entity.channelId,\n accessHash: entity.accessHash\n })\n }\n _raiseCastFail(entity, 'InputChannel')\n}\n*/\n/**\n Similar to :meth:`get_input_peer`, but for :tl:`InputUser`'s alone.\n\n .. important::\n\n This method does not validate for invalid general-purpose access\n hashes, unlike `get_input_peer`. Consider using instead:\n ``get_input_channel(get_input_peer(channel))``.\n\n * @param entity\n */\n/* CONTEST\nfunction getInputUser(entity) {\n if (entity.SUBCLASS_OF_ID === undefined) {\n _raiseCastFail(entity, 'InputUser')\n }\n if (entity.SUBCLASS_OF_ID === 0xe669bf46) { // crc32(b'InputUser')\n return entity\n }\n\n if (entity instanceof constructors.User) {\n if (entity.isSelf) {\n return new constructors.InputPeerSelf()\n } else {\n return new constructors.InputUser({\n userId: entity.id,\n accessHash: entity.accessHash || 0,\n })\n }\n }\n if (entity instanceof constructors.InputPeerSelf) {\n return new constructors.InputPeerSelf()\n }\n if (entity instanceof constructors.UserEmpty || entity instanceof constructors.InputPeerEmpty) {\n return new constructors.InputUserEmpty()\n }\n\n if (entity instanceof constructors.UserFull) {\n return getInputUser(entity.user)\n }\n\n if (entity instanceof constructors.InputPeerUser) {\n return new constructors.InputUser({\n userId: entity.userId,\n accessHash: entity.accessHash\n })\n }\n\n _raiseCastFail(entity, 'InputUser')\n}\n*/\n/**\n Similar to :meth:`get_input_peer`, but for dialogs\n * @param dialog\n */\n/* CONTEST\nfunction getInputDialog(dialog) {\n try {\n if (dialog.SUBCLASS_OF_ID === 0xa21c9795) { // crc32(b'InputDialogPeer')\n return dialog\n }\n if (dialog.SUBCLASS_OF_ID === 0xc91c90b6) { // crc32(b'InputPeer')\n return new constructors.InputDialogPeer({ peer: dialog })\n }\n } catch (e) {\n _raiseCastFail(dialog, 'InputDialogPeer')\n }\n\n try {\n return new constructors.InputDialogPeer(getInputPeer(dialog))\n // eslint-disable-next-line no-empty\n } catch (e) {\n\n }\n _raiseCastFail(dialog, 'InputDialogPeer')\n}\n*/\n\n/* CONTEST\n\nfunction getInputMessage(message) {\n try {\n if (typeof message == 'number') { // This case is really common too\n return new constructors.InputMessageID({\n id: message,\n })\n } else if (message.SUBCLASS_OF_ID === 0x54b6bcc5) { // crc32(b'InputMessage')\n return message\n } else if (message.SUBCLASS_OF_ID === 0x790009e3) { // crc32(b'Message')\n return new constructors.InputMessageID(message.id)\n }\n // eslint-disable-next-line no-empty\n } catch (e) {\n }\n\n _raiseCastFail(message, 'InputMessage')\n}\n*/\n\n/**\n * Adds the JPG header and footer to a stripped image.\n * Ported from https://github.com/telegramdesktop/\n * tdesktop/blob/bec39d89e19670eb436dc794a8f20b657cb87c71/Telegram/SourceFiles/ui/image/image.cpp#L225\n\n * @param stripped{Buffer}\n * @returns {Buffer}\n */\nfunction strippedPhotoToJpg(stripped) {\n // Note: Changes here should update _stripped_real_length\n if (stripped.length < 3 || stripped[0] !== 1) {\n return stripped;\n }\n const header = Buffer.from(JPEG_HEADER);\n // eslint-disable-next-line prefer-destructuring\n header[164] = stripped[1];\n // eslint-disable-next-line prefer-destructuring\n header[166] = stripped[2];\n return Buffer.concat([header, stripped.slice(3), JPEG_FOOTER]);\n}\n\n/* CONTEST\nfunction getInputLocation(location) {\n try {\n if (!location.SUBCLASS_OF_ID) {\n throw new Error()\n }\n if (location.SUBCLASS_OF_ID === 0x1523d462) {\n return {\n dcId: null,\n inputLocation: location\n }\n }\n } catch (e) {\n _raiseCastFail(location, 'InputFileLocation')\n }\n if (location instanceof constructors.Message) {\n location = location.media\n }\n\n if (location instanceof constructors.MessageMediaDocument) {\n location = location.document\n } else if (location instanceof constructors.MessageMediaPhoto) {\n location = location.photo\n }\n\n if (location instanceof constructors.Document) {\n return {\n dcId: location.dcId,\n inputLocation: new constructors.InputDocumentFileLocation({\n id: location.id,\n accessHash: location.accessHash,\n fileReference: location.fileReference,\n thumbSize: '', // Presumably to download one of its thumbnails\n }),\n }\n } else if (location instanceof constructors.Photo) {\n return {\n dcId: location.dcId,\n inputLocation: new constructors.InputPhotoFileLocation({\n id: location.id,\n accessHash: location.accessHash,\n fileReference: location.fileReference,\n thumbSize: location.sizes[location.sizes.length - 1].type,\n }),\n }\n }\n\n if (location instanceof constructors.FileLocationToBeDeprecated) {\n throw new Error('Unavailable location cannot be used as input')\n }\n _raiseCastFail(location, 'InputFileLocation')\n}\n*/\n\n/**\n * Gets the appropriated part size when uploading or downloading files,\n * given an initial file size.\n * @param fileSize\n * @returns {Number}\n */\nfunction getAppropriatedPartSize(fileSize) {\n if (fileSize <= 104857600) { // 100MB\n return 128;\n }\n if (fileSize <= 786432000) { // 750MB\n return 256;\n }\n if (fileSize <= 2097152000) { // 2000MB\n return 512;\n }\n\n throw new Error('File size too large');\n}\n\n/* CONTEST\nfunction getPeer(peer) {\n try {\n if (typeof peer === 'number') {\n const res = resolveId(peer)\n\n if (res[1] === constructors.PeerChannel) {\n return new res[1]({ channelId: res[0] })\n } else if (res[1] === constructors.PeerChat) {\n return new res[1]({ chatId: res[0] })\n } else {\n return new res[1]({ userId: res[0] })\n }\n }\n if (peer.SUBCLASS_OF_ID === undefined) {\n throw new Error()\n }\n if (peer.SUBCLASS_OF_ID === 0x2d45687) {\n return peer\n } else if (peer instanceof constructors.contacts.ResolvedPeer ||\n peer instanceof constructors.InputNotifyPeer || peer instanceof constructors.TopPeer ||\n peer instanceof constructors.Dialog || peer instanceof constructors.DialogPeer) {\n return peer.peer\n } else if (peer instanceof constructors.ChannelFull) {\n return new constructors.PeerChannel({ channelId: peer.id })\n }\n if (peer.SUBCLASS_OF_ID === 0x7d7c6f86 || peer.SUBCLASS_OF_ID === 0xd9c7fc18) {\n // ChatParticipant, ChannelParticipant\n return new constructors.PeerUser({ userId: peer.userId })\n }\n peer = getInputPeer(peer, false, false)\n\n if (peer instanceof constructors.InputPeerUser) {\n return new constructors.PeerUser({ userId: peer.userId })\n } else if (peer instanceof constructors.InputPeerChat) {\n return new constructors.PeerChat({ chatId: peer.chatId })\n } else if (peer instanceof constructors.InputPeerChannel) {\n return new constructors.PeerChannel({ channelId: peer.channelId })\n }\n // eslint-disable-next-line no-empty\n } catch (e) {\n console.log(e)\n }\n _raiseCastFail(peer, 'peer')\n}\n*/\n\n/**\n Convert the given peer into its marked ID by default.\n\n This \"mark\" comes from the \"bot api\" format, and with it the peer type\n can be identified back. User ID is left unmodified, chat ID is negated,\n and channel ID is prefixed with -100:\n\n * ``userId``\n * ``-chatId``\n * ``-100channel_id``\n\n The original ID and the peer type class can be returned with\n a call to :meth:`resolve_id(marked_id)`.\n * @param peer\n * @param addMark\n */\n/* CONTEST\nfunction getPeerId(peer, addMark = true) {\n // First we assert it's a Peer TLObject, or early return for integers\n if (typeof peer == 'number') {\n return addMark ? peer : resolveId(peer)[0]\n }\n\n // Tell the user to use their client to resolve InputPeerSelf if we got one\n if (peer instanceof constructors.InputPeerSelf) {\n _raiseCastFail(peer, 'int (you might want to use client.get_peer_id)')\n }\n\n try {\n peer = getPeer(peer)\n } catch (e) {\n _raiseCastFail(peer, 'int')\n }\n if (peer instanceof constructors.PeerUser) {\n return peer.userId\n } else if (peer instanceof constructors.PeerChat) {\n // Check in case the user mixed things up to avoid blowing up\n if (!(0 < peer.chatId <= 0x7fffffff)) {\n peer.chatId = resolveId(peer.chatId)[0]\n }\n\n return addMark ? -(peer.chatId) : peer.chatId\n } else { // if (peer instanceof constructors.PeerChannel)\n // Check in case the user mixed things up to avoid blowing up\n if (!(0 < peer.channelId <= 0x7fffffff)) {\n peer.channelId = resolveId(peer.channelId)[0]\n }\n if (!addMark) {\n return peer.channelId\n }\n // Concat -100 through math tricks, .to_supergroup() on\n // Madeline IDs will be strictly positive -> log works.\n try {\n return -(peer.channelId + Math.pow(10, Math.floor(Math.log10(peer.channelId) + 3)))\n } catch (e) {\n throw new Error('Cannot get marked ID of a channel unless its ID is strictly positive')\n }\n }\n}\n*/\n/**\n * Given a marked ID, returns the original ID and its :tl:`Peer` type.\n * @param markedId\n */\n/* CONTEST\nfunction resolveId(markedId) {\n if (markedId >= 0) {\n return [markedId, constructors.PeerUser]\n }\n\n // There have been report of chat IDs being 10000xyz, which means their\n // marked version is -10000xyz, which in turn looks like a channel but\n // it becomes 00xyz (= xyz). Hence, we must assert that there are only\n // two zeroes.\n const m = markedId.toString()\n .match(/-100([^0]\\d*)/)\n if (m) {\n return [parseInt(m[1]), constructors.PeerChannel]\n }\n return [-markedId, constructors.PeerChat]\n}\n*/\n\n/**\n * returns an entity pair\n * @param entityId\n * @param entities\n * @param cache\n * @param getInputPeer\n * @returns {{inputEntity: *, entity: *}}\n * @private\n */\n\n/* CONTEST\n\nfunction _getEntityPair(entityId, entities, cache, getInputPeer = getInputPeer) {\n const entity = entities.get(entityId)\n let inputEntity = cache[entityId]\n if (inputEntity === undefined) {\n try {\n inputEntity = getInputPeer(inputEntity)\n } catch (e) {\n inputEntity = null\n }\n }\n return {\n entity,\n inputEntity\n }\n}\n*/\n\nfunction getMessageId(message) {\n if (message === undefined) {\n return undefined;\n }\n if (typeof message === 'number') {\n return message;\n }\n if (message.SUBCLASS_OF_ID === 0x790009e3) { // crc32(b'Message')\n return message.id;\n }\n throw new Error(`Invalid message type: ${message.constructor.name}`);\n}\n\n\n/**\n Parses the given username or channel access hash, given\n a string, username or URL. Returns a tuple consisting of\n both the stripped, lowercase username and whether it is\n a joinchat/ hash (in which case is not lowercase'd).\n\n Returns ``(None, False)`` if the ``username`` or link is not valid.\n\n * @param username {string}\n */\n\n/* CONTEST\n\nfunction parseUsername(username) {\n username = username.trim()\n const m = username.match(USERNAME_RE) || username.match(TG_JOIN_RE)\n if (m) {\n username = username.replace(m[0], '')\n if (m[1]) {\n return {\n username: username,\n isInvite: true\n }\n } else {\n username = rtrim(username, '/')\n }\n }\n if (username.match(VALID_USERNAME_RE)) {\n return {\n username: username.toLowerCase(),\n isInvite: false\n }\n } else {\n return {\n username: null,\n isInvite: false\n }\n }\n}\n\nfunction rtrim(s, mask) {\n while (~mask.indexOf(s[s.length - 1])) {\n s = s.slice(0, -1)\n }\n return s\n}\n\n */\n\n/**\n * Gets the display name for the given :tl:`User`,\n :tl:`Chat` or :tl:`Channel`. Returns an empty string otherwise\n * @param entity\n */\nfunction getDisplayName(entity) {\n if (entity instanceof constructors.User) {\n if (entity.lastName && entity.firstName) {\n return `${entity.firstName} ${entity.lastName}`;\n } else if (entity.firstName) {\n return entity.firstName;\n } else if (entity.lastName) {\n return entity.lastName;\n } else {\n return '';\n }\n } else if (entity instanceof constructors.Chat || entity instanceof constructors.Channel) {\n return entity.title;\n }\n return '';\n}\n\n/**\n * check if a given item is an array like or not\n * @param item\n * @returns {boolean}\n */\n\n/* CONTEST\nDuplicate ?\nfunction isListLike(item) {\n return (\n Array.isArray(item) ||\n (!!item &&\n typeof item === 'object' &&\n typeof (item.length) === 'number' &&\n (item.length === 0 ||\n (item.length > 0 &&\n (item.length - 1) in item)\n )\n )\n )\n}\n*/\n/**\n * Returns the appropriate DC based on the id\n * @param dcId the id of the DC.\n * @param downloadDC whether to use -1 DCs or not\n * (These only support downloading/uploading and not creating a new AUTH key)\n * @return {{port: number, ipAddress: string, id: number}}\n */\nfunction getDC(dcId, downloadDC = false) {\n // TODO Move to external config\n switch (dcId) {\n case 1:\n return {\n id: 1,\n ipAddress: `zws1${downloadDC ? '-1' : ''}.web.telegram.org`,\n port: 443,\n };\n case 2:\n return {\n id: 2,\n ipAddress: `zws2${downloadDC ? '-1' : ''}.web.telegram.org`,\n port: 443,\n };\n case 3:\n return {\n id: 3,\n ipAddress: `zws3${downloadDC ? '-1' : ''}.web.telegram.org`,\n port: 443,\n };\n case 4:\n return {\n id: 4,\n ipAddress: `zws4${downloadDC ? '-1' : ''}.web.telegram.org`,\n port: 443,\n };\n case 5:\n return {\n id: 5,\n ipAddress: `zws5${downloadDC ? '-1' : ''}.web.telegram.org`,\n port: 443,\n };\n default:\n throw new Error(`Cannot find the DC with the ID of ${dcId}`);\n }\n // TODO chose based on current connection method\n /*\n if (!this._config) {\n this._config = await this.invoke(new requests.help.GetConfig())\n }\n if (cdn && !this._cdnConfig) {\n this._cdnConfig = await this.invoke(new requests.help.GetCdnConfig())\n for (const pk of this._cdnConfig.publicKeys) {\n addKey(pk.publicKey)\n }\n }\n for (const DC of this._config.dcOptions) {\n if (DC.id === dcId && Boolean(DC.ipv6) === this._useIPV6 && Boolean(DC.cdn) === cdn) {\n return DC\n }\n } */\n}\n\nmodule.exports = {\n getMessageId,\n // _getEntityPair,\n // getInputMessage,\n // getInputDialog,\n // getInputUser,\n // getInputChannel,\n getInputPeer,\n // parsePhone,\n // parseUsername,\n // getPeer,\n // getPeerId,\n getDisplayName,\n // resolveId,\n // isListLike,\n getAppropriatedPartSize,\n // getInputLocation,\n strippedPhotoToJpg,\n getDC,\n};\n","module.exports = '0.0.2';\n","import TelegramClient from './TelegramClient';\n// eslint-disable-next-line import/no-named-default\nimport { default as Api } from '../tl/api';\nimport { generateRandomBytes } from '../Helpers';\nimport { computeCheck, computeDigest } from '../Password';\nimport errors from '../errors';\n\nexport interface TwoFaParams {\n isCheckPassword?: boolean;\n currentPassword?: string;\n newPassword?: string;\n hint?: string;\n email?: string;\n emailCodeCallback?: (length: number) => Promise;\n onEmailCodeError?: (err: Error) => void;\n}\n\n/**\n * Changes the 2FA settings of the logged in user.\n Note that this method may be *incredibly* slow depending on the\n prime numbers that must be used during the process to make sure\n that everything is safe.\n\n Has no effect if both current and new password are omitted.\n\n * @param client: The telegram client instance\n * @param isCheckPassword: Must be ``true`` if you want to check the current password\n * @param currentPassword: The current password, to authorize changing to ``new_password``.\n Must be set if changing existing 2FA settings.\n Must **not** be set if 2FA is currently disabled.\n Passing this by itself will remove 2FA (if correct).\n * @param newPassword: The password to set as 2FA.\n If 2FA was already enabled, ``currentPassword`` **must** be set.\n Leaving this blank or `undefined` will remove the password.\n * @param hint: Hint to be displayed by Telegram when it asks for 2FA.\n Must be set when changing or creating a new password.\n Has no effect if ``newPassword`` is not set.\n * @param email: Recovery and verification email. If present, you must also\n set `emailCodeCallback`, else it raises an Error.\n * @param emailCodeCallback: If an email is provided, a callback that returns the code sent\n to it must also be set. This callback may be asynchronous.\n It should return a string with the code. The length of the\n code will be passed to the callback as an input parameter.\n\n If the callback returns an invalid code, it will raise an rpc error with the message\n ``CODE_INVALID``\n\n * @returns Promise\n * @throws this method can throw:\n \"PASSWORD_HASH_INVALID\" if you entered a wrong password (or set it to undefined).\n \"EMAIL_INVALID\" if the entered email is wrong\n \"EMAIL_HASH_EXPIRED\" if the user took too long to verify their email\n */\nexport async function updateTwoFaSettings(\n client: TelegramClient,\n {\n isCheckPassword,\n currentPassword,\n newPassword,\n hint = '',\n email,\n emailCodeCallback,\n onEmailCodeError,\n }: TwoFaParams,\n) {\n if (!newPassword && !currentPassword) {\n throw new Error('Neither `currentPassword` nor `newPassword` is present');\n }\n\n if (email && !(emailCodeCallback && onEmailCodeError)) {\n throw new Error('`email` present without `emailCodeCallback` and `onEmailCodeError`');\n }\n\n const pwd = await client.invoke(new Api.account.GetPassword());\n\n if (!(pwd.newAlgo instanceof Api.PasswordKdfAlgoUnknown)) {\n pwd.newAlgo.salt1 = Buffer.concat([pwd.newAlgo.salt1, generateRandomBytes(32)]);\n }\n if (!pwd.hasPassword && currentPassword) {\n currentPassword = undefined;\n }\n\n const password = currentPassword ? await computeCheck(pwd, currentPassword!) : new Api.InputCheckPasswordEmpty();\n\n if (isCheckPassword) {\n await client.invoke(new Api.auth.CheckPassword({ password }));\n return;\n }\n\n try {\n await client.invoke(new Api.account.UpdatePasswordSettings({\n password,\n newSettings: new Api.account.PasswordInputSettings({\n newAlgo: pwd.newAlgo,\n newPasswordHash: newPassword ? await computeDigest(pwd.newAlgo, newPassword) : Buffer.alloc(0),\n hint,\n email,\n // not explained what it does and it seems to always be set to empty in tdesktop\n newSecureSettings: undefined,\n }),\n }));\n } catch (e) {\n if (e instanceof errors.EmailUnconfirmedError) {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n try {\n const code = await emailCodeCallback!(e.codeLength);\n\n if (!code) {\n throw new Error('Code is empty');\n }\n\n await client.invoke(new Api.account.ConfirmPasswordEmail({ code }));\n break;\n } catch (err) {\n onEmailCodeError!(err);\n }\n }\n } else {\n throw e;\n }\n }\n}\n","const os = require('os');\nconst Logger = require('../extensions/Logger');\nconst { sleep } = require('../Helpers');\nconst errors = require('../errors');\nconst MemorySession = require('../sessions/Memory');\nconst Helpers = require('../Helpers');\nconst utils = require('../Utils');\nconst Session = require('../sessions/Abstract');\nconst { LAYER } = require('../tl/AllTLObjects');\nconst {\n constructors,\n requests,\n} = require('../tl');\nconst MTProtoSender = require('../network/MTProtoSender');\nconst { ConnectionTCPObfuscated } = require('../network/connection/TCPObfuscated');\nconst {\n authFlow,\n checkAuthorization,\n} = require('./auth');\nconst { downloadFile } = require('./downloadFile');\nconst { uploadFile } = require('./uploadFile');\nconst { updateTwoFaSettings } = require('./2fa');\n\nconst DEFAULT_DC_ID = 2;\nconst WEBDOCUMENT_DC_ID = 4;\nconst DEFAULT_IPV4_IP = 'zws2.web.telegram.org';\nconst DEFAULT_IPV6_IP = '[2001:67c:4e8:f002::a]';\nconst EXPORTED_SENDER_RECONNECT_TIMEOUT = 1000; // 1 sec\nconst EXPORTED_SENDER_RELEASE_TIMEOUT = 30000; // 30 sec\nconst WEBDOCUMENT_REQUEST_PART_SIZE = 131072; // 128kb\n\nconst PING_INTERVAL = 3000; // 3 sec\nconst PING_TIMEOUT = 5000; // 5 sec\nconst PING_FAIL_ATTEMPTS = 3;\nconst PING_FAIL_INTERVAL = 100; // ms\nconst PING_DISCONNECT_DELAY = 60000; // 1 min\n\n// All types\nconst sizeTypes = ['w', 'y', 'd', 'x', 'c', 'm', 'b', 'a', 's'];\n\n\nclass TelegramClient {\n static DEFAULT_OPTIONS = {\n connection: ConnectionTCPObfuscated,\n useIPV6: false,\n proxy: undefined,\n timeout: 10,\n requestRetries: 5,\n connectionRetries: Infinity,\n retryDelay: 1000,\n autoReconnect: true,\n sequentialUpdates: false,\n floodSleepLimit: 60,\n deviceModel: undefined,\n systemVersion: undefined,\n appVersion: undefined,\n langCode: 'en',\n systemLangCode: 'en',\n baseLogger: 'gramjs',\n useWSS: false,\n additionalDcsDisabled: false,\n };\n\n /**\n *\n * @param session {StringSession|LocalStorageSession}\n * @param apiId\n * @param apiHash\n * @param opts\n */\n constructor(session, apiId, apiHash, opts = TelegramClient.DEFAULT_OPTIONS) {\n if (!apiId || !apiHash) {\n throw Error('Your API ID or Hash are invalid. Please read \"Requirements\" on README.md');\n }\n const args = { ...TelegramClient.DEFAULT_OPTIONS, ...opts };\n this.apiId = apiId;\n this.apiHash = apiHash;\n this._useIPV6 = args.useIPV6;\n // this._entityCache = new Set()\n if (typeof args.baseLogger === 'string') {\n this._log = new Logger();\n } else {\n this._log = args.baseLogger;\n }\n // Determine what session we will use\n if (typeof session === 'string' || !session) {\n try {\n throw new Error('not implemented');\n } catch (e) {\n session = new MemorySession();\n }\n } else if (!(session instanceof Session)) {\n throw new Error('The given session must be str or a session instance');\n }\n\n this.floodSleepLimit = args.floodSleepLimit;\n this._eventBuilders = [];\n\n this._phoneCodeHash = {};\n this.session = session;\n // this._entityCache = EntityCache();\n this.apiId = parseInt(apiId, 10);\n this.apiHash = apiHash;\n\n this._requestRetries = args.requestRetries;\n this._connectionRetries = args.connectionRetries;\n this._retryDelay = args.retryDelay || 0;\n if (args.proxy) {\n this._log.warn('proxies are not supported');\n }\n this._proxy = args.proxy;\n this._timeout = args.timeout;\n this._autoReconnect = args.autoReconnect;\n\n this._connection = args.connection;\n // TODO add proxy support\n\n this._floodWaitedRequests = {};\n\n this._initWith = (x) => {\n return new requests.InvokeWithLayer({\n layer: LAYER,\n query: new requests.InitConnection({\n apiId: this.apiId,\n deviceModel: args.deviceModel || os.type()\n .toString() || 'Unknown',\n systemVersion: args.systemVersion || os.release()\n .toString() || '1.0',\n appVersion: args.appVersion || '1.0',\n langCode: args.langCode,\n langPack: '', // this should be left empty.\n systemLangCode: args.systemLangCode,\n query: x,\n proxy: undefined, // no proxies yet.\n }),\n });\n };\n\n this._args = args;\n // These will be set later\n this._config = undefined;\n this.phoneCodeHashes = [];\n this._exportedSenderPromises = {};\n this._exportedSenderReleaseTimeouts = {};\n this._additionalDcsDisabled = args.additionalDcsDisabled;\n this._loopStarted = false;\n this._reconnecting = false;\n this._destroyed = false;\n }\n\n\n // region Connecting\n\n /**\n * Connects to the Telegram servers, executing authentication if required.\n * Note that authenticating to the Telegram servers is not the same as authenticating\n * the app, which requires to send a code first.\n * @returns {Promise}\n */\n async connect() {\n await this._initSession();\n\n if (this._sender === undefined) {\n // only init sender once to avoid multiple loops.\n this._sender = new MTProtoSender(this.session.getAuthKey(), {\n logger: this._log,\n dcId: this.session.dcId,\n retries: this._connectionRetries,\n delay: this._retryDelay,\n autoReconnect: this._autoReconnect,\n connectTimeout: this._timeout,\n authKeyCallback: this._authKeyCallback.bind(this),\n updateCallback: this._handleUpdate.bind(this),\n isMainSender: true,\n });\n }\n // set defaults vars\n this._sender.userDisconnected = false;\n this._sender._user_connected = false;\n this._sender._reconnecting = false;\n this._sender._disconnected = true;\n\n const connection = new this._connection(\n this.session.serverAddress, this.session.port, this.session.dcId, this._log,\n );\n\n const newConnection = await this._sender.connect(connection);\n if (!newConnection) {\n // we're already connected so no need to reset auth key.\n if (!this._loopStarted) {\n this._updateLoop();\n this._loopStarted = true;\n }\n return;\n }\n\n this.session.setAuthKey(this._sender.authKey);\n await this._sender.send(this._initWith(\n new requests.help.GetConfig({}),\n ));\n\n if (!this._loopStarted) {\n this._updateLoop();\n this._loopStarted = true;\n }\n this._reconnecting = false;\n }\n\n async _initSession() {\n await this.session.load();\n\n if (!this.session.serverAddress || (this.session.serverAddress.includes(':') !== this._useIPV6)) {\n this.session.setDC(DEFAULT_DC_ID, this._useIPV6\n ? DEFAULT_IPV6_IP : DEFAULT_IPV4_IP, this._args.useWSS ? 443 : 80);\n }\n }\n\n async _updateLoop() {\n while (!this._destroyed) {\n await Helpers.sleep(PING_INTERVAL);\n if (this._reconnecting) {\n continue;\n }\n\n try {\n await attempts(() => {\n return timeout(this._sender.send(new requests.PingDelayDisconnect({\n pingId: Helpers.getRandomInt(Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER),\n disconnectDelay: PING_DISCONNECT_DELAY,\n })), PING_TIMEOUT);\n }, PING_FAIL_ATTEMPTS, PING_FAIL_INTERVAL);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n if (this._reconnecting) {\n continue;\n }\n\n await this.disconnect();\n await this.connect();\n }\n\n // We need to send some content-related request at least hourly\n // for Telegram to keep delivering updates, otherwise they will\n // just stop even if we're connected. Do so every 30 minutes.\n\n // TODO Call getDifference instead since it's more relevant\n if (new Date().getTime() - this._lastRequest > 30 * 60 * 1000) {\n try {\n await this.invoke(new requests.updates.GetState());\n } catch (e) {\n // we don't care about errors here\n }\n }\n }\n await this.disconnect();\n }\n\n /**\n * Disconnects from the Telegram server\n * @returns {Promise}\n */\n async disconnect() {\n if (this._sender) {\n await this._sender.disconnect();\n }\n\n await Promise.all(\n Object.values(this._exportedSenderPromises)\n .map((promise) => {\n return promise && promise.then((sender) => {\n if (sender) {\n return sender.disconnect();\n }\n return undefined;\n });\n }),\n );\n\n this._exportedSenderPromises = {};\n }\n\n /**\n * Disconnects all senders and removes all handlers\n * @returns {Promise}\n */\n async destroy() {\n this._destroyed = true;\n\n try {\n await this.disconnect();\n } catch (err) {\n // Do nothing\n }\n\n this.session.delete();\n this._eventBuilders = [];\n }\n\n async _switchDC(newDc) {\n this._log.info(`Reconnecting to new data center ${newDc}`);\n const DC = utils.getDC(newDc);\n this.session.setDC(newDc, DC.ipAddress, DC.port);\n // authKey's are associated with a server, which has now changed\n // so it's not valid anymore. Set to None to force recreating it.\n await this._sender.authKey.setKey(undefined);\n this.session.setAuthKey(undefined);\n this._reconnecting = true;\n await this.disconnect();\n return this.connect();\n }\n\n _authKeyCallback(authKey, dcId) {\n this.session.setAuthKey(authKey, dcId);\n }\n\n // endregion\n // export region\n\n async _cleanupExportedSender(dcId) {\n if (this.session.dcId !== dcId) {\n this.session.setAuthKey(undefined, dcId);\n }\n const sender = await this._exportedSenderPromises[dcId];\n this._exportedSenderPromises[dcId] = undefined;\n await sender.disconnect();\n }\n\n async _connectSender(sender, dcId) {\n // if we don't already have an auth key we want to use normal DCs not -1\n const dc = utils.getDC(dcId, !!sender.authKey.getKey());\n\n while (true) {\n try {\n await sender.connect(new this._connection(\n dc.ipAddress,\n dc.port,\n dcId,\n this._log,\n ));\n\n if (this.session.dcId !== dcId && !sender._authenticated) {\n this._log.info(`Exporting authorization for data center ${dc.ipAddress}`);\n const auth = await this.invoke(new requests.auth.ExportAuthorization({ dcId }));\n const req = this._initWith(new requests.auth.ImportAuthorization({\n id: auth.id,\n bytes: auth.bytes,\n }));\n await sender.send(req);\n sender._authenticated = true;\n }\n sender.dcId = dcId;\n sender.userDisconnected = false;\n\n return sender;\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n\n await Helpers.sleep(1000);\n await sender.disconnect();\n }\n }\n }\n\n async _borrowExportedSender(dcId, shouldReconnect, existingSender) {\n if (this._additionalDcsDisabled) {\n return undefined;\n }\n\n if (!this._exportedSenderPromises[dcId] || shouldReconnect) {\n this._exportedSenderPromises[dcId] = this._connectSender(\n existingSender || this._createExportedSender(dcId),\n dcId,\n );\n }\n\n let sender;\n try {\n sender = await this._exportedSenderPromises[dcId];\n\n if (!sender.isConnected()) {\n if (sender.isConnecting) {\n await Helpers.sleep(EXPORTED_SENDER_RECONNECT_TIMEOUT);\n return this._borrowExportedSender(dcId, false, sender);\n } else {\n return this._borrowExportedSender(dcId, true, sender);\n }\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n\n return this._borrowExportedSender(dcId, true);\n }\n\n if (this._exportedSenderReleaseTimeouts[dcId]) {\n clearTimeout(this._exportedSenderReleaseTimeouts[dcId]);\n this._exportedSenderReleaseTimeouts[dcId] = undefined;\n }\n\n this._exportedSenderReleaseTimeouts[dcId] = setTimeout(() => {\n this._exportedSenderReleaseTimeouts[dcId] = undefined;\n sender.disconnect();\n }, EXPORTED_SENDER_RELEASE_TIMEOUT);\n\n return sender;\n }\n\n _createExportedSender(dcId) {\n return new MTProtoSender(this.session.getAuthKey(dcId), {\n logger: this._log,\n dcId,\n retries: this._connectionRetries,\n delay: this._retryDelay,\n autoReconnect: this._autoReconnect,\n connectTimeout: this._timeout,\n authKeyCallback: this._authKeyCallback.bind(this),\n isMainSender: dcId === this.session.dcId,\n onConnectionBreak: this._cleanupExportedSender.bind(this),\n });\n }\n\n getSender(dcId) {\n return dcId ? this._borrowExportedSender(dcId) : Promise.resolve(this._sender);\n }\n\n // end region\n\n // download region\n\n /**\n * Complete flow to download a file.\n * @param inputLocation {constructors.InputFileLocation}\n * @param [args[partSizeKb] {number}]\n * @param [args[fileSize] {number}]\n * @param [args[progressCallback] {Function}]\n * @param [args[start] {number}]\n * @param [args[end] {number}]\n * @param [args[dcId] {number}]\n * @param [args[workers] {number}]\n * @returns {Promise}\n */\n downloadFile(inputLocation, args = {}) {\n return downloadFile(this, inputLocation, args);\n }\n\n downloadMedia(messageOrMedia, args) {\n let media;\n if (messageOrMedia instanceof constructors.Message) {\n media = messageOrMedia.media;\n } else {\n media = messageOrMedia;\n }\n if (typeof media === 'string') {\n throw new Error('not implemented');\n }\n\n if (media instanceof constructors.MessageMediaWebPage) {\n if (media.webpage instanceof constructors.WebPage) {\n media = media.webpage.document || media.webpage.photo;\n }\n }\n if (media instanceof constructors.MessageMediaPhoto || media instanceof constructors.Photo) {\n return this._downloadPhoto(media, args);\n } else if (media instanceof constructors.MessageMediaDocument || media instanceof constructors.Document) {\n return this._downloadDocument(media, args);\n } else if (media instanceof constructors.MessageMediaContact) {\n return this._downloadContact(media, args);\n } else if (media instanceof constructors.WebDocument || media instanceof constructors.WebDocumentNoProxy) {\n return this._downloadWebDocument(media, args);\n }\n return undefined;\n }\n\n downloadProfilePhoto(entity, isBig = false) {\n // ('User', 'Chat', 'UserFull', 'ChatFull')\n const ENTITIES = [0x2da17977, 0xc5af5d94, 0x1f4661b9, 0xd49a2697];\n // ('InputPeer', 'InputUser', 'InputChannel')\n // const INPUTS = [0xc91c90b6, 0xe669bf46, 0x40f202fd]\n // Todo account for input methods\n const sizeType = isBig ? 'x' : 'm';\n let photo;\n if (!(ENTITIES.includes(entity.SUBCLASS_OF_ID))) {\n photo = entity;\n } else {\n if (!entity.photo) {\n // Special case: may be a ChatFull with photo:Photo\n if (!entity.chatPhoto) {\n return undefined;\n }\n\n return this._downloadPhoto(\n entity.chatPhoto, { sizeType },\n );\n }\n photo = entity.photo;\n }\n\n let dcId;\n let loc;\n if (photo instanceof constructors.UserProfilePhoto || photo instanceof constructors.ChatPhoto) {\n dcId = photo.dcId;\n loc = new constructors.InputPeerPhotoFileLocation({\n peer: utils.getInputPeer(entity),\n photoId: photo.photoId,\n big: isBig,\n });\n } else {\n // It doesn't make any sense to check if `photo` can be used\n // as input location, because then this method would be able\n // to \"download the profile photo of a message\", i.e. its\n // media which should be done with `download_media` instead.\n return undefined;\n }\n return this.downloadFile(loc, {\n dcId,\n });\n }\n\n downloadStickerSetThumb(stickerSet) {\n if (!stickerSet.thumbs || !stickerSet.thumbs.length) {\n return undefined;\n }\n\n const { thumbVersion } = stickerSet;\n return this.downloadFile(\n new constructors.InputStickerSetThumb({\n stickerset: new constructors.InputStickerSetID({\n id: stickerSet.id,\n accessHash: stickerSet.accessHash,\n }),\n thumbVersion,\n }),\n { dcId: stickerSet.thumbDcId },\n );\n }\n\n _pickFileSize(sizes, sizeType) {\n if (!sizeType || !sizes || !sizes.length) {\n return undefined;\n }\n const indexOfSize = sizeTypes.indexOf(sizeType);\n let size;\n for (let i = indexOfSize; i < sizeTypes.length; i++) {\n size = sizes.find((s) => s.type === sizeTypes[i]);\n if (size) {\n return size;\n }\n }\n return undefined;\n }\n\n\n _downloadCachedPhotoSize(size) {\n // No need to download anything, simply write the bytes\n let data;\n if (size instanceof constructors.PhotoStrippedSize) {\n data = utils.strippedPhotoToJpg(size.bytes);\n } else {\n data = size.bytes;\n }\n return data;\n }\n\n _downloadPhoto(photo, args) {\n if (photo instanceof constructors.MessageMediaPhoto) {\n photo = photo.photo;\n }\n if (!(photo instanceof constructors.Photo)) {\n return undefined;\n }\n const size = this._pickFileSize(photo.sizes, args.sizeType);\n if (!size || (size instanceof constructors.PhotoSizeEmpty)) {\n return undefined;\n }\n\n if (size instanceof constructors.PhotoCachedSize || size instanceof constructors.PhotoStrippedSize) {\n return this._downloadCachedPhotoSize(size);\n }\n return this.downloadFile(\n new constructors.InputPhotoFileLocation({\n id: photo.id,\n accessHash: photo.accessHash,\n fileReference: photo.fileReference,\n thumbSize: size.type,\n }),\n {\n dcId: photo.dcId,\n fileSize: size.size,\n progressCallback: args.progressCallback,\n },\n );\n }\n\n _downloadDocument(doc, args) {\n if (doc instanceof constructors.MessageMediaDocument) {\n doc = doc.document;\n }\n if (!(doc instanceof constructors.Document)) {\n return undefined;\n }\n\n let size;\n if (args.sizeType) {\n size = doc.thumbs ? this._pickFileSize(doc.thumbs, args.sizeType) : undefined;\n if (!size && doc.mimeType.startsWith('video/')) {\n return undefined;\n }\n\n if (size && (size instanceof constructors.PhotoCachedSize\n || size instanceof constructors.PhotoStrippedSize)) {\n return this._downloadCachedPhotoSize(size);\n }\n }\n\n return this.downloadFile(\n new constructors.InputDocumentFileLocation({\n id: doc.id,\n accessHash: doc.accessHash,\n fileReference: doc.fileReference,\n thumbSize: size ? size.type : '',\n }),\n {\n fileSize: size ? size.size : doc.size,\n progressCallback: args.progressCallback,\n start: args.start,\n end: args.end,\n dcId: doc.dcId,\n workers: args.workers,\n },\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _downloadContact(media, args) {\n throw new Error('not implemented');\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async _downloadWebDocument(media) {\n try {\n const buff = [];\n let offset = 0;\n while (true) {\n const downloaded = new requests.upload.GetWebFile({\n location: new constructors.InputWebFileLocation({\n url: media.url,\n accessHash: media.accessHash,\n }),\n offset,\n limit: WEBDOCUMENT_REQUEST_PART_SIZE,\n });\n const sender = await this._borrowExportedSender(WEBDOCUMENT_DC_ID);\n const res = await sender.send(downloaded);\n offset += 131072;\n if (res.bytes.length) {\n buff.push(res.bytes);\n if (res.bytes.length < WEBDOCUMENT_REQUEST_PART_SIZE) {\n break;\n }\n } else {\n break;\n }\n }\n return Buffer.concat(buff);\n } catch (e) {\n // the file is no longer saved in telegram's cache.\n if (e.message === 'WEBFILE_NOT_AVAILABLE') {\n return Buffer.alloc(0);\n } else {\n throw e;\n }\n }\n }\n\n // region Invoking Telegram request\n /**\n * Invokes a MTProtoRequest (sends and receives it) and returns its result\n * @param request\n * @returns {Promise}\n */\n\n async invoke(request) {\n if (request.classType !== 'request') {\n throw new Error('You can only invoke MTProtoRequests');\n }\n // This causes issues for now because not enough utils\n // await request.resolve(this, utils)\n\n\n this._lastRequest = new Date().getTime();\n let attempt = 0;\n for (attempt = 0; attempt < this._requestRetries; attempt++) {\n const promise = this._sender.sendWithInvokeSupport(request);\n try {\n const result = await promise.promise;\n return result;\n } catch (e) {\n if (e instanceof errors.ServerError || e.message === 'RPC_CALL_FAIL'\n || e.message === 'RPC_MCGET_FAIL') {\n this._log.warn(`Telegram is having internal issues ${e.constructor.name}`);\n await sleep(2000);\n } else if (e instanceof errors.FloodWaitError || e instanceof errors.FloodTestPhoneWaitError) {\n if (e.seconds <= this.floodSleepLimit) {\n this._log.info(`Sleeping for ${e.seconds}s on flood wait`);\n await sleep(e.seconds * 1000);\n } else {\n throw e;\n }\n } else if (e instanceof errors.PhoneMigrateError || e instanceof errors.NetworkMigrateError\n || e instanceof errors.UserMigrateError) {\n this._log.info(`Phone migrated to ${e.newDc}`);\n const shouldRaise = e instanceof errors.PhoneMigrateError\n || e instanceof errors.NetworkMigrateError;\n if (shouldRaise && await checkAuthorization(this)) {\n throw e;\n }\n await this._switchDC(e.newDc);\n } else if (e instanceof errors.MsgWaitError) {\n // we need to resend this after the old one was confirmed.\n await promise.isReady();\n } else {\n throw e;\n }\n }\n }\n throw new Error(`Request was unsuccessful ${attempt} time(s)`);\n }\n\n async getMe() {\n try {\n return (await this.invoke(new requests.users\n .GetUsers({ id: [new constructors.InputUserSelf()] })))[0];\n } catch (e) {\n this._log.warn('error while getting me');\n this._log.warn(e);\n }\n return undefined;\n }\n\n async start(authParams) {\n if (!this.isConnected()) {\n await this.connect();\n }\n\n if (await checkAuthorization(this)) {\n return;\n }\n\n const apiCredentials = {\n apiId: this.apiId,\n apiHash: this.apiHash,\n };\n\n await authFlow(this, apiCredentials, authParams);\n }\n\n uploadFile(fileParams) {\n return uploadFile(this, fileParams);\n }\n\n updateTwoFaSettings(params) {\n return updateTwoFaSettings(this, params);\n }\n\n // event region\n addEventHandler(callback, event) {\n this._eventBuilders.push([event, callback]);\n }\n\n _handleUpdate(update) {\n // this.session.processEntities(update)\n // this._entityCache.add(update)\n\n if (update instanceof constructors.Updates || update instanceof constructors.UpdatesCombined) {\n // TODO deal with entities\n const entities = [];\n for (const x of [...update.users, ...update.chats]) {\n entities.push(x);\n }\n for (const u of update.updates) {\n this._processUpdate(u, update.updates, entities);\n }\n } else if (update instanceof constructors.UpdateShort) {\n this._processUpdate(update.update, undefined);\n } else {\n this._processUpdate(update, undefined);\n }\n // TODO add caching\n // this._stateCache.update(update)\n }\n\n _processUpdate(update, others, entities) {\n update._entities = entities || [];\n const args = {\n update,\n others,\n };\n this._dispatchUpdate(args);\n }\n\n\n // endregion\n\n // region private methods\n\n /**\n Gets a full entity from the given string, which may be a phone or\n a username, and processes all the found entities on the session.\n The string may also be a user link, or a channel/chat invite link.\n\n This method has the side effect of adding the found users to the\n session database, so it can be queried later without API calls,\n if this option is enabled on the session.\n\n Returns the found entity, or raises TypeError if not found.\n * @param string {string}\n * @returns {Promise}\n * @private\n */\n /* CONTEST\n async _getEntityFromString(string) {\n const phone = utils.parsePhone(string)\n if (phone) {\n try {\n for (const user of (await this.invoke(\n new requests.contacts.GetContacts(0))).users) {\n if (user.phone === phone) {\n return user\n }\n }\n } catch (e) {\n if (e.message === 'BOT_METHOD_INVALID') {\n throw new Error('Cannot get entity by phone number as a ' +\n 'bot (try using integer IDs, not strings)')\n }\n throw e\n }\n } else if (['me', 'this'].includes(string.toLowerCase())) {\n return this.getMe()\n } else {\n const { username, isJoinChat } = utils.parseUsername(string)\n if (isJoinChat) {\n const invite = await this.invoke(new requests.messages.CheckChatInvite({\n 'hash': username,\n }))\n if (invite instanceof constructors.ChatInvite) {\n throw new Error('Cannot get entity from a channel (or group) ' +\n 'that you are not part of. Join the group and retry',\n )\n } else if (invite instanceof constructors.ChatInviteAlready) {\n return invite.chat\n }\n } else if (username) {\n try {\n const result = await this.invoke(\n new requests.contacts.ResolveUsername(username))\n const pid = utils.getPeerId(result.peer, false)\n if (result.peer instanceof constructors.PeerUser) {\n for (const x of result.users) {\n if (x.id === pid) {\n return x\n }\n }\n } else {\n for (const x of result.chats) {\n if (x.id === pid) {\n return x\n }\n }\n }\n } catch (e) {\n if (e.message === 'USERNAME_NOT_OCCUPIED') {\n throw new Error(`No user has \"${username}\" as username`)\n }\n throw e\n }\n }\n }\n throw new Error(`Cannot find any entity corresponding to \"${string}\"`)\n }\n */\n // endregion\n\n\n // users region\n /**\n Turns the given entity into its input entity version.\n\n Most requests use this kind of :tl:`InputPeer`, so this is the most\n suitable call to make for those cases. **Generally you should let the\n library do its job** and don't worry about getting the input entity\n first, but if you're going to use an entity often, consider making the\n call:\n\n Arguments\n entity (`str` | `int` | :tl:`Peer` | :tl:`InputPeer`):\n If a username or invite link is given, **the library will\n use the cache**. This means that it's possible to be using\n a username that *changed* or an old invite link (this only\n happens if an invite link for a small group chat is used\n after it was upgraded to a mega-group).\n\n If the username or ID from the invite link is not found in\n the cache, it will be fetched. The same rules apply to phone\n numbers (``'+34 123456789'``) from people in your contact list.\n\n If an exact name is given, it must be in the cache too. This\n is not reliable as different people can share the same name\n and which entity is returned is arbitrary, and should be used\n only for quick tests.\n\n If a positive integer ID is given, the entity will be searched\n in cached users, chats or channels, without making any call.\n\n If a negative integer ID is given, the entity will be searched\n exactly as either a chat (prefixed with ``-``) or as a channel\n (prefixed with ``-100``).\n\n If a :tl:`Peer` is given, it will be searched exactly in the\n cache as either a user, chat or channel.\n\n If the given object can be turned into an input entity directly,\n said operation will be done.\n\n Unsupported types will raise ``TypeError``.\n\n If the entity can't be found, ``ValueError`` will be raised.\n\n Returns\n :tl:`InputPeerUser`, :tl:`InputPeerChat` or :tl:`InputPeerChannel`\n or :tl:`InputPeerSelf` if the parameter is ``'me'`` or ``'self'``.\n\n If you need to get the ID of yourself, you should use\n `get_me` with ``input_peer=True``) instead.\n\n Example\n .. code-block:: python\n\n // If you're going to use \"username\" often in your code\n // (make a lot of calls), consider getting its input entity\n // once, and then using the \"user\" everywhere instead.\n user = await client.get_input_entity('username')\n\n // The same applies to IDs, chats or channels.\n chat = await client.get_input_entity(-123456789)\n\n * @param peer\n * @returns {Promise<>}\n */\n\n /* CONTEST\n async getInputEntity(peer) {\n // Short-circuit if the input parameter directly maps to an InputPeer\n try {\n return utils.getInputPeer(peer)\n // eslint-disable-next-line no-empty\n } catch (e) {\n }\n // Next in priority is having a peer (or its ID) cached in-memory\n try {\n // 0x2d45687 == crc32(b'Peer')\n if (typeof peer === 'number' || peer.SUBCLASS_OF_ID === 0x2d45687) {\n if (this._entityCache.has(peer)) {\n return this._entityCache[peer]\n }\n }\n // eslint-disable-next-line no-empty\n } catch (e) {\n }\n // Then come known strings that take precedence\n if (['me', 'this'].includes(peer)) {\n return new constructors.InputPeerSelf()\n }\n // No InputPeer, cached peer, or known string. Fetch from disk cache\n try {\n return this.session.getInputEntity(peer)\n // eslint-disable-next-line no-empty\n } catch (e) {\n }\n // Only network left to try\n if (typeof peer === 'string') {\n return utils.getInputPeer(await this._getEntityFromString(peer))\n }\n // If we're a bot and the user has messaged us privately users.getUsers\n // will work with accessHash = 0. Similar for channels.getChannels.\n // If we're not a bot but the user is in our contacts, it seems to work\n // regardless. These are the only two special-cased requests.\n peer = utils.getPeer(peer)\n if (peer instanceof constructors.PeerUser) {\n const users = await this.invoke(new requests.users.GetUsers({\n id: [new constructors.InputUser({\n userId: peer.userId,\n accessHash: 0,\n })],\n }))\n if (users && !(users[0] instanceof constructors.UserEmpty)) {\n // If the user passed a valid ID they expect to work for\n // channels but would be valid for users, we get UserEmpty.\n // Avoid returning the invalid empty input peer for that.\n //\n // We *could* try to guess if it's a channel first, and if\n // it's not, work as a chat and try to validate it through\n // another request, but that becomes too much work.\n return utils.getInputPeer(users[0])\n }\n } else if (peer instanceof constructors.PeerChat) {\n return new constructors.InputPeerChat({\n chatId: peer.chatId,\n })\n } else if (peer instanceof constructors.PeerChannel) {\n try {\n const channels = await this.invoke(new requests.channels.GetChannels({\n id: [new constructors.InputChannel({\n channelId: peer.channelId,\n accessHash: 0,\n })],\n }))\n\n return utils.getInputPeer(channels.chats[0])\n // eslint-disable-next-line no-empty\n } catch (e) {\n console.log(e)\n }\n }\n throw new Error(`Could not find the input entity for ${peer.id || peer.channelId || peer.chatId || peer.userId}.\n Please read https://` +\n 'docs.telethon.dev/en/latest/concepts/entities.html to' +\n ' find out more details.',\n )\n }\n */\n async _dispatchUpdate(args = {\n update: undefined,\n others: undefined,\n channelId: undefined,\n ptsDate: undefined,\n }) {\n for (const [builder, callback] of this._eventBuilders) {\n const event = builder.build(args.update);\n if (event) {\n await callback(event);\n }\n }\n }\n\n isConnected() {\n if (this._sender) {\n if (this._sender.isConnected()) {\n return true;\n }\n }\n return false;\n }\n}\n\nfunction timeout(promise, ms) {\n return Promise.race([\n promise,\n Helpers.sleep(ms)\n .then(() => Promise.reject(new Error('TIMEOUT'))),\n ]);\n}\n\nasync function attempts(cb, times, pause) {\n for (let i = 0; i < times; i++) {\n try {\n // We need to `return await` here so it can be caught locally\n return await cb();\n } catch (err) {\n if (i === times - 1) {\n throw err;\n }\n\n await Helpers.sleep(pause);\n }\n }\n return undefined;\n}\n\nmodule.exports = TelegramClient;\n","// eslint-disable-next-line import/no-named-default\nimport { default as Api } from '../tl/api';\nimport TelegramClient from './TelegramClient';\nimport utils from '../Utils';\nimport { sleep } from '../Helpers';\nimport { computeCheck as computePasswordSrpCheck } from '../Password';\n\nexport interface UserAuthParams {\n phoneNumber: string | (() => Promise);\n phoneCode: (isCodeViaApp?: boolean) => Promise;\n password: (hint?: string) => Promise;\n firstAndLastNames: () => Promise<[string, string?]>;\n qrCode: (qrCode: { token: Buffer; expires: number }) => Promise;\n onError: (err: Error) => void;\n forceSMS?: boolean;\n initialMethod?: 'phoneNumber' | 'qrCode';\n}\n\nexport interface BotAuthParams {\n botAuthToken: string;\n}\n\ninterface ApiCredentials {\n apiId: number;\n apiHash: string;\n}\n\nconst DEFAULT_INITIAL_METHOD = 'phoneNumber';\nconst QR_CODE_TIMEOUT = 30000;\n\nexport async function authFlow(\n client: TelegramClient,\n apiCredentials: ApiCredentials,\n authParams: UserAuthParams | BotAuthParams,\n) {\n let me: Api.TypeUser;\n\n if ('botAuthToken' in authParams) {\n me = await signInBot(client, apiCredentials, authParams);\n } else {\n const { initialMethod = DEFAULT_INITIAL_METHOD } = authParams;\n\n if (initialMethod === 'phoneNumber') {\n me = await signInUser(client, apiCredentials, authParams);\n } else {\n me = await signInUserWithQrCode(client, apiCredentials, authParams);\n }\n }\n\n client._log.info('Signed in successfully as', utils.getDisplayName(me));\n}\n\nexport async function checkAuthorization(client: TelegramClient) {\n try {\n await client.invoke(new Api.updates.GetState());\n return true;\n } catch (e) {\n if (e.message === 'Disconnect') throw e;\n return false;\n }\n}\n\nasync function signInUser(\n client: TelegramClient, apiCredentials: ApiCredentials, authParams: UserAuthParams,\n): Promise {\n let phoneNumber;\n let phoneCodeHash;\n let isCodeViaApp = false;\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n try {\n if (typeof authParams.phoneNumber === 'function') {\n try {\n phoneNumber = await authParams.phoneNumber();\n } catch (err) {\n if (err.message === 'RESTART_AUTH_WITH_QR') {\n return signInUserWithQrCode(client, apiCredentials, authParams);\n }\n\n throw err;\n }\n } else {\n phoneNumber = authParams.phoneNumber;\n }\n const sendCodeResult = await sendCode(client, apiCredentials, phoneNumber, authParams.forceSMS);\n phoneCodeHash = sendCodeResult.phoneCodeHash;\n isCodeViaApp = sendCodeResult.isCodeViaApp;\n\n if (typeof phoneCodeHash !== 'string') {\n throw new Error('Failed to retrieve phone code hash');\n }\n\n break;\n } catch (err) {\n if (typeof authParams.phoneNumber !== 'function') {\n throw err;\n }\n\n authParams.onError(err);\n }\n }\n\n let phoneCode;\n let isRegistrationRequired = false;\n let termsOfService;\n\n // eslint-disable-next-line no-constant-condition\n while (1) {\n try {\n try {\n phoneCode = await authParams.phoneCode(isCodeViaApp);\n } catch (err) {\n // This is the support for changing phone number from the phone code screen.\n if (err.message === 'RESTART_AUTH') {\n return signInUser(client, apiCredentials, authParams);\n }\n }\n\n if (!phoneCode) {\n throw new Error('Code is empty');\n }\n\n // May raise PhoneCodeEmptyError, PhoneCodeExpiredError,\n // PhoneCodeHashEmptyError or PhoneCodeInvalidError.\n const result = await client.invoke(new Api.auth.SignIn({\n phoneNumber,\n phoneCodeHash,\n phoneCode,\n }));\n\n if (result instanceof Api.auth.AuthorizationSignUpRequired) {\n isRegistrationRequired = true;\n termsOfService = result.termsOfService;\n break;\n }\n\n return result.user;\n } catch (err) {\n if (err.message === 'SESSION_PASSWORD_NEEDED') {\n return signInWithPassword(client, apiCredentials, authParams);\n } else {\n authParams.onError(err);\n }\n }\n }\n\n if (isRegistrationRequired) {\n // eslint-disable-next-line no-constant-condition\n while (1) {\n try {\n const [firstName, lastName] = await authParams.firstAndLastNames();\n if (!firstName) {\n throw new Error('First name is required');\n }\n\n const { user } = await client.invoke(new Api.auth.SignUp({\n phoneNumber,\n phoneCodeHash,\n firstName,\n lastName,\n })) as Api.auth.Authorization;\n\n if (termsOfService) {\n // This is a violation of Telegram rules: the user should be presented with and accept TOS.\n await client.invoke(new Api.help.AcceptTermsOfService({ id: termsOfService.id }));\n }\n\n return user;\n } catch (err) {\n authParams.onError(err);\n }\n }\n }\n\n authParams.onError(new Error('Auth failed'));\n return signInUser(client, apiCredentials, authParams);\n}\n\nasync function signInUserWithQrCode(\n client: TelegramClient, apiCredentials: ApiCredentials, authParams: UserAuthParams,\n): Promise {\n let isScanningComplete = false;\n\n const inputPromise = (async () => {\n // eslint-disable-next-line no-constant-condition\n while (1) {\n if (isScanningComplete) {\n break;\n }\n\n const result = await client.invoke(new Api.auth.ExportLoginToken({\n apiId: Number(process.env.TELEGRAM_T_API_ID),\n apiHash: process.env.TELEGRAM_T_API_HASH,\n exceptIds: [],\n }));\n if (!(result instanceof Api.auth.LoginToken)) {\n throw new Error('Unexpected');\n }\n\n const { token, expires } = result;\n\n await Promise.race([\n authParams.qrCode({ token, expires }),\n sleep(QR_CODE_TIMEOUT),\n ]);\n }\n })();\n\n const updatePromise = new Promise((resolve) => {\n client.addEventHandler((update: Api.TypeUpdate) => {\n if (update instanceof Api.UpdateLoginToken) {\n resolve();\n }\n }, { build: (update: object) => update });\n });\n\n try {\n // Either we receive an update that QR is successfully scanned,\n // or we receive a rejection caused by user going back to the regular auth form\n await Promise.race([updatePromise, inputPromise]);\n } catch (err) {\n if (err.message === 'RESTART_AUTH') {\n return await signInUser(client, apiCredentials, authParams);\n }\n\n throw err;\n } finally {\n isScanningComplete = true;\n }\n\n try {\n const result2 = await client.invoke(new Api.auth.ExportLoginToken({\n apiId: Number(process.env.TELEGRAM_T_API_ID),\n apiHash: process.env.TELEGRAM_T_API_HASH,\n exceptIds: [],\n }));\n\n if (result2 instanceof Api.auth.LoginTokenSuccess && result2.authorization instanceof Api.auth.Authorization) {\n return result2.authorization.user;\n } else if (result2 instanceof Api.auth.LoginTokenMigrateTo) {\n await client._switchDC(result2.dcId);\n const migratedResult = await client.invoke(new Api.auth.ImportLoginToken({\n token: result2.token,\n }));\n\n if (migratedResult instanceof Api.auth.LoginTokenSuccess\n && migratedResult.authorization instanceof Api.auth.Authorization) {\n return migratedResult.authorization.user;\n }\n }\n } catch (err) {\n if (err.message === 'SESSION_PASSWORD_NEEDED') {\n return signInWithPassword(client, apiCredentials, authParams);\n }\n\n throw err;\n }\n\n // This is a workaround for TypeScript (never actually reached)\n // eslint-disable-next-line no-throw-literal\n throw undefined;\n}\n\nasync function sendCode(\n client: TelegramClient, apiCredentials: ApiCredentials, phoneNumber: string, forceSMS = false,\n): Promise<{\n phoneCodeHash: string;\n isCodeViaApp: boolean;\n }> {\n try {\n const { apiId, apiHash } = apiCredentials;\n const sendResult = await client.invoke(new Api.auth.SendCode({\n phoneNumber,\n apiId,\n apiHash,\n settings: new Api.CodeSettings(),\n }));\n\n // If we already sent a SMS, do not resend the phoneCode (hash may be empty)\n if (!forceSMS || (sendResult.type instanceof Api.auth.SentCodeTypeSms)) {\n return {\n phoneCodeHash: sendResult.phoneCodeHash,\n isCodeViaApp: sendResult.type instanceof Api.auth.SentCodeTypeApp,\n };\n }\n\n const resendResult = await client.invoke(new Api.auth.ResendCode({\n phoneNumber,\n phoneCodeHash: sendResult.phoneCodeHash,\n }));\n\n return {\n phoneCodeHash: resendResult.phoneCodeHash,\n isCodeViaApp: resendResult.type instanceof Api.auth.SentCodeTypeApp,\n };\n } catch (err) {\n if (err.message === 'AUTH_RESTART') {\n return sendCode(client, apiCredentials, phoneNumber, forceSMS);\n } else {\n throw err;\n }\n }\n}\n\nasync function signInWithPassword(\n client: TelegramClient, apiCredentials: ApiCredentials, authParams: UserAuthParams,\n): Promise {\n // eslint-disable-next-line no-constant-condition\n while (1) {\n try {\n const passwordSrpResult = await client.invoke(new Api.account.GetPassword());\n const password = await authParams.password(passwordSrpResult.hint);\n if (!password) {\n throw new Error('Password is empty');\n }\n\n const passwordSrpCheck = await computePasswordSrpCheck(passwordSrpResult, password);\n const { user } = await client.invoke(new Api.auth.CheckPassword({\n password: passwordSrpCheck,\n })) as Api.auth.Authorization;\n\n return user;\n } catch (err) {\n authParams.onError(err);\n }\n }\n\n // eslint-disable-next-line no-unreachable\n return undefined!; // Never reached (TypeScript fix)\n}\n\nasync function signInBot(client: TelegramClient, apiCredentials: ApiCredentials, authParams: BotAuthParams) {\n const { apiId, apiHash } = apiCredentials;\n const { botAuthToken } = authParams;\n\n const { user } = await client.invoke(new Api.auth.ImportBotAuthorization({\n apiId,\n apiHash,\n botAuthToken,\n })) as Api.auth.Authorization;\n\n return user;\n}\n","// eslint-disable-next-line import/no-named-default\nimport { default as Api } from '../tl/api';\nimport TelegramClient from './TelegramClient';\nimport { getAppropriatedPartSize } from '../Utils';\nimport { sleep, createDeferred } from '../Helpers';\nimport errors from '../errors';\n\nexport interface progressCallback {\n isCanceled?: boolean;\n acceptsBuffer?: boolean;\n\n (\n progress: number, // Float between 0 and 1.\n ...args: any[]\n ): void;\n}\n\nexport interface DownloadFileParams {\n dcId: number;\n fileSize: number;\n workers?: number;\n partSizeKb?: number;\n start?: number;\n end?: number;\n progressCallback?: progressCallback;\n}\n\ninterface Deferred {\n promise: Promise;\n resolve: (value?: any) => void;\n}\n\n// Chunk sizes for `upload.getFile` must be multiple of the smallest size\nconst MIN_CHUNK_SIZE = 4096;\nconst DEFAULT_CHUNK_SIZE = 64; // kb\nconst ONE_MB = 1024 * 1024;\nconst DISCONNECT_SLEEP = 1000;\n\n\nclass Foreman {\n private deferred: Deferred | undefined;\n\n private activeWorkers = 0;\n\n constructor(private maxWorkers: number) {\n }\n\n requestWorker() {\n this.activeWorkers++;\n\n if (this.activeWorkers > this.maxWorkers) {\n this.deferred = createDeferred();\n return this.deferred!.promise;\n }\n\n return Promise.resolve();\n }\n\n releaseWorker() {\n this.activeWorkers--;\n\n if (this.deferred && (this.activeWorkers <= this.maxWorkers)) {\n this.deferred.resolve();\n }\n }\n}\n\nexport async function downloadFile(\n client: TelegramClient,\n inputLocation: Api.InputFileLocation,\n fileParams: DownloadFileParams,\n) {\n let {\n partSizeKb, end,\n } = fileParams;\n const {\n fileSize, workers = 1,\n } = fileParams;\n const { dcId, progressCallback, start = 0 } = fileParams;\n\n end = end && end < fileSize ? end : fileSize - 1;\n\n if (!partSizeKb) {\n partSizeKb = fileSize ? getAppropriatedPartSize(fileSize) : DEFAULT_CHUNK_SIZE;\n }\n\n const partSize = partSizeKb * 1024;\n const partsCount = end ? Math.ceil((end - start) / partSize) : 1;\n\n if (partSize % MIN_CHUNK_SIZE !== 0) {\n throw new Error(`The part size must be evenly divisible by ${MIN_CHUNK_SIZE}`);\n }\n\n client._log.info(`Downloading file in chunks of ${partSize} bytes`);\n\n const foreman = new Foreman(workers);\n const promises: Promise[] = [];\n let offset = start;\n // Used for files with unknown size and for manual cancellations\n let hasEnded = false;\n\n let progress = 0;\n if (progressCallback) {\n progressCallback(progress);\n }\n\n // Preload sender\n await client.getSender(dcId);\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n let limit = partSize;\n let isPrecise = false;\n\n if (Math.floor(offset / ONE_MB) !== Math.floor((offset + limit - 1) / ONE_MB)) {\n limit = ONE_MB - (offset % ONE_MB);\n isPrecise = true;\n }\n\n await foreman.requestWorker();\n\n if (hasEnded) {\n foreman.releaseWorker();\n break;\n }\n\n // eslint-disable-next-line no-loop-func\n promises.push((async (offsetMemo: number) => {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n let sender;\n try {\n sender = await client.getSender(dcId);\n const result = await sender.send(new Api.upload.GetFile({\n location: inputLocation,\n offset: offsetMemo,\n limit,\n precise: isPrecise || undefined,\n }));\n\n if (progressCallback) {\n if (progressCallback.isCanceled) {\n throw new Error('USER_CANCELED');\n }\n\n progress += (1 / partsCount);\n progressCallback(progress);\n }\n\n if (!end && (result.bytes.length < limit)) {\n hasEnded = true;\n }\n\n foreman.releaseWorker();\n\n return result.bytes;\n } catch (err) {\n if (sender && !sender.isConnected()) {\n await sleep(DISCONNECT_SLEEP);\n continue;\n } else if (err instanceof errors.FloodWaitError) {\n await sleep(err.seconds * 1000);\n continue;\n }\n\n foreman.releaseWorker();\n\n hasEnded = true;\n throw err;\n }\n }\n })(offset));\n\n offset += limit;\n\n if (end && (offset > end)) {\n break;\n }\n }\n const results = await Promise.all(promises);\n const buffers = results.filter(Boolean);\n const totalLength = end ? (end + 1) - start : undefined;\n return Buffer.concat(buffers, totalLength);\n}\n","// eslint-disable-next-line import/no-named-default\nimport { default as Api } from '../tl/api';\n\nimport TelegramClient from './TelegramClient';\nimport { generateRandomBytes, readBigIntFromBuffer, sleep } from '../Helpers';\nimport { getAppropriatedPartSize } from '../Utils';\nimport errors from '../errors';\n\ninterface OnProgress {\n isCanceled?: boolean;\n\n // Float between 0 and 1.\n (progress: number): void;\n}\n\nexport interface UploadFileParams {\n file: File;\n workers: number;\n onProgress?: OnProgress;\n}\n\nconst KB_TO_BYTES = 1024;\nconst LARGE_FILE_THRESHOLD = 10 * 1024 * 1024;\nconst DISCONNECT_SLEEP = 1000;\n\nexport async function uploadFile(\n client: TelegramClient,\n fileParams: UploadFileParams,\n): Promise {\n const { file, onProgress } = fileParams;\n let { workers } = fileParams;\n\n const { name, size } = file;\n const fileId = readBigIntFromBuffer(generateRandomBytes(8), true, true);\n const isLarge = size > LARGE_FILE_THRESHOLD;\n\n const partSize = getAppropriatedPartSize(size) * KB_TO_BYTES;\n const partCount = Math.floor((size + partSize - 1) / partSize);\n const buffer = Buffer.from(await fileToBuffer(file));\n\n // Make sure a new sender can be created before starting upload\n await client.getSender(client.session.dcId);\n\n if (!workers || !size) {\n workers = 1;\n }\n if (workers >= partCount) {\n workers = partCount;\n }\n\n let progress = 0;\n if (onProgress) {\n onProgress(progress);\n }\n\n for (let i = 0; i < partCount; i += workers) {\n const sendingParts = [];\n let end = i + workers;\n if (end > partCount) {\n end = partCount;\n }\n\n for (let j = i; j < end; j++) {\n const bytes = buffer.slice(j * partSize, (j + 1) * partSize);\n\n // eslint-disable-next-line no-loop-func\n sendingParts.push((async (jMemo: number, bytesMemo: Buffer) => {\n while (true) {\n let sender;\n try {\n // We always upload from the DC we are in\n sender = await client.getSender(client.session.dcId);\n await sender.send(\n isLarge\n ? new Api.upload.SaveBigFilePart({\n fileId,\n filePart: jMemo,\n fileTotalParts: partCount,\n bytes: bytesMemo,\n })\n : new Api.upload.SaveFilePart({\n fileId,\n filePart: jMemo,\n bytes: bytesMemo,\n }),\n );\n } catch (err) {\n if (sender && !sender.isConnected()) {\n await sleep(DISCONNECT_SLEEP);\n continue;\n } else if (err instanceof errors.FloodWaitError) {\n await sleep(err.seconds * 1000);\n continue;\n }\n throw err;\n }\n\n if (onProgress) {\n if (onProgress.isCanceled) {\n throw new Error('USER_CANCELED');\n }\n\n progress += (1 / partCount);\n onProgress(progress);\n }\n break;\n }\n })(j, bytes));\n }\n\n await Promise.all(sendingParts);\n }\n\n return isLarge\n ? new Api.InputFileBig({\n id: fileId,\n parts: partCount,\n name,\n })\n : new Api.InputFile({\n id: fileId,\n parts: partCount,\n name,\n md5Checksum: '', // This is not a \"flag\", so not sure if we can make it optional.\n });\n}\n\nfunction fileToBuffer(file: File) {\n return new Response(file).arrayBuffer();\n}\n","const {\n sha1,\n toSignedLittleBuffer,\n readBufferFromBigInt,\n readBigIntFromBuffer,\n} = require('../Helpers');\nconst BinaryReader = require('../extensions/BinaryReader');\nconst { sleep } = require('../Helpers');\n\nclass AuthKey {\n constructor(value, hash) {\n if (!hash || !value) {\n return;\n }\n this._key = value;\n this._hash = hash;\n const reader = new BinaryReader(hash);\n this.auxHash = reader.readLong(false);\n reader.read(4);\n this.keyId = reader.readLong(false);\n }\n\n async setKey(value) {\n if (!value) {\n this._key = undefined;\n this.auxHash = undefined;\n this.keyId = undefined;\n this._hash = undefined;\n return;\n }\n if (value instanceof AuthKey) {\n this._key = value._key;\n this.auxHash = value.auxHash;\n this.keyId = value.keyId;\n this._hash = value._hash;\n return;\n }\n this._key = value;\n this._hash = await sha1(this._key);\n const reader = new BinaryReader(this._hash);\n this.auxHash = reader.readLong(false);\n reader.read(4);\n this.keyId = reader.readLong(false);\n }\n\n async waitForKey() {\n while (!this.keyId) {\n await sleep(20);\n }\n }\n\n getKey() {\n return this._key;\n }\n\n // TODO : This doesn't really fit here, it's only used in authentication\n\n /**\n * Calculates the new nonce hash based on the current class fields' values\n * @param newNonce\n * @param number\n * @returns {bigint}\n */\n async calcNewNonceHash(newNonce, number) {\n newNonce = toSignedLittleBuffer(newNonce, 32);\n const n = Buffer.alloc(1);\n n.writeUInt8(number, 0);\n const data = Buffer.concat([newNonce,\n Buffer.concat([n, readBufferFromBigInt(this.auxHash, 8, true)])]);\n\n // Calculates the message key from the given data\n const shaData = (await sha1(data)).slice(4, 20);\n return readBigIntFromBuffer(shaData, true, true);\n }\n\n equals(other) {\n return other instanceof this.constructor && this._key && other.getKey() && other.getKey()\n .equals(this._key);\n }\n}\n\nmodule.exports = AuthKey;\n","const crypto = require('./crypto');\n\nclass CTR {\n constructor(key, iv) {\n if (!Buffer.isBuffer(key) || !Buffer.isBuffer(iv) || iv.length !== 16) {\n throw new Error('Key and iv need to be a buffer');\n }\n\n this.cipher = crypto.createCipheriv('AES-256-CTR', key, iv);\n }\n\n encrypt(data) {\n return Buffer.from(this.cipher.update(data));\n }\n}\n\nmodule.exports = CTR;\n","const BigInt = require('big-integer');\nconst { modExp } = require('../Helpers');\n\nclass Factorizator {\n /**\n * Calculates the greatest common divisor\n * @param a {BigInteger}\n * @param b {BigInteger}\n * @returns {BigInteger}\n */\n static gcd(a, b) {\n while (b.neq(BigInt.zero)) {\n const temp = b;\n b = a.remainder(b);\n a = temp;\n }\n return a;\n }\n\n /**\n * Factorizes the given number and returns both the divisor and the number divided by the divisor\n * @param pq {BigInteger}\n * @returns {{p: *, q: *}}\n */\n static factorize(pq) {\n if (pq.remainder(2)\n .equals(BigInt.zero)) {\n return {\n p: BigInt(2),\n q: pq.divide(BigInt(2)),\n };\n }\n let y = BigInt.randBetween(BigInt(1), pq.minus(1));\n const c = BigInt.randBetween(BigInt(1), pq.minus(1));\n const m = BigInt.randBetween(BigInt(1), pq.minus(1));\n\n let g = BigInt.one;\n let r = BigInt.one;\n let q = BigInt.one;\n let x = BigInt.zero;\n let ys = BigInt.zero;\n let k;\n\n while (g.eq(BigInt.one)) {\n x = y;\n for (let i = 0; BigInt(i)\n .lesser(r); i++) {\n y = (modExp(y, BigInt(2), pq)).add(c)\n .remainder(pq);\n }\n k = BigInt.zero;\n\n while (k.lesser(r) && g.eq(BigInt.one)) {\n ys = y;\n const condition = BigInt.min(m, r.minus(k));\n for (let i = 0; BigInt(i)\n .lesser(condition); i++) {\n y = (modExp(y, BigInt(2), pq)).add(c)\n .remainder(pq);\n q = q.multiply(x.minus(y)\n .abs())\n .remainder(pq);\n }\n g = Factorizator.gcd(q, pq);\n k = k.add(m);\n }\n\n r = r.multiply(2);\n }\n\n\n if (g.eq(pq)) {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n ys = (modExp(ys, BigInt(2), pq)).add(c)\n .remainder(pq);\n g = Factorizator.gcd(x.minus(ys)\n .abs(), pq);\n\n if (g.greater(1)) {\n break;\n }\n }\n }\n const p = g;\n q = pq.divide(g);\n return p < q ? {\n p,\n q,\n } : {\n p: q,\n q: p,\n };\n }\n}\n\nmodule.exports = Factorizator;\n","const { IGE: AESIGE } = require('@cryptography/aes');\nconst Helpers = require('../Helpers');\n\n\nclass IGENEW {\n constructor(key, iv) {\n this.ige = new AESIGE(key, iv);\n }\n\n /**\n * Decrypts the given text in 16-bytes blocks by using the given key and 32-bytes initialization vector\n * @param cipherText {Buffer}\n * @returns {Buffer}\n */\n decryptIge(cipherText) {\n return Helpers.convertToLittle(this.ige.decrypt(cipherText));\n }\n\n /**\n * Encrypts the given text in 16-bytes blocks by using the given key and 32-bytes initialization vector\n * @param plainText {Buffer}\n * @returns {Buffer}\n */\n encryptIge(plainText) {\n const padding = plainText.length % 16;\n if (padding) {\n plainText = Buffer.concat([plainText, Helpers.generateRandomBytes(16 - padding)]);\n }\n\n return Helpers.convertToLittle(this.ige.encrypt(plainText));\n }\n}\n\nmodule.exports = IGENEW;\n","/**\n * Uint32Array -> ArrayBuffer (low-endian os)\n */\nexport function i2abLow(buf: Uint32Array): ArrayBuffer {\n const uint8 = new Uint8Array(buf.length * 4);\n let i = 0;\n\n for (let j = 0; j < buf.length; j++) {\n const int = buf[j];\n\n uint8[i++] = int >>> 24;\n uint8[i++] = (int >> 16) & 0xFF;\n uint8[i++] = (int >> 8) & 0xFF;\n uint8[i++] = int & 0xFF;\n }\n\n return uint8.buffer;\n}\n\n/**\n * Uint32Array -> ArrayBuffer (big-endian os)\n */\nexport function i2abBig(buf: Uint32Array): ArrayBuffer {\n return buf.buffer;\n}\n\n/**\n * ArrayBuffer -> Uint32Array (low-endian os)\n */\nexport function ab2iLow(ab: ArrayBuffer | SharedArrayBuffer | Uint8Array): Uint32Array {\n const uint8 = new Uint8Array(ab);\n const buf = new Uint32Array(uint8.length / 4);\n\n for (let i = 0; i < uint8.length; i += 4) {\n buf[i / 4] = (\n uint8[i] << 24\n ^ uint8[i + 1] << 16\n ^ uint8[i + 2] << 8\n ^ uint8[i + 3]\n );\n }\n\n return buf;\n}\n\n/**\n * ArrayBuffer -> Uint32Array (big-endian os)\n */\nexport function ab2iBig(ab: ArrayBuffer | SharedArrayBuffer | Uint8Array): Uint32Array {\n return new Uint32Array(ab);\n}\n\nexport const isBigEndian = new Uint8Array(new Uint32Array([0x01020304]))[0] === 0x01;\nexport const i2ab = isBigEndian ? i2abBig : i2abLow;\nexport const ab2i = isBigEndian ? ab2iBig : ab2iLow;\n","const AES = require('@cryptography/aes').default;\nconst {\n i2ab,\n ab2i,\n} = require('./converters');\nconst { getWords } = require('./words');\n\nclass Counter {\n constructor(initialValue) {\n this.setBytes(initialValue);\n }\n\n setBytes(bytes) {\n bytes = Buffer.from(bytes);\n this._counter = bytes;\n }\n\n increment() {\n for (let i = 15; i >= 0; i--) {\n if (this._counter[i] === 255) {\n this._counter[i] = 0;\n } else {\n this._counter[i]++;\n break;\n }\n }\n }\n}\n\nclass CTR {\n constructor(key, counter) {\n if (!(counter instanceof Counter)) {\n counter = new Counter(counter);\n }\n\n this._counter = counter;\n\n this._remainingCounter = undefined;\n this._remainingCounterIndex = 16;\n\n this._aes = new AES(getWords(key));\n }\n\n update(plainText) {\n return this.encrypt(plainText);\n }\n\n encrypt(plainText) {\n const encrypted = Buffer.from(plainText);\n\n for (let i = 0; i < encrypted.length; i++) {\n if (this._remainingCounterIndex === 16) {\n this._remainingCounter = Buffer.from(i2ab(this._aes.encrypt(ab2i(this._counter._counter))));\n this._remainingCounterIndex = 0;\n this._counter.increment();\n }\n encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++];\n }\n\n return encrypted;\n }\n}\n\n// endregion\nfunction createDecipheriv(algorithm, key, iv) {\n if (algorithm.includes('ECB')) {\n throw new Error('Not supported');\n } else {\n return new CTR(key, iv);\n }\n}\n\nfunction createCipheriv(algorithm, key, iv) {\n if (algorithm.includes('ECB')) {\n throw new Error('Not supported');\n } else {\n return new CTR(key, iv);\n }\n}\n\nfunction randomBytes(count) {\n const bytes = new Uint8Array(count);\n crypto.getRandomValues(bytes);\n return bytes;\n}\n\nclass Hash {\n constructor(algorithm) {\n this.algorithm = algorithm;\n }\n\n update(data) {\n // We shouldn't be needing new Uint8Array but it doesn't\n // work without it\n this.data = new Uint8Array(data);\n }\n\n\n async digest() {\n if (this.algorithm === 'sha1') {\n // eslint-disable-next-line no-restricted-globals\n return Buffer.from(await self.crypto.subtle.digest('SHA-1', this.data));\n } else if (this.algorithm === 'sha256') {\n // eslint-disable-next-line no-restricted-globals\n return Buffer.from(await self.crypto.subtle.digest('SHA-256', this.data));\n }\n return undefined;\n }\n}\n\nasync function pbkdf2(password, salt, iterations) {\n const passwordKey = await crypto.subtle.importKey('raw', password,\n { name: 'PBKDF2' }, false, ['deriveBits']);\n return Buffer.from(await crypto.subtle.deriveBits({\n name: 'PBKDF2',\n hash: 'SHA-512',\n salt,\n iterations,\n }, passwordKey, 512));\n}\n\nfunction createHash(algorithm) {\n return new Hash(algorithm);\n}\n\nmodule.exports = {\n createCipheriv,\n createDecipheriv,\n randomBytes,\n createHash,\n pbkdf2,\n};\n","/*\n * Imported from https://github.com/spalt08/cryptography/blob/master/packages/aes/src/utils/words.ts\n */\n\nexport function s2i(str: string, pos: number) {\n return (\n str.charCodeAt(pos) << 24\n ^ str.charCodeAt(pos + 1) << 16\n ^ str.charCodeAt(pos + 2) << 8\n ^ str.charCodeAt(pos + 3)\n );\n}\n\n/**\n * Helper function for transforming string key to Uint32Array\n */\nexport function getWords(key: string | Uint8Array | Uint32Array) {\n if (key instanceof Uint32Array) {\n return key;\n }\n\n if (typeof key === 'string') {\n if (key.length % 4 !== 0) for (let i = key.length % 4; i <= 4; i++) key += '\\0x00';\n\n const buf = new Uint32Array(key.length / 4);\n for (let i = 0; i < key.length; i += 4) buf[i / 4] = s2i(key, i);\n\n return buf;\n }\n\n if (key instanceof Uint8Array) {\n const buf = new Uint32Array(key.length / 4);\n\n for (let i = 0; i < key.length; i += 4) {\n buf[i / 4] = (\n key[i] << 24\n ^ key[i + 1] << 16\n ^ key[i + 2] << 8\n ^ key[i + 3]\n );\n }\n\n return buf;\n }\n\n throw new Error('Unable to create 32-bit words');\n}\n\nexport function xor(left: Uint32Array, right: Uint32Array, to = left) {\n for (let i = 0; i < left.length; i++) to[i] = left[i] ^ right[i];\n}\n","/**\n * Errors not related to the Telegram API itself\n */\n\n\n/**\n * Occurs when a read operation was cancelled.\n */\nclass ReadCancelledError extends Error {\n constructor() {\n super('The read operation was cancelled.');\n }\n}\n\n/**\n * Occurs when a type is not found, for example,\n * when trying to read a TLObject with an invalid constructor code.\n */\nclass TypeNotFoundError extends Error {\n constructor(invalidConstructorId, remaining) {\n super(`Could not find a matching Constructor ID for the TLObject that was supposed to be\n read with ID ${invalidConstructorId}. Most likely, a TLObject was trying to be read when\n it should not be read. Remaining bytes: ${remaining.length}`);\n if (typeof alert !== 'undefined') {\n // eslint-disable-next-line no-alert\n alert(`Missing MTProto Entity: Please, make sure to add TL definition for ID ${invalidConstructorId}`);\n }\n this.invalidConstructorId = invalidConstructorId;\n this.remaining = remaining;\n }\n}\n\n/**\n * Occurs when using the TCP full mode and the checksum of a received\n * packet doesn't match the expected checksum.\n */\nclass InvalidChecksumError extends Error {\n constructor(checksum, validChecksum) {\n super(`Invalid checksum (${checksum} when ${validChecksum} was expected). This packet should be skipped.`);\n this.checksum = checksum;\n this.validChecksum = validChecksum;\n }\n}\n\n/**\n * Occurs when the buffer is invalid, and may contain an HTTP error code.\n * For instance, 404 means \"forgotten/broken authorization key\", while\n */\nclass InvalidBufferError extends Error {\n constructor(payload) {\n let code;\n if (payload.length === 4) {\n code = -payload.readInt32LE(0);\n super(`Invalid response buffer (HTTP code ${code})`);\n } else {\n super(`Invalid response buffer (too short ${payload})`);\n }\n this.code = code;\n this.payload = payload;\n }\n}\n\n/**\n * Generic security error, mostly used when generating a new AuthKey.\n */\nclass SecurityError extends Error {\n constructor(...args) {\n if (!args.length) {\n args = ['A security check failed.'];\n }\n super(...args);\n }\n}\n\n/**\n * Occurs when there's a hash mismatch between the decrypted CDN file\n * and its expected hash.\n */\nclass CdnFileTamperedError extends SecurityError {\n constructor() {\n super('The CDN file has been altered and its download cancelled.');\n }\n}\n\n/**\n * Occurs when handling a badMessageNotification\n */\nclass BadMessageError extends Error {\n static ErrorMessages = {\n 16:\n 'msg_id too low (most likely, client time is wrong it would be worthwhile to '\n + 'synchronize it using msg_id notifications and re-send the original message '\n + 'with the “correct” msg_id or wrap it in a container with a new msg_id if the '\n + 'original message had waited too long on the client to be transmitted).',\n\n 17:\n 'msg_id too high (similar to the previous case, the client time has to be '\n + 'synchronized, and the message re-sent with the correct msg_id).',\n\n 18:\n 'Incorrect two lower order msg_id bits (the server expects client message msg_id '\n + 'to be divisible by 4).',\n\n 19: 'Container msg_id is the same as msg_id of a previously received message (this must never happen).',\n\n 20:\n 'Message too old, and it cannot be verified whether the server has received a '\n + 'message with this msg_id or not.',\n\n 32:\n 'msg_seqno too low (the server has already received a message with a lower '\n + 'msg_id but with either a higher or an equal and odd seqno).',\n\n 33:\n 'msg_seqno too high (similarly, there is a message with a higher msg_id but with '\n + 'either a lower or an equal and odd seqno).',\n\n 34: 'An even msg_seqno expected (irrelevant message), but odd received.',\n\n 35: 'Odd msg_seqno expected (relevant message), but even received.',\n\n 48:\n 'Incorrect server salt (in this case, the bad_server_salt response is received with '\n + 'the correct salt, and the message is to be re-sent with it).',\n\n 64: 'Invalid container.',\n };\n\n constructor(request, code) {\n let errorMessage = BadMessageError.ErrorMessages[code]\n || `Unknown error code (this should not happen): ${code}.`;\n errorMessage += ` Caused by ${request.className}`;\n super(errorMessage);\n this.message = errorMessage;\n this.code = code;\n }\n}\n\n// TODO : Support multi errors.\n\nmodule.exports = {\n ReadCancelledError,\n TypeNotFoundError,\n InvalidChecksumError,\n InvalidBufferError,\n SecurityError,\n CdnFileTamperedError,\n BadMessageError,\n};\n","/**\n * Base class for all Remote Procedure Call errors.\n */\nclass RPCError extends Error {\n constructor(message, request, code = undefined) {\n super(\n 'RPCError {0}: {1}{2}'\n .replace('{0}', code)\n .replace('{1}', message)\n .replace('{2}', RPCError._fmtRequest(request)),\n );\n this.code = code;\n this.message = message;\n }\n\n static _fmtRequest(request) {\n // TODO fix this\n if (request) {\n return ` (caused by ${request.className})`;\n } else {\n return '';\n }\n }\n}\n\n/**\n * The request must be repeated, but directed to a different data center.\n */\nclass InvalidDCError extends RPCError {\n constructor(request, message, code) {\n super(message, request, code);\n this.code = code || 303;\n this.message = message || 'ERROR_SEE_OTHER';\n }\n}\n\n/**\n * The query contains errors. In the event that a request was created\n * using a form and contains user generated data, the user should be\n * notified that the data must be corrected before the query is repeated.\n */\nclass BadRequestError extends RPCError {\n code = 400;\n\n message = 'BAD_REQUEST';\n}\n\n/**\n * There was an unauthorized attempt to use functionality available only\n * to authorized users.\n */\nclass UnauthorizedError extends RPCError {\n code = 401;\n\n message = 'UNAUTHORIZED';\n}\n\n/**\n * Privacy violation. For example, an attempt to write a message to\n * someone who has blacklisted the current user.\n */\nclass ForbiddenError extends RPCError {\n code = 403;\n\n message = 'FORBIDDEN';\n}\n\n/**\n * An attempt to invoke a non-existent object, such as a method.\n */\nclass NotFoundError extends RPCError {\n code = 404;\n\n message = 'NOT_FOUND';\n}\n\n/**\n * Errors related to invalid authorization key, like\n * AUTH_KEY_DUPLICATED which can cause the connection to fail.\n */\nclass AuthKeyError extends RPCError {\n code = 406;\n\n message = 'AUTH_KEY';\n}\n\n/**\n * The maximum allowed number of attempts to invoke the given method\n * with the given input parameters has been exceeded. For example, in an\n * attempt to request a large number of text messages (SMS) for the same\n * phone number.\n */\nclass FloodError extends RPCError {\n code = 420;\n\n message = 'FLOOD';\n}\n\n/**\n * An internal server error occurred while a request was being processed\n * for example, there was a disruption while accessing a database or file\n * storage\n */\nclass ServerError extends RPCError {\n code = 500; // Also witnessed as -500\n\n message = 'INTERNAL';\n}\n\n/**\n * Clicking the inline buttons of bots that never (or take to long to)\n * call ``answerCallbackQuery`` will result in this \"special\" RPCError.\n */\nclass TimedOutError extends RPCError {\n code = 503; // Only witnessed as -503\n\n message = 'Timeout';\n}\n\nmodule.exports = {\n RPCError,\n InvalidDCError,\n BadRequestError,\n UnauthorizedError,\n ForbiddenError,\n NotFoundError,\n AuthKeyError,\n FloodError,\n ServerError,\n TimedOutError,\n};\n","const {\n RPCError,\n InvalidDCError,\n FloodError,\n BadRequestError,\n} = require('./RPCBaseErrors');\n\n\nclass UserMigrateError extends InvalidDCError {\n constructor(args) {\n const newDc = Number(args.capture || 0);\n // eslint-disable-next-line max-len\n super(`The user whose identity is being used to execute queries is associated with DC ${newDc}${RPCError._fmtRequest(args.request)}`);\n // eslint-disable-next-line max-len\n this.message = `The user whose identity is being used to execute queries is associated with DC ${newDc}${RPCError._fmtRequest(args.request)}`;\n this.newDc = newDc;\n }\n}\n\n\nclass PhoneMigrateError extends InvalidDCError {\n constructor(args) {\n const newDc = Number(args.capture || 0);\n // eslint-disable-next-line max-len\n super(`The phone number a user is trying to use for authorization is associated with DC ${newDc}${RPCError._fmtRequest(args.request)}`);\n // eslint-disable-next-line max-len\n this.message = `The phone number a user is trying to use for authorization is associated with DC ${newDc}${RPCError._fmtRequest(args.request)}`;\n this.newDc = newDc;\n }\n}\n\nclass SlowModeWaitError extends FloodError {\n constructor(args) {\n const seconds = Number(args.capture || 0);\n // eslint-disable-next-line max-len\n super(`A wait of ${seconds} seconds is required before sending another message in this chat${RPCError._fmtRequest(args.request)}`);\n // eslint-disable-next-line max-len\n this.message = `A wait of ${seconds} seconds is required before sending another message in this chat${RPCError._fmtRequest(args.request)}`;\n this.seconds = seconds;\n }\n}\n\nclass FloodWaitError extends FloodError {\n constructor(args) {\n const seconds = Number(args.capture || 0);\n super(`A wait of ${seconds} seconds is required${RPCError._fmtRequest(args.request)}`);\n this.message = `A wait of ${seconds} seconds is required${RPCError._fmtRequest(args.request)}`;\n this.seconds = seconds;\n }\n}\nclass MsgWaitError extends FloodError {\n constructor(args) {\n super(`Message failed to be sent.${RPCError._fmtRequest(args.request)}`);\n this.message = `Message failed to be sent.${RPCError._fmtRequest(args.request)}`;\n }\n}\n\nclass FloodTestPhoneWaitError extends FloodError {\n constructor(args) {\n const seconds = Number(args.capture || 0);\n super(`A wait of ${seconds} seconds is required in the test servers${RPCError._fmtRequest(args.request)}`);\n // eslint-disable-next-line max-len\n this.message = `A wait of ${seconds} seconds is required in the test servers${RPCError._fmtRequest(args.request)}`;\n this.seconds = seconds;\n }\n}\n\nclass FileMigrateError extends InvalidDCError {\n constructor(args) {\n const newDc = Number(args.capture || 0);\n super(`The file to be accessed is currently stored in DC ${newDc}${RPCError._fmtRequest(args.request)}`);\n // eslint-disable-next-line max-len\n this.message = `The file to be accessed is currently stored in DC ${newDc}${RPCError._fmtRequest(args.request)}`;\n this.newDc = newDc;\n }\n}\n\nclass NetworkMigrateError extends InvalidDCError {\n constructor(args) {\n const newDc = Number(args.capture || 0);\n super(`The source IP address is associated with DC ${newDc}${RPCError._fmtRequest(args.request)}`);\n this.message = `The source IP address is associated with DC ${newDc}${RPCError._fmtRequest(args.request)}`;\n this.newDc = newDc;\n }\n}\n\nclass EmailUnconfirmedError extends BadRequestError {\n constructor(args) {\n const codeLength = Number(args.capture || 0);\n super(`Email unconfirmed, the length of the code must be ${codeLength}${RPCError._fmtRequest(args.request)}`);\n // eslint-disable-next-line max-len\n this.message = `Email unconfirmed, the length of the code must be ${codeLength}${RPCError._fmtRequest(args.request)}`;\n this.codeLength = codeLength;\n }\n}\n\nconst rpcErrorRe = [\n [/FILE_MIGRATE_(\\d+)/, FileMigrateError],\n [/FLOOD_TEST_PHONE_WAIT_(\\d+)/, FloodTestPhoneWaitError],\n [/FLOOD_WAIT_(\\d+)/, FloodWaitError],\n [/MSG_WAIT_(.*)/, MsgWaitError],\n [/PHONE_MIGRATE_(\\d+)/, PhoneMigrateError],\n [/SLOWMODE_WAIT_(\\d+)/, SlowModeWaitError],\n [/USER_MIGRATE_(\\d+)/, UserMigrateError],\n [/NETWORK_MIGRATE_(\\d+)/, NetworkMigrateError],\n [/EMAIL_UNCONFIRMED_(\\d+)/, EmailUnconfirmedError],\n\n];\nmodule.exports = {\n rpcErrorRe,\n FileMigrateError,\n FloodTestPhoneWaitError,\n FloodWaitError,\n PhoneMigrateError,\n SlowModeWaitError,\n UserMigrateError,\n NetworkMigrateError,\n MsgWaitError,\n EmailUnconfirmedError,\n};\n","/**\n * Converts a Telegram's RPC Error to a Python error.\n * @param rpcError the RPCError instance\n * @param request the request that caused this error\n * @constructor the RPCError as a Python exception that represents this error\n */\nconst { RPCError } = require('./RPCBaseErrors');\nconst { rpcErrorRe } = require('./RPCErrorList');\n\nfunction RPCMessageToError(rpcError, request) {\n for (const [msgRegex, Cls] of rpcErrorRe) {\n const m = rpcError.errorMessage.match(msgRegex);\n if (m) {\n const capture = m.length === 2 ? parseInt(m[1], 10) : undefined;\n return new Cls({\n request,\n capture,\n });\n }\n }\n\n return new RPCError(rpcError.errorMessage, request);\n}\n\nconst Common = require('./Common');\nconst RPCBaseErrors = require('./RPCBaseErrors');\nconst RPCErrorList = require('./RPCErrorList');\n\nmodule.exports = {\n RPCMessageToError,\n ...Common,\n ...RPCBaseErrors,\n ...RPCErrorList,\n};\n","const { EventBuilder } = require('./common');\n\nclass Raw extends EventBuilder {\n constructor(args = {\n types: undefined,\n func: undefined,\n }) {\n super();\n if (!args.types) {\n this.types = true;\n } else {\n this.types = args.types;\n }\n }\n\n build(update) {\n return update;\n }\n}\n\nmodule.exports = Raw;\n","class EventBuilder {\n constructor(args = {\n chats: undefined,\n blacklistChats: undefined,\n func: undefined,\n }) {\n this.chats = args.chats;\n this.blacklistChats = Boolean(args.blacklistChats);\n this.resolved = false;\n this.func = args.func;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n build(update) {\n\n }\n}\n\n\nmodule.exports = {\n EventBuilder,\n};\n","const NewMessage = require('./NewMessage');\nconst Raw = require('./Raw');\n\nclass StopPropagation extends Error {\n\n}\n\nmodule.exports = {\n NewMessage,\n StopPropagation,\n Raw,\n};\n","class AsyncQueue {\n constructor() {\n this._queue = [];\n this.canGet = new Promise((resolve) => {\n this.resolveGet = resolve;\n });\n this.canPush = true;\n }\n\n async push(value) {\n await this.canPush;\n this._queue.push(value);\n this.resolveGet(true);\n this.canPush = new Promise((resolve) => {\n this.resolvePush = resolve;\n });\n }\n\n async pop() {\n await this.canGet;\n const returned = this._queue.pop();\n this.resolvePush(true);\n this.canGet = new Promise((resolve) => {\n this.resolveGet = resolve;\n });\n return returned;\n }\n}\n\nmodule.exports = AsyncQueue;\n","const { TypeNotFoundError } = require('../errors/Common');\nconst { coreObjects } = require('../tl/core');\nconst { tlobjects } = require('../tl/AllTLObjects');\nconst { readBigIntFromBuffer } = require('../Helpers');\n\nclass BinaryReader {\n /**\n * Small utility class to read binary data.\n * @param data {Buffer}\n */\n constructor(data) {\n this.stream = data;\n this._last = undefined;\n this.offset = 0;\n }\n\n // region Reading\n\n // \"All numbers are written as little endian.\"\n // https://core.telegram.org/mtproto\n /**\n * Reads a single byte value.\n */\n readByte() {\n return this.read(1)[0];\n }\n\n /**\n * Reads an integer (4 bytes or 32 bits) value.\n * @param signed {Boolean}\n */\n readInt(signed = true) {\n let res;\n if (signed) {\n res = this.stream.readInt32LE(this.offset);\n } else {\n res = this.stream.readUInt32LE(this.offset);\n }\n this.offset += 4;\n return res;\n }\n\n /**\n * Reads a long integer (8 bytes or 64 bits) value.\n * @param signed\n * @returns {BigInteger}\n */\n readLong(signed = true) {\n return this.readLargeInt(64, signed);\n }\n\n /**\n * Reads a real floating point (4 bytes) value.\n * @returns {number}\n */\n readFloat() {\n return this.read(4)\n .readFloatLE(0);\n }\n\n /**\n * Reads a real floating point (8 bytes) value.\n * @returns {BigInteger}\n */\n readDouble() {\n // was this a bug ? it should have been 0) {\n padding = 4 - padding;\n this.read(padding);\n }\n\n return data;\n }\n\n /**\n * Reads a Telegram-encoded string.\n * @returns {string}\n */\n tgReadString() {\n return this.tgReadBytes()\n .toString('utf-8');\n }\n\n /**\n * Reads a Telegram boolean value.\n * @returns {boolean}\n */\n tgReadBool() {\n const value = this.readInt(false);\n if (value === 0x997275b5) {\n // boolTrue\n return true;\n } else if (value === 0xbc799737) {\n // boolFalse\n return false;\n } else {\n throw new Error(`Invalid boolean code ${value.toString('16')}`);\n }\n }\n\n /**\n * Reads and converts Unix time (used by Telegram)\n * into a Javascript {Date} object.\n * @returns {Date}\n */\n tgReadDate() {\n const value = this.readInt();\n return new Date(value * 1000);\n }\n\n /**\n * Reads a Telegram object.\n */\n tgReadObject() {\n const constructorId = this.readInt(false);\n let clazz = tlobjects[constructorId];\n if (clazz === undefined) {\n /**\n * The class was None, but there's still a\n * chance of it being a manually parsed value like bool!\n */\n const value = constructorId;\n if (value === 0x997275b5) {\n // boolTrue\n return true;\n } else if (value === 0xbc799737) {\n // boolFalse\n return false;\n } else if (value === 0x1cb5c415) {\n // Vector\n const temp = [];\n const length = this.readInt();\n for (let i = 0; i < length; i++) {\n temp.push(this.tgReadObject());\n }\n return temp;\n }\n\n clazz = coreObjects[constructorId];\n\n if (clazz === undefined) {\n // If there was still no luck, give up\n this.seek(-4); // Go back\n const pos = this.tellPosition();\n const error = new TypeNotFoundError(constructorId, this.read());\n this.setPosition(pos);\n throw error;\n }\n }\n return clazz.fromReader(this);\n }\n\n /**\n * Reads a vector (a list) of Telegram objects.\n * @returns {[Buffer]}\n */\n tgReadVector() {\n if (this.readInt(false) !== 0x1cb5c415) {\n throw new Error('Invalid constructor code, vector was expected');\n }\n const count = this.readInt();\n const temp = [];\n for (let i = 0; i < count; i++) {\n temp.push(this.tgReadObject());\n }\n return temp;\n }\n\n // endregion\n\n /**\n * Closes the reader.\n */\n close() {\n this.stream = undefined;\n }\n\n // region Position related\n\n /**\n * Tells the current position on the stream.\n * @returns {number}\n */\n tellPosition() {\n return this.offset;\n }\n\n /**\n * Sets the current position on the stream.\n * @param position\n */\n setPosition(position) {\n this.offset = position;\n }\n\n /**\n * Seeks the stream position given an offset from the current position.\n * The offset may be negative.\n * @param offset\n */\n seek(offset) {\n this.offset += offset;\n }\n\n // endregion\n}\n\nmodule.exports = BinaryReader;\n","class BinaryWriter {\n constructor(stream) {\n this._stream = stream;\n }\n\n write(buffer) {\n this._stream = Buffer.concat([this._stream, buffer]);\n }\n\n getValue() {\n return this._stream;\n }\n}\n\nmodule.exports = BinaryWriter;\n","let _level;\n\nclass Logger {\n static levels = ['error', 'warn', 'info', 'debug'];\n\n constructor(level) {\n if (!_level) {\n _level = level || 'debug';\n }\n\n this.isBrowser = typeof process === 'undefined'\n || process.type === 'renderer'\n || process.browser === true\n || process.__nwjs;\n if (!this.isBrowser) {\n this.colors = {\n start: '\\x1b[2m',\n warn: '\\x1b[35m',\n info: '\\x1b[33m',\n debug: '\\x1b[36m',\n error: '\\x1b[31m',\n end: '\\x1b[0m',\n };\n } else {\n this.colors = {\n start: '%c',\n warn: 'color : #ff00ff',\n info: 'color : #ffff00',\n debug: 'color : #00ffff',\n error: 'color : #ff0000',\n end: '',\n };\n }\n this.messageFormat = '[%t] [%l] - [%m]';\n }\n\n static setLevel(level) {\n _level = level;\n }\n\n /**\n *\n * @param level {string}\n * @returns {boolean}\n */\n canSend(level) {\n return (Logger.levels.indexOf(_level) >= Logger.levels.indexOf(level));\n }\n\n /**\n * @param message {string}\n */\n warn(message) {\n // todo remove later\n if (_level === 'debug') {\n // eslint-disable-next-line no-console\n console.error(new Error().stack);\n }\n this._log('warn', message, this.colors.warn);\n }\n\n /**\n * @param message {string}\n */\n info(message) {\n this._log('info', message, this.colors.info);\n }\n\n /**\n * @param message {string}\n */\n debug(message) {\n this._log('debug', message, this.colors.debug);\n }\n\n /**\n * @param message {string}\n */\n error(message) {\n // todo remove later\n if (_level === 'debug') {\n // eslint-disable-next-line no-console\n console.error(new Error().stack);\n }\n this._log('error', message, this.colors.error);\n }\n\n format(message, level) {\n return this.messageFormat.replace('%t', new Date().toISOString())\n .replace('%l', level.toUpperCase())\n .replace('%m', message);\n }\n\n /**\n * @param level {string}\n * @param message {string}\n * @param color {string}\n */\n _log(level, message, color) {\n if (!_level) {\n return;\n }\n if (this.canSend(level)) {\n if (!this.isBrowser) {\n // eslint-disable-next-line no-console\n console.log(color + this.format(message, level) + this.colors.end);\n } else {\n // eslint-disable-next-line no-console\n console.log(this.colors.start + this.format(message, level), color);\n }\n }\n }\n}\n\nmodule.exports = Logger;\n","const MessageContainer = require('../tl/core/MessageContainer');\nconst TLMessage = require('../tl/core/TLMessage');\nconst BinaryWriter = require('../extensions/BinaryWriter');\n\nconst USE_INVOKE_AFTER_WITH = [\n 'messages.SendMessage', 'messages.SendMedia', 'messages.SendMultiMedia',\n 'messages.ForwardMessages', 'messages.SendInlineBotResult',\n];\n\nclass MessagePacker {\n constructor(state, logger) {\n this._state = state;\n this._queue = [];\n this._pendingStates = [];\n this._ready = new Promise(((resolve) => {\n this.setReady = resolve;\n }));\n this._log = logger;\n }\n\n values() {\n return this._queue;\n }\n\n append(state) {\n // we need to check if there is already a request with the same name that we should send after.\n if (state && USE_INVOKE_AFTER_WITH.includes(state.request.className)) {\n // we now need to check if there is any request in queue already.\n // we loop backwards since the latest request is the most recent\n for (let i = this._queue.length - 1; i >= 0; i--) {\n if (USE_INVOKE_AFTER_WITH.includes(this._queue[i].request.className)) {\n state.after = this._queue[i];\n break;\n }\n }\n }\n\n\n this._queue.push(state);\n this.setReady(true);\n\n if (state) {\n this._pendingStates.push(state);\n state.promise\n // Using finally causes triggering `unhandledrejection` event\n .catch(() => {\n })\n .finally(() => {\n this._pendingStates = this._pendingStates.filter((s) => s !== state);\n });\n }\n }\n\n extend(states) {\n for (const state of states) {\n this._queue.push(state);\n }\n this.setReady(true);\n }\n\n async get() {\n if (!this._queue.length) {\n this._ready = new Promise(((resolve) => {\n this.setReady = resolve;\n }));\n await this._ready;\n }\n if (!this._queue[this._queue.length - 1]) {\n this._queue = [];\n return undefined;\n }\n let data;\n let buffer = new BinaryWriter(Buffer.alloc(0));\n\n const batch = [];\n let size = 0;\n\n while (this._queue.length && batch.length <= MessageContainer.MAXIMUM_LENGTH) {\n const state = this._queue.shift();\n size += state.data.length + TLMessage.SIZE_OVERHEAD;\n if (size <= MessageContainer.MAXIMUM_SIZE) {\n let afterId;\n if (state.after) {\n afterId = state.after.msgId;\n }\n state.msgId = await this._state.writeDataAsMessage(\n buffer, state.data, state.request.classType === 'request',\n afterId,\n );\n this._log.debug(`Assigned msgId = ${state.msgId} to ${state.request.className\n || state.request.constructor.name}`);\n batch.push(state);\n continue;\n }\n if (batch.length) {\n this._queue.unshift(state);\n break;\n }\n this._log.warn(`Message payload for ${state.request.className\n || state.request.constructor.name} is too long ${state.data.length} and cannot be sent`);\n state.reject('Request Payload is too big');\n size = 0;\n }\n if (!batch.length) {\n return undefined;\n }\n if (batch.length > 1) {\n const b = Buffer.alloc(8);\n b.writeUInt32LE(MessageContainer.CONSTRUCTOR_ID, 0);\n b.writeInt32LE(batch.length, 4);\n data = Buffer.concat([b, buffer.getValue()]);\n buffer = new BinaryWriter(Buffer.alloc(0));\n const containerId = await this._state.writeDataAsMessage(\n buffer, data, false,\n );\n for (const s of batch) {\n s.containerId = containerId;\n }\n }\n\n data = buffer.getValue();\n return {\n batch,\n data,\n };\n }\n\n rejectAll() {\n this._pendingStates.forEach((requestState) => {\n requestState.reject(new Error('Disconnect'));\n });\n }\n}\n\nmodule.exports = MessagePacker;\n","const { Mutex } = require('async-mutex');\n\nconst mutex = new Mutex();\n\nconst WebSocketClient = require('websocket').w3cwebsocket;\n\nconst closeError = new Error('WebSocket was closed');\n\nclass PromisedWebSockets {\n constructor(disconnectedCallback) {\n /* CONTEST\n this.isBrowser = typeof process === 'undefined' ||\n process.type === 'renderer' ||\n process.browser === true ||\n process.__nwjs\n\n */\n this.client = undefined;\n this.closed = true;\n this.disconnectedCallback = disconnectedCallback;\n }\n\n async readExactly(number) {\n let readData = Buffer.alloc(0);\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const thisTime = await this.read(number);\n readData = Buffer.concat([readData, thisTime]);\n number -= thisTime.length;\n if (!number) {\n return readData;\n }\n }\n }\n\n async read(number) {\n if (this.closed) {\n throw closeError;\n }\n await this.canRead;\n if (this.closed) {\n throw closeError;\n }\n const toReturn = this.stream.slice(0, number);\n this.stream = this.stream.slice(number);\n if (this.stream.length === 0) {\n this.canRead = new Promise((resolve) => {\n this.resolveRead = resolve;\n });\n }\n\n return toReturn;\n }\n\n async readAll() {\n if (this.closed || !await this.canRead) {\n throw closeError;\n }\n const toReturn = this.stream;\n this.stream = Buffer.alloc(0);\n this.canRead = new Promise((resolve) => {\n this.resolveRead = resolve;\n });\n\n return toReturn;\n }\n\n getWebSocketLink(ip, port) {\n if (port === 443) {\n return `wss://${ip}:${port}/apiws`;\n } else {\n return `ws://${ip}:${port}/apiws`;\n }\n }\n\n connect(port, ip) {\n this.stream = Buffer.alloc(0);\n this.canRead = new Promise((resolve) => {\n this.resolveRead = resolve;\n });\n this.closed = false;\n this.website = this.getWebSocketLink(ip, port);\n this.client = new WebSocketClient(this.website, 'binary');\n return new Promise((resolve, reject) => {\n this.client.onopen = () => {\n this.receive();\n resolve(this);\n };\n this.client.onerror = (error) => {\n // eslint-disable-next-line no-console\n console.error('WebSocket error', error);\n reject(error);\n };\n this.client.onclose = (event) => {\n const { code, reason, wasClean } = event;\n if (code !== 1000) {\n // eslint-disable-next-line no-console\n console.error(`Socket ${ip} closed. Code: ${code}, reason: ${reason}, was clean: ${wasClean}`);\n }\n\n this.resolveRead(false);\n this.closed = true;\n if (this.disconnectedCallback) {\n this.disconnectedCallback();\n }\n };\n // CONTEST\n // Seems to not be working, at least in a web worker\n // eslint-disable-next-line no-restricted-globals\n self.addEventListener('offline', async () => {\n await this.close();\n this.resolveRead(false);\n });\n });\n }\n\n write(data) {\n if (this.closed) {\n throw closeError;\n }\n this.client.send(data);\n }\n\n async close() {\n await this.client.close();\n this.closed = true;\n }\n\n receive() {\n this.client.onmessage = async (message) => {\n const release = await mutex.acquire();\n try {\n const data = message.data instanceof ArrayBuffer\n ? Buffer.from(message.data)\n : Buffer.from(await new Response(message.data).arrayBuffer());\n this.stream = Buffer.concat([this.stream, data]);\n this.resolveRead(true);\n } finally {\n release();\n }\n };\n }\n}\n\nmodule.exports = PromisedWebSockets;\n","const Logger = require('./Logger');\nconst BinaryWriter = require('./BinaryWriter');\nconst BinaryReader = require('./BinaryReader');\nconst PromisedWebSockets = require('./PromisedWebSockets');\nconst MessagePacker = require('./MessagePacker');\nconst AsyncQueue = require('./AsyncQueue');\n\nmodule.exports = {\n BinaryWriter,\n BinaryReader,\n MessagePacker,\n AsyncQueue,\n Logger,\n PromisedWebSockets,\n};\n","const Api = require('./tl/api');\nconst TelegramClient = require('./client/TelegramClient');\nconst connection = require('./network');\nconst tl = require('./tl');\nconst version = require('./Version');\nconst events = require('./events');\nconst utils = require('./Utils');\nconst errors = require('./errors');\nconst sessions = require('./sessions');\nconst extensions = require('./extensions');\nconst helpers = require('./Helpers');\n\nmodule.exports = {\n Api,\n TelegramClient,\n sessions,\n connection,\n extensions,\n tl,\n version,\n events,\n utils,\n errors,\n helpers,\n};\n","import bigInt from 'big-integer';\nimport {\n generateRandomBytes,\n modExp,\n readBigIntFromBuffer,\n readBufferFromBigInt,\n sha1,\n} from '../Helpers';\n\nconst PUBLIC_KEYS = [\n {\n fingerprint: bigInt('-3414540481677951611'),\n n: bigInt(\n '2937959817066933702298617714945612856538843112005886376816255642404751219133084745514657634448776440866'\n + '1701890505066208632169112269581063774293102577308490531282748465986139880977280302242772832972539403531'\n + '3160108704012876427630091361567343395380424193887227773571344877461690935390938502512438971889287359033'\n + '8945177273024525306296338410881284207988753897636046529094613963869149149606209957083647645485599631919'\n + '2747663615955633778034897140982517446405334423701359108810182097749467210509584293428076654573384828809'\n + '574217079944388301239431309115013843331317877374435868468779972014486325557807783825502498215169806323',\n ),\n e: 65537,\n },\n];\n\nexport const _serverKeys = new Map();\n\nPUBLIC_KEYS.forEach(({ fingerprint, ...keyInfo }) => {\n _serverKeys.set(fingerprint.toString(),\n keyInfo);\n});\n\n/**\n * Encrypts the given data known the fingerprint to be used\n * in the way Telegram requires us to do so (sha1(data) + data + padding)\n\n * @param fingerprint the fingerprint of the RSA key.\n * @param data the data to be encrypted.\n * @returns {Buffer|*|undefined} the cipher text, or undefined if no key matching this fingerprint is found.\n */\nexport async function encrypt(fingerprint: bigInt.BigInteger, data: Buffer) {\n const key = _serverKeys.get(fingerprint.toString());\n if (!key) {\n return undefined;\n }\n\n // len(sha1.digest) is always 20, so we're left with 255 - 20 - x padding\n const rand = generateRandomBytes(235 - data.length);\n\n const toEncrypt = Buffer.concat([await sha1(data), data, rand]);\n\n // rsa module rsa.encrypt adds 11 bits for padding which we don't want\n // rsa module uses rsa.transform.bytes2int(to_encrypt), easier way:\n const payload = readBigIntFromBuffer(toEncrypt, false);\n const encrypted = modExp(payload, bigInt(key.e), key.n);\n // rsa module uses transform.int2bytes(encrypted, keylength), easier:\n return readBufferFromBigInt(encrypted, 256, false);\n}\n","/**\n * Executes the authentication process with the Telegram servers.\n * @param sender a connected {MTProtoPlainSender}.\n * @param log\n * @returns {Promise<{authKey: *, timeOffset: *}>}\n */\n// eslint-disable-next-line import/no-named-default\nimport { default as Api } from '../tl/api';\nimport { SecurityError } from '../errors';\n// eslint-disable-next-line import/no-named-default\nimport { default as MTProtoPlainSender } from './MTProtoPlainSender';\nimport { _serverKeys } from '../crypto/RSA';\n\nconst bigInt = require('big-integer');\nconst IGE = require('../crypto/IGE');\nconst AuthKey = require('../crypto/AuthKey');\nconst Factorizator = require('../crypto/Factorizator');\nconst Helpers = require('../Helpers');\nconst BinaryReader = require('../extensions/BinaryReader');\n\nconst RETRIES = 20;\n\nexport async function doAuthentication(sender: MTProtoPlainSender, log: any) {\n // Step 1 sending: PQ Request, endianness doesn't matter since it's random\n let bytes = Helpers.generateRandomBytes(16);\n\n const nonce = Helpers.readBigIntFromBuffer(bytes, false, true);\n const resPQ = await sender.send(new Api.ReqPqMulti({ nonce }));\n log.debug('Starting authKey generation step 1');\n\n if (!(resPQ instanceof Api.ResPQ)) {\n throw new SecurityError(`Step 1 answer was ${resPQ}`);\n }\n if (resPQ.nonce.neq(nonce)) {\n throw new SecurityError('Step 1 invalid nonce from server');\n }\n const pq = Helpers.readBigIntFromBuffer(resPQ.pq, false, true);\n log.debug('Finished authKey generation step 1');\n // Step 2 sending: DH Exchange\n const { p, q } = Factorizator.factorize(pq);\n\n const pBuffer = Helpers.getByteArray(p);\n const qBuffer = Helpers.getByteArray(q);\n\n bytes = Helpers.generateRandomBytes(32);\n const newNonce = Helpers.readBigIntFromBuffer(bytes, true, true);\n const pqInnerData = new Api.PQInnerData({\n pq: Helpers.getByteArray(pq), // unsigned\n p: pBuffer,\n q: qBuffer,\n nonce: resPQ.nonce,\n serverNonce: resPQ.serverNonce,\n newNonce,\n }).getBytes();\n if (pqInnerData.length > 144) {\n throw new SecurityError('Step 1 invalid nonce from server');\n }\n let targetFingerprint;\n let targetKey;\n for (const fingerprint of resPQ.serverPublicKeyFingerprints) {\n targetKey = _serverKeys.get(fingerprint.toString());\n if (targetKey !== undefined) {\n targetFingerprint = fingerprint;\n break;\n }\n }\n if (targetFingerprint === undefined || targetKey === undefined) {\n throw new SecurityError(\n 'Step 2 could not find a valid key for fingerprints',\n );\n }\n // Value should be padded to be made 192 exactly\n const padding = Helpers.generateRandomBytes(192 - pqInnerData.length);\n const dataWithPadding = Buffer.concat([pqInnerData, padding]);\n const dataPadReversed = Buffer.from(dataWithPadding).reverse();\n\n let encryptedData;\n for (let i = 0; i < RETRIES; i++) {\n const tempKey = Helpers.generateRandomBytes(32);\n const shaDigestKeyWithData = await Helpers.sha256(Buffer.concat([tempKey, dataWithPadding]));\n const dataWithHash = Buffer.concat([dataPadReversed, shaDigestKeyWithData]);\n\n const ige = new IGE(tempKey, Buffer.alloc(32));\n const aesEncrypted = ige.encryptIge(dataWithHash);\n const tempKeyXor = Helpers.bufferXor(tempKey, await Helpers.sha256(aesEncrypted));\n\n const keyAesEncrypted = Buffer.concat([tempKeyXor, aesEncrypted]);\n const keyAesEncryptedInt = Helpers.readBigIntFromBuffer(keyAesEncrypted, false, false);\n if (keyAesEncryptedInt.greaterOrEquals(targetKey.n)) {\n log.debug('Aes key greater than RSA. retrying');\n continue;\n }\n const encryptedDataBuffer = Helpers.modExp(keyAesEncryptedInt, bigInt(targetKey.e), targetKey.n);\n encryptedData = Helpers.readBufferFromBigInt(encryptedDataBuffer, 256, false, false);\n\n break;\n }\n if (encryptedData === undefined) {\n throw new SecurityError(\n 'Step 2 could create a secure encrypted key',\n );\n }\n log.debug('Step 2 : Generated a secure aes encrypted data');\n\n const serverDhParams = await sender.send(\n new Api.ReqDHParams({\n nonce: resPQ.nonce,\n serverNonce: resPQ.serverNonce,\n p: pBuffer,\n q: qBuffer,\n publicKeyFingerprint: targetFingerprint,\n encryptedData,\n }),\n );\n\n if (\n !(\n serverDhParams instanceof Api.ServerDHParamsOk\n || serverDhParams instanceof Api.ServerDHParamsFail\n )\n ) {\n throw new Error(`Step 2.1 answer was ${serverDhParams}`);\n }\n if (serverDhParams.nonce.neq(resPQ.nonce)) {\n throw new SecurityError('Step 2 invalid nonce from server');\n }\n\n if (serverDhParams.serverNonce.neq(resPQ.serverNonce)) {\n throw new SecurityError('Step 2 invalid server nonce from server');\n }\n\n if (serverDhParams instanceof Api.ServerDHParamsFail) {\n const sh = await Helpers.sha1(\n Helpers.toSignedLittleBuffer(newNonce, 32).slice(4, 20),\n );\n const nnh = Helpers.readBigIntFromBuffer(sh, true, true);\n if (serverDhParams.newNonceHash.neq(nnh)) {\n throw new SecurityError('Step 2 invalid DH fail nonce from server');\n }\n }\n if (!(serverDhParams instanceof Api.ServerDHParamsOk)) {\n throw new Error(`Step 2.2 answer was ${serverDhParams}`);\n }\n log.debug('Finished authKey generation step 2');\n log.debug('Starting authKey generation step 3');\n\n // Step 3 sending: Complete DH Exchange\n const { key, iv } = await Helpers.generateKeyDataFromNonce(\n resPQ.serverNonce,\n newNonce,\n );\n if (serverDhParams.encryptedAnswer.length % 16 !== 0) {\n // See PR#453\n throw new SecurityError('Step 3 AES block size mismatch');\n }\n const ige = new IGE(key, iv);\n const plainTextAnswer = ige.decryptIge(serverDhParams.encryptedAnswer);\n const reader = new BinaryReader(plainTextAnswer);\n reader.read(20); // hash sum\n const serverDhInner = reader.tgReadObject();\n if (!(serverDhInner instanceof Api.ServerDHInnerData)) {\n throw new Error(`Step 3 answer was ${serverDhInner}`);\n }\n\n if (serverDhInner.nonce.neq(resPQ.nonce)) {\n throw new SecurityError('Step 3 Invalid nonce in encrypted answer');\n }\n if (serverDhInner.serverNonce.neq(resPQ.serverNonce)) {\n throw new SecurityError(\n 'Step 3 Invalid server nonce in encrypted answer',\n );\n }\n const dhPrime = Helpers.readBigIntFromBuffer(\n serverDhInner.dhPrime,\n false,\n false,\n );\n const ga = Helpers.readBigIntFromBuffer(serverDhInner.gA, false, false);\n const timeOffset = serverDhInner.serverTime - Math.floor(new Date().getTime() / 1000);\n const b = Helpers.readBigIntFromBuffer(\n Helpers.generateRandomBytes(256),\n false,\n false,\n );\n const gb = Helpers.modExp(bigInt(serverDhInner.g), b, dhPrime);\n const gab = Helpers.modExp(ga, b, dhPrime);\n\n // Prepare client DH Inner Data\n const clientDhInner = new Api.ClientDHInnerData({\n nonce: resPQ.nonce,\n serverNonce: resPQ.serverNonce,\n retryId: bigInt.zero, // TODO Actual retry ID\n gB: Helpers.getByteArray(gb, false),\n }).getBytes();\n\n const clientDdhInnerHashed = Buffer.concat([\n await Helpers.sha1(clientDhInner),\n clientDhInner,\n ]);\n // Encryption\n\n const clientDhEncrypted = ige.encryptIge(clientDdhInnerHashed);\n const dhGen = await sender.send(\n new Api.SetClientDHParams({\n nonce: resPQ.nonce,\n serverNonce: resPQ.serverNonce,\n encryptedData: clientDhEncrypted,\n }),\n );\n const nonceTypes = [Api.DhGenOk, Api.DhGenRetry, Api.DhGenFail];\n // TS being weird again.\n const nonceTypesString = ['DhGenOk', 'DhGenRetry', 'DhGenFail'];\n if (\n !(\n dhGen instanceof nonceTypes[0]\n || dhGen instanceof nonceTypes[1]\n || dhGen instanceof nonceTypes[2]\n )\n ) {\n throw new Error(`Step 3.1 answer was ${dhGen}`);\n }\n const { name } = dhGen.constructor;\n if (dhGen.nonce.neq(resPQ.nonce)) {\n throw new SecurityError(`Step 3 invalid ${name} nonce from server`);\n }\n if (dhGen.serverNonce.neq(resPQ.serverNonce)) {\n throw new SecurityError(\n `Step 3 invalid ${name} server nonce from server`,\n );\n }\n const authKey = new AuthKey();\n await authKey.setKey(Helpers.getByteArray(gab));\n\n const nonceNumber = 1 + nonceTypesString.indexOf(dhGen.className);\n\n const newNonceHash = await authKey.calcNewNonceHash(newNonce, nonceNumber);\n // @ts-ignore\n const dhHash = dhGen[`newNonceHash${nonceNumber}`];\n\n if (dhHash.neq(newNonceHash)) {\n throw new SecurityError('Step 3 invalid new nonce hash');\n }\n\n if (!(dhGen instanceof Api.DhGenOk)) {\n throw new Error(`Step 3.2 answer was ${dhGen}`);\n }\n log.debug('Finished authKey generation step 3');\n\n return { authKey, timeOffset };\n}\n","/**\n * This module contains the class used to communicate with Telegram's servers\n * in plain text, when no authorization key has been created yet.\n */\nconst BigInt = require('big-integer');\nconst MTProtoState = require('./MTProtoState');\nconst BinaryReader = require('../extensions/BinaryReader');\nconst { InvalidBufferError } = require('../errors/Common');\nconst { toSignedLittleBuffer } = require('../Helpers');\n\n/**\n * MTProto Mobile Protocol plain sender (https://core.telegram.org/mtproto/description#unencrypted-messages)\n */\n\nclass MTProtoPlainSender {\n /**\n * Initializes the MTProto plain sender.\n * @param connection connection: the Connection to be used.\n * @param loggers\n */\n constructor(connection, loggers) {\n this._state = new MTProtoState(connection, loggers);\n this._connection = connection;\n }\n\n /**\n * Sends and receives the result for the given request.\n * @param request\n */\n async send(request) {\n let body = request.getBytes();\n let msgId = this._state._getNewMsgId();\n const m = toSignedLittleBuffer(msgId, 8);\n const b = Buffer.alloc(4);\n b.writeInt32LE(body.length, 0);\n\n const res = Buffer.concat([Buffer.concat([Buffer.alloc(8), m, b]), body]);\n\n await this._connection.send(res);\n body = await this._connection.recv();\n if (body.length < 8) {\n throw new InvalidBufferError(body);\n }\n const reader = new BinaryReader(body);\n const authKeyId = reader.readLong();\n if (authKeyId.neq(BigInt(0))) {\n throw new Error('Bad authKeyId');\n }\n msgId = reader.readLong();\n if (msgId.eq(BigInt(0))) {\n throw new Error('Bad msgId');\n }\n /** ^ We should make sure that the read ``msg_id`` is greater\n * than our own ``msg_id``. However, under some circumstances\n * (bad system clock/working behind proxies) this seems to not\n * be the case, which would cause endless assertion errors.\n */\n\n const length = reader.readInt();\n if (length <= 0) {\n throw new Error('Bad length');\n }\n /**\n * We could read length bytes and use those in a new reader to read\n * the next TLObject without including the padding, but since the\n * reader isn't used for anything else after this, it's unnecessary.\n */\n return reader.tgReadObject();\n }\n}\n\nmodule.exports = MTProtoPlainSender;\n","const MtProtoPlainSender = require('./MTProtoPlainSender');\nconst MTProtoState = require('./MTProtoState');\nconst Helpers = require('../Helpers');\nconst AuthKey = require('../crypto/AuthKey');\nconst { doAuthentication } = require('./Authenticator');\nconst RPCResult = require('../tl/core/RPCResult');\nconst MessageContainer = require('../tl/core/MessageContainer');\nconst GZIPPacked = require('../tl/core/GZIPPacked');\nconst RequestState = require('./RequestState');\n\nconst {\n MsgsAck,\n upload,\n MsgsStateInfo,\n Pong,\n} = require('../tl').constructors;\nconst MessagePacker = require('../extensions/MessagePacker');\nconst BinaryReader = require('../extensions/BinaryReader');\nconst { UpdateConnectionState, UpdateServerTimeOffset } = require('./index');\nconst { BadMessageError } = require('../errors/Common');\nconst {\n BadServerSalt,\n BadMsgNotification,\n MsgDetailedInfo,\n MsgNewDetailedInfo,\n NewSessionCreated,\n FutureSalts,\n MsgsStateReq,\n MsgResendReq,\n MsgsAllInfo,\n} = require('../tl').constructors;\nconst { SecurityError } = require('../errors/Common');\nconst { InvalidBufferError } = require('../errors/Common');\nconst { LogOut } = require('../tl').requests.auth;\nconst { RPCMessageToError } = require('../errors');\nconst { TypeNotFoundError } = require('../errors/Common');\n\n\n/**\n * MTProto Mobile Protocol sender\n * (https://core.telegram.org/mtproto/description)\n * This class is responsible for wrapping requests into `TLMessage`'s,\n * sending them over the network and receiving them in a safe manner.\n *\n * Automatic reconnection due to temporary network issues is a concern\n * for this class as well, including retry of messages that could not\n * be sent successfully.\n *\n * A new authorization key will be generated on connection if no other\n * key exists yet.\n */\nclass MTProtoSender {\n static DEFAULT_OPTIONS = {\n logger: undefined,\n retries: Infinity,\n delay: 2000,\n autoReconnect: true,\n connectTimeout: undefined,\n authKeyCallback: undefined,\n updateCallback: undefined,\n autoReconnectCallback: undefined,\n isMainSender: undefined,\n onConnectionBreak: undefined,\n };\n\n /**\n * @param authKey\n * @param opts\n */\n constructor(authKey, opts) {\n const args = { ...MTProtoSender.DEFAULT_OPTIONS, ...opts };\n this._connection = undefined;\n this._log = args.logger;\n this._dcId = args.dcId;\n this._retries = args.retries;\n this._delay = args.delay;\n this._autoReconnect = args.autoReconnect;\n this._connectTimeout = args.connectTimeout;\n this._authKeyCallback = args.authKeyCallback;\n this._updateCallback = args.updateCallback;\n this._autoReconnectCallback = args.autoReconnectCallback;\n this._isMainSender = args.isMainSender;\n this._onConnectionBreak = args.onConnectionBreak;\n\n\n /**\n * whether we disconnected ourself or telegram did it.\n */\n this.userDisconnected = false;\n\n /**\n * Whether the user has explicitly connected or disconnected.\n *\n * If a disconnection happens for any other reason and it\n * was *not* user action then the pending messages won't\n * be cleared but on explicit user disconnection all the\n * pending futures should be cancelled.\n */\n this._user_connected = false;\n this._reconnecting = false;\n this._disconnected = true;\n\n /**\n * We need to join the loops upon disconnection\n */\n this._send_loop_handle = undefined;\n this._recv_loop_handle = undefined;\n\n /**\n * Preserving the references of the AuthKey and state is important\n */\n this.authKey = authKey || new AuthKey();\n this._state = new MTProtoState(this.authKey, this._log);\n\n /**\n * Outgoing messages are put in a queue and sent in a batch.\n * Note that here we're also storing their ``_RequestState``.\n */\n this._send_queue = new MessagePacker(this._state, this._log);\n\n /**\n * Sent states are remembered until a response is received.\n */\n this._pending_state = {};\n\n /**\n * Responses must be acknowledged, and we can also batch these.\n */\n this._pending_ack = new Set();\n\n /**\n * Similar to pending_messages but only for the last acknowledges.\n * These can't go in pending_messages because no acknowledge for them\n * is received, but we may still need to resend their state on bad salts.\n */\n this._last_acks = [];\n\n /**\n * Jump table from response ID to method that handles it\n */\n\n this._handlers = {\n [RPCResult.CONSTRUCTOR_ID]: this._handleRPCResult.bind(this),\n [MessageContainer.CONSTRUCTOR_ID]: this._handleContainer.bind(this),\n [GZIPPacked.CONSTRUCTOR_ID]: this._handleGzipPacked.bind(this),\n [Pong.CONSTRUCTOR_ID]: this._handlePong.bind(this),\n [BadServerSalt.CONSTRUCTOR_ID]: this._handleBadServerSalt.bind(this),\n [BadMsgNotification.CONSTRUCTOR_ID]: this._handleBadNotification.bind(this),\n [MsgDetailedInfo.CONSTRUCTOR_ID]: this._handleDetailedInfo.bind(this),\n [MsgNewDetailedInfo.CONSTRUCTOR_ID]: this._handleNewDetailedInfo.bind(this),\n [NewSessionCreated.CONSTRUCTOR_ID]: this._handleNewSessionCreated.bind(this),\n [MsgsAck.CONSTRUCTOR_ID]: this._handleAck.bind(this),\n [FutureSalts.CONSTRUCTOR_ID]: this._handleFutureSalts.bind(this),\n [MsgsStateReq.CONSTRUCTOR_ID]: this._handleStateForgotten.bind(this),\n [MsgResendReq.CONSTRUCTOR_ID]: this._handleStateForgotten.bind(this),\n [MsgsAllInfo.CONSTRUCTOR_ID]: this._handleMsgAll.bind(this),\n };\n }\n\n // Public API\n\n /**\n * Connects to the specified given connection using the given auth key.\n * @param connection\n * @param [force]\n * @returns {Promise}\n */\n async connect(connection, force) {\n if (this._user_connected && !force) {\n this._log.info('User is already connected!');\n return false;\n }\n this.isConnecting = true;\n this._connection = connection;\n\n for (let attempt = 0; attempt < this._retries; attempt++) {\n try {\n await this._connect();\n if (this._updateCallback) {\n this._updateCallback(new UpdateConnectionState(UpdateConnectionState.connected));\n }\n break;\n } catch (err) {\n if (this._updateCallback && attempt === 0) {\n this._updateCallback(new UpdateConnectionState(UpdateConnectionState.disconnected));\n }\n this._log.error(`WebSocket connection failed attempt: ${attempt + 1}`);\n // eslint-disable-next-line no-console\n console.error(err);\n await Helpers.sleep(this._delay);\n }\n }\n this.isConnecting = false;\n return true;\n }\n\n isConnected() {\n return this._user_connected;\n }\n\n /**\n * Cleanly disconnects the instance from the network, cancels\n * all pending requests, and closes the send and receive loops.\n */\n async disconnect() {\n this.userDisconnected = true;\n await this._disconnect();\n }\n\n /**\n *\n This method enqueues the given request to be sent. Its send\n state will be saved until a response arrives, and a ``Future``\n that will be resolved when the response arrives will be returned:\n\n .. code-block:: javascript\n\n async def method():\n # Sending (enqueued for the send loop)\n future = sender.send(request)\n # Receiving (waits for the receive loop to read the result)\n result = await future\n\n Designed like this because Telegram may send the response at\n any point, and it can send other items while one waits for it.\n Once the response for this future arrives, it is set with the\n received result, quite similar to how a ``receive()`` call\n would otherwise work.\n\n Since the receiving part is \"built in\" the future, it's\n impossible to await receive a result that was never sent.\n * @param request\n * @returns {RequestState}\n */\n send(request) {\n if (!this._user_connected) {\n throw new Error('Cannot send requests while disconnected');\n }\n const state = new RequestState(request);\n this._send_queue.append(state);\n return state.promise;\n }\n\n /**\n * Same as send but returns the full state. usefull for invoke after logic\n * @param request\n * @return {RequestState}\n */\n sendWithInvokeSupport(request) {\n if (!this._user_connected) {\n throw new Error('Cannot send requests while disconnected');\n }\n const state = new RequestState(request, undefined, this._pending_state);\n this._send_queue.append(state);\n return state;\n }\n\n /**\n * Performs the actual connection, retrying, generating the\n * authorization key if necessary, and starting the send and\n * receive loops.\n * @returns {Promise}\n * @private\n */\n async _connect() {\n this._log.info('Connecting to {0}...'.replace('{0}', this._connection));\n await this._connection.connect();\n this._log.debug('Connection success!');\n // process.exit(0)\n if (!this.authKey.getKey()) {\n const plain = new MtProtoPlainSender(this._connection, this._log);\n this._log.debug('New auth_key attempt ...');\n const res = await doAuthentication(plain, this._log);\n this._log.debug('Generated new auth_key successfully');\n await this.authKey.setKey(res.authKey);\n\n this._state.timeOffset = res.timeOffset;\n\n if (this._updateCallback) {\n this._updateCallback(new UpdateServerTimeOffset(this._state.timeOffset));\n }\n\n /**\n * This is *EXTREMELY* important since we don't control\n * external references to the authorization key, we must\n * notify whenever we change it. This is crucial when we\n * switch to different data centers.\n */\n if (this._authKeyCallback) {\n await this._authKeyCallback(this.authKey, this._dcId);\n }\n } else {\n this._authenticated = true;\n this._log.debug('Already have an auth key ...');\n }\n this._user_connected = true;\n this._reconnecting = false;\n\n this._log.debug('Starting send loop');\n this._send_loop_handle = this._sendLoop();\n\n this._log.debug('Starting receive loop');\n this._recv_loop_handle = this._recvLoop();\n\n // _disconnected only completes after manual disconnection\n // or errors after which the sender cannot continue such\n // as failing to reconnect or any unexpected error.\n\n this._log.info('Connection to %s complete!'.replace('%s', this._connection.toString()));\n }\n\n async _disconnect() {\n this._send_queue.rejectAll();\n\n if (this._connection === undefined) {\n this._log.info('Not disconnecting (already have no connection)');\n return;\n }\n if (this._updateCallback) {\n this._updateCallback(new UpdateConnectionState(UpdateConnectionState.disconnected));\n }\n this._log.info('Disconnecting from %s...'.replace('%s', this._connection.toString()));\n this._user_connected = false;\n this._log.debug('Closing current connection...');\n await this._connection.disconnect();\n }\n\n /**\n * This loop is responsible for popping items off the send\n * queue, encrypting them, and sending them over the network.\n * Besides `connect`, only this method ever sends data.\n * @returns {Promise}\n * @private\n */\n async _sendLoop() {\n this._send_queue = new MessagePacker(this._state, this._log);\n\n while (this._user_connected && !this._reconnecting) {\n if (this._pending_ack.size) {\n const ack = new RequestState(new MsgsAck({ msgIds: Array(...this._pending_ack) }));\n this._send_queue.append(ack);\n this._last_acks.push(ack);\n this._pending_ack.clear();\n }\n this._log.debug(`Waiting for messages to send...${this._reconnecting}`);\n // TODO Wait for the connection send queue to be empty?\n // This means that while it's not empty we can wait for\n // more messages to be added to the send queue.\n const res = await this._send_queue.get();\n\n if (this._reconnecting) {\n return;\n }\n\n if (!res) {\n continue;\n }\n let { data } = res;\n const { batch } = res;\n this._log.debug(`Encrypting ${batch.length} message(s) in ${data.length} bytes for sending`);\n\n data = await this._state.encryptMessageData(data);\n\n try {\n await this._connection.send(data);\n } catch (e) {\n this._log.error(e);\n this._log.info('Connection closed while sending data');\n return;\n }\n for (const state of batch) {\n if (!Array.isArray(state)) {\n if (state.request.classType === 'request') {\n this._pending_state[state.msgId] = state;\n }\n } else {\n for (const s of state) {\n if (s.request.classType === 'request') {\n this._pending_state[s.msgId] = s;\n }\n }\n }\n }\n this._log.debug('Encrypted messages put in a queue to be sent');\n }\n }\n\n async _recvLoop() {\n let body;\n let message;\n\n while (this._user_connected && !this._reconnecting) {\n // this._log.debug('Receiving items from the network...');\n this._log.debug('Receiving items from the network...');\n try {\n body = await this._connection.recv();\n } catch (e) {\n // this._log.info('Connection closed while receiving data');\n /** when the server disconnects us we want to reconnect */\n if (!this.userDisconnected) {\n this._log.error(e);\n this._log.warn('Connection closed while receiving data');\n this.reconnect();\n }\n return;\n }\n try {\n message = await this._state.decryptMessageData(body);\n } catch (e) {\n if (e instanceof TypeNotFoundError) {\n // Received object which we don't know how to deserialize\n this._log.info(`Type ${e.invalidConstructorId} not found, remaining data ${e.remaining}`);\n continue;\n } else if (e instanceof SecurityError) {\n // A step while decoding had the incorrect data. This message\n // should not be considered safe and it should be ignored.\n this._log.warn(`Security error while unpacking a received message: ${e}`);\n continue;\n } else if (e instanceof InvalidBufferError) {\n // 404 means that the server has \"forgotten\" our auth key and we need to create a new one.\n if (e.code === 404) {\n this._log.warn(`Broken authorization key for dc ${this._dcId}; resetting`);\n if (this._updateCallback && this._isMainSender) {\n this._updateCallback(new UpdateConnectionState(UpdateConnectionState.broken));\n } else if (this._onConnectionBreak && !this._isMainSender) {\n // Deletes the current sender from the object\n this._onConnectionBreak(this._dcId);\n }\n } else {\n // this happens sometimes when telegram is having some internal issues.\n // reconnecting should be enough usually\n // since the data we sent and received is probably wrong now.\n this._log.warn(`Invalid buffer ${e.code} for dc ${this._dcId}`);\n this.reconnect();\n }\n return;\n } else {\n this._log.error('Unhandled error while receiving data');\n this._log.error(e);\n this.reconnect();\n return;\n }\n }\n try {\n await this._processMessage(message);\n } catch (e) {\n this._log.error('Unhandled error while receiving data');\n this._log.error(e);\n }\n }\n }\n\n // Response Handlers\n\n /**\n * Adds the given message to the list of messages that must be\n * acknowledged and dispatches control to different ``_handle_*``\n * method based on its type.\n * @param message\n * @returns {Promise}\n * @private\n */\n async _processMessage(message) {\n this._pending_ack.add(message.msgId);\n // eslint-disable-next-line require-atomic-updates\n message.obj = await message.obj;\n let handler = this._handlers[message.obj.CONSTRUCTOR_ID];\n if (!handler) {\n handler = this._handleUpdate.bind(this);\n }\n\n await handler(message);\n }\n\n /**\n * Pops the states known to match the given ID from pending messages.\n * This method should be used when the response isn't specific.\n * @param msgId\n * @returns {*[]}\n * @private\n */\n _popStates(msgId) {\n let state = this._pending_state[msgId];\n if (state) {\n this._pending_state[msgId].deferred.resolve();\n delete this._pending_state[msgId];\n return [state];\n }\n\n const toPop = [];\n\n for (state of Object.values(this._pending_state)) {\n if (state.containerId && state.containerId.equals(msgId)) {\n toPop.push(state.msgId);\n }\n }\n\n if (toPop.length) {\n const temp = [];\n for (const x of toPop) {\n temp.push(this._pending_state[x]);\n this._pending_state[x].deferred.resolve();\n delete this._pending_state[x];\n }\n return temp;\n }\n\n for (const ack of this._last_acks) {\n if (ack.msgId === msgId) {\n return [ack];\n }\n }\n\n return [];\n }\n\n /**\n * Handles the result for Remote Procedure Calls:\n * rpc_result#f35c6d01 req_msg_id:long result:bytes = RpcResult;\n * This is where the future results for sent requests are set.\n * @param message\n * @returns {Promise}\n * @private\n */\n _handleRPCResult(message) {\n const result = message.obj;\n const state = this._pending_state[result.reqMsgId];\n if (state) {\n state.deferred.resolve();\n delete this._pending_state[result.reqMsgId];\n }\n this._log.debug(`Handling RPC result for message ${result.reqMsgId}`);\n\n if (!state) {\n // TODO We should not get responses to things we never sent\n // However receiving a File() with empty bytes is \"common\".\n // See #658, #759 and #958. They seem to happen in a container\n // which contain the real response right after.\n try {\n const reader = new BinaryReader(result.body);\n if (!(reader.tgReadObject() instanceof upload.File)) {\n throw new TypeNotFoundError('Not an upload.File');\n }\n } catch (e) {\n this._log.error(e);\n if (e instanceof TypeNotFoundError) {\n this._log.info(`Received response without parent request: ${result.body}`);\n return;\n } else {\n throw e;\n }\n }\n }\n if (result.error) {\n // eslint-disable-next-line new-cap\n const error = RPCMessageToError(result.error, state.request);\n this._send_queue.append(new RequestState(new MsgsAck({ msgIds: [state.msgId] })));\n state.reject(error);\n } else {\n const reader = new BinaryReader(result.body);\n const read = state.request.readResult(reader);\n state.resolve(read);\n }\n }\n\n /**\n * Processes the inner messages of a container with many of them:\n * msg_container#73f1f8dc messages:vector<%Message> = MessageContainer;\n * @param message\n * @returns {Promise}\n * @private\n */\n async _handleContainer(message) {\n this._log.debug('Handling container');\n for (const innerMessage of message.obj.messages) {\n await this._processMessage(innerMessage);\n }\n }\n\n /**\n * Unpacks the data from a gzipped object and processes it:\n * gzip_packed#3072cfa1 packed_data:bytes = Object;\n * @param message\n * @returns {Promise}\n * @private\n */\n async _handleGzipPacked(message) {\n this._log.debug('Handling gzipped data');\n const reader = new BinaryReader(message.obj.data);\n message.obj = reader.tgReadObject();\n await this._processMessage(message);\n }\n\n _handleUpdate(message) {\n if (message.obj.SUBCLASS_OF_ID !== 0x8af52aac) {\n // crc32(b'Updates')\n this._log.warn(`Note: ${message.obj.className} is not an update, not dispatching it`);\n return;\n }\n this._log.debug(`Handling update ${message.obj.className}`);\n if (this._updateCallback) {\n this._updateCallback(message.obj);\n }\n }\n\n /**\n * Handles pong results, which don't come inside a ``RPCResult``\n * but are still sent through a request:\n * pong#347773c5 msg_id:long ping_id:long = Pong;\n * @param message\n * @returns {Promise}\n * @private\n */\n _handlePong(message) {\n const pong = message.obj;\n\n const newTimeOffset = this._state.updateTimeOffset(message.msgId);\n if (this._updateCallback) {\n this._updateCallback(new UpdateServerTimeOffset(newTimeOffset));\n }\n\n this._log.debug(`Handling pong for message ${pong.msgId}`);\n const state = this._pending_state[pong.msgId];\n this._pending_state[pong.msgId].deferred.resolve();\n delete this._pending_state[pong.msgId];\n\n // Todo Check result\n if (state) {\n state.resolve(pong);\n }\n }\n\n /**\n * Corrects the currently used server salt to use the right value\n * before enqueuing the rejected message to be re-sent:\n * bad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int\n * error_code:int new_server_salt:long = BadMsgNotification;\n * @param message\n * @returns {Promise}\n * @private\n */\n _handleBadServerSalt(message) {\n const badSalt = message.obj;\n this._log.debug(`Handling bad salt for message ${badSalt.badMsgId}`);\n this._state.salt = badSalt.newServerSalt;\n const states = this._popStates(badSalt.badMsgId);\n this._send_queue.extend(states);\n this._log.debug(`${states.length} message(s) will be resent`);\n }\n\n /**\n * Adjusts the current state to be correct based on the\n * received bad message notification whenever possible:\n * bad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int\n * error_code:int = BadMsgNotification;\n * @param message\n * @returns {Promise}\n * @private\n */\n _handleBadNotification(message) {\n const badMsg = message.obj;\n const states = this._popStates(badMsg.badMsgId);\n this._log.debug(`Handling bad msg ${JSON.stringify(badMsg)}`);\n if ([16, 17].includes(badMsg.errorCode)) {\n // Sent msg_id too low or too high (respectively).\n // Use the current msg_id to determine the right time offset.\n const newTimeOffset = this._state.updateTimeOffset(message.msgId);\n\n if (this._updateCallback) {\n this._updateCallback(new UpdateServerTimeOffset(newTimeOffset));\n }\n\n this._log.info(`System clock is wrong, set time offset to ${newTimeOffset}s`);\n } else if (badMsg.errorCode === 32) {\n // msg_seqno too low, so just pump it up by some \"large\" amount\n // TODO A better fix would be to start with a new fresh session ID\n this._state._sequence += 64;\n } else if (badMsg.errorCode === 33) {\n // msg_seqno too high never seems to happen but just in case\n this._state._sequence -= 16;\n } else {\n for (const state of states) {\n state.reject(new BadMessageError(state.request, badMsg.errorCode));\n }\n\n return;\n }\n // Messages are to be re-sent once we've corrected the issue\n this._send_queue.extend(states);\n this._log.debug(`${states.length} messages will be resent due to bad msg`);\n }\n\n /**\n * Updates the current status with the received detailed information:\n * msg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long\n * bytes:int status:int = MsgDetailedInfo;\n * @param message\n * @returns {Promise}\n * @private\n */\n _handleDetailedInfo(message) {\n // TODO https://goo.gl/VvpCC6\n const msgId = message.obj.answerMsgId;\n this._log.debug(`Handling detailed info for message ${msgId}`);\n this._pending_ack.add(msgId);\n }\n\n /**\n * Updates the current status with the received detailed information:\n * msg_new_detailed_info#809db6df answer_msg_id:long\n * bytes:int status:int = MsgDetailedInfo;\n * @param message\n * @returns {Promise}\n * @private\n */\n _handleNewDetailedInfo(message) {\n // TODO https://goo.gl/VvpCC6\n const msgId = message.obj.answerMsgId;\n this._log.debug(`Handling new detailed info for message ${msgId}`);\n this._pending_ack.add(msgId);\n }\n\n /**\n * Updates the current status with the received session information:\n * new_session_created#9ec20908 first_msg_id:long unique_id:long\n * server_salt:long = NewSession;\n * @param message\n * @returns {Promise}\n * @private\n */\n _handleNewSessionCreated(message) {\n // TODO https://goo.gl/LMyN7A\n this._log.debug('Handling new session created');\n this._state.salt = message.obj.serverSalt;\n }\n\n /**\n * Handles a server acknowledge about our messages. Normally\n * these can be ignored except in the case of ``auth.logOut``:\n *\n * auth.logOut#5717da40 = Bool;\n *\n * Telegram doesn't seem to send its result so we need to confirm\n * it manually. No other request is known to have this behaviour.\n\n * Since the ID of sent messages consisting of a container is\n * never returned (unless on a bad notification), this method\n * also removes containers messages when any of their inner\n * messages are acknowledged.\n\n * @param message\n * @returns {Promise}\n * @private\n */\n _handleAck(message) {\n const ack = message.obj;\n this._log.debug(`Handling acknowledge for ${ack.msgIds}`);\n for (const msgId of ack.msgIds) {\n const state = this._pending_state[msgId];\n if (state && state.request instanceof LogOut) {\n this._pending_state[msgId].deferred.resolve();\n delete this._pending_state[msgId];\n state.resolve(true);\n }\n }\n }\n\n /**\n * Handles future salt results, which don't come inside a\n * ``rpc_result`` but are still sent through a request:\n * future_salts#ae500895 req_msg_id:long now:int\n * salts:vector = FutureSalts;\n * @param message\n * @returns {Promise}\n * @private\n */\n _handleFutureSalts(message) {\n // TODO save these salts and automatically adjust to the\n // correct one whenever the salt in use expires.\n this._log.debug(`Handling future salts for message ${message.msgId}`);\n const state = this._pending_state[message.msgId];\n\n if (state) {\n this._pending_state[message].deferred.resolve();\n delete this._pending_state[message];\n state.resolve(message.obj);\n }\n }\n\n /**\n * Handles both :tl:`MsgsStateReq` and :tl:`MsgResendReq` by\n * enqueuing a :tl:`MsgsStateInfo` to be sent at a later point.\n * @param message\n * @returns {Promise}\n * @private\n */\n _handleStateForgotten(message) {\n this._send_queue.append(\n new RequestState(new MsgsStateInfo(message.msgId, String.fromCharCode(1)\n .repeat(message.obj.msgIds))),\n );\n }\n\n /**\n * Handles :tl:`MsgsAllInfo` by doing nothing (yet).\n * used as part of the telegram protocol https://core.telegram.org/mtproto/service_messages_about_messages\n * This message does not require an acknowledgment.\n * @param message\n * @returns {Promise}\n * @private\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _handleMsgAll(message) {\n }\n\n reconnect() {\n if (this._user_connected && !this._reconnecting) {\n this._reconnecting = true;\n // TODO Should we set this?\n // this._user_connected = false\n // we want to wait a second between each reconnect try to not flood the server with reconnects\n // in case of internal server issues.\n Helpers.sleep(1000).then(() => {\n this._log.info('Started reconnecting');\n this._reconnect();\n });\n }\n }\n\n async _reconnect() {\n this._log.debug('Closing current connection...');\n try {\n await this._disconnect();\n } catch (err) {\n this._log.warn(err);\n }\n\n this._send_queue.append(undefined);\n this._state.reset();\n\n // For some reason reusing existing connection caused stuck requests\n const newConnection = new this._connection.constructor(\n this._connection._ip,\n this._connection._port,\n this._connection._dcId,\n this._connection._log,\n );\n await this.connect(newConnection, true);\n\n this._reconnecting = false;\n // uncomment this if you want to resend\n // this._send_queue.extend(Object.values(this._pending_state))\n for (const state of Object.values(this._pending_state)) {\n state.deferred.resolve();\n }\n this._pending_state = {};\n if (this._autoReconnectCallback) {\n await this._autoReconnectCallback();\n }\n }\n}\n\nmodule.exports = MTProtoSender;\n","const BigInt = require('big-integer');\n\nconst Helpers = require('../Helpers');\nconst IGE = require('../crypto/IGE');\nconst BinaryReader = require('../extensions/BinaryReader');\nconst GZIPPacked = require('../tl/core/GZIPPacked');\nconst { TLMessage } = require('../tl/core');\nconst {\n SecurityError,\n InvalidBufferError,\n} = require('../errors/Common');\nconst { InvokeAfterMsg } = require('../tl').requests;\nconst {\n toSignedLittleBuffer,\n} = require('../Helpers');\n\nclass MTProtoState {\n /**\n *\n `telethon.network.mtprotosender.MTProtoSender` needs to hold a state\n in order to be able to encrypt and decrypt incoming/outgoing messages,\n as well as generating the message IDs. Instances of this class hold\n together all the required information.\n\n It doesn't make sense to use `telethon.sessions.abstract.Session` for\n the sender because the sender should *not* be concerned about storing\n this information to disk, as one may create as many senders as they\n desire to any other data center, or some CDN. Using the same session\n for all these is not a good idea as each need their own authkey, and\n the concept of \"copying\" sessions with the unnecessary entities or\n updates state for these connections doesn't make sense.\n\n While it would be possible to have a `MTProtoPlainState` that does no\n encryption so that it was usable through the `MTProtoLayer` and thus\n avoid the need for a `MTProtoPlainSender`, the `MTProtoLayer` is more\n focused to efficiency and this state is also more advanced (since it\n supports gzipping and invoking after other message IDs). There are too\n many methods that would be needed to make it convenient to use for the\n authentication process, at which point the `MTProtoPlainSender` is better\n * @param authKey\n * @param loggers\n */\n constructor(authKey, loggers) {\n this.authKey = authKey;\n this._log = loggers;\n this.timeOffset = 0;\n this.salt = 0;\n\n this.id = undefined;\n this._sequence = undefined;\n this._lastMsgId = undefined;\n this.reset();\n }\n\n /**\n * Resets the state\n */\n reset() {\n // Session IDs can be random on every connection\n this.id = Helpers.generateRandomLong(true);\n this._sequence = 0;\n this._lastMsgId = BigInt(0);\n }\n\n /**\n * Updates the message ID to a new one,\n * used when the time offset changed.\n * @param message\n */\n updateMessageId(message) {\n message.msgId = this._getNewMsgId();\n }\n\n /**\n * Calculate the key based on Telegram guidelines, specifying whether it's the client or not\n * @param authKey\n * @param msgKey\n * @param client\n * @returns {{iv: Buffer, key: Buffer}}\n */\n async _calcKey(authKey, msgKey, client) {\n const x = client === true ? 0 : 8;\n const [sha256a, sha256b] = await Promise.all([\n Helpers.sha256(Buffer.concat([msgKey, authKey.slice(x, x + 36)])),\n Helpers.sha256(Buffer.concat([authKey.slice(x + 40, x + 76), msgKey])),\n ]);\n const key = Buffer.concat([sha256a.slice(0, 8), sha256b.slice(8, 24), sha256a.slice(24, 32)]);\n const iv = Buffer.concat([sha256b.slice(0, 8), sha256a.slice(8, 24), sha256b.slice(24, 32)]);\n return {\n key,\n iv,\n };\n }\n\n /**\n * Writes a message containing the given data into buffer.\n * Returns the message id.\n * @param buffer\n * @param data\n * @param contentRelated\n * @param afterId\n */\n async writeDataAsMessage(buffer, data, contentRelated, afterId) {\n const msgId = this._getNewMsgId();\n const seqNo = this._getSeqNo(contentRelated);\n let body;\n if (!afterId) {\n body = await GZIPPacked.gzipIfSmaller(contentRelated, data);\n } else {\n // Invoke query expects a query with a getBytes func\n body = await GZIPPacked.gzipIfSmaller(contentRelated, new InvokeAfterMsg(afterId, {\n getBytes() {\n return data;\n },\n }).getBytes());\n }\n const s = Buffer.alloc(4);\n s.writeInt32LE(seqNo, 0);\n const b = Buffer.alloc(4);\n b.writeInt32LE(body.length, 0);\n const m = toSignedLittleBuffer(msgId, 8);\n buffer.write(Buffer.concat([m, s, b]));\n buffer.write(body);\n return msgId;\n }\n\n /**\n * Encrypts the given message data using the current authorization key\n * following MTProto 2.0 guidelines core.telegram.org/mtproto/description.\n * @param data\n */\n async encryptMessageData(data) {\n await this.authKey.waitForKey();\n const s = toSignedLittleBuffer(this.salt, 8);\n const i = toSignedLittleBuffer(this.id, 8);\n data = Buffer.concat([Buffer.concat([s, i]), data]);\n const padding = Helpers.generateRandomBytes(Helpers.mod(-(data.length + 12), 16) + 12);\n // Being substr(what, offset, length); x = 0 for client\n // \"msg_key_large = SHA256(substr(auth_key, 88+x, 32) + pt + padding)\"\n const msgKeyLarge = await Helpers.sha256(Buffer.concat([this.authKey.getKey()\n .slice(88, 88 + 32), data, padding]));\n // \"msg_key = substr (msg_key_large, 8, 16)\"\n const msgKey = msgKeyLarge.slice(8, 24);\n\n const {\n iv,\n key,\n } = await this._calcKey(this.authKey.getKey(), msgKey, true);\n\n const keyId = Helpers.readBufferFromBigInt(this.authKey.keyId, 8);\n return Buffer.concat([keyId, msgKey, new IGE(key, iv).encryptIge(Buffer.concat([data, padding]))]);\n }\n\n /**\n * Inverse of `encrypt_message_data` for incoming server messages.\n * @param body\n */\n async decryptMessageData(body) {\n if (body.length < 8) {\n throw new InvalidBufferError(body);\n }\n if (body.length < 0) { // length needs to be positive\n throw new SecurityError('Server replied with negative length');\n }\n if (body.length % 4 !== 0) {\n throw new SecurityError('Server replied with length not divisible by 4');\n }\n // TODO Check salt,sessionId, and sequenceNumber\n const keyId = Helpers.readBigIntFromBuffer(body.slice(0, 8));\n if (keyId.neq(this.authKey.keyId)) {\n throw new SecurityError('Server replied with an invalid auth key');\n }\n\n const msgKey = body.slice(8, 24);\n const {\n iv,\n key,\n } = await this._calcKey(this.authKey.getKey(), msgKey, false);\n body = new IGE(key, iv).decryptIge(body.slice(24));\n\n // https://core.telegram.org/mtproto/security_guidelines\n // Sections \"checking sha256 hash\" and \"message length\"\n\n const ourKey = await Helpers.sha256(Buffer.concat([this.authKey.getKey()\n .slice(96, 96 + 32), body]));\n\n if (!msgKey.equals(ourKey.slice(8, 24))) {\n throw new SecurityError('Received msg_key doesn\\'t match with expected one');\n }\n\n const reader = new BinaryReader(body);\n reader.readLong(); // removeSalt\n const serverId = reader.readLong();\n if (!serverId.eq(this.id)) {\n throw new SecurityError('Server replied with a wrong session ID');\n }\n\n const remoteMsgId = reader.readLong();\n const remoteSequence = reader.readInt();\n const containerLen = reader.readInt(); // msgLen for the inner object, padding ignored\n const diff = body.length - containerLen;\n // We want to check if it's between 12 and 1024\n // https://core.telegram.org/mtproto/security_guidelines#checking-message-length\n if (diff < 12 || diff > 1024) {\n throw new SecurityError('Server replied with the wrong message padding');\n }\n\n // We could read msg_len bytes and use those in a new reader to read\n // the next TLObject without including the padding, but since the\n // reader isn't used for anything else after this, it's unnecessary.\n const obj = reader.tgReadObject();\n\n return new TLMessage(remoteMsgId, remoteSequence, obj);\n }\n\n /**\n * Generates a new unique message ID based on the current\n * time (in ms) since epoch, applying a known time offset.\n * @private\n */\n _getNewMsgId() {\n const now = new Date().getTime() / 1000 + this.timeOffset;\n const nanoseconds = Math.floor((now - Math.floor(now)) * 1e9);\n let newMsgId = (BigInt(Math.floor(now))\n .shiftLeft(BigInt(32))).or(BigInt(nanoseconds)\n .shiftLeft(BigInt(2)));\n if (this._lastMsgId.greaterOrEquals(newMsgId)) {\n newMsgId = this._lastMsgId.add(BigInt(4));\n }\n this._lastMsgId = newMsgId;\n return newMsgId;\n }\n\n /**\n * Updates the time offset to the correct\n * one given a known valid message ID.\n * @param correctMsgId {BigInteger}\n */\n updateTimeOffset(correctMsgId) {\n const bad = this._getNewMsgId();\n const old = this.timeOffset;\n const now = Math.floor(new Date().getTime() / 1000);\n const correct = correctMsgId.shiftRight(BigInt(32));\n this.timeOffset = correct - now;\n\n if (this.timeOffset !== old) {\n this._lastMsgId = BigInt(0);\n this._log.debug(\n `Updated time offset (old offset ${old}, bad ${bad}, good ${correctMsgId}, new ${this.timeOffset})`,\n );\n }\n\n return this.timeOffset;\n }\n\n /**\n * Generates the next sequence number depending on whether\n * it should be for a content-related query or not.\n * @param contentRelated\n * @private\n */\n _getSeqNo(contentRelated) {\n if (contentRelated) {\n const result = this._sequence * 2 + 1;\n this._sequence += 1;\n return result;\n } else {\n return this._sequence * 2;\n }\n }\n}\n\nmodule.exports = MTProtoState;\n","const { createDeferred } = require('../Helpers');\n\nclass RequestState {\n constructor(request, after = undefined, pending = {}) {\n this.containerId = undefined;\n this.msgId = undefined;\n this.request = request;\n this.data = request.getBytes();\n this.after = after;\n this.result = undefined;\n this.pending = pending;\n this.deferred = createDeferred();\n this.promise = new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }\n\n isReady() {\n const state = this.pending[this.after.id];\n if (!state) {\n return true;\n }\n return state.deferred.promise;\n }\n}\n\nmodule.exports = RequestState;\n","const PromisedWebSockets = require('../../extensions/PromisedWebSockets');\nconst AsyncQueue = require('../../extensions/AsyncQueue');\n\n/**\n * The `Connection` class is a wrapper around ``asyncio.open_connection``.\n *\n * Subclasses will implement different transport modes as atomic operations,\n * which this class eases doing since the exposed interface simply puts and\n * gets complete data payloads to and from queues.\n *\n * The only error that will raise from send and receive methods is\n * ``ConnectionError``, which will raise when attempting to send if\n * the client is disconnected (includes remote disconnections).\n */\nclass Connection {\n PacketCodecClass = undefined;\n\n constructor(ip, port, dcId, loggers) {\n this._ip = ip;\n this._port = port;\n this._dcId = dcId;\n this._log = loggers;\n this._connected = false;\n this._sendTask = undefined;\n this._recvTask = undefined;\n this._codec = undefined;\n this._obfuscation = undefined; // TcpObfuscated and MTProxy\n this._sendArray = new AsyncQueue();\n this._recvArray = new AsyncQueue();\n // this.socket = new PromiseSocket(new Socket())\n\n this.socket = new PromisedWebSockets(this.disconnectCallback.bind(this));\n }\n\n async disconnectCallback() {\n await this.disconnect(true);\n }\n\n async _connect() {\n this._log.debug('Connecting');\n this._codec = new this.PacketCodecClass(this);\n await this.socket.connect(this._port, this._ip, this);\n this._log.debug('Finished connecting');\n // await this.socket.connect({host: this._ip, port: this._port});\n await this._initConn();\n }\n\n async connect() {\n await this._connect();\n this._connected = true;\n\n if (!this._sendTask) {\n this._sendTask = this._sendLoop();\n }\n this._recvTask = this._recvLoop();\n }\n\n async disconnect(fromCallback = false) {\n if (!this._connected) {\n return;\n }\n\n this._connected = false;\n void this._recvArray.push(undefined);\n if (!fromCallback) {\n await this.socket.close();\n }\n }\n\n async send(data) {\n if (!this._connected) {\n throw new Error('Not connected');\n }\n await this._sendArray.push(data);\n }\n\n async recv() {\n while (this._connected) {\n const result = await this._recvArray.pop();\n // null = sentinel value = keep trying\n if (result) {\n return result;\n }\n }\n throw new Error('Not connected');\n }\n\n async _sendLoop() {\n // TODO handle errors\n try {\n while (this._connected) {\n const data = await this._sendArray.pop();\n if (!data) {\n this._sendTask = undefined;\n return;\n }\n await this._send(data);\n }\n } catch (e) {\n this._log.info('The server closed the connection while sending');\n }\n }\n\n async _recvLoop() {\n let data;\n while (this._connected) {\n try {\n data = await this._recv();\n if (!data) {\n throw new Error('no data received');\n }\n } catch (e) {\n this._log.info('connection closed');\n // await this._recvArray.push()\n\n this.disconnect();\n return;\n }\n await this._recvArray.push(data);\n }\n }\n\n async _initConn() {\n if (this._codec.tag) {\n await this.socket.write(this._codec.tag);\n }\n }\n\n _send(data) {\n const encodedPacket = this._codec.encodePacket(data);\n this.socket.write(encodedPacket);\n }\n\n _recv() {\n return this._codec.readPacket(this.socket);\n }\n\n toString() {\n return `${this._ip}:${this._port}/${this.constructor.name.replace('Connection', '')}`;\n }\n}\n\nclass ObfuscatedConnection extends Connection {\n ObfuscatedIO = undefined;\n\n _initConn() {\n this._obfuscation = new this.ObfuscatedIO(this);\n this.socket.write(this._obfuscation.header);\n }\n\n _send(data) {\n this._obfuscation.write(this._codec.encodePacket(data));\n }\n\n\n _recv() {\n return this._codec.readPacket(this._obfuscation);\n }\n}\n\nclass PacketCodec {\n constructor(connection) {\n this._conn = connection;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n encodePacket(data) {\n throw new Error('Not Implemented');\n\n // Override\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n readPacket(reader) {\n // override\n throw new Error('Not Implemented');\n }\n}\n\nmodule.exports = {\n Connection,\n PacketCodec,\n ObfuscatedConnection,\n};\n","const BigInt = require('big-integer');\nconst { readBufferFromBigInt } = require('../../Helpers');\nconst {\n Connection,\n PacketCodec,\n} = require('./Connection');\n\nclass AbridgedPacketCodec extends PacketCodec {\n static tag = Buffer.from('ef', 'hex');\n\n static obfuscateTag = Buffer.from('efefefef', 'hex');\n\n constructor(props) {\n super(props);\n this.tag = AbridgedPacketCodec.tag;\n this.obfuscateTag = AbridgedPacketCodec.obfuscateTag;\n }\n\n encodePacket(data) {\n let length = data.length >> 2;\n if (length < 127) {\n const b = Buffer.alloc(1);\n b.writeUInt8(length, 0);\n length = b;\n } else {\n length = Buffer.concat([Buffer.from('7f', 'hex'), readBufferFromBigInt(BigInt(length), 3)]);\n }\n return Buffer.concat([length, data]);\n }\n\n async readPacket(reader) {\n const readData = await reader.read(1);\n let length = readData[0];\n if (length >= 127) {\n length = Buffer.concat([await reader.read(3), Buffer.alloc(1)])\n .readInt32LE(0);\n }\n\n return reader.read(length << 2);\n }\n}\n\n/**\n * This is the mode with the lowest overhead, as it will\n * only require 1 byte if the packet length is less than\n * 508 bytes (127 << 2, which is very common).\n */\nclass ConnectionTCPAbridged extends Connection {\n PacketCodecClass = AbridgedPacketCodec;\n}\n\nmodule.exports = {\n ConnectionTCPAbridged,\n AbridgedPacketCodec,\n};\n","const { generateRandomBytes } = require('../../Helpers');\nconst { ObfuscatedConnection } = require('./Connection');\nconst { AbridgedPacketCodec } = require('./TCPAbridged');\nconst CTR = require('../../crypto/CTR');\n\nclass ObfuscatedIO {\n header = undefined;\n\n constructor(connection) {\n this.connection = connection.socket;\n const res = this.initHeader(connection.PacketCodecClass);\n this.header = res.random;\n\n this._encrypt = res.encryptor;\n this._decrypt = res.decryptor;\n }\n\n initHeader(packetCodec) {\n // Obfuscated messages secrets cannot start with any of these\n const keywords = [Buffer.from('50567247', 'hex'), Buffer.from('474554', 'hex'),\n Buffer.from('504f5354', 'hex'), Buffer.from('eeeeeeee', 'hex')];\n let random;\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n random = generateRandomBytes(64);\n if (random[0] !== 0xef && !(random.slice(4, 8)\n .equals(Buffer.alloc(4)))) {\n let ok = true;\n for (const key of keywords) {\n if (key.equals(random.slice(0, 4))) {\n ok = false;\n break;\n }\n }\n if (ok) {\n break;\n }\n }\n }\n random = random.toJSON().data;\n\n const randomReversed = Buffer.from(random.slice(8, 56))\n .reverse();\n // Encryption has \"continuous buffer\" enabled\n const encryptKey = Buffer.from(random.slice(8, 40));\n const encryptIv = Buffer.from(random.slice(40, 56));\n const decryptKey = Buffer.from(randomReversed.slice(0, 32));\n const decryptIv = Buffer.from(randomReversed.slice(32, 48));\n const encryptor = new CTR(encryptKey, encryptIv);\n const decryptor = new CTR(decryptKey, decryptIv);\n\n random = Buffer.concat([\n Buffer.from(random.slice(0, 56)), packetCodec.obfuscateTag, Buffer.from(random.slice(60)),\n ]);\n random = Buffer.concat([\n Buffer.from(random.slice(0, 56)), Buffer.from(encryptor.encrypt(random)\n .slice(56, 64)), Buffer.from(random.slice(64)),\n ]);\n return {\n random,\n encryptor,\n decryptor,\n };\n }\n\n async read(n) {\n const data = await this.connection.readExactly(n);\n return this._decrypt.encrypt(data);\n }\n\n write(data) {\n this.connection.write(this._encrypt.encrypt(data));\n }\n}\n\nclass ConnectionTCPObfuscated extends ObfuscatedConnection {\n ObfuscatedIO = ObfuscatedIO;\n\n PacketCodecClass = AbridgedPacketCodec;\n}\n\nmodule.exports = {\n ConnectionTCPObfuscated,\n};\n","const { Connection } = require('./Connection');\nconst { ConnectionTCPFull } = require('./TCPFull');\nconst { ConnectionTCPAbridged } = require('./TCPAbridged');\nconst { ConnectionTCPObfuscated } = require('./TCPObfuscated');\n\nmodule.exports = {\n Connection,\n ConnectionTCPFull,\n ConnectionTCPAbridged,\n ConnectionTCPObfuscated,\n};\n","const MTProtoPlainSender = require('./MTProtoPlainSender');\nconst MTProtoSender = require('./MTProtoSender');\n\nclass UpdateConnectionState {\n static disconnected = -1;\n\n static connected = 1;\n\n static broken = 0;\n\n constructor(state) {\n this.state = state;\n }\n}\n\nclass UpdateServerTimeOffset {\n constructor(timeOffset) {\n this.timeOffset = timeOffset;\n }\n}\n\nconst {\n Connection,\n ConnectionTCPFull,\n ConnectionTCPAbridged,\n ConnectionTCPObfuscated,\n} = require('./connection');\n\nmodule.exports = {\n Connection,\n ConnectionTCPFull,\n ConnectionTCPAbridged,\n ConnectionTCPObfuscated,\n MTProtoPlainSender,\n MTProtoSender,\n UpdateConnectionState,\n UpdateServerTimeOffset,\n};\n","class Session {\n /**\n * Creates a clone of this session file\n * @param toInstance {Session|null}\n * @returns {Session}\n */\n\n /* CONTEST\n clone(toInstance = null) {\n return toInstance || new this.constructor()\n } */\n\n /**\n * Returns the currently-used data center ID.\n */\n get dcId() {\n throw new Error('Not Implemented');\n }\n\n /**\n * Returns the server address where the library should connect to.\n */\n get serverAddress() {\n throw new Error('Not Implemented');\n }\n\n /**\n * Returns the port to which the library should connect to.\n */\n get port() {\n throw new Error('Not Implemented');\n }\n\n /**\n * Returns an ``AuthKey`` instance associated with the saved\n * data center, or `None` if a new one should be generated.\n */\n get authKey() {\n throw new Error('Not Implemented');\n }\n\n /**\n * Sets the ``AuthKey`` to be used for the saved data center.\n * @param value\n */\n set authKey(value) {\n throw new Error('Not Implemented');\n }\n\n /**\n * Sets the information of the data center address and port that\n * the library should connect to, as well as the data center ID,\n * which is currently unused.\n * @param dcId {number}\n * @param serverAddress {string}\n * @param port {number}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setDC(dcId, serverAddress, port) {\n throw new Error('Not implemented');\n }\n\n /**\n * Returns an ID of the takeout process initialized for this session,\n * or `None` if there's no were any unfinished takeout requests.\n */\n /* CONTEST\n get takeoutId() {\n throw new Error('Not Implemented')\n }\n */\n /**\n * Sets the ID of the unfinished takeout process for this session.\n * @param value\n */\n /* CONTEST\n set takeoutId(value) {\n throw new Error('Not Implemented')\n }\n */\n /**\n * Returns the ``UpdateState`` associated with the given `entity_id`.\n * If the `entity_id` is 0, it should return the ``UpdateState`` for\n * no specific channel (the \"general\" state). If no state is known\n * it should ``return None``.\n * @param entityId\n */\n /* CONTEST\n getUpdateState(entityId) {\n throw new Error('Not Implemented')\n }\n\n */\n\n /**\n * Sets the given ``UpdateState`` for the specified `entity_id`, which\n * should be 0 if the ``UpdateState`` is the \"general\" state (and not\n * for any specific channel).\n * @param entityId\n * @param state\n */\n /* CONTEST\n setUpdateState(entityId, state) {\n throw new Error('Not Implemented')\n }\n\n */\n\n /**\n * Called on client disconnection. Should be used to\n * free any used resources. Can be left empty if none.\n */\n\n /* CONTEST\n close() {\n\n }\n\n */\n\n /**\n * called whenever important properties change. It should\n * make persist the relevant session information to disk.\n */\n save() {\n throw new Error('Not Implemented');\n }\n\n /**\n * Called upon client.log_out(). Should delete the stored\n * information from disk since it's not valid anymore.\n */\n\n delete() {\n throw new Error('Not Implemented');\n }\n\n /**\n * Lists available sessions. Not used by the library itself.\n */\n /* CONTEST\n listSessions() {\n throw new Error('Not Implemented')\n }\n\n */\n\n /**\n * Processes the input ``TLObject`` or ``list`` and saves\n * whatever information is relevant (e.g., ID or access hash).\n * @param tlo\n */\n /* CONTEST\n processEntities(tlo) {\n throw new Error('Not Implemented')\n }\n\n */\n\n /**\n * Turns the given key into an ``InputPeer`` (e.g. ``InputPeerUser``).\n * The library uses this method whenever an ``InputPeer`` is needed\n * to suit several purposes (e.g. user only provided its ID or wishes\n * to use a cached username to avoid extra RPC).\n */\n /* CONTEST\n getInputEntity(key) {\n throw new Error('Not Implemented')\n }\n\n */\n}\n\nmodule.exports = Session;\n","/* eslint-disable no-restricted-globals */\nconst StorageSession = require('./StorageSession');\n\nconst CACHE_NAME = 'GramJs';\n\nclass CacheApiSession extends StorageSession {\n async _delete() {\n const request = new Request(this._storageKey);\n const cache = await self.caches.open(CACHE_NAME);\n return cache.delete(request);\n }\n\n async _fetchFromCache() {\n const request = new Request(this._storageKey);\n const cache = await self.caches.open(CACHE_NAME);\n const cached = await cache.match(request);\n return cached ? cached.text() : undefined;\n }\n\n async _saveToCache(data) {\n const request = new Request(this._storageKey);\n const response = new Response(data);\n const cache = await self.caches.open(CACHE_NAME);\n return cache.put(request, response);\n }\n}\n\nmodule.exports = CacheApiSession;\n","const MemorySession = require('./Memory');\nconst AuthKey = require('../crypto/AuthKey');\nconst utils = require('../Utils');\n\nclass CallbackSession extends MemorySession {\n constructor(sessionData, callback) {\n super();\n\n this._sessionData = sessionData;\n this._callback = callback;\n\n this._authKeys = {};\n }\n\n get authKey() {\n throw new Error('Not supported');\n }\n\n set authKey(value) {\n throw new Error('Not supported');\n }\n\n async load() {\n if (!this._sessionData) {\n return;\n }\n\n const {\n mainDcId,\n keys,\n hashes,\n } = this._sessionData;\n const {\n ipAddress,\n port,\n } = utils.getDC(mainDcId);\n\n this.setDC(mainDcId, ipAddress, port, true);\n\n await Promise.all(Object.keys(keys)\n .map(async (dcId) => {\n const key = typeof keys[dcId] === 'string'\n ? Buffer.from(keys[dcId], 'hex')\n : Buffer.from(keys[dcId]);\n\n if (hashes[dcId]) {\n const hash = typeof hashes[dcId] === 'string'\n ? Buffer.from(hashes[dcId], 'hex')\n : Buffer.from(hashes[dcId]);\n\n this._authKeys[dcId] = new AuthKey(key, hash);\n } else {\n this._authKeys[dcId] = new AuthKey();\n await this._authKeys[dcId].setKey(key, true);\n }\n }));\n }\n\n setDC(dcId, serverAddress, port, skipOnUpdate = false) {\n this._dcId = dcId;\n this._serverAddress = serverAddress;\n this._port = port;\n\n delete this._authKeys[dcId];\n\n if (!skipOnUpdate) {\n void this._onUpdate();\n }\n }\n\n getAuthKey(dcId = this._dcId) {\n return this._authKeys[dcId];\n }\n\n setAuthKey(authKey, dcId = this._dcId) {\n this._authKeys[dcId] = authKey;\n\n void this._onUpdate();\n }\n\n getSessionData() {\n const sessionData = {\n mainDcId: this._dcId,\n keys: {},\n hashes: {},\n };\n\n Object\n .keys(this._authKeys)\n .forEach((dcId) => {\n const authKey = this._authKeys[dcId];\n if (!authKey || !authKey._key) return;\n\n sessionData.keys[dcId] = authKey._key.toString('hex');\n sessionData.hashes[dcId] = authKey._hash.toString('hex');\n });\n\n return sessionData;\n }\n\n _onUpdate() {\n this._callback(this.getSessionData());\n }\n\n delete() {\n this._callback(undefined);\n }\n}\n\nmodule.exports = CallbackSession;\n","const idb = require('idb-keyval');\nconst StorageSession = require('./StorageSession');\n\nconst CACHE_NAME = 'GramJs';\n\nclass IdbSession extends StorageSession {\n _delete() {\n return idb.del(`${CACHE_NAME}:${this._storageKey}`);\n }\n\n _fetchFromCache() {\n return idb.get(`${CACHE_NAME}:${this._storageKey}`);\n }\n\n _saveToCache(data) {\n return idb.set(`${CACHE_NAME}:${this._storageKey}`, data);\n }\n}\n\nmodule.exports = IdbSession;\n","const StorageSession = require('./StorageSession');\n\nclass LocalStorageSession extends StorageSession {\n _delete() {\n return localStorage.removeItem(this._storageKey);\n }\n\n _fetchFromCache() {\n return localStorage.getItem(this._storageKey);\n }\n\n _saveToCache(data) {\n return localStorage.setItem(this._storageKey, data);\n }\n}\n\nmodule.exports = LocalStorageSession;\n","const Session = require('./Abstract');\n\nclass MemorySession extends Session {\n constructor() {\n super();\n\n this._serverAddress = undefined;\n this._dcId = 0;\n this._port = undefined;\n this._takeoutId = undefined;\n\n this._entities = new Set();\n this._updateStates = {};\n }\n\n get dcId() {\n return this._dcId;\n }\n\n get serverAddress() {\n return this._serverAddress;\n }\n\n get port() {\n return this._port;\n }\n\n get authKey() {\n return this._authKey;\n }\n\n set authKey(value) {\n this._authKey = value;\n }\n\n setDC(dcId, serverAddress, port) {\n this._dcId = dcId | 0;\n this._serverAddress = serverAddress;\n this._port = port;\n }\n\n /* CONTEST\n get takeoutId() {\n return this._takeoutId\n }\n\n set takeoutId(value) {\n this._takeoutId = value\n }\n\n\n getUpdateState(entityId) {\n return this._updateStates[entityId]\n }\n\n setUpdateState(entityId, state) {\n return this._updateStates[entityId] = state\n }\n\n close() {\n }\n\n save() {\n }\n\n async load() {\n\n }\n\n delete() {\n }\n\n _entityValuesToRow(id, hash, username, phone, name) {\n // While this is a simple implementation it might be overrode by,\n // other classes so they don't need to implement the plural form\n // of the method. Don't remove.\n return [id, hash, username, phone, name]\n }\n\n _entityToRow(e) {\n if (!(e.classType === \"constructor\")) {\n return\n }\n let p\n let markedId\n try {\n p = utils.getInputPeer(e, false)\n markedId = utils.getPeerId(p)\n } catch (e) {\n // Note: `get_input_peer` already checks for non-zero `accessHash`.\n // See issues #354 and #392. It also checks that the entity\n // is not `min`, because its `accessHash` cannot be used\n // anywhere (since layer 102, there are two access hashes).\n return\n }\n let pHash\n if (p instanceof types.InputPeerUser || p instanceof types.InputPeerChannel) {\n pHash = p.accessHash\n } else if (p instanceof types.InputPeerChat) {\n pHash = 0\n } else {\n return\n }\n\n let username = e.username\n if (username) {\n username = username.toLowerCase()\n }\n const phone = e.phone\n const name = utils.getDisplayName(e)\n return this._entityValuesToRow(markedId, pHash, username, phone, name)\n }\n\n _entitiesToRows(tlo) {\n let entities = []\n if (tlo.classType === \"constructor\" && utils.isListLike(tlo)) {\n // This may be a list of users already for instance\n entities = tlo\n } else {\n if (tlo instanceof Object) {\n if ('user' in tlo) {\n entities.push(tlo.user)\n }\n if ('chats' in tlo && utils.isListLike(tlo.chats)) {\n entities.concat(tlo.chats)\n }\n if ('users' in tlo && utils.isListLike(tlo.users)) {\n entities.concat(tlo.users)\n }\n }\n }\n const rows = [] // Rows to add (id, hash, username, phone, name)\n for (const e of entities) {\n const row = this._entityToRow(e)\n if (row) {\n rows.push(row)\n }\n }\n return rows\n }\n\n processEntities(tlo) {\n const entitiesSet = this._entitiesToRows(tlo)\n for (const e of entitiesSet) {\n this._entities.add(e)\n }\n }\n\n getEntityRowsByPhone(phone) {\n for (const e of this._entities) { // id, hash, username, phone, name\n if (e[3] === phone) {\n return [e[0], e[1]]\n }\n }\n }\n\n getEntityRowsByUsername(username) {\n for (const e of this._entities) { // id, hash, username, phone, name\n if (e[2] === username) {\n return [e[0], e[1]]\n }\n }\n }\n\n getEntityRowsByName(name) {\n for (const e of this._entities) { // id, hash, username, phone, name\n if (e[4] === name) {\n return [e[0], e[1]]\n }\n }\n }\n\n getEntityRowsById(id, exact = true) {\n if (exact) {\n for (const e of this._entities) { // id, hash, username, phone, name\n if (e[0] === id) {\n return [e[0], e[1]]\n }\n }\n } else {\n const ids = [utils.getPeerId(new types.PeerUser({ userId: id })),\n utils.getPeerId(new types.PeerChat({ chatId: id })),\n utils.getPeerId(new types.PeerChannel({ channelId: id })),\n ]\n for (const e of this._entities) { // id, hash, username, phone, name\n if (ids.includes(e[0])) {\n return [e[0], e[1]]\n }\n }\n }\n }\n\n getInputEntity(key) {\n let exact\n if (key.SUBCLASS_OF_ID !== undefined) {\n if ([0xc91c90b6, 0xe669bf46, 0x40f202fd].includes(key.SUBCLASS_OF_ID)) {\n // hex(crc32(b'InputPeer', b'InputUser' and b'InputChannel'))\n // We already have an Input version, so nothing else required\n return key\n }\n // Try to early return if this key can be casted as input peer\n return utils.getInputPeer(key)\n } else {\n // Not a TLObject or can't be cast into InputPeer\n if (key.classType === 'constructor') {\n key = utils.getPeerId(key)\n exact = true\n } else {\n exact = !(typeof key == 'number') || key < 0\n }\n }\n let result = null\n if (typeof key === 'string') {\n const phone = utils.parsePhone(key)\n if (phone) {\n result = this.getEntityRowsByPhone(phone)\n } else {\n const { username, isInvite } = utils.parseUsername(key)\n if (username && !isInvite) {\n result = this.getEntityRowsByUsername(username)\n } else {\n const tup = utils.resolveInviteLink(key)[1]\n if (tup) {\n result = this.getEntityRowsById(tup, false)\n }\n }\n }\n } else if (typeof key === 'number') {\n result = this.getEntityRowsById(key, exact)\n }\n if (!result && typeof key === 'string') {\n result = this.getEntityRowsByName(key)\n }\n\n if (result) {\n let entityId = result[0] // unpack resulting tuple\n const entityHash = result[1]\n const resolved = utils.resolveId(entityId)\n entityId = resolved[0]\n const kind = resolved[1]\n // removes the mark and returns type of entity\n if (kind === types.PeerUser) {\n return new types.InputPeerUser({ userId: entityId, accessHash: entityHash })\n } else if (kind === types.PeerChat) {\n return new types.InputPeerChat({ chatId: entityId })\n } else if (kind === types.PeerChannel) {\n return new types.InputPeerChannel({ channelId: entityId, accessHash: entityHash })\n }\n } else {\n throw new Error('Could not find input entity with key ' + key)\n }\n } */\n}\n\nmodule.exports = MemorySession;\n","const MemorySession = require('./Memory');\nconst AuthKey = require('../crypto/AuthKey');\nconst utils = require('../Utils');\n\nconst STORAGE_KEY_BASE = 'GramJs-session-';\nconst SESSION_DATA_PREFIX = 'session:';\n\nclass StorageSession extends MemorySession {\n constructor(sessionInfo) {\n super();\n\n this._authKeys = {};\n\n if (sessionInfo && sessionInfo.startsWith(SESSION_DATA_PREFIX)) {\n this._sessionString = sessionInfo;\n } else if (sessionInfo) {\n this._storageKey = sessionInfo;\n }\n }\n\n get authKey() {\n throw new Error('Not supported');\n }\n\n set authKey(value) {\n throw new Error('Not supported');\n }\n\n async load() {\n if (this._sessionString) {\n await this._loadFromSessionString();\n return;\n }\n\n if (!this._storageKey) {\n return;\n }\n\n try {\n const json = await this._fetchFromCache();\n const {\n mainDcId,\n keys,\n hashes,\n } = JSON.parse(json);\n const {\n ipAddress,\n port,\n } = utils.getDC(mainDcId);\n\n this.setDC(mainDcId, ipAddress, port, true);\n\n Object.keys(keys)\n .forEach((dcId) => {\n if (keys[dcId] && hashes[dcId]) {\n this._authKeys[dcId] = new AuthKey(\n Buffer.from(keys[dcId].data),\n Buffer.from(hashes[dcId].data),\n );\n }\n });\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn('Failed to retrieve or parse session from storage');\n // eslint-disable-next-line no-console\n console.warn(err);\n }\n }\n\n setDC(dcId, serverAddress, port, skipUpdateStorage = false) {\n this._dcId = dcId;\n this._serverAddress = serverAddress;\n this._port = port;\n\n delete this._authKeys[dcId];\n\n if (!skipUpdateStorage) {\n void this._updateStorage();\n }\n }\n\n async save() {\n if (!this._storageKey) {\n this._storageKey = generateStorageKey();\n }\n\n await this._updateStorage();\n\n return this._storageKey;\n }\n\n getAuthKey(dcId = this._dcId) {\n return this._authKeys[dcId];\n }\n\n setAuthKey(authKey, dcId = this._dcId) {\n this._authKeys[dcId] = authKey;\n\n void this._updateStorage();\n }\n\n getSessionData(asHex) {\n const sessionData = {\n mainDcId: this._dcId,\n keys: {},\n hashes: {},\n };\n\n Object\n .keys(this._authKeys)\n .forEach((dcId) => {\n const authKey = this._authKeys[dcId];\n if (!authKey._key) return;\n\n sessionData.keys[dcId] = asHex ? authKey._key.toString('hex') : authKey._key;\n sessionData.hashes[dcId] = asHex ? authKey._hash.toString('hex') : authKey._hash;\n });\n\n return sessionData;\n }\n\n async _loadFromSessionString() {\n const [, mainDcIdStr, mainDcKey] = this._sessionString.split(':');\n const mainDcId = Number(mainDcIdStr);\n const {\n ipAddress,\n port,\n } = utils.getDC(mainDcId);\n this.setDC(mainDcId, ipAddress, port);\n const authKey = new AuthKey();\n await authKey.setKey(Buffer.from(mainDcKey, 'hex'), true);\n this.setAuthKey(authKey, mainDcId);\n }\n\n async _updateStorage() {\n if (!this._storageKey) {\n return;\n }\n\n try {\n await this._saveToCache(JSON.stringify(this.getSessionData()));\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn('Failed to update session in storage');\n // eslint-disable-next-line no-console\n console.warn(err);\n }\n }\n\n async delete() {\n try {\n return await this._delete();\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn('Failed to delete session from storage');\n // eslint-disable-next-line no-console\n console.warn(err);\n }\n return undefined;\n }\n\n // @abstract\n _delete() {\n throw new Error('Not Implemented');\n }\n\n // @abstract\n _fetchFromCache() {\n throw new Error('Not Implemented');\n }\n\n // @abstract\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _saveToCache(data) {\n throw new Error('Not Implemented');\n }\n}\n\nfunction generateStorageKey() {\n // Creating two sessions at the same moment is not expected nor supported.\n return `${STORAGE_KEY_BASE}${Date.now()}`;\n}\n\nmodule.exports = StorageSession;\n","const MemorySession = require('./Memory');\nconst AuthKey = require('../crypto/AuthKey');\nconst BinaryReader = require('../extensions/BinaryReader');\n\nconst CURRENT_VERSION = '1';\n\n\nclass StringSession extends MemorySession {\n /**\n * This session file can be easily saved and loaded as a string. According\n * to the initial design, it contains only the data that is necessary for\n * successful connection and authentication, so takeout ID is not stored.\n\n * It is thought to be used where you don't want to create any on-disk\n * files but would still like to be able to save and load existing sessions\n * by other means.\n\n * You can use custom `encode` and `decode` functions, if present:\n\n * `encode` definition must be ``function encode(value: Buffer) -> string:``.\n * `decode` definition must be ``function decode(value: string) -> Buffer:``.\n * @param session {string|null}\n */\n constructor(session = undefined) {\n super();\n if (session) {\n if (session[0] !== CURRENT_VERSION) {\n throw new Error('Not a valid string');\n }\n session = session.slice(1);\n const r = StringSession.decode(session);\n const reader = new BinaryReader(r);\n this._dcId = reader.read(1)\n .readUInt8(0);\n const serverAddressLen = reader.read(2)\n .readInt16BE(0);\n this._serverAddress = String(reader.read(serverAddressLen));\n this._port = reader.read(2)\n .readInt16BE(0);\n this._key = reader.read(-1);\n }\n }\n\n /**\n * @param x {Buffer}\n * @returns {string}\n */\n static encode(x) {\n return x.toString('base64');\n }\n\n /**\n * @param x {string}\n * @returns {Buffer}\n */\n static decode(x) {\n return Buffer.from(x, 'base64');\n }\n\n async load() {\n if (this._key) {\n this._authKey = new AuthKey();\n await this._authKey.setKey(this._key);\n }\n }\n\n save() {\n if (!this.authKey) {\n return '';\n }\n const dcBuffer = Buffer.from([this.dcId]);\n const addressBuffer = Buffer.from(this.serverAddress);\n const addressLengthBuffer = Buffer.alloc(2);\n addressLengthBuffer.writeInt16BE(addressBuffer.length, 0);\n const portBuffer = Buffer.alloc(2);\n portBuffer.writeInt16BE(this.port, 0);\n\n return CURRENT_VERSION + StringSession.encode(Buffer.concat([\n dcBuffer,\n addressLengthBuffer,\n addressBuffer,\n portBuffer,\n this.authKey.getKey(),\n ]));\n }\n\n getAuthKey(dcId) {\n if (dcId && dcId !== this.dcId) {\n // Not supported.\n return undefined;\n }\n\n return this.authKey;\n }\n\n setAuthKey(authKey, dcId) {\n if (dcId && dcId !== this.dcId) {\n // Not supported.\n return;\n }\n\n this.authKey = authKey;\n }\n}\n\nmodule.exports = StringSession;\n","const Memory = require('./Memory');\nconst StringSession = require('./StringSession');\nconst CacheApiSession = require('./CacheApiSession');\nconst LocalStorageSession = require('./LocalStorageSession');\nconst IdbSession = require('./IdbSession');\nconst CallbackSession = require('./CallbackSession');\n\nmodule.exports = {\n Memory,\n StringSession,\n CacheApiSession,\n LocalStorageSession,\n IdbSession,\n CallbackSession,\n};\n","const api = require('./api');\n\nconst LAYER = 131;\nconst tlobjects = {};\n\n\nfor (const tl of Object.values(api)) {\n if (tl.CONSTRUCTOR_ID) {\n tlobjects[tl.CONSTRUCTOR_ID] = tl;\n } else {\n for (const sub of Object.values(tl)) {\n tlobjects[sub.CONSTRUCTOR_ID] = sub;\n }\n }\n}\n\nmodule.exports = {\n LAYER,\n tlobjects,\n};\n","const {\n parseTl,\n serializeBytes,\n serializeDate,\n} = require('./generationHelpers');\nconst {\n toSignedLittleBuffer,\n} = require('../Helpers');\n\nconst tlContent = require('./apiTl.js');\nconst schemeContent = require('./schemaTl.js');\n\n/* CONTEST\nconst NAMED_AUTO_CASTS = new Set([\n 'chatId,int'\n])\nconst NAMED_BLACKLIST = new Set([\n 'discardEncryption'\n])\nconst AUTO_CASTS = new Set([\n 'InputPeer',\n 'InputChannel',\n 'InputUser',\n 'InputDialogPeer',\n 'InputNotifyPeer',\n 'InputMedia',\n 'InputPhoto',\n 'InputMessage',\n 'InputDocument',\n 'InputChatPhoto'\n])\n\n */\n// eslint-disable-next-line no-restricted-globals\nconst CACHING_SUPPORTED = typeof self !== 'undefined' && self.localStorage !== undefined;\n\nconst CACHE_KEY = 'GramJs:apiCache';\n\nfunction buildApiFromTlSchema() {\n let definitions;\n const fromCache = CACHING_SUPPORTED && loadFromCache();\n\n if (fromCache) {\n definitions = fromCache;\n } else {\n definitions = loadFromTlSchemas();\n\n if (CACHING_SUPPORTED) {\n localStorage.setItem(CACHE_KEY, JSON.stringify(definitions));\n }\n }\n\n return mergeWithNamespaces(\n createClasses('constructor', definitions.constructors),\n createClasses('request', definitions.requests),\n );\n}\n\nfunction loadFromCache() {\n const jsonCache = localStorage.getItem(CACHE_KEY);\n return jsonCache && JSON.parse(jsonCache);\n}\n\nfunction loadFromTlSchemas() {\n const [constructorParamsApi, functionParamsApi] = extractParams(tlContent);\n const [constructorParamsSchema, functionParamsSchema] = extractParams(schemeContent);\n const constructors = [].concat(constructorParamsApi, constructorParamsSchema);\n const requests = [].concat(functionParamsApi, functionParamsSchema);\n\n return {\n constructors,\n requests,\n };\n}\n\nfunction mergeWithNamespaces(obj1, obj2) {\n const result = { ...obj1 };\n\n Object.keys(obj2)\n .forEach((key) => {\n if (typeof obj2[key] === 'function' || !result[key]) {\n result[key] = obj2[key];\n } else {\n Object.assign(result[key], obj2[key]);\n }\n });\n\n return result;\n}\n\nfunction extractParams(fileContent) {\n const f = parseTl(fileContent, 109);\n const constructors = [];\n const functions = [];\n for (const d of f) {\n if (d.isFunction) {\n functions.push(d);\n } else {\n constructors.push(d);\n }\n }\n return [constructors, functions];\n}\n\nfunction argToBytes(x, type) {\n switch (type) {\n case 'int': {\n const i = Buffer.alloc(4);\n i.writeInt32LE(x, 0);\n return i;\n }\n case 'long':\n return toSignedLittleBuffer(x, 8);\n case 'int128':\n return toSignedLittleBuffer(x, 16);\n case 'int256':\n return toSignedLittleBuffer(x, 32);\n case 'double': {\n const d = Buffer.alloc(8);\n d.writeDoubleLE(x, 0);\n return d;\n }\n case 'string':\n return serializeBytes(x);\n case 'Bool':\n return x ? Buffer.from('b5757299', 'hex') : Buffer.from('379779bc', 'hex');\n case 'true':\n return Buffer.alloc(0);\n case 'bytes':\n return serializeBytes(x);\n case 'date':\n return serializeDate(x);\n default:\n return x.getBytes();\n }\n}\n\n/*\nCONTEST\nasync function getInputFromResolve(utils, client, peer, peerType) {\n switch (peerType) {\n case 'InputPeer':\n return utils.getInputPeer(await client.getInputEntity(peer))\n case 'InputChannel':\n return utils.getInputChannel(await client.getInputEntity(peer))\n case 'InputUser':\n return utils.getInputUser(await client.getInputEntity(peer))\n case 'InputDialogPeer':\n return await client._getInputDialog(peer)\n case 'InputNotifyPeer':\n return await client._getInputNotify(peer)\n case 'InputMedia':\n return utils.getInputMedia(peer)\n case 'InputPhoto':\n return utils.getInputPhoto(peer)\n case 'InputMessage':\n return utils.getInputMessage(peer)\n case 'InputDocument':\n return utils.getInputDocument(peer)\n case 'InputChatPhoto':\n return utils.getInputChatPhoto(peer)\n case 'chatId,int' :\n return await client.getPeerId(peer, false)\n default:\n throw new Error('unsupported peer type : ' + peerType)\n }\n}\n*/\nfunction getArgFromReader(reader, arg) {\n if (arg.isVector) {\n if (arg.useVectorId) {\n reader.readInt();\n }\n const temp = [];\n const len = reader.readInt();\n arg.isVector = false;\n for (let i = 0; i < len; i++) {\n temp.push(getArgFromReader(reader, arg));\n }\n arg.isVector = true;\n return temp;\n } else if (arg.flagIndicator) {\n return reader.readInt();\n } else {\n switch (arg.type) {\n case 'int':\n return reader.readInt();\n case 'long':\n return reader.readLong();\n case 'int128':\n return reader.readLargeInt(128);\n case 'int256':\n return reader.readLargeInt(256);\n case 'double':\n return reader.readDouble();\n case 'string':\n return reader.tgReadString();\n case 'Bool':\n return reader.tgReadBool();\n case 'true':\n return true;\n case 'bytes':\n return reader.tgReadBytes();\n case 'date':\n return reader.tgReadDate();\n default:\n if (!arg.skipConstructorId) {\n return reader.tgReadObject();\n } else {\n throw new Error(`Unknown type ${arg}`);\n }\n }\n }\n}\n\nfunction createClasses(classesType, params) {\n const classes = {};\n for (const classParams of params) {\n const {\n name,\n constructorId,\n subclassOfId,\n argsConfig,\n namespace,\n result,\n } = classParams;\n const fullName = [namespace, name].join('.')\n .replace(/^\\./, '');\n\n class VirtualClass {\n static CONSTRUCTOR_ID = constructorId;\n\n static SUBCLASS_OF_ID = subclassOfId;\n\n static className = fullName;\n\n static classType = classesType;\n\n CONSTRUCTOR_ID = constructorId;\n\n SUBCLASS_OF_ID = subclassOfId;\n\n className = fullName;\n\n classType = classesType;\n\n constructor(args) {\n args = args || {};\n Object.keys(args)\n .forEach((argName) => {\n this[argName] = args[argName];\n });\n }\n\n static fromReader(reader) {\n const args = {};\n\n for (const argName in argsConfig) {\n if (argsConfig.hasOwnProperty(argName)) {\n const arg = argsConfig[argName];\n if (arg.isFlag) {\n if (arg.type === 'true') {\n args[argName] = Boolean(args.flags & (1 << arg.flagIndex));\n continue;\n }\n if (args.flags & (1 << arg.flagIndex)) {\n args[argName] = getArgFromReader(reader, arg);\n } else {\n args[argName] = undefined;\n }\n } else {\n if (arg.flagIndicator) {\n arg.name = 'flags';\n }\n args[argName] = getArgFromReader(reader, arg);\n }\n }\n }\n return new VirtualClass(args);\n }\n\n getBytes() {\n // The next is pseudo-code:\n const idForBytes = this.CONSTRUCTOR_ID;\n const c = Buffer.alloc(4);\n c.writeUInt32LE(idForBytes, 0);\n const buffers = [c];\n for (const arg in argsConfig) {\n if (argsConfig.hasOwnProperty(arg)) {\n if (argsConfig[arg].isFlag) {\n if ((this[arg] === false && argsConfig[arg].type === 'true')\n || this[arg] === undefined) {\n continue;\n }\n }\n if (argsConfig[arg].isVector) {\n if (argsConfig[arg].useVectorId) {\n buffers.push(Buffer.from('15c4b51c', 'hex'));\n }\n const l = Buffer.alloc(4);\n l.writeInt32LE(this[arg].length, 0);\n buffers.push(l, Buffer.concat(this[arg].map((x) => argToBytes(x, argsConfig[arg].type))));\n } else if (argsConfig[arg].flagIndicator) {\n if (!Object.values(argsConfig)\n .some((f) => f.isFlag)) {\n buffers.push(Buffer.alloc(4));\n } else {\n let flagCalculate = 0;\n for (const f in argsConfig) {\n if (argsConfig[f].isFlag) {\n if ((this[f] === false && argsConfig[f].type === 'true')\n || this[f] === undefined) {\n flagCalculate |= 0;\n } else {\n flagCalculate |= 1 << argsConfig[f].flagIndex;\n }\n }\n }\n const f = Buffer.alloc(4);\n f.writeUInt32LE(flagCalculate, 0);\n buffers.push(f);\n }\n } else {\n buffers.push(argToBytes(this[arg], argsConfig[arg].type));\n\n if (this[arg] && typeof this[arg].getBytes === 'function') {\n let boxed = (argsConfig[arg].type.charAt(argsConfig[arg].type.indexOf('.') + 1));\n boxed = boxed === boxed.toUpperCase();\n if (!boxed) {\n buffers.shift();\n }\n }\n }\n }\n }\n return Buffer.concat(buffers);\n }\n\n readResult(reader) {\n if (classesType !== 'request') {\n throw new Error('`readResult()` called for non-request instance');\n }\n\n const m = result.match(/Vector<(int|long)>/);\n if (m) {\n reader.readInt();\n const temp = [];\n const len = reader.readInt();\n if (m[1] === 'int') {\n for (let i = 0; i < len; i++) {\n temp.push(reader.readInt());\n }\n } else {\n for (let i = 0; i < len; i++) {\n temp.push(reader.readLong());\n }\n }\n return temp;\n } else {\n return reader.tgReadObject();\n }\n }\n\n /* CONTEST\n async resolve(client, utils) {\n\n if (classesType !== 'request') {\n throw new Error('`resolve()` called for non-request instance')\n }\n\n for (const arg in argsConfig) {\n if (argsConfig.hasOwnProperty(arg)) {\n if (!AUTO_CASTS.has(argsConfig[arg].type)) {\n if (!NAMED_AUTO_CASTS.has(`${argsConfig[arg].name},${argsConfig[arg].type}`)) {\n continue\n }\n }\n if (argsConfig[arg].isFlag) {\n if (!this[arg]) {\n continue\n }\n }\n if (argsConfig[arg].isVector) {\n const temp = []\n for (const x of this[arg]) {\n temp.push(await getInputFromResolve(utils, client, x, argsConfig[arg].type))\n }\n this[arg] = temp\n } else {\n this[arg] = await getInputFromResolve(utils, client, this[arg], argsConfig[arg].type)\n }\n }\n }\n } */\n }\n\n if (namespace) {\n if (!classes[namespace]) {\n classes[namespace] = {};\n }\n classes[namespace][name] = VirtualClass;\n } else {\n classes[name] = VirtualClass;\n }\n }\n\n return classes;\n}\n\nmodule.exports = buildApiFromTlSchema();\n","module.exports = `boolFalse#bc799737 = Bool;\nboolTrue#997275b5 = Bool;\ntrue#3fedd339 = True;\nvector#1cb5c415 {t:Type} # [ t ] = Vector t;\nerror#c4b9f9bb code:int text:string = Error;\nnull#56730bcc = Null;\ninputPeerEmpty#7f3b18ea = InputPeer;\ninputPeerSelf#7da07ec9 = InputPeer;\ninputPeerChat#179be863 chat_id:int = InputPeer;\ninputPeerUser#7b8e7de6 user_id:int access_hash:long = InputPeer;\ninputPeerChannel#20adaef8 channel_id:int access_hash:long = InputPeer;\ninputPeerUserFromMessage#17bae2e6 peer:InputPeer msg_id:int user_id:int = InputPeer;\ninputPeerChannelFromMessage#9c95f7bb peer:InputPeer msg_id:int channel_id:int = InputPeer;\ninputUserEmpty#b98886cf = InputUser;\ninputUserSelf#f7c1b13f = InputUser;\ninputUser#d8292816 user_id:int access_hash:long = InputUser;\ninputUserFromMessage#2d117597 peer:InputPeer msg_id:int user_id:int = InputUser;\ninputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;\ninputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;\ninputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;\ninputMediaEmpty#9664f57f = InputMedia;\ninputMediaUploadedPhoto#1e287d04 flags:# file:InputFile stickers:flags.0?Vector ttl_seconds:flags.1?int = InputMedia;\ninputMediaPhoto#b3ba0635 flags:# id:InputPhoto ttl_seconds:flags.0?int = InputMedia;\ninputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;\ninputMediaContact#f8ab7dfb phone_number:string first_name:string last_name:string vcard:string = InputMedia;\ninputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true force_file:flags.4?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector stickers:flags.0?Vector ttl_seconds:flags.1?int = InputMedia;\ninputMediaDocument#33473058 flags:# id:InputDocument ttl_seconds:flags.0?int query:flags.1?string = InputMedia;\ninputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia;\ninputMediaPhotoExternal#e5bbfe1a flags:# url:string ttl_seconds:flags.0?int = InputMedia;\ninputMediaDocumentExternal#fb52dc99 flags:# url:string ttl_seconds:flags.0?int = InputMedia;\ninputMediaGame#d33f43f3 id:InputGame = InputMedia;\ninputMediaInvoice#d9799874 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:flags.1?string = InputMedia;\ninputMediaGeoLive#971fa843 flags:# stopped:flags.0?true geo_point:InputGeoPoint heading:flags.2?int period:flags.1?int proximity_notification_radius:flags.3?int = InputMedia;\ninputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector solution:flags.1?string solution_entities:flags.1?Vector = InputMedia;\ninputMediaDice#e66fbf7b emoticon:string = InputMedia;\ninputChatPhotoEmpty#1ca48f57 = InputChatPhoto;\ninputChatUploadedPhoto#c642724e flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = InputChatPhoto;\ninputChatPhoto#8953ad37 id:InputPhoto = InputChatPhoto;\ninputGeoPointEmpty#e4c123d6 = InputGeoPoint;\ninputGeoPoint#48222faf flags:# lat:double long:double accuracy_radius:flags.0?int = InputGeoPoint;\ninputPhotoEmpty#1cd7bf0d = InputPhoto;\ninputPhoto#3bb3b94a id:long access_hash:long file_reference:bytes = InputPhoto;\ninputFileLocation#dfdaabe1 volume_id:long local_id:int secret:long file_reference:bytes = InputFileLocation;\ninputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;\ninputDocumentFileLocation#bad07584 id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;\ninputSecureFileLocation#cbc7ee28 id:long access_hash:long = InputFileLocation;\ninputTakeoutFileLocation#29be5899 = InputFileLocation;\ninputPhotoFileLocation#40181ffe id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;\ninputPhotoLegacyFileLocation#d83466f3 id:long access_hash:long file_reference:bytes volume_id:long local_id:int secret:long = InputFileLocation;\ninputPeerPhotoFileLocation#37257e99 flags:# big:flags.0?true peer:InputPeer photo_id:long = InputFileLocation;\ninputStickerSetThumb#9d84f3db stickerset:InputStickerSet thumb_version:int = InputFileLocation;\ninputGroupCallStream#bba51639 call:InputGroupCall time_ms:long scale:int = InputFileLocation;\npeerUser#9db1bc6d user_id:int = Peer;\npeerChat#bad0e5bb chat_id:int = Peer;\npeerChannel#bddde532 channel_id:int = Peer;\nstorage.fileUnknown#aa963b05 = storage.FileType;\nstorage.filePartial#40bc6f52 = storage.FileType;\nstorage.fileJpeg#7efe0e = storage.FileType;\nstorage.fileGif#cae1aadf = storage.FileType;\nstorage.filePng#a4f63c0 = storage.FileType;\nstorage.filePdf#ae1e508d = storage.FileType;\nstorage.fileMp3#528a0677 = storage.FileType;\nstorage.fileMov#4b09ebbc = storage.FileType;\nstorage.fileMp4#b3cea0e4 = storage.FileType;\nstorage.fileWebp#1081464c = storage.FileType;\nuserEmpty#200250ba id:int = User;\nuser#938458c1 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;\nuserProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;\nuserProfilePhoto#82d1f706 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto;\nuserStatusEmpty#9d05049 = UserStatus;\nuserStatusOnline#edb93949 expires:int = UserStatus;\nuserStatusOffline#8c703f was_online:int = UserStatus;\nuserStatusRecently#e26f42f1 = UserStatus;\nuserStatusLastWeek#7bf09fc = UserStatus;\nuserStatusLastMonth#77ebc742 = UserStatus;\nchatEmpty#9ba2d800 id:int = Chat;\nchat#3bda1bde flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat;\nchatForbidden#7328bdb id:int title:string = Chat;\nchannel#d31a961e flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true id:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?Vector admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat;\nchannelForbidden#289da732 flags:# broadcast:flags.5?true megagroup:flags.8?true id:int access_hash:long title:string until_date:flags.16?int = Chat;\nchatFull#8a1e2983 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:int about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer = ChatFull;\nchannelFull#548c3f93 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?int location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector groupcall_default_join_as:flags.26?Peer = ChatFull;\nchatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;\nchatParticipantCreator#da13538a user_id:int = ChatParticipant;\nchatParticipantAdmin#e2d6e436 user_id:int inviter_id:int date:int = ChatParticipant;\nchatParticipantsForbidden#fc900c2b flags:# chat_id:int self_participant:flags.0?ChatParticipant = ChatParticipants;\nchatParticipants#3f460fed chat_id:int participants:Vector version:int = ChatParticipants;\nchatPhotoEmpty#37c1011c = ChatPhoto;\nchatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = ChatPhoto;\nmessageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = Message;\nmessage#bce383d2 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector ttl_period:flags.25?int = Message;\nmessageService#2b085862 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction ttl_period:flags.25?int = Message;\nmessageMediaEmpty#3ded6320 = MessageMedia;\nmessageMediaPhoto#695150d7 flags:# photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia;\nmessageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;\nmessageMediaContact#cbf24940 phone_number:string first_name:string last_name:string vcard:string user_id:int = MessageMedia;\nmessageMediaUnsupported#9f84f49e = MessageMedia;\nmessageMediaDocument#9cb070d7 flags:# document:flags.0?Document ttl_seconds:flags.2?int = MessageMedia;\nmessageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;\nmessageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia;\nmessageMediaGame#fdb19008 game:Game = MessageMedia;\nmessageMediaInvoice#84551347 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string = MessageMedia;\nmessageMediaGeoLive#b940c666 flags:# geo:GeoPoint heading:flags.0?int period:int proximity_notification_radius:flags.1?int = MessageMedia;\nmessageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia;\nmessageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia;\nmessageActionEmpty#b6aef7b0 = MessageAction;\nmessageActionChatCreate#a6638b9a title:string users:Vector = MessageAction;\nmessageActionChatEditTitle#b5a1ce5a title:string = MessageAction;\nmessageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;\nmessageActionChatDeletePhoto#95e3fbef = MessageAction;\nmessageActionChatAddUser#488a7337 users:Vector = MessageAction;\nmessageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;\nmessageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction;\nmessageActionChannelCreate#95d2ac92 title:string = MessageAction;\nmessageActionChatMigrateTo#51bdb021 channel_id:int = MessageAction;\nmessageActionChannelMigrateFrom#b055eaee title:string chat_id:int = MessageAction;\nmessageActionPinMessage#94bd38ed = MessageAction;\nmessageActionHistoryClear#9fbab604 = MessageAction;\nmessageActionGameScore#92a72876 game_id:long score:int = MessageAction;\nmessageActionPaymentSentMe#8f31b327 flags:# currency:string total_amount:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string charge:PaymentCharge = MessageAction;\nmessageActionPaymentSent#40699cd0 currency:string total_amount:long = MessageAction;\nmessageActionPhoneCall#80e11a7f flags:# video:flags.2?true call_id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = MessageAction;\nmessageActionScreenshotTaken#4792929b = MessageAction;\nmessageActionCustomAction#fae69f56 message:string = MessageAction;\nmessageActionBotAllowed#abe9affe domain:string = MessageAction;\nmessageActionSecureValuesSentMe#1b287353 values:Vector credentials:SecureCredentialsEncrypted = MessageAction;\nmessageActionSecureValuesSent#d95c6154 types:Vector = MessageAction;\nmessageActionContactSignUp#f3f25f76 = MessageAction;\nmessageActionGeoProximityReached#98e0d697 from_id:Peer to_id:Peer distance:int = MessageAction;\nmessageActionGroupCall#7a0d7f42 flags:# call:InputGroupCall duration:flags.0?int = MessageAction;\nmessageActionInviteToGroupCall#76b9f11a call:InputGroupCall users:Vector = MessageAction;\nmessageActionSetMessagesTTL#aa1afbfd period:int = MessageAction;\nmessageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction;\ndialog#2c171f72 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int = Dialog;\ndialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;\nphotoEmpty#2331b22d id:long = Photo;\nphoto#fb197a65 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector video_sizes:flags.1?Vector dc_id:int = Photo;\nphotoSizeEmpty#e17e23c type:string = PhotoSize;\nphotoSize#75c78e60 type:string w:int h:int size:int = PhotoSize;\nphotoCachedSize#21e1ad6 type:string w:int h:int bytes:bytes = PhotoSize;\nphotoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize;\nphotoSizeProgressive#fa3efb95 type:string w:int h:int sizes:Vector = PhotoSize;\nphotoPathSize#d8214d41 type:string bytes:bytes = PhotoSize;\ngeoPointEmpty#1117dd5f = GeoPoint;\ngeoPoint#b2a2f663 flags:# long:double lat:double access_hash:long accuracy_radius:flags.0?int = GeoPoint;\nauth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode;\nauth.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Authorization;\nauth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization;\nauth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;\ninputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;\ninputNotifyUsers#193b4417 = InputNotifyPeer;\ninputNotifyChats#4a95e84e = InputNotifyPeer;\ninputNotifyBroadcasts#b1db7c7e = InputNotifyPeer;\ninputPeerNotifySettings#9c3d198e flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = InputPeerNotifySettings;\npeerNotifySettings#af509d20 flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = PeerNotifySettings;\npeerSettings#733f2961 flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true invite_members:flags.8?true geo_distance:flags.6?int = PeerSettings;\nwallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper;\nwallPaperNoFile#e0804116 id:long flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper;\ninputReportReasonSpam#58dbcab8 = ReportReason;\ninputReportReasonViolence#1e22c78d = ReportReason;\ninputReportReasonPornography#2e59d922 = ReportReason;\ninputReportReasonChildAbuse#adf44ee3 = ReportReason;\ninputReportReasonOther#c1e4a2b1 = ReportReason;\ninputReportReasonCopyright#9b89f93a = ReportReason;\ninputReportReasonGeoIrrelevant#dbd4feed = ReportReason;\ninputReportReasonFake#f5ddd6e7 = ReportReason;\nuserFull#139a9a77 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int = UserFull;\ncontact#f911c994 user_id:int mutual:Bool = Contact;\nimportedContact#d0028438 user_id:int client_id:long = ImportedContact;\ncontactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus;\ncontacts.contactsNotModified#b74ba9d2 = contacts.Contacts;\ncontacts.contacts#eae87e42 contacts:Vector saved_count:int users:Vector = contacts.Contacts;\ncontacts.importedContacts#77d01c3b imported:Vector popular_invites:Vector retry_contacts:Vector users:Vector = contacts.ImportedContacts;\ncontacts.blocked#ade1591 blocked:Vector chats:Vector users:Vector = contacts.Blocked;\ncontacts.blockedSlice#e1664194 count:int blocked:Vector chats:Vector users:Vector = contacts.Blocked;\nmessages.dialogs#15ba6c40 dialogs:Vector messages:Vector chats:Vector users:Vector = messages.Dialogs;\nmessages.dialogsSlice#71e094f3 count:int dialogs:Vector messages:Vector chats:Vector users:Vector = messages.Dialogs;\nmessages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs;\nmessages.messages#8c718e87 messages:Vector chats:Vector users:Vector = messages.Messages;\nmessages.messagesSlice#3a54685e flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int messages:Vector chats:Vector users:Vector = messages.Messages;\nmessages.channelMessages#64479808 flags:# inexact:flags.1?true pts:int count:int offset_id_offset:flags.2?int messages:Vector chats:Vector users:Vector = messages.Messages;\nmessages.messagesNotModified#74535f21 count:int = messages.Messages;\nmessages.chats#64ff9fd5 chats:Vector = messages.Chats;\nmessages.chatsSlice#9cd81144 count:int chats:Vector = messages.Chats;\nmessages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector users:Vector = messages.ChatFull;\nmessages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;\ninputMessagesFilterEmpty#57e2f66c = MessagesFilter;\ninputMessagesFilterPhotos#9609a51c = MessagesFilter;\ninputMessagesFilterVideo#9fc00e65 = MessagesFilter;\ninputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;\ninputMessagesFilterDocument#9eddf188 = MessagesFilter;\ninputMessagesFilterUrl#7ef0dd87 = MessagesFilter;\ninputMessagesFilterGif#ffc86587 = MessagesFilter;\ninputMessagesFilterVoice#50f5c392 = MessagesFilter;\ninputMessagesFilterMusic#3751b49e = MessagesFilter;\ninputMessagesFilterChatPhotos#3a20ecb8 = MessagesFilter;\ninputMessagesFilterPhoneCalls#80c99768 flags:# missed:flags.0?true = MessagesFilter;\ninputMessagesFilterRoundVoice#7a7c17a4 = MessagesFilter;\ninputMessagesFilterRoundVideo#b549da53 = MessagesFilter;\ninputMessagesFilterMyMentions#c1f8e69a = MessagesFilter;\ninputMessagesFilterGeo#e7026d0d = MessagesFilter;\ninputMessagesFilterContacts#e062db83 = MessagesFilter;\ninputMessagesFilterPinned#1bb00451 = MessagesFilter;\nupdateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;\nupdateMessageID#4e90bfd6 id:int random_id:long = Update;\nupdateDeleteMessages#a20db0e5 messages:Vector pts:int pts_count:int = Update;\nupdateUserTyping#5c486927 user_id:int action:SendMessageAction = Update;\nupdateChatUserTyping#86cadb6c chat_id:int from_id:Peer action:SendMessageAction = Update;\nupdateChatParticipants#7761198 participants:ChatParticipants = Update;\nupdateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;\nupdateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update;\nupdateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;\nupdateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;\nupdateEncryptedChatTyping#1710f156 chat_id:int = Update;\nupdateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;\nupdateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;\nupdateChatParticipantAdd#ea4b0e5c chat_id:int user_id:int inviter_id:int date:int version:int = Update;\nupdateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;\nupdateDcOptions#8e5e9873 dc_options:Vector = Update;\nupdateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update;\nupdateServiceNotification#ebe46819 flags:# popup:flags.0?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector = Update;\nupdatePrivacy#ee3b272a key:PrivacyKey rules:Vector = Update;\nupdateUserPhone#12b9417b user_id:int phone:string = Update;\nupdateReadHistoryInbox#9c974fdf flags:# folder_id:flags.0?int peer:Peer max_id:int still_unread_count:int pts:int pts_count:int = Update;\nupdateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;\nupdateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update;\nupdateReadMessagesContents#68c13933 messages:Vector pts:int pts_count:int = Update;\nupdateChannelTooLong#eb0467fb flags:# channel_id:int pts:flags.0?int = Update;\nupdateChannel#b6d45656 channel_id:int = Update;\nupdateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update;\nupdateReadChannelInbox#330b5424 flags:# folder_id:flags.0?int channel_id:int max_id:int still_unread_count:int pts:int = Update;\nupdateDeleteChannelMessages#c37521c9 channel_id:int messages:Vector pts:int pts_count:int = Update;\nupdateChannelMessageViews#98a12b4b channel_id:int id:int views:int = Update;\nupdateChatParticipantAdmin#b6901959 chat_id:int user_id:int is_admin:Bool version:int = Update;\nupdateNewStickerSet#688a30aa stickerset:messages.StickerSet = Update;\nupdateStickerSetsOrder#bb2d201 flags:# masks:flags.0?true order:Vector = Update;\nupdateStickerSets#43ae3dec = Update;\nupdateSavedGifs#9375341e = Update;\nupdateBotInlineQuery#3f2038db flags:# query_id:long user_id:int query:string geo:flags.0?GeoPoint peer_type:flags.1?InlineQueryPeerType offset:string = Update;\nupdateBotInlineSend#e48f964 flags:# user_id:int query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update;\nupdateEditChannelMessage#1b3f4df7 message:Message pts:int pts_count:int = Update;\nupdateBotCallbackQuery#e73547e1 flags:# query_id:long user_id:int peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;\nupdateEditMessage#e40370a3 message:Message pts:int pts_count:int = Update;\nupdateInlineBotCallbackQuery#f9d27a5a flags:# query_id:long user_id:int msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;\nupdateReadChannelOutbox#25d6c9c7 channel_id:int max_id:int = Update;\nupdateDraftMessage#ee2bb969 peer:Peer draft:DraftMessage = Update;\nupdateReadFeaturedStickers#571d2742 = Update;\nupdateRecentStickers#9a422c20 = Update;\nupdateConfig#a229dd06 = Update;\nupdatePtsChanged#3354678f = Update;\nupdateChannelWebPage#40771900 channel_id:int webpage:WebPage pts:int pts_count:int = Update;\nupdateDialogPinned#6e6fe51c flags:# pinned:flags.0?true folder_id:flags.1?int peer:DialogPeer = Update;\nupdatePinnedDialogs#fa0f3ca2 flags:# folder_id:flags.1?int order:flags.0?Vector = Update;\nupdateBotWebhookJSON#8317c0c3 data:DataJSON = Update;\nupdateBotWebhookJSONQuery#9b9240a6 query_id:long data:DataJSON timeout:int = Update;\nupdateBotShippingQuery#e0cdc940 query_id:long user_id:int payload:bytes shipping_address:PostAddress = Update;\nupdateBotPrecheckoutQuery#5d2f3aa9 flags:# query_id:long user_id:int payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update;\nupdatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update;\nupdateLangPackTooLong#46560264 lang_code:string = Update;\nupdateLangPack#56022f4d difference:LangPackDifference = Update;\nupdateFavedStickers#e511996d = Update;\nupdateChannelReadMessagesContents#89893b45 channel_id:int messages:Vector = Update;\nupdateContactsReset#7084a7be = Update;\nupdateChannelAvailableMessages#70db6837 channel_id:int available_min_id:int = Update;\nupdateDialogUnreadMark#e16459c3 flags:# unread:flags.0?true peer:DialogPeer = Update;\nupdateMessagePoll#aca1657b flags:# poll_id:long poll:flags.0?Poll results:PollResults = Update;\nupdateChatDefaultBannedRights#54c01850 peer:Peer default_banned_rights:ChatBannedRights version:int = Update;\nupdateFolderPeers#19360dc0 folder_peers:Vector pts:int pts_count:int = Update;\nupdatePeerSettings#6a7e7366 peer:Peer settings:PeerSettings = Update;\nupdatePeerLocated#b4afcfb0 peers:Vector = Update;\nupdateNewScheduledMessage#39a51dfb message:Message = Update;\nupdateDeleteScheduledMessages#90866cee peer:Peer messages:Vector = Update;\nupdateTheme#8216fba3 theme:Theme = Update;\nupdateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update;\nupdateLoginToken#564fe691 = Update;\nupdateMessagePollVote#37f69f0b poll_id:long user_id:int options:Vector qts:int = Update;\nupdateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update;\nupdateDialogFilterOrder#a5d72105 order:Vector = Update;\nupdateDialogFilters#3504914f = Update;\nupdatePhoneCallSignalingData#2661bf09 phone_call_id:long data:bytes = Update;\nupdateChannelMessageForwards#6e8a84df channel_id:int id:int forwards:int = Update;\nupdateReadChannelDiscussionInbox#1cc7de54 flags:# channel_id:int top_msg_id:int read_max_id:int broadcast_id:flags.0?int broadcast_post:flags.0?int = Update;\nupdateReadChannelDiscussionOutbox#4638a26c channel_id:int top_msg_id:int read_max_id:int = Update;\nupdatePeerBlocked#246a4b22 peer_id:Peer blocked:Bool = Update;\nupdateChannelUserTyping#6b171718 flags:# channel_id:int top_msg_id:flags.0?int from_id:Peer action:SendMessageAction = Update;\nupdatePinnedMessages#ed85eab5 flags:# pinned:flags.0?true peer:Peer messages:Vector pts:int pts_count:int = Update;\nupdatePinnedChannelMessages#8588878b flags:# pinned:flags.0?true channel_id:int messages:Vector pts:int pts_count:int = Update;\nupdateChat#1330a196 chat_id:int = Update;\nupdateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector version:int = Update;\nupdateGroupCall#a45eb99b chat_id:int call:GroupCall = Update;\nupdatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update;\nupdateChatParticipant#f3b3781f flags:# chat_id:int date:int actor_id:int user_id:int prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update;\nupdateChannelParticipant#7fecb1ec flags:# channel_id:int date:int actor_id:int user_id:int prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update;\nupdateBotStopped#7f9488a user_id:int date:int stopped:Bool qts:int = Update;\nupdateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update;\nupdateBotCommands#cf7e0873 peer:Peer bot_id:int commands:Vector = Update;\nupdates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;\nupdates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;\nupdates.difference#f49ca0 new_messages:Vector new_encrypted_messages:Vector other_updates:Vector chats:Vector users:Vector state:updates.State = updates.Difference;\nupdates.differenceSlice#a8fb1981 new_messages:Vector new_encrypted_messages:Vector other_updates:Vector chats:Vector users:Vector intermediate_state:updates.State = updates.Difference;\nupdates.differenceTooLong#4afe8f6d pts:int = updates.Difference;\nupdatesTooLong#e317af7e = Updates;\nupdateShortMessage#faeff833 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates;\nupdateShortChatMessage#1157b858 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates;\nupdateShort#78d4dec1 update:Update date:int = Updates;\nupdatesCombined#725b04c3 updates:Vector users:Vector chats:Vector date:int seq_start:int seq:int = Updates;\nupdates#74ae4240 updates:Vector users:Vector chats:Vector date:int seq:int = Updates;\nupdateShortSentMessage#9015e101 flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector ttl_period:flags.25?int = Updates;\nphotos.photos#8dca6aa5 photos:Vector users:Vector = photos.Photos;\nphotos.photosSlice#15051f54 count:int photos:Vector users:Vector = photos.Photos;\nphotos.photo#20212ca8 photo:Photo users:Vector = photos.Photo;\nupload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;\nupload.fileCdnRedirect#f18cda44 dc_id:int file_token:bytes encryption_key:bytes encryption_iv:bytes file_hashes:Vector = upload.File;\ndcOption#18b7a10d flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true cdn:flags.3?true static:flags.4?true id:int ip_address:string port:int secret:flags.10?bytes = DcOption;\nconfig#330b4067 flags:# phonecalls_enabled:flags.1?true default_p2p_contacts:flags.3?true preload_featured_stickers:flags.4?true ignore_phone_entities:flags.5?true revoke_pm_inbox:flags.6?true blocked_mode:flags.8?true pfs_enabled:flags.13?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector dc_txt_domain_name:string chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int revoke_time_limit:int revoke_pm_time_limit:int rating_e_decay:int stickers_recent_limit:int stickers_faved_limit:int channels_read_media_period:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int pinned_infolder_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string autoupdate_url_prefix:flags.7?string gif_search_username:flags.9?string venue_search_username:flags.10?string img_search_username:flags.11?string static_maps_provider:flags.12?string caption_length_max:int message_length_max:int webfile_dc_id:int suggested_lang_code:flags.2?string lang_pack_version:flags.2?int base_lang_pack_version:flags.2?int = Config;\nnearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;\nhelp.appUpdate#ccbbce30 flags:# can_not_skip:flags.0?true id:int version:string text:string entities:Vector document:flags.1?Document url:flags.2?string sticker:flags.3?Document = help.AppUpdate;\nhelp.noAppUpdate#c45a6536 = help.AppUpdate;\nhelp.inviteText#18cb9f78 message:string = help.InviteText;\nencryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;\nencryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;\nencryptedChatRequested#62718a82 flags:# folder_id:flags.0?int id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;\nencryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;\nencryptedChatDiscarded#1e1c7c45 flags:# history_deleted:flags.0?true id:int = EncryptedChat;\ninputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;\nencryptedFileEmpty#c21f497e = EncryptedFile;\nencryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;\ninputEncryptedFileEmpty#1837c364 = InputEncryptedFile;\ninputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;\ninputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;\ninputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;\nencryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;\nencryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;\nmessages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;\nmessages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;\nmessages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;\nmessages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;\ninputDocumentEmpty#72f0eaae = InputDocument;\ninputDocument#1abfb575 id:long access_hash:long file_reference:bytes = InputDocument;\ndocumentEmpty#36f8c871 id:long = Document;\ndocument#1e87342b flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:int thumbs:flags.0?Vector video_thumbs:flags.1?Vector dc_id:int attributes:Vector = Document;\nhelp.support#17c6b5f6 phone_number:string user:User = help.Support;\nnotifyPeer#9fd40bd8 peer:Peer = NotifyPeer;\nnotifyUsers#b4c83b4c = NotifyPeer;\nnotifyChats#c007cec3 = NotifyPeer;\nnotifyBroadcasts#d612e8ef = NotifyPeer;\nsendMessageTypingAction#16bf744e = SendMessageAction;\nsendMessageCancelAction#fd5ec8f5 = SendMessageAction;\nsendMessageRecordVideoAction#a187d66f = SendMessageAction;\nsendMessageUploadVideoAction#e9763aec progress:int = SendMessageAction;\nsendMessageRecordAudioAction#d52f73f7 = SendMessageAction;\nsendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction;\nsendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction;\nsendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction;\nsendMessageGeoLocationAction#176f8ba1 = SendMessageAction;\nsendMessageChooseContactAction#628cbc6f = SendMessageAction;\nsendMessageGamePlayAction#dd6a8f48 = SendMessageAction;\nsendMessageRecordRoundAction#88f27fbc = SendMessageAction;\nsendMessageUploadRoundAction#243e1c66 progress:int = SendMessageAction;\nspeakingInGroupCallAction#d92c2285 = SendMessageAction;\nsendMessageHistoryImportAction#dbda9246 progress:int = SendMessageAction;\ncontacts.found#b3134d9d my_results:Vector results:Vector chats:Vector users:Vector = contacts.Found;\ninputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;\ninputPrivacyKeyChatInvite#bdfb0426 = InputPrivacyKey;\ninputPrivacyKeyPhoneCall#fabadc5f = InputPrivacyKey;\ninputPrivacyKeyPhoneP2P#db9e70d2 = InputPrivacyKey;\ninputPrivacyKeyForwards#a4dd4c08 = InputPrivacyKey;\ninputPrivacyKeyProfilePhoto#5719bacc = InputPrivacyKey;\ninputPrivacyKeyPhoneNumber#352dafa = InputPrivacyKey;\ninputPrivacyKeyAddedByPhone#d1219bdd = InputPrivacyKey;\nprivacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;\nprivacyKeyChatInvite#500e6dfa = PrivacyKey;\nprivacyKeyPhoneCall#3d662b7b = PrivacyKey;\nprivacyKeyPhoneP2P#39491cc8 = PrivacyKey;\nprivacyKeyForwards#69ec56a3 = PrivacyKey;\nprivacyKeyProfilePhoto#96151fed = PrivacyKey;\nprivacyKeyPhoneNumber#d19ae46d = PrivacyKey;\nprivacyKeyAddedByPhone#42ffd42b = PrivacyKey;\ninputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;\ninputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;\ninputPrivacyValueAllowUsers#131cc67f users:Vector = InputPrivacyRule;\ninputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule;\ninputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule;\ninputPrivacyValueDisallowUsers#90110467 users:Vector = InputPrivacyRule;\ninputPrivacyValueAllowChatParticipants#4c81c1ba chats:Vector = InputPrivacyRule;\ninputPrivacyValueDisallowChatParticipants#d82363af chats:Vector = InputPrivacyRule;\nprivacyValueAllowContacts#fffe1bac = PrivacyRule;\nprivacyValueAllowAll#65427b82 = PrivacyRule;\nprivacyValueAllowUsers#4d5bbe0c users:Vector = PrivacyRule;\nprivacyValueDisallowContacts#f888fa1a = PrivacyRule;\nprivacyValueDisallowAll#8b73e763 = PrivacyRule;\nprivacyValueDisallowUsers#c7f49b7 users:Vector = PrivacyRule;\nprivacyValueAllowChatParticipants#18be796b chats:Vector = PrivacyRule;\nprivacyValueDisallowChatParticipants#acae0690 chats:Vector = PrivacyRule;\naccount.privacyRules#50a04e45 rules:Vector chats:Vector users:Vector = account.PrivacyRules;\naccountDaysTTL#b8d0afdf days:int = AccountDaysTTL;\ndocumentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;\ndocumentAttributeAnimated#11b58939 = DocumentAttribute;\ndocumentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute;\ndocumentAttributeVideo#ef02ce6 flags:# round_message:flags.0?true supports_streaming:flags.1?true duration:int w:int h:int = DocumentAttribute;\ndocumentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute;\ndocumentAttributeFilename#15590068 file_name:string = DocumentAttribute;\ndocumentAttributeHasStickers#9801d2f7 = DocumentAttribute;\nmessages.stickersNotModified#f1749a22 = messages.Stickers;\nmessages.stickers#e4599bbd hash:int stickers:Vector = messages.Stickers;\nstickerPack#12b299d4 emoticon:string documents:Vector = StickerPack;\nmessages.allStickersNotModified#e86602c3 = messages.AllStickers;\nmessages.allStickers#edfd405f hash:int sets:Vector = messages.AllStickers;\nmessages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;\nwebPageEmpty#eb1477e8 id:long = WebPage;\nwebPagePending#c586da1c id:long date:int = WebPage;\nwebPage#e89c45b2 flags:# id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page attributes:flags.12?Vector = WebPage;\nwebPageNotModified#7311ca11 flags:# cached_page_views:flags.0?int = WebPage;\nauthorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true hash:long device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;\naccount.authorizations#1250abde authorizations:Vector = account.Authorizations;\naccount.password#185b184f flags:# has_recovery:flags.0?true has_secure_values:flags.1?true has_password:flags.2?true current_algo:flags.2?PasswordKdfAlgo srp_B:flags.2?bytes srp_id:flags.2?long hint:flags.3?string email_unconfirmed_pattern:flags.4?string new_algo:PasswordKdfAlgo new_secure_algo:SecurePasswordKdfAlgo secure_random:bytes pending_reset_date:flags.5?int = account.Password;\naccount.passwordSettings#9a5c33e5 flags:# email:flags.0?string secure_settings:flags.1?SecureSecretSettings = account.PasswordSettings;\naccount.passwordInputSettings#c23727c9 flags:# new_algo:flags.0?PasswordKdfAlgo new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string new_secure_settings:flags.2?SecureSecretSettings = account.PasswordInputSettings;\nauth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;\nreceivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;\nchatInviteExported#6e24fc9d flags:# revoked:flags.0?true permanent:flags.5?true link:string admin_id:int date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int = ExportedChatInvite;\nchatInviteAlready#5a686d7c chat:Chat = ChatInvite;\nchatInvite#dfc2f58e flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true title:string photo:Photo participants_count:int participants:flags.4?Vector = ChatInvite;\nchatInvitePeek#61695cb0 chat:Chat expires:int = ChatInvite;\ninputStickerSetEmpty#ffb62b95 = InputStickerSet;\ninputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;\ninputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;\ninputStickerSetAnimatedEmoji#28703c8 = InputStickerSet;\ninputStickerSetDice#e67f520e emoticon:string = InputStickerSet;\nstickerSet#d7df217a flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector thumb_dc_id:flags.4?int thumb_version:flags.4?int count:int hash:int = StickerSet;\nmessages.stickerSet#b60a24a6 set:StickerSet packs:Vector documents:Vector = messages.StickerSet;\nbotCommand#c27ac8c7 command:string description:string = BotCommand;\nbotInfo#98e81d3a user_id:int description:string commands:Vector = BotInfo;\nkeyboardButton#a2fa4880 text:string = KeyboardButton;\nkeyboardButtonUrl#258aff05 text:string url:string = KeyboardButton;\nkeyboardButtonCallback#35bbdb6b flags:# requires_password:flags.0?true text:string data:bytes = KeyboardButton;\nkeyboardButtonRequestPhone#b16a6c29 text:string = KeyboardButton;\nkeyboardButtonRequestGeoLocation#fc796b3f text:string = KeyboardButton;\nkeyboardButtonSwitchInline#568a748 flags:# same_peer:flags.0?true text:string query:string = KeyboardButton;\nkeyboardButtonGame#50f41ccf text:string = KeyboardButton;\nkeyboardButtonBuy#afd93fbb text:string = KeyboardButton;\nkeyboardButtonUrlAuth#10b78d29 flags:# text:string fwd_text:flags.0?string url:string button_id:int = KeyboardButton;\ninputKeyboardButtonUrlAuth#d02e7fd4 flags:# request_write_access:flags.0?true text:string fwd_text:flags.1?string url:string bot:InputUser = KeyboardButton;\nkeyboardButtonRequestPoll#bbc7515d flags:# quiz:flags.0?Bool text:string = KeyboardButton;\nkeyboardButtonRow#77608b83 buttons:Vector = KeyboardButtonRow;\nreplyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup;\nreplyKeyboardForceReply#86b40b08 flags:# single_use:flags.1?true selective:flags.2?true placeholder:flags.3?string = ReplyMarkup;\nreplyKeyboardMarkup#85dd99d1 flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true rows:Vector placeholder:flags.3?string = ReplyMarkup;\nreplyInlineMarkup#48a30254 rows:Vector = ReplyMarkup;\nmessageEntityUnknown#bb92ba95 offset:int length:int = MessageEntity;\nmessageEntityMention#fa04579d offset:int length:int = MessageEntity;\nmessageEntityHashtag#6f635b0d offset:int length:int = MessageEntity;\nmessageEntityBotCommand#6cef8ac7 offset:int length:int = MessageEntity;\nmessageEntityUrl#6ed02538 offset:int length:int = MessageEntity;\nmessageEntityEmail#64e475c2 offset:int length:int = MessageEntity;\nmessageEntityBold#bd610bc9 offset:int length:int = MessageEntity;\nmessageEntityItalic#826f8b60 offset:int length:int = MessageEntity;\nmessageEntityCode#28a20571 offset:int length:int = MessageEntity;\nmessageEntityPre#73924be0 offset:int length:int language:string = MessageEntity;\nmessageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity;\nmessageEntityMentionName#352dca58 offset:int length:int user_id:int = MessageEntity;\ninputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity;\nmessageEntityPhone#9b69e34b offset:int length:int = MessageEntity;\nmessageEntityCashtag#4c4e743f offset:int length:int = MessageEntity;\nmessageEntityUnderline#9c4e7e8b offset:int length:int = MessageEntity;\nmessageEntityStrike#bf0693d4 offset:int length:int = MessageEntity;\nmessageEntityBlockquote#20df5d0 offset:int length:int = MessageEntity;\nmessageEntityBankCard#761e6af4 offset:int length:int = MessageEntity;\ninputChannelEmpty#ee8c1e86 = InputChannel;\ninputChannel#afeb712e channel_id:int access_hash:long = InputChannel;\ninputChannelFromMessage#2a286531 peer:InputPeer msg_id:int channel_id:int = InputChannel;\ncontacts.resolvedPeer#7f077ad9 peer:Peer chats:Vector users:Vector = contacts.ResolvedPeer;\nmessageRange#ae30253 min_id:int max_id:int = MessageRange;\nupdates.channelDifferenceEmpty#3e11affb flags:# final:flags.0?true pts:int timeout:flags.1?int = updates.ChannelDifference;\nupdates.channelDifferenceTooLong#a4bcc6fe flags:# final:flags.0?true timeout:flags.1?int dialog:Dialog messages:Vector chats:Vector users:Vector = updates.ChannelDifference;\nupdates.channelDifference#2064674e flags:# final:flags.0?true pts:int timeout:flags.1?int new_messages:Vector other_updates:Vector chats:Vector users:Vector = updates.ChannelDifference;\nchannelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter;\nchannelMessagesFilter#cd77d957 flags:# exclude_new_messages:flags.1?true ranges:Vector = ChannelMessagesFilter;\nchannelParticipant#15ebac1d user_id:int date:int = ChannelParticipant;\nchannelParticipantSelf#a3289a6d user_id:int inviter_id:int date:int = ChannelParticipant;\nchannelParticipantCreator#447dca4b flags:# user_id:int admin_rights:ChatAdminRights rank:flags.0?string = ChannelParticipant;\nchannelParticipantAdmin#ccbebbaf flags:# can_edit:flags.0?true self:flags.1?true user_id:int inviter_id:flags.1?int promoted_by:int date:int admin_rights:ChatAdminRights rank:flags.2?string = ChannelParticipant;\nchannelParticipantBanned#50a1dfd6 flags:# left:flags.0?true peer:Peer kicked_by:int date:int banned_rights:ChatBannedRights = ChannelParticipant;\nchannelParticipantLeft#1b03f006 peer:Peer = ChannelParticipant;\nchannelParticipantsRecent#de3f3c79 = ChannelParticipantsFilter;\nchannelParticipantsAdmins#b4608969 = ChannelParticipantsFilter;\nchannelParticipantsKicked#a3b54985 q:string = ChannelParticipantsFilter;\nchannelParticipantsBots#b0d1865b = ChannelParticipantsFilter;\nchannelParticipantsBanned#1427a5e1 q:string = ChannelParticipantsFilter;\nchannelParticipantsSearch#656ac4b q:string = ChannelParticipantsFilter;\nchannelParticipantsContacts#bb6ae88d q:string = ChannelParticipantsFilter;\nchannelParticipantsMentions#e04b5ceb flags:# q:flags.0?string top_msg_id:flags.1?int = ChannelParticipantsFilter;\nchannels.channelParticipants#9ab0feaf count:int participants:Vector chats:Vector users:Vector = channels.ChannelParticipants;\nchannels.channelParticipantsNotModified#f0173fe9 = channels.ChannelParticipants;\nchannels.channelParticipant#dfb80317 participant:ChannelParticipant chats:Vector users:Vector = channels.ChannelParticipant;\nhelp.termsOfService#780a0310 flags:# popup:flags.0?true id:DataJSON text:string entities:Vector min_age_confirm:flags.1?int = help.TermsOfService;\nmessages.savedGifsNotModified#e8025ca2 = messages.SavedGifs;\nmessages.savedGifs#2e0709a5 hash:int gifs:Vector = messages.SavedGifs;\ninputBotInlineMessageMediaAuto#3380c786 flags:# message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaGeo#96929a85 flags:# geo_point:InputGeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaVenue#417bbf11 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaContact#a6edbffd flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaInvoice#d7e78225 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineResult#88bf9319 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?InputWebDocument content:flags.5?InputWebDocument send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultDocument#fff8fdc4 flags:# id:string type:string title:flags.1?string description:flags.2?string document:InputDocument send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultGame#4fa417f2 id:string short_name:string send_message:InputBotInlineMessage = InputBotInlineResult;\nbotInlineMessageMediaAuto#764cf810 flags:# message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaGeo#51846fd flags:# geo:GeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaVenue#8a86659c flags:# geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaContact#18d1cdc2 flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaInvoice#354a9b09 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument currency:string total_amount:long reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineResult#11965f3a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?WebDocument content:flags.5?WebDocument send_message:BotInlineMessage = BotInlineResult;\nbotInlineMediaResult#17db940b flags:# id:string type:string photo:flags.0?Photo document:flags.1?Document title:flags.2?string description:flags.3?string send_message:BotInlineMessage = BotInlineResult;\nmessages.botResults#947ca848 flags:# gallery:flags.0?true query_id:long next_offset:flags.1?string switch_pm:flags.2?InlineBotSwitchPM results:Vector cache_time:int users:Vector = messages.BotResults;\nexportedMessageLink#5dab1af4 link:string html:string = ExportedMessageLink;\nmessageFwdHeader#5f777dce flags:# imported:flags.7?true from_id:flags.0?Peer from_name:flags.5?string date:int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int psa_type:flags.6?string = MessageFwdHeader;\nauth.codeTypeSms#72a3158c = auth.CodeType;\nauth.codeTypeCall#741cd3e3 = auth.CodeType;\nauth.codeTypeFlashCall#226ccefb = auth.CodeType;\nauth.sentCodeTypeApp#3dbb5986 length:int = auth.SentCodeType;\nauth.sentCodeTypeSms#c000bba2 length:int = auth.SentCodeType;\nauth.sentCodeTypeCall#5353e5a7 length:int = auth.SentCodeType;\nauth.sentCodeTypeFlashCall#ab03c6d9 pattern:string = auth.SentCodeType;\nmessages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?true native_ui:flags.4?true message:flags.0?string url:flags.2?string cache_time:int = messages.BotCallbackAnswer;\nmessages.messageEditData#26b5dde6 flags:# caption:flags.0?true = messages.MessageEditData;\ninputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID;\ninlineBotSwitchPM#3c20629f text:string start_param:string = InlineBotSwitchPM;\nmessages.peerDialogs#3371c354 dialogs:Vector messages:Vector chats:Vector users:Vector state:updates.State = messages.PeerDialogs;\ntopPeer#edcdc05b peer:Peer rating:double = TopPeer;\ntopPeerCategoryBotsPM#ab661b5b = TopPeerCategory;\ntopPeerCategoryBotsInline#148677e2 = TopPeerCategory;\ntopPeerCategoryCorrespondents#637b7ed = TopPeerCategory;\ntopPeerCategoryGroups#bd17a14a = TopPeerCategory;\ntopPeerCategoryChannels#161d9628 = TopPeerCategory;\ntopPeerCategoryPhoneCalls#1e76a78c = TopPeerCategory;\ntopPeerCategoryForwardUsers#a8406ca9 = TopPeerCategory;\ntopPeerCategoryForwardChats#fbeec0f0 = TopPeerCategory;\ntopPeerCategoryPeers#fb834291 category:TopPeerCategory count:int peers:Vector = TopPeerCategoryPeers;\ncontacts.topPeersNotModified#de266ef5 = contacts.TopPeers;\ncontacts.topPeers#70b772a8 categories:Vector chats:Vector users:Vector = contacts.TopPeers;\ncontacts.topPeersDisabled#b52c939d = contacts.TopPeers;\ndraftMessageEmpty#1b0c841a flags:# date:flags.0?int = DraftMessage;\ndraftMessage#fd8e711f flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int message:string entities:flags.3?Vector date:int = DraftMessage;\nmessages.featuredStickersNotModified#c6dc0c66 count:int = messages.FeaturedStickers;\nmessages.featuredStickers#b6abc341 hash:int count:int sets:Vector unread:Vector = messages.FeaturedStickers;\nmessages.recentStickersNotModified#b17f890 = messages.RecentStickers;\nmessages.recentStickers#22f3afb3 hash:int packs:Vector stickers:Vector dates:Vector = messages.RecentStickers;\nmessages.archivedStickers#4fcba9c8 count:int sets:Vector = messages.ArchivedStickers;\nmessages.stickerSetInstallResultSuccess#38641628 = messages.StickerSetInstallResult;\nmessages.stickerSetInstallResultArchive#35e410a8 sets:Vector = messages.StickerSetInstallResult;\nstickerSetCovered#6410a5d2 set:StickerSet cover:Document = StickerSetCovered;\nstickerSetMultiCovered#3407e51b set:StickerSet covers:Vector = StickerSetCovered;\nmaskCoords#aed6dbb2 n:int x:double y:double zoom:double = MaskCoords;\ninputStickeredMediaPhoto#4a992157 id:InputPhoto = InputStickeredMedia;\ninputStickeredMediaDocument#438865b id:InputDocument = InputStickeredMedia;\ngame#bdf9653b flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document = Game;\ninputGameID#32c3e77 id:long access_hash:long = InputGame;\ninputGameShortName#c331e80a bot_id:InputUser short_name:string = InputGame;\nhighScore#58fffcd0 pos:int user_id:int score:int = HighScore;\nmessages.highScores#9a3bfd99 scores:Vector users:Vector = messages.HighScores;\ntextEmpty#dc3d824f = RichText;\ntextPlain#744694e0 text:string = RichText;\ntextBold#6724abc4 text:RichText = RichText;\ntextItalic#d912a59c text:RichText = RichText;\ntextUnderline#c12622c4 text:RichText = RichText;\ntextStrike#9bf8bb95 text:RichText = RichText;\ntextFixed#6c3f19b9 text:RichText = RichText;\ntextUrl#3c2884c1 text:RichText url:string webpage_id:long = RichText;\ntextEmail#de5a0dd6 text:RichText email:string = RichText;\ntextConcat#7e6260d7 texts:Vector = RichText;\ntextSubscript#ed6a8504 text:RichText = RichText;\ntextSuperscript#c7fb5e01 text:RichText = RichText;\ntextMarked#34b8621 text:RichText = RichText;\ntextPhone#1ccb966a text:RichText phone:string = RichText;\ntextImage#81ccf4f document_id:long w:int h:int = RichText;\ntextAnchor#35553762 text:RichText name:string = RichText;\npageBlockUnsupported#13567e8a = PageBlock;\npageBlockTitle#70abc3fd text:RichText = PageBlock;\npageBlockSubtitle#8ffa9a1f text:RichText = PageBlock;\npageBlockAuthorDate#baafe5e0 author:RichText published_date:int = PageBlock;\npageBlockHeader#bfd064ec text:RichText = PageBlock;\npageBlockSubheader#f12bb6e1 text:RichText = PageBlock;\npageBlockParagraph#467a0766 text:RichText = PageBlock;\npageBlockPreformatted#c070d93e text:RichText language:string = PageBlock;\npageBlockFooter#48870999 text:RichText = PageBlock;\npageBlockDivider#db20b188 = PageBlock;\npageBlockAnchor#ce0d37b0 name:string = PageBlock;\npageBlockList#e4e88011 items:Vector = PageBlock;\npageBlockBlockquote#263d7c26 text:RichText caption:RichText = PageBlock;\npageBlockPullquote#4f4456d3 text:RichText caption:RichText = PageBlock;\npageBlockPhoto#1759c560 flags:# photo_id:long caption:PageCaption url:flags.0?string webpage_id:flags.0?long = PageBlock;\npageBlockVideo#7c8fe7b6 flags:# autoplay:flags.0?true loop:flags.1?true video_id:long caption:PageCaption = PageBlock;\npageBlockCover#39f23300 cover:PageBlock = PageBlock;\npageBlockEmbed#a8718dc5 flags:# full_width:flags.0?true allow_scrolling:flags.3?true url:flags.1?string html:flags.2?string poster_photo_id:flags.4?long w:flags.5?int h:flags.5?int caption:PageCaption = PageBlock;\npageBlockEmbedPost#f259a80b url:string webpage_id:long author_photo_id:long author:string date:int blocks:Vector caption:PageCaption = PageBlock;\npageBlockCollage#65a0fa4d items:Vector caption:PageCaption = PageBlock;\npageBlockSlideshow#31f9590 items:Vector caption:PageCaption = PageBlock;\npageBlockChannel#ef1751b5 channel:Chat = PageBlock;\npageBlockAudio#804361ea audio_id:long caption:PageCaption = PageBlock;\npageBlockKicker#1e148390 text:RichText = PageBlock;\npageBlockTable#bf4dea82 flags:# bordered:flags.0?true striped:flags.1?true title:RichText rows:Vector = PageBlock;\npageBlockOrderedList#9a8ae1e1 items:Vector = PageBlock;\npageBlockDetails#76768bed flags:# open:flags.0?true blocks:Vector title:RichText = PageBlock;\npageBlockRelatedArticles#16115a96 title:RichText articles:Vector = PageBlock;\npageBlockMap#a44f3ef6 geo:GeoPoint zoom:int w:int h:int caption:PageCaption = PageBlock;\nphoneCallDiscardReasonMissed#85e42301 = PhoneCallDiscardReason;\nphoneCallDiscardReasonDisconnect#e095c1a0 = PhoneCallDiscardReason;\nphoneCallDiscardReasonHangup#57adc690 = PhoneCallDiscardReason;\nphoneCallDiscardReasonBusy#faf7e8c9 = PhoneCallDiscardReason;\ndataJSON#7d748d04 data:string = DataJSON;\nlabeledPrice#cb296bf8 label:string amount:long = LabeledPrice;\ninvoice#cd886e0 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true currency:string prices:Vector max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector = Invoice;\npaymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge;\npostAddress#1e8caaeb street_line1:string street_line2:string city:string state:string country_iso2:string post_code:string = PostAddress;\npaymentRequestedInfo#909c3f94 flags:# name:flags.0?string phone:flags.1?string email:flags.2?string shipping_address:flags.3?PostAddress = PaymentRequestedInfo;\npaymentSavedCredentialsCard#cdc27a1f id:string title:string = PaymentSavedCredentials;\nwebDocument#1c570ed1 url:string access_hash:long size:int mime_type:string attributes:Vector = WebDocument;\nwebDocumentNoProxy#f9c8bcc6 url:string size:int mime_type:string attributes:Vector = WebDocument;\ninputWebDocument#9bed434d url:string size:int mime_type:string attributes:Vector = InputWebDocument;\ninputWebFileLocation#c239d686 url:string access_hash:long = InputWebFileLocation;\ninputWebFileGeoPointLocation#9f2221c9 geo_point:InputGeoPoint access_hash:long w:int h:int zoom:int scale:int = InputWebFileLocation;\nupload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile;\npayments.paymentForm#8d0b2415 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector = payments.PaymentForm;\npayments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector = payments.ValidatedRequestedInfo;\npayments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult;\npayments.paymentVerificationNeeded#d8411139 url:string = payments.PaymentResult;\npayments.paymentReceipt#10b555d0 flags:# date:int bot_id:int provider_id:int title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector = payments.PaymentReceipt;\npayments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo;\ninputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;\ninputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;\ninputPaymentCredentialsApplePay#aa1c39f payment_data:DataJSON = InputPaymentCredentials;\ninputPaymentCredentialsGooglePay#8ac32801 payment_token:DataJSON = InputPaymentCredentials;\naccount.tmpPassword#db64fd34 tmp_password:bytes valid_until:int = account.TmpPassword;\nshippingOption#b6213cdf id:string title:string prices:Vector = ShippingOption;\ninputStickerSetItem#ffa0a496 flags:# document:InputDocument emoji:string mask_coords:flags.0?MaskCoords = InputStickerSetItem;\ninputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall;\nphoneCallEmpty#5366c915 id:long = PhoneCall;\nphoneCallWaiting#1b8f4ad1 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall;\nphoneCallRequested#87eabb53 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall;\nphoneCallAccepted#997c454a flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_b:bytes protocol:PhoneCallProtocol = PhoneCall;\nphoneCall#8742ae7f flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector start_date:int = PhoneCall;\nphoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall;\nphoneConnection#9d4c17c0 id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection;\nphoneConnectionWebrtc#635fe375 flags:# turn:flags.0?true stun:flags.1?true id:long ip:string ipv6:string port:int username:string password:string = PhoneConnection;\nphoneCallProtocol#fc878fc8 flags:# udp_p2p:flags.0?true udp_reflector:flags.1?true min_layer:int max_layer:int library_versions:Vector = PhoneCallProtocol;\nphone.phoneCall#ec82e140 phone_call:PhoneCall users:Vector = phone.PhoneCall;\nupload.cdnFileReuploadNeeded#eea8e46e request_token:bytes = upload.CdnFile;\nupload.cdnFile#a99fca4f bytes:bytes = upload.CdnFile;\ncdnPublicKey#c982eaba dc_id:int public_key:string = CdnPublicKey;\ncdnConfig#5725e40a public_keys:Vector = CdnConfig;\nlangPackString#cad181f6 key:string value:string = LangPackString;\nlangPackStringPluralized#6c47ac9f flags:# key:string zero_value:flags.0?string one_value:flags.1?string two_value:flags.2?string few_value:flags.3?string many_value:flags.4?string other_value:string = LangPackString;\nlangPackStringDeleted#2979eeb2 key:string = LangPackString;\nlangPackDifference#f385c1f6 lang_code:string from_version:int version:int strings:Vector = LangPackDifference;\nlangPackLanguage#eeca5ce3 flags:# official:flags.0?true rtl:flags.2?true beta:flags.3?true name:string native_name:string lang_code:string base_lang_code:flags.1?string plural_code:string strings_count:int translated_count:int translations_url:string = LangPackLanguage;\nchannelAdminLogEventActionChangeTitle#e6dfb825 prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeAbout#55188a2e prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeUsername#6a4afc38 prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangePhoto#434bd2af prev_photo:Photo new_photo:Photo = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleInvites#1b7907ae new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleSignatures#26ae0971 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionUpdatePinned#e9e82c18 message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionEditMessage#709b2405 prev_message:Message new_message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDeleteMessage#42e047bb message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantJoin#183040d3 = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantLeave#f89777f2 = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantInvite#e31c34d8 participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantToggleBan#e6d83d7e prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantToggleAdmin#d5676710 prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeStickerSet#b1c3caa7 prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction;\nchannelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDefaultBannedRights#2df5fc0a prev_banned_rights:ChatBannedRights new_banned_rights:ChatBannedRights = ChannelAdminLogEventAction;\nchannelAdminLogEventActionStopPoll#8f079643 message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeLinkedChat#a26f881b prev_value:int new_value:int = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeLocation#e6b76ae prev_value:ChannelLocation new_value:ChannelLocation = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleSlowMode#53909779 prev_value:int new_value:int = ChannelAdminLogEventAction;\nchannelAdminLogEventActionStartGroupCall#23209745 call:InputGroupCall = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDiscardGroupCall#db9f9140 call:InputGroupCall = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantMute#f92424d2 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantUnmute#e64429c0 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleGroupCallSetting#56d6a247 join_muted:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantJoinByInvite#5cdada77 invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteDelete#5a50fca4 invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantVolume#3e7f6847 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeHistoryTTL#6e941a38 prev_value:int new_value:int = ChannelAdminLogEventAction;\nchannelAdminLogEvent#3b5a3e40 id:long date:int user_id:int action:ChannelAdminLogEventAction = ChannelAdminLogEvent;\nchannels.adminLogResults#ed8af74d events:Vector chats:Vector users:Vector = channels.AdminLogResults;\nchannelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true = ChannelAdminLogEventsFilter;\npopularContact#5ce14175 client_id:long importers:int = PopularContact;\nmessages.favedStickersNotModified#9e8fa6d3 = messages.FavedStickers;\nmessages.favedStickers#f37f2f16 hash:int packs:Vector stickers:Vector = messages.FavedStickers;\nrecentMeUrlUnknown#46e1d13d url:string = RecentMeUrl;\nrecentMeUrlUser#8dbc3336 url:string user_id:int = RecentMeUrl;\nrecentMeUrlChat#a01b22f9 url:string chat_id:int = RecentMeUrl;\nrecentMeUrlChatInvite#eb49081d url:string chat_invite:ChatInvite = RecentMeUrl;\nrecentMeUrlStickerSet#bc0a57dc url:string set:StickerSetCovered = RecentMeUrl;\nhelp.recentMeUrls#e0310d7 urls:Vector chats:Vector users:Vector = help.RecentMeUrls;\ninputSingleMedia#1cc6e91f flags:# media:InputMedia random_id:long message:string entities:flags.0?Vector = InputSingleMedia;\nwebAuthorization#cac943f2 hash:long bot_id:int domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization;\naccount.webAuthorizations#ed56c9fc authorizations:Vector users:Vector = account.WebAuthorizations;\ninputMessageID#a676a322 id:int = InputMessage;\ninputMessageReplyTo#bad88395 id:int = InputMessage;\ninputMessagePinned#86872538 = InputMessage;\ninputMessageCallbackQuery#acfa1a7e id:int query_id:long = InputMessage;\ninputDialogPeer#fcaafeb7 peer:InputPeer = InputDialogPeer;\ninputDialogPeerFolder#64600527 folder_id:int = InputDialogPeer;\ndialogPeer#e56dbf05 peer:Peer = DialogPeer;\ndialogPeerFolder#514519e2 folder_id:int = DialogPeer;\nmessages.foundStickerSetsNotModified#d54b65d = messages.FoundStickerSets;\nmessages.foundStickerSets#5108d648 hash:int sets:Vector = messages.FoundStickerSets;\nfileHash#6242c773 offset:int limit:int hash:bytes = FileHash;\ninputClientProxy#75588b3f address:string port:int = InputClientProxy;\nhelp.termsOfServiceUpdateEmpty#e3309f7f expires:int = help.TermsOfServiceUpdate;\nhelp.termsOfServiceUpdate#28ecf961 expires:int terms_of_service:help.TermsOfService = help.TermsOfServiceUpdate;\ninputSecureFileUploaded#3334b0f0 id:long parts:int md5_checksum:string file_hash:bytes secret:bytes = InputSecureFile;\ninputSecureFile#5367e5be id:long access_hash:long = InputSecureFile;\nsecureFileEmpty#64199744 = SecureFile;\nsecureFile#e0277a62 id:long access_hash:long size:int dc_id:int date:int file_hash:bytes secret:bytes = SecureFile;\nsecureData#8aeabec3 data:bytes data_hash:bytes secret:bytes = SecureData;\nsecurePlainPhone#7d6099dd phone:string = SecurePlainData;\nsecurePlainEmail#21ec5a5f email:string = SecurePlainData;\nsecureValueTypePersonalDetails#9d2a81e3 = SecureValueType;\nsecureValueTypePassport#3dac6a00 = SecureValueType;\nsecureValueTypeDriverLicense#6e425c4 = SecureValueType;\nsecureValueTypeIdentityCard#a0d0744b = SecureValueType;\nsecureValueTypeInternalPassport#99a48f23 = SecureValueType;\nsecureValueTypeAddress#cbe31e26 = SecureValueType;\nsecureValueTypeUtilityBill#fc36954e = SecureValueType;\nsecureValueTypeBankStatement#89137c0d = SecureValueType;\nsecureValueTypeRentalAgreement#8b883488 = SecureValueType;\nsecureValueTypePassportRegistration#99e3806a = SecureValueType;\nsecureValueTypeTemporaryRegistration#ea02ec33 = SecureValueType;\nsecureValueTypePhone#b320aadb = SecureValueType;\nsecureValueTypeEmail#8e3ca7ee = SecureValueType;\nsecureValue#187fa0ca flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?SecureFile reverse_side:flags.2?SecureFile selfie:flags.3?SecureFile translation:flags.6?Vector files:flags.4?Vector plain_data:flags.5?SecurePlainData hash:bytes = SecureValue;\ninputSecureValue#db21d0a7 flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?InputSecureFile reverse_side:flags.2?InputSecureFile selfie:flags.3?InputSecureFile translation:flags.6?Vector files:flags.4?Vector plain_data:flags.5?SecurePlainData = InputSecureValue;\nsecureValueHash#ed1ecdb0 type:SecureValueType hash:bytes = SecureValueHash;\nsecureValueErrorData#e8a40bd9 type:SecureValueType data_hash:bytes field:string text:string = SecureValueError;\nsecureValueErrorFrontSide#be3dfa type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorReverseSide#868a2aa5 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorSelfie#e537ced6 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorFile#7a700873 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorFiles#666220e9 type:SecureValueType file_hash:Vector text:string = SecureValueError;\nsecureValueError#869d758f type:SecureValueType hash:bytes text:string = SecureValueError;\nsecureValueErrorTranslationFile#a1144770 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorTranslationFiles#34636dd8 type:SecureValueType file_hash:Vector text:string = SecureValueError;\nsecureCredentialsEncrypted#33f0ea47 data:bytes hash:bytes secret:bytes = SecureCredentialsEncrypted;\naccount.authorizationForm#ad2e1cd8 flags:# required_types:Vector values:Vector errors:Vector users:Vector privacy_policy_url:flags.0?string = account.AuthorizationForm;\naccount.sentEmailCode#811f854f email_pattern:string length:int = account.SentEmailCode;\nhelp.deepLinkInfoEmpty#66afa166 = help.DeepLinkInfo;\nhelp.deepLinkInfo#6a4ee832 flags:# update_app:flags.0?true message:string entities:flags.1?Vector = help.DeepLinkInfo;\nsavedPhoneContact#1142bd56 phone:string first_name:string last_name:string date:int = SavedContact;\naccount.takeout#4dba4501 id:long = account.Takeout;\npasswordKdfAlgoUnknown#d45ab096 = PasswordKdfAlgo;\npasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow#3a912d4a salt1:bytes salt2:bytes g:int p:bytes = PasswordKdfAlgo;\nsecurePasswordKdfAlgoUnknown#4a8537 = SecurePasswordKdfAlgo;\nsecurePasswordKdfAlgoPBKDF2HMACSHA512iter100000#bbf2dda0 salt:bytes = SecurePasswordKdfAlgo;\nsecurePasswordKdfAlgoSHA512#86471d92 salt:bytes = SecurePasswordKdfAlgo;\nsecureSecretSettings#1527bcac secure_algo:SecurePasswordKdfAlgo secure_secret:bytes secure_secret_id:long = SecureSecretSettings;\ninputCheckPasswordEmpty#9880f658 = InputCheckPasswordSRP;\ninputCheckPasswordSRP#d27ff082 srp_id:long A:bytes M1:bytes = InputCheckPasswordSRP;\nsecureRequiredType#829d99da flags:# native_names:flags.0?true selfie_required:flags.1?true translation_required:flags.2?true type:SecureValueType = SecureRequiredType;\nsecureRequiredTypeOneOf#27477b4 types:Vector = SecureRequiredType;\nhelp.passportConfigNotModified#bfb9f457 = help.PassportConfig;\nhelp.passportConfig#a098d6af hash:int countries_langs:DataJSON = help.PassportConfig;\ninputAppEvent#1d1b1245 time:double type:string peer:long data:JSONValue = InputAppEvent;\njsonObjectValue#c0de1bd9 key:string value:JSONValue = JSONObjectValue;\njsonNull#3f6d7b68 = JSONValue;\njsonBool#c7345e6a value:Bool = JSONValue;\njsonNumber#2be0dfa4 value:double = JSONValue;\njsonString#b71e767a value:string = JSONValue;\njsonArray#f7444763 value:Vector = JSONValue;\njsonObject#99c1d49d value:Vector = JSONValue;\npageTableCell#34566b6a flags:# header:flags.0?true align_center:flags.3?true align_right:flags.4?true valign_middle:flags.5?true valign_bottom:flags.6?true text:flags.7?RichText colspan:flags.1?int rowspan:flags.2?int = PageTableCell;\npageTableRow#e0c0c5e5 cells:Vector = PageTableRow;\npageCaption#6f747657 text:RichText credit:RichText = PageCaption;\npageListItemText#b92fb6cd text:RichText = PageListItem;\npageListItemBlocks#25e073fc blocks:Vector = PageListItem;\npageListOrderedItemText#5e068047 num:string text:RichText = PageListOrderedItem;\npageListOrderedItemBlocks#98dd8936 num:string blocks:Vector = PageListOrderedItem;\npageRelatedArticle#b390dc08 flags:# url:string webpage_id:long title:flags.0?string description:flags.1?string photo_id:flags.2?long author:flags.3?string published_date:flags.4?int = PageRelatedArticle;\npage#98657f0d flags:# part:flags.0?true rtl:flags.1?true v2:flags.2?true url:string blocks:Vector photos:Vector documents:Vector views:flags.3?int = Page;\nhelp.supportName#8c05f1c9 name:string = help.SupportName;\nhelp.userInfoEmpty#f3ae2eed = help.UserInfo;\nhelp.userInfo#1eb3758 message:string entities:Vector author:string date:int = help.UserInfo;\npollAnswer#6ca9c2e9 text:string option:bytes = PollAnswer;\npoll#86e18161 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true question:string answers:Vector close_period:flags.4?int close_date:flags.5?int = Poll;\npollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters;\npollResults#badcc1a3 flags:# min:flags.0?true results:flags.1?Vector total_voters:flags.2?int recent_voters:flags.3?Vector solution:flags.4?string solution_entities:flags.4?Vector = PollResults;\nchatOnlines#f041e250 onlines:int = ChatOnlines;\nstatsURL#47a971e0 url:string = StatsURL;\nchatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true = ChatAdminRights;\nchatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true send_polls:flags.8?true change_info:flags.10?true invite_users:flags.15?true pin_messages:flags.17?true until_date:int = ChatBannedRights;\ninputWallPaper#e630b979 id:long access_hash:long = InputWallPaper;\ninputWallPaperSlug#72091c80 slug:string = InputWallPaper;\ninputWallPaperNoFile#967a462e id:long = InputWallPaper;\naccount.wallPapersNotModified#1c199183 = account.WallPapers;\naccount.wallPapers#702b65a9 hash:int wallpapers:Vector = account.WallPapers;\ncodeSettings#debebe83 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true = CodeSettings;\nwallPaperSettings#1dc1bca4 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int third_background_color:flags.5?int fourth_background_color:flags.6?int intensity:flags.3?int rotation:flags.4?int = WallPaperSettings;\nautoDownloadSettings#e04232f3 flags:# disabled:flags.0?true video_preload_large:flags.1?true audio_preload_next:flags.2?true phonecalls_less_data:flags.3?true photo_size_max:int video_size_max:int file_size_max:int video_upload_maxbitrate:int = AutoDownloadSettings;\naccount.autoDownloadSettings#63cacf26 low:AutoDownloadSettings medium:AutoDownloadSettings high:AutoDownloadSettings = account.AutoDownloadSettings;\nemojiKeyword#d5b3b9f9 keyword:string emoticons:Vector = EmojiKeyword;\nemojiKeywordDeleted#236df622 keyword:string emoticons:Vector = EmojiKeyword;\nemojiKeywordsDifference#5cc761bd lang_code:string from_version:int version:int keywords:Vector = EmojiKeywordsDifference;\nemojiURL#a575739d url:string = EmojiURL;\nemojiLanguage#b3fb5361 lang_code:string = EmojiLanguage;\nfolder#ff544e65 flags:# autofill_new_broadcasts:flags.0?true autofill_public_groups:flags.1?true autofill_new_correspondents:flags.2?true id:int title:string photo:flags.3?ChatPhoto = Folder;\ninputFolderPeer#fbd2c296 peer:InputPeer folder_id:int = InputFolderPeer;\nfolderPeer#e9baa668 peer:Peer folder_id:int = FolderPeer;\nmessages.searchCounter#e844ebff flags:# inexact:flags.1?true filter:MessagesFilter count:int = messages.SearchCounter;\nurlAuthResultRequest#92d33a0e flags:# request_write_access:flags.0?true bot:User domain:string = UrlAuthResult;\nurlAuthResultAccepted#8f8c0e4e url:string = UrlAuthResult;\nurlAuthResultDefault#a9d6db1f = UrlAuthResult;\nchannelLocationEmpty#bfb5ad8b = ChannelLocation;\nchannelLocation#209b82db geo_point:GeoPoint address:string = ChannelLocation;\npeerLocated#ca461b5d peer:Peer expires:int distance:int = PeerLocated;\npeerSelfLocated#f8ec284b expires:int = PeerLocated;\nrestrictionReason#d072acb4 platform:string reason:string text:string = RestrictionReason;\ninputTheme#3c5693e9 id:long access_hash:long = InputTheme;\ninputThemeSlug#f5890df1 slug:string = InputTheme;\ntheme#28f1114 flags:# creator:flags.0?true default:flags.1?true id:long access_hash:long slug:string title:string document:flags.2?Document settings:flags.3?ThemeSettings installs_count:int = Theme;\naccount.themesNotModified#f41eb622 = account.Themes;\naccount.themes#7f676421 hash:int themes:Vector = account.Themes;\nauth.loginToken#629f1980 expires:int token:bytes = auth.LoginToken;\nauth.loginTokenMigrateTo#68e9916 dc_id:int token:bytes = auth.LoginToken;\nauth.loginTokenSuccess#390d5c5e authorization:auth.Authorization = auth.LoginToken;\naccount.contentSettings#57e28221 flags:# sensitive_enabled:flags.0?true sensitive_can_change:flags.1?true = account.ContentSettings;\nmessages.inactiveChats#a927fec5 dates:Vector chats:Vector users:Vector = messages.InactiveChats;\nbaseThemeClassic#c3a12462 = BaseTheme;\nbaseThemeDay#fbd81688 = BaseTheme;\nbaseThemeNight#b7b31ea8 = BaseTheme;\nbaseThemeTinted#6d5f77ee = BaseTheme;\nbaseThemeArctic#5b11125a = BaseTheme;\ninputThemeSettings#bd507cd1 flags:# base_theme:BaseTheme accent_color:int message_top_color:flags.0?int message_bottom_color:flags.0?int wallpaper:flags.1?InputWallPaper wallpaper_settings:flags.1?WallPaperSettings = InputThemeSettings;\nthemeSettings#9c14984a flags:# base_theme:BaseTheme accent_color:int message_top_color:flags.0?int message_bottom_color:flags.0?int wallpaper:flags.1?WallPaper = ThemeSettings;\nwebPageAttributeTheme#54b56617 flags:# documents:flags.0?Vector settings:flags.1?ThemeSettings = WebPageAttribute;\nmessageUserVote#a28e5559 user_id:int option:bytes date:int = MessageUserVote;\nmessageUserVoteInputOption#36377430 user_id:int date:int = MessageUserVote;\nmessageUserVoteMultiple#e8fe0de user_id:int options:Vector date:int = MessageUserVote;\nmessages.votesList#823f649 flags:# count:int votes:Vector users:Vector next_offset:flags.0?string = messages.VotesList;\nbankCardOpenUrl#f568028a url:string name:string = BankCardOpenUrl;\npayments.bankCardData#3e24e573 title:string open_urls:Vector = payments.BankCardData;\ndialogFilter#7438f7e8 flags:# contacts:flags.0?true non_contacts:flags.1?true groups:flags.2?true broadcasts:flags.3?true bots:flags.4?true exclude_muted:flags.11?true exclude_read:flags.12?true exclude_archived:flags.13?true id:int title:string emoticon:flags.25?string pinned_peers:Vector include_peers:Vector exclude_peers:Vector = DialogFilter;\ndialogFilterSuggested#77744d4a filter:DialogFilter description:string = DialogFilterSuggested;\nstatsDateRangeDays#b637edaf min_date:int max_date:int = StatsDateRangeDays;\nstatsAbsValueAndPrev#cb43acde current:double previous:double = StatsAbsValueAndPrev;\nstatsPercentValue#cbce2fe0 part:double total:double = StatsPercentValue;\nstatsGraphAsync#4a27eb2d token:string = StatsGraph;\nstatsGraphError#bedc9822 error:string = StatsGraph;\nstatsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph;\nmessageInteractionCounters#ad4fc9bd msg_id:int views:int forwards:int = MessageInteractionCounters;\nstats.broadcastStats#bdf78394 period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post:StatsAbsValueAndPrev enabled_notifications:StatsPercentValue growth_graph:StatsGraph followers_graph:StatsGraph mute_graph:StatsGraph top_hours_graph:StatsGraph interactions_graph:StatsGraph iv_interactions_graph:StatsGraph views_by_source_graph:StatsGraph new_followers_by_source_graph:StatsGraph languages_graph:StatsGraph recent_message_interactions:Vector = stats.BroadcastStats;\nhelp.promoDataEmpty#98f6ac75 expires:int = help.PromoData;\nhelp.promoData#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:Vector users:Vector psa_type:flags.1?string psa_message:flags.2?string = help.PromoData;\nvideoSize#de33b094 flags:# type:string w:int h:int size:int video_start_ts:flags.0?double = VideoSize;\nstatsGroupTopPoster#18f3d0f7 user_id:int messages:int avg_chars:int = StatsGroupTopPoster;\nstatsGroupTopAdmin#6014f412 user_id:int deleted:int kicked:int banned:int = StatsGroupTopAdmin;\nstatsGroupTopInviter#31962a4c user_id:int invitations:int = StatsGroupTopInviter;\nstats.megagroupStats#ef7ff916 period:StatsDateRangeDays members:StatsAbsValueAndPrev messages:StatsAbsValueAndPrev viewers:StatsAbsValueAndPrev posters:StatsAbsValueAndPrev growth_graph:StatsGraph members_graph:StatsGraph new_members_by_source_graph:StatsGraph languages_graph:StatsGraph messages_graph:StatsGraph actions_graph:StatsGraph top_hours_graph:StatsGraph weekdays_graph:StatsGraph top_posters:Vector top_admins:Vector top_inviters:Vector users:Vector = stats.MegagroupStats;\nglobalPrivacySettings#bea2f424 flags:# archive_and_mute_new_noncontact_peers:flags.0?Bool = GlobalPrivacySettings;\nhelp.countryCode#4203c5ef flags:# country_code:string prefixes:flags.0?Vector patterns:flags.1?Vector = help.CountryCode;\nhelp.country#c3878e23 flags:# hidden:flags.0?true iso2:string default_name:string name:flags.1?string country_codes:Vector = help.Country;\nhelp.countriesListNotModified#93cc1f32 = help.CountriesList;\nhelp.countriesList#87d0759e countries:Vector hash:int = help.CountriesList;\nmessageViews#455b853d flags:# views:flags.0?int forwards:flags.1?int replies:flags.2?MessageReplies = MessageViews;\nmessages.messageViews#b6c4f543 views:Vector chats:Vector users:Vector = messages.MessageViews;\nmessages.discussionMessage#f5dd8f9d flags:# messages:Vector max_id:flags.0?int read_inbox_max_id:flags.1?int read_outbox_max_id:flags.2?int chats:Vector users:Vector = messages.DiscussionMessage;\nmessageReplyHeader#a6d57763 flags:# reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader;\nmessageReplies#4128faac flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector channel_id:flags.0?int max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;\npeerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked;\nstats.messageStats#8999f295 views_graph:StatsGraph = stats.MessageStats;\ngroupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall;\ngroupCall#d597650c flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int = GroupCall;\ninputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;\ngroupCallParticipant#eba636fe flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo = GroupCallParticipant;\nphone.groupCall#9e727aad call:GroupCall participants:Vector participants_next_offset:string chats:Vector users:Vector = phone.GroupCall;\nphone.groupParticipants#f47751b6 count:int participants:Vector next_offset:string chats:Vector users:Vector version:int = phone.GroupParticipants;\ninlineQueryPeerTypeSameBotPM#3081ed9d = InlineQueryPeerType;\ninlineQueryPeerTypePM#833c0fac = InlineQueryPeerType;\ninlineQueryPeerTypeChat#d766c50a = InlineQueryPeerType;\ninlineQueryPeerTypeMegagroup#5ec4be43 = InlineQueryPeerType;\ninlineQueryPeerTypeBroadcast#6334ee9a = InlineQueryPeerType;\nmessages.historyImport#1662af0b id:long = messages.HistoryImport;\nmessages.historyImportParsed#5e0fb7b9 flags:# pm:flags.0?true group:flags.1?true title:flags.2?string = messages.HistoryImportParsed;\nmessages.affectedFoundMessages#ef8d3e6c pts:int pts_count:int offset:int messages:Vector = messages.AffectedFoundMessages;\nchatInviteImporter#1e3e6680 user_id:int date:int = ChatInviteImporter;\nmessages.exportedChatInvites#bdc62dcc count:int invites:Vector users:Vector = messages.ExportedChatInvites;\nmessages.exportedChatInvite#1871be50 invite:ExportedChatInvite users:Vector = messages.ExportedChatInvite;\nmessages.exportedChatInviteReplaced#222600ef invite:ExportedChatInvite new_invite:ExportedChatInvite users:Vector = messages.ExportedChatInvite;\nmessages.chatInviteImporters#81b6b00a count:int importers:Vector users:Vector = messages.ChatInviteImporters;\nchatAdminWithInvites#dfd2330f admin_id:int invites_count:int revoked_invites_count:int = ChatAdminWithInvites;\nmessages.chatAdminsWithInvites#b69b72d7 admins:Vector users:Vector = messages.ChatAdminsWithInvites;\nmessages.checkedHistoryImportPeer#a24de717 confirm_text:string = messages.CheckedHistoryImportPeer;\nphone.joinAsPeers#afe5623f peers:Vector chats:Vector users:Vector = phone.JoinAsPeers;\nphone.exportedGroupCallInvite#204bd158 link:string = phone.ExportedGroupCallInvite;\ngroupCallParticipantVideoSourceGroup#dcb118b7 semantics:string sources:Vector = GroupCallParticipantVideoSourceGroup;\ngroupCallParticipantVideo#67753ac8 flags:# paused:flags.0?true endpoint:string source_groups:Vector audio_source:flags.1?int = GroupCallParticipantVideo;\nstickers.suggestedShortName#85fea03f short_name:string = stickers.SuggestedShortName;\nbotCommandScopeDefault#2f6cb2ab = BotCommandScope;\nbotCommandScopeUsers#3c4f04d8 = BotCommandScope;\nbotCommandScopeChats#6fe1a881 = BotCommandScope;\nbotCommandScopeChatAdmins#b9aa606a = BotCommandScope;\nbotCommandScopePeer#db9d897d peer:InputPeer = BotCommandScope;\nbotCommandScopePeerAdmins#3fd863d1 peer:InputPeer = BotCommandScope;\nbotCommandScopePeerUser#a1321f3 peer:InputPeer user_id:InputUser = BotCommandScope;\naccount.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordResult;\naccount.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult;\naccount.resetPasswordOk#e926d63e = account.ResetPasswordResult;\n---functions---\ninitConnection#c1cd5ea9 {X:Type} flags:# api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string proxy:flags.0?InputClientProxy params:flags.1?JSONValue query:!X = X;\ninvokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;\nauth.sendCode#a677244f phone_number:string api_id:int api_hash:string settings:CodeSettings = auth.SentCode;\nauth.signUp#80eee427 phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization;\nauth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;\nauth.logOut#5717da40 = Bool;\nauth.resetAuthorizations#9fab0d1a = Bool;\nauth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;\nauth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;\nauth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;\nauth.checkPassword#d18b4d16 password:InputCheckPasswordSRP = auth.Authorization;\nauth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery;\nauth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode;\nauth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool;\nauth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector = Bool;\nauth.exportLoginToken#b1b41517 api_id:int api_hash:string except_ids:Vector = auth.LoginToken;\nauth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken;\naccount.registerDevice#68976c6f flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector = Bool;\naccount.unregisterDevice#3076c4bf token_type:int token:string other_uids:Vector = Bool;\naccount.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;\naccount.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;\naccount.updateProfile#78515775 flags:# first_name:flags.0?string last_name:flags.1?string about:flags.2?string = User;\naccount.updateStatus#6628562c offline:Bool = Bool;\naccount.getWallPapers#aabb1763 hash:int = account.WallPapers;\naccount.checkUsername#2714d86c username:string = Bool;\naccount.updateUsername#3e0bdd7c username:string = User;\naccount.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;\naccount.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector = account.PrivacyRules;\naccount.getAuthorizations#e320c158 = account.Authorizations;\naccount.resetAuthorization#df77f3bc hash:long = Bool;\naccount.getPassword#548a30f5 = account.Password;\naccount.getPasswordSettings#9cd4eaf9 password:InputCheckPasswordSRP = account.PasswordSettings;\naccount.updatePasswordSettings#a59b102f password:InputCheckPasswordSRP new_settings:account.PasswordInputSettings = Bool;\naccount.sendConfirmPhoneCode#1b3faa88 hash:string settings:CodeSettings = auth.SentCode;\naccount.confirmPhone#5f2178c3 phone_code_hash:string phone_code:string = Bool;\naccount.getTmpPassword#449e0b51 password:InputCheckPasswordSRP period:int = account.TmpPassword;\naccount.sendVerifyPhoneCode#a5a356f9 phone_number:string settings:CodeSettings = auth.SentCode;\naccount.confirmPasswordEmail#8fdf1920 code:string = Bool;\naccount.getContactSignUpNotification#9f07c728 = Bool;\naccount.setContactSignUpNotification#cff43f61 silent:Bool = Bool;\naccount.getNotifyExceptions#53577479 flags:# compare_sound:flags.1?true peer:flags.0?InputNotifyPeer = Updates;\naccount.uploadWallPaper#dd853661 file:InputFile mime_type:string settings:WallPaperSettings = WallPaper;\naccount.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool;\naccount.getContentSettings#8b9b4dae = account.ContentSettings;\nusers.getUsers#d91a548 id:Vector = Vector;\nusers.getFullUser#ca30a5b1 id:InputUser = UserFull;\ncontacts.getContacts#c023849f hash:int = contacts.Contacts;\ncontacts.importContacts#2c800be5 contacts:Vector = contacts.ImportedContacts;\ncontacts.deleteContacts#96a0e00 id:Vector = Updates;\ncontacts.block#68cc1411 id:InputPeer = Bool;\ncontacts.unblock#bea65d50 id:InputPeer = Bool;\ncontacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;\ncontacts.search#11f812d8 q:string limit:int = contacts.Found;\ncontacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;\ncontacts.getTopPeers#d4982db5 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:int = contacts.TopPeers;\nmessages.getMessages#63c66506 id:Vector = messages.Messages;\nmessages.getDialogs#a0ee3b73 flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:int = messages.Dialogs;\nmessages.getHistory#dcbb8260 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;\nmessages.search#c352eec flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;\nmessages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages;\nmessages.deleteHistory#1c015b09 flags:# just_clear:flags.0?true revoke:flags.1?true peer:InputPeer max_id:int = messages.AffectedHistory;\nmessages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector = messages.AffectedMessages;\nmessages.receivedMessages#5a954c0 max_id:int = Vector;\nmessages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool;\nmessages.sendMessage#520c3870 flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int = Updates;\nmessages.sendMedia#3491eba9 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int = Updates;\nmessages.forwardMessages#d9fee60e flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true from_peer:InputPeer id:Vector random_id:Vector to_peer:InputPeer schedule_date:flags.10?int = Updates;\nmessages.report#8953ab4e peer:InputPeer id:Vector reason:ReportReason message:string = Bool;\nmessages.getChats#3c6aa187 id:Vector = messages.Chats;\nmessages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;\nmessages.editChatTitle#dc452855 chat_id:int title:string = Updates;\nmessages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates;\nmessages.addChatUser#f9a0aa09 chat_id:int user_id:InputUser fwd_limit:int = Updates;\nmessages.deleteChatUser#c534459a flags:# revoke_history:flags.0?true chat_id:int user_id:InputUser = Updates;\nmessages.createChat#9cb126e users:Vector title:string = Updates;\nmessages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;\nmessages.readMessageContents#36a73f77 id:Vector = messages.AffectedMessages;\nmessages.getStickers#43d4f2c emoticon:string hash:int = messages.Stickers;\nmessages.getAllStickers#1c9618b1 hash:int = messages.AllStickers;\nmessages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector = MessageMedia;\nmessages.exportChatInvite#14b9bcd7 flags:# legacy_revoke_permanent:flags.2?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int = ExportedChatInvite;\nmessages.checkChatInvite#3eadb1bb hash:string = ChatInvite;\nmessages.importChatInvite#6c50051c hash:string = Updates;\nmessages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;\nmessages.installStickerSet#c78fe460 stickerset:InputStickerSet archived:Bool = messages.StickerSetInstallResult;\nmessages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;\nmessages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_param:string = Updates;\nmessages.migrateChat#15a3b8e3 chat_id:int = Updates;\nmessages.searchGlobal#4bc6589a flags:# folder_id:flags.0?int q:string filter:MessagesFilter min_date:int max_date:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;\nmessages.getDocumentByHash#338e2464 sha256:bytes size:int mime_type:string = Document;\nmessages.getSavedGifs#83bf3d52 hash:int = messages.SavedGifs;\nmessages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults;\nmessages.sendInlineBotResult#220815b0 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string schedule_date:flags.10?int = Updates;\nmessages.editMessage#48f71778 flags:# no_webpage:flags.1?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.15?int = Updates;\nmessages.getBotCallbackAnswer#9342ca07 flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes password:flags.2?InputCheckPasswordSRP = messages.BotCallbackAnswer;\nmessages.getPeerDialogs#e470bcfd peers:Vector = messages.PeerDialogs;\nmessages.saveDraft#bc39e14b flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int peer:InputPeer message:string entities:flags.3?Vector = Bool;\nmessages.getFeaturedStickers#2dacca4f hash:int = messages.FeaturedStickers;\nmessages.readFeaturedStickers#5b118126 id:Vector = Bool;\nmessages.getRecentStickers#5ea192c9 flags:# attached:flags.0?true hash:int = messages.RecentStickers;\nmessages.getWebPage#32ca8f91 url:string hash:int = WebPage;\nmessages.toggleDialogPin#a731e257 flags:# pinned:flags.0?true peer:InputDialogPeer = Bool;\nmessages.getPinnedDialogs#d6b94df2 folder_id:int = messages.PeerDialogs;\nmessages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia;\nmessages.getFavedStickers#21ce0b0e hash:int = messages.FavedStickers;\nmessages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool;\nmessages.sendMultiMedia#cc0110cb flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector schedule_date:flags.10?int = Updates;\nmessages.searchStickerSets#c2b7d08b flags:# exclude_featured:flags.0?true q:string hash:int = messages.FoundStickerSets;\nmessages.markDialogUnread#c286d98f flags:# unread:flags.0?true peer:InputDialogPeer = Bool;\nmessages.updatePinnedMessage#d2aaf7ec flags:# silent:flags.0?true unpin:flags.1?true pm_oneside:flags.2?true peer:InputPeer id:int = Updates;\nmessages.sendVote#10ea6184 peer:InputPeer msg_id:int options:Vector = Updates;\nmessages.getOnlines#6e2be050 peer:InputPeer = ChatOnlines;\nmessages.editChatAbout#def60797 peer:InputPeer about:string = Bool;\nmessages.editChatDefaultBannedRights#a5866b41 peer:InputPeer banned_rights:ChatBannedRights = Updates;\nmessages.getEmojiKeywordsDifference#1508b6af lang_code:string from_version:int = EmojiKeywordsDifference;\nmessages.getScheduledHistory#e2c2685b peer:InputPeer hash:int = messages.Messages;\nmessages.sendScheduledMessages#bd38850a peer:InputPeer id:Vector = Updates;\nmessages.deleteScheduledMessages#59ae2b16 peer:InputPeer id:Vector = Updates;\nmessages.getPollVotes#b86e380e flags:# peer:InputPeer id:int option:flags.0?bytes offset:flags.1?string limit:int = messages.VotesList;\nmessages.getDialogFilters#f19ed96d = Vector;\nmessages.getSuggestedDialogFilters#a29cd42c = Vector;\nmessages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter = Bool;\nmessages.getReplies#24b581ba peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;\nmessages.getDiscussionMessage#446972fd peer:InputPeer msg_id:int = messages.DiscussionMessage;\nmessages.readDiscussion#f731a9f4 peer:InputPeer msg_id:int read_max_id:int = Bool;\nmessages.unpinAllMessages#f025bc8b peer:InputPeer = messages.AffectedHistory;\nmessages.deleteChat#83247d11 chat_id:int = Bool;\nupdates.getState#edd4882a = updates.State;\nupdates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;\nupdates.getChannelDifference#3173d78 flags:# force:flags.0?true channel:InputChannel filter:ChannelMessagesFilter pts:int limit:int = updates.ChannelDifference;\nphotos.uploadProfilePhoto#89f30f69 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = photos.Photo;\nphotos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int = photos.Photos;\nupload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;\nupload.getFile#b15a9afc flags:# precise:flags.0?true cdn_supported:flags.1?true location:InputFileLocation offset:int limit:int = upload.File;\nupload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;\nupload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile;\nhelp.getConfig#c4f9186b = Config;\nhelp.getNearestDc#1fb33026 = NearestDc;\nhelp.getSupport#9cdf08cd = help.Support;\nhelp.acceptTermsOfService#ee72f79a id:DataJSON = Bool;\nhelp.getCountriesList#735787a8 lang_code:string hash:int = help.CountriesList;\nchannels.readHistory#cc104937 channel:InputChannel max_id:int = Bool;\nchannels.deleteMessages#84c1fd4e channel:InputChannel id:Vector = messages.AffectedMessages;\nchannels.getMessages#ad8c9a23 channel:InputChannel id:Vector = messages.Messages;\nchannels.getParticipants#123e05e9 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:int = channels.ChannelParticipants;\nchannels.getParticipant#a0ab6cc6 channel:InputChannel participant:InputPeer = channels.ChannelParticipant;\nchannels.getChannels#a7f6bbb id:Vector = messages.Chats;\nchannels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull;\nchannels.createChannel#3d5fb10f flags:# broadcast:flags.0?true megagroup:flags.1?true for_import:flags.3?true title:string about:string geo_point:flags.2?InputGeoPoint address:flags.2?string = Updates;\nchannels.editAdmin#d33c8902 channel:InputChannel user_id:InputUser admin_rights:ChatAdminRights rank:string = Updates;\nchannels.editTitle#566decd0 channel:InputChannel title:string = Updates;\nchannels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates;\nchannels.checkUsername#10e6bd2c channel:InputChannel username:string = Bool;\nchannels.updateUsername#3514b3de channel:InputChannel username:string = Bool;\nchannels.joinChannel#24b524c5 channel:InputChannel = Updates;\nchannels.leaveChannel#f836aa95 channel:InputChannel = Updates;\nchannels.inviteToChannel#199f3a6c channel:InputChannel users:Vector = Updates;\nchannels.deleteChannel#c0111fe3 channel:InputChannel = Updates;\nchannels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates;\nchannels.editBanned#96e6cd81 channel:InputChannel participant:InputPeer banned_rights:ChatBannedRights = Updates;\nchannels.readMessageContents#eab5dc38 channel:InputChannel id:Vector = Bool;\nchannels.togglePreHistoryHidden#eabbb94c channel:InputChannel enabled:Bool = Updates;\nchannels.getGroupsForDiscussion#f5dad378 = messages.Chats;\nchannels.setDiscussionGroup#40582bb2 broadcast:InputChannel group:InputChannel = Bool;\npayments.getPaymentForm#8a333c8d flags:# peer:InputPeer msg_id:int theme_params:flags.0?DataJSON = payments.PaymentForm;\npayments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt;\npayments.validateRequestedInfo#db103170 flags:# save:flags.0?true peer:InputPeer msg_id:int info:PaymentRequestedInfo = payments.ValidatedRequestedInfo;\npayments.sendPaymentForm#30c3bc9d flags:# form_id:long peer:InputPeer msg_id:int requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials tip_amount:flags.2?long = payments.PaymentResult;\npayments.getSavedInfo#227d824b = payments.SavedInfo;\nlangpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference;\nlangpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector = Vector;\nlangpack.getLanguages#42c6978f lang_pack:string = Vector;\nfolders.editPeerFolders#6847d0ab folder_peers:Vector = Updates;\n`;","const { inflate } = require('pako/dist/pako_inflate');\nconst { serializeBytes } = require('../index');\n\n// CONTEST const { deflate } = require('pako/dist/pako_deflate')\n\nclass GZIPPacked {\n static CONSTRUCTOR_ID = 0x3072cfa1;\n\n static classType = 'constructor';\n\n constructor(data) {\n this.data = data;\n this.CONSTRUCTOR_ID = 0x3072cfa1;\n this.classType = 'constructor';\n }\n\n static async gzipIfSmaller(contentRelated, data) {\n if (contentRelated && data.length > 512) {\n const gzipped = await (new GZIPPacked(data)).toBytes();\n if (gzipped.length < data.length) {\n return gzipped;\n }\n }\n return data;\n }\n\n static gzip(input) {\n return Buffer.from(input);\n // TODO this usually makes it faster for large requests\n // return Buffer.from(deflate(input, { level: 9, gzip: true }))\n }\n\n static ungzip(input) {\n return Buffer.from(inflate(input));\n }\n\n static read(reader) {\n const constructor = reader.readInt(false);\n if (constructor !== GZIPPacked.CONSTRUCTOR_ID) {\n throw new Error('not equal');\n }\n return GZIPPacked.gzip(reader.tgReadBytes());\n }\n\n static async fromReader(reader) {\n return new GZIPPacked(await GZIPPacked.ungzip(reader.tgReadBytes()));\n }\n\n async toBytes() {\n const g = Buffer.alloc(4);\n g.writeUInt32LE(GZIPPacked.CONSTRUCTOR_ID, 0);\n return Buffer.concat([\n g,\n serializeBytes(await GZIPPacked.gzip(this.data)),\n ]);\n }\n}\n\nmodule.exports = GZIPPacked;\n","const TLMessage = require('./TLMessage');\n\nclass MessageContainer {\n static CONSTRUCTOR_ID = 0x73f1f8dc;\n\n static classType = 'constructor';\n\n // Maximum size in bytes for the inner payload of the container.\n // Telegram will close the connection if the payload is bigger.\n // The overhead of the container itself is subtracted.\n static MAXIMUM_SIZE = 1044456 - 8;\n\n // Maximum amount of messages that can't be sent inside a single\n // container, inclusive. Beyond this limit Telegram will respond\n // with BAD_MESSAGE 64 (invalid container).\n //\n // This limit is not 100% accurate and may in some cases be higher.\n // However, sending up to 100 requests at once in a single container\n // is a reasonable conservative value, since it could also depend on\n // other factors like size per request, but we cannot know this.\n static MAXIMUM_LENGTH = 100;\n\n constructor(messages) {\n this.CONSTRUCTOR_ID = 0x73f1f8dc;\n this.messages = messages;\n this.classType = 'constructor';\n }\n\n static fromReader(reader) {\n const messages = [];\n const length = reader.readInt();\n for (let x = 0; x < length; x++) {\n const msgId = reader.readLong();\n const seqNo = reader.readInt();\n const containerLength = reader.readInt();\n const before = reader.tellPosition();\n const obj = reader.tgReadObject();\n reader.setPosition(before + containerLength);\n const tlMessage = new TLMessage(msgId, seqNo, obj);\n messages.push(tlMessage);\n }\n return new MessageContainer(messages);\n }\n}\n\nmodule.exports = MessageContainer;\n","const { RpcError } = require('../index').constructors;\nconst GZIPPacked = require('./GZIPPacked');\n\nclass RPCResult {\n static CONSTRUCTOR_ID = 0xf35c6d01;\n\n static classType = 'constructor';\n\n constructor(reqMsgId, body, error) {\n this.CONSTRUCTOR_ID = 0xf35c6d01;\n this.reqMsgId = reqMsgId;\n this.body = body;\n this.error = error;\n this.classType = 'constructor';\n }\n\n static async fromReader(reader) {\n const msgId = reader.readLong();\n const innerCode = reader.readInt(false);\n if (innerCode === RpcError.CONSTRUCTOR_ID) {\n return new RPCResult(msgId, undefined, RpcError.fromReader(reader));\n }\n if (innerCode === GZIPPacked.CONSTRUCTOR_ID) {\n return new RPCResult(msgId, (await GZIPPacked.fromReader(reader)).data);\n }\n reader.seek(-4);\n // This reader.read() will read more than necessary, but it's okay.\n // We could make use of MessageContainer's length here, but since\n // it's not necessary we don't need to care about it.\n return new RPCResult(msgId, reader.read(), undefined);\n }\n}\n\nmodule.exports = RPCResult;\n","class TLMessage {\n static SIZE_OVERHEAD = 12;\n\n static classType = 'constructor';\n\n constructor(msgId, seqNo, obj) {\n this.msgId = msgId;\n this.seqNo = seqNo;\n this.obj = obj;\n this.classType = 'constructor';\n }\n}\n\nmodule.exports = TLMessage;\n","const TLMessage = require('./TLMessage');\nconst RPCResult = require('./RPCResult');\nconst MessageContainer = require('./MessageContainer');\nconst GZIPPacked = require('./GZIPPacked');\n\nconst coreObjects = {\n [RPCResult.CONSTRUCTOR_ID]: RPCResult,\n [GZIPPacked.CONSTRUCTOR_ID]: GZIPPacked,\n [MessageContainer.CONSTRUCTOR_ID]: MessageContainer,\n};\n\nmodule.exports = {\n TLMessage,\n RPCResult,\n MessageContainer,\n GZIPPacked,\n coreObjects,\n};\n","const snakeToCamelCase = (name) => {\n const result = name.replace(/(?:^|_)([a-z])/g, (_, g) => g.toUpperCase());\n return result.replace(/_/g, '');\n};\nconst variableSnakeToCamelCase = (str) => str.replace(\n /([-_][a-z])/g,\n (group) => group.toUpperCase()\n .replace('-', '')\n .replace('_', ''),\n);\n\nconst CORE_TYPES = new Set([\n 0xbc799737, // boolFalse#bc799737 = Bool;\n 0x997275b5, // boolTrue#997275b5 = Bool;\n 0x3fedd339, // true#3fedd339 = True;\n 0xc4b9f9bb, // error#c4b9f9bb code:int text:string = Error;\n 0x56730bcc, // null#56730bcc = Null;\n]);\nconst AUTH_KEY_TYPES = new Set([\n 0x05162463, // resPQ,\n 0x83c95aec, // p_q_inner_data\n 0xa9f55f95, // p_q_inner_data_dc\n 0x3c6a84d4, // p_q_inner_data_temp\n 0x56fddf88, // p_q_inner_data_temp_dc\n 0xd0e8075c, // server_DH_params_ok\n 0xb5890dba, // server_DH_inner_data\n 0x6643b654, // client_DH_inner_data\n 0xd712e4be, // req_DH_params\n 0xf5045f1f, // set_client_DH_params\n 0x3072cfa1, // gzip_packed\n]);\n\n// This is copy-pasted from `gramjs/Helpers.js` to not depend on TypeScript modules\nfunction makeCRCTable() {\n let c;\n const crcTable = [];\n for (let n = 0; n < 256; n++) {\n c = n;\n for (let k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n crcTable[n] = c;\n }\n return crcTable;\n}\n\nlet crcTable;\n\nfunction crc32(buf) {\n if (!crcTable) {\n crcTable = makeCRCTable();\n }\n if (!Buffer.isBuffer(buf)) {\n buf = Buffer.from(buf);\n }\n let crc = -1;\n\n for (let index = 0; index < buf.length; index++) {\n const byte = buf[index];\n crc = crcTable[(crc ^ byte) & 0xff] ^ (crc >>> 8);\n }\n return (crc ^ (-1)) >>> 0;\n}\n\nconst findAll = (regex, str, matches = []) => {\n if (!regex.flags.includes('g')) {\n regex = new RegExp(regex.source, 'g');\n }\n\n const res = regex.exec(str);\n\n if (res) {\n matches.push(res.slice(1));\n findAll(regex, str, matches);\n }\n\n return matches;\n};\n\nconst fromLine = (line, isFunction) => {\n const match = line.match(/([\\w.]+)(?:#([0-9a-fA-F]+))?(?:\\s{?\\w+:[\\w\\d<>#.?!]+}?)*\\s=\\s([\\w\\d<>#.?]+);$/);\n if (!match) {\n // Probably \"vector#1cb5c415 {t:Type} # [ t ] = Vector t;\"\n throw new Error(`Cannot parse TLObject ${line}`);\n }\n\n const argsMatch = findAll(/({)?(\\w+):([\\w\\d<>#.?!]+)}?/, line);\n const currentConfig = {\n name: match[1],\n constructorId: parseInt(match[2], 16),\n argsConfig: {},\n subclassOfId: crc32(match[3]),\n result: match[3],\n isFunction,\n namespace: undefined,\n };\n if (!currentConfig.constructorId) {\n const hexId = '';\n let args;\n\n if (Object.values(currentConfig.argsConfig).length) {\n args = ` ${Object.keys(currentConfig.argsConfig)\n .map((arg) => arg.toString())\n .join(' ')}`;\n } else {\n args = '';\n }\n\n const representation = `${currentConfig.name}${hexId}${args} = ${currentConfig.result}`\n .replace(/(:|\\?)bytes /g, '$1string ')\n .replace(/|{|}/g, '')\n .replace(/ \\w+:flags\\.\\d+\\?true/g, '');\n\n if (currentConfig.name === 'inputMediaInvoice') {\n // eslint-disable-next-line no-empty\n if (currentConfig.name === 'inputMediaInvoice') {\n }\n }\n\n currentConfig.constructorId = crc32(Buffer.from(representation, 'utf8'));\n }\n for (const [brace, name, argType] of argsMatch) {\n if (brace === undefined) {\n currentConfig.argsConfig[variableSnakeToCamelCase(name)] = buildArgConfig(name, argType);\n }\n }\n if (currentConfig.name.includes('.')) {\n [currentConfig.namespace, currentConfig.name] = currentConfig.name.split(/\\.(.+)/);\n }\n currentConfig.name = snakeToCamelCase(currentConfig.name);\n /*\n for (const arg in currentConfig.argsConfig){\n if (currentConfig.argsConfig.hasOwnProperty(arg)){\n if (currentConfig.argsConfig[arg].flagIndicator){\n delete currentConfig.argsConfig[arg]\n }\n }\n } */\n return currentConfig;\n};\n\nfunction buildArgConfig(name, argType) {\n name = name === 'self' ? 'is_self' : name;\n // Default values\n const currentConfig = {\n isVector: false,\n isFlag: false,\n skipConstructorId: false,\n flagIndex: -1,\n flagIndicator: true,\n type: undefined,\n useVectorId: undefined,\n };\n\n // The type can be an indicator that other arguments will be flags\n if (argType !== '#') {\n currentConfig.flagIndicator = false;\n // Strip the exclamation mark always to have only the name\n currentConfig.type = argType.replace(/^!+/, '');\n\n // The type may be a flag (flags.IDX?REAL_TYPE)\n // Note that 'flags' is NOT the flags name; this\n // is determined by a previous argument\n // However, we assume that the argument will always be called 'flags'\n // @ts-ignore\n const flagMatch = currentConfig.type.match(/flags.(\\d+)\\?([\\w<>.]+)/);\n\n if (flagMatch) {\n currentConfig.isFlag = true;\n currentConfig.flagIndex = Number(flagMatch[1]);\n // Update the type to match the exact type, not the \"flagged\" one\n [, , currentConfig.type] = flagMatch;\n }\n\n // Then check if the type is a Vector\n // @ts-ignore\n const vectorMatch = currentConfig.type.match(/[Vv]ector<([\\w\\d.]+)>/);\n\n if (vectorMatch) {\n currentConfig.isVector = true;\n\n // If the type's first letter is not uppercase, then\n // it is a constructor and we use (read/write) its ID.\n // @ts-ignore\n currentConfig.useVectorId = currentConfig.type.charAt(0) === 'V';\n\n // Update the type to match the one inside the vector\n [, currentConfig.type] = vectorMatch;\n }\n\n // See use_vector_id. An example of such case is ipPort in\n // help.configSpecial\n // @ts-ignore\n if (/^[a-z]$/.test(currentConfig.type.split('.')\n .pop()\n .charAt(0))\n ) {\n currentConfig.skipConstructorId = true;\n }\n\n // The name may contain \"date\" in it, if this is the case and\n // the type is \"int\", we can safely assume that this should be\n // treated as a \"date\" object. Note that this is not a valid\n // Telegram object, but it's easier to work with\n // if (\n // this.type === 'int' &&\n // (/(\\b|_)([dr]ate|until|since)(\\b|_)/.test(name) ||\n // ['expires', 'expires_at', 'was_online'].includes(name))\n // ) {\n // this.type = 'date';\n // }\n }\n return currentConfig;\n}\n\n\nfunction* parseTl(content, layer, methods = [], ignoreIds = CORE_TYPES) {\n (methods || []).reduce((o, m) => ({\n ...o,\n [m.name]: m,\n }), {});\n const objAll = [];\n const objByName = {};\n const objByType = {};\n\n const file = content;\n\n let isFunction = false;\n\n for (let line of file.split('\\n')) {\n const commentIndex = line.indexOf('//');\n\n if (commentIndex !== -1) {\n line = line.slice(0, commentIndex);\n }\n\n line = line.trim();\n\n if (!line) {\n continue;\n }\n\n const match = line.match(/---(\\w+)---/);\n\n if (match) {\n const [, followingTypes] = match;\n isFunction = followingTypes === 'functions';\n continue;\n }\n\n try {\n const result = fromLine(line, isFunction);\n\n if (ignoreIds.has(result.constructorId)) {\n continue;\n }\n\n objAll.push(result);\n\n if (!result.isFunction) {\n if (!objByType[result.result]) {\n objByType[result.result] = [];\n }\n\n objByName[result.name] = result;\n objByType[result.result].push(result);\n }\n } catch (e) {\n if (!e.toString()\n .includes('vector#1cb5c415')) {\n throw e;\n }\n }\n }\n\n // Once all objects have been parsed, replace the\n // string type from the arguments with references\n for (const obj of objAll) {\n // console.log(obj)\n if (AUTH_KEY_TYPES.has(obj.constructorId)) {\n for (const arg in obj.argsConfig) {\n if (obj.argsConfig[arg].type === 'string') {\n obj.argsConfig[arg].type = 'bytes';\n }\n }\n }\n }\n\n for (const obj of objAll) {\n yield obj;\n }\n}\n\nfunction serializeBytes(data) {\n if (!(data instanceof Buffer)) {\n if (typeof data === 'string') {\n data = Buffer.from(data);\n } else {\n throw Error(`Bytes or str expected, not ${data.constructor.name}`);\n }\n }\n const r = [];\n let padding;\n if (data.length < 254) {\n padding = (data.length + 1) % 4;\n if (padding !== 0) {\n padding = 4 - padding;\n }\n r.push(Buffer.from([data.length]));\n r.push(data);\n } else {\n padding = data.length % 4;\n if (padding !== 0) {\n padding = 4 - padding;\n }\n r.push(Buffer.from([254, data.length % 256, (data.length >> 8) % 256, (data.length >> 16) % 256]));\n r.push(data);\n }\n r.push(Buffer.alloc(padding)\n .fill(0));\n\n return Buffer.concat(r);\n}\n\nfunction serializeDate(dt) {\n if (!dt) {\n return Buffer.alloc(4)\n .fill(0);\n }\n if (dt instanceof Date) {\n dt = Math.floor((Date.now() - dt.getTime()) / 1000);\n }\n if (typeof dt === 'number') {\n const t = Buffer.alloc(4);\n t.writeInt32LE(dt, 0);\n return t;\n }\n throw Error(`Cannot interpret \"${dt}\" as a date`);\n}\n\nmodule.exports = {\n findAll,\n parseTl,\n buildArgConfig,\n fromLine,\n CORE_TYPES,\n serializeDate,\n serializeBytes,\n snakeToCamelCase,\n variableSnakeToCamelCase,\n};\n","const api = require('./api');\nconst {\n serializeBytes,\n serializeDate,\n} = require('./generationHelpers');\n\nmodule.exports = {\n // TODO Refactor internal usages to always use `api`.\n constructors: api,\n requests: api,\n serializeBytes,\n serializeDate,\n};\n","module.exports = `resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector = ResPQ;\np_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data;\nserver_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params;\nserver_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;\nserver_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;\nclient_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;\ndh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;\ndh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer;\ndh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;\ndestroy_auth_key_ok#f660e1d4 = DestroyAuthKeyRes;\ndestroy_auth_key_none#0a9f2259 = DestroyAuthKeyRes;\ndestroy_auth_key_fail#ea109b13 = DestroyAuthKeyRes;\n---functions---\nreq_pq#60469778 nonce:int128 = ResPQ;\nreq_pq_multi#be7e8ef1 nonce:int128 = ResPQ;\nreq_pq_multi_new#51b410fd nonce:int128 = ResPQ;\nreq_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;\nset_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;\ndestroy_auth_key#d1435160 = DestroyAuthKeyRes;\n---types---\nmsgs_ack#62d6b459 msg_ids:Vector = MsgsAck;\nbad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int error_code:int = BadMsgNotification;\nbad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_server_salt:long = BadMsgNotification;\nmsgs_state_req#da69fb52 msg_ids:Vector = MsgsStateReq;\nmsgs_state_info#04deb57d req_msg_id:long info:string = MsgsStateInfo;\nmsgs_all_info#8cc0d131 msg_ids:Vector info:string = MsgsAllInfo;\nmsg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\nmsg_new_detailed_info#809db6df answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\nmsg_resend_req#7d861a08 msg_ids:Vector = MsgResendReq;\nrpc_error#2144ca19 error_code:int error_message:string = RpcError;\nfuture_salt#0949d9dc valid_since:int valid_until:int salt:long = FutureSalt;\nfuture_salts#ae500895 req_msg_id:long now:int salts:vector = FutureSalts;\npong#347773c5 msg_id:long ping_id:long = Pong;\ndestroy_session_ok#e22045fc session_id:long = DestroySessionRes;\ndestroy_session_none#62d350c9 session_id:long = DestroySessionRes;\nnew_session_created#9ec20908 first_msg_id:long unique_id:long server_salt:long = NewSession;\n---functions---\nping#7abe77ec ping_id:long = Pong;\nping_delay_disconnect#f3427b8c ping_id:long disconnect_delay:int = Pong;`;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [592], () => (__webpack_require__(6514)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".\" + \"d7ca037ed9b7d1c6792a\" + \".js\";\n};","// This function allow to reference all chunks\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t514: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = self[\"webpackChunktelegram_t\"] = self[\"webpackChunktelegram_t\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["deferred","next","API_UPDATE_THROTTLE","window","innerHeight","Math","round","API_THROTTLE_RESET_UPDATES","Set","buildCollectionByKey","collection","key","reduce","byKey","member","pick","object","keys","result","isPeerUser","peer","hasOwnProperty","isPeerChat","bytesToDataUri","bytes","shouldOmitPrefix","mimeType","btoa","String","fromCharCode","omitVirtualClassFields","instance","flags","CONSTRUCTOR_ID","SUBCLASS_OF_ID","className","classType","rest","getServerTime","serverTimeOffset","floor","Date","now","buildApiChatFieldsFromPeerEntity","peerEntity","isSupport","isMin","Boolean","min","accessHash","avatarHash","photo","buildAvatarHash","isSignaturesShown","signatures","hasPrivateLink","hasLink","GramJs","username","isVerified","verified","isCallActive","callActive","isCallNotEmpty","callNotEmpty","participantsCount","membersCount","joinDate","date","buildApiChatPermissions","isCreator","creator","buildApiChatRestrictions","buildApiChatMigrationInfo","buildApiChatFromDialog","dialog","folderId","unreadMark","unreadCount","unreadMentionsCount","notifySettings","silent","muteUntil","readOutboxMaxId","readInboxMaxId","draft","isMuted","id","getApiChatIdFromMtpPeer","type","getApiChatTypeFromPeerEntity","title","getApiChatTitleFromMtpPeer","lastReadOutboxMessageId","lastReadInboxMessageId","hasUnreadMark","draftDate","adminRights","currentUserBannedRights","bannedRights","undefined","defaultBannedRights","isRestricted","restrictions","restrictionReason","restricted","restrictionReasons","targetReason","find","platform","buildApiChatRestrictionReason","Object","assign","isNotJoined","left","kicked","migratedTo","chatId","toString","buildApiChatFromPreview","preview","withForbidden","getUserName","userId","channelId","getApiChatIdFromInputMtpPeer","isInputPeerUser","isInputPeerChat","isInputPeerChannel","megagroup","getPeerKey","user","firstName","lastName","photoId","buildChatMember","inviterId","joinedDate","kickedByUserId","kickedBy","promotedByUserId","promotedBy","customTitle","rank","isAdmin","isOwner","buildChatMembers","participants","map","filter","buildChatTypingStatus","update","action","fromId","timestamp","buildApiChatFolder","channels","broadcasts","pinnedChatIds","pinnedPeers","includedChatIds","includePeers","excludedChatIds","excludePeers","buildApiChatFolderFromSuggested","description","buildApiChatBotCommands","botInfos","botCommands","botInfo","concat","commands","mtpCommand","botId","pathBytesToSvg","width","height","replace","path","len","length","i","num","buildPath","DEFAULT_THUMB_SIZE","w","h","buildApiThumbnailFromStripped","sizes","thumb","s","realSizes","dataUri","strippedPhotoToJpg","buildApiPhoto","buildApiPhotoSize","thumbnail","photoSize","localMessages","chats","users","messages","documents","stickerSets","photos","webDocuments","ANIMATED_STICKER_MIME_TYPE","buildStickerFromDocument","document","stickerAttribute","attributes","attr","fileAttribute","sizeAttribute","stickerSetInfo","stickerset","emoji","alt","isAnimated","cachedThumb","thumbs","pathThumb","buildApiThumbnailFromCached","buildApiThumbnailFromPath","stickerSetId","stickerSetAccessHash","buildStickerSet","set","archived","animated","installedDate","count","hash","shortName","hasThumbnail","buildStickerSetCovered","coveredStickerSet","stickerSet","stickerSetCovers","covers","cover","forEach","coverSticker","push","localDb","interpolateArray","data","fitCount","peak","newData","Array","springFactor","leftFiller","rightFiller","idx","val","ApiMessageEntityTypes","ApiMediaFormat","getEntityTypeById","chatOrUserId","buildPeer","buildInputPeer","BigInt","buildInputPeerFromLocalDb","buildInputEntity","buildInputStickerSet","buildInputDocument","media","buildInputMediaDocument","inputDocument","generateRandomBigInt","readBigIntFromBuffer","generateRandomBytes","buildMessageFromUpdate","peerId","buildMtpMessageEntity","entity","offset","url","Bold","Italic","Underline","Strike","Code","Pre","language","Blockquote","TextUrl","Url","Hashtag","MentionName","calculateResultHash","ids","isMessageWithMedia","message","webpage","startsWith","buildInputContact","phone","clientId","buildChatBannedRights","untilDate","buildChatAdminRights","buildShippingInfo","info","shippingAddress","buildInputPrivacyKey","privacyKey","buildInputReportReason","reason","resolveMessageApiChatId","mtpMessage","addMessageToLocalDb","messageFullId","addPhotoToLocalDb","currentUserId","onUpdate","localMessageCounter","buildApiMessage","buildApiMessageWithChatId","isChatWithSelf","isOutgoing","out","post","fwdFrom","content","buildMessageMediaContent","sticker","poll","contact","text","buildMessageTextContent","entities","senderId","targetPeerId","isChannelPost","amount","currency","translationValues","targetUserIds","targetChatId","includes","withDuration","duration","video","join","mins","max","Number","totalAmount","domain","buildAction","replyToMsgId","replyToTopId","replyTo","isEdited","editDate","editHide","inlineButtons","keyboardButtons","keyboardPlaceholder","isKeyboardSingleUse","messageId","replyMarkup","value","markup","rows","buttons","button","receiptMsgId","placeholder","singleUse","buildReplyButtons","forwardInfo","savedFromPeerId","savedFromPeer","channelPost","channelPostId","isLinkedChannelPost","fromChatId","fromMessageId","savedFromMsgId","senderUserId","hiddenUserName","fromName","adminTitle","postAuthor","buildApiMessageForwardInfo","replies","mediaUnread","isMediaUnread","groupedId","isInAlbum","audio","shouldHideKeyboardButtons","views","isFromScheduled","fromScheduled","replyToMessageId","replyToTopMessageId","mentioned","hasUnreadMention","viaBotId","comments","threadInfo","buildThreadInfo","buildApiMessageEntity","buildMessageDraft","formattedText","replyingToId","buildSticker","ttlSeconds","buildPhoto","buildVideoFromDocument","buildVideo","audioAttribute","voice","fileName","getFilenameFromDocument","buildAudio","waveform","from","buildVoice","buildApiDocument","buildDocumentFromMedia","buildContact","buildPoll","results","buildPollFromMedia","webPage","buildWebPage","invoice","test","photoUrl","isTest","buildInvoice","buildInvoiceFromMedia","size","videoAttr","a","gifAttr","supportsStreaming","roundMessage","isRound","isGif","mediaType","mediaSize","imageAttribute","pollResults","answers","rawAnswers","answer","option","summary","isPublic","publicVoters","buildPollResults","rawResults","totalVoters","recentVoters","solution","solutionEntities","recentVoterIds","chosen","correct","voters","isChosen","isCorrect","votersCount","defaultBase","filenameAttribute","extension","split","buildNewPoll","localId","messageReplies","maxId","readMaxId","recentRepliers","threadId","originChannelId","messagesCount","lastMessageId","recentReplierIds","buildApiUserFromFull","mtpUserFull","about","commonChatsCount","pinnedMsgId","blocked","buildApiUser","fullInfo","bio","pinnedMessageId","isBlocked","botDescription","buildApiBotCommands","mtpUser","userType","bot","deleted","self","isSelf","mutualContact","isContact","canBeInvitedToGroup","botNochats","phoneNumber","status","buildApiUserStatus","botInlinePlaceholder","botPlaceholder","mtpStatus","expires","wasOnline","command","buildApiWallpaper","wallpaper","slug","buildApiSession","session","isCurrent","current","isOfficialApp","officialApp","isPasswordPending","passwordPending","buildPrivacyRules","rules","visibility","allowUserIds","allowChatIds","blockUserIds","blockChatIds","rule","buildApiNotifyException","showPreviews","sound","isSilent","shouldShowPreviews","buildApiCountry","country","code","hidden","iso2","defaultName","name","countryCode","prefixes","patterns","isHidden","sentMessageIds","updater","originRequest","connection","timeOffset","connectionState","state","buildApiMessageFromShort","notification","currentDate","inboxDate","buildApiMessageFromNotification","_entities","e","chat","has","dcId","buildChatPhotoForLocalDb","localDbChatId","abs","newProfilePhoto","some","existingIds","missingIds","profilePhotoIds","setTimeout","randomId","localMessage","Error","newContent","add","isAlreadySent","isScheduled","sendingState","messageUpdate","pollId","apiPoll","pollUpdate","options","stillUnreadCount","isPinned","pinned","order","dp","folderPeers","folderPeer","folder","orderedIds","replacedMembers","addedMember","deletedMemberId","messageIds","typingStatus","channel","unread","updatedUser","peerType","buildPrivacyKey","ApiErrors","PHONE_NUMBER_INVALID","PHONE_CODE_INVALID","PASSWORD_HASH_INVALID","PHONE_PASSWORD_FLOOD","authController","onRequestPhoneNumber","buildAuthStateUpdate","Promise","resolve","reject","onRequestCode","isCodeViaApp","onRequestPassword","hint","onRequestRegistration","onRequestQrCode","qrCode","token","onAuthError","err","errors","hours","ceil","seconds","authorizationState","provideAuthPhoneNumber","provideAuthCode","provideAuthPassword","password","provideAuthRegistration","registration","restartAuth","restartAuthWithQr","File","Blob","constructor","fileBits","super","this","cacheApi","caches","Type","async","fetch","cacheName","isHtmlAllowed","request","Request","cache","open","response","match","Text","blob","substr","contentType","headers","get","Json","json","console","warn","save","cacheData","JSON","stringify","Response","put","clear","delete","MEDIA_ENTITY_TYPES","getMimeType","fallbackMimeType","subarray","byte","GramJsLogger","gramJsUpdateEventBuilder","build","client","isConnected","destroy","invokeRequest","disconnect","onSessionUpdate","sessionData","handleGramJsUpdate","handleTerminatedSession","shouldHandleUpdates","shouldThrow","invoke","updatesContainer","updates","injectUpdateEntities","isSlowMode","error","hasErrorKey","dispatchErrorUpdate","downloadMedia","args","onProgress","mediaFormat","start","end","fullSize","mediaMatch","arrayBuffer","entityType","entityId","sizeType","Stream","acceptsBuffer","progressCallback","workers","getMessageMediaMimeType","downloadStickerSetThumb","Lottie","downloadProfilePhoto","download","parsed","DataUri","reader","FileReader","onload","target","onerror","readAsDataURL","BlobUrl","inflate","to","parse","Progressive","buffer","parseMedia","canCache","prepared","mediaData","URL","createObjectURL","downloadMediaWithClient","uploadFile","file","updateTwoFaSettings","params","fetchCurrentUser","userFull","currentUser","_currentUserId","onCurrentUserUpdate","MAX_INT_32","fetchChats","limit","offsetDate","withPinned","offsetPeer","excludePinned","resultPinned","updateLocalDb","lastMessagesByChatId","peersByKey","preparePeers","draftsById","replyingToById","dialogs","orderedPinnedIds","lastMessage","isListed","chatIds","totalChatCount","fetchFullChat","fullChat","onlineCount","exportedInvite","slowmodeSeconds","slowmodeNextSendDate","migratedFromChatId","migratedFromMaxId","canViewParticipants","linkedChatId","hiddenPrehistory","call","inviteLink","link","members","fetchMembers","kickedMembers","bannedUsers","adminMembers","adminUsers","slowMode","nextSendDate","migratedFrom","maxMessageId","canViewMembers","isPreHistoryHidden","groupCallId","getFullChannelInfo","getFullChatInfo","searchChats","query","q","localPeerIds","myResults","allChats","allUsers","localChats","r","localUsers","u","globalChats","globalUsers","fetchChat","requestChatUpdate","peers","saveDraft","clearDraft","updateChatMutedState","settings","createChannel","broadcast","newChannel","joinChannel","deleteChatUser","deleteChat","leaveChannel","deleteChannel","createGroupChat","newChat","editChatPhoto","uploadedPhoto","inputEntity","toggleChatPinned","shouldBePinned","toggleChatArchived","fetchChatFolders","byId","fetchRecommendedChatFolders","editChatFolder","folderUpdate","emoticon","contacts","nonContacts","groups","bots","excludeArchived","excludeMuted","excludeRead","buildFilterFromApiFolder","deleteChatFolder","isActionSuccessful","recommendedChatFolders","folders","toggleDialogUnread","getChatByUsername","togglePreHistoryHidden","isEnabled","enabled","updateChatDefaultBannedRights","updateChatMemberBannedRights","participant","updateChatAdmin","updateChatTitle","updateChatAbout","toggleSignatures","memberFilter","fetchGroupsForDiscussion","setDiscussionGroup","group","migrateChat","openChatByInvite","isChannel","addChatMembers","all","deleteChatMember","viewMessages","sendMessages","sendMedia","sendStickers","sendGifs","sendGames","sendInline","embedLinks","sendPolls","changeInfo","inviteUsers","pinMessages","store","importChatInvite","fetchMessages","pagination","RequestClass","msgId","c","threadInfos","fetchMessage","queue","sendMessage","replyingTo","attachment","gif","scheduledAt","noWebPage","filename","blobUrl","previewBlobUrl","quick","inputWaveform","buildUploadingMedia","buildLocalMessage","groupIndex","groupedUploads","counter","singleMediaByIndex","prevQueue","uploadMedia","inputMedia","uploadedMedia","messageMedia","fileReference","fetchInputMedia","multiMedia","values","scheduleDate","sendGroupedMedia","pollParams","quiz","question","Buffer","multipleChoice","correctAnswers","buildInputPoll","noWebpage","editMessage","mtpEntities","rescheduleMessage","lastModified","blobToFile","fetchBlob","fetchFile","patchedOnProgress","progress","isCanceled","inputFile","pinMessage","isUnpin","isOneSide","unpin","pmOneside","unpinAllMessages","deleteMessages","shouldDeleteForAll","revoke","deleteScheduledMessages","deleteHistory","just_clear","reportMessages","markMessageListRead","requestThreadInfoUpdate","markMessagesRead","topMessageResult","repliesResult","offsetId","addOffset","discussionChatId","topMessageId","firstMessageId","noTopChatsRequest","searchMessagesLocal","chatOrUser","minDate","maxDate","topMsgId","nextOffsetId","totalCount","searchMessagesGlobal","offsetRate","nextRate","fetchWebPagePreview","sendPollVote","loadPollOptionResults","shouldResetVoters","votes","vote","nextOffset","forwardMessages","fromChat","toChat","randomIds","index","isAudio","asIncomingInChatWithSelf","buildForwardedMessage","fromPeer","toPeer","findFirstMessageIdAfterDate","fetchScheduledHistory","sendScheduledMessages","isServiceMessageWithMedia","fetchPinnedMessages","inputGifBot","fetchFullUser","input","userWithFullInfo","fetchNearestCountry","dcInfo","fetchCountryList","langCode","countryList","countries","phoneCodes","array","countryCodes","isArray","sort","b","localeCompare","general","fetchTopUsers","topPeers","correspondents","fetchContactList","savedCount","fetchUsers","updateContact","deleteUser","fetchProfilePhotos","fetchStickerSets","allStickers","sets","fetchRecentStickers","stickers","processStickerResult","slice","fetchFavoriteStickers","fetchFeaturedStickers","faveSticker","unfave","fetchStickers","stickerSetShortName","packs","acc","documentId","fetchAnimatedEmojis","searchStickers","fetchSavedGifs","gifs","processGifResult","installStickerSet","uninstallStickerSet","searchGifs","config","resolvedPeer","gifSearchUsername","foundGif","fetchStickersForEmoji","fetchEmojiKeywords","fromVersion","version","keywords","emojiKeyword","keyword","emoticons","checkChatUsername","setChatUsername","updatePrivateLink","EMAIL_UNCONFIRMED","EMAIL_HASH_EXPIRED","NEW_SALT_INVALID","NEW_SETTINGS_INVALID","CODE_INVALID","emailCodeController","getPasswordInfo","hasPassword","onRequestEmailCode","checkPassword","currentPassword","isCheckPassword","onError","clearPassword","updatePassword","email","newPassword","emailCodeCallback","onEmailCodeError","updateRecoveryEmail","provideRecoveryEmailCode","BETA_LANG_CODES","updateProfile","checkUsername","updateUsername","updateProfilePhoto","uploadProfilePhoto","fetchWallpapers","filteredWallpapers","wallpapers","pattern","uploadWallpaper","fetchBlockedContacts","blockedIds","blockContact","unblockContact","fetchAuthorizations","authorizations","terminateAuthorization","terminateAllAuthorizations","fetchNotificationExceptions","compareSound","fetchNotificationSettings","isMutedContactSignUpNotification","privateContactNotificationsSettings","groupNotificationsSettings","broadcastNotificationsSettings","privateSilent","privateMuteUntil","privateShowPreviews","groupSilent","groupMuteUntil","groupShowPreviews","broadcastSilent","broadcastMuteUntil","broadcastShowPreviews","hasContactJoinedNotifications","hasPrivateChatsNotifications","hasPrivateChatsMessagePreview","hasGroupNotifications","hasGroupMessagePreview","hasBroadcastNotifications","hasBroadcastMessagePreview","updateContactSignUpNotification","updateNotificationSettings","fetchLanguages","langPack","fetchLangPack","sourceLangPacks","collections","strings","reverse","fetchLangStrings","fetchPrivacySettings","registerDevice","secret","getAuthKey","getKey","tokenType","appSandbox","otherUids","unregisterDevice","setPrivacySettings","privacyRules","allowedUsers","allowedChats","blockedUsers","blockedChats","updateIsOnline","isOnline","offline","fetchContentSettings","isSensitiveEnabled","sensitiveEnabled","canChangeSensitive","sensitiveCanChange","updateContentSettings","buildApiWebDocument","answerCallbackButton","fetchTopInlineBots","botsInline","fetchInlineBot","addUserToLocalDb","fetchInlineBotResults","queryId","switchPm","isGallery","gallery","help","buildApiBotInlineMediaResult","webDocument","webThumbnail","buildApiBotInlineResult","sendInlineBotResult","resultId","startBot","startParam","buildShippingOptions","shippingOptions","prices","ac","cur","label","validateRequestedInfo","requestInfo","shouldSave","sendPaymentForm","formId","requestedInfoId","shippingOptionId","credentials","getPaymentForm","form","canSaveCredentials","passwordMissing","providerId","nativeProvider","nativeParams","savedInfo","nameRequested","phoneRequested","emailRequested","shippingAddressRequested","flexible","phoneToProvider","emailToProvider","mapedPrices","nativeData","needCardholderName","need_cardholder_name","needCountry","need_country","needZip","need_zip","publishableKey","publishable_key","buildPaymentForm","getReceipt","receipt","shipping","credentialsTitle","shippingPrices","shippingMethod","buildReceipt","initApi","_onUpdate","initialArgs","initUpdater","handleUpdate","initAuth","initChats","initMessages","initUsers","initStickers","initManagement","initTwoFaSettings","userAgent","sessions","TelegramClient","process","deviceModel","navigator","appVersion","useWSS","additionalDcsDisabled","addEventHandler","phoneCode","firstAndLastNames","initialMethod","getSessionData","initClient","flushUpdatesOnTickEnd","schedulerFn","fn","waiting","_args","throttleWith","cb","then","throttleId","pendingUpdates","currentThrottleId","currentUpdates","flushUpdatesThrottled","ms","shouldRunFirst","interval","isPending","setInterval","clearInterval","throttle","random","sendToOrigin","addEventListener","callbackState","Map","postMessage","onmessage","callback","callbackArgs","lastArg","ArrayBuffer","fnName","methods","callApi","require","crypto","little","signed","randBuffer","bytesNumber","bigInt","subtract","pow","toSignedLittleBuffer","big","number","bigNumber","byteArray","shiftRight","and","readBufferFromBigInt","bitLength","lesser","below","hex","padStart","l","reminder","randomBytes","sha1","shaSum","createHash","digest","crcTable","module","exports","generateRandomLong","mod","n","m","crc32","buf","k","makeCRCTable","isBuffer","crc","generateKeyDataFromNonce","serverNonce","newNonce","hash1","hash2","hash3","iv","sha256","bigIntMod","remainder","modExp","one","x","greater","zero","leastSignificantBit","divide","eq","multiply","getRandomInt","sleep","getByteArray","integer","bits","byteLength","convertToLittle","alloc","writeUInt32BE","bufferXor","res","createDeferred","promise","_resolve","constructors","checkPrimeAndGood","primeBytes","g","equals","numBytesForHash","bigNumForHash","isGoodModExpFirst","modexp","prime","diff","xor","computeHash","algo","salt1","salt2","salt","iterations","pbkdf2","pbkdf2sha512","computeCheck","currentAlgo","PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow","pwHash","p","B","srp_B","isGoodLarge","pForHash","gForHash","bForHash","gX","kgX","aForHash","A","generateAndCheckRandom","gB","ux","aUx","S","K","pSha","gSha","salt1Sha","salt2Sha","M1","InputCheckPasswordSRP","srpId","computeDigest","JPEG_HEADER","JPEG_FOOTER","_raiseCastFail","getMessageId","getInputPeer","allowSelf","checkHash","User","InputPeerSelf","InputPeerUser","Chat","ChatEmpty","ChatForbidden","InputPeerChat","Channel","TypeError","InputPeerChannel","ChannelForbidden","InputUser","InputChannel","UserEmpty","InputPeerEmpty","UserFull","ChatFull","PeerChat","getDisplayName","getAppropriatedPartSize","fileSize","stripped","header","getDC","downloadDC","ipAddress","port","pwd","Api","newAlgo","newSettings","newPasswordHash","newSecureSettings","codeLength","os","Logger","MemorySession","Helpers","utils","Session","LAYER","requests","MTProtoSender","ConnectionTCPObfuscated","authFlow","checkAuthorization","downloadFile","WEBDOCUMENT_REQUEST_PART_SIZE","sizeTypes","apiId","apiHash","opts","DEFAULT_OPTIONS","_useIPV6","useIPV6","baseLogger","_log","floodSleepLimit","_eventBuilders","_phoneCodeHash","parseInt","_requestRetries","requestRetries","_connectionRetries","connectionRetries","_retryDelay","retryDelay","proxy","_proxy","_timeout","timeout","_autoReconnect","autoReconnect","_connection","_floodWaitedRequests","_initWith","InvokeWithLayer","layer","InitConnection","systemVersion","release","systemLangCode","_config","phoneCodeHashes","_exportedSenderPromises","_exportedSenderReleaseTimeouts","_additionalDcsDisabled","_loopStarted","_reconnecting","_destroyed","_initSession","_sender","logger","retries","delay","connectTimeout","authKeyCallback","_authKeyCallback","bind","updateCallback","_handleUpdate","isMainSender","userDisconnected","_user_connected","_disconnected","serverAddress","connect","setAuthKey","authKey","send","GetConfig","_updateLoop","load","setDC","attempts","PingDelayDisconnect","pingId","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","disconnectDelay","race","getTime","_lastRequest","GetState","sender","newDc","DC","setKey","dc","_authenticated","auth","ExportAuthorization","req","ImportAuthorization","shouldReconnect","existingSender","_connectSender","_createExportedSender","isConnecting","_borrowExportedSender","clearTimeout","onConnectionBreak","_cleanupExportedSender","getSender","inputLocation","messageOrMedia","Message","MessageMediaWebPage","WebPage","MessageMediaPhoto","Photo","_downloadPhoto","MessageMediaDocument","Document","_downloadDocument","MessageMediaContact","_downloadContact","WebDocument","WebDocumentNoProxy","_downloadWebDocument","isBig","loc","chatPhoto","UserProfilePhoto","ChatPhoto","InputPeerPhotoFileLocation","thumbVersion","InputStickerSetThumb","InputStickerSetID","thumbDcId","_pickFileSize","indexOf","_downloadCachedPhotoSize","PhotoStrippedSize","PhotoSizeEmpty","PhotoCachedSize","InputPhotoFileLocation","thumbSize","doc","InputDocumentFileLocation","buff","downloaded","upload","GetWebFile","location","InputWebFileLocation","attempt","sendWithInvokeSupport","ServerError","FloodWaitError","FloodTestPhoneWaitError","PhoneMigrateError","NetworkMigrateError","UserMigrateError","_switchDC","MsgWaitError","isReady","GetUsers","InputUserSelf","authParams","apiCredentials","fileParams","event","Updates","UpdatesCombined","_processUpdate","UpdateShort","others","_dispatchUpdate","ptsDate","builder","times","pause","Infinity","sequentialUpdates","DEFAULT_INITIAL_METHOD","me","botAuthToken","signInBot","signInUser","signInUserWithQrCode","phoneCodeHash","sendCodeResult","sendCode","forceSMS","termsOfService","isRegistrationRequired","signInWithPassword","isScanningComplete","inputPromise","exceptIds","updatePromise","result2","authorization","migratedResult","sendResult","resendResult","passwordSrpResult","passwordSrpCheck","computePasswordSrpCheck","ONE_MB","Foreman","maxWorkers","requestWorker","activeWorkers","releaseWorker","partSizeKb","partSize","partsCount","foreman","promises","hasEnded","isPrecise","offsetMemo","precise","buffers","totalLength","fileId","isLarge","partCount","fileToBuffer","sendingParts","j","jMemo","bytesMemo","filePart","fileTotalParts","parts","md5Checksum","BinaryReader","AuthKey","_key","_hash","auxHash","readLong","read","keyId","writeUInt8","shaData","other","cipher","createCipheriv","encrypt","Factorizator","neq","temp","pq","y","randBetween","minus","ys","condition","gcd","IGE","AESIGE","ige","decryptIge","cipherText","decrypt","encryptIge","plainText","padding","i2abLow","uint8","Uint8Array","int","i2abBig","ab2iLow","ab","Uint32Array","ab2iBig","isBigEndian","i2ab","ab2i","AES","getWords","Counter","initialValue","setBytes","_counter","increment","CTR","_remainingCounter","_remainingCounterIndex","_aes","encrypted","Hash","algorithm","subtle","createDecipheriv","getRandomValues","passwordKey","importKey","deriveBits","s2i","str","pos","charCodeAt","right","ReadCancelledError","TypeNotFoundError","invalidConstructorId","remaining","alert","InvalidChecksumError","checksum","validChecksum","InvalidBufferError","payload","readInt32LE","SecurityError","BadMessageError","errorMessage","ErrorMessages","CdnFileTamperedError","RPCError","_fmtRequest","InvalidDCError","BadRequestError","UnauthorizedError","ForbiddenError","NotFoundError","AuthKeyError","FloodError","TimedOutError","capture","SlowModeWaitError","FileMigrateError","EmailUnconfirmedError","rpcErrorRe","Common","RPCBaseErrors","RPCErrorList","RPCMessageToError","rpcError","msgRegex","Cls","EventBuilder","types","func","blacklistChats","resolved","NewMessage","Raw","StopPropagation","_queue","canGet","resolveGet","canPush","resolvePush","returned","pop","coreObjects","tlobjects","stream","_last","readByte","readInt","readUInt32LE","readLargeInt","readFloat","readFloatLE","readDouble","readDoubleLE","getBuffer","tgReadBytes","firstByte","tgReadString","tgReadBool","tgReadDate","tgReadObject","constructorId","clazz","seek","tellPosition","setPosition","fromReader","tgReadVector","close","position","_stream","write","getValue","_level","level","isBrowser","browser","__nwjs","colors","debug","messageFormat","canSend","levels","stack","format","toISOString","toUpperCase","color","log","MessageContainer","TLMessage","BinaryWriter","USE_INVOKE_AFTER_WITH","_state","_pendingStates","_ready","setReady","append","after","catch","finally","extend","states","batch","MAXIMUM_LENGTH","shift","SIZE_OVERHEAD","MAXIMUM_SIZE","afterId","writeDataAsMessage","unshift","writeUInt32LE","writeInt32LE","containerId","rejectAll","requestState","Mutex","mutex","WebSocketClient","closeError","disconnectedCallback","closed","readData","thisTime","canRead","toReturn","resolveRead","getWebSocketLink","ip","website","onopen","receive","onclose","wasClean","acquire","PromisedWebSockets","MessagePacker","AsyncQueue","tl","events","extensions","helpers","PUBLIC_KEYS","fingerprint","_serverKeys","keyInfo","doAuthentication","nonce","resPQ","factorize","pBuffer","qBuffer","pqInnerData","getBytes","targetFingerprint","targetKey","serverPublicKeyFingerprints","dataWithPadding","dataPadReversed","encryptedData","tempKey","shaDigestKeyWithData","dataWithHash","aesEncrypted","tempKeyXor","keyAesEncrypted","keyAesEncryptedInt","greaterOrEquals","encryptedDataBuffer","serverDhParams","publicKeyFingerprint","sh","nnh","newNonceHash","encryptedAnswer","plainTextAnswer","serverDhInner","dhPrime","ga","gA","serverTime","gb","gab","clientDhInner","retryId","clientDdhInnerHashed","clientDhEncrypted","dhGen","nonceTypes","nonceNumber","calcNewNonceHash","MTProtoState","loggers","body","_getNewMsgId","recv","MtProtoPlainSender","RPCResult","GZIPPacked","RequestState","MsgsAck","MsgsStateInfo","Pong","UpdateConnectionState","UpdateServerTimeOffset","BadServerSalt","BadMsgNotification","MsgDetailedInfo","MsgNewDetailedInfo","NewSessionCreated","FutureSalts","MsgsStateReq","MsgResendReq","MsgsAllInfo","LogOut","_dcId","_retries","_delay","_connectTimeout","_updateCallback","_autoReconnectCallback","autoReconnectCallback","_isMainSender","_onConnectionBreak","_send_loop_handle","_recv_loop_handle","_send_queue","_pending_state","_pending_ack","_last_acks","_handlers","_handleRPCResult","_handleContainer","_handleGzipPacked","_handlePong","_handleBadServerSalt","_handleBadNotification","_handleDetailedInfo","_handleNewDetailedInfo","_handleNewSessionCreated","_handleAck","_handleFutureSalts","_handleStateForgotten","_handleMsgAll","force","_connect","connected","disconnected","_disconnect","plain","_sendLoop","_recvLoop","ack","msgIds","encryptMessageData","reconnect","decryptMessageData","broken","_processMessage","obj","handler","_popStates","toPop","reqMsgId","readResult","innerMessage","pong","newTimeOffset","updateTimeOffset","badSalt","badMsgId","newServerSalt","badMsg","errorCode","_sequence","answerMsgId","serverSalt","repeat","_reconnect","reset","newConnection","_ip","_port","InvokeAfterMsg","_lastMsgId","updateMessageId","msgKey","sha256a","sha256b","contentRelated","seqNo","_getSeqNo","gzipIfSmaller","waitForKey","_calcKey","ourKey","remoteMsgId","remoteSequence","containerLen","nanoseconds","newMsgId","shiftLeft","or","correctMsgId","bad","old","pending","Connection","_connected","_sendTask","_recvTask","_codec","_obfuscation","_sendArray","_recvArray","socket","disconnectCallback","PacketCodecClass","_initConn","fromCallback","_send","_recv","tag","encodedPacket","encodePacket","readPacket","PacketCodec","_conn","ObfuscatedConnection","ObfuscatedIO","AbridgedPacketCodec","props","obfuscateTag","ConnectionTCPAbridged","initHeader","_encrypt","encryptor","_decrypt","decryptor","packetCodec","ok","toJSON","randomReversed","encryptKey","encryptIv","decryptKey","decryptIv","readExactly","ConnectionTCPFull","MTProtoPlainSender","StorageSession","CACHE_NAME","_storageKey","cached","_sessionData","_callback","_authKeys","mainDcId","hashes","skipOnUpdate","_serverAddress","idb","_delete","del","_fetchFromCache","_saveToCache","localStorage","removeItem","getItem","setItem","_takeoutId","_updateStates","_authKey","sessionInfo","_sessionString","_loadFromSessionString","skipUpdateStorage","_updateStorage","asHex","mainDcIdStr","mainDcKey","StringSession","decode","readUInt8","serverAddressLen","readInt16BE","dcBuffer","addressBuffer","addressLengthBuffer","writeInt16BE","portBuffer","encode","Memory","CacheApiSession","LocalStorageSession","IdbSession","CallbackSession","api","sub","parseTl","serializeBytes","serializeDate","tlContent","schemeContent","CACHING_SUPPORTED","CACHE_KEY","extractParams","fileContent","f","functions","d","isFunction","argToBytes","writeDoubleLE","getArgFromReader","arg","isVector","useVectorId","flagIndicator","skipConstructorId","createClasses","classesType","classes","classParams","subclassOfId","argsConfig","namespace","fullName","VirtualClass","argName","isFlag","flagIndex","idForBytes","flagCalculate","boxed","charAt","definitions","fromCache","jsonCache","loadFromCache","constructorParamsApi","functionParamsApi","constructorParamsSchema","functionParamsSchema","loadFromTlSchemas","obj1","obj2","mergeWithNamespaces","buildApiFromTlSchema","gzipped","toBytes","gzip","ungzip","containerLength","before","tlMessage","RpcError","innerCode","snakeToCamelCase","_","variableSnakeToCamelCase","CORE_TYPES","AUTH_KEY_TYPES","findAll","regex","matches","RegExp","source","exec","fromLine","line","argsMatch","currentConfig","hexId","representation","brace","argType","buildArgConfig","flagMatch","vectorMatch","ignoreIds","o","objAll","objByName","objByType","commentIndex","trim","followingTypes","dt","fill","t","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","loaded","__webpack_modules__","__webpack_exports__","O","chunkIds","priority","notFulfilled","fulfilled","every","splice","getter","__esModule","definition","defineProperty","enumerable","chunkId","miniCssF","globalThis","Function","prop","prototype","Symbol","toStringTag","nmd","paths","children","scriptUrl","importScripts","currentScript","src","scripts","getElementsByTagName","installedChunks","chunkLoadingGlobal","parentChunkLoadingFunction","moreModules","runtime"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/524.157e5943ba0ef80e2cdd.js b/dist/524.c17eab1f1ac04dc51e06.js similarity index 99% rename from dist/524.157e5943ba0ef80e2cdd.js rename to dist/524.c17eab1f1ac04dc51e06.js index 36ff24d6..3c1243f3 100644 --- a/dist/524.157e5943ba0ef80e2cdd.js +++ b/dist/524.c17eab1f1ac04dc51e06.js @@ -1,2 +1,2 @@ (()=>{"use strict";const e="tt-media-progressive",t="tt-assets";"undefined"!=typeof window&&window.innerHeight,Math.round(425),new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory"]),new Set(["image/png","image/gif","image/jpeg","video/mp4","video/avi","video/quicktime"]);const s=e=>new Promise((t=>{setTimeout((()=>t()),e)})),n=524288,a=new Map;var i,o;self.addEventListener("message",(e=>{const{type:t,messageId:s,result:n}=e.data;if("partResponse"===t){const e=a.get(s);e&&e.resolve(n)}})),(o=i||(i={})).True="1",o.False="0";let r=(new Date).valueOf();const c=new Set,d={};function l(e){return e.custom.from_id?parseInt(e.custom.from_id,10):e.custom.chat_id?-1*parseInt(e.custom.chat_id,10):e.custom.channel_id?-1*parseInt(e.custom.channel_id,10):void 0}function u(e){if(e.custom.msg_id)return parseInt(e.custom.msg_id,10)}async function f(e){const t=(await self.clients.matchAll({type:"window"})).filter((e=>e.url===self.registration.scope)),s=t[0];s&&0!==t.length&&s.postMessage({type:"playNotificationSound",payload:{id:e}})}function g({chatId:e,messageId:t,body:s,title:n,icon:a}){const i=(new Date).valueOf()-r<1e3,o={body:s,data:{chatId:e,messageId:t,count:1},icon:a||"icon-192x192.png",badge:"icon-192x192.png",tag:String(i?0:e||0),vibrate:[200,100,200]};return Promise.all([f(t||e||0),self.registration.showNotification(n,o)])}async function p(e,t){const{chatId:s,messageId:n}=t;if(s){e.postMessage({type:"focusMessage",payload:{chatId:s,messageId:n}});try{await e.focus()}catch(e){}}}self.onsync=()=>{r=(new Date).valueOf()};const m=/[0-9a-f]{20}.*\.(js|css|woff2?|svg|png|jpg|jpeg|json|wasm)$/;self.addEventListener("install",(e=>{e.waitUntil(self.skipWaiting())})),self.addEventListener("activate",(e=>{e.waitUntil(Promise.race([s(3e3),Promise.all([self.caches.delete(t),self.clients.claim()])]))})),self.addEventListener("fetch",(i=>{const{url:o}=i.request;return o.includes("/progressive/")?(i.respondWith(async function(t){const{url:i}=t.request,o=t.request.headers.get("range"),r=/^bytes=(\d+)-(\d+)?$/g.exec(o||""),c=Number(r[1]);let d=Number(r[2]);if((!d||d-c+1>n)&&(d=c+n-1),0===c&&1===d){const e=t.request.url.match(/fileSize=(\d+)&mimeType=([\w/]+)/),s=e&&Number(e[1]),n=null==e?void 0:e[2];if(s&&n)return new Response(new Uint8Array(2).buffer,{status:206,statusText:"Partial Content",headers:[["Content-Range",`bytes 0-1/${s}`],["Accept-Ranges","bytes"],["Content-Length","2"],["Content-Type",n]]})}const l=`${i}?start=${c}&end=${d}`,[u,f]=await async function(t){const s=await self.caches.open(e);return Promise.all([s.match(`${t}&type=arrayBuffer`).then((e=>e?e.arrayBuffer():void 0)),s.match(`${t}&type=headers`).then((e=>e?e.json():void 0))])}(l);if(u)return new Response(u,{status:206,statusText:"Partial Content",headers:f});let g;try{g=await async function(e,t){if(!e.clientId)return;const n=await self.clients.get(e.clientId);if(!n)return;const i=(e=>{let t;do{t=String(Math.random()).replace("0.","id")}while(e.hasOwnProperty(t));return t})(a),o={},r=Promise.race([s(6e4).then((()=>Promise.reject(new Error("ERROR_PART_TIMEOUT")))),new Promise(((e,t)=>{Object.assign(o,{resolve:e,reject:t})}))]);return a.set(i,o),r.catch((()=>{})).finally((()=>{a.delete(i)})),n.postMessage({type:"requestPart",messageId:i,params:t}),r}(t,{url:i,start:c,end:d})}catch(e){}if(!g)return new Response("",{status:500,statusText:"Failed to fetch progressive part"});const{arrayBuffer:p,fullSize:m,mimeType:w}=g,h=Math.min(d-c+1,p.byteLength);d=c+h-1;const y=p.slice(0,h),v=[["Content-Range",`bytes ${c}-${d}/${m}`],["Accept-Ranges","bytes"],["Content-Length",String(h)],["Content-Type",w]];return h<=524288&&d<2097151&&async function(t,s,n){const a=await self.caches.open(e);Promise.all([a.put(new Request(`${t}&type=arrayBuffer`),new Response(s)),a.put(new Request(`${t}&type=headers`),new Response(JSON.stringify(n)))])}(l,y,v),new Response(y,{status:206,statusText:"Partial Content",headers:v})}(i)),!0):!(!o.startsWith("http")||!o.match(m)||(i.respondWith(async function(e){const s=await self.caches.open(t),n=await s.match(e.request);if(n){if(n.ok)return n;await s.delete(e.request)}const a=await fetch(e.request);return a.ok&&s.put(e.request,a.clone()),a}(i)),0))})),self.addEventListener("push",(function(e){const t=function(e){try{return e.data.json()}catch(e){return}}(e);if(!t||t.mute===i.True)return;const s=function(e){return{chatId:l(e),messageId:u(e),title:e.title||"Telegram WebZ",body:e.description}}(t);c.has(s.messageId)?c.delete(s.messageId):e.waitUntil(g(s))})),self.addEventListener("notificationclick",(function(e){const t=new URL(self.registration.scope).origin;e.notification.close();const{data:s}=e.notification;e.waitUntil((async()=>{const e=(await self.clients.matchAll({type:"window"})).filter((e=>new URL(e.url).origin===t));if(await Promise.all(e.map((e=>(d[e.id]=s,p(e,s))))),self.clients.openWindow&&!(e.length>0)){d[0]=s;try{const e=await self.clients.openWindow(t);e&&(d[e.id]=s)}catch(e){}}})())})),self.addEventListener("message",(function(e){if(!e.data)return;const t=e.source;if("clientReady"===e.data.type){const s=d[t.id]||d[0];s&&(delete d[t.id],delete d[0],e.waitUntil(p(t,s)))}if("newMessageNotification"===e.data.type){const t=e.data.payload;c.add(t.messageId),e.waitUntil(g(t))}"closeMessageNotifications"===e.data.type&&e.waitUntil(async function({chatId:e,lastReadInboxMessageId:t}){const s=await self.registration.getNotifications(),n=t||Number.MAX_VALUE;s.forEach((t=>{("0"===t.tag||t.data.chatId===e&&t.data.messageId<=n)&&t.close()}))}(e.data.payload))}))})(); -//# sourceMappingURL=524.157e5943ba0ef80e2cdd.js.map \ No newline at end of file +//# sourceMappingURL=524.c17eab1f1ac04dc51e06.js.map \ No newline at end of file diff --git a/dist/524.157e5943ba0ef80e2cdd.js.map b/dist/524.c17eab1f1ac04dc51e06.js.map similarity index 99% rename from dist/524.157e5943ba0ef80e2cdd.js.map rename to dist/524.c17eab1f1ac04dc51e06.js.map index c04c194f..55507b63 100644 --- a/dist/524.157e5943ba0ef80e2cdd.js.map +++ b/dist/524.c17eab1f1ac04dc51e06.js.map @@ -1 +1 @@ -{"version":3,"file":"524.157e5943ba0ef80e2cdd.js","mappings":"mBAAO,MA6BMA,EAA+B,uBAI/BC,EAAmB,YAKM,oBAAXC,QAA0BA,OAAOC,YA2DzBC,KAAKC,MAAM,KACJ,IAAIC,IAAI,CAChD,aAAc,sBAAuB,iBAAkB,0BAA2B,kBAwBtC,IAAIA,IAAI,CACpD,YAAa,YAAa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AEjB,IACE,MAAMsI,QAAkB5I,KAAK0B,QAAQiH,WAAWL,GAC5CM,IAEF/H,EAAY+H,EAAUpH,IAAMlB,GAE9B,MAAO6C,OAQC0F,OChKd7I,KAAKC,iBAAiB,WDmKf,SAA6BC,GAKlC,IAAKA,EAAEI,KAAM,OACb,MAAMwI,EAAS5I,EAAE4I,OACjB,GAAoB,gBAAhB5I,EAAEI,KAAKH,KAAwB,CAEjC,MAAMG,EAAOO,EAAYiI,EAAOtH,KAAOX,EAAY,GAC/CP,WACKO,EAAYiI,EAAOtH,WACnBX,EAAY,GACnBX,EAAEoD,UAAUL,EAAiB6F,EAAQxI,KAGzC,GAAoB,2BAAhBJ,EAAEI,KAAKH,KAAmC,CAE5C,MAAM8H,EAAiC/H,EAAEI,KAAK6B,QAE9CvB,EAAmBmI,IAAId,EAAa7H,WACpCF,EAAEoD,UAAUlB,EAAiB6F,IAGX,8BAAhB/H,EAAEI,KAAKH,MACTD,EAAEoD,UA7HNhC,gBAAkC,OAChCe,EADgC,uBAEhC2G,IAEA,MAAMC,QAAsBjJ,KAAK+B,aAAamH,mBACxCC,EAAgBH,GAA0B5E,OAAOgF,UACvDH,EAAcI,SAASpB,KAEE,MAArBA,EAAapF,KACToF,EAAa3H,KAAK+B,SAAWA,GAAU4F,EAAa3H,KAAKF,WAAa+I,IAE1ElB,EAAaQ,WAkHHa,CAAmBpJ,EAAEI,KAAK6B,c","sources":["webpack://telegram-t/./src/config.ts","webpack://telegram-t/./src/util/schedulers.ts","webpack://telegram-t/./src/serviceWorker/progressive.ts","webpack://telegram-t/./src/serviceWorker/pushNotification.ts","webpack://telegram-t/./src/serviceWorker.ts","webpack://telegram-t/./src/serviceWorker/assetCache.ts","webpack://telegram-t/./src/util/generateIdFor.ts"],"sourcesContent":["export const PAGE_TITLE = 'Telegram';\nexport const INACTIVE_MARKER = ' [Inactive]';\n\nexport const APP_NAME = process.env.APP_NAME || 'Telegram WebZ';\nexport const APP_VERSION = process.env.APP_VERSION || 'dev';\n\nexport const DEBUG = (\n process.env.APP_ENV !== 'production' && process.env.APP_ENV !== 'perf' && process.env.APP_ENV !== 'test'\n);\nexport const DEBUG_MORE = false;\n\nexport const IS_TEST = process.env.APP_ENV === 'test';\nexport const IS_PERF = process.env.APP_ENV === 'perf';\n\nexport const DEBUG_ALERT_MSG = 'Shoot!\\nSomething went wrong, please see the error details in Dev Tools Console.';\nexport const DEBUG_GRAMJS = false;\n\nexport const SESSION_USER_KEY = 'user_auth';\nexport const LEGACY_SESSION_KEY = 'GramJs:sessionId';\n\nexport const GLOBAL_STATE_CACHE_DISABLED = false;\nexport const GLOBAL_STATE_CACHE_KEY = 'tt-global-state';\nexport const GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT = 30;\nexport const GLOBAL_STATE_CACHE_USER_LIST_LIMIT = 5000;\n\nexport const MEDIA_CACHE_DISABLED = false;\nexport const MEDIA_CACHE_NAME = 'tt-media';\nexport const MEDIA_CACHE_NAME_AVATARS = 'tt-media-avatars';\nexport const MEDIA_PROGRESSIVE_CACHE_DISABLED = false;\nexport const MEDIA_PROGRESSIVE_CACHE_NAME = 'tt-media-progressive';\nexport const MEDIA_CACHE_MAX_BYTES = 512 * 1024; // 512 KB\nexport const CUSTOM_BG_CACHE_NAME = 'tt-custom-bg';\nexport const LANG_CACHE_NAME = 'tt-lang-packs-v5';\nexport const ASSET_CACHE_NAME = 'tt-assets';\n\nexport const DOWNLOAD_WORKERS = 16;\nexport const UPLOAD_WORKERS = 16;\n\nconst isBigScreen = typeof window !== 'undefined' && window.innerHeight >= 900;\n\nexport const MIN_PASSWORD_LENGTH = 1;\n\nexport const MESSAGE_LIST_SENSITIVE_AREA = 750;\nexport const MESSAGE_LIST_SLICE = isBigScreen ? 60 : 40;\nexport const MESSAGE_LIST_VIEWPORT_LIMIT = MESSAGE_LIST_SLICE * 2;\n\nexport const CHAT_HEIGHT_PX = 72;\nexport const CHAT_LIST_SLICE = isBigScreen ? 30 : 25;\nexport const CHAT_LIST_LOAD_SLICE = 100;\nexport const SHARED_MEDIA_SLICE = 42;\nexport const MESSAGE_SEARCH_SLICE = 42;\nexport const GLOBAL_SEARCH_SLICE = 20;\nexport const MEMBERS_SLICE = 30;\nexport const MEMBERS_LOAD_SLICE = 200;\nexport const PINNED_MESSAGES_LIMIT = 50;\nexport const BLOCKED_LIST_LIMIT = 100;\nexport const PROFILE_PHOTOS_LIMIT = 40;\nexport const PROFILE_SENSITIVE_AREA = 500;\n\nexport const TOP_CHAT_MESSAGES_PRELOAD_LIMIT = 20;\nexport const ALL_CHATS_PRELOAD_DISABLED = false;\n\nexport const ANIMATION_LEVEL_MIN = 0;\nexport const ANIMATION_LEVEL_MED = 1;\nexport const ANIMATION_LEVEL_MAX = 2;\nexport const ANIMATION_LEVEL_DEFAULT = ANIMATION_LEVEL_MAX;\n\nexport const DEFAULT_MESSAGE_TEXT_SIZE_PX = 16;\nexport const IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 17;\nexport const MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 15;\n\nexport const DRAFT_DEBOUNCE = 10000; // 10s\n\nexport const EDITABLE_INPUT_ID = 'editable-message-text';\nexport const EDITABLE_INPUT_MODAL_ID = 'editable-message-text-modal';\n\n// Screen width where Pinned Message / Audio Player in the Middle Header can be safely displayed\nexport const SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1440; // px\n// Screen width where Pinned Message / Audio Player in the Middle Header shouldn't collapse with ChatInfo\nexport const SAFE_SCREEN_WIDTH_FOR_CHAT_INFO = 1150; // px\n\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1275; // px\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN = 925; // px\nexport const MOBILE_SCREEN_MAX_WIDTH = 600; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH = 950; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT = 450; // px\n\nexport const LOCAL_MESSAGE_ID_BASE = 1e9;\n\nexport const ANIMATION_END_DELAY = 100;\n\nexport const FAST_SMOOTH_MAX_DISTANCE = 1500;\nexport const FAST_SMOOTH_MIN_DURATION = 250;\nexport const FAST_SMOOTH_MAX_DURATION = 600;\nexport const FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE = 500; // px\n\n// Average duration of message sending animation\nexport const API_UPDATE_THROTTLE = Math.round((FAST_SMOOTH_MIN_DURATION + FAST_SMOOTH_MAX_DURATION) / 2);\nexport const API_THROTTLE_RESET_UPDATES = new Set([\n 'newMessage', 'newScheduledMessage', 'deleteMessages', 'deleteScheduledMessages', 'deleteHistory',\n]);\n\nexport const STICKER_SIZE_INLINE_DESKTOP_FACTOR = 13;\nexport const STICKER_SIZE_INLINE_MOBILE_FACTOR = 11;\nexport const STICKER_SIZE_AUTH = 160;\nexport const STICKER_SIZE_AUTH_MOBILE = 120;\nexport const STICKER_SIZE_PICKER = 64;\nexport const STICKER_SIZE_GENERAL_SETTINGS = 48;\nexport const STICKER_SIZE_PICKER_HEADER = 32;\nexport const STICKER_SIZE_SEARCH = 64;\nexport const STICKER_SIZE_MODAL = 64;\nexport const STICKER_SIZE_TWO_FA = 160;\nexport const STICKER_SIZE_DISCUSSION_GROUPS = 140;\nexport const STICKER_SIZE_FOLDER_SETTINGS = 80;\nexport const STICKER_SIZE_INLINE_BOT_RESULT = 100;\nexport const RECENT_STICKERS_LIMIT = 20;\nexport const MEMOJI_STICKER_ID = 'MEMOJI_STICKER';\n\nexport const BASE_EMOJI_KEYWORD_LANG = 'en';\n\nexport const MENU_TRANSITION_DURATION = 200;\nexport const SLIDE_TRANSITION_DURATION = 450;\n\nexport const CONTENT_TYPES_FOR_QUICK_UPLOAD = new Set([\n 'image/png', 'image/gif', 'image/jpeg', 'video/mp4', 'video/avi', 'video/quicktime',\n]);\n\n// eslint-disable-next-line max-len\nexport const RE_LINK_TEMPLATE = '((ftp|https?):\\\\/\\\\/)?((www\\\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\\\.[a-zA-Z0-9()]{1,63})\\\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)';\nexport const RE_MENTION_TEMPLATE = '(@[\\\\w\\\\d_-]+)';\nexport const RE_TME_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/)([\\d\\w_]+)(?:\\/([\\d]+))?(?:\\/([\\d]+))?$/gm;\nexport const RE_TME_INVITE_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/joinchat\\/)([\\d\\w_-]+)?$/gm;\n\n// MTProto constants\nexport const SERVICE_NOTIFICATIONS_USER_ID = 777000;\nexport const REPLIES_USER_ID = 1271266957;\nexport const ALL_FOLDER_ID = 0;\nexport const ARCHIVED_FOLDER_ID = 1;\nexport const DELETED_COMMENTS_CHANNEL_ID = 777;\nexport const MAX_MEDIA_FILES_FOR_ALBUM = 10;\nexport const MAX_ACTIVE_PINNED_CHATS = 5;\nexport const SCHEDULED_WHEN_ONLINE = 0x7FFFFFFE;\nexport const DEFAULT_LANG_CODE = 'en';\nexport const DEFAULT_LANG_PACK = 'android';\nexport const LANG_PACKS = ['android', 'ios', 'tdesktop', 'macos'] as const;\nexport const TIPS_USERNAME = 'TelegramTips';\nexport const LOCALIZED_TIPS = ['ar', 'pt-br', 'id', 'it', 'ko', 'ms', 'pl', 'es', 'tr'];\nexport const FEEDBACK_URL = 'https://bugs.telegram.org/?tag_ids=41&sort=time';\nexport const LIGHT_THEME_BG_COLOR = '#A2AF8E';\nexport const DARK_THEME_BG_COLOR = '#0F0F0F';\nexport const DARK_THEME_PATTERN_COLOR = '#0a0a0a8c';\nexport const DEFAULT_PATTERN_COLOR = 'rgba(90, 110, 70, 0.6)';\n","type Scheduler =\n typeof requestAnimationFrame\n | typeof onTickEnd\n | typeof runNow;\n\nexport function debounce(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n shouldRunLast = true,\n) {\n let waitingTimeout: number | undefined;\n\n return (...args: Parameters) => {\n if (waitingTimeout) {\n clearTimeout(waitingTimeout);\n waitingTimeout = undefined;\n } else if (shouldRunFirst) {\n // @ts-ignore\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n waitingTimeout = self.setTimeout(() => {\n if (shouldRunLast) {\n // @ts-ignore\n fn(...args);\n }\n\n waitingTimeout = undefined;\n }, ms);\n };\n}\n\nexport function throttle(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n) {\n let interval: number | undefined;\n let isPending: boolean;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n isPending = true;\n args = _args;\n\n if (!interval) {\n if (shouldRunFirst) {\n isPending = false;\n // @ts-ignore\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n interval = self.setInterval(() => {\n if (!isPending) {\n // eslint-disable-next-line no-restricted-globals\n self.clearInterval(interval!);\n interval = undefined;\n return;\n }\n\n isPending = false;\n // @ts-ignore\n fn(...args);\n }, ms);\n }\n };\n}\n\nexport function throttleWithRaf(fn: F) {\n return throttleWith(fastRaf, fn);\n}\n\nexport function throttleWithPrimaryRaf(fn: F) {\n return throttleWith(fastPrimaryRaf, fn);\n}\n\nexport function throttleWithTickEnd(fn: F) {\n return throttleWith(onTickEnd, fn);\n}\n\nexport function throttleWithNow(fn: F) {\n return throttleWith(runNow, fn);\n}\n\nexport function throttleWith(schedulerFn: Scheduler, fn: F) {\n let waiting = false;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n args = _args;\n\n if (!waiting) {\n waiting = true;\n\n schedulerFn(() => {\n waiting = false;\n // @ts-ignore\n fn(...args);\n });\n }\n };\n}\n\nexport function onTickEnd(cb: NoneToVoidFunction) {\n Promise.resolve().then(cb);\n}\n\nexport function onIdle(cb: NoneToVoidFunction) {\n // eslint-disable-next-line no-restricted-globals\n if (self.requestIdleCallback) {\n // eslint-disable-next-line no-restricted-globals\n self.requestIdleCallback(cb);\n } else {\n onTickEnd(cb);\n }\n}\n\nfunction runNow(fn: NoneToVoidFunction) {\n fn();\n}\n\nexport const pause = (ms: number) => new Promise((resolve) => {\n setTimeout(() => resolve(), ms);\n});\n\nexport function rafPromise() {\n return new Promise((resolve) => {\n fastRaf(resolve);\n });\n}\n\nlet fastRafCallbacks: NoneToVoidFunction[] | undefined;\nlet fastRafPrimaryCallbacks: NoneToVoidFunction[] | undefined;\n\n// May result in an immediate execution if called from another `requestAnimationFrame` callback\nexport function fastRaf(callback: NoneToVoidFunction, isPrimary = false) {\n if (!fastRafCallbacks) {\n fastRafCallbacks = isPrimary ? [] : [callback];\n fastRafPrimaryCallbacks = isPrimary ? [callback] : [];\n\n requestAnimationFrame(() => {\n const currentCallbacks = fastRafCallbacks!;\n const currentPrimaryCallbacks = fastRafPrimaryCallbacks!;\n fastRafCallbacks = undefined;\n fastRafPrimaryCallbacks = undefined;\n currentPrimaryCallbacks.forEach((cb) => cb());\n currentCallbacks.forEach((cb) => cb());\n });\n } else if (isPrimary) {\n fastRafPrimaryCallbacks!.push(callback);\n } else {\n fastRafCallbacks.push(callback);\n }\n}\n\nexport function fastPrimaryRaf(callback: NoneToVoidFunction) {\n fastRaf(callback, true);\n}\n\nlet beforeUnloadCallbacks: NoneToVoidFunction[] | undefined;\n\nexport function onBeforeUnload(callback: NoneToVoidFunction, isLast = false) {\n if (!beforeUnloadCallbacks) {\n beforeUnloadCallbacks = [];\n // eslint-disable-next-line no-restricted-globals\n self.addEventListener('beforeunload', () => {\n beforeUnloadCallbacks!.forEach((cb) => cb());\n });\n }\n\n if (isLast) {\n beforeUnloadCallbacks.push(callback);\n } else {\n beforeUnloadCallbacks.unshift(callback);\n }\n\n return () => {\n beforeUnloadCallbacks = beforeUnloadCallbacks!.filter((cb) => cb !== callback);\n };\n}\n","import { pause } from '../util/schedulers';\nimport generateIdFor from '../util/generateIdFor';\nimport {\n DEBUG,\n MEDIA_CACHE_MAX_BYTES,\n MEDIA_PROGRESSIVE_CACHE_DISABLED,\n MEDIA_PROGRESSIVE_CACHE_NAME,\n} from '../config';\n\ndeclare const self: ServiceWorkerGlobalScope;\n\ntype PartInfo = {\n type: 'PartInfo';\n arrayBuffer: ArrayBuffer;\n mimeType: 'string';\n fullSize: number;\n};\n\ntype RequestStates = {\n resolve: (response: PartInfo) => void;\n reject: () => void;\n};\n\nconst MB = 1024 * 1024;\nconst DEFAULT_PART_SIZE = 0.5 * MB;\nconst MAX_END_TO_CACHE = 2 * MB - 1; // We only cache the first 2 MB of each file\nconst PART_TIMEOUT = 60000;\n\nconst requestStates = new Map();\n\nexport async function respondForProgressive(e: FetchEvent) {\n const { url } = e.request;\n const range = e.request.headers.get('range');\n const bytes = /^bytes=(\\d+)-(\\d+)?$/g.exec(range || '')!;\n const start = Number(bytes[1]);\n const originalEnd = Number(bytes[2]);\n\n let end = originalEnd;\n if (!end || (end - start + 1) > DEFAULT_PART_SIZE) {\n end = start + DEFAULT_PART_SIZE - 1;\n }\n\n // Optimization for Safari\n if (start === 0 && end === 1) {\n const match = e.request.url.match(/fileSize=(\\d+)&mimeType=([\\w/]+)/);\n const fileSize = match && Number(match[1]);\n const mimeType = match?.[2];\n\n if (fileSize && mimeType) {\n return new Response(new Uint8Array(2).buffer, {\n status: 206,\n statusText: 'Partial Content',\n headers: [\n ['Content-Range', `bytes 0-1/${fileSize}`],\n ['Accept-Ranges', 'bytes'],\n ['Content-Length', '2'],\n ['Content-Type', mimeType],\n ],\n });\n }\n }\n\n const cacheKey = `${url}?start=${start}&end=${end}`;\n const [cachedArrayBuffer, cachedHeaders] = !MEDIA_PROGRESSIVE_CACHE_DISABLED ? await fetchFromCache(cacheKey) : [];\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log(\n `FETCH PROGRESSIVE ${cacheKey} (request: ${start}-${originalEnd}) CACHED: ${Boolean(cachedArrayBuffer)}`,\n );\n }\n\n if (cachedArrayBuffer) {\n return new Response(cachedArrayBuffer, {\n status: 206,\n statusText: 'Partial Content',\n headers: cachedHeaders,\n });\n }\n\n let partInfo;\n try {\n partInfo = await requestPart(e, { url, start, end });\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('FETCH PROGRESSIVE', err);\n }\n }\n\n if (!partInfo) {\n return new Response('', {\n status: 500,\n statusText: 'Failed to fetch progressive part',\n });\n }\n\n const { arrayBuffer, fullSize, mimeType } = partInfo;\n\n const partSize = Math.min(end - start + 1, arrayBuffer.byteLength);\n end = start + partSize - 1;\n const arrayBufferPart = arrayBuffer.slice(0, partSize);\n const headers = [\n ['Content-Range', `bytes ${start}-${end}/${fullSize}`],\n ['Accept-Ranges', 'bytes'],\n ['Content-Length', String(partSize)],\n ['Content-Type', mimeType],\n ];\n\n if (!MEDIA_PROGRESSIVE_CACHE_DISABLED && partSize <= MEDIA_CACHE_MAX_BYTES && end < MAX_END_TO_CACHE) {\n saveToCache(cacheKey, arrayBufferPart, headers);\n }\n\n return new Response(arrayBufferPart, {\n status: 206,\n statusText: 'Partial Content',\n headers,\n });\n}\n\n// We can not cache 206 responses: https://github.com/GoogleChrome/workbox/issues/1644#issuecomment-638741359\nasync function fetchFromCache(cacheKey: string) {\n const cache = await self.caches.open(MEDIA_PROGRESSIVE_CACHE_NAME);\n\n return Promise.all([\n cache.match(`${cacheKey}&type=arrayBuffer`).then((r) => (r ? r.arrayBuffer() : undefined)),\n cache.match(`${cacheKey}&type=headers`).then((r) => (r ? r.json() : undefined)),\n ]);\n}\n\nasync function saveToCache(cacheKey: string, arrayBuffer: ArrayBuffer, headers: HeadersInit) {\n const cache = await self.caches.open(MEDIA_PROGRESSIVE_CACHE_NAME);\n\n return Promise.all([\n cache.put(new Request(`${cacheKey}&type=arrayBuffer`), new Response(arrayBuffer)),\n cache.put(new Request(`${cacheKey}&type=headers`), new Response(JSON.stringify(headers))),\n ]);\n}\n\nasync function requestPart(\n e: FetchEvent,\n params: { url: string; start: number; end: number },\n): Promise {\n if (!e.clientId) {\n return undefined;\n }\n\n // eslint-disable-next-line no-restricted-globals\n const client = await self.clients.get(e.clientId);\n if (!client) {\n return undefined;\n }\n\n const messageId = generateIdFor(requestStates);\n const requestState = {} as RequestStates;\n\n const promise = Promise.race([\n pause(PART_TIMEOUT).then(() => Promise.reject(new Error('ERROR_PART_TIMEOUT'))),\n new Promise((resolve, reject) => {\n Object.assign(requestState, { resolve, reject });\n }),\n ]);\n\n requestStates.set(messageId, requestState);\n promise\n .catch(() => undefined)\n .finally(() => {\n requestStates.delete(messageId);\n });\n\n client.postMessage({\n type: 'requestPart',\n messageId,\n params,\n });\n\n return promise;\n}\n\nself.addEventListener('message', (e) => {\n const { type, messageId, result } = e.data as {\n type: string;\n messageId: string;\n result: PartInfo;\n };\n\n if (type === 'partResponse') {\n const requestState = requestStates.get(messageId);\n if (requestState) {\n requestState.resolve(result);\n }\n }\n});\n","import { APP_NAME, DEBUG } from '../config';\n\ndeclare const self: ServiceWorkerGlobalScope;\n\nenum Boolean {\n True = '1',\n False = '0',\n}\n\ntype PushData = {\n custom: {\n msg_id?: string;\n channel_id?: string;\n chat_id?: string;\n from_id?: string;\n };\n mute: Boolean;\n badge: Boolean;\n loc_key: string;\n loc_args: string[];\n random_id: number;\n title: string;\n description: string;\n};\n\ntype NotificationData = {\n messageId?: number;\n chatId?: number;\n title: string;\n body: string;\n icon?: string;\n};\n\ntype CloseNotificationData = {\n lastReadInboxMessageId?: number;\n chatId: number;\n};\n\nlet lastSyncAt = new Date().valueOf();\nconst shownNotifications = new Set();\nconst clickBuffer: Record = {};\n\nfunction getPushData(e: PushEvent | Notification): PushData | undefined {\n try {\n return e.data.json();\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] Unable to parse push notification data', e.data);\n }\n return undefined;\n }\n}\n\nfunction getChatId(data: PushData) {\n if (data.custom.from_id) {\n return parseInt(data.custom.from_id, 10);\n }\n // Chats and channels have negative IDs\n if (data.custom.chat_id) {\n return parseInt(data.custom.chat_id, 10) * -1;\n }\n if (data.custom.channel_id) {\n return parseInt(data.custom.channel_id, 10) * -1;\n }\n return undefined;\n}\n\nfunction getMessageId(data: PushData) {\n if (!data.custom.msg_id) return undefined;\n return parseInt(data.custom.msg_id, 10);\n}\n\nfunction getNotificationData(data: PushData): NotificationData {\n return {\n chatId: getChatId(data),\n messageId: getMessageId(data),\n title: data.title || APP_NAME,\n body: data.description,\n };\n}\n\nasync function playNotificationSound(id: number) {\n const clients = await self.clients.matchAll({ type: 'window' }) as WindowClient[];\n const clientsInScope = clients.filter((client) => client.url === self.registration.scope);\n const client = clientsInScope[0];\n if (!client) return;\n if (clientsInScope.length === 0) return;\n client.postMessage({\n type: 'playNotificationSound',\n payload: { id },\n });\n}\n\nfunction showNotification({\n chatId,\n messageId,\n body,\n title,\n icon,\n}: NotificationData) {\n const isFirstBatch = new Date().valueOf() - lastSyncAt < 1000;\n const tag = String(isFirstBatch ? 0 : chatId || 0);\n const options: NotificationOptions = {\n body,\n data: {\n chatId,\n messageId,\n count: 1,\n },\n icon: icon || 'icon-192x192.png',\n badge: 'icon-192x192.png',\n tag,\n vibrate: [200, 100, 200],\n };\n\n return Promise.all([\n playNotificationSound(messageId || chatId || 0),\n self.registration.showNotification(title, options),\n ]);\n}\n\nasync function closeNotifications({\n chatId,\n lastReadInboxMessageId,\n}: CloseNotificationData) {\n const notifications = await self.registration.getNotifications();\n const lastMessageId = lastReadInboxMessageId || Number.MAX_VALUE;\n notifications.forEach((notification) => {\n if (\n notification.tag === '0'\n || (notification.data.chatId === chatId && notification.data.messageId <= lastMessageId)\n ) {\n notification.close();\n }\n });\n}\n\nexport function handlePush(e: PushEvent) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] Push received event', e);\n if (e.data) {\n // eslint-disable-next-line no-console\n console.log('[SW] Push received with data', e.data.json());\n }\n }\n\n const data = getPushData(e);\n\n // Do not show muted notifications\n if (!data || data.mute === Boolean.True) return;\n\n const notification = getNotificationData(data);\n\n // Dont show already triggered notification\n if (shownNotifications.has(notification.messageId)) {\n shownNotifications.delete(notification.messageId);\n return;\n }\n\n e.waitUntil(showNotification(notification));\n}\n\nasync function focusChatMessage(client: WindowClient, data: { chatId?: number; messageId?: number }) {\n const {\n chatId,\n messageId,\n } = data;\n if (!chatId) return;\n client.postMessage({\n type: 'focusMessage',\n payload: {\n chatId,\n messageId,\n },\n });\n // Catch \"focus not allowed\" DOM Exceptions\n try {\n await client.focus();\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[SW] ', error);\n }\n }\n}\n\nexport function handleNotificationClick(e: NotificationEvent) {\n const appUrl = new URL(self.registration.scope).origin;\n e.notification.close(); // Android needs explicit close.\n const { data } = e.notification;\n const notifyClients = async () => {\n const clients = await self.clients.matchAll({ type: 'window' }) as WindowClient[];\n const clientsInScope = clients.filter((client) => {\n return new URL(client.url).origin === appUrl;\n });\n await Promise.all(clientsInScope.map((client) => {\n clickBuffer[client.id] = data;\n return focusChatMessage(client, data);\n }));\n if (!self.clients.openWindow || clientsInScope.length > 0) return undefined;\n // Store notification data for default client (fix for android)\n clickBuffer[0] = data;\n // If there is no opened client we need to open one and wait until it is fully loaded\n try {\n const newClient = await self.clients.openWindow(appUrl);\n if (newClient) {\n // Store notification data until client is fully loaded\n clickBuffer[newClient.id] = data;\n }\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[SW] ', error);\n }\n }\n return undefined;\n };\n e.waitUntil(notifyClients());\n}\n\nexport function handleClientMessage(e: ExtendableMessageEvent) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] New message from client', e);\n }\n if (!e.data) return;\n const source = e.source as WindowClient;\n if (e.data.type === 'clientReady') {\n // focus on chat message when client is fully ready\n const data = clickBuffer[source.id] || clickBuffer[0];\n if (data) {\n delete clickBuffer[source.id];\n delete clickBuffer[0];\n e.waitUntil(focusChatMessage(source, data));\n }\n }\n if (e.data.type === 'newMessageNotification') {\n // store messageId for already shown notification\n const notification: NotificationData = e.data.payload;\n // mark this notification as shown if it was handled locally\n shownNotifications.add(notification.messageId);\n e.waitUntil(showNotification(notification));\n }\n\n if (e.data.type === 'closeMessageNotifications') {\n e.waitUntil(closeNotifications(e.data.payload));\n }\n}\n\nself.onsync = () => {\n lastSyncAt = new Date().valueOf();\n};\n","import { DEBUG } from './config';\nimport { respondForProgressive } from './serviceWorker/progressive';\nimport { respondWithCache, clearAssetCache } from './serviceWorker/assetCache';\nimport { handlePush, handleNotificationClick, handleClientMessage } from './serviceWorker/pushNotification';\nimport { pause } from './util/schedulers';\n\ndeclare const self: ServiceWorkerGlobalScope;\n\nconst ASSET_CACHE_PATTERN = /[0-9a-f]{20}.*\\.(js|css|woff2?|svg|png|jpg|jpeg|json|wasm)$/;\nconst ACTIVATE_TIMEOUT = 3000;\n\nself.addEventListener('install', (e) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('ServiceWorker installed');\n }\n\n // Activate worker immediately\n e.waitUntil(self.skipWaiting());\n});\n\nself.addEventListener('activate', (e) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('ServiceWorker activated');\n }\n\n e.waitUntil(\n Promise.race([\n // An attempt to fix freezing UI on iOS\n pause(ACTIVATE_TIMEOUT),\n Promise.all([\n clearAssetCache(),\n // Become available to all pages\n self.clients.claim(),\n ]),\n ]),\n );\n});\n\n// eslint-disable-next-line no-restricted-globals\nself.addEventListener('fetch', (e: FetchEvent) => {\n const { url } = e.request;\n\n if (url.includes('/progressive/')) {\n e.respondWith(respondForProgressive(e));\n return true;\n }\n\n if (url.startsWith('http') && url.match(ASSET_CACHE_PATTERN)) {\n e.respondWith(respondWithCache(e));\n return true;\n }\n\n return false;\n});\n\nself.addEventListener('push', handlePush);\nself.addEventListener('notificationclick', handleNotificationClick);\nself.addEventListener('message', handleClientMessage);\n","import { ASSET_CACHE_NAME } from '../config';\n\ndeclare const self: ServiceWorkerGlobalScope;\n\nexport async function respondWithCache(e: FetchEvent) {\n const cache = await self.caches.open(ASSET_CACHE_NAME);\n const cached = await cache.match(e.request);\n\n if (cached) {\n if (cached.ok) {\n return cached;\n } else {\n await cache.delete(e.request);\n }\n }\n\n const remote = await fetch(e.request);\n\n if (remote.ok) {\n cache.put(e.request, remote.clone());\n }\n\n return remote;\n}\n\nexport function clearAssetCache() {\n return self.caches.delete(ASSET_CACHE_NAME);\n}\n","export default (store: AnyLiteral) => {\n let id;\n\n do {\n id = String(Math.random()).replace('0.', 'id');\n } while (store.hasOwnProperty(id));\n\n return id;\n};\n"],"names":["MEDIA_PROGRESSIVE_CACHE_NAME","ASSET_CACHE_NAME","window","innerHeight","Math","round","Set","pause","ms","Promise","resolve","setTimeout","DEFAULT_PART_SIZE","requestStates","Map","Boolean","self","addEventListener","e","type","messageId","result","data","requestState","get","lastSyncAt","Date","valueOf","shownNotifications","clickBuffer","getChatId","custom","from_id","parseInt","chat_id","channel_id","getMessageId","msg_id","async","playNotificationSound","id","clientsInScope","clients","matchAll","filter","client","url","registration","scope","length","postMessage","payload","showNotification","chatId","body","title","icon","isFirstBatch","options","count","badge","tag","String","vibrate","all","focusChatMessage","focus","error","onsync","ASSET_CACHE_PATTERN","waitUntil","skipWaiting","race","caches","delete","claim","request","includes","respondWith","range","headers","bytes","exec","start","Number","end","match","fileSize","mimeType","Response","Uint8Array","buffer","status","statusText","cacheKey","cachedArrayBuffer","cachedHeaders","cache","open","then","r","arrayBuffer","undefined","json","fetchFromCache","partInfo","params","clientId","store","random","replace","hasOwnProperty","generateIdFor","promise","reject","Error","Object","assign","set","catch","finally","requestPart","err","fullSize","partSize","min","byteLength","arrayBufferPart","slice","put","Request","JSON","stringify","saveToCache","respondForProgressive","startsWith","cached","ok","remote","fetch","clone","respondWithCache","getPushData","mute","True","notification","process","description","getNotificationData","has","appUrl","URL","origin","close","map","openWindow","newClient","notifyClients","source","add","lastReadInboxMessageId","notifications","getNotifications","lastMessageId","MAX_VALUE","forEach","closeNotifications"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"524.c17eab1f1ac04dc51e06.js","mappings":"mBAAO,MA6BMA,EAA+B,uBAI/BC,EAAmB,YAKM,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,KAAK7G,IACpChB,EAAYgB,EAAOL,IAAMlB,EAClB2C,EAAiBpB,EAAQvB,OAE7BN,KAAK0B,QAAQiH,cAAclH,EAAeQ,OAAS,GAAxD,CAEApB,EAAY,GAAKP,EAEjB,IACE,MAAMsI,QAAkB5I,KAAK0B,QAAQiH,WAAWL,GAC5CM,IAEF/H,EAAY+H,EAAUpH,IAAMlB,GAE9B,MAAO6C,OAQC0F,OChKd7I,KAAKC,iBAAiB,WDmKf,SAA6BC,GAKlC,IAAKA,EAAEI,KAAM,OACb,MAAMwI,EAAS5I,EAAE4I,OACjB,GAAoB,gBAAhB5I,EAAEI,KAAKH,KAAwB,CAEjC,MAAMG,EAAOO,EAAYiI,EAAOtH,KAAOX,EAAY,GAC/CP,WACKO,EAAYiI,EAAOtH,WACnBX,EAAY,GACnBX,EAAEoD,UAAUL,EAAiB6F,EAAQxI,KAGzC,GAAoB,2BAAhBJ,EAAEI,KAAKH,KAAmC,CAE5C,MAAM8H,EAAiC/H,EAAEI,KAAK6B,QAE9CvB,EAAmBmI,IAAId,EAAa7H,WACpCF,EAAEoD,UAAUlB,EAAiB6F,IAGX,8BAAhB/H,EAAEI,KAAKH,MACTD,EAAEoD,UA7HNhC,gBAAkC,OAChCe,EADgC,uBAEhC2G,IAEA,MAAMC,QAAsBjJ,KAAK+B,aAAamH,mBACxCC,EAAgBH,GAA0B5E,OAAOgF,UACvDH,EAAcI,SAASpB,KAEE,MAArBA,EAAapF,KACToF,EAAa3H,KAAK+B,SAAWA,GAAU4F,EAAa3H,KAAKF,WAAa+I,IAE1ElB,EAAaQ,WAkHHa,CAAmBpJ,EAAEI,KAAK6B,c","sources":["webpack://telegram-t/./src/config.ts","webpack://telegram-t/./src/util/schedulers.ts","webpack://telegram-t/./src/serviceWorker/progressive.ts","webpack://telegram-t/./src/serviceWorker/pushNotification.ts","webpack://telegram-t/./src/serviceWorker.ts","webpack://telegram-t/./src/serviceWorker/assetCache.ts","webpack://telegram-t/./src/util/generateIdFor.ts"],"sourcesContent":["export const PAGE_TITLE = 'Telegram';\nexport const INACTIVE_MARKER = ' [Inactive]';\n\nexport const APP_NAME = process.env.APP_NAME || 'Telegram WebZ';\nexport const APP_VERSION = process.env.APP_VERSION || 'dev';\n\nexport const DEBUG = (\n process.env.APP_ENV !== 'production' && process.env.APP_ENV !== 'perf' && process.env.APP_ENV !== 'test'\n);\nexport const DEBUG_MORE = false;\n\nexport const IS_TEST = process.env.APP_ENV === 'test';\nexport const IS_PERF = process.env.APP_ENV === 'perf';\n\nexport const DEBUG_ALERT_MSG = 'Shoot!\\nSomething went wrong, please see the error details in Dev Tools Console.';\nexport const DEBUG_GRAMJS = false;\n\nexport const SESSION_USER_KEY = 'user_auth';\nexport const LEGACY_SESSION_KEY = 'GramJs:sessionId';\n\nexport const GLOBAL_STATE_CACHE_DISABLED = false;\nexport const GLOBAL_STATE_CACHE_KEY = 'tt-global-state';\nexport const GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT = 30;\nexport const GLOBAL_STATE_CACHE_USER_LIST_LIMIT = 5000;\n\nexport const MEDIA_CACHE_DISABLED = false;\nexport const MEDIA_CACHE_NAME = 'tt-media';\nexport const MEDIA_CACHE_NAME_AVATARS = 'tt-media-avatars';\nexport const MEDIA_PROGRESSIVE_CACHE_DISABLED = false;\nexport const MEDIA_PROGRESSIVE_CACHE_NAME = 'tt-media-progressive';\nexport const MEDIA_CACHE_MAX_BYTES = 512 * 1024; // 512 KB\nexport const CUSTOM_BG_CACHE_NAME = 'tt-custom-bg';\nexport const LANG_CACHE_NAME = 'tt-lang-packs-v5';\nexport const ASSET_CACHE_NAME = 'tt-assets';\n\nexport const DOWNLOAD_WORKERS = 16;\nexport const UPLOAD_WORKERS = 16;\n\nconst isBigScreen = typeof window !== 'undefined' && window.innerHeight >= 900;\n\nexport const MIN_PASSWORD_LENGTH = 1;\n\nexport const MESSAGE_LIST_SENSITIVE_AREA = 750;\nexport const MESSAGE_LIST_SLICE = isBigScreen ? 60 : 40;\nexport const MESSAGE_LIST_VIEWPORT_LIMIT = MESSAGE_LIST_SLICE * 2;\n\nexport const CHAT_HEIGHT_PX = 72;\nexport const CHAT_LIST_SLICE = isBigScreen ? 30 : 25;\nexport const CHAT_LIST_LOAD_SLICE = 100;\nexport const SHARED_MEDIA_SLICE = 42;\nexport const MESSAGE_SEARCH_SLICE = 42;\nexport const GLOBAL_SEARCH_SLICE = 20;\nexport const MEMBERS_SLICE = 30;\nexport const MEMBERS_LOAD_SLICE = 200;\nexport const PINNED_MESSAGES_LIMIT = 50;\nexport const BLOCKED_LIST_LIMIT = 100;\nexport const PROFILE_PHOTOS_LIMIT = 40;\nexport const PROFILE_SENSITIVE_AREA = 500;\n\nexport const TOP_CHAT_MESSAGES_PRELOAD_LIMIT = 20;\nexport const ALL_CHATS_PRELOAD_DISABLED = false;\n\nexport const ANIMATION_LEVEL_MIN = 0;\nexport const ANIMATION_LEVEL_MED = 1;\nexport const ANIMATION_LEVEL_MAX = 2;\nexport const ANIMATION_LEVEL_DEFAULT = ANIMATION_LEVEL_MAX;\n\nexport const DEFAULT_MESSAGE_TEXT_SIZE_PX = 16;\nexport const IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 17;\nexport const MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 15;\n\nexport const DRAFT_DEBOUNCE = 10000; // 10s\n\nexport const EDITABLE_INPUT_ID = 'editable-message-text';\nexport const EDITABLE_INPUT_MODAL_ID = 'editable-message-text-modal';\n\n// Screen width where Pinned Message / Audio Player in the Middle Header can be safely displayed\nexport const SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1440; // px\n// Screen width where Pinned Message / Audio Player in the Middle Header shouldn't collapse with ChatInfo\nexport const SAFE_SCREEN_WIDTH_FOR_CHAT_INFO = 1150; // px\n\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1275; // px\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN = 925; // px\nexport const MOBILE_SCREEN_MAX_WIDTH = 600; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH = 950; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT = 450; // px\n\nexport const LOCAL_MESSAGE_ID_BASE = 1e9;\n\nexport const ANIMATION_END_DELAY = 100;\n\nexport const FAST_SMOOTH_MAX_DISTANCE = 1500;\nexport const FAST_SMOOTH_MIN_DURATION = 250;\nexport const FAST_SMOOTH_MAX_DURATION = 600;\nexport const FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE = 500; // px\n\n// Average duration of message sending animation\nexport const API_UPDATE_THROTTLE = Math.round((FAST_SMOOTH_MIN_DURATION + FAST_SMOOTH_MAX_DURATION) / 2);\nexport const API_THROTTLE_RESET_UPDATES = new Set([\n 'newMessage', 'newScheduledMessage', 'deleteMessages', 'deleteScheduledMessages', 'deleteHistory',\n]);\n\nexport const STICKER_SIZE_INLINE_DESKTOP_FACTOR = 13;\nexport const STICKER_SIZE_INLINE_MOBILE_FACTOR = 11;\nexport const STICKER_SIZE_AUTH = 160;\nexport const STICKER_SIZE_AUTH_MOBILE = 120;\nexport const STICKER_SIZE_PICKER = 64;\nexport const STICKER_SIZE_GENERAL_SETTINGS = 48;\nexport const STICKER_SIZE_PICKER_HEADER = 32;\nexport const STICKER_SIZE_SEARCH = 64;\nexport const STICKER_SIZE_MODAL = 64;\nexport const STICKER_SIZE_TWO_FA = 160;\nexport const STICKER_SIZE_DISCUSSION_GROUPS = 140;\nexport const STICKER_SIZE_FOLDER_SETTINGS = 80;\nexport const STICKER_SIZE_INLINE_BOT_RESULT = 100;\nexport const RECENT_STICKERS_LIMIT = 20;\nexport const MEMOJI_STICKER_ID = 'MEMOJI_STICKER';\n\nexport const BASE_EMOJI_KEYWORD_LANG = 'en';\n\nexport const MENU_TRANSITION_DURATION = 200;\nexport const SLIDE_TRANSITION_DURATION = 450;\n\nexport const CONTENT_TYPES_FOR_QUICK_UPLOAD = new Set([\n 'image/png', 'image/gif', 'image/jpeg', 'video/mp4', 'video/avi', 'video/quicktime',\n]);\n\n// eslint-disable-next-line max-len\nexport const RE_LINK_TEMPLATE = '((ftp|https?):\\\\/\\\\/)?((www\\\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\\\.[a-zA-Z0-9()]{1,63})\\\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)';\nexport const RE_MENTION_TEMPLATE = '(@[\\\\w\\\\d_-]+)';\nexport const RE_TME_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/)([\\d\\w_]+)(?:\\/([\\d]+))?(?:\\/([\\d]+))?$/gm;\nexport const RE_TME_INVITE_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/joinchat\\/)([\\d\\w_-]+)?$/gm;\n\n// MTProto constants\nexport const SERVICE_NOTIFICATIONS_USER_ID = 777000;\nexport const REPLIES_USER_ID = 1271266957;\nexport const ALL_FOLDER_ID = 0;\nexport const ARCHIVED_FOLDER_ID = 1;\nexport const DELETED_COMMENTS_CHANNEL_ID = 777;\nexport const MAX_MEDIA_FILES_FOR_ALBUM = 10;\nexport const MAX_ACTIVE_PINNED_CHATS = 5;\nexport const SCHEDULED_WHEN_ONLINE = 0x7FFFFFFE;\nexport const DEFAULT_LANG_CODE = 'en';\nexport const DEFAULT_LANG_PACK = 'android';\nexport const LANG_PACKS = ['android', 'ios', 'tdesktop', 'macos'] as const;\nexport const TIPS_USERNAME = 'TelegramTips';\nexport const LOCALIZED_TIPS = ['ar', 'pt-br', 'id', 'it', 'ko', 'ms', 'pl', 'es', 'tr'];\nexport const FEEDBACK_URL = 'https://bugs.telegram.org/?tag_ids=41&sort=time';\nexport const LIGHT_THEME_BG_COLOR = '#A2AF8E';\nexport const DARK_THEME_BG_COLOR = '#0F0F0F';\nexport const DARK_THEME_PATTERN_COLOR = '#0a0a0a8c';\nexport const DEFAULT_PATTERN_COLOR = 'rgba(90, 110, 70, 0.6)';\n","type Scheduler =\n typeof requestAnimationFrame\n | typeof onTickEnd\n | typeof runNow;\n\nexport function debounce(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n shouldRunLast = true,\n) {\n let waitingTimeout: number | undefined;\n\n return (...args: Parameters) => {\n if (waitingTimeout) {\n clearTimeout(waitingTimeout);\n waitingTimeout = undefined;\n } else if (shouldRunFirst) {\n // @ts-ignore\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n waitingTimeout = self.setTimeout(() => {\n if (shouldRunLast) {\n // @ts-ignore\n fn(...args);\n }\n\n waitingTimeout = undefined;\n }, ms);\n };\n}\n\nexport function throttle(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n) {\n let interval: number | undefined;\n let isPending: boolean;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n isPending = true;\n args = _args;\n\n if (!interval) {\n if (shouldRunFirst) {\n isPending = false;\n // @ts-ignore\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n interval = self.setInterval(() => {\n if (!isPending) {\n // eslint-disable-next-line no-restricted-globals\n self.clearInterval(interval!);\n interval = undefined;\n return;\n }\n\n isPending = false;\n // @ts-ignore\n fn(...args);\n }, ms);\n }\n };\n}\n\nexport function throttleWithRaf(fn: F) {\n return throttleWith(fastRaf, fn);\n}\n\nexport function throttleWithPrimaryRaf(fn: F) {\n return throttleWith(fastPrimaryRaf, fn);\n}\n\nexport function throttleWithTickEnd(fn: F) {\n return throttleWith(onTickEnd, fn);\n}\n\nexport function throttleWithNow(fn: F) {\n return throttleWith(runNow, fn);\n}\n\nexport function throttleWith(schedulerFn: Scheduler, fn: F) {\n let waiting = false;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n args = _args;\n\n if (!waiting) {\n waiting = true;\n\n schedulerFn(() => {\n waiting = false;\n // @ts-ignore\n fn(...args);\n });\n }\n };\n}\n\nexport function onTickEnd(cb: NoneToVoidFunction) {\n Promise.resolve().then(cb);\n}\n\nexport function onIdle(cb: NoneToVoidFunction) {\n // eslint-disable-next-line no-restricted-globals\n if (self.requestIdleCallback) {\n // eslint-disable-next-line no-restricted-globals\n self.requestIdleCallback(cb);\n } else {\n onTickEnd(cb);\n }\n}\n\nfunction runNow(fn: NoneToVoidFunction) {\n fn();\n}\n\nexport const pause = (ms: number) => new Promise((resolve) => {\n setTimeout(() => resolve(), ms);\n});\n\nexport function rafPromise() {\n return new Promise((resolve) => {\n fastRaf(resolve);\n });\n}\n\nlet fastRafCallbacks: NoneToVoidFunction[] | undefined;\nlet fastRafPrimaryCallbacks: NoneToVoidFunction[] | undefined;\n\n// May result in an immediate execution if called from another `requestAnimationFrame` callback\nexport function fastRaf(callback: NoneToVoidFunction, isPrimary = false) {\n if (!fastRafCallbacks) {\n fastRafCallbacks = isPrimary ? [] : [callback];\n fastRafPrimaryCallbacks = isPrimary ? [callback] : [];\n\n requestAnimationFrame(() => {\n const currentCallbacks = fastRafCallbacks!;\n const currentPrimaryCallbacks = fastRafPrimaryCallbacks!;\n fastRafCallbacks = undefined;\n fastRafPrimaryCallbacks = undefined;\n currentPrimaryCallbacks.forEach((cb) => cb());\n currentCallbacks.forEach((cb) => cb());\n });\n } else if (isPrimary) {\n fastRafPrimaryCallbacks!.push(callback);\n } else {\n fastRafCallbacks.push(callback);\n }\n}\n\nexport function fastPrimaryRaf(callback: NoneToVoidFunction) {\n fastRaf(callback, true);\n}\n\nlet beforeUnloadCallbacks: NoneToVoidFunction[] | undefined;\n\nexport function onBeforeUnload(callback: NoneToVoidFunction, isLast = false) {\n if (!beforeUnloadCallbacks) {\n beforeUnloadCallbacks = [];\n // eslint-disable-next-line no-restricted-globals\n self.addEventListener('beforeunload', () => {\n beforeUnloadCallbacks!.forEach((cb) => cb());\n });\n }\n\n if (isLast) {\n beforeUnloadCallbacks.push(callback);\n } else {\n beforeUnloadCallbacks.unshift(callback);\n }\n\n return () => {\n beforeUnloadCallbacks = beforeUnloadCallbacks!.filter((cb) => cb !== callback);\n };\n}\n","import { pause } from '../util/schedulers';\nimport generateIdFor from '../util/generateIdFor';\nimport {\n DEBUG,\n MEDIA_CACHE_MAX_BYTES,\n MEDIA_PROGRESSIVE_CACHE_DISABLED,\n MEDIA_PROGRESSIVE_CACHE_NAME,\n} from '../config';\n\ndeclare const self: ServiceWorkerGlobalScope;\n\ntype PartInfo = {\n type: 'PartInfo';\n arrayBuffer: ArrayBuffer;\n mimeType: 'string';\n fullSize: number;\n};\n\ntype RequestStates = {\n resolve: (response: PartInfo) => void;\n reject: () => void;\n};\n\nconst MB = 1024 * 1024;\nconst DEFAULT_PART_SIZE = 0.5 * MB;\nconst MAX_END_TO_CACHE = 2 * MB - 1; // We only cache the first 2 MB of each file\nconst PART_TIMEOUT = 60000;\n\nconst requestStates = new Map();\n\nexport async function respondForProgressive(e: FetchEvent) {\n const { url } = e.request;\n const range = e.request.headers.get('range');\n const bytes = /^bytes=(\\d+)-(\\d+)?$/g.exec(range || '')!;\n const start = Number(bytes[1]);\n const originalEnd = Number(bytes[2]);\n\n let end = originalEnd;\n if (!end || (end - start + 1) > DEFAULT_PART_SIZE) {\n end = start + DEFAULT_PART_SIZE - 1;\n }\n\n // Optimization for Safari\n if (start === 0 && end === 1) {\n const match = e.request.url.match(/fileSize=(\\d+)&mimeType=([\\w/]+)/);\n const fileSize = match && Number(match[1]);\n const mimeType = match?.[2];\n\n if (fileSize && mimeType) {\n return new Response(new Uint8Array(2).buffer, {\n status: 206,\n statusText: 'Partial Content',\n headers: [\n ['Content-Range', `bytes 0-1/${fileSize}`],\n ['Accept-Ranges', 'bytes'],\n ['Content-Length', '2'],\n ['Content-Type', mimeType],\n ],\n });\n }\n }\n\n const cacheKey = `${url}?start=${start}&end=${end}`;\n const [cachedArrayBuffer, cachedHeaders] = !MEDIA_PROGRESSIVE_CACHE_DISABLED ? await fetchFromCache(cacheKey) : [];\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log(\n `FETCH PROGRESSIVE ${cacheKey} (request: ${start}-${originalEnd}) CACHED: ${Boolean(cachedArrayBuffer)}`,\n );\n }\n\n if (cachedArrayBuffer) {\n return new Response(cachedArrayBuffer, {\n status: 206,\n statusText: 'Partial Content',\n headers: cachedHeaders,\n });\n }\n\n let partInfo;\n try {\n partInfo = await requestPart(e, { url, start, end });\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('FETCH PROGRESSIVE', err);\n }\n }\n\n if (!partInfo) {\n return new Response('', {\n status: 500,\n statusText: 'Failed to fetch progressive part',\n });\n }\n\n const { arrayBuffer, fullSize, mimeType } = partInfo;\n\n const partSize = Math.min(end - start + 1, arrayBuffer.byteLength);\n end = start + partSize - 1;\n const arrayBufferPart = arrayBuffer.slice(0, partSize);\n const headers = [\n ['Content-Range', `bytes ${start}-${end}/${fullSize}`],\n ['Accept-Ranges', 'bytes'],\n ['Content-Length', String(partSize)],\n ['Content-Type', mimeType],\n ];\n\n if (!MEDIA_PROGRESSIVE_CACHE_DISABLED && partSize <= MEDIA_CACHE_MAX_BYTES && end < MAX_END_TO_CACHE) {\n saveToCache(cacheKey, arrayBufferPart, headers);\n }\n\n return new Response(arrayBufferPart, {\n status: 206,\n statusText: 'Partial Content',\n headers,\n });\n}\n\n// We can not cache 206 responses: https://github.com/GoogleChrome/workbox/issues/1644#issuecomment-638741359\nasync function fetchFromCache(cacheKey: string) {\n const cache = await self.caches.open(MEDIA_PROGRESSIVE_CACHE_NAME);\n\n return Promise.all([\n cache.match(`${cacheKey}&type=arrayBuffer`).then((r) => (r ? r.arrayBuffer() : undefined)),\n cache.match(`${cacheKey}&type=headers`).then((r) => (r ? r.json() : undefined)),\n ]);\n}\n\nasync function saveToCache(cacheKey: string, arrayBuffer: ArrayBuffer, headers: HeadersInit) {\n const cache = await self.caches.open(MEDIA_PROGRESSIVE_CACHE_NAME);\n\n return Promise.all([\n cache.put(new Request(`${cacheKey}&type=arrayBuffer`), new Response(arrayBuffer)),\n cache.put(new Request(`${cacheKey}&type=headers`), new Response(JSON.stringify(headers))),\n ]);\n}\n\nasync function requestPart(\n e: FetchEvent,\n params: { url: string; start: number; end: number },\n): Promise {\n if (!e.clientId) {\n return undefined;\n }\n\n // eslint-disable-next-line no-restricted-globals\n const client = await self.clients.get(e.clientId);\n if (!client) {\n return undefined;\n }\n\n const messageId = generateIdFor(requestStates);\n const requestState = {} as RequestStates;\n\n const promise = Promise.race([\n pause(PART_TIMEOUT).then(() => Promise.reject(new Error('ERROR_PART_TIMEOUT'))),\n new Promise((resolve, reject) => {\n Object.assign(requestState, { resolve, reject });\n }),\n ]);\n\n requestStates.set(messageId, requestState);\n promise\n .catch(() => undefined)\n .finally(() => {\n requestStates.delete(messageId);\n });\n\n client.postMessage({\n type: 'requestPart',\n messageId,\n params,\n });\n\n return promise;\n}\n\nself.addEventListener('message', (e) => {\n const { type, messageId, result } = e.data as {\n type: string;\n messageId: string;\n result: PartInfo;\n };\n\n if (type === 'partResponse') {\n const requestState = requestStates.get(messageId);\n if (requestState) {\n requestState.resolve(result);\n }\n }\n});\n","import { APP_NAME, DEBUG } from '../config';\n\ndeclare const self: ServiceWorkerGlobalScope;\n\nenum Boolean {\n True = '1',\n False = '0',\n}\n\ntype PushData = {\n custom: {\n msg_id?: string;\n channel_id?: string;\n chat_id?: string;\n from_id?: string;\n };\n mute: Boolean;\n badge: Boolean;\n loc_key: string;\n loc_args: string[];\n random_id: number;\n title: string;\n description: string;\n};\n\ntype NotificationData = {\n messageId?: number;\n chatId?: number;\n title: string;\n body: string;\n icon?: string;\n};\n\ntype CloseNotificationData = {\n lastReadInboxMessageId?: number;\n chatId: number;\n};\n\nlet lastSyncAt = new Date().valueOf();\nconst shownNotifications = new Set();\nconst clickBuffer: Record = {};\n\nfunction getPushData(e: PushEvent | Notification): PushData | undefined {\n try {\n return e.data.json();\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] Unable to parse push notification data', e.data);\n }\n return undefined;\n }\n}\n\nfunction getChatId(data: PushData) {\n if (data.custom.from_id) {\n return parseInt(data.custom.from_id, 10);\n }\n // Chats and channels have negative IDs\n if (data.custom.chat_id) {\n return parseInt(data.custom.chat_id, 10) * -1;\n }\n if (data.custom.channel_id) {\n return parseInt(data.custom.channel_id, 10) * -1;\n }\n return undefined;\n}\n\nfunction getMessageId(data: PushData) {\n if (!data.custom.msg_id) return undefined;\n return parseInt(data.custom.msg_id, 10);\n}\n\nfunction getNotificationData(data: PushData): NotificationData {\n return {\n chatId: getChatId(data),\n messageId: getMessageId(data),\n title: data.title || APP_NAME,\n body: data.description,\n };\n}\n\nasync function playNotificationSound(id: number) {\n const clients = await self.clients.matchAll({ type: 'window' }) as WindowClient[];\n const clientsInScope = clients.filter((client) => client.url === self.registration.scope);\n const client = clientsInScope[0];\n if (!client) return;\n if (clientsInScope.length === 0) return;\n client.postMessage({\n type: 'playNotificationSound',\n payload: { id },\n });\n}\n\nfunction showNotification({\n chatId,\n messageId,\n body,\n title,\n icon,\n}: NotificationData) {\n const isFirstBatch = new Date().valueOf() - lastSyncAt < 1000;\n const tag = String(isFirstBatch ? 0 : chatId || 0);\n const options: NotificationOptions = {\n body,\n data: {\n chatId,\n messageId,\n count: 1,\n },\n icon: icon || 'icon-192x192.png',\n badge: 'icon-192x192.png',\n tag,\n vibrate: [200, 100, 200],\n };\n\n return Promise.all([\n playNotificationSound(messageId || chatId || 0),\n self.registration.showNotification(title, options),\n ]);\n}\n\nasync function closeNotifications({\n chatId,\n lastReadInboxMessageId,\n}: CloseNotificationData) {\n const notifications = await self.registration.getNotifications();\n const lastMessageId = lastReadInboxMessageId || Number.MAX_VALUE;\n notifications.forEach((notification) => {\n if (\n notification.tag === '0'\n || (notification.data.chatId === chatId && notification.data.messageId <= lastMessageId)\n ) {\n notification.close();\n }\n });\n}\n\nexport function handlePush(e: PushEvent) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] Push received event', e);\n if (e.data) {\n // eslint-disable-next-line no-console\n console.log('[SW] Push received with data', e.data.json());\n }\n }\n\n const data = getPushData(e);\n\n // Do not show muted notifications\n if (!data || data.mute === Boolean.True) return;\n\n const notification = getNotificationData(data);\n\n // Dont show already triggered notification\n if (shownNotifications.has(notification.messageId)) {\n shownNotifications.delete(notification.messageId);\n return;\n }\n\n e.waitUntil(showNotification(notification));\n}\n\nasync function focusChatMessage(client: WindowClient, data: { chatId?: number; messageId?: number }) {\n const {\n chatId,\n messageId,\n } = data;\n if (!chatId) return;\n client.postMessage({\n type: 'focusMessage',\n payload: {\n chatId,\n messageId,\n },\n });\n // Catch \"focus not allowed\" DOM Exceptions\n try {\n await client.focus();\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[SW] ', error);\n }\n }\n}\n\nexport function handleNotificationClick(e: NotificationEvent) {\n const appUrl = new URL(self.registration.scope).origin;\n e.notification.close(); // Android needs explicit close.\n const { data } = e.notification;\n const notifyClients = async () => {\n const clients = await self.clients.matchAll({ type: 'window' }) as WindowClient[];\n const clientsInScope = clients.filter((client) => {\n return new URL(client.url).origin === appUrl;\n });\n await Promise.all(clientsInScope.map((client) => {\n clickBuffer[client.id] = data;\n return focusChatMessage(client, data);\n }));\n if (!self.clients.openWindow || clientsInScope.length > 0) return undefined;\n // Store notification data for default client (fix for android)\n clickBuffer[0] = data;\n // If there is no opened client we need to open one and wait until it is fully loaded\n try {\n const newClient = await self.clients.openWindow(appUrl);\n if (newClient) {\n // Store notification data until client is fully loaded\n clickBuffer[newClient.id] = data;\n }\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[SW] ', error);\n }\n }\n return undefined;\n };\n e.waitUntil(notifyClients());\n}\n\nexport function handleClientMessage(e: ExtendableMessageEvent) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] New message from client', e);\n }\n if (!e.data) return;\n const source = e.source as WindowClient;\n if (e.data.type === 'clientReady') {\n // focus on chat message when client is fully ready\n const data = clickBuffer[source.id] || clickBuffer[0];\n if (data) {\n delete clickBuffer[source.id];\n delete clickBuffer[0];\n e.waitUntil(focusChatMessage(source, data));\n }\n }\n if (e.data.type === 'newMessageNotification') {\n // store messageId for already shown notification\n const notification: NotificationData = e.data.payload;\n // mark this notification as shown if it was handled locally\n shownNotifications.add(notification.messageId);\n e.waitUntil(showNotification(notification));\n }\n\n if (e.data.type === 'closeMessageNotifications') {\n e.waitUntil(closeNotifications(e.data.payload));\n }\n}\n\nself.onsync = () => {\n lastSyncAt = new Date().valueOf();\n};\n","import { DEBUG } from './config';\nimport { respondForProgressive } from './serviceWorker/progressive';\nimport { respondWithCache, clearAssetCache } from './serviceWorker/assetCache';\nimport { handlePush, handleNotificationClick, handleClientMessage } from './serviceWorker/pushNotification';\nimport { pause } from './util/schedulers';\n\ndeclare const self: ServiceWorkerGlobalScope;\n\nconst ASSET_CACHE_PATTERN = /[0-9a-f]{20}.*\\.(js|css|woff2?|svg|png|jpg|jpeg|json|wasm)$/;\nconst ACTIVATE_TIMEOUT = 3000;\n\nself.addEventListener('install', (e) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('ServiceWorker installed');\n }\n\n // Activate worker immediately\n e.waitUntil(self.skipWaiting());\n});\n\nself.addEventListener('activate', (e) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('ServiceWorker activated');\n }\n\n e.waitUntil(\n Promise.race([\n // An attempt to fix freezing UI on iOS\n pause(ACTIVATE_TIMEOUT),\n Promise.all([\n clearAssetCache(),\n // Become available to all pages\n self.clients.claim(),\n ]),\n ]),\n );\n});\n\n// eslint-disable-next-line no-restricted-globals\nself.addEventListener('fetch', (e: FetchEvent) => {\n const { url } = e.request;\n\n if (url.includes('/progressive/')) {\n e.respondWith(respondForProgressive(e));\n return true;\n }\n\n if (url.startsWith('http') && url.match(ASSET_CACHE_PATTERN)) {\n e.respondWith(respondWithCache(e));\n return true;\n }\n\n return false;\n});\n\nself.addEventListener('push', handlePush);\nself.addEventListener('notificationclick', handleNotificationClick);\nself.addEventListener('message', handleClientMessage);\n","import { ASSET_CACHE_NAME } from '../config';\n\ndeclare const self: ServiceWorkerGlobalScope;\n\nexport async function respondWithCache(e: FetchEvent) {\n const cache = await self.caches.open(ASSET_CACHE_NAME);\n const cached = await cache.match(e.request);\n\n if (cached) {\n if (cached.ok) {\n return cached;\n } else {\n await cache.delete(e.request);\n }\n }\n\n const remote = await fetch(e.request);\n\n if (remote.ok) {\n cache.put(e.request, remote.clone());\n }\n\n return remote;\n}\n\nexport function clearAssetCache() {\n return self.caches.delete(ASSET_CACHE_NAME);\n}\n","export default (store: AnyLiteral) => {\n let id;\n\n do {\n id = String(Math.random()).replace('0.', 'id');\n } while (store.hasOwnProperty(id));\n\n return id;\n};\n"],"names":["MEDIA_PROGRESSIVE_CACHE_NAME","ASSET_CACHE_NAME","window","innerHeight","Math","round","Set","pause","ms","Promise","resolve","setTimeout","DEFAULT_PART_SIZE","requestStates","Map","Boolean","self","addEventListener","e","type","messageId","result","data","requestState","get","lastSyncAt","Date","valueOf","shownNotifications","clickBuffer","getChatId","custom","from_id","parseInt","chat_id","channel_id","getMessageId","msg_id","async","playNotificationSound","id","clientsInScope","clients","matchAll","filter","client","url","registration","scope","length","postMessage","payload","showNotification","chatId","body","title","icon","isFirstBatch","options","count","badge","tag","String","vibrate","all","focusChatMessage","focus","error","onsync","ASSET_CACHE_PATTERN","waitUntil","skipWaiting","race","caches","delete","claim","request","includes","respondWith","range","headers","bytes","exec","start","Number","end","match","fileSize","mimeType","Response","Uint8Array","buffer","status","statusText","cacheKey","cachedArrayBuffer","cachedHeaders","cache","open","then","r","arrayBuffer","undefined","json","fetchFromCache","partInfo","params","clientId","store","random","replace","hasOwnProperty","generateIdFor","promise","reject","Error","Object","assign","set","catch","finally","requestPart","err","fullSize","partSize","min","byteLength","arrayBufferPart","slice","put","Request","JSON","stringify","saveToCache","respondForProgressive","startsWith","cached","ok","remote","fetch","clone","respondWithCache","getPushData","mute","True","notification","process","description","getNotificationData","has","appUrl","URL","origin","close","map","openWindow","newClient","notifyClients","source","add","lastReadInboxMessageId","notifications","getNotifications","lastMessageId","MAX_VALUE","forEach","closeNotifications"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/347.e76314e5520fe6e65783.css b/dist/860.71a26210d53a0e37c47e.css similarity index 99% rename from dist/347.e76314e5520fe6e65783.css rename to dist/860.71a26210d53a0e37c47e.css index 354eec47..98214264 100644 --- a/dist/347.e76314e5520fe6e65783.css +++ b/dist/860.71a26210d53a0e37c47e.css @@ -64,4 +64,4 @@ .PaymentInfo{padding:.5rem 1rem}.PaymentInfo h5{font-size:.9rem;color:var(--color-text-secondary);margin:1rem 0 1.1rem}.PaymentInfo .inline-inputs{display:flex;justify-content:space-between}.PaymentInfo .inline-inputs .input-group{flex:1 10rem;max-width:45%;display:flex} .PaymentModal .modal-backdrop{pointer-events:none}.PaymentModal .header{position:relative;border-top-left-radius:10px;border-top-right-radius:10px;width:100%;padding:.25rem 1rem;display:flex;align-items:center;flex-direction:row;background:var(--color-background);border-bottom:1px var(--color-borders) solid}.PaymentModal .header h3{margin-bottom:0;margin-left:1.5rem;unicode-bidi:plaintext;text-align:initial}.PaymentModal .Transition{height:25rem}.PaymentModal .empty-content{height:25rem;max-height:90%;display:flex;align-items:center;justify-content:center}.PaymentModal .receipt-content{height:25rem;overflow-y:auto}.PaymentModal .content{overflow:auto;width:100%;height:100%;position:relative}.PaymentModal .footer{position:relative;border-bottom-left-radius:10px;border-bottom-right-radius:10px;width:100%;padding:.75rem 1rem;background:var(--color-background);border-top:1px var(--color-borders) solid}.PaymentModal .footer button{text-transform:none;font-weight:500}.PaymentModal .modal-dialog{width:25rem}.PaymentModal .modal-content{padding:0;overflow:hidden}@media screen and (max-device-width: 640px)and (max-height: 640px)and (orientation: landscape){.PaymentModal .modal-dialog{max-height:100%}.PaymentModal .Transition{height:10rem}} -/*# sourceMappingURL=347.e76314e5520fe6e65783.css.map*/ \ No newline at end of file +/*# sourceMappingURL=860.71a26210d53a0e37c47e.css.map*/ \ No newline at end of file diff --git a/dist/347.e76314e5520fe6e65783.css.map b/dist/860.71a26210d53a0e37c47e.css.map similarity index 99% rename from dist/347.e76314e5520fe6e65783.css.map rename to dist/860.71a26210d53a0e37c47e.css.map index dd6899fe..5f8f58da 100644 --- a/dist/347.e76314e5520fe6e65783.css.map +++ b/dist/860.71a26210d53a0e37c47e.css.map @@ -1 +1 @@ -{"version":3,"file":"347.e76314e5520fe6e65783.css","mappings":"AAAA,YACE,aACA,qBACA,WACA,eAEA,WACA,wBAEA,kBACE,UAGF,oBACE,uBAEA,yBAHF,oBAII,cAIJ,kBACE,aACA,sBACA,uBACA,eAGF,mBACE,oBACA,gBACA,gBACA,gBACA,uBAGF,kBACE,oBACA,kBACA,wB;ACvCJ,oBACE,aACA,yBACA,4BAEA,4BACE,2BAIJ,2BACE,kBAEA,4CACE,kBACA,MACA,O;AChBJ,mBACE,kBACA,SACA,eACA,WACA,wBAEA,uCACE,aAGF,0BAXF,mBAYI,mBAGF,yBAfF,mBAgBI,sBACA,mEAEA,gCACE,UACA,oBAEA,wDACE,UACA,oBAKN,gDACE,kBACA,0CACA,YACA,eACA,WACA,wBAEA,sDACE,UAGF,yBAZF,gDAaI,WAIJ,6BACE,UAGF,+BACE,gBACA,cACA,gBACA,kBACA,2BACA,mBACA,uBACA,mBAEA,0BAVF,+BAWI,oBAGF,sCACE,eACA,gBACA,oBAIA,iDACE,WACA,kBACA,cACA,eACA,aACA,gBACA,2BACA,2CACA,uBAEA,yBAXF,iDAYI,aACA,iBAMR,qBACE,yBAEA,sDAEE,+B;AChGN,qBACE,aACA,mBACA,kBACA,OACA,SACA,WACA,oBACA,kBACA,mEAEA,yCACE,aAGF,yBAfF,qBAgBI,eACA,6BACA,gBACA,+BAIA,8CACE,gBACA,UACA,eACA,iBAGF,wCACE,iBAGF,qDACE,iBAIJ,6BACE,cACA,UACA,cACA,eACA,yBALF,6BAMI,gBAIJ,6BACE,mBAGF,kCACE,cACA,mBAGF,iCACE,iBACA,yBAFF,iCAGI,kBAEF,mCACE,oBACA,yBAFF,mCAGI,kBAKN,yBACE,8CACE,kBAIJ,uCACE,kBACA,SACA,2BACA,mBACA,gBACA,uBAEA,yBARF,uCASI,gBACA,UACA,eACA,iBACA,kBACA,mDACE,eAKN,sCACE,kBACA,UACA,WACA,MACA,YAGA,4CACE,kBACA,QACA,cACA,eACA,WACA,2BACA,uCACA,2CAGF,wIAGE,kBACA,MACA,OACA,YACA,2CAGF,+CACE,sCAGF,6CACE,gCAEA,oDACE,WACA,kBACA,aACA,cACA,kBACA,sCACA,QACA,QACA,oCAIJ,4CACE,WACA,UACA,SACA,UACA,eACA,gBAEA,kEACE,iB;AC3JR,aACE,kBACA,oBACA,sBACA,gBAEA,iCACE,kBACA,MACA,QACA,SACA,OACA,qCACE,sBACA,uBAEF,uCACE,2BAIJ,yBArBF,aAuBI,WAGF,yBA1BF,aA2BI,kBAGF,0BA9BF,aA+BI,sBACS,yBACP,iBAIJ,mBACE,cACA,iCACA,YACA,mBACA,aACA,WACA,YACA,6BACA,wBAEA,0BAXF,mBAYI,gCAEO,+BACP,+BACA,0BAFO,+BAGL,gCAKN,0BACE,kBACA,SACA,QACA,gCACA,cACA,eACA,2CACA,uDACE,uCAGF,qCACE,kBACA,kBACA,aAIJ,gCACE,kBACA,MACA,OACA,WACA,YACA,aACA,mBACA,uBAEA,2CACE,2BACA,WACA,iBACA,kBACA,cACA,aACA,UACA,kBACA,qBACA,qBAGF,iDACE,e;ACtGN,cACE,kBACA,eACA,SACA,0BACA,2CACA,WACA,gBACA,gBACA,qCACA,+BACA,oBAEA,mBACE,8BACA,mBAGF,+CAEE,kBACA,aACA,aACA,cACA,WAEA,mDACE,iBAIJ,wBACE,WAGF,uBACE,YAGF,wBACE,kBACA,aACA,cACA,aACA,YAEA,8BACE,kBACA,QACA,cACA,eACA,WACA,2BACA,sCACA,2CAGF,6DAEE,kBACA,MACA,OACA,YACA,2CAGF,+BACE,gBACA,uBAEA,sCACE,WACA,kBACA,aACA,cACA,kBACA,oCACA,QACA,QACA,oCAIJ,8BACE,WACA,YACA,cACA,UACA,SACA,UACA,eACA,gBAEA,oDACE,iB;AC9FR,4BAEE,kBACA,WACA,YAGF,aACE,YACA,0CAGF,eACE,iCAEA,iCACE,gBAGF,uBACE,eACA,MACA,O;ACtBJ,aACE,eACA,MACA,OACA,YACA,YACA,0BACA,WACA,8BACA,gBAEA,aACA,2BACA,+BACA,kBACA,eACA,sBACA,mBAGA,yBACE,yBACA,mBAIA,sIACE,aAIJ,oCACE,mCAKA,sEACE,oBACA,gBAKF,gCACE,aAGF,uCACE,UAGF,0CACE,eACA,MACA,OACA,YACA,aACA,UACA,UAIJ,gCACE,aACA,mBACA,kBACA,kBACA,mCACA,YAEA,4CACE,WACA,YAGF,yBAbF,gCAcI,gBAEA,oDACE,qBAKN,mDAEE,oBAGF,+DAEE,kBACA,oBACA,kBACA,WACA,YACA,aACA,mBACA,gBAGF,mCACE,kBACA,UACA,kBACA,YACA,oBACA,uBACA,mBAEA,8CACE,eACA,yBAFF,8CAGI,iBAGF,0BANF,8CAOI,gBAGF,kDACE,+BACA,0BAFF,kDAGI,gCAKN,8CACE,kBAEA,kDACE,kBACA,QACA,SACA,gCAIJ,uCACE,gBACA,iCACA,mBACA,yBAGF,oDACE,gBACA,YAGF,4CACE,YAIJ,yBACE,eACA,SACA,WACA,SACA,YACA,UACA,SACA,wCACA,iCACA,wBACA,UACA,wBACA,aACA,eACA,UAEA,yBAjBF,yBAkBI,YAGF,sEACE,UAGF,8BACE,OACA,yDACA,6CAEA,uCACE,UACA,QACA,qBAIJ,8BACE,QACA,yDACA,0DAEA,uCACE,OACA,WACA,qBAIJ,gCACE,qBACA,aACA,YACA,6BAEA,yBANF,gCAOI,UACA,gCACA,oBAEA,wDACE,UACA,oBAOV,OACE,kBACA,8BACA,8BACA,gBACA,gBACA,+CAEA,uBACE,4CAGF,cACE,kBAGF,mBACE,iFAGF,wBAEE,WACA,YACA,iBACA,yBACA,+C;AC5PJ,eACE,8BAEA,6BACE,WACA,gBAEA,yBAJF,6BAKI,YAIJ,6BACE,aACA,mBACA,qBAEA,qCACE,mBAGF,0CACE,SAGF,2CACE,YACA,2BAEA,eACA,cACA,kBACA,oBACA,uBAIJ,8BACE,UACA,gBACA,aACA,sBAEA,2CACE,YACA,kBACA,gBACA,oBAIJ,2BACE,YACA,SACA,kBACA,aACA,mBACA,uBACA,kCAKE,yBADF,yEAEI,SAEA,0FACE,iB;ACnEV,SACE,eACA,MACA,OACA,YACA,aACA,uB;ACLA,6BACE,mBACA,4CACE,0BAIJ,2BACE,aACA,mBACA,uBACA,qBAEA,yCACE,eACA,kBAEA,qDACE,kBAEF,oDACE,iBAKN,uBACE,aACA,yBACA,sBAEA,+BACE,oBAEA,uCACE,iBAKN,+BACE,aACA,mBAEA,kCACE,OACA,qBACA,kBAEA,yBALF,kCAMI,oBAGF,0CACE,2BAIJ,8CACE,WACA,oBAIJ,2BACE,kBACA,mBACA,wBACA,gBACA,uBAEA,yBAPF,2BAQI,uBAGF,mCACE,gBACA,YAGF,qCACE,eAEA,2CACE,wDAGF,8CACE,sCACA,WAIJ,oCACE,YACA,oBAGF,mCACE,WACA,cACA,iBAGF,gCACE,kBACA,MACA,OACA,WACA,YACA,aACA,mBACA,uBACA,kBAIJ,iCACE,aACA,mBACA,uBACA,iBACA,4BAGF,8BACE,aACA,qCACA,W;ACjIJ,sBACE,kBACA,aACA,WACA,YACA,WACA,WACA,uBACA,SAqBA,UAnBA,mDACE,qBACA,sBAGF,mCACE,WAGF,yBAnBF,sBAoBI,UACA,WACA,eAEA,mCACE,cAMJ,4BACE,oBACA,+EAGF,kDACE,kCAGF,kHAEE,SAGF,6CACE,2BAGF,kCACE,UACA,oBAEA,+CACE,iDAGF,4EACE,2FAGF,kFACE,kEAIJ,8BACE,WACA,gBACA,WACA,UACA,WAGF,4BACE,WACA,gBACA,aACA,mBACA,eAEA,mCACA,4CACA,iDACA,gBAEA,yBAZF,4BAaI,UACA,gBAGF,oCACE,WACA,YAEA,yBAJF,oCAKI,eACA,iBAKN,4BACE,iBACA,mBACA,gBACA,uBACA,YAEA,yBAPF,4BAQI,oBAIJ,8BACE,iBACA,aAEA,wCACE,iBACA,kBAEA,0CACE,eAGF,mDACE,a;AC9HN,yBACE,gBAGF,mCACE,mBAGF,2BACE,YACA,eACA,gBACA,kBACA,mBAEA,qBACA,8BAEA,8CACE,SAGF,oDACE,+BAIJ,+BACE,qBACA,aACA,YACA,uBACA,kBACA,2CACA,eACA,kBACA,gBAEA,2CACE,oBAGF,0CACE,qBAGF,uCACE,sBAGF,qCACE,mCAGF,8CACE,kBACA,mBACA,iBACA,gBACA,uBAEA,2DACE,WACA,YACA,qBACA,sBACA,oBAKN,qCACE,aACA,mBAEA,6CACE,iBAIA,sDACE,cACA,kB;AClFN,yBACE,iBAGA,qFACE,qCAIJ,8BACE,qBAIA,0BACE,YAGF,sBACE,eACA,WAGF,6BACE,kCAEA,sDACE,wBACA,mBACA,qBACA,kBAIJ,4BACE,YACA,kCACA,gBACA,uBAEA,yCACE,wBAGA,gDACE,aAIJ,gCACE,cACA,eACA,iBACA,sBACA,wBACA,oBAGF,uCACE,kBACA,qBACA,iBACA,WACA,6BACA,wBACA,gBAKN,uBACE,aACA,8BAIA,gCACE,iB;AC9EN,aACE,aACA,YACA,mBACA,8BACA,kBACA,oBAEA,wBACE,aACA,cACA,eACA,mBACA,eACA,kBACA,gBACA,kCAEA,uCACE,kBACA,oB;ACpBN,wBACE,sBACA,YACA,gBACA,yBAEA,MACE,gBACA,sBAGF,kBACE,UACA,6BAGF,yBACE,uCAEA,iBACE,8BAIJ,iBACE,oBACA,qBACA,oCACA,gBAEA,mBACA,kCACA,sCAEA,UACE,kBACA,WACA,WACA,gCACA,aACA,SACA,8EAGF,cAEE,sBACA,oCACA,mBACA,8FAEA,SACE,cACA,uHAKN,4BAEE,wBACA,2CACA,uIAEA,YACE,sBAIJ,YACE,0CAGF,iBACE,YACA,YACA,gBACA,uBACA,sBACA,2BAGF,gBACE,kCACA,kBACA,mBACA,yBAGF,YACE,cACA,qCACA,mBACA,gBACA,mCAIA,gBACE,qCAGF,gCACE,uDAMA,sBACE,2BACA,uBACA,+DAEA,WACE,6EACA,aACE,yBACA,8DAIJ,YACE,kCACA,4EAEA,UACE,gEAMJ,gBACE,wEAEA,WACE,0DAQR,uBACE,iEAEA,YACE,gBACA,0BAKN,sBACE,kBACE,8BAIJ,oBACE,8CAEA,iCACE,mBACA,gBACA,2BACA,oBACA,oDAEA,WACE,yBACA,gBACA,kBACA,mHAEA,8BAEE,0HAMF,UACE,iBACA,eACA,sCAKN,aACE,oBACA,6BAIJ,iBACE,aACA,cACA,iBACA,8BACA,qBACA,iDACA,yCACA,iCACA,gBACA,kBACA,8BAEA,iDAEA,aACE,4DAEA,iBACE,qEAKF,gBACE,eACA,2BAKN,WACE,qCAIA,cACE,mBACA,C;ACjOJ,yBACE,wBACA,gBACA,yBACA,iBACA,kBAGF,kDACE,gBAGF,2BACE,kBACA,YACA,WACA,iDAGF,wBACE,gBACA,cACA,kBAEA,gCACE,WACA,cACA,iBAGF,qCACE,kBACA,MACA,OACA,kDAGF,qCACE,YACA,kDAOA,kEACE,gCAGF,qDACE,gCAGF,8CACE,gCAGF,yDArEJ,gCACA,eACA,mBACA,oFAEA,+DACE,qBAmEE,qDAzEJ,gCACA,eACA,mBACA,iFAEA,2DACE,qBAuEE,8CA7EJ,gCACA,eACA,mBACA,gFAEA,oDACE,qB;ACJF,sBACE,iBACA,kBACA,aACA,cACA,mBACA,wBACA,mBACA,uBACA,sCACA,kBACA,WACA,eACA,eACA,kBACA,gBACA,wBAEA,4BACE,aAGF,0BACE,kBACA,MACA,OACA,WACA,YAGF,wBACE,mBACA,iCACA,qCAKA,6UACE,wBAGF,6GACE,2BAKF,8BACE,qBAIJ,6BACE,yCAEA,oCACE,WACA,cACA,kBACA,OACA,MACA,WACA,YACA,gCAIJ,+BACE,oBAEA,iCACE,aAGF,sCACE,a;AC/ER,gBACE,mCACA,aACA,mBACA,gBACA,oBACA,+BACA,qBAEA,kBACE,iBACA,kBACA,kCAGF,yBACE,a;AChBJ,4BACE,yCAEA,2CACE,+CAEA,8DACE,oBACA,kBACA,YAGF,8DACE,kCAIJ,yCACE,sBAEA,qDACE,aAKF,uFACE,uBAGF,kFACE,qBAGF,iEACE,iBACA,qBAGF,kEACE,eACA,gBACA,SAIA,0EACE,cACA,kBACA,eACA,sBAKN,kDACE,mBACA,gBACA,oBAGF,iDACE,uBACA,6C;AC/DJ,mCACE,WACA,aACA,mBACA,8BAIA,sCACE,aACA,mBAEA,8CACE,qBACA,oBAGF,6CACE,aACA,2BACA,mBAEA,gDACE,eACA,gBACA,mBACA,SACA,gBACA,mBACA,uBACA,gBAIJ,8CACE,aAIA,yDACE,iBAMJ,+CACE,WAIJ,2DACE,2BAEA,6DACE,UACA,cAKF,6CACE,mBACA,sBAKN,+BACE,eACA,wBACA,6B;ACxDF,aACE,qCAEA,mBAEA,sBACE,oBACA,4CAGF,6BACE,aACA,8BACA,sBAEA,oCACE,cACA,iBACA,kCAIA,6CACE,cACA,kBAKN,0BACE,kBACA,UAEA,kCACE,WACA,kBACA,WACA,OACA,aACA,eACA,sCACA,sBACA,WACA,WAIJ,gCACE,kBACA,WACA,OACA,aACA,eACA,qCACA,sBACA,oBAIF,+BACE,wBACA,cACA,WACA,cACA,oBACA,uBAEA,qCACE,aAGF,0CACE,WACA,eAEA,uBACA,yBACA,kBAGF,qDACE,wBAQF,qDAvGF,+BACA,YACA,cACA,aACA,kBACA,eACA,mBACA,oFAEA,2DACE,qBAiGA,iDA3GF,+BACA,YACA,cACA,aACA,kBACA,eACA,mBACA,iFAEA,uDACE,qBAqGA,0CA/GF,+BACA,YACA,cACA,aACA,kBACA,eACA,mBACA,gFAEA,gDACE,qBA0GF,6BACE,aACA,wBACA,sBACA,sBAGF,4BACE,kBACA,kBACA,eACA,kCACA,0BAEA,qEACE,wBAGF,mCACE,gBAGF,wCACE,gBAGF,uCACE,iB;AC/IJ,4CACE,oBAGF,+DAEE,WACA,YACA,mBACA,UACA,cAGF,wBACE,eACA,gBAGF,yCACE,aACA,sBACA,uBAIA,iFAEE,mB;AC5BN,eACE,SACA,oBACA,eACA,kBAEA,kDAEE,kBACA,OACA,MACA,WACA,YAGF,4BACE,gBACA,mBACA,+BAEA,mEACE,kBACA,OACA,MACA,WACA,YACA,iBAIJ,sBACE,WACA,cACA,sCACA,UACA,6BAIA,+BACE,UAGF,qCACE,qBAIJ,kCACE,YACA,aACA,mBACA,uB;ACnDF,gDACE,aACA,cACA,qCACA,mBACA,gBAGF,oCACE,uBACA,gB;ACVF,0DACE,gCAGF,0FACE,kBAGF,8CACE,gBACA,aAGF,4CACE,cACA,aAGF,uCACE,cACA,WACA,YACA,2CACA,eAGF,wCACE,kBACA,aACA,cACA,aACA,cACA,wCACA,qBACA,YAGF,oDACE,YAGF,uCACE,sBACA,aAEA,oDACE,gBAGE,mEACE,mDAKN,gEACE,mBAGF,+DACE,kBAIJ,mDACE,aACA,cACA,qCACA,mBACA,gBAEA,uDACE,eACA,iDACA,iCAEA,8DACE,0CACA,wDAIF,8DACE,cACA,WACA,WACA,iBACA,oB;ACxFR,QACE,kBACA,cACA,iBACA,kBACA,aACA,cACA,sBAEA,gDATF,QAUI,YACA,aACA,sBAGF,YACE,YACA,aAGF,yBACE,kBACA,OACA,MACA,WACA,YAEA,gCACE,aAIJ,wBACE,WACA,YACA,qBACA,wD;AClCJ,UACE,YAEA,cACE,aACA,sBACA,gBAGF,uBACE,uBAIJ,sBACE,aACA,YACA,8BACA,mBAIA,4BACE,WAEA,6CACE,6BACA,8BAKN,kBACE,mCACA,yCAEA,gBC9BA,+BD0BF,kBCzBI,mBAGA,mBD6BF,kCACE,aACA,sBAEA,iDACE,cACA,YAIJ,0BACE,iBACA,mBAGF,iCACE,iBACA,qBAIJ,yBACE,aACA,sBACA,mBACA,sBACA,kBAEA,sCACE,WAIJ,uBACE,WACA,YACA,qBACA,kBAEA,wCACE,kBACA,OACA,MACA,WACA,YAEA,+CACE,aAKN,oBACE,uBAEA,+BACE,yBACA,yBACA,2EACA,8DAEA,gDACE,qBAKN,eACE,0CACA,2BAEA,yBACE,gBAGF,sBACE,eACA,kCACA,mBACA,kBAEA,+BACE,iBAIJ,sBACE,gBAGF,2BACE,kBACA,kCACA,mBACA,qBAEA,oDACE,eAGF,oCACE,iBACA,uBAIJ,kCACE,eACA,sBACA,kCACA,gBACA,qBAEA,2CACE,iBAIJ,yBACE,oBAEA,oCACE,gBAGF,8CACE,oBAEA,wDACE,WAGF,oDACE,YACA,iBACA,iBACA,kCAGF,6GACE,cACA,gBAGF,qDACE,oBAGF,wDACE,kBACA,mBACA,kCAEA,kEACE,oBAGF,8DACE,wBAGF,8DACE,sBACA,uBAMJ,sDACE,yBAEA,wDACE,cAKN,2CACE,oBAEA,4DACE,mBACA,gBACA,cAGF,mDACE,WACA,YACA,kBAGF,yDACE,eACA,iBACA,qBACA,gBAGF,0DACE,kBACA,iBACA,kCAMA,+HACE,iBAGF,6DACE,WACA,cACA,kBAMR,4BACE,wBAGF,qDACE,qBAIA,8CACE,gBAIJ,gEACE,gBAIJ,sBACE,yCACA,kBACA,gBAEA,wCACE,YAGF,4CACE,aAIJ,uBACE,iBAGF,eACE,yB;AE7SF,SACE,YACA,gBACA,kBAEA,eACE,yCACA,gBAEA,sBACE,kBACA,aACA,sBAEA,yDACE,kBACA,oBACA,qBAGF,6BACE,yBAGF,4BACE,sBACA,kCAGF,4CACE,kCACA,eACA,gBACA,mBAGF,yCACE,kBACA,oBAEA,kBACA,Y;ACzCR,eACE,YACA,gBAEA,0BACE,yC;ACLJ,oBACE,kBACA,eAEA,4BACE,qBACA,4GAGF,8BACE,kBACA,kB;ACVF,+BACE,eACA,eAGF,yBACE,+BACE,iBAIJ,+BACE,mBAGF,gCACE,kBACA,UAGF,2BACE,kBACA,WACA,aACA,gBACA,gBACA,iBACA,gBAGF,iCACE,gBACA,0CACA,+CAEA,wCACE,qBAIJ,0BACE,WACA,kBACA,kC;AC5CJ,qBACE,eACA,MACA,OACA,QACA,aACA,6BAEA,2BACE,kBACA,eAEA,qCACE,sCAGF,mCACE,6BACA,8B;AClBN,sBACE,kBACA,MACA,OACA,+BACA,WACA,cACA,mCACA,aACA,mBACA,yBAEA,mCACE,mBACA,OAIJ,sBACE,kBACA,SACA,OACA,+BACA,WACA,cACA,mCACA,aACA,mBACA,kBACA,oBAEA,+BACE,OACA,kCAKF,sEAEE,8B;ACxCJ,gBACE,wBACA,gBACA,sBAEA,WAEA,yBAPF,gBAQI,yBAGF,8CACE,SAEA,+DACE,gBAGF,oDACE,aAGF,qDACE,0BACA,cAGF,sDACE,eAIA,+DACE,WAMJ,oCACE,iBAGF,kCACE,kBAIA,0CACE,YAIJ,uCACE,wB;ACtDN,iBACE,kCAEA,+BACE,mBACA,yBAFF,+BAGI,gBACA,uBAIJ,gCACE,+BACA,iCACA,yBAHF,gCAII,uBAIJ,gCACE,iBACA,cACA,aACA,eACA,qBAEA,0EAEE,OACA,0BACA,aACA,oBACA,2CACA,iBAEA,gGACE,YACA,iBACA,gBAGF,0GACE,kBAKN,mCACE,iBACA,cACA,cACA,aACA,sBACA,wBAEA,0DACE,qBAGF,8CACE,0BAIJ,6CACE,kBAEA,2DACE,mCAGF,6DACE,mBACA,UAIJ,8BACE,kBAEA,2EAEE,WACA,kBACA,OACA,MACA,QACA,SACA,2CACA,oBAEA,UACA,yBACA,UAGF,sCACE,mDACA,yCAGF,qCACE,sCACA,aACA,uBACA,mBACA,2BAKF,8CACE,YAGF,6CACE,UAGF,wIAGE,oBAGF,mFAEE,2C;AC9HJ,yBACE,mBACA,8BAGF,0BACE,+BACA,oBAGF,mCACE,mBAGF,2BACE,kCACA,eACA,gBACA,qBAGF,yBACE,6BACA,iBACA,6CACA,iBACA,cAEA,mCACE,6BAGF,yBAXF,yBAYI,gBACA,gBAEA,4DACE,kBAKN,2BACE,kBAEA,yCACE,mBAGF,iDACE,kBACA,aACA,eAIJ,sBACE,kBAEA,sCACE,oBAGF,4BACE,iBAIJ,iBACE,kBACA,kCAGF,kBACE,kBACA,yBACA,2BAGF,mCACE,oB;ACjFJ,aACE,oBACA,mBACA,uBACA,aACA,cACA,eACA,kDACA,eACA,kBACA,mBACA,6BACA,sCAEA,yBACE,oBAGF,sCAEE,kDAGF,iBACE,WACA,Y;ACzBJ,aACE,YAEA,kBACE,yBACA,gBACA,cAEA,yBALF,kBAMI,sBAGF,wCACE,aACA,eAIJ,oBACE,YACA,6CACA,aACA,mBACA,6BACA,+CAEA,yBARF,oBASI,gBACA,kBACA,cACA,mBACA,mBAEA,qBACA,8BAEA,uCACE,SAGF,6CACE,+BAGF,uCACE,oBACA,sBAIF,2BACE,WACA,cACA,cACA,WACA,a;ACvDR,eACE,YAEA,oBACE,kBACA,yBACA,gBACA,cAEA,yBANF,oBAOI,sBAIJ,sBACE,YACA,6CACA,kBACA,gBACA,kBACA,mBACA,+CAEA,qBACA,8BAEA,yCACE,SAGF,+CACE,+BAIF,6BACE,WACA,cACA,cACA,WACA,YAIF,0CACE,oBACA,sBAEA,wDACE,qBAEA,qIACE,YACA,aACA,WACA,YAIJ,6DACE,WACA,YACA,kBACA,aACA,mBACA,uBAEA,+IACE,WACA,YACA,kBACA,MACA,OAMR,qCACE,YACA,cAEA,yBAJF,qCAKI,YAIJ,mCACE,yBACA,eACA,gBACA,kD;AC3FJ,WACE,aACA,mBACA,uBACA,eACA,6BACA,eACA,gBACA,kBAEA,sBACE,mBAGF,oBACE,uBAGF,sBACE,uBAGF,sBACE,WACA,YACA,iCACA,wCAGF,qCACE,kBACA,MACA,OACA,WACA,YACA,iBAGF,oBACE,kBACA,oB;ACxCJ,WACE,aACA,qCACA,uBACA,gBACA,qBACA,YACA,gBACA,eAEA,gDACE,iBACA,0B;ACTF,wBACE,eACA,OACA,QACA,SACA,mCACA,gGACA,UAEA,6CAEA,6BACE,+BAEA,uDACE,gGAIJ,+CACE,gBAGF,iDACE,8CAIJ,iBACE,+BACA,iCACA,0DAGF,mBACE,wCACA,0CACA,aACA,mBACA,uBACA,+CACA,kBAEA,2BACE,cACA,0BACA,gBACA,gBACA,UAEA,qCACE,oBAGF,6CACE,gBAGF,gDACE,kBACA,YAGF,gDACE,kBACA,aAKN,8BACE,YAEA,uCACE,iCAKF,sCACE,kBACA,UACA,OACA,WACA,aACA,cAKF,2DACE,UACA,cAIJ,oBACE,UACA,+BACA,gBAGF,6BACE,iCACA,aACA,mBACA,uBACA,kCAGF,iCACE,aACA,kBACA,aACA,WAGF,+BACE,iCACE,eAKN,YACE,mBAEA,iBACE,eACA,sBACA,gBACA,SACA,mBACA,kDACA,gBACA,mBACA,uBACA,mBACA,uBAGF,sBACE,mBAGF,mBACE,cACA,0BACA,gBACA,gBACA,UfvJF,iFe2JE,gBAIA,8CACE,cAGF,0CACE,gB;ACtKN,YACE,kBAGE,sCACE,kBACA,UACA,UACA,QACA,aAKJ,mCACE,mB;ACfJ,YACE,oBAEA,6BACE,gBAGF,4BACE,eAEA,sCACE,mBACA,mBAKF,wCACE,UACA,aAGF,uCACE,O;ACvBN,mBACE,wBACA,gBACA,sBAEA,WAEA,yBAPF,mBAQI,yB;ACPF,gCACE,wBACA,gBACA,gBACA,cACA,sBAEA,yBAPF,gCAQI,yBAKF,0CACE,kBACA,UACA,OACA,WACA,aACA,c;ACpBN,gBACE,aACA,2DACA,oBACA,mBAEA,uBACE,a;ACPJ,gBACE,kBACA,cAGE,0CACE,kBACA,UACA,UACA,QACA,aAKJ,uCACE,mBAGF,wBACE,Y;ACpBJ,cACE,aACA,oBAEA,gBAIA,kBAHA,+BALF,cAMI,oBAIF,2BACE,gB;ACVF,iDACE,gCACA,iCAEA,wDACE,cACA,uBAIJ,mBACE,mDACA,cACA,WACA,YACA,iBACA,gDACA,oBACA,qBACA,uBACA,wBACA,gBACA,iBAEA,mCACE,WACA,iBAGF,6BACE,aACA,cACA,kBAIJ,2BACE,YAGF,mBACE,gBACA,gBACA,uBAGF,yBACE,mBACA,oBACA,qBACA,4BACA,gBACA,uBACA,gBACA,uBAEF,8DAEE,iB;AC3DJ,aACE,SACA,oBACA,gBACA,kBACA,eAEA,iBACE,kBACA,OACA,MACA,WACA,YACA,iB;ACbJ,kBAME,2BALA,oCACE,cACA,gBAKF,0BACE,aACA,qCACA,aACA,UAEA,yBANF,0BAOI,sCAGF,qCACE,iBACA,sDACE,4BACA,6BAIJ,qCACE,wBAGF,yCACE,cACA,SACA,SACA,oBACA,gBAEA,uJACE,kBACA,MACA,OACA,sBACA,uBAEA,yBAPF,uJAQI,WACA,YACA,oCACA,sC;AChDV,aACE,YACA,gBACA,gBAEA,0BACE,aACA,sBACA,gBACA,kCACA,uBACA,mB;ACXJ,eACE,YACA,gBACA,gBAEA,4BACE,aACA,sBACA,gBACA,kCAGF,4BACE,mBAEA,mCACE,aACA,8BACA,cAEA,kDACE,gBAGF,0CACE,eACA,sBACA,SACA,gBACA,mBACA,uBAGF,0CACE,kCACA,SAGF,2CACE,cACA,iBAEA,oDACE,mCACA,kCAEA,qHACE,+CAMR,iCACE,aACA,iBACA,gBAIA,oDACE,iBAGF,6CACE,cACA,kBAKN,8BACE,e;ACxEJ,WACE,YACA,eAEA,0BACE,YACA,cAEA,+BACE,aACA,qCACA,uBACA,gBACA,qBAIJ,wBACE,6BACA,gBACA,kB;ACpBJ,mBACE,6CACA,wBACA,aACA,8BAEA,gCACE,aACA,mBACA,mBACA,sBACA,gBACA,kCACA,+BACA,gBACA,MACA,mCAEA,yBAZF,gCAaI,kCAIJ,mCACE,iBAEA,6CACE,cACA,kBAIJ,gCACE,iBACA,kBACA,gBAEA,yBALF,gCAMI,kBAGF,yCACE,wBAKF,oEACE,qBAIA,6EACE,oBACA,eAKN,mCACE,0BACA,wBAGE,uDACE,iBACA,eAKN,8BACE,sBACA,kBACA,iB;AC1EJ,aACE,YACA,kBACA,aACA,sBACA,oBAEA,sBACE,kBACA,MACA,OACA,SACA,QACA,iCAGF,4BACE,sBACA,cACA,kBAEA,yBALF,4BAMI,gBAIJ,gCACE,0CACA,YACA,c;AC7BJ,YACE,kBACA,YAEA,2BACE,YACA,kBACA,kBAGF,qBACE,oBACA,0CAEA,0BACE,eAGF,mCACE,gBACA,iBAGF,+BACE,gBAGF,+BACE,2BAEA,yCACE,gBAIJ,mCACE,cACA,eACA,mBACA,kBAEA,oDACE,kBACA,OACA,MACA,WACA,YAEA,2DACE,aAKN,+BACE,kBAEA,0CACE,gBAGF,yDACE,oBAGF,gEACE,gBACA,mBAIA,gDACE,gBACA,mBAKF,mEACE,qBAKN,sCACE,gBACA,mBACA,kCAEA,gDACE,mBAIJ,mCACE,kCACA,qBAEA,6CACE,mBAIJ,mCACE,kCACA,kBAGF,8BACE,iBAIJ,kCACE,YAGF,wBACE,wBAGF,yBACE,gBAEA,gCACE,oBACA,mBAEA,2CACE,sBAKF,6CACE,aACA,WACA,eAGF,4CACE,cACA,aACA,eAMR,oBACE,mB;ACtJF,cACE,mBAEA,iBACE,gBACA,kCACA,qB;ACNJ,UACE,mBAGE,iBACE,kCACA,gBACA,oBAGF,sBACE,mB;ACXN,UACE,gBAEA,uBACE,aACA,mBACA,cAEA,2BACE,YACA,aAIA,gCACE,iBACA,mBAGF,+BACE,gBACA,iBACA,kCAKN,sBACE,YAEA,uCACE,kBACA,aACA,mBACA,4BACA,kCACA,gBAEA,4CACE,wBAGF,8CACE,aACA,YAKN,wBACE,0CACA,aAEA,4CACE,aACA,0BACA,gBAEA,8CACE,iBACA,kCACA,kBACA,aAGF,8DACE,oEACA,qBACA,mBACA,cAIA,yDACE,eACA,sBACA,gBACA,gBACA,sBACA,wBACA,0BAGF,wDACE,gBACA,kBACA,qC;ACtFV,WACE,kBAEA,qDACE,kBAGF,uBACE,kBACA,UACA,UACA,UAEA,2BACE,e;ACdN,aACE,mBAEA,gBACE,gBACA,kCACA,qBAGF,4BACE,aACA,8BAEA,yCACE,aACA,cACA,a;ACfJ,8BACE,oBAGF,sBACE,kBACA,4BACA,6BACA,WACA,oBACA,aACA,mBACA,mBACA,mCACA,6CAEA,yBACE,gBACA,mBACA,uBACA,mBAIJ,0BACE,aAGF,6BACE,aACA,eACA,aACA,mBACA,uBAGF,+BACE,aACA,gBAGF,uBACE,cACA,WACA,YACA,kBAGF,sBACE,kBACA,+BACA,gCACA,WACA,oBACA,mCACA,0CAEA,6BACE,oBACA,gBAIJ,4BACE,YAGF,6BACE,UACA,gBAIJ,+FAKI,4BACE,gBAGF,0BACE,c","sources":["webpack://telegram-t/./src/components/mediaViewer/SenderInfo.scss","webpack://telegram-t/./src/components/mediaViewer/MediaViewerActions.scss","webpack://telegram-t/./src/components/mediaViewer/MediaViewerFooter.scss","webpack://telegram-t/./src/components/mediaViewer/VideoPlayerControls.scss","webpack://telegram-t/./src/components/mediaViewer/VideoPlayer.scss","webpack://telegram-t/./src/components/mediaViewer/ZoomControls.scss","webpack://telegram-t/./src/components/mediaViewer/PanZoom.scss","webpack://telegram-t/./src/components/mediaViewer/MediaViewer.scss","webpack://telegram-t/./src/components/main/ForwardPicker.scss","webpack://telegram-t/./src/components/main/Dialogs.scss","webpack://telegram-t/./src/components/common/CalendarModal.scss","webpack://telegram-t/./src/components/middle/MessageSelectToolbar.scss","webpack://telegram-t/./src/components/left/search/RecentContacts.scss","webpack://telegram-t/./src/components/left/search/ChatMessage.scss","webpack://telegram-t/./src/components/left/search/DateSuggest.scss","webpack://telegram-t/./src/components/left/search/LeftSearch.scss","webpack://telegram-t/./src/components/ui/CropModal.scss","webpack://telegram-t/./src/components/ui/AvatarEditable.scss","webpack://telegram-t/./src/components/ui/ShowMoreButton.scss","webpack://telegram-t/./src/components/left/settings/folders/SettingsFoldersChatsPicker.scss","webpack://telegram-t/./src/components/left/settings/folders/SettingsFolders.scss","webpack://telegram-t/./src/components/ui/RangeSlider.scss","webpack://telegram-t/./src/components/left/settings/SettingsStickerSet.scss","webpack://telegram-t/./src/components/left/settings/WallpaperTile.scss","webpack://telegram-t/./src/components/left/settings/SettingsGeneralBackground.scss","webpack://telegram-t/./src/components/left/settings/SettingsGeneralBackgroundColor.scss","webpack://telegram-t/./src/components/common/PasswordMonkey.scss","webpack://telegram-t/./src/components/left/settings/Settings.scss","webpack://telegram-t/./src/styles/_mixins.scss","webpack://telegram-t/./src/components/left/newChat/NewChat.scss","webpack://telegram-t/./src/components/left/ArchivedChats.scss","webpack://telegram-t/./src/components/middle/message/MessageContextMenu.scss","webpack://telegram-t/./src/components/common/StickerSetModal.scss","webpack://telegram-t/./src/components/middle/HeaderMenuContainer.scss","webpack://telegram-t/./src/components/middle/MobileSearch.scss","webpack://telegram-t/./src/components/middle/composer/MentionTooltip.scss","webpack://telegram-t/./src/components/middle/composer/AttachmentModal.scss","webpack://telegram-t/./src/components/middle/composer/PollModal.scss","webpack://telegram-t/./src/components/middle/composer/EmojiButton.scss","webpack://telegram-t/./src/components/middle/composer/EmojiPicker.scss","webpack://telegram-t/./src/components/middle/composer/StickerPicker.scss","webpack://telegram-t/./src/components/common/GifButton.scss","webpack://telegram-t/./src/components/middle/composer/GifPicker.scss","webpack://telegram-t/./src/components/middle/composer/SymbolMenu.scss","webpack://telegram-t/./src/components/middle/composer/AttachMenu.scss","webpack://telegram-t/./src/components/middle/composer/BotCommand.scss","webpack://telegram-t/./src/components/middle/composer/BotCommandTooltip.scss","webpack://telegram-t/./src/components/middle/composer/BotCommandMenu.scss","webpack://telegram-t/./src/components/middle/composer/StickerTooltip.scss","webpack://telegram-t/./src/components/middle/composer/CustomSendMenu.scss","webpack://telegram-t/./src/components/middle/composer/EmojiTooltip.scss","webpack://telegram-t/./src/components/middle/composer/inlineResults/BaseResult.scss","webpack://telegram-t/./src/components/middle/composer/inlineResults/MediaResult.scss","webpack://telegram-t/./src/components/middle/composer/InlineBotTooltip.scss","webpack://telegram-t/./src/components/right/RightSearch.scss","webpack://telegram-t/./src/components/right/StickerSearch.scss","webpack://telegram-t/./src/components/right/GifSearch.scss","webpack://telegram-t/./src/components/right/PollAnswerResults.scss","webpack://telegram-t/./src/components/right/PollResults.scss","webpack://telegram-t/./src/components/right/management/Management.scss","webpack://telegram-t/./src/components/payment/ShippingInfo.scss","webpack://telegram-t/./src/components/payment/Shipping.scss","webpack://telegram-t/./src/components/payment/Checkout.scss","webpack://telegram-t/./src/components/payment/CardInput.scss","webpack://telegram-t/./src/components/payment/PaymentInfo.scss","webpack://telegram-t/./src/components/payment/PaymentModal.scss"],"sourcesContent":[".SenderInfo {\n display: flex;\n align-content: center;\n color: white;\n cursor: pointer;\n\n opacity: .5;\n transition: .15s opacity;\n\n &:hover {\n opacity: 1;\n }\n\n .Avatar {\n margin-inline-end: 1rem;\n\n @media (max-width: 600px) {\n display: none;\n }\n }\n\n .meta {\n display: flex;\n flex-direction: column;\n justify-content: center;\n max-width: 100%;\n }\n\n .title {\n line-height: 1.45rem;\n font-weight: 500;\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .date {\n line-height: 1.25rem;\n font-size: 0.875rem;\n letter-spacing: -0.01rem;\n }\n}\n",".MediaViewerActions {\n display: flex;\n margin-inline-start: auto;\n margin-inline-end: -.375rem;\n\n .Button {\n margin-inline-start: .25rem;\n }\n}\n\n.MediaViewerActions-mobile {\n position: relative;\n\n .ProgressSpinner {\n position: absolute;\n top: 0;\n left: 0;\n }\n}\n",".MediaViewerFooter {\n position: absolute;\n bottom: 0;\n padding: 1rem 0;\n width: 100%;\n transition: opacity .15s;\n\n #MediaViewer.zoomed & {\n display: none;\n }\n\n @media (max-height: 640px) {\n padding: .5rem 0 0;\n }\n\n @media (max-width: 600px) {\n padding-bottom: 4.5rem;\n background: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0) 100%);\n\n &.is-for-video {\n opacity: 0;\n pointer-events: none;\n\n .video-controls-visible & {\n opacity: 1;\n pointer-events: all;\n }\n }\n }\n\n .media-viewer-footer-content {\n position: relative;\n max-width: var(--messages-container-width);\n margin: auto;\n cursor: pointer;\n opacity: .5;\n transition: opacity .15s;\n\n &:hover {\n opacity: 1;\n }\n\n @media (max-width: 600px) {\n opacity: 1;\n }\n }\n\n &.is-hidden {\n opacity: 0;\n }\n\n .media-text {\n margin-bottom: 0;\n overflow: auto;\n padding: 0 .5rem;\n text-align: center;\n color: rgba(255, 255, 255, .9);\n font-size: .9375rem;\n letter-spacing: .025rem;\n max-height: 4.25rem;\n\n @media (max-height: 640px) {\n max-height: 2.75rem;\n }\n\n .emoji {\n width: .9375rem;\n height: .9375rem;\n vertical-align: -2px;\n }\n\n &.multiline {\n &::before {\n content: '';\n position: absolute;\n left: -.75rem;\n right: -.75rem;\n top: -.25rem;\n bottom: -.25rem;\n background: rgba(0, 0, 0, .75);\n border-radius: var(--border-radius-default);\n z-index: var(--z-below);\n\n @media (max-width: 600px) {\n display: none;\n background: none;\n }\n }\n }\n }\n\n a {\n color: var(--color-links);\n\n &:hover,\n &:focus {\n color: var(--color-links-hover);\n }\n }\n}\n",".VideoPlayerControls {\n display: flex;\n align-items: center;\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n padding-top: .625rem;\n font-size: .875rem;\n background: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0) 100%);\n\n #MediaViewer.zoomed & {\n display: none;\n }\n\n @media (max-width: 600px) {\n position: fixed;\n padding: 1.25rem .5rem .75rem;\n background: none;\n z-index: var(--z-media-viewer);\n }\n\n &.mobile {\n .player-file-size {\n position: static;\n left: auto;\n transform: none;\n margin-left: auto;\n }\n\n .fullscreen {\n margin-left: 1rem;\n }\n\n .player-time + .fullscreen {\n margin-left: auto;\n }\n }\n\n .Button {\n width: 2.25rem;\n padding: 0;\n margin: .25rem;\n height: 1.75rem;\n @media (max-width: 600px) {\n height: 2.25rem;\n }\n }\n\n .play i {\n line-height: 1.5rem;\n }\n\n .player-time {\n margin: 0 1rem;\n white-space: nowrap;\n }\n\n .fullscreen {\n margin-left: auto;\n @media (max-width: 600px) {\n margin-left: 1rem;\n }\n i {\n line-height: 1.75rem;\n @media (max-width: 600px) {\n font-size: 1.5rem;\n }\n }\n }\n\n @media (max-width: 600px) {\n .player-time + .fullscreen {\n margin-left: auto;\n }\n }\n\n .player-file-size {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n @media (max-width: 600px) {\n position: static;\n left: auto;\n transform: none;\n margin-left: auto;\n margin-right: 1rem;\n & + .fullscreen {\n margin-left: 0;\n }\n }\n }\n\n .player-seekline {\n position: absolute;\n left: 1rem;\n right: 1rem;\n top: 0;\n height: 1rem;\n\n\n &-track {\n position: absolute;\n top: 50%;\n left: -.25rem;\n right: -.25rem;\n height: 5px;\n transform: translateY(-50%);\n background-color: rgba(255, 255, 255, 0.16);\n border-radius: var(--border-radius-default);\n }\n\n &-buffered,\n &-played,\n &-input {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n border-radius: var(--border-radius-default);\n }\n\n &-buffered {\n background-color: rgba(255, 255, 255, 0.5);\n }\n\n &-played {\n background: var(--color-primary);\n\n &::after {\n content: '';\n position: absolute;\n width: .75rem;\n height: .75rem;\n border-radius: 50%;\n background-color: var(--color-primary);\n right: 0;\n top: 50%;\n transform: translate(.325rem, -50%);\n }\n }\n\n &-input {\n width: 100%;\n opacity: 0;\n margin: 0;\n padding: 0;\n cursor: pointer;\n overflow: hidden;\n\n &::-webkit-slider-thumb {\n margin-top: -2rem;\n }\n }\n }\n}\n",".VideoPlayer {\n position: relative;\n display: inline-flex;\n flex-direction: column;\n overflow: hidden;\n\n #MediaViewer.zoomed & {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n > div {\n width: 100% !important;\n height: 100% !important;\n }\n video {\n max-height: none !important;\n }\n }\n\n @media (min-width: 601px) {\n // Safari: custom controls are not displayed after exiting full screen mode.\n z-index: 1;\n }\n\n @media (max-width: 600px) {\n overflow: visible;\n }\n\n @media (max-height: 640px) {\n margin-bottom: 1.75rem;\n @at-root .has-footer #{&} {\n margin-bottom: 0;\n }\n }\n\n video {\n display: block;\n max-height: calc(100vh - 8.25rem);\n margin: auto;\n object-fit: contain;\n outline: none;\n width: 100%;\n height: 100%;\n background: no-repeat 50% 50%;\n background-size: contain;\n\n @media (max-height: 640px) {\n max-height: calc(100vh - 10rem);\n }\n @at-root .has-footer #{&} {\n max-height: calc(100vh - 15rem);\n @media (max-height: 640px) {\n max-height: calc(100vh - 10rem);\n }\n }\n }\n\n .play-button {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 3.25rem;\n height: 3.25rem;\n background-color: rgba(0, 0, 0, 0.5) !important;\n body:not(.animation-level-0) & {\n transition: opacity .3s ease !important;\n }\n\n .icon-play {\n font-size: 1.75rem;\n position: relative;\n left: .125rem;\n }\n }\n\n .spinner-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n\n .buffering {\n background: rgba(0, 0, 0, 0.25);\n color: #fff;\n font-size: 0.75rem;\n position: absolute;\n left: 0.1875rem;\n top: 0.1875rem;\n z-index: 1;\n padding: 0 0.375rem;\n border-radius: 0.75rem;\n line-height: 1.125rem;\n }\n\n .ProgressSpinner {\n cursor: pointer;\n }\n }\n}\n",".ZoomControls {\n position: absolute;\n bottom: 1.25rem;\n left: 50%;\n background: rgba(0,0,0,.5);\n border-radius: var(--border-radius-default);\n width: 100%;\n height: 3.375rem;\n max-width: 274px;\n transform: translate3d(-50%, 0, 10px);\n transition: opacity .3s ease-in;\n pointer-events: none;\n\n &.open {\n z-index: var(--z-media-viewer);\n pointer-events: all;\n }\n\n .zoom-out,\n .zoom-in {\n position: absolute;\n top: 0.4375rem;\n width: 2.5rem;\n height: 2.5rem;\n color: #fff;\n\n i {\n font-size: 1.5rem;\n }\n }\n\n .zoom-out {\n left: .5rem;\n }\n\n .zoom-in {\n right: .5rem;\n }\n\n .seekline {\n position: absolute;\n left: 3.25rem;\n right: 3.25rem;\n top: 1.125rem;\n height: 1rem;\n\n &-track {\n position: absolute;\n top: 50%;\n left: -.25rem;\n right: -.25rem;\n height: 2px;\n transform: translateY(-50%);\n background-color: rgba(255, 255, 255, .5);\n border-radius: var(--border-radius-default);\n }\n\n &-played,\n &-input {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n border-radius: var(--border-radius-default);\n }\n\n &-played {\n background: #fff;\n transition: width 200ms;\n\n &::after {\n content: '';\n position: absolute;\n width: .75rem;\n height: .75rem;\n border-radius: 50%;\n background-color: var(--color-white);\n right: 0;\n top: 50%;\n transform: translate(.325rem, -50%);\n }\n }\n\n &-input {\n width: 100%;\n height: 1rem;\n top: -.375rem;\n opacity: 0;\n margin: 0;\n padding: 0;\n cursor: pointer;\n overflow: hidden;\n\n &::-webkit-slider-thumb {\n margin-top: -2rem;\n }\n }\n }\n}\n",".pan-wrapper,\n.pan-container {\n position: relative;\n width: 100%;\n height: 100%;\n}\n\n.pan-wrapper {\n cursor: move;\n user-select: none;\n}\n\n.pan-container {\n transition: transform .2s ease-in;\n\n .pan-wrapper.move & {\n transition: none;\n }\n\n .zoomed & {\n position: fixed;\n top: 0;\n left: 0;\n }\n}\n","#MediaViewer {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100%;\n background: rgba(0, 0, 0, .9);\n color: #fff;\n z-index: var(--z-media-viewer);\n padding: 0.5rem 0;\n\n display: grid;\n grid-template-columns: auto;\n grid-template-rows: 2.75rem 1fr;\n grid-column-gap: 0;\n grid-row-gap: 0;\n justify-items: stretch;\n align-items: center;\n\n // Potential perf improvement\n &:not(.shown) {\n display: block !important;\n transform: scale(0);\n }\n\n body.ghost-animating & {\n > .pan-wrapper, > .Transition, > button {\n display: none;\n }\n }\n\n body.animation-level-2 & {\n transition-duration: .3s !important;\n }\n\n &:not(.open),\n .closing {\n .SenderInfo {\n pointer-events: none;\n transition: none;\n }\n }\n\n &.zoomed {\n .navigation {\n display: none;\n }\n\n .media-viewer-head {\n z-index: 2;\n }\n\n .media-viewer-content {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n padding: 0;\n z-index: 1;\n }\n }\n\n .media-viewer-head {\n display: flex;\n grid-area: 1 / 1 / 2 / -2;\n padding: 0 1.25rem;\n position: relative;\n z-index: var(--z-media-viewer-head);\n min-width: 0;\n\n & > .Transition {\n width: 100%;\n min-width: 0;\n }\n\n @media (max-width: 600px) {\n padding: 0 0.5rem;\n\n .media-viewer-close {\n margin-right: 1.5rem;\n }\n }\n }\n\n & > .Transition,\n & > .pan-wrapper {\n grid-area: 1 / 1 / -1 / -1;\n }\n\n & > .Transition,\n & > .pan-wrapper .Transition {\n position: relative;\n justify-self: center;\n text-align: center;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n overflow: hidden;\n }\n\n .media-viewer-content {\n position: relative;\n z-index: 1;\n padding: 3.25rem 0;\n height: 100%;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n\n &.has-footer {\n padding: 7rem 0;\n @media (min-width: 600px) {\n min-width: 600px;\n }\n\n @media (max-height: 640px) {\n padding: 4rem 0;\n }\n\n > img {\n max-height: calc(100vh - 15rem);\n @media (max-height: 640px) {\n max-height: calc(100vh - 10rem);\n }\n }\n }\n\n .thumbnail {\n position: relative;\n\n img {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n }\n\n > img {\n max-width: 100vw;\n max-height: calc(100vh - 8.25rem);\n object-fit: contain;\n transition: transform .2s;\n }\n\n .spinner-wrapper {\n max-width: 100vw;\n margin: auto;\n }\n\n .Spinner {\n margin: auto;\n }\n }\n\n .navigation {\n position: fixed;\n top: 4rem;\n width: 10vw;\n bottom: 0;\n border: none;\n padding: 0;\n margin: 0;\n appearance: none;\n background: transparent no-repeat;\n background-size: 1.25rem;\n opacity: 0;\n transition: opacity .15s;\n outline: none;\n cursor: pointer;\n z-index: 1;\n\n @media (max-width: 600px) {\n width: 20vw;\n }\n\n &:hover, .is-touch-env & {\n opacity: 1;\n }\n\n &.prev {\n left: 0;\n background-image: url(\"../../assets/media_navigation_previous.svg\");\n background-position: 1.25rem calc(50% - 2rem);\n\n &[dir=rtl] {\n left: auto;\n right: 0;\n transform: scaleX(-1);\n }\n }\n\n &.next {\n right: 0;\n background-image: url(\"../../assets/media_navigation_next.svg\");\n background-position: calc(100% - 1.25rem) calc(50% - 2rem);\n\n &[dir=rtl]{\n left: 0;\n right: auto;\n transform: scaleX(-1);\n }\n }\n\n &.inline {\n top: calc(50% - 3rem);\n bottom: unset;\n height: 6rem;\n background-position-y: center;\n\n @media (max-width: 600px) {\n opacity: 0;\n transition: opacity .15s ease-in;\n pointer-events: none;\n\n .video-controls-visible & {\n opacity: 1;\n pointer-events: all;\n }\n }\n }\n }\n}\n\n.ghost {\n position: absolute;\n z-index: var(--z-media-viewer);\n will-change: transform, opacity;\n overflow: hidden;\n border-radius: 0;\n transition: transform .2s ease, opacity .2s ease;\n\n &.rounded-corners {\n border-radius: var(--border-radius-messages);\n }\n\n &.circle {\n border-radius: 50%;\n }\n\n body.is-ios & {\n transition: transform .2s ease, opacity .2s ease, border-radius .2s ease !important;\n }\n\n img,\n video {\n width: 100%;\n height: 100%;\n user-select: none;\n -webkit-user-select: none;\n object-fit: cover;\n }\n}\n",".ForwardPicker {\n z-index: var(--z-media-viewer);\n\n .modal-dialog {\n height: 70%;\n max-width: 25rem;\n\n @media (max-width: 600px) {\n height: 90%;\n }\n }\n\n .modal-header {\n display: flex;\n align-items: center;\n padding: 0.25rem 0.5rem;\n\n .Button {\n margin-right: 0.5rem;\n }\n\n .input-group {\n margin: 0;\n }\n\n .form-control {\n border: none;\n box-shadow: none !important;\n\n height: 2.75rem;\n padding: 0.5rem;\n font-size: 1.25rem;\n line-height: 1.75rem;\n unicode-bidi: plaintext;\n }\n }\n\n .modal-content {\n padding: 0;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n\n .picker-list {\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n padding: 0 1rem 1rem;\n }\n }\n\n .no-results {\n height: 100%;\n margin: 0;\n padding: 1rem 1rem;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color-text-secondary);\n }\n\n .ListItem.chat-item-clickable {\n &:not(.force-rounded-corners) {\n @media (max-width: 600px) {\n margin: 0;\n\n .ListItem-button {\n border-radius: 0;\n }\n }\n }\n\n }\n}\n","#Dialogs {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n z-index: var(--z-modal);\n}\n",".CalendarModal {\n .modal-dialog {\n max-width: 26.25rem;\n .modal-content {\n padding: .375rem 1rem 1rem;\n }\n }\n\n .timepicker {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-bottom: 1.5rem;\n\n .form-control {\n max-width: 5rem;\n text-align: center;\n\n &:first-child {\n margin-right: 1rem;\n }\n &:last-child {\n margin-left: 1rem;\n }\n }\n }\n\n .footer {\n display: flex;\n justify-content: flex-end;\n flex-direction: column;\n\n .Button {\n text-transform: none;\n\n + .Button {\n margin-top: .5rem;\n }\n }\n }\n\n .month-selector {\n display: flex;\n align-items: center;\n\n h4 {\n flex: 1;\n margin: 0 0 0 1.25rem;\n font-size: 1.25rem;\n\n @media (max-width: 600px) {\n margin-left: .75rem;\n }\n\n & ~ .Button {\n color: var(--color-primary)\n }\n }\n\n .Button.hidden {\n opacity: 0.5;\n pointer-events: none;\n }\n }\n\n .day-button {\n position: relative;\n border-radius: 4rem;\n outline: none !important;\n font-weight: 500;\n margin: .125rem .625rem;\n\n @media (max-width: 600px) {\n margin: .25rem .375rem;\n }\n\n &.weekday {\n margin-bottom: 0;\n height: 1rem;\n }\n\n &.clickable {\n cursor: pointer;\n\n &:hover {\n background-color: var(--color-interactive-element-hover);\n }\n\n &.selected {\n background-color: var(--color-primary);\n color: white;\n }\n }\n\n &.disabled {\n opacity: 0.25;\n pointer-events: none;\n }\n\n &::before {\n content: \"\";\n display: block;\n padding-top: 100%;\n }\n\n span {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 0.875rem;\n }\n }\n\n .calendar-wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 17rem;\n margin: 1.5rem -0.5rem 0.5rem;\n }\n\n .calendar-grid {\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n width: 100%;\n }\n}\n",".MessageSelectToolbar {\n position: absolute;\n bottom: 0.5rem;\n left: 0.5rem;\n right: 0.5rem;\n width: auto;\n z-index: 20;\n justify-content: center;\n margin: 0;\n\n .mask-image-disabled &::before {\n left: auto !important;\n right: auto !important;\n }\n\n .no-composer & {\n width: 100%;\n }\n\n @media (min-width: 601px) {\n left: 1rem;\n right: 1rem;\n bottom: 1.25rem;\n\n .no-composer & {\n top: -4.75rem;\n }\n }\n\n opacity: 1;\n\n &-inner {\n transform: scaleX(1);\n transition: transform var(--select-transition), opacity var(--select-transition);\n }\n\n & .MessageSelectToolbar-inner {\n transform: scaleX(1) translateX(0);\n }\n\n .no-composer .unpin-button-container + &,\n .no-composer .messaging-disabled + & {\n top: auto;\n }\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n &:not(.shown) {\n opacity: 0;\n pointer-events: none;\n\n .shown-inner {\n transform: scaleX(var(--toolbar-hidden-scale, 1));\n }\n\n &.with-composer .MessageSelectToolbar-inner {\n transform: scaleX(var(--toolbar-hidden-scale, 1)) translateX(var(--toolbar-translate-x, 0));\n }\n\n &:not(.with-composer) .MessageSelectToolbar-inner {\n transform: scaleX(var(--toolbar-unpin-hidden-scale)) translateX(0);\n }\n }\n\n &::before {\n z-index: -1;\n max-width: 32rem;\n width: 100%;\n left: auto;\n right: auto;\n }\n\n &-inner {\n width: 100%;\n max-width: 32rem;\n display: flex;\n align-items: center;\n padding: 0.25rem;\n\n background: var(--color-background);\n border-radius: var(--border-radius-messages);\n box-shadow: 0 1px 2px var(--color-default-shadow);\n font-weight: 500;\n\n @media (max-width: 600px) {\n padding: 0;\n max-width: none;\n }\n\n > .Button {\n width: 3rem;\n height: 3rem;\n\n @media (max-width: 600px) {\n width: 2.875rem;\n height: 2.875rem;\n }\n }\n }\n\n &-count {\n margin-left: 1rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-grow: 1;\n\n @media (max-width: 600px) {\n margin-right: 0.5rem;\n }\n }\n\n &-actions {\n margin-left: auto;\n display: flex;\n\n .MenuItem {\n padding: 0.6875rem;\n border-radius: 50%;\n\n i {\n margin-right: 0;\n }\n\n .item-text {\n display: none;\n }\n }\n }\n}\n",".RecentContacts {\n .Loading {\n min-height: 75vh;\n }\n\n .top-peers-section {\n padding: .5rem 1rem;\n }\n\n .top-peers {\n height: 6rem;\n margin: 0 -1rem;\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n\n scrollbar-width: none;\n scrollbar-color: rgba(0, 0, 0, 0);\n\n &::-webkit-scrollbar {\n height: 0;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0);\n }\n }\n\n .top-peer-item {\n display: inline-block;\n width: 4.5rem;\n height: 6rem;\n padding: 0.625rem 0.25rem;\n margin-left: 0.5rem;\n border-radius: var(--border-radius-default);\n cursor: pointer;\n position: relative;\n overflow: hidden;\n\n &:first-child {\n margin-left: 0.125rem;\n }\n\n &:last-child {\n margin-right: 0.125rem;\n }\n\n .Avatar {\n margin: 0 auto 0.375rem;\n }\n\n &:hover {\n background: var(--color-chat-hover);\n }\n\n .top-peer-name {\n text-align: center;\n white-space: nowrap;\n font-size: 0.75rem;\n overflow: hidden;\n text-overflow: ellipsis;\n\n .emoji-small {\n width: 1rem;\n height: 1rem;\n background-size: 1rem;\n margin-inline-end: 1px;\n vertical-align: -3px;\n }\n }\n }\n\n .recent-chats-header {\n display: flex;\n align-items: center;\n\n .Button {\n margin-left: auto;\n }\n\n &[dir=rtl] {\n .Button {\n margin-left: 0;\n margin-right: auto;\n }\n }\n }\n}\n",".ChatMessage {\n &:first-child {\n margin-top: .5rem;\n }\n &:hover, &.selected {\n .Avatar.online::after {\n border-color: var(--color-chat-hover);\n }\n }\n\n .ListItem-button {\n padding: .25rem .5rem;\n }\n\n .info {\n .title {\n flex-grow: 1;\n }\n\n h3 {\n font-size: 1rem;\n width: auto;\n }\n\n .subtitle {\n color: var(--color-text-secondary);\n\n .matching-text-highlight {\n color: var(--color-text);\n background: #CAE3F7;\n border-radius: 0.25rem;\n padding: 0 0.125rem;\n }\n }\n\n .message {\n flex-grow: 1;\n color: var(--color-text-secondary);\n overflow: hidden;\n text-overflow: ellipsis;\n\n .sender-name {\n color: var(--color-text);\n }\n .sender-name {\n &::after {\n content: ': ';\n }\n }\n\n img {\n width: 1.25rem;\n height: 1.25rem;\n object-fit: cover;\n border-radius: .125rem;\n vertical-align: -.25rem;\n margin-right: .25rem;\n }\n\n .icon-play {\n position: relative;\n display: inline-block;\n font-size: .75rem;\n color: #fff;\n margin-inline-start: -1.25rem;\n margin-inline-end: 0.5rem;\n bottom: 0.0625rem;\n }\n }\n }\n\n .info-row {\n display: flex;\n justify-content: space-between;\n }\n\n &[dir=rtl] {\n .subtitle {\n text-align: right;\n }\n }\n}\n",".DateSuggest {\n display: flex;\n height: 2rem;\n flex-direction: row;\n justify-content: space-between;\n margin-left: .5rem;\n margin-bottom: .5rem;\n\n .date-item {\n display: flex;\n flex: 1 1 auto;\n min-width: 8rem;\n margin-top: .375rem;\n cursor: pointer;\n font-size: .875rem;\n font-weight: 500;\n color: var(--color-text-secondary);\n\n .icon-calendar {\n font-size: 1.25rem;\n margin-right: .25rem;\n }\n }\n \n}",".LeftSearch {\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n\n & > .Transition {\n flex: 1;\n overflow: hidden;\n }\n\n .TabList {\n padding-bottom: 1px;\n z-index: 1;\n }\n\n .documents-list {\n padding: 0 1.25rem 1.25rem;\n\n .ListItem {\n padding: 0.625rem 0;\n }\n }\n\n .section-heading {\n position: relative;\n padding-top: 1.25rem;\n padding-left: 1.25rem;\n margin: 0 0 1rem -1.25rem !important;\n\n font-weight: 500;\n font-size: .9375rem;\n color: var(--color-text-secondary);\n\n &::before {\n content: '';\n position: absolute;\n width: 100%;\n height: 1px;\n background: var(--color-borders);\n left: .625rem;\n top: -1px;\n }\n\n &[dir=rtl],\n &[dir=auto] {\n padding-left: 0;\n padding-right: 1.25rem;\n margin: 0 -1.25rem 0 1rem !important;\n text-align: initial;\n\n &::before {\n left: auto;\n right: .625rem;\n }\n }\n }\n\n .LeftSearch .search-section .section-heading,\n .RecentContacts .search-section .section-heading {\n margin-left: -1rem !important;\n width: calc(100% + 2rem);\n box-shadow: 0 -1px 0 0 var(--color-borders);\n\n &::before {\n display: none;\n }\n }\n\n .WebLink {\n display: flex;\n }\n\n .content:not(.with-seekline) {\n align-self: center;\n min-width: 0;\n flex-grow: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: break-word;\n }\n\n .message-date {\n font-size: .75rem;\n color: var(--color-text-secondary);\n padding-left: 1rem;\n white-space: nowrap;\n }\n\n .media-list {\n display: grid;\n padding: .5rem;\n grid-template-columns: repeat(3, 1fr);\n grid-auto-rows: 1fr;\n grid-gap: .25rem;\n }\n\n .Audio {\n .duration span {\n padding: 0 .25rem;\n }\n\n .ProgressSpinner {\n margin: -.1875rem 0 0 -.1875rem;\n }\n }\n\n .ListItem.search-result {\n .ChatInfo {\n .handle {\n unicode-bidi: plaintext;\n color: var(--color-primary);\n unicode-bidi: plaintext;\n\n &::before {\n content: '@';\n html[lang=ar] & {\n content: ' ،@';\n margin-inline-end: .25rem;\n }\n }\n\n &::after {\n content: ', ';\n color: var(--color-text-secondary);\n\n html[lang=ar] & {\n content: '';\n }\n }\n }\n\n &[dir=rtl] {\n .status {\n text-align: right;\n\n .handle {\n float: right;\n }\n }\n }\n }\n }\n\n .ListItem.search-result-message {\n .sender-name {\n color: var(--color-text);\n\n &::after {\n content: ': ';\n white-space: pre;\n }\n }\n }\n\n @media (max-width: 600px) {\n .ListItem {\n margin: 0 -0.625rem;\n }\n }\n\n .search-section {\n padding: 0 1rem 0.5rem;\n\n .section-heading {\n color: var(--color-text-secondary);\n font-size: .9375rem;\n font-weight: 500;\n margin-bottom: 0 !important;\n padding-top: .875rem;\n\n .Link {\n float: right;\n color: var(--color-links);\n font-weight: 400;\n margin-right: 1rem;\n\n &:focus,\n &:hover {\n color: var(--color-links-hover);\n }\n }\n\n &[dir=rtl],\n &[dir=auto] {\n .Link {\n float: left;\n margin-left: 1rem;\n margin-right: 0;\n }\n }\n }\n\n .Loading {\n height: 4.5rem;\n margin-bottom: 0.5rem;\n }\n }\n\n .chat-selection {\n padding-top: .5rem;\n display: flex;\n flex-shrink: 0;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: flex-end;\n box-shadow: inset 0 -1px 0 0 var(--color-borders);\n background-color: var(--color-background);\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: hidden;\n\n scrollbar-color: rgba(0, 0, 0, 0);\n\n > .PickerSelectedItem {\n flex: 0 0 auto;\n\n &:last-child {\n margin-right: auto;\n }\n }\n\n &[dir=rtl] {\n > .PickerSelectedItem:last-child {\n margin-left: auto;\n margin-right: 0;\n }\n }\n }\n\n .NothingFound {\n height: 100%;\n }\n\n [dir=rtl] {\n .message-date {\n padding-left: 0;\n padding-right: 1rem;\n }\n }\n}\n","@mixin thumb-styles() {\n background: var(--color-primary);\n cursor: pointer;\n transform: scale(1);\n transition: transform .25s ease-in-out;\n\n &:hover {\n transform: scale(1.2);\n }\n}\n\n.CropModal {\n .modal-dialog {\n width: calc(100% - 2rem);\n max-width: 35rem;\n height: calc(100% - 1rem);\n max-height: 35rem;\n position: relative;\n }\n\n .modal-content, #avatar-crop {\n overflow: hidden;\n }\n\n .confirm-button {\n position: absolute;\n bottom: 1rem;\n right: 1rem;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n }\n\n #avatar-crop {\n max-width: 25rem;\n margin: 0 auto;\n position: relative;\n\n &::before {\n content: '';\n display: block;\n padding-top: 100%;\n }\n\n .cr-boundary {\n position: absolute;\n top: 0;\n left: 0;\n border-radius: var(--border-radius-messages-small);\n }\n\n .cr-viewport {\n border: none;\n box-shadow: 0 0 2000px 2000px rgba(white, 0.5);\n }\n\n .cr-slider {\n // Note that while we're repeating code here, that's necessary as you can't comma-separate these type of selectors.\n // Browsers will drop the entire selector if it doesn't understand a part of it.\n\n &::-webkit-slider-runnable-track {\n background: var(--color-borders);\n }\n\n &::-moz-range-track {\n background: var(--color-borders);\n }\n\n &::-ms-track {\n background: var(--color-borders);\n }\n\n &::-webkit-slider-thumb {\n @include thumb-styles();\n }\n\n &::-moz-range-thumb {\n @include thumb-styles();\n }\n\n &::-ms-thumb {\n @include thumb-styles();\n }\n }\n }\n}\n","@import '../../styles/mixins';\n\n.AvatarEditable {\n label {\n margin-left: auto;\n margin-right: auto;\n width: 7.5rem;\n height: 7.5rem;\n margin-bottom: 2rem;\n display: flex !important;\n align-items: center;\n justify-content: center;\n background-color: var(--color-primary);\n border-radius: 50%;\n color: white;\n font-size: 3rem;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n outline: none !important;\n\n input {\n display: none;\n }\n\n img {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n i {\n transform: scale(1);\n transition: transform .15s linear;\n z-index: var(--z-register-add-avatar);\n }\n\n // @optimization The weirdest workaround for screen animation lag\n @include while-transition() {\n input, i, &::after {\n display: none !important;\n }\n\n img {\n position: static !important;\n }\n }\n\n &:hover {\n i {\n transform: scale(1.2);\n }\n }\n\n &.filled {\n background-color: var(--color-background);\n\n &::after {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(black, 0.4);\n }\n }\n\n &.disabled {\n pointer-events: none;\n\n i {\n display: none;\n }\n\n &::after {\n display: none;\n }\n }\n }\n}\n",".ShowMoreButton {\n color: var(--text-color) !important;\n display: flex;\n align-items: center;\n text-align: left;\n text-transform: none;\n padding-left: .75rem !important;\n opacity: 1 !important;\n\n i {\n font-size: 1.5rem;\n margin-right: 2rem;\n color: var(--color-text-secondary);\n }\n\n .Spinner {\n top: 0.4375rem;\n }\n}\n",".SettingsFoldersChatsPicker {\n height: calc(100% - var(--header-height));\n\n .picker-header {\n box-shadow: 0 0 2px var(--color-default-shadow);\n\n .max-items-reached {\n margin-bottom: 0.5rem;\n margin-left: 0.5rem;\n flex-grow: 1;\n }\n\n .max-items-reached {\n color: var(--color-text-secondary);\n }\n }\n\n .picker-list {\n padding: 0 0.5rem 0.5rem;\n\n .no-results {\n height: 10rem;\n }\n }\n\n .ListItem.picker-list-item {\n &.chat-type-item .ListItem-button {\n padding: 0.875rem 0.75rem;\n }\n\n &.chat-item .ListItem-button {\n padding: 0.5rem 0.75rem;\n }\n\n .Checkbox {\n margin-left: auto;\n padding-left: 3.25rem;\n }\n\n .chat-type {\n font-size: 1rem;\n font-weight: 400;\n margin: 0;\n }\n\n &[dir=rtl] {\n .Checkbox {\n margin-left: 0;\n margin-right: auto;\n padding-left: 0;\n padding-right: 3.25rem;\n }\n }\n }\n\n .settings-item-header {\n margin-left: 0.75rem;\n margin-top: 1rem;\n margin-bottom: 0.5rem;\n }\n\n .picker-list-divider {\n margin: 0.5rem -0.5rem 0;\n border-bottom: 1px solid var(--color-borders);\n }\n}\n",".settings-folders-recommended-item {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.settings-folders-list-item {\n .ChatInfo {\n display: flex;\n align-items: center;\n\n .Avatar {\n margin-left: -0.25rem;\n margin-right: 1.5rem;\n }\n\n .title {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n\n h3 {\n font-size: 1rem;\n font-weight: 500;\n line-height: 1.3125;\n margin: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-align: left;\n }\n }\n\n .status {\n display: none;\n }\n\n &[dir=rtl] {\n .title h3{\n text-align: right;\n }\n }\n }\n\n .ListItem-button {\n i {\n opacity: 0.9;\n }\n }\n\n &.color-primary .ListItem-button {\n color: var(--color-primary);\n\n i {\n opacity: 1;\n color: inherit;\n }\n }\n\n &[dir=rtl] {\n .Avatar {\n margin-left: 1.5rem;\n margin-right: -0.25rem;\n }\n }\n}\n\n.settings-item .ShowMoreButton {\n margin: 0 -1rem;\n width: calc(100% + 2rem);\n padding-left: 1rem !important;\n}\n","@mixin thumb-styles() {\n background: var(--slider-color);\n border: none;\n height: 0.75rem;\n width: 0.75rem;\n border-radius: 50%;\n cursor: pointer;\n transform: scale(1);\n transition: transform .25s ease-in-out;\n\n &:hover {\n transform: scale(1.2);\n }\n}\n\n.RangeSlider {\n --slider-color: var(--color-primary);\n\n margin-bottom: 1rem;\n\n &.disabled {\n pointer-events: none;\n --slider-color: var(--color-text-secondary);\n }\n\n .slider-top-row {\n display: flex;\n justify-content: space-between;\n margin-bottom: 0.625rem;\n\n .value {\n flex-shrink: 0;\n margin-left: 1rem;\n color: var(--color-text-secondary);\n }\n\n &[dir=rtl] {\n .value {\n margin-left: 0;\n margin-right: 1rem;\n }\n }\n }\n\n .slider-main {\n position: relative;\n z-index: 1;\n\n &::before {\n content: '';\n position: absolute;\n width: 100%;\n left: 0;\n top: 0.3125rem;\n height: 0.125rem;\n background-color: var(--color-borders);\n border-radius: 0.125rem;\n opacity: 0.5;\n z-index: -1;\n }\n }\n\n .slider-fill-track {\n position: absolute;\n width: 100%;\n left: 0;\n top: 0.3125rem;\n height: 0.125rem;\n background-color: var(--slider-color);\n border-radius: 0.125rem;\n pointer-events: none;\n }\n\n // Reset range input browser styles\n input[type=\"range\"] {\n -webkit-appearance: none;\n display: block;\n width: 100%;\n height: 0.75rem;\n margin-bottom: 0.5rem;\n background: transparent;\n\n &:focus {\n outline: none;\n }\n\n &::-ms-track {\n width: 100%;\n cursor: pointer;\n\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n }\n }\n\n // Apply custom styles\n input[type=\"range\"] {\n // Note that while we're repeating code here, that's necessary as you can't comma-separate these type of selectors.\n // Browsers will drop the entire selector if it doesn't understand a part of it.\n &::-webkit-slider-thumb {\n @include thumb-styles();\n }\n\n &::-moz-range-thumb {\n @include thumb-styles();\n }\n\n &::-ms-thumb {\n @include thumb-styles();\n }\n }\n\n .slider-options {\n display: grid;\n grid-template-rows: auto;\n grid-auto-columns: 1fr;\n grid-auto-flow: column;\n }\n\n .slider-option {\n font-size: 0.825rem;\n text-align: center;\n cursor: pointer;\n color: var(--color-text-secondary);\n transition: color .2s ease;\n\n &:hover, &.active {\n color: var(--color-text);\n }\n\n &.active {\n font-weight: 500;\n }\n\n &:first-child {\n text-align: left;\n }\n\n &:last-child {\n text-align: right;\n }\n }\n}\n",".SettingsStickerSet {\n .settings-item &.ListItem {\n margin-bottom: .5rem;\n }\n\n .StickerButton,\n .Button {\n width: 3rem;\n height: 3rem;\n margin: 0 .5rem 0 0;\n padding: 0;\n flex: 0 0 3rem;\n }\n\n img {\n max-width: 100%;\n max-height: 100%;\n }\n\n .multiline-menu-item {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n\n &[dir=rtl] {\n .StickerButton,\n .Button {\n margin: 0 0 0 .5rem;\n }\n }\n}\n",".WallpaperTile {\n height: 0;\n padding-bottom: 100%;\n cursor: pointer;\n position: relative;\n\n .media-inner,\n &::after {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n }\n\n .media-inner {\n overflow: hidden;\n transform: scale(1);\n transition: transform .15s ease;\n\n img, canvas {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n }\n\n &::after {\n content: \"\";\n display: block;\n border: 2px solid var(--color-primary);\n opacity: 0;\n transition: opacity .15s ease;\n }\n\n &.selected {\n &::after {\n opacity: 1;\n }\n\n .media-inner {\n transform: scale(0.9);\n }\n }\n\n .spinner-container {\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n}\n",".SettingsGeneralBackground {\n .settings-wallpapers {\n display: grid;\n padding: .5rem;\n grid-template-columns: repeat(3, 1fr);\n grid-auto-rows: 1fr;\n grid-gap: .25rem;\n }\n\n .Loading {\n height: auto !important;\n margin-top: 5rem;\n }\n}\n",".SettingsGeneralBackgroundColor {\n &:not(.is-dragging) .handle {\n transition: transform 300ms ease;\n }\n\n .color-picker, .hue-picker {\n position: relative;\n }\n\n .color-picker {\n margin-top: 1rem;\n height: 12rem;\n }\n\n .hue-picker {\n margin: 2rem 0;\n height: 0.5rem;\n }\n\n canvas {\n display: block;\n width: 100%;\n height: 100%;\n border-radius: var(--border-radius-default);\n cursor: pointer;\n }\n\n .handle {\n position: absolute;\n top: -0.75rem;\n left: -0.75rem;\n width: 1.5rem;\n height: 1.5rem;\n border: 0.125rem solid var(--color-white);\n border-radius: 0.75rem;\n cursor: grab;\n }\n\n .hue-picker .handle {\n top: -0.5rem;\n }\n\n .tools {\n margin-bottom: 0.625rem;\n display: flex;\n\n .input-group {\n margin-bottom: 0;\n\n &[dir=rtl] {\n label {\n transform: scale(0.75) translate(1.25rem, -2.25rem);\n }\n }\n }\n\n .input-group:first-child {\n margin-right: 0.5rem;\n }\n\n .input-group:last-child {\n margin-left: 0.5rem;\n }\n }\n\n .predefined-colors {\n display: grid;\n padding: .5rem;\n grid-template-columns: repeat(3, 1fr);\n grid-auto-rows: 1fr;\n grid-gap: .25rem;\n\n div {\n cursor: pointer;\n box-shadow: inset 0 0 0 0 var(--color-background);\n transition: box-shadow 300ms ease;\n\n &.active {\n border: 0.125rem solid var(--color-primary);\n box-shadow: inset 0 0 0 0.3125rem var(--color-background);\n }\n\n // A hack to make a square\n &:before {\n display: block;\n content: \"\";\n width: 100%;\n padding-top: 100%;\n pointer-events: none;\n }\n }\n }\n}\n","#monkey {\n position: relative;\n display: block;\n margin-left: auto;\n margin-right: auto;\n width: 7.5rem;\n height: 7.5rem;\n margin-bottom: 1.75rem;\n\n @media (min-width: 600px) and (min-height: 450px) {\n width: 10rem;\n height: 10rem;\n margin-bottom: 2.5rem;\n }\n\n &.big {\n width: 10rem;\n height: 10rem;\n }\n\n .AnimatedSticker {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n\n &.hidden {\n display: none\n }\n }\n\n .monkey-preview {\n width: 100%;\n height: 100%;\n background-size: 100%;\n background: url('../../assets/monkey.svg') center;\n }\n}\n","@import '../../../styles/mixins';\n\n#Settings {\n height: 100%;\n\n > div {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .left-header {\n padding-right: .8125rem;\n }\n}\n\n.settings-main-header {\n display: flex;\n flex-grow: 1;\n justify-content: space-between;\n align-items: center;\n}\n\n.settings-more-menu {\n .bubble {\n width: auto;\n\n .MenuItem button {\n padding-left: 1rem !important;\n padding-right: 2rem !important;\n }\n }\n}\n\n.settings-content {\n background: var(--color-background);\n height: calc(100% - var(--header-height));\n\n overflow-y: auto;\n @include overflow-y-overlay();\n\n &.infinite-scroll {\n display: flex;\n flex-direction: column;\n\n & > .custom-scroll {\n flex: 1 1 auto;\n height: auto;\n }\n }\n\n #monkey {\n margin-top: .5rem;\n margin-bottom: 1rem;\n }\n\n .AnimatedEmoji {\n margin-top: .5rem;\n margin-bottom: 1.5rem;\n }\n}\n\n.settings-content-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 0 1.5rem 1rem;\n text-align: center;\n\n .input-group {\n width: 100%;\n }\n}\n\n.settings-content-icon {\n width: 5rem;\n height: 5rem;\n margin-bottom: 2.5rem;\n position: relative;\n\n .AnimatedSticker {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n\n &.hidden {\n display: none\n }\n }\n}\n\n.settings-main-menu {\n padding: 0 0.5rem .75rem;\n\n > .ChatExtra {\n padding: 0 .5rem .3125rem;\n margin: 0 -.5rem .625rem;\n box-shadow: inset 0 -.0625rem 0 0 var(--color-background-secondary-accent);\n border-bottom: .625rem solid var(--color-background-secondary);\n\n .ListItem.narrow {\n margin-bottom: .25rem;\n }\n }\n}\n\n.settings-item {\n border-top: 1px solid var(--color-borders);\n padding: 1.5rem 1.5rem 1rem;\n\n &.no-border {\n border-top: none;\n }\n\n &-header {\n font-size: 1rem;\n color: var(--color-text-secondary);\n margin-bottom: 2rem;\n position: relative;\n\n &[dir=rtl] {\n text-align: right;\n }\n }\n\n &-slider {\n margin-top: 2rem;\n }\n\n &-description {\n font-size: 0.875rem;\n color: var(--color-text-secondary);\n margin-top: -0.5rem;\n margin-bottom: 1.5rem;\n\n .settings-content.two-fa & {\n font-size: 1rem;\n }\n\n &[dir=rtl] {\n text-align: right;\n unicode-bidi: plaintext;\n }\n }\n\n &-description-larger {\n font-size: 1rem;\n line-height: 1.3125rem;\n color: var(--color-text-secondary);\n margin-top: 2rem;\n margin-bottom: 0.75rem;\n\n &[dir=rtl] {\n text-align: right;\n }\n }\n\n .ListItem {\n margin: 0 -1rem 1rem;\n\n &:last-child {\n margin-bottom: 0;\n }\n\n .multiline-menu-item {\n white-space: initial;\n\n &.full-size {\n width: 100%;\n }\n\n .date {\n float: right;\n font-size: 0.75rem;\n margin-left: 1rem;\n color: var(--color-text-secondary);\n }\n\n .title, .subtitle {\n display: block;\n text-align: left;\n }\n\n .title {\n line-height: 1.25rem;\n }\n\n .subtitle {\n font-size: 0.875rem;\n line-height: 1.5rem;\n color: var(--color-text-secondary);\n\n & + .subtitle {\n margin-top: -0.25rem;\n }\n\n &.black {\n color: var(--color-text);\n }\n\n &.tight {\n line-height: 1.3125rem;\n margin-bottom: .1875rem;\n }\n }\n }\n\n &.destructive {\n .ListItem-button {\n color: var(--color-error);\n\n i {\n color: inherit;\n }\n }\n }\n\n &.blocked-list-item {\n margin-bottom: 0.5rem;\n\n .ListItem-button {\n align-items: center;\n text-align: left;\n padding: 0.5rem;\n }\n\n .Avatar {\n width: 3rem;\n height: 3rem;\n margin-right: 1rem;\n }\n\n .contact-name {\n font-size: 1rem;\n line-height: 1rem;\n margin-bottom: 0.25rem;\n font-weight: 500;\n }\n\n .contact-phone {\n font-size: 0.875rem;\n line-height: 1rem;\n color: var(--color-text-secondary);\n }\n }\n\n &[dir=rtl] {\n .multiline-menu-item {\n .title, .subtitle {\n text-align: right;\n }\n\n .date {\n float: left;\n margin-left: 0;\n margin-right: 1rem;\n }\n }\n }\n }\n\n .RangeSlider {\n margin-bottom: 1.0625rem;\n }\n\n .Checkbox, .radio-group {\n margin: 0 -1rem 0.5rem;\n }\n\n .radio-group {\n .Radio:last-child {\n margin-bottom: 0;\n }\n }\n\n .Radio + .Radio, .Checkbox + .Checkbox {\n margin-top: 2rem;\n }\n}\n\n.settings-fab-wrapper {\n height: calc(100% - var(--header-height));\n position: relative;\n overflow: hidden;\n\n .settings-content {\n height: 100%;\n }\n\n .FloatingActionButton {\n right: 1.5rem;\n }\n}\n\n.settings-edit-profile {\n padding: 0 1.5rem;\n}\n\n.username-link {\n color: var(--color-links);\n}\n","// @optimization\n@mixin while-transition() {\n .Transition > div:not(.active) &, body.animating-right-column & {\n @content;\n }\n}\n\n@mixin overflow-y-overlay() {\n @supports (overflow-y: overlay) {\n overflow-y: overlay;\n\n //Workaround for Android <= 9\n overflow-x: hidden;\n }\n}\n",".NewChat {\n height: 100%;\n overflow: hidden;\n position: relative;\n\n &-inner {\n height: calc(100% - var(--header-height));\n overflow: hidden;\n\n &.step-2 {\n padding: 0 1.25rem;\n display: flex;\n flex-direction: column;\n\n .note, .error {\n font-size: 0.875rem;\n line-height: 1.25rem;\n margin: 1.5rem 0.25rem;\n }\n\n .error {\n color: var(--color-error);\n }\n\n .note {\n margin-top: -0.5625rem;\n color: var(--color-text-secondary);\n }\n\n .chat-members-heading {\n color: var(--color-text-secondary);\n font-size: 1rem;\n font-weight: 500;\n margin: 1rem 0.25rem;\n }\n\n .chat-members-list {\n margin: 0 -1.25rem;\n padding: 0 1rem 1rem;\n\n overflow-x: hidden;\n flex-grow: 1;\n }\n }\n }\n}\n",".ArchivedChats {\n height: 100%;\n overflow: hidden;\n\n .chat-list {\n height: calc(100% - var(--header-height));\n }\n}\n",".MessageContextMenu {\n position: absolute;\n font-size: 1rem;\n\n .bubble {\n transform: scale(0.5);\n transition: opacity .15s cubic-bezier(0.2, 0, 0.2, 1), transform .15s cubic-bezier(0.2, 0, 0.2, 1) !important;\n }\n\n .backdrop {\n position: absolute;\n touch-action: none;\n }\n}\n",".StickerSetModal {\n .modal-dialog {\n width: 26.25rem;\n max-width: 100%;\n }\n\n @media (max-width: 600px) {\n .modal-dialog {\n width: 18.875rem;\n }\n }\n\n .modal-header {\n padding: 0.5rem 1rem;\n }\n\n .modal-content {\n text-align: center;\n padding: 0;\n }\n\n .stickers {\n position: relative;\n width: 100%;\n height: 19rem;\n max-height: 50vh;\n overflow-y: auto;\n padding: 0 0.25rem;\n text-align: left;\n }\n\n .button-wrapper {\n padding: 0.5rem 0;\n border-top: 1px solid var(--color-borders);\n box-shadow: 0 0 2px var(--color-default-shadow);\n\n button {\n display: inline-block;\n }\n }\n\n .Loading {\n width: 100%;\n height: 22.8125rem;\n max-height: calc(50vh + 3.8125rem);\n }\n}\n\n",".HeaderMenuContainer {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 100vh;\n z-index: var(--z-header-menu);\n\n .Menu {\n position: absolute;\n font-size: 1rem;\n\n .backdrop {\n z-index: var(--z-header-menu-backdrop);\n }\n\n .bubble {\n z-index: var(--z-header-menu);\n --offset-y: calc(100% + 1rem);\n }\n }\n}\n","#MobileSearch > .header {\n position: absolute;\n top: 0;\n left: 0;\n z-index: var(--z-mobile-search);\n width: 100%;\n height: 3.5rem;\n background: var(--color-background);\n display: flex;\n align-items: center;\n padding: 0 0.5rem 0 0.25rem;\n\n > .SearchInput {\n margin-left: 0.25rem;\n flex: 1;\n }\n}\n\n#MobileSearch > .footer {\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: var(--z-mobile-search);\n width: 100%;\n height: 3.5rem;\n background: var(--color-background);\n display: flex;\n align-items: center;\n padding-left: 1rem;\n padding-right: 0.5rem;\n\n > .counter {\n flex: 1;\n color: var(--color-text-secondary);\n }\n}\n\n#MobileSearch:not(.active) {\n .header, .footer {\n // `display: none` will prevent synchronous focus on iOS\n transform: translateX(-999rem);\n }\n}\n",".MentionTooltip {\n width: calc(100% - 4rem);\n max-width: 20rem;\n flex-direction: column;\n\n z-index: -1;\n\n @media (max-width: 600px) {\n width: calc(100% - 3rem);\n }\n\n .ListItem.chat-item-clickable {\n margin: 0;\n\n .ListItem-button {\n border-radius: 0;\n }\n\n .info {\n display: flex;\n }\n\n .title {\n margin-inline-end: .625rem;\n max-width: 70%;\n }\n\n .handle {\n font-size: 1rem;\n }\n\n &[dir=rtl] {\n .status {\n width: auto;\n }\n }\n }\n\n .ChatInfo {\n .title h3 {\n line-height: 1.25;\n }\n\n .Avatar {\n margin-right: 0.7em;\n }\n\n .handle {\n &::before {\n content: '@';\n }\n }\n\n .user-status {\n display: none !important;\n }\n }\n}\n",".AttachmentModal {\n --border-radius-default: 0.625rem;\n\n .modal-dialog {\n max-width: 26.25rem;\n @media(max-width: 600px) {\n max-height: 100%;\n padding-bottom: 1.5rem;\n }\n }\n\n .modal-content {\n padding: .5rem 1.25rem 1.875rem;\n max-height: calc(100vh - 3.25rem);\n @media(max-width: 600px) {\n padding-bottom: .25rem;\n }\n }\n\n .media-wrapper {\n max-height: 26rem;\n overflow: auto;\n display: flex;\n flex-wrap: wrap;\n margin-bottom: 1.5rem;\n\n video,\n img {\n flex: 1;\n width: calc(50% - 0.15rem);\n height: 12rem;\n margin-bottom: 0.3rem;\n border-radius: var(--border-radius-default);\n object-fit: cover;\n\n &:only-child {\n height: auto;\n max-height: 25rem;\n margin-bottom: 0;\n }\n\n &:nth-child(even) {\n margin-left: 0.3rem;\n }\n }\n }\n\n .document-wrapper {\n max-height: 25rem;\n overflow: auto;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n margin: .75rem 0 1.75rem;\n\n .File:not(:last-child) {\n margin-bottom: 1.5rem;\n }\n\n .file-icon {\n cursor: default !important;\n }\n }\n\n .attachment-caption-wrapper {\n position: relative;\n\n .form-control {\n background: var(--color-background);\n }\n\n .MentionTooltip {\n right: 0 !important;\n z-index: 0;\n }\n }\n\n .drop-target {\n position: relative;\n\n &::before,\n &::after {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n border-radius: var(--border-radius-default);\n pointer-events: none;\n\n opacity: 0;\n transition: 250ms opacity;\n z-index: 1;\n }\n\n &::before {\n background-image: var(--drag-target-border-hovered);\n background-color: var(--color-background);\n }\n\n &::after {\n content: attr(data-attach-description);\n display: flex;\n justify-content: center;\n align-items: center;\n color: var(--color-primary);\n }\n }\n\n &.hovered {\n .drop-target::before {\n opacity: .95;\n }\n\n .drop-target::after {\n opacity: 1;\n }\n\n .attachment-caption-wrapper,\n .document-wrapper,\n .media-wrapper {\n pointer-events: none;\n }\n\n .document-wrapper,\n .media-wrapper {\n border-radius: var(--border-radius-default);\n }\n }\n}\n",".PollModal {\n .modal-dialog {\n max-width: 26.25rem;\n max-height: calc(100vh - 5rem);\n }\n\n .modal-content {\n padding: .5rem 1.25rem 1.875rem;\n min-height: 4.875rem;\n }\n\n .modal-header-condensed {\n margin-bottom: 1rem;\n }\n\n .options-header {\n color: var(--color-text-secondary);\n font-size: 1rem;\n font-weight: 500;\n margin: 1.5rem 0.25rem;\n }\n\n .options-list {\n margin: 1rem -0.75rem -0.5rem;\n padding: 0 0.75rem;\n border-top: 1px solid var(--color-chat-hover);\n max-height: 20rem;\n overflow: auto;\n\n &.overflown {\n padding: 0 0.4rem 0.5rem 0.75rem;\n }\n\n @media (max-width: 600px) {\n overflow: hidden;\n max-height: none;\n\n &, &.overflown {\n padding: 0 0.75rem;\n }\n }\n }\n\n .option-wrapper {\n position: relative;\n\n .form-control {\n padding-right: 3rem;\n }\n\n .option-remove-button {\n position: absolute;\n top: 0.3125rem;\n right: 0.3125rem;\n }\n }\n\n .quiz-mode {\n margin-top: 1.5rem;\n\n .options-header {\n margin-bottom: 0.5rem;\n }\n\n .note {\n margin-top: 0.5rem;\n }\n }\n\n .note {\n font-size: smaller;\n color: var(--color-text-secondary)\n }\n\n .error {\n font-size: smaller;\n color: var(--color-error);\n margin: -1rem 0 1rem .25rem;\n }\n\n .input-group:last-child {\n margin-bottom: 0.5rem;\n }\n}\n",".EmojiButton {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2.5rem;\n height: 2.5rem;\n margin: 0.125rem;\n border-radius: var(--border-radius-messages-small);\n cursor: pointer;\n font-size: 1.75rem;\n line-height: 2.5rem;\n background-color: transparent;\n transition: background-color .15s ease;\n\n .mac-os-fix & {\n line-height: inherit;\n }\n\n &.focus,\n &:hover {\n background-color: var(--color-background-selected);\n }\n\n & > img {\n width: 2rem;\n height: 2rem;\n }\n}\n",".EmojiPicker {\n height: 100%;\n\n &-main {\n height: calc(100% - 3rem);\n overflow-y: auto;\n padding: 0.5rem;\n\n @media (max-width: 600px) {\n padding: 0.5rem 0.25rem;\n }\n\n .symbol-set-container {\n display: flex;\n flex-wrap: wrap;\n }\n }\n\n &-header {\n height: 3rem;\n border-bottom: 1px solid var(--color-borders);\n display: flex;\n align-items: center;\n justify-content: space-around;\n box-shadow: 0 0 2px var(--color-default-shadow);\n\n @media (max-width: 600px) {\n overflow-x: auto;\n overflow-y: hidden;\n display: block;\n white-space: nowrap;\n padding: 0.4375rem 0;\n\n scrollbar-width: none;\n scrollbar-color: rgba(0, 0, 0, 0);\n\n &::-webkit-scrollbar {\n height: 0;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0);\n }\n\n .symbol-set-button {\n display: inline-flex;\n vertical-align: middle;\n }\n\n // Spacer to counter last button margin not being accounted in scroll width\n &::after {\n content: \"\";\n display: block;\n flex-shrink: 0;\n width: 0.1px;\n height: 1rem;\n }\n }\n }\n}\n",".StickerPicker {\n height: 100%;\n\n &-main {\n position: relative;\n height: calc(100% - 3rem);\n overflow-y: auto;\n padding: 0.5rem;\n\n @media (max-width: 600px) {\n padding: 0.5rem 0.25rem;\n }\n }\n\n &-header {\n height: 3rem;\n border-bottom: 1px solid var(--color-borders);\n padding: 0.125rem 0;\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n box-shadow: 0 0 2px var(--color-default-shadow);\n\n scrollbar-width: none;\n scrollbar-color: rgba(0, 0, 0, 0);\n\n &::-webkit-scrollbar {\n height: 0;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0);\n }\n\n // Spacer to counter last button margin not being accounted in scroll width\n &::after {\n content: \"\";\n display: block;\n flex-shrink: 0;\n width: 0.1px;\n height: 1rem;\n }\n\n\n .sticker-set-button {\n display: inline-flex;\n vertical-align: middle;\n\n &.StickerButton {\n background-size: 2rem;\n\n img, .AnimatedSticker {\n top: 0.375rem;\n left: 0.375rem;\n width: 2rem;\n height: 2rem;\n }\n }\n\n .sticker-set-cover {\n width: 2rem;\n height: 2rem;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n\n img, .AnimatedSticker {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n }\n }\n }\n }\n\n .symbol-set-container {\n width: 25rem;\n line-height: 0;\n\n @media (max-width: 600px) {\n width: 100%;\n }\n }\n\n .sticker-set-button {\n width: 2.75rem !important;\n height: 2.75rem;\n margin: 0 0.25rem;\n border-radius: var(--border-radius-messages-small);\n }\n}\n",".GifButton {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 6.25rem;\n background-color: transparent;\n cursor: pointer;\n overflow: hidden;\n position: relative;\n\n &:last-child {\n margin-bottom: 1rem;\n }\n\n &.vertical {\n grid-column-end: span 1;\n }\n\n &.horizontal {\n grid-column-end: span 2;\n }\n\n .thumbnail {\n width: 100%;\n height: 100%;\n background-size: cover !important;\n background: transparent no-repeat center;\n }\n\n .preview, video {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n .Spinner {\n position: absolute;\n pointer-events: none;\n }\n}\n",".GifPicker {\n display: grid;\n grid-template-columns: repeat(6, 1fr);\n grid-auto-rows: 6.25rem;\n grid-gap: 0.25rem;\n grid-auto-flow: dense;\n height: 100%;\n overflow-y: auto;\n padding: 0.25rem;\n\n .Loading, .picker-disabled {\n grid-column: 1 / -1;\n height: var(--menu-height);\n }\n}\n","@import '../../../styles/mixins';\n\n.SymbolMenu {\n &.mobile-menu {\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n background: var(--color-background);\n transform: translate3d(0, calc(var(--symbol-menu-height) + var(--symbol-menu-footer-height)), 0);\n z-index: 1;\n\n transition: transform var(--layer-transition);\n\n &.open {\n transform: translate3d(0, 0, 0);\n\n body.is-media-viewer-open & {\n transform: translate3d(0, calc(var(--symbol-menu-height) + var(--symbol-menu-footer-height)), 0);\n }\n }\n\n body.animation-level-0 & {\n transition: none;\n }\n\n &:not(.middle-column-open) {\n transform: translate3d(100vw, 0, 0) !important;\n }\n }\n\n &-main {\n width: var(--symbol-menu-width);\n height: var(--symbol-menu-height);\n max-height: calc(100vh - var(--symbol-menu-footer-height));\n }\n\n &-footer {\n height: var(--symbol-menu-footer-height);\n border-top: 1px solid var(--color-borders);\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 0 2px var(--color-default-shadow);\n position: relative;\n\n .Button {\n flex-shrink: 0;\n width: 2.125rem !important;\n height: 2.125rem;\n margin: 0 .25rem;\n padding: 0;\n\n &.activated {\n pointer-events: none;\n }\n\n &.symbol-tab-button {\n margin: 0 0.75rem;\n }\n\n &.symbol-search-button {\n position: absolute;\n left: 0.25rem;\n }\n\n &.symbol-delete-button {\n position: absolute;\n right: 0.25rem;\n }\n }\n }\n\n .Transition.slide {\n height: 100%;\n\n .Loading {\n height: var(--symbol-menu-height);\n }\n }\n\n .is-pointer-env & {\n > .backdrop {\n position: absolute;\n top: -1rem;\n left: 0;\n right: auto;\n width: 3.5rem;\n height: 4.5rem;\n }\n }\n\n .Button.bot-commands ~ & {\n .is-pointer-env & > .backdrop {\n left: 3rem;\n width: 3.25rem;\n }\n }\n\n .bubble {\n padding: 0;\n width: var(--symbol-menu-width);\n overflow: hidden;\n }\n\n .picker-disabled {\n height: var(--symbol-menu-height);\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color-text-secondary);\n }\n\n .symbol-close-button {\n display: none;\n position: absolute;\n right: .25rem;\n top: .25rem;\n }\n\n @media (orientation: landscape) {\n .symbol-close-button {\n display: block;\n }\n }\n}\n\n.symbol-set {\n margin-bottom: 1rem;\n\n &-name {\n font-size: 1rem;\n line-height: 1.6875rem;\n font-weight: 500;\n margin: 0;\n padding-left: 0.5rem;\n color: rgba(var(--color-text-secondary-rgb), 0.75);\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-align: initial;\n unicode-bidi: plaintext;\n }\n\n &-container {\n text-align: initial;\n }\n\n &-button {\n flex-shrink: 0;\n width: 2.125rem !important;\n height: 2.125rem;\n margin: 0 0.25rem;\n padding: 0;\n }\n\n @include while-transition() {\n overflow: hidden;\n }\n\n .symbol-set-container {\n &:not(.shown) {\n display: block;\n }\n\n &.closing {\n transition: none;\n }\n }\n}\n",".AttachMenu {\n position: relative;\n\n .is-pointer-env & {\n > .backdrop {\n position: absolute;\n top: -1rem;\n left: auto;\n right: 0;\n width: 3.5rem;\n }\n }\n\n\n .media-disabled > button {\n white-space: normal;\n }\n}\n",".BotCommand {\n margin: 0 !important;\n\n .ListItem-button {\n border-radius: 0;\n }\n\n .multiline-item {\n padding: 0 1rem;\n\n .subtitle {\n padding-top: .25rem;\n line-height: 1.3125;\n }\n }\n\n &.with-avatar {\n .multiline-item {\n padding: 0;\n display: flex;\n }\n\n .content-inner {\n flex: 1;\n }\n }\n}\n",".BotCommandTooltip {\n width: calc(100% - 4rem);\n max-width: 26rem;\n flex-direction: column;\n\n z-index: -1;\n\n @media (max-width: 600px) {\n width: calc(100% - 3rem);\n }\n}\n",".BotCommandMenu {\n .menu-container {\n width: calc(100% - 4rem);\n max-width: 20rem;\n max-height: 40vh;\n overflow: auto;\n flex-direction: column;\n\n @media (max-width: 600px) {\n width: calc(100% - 3rem);\n }\n }\n\n .is-pointer-env & {\n > .backdrop {\n position: absolute;\n top: -1rem;\n left: 0;\n right: auto;\n width: 3.5rem;\n height: 4.5rem;\n }\n }\n}\n",".StickerTooltip {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr));\n grid-auto-rows: auto;\n place-items: center;\n\n &.hidden {\n display: none;\n }\n}\n",".CustomSendMenu {\n position: relative;\n bottom: 3.5rem;\n\n .is-pointer-env & {\n > .backdrop {\n position: absolute;\n top: -1rem;\n left: auto;\n right: 0;\n width: 3.5rem;\n }\n }\n\n\n .media-disabled > button {\n white-space: normal;\n }\n\n .bubble {\n width: 16rem;\n }\n}\n",".EmojiTooltip {\n display: flex;\n padding-left: .25rem;\n\n overflow-x: auto;\n @supports (overflow-x: overlay) {\n overflow-x: overlay;\n }\n overflow-y: hidden;\n\n .EmojiButton {\n flex: 0 0 2.5rem\n }\n}\n",".BaseResult {\n &.chat-item-clickable > .ListItem-button {\n padding-left: 1.25rem !important;\n padding-right: 1.25rem !important;\n\n .title {\n display: block;\n text-overflow: ellipsis;\n }\n }\n\n .thumb {\n background-color: var(--color-background-secondary);\n flex: 0 0 3rem;\n width: 3rem;\n height: 3rem;\n line-height: 3rem;\n border-radius: var(--border-radius-default-tiny);\n display: inline-flex;\n align-content: center;\n justify-content: center;\n margin-inline-end: .5rem;\n overflow: hidden;\n font-size: 1.5rem;\n\n img:not(.emoji) {\n width: 100%;\n object-fit: cover;\n }\n\n img.emoji {\n width: 1.5rem;\n height: 1.5rem;\n margin: .75rem 0 0;\n }\n }\n\n .content-inner {\n min-width: 0;\n }\n\n .title {\n font-weight: 500;\n text-align: left;\n unicode-bidi: plaintext;\n }\n\n .description {\n white-space: normal;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n text-align: left;\n unicode-bidi: plaintext;\n }\n &[dir=rtl] .title,\n &[dir=rtl] .description {\n text-align: right;\n }\n}\n",".MediaResult {\n height: 0;\n padding-bottom: 100%;\n overflow: hidden;\n position: relative;\n cursor: pointer;\n\n img {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n}\n",".InlineBotTooltip {\n .switch-pm .title {\n margin: 0 auto;\n font-weight: 500;\n }\n\n --border-radius-default: 0;\n\n &.gallery {\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n grid-gap: 1px;\n padding: 0;\n\n @media (max-width: 600px) {\n grid-template-columns: repeat(3, 1fr);\n }\n\n .switch-pm {\n grid-column: 1 / -1;\n .ListItem-button {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n }\n }\n\n .GifButton {\n grid-column-end: initial;\n }\n\n .StickerButton {\n width: initial;\n height: 0;\n margin: 0;\n padding-bottom: 100%;\n border-radius: 0;\n\n .AnimatedSticker, img, canvas {\n position: absolute;\n top: 0;\n left: 0;\n width: 100% !important;\n height: 100% !important;\n\n @media (min-width: 600px) {\n top: .25rem;\n left: .25rem;\n width: calc(100% - .5rem) !important;\n height: calc(100% - .5rem) !important;\n }\n }\n }\n }\n}\n",".RightSearch {\n height: 100%;\n padding: 0 0.5rem;\n overflow-y: auto;\n\n .helper-text {\n padding: 1rem;\n margin-bottom: 0.125rem;\n font-weight: 500;\n color: var(--color-text-secondary);\n unicode-bidi: plaintext;\n text-align: initial;\n }\n}\n",".StickerSearch {\n height: 100%;\n padding: 0 0.5rem;\n overflow-y: auto;\n\n .helper-text {\n padding: 1rem;\n margin-bottom: 0.125rem;\n font-weight: 500;\n color: var(--color-text-secondary);\n }\n\n .sticker-set {\n margin-bottom: 1rem;\n\n &-header {\n display: flex;\n justify-content: space-between;\n padding: 0.5rem;\n\n .title-wrapper {\n overflow: hidden;\n }\n\n .title {\n font-size: 1rem;\n line-height: 1.6875rem;\n margin: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n\n .count {\n color: var(--color-text-secondary);\n margin: 0;\n }\n\n .Button {\n flex-shrink: 0;\n margin-left: 1rem;\n\n &.is-added {\n background: var(--color-chat-hover);\n color: var(--color-text-secondary);\n\n &:hover, &:active {\n background: var(--color-item-active) !important;\n }\n }\n }\n }\n\n &-main {\n display: flex;\n flex-wrap: nowrap;\n overflow: hidden;\n }\n\n &[dir=rtl] {\n .title-wrapper {\n text-align: right;\n }\n\n .Button {\n margin-left: 0;\n margin-right: 1rem;\n }\n }\n }\n\n .StickerButton {\n margin: 0.125rem;\n }\n}\n",".GifSearch {\n height: 100%;\n padding: 0.25rem;\n\n .gif-container {\n height: 100%;\n overflow: auto;\n\n &.grid {\n display: grid;\n grid-template-columns: repeat(6, 1fr);\n grid-auto-rows: 6.25rem;\n grid-gap: 0.25rem;\n grid-auto-flow: dense;\n }\n }\n\n .helper-text {\n color: var(--color-text-meta);\n margin-top: 2rem;\n text-align: center;\n }\n}\n",".PollAnswerResults {\n border-bottom: 1px solid var(--color-borders);\n padding: 0 .5rem .625rem;\n display: flex;\n flex-direction: column-reverse;\n\n .answer-head {\n display: flex;\n align-items: center;\n font-size: .9375rem;\n line-height: 1.3125rem;\n font-weight: 500;\n color: var(--color-text-secondary);\n padding: 1rem .75rem .5rem 1rem;\n position: sticky;\n top: 0;\n background: var(--color-background);\n\n @media (max-width: 600px) {\n padding: .5rem .25rem .5rem .5rem;\n }\n }\n\n .answer-percent {\n margin-left: auto;\n\n &[dir=auto] {\n margin-left: 0;\n margin-right: auto;\n }\n }\n\n .poll-voters {\n padding: 0 .75rem;\n position: relative;\n min-height: 3rem;\n\n @media (max-width: 600px) {\n padding: 0 .25rem;\n }\n\n .Spinner {\n --spinner-size: 1.25rem;\n }\n }\n\n .chat-item-clickable {\n .ChatInfo .Avatar.size-tiny {\n margin-right: 1.75rem;\n }\n\n &[dir=rtl] {\n .ChatInfo .Avatar.size-tiny {\n margin-left: 1.75rem;\n margin-right: 0;\n }\n }\n }\n\n .ShowMoreButton {\n margin: .25rem 0 0 -0.5rem;\n width: calc(100% + 1rem);\n\n &[dir=rtl] {\n .icon-down {\n margin-left: 2rem;\n margin-right: 0;\n }\n }\n }\n\n .icon-down {\n vertical-align: middle;\n margin-right: 2rem;\n font-size: 1.5rem;\n }\n}\n",".PollResults {\n height: 100%;\n position: relative;\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n\n > .Loading {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n background: rgba(white, 0.75);\n }\n\n .poll-question {\n padding: .75rem 1.5rem;\n flex-shrink: 0;\n font-size: 1.25rem;\n\n @media (max-width: 600px) {\n padding: 0 1rem;\n }\n }\n\n .poll-results-list {\n border-top: 1px solid var(--color-borders);\n flex-grow: 1;\n overflow: auto;\n }\n}\n",".Management {\n position: relative;\n height: 100%;\n\n & > .custom-scroll {\n height: 100%;\n overflow-y: scroll;\n overflow-x: hidden;\n }\n\n .section {\n padding: 1rem 1.5rem;\n border-top: 1px solid var(--color-borders);\n\n &.wide {\n padding: 1.5rem;\n }\n\n &:first-of-type {\n border-top: none;\n padding-top: 1rem;\n }\n\n &.no-border {\n border-top: none;\n }\n\n > .ChatInfo {\n margin: 0 0 2rem !important;\n\n .title h3 {\n margin-bottom: 0;\n }\n }\n\n .section-icon {\n width: 8.75rem;\n height: 8.75rem;\n margin: 0 auto 2rem;\n position: relative;\n\n .AnimatedSticker {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n\n &.hidden {\n display: none\n }\n }\n }\n\n .ListItem {\n margin: 0 -.75rem;\n\n &:last-child {\n margin-bottom: 0;\n }\n\n .multiline-item .subtitle {\n line-height: 1.25rem;\n }\n\n &:not(.picker-list-item) .Checkbox {\n margin-top: 2rem;\n margin-bottom: 2rem;\n }\n\n &.narrow {\n .Checkbox {\n margin-top: 1rem;\n margin-bottom: 1rem;\n }\n }\n\n &.exceptions-member {\n .ChatInfo .status {\n white-space: pre-wrap;\n }\n }\n }\n\n .section-heading {\n font-weight: 500;\n font-size: .9375rem;\n color: var(--color-text-secondary);\n\n &[dir=auto] {\n text-align: initial;\n }\n }\n\n .section-help {\n color: var(--color-text-secondary);\n line-height: 1.375rem;\n\n &[dir=auto] {\n text-align: initial;\n }\n }\n\n .section-info {\n color: var(--color-text-secondary);\n font-size: .875rem;\n }\n\n &[dir=rtl] {\n text-align: right;\n }\n }\n\n textarea.form-control {\n height: auto;\n }\n\n .group-link {\n color: var(--color-text);\n }\n\n .radio-group {\n margin-top: 2rem;\n\n .Radio {\n padding-left: 3.5rem;\n margin-bottom: 2rem;\n\n &:last-child {\n margin-bottom: .625rem;\n }\n }\n\n .Radio-main {\n &::before {\n left: 0.125rem;\n top: .25rem;\n transform: none;\n }\n\n &::after {\n left: 0.4375rem;\n top: .5625rem;\n transform: none;\n }\n }\n }\n}\n\n.ManageGroupMembers {\n padding: 0.5rem 1rem;\n}\n",".ShippingInfo {\n padding: 0.5rem 1rem;\n\n h5 {\n font-size: 0.9rem;\n color: var(--color-text-secondary);\n margin: 1rem 0 1.1rem;\n }\n}",".Shipping {\n padding: 0.5rem 1rem;\n\n form {\n p {\n color: var(--color-text-secondary);\n font-weight: 500;\n margin: .5rem 0 2rem;\n }\n\n .Radio {\n margin-bottom: 2rem;\n }\n }\n}",".Checkout {\n padding: 0.5rem 0;\n\n .description {\n display: flex;\n flex-direction: row;\n margin: 0 1rem;\n\n img {\n height: 6rem;\n margin: .5rem;\n }\n\n .text {\n h5 {\n margin-top: .5rem;\n font-size: 1.125rem;\n }\n\n p {\n font-size: 0.8rem;\n line-height: 1rem;\n color: var(--color-text-secondary);\n }\n }\n }\n\n .price-info {\n margin: 1rem;\n\n .price-info-item {\n margin: 1rem .5rem;\n display: flex;\n flex-direction: row;\n align-content: space-between;\n color: var(--color-text-secondary);\n font-weight: 500;\n \n &-main{\n color: var(--color-text);\n }\n \n .title {\n display: flex;\n flex: 1 auto;\n }\n }\n }\n\n .invoice-info {\n border-top: 1px var(--color-borders) solid;\n padding: 1rem;\n\n .checkout-info-item {\n display: flex;\n padding: .75rem .5rem 1rem;\n text-align: left;\n\n i {\n font-size: 1.5rem;\n color: var(--color-text-secondary);\n margin-right: 2rem;\n width: 1.5rem;\n }\n\n i.stripe-provider {\n background: url('../../assets/stripe-logo.png') no-repeat center;\n background-size: 2rem;\n border-radius: 1rem;\n height: 1.5rem;\n }\n\n .info {\n .title {\n font-size: 1rem;\n line-height: 1.4375rem;\n margin-bottom: 0;\n font-weight: 400;\n word-break: break-word;\n color: var(--color-text);\n text-transform: capitalize;\n }\n\n .data {\n margin-bottom: 0;\n font-size: 0.875rem;\n color: var(--color-text-secondary);\n }\n }\n }\n }\n \n}",".CardInput {\n position: relative;\n\n .input-group.has-left-addon .form-control{\n padding-left: 4rem;\n }\n\n .left-addon {\n position: absolute;\n top: .8rem;\n left: 1rem;\n z-index: 8;\n\n img {\n max-width: 2rem;\n }\n }\n}\n",".PaymentInfo {\n padding: 0.5rem 1rem;\n\n h5 {\n font-size: 0.9rem;\n color: var(--color-text-secondary);\n margin: 1rem 0 1.1rem;\n }\n\n .inline-inputs {\n display: flex;\n justify-content: space-between;\n\n .input-group {\n flex: 1 10rem;\n max-width: 45%;\n display: flex;\n }\n }\n}\n",".PaymentModal {\n .modal-backdrop {\n pointer-events: none;\n }\n\n .header {\n position: relative;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n width: 100%;\n padding: .25rem 1rem;\n display: flex;\n align-items: center;\n flex-direction: row;\n background: var(--color-background);\n border-bottom: 1px var(--color-borders) solid;\n\n h3 {\n margin-bottom: 0;\n margin-left: 1.5rem;\n unicode-bidi: plaintext;\n text-align: initial;\n }\n }\n\n .Transition {\n height: 25rem;\n }\n\n .empty-content {\n height: 25rem;\n max-height: 90%;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .receipt-content {\n height: 25rem;\n overflow-y: auto;\n }\n\n .content {\n overflow: auto;\n width: 100%;\n height: 100%;\n position: relative;\n }\n\n .footer {\n position: relative;\n border-bottom-left-radius: 10px;\n border-bottom-right-radius: 10px;\n width: 100%;\n padding: .75rem 1rem;\n background: var(--color-background);\n border-top: 1px var(--color-borders) solid;\n\n button {\n text-transform: none;\n font-weight: 500;\n }\n }\n\n .modal-dialog {\n width: 25rem;\n }\n\n .modal-content {\n padding:0;\n overflow: hidden;\n }\n}\n\n@media screen\n and (max-device-width: 640px)\n and (max-height: 640px)\n and (orientation: landscape) {\n .PaymentModal {\n .modal-dialog {\n max-height: 100%;\n }\n\n .Transition {\n height: 10rem;\n }\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"860.71a26210d53a0e37c47e.css","mappings":"AAAA,YACE,aACA,qBACA,WACA,eAEA,WACA,wBAEA,kBACE,UAGF,oBACE,uBAEA,yBAHF,oBAII,cAIJ,kBACE,aACA,sBACA,uBACA,eAGF,mBACE,oBACA,gBACA,gBACA,gBACA,uBAGF,kBACE,oBACA,kBACA,wB;ACvCJ,oBACE,aACA,yBACA,4BAEA,4BACE,2BAIJ,2BACE,kBAEA,4CACE,kBACA,MACA,O;AChBJ,mBACE,kBACA,SACA,eACA,WACA,wBAEA,uCACE,aAGF,0BAXF,mBAYI,mBAGF,yBAfF,mBAgBI,sBACA,mEAEA,gCACE,UACA,oBAEA,wDACE,UACA,oBAKN,gDACE,kBACA,0CACA,YACA,eACA,WACA,wBAEA,sDACE,UAGF,yBAZF,gDAaI,WAIJ,6BACE,UAGF,+BACE,gBACA,cACA,gBACA,kBACA,2BACA,mBACA,uBACA,mBAEA,0BAVF,+BAWI,oBAGF,sCACE,eACA,gBACA,oBAIA,iDACE,WACA,kBACA,cACA,eACA,aACA,gBACA,2BACA,2CACA,uBAEA,yBAXF,iDAYI,aACA,iBAMR,qBACE,yBAEA,sDAEE,+B;AChGN,qBACE,aACA,mBACA,kBACA,OACA,SACA,WACA,oBACA,kBACA,mEAEA,yCACE,aAGF,yBAfF,qBAgBI,eACA,6BACA,gBACA,+BAIA,8CACE,gBACA,UACA,eACA,iBAGF,wCACE,iBAGF,qDACE,iBAIJ,6BACE,cACA,UACA,cACA,eACA,yBALF,6BAMI,gBAIJ,6BACE,mBAGF,kCACE,cACA,mBAGF,iCACE,iBACA,yBAFF,iCAGI,kBAEF,mCACE,oBACA,yBAFF,mCAGI,kBAKN,yBACE,8CACE,kBAIJ,uCACE,kBACA,SACA,2BACA,mBACA,gBACA,uBAEA,yBARF,uCASI,gBACA,UACA,eACA,iBACA,kBACA,mDACE,eAKN,sCACE,kBACA,UACA,WACA,MACA,YAGA,4CACE,kBACA,QACA,cACA,eACA,WACA,2BACA,uCACA,2CAGF,wIAGE,kBACA,MACA,OACA,YACA,2CAGF,+CACE,sCAGF,6CACE,gCAEA,oDACE,WACA,kBACA,aACA,cACA,kBACA,sCACA,QACA,QACA,oCAIJ,4CACE,WACA,UACA,SACA,UACA,eACA,gBAEA,kEACE,iB;AC3JR,aACE,kBACA,oBACA,sBACA,gBAEA,iCACE,kBACA,MACA,QACA,SACA,OACA,qCACE,sBACA,uBAEF,uCACE,2BAIJ,yBArBF,aAuBI,WAGF,yBA1BF,aA2BI,kBAGF,0BA9BF,aA+BI,sBACS,yBACP,iBAIJ,mBACE,cACA,iCACA,YACA,mBACA,aACA,WACA,YACA,6BACA,wBAEA,0BAXF,mBAYI,gCAEO,+BACP,+BACA,0BAFO,+BAGL,gCAKN,0BACE,kBACA,SACA,QACA,gCACA,cACA,eACA,2CACA,uDACE,uCAGF,qCACE,kBACA,kBACA,aAIJ,gCACE,kBACA,MACA,OACA,WACA,YACA,aACA,mBACA,uBAEA,2CACE,2BACA,WACA,iBACA,kBACA,cACA,aACA,UACA,kBACA,qBACA,qBAGF,iDACE,e;ACtGN,cACE,kBACA,eACA,SACA,0BACA,2CACA,WACA,gBACA,gBACA,qCACA,+BACA,oBAEA,mBACE,8BACA,mBAGF,+CAEE,kBACA,aACA,aACA,cACA,WAEA,mDACE,iBAIJ,wBACE,WAGF,uBACE,YAGF,wBACE,kBACA,aACA,cACA,aACA,YAEA,8BACE,kBACA,QACA,cACA,eACA,WACA,2BACA,sCACA,2CAGF,6DAEE,kBACA,MACA,OACA,YACA,2CAGF,+BACE,gBACA,uBAEA,sCACE,WACA,kBACA,aACA,cACA,kBACA,oCACA,QACA,QACA,oCAIJ,8BACE,WACA,YACA,cACA,UACA,SACA,UACA,eACA,gBAEA,oDACE,iB;AC9FR,4BAEE,kBACA,WACA,YAGF,aACE,YACA,0CAGF,eACE,iCAEA,iCACE,gBAGF,uBACE,eACA,MACA,O;ACtBJ,aACE,eACA,MACA,OACA,YACA,YACA,0BACA,WACA,8BACA,gBAEA,aACA,2BACA,+BACA,kBACA,eACA,sBACA,mBAGA,yBACE,yBACA,mBAIA,sIACE,aAIJ,oCACE,mCAKA,sEACE,oBACA,gBAKF,gCACE,aAGF,uCACE,UAGF,0CACE,eACA,MACA,OACA,YACA,aACA,UACA,UAIJ,gCACE,aACA,mBACA,kBACA,kBACA,mCACA,YAEA,4CACE,WACA,YAGF,yBAbF,gCAcI,gBAEA,oDACE,qBAKN,mDAEE,oBAGF,+DAEE,kBACA,oBACA,kBACA,WACA,YACA,aACA,mBACA,gBAGF,mCACE,kBACA,UACA,kBACA,YACA,oBACA,uBACA,mBAEA,8CACE,eACA,yBAFF,8CAGI,iBAGF,0BANF,8CAOI,gBAGF,kDACE,+BACA,0BAFF,kDAGI,gCAKN,8CACE,kBAEA,kDACE,kBACA,QACA,SACA,gCAIJ,uCACE,gBACA,iCACA,mBACA,yBAGF,oDACE,gBACA,YAGF,4CACE,YAIJ,yBACE,eACA,SACA,WACA,SACA,YACA,UACA,SACA,wCACA,iCACA,wBACA,UACA,wBACA,aACA,eACA,UAEA,yBAjBF,yBAkBI,YAGF,sEACE,UAGF,8BACE,OACA,yDACA,6CAEA,uCACE,UACA,QACA,qBAIJ,8BACE,QACA,yDACA,0DAEA,uCACE,OACA,WACA,qBAIJ,gCACE,qBACA,aACA,YACA,6BAEA,yBANF,gCAOI,UACA,gCACA,oBAEA,wDACE,UACA,oBAOV,OACE,kBACA,8BACA,8BACA,gBACA,gBACA,+CAEA,uBACE,4CAGF,cACE,kBAGF,mBACE,iFAGF,wBAEE,WACA,YACA,iBACA,yBACA,+C;AC5PJ,eACE,8BAEA,6BACE,WACA,gBAEA,yBAJF,6BAKI,YAIJ,6BACE,aACA,mBACA,qBAEA,qCACE,mBAGF,0CACE,SAGF,2CACE,YACA,2BAEA,eACA,cACA,kBACA,oBACA,uBAIJ,8BACE,UACA,gBACA,aACA,sBAEA,2CACE,YACA,kBACA,gBACA,oBAIJ,2BACE,YACA,SACA,kBACA,aACA,mBACA,uBACA,kCAKE,yBADF,yEAEI,SAEA,0FACE,iB;ACnEV,SACE,eACA,MACA,OACA,YACA,aACA,uB;ACLA,6BACE,mBACA,4CACE,0BAIJ,2BACE,aACA,mBACA,uBACA,qBAEA,yCACE,eACA,kBAEA,qDACE,kBAEF,oDACE,iBAKN,uBACE,aACA,yBACA,sBAEA,+BACE,oBAEA,uCACE,iBAKN,+BACE,aACA,mBAEA,kCACE,OACA,qBACA,kBAEA,yBALF,kCAMI,oBAGF,0CACE,2BAIJ,8CACE,WACA,oBAIJ,2BACE,kBACA,mBACA,wBACA,gBACA,uBAEA,yBAPF,2BAQI,uBAGF,mCACE,gBACA,YAGF,qCACE,eAEA,2CACE,wDAGF,8CACE,sCACA,WAIJ,oCACE,YACA,oBAGF,mCACE,WACA,cACA,iBAGF,gCACE,kBACA,MACA,OACA,WACA,YACA,aACA,mBACA,uBACA,kBAIJ,iCACE,aACA,mBACA,uBACA,iBACA,4BAGF,8BACE,aACA,qCACA,W;ACjIJ,sBACE,kBACA,aACA,WACA,YACA,WACA,WACA,uBACA,SAqBA,UAnBA,mDACE,qBACA,sBAGF,mCACE,WAGF,yBAnBF,sBAoBI,UACA,WACA,eAEA,mCACE,cAMJ,4BACE,oBACA,+EAGF,kDACE,kCAGF,kHAEE,SAGF,6CACE,2BAGF,kCACE,UACA,oBAEA,+CACE,iDAGF,4EACE,2FAGF,kFACE,kEAIJ,8BACE,WACA,gBACA,WACA,UACA,WAGF,4BACE,WACA,gBACA,aACA,mBACA,eAEA,mCACA,4CACA,iDACA,gBAEA,yBAZF,4BAaI,UACA,gBAGF,oCACE,WACA,YAEA,yBAJF,oCAKI,eACA,iBAKN,4BACE,iBACA,mBACA,gBACA,uBACA,YAEA,yBAPF,4BAQI,oBAIJ,8BACE,iBACA,aAEA,wCACE,iBACA,kBAEA,0CACE,eAGF,mDACE,a;AC9HN,yBACE,gBAGF,mCACE,mBAGF,2BACE,YACA,eACA,gBACA,kBACA,mBAEA,qBACA,8BAEA,8CACE,SAGF,oDACE,+BAIJ,+BACE,qBACA,aACA,YACA,uBACA,kBACA,2CACA,eACA,kBACA,gBAEA,2CACE,oBAGF,0CACE,qBAGF,uCACE,sBAGF,qCACE,mCAGF,8CACE,kBACA,mBACA,iBACA,gBACA,uBAEA,2DACE,WACA,YACA,qBACA,sBACA,oBAKN,qCACE,aACA,mBAEA,6CACE,iBAIA,sDACE,cACA,kB;AClFN,yBACE,iBAGA,qFACE,qCAIJ,8BACE,qBAIA,0BACE,YAGF,sBACE,eACA,WAGF,6BACE,kCAEA,sDACE,wBACA,mBACA,qBACA,kBAIJ,4BACE,YACA,kCACA,gBACA,uBAEA,yCACE,wBAGA,gDACE,aAIJ,gCACE,cACA,eACA,iBACA,sBACA,wBACA,oBAGF,uCACE,kBACA,qBACA,iBACA,WACA,6BACA,wBACA,gBAKN,uBACE,aACA,8BAIA,gCACE,iB;AC9EN,aACE,aACA,YACA,mBACA,8BACA,kBACA,oBAEA,wBACE,aACA,cACA,eACA,mBACA,eACA,kBACA,gBACA,kCAEA,uCACE,kBACA,oB;ACpBN,wBACE,sBACA,YACA,gBACA,yBAEA,MACE,gBACA,sBAGF,kBACE,UACA,6BAGF,yBACE,uCAEA,iBACE,8BAIJ,iBACE,oBACA,qBACA,oCACA,gBAEA,mBACA,kCACA,sCAEA,UACE,kBACA,WACA,WACA,gCACA,aACA,SACA,8EAGF,cAEE,sBACA,oCACA,mBACA,8FAEA,SACE,cACA,uHAKN,4BAEE,wBACA,2CACA,uIAEA,YACE,sBAIJ,YACE,0CAGF,iBACE,YACA,YACA,gBACA,uBACA,sBACA,2BAGF,gBACE,kCACA,kBACA,mBACA,yBAGF,YACE,cACA,qCACA,mBACA,gBACA,mCAIA,gBACE,qCAGF,gCACE,uDAMA,sBACE,2BACA,uBACA,+DAEA,WACE,6EACA,aACE,yBACA,8DAIJ,YACE,kCACA,4EAEA,UACE,gEAMJ,gBACE,wEAEA,WACE,0DAQR,uBACE,iEAEA,YACE,gBACA,0BAKN,sBACE,kBACE,8BAIJ,oBACE,8CAEA,iCACE,mBACA,gBACA,2BACA,oBACA,oDAEA,WACE,yBACA,gBACA,kBACA,mHAEA,8BAEE,0HAMF,UACE,iBACA,eACA,sCAKN,aACE,oBACA,6BAIJ,iBACE,aACA,cACA,iBACA,8BACA,qBACA,iDACA,yCACA,iCACA,gBACA,kBACA,8BAEA,iDAEA,aACE,4DAEA,iBACE,qEAKF,gBACE,eACA,2BAKN,WACE,qCAIA,cACE,mBACA,C;ACjOJ,yBACE,wBACA,gBACA,yBACA,iBACA,kBAGF,kDACE,gBAGF,2BACE,kBACA,YACA,WACA,iDAGF,wBACE,gBACA,cACA,kBAEA,gCACE,WACA,cACA,iBAGF,qCACE,kBACA,MACA,OACA,kDAGF,qCACE,YACA,kDAOA,kEACE,gCAGF,qDACE,gCAGF,8CACE,gCAGF,yDArEJ,gCACA,eACA,mBACA,oFAEA,+DACE,qBAmEE,qDAzEJ,gCACA,eACA,mBACA,iFAEA,2DACE,qBAuEE,8CA7EJ,gCACA,eACA,mBACA,gFAEA,oDACE,qB;ACJF,sBACE,iBACA,kBACA,aACA,cACA,mBACA,wBACA,mBACA,uBACA,sCACA,kBACA,WACA,eACA,eACA,kBACA,gBACA,wBAEA,4BACE,aAGF,0BACE,kBACA,MACA,OACA,WACA,YAGF,wBACE,mBACA,iCACA,qCAKA,6UACE,wBAGF,6GACE,2BAKF,8BACE,qBAIJ,6BACE,yCAEA,oCACE,WACA,cACA,kBACA,OACA,MACA,WACA,YACA,gCAIJ,+BACE,oBAEA,iCACE,aAGF,sCACE,a;AC/ER,gBACE,mCACA,aACA,mBACA,gBACA,oBACA,+BACA,qBAEA,kBACE,iBACA,kBACA,kCAGF,yBACE,a;AChBJ,4BACE,yCAEA,2CACE,+CAEA,8DACE,oBACA,kBACA,YAGF,8DACE,kCAIJ,yCACE,sBAEA,qDACE,aAKF,uFACE,uBAGF,kFACE,qBAGF,iEACE,iBACA,qBAGF,kEACE,eACA,gBACA,SAIA,0EACE,cACA,kBACA,eACA,sBAKN,kDACE,mBACA,gBACA,oBAGF,iDACE,uBACA,6C;AC/DJ,mCACE,WACA,aACA,mBACA,8BAIA,sCACE,aACA,mBAEA,8CACE,qBACA,oBAGF,6CACE,aACA,2BACA,mBAEA,gDACE,eACA,gBACA,mBACA,SACA,gBACA,mBACA,uBACA,gBAIJ,8CACE,aAIA,yDACE,iBAMJ,+CACE,WAIJ,2DACE,2BAEA,6DACE,UACA,cAKF,6CACE,mBACA,sBAKN,+BACE,eACA,wBACA,6B;ACxDF,aACE,qCAEA,mBAEA,sBACE,oBACA,4CAGF,6BACE,aACA,8BACA,sBAEA,oCACE,cACA,iBACA,kCAIA,6CACE,cACA,kBAKN,0BACE,kBACA,UAEA,kCACE,WACA,kBACA,WACA,OACA,aACA,eACA,sCACA,sBACA,WACA,WAIJ,gCACE,kBACA,WACA,OACA,aACA,eACA,qCACA,sBACA,oBAIF,+BACE,wBACA,cACA,WACA,cACA,oBACA,uBAEA,qCACE,aAGF,0CACE,WACA,eAEA,uBACA,yBACA,kBAGF,qDACE,wBAQF,qDAvGF,+BACA,YACA,cACA,aACA,kBACA,eACA,mBACA,oFAEA,2DACE,qBAiGA,iDA3GF,+BACA,YACA,cACA,aACA,kBACA,eACA,mBACA,iFAEA,uDACE,qBAqGA,0CA/GF,+BACA,YACA,cACA,aACA,kBACA,eACA,mBACA,gFAEA,gDACE,qBA0GF,6BACE,aACA,wBACA,sBACA,sBAGF,4BACE,kBACA,kBACA,eACA,kCACA,0BAEA,qEACE,wBAGF,mCACE,gBAGF,wCACE,gBAGF,uCACE,iB;AC/IJ,4CACE,oBAGF,+DAEE,WACA,YACA,mBACA,UACA,cAGF,wBACE,eACA,gBAGF,yCACE,aACA,sBACA,uBAIA,iFAEE,mB;AC5BN,eACE,SACA,oBACA,eACA,kBAEA,kDAEE,kBACA,OACA,MACA,WACA,YAGF,4BACE,gBACA,mBACA,+BAEA,mEACE,kBACA,OACA,MACA,WACA,YACA,iBAIJ,sBACE,WACA,cACA,sCACA,UACA,6BAIA,+BACE,UAGF,qCACE,qBAIJ,kCACE,YACA,aACA,mBACA,uB;ACnDF,gDACE,aACA,cACA,qCACA,mBACA,gBAGF,oCACE,uBACA,gB;ACVF,0DACE,gCAGF,0FACE,kBAGF,8CACE,gBACA,aAGF,4CACE,cACA,aAGF,uCACE,cACA,WACA,YACA,2CACA,eAGF,wCACE,kBACA,aACA,cACA,aACA,cACA,wCACA,qBACA,YAGF,oDACE,YAGF,uCACE,sBACA,aAEA,oDACE,gBAGE,mEACE,mDAKN,gEACE,mBAGF,+DACE,kBAIJ,mDACE,aACA,cACA,qCACA,mBACA,gBAEA,uDACE,eACA,iDACA,iCAEA,8DACE,0CACA,wDAIF,8DACE,cACA,WACA,WACA,iBACA,oB;ACxFR,QACE,kBACA,cACA,iBACA,kBACA,aACA,cACA,sBAEA,gDATF,QAUI,YACA,aACA,sBAGF,YACE,YACA,aAGF,yBACE,kBACA,OACA,MACA,WACA,YAEA,gCACE,aAIJ,wBACE,WACA,YACA,qBACA,wD;AClCJ,UACE,YAEA,cACE,aACA,sBACA,gBAGF,uBACE,uBAIJ,sBACE,aACA,YACA,8BACA,mBAIA,4BACE,WAEA,6CACE,6BACA,8BAKN,kBACE,mCACA,yCAEA,gBC9BA,+BD0BF,kBCzBI,mBAGA,mBD6BF,kCACE,aACA,sBAEA,iDACE,cACA,YAIJ,0BACE,iBACA,mBAGF,iCACE,iBACA,qBAIJ,yBACE,aACA,sBACA,mBACA,sBACA,kBAEA,sCACE,WAIJ,uBACE,WACA,YACA,qBACA,kBAEA,wCACE,kBACA,OACA,MACA,WACA,YAEA,+CACE,aAKN,oBACE,uBAEA,+BACE,yBACA,yBACA,2EACA,8DAEA,gDACE,qBAKN,eACE,0CACA,2BAEA,yBACE,gBAGF,sBACE,eACA,kCACA,mBACA,kBAEA,+BACE,iBAIJ,sBACE,gBAGF,2BACE,kBACA,kCACA,mBACA,qBAEA,oDACE,eAGF,oCACE,iBACA,uBAIJ,kCACE,eACA,sBACA,kCACA,gBACA,qBAEA,2CACE,iBAIJ,yBACE,oBAEA,oCACE,gBAGF,8CACE,oBAEA,wDACE,WAGF,oDACE,YACA,iBACA,iBACA,kCAGF,6GACE,cACA,gBAGF,qDACE,oBAGF,wDACE,kBACA,mBACA,kCAEA,kEACE,oBAGF,8DACE,wBAGF,8DACE,sBACA,uBAMJ,sDACE,yBAEA,wDACE,cAKN,2CACE,oBAEA,4DACE,mBACA,gBACA,cAGF,mDACE,WACA,YACA,kBAGF,yDACE,eACA,iBACA,qBACA,gBAGF,0DACE,kBACA,iBACA,kCAMA,+HACE,iBAGF,6DACE,WACA,cACA,kBAMR,4BACE,wBAGF,qDACE,qBAIA,8CACE,gBAIJ,gEACE,gBAIJ,sBACE,yCACA,kBACA,gBAEA,wCACE,YAGF,4CACE,aAIJ,uBACE,iBAGF,eACE,yB;AE7SF,SACE,YACA,gBACA,kBAEA,eACE,yCACA,gBAEA,sBACE,kBACA,aACA,sBAEA,yDACE,kBACA,oBACA,qBAGF,6BACE,yBAGF,4BACE,sBACA,kCAGF,4CACE,kCACA,eACA,gBACA,mBAGF,yCACE,kBACA,oBAEA,kBACA,Y;ACzCR,eACE,YACA,gBAEA,0BACE,yC;ACLJ,oBACE,kBACA,eAEA,4BACE,qBACA,4GAGF,8BACE,kBACA,kB;ACVF,+BACE,eACA,eAGF,yBACE,+BACE,iBAIJ,+BACE,mBAGF,gCACE,kBACA,UAGF,2BACE,kBACA,WACA,aACA,gBACA,gBACA,iBACA,gBAGF,iCACE,gBACA,0CACA,+CAEA,wCACE,qBAIJ,0BACE,WACA,kBACA,kC;AC5CJ,qBACE,eACA,MACA,OACA,QACA,aACA,6BAEA,2BACE,kBACA,eAEA,qCACE,sCAGF,mCACE,6BACA,8B;AClBN,sBACE,kBACA,MACA,OACA,+BACA,WACA,cACA,mCACA,aACA,mBACA,yBAEA,mCACE,mBACA,OAIJ,sBACE,kBACA,SACA,OACA,+BACA,WACA,cACA,mCACA,aACA,mBACA,kBACA,oBAEA,+BACE,OACA,kCAKF,sEAEE,8B;ACxCJ,gBACE,wBACA,gBACA,sBAEA,WAEA,yBAPF,gBAQI,yBAGF,8CACE,SAEA,+DACE,gBAGF,oDACE,aAGF,qDACE,0BACA,cAGF,sDACE,eAIA,+DACE,WAMJ,oCACE,iBAGF,kCACE,kBAIA,0CACE,YAIJ,uCACE,wB;ACtDN,iBACE,kCAEA,+BACE,mBACA,yBAFF,+BAGI,gBACA,uBAIJ,gCACE,+BACA,iCACA,yBAHF,gCAII,uBAIJ,gCACE,iBACA,cACA,aACA,eACA,qBAEA,0EAEE,OACA,0BACA,aACA,oBACA,2CACA,iBAEA,gGACE,YACA,iBACA,gBAGF,0GACE,kBAKN,mCACE,iBACA,cACA,cACA,aACA,sBACA,wBAEA,0DACE,qBAGF,8CACE,0BAIJ,6CACE,kBAEA,2DACE,mCAGF,6DACE,mBACA,UAIJ,8BACE,kBAEA,2EAEE,WACA,kBACA,OACA,MACA,QACA,SACA,2CACA,oBAEA,UACA,yBACA,UAGF,sCACE,mDACA,yCAGF,qCACE,sCACA,aACA,uBACA,mBACA,2BAKF,8CACE,YAGF,6CACE,UAGF,wIAGE,oBAGF,mFAEE,2C;AC9HJ,yBACE,mBACA,8BAGF,0BACE,+BACA,oBAGF,mCACE,mBAGF,2BACE,kCACA,eACA,gBACA,qBAGF,yBACE,6BACA,iBACA,6CACA,iBACA,cAEA,mCACE,6BAGF,yBAXF,yBAYI,gBACA,gBAEA,4DACE,kBAKN,2BACE,kBAEA,yCACE,mBAGF,iDACE,kBACA,aACA,eAIJ,sBACE,kBAEA,sCACE,oBAGF,4BACE,iBAIJ,iBACE,kBACA,kCAGF,kBACE,kBACA,yBACA,2BAGF,mCACE,oB;ACjFJ,aACE,oBACA,mBACA,uBACA,aACA,cACA,eACA,kDACA,eACA,kBACA,mBACA,6BACA,sCAEA,yBACE,oBAGF,sCAEE,kDAGF,iBACE,WACA,Y;ACzBJ,aACE,YAEA,kBACE,yBACA,gBACA,cAEA,yBALF,kBAMI,sBAGF,wCACE,aACA,eAIJ,oBACE,YACA,6CACA,aACA,mBACA,6BACA,+CAEA,yBARF,oBASI,gBACA,kBACA,cACA,mBACA,mBAEA,qBACA,8BAEA,uCACE,SAGF,6CACE,+BAGF,uCACE,oBACA,sBAIF,2BACE,WACA,cACA,cACA,WACA,a;ACvDR,eACE,YAEA,oBACE,kBACA,yBACA,gBACA,cAEA,yBANF,oBAOI,sBAIJ,sBACE,YACA,6CACA,kBACA,gBACA,kBACA,mBACA,+CAEA,qBACA,8BAEA,yCACE,SAGF,+CACE,+BAIF,6BACE,WACA,cACA,cACA,WACA,YAIF,0CACE,oBACA,sBAEA,wDACE,qBAEA,qIACE,YACA,aACA,WACA,YAIJ,6DACE,WACA,YACA,kBACA,aACA,mBACA,uBAEA,+IACE,WACA,YACA,kBACA,MACA,OAMR,qCACE,YACA,cAEA,yBAJF,qCAKI,YAIJ,mCACE,yBACA,eACA,gBACA,kD;AC3FJ,WACE,aACA,mBACA,uBACA,eACA,6BACA,eACA,gBACA,kBAEA,sBACE,mBAGF,oBACE,uBAGF,sBACE,uBAGF,sBACE,WACA,YACA,iCACA,wCAGF,qCACE,kBACA,MACA,OACA,WACA,YACA,iBAGF,oBACE,kBACA,oB;ACxCJ,WACE,aACA,qCACA,uBACA,gBACA,qBACA,YACA,gBACA,eAEA,gDACE,iBACA,0B;ACTF,wBACE,eACA,OACA,QACA,SACA,mCACA,gGACA,UAEA,6CAEA,6BACE,+BAEA,uDACE,gGAIJ,+CACE,gBAGF,iDACE,8CAIJ,iBACE,+BACA,iCACA,0DAGF,mBACE,wCACA,0CACA,aACA,mBACA,uBACA,+CACA,kBAEA,2BACE,cACA,0BACA,gBACA,gBACA,UAEA,qCACE,oBAGF,6CACE,gBAGF,gDACE,kBACA,YAGF,gDACE,kBACA,aAKN,8BACE,YAEA,uCACE,iCAKF,sCACE,kBACA,UACA,OACA,WACA,aACA,cAKF,2DACE,UACA,cAIJ,oBACE,UACA,+BACA,gBAGF,6BACE,iCACA,aACA,mBACA,uBACA,kCAGF,iCACE,aACA,kBACA,aACA,WAGF,+BACE,iCACE,eAKN,YACE,mBAEA,iBACE,eACA,sBACA,gBACA,SACA,mBACA,kDACA,gBACA,mBACA,uBACA,mBACA,uBAGF,sBACE,mBAGF,mBACE,cACA,0BACA,gBACA,gBACA,UfvJF,iFe2JE,gBAIA,8CACE,cAGF,0CACE,gB;ACtKN,YACE,kBAGE,sCACE,kBACA,UACA,UACA,QACA,aAKJ,mCACE,mB;ACfJ,YACE,oBAEA,6BACE,gBAGF,4BACE,eAEA,sCACE,mBACA,mBAKF,wCACE,UACA,aAGF,uCACE,O;ACvBN,mBACE,wBACA,gBACA,sBAEA,WAEA,yBAPF,mBAQI,yB;ACPF,gCACE,wBACA,gBACA,gBACA,cACA,sBAEA,yBAPF,gCAQI,yBAKF,0CACE,kBACA,UACA,OACA,WACA,aACA,c;ACpBN,gBACE,aACA,2DACA,oBACA,mBAEA,uBACE,a;ACPJ,gBACE,kBACA,cAGE,0CACE,kBACA,UACA,UACA,QACA,aAKJ,uCACE,mBAGF,wBACE,Y;ACpBJ,cACE,aACA,oBAEA,gBAIA,kBAHA,+BALF,cAMI,oBAIF,2BACE,gB;ACVF,iDACE,gCACA,iCAEA,wDACE,cACA,uBAIJ,mBACE,mDACA,cACA,WACA,YACA,iBACA,gDACA,oBACA,qBACA,uBACA,wBACA,gBACA,iBAEA,mCACE,WACA,iBAGF,6BACE,aACA,cACA,kBAIJ,2BACE,YAGF,mBACE,gBACA,gBACA,uBAGF,yBACE,mBACA,oBACA,qBACA,4BACA,gBACA,uBACA,gBACA,uBAEF,8DAEE,iB;AC3DJ,aACE,SACA,oBACA,gBACA,kBACA,eAEA,iBACE,kBACA,OACA,MACA,WACA,YACA,iB;ACbJ,kBAME,2BALA,oCACE,cACA,gBAKF,0BACE,aACA,qCACA,aACA,UAEA,yBANF,0BAOI,sCAGF,qCACE,iBACA,sDACE,4BACA,6BAIJ,qCACE,wBAGF,yCACE,cACA,SACA,SACA,oBACA,gBAEA,uJACE,kBACA,MACA,OACA,sBACA,uBAEA,yBAPF,uJAQI,WACA,YACA,oCACA,sC;AChDV,aACE,YACA,gBACA,gBAEA,0BACE,aACA,sBACA,gBACA,kCACA,uBACA,mB;ACXJ,eACE,YACA,gBACA,gBAEA,4BACE,aACA,sBACA,gBACA,kCAGF,4BACE,mBAEA,mCACE,aACA,8BACA,cAEA,kDACE,gBAGF,0CACE,eACA,sBACA,SACA,gBACA,mBACA,uBAGF,0CACE,kCACA,SAGF,2CACE,cACA,iBAEA,oDACE,mCACA,kCAEA,qHACE,+CAMR,iCACE,aACA,iBACA,gBAIA,oDACE,iBAGF,6CACE,cACA,kBAKN,8BACE,e;ACxEJ,WACE,YACA,eAEA,0BACE,YACA,cAEA,+BACE,aACA,qCACA,uBACA,gBACA,qBAIJ,wBACE,6BACA,gBACA,kB;ACpBJ,mBACE,6CACA,wBACA,aACA,8BAEA,gCACE,aACA,mBACA,mBACA,sBACA,gBACA,kCACA,+BACA,gBACA,MACA,mCAEA,yBAZF,gCAaI,kCAIJ,mCACE,iBAEA,6CACE,cACA,kBAIJ,gCACE,iBACA,kBACA,gBAEA,yBALF,gCAMI,kBAGF,yCACE,wBAKF,oEACE,qBAIA,6EACE,oBACA,eAKN,mCACE,0BACA,wBAGE,uDACE,iBACA,eAKN,8BACE,sBACA,kBACA,iB;AC1EJ,aACE,YACA,kBACA,aACA,sBACA,oBAEA,sBACE,kBACA,MACA,OACA,SACA,QACA,iCAGF,4BACE,sBACA,cACA,kBAEA,yBALF,4BAMI,gBAIJ,gCACE,0CACA,YACA,c;AC7BJ,YACE,kBACA,YAEA,2BACE,YACA,kBACA,kBAGF,qBACE,oBACA,0CAEA,0BACE,eAGF,mCACE,gBACA,iBAGF,+BACE,gBAGF,+BACE,2BAEA,yCACE,gBAIJ,mCACE,cACA,eACA,mBACA,kBAEA,oDACE,kBACA,OACA,MACA,WACA,YAEA,2DACE,aAKN,+BACE,kBAEA,0CACE,gBAGF,yDACE,oBAGF,gEACE,gBACA,mBAIA,gDACE,gBACA,mBAKF,mEACE,qBAKN,sCACE,gBACA,mBACA,kCAEA,gDACE,mBAIJ,mCACE,kCACA,qBAEA,6CACE,mBAIJ,mCACE,kCACA,kBAGF,8BACE,iBAIJ,kCACE,YAGF,wBACE,wBAGF,yBACE,gBAEA,gCACE,oBACA,mBAEA,2CACE,sBAKF,6CACE,aACA,WACA,eAGF,4CACE,cACA,aACA,eAMR,oBACE,mB;ACtJF,cACE,mBAEA,iBACE,gBACA,kCACA,qB;ACNJ,UACE,mBAGE,iBACE,kCACA,gBACA,oBAGF,sBACE,mB;ACXN,UACE,gBAEA,uBACE,aACA,mBACA,cAEA,2BACE,YACA,aAIA,gCACE,iBACA,mBAGF,+BACE,gBACA,iBACA,kCAKN,sBACE,YAEA,uCACE,kBACA,aACA,mBACA,4BACA,kCACA,gBAEA,4CACE,wBAGF,8CACE,aACA,YAKN,wBACE,0CACA,aAEA,4CACE,aACA,0BACA,gBAEA,8CACE,iBACA,kCACA,kBACA,aAGF,8DACE,oEACA,qBACA,mBACA,cAIA,yDACE,eACA,sBACA,gBACA,gBACA,sBACA,wBACA,0BAGF,wDACE,gBACA,kBACA,qC;ACtFV,WACE,kBAEA,qDACE,kBAGF,uBACE,kBACA,UACA,UACA,UAEA,2BACE,e;ACdN,aACE,mBAEA,gBACE,gBACA,kCACA,qBAGF,4BACE,aACA,8BAEA,yCACE,aACA,cACA,a;ACfJ,8BACE,oBAGF,sBACE,kBACA,4BACA,6BACA,WACA,oBACA,aACA,mBACA,mBACA,mCACA,6CAEA,yBACE,gBACA,mBACA,uBACA,mBAIJ,0BACE,aAGF,6BACE,aACA,eACA,aACA,mBACA,uBAGF,+BACE,aACA,gBAGF,uBACE,cACA,WACA,YACA,kBAGF,sBACE,kBACA,+BACA,gCACA,WACA,oBACA,mCACA,0CAEA,6BACE,oBACA,gBAIJ,4BACE,YAGF,6BACE,UACA,gBAIJ,+FAKI,4BACE,gBAGF,0BACE,c","sources":["webpack://telegram-t/./src/components/mediaViewer/SenderInfo.scss","webpack://telegram-t/./src/components/mediaViewer/MediaViewerActions.scss","webpack://telegram-t/./src/components/mediaViewer/MediaViewerFooter.scss","webpack://telegram-t/./src/components/mediaViewer/VideoPlayerControls.scss","webpack://telegram-t/./src/components/mediaViewer/VideoPlayer.scss","webpack://telegram-t/./src/components/mediaViewer/ZoomControls.scss","webpack://telegram-t/./src/components/mediaViewer/PanZoom.scss","webpack://telegram-t/./src/components/mediaViewer/MediaViewer.scss","webpack://telegram-t/./src/components/main/ForwardPicker.scss","webpack://telegram-t/./src/components/main/Dialogs.scss","webpack://telegram-t/./src/components/common/CalendarModal.scss","webpack://telegram-t/./src/components/middle/MessageSelectToolbar.scss","webpack://telegram-t/./src/components/left/search/RecentContacts.scss","webpack://telegram-t/./src/components/left/search/ChatMessage.scss","webpack://telegram-t/./src/components/left/search/DateSuggest.scss","webpack://telegram-t/./src/components/left/search/LeftSearch.scss","webpack://telegram-t/./src/components/ui/CropModal.scss","webpack://telegram-t/./src/components/ui/AvatarEditable.scss","webpack://telegram-t/./src/components/ui/ShowMoreButton.scss","webpack://telegram-t/./src/components/left/settings/folders/SettingsFoldersChatsPicker.scss","webpack://telegram-t/./src/components/left/settings/folders/SettingsFolders.scss","webpack://telegram-t/./src/components/ui/RangeSlider.scss","webpack://telegram-t/./src/components/left/settings/SettingsStickerSet.scss","webpack://telegram-t/./src/components/left/settings/WallpaperTile.scss","webpack://telegram-t/./src/components/left/settings/SettingsGeneralBackground.scss","webpack://telegram-t/./src/components/left/settings/SettingsGeneralBackgroundColor.scss","webpack://telegram-t/./src/components/common/PasswordMonkey.scss","webpack://telegram-t/./src/components/left/settings/Settings.scss","webpack://telegram-t/./src/styles/_mixins.scss","webpack://telegram-t/./src/components/left/newChat/NewChat.scss","webpack://telegram-t/./src/components/left/ArchivedChats.scss","webpack://telegram-t/./src/components/middle/message/MessageContextMenu.scss","webpack://telegram-t/./src/components/common/StickerSetModal.scss","webpack://telegram-t/./src/components/middle/HeaderMenuContainer.scss","webpack://telegram-t/./src/components/middle/MobileSearch.scss","webpack://telegram-t/./src/components/middle/composer/MentionTooltip.scss","webpack://telegram-t/./src/components/middle/composer/AttachmentModal.scss","webpack://telegram-t/./src/components/middle/composer/PollModal.scss","webpack://telegram-t/./src/components/middle/composer/EmojiButton.scss","webpack://telegram-t/./src/components/middle/composer/EmojiPicker.scss","webpack://telegram-t/./src/components/middle/composer/StickerPicker.scss","webpack://telegram-t/./src/components/common/GifButton.scss","webpack://telegram-t/./src/components/middle/composer/GifPicker.scss","webpack://telegram-t/./src/components/middle/composer/SymbolMenu.scss","webpack://telegram-t/./src/components/middle/composer/AttachMenu.scss","webpack://telegram-t/./src/components/middle/composer/BotCommand.scss","webpack://telegram-t/./src/components/middle/composer/BotCommandTooltip.scss","webpack://telegram-t/./src/components/middle/composer/BotCommandMenu.scss","webpack://telegram-t/./src/components/middle/composer/StickerTooltip.scss","webpack://telegram-t/./src/components/middle/composer/CustomSendMenu.scss","webpack://telegram-t/./src/components/middle/composer/EmojiTooltip.scss","webpack://telegram-t/./src/components/middle/composer/inlineResults/BaseResult.scss","webpack://telegram-t/./src/components/middle/composer/inlineResults/MediaResult.scss","webpack://telegram-t/./src/components/middle/composer/InlineBotTooltip.scss","webpack://telegram-t/./src/components/right/RightSearch.scss","webpack://telegram-t/./src/components/right/StickerSearch.scss","webpack://telegram-t/./src/components/right/GifSearch.scss","webpack://telegram-t/./src/components/right/PollAnswerResults.scss","webpack://telegram-t/./src/components/right/PollResults.scss","webpack://telegram-t/./src/components/right/management/Management.scss","webpack://telegram-t/./src/components/payment/ShippingInfo.scss","webpack://telegram-t/./src/components/payment/Shipping.scss","webpack://telegram-t/./src/components/payment/Checkout.scss","webpack://telegram-t/./src/components/payment/CardInput.scss","webpack://telegram-t/./src/components/payment/PaymentInfo.scss","webpack://telegram-t/./src/components/payment/PaymentModal.scss"],"sourcesContent":[".SenderInfo {\n display: flex;\n align-content: center;\n color: white;\n cursor: pointer;\n\n opacity: .5;\n transition: .15s opacity;\n\n &:hover {\n opacity: 1;\n }\n\n .Avatar {\n margin-inline-end: 1rem;\n\n @media (max-width: 600px) {\n display: none;\n }\n }\n\n .meta {\n display: flex;\n flex-direction: column;\n justify-content: center;\n max-width: 100%;\n }\n\n .title {\n line-height: 1.45rem;\n font-weight: 500;\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .date {\n line-height: 1.25rem;\n font-size: 0.875rem;\n letter-spacing: -0.01rem;\n }\n}\n",".MediaViewerActions {\n display: flex;\n margin-inline-start: auto;\n margin-inline-end: -.375rem;\n\n .Button {\n margin-inline-start: .25rem;\n }\n}\n\n.MediaViewerActions-mobile {\n position: relative;\n\n .ProgressSpinner {\n position: absolute;\n top: 0;\n left: 0;\n }\n}\n",".MediaViewerFooter {\n position: absolute;\n bottom: 0;\n padding: 1rem 0;\n width: 100%;\n transition: opacity .15s;\n\n #MediaViewer.zoomed & {\n display: none;\n }\n\n @media (max-height: 640px) {\n padding: .5rem 0 0;\n }\n\n @media (max-width: 600px) {\n padding-bottom: 4.5rem;\n background: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0) 100%);\n\n &.is-for-video {\n opacity: 0;\n pointer-events: none;\n\n .video-controls-visible & {\n opacity: 1;\n pointer-events: all;\n }\n }\n }\n\n .media-viewer-footer-content {\n position: relative;\n max-width: var(--messages-container-width);\n margin: auto;\n cursor: pointer;\n opacity: .5;\n transition: opacity .15s;\n\n &:hover {\n opacity: 1;\n }\n\n @media (max-width: 600px) {\n opacity: 1;\n }\n }\n\n &.is-hidden {\n opacity: 0;\n }\n\n .media-text {\n margin-bottom: 0;\n overflow: auto;\n padding: 0 .5rem;\n text-align: center;\n color: rgba(255, 255, 255, .9);\n font-size: .9375rem;\n letter-spacing: .025rem;\n max-height: 4.25rem;\n\n @media (max-height: 640px) {\n max-height: 2.75rem;\n }\n\n .emoji {\n width: .9375rem;\n height: .9375rem;\n vertical-align: -2px;\n }\n\n &.multiline {\n &::before {\n content: '';\n position: absolute;\n left: -.75rem;\n right: -.75rem;\n top: -.25rem;\n bottom: -.25rem;\n background: rgba(0, 0, 0, .75);\n border-radius: var(--border-radius-default);\n z-index: var(--z-below);\n\n @media (max-width: 600px) {\n display: none;\n background: none;\n }\n }\n }\n }\n\n a {\n color: var(--color-links);\n\n &:hover,\n &:focus {\n color: var(--color-links-hover);\n }\n }\n}\n",".VideoPlayerControls {\n display: flex;\n align-items: center;\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n padding-top: .625rem;\n font-size: .875rem;\n background: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0) 100%);\n\n #MediaViewer.zoomed & {\n display: none;\n }\n\n @media (max-width: 600px) {\n position: fixed;\n padding: 1.25rem .5rem .75rem;\n background: none;\n z-index: var(--z-media-viewer);\n }\n\n &.mobile {\n .player-file-size {\n position: static;\n left: auto;\n transform: none;\n margin-left: auto;\n }\n\n .fullscreen {\n margin-left: 1rem;\n }\n\n .player-time + .fullscreen {\n margin-left: auto;\n }\n }\n\n .Button {\n width: 2.25rem;\n padding: 0;\n margin: .25rem;\n height: 1.75rem;\n @media (max-width: 600px) {\n height: 2.25rem;\n }\n }\n\n .play i {\n line-height: 1.5rem;\n }\n\n .player-time {\n margin: 0 1rem;\n white-space: nowrap;\n }\n\n .fullscreen {\n margin-left: auto;\n @media (max-width: 600px) {\n margin-left: 1rem;\n }\n i {\n line-height: 1.75rem;\n @media (max-width: 600px) {\n font-size: 1.5rem;\n }\n }\n }\n\n @media (max-width: 600px) {\n .player-time + .fullscreen {\n margin-left: auto;\n }\n }\n\n .player-file-size {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n @media (max-width: 600px) {\n position: static;\n left: auto;\n transform: none;\n margin-left: auto;\n margin-right: 1rem;\n & + .fullscreen {\n margin-left: 0;\n }\n }\n }\n\n .player-seekline {\n position: absolute;\n left: 1rem;\n right: 1rem;\n top: 0;\n height: 1rem;\n\n\n &-track {\n position: absolute;\n top: 50%;\n left: -.25rem;\n right: -.25rem;\n height: 5px;\n transform: translateY(-50%);\n background-color: rgba(255, 255, 255, 0.16);\n border-radius: var(--border-radius-default);\n }\n\n &-buffered,\n &-played,\n &-input {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n border-radius: var(--border-radius-default);\n }\n\n &-buffered {\n background-color: rgba(255, 255, 255, 0.5);\n }\n\n &-played {\n background: var(--color-primary);\n\n &::after {\n content: '';\n position: absolute;\n width: .75rem;\n height: .75rem;\n border-radius: 50%;\n background-color: var(--color-primary);\n right: 0;\n top: 50%;\n transform: translate(.325rem, -50%);\n }\n }\n\n &-input {\n width: 100%;\n opacity: 0;\n margin: 0;\n padding: 0;\n cursor: pointer;\n overflow: hidden;\n\n &::-webkit-slider-thumb {\n margin-top: -2rem;\n }\n }\n }\n}\n",".VideoPlayer {\n position: relative;\n display: inline-flex;\n flex-direction: column;\n overflow: hidden;\n\n #MediaViewer.zoomed & {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n > div {\n width: 100% !important;\n height: 100% !important;\n }\n video {\n max-height: none !important;\n }\n }\n\n @media (min-width: 601px) {\n // Safari: custom controls are not displayed after exiting full screen mode.\n z-index: 1;\n }\n\n @media (max-width: 600px) {\n overflow: visible;\n }\n\n @media (max-height: 640px) {\n margin-bottom: 1.75rem;\n @at-root .has-footer #{&} {\n margin-bottom: 0;\n }\n }\n\n video {\n display: block;\n max-height: calc(100vh - 8.25rem);\n margin: auto;\n object-fit: contain;\n outline: none;\n width: 100%;\n height: 100%;\n background: no-repeat 50% 50%;\n background-size: contain;\n\n @media (max-height: 640px) {\n max-height: calc(100vh - 10rem);\n }\n @at-root .has-footer #{&} {\n max-height: calc(100vh - 15rem);\n @media (max-height: 640px) {\n max-height: calc(100vh - 10rem);\n }\n }\n }\n\n .play-button {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 3.25rem;\n height: 3.25rem;\n background-color: rgba(0, 0, 0, 0.5) !important;\n body:not(.animation-level-0) & {\n transition: opacity .3s ease !important;\n }\n\n .icon-play {\n font-size: 1.75rem;\n position: relative;\n left: .125rem;\n }\n }\n\n .spinner-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n\n .buffering {\n background: rgba(0, 0, 0, 0.25);\n color: #fff;\n font-size: 0.75rem;\n position: absolute;\n left: 0.1875rem;\n top: 0.1875rem;\n z-index: 1;\n padding: 0 0.375rem;\n border-radius: 0.75rem;\n line-height: 1.125rem;\n }\n\n .ProgressSpinner {\n cursor: pointer;\n }\n }\n}\n",".ZoomControls {\n position: absolute;\n bottom: 1.25rem;\n left: 50%;\n background: rgba(0,0,0,.5);\n border-radius: var(--border-radius-default);\n width: 100%;\n height: 3.375rem;\n max-width: 274px;\n transform: translate3d(-50%, 0, 10px);\n transition: opacity .3s ease-in;\n pointer-events: none;\n\n &.open {\n z-index: var(--z-media-viewer);\n pointer-events: all;\n }\n\n .zoom-out,\n .zoom-in {\n position: absolute;\n top: 0.4375rem;\n width: 2.5rem;\n height: 2.5rem;\n color: #fff;\n\n i {\n font-size: 1.5rem;\n }\n }\n\n .zoom-out {\n left: .5rem;\n }\n\n .zoom-in {\n right: .5rem;\n }\n\n .seekline {\n position: absolute;\n left: 3.25rem;\n right: 3.25rem;\n top: 1.125rem;\n height: 1rem;\n\n &-track {\n position: absolute;\n top: 50%;\n left: -.25rem;\n right: -.25rem;\n height: 2px;\n transform: translateY(-50%);\n background-color: rgba(255, 255, 255, .5);\n border-radius: var(--border-radius-default);\n }\n\n &-played,\n &-input {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n border-radius: var(--border-radius-default);\n }\n\n &-played {\n background: #fff;\n transition: width 200ms;\n\n &::after {\n content: '';\n position: absolute;\n width: .75rem;\n height: .75rem;\n border-radius: 50%;\n background-color: var(--color-white);\n right: 0;\n top: 50%;\n transform: translate(.325rem, -50%);\n }\n }\n\n &-input {\n width: 100%;\n height: 1rem;\n top: -.375rem;\n opacity: 0;\n margin: 0;\n padding: 0;\n cursor: pointer;\n overflow: hidden;\n\n &::-webkit-slider-thumb {\n margin-top: -2rem;\n }\n }\n }\n}\n",".pan-wrapper,\n.pan-container {\n position: relative;\n width: 100%;\n height: 100%;\n}\n\n.pan-wrapper {\n cursor: move;\n user-select: none;\n}\n\n.pan-container {\n transition: transform .2s ease-in;\n\n .pan-wrapper.move & {\n transition: none;\n }\n\n .zoomed & {\n position: fixed;\n top: 0;\n left: 0;\n }\n}\n","#MediaViewer {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100%;\n background: rgba(0, 0, 0, .9);\n color: #fff;\n z-index: var(--z-media-viewer);\n padding: 0.5rem 0;\n\n display: grid;\n grid-template-columns: auto;\n grid-template-rows: 2.75rem 1fr;\n grid-column-gap: 0;\n grid-row-gap: 0;\n justify-items: stretch;\n align-items: center;\n\n // Potential perf improvement\n &:not(.shown) {\n display: block !important;\n transform: scale(0);\n }\n\n body.ghost-animating & {\n > .pan-wrapper, > .Transition, > button {\n display: none;\n }\n }\n\n body.animation-level-2 & {\n transition-duration: .3s !important;\n }\n\n &:not(.open),\n .closing {\n .SenderInfo {\n pointer-events: none;\n transition: none;\n }\n }\n\n &.zoomed {\n .navigation {\n display: none;\n }\n\n .media-viewer-head {\n z-index: 2;\n }\n\n .media-viewer-content {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n padding: 0;\n z-index: 1;\n }\n }\n\n .media-viewer-head {\n display: flex;\n grid-area: 1 / 1 / 2 / -2;\n padding: 0 1.25rem;\n position: relative;\n z-index: var(--z-media-viewer-head);\n min-width: 0;\n\n & > .Transition {\n width: 100%;\n min-width: 0;\n }\n\n @media (max-width: 600px) {\n padding: 0 0.5rem;\n\n .media-viewer-close {\n margin-right: 1.5rem;\n }\n }\n }\n\n & > .Transition,\n & > .pan-wrapper {\n grid-area: 1 / 1 / -1 / -1;\n }\n\n & > .Transition,\n & > .pan-wrapper .Transition {\n position: relative;\n justify-self: center;\n text-align: center;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n overflow: hidden;\n }\n\n .media-viewer-content {\n position: relative;\n z-index: 1;\n padding: 3.25rem 0;\n height: 100%;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n\n &.has-footer {\n padding: 7rem 0;\n @media (min-width: 600px) {\n min-width: 600px;\n }\n\n @media (max-height: 640px) {\n padding: 4rem 0;\n }\n\n > img {\n max-height: calc(100vh - 15rem);\n @media (max-height: 640px) {\n max-height: calc(100vh - 10rem);\n }\n }\n }\n\n .thumbnail {\n position: relative;\n\n img {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n }\n\n > img {\n max-width: 100vw;\n max-height: calc(100vh - 8.25rem);\n object-fit: contain;\n transition: transform .2s;\n }\n\n .spinner-wrapper {\n max-width: 100vw;\n margin: auto;\n }\n\n .Spinner {\n margin: auto;\n }\n }\n\n .navigation {\n position: fixed;\n top: 4rem;\n width: 10vw;\n bottom: 0;\n border: none;\n padding: 0;\n margin: 0;\n appearance: none;\n background: transparent no-repeat;\n background-size: 1.25rem;\n opacity: 0;\n transition: opacity .15s;\n outline: none;\n cursor: pointer;\n z-index: 1;\n\n @media (max-width: 600px) {\n width: 20vw;\n }\n\n &:hover, .is-touch-env & {\n opacity: 1;\n }\n\n &.prev {\n left: 0;\n background-image: url(\"../../assets/media_navigation_previous.svg\");\n background-position: 1.25rem calc(50% - 2rem);\n\n &[dir=rtl] {\n left: auto;\n right: 0;\n transform: scaleX(-1);\n }\n }\n\n &.next {\n right: 0;\n background-image: url(\"../../assets/media_navigation_next.svg\");\n background-position: calc(100% - 1.25rem) calc(50% - 2rem);\n\n &[dir=rtl]{\n left: 0;\n right: auto;\n transform: scaleX(-1);\n }\n }\n\n &.inline {\n top: calc(50% - 3rem);\n bottom: unset;\n height: 6rem;\n background-position-y: center;\n\n @media (max-width: 600px) {\n opacity: 0;\n transition: opacity .15s ease-in;\n pointer-events: none;\n\n .video-controls-visible & {\n opacity: 1;\n pointer-events: all;\n }\n }\n }\n }\n}\n\n.ghost {\n position: absolute;\n z-index: var(--z-media-viewer);\n will-change: transform, opacity;\n overflow: hidden;\n border-radius: 0;\n transition: transform .2s ease, opacity .2s ease;\n\n &.rounded-corners {\n border-radius: var(--border-radius-messages);\n }\n\n &.circle {\n border-radius: 50%;\n }\n\n body.is-ios & {\n transition: transform .2s ease, opacity .2s ease, border-radius .2s ease !important;\n }\n\n img,\n video {\n width: 100%;\n height: 100%;\n user-select: none;\n -webkit-user-select: none;\n object-fit: cover;\n }\n}\n",".ForwardPicker {\n z-index: var(--z-media-viewer);\n\n .modal-dialog {\n height: 70%;\n max-width: 25rem;\n\n @media (max-width: 600px) {\n height: 90%;\n }\n }\n\n .modal-header {\n display: flex;\n align-items: center;\n padding: 0.25rem 0.5rem;\n\n .Button {\n margin-right: 0.5rem;\n }\n\n .input-group {\n margin: 0;\n }\n\n .form-control {\n border: none;\n box-shadow: none !important;\n\n height: 2.75rem;\n padding: 0.5rem;\n font-size: 1.25rem;\n line-height: 1.75rem;\n unicode-bidi: plaintext;\n }\n }\n\n .modal-content {\n padding: 0;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n\n .picker-list {\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n padding: 0 1rem 1rem;\n }\n }\n\n .no-results {\n height: 100%;\n margin: 0;\n padding: 1rem 1rem;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color-text-secondary);\n }\n\n .ListItem.chat-item-clickable {\n &:not(.force-rounded-corners) {\n @media (max-width: 600px) {\n margin: 0;\n\n .ListItem-button {\n border-radius: 0;\n }\n }\n }\n\n }\n}\n","#Dialogs {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n z-index: var(--z-modal);\n}\n",".CalendarModal {\n .modal-dialog {\n max-width: 26.25rem;\n .modal-content {\n padding: .375rem 1rem 1rem;\n }\n }\n\n .timepicker {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-bottom: 1.5rem;\n\n .form-control {\n max-width: 5rem;\n text-align: center;\n\n &:first-child {\n margin-right: 1rem;\n }\n &:last-child {\n margin-left: 1rem;\n }\n }\n }\n\n .footer {\n display: flex;\n justify-content: flex-end;\n flex-direction: column;\n\n .Button {\n text-transform: none;\n\n + .Button {\n margin-top: .5rem;\n }\n }\n }\n\n .month-selector {\n display: flex;\n align-items: center;\n\n h4 {\n flex: 1;\n margin: 0 0 0 1.25rem;\n font-size: 1.25rem;\n\n @media (max-width: 600px) {\n margin-left: .75rem;\n }\n\n & ~ .Button {\n color: var(--color-primary)\n }\n }\n\n .Button.hidden {\n opacity: 0.5;\n pointer-events: none;\n }\n }\n\n .day-button {\n position: relative;\n border-radius: 4rem;\n outline: none !important;\n font-weight: 500;\n margin: .125rem .625rem;\n\n @media (max-width: 600px) {\n margin: .25rem .375rem;\n }\n\n &.weekday {\n margin-bottom: 0;\n height: 1rem;\n }\n\n &.clickable {\n cursor: pointer;\n\n &:hover {\n background-color: var(--color-interactive-element-hover);\n }\n\n &.selected {\n background-color: var(--color-primary);\n color: white;\n }\n }\n\n &.disabled {\n opacity: 0.25;\n pointer-events: none;\n }\n\n &::before {\n content: \"\";\n display: block;\n padding-top: 100%;\n }\n\n span {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 0.875rem;\n }\n }\n\n .calendar-wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 17rem;\n margin: 1.5rem -0.5rem 0.5rem;\n }\n\n .calendar-grid {\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n width: 100%;\n }\n}\n",".MessageSelectToolbar {\n position: absolute;\n bottom: 0.5rem;\n left: 0.5rem;\n right: 0.5rem;\n width: auto;\n z-index: 20;\n justify-content: center;\n margin: 0;\n\n .mask-image-disabled &::before {\n left: auto !important;\n right: auto !important;\n }\n\n .no-composer & {\n width: 100%;\n }\n\n @media (min-width: 601px) {\n left: 1rem;\n right: 1rem;\n bottom: 1.25rem;\n\n .no-composer & {\n top: -4.75rem;\n }\n }\n\n opacity: 1;\n\n &-inner {\n transform: scaleX(1);\n transition: transform var(--select-transition), opacity var(--select-transition);\n }\n\n & .MessageSelectToolbar-inner {\n transform: scaleX(1) translateX(0);\n }\n\n .no-composer .unpin-button-container + &,\n .no-composer .messaging-disabled + & {\n top: auto;\n }\n\n body.animation-level-0 & {\n transition: none !important;\n }\n\n &:not(.shown) {\n opacity: 0;\n pointer-events: none;\n\n .shown-inner {\n transform: scaleX(var(--toolbar-hidden-scale, 1));\n }\n\n &.with-composer .MessageSelectToolbar-inner {\n transform: scaleX(var(--toolbar-hidden-scale, 1)) translateX(var(--toolbar-translate-x, 0));\n }\n\n &:not(.with-composer) .MessageSelectToolbar-inner {\n transform: scaleX(var(--toolbar-unpin-hidden-scale)) translateX(0);\n }\n }\n\n &::before {\n z-index: -1;\n max-width: 32rem;\n width: 100%;\n left: auto;\n right: auto;\n }\n\n &-inner {\n width: 100%;\n max-width: 32rem;\n display: flex;\n align-items: center;\n padding: 0.25rem;\n\n background: var(--color-background);\n border-radius: var(--border-radius-messages);\n box-shadow: 0 1px 2px var(--color-default-shadow);\n font-weight: 500;\n\n @media (max-width: 600px) {\n padding: 0;\n max-width: none;\n }\n\n > .Button {\n width: 3rem;\n height: 3rem;\n\n @media (max-width: 600px) {\n width: 2.875rem;\n height: 2.875rem;\n }\n }\n }\n\n &-count {\n margin-left: 1rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-grow: 1;\n\n @media (max-width: 600px) {\n margin-right: 0.5rem;\n }\n }\n\n &-actions {\n margin-left: auto;\n display: flex;\n\n .MenuItem {\n padding: 0.6875rem;\n border-radius: 50%;\n\n i {\n margin-right: 0;\n }\n\n .item-text {\n display: none;\n }\n }\n }\n}\n",".RecentContacts {\n .Loading {\n min-height: 75vh;\n }\n\n .top-peers-section {\n padding: .5rem 1rem;\n }\n\n .top-peers {\n height: 6rem;\n margin: 0 -1rem;\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n\n scrollbar-width: none;\n scrollbar-color: rgba(0, 0, 0, 0);\n\n &::-webkit-scrollbar {\n height: 0;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0);\n }\n }\n\n .top-peer-item {\n display: inline-block;\n width: 4.5rem;\n height: 6rem;\n padding: 0.625rem 0.25rem;\n margin-left: 0.5rem;\n border-radius: var(--border-radius-default);\n cursor: pointer;\n position: relative;\n overflow: hidden;\n\n &:first-child {\n margin-left: 0.125rem;\n }\n\n &:last-child {\n margin-right: 0.125rem;\n }\n\n .Avatar {\n margin: 0 auto 0.375rem;\n }\n\n &:hover {\n background: var(--color-chat-hover);\n }\n\n .top-peer-name {\n text-align: center;\n white-space: nowrap;\n font-size: 0.75rem;\n overflow: hidden;\n text-overflow: ellipsis;\n\n .emoji-small {\n width: 1rem;\n height: 1rem;\n background-size: 1rem;\n margin-inline-end: 1px;\n vertical-align: -3px;\n }\n }\n }\n\n .recent-chats-header {\n display: flex;\n align-items: center;\n\n .Button {\n margin-left: auto;\n }\n\n &[dir=rtl] {\n .Button {\n margin-left: 0;\n margin-right: auto;\n }\n }\n }\n}\n",".ChatMessage {\n &:first-child {\n margin-top: .5rem;\n }\n &:hover, &.selected {\n .Avatar.online::after {\n border-color: var(--color-chat-hover);\n }\n }\n\n .ListItem-button {\n padding: .25rem .5rem;\n }\n\n .info {\n .title {\n flex-grow: 1;\n }\n\n h3 {\n font-size: 1rem;\n width: auto;\n }\n\n .subtitle {\n color: var(--color-text-secondary);\n\n .matching-text-highlight {\n color: var(--color-text);\n background: #CAE3F7;\n border-radius: 0.25rem;\n padding: 0 0.125rem;\n }\n }\n\n .message {\n flex-grow: 1;\n color: var(--color-text-secondary);\n overflow: hidden;\n text-overflow: ellipsis;\n\n .sender-name {\n color: var(--color-text);\n }\n .sender-name {\n &::after {\n content: ': ';\n }\n }\n\n img {\n width: 1.25rem;\n height: 1.25rem;\n object-fit: cover;\n border-radius: .125rem;\n vertical-align: -.25rem;\n margin-right: .25rem;\n }\n\n .icon-play {\n position: relative;\n display: inline-block;\n font-size: .75rem;\n color: #fff;\n margin-inline-start: -1.25rem;\n margin-inline-end: 0.5rem;\n bottom: 0.0625rem;\n }\n }\n }\n\n .info-row {\n display: flex;\n justify-content: space-between;\n }\n\n &[dir=rtl] {\n .subtitle {\n text-align: right;\n }\n }\n}\n",".DateSuggest {\n display: flex;\n height: 2rem;\n flex-direction: row;\n justify-content: space-between;\n margin-left: .5rem;\n margin-bottom: .5rem;\n\n .date-item {\n display: flex;\n flex: 1 1 auto;\n min-width: 8rem;\n margin-top: .375rem;\n cursor: pointer;\n font-size: .875rem;\n font-weight: 500;\n color: var(--color-text-secondary);\n\n .icon-calendar {\n font-size: 1.25rem;\n margin-right: .25rem;\n }\n }\n \n}",".LeftSearch {\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n\n & > .Transition {\n flex: 1;\n overflow: hidden;\n }\n\n .TabList {\n padding-bottom: 1px;\n z-index: 1;\n }\n\n .documents-list {\n padding: 0 1.25rem 1.25rem;\n\n .ListItem {\n padding: 0.625rem 0;\n }\n }\n\n .section-heading {\n position: relative;\n padding-top: 1.25rem;\n padding-left: 1.25rem;\n margin: 0 0 1rem -1.25rem !important;\n\n font-weight: 500;\n font-size: .9375rem;\n color: var(--color-text-secondary);\n\n &::before {\n content: '';\n position: absolute;\n width: 100%;\n height: 1px;\n background: var(--color-borders);\n left: .625rem;\n top: -1px;\n }\n\n &[dir=rtl],\n &[dir=auto] {\n padding-left: 0;\n padding-right: 1.25rem;\n margin: 0 -1.25rem 0 1rem !important;\n text-align: initial;\n\n &::before {\n left: auto;\n right: .625rem;\n }\n }\n }\n\n .LeftSearch .search-section .section-heading,\n .RecentContacts .search-section .section-heading {\n margin-left: -1rem !important;\n width: calc(100% + 2rem);\n box-shadow: 0 -1px 0 0 var(--color-borders);\n\n &::before {\n display: none;\n }\n }\n\n .WebLink {\n display: flex;\n }\n\n .content:not(.with-seekline) {\n align-self: center;\n min-width: 0;\n flex-grow: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: break-word;\n }\n\n .message-date {\n font-size: .75rem;\n color: var(--color-text-secondary);\n padding-left: 1rem;\n white-space: nowrap;\n }\n\n .media-list {\n display: grid;\n padding: .5rem;\n grid-template-columns: repeat(3, 1fr);\n grid-auto-rows: 1fr;\n grid-gap: .25rem;\n }\n\n .Audio {\n .duration span {\n padding: 0 .25rem;\n }\n\n .ProgressSpinner {\n margin: -.1875rem 0 0 -.1875rem;\n }\n }\n\n .ListItem.search-result {\n .ChatInfo {\n .handle {\n unicode-bidi: plaintext;\n color: var(--color-primary);\n unicode-bidi: plaintext;\n\n &::before {\n content: '@';\n html[lang=ar] & {\n content: ' ،@';\n margin-inline-end: .25rem;\n }\n }\n\n &::after {\n content: ', ';\n color: var(--color-text-secondary);\n\n html[lang=ar] & {\n content: '';\n }\n }\n }\n\n &[dir=rtl] {\n .status {\n text-align: right;\n\n .handle {\n float: right;\n }\n }\n }\n }\n }\n\n .ListItem.search-result-message {\n .sender-name {\n color: var(--color-text);\n\n &::after {\n content: ': ';\n white-space: pre;\n }\n }\n }\n\n @media (max-width: 600px) {\n .ListItem {\n margin: 0 -0.625rem;\n }\n }\n\n .search-section {\n padding: 0 1rem 0.5rem;\n\n .section-heading {\n color: var(--color-text-secondary);\n font-size: .9375rem;\n font-weight: 500;\n margin-bottom: 0 !important;\n padding-top: .875rem;\n\n .Link {\n float: right;\n color: var(--color-links);\n font-weight: 400;\n margin-right: 1rem;\n\n &:focus,\n &:hover {\n color: var(--color-links-hover);\n }\n }\n\n &[dir=rtl],\n &[dir=auto] {\n .Link {\n float: left;\n margin-left: 1rem;\n margin-right: 0;\n }\n }\n }\n\n .Loading {\n height: 4.5rem;\n margin-bottom: 0.5rem;\n }\n }\n\n .chat-selection {\n padding-top: .5rem;\n display: flex;\n flex-shrink: 0;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: flex-end;\n box-shadow: inset 0 -1px 0 0 var(--color-borders);\n background-color: var(--color-background);\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: hidden;\n\n scrollbar-color: rgba(0, 0, 0, 0);\n\n > .PickerSelectedItem {\n flex: 0 0 auto;\n\n &:last-child {\n margin-right: auto;\n }\n }\n\n &[dir=rtl] {\n > .PickerSelectedItem:last-child {\n margin-left: auto;\n margin-right: 0;\n }\n }\n }\n\n .NothingFound {\n height: 100%;\n }\n\n [dir=rtl] {\n .message-date {\n padding-left: 0;\n padding-right: 1rem;\n }\n }\n}\n","@mixin thumb-styles() {\n background: var(--color-primary);\n cursor: pointer;\n transform: scale(1);\n transition: transform .25s ease-in-out;\n\n &:hover {\n transform: scale(1.2);\n }\n}\n\n.CropModal {\n .modal-dialog {\n width: calc(100% - 2rem);\n max-width: 35rem;\n height: calc(100% - 1rem);\n max-height: 35rem;\n position: relative;\n }\n\n .modal-content, #avatar-crop {\n overflow: hidden;\n }\n\n .confirm-button {\n position: absolute;\n bottom: 1rem;\n right: 1rem;\n box-shadow: 0 1px 2px var(--color-default-shadow);\n }\n\n #avatar-crop {\n max-width: 25rem;\n margin: 0 auto;\n position: relative;\n\n &::before {\n content: '';\n display: block;\n padding-top: 100%;\n }\n\n .cr-boundary {\n position: absolute;\n top: 0;\n left: 0;\n border-radius: var(--border-radius-messages-small);\n }\n\n .cr-viewport {\n border: none;\n box-shadow: 0 0 2000px 2000px rgba(white, 0.5);\n }\n\n .cr-slider {\n // Note that while we're repeating code here, that's necessary as you can't comma-separate these type of selectors.\n // Browsers will drop the entire selector if it doesn't understand a part of it.\n\n &::-webkit-slider-runnable-track {\n background: var(--color-borders);\n }\n\n &::-moz-range-track {\n background: var(--color-borders);\n }\n\n &::-ms-track {\n background: var(--color-borders);\n }\n\n &::-webkit-slider-thumb {\n @include thumb-styles();\n }\n\n &::-moz-range-thumb {\n @include thumb-styles();\n }\n\n &::-ms-thumb {\n @include thumb-styles();\n }\n }\n }\n}\n","@import '../../styles/mixins';\n\n.AvatarEditable {\n label {\n margin-left: auto;\n margin-right: auto;\n width: 7.5rem;\n height: 7.5rem;\n margin-bottom: 2rem;\n display: flex !important;\n align-items: center;\n justify-content: center;\n background-color: var(--color-primary);\n border-radius: 50%;\n color: white;\n font-size: 3rem;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n outline: none !important;\n\n input {\n display: none;\n }\n\n img {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n i {\n transform: scale(1);\n transition: transform .15s linear;\n z-index: var(--z-register-add-avatar);\n }\n\n // @optimization The weirdest workaround for screen animation lag\n @include while-transition() {\n input, i, &::after {\n display: none !important;\n }\n\n img {\n position: static !important;\n }\n }\n\n &:hover {\n i {\n transform: scale(1.2);\n }\n }\n\n &.filled {\n background-color: var(--color-background);\n\n &::after {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(black, 0.4);\n }\n }\n\n &.disabled {\n pointer-events: none;\n\n i {\n display: none;\n }\n\n &::after {\n display: none;\n }\n }\n }\n}\n",".ShowMoreButton {\n color: var(--text-color) !important;\n display: flex;\n align-items: center;\n text-align: left;\n text-transform: none;\n padding-left: .75rem !important;\n opacity: 1 !important;\n\n i {\n font-size: 1.5rem;\n margin-right: 2rem;\n color: var(--color-text-secondary);\n }\n\n .Spinner {\n top: 0.4375rem;\n }\n}\n",".SettingsFoldersChatsPicker {\n height: calc(100% - var(--header-height));\n\n .picker-header {\n box-shadow: 0 0 2px var(--color-default-shadow);\n\n .max-items-reached {\n margin-bottom: 0.5rem;\n margin-left: 0.5rem;\n flex-grow: 1;\n }\n\n .max-items-reached {\n color: var(--color-text-secondary);\n }\n }\n\n .picker-list {\n padding: 0 0.5rem 0.5rem;\n\n .no-results {\n height: 10rem;\n }\n }\n\n .ListItem.picker-list-item {\n &.chat-type-item .ListItem-button {\n padding: 0.875rem 0.75rem;\n }\n\n &.chat-item .ListItem-button {\n padding: 0.5rem 0.75rem;\n }\n\n .Checkbox {\n margin-left: auto;\n padding-left: 3.25rem;\n }\n\n .chat-type {\n font-size: 1rem;\n font-weight: 400;\n margin: 0;\n }\n\n &[dir=rtl] {\n .Checkbox {\n margin-left: 0;\n margin-right: auto;\n padding-left: 0;\n padding-right: 3.25rem;\n }\n }\n }\n\n .settings-item-header {\n margin-left: 0.75rem;\n margin-top: 1rem;\n margin-bottom: 0.5rem;\n }\n\n .picker-list-divider {\n margin: 0.5rem -0.5rem 0;\n border-bottom: 1px solid var(--color-borders);\n }\n}\n",".settings-folders-recommended-item {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.settings-folders-list-item {\n .ChatInfo {\n display: flex;\n align-items: center;\n\n .Avatar {\n margin-left: -0.25rem;\n margin-right: 1.5rem;\n }\n\n .title {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n\n h3 {\n font-size: 1rem;\n font-weight: 500;\n line-height: 1.3125;\n margin: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-align: left;\n }\n }\n\n .status {\n display: none;\n }\n\n &[dir=rtl] {\n .title h3{\n text-align: right;\n }\n }\n }\n\n .ListItem-button {\n i {\n opacity: 0.9;\n }\n }\n\n &.color-primary .ListItem-button {\n color: var(--color-primary);\n\n i {\n opacity: 1;\n color: inherit;\n }\n }\n\n &[dir=rtl] {\n .Avatar {\n margin-left: 1.5rem;\n margin-right: -0.25rem;\n }\n }\n}\n\n.settings-item .ShowMoreButton {\n margin: 0 -1rem;\n width: calc(100% + 2rem);\n padding-left: 1rem !important;\n}\n","@mixin thumb-styles() {\n background: var(--slider-color);\n border: none;\n height: 0.75rem;\n width: 0.75rem;\n border-radius: 50%;\n cursor: pointer;\n transform: scale(1);\n transition: transform .25s ease-in-out;\n\n &:hover {\n transform: scale(1.2);\n }\n}\n\n.RangeSlider {\n --slider-color: var(--color-primary);\n\n margin-bottom: 1rem;\n\n &.disabled {\n pointer-events: none;\n --slider-color: var(--color-text-secondary);\n }\n\n .slider-top-row {\n display: flex;\n justify-content: space-between;\n margin-bottom: 0.625rem;\n\n .value {\n flex-shrink: 0;\n margin-left: 1rem;\n color: var(--color-text-secondary);\n }\n\n &[dir=rtl] {\n .value {\n margin-left: 0;\n margin-right: 1rem;\n }\n }\n }\n\n .slider-main {\n position: relative;\n z-index: 1;\n\n &::before {\n content: '';\n position: absolute;\n width: 100%;\n left: 0;\n top: 0.3125rem;\n height: 0.125rem;\n background-color: var(--color-borders);\n border-radius: 0.125rem;\n opacity: 0.5;\n z-index: -1;\n }\n }\n\n .slider-fill-track {\n position: absolute;\n width: 100%;\n left: 0;\n top: 0.3125rem;\n height: 0.125rem;\n background-color: var(--slider-color);\n border-radius: 0.125rem;\n pointer-events: none;\n }\n\n // Reset range input browser styles\n input[type=\"range\"] {\n -webkit-appearance: none;\n display: block;\n width: 100%;\n height: 0.75rem;\n margin-bottom: 0.5rem;\n background: transparent;\n\n &:focus {\n outline: none;\n }\n\n &::-ms-track {\n width: 100%;\n cursor: pointer;\n\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n }\n }\n\n // Apply custom styles\n input[type=\"range\"] {\n // Note that while we're repeating code here, that's necessary as you can't comma-separate these type of selectors.\n // Browsers will drop the entire selector if it doesn't understand a part of it.\n &::-webkit-slider-thumb {\n @include thumb-styles();\n }\n\n &::-moz-range-thumb {\n @include thumb-styles();\n }\n\n &::-ms-thumb {\n @include thumb-styles();\n }\n }\n\n .slider-options {\n display: grid;\n grid-template-rows: auto;\n grid-auto-columns: 1fr;\n grid-auto-flow: column;\n }\n\n .slider-option {\n font-size: 0.825rem;\n text-align: center;\n cursor: pointer;\n color: var(--color-text-secondary);\n transition: color .2s ease;\n\n &:hover, &.active {\n color: var(--color-text);\n }\n\n &.active {\n font-weight: 500;\n }\n\n &:first-child {\n text-align: left;\n }\n\n &:last-child {\n text-align: right;\n }\n }\n}\n",".SettingsStickerSet {\n .settings-item &.ListItem {\n margin-bottom: .5rem;\n }\n\n .StickerButton,\n .Button {\n width: 3rem;\n height: 3rem;\n margin: 0 .5rem 0 0;\n padding: 0;\n flex: 0 0 3rem;\n }\n\n img {\n max-width: 100%;\n max-height: 100%;\n }\n\n .multiline-menu-item {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n\n &[dir=rtl] {\n .StickerButton,\n .Button {\n margin: 0 0 0 .5rem;\n }\n }\n}\n",".WallpaperTile {\n height: 0;\n padding-bottom: 100%;\n cursor: pointer;\n position: relative;\n\n .media-inner,\n &::after {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n }\n\n .media-inner {\n overflow: hidden;\n transform: scale(1);\n transition: transform .15s ease;\n\n img, canvas {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n }\n\n &::after {\n content: \"\";\n display: block;\n border: 2px solid var(--color-primary);\n opacity: 0;\n transition: opacity .15s ease;\n }\n\n &.selected {\n &::after {\n opacity: 1;\n }\n\n .media-inner {\n transform: scale(0.9);\n }\n }\n\n .spinner-container {\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n}\n",".SettingsGeneralBackground {\n .settings-wallpapers {\n display: grid;\n padding: .5rem;\n grid-template-columns: repeat(3, 1fr);\n grid-auto-rows: 1fr;\n grid-gap: .25rem;\n }\n\n .Loading {\n height: auto !important;\n margin-top: 5rem;\n }\n}\n",".SettingsGeneralBackgroundColor {\n &:not(.is-dragging) .handle {\n transition: transform 300ms ease;\n }\n\n .color-picker, .hue-picker {\n position: relative;\n }\n\n .color-picker {\n margin-top: 1rem;\n height: 12rem;\n }\n\n .hue-picker {\n margin: 2rem 0;\n height: 0.5rem;\n }\n\n canvas {\n display: block;\n width: 100%;\n height: 100%;\n border-radius: var(--border-radius-default);\n cursor: pointer;\n }\n\n .handle {\n position: absolute;\n top: -0.75rem;\n left: -0.75rem;\n width: 1.5rem;\n height: 1.5rem;\n border: 0.125rem solid var(--color-white);\n border-radius: 0.75rem;\n cursor: grab;\n }\n\n .hue-picker .handle {\n top: -0.5rem;\n }\n\n .tools {\n margin-bottom: 0.625rem;\n display: flex;\n\n .input-group {\n margin-bottom: 0;\n\n &[dir=rtl] {\n label {\n transform: scale(0.75) translate(1.25rem, -2.25rem);\n }\n }\n }\n\n .input-group:first-child {\n margin-right: 0.5rem;\n }\n\n .input-group:last-child {\n margin-left: 0.5rem;\n }\n }\n\n .predefined-colors {\n display: grid;\n padding: .5rem;\n grid-template-columns: repeat(3, 1fr);\n grid-auto-rows: 1fr;\n grid-gap: .25rem;\n\n div {\n cursor: pointer;\n box-shadow: inset 0 0 0 0 var(--color-background);\n transition: box-shadow 300ms ease;\n\n &.active {\n border: 0.125rem solid var(--color-primary);\n box-shadow: inset 0 0 0 0.3125rem var(--color-background);\n }\n\n // A hack to make a square\n &:before {\n display: block;\n content: \"\";\n width: 100%;\n padding-top: 100%;\n pointer-events: none;\n }\n }\n }\n}\n","#monkey {\n position: relative;\n display: block;\n margin-left: auto;\n margin-right: auto;\n width: 7.5rem;\n height: 7.5rem;\n margin-bottom: 1.75rem;\n\n @media (min-width: 600px) and (min-height: 450px) {\n width: 10rem;\n height: 10rem;\n margin-bottom: 2.5rem;\n }\n\n &.big {\n width: 10rem;\n height: 10rem;\n }\n\n .AnimatedSticker {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n\n &.hidden {\n display: none\n }\n }\n\n .monkey-preview {\n width: 100%;\n height: 100%;\n background-size: 100%;\n background: url('../../assets/monkey.svg') center;\n }\n}\n","@import '../../../styles/mixins';\n\n#Settings {\n height: 100%;\n\n > div {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .left-header {\n padding-right: .8125rem;\n }\n}\n\n.settings-main-header {\n display: flex;\n flex-grow: 1;\n justify-content: space-between;\n align-items: center;\n}\n\n.settings-more-menu {\n .bubble {\n width: auto;\n\n .MenuItem button {\n padding-left: 1rem !important;\n padding-right: 2rem !important;\n }\n }\n}\n\n.settings-content {\n background: var(--color-background);\n height: calc(100% - var(--header-height));\n\n overflow-y: auto;\n @include overflow-y-overlay();\n\n &.infinite-scroll {\n display: flex;\n flex-direction: column;\n\n & > .custom-scroll {\n flex: 1 1 auto;\n height: auto;\n }\n }\n\n #monkey {\n margin-top: .5rem;\n margin-bottom: 1rem;\n }\n\n .AnimatedEmoji {\n margin-top: .5rem;\n margin-bottom: 1.5rem;\n }\n}\n\n.settings-content-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 0 1.5rem 1rem;\n text-align: center;\n\n .input-group {\n width: 100%;\n }\n}\n\n.settings-content-icon {\n width: 5rem;\n height: 5rem;\n margin-bottom: 2.5rem;\n position: relative;\n\n .AnimatedSticker {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n\n &.hidden {\n display: none\n }\n }\n}\n\n.settings-main-menu {\n padding: 0 0.5rem .75rem;\n\n > .ChatExtra {\n padding: 0 .5rem .3125rem;\n margin: 0 -.5rem .625rem;\n box-shadow: inset 0 -.0625rem 0 0 var(--color-background-secondary-accent);\n border-bottom: .625rem solid var(--color-background-secondary);\n\n .ListItem.narrow {\n margin-bottom: .25rem;\n }\n }\n}\n\n.settings-item {\n border-top: 1px solid var(--color-borders);\n padding: 1.5rem 1.5rem 1rem;\n\n &.no-border {\n border-top: none;\n }\n\n &-header {\n font-size: 1rem;\n color: var(--color-text-secondary);\n margin-bottom: 2rem;\n position: relative;\n\n &[dir=rtl] {\n text-align: right;\n }\n }\n\n &-slider {\n margin-top: 2rem;\n }\n\n &-description {\n font-size: 0.875rem;\n color: var(--color-text-secondary);\n margin-top: -0.5rem;\n margin-bottom: 1.5rem;\n\n .settings-content.two-fa & {\n font-size: 1rem;\n }\n\n &[dir=rtl] {\n text-align: right;\n unicode-bidi: plaintext;\n }\n }\n\n &-description-larger {\n font-size: 1rem;\n line-height: 1.3125rem;\n color: var(--color-text-secondary);\n margin-top: 2rem;\n margin-bottom: 0.75rem;\n\n &[dir=rtl] {\n text-align: right;\n }\n }\n\n .ListItem {\n margin: 0 -1rem 1rem;\n\n &:last-child {\n margin-bottom: 0;\n }\n\n .multiline-menu-item {\n white-space: initial;\n\n &.full-size {\n width: 100%;\n }\n\n .date {\n float: right;\n font-size: 0.75rem;\n margin-left: 1rem;\n color: var(--color-text-secondary);\n }\n\n .title, .subtitle {\n display: block;\n text-align: left;\n }\n\n .title {\n line-height: 1.25rem;\n }\n\n .subtitle {\n font-size: 0.875rem;\n line-height: 1.5rem;\n color: var(--color-text-secondary);\n\n & + .subtitle {\n margin-top: -0.25rem;\n }\n\n &.black {\n color: var(--color-text);\n }\n\n &.tight {\n line-height: 1.3125rem;\n margin-bottom: .1875rem;\n }\n }\n }\n\n &.destructive {\n .ListItem-button {\n color: var(--color-error);\n\n i {\n color: inherit;\n }\n }\n }\n\n &.blocked-list-item {\n margin-bottom: 0.5rem;\n\n .ListItem-button {\n align-items: center;\n text-align: left;\n padding: 0.5rem;\n }\n\n .Avatar {\n width: 3rem;\n height: 3rem;\n margin-right: 1rem;\n }\n\n .contact-name {\n font-size: 1rem;\n line-height: 1rem;\n margin-bottom: 0.25rem;\n font-weight: 500;\n }\n\n .contact-phone {\n font-size: 0.875rem;\n line-height: 1rem;\n color: var(--color-text-secondary);\n }\n }\n\n &[dir=rtl] {\n .multiline-menu-item {\n .title, .subtitle {\n text-align: right;\n }\n\n .date {\n float: left;\n margin-left: 0;\n margin-right: 1rem;\n }\n }\n }\n }\n\n .RangeSlider {\n margin-bottom: 1.0625rem;\n }\n\n .Checkbox, .radio-group {\n margin: 0 -1rem 0.5rem;\n }\n\n .radio-group {\n .Radio:last-child {\n margin-bottom: 0;\n }\n }\n\n .Radio + .Radio, .Checkbox + .Checkbox {\n margin-top: 2rem;\n }\n}\n\n.settings-fab-wrapper {\n height: calc(100% - var(--header-height));\n position: relative;\n overflow: hidden;\n\n .settings-content {\n height: 100%;\n }\n\n .FloatingActionButton {\n right: 1.5rem;\n }\n}\n\n.settings-edit-profile {\n padding: 0 1.5rem;\n}\n\n.username-link {\n color: var(--color-links);\n}\n","// @optimization\n@mixin while-transition() {\n .Transition > div:not(.active) &, body.animating-right-column & {\n @content;\n }\n}\n\n@mixin overflow-y-overlay() {\n @supports (overflow-y: overlay) {\n overflow-y: overlay;\n\n //Workaround for Android <= 9\n overflow-x: hidden;\n }\n}\n",".NewChat {\n height: 100%;\n overflow: hidden;\n position: relative;\n\n &-inner {\n height: calc(100% - var(--header-height));\n overflow: hidden;\n\n &.step-2 {\n padding: 0 1.25rem;\n display: flex;\n flex-direction: column;\n\n .note, .error {\n font-size: 0.875rem;\n line-height: 1.25rem;\n margin: 1.5rem 0.25rem;\n }\n\n .error {\n color: var(--color-error);\n }\n\n .note {\n margin-top: -0.5625rem;\n color: var(--color-text-secondary);\n }\n\n .chat-members-heading {\n color: var(--color-text-secondary);\n font-size: 1rem;\n font-weight: 500;\n margin: 1rem 0.25rem;\n }\n\n .chat-members-list {\n margin: 0 -1.25rem;\n padding: 0 1rem 1rem;\n\n overflow-x: hidden;\n flex-grow: 1;\n }\n }\n }\n}\n",".ArchivedChats {\n height: 100%;\n overflow: hidden;\n\n .chat-list {\n height: calc(100% - var(--header-height));\n }\n}\n",".MessageContextMenu {\n position: absolute;\n font-size: 1rem;\n\n .bubble {\n transform: scale(0.5);\n transition: opacity .15s cubic-bezier(0.2, 0, 0.2, 1), transform .15s cubic-bezier(0.2, 0, 0.2, 1) !important;\n }\n\n .backdrop {\n position: absolute;\n touch-action: none;\n }\n}\n",".StickerSetModal {\n .modal-dialog {\n width: 26.25rem;\n max-width: 100%;\n }\n\n @media (max-width: 600px) {\n .modal-dialog {\n width: 18.875rem;\n }\n }\n\n .modal-header {\n padding: 0.5rem 1rem;\n }\n\n .modal-content {\n text-align: center;\n padding: 0;\n }\n\n .stickers {\n position: relative;\n width: 100%;\n height: 19rem;\n max-height: 50vh;\n overflow-y: auto;\n padding: 0 0.25rem;\n text-align: left;\n }\n\n .button-wrapper {\n padding: 0.5rem 0;\n border-top: 1px solid var(--color-borders);\n box-shadow: 0 0 2px var(--color-default-shadow);\n\n button {\n display: inline-block;\n }\n }\n\n .Loading {\n width: 100%;\n height: 22.8125rem;\n max-height: calc(50vh + 3.8125rem);\n }\n}\n\n",".HeaderMenuContainer {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 100vh;\n z-index: var(--z-header-menu);\n\n .Menu {\n position: absolute;\n font-size: 1rem;\n\n .backdrop {\n z-index: var(--z-header-menu-backdrop);\n }\n\n .bubble {\n z-index: var(--z-header-menu);\n --offset-y: calc(100% + 1rem);\n }\n }\n}\n","#MobileSearch > .header {\n position: absolute;\n top: 0;\n left: 0;\n z-index: var(--z-mobile-search);\n width: 100%;\n height: 3.5rem;\n background: var(--color-background);\n display: flex;\n align-items: center;\n padding: 0 0.5rem 0 0.25rem;\n\n > .SearchInput {\n margin-left: 0.25rem;\n flex: 1;\n }\n}\n\n#MobileSearch > .footer {\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: var(--z-mobile-search);\n width: 100%;\n height: 3.5rem;\n background: var(--color-background);\n display: flex;\n align-items: center;\n padding-left: 1rem;\n padding-right: 0.5rem;\n\n > .counter {\n flex: 1;\n color: var(--color-text-secondary);\n }\n}\n\n#MobileSearch:not(.active) {\n .header, .footer {\n // `display: none` will prevent synchronous focus on iOS\n transform: translateX(-999rem);\n }\n}\n",".MentionTooltip {\n width: calc(100% - 4rem);\n max-width: 20rem;\n flex-direction: column;\n\n z-index: -1;\n\n @media (max-width: 600px) {\n width: calc(100% - 3rem);\n }\n\n .ListItem.chat-item-clickable {\n margin: 0;\n\n .ListItem-button {\n border-radius: 0;\n }\n\n .info {\n display: flex;\n }\n\n .title {\n margin-inline-end: .625rem;\n max-width: 70%;\n }\n\n .handle {\n font-size: 1rem;\n }\n\n &[dir=rtl] {\n .status {\n width: auto;\n }\n }\n }\n\n .ChatInfo {\n .title h3 {\n line-height: 1.25;\n }\n\n .Avatar {\n margin-right: 0.7em;\n }\n\n .handle {\n &::before {\n content: '@';\n }\n }\n\n .user-status {\n display: none !important;\n }\n }\n}\n",".AttachmentModal {\n --border-radius-default: 0.625rem;\n\n .modal-dialog {\n max-width: 26.25rem;\n @media(max-width: 600px) {\n max-height: 100%;\n padding-bottom: 1.5rem;\n }\n }\n\n .modal-content {\n padding: .5rem 1.25rem 1.875rem;\n max-height: calc(100vh - 3.25rem);\n @media(max-width: 600px) {\n padding-bottom: .25rem;\n }\n }\n\n .media-wrapper {\n max-height: 26rem;\n overflow: auto;\n display: flex;\n flex-wrap: wrap;\n margin-bottom: 1.5rem;\n\n video,\n img {\n flex: 1;\n width: calc(50% - 0.15rem);\n height: 12rem;\n margin-bottom: 0.3rem;\n border-radius: var(--border-radius-default);\n object-fit: cover;\n\n &:only-child {\n height: auto;\n max-height: 25rem;\n margin-bottom: 0;\n }\n\n &:nth-child(even) {\n margin-left: 0.3rem;\n }\n }\n }\n\n .document-wrapper {\n max-height: 25rem;\n overflow: auto;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n margin: .75rem 0 1.75rem;\n\n .File:not(:last-child) {\n margin-bottom: 1.5rem;\n }\n\n .file-icon {\n cursor: default !important;\n }\n }\n\n .attachment-caption-wrapper {\n position: relative;\n\n .form-control {\n background: var(--color-background);\n }\n\n .MentionTooltip {\n right: 0 !important;\n z-index: 0;\n }\n }\n\n .drop-target {\n position: relative;\n\n &::before,\n &::after {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n border-radius: var(--border-radius-default);\n pointer-events: none;\n\n opacity: 0;\n transition: 250ms opacity;\n z-index: 1;\n }\n\n &::before {\n background-image: var(--drag-target-border-hovered);\n background-color: var(--color-background);\n }\n\n &::after {\n content: attr(data-attach-description);\n display: flex;\n justify-content: center;\n align-items: center;\n color: var(--color-primary);\n }\n }\n\n &.hovered {\n .drop-target::before {\n opacity: .95;\n }\n\n .drop-target::after {\n opacity: 1;\n }\n\n .attachment-caption-wrapper,\n .document-wrapper,\n .media-wrapper {\n pointer-events: none;\n }\n\n .document-wrapper,\n .media-wrapper {\n border-radius: var(--border-radius-default);\n }\n }\n}\n",".PollModal {\n .modal-dialog {\n max-width: 26.25rem;\n max-height: calc(100vh - 5rem);\n }\n\n .modal-content {\n padding: .5rem 1.25rem 1.875rem;\n min-height: 4.875rem;\n }\n\n .modal-header-condensed {\n margin-bottom: 1rem;\n }\n\n .options-header {\n color: var(--color-text-secondary);\n font-size: 1rem;\n font-weight: 500;\n margin: 1.5rem 0.25rem;\n }\n\n .options-list {\n margin: 1rem -0.75rem -0.5rem;\n padding: 0 0.75rem;\n border-top: 1px solid var(--color-chat-hover);\n max-height: 20rem;\n overflow: auto;\n\n &.overflown {\n padding: 0 0.4rem 0.5rem 0.75rem;\n }\n\n @media (max-width: 600px) {\n overflow: hidden;\n max-height: none;\n\n &, &.overflown {\n padding: 0 0.75rem;\n }\n }\n }\n\n .option-wrapper {\n position: relative;\n\n .form-control {\n padding-right: 3rem;\n }\n\n .option-remove-button {\n position: absolute;\n top: 0.3125rem;\n right: 0.3125rem;\n }\n }\n\n .quiz-mode {\n margin-top: 1.5rem;\n\n .options-header {\n margin-bottom: 0.5rem;\n }\n\n .note {\n margin-top: 0.5rem;\n }\n }\n\n .note {\n font-size: smaller;\n color: var(--color-text-secondary)\n }\n\n .error {\n font-size: smaller;\n color: var(--color-error);\n margin: -1rem 0 1rem .25rem;\n }\n\n .input-group:last-child {\n margin-bottom: 0.5rem;\n }\n}\n",".EmojiButton {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2.5rem;\n height: 2.5rem;\n margin: 0.125rem;\n border-radius: var(--border-radius-messages-small);\n cursor: pointer;\n font-size: 1.75rem;\n line-height: 2.5rem;\n background-color: transparent;\n transition: background-color .15s ease;\n\n .mac-os-fix & {\n line-height: inherit;\n }\n\n &.focus,\n &:hover {\n background-color: var(--color-background-selected);\n }\n\n & > img {\n width: 2rem;\n height: 2rem;\n }\n}\n",".EmojiPicker {\n height: 100%;\n\n &-main {\n height: calc(100% - 3rem);\n overflow-y: auto;\n padding: 0.5rem;\n\n @media (max-width: 600px) {\n padding: 0.5rem 0.25rem;\n }\n\n .symbol-set-container {\n display: flex;\n flex-wrap: wrap;\n }\n }\n\n &-header {\n height: 3rem;\n border-bottom: 1px solid var(--color-borders);\n display: flex;\n align-items: center;\n justify-content: space-around;\n box-shadow: 0 0 2px var(--color-default-shadow);\n\n @media (max-width: 600px) {\n overflow-x: auto;\n overflow-y: hidden;\n display: block;\n white-space: nowrap;\n padding: 0.4375rem 0;\n\n scrollbar-width: none;\n scrollbar-color: rgba(0, 0, 0, 0);\n\n &::-webkit-scrollbar {\n height: 0;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0);\n }\n\n .symbol-set-button {\n display: inline-flex;\n vertical-align: middle;\n }\n\n // Spacer to counter last button margin not being accounted in scroll width\n &::after {\n content: \"\";\n display: block;\n flex-shrink: 0;\n width: 0.1px;\n height: 1rem;\n }\n }\n }\n}\n",".StickerPicker {\n height: 100%;\n\n &-main {\n position: relative;\n height: calc(100% - 3rem);\n overflow-y: auto;\n padding: 0.5rem;\n\n @media (max-width: 600px) {\n padding: 0.5rem 0.25rem;\n }\n }\n\n &-header {\n height: 3rem;\n border-bottom: 1px solid var(--color-borders);\n padding: 0.125rem 0;\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n box-shadow: 0 0 2px var(--color-default-shadow);\n\n scrollbar-width: none;\n scrollbar-color: rgba(0, 0, 0, 0);\n\n &::-webkit-scrollbar {\n height: 0;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0);\n }\n\n // Spacer to counter last button margin not being accounted in scroll width\n &::after {\n content: \"\";\n display: block;\n flex-shrink: 0;\n width: 0.1px;\n height: 1rem;\n }\n\n\n .sticker-set-button {\n display: inline-flex;\n vertical-align: middle;\n\n &.StickerButton {\n background-size: 2rem;\n\n img, .AnimatedSticker {\n top: 0.375rem;\n left: 0.375rem;\n width: 2rem;\n height: 2rem;\n }\n }\n\n .sticker-set-cover {\n width: 2rem;\n height: 2rem;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n\n img, .AnimatedSticker {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n }\n }\n }\n }\n\n .symbol-set-container {\n width: 25rem;\n line-height: 0;\n\n @media (max-width: 600px) {\n width: 100%;\n }\n }\n\n .sticker-set-button {\n width: 2.75rem !important;\n height: 2.75rem;\n margin: 0 0.25rem;\n border-radius: var(--border-radius-messages-small);\n }\n}\n",".GifButton {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 6.25rem;\n background-color: transparent;\n cursor: pointer;\n overflow: hidden;\n position: relative;\n\n &:last-child {\n margin-bottom: 1rem;\n }\n\n &.vertical {\n grid-column-end: span 1;\n }\n\n &.horizontal {\n grid-column-end: span 2;\n }\n\n .thumbnail {\n width: 100%;\n height: 100%;\n background-size: cover !important;\n background: transparent no-repeat center;\n }\n\n .preview, video {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n .Spinner {\n position: absolute;\n pointer-events: none;\n }\n}\n",".GifPicker {\n display: grid;\n grid-template-columns: repeat(6, 1fr);\n grid-auto-rows: 6.25rem;\n grid-gap: 0.25rem;\n grid-auto-flow: dense;\n height: 100%;\n overflow-y: auto;\n padding: 0.25rem;\n\n .Loading, .picker-disabled {\n grid-column: 1 / -1;\n height: var(--menu-height);\n }\n}\n","@import '../../../styles/mixins';\n\n.SymbolMenu {\n &.mobile-menu {\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n background: var(--color-background);\n transform: translate3d(0, calc(var(--symbol-menu-height) + var(--symbol-menu-footer-height)), 0);\n z-index: 1;\n\n transition: transform var(--layer-transition);\n\n &.open {\n transform: translate3d(0, 0, 0);\n\n body.is-media-viewer-open & {\n transform: translate3d(0, calc(var(--symbol-menu-height) + var(--symbol-menu-footer-height)), 0);\n }\n }\n\n body.animation-level-0 & {\n transition: none;\n }\n\n &:not(.middle-column-open) {\n transform: translate3d(100vw, 0, 0) !important;\n }\n }\n\n &-main {\n width: var(--symbol-menu-width);\n height: var(--symbol-menu-height);\n max-height: calc(100vh - var(--symbol-menu-footer-height));\n }\n\n &-footer {\n height: var(--symbol-menu-footer-height);\n border-top: 1px solid var(--color-borders);\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 0 2px var(--color-default-shadow);\n position: relative;\n\n .Button {\n flex-shrink: 0;\n width: 2.125rem !important;\n height: 2.125rem;\n margin: 0 .25rem;\n padding: 0;\n\n &.activated {\n pointer-events: none;\n }\n\n &.symbol-tab-button {\n margin: 0 0.75rem;\n }\n\n &.symbol-search-button {\n position: absolute;\n left: 0.25rem;\n }\n\n &.symbol-delete-button {\n position: absolute;\n right: 0.25rem;\n }\n }\n }\n\n .Transition.slide {\n height: 100%;\n\n .Loading {\n height: var(--symbol-menu-height);\n }\n }\n\n .is-pointer-env & {\n > .backdrop {\n position: absolute;\n top: -1rem;\n left: 0;\n right: auto;\n width: 3.5rem;\n height: 4.5rem;\n }\n }\n\n .Button.bot-commands ~ & {\n .is-pointer-env & > .backdrop {\n left: 3rem;\n width: 3.25rem;\n }\n }\n\n .bubble {\n padding: 0;\n width: var(--symbol-menu-width);\n overflow: hidden;\n }\n\n .picker-disabled {\n height: var(--symbol-menu-height);\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color-text-secondary);\n }\n\n .symbol-close-button {\n display: none;\n position: absolute;\n right: .25rem;\n top: .25rem;\n }\n\n @media (orientation: landscape) {\n .symbol-close-button {\n display: block;\n }\n }\n}\n\n.symbol-set {\n margin-bottom: 1rem;\n\n &-name {\n font-size: 1rem;\n line-height: 1.6875rem;\n font-weight: 500;\n margin: 0;\n padding-left: 0.5rem;\n color: rgba(var(--color-text-secondary-rgb), 0.75);\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-align: initial;\n unicode-bidi: plaintext;\n }\n\n &-container {\n text-align: initial;\n }\n\n &-button {\n flex-shrink: 0;\n width: 2.125rem !important;\n height: 2.125rem;\n margin: 0 0.25rem;\n padding: 0;\n }\n\n @include while-transition() {\n overflow: hidden;\n }\n\n .symbol-set-container {\n &:not(.shown) {\n display: block;\n }\n\n &.closing {\n transition: none;\n }\n }\n}\n",".AttachMenu {\n position: relative;\n\n .is-pointer-env & {\n > .backdrop {\n position: absolute;\n top: -1rem;\n left: auto;\n right: 0;\n width: 3.5rem;\n }\n }\n\n\n .media-disabled > button {\n white-space: normal;\n }\n}\n",".BotCommand {\n margin: 0 !important;\n\n .ListItem-button {\n border-radius: 0;\n }\n\n .multiline-item {\n padding: 0 1rem;\n\n .subtitle {\n padding-top: .25rem;\n line-height: 1.3125;\n }\n }\n\n &.with-avatar {\n .multiline-item {\n padding: 0;\n display: flex;\n }\n\n .content-inner {\n flex: 1;\n }\n }\n}\n",".BotCommandTooltip {\n width: calc(100% - 4rem);\n max-width: 26rem;\n flex-direction: column;\n\n z-index: -1;\n\n @media (max-width: 600px) {\n width: calc(100% - 3rem);\n }\n}\n",".BotCommandMenu {\n .menu-container {\n width: calc(100% - 4rem);\n max-width: 20rem;\n max-height: 40vh;\n overflow: auto;\n flex-direction: column;\n\n @media (max-width: 600px) {\n width: calc(100% - 3rem);\n }\n }\n\n .is-pointer-env & {\n > .backdrop {\n position: absolute;\n top: -1rem;\n left: 0;\n right: auto;\n width: 3.5rem;\n height: 4.5rem;\n }\n }\n}\n",".StickerTooltip {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr));\n grid-auto-rows: auto;\n place-items: center;\n\n &.hidden {\n display: none;\n }\n}\n",".CustomSendMenu {\n position: relative;\n bottom: 3.5rem;\n\n .is-pointer-env & {\n > .backdrop {\n position: absolute;\n top: -1rem;\n left: auto;\n right: 0;\n width: 3.5rem;\n }\n }\n\n\n .media-disabled > button {\n white-space: normal;\n }\n\n .bubble {\n width: 16rem;\n }\n}\n",".EmojiTooltip {\n display: flex;\n padding-left: .25rem;\n\n overflow-x: auto;\n @supports (overflow-x: overlay) {\n overflow-x: overlay;\n }\n overflow-y: hidden;\n\n .EmojiButton {\n flex: 0 0 2.5rem\n }\n}\n",".BaseResult {\n &.chat-item-clickable > .ListItem-button {\n padding-left: 1.25rem !important;\n padding-right: 1.25rem !important;\n\n .title {\n display: block;\n text-overflow: ellipsis;\n }\n }\n\n .thumb {\n background-color: var(--color-background-secondary);\n flex: 0 0 3rem;\n width: 3rem;\n height: 3rem;\n line-height: 3rem;\n border-radius: var(--border-radius-default-tiny);\n display: inline-flex;\n align-content: center;\n justify-content: center;\n margin-inline-end: .5rem;\n overflow: hidden;\n font-size: 1.5rem;\n\n img:not(.emoji) {\n width: 100%;\n object-fit: cover;\n }\n\n img.emoji {\n width: 1.5rem;\n height: 1.5rem;\n margin: .75rem 0 0;\n }\n }\n\n .content-inner {\n min-width: 0;\n }\n\n .title {\n font-weight: 500;\n text-align: left;\n unicode-bidi: plaintext;\n }\n\n .description {\n white-space: normal;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n text-align: left;\n unicode-bidi: plaintext;\n }\n &[dir=rtl] .title,\n &[dir=rtl] .description {\n text-align: right;\n }\n}\n",".MediaResult {\n height: 0;\n padding-bottom: 100%;\n overflow: hidden;\n position: relative;\n cursor: pointer;\n\n img {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n}\n",".InlineBotTooltip {\n .switch-pm .title {\n margin: 0 auto;\n font-weight: 500;\n }\n\n --border-radius-default: 0;\n\n &.gallery {\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n grid-gap: 1px;\n padding: 0;\n\n @media (max-width: 600px) {\n grid-template-columns: repeat(3, 1fr);\n }\n\n .switch-pm {\n grid-column: 1 / -1;\n .ListItem-button {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n }\n }\n\n .GifButton {\n grid-column-end: initial;\n }\n\n .StickerButton {\n width: initial;\n height: 0;\n margin: 0;\n padding-bottom: 100%;\n border-radius: 0;\n\n .AnimatedSticker, img, canvas {\n position: absolute;\n top: 0;\n left: 0;\n width: 100% !important;\n height: 100% !important;\n\n @media (min-width: 600px) {\n top: .25rem;\n left: .25rem;\n width: calc(100% - .5rem) !important;\n height: calc(100% - .5rem) !important;\n }\n }\n }\n }\n}\n",".RightSearch {\n height: 100%;\n padding: 0 0.5rem;\n overflow-y: auto;\n\n .helper-text {\n padding: 1rem;\n margin-bottom: 0.125rem;\n font-weight: 500;\n color: var(--color-text-secondary);\n unicode-bidi: plaintext;\n text-align: initial;\n }\n}\n",".StickerSearch {\n height: 100%;\n padding: 0 0.5rem;\n overflow-y: auto;\n\n .helper-text {\n padding: 1rem;\n margin-bottom: 0.125rem;\n font-weight: 500;\n color: var(--color-text-secondary);\n }\n\n .sticker-set {\n margin-bottom: 1rem;\n\n &-header {\n display: flex;\n justify-content: space-between;\n padding: 0.5rem;\n\n .title-wrapper {\n overflow: hidden;\n }\n\n .title {\n font-size: 1rem;\n line-height: 1.6875rem;\n margin: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n\n .count {\n color: var(--color-text-secondary);\n margin: 0;\n }\n\n .Button {\n flex-shrink: 0;\n margin-left: 1rem;\n\n &.is-added {\n background: var(--color-chat-hover);\n color: var(--color-text-secondary);\n\n &:hover, &:active {\n background: var(--color-item-active) !important;\n }\n }\n }\n }\n\n &-main {\n display: flex;\n flex-wrap: nowrap;\n overflow: hidden;\n }\n\n &[dir=rtl] {\n .title-wrapper {\n text-align: right;\n }\n\n .Button {\n margin-left: 0;\n margin-right: 1rem;\n }\n }\n }\n\n .StickerButton {\n margin: 0.125rem;\n }\n}\n",".GifSearch {\n height: 100%;\n padding: 0.25rem;\n\n .gif-container {\n height: 100%;\n overflow: auto;\n\n &.grid {\n display: grid;\n grid-template-columns: repeat(6, 1fr);\n grid-auto-rows: 6.25rem;\n grid-gap: 0.25rem;\n grid-auto-flow: dense;\n }\n }\n\n .helper-text {\n color: var(--color-text-meta);\n margin-top: 2rem;\n text-align: center;\n }\n}\n",".PollAnswerResults {\n border-bottom: 1px solid var(--color-borders);\n padding: 0 .5rem .625rem;\n display: flex;\n flex-direction: column-reverse;\n\n .answer-head {\n display: flex;\n align-items: center;\n font-size: .9375rem;\n line-height: 1.3125rem;\n font-weight: 500;\n color: var(--color-text-secondary);\n padding: 1rem .75rem .5rem 1rem;\n position: sticky;\n top: 0;\n background: var(--color-background);\n\n @media (max-width: 600px) {\n padding: .5rem .25rem .5rem .5rem;\n }\n }\n\n .answer-percent {\n margin-left: auto;\n\n &[dir=auto] {\n margin-left: 0;\n margin-right: auto;\n }\n }\n\n .poll-voters {\n padding: 0 .75rem;\n position: relative;\n min-height: 3rem;\n\n @media (max-width: 600px) {\n padding: 0 .25rem;\n }\n\n .Spinner {\n --spinner-size: 1.25rem;\n }\n }\n\n .chat-item-clickable {\n .ChatInfo .Avatar.size-tiny {\n margin-right: 1.75rem;\n }\n\n &[dir=rtl] {\n .ChatInfo .Avatar.size-tiny {\n margin-left: 1.75rem;\n margin-right: 0;\n }\n }\n }\n\n .ShowMoreButton {\n margin: .25rem 0 0 -0.5rem;\n width: calc(100% + 1rem);\n\n &[dir=rtl] {\n .icon-down {\n margin-left: 2rem;\n margin-right: 0;\n }\n }\n }\n\n .icon-down {\n vertical-align: middle;\n margin-right: 2rem;\n font-size: 1.5rem;\n }\n}\n",".PollResults {\n height: 100%;\n position: relative;\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n\n > .Loading {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n background: rgba(white, 0.75);\n }\n\n .poll-question {\n padding: .75rem 1.5rem;\n flex-shrink: 0;\n font-size: 1.25rem;\n\n @media (max-width: 600px) {\n padding: 0 1rem;\n }\n }\n\n .poll-results-list {\n border-top: 1px solid var(--color-borders);\n flex-grow: 1;\n overflow: auto;\n }\n}\n",".Management {\n position: relative;\n height: 100%;\n\n & > .custom-scroll {\n height: 100%;\n overflow-y: scroll;\n overflow-x: hidden;\n }\n\n .section {\n padding: 1rem 1.5rem;\n border-top: 1px solid var(--color-borders);\n\n &.wide {\n padding: 1.5rem;\n }\n\n &:first-of-type {\n border-top: none;\n padding-top: 1rem;\n }\n\n &.no-border {\n border-top: none;\n }\n\n > .ChatInfo {\n margin: 0 0 2rem !important;\n\n .title h3 {\n margin-bottom: 0;\n }\n }\n\n .section-icon {\n width: 8.75rem;\n height: 8.75rem;\n margin: 0 auto 2rem;\n position: relative;\n\n .AnimatedSticker {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n\n &.hidden {\n display: none\n }\n }\n }\n\n .ListItem {\n margin: 0 -.75rem;\n\n &:last-child {\n margin-bottom: 0;\n }\n\n .multiline-item .subtitle {\n line-height: 1.25rem;\n }\n\n &:not(.picker-list-item) .Checkbox {\n margin-top: 2rem;\n margin-bottom: 2rem;\n }\n\n &.narrow {\n .Checkbox {\n margin-top: 1rem;\n margin-bottom: 1rem;\n }\n }\n\n &.exceptions-member {\n .ChatInfo .status {\n white-space: pre-wrap;\n }\n }\n }\n\n .section-heading {\n font-weight: 500;\n font-size: .9375rem;\n color: var(--color-text-secondary);\n\n &[dir=auto] {\n text-align: initial;\n }\n }\n\n .section-help {\n color: var(--color-text-secondary);\n line-height: 1.375rem;\n\n &[dir=auto] {\n text-align: initial;\n }\n }\n\n .section-info {\n color: var(--color-text-secondary);\n font-size: .875rem;\n }\n\n &[dir=rtl] {\n text-align: right;\n }\n }\n\n textarea.form-control {\n height: auto;\n }\n\n .group-link {\n color: var(--color-text);\n }\n\n .radio-group {\n margin-top: 2rem;\n\n .Radio {\n padding-left: 3.5rem;\n margin-bottom: 2rem;\n\n &:last-child {\n margin-bottom: .625rem;\n }\n }\n\n .Radio-main {\n &::before {\n left: 0.125rem;\n top: .25rem;\n transform: none;\n }\n\n &::after {\n left: 0.4375rem;\n top: .5625rem;\n transform: none;\n }\n }\n }\n}\n\n.ManageGroupMembers {\n padding: 0.5rem 1rem;\n}\n",".ShippingInfo {\n padding: 0.5rem 1rem;\n\n h5 {\n font-size: 0.9rem;\n color: var(--color-text-secondary);\n margin: 1rem 0 1.1rem;\n }\n}",".Shipping {\n padding: 0.5rem 1rem;\n\n form {\n p {\n color: var(--color-text-secondary);\n font-weight: 500;\n margin: .5rem 0 2rem;\n }\n\n .Radio {\n margin-bottom: 2rem;\n }\n }\n}",".Checkout {\n padding: 0.5rem 0;\n\n .description {\n display: flex;\n flex-direction: row;\n margin: 0 1rem;\n\n img {\n height: 6rem;\n margin: .5rem;\n }\n\n .text {\n h5 {\n margin-top: .5rem;\n font-size: 1.125rem;\n }\n\n p {\n font-size: 0.8rem;\n line-height: 1rem;\n color: var(--color-text-secondary);\n }\n }\n }\n\n .price-info {\n margin: 1rem;\n\n .price-info-item {\n margin: 1rem .5rem;\n display: flex;\n flex-direction: row;\n align-content: space-between;\n color: var(--color-text-secondary);\n font-weight: 500;\n \n &-main{\n color: var(--color-text);\n }\n \n .title {\n display: flex;\n flex: 1 auto;\n }\n }\n }\n\n .invoice-info {\n border-top: 1px var(--color-borders) solid;\n padding: 1rem;\n\n .checkout-info-item {\n display: flex;\n padding: .75rem .5rem 1rem;\n text-align: left;\n\n i {\n font-size: 1.5rem;\n color: var(--color-text-secondary);\n margin-right: 2rem;\n width: 1.5rem;\n }\n\n i.stripe-provider {\n background: url('../../assets/stripe-logo.png') no-repeat center;\n background-size: 2rem;\n border-radius: 1rem;\n height: 1.5rem;\n }\n\n .info {\n .title {\n font-size: 1rem;\n line-height: 1.4375rem;\n margin-bottom: 0;\n font-weight: 400;\n word-break: break-word;\n color: var(--color-text);\n text-transform: capitalize;\n }\n\n .data {\n margin-bottom: 0;\n font-size: 0.875rem;\n color: var(--color-text-secondary);\n }\n }\n }\n }\n \n}",".CardInput {\n position: relative;\n\n .input-group.has-left-addon .form-control{\n padding-left: 4rem;\n }\n\n .left-addon {\n position: absolute;\n top: .8rem;\n left: 1rem;\n z-index: 8;\n\n img {\n max-width: 2rem;\n }\n }\n}\n",".PaymentInfo {\n padding: 0.5rem 1rem;\n\n h5 {\n font-size: 0.9rem;\n color: var(--color-text-secondary);\n margin: 1rem 0 1.1rem;\n }\n\n .inline-inputs {\n display: flex;\n justify-content: space-between;\n\n .input-group {\n flex: 1 10rem;\n max-width: 45%;\n display: flex;\n }\n }\n}\n",".PaymentModal {\n .modal-backdrop {\n pointer-events: none;\n }\n\n .header {\n position: relative;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n width: 100%;\n padding: .25rem 1rem;\n display: flex;\n align-items: center;\n flex-direction: row;\n background: var(--color-background);\n border-bottom: 1px var(--color-borders) solid;\n\n h3 {\n margin-bottom: 0;\n margin-left: 1.5rem;\n unicode-bidi: plaintext;\n text-align: initial;\n }\n }\n\n .Transition {\n height: 25rem;\n }\n\n .empty-content {\n height: 25rem;\n max-height: 90%;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .receipt-content {\n height: 25rem;\n overflow-y: auto;\n }\n\n .content {\n overflow: auto;\n width: 100%;\n height: 100%;\n position: relative;\n }\n\n .footer {\n position: relative;\n border-bottom-left-radius: 10px;\n border-bottom-right-radius: 10px;\n width: 100%;\n padding: .75rem 1rem;\n background: var(--color-background);\n border-top: 1px var(--color-borders) solid;\n\n button {\n text-transform: none;\n font-weight: 500;\n }\n }\n\n .modal-dialog {\n width: 25rem;\n }\n\n .modal-content {\n padding:0;\n overflow: hidden;\n }\n}\n\n@media screen\n and (max-device-width: 640px)\n and (max-height: 640px)\n and (orientation: landscape) {\n .PaymentModal {\n .modal-dialog {\n max-height: 100%;\n }\n\n .Transition {\n height: 10rem;\n }\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/860.71a26210d53a0e37c47e.js b/dist/860.71a26210d53a0e37c47e.js new file mode 100644 index 00000000..30678b43 --- /dev/null +++ b/dist/860.71a26210d53a0e37c47e.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[860],{860:(e,t,n)=>{n.r(t),n.d(t,{ArchivedChats:()=>Ta,AttachMenu:()=>$s,AttachmentModal:()=>ls,BotCommandMenu:()=>xs,BotCommandTooltip:()=>Us,CalendarModal:()=>$e,ContactList:()=>ya,ContextMenuContainer:()=>Ja,CustomSendMenu:()=>Gs,DeleteMessageModal:()=>Ue,Dialogs:()=>Se,DropArea:()=>Js.Z,EmojiTooltip:()=>Ys,ForwardPicker:()=>be,GifSearch:()=>rr,HeaderMenuContainer:()=>Ya,HistoryCalendar:()=>De,InlineBotTooltip:()=>Ws,LeftSearch:()=>At,Management:()=>Sr,MediaViewer:()=>me,MentionTooltip:()=>os,MessageSelectToolbar:()=>Ye,MobileSearch:()=>ja,NewChat:()=>ka,NewChatStep1:()=>Sa,NewChatStep2:()=>Na,Notifications:()=>we,PaymentModal:()=>qr,PinMessageModal:()=>xe,PollModal:()=>ds,PollResults:()=>ir,ReceiptModal:()=>eo,RightSearch:()=>er,SafeLinkModal:()=>Te,Settings:()=>fa,StickerSearch:()=>sr,StickerSetModal:()=>za,StickerTooltip:()=>Os,SymbolMenu:()=>Bs,TextFormatter:()=>zs.Z,UnpinAllMessagesModal:()=>Oe});var a=n(4050),s=n(5116),r=n(6137),o=n(1713),i=n(3716),l=n(7361),c=n(3858),d=n(4399),m=n(8085),u=n(2858),h=n(782),Z=n(1174),P=n(3989),g=n(396),v=n(5326),p=n(6202),E=n(2761),C=n(2937),f=n(7204),b=n(8674),y=n(935);function I(e,t){const n=document.createElement("div");n.classList.add("ghost");const a=new Image;if("string"==typeof e?a.src=e:e instanceof HTMLVideoElement?a.src=e.poster:a.src=e.src,n.appendChild(a),t===o.bZ.ProfileAvatar||t===o.bZ.SettingsAvatar){n.classList.add("ProfileInfo"),t===o.bZ.SettingsAvatar&&n.classList.add("self");const e=document.querySelector(t===o.bZ.ProfileAvatar?"#RightColumn .ProfileInfo .info":"#Settings .ProfileInfo .info");e&&n.appendChild(e.cloneNode(!0))}return n}function S(e,t){const n=document.querySelector(".active > .MessageList");let a=e.offsetTop+t.closest(".content-inner, .WebPage").offsetTop;return e.id.includes("album-media-")&&(a+=e.parentElement.offsetTop+e.closest(".Message").offsetTop),a>n.scrollTop&&a+t.offsetHeight .MessageList #album-media-${t.id}`,a=".full-media";break;case o.bZ.SharedMedia:n=`#shared-media${t.id}`,a="img";break;case o.bZ.SearchResult:n=`#search-media${t.id}`,a="img";break;case o.bZ.MiddleHeaderAvatar:n=".MiddleHeader .ChatInfo .Avatar",a="img.avatar-media";break;case o.bZ.SettingsAvatar:n="#Settings .ProfileInfo .active .ProfilePhoto",a="img.avatar-media";break;case o.bZ.ProfileAvatar:n="#RightColumn .ProfileInfo .active .ProfilePhoto",a="img.avatar-media";break;case o.bZ.ScheduledInline:case o.bZ.Inline:default:n=`.active > .MessageList #message${t.id}`,a=".message-content .full-media, .message-content .thumbnail"}const s=document.querySelector(n),r=s&&s.querySelectorAll(a);return{container:s,mediaEl:null==r?void 0:r[r.length-1]}}function k(e,t){switch(t){case o.bZ.Album:case o.bZ.ScheduledAlbum:case o.bZ.Inline:case o.bZ.ScheduledInline:e.classList.add("rounded-corners");break;case o.bZ.SharedMedia:case o.bZ.SettingsAvatar:case o.bZ.ProfileAvatar:case o.bZ.SearchResult:e.firstChild.style.objectFit="cover";break;case o.bZ.MiddleHeaderAvatar:e.classList.add("circle")}}var M=n(9107),T=n(6590),F=n(9204),A=n(126),L=n(2255),R=n(231),B=n(790),$=n(2340),D=n(172);const U=(0,s.c$)(((e,{chatId:t,messageId:n,isAvatar:a})=>{if(a&&t)return{sender:(0,u.YA)(t)?(0,m.dy)(e,t):(0,m.Z1)(e,t)};if(!n||!t)return{};const s=(0,m.hj)(e,t,n);return{message:s,sender:s&&(0,m.Ur)(e,s)}}),((e,t)=>(0,h.ei)(t,["closeMediaViewer","focusMessage"])))((({chatId:e,messageId:t,sender:n,isAvatar:s,message:r,closeMediaViewer:o,focusMessage:i})=>{const l=(0,a.I4)((()=>{o(),i({chatId:e,messageId:t})}),[e,i,t,o]),c=(0,M.Z)();if(!n||!r&&!s)return;const d=n.id<0,m=(0,u.OU)(c,n);return a.ZP.createElement("div",{className:"SenderInfo",onClick:l},d?a.ZP.createElement(D.Z,{key:n.id,size:"medium",chat:n}):a.ZP.createElement(D.Z,{key:n.id,size:"medium",user:n}),a.ZP.createElement("div",{className:"meta"},a.ZP.createElement("div",{className:"title",dir:"auto"},m&&(0,$.Z)(m)),a.ZP.createElement("div",{className:"date",dir:"auto"},s?c("lng_mediaview_profile_photo"):(0,B.ZK)(c,1e3*r.date))))}));var x=n(2619),O=n(3106),G=n(8964),J=n(9196);const z=({mediaData:e,isVideo:t,isZoomed:n,message:s,fileName:r,isAvatar:o,onCloseMediaViewer:i,onForward:c,onZoomToggle:d})=>{const{isDownloadStarted:m,downloadProgress:h,handleDownloadClick:Z}=(0,x.Z)(s&&t?(0,u.Ti)(s,"download"):void 0,r),P=(0,M.Z)(),g=(0,a.Ye)((()=>({onTrigger:e,isOpen:t})=>a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",className:t?"active":void 0,onClick:e,ariaLabel:"More actions"},a.ZP.createElement("i",{className:"icon-more"}))),[]);return l.wB?a.ZP.createElement("div",{className:"MediaViewerActions-mobile"},a.ZP.createElement(O.Z,{trigger:g,positionX:"right"},!o&&a.ZP.createElement(G.Z,{icon:"forward",onClick:c},P("Forward")),t?a.ZP.createElement(G.Z,{icon:m?"close":"download",onClick:Z},m?`${Math.round(100*h)}% Downloading...`:"Download"):a.ZP.createElement(G.Z,{icon:"download",href:e,download:r},P("AccActionDownload"))),m&&a.ZP.createElement(J.Z,{progress:h,size:"s",noCross:!0})):a.ZP.createElement("div",{className:"MediaViewerActions"},!o&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:P("Forward"),onClick:c},a.ZP.createElement("i",{className:"icon-forward"}))),t?a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:P("AccActionDownload"),onClick:Z},m?a.ZP.createElement(J.Z,{progress:h,size:"s",onClick:Z}):a.ZP.createElement("i",{className:"icon-download"})):a.ZP.createElement(R.Z,{href:e,download:r,round:!0,size:"smaller",color:"translucent-white",ariaLabel:P("AccActionDownload")},a.ZP.createElement("i",{className:"icon-download"})),a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:n?"Zoom Out":"Zoom In",onClick:d},a.ZP.createElement("i",{className:n?"icon-zoom-out":"icon-zoom-in"})),a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:P("Close"),onClick:i},a.ZP.createElement("i",{className:"icon-close"})))};var X=n(9118),Y=n(6752);const _=({text:e="",isHidden:t,isForVideo:n,onClick:s})=>{const[r,o]=(0,a.eJ)(!1);(0,a.d4)((()=>{const e=document.querySelector(".MediaViewerFooter .media-text"),t=()=>{const t=e?e.clientHeight:0;o(t>2*d.Gw)};t();const n=(0,X.P2)(t,500,!0);return window.addEventListener("resize",n,!1),()=>{window.removeEventListener("resize",n,!1)}}),[]);const i=(0,Y.Z)("MediaViewerFooter",n&&"is-for-video",t&&"is-hidden");return a.ZP.createElement("div",{className:i,onClick:function(t){e&&t.stopPropagation()}},e&&a.ZP.createElement("div",{className:"media-viewer-footer-content",onClick:l.wB?void 0:s},a.ZP.createElement("p",{className:"media-text custom-scroll "+(r?"multiline":""),dir:"auto"},e)))};var H=n(1212),j=n(2019);const V=void 0!==document.fullscreenElement?"fullscreenElement":void 0!==document.mozFullScreenElement?"mozFullScreenElement":void 0!==document.webkitFullscreenElement?"webkitFullscreenElement":"";var K=n(6898),q=n(4753);const W=["bytes","kB","MB","GB","TB","PB"],Q=e=>{const t=0===e?0:Math.floor(Math.log(e)/Math.log(1024));return`${(e/1024**Math.floor(t)).toFixed(1)} ${W[t]}`},ee=e=>{e.stopPropagation()},te=({bufferedProgress:e,currentTime:t,duration:n,fileSize:s,isForceVisible:r,isForceMobileVersion:o,isPlayed:i,isFullscreenSupported:c,isFullscreen:d,onChangeFullscreen:m,onPlayPause:u,onSeek:h})=>{const[Z,P]=(0,a.eJ)(!0);(0,a.d4)((()=>{r&&P(r)}),[r]),(0,a.d4)((()=>{let e;return r||(l.wB?P(!1):e=window.setTimeout((()=>{P(!1)}),800)),()=>{e&&window.clearTimeout(e)}}),[r]),(0,a.d4)((()=>((Z||r)&&document.body.classList.add("video-controls-visible"),()=>{document.body.classList.remove("video-controls-visible")})),[r,Z]);const g=(0,M.Z)();var v,p;if(Z||r)return a.ZP.createElement("div",{className:"VideoPlayerControls "+(o?"mobile":""),onClick:ee},function(e,t,n,s){const r=e/t*100,o=100*n;return a.ZP.createElement("div",{className:"player-seekline"},a.ZP.createElement("div",{className:"player-seekline-track"},a.ZP.createElement("div",{className:"player-seekline-buffered",style:`width: ${o||0}%`}),a.ZP.createElement("div",{className:"player-seekline-played",style:`width: ${r||0}%`}),a.ZP.createElement("input",{min:"0",max:"100",step:.01,type:"range",onInput:s,className:"player-seekline-input",value:r||0})))}(t,n,e,h),a.ZP.createElement(R.Z,{ariaLabel:g("AccActionPlay"),size:"tiny",ripple:!l.wB,color:"translucent-white",className:"play",onClick:u},a.ZP.createElement("i",{className:i?"icon-pause":"icon-play"})),function(e,t){return a.ZP.createElement("div",{className:"player-time"},`${(0,B.k9)(e)} / ${(0,B.k9)(t)}`)}(t,n),e<1&&(v=e,p=s,a.ZP.createElement("div",{className:"player-file-size"},`${Q(p*v)} / ${Q(p)}`)),c&&a.ZP.createElement(R.Z,{ariaLabel:"Fullscreen",size:"tiny",color:"translucent-white",className:"fullscreen",onClick:m},a.ZP.createElement("i",{className:d?"icon-smallscreen":"icon-fullscreen"})))};function ne(){return(ne=Object.assign||function(e){for(var t=1;t{const m=(0,a.sO)(null),[u,h]=(0,a.eJ)(!l.$b||!l.cj),[Z,P]=(0,a.eJ)(0),[g,v]=(0,a.eJ)(!0),[p,E,C]=function(e,t){const[n,s]=(0,a.eJ)(Boolean(V&&document[V]));return(0,a.bt)((()=>{const n=()=>{s(Boolean(V&&document[V]))},a=()=>{s(!0)},r=()=>{s(!1),t(!1)},o=e.current;return document.addEventListener("fullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),o&&(o.addEventListener("webkitbeginfullscreen",a,!1),o.addEventListener("webkitendfullscreen",r,!1)),()=>{document.removeEventListener("fullscreenchange",n,!1),document.removeEventListener("webkitfullscreenchange",n,!1),document.removeEventListener("mozfullscreenchange",n,!1),o&&(o.removeEventListener("webkitbeginfullscreen",a,!1),o.removeEventListener("webkitendfullscreen",r,!1))}}),[]),V||"iOS"===l.Lt?[n,()=>{e.current&&(V||"iOS"===l.Lt)&&(e.current.requestFullscreen?e.current.requestFullscreen():e.current.webkitRequestFullscreen?e.current.webkitRequestFullscreen():e.current.webkitEnterFullscreen?e.current.webkitEnterFullscreen():e.current.mozRequestFullScreen&&e.current.mozRequestFullScreen(),s(!0))},()=>{e.current&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen(),s(!1))}]:[!1]}(m,h),{isBuffered:f,bufferedProgress:b,bufferingHandlers:y}=(0,j.Z)(),{shouldRender:I,transitionClassNames:S}=(0,H.Z)(!f,void 0,void 0,"slow"),{shouldRender:N,transitionClassNames:w}=(0,H.Z)(l.cj&&!u&&!I,void 0,void 0,"slow");(0,a.d4)((()=>{c||!i?m.current.pause():e&&!l.$b&&(0,q.Z)(m.current)}),[c,i,e]),(0,a.d4)((()=>{m.current.currentTime===m.current.duration?(P(0),h(!1)):P(m.current.currentTime)}),[Z]);const k=(0,a.I4)((e=>{e.stopPropagation(),u?(m.current.pause(),h(!1)):(m.current.play(),h(!0))}),[u]);(0,K.Z)(m,[]);const M=(0,a.I4)((()=>{v(!0)}),[]),T=(0,a.I4)((()=>{v(!1)}),[]),F=(0,a.I4)((e=>{P(e.currentTarget.currentTime)}),[]),A=(0,a.I4)((()=>{P(0),h(!1)}),[]),L=(0,a.I4)((()=>{p&&C?C():!p&&E&&E()}),[C,p,E]),B=(0,a.I4)((e=>{e.stopPropagation(),m.current.currentTime=Number(e.target.value)*m.current.duration/100}),[]),$=(0,a.I4)((e=>{e.stopPropagation(),v(!g)}),[g]);(0,a.d4)((()=>{const e=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),k(e))};return document.addEventListener("keydown",e,!1),()=>{document.removeEventListener("keydown",e,!1)}}),[k]);const D=s&&`width: ${s.width}px; height: ${s.height}px`,U=`background-image: url(${n})`;return a.ZP.createElement("div",{className:"VideoPlayer",onClick:!t&&l.wB?$:void 0,onMouseOver:t?void 0:M,onMouseOut:t?void 0:T},a.ZP.createElement("div",{style:D},a.ZP.createElement("video",ne({ref:m,autoPlay:l.$b,playsInline:!0,loop:t,muted:t,id:"media-viewer-video",style:U,onEnded:A,onClick:l.wB?void 0:k,onDoubleClick:L},y,{onTimeUpdate:F}),e&&a.ZP.createElement("source",{src:e}))),N&&a.ZP.createElement(R.Z,{round:!0,className:`play-button ${w}`,onClick:k},a.ZP.createElement("i",{className:"icon-play"})),I&&a.ZP.createElement("div",{className:["spinner-container",S].join(" ")},!f&&a.ZP.createElement("div",{className:"buffering"},"Buffering..."),a.ZP.createElement(J.Z,{size:"xl",progress:f?1:r,square:!0,onClick:d})),!t&&!I&&a.ZP.createElement(te,{isPlayed:u,bufferedProgress:b,currentTime:Z,isFullscreenSupported:Boolean(E),isFullscreen:p,fileSize:o,duration:m.current?m.current.duration:0,isForceVisible:!u||g,isForceMobileVersion:s&&s.width<400,onSeek:B,onChangeFullscreen:L,onPlayPause:k}))})),se=(0,a.X$)((({isShown:e,onChangeZoom:t})=>{const{transitionClassNames:n}=(0,H.Z)(e),s=(0,f.Z)(e),r=(0,a.sO)(null),[o,i]=(0,a.eJ)(1),c=(0,a.sO)(!1);(0,a.d4)((()=>{e&&!s&&i(1.5)}),[e,s]);const d=(0,a.I4)((()=>{c.current=!0}),[]),m=(0,a.I4)((()=>{c.current=!1,1===o&&t(o,!c.current)}),[t,o]);(0,a.d4)((()=>{t(o,!c.current)}),[o,t]);const u=(0,M.Z)(),h=(0,Y.Z)("ZoomControls",n);return a.ZP.createElement("div",{className:h},a.ZP.createElement(R.Z,{disabled:1===o,size:"tiny",color:"translucent-white",ariaLabel:u("ZoomOut"),className:"zoom-out",ripple:!l.wB,onClick:()=>{r.current&&i(Math.max(1,o-.5))}},a.ZP.createElement("i",{className:"icon-zoom-out"})),a.ZP.createElement(R.Z,{disabled:3===o,size:"tiny",color:"translucent-white",ariaLabel:"Zoom In",className:"zoom-in",ripple:!l.wB,onClick:()=>{r.current&&i(Math.min(3,o+.5))}},a.ZP.createElement("i",{className:"icon-zoom-in"})),a.ZP.createElement("div",{className:"seekline"},a.ZP.createElement("div",{className:"seekline-track"},a.ZP.createElement("div",{className:"seekline-played",style:`width: ${50*(o-1)}%`}),a.ZP.createElement("input",{ref:r,min:1,max:3,step:"0.5",value:o,type:"range",className:"seekline-input",onChange:e=>{i(Math.min(3,Math.max(Number(e.target.value),1)))},onMouseDown:d,onMouseUp:m}))))})),re=[1,0,0,1,0,0],oe={1:1,1.5:1.5,2:2.2,2.5:3.3,3:5.5},ie=150,le=(0,a.X$)((({children:e,className:t,noWrap:n,canPan:s,zoomLevel:r,panDeltaX:o,panDeltaY:i,onPan:l})=>{const c=oe[r]||r,[d,m]=(0,a.eJ)(!1),[u,Z]=(0,a.eJ)({dx:o,dy:i,x:0,y:0}),[P,g]=(0,a.eJ)(re),v=(0,a.sO)(null),p=(0,a.sO)(null);return(0,a.d4)((()=>{const e=c||P[0],t=o||P[4],n=i||P[5],a=[...P];P[0]!==e&&(a[0]=e||a[0],a[3]=e||a[3]),P[4]!==t&&(a[4]=t),P[5]!==n&&(a[5]=n),(0,h.et)(P,a)||g(function(e,t,n){const a=n&&n.querySelector(".active img");if(!n||!a)return t;const s=n.getBoundingClientRect(),r=a.getBoundingClientRect(),o=r.width/e*t[0],i=r.height/e*t[3],l=(s.width-o)/2+t[4],c=(s.height-i)/2+t[5];return s.width&&s.width-ie{s||g(re)}),[s]),(0,a.d4)((()=>{p.current&&(p.current.style.transform=`matrix(${P.toString()})`)}),[n,P]),n?e:a.ZP.createElement("div",{ref:v,className:`pan-wrapper ${t||""}`,onMouseDown:e=>{if(!s)return;e.stopPropagation(),e.preventDefault();const t={dx:P[4],dy:P[5],x:e.pageX,y:e.pageY};Z(t),m(!0),v.current&&v.current.classList.add("move")},onMouseUp:()=>{m(!1),v.current&&v.current.classList.remove("move"),l&&l(P[4],P[5])},onMouseMove:e=>{if(d){const t=function(e,t){const n=[...P],a=u.x-e,s=u.y-t;return n[4]=u.dx-a,n[5]=u.dy-s,n}(e.pageX,e.pageY);g(t),p.current&&(p.current.style.transform=`matrix(${P.toString()})`)}}},a.ZP.createElement("div",{ref:p,className:"pan-container"},e))})),ce=350;function de(e,t,n){return e?a.ZP.createElement("img",{src:e,alt:"",style:t?`width: ${t.width}px`:"",draggable:Boolean(n)}):a.ZP.createElement("div",{className:"spinner-wrapper",style:t?`width: ${t.width}px`:""},a.ZP.createElement(F.Z,{color:"white"}))}const me=(0,a.X$)((0,s.c$)((e=>{const{chatId:t,threadId:n,messageId:a,avatarOwnerId:s,profilePhotoIndex:r,origin:i}=e.mediaViewer,{animationLevel:l}=e.settings.byKey;if(i===o.bZ.SearchResult){if(!t||!a)return{animationLevel:l};const n=(0,m.hj)(e,t,a);return n?{chatId:t,messageId:a,senderId:n.senderId,origin:i,message:n,animationLevel:l}:{animationLevel:l}}if(s)return{messageId:-1,senderId:s,avatarOwner:(0,m.dy)(e,s)||(0,m.Z1)(e,s),profilePhotoIndex:r||0,animationLevel:l,origin:i};if(!(t&&n&&a))return{animationLevel:l};let c,d,u;if(c=i&&[o.bZ.ScheduledAlbum,o.bZ.ScheduledInline].includes(i)?(0,m.Tm)(e,t,a):(0,m.hj)(e,t,a),!c)return{animationLevel:l};if(d=i&&[o.bZ.ScheduledAlbum,o.bZ.ScheduledInline].includes(i)?(0,m.Fn)(e,t):(0,m.Zw)(e,t),i===o.bZ.Inline||i===o.bZ.Album)u=(0,m.qC)(e,t,n)||(0,m.gb)(e,t,n);else if(i===o.bZ.SharedMedia){const t=(0,m.we)(e),{foundIds:n}=t&&t.resultsByType&&t.resultsByType.media||{};u=n}return{chatId:t,threadId:n,messageId:a,senderId:c.senderId,origin:i,message:c,chatMessages:d,collectionIds:u,animationLevel:l}}),((e,t)=>(0,h.ei)(t,["openMediaViewer","closeMediaViewer","openForwardMenu","focusMessage"])))((({chatId:e,threadId:t,messageId:n,senderId:s,origin:m,avatarOwner:h,profilePhotoIndex:F,message:B,chatMessages:$,collectionIds:D,openMediaViewer:x,closeMediaViewer:O,openForwardMenu:G,focusMessage:J,animationLevel:X})=>{const Y=Boolean(h||n),H=m===o.bZ.SharedMedia,j=m===o.bZ.SearchResult,V=B?(0,u.O$)(B):void 0,K=B?(0,u.b7)(B):void 0,q=B?(0,u.F$)(B):void 0,W=B?(0,u.Cg)(B):void 0,Q=!!B&&(0,u.rl)(B),ee=!!B&&(0,u.hC)(B),te=Boolean(K||W||ee),ne=Boolean(!te&&(V||q||Q)),{isGif:re}=K||W||{},oe=Boolean(h),ie=Boolean(q||W),me=(0,a.Ye)((()=>ie&&n?[n]:(0,u.N0)($||{},D||[],H)),[ie,n,$,D,H]),ue=n?me.indexOf(n):-1,he=0===ue||-1===ue,Ze=ue===me.length-1||-1===ue,Pe=(0,a.sO)(),ge=(0,f.Z)(s);!Y||ge&&ge===s&&Pe.current||(Pe.current=ue);const ve=X>=1?"mv-slide":"none",pe=2===X?"slide-fade":"none",Ee=2===X,[Ce,fe]=(0,a.eJ)(!1),[be,ye]=(0,a.eJ)(!1),[Ie,Se]=(0,a.eJ)(!1),[Ne,we]=(0,a.eJ)(1),[ke,Me]=(0,a.eJ)({x:0,y:0});function Te(e){if(oe&&void 0!==F){const{photos:t}=h;return t&&t[F]?`photo${t[F].id}?size=c`:(0,u.RT)(h,e?"big":"normal")}return B&&(0,u.Ti)(B,e?"viewerFull":"viewerPreview")}const Fe=(0,p.Z)(B&&(H||j)&&(0,u.Ti)(B,"pictogram"),void 0,r.IU.BlobUrl,void 0,Ee&&ce),Ae=Te(),Le=(0,p.Z)(Ae,void 0,oe&&Ae&&Ae.startsWith("profilePhoto")?r.IU.DataUri:r.IU.BlobUrl,void 0,Ee&&ce),{mediaData:Re,downloadProgress:Be}=(0,E.Z)(Te(!0),void 0,B&&(0,u.kG)(B,"viewerFull"),void 0,Ee&&ce),$e=V||K?(V||K).blobUrl:void 0;let De=!te&&($e||Re)||Le||Fe;const Ue=(0,C.Z)(!De&&B&&(0,u.DH)(B));De||m===o.bZ.SearchResult||(De=Ue);const xe=B?(0,u.c0)(B):void 0,Oe=B?(0,u.ep)(B):oe?`avatar${h.id}-${F}.jpg`:void 0;let Ge;B?Q||ee?Ge=(0,u.aE)(B).mediaSize:V||q?Ge=(0,u.bV)(V||q):(K||W)&&(Ge=(0,u.jC)(K||W)):Ge=d.vY,(0,a.d4)((()=>{l.wB&&document.body.classList.toggle("is-media-viewer-open",Y)}),[Y]);const Je=(0,v.Z)();(0,a.d4)((()=>{const e=window.matchMedia(d.L6);return"function"==typeof e.addEventListener?e.addEventListener("change",Je):"function"==typeof e.addListener&&e.addListener(Je),()=>{"function"==typeof e.removeEventListener?e.removeEventListener("change",Je):"function"==typeof e.removeListener&&e.removeListener(Je)}}),[Je]);const ze=(0,f.Z)(B),Xe=(0,f.Z)(m),Ye=(0,f.Z)(h),_e=(0,f.Z)(De);(0,a.d4)((()=>{if(Ee&&Y&&!ze&&!Ye){(0,b.YW)(ce+i.fK);const e=B?(0,y.X)(B):void 0;!function(e,t,n,a,s,r){const{mediaEl:l}=w(t,r);if(!l)return;const{width:m}=c.Z.get(),{width:u,height:h}=(0,d.fM)(e,s),{width:Z,height:P}=(0,d.jg)(u,h,a.width,a.height),g=(m-Z)/2,v=function(e){const t=window.matchMedia(d.L6);let n=4.125;return e&&(n+=t.matches?.875:3.375),n*d.Gw}(e)+(h-P)/2;let{top:p,left:E,width:C,height:f}=l.getBoundingClientRect();if([o.bZ.SharedMedia,o.bZ.Album,o.bZ.ScheduledAlbum,o.bZ.SearchResult].includes(t)){const e=function(e,t,n,a,s,r){if(e===t){const o=Math.max(s,r)*(e/t);a-=(o-s)/2,n-=(o-r)/2,s=o,r=o}else if(e>t){const n=s;a-=((s=r*(e/t))-n)/2}else if(t>e){const a=r;n-=((r=s*(t/e))-a)/2}return{top:n,left:a,width:s,height:r}}(Z,P,p,E,C,f);p=e.top,E=e.left,C=e.width,f=e.height}const b=E+C/2-(g+Z/2),y=p+f/2-(v+P/2),S=C/Z,M=f/P,T=I(n||l);N(T,{top:`${v}px`,left:`${g}px`,width:`${Z}px`,height:`${P}px`,transform:`translate3d(${b}px, ${y}px, 0) scale(${S}, ${M})`}),k(T,t),document.body.classList.add("ghost-animating"),requestAnimationFrame((()=>{document.body.appendChild(T),requestAnimationFrame((()=>{T.style.transform="",function(e){e.firstChild.style.objectFit="default",e.classList.remove("rounded-corners","circle")}(T),setTimeout((()=>{requestAnimationFrame((()=>{document.body.contains(T)&&document.body.removeChild(T),document.body.classList.remove("ghost-animating")}))}),200+i.fK)}))}))}(Boolean(e),m,De,Ge,te,B)}Ee&&!Y&&(ze||Ye)&&((0,b.YW)(ce+i.fK),function(e,t,n){const{container:a,mediaEl:s}=w(e,n);if(!s)return;const r=document.getElementById("MediaViewer").querySelector(".active .media-viewer-content img, .active .media-viewer-content video");if(!r||!s)return;const{top:l,left:d,width:m,height:u}=r.getBoundingClientRect(),{top:h,left:Z,width:P,height:g}=s.getBoundingClientRect();let v=h;if(!function(e){if("none"===e.style.display)return!1;const t=e.getBoundingClientRect(),{height:n}=c.Z.get();return t.top<=n&&t.top+t.height>=0}(a)){const{height:e}=c.Z.get();v=hf?C=f:f>C&&(f=C));const y=document.getElementsByClassName("ghost")[0],M=y||I(t||s,e);y||N(M,{top:`${v}px`,left:`${Z}px`,width:`${P}px`,height:`${g}px`,transform:`translate3d(${p}px, ${E}px, 0) scale(${C}, ${f})`}),requestAnimationFrame((()=>{if(y){const{top:e,left:t,width:n,height:a}=y.getBoundingClientRect();N(M,{transition:"none",top:`${v}px`,left:`${Z}px`,transformOrigin:"top left",transform:`translate3d(${t-Z}px, ${e-v}px, 0) scale(${n/P}, ${a/g})`,width:`${P}px`,height:`${g}px`})}document.body.classList.add("ghost-animating"),y||document.body.appendChild(M),requestAnimationFrame((()=>{y&&(y.style.transition=""),M.style.transform="",b&&(M.style.opacity="0"),k(M,e),setTimeout((()=>{requestAnimationFrame((()=>{document.body.contains(M)&&document.body.removeChild(M),document.body.classList.remove("ghost-animating")}))}),200+i.fK)}))}))}(Xe,_e,ze||void 0))}),[Ee,Y,m,Xe,B,ze,Ye,De,_e,Ge,te]),(0,a.d4)((()=>{let e;return Ie?ye(!0):e=window.setTimeout((()=>{ye(!1)}),ce),()=>{e&&window.clearTimeout(e)}}),[Ie]);const He=()=>{Se(!1),we(1),Me({x:0,y:0})},je=(0,a.I4)((()=>{Se(!Ie),we(Ie?1:1.5),Ie&&Me({x:0,y:0})}),[Ie]),Ve=(0,a.I4)(((e,t=!1)=>{we(e),1===e&&t&&He()}),[]),Ke=(0,a.I4)((()=>{O(),He()}),[O]),qe=(0,a.I4)((()=>{Ke(),J({chatId:e,threadId:t,messageId:n})}),[Ke,e,t,J,n]),We=(0,a.I4)((()=>{G({fromChatId:e,messageIds:[n]}),He()}),[G,e,n]);(0,a.d4)((()=>Y?(0,P.Z)((()=>{Ie?He():Ke()})):void 0),[Ke,Y,Ie]),(0,a.d4)((()=>{te&&!re&&(0,g.E)()}),[re,te]),(0,a.d4)((()=>{if(Y)return c.Z.disableRefresh(),()=>{c.Z.enableRefresh()}}),[Y]);const Qe=(0,a.I4)(((e,t)=>{let n=me.indexOf(e);return(-1===t&&n>0||1===t&&n{he||x({chatId:e,threadId:t,messageId:n?Qe(n,-1):void 0,origin:m})}),[e,t,Qe,he,n,x,m]),tt=(0,a.I4)((()=>{Ze||x({chatId:e,threadId:t,messageId:n?Qe(n,1):void 0,origin:m})}),[e,t,Qe,Ze,n,x,m]);(0,a.d4)((()=>{const e=e=>{switch(e.key){case"Left":case"ArrowLeft":et();break;case"Right":case"ArrowRight":tt()}};return document.addEventListener("keydown",e,!1),()=>{document.removeEventListener("keydown",e,!1)}})),(0,a.d4)((()=>{const e=document.querySelector(".slide-container > .active, .slide-container > .to");if(!e)return;const t=re&&!l.cj;return(0,Z.s)(e,{excludedClosestSelector:".backdrop, .navigation, .media-viewer-head, .media-viewer-footer"+(t?"":", .VideoPlayer"),onClick:()=>{Ie||l.$b||Ke()},onSwipe:l.$b?(e,t)=>(t===Z.e.Right?et():t===Z.e.Left?tt():e.target&&e.target.closest(".MediaViewerFooter")||Ke(),!0):void 0})}),[Ke,Ce,re,ne,Ie,tt,et]);const nt=(0,a.I4)(((e,t)=>{Me({x:e,y:t})}),[]),at=(0,a.I4)((()=>{l.$b&&(ne||re)&&fe(!Ce)}),[Ce,re,ne]),st=(0,M.Z)();function rt(t){if(oe)return a.ZP.createElement("div",{key:e,className:"media-viewer-content"},de(Re||Le,(0,d.PA)(d.vY,!1),!l.wB&&!Ie));if(B){const e=(0,y.X)(B),s=Boolean(e);return a.ZP.createElement("div",{key:n,className:"media-viewer-content "+(s?"has-footer":""),onClick:at},ne&&de($e||Re||Le||Fe,B&&(0,d.PA)(Ge,s),!l.wB&&!Ie),te&&a.ZP.createElement(ae,{key:n,url:$e||Re,isGif:re,posterData:De,posterSize:B&&(0,d.PA)(Ge,s,!0),downloadProgress:Be,fileSize:xe,isMediaViewerOpen:Y,noPlay:!t,onClose:Ke}),e&&a.ZP.createElement(_,{text:e,onClick:qe,isHidden:Ce&&(!te||re),isForVideo:te&&!re}))}}function ot(){return oe?a.ZP.createElement(U,{key:h.id,chatId:h.id,isAvatar:!0}):a.ZP.createElement(U,{key:n,chatId:e,messageId:n})}return(0,T.ZP)(Y,O,x,{chatId:e,threadId:t,messageId:n,origin:m,avatarOwnerId:h&&h.id}),a.ZP.createElement(A.Z,{id:"MediaViewer",className:Ie?"zoomed":"",isOpen:Y},(()=>a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("div",{className:"media-viewer-head",dir:st.isRtl?"rtl":void 0},l.wB&&a.ZP.createElement(R.Z,{className:"media-viewer-close",round:!0,size:"smaller",color:"translucent-white",ariaLabel:st("Close"),onClick:Ke},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement(L.Z,{activeKey:Pe.current,name:pe},ot),a.ZP.createElement(z,{mediaData:Re||Le,isVideo:te,isZoomed:Ie,message:B,fileName:Oe,onCloseMediaViewer:Ke,onForward:We,onZoomToggle:je,isAvatar:oe})),a.ZP.createElement(le,{noWrap:!be,canPan:Ie,panDeltaX:ke.x,panDeltaY:ke.y,zoomLevel:Ne,onPan:nt},a.ZP.createElement(L.Z,{className:"slide-container",activeKey:ue,name:ve},rt)),!he&&a.ZP.createElement("button",{type:"button",className:`navigation prev ${te&&!re&&"inline"}`,"aria-label":st("AccDescrPrevious"),dir:st.isRtl?"rtl":void 0,onClick:et}),!Ze&&a.ZP.createElement("button",{type:"button",className:`navigation next ${te&&!re&&"inline"}`,"aria-label":st("Next"),dir:st.isRtl?"rtl":void 0,onClick:tt}),a.ZP.createElement(se,{isShown:Ie,onChangeZoom:Ve}))))})));var ue=n(5765),he=n(7407),Ze=n(2313),Pe=n(4288),ge=n(3103),ve=n(7687),pe=n(1273),Ee=n(1876),Ce=n(6058),fe=n(8799);const be=(0,a.X$)((0,s.c$)((e=>{const{chats:{byId:t,listIds:n,orderedPinnedIds:a},currentUserId:s}=e;return{chatsById:t,pinnedIds:a.active,activeListIds:n.active,archivedListIds:n.archived,currentUserId:s}}),((e,t)=>(0,h.ei)(t,["setForwardChatId","exitForwardMode","loadMoreChats"])))((({chatsById:e,pinnedIds:t,activeListIds:n,archivedListIds:s,currentUserId:o,isOpen:i,setForwardChatId:c,exitForwardMode:d,loadMoreChats:m})=>{const[Z,P]=(0,a.eJ)(""),g=(0,a.sO)(null),v=(0,M.Z)();(0,a.d4)((()=>{i?l.wB||setTimeout((()=>{requestAnimationFrame((()=>{g.current&&g.current.focus()}))}),500):(g.current&&g.current.blur(),setTimeout((()=>{P("")}),300))}),[i]);const p=(0,a.Ye)((()=>{const a=[...n||[],...s||[]];let i=t||[];return o&&(i=(0,h.Tw)([o,...i])),(0,u.ih)([...a.filter((t=>{const n=e[t];return!n||!!(0,u.Qm)(n,r._f)&&(!Z||(0,ue.Z)((0,u.U)(v,e[t],void 0,t===o),Z))}))],e,void 0,i)}),[n,s,e,o,Z,v,t]),[E,C]=(0,he.Z)(m,p,Boolean(Z)),f=(0,a.I4)((e=>{P(e.currentTarget.value)}),[]),b=(0,a.sO)(null),y=(0,Ze.Z)(b,i,(e=>{E&&E.length>0&&c({id:E[-1===e?0:e]})}),".ListItem-button",!0),I=a.ZP.createElement("div",{className:"modal-header",dir:v.isRtl?"rtl":void 0},a.ZP.createElement(R.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:v("Close"),onClick:d},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement(ve.Z,{ref:g,value:Z,onChange:f,onKeyDown:y,placeholder:v("ForwardTo")}));return a.ZP.createElement(ge.Z,{isOpen:i,onClose:d,className:"ForwardPicker",header:I},null!=E&&E.length?a.ZP.createElement(pe.Z,{className:"picker-list custom-scroll",items:E,onLoadMore:C,noScrollRestore:Boolean(Z),ref:b,onKeyDown:y},E.map((e=>a.ZP.createElement(Ee.Z,{key:e,className:"chat-item-clickable force-rounded-corners",onClick:()=>c({id:e})},(0,u.YA)(e)?a.ZP.createElement(Ce.Z,{status:e===o?v("SavedMessagesInfo"):void 0,userId:e}):a.ZP.createElement(fe.Z,{chatId:e}))))):E&&!E.length?a.ZP.createElement("p",{className:"no-results"},"Sorry, nothing found."):a.ZP.createElement(Pe.Z,null))})));var ye=n(1947);function Ie(e){return e.isSlowMode?"Slowmode enabled":e.hasErrorKey?"Something went wrong":"Telegram"}const Se=(0,a.X$)((0,s.c$)((e=>(0,h.ei)(e,["dialogs"])),((e,t)=>(0,h.ei)(t,["dismissDialog","acceptInviteConfirmation"])))((({dialogs:e,dismissDialog:t,acceptInviteConfirmation:n})=>{const s=(0,M.Z)();if(e.length)return a.ZP.createElement("div",{id:"Dialogs"},e.map((e=>{return"hash"in e?(e=>{const{hash:r,title:o,participantsCount:i,isChannel:l}=e,c=s(l?"Subscribers":"Members",i,"i"),d=s(l?"ChannelJoin":"JoinGroup");return a.ZP.createElement(ge.Z,{isOpen:!0,onClose:t,className:"error",title:o},void 0!==i&&a.ZP.createElement("p",null,c),a.ZP.createElement(R.Z,{isText:!0,className:"confirm-dialog-button",onClick:()=>{n({hash:r}),t()}},d),a.ZP.createElement(R.Z,{isText:!0,className:"confirm-dialog-button",onClick:t},s("Cancel")))})(e):(r=e,a.ZP.createElement(ge.Z,{isOpen:!0,onClose:t,className:"error",title:Ie(r)},r.hasErrorKey?(0,ye.ZP)(r):(0,$.Z)(r.message,["emoji","br"]),a.ZP.createElement("div",null,a.ZP.createElement(R.Z,{isText:!0,onClick:t},s("OK")))));var r})))})));var Ne=n(6937);const we=(0,a.X$)((0,s.c$)((e=>(0,h.ei)(e,["notifications"])),((e,t)=>(0,h.ei)(t,["dismissNotification"])))((({notifications:e,dismissNotification:t})=>{if(e.length)return a.ZP.createElement("div",{id:"Notifications"},e.map((({message:e,localId:n})=>a.ZP.createElement(Ne.Z,{message:(0,$.Z)(e,["emoji","br","links","simple_markdown"]),onDismiss:()=>t({localId:n})}))))})));var ke=n(8360),Me=n(7551);const Te=(0,a.X$)((0,s.c$)(void 0,((e,t)=>(0,h.ei)(t,["toggleSafeLinkModal"])))((({url:e,toggleSafeLinkModal:t})=>{const n=(0,M.Z)(),s=(0,a.I4)((()=>{window.open(e),t({url:void 0})}),[t,e]),r=(0,a.I4)((()=>{t({url:void 0})}),[t]),o=(0,ke.Z)(e);return a.ZP.createElement(Me.Z,{isOpen:Boolean(e),onClose:r,title:n("OpenUrlTitle"),textParts:(0,$.Z)(n("OpenUrlAlert2",o),["links"]),confirmLabel:n("OpenUrlTitle"),confirmHandler:s})})));var Fe=n(706);const Ae=["lng_weekday1","lng_weekday2","lng_weekday3","lng_weekday4","lng_weekday5","lng_weekday6","lng_weekday7"];function Le(e,t,n,a,s){const r=new Date(e,t,n,0,0,0,0),o=a&&new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0),i=s&&new Date(s.getFullYear(),s.getMonth(),s.getDate(),0,0,0,0);return!!(i&&r>i)||!!(o&&r{const u=(0,M.Z)(),h=new Date,Z=(0,a.Ye)((()=>e?new Date(e):new Date),[e]),P=t?new Date(t):void 0,g=(0,f.Z)(r),[v,p,E]=(0,Fe.Z)(!1),[C,b]=(0,a.eJ)(Z),[y,I]=(0,a.eJ)(new Date(C.getFullYear(),C.getMonth(),1)),[S,N]=(0,a.eJ)(Re(Z.getHours())),[w,k]=(0,a.eJ)(Re(Z.getMinutes())),T=Be(C.getFullYear(),C.getMonth(),C.getDate()),F=y.getFullYear(),A=y.getMonth();(0,a.d4)((()=>{!g&&r&&(b(Z),I(new Date(Z.getFullYear(),Z.getMonth(),1)))}),[Z,r,g]),(0,a.d4)((()=>{n&&!v&&C.getTime()=h.getFullYear()&&A>=h.getMonth()||P&&F>=P.getFullYear()&&A>=P.getMonth(),$=n&&F<=h.getFullYear()&&A<=h.getMonth(),{prevMonthGrid:D,currentMonthGrid:U,nextMonthGrid:x}=(0,a.Ye)((()=>function(e,t){const n=[],a=[],s=[],r=new Date;r.setDate(1),r.setMonth(t),r.setFullYear(e);const o=r.getDay(),i=new Date(e,t,0).getDate();for(let e=1;e0)for(let e=1;e<=7-l;e++)s.push(e);return{prevMonthGrid:n,currentMonthGrid:a,nextMonthGrid:s}}(F,A)),[A,F]),O=(0,a.I4)((e=>{const t=e.target.value.replace(/[^\d]+/g,"");if(!t.length)return N(""),void(e.target.value="");const n=Math.max(0,Math.min(Number(t),23)),a=new Date(C.getTime());a.setHours(n),b(a);const s=Re(n);N(s),e.target.value=s}),[C]),G=(0,a.I4)((e=>{const t=e.target.value.replace(/[^\d]+/g,"");if(!t.length)return k(""),void(e.target.value="");const n=Math.max(0,Math.min(Number(t),59)),a=new Date(C.getTime());a.setMinutes(n),b(a);const s=Re(n);k(s),e.target.value=s}),[C]);return a.ZP.createElement(ge.Z,{isOpen:r,onClose:c,className:"CalendarModal"},a.ZP.createElement("div",{className:"container"},a.ZP.createElement("div",{className:"month-selector"},a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",onClick:c},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement("h4",null,u(`lng_month${A+1}`)," ",F),a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",disabled:$,onClick:$?void 0:function(){I((e=>{const t=new Date(e);return t.setMonth(t.getMonth()-1),t}))}},a.ZP.createElement("i",{className:"icon-previous"})),a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",disabled:L,onClick:L?void 0:function(){I((e=>{const t=new Date(e);return t.setMonth(t.getMonth()+1),t}))}},a.ZP.createElement("i",{className:"icon-next"})))),a.ZP.createElement("div",{className:"calendar-wrapper"},a.ZP.createElement("div",{className:"calendar-grid"},Ae.map((e=>a.ZP.createElement("div",{className:"day-button faded weekday"},a.ZP.createElement("span",null,u(e))))),D.map((e=>a.ZP.createElement("div",{className:"day-button disabled"},a.ZP.createElement("span",null,e)))),U.map((e=>a.ZP.createElement("div",{role:"button",tabIndex:0,onClick:()=>{return t=e,void b((e=>{const n=new Date(e);return n.setDate(t),n.setMonth(A),n.setFullYear(F),n}));var t},className:(0,Y.Z)("day-button",Le(F,A,e,n?h:void 0,s?h:P)?"disabled":e?"clickable":"",T===Be(F,A,e)&&"selected")},!!e&&a.ZP.createElement("span",null,e)))),x.map((e=>a.ZP.createElement("div",{className:"day-button disabled"},a.ZP.createElement("span",null,e)))))),o&&a.ZP.createElement("div",{className:"timepicker"},a.ZP.createElement("input",{type:"text",className:"form-control",inputMode:"decimal",value:S,onChange:O,onFocus:p,onBlur:E}),":",a.ZP.createElement("input",{type:"text",className:"form-control",inputMode:"decimal",value:w,onChange:G,onFocus:p,onBlur:E})),a.ZP.createElement("div",{className:"footer"},a.ZP.createElement(R.Z,{onClick:function(){d(C)}},o?function(e,t){const n=(0,B.xH)(t,e.code);return n===(0,B.xH)(new Date,e.code)?e("Conversation.ScheduleMessage.SendToday",(0,B.mr)(t)):e("Conversation.ScheduleMessage.SendOn",[n,(0,B.mr)(t)])}(u,C):i),l&&a.ZP.createElement(R.Z,{onClick:m,isText:!0},l)))})),De=(0,a.X$)((0,s.c$)((e=>({selectedAt:e.historyCalendarSelectedAt})),((e,t)=>(0,h.ei)(t,["searchMessagesByDate","closeHistoryCalendar"])))((({isOpen:e,selectedAt:t,searchMessagesByDate:n,closeHistoryCalendar:s})=>{const r=(0,a.I4)((e=>{n({timestamp:e.valueOf()/1e3}),s()}),[s,n]),o=(0,M.Z)();return a.ZP.createElement($e,{isOpen:e,selectedAt:t,isPastMode:!0,submitButtonLabel:o("JumpToDate"),onClose:s,onSubmit:r})}))),Ue=(0,a.X$)((0,s.c$)(((e,{message:t,isSchedule:n})=>{const{threadId:a}=(0,m.Bt)(e)||{},{canDeleteForAll:s}=a&&(0,m._k)(e,t,a)||{},r=(0,m.Z1)(e,t.chatId);return{canDeleteForAll:!n&&s,contactName:r&&(0,u.YA)(r.id)?(0,u.Vl)((0,m.dy)(e,(0,u.zX)(r))):void 0,willDeleteForCurrentUserOnly:r&&(0,u.G9)(r)&&!s,willDeleteForAll:r&&(0,u.ZV)(r)}}),((e,t)=>(0,h.ei)(t,["deleteMessages","deleteScheduledMessages"])))((({isOpen:e,isSchedule:t,message:n,album:s,canDeleteForAll:r,contactName:o,willDeleteForCurrentUserOnly:i,willDeleteForAll:l,onClose:c,deleteMessages:d,deleteScheduledMessages:m})=>{const u=(0,a.I4)((()=>{const e=null!=s&&s.messages?s.messages.map((({id:e})=>e)):[n.id];d({messageIds:e,shouldDeleteForAll:!0}),c()}),[d,n.id,c,s]),h=(0,a.I4)((()=>{const e=null!=s&&s.messages?s.messages.map((({id:e})=>e)):[n.id];t?m({messageIds:e}):d({messageIds:e,shouldDeleteForAll:!1}),c()}),[s,n.id,t,c,m,d]),Z=(0,M.Z)();return a.ZP.createElement(ge.Z,{isOpen:e,onClose:c,onEnter:e&&!r?h:void 0,className:"delete",title:Z("DeleteSingleMessagesTitle")},a.ZP.createElement("p",null,Z("AreYouSureDeleteSingleMessage")),i&&a.ZP.createElement("p",null,Z("lng_delete_for_me_chat_hint",1,"i")),l&&a.ZP.createElement("p",null,Z("lng_delete_for_everyone_hint",1,"i")),r&&a.ZP.createElement(R.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:u},o&&(0,$.Z)(Z("Conversation.DeleteMessagesFor",o)),!o&&Z("Conversation.DeleteMessagesForEveryone")),a.ZP.createElement(R.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:h},Z(r?"ChatList.DeleteForCurrentUser":"Delete")),a.ZP.createElement(R.Z,{className:"confirm-dialog-button",isText:!0,onClick:c},Z("Cancel")))}))),xe=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{const n=(0,u.YA)(t),a=(0,m.FM)(e,t),s=(0,m.Z1)(e,t),r=!!s&&(0,u.eA)(s),o=!!s&&(0,u.G9)(s),i=!!s&&(0,u.ZV)(s);return{isPrivateChat:n,isChatWithSelf:a,isChannel:r,isGroup:o,isSuperGroup:i,canPinForAll:n&&!a||i||o,contactName:s&&(0,u.YA)(s.id)?(0,u.Vl)((0,m.dy)(e,(0,u.zX)(s))):void 0}}),((e,t)=>(0,h.ei)(t,["pinMessage"])))((({isOpen:e,messageId:t,chatId:n,isChannel:s,isGroup:r,isSuperGroup:o,canPinForAll:i,contactName:l,onClose:c,pinMessage:d})=>{const m=(0,a.I4)((()=>{d({chatId:n,messageId:t,isUnpin:!1}),c()}),[d,n,t,c]),u=(0,a.I4)((()=>{d({chatId:n,messageId:t,isUnpin:!1,isOneSide:!0,isSilent:!0}),c()}),[n,t,c,d]),h=(0,M.Z)();return a.ZP.createElement(ge.Z,{isOpen:e,onClose:c,className:"pin",title:h("PinMessageAlertTitle")},a.ZP.createElement("p",null,h(s?"PinMessageAlertChannel":r||o?"PinMessageAlert":"PinMessageAlertChat")),a.ZP.createElement(R.Z,{className:"confirm-dialog-button",isText:!0,onClick:u},h("DialogPin")),i&&a.ZP.createElement(R.Z,{className:"confirm-dialog-button",isText:!0,onClick:m},l?(0,$.Z)(h("Conversation.PinMessagesFor",l)):h("Conversation.PinMessageAlert.PinAndNotifyMembers")),a.ZP.createElement(R.Z,{className:"confirm-dialog-button",isText:!0,onClick:c},h("Cancel")))}))),Oe=(0,a.X$)((({isOpen:e,pinnedMessagesCount:t=0,onClose:n,onUnpin:s})=>{const r=(0,M.Z)();return a.ZP.createElement(ge.Z,{isOpen:e,onClose:n,className:"unpin-all",title:r("Chat.PanelUnpinAllMessages")},a.ZP.createElement("p",null,r("Chat.UnpinAllMessagesConfirmation",t,"i")),a.ZP.createElement(R.Z,{className:"confirm-dialog-button",isText:!0,onClick:s},r("DialogUnpin")),a.ZP.createElement(R.Z,{className:"confirm-dialog-button",isText:!0,onClick:n},r("Cancel")))}));var Ge=n(517);const Je=(0,a.X$)((0,s.c$)(((e,{isSchedule:t})=>{const{messageIds:n}=e.selectedMessages||{},{canDeleteForAll:a}=(0,m.xl)(e),s=(0,m.jr)(e);return{selectedMessageIds:n,canDeleteForAll:!t&&a,contactName:s&&(0,u.YA)(s.id)?(0,u.Vl)((0,m.dy)(e,(0,u.zX)(s))):void 0,willDeleteForCurrentUserOnly:s&&(0,u.G9)(s)&&!a,willDeleteForAll:s&&(0,u.ZV)(s)}}),((e,t)=>(0,h.ei)(t,["deleteMessages","deleteScheduledMessages","exitMessageSelectMode"])))((({isOpen:e,isSchedule:t,selectedMessageIds:n,canDeleteForAll:s,contactName:r,willDeleteForCurrentUserOnly:o,willDeleteForAll:i,onClose:l,deleteMessages:c,deleteScheduledMessages:d,exitMessageSelectMode:m})=>{const u=(0,f.Z)(e),h=(0,a.I4)((()=>{l(),c({messageIds:n,shouldDeleteForAll:!0})}),[c,n,l]),Z=(0,a.I4)((()=>{t?d({messageIds:n}):c({messageIds:n,shouldDeleteForAll:!1}),l()}),[t,l,d,n,c]),P=(0,M.Z)();if((0,a.d4)((()=>{!e&&u&&m()}),[m,e,u]),n)return a.ZP.createElement(ge.Z,{isOpen:e,onClose:l,onEnter:s?void 0:Z,className:"delete",title:P("Conversation.DeleteManyMessages")},a.ZP.createElement("p",null,P("AreYouSureDeleteFewMessages")),o&&a.ZP.createElement("p",null,"This will delete them just for you, not for other participants in the chat."),i&&a.ZP.createElement("p",null,"This will delete them for everyone in this chat."),s&&a.ZP.createElement(R.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:h},r?(0,$.Z)(P("ChatList.DeleteForEveryone",r)):P("Conversation.DeleteMessagesForEveryone")),a.ZP.createElement(R.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:Z},P(s?"ChatList.DeleteForCurrentUser":"Delete")),a.ZP.createElement(R.Z,{className:"confirm-dialog-button",isText:!0,onClick:l},P("Cancel")))})));var ze=n(4434);const Xe=(0,a.X$)((0,s.c$)(void 0,((e,t)=>(0,h.ei)(t,["reportMessages","exitMessageSelectMode"])))((({isOpen:e,messageIds:t,reportMessages:n,exitMessageSelectMode:s,onClose:r})=>{const[o,i]=(0,a.eJ)("spam"),[l,c]=(0,a.eJ)(""),d=()=>{n({messageIds:t,reason:o,description:l}),s(),r()},m=(0,a.I4)((e=>{i(e)}),[]),u=(0,a.I4)((e=>{c(e.target.value)}),[]),h=(0,M.Z)(),Z=[{value:"spam",label:h("lng_report_reason_spam")},{value:"violence",label:h("lng_report_reason_violence")},{value:"pornography",label:h("lng_report_reason_pornography")},{value:"childAbuse",label:h("lng_report_reason_child_abuse")},{value:"copyright",label:h("ReportPeer.ReasonCopyright")},{value:"other",label:h("lng_report_reason_other")}];if(t)return a.ZP.createElement(ge.Z,{isOpen:e,onClose:r,onEnter:e?d:void 0,className:"report",title:h("lng_report_message_title")},a.ZP.createElement(ze.Z,{name:"report-message",options:Z,onChange:m,selected:o}),a.ZP.createElement(ve.Z,{label:h("lng_report_reason_description"),value:l,onChange:u}),a.ZP.createElement(R.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:d},h("lng_report_button")),a.ZP.createElement(R.Z,{className:"confirm-dialog-button",isText:!0,onClick:r},h("Cancel")))}))),Ye=(0,a.X$)((0,s.c$)((e=>{const{type:t}=(0,m.Bt)(e)||{},{canDelete:n}=(0,m.xl)(e),a=(0,m.nB)(e),{messageIds:s}=e.selectedMessages||{};return{isSchedule:"scheduled"===t,selectedMessagesCount:(0,m.D7)(e),canDeleteMessages:n,canReportMessages:a,selectedMessageIds:s}}),((e,t)=>(0,h.ei)(t,["exitMessageSelectMode","openForwardMenuForSelectedMessages"])))((({canPost:e,isActive:t,messageListType:n,isSchedule:s,selectedMessagesCount:r,canDeleteMessages:o,canReportMessages:i,selectedMessageIds:l,exitMessageSelectMode:c,openForwardMenuForSelectedMessages:d})=>{const[m,u,h]=(0,Fe.Z)(),[Z,P,g]=(0,Fe.Z)();(0,a.d4)((()=>!t||m||Z?void 0:(0,Ge.Z)({onBackspace:u,onDelete:u,onEsc:c})),[t,m,Z,u,c]);const v=(0,f.Z)(r||void 0,!0),p=t?r:v,E=(0,M.Z)(),C=E("VoiceOver.Chat.MessagesSelected",p),b=(0,Y.Z)("MessageSelectToolbar",e&&"with-composer",t&&"shown");return a.ZP.createElement("div",{className:b},a.ZP.createElement("div",{className:"MessageSelectToolbar-inner"},a.ZP.createElement(R.Z,{color:"translucent",round:!0,onClick:c,ariaLabel:"Exit select mode"},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement("span",{className:"MessageSelectToolbar-count",title:C},C),!!r&&a.ZP.createElement("div",{className:"MessageSelectToolbar-actions"},"scheduled"!==n&&a.ZP.createElement(G.Z,{icon:"forward",ariaLabel:"Forward Messages",onClick:d},a.ZP.createElement("span",{className:"item-text"},E("Forward"))),i&&a.ZP.createElement(G.Z,{icon:"flag",onClick:P,disabled:!i,ariaLabel:E("Conversation.ReportMessages")},a.ZP.createElement("span",{className:"item-text"},E("Report"))),a.ZP.createElement(G.Z,{destructive:!0,icon:"delete",onClick:u,disabled:!o,ariaLabel:E("EditAdminGroupDeleteMessages")},a.ZP.createElement("span",{className:"item-text"},E("Delete"))))),a.ZP.createElement(Je,{isOpen:m,isSchedule:s,onClose:h}),a.ZP.createElement(Xe,{isOpen:Z,onClose:g,messageIds:l}))})));var _e=n(3133),He=n(735),je=n(1470);const Ve=e=>{const t=(0,a.sO)(null),n=(0,a.I4)((n=>{"Enter"===n.key&&t.current===document.activeElement&&e()}),[e]);return(0,a.d4)((()=>(window.addEventListener("keydown",n,!1),()=>window.removeEventListener("keydown",n))),[n]),t};var Ke=n(329);const qe=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{const n=(0,m.Z1)(e,t),a=n&&(0,u.zX)(n);return{chat:n,privateChatUser:a?(0,m.dy)(e,a):void 0,isPinned:(0,m.ep)(e,t),isMuted:n?(0,u.i4)(n,(0,m.dZ)(e),(0,m.NJ)(e)):void 0}}))((({chatId:e,chat:t,privateChatUser:n,isPinned:s,isMuted:r,withUsername:o,onClick:i})=>{const[l,c,d]=(0,Fe.Z)(),m=(0,je.Z)({chat:t,privateChatUser:n,isPinned:s,isMuted:r,handleDelete:c},!0),h=()=>{i(e)},Z=Ve(h);if(t)return a.ZP.createElement(Ee.Z,{className:"chat-item-clickable search-result",onClick:h,contextActions:m,buttonRef:Z},(0,u.YA)(e)?a.ZP.createElement(Ce.Z,{userId:e,withUsername:o,avatarSize:"large"}):a.ZP.createElement(fe.Z,{chatId:e,withUsername:o,avatarSize:"large"}),a.ZP.createElement(Ke.Z,{isOpen:l,onClose:d,chat:t}))})));var We=n(8781);const Qe=(0,X.P2)((e=>e()),6e4,!0),et=(0,a.X$)((0,s.c$)((e=>{const{userIds:t}=e.topPeers,n=e.users.byId,{recentlyFoundChatIds:a}=e.globalSearch;return{topUserIds:t,usersById:n,recentlyFoundChatIds:a}}),((e,t)=>(0,h.ei)(t,["loadTopUsers","loadContactList","openChat","addRecentlyFoundChatId","clearRecentlyFoundChats"])))((({topUserIds:e,usersById:t,recentlyFoundChatIds:n,onReset:s,loadTopUsers:r,loadContactList:o,openChat:i,addRecentlyFoundChatId:l,clearRecentlyFoundChats:c})=>{const d=(0,a.sO)(null);(0,a.d4)((()=>{Qe((()=>{r(),o()}))}),[r,o]),(0,We.Z)(d.current,!e);const m=(0,a.I4)((e=>{i({id:e,shouldReplaceHistory:!0}),s(),setTimeout((()=>{l({id:e})}),250)}),[i,l,s]),h=(0,M.Z)();return a.ZP.createElement("div",{className:"RecentContacts custom-scroll"},e&&a.ZP.createElement("div",{className:"top-peers-section",dir:h.isRtl?"rtl":void 0},a.ZP.createElement("div",{ref:d,className:"top-peers no-selection"},e.map((e=>a.ZP.createElement("div",{className:"top-peer-item",onClick:()=>m(e),dir:h.isRtl?"rtl":void 0},a.ZP.createElement(D.Z,{user:t[e]}),a.ZP.createElement("div",{className:"top-peer-name"},(0,$.Z)((0,u.Vl)(t[e])||" "))))))),n&&a.ZP.createElement("div",{className:"search-section pt-1"},a.ZP.createElement("h3",{className:"section-heading mt-0 recent-chats-header",dir:h.isRtl?"rtl":void 0},h("Recent"),a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",ariaLabel:"Clear recent chats",onClick:c,isRtl:h.isRtl},a.ZP.createElement("i",{className:"icon-close"}))),n.map((e=>a.ZP.createElement(qe,{chatId:e,onClick:m})))))})));var tt=n(9411),nt=n(8033);const at=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{const n=(0,m.Z1)(e,t);if(!n)return{};const a=(0,u.zX)(n);return{chat:n,lastSyncTime:e.lastSyncTime,...a&&{privateChatUser:(0,m.dy)(e,a)}}}),((e,t)=>(0,h.ei)(t,["focusMessage"])))((({message:e,searchQuery:t,chatId:n,chat:s,privateChatUser:r,focusMessage:o,lastSyncTime:i})=>{const c=(0,u.DH)(e),d=(0,p.Z)((0,u.Ti)(e,"micro")),m=Boolean((0,u.Y5)(e)),h=(0,a.I4)((()=>{o({chatId:n,messageId:e.id})}),[n,o,e.id]),Z=(0,M.Z)(),P=Ve(h);if(s)return a.ZP.createElement(Ee.Z,{className:"ChatMessage chat-item-clickable",ripple:!l.wB,onClick:h,buttonRef:P},a.ZP.createElement(D.Z,{chat:s,user:r,withOnlineStatus:!0,isSavedMessages:null==r?void 0:r.isSelf,lastSyncTime:i}),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"info-row"},a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},(0,$.Z)((0,u.U)(Z,s,r))),s.isVerified&&a.ZP.createElement(tt.Z,null)),a.ZP.createElement("div",{className:"message-date"},a.ZP.createElement(nt.Z,{className:"date"},(0,B.VX)(Z,1e3*e.date)))),a.ZP.createElement("div",{className:"subtitle"},a.ZP.createElement("div",{className:"message",dir:"auto"},function(e,t,n,s,r){return n?a.ZP.createElement("span",{className:"media-preview"},a.ZP.createElement("img",{src:n,alt:"",className:r?"round":void 0}),(0,u.b7)(t)&&a.ZP.createElement("i",{className:"icon-play"}),(0,$.Z)((0,u.MK)(e,t,!0),["emoji","highlight"],{highlight:s})):(0,$.Z)((0,u.MK)(e,t))}(Z,e,d||c,t,m)))))}))),st=(0,a.X$)((({searchDate:e,onSelect:t})=>{const n=(0,a.Ye)((()=>function(e){if(e.match(/^\d{2,4}-\d{2}-\d{2}$/g)){const t=new Date(e);return[{date:t,text:(0,B.xH)(t)}]}const t=[],n=new Date,a=n.getFullYear(),s=n.getTime()>new Date(`${a}-${e}`).getTime()?a:a-1;for(let n=0;n<8;n++){const a=new Date(`${s-n}-${e}`);t.push({date:a,text:(0,B.xH)(a)})}return t}(e)),[e]);return a.ZP.createElement("section",{className:"DateSuggest custom-scroll custom-scroll-x"},n.map((({date:e,text:n})=>a.ZP.createElement("div",{onClick:()=>t(e),className:"date-item",key:n},a.ZP.createElement("i",{className:"icon-calendar"}),a.ZP.createElement("span",null,n)))))}));var rt=n(7262),ot=n(9187);const it=(0,X.P2)((e=>e()),500,!0),lt=(0,a.X$)((0,s.c$)((e=>{var t;const{byId:n}=e.chats,{byId:a}=e.users,{userIds:s}=e.contactList||{};if(!s)return{chatsById:n,usersById:a};const{currentUserId:r,messages:o,lastSyncTime:i}=e,{fetchingStatus:l,globalResults:c,localResults:d,resultsByType:m}=e.globalSearch,{chatIds:u,userIds:h}=c||{},{chatIds:Z,userIds:P}=d||{},{byChatId:g}=o;return{currentUserId:r,localContactIds:s,localChatIds:Z,localUserIds:P,globalChatIds:u,globalUserIds:h,foundIds:null==m||null===(t=m.text)||void 0===t?void 0:t.foundIds,globalMessagesByChatId:g,chatsById:n,usersById:a,fetchingStatus:l,lastSyncTime:i}}),((e,t)=>(0,h.ei)(t,["openChat","addRecentlyFoundChatId","searchMessagesGlobal","setGlobalSearchChatId"])))((({searchQuery:e,searchDate:t,dateSearchQuery:n,currentUserId:s,localContactIds:r,localChatIds:i,localUserIds:c,globalChatIds:d,globalUserIds:m,foundIds:Z,globalMessagesByChatId:P,chatsById:g,usersById:v,fetchingStatus:p,lastSyncTime:E,onReset:C,onSearchDateSelect:f,openChat:b,addRecentlyFoundChatId:y,searchMessagesGlobal:I,setGlobalSearchChatId:S})=>{const N=(0,M.Z)(),[w,k]=(0,a.eJ)(!1),[T,F]=(0,a.eJ)(!1),A=(0,a.I4)((({direction:t})=>{E&&t===o.Uq.Backwards&&it((()=>{I({type:"text",query:e})}))}),[E,I,e]),L=(0,a.I4)((e=>{b({id:e,shouldReplaceHistory:!0}),e!==s&&y({id:e}),l.wB||C()}),[s,b,y,C]),R=(0,a.I4)((e=>{S({id:e})}),[S]),B=(0,a.Ye)((()=>{if(!e||e.startsWith("@")&&e.length<2)return He.D;const t=r?r.filter((t=>{const n=v[t];if(!n)return!1;const a=(0,u.Js)(n);return a&&(0,ue.Z)(a,e)||(0,ue.Z)(n.username,e)})):[];return[...s&&(0,ue.Z)(N("SavedMessages"),e)?[s]:[],...(0,u.ih)((0,h.Tw)([...t,...i||[],...c||[]]),g)]}),[e,r,s,N,i,c,g,v]),$=(0,a.Ye)((()=>!e||e.length<4||!d||!m?He.D:(0,u.ih)((0,h.Tw)([...d,...m]),g,!0)),[g,d,m,e]),D=(0,a.Ye)((()=>(e||t)&&Z&&0!==Z.length?Z.map((e=>{var t;const[n,a]=e.split("_").map(Number);return null==P||null===(t=P[n])||void 0===t?void 0:t.byId[a]})).filter(Boolean).sort(((e,t)=>t.date-e.date)):He.D),[Z,P,e,t]),U=(0,a.I4)((()=>{k(!w)}),[w]),x=(0,a.I4)((()=>{F(!T)}),[T]),O=p&&!p.chats&&!p.messages&&!B.length&&!$.length&&!D.length;return e||t?a.ZP.createElement(pe.Z,{className:"LeftSearch custom-scroll",items:D,onLoadMore:A,noScrollRestoreOnTop:!0,noFastList:!0},n&&a.ZP.createElement("div",{className:"chat-selection no-selection no-scrollbar"},a.ZP.createElement(st,{searchDate:n,onSelect:f})),O&&a.ZP.createElement(rt.Z,{text:N("ChatList.Search.NoResults"),description:N("ChatList.Search.NoResultsDescription")}),!!B.length&&a.ZP.createElement("div",{className:"chat-selection no-selection no-scrollbar",dir:N.isRtl?"rtl":void 0},B.map((e=>a.ZP.createElement(ot.Z,{chatOrUserId:e,onClick:R,clickArg:e})))),!!B.length&&a.ZP.createElement("div",{className:"search-section"},a.ZP.createElement("h3",{className:"section-heading",dir:N.isRtl?"auto":void 0},B.length>3&&a.ZP.createElement(nt.Z,{onClick:U},N(w?"ChatList.Search.ShowLess":"ChatList.Search.ShowMore")),N("DialogList.SearchSectionDialogs")),B.map(((e,t)=>{if(w||!(t>=3))return a.ZP.createElement(qe,{chatId:e,onClick:L})}))),!!$.length&&a.ZP.createElement("div",{className:"search-section"},a.ZP.createElement("h3",{className:"section-heading",dir:N.isRtl?"auto":void 0},$.length>3&&a.ZP.createElement(nt.Z,{onClick:x},N(T?"ChatList.Search.ShowLess":"ChatList.Search.ShowMore")),N("DialogList.SearchSectionGlobal")),$.map(((e,t)=>{if(T||!(t>=3))return a.ZP.createElement(qe,{chatId:e,withUsername:!0,onClick:L})}))),!!D.length&&a.ZP.createElement("div",{className:"search-section"},a.ZP.createElement("h3",{className:"section-heading",dir:N.isRtl?"auto":void 0},N("SearchMessages")),D.map((function(t){const n=(0,u.MK)(N,t),s=g[t.chatId];if(n&&s)return a.ZP.createElement(at,{chatId:t.chatId,message:t,searchQuery:e})})))):a.ZP.createElement(et,{onReset:C})}))),ct=(0,X.P2)((e=>e()),500,!0),dt=(0,a.X$)((0,s.c$)((e=>{const{byId:t}=e.chats,{currentUserId:n,messages:{byChatId:a},lastSyncTime:s}=e,{fetchingStatus:r,resultsByType:o}=e.globalSearch,{foundIds:i}=(null==o?void 0:o.text)||{};return{currentUserId:n,foundIds:i,globalMessagesByChatId:a,chatsById:t,fetchingStatus:r,lastSyncTime:s}}),((e,t)=>(0,h.ei)(t,["searchMessagesGlobal"])))((({searchQuery:e,currentUserId:t,dateSearchQuery:n,foundIds:s,globalMessagesByChatId:r,chatsById:i,fetchingStatus:l,lastSyncTime:c,searchMessagesGlobal:d,onSearchDateSelect:m})=>{const h=(0,M.Z)(),Z=(0,a.I4)((({direction:n})=>{c&&n===o.Uq.Backwards&&ct((()=>{d({type:"text",query:e,chatId:t})}))}),[t,c,d,e]),P=(0,a.Ye)((()=>s&&0!==s.length?s.map((e=>{var t;const[n,a]=e.split("_").map(Number);return null==r||null===(t=r[n])||void 0===t?void 0:t.byId[a]})).filter(Boolean).sort(((e,t)=>t.date-e.date)):He.D),[s,r]),g=l&&!l.chats&&!l.messages&&!P.length;return a.ZP.createElement("div",{className:"LeftSearch"},a.ZP.createElement(pe.Z,{className:"search-content custom-scroll chat-list",items:P,onLoadMore:Z,noFastList:!0},n&&a.ZP.createElement("div",{className:"chat-selection no-selection no-scrollbar"},a.ZP.createElement(st,{searchDate:n,onSelect:m})),g&&a.ZP.createElement(rt.Z,{text:h("ChatList.Search.NoResults"),description:h("ChatList.Search.NoResultsDescription")}),!!P.length&&P.map((function(t){const n=(0,u.MK)(h,t),s=i[t.chatId];if(n&&s)return a.ZP.createElement(at,{chatId:t.chatId,message:t,searchQuery:e})}))))})));function mt(e){return(t,n)=>{var a;const{byId:s}=t.chats,{byId:r}=t.users,{fetchingStatus:o,resultsByType:i,chatId:l}=t.globalSearch,c="audio"!==e?e:null!=n&&n.isVoice?"voice":"audio",{byChatId:d}=t.messages,u=null==i||null===(a=i[c])||void 0===a?void 0:a.foundIds;return{theme:(0,m.Pu)(t),isLoading:void 0===u||!!o&&Boolean(o.chats||o.messages),chatsById:s,usersById:r,globalMessagesByChatId:d,foundIds:u,searchChatId:l,lastSyncTime:t.lastSyncTime}}}var ut=n(7891),ht=n(3709);const Zt="media",Pt=(0,X.P2)((e=>e()),500,!0),gt=(0,a.X$)((0,s.c$)(mt(Zt),((e,t)=>(0,h.ei)(t,["searchMessagesGlobal","openMediaViewer"])))((({searchQuery:e,searchChatId:t,isLoading:n,globalMessagesByChatId:s,foundIds:r,lastSyncTime:l,searchMessagesGlobal:c,openMediaViewer:d})=>{const m=(0,M.Z)(),u=(0,a.I4)((({direction:n})=>{l&&n===o.Uq.Backwards&&Pt((()=>{c({type:Zt,query:e,chatId:t})}))}),[l,c,e,t]),h=(0,a.Ye)((()=>r&&s?r.map((e=>{var t;const[n,a]=e.split("_").map(Number);return null===(t=s[n])||void 0===t?void 0:t.byId[a]})).filter(Boolean):He.D),[s,r]),Z=(0,a.I4)(((e,t)=>{d({chatId:t,messageId:e,origin:o.bZ.SearchResult})}),[d]),P=(0,ut.Z)([e],i.Y)&&!n,g=P&&r&&r.length>0&&!e,v=P&&r&&r.length>0&&e,p=(0,Y.Z)("search-content custom-scroll",v&&"chat-list");return a.ZP.createElement("div",{className:"LeftSearch"},a.ZP.createElement(pe.Z,{className:p,items:h,itemSelector:e?".ListItem":".Media",onLoadMore:u,noFastList:!0},!P&&a.ZP.createElement(Pe.Z,null),P&&(!r||0===r.length)&&a.ZP.createElement(rt.Z,{text:m("ChatList.Search.NoResults"),description:m("ChatList.Search.NoResultsDescription")}),g&&a.ZP.createElement("div",{className:"media-list",dir:m.isRtl?"rtl":void 0},h.map((e=>a.ZP.createElement(ht.Z,{key:e.id,idPrefix:"search-media",message:e,onClick:Z})))),v&&h.map((e=>a.ZP.createElement(at,{key:e.id,chatId:e.chatId,message:e})))))})));function vt(e,t,n,a){const{senderId:s}=t;if(!s)return;const r=(0,u.YA)(s)?a[s]:n[s];let o=(0,u.OU)(e,r);const i=n[t.chatId];return i&&((0,u.YA)(s)&&r.isSelf?o=`${e("FromYou")} → ${(0,u.U)(e,i)}`:(0,u.Bf)(i)&&(o+=` → ${(0,u.U)(e,i)}`)),o}var pt=n(5418);const Et="links",Ct=(0,X.P2)((e=>e()),500,!0),ft=(0,a.X$)((0,s.c$)(mt(Et),((e,t)=>(0,h.ei)(t,["searchMessagesGlobal","focusMessage"])))((({searchQuery:e,searchChatId:t,isLoading:n,chatsById:s,usersById:r,globalMessagesByChatId:l,foundIds:c,lastSyncTime:d,searchMessagesGlobal:m,focusMessage:u})=>{const h=(0,M.Z)(),Z=(0,a.I4)((({direction:n})=>{d&&n===o.Uq.Backwards&&Ct((()=>{m({type:Et,query:e,chatId:t})}))}),[d,m,e,t]),P=(0,a.Ye)((()=>c&&l?c.map((e=>{var t;const[n,a]=e.split("_").map(Number);return null===(t=l[n])||void 0===t?void 0:t.byId[a]})).filter(Boolean):He.D),[l,c]),g=(0,a.I4)(((e,t)=>{u({chatId:t,messageId:e})}),[u]),v=(0,ut.Z)([e],i.Y)&&!n;return a.ZP.createElement("div",{className:"LeftSearch"},a.ZP.createElement(pe.Z,{className:"search-content documents-list custom-scroll",items:P,onLoadMore:Z,noFastList:!0},!v&&a.ZP.createElement(Pe.Z,null),v&&(!c||0===c.length)&&a.ZP.createElement(rt.Z,{text:h("ChatList.Search.NoResults"),description:h("ChatList.Search.NoResultsDescription")}),v&&c&&c.length>0&&P.map(((e,t)=>{const n=0===t||(0,B.kj)(e.date)!==(0,B.kj)(P[t-1].date);return a.ZP.createElement("div",{className:"ListItem small-icon",dir:h.isRtl?"rtl":void 0,key:e.id},n&&a.ZP.createElement("p",{className:"section-heading",dir:h.isRtl?"rtl":void 0},(0,B.np)(h,new Date(1e3*e.date))),a.ZP.createElement(pt.Z,{key:e.id,message:e,senderTitle:vt(h,e,s,r),onMessageClick:g}))}))))})));var bt=n(2535);const yt="documents",It=(0,X.P2)((e=>e()),500,!0),St=(0,a.X$)((0,s.c$)(mt(yt),((e,t)=>(0,h.ei)(t,["searchMessagesGlobal","focusMessage"])))((({searchQuery:e,searchChatId:t,isLoading:n,chatsById:s,usersById:r,globalMessagesByChatId:l,foundIds:c,lastSyncTime:d,searchMessagesGlobal:m,focusMessage:h})=>{const Z=(0,M.Z)(),P=(0,a.I4)((({direction:n})=>{d&&n===o.Uq.Backwards&&It((()=>{m({type:yt,query:e,chatId:t})}))}),[d,m,e,t]),g=(0,a.Ye)((()=>c&&l?c.map((e=>{var t;const[n,a]=e.split("_").map(Number),s=null===(t=l[n])||void 0===t?void 0:t.byId[a];return s&&(0,u.aE)(s)?s:void 0})).filter(Boolean):He.D),[l,c]),v=(0,a.I4)(((e,t)=>{h({chatId:t,messageId:e})}),[h]),p=(0,ut.Z)([e],i.Y)&&!n;return a.ZP.createElement("div",{className:"LeftSearch"},a.ZP.createElement(pe.Z,{className:"search-content documents-list custom-scroll",items:g,onLoadMore:P,noFastList:!0},!p&&a.ZP.createElement(Pe.Z,null),p&&(!c||0===c.length)&&a.ZP.createElement(rt.Z,{text:Z("ChatList.Search.NoResults"),description:Z("ChatList.Search.NoResultsDescription")}),p&&c&&c.length>0&&g.map(((e,t)=>{const n=0===t||(0,B.kj)(e.date)!==(0,B.kj)(g[t-1].date);return a.ZP.createElement("div",{className:"ListItem small-icon",key:e.id},n&&a.ZP.createElement("p",{className:"section-heading"},(0,B.np)(Z,new Date(1e3*e.date))),a.ZP.createElement(bt.Z,{message:e,withDate:!0,datetime:e.date,smaller:!0,sender:vt(Z,e,s,r),className:"scroll-item",onDateClick:v}))}))))})));var Nt=n(4752);const wt=(0,X.P2)((e=>e()),500,!0),kt=(0,a.X$)((0,s.c$)(mt("audio"),((e,t)=>(0,h.ei)(t,["searchMessagesGlobal","focusMessage","openAudioPlayer"])))((({theme:e,isVoice:t,searchQuery:n,searchChatId:s,isLoading:r,chatsById:l,usersById:c,globalMessagesByChatId:d,foundIds:m,lastSyncTime:u,searchMessagesGlobal:h,focusMessage:Z,openAudioPlayer:P})=>{const g=(0,M.Z)(),v=t?"voice":"audio",p=(0,a.I4)((({direction:e})=>{u&&e===o.Uq.Backwards&&wt((()=>{h({type:v,query:n,chatId:s})}))}),[v,u,h,n,s]),E=(0,a.Ye)((()=>m&&d?m.map((e=>{var t;const[n,a]=e.split("_").map(Number);return null===(t=d[n])||void 0===t?void 0:t.byId[a]})).filter(Boolean):He.D),[d,m]),C=(0,a.I4)(((e,t)=>{Z({chatId:t,messageId:e})}),[Z]),f=(0,a.I4)(((e,t)=>{P({chatId:t,messageId:e})}),[P]),b=(0,ut.Z)([n],i.Y)&&!r;return a.ZP.createElement("div",{className:"LeftSearch"},a.ZP.createElement(pe.Z,{className:"search-content documents-list custom-scroll",items:E,onLoadMore:p,noFastList:!0},!b&&a.ZP.createElement(Pe.Z,null),b&&(!m||0===m.length)&&a.ZP.createElement(rt.Z,{text:g("ChatList.Search.NoResults"),description:g("ChatList.Search.NoResultsDescription")}),b&&m&&m.length>0&&E.map(((t,n)=>{const s=0===n||(0,B.kj)(t.date)!==(0,B.kj)(E[n-1].date);return a.ZP.createElement("div",{className:"ListItem small-icon",key:t.id},s&&a.ZP.createElement("p",{className:"section-heading",dir:g.isRtl?"rtl":void 0},(0,B.np)(g,new Date(1e3*t.date))),a.ZP.createElement(Nt.Z,{key:t.id,theme:e,message:t,target:"searchResult",senderTitle:vt(g,t,l,c),date:t.date,lastSyncTime:u,className:"scroll-item",onPlay:f,onDateClick:C}))}))))}))),Mt=[{type:o.nJ.ChatList,title:"SearchAllChatsShort"},{type:o.nJ.Media,title:"SharedMediaTab2"},{type:o.nJ.Links,title:"SharedLinksTab2"},{type:o.nJ.Files,title:"SharedFilesTab2"},{type:o.nJ.Music,title:"SharedMusicTab2"},{type:o.nJ.Voice,title:"SharedVoiceTab2"}],Tt=[{type:o.nJ.ChatList,title:"All Messages"},...Mt.slice(1)],Ft=Object.keys(o.nJ).length/2,At=(0,a.X$)((0,s.c$)((e=>{const{currentContent:t,chatId:n}=e.globalSearch;return{currentContent:t,chatId:n}}),((e,t)=>(0,h.ei)(t,["setGlobalSearchContent","setGlobalSearchDate"])))((({searchQuery:e,searchDate:t,isActive:n,currentContent:s=o.nJ.ChatList,chatId:r,setGlobalSearchContent:i,setGlobalSearchDate:l,onReset:c})=>{const d=(0,M.Z)(),[m,u]=(0,a.eJ)(s),h=(0,a.Ye)((()=>(0,B.xk)(e)),[e]),Z=(0,a.I4)((e=>{const t=Mt[e];i({content:t.type}),u(e)}),[i]),P=(0,a.I4)((e=>{l({date:e.getTime()/1e3})}),[l]);(0,T.ZP)(n,c,void 0,void 0,!0);const g=(0,a.sO)(null),v=(0,Ze.Z)(g,n,void 0,".ListItem-button",!0);return a.ZP.createElement("div",{className:"LeftSearch",ref:g,onKeyDown:v},a.ZP.createElement(_e.Z,{activeTab:m,tabs:r?Tt:Mt,onSwitchTab:Z}),a.ZP.createElement(L.Z,{name:d.isRtl?"slide-reversed":"slide",renderCount:Ft,activeKey:s},(()=>{switch(s){case o.nJ.ChatList:return r?a.ZP.createElement(dt,{searchQuery:e,dateSearchQuery:h,onReset:c,onSearchDateSelect:P}):a.ZP.createElement(lt,{searchQuery:e,searchDate:t,dateSearchQuery:h,onReset:c,onSearchDateSelect:P});case o.nJ.Media:return a.ZP.createElement(gt,{searchQuery:e});case o.nJ.Links:return a.ZP.createElement(ft,{searchQuery:e});case o.nJ.Files:return a.ZP.createElement(St,{searchQuery:e});case o.nJ.Music:return a.ZP.createElement(kt,{key:"audio",searchQuery:e});case o.nJ.Voice:return a.ZP.createElement(kt,{key:"voice",isVoice:!0,searchQuery:e});default:return}})))})));var Lt=n(1090);const Rt={currentPassword:"",password:"",hint:"",email:""},Bt=(e,t)=>{switch(t.type){case"setCurrentPassword":return{...e,currentPassword:t.payload};case"setPassword":return{...e,password:t.payload};case"setHint":return{...e,hint:t.payload};case"setEmail":return{...e,email:t.payload};case"reset":return Rt;default:return e}},$t=(0,a.X$)((0,s.c$)(void 0,((e,t)=>(0,h.ei)(t,["signOut","deleteChatFolder"])))((({currentScreen:e,editedFolderId:t,onReset:n,onSaveFilter:s,signOut:r,deleteChatFolder:i,onScreenSelect:c})=>{const[d,m]=(0,a.eJ)(!1),[u,h]=(0,a.eJ)(!1),Z=(0,a.I4)((()=>{m(!0)}),[]),P=(0,a.I4)((()=>{m(!1)}),[]),g=(0,a.I4)((()=>{h(!0)}),[]),v=(0,a.I4)((()=>{h(!1)}),[]),p=(0,a.I4)((()=>{P(),r()}),[P,r]),E=(0,a.I4)((()=>{v(),i({id:t}),n()}),[t,v,i,n]),C=(0,a.Ye)((()=>({onTrigger:e,isOpen:t})=>a.ZP.createElement(R.Z,{round:!0,ripple:!l.wB,size:"smaller",color:"translucent",className:t?"active":"",onClick:e,ariaLabel:"More actions"},a.ZP.createElement("i",{className:"icon-more"}))),[]),f=(0,M.Z)();return a.ZP.createElement("div",{className:"left-header"},a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",onClick:n,ariaLabel:f("AccDescrGoBack")},a.ZP.createElement("i",{className:"icon-arrow-left"})),function(){switch(e){case o.MT.EditProfile:return a.ZP.createElement("h3",null,f("lng_settings_information"));case o.MT.General:return a.ZP.createElement("h3",null,f("General"));case o.MT.Notifications:return a.ZP.createElement("h3",null,f("Notifications"));case o.MT.Privacy:return a.ZP.createElement("h3",null,f("PrivacySettings"));case o.MT.Language:return a.ZP.createElement("h3",null,f("Language"));case o.MT.GeneralChatBackground:return a.ZP.createElement("h3",null,f("ChatBackground"));case o.MT.GeneralChatBackgroundColor:return a.ZP.createElement("h3",null,f("SetColor"));case o.MT.PrivacyPhoneNumber:return a.ZP.createElement("h3",null,f("PrivacyPhone"));case o.MT.PrivacyLastSeen:return a.ZP.createElement("h3",null,f("PrivacyLastSeen"));case o.MT.PrivacyProfilePhoto:return a.ZP.createElement("h3",null,f("Privacy.ProfilePhoto"));case o.MT.PrivacyForwarding:return a.ZP.createElement("h3",null,f("PrivacyForwards"));case o.MT.PrivacyGroupChats:return a.ZP.createElement("h3",null,f("AutodownloadGroupChats"));case o.MT.PrivacyPhoneNumberAllowedContacts:case o.MT.PrivacyLastSeenAllowedContacts:case o.MT.PrivacyProfilePhotoAllowedContacts:case o.MT.PrivacyForwardingAllowedContacts:case o.MT.PrivacyGroupChatsAllowedContacts:return a.ZP.createElement("h3",null,f("AlwaysShareWith"));case o.MT.PrivacyPhoneNumberDeniedContacts:case o.MT.PrivacyLastSeenDeniedContacts:case o.MT.PrivacyProfilePhotoDeniedContacts:case o.MT.PrivacyForwardingDeniedContacts:case o.MT.PrivacyGroupChatsDeniedContacts:return a.ZP.createElement("h3",null,f("NeverShareWith"));case o.MT.PrivacyActiveSessions:return a.ZP.createElement("h3",null,f("SessionsTitle"));case o.MT.PrivacyBlockedUsers:return a.ZP.createElement("h3",null,f("BlockedUsers"));case o.MT.TwoFaDisabled:case o.MT.TwoFaEnabled:return a.ZP.createElement("h3",null,f("TwoStepVerification"));case o.MT.TwoFaNewPassword:case o.MT.TwoFaChangePasswordNew:case o.MT.TwoFaChangePasswordConfirm:return a.ZP.createElement("h3",null,f("PleaseEnterCurrentPassword"));case o.MT.TwoFaNewPasswordConfirm:return a.ZP.createElement("h3",null,f("PleaseReEnterPassword"));case o.MT.TwoFaNewPasswordHint:case o.MT.TwoFaChangePasswordHint:return a.ZP.createElement("h3",null,f("PasswordHint"));case o.MT.TwoFaNewPasswordEmail:case o.MT.TwoFaRecoveryEmail:return a.ZP.createElement("h3",null,f("RecoveryEmailTitle"));case o.MT.TwoFaNewPasswordEmailCode:case o.MT.TwoFaRecoveryEmailCode:return a.ZP.createElement("h3",null,"Recovery Email Code");case o.MT.TwoFaCongratulations:return a.ZP.createElement("h3",null,f("TwoStepVerificationPasswordSet"));case o.MT.TwoFaChangePasswordCurrent:case o.MT.TwoFaTurnOff:case o.MT.TwoFaRecoveryEmailCurrentPassword:return a.ZP.createElement("h3",null,f("PleaseEnterCurrentPassword"));case o.MT.Folders:return a.ZP.createElement("h3",null,f("Filters"));case o.MT.FoldersCreateFolder:return a.ZP.createElement("h3",null,f("FilterNew"));case o.MT.FoldersEditFolder:case o.MT.FoldersEditFolderFromChatList:return a.ZP.createElement("div",{className:"settings-main-header"},a.ZP.createElement("h3",null,f("FilterEdit")),t&&a.ZP.createElement(O.Z,{className:"settings-more-menu",trigger:C,positionX:"right"},a.ZP.createElement(G.Z,{icon:"delete",destructive:!0,onClick:g},f("Delete"))));case o.MT.FoldersIncludedChats:case o.MT.FoldersIncludedChatsFromChatList:case o.MT.FoldersExcludedChats:case o.MT.FoldersExcludedChatsFromChatList:return a.ZP.createElement("div",{className:"settings-main-header"},e===o.MT.FoldersIncludedChats||e===o.MT.FoldersIncludedChatsFromChatList?a.ZP.createElement("h3",null,f("FilterInclude")):a.ZP.createElement("h3",null,f("FilterExclude")),a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",className:"color-primary",onClick:s,ariaLabel:f("AutoDeleteConfirm")},a.ZP.createElement("i",{className:"icon-check"})));default:return a.ZP.createElement("div",{className:"settings-main-header"},a.ZP.createElement("h3",null,f("SETTINGS")),a.ZP.createElement(R.Z,{round:!0,ripple:!l.wB,size:"smaller",color:"translucent",onClick:()=>c(o.MT.EditProfile),ariaLabel:f("lng_settings_information")},a.ZP.createElement("i",{className:"icon-edit"})),a.ZP.createElement(O.Z,{className:"settings-more-menu",trigger:C,positionX:"right"},a.ZP.createElement(G.Z,{icon:"logout",onClick:Z},f("LogOutTitle"))))}}(),a.ZP.createElement(Me.Z,{isOpen:d,onClose:P,text:f("lng_sure_logout"),confirmLabel:f("AccountSettings.Logout"),confirmHandler:p,confirmIsDestructive:!0}),a.ZP.createElement(Me.Z,{isOpen:u,onClose:v,text:f("FilterDeleteAlert"),confirmLabel:f("Delete"),confirmHandler:E,confirmIsDestructive:!0}))})));var Dt=n(787),Ut=n(180);const xt=(0,a.X$)((0,s.c$)((e=>{const{currentUserId:t,lastSyncTime:n}=e;return{currentUser:t?(0,m.dy)(e,t):void 0,lastSyncTime:n}}),((e,t)=>(0,h.ei)(t,["loadProfilePhotos"])))((({isActive:e,onScreenSelect:t,onReset:n,loadProfilePhotos:s,currentUser:r,lastSyncTime:i})=>{const l=(0,M.Z)(),c=null==r?void 0:r.id;return(0,a.d4)((()=>{c&&i&&s({profileId:c})}),[i,c,s]),(0,T.ZP)(e,n,t,o.MT.Main),a.ZP.createElement("div",{className:"settings-content custom-scroll"},a.ZP.createElement("div",{className:"settings-main-menu"},r&&a.ZP.createElement(Dt.Z,{userId:r.id,forceShowSelf:!0}),r&&a.ZP.createElement(Ut.Z,{chatOrUserId:r.id,forceShowSelf:!0}),a.ZP.createElement(Ee.Z,{icon:"settings",onClick:()=>t(o.MT.General)},l("Telegram.GeneralSettingsViewController")),a.ZP.createElement(Ee.Z,{icon:"unmute",onClick:()=>t(o.MT.Notifications)},l("Notifications")),a.ZP.createElement(Ee.Z,{icon:"lock",onClick:()=>t(o.MT.Privacy)},l("PrivacySettings")),a.ZP.createElement(Ee.Z,{icon:"folder",onClick:()=>t(o.MT.Folders)},l("Filters")),a.ZP.createElement(Ee.Z,{icon:"language",onClick:()=>t(o.MT.Language)},l("Language"))))})));var Ot=n(710),Gt=n(1151);const Jt="https://t.me/",zt=/https:\/\/t\.me\/?/i,Xt=/^([a-zA-Z0-9_]+)$/,Yt=(0,X.Ds)((e=>e()),250,!1),_t=(0,a.X$)((({currentUsername:e,asLink:t,isLoading:n,isUsernameAvailable:s,checkUsername:r,onChange:o})=>{const[i,l]=(0,a.eJ)(e||""),c=(0,M.Z)(),d=t?"SetUrl":"Username",m=c(t?"SetUrlPlaceholder":"Username"),[u,h]=(0,a.Ye)((()=>i.length?i.length<5?[void 0,`${m} is too short`]:i.length>32?[void 0,`${m} is too long`]:Xt.test(i)?void 0===s?[]:[s?c(`${d}Available`,"Username"):void 0,!1===s?c(`${d}InUse`):void 0]:[void 0,`${m} contains invalid characters`]:[]),[i,s,c,d,m]);(0,a.d4)((()=>{l(e||"")}),[t,e]);const Z=(0,a.I4)((e=>{const n=e.target.value.trim().replace(zt,"");l(n),e.target.value=`${t?Jt:""}${n}`;const a=function(e){return e.length>=5&&e.length<=32&&Xt.test(e)}(n);a&&Yt((()=>{r({username:n})})),o&&o(!!a&&n)}),[t,r,o]);return a.ZP.createElement(ve.Z,{value:`${t?Jt:""}${i}`,onChange:Z,label:m,error:h,success:u,readOnly:n})})),Ht=(0,X.P2)((e=>e()),6e4,!0),jt="Please provide your first name",Vt="Bio can' be longer than 70 characters",Kt=(0,a.X$)((0,s.c$)((e=>{const{currentUserId:t}=e,{progress:n,isUsernameAvailable:a}=e.profileEdit||{},s=t?(0,m.dy)(e,t):void 0;if(!s)return{progress:n,isUsernameAvailable:a};const{firstName:r,lastName:o,username:i,fullInfo:l}=s,{bio:c}=l||{};return{currentAvatarHash:(0,u.RT)(s),currentFirstName:r,currentLastName:o,currentBio:c,currentUsername:i,progress:n,isUsernameAvailable:a}}),((e,t)=>(0,h.ei)(t,["loadCurrentUser","updateProfile","checkUsername"])))((({isActive:e,onScreenSelect:t,onReset:n,currentAvatarHash:s,currentFirstName:i,currentLastName:l,currentBio:c,currentUsername:d,progress:m,isUsernameAvailable:u,loadCurrentUser:h,updateProfile:Z,checkUsername:P})=>{const g=(0,M.Z)(),[v,E]=(0,a.eJ)(!1),[C,f]=(0,a.eJ)(!1),[b,y]=(0,a.eJ)(),[I,S]=(0,a.eJ)(),[N,w]=(0,a.eJ)(i||""),[k,A]=(0,a.eJ)(l||""),[L,R]=(0,a.eJ)(c||""),[B,D]=(0,a.eJ)(d||""),U=(0,p.Z)(s,!1,r.IU.BlobUrl),x=m===o.rN.InProgress,O=!1===B,G=(0,a.Ye)((()=>!O&&(Boolean(I)||C||!0===u)),[I,C,O,u]);(0,T.ZP)(e,n,t,o.MT.EditProfile),(0,a.d4)((()=>{Ht((()=>{h()}))}),[h]),(0,a.d4)((()=>{S(void 0)}),[U]),(0,a.d4)((()=>{w(i||""),A(l||""),R(c||"")}),[i,l,c]),(0,a.d4)((()=>{D(d||"")}),[d]),(0,a.d4)((()=>{m===o.rN.Complete&&(f(!1),E(!1),y(void 0))}),[m]);const J=(0,a.I4)((e=>{S(e)}),[]),z=(0,a.I4)((e=>{w(e.target.value),f(!0)}),[]),X=(0,a.I4)((e=>{A(e.target.value),f(!0)}),[]),Y=(0,a.I4)((e=>{R(e.target.value),f(!0)}),[]),_=(0,a.I4)((e=>{D(e),E(!0)}),[]),H=(0,a.I4)((()=>{const e=N.trim(),t=k.trim(),n=L.trim();e.length?n.length>70?y(Vt):Z({photo:I,...C&&{firstName:e,lastName:t,bio:n},...v&&{username:B}}):y(jt)}),[I,N,k,L,C,B,v,Z]);return a.ZP.createElement("div",{className:"settings-fab-wrapper"},a.ZP.createElement("div",{className:"settings-content custom-scroll"},a.ZP.createElement("div",{className:"settings-edit-profile"},a.ZP.createElement(Ot.Z,{currentAvatarBlobUrl:U,onChange:J,title:"Edit your profile photo",disabled:x}),a.ZP.createElement(ve.Z,{value:N,onChange:z,label:g("FirstName"),disabled:x,error:b===jt?b:void 0}),a.ZP.createElement(ve.Z,{value:k,onChange:X,label:g("LastName"),disabled:x}),a.ZP.createElement(ve.Z,{value:L,onChange:Y,label:g("UserBio"),disabled:x,error:b===Vt?b:void 0}),a.ZP.createElement("p",{className:"settings-item-description",dir:g.isRtl?"rtl":void 0},(0,$.Z)(g("lng_settings_about_bio"),["br","simple_markdown"]))),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:g.isRtl?"rtl":void 0},g("Username")),a.ZP.createElement(_t,{currentUsername:B||"",isLoading:x,isUsernameAvailable:u,checkUsername:P,onChange:_}),a.ZP.createElement("p",{className:"settings-item-description",dir:g.isRtl?"rtl":void 0},(0,$.Z)(g("UsernameHelp"),["br","simple_markdown"])),B&&a.ZP.createElement("p",{className:"settings-item-description",dir:g.isRtl?"rtl":void 0},g("lng_username_link"),a.ZP.createElement("br",null),a.ZP.createElement("span",{className:"username-link"},"https://t.me/",B)))),a.ZP.createElement(Gt.Z,{isShown:G,onClick:H,disabled:x,ariaLabel:"Save changes"},x?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-check"})))})));var qt=n(7324),Wt=n(7799);const Qt=(0,X.P2)((e=>e()),6e4,!0),en=(0,a.X$)((0,s.c$)((e=>{const{chats:{byId:t},users:{byId:n}}=e,{orderedIds:a,byId:s,recommended:r}=e.chatFolders;return{chatsById:t,usersById:n,orderedFolderIds:a,foldersById:s,recommendedChatFolders:r,notifySettings:(0,m.dZ)(e),notifyExceptions:(0,m.NJ)(e)}}),((e,t)=>(0,h.ei)(t,["loadRecommendedChatFolders","addChatFolder","showDialog"])))((({onCreateFolder:e,onEditFolder:t,isActive:n,onScreenSelect:s,onReset:r,chatsById:l,usersById:c,orderedFolderIds:d,foldersById:m,recommendedChatFolders:h,notifySettings:Z,notifyExceptions:P,loadRecommendedChatFolders:g,addChatFolder:v,showDialog:p})=>{const[E,C]=(0,a.eJ)(),[f,b]=(0,a.eJ)(!1),y=(0,a.I4)((()=>b(!0)),[]);(0,a.d4)((()=>{E||(0,qt.Z)("FoldersAll").then(C)}),[E]),(0,a.d4)((()=>{Qt((()=>{g()}))}),[g]);const I=(0,a.I4)((()=>{Object.keys(m).length>=10?p({data:{message:"DIALOG_FILTERS_TOO_MUCH",hasErrorKey:!0}}):e()}),[m,p,e]),S=(0,M.Z)();(0,T.ZP)(n,r,s,o.MT.Folders);const N=(0,a.Ye)((()=>{if(!d)return;const e=Object.keys(l).map(Number);return d.map((t=>{const n=m[t];return{id:n.id,title:n.title,subtitle:(0,u.SB)(S,l,c,n,e,Z,P)}}))}),[d,l,m,c,Z,P,S]),w=(0,a.I4)((e=>{Object.keys(m).length>=10?p({data:{message:"DIALOG_FILTERS_TOO_MUCH",hasErrorKey:!0}}):v({folder:e})}),[m,v,p]);return a.ZP.createElement("div",{className:"settings-content custom-scroll"},a.ZP.createElement("div",{className:"settings-content-header"},a.ZP.createElement("div",{className:"settings-content-icon"},E&&a.ZP.createElement(Wt.Z,{id:"settingsFoldersMain",size:i.ku,animationData:E,play:f,noLoop:!0,onLoad:y})),a.ZP.createElement("p",{className:"settings-item-description mb-3",dir:"auto"},S("CreateNewFilterInfo")),a.ZP.createElement(R.Z,{className:"with-icon mb-2",color:"primary",size:"smaller",pill:!0,fluid:!0,onClick:I,isRtl:S.isRtl},a.ZP.createElement("i",{className:"icon-add"}),S("CreateNewFilter"))),a.ZP.createElement("div",{className:"settings-item pt-3"},a.ZP.createElement("h4",{className:"settings-item-header mb-3",dir:S.isRtl?"rtl":void 0},S("Filters")),null!=N&&N.length?N.map((e=>a.ZP.createElement(Ee.Z,{className:"mb-2 no-icon",narrow:!0,multiline:!0,onClick:()=>t(m[e.id])},a.ZP.createElement("span",{className:"title"},e.title),a.ZP.createElement("span",{className:"subtitle"},e.subtitle)))):N&&!N.length?a.ZP.createElement("p",{className:"settings-item-description my-4",dir:"auto"},"You have no folders yet."):a.ZP.createElement(Pe.Z,null)),h&&!!h.length&&a.ZP.createElement("div",{className:"settings-item pt-3"},a.ZP.createElement("h4",{className:"settings-item-header mb-3",dir:S.isRtl?"rtl":void 0},S("FilterRecommended")),h.map((e=>a.ZP.createElement(Ee.Z,{className:"mb-2",narrow:!0,onClick:()=>w(e)},a.ZP.createElement("div",{className:"settings-folders-recommended-item"},a.ZP.createElement("div",{className:"multiline-item"},a.ZP.createElement("span",{className:"title"},e.title),a.ZP.createElement("span",{className:"subtitle"},e.description)),a.ZP.createElement(R.Z,{className:"px-3",color:"primary",size:"tiny",pill:!0,fluid:!0,isRtl:S.isRtl},S("Add"))))))))})));var tn=n(3455);const nn=({count:e,itemName:t,itemPluralName:n,isLoading:s,onClick:r})=>{const o=(0,M.Z)();return a.ZP.createElement(R.Z,{className:"ShowMoreButton",color:"translucent",size:"smaller",isText:!0,isLoading:s,isRtl:o.isRtl,onClick:r},a.ZP.createElement("i",{className:"icon-down"}),"Show ",e," more ",e>1?n||`${t}s`:t)},an="Please provide a title for this folder.",sn="ChatList.Filter.Error.Empty",rn=(0,a.X$)((0,s.c$)((e=>{const{listIds:t}=e.chats;return{loadedActiveChatIds:t.active,loadedArchivedChatIds:t.archived}}),((e,t)=>(0,h.ei)(t,["editChatFolder","addChatFolder","loadMoreChats"])))((({state:e,dispatch:t,onAddIncludedChats:n,onAddExcludedChats:s,isActive:r,onScreenSelect:l,onReset:c,onBack:d,loadedActiveChatIds:m,loadedArchivedChatIds:Z,editChatFolder:P,addChatFolder:g,loadMoreChats:v})=>{const[p,E]=(0,a.eJ)(),[C,f]=(0,a.eJ)(!1),b=(0,a.I4)((()=>f(!0)),[]),[y,I]=(0,a.eJ)(!1),[S,N]=(0,a.eJ)(!1),{selectedChatIds:w,selectedChatTypes:k}=(0,tn.vb)(e,"included"),{selectedChatIds:A,selectedChatTypes:L}=(0,tn.vb)(e,"excluded");(0,a.d4)((()=>{p||(0,qt.Z)("FoldersNew").then(E)}),[p]),(0,a.d4)((()=>{I(!1),N(!1)}),[e.folderId]);const[R,B]=(0,a.Ye)((()=>{const e=new Set([...m||[],...Z||[]]),t=(0,h.eL)(w,e),n=(0,h.eL)(A,e);return[y?t:t.slice(0,5-k.length),S?n:n.slice(0,5-L.length)]}),[A,w,k,L,S,y,m,Z]);(0,a.d4)((()=>{(R.lengthI(!0):()=>N(!0);return a.ZP.createElement(a.ZP.Fragment,null,t.map((t=>function(e,t){const n="included"===t?tn.fi.find((({key:t})=>t===e)):tn.Yy.find((({key:t})=>t===e));if(n)return a.ZP.createElement(Ee.Z,{key:n.key,className:"settings-folders-list-item mb-1",icon:n.icon,narrow:!0,inactive:!0},$(n.title))}(t,e))),n.map((e=>a.ZP.createElement(Ee.Z,{className:"settings-folders-list-item mb-1",narrow:!0,inactive:!0},(0,u.YA)(e)?a.ZP.createElement(Ce.Z,{avatarSize:"small",userId:e}):a.ZP.createElement(fe.Z,{avatarSize:"small",chatId:e})))),!s&&r>0&&a.ZP.createElement(nn,{count:r,itemName:"chat",onClick:o}))}return(0,T.ZP)(r,d,l,"edit"===e.mode?o.MT.FoldersEditFolder:o.MT.FoldersCreateFolder),a.ZP.createElement("div",{className:"settings-fab-wrapper"},a.ZP.createElement("div",{className:"settings-content custom-scroll"},a.ZP.createElement("div",{className:"settings-content-header"},a.ZP.createElement("div",{className:"settings-content-icon"},p&&a.ZP.createElement(Wt.Z,{id:"settingsFoldersEdit",size:i.ku,animationData:p,play:C&&String(e.folderId),noLoop:!0,onLoad:b})),"create"===e.mode&&a.ZP.createElement("p",{className:"settings-item-description mb-3",dir:$.isRtl?"rtl":void 0},$("FilterIncludeInfo")),a.ZP.createElement(ve.Z,{className:"mb-0",label:$("FilterNameHint"),value:e.folder.title,onChange:function(e){const{currentTarget:n}=e;t({type:"setTitle",payload:n.value.trim()})},error:e.error&&e.error===an?an:void 0})),a.ZP.createElement("div",{className:"settings-item no-border pt-3"},e.error&&e.error===sn&&a.ZP.createElement("p",{className:"settings-item-description color-danger mb-2",dir:$.isRtl?"rtl":void 0},$(e.error)),a.ZP.createElement("h4",{className:"settings-item-header mb-3",dir:$.isRtl?"rtl":void 0},$("FilterInclude")),a.ZP.createElement(Ee.Z,{className:"settings-folders-list-item color-primary mb-0",icon:"add",onClick:n},$("FilterAddChats")),D("included")),a.ZP.createElement("div",{className:"settings-item no-border pt-3"},a.ZP.createElement("h4",{className:"settings-item-header mb-3",dir:$.isRtl?"rtl":void 0},$("FilterExclude")),a.ZP.createElement(Ee.Z,{className:"settings-folders-list-item color-primary mb-0",icon:"add",onClick:s},$("FilterAddChats")),D("excluded"))),a.ZP.createElement(Gt.Z,{isShown:!!e.isTouched,disabled:e.isLoading,onClick:function(){const{title:n}=e.folder;n?w.length||Object.keys(k).length?(t({type:"setIsLoading",payload:!0}),"edit"===e.mode?P({id:e.folderId,folderUpdate:e.folder}):g({folder:e.folder}),setTimeout((()=>{c()}),500)):t({type:"setError",payload:sn}):t({type:"setError",payload:an})},ariaLabel:"edit"===e.mode?"Save changes":"Create folder"},e.isLoading?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-check"})))})));var on=n(4605);const ln=(0,a.X$)((({mode:e,chatIds:t,selectedIds:n,selectedChatTypes:s,filterValue:r,onSelectedIdsChange:o,onSelectedChatTypesChange:i,onFilterChange:l,onLoadMore:c})=>{const d=(0,a.sO)(null),m="included"===e?tn.fi:tn.Yy,h=n.length+s.length>10,Z=n.length>=100;(0,a.d4)((()=>{setTimeout((()=>{requestAnimationFrame((()=>{d.current.focus()}))}),500)}),[]);const P=(0,a.I4)((e=>{const t=[...n];t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),o(t)}),[n,o]),g=(0,a.I4)((e=>{const t=[...s];t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),i(t)}),[s,i]),v=(0,a.I4)((e=>{const{value:t}=e.currentTarget;l(t)}),[l]),p=(0,M.Z)(),[E,C]=(0,he.Z)(c,t,Boolean(r));return a.ZP.createElement("div",{className:"Picker SettingsFoldersChatsPicker"},a.ZP.createElement("div",{className:"picker-header custom-scroll"},s.map((function(e){const t=m.find((({key:t})=>e===t));if(t)return a.ZP.createElement(ot.Z,{icon:t.icon,title:p(t.title),isMinimized:h,canClose:!0,onClick:g,clickArg:t.key})})),n.map(((e,t)=>a.ZP.createElement(ot.Z,{chatOrUserId:e,isMinimized:h&&tg(e.key),ripple:!0},a.ZP.createElement("i",{className:`icon-${e.icon}`}),a.ZP.createElement("h3",{className:"chat-type",dir:"auto"},p(e.title)),a.ZP.createElement(on.Z,{label:"",checked:s.includes(e.key),round:!0}))})),a.ZP.createElement("div",{key:"divider",className:"picker-list-divider"}),a.ZP.createElement("h4",{key:"header2",className:"settings-item-header",dir:p.isRtl?"rtl":void 0},p("FilterChats"))),null!=E&&E.length?E.map((function(e){const t=n.includes(e);return a.ZP.createElement(Ee.Z,{key:e,className:"chat-item-clickable picker-list-item chat-item",onClick:()=>P(e),ripple:!0,disabled:!t&&Z},(0,u.YA)(e)?a.ZP.createElement(Ce.Z,{userId:e}):a.ZP.createElement(fe.Z,{chatId:e,withChatType:!0}),a.ZP.createElement(on.Z,{label:"",checked:t,round:!0}))})):E&&!E.length?a.ZP.createElement("p",{className:"no-results",key:"no-results"},"Sorry, nothing found."):a.ZP.createElement(Pe.Z,{key:"loading"})))})),cn=(0,a.X$)((0,s.c$)((e=>{const{chats:{byId:t,listIds:n,orderedPinnedIds:a}}=e;return{chatsById:t,listIds:n.active,orderedPinnedIds:a.active,archivedPinnedIds:a.archived,archivedListIds:n.archived}}),((e,t)=>(0,h.ei)(t,["loadMoreChats"])))((({isActive:e,onScreenSelect:t,onReset:n,mode:s,state:r,dispatch:i,chatsById:l,listIds:c,orderedPinnedIds:d,archivedListIds:m,archivedPinnedIds:h,loadMoreChats:Z})=>{const{chatFilter:P}=r,{selectedChatIds:g,selectedChatTypes:v}=(0,tn.vb)(r,s,!0),p=(0,M.Z)(),E=(0,a.Ye)((()=>{const e=c?(0,u.O)(l,c,d,"all"):void 0,t=m?(0,u.O)(l,m,h,"archived"):void 0;if(e||t)return[...e?[...e.pinnedChats,...e.otherChats]:[],...t?t.otherChats:[]]}),[l,c,d,m,h]),C=(0,a.Ye)((()=>{if(E)return E.filter((e=>!P||(0,ue.Z)((0,u.U)(p,e),P)||g.includes(e.id))).map((({id:e})=>e))}),[E,P,p,g]),f=(0,a.I4)((e=>{i({type:"setChatFilter",payload:e})}),[i]),b=(0,a.I4)((e=>{i("included"===s?{type:"setIncludeFilters",payload:{...r.includeFilters,includedChatIds:e}}:{type:"setExcludeFilters",payload:{...r.excludeFilters,excludedChatIds:e}})}),[s,r,i]),y=(0,a.I4)((e=>{const t={};e.forEach((e=>{t[e]=!0})),i("included"===s?{type:"setIncludeFilters",payload:{includedChatIds:g,...t}}:{type:"setExcludeFilters",payload:{excludedChatIds:g,...t}})}),[s,g,i]);return(0,T.ZP)(e,n,t,"included"===s?o.MT.FoldersIncludedChats:o.MT.FoldersExcludedChats),C?a.ZP.createElement(ln,{mode:s,chatIds:C,selectedIds:g,selectedChatTypes:v,filterValue:P,onSelectedIdsChange:b,onSelectedChatTypesChange:y,onFilterChange:f,onLoadMore:Z}):a.ZP.createElement(Pe.Z,null)}))),dn=(0,a.X$)((({currentScreen:e,shownScreen:t,state:n,dispatch:s,isActive:r,onScreenSelect:i,onReset:l})=>{const c=(0,a.I4)((()=>{e!==o.MT.FoldersCreateFolder&&e!==o.MT.FoldersEditFolder&&e!==o.MT.FoldersEditFolderFromChatList||setTimeout((()=>{s({type:"reset"})}),200),e!==o.MT.FoldersIncludedChats&&e!==o.MT.FoldersExcludedChats?l():"create"===n.mode?i(o.MT.FoldersCreateFolder):i(o.MT.FoldersEditFolder)}),[n.mode,s,e,l,i]),d=(0,a.I4)((()=>{s({type:"reset"}),i(o.MT.FoldersCreateFolder)}),[i,s]),m=(0,a.I4)((e=>{s({type:"editFolder",payload:e}),i(o.MT.FoldersEditFolder)}),[s,i]),u=(0,a.I4)((()=>{s({type:"editIncludeFilters"}),i(e===o.MT.FoldersEditFolderFromChatList?o.MT.FoldersIncludedChatsFromChatList:o.MT.FoldersIncludedChats)}),[e,s,i]),h=(0,a.I4)((()=>{s({type:"editExcludeFilters"}),i(e===o.MT.FoldersEditFolderFromChatList?o.MT.FoldersExcludedChatsFromChatList:o.MT.FoldersExcludedChats)}),[e,s,i]);switch(e){case o.MT.Folders:return a.ZP.createElement(en,{onCreateFolder:d,onEditFolder:m,onScreenSelect:i,isActive:r||[o.MT.FoldersCreateFolder,o.MT.FoldersEditFolder,o.MT.FoldersIncludedChats,o.MT.FoldersExcludedChats].includes(t),onReset:l});case o.MT.FoldersCreateFolder:case o.MT.FoldersEditFolder:case o.MT.FoldersEditFolderFromChatList:return a.ZP.createElement(rn,{state:n,dispatch:s,onAddIncludedChats:u,onAddExcludedChats:h,onReset:c,onScreenSelect:i,isActive:r||[o.MT.FoldersIncludedChats,o.MT.FoldersExcludedChats].includes(t),onBack:l});case o.MT.FoldersIncludedChats:case o.MT.FoldersIncludedChatsFromChatList:return a.ZP.createElement(cn,{mode:"included",state:n,dispatch:s,onReset:c,onScreenSelect:i,isActive:r});case o.MT.FoldersExcludedChats:case o.MT.FoldersExcludedChatsFromChatList:return a.ZP.createElement(cn,{mode:"excluded",state:n,dispatch:s,onReset:c,onScreenSelect:i,isActive:r});default:return}}));var mn=n(3657);const un=(0,a.X$)((({options:e,range:t,label:n,value:s,disabled:r,onChange:o})=>{const i=(0,M.Z)(),l=(0,a.I4)((e=>{o(Number(e.currentTarget.value))}),[o]),c=(0,Y.Z)("RangeSlider",r&&"disabled"),d=(0,a.Ye)((()=>{if(e)return s/(e.length-1)*100;if(t){const e=(t.max-t.min)/(t.step||1);return(s-t.min)/e*100}return 0}),[s,e,t]),[m,u,h]=(0,a.Ye)((()=>e?[0,e.length-1,1]:t?[t.min,t.max,t.step||1]:[0,0,0]),[t,e]);return a.ZP.createElement("div",{className:c},n&&a.ZP.createElement("div",{className:"slider-top-row",dir:i.isRtl?"rtl":void 0},a.ZP.createElement("span",{className:"label",dir:"auto"},n),t&&a.ZP.createElement("span",{className:"value",dir:"auto"},s)),a.ZP.createElement("div",{className:"slider-main"},a.ZP.createElement("div",{className:"slider-fill-track",style:`width: ${d}%`}),a.ZP.createElement("input",{min:m,max:u,value:s,step:h,type:"range",onChange:l}),e&&a.ZP.createElement("div",{className:"slider-options"},e.map(((e,t)=>a.ZP.createElement("div",{className:(0,Y.Z)("slider-option no-selection",t===s&&"active"),onClick:()=>o(t)},e))))))}));var hn=n(8835),Zn=n(2155);const Pn=(0,a.X$)((({size:e=i.DC,stickerSet:t,observeIntersection:n})=>{const s=(0,a.sO)(null),o=(0,mn.Op)(s,n),l=`stickerSet${t.id}`,c=(0,p.Z)(l,!o,r.IU.Lottie),{shouldRenderFullMedia:d,transitionClassNames:m}=(0,hn.Z)(c,"slow");return a.ZP.createElement("div",{ref:s,className:"sticker-set-cover"},!d&&(0,Zn.Xv)(t.title,2),d&&c&&a.ZP.createElement(Wt.Z,{id:l,size:e,animationData:c,className:m}))})),gn=(0,a.X$)((({stickerSet:e,observeIntersection:t})=>{const n=(0,a.sO)(null),s=(0,mn.Op)(n,t),r=(0,p.Z)(e.hasThumbnail&&`stickerSet${e.id}`,!s),{shouldRenderFullMedia:o,transitionClassNames:i}=(0,hn.Z)(r,"slow");return a.ZP.createElement("div",{ref:n,className:"sticker-set-cover"},!o&&(0,Zn.Xv)(e.title,2),o&&a.ZP.createElement("img",{src:r,className:i,alt:""}))}));var vn=n(3547);const pn=(0,a.X$)((({stickerSet:e,observeIntersection:t,onClick:n})=>{var s;const r=(0,M.Z)();if(!e||!e.stickers)return;const o=null===(s=e.stickers)||void 0===s?void 0:s[0];return e.hasThumbnail||!o?a.ZP.createElement(Ee.Z,{narrow:!0,className:"SettingsStickerSet",inactive:!o,onClick:()=>o&&n(o)},a.ZP.createElement(R.Z,{ariaLabel:e.title,color:"translucent",isRtl:r.isRtl},e.isAnimated?a.ZP.createElement(Pn,{size:i.Mw,stickerSet:e,observeIntersection:t}):a.ZP.createElement(gn,{stickerSet:e,observeIntersection:t})),a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("div",{className:"title"},e.title),a.ZP.createElement("div",{className:"subtitle"},r("StickerPack.StickerCount",e.count,"i")))):a.ZP.createElement(Ee.Z,{narrow:!0,className:"SettingsStickerSet",onClick:()=>n(o)},a.ZP.createElement(vn.Z,{sticker:o,size:i.Mw,title:e.title,observeIntersection:t}),a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("div",{className:"title"},e.title),a.ZP.createElement("div",{className:"subtitle"},r("StickerPack.StickerCount",e.count,"i"))))}));var En=n(4851);const Cn=["Solid and Steady","Nice and Fast","Lots of Stuff"],fn=(0,a.X$)((0,s.c$)((e=>({...(0,h.ei)(e.settings.byKey,["messageTextSize","animationLevel","messageSendKeyCombo","shouldAutoDownloadMediaFromContacts","shouldAutoDownloadMediaInPrivateChats","shouldAutoDownloadMediaInGroups","shouldAutoDownloadMediaInChannels","shouldAutoPlayGifs","shouldAutoPlayVideos","shouldSuggestStickers","shouldLoopStickers","isSensitiveEnabled","canChangeSensitive"]),stickerSetIds:e.stickers.added.setIds,stickerSetsById:e.stickers.setsById})),((e,t)=>(0,h.ei)(t,["setSettingOption","loadStickerSets","loadAddedStickers"])))((({isActive:e,onScreenSelect:t,onReset:n,stickerSetIds:s,stickerSetsById:r,messageTextSize:i,animationLevel:c,messageSendKeyCombo:d,shouldAutoDownloadMediaFromContacts:m,shouldAutoDownloadMediaInPrivateChats:u,shouldAutoDownloadMediaInGroups:h,shouldAutoDownloadMediaInChannels:Z,shouldAutoPlayGifs:P,shouldAutoPlayVideos:g,shouldSuggestStickers:v,shouldLoopStickers:p,setSettingOption:E,loadStickerSets:C,loadAddedStickers:f})=>{const b=(0,a.sO)(null),{observe:y}=(0,mn.S1)({rootRef:b}),[I,S,N]=(0,Fe.Z)(),[w,k]=(0,a.eJ)(),F=(0,M.Z)(),A=l.$b?void 0:[{value:"enter",label:F("lng_settings_send_enter"),subLabel:"New line by Shift + Enter"},{value:"ctrl-enter",label:F(l.jm?"lng_settings_send_cmdenter":"lng_settings_send_ctrlenter"),subLabel:"New line by Enter"}];(0,a.d4)((()=>{C()}),[C]),(0,a.d4)((()=>{null!=s&&s.length&&f()}),[s,f]);const L=(0,a.I4)((e=>{Cn.forEach(((t,n)=>{document.body.classList.toggle(`animation-level-${n}`,e===n)})),E({animationLevel:e})}),[E]),R=(0,a.I4)((e=>{document.documentElement.style.setProperty("--composer-text-size",`${Math.max(e,l.cj?16:15)}px`),document.documentElement.style.setProperty("--message-meta-height",`${Math.floor(1.3125*e)}px`),document.documentElement.style.setProperty("--message-text-size",`${e}px`),document.documentElement.setAttribute("data-message-text-size",e.toString()),E({messageTextSize:e})}),[E]),B=(0,a.I4)((e=>{k(e),S()}),[S]),$=s&&s.map((e=>{var t;return!(null==r||null===(t=r[e])||void 0===t||!t.installedDate)&&r[e]})).filter(Boolean);return(0,T.ZP)(e,n,t,o.MT.General),a.ZP.createElement("div",{className:"settings-content custom-scroll"},a.ZP.createElement("div",{className:"settings-item pt-3"},a.ZP.createElement("h4",{className:"settings-item-header",dir:F.isRtl?"rtl":void 0},F("SETTINGS")),a.ZP.createElement(un,{label:F("TextSize"),range:{min:12,max:20},value:i,onChange:R}),a.ZP.createElement(Ee.Z,{icon:"photo",onClick:()=>t(o.MT.GeneralChatBackground)},F("ChatBackground"))),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:F.isRtl?"rtl":void 0},"Animation Level"),a.ZP.createElement("p",{className:"settings-item-description",dir:F.isRtl?"rtl":void 0},"Choose the desired animations amount."),a.ZP.createElement(un,{options:Cn,value:c,onChange:L})),A&&a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:F.isRtl?"rtl":void 0},F("VoiceOver.Keyboard")),a.ZP.createElement(ze.Z,{name:"keyboard-send-settings",options:A,onChange:e=>E({messageSendKeyCombo:e}),selected:d})),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:F.isRtl?"rtl":void 0},F("AutoDownloadMedia")),a.ZP.createElement(on.Z,{label:F("Contacts"),checked:m,onCheck:e=>E({shouldAutoDownloadMediaFromContacts:e})}),a.ZP.createElement(on.Z,{label:F("AutodownloadPrivateChats"),checked:u,onCheck:e=>E({shouldAutoDownloadMediaInPrivateChats:e})}),a.ZP.createElement(on.Z,{label:F("AutodownloadGroupChats"),checked:h,onCheck:e=>E({shouldAutoDownloadMediaInGroups:e})}),a.ZP.createElement(on.Z,{label:F("FilterChannels"),checked:Z,onCheck:e=>E({shouldAutoDownloadMediaInChannels:e})})),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:F.isRtl?"rtl":void 0},F("AutoplayMedia")),a.ZP.createElement(on.Z,{label:F("GifsTab2"),checked:P,onCheck:e=>E({shouldAutoPlayGifs:e})}),a.ZP.createElement(on.Z,{label:F("DataAndStorage.Autoplay.Videos"),checked:g,onCheck:e=>E({shouldAutoPlayVideos:e})})),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:F.isRtl?"rtl":void 0},F("AccDescrStickers")),a.ZP.createElement(on.Z,{label:F("SuggestStickers"),checked:v,onCheck:e=>E({shouldSuggestStickers:e})}),a.ZP.createElement(on.Z,{label:F("LoopAnimatedStickers"),checked:p,onCheck:e=>E({shouldLoopStickers:e})}),a.ZP.createElement("div",{className:"mt-4",ref:b},$&&$.map((e=>a.ZP.createElement(pn,{key:e.id,stickerSet:e,observeIntersection:y,onClick:B})))),w&&a.ZP.createElement(En.Z,{isOpen:I,fromSticker:w,onClose:N})))})));let bn;function yn(e="*",t,n=!1){bn||(bn=document.createElement("input"),bn.setAttribute("type","file")),bn.setAttribute("accept",e),n?bn.removeAttribute("multiple"):bn.setAttribute("multiple","multiple"),bn.onchange=null,bn.value="",bn.onchange=t,bn.click()}var In=n(1394);function Sn(e){return[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)]}function Nn(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 wn([e,t,n]){e/=255,t/=255,n/=255;let a,s,r=Math.max(e,t,n),o=Math.min(e,t,n),i=r,l=r-o;if(s=0==r?0:l/r,r==o)a=0;else{switch(r){case e:a=(t-n)/l+(t.5?Math.max(0,.65*a):Math.max(0,Math.min(1,1-.65*a)),`hsla(${360*t}, ${100*n}%, ${100*a}%, .4)`}var Tn=n(9524),Fn=n(5866);const An=(0,a.X$)((({wallpaper:e,theme:t,isSelected:n,onClick:s})=>{var r;const{slug:l,document:c}=e,d=`wallpaper${c.id}`,m=c.previewBlobUrl,u=(0,p.Z)(`${d}?size=m`),h=(0,Fn.Z)(null===(r=c.thumbnail)||void 0===r?void 0:r.dataUri,Boolean(u),!0),{shouldRenderThumb:Z,shouldRenderFullMedia:P,transitionClassNames:g}=(0,hn.Z)(u||m,"slow"),[v,C]=(0,a.eJ)(!1),{mediaData:b,downloadProgress:y}=(0,E.Z)(d,!v),I=!1===(0,f.Z)(v),{shouldRender:S,transitionClassNames:N}=(0,H.Z)(v&&!b||l===o.mp,void 0,I,"slow"),w=(0,a.sO)();w.current=t;const k=(0,a.I4)((()=>{(async()=>{const e=await(0,In.gm)(b);await Tn.save(i.fo,w.current,e),s(l)})()}),[b,s,l]);(0,a.d4)((()=>{b&&k()}),[b,k]);const M=(0,a.I4)((()=>{b?k():C((e=>!e))}),[b,k]),T=(0,Y.Z)("WallpaperTile",n&&"selected");return a.ZP.createElement("div",{className:T,onClick:M},a.ZP.createElement("div",{className:"media-inner"},Z&&a.ZP.createElement("canvas",{ref:h,className:"thumbnail"}),P&&a.ZP.createElement("img",{src:u||m,className:`full-media ${g}`,alt:""}),S&&a.ZP.createElement("div",{className:(0,Y.Z)("spinner-container",N)},a.ZP.createElement(J.Z,{progress:y,onClick:M}))))})),Ln=(0,X.P2)((e=>e()),6e4,!0),Rn=(0,a.X$)((0,s.c$)((e=>{const t=(0,m.Pu)(e),{background:n,isBlurred:a}=e.settings.themes[t]||{},{loadedWallpapers:s}=e.settings;return{background:n,isBlurred:a,loadedWallpapers:s,theme:t}}),((e,t)=>(0,h.ei)(t,["loadWallpapers","uploadWallpaper","setThemeSettings"])))((({isActive:e,onScreenSelect:t,onReset:n,background:s,isBlurred:r,loadedWallpapers:l,theme:c,loadWallpapers:d,uploadWallpaper:m,setThemeSettings:u})=>{const h=(0,a.sO)();h.current=c,(0,a.d4)((()=>{Ln((()=>{d()}))}),[d]);const Z=(0,a.I4)((e=>{const{files:t}=e.target;t&&t.length>0&&m(t[0])}),[m]),P=(0,a.I4)((()=>{yn("image/jpeg",Z,!0)}),[Z]),g=(0,a.I4)((()=>{t(o.MT.GeneralChatBackgroundColor)}),[t]),v=(0,a.I4)((()=>{u({theme:c,background:void 0,backgroundColor:void 0,isBlurred:!0,patternColor:"dark"===c?i.Vv:i.g})}),[u,c]),p=(0,a.I4)((e=>{u({theme:h.current,background:e});const t=l&&l.find((t=>t.slug===e));null!=t&&t.document.thumbnail&&async function(e){const t=[0,0,0];let n,a,s,r,o=-4,i=[0,0,0],l=0;const c=document.createElement("canvas"),d=c.getContext&&c.getContext("2d");if(!d)return t;const m=await(0,In.pt)(e);s=m.naturalHeight||m.offsetHeight||m.height,a=m.naturalWidth||m.offsetWidth||m.width,c.height=s,c.width=a,d.drawImage(m,0,0);try{n=d.getImageData(0,0,a,s)}catch(e){return t}for(r=n.data.length;(o+=20){const t=Mn(e),n=`#${Nn(e)}`;u({theme:h.current,backgroundColor:n,patternColor:t})}))}),[l,u]),E=(0,a.I4)((e=>{u({theme:h.current,isBlurred:e.target.checked})}),[u]),C=(0,M.Z)();(0,T.ZP)(e,n,t,o.MT.GeneralChatBackground);const f=(null==l?void 0:l[0])&&l[0].slug===o.mp;return a.ZP.createElement("div",{className:"SettingsGeneralBackground settings-content custom-scroll"},a.ZP.createElement("div",{className:"settings-item pt-3"},a.ZP.createElement(Ee.Z,{icon:"camera-add",className:"mb-0",disabled:f,onClick:P},C("UploadImage")),a.ZP.createElement(Ee.Z,{icon:"colorize",className:"mb-0",onClick:g},C("SetColor")),a.ZP.createElement(Ee.Z,{icon:"favorite",onClick:v},C("ThemeResetToDefaults")),a.ZP.createElement(on.Z,{label:C("BackgroundBlurred"),checked:Boolean(r),onChange:E})),l?a.ZP.createElement("div",{className:"settings-wallpapers"},l.map((e=>a.ZP.createElement(An,{wallpaper:e,theme:c,isSelected:s===e.slug,onClick:p})))):a.ZP.createElement(Pe.Z,null))}))),Bn=wn(Sn("e6ebee")),$n=["#e6ebee","#b2cee1","#008dd0","#c6e7cb","#c4e1a6","#60b16e","#ccd0af","#a6a997","#7a7072","#fdd7af","#fdb76e","#dd8851"];function Dn(e,t){return{colorPosition:[Math.round(e[1]*(t.colorRect.width-1)),Math.round((1-e[2])*(t.colorRect.height-1))],huePosition:Math.round(e[0]*(t.hueRect.width-1))}}function Un({colorPosition:e,huePosition:t},n){return[t/(n.hueRect.width-1),e[0]/(n.colorRect.width-1),1-e[1]/(n.colorRect.height-1)]}const xn=(0,a.X$)((0,s.c$)((e=>{const t=(0,m.Pu)(e),{backgroundColor:n}=e.settings.themes[t]||{};return{backgroundColor:n,theme:t}}),((e,t)=>(0,h.ei)(t,["setThemeSettings"])))((({isActive:e,onScreenSelect:t,onReset:n,theme:s,backgroundColor:r,setThemeSettings:i})=>{const l=(0,a.sO)();l.current=s;const c=(0,a.sO)(null),d=(0,a.sO)(null),m=(0,a.sO)(null),u=(0,a.sO)(!0),[P,g]=(0,a.eJ)(function(e){return e&&e.startsWith("#")?wn(Sn(e.replace("#",""))):Bn}(r)),v=(0,a.sO)(P);(0,a.d4)((()=>{v.current=P}),[P]);const[p,E,C]=(0,Fe.Z)(),[f,b]=(0,a.eJ)(""),[y,I]=(0,a.eJ)(""),S=(0,a.sO)(),N=(0,a.sO)();(0,a.d4)((()=>{const e={offsetLeft:d.current.offsetLeft,...(0,h.ei)(d.current.getBoundingClientRect(),["top","width","height"])},t={offsetLeft:m.current.offsetLeft,...(0,h.ei)(m.current.getBoundingClientRect(),["width"])};function n(t){const n=[Math.min(Math.max(0,t.pageX-e.offsetLeft),e.width-1),Math.min(Math.max(0,t.pageY-e.top+c.current.scrollTop),e.height-1)],{huePosition:a}=Dn(v.current,S.current);return g(Un({colorPosition:n,huePosition:a},S.current)),E(),!0}function a(e){const{colorPosition:n}=Dn(v.current,S.current),a=Math.min(Math.max(0,e.pageX-t.offsetLeft),t.width-1);return g(Un({colorPosition:n,huePosition:a},S.current)),E(),!0}S.current={colorRect:e,hueRect:t},(0,Z.s)(d.current,{onCapture:n,onDrag:n,onRelease:C,onClick:C,selectorToPreventScroll:".SettingsGeneralBackgroundColor",withCursor:!0}),(0,Z.s)(m.current,{onCapture:a,onDrag:a,onRelease:C,onClick:C,selectorToPreventScroll:".SettingsGeneralBackgroundColor",withCursor:!0})}),[E,C]);const{colorPosition:w=[0,0],huePosition:k=0}=S.current?Dn(P,S.current):{},M=Nn(kn(P)),F=P[0],A=Nn(kn([F,1,1]));(0,a.d4)((()=>{const e=kn(P),t=`#${Nn(e)}`;if(b(e.join(", ")),I(t),!u.current){const n=Mn(e);i({theme:l.current,background:void 0,backgroundColor:t,patternColor:n})}u.current=!1}),[P,i]),(0,a.d4)((()=>{!function(e,t,n,a){let s,r,o;n.current&&a.current?(s=a.current.colorRect.width,r=a.current.colorRect.height,o=n.current):(s=e.offsetWidth,r=e.offsetHeight,o=e.getContext("2d"),e.width=s,e.height=r,n.current=o);const i=o.createImageData(s,r),l=i.data,c=kn([t,1,1]);let d=0;for(let e=0;e{!function(e){const t=e.offsetWidth;e.width=t,e.height=1;const n=e.getContext("2d"),a=n.createImageData(t,1),s=a.data;let r=0;for(let e=0;e{const t=e.currentTarget.value.replace(/[^\d, ]/g,"").slice(0,13);if(t.match(/^\d{1,3},\s?\d{1,3},\s?\d{1,3}$/)){const e=t.split(",").map((e=>Number(e.trim())));g(wn(e))}e.currentTarget.value=t}),[]),R=(0,a.I4)((e=>{const t=e.currentTarget.value.replace(/[^0-9a-fA-F]/g,"").slice(0,6);t.match(/^#?[0-9a-fA-F]{6}$/)&&g(wn(Sn(t.replace("#","")))),e.currentTarget.value=t}),[]),B=(0,a.I4)((e=>{g(wn(Sn(e.currentTarget.dataset.color.replace("#",""))))}),[]),$=(0,Y.Z)("SettingsGeneralBackgroundColor settings-content custom-scroll",p&&"is-dragging");return(0,T.ZP)(e,n,t,o.MT.GeneralChatBackgroundColor),a.ZP.createElement("div",{ref:c,className:$},a.ZP.createElement("div",{className:"settings-item pt-3"},a.ZP.createElement("div",{ref:d,className:"color-picker"},a.ZP.createElement("canvas",null),a.ZP.createElement("div",{className:"handle",style:`transform: translate(${w[0]}px, ${w[1]}px); background-color: #${M};`})),a.ZP.createElement("div",{ref:m,className:"hue-picker"},a.ZP.createElement("canvas",null),a.ZP.createElement("div",{className:"handle",style:`transform: translateX(${k}px); background-color: #${A};`})),a.ZP.createElement("div",{className:"tools"},a.ZP.createElement(ve.Z,{value:y,label:"HEX",onChange:R}),a.ZP.createElement(ve.Z,{value:f,label:"RGB",onChange:L}))),a.ZP.createElement("div",{className:"predefined-colors"},$n.map((e=>a.ZP.createElement("div",{className:e===`#${M}`?"active":void 0,"data-color":e,style:`background-color: ${e};`,onClick:B})))))}))),On=(0,a.X$)((0,s.c$)((e=>({hasPrivateChatsNotifications:Boolean(e.settings.byKey.hasPrivateChatsNotifications),hasPrivateChatsMessagePreview:Boolean(e.settings.byKey.hasPrivateChatsMessagePreview),hasGroupNotifications:Boolean(e.settings.byKey.hasGroupNotifications),hasGroupMessagePreview:Boolean(e.settings.byKey.hasGroupMessagePreview),hasBroadcastNotifications:Boolean(e.settings.byKey.hasBroadcastNotifications),hasBroadcastMessagePreview:Boolean(e.settings.byKey.hasBroadcastMessagePreview),hasContactJoinedNotifications:Boolean(e.settings.byKey.hasContactJoinedNotifications),hasWebNotifications:e.settings.byKey.hasWebNotifications,hasPushNotifications:e.settings.byKey.hasPushNotifications,notificationSoundVolume:e.settings.byKey.notificationSoundVolume})),((e,t)=>(0,h.ei)(t,["loadNotificationSettings","updateContactSignUpNotification","updateNotificationSettings","updateWebNotificationSettings"])))((({isActive:e,onScreenSelect:t,onReset:n,hasPrivateChatsNotifications:s,hasPrivateChatsMessagePreview:r,hasGroupNotifications:i,hasGroupMessagePreview:l,hasBroadcastNotifications:c,hasBroadcastMessagePreview:d,hasContactJoinedNotifications:m,hasPushNotifications:u,hasWebNotifications:h,notificationSoundVolume:Z,loadNotificationSettings:P,updateContactSignUpNotification:g,updateNotificationSettings:v,updateWebNotificationSettings:p})=>{(0,a.d4)((()=>{P()}),[P]);const E=(0,a.I4)(((e,t,n)=>{const a="contact"===t?!s:!("group"===t?i:c),o="contact"===t?r:"group"===t?l:d;v({peerType:t,..."silent"===n&&{isSilent:!e.target.checked,shouldShowPreviews:o},..."showPreviews"===n&&{shouldShowPreviews:e.target.checked,isSilent:a}})}),[d,c,l,i,r,s,v]),C=(0,a.I4)((e=>{g({isSilent:!e.target.checked})}),[g]),f=(0,M.Z)();return(0,T.ZP)(e,n,t,o.MT.Notifications),a.ZP.createElement("div",{className:"settings-content custom-scroll"},a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:f.isRtl?"rtl":void 0},"Web notifications"),a.ZP.createElement(on.Z,{label:"Web notifications",subLabel:f(h?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:h,onChange:e=>{p({hasWebNotifications:e.target.checked})}}),a.ZP.createElement(on.Z,{label:"Offline notifications",disabled:!h,subLabel:f(u?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:u,onChange:e=>{p({hasPushNotifications:e.target.checked})}}),a.ZP.createElement("div",{className:"settings-item-slider"},a.ZP.createElement(un,{label:"Sound",disabled:!h,range:{min:0,max:10},value:Z,onChange:e=>{p({notificationSoundVolume:e})}}))),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:f.isRtl?"rtl":void 0},f("AutodownloadPrivateChats")),a.ZP.createElement(on.Z,{label:f("NotificationsForPrivateChats"),subLabel:f(s?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:s,onChange:e=>{E(e,"contact","silent")}}),a.ZP.createElement(on.Z,{label:f("MessagePreview"),disabled:!s,subLabel:f(r?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:r,onChange:e=>{E(e,"contact","showPreviews")}})),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:f.isRtl?"rtl":void 0},f("FilterGroups")),a.ZP.createElement(on.Z,{label:f("NotificationsForGroups"),subLabel:f(i?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:i,onChange:e=>{E(e,"group","silent")}}),a.ZP.createElement(on.Z,{label:f("MessagePreview"),disabled:!i,subLabel:f(l?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:l,onChange:e=>{E(e,"group","showPreviews")}})),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:f.isRtl?"rtl":void 0},f("FilterChannels")),a.ZP.createElement(on.Z,{label:f("NotificationsForChannels"),subLabel:f(c?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:c,onChange:e=>{E(e,"broadcast","silent")}}),a.ZP.createElement(on.Z,{label:f("MessagePreview"),disabled:!c,subLabel:f(d?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),checked:d,onChange:e=>{E(e,"broadcast","showPreviews")}})),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:f.isRtl?"rtl":void 0},f("PhoneOther")),a.ZP.createElement(on.Z,{label:f("ContactJoined"),checked:m,onChange:C})))}))),Gn=(0,a.X$)((0,s.c$)((e=>{var t,n,a,s,r;const{settings:{byKey:{hasPassword:o,isSensitiveEnabled:i,canChangeSensitive:l},privacy:c},blocked:d,activeSessions:m}=e;return{hasPassword:o,blockedCount:d.totalCount,sessionsCount:m.length,isSensitiveEnabled:i,canChangeSensitive:l,visibilityPrivacyPhoneNumber:null===(t=c.phoneNumber)||void 0===t?void 0:t.visibility,visibilityPrivacyLastSeen:null===(n=c.lastSeen)||void 0===n?void 0:n.visibility,visibilityPrivacyProfilePhoto:null===(a=c.profilePhoto)||void 0===a?void 0:a.visibility,visibilityPrivacyForwarding:null===(s=c.forwards)||void 0===s?void 0:s.visibility,visibilityPrivacyGroupChats:null===(r=c.chatInvite)||void 0===r?void 0:r.visibility}}),((e,t)=>(0,h.ei)(t,["loadBlockedContacts","loadAuthorizations","loadPrivacySettings","loadContentSettings","updateContentSettings"])))((({isActive:e,onScreenSelect:t,onReset:n,hasPassword:s,blockedCount:r,sessionsCount:i,isSensitiveEnabled:l,canChangeSensitive:c,visibilityPrivacyPhoneNumber:d,visibilityPrivacyLastSeen:m,visibilityPrivacyProfilePhoto:u,visibilityPrivacyForwarding:h,visibilityPrivacyGroupChats:Z,loadPrivacySettings:P,loadBlockedContacts:g,loadAuthorizations:v,loadContentSettings:p,updateContentSettings:E})=>{(0,a.d4)((()=>{g(),v(),P(),p()}),[g,v,P,p]);const C=(0,M.Z)();function f(e){switch(e){case"everybody":return C("P2PEverybody");case"contacts":return C("P2PContacts");case"nobody":return C("P2PNobody")}}return(0,T.ZP)(e,n,t,o.MT.Privacy),a.ZP.createElement("div",{className:"settings-content custom-scroll"},a.ZP.createElement("div",{className:"settings-item pt-3"},a.ZP.createElement(Ee.Z,{icon:"delete-user",narrow:!0,onClick:()=>t(o.MT.PrivacyBlockedUsers)},a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("span",{className:"title"},C("BlockedUsers")),r>0&&a.ZP.createElement("span",{className:"subtitle",dir:"auto"},C("Users",r)))),a.ZP.createElement(Ee.Z,{icon:"lock",narrow:!0,onClick:()=>t(s?o.MT.TwoFaEnabled:o.MT.TwoFaDisabled)},a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("span",{className:"title"},C("TwoStepVerification")),a.ZP.createElement("span",{className:"subtitle",dir:"auto"},C(s?"PasswordOn":"PasswordOff")))),a.ZP.createElement(Ee.Z,{icon:"active-sessions",narrow:!0,onClick:()=>t(o.MT.PrivacyActiveSessions)},a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("span",{className:"title"},C("SessionsTitle")),i>0&&a.ZP.createElement("span",{className:"subtitle",dir:"auto"},1===i?"1 session":`${i} sessions`)))),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header mb-4",dir:C.isRtl?"rtl":void 0},C("PrivacyTitle")),a.ZP.createElement(Ee.Z,{narrow:!0,className:"no-icon",onClick:()=>t(o.MT.PrivacyPhoneNumber)},a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("span",{className:"title"},C("PrivacyPhoneTitle")),a.ZP.createElement("span",{className:"subtitle",dir:"auto"},f(d)))),a.ZP.createElement(Ee.Z,{narrow:!0,className:"no-icon",onClick:()=>t(o.MT.PrivacyLastSeen)},a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("span",{className:"title"},C("LastSeenTitle")),a.ZP.createElement("span",{className:"subtitle",dir:"auto"},f(m)))),a.ZP.createElement(Ee.Z,{narrow:!0,className:"no-icon",onClick:()=>t(o.MT.PrivacyProfilePhoto)},a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("span",{className:"title"},C("PrivacyProfilePhotoTitle")),a.ZP.createElement("span",{className:"subtitle",dir:"auto"},f(u)))),a.ZP.createElement(Ee.Z,{narrow:!0,className:"no-icon",onClick:()=>t(o.MT.PrivacyForwarding)},a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("span",{className:"title"},C("PrivacyForwardsTitle")),a.ZP.createElement("span",{className:"subtitle",dir:"auto"},f(h)))),a.ZP.createElement(Ee.Z,{narrow:!0,className:"no-icon",onClick:()=>t(o.MT.PrivacyGroupChats)},a.ZP.createElement("div",{className:"multiline-menu-item"},a.ZP.createElement("span",{className:"title"},C("WhoCanAddMe")),a.ZP.createElement("span",{className:"subtitle",dir:"auto"},f(Z))))),c&&a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:C.isRtl?"rtl":void 0},C("lng_settings_sensitive_title")),a.ZP.createElement(on.Z,{label:C("lng_settings_sensitive_disable_filtering"),subLabel:C("lng_settings_sensitive_about"),checked:Boolean(l),disabled:!c,onCheck:E})))})));var Jn=n(663);const zn=(0,a.X$)((0,s.c$)((e=>({languages:e.settings.byKey.languages,language:e.settings.byKey.language})),((e,t)=>(0,h.ei)(t,["loadLanguages","setSettingOption"])))((({isActive:e,onScreenSelect:t,onReset:n,languages:s,language:r,loadLanguages:i,setSettingOption:l})=>{const[c,d]=(0,a.eJ)(r),[m,u,h]=(0,Fe.Z)();(0,a.d4)((()=>{i()}),[i]);const Z=(0,a.I4)((e=>{d(e),u(),(0,Jn.m0)(e,(()=>{h(),l({language:e})}))}),[u,h,l]),P=(0,a.Ye)((()=>s?function(e){const t=(window.navigator.language||"en").toLowerCase(),n=t.substr(0,2);return e.map((({langCode:e,nativeName:t,name:n})=>({value:e,label:t,subLabel:n}))).sort((e=>!t||e.value!==t&&e.value!==n?0:-1))}(s):void 0),[s]);return(0,T.ZP)(e,n,t,o.MT.Language),a.ZP.createElement("div",{className:"settings-content settings-item settings-language custom-scroll"},P?a.ZP.createElement(ze.Z,{name:"keyboard-send-settings",options:P,selected:c,loadingOption:m?c:void 0,onChange:Z}):a.ZP.createElement(Pe.Z,null))})));function Xn(e){switch(e){case o.MT.PrivacyPhoneNumber:case o.MT.PrivacyPhoneNumberAllowedContacts:case o.MT.PrivacyPhoneNumberDeniedContacts:return"phoneNumber";case o.MT.PrivacyLastSeen:case o.MT.PrivacyLastSeenAllowedContacts:case o.MT.PrivacyLastSeenDeniedContacts:return"lastSeen";case o.MT.PrivacyProfilePhoto:case o.MT.PrivacyProfilePhotoAllowedContacts:case o.MT.PrivacyProfilePhotoDeniedContacts:return"profilePhoto";case o.MT.PrivacyForwarding:case o.MT.PrivacyForwardingAllowedContacts:case o.MT.PrivacyForwardingDeniedContacts:return"forwards";case o.MT.PrivacyGroupChats:case o.MT.PrivacyGroupChatsAllowedContacts:case o.MT.PrivacyGroupChatsDeniedContacts:return"chatInvite"}}const Yn=(0,a.X$)((0,s.c$)(((e,{screen:t})=>{let n;const{chats:{byId:a},settings:{privacy:s}}=e;switch(t){case o.MT.PrivacyPhoneNumber:n=s.phoneNumber;break;case o.MT.PrivacyLastSeen:n=s.lastSeen;break;case o.MT.PrivacyProfilePhoto:n=s.profilePhoto;break;case o.MT.PrivacyForwarding:n=s.forwards;break;case o.MT.PrivacyGroupChats:n=s.chatInvite}return n?{...n,chatsById:a}:{}}),((e,t)=>(0,h.ei)(t,["setPrivacyVisibility"])))((({screen:e,isActive:t,onScreenSelect:n,onReset:s,visibility:r,allowUserIds:i,allowChatIds:l,blockUserIds:c,blockChatIds:d,chatsById:m,setPrivacyVisibility:u})=>{const h=(0,M.Z)(),Z=(0,a.Ye)((()=>{switch(e){case o.MT.PrivacyProfilePhoto:case o.MT.PrivacyGroupChats:return[{value:"everybody",label:h("P2PEverybody")},{value:"contacts",label:h("P2PContacts")}];default:return[{value:"everybody",label:h("P2PEverybody")},{value:"contacts",label:h("P2PContacts")},{value:"nobody",label:h("P2PNobody")}]}}),[h,e]),P={shouldShowDenied:"nobody"!==r,shouldShowAllowed:"everybody"!==r},g=Xn(e),v=(0,a.Ye)((()=>{switch(e){case o.MT.PrivacyPhoneNumber:return h("PrivacyPhoneTitle");case o.MT.PrivacyLastSeen:return h("LastSeenTitle");case o.MT.PrivacyProfilePhoto:return h("PrivacyProfilePhotoTitle");case o.MT.PrivacyForwarding:return h("PrivacyForwardsTitle");case o.MT.PrivacyGroupChats:return h("WhoCanAddMe");default:return}}),[h,e]);(0,T.ZP)(t,s,n,e);const p=(0,a.Ye)((()=>{switch(e){case o.MT.PrivacyLastSeen:return h("CustomHelp");default:return}}),[h,e]),E=(()=>{switch(e){case o.MT.PrivacyPhoneNumber:return o.MT.PrivacyPhoneNumberAllowedContacts;case o.MT.PrivacyLastSeen:return o.MT.PrivacyLastSeenAllowedContacts;case o.MT.PrivacyProfilePhoto:return o.MT.PrivacyProfilePhotoAllowedContacts;case o.MT.PrivacyForwarding:return o.MT.PrivacyForwardingAllowedContacts;default:return o.MT.PrivacyGroupChatsAllowedContacts}})(),C=(()=>{switch(e){case o.MT.PrivacyPhoneNumber:return o.MT.PrivacyPhoneNumberDeniedContacts;case o.MT.PrivacyLastSeen:return o.MT.PrivacyLastSeenDeniedContacts;case o.MT.PrivacyProfilePhoto:return o.MT.PrivacyProfilePhotoDeniedContacts;case o.MT.PrivacyForwarding:return o.MT.PrivacyForwardingDeniedContacts;default:return o.MT.PrivacyGroupChatsDeniedContacts}})(),f=(0,a.Ye)((()=>i&&l&&m?l.reduce(((e,t)=>e+(m[t]?m[t].membersCount:0)),i.length):0),[l,i,m]),b=(0,a.Ye)((()=>c&&d&&m?d.reduce(((e,t)=>e+(m[t]?m[t].membersCount:0)),c.length):0),[d,c,m]),y=(0,a.I4)((e=>{u({privacyKey:g,visibility:e})}),[g,u]);return a.ZP.createElement("div",{className:"settings-content custom-scroll"},a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header",dir:h.isRtl?"rtl":void 0},v),a.ZP.createElement(ze.Z,{name:`visibility-${g}`,options:Z,onChange:y,selected:r}),p&&a.ZP.createElement("p",{className:"settings-item-description-larger",dir:h.isRtl?"rtl":void 0},p)),a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header mb-4",dir:h.isRtl?"rtl":void 0},h("PrivacyExceptions")),P.shouldShowAllowed&&a.ZP.createElement(Ee.Z,{narrow:!0,icon:"add-user",onClick:()=>{n(E)}},a.ZP.createElement("div",{className:"multiline-menu-item full-size"},f>0&&a.ZP.createElement("span",{className:"date",dir:"auto"},"+",f),a.ZP.createElement("span",{className:"title"},h("AlwaysShareWith")),a.ZP.createElement("span",{className:"subtitle"},h("EditAdminAddUsers")))),P.shouldShowDenied&&a.ZP.createElement(Ee.Z,{narrow:!0,icon:"delete-user",onClick:()=>{n(C)}},a.ZP.createElement("div",{className:"multiline-menu-item full-size"},b>0&&a.ZP.createElement("span",{className:"date",dir:"auto"},"−",b),a.ZP.createElement("span",{className:"title"},h("NeverShareWith")),a.ZP.createElement("span",{className:"subtitle"},h("EditAdminAddUsers"))))))})));function _n(e){return[e.region,e.country].filter(Boolean).join(", ")}function Hn(e){return`${e.deviceModel}${e.deviceModel?", ":""} ${e.platform} ${e.systemVersion}`}const jn=(0,a.X$)((0,s.c$)((e=>({activeSessions:e.activeSessions})),((e,t)=>(0,h.ei)(t,["loadAuthorizations","terminateAuthorization","terminateAllAuthorizations"])))((({isActive:e,onScreenSelect:t,onReset:n,activeSessions:s,loadAuthorizations:r,terminateAuthorization:i,terminateAllAuthorizations:l})=>{const[c,d,m]=(0,Fe.Z)();(0,a.d4)((()=>{r()}),[r]);const u=(0,a.I4)((e=>{i({hash:e})}),[i]),h=(0,a.I4)((()=>{m(),l()}),[m,l]),Z=(0,a.Ye)((()=>s.find((e=>e.isCurrent))),[s]),P=(0,a.Ye)((()=>s.filter((e=>!e.isCurrent))),[s]),g=(0,M.Z)();return(0,T.ZP)(e,n,t,o.MT.PrivacyActiveSessions),a.ZP.createElement("div",{className:"settings-content custom-scroll"},Z&&(p=Z,a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header mb-4",dir:g.isRtl?"rtl":void 0},g("AuthSessions.CurrentSession")),a.ZP.createElement(Ee.Z,{narrow:!0,inactive:!0,className:"no-icon"},a.ZP.createElement("div",{className:"multiline-menu-item",dir:"auto"},a.ZP.createElement("span",{className:"title",dir:"auto"},p.appName),a.ZP.createElement("span",{className:"subtitle black tight"},Hn(p)),a.ZP.createElement("span",{className:"subtitle"},p.ip," - ",_n(p)))),a.ZP.createElement(Ee.Z,{className:"destructive mb-0 no-icon",icon:"stop",ripple:!0,narrow:!0,onClick:d},g("TerminateAllSessions")))),P&&(v=P,a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("h4",{className:"settings-item-header mb-4",dir:g.isRtl?"rtl":void 0},g("OtherSessions")),v.map((function(e){return a.ZP.createElement(Ee.Z,{key:e.hash,ripple:!0,narrow:!0,contextActions:[{title:"Terminate",icon:"stop",handler:()=>{u(e.hash)}}],className:"no-icon"},a.ZP.createElement("div",{className:"multiline-menu-item full-size",dir:"auto"},a.ZP.createElement("span",{className:"date"},(0,B.VX)(g,1e3*e.dateActive)),a.ZP.createElement("span",{className:"title"},e.appName),a.ZP.createElement("span",{className:"subtitle black tight"},Hn(e)),a.ZP.createElement("span",{className:"subtitle"},e.ip," - ",_n(e))))})))),P&&a.ZP.createElement(Me.Z,{isOpen:c,onClose:m,text:"Are you sure you want to terminate all other sessions?",confirmLabel:"Terminate All Other Sessions",confirmHandler:h,confirmIsDestructive:!0}));var v,p})));var Vn=n(6272);const Kn=(0,a.X$)((0,s.c$)((e=>{const{chats:{byId:t},users:{byId:n},blocked:{ids:a},countryList:{phoneCodes:s}}=e;return{chatsByIds:t,usersByIds:n,blockedIds:a,phoneCodeList:s}}),((e,t)=>(0,h.ei)(t,["unblockContact"])))((({isActive:e,onScreenSelect:t,onReset:n,chatsByIds:s,usersByIds:r,blockedIds:l,phoneCodeList:c,unblockContact:d})=>{const m=(0,a.I4)((e=>{d({contactId:e})}),[d]),h=(0,M.Z)();return(0,T.ZP)(e,n,t,o.MT.PrivacyBlockedUsers),a.ZP.createElement("div",{className:"settings-fab-wrapper"},a.ZP.createElement("div",{className:"settings-content infinite-scroll"},a.ZP.createElement("div",{className:"settings-item"},a.ZP.createElement("p",{className:"settings-item-description-larger mt-0 mb-2",dir:h.isRtl?"rtl":void 0},h("BlockedUsersInfo"))),a.ZP.createElement("div",{className:"chat-list custom-scroll"},null!=l&&l.length?a.ZP.createElement("div",{className:"scroll-container"},l.map(((e,t)=>function(e,t,n){const o=(0,u.YA)(e),l=o?r[e]:void 0,d=o?void 0:s[e],Z=(0,Y.Z)("Chat chat-item-clickable blocked-list-item small-icon",o?"private":"group");return a.ZP.createElement(Ee.Z,{key:e,className:Z,ripple:!0,narrow:!0,contextActions:[{title:"Unblock",icon:"unlock",handler:()=>{m(e)}}],style:`top: ${(0+t)*i.rS}px;`},a.ZP.createElement(D.Z,{size:"medium",user:l,chat:d}),a.ZP.createElement("div",{className:"contact-info",dir:"auto"},a.ZP.createElement("h3",{dir:"auto"},(0,$.Z)((o?(0,u.Js)(l):(0,u.U)(h,d))||"")),(null==l?void 0:l.phoneNumber)&&a.ZP.createElement("div",{className:"contact-phone",dir:"auto"},(0,Vn.WZ)(c,l.phoneNumber)),l&&!l.phoneNumber&&l.username&&a.ZP.createElement("div",{className:"contact-username",dir:"auto"},"@",l.username)))}(e,t)))):l&&!l.length?a.ZP.createElement("div",{className:"no-results",dir:"auto"},"List is empty"):a.ZP.createElement(Pe.Z,{key:"loading"}))),a.ZP.createElement(Gt.Z,{isShown:!0,onClick:()=>{},className:"not-implemented",ariaLabel:"Add a blocked user"},a.ZP.createElement("i",{className:"icon-add"})))})));var qn=n(7854);const Wn=(0,a.X$)((0,s.c$)((e=>({animatedEmoji:(0,m.zB)(e,"🔐")})))((({isActive:e,onReset:t,animatedEmoji:n,onScreenSelect:s})=>{const r=(0,M.Z)();return(0,T.ZP)(e,t,s,o.MT.TwoFaEnabled),a.ZP.createElement("div",{className:"settings-content two-fa custom-scroll"},a.ZP.createElement("div",{className:"settings-content-header"},a.ZP.createElement(qn.Z,{sticker:n,size:"large"}),a.ZP.createElement("p",{className:"settings-item-description mb-3",dir:"auto"},(0,$.Z)(r("EnabledPasswordText"),["br"]))),a.ZP.createElement("div",{className:"settings-item pt-0 no-border"},a.ZP.createElement(Ee.Z,{icon:"edit",onClick:()=>s(o.MT.TwoFaChangePasswordCurrent)},r("ChangePassword")),a.ZP.createElement(Ee.Z,{icon:"password-off",onClick:()=>s(o.MT.TwoFaTurnOff)},r("TurnPasswordOff")),a.ZP.createElement(Ee.Z,{icon:"email",onClick:()=>s(o.MT.TwoFaRecoveryEmailCurrentPassword)},r("SetRecoveryEmail"))))})));var Qn=n(3490),ea=n(9364);const ta=(0,a.X$)((({screen:e,isActive:t,onScreenSelect:n,onReset:s,error:r,isLoading:o,expectedPassword:i,placeholder:l="Current Password",hint:c,submitLabel:d,clearError:m,onSubmit:u})=>{const[h,Z]=(0,a.eJ)(""),[P,g]=(0,a.eJ)(!1),v=(0,a.I4)((e=>{i&&e!==i?Z("Passwords Should Be Equal"):u(e)}),[u,i]),p=(0,a.I4)((()=>{m&&m(),Z("")}),[m]),E=(0,M.Z)();return(0,T.ZP)(t,s,n,e),a.ZP.createElement("div",{className:"settings-content two-fa custom-scroll"},a.ZP.createElement("div",{className:"settings-content-header"},a.ZP.createElement(Qn.Z,{isBig:!0,isPasswordVisible:P})),a.ZP.createElement("div",{className:"settings-item pt-0 no-border"},a.ZP.createElement(ea.Z,{error:h||r,hint:c,placeholder:l,submitLabel:d||E("Next"),clearError:p,isLoading:o,isPasswordVisible:P,onChangePasswordVisibility:g,onSubmit:v})))})),na=(0,a.X$)((0,s.c$)((e=>({animatedEmoji:(0,m.zB)(e,"🔐")})))((({isActive:e,onScreenSelect:t,onReset:n,animatedEmoji:s,onStart:r})=>{const i=(0,M.Z)();return(0,T.ZP)(e,n,t,o.MT.TwoFaDisabled),a.ZP.createElement("div",{className:"settings-content two-fa custom-scroll"},a.ZP.createElement("div",{className:"settings-content-header"},a.ZP.createElement(qn.Z,{sticker:s,size:"large"}),a.ZP.createElement("p",{className:"settings-item-description mb-3",dir:"auto"},i("SetAdditionalPasswordInfo"))),a.ZP.createElement("div",{className:"settings-item pt-0 no-border"},a.ZP.createElement(R.Z,{onClick:r},i("EditAdminTransferSetPassword"))))}))),aa=l.wB?550:400,sa=(0,a.X$)((0,s.c$)(((e,{icon:t})=>({animatedEmoji:(0,m.zB)(e,"email"===t?"💌":"💡")})))((({animatedEmoji:e,type:t="text",isLoading:n,error:s,placeholder:r,shouldConfirm:o,clearError:i,onSubmit:c,isActive:d,onScreenSelect:m,onReset:u,screen:h})=>{const Z=(0,a.sO)(null),[P,g]=(0,a.eJ)(""),[v,p,E]=(0,Fe.Z)(!1);(0,a.d4)((()=>{l.$b||setTimeout((()=>{Z.current.focus()}),aa)}),[]);const C=(0,M.Z)();return(0,T.ZP)(d,u,m,h),a.ZP.createElement("div",{className:"settings-content two-fa custom-scroll"},a.ZP.createElement("div",{className:"settings-content-header"},a.ZP.createElement(qn.Z,{sticker:e,size:"large"})),a.ZP.createElement("div",{className:"settings-item pt-0 no-border"},a.ZP.createElement("form",{action:"",onSubmit:e=>{e.preventDefault(),Z.current&&c(P)}},a.ZP.createElement(ve.Z,{ref:Z,value:P,inputMode:t,label:r,error:s,onChange:e=>{s&&i&&i(),g(e.target.value)}}),P?a.ZP.createElement(R.Z,{type:"submit",isLoading:n,ripple:!0},C("Continue")):a.ZP.createElement(R.Z,{isText:!0,isLoading:n,ripple:!0,onClick:o?p:()=>{c()}},C("YourEmailSkip"))),o&&a.ZP.createElement(ge.Z,{className:"narrow",isOpen:v,title:C("YourEmailSkipWarning"),onClose:E},(0,$.Z)(C("YourEmailSkipWarningText"),["br","simple_markdown"]),a.ZP.createElement("div",{className:"dialog-buttons"},a.ZP.createElement(R.Z,{color:"danger",ripple:!0,isText:!0,className:"confirm-dialog-button",onClick:()=>{E(),c()}},C("YourEmailSkip")),a.ZP.createElement(R.Z,{color:"primary",ripple:!0,isText:!0,className:"confirm-dialog-button",onClick:E},C("Cancel"))))))}))),ra=(0,a.X$)((0,s.c$)((e=>({animatedEmoji:(0,m.zB)(e,"🥳")})))((({isActive:e,onReset:t,animatedEmoji:n,onScreenSelect:s})=>{const r=(0,M.Z)();return(0,T.ZP)(e,t,s,o.MT.TwoFaCongratulations),a.ZP.createElement("div",{className:"settings-content two-fa custom-scroll"},a.ZP.createElement("div",{className:"settings-content-header"},a.ZP.createElement(qn.Z,{sticker:n,size:"large"}),a.ZP.createElement("p",{className:"settings-item-description mb-3",dir:"auto"},r("TwoStepVerificationPasswordSetInfo"))),a.ZP.createElement("div",{className:"settings-item pt-0 no-border"},a.ZP.createElement(R.Z,{onClick:()=>{s(o.MT.Privacy)}},r("TwoStepVerificationPasswordReturnSettings"))))}))),oa=l.wB?550:400,ia=(0,a.X$)((0,s.c$)((e=>({animatedEmoji:(0,m.zB)(e,"💌"),codeLength:e.twoFaSettings.waitingEmailCodeLength})))((({animatedEmoji:e,codeLength:t,isLoading:n,error:s,clearError:r,onSubmit:o,isActive:i,onScreenSelect:c,onReset:d,screen:m})=>{const u=(0,a.sO)(null),[h,Z]=(0,a.eJ)("");(0,a.d4)((()=>{l.$b||setTimeout((()=>{u.current.focus()}),oa)}),[]);const P=(0,M.Z)();return(0,T.ZP)(i,d,c,m),a.ZP.createElement("div",{className:"settings-content two-fa custom-scroll"},a.ZP.createElement("div",{className:"settings-content-header"},a.ZP.createElement(qn.Z,{sticker:e,size:"large"})),a.ZP.createElement("div",{className:"settings-item pt-0 no-border"},a.ZP.createElement(ve.Z,{value:h,ref:u,inputMode:"decimal",label:P("YourEmailCode"),error:s,onChange:e=>{s&&r&&r();const n=e.target.value.slice(0,t);n.length===t&&o(n),Z(n),e.target.value=n}}),n&&a.ZP.createElement(Pe.Z,null)))}))),la=(0,a.X$)((0,s.c$)((e=>({...e.twoFaSettings})),((e,t)=>(0,h.ei)(t,["updatePassword","updateRecoveryEmail","clearPassword","provideTwoFaEmailCode","checkPassword","clearTwoFaError"])))((({currentScreen:e,shownScreen:t,state:n,hint:s,isLoading:r,error:i,waitingEmailCodeLength:l,dispatch:c,isActive:d,onScreenSelect:m,onReset:u,updatePassword:h,checkPassword:Z,clearTwoFaError:P,updateRecoveryEmail:g,provideTwoFaEmailCode:v,clearPassword:p})=>{(0,a.d4)((()=>{l&&(e===o.MT.TwoFaNewPasswordEmail?m(o.MT.TwoFaNewPasswordEmailCode):e===o.MT.TwoFaRecoveryEmail&&m(o.MT.TwoFaRecoveryEmailCode))}),[e,m,l]);const E=(0,a.I4)((()=>{c({type:"reset"}),m(o.MT.TwoFaNewPassword)}),[c,m]),C=(0,a.I4)((e=>{c({type:"setPassword",payload:e}),m(o.MT.TwoFaNewPasswordConfirm)}),[c,m]),f=(0,a.I4)((()=>{m(o.MT.TwoFaNewPasswordHint)}),[m]),b=(0,a.I4)((e=>{c({type:"setHint",payload:e}),m(o.MT.TwoFaNewPasswordEmail)}),[c,m]),y=(0,a.I4)((e=>{c({type:"setEmail",payload:e}),h({...n,email:e,onSuccess:()=>{m(o.MT.TwoFaCongratulations)}})}),[c,m,n,h]),I=(0,a.I4)((e=>{c({type:"setCurrentPassword",payload:e}),Z({currentPassword:e,onSuccess:()=>{m(o.MT.TwoFaChangePasswordNew)}})}),[Z,c,m]),S=(0,a.I4)((e=>{c({type:"setPassword",payload:e}),m(o.MT.TwoFaChangePasswordConfirm)}),[c,m]),N=(0,a.I4)((()=>{m(o.MT.TwoFaChangePasswordHint)}),[m]),w=(0,a.I4)((e=>{c({type:"setHint",payload:e}),h({...n,hint:e,onSuccess:()=>{m(o.MT.TwoFaCongratulations)}})}),[c,m,n,h]),k=(0,a.I4)((e=>{p({currentPassword:e,onSuccess:()=>{m(o.MT.Privacy)}})}),[p,m]),T=(0,a.I4)((e=>{c({type:"setCurrentPassword",payload:e}),Z({currentPassword:e,onSuccess:()=>{m(o.MT.TwoFaRecoveryEmail)}})}),[Z,c,m]),F=(0,a.I4)((e=>{c({type:"setEmail",payload:e}),g({...n,email:e,onSuccess:()=>{m(o.MT.TwoFaCongratulations)}})}),[c,m,n,g]),A=(0,a.I4)((e=>{v({code:e})}),[v]),L=(0,M.Z)();switch(e){case o.MT.TwoFaDisabled:return a.ZP.createElement(na,{onStart:E,onScreenSelect:m,isActive:d||[o.MT.TwoFaNewPassword,o.MT.TwoFaNewPasswordConfirm,o.MT.TwoFaNewPasswordHint,o.MT.TwoFaNewPasswordEmail,o.MT.TwoFaNewPasswordEmailCode,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaNewPassword:return a.ZP.createElement(ta,{screen:e,placeholder:L("PleaseEnterPassword"),submitLabel:L("Continue"),onSubmit:C,onScreenSelect:m,isActive:d||[o.MT.TwoFaNewPasswordConfirm,o.MT.TwoFaNewPasswordHint,o.MT.TwoFaNewPasswordEmail,o.MT.TwoFaNewPasswordEmailCode,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaNewPasswordConfirm:return a.ZP.createElement(ta,{screen:e,expectedPassword:n.password,placeholder:L("PleaseReEnterPassword"),submitLabel:L("Continue"),onSubmit:f,onScreenSelect:m,isActive:d||[o.MT.TwoFaNewPasswordHint,o.MT.TwoFaNewPasswordEmail,o.MT.TwoFaNewPasswordEmailCode,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaNewPasswordHint:return a.ZP.createElement(sa,{icon:"hint",placeholder:L("PasswordHintPlaceholder"),onSubmit:b,screen:e,onScreenSelect:m,isActive:d||[o.MT.TwoFaNewPasswordEmail,o.MT.TwoFaNewPasswordEmailCode,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaNewPasswordEmail:return a.ZP.createElement(sa,{icon:"email",type:"email",isLoading:r,error:i,clearError:P,placeholder:L("RecoveryEmailTitle"),shouldConfirm:!0,onSubmit:y,screen:e,onScreenSelect:m,isActive:d||[o.MT.TwoFaNewPasswordEmailCode,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaNewPasswordEmailCode:return a.ZP.createElement(ia,{isLoading:r,error:i,clearError:P,onSubmit:A,screen:e,onScreenSelect:m,isActive:d||t===o.MT.TwoFaCongratulations,onReset:u});case o.MT.TwoFaCongratulations:return a.ZP.createElement(ra,{onScreenSelect:m,isActive:d,onReset:u});case o.MT.TwoFaEnabled:return a.ZP.createElement(Wn,{onScreenSelect:m,isActive:d||[o.MT.TwoFaChangePasswordCurrent,o.MT.TwoFaChangePasswordNew,o.MT.TwoFaChangePasswordConfirm,o.MT.TwoFaChangePasswordHint,o.MT.TwoFaTurnOff,o.MT.TwoFaRecoveryEmailCurrentPassword,o.MT.TwoFaRecoveryEmail,o.MT.TwoFaRecoveryEmailCode,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaChangePasswordCurrent:return a.ZP.createElement(ta,{screen:e,isLoading:r,error:i,clearError:P,hint:s,onSubmit:I,onScreenSelect:m,isActive:d||[o.MT.TwoFaChangePasswordNew,o.MT.TwoFaChangePasswordConfirm,o.MT.TwoFaChangePasswordHint,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaChangePasswordNew:return a.ZP.createElement(ta,{screen:e,placeholder:L("PleaseEnterNewFirstPassword"),onSubmit:S,onScreenSelect:m,isActive:d||[o.MT.TwoFaChangePasswordConfirm,o.MT.TwoFaChangePasswordHint,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaChangePasswordConfirm:return a.ZP.createElement(ta,{screen:e,expectedPassword:n.password,placeholder:L("PleaseReEnterPassword"),onSubmit:N,onScreenSelect:m,isActive:d||[o.MT.TwoFaChangePasswordHint,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaChangePasswordHint:return a.ZP.createElement(sa,{isLoading:r,error:i,clearError:P,icon:"hint",placeholder:L("PasswordHintPlaceholder"),onSubmit:w,onScreenSelect:m,isActive:d||t===o.MT.TwoFaCongratulations,onReset:u,screen:e});case o.MT.TwoFaTurnOff:return a.ZP.createElement(ta,{isLoading:r,error:i,clearError:P,hint:s,onSubmit:k,onScreenSelect:m,isActive:d,onReset:u,screen:e});case o.MT.TwoFaRecoveryEmailCurrentPassword:return a.ZP.createElement(ta,{screen:e,isLoading:r,error:i,clearError:P,hint:s,onSubmit:T,onScreenSelect:m,isActive:d||[o.MT.TwoFaRecoveryEmail,o.MT.TwoFaRecoveryEmailCode,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaRecoveryEmail:return a.ZP.createElement(sa,{screen:e,icon:"email",type:"email",placeholder:L("RecoveryEmailTitle"),onSubmit:F,onScreenSelect:m,isActive:d||[o.MT.TwoFaRecoveryEmailCode,o.MT.TwoFaCongratulations].includes(t),onReset:u});case o.MT.TwoFaRecoveryEmailCode:return a.ZP.createElement(ia,{screen:e,isLoading:r,error:i,clearError:P,onSubmit:A,onScreenSelect:m,isActive:d||t===o.MT.TwoFaCongratulations,onReset:u});default:return}})));var ca=n(1820);function da(e,t){const{privacy:n}=e.settings;switch(t){case o.MT.PrivacyPhoneNumberAllowedContacts:case o.MT.PrivacyPhoneNumberDeniedContacts:return n.phoneNumber;case o.MT.PrivacyLastSeenAllowedContacts:case o.MT.PrivacyLastSeenDeniedContacts:return n.lastSeen;case o.MT.PrivacyProfilePhotoAllowedContacts:case o.MT.PrivacyProfilePhotoDeniedContacts:return n.profilePhoto;case o.MT.PrivacyForwardingAllowedContacts:case o.MT.PrivacyForwardingDeniedContacts:return n.forwards;case o.MT.PrivacyGroupChatsDeniedContacts:case o.MT.PrivacyGroupChatsAllowedContacts:return n.chatInvite}}const ma=(0,a.X$)((0,s.c$)(((e,{screen:t})=>{const{chats:{byId:n,listIds:a,orderedPinnedIds:s},currentUserId:r}=e;return{currentUserId:r,chatsById:n,listIds:a.active,orderedPinnedIds:s.active,archivedPinnedIds:s.archived,archivedListIds:a.archived,settings:da(e,t)}}),((e,t)=>(0,h.ei)(t,["setPrivacySettings"])))((({currentUserId:e,isAllowList:t,screen:n,settings:s,chatsById:r,listIds:i,orderedPinnedIds:l,archivedListIds:c,archivedPinnedIds:d,setPrivacySettings:m,isActive:h,onScreenSelect:Z,onReset:P})=>{const g=(0,M.Z)(),v=(0,a.Ye)((()=>s?t?[...s.allowUserIds,...s.allowChatIds]:[...s.blockUserIds,...s.blockChatIds]:[]),[t,s]),[p,E]=(0,a.eJ)(""),[C,f]=(0,a.eJ)(!1),[b,y]=(0,a.eJ)(v),I=(0,a.Ye)((()=>{const e=i?(0,u.O)(r,i,l,"all"):void 0,t=c?(0,u.O)(r,c,d,"archived"):void 0;if(e||t)return[...e?[...e.pinnedChats,...e.otherChats]:[],...t?t.otherChats:[]]}),[r,i,l,c,d]),S=(0,a.Ye)((()=>{if(I)return I.filter((t=>((0,u.YA)(t.id)&&t.id!==e||(0,u.Bf)(t))&&(!p||(0,ue.Z)((0,u.U)(g,t),p)||v.includes(t.id)))).map((({id:e})=>e))}),[I,e,g,p,v]),N=(0,a.I4)((e=>{y(e),f(!0)}),[]),w=(0,a.I4)((()=>{m({privacyKey:Xn(n),isAllowList:Boolean(t),contactsIds:b}),Z(o.MT.Privacy)}),[t,b,Z,n,m]);return(0,T.ZP)(h,P,Z,n),a.ZP.createElement("div",{className:"NewChat-inner step-1"},a.ZP.createElement(ca.Z,{itemIds:S||[],selectedIds:b,filterValue:p,filterPlaceholder:g(t?"AlwaysShareWithPlaceholder":"NeverShareWithPlaceholder"),searchInputId:"new-group-picker-search",onSelectedIdsChange:N,onFilterChange:E}),a.ZP.createElement(Gt.Z,{isShown:C,onClick:w,ariaLabel:g(t?"AlwaysShareWithTitle":"NeverShareWithTitle")},a.ZP.createElement("i",{className:"icon-arrow-right"})))}))),ua=Object.keys(o.MT).length/2,ha=[o.MT.TwoFaDisabled,o.MT.TwoFaNewPassword,o.MT.TwoFaNewPasswordConfirm,o.MT.TwoFaNewPasswordHint,o.MT.TwoFaNewPasswordEmail,o.MT.TwoFaNewPasswordEmailCode,o.MT.TwoFaCongratulations,o.MT.TwoFaEnabled,o.MT.TwoFaChangePasswordCurrent,o.MT.TwoFaChangePasswordNew,o.MT.TwoFaChangePasswordConfirm,o.MT.TwoFaChangePasswordHint,o.MT.TwoFaTurnOff,o.MT.TwoFaRecoveryEmailCurrentPassword,o.MT.TwoFaRecoveryEmail,o.MT.TwoFaRecoveryEmailCode],Za=[o.MT.Folders,o.MT.FoldersCreateFolder,o.MT.FoldersEditFolder,o.MT.FoldersEditFolderFromChatList,o.MT.FoldersIncludedChats,o.MT.FoldersIncludedChatsFromChatList,o.MT.FoldersExcludedChats,o.MT.FoldersExcludedChatsFromChatList],Pa=[o.MT.PrivacyBlockedUsers,o.MT.PrivacyActiveSessions],ga=[o.MT.PrivacyPhoneNumberAllowedContacts,o.MT.PrivacyPhoneNumberDeniedContacts],va=[o.MT.PrivacyLastSeenAllowedContacts,o.MT.PrivacyLastSeenDeniedContacts],pa=[o.MT.PrivacyProfilePhotoAllowedContacts,o.MT.PrivacyProfilePhotoDeniedContacts],Ea=[o.MT.PrivacyForwardingAllowedContacts,o.MT.PrivacyForwardingDeniedContacts],Ca=[o.MT.PrivacyGroupChatsAllowedContacts,o.MT.PrivacyGroupChatsDeniedContacts],fa=(0,a.X$)((({isActive:e,currentScreen:t,foldersState:n,foldersDispatch:s,onScreenSelect:r,onReset:i,shouldSkipTransition:c})=>{const[d,m]=(0,Lt.Z)(Bt,Rt),u=(0,a.I4)((()=>{t!==o.MT.FoldersCreateFolder&&t!==o.MT.FoldersEditFolder&&t!==o.MT.FoldersEditFolderFromChatList||setTimeout((()=>{s({type:"reset"})}),200),t!==o.MT.FoldersIncludedChats&&t!==o.MT.FoldersExcludedChats?i():"create"===n.mode?r(o.MT.FoldersCreateFolder):r(o.MT.FoldersEditFolder)}),[n.mode,s,t,i,r]),h=(0,a.I4)((()=>{s({type:"saveFilters"}),u()}),[s,u]);function Z(i,l,c){return a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement($t,{currentScreen:t,onReset:u,onSaveFilter:h,onScreenSelect:r,editedFolderId:n.folderId}),function(i,l){const c={[o.MT.PrivacyPhoneNumber]:ga.includes(l),[o.MT.PrivacyLastSeen]:va.includes(l),[o.MT.PrivacyProfilePhoto]:pa.includes(l),[o.MT.PrivacyForwarding]:Ea.includes(l),[o.MT.PrivacyGroupChats]:Ca.includes(l)},h=ha.includes(l),Z=Za.includes(l),P=Pa.includes(l)||h||Object.keys(c).includes(l.toString())||Object.values(c).find((e=>!0===e));switch(t){case o.MT.Main:return a.ZP.createElement(xt,{onScreenSelect:r,isActive:e,onReset:u});case o.MT.EditProfile:return a.ZP.createElement(Kt,{onScreenSelect:r,isActive:e&&i,onReset:u});case o.MT.General:return a.ZP.createElement(fn,{onScreenSelect:r,isActive:i||l===o.MT.GeneralChatBackgroundColor||l===o.MT.GeneralChatBackground||P||Z,onReset:u});case o.MT.Notifications:return a.ZP.createElement(On,{onScreenSelect:r,isActive:i,onReset:u});case o.MT.Privacy:return a.ZP.createElement(Gn,{onScreenSelect:r,isActive:i||P||h,onReset:u});case o.MT.Language:return a.ZP.createElement(zn,{onScreenSelect:r,isActive:i,onReset:u});case o.MT.GeneralChatBackground:return a.ZP.createElement(Rn,{onScreenSelect:r,isActive:i||l===o.MT.GeneralChatBackgroundColor,onReset:u});case o.MT.GeneralChatBackgroundColor:return a.ZP.createElement(xn,{onScreenSelect:r,isActive:i,onReset:u});case o.MT.PrivacyActiveSessions:return a.ZP.createElement(jn,{onScreenSelect:r,isActive:i,onReset:u});case o.MT.PrivacyBlockedUsers:return a.ZP.createElement(Kn,{onScreenSelect:r,isActive:i,onReset:u});case o.MT.PrivacyPhoneNumber:case o.MT.PrivacyLastSeen:case o.MT.PrivacyProfilePhoto:case o.MT.PrivacyForwarding:case o.MT.PrivacyGroupChats:return a.ZP.createElement(Yn,{screen:t,onScreenSelect:r,isActive:i||c[t],onReset:u});case o.MT.PrivacyPhoneNumberAllowedContacts:case o.MT.PrivacyLastSeenAllowedContacts:case o.MT.PrivacyProfilePhotoAllowedContacts:case o.MT.PrivacyForwardingAllowedContacts:case o.MT.PrivacyGroupChatsAllowedContacts:return a.ZP.createElement(ma,{isAllowList:!0,screen:t,onScreenSelect:r,isActive:i||c[t],onReset:u});case o.MT.PrivacyPhoneNumberDeniedContacts:case o.MT.PrivacyLastSeenDeniedContacts:case o.MT.PrivacyProfilePhotoDeniedContacts:case o.MT.PrivacyForwardingDeniedContacts:case o.MT.PrivacyGroupChatsDeniedContacts:return a.ZP.createElement(ma,{screen:t,onScreenSelect:r,isActive:i,onReset:u});case o.MT.Folders:case o.MT.FoldersCreateFolder:case o.MT.FoldersEditFolder:case o.MT.FoldersEditFolderFromChatList:case o.MT.FoldersIncludedChats:case o.MT.FoldersIncludedChatsFromChatList:case o.MT.FoldersExcludedChats:case o.MT.FoldersExcludedChatsFromChatList:return a.ZP.createElement(dn,{currentScreen:t,shownScreen:l,state:n,dispatch:s,isActive:i,onScreenSelect:r,onReset:u});case o.MT.TwoFaDisabled:case o.MT.TwoFaNewPassword:case o.MT.TwoFaNewPasswordConfirm:case o.MT.TwoFaNewPasswordHint:case o.MT.TwoFaNewPasswordEmail:case o.MT.TwoFaNewPasswordEmailCode:case o.MT.TwoFaCongratulations:case o.MT.TwoFaEnabled:case o.MT.TwoFaChangePasswordCurrent:case o.MT.TwoFaChangePasswordNew:case o.MT.TwoFaChangePasswordConfirm:case o.MT.TwoFaChangePasswordHint:case o.MT.TwoFaTurnOff:case o.MT.TwoFaRecoveryEmailCurrentPassword:case o.MT.TwoFaRecoveryEmail:case o.MT.TwoFaRecoveryEmailCode:return a.ZP.createElement(la,{currentScreen:t,state:d,dispatch:m,shownScreen:l,isActive:i,onScreenSelect:r,onReset:u});default:return}}(i,c))}return a.ZP.createElement(L.Z,{id:"Settings",name:c?"none":l.s0,activeKey:t,renderCount:ua},Z)})),ba=(0,X.P2)((e=>e()),6e4,!0),ya=(0,a.X$)((0,s.c$)((e=>{const{userIds:t}=e.contactList||{},{byId:n}=e.users;return{usersById:n,contactIds:t,serverTimeOffset:e.serverTimeOffset}}),((e,t)=>(0,h.ei)(t,["loadContactList","openChat"])))((({isActive:e,onReset:t,filter:n,usersById:s,contactIds:r,loadContactList:o,openChat:i,serverTimeOffset:c})=>{(0,a.d4)((()=>{ba((()=>{o()}))})),(0,T.ZP)(e,t);const d=(0,a.I4)((e=>{i({id:e,shouldReplaceHistory:!0})}),[i]),m=(0,a.Ye)((()=>{if(!r)return;const e=n?r.filter((e=>{const t=s[e];if(!t)return!1;const a=(0,u.Js)(t);return a&&(0,ue.Z)(a,n)})):r;return(0,u.Z0)(e,s,void 0,c)}),[r,n,s,c]),[h,Z]=(0,he.Z)(void 0,m,Boolean(n));return a.ZP.createElement(pe.Z,{items:h,onLoadMore:Z,className:"chat-list custom-scroll"},null!=h&&h.length?h.map((e=>a.ZP.createElement(Ee.Z,{key:e,className:"chat-item-clickable",onClick:()=>d(e),ripple:!l.wB},a.ZP.createElement(Ce.Z,{userId:e,forceShowSelf:!0,avatarSize:"large"})))):h&&!h.length?a.ZP.createElement("p",{className:"no-results",key:"no-results",dir:"auto"},n.length?"No contacts matched your search.":"Contact list is empty."):a.ZP.createElement(Pe.Z,{key:"loading"}))}))),Ia=(0,X.P2)((e=>e()),6e4,!0),Sa=(0,a.X$)((0,s.c$)((e=>{const{userIds:t}=e.contactList||{},{byId:n}=e.users,{byId:a}=e.chats,{currentUserId:s}=e,{query:r,fetchingStatus:o,globalResults:i,localResults:l}=e.globalSearch,{userIds:c}=i||{},{userIds:d}=l||{};return{currentUserId:s,usersById:n,chatsById:a,localContactIds:t,searchQuery:r,isSearching:null==o?void 0:o.chats,globalUserIds:c,localUserIds:d}}),((e,t)=>(0,h.ei)(t,["loadContactList","setGlobalSearchQuery"])))((({isChannel:e,isActive:t,selectedMemberIds:n,onSelectedMemberIdsChange:s,onNextStep:r,onReset:o,currentUserId:i,usersById:l,chatsById:c,localContactIds:d,searchQuery:m,isSearching:Z,localUserIds:P,globalUserIds:g,loadContactList:v,setGlobalSearchQuery:p})=>{(0,a.d4)((()=>{Ia((()=>{v()}))}));const E=(0,M.Z)();(0,T.ZP)(t,o);const C=(0,a.I4)((e=>{p({query:e})}),[p]),f=(0,a.Ye)((()=>{const e=d?(0,u.ih)(d.filter((e=>e!==i)),c):[];if(!m)return e;const t=e.filter((e=>{const t=l[e];if(!t)return!1;const n=(0,u.Js)(t);return n&&(0,ue.Z)(n,m)}));return(0,u.ih)((0,h.Tw)([...t,...P||[],...g||[]]).filter((e=>{const t=l[e];return!t||!(0,u.cS)(t)||t.canBeInvitedToGroup})),c,!1,n)}),[d,c,m,P,g,n,i,l]),b=(0,a.I4)((()=>{(n.length||e)&&(p({query:""}),r())}),[n.length,e,p,r]);return a.ZP.createElement("div",{className:"NewChat step-1"},a.ZP.createElement("div",{className:"left-header"},a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",onClick:o,ariaLabel:"Return to Chat List"},a.ZP.createElement("i",{className:"icon-arrow-left"})),a.ZP.createElement("h3",null,E("GroupAddMembers"))),a.ZP.createElement("div",{className:"NewChat-inner step-1"},a.ZP.createElement(ca.Z,{itemIds:f,selectedIds:n,filterValue:m,filterPlaceholder:E("SendMessageTo"),searchInputId:"new-group-picker-search",isLoading:Z,onSelectedIdsChange:s,onFilterChange:C}),a.ZP.createElement(Gt.Z,{isShown:Boolean(n.length||e),onClick:b,ariaLabel:e?"Continue To Channel Info":"Continue To Group Info"},a.ZP.createElement("i",{className:"icon-arrow-right"}))))}))),Na=(0,a.X$)((0,s.c$)((e=>{const{progress:t,error:n}=e.chatCreation||{};return{creationProgress:t,creationError:n}}),((e,t)=>(0,h.ei)(t,["createGroupChat","createChannel"])))((({isChannel:e,isActive:t,memberIds:n,onReset:s,creationProgress:r,creationError:i,createGroupChat:l,createChannel:c})=>{const d=(0,M.Z)();(0,T.ZP)(t,s);const[m,u]=(0,a.eJ)(""),[h,Z]=(0,a.eJ)(""),[P,g]=(0,a.eJ)(),[v,p]=(0,a.eJ)(),E="Chat title can't be empty",C="Channel title can't be empty",f="Sorry, creating supergroups is not yet supported",b=r===o.Nh.InProgress,y=(0,a.I4)((e=>{const{value:t}=e.currentTarget,n=t.replace(/^\s+/,"");u(n),n!==t&&(e.currentTarget.value=n)}),[]),I=(0,a.I4)((e=>{Z(e.currentTarget.value)}),[]),S=(0,a.I4)((()=>{m.length?n.length>199?p(f):l({title:m,photo:P,memberIds:n}):p(E)}),[m,n,l,P,E,f]),N=(0,a.I4)((()=>{m.length?c({title:m,about:h,photo:P,memberIds:n}):p(C)}),[m,c,h,P,n,C]);(0,a.d4)((()=>{r===o.Nh.Complete&&s(!0)}),[r,s]);const w=i||(v!==E&&v!==C?v:void 0);return a.ZP.createElement("div",{className:"NewChat"},a.ZP.createElement("div",{className:"left-header"},a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",onClick:()=>s(),ariaLabel:"Return to member selection"},a.ZP.createElement("i",{className:"icon-arrow-left"})),a.ZP.createElement("h3",null,d(e?"NewChannel":"NewGroup"))),a.ZP.createElement("div",{className:"NewChat-inner step-2"},a.ZP.createElement(Ot.Z,{onChange:g,title:d("AddPhoto")}),a.ZP.createElement(ve.Z,{value:m,onChange:y,label:d(e?"EnterChannelName":"GroupName"),error:v===E||v===C?v:void 0}),e&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(ve.Z,{value:h,onChange:I,label:d("DescriptionOptionalPlaceholder")}),a.ZP.createElement("p",{className:"note"},d("DescriptionInfo"))),w&&a.ZP.createElement("p",{className:"error"},w),n.length>0&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("h3",{className:"chat-members-heading"},d("GroupInfo.ParticipantCount",n.length,"i")),a.ZP.createElement("div",{className:"chat-members-list custom-scroll"},n.map((e=>a.ZP.createElement(Ee.Z,{inactive:!0,className:"chat-item-clickable"},a.ZP.createElement(Ce.Z,{userId:e}))))))),a.ZP.createElement(Gt.Z,{isShown:0!==m.length,onClick:e?N:S,disabled:b,ariaLabel:e?d("ChannelIntro.CreateChannel"):"Create Group"},b?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-arrow-right"})))}))),wa=Object.keys(o.du).length/2,ka=(0,a.X$)((({isActive:e,isChannel:t=!1,content:n,onContentChange:s,onReset:r})=>{const[i,c]=(0,a.eJ)([]),d=(0,a.I4)((()=>{s(t?o.du.NewChannelStep2:o.du.NewGroupStep2)}),[t,s]);return a.ZP.createElement(L.Z,{id:"NewChat",name:l.s0,renderCount:wa,activeKey:n},(s=>{switch(n){case o.du.NewChannelStep1:case o.du.NewGroupStep1:return a.ZP.createElement(Sa,{isChannel:t,isActive:e,selectedMemberIds:i,onSelectedMemberIdsChange:c,onNextStep:d,onReset:r});case o.du.NewChannelStep2:case o.du.NewGroupStep2:return a.ZP.createElement(Na,{isChannel:t,isActive:s&&e,memberIds:i,onReset:r});default:return}}))}));var Ma=n(9359);const Ta=(0,a.X$)((({isActive:e,onReset:t,onContentChange:n})=>{const s=(0,M.Z)();return(0,T.ZP)(e,t,n,o.du.Archived),a.ZP.createElement("div",{className:"ArchivedChats"},a.ZP.createElement("div",{className:"left-header"},a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",onClick:t,ariaLabel:"Return to chat list"},a.ZP.createElement("i",{className:"icon-arrow-left"})),a.ZP.createElement("h3",null,s("ArchivedChats"))),a.ZP.createElement(Ma.Z,{folderType:"archived",isActive:e}))})),Fa={Down:!0,ArrowDown:!0,Up:!0,ArrowUp:!0,Left:!0,ArrowLeft:!0,Right:!0,ArrowRight:!0," ":!0,PageUp:!0,PageDown:!0,End:!0,Home:!0,Tab:!0},Aa=e=>{e.preventDefault()};function La(e){Fa[e.key]&&!function(e){if(!(e&&e instanceof HTMLElement))return!1;const t=e,n=t.tagName.toLowerCase();if("textarea"===n)return!0;if("input"!==n)return!1;const a=t.getAttribute("type");return!!a&&["text","password","number","email","tel","url","search","date","datetime","datetime-local","time","month","week"].indexOf(a.toLowerCase())>-1}(e.target)&&Aa(e)}function Ra(){document.addEventListener("wheel",Aa,{passive:!1}),window.ontouchmove=Aa,document.onkeydown=La}function Ba(){document.removeEventListener("wheel",Aa),window.ontouchmove=null,document.onkeydown=null}var $a=n(647),Da=n(4319);function Ua(e){return e?"lng_context_copy_selected":"lng_context_copy_text"}var xa=n(3394),Oa=n(2328);const Ga=({isOpen:e,message:t,anchor:n,canSendNow:s,canReschedule:o,canReply:i,canEdit:l,canPin:c,canUnpin:d,canDelete:m,canReport:h,canForward:Z,canFaveSticker:P,canUnfaveSticker:g,canCopy:v,canCopyLink:p,canSelect:E,onReply:C,onEdit:f,onPin:b,onUnpin:y,onForward:I,onDelete:S,onReport:N,onFaveSticker:w,onUnfaveSticker:k,onSelect:T,onSend:F,onReschedule:A,onClose:L,onCloseAnimationEnd:R,onCopyLink:B})=>{const $=function(e,t,n){const a=[],s=(0,u.UD)(e),o=(0,u.O$)(e)||((0,u.Cg)(e)?void 0:(0,u.F$)(e)),i=(0,u.Ti)(e,"inline"),l=o&&(i||(0,u.BM)(e))&&Da.yl,c=window.getSelection();if(l&&a.push({label:"lng_context_copy_image",handler:()=>{Promise.resolve(i?$a.he(i,r.IU.BlobUrl):o.blobUrl).then(Da.VP),t&&t()}}),s){var d;const e=Boolean((null==c||null===(d=c.anchorNode)||void 0===d?void 0:d.parentNode)&&c.anchorNode.parentNode.closest(".Message .content-inner")&&""!==c.toString().replace(/(?:\r\n|\r|\n)/g,""));a.push({label:Ua(e),handler:()=>{const n=e&&c?c.toString():s;(0,Da.TE)(n),t&&t()}})}return n&&a.push({label:"lng_context_copy_message_link",handler:()=>{n(),t&&t()}}),a}(t,L,p?B:void 0),D=(0,a.I4)((()=>document.querySelector(`.active > .MessageList div[data-message-id="${t.id}"]`)),[t.id]),U=(0,a.I4)((()=>document.querySelector(".active > .MessageList")),[]),x=(0,a.I4)((()=>document.querySelector(".MessageContextMenu .bubble")),[]),{positionX:O,positionY:J,style:z}=(0,xa.Z)(n,D,U,x,10,document.querySelector(".MiddleHeader").offsetHeight),X=(0,M.Z)();return a.ZP.createElement(Oa.Z,{isOpen:e,positionX:O,positionY:J,style:z,className:"MessageContextMenu fluid",onClose:L,onCloseAnimationEnd:R},s&&a.ZP.createElement(G.Z,{icon:"send-outline",onClick:F},X("MessageScheduleSend")),o&&a.ZP.createElement(G.Z,{icon:"schedule",onClick:A},X("MessageScheduleEditTime")),i&&a.ZP.createElement(G.Z,{icon:"reply",onClick:C},X("Reply")),l&&a.ZP.createElement(G.Z,{icon:"edit",onClick:f},X("Edit")),P&&a.ZP.createElement(G.Z,{icon:"favorite",onClick:w},X("AddToFavorites")),g&&a.ZP.createElement(G.Z,{icon:"favorite",onClick:k},X("Stickers.RemoveFromFavorites")),v&&$.map((e=>a.ZP.createElement(G.Z,{key:e.label,icon:"copy",onClick:e.handler},X(e.label)))),c&&a.ZP.createElement(G.Z,{icon:"pin",onClick:b},X("DialogPin")),d&&a.ZP.createElement(G.Z,{icon:"unpin",onClick:y},X("DialogUnpin")),Z&&a.ZP.createElement(G.Z,{icon:"forward",onClick:I},X("Forward")),E&&a.ZP.createElement(G.Z,{icon:"select",onClick:T},X("Common.Select")),h&&a.ZP.createElement(G.Z,{icon:"flag",onClick:N},X("lng_context_report_msg")),m&&a.ZP.createElement(G.Z,{destructive:!0,icon:"delete",onClick:S},X("Delete")))},Ja=(0,a.X$)((0,s.c$)(((e,{message:t,messageListType:n})=>{const{threadId:a}=(0,m.Bt)(e)||{},{noOptions:s,canReply:r,canPin:o,canUnpin:i,canDelete:l,canReport:c,canEdit:d,canForward:u,canFaveSticker:h,canUnfaveSticker:Z,canCopy:P,canCopyLink:g,canSelect:v}=a&&(0,m._k)(e,t,a)||{},p="pinned"===n,E="scheduled"===n;return{noOptions:s,canSendNow:E,canReschedule:E,canReply:!p&&!E&&r,canPin:!E&&o,canUnpin:!E&&i,canDelete:l,canReport:c,canEdit:!p&&d,canForward:!E&&u,canFaveSticker:!E&&h,canUnfaveSticker:!E&&Z,canCopy:P,canCopyLink:!E&&g,canSelect:v}}),((e,t)=>(0,h.ei)(t,["setReplyingToId","setEditingId","pinMessage","openForwardMenu","faveSticker","unfaveSticker","toggleMessageSelection","sendScheduledMessages","rescheduleMessage"])))((({isOpen:e,messageListType:t,chatUsername:n,message:s,album:r,anchor:o,onClose:i,onCloseAnimationEnd:l,noOptions:c,canSendNow:d,canReschedule:m,canReply:u,canPin:h,canUnpin:Z,canDelete:P,canReport:g,canEdit:v,canForward:p,canFaveSticker:E,canUnfaveSticker:C,canCopy:f,canCopyLink:b,canSelect:y,setReplyingToId:I,setEditingId:S,pinMessage:N,openForwardMenu:w,faveSticker:k,unfaveSticker:M,toggleMessageSelection:T,sendScheduledMessages:F,rescheduleMessage:A})=>{const{transitionClassNames:L}=(0,H.Z)(e,l,void 0,!1),[R,$]=(0,a.eJ)(!0),[D,U]=(0,a.eJ)(!1),[x,O]=(0,a.eJ)(!1),[G,J]=(0,a.eJ)(!1),[z,X,Y]=(0,Fe.Z)(),_=(0,a.I4)((()=>{$(!1),U(!0)}),[]),j=(0,a.I4)((()=>{$(!1),O(!0)}),[]),V=(0,a.I4)((()=>{$(!1),i()}),[i]),K=(0,a.I4)((()=>{U(!1),i()}),[i]),q=(0,a.I4)((()=>{O(!1),i()}),[i]),W=(0,a.I4)((()=>{J(!1),i()}),[i]),Q=(0,a.I4)((()=>{Y(),i()}),[Y,i]),ee=(0,a.I4)((()=>{I({messageId:s.id}),V()}),[I,s.id,V]),te=(0,a.I4)((()=>{S({messageId:s.id}),V()}),[S,s.id,V]),ne=(0,a.I4)((()=>{$(!1),J(!0)}),[]),ae=(0,a.I4)((()=>{N({messageId:s.id,isUnpin:!0}),V()}),[N,s.id,V]),se=(0,a.I4)((()=>{if(V(),null!=r&&r.messages){const e=r.messages.map((({id:e})=>e));w({fromChatId:s.chatId,messageIds:e})}else w({fromChatId:s.chatId,messageIds:[s.id]})}),[w,s,V,r]),re=(0,a.I4)((()=>{V(),k({sticker:s.content.sticker})}),[V,s.content.sticker,k]),oe=(0,a.I4)((()=>{V(),M({sticker:s.content.sticker})}),[V,s.content.sticker,M]),ie=(0,a.I4)((()=>{const e=null!=r&&r.messages?{messageId:s.id,childMessageIds:r.messages.map((({id:e})=>e)),withShift:!1}:{messageId:s.id,withShift:!1};T(e),V()}),[V,s.id,T,r]),le=(0,a.I4)((()=>{F({chatId:s.chatId,id:s.id}),V()}),[V,s.chatId,s.id,F]),ce=(0,a.I4)((()=>{$(!1),X()}),[X]),de=(0,a.I4)((e=>{A({chatId:s.chatId,messageId:s.id,scheduledAt:Math.round(e.getTime()/1e3)})}),[s.chatId,s.id,A]),me=(0,a.I4)((()=>{(0,Da.TE)(`https://t.me/${n||`c/${Math.abs(s.chatId)}`}/${s.id}`),V()}),[n,V,s.chatId,s.id]);(0,a.d4)((()=>(Ra(),Ba)),[]);const ue=(0,a.Ye)((()=>(r?r.messages:[s]).map((({id:e})=>e))),[r,s]);if(c)return void V();const he=new Date;return he.setFullYear(he.getFullYear()+1),a.ZP.createElement("div",{className:["ContextMenuContainer",L].join(" ")},a.ZP.createElement(Ga,{message:s,isOpen:R,anchor:o,canSendNow:d,canReschedule:m,canReply:u,canDelete:P,canReport:g,canPin:h,canUnpin:Z,canEdit:v,canForward:p,canFaveSticker:E,canUnfaveSticker:C,canCopy:f,canCopyLink:b,canSelect:y,onReply:ee,onEdit:te,onPin:ne,onUnpin:ae,onForward:se,onDelete:_,onReport:j,onFaveSticker:re,onUnfaveSticker:oe,onSelect:ie,onSend:le,onReschedule:ce,onClose:V,onCopyLink:me}),a.ZP.createElement(Ue,{isOpen:D,isSchedule:"scheduled"===t,onClose:K,album:r,message:s}),a.ZP.createElement(Xe,{isOpen:x,onClose:q,messageIds:ue}),a.ZP.createElement(xe,{isOpen:G,messageId:s.id,chatId:s.chatId,onClose:W}),a.ZP.createElement($e,{isOpen:z,withTimePicker:!0,selectedAt:1e3*s.date,maxAt:(0,B._F)(he),isFutureMode:!0,onClose:Q,onSubmit:de}))}))),za=(0,a.X$)((0,s.c$)(((e,{fromSticker:t,stickerSetShortName:n})=>({stickerSet:t?(0,m.Ny)(e,t.stickerSetId):n?(0,m.E_)(e,n):void 0})),((e,t)=>(0,h.ei)(t,["loadStickers","toggleStickerSet","sendMessage"])))((({isOpen:e,fromSticker:t,stickerSetShortName:n,stickerSet:s,onClose:r,loadStickers:o,toggleStickerSet:l,sendMessage:c})=>{const d=(0,a.sO)(null),m=(0,M.Z)(),{observe:u}=(0,mn.S1)({rootRef:d,throttleMs:200,isDisabled:!e});(0,a.d4)((()=>{if(e)if(t){const{stickerSetId:e,stickerSetAccessHash:n}=t;o({stickerSetId:e,stickerSetAccessHash:n})}else n&&o({stickerSetShortName:n})}),[e,t,o,n]);const h=(0,a.I4)((e=>{e={...e,isPreloadedGlobally:!0},c({sticker:e}),r()}),[r,c]),Z=(0,a.I4)((()=>{s&&(l({stickerSetId:s.id}),r())}),[r,s,l]);return a.ZP.createElement(ge.Z,{className:"StickerSetModal",isOpen:e,onClose:r,hasCloseButton:!0,title:s?(0,$.Z)(s.title,["emoji","links"]):m("AccDescrStickerSet")},null!=s&&s.stickers?a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("div",{ref:d,className:"stickers custom-scroll"},s.stickers.map((e=>a.ZP.createElement(vn.Z,{sticker:e,size:i.yK,observeIntersection:u,onClick:h,clickArg:e})))),a.ZP.createElement("div",{className:"button-wrapper"},a.ZP.createElement(R.Z,{size:"smaller",fluid:!0,color:s.installedDate?"danger":"primary",onClick:Z},m(s.installedDate?"StickerPack.RemoveStickerCount":"StickerPack.AddStickerCount",s.count,"i")))):a.ZP.createElement(Pe.Z,null))})));var Xa=n(2898);const Ya=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{const n=(0,m.Z1)(e,t);return!n||n.isRestricted?{}:{chat:n,isMuted:(0,u.i4)(n,(0,m.dZ)(e),(0,m.NJ)(e)),isPrivate:(0,u.YA)(n.id),canDeleteChat:(0,u.cc)(n)}}),((e,t)=>(0,h.ei)(t,["updateChatMutedState","enterMessageSelectMode","sendBotCommand","restartBot"])))((({chatId:e,isOpen:t,anchor:n,isChannel:s,canStartBot:r,canRestartBot:o,canSubscribe:i,canSearch:c,canMute:d,canLeave:m,chat:u,isPrivate:h,isMuted:Z,canDeleteChat:P,onSubscribeChannel:g,onSearchClick:v,onClose:p,onCloseAnimationEnd:E,updateChatMutedState:C,enterMessageSelectMode:f,sendBotCommand:b,restartBot:y})=>{const[I,S]=(0,a.eJ)(!0),[N,w]=(0,a.eJ)(!1),{x:k,y:T}=n;(0,H.Z)(t,E,void 0,!1);const F=(0,a.I4)((()=>{S(!1),w(!0)}),[]),A=(0,a.I4)((()=>{S(!1),p()}),[p]),L=(0,a.I4)((()=>{w(!1),p()}),[p]),R=(0,a.I4)((()=>{b({command:"/start"})}),[b]),B=(0,a.I4)((()=>{y({chatId:e})}),[e,y]),$=(0,a.I4)((()=>{C({chatId:e,isMuted:!Z}),A()}),[e,A,Z,C]),D=(0,a.I4)((()=>{g(),A()}),[A,g]),U=(0,a.I4)((()=>{v(),A()}),[A,v]),x=(0,a.I4)((()=>{f(),A()}),[A,f]);(0,a.d4)((()=>(Ra(),Ba)),[]);const O=(0,M.Z)();return a.ZP.createElement(Xa.Z,null,a.ZP.createElement("div",{className:"HeaderMenuContainer"},a.ZP.createElement(Oa.Z,{isOpen:I,positionX:"right",style:`left: ${k}px;top: ${T}px;`,onClose:A},l.wB&&r&&a.ZP.createElement(G.Z,{icon:"bots",onClick:R},O("BotStart")),l.wB&&o&&a.ZP.createElement(G.Z,{icon:"bots",onClick:B},O("BotRestart")),l.wB&&i&&a.ZP.createElement(G.Z,{icon:s?"channel":"group",onClick:D},O(s?"Subscribe":"Join Group")),l.wB&&c&&a.ZP.createElement(G.Z,{icon:"search",onClick:U},O("Search")),d&&a.ZP.createElement(G.Z,{icon:Z?"unmute":"mute",onClick:$},O(Z?"ChatsUnmute":"ChatsMute")),a.ZP.createElement(G.Z,{icon:"select",onClick:x},O("ReportSelectMessages")),m&&a.ZP.createElement(G.Z,{destructive:!0,icon:"delete",onClick:F},O(h?"DeleteChatUser":P?"GroupInfo.DeleteAndExit":s?"LeaveChannel":"Group.LeaveGroup"))),u&&a.ZP.createElement(Ke.Z,{isOpen:N,onClose:L,chat:u})))})));var _a=n(9589);const Ha=(0,X.Ds)((e=>e()),200,!1),ja=(0,a.X$)((0,s.c$)((e=>{const t=(0,m.jr)(e);if(!t)return{};const{query:n,results:a}=(0,m.n5)(e)||{},{totalCount:s,foundIds:r}=a||{};return{chat:t,query:n,totalCount:s,foundIds:r,isHistoryCalendarOpen:Boolean(e.historyCalendarSelectedAt)}}),((e,t)=>(0,h.ei)(t,["setLocalTextSearchQuery","searchTextMessagesLocal","focusMessage","closeLocalTextSearch","openHistoryCalendar"])))((({isActive:e,chat:t,query:n,totalCount:s,foundIds:r,isHistoryCalendarOpen:o,setLocalTextSearchQuery:i,searchTextMessagesLocal:l,focusMessage:c,closeLocalTextSearch:d,openHistoryCalendar:m})=>{const u=(0,a.sO)(null),[h,Z]=(0,a.eJ)(0);(0,a.d4)((()=>{const{visualViewport:e}=window;if(!e)return;const t=document.getElementById("Main"),n=()=>{const{activeElement:n}=document;if(n&&n===u.current){const{pageTop:n,height:a}=e;t.style.transform=`translateY(${n}px)`,t.style.height=`${a}px`,document.documentElement.scrollTop=n}else t.style.transform="",t.style.height=""};return e.addEventListener("resize",n),()=>{e.removeEventListener("resize",n)}}),[]),(0,a.d4)((()=>{t&&r&&r.length?(c({chatId:t.id,messageId:r[r.length-1]}),Z(0)):Z(-1)}),[t,c,r]),(0,a.d4)((()=>{Array.from(document.querySelectorAll("input")).forEach((t=>{t.disabled=Boolean(e&&t!==u.current)})),Array.from(document.querySelectorAll("div[contenteditable]")).forEach((t=>{t.contentEditable=e?"false":"true"}))}),[e]),(0,a.d4)((()=>{e||u.current.blur()}),[e]),(0,a.bt)((()=>{document.querySelector("#MobileSearch input").blur()}),[o]);const P=(0,a.I4)((e=>{i({query:e}),e.length&&Ha(l)}),[l,i]),g=(0,a.I4)((()=>{if(t&&r){const e=h+1;c({chatId:t.id,messageId:r[r.length-1-e]}),Z(e)}}),[t,h,c,r]),v=(0,a.I4)((()=>{if(t&&r){const e=h-1;c({chatId:t.id,messageId:r[r.length-1-e]}),Z(e)}}),[t,h,c,r]);return a.ZP.createElement("div",{id:"MobileSearch",className:e?"active":""},a.ZP.createElement("div",{className:"header"},a.ZP.createElement(R.Z,{size:"smaller",round:!0,color:"translucent",onClick:d},a.ZP.createElement("i",{className:"icon-arrow-left"})),a.ZP.createElement(_a.Z,{ref:u,value:n,onChange:P})),a.ZP.createElement("div",{className:"footer"},a.ZP.createElement("div",{className:"counter"},n?null!=r&&r.length?`${h+1} of ${s}`:r&&!r.length?"No results":"":a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",onClick:()=>m({selectedAt:(0,B._F)(Date.now())}),ariaLabel:"Search messages by date"},a.ZP.createElement("i",{className:"icon-calendar"}))),a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",onClick:g,disabled:!r||!r.length||h===r.length-1},a.ZP.createElement("i",{className:"icon-up"})),a.ZP.createElement(R.Z,{round:!0,size:"smaller",color:"translucent",onClick:v,disabled:!r||!r.length||0===h},a.ZP.createElement("i",{className:"icon-down"}))))})));var Va=n(5376),Ka=n(2365),qa=n(8353),Wa=n(7002),Qa=n(3616);function es(e,t,n=0,a=!1,s=!1,r=!1){const o=e[r?"scrollLeft":"scrollTop"],i=o+e[r?"offsetWidth":"offsetHeight"],l="string"==typeof t?e.querySelectorAll(t):t,{length:c}=l,d=[];let m=!1;for(let e=0;e=o-n&&u<=i+n:c<=i+n&&u>=o-n)d.push(e),m=!0;else if(m&&!a)break}return{allElements:l,visibleIndexes:d}}const ts=function(e,t,n=!1){const a=e[n?"scrollLeft":"scrollTop"],s=a+e[n?"offsetWidth":"offsetHeight"],r=t[n?"offsetLeft":"offsetTop"],o=r+t[n?"offsetWidth":"offsetHeight"];return r>a&&os[s.length-1]?"start":"end";(0,ns.Z)(a,r[t],e,10)}}var ss=n(3570);function rs({isActive:e,isHorizontal:t,shouldRemoveSelectionOnReset:n,noArrowNavigation:s,items:r,shouldSelectOnTab:o,onSelect:i,onClose:l}){const[c,d]=(0,a.eJ)(-1),m=(0,a.I4)((e=>r?(0,ss.Z)(r.length,e):-1),[r]),u=(0,a.I4)(((e,t)=>{t.preventDefault(),d((t=>m(t+e)))}),[d,m]),h=(0,a.I4)((e=>{if(r&&r.length&&c>-1){const t=r[c];t&&(e.preventDefault(),i(t))}}),[r,i,c]);return(0,a.d4)((()=>{d(n?-1:0)}),[r,n]),(0,a.d4)((()=>e?(0,Ge.Z)({onEsc:l,onUp:s||t?void 0:e=>u(-1,e),onDown:s||t?void 0:e=>u(1,e),onLeft:s||!t?void 0:e=>u(-1,e),onRight:s||!t?void 0:e=>u(1,e),onTab:o?h:void 0,onEnter:h}):void 0),[s,u,h,e,t,l,o]),c}const os=(0,a.X$)((({isOpen:e,onClose:t,onInsertUserName:n,usersById:s,filteredUsers:r})=>{const o=(0,a.sO)(null),{shouldRender:i,transitionClassNames:l}=(0,H.Z)(e,void 0,void 0,!1),c=(0,a.I4)(((e,t=!1)=>{const a=null==s?void 0:s[e];a&&n(a,t)}),[s,n]),d=(0,a.I4)((e=>{c(e.id,!0)}),[c]),m=rs({isActive:e,items:r,onSelect:d,shouldSelectOnTab:!0,onClose:t});(0,a.d4)((()=>{as(".chat-item-clickable",m,o)}),[m]),(0,a.d4)((()=>{r&&!r.length&&t()}),[r,t]);const u=(0,f.Z)(null!=r&&r.length?r:void 0,i),h=r&&!r.length?u:r;if(!i||h&&!h.length)return;const Z=(0,Y.Z)("MentionTooltip composer-tooltip custom-scroll",l);return a.ZP.createElement("div",{className:Z,ref:o},null==h?void 0:h.map((({id:e},t)=>a.ZP.createElement(Ee.Z,{key:e,className:"chat-item-clickable scroll-item",onClick:()=>c(e),focus:m===t},a.ZP.createElement(Ce.Z,{userId:e,avatarSize:"small",withUsername:!0})))))}));var is=n(9830);const ls=(0,a.X$)((({attachments:e,caption:t,isReady:n,currentUserId:s,groupChatMembers:r,usersById:o,recentEmojis:l,baseEmojiKeywords:c,emojiKeywords:d,addRecentEmoji:m,onCaptionUpdate:u,onSend:h,onFileAppend:Z,onClear:g})=>{const v=(0,a.sO)(null),p=(0,f.Z)(e),E=e.length?e:p,C=Boolean(e.length),[b,y,I]=(0,Fe.Z)(),S=Boolean(E&&E.every((e=>e.quick))),N=(0,M.Z)(),{isMentionTooltipOpen:w,closeMentionTooltip:k,insertMention:T,mentionFilteredUsers:F}=(0,Ka.Z)(C,t,u,i.nY,r,void 0,s,o),{isEmojiTooltipOpen:A,closeEmojiTooltip:L,filteredEmojis:B,insertEmoji:$}=(0,qa.Z)(C,t,l,i.nY,u,c,d,!n);(0,a.d4)((()=>C?(0,P.Z)(g):void 0),[C,g]);const D=(0,a.I4)((()=>{C&&h()}),[C,h]),U=(0,a.I4)((e=>{e.preventDefault(),I();const{dataTransfer:{files:t}}=e;if(null!=t&&t.length){const e=S?Array.from(t).filter((e=>e.type&&i.AK.has(e.type))):Array.from(t);Z(e,S)}}),[S,Z,I]);if(!E)return;const x=E.every((e=>e.mimeType.startsWith("image/"))),O=E.every((e=>e.mimeType.startsWith("video/")));let G="";return G=N(x?"PreviewSender.SendPhoto":O?"PreviewSender.SendVideo":"PreviewSender.SendFile",E.length,"i"),a.ZP.createElement(ge.Z,{isOpen:C,onClose:g,header:function(){if(E)return a.ZP.createElement("div",{className:"modal-header-condensed",dir:N.isRtl?"rtl":void 0},a.ZP.createElement(R.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:"Cancel attachments",onClick:g},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement("div",{className:"modal-title"},G),a.ZP.createElement(R.Z,{color:"primary",size:"smaller",className:"modal-action-button",onClick:D},N("Send")))}(),className:"AttachmentModal "+(b?"hovered":"")},a.ZP.createElement("div",{className:"drop-target",onDragEnter:y,onDrop:U,onDragOver:function(e){e.preventDefault(),e.stopPropagation(),v.current&&window.clearTimeout(v.current)},onDragLeave:e=>{const{relatedTarget:t,target:n}=e;n.matches(".drop-target")&&!t&&(v.current=window.setTimeout(I,150)),n&&n.closest(".AttachmentModal.hovered")||(t&&e.stopPropagation(),I())},"data-attach-description":N("Preview.Dragging.AddItems",10)},S?a.ZP.createElement("div",{className:"media-wrapper custom-scroll"},E.map((e=>e.mimeType.startsWith("image/")?a.ZP.createElement("img",{src:e.blobUrl,alt:""}):a.ZP.createElement("video",{src:e.blobUrl,autoPlay:!0,muted:!0,loop:!0})))):a.ZP.createElement("div",{className:"document-wrapper custom-scroll"},E.map((e=>a.ZP.createElement(Wa.Z,{name:e.filename,extension:(0,Va.mD)(e.filename,e.mimeType),previewData:e.previewBlobUrl,size:e.size,smaller:!0})))),a.ZP.createElement("div",{className:"attachment-caption-wrapper"},a.ZP.createElement(os,{isOpen:w,onClose:k,onInsertUserName:T,filteredUsers:F,usersById:o}),a.ZP.createElement(is.Z,{isOpen:A,emojis:B,onClose:L,onEmojiSelect:$,addRecentEmoji:m}),a.ZP.createElement(Qa.Z,{id:"caption-input-text",isAttachmentModalInput:!0,html:t,editableInputId:i.nY,placeholder:N("Caption"),onUpdate:u,onSend:h,shouldSetFocus:Boolean(e.length)}))))}));var cs=n(6980);const ds=(0,a.X$)((({isOpen:e,onSend:t,onClear:n})=>{const s=(0,a.sO)(null),r=(0,a.sO)(null),o=(0,a.sO)(null),[i,l]=(0,a.eJ)(""),[c,d]=(0,a.eJ)([""]),[m,u]=(0,a.eJ)(!0),[h,Z]=(0,a.eJ)(!1),[g,v]=(0,a.eJ)(!1),[p,E]=(0,a.eJ)(),[C,f]=(0,a.eJ)(),[b,y]=(0,a.eJ)(!1),I=(0,M.Z)(),S=(0,a.I4)((t=>{e&&t.current&&t.current.focus()}),[e]);(0,a.d4)((()=>e?(0,P.Z)(n):void 0),[e,n]),(0,a.d4)((()=>{e||(l(""),d([""]),u(!0),Z(!1),v(!1),E(""),f(""),y(!1))}),[e]),(0,a.d4)((()=>S(s)),[S,e]),(0,a.bt)((()=>{const e=o.current;e&&p!==e.innerHTML&&(e.innerHTML=p)}),[p]);const N=(0,a.I4)(((e=[])=>{d([...e,""]),requestAnimationFrame((()=>{const e=r.current;e&&(e.classList.toggle("overflown",e.scrollHeight>320),e.scrollTo({top:e.scrollHeight,behavior:"smooth"}))}))}),[]),w=(0,a.I4)((()=>{if(y(!1),!e)return;const n=i.trim().substring(0,255),a=c.map((e=>e.trim().substring(0,100))).filter((e=>e.length));if(!n||a.length<2)return l(n),a.length?a.length<2?N(a):d(a):N(),void y(!0);if(g&&(!C||!a[Number(C)]))return void y(!0);const s={summary:{question:n,answers:a.map(((e,t)=>({text:e.trim(),option:String(t),...String(t)===C&&{correct:!0}}))),...!m&&{isPublic:!0},...h&&{multipleChoice:!0},...g&&{quiz:!0}}};if(g){const{text:e,entities:t}=p&&(0,cs.Z)(p.substring(0,200))||{};s.quiz={correctAnswers:[C],...e&&{solution:e},...t&&{solutionEntities:t}}}t(s)}),[e,i,c,g,C,m,h,t,N,p]),k=(0,a.I4)(((e,t)=>{const n=[...c];n[e]=t,n[n.length-1].trim().length&&n.length<10?N(n):d(n)}),[c,N]),T=(0,a.I4)((e=>{const t=[...c];t.splice(e,1),d(t),requestAnimationFrame((()=>{r.current&&r.current.classList.toggle("overflown",r.current.scrollHeight>320)}))}),[c]),F=(0,a.I4)((e=>{f(e)}),[f]),A=(0,a.I4)((e=>{u(e.target.checked)}),[]),L=(0,a.I4)((e=>{Z(e.target.checked)}),[]),B=(0,a.I4)((e=>{v(e.target.checked)}),[]),$=(0,a.I4)((e=>{13===e.keyCode&&w()}),[w]),D=(0,a.I4)((()=>{if(b&&!i.trim().length)return I("lng_polls_choose_question")}),[b,I,i]),U=(0,a.I4)((e=>{const t=c.map((e=>e.trim())).filter((e=>e.length));if(b&&t.length<2&&!c[e].trim().length)return I("lng_polls_choose_answers")}),[b,I,c]);function x(){return c.map(((e,t)=>a.ZP.createElement("div",{className:"option-wrapper"},a.ZP.createElement(ve.Z,{label:t!==c.length-1||10===c.length?I("OptionHint"):I("CreatePoll.AddOption"),error:U(t),value:e,onChange:e=>k(t,e.currentTarget.value),onKeyPress:$}),t!==c.length-1&&a.ZP.createElement(R.Z,{className:"option-remove-button",round:!0,color:"translucent",size:"smaller",ariaLabel:I("Delete"),onClick:()=>T(t)},a.ZP.createElement("i",{className:"icon-close"})))))}return a.ZP.createElement(ge.Z,{isOpen:e,onClose:n,header:a.ZP.createElement("div",{className:"modal-header-condensed"},a.ZP.createElement(R.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:"Cancel poll creation",onClick:n},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement("div",{className:"modal-title"},I("NewPoll")),a.ZP.createElement(R.Z,{color:"primary",size:"smaller",className:"modal-action-button",onClick:w},I("Create"))),className:"PollModal"},a.ZP.createElement(ve.Z,{ref:s,label:I("AskAQuestion"),value:i,error:D(),onChange:e=>l(e.currentTarget.value),onKeyPress:$}),a.ZP.createElement("div",{className:"options-divider"}),a.ZP.createElement("div",{className:"options-list custom-scroll",ref:r},a.ZP.createElement("h3",{className:"options-header"},I("PollOptions")),b&&function(){const e=c.map((e=>e.trim())).filter((e=>e.length));return g&&(!C||!e[Number(C)])&&a.ZP.createElement("p",{className:"error"},I("lng_polls_choose_correct"))}(),g?a.ZP.createElement(ze.Z,{name:"correctOption",options:x().map(((e,t)=>({value:String(t),label:e,hidden:t===c.length-1}))),onChange:F}):x()),a.ZP.createElement("div",{className:"options-divider"}),a.ZP.createElement("div",{className:"quiz-mode"},a.ZP.createElement(on.Z,{label:I("PollAnonymous"),checked:m,onChange:A}),a.ZP.createElement(on.Z,{label:I("PollMultiple"),checked:h,disabled:g,onChange:L}),a.ZP.createElement(on.Z,{label:I("PollQuiz"),checked:g,disabled:h,onChange:B}),g&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("h3",{className:"options-header"},I("lng_polls_solution_title")),a.ZP.createElement("div",{ref:o,className:"form-control",contentEditable:!0,dir:"auto",onChange:e=>E(e.currentTarget.innerHTML)}),a.ZP.createElement("div",{className:"note"},I("CreatePoll.ExplanationInfo")))))}));var ms=n(6503),us=n(4284),hs=n(1367);const Zs=(0,a.X$)((({emoji:e,focus:t,onClick:n})=>{const s=(0,a.I4)((t=>{t.preventDefault(),n(e.native,e.id)}),[e,n]);return a.ZP.createElement("div",{className:"EmojiButton "+(t?"focus":""),onMouseDown:s,title:`:${e.names[0]}:`},l.op?e.native:a.ZP.createElement("img",{src:`./img-apple-64/${e.image}.png`,alt:"",loading:"lazy"}))})),Ps=(0,a.X$)((({category:e,index:t,allEmojis:n,observeIntersection:s,shouldRender:r,onEmojiSelect:o})=>{const i=(0,a.sO)(null);(0,mn._N)(i,s);const{transitionClassNames:d}=(0,H.Z)(r,void 0,void 0,"slow"),m=(0,M.Z)(),u=l.wB?Math.floor((c.Z.get().width-8)/44):9,h=44*Math.ceil(e.emojis.length/u);return a.ZP.createElement("div",{ref:i,key:e.id,id:`emoji-category-${t}`,className:"symbol-set"},a.ZP.createElement("p",{className:"symbol-set-name",dir:"auto"},m("recent"===e.id?"RecentStickers":`Emoji${t}`)),a.ZP.createElement("div",{className:(0,Y.Z)("symbol-set-container",d),style:`height: ${h}px;`,dir:m.isRtl?"rtl":void 0},r&&e.emojis.map((e=>{const t=n[e];if(!t)return;const s="id"in t?t:t[1];return a.ZP.createElement(Zs,{key:s.id,emoji:s,onClick:o})}))))})),gs={recent:"icon-recent",people:"icon-smile",nature:"icon-animals",foods:"icon-eats",activity:"icon-sport",places:"icon-car",objects:"icon-lamp",symbols:"icon-language",flags:"icon-flag"},vs=[];let ps,Es,Cs;const fs=(0,a.X$)((0,s.c$)((e=>(0,h.ei)(e,["recentEmojis"])))((({className:e,onEmojiSelect:t,recentEmojis:s})=>{const r=(0,a.sO)(null),o=(0,a.sO)(null),[c,d]=(0,a.eJ)(),[m,u]=(0,a.eJ)(),[h,Z]=(0,a.eJ)(0),{observe:P}=(0,mn.S1)({rootRef:r,throttleMs:200},(e=>{e.forEach((e=>{const{id:t}=e.target;if(!t||!t.startsWith("emoji-category-"))return;const n=Number(t.replace("emoji-category-",""));vs[n]=e.isIntersecting}));const t=vs.map(((e,t)=>({index:t,isIntersecting:e}))).filter((({isIntersecting:e})=>e));t.length&&Z(t[Math.floor(t.length/2)].index)}));(0,We.Z)(o.current,!l.wB),(0,a.d4)((()=>{if(!c)return;const e=o.current;if(!e)return;const t=42*h-e.offsetWidth/2+21;(0,hs.Z)(e,t)}),[c,h]);const g=(0,M.Z)(),v=(0,a.Ye)((()=>{if(!c)return He.D;const e=[...c];return null!=s&&s.length&&e.unshift({id:"recent",name:g("RecentStickers"),emojis:s}),e}),[c,g,s]);(0,a.d4)((()=>{setTimeout((()=>{const e=()=>{d(Cs.categories),u(Cs.emojis)};Cs?e():async function(){return ps||(ps=n.e(501).then(n.t.bind(n,7501,19)),Es=(await ps).default,Cs=(0,us.NM)(Es)),ps}().then(e)}),200)}),[]);const p=(0,a.I4)((e=>{Z(e);const t=document.getElementById(`emoji-category-${e}`);(0,ns.Z)(r.current,t,"start",50,800)}),[]),E=(0,a.I4)(((e,n)=>{t(e,n)}),[t]),C=(0,ut.Z)([],i.kU),f=(0,Y.Z)("EmojiPicker",e);return m&&C?a.ZP.createElement("div",{className:f},a.ZP.createElement("div",{ref:o,className:"EmojiPicker-header",dir:g.isRtl?"rtl":""},v.map((function(e,t){const n=gs[e.id];return n&&a.ZP.createElement(R.Z,{className:"symbol-set-button "+(t===h?"activated":""),round:!0,faded:!0,color:"translucent",onClick:()=>p(t),ariaLabel:e.name},a.ZP.createElement("i",{className:n}))}))),a.ZP.createElement("div",{ref:r,className:(0,Y.Z)("EmojiPicker-main no-selection",l.$b?"no-scrollbar":"custom-scroll")},v.map(((e,t)=>a.ZP.createElement(Ps,{category:e,index:t,allEmojis:m,observeIntersection:P,shouldRender:h>=t-1&&h<=t+1,onEmojiSelect:E}))))):a.ZP.createElement("div",{className:f},a.ZP.createElement(Pe.Z,null))}))),bs=l.wB?8:16,ys=(0,a.X$)((({stickerSet:e,loadAndPlay:t,index:n,observeIntersection:s,shouldRender:r,onStickerSelect:o,onStickerUnfave:d})=>{const m=(0,a.sO)(null);(0,mn._N)(m,s);const{transitionClassNames:u}=(0,H.Z)(r,void 0,void 0,"slow"),h=l.wB?Math.floor((c.Z.get().width-8)/(i.Q+bs)):5,Z=Math.ceil(e.count/h)*(i.Q+bs);return a.ZP.createElement("div",{ref:m,key:e.id,id:`sticker-set-${n}`,className:"symbol-set"},a.ZP.createElement("p",{className:"symbol-set-name"},e.title),a.ZP.createElement("div",{className:(0,Y.Z)("symbol-set-container",u),style:`height: ${Z}px;`},r&&e.stickers&&e.stickers.map((n=>a.ZP.createElement(vn.Z,{key:n.id,sticker:n,size:i.Q,observeIntersection:s,noAnimate:!t,onClick:o,clickArg:n,onUnfaveClick:"favorite"===e.id?d:void 0})))))})),Is=[],Ss=(0,a.X$)((0,s.c$)((e=>{const{setsById:t,added:n,recent:a,favorite:s}=e.stickers;return{recentStickers:a.stickers,favoriteStickers:s.stickers,stickerSetsById:t,addedSetIds:n.setIds,shouldPlay:e.settings.byKey.shouldLoopStickers}}),((e,t)=>(0,h.ei)(t,["loadStickerSets","loadRecentStickers","loadFavoriteStickers","loadAddedStickers","addRecentSticker","unfaveSticker"])))((({className:e,loadAndPlay:t,canSendStickers:n,recentStickers:s,favoriteStickers:r,addedSetIds:o,stickerSetsById:c,shouldPlay:d,onStickerSelect:m,loadStickerSets:u,loadRecentStickers:h,loadFavoriteStickers:Z,loadAddedStickers:P,addRecentSticker:g,unfaveSticker:v})=>{const p=(0,a.sO)(null),E=(0,a.sO)(null),[C,f]=(0,a.eJ)(0),{observe:b}=(0,mn.S1)({rootRef:p,throttleMs:200},(e=>{e.forEach((e=>{const{id:t}=e.target;if(!t||!t.startsWith("sticker-set-"))return;const n=Number(t.replace("sticker-set-",""));Is[n]=e.isIntersecting}));const t=Is.map(((e,t)=>({index:t,isIntersecting:e}))).filter((({isIntersecting:e})=>e));t.length&&f(t[Math.floor(t.length/2)].index)})),{observe:y}=(0,mn.S1)({rootRef:E}),I=(0,M.Z)(),S=Boolean(o),N=(0,a.Ye)((()=>o?[{id:"recent",title:I("RecentStickers"),stickers:s,count:s.length},{id:"favorite",title:I("FavoriteStickers"),stickers:r,count:r.length},...o.map((e=>c[e])).filter(Boolean)]:He.D),[o,I,s,r,c]),w=(0,a.Ye)((()=>S&&0===N.filter((e=>{var t;return null===(t=e.stickers)||void 0===t?void 0:t.length})).length),[N,S]);(0,a.d4)((()=>{t&&(u(),h(),Z())}),[t,Z,h,u]),(0,a.d4)((()=>{null!=o&&o.length&&P()}),[o,P]),(0,We.Z)(E.current),(0,a.d4)((()=>{if(!S)return;const e=E.current;if(!e)return;const t=52*C-(e.offsetWidth/2-26);(0,hs.Z)(e,t)}),[S,C]);const k=(0,a.I4)((e=>{f(e);const t=document.getElementById(`sticker-set-${e}`);(0,ns.Z)(p.current,t,"start",void 0,500)}),[]),T=(0,a.I4)((e=>{m(e),g({sticker:e})}),[g,m]),F=(0,a.I4)((e=>{v({sticker:e})}),[v]),A=(0,ut.Z)([],i.Y),L=(0,Y.Z)("StickerPicker",e);return S&&A&&!w&&n?a.ZP.createElement("div",{className:L},a.ZP.createElement("div",{ref:E,className:"StickerPicker-header no-selection no-scrollbar"},N.map((function(e,t){var n;const s=null===(n=e.stickers)||void 0===n?void 0:n[0],r=(0,Y.Z)("symbol-set-button sticker-set-button",t===C&&"activated");return"recent"===e.id||"favorite"===e.id||e.hasThumbnail||!s?a.ZP.createElement(R.Z,{key:e.id,className:r,ariaLabel:e.title,round:!0,faded:"recent"===e.id||"favorite"===e.id,color:"translucent",onClick:()=>k(t)},"recent"===e.id?a.ZP.createElement("i",{className:"icon-recent"}):"favorite"===e.id?a.ZP.createElement("i",{className:"icon-favorite"}):e.isAnimated?a.ZP.createElement(Pn,{stickerSet:e,observeIntersection:y}):a.ZP.createElement(gn,{stickerSet:e,observeIntersection:y})):a.ZP.createElement(vn.Z,{key:e.id,sticker:s,size:i.DC,title:e.title,className:r,observeIntersection:y,onClick:k,clickArg:t})}))),a.ZP.createElement("div",{ref:p,className:(0,Y.Z)("StickerPicker-main no-selection",l.$b?"no-scrollbar":"custom-scroll")},N.map(((e,n)=>a.ZP.createElement(ys,{key:e.id,stickerSet:e,loadAndPlay:Boolean(d&&t),index:n,observeIntersection:b,shouldRender:C>=n-1&&C<=n+1,onStickerSelect:T,onStickerUnfave:F}))))):a.ZP.createElement("div",{className:L},n?w?a.ZP.createElement("div",{className:"picker-disabled"},"You have no saved Stickers."):a.ZP.createElement(Pe.Z,null):a.ZP.createElement("div",{className:"picker-disabled"},"Sending stickers is not allowed in this chat."))})));var Ns=n(386);function ws(){return(ws=Object.assign||function(e){for(var t=1;t{var i,l;const c=(0,a.sO)(null),d=(0,a.sO)(null),m=Boolean(null===(i=e.thumbnail)||void 0===i?void 0:i.dataUri),u=`gif${e.id}`,h=(0,mn.Op)(c,t)&&!n,Z=(0,p.Z)(`${u}?size=m`,!h,r.IU.BlobUrl),P=(0,Fn.Z)(null===(l=e.thumbnail)||void 0===l?void 0:l.dataUri,Boolean(Z)),g=(0,p.Z)(u,!h,r.IU.BlobUrl),v=Boolean(h&&g),{isBuffered:E,bufferingHandlers:C}=(0,j.Z)(!0),f=h&&!E,b=h&&E;(0,K.Z)(d,[v]);const y=(0,a.I4)((()=>o({...e,blobUrl:g})),[o,e,g]),I=(0,Y.Z)("GifButton",e.width&&e.height&&e.width({savedGifs:e.gifs.saved.gifs})),((e,t)=>(0,h.ei)(t,["loadSavedGifs"])))((({className:e,loadAndPlay:t,canSendGifs:n,savedGifs:s,onGifSelect:r,loadSavedGifs:o})=>{const c=(0,a.sO)(null),{observe:d}=(0,mn.S1)({rootRef:c,debounceMs:300});(0,a.d4)((()=>{t&&o()}),[t,o]);const m=(0,ut.Z)([],i.Y);return a.ZP.createElement("div",{ref:c,className:(0,Y.Z)("GifPicker",e,l.$b?"no-scrollbar":"custom-scroll")},n?m&&s&&s.length?s.map((e=>a.ZP.createElement(ks,{key:e.id,gif:e,observeIntersection:d,isDisabled:!t,onClick:r}))):m&&s?a.ZP.createElement("div",{className:"picker-disabled"},"No saved GIFs."):a.ZP.createElement(Pe.Z,null):a.ZP.createElement("div",{className:"picker-disabled"},"Sending GIFs is not allowed in this chat."))})));let Ts;!function(e){e[e.Emoji=0]="Emoji",e[e.Stickers=1]="Stickers",e[e.GIFs=2]="GIFs"}(Ts||(Ts={}));const Fs=Object.values(Ts).filter((e=>"string"==typeof e)),As={[Ts.Emoji]:"icon-smile",[Ts.Stickers]:"icon-stickers",[Ts.GIFs]:"icon-gifs"},Ls=(0,a.X$)((({activeTab:e,onSwitchTab:t,onRemoveSymbol:n,onSearchOpen:s})=>{const r=(0,M.Z)();function o(n){return a.ZP.createElement(R.Z,{className:"symbol-tab-button "+(e===n?"activated":""),onClick:()=>t(n),ariaLabel:Fs[n],round:!0,faded:!0,color:"translucent"},a.ZP.createElement("i",{className:As[n]}))}const i=(0,a.I4)((()=>{s(e===Ts.Stickers?"stickers":"gifs")}),[e,s]);return a.ZP.createElement("div",{className:"SymbolMenu-footer",onClick:function(e){e.stopPropagation()},dir:r.isRtl?"rtl":void 0},e!==Ts.Emoji&&a.ZP.createElement(R.Z,{className:"symbol-search-button",ariaLabel:e===Ts.Stickers?"Search Stickers":"Search GIFs",round:!0,faded:!0,color:"translucent",onClick:i},a.ZP.createElement("i",{className:"icon-search"})),o(Ts.Emoji),o(Ts.Stickers),o(Ts.GIFs),e===Ts.Emoji&&a.ZP.createElement(R.Z,{className:"symbol-delete-button",onClick:n,ariaLabel:"Remove Symbol",round:!0,faded:!0,color:"translucent"},a.ZP.createElement("i",{className:"icon-delete-left"})))}));let Rs=!1;const Bs=(0,a.X$)((0,s.c$)((e=>({isLeftColumnShown:e.isLeftColumnShown})))((({isOpen:e,allowedAttachmentOptions:t,isLeftColumnShown:n,onLoad:s,onClose:r,onEmojiSelect:o,onStickerSelect:i,onGifSelect:c,onRemoveSymbol:d,onSearchOpen:m,addRecentEmoji:u})=>{const[h,Z]=(0,a.eJ)(0),[P,g]=(0,a.eJ)([]),[v,p]=(0,ms.Z)(e,r,void 0,l.wB),{shouldRender:E,transitionClassNames:C}=(0,H.Z)(e,r,!1,!1);!Rs&&e&&(Rs=!0),(0,a.d4)((()=>{s()}),[s]),(0,a.bt)((()=>{if(l.wB)return e&&(document.body.classList.add("enable-symbol-menu-transforms"),document.body.classList.add("is-symbol-menu-open")),()=>{e&&(0,X.T2)((()=>{document.body.classList.remove("is-symbol-menu-open"),setTimeout((()=>{document.body.classList.remove("enable-symbol-menu-transforms")}),350)}))}}),[e]);const f=(0,a.sO)(P);f.current=P,(0,a.d4)((()=>{f.current.length&&(f.current.forEach((e=>{u({emoji:e})})),g([]))}),[e,h,u]);const b=(0,a.I4)(((e,t)=>{g((e=>[...e,t])),o(e)}),[o]),y=(0,a.I4)((e=>{r(),m(e)}),[r,m]),I=(0,a.I4)((e=>{i(e,!0)}),[i]),S=(0,M.Z)(),{canSendStickers:N,canSendGifs:w}=t;function k(t,n){switch(h){case Ts.Emoji:return a.ZP.createElement(fs,{className:"picker-tab",onEmojiSelect:b});case Ts.Stickers:return a.ZP.createElement(Ss,{className:"picker-tab",loadAndPlay:!!N&&e&&(t||n),canSendStickers:N,onStickerSelect:I});case Ts.GIFs:return a.ZP.createElement(Ms,{className:"picker-tab",loadAndPlay:!!w&&e&&(t||n),canSendGifs:w,onGifSelect:c})}}const T=a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("div",{className:"SymbolMenu-main",onClick:function(e){e.stopPropagation()}},Rs&&a.ZP.createElement(L.Z,{name:"slide",activeKey:h,renderCount:Fs.length},k)),l.wB&&a.ZP.createElement(R.Z,{round:!0,faded:!0,color:"translucent",ariaLabel:S("Close"),className:"symbol-close-button",size:"tiny",onClick:r},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement(Ls,{activeTab:h,onSwitchTab:Z,onRemoveSymbol:d,onSearchOpen:y}));if(l.wB){if(!E)return;const e=(0,Y.Z)("SymbolMenu mobile-menu",C,!n&&"middle-column-open");return a.ZP.createElement(Xa.Z,null,a.ZP.createElement("div",{className:e},T))}return a.ZP.createElement(Oa.Z,{isOpen:e,positionX:"left",positionY:"bottom",onClose:r,className:"SymbolMenu",onCloseAnimationEnd:r,onMouseEnter:l.$b?void 0:v,onMouseLeave:l.$b?void 0:p,noCloseOnBackdrop:!l.$b},T)}))),$s=(0,a.X$)((({isOpen:e,allowedAttachmentOptions:t,onFileSelect:n,onPollCreate:s,onClose:r})=>{const[o,c]=(0,ms.Z)(e,r),d=(0,a.I4)(((e,t)=>{const{files:a}=e.target;a&&a.length>0&&n(Array.from(a),t)}),[n]),m=(0,a.I4)((()=>{yn(Array.from(i.AK).join(","),(e=>d(e,!0)))}),[d]),u=(0,a.I4)((()=>{yn("*",(e=>d(e,!1)))}),[d]),h=(0,M.Z)(),{canAttachMedia:Z,canAttachPolls:P}=t;return a.ZP.createElement(Oa.Z,{isOpen:e,autoClose:!0,positionX:"right",positionY:"bottom",onClose:r,className:"AttachMenu fluid",onCloseAnimationEnd:r,onMouseEnter:l.$b?void 0:o,onMouseLeave:l.$b?void 0:c,noCloseOnBackdrop:!l.$b},!Z&&a.ZP.createElement(G.Z,{className:"media-disabled",disabled:!0},"Posting media content is not allowed in this group."),Z&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(G.Z,{icon:"photo",onClick:m},h("AttachmentMenu.PhotoOrVideo")),a.ZP.createElement(G.Z,{icon:"document",onClick:u},h("AttachDocument"))),P&&a.ZP.createElement(G.Z,{icon:"poll",onClick:s},h("Poll")))})),Ds=(0,a.X$)((({withAvatar:e,focus:t,botCommand:n,bot:s,onClick:r})=>a.ZP.createElement(Ee.Z,{key:n.command,className:(0,Y.Z)("BotCommand chat-item-clickable scroll-item",e&&"with-avatar"),multiline:!0,onClick:()=>r(n),focus:t},e&&a.ZP.createElement(D.Z,{size:"small",user:s}),a.ZP.createElement("div",{className:"content-inner"},a.ZP.createElement("span",{className:"title"},"/",n.command),a.ZP.createElement("span",{className:"subtitle"},(0,$.Z)(n.description)))))),Us=(0,a.X$)((0,s.c$)((e=>({usersById:e.users.byId})),((e,t)=>(0,h.ei)(t,["sendBotCommand"])))((({usersById:e,isOpen:t,withUsername:n,botCommands:s,onClick:r,onClose:o,sendBotCommand:i})=>{const l=(0,a.sO)(null),{shouldRender:c,transitionClassNames:d}=(0,H.Z)(t,void 0,void 0,!1),m=(0,a.I4)((({botId:t,command:a})=>{const s=e[t];i({command:`/${a}${n&&s?`@${s.username}`:""}`,botId:t}),r()}),[r,i,e,n]),u=rs({isActive:t,items:s,onSelect:m,onClose:o});(0,a.d4)((()=>{s&&!s.length&&o()}),[s,o]),(0,a.d4)((()=>{as(".chat-item-clickable",u,l)}),[u]);const h=(0,f.Z)(s&&s.length?s:void 0,c),Z=s&&!s.length?h:s;if(!c||Z&&!Z.length)return;const P=(0,Y.Z)("BotCommandTooltip composer-tooltip custom-scroll",d);return a.ZP.createElement("div",{className:P,ref:l},Z&&Z.map(((t,n)=>a.ZP.createElement(Ds,{key:`${t.botId}_${t.command}`,botCommand:t,bot:e[t.botId],withAvatar:!0,onClick:m,focus:u===n}))))}))),xs=(0,a.X$)((0,s.c$)(void 0,((e,t)=>(0,h.ei)(t,["sendBotCommand"])))((({isOpen:e,botCommands:t,onClose:n,sendBotCommand:s})=>{const[r,o]=(0,ms.Z)(e,n,void 0,l.wB),i=(0,a.I4)((e=>{s({command:`/${e.command}`,botId:e.botId}),n()}),[n,s]);return a.ZP.createElement(Oa.Z,{isOpen:e,positionX:"left",positionY:"bottom",onClose:n,className:"BotCommandMenu",onCloseAnimationEnd:n,onMouseEnter:l.$b?void 0:r,onMouseLeave:l.$b?void 0:o,noCloseOnBackdrop:!l.$b},t.map((e=>a.ZP.createElement(Ds,{key:e.command,botCommand:e,onClick:i}))))}))),Os=(0,a.X$)((0,s.c$)((e=>{const{stickers:t}=e.stickers.forEmoji;return{stickers:t}}),((e,t)=>(0,h.ei)(t,["clearStickersForEmoji"])))((({isOpen:e,onStickerSelect:t,stickers:n,clearStickersForEmoji:s})=>{const r=(0,a.sO)(null),{shouldRender:o,transitionClassNames:c}=(0,H.Z)(e,void 0,void 0,!1),d=(0,f.Z)(n,!0),m=n||d,{observe:u}=(0,mn.S1)({rootRef:r,throttleMs:200});(0,a.d4)((()=>e?(0,P.Z)(s):void 0),[e,s]);const h=(0,Y.Z)("StickerTooltip composer-tooltip custom-scroll",c,!(null!=m&&m.length)&&"hidden");return a.ZP.createElement("div",{ref:r,className:h,onMouseEnter:l.$b?void 0:()=>{document.body.classList.add("no-select")},onMouseLeave:l.$b?void 0:()=>{document.body.classList.remove("no-select")}},o&&m?m.map((e=>a.ZP.createElement(vn.Z,{key:e.id,sticker:e,size:i.Q,observeIntersection:u,onClick:t,clickArg:e}))):o?a.ZP.createElement(Pe.Z,null):void 0)}))),Gs=(0,a.X$)((({isOpen:e,onSilentSend:t,onScheduleSend:n,onClose:s,onCloseAnimationEnd:r})=>{const[o,i]=(0,ms.Z)(e,s),c=(0,M.Z)();return a.ZP.createElement(Oa.Z,{isOpen:e,autoClose:!0,positionX:"right",positionY:"bottom",className:"CustomSendMenu",onClose:s,onCloseAnimationEnd:r,onMouseEnter:l.$b?void 0:o,onMouseLeave:l.$b?void 0:i,noCloseOnBackdrop:!l.$b},t&&a.ZP.createElement(G.Z,{icon:"mute",onClick:t},c("SendWithoutSound")),n&&a.ZP.createElement(G.Z,{icon:"schedule",onClick:n},c("ScheduleMessage")))}));var Js=n(2420),zs=n(3283),Xs=n(2678);const Ys=(0,a.X$)((({isOpen:e,emojis:t,onClose:n,onEmojiSelect:s,addRecentEmoji:r})=>{const o=(0,a.sO)(null),{shouldRender:i,transitionClassNames:c}=(0,H.Z)(e,void 0,void 0,!1),d=(0,Xs.Z)(t.length?t:void 0,350)||[],m=(0,a.I4)((e=>{s(e.native),r({emoji:e.id})}),[r,s]),u=(0,a.I4)(((e,t)=>{s(e),r({emoji:t})}),[r,s]),h=rs({isActive:e,isHorizontal:!0,items:t,onSelect:m,onClose:n});(0,a.d4)((()=>{!function(e,t){const n=t.current;if(!n)return;const{visibleIndexes:a,allElements:s}=es(n,".EmojiButton",8,!0,!0,!0);if(!s.length||!s[e])return;const r=a[0];if(!a.includes(e)||e===r&&!ts(n,s[r],!0)){const t="start"==(e>a[a.length-1]?"start":"end")?44*e:0;(0,hs.Z)(n,t)}}(h,o)}),[h]);const Z=(0,Y.Z)("EmojiTooltip composer-tooltip custom-scroll-x",c);return a.ZP.createElement("div",{ref:o,className:Z,onMouseEnter:l.$b?void 0:()=>{document.body.classList.add("no-select")},onMouseLeave:l.$b?void 0:()=>{document.body.classList.remove("no-select")}},i&&d?d.map(((e,t)=>a.ZP.createElement(Zs,{key:e.id,emoji:e,focus:h===t,onClick:u}))):i?a.ZP.createElement(Pe.Z,null):void 0)})),_s=(0,a.X$)((({title:e,description:t,thumbnail:n,thumbUrl:s,focus:r,transitionClassNames:o="",onClick:i})=>{let l="";const c=(0,p.Z)(n?`webDocument:${n.url}`:void 0);return(s=s||c)?l=a.ZP.createElement("img",{src:s,className:o,alt:"",decoding:"async",draggable:"false"}):e&&(l=(0,Zn.Xv)(e,1)),a.ZP.createElement(Ee.Z,{focus:r,className:"BaseResult chat-item-clickable",onMouseDown:Ns.b,onClick:i},a.ZP.createElement("span",{className:"thumb"},"string"==typeof l?(0,$.Z)(l):l),a.ZP.createElement("div",{className:"content-inner"},e&&a.ZP.createElement("div",{className:"title"},e),t&&a.ZP.createElement("div",{className:"description"},t)))})),Hs=(0,a.X$)((({focus:e,isForGallery:t,inlineResult:n,onClick:s})=>{var r;let o,i,l;"photo"in n&&(o=n.photo),"thumbnail"in n&&(i=n.thumbnail),"webThumbnail"in n&&t&&(l=n.webThumbnail);const c=(0,p.Z)(l?`webDocument:${l.url}`:void 0),d=(0,p.Z)(o&&`photo${o.id}?size=m`),{shouldRenderThumb:m,shouldRenderFullMedia:u,transitionClassNames:h}=(0,hn.Z)(d,"slow"),Z=(0,a.I4)((()=>{s(n)}),[n,s]);var P,g;if(t)return a.ZP.createElement("div",{className:"MediaResult chat-item-clickable",onClick:Z},m&&a.ZP.createElement("img",{src:(null===(P=o)||void 0===P||null===(g=P.thumbnail)||void 0===g?void 0:g.dataUri)||c,alt:""}),u&&a.ZP.createElement("img",{src:d,className:`${h} full-media`,alt:""}));const{title:v,description:E}=n;return a.ZP.createElement(_s,{focus:e,thumbUrl:u?d:(null===(r=i)||void 0===r?void 0:r.dataUri)||c,transitionClassNames:u?h:void 0,title:v,description:E,onClick:Z})})),js=(0,a.X$)((({focus:e,inlineResult:t,onClick:n})=>{const{title:s,url:r,description:o,webThumbnail:i}=t,l=(0,a.I4)((()=>{n(t)}),[t,n]);return a.ZP.createElement(_s,{focus:e,thumbnail:i,title:s||r,description:o,onClick:l})})),Vs=(0,a.X$)((({inlineResult:e,observeIntersection:t,onClick:n})=>{const{gif:s}=e,r=(0,a.I4)((()=>{n(e)}),[e,n]);if(s)return a.ZP.createElement(ks,{gif:s,observeIntersection:t,className:"chat-item-clickable",onClick:r})})),Ks=(0,a.X$)((({inlineResult:e,observeIntersection:t,onClick:n})=>{const{sticker:s}=e;if(s)return a.ZP.createElement(vn.Z,{sticker:s,size:i.zq,observeIntersection:t,title:s.emoji,className:"chat-item-clickable",onClick:n,clickArg:e})})),qs=(0,X.P2)((e=>e()),500,!0),Ws=(0,a.X$)((0,s.c$)(void 0,((e,t)=>(0,h.ei)(t,["startBot","openChat","sendInlineBotResult"])))((({isOpen:e,botId:t,isGallery:n,inlineBotResults:s,switchPm:r,loadMore:i,onClose:c,openChat:d,startBot:m,onSelectResult:u})=>{const h=(0,a.sO)(null),{shouldRender:Z,transitionClassNames:P}=(0,H.Z)(e,void 0,void 0,!1),{observe:g}=(0,mn.S1)({rootRef:h,debounceMs:200,isDisabled:!e}),v=(0,a.I4)((({direction:e})=>{e===o.Uq.Backwards&&qs(i)}),[i]),p=rs({isActive:e,shouldRemoveSelectionOnReset:n,noArrowNavigation:n,items:s,onSelect:u,onClose:c});(0,a.d4)((()=>{as(".chat-item-clickable",p,h)}),[p]);const E=(0,a.I4)((()=>{d({id:t}),m({botId:t,param:r.startParam})}),[t,d,m,r]),C=(0,f.Z)(null!=s&&s.length?s:void 0,Z),b=s&&!s.length?C:s;if(!Z||!b||!b.length&&!r)return;const y=(0,Y.Z)("InlineBotTooltip composer-tooltip",l.$b?"no-scrollbar":"custom-scroll",n&&"gallery",P);return a.ZP.createElement(pe.Z,{ref:h,className:y,items:b,itemSelector:".chat-item-clickable",noFastList:!0,onLoadMore:v,sensitiveArea:160},r&&a.ZP.createElement(Ee.Z,{ripple:!0,className:"switch-pm scroll-item",onClick:E},a.ZP.createElement("span",{className:"title"},r.text)),b.map(((e,t)=>{switch(e.type){case"gif":return a.ZP.createElement(Vs,{key:e.id,inlineResult:e,observeIntersection:g,onClick:u});case"photo":return a.ZP.createElement(Hs,{key:e.id,isForGallery:n,inlineResult:e,onClick:u});case"sticker":return a.ZP.createElement(Ks,{key:e.id,inlineResult:e,observeIntersection:g,onClick:u});case"video":case"game":return a.ZP.createElement(Hs,{key:e.id,focus:p===t,inlineResult:e,onClick:u});case"article":case"audio":return a.ZP.createElement(js,{key:e.id,focus:p===t,inlineResult:e,onClick:u});default:return}})))})));var Qs=n(6844);const er=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{const n=(0,m.Z1)(e,t),a=n&&(0,m.Zw)(e,n.id);if(!n||!a)return{};const{query:s,results:r}=(0,m.n5)(e)||{},{totalCount:o,foundIds:i}=r||{};return{chat:n,messagesById:a,query:s,totalCount:o,foundIds:i}}),((e,t)=>(0,h.ei)(t,["searchTextMessagesLocal","focusMessage"])))((({chatId:e,threadId:t,onClose:n,isActive:r,chat:o,messagesById:i,query:l,totalCount:c,foundIds:d,searchTextMessagesLocal:Z,focusMessage:P})=>{const g=(0,M.Z)(),v=(0,a.Ye)((()=>{if(!(l&&d&&d.length&&i))return He.D;const n=d.map((n=>{const a=i[n];if(!a)return;const r=a.senderId?(0,m.dy)((0,s.Rd)(),a.senderId):void 0;let l;if(o&&(0,u.eA)(o))l=o;else if(a.forwardInfo){const{isChannelPost:e,fromChatId:t}=a.forwardInfo;l=e&&t?(0,m.Z1)((0,s.Rd)(),t):void 0}else l=a.senderId?(0,m.Z1)((0,s.Rd)(),a.senderId):void 0;return{message:a,senderUser:r,senderChat:l,onClick:()=>P({chatId:e,threadId:t,messageId:n})}})).filter(Boolean);return(0,h.Xo)(n,(({message:e})=>e.date),"desc")}),[e,t,P,d,o,i,l]);(0,T.ZP)(r,n);const p=(0,a.sO)(null),E=(0,Ze.Z)(p,!0,(e=>{const t=null==v?void 0:v[-1===e?0:e];t&&t.onClick()}),".ListItem-button",!0);return a.ZP.createElement(pe.Z,{className:"RightSearch custom-scroll",items:v,preloadBackwards:0,onLoadMore:Z,noFastList:!0,onKeyDown:E,ref:p},a.ZP.createElement("p",{className:"helper-text",dir:"auto"},l?0!==c&&v.length?1===c?"1 message found":`${v.length&&(c||v.length)} messages found`:g("lng_search_no_results"):g("lng_dlg_search_for_messages")),v.map((({message:e,senderUser:t,senderChat:n,onClick:s})=>{const r=n?(0,u.U)(g,n):(0,u.Js)(t),o=(0,u.MK)(g,e);return a.ZP.createElement(Ee.Z,{className:"chat-item-clickable search-result-message m-0",onClick:s},a.ZP.createElement(D.Z,{chat:n,user:t}),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},r&&(0,$.Z)(r)),a.ZP.createElement(Qs.Z,{message:e})),a.ZP.createElement("div",{className:"subtitle",dir:"auto"},(0,$.Z)(o,["emoji","highlight"],{highlight:l}))))})))})));var tr=n(9290);const nr=(0,a.X$)((0,s.c$)(((e,{stickerSetId:t})=>({set:(0,m.Ny)(e,t),shouldPlay:(0,m.yB)(e)})),((e,t)=>(0,h.ei)(t,["loadStickers","toggleStickerSet"])))((({stickerSetId:e,observeIntersection:t,set:n,shouldPlay:s,loadStickers:r,toggleStickerSet:o,isSomeModalOpen:l,onModalToggle:c})=>{const d=(0,M.Z)(),m=n&&Boolean(n.installedDate),u=Boolean(null==n?void 0:n.stickers),[h,Z,P]=(0,Fe.Z)();(0,tr.Z)((()=>{c(h)}),[h,c]);const g=(0,a.Ye)((()=>{if(!n)return[];const e=(n.covers||[]).map((({id:e})=>e)),t=n.stickers?n.stickers.filter((({id:t})=>!e.includes(t))):[];return[...n.covers||[],...t].slice(0,5)}),[n]);(0,a.d4)((()=>{!u&&g.length<5&&r({stickerSetId:e})}),[u,g.length,r,e]);const v=(0,a.I4)((()=>{o({stickerSetId:e})}),[o,e]);if(!n)return;const p=g.length>0;return a.ZP.createElement("div",{key:n.id,className:"sticker-set",dir:d.isRtl?"rtl":void 0},a.ZP.createElement("div",{className:"sticker-set-header"},a.ZP.createElement("div",{className:"title-wrapper"},a.ZP.createElement("h3",{className:"title",dir:"auto"},n.title),a.ZP.createElement("p",{className:"count",dir:"auto"},d("Stickers",n.count,"i"))),a.ZP.createElement(R.Z,{className:m?"is-added":void 0,color:"primary",size:"tiny",pill:!0,fluid:!0,onClick:v},d(m?"Stickers.Installed":"Stickers.Install"))),a.ZP.createElement("div",{className:"sticker-set-main"},!p&&a.ZP.createElement(F.Z,null),p&&g.map((e=>a.ZP.createElement(vn.Z,{sticker:e,size:i.Y7,observeIntersection:t,noAnimate:!s||h||l,onClick:Z})))),p&&a.ZP.createElement(En.Z,{isOpen:h,fromSticker:g[0],onClose:P}))}))),ar=(0,X.P2)((e=>e()),6e4,!0),sr=(0,a.X$)((0,s.c$)((e=>{const t=(0,m.y5)(e),{query:n,resultIds:a}=t||{},{featured:s}=e.stickers;return{query:n,featuredIds:s.setIds,resultIds:a}}),((e,t)=>(0,h.ei)(t,["loadFeaturedStickers"])))((({onClose:e,isActive:t,query:n,featuredIds:s,resultIds:r,loadFeaturedStickers:o})=>{const i=(0,a.sO)(null),l=(0,M.Z)(),[c,d]=(0,a.eJ)(!1),{observe:m}=(0,mn.S1)({rootRef:i,throttleMs:200});return(0,a.d4)((()=>{ar((()=>{o()}))})),(0,T.ZP)(t,e),a.ZP.createElement("div",{ref:i,className:"StickerSearch custom-scroll",dir:l.isRtl?"rtl":void 0},function(){if(void 0!==n)return!n&&s?s.map((e=>a.ZP.createElement(nr,{key:e,stickerSetId:e,observeIntersection:m,isSomeModalOpen:c,onModalToggle:d}))):r?r.length?r.map((e=>a.ZP.createElement(nr,{key:e,stickerSetId:e,observeIntersection:m,isSomeModalOpen:c,onModalToggle:d}))):a.ZP.createElement("p",{className:"helper-text",dir:"auto"},"Nothing found."):a.ZP.createElement(Pe.Z,null)}())}))),rr=(0,a.X$)((0,s.c$)((e=>{const t=(0,m.yN)(e),{query:n,results:a}=t||{},{chatId:s}=(0,m.Bt)(e)||{},r=s?(0,m.Z1)(e,s):void 0;return{query:n,results:a,chat:r,isChatWithBot:r?(0,m.xo)(e,r):void 0}}),((e,t)=>(0,h.ei)(t,["searchMoreGifs","sendMessage","setGifSearchQuery"])))((({onClose:e,isActive:t,query:n,results:s,chat:r,isChatWithBot:o,searchMoreGifs:i,sendMessage:c,setGifSearchQuery:d})=>{const m=(0,a.sO)(null),{observe:h}=(0,mn.S1)({rootRef:m,debounceMs:300}),{canSendGifs:Z}=(0,u.H5)(r,o),P=(0,a.I4)((e=>{Z&&c({gif:e}),l.$b&&d({query:void 0})}),[Z,c,d]),g=(0,M.Z)();(0,T.ZP)(t,e);const v=Boolean(void 0!==n&&s&&s.length);return a.ZP.createElement("div",{className:"GifSearch",dir:g.isRtl?"rtl":void 0},a.ZP.createElement(pe.Z,{ref:m,className:(0,Y.Z)("gif-container custom-scroll",v&&"grid"),items:s,itemSelector:".GifButton",preloadBackwards:96,noFastList:!0,onLoadMore:i},function(){if(void 0!==n)return s?s.length?s.map((e=>a.ZP.createElement(ks,{key:e.id,gif:e,observeIntersection:h,onClick:P}))):a.ZP.createElement("p",{className:"helper-text",dir:"auto"},g("NoGIFsFound")):a.ZP.createElement(Pe.Z,null)}()))}))),or=(0,a.X$)((0,s.c$)(((e,{answer:t})=>{const{voters:n,offsets:a}=e.pollResults;return{voters:null==n?void 0:n[t.option],offset:(null==a?void 0:a[t.option])||""}}),((e,t)=>(0,h.ei)(t,["loadPollOptionResults","openChat","closePollResults"])))((({chat:e,message:t,answer:n,answerVote:s,totalVoters:r,voters:o,offset:i,loadPollOptionResults:l,openChat:c,closePollResults:d})=>{const m=(0,f.Z)(s.votersCount),[u,h]=(0,a.eJ)(!0),Z=Boolean(o),{option:P,text:g}=n,v=(0,M.Z)();(0,a.d4)((()=>{Z&&m===s.votersCount||l({chat:e,messageId:t.id,option:P,offset:i,limit:4,shouldResetVoters:!0})}),[s.votersCount,Z]);const p=(0,a.I4)((()=>{h(!0),l({chat:e,messageId:t.id,option:P,offset:i,limit:50})}),[e,l,t.id,i,P]);(0,a.d4)((()=>{h(!1)}),[o]);const E=(0,a.I4)((e=>{c({id:e}),d()}),[d,c]);return a.ZP.createElement("div",{className:"PollAnswerResults"},a.ZP.createElement("div",{className:"poll-voters"},o?o.map((e=>a.ZP.createElement(Ee.Z,{key:e,className:"chat-item-clickable",onClick:()=>E(e)},a.ZP.createElement(Ce.Z,{avatarSize:"tiny",userId:e,forceShowSelf:!0,noStatusOrTyping:!0})))):a.ZP.createElement(Pe.Z,null),o&&function(){const e=s.votersCount-o.length;return s.votersCount>4&&e>0&&a.ZP.createElement(nn,{count:e,itemName:"voter",isLoading:u,onClick:p})}()),a.ZP.createElement("div",{className:"answer-head",dir:v.isRtl?"rtl":void 0},a.ZP.createElement("span",{className:"answer-title",dir:"auto"},g),a.ZP.createElement("span",{className:"answer-percent",dir:v.isRtl?"auto":void 0},(C=s.votersCount,(b=r)>0?(C/b*100).toFixed():0),"%")));var C,b}))),ir=(0,a.X$)((0,s.c$)((e=>{const{pollResults:{chatId:t,messageId:n},lastSyncTime:a}=e;return t&&n?{chat:(0,m.Z1)(e,t),message:(0,m.hj)(e,t,n),lastSyncTime:a}:{}}))((({onClose:e,isActive:t,chat:n,message:s,lastSyncTime:r})=>{const o=(0,M.Z)();if((0,T.ZP)(t,e),!s||!n)return a.ZP.createElement(Pe.Z,null);const{summary:i,results:l}=(0,u.t9)(s);if(!l.results)return;const c=(0,h.ee)(l.results,"option");return a.ZP.createElement("div",{className:"PollResults",dir:o.isRtl?"rtl":void 0},a.ZP.createElement("h3",{className:"poll-question",dir:"auto"},i.question),a.ZP.createElement("div",{className:"poll-results-list custom-scroll"},r&&i.answers.map((e=>a.ZP.createElement(or,{key:`${s.id}-${e.option}`,chat:n,message:s,answer:e,answerVote:c[e.option],totalVoters:l.totalVoters}))),!r&&a.ZP.createElement(Pe.Z,null)))}))),lr="Please provide first name",cr=(0,a.X$)((0,s.c$)(((e,{userId:t})=>{const n=(0,m.dy)(e,t),a=(0,m.Z1)(e,t),{progress:s}=e.management;return{user:n,chat:a,progress:s,isMuted:(0,u.i4)(a,(0,m.dZ)(e),(0,m.NJ)(e))}}),((e,t)=>(0,h.ei)(t,["updateContact","deleteUser","closeManagement","openChat","deleteHistory"])))((({userId:e,user:t,chat:n,progress:s,isMuted:r,updateContact:i,deleteUser:l,deleteHistory:c,closeManagement:d,openChat:m,onClose:u,isActive:h})=>{const[Z,P,g]=(0,Fe.Z)(),[v,p]=(0,a.eJ)(!1),[E,C]=(0,a.eJ)(),f=(0,M.Z)();(0,T.ZP)(h,u);const b=t&&t.firstName||"",y=t&&t.lastName||"",[I,S]=(0,a.eJ)(b),[N,w]=(0,a.eJ)(y),[k,A]=(0,a.eJ)(!r);(0,a.d4)((()=>{A(!r)}),[r]),(0,a.d4)((()=>{p(!1),g()}),[g,e]),(0,a.d4)((()=>{S(b),w(y)}),[b,y,t]),(0,a.d4)((()=>{s===o.wv.Complete&&(p(!1),C(void 0),g())}),[g,s]);const L=(0,a.I4)((e=>{S(e.target.value),p(!0)}),[]),R=(0,a.I4)((e=>{w(e.target.value),p(!0)}),[]),B=(0,a.I4)((e=>{A(e.target.checked),p(!0)}),[]),$=(0,a.I4)((()=>{const t=I.trim(),n=N.trim();t.length||C(lr),i({userId:e,isMuted:!k,firstName:t,lastName:n})}),[I,N,i,e,k]),D=(0,a.I4)((()=>{c({chatId:n.id,shouldDeleteForAll:!1}),l({userId:e}),g(),d(),m({id:void 0})}),[n.id,g,d,c,l,m,e]);if(!t)return;const U=s===o.wv.InProgress;return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ce.Z,{userId:t.id,avatarSize:"jumbo",status:"original name",withFullInfo:!0}),a.ZP.createElement(ve.Z,{id:"user-first-name",label:f("UserInfo.FirstNamePlaceholder"),onChange:L,value:I,error:E===lr?E:void 0}),a.ZP.createElement(ve.Z,{id:"user-last-name",label:f("UserInfo.LastNamePlaceholder"),onChange:R,value:N}),a.ZP.createElement("div",{className:"ListItem no-selection narrow"},a.ZP.createElement(on.Z,{checked:k,label:f("Notifications"),subLabel:f(k?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),onChange:B}))),a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{icon:"delete",ripple:!0,destructive:!0,onClick:P},f("DeleteContact")))),a.ZP.createElement(Gt.Z,{isShown:v,onClick:$,disabled:U,ariaLabel:f("Save")},U?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-check"})),a.ZP.createElement(Me.Z,{isOpen:Z,onClose:g,text:f("AreYouSureDeleteContact"),confirmLabel:f("DeleteContact"),confirmHandler:D,confirmIsDestructive:!0}))}))),dr="Group title can't be empty",mr=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{var n;const a=(0,m.Z1)(e,t),{progress:s}=e.management,r=Boolean(null===(n=a.fullInfo)||void 0===n?void 0:n.linkedChatId),o=(0,u.G9)(a);return{chat:a,progress:s,isBasicGroup:o,hasLinkedChannel:r,canChangeInfo:o?a.isCreator:(0,u.VE)(a,"changeInfo"),canBanUsers:o?a.isCreator:(0,u.VE)(a,"banUsers")}}),((e,t)=>(0,h.ei)(t,["togglePreHistoryHidden","updateChat","closeManagement","leaveChannel","deleteChannel","deleteChat","openChat"])))((({chatId:e,chat:t,progress:n,isBasicGroup:s,hasLinkedChannel:i,canChangeInfo:l,canBanUsers:c,onScreenSelect:d,togglePreHistoryHidden:m,updateChat:h,deleteChat:Z,leaveChannel:P,deleteChannel:g,closeManagement:v,openChat:E,onClose:C,isActive:f})=>{var b,y,I;const[S,N,w]=(0,Fe.Z)(),k=t.title,A=t.fullInfo&&t.fullInfo.about||"",[L,R]=(0,a.eJ)(!1),[B,D]=(0,a.eJ)(k),[U,x]=(0,a.eJ)(A),[O,G]=(0,a.eJ)(),[J,z]=(0,a.eJ)(),X=(0,u.RT)(t),Y=(0,p.Z)(X,!1,r.IU.BlobUrl),_=(0,M.Z)();(0,T.ZP)(f,C),(0,a.d4)((()=>{n===o.wv.Complete&&(R(!1),z(void 0))}),[n]);const H=(0,a.I4)((()=>{d(o.u1.ChatPrivacyType)}),[d]),j=(0,a.I4)((()=>{d(o.u1.Discussion)}),[d]),V=(0,a.I4)((()=>{d(o.u1.GroupPermissions)}),[d]),K=(0,a.I4)((()=>{d(o.u1.ChatAdministrators)}),[d]),q=(0,a.I4)((e=>{G(e),R(!0)}),[]),W=(0,a.I4)((e=>{D(e.target.value),R(!0)}),[]),Q=(0,a.I4)((e=>{x(e.target.value),R(!0)}),[]),ee=(0,a.I4)((()=>{const t=B.trim(),n=U.trim();t.length?h({chatId:e,title:t,about:n,photo:O}):z(dr)}),[U,e,O,B,h]),te=(0,a.I4)((()=>{d(o.u1.GroupMembers)}),[d]),ne=(0,a.I4)((()=>{if(!t.fullInfo)return;const{isPreHistoryHidden:e}=t.fullInfo;m({chatId:t.id,isEnabled:!e})}),[t,m]),ae=(0,a.Ye)((()=>{if(!t.defaultBannedRights)return 0;let e=["sendMessages","sendMedia","embedLinks","sendPolls","changeInfo","inviteUsers","pinMessages"].filter((e=>!t.defaultBannedRights[e])).length;const{sendStickers:n,sendGifs:a}=t.defaultBannedRights;return n||a||(e+=1),e}),[t]),se=(null===(b=t.fullInfo)||void 0===b||null===(y=b.adminMembers)||void 0===y?void 0:y.length)||0,re=(0,a.I4)((()=>{s?Z({chatId:t.id}):t.isCreator?g({chatId:t.id}):P({chatId:t.id}),w(),v(),E({id:void 0})}),[s,t.isCreator,t.id,w,v,P,g,Z,E]);if(t.isRestricted)return;const oe=n===o.wv.InProgress;return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ot.Z,{currentAvatarBlobUrl:Y,onChange:q,disabled:!l}),a.ZP.createElement(ve.Z,{id:"group-title",label:_("GroupName"),onChange:W,value:B,error:J===dr?J:void 0,disabled:!l}),a.ZP.createElement(ve.Z,{id:"group-about",className:"mb-2",label:_("DescriptionPlaceholder"),onChange:Q,value:U,disabled:!l}),t.isCreator&&a.ZP.createElement(Ee.Z,{icon:"lock",multiline:!0,onClick:H},a.ZP.createElement("span",{className:"title"},_("GroupType")),a.ZP.createElement("span",{className:"subtitle"},t.username?_("TypePublic"):_("TypePrivate"))),i&&a.ZP.createElement(Ee.Z,{icon:"message",multiline:!0,onClick:j},a.ZP.createElement("span",{className:"title"},_("LinkedChannel")),a.ZP.createElement("span",{className:"subtitle"},_("DiscussionUnlink"))),a.ZP.createElement(Ee.Z,{icon:"permissions",multiline:!0,onClick:V,disabled:!c},a.ZP.createElement("span",{className:"title"},_("ChannelPermissions")),a.ZP.createElement("span",{className:"subtitle",dir:"auto"},ae,"/",8)),a.ZP.createElement(Ee.Z,{icon:"admin",multiline:!0,onClick:K},a.ZP.createElement("span",{className:"title"},_("ChannelAdministrators")),a.ZP.createElement("span",{className:"subtitle"},(0,Zn.kh)(se)))),a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{icon:"group",multiline:!0,onClick:te},a.ZP.createElement("span",{className:"title"},_("GroupMembers")),a.ZP.createElement("span",{className:"subtitle"},(0,Zn.kh)(null!==(I=t.membersCount)&&void 0!==I?I:0))),t.fullInfo&&a.ZP.createElement("div",{className:"ListItem narrow no-selection"},a.ZP.createElement(on.Z,{checked:!t.fullInfo.isPreHistoryHidden,label:_("ChatHistory"),onChange:ne,disabled:!c}))),a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{icon:"delete",ripple:!0,destructive:!0,onClick:N},_("DeleteMega")))),a.ZP.createElement(Gt.Z,{isShown:L,onClick:ee,disabled:oe,ariaLabel:_("Save")},oe?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-check"})),a.ZP.createElement(Me.Z,{isOpen:S,onClose:w,textParts:(0,$.Z)(s||!t.isCreator?_("AreYouSureDeleteAndExit"):_("AreYouSureDeleteThisChatWithGroup",t.title),["br","simple_markdown"]),confirmLabel:s||!t.isCreator?_("DeleteMega"):_("DeleteGroupForAll"),confirmHandler:re,confirmIsDestructive:!0}))}))),ur=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>({chat:(0,m.Z1)(e,t),currentUserId:e.currentUserId})),((e,t)=>(0,h.ei)(t,["updateChatDefaultBannedRights"])))((({onScreenSelect:e,onChatMemberSelect:t,chat:n,currentUserId:s,updateChatDefaultBannedRights:r,onClose:i,isActive:l})=>{const[c,d]=(0,a.eJ)({}),[m,u]=(0,a.eJ)(!1),[h,Z]=(0,a.eJ)(!1),P=(0,M.Z)();(0,T.ZP)(l,i);const g=(0,a.I4)((()=>{e(o.u1.GroupRemovedUsers)}),[e]),v=(0,a.I4)((()=>{e(o.u1.GroupUserPermissionsCreate)}),[e]),p=(0,a.I4)((n=>{t(n.userId,n.promotedByUserId===s),e(o.u1.GroupUserPermissions)}),[s,t,e]);(0,a.d4)((()=>{d((null==n?void 0:n.defaultBannedRights)||{}),u(!1),setTimeout((()=>{Z(!1)}),250)}),[n]);const E=(0,a.I4)((e=>{const{name:t}=e.target;function n(e){return!e||void 0}d((e=>({...e,[t]:n(e[t]),..."sendStickers"===t&&{sendGifs:n(e[t])}}))),u(!0)}),[]),C=(0,a.I4)((()=>{n&&(Z(!0),r({chatId:n.id,bannedRights:c}))}),[n,c,r]),f=(0,a.Ye)((()=>n&&n.fullInfo&&n.fullInfo.kickedMembers?n.fullInfo.kickedMembers.length:0),[n]),b=(0,a.Ye)((()=>n&&n.fullInfo&&n.fullInfo.members?n.fullInfo.members.filter((({bannedRights:e})=>!!e)):[]),[n]),y=(0,a.I4)((e=>{const{bannedRights:t}=e;if(!t||!n)return;const{defaultBannedRights:a}=n;return Object.keys(t).reduce(((e,n)=>{if(!t[n]||null!=a&&a[n]||"sendInline"===n||"viewMessages"===n||"sendGames"===n)return e;const s=function(e){switch(e){case"sendMessages":return"UserRestrictionsNoSend";case"sendMedia":return"UserRestrictionsNoSendMedia";case"sendStickers":return"UserRestrictionsNoSendStickers";case"embedLinks":return"UserRestrictionsNoEmbedLinks";case"sendPolls":return"UserRestrictionsNoSendPolls";case"changeInfo":return"UserRestrictionsNoChangeInfo";case"inviteUsers":return"UserRestrictionsInviteUsers";case"pinMessages":return"UserRestrictionsPinMessages";default:return}}(n);if(!s)return e;const r=P(s);return`${e}${e.length?`, ${r}`:r}`}),"")}),[n,P]);return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section"},a.ZP.createElement("h3",{className:"section-heading",dir:"auto"},P("ChannelPermissionsHeader")),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"sendMessages",checked:!c.sendMessages,label:P("UserRestrictionsSend"),blocking:!0,onChange:E})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"sendMedia",checked:!c.sendMedia,label:P("UserRestrictionsSendMedia"),blocking:!0,onChange:E})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"sendStickers",checked:!c.sendStickers&&!c.sendGifs,label:P("UserRestrictionsSendStickers"),blocking:!0,onChange:E})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"sendPolls",checked:!c.sendPolls,label:P("UserRestrictionsSendPolls"),blocking:!0,onChange:E})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"embedLinks",checked:!c.embedLinks,label:P("UserRestrictionsEmbedLinks"),blocking:!0,onChange:E})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"inviteUsers",checked:!c.inviteUsers,label:P("UserRestrictionsInviteUsers"),blocking:!0,onChange:E})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"pinMessages",checked:!c.pinMessages,label:P("UserRestrictionsPinMessages"),blocking:!0,onChange:E})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"changeInfo",checked:!c.changeInfo,label:P("UserRestrictionsChangeInfo"),blocking:!0,onChange:E}))),a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{icon:"delete-user",multiline:!0,narrow:!0,onClick:g},a.ZP.createElement("span",{className:"title"},P("ChannelBlockedUsers")),a.ZP.createElement("span",{className:"subtitle"},f))),a.ZP.createElement("div",{className:"section"},a.ZP.createElement("h3",{className:"section-heading",dir:"auto"},P("PrivacyExceptions")),a.ZP.createElement(Ee.Z,{icon:"add-user",onClick:v},P("ChannelAddException")),b.map((e=>a.ZP.createElement(Ee.Z,{key:e.userId,className:"chat-item-clickable exceptions-member",onClick:()=>p(e)},a.ZP.createElement(Ce.Z,{userId:e.userId,status:y(e)})))))),a.ZP.createElement(Gt.Z,{isShown:m,onClick:C,ariaLabel:P("Save"),disabled:h},h?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-check"})))}))),hr=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{const n=(0,m.Z1)(e,t),{byId:a}=e.users;return{chat:n,usersById:a}}),((e,t)=>(0,h.ei)(t,["updateChatMemberBannedRights"])))((({chat:e,usersById:t,updateChatMemberBannedRights:n,onClose:s,isActive:r})=>{const o=(0,M.Z)();(0,T.ZP)(r,s);const i=(0,a.Ye)((()=>e&&e.fullInfo&&e.fullInfo.kickedMembers?e.fullInfo.kickedMembers:[]),[e]),l=(0,a.I4)((e=>{if(!e.kickedByUserId)return;const n=t[e.kickedByUserId];return n?o("UserRemovedBy",(0,u.Js)(n)):void 0}),[o,t]),c=(0,a.I4)((t=>{if(e)return[{title:o("Unblock"),icon:"delete",destructive:!0,handler:()=>n({chatId:e.id,userId:t.userId,bannedRights:{}})}]}),[o,e,n]);return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section",dir:o.isRtl?"rtl":void 0},a.ZP.createElement("p",{className:"text-muted"},o("NoBlockedGroup2")),i.map((e=>a.ZP.createElement(Ee.Z,{key:e.userId,className:"chat-item-clickable",ripple:!0,contextActions:c(e)},a.ZP.createElement(Ce.Z,{userId:e.userId,status:l(e)})))))))}))),Zr="Channel title can't be empty",Pr=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{const n=(0,m.Z1)(e,t),{progress:a}=e.management;return{chat:n,progress:a,isSignaturesShown:Boolean(null==n?void 0:n.isSignaturesShown),canChangeInfo:(0,u.VE)(n,"changeInfo")}}),((e,t)=>(0,h.ei)(t,["toggleSignatures","updateChat","closeManagement","leaveChannel","deleteChannel","openChat"])))((({chatId:e,chat:t,progress:n,isSignaturesShown:s,canChangeInfo:i,onScreenSelect:l,updateChat:c,toggleSignatures:d,closeManagement:m,leaveChannel:h,deleteChannel:Z,openChat:P,onClose:g,isActive:v})=>{var E,C,f,b;const y=t&&t.title||"",I=null!=t&&t.fullInfo&&t.fullInfo.about||"",S=null==t||null===(E=t.fullInfo)||void 0===E?void 0:E.linkedChatId,[N,w,k]=(0,Fe.Z)(),[A,L]=(0,a.eJ)(!1),[R,B]=(0,a.eJ)(y),[$,D]=(0,a.eJ)(I),[U,x]=(0,a.eJ)(),[O,G]=(0,a.eJ)(),J=t&&(0,u.RT)(t),z=(0,p.Z)(J,!1,r.IU.BlobUrl),X=(0,M.Z)();(0,T.ZP)(v,g),(0,a.d4)((()=>{n===o.wv.Complete&&(L(!1),G(void 0))}),[n]);const Y=(null==t||null===(C=t.fullInfo)||void 0===C||null===(f=C.adminMembers)||void 0===f?void 0:f.length)||0,_=(0,a.I4)((()=>{l(o.u1.ChatPrivacyType)}),[l]),H=(0,a.I4)((()=>{l(o.u1.Discussion)}),[l]),j=(0,a.I4)((()=>{l(o.u1.ChatAdministrators)}),[l]),V=(0,a.I4)((e=>{x(e),L(!0)}),[]),K=(0,a.I4)((e=>{B(e.target.value),L(!0)}),[]),q=(0,a.I4)((e=>{D(e.target.value),L(!0)}),[]),W=(0,a.I4)((()=>{const t=R.trim(),n=$.trim();t.length?c({chatId:e,title:t,about:n,photo:U}):G(Zr)}),[$,e,U,R,c]),Q=(0,a.I4)((()=>{d({chatId:e,isEnabled:!s})}),[e,s,d]),ee=(0,a.I4)((()=>{l(o.u1.ChannelSubscribers)}),[l]),te=(0,a.I4)((()=>{t.isCreator?Z({chatId:t.id}):h({chatId:t.id}),k(),m(),P({id:void 0})}),[t.isCreator,t.id,k,m,h,Z,P]);if(t.isRestricted)return;const ne=n===o.wv.InProgress;return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ot.Z,{currentAvatarBlobUrl:z,onChange:V,disabled:!i}),a.ZP.createElement(ve.Z,{id:"channel-title",label:X("EnterChannelName"),onChange:K,value:R,error:O===Zr?O:void 0,disabled:!i}),a.ZP.createElement(ve.Z,{id:"channel-about",className:"mb-2",label:X("DescriptionPlaceholder"),onChange:q,value:$,disabled:!i}),t.isCreator&&a.ZP.createElement(Ee.Z,{icon:"lock",multiline:!0,onClick:_},a.ZP.createElement("span",{className:"title"},X("ChannelType")),a.ZP.createElement("span",{className:"subtitle"},t.username?X("TypePublic"):X("TypePrivate"))),a.ZP.createElement(Ee.Z,{icon:"message",multiline:!0,onClick:H,disabled:!i},a.ZP.createElement("span",{className:"title"},X("Discussion")),a.ZP.createElement("span",{className:"subtitle"},X(S?"DiscussionUnlink":"Add"))),a.ZP.createElement(Ee.Z,{icon:"admin",multiline:!0,onClick:j},a.ZP.createElement("span",{className:"title"},X("ChannelAdministrators")),a.ZP.createElement("span",{className:"subtitle"},Y)),a.ZP.createElement("div",{className:"ListItem no-selection narrow"},a.ZP.createElement(on.Z,{checked:s,label:X("ChannelSignMessages"),onChange:Q}))),a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{icon:"group",multiline:!0,onClick:ee},a.ZP.createElement("span",{className:"title",dir:"auto"},X("ChannelSubscribers")),a.ZP.createElement("span",{className:"subtitle",dir:"auto"},X("Subscribers",null!==(b=t.membersCount)&&void 0!==b?b:0,"i")))),a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{icon:"delete",ripple:!0,destructive:!0,onClick:w},t.isCreator?X("ChannelDelete"):X("LeaveChannel")))),a.ZP.createElement(Gt.Z,{isShown:A,onClick:W,disabled:ne,ariaLabel:X("Save")},ne?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-check"})),a.ZP.createElement(Me.Z,{isOpen:N,onClose:k,text:t.isCreator?X("ChannelDeleteAlert"):X("ChannelLeaveAlert"),confirmLabel:t.isCreator?X("ChannelDelete"):X("LeaveChannel"),confirmHandler:te,confirmIsDestructive:!0}))})));var gr=n(88);const vr=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{const n=(0,m.Z1)(e,t),{isUsernameAvailable:a}=(0,m.aW)(e,t);return{chat:n,isChannel:(0,u.eA)(n),progress:e.management.progress,isUsernameAvailable:a}}),((e,t)=>(0,h.ei)(t,["checkPublicLink","updatePublicLink","updatePrivateLink"])))((({chat:e,onClose:t,isActive:n,isChannel:s,progress:r,isUsernameAvailable:i,checkPublicLink:l,updatePublicLink:c,updatePrivateLink:d})=>{var m;const u=Boolean(e.username),h=null===(m=e.fullInfo)||void 0===m?void 0:m.inviteLink,[Z,P]=(0,a.eJ)(u?"public":"private"),[g,v]=(0,a.eJ)(),[p,E,C]=(0,Fe.Z)(),f=Boolean("public"===Z&&g&&i||"private"===Z&&u);(0,T.ZP)(n,t),(0,a.d4)((()=>{Z&&!h&&d()}),[Z,h,d]);const b=(0,a.I4)((e=>{P(e)}),[]),y=(0,a.I4)((()=>{c({username:"public"===Z?g:""})}),[Z,c,g]),I=(0,a.I4)((()=>{C(),d()}),[C,d]),S=(0,M.Z)(),N=s?"Channel":"Mega",w=s?"Channel":"Group",k=[{value:"private",label:S(`${N}Private`),subLabel:S(`${N}PrivateInfo`)},{value:"public",label:S(`${N}Public`),subLabel:S(`${N}PublicInfo`)}],A=r===o.wv.InProgress;return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section",dir:S.isRtl?"rtl":void 0},a.ZP.createElement("h3",{className:"section-heading"},S(`${w}Type`)),a.ZP.createElement(ze.Z,{selected:Z,name:"channel-type",options:k,onChange:b})),"private"===Z?a.ZP.createElement("div",{className:"section",dir:S.isRtl?"rtl":void 0},h?a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(gr.Z,{url:h,className:"group-link",text:h}),a.ZP.createElement("p",{className:"section-info",dir:S.isRtl?"rtl":void 0},S(`${N}PrivateLinkHelp`)),a.ZP.createElement(Ee.Z,{icon:"delete",ripple:!0,destructive:!0,onClick:E},S("RevokeLink")),a.ZP.createElement(Me.Z,{isOpen:p,onClose:C,text:S("RevokeAlert"),confirmLabel:S("RevokeButton"),confirmHandler:I,confirmIsDestructive:!0})):a.ZP.createElement(Pe.Z,null)):a.ZP.createElement("div",{className:"section no-border"},a.ZP.createElement(_t,{asLink:!0,currentUsername:e.username,isLoading:A,isUsernameAvailable:i,checkUsername:l,onChange:v}),a.ZP.createElement("p",{className:"section-info",dir:"auto"},S(`${w}.Username.CreatePublicLinkHelp`)))),a.ZP.createElement(Gt.Z,{isShown:f,disabled:A,ariaLabel:S("Save"),onClick:y},A?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-check"})))}))),pr=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{var n;const a=(0,m.Z1)(e,t),{forDiscussionIds:s,byId:r}=e.chats;return{chat:a,chatsByIds:r,forDiscussionIds:s,linkedChat:null!=a&&null!==(n=a.fullInfo)&&void 0!==n&&n.linkedChatId?(0,m.Z1)(e,a.fullInfo.linkedChatId):void 0,isChannel:a&&(0,u.eA)(a)}}),((e,t)=>(0,h.ei)(t,["loadGroupsForDiscussion","linkDiscussionGroup","unlinkDiscussionGroup"])))((({chat:e,onClose:t,isActive:n,chatId:s,chatsByIds:r,linkedChat:l,forDiscussionIds:c,isChannel:d,onScreenSelect:m,loadGroupsForDiscussion:u,linkDiscussionGroup:h,unlinkDiscussionGroup:Z})=>{const[P,g]=(0,a.eJ)(),[v,p]=(0,a.eJ)(),[E,C]=(0,a.eJ)(!1),f=(0,a.I4)((()=>C(!0)),[]),[b,y,I]=(0,Fe.Z)(),[S,N,w]=(0,Fe.Z)(),k=(0,M.Z)(),F=null==l?void 0:l.id;(0,T.ZP)(n,t),(0,a.d4)((()=>{u()}),[u]),(0,a.d4)((()=>{v||(0,qt.Z)("DiscussionGroups").then(p)}),[v]);const A=(0,a.I4)((()=>{I(),Z({channelId:d?s:F}),d||m(o.u1.Initial)}),[I,Z,d,s,F,m]),L=(0,a.I4)((()=>{w(),h({channelId:s,chatId:P})}),[w,h,s,P]);return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section"},a.ZP.createElement("div",{className:"section-icon"},v&&a.ZP.createElement(Wt.Z,{id:"discussionGroupsDucks",size:i.bM,animationData:v,play:E,noLoop:!0,onLoad:f})),l&&a.ZP.createElement("div",null,a.ZP.createElement(Ee.Z,{className:"chat-item-clickable",inactive:!0},a.ZP.createElement(fe.Z,{chatId:l.id})),a.ZP.createElement(Ee.Z,{icon:"delete",ripple:!0,destructive:!0,onClick:y},k(d?"DiscussionUnlinkGroup":"DiscussionUnlinkChannel")),a.ZP.createElement(Me.Z,{isOpen:b,onClose:I,header:a.ZP.createElement("div",{className:"modal-header"},a.ZP.createElement(D.Z,{size:"tiny",chat:l}),a.ZP.createElement("div",{className:"modal-title"},k(d?"DiscussionUnlinkGroup":"DiscussionUnlinkChannel"))),textParts:(0,$.Z)(k(d?"DiscussionUnlinkChannelAlert":"DiscussionUnlinkGroupAlert",l.title),["br","simple_markdown"]),confirmLabel:k(d?"DiscussionUnlinkGroup":"DiscussionUnlinkChannel"),confirmHandler:A,confirmIsDestructive:!0})),!l&&a.ZP.createElement("div",null,a.ZP.createElement("p",{className:"section-help",dir:"auto"},k("DiscussionChannelHelp")),a.ZP.createElement("div",{teactFastList:!0},a.ZP.createElement(Ee.Z,{key:"create-group",icon:"group",ripple:!0,teactOrderKey:0,className:"not-implemented"},k("DiscussionCreateGroup")),c?c.map(((e,t)=>a.ZP.createElement(Ee.Z,{key:e,teactOrderKey:t+1,className:"chat-item-clickable scroll-item",onClick:()=>{g(e),N()}},a.ZP.createElement(fe.Z,{chatId:e})))):a.ZP.createElement(rt.Z,{key:"nothing-found",teactOrderKey:0,text:"No discussion groups found"})),a.ZP.createElement("p",{className:"mt-4 mb-0 section-help",dir:"auto"},k("DiscussionChannelHelp2")),a.ZP.createElement(Me.Z,{isOpen:S,onClose:w,header:function(){const e=r[P];if(e)return a.ZP.createElement("div",{className:"modal-header"},a.ZP.createElement(D.Z,{size:"tiny",chat:e}),a.ZP.createElement("div",{className:"modal-title"},k("Channel.DiscussionGroup.LinkGroup")))}(),textParts:function(){const t=r[P];if(t)return t.hasPrivateLink?(0,$.Z)(`Do you want to make **${t.title}** the discussion board for **${e.title}**?`,["br","simple_markdown"]):(0,$.Z)(`Do you want to make **${t.title}** the discussion board for **${e.title}**?\n\nAnyone from the channel will be able to see messages in this group.`,["br","simple_markdown"])}(),confirmLabel:k("DiscussionLinkGroup"),confirmHandler:L,isButtonsInOneRow:!0})))))}))),Er=(0,a.X$)((0,s.c$)(((e,{chatId:t,isPromotedByCurrentUser:n})=>{const a=(0,m.Z1)(e,t);return{chat:a,isFormFullyDisabled:!(a.isCreator||n)}}),((e,t)=>(0,h.ei)(t,["updateChatMemberBannedRights"])))((({chat:e,selectedChatMemberId:t,onScreenSelect:n,updateChatMemberBannedRights:s,isFormFullyDisabled:r,onClose:i,isActive:l})=>{const[c,d]=(0,a.eJ)({}),[m,u]=(0,a.eJ)(!1),[h,Z]=(0,a.eJ)(!1),[P,g,v]=(0,Fe.Z)(),p=(0,M.Z)();(0,T.ZP)(l,i);const E=(0,a.Ye)((()=>{if(e&&e.fullInfo&&e.fullInfo.members)return e.fullInfo.members.find((({userId:e})=>e===t))}),[e,t]);(0,a.d4)((()=>{null!=e&&e.fullInfo&&t&&!E&&n(o.u1.GroupPermissions)}),[e,n,E,t]),(0,a.d4)((()=>{d((null==E?void 0:E.bannedRights)||(null==e?void 0:e.defaultBannedRights)||{}),u(!1),Z(!1)}),[e,E]);const C=(0,a.I4)((e=>{const{name:t}=e.target;function n(e){return!e||void 0}d((e=>({...e,[t]:n(e[t]),..."sendStickers"===t&&{sendGifs:n(e[t])}}))),u(!0)}),[]),f=(0,a.I4)((()=>{e&&t&&(Z(!0),s({chatId:e.id,userId:t,bannedRights:c}))}),[e,t,c,s]),b=(0,a.I4)((()=>{e&&t&&s({chatId:e.id,userId:t,bannedRights:{viewMessages:!0}})}),[e,t,s]),y=(0,a.I4)((t=>!!r||!(!e||!e.defaultBannedRights)&&e.defaultBannedRights[t]),[e,r]);if(E)return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{inactive:!0,className:"chat-item-clickable"},a.ZP.createElement(Ce.Z,{userId:E.userId})),a.ZP.createElement("h3",{className:"section-heading mt-4",dir:"auto"},p("UserRestrictionsCanDo")),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"sendMessages",checked:!c.sendMessages,label:p("UserRestrictionsSend"),blocking:!0,disabled:y("sendMessages"),onChange:C})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"sendMedia",checked:!c.sendMedia,label:p("UserRestrictionsSendMedia"),blocking:!0,disabled:y("sendMedia"),onChange:C})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"sendStickers",checked:!c.sendStickers&&!c.sendGifs,label:p("UserRestrictionsSendStickers"),blocking:!0,disabled:y("sendStickers"),onChange:C})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"sendPolls",checked:!c.sendPolls,label:p("UserRestrictionsSendPolls"),blocking:!0,disabled:y("sendPolls"),onChange:C})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"embedLinks",checked:!c.embedLinks,label:p("UserRestrictionsEmbedLinks"),blocking:!0,disabled:y("embedLinks"),onChange:C})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"inviteUsers",checked:!c.inviteUsers,label:p("UserRestrictionsInviteUsers"),blocking:!0,disabled:y("inviteUsers"),onChange:C})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"pinMessages",checked:!c.pinMessages,label:p("UserRestrictionsPinMessages"),blocking:!0,disabled:y("pinMessages"),onChange:C})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"changeInfo",checked:!c.changeInfo,label:p("UserRestrictionsChangeInfo"),blocking:!0,disabled:y("changeInfo"),onChange:C}))),!r&&a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{icon:"delete-user",ripple:!0,destructive:!0,onClick:g},p("UserRestrictionsBlock")))),a.ZP.createElement(Gt.Z,{isShown:m,onClick:f,ariaLabel:p("Save"),disabled:h},h?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-check"})),a.ZP.createElement(Me.Z,{isOpen:P,onClose:v,text:"Are you sure you want to ban and remove this user from the group?",confirmLabel:"Remove",confirmHandler:b,confirmIsDestructive:!0}))}))),Cr=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{const n=(0,m.Z1)(e,t),{byId:a}=e.users;return{chat:n,currentUserId:e.currentUserId,isChannel:(0,u.eA)(n),usersById:a}}))((({chat:e,isChannel:t,currentUserId:n,usersById:s,onScreenSelect:r,onChatMemberSelect:i,onClose:l,isActive:c})=>{const d=(0,M.Z)();(0,T.ZP)(c,l);const m=(0,a.Ye)((()=>e.fullInfo&&e.fullInfo.adminMembers?e.fullInfo.adminMembers.sort(((e,t)=>e.isOwner?-1:t.isOwner?1:0)):[]),[e]),h=(0,a.I4)((e=>{i(e.userId,e.promotedByUserId===n),r(o.u1.ChatAdminRights)}),[n,i,r]),Z=(0,a.I4)((e=>{if(e.isOwner)return d("ChannelCreator");const t=e.promotedByUserId?s[e.promotedByUserId]:void 0;return t?d("EditAdminPromotedBy",(0,u.Js)(t)):d("ChannelAdmin")}),[d,s]);return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{icon:"recent",multiline:!0,onClick:function(){r(o.u1.GroupRecentActions)}},a.ZP.createElement("span",{className:"title"},d("EventLog")),a.ZP.createElement("span",{className:"subtitle"},d(t?"EventLogInfoDetailChannel":"EventLogInfoDetail")))),a.ZP.createElement("div",{className:"section",dir:d.isRtl?"rtl":void 0},a.ZP.createElement("p",{className:"text-muted",dir:"auto"},t?"You can add administrators to help you manage your channel.":"You can add administrators to help you manage your group."),m.map((e=>a.ZP.createElement(Ee.Z,{key:e.userId,className:"chat-item-clickable",onClick:()=>h(e)},a.ZP.createElement(Ce.Z,{userId:e.userId,status:Z(e),forceShowSelf:!0})))))))}))),fr=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>({chat:(0,m.Z1)(e,t)})))((({chat:e,onClose:t,isActive:n})=>{const s=(0,M.Z)();(0,T.ZP)(n,t);const r=(0,a.Ye)((()=>e&&e.fullInfo&&e.fullInfo.adminMembers?e.fullInfo.adminMembers.sort(((e,t)=>e.isOwner?-1:t.isOwner?1:0)):[]),[e]),o=(0,a.I4)((e=>e.isOwner?s("ChannelCreator"):s("ChannelAdmin")),[s]);return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section not-implemented",dir:s.isRtl?"rtl":void 0},a.ZP.createElement("h3",{className:"section-heading",dir:"auto"},"Actions"),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"changeInfo",checked:!0,label:s("EventLogAllEvents"),onChange:void 0})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"changeInfo",checked:!0,label:s("EventLogFilterNewAdmins"),onChange:void 0})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"changeInfo",checked:!0,label:s("EventLogFilterNewMembers"),onChange:void 0})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"changeInfo",checked:!0,label:s("EventLogFilterChannelInfo"),onChange:void 0})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"changeInfo",checked:!0,label:s("EventLogFilterDeletedMessages"),onChange:void 0})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"changeInfo",checked:!0,label:s("EventLogFilterEditedMessages"),onChange:void 0})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"changeInfo",checked:!0,label:s("EventLogFilterLeavingMembers"),onChange:void 0}))),a.ZP.createElement("div",{className:"section not-implemented",dir:s.isRtl?"rtl":void 0},a.ZP.createElement("h3",{className:"section-heading",dir:"auto"},s("Channel.Management.Title")),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"changeInfo",checked:!0,label:s("EventLogAllAdmins"),onChange:void 0})),r.map((e=>a.ZP.createElement(Ee.Z,{key:e.userId,className:"chat-item-clickable picker-list-item",onClick:void 0,ripple:!0},a.ZP.createElement(on.Z,{label:"",checked:!0}),a.ZP.createElement(Ce.Z,{userId:e.userId,status:o(e),forceShowSelf:!0})))))))}))),br=(0,a.X$)((0,s.c$)(((e,{chatId:t,isPromotedByCurrentUser:n})=>{const a=(0,m.Z1)(e,t),{byId:s}=e.users,{currentUserId:r}=e;return{chat:a,usersById:s,currentUserId:r,isChannel:(0,u.eA)(a),isFormFullyDisabled:!(a.isCreator||n)}}),((e,t)=>(0,h.ei)(t,["updateChatAdmin"])))((({selectedChatMemberId:e,onScreenSelect:t,chat:n,usersById:s,currentUserId:r,isChannel:i,isFormFullyDisabled:l,updateChatAdmin:c,onClose:d,isActive:m})=>{const[h,Z]=(0,a.eJ)({}),[P,g]=(0,a.eJ)(!1),[v,p]=(0,a.eJ)(!1),[E,C,f]=(0,Fe.Z)(),[b,y]=(0,a.eJ)(""),I=(0,M.Z)();(0,T.ZP)(m,d);const S=(0,a.Ye)((()=>{if(n.fullInfo&&n.fullInfo.adminMembers)return n.fullInfo.adminMembers.find((({userId:t})=>t===e))}),[n,e]);(0,a.d4)((()=>{null!=n&&n.fullInfo&&e&&!S&&t(o.u1.ChatAdministrators)}),[n,t,S,e]),(0,a.d4)((()=>{Z((null==S?void 0:S.adminRights)||{}),y(((null==S?void 0:S.customTitle)||"").substr(0,16)),g(!1),p(!1)}),[S]);const N=(0,a.I4)((e=>{const{name:t}=e.target;Z((e=>{return{...e,[t]:(n=e[t],!n||void 0)};var n})),g(!0)}),[]),w=(0,a.I4)((()=>{e&&(p(!0),c({chatId:n.id,userId:e,adminRights:h,customTitle:b}))}),[n,e,h,b,c]),k=(0,a.I4)((()=>{e&&(c({chatId:n.id,userId:e,adminRights:{}}),f())}),[n.id,f,e,c]),A=(0,a.I4)((e=>!((0,u.G9)(n)||!l&&n.adminRights&&n.adminRights[e])),[n,l]),L=(0,a.Ye)((()=>{if(!S)return;if(S.isOwner)return I("ChannelCreator");const e=S.promotedByUserId?s[S.promotedByUserId]:void 0;return e?I("EditAdminPromotedBy",(0,u.Js)(e)):I("ChannelAdmin")}),[S,s,I]),R=(0,a.I4)((e=>{const{value:t}=e.target;y(t),g(!0)}),[]);if(S)return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section"},a.ZP.createElement(Ee.Z,{inactive:!0,className:"chat-item-clickable"},a.ZP.createElement(Ce.Z,{userId:S.userId,status:L,forceShowSelf:!0})),a.ZP.createElement("h3",{className:"section-heading mt-4",dir:"auto"},I("EditAdminWhatCanDo")),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"changeInfo",checked:!!h.changeInfo,label:I(i?"EditAdminChangeChannelInfo":"EditAdminChangeGroupInfo"),blocking:!0,disabled:A("changeInfo"),onChange:N})),i&&a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"postMessages",checked:!!h.postMessages,label:I("EditAdminPostMessages"),blocking:!0,disabled:A("postMessages"),onChange:N})),i&&a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"editMessages",checked:!!h.editMessages,label:I("EditAdminEditMessages"),blocking:!0,disabled:A("editMessages"),onChange:N})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"deleteMessages",checked:!!h.deleteMessages,label:I(i?"EditAdminDeleteMessages":"EditAdminGroupDeleteMessages"),blocking:!0,disabled:A("deleteMessages"),onChange:N})),!i&&a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"banUsers",checked:!!h.banUsers,label:I("EditAdminBanUsers"),blocking:!0,disabled:A("banUsers"),onChange:N})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"inviteUsers",checked:!!h.inviteUsers,label:I("EditAdminAddUsers"),blocking:!0,disabled:A("inviteUsers"),onChange:N})),!i&&a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"pinMessages",checked:!!h.pinMessages,label:I("EditAdminPinMessages"),blocking:!0,disabled:A("pinMessages"),onChange:N})),a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"addAdmins",checked:!!h.addAdmins,label:I("EditAdminAddAdmins"),blocking:!0,disabled:A("addAdmins"),onChange:N})),!i&&a.ZP.createElement("div",{className:"ListItem no-selection"},a.ZP.createElement(on.Z,{name:"anonymous",checked:!!h.anonymous,label:I("EditAdminSendAnonymously"),blocking:!0,disabled:A("anonymous"),onChange:N})),l&&a.ZP.createElement("p",{className:"section-info mb-4",dir:"auto"},I("Channel.EditAdmin.CannotEdit")),!i&&a.ZP.createElement(ve.Z,{id:"admin-title",label:I("EditAdminRank"),onChange:R,value:b,disabled:l,maxLength:16}),r!==e&&!l&&a.ZP.createElement(Ee.Z,{icon:"delete",ripple:!0,destructive:!0,onClick:C},I("EditAdminRemoveAdmin")))),a.ZP.createElement(Gt.Z,{isShown:P,onClick:w,ariaLabel:I("Save"),disabled:v},v?a.ZP.createElement(F.Z,{color:"white"}):a.ZP.createElement("i",{className:"icon-check"})),a.ZP.createElement(Me.Z,{isOpen:E,onClose:f,text:"Are you sure you want to dismiss this admin?",confirmLabel:"Dismiss",confirmHandler:k,confirmIsDestructive:!0}))}))),yr=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{var n;const a=(0,m.Z1)(e,t),{byId:s}=e.users;return{members:null==a||null===(n=a.fullInfo)||void 0===n?void 0:n.members,usersById:s,isChannel:a&&(0,u.eA)(a),serverTimeOffset:e.serverTimeOffset}}),((e,t)=>(0,h.ei)(t,["openUserInfo"])))((({members:e,usersById:t,isChannel:n,openUserInfo:s,onClose:r,isActive:o,serverTimeOffset:i})=>{const l=(0,a.Ye)((()=>{if(e&&t)return(0,u.Z0)(e.map((({userId:e})=>e)),t,void 0,i)}),[e,i,t]),c=(0,a.I4)((e=>{s({id:e})}),[s]);return(0,T.ZP)(o,r),a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section",teactFastList:!0},l?l.map(((e,t)=>a.ZP.createElement(Ee.Z,{key:e,teactOrderKey:t,className:"chat-item-clickable scroll-item",onClick:()=>c(e)},a.ZP.createElement(Ce.Z,{userId:e,forceShowSelf:!0})))):a.ZP.createElement(rt.Z,{teactOrderKey:0,key:"nothing-found",text:n?"No subscribers found":"No members found"}))))}))),Ir=(0,a.X$)((0,s.c$)(((e,{chatId:t})=>{var n;const a=(0,m.Z1)(e,t),{byId:s}=e.users;return{members:null==a||null===(n=a.fullInfo)||void 0===n?void 0:n.members,usersById:s,isChannel:a&&(0,u.eA)(a),serverTimeOffset:e.serverTimeOffset}}))((({usersById:e,members:t,isChannel:n,onScreenSelect:s,onChatMemberSelect:r,onClose:i,isActive:l,serverTimeOffset:c})=>{(0,T.ZP)(l,i);const d=(0,a.Ye)((()=>{if(t&&e)return(0,u.Z0)(t.filter((e=>!e.isOwner)).map((({userId:e})=>e)),e,void 0,c)}),[t,c,e]),m=(0,a.I4)((e=>{r(e),s(o.u1.GroupUserPermissions)}),[r,s]);return a.ZP.createElement("div",{className:"Management"},a.ZP.createElement("div",{className:"custom-scroll"},a.ZP.createElement("div",{className:"section",teactFastList:!0},d?d.map(((e,t)=>a.ZP.createElement(Ee.Z,{key:e,teactOrderKey:t,className:"chat-item-clickable scroll-item",onClick:()=>m(e)},a.ZP.createElement(Ce.Z,{userId:e,forceShowSelf:!0})))):a.ZP.createElement(rt.Z,{teactOrderKey:0,key:"nothing-found",text:n?"No subscribers found":"No members found"}))))}))),Sr=(0,a.X$)((0,s.c$)((e=>({managementType:(0,m.pP)(e)})))((({chatId:e,currentScreen:t,selectedChatMemberId:n,isPromotedByCurrentUser:s,onScreenSelect:r,onChatMemberSelect:i,onClose:l,isActive:c,managementType:d})=>{switch(t){case o.u1.Initial:switch(d){case"user":return a.ZP.createElement(cr,{key:e,userId:e,onClose:l,isActive:c});case"group":return a.ZP.createElement(mr,{key:e,chatId:e,onScreenSelect:r,onClose:l,isActive:c||[o.u1.ChatPrivacyType,o.u1.Discussion,o.u1.GroupPermissions,o.u1.ChatAdministrators,o.u1.GroupRemovedUsers,o.u1.GroupUserPermissionsCreate,o.u1.GroupUserPermissions,o.u1.ChatAdminRights,o.u1.GroupRecentActions].includes(t)});case"channel":return a.ZP.createElement(Pr,{key:e,chatId:e,onScreenSelect:r,onClose:l,isActive:c||[o.u1.ChannelSubscribers,o.u1.ChatAdministrators,o.u1.Discussion,o.u1.ChatPrivacyType,o.u1.ChatAdminRights,o.u1.GroupRecentActions].includes(t)})}break;case o.u1.ChatPrivacyType:return a.ZP.createElement(vr,{chatId:e,isActive:c,onClose:l});case o.u1.Discussion:return a.ZP.createElement(pr,{chatId:e,onScreenSelect:r,isActive:c,onClose:l});case o.u1.GroupPermissions:return a.ZP.createElement(ur,{chatId:e,onScreenSelect:r,onChatMemberSelect:i,isActive:c||[o.u1.GroupRemovedUsers,o.u1.GroupUserPermissionsCreate,o.u1.GroupUserPermissions].includes(t),onClose:l});case o.u1.GroupRemovedUsers:return a.ZP.createElement(hr,{chatId:e,isActive:c,onClose:l});case o.u1.GroupUserPermissionsCreate:return a.ZP.createElement(Ir,{chatId:e,onChatMemberSelect:i,onScreenSelect:r,isActive:c||[o.u1.GroupUserPermissions].includes(t),onClose:l});case o.u1.GroupUserPermissions:return a.ZP.createElement(Er,{chatId:e,selectedChatMemberId:n,isPromotedByCurrentUser:s,onScreenSelect:r,isActive:c,onClose:l});case o.u1.ChatAdministrators:return a.ZP.createElement(Cr,{chatId:e,onScreenSelect:r,onChatMemberSelect:i,isActive:c||[o.u1.ChatAdminRights,o.u1.GroupRecentActions].includes(t),onClose:l});case o.u1.GroupRecentActions:return a.ZP.createElement(fr,{chatId:e,isActive:c,onClose:l});case o.u1.ChatAdminRights:return a.ZP.createElement(br,{chatId:e,selectedChatMemberId:n,isPromotedByCurrentUser:s,onScreenSelect:r,isActive:c,onClose:l});case o.u1.ChannelSubscribers:case o.u1.GroupMembers:return a.ZP.createElement(yr,{chatId:e,isActive:c,onClose:l})}})));var Nr=n(9937);const wr=/^4[0-9]{12}(?:[0-9]{1,3})?$/,kr=/^5[1-5][0-9]{11,14}$/,Mr=/^2[2-7][0-9]{11,14}$/;let Tr;!function(e){e[e.Default=0]="Default",e[e.Visa=1]="Visa",e[e.Mastercard=2]="Mastercard"}(Tr||(Tr={}));const Fr={[Tr.Default]:"",[Tr.Visa]:"visa",[Tr.Mastercard]:"mastercard"};function Ar(e){return e=e.replace(/\s/g,""),wr.test(e)?Tr.Visa:kr.test(e)||Mr.test(e)?Tr.Mastercard:Tr.Default}const Lr={},Rr=/(\d{1,3})(\d{1,3})?(\d{1,3})?(\d{1,3})?(\d{1,3})?/,Br="AF🇦🇫93Afghanistan333\nAO🇦🇴244Angola333\nAL🇦🇱355Albania234\nAD🇦🇩376Andorra222\nAE🇦🇪971United Arab Emirates234\nAI🇦🇮1264Anguilla34\nAR🇦🇷54Argentina\nAM🇦🇲374Armenia233\nAG🇦🇬1268Antigua and Barbuda34\nAU🇦🇺61Australia333\nAS🇦🇸1684American Samoa34\nAT🇦🇹43Austria\nAW🇦🇼297Aruba34\nAZ🇦🇿994Azerbaijan2322\nBI🇧🇮257Burundi224\nBE🇧🇪32Belgium3222\nBJ🇧🇯229Benin233\nBF🇧🇫226Burkina Faso2222\nBD🇧🇩880Bangladesh\nBG🇧🇬359Bulgaria\nBH🇧🇭973Bahrain44\nBS🇧🇸1242Bahamas34\nBA🇧🇦387Bosnia and Herzegovina\nBY🇧🇾375Belarus2322\nBZ🇧🇿501Belize\nBO🇧🇴591Bolivia134\nBR🇧🇷55Brazil254\nBB🇧🇧1246Barbados34\nBM🇧🇲1441Bermuda34\nBN🇧🇳673Brunei34\nBQ🇧🇶599Bonaire, Sint Eustatius and Saba\nBT🇧🇹975Bhutan\nBW🇧🇼267Botswana233\nCF🇨🇫236Central African Republic2222\nCA🇨🇦1Canada334\nCH🇨🇭41Switzerland234\nCK🇨🇰682Cook Islands\nCL🇨🇱56Chile144\nCN🇨🇳86China344\nCI🇨🇮225Côte d`Ivoire233\nCM🇨🇲237Cameroon44\nCD🇨🇩243DR Congo234\nCG🇨🇬242Republic of the Congo234\nCO🇨🇴57Colombia334\nKM🇰🇲269Comoros34\nCV🇨🇻238Cape Verde34\nCR🇨🇷506Costa Rica\nCU🇨🇺53Cuba44\nCY🇨🇾357Cyprus44\nCW🇨🇼599Curaçao\nCZ🇨🇿420Czech Republic\nDE🇩🇪49Germany38\nDJ🇩🇯253Djibouti2222\nDM🇩🇲1767Dominica34\nDK🇩🇰45Denmark44\nDO🇩🇴1Dominican Republic334\nDZ🇩🇿213Algeria3222\nEC🇪🇨593Ecuador\nEG🇪🇬20Egypt234\nER🇪🇷291Eritrea133\nES🇪🇸34Spain333\nEE🇪🇪372Estonia\nET🇪🇹251Ethiopia234\nFI🇫🇮358Finland\nFJ🇫🇯679Fiji\nFK🇫🇰500Falkland Islands\nFM🇫🇲691Micronesia\nFO🇫🇴298Faroe Islands33\nFR🇫🇷33France12222\nGA🇬🇦241Gabon1222\nGB🇬🇧44United Kingdom46\nGE🇬🇪995Georgia\nGF🇬🇫594French Guiana\nGH🇬🇭233Ghana\nGI🇬🇮350Gibraltar44\nGL🇬🇱299Greenland33\nGN🇬🇳224Guinea333\nGM🇬🇲220Gambia34\nGP🇬🇵590Guadeloupe\nGU🇬🇺1671Guam34\nGW🇬🇼245Guinea-Bissau34\nGQ🇬🇶240Equatorial Guinea333\nGR🇬🇷30Greece244\nGD🇬🇩1473Grenada34\nGT🇬🇹502Guatemala134\nGY🇬🇾592Guyana\nHK🇭🇰852Hong Kong\nHN🇭🇳504Honduras44\nHR🇭🇷385Croatia\nHT🇭🇹509Haiti\nHU🇭🇺36Hungary234\nID🇮🇩62Indonesia\nIN🇮🇳91India55\nIO🇩🇬246Diego Garcia34\nIE🇮🇪353Ireland234\nIR🇮🇷98Iran334\nIQ🇮🇶964Iraq334\nIS🇮🇸354Iceland34\nIL🇮🇱972Israel234\nIT🇮🇹39Italy334\nJM🇯🇲1876Jamaica34\nJO🇯🇴962Jordan144\nJP🇯🇵81Japan244\nKZ🇰🇿7Kazakhstan3322\nKE🇰🇪254Kenya333\nKG🇰🇬996Kyrgyzstan\nKH🇰🇭855Cambodia\nKI🇰🇮686Kiribati\nKN🇰🇳1869Saint Kitts and Nevis34\nKR🇰🇷82South Korea\nKW🇰🇼965Kuwait44\nKY🇰🇾1345Cayman Islands34\nLA🇱🇦856Laos\nLB🇱🇧961Lebanon\nLR🇱🇷231Liberia\nLY🇱🇾218Libya234\nLC🇱🇨1758Saint Lucia34\nLI🇱🇮423Liechtenstein\nLK🇱🇰94Sri Lanka234\nLS🇱🇸266Lesotho233\nLT🇱🇹370Lithuania35\nLU🇱🇺352Luxembourg\nLV🇱🇻371Latvia35\nMA🇲🇦212Morocco234\nMC🇲🇨377Monaco44\nMD🇲🇩373Moldova233\nMG🇲🇬261Madagascar2232\nMP🇲🇵1670Northern Mariana Islands34\nMO🇲🇴853Macau\nMS🇲🇸1664Montserrat34\nMV🇲🇻960Maldives\nMX🇲🇽52Mexico\nMH🇲🇭692Marshall Islands\nMK🇲🇰389Macedonia\nML🇲🇱223Mali44\nMT🇲🇹356Malta2222\nMM🇲🇲95Myanmar\nME🇲🇪382Montenegro\nMN🇲🇳976Mongolia\nMZ🇲🇿258Mozambique234\nMQ🇲🇶596Martinique\nMR🇲🇷222Mauritania44\nMU🇲🇺230Mauritius\nMW🇲🇼265Malawi\nMY🇲🇾60Malaysia\nNA🇳🇦264Namibia234\nNC🇳🇨687New Caledonia6\nNE🇳🇪227Niger2222\nNF🇳🇫672Norfolk Island\nNG🇳🇬234Nigeria\nNI🇳🇮505Nicaragua44\nNL🇳🇱31Netherlands12222\nNO🇳🇴47Norway44\nNP🇳🇵977Nepal\nNU🇳🇺683Niue\nNR🇳🇷674Nauru\nNZ🇳🇿64New Zealand\nOM🇴🇲968Oman44\nPK🇵🇰92Pakistan334\nPA🇵🇦507Panama44\nPE🇵🇪51Peru333\nPF🇵🇫689French Polynesia\nPH🇵🇭63Philippines334\nPM🇵🇲508Saint Pierre and Miquelon\nPR🇵🇷1Puerto Rico334\nPS🇵🇸970Palestine324\nPW🇵🇼680Palau\nPG🇵🇬675Papua New Guinea\nPL🇵🇱48Poland333\nKP🇰🇵850North Korea\nPT🇵🇹351Portugal144\nPY🇵🇾595Paraguay333\nQA🇶🇦974Qatar\nRE🇷🇪262Réunion333\nRO🇷🇴40Romania333\nRU🇷🇺7Russia3322\nRW🇷🇼250Rwanda333\nSA🇸🇦966Saudi Arabia\nSD🇸🇩249Sudan234\nSN🇸🇳221Senegal234\nSG🇸🇬65Singapore44\nSH🇸🇭290Saint Helena23\nSH🇸🇭247Saint Helena4\nSB🇸🇧677Solomon Islands\nSL🇸🇱232Sierra Leone233\nSV🇸🇻503El Salvador44\nSM🇸🇲378San Marino334\nSO🇸🇴252Somalia233\nRS🇷🇸381Serbia234\nSS🇸🇸211South Sudan234\nST🇸🇹239São Tomé and Príncipe25\nSR🇸🇷597Suriname34\nSK🇸🇰421Slovakia\nSI🇸🇮386Slovenia\nSE🇸🇪46Sweden234\nSZ🇸🇿268Swaziland44\nSC🇸🇨248Seychelles1222\nSX🇸🇽1721Sint Maarten34\nSY🇸🇾963Syria\nTC🇹🇨1649Turks and Caicos Islands34\nTD🇹🇩235Chad2222\nTG🇹🇬228Togo233\nTH🇹🇭66Thailand144\nTJ🇹🇯992Tajikistan\nTK🇹🇰690Tokelau\nTM🇹🇲993Turkmenistan26\nTL🇹🇱670Timor-Leste\nTO🇹🇴676Tonga\nTT🇹🇹1868Trinidad and Tobago34\nTN🇹🇳216Tunisia233\nTR🇹🇷90Turkey334\nTV🇹🇻688Tuvalu\nTW🇹🇼886Taiwan\nTZ🇹🇿255Tanzania234\nUG🇺🇬256Uganda234\nUA🇺🇦380Ukraine2322\nUY🇺🇾598Uruguay44\nUS🇺🇸1United States334\nUZ🇺🇿998Uzbekistan27\nVA🇻🇦3Vatican City\nVC🇻🇨1784Saint Vincent and the Grenadines34\nVE🇻🇪58Venezuela334\nVG🇻🇬1284British Virgin Islands34\nVI🇻🇮1340US Virgin Islands34\nVN🇻🇳84Vietnam\nVU🇻🇺678Vanuatu\nWF🇼🇫681Wallis and Futuna\nWS🇼🇸685Samoa\nXK🇽🇰383Kosovo44\nYE🇾🇪967Yemen333\nZA🇿🇦27South Africa234\nZM🇿🇲260Zambia234\nZW🇿🇼263Zimbabwe234".split("\n").map((e=>({id:e.substr(0,2),flag:e.substr(2,4),code:`+${e.match(/\d+/)[0]}`,name:e.split(/\d+/)[1],phoneFormat:function(e){if(!e)return Rr;const t=e[0];let n;if(!Lr[t]){const e=t.split("").map(Number);n=e.reduce(((e,t,n)=>`${e}(\\d{1,${t}})${n>0?"?":""}`),""),Lr[t]=new RegExp(`${n}${"()?".repeat(5-e.length)}`)}return Lr[t]}(e.match(/\d+$/))}))),$r={streetLine1:"",streetLine2:"",city:"",state:"",countryIso2:"",postCode:"",fullName:"",email:"",phone:"",shipping:"",cardNumber:"",cardholder:"",expiry:"",cvv:"",billingCountry:"",billingZip:"",saveInfo:!0,saveCredentials:!1,formErrors:{}},Dr=(e,t)=>{switch(t.type){case"changeAddress1":return{...e,streetLine1:t.payload,formErrors:{...e.formErrors,streetLine1:void 0}};case"changeAddress2":return{...e,streetLine2:t.payload,formErrors:{...e.formErrors,streetLine2:void 0}};case"changeCity":return{...e,city:t.payload,formErrors:{...e.formErrors,city:void 0}};case"changeState":return{...e,state:t.payload,formErrors:{...e.formErrors,state:void 0}};case"changeCountry":return{...e,countryIso2:t.payload,billingCountry:Ur(t.payload),formErrors:{...e.formErrors,countryIso2:void 0}};case"changePostCode":return{...e,postCode:t.payload,formErrors:{...e.formErrors,postCode:void 0}};case"changeFullName":return{...e,fullName:t.payload,formErrors:{...e.formErrors,fullName:void 0}};case"changeEmail":return{...e,email:t.payload,formErrors:{...e.formErrors,email:void 0}};case"changePhone":return{...e,phone:t.payload,formErrors:{...e.formErrors,phone:void 0}};case"changeShipping":return{...e,shipping:t.payload};case"changeCardNumber":return{...e,cardNumber:t.payload,formErrors:{...e.formErrors,cardNumber:void 0}};case"changeCardholder":return{...e,cardholder:t.payload,formErrors:{...e.formErrors,cardholder:void 0}};case"changeExpiryDate":return{...e,expiry:t.payload,formErrors:{...e.formErrors,expiry:void 0}};case"changeCvvCode":return{...e,cvv:t.payload,formErrors:{...e.formErrors,cvv:void 0}};case"changeBillingCountry":return{...e,billingCountry:t.payload,formErrors:{...e.formErrors,billingCountry:void 0}};case"changeBillingZip":return{...e,billingZip:t.payload,formErrors:{...e.formErrors,billingZip:void 0}};case"changeSaveInfo":return{...e,saveInfo:t.payload};case"changeSaveCredentials":return{...e,saveCredentials:t.payload};case"updateUserInfo":return t.payload.countryIso2?{...e,...t.payload,billingCountry:Ur(t.payload.countryIso2)}:{...e,...t.payload};case"setFormErrors":return{...e,formErrors:{...e.formErrors,...t.payload}};default:return e}};function Ur(e){const t=Br.find((({id:t})=>t===e));return t?t.name:""}function xr(e,t=400){(0,a.d4)((()=>{l.$b||setTimeout((()=>{(0,X.T2)((()=>{e.current&&e.current.focus()}))}),t)}),[e,t])}const Or=(0,a.X$)((e=>{const{id:t,value:n,label:s,hasArrow:r,error:o,ref:i,placeholder:l,onChange:c,children:d}=e,m=o||s,u=(0,Y.Z)("input-group",n&&"touched",o&&"error",m&&"with-label",r&&"with-arrow","input-group");return a.ZP.createElement("div",{className:u},a.ZP.createElement("select",{className:"form-control",id:t,value:n||"",onChange:c,placeholder:l||s,ref:i},d),m&&t&&a.ZP.createElement("label",{htmlFor:t},m))})),Gr=(0,a.X$)((({state:e,needEmail:t,needPhone:n,needName:s,needAddress:r,dispatch:o})=>{const i=(0,a.sO)(null),l=(0,a.sO)(null),c=(0,a.sO)(null);(0,a.d4)((()=>{c.current&&c.current.value!==e.countryIso2&&(c.current.value=e.countryIso2)}),[e.countryIso2]);const d=(0,M.Z)();xr(i);const m=(0,a.I4)((e=>{o({type:"changeAddress1",payload:e.target.value})}),[o]),u=(0,a.I4)((e=>{o({type:"changeAddress2",payload:e.target.value})}),[o]),h=(0,a.I4)((e=>{o({type:"changeCity",payload:e.target.value})}),[o]),Z=(0,a.I4)((e=>{o({type:"changeState",payload:e.target.value})}),[o]),P=(0,a.I4)((e=>{o({type:"changeCountry",payload:e.target.value})}),[o]),g=(0,a.I4)((e=>{o({type:"changePostCode",payload:e.target.value})}),[o]),v=(0,a.I4)((e=>{o({type:"changeFullName",payload:e.target.value})}),[o]),p=(0,a.I4)((e=>{o({type:"changeEmail",payload:e.target.value})}),[o]),E=(0,a.I4)((e=>{let{value:t}=e.target;t=`+${t.replace(/\D/g,"")}`,l.current&&(l.current.value=t),o({type:"changePhone",payload:t})}),[o]),C=(0,a.I4)((e=>{o({type:"changeSaveInfo",payload:e.target.value})}),[o]),{formErrors:f}=e;return a.ZP.createElement("div",{className:"ShippingInfo"},a.ZP.createElement("form",null,r?a.ZP.createElement("div",null,a.ZP.createElement("h5",null,d("PaymentShippingAddress")),a.ZP.createElement(ve.Z,{ref:i,label:"Address1 (Street)",onChange:m,value:e.streetLine1,inputMode:"text",error:f.streetLine1}),a.ZP.createElement(ve.Z,{label:"Address2 (Street)",onChange:u,value:e.streetLine2,inputMode:"text",error:f.streetLine2}),a.ZP.createElement(ve.Z,{label:"City",onChange:h,value:e.city,inputMode:"text",error:f.city}),a.ZP.createElement(ve.Z,{label:"State",onChange:Z,value:e.state,inputMode:"text",error:f.state}),a.ZP.createElement(Or,{label:"Country",placeholder:"Country",onChange:P,value:e.countryIso2,hasArrow:Boolean(!0),id:"shipping-country",error:f.countryIso2,ref:c},Br.map((({name:e,id:t})=>a.ZP.createElement("option",{value:t,className:"county-item"},e)))),a.ZP.createElement(ve.Z,{label:"Post Code",onChange:g,value:e.postCode,inputMode:"text",error:f.postCode})):void 0,s||t||n?a.ZP.createElement("h5",null,d("PaymentShippingReceiver")):void 0,s&&a.ZP.createElement(ve.Z,{label:"Full name",onChange:v,value:e.fullName,inputMode:"text",error:f.fullName}),t&&a.ZP.createElement(ve.Z,{label:"Email",onChange:p,value:e.email,inputMode:"email",error:f.email}),n&&a.ZP.createElement(ve.Z,{label:"Phone number",onChange:E,value:e.phone,inputMode:"tel",error:f.phone,ref:l}),a.ZP.createElement(on.Z,{label:d("PaymentShippingSave"),subLabel:d("PaymentShippingSaveInfo"),checked:Boolean(e.saveInfo),onChange:C})))})),Jr=(0,a.X$)((({state:e,shippingOptions:t,currency:n,dispatch:s})=>{const r=(0,M.Z)();(0,a.d4)((()=>{t&&!e.shipping&&s({type:"changeShipping",payload:t[0].id})}),[t,e.shipping,s]);const o=(0,a.I4)((e=>{s({type:"changeShipping",payload:e})}),[s]),i=(0,a.Ye)((()=>t.map((({id:e,title:t,amount:a})=>({label:t,subLabel:(0,Nr.x)(a,n,r.code),value:e})))),[t,n,r.code]);return a.ZP.createElement("div",{className:"Shipping"},a.ZP.createElement("form",null,a.ZP.createElement("p",null,"Select shipping method"),a.ZP.createElement(ze.Z,{name:"shipping-options",options:i,onChange:o,selected:e.shipping})))}));function zr(e,t,n,s,r=!1){return a.ZP.createElement("div",{className:"price-info-item "+(r?"price-info-item-main":"")},a.ZP.createElement("div",{className:"title"},t),a.ZP.createElement("div",{className:"value"},(0,Nr.x)(n,s,e)))}function Xr(e,t,n){return a.ZP.createElement("div",{className:"checkout-info-item"},a.ZP.createElement("i",{className:e}," "),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"title"},t),a.ZP.createElement("p",{className:"data"},n)))}const Yr=(0,a.X$)((({invoiceContent:e,prices:t,shippingPrices:n,checkoutInfo:s,currency:r,totalPrice:o})=>{const i=(0,M.Z)(),{photoUrl:l,title:c,text:d}=e||{},{paymentMethod:m,paymentProvider:u,shippingAddress:h,name:Z,phone:P,shippingMethod:g}=s||{};return a.ZP.createElement("div",{className:"Checkout"},a.ZP.createElement("div",{className:"description has-image"},l&&a.ZP.createElement("img",{src:l,alt:""}),a.ZP.createElement("div",{className:"text"},a.ZP.createElement("h5",null,c),a.ZP.createElement("p",null,d))),a.ZP.createElement("div",{className:"price-info"},t&&t.map((e=>zr(i.code,e.label,e.amount,r))),n&&n.map((e=>zr(i.code,e.label,e.amount,r))),void 0!==o&&zr(i.code,i("Checkout.TotalAmount"),o,r,!0)),a.ZP.createElement("div",{className:"invoice-info"},m&&Xr("icon-card",m,"Payment method"),u&&Xr("stripe-provider",u,"Payment provider"),h&&Xr("icon-location",h,"Shipping address"),Z&&Xr("icon-user",Z,"Name"),P&&Xr("icon-phone",P,"Phone number"),g&&Xr("icon-truck",g,"Shipping method")))})),_r=(0,a.X$)((({value:e,error:t,onChange:n})=>{const s=(0,a.sO)(null),r=(0,a.I4)((t=>{if("Backspace"===t.key&&"/"===e.charAt(e.length-1)){const t=e.slice(0,e.length-1);s.current&&(s.current.value=t)}}),[e]),o=(0,a.I4)((e=>{n(function(e){const t=(e=e.replace(/[^\d]/g,"").slice(0,4)).match(/.{1,2}/g);return null!=t&&t[0]&&Number(t[0])>12&&(t[0]="12"),null!=t&&t[0]&&2===t[0].length&&!t[1]&&(t[1]=""),t?t.join("/"):""}(e.target.value))}),[n]);return a.ZP.createElement(ve.Z,{label:"Expiry date",ref:s,onChange:o,onKeyDown:r,value:e,error:t,inputMode:"numeric",maxLength:5})}));var Hr=n(6352),jr=n(5753);const Vr=(0,a.X$)((({value:e,error:t,onChange:n})=>{const s=(0,a.sO)(null);xr(s);const[r,o]=(0,a.eJ)(Tr.Default);(0,a.d4)((()=>{const t=Ar(e);o(t)}),[]);const i=(0,a.I4)((e=>{const t=function(e){const t=(e=e.replace(/[^\d]/g,"")).match(/.{1,4}/g);return t?t.join(" "):""}(e.target.value),a=Ar(e.target.value);o(a),n(t),s.current&&(s.current.value=t)}),[n,s]),l=function(e){switch(e){case Tr.Mastercard:return a.ZP.createElement("img",{src:Hr,alt:""});case Tr.Visa:return a.ZP.createElement("img",{src:jr,alt:""});default:return}}(r);return a.ZP.createElement("div",{className:"CardInput"},a.ZP.createElement("span",{className:"left-addon"},l),a.ZP.createElement(ve.Z,{ref:s,label:"Card number",onChange:i,value:e,inputMode:"numeric",className:r?"has-left-addon":"",error:t,maxLength:23}))})),Kr=(0,a.X$)((({state:e,canSaveCredentials:t,needCardholderName:n,needCountry:s,needZip:r,dispatch:o})=>{const i=(0,a.sO)(null);(0,a.d4)((()=>{i.current&&i.current.value!==e.billingCountry&&(i.current.value=e.billingCountry)}),[e.billingCountry]);const l=(0,a.I4)((e=>{o({type:"changeCardNumber",payload:e})}),[o]),c=(0,a.I4)((e=>{o({type:"changeCardholder",payload:e.target.value.toUpperCase()})}),[o]),d=(0,a.I4)((e=>{o({type:"changeExpiryDate",payload:e})}),[o]),m=(0,a.I4)((e=>{o({type:"changeCvvCode",payload:e.target.value})}),[o]),u=(0,a.I4)((e=>{o({type:"changeBillingCountry",payload:e.target.value})}),[o]),h=(0,a.I4)((e=>{o({type:"changeBillingZip",payload:e.target.value})}),[o]),Z=(0,a.I4)((e=>{o({type:"changeSaveCredentials",payload:e.target.value})}),[o]),P=(0,M.Z)(),{formErrors:g={}}=e;return a.ZP.createElement("div",{className:"PaymentInfo"},a.ZP.createElement("form",null,a.ZP.createElement("h5",null,P("PaymentCardTitle")),a.ZP.createElement(Vr,{onChange:l,value:e.cardNumber,error:g.cardNumber}),n&&a.ZP.createElement(ve.Z,{label:"Name on card",onChange:c,value:e.cardholder,inputMode:"text",error:g.cardholder}),a.ZP.createElement("section",{className:"inline-inputs"},a.ZP.createElement(_r,{value:e.expiry,onChange:d,error:g.expiry}),a.ZP.createElement(ve.Z,{label:"CVV code",onChange:m,value:e.cvv,inputMode:"numeric",maxLength:3,error:g.cvv})),s||r?a.ZP.createElement("h5",null,P("PaymentBillingAddress")):void 0,s&&a.ZP.createElement(Or,{label:"Country",placeholder:"Country",onChange:u,value:e.billingCountry,hasArrow:Boolean(!0),id:"billing-country",error:g.billingCountry,ref:i},Br.map((({name:e})=>a.ZP.createElement("option",{value:e,className:"county-item"},e)))),r&&a.ZP.createElement(ve.Z,{label:"Post Code",onChange:h,value:e.billingZip,inputMode:"text",error:g.billingZip}),t&&a.ZP.createElement(on.Z,{label:P("PaymentCardSavePaymentInformation"),checked:e.saveCredentials,onChange:Z})))})),qr=(0,a.X$)((0,s.c$)((e=>{const{step:t,shippingOptions:n,savedInfo:a,canSaveCredentials:s,invoice:r,invoiceContent:o,nativeProvider:i,nativeParams:l,passwordMissing:c,error:d}=e.payment,m=Boolean(r&&(!i||"stripe"!==i)),{needCardholderName:u,needCountry:h,needZip:Z}=l||{},{nameRequested:P,phoneRequested:g,emailRequested:v,shippingAddressRequested:p,flexible:E,phoneToProvider:C,emailToProvider:f,currency:b,prices:y}=r||{};return{step:t,shippingOptions:n,savedInfo:a,canSaveCredentials:s,nativeProvider:i,passwordMissing:c,nameRequested:P,shippingAddressRequested:p,phoneRequested:g,emailRequested:v,flexible:E,phoneToProvider:C,emailToProvider:f,currency:b,prices:y,isProviderError:m,invoiceContent:o,needCardholderName:u,needCountry:h,needZip:Z,error:d}}),((e,t)=>(0,h.ei)(t,["validateRequestedInfo","sendPaymentForm","setPaymentStep","sendCredentialsInfo","clearPaymentError"])))((({isOpen:e,onClose:t,step:n,shippingOptions:s,savedInfo:r,canSaveCredentials:i,nameRequested:l,shippingAddressRequested:c,phoneRequested:d,emailRequested:m,phoneToProvider:u,emailToProvider:h,currency:Z,passwordMissing:P,isProviderError:g,invoiceContent:v,nativeProvider:p,prices:E,needCardholderName:C,needCountry:f,needZip:b,error:y,validateRequestedInfo:I,sendPaymentForm:S,setPaymentStep:N,sendCredentialsInfo:w,clearPaymentError:k})=>{const[T,A]=(0,Lt.Z)(Dr,$r),[B,$]=(0,a.eJ)(!1),D=(0,M.Z)();(0,a.d4)((()=>{(n||y)&&$(!1)}),[n,y]),(0,a.d4)((()=>{null!=y&&y.field&&A({type:"setFormErrors",payload:{[y.field]:y.message}})}),[y,A]),(0,a.d4)((()=>{if(r){const{name:e,phone:t,email:n,shippingAddress:a}=r;A({type:"updateUserInfo",payload:{fullName:e,phone:t&&"+"!==t.charAt(0)?`+${t}`:t,email:n,...a||{}}})}}),[r,A]);const U=(0,a.I4)((()=>{k()}),[k]),x=(0,a.Ye)((()=>n!==o.KB.Checkout?0:function(e=[],t,n){const a=t?Qr(t,n):[];let s=0;return s=e.concat(a||[]).reduce(((e,t)=>e+t.amount),s),s}(E,s,T.shipping)),[n,T.shipping,E,s]),O=(0,a.Ye)((()=>{if(n===o.KB.Checkout)return function(e,t,n){const a=`${function(e){const t=Ar(e);return Fr[t]||""}(e.cardNumber)} *${e.cardNumber.slice(-4)}`,s=e.streetLine1?`${e.streetLine1}, ${e.city}, ${e.countryIso2}`:void 0,{phone:r,fullName:o}=e,i=t?Wr(t,e.shipping):void 0;return{paymentMethod:a,paymentProvider:n,shippingAddress:s,name:o,phone:r,shippingMethod:null==i?void 0:i.title}}(T,s,p||"")}),[n,T,s,p]),G=(0,a.I4)((()=>{const{saveInfo:e}=T,t=function(e){const{streetLine1:t,streetLine2:n,city:a,state:s,countryIso2:r,postCode:o,fullName:i,phone:l,email:c}=e;return{name:i,phone:l,email:c,shippingAddress:{streetLine1:t,streetLine2:n,city:a,state:s,countryIso2:r,postCode:o}}}(T);I({requestInfo:t,saveInfo:e})}),[I,T]),J=(0,a.I4)((()=>{const e=function(e){const{cardNumber:t,cardholder:n,expiry:a,cvv:s,billingCountry:r,billingZip:o}=e,[i,l]=a.split("/");return{data:{cardNumber:t,cardholder:n,expiryMonth:i,expiryYear:l,cvv:s,country:r,zip:o}}}(T);w({credentials:e})}),[w,T]),z=(0,a.I4)((()=>{S({shippingOptionId:T.shipping,saveCredentials:T.saveCredentials})}),[S,T]),X=(0,a.I4)((e=>{N({step:e})}),[N]),Y=(0,a.I4)((()=>{switch($(!0),n){case o.KB.ShippingInfo:return G();case o.KB.Shipping:return X(o.KB.PaymentInfo);case o.KB.PaymentInfo:return J();case o.KB.Checkout:return z();default:return()=>{}}}),[n,G,X,J,z]),_=(0,a.Ye)((()=>{switch(n){case o.KB.ShippingInfo:return D("PaymentShippingInfo");case o.KB.Shipping:return D("PaymentShippingMethod");case o.KB.PaymentInfo:return D("PaymentCardInfo");case o.KB.Checkout:return D("PaymentCheckout");default:return""}}),[n,D]),H=(0,a.Ye)((()=>{switch(n){case o.KB.Checkout:return D("Checkout.PayPrice",(0,Nr.x)(x,Z,D.code));default:return D("Next")}}),[n,D,Z,x]);return g?a.ZP.createElement(ge.Z,{className:"error",isOpen:e,onClose:t},a.ZP.createElement("p",null,"Sorry, Telegram WebZ doesn't support payments with this provider yet. ",a.ZP.createElement("br",null),"Please use one of our mobile apps to do this."),a.ZP.createElement(R.Z,{isText:!0,onClick:t},D("OK"))):a.ZP.createElement(ge.Z,{className:"PaymentModal",isOpen:e,onClose:t},a.ZP.createElement("div",{className:"header",dir:D.isRtl?"rtl":void 0},a.ZP.createElement(R.Z,{className:"close-button",color:"translucent",round:!0,size:"smaller",onClick:t,ariaLabel:"Close"},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement("h3",null,_)),void 0!==n?a.ZP.createElement(L.Z,{name:"slide",activeKey:n},(()=>a.ZP.createElement("div",{className:"content custom-scroll"},function(e){switch(e){case o.KB.ShippingInfo:return a.ZP.createElement(Gr,{state:T,dispatch:A,needAddress:Boolean(c),needEmail:Boolean(m||h),needPhone:Boolean(d||u),needName:Boolean(l)});case o.KB.Shipping:return a.ZP.createElement(Jr,{state:T,dispatch:A,shippingOptions:s||[],currency:Z});case o.KB.PaymentInfo:return a.ZP.createElement(Kr,{state:T,dispatch:A,canSaveCredentials:Boolean(!P&&i),needCardholderName:C,needCountry:f,needZip:b});case o.KB.Checkout:return a.ZP.createElement(Yr,{prices:E,shippingPrices:T.shipping&&s?Qr(s,T.shipping):void 0,totalPrice:x,invoiceContent:v,checkoutInfo:O,currency:Z});default:return}}(n)))):a.ZP.createElement("div",{className:"empty-content"},a.ZP.createElement(F.Z,{color:"gray"})),a.ZP.createElement("div",{className:"footer"},a.ZP.createElement(R.Z,{type:"submit",onClick:Y,disabled:B,isLoading:B},H)),y&&!y.field&&function(){if(y)return a.ZP.createElement(ge.Z,{className:"error",isOpen:Boolean(y),onClose:U},a.ZP.createElement("h4",null,y.description||"Error"),a.ZP.createElement("p",null,y.description||"Error"),a.ZP.createElement(R.Z,{isText:!0,onClick:k},D("OK")))}())})));function Wr(e,t){return e.find((({id:e})=>e===t))}function Qr(e,t){const n=Wr(e,t);return null==n?void 0:n.prices}const eo=(0,a.X$)((0,s.c$)((e=>{const{receipt:t}=e.payment,{currency:n,prices:a,info:s,totalAmount:r,credentialsTitle:o,shippingPrices:i,shippingMethod:l,photoUrl:c,text:d,title:m}=t||{};return{currency:n,prices:a,info:s,totalAmount:r,credentialsTitle:o,shippingPrices:i,shippingMethod:l,photoUrl:c,text:d,title:m}}))((({isOpen:e,onClose:t,prices:n,shippingPrices:s,totalAmount:r,currency:o,info:i,photoUrl:l,text:c,title:d,credentialsTitle:m,shippingMethod:u})=>{const h=(0,M.Z)(),Z=(0,a.Ye)((()=>function(e,t,n){if(!t)return{paymentMethod:e};const{shippingAddress:a}=t,s=null!=a&&a.streetLine1?`${a.streetLine1}, ${a.city}, ${a.countryIso2}`:void 0,{phone:r,name:o}=t;return{paymentMethod:e,paymentProvider:"Stripe",shippingAddress:s,name:o,phone:r,shippingMethod:n}}(m,i,u)),[i,u,m]);return a.ZP.createElement(ge.Z,{className:"PaymentModal PaymentModal-receipt",isOpen:e,onClose:t},a.ZP.createElement("div",null,a.ZP.createElement("div",{className:"header",dir:h.isRtl?"rtl":void 0},a.ZP.createElement(R.Z,{className:"close-button",color:"translucent",round:!0,size:"smaller",onClick:t,ariaLabel:"Close"},a.ZP.createElement("i",{className:"icon-close"})),a.ZP.createElement("h3",null," ",h("PaymentReceipt")," ")),a.ZP.createElement("div",{className:"receipt-content custom-scroll"},a.ZP.createElement(Yr,{prices:n,shippingPrices:s,totalPrice:r,invoiceContent:{photoUrl:l,text:c,title:d},checkoutInfo:Z,currency:o}))))})))},9364:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(4050),s=n(3716),r=n(7361),o=n(6752),i=n(9107),l=n(231);const c=r.wB?550:400,d=(0,a.X$)((({isLoading:e=!1,isPasswordVisible:t,error:n,hint:d,placeholder:m="Password",submitLabel:u="Next",clearError:h,onChangePasswordVisibility:Z,onInputChange:P,onSubmit:g})=>{const v=(0,a.sO)(null),p=(0,i.Z)(),[E,C]=(0,a.eJ)(""),[f,b]=(0,a.eJ)(!1);return(0,a.d4)((()=>{r.$b||setTimeout((()=>{v.current.focus()}),c)}),[]),(0,a.d4)((()=>{n&&requestAnimationFrame((()=>{v.current.focus(),v.current.select()}))}),[n]),a.ZP.createElement("form",{action:"",onSubmit:function(t){t.preventDefault(),e||f&&g(E)},autoComplete:"off"},a.ZP.createElement("div",{className:(0,o.Z)("input-group password-input",E&&"touched",n&&"error"),dir:p.isRtl?"rtl":void 0},a.ZP.createElement("input",{ref:v,className:"form-control",type:t?"text":"password",id:"sign-in-password",value:E||"",autoComplete:"current-password",onChange:function(e){n&&h();const{target:t}=e;C(t.value),b(t.value.length>=s.lo),P&&P(t.value)},dir:"auto"}),a.ZP.createElement("label",null,n||d||m),a.ZP.createElement("div",{className:"toggle-password",onClick:function(){Z(!t)},role:"button",tabIndex:0,title:"Toggle password visibility"},a.ZP.createElement("i",{className:t?"icon-eye":"icon-eye-closed"}))),f&&a.ZP.createElement(l.Z,{type:"submit",ripple:!0,isLoading:e},u))}))},3490:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(4050),s=n(3716),r=n(7361),o=n(7324),i=n(7799);const l=[0,50],c=[0,20],d=[20,0],m=r.wB?s.qp:s.z7,u=(0,a.X$)((({isPasswordVisible:e,isBig:t})=>{const[n,r]=(0,a.eJ)(),[u,h]=(0,a.eJ)(),[Z,P]=(0,a.eJ)(!1),[g,v]=(0,a.eJ)(!1);(0,a.d4)((()=>{n?setTimeout((()=>v(!0)),2e3):(0,o.Z)("MonkeyClose").then(r)}),[n]),(0,a.d4)((()=>{u||(0,o.Z)("MonkeyPeek").then(h)}),[u]);const p=(0,a.I4)((()=>P(!0)),[]);return a.ZP.createElement("div",{id:"monkey",className:t?"big":""},!Z&&a.ZP.createElement("div",{className:"monkey-preview"}),n&&a.ZP.createElement(i.Z,{id:"closeMonkey",size:t?s.K2:m,className:g?"hidden":"shown",animationData:n,playSegment:l,noLoop:!0,onLoad:p}),u&&a.ZP.createElement(i.Z,{id:"peekMonkey",size:t?s.K2:m,className:g?"shown":"hidden",animationData:u,playSegment:e?c:d,noLoop:!0}))}))},7324:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(6137),s=n(647);const r={MonkeyIdle:n(1679),MonkeyTracking:n(4889),MonkeyClose:n(4185),MonkeyPeek:n(8431),FoldersAll:n(6041),FoldersNew:n(7196),DiscussionGroups:n(4349)};function o(e){const t=r[e].replace(window.location.origin,"");return s.he(`file${t}`,a.IU.Lottie)}},710:(e,t,n)=>{n.d(t,{Z:()=>g});var a=n(4050),s=n(6752),r=n(3716),o=n(1394),i=n(9107),l=n(231),c=n(3103),d=n(4288);const m={type:"blob",quality:1,format:"jpeg",circle:!1};let u,h,Z;const P=(0,a.X$)((({file:e,onChange:t,onClose:s})=>{const[P,g]=(0,a.eJ)(!1);(0,a.d4)((()=>{e&&(P?async function(e){try{const t=document.getElementById("avatar-crop");if(!t)return;const{offsetWidth:n,offsetHeight:a}=t;Z=new u(t,{enableZoom:!0,boundary:{width:n,height:a},viewport:{width:n-16,height:a-16,type:"circle"}});const s=await(0,o.YJ)(e);await Z.bind({url:s})}catch(e){r.eM&&console.error(e)}}(e):async function(){return h||(h=Promise.all([n.e(99),n.e(472)]).then(n.bind(n,3472)),u=(await h).default),h}().then((()=>g(!0))))}),[e,P]);const v=(0,i.Z)();return a.ZP.createElement(c.Z,{isOpen:Boolean(e),onClose:s,title:"Drag to reposition",className:"CropModal",hasCloseButton:!0},P?a.ZP.createElement("div",{id:"avatar-crop"}):a.ZP.createElement(d.Z,null),a.ZP.createElement(l.Z,{className:"confirm-button",round:!0,color:"primary",onClick:async function(){if(!Z)return;const e=await Z.result(m),n="string"==typeof e?e:(0,o.hl)(e,"avatar.jpg");t(n)},ariaLabel:v("CropImage")},a.ZP.createElement("i",{className:"icon-check"})))})),g=(0,a.X$)((({title:e="Change your profile picture",disabled:t,currentAvatarBlobUrl:n,onChange:r})=>{const[o,i]=(0,a.eJ)(),[l,c]=(0,a.eJ)(n);(0,a.d4)((()=>{c(n)}),[n]);const d=(0,s.Z)(l&&"filled",t&&"disabled");return a.ZP.createElement("div",{className:"AvatarEditable"},a.ZP.createElement("label",{className:d,role:"button",tabIndex:0,title:e},a.ZP.createElement("input",{type:"file",onChange:function(e){const t=e.target;t&&t.files&&t.files[0]&&(i(t.files[0]),t.value="")},accept:"image/png, image/jpeg"}),a.ZP.createElement("i",{className:"icon-camera-add"}),l&&a.ZP.createElement("img",{src:l,alt:"Avatar"})),a.ZP.createElement(P,{file:o,onClose:function(){i(void 0)},onChange:function(e){i(void 0),r(e),l&&URL.revokeObjectURL(l),c(URL.createObjectURL(e))}}))}))},4349:(e,t,n)=>{e.exports=n.p+"DiscussionGroupsDucks.9ea453d1be9d1b0ee77a..tgs"},6041:(e,t,n)=>{e.exports=n.p+"FoldersAll.3f9f9e243d19f0fbf9aa..tgs"},7196:(e,t,n)=>{e.exports=n.p+"FoldersNew.9a40d71c0c8be70f5bd1..tgs"},4185:(e,t,n)=>{e.exports=n.p+"TwoFactorSetupMonkeyClose.604c4c833d322b7e6c3e..tgs"},1679:(e,t,n)=>{e.exports=n.p+"TwoFactorSetupMonkeyIdle.dea4a492c144df84ddab..tgs"},8431:(e,t,n)=>{e.exports=n.p+"TwoFactorSetupMonkeyPeek.1905436b042520363d7e..tgs"},4889:(e,t,n)=>{e.exports=n.p+"TwoFactorSetupMonkeyTracking.eb5a7a6f166fb7589c12..tgs"},6352:(e,t,n)=>{e.exports=n.p+"mastercard.4216118edafe23cc2dec..svg"},5753:(e,t,n)=>{e.exports=n.p+"visa.e5a7c336e1deb4b92a63..svg"}}]); +//# sourceMappingURL=860.71a26210d53a0e37c47e.js.map \ No newline at end of file diff --git a/dist/860.71a26210d53a0e37c47e.js.map b/dist/860.71a26210d53a0e37c47e.js.map new file mode 100644 index 00000000..d11069d1 --- /dev/null +++ b/dist/860.71a26210d53a0e37c47e.js.map @@ -0,0 +1 @@ +{"version":3,"file":"860.71a26210d53a0e37c47e.js","mappings":"2rCA6MA,SAASA,EAAYC,EAAsDC,GACzE,MAAMC,EAAQC,SAASC,cAAc,OACrCF,EAAMG,UAAUC,IAAI,SAEpB,MAAMC,EAAM,IAAIC,MAYhB,GAVsB,iBAAXR,EACTO,EAAIE,IAAMT,EACDA,aAAkBU,iBAC3BH,EAAIE,IAAMT,EAAOW,OAEjBJ,EAAIE,IAAMT,EAAOS,IAGnBP,EAAMU,YAAYL,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iCT0gC,OAAO,0BAET,wBAAGlnC,UAAU,oBACZ+6E,GAAkB,0BAAK3+E,IAAK2+E,EAAgBjrE,IAAI,YAEnD,mBAAC,EAAD,CAAW2/C,KAAMorB,EAAcxzE,QAzBnC,WACEyzE,OAAgBv5E,IAwB4CgL,SAnC9D,SAA0BouE,GACxBG,OAAgBv5E,GAChBgL,EAASouE,GAELI,GACFG,IAAIC,gBAAgBJ,GAEtBC,EAAkBE,IAAIE,gBAAgBT,Y","sources":["webpack://telegram-t/./src/components/mediaViewer/helpers/ghostAnimation.ts","webpack://telegram-t/./src/components/mediaViewer/SenderInfo.tsx","webpack://telegram-t/./src/components/mediaViewer/MediaViewerActions.tsx","webpack://telegram-t/./src/components/mediaViewer/MediaViewerFooter.tsx","webpack://telegram-t/./src/hooks/useFullscreen.ts","webpack://telegram-t/./src/components/mediaViewer/helpers/formatFileSize.ts","webpack://telegram-t/./src/components/mediaViewer/VideoPlayerControls.tsx","webpack://telegram-t/./src/components/mediaViewer/VideoPlayer.tsx","webpack://telegram-t/./src/components/mediaViewer/ZoomControls.tsx","webpack://telegram-t/./src/components/mediaViewer/PanZoom.tsx","webpack://telegram-t/./src/components/mediaViewer/MediaViewer.tsx","webpack://telegram-t/./src/components/main/ForwardPicker.tsx","webpack://telegram-t/./src/components/main/Dialogs.tsx","webpack://telegram-t/./src/components/main/Notifications.tsx","webpack://telegram-t/./src/components/main/SafeLinkModal.tsx","webpack://telegram-t/./src/components/common/CalendarModal.tsx","webpack://telegram-t/./src/components/main/HistoryCalendar.tsx","webpack://telegram-t/./src/components/common/DeleteMessageModal.tsx","webpack://telegram-t/./src/components/common/PinMessageModal.tsx","webpack://telegram-t/./src/components/common/UnpinAllMessagesModal.tsx","webpack://telegram-t/./src/components/middle/DeleteSelectedMessageModal.tsx","webpack://telegram-t/./src/components/common/ReportMessageModal.tsx","webpack://telegram-t/./src/components/middle/MessageSelectToolbar.tsx","webpack://telegram-t/./src/hooks/useSelectWithEnter.ts","webpack://telegram-t/./src/components/left/search/LeftSearchResultChat.tsx","webpack://telegram-t/./src/components/left/search/RecentContacts.tsx","webpack://telegram-t/./src/components/left/search/ChatMessage.tsx","webpack://telegram-t/./src/components/left/search/DateSuggest.tsx","webpack://telegram-t/./src/components/left/search/ChatResults.tsx","webpack://telegram-t/./src/components/left/search/ChatMessageResults.tsx","webpack://telegram-t/./src/components/left/search/helpers/createMapStateToProps.ts","webpack://telegram-t/./src/components/left/search/MediaResults.tsx","webpack://telegram-t/./src/components/left/search/helpers/getSenderName.ts","webpack://telegram-t/./src/components/left/search/LinkResults.tsx","webpack://telegram-t/./src/components/left/search/FileResults.tsx","webpack://telegram-t/./src/components/left/search/AudioResults.tsx","webpack://telegram-t/./src/components/left/search/LeftSearch.tsx","webpack://telegram-t/./src/hooks/reducers/useTwoFaReducer.ts","webpack://telegram-t/./src/components/left/settings/SettingsHeader.tsx","webpack://telegram-t/./src/components/left/settings/SettingsMain.tsx","webpack://telegram-t/./src/components/common/UsernameInput.tsx","webpack://telegram-t/./src/components/left/settings/SettingsEditProfile.tsx","webpack://telegram-t/./src/components/left/settings/folders/SettingsFoldersMain.tsx","webpack://telegram-t/./src/components/ui/ShowMoreButton.tsx","webpack://telegram-t/./src/components/left/settings/folders/SettingsFoldersEdit.tsx","webpack://telegram-t/./src/components/left/settings/folders/SettingsFoldersChatsPicker.tsx","webpack://telegram-t/./src/components/left/settings/folders/SettingsFoldersChatFilters.tsx","webpack://telegram-t/./src/components/left/settings/folders/SettingsFolders.tsx","webpack://telegram-t/./src/components/ui/RangeSlider.tsx","webpack://telegram-t/./src/components/middle/composer/StickerSetCoverAnimated.tsx","webpack://telegram-t/./src/components/middle/composer/StickerSetCover.tsx","webpack://telegram-t/./src/components/left/settings/SettingsStickerSet.tsx","webpack://telegram-t/./src/components/left/settings/SettingsGeneral.tsx","webpack://telegram-t/./src/util/systemFilesDialog.ts","webpack://telegram-t/./src/util/colors.ts","webpack://telegram-t/./src/components/left/settings/WallpaperTile.tsx","webpack://telegram-t/./src/components/left/settings/SettingsGeneralBackground.tsx","webpack://telegram-t/./src/components/left/settings/SettingsGeneralBackgroundColor.tsx","webpack://telegram-t/./src/components/left/settings/SettingsNotifications.tsx","webpack://telegram-t/./src/components/left/settings/SettingsPrivacy.tsx","webpack://telegram-t/./src/components/left/settings/SettingsLanguage.tsx","webpack://telegram-t/./src/components/left/settings/helper/privacy.ts","webpack://telegram-t/./src/components/left/settings/SettingsPrivacyVisibility.tsx","webpack://telegram-t/./src/components/left/settings/SettingsPrivacyActiveSessions.tsx","webpack://telegram-t/./src/components/left/settings/SettingsPrivacyBlockedUsers.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFaPassword.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFaStart.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx","webpack://telegram-t/./src/components/left/settings/twoFa/SettingsTwoFa.tsx","webpack://telegram-t/./src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx","webpack://telegram-t/./src/components/left/settings/Settings.tsx","webpack://telegram-t/./src/components/left/main/ContactList.tsx","webpack://telegram-t/./src/components/left/newChat/NewChatStep1.tsx","webpack://telegram-t/./src/components/left/newChat/NewChatStep2.tsx","webpack://telegram-t/./src/components/left/newChat/NewChat.tsx","webpack://telegram-t/./src/components/left/ArchivedChats.tsx","webpack://telegram-t/./src/util/scrollLock.ts","webpack://telegram-t/./src/components/middle/message/helpers/copyOptions.ts","webpack://telegram-t/./src/components/middle/message/MessageContextMenu.tsx","webpack://telegram-t/./src/components/middle/message/ContextMenuContainer.tsx","webpack://telegram-t/./src/components/common/StickerSetModal.tsx","webpack://telegram-t/./src/components/middle/HeaderMenuContainer.tsx","webpack://telegram-t/./src/components/middle/MobileSearch.tsx","webpack://telegram-t/./src/util/findInViewport.ts","webpack://telegram-t/./src/util/isFullyVisible.ts","webpack://telegram-t/./src/util/setTooltipItemVisible.ts","webpack://telegram-t/./src/components/middle/composer/hooks/useKeyboardNavigation.ts","webpack://telegram-t/./src/components/middle/composer/MentionTooltip.tsx","webpack://telegram-t/./src/components/middle/composer/AttachmentModal.tsx","webpack://telegram-t/./src/components/middle/composer/PollModal.tsx","webpack://telegram-t/./src/components/middle/composer/EmojiButton.tsx","webpack://telegram-t/./src/components/middle/composer/EmojiCategory.tsx","webpack://telegram-t/./src/components/middle/composer/EmojiPicker.tsx","webpack://telegram-t/./src/components/middle/composer/StickerSet.tsx","webpack://telegram-t/./src/components/middle/composer/StickerPicker.tsx","webpack://telegram-t/./src/components/common/GifButton.tsx","webpack://telegram-t/./src/components/middle/composer/GifPicker.tsx","webpack://telegram-t/./src/components/middle/composer/SymbolMenuFooter.tsx","webpack://telegram-t/./src/components/middle/composer/SymbolMenu.tsx","webpack://telegram-t/./src/components/middle/composer/AttachMenu.tsx","webpack://telegram-t/./src/components/middle/composer/BotCommand.tsx","webpack://telegram-t/./src/components/middle/composer/BotCommandTooltip.tsx","webpack://telegram-t/./src/components/middle/composer/BotCommandMenu.tsx","webpack://telegram-t/./src/components/middle/composer/StickerTooltip.tsx","webpack://telegram-t/./src/components/middle/composer/CustomSendMenu.tsx","webpack://telegram-t/./src/components/middle/composer/EmojiTooltip.tsx","webpack://telegram-t/./src/components/middle/composer/inlineResults/BaseResult.tsx","webpack://telegram-t/./src/components/middle/composer/inlineResults/MediaResult.tsx","webpack://telegram-t/./src/components/middle/composer/inlineResults/ArticleResult.tsx","webpack://telegram-t/./src/components/middle/composer/inlineResults/GifResult.tsx","webpack://telegram-t/./src/components/middle/composer/inlineResults/StickerResult.tsx","webpack://telegram-t/./src/components/middle/composer/InlineBotTooltip.tsx","webpack://telegram-t/./src/components/right/RightSearch.tsx","webpack://telegram-t/./src/components/right/StickerSetResult.tsx","webpack://telegram-t/./src/components/right/StickerSearch.tsx","webpack://telegram-t/./src/components/right/GifSearch.tsx","webpack://telegram-t/./src/components/right/PollAnswerResults.tsx","webpack://telegram-t/./src/components/right/PollResults.tsx","webpack://telegram-t/./src/components/right/management/ManageUser.tsx","webpack://telegram-t/./src/components/right/management/ManageGroup.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupPermissions.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupRemovedUsers.tsx","webpack://telegram-t/./src/components/right/management/ManageChannel.tsx","webpack://telegram-t/./src/components/right/management/ManageChatPrivacyType.tsx","webpack://telegram-t/./src/components/right/management/ManageDiscussion.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupUserPermissions.tsx","webpack://telegram-t/./src/components/right/management/ManageChatAdministrators.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupRecentActions.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupAdminRights.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupMembers.tsx","webpack://telegram-t/./src/components/right/management/ManageGroupUserPermissionsCreate.tsx","webpack://telegram-t/./src/components/right/management/Management.tsx","webpack://telegram-t/./src/components/common/helpers/detectCardType.ts","webpack://telegram-t/./src/util/countries.ts","webpack://telegram-t/./src/hooks/reducers/usePaymentReducer.ts","webpack://telegram-t/./src/hooks/useFocusAfterAnimation.tsx","webpack://telegram-t/./src/components/ui/Select.tsx","webpack://telegram-t/./src/components/payment/ShippingInfo.tsx","webpack://telegram-t/./src/components/payment/Shipping.tsx","webpack://telegram-t/./src/components/payment/Checkout.tsx","webpack://telegram-t/./src/components/payment/ExpiryInput.tsx","webpack://telegram-t/./src/components/middle/helpers/inputFormatters.ts","webpack://telegram-t/./src/components/payment/CardInput.tsx","webpack://telegram-t/./src/components/payment/PaymentInfo.tsx","webpack://telegram-t/./src/components/payment/PaymentModal.tsx","webpack://telegram-t/./src/components/payment/ReceiptModal.tsx","webpack://telegram-t/./src/components/common/PasswordForm.tsx","webpack://telegram-t/./src/components/common/PasswordMonkey.tsx","webpack://telegram-t/./src/components/common/helpers/animatedAssets.ts","webpack://telegram-t/./src/components/ui/CropModal.tsx","webpack://telegram-t/./src/components/ui/AvatarEditable.tsx"],"sourcesContent":["import { ApiMessage, ApiDimensions } from '../../../api/types';\n\nimport { MediaViewerOrigin } from '../../../types';\n\nimport { ANIMATION_END_DELAY } from '../../../config';\nimport {\n calculateDimensions,\n getMediaViewerAvailableDimensions,\n MEDIA_VIEWER_MEDIA_QUERY,\n REM,\n} from '../../common/helpers/mediaDimensions';\nimport windowSize from '../../../util/windowSize';\n\nconst ANIMATION_DURATION = 200;\n\nexport function animateOpening(\n hasFooter: boolean,\n origin: MediaViewerOrigin,\n bestImageData: string,\n dimensions: ApiDimensions,\n isVideo: boolean,\n message?: ApiMessage,\n) {\n const { mediaEl: fromImage } = getNodes(origin, message);\n if (!fromImage) {\n return;\n }\n\n const { width: windowWidth } = windowSize.get();\n const {\n width: availableWidth, height: availableHeight,\n } = getMediaViewerAvailableDimensions(hasFooter, isVideo);\n const { width: toWidth, height: toHeight } = calculateDimensions(\n availableWidth, availableHeight, dimensions.width, dimensions.height,\n );\n const toLeft = (windowWidth - toWidth) / 2;\n const toTop = getTopOffset(hasFooter) + (availableHeight - toHeight) / 2;\n\n let {\n top: fromTop, left: fromLeft, width: fromWidth, height: fromHeight,\n } = fromImage.getBoundingClientRect();\n\n if ([\n MediaViewerOrigin.SharedMedia,\n MediaViewerOrigin.Album,\n MediaViewerOrigin.ScheduledAlbum,\n MediaViewerOrigin.SearchResult,\n ].includes(origin)) {\n const uncovered = uncover(toWidth, toHeight, fromTop, fromLeft, fromWidth, fromHeight);\n fromTop = uncovered.top;\n fromLeft = uncovered.left;\n fromWidth = uncovered.width;\n fromHeight = uncovered.height;\n }\n\n const fromTranslateX = (fromLeft + fromWidth / 2) - (toLeft + toWidth / 2);\n const fromTranslateY = (fromTop + fromHeight / 2) - (toTop + toHeight / 2);\n const fromScaleX = fromWidth / toWidth;\n const fromScaleY = fromHeight / toHeight;\n\n const ghost = createGhost(bestImageData || fromImage);\n applyStyles(ghost, {\n top: `${toTop}px`,\n left: `${toLeft}px`,\n width: `${toWidth}px`,\n height: `${toHeight}px`,\n transform: `translate3d(${fromTranslateX}px, ${fromTranslateY}px, 0) scale(${fromScaleX}, ${fromScaleY})`,\n });\n applyShape(ghost, origin);\n\n document.body.classList.add('ghost-animating');\n\n requestAnimationFrame(() => {\n document.body.appendChild(ghost);\n\n requestAnimationFrame(() => {\n ghost.style.transform = '';\n clearShape(ghost);\n\n setTimeout(() => {\n requestAnimationFrame(() => {\n if (document.body.contains(ghost)) {\n document.body.removeChild(ghost);\n }\n document.body.classList.remove('ghost-animating');\n });\n }, ANIMATION_DURATION + ANIMATION_END_DELAY);\n });\n });\n}\n\nexport function animateClosing(origin: MediaViewerOrigin, bestImageData: string, message?: ApiMessage) {\n const { container, mediaEl: toImage } = getNodes(origin, message);\n if (!toImage) {\n return;\n }\n\n const fromImage = document.getElementById('MediaViewer')!.querySelector(\n '.active .media-viewer-content img, .active .media-viewer-content video',\n );\n if (!fromImage || !toImage) {\n return;\n }\n\n const {\n top: fromTop, left: fromLeft, width: fromWidth, height: fromHeight,\n } = fromImage.getBoundingClientRect();\n const {\n top: targetTop, left: toLeft, width: toWidth, height: toHeight,\n } = toImage.getBoundingClientRect();\n\n let toTop = targetTop;\n if (!isElementInViewport(container)) {\n const { height: windowHeight } = windowSize.get();\n toTop = targetTop < fromTop ? -toHeight : windowHeight;\n }\n\n const fromTranslateX = (fromLeft + fromWidth / 2) - (toLeft + toWidth / 2);\n const fromTranslateY = (fromTop + fromHeight / 2) - (toTop + toHeight / 2);\n let fromScaleX = fromWidth / toWidth;\n let fromScaleY = fromHeight / toHeight;\n\n const shouldFadeOut = (\n [MediaViewerOrigin.Inline, MediaViewerOrigin.ScheduledInline].includes(origin)\n && !isMessageImageFullyVisible(container, toImage)\n ) || (\n [MediaViewerOrigin.Album, MediaViewerOrigin.ScheduledAlbum].includes(origin)\n && !isMessageImageFullyVisible(container, toImage)\n );\n\n if ([\n MediaViewerOrigin.SharedMedia,\n MediaViewerOrigin.Album,\n MediaViewerOrigin.ScheduledAlbum,\n MediaViewerOrigin.SearchResult,\n ].includes(origin)) {\n if (fromScaleX > fromScaleY) {\n fromScaleX = fromScaleY;\n } else if (fromScaleY > fromScaleX) {\n fromScaleY = fromScaleX;\n }\n }\n\n const existingGhost = document.getElementsByClassName('ghost')[0] as HTMLDivElement;\n\n const ghost = existingGhost || createGhost(bestImageData || toImage, origin);\n if (!existingGhost) {\n applyStyles(ghost, {\n top: `${toTop}px`,\n left: `${toLeft}px`,\n width: `${toWidth}px`,\n height: `${toHeight}px`,\n transform: `translate3d(${fromTranslateX}px, ${fromTranslateY}px, 0) scale(${fromScaleX}, ${fromScaleY})`,\n });\n }\n\n requestAnimationFrame(() => {\n if (existingGhost) {\n const {\n top,\n left,\n width,\n height,\n } = existingGhost.getBoundingClientRect();\n const scaleX = width / toWidth;\n const scaleY = height / toHeight;\n\n applyStyles(ghost, {\n transition: 'none',\n top: `${toTop}px`,\n left: `${toLeft}px`,\n transformOrigin: 'top left',\n transform: `translate3d(${left - toLeft}px, ${top - toTop}px, 0) scale(${scaleX}, ${scaleY})`,\n width: `${toWidth}px`,\n height: `${toHeight}px`,\n });\n }\n document.body.classList.add('ghost-animating');\n if (!existingGhost) document.body.appendChild(ghost);\n\n requestAnimationFrame(() => {\n if (existingGhost) {\n existingGhost.style.transition = '';\n }\n\n ghost.style.transform = '';\n\n if (shouldFadeOut) {\n ghost.style.opacity = '0';\n }\n\n applyShape(ghost, origin);\n\n setTimeout(() => {\n requestAnimationFrame(() => {\n if (document.body.contains(ghost)) {\n document.body.removeChild(ghost);\n }\n document.body.classList.remove('ghost-animating');\n });\n }, ANIMATION_DURATION + ANIMATION_END_DELAY);\n });\n });\n}\n\nfunction createGhost(source: string | HTMLImageElement | HTMLVideoElement, origin?: MediaViewerOrigin) {\n const ghost = document.createElement('div');\n ghost.classList.add('ghost');\n\n const img = new Image();\n\n if (typeof source === 'string') {\n img.src = source;\n } else if (source instanceof HTMLVideoElement) {\n img.src = source.poster;\n } else {\n img.src = source.src;\n }\n\n ghost.appendChild(img);\n\n if (origin === MediaViewerOrigin.ProfileAvatar || origin === MediaViewerOrigin.SettingsAvatar) {\n ghost.classList.add('ProfileInfo');\n if (origin === MediaViewerOrigin.SettingsAvatar) {\n ghost.classList.add('self');\n }\n const profileInfo = document.querySelector(\n origin === MediaViewerOrigin.ProfileAvatar\n ? '#RightColumn .ProfileInfo .info'\n : '#Settings .ProfileInfo .info',\n );\n if (profileInfo) {\n ghost.appendChild(profileInfo.cloneNode(true));\n }\n }\n\n return ghost;\n}\n\nfunction uncover(realWidth: number, realHeight: number, top: number, left: number, width: number, height: number) {\n if (realWidth === realHeight) {\n const size = Math.max(width, height) * (realWidth / realHeight);\n left -= (size - width) / 2;\n top -= (size - height) / 2;\n width = size;\n height = size;\n } else if (realWidth > realHeight) {\n const srcWidth = width;\n width = height * (realWidth / realHeight);\n left -= (width - srcWidth) / 2;\n } else if (realHeight > realWidth) {\n const srcHeight = height;\n height = width * (realHeight / realWidth);\n top -= (height - srcHeight) / 2;\n }\n\n return {\n top, left, width, height,\n };\n}\n\nfunction isElementInViewport(el: HTMLElement) {\n if (el.style.display === 'none') {\n return false;\n }\n\n const rect = el.getBoundingClientRect();\n const { height: windowHeight } = windowSize.get();\n\n return (rect.top <= windowHeight) && ((rect.top + rect.height) >= 0);\n}\n\nfunction isMessageImageFullyVisible(container: HTMLElement, imageEl: HTMLElement) {\n const messageListElement = document.querySelector('.active > .MessageList')!;\n let imgOffsetTop = container.offsetTop + imageEl.closest('.content-inner, .WebPage')!.offsetTop;\n if (container.id.includes('album-media-')) {\n imgOffsetTop += container.parentElement!.offsetTop + container.closest('.Message')!.offsetTop;\n }\n\n return imgOffsetTop > messageListElement.scrollTop\n && imgOffsetTop + imageEl.offsetHeight < messageListElement.scrollTop + messageListElement.offsetHeight;\n}\n\nfunction getTopOffset(hasFooter: boolean) {\n const mql = window.matchMedia(MEDIA_VIEWER_MEDIA_QUERY);\n let topOffsetRem = 4.125;\n if (hasFooter) {\n topOffsetRem += mql.matches ? 0.875 : 3.375;\n }\n\n return topOffsetRem * REM;\n}\n\nfunction applyStyles(element: HTMLElement, styles: Record) {\n Object.assign(element.style, styles);\n}\n\nfunction getNodes(origin: MediaViewerOrigin, message?: ApiMessage) {\n let containerSelector;\n let mediaSelector;\n\n switch (origin) {\n case MediaViewerOrigin.Album:\n case MediaViewerOrigin.ScheduledAlbum:\n containerSelector = `.active > .MessageList #album-media-${message!.id}`;\n mediaSelector = '.full-media';\n break;\n\n case MediaViewerOrigin.SharedMedia:\n containerSelector = `#shared-media${message!.id}`;\n mediaSelector = 'img';\n break;\n\n case MediaViewerOrigin.SearchResult:\n containerSelector = `#search-media${message!.id}`;\n mediaSelector = 'img';\n break;\n\n case MediaViewerOrigin.MiddleHeaderAvatar:\n containerSelector = '.MiddleHeader .ChatInfo .Avatar';\n mediaSelector = 'img.avatar-media';\n break;\n\n case MediaViewerOrigin.SettingsAvatar:\n containerSelector = '#Settings .ProfileInfo .active .ProfilePhoto';\n mediaSelector = 'img.avatar-media';\n break;\n\n case MediaViewerOrigin.ProfileAvatar:\n containerSelector = '#RightColumn .ProfileInfo .active .ProfilePhoto';\n mediaSelector = 'img.avatar-media';\n break;\n\n case MediaViewerOrigin.ScheduledInline:\n case MediaViewerOrigin.Inline:\n default:\n containerSelector = `.active > .MessageList #message${message!.id}`;\n mediaSelector = '.message-content .full-media, .message-content .thumbnail';\n }\n\n const container = document.querySelector(containerSelector)!;\n const mediaEls = container && container.querySelectorAll(mediaSelector);\n\n return {\n container,\n mediaEl: mediaEls?.[mediaEls.length - 1],\n };\n}\n\nfunction applyShape(ghost: HTMLDivElement, origin: MediaViewerOrigin) {\n switch (origin) {\n case MediaViewerOrigin.Album:\n case MediaViewerOrigin.ScheduledAlbum:\n case MediaViewerOrigin.Inline:\n case MediaViewerOrigin.ScheduledInline:\n ghost.classList.add('rounded-corners');\n break;\n\n case MediaViewerOrigin.SharedMedia:\n case MediaViewerOrigin.SettingsAvatar:\n case MediaViewerOrigin.ProfileAvatar:\n case MediaViewerOrigin.SearchResult:\n (ghost.firstChild as HTMLElement).style.objectFit = 'cover';\n break;\n\n case MediaViewerOrigin.MiddleHeaderAvatar:\n ghost.classList.add('circle');\n break;\n }\n}\n\nfunction clearShape(ghost: HTMLDivElement) {\n (ghost.firstChild as HTMLElement).style.objectFit = 'default';\n ghost.classList.remove('rounded-corners', 'circle');\n}\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat, ApiMessage, ApiUser } from '../../api/types';\n\nimport { getSenderTitle, isChatPrivate } from '../../modules/helpers';\nimport { formatMediaDateTime } from '../../util/dateFormat';\nimport renderText from '../common/helpers/renderText';\nimport {\n selectChat,\n selectChatMessage,\n selectSender,\n selectUser,\n} from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport Avatar from '../common/Avatar';\n\nimport './SenderInfo.scss';\n\ntype OwnProps = {\n chatId?: number;\n messageId?: number;\n isAvatar?: boolean;\n};\n\ntype StateProps = {\n sender?: ApiUser | ApiChat;\n message?: ApiMessage;\n};\n\ntype DispatchProps = Pick;\n\nconst SenderInfo: FC = ({\n chatId, messageId, sender, isAvatar, message, closeMediaViewer, focusMessage,\n}) => {\n const handleFocusMessage = useCallback(() => {\n closeMediaViewer();\n focusMessage({ chatId, messageId });\n }, [chatId, focusMessage, messageId, closeMediaViewer]);\n\n const lang = useLang();\n\n if (!sender || (!message && !isAvatar)) {\n return undefined;\n }\n\n const isFromChat = sender.id < 0;\n const senderTitle = getSenderTitle(lang, sender);\n\n return (\n
\n {isFromChat ? (\n \n ) : (\n \n )}\n
\n
\n {senderTitle && renderText(senderTitle)}\n
\n
\n {isAvatar ? lang('lng_mediaview_profile_photo') : formatMediaDateTime(lang, message!.date * 1000)}\n
\n
\n
\n );\n};\n\nexport default withGlobal(\n (global, { chatId, messageId, isAvatar }): StateProps => {\n if (isAvatar && chatId) {\n return {\n sender: isChatPrivate(chatId) ? selectUser(global, chatId) : selectChat(global, chatId),\n };\n }\n\n if (!messageId || !chatId) {\n return {};\n }\n\n const message = selectChatMessage(global, chatId, messageId);\n\n return {\n message,\n sender: message && selectSender(global, message),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['closeMediaViewer', 'focusMessage']),\n)(SenderInfo);\n","import React, { FC, useMemo } from '../../lib/teact/teact';\n\nimport { ApiMessage } from '../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { getMessageMediaHash } from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport useMediaDownload from '../../hooks/useMediaDownload';\n\nimport Button from '../ui/Button';\nimport DropdownMenu from '../ui/DropdownMenu';\nimport MenuItem from '../ui/MenuItem';\nimport ProgressSpinner from '../ui/ProgressSpinner';\n\nimport './MediaViewerActions.scss';\n\ntype OwnProps = {\n mediaData?: string;\n isVideo: boolean;\n isZoomed: boolean;\n message?: ApiMessage;\n fileName?: string;\n isAvatar?: boolean;\n onCloseMediaViewer: NoneToVoidFunction;\n onForward: NoneToVoidFunction;\n onZoomToggle: NoneToVoidFunction;\n};\n\nconst MediaViewerActions: FC = ({\n mediaData,\n isVideo,\n isZoomed,\n message,\n fileName,\n isAvatar,\n onCloseMediaViewer,\n onForward,\n onZoomToggle,\n}) => {\n const {\n isDownloadStarted,\n downloadProgress,\n handleDownloadClick,\n } = useMediaDownload(\n message && isVideo ? getMessageMediaHash(message, 'download') : undefined,\n fileName,\n );\n\n const lang = useLang();\n\n const MenuButton: FC<{ onTrigger: () => void; isOpen?: boolean }> = useMemo(() => {\n return ({ onTrigger, isOpen }) => (\n \n \n \n );\n }, []);\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n return (\n
\n \n {!isAvatar && (\n \n {lang('Forward')}\n \n )}\n {isVideo ? (\n \n {isDownloadStarted ? `${Math.round(downloadProgress * 100)}% Downloading...` : 'Download'}\n \n ) : (\n \n {lang('AccActionDownload')}\n \n )}\n \n {isDownloadStarted && }\n
\n );\n }\n\n return (\n
\n {!isAvatar && (\n <>\n \n \n \n \n )}\n {isVideo ? (\n \n {isDownloadStarted ? (\n \n ) : (\n \n )}\n \n ) : (\n \n \n \n )}\n \n \n \n \n \n \n
\n );\n};\n\nexport default MediaViewerActions;\n","import React, { FC, useEffect, useState } from '../../lib/teact/teact';\n\nimport { throttle } from '../../util/schedulers';\nimport { TextPart } from '../common/helpers/renderMessageText';\nimport buildClassName from '../../util/buildClassName';\nimport { REM } from '../common/helpers/mediaDimensions';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\n\nimport './MediaViewerFooter.scss';\n\nconst RESIZE_THROTTLE_MS = 500;\n\ntype OwnProps = {\n text: TextPart | TextPart[];\n onClick: () => void;\n isHidden?: boolean;\n isForVideo: boolean;\n};\n\nconst MediaViewerFooter: FC = ({\n text = '', isHidden, isForVideo, onClick,\n}) => {\n const [isMultiline, setIsMultiline] = useState(false);\n useEffect(() => {\n const footerContent = document.querySelector('.MediaViewerFooter .media-text') as HTMLDivElement | null;\n\n const checkIsMultiline = () => {\n const height = footerContent ? footerContent.clientHeight : 0;\n\n setIsMultiline(height > REM * 2);\n };\n\n // First run for initial detection of multiline footer text\n checkIsMultiline();\n\n const handleResize = throttle(checkIsMultiline, RESIZE_THROTTLE_MS, true);\n\n window.addEventListener('resize', handleResize, false);\n\n return () => {\n window.removeEventListener('resize', handleResize, false);\n };\n }, []);\n\n function stopEvent(e: React.MouseEvent) {\n if (text) {\n e.stopPropagation();\n }\n }\n\n const classNames = buildClassName(\n 'MediaViewerFooter',\n isForVideo && 'is-for-video',\n isHidden && 'is-hidden',\n );\n\n return (\n
\n {text && (\n
\n

{text}

\n
\n )}\n
\n );\n};\n\nexport default MediaViewerFooter;\n","import { useLayoutEffect, useState } from '../lib/teact/teact';\nimport { PLATFORM_ENV } from '../util/environment';\n\ntype RefType = {\n current: HTMLElement | null;\n};\n\ntype ReturnType = [boolean, () => void, () => void] | [false];\ntype CallbackType = (isPlayed: boolean) => void;\n\nconst prop = getBrowserFullscreenElementProp();\n\nexport default function useFullscreenStatus(elRef: RefType, setIsPlayed: CallbackType): ReturnType {\n const [isFullscreen, setIsFullscreen] = useState(Boolean(prop && document[prop]));\n\n const setFullscreen = () => {\n if (!elRef.current || !(prop || PLATFORM_ENV === 'iOS')) {\n return;\n }\n\n if (elRef.current.requestFullscreen) {\n elRef.current.requestFullscreen();\n } else if (elRef.current.webkitRequestFullscreen) {\n elRef.current.webkitRequestFullscreen();\n } else if (elRef.current.webkitEnterFullscreen) {\n elRef.current.webkitEnterFullscreen();\n } else if (elRef.current.mozRequestFullScreen) {\n elRef.current.mozRequestFullScreen();\n }\n\n setIsFullscreen(true);\n };\n\n const exitFullscreen = () => {\n if (!elRef.current) {\n return;\n }\n\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n }\n\n setIsFullscreen(false);\n };\n\n useLayoutEffect(() => {\n const listener = () => { setIsFullscreen(Boolean(prop && document[prop])); };\n const listenerEnter = () => { setIsFullscreen(true); };\n const listenerExit = () => {\n setIsFullscreen(false);\n setIsPlayed(false);\n };\n const video = elRef.current;\n\n document.addEventListener('fullscreenchange', listener, false);\n document.addEventListener('webkitfullscreenchange', listener, false);\n document.addEventListener('mozfullscreenchange', listener, false);\n\n if (video) {\n video.addEventListener('webkitbeginfullscreen', listenerEnter, false);\n video.addEventListener('webkitendfullscreen', listenerExit, false);\n }\n\n return () => {\n document.removeEventListener('fullscreenchange', listener, false);\n document.removeEventListener('webkitfullscreenchange', listener, false);\n document.removeEventListener('mozfullscreenchange', listener, false);\n if (video) {\n video.removeEventListener('webkitbeginfullscreen', listenerEnter, false);\n video.removeEventListener('webkitendfullscreen', listenerExit, false);\n }\n };\n // eslint-disable-next-line\n }, []);\n\n if (!prop && PLATFORM_ENV !== 'iOS') {\n return [false];\n }\n\n return [isFullscreen, setFullscreen, exitFullscreen];\n}\n\nfunction getBrowserFullscreenElementProp() {\n if (typeof document.fullscreenElement !== 'undefined') {\n return 'fullscreenElement';\n } else if (typeof document.mozFullScreenElement !== 'undefined') {\n return 'mozFullScreenElement';\n } else if (typeof document.webkitFullscreenElement !== 'undefined') {\n return 'webkitFullscreenElement';\n }\n\n return '';\n}\n","const units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'];\n\nexport default (bytes: number) => {\n const number = bytes === 0 ? 0 : Math.floor(Math.log(bytes) / Math.log(1024));\n\n return `${(bytes / 1024 ** Math.floor(number)).toFixed(1)} ${units[number]}`;\n};\n","import React, { FC, useState, useEffect } from '../../lib/teact/teact';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { formatMediaDuration } from '../../util/dateFormat';\nimport formatFileSize from './helpers/formatFileSize';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\n\nimport './VideoPlayerControls.scss';\n\ntype IProps = {\n bufferedProgress: number;\n currentTime: number;\n duration: number;\n fileSize: number;\n isForceVisible: boolean;\n isForceMobileVersion?: boolean;\n isPlayed: boolean;\n isFullscreenSupported: boolean;\n isFullscreen: boolean;\n onChangeFullscreen: (e: React.MouseEvent) => void;\n onPlayPause: (e: React.MouseEvent) => void;\n onSeek: OnChangeHandler;\n};\n\ntype OnChangeHandler = (e: React.ChangeEvent) => void;\n\nconst stopEvent = (e: React.MouseEvent) => {\n e.stopPropagation();\n};\n\nconst HIDE_CONTROLS_TIMEOUT_MS = 800;\n\nconst VideoPlayerControls: FC = ({\n bufferedProgress,\n currentTime,\n duration,\n fileSize,\n isForceVisible,\n isForceMobileVersion,\n isPlayed,\n isFullscreenSupported,\n isFullscreen,\n onChangeFullscreen,\n onPlayPause,\n onSeek,\n}) => {\n const [isVisible, setVisibility] = useState(true);\n\n useEffect(() => {\n if (isForceVisible) {\n setVisibility(isForceVisible);\n }\n }, [isForceVisible]);\n\n useEffect(() => {\n let timeout: number | undefined;\n\n if (!isForceVisible) {\n if (IS_SINGLE_COLUMN_LAYOUT) {\n setVisibility(false);\n } else {\n timeout = window.setTimeout(() => {\n setVisibility(false);\n }, HIDE_CONTROLS_TIMEOUT_MS);\n }\n }\n\n return () => {\n if (timeout) {\n window.clearTimeout(timeout);\n }\n };\n }, [isForceVisible]);\n\n useEffect(() => {\n if (isVisible || isForceVisible) {\n document.body.classList.add('video-controls-visible');\n }\n\n return () => {\n document.body.classList.remove('video-controls-visible');\n };\n }, [isForceVisible, isVisible]);\n\n const lang = useLang();\n\n if (!isVisible && !isForceVisible) {\n return undefined;\n }\n\n return (\n
\n {renderSeekLine(currentTime, duration, bufferedProgress, onSeek)}\n \n \n \n {renderTime(currentTime, duration)}\n {bufferedProgress < 1 && renderFileSize(bufferedProgress, fileSize)}\n {isFullscreenSupported && (\n \n \n \n )}\n
\n );\n};\n\nfunction renderTime(currentTime: number, duration: number) {\n return (\n
\n {`${formatMediaDuration(currentTime)} / ${formatMediaDuration(duration)}`}\n
\n );\n}\n\nfunction renderFileSize(downloadedPercent: number, totalSize: number) {\n return (\n
\n {`${formatFileSize(totalSize * downloadedPercent)} / ${formatFileSize(totalSize)}`}\n
\n );\n}\n\nfunction renderSeekLine(currentTime: number, duration: number, bufferedProgress: number, onSeek: OnChangeHandler) {\n const percentagePlayed = (currentTime / duration) * 100;\n const percentageBuffered = bufferedProgress * 100;\n\n return (\n
\n
\n \n \n \n
\n
\n );\n}\n\nexport default VideoPlayerControls;\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { ApiDimensions } from '../../api/types';\n\nimport { IS_IOS, IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../util/environment';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useBuffering from '../../hooks/useBuffering';\nimport useFullscreenStatus from '../../hooks/useFullscreen';\nimport useVideoCleanup from '../../hooks/useVideoCleanup';\nimport safePlay from '../../util/safePlay';\n\nimport VideoPlayerControls from './VideoPlayerControls';\nimport ProgressSpinner from '../ui/ProgressSpinner';\nimport Button from '../ui/Button';\n\nimport './VideoPlayer.scss';\n\ntype OwnProps = {\n url?: string;\n isGif?: boolean;\n posterData?: string;\n posterSize?: ApiDimensions;\n downloadProgress?: number;\n fileSize: number;\n isMediaViewerOpen?: boolean;\n noPlay?: boolean;\n onClose: (e: React.MouseEvent) => void;\n};\n\nconst MOBILE_VERSION_CONTROL_WIDTH = 400;\n\nconst VideoPlayer: FC = ({\n url,\n isGif,\n posterData,\n posterSize,\n downloadProgress,\n fileSize,\n isMediaViewerOpen,\n noPlay,\n onClose,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const videoRef = useRef(null);\n const [isPlayed, setIsPlayed] = useState(!IS_TOUCH_ENV || !IS_IOS);\n const [currentTime, setCurrentTime] = useState(0);\n const [isControlsVisible, setIsControlsVisible] = useState(true);\n\n const [isFullscreen, setFullscreen, exitFullscreen] = useFullscreenStatus(videoRef, setIsPlayed);\n\n const { isBuffered, bufferedProgress, bufferingHandlers } = useBuffering();\n const {\n shouldRender: shouldRenderSpinner,\n transitionClassNames: spinnerClassNames,\n } = useShowTransition(!isBuffered, undefined, undefined, 'slow');\n const {\n shouldRender: shouldRenderPlayButton,\n transitionClassNames: playButtonClassNames,\n } = useShowTransition(IS_IOS && !isPlayed && !shouldRenderSpinner, undefined, undefined, 'slow');\n\n useEffect(() => {\n if (noPlay || !isMediaViewerOpen) {\n videoRef.current!.pause();\n } else if (url && !IS_TOUCH_ENV) {\n // Chrome does not automatically start playing when `url` becomes available (even with `autoPlay`),\n // so we force it here. Contrary, iOS does not allow to call `play` without mouse event,\n // so we need to use `autoPlay` instead to allow pre-buffering.\n safePlay(videoRef.current!);\n }\n }, [noPlay, isMediaViewerOpen, url]);\n\n useEffect(() => {\n if (videoRef.current!.currentTime === videoRef.current!.duration) {\n setCurrentTime(0);\n setIsPlayed(false);\n } else {\n setCurrentTime(videoRef.current!.currentTime);\n }\n }, [currentTime]);\n\n const togglePlayState = useCallback((e: React.MouseEvent | KeyboardEvent) => {\n e.stopPropagation();\n if (isPlayed) {\n videoRef.current!.pause();\n setIsPlayed(false);\n } else {\n videoRef.current!.play();\n setIsPlayed(true);\n }\n }, [isPlayed]);\n\n useVideoCleanup(videoRef, []);\n\n const handleMouseOver = useCallback(() => {\n setIsControlsVisible(true);\n }, []);\n\n const handleMouseOut = useCallback(() => {\n setIsControlsVisible(false);\n }, []);\n\n const handleTimeUpdate = useCallback((e: React.SyntheticEvent) => {\n setCurrentTime(e.currentTarget.currentTime);\n }, []);\n\n const handleEnded = useCallback(() => {\n setCurrentTime(0);\n setIsPlayed(false);\n }, []);\n\n const handleFullscreenChange = useCallback(() => {\n if (isFullscreen && exitFullscreen) {\n exitFullscreen();\n } else if (!isFullscreen && setFullscreen) {\n setFullscreen();\n }\n }, [exitFullscreen, isFullscreen, setFullscreen]);\n\n const handleSeek = useCallback((e: React.ChangeEvent) => {\n e.stopPropagation();\n\n videoRef.current!.currentTime = (Number(e.target.value) * videoRef.current!.duration) / 100;\n }, []);\n\n const toggleControls = useCallback((e: React.MouseEvent) => {\n e.stopPropagation();\n setIsControlsVisible(!isControlsVisible);\n }, [isControlsVisible]);\n\n useEffect(() => {\n const togglePayingStateBySpace = (e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n togglePlayState(e);\n }\n };\n\n document.addEventListener('keydown', togglePayingStateBySpace, false);\n\n return () => {\n document.removeEventListener('keydown', togglePayingStateBySpace, false);\n };\n }, [togglePlayState]);\n\n const wrapperStyle = posterSize && `width: ${posterSize.width}px; height: ${posterSize.height}px`;\n const videoStyle = `background-image: url(${posterData})`;\n\n return (\n \n \n {/* eslint-disable-next-line jsx-a11y/media-has-caption */}\n \n {url && }\n \n
\n {shouldRenderPlayButton && (\n \n )}\n {shouldRenderSpinner && (\n
\n {!isBuffered &&
Buffering...
}\n \n
\n )}\n {!isGif && !shouldRenderSpinner && (\n \n )}\n
\n );\n};\n\nexport default memo(VideoPlayer);\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport buildClassName from '../../util/buildClassName';\nimport usePrevious from '../../hooks/usePrevious';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\n\nimport './ZoomControls.scss';\n\ntype OwnProps = {\n isShown: boolean;\n onChangeZoom: (level: number, canCloseZoom?: boolean) => void;\n};\n\nexport const MAX_ZOOM_LEVEL = 3;\nexport const MIN_ZOOM_LEVEL = 1;\nconst ONE_STEP_PERCENT = 100 / (MAX_ZOOM_LEVEL - MIN_ZOOM_LEVEL);\nconst RESET_ZOOM_LEVEL = 1.5;\n\nconst ZoomControls: FC = ({ isShown, onChangeZoom }) => {\n const { transitionClassNames } = useShowTransition(isShown);\n const prevIsShown = usePrevious(isShown);\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const [zoomLevel, setZoomLevel] = useState(1);\n const isSeeking = useRef(false);\n\n useEffect(() => {\n if (isShown && !prevIsShown) {\n setZoomLevel(RESET_ZOOM_LEVEL);\n }\n }, [isShown, prevIsShown]);\n\n const handleZoomOut = () => {\n if (inputRef.current) {\n setZoomLevel(Math.max(MIN_ZOOM_LEVEL, zoomLevel - 0.5));\n }\n };\n\n const handleZoomIn = () => {\n if (inputRef.current) {\n setZoomLevel(Math.min(MAX_ZOOM_LEVEL, zoomLevel + 0.5));\n }\n };\n\n const handleStartSeek = useCallback(() => {\n isSeeking.current = true;\n }, []);\n\n const handleStopSeek = useCallback(() => {\n isSeeking.current = false;\n if (zoomLevel === 1) {\n onChangeZoom(zoomLevel, !isSeeking.current);\n }\n }, [onChangeZoom, zoomLevel]);\n\n const handleSeeklineChange = (e:React.ChangeEvent) => {\n setZoomLevel(Math.min(MAX_ZOOM_LEVEL, Math.max(Number(e.target.value), MIN_ZOOM_LEVEL)));\n };\n\n useEffect(() => {\n onChangeZoom(zoomLevel, !isSeeking.current);\n }, [zoomLevel, onChangeZoom]);\n\n const lang = useLang();\n\n const className = buildClassName(\n 'ZoomControls',\n transitionClassNames,\n );\n\n return (\n
\n \n \n \n \n \n \n
\n
\n \n \n
\n
\n
\n );\n};\n\nexport default memo(ZoomControls);\n","/*\n @source https://github.com/ajainarayanan/react-pan-zoom\n\n Heavily inspired/lifted from this idea: https://stackoverflow.com/a/39311435/661768\n without jqueryUI or jquery dependency.\n*/\nimport React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { areSortedArraysEqual } from '../../util/iteratees';\n\nimport './PanZoom.scss';\n\nexport interface IDragData {\n x: number;\n y: number;\n dx: number;\n dy: number;\n}\n\nexport interface OwnProps {\n children: any;\n className?: string;\n noWrap: boolean;\n canPan: boolean;\n zoomLevel: number;\n panDeltaX: number;\n panDeltaY: number;\n onPan?: (x: number, y: number) => void;\n}\n\nconst INITIAL_MATRIX = [\n 1, 0, 0, 1, 0, 0,\n];\n\nconst SCALE_VALUES = {\n 1: 1,\n 1.5: 1.5,\n 2: 2.2,\n 2.5: 3.3,\n 3: 5.5,\n};\n\nconst ZOOM_SAFE_AREA = 150;\n\nfunction calculateSafeZoneOnZoom(oldScale: number, matrixData: number[], wrapper: HTMLDivElement | null) {\n const image = wrapper && wrapper.querySelector('.active img');\n if (!wrapper || !image) {\n return matrixData;\n }\n const wrapperRect = wrapper.getBoundingClientRect();\n const imageRect = image.getBoundingClientRect();\n\n const newImgWidth = (imageRect.width / oldScale) * matrixData[0];\n const newImgHeight = (imageRect.height / oldScale) * matrixData[3];\n const newImgX = (wrapperRect.width - newImgWidth) / 2 + matrixData[4];\n const newImgY = (wrapperRect.height - newImgHeight) / 2 + matrixData[5];\n if (wrapperRect.width && wrapperRect.width - ZOOM_SAFE_AREA < newImgX) {\n matrixData[4] -= newImgX + wrapperRect.width - ZOOM_SAFE_AREA;\n } else if (newImgWidth && newImgWidth + newImgX < ZOOM_SAFE_AREA) {\n matrixData[4] -= newImgWidth + newImgX - ZOOM_SAFE_AREA;\n }\n if (wrapperRect.height && wrapperRect.height - ZOOM_SAFE_AREA < newImgY) {\n matrixData[5] -= newImgY + wrapperRect.height - ZOOM_SAFE_AREA;\n } else if (newImgHeight && newImgHeight + newImgY < ZOOM_SAFE_AREA) {\n matrixData[5] -= newImgHeight + newImgY - ZOOM_SAFE_AREA;\n }\n\n return matrixData;\n}\n\nconst PanZoom: FC = ({\n children,\n className,\n noWrap,\n canPan,\n zoomLevel,\n panDeltaX,\n panDeltaY,\n onPan,\n}) => {\n const tunedZoomLevel = SCALE_VALUES[zoomLevel as keyof typeof SCALE_VALUES] || zoomLevel;\n const [isDragging, setIsDragging] = useState(false);\n const [dragData, setDragData] = useState({\n dx: panDeltaX, dy: panDeltaY, x: 0, y: 0,\n });\n // [zoom, skew, skew, zoom, dx, dy] - see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix()\n const [matrixData, setMatrixData] = useState(INITIAL_MATRIX);\n // Used to set cursor while moving.\n // eslint-disable-next-line no-null/no-null\n const panWrapperRef = useRef(null);\n // Used to set transform for pan.\n // eslint-disable-next-line no-null/no-null\n const panContainerRef = useRef(null);\n\n useEffect(() => {\n const newZoomLevel = tunedZoomLevel || matrixData[0];\n const newPandx = panDeltaX || matrixData[4];\n const newPandy = panDeltaY || matrixData[5];\n\n const newMatrixData = [...matrixData];\n if (matrixData[0] !== newZoomLevel) {\n newMatrixData[0] = newZoomLevel || newMatrixData[0];\n newMatrixData[3] = newZoomLevel || newMatrixData[3];\n }\n if (matrixData[4] !== newPandx) {\n newMatrixData[4] = newPandx;\n }\n if (matrixData[5] !== newPandy) {\n newMatrixData[5] = newPandy;\n }\n\n if (!areSortedArraysEqual(matrixData, newMatrixData)) {\n setMatrixData(calculateSafeZoneOnZoom(matrixData[0], newMatrixData, panWrapperRef.current));\n }\n // eslint-disable-next-line\n }, [panDeltaX, panDeltaY, tunedZoomLevel]);\n\n useEffect(() => {\n if (!canPan) {\n setMatrixData(INITIAL_MATRIX);\n }\n }, [canPan]);\n\n useEffect(() => {\n if (panContainerRef.current) {\n panContainerRef.current.style.transform = `matrix(${matrixData.toString()})`;\n }\n }, [noWrap, matrixData]);\n\n const handleMouseDown = (e: React.MouseEvent) => {\n if (!canPan) {\n return;\n }\n\n e.stopPropagation();\n e.preventDefault();\n\n const offsetX = matrixData[4];\n const offsetY = matrixData[5];\n const newDragData: IDragData = {\n dx: offsetX,\n dy: offsetY,\n x: e.pageX,\n y: e.pageY,\n };\n setDragData(newDragData);\n setIsDragging(true);\n\n if (panWrapperRef.current) {\n panWrapperRef.current.classList.add('move');\n }\n };\n\n const handleMouseUp = () => {\n setIsDragging(false);\n\n if (panWrapperRef.current) {\n panWrapperRef.current.classList.remove('move');\n }\n\n if (onPan) {\n onPan(matrixData[4], matrixData[5]);\n }\n };\n\n function getNewMatrixData(x: number, y: number): number[] {\n const newMatrixData = [...matrixData];\n const deltaX = dragData.x - x;\n const deltaY = dragData.y - y;\n newMatrixData[4] = dragData.dx - deltaX;\n newMatrixData[5] = dragData.dy - deltaY;\n\n return newMatrixData;\n }\n\n const handleMouseMove = (e: React.MouseEvent) => {\n if (isDragging) {\n const newMatrixData = getNewMatrixData(e.pageX, e.pageY);\n setMatrixData(newMatrixData);\n\n if (panContainerRef.current) {\n panContainerRef.current.style.transform = `matrix(${matrixData.toString()})`;\n }\n }\n };\n\n if (noWrap) {\n return children;\n }\n\n return (\n \n \n {children}\n \n \n );\n};\n\nexport default memo(PanZoom);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport {\n ApiChat, ApiMediaFormat, ApiMessage, ApiUser, ApiDimensions,\n} from '../../api/types';\nimport { MediaViewerOrigin } from '../../types';\n\nimport { ANIMATION_END_DELAY } from '../../config';\nimport { IS_IOS, IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../util/environment';\nimport windowSize from '../../util/windowSize';\nimport {\n AVATAR_FULL_DIMENSIONS,\n MEDIA_VIEWER_MEDIA_QUERY,\n calculateMediaViewerDimensions,\n} from '../common/helpers/mediaDimensions';\nimport {\n selectChat,\n selectChatMessage,\n selectChatMessages,\n selectCurrentMediaSearch,\n selectListedIds,\n selectOutlyingIds,\n selectScheduledMessage,\n selectScheduledMessages,\n selectUser,\n} from '../../modules/selectors';\nimport {\n getChatAvatarHash,\n getChatMediaMessageIds,\n getMessageFileName,\n getMessageMediaFormat,\n getMessageMediaHash,\n getMessageMediaThumbDataUri,\n getMessagePhoto,\n getMessageVideo,\n getMessageDocument,\n isMessageDocumentPhoto,\n isMessageDocumentVideo,\n getMessageWebPagePhoto,\n getMessageWebPageVideo,\n getPhotoFullDimensions,\n getVideoDimensions, getMessageFileSize,\n} from '../../modules/helpers';\nimport { pick } from '../../util/iteratees';\nimport { captureEvents, SwipeDirection } from '../../util/captureEvents';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport { stopCurrentAudio } from '../../util/audioPlayer';\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport useMedia from '../../hooks/useMedia';\nimport useMediaWithDownloadProgress from '../../hooks/useMediaWithDownloadProgress';\nimport useBlurSync from '../../hooks/useBlurSync';\nimport usePrevious from '../../hooks/usePrevious';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport { renderMessageText } from '../common/helpers/renderMessageText';\nimport { animateClosing, animateOpening } from './helpers/ghostAnimation';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Spinner from '../ui/Spinner';\nimport ShowTransition from '../ui/ShowTransition';\nimport Transition from '../ui/Transition';\nimport Button from '../ui/Button';\nimport SenderInfo from './SenderInfo';\nimport MediaViewerActions from './MediaViewerActions';\nimport MediaViewerFooter from './MediaViewerFooter';\nimport VideoPlayer from './VideoPlayer';\nimport ZoomControls from './ZoomControls';\nimport PanZoom from './PanZoom';\n\nimport './MediaViewer.scss';\n\ntype StateProps = {\n chatId?: number;\n threadId?: number;\n messageId?: number;\n senderId?: number;\n origin?: MediaViewerOrigin;\n avatarOwner?: ApiChat | ApiUser;\n profilePhotoIndex?: number;\n message?: ApiMessage;\n chatMessages?: Record;\n collectionIds?: number[];\n animationLevel: 0 | 1 | 2;\n};\n\ntype DispatchProps = Pick;\n\nconst ANIMATION_DURATION = 350;\n\nconst MediaViewer: FC = ({\n chatId,\n threadId,\n messageId,\n senderId,\n origin,\n avatarOwner,\n profilePhotoIndex,\n message,\n chatMessages,\n collectionIds,\n openMediaViewer,\n closeMediaViewer,\n openForwardMenu,\n focusMessage,\n animationLevel,\n}) => {\n const isOpen = Boolean(avatarOwner || messageId);\n\n const isFromSharedMedia = origin === MediaViewerOrigin.SharedMedia;\n const isFromSearch = origin === MediaViewerOrigin.SearchResult;\n\n /* Content */\n const photo = message ? getMessagePhoto(message) : undefined;\n const video = message ? getMessageVideo(message) : undefined;\n const webPagePhoto = message ? getMessageWebPagePhoto(message) : undefined;\n const webPageVideo = message ? getMessageWebPageVideo(message) : undefined;\n const isDocumentPhoto = message ? isMessageDocumentPhoto(message) : false;\n const isDocumentVideo = message ? isMessageDocumentVideo(message) : false;\n const isVideo = Boolean(video || webPageVideo || isDocumentVideo);\n const isPhoto = Boolean(!isVideo && (photo || webPagePhoto || isDocumentPhoto));\n const { isGif } = video || webPageVideo || {};\n const isAvatar = Boolean(avatarOwner);\n\n /* Navigation */\n const isSingleSlide = Boolean(webPagePhoto || webPageVideo);\n const messageIds = useMemo(() => {\n return isSingleSlide && messageId\n ? [messageId]\n : getChatMediaMessageIds(chatMessages || {}, collectionIds || [], isFromSharedMedia);\n }, [isSingleSlide, messageId, chatMessages, collectionIds, isFromSharedMedia]);\n\n const selectedMediaMessageIndex = messageId ? messageIds.indexOf(messageId) : -1;\n const isFirst = selectedMediaMessageIndex === 0 || selectedMediaMessageIndex === -1;\n const isLast = selectedMediaMessageIndex === messageIds.length - 1 || selectedMediaMessageIndex === -1;\n\n /* Animation */\n const animationKey = useRef();\n const prevSenderId = usePrevious(senderId);\n if (isOpen && (!prevSenderId || prevSenderId !== senderId || !animationKey.current)) {\n animationKey.current = selectedMediaMessageIndex;\n }\n const slideAnimation = animationLevel >= 1 ? 'mv-slide' : 'none';\n const headerAnimation = animationLevel === 2 ? 'slide-fade' : 'none';\n const isGhostAnimation = animationLevel === 2;\n\n /* Controls */\n const [isFooterHidden, setIsFooterHidden] = useState(false);\n const [canPanZoomWrap, setCanPanZoomWrap] = useState(false);\n const [isZoomed, setIsZoomed] = useState(false);\n const [zoomLevel, setZoomLevel] = useState(1);\n const [panDelta, setPanDelta] = useState({ x: 0, y: 0 });\n\n /* Media data */\n function getMediaHash(isFull?: boolean) {\n if (isAvatar && profilePhotoIndex !== undefined) {\n const { photos } = avatarOwner!;\n return photos && photos[profilePhotoIndex]\n ? `photo${photos[profilePhotoIndex].id}?size=c`\n : getChatAvatarHash(avatarOwner!, isFull ? 'big' : 'normal');\n }\n\n return message && getMessageMediaHash(message, isFull ? 'viewerFull' : 'viewerPreview');\n }\n\n const blobUrlPictogram = useMedia(\n message && (isFromSharedMedia || isFromSearch) && getMessageMediaHash(message, 'pictogram'),\n undefined,\n ApiMediaFormat.BlobUrl,\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n const previewMediaHash = getMediaHash();\n const blobUrlPreview = useMedia(\n previewMediaHash,\n undefined,\n isAvatar && previewMediaHash && previewMediaHash.startsWith('profilePhoto')\n ? ApiMediaFormat.DataUri\n : ApiMediaFormat.BlobUrl,\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n const { mediaData: fullMediaData, downloadProgress } = useMediaWithDownloadProgress(\n getMediaHash(true),\n undefined,\n message && getMessageMediaFormat(message, 'viewerFull'),\n undefined,\n isGhostAnimation && ANIMATION_DURATION,\n );\n\n const localBlobUrl = (photo || video) ? (photo || video)!.blobUrl : undefined;\n let bestImageData = (!isVideo && (localBlobUrl || fullMediaData)) || blobUrlPreview || blobUrlPictogram;\n const thumbDataUri = useBlurSync(!bestImageData && message && getMessageMediaThumbDataUri(message));\n if (!bestImageData && origin !== MediaViewerOrigin.SearchResult) {\n bestImageData = thumbDataUri;\n }\n\n const videoSize = message ? getMessageFileSize(message) : undefined;\n const fileName = message\n ? getMessageFileName(message)\n : isAvatar\n ? `avatar${avatarOwner!.id}-${profilePhotoIndex}.jpg`\n : undefined;\n\n let dimensions!: ApiDimensions;\n if (message) {\n if (isDocumentPhoto || isDocumentVideo) {\n dimensions = getMessageDocument(message)!.mediaSize!;\n } else if (photo || webPagePhoto) {\n dimensions = getPhotoFullDimensions((photo || webPagePhoto)!)!;\n } else if (video || webPageVideo) {\n dimensions = getVideoDimensions((video || webPageVideo)!)!;\n }\n } else {\n dimensions = AVATAR_FULL_DIMENSIONS;\n }\n\n useEffect(() => {\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n return;\n }\n\n document.body.classList.toggle('is-media-viewer-open', isOpen);\n }, [isOpen]);\n\n const forceUpdate = useForceUpdate();\n useEffect(() => {\n const mql = window.matchMedia(MEDIA_VIEWER_MEDIA_QUERY);\n if (typeof mql.addEventListener === 'function') {\n mql.addEventListener('change', forceUpdate);\n } else if (typeof mql.addListener === 'function') {\n mql.addListener(forceUpdate);\n }\n\n return () => {\n if (typeof mql.removeEventListener === 'function') {\n mql.removeEventListener('change', forceUpdate);\n } else if (typeof mql.removeListener === 'function') {\n mql.removeListener(forceUpdate);\n }\n };\n }, [forceUpdate]);\n\n const prevMessage = usePrevious(message);\n const prevOrigin = usePrevious(origin);\n const prevAvatarOwner = usePrevious(avatarOwner);\n const prevBestImageData = usePrevious(bestImageData);\n useEffect(() => {\n if (isGhostAnimation && isOpen && !prevMessage && !prevAvatarOwner) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION + ANIMATION_END_DELAY);\n const textParts = message ? renderMessageText(message) : undefined;\n const hasFooter = Boolean(textParts);\n animateOpening(hasFooter, origin!, bestImageData!, dimensions, isVideo, message);\n }\n\n if (isGhostAnimation && !isOpen && (prevMessage || prevAvatarOwner)) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION + ANIMATION_END_DELAY);\n animateClosing(prevOrigin!, prevBestImageData!, prevMessage || undefined);\n }\n }, [\n isGhostAnimation, isOpen, origin, prevOrigin, message, prevMessage, prevAvatarOwner,\n bestImageData, prevBestImageData, dimensions, isVideo,\n ]);\n\n useEffect(() => {\n let timer: number | undefined;\n\n if (isZoomed) {\n setCanPanZoomWrap(true);\n } else {\n timer = window.setTimeout(() => {\n setCanPanZoomWrap(false);\n }, ANIMATION_DURATION);\n }\n\n return () => {\n if (timer) {\n window.clearTimeout(timer);\n }\n };\n }, [isZoomed]);\n\n const closeZoom = () => {\n setIsZoomed(false);\n setZoomLevel(1);\n setPanDelta({ x: 0, y: 0 });\n };\n\n const handleZoomToggle = useCallback(() => {\n setIsZoomed(!isZoomed);\n setZoomLevel(!isZoomed ? 1.5 : 1);\n if (isZoomed) {\n setPanDelta({ x: 0, y: 0 });\n }\n }, [isZoomed]);\n\n const handleZoomValue = useCallback((level: number, canCloseZoom = false) => {\n setZoomLevel(level);\n if (level === 1 && canCloseZoom) {\n closeZoom();\n }\n }, []);\n\n const close = useCallback(() => {\n closeMediaViewer();\n closeZoom();\n }, [closeMediaViewer]);\n\n const handleFooterClick = useCallback(() => {\n close();\n focusMessage({ chatId, threadId, messageId });\n }, [close, chatId, threadId, focusMessage, messageId]);\n\n const handleForward = useCallback(() => {\n openForwardMenu({ fromChatId: chatId, messageIds: [messageId] });\n closeZoom();\n }, [openForwardMenu, chatId, messageId]);\n\n useEffect(() => (isOpen ? captureEscKeyListener(() => {\n if (isZoomed) {\n closeZoom();\n } else {\n close();\n }\n }) : undefined), [close, isOpen, isZoomed]);\n\n useEffect(() => {\n if (isVideo && !isGif) {\n stopCurrentAudio();\n }\n }, [isGif, isVideo]);\n\n // Prevent refresh when rotating device to watch a video\n useEffect(() => {\n if (!isOpen) {\n return undefined;\n }\n\n windowSize.disableRefresh();\n\n return () => {\n windowSize.enableRefresh();\n };\n }, [isOpen]);\n\n const getMessageId = useCallback((fromId: number, direction: number): number => {\n let index = messageIds.indexOf(fromId);\n if ((direction === -1 && index > 0) || (direction === 1 && index < messageIds.length - 1)) {\n index += direction;\n }\n\n return messageIds[index];\n }, [messageIds]);\n\n const selectPreviousMedia = useCallback(() => {\n if (isFirst) {\n return;\n }\n\n openMediaViewer({\n chatId,\n threadId,\n messageId: messageId ? getMessageId(messageId, -1) : undefined,\n origin,\n });\n }, [chatId, threadId, getMessageId, isFirst, messageId, openMediaViewer, origin]);\n\n const selectNextMedia = useCallback(() => {\n if (isLast) {\n return;\n }\n\n openMediaViewer({\n chatId,\n threadId,\n messageId: messageId ? getMessageId(messageId, 1) : undefined,\n origin,\n });\n }, [chatId, threadId, getMessageId, isLast, messageId, openMediaViewer, origin]);\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n switch (e.key) {\n case 'Left': // IE/Edge specific value\n case 'ArrowLeft':\n selectPreviousMedia();\n break;\n\n case 'Right': // IE/Edge specific value\n case 'ArrowRight':\n selectNextMedia();\n break;\n }\n };\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n });\n\n // Support for swipe gestures and closing on click\n useEffect(() => {\n const element = document.querySelector('.slide-container > .active, .slide-container > .to');\n if (!element) {\n return undefined;\n }\n\n const shouldCloseOnVideo = isGif && !IS_IOS;\n\n return captureEvents(element, {\n // eslint-disable-next-line max-len\n excludedClosestSelector: `.backdrop, .navigation, .media-viewer-head, .media-viewer-footer${!shouldCloseOnVideo ? ', .VideoPlayer' : ''}`,\n onClick: () => {\n if (!isZoomed && !IS_TOUCH_ENV) {\n close();\n }\n },\n onSwipe: IS_TOUCH_ENV ? (e, direction) => {\n if (direction === SwipeDirection.Right) {\n selectPreviousMedia();\n } else if (direction === SwipeDirection.Left) {\n selectNextMedia();\n } else if (!(e.target && (e.target as HTMLElement).closest('.MediaViewerFooter'))) {\n close();\n }\n\n return true;\n } : undefined,\n });\n }, [close, isFooterHidden, isGif, isPhoto, isZoomed, selectNextMedia, selectPreviousMedia]);\n\n const handlePan = useCallback((x: number, y: number) => {\n setPanDelta({ x, y });\n }, []);\n\n const handleToggleFooterVisibility = useCallback(() => {\n if (IS_TOUCH_ENV && (isPhoto || isGif)) {\n setIsFooterHidden(!isFooterHidden);\n }\n }, [isFooterHidden, isGif, isPhoto]);\n\n const lang = useLang();\n\n useHistoryBack(isOpen, closeMediaViewer, openMediaViewer, {\n chatId,\n threadId,\n messageId,\n origin,\n avatarOwnerId: avatarOwner && avatarOwner.id,\n });\n\n function renderSlide(isActive: boolean) {\n if (isAvatar) {\n return (\n
\n {renderPhoto(\n fullMediaData || blobUrlPreview,\n calculateMediaViewerDimensions(AVATAR_FULL_DIMENSIONS, false),\n !IS_SINGLE_COLUMN_LAYOUT && !isZoomed,\n )}\n
\n );\n } else if (message) {\n const textParts = renderMessageText(message);\n const hasFooter = Boolean(textParts);\n\n return (\n \n {isPhoto && renderPhoto(\n localBlobUrl || fullMediaData || blobUrlPreview || blobUrlPictogram,\n message && calculateMediaViewerDimensions(dimensions!, hasFooter),\n !IS_SINGLE_COLUMN_LAYOUT && !isZoomed,\n )}\n {isVideo && (\n \n )}\n {textParts && (\n \n )}\n \n );\n }\n\n return undefined;\n }\n\n function renderSenderInfo() {\n return isAvatar ? (\n \n ) : (\n \n );\n }\n\n return (\n \n {() => (\n <>\n
\n {IS_SINGLE_COLUMN_LAYOUT && (\n \n \n \n )}\n \n {renderSenderInfo}\n \n \n
\n \n \n {renderSlide}\n \n \n {!isFirst && (\n \n )}\n {!isLast && (\n \n )}\n \n \n )}\n \n );\n};\n\nfunction renderPhoto(blobUrl?: string, imageSize?: ApiDimensions, canDrag?: boolean) {\n return blobUrl\n ? (\n \n )\n : (\n \n \n \n );\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chatId, threadId, messageId, avatarOwnerId, profilePhotoIndex, origin,\n } = global.mediaViewer;\n const {\n animationLevel,\n } = global.settings.byKey;\n\n if (origin === MediaViewerOrigin.SearchResult) {\n if (!(chatId && messageId)) {\n return { animationLevel };\n }\n\n const message = selectChatMessage(global, chatId, messageId);\n if (!message) {\n return { animationLevel };\n }\n\n return {\n chatId,\n messageId,\n senderId: message.senderId,\n origin,\n message,\n animationLevel,\n };\n }\n\n if (avatarOwnerId) {\n const sender = selectUser(global, avatarOwnerId) || selectChat(global, avatarOwnerId);\n\n return {\n messageId: -1,\n senderId: avatarOwnerId,\n avatarOwner: sender,\n profilePhotoIndex: profilePhotoIndex || 0,\n animationLevel,\n origin,\n };\n }\n\n if (!(chatId && threadId && messageId)) {\n return { animationLevel };\n }\n\n let message: ApiMessage | undefined;\n if (origin && [MediaViewerOrigin.ScheduledAlbum, MediaViewerOrigin.ScheduledInline].includes(origin)) {\n message = selectScheduledMessage(global, chatId, messageId);\n } else {\n message = selectChatMessage(global, chatId, messageId);\n }\n\n if (!message) {\n return { animationLevel };\n }\n\n let chatMessages: Record | undefined;\n\n if (origin && [MediaViewerOrigin.ScheduledAlbum, MediaViewerOrigin.ScheduledInline].includes(origin)) {\n chatMessages = selectScheduledMessages(global, chatId);\n } else {\n chatMessages = selectChatMessages(global, chatId);\n }\n let collectionIds: number[] | undefined;\n\n if (origin === MediaViewerOrigin.Inline || origin === MediaViewerOrigin.Album) {\n collectionIds = selectOutlyingIds(global, chatId, threadId) || selectListedIds(global, chatId, threadId);\n } else if (origin === MediaViewerOrigin.SharedMedia) {\n const currentSearch = selectCurrentMediaSearch(global);\n const { foundIds } = (currentSearch && currentSearch.resultsByType && currentSearch.resultsByType.media) || {};\n collectionIds = foundIds;\n }\n\n return {\n chatId,\n threadId,\n messageId,\n senderId: message.senderId,\n origin,\n message,\n chatMessages,\n collectionIds,\n animationLevel,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openMediaViewer', 'closeMediaViewer', 'openForwardMenu', 'focusMessage',\n ]),\n)(MediaViewer));\n","import React, {\n FC, useMemo, useState, memo, useRef, useEffect, useCallback,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat, MAIN_THREAD_ID } from '../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport {\n getCanPostInChat, getChatTitle, isChatPrivate, sortChatIds,\n} from '../../modules/helpers';\nimport searchWords from '../../util/searchWords';\nimport { pick, unique } from '../../util/iteratees';\nimport useInfiniteScroll from '../../hooks/useInfiniteScroll';\nimport useLang from '../../hooks/useLang';\nimport useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';\n\nimport Loading from '../ui/Loading';\nimport Modal from '../ui/Modal';\nimport InputText from '../ui/InputText';\nimport Button from '../ui/Button';\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport ListItem from '../ui/ListItem';\nimport PrivateChatInfo from '../common/PrivateChatInfo';\nimport GroupChatInfo from '../common/GroupChatInfo';\n\nimport './ForwardPicker.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n};\n\ntype StateProps = {\n chatsById: Record;\n pinnedIds?: number[];\n activeListIds?: number[];\n archivedListIds?: number[];\n orderedPinnedIds?: number[];\n currentUserId?: number;\n};\n\ntype DispatchProps = Pick;\n\n// Focus slows down animation, also it breaks transition layout in Chrome\nconst FOCUS_DELAY_MS = 500;\nconst MODAL_HIDE_DELAY_MS = 300;\n\nconst ForwardPicker: FC = ({\n chatsById,\n pinnedIds,\n activeListIds,\n archivedListIds,\n currentUserId,\n isOpen,\n setForwardChatId,\n exitForwardMode,\n loadMoreChats,\n}) => {\n const [filter, setFilter] = useState('');\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n\n const lang = useLang();\n\n useEffect(() => {\n if (isOpen) {\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n setTimeout(() => {\n requestAnimationFrame(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n });\n }, FOCUS_DELAY_MS);\n }\n } else {\n if (inputRef.current) {\n inputRef.current.blur();\n }\n\n setTimeout(() => {\n setFilter('');\n }, MODAL_HIDE_DELAY_MS);\n }\n }, [isOpen]);\n\n const chatIds = useMemo(() => {\n const listIds = [\n ...(activeListIds || []),\n ...(archivedListIds || []),\n ];\n\n let priorityIds = pinnedIds || [];\n if (currentUserId) {\n priorityIds = unique([currentUserId, ...priorityIds]);\n }\n\n return sortChatIds([\n ...listIds.filter((id) => {\n const chat = chatsById[id];\n if (!chat) {\n return true;\n }\n\n if (!getCanPostInChat(chat, MAIN_THREAD_ID)) {\n return false;\n }\n\n if (!filter) {\n return true;\n }\n\n return searchWords(getChatTitle(lang, chatsById[id], undefined, id === currentUserId), filter);\n }),\n ], chatsById, undefined, priorityIds);\n }, [activeListIds, archivedListIds, chatsById, currentUserId, filter, lang, pinnedIds]);\n\n const [viewportIds, getMore] = useInfiniteScroll(loadMoreChats, chatIds, Boolean(filter));\n\n const handleFilterChange = useCallback((e: React.ChangeEvent) => {\n setFilter(e.currentTarget.value);\n }, []);\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const handleKeyDown = useKeyboardListNavigation(containerRef, isOpen, (index) => {\n if (viewportIds && viewportIds.length > 0) {\n setForwardChatId({ id: viewportIds[index === -1 ? 0 : index] });\n }\n }, '.ListItem-button', true);\n\n const modalHeader = (\n
\n \n \n \n \n
\n );\n\n return (\n \n {viewportIds?.length ? (\n \n {viewportIds.map((id) => (\n setForwardChatId({ id })}\n >\n {isChatPrivate(id) ? (\n \n ) : (\n \n )}\n \n ))}\n \n ) : viewportIds && !viewportIds.length ? (\n

Sorry, nothing found.

\n ) : (\n \n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chats: {\n byId: chatsById,\n listIds,\n orderedPinnedIds,\n },\n currentUserId,\n } = global;\n\n return {\n chatsById,\n pinnedIds: orderedPinnedIds.active,\n activeListIds: listIds.active,\n archivedListIds: listIds.archived,\n currentUserId,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['setForwardChatId', 'exitForwardMode', 'loadMoreChats']),\n)(ForwardPicker));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiError, ApiInviteInfo } from '../../api/types';\n\nimport getReadableErrorText from '../../util/getReadableErrorText';\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\nimport renderText from '../common/helpers/renderText';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nimport './Dialogs.scss';\n\ntype StateProps = {\n dialogs: (ApiError | ApiInviteInfo)[];\n};\n\ntype DispatchProps = Pick;\n\nconst Dialogs: FC = ({ dialogs, dismissDialog, acceptInviteConfirmation }) => {\n const lang = useLang();\n\n if (!dialogs.length) {\n return undefined;\n }\n\n const renderInvite = (invite: ApiInviteInfo) => {\n const {\n hash, title, participantsCount, isChannel,\n } = invite;\n\n const handleJoinClick = () => {\n acceptInviteConfirmation({\n hash,\n });\n dismissDialog();\n };\n\n const participantsText = isChannel\n ? lang('Subscribers', participantsCount, 'i')\n : lang('Members', participantsCount, 'i');\n\n const joinText = isChannel ? lang('ChannelJoin') : lang('JoinGroup');\n\n return (\n \n {participantsCount !== undefined &&

{participantsText}

}\n \n \n \n );\n };\n\n const renderError = (error: ApiError) => {\n return (\n \n {error.hasErrorKey ? getReadableErrorText(error) : renderText(error.message!, ['emoji', 'br'])}\n
\n \n
\n \n );\n };\n\n const renderDialog = (dialog: ApiError | ApiInviteInfo) => {\n if ('hash' in dialog) {\n return renderInvite(dialog);\n }\n\n return renderError(dialog);\n };\n\n return (\n
\n {dialogs.map(renderDialog)}\n
\n );\n};\n\nfunction getErrorHeader(error: ApiError) {\n if (error.isSlowMode) {\n return 'Slowmode enabled';\n }\n\n if (!error.hasErrorKey) {\n return 'Telegram';\n }\n\n return 'Something went wrong';\n}\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['dialogs']),\n (setGlobal, actions): DispatchProps => pick(actions, ['dismissDialog', 'acceptInviteConfirmation']),\n)(Dialogs));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiNotification } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport renderText from '../common/helpers/renderText';\n\nimport Notification from '../ui/Notification';\n\ntype StateProps = {\n notifications: ApiNotification[];\n};\n\ntype DispatchProps = Pick;\n\nconst Notifications: FC = ({ notifications, dismissNotification }) => {\n if (!notifications.length) {\n return undefined;\n }\n\n return (\n
\n {notifications.map(({ message, localId }) => (\n dismissNotification({ localId })}\n />\n ))}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['notifications']),\n (setGlobal, actions): DispatchProps => pick(actions, ['dismissNotification']),\n)(Notifications));\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\n\nimport ConfirmDialog from '../ui/ConfirmDialog';\n\nexport type OwnProps = {\n url?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst SafeLinkModal: FC = ({ url, toggleSafeLinkModal }) => {\n const lang = useLang();\n\n const handleOpen = useCallback(() => {\n window.open(url);\n toggleSafeLinkModal({ url: undefined });\n }, [toggleSafeLinkModal, url]);\n\n const handleDismiss = useCallback(() => {\n toggleSafeLinkModal({ url: undefined });\n }, [toggleSafeLinkModal]);\n\n const renderingUrl = useCurrentOrPrev(url);\n\n return (\n \n );\n};\n\nexport default memo(withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['toggleSafeLinkModal']),\n)(SafeLinkModal));\n","import React, {\n FC, memo, useState, useEffect, useMemo, useCallback,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport { formatTime, formatDateToString } from '../../util/dateFormat';\nimport useLang, { LangFn } from '../../hooks/useLang';\nimport usePrevious from '../../hooks/usePrevious';\nimport useFlag from '../../hooks/useFlag';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nimport './CalendarModal.scss';\n\nexport type OwnProps = {\n selectedAt?: number;\n maxAt?: number;\n isFutureMode?: boolean;\n isPastMode?: boolean;\n isOpen: boolean;\n withTimePicker?: boolean;\n submitButtonLabel?: string;\n secondButtonLabel?: string;\n onClose: () => void;\n onSubmit: (date: Date) => void;\n onSecondButtonClick?: NoneToVoidFunction;\n};\n\nconst WEEKDAY_LETTERS = [\n 'lng_weekday1',\n 'lng_weekday2',\n 'lng_weekday3',\n 'lng_weekday4',\n 'lng_weekday5',\n 'lng_weekday6',\n 'lng_weekday7',\n];\n\nconst CalendarModal: FC = ({\n selectedAt,\n maxAt,\n isFutureMode,\n isPastMode,\n isOpen,\n withTimePicker,\n submitButtonLabel,\n secondButtonLabel,\n onClose,\n onSubmit,\n onSecondButtonClick,\n}) => {\n const lang = useLang();\n const now = new Date();\n const defaultSelectedDate = useMemo(() => (selectedAt ? new Date(selectedAt) : new Date()), [selectedAt]);\n const maxDate = maxAt ? new Date(maxAt) : undefined;\n const prevIsOpen = usePrevious(isOpen);\n const [isTimeInputFocused, markTimeInputAsFocused, unmarkTimeInputAsFocused] = useFlag(false);\n\n const [selectedDate, setSelectedDate] = useState(defaultSelectedDate);\n const [currentMonthAndYear, setCurrentMonthAndYear] = useState(\n new Date(selectedDate.getFullYear(), selectedDate.getMonth(), 1),\n );\n const [selectedHours, setSelectedHours] = useState(\n formatInputTime(defaultSelectedDate.getHours()),\n );\n const [selectedMinutes, setSelectedMinutes] = useState(\n formatInputTime(defaultSelectedDate.getMinutes()),\n );\n\n const selectedDay = formatDay(selectedDate.getFullYear(), selectedDate.getMonth(), selectedDate.getDate());\n const currentYear = currentMonthAndYear.getFullYear();\n const currentMonth = currentMonthAndYear.getMonth();\n\n useEffect(() => {\n if (!prevIsOpen && isOpen) {\n setSelectedDate(defaultSelectedDate);\n setCurrentMonthAndYear(new Date(defaultSelectedDate.getFullYear(), defaultSelectedDate.getMonth(), 1));\n }\n }, [defaultSelectedDate, isOpen, prevIsOpen]);\n\n useEffect(() => {\n if (isFutureMode && !isTimeInputFocused && selectedDate.getTime() < defaultSelectedDate.getTime()) {\n setSelectedDate(defaultSelectedDate);\n setSelectedHours(formatInputTime(defaultSelectedDate.getHours()));\n setSelectedMinutes(formatInputTime(defaultSelectedDate.getMinutes()));\n }\n }, [defaultSelectedDate, isTimeInputFocused, isFutureMode, selectedDate]);\n\n const shouldDisableNextMonth = (isPastMode && currentYear >= now.getFullYear() && currentMonth >= now.getMonth())\n || (maxDate && currentYear >= maxDate.getFullYear() && currentMonth >= maxDate.getMonth());\n const shouldDisablePrevMonth = isFutureMode && currentYear <= now.getFullYear() && currentMonth <= now.getMonth();\n\n const { prevMonthGrid, currentMonthGrid, nextMonthGrid } = useMemo(() => (\n buildCalendarGrid(currentYear, currentMonth)\n ), [currentMonth, currentYear]);\n\n function handlePrevMonth() {\n setCurrentMonthAndYear((d) => {\n const dateCopy = new Date(d);\n dateCopy.setMonth(dateCopy.getMonth() - 1);\n\n return dateCopy;\n });\n }\n\n function handleNextMonth() {\n setCurrentMonthAndYear((d) => {\n const dateCopy = new Date(d);\n dateCopy.setMonth(dateCopy.getMonth() + 1);\n\n return dateCopy;\n });\n }\n\n function handleDateSelect(date: number) {\n setSelectedDate((d) => {\n const dateCopy = new Date(d);\n dateCopy.setDate(date);\n dateCopy.setMonth(currentMonth);\n dateCopy.setFullYear(currentYear);\n\n return dateCopy;\n });\n }\n\n function handleSubmit() {\n onSubmit(selectedDate);\n }\n\n const handleChangeHours = useCallback((e: React.ChangeEvent) => {\n const value = e.target.value.replace(/[^\\d]+/g, '');\n if (!value.length) {\n setSelectedHours('');\n e.target.value = '';\n return;\n }\n\n const hours = Math.max(0, Math.min(Number(value), 23));\n\n const date = new Date(selectedDate.getTime());\n date.setHours(hours);\n setSelectedDate(date);\n\n const hoursStr = formatInputTime(hours);\n setSelectedHours(hoursStr);\n e.target.value = hoursStr;\n }, [selectedDate]);\n\n const handleChangeMinutes = useCallback((e: React.ChangeEvent) => {\n const value = e.target.value.replace(/[^\\d]+/g, '');\n if (!value.length) {\n setSelectedMinutes('');\n e.target.value = '';\n return;\n }\n\n const minutes = Math.max(0, Math.min(Number(value), 59));\n\n const date = new Date(selectedDate.getTime());\n date.setMinutes(minutes);\n setSelectedDate(date);\n\n const minutesStr = formatInputTime(minutes);\n setSelectedMinutes(minutesStr);\n e.target.value = minutesStr;\n }, [selectedDate]);\n\n function renderTimePicker() {\n return (\n
\n \n :\n \n
\n );\n }\n\n return (\n \n
\n
\n \n \n \n\n

\n {lang(`lng_month${currentMonth + 1}`)}\n {' '}\n {currentYear}\n

\n\n \n \n \n\n \n \n \n
\n
\n\n
\n
\n {WEEKDAY_LETTERS.map((day) => (\n
\n {lang(day)}\n
\n ))}\n {prevMonthGrid.map((gridDate) => (\n
{gridDate}
\n ))}\n {currentMonthGrid.map((gridDate) => (\n handleDateSelect(gridDate)}\n className={buildClassName(\n 'day-button',\n isDisabledDay(\n currentYear, currentMonth, gridDate, isFutureMode ? now : undefined, isPastMode ? now : maxDate,\n )\n ? 'disabled'\n : `${gridDate ? 'clickable' : ''}`,\n selectedDay === formatDay(currentYear, currentMonth, gridDate) && 'selected',\n )}\n >\n {!!gridDate && (\n {gridDate}\n )}\n
\n ))}\n {nextMonthGrid.map((gridDate) => (\n
{gridDate}
\n ))}\n
\n \n\n {withTimePicker && renderTimePicker()}\n\n
\n \n {secondButtonLabel && (\n \n )}\n
\n \n );\n};\n\nfunction buildCalendarGrid(year: number, month: number) {\n const prevMonthGrid: number[] = [];\n const currentMonthGrid: number[] = [];\n const nextMonthGrid: number[] = [];\n\n const date = new Date();\n date.setDate(1);\n date.setMonth(month);\n date.setFullYear(year);\n const firstDay = date.getDay();\n const totalDaysInPrevMonth = new Date(year, month, 0).getDate();\n\n for (let i = 1; i < firstDay; i++) {\n prevMonthGrid.push(totalDaysInPrevMonth - firstDay + i + 1);\n }\n\n while (date.getMonth() === month) {\n const gridDate = date.getDate();\n currentMonthGrid.push(gridDate);\n date.setDate(gridDate + 1);\n }\n\n const lastRowDaysCount = (currentMonthGrid.length + prevMonthGrid.length) % 7;\n if (lastRowDaysCount > 0) {\n for (let i = 1; i <= 7 - lastRowDaysCount; i++) {\n nextMonthGrid.push(i);\n }\n }\n\n return { prevMonthGrid, currentMonthGrid, nextMonthGrid };\n}\n\nfunction isDisabledDay(year: number, month: number, day: number, minDate?: Date, maxDate?: Date) {\n const selectedDay = new Date(year, month, day, 0, 0, 0, 0);\n const fixedMinDate = minDate && new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate(), 0, 0, 0, 0);\n const fixedMaxDate = maxDate && new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate(), 0, 0, 0, 0);\n\n if (fixedMaxDate && selectedDay > fixedMaxDate) {\n return true;\n } else if (fixedMinDate && selectedDay < fixedMinDate) {\n return true;\n }\n\n return false;\n}\n\nfunction formatInputTime(value: string | number) {\n return String(value).padStart(2, '0');\n}\n\nfunction formatDay(year: number, month: number, day: number) {\n return `${year}-${month + 1}-${day}`;\n}\n\nfunction formatSubmitLabel(lang: LangFn, date: Date) {\n const day = formatDateToString(date, lang.code);\n const today = formatDateToString(new Date(), lang.code);\n\n if (day === today) {\n return lang('Conversation.ScheduleMessage.SendToday', formatTime(date));\n }\n\n return lang('Conversation.ScheduleMessage.SendOn', [day, formatTime(date)]);\n}\n\nexport default memo(CalendarModal);\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport CalendarModal from '../common/CalendarModal';\n\nexport type OwnProps = {\n isOpen: boolean;\n};\n\ntype StateProps = {\n selectedAt?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst HistoryCalendar: FC = ({\n isOpen, selectedAt, searchMessagesByDate, closeHistoryCalendar,\n}) => {\n const handleJumpToDate = useCallback((date: Date) => {\n searchMessagesByDate({ timestamp: date.valueOf() / 1000 });\n closeHistoryCalendar();\n }, [closeHistoryCalendar, searchMessagesByDate]);\n\n const lang = useLang();\n\n return (\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n selectedAt: global.historyCalendarSelectedAt,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesByDate', 'closeHistoryCalendar',\n ]),\n)(HistoryCalendar));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../api/types';\nimport { IAlbum } from '../../types';\n\nimport { GlobalActions } from '../../global/types';\n\nimport {\n selectAllowedMessageActions,\n selectChat,\n selectCurrentMessageList,\n selectUser,\n} from '../../modules/selectors';\nimport {\n isChatPrivate,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n} from '../../modules/helpers';\nimport renderText from './helpers/renderText';\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n isSchedule: boolean;\n message: ApiMessage;\n album?: IAlbum;\n onClose: () => void;\n};\n\ntype StateProps = {\n canDeleteForAll?: boolean;\n contactName?: string;\n willDeleteForCurrentUserOnly?: boolean;\n willDeleteForAll?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst DeleteMessageModal: FC = ({\n isOpen,\n isSchedule,\n message,\n album,\n canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n onClose,\n deleteMessages,\n deleteScheduledMessages,\n}) => {\n const handleDeleteMessageForAll = useCallback(() => {\n const messageIds = album?.messages\n ? album.messages.map(({ id }) => id)\n : [message.id];\n deleteMessages({ messageIds, shouldDeleteForAll: true });\n onClose();\n }, [deleteMessages, message.id, onClose, album]);\n\n const handleDeleteMessageForSelf = useCallback(() => {\n const messageIds = album?.messages\n ? album.messages.map(({ id }) => id)\n : [message.id];\n if (isSchedule) {\n deleteScheduledMessages({ messageIds });\n } else {\n deleteMessages({\n messageIds,\n shouldDeleteForAll: false,\n });\n }\n onClose();\n }, [album, message.id, isSchedule, onClose, deleteScheduledMessages, deleteMessages]);\n\n const lang = useLang();\n\n return (\n \n

{lang('AreYouSureDeleteSingleMessage')}

\n {willDeleteForCurrentUserOnly && (\n

{lang('lng_delete_for_me_chat_hint', 1, 'i')}

\n )}\n {willDeleteForAll && (\n

{lang('lng_delete_for_everyone_hint', 1, 'i')}

\n )}\n {canDeleteForAll && (\n \n )}\n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { message, isSchedule }): StateProps => {\n const { threadId } = selectCurrentMessageList(global) || {};\n const { canDeleteForAll } = (threadId && selectAllowedMessageActions(global, message, threadId)) || {};\n const chat = selectChat(global, message.chatId);\n const contactName = chat && isChatPrivate(chat.id)\n ? getUserFirstOrLastName(selectUser(global, getPrivateChatUserId(chat)!))\n : undefined;\n\n const willDeleteForCurrentUserOnly = chat && isChatBasicGroup(chat) && !canDeleteForAll;\n const willDeleteForAll = chat && isChatSuperGroup(chat);\n\n return {\n canDeleteForAll: !isSchedule && canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'deleteMessages', 'deleteScheduledMessages',\n ]),\n)(DeleteMessageModal));\n","import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { selectChat, selectIsChatWithSelf, selectUser } from '../../modules/selectors';\nimport {\n isChatPrivate,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n isChatChannel,\n} from '../../modules/helpers';\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\nimport renderText from './helpers/renderText';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n chatId: number;\n messageId: number;\n onClose: () => void;\n};\n\ntype StateProps = {\n isChannel: boolean;\n isPrivateChat: boolean;\n isChatWithSelf: boolean;\n isGroup: boolean;\n isSuperGroup: boolean;\n canPinForAll: boolean;\n contactName?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst PinMessageModal: FC = ({\n isOpen,\n messageId,\n chatId,\n isChannel,\n isGroup,\n isSuperGroup,\n canPinForAll,\n contactName,\n onClose,\n pinMessage,\n}) => {\n const handlePinMessageForAll = useCallback(() => {\n pinMessage({\n chatId, messageId, isUnpin: false,\n });\n onClose();\n }, [pinMessage, chatId, messageId, onClose]);\n\n const handlePinMessage = useCallback(() => {\n pinMessage({\n chatId, messageId, isUnpin: false, isOneSide: true, isSilent: true,\n });\n onClose();\n }, [chatId, messageId, onClose, pinMessage]);\n\n const lang = useLang();\n\n function renderMessage() {\n if (isChannel) {\n return lang('PinMessageAlertChannel');\n }\n\n if (isGroup || isSuperGroup) {\n return lang('PinMessageAlert');\n }\n\n return lang('PinMessageAlertChat');\n }\n\n return (\n \n

{renderMessage()}

\n \n {canPinForAll && (\n \n )}\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const isPrivateChat = isChatPrivate(chatId);\n const isChatWithSelf = selectIsChatWithSelf(global, chatId);\n const chat = selectChat(global, chatId);\n const isChannel = !!chat && isChatChannel(chat);\n const isGroup = !!chat && isChatBasicGroup(chat);\n const isSuperGroup = !!chat && isChatSuperGroup(chat);\n const canPinForAll = (isPrivateChat && !isChatWithSelf) || isSuperGroup || isGroup;\n const contactName = chat && isChatPrivate(chat.id)\n ? getUserFirstOrLastName(selectUser(global, getPrivateChatUserId(chat)!))\n : undefined;\n\n return {\n isPrivateChat,\n isChatWithSelf,\n isChannel,\n isGroup,\n isSuperGroup,\n canPinForAll,\n contactName,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['pinMessage']),\n)(PinMessageModal));\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n chatId?: number;\n pinnedMessagesCount?: number;\n onClose: () => void;\n onUnpin: () => void;\n};\n\nconst UnpinAllMessagesModal: FC = ({\n isOpen,\n pinnedMessagesCount = 0,\n onClose,\n onUnpin,\n}) => {\n const lang = useLang();\n\n return (\n \n

{lang('Chat.UnpinAllMessagesConfirmation', pinnedMessagesCount, 'i')}

\n \n \n \n );\n};\n\nexport default memo(UnpinAllMessagesModal);\n","import React, {\n FC, useCallback, memo, useEffect,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { selectCanDeleteSelectedMessages, selectCurrentChat, selectUser } from '../../modules/selectors';\nimport {\n isChatPrivate,\n getUserFirstOrLastName,\n getPrivateChatUserId,\n isChatBasicGroup,\n isChatSuperGroup,\n} from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\nimport usePrevious from '../../hooks/usePrevious';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n isSchedule: boolean;\n onClose: () => void;\n};\n\ntype StateProps = {\n selectedMessageIds?: number[];\n canDeleteForAll?: boolean;\n contactName?: string;\n willDeleteForCurrentUserOnly?: boolean;\n willDeleteForAll?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst DeleteSelectedMessageModal: FC = ({\n isOpen,\n isSchedule,\n selectedMessageIds,\n canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n onClose,\n deleteMessages,\n deleteScheduledMessages,\n exitMessageSelectMode,\n}) => {\n const prevIsOpen = usePrevious(isOpen);\n\n const handleDeleteMessageForAll = useCallback(() => {\n onClose();\n deleteMessages({ messageIds: selectedMessageIds, shouldDeleteForAll: true });\n }, [deleteMessages, selectedMessageIds, onClose]);\n\n const handleDeleteMessageForSelf = useCallback(() => {\n if (isSchedule) {\n deleteScheduledMessages({ messageIds: selectedMessageIds });\n } else {\n deleteMessages({ messageIds: selectedMessageIds, shouldDeleteForAll: false });\n }\n\n onClose();\n }, [isSchedule, onClose, deleteScheduledMessages, selectedMessageIds, deleteMessages]);\n\n const lang = useLang();\n\n // Returning `undefined` from FC instead of `` doesn't trigger useHistoryBack\n useEffect(() => {\n if (!isOpen && prevIsOpen) {\n exitMessageSelectMode();\n }\n }, [exitMessageSelectMode, isOpen, prevIsOpen]);\n\n if (!selectedMessageIds) {\n return undefined;\n }\n\n return (\n \n

{lang('AreYouSureDeleteFewMessages')}

\n {willDeleteForCurrentUserOnly && (\n

This will delete them just for you, not for other participants in the chat.

\n )}\n {willDeleteForAll && (\n

This will delete them for everyone in this chat.

\n )}\n {canDeleteForAll && (\n \n )}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { isSchedule }): StateProps => {\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n const { canDeleteForAll } = selectCanDeleteSelectedMessages(global);\n const chat = selectCurrentChat(global);\n const contactName = chat && isChatPrivate(chat.id)\n ? getUserFirstOrLastName(selectUser(global, getPrivateChatUserId(chat)!))\n : undefined;\n\n const willDeleteForCurrentUserOnly = chat && isChatBasicGroup(chat) && !canDeleteForAll;\n const willDeleteForAll = chat && isChatSuperGroup(chat);\n\n return {\n selectedMessageIds,\n canDeleteForAll: !isSchedule && canDeleteForAll,\n contactName,\n willDeleteForCurrentUserOnly,\n willDeleteForAll,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'deleteMessages',\n 'deleteScheduledMessages',\n 'exitMessageSelectMode',\n ]),\n)(DeleteSelectedMessageModal));\n","import { ChangeEvent } from 'react';\n\nimport React, {\n FC, memo, useCallback, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiReportReason } from '../../api/types';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\nimport RadioGroup from '../ui/RadioGroup';\nimport InputText from '../ui/InputText';\n\nexport type OwnProps = {\n isOpen: boolean;\n messageIds?: number[];\n onClose: () => void;\n};\n\ntype DispatchProps = Pick;\n\nconst ReportMessageModal: FC = ({\n isOpen,\n messageIds,\n reportMessages,\n exitMessageSelectMode,\n onClose,\n}) => {\n const [selectedReason, setSelectedReason] = useState('spam');\n const [description, setDescription] = useState('');\n\n const handleReport = () => {\n reportMessages({ messageIds, reason: selectedReason, description });\n exitMessageSelectMode();\n onClose();\n };\n\n const handleSelectReason = useCallback((value: string) => {\n setSelectedReason(value as ApiReportReason);\n }, []);\n\n const handleDescriptionChange = useCallback((e: ChangeEvent) => {\n setDescription(e.target.value);\n }, []);\n\n const lang = useLang();\n\n const REPORT_OPTIONS: { value: ApiReportReason; label: string }[] = [\n { value: 'spam', label: lang('lng_report_reason_spam') },\n { value: 'violence', label: lang('lng_report_reason_violence') },\n { value: 'pornography', label: lang('lng_report_reason_pornography') },\n { value: 'childAbuse', label: lang('lng_report_reason_child_abuse') },\n { value: 'copyright', label: lang('ReportPeer.ReasonCopyright') },\n { value: 'other', label: lang('lng_report_reason_other') },\n ];\n\n if (!messageIds) {\n return undefined;\n }\n\n return (\n \n \n \n \n \n \n );\n};\n\nexport default memo(withGlobal(\n undefined, (setGlobal, actions): DispatchProps => pick(actions, [\n 'reportMessages', 'exitMessageSelectMode',\n ]),\n)(ReportMessageModal));\n","import React, { FC, memo, useEffect } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, MessageListType } from '../../global/types';\n\nimport {\n selectCanDeleteSelectedMessages,\n selectCanReportSelectedMessages,\n selectCurrentMessageList,\n selectSelectedMessagesCount,\n} from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\nimport useFlag from '../../hooks/useFlag';\nimport captureKeyboardListeners from '../../util/captureKeyboardListeners';\nimport buildClassName from '../../util/buildClassName';\nimport usePrevious from '../../hooks/usePrevious';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport MenuItem from '../ui/MenuItem';\n\nimport DeleteSelectedMessageModal from './DeleteSelectedMessageModal';\nimport ReportMessageModal from '../common/ReportMessageModal';\n\nimport './MessageSelectToolbar.scss';\n\nexport type OwnProps = {\n isActive?: boolean;\n canPost?: boolean;\n messageListType?: MessageListType;\n};\n\ntype StateProps = {\n isSchedule: boolean;\n selectedMessagesCount?: number;\n canDeleteMessages?: boolean;\n canReportMessages?: boolean;\n selectedMessageIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst MessageSelectToolbar: FC = ({\n canPost,\n isActive,\n messageListType,\n isSchedule,\n selectedMessagesCount,\n canDeleteMessages,\n canReportMessages,\n selectedMessageIds,\n exitMessageSelectMode,\n openForwardMenuForSelectedMessages,\n}) => {\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n const [isReportModalOpen, openReportModal, closeReportModal] = useFlag();\n\n useEffect(() => {\n return isActive && !isDeleteModalOpen && !isReportModalOpen\n ? captureKeyboardListeners({\n onBackspace: openDeleteModal,\n onDelete: openDeleteModal,\n onEsc: exitMessageSelectMode,\n })\n : undefined;\n }, [isActive, isDeleteModalOpen, isReportModalOpen, openDeleteModal, exitMessageSelectMode]);\n\n const prevSelectedMessagesCount = usePrevious(selectedMessagesCount || undefined, true);\n const renderingSelectedMessagesCount = isActive ? selectedMessagesCount : prevSelectedMessagesCount;\n\n const lang = useLang();\n\n const formattedMessagesCount = lang('VoiceOver.Chat.MessagesSelected', renderingSelectedMessagesCount);\n\n const className = buildClassName(\n 'MessageSelectToolbar',\n canPost && 'with-composer',\n isActive && 'shown',\n );\n\n return (\n
\n
\n \n \n \n \n {formattedMessagesCount}\n \n\n {!!selectedMessagesCount && (\n
\n {messageListType !== 'scheduled' && (\n \n \n {lang('Forward')}\n \n \n )}\n {canReportMessages && (\n \n \n {lang('Report')}\n \n \n )}\n \n \n {lang('Delete')}\n \n \n
\n )}\n
\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { type: messageListType } = selectCurrentMessageList(global) || {};\n const { canDelete } = selectCanDeleteSelectedMessages(global);\n const canReport = selectCanReportSelectedMessages(global);\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n\n return {\n isSchedule: messageListType === 'scheduled',\n selectedMessagesCount: selectSelectedMessagesCount(global),\n canDeleteMessages: canDelete,\n canReportMessages: canReport,\n selectedMessageIds,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['exitMessageSelectMode', 'openForwardMenuForSelectedMessages']),\n)(MessageSelectToolbar));\n","import { useCallback, useEffect, useRef } from '../lib/teact/teact';\n\nexport default (\n onSelect: NoneToVoidFunction,\n) => {\n // eslint-disable-next-line no-null/no-null\n const buttonRef = useRef(null);\n\n const handleKeyDown = useCallback((e: KeyboardEvent) => {\n if (e.key !== 'Enter') return;\n const isFocused = buttonRef.current === document.activeElement;\n\n if (isFocused) {\n onSelect();\n }\n }, [onSelect]);\n\n useEffect(() => {\n window.addEventListener('keydown', handleKeyDown, false);\n\n return () => window.removeEventListener('keydown', handleKeyDown);\n }, [handleKeyDown]);\n\n return buttonRef;\n};\n","import React, {\n FC, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport useChatContextActions from '../../../hooks/useChatContextActions';\nimport useFlag from '../../../hooks/useFlag';\nimport { isChatPrivate, getPrivateChatUserId, selectIsChatMuted } from '../../../modules/helpers';\nimport {\n selectChat, selectUser, selectIsChatPinned, selectNotifySettings, selectNotifyExceptions,\n} from '../../../modules/selectors';\nimport useSelectWithEnter from '../../../hooks/useSelectWithEnter';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport GroupChatInfo from '../../common/GroupChatInfo';\nimport DeleteChatModal from '../../common/DeleteChatModal';\nimport ListItem from '../../ui/ListItem';\n\ntype OwnProps = {\n chatId: number;\n withUsername?: boolean;\n onClick: (id: number) => void;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n privateChatUser?: ApiUser;\n isPinned?: boolean;\n isMuted?: boolean;\n};\n\nconst LeftSearchResultChat: FC = ({\n chatId,\n chat,\n privateChatUser,\n isPinned,\n isMuted,\n withUsername,\n onClick,\n}) => {\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();\n\n const contextActions = useChatContextActions({\n chat,\n privateChatUser,\n isPinned,\n isMuted,\n handleDelete: openDeleteModal,\n }, true);\n\n const handleClick = () => {\n onClick(chatId);\n };\n\n const buttonRef = useSelectWithEnter(handleClick);\n\n if (!chat) {\n return undefined;\n }\n\n return (\n \n {isChatPrivate(chatId) ? (\n \n ) : (\n \n )}\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const privateChatUserId = chat && getPrivateChatUserId(chat);\n const privateChatUser = privateChatUserId ? selectUser(global, privateChatUserId) : undefined;\n const isPinned = selectIsChatPinned(global, chatId);\n const isMuted = chat\n ? selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global))\n : undefined;\n\n return {\n chat,\n privateChatUser,\n isPinned,\n isMuted,\n };\n },\n)(LeftSearchResultChat));\n","import React, {\n FC, useEffect, useCallback, useRef, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiUser } from '../../../api/types';\n\nimport { getUserFirstOrLastName } from '../../../modules/helpers';\nimport renderText from '../../common/helpers/renderText';\nimport { throttle } from '../../../util/schedulers';\nimport { pick } from '../../../util/iteratees';\nimport useHorizontalScroll from '../../../hooks/useHorizontalScroll';\nimport useLang from '../../../hooks/useLang';\n\nimport Avatar from '../../common/Avatar';\nimport Button from '../../ui/Button';\nimport LeftSearchResultChat from './LeftSearchResultChat';\n\nimport './RecentContacts.scss';\n\ntype OwnProps = {\n onReset: () => void;\n};\n\ntype StateProps = {\n topUserIds?: number[];\n usersById: Record;\n recentlyFoundChatIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst SEARCH_CLOSE_TIMEOUT_MS = 250;\nconst NBSP = '\\u00A0';\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst RecentContacts: FC = ({\n topUserIds, usersById, recentlyFoundChatIds,\n onReset, loadTopUsers, loadContactList, openChat,\n addRecentlyFoundChatId, clearRecentlyFoundChats,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const topUsersRef = useRef(null);\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadTopUsers();\n // Loading full contact list for quick local search before user enters the query\n loadContactList();\n });\n }, [loadTopUsers, loadContactList]);\n\n useHorizontalScroll(topUsersRef.current, !topUserIds);\n\n const handleClick = useCallback(\n (id: number) => {\n openChat({ id, shouldReplaceHistory: true });\n onReset();\n setTimeout(() => {\n addRecentlyFoundChatId({ id });\n }, SEARCH_CLOSE_TIMEOUT_MS);\n },\n [openChat, addRecentlyFoundChatId, onReset],\n );\n\n const lang = useLang();\n\n return (\n
\n {topUserIds && (\n
\n
\n {topUserIds.map((userId) => (\n
handleClick(userId)} dir={lang.isRtl ? 'rtl' : undefined}>\n \n
{renderText(getUserFirstOrLastName(usersById[userId]) || NBSP)}
\n
\n ))}\n
\n
\n )}\n {recentlyFoundChatIds && (\n
\n

\n {lang('Recent')}\n\n \n \n \n

\n {recentlyFoundChatIds.map((id) => (\n \n ))}\n
\n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { userIds: topUserIds } = global.topPeers;\n const usersById = global.users.byId;\n const { recentlyFoundChatIds } = global.globalSearch;\n\n return {\n topUserIds,\n usersById,\n recentlyFoundChatIds,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadTopUsers',\n 'loadContactList',\n 'openChat',\n 'addRecentlyFoundChatId',\n 'clearRecentlyFoundChats',\n ]),\n)(RecentContacts));\n","import React, {\n FC, memo, useCallback,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport {\n ApiChat, ApiUser, ApiMessage, ApiMessageOutgoingStatus,\n} from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport {\n getChatTitle,\n getPrivateChatUserId,\n getMessageMediaHash,\n getMessageSummaryText,\n getMessageMediaThumbDataUri,\n getMessageVideo,\n getMessageRoundVideo,\n} from '../../../modules/helpers';\nimport { selectChat, selectUser } from '../../../modules/selectors';\nimport renderText from '../../common/helpers/renderText';\nimport { pick } from '../../../util/iteratees';\nimport useMedia from '../../../hooks/useMedia';\nimport { formatPastTimeShort } from '../../../util/dateFormat';\nimport useLang, { LangFn } from '../../../hooks/useLang';\nimport useSelectWithEnter from '../../../hooks/useSelectWithEnter';\n\nimport Avatar from '../../common/Avatar';\nimport VerifiedIcon from '../../common/VerifiedIcon';\nimport ListItem from '../../ui/ListItem';\nimport Link from '../../ui/Link';\n\nimport './ChatMessage.scss';\n\ntype OwnProps = {\n searchQuery?: string;\n message: ApiMessage;\n chatId: number;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n privateChatUser?: ApiUser;\n lastMessageOutgoingStatus?: ApiMessageOutgoingStatus;\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst ChatMessage: FC = ({\n message,\n searchQuery,\n chatId,\n chat,\n privateChatUser,\n focusMessage,\n lastSyncTime,\n}) => {\n const mediaThumbnail = getMessageMediaThumbDataUri(message);\n const mediaBlobUrl = useMedia(getMessageMediaHash(message, 'micro'));\n const isRoundVideo = Boolean(getMessageRoundVideo(message));\n\n const handleClick = useCallback(() => {\n focusMessage({ chatId, messageId: message.id });\n }, [chatId, focusMessage, message.id]);\n\n const lang = useLang();\n\n const buttonRef = useSelectWithEnter(handleClick);\n\n if (!chat) {\n return undefined;\n }\n\n return (\n \n \n
\n
\n
\n

{renderText(getChatTitle(lang, chat, privateChatUser))}

\n {chat.isVerified && }\n
\n
\n \n {formatPastTimeShort(lang, message.date * 1000)}\n \n
\n\n
\n
\n
\n {renderMessageSummary(lang, message, mediaBlobUrl || mediaThumbnail, searchQuery, isRoundVideo)}\n
\n
\n
\n \n );\n};\n\nfunction renderMessageSummary(\n lang: LangFn, message: ApiMessage, blobUrl?: string, searchQuery?: string, isRoundVideo?: boolean,\n) {\n if (!blobUrl) {\n return renderText(getMessageSummaryText(lang, message));\n }\n\n return (\n \n \"\"\n {getMessageVideo(message) && }\n {renderText(getMessageSummaryText(lang, message, true), ['emoji', 'highlight'], { highlight: searchQuery })}\n \n );\n}\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n if (!chat) {\n return {};\n }\n\n const privateChatUserId = getPrivateChatUserId(chat);\n\n return {\n chat,\n lastSyncTime: global.lastSyncTime,\n ...(privateChatUserId && { privateChatUser: selectUser(global, privateChatUserId) }),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'focusMessage',\n ]),\n)(ChatMessage));\n","import React, { FC, memo, useMemo } from '../../../lib/teact/teact';\nimport { formatDateToString } from '../../../util/dateFormat';\n\nimport './DateSuggest.scss';\n\nconst SUGGESTION_COUNT = 8;\n\nexport type OwnProps = {\n searchDate: string;\n onSelect: (value: Date) => void;\n};\n\nconst DateSuggest: FC = ({\n searchDate, onSelect,\n}) => {\n const suggestions = useMemo(() => getSuggestionsFromDate(searchDate), [searchDate]);\n return (\n
\n {suggestions.map(({ date, text }) => {\n return (\n onSelect(date)}\n className=\"date-item\"\n key={text}\n >\n \n {text}\n \n );\n })}\n
\n );\n};\n\nfunction getSuggestionsFromDate(searchDate: string) {\n const hasYear = searchDate.match(/^\\d{2,4}-\\d{2}-\\d{2}$/g);\n if (hasYear) {\n const date = new Date(searchDate);\n return [{ date, text: formatDateToString(date) }];\n }\n\n const suggestion = [];\n const currentDate = new Date();\n const currentYear = currentDate.getFullYear();\n const latestYear = currentDate.getTime() > (new Date(`${currentYear}-${searchDate}`)).getTime()\n ? currentYear\n : currentYear - 1;\n\n for (let i = 0; i < SUGGESTION_COUNT; i++) {\n const date = new Date(`${latestYear - i}-${searchDate}`);\n suggestion.push({ date, text: formatDateToString(date) });\n }\n\n return suggestion;\n}\n\nexport default memo(DateSuggest);\n","import React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiUser, ApiChat, ApiMessage } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport searchWords from '../../../util/searchWords';\nimport { unique, pick } from '../../../util/iteratees';\nimport { getUserFullName, getMessageSummaryText, sortChatIds } from '../../../modules/helpers';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { throttle } from '../../../util/schedulers';\nimport useLang from '../../../hooks/useLang';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport LeftSearchResultChat from './LeftSearchResultChat';\nimport RecentContacts from './RecentContacts';\nimport ChatMessage from './ChatMessage';\nimport DateSuggest from './DateSuggest';\nimport Link from '../../ui/Link';\nimport NothingFound from '../../common/NothingFound';\nimport PickerSelectedItem from '../../common/PickerSelectedItem';\n\nexport type OwnProps = {\n searchQuery?: string;\n dateSearchQuery?: string;\n searchDate?: number;\n onReset: () => void;\n onSearchDateSelect: (value: Date) => void;\n};\n\ntype StateProps = {\n currentUserId?: number;\n localContactIds?: number[];\n localChatIds?: number[];\n localUserIds?: number[];\n globalChatIds?: number[];\n globalUserIds?: number[];\n foundIds?: string[];\n globalMessagesByChatId?: Record }>;\n chatsById: Record;\n usersById: Record;\n fetchingStatus?: { chats?: boolean; messages?: boolean };\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst MIN_QUERY_LENGTH_FOR_GLOBAL_SEARCH = 4;\nconst LESS_LIST_ITEMS_AMOUNT = 3;\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst ChatResults: FC = ({\n searchQuery, searchDate, dateSearchQuery, currentUserId,\n localContactIds, localChatIds, localUserIds, globalChatIds, globalUserIds,\n foundIds, globalMessagesByChatId, chatsById, usersById, fetchingStatus, lastSyncTime,\n onReset, onSearchDateSelect, openChat, addRecentlyFoundChatId, searchMessagesGlobal, setGlobalSearchChatId,\n}) => {\n const lang = useLang();\n\n const [shouldShowMoreLocal, setShouldShowMoreLocal] = useState(false);\n const [shouldShowMoreGlobal, setShouldShowMoreGlobal] = useState(false);\n\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: 'text',\n query: searchQuery,\n });\n });\n }\n }, [lastSyncTime, searchMessagesGlobal, searchQuery]);\n\n const handleChatClick = useCallback(\n (id: number) => {\n openChat({ id, shouldReplaceHistory: true });\n\n if (id !== currentUserId) {\n addRecentlyFoundChatId({ id });\n }\n\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n onReset();\n }\n },\n [currentUserId, openChat, addRecentlyFoundChatId, onReset],\n );\n\n const handlePickerItemClick = useCallback((id: number) => {\n setGlobalSearchChatId({ id });\n }, [setGlobalSearchChatId]);\n\n const localResults = useMemo(() => {\n if (!searchQuery || (searchQuery.startsWith('@') && searchQuery.length < 2)) {\n return MEMO_EMPTY_ARRAY;\n }\n\n const foundContactIds = localContactIds\n ? localContactIds.filter((id) => {\n const user = usersById[id];\n if (!user) {\n return false;\n }\n\n const fullName = getUserFullName(user);\n return (fullName && searchWords(fullName, searchQuery)) || searchWords(user.username, searchQuery);\n })\n : [];\n\n return [\n ...(currentUserId && searchWords(lang('SavedMessages'), searchQuery) ? [currentUserId] : []),\n ...sortChatIds(unique([\n ...foundContactIds,\n ...(localChatIds || []),\n ...(localUserIds || []),\n ]), chatsById),\n ];\n }, [\n searchQuery, localContactIds, currentUserId, lang, localChatIds, localUserIds, chatsById, usersById,\n ]);\n\n const globalResults = useMemo(() => {\n if (!searchQuery || searchQuery.length < MIN_QUERY_LENGTH_FOR_GLOBAL_SEARCH || !globalChatIds || !globalUserIds) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return sortChatIds(unique([...globalChatIds, ...globalUserIds]),\n chatsById, true);\n }, [chatsById, globalChatIds, globalUserIds, searchQuery]);\n\n const foundMessages = useMemo(() => {\n if ((!searchQuery && !searchDate) || !foundIds || foundIds.length === 0) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds\n .map((id) => {\n const [chatId, messageId] = id.split('_').map(Number);\n\n return globalMessagesByChatId?.[chatId]?.byId[messageId];\n })\n .filter(Boolean as any)\n .sort((a, b) => b.date - a.date);\n }, [foundIds, globalMessagesByChatId, searchQuery, searchDate]);\n\n const handleClickShowMoreLocal = useCallback(() => {\n setShouldShowMoreLocal(!shouldShowMoreLocal);\n }, [shouldShowMoreLocal]);\n\n const handleClickShowMoreGlobal = useCallback(() => {\n setShouldShowMoreGlobal(!shouldShowMoreGlobal);\n }, [shouldShowMoreGlobal]);\n\n function renderFoundMessage(message: ApiMessage) {\n const text = getMessageSummaryText(lang, message);\n const chat = chatsById[message.chatId];\n\n if (!text || !chat) {\n return undefined;\n }\n\n return (\n \n );\n }\n\n const nothingFound = fetchingStatus && !fetchingStatus.chats && !fetchingStatus.messages\n && !localResults.length && !globalResults.length && !foundMessages.length;\n\n if (!searchQuery && !searchDate) {\n return ;\n }\n\n return (\n \n {dateSearchQuery && (\n
\n \n
\n )}\n {nothingFound && (\n \n )}\n {!!localResults.length && (\n
\n {localResults.map((id) => (\n \n ))}\n
\n )}\n {!!localResults.length && (\n
\n

\n {localResults.length > LESS_LIST_ITEMS_AMOUNT && (\n \n {lang(shouldShowMoreLocal ? 'ChatList.Search.ShowLess' : 'ChatList.Search.ShowMore')}\n \n )}\n {lang('DialogList.SearchSectionDialogs')}\n

\n {localResults.map((id, index) => {\n if (!shouldShowMoreLocal && index >= LESS_LIST_ITEMS_AMOUNT) {\n return undefined;\n }\n\n return (\n \n );\n })}\n
\n )}\n {!!globalResults.length && (\n
\n

\n {globalResults.length > LESS_LIST_ITEMS_AMOUNT && (\n \n {lang(shouldShowMoreGlobal ? 'ChatList.Search.ShowLess' : 'ChatList.Search.ShowMore')}\n \n )}\n {lang('DialogList.SearchSectionGlobal')}\n

\n {globalResults.map((id, index) => {\n if (!shouldShowMoreGlobal && index >= LESS_LIST_ITEMS_AMOUNT) {\n return undefined;\n }\n\n return (\n \n );\n })}\n
\n )}\n {!!foundMessages.length && (\n
\n

{lang('SearchMessages')}

\n {foundMessages.map(renderFoundMessage)}\n
\n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { byId: chatsById } = global.chats;\n const { byId: usersById } = global.users;\n\n const { userIds: localContactIds } = global.contactList || {};\n\n if (!localContactIds) {\n return {\n chatsById,\n usersById,\n };\n }\n\n const {\n currentUserId, messages, lastSyncTime,\n } = global;\n const {\n fetchingStatus, globalResults, localResults, resultsByType,\n } = global.globalSearch;\n const { chatIds: globalChatIds, userIds: globalUserIds } = globalResults || {};\n const { chatIds: localChatIds, userIds: localUserIds } = localResults || {};\n const { byChatId: globalMessagesByChatId } = messages;\n const foundIds = resultsByType?.text?.foundIds;\n\n return {\n currentUserId,\n localContactIds,\n localChatIds,\n localUserIds,\n globalChatIds,\n globalUserIds,\n foundIds,\n globalMessagesByChatId,\n chatsById,\n usersById,\n fetchingStatus,\n lastSyncTime,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openChat',\n 'addRecentlyFoundChatId',\n 'searchMessagesGlobal',\n 'setGlobalSearchChatId',\n ]),\n)(ChatResults));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiMessage } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport { getMessageSummaryText } from '../../../modules/helpers';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { throttle } from '../../../util/schedulers';\nimport useLang from '../../../hooks/useLang';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport ChatMessage from './ChatMessage';\nimport NothingFound from '../../common/NothingFound';\nimport DateSuggest from './DateSuggest';\n\nexport type OwnProps = {\n searchQuery?: string;\n dateSearchQuery?: string;\n onReset: () => void;\n onSearchDateSelect: (value: Date) => void;\n};\n\ntype StateProps = {\n currentUserId?: number;\n foundIds?: string[];\n globalMessagesByChatId?: Record }>;\n chatsById: Record;\n fetchingStatus?: { chats?: boolean; messages?: boolean };\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst ChatMessageResults: FC = ({\n searchQuery,\n currentUserId,\n dateSearchQuery,\n foundIds,\n globalMessagesByChatId,\n chatsById,\n fetchingStatus,\n lastSyncTime,\n searchMessagesGlobal,\n onSearchDateSelect,\n}) => {\n const lang = useLang();\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: 'text',\n query: searchQuery,\n chatId: currentUserId,\n });\n });\n }\n }, [currentUserId, lastSyncTime, searchMessagesGlobal, searchQuery]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || foundIds.length === 0) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds\n .map((id) => {\n const [chatId, messageId] = id.split('_').map(Number);\n\n return globalMessagesByChatId?.[chatId]?.byId[messageId];\n })\n .filter(Boolean as any)\n .sort((a, b) => b.date - a.date);\n }, [foundIds, globalMessagesByChatId]);\n\n function renderFoundMessage(message: ApiMessage) {\n const text = getMessageSummaryText(lang, message);\n const chat = chatsById[message.chatId];\n\n if (!text || !chat) {\n return undefined;\n }\n\n return (\n \n );\n }\n\n const nothingFound = fetchingStatus && !fetchingStatus.chats && !fetchingStatus.messages && !foundMessages.length;\n\n return (\n
\n \n {dateSearchQuery && (\n
\n \n
\n )}\n {nothingFound && (\n \n )}\n {!!foundMessages.length && foundMessages.map(renderFoundMessage)}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { byId: chatsById } = global.chats;\n const { currentUserId, messages: { byChatId: globalMessagesByChatId }, lastSyncTime } = global;\n const { fetchingStatus, resultsByType } = global.globalSearch;\n\n const { foundIds } = (resultsByType?.text) || {};\n\n return {\n currentUserId,\n foundIds,\n globalMessagesByChatId,\n chatsById,\n fetchingStatus,\n lastSyncTime,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['searchMessagesGlobal']),\n)(ChatMessageResults));\n","import { GlobalState } from '../../../../global/types';\nimport {\n ApiChat, ApiGlobalMessageSearchType, ApiMessage, ApiUser,\n} from '../../../../api/types';\nimport { ISettings } from '../../../../types';\n\nimport { selectTheme } from '../../../../modules/selectors';\n\nexport type StateProps = {\n theme: ISettings['theme'];\n isLoading?: boolean;\n chatsById: Record;\n usersById: Record;\n globalMessagesByChatId?: Record }>;\n foundIds?: string[];\n lastSyncTime?: number;\n searchChatId?: number;\n};\n\nexport function createMapStateToProps(type: ApiGlobalMessageSearchType) {\n return (global: GlobalState, props: any) => {\n const { byId: chatsById } = global.chats;\n const { byId: usersById } = global.users;\n const {\n fetchingStatus, resultsByType, chatId,\n } = global.globalSearch;\n\n // One component is used for two different types of results.\n // The differences between them are only in the isVoice property.\n // The rest of the search results use their own personal components.\n const currentType = type !== 'audio' ? type : (props?.isVoice ? 'voice' : 'audio');\n\n const { byChatId: globalMessagesByChatId } = global.messages;\n const foundIds = resultsByType?.[currentType]?.foundIds;\n\n return {\n theme: selectTheme(global),\n isLoading: foundIds === undefined\n || (fetchingStatus ? Boolean(fetchingStatus.chats || fetchingStatus.messages) : false),\n chatsById,\n usersById,\n globalMessagesByChatId,\n foundIds,\n searchChatId: chatId,\n lastSyncTime: global.lastSyncTime,\n };\n };\n}\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { LoadMoreDirection, MediaViewerOrigin } from '../../../types';\n\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { createMapStateToProps, StateProps } from './helpers/createMapStateToProps';\nimport { pick } from '../../../util/iteratees';\nimport buildClassName from '../../../util/buildClassName';\nimport { throttle } from '../../../util/schedulers';\nimport useLang from '../../../hooks/useLang';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport Media from '../../common/Media';\nimport ChatMessage from './ChatMessage';\nimport NothingFound from '../../common/NothingFound';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n searchQuery?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst CURRENT_TYPE = 'media';\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst MediaResults: FC = ({\n searchQuery,\n searchChatId,\n isLoading,\n globalMessagesByChatId,\n foundIds,\n lastSyncTime,\n searchMessagesGlobal,\n openMediaViewer,\n}) => {\n const lang = useLang();\n\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: CURRENT_TYPE,\n query: searchQuery,\n chatId: searchChatId,\n });\n });\n }\n }, [lastSyncTime, searchMessagesGlobal, searchQuery, searchChatId]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || !globalMessagesByChatId) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds.map((id) => {\n const [chatId, messageId] = id.split('_').map(Number);\n\n return globalMessagesByChatId[chatId]?.byId[messageId];\n }).filter(Boolean);\n }, [globalMessagesByChatId, foundIds]);\n\n const handleSelectMedia = useCallback((messageId: number, chatId: number) => {\n openMediaViewer({\n chatId,\n messageId,\n origin: MediaViewerOrigin.SearchResult,\n });\n }, [openMediaViewer]);\n\n function renderGallery() {\n return (\n
\n {foundMessages.map((message) => (\n \n ))}\n
\n );\n }\n\n function renderSearchResult() {\n return foundMessages.map((message) => (\n \n ));\n }\n\n const canRenderContents = useAsyncRendering([searchQuery], SLIDE_TRANSITION_DURATION) && !isLoading;\n const isMediaGrid = canRenderContents && foundIds && foundIds.length > 0 && !searchQuery;\n const isMessageList = canRenderContents && foundIds && foundIds.length > 0 && searchQuery;\n\n const classNames = buildClassName(\n 'search-content custom-scroll',\n isMessageList && 'chat-list',\n );\n\n return (\n
\n \n {!canRenderContents && }\n {canRenderContents && (!foundIds || foundIds.length === 0) && (\n \n )}\n {isMediaGrid && renderGallery()}\n {isMessageList && renderSearchResult()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n createMapStateToProps(CURRENT_TYPE),\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesGlobal',\n 'openMediaViewer',\n ]),\n)(MediaResults));\n","import { ApiChat, ApiMessage, ApiUser } from '../../../../api/types';\nimport {\n getChatTitle,\n getSenderTitle,\n isChatPrivate,\n isChatGroup,\n} from '../../../../modules/helpers';\nimport { LangFn } from '../../../../hooks/useLang';\n\nexport function getSenderName(\n lang: LangFn, message: ApiMessage, chatsById: Record, usersById: Record,\n) {\n const { senderId } = message;\n if (!senderId) {\n return undefined;\n }\n\n const sender = isChatPrivate(senderId) ? usersById[senderId] : chatsById[senderId];\n\n let senderName = getSenderTitle(lang, sender);\n\n const chat = chatsById[message.chatId];\n if (chat) {\n if (isChatPrivate(senderId) && (sender as ApiUser).isSelf) {\n senderName = `${lang('FromYou')} → ${getChatTitle(lang, chat)}`;\n } else if (isChatGroup(chat)) {\n senderName += ` → ${getChatTitle(lang, chat)}`;\n }\n }\n\n return senderName;\n}\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { createMapStateToProps, StateProps } from './helpers/createMapStateToProps';\nimport { pick } from '../../../util/iteratees';\nimport { formatMonthAndYear, toYearMonth } from '../../../util/dateFormat';\nimport { getSenderName } from './helpers/getSenderName';\nimport { throttle } from '../../../util/schedulers';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport useLang from '../../../hooks/useLang';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport WebLink from '../../common/WebLink';\nimport NothingFound from '../../common/NothingFound';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n searchQuery?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst CURRENT_TYPE = 'links';\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst LinkResults: FC = ({\n searchQuery,\n searchChatId,\n isLoading,\n chatsById,\n usersById,\n globalMessagesByChatId,\n foundIds,\n lastSyncTime,\n searchMessagesGlobal,\n focusMessage,\n}) => {\n const lang = useLang();\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: CURRENT_TYPE,\n query: searchQuery,\n chatId: searchChatId,\n });\n });\n }\n }, [lastSyncTime, searchMessagesGlobal, searchQuery, searchChatId]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || !globalMessagesByChatId) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds.map((id) => {\n const [chatId, messageId] = id.split('_').map(Number);\n\n return globalMessagesByChatId[chatId]?.byId[messageId];\n }).filter(Boolean);\n }, [globalMessagesByChatId, foundIds]);\n\n const handleMessageFocus = useCallback((messageId: number, chatId: number) => {\n focusMessage({ chatId, messageId });\n }, [focusMessage]);\n\n function renderList() {\n return foundMessages.map((message, index) => {\n const shouldDrawDateDivider = index === 0\n || toYearMonth(message.date) !== toYearMonth(foundMessages[index - 1].date);\n return (\n \n {shouldDrawDateDivider && (\n

\n {formatMonthAndYear(lang, new Date(message.date * 1000))}\n

\n )}\n \n \n );\n });\n }\n\n const canRenderContents = useAsyncRendering([searchQuery], SLIDE_TRANSITION_DURATION) && !isLoading;\n\n return (\n
\n \n {!canRenderContents && }\n {canRenderContents && (!foundIds || foundIds.length === 0) && (\n \n )}\n {canRenderContents && foundIds && foundIds.length > 0 && renderList()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n createMapStateToProps(CURRENT_TYPE),\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesGlobal',\n 'focusMessage',\n ]),\n)(LinkResults));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiMessage } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { createMapStateToProps, StateProps } from './helpers/createMapStateToProps';\nimport { pick } from '../../../util/iteratees';\nimport { formatMonthAndYear, toYearMonth } from '../../../util/dateFormat';\nimport { getSenderName } from './helpers/getSenderName';\nimport { throttle } from '../../../util/schedulers';\nimport { getMessageDocument } from '../../../modules/helpers';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport useLang from '../../../hooks/useLang';\n\nimport Document from '../../common/Document';\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport NothingFound from '../../common/NothingFound';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n searchQuery?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst CURRENT_TYPE = 'documents';\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst FileResults: FC = ({\n searchQuery,\n searchChatId,\n isLoading,\n chatsById,\n usersById,\n globalMessagesByChatId,\n foundIds,\n lastSyncTime,\n searchMessagesGlobal,\n focusMessage,\n}) => {\n const lang = useLang();\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: CURRENT_TYPE,\n query: searchQuery,\n chatId: searchChatId,\n });\n });\n }\n }, [lastSyncTime, searchMessagesGlobal, searchQuery, searchChatId]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || !globalMessagesByChatId) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds.map((id) => {\n const [chatId, messageId] = id.split('_').map(Number);\n const message = globalMessagesByChatId[chatId]?.byId[messageId];\n\n return message && getMessageDocument(message) ? message : undefined;\n }).filter(Boolean) as ApiMessage[];\n }, [globalMessagesByChatId, foundIds]);\n\n const handleMessageFocus = useCallback((messageId: number, chatId: number) => {\n focusMessage({ chatId, messageId });\n }, [focusMessage]);\n\n function renderList() {\n return foundMessages.map((message, index) => {\n const shouldDrawDateDivider = index === 0\n || toYearMonth(message.date) !== toYearMonth(foundMessages[index - 1].date);\n return (\n \n {shouldDrawDateDivider && (\n

{formatMonthAndYear(lang, new Date(message.date * 1000))}

\n )}\n \n \n );\n });\n }\n\n const canRenderContents = useAsyncRendering([searchQuery], SLIDE_TRANSITION_DURATION) && !isLoading;\n\n return (\n
\n \n {!canRenderContents && }\n {canRenderContents && (!foundIds || foundIds.length === 0) && (\n \n )}\n {canRenderContents && foundIds && foundIds.length > 0 && renderList()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n createMapStateToProps(CURRENT_TYPE),\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesGlobal',\n 'focusMessage',\n ]),\n)(FileResults));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport { createMapStateToProps, StateProps } from './helpers/createMapStateToProps';\nimport { pick } from '../../../util/iteratees';\nimport { formatMonthAndYear, toYearMonth } from '../../../util/dateFormat';\nimport { getSenderName } from './helpers/getSenderName';\nimport { throttle } from '../../../util/schedulers';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport useLang from '../../../hooks/useLang';\n\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport Audio from '../../common/Audio';\nimport NothingFound from '../../common/NothingFound';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n isVoice?: boolean;\n searchQuery?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nconst AudioResults: FC = ({\n theme,\n isVoice,\n searchQuery,\n searchChatId,\n isLoading,\n chatsById,\n usersById,\n globalMessagesByChatId,\n foundIds,\n lastSyncTime,\n searchMessagesGlobal,\n focusMessage,\n openAudioPlayer,\n}) => {\n const lang = useLang();\n const currentType = isVoice ? 'voice' : 'audio';\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (lastSyncTime && direction === LoadMoreDirection.Backwards) {\n runThrottled(() => {\n searchMessagesGlobal({\n type: currentType,\n query: searchQuery,\n chatId: searchChatId,\n });\n });\n }\n }, [currentType, lastSyncTime, searchMessagesGlobal, searchQuery, searchChatId]);\n\n const foundMessages = useMemo(() => {\n if (!foundIds || !globalMessagesByChatId) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return foundIds.map((id) => {\n const [chatId, messageId] = id.split('_').map(Number);\n\n return globalMessagesByChatId[chatId]?.byId[messageId];\n }).filter(Boolean);\n }, [globalMessagesByChatId, foundIds]);\n\n const handleMessageFocus = useCallback((messageId: number, chatId: number) => {\n focusMessage({ chatId, messageId });\n }, [focusMessage]);\n\n const handlePlayAudio = useCallback((messageId: number, chatId: number) => {\n openAudioPlayer({ chatId, messageId });\n }, [openAudioPlayer]);\n\n function renderList() {\n return foundMessages.map((message, index) => {\n const shouldDrawDateDivider = index === 0\n || toYearMonth(message.date) !== toYearMonth(foundMessages[index - 1].date);\n return (\n \n {shouldDrawDateDivider && (\n

\n {formatMonthAndYear(lang, new Date(message.date * 1000))}\n

\n )}\n \n \n );\n });\n }\n\n const canRenderContents = useAsyncRendering([searchQuery], SLIDE_TRANSITION_DURATION) && !isLoading;\n\n return (\n
\n \n {!canRenderContents && }\n {canRenderContents && (!foundIds || foundIds.length === 0) && (\n \n )}\n {canRenderContents && foundIds && foundIds.length > 0 && renderList()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n createMapStateToProps('audio'),\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'searchMessagesGlobal',\n 'focusMessage',\n 'openAudioPlayer',\n ]),\n)(AudioResults));\n","import React, {\n FC, memo, useCallback, useState, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { GlobalSearchContent } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport { parseDateString } from '../../../util/dateFormat';\nimport useKeyboardListNavigation from '../../../hooks/useKeyboardListNavigation';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport TabList from '../../ui/TabList';\nimport Transition from '../../ui/Transition';\nimport ChatResults from './ChatResults';\nimport UserChatResults from './ChatMessageResults';\nimport MediaResults from './MediaResults';\nimport LinkResults from './LinkResults';\nimport FileResults from './FileResults';\nimport AudioResults from './AudioResults';\n\nimport './LeftSearch.scss';\n\nexport type OwnProps = {\n searchQuery?: string;\n searchDate?: number;\n isActive: boolean;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentContent?: GlobalSearchContent;\n chatId?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst TABS = [\n { type: GlobalSearchContent.ChatList, title: 'SearchAllChatsShort' },\n { type: GlobalSearchContent.Media, title: 'SharedMediaTab2' },\n { type: GlobalSearchContent.Links, title: 'SharedLinksTab2' },\n { type: GlobalSearchContent.Files, title: 'SharedFilesTab2' },\n { type: GlobalSearchContent.Music, title: 'SharedMusicTab2' },\n { type: GlobalSearchContent.Voice, title: 'SharedVoiceTab2' },\n];\n\nconst CHAT_TABS = [\n { type: GlobalSearchContent.ChatList, title: 'All Messages' },\n ...TABS.slice(1),\n];\n\nconst TRANSITION_RENDER_COUNT = Object.keys(GlobalSearchContent).length / 2;\n\nconst LeftSearch: FC = ({\n searchQuery,\n searchDate,\n isActive,\n currentContent = GlobalSearchContent.ChatList,\n chatId,\n setGlobalSearchContent,\n setGlobalSearchDate,\n onReset,\n}) => {\n const lang = useLang();\n const [activeTab, setActiveTab] = useState(currentContent);\n const dateSearchQuery = useMemo(() => parseDateString(searchQuery), [searchQuery]);\n\n const handleSwitchTab = useCallback((index: number) => {\n const tab = TABS[index];\n setGlobalSearchContent({ content: tab.type });\n setActiveTab(index);\n }, [setGlobalSearchContent]);\n\n const handleSearchDateSelect = useCallback((value: Date) => {\n setGlobalSearchDate({ date: value.getTime() / 1000 });\n }, [setGlobalSearchDate]);\n\n useHistoryBack(isActive, onReset, undefined, undefined, true);\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const handleKeyDown = useKeyboardListNavigation(containerRef, isActive, undefined, '.ListItem-button', true);\n\n return (\n
\n \n \n {() => {\n switch (currentContent) {\n case GlobalSearchContent.ChatList:\n if (chatId) {\n return (\n \n );\n }\n return (\n \n );\n case GlobalSearchContent.Media:\n return ;\n case GlobalSearchContent.Links:\n return ;\n case GlobalSearchContent.Files:\n return ;\n case GlobalSearchContent.Music:\n return (\n \n );\n case GlobalSearchContent.Voice:\n return (\n \n );\n default:\n return undefined;\n }\n }}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { currentContent, chatId } = global.globalSearch;\n\n return { currentContent, chatId };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['setGlobalSearchContent', 'setGlobalSearchDate']),\n)(LeftSearch));\n","import useReducer, { StateReducer, Dispatch } from '../useReducer';\n\nexport type TwoFaActions = (\n 'setCurrentPassword' | 'setPassword' | 'setHint' | 'setEmail' | 'reset'\n);\nexport type TwoFaDispatch = Dispatch;\n\nexport type TwoFaState = {\n currentPassword: string;\n password: string;\n hint: string;\n email: string;\n};\n\nconst INITIAL_STATE: TwoFaState = {\n currentPassword: '',\n password: '',\n hint: '',\n email: '',\n};\n\nconst twoFaReducer: StateReducer = (\n state,\n action,\n) => {\n switch (action.type) {\n case 'setCurrentPassword':\n return {\n ...state,\n currentPassword: action.payload,\n };\n\n case 'setPassword':\n return {\n ...state,\n password: action.payload,\n };\n\n case 'setHint':\n return {\n ...state,\n hint: action.payload,\n };\n\n case 'setEmail':\n return {\n ...state,\n email: action.payload,\n };\n\n case 'reset':\n return INITIAL_STATE;\n\n default:\n return state;\n }\n};\n\nexport default () => {\n return useReducer(twoFaReducer, INITIAL_STATE);\n};\n","import React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\n\nimport DropdownMenu from '../../ui/DropdownMenu';\nimport MenuItem from '../../ui/MenuItem';\nimport Button from '../../ui/Button';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\ntype OwnProps = {\n currentScreen: SettingsScreens;\n editedFolderId?: number;\n onReset: () => void;\n onSaveFilter: () => void;\n onScreenSelect: (screen: SettingsScreens) => void;\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsHeader: FC = ({\n currentScreen,\n editedFolderId,\n onReset,\n onSaveFilter,\n signOut,\n deleteChatFolder,\n onScreenSelect,\n}) => {\n const [isSignOutDialogOpen, setIsSignOutDialogOpen] = useState(false);\n const [isDeleteFolderDialogOpen, setIsDeleteFolderDialogOpen] = useState(false);\n\n const openSignOutConfirmation = useCallback(() => {\n setIsSignOutDialogOpen(true);\n }, []);\n\n const closeSignOutConfirmation = useCallback(() => {\n setIsSignOutDialogOpen(false);\n }, []);\n\n const openDeleteFolderConfirmation = useCallback(() => {\n setIsDeleteFolderDialogOpen(true);\n }, []);\n\n const closeDeleteFolderConfirmation = useCallback(() => {\n setIsDeleteFolderDialogOpen(false);\n }, []);\n\n const handleSignOutMessage = useCallback(() => {\n closeSignOutConfirmation();\n signOut();\n }, [closeSignOutConfirmation, signOut]);\n\n const handleDeleteFolderMessage = useCallback(() => {\n closeDeleteFolderConfirmation();\n deleteChatFolder({ id: editedFolderId });\n onReset();\n }, [editedFolderId, closeDeleteFolderConfirmation, deleteChatFolder, onReset]);\n\n const SettingsMenuButton: FC<{ onTrigger: () => void; isOpen?: boolean }> = useMemo(() => {\n return ({ onTrigger, isOpen }) => (\n \n \n \n );\n }, []);\n\n const lang = useLang();\n\n function renderHeaderContent() {\n switch (currentScreen) {\n case SettingsScreens.EditProfile:\n return

{lang('lng_settings_information')}

;\n case SettingsScreens.General:\n return

{lang('General')}

;\n case SettingsScreens.Notifications:\n return

{lang('Notifications')}

;\n case SettingsScreens.Privacy:\n return

{lang('PrivacySettings')}

;\n case SettingsScreens.Language:\n return

{lang('Language')}

;\n\n case SettingsScreens.GeneralChatBackground:\n return

{lang('ChatBackground')}

;\n case SettingsScreens.GeneralChatBackgroundColor:\n return

{lang('SetColor')}

;\n\n case SettingsScreens.PrivacyPhoneNumber:\n return

{lang('PrivacyPhone')}

;\n case SettingsScreens.PrivacyLastSeen:\n return

{lang('PrivacyLastSeen')}

;\n case SettingsScreens.PrivacyProfilePhoto:\n return

{lang('Privacy.ProfilePhoto')}

;\n case SettingsScreens.PrivacyForwarding:\n return

{lang('PrivacyForwards')}

;\n case SettingsScreens.PrivacyGroupChats:\n return

{lang('AutodownloadGroupChats')}

;\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n return

{lang('AlwaysShareWith')}

;\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n return

{lang('NeverShareWith')}

;\n\n case SettingsScreens.PrivacyActiveSessions:\n return

{lang('SessionsTitle')}

;\n case SettingsScreens.PrivacyBlockedUsers:\n return

{lang('BlockedUsers')}

;\n\n case SettingsScreens.TwoFaDisabled:\n case SettingsScreens.TwoFaEnabled:\n return

{lang('TwoStepVerification')}

;\n case SettingsScreens.TwoFaNewPassword:\n case SettingsScreens.TwoFaChangePasswordNew:\n case SettingsScreens.TwoFaChangePasswordConfirm:\n return

{lang('PleaseEnterCurrentPassword')}

;\n case SettingsScreens.TwoFaNewPasswordConfirm:\n return

{lang('PleaseReEnterPassword')}

;\n case SettingsScreens.TwoFaNewPasswordHint:\n case SettingsScreens.TwoFaChangePasswordHint:\n return

{lang('PasswordHint')}

;\n case SettingsScreens.TwoFaNewPasswordEmail:\n case SettingsScreens.TwoFaRecoveryEmail:\n return

{lang('RecoveryEmailTitle')}

;\n case SettingsScreens.TwoFaNewPasswordEmailCode:\n case SettingsScreens.TwoFaRecoveryEmailCode:\n return

Recovery Email Code

;\n case SettingsScreens.TwoFaCongratulations:\n return

{lang('TwoStepVerificationPasswordSet')}

;\n case SettingsScreens.TwoFaChangePasswordCurrent:\n case SettingsScreens.TwoFaTurnOff:\n case SettingsScreens.TwoFaRecoveryEmailCurrentPassword:\n return

{lang('PleaseEnterCurrentPassword')}

;\n\n case SettingsScreens.Folders:\n return

{lang('Filters')}

;\n case SettingsScreens.FoldersCreateFolder:\n return

{lang('FilterNew')}

;\n case SettingsScreens.FoldersEditFolder:\n case SettingsScreens.FoldersEditFolderFromChatList:\n return (\n
\n

{lang('FilterEdit')}

\n\n {editedFolderId && (\n \n \n {lang('Delete')}\n \n \n )}\n
\n );\n case SettingsScreens.FoldersIncludedChats:\n case SettingsScreens.FoldersIncludedChatsFromChatList:\n case SettingsScreens.FoldersExcludedChats:\n case SettingsScreens.FoldersExcludedChatsFromChatList:\n return (\n
\n {(currentScreen === SettingsScreens.FoldersIncludedChats\n || currentScreen === SettingsScreens.FoldersIncludedChatsFromChatList) ? (\n

{lang('FilterInclude')}

\n ) : (\n

{lang('FilterExclude')}

\n )}\n\n \n \n \n
\n );\n\n default:\n return (\n
\n

{lang('SETTINGS')}

\n\n onScreenSelect(SettingsScreens.EditProfile)}\n ariaLabel={lang('lng_settings_information')}\n >\n \n \n \n {lang('LogOutTitle')}\n \n
\n );\n }\n }\n\n return (\n
\n \n \n \n {renderHeaderContent()}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['signOut', 'deleteChatFolder']),\n)(SettingsHeader));\n","import React, { FC, memo, useEffect } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { SettingsScreens } from '../../../types';\nimport { ApiUser } from '../../../api/types';\n\nimport { selectUser } from '../../../modules/selectors';\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport ProfileInfo from '../../common/ProfileInfo';\nimport ChatExtra from '../../common/ChatExtra';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentUser?: ApiUser;\n lastSyncTime?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsMain: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n loadProfilePhotos,\n currentUser,\n lastSyncTime,\n}) => {\n const lang = useLang();\n const profileId = currentUser?.id;\n\n useEffect(() => {\n if (profileId && lastSyncTime) {\n loadProfilePhotos({ profileId });\n }\n }, [lastSyncTime, profileId, loadProfilePhotos]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Main);\n\n return (\n
\n
\n {currentUser && (\n \n )}\n {currentUser && (\n \n )}\n onScreenSelect(SettingsScreens.General)}\n >\n {lang('Telegram.GeneralSettingsViewController')}\n \n onScreenSelect(SettingsScreens.Notifications)}\n >\n {lang('Notifications')}\n \n onScreenSelect(SettingsScreens.Privacy)}\n >\n {lang('PrivacySettings')}\n \n onScreenSelect(SettingsScreens.Folders)}\n >\n {lang('Filters')}\n \n onScreenSelect(SettingsScreens.Language)}\n >\n {lang('Language')}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { currentUserId, lastSyncTime } = global;\n\n return {\n currentUser: currentUserId ? selectUser(global, currentUserId) : undefined,\n lastSyncTime,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadProfilePhotos']),\n)(SettingsMain));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useState, useCallback, memo, useEffect, useMemo,\n} from '../../lib/teact/teact';\n\nimport { debounce } from '../../util/schedulers';\nimport useLang from '../../hooks/useLang';\n\nimport InputText from '../ui/InputText';\n\ntype OwnProps = {\n currentUsername?: string;\n asLink?: boolean;\n isLoading?: boolean;\n isUsernameAvailable?: boolean;\n checkUsername: AnyToVoidFunction;\n onChange: (value: string | false) => void;\n};\n\nconst MIN_USERNAME_LENGTH = 5;\nconst MAX_USERNAME_LENGTH = 32;\nconst LINK_PREFIX = 'https://t.me/';\nconst LINK_PREFIX_REGEX = /https:\\/\\/t\\.me\\/?/i;\nconst USERNAME_REGEX = /^([a-zA-Z0-9_]+)$/;\n\nconst runDebouncedForCheckUsername = debounce((cb) => cb(), 250, false);\n\nfunction isUsernameValid(username: string) {\n return username.length >= MIN_USERNAME_LENGTH\n && username.length <= MAX_USERNAME_LENGTH\n && USERNAME_REGEX.test(username);\n}\n\nconst SettingsEditProfile: FC = ({\n currentUsername,\n asLink,\n isLoading,\n isUsernameAvailable,\n checkUsername,\n onChange,\n}) => {\n const [username, setUsername] = useState(currentUsername || '');\n\n const lang = useLang();\n const langPrefix = asLink ? 'SetUrl' : 'Username';\n const label = asLink ? lang('SetUrlPlaceholder') : lang('Username');\n\n const [usernameSuccess, usernameError] = useMemo(() => {\n if (!username.length) {\n return [];\n }\n\n if (username.length < MIN_USERNAME_LENGTH) {\n return [undefined, `${label} is too short`];\n }\n if (username.length > MAX_USERNAME_LENGTH) {\n return [undefined, `${label} is too long`];\n }\n if (!USERNAME_REGEX.test(username)) {\n return [undefined, `${label} contains invalid characters`];\n }\n\n if (isUsernameAvailable === undefined) {\n return [];\n }\n\n // Variable `isUsernameAvailable` is initialized with `undefined`, so a strict false check is required\n return [\n isUsernameAvailable ? lang(`${langPrefix}Available`, 'Username') : undefined,\n isUsernameAvailable === false ? lang(`${langPrefix}InUse`) : undefined,\n ];\n }, [username, isUsernameAvailable, lang, langPrefix, label]);\n\n useEffect(() => {\n setUsername(currentUsername || '');\n }, [asLink, currentUsername]);\n\n const handleUsernameChange = useCallback((e: ChangeEvent) => {\n const newUsername = e.target.value.trim().replace(LINK_PREFIX_REGEX, '');\n setUsername(newUsername);\n e.target.value = `${asLink ? LINK_PREFIX : ''}${newUsername}`;\n\n const isValid = isUsernameValid(newUsername);\n\n if (isValid) {\n runDebouncedForCheckUsername(() => {\n checkUsername({ username: newUsername });\n });\n }\n\n if (onChange) {\n onChange(isValid ? newUsername : false);\n }\n }, [asLink, checkUsername, onChange]);\n\n return (\n \n );\n};\n\nexport default memo(SettingsEditProfile);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useState, useCallback, memo, useEffect, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiMediaFormat } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { ProfileEditProgress, SettingsScreens } from '../../../types';\n\nimport { throttle } from '../../../util/schedulers';\nimport { pick } from '../../../util/iteratees';\nimport { selectUser } from '../../../modules/selectors';\nimport { getChatAvatarHash } from '../../../modules/helpers';\nimport useMedia from '../../../hooks/useMedia';\nimport useLang from '../../../hooks/useLang';\n\nimport AvatarEditable from '../../ui/AvatarEditable';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport InputText from '../../ui/InputText';\nimport renderText from '../../common/helpers/renderText';\nimport UsernameInput from '../../common/UsernameInput';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\ntype OwnProps = {\n isActive: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentAvatarHash?: string;\n currentFirstName?: string;\n currentLastName?: string;\n currentBio?: string;\n currentUsername?: string;\n progress?: ProfileEditProgress;\n isUsernameAvailable?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst MAX_BIO_LENGTH = 70;\n\nconst ERROR_FIRST_NAME_MISSING = 'Please provide your first name';\nconst ERROR_BIO_TOO_LONG = 'Bio can\\' be longer than 70 characters';\n\nconst SettingsEditProfile: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n currentAvatarHash,\n currentFirstName,\n currentLastName,\n currentBio,\n currentUsername,\n progress,\n isUsernameAvailable,\n loadCurrentUser,\n updateProfile,\n checkUsername,\n}) => {\n const lang = useLang();\n\n const [isUsernameTouched, setIsUsernameTouched] = useState(false);\n const [isProfileFieldsTouched, setIsProfileFieldsTouched] = useState(false);\n const [error, setError] = useState();\n\n const [photo, setPhoto] = useState();\n const [firstName, setFirstName] = useState(currentFirstName || '');\n const [lastName, setLastName] = useState(currentLastName || '');\n const [bio, setBio] = useState(currentBio || '');\n const [username, setUsername] = useState(currentUsername || '');\n\n const currentAvatarBlobUrl = useMedia(currentAvatarHash, false, ApiMediaFormat.BlobUrl);\n\n const isLoading = progress === ProfileEditProgress.InProgress;\n const isUsernameError = username === false;\n\n const isSaveButtonShown = useMemo(() => {\n if (isUsernameError) {\n return false;\n }\n\n return Boolean(photo) || isProfileFieldsTouched || isUsernameAvailable === true;\n }, [photo, isProfileFieldsTouched, isUsernameError, isUsernameAvailable]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.EditProfile);\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadCurrentUser();\n });\n }, [loadCurrentUser]);\n\n useEffect(() => {\n setPhoto(undefined);\n }, [currentAvatarBlobUrl]);\n\n useEffect(() => {\n setFirstName(currentFirstName || '');\n setLastName(currentLastName || '');\n setBio(currentBio || '');\n }, [currentFirstName, currentLastName, currentBio]);\n\n useEffect(() => {\n setUsername(currentUsername || '');\n }, [currentUsername]);\n\n useEffect(() => {\n if (progress === ProfileEditProgress.Complete) {\n setIsProfileFieldsTouched(false);\n setIsUsernameTouched(false);\n setError(undefined);\n }\n }, [progress]);\n\n const handlePhotoChange = useCallback((newPhoto: File) => {\n setPhoto(newPhoto);\n }, []);\n\n const handleFirstNameChange = useCallback((e: ChangeEvent) => {\n setFirstName(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleLastNameChange = useCallback((e: ChangeEvent) => {\n setLastName(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleBioChange = useCallback((e: ChangeEvent) => {\n setBio(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleUsernameChange = useCallback((value: string | false) => {\n setUsername(value);\n setIsUsernameTouched(true);\n }, []);\n\n const handleProfileSave = useCallback(() => {\n const trimmedFirstName = firstName.trim();\n const trimmedLastName = lastName.trim();\n const trimmedBio = bio.trim();\n\n if (!trimmedFirstName.length) {\n setError(ERROR_FIRST_NAME_MISSING);\n return;\n }\n\n if (trimmedBio.length > MAX_BIO_LENGTH) {\n setError(ERROR_BIO_TOO_LONG);\n return;\n }\n\n updateProfile({\n photo,\n ...(isProfileFieldsTouched && {\n firstName: trimmedFirstName,\n lastName: trimmedLastName,\n bio: trimmedBio,\n }),\n ...(isUsernameTouched && {\n username,\n }),\n });\n }, [\n photo,\n firstName, lastName, bio, isProfileFieldsTouched,\n username, isUsernameTouched,\n updateProfile,\n ]);\n\n return (\n
\n
\n
\n \n \n \n \n\n

\n {renderText(lang('lng_settings_about_bio'), ['br', 'simple_markdown'])}\n

\n
\n\n
\n

{lang('Username')}

\n\n \n\n

\n {renderText(lang('UsernameHelp'), ['br', 'simple_markdown'])}\n

\n {username && (\n

\n {lang('lng_username_link')}
\n https://t.me/{username}\n

\n )}\n
\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { currentUserId } = global;\n const { progress, isUsernameAvailable } = global.profileEdit || {};\n const currentUser = currentUserId ? selectUser(global, currentUserId) : undefined;\n\n if (!currentUser) {\n return {\n progress,\n isUsernameAvailable,\n };\n }\n\n const {\n firstName: currentFirstName,\n lastName: currentLastName,\n username: currentUsername,\n fullInfo,\n } = currentUser;\n const { bio: currentBio } = fullInfo || {};\n const currentAvatarHash = getChatAvatarHash(currentUser);\n\n return {\n currentAvatarHash,\n currentFirstName,\n currentLastName,\n currentBio,\n currentUsername,\n progress,\n isUsernameAvailable,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadCurrentUser',\n 'updateProfile',\n 'checkUsername',\n ]),\n)(SettingsEditProfile));\n","import React, {\n FC, memo, useMemo, useCallback, useState, useEffect,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../../global/types';\nimport { ApiChatFolder, ApiChat, ApiUser } from '../../../../api/types';\nimport { NotifyException, NotifySettings, SettingsScreens } from '../../../../types';\n\nimport { STICKER_SIZE_FOLDER_SETTINGS } from '../../../../config';\nimport { pick } from '../../../../util/iteratees';\nimport { selectNotifyExceptions, selectNotifySettings } from '../../../../modules/selectors';\nimport { throttle } from '../../../../util/schedulers';\nimport getAnimationData from '../../../common/helpers/animatedAssets';\nimport { getFolderDescriptionText } from '../../../../modules/helpers';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport ListItem from '../../../ui/ListItem';\nimport Button from '../../../ui/Button';\nimport Loading from '../../../ui/Loading';\nimport AnimatedSticker from '../../../common/AnimatedSticker';\n\ntype OwnProps = {\n onCreateFolder: () => void;\n onEditFolder: (folder: ApiChatFolder) => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n chatsById: Record;\n usersById: Record;\n orderedFolderIds?: number[];\n foldersById: Record;\n recommendedChatFolders?: ApiChatFolder[];\n notifySettings: NotifySettings;\n notifyExceptions?: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst runThrottledForLoadRecommended = throttle((cb) => cb(), 60000, true);\n\nconst MAX_ALLOWED_FOLDERS = 10;\n\nconst SettingsFoldersMain: FC = ({\n onCreateFolder,\n onEditFolder,\n isActive,\n onScreenSelect,\n onReset,\n chatsById,\n usersById,\n orderedFolderIds,\n foldersById,\n recommendedChatFolders,\n notifySettings,\n notifyExceptions,\n loadRecommendedChatFolders,\n addChatFolder,\n showDialog,\n}) => {\n const [animationData, setAnimationData] = useState>();\n const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);\n const handleAnimationLoad = useCallback(() => setIsAnimationLoaded(true), []);\n\n useEffect(() => {\n if (!animationData) {\n getAnimationData('FoldersAll').then(setAnimationData);\n }\n }, [animationData]);\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottledForLoadRecommended(() => {\n loadRecommendedChatFolders();\n });\n }, [loadRecommendedChatFolders]);\n\n const handleCreateFolder = useCallback(() => {\n if (Object.keys(foldersById).length >= MAX_ALLOWED_FOLDERS) {\n showDialog({\n data: {\n message: 'DIALOG_FILTERS_TOO_MUCH',\n hasErrorKey: true,\n },\n });\n\n return;\n }\n\n onCreateFolder();\n }, [foldersById, showDialog, onCreateFolder]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Folders);\n\n const userFolders = useMemo(() => {\n if (!orderedFolderIds) {\n return undefined;\n }\n\n const chatIds = Object.keys(chatsById).map(Number);\n\n return orderedFolderIds.map((id) => {\n const folder = foldersById[id];\n\n return {\n id: folder.id,\n title: folder.title,\n subtitle: getFolderDescriptionText(\n lang, chatsById, usersById, folder, chatIds, notifySettings, notifyExceptions,\n ),\n };\n });\n }, [orderedFolderIds, chatsById, foldersById, usersById, notifySettings, notifyExceptions, lang]);\n\n const handleCreateFolderFromRecommended = useCallback((folder: ApiChatFolder) => {\n if (Object.keys(foldersById).length >= MAX_ALLOWED_FOLDERS) {\n showDialog({\n data: {\n message: 'DIALOG_FILTERS_TOO_MUCH',\n hasErrorKey: true,\n },\n });\n\n return;\n }\n\n addChatFolder({ folder });\n }, [foldersById, addChatFolder, showDialog]);\n\n return (\n
\n
\n
\n {animationData && (\n \n )}\n
\n\n

\n {lang('CreateNewFilterInfo')}\n

\n\n \n \n {lang('CreateNewFilter')}\n \n
\n\n
\n

{lang('Filters')}

\n\n {userFolders?.length ? userFolders.map((folder) => (\n onEditFolder(foldersById[folder.id])}\n >\n {folder.title}\n {folder.subtitle}\n \n )) : userFolders && !userFolders.length ? (\n

\n You have no folders yet.\n

\n ) : }\n
\n\n {(recommendedChatFolders && !!recommendedChatFolders.length) && (\n
\n

\n {lang('FilterRecommended')}\n

\n\n {recommendedChatFolders.map((folder) => (\n handleCreateFolderFromRecommended(folder)}\n >\n
\n
\n {folder.title}\n {folder.description}\n
\n\n \n {lang('Add')}\n \n
\n \n ))}\n
\n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chats: { byId: chatsById },\n users: { byId: usersById },\n } = global;\n\n const {\n orderedIds: orderedFolderIds,\n byId: foldersById,\n recommended: recommendedChatFolders,\n } = global.chatFolders;\n\n return {\n chatsById,\n usersById,\n orderedFolderIds,\n foldersById,\n recommendedChatFolders,\n notifySettings: selectNotifySettings(global),\n notifyExceptions: selectNotifyExceptions(global),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadRecommendedChatFolders', 'addChatFolder', 'showDialog']),\n)(SettingsFoldersMain));\n","import React, { FC } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\n\nimport Button from './Button';\n\nimport './ShowMoreButton.scss';\n\ntype OwnProps = {\n count: number;\n itemName: string;\n itemPluralName?: string;\n isLoading?: boolean;\n onClick: () => void;\n};\n\nconst ShowMoreButton: FC = ({\n count,\n itemName,\n itemPluralName,\n isLoading,\n onClick,\n}) => {\n const lang = useLang();\n\n return (\n \n \n Show {count} more {count > 1 ? itemPluralName || `${itemName}s` : itemName}\n \n );\n};\n\nexport default ShowMoreButton;\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../../global/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { STICKER_SIZE_FOLDER_SETTINGS } from '../../../../config';\nimport { findIntersectionWithSet, pick } from '../../../../util/iteratees';\nimport { isChatPrivate } from '../../../../modules/helpers';\nimport getAnimationData from '../../../common/helpers/animatedAssets';\nimport {\n EXCLUDED_CHAT_TYPES,\n FolderEditDispatch,\n FoldersState,\n INCLUDED_CHAT_TYPES,\n selectChatFilters,\n} from '../../../../hooks/reducers/useFoldersReducer';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport ListItem from '../../../ui/ListItem';\nimport AnimatedSticker from '../../../common/AnimatedSticker';\nimport InputText from '../../../ui/InputText';\nimport PrivateChatInfo from '../../../common/PrivateChatInfo';\nimport GroupChatInfo from '../../../common/GroupChatInfo';\nimport FloatingActionButton from '../../../ui/FloatingActionButton';\nimport Spinner from '../../../ui/Spinner';\nimport ShowMoreButton from '../../../ui/ShowMoreButton';\n\ntype OwnProps = {\n state: FoldersState;\n dispatch: FolderEditDispatch;\n onAddIncludedChats: () => void;\n onAddExcludedChats: () => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n onBack: () => void;\n};\n\ntype StateProps = {\n loadedActiveChatIds?: number[];\n loadedArchivedChatIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst SUBMIT_TIMEOUT = 500;\n\nconst INITIAL_CHATS_LIMIT = 5;\n\nconst ERROR_NO_TITLE = 'Please provide a title for this folder.';\nconst ERROR_NO_CHATS = 'ChatList.Filter.Error.Empty';\n\nconst SettingsFoldersEdit: FC = ({\n state,\n dispatch,\n onAddIncludedChats,\n onAddExcludedChats,\n isActive,\n onScreenSelect,\n onReset,\n onBack,\n loadedActiveChatIds,\n loadedArchivedChatIds,\n editChatFolder,\n addChatFolder,\n loadMoreChats,\n}) => {\n const [animationData, setAnimationData] = useState>();\n const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);\n const handleAnimationLoad = useCallback(() => setIsAnimationLoaded(true), []);\n\n const [isIncludedChatsListExpanded, setIsIncludedChatsListExpanded] = useState(false);\n const [isExcludedChatsListExpanded, setIsExcludedChatsListExpanded] = useState(false);\n\n const {\n selectedChatIds: includedChatIds,\n selectedChatTypes: includedChatTypes,\n } = selectChatFilters(state, 'included');\n const {\n selectedChatIds: excludedChatIds,\n selectedChatTypes: excludedChatTypes,\n } = selectChatFilters(state, 'excluded');\n\n useEffect(() => {\n if (!animationData) {\n getAnimationData('FoldersNew').then(setAnimationData);\n }\n }, [animationData]);\n\n useEffect(() => {\n setIsIncludedChatsListExpanded(false);\n setIsExcludedChatsListExpanded(false);\n }, [state.folderId]);\n\n const [visibleIncludedChatIds, visibleExcludedChatIds] = useMemo(() => {\n const allLoadedChatsSet = new Set([\n ...(loadedActiveChatIds || []),\n ...(loadedArchivedChatIds || []),\n ]);\n\n const loadedIncludedChatIds = findIntersectionWithSet(includedChatIds, allLoadedChatsSet);\n const loadedExcludedChatIds = findIntersectionWithSet(excludedChatIds, allLoadedChatsSet);\n\n return [\n isIncludedChatsListExpanded\n ? loadedIncludedChatIds\n : loadedIncludedChatIds.slice(0, INITIAL_CHATS_LIMIT - includedChatTypes.length),\n isExcludedChatsListExpanded\n ? loadedExcludedChatIds\n : loadedExcludedChatIds.slice(0, INITIAL_CHATS_LIMIT - excludedChatTypes.length),\n ];\n }, [\n excludedChatIds, includedChatIds, includedChatTypes, excludedChatTypes,\n isExcludedChatsListExpanded, isIncludedChatsListExpanded,\n loadedActiveChatIds, loadedArchivedChatIds,\n ]);\n\n useEffect(() => {\n if (\n visibleIncludedChatIds.length < includedChatIds.length\n || visibleExcludedChatIds.length < excludedChatIds.length\n ) {\n loadMoreChats({ listType: 'active' });\n }\n }, [\n loadMoreChats,\n excludedChatIds.length,\n includedChatIds.length,\n visibleExcludedChatIds.length,\n visibleIncludedChatIds.length,\n ]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onBack, onScreenSelect, state.mode === 'edit'\n ? SettingsScreens.FoldersEditFolder\n : SettingsScreens.FoldersCreateFolder);\n\n function handleChange(event: React.ChangeEvent) {\n const { currentTarget } = event;\n dispatch({ type: 'setTitle', payload: currentTarget.value.trim() });\n }\n\n function handleSubmit() {\n const { title } = state.folder;\n\n if (!title) {\n dispatch({ type: 'setError', payload: ERROR_NO_TITLE });\n return;\n }\n\n if (!includedChatIds.length && !Object.keys(includedChatTypes).length) {\n dispatch({ type: 'setError', payload: ERROR_NO_CHATS });\n return;\n }\n\n dispatch({ type: 'setIsLoading', payload: true });\n if (state.mode === 'edit') {\n editChatFolder({ id: state.folderId, folderUpdate: state.folder });\n } else {\n addChatFolder({ folder: state.folder });\n }\n\n setTimeout(() => {\n onReset();\n }, SUBMIT_TIMEOUT);\n }\n\n function renderChatType(key: string, mode: 'included' | 'excluded') {\n const chatType = mode === 'included'\n ? INCLUDED_CHAT_TYPES.find(({ key: typeKey }) => typeKey === key)\n : EXCLUDED_CHAT_TYPES.find(({ key: typeKey }) => typeKey === key);\n\n if (!chatType) {\n return undefined;\n }\n\n return (\n \n {lang(chatType.title)}\n \n );\n }\n\n function renderChats(mode: 'included' | 'excluded') {\n const selectedChatTypes = mode === 'included' ? includedChatTypes : excludedChatTypes;\n const visibleChatIds = mode === 'included' ? visibleIncludedChatIds : visibleExcludedChatIds;\n\n const isExpanded = mode === 'included' ? isIncludedChatsListExpanded : isExcludedChatsListExpanded;\n const allChatIds = mode === 'included' ? includedChatIds : excludedChatIds;\n const leftChatsCount = allChatIds.length - selectedChatTypes.length - visibleChatIds.length;\n const clickHandler = mode === 'included'\n ? () => setIsIncludedChatsListExpanded(true)\n : () => setIsExcludedChatsListExpanded(true);\n\n return (\n <>\n {selectedChatTypes.map((key) => renderChatType(key, mode))}\n {visibleChatIds.map((id) => (\n \n {isChatPrivate(id) ? (\n \n ) : (\n \n )}\n \n ))}\n {(!isExpanded && leftChatsCount > 0) && (\n \n )}\n \n );\n }\n\n return (\n
\n
\n
\n
\n {animationData && (\n \n )}\n
\n\n {state.mode === 'create' && (\n

\n {lang('FilterIncludeInfo')}\n

\n )}\n\n \n
\n\n
\n {state.error && state.error === ERROR_NO_CHATS && (\n

\n {lang(state.error)}\n

\n )}\n\n

{lang('FilterInclude')}

\n\n \n {lang('FilterAddChats')}\n \n\n {renderChats('included')}\n
\n\n
\n

{lang('FilterExclude')}

\n\n \n {lang('FilterAddChats')}\n \n\n {renderChats('excluded')}\n
\n
\n\n \n {state.isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { listIds } = global.chats;\n\n return {\n loadedActiveChatIds: listIds.active,\n loadedArchivedChatIds: listIds.archived,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['editChatFolder', 'addChatFolder', 'loadMoreChats']),\n)(SettingsFoldersEdit));\n","import React, {\n FC, useCallback, useRef, useEffect, memo,\n} from '../../../../lib/teact/teact';\n\nimport { isChatPrivate } from '../../../../modules/helpers';\nimport {\n INCLUDED_CHAT_TYPES,\n EXCLUDED_CHAT_TYPES,\n FolderChatType,\n} from '../../../../hooks/reducers/useFoldersReducer';\nimport useInfiniteScroll from '../../../../hooks/useInfiniteScroll';\nimport useLang from '../../../../hooks/useLang';\n\nimport Checkbox from '../../../ui/Checkbox';\nimport InputText from '../../../ui/InputText';\nimport ListItem from '../../../ui/ListItem';\nimport PrivateChatInfo from '../../../common/PrivateChatInfo';\nimport GroupChatInfo from '../../../common/GroupChatInfo';\nimport PickerSelectedItem from '../../../common/PickerSelectedItem';\nimport InfiniteScroll from '../../../ui/InfiniteScroll';\nimport Loading from '../../../ui/Loading';\n\nimport '../../../common/Picker.scss';\nimport './SettingsFoldersChatsPicker.scss';\n\ntype OwnProps = {\n mode: 'included' | 'excluded';\n chatIds: number[];\n selectedIds: number[];\n selectedChatTypes: string[];\n filterValue?: string;\n onSelectedIdsChange: (ids: number[]) => void;\n onSelectedChatTypesChange: (types: string[]) => void;\n onFilterChange: (value: string) => void;\n onLoadMore: () => void;\n};\n\n// Focus slows down animation, also it breaks transition layout in Chrome\nconst FOCUS_DELAY_MS = 500;\n\nconst MAX_CHATS = 100;\nconst MAX_FULL_ITEMS = 10;\nconst ALWAYS_FULL_ITEMS_COUNT = 5;\n\nconst SettingsFoldersChatsPicker: FC = ({\n mode,\n chatIds,\n selectedIds,\n selectedChatTypes,\n filterValue,\n onSelectedIdsChange,\n onSelectedChatTypesChange,\n onFilterChange,\n onLoadMore,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const chatTypes = mode === 'included' ? INCLUDED_CHAT_TYPES : EXCLUDED_CHAT_TYPES;\n const shouldMinimize = selectedIds.length + selectedChatTypes.length > MAX_FULL_ITEMS;\n const hasMaxChats = selectedIds.length >= MAX_CHATS;\n\n useEffect(() => {\n setTimeout(() => {\n requestAnimationFrame(() => {\n inputRef.current!.focus();\n });\n }, FOCUS_DELAY_MS);\n }, []);\n\n const handleItemClick = useCallback((id: number) => {\n const newSelectedIds = [...selectedIds];\n if (newSelectedIds.includes(id)) {\n newSelectedIds.splice(newSelectedIds.indexOf(id), 1);\n } else {\n newSelectedIds.push(id);\n }\n onSelectedIdsChange(newSelectedIds);\n }, [selectedIds, onSelectedIdsChange]);\n\n const handleChatTypeClick = useCallback((key: FolderChatType['key']) => {\n const newSelectedChatTypes = [...selectedChatTypes];\n if (newSelectedChatTypes.includes(key)) {\n newSelectedChatTypes.splice(newSelectedChatTypes.indexOf(key), 1);\n } else {\n newSelectedChatTypes.push(key);\n }\n onSelectedChatTypesChange(newSelectedChatTypes);\n }, [selectedChatTypes, onSelectedChatTypesChange]);\n\n const handleFilterChange = useCallback((e: React.ChangeEvent) => {\n const { value } = e.currentTarget;\n onFilterChange(value);\n }, [onFilterChange]);\n\n const lang = useLang();\n\n function renderSelectedChatType(key: string) {\n const selectedType = chatTypes.find(({ key: typeKey }) => key === typeKey);\n if (!selectedType) {\n return undefined;\n }\n\n return (\n \n );\n }\n\n function renderChatType(type: FolderChatType) {\n return (\n handleChatTypeClick(type.key)}\n ripple\n >\n \n

{lang(type.title)}

\n \n \n );\n }\n\n function renderItem(id: number) {\n const isSelected = selectedIds.includes(id);\n\n return (\n handleItemClick(id)}\n ripple\n disabled={!isSelected && hasMaxChats}\n >\n {isChatPrivate(id) ? (\n \n ) : (\n \n )}\n \n \n );\n }\n\n const [viewportIds, getMore] = useInfiniteScroll(onLoadMore, chatIds, Boolean(filterValue));\n\n return (\n
\n
\n {selectedChatTypes.map(renderSelectedChatType)}\n {selectedIds.map((id, i) => (\n \n ))}\n {!hasMaxChats ? (\n \n ) : (\n

\n {`Sorry, you can't add more than ${MAX_CHATS} chats.`}\n

\n )}\n
\n \n {(!viewportIds || !viewportIds.length || viewportIds.includes(chatIds[0])) && (\n <>\n

\n {lang('FilterChatTypes')}\n

\n {chatTypes.map(renderChatType)}\n
\n

\n {lang('FilterChats')}\n

\n \n )}\n\n {viewportIds?.length ? (\n viewportIds.map(renderItem)\n ) : viewportIds && !viewportIds.length ? (\n

Sorry, nothing found.

\n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(SettingsFoldersChatsPicker);\n","import React, {\n FC, memo, useMemo, useCallback,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../../global/types';\nimport { ApiChat } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport useLang from '../../../../hooks/useLang';\nimport { pick } from '../../../../util/iteratees';\nimport searchWords from '../../../../util/searchWords';\nimport { prepareChatList, getChatTitle } from '../../../../modules/helpers';\nimport {\n FoldersState,\n FolderEditDispatch,\n selectChatFilters,\n} from '../../../../hooks/reducers/useFoldersReducer';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport SettingsFoldersChatsPicker from './SettingsFoldersChatsPicker';\n\nimport Loading from '../../../ui/Loading';\n\ntype OwnProps = {\n mode: 'included' | 'excluded';\n state: FoldersState;\n dispatch: FolderEditDispatch;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n chatsById: Record;\n listIds?: number[];\n orderedPinnedIds?: number[];\n archivedListIds?: number[];\n archivedPinnedIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsFoldersChatFilters: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n mode,\n state,\n dispatch,\n chatsById,\n listIds,\n orderedPinnedIds,\n archivedListIds,\n archivedPinnedIds,\n loadMoreChats,\n}) => {\n const { chatFilter } = state;\n const { selectedChatIds, selectedChatTypes } = selectChatFilters(state, mode, true);\n\n const lang = useLang();\n const chats = useMemo(() => {\n const activeChatArrays = listIds\n ? prepareChatList(chatsById, listIds, orderedPinnedIds, 'all')\n : undefined;\n const archivedChatArrays = archivedListIds\n ? prepareChatList(chatsById, archivedListIds, archivedPinnedIds, 'archived')\n : undefined;\n\n if (!activeChatArrays && !archivedChatArrays) {\n return undefined;\n }\n\n return [\n ...(activeChatArrays\n ? [...activeChatArrays.pinnedChats, ...activeChatArrays.otherChats]\n : []\n ),\n ...(archivedChatArrays ? archivedChatArrays.otherChats : []),\n ];\n }, [chatsById, listIds, orderedPinnedIds, archivedListIds, archivedPinnedIds]);\n\n const displayedIds = useMemo(() => {\n if (!chats) {\n return undefined;\n }\n\n return chats\n .filter((chat) => (\n !chatFilter\n || searchWords(getChatTitle(lang, chat), chatFilter)\n || selectedChatIds.includes(chat.id)\n ))\n .map(({ id }) => id);\n }, [chats, chatFilter, lang, selectedChatIds]);\n\n const handleFilterChange = useCallback((newFilter: string) => {\n dispatch({\n type: 'setChatFilter',\n payload: newFilter,\n });\n }, [dispatch]);\n\n const handleSelectedIdsChange = useCallback((ids: number[]) => {\n if (mode === 'included') {\n dispatch({\n type: 'setIncludeFilters',\n payload: { ...state.includeFilters, includedChatIds: ids },\n });\n } else {\n dispatch({\n type: 'setExcludeFilters',\n payload: { ...state.excludeFilters, excludedChatIds: ids },\n });\n }\n }, [mode, state, dispatch]);\n\n const handleSelectedChatTypesChange = useCallback((keys: string[]) => {\n const newFilters: Record = {};\n keys.forEach((key) => {\n newFilters[key] = true;\n });\n\n if (mode === 'included') {\n dispatch({\n type: 'setIncludeFilters',\n payload: {\n includedChatIds: selectedChatIds,\n ...newFilters,\n },\n });\n } else {\n dispatch({\n type: 'setExcludeFilters',\n payload: {\n excludedChatIds: selectedChatIds,\n ...newFilters,\n },\n });\n }\n }, [mode, selectedChatIds, dispatch]);\n\n useHistoryBack(isActive, onReset, onScreenSelect,\n mode === 'included' ? SettingsScreens.FoldersIncludedChats : SettingsScreens.FoldersExcludedChats);\n\n if (!displayedIds) {\n return ;\n }\n\n return (\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chats: {\n byId: chatsById,\n listIds,\n orderedPinnedIds,\n },\n } = global;\n\n return {\n chatsById,\n listIds: listIds.active,\n orderedPinnedIds: orderedPinnedIds.active,\n archivedPinnedIds: orderedPinnedIds.archived,\n archivedListIds: listIds.archived,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadMoreChats']),\n)(SettingsFoldersChatFilters));\n","import React, { FC, memo, useCallback } from '../../../../lib/teact/teact';\n\nimport { ApiChatFolder } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { FolderEditDispatch, FoldersState } from '../../../../hooks/reducers/useFoldersReducer';\n\nimport SettingsFoldersMain from './SettingsFoldersMain';\nimport SettingsFoldersEdit from './SettingsFoldersEdit';\nimport SettingsFoldersChatFilters from './SettingsFoldersChatFilters';\n\nimport './SettingsFolders.scss';\n\nconst TRANSITION_DURATION = 200;\n\nexport type OwnProps = {\n currentScreen: SettingsScreens;\n shownScreen: SettingsScreens;\n state: FoldersState;\n dispatch: FolderEditDispatch;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\nconst SettingsFolders: FC = ({\n currentScreen,\n shownScreen,\n state,\n dispatch,\n isActive,\n onScreenSelect,\n onReset,\n}) => {\n const handleReset = useCallback(() => {\n if (\n currentScreen === SettingsScreens.FoldersCreateFolder\n || currentScreen === SettingsScreens.FoldersEditFolder\n || currentScreen === SettingsScreens.FoldersEditFolderFromChatList\n ) {\n setTimeout(() => {\n dispatch({ type: 'reset' });\n }, TRANSITION_DURATION);\n }\n\n if (\n currentScreen === SettingsScreens.FoldersIncludedChats\n || currentScreen === SettingsScreens.FoldersExcludedChats\n ) {\n if (state.mode === 'create') {\n onScreenSelect(SettingsScreens.FoldersCreateFolder);\n } else {\n onScreenSelect(SettingsScreens.FoldersEditFolder);\n }\n return;\n }\n\n onReset();\n }, [\n state.mode, dispatch,\n currentScreen, onReset, onScreenSelect,\n ]);\n\n const handleCreateFolder = useCallback(() => {\n dispatch({ type: 'reset' });\n onScreenSelect(SettingsScreens.FoldersCreateFolder);\n }, [onScreenSelect, dispatch]);\n\n const handleEditFolder = useCallback((folder: ApiChatFolder) => {\n dispatch({ type: 'editFolder', payload: folder });\n onScreenSelect(SettingsScreens.FoldersEditFolder);\n }, [dispatch, onScreenSelect]);\n\n const handleAddIncludedChats = useCallback(() => {\n dispatch({ type: 'editIncludeFilters' });\n onScreenSelect(currentScreen === SettingsScreens.FoldersEditFolderFromChatList\n ? SettingsScreens.FoldersIncludedChatsFromChatList\n : SettingsScreens.FoldersIncludedChats);\n }, [currentScreen, dispatch, onScreenSelect]);\n\n const handleAddExcludedChats = useCallback(() => {\n dispatch({ type: 'editExcludeFilters' });\n onScreenSelect(currentScreen === SettingsScreens.FoldersEditFolderFromChatList\n ? SettingsScreens.FoldersExcludedChatsFromChatList\n : SettingsScreens.FoldersExcludedChats);\n }, [currentScreen, dispatch, onScreenSelect]);\n\n switch (currentScreen) {\n case SettingsScreens.Folders:\n return (\n \n );\n case SettingsScreens.FoldersCreateFolder:\n case SettingsScreens.FoldersEditFolder:\n case SettingsScreens.FoldersEditFolderFromChatList:\n return (\n \n );\n case SettingsScreens.FoldersIncludedChats:\n case SettingsScreens.FoldersIncludedChatsFromChatList:\n return (\n \n );\n case SettingsScreens.FoldersExcludedChats:\n case SettingsScreens.FoldersExcludedChatsFromChatList:\n return (\n \n );\n\n default:\n return undefined;\n }\n};\n\nexport default memo(SettingsFolders);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useCallback, useMemo, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport './RangeSlider.scss';\n\ntype OwnProps = {\n options?: string[];\n range?: { min: number; max: number; step?: number };\n label?: string;\n value: number;\n disabled?: boolean;\n onChange: (value: number) => void;\n};\n\nconst RangeSlider: FC = ({\n options,\n range,\n label,\n value,\n disabled,\n onChange,\n}) => {\n const lang = useLang();\n const handleChange = useCallback((event: ChangeEvent) => {\n onChange(Number(event.currentTarget.value));\n }, [onChange]);\n\n const className = buildClassName(\n 'RangeSlider',\n disabled && 'disabled',\n );\n\n const trackWidth = useMemo(() => {\n if (options) {\n return (value / (options.length - 1)) * 100;\n } else if (range) {\n const possibleValuesLength = (range.max - range.min) / (range.step || 1);\n return ((value - range.min) / possibleValuesLength) * 100;\n }\n return 0;\n }, [value, options, range]);\n\n const [min, max, step] = useMemo(() => {\n if (options) {\n return [0, options.length - 1, 1];\n } else if (range) {\n return [range.min, range.max, range.step || 1];\n }\n\n return [0, 0, 0];\n }, [range, options]);\n\n return (\n
\n {label && (\n
\n {label}\n {range && (\n {value}\n )}\n
\n )}\n
\n \n \n {options && (\n
\n {options.map((option, index) => (\n onChange(index)}\n >\n {option}\n
\n ))}\n
\n )}\n
\n
\n );\n};\n\nexport default memo(RangeSlider);\n","import React, { FC, memo, useRef } from '../../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiStickerSet } from '../../../api/types';\n\nimport { STICKER_SIZE_PICKER_HEADER } from '../../../config';\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMedia from '../../../hooks/useMedia';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport { getFirstLetters } from '../../../util/textFormat';\n\nimport AnimatedSticker from '../../common/AnimatedSticker';\n\ntype OwnProps = {\n size?: number;\n stickerSet: ApiStickerSet;\n observeIntersection: ObserveFn;\n};\n\nconst StickerSetCoverAnimated: FC = ({\n size = STICKER_SIZE_PICKER_HEADER,\n stickerSet,\n observeIntersection,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const mediaHash = `stickerSet${stickerSet.id}`;\n const lottieData = useMedia(mediaHash, !isIntersecting, ApiMediaFormat.Lottie);\n const { shouldRenderFullMedia, transitionClassNames } = useTransitionForMedia(lottieData, 'slow');\n\n return (\n
\n {!shouldRenderFullMedia && getFirstLetters(stickerSet.title, 2)}\n {shouldRenderFullMedia && lottieData && (\n \n )}\n
\n );\n};\n\nexport default memo(StickerSetCoverAnimated);\n","import React, { FC, memo, useRef } from '../../../lib/teact/teact';\n\nimport { ApiStickerSet } from '../../../api/types';\n\nimport { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver';\nimport useMedia from '../../../hooks/useMedia';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport { getFirstLetters } from '../../../util/textFormat';\n\ntype OwnProps = {\n stickerSet: ApiStickerSet;\n observeIntersection: ObserveFn;\n};\n\nconst StickerSetCover: FC = ({ stickerSet, observeIntersection }) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n\n const mediaData = useMedia(stickerSet.hasThumbnail && `stickerSet${stickerSet.id}`, !isIntersecting);\n const { shouldRenderFullMedia, transitionClassNames } = useTransitionForMedia(mediaData, 'slow');\n\n return (\n
\n {!shouldRenderFullMedia && getFirstLetters(stickerSet.title, 2)}\n {shouldRenderFullMedia && (\n \"\"\n )}\n
\n );\n};\n\nexport default memo(StickerSetCover);\n","import React, {\n FC, memo,\n} from '../../../lib/teact/teact';\nimport { ApiSticker, ApiStickerSet } from '../../../api/types';\n\nimport { STICKER_SIZE_GENERAL_SETTINGS } from '../../../config';\nimport { ObserveFn } from '../../../hooks/useIntersectionObserver';\nimport useLang from '../../../hooks/useLang';\n\nimport ListItem from '../../ui/ListItem';\nimport Button from '../../ui/Button';\nimport StickerSetCoverAnimated from '../../middle/composer/StickerSetCoverAnimated';\nimport StickerSetCover from '../../middle/composer/StickerSetCover';\nimport StickerButton from '../../common/StickerButton';\n\nimport './SettingsStickerSet.scss';\n\ntype OwnProps = {\n stickerSet?: ApiStickerSet;\n observeIntersection: ObserveFn;\n onClick: (value: ApiSticker) => void;\n};\n\nconst SettingsStickerSet: FC = ({\n stickerSet,\n observeIntersection,\n onClick,\n}) => {\n const lang = useLang();\n\n if (!stickerSet || !stickerSet.stickers) {\n return undefined;\n }\n\n const firstSticker = stickerSet.stickers?.[0];\n\n if (stickerSet.hasThumbnail || !firstSticker) {\n return (\n firstSticker && onClick(firstSticker)}\n >\n \n {stickerSet.isAnimated ? (\n \n ) : (\n \n )}\n \n
\n
{stickerSet.title}
\n
{lang('StickerPack.StickerCount', stickerSet.count, 'i')}
\n
\n \n );\n } else {\n return (\n onClick(firstSticker)}\n >\n \n
\n
{stickerSet.title}
\n
{lang('StickerPack.StickerCount', stickerSet.count, 'i')}
\n
\n \n );\n }\n};\n\nexport default memo(SettingsStickerSet);\n","import React, {\n FC, useCallback, memo, useEffect, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { SettingsScreens, ISettings } from '../../../types';\nimport { ApiSticker, ApiStickerSet } from '../../../api/types';\n\nimport { IS_IOS, IS_MAC_OS, IS_TOUCH_ENV } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport RangeSlider from '../../ui/RangeSlider';\nimport Checkbox from '../../ui/Checkbox';\nimport RadioGroup from '../../ui/RadioGroup';\nimport SettingsStickerSet from './SettingsStickerSet';\nimport StickerSetModal from '../../common/StickerSetModal.async';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = Pick & {\n stickerSetIds?: string[];\n stickerSetsById?: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst ANIMATION_LEVEL_OPTIONS = [\n 'Solid and Steady',\n 'Nice and Fast',\n 'Lots of Stuff',\n];\n\nconst SettingsGeneral: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n stickerSetIds,\n stickerSetsById,\n messageTextSize,\n animationLevel,\n messageSendKeyCombo,\n shouldAutoDownloadMediaFromContacts,\n shouldAutoDownloadMediaInPrivateChats,\n shouldAutoDownloadMediaInGroups,\n shouldAutoDownloadMediaInChannels,\n shouldAutoPlayGifs,\n shouldAutoPlayVideos,\n shouldSuggestStickers,\n shouldLoopStickers,\n setSettingOption,\n loadStickerSets,\n loadAddedStickers,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const stickerSettingsRef = useRef(null);\n const { observe: observeIntersectionForCovers } = useIntersectionObserver({ rootRef: stickerSettingsRef });\n const [isModalOpen, openModal, closeModal] = useFlag();\n const [sticker, setSticker] = useState();\n\n const lang = useLang();\n\n const KEYBOARD_SEND_OPTIONS = !IS_TOUCH_ENV ? [\n { value: 'enter', label: lang('lng_settings_send_enter'), subLabel: 'New line by Shift + Enter' },\n {\n value: 'ctrl-enter',\n label: lang(IS_MAC_OS ? 'lng_settings_send_cmdenter' : 'lng_settings_send_ctrlenter'),\n subLabel: 'New line by Enter',\n },\n ] : undefined;\n\n useEffect(() => {\n loadStickerSets();\n }, [loadStickerSets]);\n\n useEffect(() => {\n if (stickerSetIds?.length) {\n loadAddedStickers();\n }\n }, [stickerSetIds, loadAddedStickers]);\n\n const handleAnimationLevelChange = useCallback((newLevel: number) => {\n ANIMATION_LEVEL_OPTIONS.forEach((_, i) => {\n document.body.classList.toggle(`animation-level-${i}`, newLevel === i);\n });\n\n setSettingOption({ animationLevel: newLevel });\n }, [setSettingOption]);\n\n const handleMessageTextSizeChange = useCallback((newSize: number) => {\n document.documentElement.style.setProperty(\n '--composer-text-size', `${Math.max(newSize, IS_IOS ? 16 : 15)}px`,\n );\n document.documentElement.style.setProperty('--message-meta-height', `${Math.floor(newSize * 1.3125)}px`);\n document.documentElement.style.setProperty('--message-text-size', `${newSize}px`);\n document.documentElement.setAttribute('data-message-text-size', newSize.toString());\n\n setSettingOption({ messageTextSize: newSize });\n }, [setSettingOption]);\n\n const handleStickerSetClick = useCallback((value: ApiSticker) => {\n setSticker(value);\n openModal();\n }, [openModal]);\n\n const stickerSets = stickerSetIds && stickerSetIds.map((id: string) => {\n return stickerSetsById?.[id]?.installedDate ? stickerSetsById[id] : false;\n }).filter(Boolean as any);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.General);\n\n return (\n
\n
\n

{lang('SETTINGS')}

\n\n \n\n onScreenSelect(SettingsScreens.GeneralChatBackground)}\n >\n {lang('ChatBackground')}\n \n
\n\n
\n

\n Animation Level\n

\n

\n Choose the desired animations amount.\n

\n\n \n
\n\n {KEYBOARD_SEND_OPTIONS && (\n
\n

{lang('VoiceOver.Keyboard')}

\n\n setSettingOption({ messageSendKeyCombo: value })}\n selected={messageSendKeyCombo}\n />\n
\n )}\n\n
\n

{lang('AutoDownloadMedia')}

\n\n setSettingOption({ shouldAutoDownloadMediaFromContacts: isChecked })}\n />\n setSettingOption({ shouldAutoDownloadMediaInPrivateChats: isChecked })}\n />\n setSettingOption({ shouldAutoDownloadMediaInGroups: isChecked })}\n />\n setSettingOption({ shouldAutoDownloadMediaInChannels: isChecked })}\n />\n
\n\n
\n

{lang('AutoplayMedia')}

\n\n setSettingOption({ shouldAutoPlayGifs: isChecked })}\n />\n setSettingOption({ shouldAutoPlayVideos: isChecked })}\n />\n
\n\n
\n

{lang('AccDescrStickers')}

\n\n setSettingOption({ shouldSuggestStickers: isChecked })}\n />\n setSettingOption({ shouldLoopStickers: isChecked })}\n />\n\n
\n {stickerSets && stickerSets.map((stickerSet: ApiStickerSet) => (\n \n ))}\n
\n {sticker && (\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n ...pick(global.settings.byKey, [\n 'messageTextSize',\n 'animationLevel',\n 'messageSendKeyCombo',\n 'shouldAutoDownloadMediaFromContacts',\n 'shouldAutoDownloadMediaInPrivateChats',\n 'shouldAutoDownloadMediaInGroups',\n 'shouldAutoDownloadMediaInChannels',\n 'shouldAutoPlayGifs',\n 'shouldAutoPlayVideos',\n 'shouldSuggestStickers',\n 'shouldLoopStickers',\n 'isSensitiveEnabled',\n 'canChangeSensitive',\n ]),\n stickerSetIds: global.stickers.added.setIds,\n stickerSetsById: global.stickers.setsById,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setSettingOption', 'loadStickerSets', 'loadAddedStickers',\n ]),\n)(SettingsGeneral));\n","let fileSelector: HTMLInputElement;\n\nexport function openSystemFilesDialog(accept = '*', callback: (e: Event) => void, noMultiple = false) {\n if (!fileSelector) {\n fileSelector = document.createElement('input');\n fileSelector.setAttribute('type', 'file');\n }\n\n fileSelector.setAttribute('accept', accept);\n\n if (noMultiple) {\n fileSelector.removeAttribute('multiple');\n } else {\n fileSelector.setAttribute('multiple', 'multiple');\n }\n\n // eslint-disable-next-line no-null/no-null\n fileSelector.onchange = null;\n fileSelector.value = '';\n fileSelector.onchange = callback;\n\n fileSelector.click();\n}\n","/* eslint-disable eqeqeq */\n/* eslint-disable prefer-template */\n/* eslint-disable prefer-const */\n/* eslint-disable prefer-destructuring */\n/* eslint-disable one-var */\n/* eslint-disable one-var-declaration-per-line */\n\nimport { preloadImage } from './files';\n\n/**\n * HEX > RGB\n * input: 'xxxxxx' (ex. 'ed15fa') case-insensitive\n * output: [r, g, b] ([0-255, 0-255, 0-255])\n */\nexport function hex2rgb(param: string): [number, number, number] {\n return [\n parseInt(param.substring(0, 2), 16),\n parseInt(param.substring(2, 4), 16),\n parseInt(param.substring(4, 6), 16),\n ];\n}\n\n/**\n * RGB > HEX\n * input: [r, g, b] ([0-255, 0-255, 0-255])\n * output: 'xxxxxx' (ex. 'ff0000')\n */\nexport function rgb2hex(param: [number, number, number]) {\n const p0 = param[0].toString(16);\n const p1 = param[1].toString(16);\n const p2 = param[2].toString(16);\n return (p0.length == 1 ? '0' + p0 : p0) + (p1.length == 1 ? '0' + p1 : p1) + (p2.length == 1 ? '0' + p2 : p2);\n}\n\n/**\n * Converts an RGB color value to HSV. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\n * Assumes r, g, and b are contained in the set [0, 255] and\n * returns h, s, and v in the set [0, 1].\n *\n * @param Number r The red color value\n * @param Number g The green color value\n * @param Number b The blue color value\n * @return Array The HSV representation\n */\nexport function rgb2hsb([r, g, b]: [number, number, number]): [number, number, number] {\n r /= 255;\n g /= 255;\n b /= 255;\n\n let max = Math.max(r, g, b), min = Math.min(r, g, b);\n let h!: number, s: number, v: number = max;\n\n let d = max - min;\n s = max == 0 ? 0 : d / max;\n\n if (max == min) {\n h = 0; // achromatic\n } else {\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n\n h /= 6;\n }\n\n return [h, s, v];\n}\n\n/**\n * Converts an HSV color value to RGB. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\n * Assumes h, s, and v are contained in the set [0, 1] and\n * returns r, g, and b in the set [0, 255].\n *\n * @param Number h The hue\n * @param Number s The saturation\n * @param Number v The value\n * @return Array The RGB representation\n */\nexport function hsb2rgb([h, s, v]: [number, number, number]): [number, number, number] {\n let r!: number, g!: number, b!: number;\n\n let i = Math.floor(h * 6);\n let f = h * 6 - i;\n let p = v * (1 - s);\n let q = v * (1 - f * s);\n let t = v * (1 - (1 - f) * s);\n\n switch (i % 6) {\n case 0:\n r = v;\n g = t;\n b = p;\n break;\n case 1:\n r = q;\n g = v;\n b = p;\n break;\n case 2:\n r = p;\n g = v;\n b = t;\n break;\n case 3:\n r = p;\n g = q;\n b = v;\n break;\n case 4:\n r = t;\n g = p;\n b = v;\n break;\n case 5:\n r = v;\n g = p;\n b = q;\n break;\n }\n\n return [\n Math.round(r * 255),\n Math.round(g * 255),\n Math.round(b * 255),\n ];\n}\n\nexport async function getAverageColor(url: string): Promise<[number, number, number]> {\n // Only visit every 5 pixels\n const blockSize = 5;\n const defaultRGB: [number, number, number] = [0, 0, 0];\n let data;\n let width;\n let height;\n let i = -4;\n let length;\n let rgb: [number, number, number] = [0, 0, 0];\n let count = 0;\n\n const canvas = document.createElement('canvas');\n const context = canvas.getContext && canvas.getContext('2d');\n if (!context) {\n return defaultRGB;\n }\n\n const image = await preloadImage(url);\n height = image.naturalHeight || image.offsetHeight || image.height;\n width = image.naturalWidth || image.offsetWidth || image.width;\n canvas.height = height;\n canvas.width = width;\n\n context.drawImage(image, 0, 0);\n\n try {\n data = context.getImageData(0, 0, width, height);\n } catch (e) {\n return defaultRGB;\n }\n\n length = data.data.length;\n\n // eslint-disable-next-line no-cond-assign\n while ((i += blockSize * 4) < length) {\n ++count;\n rgb[0] += data.data[i];\n rgb[1] += data.data[i + 1];\n rgb[2] += data.data[i + 2];\n }\n\n rgb[0] = Math.floor(rgb[0] / count);\n rgb[1] = Math.floor(rgb[1] / count);\n rgb[2] = Math.floor(rgb[2] / count);\n\n return rgb;\n}\n\n// eslint-disable-next-line max-len\n// Function was adapted from https://github.com/telegramdesktop/tdesktop/blob/35ff621b5b52f7e3553fb0f990ea13ade7101b8e/Telegram/SourceFiles/data/data_wall_paper.cpp#L518\nexport function getPatternColor(rgbColor: [number, number, number]) {\n let [hue, saturation, value] = rgb2hsb(rgbColor);\n\n saturation = Math.min(1, saturation + 0.05 + 0.1 * (1 - saturation));\n value = value > 0.5\n ? Math.max(0, value * 0.65)\n : Math.max(0, Math.min(1, 1 - value * 0.65));\n\n return `hsla(${hue * 360}, ${saturation * 100}%, ${value * 100}%, .4)`;\n}\n","import React, {\n FC, memo, useCallback, useEffect, useState, useRef,\n} from '../../../lib/teact/teact';\nimport { ApiWallpaper } from '../../../api/types';\nimport { ThemeKey, UPLOADING_WALLPAPER_SLUG } from '../../../types';\n\nimport { CUSTOM_BG_CACHE_NAME } from '../../../config';\nimport * as cacheApi from '../../../util/cacheApi';\nimport { fetchBlob } from '../../../util/files';\nimport useTransitionForMedia from '../../../hooks/useTransitionForMedia';\nimport buildClassName from '../../../util/buildClassName';\nimport useMedia from '../../../hooks/useMedia';\nimport useMediaWithDownloadProgress from '../../../hooks/useMediaWithDownloadProgress';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useCanvasBlur from '../../../hooks/useCanvasBlur';\n\nimport ProgressSpinner from '../../ui/ProgressSpinner';\n\nimport './WallpaperTile.scss';\n\ntype OwnProps = {\n wallpaper: ApiWallpaper;\n theme: ThemeKey;\n isSelected: boolean;\n onClick: (slug: string) => void;\n};\n\nconst WallpaperTile: FC = ({\n wallpaper,\n theme,\n isSelected,\n onClick,\n}) => {\n const { slug, document } = wallpaper;\n const localMediaHash = `wallpaper${document.id!}`;\n const localBlobUrl = document.previewBlobUrl;\n const previewBlobUrl = useMedia(`${localMediaHash}?size=m`);\n const thumbRef = useCanvasBlur(\n document.thumbnail?.dataUri,\n Boolean(previewBlobUrl),\n true,\n );\n const {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(previewBlobUrl || localBlobUrl, 'slow');\n const [isDownloadAllowed, setIsDownloadAllowed] = useState(false);\n const {\n mediaData: fullMedia, downloadProgress,\n } = useMediaWithDownloadProgress(localMediaHash, !isDownloadAllowed);\n const wasDownloadDisabled = usePrevious(isDownloadAllowed) === false;\n const { shouldRender: shouldRenderSpinner, transitionClassNames: spinnerClassNames } = useShowTransition(\n (isDownloadAllowed && !fullMedia) || slug === UPLOADING_WALLPAPER_SLUG,\n undefined,\n wasDownloadDisabled,\n 'slow',\n );\n // To prevent triggering of the effect for useCallback\n const cacheKeyRef = useRef();\n cacheKeyRef.current = theme;\n\n const handleSelect = useCallback(() => {\n (async () => {\n const blob = await fetchBlob(fullMedia!);\n await cacheApi.save(CUSTOM_BG_CACHE_NAME, cacheKeyRef.current!, blob);\n onClick(slug);\n })();\n }, [fullMedia, onClick, slug]);\n\n useEffect(() => {\n if (fullMedia) {\n handleSelect();\n }\n }, [fullMedia, handleSelect]);\n\n const handleClick = useCallback(() => {\n if (fullMedia) {\n handleSelect();\n } else {\n setIsDownloadAllowed((isAllowed) => !isAllowed);\n }\n }, [fullMedia, handleSelect]);\n\n const className = buildClassName(\n 'WallpaperTile',\n isSelected && 'selected',\n );\n\n return (\n
\n
\n {shouldRenderThumb && (\n \n )}\n {shouldRenderFullMedia && (\n \n )}\n {shouldRenderSpinner && (\n
\n \n
\n )}\n
\n
\n );\n};\n\nexport default memo(WallpaperTile);\n","import React, {\n FC, memo, useEffect, useCallback, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { SettingsScreens, ThemeKey, UPLOADING_WALLPAPER_SLUG } from '../../../types';\nimport { ApiWallpaper } from '../../../api/types';\n\nimport { DARK_THEME_PATTERN_COLOR, DEFAULT_PATTERN_COLOR } from '../../../config';\nimport { pick } from '../../../util/iteratees';\nimport { throttle } from '../../../util/schedulers';\nimport { openSystemFilesDialog } from '../../../util/systemFilesDialog';\nimport { getAverageColor, getPatternColor, rgb2hex } from '../../../util/colors';\nimport { selectTheme } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport Loading from '../../ui/Loading';\nimport WallpaperTile from './WallpaperTile';\n\nimport './SettingsGeneralBackground.scss';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n background?: string;\n isBlurred?: boolean;\n loadedWallpapers?: ApiWallpaper[];\n theme: ThemeKey;\n};\n\ntype DispatchProps = Pick;\n\nconst SUPPORTED_TYPES = 'image/jpeg';\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst SettingsGeneralBackground: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n background,\n isBlurred,\n loadedWallpapers,\n theme,\n loadWallpapers,\n uploadWallpaper,\n setThemeSettings,\n}) => {\n const themeRef = useRef();\n themeRef.current = theme;\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadWallpapers();\n });\n }, [loadWallpapers]);\n\n const handleFileSelect = useCallback((e: Event) => {\n const { files } = e.target as HTMLInputElement;\n\n if (files && files.length > 0) {\n uploadWallpaper(files[0]);\n }\n }, [uploadWallpaper]);\n\n const handleUploadWallpaper = useCallback(() => {\n openSystemFilesDialog(SUPPORTED_TYPES, handleFileSelect, true);\n }, [handleFileSelect]);\n\n const handleSetColor = useCallback(() => {\n onScreenSelect(SettingsScreens.GeneralChatBackgroundColor);\n }, [onScreenSelect]);\n\n const handleResetToDefault = useCallback(() => {\n setThemeSettings({\n theme,\n background: undefined,\n backgroundColor: undefined,\n isBlurred: true,\n patternColor: theme === 'dark' ? DARK_THEME_PATTERN_COLOR : DEFAULT_PATTERN_COLOR,\n });\n }, [setThemeSettings, theme]);\n\n const handleWallPaperSelect = useCallback((slug: string) => {\n setThemeSettings({ theme: themeRef.current, background: slug });\n const currentWallpaper = loadedWallpapers && loadedWallpapers.find((wallpaper) => wallpaper.slug === slug);\n if (currentWallpaper?.document.thumbnail) {\n getAverageColor(currentWallpaper.document.thumbnail.dataUri)\n .then((color) => {\n const patternColor = getPatternColor(color);\n const rgbColor = `#${rgb2hex(color)}`;\n setThemeSettings({ theme: themeRef.current, backgroundColor: rgbColor, patternColor });\n });\n }\n }, [loadedWallpapers, setThemeSettings]);\n\n const handleWallPaperBlurChange = useCallback((e: React.ChangeEvent) => {\n setThemeSettings({ theme: themeRef.current, isBlurred: e.target.checked });\n }, [setThemeSettings]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.GeneralChatBackground);\n\n const isUploading = loadedWallpapers?.[0] && loadedWallpapers[0].slug === UPLOADING_WALLPAPER_SLUG;\n\n return (\n
\n
\n \n {lang('UploadImage')}\n \n\n \n {lang('SetColor')}\n \n\n \n {lang('ThemeResetToDefaults')}\n \n\n \n
\n\n {loadedWallpapers ? (\n
\n {loadedWallpapers.map((wallpaper) => (\n \n ))}\n
\n ) : (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const theme = selectTheme(global);\n const { background, isBlurred } = global.settings.themes[theme] || {};\n const { loadedWallpapers } = global.settings;\n\n return {\n background,\n isBlurred,\n loadedWallpapers,\n theme,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadWallpapers', 'uploadWallpaper', 'setThemeSettings',\n ]),\n)(SettingsGeneralBackground));\n","import { ChangeEvent, MutableRefObject, RefObject } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { SettingsScreens, ThemeKey } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport {\n getPatternColor, hex2rgb, hsb2rgb, rgb2hex, rgb2hsb,\n} from '../../../util/colors';\nimport { captureEvents, RealTouchEvent } from '../../../util/captureEvents';\nimport { selectTheme } from '../../../modules/selectors';\nimport useFlag from '../../../hooks/useFlag';\nimport buildClassName from '../../../util/buildClassName';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport InputText from '../../ui/InputText';\n\nimport './SettingsGeneralBackgroundColor.scss';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n backgroundColor?: string;\n theme: ThemeKey;\n};\n\ntype DispatchProps = Pick;\n\ninterface CanvasRects {\n colorRect: {\n offsetLeft: number;\n top: number;\n width: number;\n height: number;\n };\n hueRect: {\n offsetLeft: number;\n width: number;\n };\n}\n\nconst DEFAULT_HSB = rgb2hsb(hex2rgb('e6ebee'));\nconst PREDEFINED_COLORS = [\n '#e6ebee', '#b2cee1', '#008dd0', '#c6e7cb', '#c4e1a6', '#60b16e',\n '#ccd0af', '#a6a997', '#7a7072', '#fdd7af', '#fdb76e', '#dd8851',\n];\n\nconst SettingsGeneralBackground: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n theme,\n backgroundColor,\n setThemeSettings,\n}) => {\n const themeRef = useRef();\n themeRef.current = theme;\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const colorPickerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const huePickerRef = useRef(null);\n const isFirstRunRef = useRef(true);\n\n const [hsb, setHsb] = useState(getInitialHsb(backgroundColor));\n // Cache for drag handlers\n const hsbRef = useRef(hsb);\n useEffect(() => {\n hsbRef.current = hsb;\n }, [hsb]);\n\n const [isDragging, markIsDragging, unmarkIsDragging] = useFlag();\n const [rgbInput, setRgbInput] = useState('');\n const [hexInput, setHexInput] = useState('');\n\n const rectsRef = useRef();\n const colorCtxRef = useRef();\n\n // Setup: cache rects, subscribe for drag events\n useEffect(() => {\n // We use `offsetLeft` instead of `left` to support screen transition\n const colorRect = {\n offsetLeft: colorPickerRef.current!.offsetLeft,\n ...pick(colorPickerRef.current!.getBoundingClientRect(), ['top', 'width', 'height']),\n };\n const hueRect = {\n offsetLeft: huePickerRef.current!.offsetLeft,\n ...pick(huePickerRef.current!.getBoundingClientRect(), ['width']),\n };\n\n rectsRef.current = { colorRect, hueRect };\n\n function handleColorDrag(e: MouseEvent | RealTouchEvent) {\n const colorPosition = [\n Math.min(Math.max(0, e.pageX! - colorRect.offsetLeft), colorRect.width - 1),\n Math.min(Math.max(0, e.pageY! - colorRect.top + containerRef.current!.scrollTop), colorRect.height - 1),\n ];\n\n const { huePosition } = hsb2positions(hsbRef.current, rectsRef.current!);\n\n setHsb(positions2hsb({ colorPosition, huePosition }, rectsRef.current!));\n markIsDragging();\n\n return true;\n }\n\n captureEvents(colorPickerRef.current!, {\n onCapture: handleColorDrag,\n onDrag: handleColorDrag,\n onRelease: unmarkIsDragging,\n onClick: unmarkIsDragging,\n selectorToPreventScroll: '.SettingsGeneralBackgroundColor',\n withCursor: true,\n });\n\n function handleHueDrag(e: MouseEvent | RealTouchEvent) {\n const { colorPosition } = hsb2positions(hsbRef.current, rectsRef.current!);\n const huePosition = Math.min(Math.max(0, e.pageX! - hueRect.offsetLeft), hueRect.width - 1);\n\n setHsb(positions2hsb({ colorPosition, huePosition }, rectsRef.current!));\n markIsDragging();\n\n return true;\n }\n\n captureEvents(huePickerRef.current!, {\n onCapture: handleHueDrag,\n onDrag: handleHueDrag,\n onRelease: unmarkIsDragging,\n onClick: unmarkIsDragging,\n selectorToPreventScroll: '.SettingsGeneralBackgroundColor',\n withCursor: true,\n });\n }, [markIsDragging, unmarkIsDragging]);\n\n const { colorPosition = [0, 0], huePosition = 0 } = rectsRef.current ? hsb2positions(hsb, rectsRef.current) : {};\n const hex = rgb2hex(hsb2rgb(hsb));\n const hue = hsb[0];\n const hueHex = rgb2hex(hsb2rgb([hue, 1, 1]));\n\n // Save value and update inputs when HSL changes\n useEffect(() => {\n const rgb = hsb2rgb(hsb);\n const color = `#${rgb2hex(rgb)}`;\n\n setRgbInput(rgb.join(', '));\n setHexInput(color);\n\n if (!isFirstRunRef.current) {\n const patternColor = getPatternColor(rgb);\n setThemeSettings({\n theme: themeRef.current,\n background: undefined,\n backgroundColor: color,\n patternColor,\n });\n }\n isFirstRunRef.current = false;\n }, [hsb, setThemeSettings]);\n\n // Redraw color picker when hue changes\n useEffect(() => {\n drawColor(colorPickerRef.current!.firstChild as HTMLCanvasElement, hue, colorCtxRef, rectsRef);\n }, [hue]);\n\n // Initially draw hue picker\n useEffect(() => {\n drawHue(huePickerRef.current!.firstChild as HTMLCanvasElement);\n }, []);\n\n const handleRgbChange = useCallback((e: ChangeEvent) => {\n const rgbValue = e.currentTarget.value.replace(/[^\\d, ]/g, '').slice(0, 13);\n\n if (rgbValue.match(/^\\d{1,3},\\s?\\d{1,3},\\s?\\d{1,3}$/)) {\n const rgb = rgbValue.split(',').map((channel) => Number(channel.trim())) as [number, number, number];\n setHsb(rgb2hsb(rgb));\n }\n\n e.currentTarget.value = rgbValue;\n }, []);\n\n const handleHexChange = useCallback((e: ChangeEvent) => {\n const hexValue = e.currentTarget.value.replace(/[^0-9a-fA-F]/g, '').slice(0, 6);\n\n if (hexValue.match(/^#?[0-9a-fA-F]{6}$/)) {\n setHsb(rgb2hsb(hex2rgb(hexValue.replace('#', ''))));\n }\n\n e.currentTarget.value = hexValue;\n }, []);\n\n const handlePredefinedColorClick = useCallback((e: React.MouseEvent) => {\n setHsb(rgb2hsb(hex2rgb(e.currentTarget.dataset.color!.replace('#', ''))));\n }, []);\n\n const className = buildClassName(\n 'SettingsGeneralBackgroundColor settings-content custom-scroll',\n isDragging && 'is-dragging',\n );\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.GeneralChatBackgroundColor);\n\n return (\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n {PREDEFINED_COLORS.map((color) => (\n \n ))}\n
\n
\n );\n};\n\nfunction getInitialHsb(backgroundColor?: string) {\n return backgroundColor && backgroundColor.startsWith('#')\n ? rgb2hsb(hex2rgb(backgroundColor.replace('#', '')))\n : DEFAULT_HSB;\n}\n\nfunction hsb2positions(hsb: [number, number, number], rects: CanvasRects) {\n return {\n colorPosition: [\n Math.round((hsb[1]) * (rects.colorRect.width - 1)),\n Math.round((1 - hsb[2]) * (rects.colorRect.height - 1)),\n ],\n huePosition: Math.round(hsb[0] * (rects.hueRect.width - 1)),\n };\n}\n\nfunction positions2hsb(\n { colorPosition, huePosition }: { colorPosition: number[]; huePosition: number },\n rects: CanvasRects,\n): [number, number, number] {\n return [\n huePosition / (rects.hueRect.width - 1),\n colorPosition[0] / (rects.colorRect.width - 1),\n 1 - colorPosition[1] / (rects.colorRect.height - 1),\n ];\n}\n\nfunction drawColor(\n canvas: HTMLCanvasElement,\n hue: number,\n colorCtxRef: MutableRefObject,\n rectsRef: RefObject,\n) {\n let w: number;\n let h: number;\n let ctx: CanvasRenderingContext2D;\n\n if (!colorCtxRef.current || !rectsRef.current) {\n // First run\n w = canvas.offsetWidth;\n h = canvas.offsetHeight;\n ctx = canvas.getContext('2d')!;\n\n canvas.width = w;\n canvas.height = h;\n\n colorCtxRef.current = ctx;\n } else {\n w = rectsRef.current.colorRect.width;\n h = rectsRef.current.colorRect.height;\n ctx = colorCtxRef.current;\n }\n\n const imgData = ctx!.createImageData(w, h);\n const pixels = imgData.data;\n const col = hsb2rgb([hue, 1, 1]);\n\n let index = 0;\n\n for (let y = 0; y < h; y++) {\n const perY = 1 - y / (h - 1);\n const st = [255 * perY, 255 * perY, 255 * perY];\n const ed = [col[0] * perY, col[1] * perY, col[2] * perY];\n for (let x = 0; x < w; x++) {\n const perX = x / (w - 1);\n pixels[index++] = st[0] + (ed[0] - st[0]) * perX;\n pixels[index++] = st[1] + (ed[1] - st[1]) * perX;\n pixels[index++] = st[2] + (ed[2] - st[2]) * perX;\n pixels[index++] = 255;\n }\n }\n\n ctx!.putImageData(imgData, 0, 0);\n}\n\nfunction drawHue(canvas: HTMLCanvasElement) {\n const w = canvas.offsetWidth;\n const h = 1;\n canvas.width = w;\n canvas.height = h;\n const ctx = canvas.getContext('2d')!;\n\n const imgData = ctx.createImageData(w, h);\n const pixels = imgData.data;\n\n let index = 0;\n\n for (let x = 0; x < w; x++) {\n const hue = x / (w - 1);\n const rgb = hsb2rgb([hue, 1, 1]);\n /* eslint-disable prefer-destructuring */\n pixels[index++] = rgb[0];\n pixels[index++] = rgb[1];\n pixels[index++] = rgb[2];\n /* eslint-enable prefer-destructuring */\n pixels[index++] = 255;\n }\n\n ctx.putImageData(imgData, 0, 0);\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const theme = selectTheme(global);\n const { backgroundColor } = global.settings.themes[theme] || {};\n return {\n backgroundColor,\n theme,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['setThemeSettings']),\n)(SettingsGeneralBackground));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport Checkbox from '../../ui/Checkbox';\nimport RangeSlider from '../../ui/RangeSlider';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n hasPrivateChatsNotifications: boolean;\n hasPrivateChatsMessagePreview: boolean;\n hasGroupNotifications: boolean;\n hasGroupMessagePreview: boolean;\n hasBroadcastNotifications: boolean;\n hasBroadcastMessagePreview: boolean;\n hasContactJoinedNotifications: boolean;\n hasWebNotifications: boolean;\n hasPushNotifications: boolean;\n notificationSoundVolume: number;\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsNotifications: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n hasPrivateChatsNotifications,\n hasPrivateChatsMessagePreview,\n hasGroupNotifications,\n hasGroupMessagePreview,\n hasBroadcastNotifications,\n hasBroadcastMessagePreview,\n hasContactJoinedNotifications,\n hasPushNotifications,\n hasWebNotifications,\n notificationSoundVolume,\n loadNotificationSettings,\n updateContactSignUpNotification,\n updateNotificationSettings,\n updateWebNotificationSettings,\n}) => {\n useEffect(() => {\n loadNotificationSettings();\n }, [loadNotificationSettings]);\n\n const handleSettingsChange = useCallback((\n e: ChangeEvent,\n peerType: 'contact' | 'group' | 'broadcast',\n setting: 'silent' | 'showPreviews',\n ) => {\n const currentIsSilent = peerType === 'contact'\n ? !hasPrivateChatsNotifications\n : !(peerType === 'group' ? hasGroupNotifications : hasBroadcastNotifications);\n const currentShouldShowPreviews = peerType === 'contact'\n ? hasPrivateChatsMessagePreview\n : (peerType === 'group' ? hasGroupMessagePreview : hasBroadcastMessagePreview);\n\n updateNotificationSettings({\n peerType,\n ...(setting === 'silent' && { isSilent: !e.target.checked, shouldShowPreviews: currentShouldShowPreviews }),\n ...(setting === 'showPreviews' && { shouldShowPreviews: e.target.checked, isSilent: currentIsSilent }),\n });\n }, [\n hasBroadcastMessagePreview, hasBroadcastNotifications,\n hasGroupMessagePreview, hasGroupNotifications,\n hasPrivateChatsMessagePreview, hasPrivateChatsNotifications,\n updateNotificationSettings,\n ]);\n\n const handleContactNotificationChange = useCallback((e: ChangeEvent) => {\n updateContactSignUpNotification({\n isSilent: !e.target.checked,\n });\n }, [updateContactSignUpNotification]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Notifications);\n\n return (\n
\n
\n

\n Web notifications\n

\n {\n updateWebNotificationSettings({ hasWebNotifications: e.target.checked });\n }}\n />\n {\n updateWebNotificationSettings({ hasPushNotifications: e.target.checked });\n }}\n />\n
\n {\n updateWebNotificationSettings({ notificationSoundVolume: volume });\n }}\n />\n
\n
\n
\n

\n {lang('AutodownloadPrivateChats')}\n

\n\n { handleSettingsChange(e, 'contact', 'silent'); }}\n />\n { handleSettingsChange(e, 'contact', 'showPreviews'); }}\n />\n
\n\n
\n

{lang('FilterGroups')}

\n\n { handleSettingsChange(e, 'group', 'silent'); }}\n />\n { handleSettingsChange(e, 'group', 'showPreviews'); }}\n />\n
\n\n
\n

{lang('FilterChannels')}

\n\n { handleSettingsChange(e, 'broadcast', 'silent'); }}\n />\n { handleSettingsChange(e, 'broadcast', 'showPreviews'); }}\n />\n
\n\n
\n

{lang('PhoneOther')}

\n\n \n
\n
\n );\n};\n\nexport default memo(withGlobal((global): StateProps => {\n return {\n hasPrivateChatsNotifications: Boolean(global.settings.byKey.hasPrivateChatsNotifications),\n hasPrivateChatsMessagePreview: Boolean(global.settings.byKey.hasPrivateChatsMessagePreview),\n hasGroupNotifications: Boolean(global.settings.byKey.hasGroupNotifications),\n hasGroupMessagePreview: Boolean(global.settings.byKey.hasGroupMessagePreview),\n hasBroadcastNotifications: Boolean(global.settings.byKey.hasBroadcastNotifications),\n hasBroadcastMessagePreview: Boolean(global.settings.byKey.hasBroadcastMessagePreview),\n hasContactJoinedNotifications: Boolean(global.settings.byKey.hasContactJoinedNotifications),\n hasWebNotifications: global.settings.byKey.hasWebNotifications,\n hasPushNotifications: global.settings.byKey.hasPushNotifications,\n notificationSoundVolume: global.settings.byKey.notificationSoundVolume,\n };\n},\n(setGlobal, actions): DispatchProps => pick(actions, [\n 'loadNotificationSettings',\n 'updateContactSignUpNotification',\n 'updateNotificationSettings',\n 'updateWebNotificationSettings',\n]))(SettingsNotifications));\n","import React, { FC, memo, useEffect } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { PrivacyVisibility, SettingsScreens } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n hasPassword?: boolean;\n blockedCount: number;\n sessionsCount: number;\n isSensitiveEnabled?: boolean;\n canChangeSensitive?: boolean;\n visibilityPrivacyPhoneNumber?: PrivacyVisibility;\n visibilityPrivacyLastSeen?: PrivacyVisibility;\n visibilityPrivacyProfilePhoto?: PrivacyVisibility;\n visibilityPrivacyForwarding?: PrivacyVisibility;\n visibilityPrivacyGroupChats?: PrivacyVisibility;\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsPrivacy: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n hasPassword,\n blockedCount,\n sessionsCount,\n isSensitiveEnabled,\n canChangeSensitive,\n visibilityPrivacyPhoneNumber,\n visibilityPrivacyLastSeen,\n visibilityPrivacyProfilePhoto,\n visibilityPrivacyForwarding,\n visibilityPrivacyGroupChats,\n loadPrivacySettings,\n loadBlockedContacts,\n loadAuthorizations,\n loadContentSettings,\n updateContentSettings,\n}) => {\n useEffect(() => {\n loadBlockedContacts();\n loadAuthorizations();\n loadPrivacySettings();\n loadContentSettings();\n }, [loadBlockedContacts, loadAuthorizations, loadPrivacySettings, loadContentSettings]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Privacy);\n\n function getVisibilityValue(visibility?: PrivacyVisibility) {\n switch (visibility) {\n case 'everybody':\n return lang('P2PEverybody');\n\n case 'contacts':\n return lang('P2PContacts');\n\n case 'nobody':\n return lang('P2PNobody');\n }\n\n return undefined;\n }\n\n return (\n
\n
\n onScreenSelect(SettingsScreens.PrivacyBlockedUsers)}\n >\n
\n {lang('BlockedUsers')}\n {blockedCount > 0 && (\n \n {lang('Users', blockedCount)}\n \n )}\n
\n \n onScreenSelect(\n hasPassword ? SettingsScreens.TwoFaEnabled : SettingsScreens.TwoFaDisabled,\n )}\n >\n
\n {lang('TwoStepVerification')}\n \n {lang(hasPassword ? 'PasswordOn' : 'PasswordOff')}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyActiveSessions)}\n >\n
\n {lang('SessionsTitle')}\n {sessionsCount > 0 && (\n \n {sessionsCount === 1 ? '1 session' : `${sessionsCount} sessions`}\n \n )}\n
\n \n
\n\n
\n

{lang('PrivacyTitle')}

\n\n onScreenSelect(SettingsScreens.PrivacyPhoneNumber)}\n >\n
\n {lang('PrivacyPhoneTitle')}\n \n {getVisibilityValue(visibilityPrivacyPhoneNumber)}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyLastSeen)}\n >\n
\n {lang('LastSeenTitle')}\n \n {getVisibilityValue(visibilityPrivacyLastSeen)}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyProfilePhoto)}\n >\n
\n {lang('PrivacyProfilePhotoTitle')}\n \n {getVisibilityValue(visibilityPrivacyProfilePhoto)}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyForwarding)}\n >\n
\n {lang('PrivacyForwardsTitle')}\n \n {getVisibilityValue(visibilityPrivacyForwarding)}\n \n
\n \n onScreenSelect(SettingsScreens.PrivacyGroupChats)}\n >\n
\n {lang('WhoCanAddMe')}\n \n {getVisibilityValue(visibilityPrivacyGroupChats)}\n \n
\n \n
\n\n {canChangeSensitive && (\n
\n

\n {lang('lng_settings_sensitive_title')}\n

\n \n
\n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n settings: {\n byKey: { hasPassword, isSensitiveEnabled, canChangeSensitive },\n privacy,\n },\n blocked,\n activeSessions,\n } = global;\n\n return {\n hasPassword,\n blockedCount: blocked.totalCount,\n sessionsCount: activeSessions.length,\n isSensitiveEnabled,\n canChangeSensitive,\n visibilityPrivacyPhoneNumber: privacy.phoneNumber?.visibility,\n visibilityPrivacyLastSeen: privacy.lastSeen?.visibility,\n visibilityPrivacyProfilePhoto: privacy.profilePhoto?.visibility,\n visibilityPrivacyForwarding: privacy.forwards?.visibility,\n visibilityPrivacyGroupChats: privacy.chatInvite?.visibility,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadBlockedContacts', 'loadAuthorizations', 'loadPrivacySettings', 'loadContentSettings', 'updateContentSettings',\n ]),\n)(SettingsPrivacy));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ISettings, LangCode, SettingsScreens } from '../../../types';\nimport { ApiLanguage } from '../../../api/types';\n\nimport { setLanguage } from '../../../util/langProvider';\nimport { pick } from '../../../util/iteratees';\n\nimport RadioGroup from '../../ui/RadioGroup';\nimport Loading from '../../ui/Loading';\nimport useFlag from '../../../hooks/useFlag';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = Pick;\n\ntype DispatchProps = Pick;\n\nconst SettingsLanguage: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n languages,\n language,\n loadLanguages,\n setSettingOption,\n}) => {\n const [selectedLanguage, setSelectedLanguage] = useState(language);\n const [isLoading, markIsLoading, unmarkIsLoading] = useFlag();\n\n // TODO Throttle\n useEffect(() => {\n loadLanguages();\n }, [loadLanguages]);\n\n const handleChange = useCallback((langCode: string) => {\n setSelectedLanguage(langCode);\n markIsLoading();\n\n void setLanguage(langCode as LangCode, () => {\n unmarkIsLoading();\n\n setSettingOption({ language: langCode });\n });\n }, [markIsLoading, unmarkIsLoading, setSettingOption]);\n\n const options = useMemo(() => {\n return languages ? buildOptions(languages) : undefined;\n }, [languages]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.Language);\n\n return (\n
\n {options ? (\n \n ) : (\n \n )}\n
\n );\n};\n\nfunction buildOptions(languages: ApiLanguage[]) {\n const currentLangCode = (window.navigator.language || 'en').toLowerCase();\n const shortLangCode = currentLangCode.substr(0, 2);\n\n return languages.map(({ langCode, nativeName, name }) => ({\n value: langCode,\n label: nativeName,\n subLabel: name,\n })).sort((a) => {\n return currentLangCode && (a.value === currentLangCode || a.value === shortLangCode) ? -1 : 0;\n });\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n languages: global.settings.byKey.languages,\n language: global.settings.byKey.language,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadLanguages', 'setSettingOption',\n ]),\n)(SettingsLanguage));\n","import { ApiPrivacyKey, SettingsScreens } from '../../../../types';\n\nexport function getPrivacyKey(screen: SettingsScreens): ApiPrivacyKey | undefined {\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n return 'phoneNumber';\n case SettingsScreens.PrivacyLastSeen:\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n return 'lastSeen';\n case SettingsScreens.PrivacyProfilePhoto:\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n return 'profilePhoto';\n case SettingsScreens.PrivacyForwarding:\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n return 'forwards';\n case SettingsScreens.PrivacyGroupChats:\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n return 'chatInvite';\n }\n\n return undefined;\n}\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\nimport { ApiPrivacySettings, SettingsScreens } from '../../../types';\n\nimport useLang from '../../../hooks/useLang';\nimport { pick } from '../../../util/iteratees';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport RadioGroup from '../../ui/RadioGroup';\nimport { getPrivacyKey } from './helper/privacy';\n\ntype OwnProps = {\n screen: SettingsScreens;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = Partial & {\n chatsById?: Record;\n usersById?: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsPrivacyVisibility: FC = ({\n screen,\n isActive,\n onScreenSelect,\n onReset,\n visibility,\n allowUserIds,\n allowChatIds,\n blockUserIds,\n blockChatIds,\n chatsById,\n setPrivacyVisibility,\n}) => {\n const lang = useLang();\n\n const visibilityOptions = useMemo(() => {\n switch (screen) {\n case SettingsScreens.PrivacyProfilePhoto:\n case SettingsScreens.PrivacyGroupChats:\n return [\n { value: 'everybody', label: lang('P2PEverybody') },\n { value: 'contacts', label: lang('P2PContacts') },\n ];\n\n default:\n return [\n { value: 'everybody', label: lang('P2PEverybody') },\n { value: 'contacts', label: lang('P2PContacts') },\n { value: 'nobody', label: lang('P2PNobody') },\n ];\n }\n }, [lang, screen]);\n\n const exceptionLists = {\n shouldShowDenied: visibility !== 'nobody',\n shouldShowAllowed: visibility !== 'everybody',\n };\n\n const privacyKey = getPrivacyKey(screen);\n\n const headerText = useMemo(() => {\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n return lang('PrivacyPhoneTitle');\n case SettingsScreens.PrivacyLastSeen:\n return lang('LastSeenTitle');\n case SettingsScreens.PrivacyProfilePhoto:\n return lang('PrivacyProfilePhotoTitle');\n case SettingsScreens.PrivacyForwarding:\n return lang('PrivacyForwardsTitle');\n case SettingsScreens.PrivacyGroupChats:\n return lang('WhoCanAddMe');\n default:\n return undefined;\n }\n }, [lang, screen]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n const descriptionText = useMemo(() => {\n switch (screen) {\n case SettingsScreens.PrivacyLastSeen:\n return lang('CustomHelp');\n default:\n return undefined;\n }\n }, [lang, screen]);\n\n const allowedContactsScreen = (() => {\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n return SettingsScreens.PrivacyPhoneNumberAllowedContacts;\n case SettingsScreens.PrivacyLastSeen:\n return SettingsScreens.PrivacyLastSeenAllowedContacts;\n case SettingsScreens.PrivacyProfilePhoto:\n return SettingsScreens.PrivacyProfilePhotoAllowedContacts;\n case SettingsScreens.PrivacyForwarding:\n return SettingsScreens.PrivacyForwardingAllowedContacts;\n default:\n return SettingsScreens.PrivacyGroupChatsAllowedContacts;\n }\n })();\n\n const deniedContactsScreen = (() => {\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n return SettingsScreens.PrivacyPhoneNumberDeniedContacts;\n case SettingsScreens.PrivacyLastSeen:\n return SettingsScreens.PrivacyLastSeenDeniedContacts;\n case SettingsScreens.PrivacyProfilePhoto:\n return SettingsScreens.PrivacyProfilePhotoDeniedContacts;\n case SettingsScreens.PrivacyForwarding:\n return SettingsScreens.PrivacyForwardingDeniedContacts;\n default:\n return SettingsScreens.PrivacyGroupChatsDeniedContacts;\n }\n })();\n\n const allowedCount = useMemo(() => {\n if (!allowUserIds || !allowChatIds || !chatsById) {\n return 0;\n }\n\n return allowChatIds.reduce((result, chatId) => {\n return result + (chatsById[chatId] ? chatsById[chatId].membersCount! : 0);\n }, allowUserIds.length);\n }, [allowChatIds, allowUserIds, chatsById]);\n\n const blockCount = useMemo(() => {\n if (!blockUserIds || !blockChatIds || !chatsById) {\n return 0;\n }\n\n return blockChatIds.reduce((result, chatId) => {\n return result + (chatsById[chatId] ? chatsById[chatId].membersCount! : 0);\n }, blockUserIds.length);\n }, [blockChatIds, blockUserIds, chatsById]);\n\n const handleVisibilityChange = useCallback((value) => {\n setPrivacyVisibility({\n privacyKey,\n visibility: value,\n });\n }, [privacyKey, setPrivacyVisibility]);\n\n return (\n
\n
\n

{headerText}

\n\n \n\n {descriptionText && (\n

{descriptionText}

\n )}\n
\n\n
\n

{lang('PrivacyExceptions')}

\n\n {exceptionLists.shouldShowAllowed && (\n { onScreenSelect(allowedContactsScreen); }}\n >\n
\n {allowedCount > 0 && +{allowedCount}}\n {lang('AlwaysShareWith')}\n {lang('EditAdminAddUsers')}\n
\n \n )}\n {exceptionLists.shouldShowDenied && (\n { onScreenSelect(deniedContactsScreen); }}\n >\n
\n {blockCount > 0 && −{blockCount}}\n {lang('NeverShareWith')}\n {lang('EditAdminAddUsers')}\n
\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { screen }): StateProps => {\n let privacySettings: ApiPrivacySettings | undefined;\n\n const {\n chats: { byId: chatsById },\n settings: { privacy },\n } = global;\n\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumber:\n privacySettings = privacy.phoneNumber;\n break;\n\n case SettingsScreens.PrivacyLastSeen:\n privacySettings = privacy.lastSeen;\n break;\n\n case SettingsScreens.PrivacyProfilePhoto:\n privacySettings = privacy.profilePhoto;\n break;\n\n case SettingsScreens.PrivacyForwarding:\n privacySettings = privacy.forwards;\n break;\n\n case SettingsScreens.PrivacyGroupChats:\n privacySettings = privacy.chatInvite;\n break;\n }\n\n if (!privacySettings) {\n return {};\n }\n\n return {\n ...privacySettings,\n chatsById,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['setPrivacyVisibility']),\n)(SettingsPrivacyVisibility));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiSession } from '../../../api/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport { formatPastTimeShort } from '../../../util/dateFormat';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n activeSessions: ApiSession[];\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsPrivacyActiveSessions: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n activeSessions,\n loadAuthorizations,\n terminateAuthorization,\n terminateAllAuthorizations,\n}) => {\n const [isConfirmTerminateAllDialogOpen, openConfirmTerminateAllDialog, closeConfirmTerminateAllDialog] = useFlag();\n useEffect(() => {\n loadAuthorizations();\n }, [loadAuthorizations]);\n\n const handleTerminateSessionClick = useCallback((hash: string) => {\n terminateAuthorization({ hash });\n }, [terminateAuthorization]);\n\n const handleTerminateAllSessions = useCallback(() => {\n closeConfirmTerminateAllDialog();\n terminateAllAuthorizations();\n }, [closeConfirmTerminateAllDialog, terminateAllAuthorizations]);\n\n const currentSession = useMemo(() => {\n return activeSessions.find((session) => session.isCurrent);\n }, [activeSessions]);\n\n const otherSessions = useMemo(() => {\n return activeSessions.filter((session) => !session.isCurrent);\n }, [activeSessions]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.PrivacyActiveSessions);\n\n function renderCurrentSession(session: ApiSession) {\n return (\n
\n

\n {lang('AuthSessions.CurrentSession')}\n

\n\n \n
\n {session.appName}\n {getDeviceEnvironment(session)}\n {session.ip} - {getLocation(session)}\n
\n
\n\n \n {lang('TerminateAllSessions')}\n \n
\n );\n }\n\n function renderOtherSessions(sessions: ApiSession[]) {\n return (\n
\n

\n {lang('OtherSessions')}\n

\n\n {sessions.map(renderSession)}\n
\n );\n }\n\n function renderSession(session: ApiSession) {\n return (\n {\n handleTerminateSessionClick(session.hash);\n },\n }]}\n className=\"no-icon\"\n >\n
\n {formatPastTimeShort(lang, session.dateActive * 1000)}\n {session.appName}\n {getDeviceEnvironment(session)}\n {session.ip} - {getLocation(session)}\n
\n \n );\n }\n\n return (\n
\n {currentSession && renderCurrentSession(currentSession)}\n {otherSessions && renderOtherSessions(otherSessions)}\n {otherSessions && (\n \n )}\n
\n );\n};\n\nfunction getLocation(session: ApiSession) {\n return [session.region, session.country].filter(Boolean).join(', ');\n}\n\nfunction getDeviceEnvironment(session: ApiSession) {\n return `${session.deviceModel}${session.deviceModel ? ', ' : ''} ${session.platform} ${session.systemVersion}`;\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n activeSessions: global.activeSessions,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadAuthorizations', 'terminateAuthorization', 'terminateAllAuthorizations',\n ]),\n)(SettingsPrivacyActiveSessions));\n","import React, {\n FC, memo, useCallback,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiCountryCode, ApiUser } from '../../../api/types';\nimport { SettingsScreens } from '../../../types';\n\nimport { CHAT_HEIGHT_PX } from '../../../config';\nimport { formatPhoneNumberWithCode } from '../../../util/phoneNumber';\nimport { pick } from '../../../util/iteratees';\nimport {\n getChatTitle, getUserFullName, isChatPrivate,\n} from '../../../modules/helpers';\nimport renderText from '../../common/helpers/renderText';\nimport buildClassName from '../../../util/buildClassName';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Avatar from '../../common/Avatar';\nimport Loading from '../../ui/Loading';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n chatsByIds: Record;\n usersByIds: Record;\n blockedIds: number[];\n phoneCodeList: ApiCountryCode[];\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsPrivacyBlockedUsers: FC = ({\n isActive,\n onScreenSelect,\n onReset,\n chatsByIds,\n usersByIds,\n blockedIds,\n phoneCodeList,\n unblockContact,\n}) => {\n const handleUnblockClick = useCallback((contactId: number) => {\n unblockContact({ contactId });\n }, [unblockContact]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.PrivacyBlockedUsers);\n\n function renderContact(contactId: number, i: number, viewportOffset: number) {\n const isPrivate = isChatPrivate(contactId);\n const user = isPrivate ? usersByIds[contactId] : undefined;\n const chat = !isPrivate ? chatsByIds[contactId] : undefined;\n\n const className = buildClassName(\n 'Chat chat-item-clickable blocked-list-item small-icon',\n isPrivate ? 'private' : 'group',\n );\n\n return (\n {\n handleUnblockClick(contactId);\n },\n }]}\n style={`top: ${(viewportOffset + i) * CHAT_HEIGHT_PX}px;`}\n >\n \n
\n

{renderText((isPrivate ? getUserFullName(user) : getChatTitle(lang, chat!)) || '')}

\n {user?.phoneNumber && (\n
{formatPhoneNumberWithCode(phoneCodeList, user.phoneNumber)}
\n )}\n {user && !user.phoneNumber && user.username && (\n
@{user.username}
\n )}\n
\n \n );\n }\n\n return (\n
\n
\n
\n

\n {lang('BlockedUsersInfo')}\n

\n
\n\n
\n {blockedIds?.length ? (\n
\n {blockedIds!.map((contactId, i) => renderContact(contactId, i, 0))}\n
\n ) : blockedIds && !blockedIds.length ? (\n
\n List is empty\n
\n ) : (\n \n )}\n
\n
\n\n {\n }}\n className=\"not-implemented\"\n ariaLabel=\"Add a blocked user\"\n >\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n chats: {\n byId: chatsByIds,\n },\n users: {\n byId: usersByIds,\n },\n blocked: {\n ids,\n },\n countryList: {\n phoneCodes: phoneCodeList,\n },\n } = global;\n\n return {\n chatsByIds,\n usersByIds,\n blockedIds: ids,\n phoneCodeList,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['unblockContact']),\n)(SettingsPrivacyBlockedUsers));\n","import React, { FC, memo } from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport ListItem from '../../../ui/ListItem';\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\nimport renderText from '../../../common/helpers/renderText';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n};\n\nconst SettingsTwoFaEnabled: FC = ({\n isActive, onReset, animatedEmoji, onScreenSelect,\n}) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.TwoFaEnabled);\n\n return (\n
\n
\n \n\n

\n {renderText(lang('EnabledPasswordText'), ['br'])}\n

\n
\n\n
\n onScreenSelect(SettingsScreens.TwoFaChangePasswordCurrent)}\n >\n {lang('ChangePassword')}\n \n onScreenSelect(SettingsScreens.TwoFaTurnOff)}\n >\n {lang('TurnPasswordOff')}\n \n onScreenSelect(SettingsScreens.TwoFaRecoveryEmailCurrentPassword)}\n >\n {lang('SetRecoveryEmail')}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal((global) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, '🔐'),\n };\n})(SettingsTwoFaEnabled));\n","import React, {\n FC, memo, useCallback, useState,\n} from '../../../../lib/teact/teact';\n\nimport { SettingsScreens } from '../../../../types';\n\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport PasswordMonkey from '../../../common/PasswordMonkey';\nimport PasswordForm from '../../../common/PasswordForm';\n\ntype OwnProps = {\n screen: SettingsScreens;\n error?: string;\n isLoading?: boolean;\n expectedPassword?: string;\n placeholder?: string;\n hint?: string;\n submitLabel?: string;\n clearError?: NoneToVoidFunction;\n onSubmit: (password: string) => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\nconst EQUAL_PASSWORD_ERROR = 'Passwords Should Be Equal';\n\nconst SettingsTwoFaPassword: FC = ({\n screen,\n isActive,\n onScreenSelect,\n onReset,\n error,\n isLoading,\n expectedPassword,\n placeholder = 'Current Password',\n hint,\n submitLabel,\n clearError,\n onSubmit,\n}) => {\n const [validationError, setValidationError] = useState('');\n const [shouldShowPassword, setShouldShowPassword] = useState(false);\n\n const handleSubmit = useCallback((newPassword) => {\n if (expectedPassword && newPassword !== expectedPassword) {\n setValidationError(EQUAL_PASSWORD_ERROR);\n } else {\n onSubmit(newPassword);\n }\n }, [onSubmit, expectedPassword]);\n\n const handleClearError = useCallback(() => {\n if (clearError) {\n clearError();\n }\n setValidationError('');\n }, [clearError]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n return (\n
\n
\n \n
\n\n
\n \n
\n
\n );\n};\n\nexport default memo(SettingsTwoFaPassword);\n","import React, { FC, memo } from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport Button from '../../../ui/Button';\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\n\ntype OwnProps = {\n onStart: NoneToVoidFunction;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n};\n\nconst SettingsTwoFaStart: FC = ({\n isActive, onScreenSelect, onReset, animatedEmoji, onStart,\n}) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.TwoFaDisabled);\n\n return (\n
\n
\n \n\n

\n {lang('SetAdditionalPasswordInfo')}\n

\n
\n\n
\n \n
\n
\n );\n};\n\nexport default memo(withGlobal((global) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, '🔐'),\n };\n})(SettingsTwoFaStart));\n","import React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../../util/environment';\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useFlag from '../../../../hooks/useFlag';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport Button from '../../../ui/Button';\nimport Modal from '../../../ui/Modal';\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\nimport InputText from '../../../ui/InputText';\nimport renderText from '../../../common/helpers/renderText';\n\ntype OwnProps = {\n icon: 'hint' | 'email';\n type?: 'text' | 'email';\n isLoading?: boolean;\n error?: string;\n placeholder: string;\n shouldConfirm?: boolean;\n clearError?: NoneToVoidFunction;\n onSubmit: (value?: string) => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n screen: SettingsScreens;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n};\n\nconst FOCUS_DELAY_TIMEOUT_MS = IS_SINGLE_COLUMN_LAYOUT ? 550 : 400;\n\nconst SettingsTwoFaSkippableForm: FC = ({\n animatedEmoji,\n type = 'text',\n isLoading,\n error,\n placeholder,\n shouldConfirm,\n clearError,\n onSubmit,\n isActive,\n onScreenSelect,\n onReset,\n screen,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n\n const [value, setValue] = useState('');\n const [isConfirmShown, markIsConfirmShown, unmarkIsConfirmShown] = useFlag(false);\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n setTimeout(() => {\n inputRef.current!.focus();\n }, FOCUS_DELAY_TIMEOUT_MS);\n }\n }, []);\n\n const handleInputChange = (e: React.ChangeEvent) => {\n if (error && clearError) {\n clearError();\n }\n\n setValue(e.target.value);\n };\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n\n if (!inputRef.current) {\n return;\n }\n\n onSubmit(value);\n };\n\n const handleSkip = () => {\n onSubmit();\n };\n\n const handleSkipConfirm = () => {\n unmarkIsConfirmShown();\n onSubmit();\n };\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n return (\n
\n
\n \n
\n\n
\n
\n \n\n {value ? (\n \n ) : (\n \n {lang('YourEmailSkip')}\n \n )}\n \n {shouldConfirm && (\n \n {renderText(lang('YourEmailSkipWarningText'), ['br', 'simple_markdown'])}\n
\n \n {lang('YourEmailSkip')}\n \n \n {lang('Cancel')}\n \n
\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal((global, { icon }) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, icon === 'email' ? '💌' : '💡'),\n };\n})(SettingsTwoFaSkippableForm));\n","import React, { FC, memo } from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport Button from '../../../ui/Button';\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\n\ntype OwnProps = {\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n};\n\nconst SettingsTwoFaCongratulations: FC = ({\n isActive, onReset, animatedEmoji, onScreenSelect,\n}) => {\n const lang = useLang();\n\n const handleClick = () => {\n onScreenSelect(SettingsScreens.Privacy);\n };\n\n useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.TwoFaCongratulations);\n\n return (\n
\n
\n \n\n

\n {lang('TwoStepVerificationPasswordSetInfo')}\n

\n
\n\n
\n \n
\n
\n );\n};\n\nexport default memo(withGlobal((global) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, '🥳'),\n };\n})(SettingsTwoFaCongratulations));\n","import React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../../api/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../../util/environment';\nimport { selectAnimatedEmoji } from '../../../../modules/selectors';\nimport useLang from '../../../../hooks/useLang';\nimport useHistoryBack from '../../../../hooks/useHistoryBack';\n\nimport AnimatedEmoji from '../../../common/AnimatedEmoji';\nimport InputText from '../../../ui/InputText';\nimport Loading from '../../../ui/Loading';\n\ntype OwnProps = {\n isLoading?: boolean;\n error?: string;\n clearError: NoneToVoidFunction;\n onSubmit: (hint: string) => void;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n screen: SettingsScreens;\n};\n\ntype StateProps = {\n animatedEmoji: ApiSticker;\n codeLength: number;\n};\n\nconst FOCUS_DELAY_TIMEOUT_MS = IS_SINGLE_COLUMN_LAYOUT ? 550 : 400;\n\nconst SettingsTwoFaEmailCode: FC = ({\n animatedEmoji,\n codeLength,\n isLoading,\n error,\n clearError,\n onSubmit,\n isActive,\n onScreenSelect,\n onReset,\n screen,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n\n const [value, setValue] = useState('');\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n setTimeout(() => {\n inputRef.current!.focus();\n }, FOCUS_DELAY_TIMEOUT_MS);\n }\n }, []);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n const handleInputChange = (e: React.ChangeEvent) => {\n if (error && clearError) {\n clearError();\n }\n\n const newValue = e.target.value.slice(0, codeLength);\n\n if (newValue.length === codeLength) {\n onSubmit(newValue);\n }\n\n setValue(newValue);\n e.target.value = newValue;\n };\n\n return (\n
\n
\n \n
\n\n
\n \n {isLoading && }\n
\n
\n );\n};\n\nexport default memo(withGlobal((global) => {\n return {\n animatedEmoji: selectAnimatedEmoji(global, '💌'),\n codeLength: global.twoFaSettings.waitingEmailCodeLength,\n };\n})(SettingsTwoFaEmailCode));\n","import React, {\n FC, memo, useCallback, useEffect,\n} from '../../../../lib/teact/teact';\nimport { withGlobal } from '../../../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../../../global/types';\nimport { SettingsScreens } from '../../../../types';\n\nimport { pick } from '../../../../util/iteratees';\nimport { TwoFaDispatch, TwoFaState } from '../../../../hooks/reducers/useTwoFaReducer';\nimport useLang from '../../../../hooks/useLang';\n\nimport SettingsTwoFaEnabled from './SettingsTwoFaEnabled';\nimport SettingsTwoFaPassword from './SettingsTwoFaPassword';\nimport SettingsTwoFaStart from './SettingsTwoFaStart';\nimport SettingsTwoFaSkippableForm from './SettingsTwoFaSkippableForm';\nimport SettingsTwoFaCongratulations from './SettingsTwoFaCongratulations';\nimport SettingsTwoFaEmailCode from './SettingsTwoFaEmailCode';\n\nexport type OwnProps = {\n state: TwoFaState;\n currentScreen: SettingsScreens;\n shownScreen: SettingsScreens;\n dispatch: TwoFaDispatch;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = GlobalState['twoFaSettings'];\n\ntype DispatchProps = Pick;\n\nconst SettingsTwoFa: FC = ({\n currentScreen,\n shownScreen,\n state,\n hint,\n isLoading,\n error,\n waitingEmailCodeLength,\n dispatch,\n isActive,\n onScreenSelect,\n onReset,\n updatePassword,\n checkPassword,\n clearTwoFaError,\n updateRecoveryEmail,\n provideTwoFaEmailCode,\n clearPassword,\n}) => {\n useEffect(() => {\n if (waitingEmailCodeLength) {\n if (currentScreen === SettingsScreens.TwoFaNewPasswordEmail) {\n onScreenSelect(SettingsScreens.TwoFaNewPasswordEmailCode);\n } else if (currentScreen === SettingsScreens.TwoFaRecoveryEmail) {\n onScreenSelect(SettingsScreens.TwoFaRecoveryEmailCode);\n }\n }\n }, [currentScreen, onScreenSelect, waitingEmailCodeLength]);\n\n const handleStartWizard = useCallback(() => {\n dispatch({ type: 'reset' });\n onScreenSelect(SettingsScreens.TwoFaNewPassword);\n }, [dispatch, onScreenSelect]);\n\n const handleNewPassword = useCallback((value: string) => {\n dispatch({ type: 'setPassword', payload: value });\n onScreenSelect(SettingsScreens.TwoFaNewPasswordConfirm);\n }, [dispatch, onScreenSelect]);\n\n const handleNewPasswordConfirm = useCallback(() => {\n onScreenSelect(SettingsScreens.TwoFaNewPasswordHint);\n }, [onScreenSelect]);\n\n const handleNewPasswordHint = useCallback((value?: string) => {\n dispatch({ type: 'setHint', payload: value });\n onScreenSelect(SettingsScreens.TwoFaNewPasswordEmail);\n }, [dispatch, onScreenSelect]);\n\n const handleNewPasswordEmail = useCallback((value?: string) => {\n dispatch({ type: 'setEmail', payload: value });\n updatePassword({\n ...state,\n email: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaCongratulations);\n },\n });\n }, [dispatch, onScreenSelect, state, updatePassword]);\n\n const handleChangePasswordCurrent = useCallback((value: string) => {\n dispatch({ type: 'setCurrentPassword', payload: value });\n checkPassword({\n currentPassword: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaChangePasswordNew);\n },\n });\n }, [checkPassword, dispatch, onScreenSelect]);\n\n const handleChangePasswordNew = useCallback((value: string) => {\n dispatch({ type: 'setPassword', payload: value });\n onScreenSelect(SettingsScreens.TwoFaChangePasswordConfirm);\n }, [dispatch, onScreenSelect]);\n\n const handleChangePasswordConfirm = useCallback(() => {\n onScreenSelect(SettingsScreens.TwoFaChangePasswordHint);\n }, [onScreenSelect]);\n\n const handleChangePasswordHint = useCallback((value?: string) => {\n dispatch({ type: 'setHint', payload: value });\n updatePassword({\n ...state,\n hint: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaCongratulations);\n },\n });\n }, [dispatch, onScreenSelect, state, updatePassword]);\n\n const handleTurnOff = useCallback((value: string) => {\n clearPassword({\n currentPassword: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.Privacy);\n },\n });\n }, [clearPassword, onScreenSelect]);\n\n const handleRecoveryEmailCurrentPassword = useCallback((value: string) => {\n dispatch({ type: 'setCurrentPassword', payload: value });\n checkPassword({\n currentPassword: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaRecoveryEmail);\n },\n });\n }, [checkPassword, dispatch, onScreenSelect]);\n\n const handleRecoveryEmail = useCallback((value?: string) => {\n dispatch({ type: 'setEmail', payload: value });\n updateRecoveryEmail({\n ...state,\n email: value,\n onSuccess: () => {\n onScreenSelect(SettingsScreens.TwoFaCongratulations);\n },\n });\n }, [dispatch, onScreenSelect, state, updateRecoveryEmail]);\n\n const handleEmailCode = useCallback((code: string) => {\n provideTwoFaEmailCode({ code });\n }, [provideTwoFaEmailCode]);\n\n const lang = useLang();\n\n switch (currentScreen) {\n case SettingsScreens.TwoFaDisabled:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPassword:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPasswordConfirm:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPasswordHint:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPasswordEmail:\n return (\n \n );\n\n case SettingsScreens.TwoFaNewPasswordEmailCode:\n return (\n \n );\n\n case SettingsScreens.TwoFaCongratulations:\n return (\n \n );\n\n case SettingsScreens.TwoFaEnabled:\n return (\n \n );\n\n case SettingsScreens.TwoFaChangePasswordCurrent:\n return (\n \n );\n\n case SettingsScreens.TwoFaChangePasswordNew:\n return (\n \n );\n\n case SettingsScreens.TwoFaChangePasswordConfirm:\n return (\n \n );\n\n case SettingsScreens.TwoFaChangePasswordHint:\n return (\n \n );\n\n case SettingsScreens.TwoFaTurnOff:\n return (\n \n );\n\n case SettingsScreens.TwoFaRecoveryEmailCurrentPassword:\n return (\n \n );\n\n case SettingsScreens.TwoFaRecoveryEmail:\n return (\n \n );\n\n case SettingsScreens.TwoFaRecoveryEmailCode:\n return (\n \n );\n\n default:\n return undefined;\n }\n};\n\nexport default memo(withGlobal(\n (global): StateProps => ({ ...global.twoFaSettings }),\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'updatePassword', 'updateRecoveryEmail', 'clearPassword', 'provideTwoFaEmailCode',\n 'checkPassword', 'clearTwoFaError',\n ]),\n)(SettingsTwoFa));\n","import React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../../global/types';\nimport { ApiChat } from '../../../api/types';\nimport { ApiPrivacySettings, SettingsScreens } from '../../../types';\n\nimport useLang from '../../../hooks/useLang';\nimport { pick } from '../../../util/iteratees';\nimport searchWords from '../../../util/searchWords';\nimport { getPrivacyKey } from './helper/privacy';\nimport {\n getChatTitle, isChatGroup, isChatPrivate, prepareChatList,\n} from '../../../modules/helpers';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport Picker from '../../common/Picker';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\n\nexport type OwnProps = {\n isAllowList?: boolean;\n screen: SettingsScreens;\n isActive?: boolean;\n onScreenSelect: (screen: SettingsScreens) => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentUserId?: number;\n chatsById: Record;\n listIds?: number[];\n orderedPinnedIds?: number[];\n archivedListIds?: number[];\n archivedPinnedIds?: number[];\n settings?: ApiPrivacySettings;\n};\n\ntype DispatchProps = Pick;\n\nconst SettingsPrivacyVisibilityExceptionList: FC = ({\n currentUserId,\n isAllowList,\n screen,\n settings,\n chatsById,\n listIds,\n orderedPinnedIds,\n archivedListIds,\n archivedPinnedIds,\n setPrivacySettings,\n isActive,\n onScreenSelect,\n onReset,\n}) => {\n const lang = useLang();\n\n const selectedContactIds = useMemo(() => {\n if (!settings) {\n return [];\n }\n\n if (isAllowList) {\n return [...settings.allowUserIds, ...settings.allowChatIds];\n } else {\n return [...settings.blockUserIds, ...settings.blockChatIds];\n }\n }, [isAllowList, settings]);\n const [searchQuery, setSearchQuery] = useState('');\n const [isSubmitShown, setIsSubmitShown] = useState(false);\n const [newSelectedContactIds, setNewSelectedContactIds] = useState(selectedContactIds);\n\n const chats = useMemo(() => {\n const activeChatArrays = listIds\n ? prepareChatList(chatsById, listIds, orderedPinnedIds, 'all')\n : undefined;\n const archivedChatArrays = archivedListIds\n ? prepareChatList(chatsById, archivedListIds, archivedPinnedIds, 'archived')\n : undefined;\n\n if (!activeChatArrays && !archivedChatArrays) {\n return undefined;\n }\n\n return [\n ...(activeChatArrays\n ? [\n ...activeChatArrays.pinnedChats,\n ...activeChatArrays.otherChats,\n ]\n : []\n ),\n ...(archivedChatArrays ? archivedChatArrays.otherChats : []),\n ];\n }, [chatsById, listIds, orderedPinnedIds, archivedListIds, archivedPinnedIds]);\n\n const displayedIds = useMemo(() => {\n if (!chats) {\n return undefined;\n }\n\n return chats\n .filter((chat) => (\n ((isChatPrivate(chat.id) && chat.id !== currentUserId) || isChatGroup(chat))\n && (\n !searchQuery\n || searchWords(getChatTitle(lang, chat), searchQuery)\n || selectedContactIds.includes(chat.id)\n )\n ))\n .map(({ id }) => id);\n }, [chats, currentUserId, lang, searchQuery, selectedContactIds]);\n\n const handleSelectedContactIdsChange = useCallback((value: number[]) => {\n setNewSelectedContactIds(value);\n setIsSubmitShown(true);\n }, []);\n\n const handleSubmit = useCallback(() => {\n setPrivacySettings({\n privacyKey: getPrivacyKey(screen),\n isAllowList: Boolean(isAllowList),\n contactsIds: newSelectedContactIds,\n });\n\n onScreenSelect(SettingsScreens.Privacy);\n }, [isAllowList, newSelectedContactIds, onScreenSelect, screen, setPrivacySettings]);\n\n useHistoryBack(isActive, onReset, onScreenSelect, screen);\n\n return (\n
\n \n\n \n \n \n
\n );\n};\n\nfunction getCurrentPrivacySettings(global: GlobalState, screen: SettingsScreens) {\n const { privacy } = global.settings;\n switch (screen) {\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n return privacy.phoneNumber;\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n return privacy.lastSeen;\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n return privacy.profilePhoto;\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n return privacy.forwards;\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n return privacy.chatInvite;\n }\n\n return undefined;\n}\n\nexport default memo(withGlobal(\n (global, { screen }): StateProps => {\n const {\n chats: {\n byId: chatsById,\n listIds,\n orderedPinnedIds,\n },\n currentUserId,\n } = global;\n\n return {\n currentUserId,\n chatsById,\n listIds: listIds.active,\n orderedPinnedIds: orderedPinnedIds.active,\n archivedPinnedIds: orderedPinnedIds.archived,\n archivedListIds: listIds.archived,\n settings: getCurrentPrivacySettings(global, screen),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['setPrivacySettings']),\n)(SettingsPrivacyVisibilityExceptionList));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { SettingsScreens } from '../../../types';\nimport { FolderEditDispatch, FoldersState } from '../../../hooks/reducers/useFoldersReducer';\n\nimport { LAYERS_ANIMATION_NAME } from '../../../util/environment';\nimport useTwoFaReducer from '../../../hooks/reducers/useTwoFaReducer';\n\nimport Transition from '../../ui/Transition';\nimport SettingsHeader from './SettingsHeader';\nimport SettingsMain from './SettingsMain';\nimport SettingsEditProfile from './SettingsEditProfile';\nimport SettingsFolders from './folders/SettingsFolders';\nimport SettingsGeneral from './SettingsGeneral';\nimport SettingsGeneralBackground from './SettingsGeneralBackground';\nimport SettingsGeneralBackgroundColor from './SettingsGeneralBackgroundColor';\nimport SettingsNotifications from './SettingsNotifications';\nimport SettingsPrivacy from './SettingsPrivacy';\nimport SettingsLanguage from './SettingsLanguage';\nimport SettingsPrivacyVisibility from './SettingsPrivacyVisibility';\nimport SettingsPrivacyActiveSessions from './SettingsPrivacyActiveSessions';\nimport SettingsPrivacyBlockedUsers from './SettingsPrivacyBlockedUsers';\nimport SettingsTwoFa from './twoFa/SettingsTwoFa';\nimport SettingsPrivacyVisibilityExceptionList from './SettingsPrivacyVisibilityExceptionList';\n\nimport './Settings.scss';\n\nconst TRANSITION_RENDER_COUNT = Object.keys(SettingsScreens).length / 2;\nconst TRANSITION_DURATION = 200;\n\nconst TWO_FA_SCREENS = [\n SettingsScreens.TwoFaDisabled,\n SettingsScreens.TwoFaNewPassword,\n SettingsScreens.TwoFaNewPasswordConfirm,\n SettingsScreens.TwoFaNewPasswordHint,\n SettingsScreens.TwoFaNewPasswordEmail,\n SettingsScreens.TwoFaNewPasswordEmailCode,\n SettingsScreens.TwoFaCongratulations,\n SettingsScreens.TwoFaEnabled,\n SettingsScreens.TwoFaChangePasswordCurrent,\n SettingsScreens.TwoFaChangePasswordNew,\n SettingsScreens.TwoFaChangePasswordConfirm,\n SettingsScreens.TwoFaChangePasswordHint,\n SettingsScreens.TwoFaTurnOff,\n SettingsScreens.TwoFaRecoveryEmailCurrentPassword,\n SettingsScreens.TwoFaRecoveryEmail,\n SettingsScreens.TwoFaRecoveryEmailCode,\n];\n\nconst FOLDERS_SCREENS = [\n SettingsScreens.Folders,\n SettingsScreens.FoldersCreateFolder,\n SettingsScreens.FoldersEditFolder,\n SettingsScreens.FoldersEditFolderFromChatList,\n SettingsScreens.FoldersIncludedChats,\n SettingsScreens.FoldersIncludedChatsFromChatList,\n SettingsScreens.FoldersExcludedChats,\n SettingsScreens.FoldersExcludedChatsFromChatList,\n];\n\nconst PRIVACY_SCREENS = [\n SettingsScreens.PrivacyBlockedUsers,\n SettingsScreens.PrivacyActiveSessions,\n];\n\nconst PRIVACY_PHONE_NUMBER_SCREENS = [\n SettingsScreens.PrivacyPhoneNumberAllowedContacts,\n SettingsScreens.PrivacyPhoneNumberDeniedContacts,\n];\n\nconst PRIVACY_LAST_SEEN_PHONE_SCREENS = [\n SettingsScreens.PrivacyLastSeenAllowedContacts,\n SettingsScreens.PrivacyLastSeenDeniedContacts,\n];\n\nconst PRIVACY_PROFILE_PHOTO_SCREENS = [\n SettingsScreens.PrivacyProfilePhotoAllowedContacts,\n SettingsScreens.PrivacyProfilePhotoDeniedContacts,\n];\n\nconst PRIVACY_FORWARDING_SCREENS = [\n SettingsScreens.PrivacyForwardingAllowedContacts,\n SettingsScreens.PrivacyForwardingDeniedContacts,\n];\n\nconst PRIVACY_GROUP_CHATS_SCREENS = [\n SettingsScreens.PrivacyGroupChatsAllowedContacts,\n SettingsScreens.PrivacyGroupChatsDeniedContacts,\n];\n\nexport type OwnProps = {\n isActive: boolean;\n currentScreen: SettingsScreens;\n foldersState: FoldersState;\n foldersDispatch: FolderEditDispatch;\n onScreenSelect: (screen: SettingsScreens) => void;\n shouldSkipTransition?: boolean;\n onReset: () => void;\n};\n\nconst Settings: FC = ({\n isActive,\n currentScreen,\n foldersState,\n foldersDispatch,\n onScreenSelect,\n onReset,\n shouldSkipTransition,\n}) => {\n const [twoFaState, twoFaDispatch] = useTwoFaReducer();\n\n const handleReset = useCallback(() => {\n if (\n currentScreen === SettingsScreens.FoldersCreateFolder\n || currentScreen === SettingsScreens.FoldersEditFolder\n || currentScreen === SettingsScreens.FoldersEditFolderFromChatList\n ) {\n setTimeout(() => {\n foldersDispatch({ type: 'reset' });\n }, TRANSITION_DURATION);\n }\n\n if (\n currentScreen === SettingsScreens.FoldersIncludedChats\n || currentScreen === SettingsScreens.FoldersExcludedChats\n ) {\n if (foldersState.mode === 'create') {\n onScreenSelect(SettingsScreens.FoldersCreateFolder);\n } else {\n onScreenSelect(SettingsScreens.FoldersEditFolder);\n }\n return;\n }\n\n onReset();\n }, [\n foldersState.mode, foldersDispatch,\n currentScreen, onReset, onScreenSelect,\n ]);\n\n const handleSaveFilter = useCallback(() => {\n foldersDispatch({ type: 'saveFilters' });\n handleReset();\n }, [foldersDispatch, handleReset]);\n\n function renderCurrentSectionContent(isScreenActive: boolean, screen: SettingsScreens) {\n const privacyAllowScreens: Record = {\n [SettingsScreens.PrivacyPhoneNumber]: PRIVACY_PHONE_NUMBER_SCREENS.includes(screen),\n [SettingsScreens.PrivacyLastSeen]: PRIVACY_LAST_SEEN_PHONE_SCREENS.includes(screen),\n [SettingsScreens.PrivacyProfilePhoto]: PRIVACY_PROFILE_PHOTO_SCREENS.includes(screen),\n [SettingsScreens.PrivacyForwarding]: PRIVACY_FORWARDING_SCREENS.includes(screen),\n [SettingsScreens.PrivacyGroupChats]: PRIVACY_GROUP_CHATS_SCREENS.includes(screen),\n };\n\n const isTwoFaScreen = TWO_FA_SCREENS.includes(screen);\n const isFoldersScreen = FOLDERS_SCREENS.includes(screen);\n const isPrivacyScreen = PRIVACY_SCREENS.includes(screen)\n || isTwoFaScreen\n || Object.keys(privacyAllowScreens).includes(screen.toString())\n || Object.values(privacyAllowScreens).find((key) => key === true);\n\n switch (currentScreen) {\n case SettingsScreens.Main:\n return (\n \n );\n case SettingsScreens.EditProfile:\n return (\n \n );\n case SettingsScreens.General:\n return (\n \n );\n case SettingsScreens.Notifications:\n return (\n \n );\n case SettingsScreens.Privacy:\n return (\n \n );\n case SettingsScreens.Language:\n return (\n \n );\n case SettingsScreens.GeneralChatBackground:\n return (\n \n );\n case SettingsScreens.GeneralChatBackgroundColor:\n return (\n \n );\n case SettingsScreens.PrivacyActiveSessions:\n return (\n \n );\n case SettingsScreens.PrivacyBlockedUsers:\n return (\n \n );\n case SettingsScreens.PrivacyPhoneNumber:\n case SettingsScreens.PrivacyLastSeen:\n case SettingsScreens.PrivacyProfilePhoto:\n case SettingsScreens.PrivacyForwarding:\n case SettingsScreens.PrivacyGroupChats:\n return (\n \n );\n\n case SettingsScreens.PrivacyPhoneNumberAllowedContacts:\n case SettingsScreens.PrivacyLastSeenAllowedContacts:\n case SettingsScreens.PrivacyProfilePhotoAllowedContacts:\n case SettingsScreens.PrivacyForwardingAllowedContacts:\n case SettingsScreens.PrivacyGroupChatsAllowedContacts:\n return (\n \n );\n\n case SettingsScreens.PrivacyPhoneNumberDeniedContacts:\n case SettingsScreens.PrivacyLastSeenDeniedContacts:\n case SettingsScreens.PrivacyProfilePhotoDeniedContacts:\n case SettingsScreens.PrivacyForwardingDeniedContacts:\n case SettingsScreens.PrivacyGroupChatsDeniedContacts:\n return (\n \n );\n\n case SettingsScreens.Folders:\n case SettingsScreens.FoldersCreateFolder:\n case SettingsScreens.FoldersEditFolder:\n case SettingsScreens.FoldersEditFolderFromChatList:\n case SettingsScreens.FoldersIncludedChats:\n case SettingsScreens.FoldersIncludedChatsFromChatList:\n case SettingsScreens.FoldersExcludedChats:\n case SettingsScreens.FoldersExcludedChatsFromChatList:\n return (\n \n );\n\n case SettingsScreens.TwoFaDisabled:\n case SettingsScreens.TwoFaNewPassword:\n case SettingsScreens.TwoFaNewPasswordConfirm:\n case SettingsScreens.TwoFaNewPasswordHint:\n case SettingsScreens.TwoFaNewPasswordEmail:\n case SettingsScreens.TwoFaNewPasswordEmailCode:\n case SettingsScreens.TwoFaCongratulations:\n case SettingsScreens.TwoFaEnabled:\n case SettingsScreens.TwoFaChangePasswordCurrent:\n case SettingsScreens.TwoFaChangePasswordNew:\n case SettingsScreens.TwoFaChangePasswordConfirm:\n case SettingsScreens.TwoFaChangePasswordHint:\n case SettingsScreens.TwoFaTurnOff:\n case SettingsScreens.TwoFaRecoveryEmailCurrentPassword:\n case SettingsScreens.TwoFaRecoveryEmail:\n case SettingsScreens.TwoFaRecoveryEmailCode:\n return (\n \n );\n\n default:\n return undefined;\n }\n }\n\n function renderCurrentSection(isScreenActive: boolean, isFrom: boolean, currentKey: SettingsScreens) {\n return (\n <>\n \n {renderCurrentSectionContent(isScreenActive, currentKey)}\n \n );\n }\n\n return (\n \n {renderCurrentSection}\n \n );\n};\n\nexport default memo(Settings);\n","import React, {\n FC, useEffect, useCallback, useMemo, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiUser } from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport { throttle } from '../../../util/schedulers';\nimport searchWords from '../../../util/searchWords';\nimport { pick } from '../../../util/iteratees';\nimport { getUserFullName, sortUserIds } from '../../../modules/helpers';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport InfiniteScroll from '../../ui/InfiniteScroll';\nimport ListItem from '../../ui/ListItem';\nimport Loading from '../../ui/Loading';\n\nexport type OwnProps = {\n filter: string;\n isActive: boolean;\n onReset: () => void;\n};\n\ntype StateProps = {\n usersById: Record;\n contactIds?: number[];\n serverTimeOffset: number;\n};\n\ntype DispatchProps = Pick;\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst ContactList: FC = ({\n isActive, onReset,\n filter, usersById, contactIds, loadContactList, openChat, serverTimeOffset,\n}) => {\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadContactList();\n });\n });\n\n useHistoryBack(isActive, onReset);\n\n const handleClick = useCallback(\n (id: number) => {\n openChat({ id, shouldReplaceHistory: true });\n },\n [openChat],\n );\n\n const listIds = useMemo(() => {\n if (!contactIds) {\n return undefined;\n }\n\n const resultIds = filter ? contactIds.filter((id) => {\n const user = usersById[id];\n if (!user) {\n return false;\n }\n const fullName = getUserFullName(user);\n return fullName && searchWords(fullName, filter);\n }) : contactIds;\n\n return sortUserIds(resultIds, usersById, undefined, serverTimeOffset);\n }, [contactIds, filter, usersById, serverTimeOffset]);\n\n const [viewportIds, getMore] = useInfiniteScroll(undefined, listIds, Boolean(filter));\n\n return (\n \n {viewportIds?.length ? (\n viewportIds.map((id) => (\n handleClick(id)}\n ripple={!IS_SINGLE_COLUMN_LAYOUT}\n >\n \n \n ))\n ) : viewportIds && !viewportIds.length ? (\n

\n {filter.length ? 'No contacts matched your search.' : 'Contact list is empty.'}\n

\n ) : (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { userIds: contactIds } = global.contactList || {};\n const { byId: usersById } = global.users;\n\n return {\n usersById,\n contactIds,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadContactList', 'openChat']),\n)(ContactList));\n","import React, {\n FC, useCallback, useEffect, useMemo, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport { pick, unique } from '../../../util/iteratees';\nimport { throttle } from '../../../util/schedulers';\nimport searchWords from '../../../util/searchWords';\nimport { getUserFullName, isUserBot, sortChatIds } from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport Picker from '../../common/Picker';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Button from '../../ui/Button';\n\nexport type OwnProps = {\n isChannel?: boolean;\n isActive: boolean;\n selectedMemberIds: number[];\n onSelectedMemberIdsChange: (ids: number[]) => void;\n onNextStep: () => void;\n onReset: () => void;\n};\n\ntype StateProps = {\n currentUserId?: number;\n usersById: Record;\n chatsById: Record;\n localContactIds?: number[];\n searchQuery?: string;\n isSearching?: boolean;\n localUserIds?: number[];\n globalUserIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst NewChatStep1: FC = ({\n isChannel,\n isActive,\n selectedMemberIds,\n onSelectedMemberIdsChange,\n onNextStep,\n onReset,\n currentUserId,\n usersById,\n chatsById,\n localContactIds,\n searchQuery,\n isSearching,\n localUserIds,\n globalUserIds,\n loadContactList,\n setGlobalSearchQuery,\n}) => {\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadContactList();\n });\n });\n\n const lang = useLang();\n\n useHistoryBack(isActive, onReset);\n\n const handleFilterChange = useCallback((query: string) => {\n setGlobalSearchQuery({ query });\n }, [setGlobalSearchQuery]);\n\n const displayedIds = useMemo(() => {\n const contactIds = localContactIds\n ? sortChatIds(localContactIds.filter((id) => id !== currentUserId), chatsById)\n : [];\n\n if (!searchQuery) {\n return contactIds;\n }\n\n const foundContactIds = contactIds.filter((id) => {\n const user = usersById[id];\n if (!user) {\n return false;\n }\n const fullName = getUserFullName(user);\n return fullName && searchWords(fullName, searchQuery);\n });\n\n return sortChatIds(\n unique([\n ...foundContactIds,\n ...(localUserIds || []),\n ...(globalUserIds || []),\n ]).filter((contactId) => {\n const user = usersById[contactId];\n\n return !user || !isUserBot(user) || user.canBeInvitedToGroup;\n }),\n chatsById,\n false,\n selectedMemberIds,\n );\n }, [\n localContactIds, chatsById, searchQuery, localUserIds, globalUserIds, selectedMemberIds,\n currentUserId, usersById,\n ]);\n\n const handleNextStep = useCallback(() => {\n if (selectedMemberIds.length || isChannel) {\n setGlobalSearchQuery({ query: '' });\n onNextStep();\n }\n }, [selectedMemberIds.length, isChannel, setGlobalSearchQuery, onNextStep]);\n\n return (\n
\n
\n \n \n \n

{lang('GroupAddMembers')}

\n
\n
\n \n\n \n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { userIds: localContactIds } = global.contactList || {};\n const { byId: usersById } = global.users;\n const { byId: chatsById } = global.chats;\n const { currentUserId } = global;\n\n const {\n query: searchQuery,\n fetchingStatus,\n globalResults,\n localResults,\n } = global.globalSearch;\n const { userIds: globalUserIds } = globalResults || {};\n const { userIds: localUserIds } = localResults || {};\n\n return {\n currentUserId,\n usersById,\n chatsById,\n localContactIds,\n searchQuery,\n isSearching: fetchingStatus?.chats,\n globalUserIds,\n localUserIds,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadContactList', 'setGlobalSearchQuery']),\n)(NewChatStep1));\n","import React, {\n FC, useState, useCallback, useEffect, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ChatCreationProgress } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport InputText from '../../ui/InputText';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport AvatarEditable from '../../ui/AvatarEditable';\nimport Button from '../../ui/Button';\nimport ListItem from '../../ui/ListItem';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\nexport type OwnProps = {\n isChannel?: boolean;\n isActive: boolean;\n memberIds: number[];\n onReset: (forceReturnToChatList?: boolean) => void;\n};\n\ntype StateProps = {\n creationProgress?: ChatCreationProgress;\n creationError?: string;\n};\n\ntype DispatchProps = Pick;\n\n// TODO @implement\nconst MAX_USERS_FOR_LEGACY_CHAT = 199; // Accounting for current user\n\nconst NewChatStep2: FC = ({\n isChannel,\n isActive,\n memberIds,\n onReset,\n creationProgress,\n creationError,\n createGroupChat,\n createChannel,\n}) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onReset);\n\n const [title, setTitle] = useState('');\n const [about, setAbout] = useState('');\n const [photo, setPhoto] = useState();\n const [error, setError] = useState();\n\n const chatTitleEmptyError = 'Chat title can\\'t be empty';\n const channelTitleEmptyError = 'Channel title can\\'t be empty';\n const chatTooManyUsersError = 'Sorry, creating supergroups is not yet supported';\n\n const isLoading = creationProgress === ChatCreationProgress.InProgress;\n\n const handleTitleChange = useCallback((e: React.ChangeEvent) => {\n const { value } = e.currentTarget;\n const newValue = value.replace(/^\\s+/, '');\n\n setTitle(newValue);\n\n if (newValue !== value) {\n e.currentTarget.value = newValue;\n }\n }, []);\n\n const handleDescriptionChange = useCallback((e: React.ChangeEvent) => {\n setAbout(e.currentTarget.value);\n }, []);\n\n const handleCreateGroup = useCallback(() => {\n if (!title.length) {\n setError(chatTitleEmptyError);\n return;\n }\n\n if (memberIds.length > MAX_USERS_FOR_LEGACY_CHAT) {\n setError(chatTooManyUsersError);\n return;\n }\n\n createGroupChat({\n title,\n photo,\n memberIds,\n });\n }, [title, memberIds, createGroupChat, photo, chatTitleEmptyError, chatTooManyUsersError]);\n\n const handleCreateChannel = useCallback(() => {\n if (!title.length) {\n setError(channelTitleEmptyError);\n return;\n }\n\n createChannel({\n title,\n about,\n photo,\n memberIds,\n });\n }, [title, createChannel, about, photo, memberIds, channelTitleEmptyError]);\n\n useEffect(() => {\n if (creationProgress === ChatCreationProgress.Complete) {\n onReset(true);\n }\n }, [creationProgress, onReset]);\n\n const renderedError = creationError || (\n error !== chatTitleEmptyError && error !== channelTitleEmptyError\n ? error\n : undefined\n );\n\n return (\n
\n
\n onReset()}\n ariaLabel=\"Return to member selection\"\n >\n \n \n

{lang(isChannel ? 'NewChannel' : 'NewGroup')}

\n
\n
\n \n \n {isChannel && (\n <>\n \n

{lang('DescriptionInfo')}

\n \n )}\n\n {renderedError && (\n

{renderedError}

\n )}\n\n {memberIds.length > 0 && (\n <>\n

{lang('GroupInfo.ParticipantCount', memberIds.length, 'i')}

\n\n
\n {memberIds.map((id) => (\n \n \n \n ))}\n
\n \n )}\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n progress: creationProgress,\n error: creationError,\n } = global.chatCreation || {};\n\n return {\n creationProgress,\n creationError,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'createGroupChat', 'createChannel',\n ]),\n)(NewChatStep2));\n","import React, {\n FC, memo, useCallback, useState,\n} from '../../../lib/teact/teact';\n\nimport { LeftColumnContent } from '../../../types';\n\nimport { LAYERS_ANIMATION_NAME } from '../../../util/environment';\n\nimport Transition from '../../ui/Transition';\nimport NewChatStep1 from './NewChatStep1';\nimport NewChatStep2 from './NewChatStep2';\n\nimport './NewChat.scss';\n\nexport type OwnProps = {\n isActive: boolean;\n isChannel?: boolean;\n content: LeftColumnContent;\n onContentChange: (content: LeftColumnContent) => void;\n onReset: () => void;\n};\n\nconst RENDER_COUNT = Object.keys(LeftColumnContent).length / 2;\n\nconst NewChat: FC = ({\n isActive,\n isChannel = false,\n content,\n onContentChange,\n onReset,\n}) => {\n const [newChatMemberIds, setNewChatMemberIds] = useState([]);\n\n const handleNextStep = useCallback(() => {\n onContentChange(isChannel ? LeftColumnContent.NewChannelStep2 : LeftColumnContent.NewGroupStep2);\n }, [isChannel, onContentChange]);\n\n return (\n \n {(isStepActive) => {\n switch (content) {\n case LeftColumnContent.NewChannelStep1:\n case LeftColumnContent.NewGroupStep1:\n return (\n \n );\n case LeftColumnContent.NewChannelStep2:\n case LeftColumnContent.NewGroupStep2:\n return (\n \n );\n default:\n return undefined;\n }\n }}\n \n );\n};\n\nexport default memo(NewChat);\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Button from '../ui/Button';\nimport ChatList from './main/ChatList';\nimport { LeftColumnContent } from '../../types';\n\nimport './ArchivedChats.scss';\n\nexport type OwnProps = {\n isActive: boolean;\n onReset: () => void;\n onContentChange: (content: LeftColumnContent) => void;\n};\n\nconst ArchivedChats: FC = ({ isActive, onReset, onContentChange }) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onReset, onContentChange, LeftColumnContent.Archived);\n\n return (\n
\n
\n \n \n \n

{lang('ArchivedChats')}

\n
\n \n
\n );\n};\n\nexport default memo(ArchivedChats);\n","const IGNORED_KEYS: Record = {\n Down: true,\n ArrowDown: true,\n Up: true,\n ArrowUp: true,\n Left: true,\n ArrowLeft: true,\n Right: true,\n ArrowRight: true,\n ' ': true,\n PageUp: true,\n PageDown: true,\n End: true,\n Home: true,\n Tab: true,\n};\n\nfunction isTextBox(target: EventTarget | null) {\n if (!target || !(target instanceof HTMLElement)) return false;\n const element = target;\n const tagName = element.tagName.toLowerCase();\n if (tagName === 'textarea') return true;\n if (tagName !== 'input') return false;\n const type = element.getAttribute('type');\n if (!type) return false;\n const inputTypes = [\n 'text', 'password', 'number', 'email', 'tel', 'url',\n 'search', 'date', 'datetime', 'datetime-local', 'time', 'month', 'week',\n ];\n return inputTypes.indexOf(type.toLowerCase()) > -1;\n}\n\nconst preventDefault = (e: Event) => {\n e.preventDefault();\n};\n\nfunction preventDefaultForScrollKeys(e: KeyboardEvent) {\n if (IGNORED_KEYS[e.key] && !isTextBox(e.target)) {\n preventDefault(e);\n }\n}\n\nexport function disableScrolling() {\n // Disable scrolling in Chrome\n document.addEventListener('wheel', preventDefault, { passive: false });\n window.ontouchmove = preventDefault; // mobile\n document.onkeydown = preventDefaultForScrollKeys;\n}\n\nexport function enableScrolling() {\n document.removeEventListener('wheel', preventDefault); // Enable scrolling in Chrome\n // eslint-disable-next-line no-null/no-null\n window.ontouchmove = null;\n // eslint-disable-next-line no-null/no-null\n document.onkeydown = null;\n}\n","import { ApiMediaFormat, ApiMessage } from '../../../../api/types';\n\nimport * as mediaLoader from '../../../../util/mediaLoader';\nimport {\n getMessageMediaHash,\n getMessagePhoto,\n getMessageText,\n getMessageWebPagePhoto,\n getMessageWebPageVideo,\n hasMessageLocalBlobUrl,\n} from '../../../../modules/helpers';\nimport { CLIPBOARD_ITEM_SUPPORTED, copyImageToClipboard, copyTextToClipboard } from '../../../../util/clipboard';\n\ntype ICopyOptions = {\n label: string;\n handler: () => void;\n}[];\n\nexport function getMessageCopyOptions(\n message: ApiMessage, afterEffect?: () => void, onCopyLink?: () => void,\n): ICopyOptions {\n const options: ICopyOptions = [];\n const text = getMessageText(message);\n const photo = getMessagePhoto(message)\n || (!getMessageWebPageVideo(message) ? getMessageWebPagePhoto(message) : undefined);\n const mediaHash = getMessageMediaHash(message, 'inline');\n const canImageBeCopied = photo && (mediaHash || hasMessageLocalBlobUrl(message)) && CLIPBOARD_ITEM_SUPPORTED;\n const selection = window.getSelection();\n\n if (canImageBeCopied) {\n options.push({\n label: 'lng_context_copy_image',\n handler: () => {\n Promise.resolve(mediaHash ? mediaLoader.fetch(mediaHash, ApiMediaFormat.BlobUrl) : photo!.blobUrl)\n .then(copyImageToClipboard);\n\n if (afterEffect) {\n afterEffect();\n }\n },\n });\n }\n\n if (text) {\n // Detect if the user has selection in the current message\n const hasSelection = Boolean((\n selection?.anchorNode?.parentNode\n && (selection.anchorNode.parentNode as HTMLElement).closest('.Message .content-inner')\n && selection.toString().replace(/(?:\\r\\n|\\r|\\n)/g, '') !== ''\n ));\n\n options.push({\n label: getCopyLabel(hasSelection),\n handler: () => {\n const clipboardText = hasSelection && selection ? selection.toString() : text;\n copyTextToClipboard(clipboardText);\n\n if (afterEffect) {\n afterEffect();\n }\n },\n });\n }\n\n if (onCopyLink) {\n options.push({\n label: 'lng_context_copy_message_link',\n handler: () => {\n onCopyLink();\n\n if (afterEffect) {\n afterEffect();\n }\n },\n });\n }\n\n return options;\n}\n\nfunction getCopyLabel(hasSelection: boolean): string {\n if (hasSelection) {\n return 'lng_context_copy_selected';\n }\n return 'lng_context_copy_text';\n}\n","import React, { FC, useCallback } from '../../../lib/teact/teact';\n\nimport { ApiMessage } from '../../../api/types';\nimport { IAnchorPosition } from '../../../types';\n\nimport { getMessageCopyOptions } from './helpers/copyOptions';\nimport useContextMenuPosition from '../../../hooks/useContextMenuPosition';\nimport useLang from '../../../hooks/useLang';\n\nimport Menu from '../../ui/Menu';\nimport MenuItem from '../../ui/MenuItem';\n\nimport './MessageContextMenu.scss';\n\ntype OwnProps = {\n isOpen: boolean;\n anchor: IAnchorPosition;\n message: ApiMessage;\n canSendNow?: boolean;\n canReschedule?: boolean;\n canReply?: boolean;\n canPin?: boolean;\n canUnpin?: boolean;\n canDelete?: boolean;\n canReport?: boolean;\n canEdit?: boolean;\n canForward?: boolean;\n canFaveSticker?: boolean;\n canUnfaveSticker?: boolean;\n canCopy?: boolean;\n canCopyLink?: boolean;\n canSelect?: boolean;\n onReply: () => void;\n onEdit: () => void;\n onPin: () => void;\n onUnpin: () => void;\n onForward: () => void;\n onDelete: () => void;\n onReport: () => void;\n onFaveSticker: () => void;\n onUnfaveSticker: () => void;\n onSelect: () => void;\n onSend: () => void;\n onReschedule: () => void;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n onCopyLink?: () => void;\n};\n\nconst SCROLLBAR_WIDTH = 10;\n\nconst MessageContextMenu: FC = ({\n isOpen,\n message,\n anchor,\n canSendNow,\n canReschedule,\n canReply,\n canEdit,\n canPin,\n canUnpin,\n canDelete,\n canReport,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n onReply,\n onEdit,\n onPin,\n onUnpin,\n onForward,\n onDelete,\n onReport,\n onFaveSticker,\n onUnfaveSticker,\n onSelect,\n onSend,\n onReschedule,\n onClose,\n onCloseAnimationEnd,\n onCopyLink,\n}) => {\n const copyOptions = getMessageCopyOptions(message, onClose, canCopyLink ? onCopyLink : undefined);\n\n const getTriggerElement = useCallback(() => {\n return document.querySelector(`.active > .MessageList div[data-message-id=\"${message.id}\"]`);\n }, [message.id]);\n\n const getRootElement = useCallback(\n () => document.querySelector('.active > .MessageList'),\n [],\n );\n\n const getMenuElement = useCallback(\n () => document.querySelector('.MessageContextMenu .bubble'),\n [],\n );\n\n const { positionX, positionY, style } = useContextMenuPosition(\n anchor,\n getTriggerElement,\n getRootElement,\n getMenuElement,\n SCROLLBAR_WIDTH,\n (document.querySelector('.MiddleHeader') as HTMLElement).offsetHeight,\n );\n\n const lang = useLang();\n\n return (\n \n {canSendNow && {lang('MessageScheduleSend')}}\n {canReschedule && (\n {lang('MessageScheduleEditTime')}\n )}\n {canReply && {lang('Reply')}}\n {canEdit && {lang('Edit')}}\n {canFaveSticker && (\n {lang('AddToFavorites')}\n )}\n {canUnfaveSticker && (\n {lang('Stickers.RemoveFromFavorites')}\n )}\n {canCopy && copyOptions.map((options) => (\n {lang(options.label)}\n ))}\n {canPin && {lang('DialogPin')}}\n {canUnpin && {lang('DialogUnpin')}}\n {canForward && {lang('Forward')}}\n {canSelect && {lang('Common.Select')}}\n {canReport && {lang('lng_context_report_msg')}}\n {canDelete && {lang('Delete')}}\n \n );\n};\n\nexport default MessageContextMenu;\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions, MessageListType } from '../../../global/types';\nimport { ApiMessage } from '../../../api/types';\nimport { IAlbum, IAnchorPosition } from '../../../types';\nimport { selectAllowedMessageActions, selectCurrentMessageList } from '../../../modules/selectors';\nimport { disableScrolling, enableScrolling } from '../../../util/scrollLock';\nimport { pick } from '../../../util/iteratees';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useFlag from '../../../hooks/useFlag';\n\nimport DeleteMessageModal from '../../common/DeleteMessageModal';\nimport ReportMessageModal from '../../common/ReportMessageModal';\nimport PinMessageModal from '../../common/PinMessageModal';\nimport MessageContextMenu from './MessageContextMenu';\nimport CalendarModal from '../../common/CalendarModal';\nimport { getDayStartAt } from '../../../util/dateFormat';\nimport { copyTextToClipboard } from '../../../util/clipboard';\n\nexport type OwnProps = {\n isOpen: boolean;\n chatUsername?: string;\n message: ApiMessage;\n album?: IAlbum;\n anchor: IAnchorPosition;\n messageListType: MessageListType;\n onClose: () => void;\n onCloseAnimationEnd: () => void;\n};\n\ntype StateProps = {\n noOptions?: boolean;\n canSendNow?: boolean;\n canReschedule?: boolean;\n canReply?: boolean;\n canPin?: boolean;\n canUnpin?: boolean;\n canDelete?: boolean;\n canReport?: boolean;\n canEdit?: boolean;\n canForward?: boolean;\n canFaveSticker?: boolean;\n canUnfaveSticker?: boolean;\n canCopy?: boolean;\n canCopyLink?: boolean;\n canSelect?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst ContextMenuContainer: FC = ({\n isOpen,\n messageListType,\n chatUsername,\n message,\n album,\n anchor,\n onClose,\n onCloseAnimationEnd,\n noOptions,\n canSendNow,\n canReschedule,\n canReply,\n canPin,\n canUnpin,\n canDelete,\n canReport,\n canEdit,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n setReplyingToId,\n setEditingId,\n pinMessage,\n openForwardMenu,\n faveSticker,\n unfaveSticker,\n toggleMessageSelection,\n sendScheduledMessages,\n rescheduleMessage,\n}) => {\n const { transitionClassNames } = useShowTransition(isOpen, onCloseAnimationEnd, undefined, false);\n const [isMenuOpen, setIsMenuOpen] = useState(true);\n const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);\n const [isReportModalOpen, setIsReportModalOpen] = useState(false);\n const [isPinModalOpen, setIsPinModalOpen] = useState(false);\n const [isCalendarOpen, openCalendar, closeCalendar] = useFlag();\n\n const handleDelete = useCallback(() => {\n setIsMenuOpen(false);\n setIsDeleteModalOpen(true);\n }, []);\n\n const handleReport = useCallback(() => {\n setIsMenuOpen(false);\n setIsReportModalOpen(true);\n }, []);\n\n const closeMenu = useCallback(() => {\n setIsMenuOpen(false);\n onClose();\n }, [onClose]);\n\n const closeDeleteModal = useCallback(() => {\n setIsDeleteModalOpen(false);\n onClose();\n }, [onClose]);\n\n const closeReportModal = useCallback(() => {\n setIsReportModalOpen(false);\n onClose();\n }, [onClose]);\n\n const closePinModal = useCallback(() => {\n setIsPinModalOpen(false);\n onClose();\n }, [onClose]);\n\n const handleCloseCalendar = useCallback(() => {\n closeCalendar();\n onClose();\n }, [closeCalendar, onClose]);\n\n const handleReply = useCallback(() => {\n setReplyingToId({ messageId: message.id });\n closeMenu();\n }, [setReplyingToId, message.id, closeMenu]);\n\n const handleEdit = useCallback(() => {\n setEditingId({ messageId: message.id });\n closeMenu();\n }, [setEditingId, message.id, closeMenu]);\n\n const handlePin = useCallback(() => {\n setIsMenuOpen(false);\n setIsPinModalOpen(true);\n }, []);\n\n const handleUnpin = useCallback(() => {\n pinMessage({ messageId: message.id, isUnpin: true });\n closeMenu();\n }, [pinMessage, message.id, closeMenu]);\n\n const handleForward = useCallback(() => {\n closeMenu();\n if (album?.messages) {\n const messageIds = album.messages.map(({ id }) => id);\n openForwardMenu({ fromChatId: message.chatId, messageIds });\n } else {\n openForwardMenu({ fromChatId: message.chatId, messageIds: [message.id] });\n }\n }, [openForwardMenu, message, closeMenu, album]);\n\n const handleFaveSticker = useCallback(() => {\n closeMenu();\n faveSticker({ sticker: message.content.sticker });\n }, [closeMenu, message.content.sticker, faveSticker]);\n\n const handleUnfaveSticker = useCallback(() => {\n closeMenu();\n unfaveSticker({ sticker: message.content.sticker });\n }, [closeMenu, message.content.sticker, unfaveSticker]);\n\n const handleSelectMessage = useCallback(() => {\n const params = album?.messages\n ? {\n messageId: message.id,\n childMessageIds: album.messages.map(({ id }) => id),\n withShift: false,\n }\n : { messageId: message.id, withShift: false };\n\n toggleMessageSelection(params);\n closeMenu();\n }, [closeMenu, message.id, toggleMessageSelection, album]);\n\n const handleScheduledMessageSend = useCallback(() => {\n sendScheduledMessages({ chatId: message.chatId, id: message.id });\n closeMenu();\n }, [closeMenu, message.chatId, message.id, sendScheduledMessages]);\n\n const handleOpenCalendar = useCallback(() => {\n setIsMenuOpen(false);\n openCalendar();\n }, [openCalendar]);\n\n const handleRescheduleMessage = useCallback((date: Date) => {\n rescheduleMessage({\n chatId: message.chatId,\n messageId: message.id,\n scheduledAt: Math.round(date.getTime() / 1000),\n });\n }, [message.chatId, message.id, rescheduleMessage]);\n\n const handleCopyLink = useCallback(() => {\n copyTextToClipboard(`https://t.me/${chatUsername || `c/${Math.abs(message.chatId)}`}/${message.id}`);\n closeMenu();\n }, [chatUsername, closeMenu, message.chatId, message.id]);\n\n useEffect(() => {\n disableScrolling();\n\n return enableScrolling;\n }, []);\n\n const reportMessageIds = useMemo(() => (album ? album.messages : [message]).map(({ id }) => id), [album, message]);\n\n if (noOptions) {\n closeMenu();\n\n return undefined;\n }\n\n const scheduledMaxDate = new Date();\n scheduledMaxDate.setFullYear(scheduledMaxDate.getFullYear() + 1);\n\n return (\n
\n \n \n \n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { message, messageListType }): StateProps => {\n const { threadId } = selectCurrentMessageList(global) || {};\n const {\n noOptions,\n canReply,\n canPin,\n canUnpin,\n canDelete,\n canReport,\n canEdit,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n } = (threadId && selectAllowedMessageActions(global, message, threadId)) || {};\n const isPinned = messageListType === 'pinned';\n const isScheduled = messageListType === 'scheduled';\n\n return {\n noOptions,\n canSendNow: isScheduled,\n canReschedule: isScheduled,\n canReply: !isPinned && !isScheduled && canReply,\n canPin: !isScheduled && canPin,\n canUnpin: !isScheduled && canUnpin,\n canDelete,\n canReport,\n canEdit: !isPinned && canEdit,\n canForward: !isScheduled && canForward,\n canFaveSticker: !isScheduled && canFaveSticker,\n canUnfaveSticker: !isScheduled && canUnfaveSticker,\n canCopy,\n canCopyLink: !isScheduled && canCopyLink,\n canSelect,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setReplyingToId',\n 'setEditingId',\n 'pinMessage',\n 'openForwardMenu',\n 'faveSticker',\n 'unfaveSticker',\n 'toggleMessageSelection',\n 'sendScheduledMessages',\n 'rescheduleMessage',\n ]),\n)(ContextMenuContainer));\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiSticker, ApiStickerSet } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\n\nimport { STICKER_SIZE_MODAL } from '../../config';\nimport { pick } from '../../util/iteratees';\nimport { selectStickerSet, selectStickerSetByShortName } from '../../modules/selectors';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\nimport renderText from './helpers/renderText';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\nimport Loading from '../ui/Loading';\nimport StickerButton from './StickerButton';\n\nimport './StickerSetModal.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n fromSticker?: ApiSticker;\n stickerSetShortName?: string;\n onClose: () => void;\n};\n\ntype StateProps = {\n stickerSet?: ApiStickerSet;\n};\n\ntype DispatchProps = Pick;\n\nconst INTERSECTION_THROTTLE = 200;\n\nconst StickerSetModal: FC = ({\n isOpen,\n fromSticker,\n stickerSetShortName,\n stickerSet,\n onClose,\n loadStickers,\n toggleStickerSet,\n sendMessage,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const lang = useLang();\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, throttleMs: INTERSECTION_THROTTLE, isDisabled: !isOpen });\n\n useEffect(() => {\n if (isOpen) {\n if (fromSticker) {\n const { stickerSetId, stickerSetAccessHash } = fromSticker;\n loadStickers({\n stickerSetId,\n stickerSetAccessHash,\n });\n } else if (stickerSetShortName) {\n loadStickers({\n stickerSetShortName,\n });\n }\n }\n }, [isOpen, fromSticker, loadStickers, stickerSetShortName]);\n\n const handleSelect = useCallback((sticker: ApiSticker) => {\n sticker = {\n ...sticker,\n isPreloadedGlobally: true,\n };\n\n sendMessage({ sticker });\n onClose();\n }, [onClose, sendMessage]);\n\n const handleButtonClick = useCallback(() => {\n if (stickerSet) {\n toggleStickerSet({ stickerSetId: stickerSet.id });\n onClose();\n }\n }, [onClose, stickerSet, toggleStickerSet]);\n\n return (\n \n {stickerSet?.stickers ? (\n <>\n
\n {stickerSet.stickers.map((sticker) => (\n \n ))}\n
\n
\n \n {lang(\n stickerSet.installedDate ? 'StickerPack.RemoveStickerCount' : 'StickerPack.AddStickerCount',\n stickerSet.count,\n 'i',\n )}\n \n
\n \n ) : (\n \n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { fromSticker, stickerSetShortName }: OwnProps) => {\n return {\n stickerSet: fromSticker\n ? selectStickerSet(global, fromSticker.stickerSetId)\n : stickerSetShortName\n ? selectStickerSetByShortName(global, stickerSetShortName)\n : undefined,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadStickers',\n 'toggleStickerSet',\n 'sendMessage',\n ]),\n)(StickerSetModal));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat } from '../../api/types';\nimport { IAnchorPosition } from '../../types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { disableScrolling, enableScrolling } from '../../util/scrollLock';\nimport { selectChat, selectNotifySettings, selectNotifyExceptions } from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\nimport { isChatPrivate, getCanDeleteChat, selectIsChatMuted } from '../../modules/helpers';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useLang from '../../hooks/useLang';\n\nimport Portal from '../ui/Portal';\nimport Menu from '../ui/Menu';\nimport MenuItem from '../ui/MenuItem';\nimport DeleteChatModal from '../common/DeleteChatModal';\n\nimport './HeaderMenuContainer.scss';\n\ntype DispatchProps = Pick;\n\nexport type OwnProps = {\n chatId: number;\n threadId: number;\n isOpen: boolean;\n anchor: IAnchorPosition;\n isChannel?: boolean;\n canStartBot?: boolean;\n canRestartBot?: boolean;\n canSubscribe?: boolean;\n canSearch?: boolean;\n canMute?: boolean;\n canLeave?: boolean;\n onSubscribeChannel: () => void;\n onSearchClick: () => void;\n onClose: () => void;\n onCloseAnimationEnd: () => void;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n isPrivate?: boolean;\n isMuted?: boolean;\n canDeleteChat?: boolean;\n};\n\nconst HeaderMenuContainer: FC = ({\n chatId,\n isOpen,\n anchor,\n isChannel,\n canStartBot,\n canRestartBot,\n canSubscribe,\n canSearch,\n canMute,\n canLeave,\n chat,\n isPrivate,\n isMuted,\n canDeleteChat,\n onSubscribeChannel,\n onSearchClick,\n onClose,\n onCloseAnimationEnd,\n updateChatMutedState,\n enterMessageSelectMode,\n sendBotCommand,\n restartBot,\n}) => {\n const [isMenuOpen, setIsMenuOpen] = useState(true);\n const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);\n const { x, y } = anchor;\n\n useShowTransition(isOpen, onCloseAnimationEnd, undefined, false);\n\n const handleDelete = useCallback(() => {\n setIsMenuOpen(false);\n setIsDeleteModalOpen(true);\n }, []);\n\n const closeMenu = useCallback(() => {\n setIsMenuOpen(false);\n onClose();\n }, [onClose]);\n\n const closeDeleteModal = useCallback(() => {\n setIsDeleteModalOpen(false);\n onClose();\n }, [onClose]);\n\n const handleStartBot = useCallback(() => {\n sendBotCommand({ command: '/start' });\n }, [sendBotCommand]);\n\n const handleRestartBot = useCallback(() => {\n restartBot({ chatId });\n }, [chatId, restartBot]);\n\n const handleToggleMuteClick = useCallback(() => {\n updateChatMutedState({ chatId, isMuted: !isMuted });\n closeMenu();\n }, [chatId, closeMenu, isMuted, updateChatMutedState]);\n\n const handleSubscribe = useCallback(() => {\n onSubscribeChannel();\n closeMenu();\n }, [closeMenu, onSubscribeChannel]);\n\n const handleSearch = useCallback(() => {\n onSearchClick();\n closeMenu();\n }, [closeMenu, onSearchClick]);\n\n const handleSelectMessages = useCallback(() => {\n enterMessageSelectMode();\n closeMenu();\n }, [closeMenu, enterMessageSelectMode]);\n\n useEffect(() => {\n disableScrolling();\n\n return enableScrolling;\n }, []);\n\n const lang = useLang();\n\n return (\n \n
\n \n {IS_SINGLE_COLUMN_LAYOUT && canStartBot && (\n \n {lang('BotStart')}\n \n )}\n {IS_SINGLE_COLUMN_LAYOUT && canRestartBot && (\n \n {lang('BotRestart')}\n \n )}\n {IS_SINGLE_COLUMN_LAYOUT && canSubscribe && (\n \n {lang(isChannel ? 'Subscribe' : 'Join Group')}\n \n )}\n {IS_SINGLE_COLUMN_LAYOUT && canSearch && (\n \n {lang('Search')}\n \n )}\n {canMute && (\n \n {lang(isMuted ? 'ChatsUnmute' : 'ChatsMute')}\n \n )}\n \n {lang('ReportSelectMessages')}\n \n {canLeave && (\n \n {lang(isPrivate\n ? 'DeleteChatUser'\n : (canDeleteChat ? 'GroupInfo.DeleteAndExit' : (isChannel ? 'LeaveChannel' : 'Group.LeaveGroup')))}\n \n )}\n \n {chat && (\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n if (!chat || chat.isRestricted) {\n return {};\n }\n\n return {\n chat,\n isMuted: selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global)),\n isPrivate: isChatPrivate(chat.id),\n canDeleteChat: getCanDeleteChat(chat),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'updateChatMutedState',\n 'enterMessageSelectMode',\n 'sendBotCommand',\n 'restartBot',\n ]),\n)(HeaderMenuContainer));\n","import React, {\n FC, memo, useCallback, useEffect, useRef, useState, useLayoutEffect,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiChat } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\n\nimport { debounce } from '../../util/schedulers';\nimport { selectCurrentTextSearch, selectCurrentChat } from '../../modules/selectors';\nimport { pick } from '../../util/iteratees';\nimport { getDayStartAt } from '../../util/dateFormat';\n\nimport Button from '../ui/Button';\nimport SearchInput from '../ui/SearchInput';\n\nimport './MobileSearch.scss';\n\nexport type OwnProps = {\n isActive: boolean;\n};\n\ntype StateProps = {\n isActive?: boolean;\n chat?: ApiChat;\n query?: string;\n totalCount?: number;\n foundIds?: number[];\n isHistoryCalendarOpen?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst runDebouncedForSearch = debounce((cb) => cb(), 200, false);\n\nconst MobileSearchFooter: FC = ({\n isActive,\n chat,\n query,\n totalCount,\n foundIds,\n isHistoryCalendarOpen,\n setLocalTextSearchQuery,\n searchTextMessagesLocal,\n focusMessage,\n closeLocalTextSearch,\n openHistoryCalendar,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const [focusedIndex, setFocusedIndex] = useState(0);\n\n // Fix for iOS keyboard\n useEffect(() => {\n const { visualViewport } = window as any;\n if (!visualViewport) {\n return undefined;\n }\n\n const mainEl = document.getElementById('Main') as HTMLDivElement;\n const handleResize = () => {\n const { activeElement } = document;\n if (activeElement && (activeElement === inputRef.current)) {\n const { pageTop, height } = visualViewport;\n mainEl.style.transform = `translateY(${pageTop}px)`;\n mainEl.style.height = `${height}px`;\n document.documentElement.scrollTop = pageTop;\n } else {\n mainEl.style.transform = '';\n mainEl.style.height = '';\n }\n };\n\n visualViewport.addEventListener('resize', handleResize);\n\n return () => {\n visualViewport.removeEventListener('resize', handleResize);\n };\n }, []);\n\n // Focus message\n useEffect(() => {\n if (chat && foundIds && foundIds.length) {\n focusMessage({ chatId: chat.id, messageId: foundIds[foundIds.length - 1] });\n setFocusedIndex(0);\n } else {\n setFocusedIndex(-1);\n }\n }, [chat, focusMessage, foundIds]);\n\n // Disable native up/down buttons on iOS\n useEffect(() => {\n Array.from(document.querySelectorAll('input')).forEach((input) => {\n input.disabled = Boolean(isActive && input !== inputRef.current);\n });\n\n Array.from(document.querySelectorAll('div[contenteditable]')).forEach((div) => {\n div.contentEditable = isActive ? 'false' : 'true';\n });\n }, [isActive]);\n\n // Blur on exit\n useEffect(() => {\n if (!isActive) {\n inputRef.current!.blur();\n }\n }, [isActive]);\n\n useLayoutEffect(() => {\n const searchInput = document.querySelector('#MobileSearch input')!;\n searchInput.blur();\n }, [isHistoryCalendarOpen]);\n\n const handleMessageSearchQueryChange = useCallback((newQuery: string) => {\n setLocalTextSearchQuery({ query: newQuery });\n\n if (newQuery.length) {\n runDebouncedForSearch(searchTextMessagesLocal);\n }\n }, [searchTextMessagesLocal, setLocalTextSearchQuery]);\n\n const handleUp = useCallback(() => {\n if (chat && foundIds) {\n const newFocusIndex = focusedIndex + 1;\n focusMessage({ chatId: chat.id, messageId: foundIds[foundIds.length - 1 - newFocusIndex] });\n setFocusedIndex(newFocusIndex);\n }\n }, [chat, focusedIndex, focusMessage, foundIds]);\n\n const handleDown = useCallback(() => {\n if (chat && foundIds) {\n const newFocusIndex = focusedIndex - 1;\n focusMessage({ chatId: chat.id, messageId: foundIds[foundIds.length - 1 - newFocusIndex] });\n setFocusedIndex(newFocusIndex);\n }\n }, [chat, focusedIndex, focusMessage, foundIds]);\n\n return (\n
\n
\n \n \n \n \n
\n
\n
\n {query ? (\n foundIds?.length ? (\n `${focusedIndex + 1} of ${totalCount}`\n ) : foundIds && !foundIds.length ? (\n 'No results'\n ) : (\n ''\n )\n ) : (\n openHistoryCalendar({ selectedAt: getDayStartAt(Date.now()) })}\n ariaLabel=\"Search messages by date\"\n >\n \n \n )}\n
\n \n \n \n \n \n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const chat = selectCurrentChat(global);\n if (!chat) {\n return {};\n }\n\n const { query, results } = selectCurrentTextSearch(global) || {};\n const { totalCount, foundIds } = results || {};\n\n return {\n chat,\n query,\n totalCount,\n foundIds,\n isHistoryCalendarOpen: Boolean(global.historyCalendarSelectedAt),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setLocalTextSearchQuery',\n 'searchTextMessagesLocal',\n 'focusMessage',\n 'closeLocalTextSearch',\n 'openHistoryCalendar',\n ]),\n)(MobileSearchFooter));\n","export default function findInViewport(\n container: HTMLElement,\n selectorOrElements: string | NodeListOf,\n margin = 0,\n isDense = false,\n shouldContainBottom = false,\n isHorizontal = false,\n) {\n const viewportY1 = container[isHorizontal ? 'scrollLeft' : 'scrollTop'];\n const viewportY2 = viewportY1 + container[isHorizontal ? 'offsetWidth' : 'offsetHeight'];\n const allElements = typeof selectorOrElements === 'string'\n ? container.querySelectorAll(selectorOrElements)\n : selectorOrElements;\n const { length } = allElements;\n const visibleIndexes: number[] = [];\n let isFound = false;\n\n for (let i = 0; i < length; i++) {\n const element = allElements[i];\n const y1 = element[isHorizontal ? 'offsetLeft' : 'offsetTop'];\n const y2 = y1 + element[isHorizontal ? 'offsetWidth' : 'offsetHeight'];\n const isVisible = shouldContainBottom\n ? y2 >= viewportY1 - margin && y2 <= viewportY2 + margin\n : y1 <= viewportY2 + margin && y2 >= viewportY1 - margin;\n\n if (isVisible) {\n visibleIndexes.push(i);\n isFound = true;\n } else if (isFound && !isDense) {\n break;\n }\n }\n\n return { allElements, visibleIndexes };\n}\n","function isFullyVisible(container: HTMLElement, element: HTMLElement, isHorizontal = false) {\n const viewportY1 = container[isHorizontal ? 'scrollLeft' : 'scrollTop'];\n const viewportY2 = viewportY1 + container[isHorizontal ? 'offsetWidth' : 'offsetHeight'];\n const y1 = element[isHorizontal ? 'offsetLeft' : 'offsetTop'];\n const y2 = y1 + element[isHorizontal ? 'offsetWidth' : 'offsetHeight'];\n return y1 > viewportY1 && y2 < viewportY2;\n}\n\nexport default isFullyVisible;\n","import findInViewport from './findInViewport';\nimport isFullyVisible from './isFullyVisible';\nimport fastSmoothScroll from './fastSmoothScroll';\n\nconst VIEWPORT_MARGIN = 8;\nconst SCROLL_MARGIN = 10;\n\nexport default function setTooltipItemVisible(selector: string, index: number, containerRef: Record) {\n const container = containerRef.current!;\n if (!container || index < 0) {\n return;\n }\n const { visibleIndexes, allElements } = findInViewport(\n container,\n selector,\n VIEWPORT_MARGIN,\n true,\n true,\n );\n\n if (!allElements.length || !allElements[index]) {\n return;\n }\n const first = visibleIndexes[0];\n if (!visibleIndexes.includes(index)\n || (index === first && !isFullyVisible(container, allElements[first]))) {\n const position = index > visibleIndexes[visibleIndexes.length - 1] ? 'start' : 'end';\n fastSmoothScroll(container, allElements[index], position, SCROLL_MARGIN);\n }\n}\n","import { useCallback, useEffect, useState } from '../../../../lib/teact/teact';\nimport captureKeyboardListeners from '../../../../util/captureKeyboardListeners';\nimport cycleRestrict from '../../../../util/cycleRestrict';\n\nexport function useKeyboardNavigation({\n isActive,\n isHorizontal,\n shouldRemoveSelectionOnReset,\n noArrowNavigation,\n items,\n shouldSelectOnTab,\n onSelect,\n onClose,\n}: {\n isActive: boolean;\n isHorizontal?: boolean;\n shouldRemoveSelectionOnReset?: boolean;\n noArrowNavigation?: boolean;\n items?: any[];\n shouldSelectOnTab?: boolean;\n onSelect: AnyToVoidFunction;\n onClose: NoneToVoidFunction;\n}) {\n const [selectedItemIndex, setSelectedItemIndex] = useState(-1);\n\n const getSelectedIndex = useCallback((newIndex: number) => {\n if (!items) {\n return -1;\n }\n\n return cycleRestrict(items.length, newIndex);\n }, [items]);\n\n const handleArrowKey = useCallback((value: number, e: KeyboardEvent) => {\n e.preventDefault();\n setSelectedItemIndex((index) => (getSelectedIndex(index + value)));\n }, [setSelectedItemIndex, getSelectedIndex]);\n\n const handleItemSelect = useCallback((e: KeyboardEvent) => {\n if (items && items.length && selectedItemIndex > -1) {\n const item = items[selectedItemIndex];\n if (item) {\n e.preventDefault();\n onSelect(item);\n }\n }\n }, [items, onSelect, selectedItemIndex]);\n\n useEffect(() => {\n setSelectedItemIndex(shouldRemoveSelectionOnReset ? -1 : 0);\n }, [items, shouldRemoveSelectionOnReset]);\n\n useEffect(() => (isActive ? captureKeyboardListeners({\n onEsc: onClose,\n onUp: noArrowNavigation || isHorizontal ? undefined : (e: KeyboardEvent) => handleArrowKey(-1, e),\n onDown: noArrowNavigation || isHorizontal ? undefined : (e: KeyboardEvent) => handleArrowKey(1, e),\n onLeft: noArrowNavigation || !isHorizontal ? undefined : (e: KeyboardEvent) => handleArrowKey(-1, e),\n onRight: noArrowNavigation || !isHorizontal ? undefined : (e: KeyboardEvent) => handleArrowKey(1, e),\n onTab: shouldSelectOnTab ? handleItemSelect : undefined,\n onEnter: handleItemSelect,\n }) : undefined), [\n noArrowNavigation, handleArrowKey, handleItemSelect, isActive, isHorizontal, onClose, shouldSelectOnTab,\n ]);\n\n return selectedItemIndex;\n}\n","import React, {\n FC, useCallback, useEffect, useRef, memo,\n} from '../../../lib/teact/teact';\nimport usePrevious from '../../../hooks/usePrevious';\n\nimport { ApiUser } from '../../../api/types';\n\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\nimport setTooltipItemVisible from '../../../util/setTooltipItemVisible';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\n\nimport ListItem from '../../ui/ListItem';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\nimport './MentionTooltip.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onClose: () => void;\n onInsertUserName: (user: ApiUser, forceFocus?: boolean) => void;\n filteredUsers?: ApiUser[];\n usersById?: Record;\n};\n\nconst MentionTooltip: FC = ({\n isOpen,\n onClose,\n onInsertUserName,\n usersById,\n filteredUsers,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n\n const handleUserSelect = useCallback((userId: number, forceFocus = false) => {\n const user = usersById?.[userId];\n if (!user) {\n return;\n }\n\n onInsertUserName(user, forceFocus);\n }, [usersById, onInsertUserName]);\n\n const handleSelectMention = useCallback((member: ApiUser) => {\n handleUserSelect(member.id, true);\n }, [handleUserSelect]);\n\n const selectedMentionIndex = useKeyboardNavigation({\n isActive: isOpen,\n items: filteredUsers,\n onSelect: handleSelectMention,\n shouldSelectOnTab: true,\n onClose,\n });\n\n useEffect(() => {\n setTooltipItemVisible('.chat-item-clickable', selectedMentionIndex, containerRef);\n }, [selectedMentionIndex]);\n\n useEffect(() => {\n if (filteredUsers && !filteredUsers.length) {\n onClose();\n }\n }, [filteredUsers, onClose]);\n\n const prevChatMembers = usePrevious(\n filteredUsers?.length\n ? filteredUsers\n : undefined,\n shouldRender,\n );\n const renderedChatMembers = filteredUsers && !filteredUsers.length\n ? prevChatMembers\n : filteredUsers;\n\n if (!shouldRender || (renderedChatMembers && !renderedChatMembers.length)) {\n return undefined;\n }\n\n const className = buildClassName(\n 'MentionTooltip composer-tooltip custom-scroll',\n transitionClassNames,\n );\n\n return (\n
\n {renderedChatMembers?.map(({ id }, index) => (\n handleUserSelect(id)}\n focus={selectedMentionIndex === index}\n >\n \n \n ))}\n
\n );\n};\n\nexport default memo(MentionTooltip);\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { ApiAttachment, ApiChatMember, ApiUser } from '../../../api/types';\n\nimport { CONTENT_TYPES_FOR_QUICK_UPLOAD, EDITABLE_INPUT_MODAL_ID } from '../../../config';\nimport { getFileExtension } from '../../common/helpers/documentInfo';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport usePrevious from '../../../hooks/usePrevious';\nimport useMentionTooltip from './hooks/useMentionTooltip';\nimport useEmojiTooltip from './hooks/useEmojiTooltip';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\n\nimport Button from '../../ui/Button';\nimport Modal from '../../ui/Modal';\nimport File from '../../common/File';\nimport MessageInput from './MessageInput';\nimport MentionTooltip from './MentionTooltip';\nimport EmojiTooltip from './EmojiTooltip.async';\n\nimport './AttachmentModal.scss';\n\nexport type OwnProps = {\n attachments: ApiAttachment[];\n caption: string;\n isReady?: boolean;\n currentUserId?: number;\n groupChatMembers?: ApiChatMember[];\n usersById?: Record;\n recentEmojis: string[];\n baseEmojiKeywords?: Record;\n emojiKeywords?: Record;\n addRecentEmoji: AnyToVoidFunction;\n onCaptionUpdate: (html: string) => void;\n onSend: () => void;\n onFileAppend: (files: File[], isQuick: boolean) => void;\n onClear: () => void;\n};\n\nconst DROP_LEAVE_TIMEOUT_MS = 150;\n\nconst AttachmentModal: FC = ({\n attachments,\n caption,\n isReady,\n currentUserId,\n groupChatMembers,\n usersById,\n recentEmojis,\n baseEmojiKeywords,\n emojiKeywords,\n addRecentEmoji,\n onCaptionUpdate,\n onSend,\n onFileAppend,\n onClear,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const hideTimeoutRef = useRef(null);\n const prevAttachments = usePrevious(attachments);\n const renderingAttachments = attachments.length ? attachments : prevAttachments;\n const isOpen = Boolean(attachments.length);\n const [isHovered, markHovered, unmarkHovered] = useFlag();\n const isQuick = Boolean(renderingAttachments && renderingAttachments.every((a) => a.quick));\n const lang = useLang();\n\n const {\n isMentionTooltipOpen, closeMentionTooltip, insertMention, mentionFilteredUsers,\n } = useMentionTooltip(\n isOpen,\n caption,\n onCaptionUpdate,\n EDITABLE_INPUT_MODAL_ID,\n groupChatMembers,\n undefined,\n currentUserId,\n usersById,\n );\n const {\n isEmojiTooltipOpen, closeEmojiTooltip, filteredEmojis, insertEmoji,\n } = useEmojiTooltip(\n isOpen,\n caption,\n recentEmojis,\n EDITABLE_INPUT_MODAL_ID,\n onCaptionUpdate,\n baseEmojiKeywords,\n emojiKeywords,\n !isReady,\n );\n\n useEffect(() => (isOpen ? captureEscKeyListener(onClear) : undefined), [isOpen, onClear]);\n\n const sendAttachments = useCallback(() => {\n if (isOpen) {\n onSend();\n }\n }, [isOpen, onSend]);\n\n const handleDragLeave = (e: React.DragEvent) => {\n const { relatedTarget: toTarget, target: fromTarget } = e;\n\n // Esc button pressed during drag event\n if ((fromTarget as HTMLDivElement).matches('.drop-target') && !toTarget) {\n hideTimeoutRef.current = window.setTimeout(unmarkHovered, DROP_LEAVE_TIMEOUT_MS);\n }\n\n // Prevent DragLeave event from firing when the pointer moves inside the AttachmentModal drop target\n if (fromTarget && (fromTarget as HTMLElement).closest('.AttachmentModal.hovered')) {\n return;\n }\n\n if (toTarget) {\n e.stopPropagation();\n }\n\n unmarkHovered();\n };\n\n const handleFilesDrop = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n unmarkHovered();\n\n const { dataTransfer: { files } } = e;\n\n if (files?.length) {\n const newFiles = isQuick\n ? Array.from(files).filter((file) => {\n return file.type && CONTENT_TYPES_FOR_QUICK_UPLOAD.has(file.type);\n })\n : Array.from(files);\n\n onFileAppend(newFiles, isQuick);\n }\n }, [isQuick, onFileAppend, unmarkHovered]);\n\n function handleDragOver(e: React.MouseEvent) {\n e.preventDefault();\n e.stopPropagation();\n\n if (hideTimeoutRef.current) {\n window.clearTimeout(hideTimeoutRef.current);\n }\n }\n\n if (!renderingAttachments) {\n return undefined;\n }\n\n const areAllPhotos = renderingAttachments.every((a) => a.mimeType.startsWith('image/'));\n const areAllVideos = renderingAttachments.every((a) => a.mimeType.startsWith('video/'));\n\n let title = '';\n if (areAllPhotos) {\n title = lang('PreviewSender.SendPhoto', renderingAttachments.length, 'i');\n } else if (areAllVideos) {\n title = lang('PreviewSender.SendVideo', renderingAttachments.length, 'i');\n } else {\n title = lang('PreviewSender.SendFile', renderingAttachments.length, 'i');\n }\n\n function renderHeader() {\n if (!renderingAttachments) {\n return undefined;\n }\n\n return (\n
\n \n
{title}
\n \n {lang('Send')}\n \n
\n );\n }\n\n return (\n \n \n {isQuick ? (\n
\n {renderingAttachments.map((attachment) => (\n attachment.mimeType.startsWith('image/')\n ? \"\"\n :
\n ) : (\n
\n {renderingAttachments.map((attachment) => (\n \n ))}\n
\n )}\n\n
\n \n \n \n
\n \n \n );\n};\n\nexport default memo(AttachmentModal);\n","import { ChangeEvent, RefObject } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,\n} from '../../../lib/teact/teact';\n\nimport { ApiNewPoll } from '../../../api/types';\n\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport parseMessageInput from './helpers/parseMessageInput';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\nimport Modal from '../../ui/Modal';\nimport InputText from '../../ui/InputText';\nimport Checkbox from '../../ui/Checkbox';\nimport RadioGroup from '../../ui/RadioGroup';\n\nimport './PollModal.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onSend: (pollSummary: ApiNewPoll) => void;\n onClear: () => void;\n};\n\nconst MAX_LIST_HEIGHT = 320;\nconst MAX_OPTIONS_COUNT = 10;\nconst MAX_OPTION_LENGTH = 100;\nconst MAX_QUESTION_LENGTH = 255;\nconst MAX_SOLUTION_LENGTH = 200;\n\nconst PollModal: FC = ({ isOpen, onSend, onClear }) => {\n // eslint-disable-next-line no-null/no-null\n const questionInputRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const optionsListRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const solutionRef = useRef(null);\n\n const [question, setQuestion] = useState('');\n const [options, setOptions] = useState(['']);\n const [isAnonymous, setIsAnonymous] = useState(true);\n const [isMultipleAnswers, setIsMultipleAnswers] = useState(false);\n const [isQuizMode, setIsQuizMode] = useState(false);\n const [solution, setSolution] = useState();\n const [correctOption, setCorrectOption] = useState();\n const [hasErrors, setHasErrors] = useState(false);\n\n const lang = useLang();\n\n const focusInput = useCallback((ref: RefObject) => {\n if (isOpen && ref.current) {\n ref.current.focus();\n }\n }, [isOpen]);\n\n useEffect(() => (isOpen ? captureEscKeyListener(onClear) : undefined), [isOpen, onClear]);\n useEffect(() => {\n if (!isOpen) {\n setQuestion('');\n setOptions(['']);\n setIsAnonymous(true);\n setIsMultipleAnswers(false);\n setIsQuizMode(false);\n setSolution('');\n setCorrectOption('');\n setHasErrors(false);\n }\n }, [isOpen]);\n\n useEffect(() => focusInput(questionInputRef), [focusInput, isOpen]);\n\n useLayoutEffect(() => {\n const solutionEl = solutionRef.current;\n\n if (solutionEl && solution !== solutionEl.innerHTML) {\n solutionEl.innerHTML = solution;\n }\n }, [solution]);\n\n const addNewOption = useCallback((newOptions: string[] = []) => {\n setOptions([...newOptions, '']);\n requestAnimationFrame(() => {\n const list = optionsListRef.current;\n if (!list) {\n return;\n }\n\n list.classList.toggle('overflown', list.scrollHeight > MAX_LIST_HEIGHT);\n list.scrollTo({ top: list.scrollHeight, behavior: 'smooth' });\n });\n }, []);\n\n const handleCreate = useCallback(() => {\n setHasErrors(false);\n if (!isOpen) {\n return;\n }\n\n const questionTrimmed = question.trim().substring(0, MAX_QUESTION_LENGTH);\n const optionsTrimmed = options.map((o) => o.trim().substring(0, MAX_OPTION_LENGTH)).filter((o) => o.length);\n\n if (!questionTrimmed || optionsTrimmed.length < 2) {\n setQuestion(questionTrimmed);\n if (optionsTrimmed.length) {\n if (optionsTrimmed.length < 2) {\n addNewOption(optionsTrimmed);\n } else {\n setOptions(optionsTrimmed);\n }\n } else {\n addNewOption();\n }\n setHasErrors(true);\n return;\n }\n\n if (isQuizMode && (!correctOption || !optionsTrimmed[Number(correctOption)])) {\n setHasErrors(true);\n return;\n }\n\n const answers = optionsTrimmed\n .map((text, index) => ({\n text: text.trim(),\n option: String(index),\n ...(String(index) === correctOption && { correct: true }),\n }));\n\n const payload: ApiNewPoll = {\n summary: {\n question: questionTrimmed,\n answers,\n ...(!isAnonymous && { isPublic: true }),\n ...(isMultipleAnswers && { multipleChoice: true }),\n ...(isQuizMode && { quiz: true }),\n },\n };\n\n if (isQuizMode) {\n const { text, entities } = (solution && parseMessageInput(solution.substring(0, MAX_SOLUTION_LENGTH))) || {};\n\n payload.quiz = {\n correctAnswers: [correctOption],\n ...(text && { solution: text }),\n ...(entities && { solutionEntities: entities }),\n };\n }\n\n onSend(payload);\n }, [\n isOpen,\n question,\n options,\n isQuizMode,\n correctOption,\n isAnonymous,\n isMultipleAnswers,\n onSend,\n addNewOption,\n solution,\n ]);\n\n const updateOption = useCallback((index: number, text: string) => {\n const newOptions = [...options];\n newOptions[index] = text;\n if (newOptions[newOptions.length - 1].trim().length && newOptions.length < MAX_OPTIONS_COUNT) {\n addNewOption(newOptions);\n } else {\n setOptions(newOptions);\n }\n }, [options, addNewOption]);\n\n const removeOption = useCallback((index: number) => {\n const newOptions = [...options];\n newOptions.splice(index, 1);\n setOptions(newOptions);\n requestAnimationFrame(() => {\n if (!optionsListRef.current) {\n return;\n }\n\n optionsListRef.current.classList.toggle('overflown', optionsListRef.current.scrollHeight > MAX_LIST_HEIGHT);\n });\n }, [options]);\n\n const handleCorrectOptionChange = useCallback((newValue: string) => {\n setCorrectOption(newValue);\n }, [setCorrectOption]);\n\n const handleIsAnonymousChange = useCallback((e: ChangeEvent) => {\n setIsAnonymous(e.target.checked);\n }, []);\n\n const handleMultipleAnswersChange = useCallback((e: ChangeEvent) => {\n setIsMultipleAnswers(e.target.checked);\n }, []);\n\n const handleQuizModeChange = useCallback((e: ChangeEvent) => {\n setIsQuizMode(e.target.checked);\n }, []);\n\n const handleKeyPress = useCallback((e: React.KeyboardEvent) => {\n if (e.keyCode === 13) {\n handleCreate();\n }\n }, [handleCreate]);\n\n const getQuestionError = useCallback(() => {\n if (hasErrors && !question.trim().length) {\n return lang('lng_polls_choose_question');\n }\n\n return undefined;\n }, [hasErrors, lang, question]);\n\n const getOptionsError = useCallback((index: number) => {\n const optionsTrimmed = options.map((o) => o.trim()).filter((o) => o.length);\n if (hasErrors && optionsTrimmed.length < 2 && !options[index].trim().length) {\n return lang('lng_polls_choose_answers');\n }\n return undefined;\n }, [hasErrors, lang, options]);\n\n function renderHeader() {\n return (\n
\n \n
{lang('NewPoll')}
\n \n {lang('Create')}\n \n
\n );\n }\n\n function renderOptions() {\n return options.map((option, index) => (\n
\n updateOption(index, e.currentTarget.value)}\n onKeyPress={handleKeyPress}\n />\n {index !== options.length - 1 && (\n removeOption(index)}\n >\n \n \n )}\n
\n ));\n }\n\n function renderRadioOptions() {\n return renderOptions()\n .map((label, index) => ({ value: String(index), label, hidden: index === options.length - 1 }));\n }\n\n function renderQuizNoOptionError() {\n const optionsTrimmed = options.map((o) => o.trim()).filter((o) => o.length);\n\n return isQuizMode && (!correctOption || !optionsTrimmed[Number(correctOption)]) && (\n

{lang('lng_polls_choose_correct')}

\n );\n }\n\n return (\n \n setQuestion(e.currentTarget.value)}\n onKeyPress={handleKeyPress}\n />\n
\n\n
\n

{lang('PollOptions')}

\n\n {hasErrors && renderQuizNoOptionError()}\n {isQuizMode ? (\n \n ) : (\n renderOptions()\n )}\n\n
\n\n
\n\n
\n \n \n \n {isQuizMode && (\n <>\n

{lang('lng_polls_solution_title')}

\n setSolution(e.currentTarget.innerHTML)}\n />\n
{lang('CreatePoll.ExplanationInfo')}
\n \n )}\n
\n \n );\n};\n\nexport default memo(PollModal);\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { IS_EMOJI_SUPPORTED } from '../../../util/environment';\n\nimport './EmojiButton.scss';\n\ntype OwnProps = {\n emoji: Emoji;\n focus?: boolean;\n onClick: (emoji: string, name: string) => void;\n};\n\nconst EmojiButton: FC = ({ emoji, focus, onClick }) => {\n const handleClick = useCallback((e: React.MouseEvent) => {\n // Preventing safari from losing focus on Composer MessageInput\n e.preventDefault();\n\n onClick(emoji.native, emoji.id);\n }, [emoji, onClick]);\n\n return (\n \n {IS_EMOJI_SUPPORTED ? emoji.native : \"\"}\n
\n );\n};\n\nexport default memo(EmojiButton);\n","import React, { FC, memo, useRef } from '../../../lib/teact/teact';\n\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport windowSize from '../../../util/windowSize';\nimport { ObserveFn, useOnIntersect } from '../../../hooks/useIntersectionObserver';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useLang from '../../../hooks/useLang';\n\nimport EmojiButton from './EmojiButton';\n\nconst EMOJIS_PER_ROW_ON_DESKTOP = 9;\nconst EMOJI_MARGIN = 4;\nconst MOBILE_CONTAINER_PADDING = 8;\nconst EMOJI_SIZE = 40;\n\ntype OwnProps = {\n category: EmojiCategory;\n index: number;\n allEmojis: AllEmojis;\n observeIntersection: ObserveFn;\n shouldRender: boolean;\n onEmojiSelect: (emoji: string, name: string) => void;\n};\n\nconst EmojiCategory: FC = ({\n category, index, allEmojis, observeIntersection, shouldRender, onEmojiSelect,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n useOnIntersect(ref, observeIntersection);\n\n const { transitionClassNames } = useShowTransition(shouldRender, undefined, undefined, 'slow');\n\n const lang = useLang();\n\n const emojisPerRow = IS_SINGLE_COLUMN_LAYOUT\n ? Math.floor((windowSize.get().width - MOBILE_CONTAINER_PADDING) / (EMOJI_SIZE + EMOJI_MARGIN))\n : EMOJIS_PER_ROW_ON_DESKTOP;\n const height = Math.ceil(category.emojis.length / emojisPerRow) * (EMOJI_SIZE + EMOJI_MARGIN);\n\n return (\n \n

\n {lang(category.id === 'recent' ? 'RecentStickers' : `Emoji${index}`)}\n

\n \n {shouldRender && category.emojis.map((name) => {\n const emoji = allEmojis[name];\n // Recent emojis may contain emoticons that are no longer in the list\n if (!emoji) {\n return undefined;\n }\n // Some emojis have multiple skins and are represented as an Object with emojis for all skins.\n // For now, we select only the first emoji with 'neutral' skin.\n const displayedEmoji = 'id' in emoji ? emoji : emoji[1];\n\n return (\n \n );\n })}\n
\n \n );\n};\n\nexport default memo(EmojiCategory);\n","import React, {\n FC, useState, useEffect, memo, useRef, useMemo, useCallback,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\n\nimport { MENU_TRANSITION_DURATION } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport {\n EmojiModule,\n EmojiRawData,\n EmojiData,\n uncompressEmoji,\n} from '../../../util/emoji';\nimport fastSmoothScroll from '../../../util/fastSmoothScroll';\nimport buildClassName from '../../../util/buildClassName';\nimport { pick } from '../../../util/iteratees';\nimport fastSmoothScrollHorizontal from '../../../util/fastSmoothScrollHorizontal';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useHorizontalScroll from '../../../hooks/useHorizontalScroll';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\nimport Loading from '../../ui/Loading';\nimport EmojiCategory from './EmojiCategory';\n\nimport './EmojiPicker.scss';\n\ntype OwnProps = {\n className?: string;\n onEmojiSelect: (emoji: string, name: string) => void;\n};\n\ntype StateProps = Pick;\ntype EmojiCategoryData = { id: string; name: string; emojis: string[] };\n\nconst ICONS_BY_CATEGORY: Record = {\n recent: 'icon-recent',\n people: 'icon-smile',\n nature: 'icon-animals',\n foods: 'icon-eats',\n activity: 'icon-sport',\n places: 'icon-car',\n objects: 'icon-lamp',\n symbols: 'icon-language',\n flags: 'icon-flag',\n};\n\nconst OPEN_ANIMATION_DELAY = 200;\n// Only a few categories are above this height.\nconst SMOOTH_SCROLL_DISTANCE = 800;\nconst FOCUS_MARGIN = 50;\nconst HEADER_BUTTON_WIDTH = 42; // px. Includes margins\nconst INTERSECTION_THROTTLE = 200;\n\nconst categoryIntersections: boolean[] = [];\n\nlet emojiDataPromise: Promise;\nlet emojiRawData: EmojiRawData;\nlet emojiData: EmojiData;\n\nconst EmojiPicker: FC = ({\n className, onEmojiSelect, recentEmojis,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const headerRef = useRef(null);\n\n const [categories, setCategories] = useState();\n const [emojis, setEmojis] = useState();\n const [activeCategoryIndex, setActiveCategoryIndex] = useState(0);\n\n const { observe: observeIntersection } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: INTERSECTION_THROTTLE,\n }, (entries) => {\n entries.forEach((entry) => {\n const { id } = entry.target as HTMLDivElement;\n if (!id || !id.startsWith('emoji-category-')) {\n return;\n }\n\n const index = Number(id.replace('emoji-category-', ''));\n categoryIntersections[index] = entry.isIntersecting;\n });\n\n const intersectingWithIndexes = categoryIntersections\n .map((isIntersecting, index) => ({ index, isIntersecting }))\n .filter(({ isIntersecting }) => isIntersecting);\n\n if (!intersectingWithIndexes.length) {\n return;\n }\n\n setActiveCategoryIndex(intersectingWithIndexes[Math.floor(intersectingWithIndexes.length / 2)].index);\n });\n\n useHorizontalScroll(headerRef.current, !IS_SINGLE_COLUMN_LAYOUT);\n\n // Scroll header when active set updates\n useEffect(() => {\n if (!categories) {\n return;\n }\n\n const header = headerRef.current;\n if (!header) {\n return;\n }\n\n const newLeft = activeCategoryIndex * HEADER_BUTTON_WIDTH - header.offsetWidth / 2 + HEADER_BUTTON_WIDTH / 2;\n\n fastSmoothScrollHorizontal(header, newLeft);\n }, [categories, activeCategoryIndex]);\n\n const lang = useLang();\n\n const allCategories = useMemo(() => {\n if (!categories) {\n return MEMO_EMPTY_ARRAY;\n }\n const themeCategories = [...categories];\n if (recentEmojis?.length) {\n themeCategories.unshift({\n id: 'recent',\n name: lang('RecentStickers'),\n emojis: recentEmojis,\n });\n }\n\n return themeCategories;\n }, [categories, lang, recentEmojis]);\n\n // Initialize data on first render.\n useEffect(() => {\n setTimeout(() => {\n const exec = () => {\n setCategories(emojiData.categories);\n\n setEmojis(emojiData.emojis as AllEmojis);\n };\n\n if (emojiData) {\n exec();\n } else {\n ensureEmojiData()\n .then(exec);\n }\n }, OPEN_ANIMATION_DELAY);\n }, []);\n\n const selectCategory = useCallback((index: number) => {\n setActiveCategoryIndex(index);\n const categoryEl = document.getElementById(`emoji-category-${index}`)!;\n fastSmoothScroll(containerRef.current!, categoryEl, 'start', FOCUS_MARGIN, SMOOTH_SCROLL_DISTANCE);\n }, []);\n\n const handleEmojiSelect = useCallback((emoji: string, name: string) => {\n onEmojiSelect(emoji, name);\n }, [onEmojiSelect]);\n\n const canRenderContents = useAsyncRendering([], MENU_TRANSITION_DURATION);\n\n function renderCategoryButton(category: EmojiCategoryData, index: number) {\n const icon = ICONS_BY_CATEGORY[category.id];\n\n return icon && (\n selectCategory(index)}\n ariaLabel={category.name}\n >\n \n \n );\n }\n\n const containerClassName = buildClassName('EmojiPicker', className);\n\n if (!emojis || !canRenderContents) {\n return (\n
\n \n
\n );\n }\n\n return (\n
\n
\n {allCategories.map(renderCategoryButton)}\n
\n \n {allCategories.map((category, i) => (\n = i - 1 && activeCategoryIndex <= i + 1}\n onEmojiSelect={handleEmojiSelect}\n />\n ))}\n
\n \n );\n};\n\nasync function ensureEmojiData() {\n if (!emojiDataPromise) {\n emojiDataPromise = import('emoji-data-ios/emoji-data.json') as unknown as Promise;\n emojiRawData = (await emojiDataPromise).default;\n\n emojiData = uncompressEmoji(emojiRawData);\n }\n\n return emojiDataPromise;\n}\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['recentEmojis']),\n)(EmojiPicker));\n","import React, { FC, memo, useRef } from '../../../lib/teact/teact';\n\nimport { ApiSticker } from '../../../api/types';\nimport { StickerSetOrRecent } from '../../../types';\nimport { ObserveFn, useOnIntersect } from '../../../hooks/useIntersectionObserver';\n\nimport { STICKER_SIZE_PICKER } from '../../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';\nimport windowSize from '../../../util/windowSize';\nimport StickerButton from '../../common/StickerButton';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport buildClassName from '../../../util/buildClassName';\n\ntype OwnProps = {\n stickerSet: StickerSetOrRecent;\n loadAndPlay: boolean;\n index: number;\n observeIntersection: ObserveFn;\n shouldRender: boolean;\n onStickerSelect: (sticker: ApiSticker) => void;\n onStickerUnfave: (sticker: ApiSticker) => void;\n};\n\nconst STICKERS_PER_ROW_ON_DESKTOP = 5;\nconst STICKER_MARGIN = IS_SINGLE_COLUMN_LAYOUT ? 8 : 16;\nconst MOBILE_CONTAINER_PADDING = 8;\n\nconst StickerSet: FC = ({\n stickerSet,\n loadAndPlay,\n index,\n observeIntersection,\n shouldRender,\n onStickerSelect,\n onStickerUnfave,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n\n useOnIntersect(ref, observeIntersection);\n\n const { transitionClassNames } = useShowTransition(shouldRender, undefined, undefined, 'slow');\n\n const stickersPerRow = IS_SINGLE_COLUMN_LAYOUT\n ? Math.floor((windowSize.get().width - MOBILE_CONTAINER_PADDING) / (STICKER_SIZE_PICKER + STICKER_MARGIN))\n : STICKERS_PER_ROW_ON_DESKTOP;\n const height = Math.ceil(stickerSet.count / stickersPerRow) * (STICKER_SIZE_PICKER + STICKER_MARGIN);\n\n return (\n \n

{stickerSet.title}

\n \n {shouldRender && stickerSet.stickers && stickerSet.stickers.map((sticker) => (\n \n ))}\n \n \n );\n};\n\nexport default memo(StickerSet);\n","import React, {\n FC, useState, useEffect, memo, useRef, useMemo, useCallback,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiStickerSet, ApiSticker } from '../../../api/types';\nimport { StickerSetOrRecent } from '../../../types';\n\nimport { SLIDE_TRANSITION_DURATION, STICKER_SIZE_PICKER_HEADER } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { MEMO_EMPTY_ARRAY } from '../../../util/memo';\nimport fastSmoothScroll from '../../../util/fastSmoothScroll';\nimport buildClassName from '../../../util/buildClassName';\nimport { pick } from '../../../util/iteratees';\nimport fastSmoothScrollHorizontal from '../../../util/fastSmoothScrollHorizontal';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useHorizontalScroll from '../../../hooks/useHorizontalScroll';\nimport useLang from '../../../hooks/useLang';\n\nimport Loading from '../../ui/Loading';\nimport Button from '../../ui/Button';\nimport StickerButton from '../../common/StickerButton';\nimport StickerSet from './StickerSet';\nimport StickerSetCover from './StickerSetCover';\nimport StickerSetCoverAnimated from './StickerSetCoverAnimated';\n\nimport './StickerPicker.scss';\n\ntype OwnProps = {\n className: string;\n loadAndPlay: boolean;\n canSendStickers: boolean;\n onStickerSelect: (sticker: ApiSticker) => void;\n};\n\ntype StateProps = {\n recentStickers: ApiSticker[];\n favoriteStickers: ApiSticker[];\n stickerSetsById: Record;\n addedSetIds?: string[];\n shouldPlay?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst SMOOTH_SCROLL_DISTANCE = 500;\nconst HEADER_BUTTON_WIDTH = 52; // px (including margin)\nconst STICKER_INTERSECTION_THROTTLE = 200;\n\nconst stickerSetIntersections: boolean[] = [];\n\nconst StickerPicker: FC = ({\n className,\n loadAndPlay,\n canSendStickers,\n recentStickers,\n favoriteStickers,\n addedSetIds,\n stickerSetsById,\n shouldPlay,\n onStickerSelect,\n loadStickerSets,\n loadRecentStickers,\n loadFavoriteStickers,\n loadAddedStickers,\n addRecentSticker,\n unfaveSticker,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const headerRef = useRef(null);\n const [activeSetIndex, setActiveSetIndex] = useState(0);\n\n const { observe: observeIntersection } = useIntersectionObserver({\n rootRef: containerRef,\n throttleMs: STICKER_INTERSECTION_THROTTLE,\n }, (entries) => {\n entries.forEach((entry) => {\n const { id } = entry.target as HTMLDivElement;\n if (!id || !id.startsWith('sticker-set-')) {\n return;\n }\n\n const index = Number(id.replace('sticker-set-', ''));\n stickerSetIntersections[index] = entry.isIntersecting;\n });\n\n const intersectingWithIndexes = stickerSetIntersections\n .map((isIntersecting, index) => ({ index, isIntersecting }))\n .filter(({ isIntersecting }) => isIntersecting);\n\n if (!intersectingWithIndexes.length) {\n return;\n }\n\n setActiveSetIndex(intersectingWithIndexes[Math.floor(intersectingWithIndexes.length / 2)].index);\n });\n const { observe: observeIntersectionForCovers } = useIntersectionObserver({ rootRef: headerRef });\n\n const lang = useLang();\n\n const areAddedLoaded = Boolean(addedSetIds);\n\n const allSets = useMemo(() => {\n if (!addedSetIds) {\n return MEMO_EMPTY_ARRAY;\n }\n\n return [\n {\n id: 'recent',\n title: lang('RecentStickers'),\n stickers: recentStickers,\n count: recentStickers.length,\n },\n {\n id: 'favorite',\n title: lang('FavoriteStickers'),\n stickers: favoriteStickers,\n count: favoriteStickers.length,\n },\n ...addedSetIds.map((id) => stickerSetsById[id]).filter(Boolean),\n ];\n }, [addedSetIds, lang, recentStickers, favoriteStickers, stickerSetsById]);\n\n const noPopulatedSets = useMemo(() => (\n areAddedLoaded\n && allSets.filter((set) => set.stickers?.length).length === 0\n ), [allSets, areAddedLoaded]);\n\n useEffect(() => {\n if (loadAndPlay) {\n loadStickerSets();\n loadRecentStickers();\n loadFavoriteStickers();\n }\n }, [loadAndPlay, loadFavoriteStickers, loadRecentStickers, loadStickerSets]);\n\n useEffect(() => {\n if (addedSetIds?.length) {\n loadAddedStickers();\n }\n }, [addedSetIds, loadAddedStickers]);\n\n useHorizontalScroll(headerRef.current);\n\n // Scroll container and header when active set changes\n useEffect(() => {\n if (!areAddedLoaded) {\n return;\n }\n\n const header = headerRef.current;\n if (!header) {\n return;\n }\n\n const newLeft = activeSetIndex * HEADER_BUTTON_WIDTH - (header.offsetWidth / 2 - HEADER_BUTTON_WIDTH / 2);\n\n fastSmoothScrollHorizontal(header, newLeft);\n }, [areAddedLoaded, activeSetIndex]);\n\n const selectStickerSet = useCallback((index: number) => {\n setActiveSetIndex(index);\n const stickerSetEl = document.getElementById(`sticker-set-${index}`)!;\n fastSmoothScroll(containerRef.current!, stickerSetEl, 'start', undefined, SMOOTH_SCROLL_DISTANCE);\n }, []);\n\n const handleStickerSelect = useCallback((sticker: ApiSticker) => {\n onStickerSelect(sticker);\n addRecentSticker({ sticker });\n }, [addRecentSticker, onStickerSelect]);\n\n const handleStickerUnfave = useCallback((sticker: ApiSticker) => {\n unfaveSticker({ sticker });\n }, [unfaveSticker]);\n\n const canRenderContents = useAsyncRendering([], SLIDE_TRANSITION_DURATION);\n\n function renderCover(stickerSet: StickerSetOrRecent, index: number) {\n const firstSticker = stickerSet.stickers?.[0];\n const buttonClassName = buildClassName(\n 'symbol-set-button sticker-set-button',\n index === activeSetIndex && 'activated',\n );\n\n if (stickerSet.id === 'recent' || stickerSet.id === 'favorite' || stickerSet.hasThumbnail || !firstSticker) {\n return (\n selectStickerSet(index)}\n >\n {stickerSet.id === 'recent' ? (\n \n ) : stickerSet.id === 'favorite' ? (\n \n ) : stickerSet.isAnimated ? (\n \n ) : (\n \n )}\n \n );\n } else {\n return (\n \n );\n }\n }\n\n const fullClassName = buildClassName('StickerPicker', className);\n\n if (!areAddedLoaded || !canRenderContents || noPopulatedSets || !canSendStickers) {\n return (\n
\n {!canSendStickers ? (\n
Sending stickers is not allowed in this chat.
\n ) : noPopulatedSets ? (\n
You have no saved Stickers.
\n ) : (\n \n )}\n
\n );\n }\n\n return (\n
\n \n {allSets.map(renderCover)}\n
\n \n {allSets.map((stickerSet, i) => (\n = i - 1 && activeSetIndex <= i + 1}\n onStickerSelect={handleStickerSelect}\n onStickerUnfave={handleStickerUnfave}\n />\n ))}\n \n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n setsById,\n added,\n recent,\n favorite,\n } = global.stickers;\n\n return {\n recentStickers: recent.stickers,\n favoriteStickers: favorite.stickers,\n stickerSetsById: setsById,\n addedSetIds: added.setIds,\n shouldPlay: global.settings.byKey.shouldLoopStickers,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadStickerSets',\n 'loadRecentStickers',\n 'loadFavoriteStickers',\n 'loadAddedStickers',\n 'addRecentSticker',\n 'unfaveSticker',\n ]),\n)(StickerPicker));\n","import React, {\n FC, memo, useCallback, useRef,\n} from '../../lib/teact/teact';\n\nimport { ApiMediaFormat, ApiVideo } from '../../api/types';\n\nimport buildClassName from '../../util/buildClassName';\nimport { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver';\nimport useMedia from '../../hooks/useMedia';\nimport useTransitionForMedia from '../../hooks/useTransitionForMedia';\nimport useVideoCleanup from '../../hooks/useVideoCleanup';\nimport useBuffering from '../../hooks/useBuffering';\nimport useCanvasBlur from '../../hooks/useCanvasBlur';\nimport { preventMessageInputBlurWithBubbling } from '../middle/helpers/preventMessageInputBlur';\n\nimport Spinner from '../ui/Spinner';\n\nimport './GifButton.scss';\n\ntype OwnProps = {\n gif: ApiVideo;\n observeIntersection: ObserveFn;\n isDisabled?: boolean;\n className?: string;\n onClick: (gif: ApiVideo) => void;\n};\n\nconst GifButton: FC = ({\n gif, observeIntersection, isDisabled, className, onClick,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const ref = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const videoRef = useRef(null);\n\n const hasThumbnail = Boolean(gif.thumbnail?.dataUri);\n const localMediaHash = `gif${gif.id}`;\n const isIntersecting = useIsIntersecting(ref, observeIntersection);\n const loadAndPlay = isIntersecting && !isDisabled;\n const previewBlobUrl = useMedia(`${localMediaHash}?size=m`, !loadAndPlay, ApiMediaFormat.BlobUrl);\n const thumbRef = useCanvasBlur(gif.thumbnail?.dataUri, Boolean(previewBlobUrl));\n const videoData = useMedia(localMediaHash, !loadAndPlay, ApiMediaFormat.BlobUrl);\n const shouldRenderVideo = Boolean(loadAndPlay && videoData);\n const { isBuffered, bufferingHandlers } = useBuffering(true);\n const shouldRenderSpinner = loadAndPlay && !isBuffered;\n const isVideoReady = loadAndPlay && isBuffered;\n\n useVideoCleanup(videoRef, [shouldRenderVideo]);\n\n const handleClick = useCallback(\n () => onClick({\n ...gif,\n blobUrl: videoData,\n }),\n [onClick, gif, videoData],\n );\n\n const fullClassName = buildClassName(\n 'GifButton',\n gif.width && gif.height && gif.width < gif.height ? 'vertical' : 'horizontal',\n localMediaHash,\n className,\n );\n\n return (\n \n {hasThumbnail && (\n \n )}\n {previewBlobUrl && !isVideoReady && (\n \n )}\n {shouldRenderVideo && (\n \n \n \n )}\n {shouldRenderSpinner && (\n \n )}\n \n );\n};\n\nexport default memo(GifButton);\n","import React, {\n FC, useEffect, memo, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiVideo } from '../../../api/types';\n\nimport { SLIDE_TRANSITION_DURATION } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport { pick } from '../../../util/iteratees';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useAsyncRendering from '../../right/hooks/useAsyncRendering';\n\nimport Loading from '../../ui/Loading';\nimport GifButton from '../../common/GifButton';\n\nimport './GifPicker.scss';\n\ntype OwnProps = {\n className: string;\n loadAndPlay: boolean;\n canSendGifs: boolean;\n onGifSelect: (gif: ApiVideo) => void;\n};\n\ntype StateProps = {\n savedGifs?: ApiVideo[];\n};\n\ntype DispatchProps = Pick;\n\nconst INTERSECTION_DEBOUNCE = 300;\n\nconst GifPicker: FC = ({\n className,\n loadAndPlay,\n canSendGifs,\n savedGifs,\n onGifSelect,\n loadSavedGifs,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, debounceMs: INTERSECTION_DEBOUNCE });\n\n useEffect(() => {\n if (loadAndPlay) {\n loadSavedGifs();\n }\n }, [loadAndPlay, loadSavedGifs]);\n\n const canRenderContents = useAsyncRendering([], SLIDE_TRANSITION_DURATION);\n\n return (\n \n {!canSendGifs ? (\n
Sending GIFs is not allowed in this chat.
\n ) : canRenderContents && savedGifs && savedGifs.length ? (\n savedGifs.map((gif) => (\n \n ))\n ) : canRenderContents && savedGifs ? (\n
No saved GIFs.
\n ) : (\n \n )}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n savedGifs: global.gifs.saved.gifs,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadSavedGifs']),\n)(GifPicker));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\n\ntype OwnProps = {\n activeTab: SymbolMenuTabs;\n onSwitchTab: (tab: SymbolMenuTabs) => void;\n onRemoveSymbol: () => void;\n onSearchOpen: (type: 'stickers' | 'gifs') => void;\n};\n\nexport enum SymbolMenuTabs {\n 'Emoji',\n 'Stickers',\n 'GIFs',\n}\n\n// Getting enum string values for display in Tabs.\n// See: https://www.typescriptlang.org/docs/handbook/enums.html#reverse-mappings\nexport const SYMBOL_MENU_TAB_TITLES = Object.values(SymbolMenuTabs)\n .filter((value): value is string => typeof value === 'string');\n\nconst SYMBOL_MENU_TAB_ICONS = {\n [SymbolMenuTabs.Emoji]: 'icon-smile',\n [SymbolMenuTabs.Stickers]: 'icon-stickers',\n [SymbolMenuTabs.GIFs]: 'icon-gifs',\n};\n\nconst SymbolMenuFooter: FC = ({\n activeTab, onSwitchTab, onRemoveSymbol, onSearchOpen,\n}) => {\n const lang = useLang();\n\n function renderTabButton(tab: SymbolMenuTabs) {\n return (\n onSwitchTab(tab)}\n ariaLabel={SYMBOL_MENU_TAB_TITLES[tab]}\n round\n faded\n color=\"translucent\"\n >\n \n \n );\n }\n\n const handleSearchOpen = useCallback(() => {\n onSearchOpen(activeTab === SymbolMenuTabs.Stickers ? 'stickers' : 'gifs');\n }, [activeTab, onSearchOpen]);\n\n function stopPropagation(event: any) {\n event.stopPropagation();\n }\n\n return (\n
\n {activeTab !== SymbolMenuTabs.Emoji && (\n \n \n \n )}\n\n {renderTabButton(SymbolMenuTabs.Emoji)}\n {renderTabButton(SymbolMenuTabs.Stickers)}\n {renderTabButton(SymbolMenuTabs.GIFs)}\n\n {activeTab === SymbolMenuTabs.Emoji && (\n \n \n \n )}\n
\n );\n};\n\nexport default memo(SymbolMenuFooter);\n","import React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiSticker, ApiVideo } from '../../../api/types';\n\nimport { IAllowedAttachmentOptions } from '../../../modules/helpers';\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment';\nimport { fastRaf } from '../../../util/schedulers';\nimport buildClassName from '../../../util/buildClassName';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport useMouseInside from '../../../hooks/useMouseInside';\nimport useLang from '../../../hooks/useLang';\n\nimport Button from '../../ui/Button';\nimport Menu from '../../ui/Menu';\nimport Transition from '../../ui/Transition';\nimport EmojiPicker from './EmojiPicker';\nimport StickerPicker from './StickerPicker';\nimport GifPicker from './GifPicker';\nimport SymbolMenuFooter, { SYMBOL_MENU_TAB_TITLES, SymbolMenuTabs } from './SymbolMenuFooter';\nimport Portal from '../../ui/Portal';\n\nimport './SymbolMenu.scss';\n\nconst ANIMATION_DURATION = 350;\n\nexport type OwnProps = {\n isOpen: boolean;\n allowedAttachmentOptions: IAllowedAttachmentOptions;\n onLoad: () => void;\n onClose: () => void;\n onEmojiSelect: (emoji: string) => void;\n onStickerSelect: (sticker: ApiSticker, shouldPreserveInput?: boolean) => void;\n onGifSelect: (gif: ApiVideo) => void;\n onRemoveSymbol: () => void;\n onSearchOpen: (type: 'stickers' | 'gifs') => void;\n addRecentEmoji: AnyToVoidFunction;\n};\n\ntype StateProps = {\n isLeftColumnShown: boolean;\n};\n\nlet isActivated = false;\n\nconst SymbolMenu: FC = ({\n isOpen, allowedAttachmentOptions, isLeftColumnShown,\n onLoad, onClose,\n onEmojiSelect, onStickerSelect, onGifSelect,\n onRemoveSymbol, onSearchOpen, addRecentEmoji,\n}) => {\n const [activeTab, setActiveTab] = useState(0);\n const [recentEmojis, setRecentEmojis] = useState([]);\n\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose, undefined, IS_SINGLE_COLUMN_LAYOUT);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, onClose, false, false);\n\n if (!isActivated && isOpen) {\n isActivated = true;\n }\n\n useEffect(() => {\n onLoad();\n }, [onLoad]);\n\n useLayoutEffect(() => {\n if (!IS_SINGLE_COLUMN_LAYOUT) {\n return undefined;\n }\n\n if (isOpen) {\n document.body.classList.add('enable-symbol-menu-transforms');\n document.body.classList.add('is-symbol-menu-open');\n }\n\n return () => {\n if (isOpen) {\n fastRaf(() => {\n document.body.classList.remove('is-symbol-menu-open');\n setTimeout(() => {\n document.body.classList.remove('enable-symbol-menu-transforms');\n }, ANIMATION_DURATION);\n });\n }\n };\n }, [isOpen]);\n\n const recentEmojisRef = useRef(recentEmojis);\n recentEmojisRef.current = recentEmojis;\n useEffect(() => {\n if (!recentEmojisRef.current.length) {\n return;\n }\n\n recentEmojisRef.current.forEach((name) => {\n addRecentEmoji({ emoji: name });\n });\n\n setRecentEmojis([]);\n }, [isOpen, activeTab, addRecentEmoji]);\n\n const handleEmojiSelect = useCallback((emoji: string, name: string) => {\n setRecentEmojis((emojis) => {\n return [...emojis, name];\n });\n\n onEmojiSelect(emoji);\n }, [onEmojiSelect]);\n\n const handleSearch = useCallback((type: 'stickers' | 'gifs') => {\n onClose();\n onSearchOpen(type);\n }, [onClose, onSearchOpen]);\n\n const handleStickerSelect = useCallback((sticker: ApiSticker) => {\n onStickerSelect(sticker, true);\n }, [onStickerSelect]);\n\n const lang = useLang();\n\n const { canSendStickers, canSendGifs } = allowedAttachmentOptions;\n\n function renderContent(isActive: boolean, isFrom: boolean) {\n switch (activeTab) {\n case SymbolMenuTabs.Emoji:\n return (\n \n );\n case SymbolMenuTabs.Stickers:\n return (\n \n );\n case SymbolMenuTabs.GIFs:\n return (\n \n );\n }\n\n return undefined;\n }\n\n function stopPropagation(event: any) {\n event.stopPropagation();\n }\n\n const content = (\n <>\n
\n {isActivated && (\n \n {renderContent}\n \n )}\n
\n {IS_SINGLE_COLUMN_LAYOUT && (\n \n \n \n )}\n \n \n );\n\n if (IS_SINGLE_COLUMN_LAYOUT) {\n if (!shouldRender) {\n return undefined;\n }\n\n const className = buildClassName(\n 'SymbolMenu mobile-menu',\n transitionClassNames,\n !isLeftColumnShown && 'middle-column-open',\n );\n\n return (\n \n
\n {content}\n
\n
\n );\n }\n\n return (\n \n {content}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n isLeftColumnShown: global.isLeftColumnShown,\n };\n },\n)(SymbolMenu));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\n\nimport { CONTENT_TYPES_FOR_QUICK_UPLOAD } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport { openSystemFilesDialog } from '../../../util/systemFilesDialog';\nimport { IAllowedAttachmentOptions } from '../../../modules/helpers';\nimport useMouseInside from '../../../hooks/useMouseInside';\nimport useLang from '../../../hooks/useLang';\n\nimport Menu from '../../ui/Menu';\nimport MenuItem from '../../ui/MenuItem';\n\nimport './AttachMenu.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n allowedAttachmentOptions: IAllowedAttachmentOptions;\n onFileSelect: (files: File[], isQuick: boolean) => void;\n onPollCreate: () => void;\n onClose: () => void;\n};\n\nconst AttachMenu: FC = ({\n isOpen, allowedAttachmentOptions, onFileSelect, onPollCreate, onClose,\n}) => {\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose);\n\n const handleFileSelect = useCallback((e: Event, isQuick: boolean) => {\n const { files } = e.target as HTMLInputElement;\n\n if (files && files.length > 0) {\n onFileSelect(Array.from(files), isQuick);\n }\n }, [onFileSelect]);\n\n const handleQuickSelect = useCallback(() => {\n openSystemFilesDialog(\n Array.from(CONTENT_TYPES_FOR_QUICK_UPLOAD).join(','),\n (e) => handleFileSelect(e, true),\n );\n }, [handleFileSelect]);\n\n const handleDocumentSelect = useCallback(() => {\n openSystemFilesDialog('*', (e) => handleFileSelect(e, false));\n }, [handleFileSelect]);\n\n const lang = useLang();\n\n const { canAttachMedia, canAttachPolls } = allowedAttachmentOptions;\n\n return (\n \n {/*\n ** Using ternary operator here causes some attributes from first clause\n ** transferring to the fragment content in the second clause\n */}\n {!canAttachMedia && (\n Posting media content is not allowed in this group.\n )}\n {canAttachMedia && (\n <>\n \n {lang('AttachmentMenu.PhotoOrVideo')}\n \n {lang('AttachDocument')}\n \n )}\n {canAttachPolls && (\n {lang('Poll')}\n )}\n \n );\n};\n\nexport default memo(AttachMenu);\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { ApiBotCommand, ApiUser } from '../../../api/types';\n\nimport renderText from '../../common/helpers/renderText';\nimport buildClassName from '../../../util/buildClassName';\n\nimport ListItem from '../../ui/ListItem';\nimport Avatar from '../../common/Avatar';\n\nimport './BotCommand.scss';\n\ntype OwnProps = {\n botCommand: ApiBotCommand;\n bot?: ApiUser;\n withAvatar?: boolean;\n focus?: boolean;\n onClick: (botCommand: ApiBotCommand) => void;\n};\n\nconst BotCommand: FC = ({\n withAvatar,\n focus,\n botCommand,\n bot,\n onClick,\n}) => {\n return (\n onClick(botCommand)}\n focus={focus}\n >\n {withAvatar && (\n \n )}\n
\n /{botCommand.command}\n {renderText(botCommand.description)}\n
\n \n );\n};\n\nexport default memo(BotCommand);\n","import React, {\n FC, useCallback, useEffect, useRef, memo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiBotCommand, ApiUser } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { pick } from '../../../util/iteratees';\nimport buildClassName from '../../../util/buildClassName';\nimport setTooltipItemVisible from '../../../util/setTooltipItemVisible';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevious from '../../../hooks/usePrevious';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\n\nimport BotCommand from './BotCommand';\n\nimport './BotCommandTooltip.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n withUsername?: boolean;\n botCommands?: ApiBotCommand[];\n onClick: NoneToVoidFunction;\n onClose: NoneToVoidFunction;\n};\n\ntype StateProps = {\n usersById: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst BotCommandTooltip: FC = ({\n usersById,\n isOpen,\n withUsername,\n botCommands,\n onClick,\n onClose,\n sendBotCommand,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n\n const handleSendCommand = useCallback(({ botId, command }: ApiBotCommand) => {\n const bot = usersById[botId];\n sendBotCommand({\n command: `/${command}${withUsername && bot ? `@${bot.username}` : ''}`,\n botId,\n });\n onClick();\n }, [onClick, sendBotCommand, usersById, withUsername]);\n\n const selectedCommandIndex = useKeyboardNavigation({\n isActive: isOpen,\n items: botCommands,\n onSelect: handleSendCommand,\n onClose,\n });\n\n useEffect(() => {\n if (botCommands && !botCommands.length) {\n onClose();\n }\n }, [botCommands, onClose]);\n\n useEffect(() => {\n setTooltipItemVisible('.chat-item-clickable', selectedCommandIndex, containerRef);\n }, [selectedCommandIndex]);\n\n const prevCommands = usePrevious(botCommands && botCommands.length ? botCommands : undefined, shouldRender);\n const renderedCommands = botCommands && !botCommands.length ? prevCommands : botCommands;\n\n if (!shouldRender || (renderedCommands && !renderedCommands.length)) {\n return undefined;\n }\n\n const className = buildClassName(\n 'BotCommandTooltip composer-tooltip custom-scroll',\n transitionClassNames,\n );\n\n return (\n
\n {renderedCommands && renderedCommands.map((chatBotCommand, index) => (\n \n ))}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => ({\n usersById: global.users.byId,\n }),\n (setGlobal, actions): DispatchProps => pick(actions, ['sendBotCommand']),\n)(BotCommandTooltip));\n","import React, { FC, memo, useCallback } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiBotCommand } from '../../../api/types';\n\nimport { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment';\nimport { pick } from '../../../util/iteratees';\nimport useMouseInside from '../../../hooks/useMouseInside';\n\nimport Menu from '../../ui/Menu';\nimport BotCommand from './BotCommand';\n\nimport './BotCommandMenu.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n botCommands: ApiBotCommand[];\n onClose: NoneToVoidFunction;\n};\n\ntype DispatchProps = Pick;\n\nconst BotCommandMenu: FC = ({\n isOpen, botCommands, onClose, sendBotCommand,\n}) => {\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose, undefined, IS_SINGLE_COLUMN_LAYOUT);\n\n const handleClick = useCallback((botCommand: ApiBotCommand) => {\n sendBotCommand({\n command: `/${botCommand.command}`,\n botId: botCommand.botId,\n });\n onClose();\n }, [onClose, sendBotCommand]);\n\n return (\n \n {botCommands.map((botCommand) => (\n \n ))}\n \n );\n};\n\nexport default memo(withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['sendBotCommand']),\n)(BotCommandMenu));\n","import React, {\n FC, memo, useEffect, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiSticker } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { STICKER_SIZE_PICKER } from '../../../config';\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport captureEscKeyListener from '../../../util/captureEscKeyListener';\nimport { pick } from '../../../util/iteratees';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevious from '../../../hooks/usePrevious';\n\nimport Loading from '../../ui/Loading';\nimport StickerButton from '../../common/StickerButton';\n\nimport './StickerTooltip.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onStickerSelect: (sticker: ApiSticker) => void;\n};\n\ntype StateProps = {\n stickers?: ApiSticker[];\n};\n\ntype DispatchProps = Pick;\n\nconst INTERSECTION_THROTTLE = 200;\n\nconst StickerTooltip: FC = ({\n isOpen,\n onStickerSelect,\n stickers,\n clearStickersForEmoji,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n const prevStickers = usePrevious(stickers, true);\n const displayedStickers = stickers || prevStickers;\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, throttleMs: INTERSECTION_THROTTLE });\n\n useEffect(() => (isOpen ? captureEscKeyListener(clearStickersForEmoji) : undefined), [isOpen, clearStickersForEmoji]);\n\n const handleMouseEnter = () => {\n document.body.classList.add('no-select');\n };\n\n const handleMouseLeave = () => {\n document.body.classList.remove('no-select');\n };\n\n const className = buildClassName(\n 'StickerTooltip composer-tooltip custom-scroll',\n transitionClassNames,\n !(displayedStickers?.length) && 'hidden',\n );\n\n return (\n \n {shouldRender && displayedStickers ? (\n displayedStickers.map((sticker) => (\n \n ))\n ) : shouldRender ? (\n \n ) : undefined}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { stickers } = global.stickers.forEmoji;\n\n return { stickers };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['clearStickersForEmoji']),\n)(StickerTooltip));\n","import React, { FC, memo } from '../../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport useMouseInside from '../../../hooks/useMouseInside';\nimport useLang from '../../../hooks/useLang';\n\nimport Menu from '../../ui/Menu';\nimport MenuItem from '../../ui/MenuItem';\n\nimport './CustomSendMenu.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onSilentSend?: NoneToVoidFunction;\n onScheduleSend?: NoneToVoidFunction;\n onClose: NoneToVoidFunction;\n onCloseAnimationEnd?: NoneToVoidFunction;\n};\n\nconst CustomSendMenu: FC = ({\n isOpen, onSilentSend, onScheduleSend, onClose, onCloseAnimationEnd,\n}) => {\n const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose);\n\n const lang = useLang();\n\n return (\n \n {onSilentSend && {lang('SendWithoutSound')}}\n {onScheduleSend && {lang('ScheduleMessage')}}\n \n );\n};\n\nexport default memo(CustomSendMenu);\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport findInViewport from '../../../util/findInViewport';\nimport isFullyVisible from '../../../util/isFullyVisible';\nimport fastSmoothScrollHorizontal from '../../../util/fastSmoothScrollHorizontal';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport usePrevDuringAnimation from '../../../hooks/usePrevDuringAnimation';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\n\nimport Loading from '../../ui/Loading';\nimport EmojiButton from './EmojiButton';\n\nimport './EmojiTooltip.scss';\n\nconst VIEWPORT_MARGIN = 8;\nconst EMOJI_BUTTON_WIDTH = 44;\nconst CLOSE_DURATION = 350;\n\nfunction setItemVisible(index: number, containerRef: Record) {\n const container = containerRef.current!;\n if (!container) {\n return;\n }\n\n const { visibleIndexes, allElements } = findInViewport(\n container,\n '.EmojiButton',\n VIEWPORT_MARGIN,\n true,\n true,\n true,\n );\n\n if (!allElements.length || !allElements[index]) {\n return;\n }\n const first = visibleIndexes[0];\n if (!visibleIndexes.includes(index)\n || (index === first && !isFullyVisible(container, allElements[first], true))) {\n const position = index > visibleIndexes[visibleIndexes.length - 1] ? 'start' : 'end';\n const newLeft = position === 'start' ? index * EMOJI_BUTTON_WIDTH : 0;\n\n fastSmoothScrollHorizontal(container, newLeft);\n }\n}\n\nexport type OwnProps = {\n isOpen: boolean;\n onEmojiSelect: (text: string) => void;\n onClose: NoneToVoidFunction;\n addRecentEmoji: AnyToVoidFunction;\n emojis: Emoji[];\n};\n\nconst EmojiTooltip: FC = ({\n isOpen,\n emojis,\n onClose,\n onEmojiSelect,\n addRecentEmoji,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n const listEmojis: Emoji[] = usePrevDuringAnimation(emojis.length ? emojis : undefined, CLOSE_DURATION) || [];\n\n const handleSelectEmoji = useCallback((emoji: Emoji) => {\n onEmojiSelect(emoji.native);\n addRecentEmoji({ emoji: emoji.id });\n }, [addRecentEmoji, onEmojiSelect]);\n\n const handleClick = useCallback((native: string, id: string) => {\n onEmojiSelect(native);\n addRecentEmoji({ emoji: id });\n }, [addRecentEmoji, onEmojiSelect]);\n\n const selectedIndex = useKeyboardNavigation({\n isActive: isOpen,\n isHorizontal: true,\n items: emojis,\n onSelect: handleSelectEmoji,\n onClose,\n });\n\n useEffect(() => {\n setItemVisible(selectedIndex, containerRef);\n }, [selectedIndex]);\n\n const handleMouseEnter = () => {\n document.body.classList.add('no-select');\n };\n\n const handleMouseLeave = () => {\n document.body.classList.remove('no-select');\n };\n\n const className = buildClassName(\n 'EmojiTooltip composer-tooltip custom-scroll-x',\n transitionClassNames,\n );\n\n return (\n \n {shouldRender && listEmojis ? (\n listEmojis.map((emoji, index) => (\n \n ))\n ) : shouldRender ? (\n \n ) : undefined}\n \n );\n};\n\nexport default memo(EmojiTooltip);\n","import React, { FC, memo } from '../../../../lib/teact/teact';\n\nimport { ApiWebDocument } from '../../../../api/types';\n\nimport { getFirstLetters } from '../../../../util/textFormat';\nimport renderText from '../../../common/helpers/renderText';\nimport useMedia from '../../../../hooks/useMedia';\n\nimport ListItem from '../../../ui/ListItem';\n\nimport './BaseResult.scss';\nimport { preventMessageInputBlurWithBubbling } from '../../helpers/preventMessageInputBlur';\n\nexport type OwnProps = {\n focus?: boolean;\n thumbnail?: ApiWebDocument;\n thumbUrl?: string;\n title?: string;\n description?: string;\n transitionClassNames?: string;\n onClick: NoneToVoidFunction;\n};\n\nconst BaseResult: FC = ({\n title,\n description,\n thumbnail,\n thumbUrl,\n focus,\n transitionClassNames = '',\n onClick,\n}) => {\n let content: string | undefined = '';\n\n const thumbnailDataUrl = useMedia(thumbnail ? `webDocument:${thumbnail.url}` : undefined);\n thumbUrl = thumbUrl || thumbnailDataUrl;\n\n if (thumbUrl) {\n content = (\n \"\"\n );\n } else if (title) {\n content = getFirstLetters(title, 1);\n }\n\n return (\n \n \n {typeof content === 'string' ? renderText(content) : content}\n \n
\n {title && (
{title}
)}\n {description && (
{description}
)}\n
\n \n );\n};\n\nexport default memo(BaseResult);\n","import React, { FC, memo, useCallback } from '../../../../lib/teact/teact';\n\nimport {\n ApiBotInlineMediaResult, ApiBotInlineResult, ApiPhoto, ApiThumbnail, ApiWebDocument,\n} from '../../../../api/types';\n\nimport useMedia from '../../../../hooks/useMedia';\nimport useTransitionForMedia from '../../../../hooks/useTransitionForMedia';\n\nimport BaseResult from './BaseResult';\n\nimport './MediaResult.scss';\n\nexport type OwnProps = {\n focus?: boolean;\n isForGallery?: boolean;\n inlineResult: ApiBotInlineMediaResult | ApiBotInlineResult;\n onClick: (result: ApiBotInlineResult) => void;\n};\n\nconst MediaResult: FC = ({\n focus, isForGallery, inlineResult, onClick,\n}) => {\n let photo: ApiPhoto | undefined;\n let thumbnail: ApiThumbnail | undefined;\n let webThumbnail: ApiWebDocument | undefined;\n\n if ('photo' in inlineResult) {\n photo = inlineResult.photo;\n }\n // For results with type=video (for example @stikstokbot)\n if ('thumbnail' in inlineResult) {\n thumbnail = inlineResult.thumbnail;\n }\n if ('webThumbnail' in inlineResult && isForGallery) {\n webThumbnail = inlineResult.webThumbnail;\n }\n\n const thumbnailDataUrl = useMedia(webThumbnail ? `webDocument:${webThumbnail.url}` : undefined);\n const mediaBlobUrl = useMedia(photo && `photo${photo.id}?size=m`);\n const {\n shouldRenderThumb, shouldRenderFullMedia, transitionClassNames,\n } = useTransitionForMedia(mediaBlobUrl, 'slow');\n\n const handleClick = useCallback(() => {\n onClick(inlineResult);\n }, [inlineResult, onClick]);\n\n if (isForGallery) {\n return (\n
\n {shouldRenderThumb && (\n \"\"\n )}\n {shouldRenderFullMedia && (\n \"\"\n )}\n
\n );\n }\n\n const { title, description } = inlineResult;\n\n return (\n \n );\n};\n\nexport default memo(MediaResult);\n","import React, { FC, memo, useCallback } from '../../../../lib/teact/teact';\n\nimport { ApiBotInlineResult } from '../../../../api/types';\n\nimport BaseResult from './BaseResult';\n\nexport type OwnProps = {\n focus?: boolean;\n inlineResult: ApiBotInlineResult;\n onClick: (result: ApiBotInlineResult) => void;\n};\n\nconst ArticleResult: FC = ({ focus, inlineResult, onClick }) => {\n const {\n title, url, description, webThumbnail,\n } = inlineResult;\n\n const handleClick = useCallback(() => {\n onClick(inlineResult);\n }, [inlineResult, onClick]);\n\n return (\n \n );\n};\n\nexport default memo(ArticleResult);\n","import React, {\n FC, memo, useCallback,\n} from '../../../../lib/teact/teact';\n\nimport { ApiBotInlineMediaResult, ApiBotInlineResult } from '../../../../api/types';\n\nimport { ObserveFn } from '../../../../hooks/useIntersectionObserver';\n\nimport GifButton from '../../../common/GifButton';\n\ntype OwnProps = {\n inlineResult: ApiBotInlineMediaResult;\n observeIntersection: ObserveFn;\n onClick: (result: ApiBotInlineResult) => void;\n};\n\nconst GifResult: FC = ({\n inlineResult, observeIntersection, onClick,\n}) => {\n const { gif } = inlineResult;\n\n const handleClick = useCallback(() => {\n onClick(inlineResult);\n }, [inlineResult, onClick]);\n\n if (!gif) {\n return undefined;\n }\n\n return (\n \n );\n};\n\nexport default memo(GifResult);\n","import React, { FC, memo } from '../../../../lib/teact/teact';\n\nimport { ApiBotInlineMediaResult, ApiBotInlineResult } from '../../../../api/types';\n\nimport { STICKER_SIZE_INLINE_BOT_RESULT } from '../../../../config';\nimport { ObserveFn } from '../../../../hooks/useIntersectionObserver';\n\nimport StickerButton from '../../../common/StickerButton';\n\ntype OwnProps = {\n inlineResult: ApiBotInlineMediaResult;\n observeIntersection: ObserveFn;\n onClick: (result: ApiBotInlineResult) => void;\n};\n\nconst StickerResult: FC = ({ inlineResult, observeIntersection, onClick }) => {\n const { sticker } = inlineResult;\n\n if (!sticker) {\n return undefined;\n }\n\n return (\n \n );\n};\n\nexport default memo(StickerResult);\n","import React, {\n FC, memo, useCallback, useEffect, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiBotInlineMediaResult, ApiBotInlineResult, ApiBotInlineSwitchPm } from '../../../api/types';\nimport { IAllowedAttachmentOptions } from '../../../modules/helpers';\nimport { LoadMoreDirection } from '../../../types';\n\nimport { IS_TOUCH_ENV } from '../../../util/environment';\nimport setTooltipItemVisible from '../../../util/setTooltipItemVisible';\nimport buildClassName from '../../../util/buildClassName';\nimport useShowTransition from '../../../hooks/useShowTransition';\nimport { throttle } from '../../../util/schedulers';\nimport { pick } from '../../../util/iteratees';\nimport { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';\nimport usePrevious from '../../../hooks/usePrevious';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\n\nimport MediaResult from './inlineResults/MediaResult';\nimport ArticleResult from './inlineResults/ArticleResult';\nimport GifResult from './inlineResults/GifResult';\nimport StickerResult from './inlineResults/StickerResult';\nimport ListItem from '../../ui/ListItem';\nimport InfiniteScroll from '../../ui/InfiniteScroll';\n\nimport './InlineBotTooltip.scss';\n\nconst INTERSECTION_DEBOUNCE_MS = 200;\nconst runThrottled = throttle((cb) => cb(), 500, true);\n\nexport type OwnProps = {\n isOpen: boolean;\n botId?: number;\n isGallery?: boolean;\n allowedAttachmentOptions: IAllowedAttachmentOptions;\n inlineBotResults?: (ApiBotInlineResult | ApiBotInlineMediaResult)[];\n switchPm?: ApiBotInlineSwitchPm;\n onSelectResult: (inlineResult: ApiBotInlineMediaResult | ApiBotInlineResult) => void;\n loadMore: NoneToVoidFunction;\n onClose: NoneToVoidFunction;\n};\n\ntype DispatchProps = Pick;\n\nconst InlineBotTooltip: FC = ({\n isOpen,\n botId,\n isGallery,\n inlineBotResults,\n switchPm,\n loadMore,\n onClose,\n openChat,\n startBot,\n onSelectResult,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const { shouldRender, transitionClassNames } = useShowTransition(isOpen, undefined, undefined, false);\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({\n rootRef: containerRef,\n debounceMs: INTERSECTION_DEBOUNCE_MS,\n isDisabled: !isOpen,\n });\n\n const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {\n if (direction === LoadMoreDirection.Backwards) {\n runThrottled(loadMore);\n }\n }, [loadMore]);\n\n const selectedIndex = useKeyboardNavigation({\n isActive: isOpen,\n shouldRemoveSelectionOnReset: isGallery,\n noArrowNavigation: isGallery,\n items: inlineBotResults,\n onSelect: onSelectResult,\n onClose,\n });\n\n useEffect(() => {\n setTooltipItemVisible('.chat-item-clickable', selectedIndex, containerRef);\n }, [selectedIndex]);\n\n const handleSendPm = useCallback(() => {\n openChat({ id: botId });\n startBot({ botId, param: switchPm!.startParam });\n }, [botId, openChat, startBot, switchPm]);\n\n const prevInlineBotResults = usePrevious(\n inlineBotResults?.length\n ? inlineBotResults\n : undefined,\n shouldRender,\n );\n const renderedInlineBotResults = inlineBotResults && !inlineBotResults.length\n ? prevInlineBotResults\n : inlineBotResults;\n\n if (!shouldRender || !renderedInlineBotResults || (!renderedInlineBotResults.length && !switchPm)) {\n return undefined;\n }\n\n const className = buildClassName(\n 'InlineBotTooltip composer-tooltip',\n IS_TOUCH_ENV ? 'no-scrollbar' : 'custom-scroll',\n isGallery && 'gallery',\n transitionClassNames,\n );\n\n function renderSwitchPm() {\n return (\n \n {switchPm!.text}\n \n );\n }\n\n function renderContent() {\n return renderedInlineBotResults!.map((inlineBotResult, index) => {\n switch (inlineBotResult.type) {\n case 'gif':\n return (\n \n );\n\n case 'photo':\n return (\n \n );\n\n case 'sticker':\n return (\n \n );\n\n case 'video':\n case 'game':\n return (\n \n );\n case 'article':\n case 'audio':\n return (\n \n );\n\n default:\n return undefined;\n }\n });\n }\n\n return (\n \n {switchPm && renderSwitchPm()}\n {renderContent()}\n \n );\n};\n\nexport default memo(withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'startBot', 'openChat', 'sendInlineBotResult',\n ]),\n)(InlineBotTooltip));\n","import React, {\n FC, useMemo, memo, useRef,\n} from '../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage, ApiUser, ApiChat } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\n\nimport {\n selectUser,\n selectChatMessages,\n selectChat,\n selectCurrentTextSearch,\n} from '../../modules/selectors';\nimport {\n getMessageSummaryText,\n getChatTitle,\n getUserFullName,\n isChatChannel,\n} from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport { orderBy, pick } from '../../util/iteratees';\nimport { MEMO_EMPTY_ARRAY } from '../../util/memo';\nimport useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport ListItem from '../ui/ListItem';\nimport LastMessageMeta from '../common/LastMessageMeta';\nimport Avatar from '../common/Avatar';\n\nimport './RightSearch.scss';\n\nexport type OwnProps = {\n chatId: number;\n threadId: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n messagesById?: Record;\n query?: string;\n totalCount?: number;\n foundIds?: number[];\n};\n\ntype DispatchProps = Pick;\n\ninterface Result {\n message: ApiMessage;\n senderUser?: ApiUser;\n senderChat?: ApiChat;\n onClick: NoneToVoidFunction;\n}\n\nconst RightSearch: FC = ({\n chatId,\n threadId,\n onClose,\n isActive,\n chat,\n messagesById,\n query,\n totalCount,\n foundIds,\n searchTextMessagesLocal,\n focusMessage,\n}) => {\n const lang = useLang();\n\n const foundResults = useMemo(() => {\n if (!query || !foundIds || !foundIds.length || !messagesById) {\n return MEMO_EMPTY_ARRAY;\n }\n\n const results = foundIds.map((id) => {\n const message = messagesById[id];\n if (!message) {\n return undefined;\n }\n\n const senderUser = message.senderId ? selectUser(getGlobal(), message.senderId) : undefined;\n\n let senderChat;\n if (chat && isChatChannel(chat)) {\n senderChat = chat;\n } else if (message.forwardInfo) {\n const { isChannelPost, fromChatId } = message.forwardInfo;\n senderChat = isChannelPost && fromChatId ? selectChat(getGlobal(), fromChatId) : undefined;\n } else {\n senderChat = message.senderId ? selectChat(getGlobal(), message.senderId) : undefined;\n }\n\n return {\n message,\n senderUser,\n senderChat,\n onClick: () => focusMessage({ chatId, threadId, messageId: id }),\n };\n }).filter(Boolean) as Result[];\n\n return orderBy(results, ({ message }) => message.date, 'desc');\n }, [chatId, threadId, focusMessage, foundIds, chat, messagesById, query]);\n\n const renderSearchResult = ({\n message, senderUser, senderChat, onClick,\n }: Result) => {\n const title = senderChat ? getChatTitle(lang, senderChat) : getUserFullName(senderUser);\n const text = getMessageSummaryText(lang, message);\n\n return (\n \n \n
\n
\n

{title && renderText(title)}

\n \n
\n
\n {renderText(text, ['emoji', 'highlight'], { highlight: query })}\n
\n
\n \n );\n };\n\n useHistoryBack(isActive, onClose);\n\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n const handleKeyDown = useKeyboardListNavigation(containerRef, true, (index) => {\n const foundResult = foundResults?.[index === -1 ? 0 : index];\n if (foundResult) {\n foundResult.onClick();\n }\n }, '.ListItem-button', true);\n\n return (\n \n

\n {!query ? (\n lang('lng_dlg_search_for_messages')\n ) : (totalCount === 0 || !foundResults.length) ? (\n lang('lng_search_no_results')\n ) : totalCount === 1 ? (\n '1 message found'\n ) : (\n `${(foundResults.length && (totalCount || foundResults.length))} messages found`\n )}\n

\n {foundResults.map(renderSearchResult)}\n \n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const messagesById = chat && selectChatMessages(global, chat.id);\n if (!chat || !messagesById) {\n return {};\n }\n\n const { query, results } = selectCurrentTextSearch(global) || {};\n const { totalCount, foundIds } = results || {};\n\n return {\n chat,\n messagesById,\n query,\n totalCount,\n foundIds,\n };\n },\n (global, actions): DispatchProps => pick(actions, ['searchTextMessagesLocal', 'focusMessage']),\n)(RightSearch));\n","import React, {\n FC, useEffect, memo, useMemo, useCallback,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiStickerSet } from '../../api/types';\nimport { GlobalActions } from '../../global/types';\nimport { ObserveFn } from '../../hooks/useIntersectionObserver';\n\nimport { STICKER_SIZE_SEARCH } from '../../config';\nimport { pick } from '../../util/iteratees';\nimport { selectShouldLoopStickers, selectStickerSet } from '../../modules/selectors';\nimport useFlag from '../../hooks/useFlag';\nimport useOnChange from '../../hooks/useOnChange';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport StickerButton from '../common/StickerButton';\nimport StickerSetModal from '../common/StickerSetModal.async';\nimport Spinner from '../ui/Spinner';\n\ntype OwnProps = {\n stickerSetId: string;\n observeIntersection: ObserveFn;\n isSomeModalOpen: boolean;\n onModalToggle: (isOpen: boolean) => void;\n};\n\ntype StateProps = {\n set?: ApiStickerSet;\n shouldPlay?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst STICKERS_TO_DISPLAY = 5;\n\nconst StickerSetResult: FC = ({\n stickerSetId, observeIntersection, set, shouldPlay,\n loadStickers, toggleStickerSet, isSomeModalOpen, onModalToggle,\n}) => {\n const lang = useLang();\n const isAdded = set && Boolean(set.installedDate);\n const areStickersLoaded = Boolean(set?.stickers);\n\n const [isModalOpen, openModal, closeModal] = useFlag();\n\n useOnChange(() => {\n onModalToggle(isModalOpen);\n }, [isModalOpen, onModalToggle]);\n\n const displayedStickers = useMemo(() => {\n if (!set) {\n return [];\n }\n\n const coverStickerIds = (set.covers || []).map(({ id }) => id);\n const otherStickers = set.stickers ? set.stickers.filter(({ id }) => !coverStickerIds.includes(id)) : [];\n\n return [...(set.covers || []), ...otherStickers].slice(0, STICKERS_TO_DISPLAY);\n }, [set]);\n\n useEffect(() => {\n // Featured stickers are initialized with one sticker in collection (cover of SickerSet)\n if (!areStickersLoaded && displayedStickers.length < STICKERS_TO_DISPLAY) {\n loadStickers({ stickerSetId });\n }\n }, [areStickersLoaded, displayedStickers.length, loadStickers, stickerSetId]);\n\n const handleAddClick = useCallback(() => {\n toggleStickerSet({ stickerSetId });\n }, [toggleStickerSet, stickerSetId]);\n\n if (!set) {\n return undefined;\n }\n\n const canRenderStickers = displayedStickers.length > 0;\n\n return (\n
\n
\n
\n

{set.title}

\n

{lang('Stickers', set.count, 'i')}

\n
\n \n {lang(isAdded ? 'Stickers.Installed' : 'Stickers.Install')}\n \n
\n
\n {!canRenderStickers && }\n {canRenderStickers && displayedStickers.map((sticker) => (\n \n ))}\n
\n {canRenderStickers && (\n \n )}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { stickerSetId }): StateProps => {\n return {\n set: selectStickerSet(global, stickerSetId),\n shouldPlay: selectShouldLoopStickers(global),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadStickers', 'toggleStickerSet']),\n)(StickerSetResult));\n","import React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\nimport { throttle } from '../../util/schedulers';\nimport { selectCurrentStickerSearch } from '../../modules/selectors';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Loading from '../ui/Loading';\nimport StickerSetResult from './StickerSetResult';\n\nimport './StickerSearch.scss';\n\ntype OwnProps = {\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n query?: string;\n featuredIds?: string[];\n resultIds?: string[];\n};\n\ntype DispatchProps = Pick;\n\nconst INTERSECTION_THROTTLE = 200;\n\nconst runThrottled = throttle((cb) => cb(), 60000, true);\n\nconst StickerSearch: FC = ({\n onClose,\n isActive,\n query,\n featuredIds,\n resultIds,\n loadFeaturedStickers,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const lang = useLang();\n\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, throttleMs: INTERSECTION_THROTTLE });\n\n // Due to the parent Transition, this component never gets unmounted,\n // that's why we use throttled API call on every update.\n useEffect(() => {\n runThrottled(() => {\n loadFeaturedStickers();\n });\n });\n\n useHistoryBack(isActive, onClose);\n\n function renderContent() {\n if (query === undefined) {\n return undefined;\n }\n\n if (!query && featuredIds) {\n return featuredIds.map((id) => (\n \n ));\n }\n\n if (resultIds) {\n if (!resultIds.length) {\n return

Nothing found.

;\n }\n\n return resultIds.map((id) => (\n \n ));\n }\n\n return ;\n }\n\n return (\n
\n {renderContent()}\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const currentSearch = selectCurrentStickerSearch(global);\n const { query, resultIds } = currentSearch || {};\n const { featured } = global.stickers;\n\n return {\n query,\n featuredIds: featured.setIds,\n resultIds,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['loadFeaturedStickers']),\n)(StickerSearch));\n","import React, {\n FC, memo, useRef, useCallback,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat, ApiVideo } from '../../api/types';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport {\n selectCurrentGifSearch,\n selectChat,\n selectIsChatWithBot,\n selectCurrentMessageList,\n} from '../../modules/selectors';\nimport { getAllowedAttachmentOptions } from '../../modules/helpers';\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport InfiniteScroll from '../ui/InfiniteScroll';\nimport GifButton from '../common/GifButton';\nimport Loading from '../ui/Loading';\n\nimport './GifSearch.scss';\n\ntype OwnProps = {\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n query?: string;\n results?: ApiVideo[];\n chat?: ApiChat;\n isChatWithBot?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst PRELOAD_BACKWARDS = 96; // GIF Search bot results are multiplied by 24\nconst INTERSECTION_DEBOUNCE = 300;\n\nconst GifSearch: FC = ({\n onClose,\n isActive,\n query,\n results,\n chat,\n isChatWithBot,\n searchMoreGifs,\n sendMessage,\n setGifSearchQuery,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef(null);\n\n const {\n observe: observeIntersection,\n } = useIntersectionObserver({ rootRef: containerRef, debounceMs: INTERSECTION_DEBOUNCE });\n\n const { canSendGifs } = getAllowedAttachmentOptions(chat, isChatWithBot);\n\n const handleGifClick = useCallback((gif: ApiVideo) => {\n if (canSendGifs) {\n sendMessage({ gif });\n }\n\n if (IS_TOUCH_ENV) {\n setGifSearchQuery({ query: undefined });\n }\n }, [canSendGifs, sendMessage, setGifSearchQuery]);\n\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n function renderContent() {\n if (query === undefined) {\n return undefined;\n }\n\n if (!results) {\n return (\n \n );\n }\n\n if (!results.length) {\n return (\n

{lang('NoGIFsFound')}

\n );\n }\n\n return results.map((gif) => (\n \n ));\n }\n\n const hasResults = Boolean(query !== undefined && results && results.length);\n\n return (\n
\n \n {renderContent()}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const currentSearch = selectCurrentGifSearch(global);\n const { query, results } = currentSearch || {};\n const { chatId } = selectCurrentMessageList(global) || {};\n const chat = chatId ? selectChat(global, chatId) : undefined;\n const isChatWithBot = chat ? selectIsChatWithBot(global, chat) : undefined;\n\n return {\n query,\n results,\n chat,\n isChatWithBot,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['searchMoreGifs', 'sendMessage', 'setGifSearchQuery']),\n)(GifSearch));\n","import React, {\n FC, useCallback, useState, memo, useEffect,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport {\n ApiChat,\n ApiMessage,\n ApiPollAnswer,\n ApiPollResult,\n} from '../../api/types';\nimport { GlobalActions } from '../../global/types';\nimport { pick } from '../../util/iteratees';\nimport usePrevious from '../../hooks/usePrevious';\nimport useLang from '../../hooks/useLang';\n\nimport ShowMoreButton from '../ui/ShowMoreButton';\nimport Loading from '../ui/Loading';\nimport ListItem from '../ui/ListItem';\nimport PrivateChatInfo from '../common/PrivateChatInfo';\n\nimport './PollAnswerResults.scss';\n\ntype OwnProps = {\n chat: ApiChat;\n message: ApiMessage;\n answer: ApiPollAnswer;\n answerVote: ApiPollResult;\n totalVoters: number;\n};\n\ntype StateProps = {\n voters?: number[];\n offset: string;\n};\n\ntype DispatchProps = Pick;\n\nconst INITIAL_LIMIT = 4;\nconst VIEW_MORE_LIMIT = 50;\n\nconst PollAnswerResults: FC = ({\n chat,\n message,\n answer,\n answerVote,\n totalVoters,\n voters,\n offset,\n loadPollOptionResults,\n openChat,\n closePollResults,\n}) => {\n const prevVotersCount = usePrevious(answerVote.votersCount);\n const [isLoading, setIsLoading] = useState(true);\n const areVotersLoaded = Boolean(voters);\n const { option, text } = answer;\n const lang = useLang();\n\n useEffect(() => {\n // For update when new votes arrive or when the user takes back his vote\n if (!areVotersLoaded || prevVotersCount !== answerVote.votersCount) {\n loadPollOptionResults({\n chat, messageId: message.id, option, offset, limit: INITIAL_LIMIT, shouldResetVoters: true,\n });\n }\n // eslint-disable-next-line\n }, [answerVote.votersCount, areVotersLoaded]);\n\n const handleViewMoreClick = useCallback(() => {\n setIsLoading(true);\n loadPollOptionResults({\n chat, messageId: message.id, option, offset, limit: VIEW_MORE_LIMIT,\n });\n }, [chat, loadPollOptionResults, message.id, offset, option]);\n\n useEffect(() => {\n setIsLoading(false);\n }, [voters]);\n\n const handleMemberClick = useCallback((id: number) => {\n openChat({ id });\n closePollResults();\n }, [closePollResults, openChat]);\n\n function renderViewMoreButton() {\n const leftVotersCount = answerVote.votersCount - voters!.length;\n\n return answerVote.votersCount > INITIAL_LIMIT && leftVotersCount > 0 && (\n \n );\n }\n\n return (\n
\n
\n {voters\n ? voters.map((id) => (\n handleMemberClick(id)}\n >\n \n \n ))\n : }\n {voters && renderViewMoreButton()}\n
\n
\n {text}\n \n {getPercentage(answerVote.votersCount, totalVoters)}%\n \n
\n
\n );\n};\n\nfunction getPercentage(value: number, total: number) {\n return total > 0 ? ((value / total) * 100).toFixed() : 0;\n}\n\nexport default memo(withGlobal(\n (global, { answer }: OwnProps): StateProps => {\n const { voters, offsets } = global.pollResults;\n\n return {\n voters: voters?.[answer.option],\n offset: (offsets?.[answer.option]) || '',\n };\n },\n (global, actions): DispatchProps => pick(actions, ['loadPollOptionResults', 'openChat', 'closePollResults']),\n)(PollAnswerResults));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMessage, ApiChat } from '../../api/types';\nimport { selectChat, selectChatMessage } from '../../modules/selectors';\nimport { buildCollectionByKey } from '../../util/iteratees';\nimport { getMessagePoll } from '../../modules/helpers';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport PollAnswerResults from './PollAnswerResults';\nimport Loading from '../ui/Loading';\n\nimport './PollResults.scss';\n\ntype OwnProps = {\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n message?: ApiMessage;\n lastSyncTime?: number;\n};\n\nconst PollResults: FC = ({\n onClose,\n isActive,\n chat,\n message,\n lastSyncTime,\n}) => {\n const lang = useLang();\n useHistoryBack(isActive, onClose);\n\n if (!message || !chat) {\n return ;\n }\n\n const { summary, results } = getMessagePoll(message)!;\n if (!results.results) {\n return undefined;\n }\n\n const resultsByOption = buildCollectionByKey(results.results, 'option');\n\n return (\n
\n

{summary.question}

\n
\n {lastSyncTime && summary.answers.map((answer) => (\n \n ))}\n {!lastSyncTime && }\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n pollResults: { chatId, messageId },\n lastSyncTime,\n } = global;\n\n if (!chatId || !messageId) {\n return {};\n }\n\n const chat = selectChat(global, chatId);\n const message = selectChatMessage(global, chatId, messageId);\n\n return {\n chat,\n message,\n lastSyncTime,\n };\n },\n)(PollResults));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\nimport { ManagementProgress } from '../../../types';\n\nimport { pick } from '../../../util/iteratees';\nimport {\n selectChat, selectNotifyExceptions, selectNotifySettings, selectUser,\n} from '../../../modules/selectors';\nimport { selectIsChatMuted } from '../../../modules/helpers';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport InputText from '../../ui/InputText';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\nimport './Management.scss';\n\ntype OwnProps = {\n userId: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat: ApiChat;\n progress?: ManagementProgress;\n isMuted?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst ERROR_FIRST_NAME_MISSING = 'Please provide first name';\n\nconst ManageUser: FC = ({\n userId,\n user,\n chat,\n progress,\n isMuted,\n updateContact,\n deleteUser,\n deleteHistory,\n closeManagement,\n openChat,\n onClose,\n isActive,\n}) => {\n const [isDeleteDialogOpen, openDeleteDialog, closeDeleteDialog] = useFlag();\n const [isProfileFieldsTouched, setIsProfileFieldsTouched] = useState(false);\n const [error, setError] = useState();\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const currentFirstName = user ? (user.firstName || '') : '';\n const currentLastName = user ? (user.lastName || '') : '';\n\n const [firstName, setFirstName] = useState(currentFirstName);\n const [lastName, setLastName] = useState(currentLastName);\n const [isNotificationsEnabled, setIsNotificationsEnabled] = useState(!isMuted);\n\n useEffect(() => {\n setIsNotificationsEnabled(!isMuted);\n }, [isMuted]);\n\n useEffect(() => {\n setIsProfileFieldsTouched(false);\n closeDeleteDialog();\n }, [closeDeleteDialog, userId]);\n\n useEffect(() => {\n setFirstName(currentFirstName);\n setLastName(currentLastName);\n }, [currentFirstName, currentLastName, user]);\n\n useEffect(() => {\n if (progress === ManagementProgress.Complete) {\n setIsProfileFieldsTouched(false);\n setError(undefined);\n closeDeleteDialog();\n }\n }, [closeDeleteDialog, progress]);\n\n const handleFirstNameChange = useCallback((e: ChangeEvent) => {\n setFirstName(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleLastNameChange = useCallback((e: ChangeEvent) => {\n setLastName(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleNotificationChange = useCallback((e: ChangeEvent) => {\n setIsNotificationsEnabled(e.target.checked);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleProfileSave = useCallback(() => {\n const trimmedFirstName = firstName.trim();\n const trimmedLastName = lastName.trim();\n\n if (!trimmedFirstName.length) {\n setError(ERROR_FIRST_NAME_MISSING);\n }\n\n updateContact({\n userId,\n isMuted: !isNotificationsEnabled,\n firstName: trimmedFirstName,\n lastName: trimmedLastName,\n });\n }, [firstName, lastName, updateContact, userId, isNotificationsEnabled]);\n\n const handleDeleteContact = useCallback(() => {\n deleteHistory({\n chatId: chat.id,\n shouldDeleteForAll: false,\n });\n deleteUser({ userId });\n closeDeleteDialog();\n closeManagement();\n openChat({ id: undefined });\n }, [chat.id, closeDeleteDialog, closeManagement, deleteHistory, deleteUser, openChat, userId]);\n\n if (!user) {\n return undefined;\n }\n\n const isLoading = progress === ManagementProgress.InProgress;\n\n return (\n
\n
\n
\n \n \n \n
\n \n
\n
\n
\n \n {lang('DeleteContact')}\n \n
\n
\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { userId }): StateProps => {\n const user = selectUser(global, userId);\n const chat = selectChat(global, userId)!;\n const { progress } = global.management;\n const isMuted = selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global));\n\n return {\n user, chat, progress, isMuted,\n };\n },\n (global, actions): DispatchProps => pick(actions, [\n 'updateContact', 'deleteUser', 'closeManagement', 'openChat', 'deleteHistory',\n ]),\n)(ManageUser));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens, ManagementProgress } from '../../../types';\nimport { ApiChat, ApiChatBannedRights, ApiMediaFormat } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { getChatAvatarHash, getHasAdminRight, isChatBasicGroup } from '../../../modules/helpers';\nimport useMedia from '../../../hooks/useMedia';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport { selectChat } from '../../../modules/selectors';\nimport { formatInteger } from '../../../util/textFormat';\nimport { pick } from '../../../util/iteratees';\nimport renderText from '../../common/helpers/renderText';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport AvatarEditable from '../../ui/AvatarEditable';\nimport InputText from '../../ui/InputText';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport Spinner from '../../ui/Spinner';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\nimport './Management.scss';\n\ntype OwnProps = {\n chatId: number;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n progress?: ManagementProgress;\n isBasicGroup: boolean;\n hasLinkedChannel: boolean;\n canChangeInfo?: boolean;\n canBanUsers?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst GROUP_TITLE_EMPTY = 'Group title can\\'t be empty';\n\n// Some checkboxes control multiple rights, and some rights are not controlled from Permissions screen,\n// so we need to define the amount manually\nconst TOTAL_PERMISSIONS_COUNT = 8;\n\nconst ManageGroup: FC = ({\n chatId,\n chat,\n progress,\n isBasicGroup,\n hasLinkedChannel,\n canChangeInfo,\n canBanUsers,\n onScreenSelect,\n togglePreHistoryHidden,\n updateChat,\n deleteChat,\n leaveChannel,\n deleteChannel,\n closeManagement,\n openChat,\n onClose,\n isActive,\n}) => {\n const [isDeleteDialogOpen, openDeleteDialog, closeDeleteDialog] = useFlag();\n const currentTitle = chat.title;\n const currentAbout = chat.fullInfo ? (chat.fullInfo.about || '') : '';\n\n const [isProfileFieldsTouched, setIsProfileFieldsTouched] = useState(false);\n const [title, setTitle] = useState(currentTitle);\n const [about, setAbout] = useState(currentAbout);\n const [photo, setPhoto] = useState();\n const [error, setError] = useState();\n const imageHash = getChatAvatarHash(chat);\n const currentAvatarBlobUrl = useMedia(imageHash, false, ApiMediaFormat.BlobUrl);\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n useEffect(() => {\n if (progress === ManagementProgress.Complete) {\n setIsProfileFieldsTouched(false);\n setError(undefined);\n }\n }, [progress]);\n\n const handleClickEditType = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatPrivacyType);\n }, [onScreenSelect]);\n\n const handleClickDiscussion = useCallback(() => {\n onScreenSelect(ManagementScreens.Discussion);\n }, [onScreenSelect]);\n\n const handleClickPermissions = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupPermissions);\n }, [onScreenSelect]);\n\n const handleClickAdministrators = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatAdministrators);\n }, [onScreenSelect]);\n\n const handleSetPhoto = useCallback((file: File) => {\n setPhoto(file);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleTitleChange = useCallback((e: ChangeEvent) => {\n setTitle(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleAboutChange = useCallback((e: ChangeEvent) => {\n setAbout(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleUpdateGroup = useCallback(() => {\n const trimmedTitle = title.trim();\n const trimmedAbout = about.trim();\n\n if (!trimmedTitle.length) {\n setError(GROUP_TITLE_EMPTY);\n return;\n }\n\n updateChat({\n chatId,\n title: trimmedTitle,\n about: trimmedAbout,\n photo,\n });\n }, [about, chatId, photo, title, updateChat]);\n\n const handleClickMembers = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupMembers);\n }, [onScreenSelect]);\n\n const handleTogglePreHistory = useCallback(() => {\n if (!chat.fullInfo) {\n return;\n }\n\n const { isPreHistoryHidden } = chat.fullInfo;\n\n togglePreHistoryHidden({ chatId: chat.id, isEnabled: !isPreHistoryHidden });\n }, [chat, togglePreHistoryHidden]);\n\n const enabledPermissionsCount = useMemo(() => {\n if (!chat.defaultBannedRights) {\n return 0;\n }\n\n let totalCount = [\n 'sendMessages',\n 'sendMedia',\n 'embedLinks',\n 'sendPolls',\n 'changeInfo',\n 'inviteUsers',\n 'pinMessages',\n ].filter(\n (key) => !chat.defaultBannedRights![key as keyof ApiChatBannedRights],\n ).length;\n\n const { sendStickers, sendGifs } = chat.defaultBannedRights;\n\n // These two rights are controlled with a single checkbox\n if (!sendStickers && !sendGifs) {\n totalCount += 1;\n }\n\n return totalCount;\n }, [chat]);\n\n const adminsCount = (chat.fullInfo?.adminMembers?.length) || 0;\n\n const handleDeleteGroup = useCallback(() => {\n if (isBasicGroup) {\n deleteChat({ chatId: chat.id });\n } else if (!chat.isCreator) {\n leaveChannel({ chatId: chat.id });\n } else {\n deleteChannel({ chatId: chat.id });\n }\n closeDeleteDialog();\n closeManagement();\n openChat({ id: undefined });\n }, [\n isBasicGroup, chat.isCreator, chat.id,\n closeDeleteDialog, closeManagement, leaveChannel, deleteChannel, deleteChat, openChat,\n ]);\n\n if (chat.isRestricted) {\n return undefined;\n }\n\n const isLoading = progress === ManagementProgress.InProgress;\n\n return (\n
\n
\n
\n \n \n \n {chat.isCreator && (\n \n {lang('GroupType')}\n {chat.username ? lang('TypePublic') : lang('TypePrivate')}\n \n )}\n {hasLinkedChannel && (\n \n {lang('LinkedChannel')}\n {lang('DiscussionUnlink')}\n \n )}\n \n {lang('ChannelPermissions')}\n \n {enabledPermissionsCount}/{TOTAL_PERMISSIONS_COUNT}\n \n \n \n {lang('ChannelAdministrators')}\n {formatInteger(adminsCount)}\n \n
\n
\n \n {lang('GroupMembers')}\n {formatInteger(chat.membersCount ?? 0)}\n \n\n {chat.fullInfo && (\n
\n \n
\n )}\n
\n
\n \n {lang('DeleteMega')}\n \n
\n
\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { progress } = global.management;\n const hasLinkedChannel = Boolean(chat.fullInfo?.linkedChatId);\n const isBasicGroup = isChatBasicGroup(chat);\n\n return {\n chat,\n progress,\n isBasicGroup,\n hasLinkedChannel,\n canChangeInfo: isBasicGroup ? chat.isCreator : getHasAdminRight(chat, 'changeInfo'),\n canBanUsers: isBasicGroup ? chat.isCreator : getHasAdminRight(chat, 'banUsers'),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'togglePreHistoryHidden', 'updateChat', 'closeManagement',\n 'leaveChannel', 'deleteChannel', 'deleteChat', 'openChat',\n ]),\n)(ManageGroup));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens } from '../../../types';\nimport { ApiChat, ApiChatBannedRights, ApiChatMember } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport useLang from '../../../hooks/useLang';\nimport { selectChat } from '../../../modules/selectors';\nimport { pick } from '../../../util/iteratees';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\ntype OwnProps = {\n chatId: number;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: number, isPromotedByCurrentUser?: boolean) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n currentUserId?: number;\n};\n\ntype DispatchProps = Pick;\n\nconst FLOATING_BUTTON_ANIMATION_TIMEOUT_MS = 250;\n\nfunction getLangKeyForBannedRightKey(key: string) {\n switch (key) {\n case 'sendMessages':\n return 'UserRestrictionsNoSend';\n case 'sendMedia':\n return 'UserRestrictionsNoSendMedia';\n case 'sendStickers':\n return 'UserRestrictionsNoSendStickers';\n case 'embedLinks':\n return 'UserRestrictionsNoEmbedLinks';\n case 'sendPolls':\n return 'UserRestrictionsNoSendPolls';\n case 'changeInfo':\n return 'UserRestrictionsNoChangeInfo';\n case 'inviteUsers':\n return 'UserRestrictionsInviteUsers';\n case 'pinMessages':\n return 'UserRestrictionsPinMessages';\n default:\n return undefined;\n }\n}\n\nconst ManageGroupPermissions: FC = ({\n onScreenSelect,\n onChatMemberSelect,\n chat,\n currentUserId,\n updateChatDefaultBannedRights,\n onClose,\n isActive,\n}) => {\n const [permissions, setPermissions] = useState({});\n const [havePermissionChanged, setHavePermissionChanged] = useState(false);\n const [isLoading, setIsLoading] = useState(false);\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const handleRemovedUsersClick = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupRemovedUsers);\n }, [onScreenSelect]);\n\n const handleAddExceptionClick = useCallback(() => {\n onScreenSelect(ManagementScreens.GroupUserPermissionsCreate);\n }, [onScreenSelect]);\n\n const handleExceptionMemberClick = useCallback((member: ApiChatMember) => {\n onChatMemberSelect(member.userId, member.promotedByUserId === currentUserId);\n onScreenSelect(ManagementScreens.GroupUserPermissions);\n }, [currentUserId, onChatMemberSelect, onScreenSelect]);\n\n useEffect(() => {\n setPermissions((chat?.defaultBannedRights) || {});\n setHavePermissionChanged(false);\n setTimeout(() => {\n setIsLoading(false);\n }, FLOATING_BUTTON_ANIMATION_TIMEOUT_MS);\n }, [chat]);\n\n const handlePermissionChange = useCallback((e: React.ChangeEvent) => {\n const { name } = e.target;\n\n function getUpdatedPermissionValue(value: true | undefined) {\n return value ? undefined : true;\n }\n\n setPermissions((p) => ({\n ...p,\n [name]: getUpdatedPermissionValue(p[name as Exclude]),\n ...(name === 'sendStickers' && {\n sendGifs: getUpdatedPermissionValue(p[name]),\n }),\n }));\n setHavePermissionChanged(true);\n }, []);\n\n const handleSavePermissions = useCallback(() => {\n if (!chat) {\n return;\n }\n\n setIsLoading(true);\n updateChatDefaultBannedRights({ chatId: chat.id, bannedRights: permissions });\n }, [chat, permissions, updateChatDefaultBannedRights]);\n\n const removedUsersCount = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.kickedMembers) {\n return 0;\n }\n\n return chat.fullInfo.kickedMembers.length;\n }, [chat]);\n\n const exceptionMembers = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.members) {\n return [];\n }\n\n return chat.fullInfo.members.filter(({ bannedRights }) => !!bannedRights);\n }, [chat]);\n\n const getMemberExceptions = useCallback((member: ApiChatMember) => {\n const { bannedRights } = member;\n if (!bannedRights || !chat) {\n return undefined;\n }\n\n const { defaultBannedRights } = chat;\n\n return Object.keys(bannedRights).reduce((result, key) => {\n if (\n !bannedRights[key as keyof ApiChatBannedRights]\n || (defaultBannedRights?.[key as keyof ApiChatBannedRights])\n || key === 'sendInline' || key === 'viewMessages' || key === 'sendGames'\n ) {\n return result;\n }\n\n const langKey = getLangKeyForBannedRightKey(key);\n\n if (!langKey) {\n return result;\n }\n\n const translatedString = lang(langKey);\n\n return `${result}${!result.length ? translatedString : `, ${translatedString}`}`;\n }, '');\n }, [chat, lang]);\n\n return (\n
\n
\n
\n

{lang('ChannelPermissionsHeader')}

\n\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n\n
\n \n {lang('ChannelBlockedUsers')}\n {removedUsersCount}\n \n
\n\n
\n

{lang('PrivacyExceptions')}

\n\n \n {lang('ChannelAddException')}\n \n\n {exceptionMembers.map((member) => (\n handleExceptionMemberClick(member)}\n >\n \n \n ))}\n
\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n\n return { chat, currentUserId: global.currentUserId };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['updateChatDefaultBannedRights']),\n)(ManageGroupPermissions));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatMember, ApiUser } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { selectChat } from '../../../modules/selectors';\nimport { getUserFullName } from '../../../modules/helpers';\nimport { pick } from '../../../util/iteratees';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\n\ntype OwnProps = {\n chatId: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n usersById: Record;\n};\n\ntype DispatchProps = Pick;\n\nconst ManageGroupRemovedUsers: FC = ({\n chat,\n usersById,\n updateChatMemberBannedRights,\n onClose,\n isActive,\n}) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const removedMembers = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.kickedMembers) {\n return [];\n }\n\n return chat.fullInfo.kickedMembers;\n }, [chat]);\n\n const getRemovedBy = useCallback((member: ApiChatMember) => {\n if (!member.kickedByUserId) {\n return undefined;\n }\n\n const kickedByUser = usersById[member.kickedByUserId];\n if (!kickedByUser) {\n return undefined;\n }\n\n return lang('UserRemovedBy', getUserFullName(kickedByUser));\n }, [lang, usersById]);\n\n const getContextActions = useCallback((member: ApiChatMember) => {\n if (!chat) {\n return undefined;\n }\n\n return [{\n title: lang('Unblock'),\n icon: 'delete',\n destructive: true,\n handler: () => updateChatMemberBannedRights({\n chatId: chat.id,\n userId: member.userId,\n bannedRights: {},\n }),\n }];\n }, [lang, chat, updateChatMemberBannedRights]);\n\n return (\n
\n
\n
\n

{lang('NoBlockedGroup2')}

\n\n {removedMembers.map((member) => (\n \n \n \n ))}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { byId: usersById } = global.users;\n\n return { chat, usersById };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['updateChatMemberBannedRights']),\n)(ManageGroupRemovedUsers));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ManagementScreens, ManagementProgress } from '../../../types';\nimport { ApiChat, ApiMediaFormat } from '../../../api/types';\n\nimport { pick } from '../../../util/iteratees';\nimport { getChatAvatarHash, getHasAdminRight } from '../../../modules/helpers';\nimport useMedia from '../../../hooks/useMedia';\nimport useLang from '../../../hooks/useLang';\nimport { selectChat } from '../../../modules/selectors';\n\nimport AvatarEditable from '../../ui/AvatarEditable';\nimport InputText from '../../ui/InputText';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport Spinner from '../../ui/Spinner';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\nimport useFlag from '../../../hooks/useFlag';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport './Management.scss';\n\ntype OwnProps = {\n chatId: number;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n progress?: ManagementProgress;\n isSignaturesShown: boolean;\n canChangeInfo?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst CHANNEL_TITLE_EMPTY = 'Channel title can\\'t be empty';\n\nconst ManageChannel: FC = ({\n chatId,\n chat,\n progress,\n isSignaturesShown,\n canChangeInfo,\n onScreenSelect,\n updateChat,\n toggleSignatures,\n closeManagement,\n leaveChannel,\n deleteChannel,\n openChat,\n onClose,\n isActive,\n}) => {\n const currentTitle = chat ? (chat.title || '') : '';\n const currentAbout = chat?.fullInfo ? (chat.fullInfo.about || '') : '';\n const hasLinkedChat = chat?.fullInfo?.linkedChatId;\n\n const [isDeleteDialogOpen, openDeleteDialog, closeDeleteDialog] = useFlag();\n const [isProfileFieldsTouched, setIsProfileFieldsTouched] = useState(false);\n const [title, setTitle] = useState(currentTitle);\n const [about, setAbout] = useState(currentAbout);\n const [photo, setPhoto] = useState();\n const [error, setError] = useState();\n const imageHash = chat && getChatAvatarHash(chat);\n const currentAvatarBlobUrl = useMedia(imageHash, false, ApiMediaFormat.BlobUrl);\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n useEffect(() => {\n if (progress === ManagementProgress.Complete) {\n setIsProfileFieldsTouched(false);\n setError(undefined);\n }\n }, [progress]);\n\n const adminsCount = (chat?.fullInfo?.adminMembers?.length) || 0;\n\n const handleClickEditType = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatPrivacyType);\n }, [onScreenSelect]);\n\n const handleClickDiscussion = useCallback(() => {\n onScreenSelect(ManagementScreens.Discussion);\n }, [onScreenSelect]);\n\n const handleClickAdministrators = useCallback(() => {\n onScreenSelect(ManagementScreens.ChatAdministrators);\n }, [onScreenSelect]);\n\n const handleSetPhoto = useCallback((file: File) => {\n setPhoto(file);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleTitleChange = useCallback((e: ChangeEvent) => {\n setTitle(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleAboutChange = useCallback((e: ChangeEvent) => {\n setAbout(e.target.value);\n setIsProfileFieldsTouched(true);\n }, []);\n\n const handleUpdateChannel = useCallback(() => {\n const trimmedTitle = title.trim();\n const trimmedAbout = about.trim();\n\n if (!trimmedTitle.length) {\n setError(CHANNEL_TITLE_EMPTY);\n return;\n }\n\n updateChat({\n chatId,\n title: trimmedTitle,\n about: trimmedAbout,\n photo,\n });\n }, [about, chatId, photo, title, updateChat]);\n\n const handleToggleSignatures = useCallback(() => {\n toggleSignatures({ chatId, isEnabled: !isSignaturesShown });\n }, [chatId, isSignaturesShown, toggleSignatures]);\n\n const handleClickSubscribers = useCallback(() => {\n onScreenSelect(ManagementScreens.ChannelSubscribers);\n }, [onScreenSelect]);\n\n const handleDeleteChannel = useCallback(() => {\n if (chat.isCreator) {\n deleteChannel({ chatId: chat.id });\n } else {\n leaveChannel({ chatId: chat.id });\n }\n\n closeDeleteDialog();\n closeManagement();\n openChat({ id: undefined });\n }, [chat.isCreator, chat.id, closeDeleteDialog, closeManagement, leaveChannel, deleteChannel, openChat]);\n\n if (chat.isRestricted) {\n return undefined;\n }\n\n const isLoading = progress === ManagementProgress.InProgress;\n\n return (\n
\n
\n
\n \n \n \n {chat.isCreator && (\n \n {lang('ChannelType')}\n {chat.username ? lang('TypePublic') : lang('TypePrivate')}\n \n )}\n \n {lang('Discussion')}\n {hasLinkedChat ? lang('DiscussionUnlink') : lang('Add')}\n \n \n {lang('ChannelAdministrators')}\n {adminsCount}\n \n
\n \n
\n
\n
\n \n {lang('ChannelSubscribers')}\n {lang('Subscribers', chat.membersCount ?? 0, 'i')}\n \n
\n
\n \n {chat.isCreator ? lang('ChannelDelete') : lang('LeaveChannel')}\n \n
\n
\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { progress } = global.management;\n const isSignaturesShown = Boolean(chat?.isSignaturesShown);\n\n return {\n chat,\n progress,\n isSignaturesShown,\n canChangeInfo: getHasAdminRight(chat, 'changeInfo'),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'toggleSignatures', 'updateChat', 'closeManagement', 'leaveChannel', 'deleteChannel', 'openChat',\n ]),\n)(ManageChannel));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat } from '../../../api/types';\nimport { ManagementProgress } from '../../../types';\n\nimport { selectChat, selectManagement } from '../../../modules/selectors';\nimport { pick } from '../../../util/iteratees';\nimport { isChatChannel } from '../../../modules/helpers';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport SafeLink from '../../common/SafeLink';\nimport ListItem from '../../ui/ListItem';\nimport RadioGroup from '../../ui/RadioGroup';\nimport Loading from '../../ui/Loading';\nimport Spinner from '../../ui/Spinner';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport UsernameInput from '../../common/UsernameInput';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\ntype PrivacyType = 'private' | 'public';\n\ntype OwnProps = {\n chatId: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n isChannel: boolean;\n progress?: ManagementProgress;\n isUsernameAvailable?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst ManageChatPrivacyType: FC = ({\n chat,\n onClose,\n isActive,\n isChannel,\n progress,\n isUsernameAvailable,\n checkPublicLink,\n updatePublicLink,\n updatePrivateLink,\n}) => {\n const isPublic = Boolean(chat.username);\n const privateLink = chat.fullInfo?.inviteLink;\n\n const [privacyType, setPrivacyType] = useState(isPublic ? 'public' : 'private');\n const [username, setUsername] = useState();\n const [isRevokeConfirmDialogOpen, openRevokeConfirmDialog, closeRevokeConfirmDialog] = useFlag();\n\n const canUpdate = Boolean(\n (privacyType === 'public' && username && isUsernameAvailable)\n || (privacyType === 'private' && isPublic),\n );\n\n useHistoryBack(isActive, onClose);\n\n useEffect(() => {\n if (privacyType && !privateLink) {\n updatePrivateLink();\n }\n }, [privacyType, privateLink, updatePrivateLink]);\n\n const handleOptionChange = useCallback((value: string) => {\n setPrivacyType(value as PrivacyType);\n }, []);\n\n const handleSave = useCallback(() => {\n updatePublicLink({ username: privacyType === 'public' ? username : '' });\n }, [privacyType, updatePublicLink, username]);\n\n const handleRevokePrivateLink = useCallback(() => {\n closeRevokeConfirmDialog();\n updatePrivateLink();\n }, [closeRevokeConfirmDialog, updatePrivateLink]);\n\n const lang = useLang();\n const langPrefix1 = isChannel ? 'Channel' : 'Mega';\n const langPrefix2 = isChannel ? 'Channel' : 'Group';\n\n const options = [\n { value: 'private', label: lang(`${langPrefix1}Private`), subLabel: lang(`${langPrefix1}PrivateInfo`) },\n { value: 'public', label: lang(`${langPrefix1}Public`), subLabel: lang(`${langPrefix1}PublicInfo`) },\n ];\n\n const isLoading = progress === ManagementProgress.InProgress;\n\n return (\n
\n
\n
\n

{lang(`${langPrefix2}Type`)}

\n \n
\n {privacyType === 'private' ? (\n
\n {privateLink ? (\n <>\n \n

\n {lang(`${langPrefix1}PrivateLinkHelp`)}\n

\n\n \n {lang('RevokeLink')}\n \n \n \n ) : (\n \n )}\n
\n ) : (\n
\n \n

\n {lang(`${langPrefix2}.Username.CreatePublicLinkHelp`)}\n

\n
\n )}\n
\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { isUsernameAvailable } = selectManagement(global, chatId)!;\n\n return {\n chat,\n isChannel: isChatChannel(chat),\n progress: global.management.progress,\n isUsernameAvailable,\n };\n },\n (setGlobal, actions) => pick(actions, [\n 'checkPublicLink', 'updatePublicLink', 'updatePrivateLink',\n ]),\n)(ManageChatPrivacyType));\n","import React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport { STICKER_SIZE_DISCUSSION_GROUPS } from '../../../config';\nimport { selectChat } from '../../../modules/selectors';\nimport { pick } from '../../../util/iteratees';\nimport getAnimationData from '../../common/helpers/animatedAssets';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport NothingFound from '../../common/NothingFound';\nimport GroupChatInfo from '../../common/GroupChatInfo';\nimport AnimatedSticker from '../../common/AnimatedSticker';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\nimport useFlag from '../../../hooks/useFlag';\nimport renderText from '../../common/helpers/renderText';\nimport Avatar from '../../common/Avatar';\nimport { isChatChannel } from '../../../modules/helpers';\n\ntype OwnProps = {\n chatId: number;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n chatsByIds: Record;\n linkedChat?: ApiChat;\n forDiscussionIds?: number[];\n isChannel?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst ManageDiscussion: FC = ({\n chat,\n onClose,\n isActive,\n chatId,\n chatsByIds,\n linkedChat,\n forDiscussionIds,\n isChannel,\n onScreenSelect,\n loadGroupsForDiscussion,\n linkDiscussionGroup,\n unlinkDiscussionGroup,\n}) => {\n const [linkedGroupId, setLinkedGroupId] = useState();\n const [animationData, setAnimationData] = useState>();\n const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);\n const handleAnimationLoad = useCallback(() => setIsAnimationLoaded(true), []);\n const [isConfirmUnlinkGroupDialogOpen, openConfirmUnlinkGroupDialog, closeConfirmUnlinkGroupDialog] = useFlag();\n const [isConfirmLinkGroupDialogOpen, openConfirmLinkGroupDialog, closeConfirmLinkGroupDialog] = useFlag();\n const lang = useLang();\n const linkedChatId = linkedChat?.id;\n\n useHistoryBack(isActive, onClose);\n\n useEffect(() => {\n loadGroupsForDiscussion();\n }, [loadGroupsForDiscussion]);\n\n useEffect(() => {\n if (!animationData) {\n getAnimationData('DiscussionGroups').then(setAnimationData);\n }\n }, [animationData]);\n\n const handleUnlinkGroupSessions = useCallback(() => {\n closeConfirmUnlinkGroupDialog();\n unlinkDiscussionGroup({ channelId: isChannel ? chatId : linkedChatId });\n if (!isChannel) {\n onScreenSelect(ManagementScreens.Initial);\n }\n }, [closeConfirmUnlinkGroupDialog, unlinkDiscussionGroup, isChannel, chatId, linkedChatId, onScreenSelect]);\n\n const handleLinkGroupSessions = useCallback(() => {\n closeConfirmLinkGroupDialog();\n linkDiscussionGroup({ channelId: chatId, chatId: linkedGroupId });\n }, [closeConfirmLinkGroupDialog, linkDiscussionGroup, chatId, linkedGroupId]);\n\n const onDiscussionClick = (groupId: number) => {\n setLinkedGroupId(groupId);\n openConfirmLinkGroupDialog();\n };\n\n function renderUnlinkGroupHeader() {\n return (\n
\n \n
\n {lang(isChannel ? 'DiscussionUnlinkGroup' : 'DiscussionUnlinkChannel')}\n
\n
\n );\n }\n function renderLinkGroupHeader() {\n const linkedGroup = chatsByIds[linkedGroupId];\n\n if (!linkedGroup) {\n return undefined;\n }\n\n return (\n
\n \n
\n {lang('Channel.DiscussionGroup.LinkGroup')}\n
\n
\n );\n }\n\n function renderLinkGroupConfirmText() {\n const linkedGroup = chatsByIds[linkedGroupId];\n\n if (!linkedGroup) {\n return undefined;\n }\n\n if (linkedGroup.hasPrivateLink) {\n return renderText(\n `Do you want to make **${linkedGroup.title}** the discussion board for **${chat!.title}**?`,\n ['br', 'simple_markdown'],\n );\n // return renderText(\n // lang('DiscussionLinkGroupPublicAlert', linkedChat.title, chat!.title),\n // ['br', 'simple_markdown'],\n // );\n }\n\n return renderText(\n // eslint-disable-next-line max-len\n `Do you want to make **${linkedGroup.title}** the discussion board for **${chat!.title}**?\\n\\nAnyone from the channel will be able to see messages in this group.`,\n ['br', 'simple_markdown'],\n );\n // return renderText(\n // lang('DiscussionLinkGroupPrivateAlert', linkedChat.title, chat!.title),\n // ['br', 'simple_markdown'],\n // );\n }\n\n function renderLinkedGroup() {\n return (\n
\n \n \n \n \n {lang(isChannel ? 'DiscussionUnlinkGroup' : 'DiscussionUnlinkChannel')}\n \n \n
\n );\n }\n\n function renderDiscussionGroups() {\n return (\n
\n

{lang('DiscussionChannelHelp')}

\n\n
\n \n {lang('DiscussionCreateGroup')}\n \n {forDiscussionIds ? (\n forDiscussionIds.map((id, i) => (\n { onDiscussionClick(id); }}\n >\n \n \n ))\n ) : (\n \n )}\n
\n

{lang('DiscussionChannelHelp2')}

\n \n
\n );\n }\n\n return (\n
\n
\n
\n
\n {animationData && (\n \n )}\n
\n {linkedChat && renderLinkedGroup()}\n {!linkedChat && renderDiscussionGroups()}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { forDiscussionIds, byId: chatsByIds } = global.chats;\n const linkedChat = chat?.fullInfo?.linkedChatId\n ? selectChat(global, chat.fullInfo.linkedChatId)\n : undefined;\n\n return {\n chat,\n chatsByIds,\n forDiscussionIds,\n linkedChat,\n isChannel: chat && isChatChannel(chat),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'loadGroupsForDiscussion', 'linkDiscussionGroup', 'unlinkDiscussionGroup',\n ]),\n)(ManageDiscussion));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatBannedRights } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { pick } from '../../../util/iteratees';\nimport { selectChat } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\n\ntype OwnProps = {\n chatId: number;\n selectedChatMemberId?: number;\n isPromotedByCurrentUser?: boolean;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n isFormFullyDisabled?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst ManageGroupUserPermissions: FC = ({\n chat,\n selectedChatMemberId,\n onScreenSelect,\n updateChatMemberBannedRights,\n isFormFullyDisabled,\n onClose,\n isActive,\n}) => {\n const [permissions, setPermissions] = useState({});\n const [havePermissionChanged, setHavePermissionChanged] = useState(false);\n const [isLoading, setIsLoading] = useState(false);\n const [isBanConfirmationDialogOpen, openBanConfirmationDialog, closeBanConfirmationDialog] = useFlag();\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const selectedChatMember = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.members) {\n return undefined;\n }\n\n return chat.fullInfo.members.find(({ userId }) => userId === selectedChatMemberId);\n }, [chat, selectedChatMemberId]);\n\n useEffect(() => {\n if (chat?.fullInfo && selectedChatMemberId && !selectedChatMember) {\n onScreenSelect(ManagementScreens.GroupPermissions);\n }\n }, [chat, onScreenSelect, selectedChatMember, selectedChatMemberId]);\n\n useEffect(() => {\n setPermissions((selectedChatMember?.bannedRights) || (chat?.defaultBannedRights) || {});\n setHavePermissionChanged(false);\n setIsLoading(false);\n }, [chat, selectedChatMember]);\n\n const handlePermissionChange = useCallback((e: React.ChangeEvent) => {\n const { name } = e.target;\n\n function getUpdatedPermissionValue(value: true | undefined) {\n return value ? undefined : true;\n }\n\n setPermissions((p) => ({\n ...p,\n [name]: getUpdatedPermissionValue(p[name as Exclude]),\n ...(name === 'sendStickers' && {\n sendGifs: getUpdatedPermissionValue(p[name]),\n }),\n }));\n setHavePermissionChanged(true);\n }, []);\n\n const handleSavePermissions = useCallback(() => {\n if (!chat || !selectedChatMemberId) {\n return;\n }\n\n setIsLoading(true);\n updateChatMemberBannedRights({\n chatId: chat.id,\n userId: selectedChatMemberId,\n bannedRights: permissions,\n });\n }, [chat, selectedChatMemberId, permissions, updateChatMemberBannedRights]);\n\n const handleBanFromGroup = useCallback(() => {\n if (!chat || !selectedChatMemberId) {\n return;\n }\n\n updateChatMemberBannedRights({\n chatId: chat.id,\n userId: selectedChatMemberId,\n bannedRights: {\n viewMessages: true,\n },\n });\n }, [chat, selectedChatMemberId, updateChatMemberBannedRights]);\n\n const getControlIsDisabled = useCallback((key: Exclude) => {\n if (isFormFullyDisabled) {\n return true;\n }\n\n if (!chat || !chat.defaultBannedRights) {\n return false;\n }\n\n return chat.defaultBannedRights[key];\n }, [chat, isFormFullyDisabled]);\n\n if (!selectedChatMember) {\n return undefined;\n }\n\n return (\n
\n
\n
\n \n \n \n\n

{lang('UserRestrictionsCanDo')}

\n\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n\n {!isFormFullyDisabled && (\n
\n \n {lang('UserRestrictionsBlock')}\n \n
\n )}\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, isPromotedByCurrentUser }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const isFormFullyDisabled = !(chat.isCreator || isPromotedByCurrentUser);\n\n return { chat, isFormFullyDisabled };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['updateChatMemberBannedRights']),\n)(ManageGroupUserPermissions));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens } from '../../../types';\nimport { ApiChat, ApiChatMember, ApiUser } from '../../../api/types';\n\nimport { getUserFullName, isChatChannel } from '../../../modules/helpers';\nimport { selectChat } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\ntype OwnProps = {\n chatId: number;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: number, isPromotedByCurrentUser?: boolean) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n currentUserId?: number;\n isChannel: boolean;\n usersById: Record;\n};\n\nconst ManageChatAdministrators: FC = ({\n chat,\n isChannel,\n currentUserId,\n usersById,\n onScreenSelect,\n onChatMemberSelect,\n onClose,\n isActive,\n}) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n function handleRecentActionsClick() {\n onScreenSelect(ManagementScreens.GroupRecentActions);\n }\n\n const adminMembers = useMemo(() => {\n if (!chat.fullInfo || !chat.fullInfo.adminMembers) {\n return [];\n }\n\n return chat.fullInfo.adminMembers.sort((a, b) => {\n if (a.isOwner) {\n return -1;\n } else if (b.isOwner) {\n return 1;\n }\n\n return 0;\n });\n }, [chat]);\n\n const handleAdminMemberClick = useCallback((member: ApiChatMember) => {\n onChatMemberSelect(member.userId, member.promotedByUserId === currentUserId);\n onScreenSelect(ManagementScreens.ChatAdminRights);\n }, [currentUserId, onChatMemberSelect, onScreenSelect]);\n\n const getMemberStatus = useCallback((member: ApiChatMember) => {\n if (member.isOwner) {\n return lang('ChannelCreator');\n }\n\n const promotedByUser = member.promotedByUserId ? usersById[member.promotedByUserId] : undefined;\n\n if (promotedByUser) {\n return lang('EditAdminPromotedBy', getUserFullName(promotedByUser));\n }\n\n return lang('ChannelAdmin');\n }, [lang, usersById]);\n\n return (\n
\n
\n
\n \n {lang('EventLog')}\n {lang(isChannel ? 'EventLogInfoDetailChannel' : 'EventLogInfoDetail')}\n \n
\n\n
\n

\n {isChannel\n ? 'You can add administrators to help you manage your channel.'\n : 'You can add administrators to help you manage your group.'}\n

\n\n {adminMembers.map((member) => (\n handleAdminMemberClick(member)}\n >\n \n \n ))}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { byId: usersById } = global.users;\n\n return {\n chat,\n currentUserId: global.currentUserId,\n isChannel: isChatChannel(chat),\n usersById,\n };\n },\n // (setGlobal, actions): DispatchProps => pick(actions, ['togglePreHistoryHidden', 'updateChat']),\n)(ManageChatAdministrators));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatMember } from '../../../api/types';\nimport useLang from '../../../hooks/useLang';\nimport { selectChat } from '../../../modules/selectors';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\n\ntype OwnProps = {\n chatId: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n};\n\nconst ManageGroupRecentActions: FC = ({ chat, onClose, isActive }) => {\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const adminMembers = useMemo(() => {\n if (!chat || !chat.fullInfo || !chat.fullInfo.adminMembers) {\n return [];\n }\n\n return chat.fullInfo.adminMembers.sort((a, b) => {\n if (a.isOwner) {\n return -1;\n } else if (b.isOwner) {\n return 1;\n }\n\n return 0;\n });\n }, [chat]);\n\n const getMemberStatus = useCallback((member: ApiChatMember) => {\n if (member.isOwner) {\n return lang('ChannelCreator');\n }\n\n return lang('ChannelAdmin');\n }, [lang]);\n\n return (\n
\n
\n
\n

Actions

\n\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n\n
\n

{lang('Channel.Management.Title')}

\n\n
\n \n
\n\n {adminMembers.map((member) => (\n \n \n \n \n ))}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n\n return { chat };\n },\n)(ManageGroupRecentActions));\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiChatAdminRights, ApiUser } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\nimport { GlobalActions } from '../../../global/types';\n\nimport { pick } from '../../../util/iteratees';\nimport { selectChat } from '../../../modules/selectors';\nimport { getUserFullName, isChatBasicGroup, isChatChannel } from '../../../modules/helpers';\nimport useLang from '../../../hooks/useLang';\nimport useFlag from '../../../hooks/useFlag';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\nimport Checkbox from '../../ui/Checkbox';\nimport FloatingActionButton from '../../ui/FloatingActionButton';\nimport Spinner from '../../ui/Spinner';\nimport ConfirmDialog from '../../ui/ConfirmDialog';\nimport InputText from '../../ui/InputText';\n\ntype OwnProps = {\n chatId: number;\n selectedChatMemberId?: number;\n isPromotedByCurrentUser?: boolean;\n onScreenSelect: (screen: ManagementScreens) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n chat: ApiChat;\n usersById: Record;\n currentUserId?: number;\n isChannel: boolean;\n isFormFullyDisabled: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst CUSTOM_TITLE_MAX_LENGTH = 16;\n\nconst ManageGroupAdminRights: FC = ({\n selectedChatMemberId,\n onScreenSelect,\n chat,\n usersById,\n currentUserId,\n isChannel,\n isFormFullyDisabled,\n updateChatAdmin,\n onClose,\n isActive,\n}) => {\n const [permissions, setPermissions] = useState({});\n const [isTouched, setIsTouched] = useState(false);\n const [isLoading, setIsLoading] = useState(false);\n const [isDismissConfirmationDialogOpen, openDismissConfirmationDialog, closeDismissConfirmationDialog] = useFlag();\n const [customTitle, setCustomTitle] = useState('');\n const lang = useLang();\n\n useHistoryBack(isActive, onClose);\n\n const selectedChatMember = useMemo(() => {\n if (!chat.fullInfo || !chat.fullInfo.adminMembers) {\n return undefined;\n }\n\n return chat.fullInfo.adminMembers.find(({ userId }) => userId === selectedChatMemberId);\n }, [chat, selectedChatMemberId]);\n\n useEffect(() => {\n if (chat?.fullInfo && selectedChatMemberId && !selectedChatMember) {\n onScreenSelect(ManagementScreens.ChatAdministrators);\n }\n }, [chat, onScreenSelect, selectedChatMember, selectedChatMemberId]);\n\n useEffect(() => {\n setPermissions((selectedChatMember?.adminRights) || {});\n setCustomTitle(((selectedChatMember?.customTitle) || '').substr(0, CUSTOM_TITLE_MAX_LENGTH));\n setIsTouched(false);\n setIsLoading(false);\n }, [selectedChatMember]);\n\n const handlePermissionChange = useCallback((e: React.ChangeEvent) => {\n const { name } = e.target;\n\n function getUpdatedPermissionValue(value: true | undefined) {\n return value ? undefined : true;\n }\n\n setPermissions((p) => ({\n ...p,\n [name]: getUpdatedPermissionValue(p[name as keyof ApiChatAdminRights]),\n }));\n setIsTouched(true);\n }, []);\n\n const handleSavePermissions = useCallback(() => {\n if (!selectedChatMemberId) {\n return;\n }\n\n setIsLoading(true);\n updateChatAdmin({\n chatId: chat.id,\n userId: selectedChatMemberId,\n adminRights: permissions,\n customTitle,\n });\n }, [chat, selectedChatMemberId, permissions, customTitle, updateChatAdmin]);\n\n const handleDismissAdmin = useCallback(() => {\n if (!selectedChatMemberId) {\n return;\n }\n\n updateChatAdmin({\n chatId: chat.id,\n userId: selectedChatMemberId,\n adminRights: {},\n });\n closeDismissConfirmationDialog();\n }, [chat.id, closeDismissConfirmationDialog, selectedChatMemberId, updateChatAdmin]);\n\n const getControlIsDisabled = useCallback((key: keyof ApiChatAdminRights) => {\n if (isChatBasicGroup(chat)) {\n return false;\n }\n\n if (isFormFullyDisabled || !chat.adminRights) {\n return true;\n }\n\n return !chat.adminRights![key];\n }, [chat, isFormFullyDisabled]);\n\n const memberStatus = useMemo(() => {\n if (!selectedChatMember) {\n return undefined;\n }\n\n if (selectedChatMember.isOwner) {\n return lang('ChannelCreator');\n }\n\n const promotedByUser = selectedChatMember.promotedByUserId\n ? usersById[selectedChatMember.promotedByUserId]\n : undefined;\n\n if (promotedByUser) {\n return lang('EditAdminPromotedBy', getUserFullName(promotedByUser));\n }\n\n return lang('ChannelAdmin');\n }, [selectedChatMember, usersById, lang]);\n\n const handleCustomTitleChange = useCallback((e) => {\n const { value } = e.target;\n setCustomTitle(value);\n setIsTouched(true);\n }, []);\n\n if (!selectedChatMember) {\n return undefined;\n }\n\n return (\n
\n
\n
\n \n \n \n\n

{lang('EditAdminWhatCanDo')}

\n\n
\n \n
\n {isChannel && (\n
\n \n
\n )}\n {isChannel && (\n
\n \n
\n )}\n
\n \n
\n {!isChannel && (\n
\n \n
\n )}\n
\n \n
\n {!isChannel && (\n
\n \n
\n )}\n
\n \n
\n {!isChannel && (\n
\n \n
\n )}\n\n {isFormFullyDisabled && (\n

\n {lang('Channel.EditAdmin.CannotEdit')}\n

\n )}\n\n {!isChannel && (\n \n )}\n\n {currentUserId !== selectedChatMemberId && !isFormFullyDisabled && (\n \n {lang('EditAdminRemoveAdmin')}\n \n )}\n
\n
\n\n \n {isLoading ? (\n \n ) : (\n \n )}\n \n\n \n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId, isPromotedByCurrentUser }): StateProps => {\n const chat = selectChat(global, chatId)!;\n const { byId: usersById } = global.users;\n const { currentUserId } = global;\n const isChannel = isChatChannel(chat);\n const isFormFullyDisabled = !(chat.isCreator || isPromotedByCurrentUser);\n\n return {\n chat,\n usersById,\n currentUserId,\n isChannel,\n isFormFullyDisabled,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['updateChatAdmin']),\n)(ManageGroupAdminRights));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChatMember, ApiUser } from '../../../api/types';\nimport { GlobalActions } from '../../../global/types';\nimport { selectChat } from '../../../modules/selectors';\nimport { sortUserIds, isChatChannel } from '../../../modules/helpers';\nimport { pick } from '../../../util/iteratees';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport NothingFound from '../../common/NothingFound';\nimport ListItem from '../../ui/ListItem';\n\ntype OwnProps = {\n chatId: number;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n usersById: Record;\n members?: ApiChatMember[];\n isChannel?: boolean;\n serverTimeOffset: number;\n};\n\ntype DispatchProps = Pick;\n\nconst ManageGroupMembers: FC = ({\n members,\n usersById,\n isChannel,\n openUserInfo,\n onClose,\n isActive,\n serverTimeOffset,\n}) => {\n const memberIds = useMemo(() => {\n if (!members || !usersById) {\n return undefined;\n }\n\n return sortUserIds(members.map(({ userId }) => userId), usersById, undefined, serverTimeOffset);\n }, [members, serverTimeOffset, usersById]);\n\n const handleMemberClick = useCallback((id: number) => {\n openUserInfo({ id });\n }, [openUserInfo]);\n\n useHistoryBack(isActive, onClose);\n\n return (\n
\n
\n
\n {memberIds ? (\n memberIds.map((id, i) => (\n handleMemberClick(id)}\n >\n \n \n ))\n ) : (\n \n )}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { byId: usersById } = global.users;\n const members = chat?.fullInfo?.members;\n const isChannel = chat && isChatChannel(chat);\n\n return {\n members,\n usersById,\n isChannel,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'openUserInfo',\n ]),\n)(ManageGroupMembers));\n","import React, {\n FC, memo, useCallback, useMemo,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChatMember, ApiUser } from '../../../api/types';\nimport { ManagementScreens } from '../../../types';\n\nimport { selectChat } from '../../../modules/selectors';\nimport { sortUserIds, isChatChannel } from '../../../modules/helpers';\nimport useHistoryBack from '../../../hooks/useHistoryBack';\n\nimport PrivateChatInfo from '../../common/PrivateChatInfo';\nimport ListItem from '../../ui/ListItem';\nimport NothingFound from '../../common/NothingFound';\n\ntype OwnProps = {\n chatId: number;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: number) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n usersById: Record;\n members?: ApiChatMember[];\n isChannel?: boolean;\n serverTimeOffset: number;\n};\n\nconst ManageGroupUserPermissionsCreate: FC = ({\n usersById,\n members,\n isChannel,\n onScreenSelect,\n onChatMemberSelect,\n onClose,\n isActive,\n serverTimeOffset,\n}) => {\n useHistoryBack(isActive, onClose);\n\n const memberIds = useMemo(() => {\n if (!members || !usersById) {\n return undefined;\n }\n\n return sortUserIds(\n members.filter((member) => !member.isOwner).map(({ userId }) => userId),\n usersById, undefined, serverTimeOffset,\n );\n }, [members, serverTimeOffset, usersById]);\n\n const handleExceptionMemberClick = useCallback((memberId: number) => {\n onChatMemberSelect(memberId);\n onScreenSelect(ManagementScreens.GroupUserPermissions);\n }, [onChatMemberSelect, onScreenSelect]);\n\n return (\n
\n
\n
\n {memberIds ? (\n memberIds.map((id, i) => (\n handleExceptionMemberClick(id)}\n >\n \n \n ))\n ) : (\n \n )}\n
\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global, { chatId }): StateProps => {\n const chat = selectChat(global, chatId);\n const { byId: usersById } = global.users;\n const members = chat?.fullInfo?.members;\n const isChannel = chat && isChatChannel(chat);\n\n return {\n members,\n usersById,\n isChannel,\n serverTimeOffset: global.serverTimeOffset,\n };\n },\n)(ManageGroupUserPermissionsCreate));\n","import React, { FC, memo } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ManagementScreens, ManagementType } from '../../../types';\n\nimport { selectCurrentManagementType } from '../../../modules/selectors';\n\nimport ManageUser from './ManageUser';\nimport ManageGroup from './ManageGroup';\nimport ManageGroupPermissions from './ManageGroupPermissions';\nimport ManageGroupRemovedUsers from './ManageGroupRemovedUsers';\nimport ManageChannel from './ManageChannel';\nimport ManageChatPrivacyType from './ManageChatPrivacyType';\nimport ManageDiscussion from './ManageDiscussion';\nimport ManageGroupUserPermissions from './ManageGroupUserPermissions';\nimport ManageChatAdministrators from './ManageChatAdministrators';\nimport ManageGroupRecentActions from './ManageGroupRecentActions';\nimport ManageGroupAdminRights from './ManageGroupAdminRights';\nimport ManageGroupMembers from './ManageGroupMembers';\nimport ManageGroupUserPermissionsCreate from './ManageGroupUserPermissionsCreate';\n\nexport type OwnProps = {\n chatId: number;\n currentScreen: ManagementScreens;\n selectedChatMemberId?: number;\n isPromotedByCurrentUser?: boolean;\n onScreenSelect: (screen: ManagementScreens) => void;\n onChatMemberSelect: (memberId: number, isPromotedByCurrentUser?: boolean) => void;\n onClose: NoneToVoidFunction;\n isActive: boolean;\n};\n\ntype StateProps = {\n managementType?: ManagementType;\n};\n\nconst Management: FC = ({\n chatId,\n currentScreen,\n selectedChatMemberId,\n isPromotedByCurrentUser,\n onScreenSelect,\n onChatMemberSelect,\n onClose,\n isActive,\n managementType,\n}) => {\n switch (currentScreen) {\n case ManagementScreens.Initial: {\n switch (managementType) {\n case 'user':\n return (\n \n );\n case 'group':\n return (\n \n );\n case 'channel':\n return (\n \n );\n }\n\n break;\n }\n\n case ManagementScreens.ChatPrivacyType:\n return (\n \n );\n\n case ManagementScreens.Discussion:\n return (\n \n );\n\n case ManagementScreens.GroupPermissions:\n return (\n \n );\n\n case ManagementScreens.GroupRemovedUsers:\n return (\n \n );\n\n case ManagementScreens.GroupUserPermissionsCreate:\n return (\n \n );\n\n case ManagementScreens.GroupUserPermissions:\n return (\n \n );\n\n case ManagementScreens.ChatAdministrators:\n return (\n \n );\n\n case ManagementScreens.GroupRecentActions:\n return (\n \n );\n\n case ManagementScreens.ChatAdminRights:\n return (\n \n );\n\n case ManagementScreens.ChannelSubscribers:\n case ManagementScreens.GroupMembers:\n return (\n \n );\n }\n\n return undefined; // Never reached\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const managementType = selectCurrentManagementType(global);\n\n return {\n managementType,\n };\n },\n)(Management));\n","const VISA = /^4[0-9]{12}(?:[0-9]{1,3})?$/;\nconst MASTERCARD1 = /^5[1-5][0-9]{11,14}$/;\nconst MASTERCARD2 = /^2[2-7][0-9]{11,14}$/;\n\nexport enum CardType {\n Default,\n Visa,\n Mastercard,\n}\n\nconst cards: Record = {\n [CardType.Default]: '',\n [CardType.Visa]: 'visa',\n [CardType.Mastercard]: 'mastercard',\n};\n\nexport function detectCardType(cardNumber: string): number {\n cardNumber = cardNumber.replace(/\\s/g, '');\n if (VISA.test(cardNumber)) {\n return CardType.Visa;\n }\n if (MASTERCARD1.test(cardNumber) || MASTERCARD2.test(cardNumber)) {\n return CardType.Mastercard;\n }\n return CardType.Default;\n}\n\nexport function detectCardTypeText(cardNumber: string): string {\n const cardType = detectCardType(cardNumber);\n return cards[cardType as number] || '';\n}\n","// This data was received from Telegram Desktop (Telegram/Resources/numbers.txt)\nconst DATA = `AF🇦🇫93Afghanistan333\nAO🇦🇴244Angola333\nAL🇦🇱355Albania234\nAD🇦🇩376Andorra222\nAE🇦🇪971United Arab Emirates234\nAI🇦🇮1264Anguilla34\nAR🇦🇷54Argentina\nAM🇦🇲374Armenia233\nAG🇦🇬1268Antigua and Barbuda34\nAU🇦🇺61Australia333\nAS🇦🇸1684American Samoa34\nAT🇦🇹43Austria\nAW🇦🇼297Aruba34\nAZ🇦🇿994Azerbaijan2322\nBI🇧🇮257Burundi224\nBE🇧🇪32Belgium3222\nBJ🇧🇯229Benin233\nBF🇧🇫226Burkina Faso2222\nBD🇧🇩880Bangladesh\nBG🇧🇬359Bulgaria\nBH🇧🇭973Bahrain44\nBS🇧🇸1242Bahamas34\nBA🇧🇦387Bosnia and Herzegovina\nBY🇧🇾375Belarus2322\nBZ🇧🇿501Belize\nBO🇧🇴591Bolivia134\nBR🇧🇷55Brazil254\nBB🇧🇧1246Barbados34\nBM🇧🇲1441Bermuda34\nBN🇧🇳673Brunei34\nBQ🇧🇶599Bonaire, Sint Eustatius and Saba\nBT🇧🇹975Bhutan\nBW🇧🇼267Botswana233\nCF🇨🇫236Central African Republic2222\nCA🇨🇦1Canada334\nCH🇨🇭41Switzerland234\nCK🇨🇰682Cook Islands\nCL🇨🇱56Chile144\nCN🇨🇳86China344\nCI🇨🇮225Côte d\\`Ivoire233\nCM🇨🇲237Cameroon44\nCD🇨🇩243DR Congo234\nCG🇨🇬242Republic of the Congo234\nCO🇨🇴57Colombia334\nKM🇰🇲269Comoros34\nCV🇨🇻238Cape Verde34\nCR🇨🇷506Costa Rica\nCU🇨🇺53Cuba44\nCY🇨🇾357Cyprus44\nCW🇨🇼599Curaçao\nCZ🇨🇿420Czech Republic\nDE🇩🇪49Germany38\nDJ🇩🇯253Djibouti2222\nDM🇩🇲1767Dominica34\nDK🇩🇰45Denmark44\nDO🇩🇴1Dominican Republic334\nDZ🇩🇿213Algeria3222\nEC🇪🇨593Ecuador\nEG🇪🇬20Egypt234\nER🇪🇷291Eritrea133\nES🇪🇸34Spain333\nEE🇪🇪372Estonia\nET🇪🇹251Ethiopia234\nFI🇫🇮358Finland\nFJ🇫🇯679Fiji\nFK🇫🇰500Falkland Islands\nFM🇫🇲691Micronesia\nFO🇫🇴298Faroe Islands33\nFR🇫🇷33France12222\nGA🇬🇦241Gabon1222\nGB🇬🇧44United Kingdom46\nGE🇬🇪995Georgia\nGF🇬🇫594French Guiana\nGH🇬🇭233Ghana\nGI🇬🇮350Gibraltar44\nGL🇬🇱299Greenland33\nGN🇬🇳224Guinea333\nGM🇬🇲220Gambia34\nGP🇬🇵590Guadeloupe\nGU🇬🇺1671Guam34\nGW🇬🇼245Guinea-Bissau34\nGQ🇬🇶240Equatorial Guinea333\nGR🇬🇷30Greece244\nGD🇬🇩1473Grenada34\nGT🇬🇹502Guatemala134\nGY🇬🇾592Guyana\nHK🇭🇰852Hong Kong\nHN🇭🇳504Honduras44\nHR🇭🇷385Croatia\nHT🇭🇹509Haiti\nHU🇭🇺36Hungary234\nID🇮🇩62Indonesia\nIN🇮🇳91India55\nIO🇩🇬246Diego Garcia34\nIE🇮🇪353Ireland234\nIR🇮🇷98Iran334\nIQ🇮🇶964Iraq334\nIS🇮🇸354Iceland34\nIL🇮🇱972Israel234\nIT🇮🇹39Italy334\nJM🇯🇲1876Jamaica34\nJO🇯🇴962Jordan144\nJP🇯🇵81Japan244\nKZ🇰🇿7Kazakhstan3322\nKE🇰🇪254Kenya333\nKG🇰🇬996Kyrgyzstan\nKH🇰🇭855Cambodia\nKI🇰🇮686Kiribati\nKN🇰🇳1869Saint Kitts and Nevis34\nKR🇰🇷82South Korea\nKW🇰🇼965Kuwait44\nKY🇰🇾1345Cayman Islands34\nLA🇱🇦856Laos\nLB🇱🇧961Lebanon\nLR🇱🇷231Liberia\nLY🇱🇾218Libya234\nLC🇱🇨1758Saint Lucia34\nLI🇱🇮423Liechtenstein\nLK🇱🇰94Sri Lanka234\nLS🇱🇸266Lesotho233\nLT🇱🇹370Lithuania35\nLU🇱🇺352Luxembourg\nLV🇱🇻371Latvia35\nMA🇲🇦212Morocco234\nMC🇲🇨377Monaco44\nMD🇲🇩373Moldova233\nMG🇲🇬261Madagascar2232\nMP🇲🇵1670Northern Mariana Islands34\nMO🇲🇴853Macau\nMS🇲🇸1664Montserrat34\nMV🇲🇻960Maldives\nMX🇲🇽52Mexico\nMH🇲🇭692Marshall Islands\nMK🇲🇰389Macedonia\nML🇲🇱223Mali44\nMT🇲🇹356Malta2222\nMM🇲🇲95Myanmar\nME🇲🇪382Montenegro\nMN🇲🇳976Mongolia\nMZ🇲🇿258Mozambique234\nMQ🇲🇶596Martinique\nMR🇲🇷222Mauritania44\nMU🇲🇺230Mauritius\nMW🇲🇼265Malawi\nMY🇲🇾60Malaysia\nNA🇳🇦264Namibia234\nNC🇳🇨687New Caledonia6\nNE🇳🇪227Niger2222\nNF🇳🇫672Norfolk Island\nNG🇳🇬234Nigeria\nNI🇳🇮505Nicaragua44\nNL🇳🇱31Netherlands12222\nNO🇳🇴47Norway44\nNP🇳🇵977Nepal\nNU🇳🇺683Niue\nNR🇳🇷674Nauru\nNZ🇳🇿64New Zealand\nOM🇴🇲968Oman44\nPK🇵🇰92Pakistan334\nPA🇵🇦507Panama44\nPE🇵🇪51Peru333\nPF🇵🇫689French Polynesia\nPH🇵🇭63Philippines334\nPM🇵🇲508Saint Pierre and Miquelon\nPR🇵🇷1Puerto Rico334\nPS🇵🇸970Palestine324\nPW🇵🇼680Palau\nPG🇵🇬675Papua New Guinea\nPL🇵🇱48Poland333\nKP🇰🇵850North Korea\nPT🇵🇹351Portugal144\nPY🇵🇾595Paraguay333\nQA🇶🇦974Qatar\nRE🇷🇪262Réunion333\nRO🇷🇴40Romania333\nRU🇷🇺7Russia3322\nRW🇷🇼250Rwanda333\nSA🇸🇦966Saudi Arabia\nSD🇸🇩249Sudan234\nSN🇸🇳221Senegal234\nSG🇸🇬65Singapore44\nSH🇸🇭290Saint Helena23\nSH🇸🇭247Saint Helena4\nSB🇸🇧677Solomon Islands\nSL🇸🇱232Sierra Leone233\nSV🇸🇻503El Salvador44\nSM🇸🇲378San Marino334\nSO🇸🇴252Somalia233\nRS🇷🇸381Serbia234\nSS🇸🇸211South Sudan234\nST🇸🇹239São Tomé and Príncipe25\nSR🇸🇷597Suriname34\nSK🇸🇰421Slovakia\nSI🇸🇮386Slovenia\nSE🇸🇪46Sweden234\nSZ🇸🇿268Swaziland44\nSC🇸🇨248Seychelles1222\nSX🇸🇽1721Sint Maarten34\nSY🇸🇾963Syria\nTC🇹🇨1649Turks and Caicos Islands34\nTD🇹🇩235Chad2222\nTG🇹🇬228Togo233\nTH🇹🇭66Thailand144\nTJ🇹🇯992Tajikistan\nTK🇹🇰690Tokelau\nTM🇹🇲993Turkmenistan26\nTL🇹🇱670Timor-Leste\nTO🇹🇴676Tonga\nTT🇹🇹1868Trinidad and Tobago34\nTN🇹🇳216Tunisia233\nTR🇹🇷90Turkey334\nTV🇹🇻688Tuvalu\nTW🇹🇼886Taiwan\nTZ🇹🇿255Tanzania234\nUG🇺🇬256Uganda234\nUA🇺🇦380Ukraine2322\nUY🇺🇾598Uruguay44\nUS🇺🇸1United States334\nUZ🇺🇿998Uzbekistan27\nVA🇻🇦3Vatican City\nVC🇻🇨1784Saint Vincent and the Grenadines34\nVE🇻🇪58Venezuela334\nVG🇻🇬1284British Virgin Islands34\nVI🇻🇮1340US Virgin Islands34\nVN🇻🇳84Vietnam\nVU🇻🇺678Vanuatu\nWF🇼🇫681Wallis and Futuna\nWS🇼🇸685Samoa\nXK🇽🇰383Kosovo44\nYE🇾🇪967Yemen333\nZA🇿🇦27South Africa234\nZM🇿🇲260Zambia234\nZW🇿🇼263Zimbabwe234`;\n\nconst formatsCache: Record = {};\nexport const defaultPhoneNumberFormat = /(\\d{1,3})(\\d{1,3})?(\\d{1,3})?(\\d{1,3})?(\\d{1,3})?/;\n\nconst parsed = DATA\n .split('\\n')\n .map((str) => {\n const id = str.substr(0, 2);\n const flag = str.substr(2, 4);\n const code = `+${str.match(/\\d+/)![0]}`;\n const name = str.split(/\\d+/)[1];\n const format = str.match(/\\d+$/);\n const phoneFormat = getPhoneNumberFormat(format);\n\n return {\n id, flag, code, name, phoneFormat,\n };\n });\n\nfunction getPhoneNumberFormat(format: RegExpMatchArray | null) {\n if (!format) {\n return defaultPhoneNumberFormat;\n }\n\n const formatValue = format[0] as string;\n let phoneNumberFormat;\n\n if (!formatsCache[formatValue]) {\n const phoneNumberGroups = formatValue.split('').map(Number);\n phoneNumberFormat = phoneNumberGroups.reduce((result, count, i) => {\n return `${result}(\\\\d{1,${count}})${i > 0 ? '?' : ''}`;\n }, '');\n formatsCache[formatValue] = new RegExp(`${phoneNumberFormat}${'()?'.repeat(5 - phoneNumberGroups.length)}`);\n }\n\n return formatsCache[formatValue];\n}\n\nexport default parsed;\n","import useReducer, { StateReducer, Dispatch } from '../useReducer';\nimport countryList from '../../util/countries';\n\nexport type FormState = {\n streetLine1: string;\n streetLine2: string;\n city: string;\n state: string;\n countryIso2: string;\n postCode: string;\n fullName: string;\n email: string;\n phone: string;\n shipping: string;\n cardNumber: string;\n cardholder: string;\n expiry: string;\n cvv: string;\n billingCountry: string;\n billingZip: string;\n saveInfo: boolean;\n saveCredentials: boolean;\n formErrors: Record;\n};\n\nexport type FormActions = (\n 'changeAddress1' | 'changeAddress2' | 'changeCity' | 'changeState' | 'changeCountry' |\n 'changePostCode' | 'changeFullName' | 'changeEmail' | 'changePhone' | 'changeShipping' | 'updateUserInfo' |\n 'changeCardNumber' | 'changeCardholder' | 'changeExpiryDate' | 'changeCvvCode' | 'changeBillingCountry' |\n 'changeBillingZip' | 'changeSaveInfo' | 'changeSaveCredentials' | 'setFormErrors'\n);\nexport type FormEditDispatch = Dispatch;\n\nconst INITIAL_STATE: FormState = {\n streetLine1: '',\n streetLine2: '',\n city: '',\n state: '',\n countryIso2: '',\n postCode: '',\n fullName: '',\n email: '',\n phone: '',\n shipping: '',\n cardNumber: '',\n cardholder: '',\n expiry: '',\n cvv: '',\n billingCountry: '',\n billingZip: '',\n saveInfo: true,\n saveCredentials: false,\n formErrors: {},\n};\n\nconst reducer: StateReducer = (state, action) => {\n switch (action.type) {\n case 'changeAddress1':\n return {\n ...state,\n streetLine1: action.payload,\n formErrors: {\n ...state.formErrors,\n streetLine1: undefined,\n },\n };\n case 'changeAddress2':\n return {\n ...state,\n streetLine2: action.payload,\n formErrors: {\n ...state.formErrors,\n streetLine2: undefined,\n },\n };\n case 'changeCity':\n return {\n ...state,\n city: action.payload,\n formErrors: {\n ...state.formErrors,\n city: undefined,\n },\n };\n case 'changeState':\n return {\n ...state,\n state: action.payload,\n formErrors: {\n ...state.formErrors,\n state: undefined,\n },\n };\n case 'changeCountry':\n return {\n ...state,\n countryIso2: action.payload,\n billingCountry: getBillingCountry(action.payload),\n formErrors: {\n ...state.formErrors,\n countryIso2: undefined,\n },\n };\n case 'changePostCode':\n return {\n ...state,\n postCode: action.payload,\n formErrors: {\n ...state.formErrors,\n postCode: undefined,\n },\n };\n case 'changeFullName':\n return {\n ...state,\n fullName: action.payload,\n formErrors: {\n ...state.formErrors,\n fullName: undefined,\n },\n };\n case 'changeEmail':\n return {\n ...state,\n email: action.payload,\n formErrors: {\n ...state.formErrors,\n email: undefined,\n },\n };\n case 'changePhone':\n return {\n ...state,\n phone: action.payload,\n formErrors: {\n ...state.formErrors,\n phone: undefined,\n },\n };\n case 'changeShipping':\n return { ...state, shipping: action.payload };\n case 'changeCardNumber':\n return {\n ...state,\n cardNumber: action.payload,\n formErrors: {\n ...state.formErrors,\n cardNumber: undefined,\n },\n };\n case 'changeCardholder':\n return {\n ...state,\n cardholder: action.payload,\n formErrors: {\n ...state.formErrors,\n cardholder: undefined,\n },\n };\n case 'changeExpiryDate':\n return {\n ...state,\n expiry: action.payload,\n formErrors: {\n ...state.formErrors,\n expiry: undefined,\n },\n };\n case 'changeCvvCode':\n return {\n ...state,\n cvv: action.payload,\n formErrors: {\n ...state.formErrors,\n cvv: undefined,\n },\n };\n case 'changeBillingCountry':\n return {\n ...state,\n billingCountry: action.payload,\n formErrors: {\n ...state.formErrors,\n billingCountry: undefined,\n },\n };\n case 'changeBillingZip':\n return {\n ...state,\n billingZip: action.payload,\n formErrors: {\n ...state.formErrors,\n billingZip: undefined,\n },\n };\n case 'changeSaveInfo':\n return { ...state, saveInfo: action.payload };\n case 'changeSaveCredentials':\n return { ...state, saveCredentials: action.payload };\n case 'updateUserInfo':\n if (action.payload.countryIso2) {\n return {\n ...state,\n ...action.payload,\n billingCountry: getBillingCountry(action.payload.countryIso2),\n };\n }\n return { ...state, ...action.payload };\n case 'setFormErrors':\n return {\n ...state,\n formErrors: {\n ...state.formErrors,\n ...action.payload,\n },\n };\n default:\n return state;\n }\n};\n\nfunction getBillingCountry(countryCode: string) {\n const country = countryList.find(({ id }) => id === countryCode);\n return country ? country.name : '';\n}\n\nexport default () => {\n return useReducer(reducer, INITIAL_STATE);\n};\n","import { RefObject } from 'react';\n\nimport { IS_TOUCH_ENV } from '../util/environment';\nimport { fastRaf } from '../util/schedulers';\nimport { useEffect } from '../lib/teact/teact';\n\nconst DEFAULT_DURATION = 400;\n\nexport default function useFocusAfterAnimation(\n ref: RefObject, animationDuration = DEFAULT_DURATION,\n) {\n useEffect(() => {\n if (IS_TOUCH_ENV) {\n return;\n }\n\n setTimeout(() => {\n fastRaf(() => {\n if (ref.current) {\n ref.current.focus();\n }\n });\n }, animationDuration);\n }, [ref, animationDuration]);\n}\n","import { ChangeEvent, RefObject } from 'react';\nimport React, { FC, memo } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\ntype OwnProps = {\n id?: string;\n value?: string;\n label?: string;\n error?: string;\n ref?: RefObject;\n hasArrow?: boolean;\n placeholder?: string;\n onChange?: (e: ChangeEvent) => void;\n children: any;\n};\n\nconst Select: FC = (props) => {\n const {\n id,\n value,\n label,\n hasArrow,\n error,\n ref,\n placeholder,\n onChange,\n children,\n } = props;\n const labelText = error || label;\n const fullClassName = buildClassName(\n 'input-group',\n value && 'touched',\n error && 'error',\n labelText && 'with-label',\n hasArrow && 'with-arrow',\n 'input-group',\n );\n\n return (\n
\n \n {children}\n \n {labelText && id && (\n \n )}\n
\n );\n};\n\nexport default memo(Select);\n","import React, {\n FC, useRef, useCallback, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer';\nimport useFocusAfterAnimation from '../../hooks/useFocusAfterAnimation';\nimport useLang from '../../hooks/useLang';\nimport countryList from '../../util/countries';\n\nimport InputText from '../ui/InputText';\nimport Select from '../ui/Select';\nimport Checkbox from '../ui/Checkbox';\n\nimport './ShippingInfo.scss';\n\nexport type OwnProps = {\n state: FormState;\n needEmail: boolean;\n needPhone: boolean;\n needName: boolean;\n needAddress: boolean;\n dispatch: FormEditDispatch;\n};\n\nconst ShippingInfo: FC = ({\n state,\n needEmail,\n needPhone,\n needName,\n needAddress,\n dispatch,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const phoneRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const selectCountryRef = useRef(null);\n\n useEffect(() => {\n if (selectCountryRef.current\n && selectCountryRef.current.value !== state.countryIso2) {\n selectCountryRef.current.value = state.countryIso2;\n }\n }, [state.countryIso2]);\n\n const lang = useLang();\n\n useFocusAfterAnimation(inputRef);\n\n const handleAddress1Change = useCallback((e) => {\n dispatch({ type: 'changeAddress1', payload: e.target.value });\n }, [dispatch]);\n\n const handleAddress2Change = useCallback((e) => {\n dispatch({ type: 'changeAddress2', payload: e.target.value });\n }, [dispatch]);\n\n const handleCityChange = useCallback((e) => {\n dispatch({ type: 'changeCity', payload: e.target.value });\n }, [dispatch]);\n\n const handleStateChange = useCallback((e) => {\n dispatch({ type: 'changeState', payload: e.target.value });\n }, [dispatch]);\n\n const handleCountryChange = useCallback((e) => {\n dispatch({ type: 'changeCountry', payload: e.target.value });\n }, [dispatch]);\n\n const handlePostCodeChange = useCallback((e) => {\n dispatch({ type: 'changePostCode', payload: e.target.value });\n }, [dispatch]);\n\n const handleFullNameChange = useCallback((e) => {\n dispatch({ type: 'changeFullName', payload: e.target.value });\n }, [dispatch]);\n\n const handleEmailChange = useCallback((e) => {\n dispatch({ type: 'changeEmail', payload: e.target.value });\n }, [dispatch]);\n\n const handlePhoneChange = useCallback((e) => {\n let { value } = e.target;\n value = `+${value.replace(/\\D/g, '')}`;\n if (phoneRef.current) {\n phoneRef.current.value = value;\n }\n dispatch({ type: 'changePhone', payload: value });\n }, [dispatch]);\n\n const handleSaveInfoChange = useCallback((e) => {\n dispatch({ type: 'changeSaveInfo', payload: e.target.value });\n }, [dispatch]);\n\n const { formErrors } = state;\n return (\n
\n
\n {needAddress ? (\n
\n
{lang('PaymentShippingAddress')}
\n \n \n \n \n \n {countryList.map(({ name, id }) => (\n \n {name}\n \n ))}\n \n\n \n
\n ) : undefined}\n { needName || needEmail || needPhone ? (\n
{lang('PaymentShippingReceiver')}
\n ) : undefined }\n { needName && (\n \n ) }\n { needEmail && (\n \n ) }\n { needPhone && (\n \n ) }\n \n \n
\n );\n};\n\nexport default memo(ShippingInfo);\n","import React, {\n FC, useCallback, memo, useMemo, useEffect,\n} from '../../lib/teact/teact';\n\nimport { ShippingOption } from '../../types';\n\nimport { formatCurrency } from '../../util/formatCurrency';\nimport { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer';\nimport useLang from '../../hooks/useLang';\n\nimport RadioGroup from '../ui/RadioGroup';\n\nimport './Shipping.scss';\n\nexport type OwnProps = {\n state: FormState;\n shippingOptions: ShippingOption[];\n currency?: string;\n dispatch: FormEditDispatch;\n};\n\nconst Shipping: FC = ({\n state,\n shippingOptions,\n currency,\n dispatch,\n}) => {\n const lang = useLang();\n\n useEffect(() => {\n if (!shippingOptions || state.shipping) {\n return;\n }\n dispatch({ type: 'changeShipping', payload: shippingOptions[0].id });\n }, [shippingOptions, state.shipping, dispatch]);\n\n const handleShippingSelect = useCallback((value) => {\n dispatch({ type: 'changeShipping', payload: value });\n }, [dispatch]);\n\n const options = useMemo(() => (shippingOptions.map(({ id: value, title: label, amount }) => ({\n label,\n subLabel: formatCurrency(amount, currency, lang.code),\n value,\n }))), [shippingOptions, currency, lang.code]);\n\n return (\n
\n
\n

Select shipping method

\n \n \n
\n );\n};\n\nexport default memo(Shipping);\n","import React, {\n FC, memo,\n} from '../../lib/teact/teact';\n\nimport { LangCode, Price } from '../../types';\n\nimport { formatCurrency } from '../../util/formatCurrency';\nimport useLang from '../../hooks/useLang';\n\nimport './Checkout.scss';\n\nexport type OwnProps = {\n invoiceContent?: {\n title?: string;\n text?: string;\n photoUrl?: string;\n };\n checkoutInfo?: {\n paymentMethod?: string;\n paymentProvider?: string;\n shippingAddress?: string;\n name?: string;\n phone?: string;\n shippingMethod?: string;\n };\n prices?: Price[];\n totalPrice?: number;\n shippingPrices?: Price[];\n currency?: string;\n};\n\nconst Checkout: FC = ({\n invoiceContent,\n prices,\n shippingPrices,\n checkoutInfo,\n currency,\n totalPrice,\n}) => {\n const lang = useLang();\n\n const { photoUrl, title, text } = invoiceContent || {};\n const {\n paymentMethod,\n paymentProvider,\n shippingAddress,\n name,\n phone,\n shippingMethod,\n } = (checkoutInfo || {});\n\n return (\n
\n
\n {photoUrl && \"\"}\n
\n
{title}
\n

{text}

\n
\n
\n
\n { prices && prices.map((item) => (\n renderPaymentItem(lang.code, item.label, item.amount, currency)\n )) }\n { shippingPrices && shippingPrices.map((item) => (\n renderPaymentItem(lang.code, item.label, item.amount, currency)\n )) }\n { totalPrice !== undefined && (\n renderPaymentItem(lang.code, lang('Checkout.TotalAmount'), totalPrice, currency, true)\n ) }\n
\n
\n {paymentMethod && renderCheckoutItem('icon-card', paymentMethod, 'Payment method')}\n {paymentProvider && renderCheckoutItem('stripe-provider', paymentProvider, 'Payment provider')}\n {shippingAddress && renderCheckoutItem('icon-location', shippingAddress, 'Shipping address')}\n {name && renderCheckoutItem('icon-user', name, 'Name')}\n {phone && renderCheckoutItem('icon-phone', phone, 'Phone number')}\n {shippingMethod && renderCheckoutItem('icon-truck', shippingMethod, 'Shipping method')}\n
\n
\n );\n};\n\nfunction renderPaymentItem(\n langCode: LangCode | undefined, title: string, value: number, currency?: string, main = false,\n) {\n return (\n
\n
\n { title }\n
\n
\n {formatCurrency(value, currency, langCode)}\n
\n
\n );\n}\n\nfunction renderCheckoutItem(icon: string, title: string, data: string) {\n return (\n
\n \n
\n
\n { title }\n
\n

\n { data }\n

\n
\n
\n );\n}\n\nexport default memo(Checkout);\n","import React, {\n FC, memo, useCallback, useRef,\n} from '../../lib/teact/teact';\n\nimport { formatCardExpiry } from '../middle/helpers/inputFormatters';\n\nimport InputText from '../ui/InputText';\n\nconst MAX_FIELD_LENGTH = 5;\n\nexport type OwnProps = {\n value: string;\n error?: string;\n onChange: (value: string) => void;\n};\n\nconst ExpiryInput : FC = ({ value, error, onChange }) => {\n // eslint-disable-next-line no-null/no-null\n const expiryInputRef = useRef(null);\n\n const handleKeyDown = useCallback((e) => {\n if (e.key === 'Backspace' && value.charAt(value.length - 1) === '/') {\n const newValue = value.slice(0, value.length - 1);\n if (expiryInputRef.current) {\n expiryInputRef.current.value = newValue;\n }\n }\n }, [value]);\n\n const handleChange = useCallback((e) => {\n onChange(formatCardExpiry(e.target.value));\n }, [onChange]);\n\n return (\n \n );\n};\n\nexport default memo(ExpiryInput);\n","export function formatCardExpiry(input: string) {\n input = input.replace(/[^\\d]/g, '').slice(0, 4);\n const parts = input.match(/.{1,2}/g);\n if (parts?.[0] && Number(parts[0]) > 12) {\n parts[0] = '12';\n }\n if (parts?.[0] && parts[0].length === 2 && !parts[1]) {\n parts[1] = '';\n }\n return parts ? parts.join('/') : '';\n}\n\nexport function formatCardNumber(input: string) {\n input = input.replace(/[^\\d]/g, '');\n const parts = input.match(/.{1,4}/g);\n return parts ? parts.join(' ') : '';\n}\n","import React, {\n FC, memo, useCallback, useState, useRef, useEffect,\n} from '../../lib/teact/teact';\n\nimport useFocusAfterAnimation from '../../hooks/useFocusAfterAnimation';\nimport { formatCardNumber } from '../middle/helpers/inputFormatters';\nimport { detectCardType, CardType } from '../common/helpers/detectCardType';\n\nimport InputText from '../ui/InputText';\n\nimport './CardInput.scss';\n\n// @ts-ignore\nimport mastercardIconPath from '../../assets/mastercard.svg';\n// @ts-ignore\nimport visaIconPath from '../../assets/visa.svg';\n\nconst CARD_NUMBER_MAX_LENGTH = 23;\n\nexport type OwnProps = {\n value: string;\n error?: string;\n onChange: (value: string) => void;\n};\n\nconst CardInput : FC = ({ value, error, onChange }) => {\n // eslint-disable-next-line no-null/no-null\n const cardNumberRef = useRef(null);\n\n useFocusAfterAnimation(cardNumberRef);\n\n const [cardType, setCardType] = useState(CardType.Default);\n useEffect(() => {\n const newCardType = detectCardType(value);\n setCardType(newCardType);\n // eslint-disable-next-line\n }, []);\n\n const handleChange = useCallback((e) => {\n const newValue = formatCardNumber(e.target.value);\n const newCardType = detectCardType(e.target.value);\n setCardType(newCardType);\n onChange(newValue);\n if (cardNumberRef.current) {\n cardNumberRef.current.value = newValue;\n }\n }, [onChange, cardNumberRef]);\n\n const cardIcon = getCardIcon(cardType);\n\n return (\n
\n {cardIcon}\n \n
\n );\n};\n\nexport default memo(CardInput);\n\nfunction getCardIcon(cardType: CardType) {\n switch (cardType) {\n case CardType.Mastercard:\n return \"\";\n case CardType.Visa:\n return \"\";\n default:\n return undefined;\n }\n}\n","import React, {\n FC, useCallback, memo, useRef, useEffect,\n} from '../../lib/teact/teact';\n\nimport { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer';\nimport useLang from '../../hooks/useLang';\nimport countryList from '../../util/countries';\n\nimport InputText from '../ui/InputText';\nimport Checkbox from '../ui/Checkbox';\nimport Select from '../ui/Select';\nimport ExpiryInput from './ExpiryInput';\nimport CardInput from './CardInput';\n\nimport './PaymentInfo.scss';\n\nexport type OwnProps = {\n state: FormState;\n canSaveCredentials: boolean;\n needCardholderName?: boolean;\n needCountry?: boolean;\n needZip?: boolean;\n dispatch: FormEditDispatch;\n};\n\nconst PaymentInfo: FC = ({\n state,\n canSaveCredentials,\n needCardholderName,\n needCountry,\n needZip,\n dispatch,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const selectCountryRef = useRef(null);\n\n useEffect(() => {\n if (selectCountryRef.current\n && selectCountryRef.current.value !== state.billingCountry) {\n selectCountryRef.current.value = state.billingCountry;\n }\n }, [state.billingCountry]);\n\n const handleCardNumberChange = useCallback((value) => {\n dispatch({ type: 'changeCardNumber', payload: value });\n }, [dispatch]);\n\n const handleCardholderChange = useCallback((e) => {\n dispatch({ type: 'changeCardholder', payload: e.target.value.toUpperCase() });\n }, [dispatch]);\n\n const handleExpiryChange = useCallback((value) => {\n dispatch({ type: 'changeExpiryDate', payload: value });\n }, [dispatch]);\n\n const handleCvvChange = useCallback((e) => {\n dispatch({ type: 'changeCvvCode', payload: e.target.value });\n }, [dispatch]);\n\n const handleCountryChange = useCallback((e) => {\n dispatch({ type: 'changeBillingCountry', payload: e.target.value });\n }, [dispatch]);\n\n const handleBillingPostCodeChange = useCallback((e) => {\n dispatch({ type: 'changeBillingZip', payload: e.target.value });\n }, [dispatch]);\n\n const handleChangeSaveCredentials = useCallback((e) => {\n dispatch({ type: 'changeSaveCredentials', payload: e.target.value });\n }, [dispatch]);\n\n const lang = useLang();\n\n const { formErrors = {} } = state;\n\n return (\n
\n
\n
{lang('PaymentCardTitle')}
\n \n { needCardholderName && (\n \n )}\n
\n \n \n
\n { needCountry || needZip ? (\n
{lang('PaymentBillingAddress')}
\n ) : undefined }\n { needCountry && (\n \n {\n countryList.map(({ name }) => (\n \n {name}\n \n ))\n }\n \n ) }\n { needZip && (\n \n )}\n { canSaveCredentials && (\n \n ) }\n \n
\n );\n};\n\nexport default memo(PaymentInfo);\n","import React, {\n FC, memo, useCallback, useEffect, useMemo, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { PaymentStep, ShippingOption, Price } from '../../types';\n\nimport { pick } from '../../util/iteratees';\nimport { formatCurrency } from '../../util/formatCurrency';\nimport { detectCardTypeText } from '../common/helpers/detectCardType';\nimport usePaymentReducer, { FormState } from '../../hooks/reducers/usePaymentReducer';\nimport useLang from '../../hooks/useLang';\n\nimport ShippingInfo from './ShippingInfo';\nimport Shipping from './Shipping';\nimport Checkout from './Checkout';\nimport PaymentInfo from './PaymentInfo';\nimport Button from '../ui/Button';\nimport Modal from '../ui/Modal';\nimport Transition from '../ui/Transition';\nimport Spinner from '../ui/Spinner';\n\nimport './PaymentModal.scss';\n\nconst DEFAULT_PROVIDER = 'stripe';\n\nexport type OwnProps = {\n isOpen: boolean;\n onClose: () => void;\n};\n\ntype StateProps = {\n nameRequested?: boolean;\n shippingAddressRequested?: boolean;\n phoneRequested?: boolean;\n emailRequested?: boolean;\n flexible?: boolean;\n phoneToProvider?: boolean;\n emailToProvider?: boolean;\n currency?: string;\n prices?: Price[];\n isProviderError: boolean;\n needCardholderName?: boolean;\n needCountry?: boolean;\n needZip?: boolean;\n};\n\ntype GlobalStateProps = Pick;\n\ntype DispatchProps = Pick;\n\nconst Invoice: FC = ({\n isOpen,\n onClose,\n step,\n shippingOptions,\n savedInfo,\n canSaveCredentials,\n nameRequested,\n shippingAddressRequested,\n phoneRequested,\n emailRequested,\n phoneToProvider,\n emailToProvider,\n currency,\n passwordMissing,\n isProviderError,\n invoiceContent,\n nativeProvider,\n prices,\n needCardholderName,\n needCountry,\n needZip,\n error,\n validateRequestedInfo,\n sendPaymentForm,\n setPaymentStep,\n sendCredentialsInfo,\n clearPaymentError,\n}) => {\n const [paymentState, paymentDispatch] = usePaymentReducer();\n const [isLoading, setIsLoading] = useState(false);\n const lang = useLang();\n\n useEffect(() => {\n if (step || error) {\n setIsLoading(false);\n }\n }, [step, error]);\n\n useEffect(() => {\n if (error?.field) {\n paymentDispatch({\n type: 'setFormErrors',\n payload: {\n [error.field]: error.message,\n },\n });\n }\n }, [error, paymentDispatch]);\n\n useEffect(() => {\n if (savedInfo) {\n const {\n name: fullName, phone, email, shippingAddress,\n } = savedInfo;\n paymentDispatch({\n type: 'updateUserInfo',\n payload: {\n fullName,\n phone: phone && phone.charAt(0) !== '+'\n ? `+${phone}`\n : phone,\n email,\n ...(shippingAddress || {}),\n },\n });\n }\n }, [savedInfo, paymentDispatch]);\n\n const handleErrorModalClose = useCallback(() => {\n clearPaymentError();\n }, [clearPaymentError]);\n\n const totalPrice = useMemo(() => {\n if (step !== PaymentStep.Checkout) {\n return 0;\n }\n\n return getTotalPrice(prices, shippingOptions, paymentState.shipping);\n }, [step, paymentState.shipping, prices, shippingOptions]);\n\n const checkoutInfo = useMemo(() => {\n if (step !== PaymentStep.Checkout) {\n return undefined;\n }\n return getCheckoutInfo(paymentState, shippingOptions, nativeProvider || '');\n }, [step, paymentState, shippingOptions, nativeProvider]);\n\n function renderError() {\n if (!error) {\n return undefined;\n }\n return (\n \n

{error.description || 'Error'}

\n

{error.description || 'Error'}

\n \n {lang('OK')}\n \n
\n );\n }\n\n function renderModalContent(currentStep: PaymentStep) {\n switch (currentStep) {\n case PaymentStep.ShippingInfo:\n return (\n \n );\n case PaymentStep.Shipping:\n return (\n \n );\n case PaymentStep.PaymentInfo:\n return (\n \n );\n case PaymentStep.Checkout:\n return (\n \n );\n default:\n return undefined;\n }\n }\n\n const validateRequest = useCallback(() => {\n const { saveInfo } = paymentState;\n const requestInfo = getRequestInfo(paymentState);\n validateRequestedInfo({ requestInfo, saveInfo });\n }, [validateRequestedInfo, paymentState]);\n\n const sendCredentials = useCallback(() => {\n const credentials = getCredentials(paymentState);\n sendCredentialsInfo({\n credentials,\n });\n }, [sendCredentialsInfo, paymentState]);\n\n const sendForm = useCallback(() => {\n sendPaymentForm({\n shippingOptionId: paymentState.shipping,\n saveCredentials: paymentState.saveCredentials,\n });\n }, [sendPaymentForm, paymentState]);\n\n const setStep = useCallback((nextStep) => {\n setPaymentStep({ step: nextStep });\n }, [setPaymentStep]);\n\n const handleButtonClick = useCallback(() => {\n setIsLoading(true);\n switch (step) {\n case PaymentStep.ShippingInfo:\n return validateRequest();\n case PaymentStep.Shipping:\n return setStep(PaymentStep.PaymentInfo);\n case PaymentStep.PaymentInfo:\n return sendCredentials();\n case PaymentStep.Checkout:\n return sendForm();\n default:\n return () => {};\n }\n }, [step, validateRequest, setStep, sendCredentials, sendForm]);\n\n const modalHeader = useMemo(() => {\n switch (step) {\n case PaymentStep.ShippingInfo:\n return lang('PaymentShippingInfo');\n case PaymentStep.Shipping:\n return lang('PaymentShippingMethod');\n case PaymentStep.PaymentInfo:\n return lang('PaymentCardInfo');\n case PaymentStep.Checkout:\n return lang('PaymentCheckout');\n default:\n return '';\n }\n }, [step, lang]);\n\n const buttonText = useMemo(() => {\n switch (step) {\n case PaymentStep.Checkout:\n return lang('Checkout.PayPrice', formatCurrency(totalPrice, currency, lang.code));\n default:\n return lang('Next');\n }\n }, [step, lang, currency, totalPrice]);\n\n if (isProviderError) {\n return (\n \n

\n Sorry, Telegram WebZ doesn't support payments with this provider yet.
\n Please use one of our mobile apps to do this.\n

\n \n {lang('OK')}\n \n \n );\n }\n\n return (\n \n
\n \n \n \n

{modalHeader}

\n
\n {step !== undefined ? (\n \n {() => (\n
\n {renderModalContent(step)}\n
\n )}\n
\n ) : (\n
\n \n
\n )}\n
\n \n {buttonText}\n \n
\n {error && !error.field && renderError()}\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps & GlobalStateProps => {\n const {\n step,\n shippingOptions,\n savedInfo,\n canSaveCredentials,\n invoice,\n invoiceContent,\n nativeProvider,\n nativeParams,\n passwordMissing,\n error,\n } = global.payment;\n\n const isProviderError = Boolean(invoice && (!nativeProvider || nativeProvider !== DEFAULT_PROVIDER));\n const { needCardholderName, needCountry, needZip } = (nativeParams || {});\n const {\n nameRequested,\n phoneRequested,\n emailRequested,\n shippingAddressRequested,\n flexible,\n phoneToProvider,\n emailToProvider,\n currency,\n prices,\n } = (invoice || {});\n\n return {\n step,\n shippingOptions,\n savedInfo,\n canSaveCredentials,\n nativeProvider,\n passwordMissing,\n nameRequested,\n shippingAddressRequested,\n phoneRequested,\n emailRequested,\n flexible,\n phoneToProvider,\n emailToProvider,\n currency,\n prices,\n isProviderError,\n invoiceContent,\n needCardholderName,\n needCountry,\n needZip,\n error,\n };\n },\n (setGlobal, actions): DispatchProps => {\n return pick(actions, [\n 'validateRequestedInfo',\n 'sendPaymentForm',\n 'setPaymentStep',\n 'sendCredentialsInfo',\n 'clearPaymentError',\n ]);\n },\n)(Invoice));\n\nfunction findShippingOption(shippingOptions: ShippingOption[], optionId: string) {\n return shippingOptions.find(({ id }) => id === optionId);\n}\n\nfunction getShippingPrices(shippingOptions: ShippingOption[], shippingOption: string) {\n const option = findShippingOption(shippingOptions, shippingOption);\n return option?.prices;\n}\n\nfunction getTotalPrice(prices: Price[] = [], shippingOptions: ShippingOption[] | undefined, shippingOption: string) {\n const shippingPrices = shippingOptions\n ? getShippingPrices(shippingOptions, shippingOption)\n : [];\n let total = 0;\n const totalPrices = prices.concat(shippingPrices || []);\n total = totalPrices.reduce((acc, cur) => {\n return acc + cur.amount;\n }, total);\n return total;\n}\n\nfunction getCheckoutInfo(state: FormState, shippingOptions: ShippingOption[] | undefined, paymentProvider: string) {\n const cardTypeText = detectCardTypeText(state.cardNumber);\n const paymentMethod = `${cardTypeText} *${state.cardNumber.slice(-4)}`;\n const shippingAddress = state.streetLine1\n ? `${state.streetLine1}, ${state.city}, ${state.countryIso2}`\n : undefined;\n const { phone, fullName: name } = state;\n const shippingOption = shippingOptions ? findShippingOption(shippingOptions, state.shipping) : undefined;\n const shippingMethod = shippingOption?.title;\n return {\n paymentMethod,\n paymentProvider,\n shippingAddress,\n name,\n phone,\n shippingMethod,\n };\n}\n\nfunction getRequestInfo(paymentState: FormState) {\n const {\n streetLine1,\n streetLine2,\n city,\n state,\n countryIso2,\n postCode,\n fullName: name,\n phone,\n email,\n } = paymentState;\n\n const shippingAddress = {\n streetLine1,\n streetLine2,\n city,\n state,\n countryIso2,\n postCode,\n };\n\n return {\n name,\n phone,\n email,\n shippingAddress,\n };\n}\n\nfunction getCredentials(paymentState: FormState) {\n const {\n cardNumber, cardholder, expiry, cvv, billingCountry, billingZip,\n } = paymentState;\n const [expiryMonth, expiryYear] = expiry.split('/');\n const data = {\n cardNumber,\n cardholder,\n expiryMonth,\n expiryYear,\n cvv,\n country: billingCountry,\n zip: billingZip,\n };\n\n return {\n data,\n };\n}\n","import React, {\n FC, memo, useMemo,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { Price } from '../../types';\nimport { ApiShippingAddress } from '../../api/types';\n\nimport useLang from '../../hooks/useLang';\n\nimport Checkout from './Checkout';\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nimport './PaymentModal.scss';\n\nexport type OwnProps = {\n isOpen: boolean;\n onClose: () => void;\n};\n\ntype StateProps = {\n prices?: Price[];\n shippingPrices: any;\n totalAmount?: number;\n currency?: string;\n info?: {\n shippingAddress?: ApiShippingAddress;\n phone?: string;\n name?: string;\n };\n photoUrl?: string;\n text?: string;\n title?: string;\n credentialsTitle?: string;\n shippingMethod?: string;\n};\n\nconst ReceiptModal: FC = ({\n isOpen,\n onClose,\n prices,\n shippingPrices,\n totalAmount,\n currency,\n info,\n photoUrl,\n text,\n title,\n credentialsTitle,\n shippingMethod,\n}) => {\n const lang = useLang();\n const checkoutInfo = useMemo(() => {\n return getCheckoutInfo(credentialsTitle, info, shippingMethod);\n }, [info, shippingMethod, credentialsTitle]);\n\n return (\n \n
\n
\n \n \n \n

{lang('PaymentReceipt')}

\n
\n
\n \n
\n
\n \n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { receipt } = global.payment;\n const {\n currency,\n prices,\n info,\n totalAmount,\n credentialsTitle,\n shippingPrices,\n shippingMethod,\n photoUrl,\n text,\n title,\n } = (receipt || {});\n\n return {\n currency,\n prices,\n info,\n totalAmount,\n credentialsTitle,\n shippingPrices,\n shippingMethod,\n photoUrl,\n text,\n title,\n };\n },\n)(ReceiptModal));\n\nfunction getCheckoutInfo(paymentMethod?: string,\n info?:\n { phone?: string;\n name?: string;\n shippingAddress?: ApiShippingAddress;\n },\n shippingMethod?: string) {\n if (!info) {\n return { paymentMethod };\n }\n const { shippingAddress } = info;\n const fullAddress = shippingAddress?.streetLine1\n ? `${shippingAddress.streetLine1}, ${shippingAddress.city}, ${shippingAddress.countryIso2}`\n : undefined;\n const { phone, name } = info;\n return {\n paymentMethod,\n paymentProvider: 'Stripe',\n shippingAddress: fullAddress,\n name,\n phone,\n shippingMethod,\n };\n}\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { MIN_PASSWORD_LENGTH } from '../../config';\nimport { IS_TOUCH_ENV, IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\n\ntype OwnProps = {\n submitLabel?: string;\n error?: string;\n hint?: string;\n placeholder?: string;\n isLoading?: boolean;\n isPasswordVisible?: boolean;\n clearError: NoneToVoidFunction;\n onChangePasswordVisibility: (state: boolean) => void;\n onInputChange?: (password: string) => void;\n onSubmit: (password: string) => void;\n};\n\nconst FOCUS_DELAY_TIMEOUT_MS = IS_SINGLE_COLUMN_LAYOUT ? 550 : 400;\n\nconst PasswordForm: FC = ({\n isLoading = false,\n isPasswordVisible,\n error,\n hint,\n placeholder = 'Password',\n submitLabel = 'Next',\n clearError,\n onChangePasswordVisibility,\n onInputChange,\n onSubmit,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const lang = useLang();\n\n const [password, setPassword] = useState('');\n const [canSubmit, setCanSubmit] = useState(false);\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n setTimeout(() => {\n inputRef.current!.focus();\n }, FOCUS_DELAY_TIMEOUT_MS);\n }\n }, []);\n\n useEffect(() => {\n if (error) {\n requestAnimationFrame(() => {\n inputRef.current!.focus();\n inputRef.current!.select();\n });\n }\n }, [error]);\n\n function onPasswordChange(e: ChangeEvent) {\n if (error) {\n clearError();\n }\n\n const { target } = e;\n setPassword(target.value);\n setCanSubmit(target.value.length >= MIN_PASSWORD_LENGTH);\n if (onInputChange) {\n onInputChange(target.value);\n }\n }\n\n function togglePasswordVisibility() {\n onChangePasswordVisibility(!isPasswordVisible);\n }\n\n function handleSubmit(event: React.FormEvent) {\n event.preventDefault();\n\n if (isLoading) {\n return;\n }\n\n if (canSubmit) {\n onSubmit(password);\n }\n }\n\n return (\n
\n \n \n \n \n \n \n \n {canSubmit && (\n \n )}\n \n );\n};\n\nexport default memo(PasswordForm);\n","import React, {\n FC, useState, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\n\nimport { STICKER_SIZE_AUTH, STICKER_SIZE_AUTH_MOBILE, STICKER_SIZE_TWO_FA } from '../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport getAnimationData from './helpers/animatedAssets';\n\nimport AnimatedSticker from './AnimatedSticker';\n\nimport './PasswordMonkey.scss';\n\ntype OwnProps = {\n isPasswordVisible: boolean;\n isBig?: boolean;\n};\n\nconst PEEK_MONKEY_SHOW_DELAY = 2000;\nconst SEGMENT_COVER_EYES: [number, number] = [0, 50];\nconst SEGMENT_UNCOVER_EYE: [number, number] = [0, 20];\nconst SEGMENT_COVER_EYE: [number, number] = [20, 0];\nconst STICKER_SIZE = IS_SINGLE_COLUMN_LAYOUT ? STICKER_SIZE_AUTH_MOBILE : STICKER_SIZE_AUTH;\n\nconst PasswordMonkey: FC = ({ isPasswordVisible, isBig }) => {\n const [closeMonkeyData, setCloseMonkeyData] = useState>();\n const [peekMonkeyData, setPeekMonkeyData] = useState>();\n const [isFirstMonkeyLoaded, setIsFirstMonkeyLoaded] = useState(false);\n const [isPeekShown, setIsPeekShown] = useState(false);\n\n useEffect(() => {\n if (!closeMonkeyData) {\n getAnimationData('MonkeyClose').then(setCloseMonkeyData);\n } else {\n setTimeout(() => setIsPeekShown(true), PEEK_MONKEY_SHOW_DELAY);\n }\n }, [closeMonkeyData]);\n\n useEffect(() => {\n if (!peekMonkeyData) {\n getAnimationData('MonkeyPeek').then(setPeekMonkeyData);\n }\n }, [peekMonkeyData]);\n\n const handleFirstMonkeyLoad = useCallback(() => setIsFirstMonkeyLoaded(true), []);\n\n return (\n
\n {!isFirstMonkeyLoaded && (\n
\n )}\n {closeMonkeyData && (\n \n )}\n {peekMonkeyData && (\n \n )}\n
\n );\n};\n\nexport default memo(PasswordMonkey);\n","import { ApiMediaFormat } from '../../../api/types';\n\nimport * as mediaLoader from '../../../util/mediaLoader';\n\n// @ts-ignore\nimport MonkeyIdle from '../../../assets/TwoFactorSetupMonkeyIdle.tgs';\n// @ts-ignore\nimport MonkeyTracking from '../../../assets/TwoFactorSetupMonkeyTracking.tgs';\n// @ts-ignore\nimport MonkeyClose from '../../../assets/TwoFactorSetupMonkeyClose.tgs';\n// @ts-ignore\nimport MonkeyPeek from '../../../assets/TwoFactorSetupMonkeyPeek.tgs';\n// @ts-ignore\nimport FoldersAll from '../../../assets/FoldersAll.tgs';\n// @ts-ignore\nimport FoldersNew from '../../../assets/FoldersNew.tgs';\n// @ts-ignore\nimport DiscussionGroups from '../../../assets/DiscussionGroupsDucks.tgs';\n\nexport const ANIMATED_STICKERS_PATHS = {\n MonkeyIdle,\n MonkeyTracking,\n MonkeyClose,\n MonkeyPeek,\n FoldersAll,\n FoldersNew,\n DiscussionGroups,\n};\n\nexport default function getAnimationData(name: keyof typeof ANIMATED_STICKERS_PATHS) {\n const path = ANIMATED_STICKERS_PATHS[name].replace(window.location.origin, '');\n\n return mediaLoader.fetch(`file${path}`, ApiMediaFormat.Lottie);\n}\n","import React, {\n FC, useEffect, useState, memo,\n} from '../../lib/teact/teact';\n\nimport { DEBUG } from '../../config';\nimport { blobToFile, blobToDataUri } from '../../util/files';\nimport useLang from '../../hooks/useLang';\n\nimport Button from './Button';\nimport Modal from './Modal';\nimport Loading from './Loading';\n\nimport './CropModal.scss';\n\n// Change to 'base64' to get base64-encoded string\nconst cropperResultOptions: Croppie.ResultOptions & { type: 'blob' } = {\n type: 'blob',\n quality: 1,\n format: 'jpeg',\n circle: false,\n};\n\ntype ICroppie = typeof import('croppie');\nlet Croppie: ICroppie;\nlet croppiePromise: Promise<{ default: ICroppie }>;\n\nasync function ensureCroppie() {\n if (!croppiePromise) {\n croppiePromise = import('../../lib/croppie') as unknown as Promise<{ default: ICroppie }>;\n Croppie = (await croppiePromise).default;\n }\n\n return croppiePromise;\n}\n\nlet cropper: Croppie;\n\nasync function initCropper(imgFile: File) {\n try {\n const cropContainer = document.getElementById('avatar-crop');\n if (!cropContainer) {\n return;\n }\n\n const { offsetWidth, offsetHeight } = cropContainer;\n\n cropper = new Croppie(cropContainer, {\n enableZoom: true,\n boundary: {\n width: offsetWidth,\n height: offsetHeight,\n },\n viewport: {\n width: offsetWidth - 16,\n height: offsetHeight - 16,\n type: 'circle',\n },\n });\n\n const dataUri = await blobToDataUri(imgFile);\n await cropper.bind({ url: dataUri });\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n }\n}\n\ntype OwnProps = {\n file?: File;\n onChange: (file: File) => void;\n onClose: () => void;\n};\n\nconst CropModal: FC = ({ file, onChange, onClose }: OwnProps) => {\n const [isCroppieReady, setIsCroppieReady] = useState(false);\n\n useEffect(() => {\n if (!file) {\n return;\n }\n\n if (!isCroppieReady) {\n ensureCroppie().then(() => setIsCroppieReady(true));\n\n return;\n }\n\n initCropper(file);\n }, [file, isCroppieReady]);\n\n const lang = useLang();\n\n async function handleCropClick() {\n if (!cropper) {\n return;\n }\n\n const result: Blob | string = await cropper.result(cropperResultOptions);\n const croppedImg = typeof result === 'string' ? result : blobToFile(result, 'avatar.jpg');\n\n onChange(croppedImg);\n }\n\n return (\n \n {isCroppieReady ? (\n
\n ) : (\n \n )}\n \n \n \n \n );\n};\n\nexport default memo(CropModal);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useState, useEffect, memo,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport CropModal from './CropModal';\n\nimport './AvatarEditable.scss';\n\ninterface OwnProps {\n title?: string;\n disabled?: boolean;\n currentAvatarBlobUrl?: string;\n onChange: (file: File) => void;\n}\n\nconst AvatarEditable: FC = ({\n title = 'Change your profile picture',\n disabled,\n currentAvatarBlobUrl,\n onChange,\n}) => {\n const [selectedFile, setSelectedFile] = useState();\n const [croppedBlobUrl, setCroppedBlobUrl] = useState(currentAvatarBlobUrl);\n\n useEffect(() => {\n setCroppedBlobUrl(currentAvatarBlobUrl);\n }, [currentAvatarBlobUrl]);\n\n function handleSelectFile(event: ChangeEvent) {\n const target = event.target as HTMLInputElement;\n\n if (!target || !target.files || !target.files[0]) {\n return;\n }\n\n setSelectedFile(target.files[0]);\n target.value = '';\n }\n\n function handleAvatarCrop(croppedImg: File) {\n setSelectedFile(undefined);\n onChange(croppedImg);\n\n if (croppedBlobUrl) {\n URL.revokeObjectURL(croppedBlobUrl);\n }\n setCroppedBlobUrl(URL.createObjectURL(croppedImg));\n }\n\n function handleModalClose() {\n setSelectedFile(undefined);\n }\n\n const labelClassName = buildClassName(\n croppedBlobUrl && 'filled',\n disabled && 'disabled',\n );\n\n return (\n
\n \n \n \n {croppedBlobUrl && \"Avatar\"}\n \n \n
\n );\n};\n\nexport default memo(AvatarEditable);\n"],"names":["createGhost","source","origin","ghost","document","createElement","classList","add","img","Image","src","HTMLVideoElement","poster","appendChild","MediaViewerOrigin","profileInfo","querySelector","cloneNode","isMessageImageFullyVisible","container","imageEl","messageListElement","imgOffsetTop","offsetTop","closest","id","includes","parentElement","scrollTop","offsetHeight","applyStyles","element","styles","Object","assign","style","getNodes","message","containerSelector","mediaSelector","mediaEls","querySelectorAll","mediaEl","length","applyShape","firstChild","objectFit","withGlobal","global","chatId","messageId","isAvatar","sender","isChatPrivate","selectUser","selectChat","selectChatMessage","selectSender","setGlobal","actions","pick","closeMediaViewer","focusMessage","handleFocusMessage","useCallback","lang","useLang","isFromChat","senderTitle","getSenderTitle","className","onClick","Avatar","key","size","chat","user","dir","renderText","formatMediaDateTime","date","mediaData","isVideo","isZoomed","fileName","onCloseMediaViewer","onForward","onZoomToggle","isDownloadStarted","downloadProgress","handleDownloadClick","useMediaDownload","getMessageMediaHash","undefined","MenuButton","useMemo","onTrigger","isOpen","Button","round","color","ariaLabel","IS_SINGLE_COLUMN_LAYOUT","DropdownMenu","trigger","positionX","MenuItem","icon","Math","href","download","ProgressSpinner","progress","noCross","text","isHidden","isForVideo","isMultiline","setIsMultiline","useState","useEffect","footerContent","checkIsMultiline","height","clientHeight","REM","handleResize","throttle","window","addEventListener","removeEventListener","classNames","buildClassName","e","stopPropagation","prop","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","units","bytes","number","floor","log","toFixed","stopEvent","bufferedProgress","currentTime","duration","fileSize","isForceVisible","isForceMobileVersion","isPlayed","isFullscreenSupported","isFullscreen","onChangeFullscreen","onPlayPause","onSeek","isVisible","setVisibility","timeout","setTimeout","clearTimeout","body","remove","downloadedPercent","totalSize","percentagePlayed","percentageBuffered","min","max","step","type","onInput","value","renderSeekLine","ripple","formatMediaDuration","renderTime","formatFileSize","memo","url","isGif","posterData","posterSize","isMediaViewerOpen","noPlay","onClose","videoRef","useRef","setIsPlayed","IS_TOUCH_ENV","IS_IOS","setCurrentTime","isControlsVisible","setIsControlsVisible","setFullscreen","exitFullscreen","elRef","setIsFullscreen","Boolean","useLayoutEffect","listener","listenerEnter","listenerExit","video","current","PLATFORM_ENV","requestFullscreen","webkitRequestFullscreen","webkitEnterFullscreen","mozRequestFullScreen","mozCancelFullScreen","webkitCancelFullScreen","webkitExitFullscreen","useFullscreenStatus","isBuffered","bufferingHandlers","useBuffering","shouldRender","shouldRenderSpinner","transitionClassNames","spinnerClassNames","useShowTransition","shouldRenderPlayButton","playButtonClassNames","pause","safePlay","togglePlayState","play","useVideoCleanup","handleMouseOver","handleMouseOut","handleTimeUpdate","currentTarget","handleEnded","handleFullscreenChange","handleSeek","Number","target","toggleControls","togglePayingStateBySpace","preventDefault","wrapperStyle","width","videoStyle","onMouseOver","onMouseOut","ref","autoPlay","playsInline","loop","muted","onEnded","onDoubleClick","onTimeUpdate","join","square","isShown","onChangeZoom","prevIsShown","usePrevious","inputRef","zoomLevel","setZoomLevel","isSeeking","handleStartSeek","handleStopSeek","disabled","onChange","onMouseDown","onMouseUp","INITIAL_MATRIX","SCALE_VALUES","ZOOM_SAFE_AREA","children","noWrap","canPan","panDeltaX","panDeltaY","onPan","tunedZoomLevel","isDragging","setIsDragging","dragData","setDragData","dx","dy","x","y","matrixData","setMatrixData","panWrapperRef","panContainerRef","newZoomLevel","newPandx","newPandy","newMatrixData","areSortedArraysEqual","oldScale","wrapper","image","wrapperRect","getBoundingClientRect","imageRect","newImgWidth","newImgHeight","newImgX","newImgY","calculateSafeZoneOnZoom","transform","toString","newDragData","pageX","pageY","onMouseMove","deltaX","deltaY","getNewMatrixData","ANIMATION_DURATION","renderPhoto","blobUrl","imageSize","canDrag","alt","draggable","Spinner","threadId","avatarOwnerId","profilePhotoIndex","mediaViewer","animationLevel","settings","byKey","senderId","avatarOwner","chatMessages","collectionIds","selectScheduledMessage","selectScheduledMessages","selectChatMessages","selectOutlyingIds","selectListedIds","currentSearch","selectCurrentMediaSearch","foundIds","resultsByType","media","openMediaViewer","openForwardMenu","isFromSharedMedia","isFromSearch","photo","getMessagePhoto","getMessageVideo","webPagePhoto","getMessageWebPagePhoto","webPageVideo","getMessageWebPageVideo","isDocumentPhoto","isMessageDocumentPhoto","isDocumentVideo","isMessageDocumentVideo","isPhoto","isSingleSlide","messageIds","getChatMediaMessageIds","selectedMediaMessageIndex","indexOf","isFirst","isLast","animationKey","prevSenderId","slideAnimation","headerAnimation","isGhostAnimation","isFooterHidden","setIsFooterHidden","canPanZoomWrap","setCanPanZoomWrap","setIsZoomed","panDelta","setPanDelta","getMediaHash","isFull","photos","getChatAvatarHash","blobUrlPictogram","useMedia","ApiMediaFormat","previewMediaHash","blobUrlPreview","startsWith","fullMediaData","useMediaWithDownloadProgress","getMessageMediaFormat","localBlobUrl","bestImageData","thumbDataUri","useBlurSync","getMessageMediaThumbDataUri","videoSize","getMessageFileSize","getMessageFileName","dimensions","getMessageDocument","mediaSize","getPhotoFullDimensions","getVideoDimensions","AVATAR_FULL_DIMENSIONS","toggle","forceUpdate","useForceUpdate","mql","matchMedia","MEDIA_VIEWER_MEDIA_QUERY","addListener","removeListener","prevMessage","prevOrigin","prevAvatarOwner","prevBestImageData","dispatchHeavyAnimationEvent","ANIMATION_END_DELAY","textParts","renderMessageText","hasFooter","fromImage","windowWidth","windowSize","availableWidth","availableHeight","getMediaViewerAvailableDimensions","toWidth","toHeight","calculateDimensions","toLeft","toTop","topOffsetRem","matches","getTopOffset","top","fromTop","left","fromLeft","fromWidth","fromHeight","uncovered","realWidth","realHeight","srcWidth","srcHeight","uncover","fromTranslateX","fromTranslateY","fromScaleX","fromScaleY","requestAnimationFrame","clearShape","contains","removeChild","animateOpening","toImage","getElementById","targetTop","el","display","rect","windowHeight","isElementInViewport","shouldFadeOut","existingGhost","getElementsByClassName","transition","transformOrigin","opacity","animateClosing","timer","closeZoom","handleZoomToggle","handleZoomValue","level","canCloseZoom","close","handleFooterClick","handleForward","fromChatId","captureEscKeyListener","stopCurrentAudio","getMessageId","fromId","direction","index","selectPreviousMedia","selectNextMedia","handleKeyDown","shouldCloseOnVideo","captureEvents","excludedClosestSelector","onSwipe","SwipeDirection","handlePan","handleToggleFooterVisibility","renderSlide","isActive","calculateMediaViewerDimensions","renderSenderInfo","useHistoryBack","ShowTransition","isRtl","Transition","activeKey","name","chats","byId","chatsById","listIds","orderedPinnedIds","currentUserId","pinnedIds","active","activeListIds","archivedListIds","archived","setForwardChatId","exitForwardMode","loadMoreChats","filter","setFilter","focus","blur","chatIds","priorityIds","unique","sortChatIds","getCanPostInChat","MAIN_THREAD_ID","searchWords","getChatTitle","viewportIds","getMore","useInfiniteScroll","handleFilterChange","containerRef","useKeyboardListNavigation","modalHeader","InputText","onKeyDown","placeholder","Modal","header","InfiniteScroll","items","onLoadMore","noScrollRestore","map","ListItem","PrivateChatInfo","status","userId","GroupChatInfo","Loading","getErrorHeader","error","isSlowMode","hasErrorKey","dialogs","dismissDialog","acceptInviteConfirmation","dialog","invite","hash","title","participantsCount","isChannel","participantsText","joinText","isText","renderInvite","getReadableErrorText","notifications","dismissNotification","localId","Notification","onDismiss","toggleSafeLinkModal","handleOpen","open","handleDismiss","renderingUrl","useCurrentOrPrev","ConfirmDialog","confirmLabel","confirmHandler","WEEKDAY_LETTERS","isDisabledDay","year","month","day","minDate","maxDate","selectedDay","Date","fixedMinDate","getFullYear","getMonth","getDate","fixedMaxDate","formatInputTime","String","padStart","formatDay","selectedAt","maxAt","isFutureMode","isPastMode","withTimePicker","submitButtonLabel","secondButtonLabel","onSubmit","onSecondButtonClick","now","defaultSelectedDate","prevIsOpen","isTimeInputFocused","markTimeInputAsFocused","unmarkTimeInputAsFocused","useFlag","selectedDate","setSelectedDate","currentMonthAndYear","setCurrentMonthAndYear","selectedHours","setSelectedHours","getHours","selectedMinutes","setSelectedMinutes","getMinutes","currentYear","currentMonth","getTime","shouldDisableNextMonth","shouldDisablePrevMonth","prevMonthGrid","currentMonthGrid","nextMonthGrid","setDate","setMonth","setFullYear","firstDay","getDay","totalDaysInPrevMonth","i","push","gridDate","lastRowDaysCount","buildCalendarGrid","handleChangeHours","replace","hours","setHours","hoursStr","handleChangeMinutes","minutes","setMinutes","minutesStr","d","dateCopy","role","tabIndex","handleDateSelect","inputMode","onFocus","onBlur","formatDateToString","code","formatTime","formatSubmitLabel","historyCalendarSelectedAt","searchMessagesByDate","closeHistoryCalendar","handleJumpToDate","timestamp","valueOf","isSchedule","selectCurrentMessageList","canDeleteForAll","selectAllowedMessageActions","contactName","getUserFirstOrLastName","getPrivateChatUserId","willDeleteForCurrentUserOnly","isChatBasicGroup","willDeleteForAll","isChatSuperGroup","album","deleteMessages","deleteScheduledMessages","handleDeleteMessageForAll","messages","shouldDeleteForAll","handleDeleteMessageForSelf","onEnter","isPrivateChat","isChatWithSelf","selectIsChatWithSelf","isChatChannel","isGroup","isSuperGroup","canPinForAll","pinMessage","handlePinMessageForAll","isUnpin","handlePinMessage","isOneSide","isSilent","pinnedMessagesCount","onUnpin","selectedMessageIds","selectedMessages","selectCanDeleteSelectedMessages","selectCurrentChat","exitMessageSelectMode","reportMessages","selectedReason","setSelectedReason","description","setDescription","handleReport","reason","handleSelectReason","handleDescriptionChange","REPORT_OPTIONS","label","RadioGroup","options","selected","messageListType","canDelete","canReport","selectCanReportSelectedMessages","selectedMessagesCount","selectSelectedMessagesCount","canDeleteMessages","canReportMessages","canPost","openForwardMenuForSelectedMessages","isDeleteModalOpen","openDeleteModal","closeDeleteModal","isReportModalOpen","openReportModal","closeReportModal","captureKeyboardListeners","onBackspace","onDelete","onEsc","prevSelectedMessagesCount","renderingSelectedMessagesCount","formattedMessagesCount","destructive","onSelect","buttonRef","activeElement","privateChatUserId","privateChatUser","isPinned","selectIsChatPinned","isMuted","selectIsChatMuted","selectNotifySettings","selectNotifyExceptions","withUsername","contextActions","useChatContextActions","handleDelete","handleClick","useSelectWithEnter","avatarSize","DeleteChatModal","runThrottled","cb","userIds","topUserIds","topPeers","usersById","users","recentlyFoundChatIds","globalSearch","onReset","loadTopUsers","loadContactList","openChat","addRecentlyFoundChatId","clearRecentlyFoundChats","topUsersRef","useHorizontalScroll","shouldReplaceHistory","lastSyncTime","searchQuery","mediaThumbnail","mediaBlobUrl","isRoundVideo","getMessageRoundVideo","withOnlineStatus","isSavedMessages","isSelf","isVerified","VerifiedIcon","Link","formatPastTimeShort","getMessageSummaryText","highlight","renderMessageSummary","searchDate","suggestions","match","suggestion","currentDate","latestYear","getSuggestionsFromDate","localContactIds","contactList","fetchingStatus","globalResults","localResults","globalChatIds","globalUserIds","localChatIds","localUserIds","byChatId","globalMessagesByChatId","dateSearchQuery","onSearchDateSelect","searchMessagesGlobal","setGlobalSearchChatId","shouldShowMoreLocal","setShouldShowMoreLocal","shouldShowMoreGlobal","setShouldShowMoreGlobal","handleLoadMore","LoadMoreDirection","query","handleChatClick","handlePickerItemClick","MEMO_EMPTY_ARRAY","foundContactIds","fullName","getUserFullName","username","foundMessages","split","sort","a","b","handleClickShowMoreLocal","handleClickShowMoreGlobal","nothingFound","noScrollRestoreOnTop","noFastList","NothingFound","PickerSelectedItem","chatOrUserId","clickArg","createMapStateToProps","props","currentType","isVoice","theme","selectTheme","isLoading","searchChatId","CURRENT_TYPE","handleSelectMedia","canRenderContents","useAsyncRendering","SLIDE_TRANSITION_DURATION","isMediaGrid","isMessageList","itemSelector","Media","idPrefix","getSenderName","senderName","isChatGroup","handleMessageFocus","shouldDrawDateDivider","toYearMonth","formatMonthAndYear","WebLink","onMessageClick","Document","withDate","datetime","smaller","onDateClick","openAudioPlayer","handlePlayAudio","Audio","onPlay","TABS","GlobalSearchContent","CHAT_TABS","slice","TRANSITION_RENDER_COUNT","keys","currentContent","setGlobalSearchContent","setGlobalSearchDate","activeTab","setActiveTab","parseDateString","handleSwitchTab","tab","content","handleSearchDateSelect","TabList","tabs","onSwitchTab","renderCount","INITIAL_STATE","currentPassword","password","hint","email","twoFaReducer","state","action","payload","currentScreen","editedFolderId","onSaveFilter","signOut","deleteChatFolder","onScreenSelect","isSignOutDialogOpen","setIsSignOutDialogOpen","isDeleteFolderDialogOpen","setIsDeleteFolderDialogOpen","openSignOutConfirmation","closeSignOutConfirmation","openDeleteFolderConfirmation","closeDeleteFolderConfirmation","handleSignOutMessage","handleDeleteFolderMessage","SettingsMenuButton","SettingsScreens","renderHeaderContent","confirmIsDestructive","currentUser","loadProfilePhotos","profileId","ProfileInfo","forceShowSelf","ChatExtra","LINK_PREFIX","LINK_PREFIX_REGEX","USERNAME_REGEX","runDebouncedForCheckUsername","debounce","currentUsername","asLink","isUsernameAvailable","checkUsername","setUsername","langPrefix","usernameSuccess","usernameError","test","handleUsernameChange","newUsername","trim","isValid","isUsernameValid","success","readOnly","ERROR_FIRST_NAME_MISSING","ERROR_BIO_TOO_LONG","profileEdit","firstName","currentFirstName","lastName","currentLastName","fullInfo","bio","currentBio","currentAvatarHash","loadCurrentUser","updateProfile","isUsernameTouched","setIsUsernameTouched","isProfileFieldsTouched","setIsProfileFieldsTouched","setError","setPhoto","setFirstName","setLastName","setBio","currentAvatarBlobUrl","ProfileEditProgress","isUsernameError","isSaveButtonShown","handlePhotoChange","newPhoto","handleFirstNameChange","handleLastNameChange","handleBioChange","handleProfileSave","trimmedFirstName","trimmedLastName","trimmedBio","AvatarEditable","UsernameInput","FloatingActionButton","runThrottledForLoadRecommended","orderedIds","orderedFolderIds","foldersById","recommended","recommendedChatFolders","chatFolders","notifySettings","notifyExceptions","onCreateFolder","onEditFolder","loadRecommendedChatFolders","addChatFolder","showDialog","animationData","setAnimationData","isAnimationLoaded","setIsAnimationLoaded","handleAnimationLoad","getAnimationData","then","handleCreateFolder","data","userFolders","folder","subtitle","getFolderDescriptionText","handleCreateFolderFromRecommended","AnimatedSticker","STICKER_SIZE_FOLDER_SETTINGS","noLoop","onLoad","pill","fluid","narrow","multiline","count","itemName","itemPluralName","ERROR_NO_TITLE","ERROR_NO_CHATS","loadedActiveChatIds","loadedArchivedChatIds","dispatch","onAddIncludedChats","onAddExcludedChats","onBack","editChatFolder","isIncludedChatsListExpanded","setIsIncludedChatsListExpanded","isExcludedChatsListExpanded","setIsExcludedChatsListExpanded","selectedChatIds","includedChatIds","selectedChatTypes","includedChatTypes","selectChatFilters","excludedChatIds","excludedChatTypes","folderId","visibleIncludedChatIds","visibleExcludedChatIds","allLoadedChatsSet","Set","loadedIncludedChatIds","findIntersectionWithSet","loadedExcludedChatIds","listType","renderChats","mode","visibleChatIds","isExpanded","leftChatsCount","clickHandler","chatType","INCLUDED_CHAT_TYPES","typeKey","EXCLUDED_CHAT_TYPES","inactive","renderChatType","event","isTouched","folderUpdate","selectedIds","filterValue","onSelectedIdsChange","onSelectedChatTypesChange","onFilterChange","chatTypes","shouldMinimize","hasMaxChats","handleItemClick","newSelectedIds","splice","handleChatTypeClick","newSelectedChatTypes","selectedType","find","isMinimized","canClose","Checkbox","checked","isSelected","withChatType","archivedPinnedIds","chatFilter","activeChatArrays","prepareChatList","archivedChatArrays","pinnedChats","otherChats","displayedIds","newFilter","handleSelectedIdsChange","ids","includeFilters","excludeFilters","handleSelectedChatTypesChange","newFilters","forEach","shownScreen","handleReset","handleEditFolder","handleAddIncludedChats","handleAddExcludedChats","range","handleChange","trackWidth","possibleValuesLength","option","STICKER_SIZE_PICKER_HEADER","stickerSet","observeIntersection","isIntersecting","useIsIntersecting","mediaHash","lottieData","shouldRenderFullMedia","useTransitionForMedia","getFirstLetters","hasThumbnail","stickers","firstSticker","isAnimated","STICKER_SIZE_GENERAL_SETTINGS","StickerButton","sticker","ANIMATION_LEVEL_OPTIONS","stickerSetIds","added","setIds","stickerSetsById","setsById","messageTextSize","messageSendKeyCombo","shouldAutoDownloadMediaFromContacts","shouldAutoDownloadMediaInPrivateChats","shouldAutoDownloadMediaInGroups","shouldAutoDownloadMediaInChannels","shouldAutoPlayGifs","shouldAutoPlayVideos","shouldSuggestStickers","shouldLoopStickers","setSettingOption","loadStickerSets","loadAddedStickers","stickerSettingsRef","observe","observeIntersectionForCovers","useIntersectionObserver","rootRef","isModalOpen","openModal","closeModal","setSticker","KEYBOARD_SEND_OPTIONS","subLabel","IS_MAC_OS","handleAnimationLevelChange","newLevel","_","handleMessageTextSizeChange","newSize","documentElement","setProperty","setAttribute","handleStickerSetClick","stickerSets","installedDate","onCheck","isChecked","fromSticker","fileSelector","openSystemFilesDialog","accept","callback","noMultiple","removeAttribute","onchange","click","hex2rgb","param","parseInt","substring","rgb2hex","p0","p1","p2","rgb2hsb","r","g","h","s","v","hsb2rgb","f","p","q","t","getPatternColor","rgbColor","hue","saturation","wallpaper","slug","localMediaHash","previewBlobUrl","thumbRef","useCanvasBlur","thumbnail","dataUri","shouldRenderThumb","isDownloadAllowed","setIsDownloadAllowed","fullMedia","wasDownloadDisabled","UPLOADING_WALLPAPER_SLUG","cacheKeyRef","handleSelect","blob","fetchBlob","cacheApi","save","CUSTOM_BG_CACHE_NAME","isAllowed","background","isBlurred","themes","loadedWallpapers","loadWallpapers","uploadWallpaper","setThemeSettings","themeRef","handleFileSelect","files","handleUploadWallpaper","handleSetColor","handleResetToDefault","backgroundColor","patternColor","DARK_THEME_PATTERN_COLOR","DEFAULT_PATTERN_COLOR","handleWallPaperSelect","currentWallpaper","async","defaultRGB","rgb","canvas","context","getContext","preloadImage","naturalHeight","naturalWidth","offsetWidth","drawImage","getImageData","blockSize","getAverageColor","handleWallPaperBlurChange","isUploading","DEFAULT_HSB","PREDEFINED_COLORS","hsb2positions","hsb","rects","colorPosition","colorRect","huePosition","hueRect","positions2hsb","colorPickerRef","huePickerRef","isFirstRunRef","setHsb","getInitialHsb","hsbRef","markIsDragging","unmarkIsDragging","rgbInput","setRgbInput","hexInput","setHexInput","rectsRef","colorCtxRef","offsetLeft","handleColorDrag","handleHueDrag","onCapture","onDrag","onRelease","selectorToPreventScroll","withCursor","hex","hueHex","w","ctx","imgData","createImageData","pixels","col","perY","st","ed","perX","putImageData","drawColor","drawHue","handleRgbChange","rgbValue","channel","handleHexChange","hexValue","handlePredefinedColorClick","dataset","hasPrivateChatsNotifications","hasPrivateChatsMessagePreview","hasGroupNotifications","hasGroupMessagePreview","hasBroadcastNotifications","hasBroadcastMessagePreview","hasContactJoinedNotifications","hasWebNotifications","hasPushNotifications","notificationSoundVolume","loadNotificationSettings","updateContactSignUpNotification","updateNotificationSettings","updateWebNotificationSettings","handleSettingsChange","peerType","setting","currentIsSilent","currentShouldShowPreviews","shouldShowPreviews","handleContactNotificationChange","volume","hasPassword","isSensitiveEnabled","canChangeSensitive","privacy","blocked","activeSessions","blockedCount","totalCount","sessionsCount","visibilityPrivacyPhoneNumber","phoneNumber","visibility","visibilityPrivacyLastSeen","lastSeen","visibilityPrivacyProfilePhoto","profilePhoto","visibilityPrivacyForwarding","forwards","visibilityPrivacyGroupChats","chatInvite","loadPrivacySettings","loadBlockedContacts","loadAuthorizations","loadContentSettings","updateContentSettings","getVisibilityValue","languages","language","loadLanguages","selectedLanguage","setSelectedLanguage","markIsLoading","unmarkIsLoading","langCode","setLanguage","currentLangCode","navigator","toLowerCase","shortLangCode","substr","nativeName","buildOptions","loadingOption","getPrivacyKey","screen","privacySettings","allowUserIds","allowChatIds","blockUserIds","blockChatIds","setPrivacyVisibility","visibilityOptions","exceptionLists","shouldShowDenied","shouldShowAllowed","privacyKey","headerText","descriptionText","allowedContactsScreen","deniedContactsScreen","allowedCount","reduce","result","membersCount","blockCount","handleVisibilityChange","getLocation","session","region","country","getDeviceEnvironment","deviceModel","platform","systemVersion","terminateAuthorization","terminateAllAuthorizations","isConfirmTerminateAllDialogOpen","openConfirmTerminateAllDialog","closeConfirmTerminateAllDialog","handleTerminateSessionClick","handleTerminateAllSessions","currentSession","isCurrent","otherSessions","appName","ip","sessions","handler","dateActive","chatsByIds","usersByIds","countryList","phoneCodes","phoneCodeList","blockedIds","unblockContact","handleUnblockClick","contactId","viewportOffset","isPrivate","CHAT_HEIGHT_PX","formatPhoneNumberWithCode","renderContact","animatedEmoji","selectAnimatedEmoji","AnimatedEmoji","expectedPassword","submitLabel","clearError","validationError","setValidationError","shouldShowPassword","setShouldShowPassword","handleSubmit","newPassword","handleClearError","PasswordMonkey","isBig","isPasswordVisible","PasswordForm","onChangePasswordVisibility","onStart","FOCUS_DELAY_TIMEOUT_MS","shouldConfirm","setValue","isConfirmShown","markIsConfirmShown","unmarkIsConfirmShown","codeLength","twoFaSettings","waitingEmailCodeLength","newValue","updatePassword","checkPassword","clearTwoFaError","updateRecoveryEmail","provideTwoFaEmailCode","clearPassword","handleStartWizard","handleNewPassword","handleNewPasswordConfirm","handleNewPasswordHint","handleNewPasswordEmail","onSuccess","handleChangePasswordCurrent","handleChangePasswordNew","handleChangePasswordConfirm","handleChangePasswordHint","handleTurnOff","handleRecoveryEmailCurrentPassword","handleRecoveryEmail","handleEmailCode","getCurrentPrivacySettings","isAllowList","setPrivacySettings","selectedContactIds","setSearchQuery","isSubmitShown","setIsSubmitShown","newSelectedContactIds","setNewSelectedContactIds","handleSelectedContactIdsChange","contactsIds","Picker","itemIds","filterPlaceholder","searchInputId","TWO_FA_SCREENS","FOLDERS_SCREENS","PRIVACY_SCREENS","PRIVACY_PHONE_NUMBER_SCREENS","PRIVACY_LAST_SEEN_PHONE_SCREENS","PRIVACY_PROFILE_PHOTO_SCREENS","PRIVACY_FORWARDING_SCREENS","PRIVACY_GROUP_CHATS_SCREENS","foldersState","foldersDispatch","shouldSkipTransition","twoFaState","twoFaDispatch","useReducer","handleSaveFilter","renderCurrentSection","isScreenActive","isFrom","currentKey","privacyAllowScreens","isTwoFaScreen","isFoldersScreen","isPrivacyScreen","values","SettingsGeneralBackgroundColor","renderCurrentSectionContent","LAYERS_ANIMATION_NAME","contactIds","serverTimeOffset","resultIds","sortUserIds","isSearching","selectedMemberIds","onSelectedMemberIdsChange","onNextStep","setGlobalSearchQuery","isUserBot","canBeInvitedToGroup","handleNextStep","creationProgress","creationError","chatCreation","memberIds","createGroupChat","createChannel","setTitle","about","setAbout","chatTitleEmptyError","channelTitleEmptyError","chatTooManyUsersError","ChatCreationProgress","handleTitleChange","handleCreateGroup","handleCreateChannel","renderedError","RENDER_COUNT","LeftColumnContent","onContentChange","newChatMemberIds","setNewChatMemberIds","isStepActive","ChatList","folderType","IGNORED_KEYS","Down","ArrowDown","Up","ArrowUp","Left","ArrowLeft","Right","ArrowRight","PageUp","PageDown","End","Home","Tab","preventDefaultForScrollKeys","HTMLElement","tagName","getAttribute","isTextBox","disableScrolling","passive","ontouchmove","onkeydown","enableScrolling","getCopyLabel","hasSelection","anchor","canSendNow","canReschedule","canReply","canEdit","canPin","canUnpin","canForward","canFaveSticker","canUnfaveSticker","canCopy","canCopyLink","canSelect","onReply","onEdit","onPin","onReport","onFaveSticker","onUnfaveSticker","onSend","onReschedule","onCloseAnimationEnd","onCopyLink","copyOptions","afterEffect","getMessageText","canImageBeCopied","hasMessageLocalBlobUrl","CLIPBOARD_ITEM_SUPPORTED","selection","getSelection","Promise","resolve","mediaLoader","copyImageToClipboard","anchorNode","parentNode","clipboardText","copyTextToClipboard","getMessageCopyOptions","getTriggerElement","getRootElement","getMenuElement","positionY","useContextMenuPosition","Menu","noOptions","isScheduled","chatUsername","setReplyingToId","setEditingId","faveSticker","unfaveSticker","toggleMessageSelection","sendScheduledMessages","rescheduleMessage","isMenuOpen","setIsMenuOpen","setIsDeleteModalOpen","setIsReportModalOpen","isPinModalOpen","setIsPinModalOpen","isCalendarOpen","openCalendar","closeCalendar","closeMenu","closePinModal","handleCloseCalendar","handleReply","handleEdit","handlePin","handleUnpin","handleFaveSticker","handleUnfaveSticker","handleSelectMessage","params","childMessageIds","withShift","handleScheduledMessageSend","handleOpenCalendar","handleRescheduleMessage","scheduledAt","handleCopyLink","abs","reportMessageIds","scheduledMaxDate","getDayStartAt","stickerSetShortName","selectStickerSet","stickerSetId","selectStickerSetByShortName","loadStickers","toggleStickerSet","sendMessage","throttleMs","isDisabled","stickerSetAccessHash","isPreloadedGlobally","handleButtonClick","hasCloseButton","STICKER_SIZE_MODAL","isRestricted","canDeleteChat","getCanDeleteChat","canStartBot","canRestartBot","canSubscribe","canSearch","canMute","canLeave","onSubscribeChannel","onSearchClick","updateChatMutedState","enterMessageSelectMode","sendBotCommand","restartBot","handleStartBot","command","handleRestartBot","handleToggleMuteClick","handleSubscribe","handleSearch","handleSelectMessages","Portal","runDebouncedForSearch","results","selectCurrentTextSearch","isHistoryCalendarOpen","setLocalTextSearchQuery","searchTextMessagesLocal","closeLocalTextSearch","openHistoryCalendar","focusedIndex","setFocusedIndex","visualViewport","mainEl","pageTop","Array","from","input","div","contentEditable","handleMessageSearchQueryChange","newQuery","handleUp","newFocusIndex","handleDown","SearchInput","findInViewport","selectorOrElements","margin","isDense","shouldContainBottom","isHorizontal","viewportY1","viewportY2","allElements","visibleIndexes","isFound","y1","y2","setTooltipItemVisible","selector","first","isFullyVisible","position","fastSmoothScroll","useKeyboardNavigation","shouldRemoveSelectionOnReset","noArrowNavigation","shouldSelectOnTab","selectedItemIndex","setSelectedItemIndex","getSelectedIndex","newIndex","cycleRestrict","handleArrowKey","handleItemSelect","item","onUp","onDown","onLeft","onRight","onTab","onInsertUserName","filteredUsers","handleUserSelect","forceFocus","handleSelectMention","member","selectedMentionIndex","prevChatMembers","renderedChatMembers","attachments","caption","isReady","groupChatMembers","recentEmojis","baseEmojiKeywords","emojiKeywords","addRecentEmoji","onCaptionUpdate","onFileAppend","onClear","hideTimeoutRef","prevAttachments","renderingAttachments","isHovered","markHovered","unmarkHovered","isQuick","every","quick","isMentionTooltipOpen","closeMentionTooltip","insertMention","mentionFilteredUsers","useMentionTooltip","EDITABLE_INPUT_MODAL_ID","isEmojiTooltipOpen","closeEmojiTooltip","filteredEmojis","insertEmoji","useEmojiTooltip","sendAttachments","handleFilesDrop","dataTransfer","newFiles","file","CONTENT_TYPES_FOR_QUICK_UPLOAD","areAllPhotos","mimeType","areAllVideos","renderHeader","onDragEnter","onDrop","onDragOver","onDragLeave","relatedTarget","toTarget","fromTarget","attachment","File","filename","extension","getFileExtension","previewData","emojis","onEmojiSelect","MessageInput","isAttachmentModalInput","html","editableInputId","onUpdate","shouldSetFocus","questionInputRef","optionsListRef","solutionRef","question","setQuestion","setOptions","isAnonymous","setIsAnonymous","isMultipleAnswers","setIsMultipleAnswers","isQuizMode","setIsQuizMode","solution","setSolution","correctOption","setCorrectOption","hasErrors","setHasErrors","focusInput","solutionEl","innerHTML","addNewOption","newOptions","list","scrollHeight","scrollTo","behavior","handleCreate","questionTrimmed","optionsTrimmed","o","summary","answers","correct","isPublic","multipleChoice","quiz","entities","parseMessageInput","correctAnswers","solutionEntities","updateOption","removeOption","handleCorrectOptionChange","handleIsAnonymousChange","handleMultipleAnswersChange","handleQuizModeChange","handleKeyPress","keyCode","getQuestionError","getOptionsError","renderOptions","onKeyPress","renderQuizNoOptionError","hidden","emoji","native","names","IS_EMOJI_SUPPORTED","loading","category","allEmojis","useOnIntersect","emojisPerRow","ceil","displayedEmoji","ICONS_BY_CATEGORY","recent","people","nature","foods","activity","places","objects","symbols","flags","categoryIntersections","emojiDataPromise","emojiRawData","emojiData","headerRef","categories","setCategories","setEmojis","activeCategoryIndex","setActiveCategoryIndex","entries","entry","intersectingWithIndexes","newLeft","HEADER_BUTTON_WIDTH","fastSmoothScrollHorizontal","allCategories","themeCategories","unshift","exec","default","uncompressEmoji","ensureEmojiData","selectCategory","categoryEl","handleEmojiSelect","MENU_TRANSITION_DURATION","containerClassName","faded","STICKER_MARGIN","loadAndPlay","onStickerSelect","onStickerUnfave","stickersPerRow","STICKER_SIZE_PICKER","noAnimate","onUnfaveClick","stickerSetIntersections","favorite","recentStickers","favoriteStickers","addedSetIds","shouldPlay","canSendStickers","loadRecentStickers","loadFavoriteStickers","addRecentSticker","activeSetIndex","setActiveSetIndex","areAddedLoaded","allSets","noPopulatedSets","set","stickerSetEl","handleStickerSelect","handleStickerUnfave","fullClassName","buttonClassName","gif","videoData","shouldRenderVideo","isVideoReady","preventMessageInputBlurWithBubbling","preload","savedGifs","gifs","saved","canSendGifs","onGifSelect","loadSavedGifs","debounceMs","SymbolMenuTabs","SYMBOL_MENU_TAB_TITLES","SYMBOL_MENU_TAB_ICONS","Emoji","Stickers","GIFs","onRemoveSymbol","onSearchOpen","renderTabButton","handleSearchOpen","isActivated","isLeftColumnShown","allowedAttachmentOptions","setRecentEmojis","handleMouseEnter","handleMouseLeave","useMouseInside","fastRaf","recentEmojisRef","renderContent","onMouseEnter","onMouseLeave","noCloseOnBackdrop","onFileSelect","onPollCreate","handleQuickSelect","handleDocumentSelect","canAttachMedia","canAttachPolls","autoClose","withAvatar","botCommand","bot","botCommands","handleSendCommand","botId","selectedCommandIndex","prevCommands","renderedCommands","chatBotCommand","forEmoji","clearStickersForEmoji","prevStickers","displayedStickers","onSilentSend","onScheduleSend","listEmojis","usePrevDuringAnimation","handleSelectEmoji","selectedIndex","setItemVisible","thumbUrl","thumbnailDataUrl","decoding","isForGallery","inlineResult","webThumbnail","STICKER_SIZE_INLINE_BOT_RESULT","isGallery","inlineBotResults","switchPm","loadMore","startBot","onSelectResult","handleSendPm","startParam","prevInlineBotResults","renderedInlineBotResults","sensitiveArea","inlineBotResult","messagesById","foundResults","senderUser","getGlobal","senderChat","forwardInfo","isChannelPost","orderBy","foundResult","preloadBackwards","LastMessageMeta","selectShouldLoopStickers","isSomeModalOpen","onModalToggle","isAdded","areStickersLoaded","useOnChange","coverStickerIds","covers","otherStickers","handleAddClick","canRenderStickers","STICKER_SIZE_SEARCH","selectCurrentStickerSearch","featured","featuredIds","loadFeaturedStickers","setIsModalOpen","selectCurrentGifSearch","isChatWithBot","selectIsChatWithBot","searchMoreGifs","setGifSearchQuery","getAllowedAttachmentOptions","handleGifClick","hasResults","answer","voters","offsets","pollResults","offset","answerVote","totalVoters","loadPollOptionResults","closePollResults","prevVotersCount","votersCount","setIsLoading","areVotersLoaded","limit","shouldResetVoters","handleViewMoreClick","handleMemberClick","noStatusOrTyping","leftVotersCount","renderViewMoreButton","total","getMessagePoll","resultsByOption","buildCollectionByKey","management","updateContact","deleteUser","deleteHistory","closeManagement","isDeleteDialogOpen","openDeleteDialog","closeDeleteDialog","isNotificationsEnabled","setIsNotificationsEnabled","ManagementProgress","handleNotificationChange","handleDeleteContact","withFullInfo","GROUP_TITLE_EMPTY","hasLinkedChannel","linkedChatId","isBasicGroup","canChangeInfo","isCreator","getHasAdminRight","canBanUsers","togglePreHistoryHidden","updateChat","deleteChat","leaveChannel","deleteChannel","currentTitle","currentAbout","imageHash","handleClickEditType","ManagementScreens","handleClickDiscussion","handleClickPermissions","handleClickAdministrators","handleSetPhoto","handleAboutChange","handleUpdateGroup","trimmedTitle","trimmedAbout","handleClickMembers","handleTogglePreHistory","isPreHistoryHidden","isEnabled","enabledPermissionsCount","defaultBannedRights","sendStickers","sendGifs","adminsCount","adminMembers","handleDeleteGroup","formatInteger","onChatMemberSelect","updateChatDefaultBannedRights","permissions","setPermissions","havePermissionChanged","setHavePermissionChanged","handleRemovedUsersClick","handleAddExceptionClick","handleExceptionMemberClick","promotedByUserId","handlePermissionChange","getUpdatedPermissionValue","handleSavePermissions","bannedRights","removedUsersCount","kickedMembers","exceptionMembers","members","getMemberExceptions","langKey","getLangKeyForBannedRightKey","translatedString","sendMessages","blocking","sendMedia","sendPolls","embedLinks","inviteUsers","pinMessages","changeInfo","updateChatMemberBannedRights","removedMembers","getRemovedBy","kickedByUserId","kickedByUser","getContextActions","CHANNEL_TITLE_EMPTY","isSignaturesShown","toggleSignatures","hasLinkedChat","handleUpdateChannel","handleToggleSignatures","handleClickSubscribers","handleDeleteChannel","selectManagement","checkPublicLink","updatePublicLink","updatePrivateLink","privateLink","inviteLink","privacyType","setPrivacyType","isRevokeConfirmDialogOpen","openRevokeConfirmDialog","closeRevokeConfirmDialog","canUpdate","handleOptionChange","handleSave","handleRevokePrivateLink","langPrefix1","langPrefix2","SafeLink","forDiscussionIds","linkedChat","loadGroupsForDiscussion","linkDiscussionGroup","unlinkDiscussionGroup","linkedGroupId","setLinkedGroupId","isConfirmUnlinkGroupDialogOpen","openConfirmUnlinkGroupDialog","closeConfirmUnlinkGroupDialog","isConfirmLinkGroupDialogOpen","openConfirmLinkGroupDialog","closeConfirmLinkGroupDialog","handleUnlinkGroupSessions","channelId","handleLinkGroupSessions","STICKER_SIZE_DISCUSSION_GROUPS","teactFastList","teactOrderKey","linkedGroup","renderLinkGroupHeader","hasPrivateLink","renderLinkGroupConfirmText","isButtonsInOneRow","isPromotedByCurrentUser","isFormFullyDisabled","selectedChatMemberId","isBanConfirmationDialogOpen","openBanConfirmationDialog","closeBanConfirmationDialog","selectedChatMember","handleBanFromGroup","viewMessages","getControlIsDisabled","isOwner","handleAdminMemberClick","getMemberStatus","promotedByUser","updateChatAdmin","setIsTouched","isDismissConfirmationDialogOpen","openDismissConfirmationDialog","closeDismissConfirmationDialog","customTitle","setCustomTitle","adminRights","handleDismissAdmin","memberStatus","handleCustomTitleChange","postMessages","editMessages","banUsers","addAdmins","anonymous","maxLength","openUserInfo","memberId","managementType","selectCurrentManagementType","VISA","MASTERCARD1","MASTERCARD2","CardType","cards","Default","Visa","Mastercard","detectCardType","cardNumber","formatsCache","defaultPhoneNumberFormat","str","flag","phoneFormat","format","formatValue","phoneNumberFormat","phoneNumberGroups","RegExp","repeat","getPhoneNumberFormat","streetLine1","streetLine2","city","countryIso2","postCode","phone","shipping","cardholder","expiry","cvv","billingCountry","billingZip","saveInfo","saveCredentials","formErrors","reducer","getBillingCountry","countryCode","useFocusAfterAnimation","animationDuration","hasArrow","labelText","htmlFor","needEmail","needPhone","needName","needAddress","phoneRef","selectCountryRef","handleAddress1Change","handleAddress2Change","handleCityChange","handleStateChange","handleCountryChange","handlePostCodeChange","handleFullNameChange","handleEmailChange","handlePhoneChange","handleSaveInfoChange","shippingOptions","currency","handleShippingSelect","amount","formatCurrency","renderPaymentItem","main","renderCheckoutItem","invoiceContent","prices","shippingPrices","checkoutInfo","totalPrice","photoUrl","paymentMethod","paymentProvider","shippingAddress","shippingMethod","expiryInputRef","charAt","parts","formatCardExpiry","cardNumberRef","cardType","setCardType","newCardType","formatCardNumber","cardIcon","mastercardIconPath","visaIconPath","getCardIcon","canSaveCredentials","needCardholderName","needCountry","needZip","handleCardNumberChange","handleCardholderChange","toUpperCase","handleExpiryChange","handleCvvChange","handleBillingPostCodeChange","handleChangeSaveCredentials","savedInfo","invoice","nativeProvider","nativeParams","passwordMissing","payment","isProviderError","nameRequested","phoneRequested","emailRequested","shippingAddressRequested","flexible","phoneToProvider","emailToProvider","validateRequestedInfo","sendPaymentForm","setPaymentStep","sendCredentialsInfo","clearPaymentError","paymentState","paymentDispatch","field","handleErrorModalClose","PaymentStep","shippingOption","getShippingPrices","concat","acc","cur","getTotalPrice","detectCardTypeText","findShippingOption","getCheckoutInfo","validateRequest","requestInfo","getRequestInfo","sendCredentials","credentials","expiryMonth","expiryYear","zip","getCredentials","sendForm","shippingOptionId","setStep","nextStep","buttonText","currentStep","renderModalContent","renderError","optionId","receipt","info","totalAmount","credentialsTitle","fullAddress","onInputChange","setPassword","canSubmit","setCanSubmit","select","autoComplete","MIN_PASSWORD_LENGTH","SEGMENT_COVER_EYES","SEGMENT_UNCOVER_EYE","SEGMENT_COVER_EYE","STICKER_SIZE","STICKER_SIZE_AUTH_MOBILE","STICKER_SIZE_AUTH","closeMonkeyData","setCloseMonkeyData","peekMonkeyData","setPeekMonkeyData","isFirstMonkeyLoaded","setIsFirstMonkeyLoaded","isPeekShown","setIsPeekShown","handleFirstMonkeyLoad","STICKER_SIZE_TWO_FA","playSegment","ANIMATED_STICKERS_PATHS","MonkeyIdle","MonkeyTracking","MonkeyClose","MonkeyPeek","FoldersAll","FoldersNew","DiscussionGroups","path","location","cropperResultOptions","quality","circle","Croppie","croppiePromise","cropper","isCroppieReady","setIsCroppieReady","imgFile","cropContainer","enableZoom","boundary","viewport","blobToDataUri","bind","err","DEBUG","console","initCropper","ensureCroppie","croppedImg","blobToFile","selectedFile","setSelectedFile","croppedBlobUrl","setCroppedBlobUrl","labelClassName","URL","revokeObjectURL","createObjectURL"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/Vazir-Medium-WOL.107ead8042d2d2a10827..woff2 b/dist/Vazir-Medium-WOL.107ead8042d2d2a10827..woff2 deleted file mode 100644 index d51715f5a690f8ee67f484b0416164b80e53df12..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 26248 zcmV)dK&QWVPew8T0RR910A`2)5&!@I0Pg?*0A?Tn0RR9100000000000000000000 z0000#Mn+Uk92$XG8^~N7k6H#`0ETi1FbSLt5eN!`hE z3Fy@|L-6w5kTj%qeJ#I?<{rR5DBoP~S4FZRgVY#zM1J*~X(W$U)y z6NbGq=P^)mhbtek_%6xZgl_Vi*04Z9aa>I%;bw9{5EXM2yy#n><9+OqJ$^3RwnFyr z+M(83D`YQ&C^Ir4d-$L;{g^Mr-PP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L.2f98e6f8ba81b54a0f96..woff2 new file mode 100644 index 0000000000000000000000000000000000000000..94725f62f954442fe73d3d6a547f8e549e8ea0de GIT binary patch literal 26192 zcmV)GK)%0sPew8T0RR910A^4C5&!@I0Pjoy0A=R@0RR9100000000000000000000 z0000#Mn+Uk92$XG8^~N7k6H#`0ETi1FbSLt5eN!`iAaI(CkuyM00A}vBm<8$1Rw>E z3Z(X z)d6Z*W^FD1g+?$B4-oF&QHCVlir|LL55t8ee4)(T~Db#KaTrrl;*P%{aeT-<<4 zf}xsnSh&&_*WwXk5dP4SNFThm9gZkHkDk;A~0^@qvq5L|1p2zpF0C@ z<0e(wd~>bTrE*yTex9G(-}BxAM${Ywiz*X7j;s%D5Efs|AhJJYBvoY~k%BcV$PLgo zLmOj8p;DrPpde`xDTsiIfB~q0pkg6L&6@Vs=GHDMP2Oy6Q>CgF5|Ql4Xc3n`I(dhH%p)EkE_;7~1>9(|Uhf(hoG< zw*7tV{Ju_8#xj+^c*2|mw6}ly`FM9TnaL!{BuSEFk_GG9Ij|OlM880_-}n5|Ch7Sb z+o~`Qi^MYsi^Jg&1}(8*F_xKkd*U%BS#wL0p=*NDc+4056*Vx=kn01iJwUK!cP7QW}wR1W64kXr>Ac zLNfrRF_PA5=A70!%{fbvW68DDIIr_ITjR6yx{KDh^sLJ^2{#JQx#)s0vT=0(x6Ij{ zo3t`N^?$0e;CeSc*`1fk?cDYB&6|0b&0CtPZPU7>HRX`VlPHh~hZHD>L~Dep-l8n< z|IexV?jMvD#rUN{Gl0YT%#fAf-i_nH=XbH6*Vu;d5H{-6jF$Y zgiMeSLQ#A7-!4nF2$09bp#(2X5UahpUT0vN?m{Obl*RBEQqjjJ*!HuZ+G%5&TQhdL z5fv07AdeBDpjc|AApa3 zF~7SUbVYSoF6x6kG=$};F+4BrK|zAT3KkX=E-t)y%m4wxAOz8lgGl)KGrt+sr^@bC zNWANx`*av0Kv1F(f}ydyeB3w#{O?q6wEOgx&?)P#1pfAU_R~TA{cpyO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?@(H{a@1CtqLc@v1YZcqHZ#9wmA=p(7;bIII-~+!E={(DLj>1;%1PY6Si2sO}a5)8E={nHwxD!mKk
\ No newline at end of file +Telegram
\ No newline at end of file diff --git a/dist/main.ae6f9de5758018d957f8.css b/dist/main.1caddd72e47829af6ab5.css similarity index 99% rename from dist/main.ae6f9de5758018d957f8.css rename to dist/main.1caddd72e47829af6ab5.css index acbceef7..5849b6fd 100644 --- a/dist/main.ae6f9de5758018d957f8.css +++ b/dist/main.1caddd72e47829af6ab5.css @@ -138,21 +138,21 @@ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } -/* Persian, v30.0.0, https://github.com/rastikerdar/vazir-font */ +/* Persian, v30.1.0, https://github.com/rastikerdar/vazir-font */ @font-face { font-family: Vazir; - src: url(Vazir-Regular-WOL.4a4990b236f65249e659..woff2) format('woff2'), - url(Vazir-Regular-WOL.a6f663c7a4c514c9de99..woff) format('woff'); + src: url(Vazir-Regular-WOL.c7b24ace258717d9a320..woff2) format('woff2'), + url(Vazir-Regular-WOL.ed6379fdf8108ff3bc5b..woff) format('woff'); font-weight: normal; font-display:swap; unicode-range:U+0627-06FF; } -/* Persian, v30.0.0, https://github.com/rastikerdar/vazir-font */ +/* Persian, v30.1.0, https://github.com/rastikerdar/vazir-font */ @font-face { font-family: Vazir; - src: url(Vazir-Medium-WOL.107ead8042d2d2a10827..woff2) format('woff2'), - url(Vazir-Medium-WOL.25ba8d95080e1e2952f4..woff) format('woff'); + src: url(Vazir-Medium-WOL.2f98e6f8ba81b54a0f96..woff2) format('woff2'), + url(Vazir-Medium-WOL.f4d87915577d64b321c6..woff) format('woff'); font-weight: 500; font-display:swap; unicode-range: U+0600-06FF; @@ -160,4 +160,4 @@ *,*::before,*::after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:none !important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500}p{margin-top:0;margin-bottom:1rem}abbr[title],abbr[data-original-title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul,dl{margin-top:0;margin-bottom:1rem}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:500}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}a{color:var(--color-links);text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):hover,a:not([href]):not([tabindex]):focus{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}pre,code,kbd,samp{font:.9375rem/1.25 "Courier","Courier New","Nimbus Mono L","Courier 10 Pitch","FreeMono",sans-serif-monospace,monospace;font-size-adjust:.43}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}a,area,button,[role=button],input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#868e96;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}input,button,select,optgroup,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none !important}:root{--color-background: #ffffff;--color-background-selected: #f4f4f5;--color-background-secondary: #f4f4f5;--color-background-secondary-accent: #E4E4E5;--color-background-own: #eefedf;--color-background-own-selected: #d4fcae;--color-background-own-rgb: 238, 254, 223;--color-text: #000000;--color-text-lighter: #2e3939;--color-text-secondary: #707579;--color-text-secondary-rgb: 112, 117, 121;--color-text-secondary-apple: #8A8A90;--color-text-meta: #686c72;--color-text-meta-rgb: 104, 108, 114;--color-text-meta-colored: #4fae4e;--color-text-meta-apple: #8C8C91;--color-text-green: #4fae4e;--color-text-green-rgb: 79, 174, 78;--color-borders: #DADCE0;--color-borders-input: #DADCE0;--color-dividers: #C8C6CC;--color-webpage-initial-background: #2e3939;--color-interactive-active: var(--color-primary);--color-interactive-inactive: rgba(var(--color-text-secondary-rgb), 0.25);--color-interactive-buffered: rgba(var(--color-text-secondary-rgb), 0.25);--color-interactive-element-hover: rgba(var(--color-text-secondary-rgb), 0.08);--color-primary: #50a2e9;--color-primary-rgb: 80, 162, 233;--color-primary-shade: #4a95d6;--color-primary-shade-darker: #4388c4;--color-primary-shade-rgb: 74, 149, 214;--color-primary-opacity: rgba(var(--color-primary), 0.50);--color-green: #4dcd5e;--color-green-darker: #41ac4f;--color-error: #e53935;--color-error-shade: #d33431;--color-error-rgb: 229, 57, 53;--color-warning: #fb8c00;--color-yellow: #FDD764;--color-links: #52a1ef;--color-links-hover: #2d8dec;--color-links-darker: #157be0;--color-links-darker-hover: #1166ba;--color-own-links: #ffffff;--color-placeholders: #A2ACB4;--color-pinned: #ffffff;--color-code: #4a729a;--color-code-bg: rgba(112, 117, 121, 0.08);--color-code-own: #3c7940;--color-code-own-bg: rgba(112, 117, 121, 0.08);--color-accent-own: #4fae4e;--color-message-meta-own: #4fae4e;--color-reply-hover: #f4f4f4;--color-reply-active: #e8e9ea;--color-reply-own-hover: #dbf4ce;--color-reply-own-active: #c8ebbc;--color-background-own-apple: #E7FDCC;--color-reply-own-hover-apple: #d9f9c1;--color-reply-own-active-apple: #d5edc2;--color-white: #ffffff;--color-gray: #c4c9cc;--color-chat-hover: #f4f4f5;--color-chat-active: #5B90E0;--color-item-active: #ededed;--color-selection-highlight: #3993fb;--color-selection-highlight-emoji: rgba(57, 147, 251, .7);--color-user-1: #E17076;--color-user-2: #7BC862;--color-user-4: #65aadd;--color-user-5: #a695e7;--color-user-6: #ee7aae;--color-user-7: #6ec9cb;--color-user-8: #faa774;--color-default-shadow: #72727240;--color-light-shadow: #7272722B;--vh: 1vh;--border-radius-default: 0.75rem;--border-radius-default-small: 0.625rem;--border-radius-default-tiny: 0.375rem;--border-radius-messages: 0.75rem;--border-radius-messages-small: 0.375rem;--messages-container-width: 45.5rem;--right-column-width: 26.5rem;--header-height: 3.5rem;--symbol-menu-width: 26.25rem;--symbol-menu-height: 23.25rem;--symbol-menu-footer-height: 3rem;--z-ui-loader-mask: 2000;--z-notification: 1000;--z-right-column: 900;--z-header-menu: 990;--z-header-menu-backdrop: 980;--z-modal: 1000;--z-media-viewer: 1500;--z-drop-area: 55;--z-animation-fade: 50;--z-menu-bubble: 21;--z-menu-backdrop: 20;--z-message-highlighted: 14;--z-message-context-menu: 13;--z-scroll-down-button: 12;--z-mobile-search: 12;--z-middle-header: 11;--z-middle-footer: 11;--z-country-code-input-group: 10;--z-message-select-control: 9;--z-message-select-area: 8;--z-sticky-date: 9;--z-register-add-avatar: 5;--z-media-viewer-head: 3;--z-below: -1;--spinner-white-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iI2ZmZmZmZiIvPjwvc3ZnPg==);--spinner-white-thin-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iI2ZmZmZmZiIgZD0iTTEyIDIzQzUuOSAyMyAxIDE4LjEgMSAxMlM1LjkgMSAxMiAxVjBDNS40IDAgMCA1LjQgMCAxMnM1LjQgMTIgMTIgMTIgMTItNS40IDEyLTEyaC0xYzAgNi4xLTQuOSAxMS0xMSAxMXoiLz48L3N2Zz4=);--spinner-blue-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzRlYTRmNiIvPjwvc3ZnPg==);--spinner-dark-blue-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzgzNzhEQiIvPjwvc3ZnPg==);--spinner-black-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzJlMzkzOSIvPjwvc3ZnPg==);--spinner-green-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzRmYWU0ZSIvPjwvc3ZnPg==);--spinner-gray-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzcwNzU3OSIvPjwvc3ZnPg==);--drag-target-border: url("data:image/svg+xml,%3csvg width=%27100%25%27 height=%27100%25%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3crect width=%27100%25%27 height=%27100%25%27 fill=%27none%27 rx=%278%27 ry=%278%27 stroke=%27%23DDDFE0%27 stroke-width=%274%27 stroke-dasharray=%279.1%2c 10.5%27 stroke-dashoffset=%273%27 stroke-linecap=%27round%27/%3e%3c/svg%3e");--drag-target-border-hovered: url("data:image/svg+xml,%3csvg width=%27100%25%27 height=%27100%25%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3crect width=%27100%25%27 height=%27100%25%27 fill=%27none%27 rx=%278%27 ry=%278%27 stroke=%27%2363A2E3%27 stroke-width=%274%27 stroke-dasharray=%279.1%2c 10.5%27 stroke-dashoffset=%273%27 stroke-linecap=%27round%27/%3e%3c/svg%3e");--layer-transition: 300ms cubic-bezier(0.33, 1, 0.68, 1);--layer-blackout-opacity: 0.3;--slide-transition: 300ms cubic-bezier(0.25, 1, 0.5, 1);--select-transition: 200ms ease-out}@media(min-width: 1276px)and (max-width: 1680px){:root{--right-column-width: 25vw}}@media(max-width: 600px){:root{--right-column-width: 100vw;--symbol-menu-width: 100vw;--symbol-menu-height: 14.6875rem}}@media(max-width: 600px){:root{--layer-transition: 450ms cubic-bezier(0.25, 1, 0.5, 1)}}:root body.is-android{--slide-transition: 200ms ease-in-out}.m-0{margin:0 !important}.mt-0,.my-0{margin-top:0 !important}.mr-0,.mx-0{margin-right:0 !important}.mb-0,.my-0{margin-bottom:0 !important}.ml-0,.mx-0{margin-left:0 !important}.m-1{margin:.25rem !important}.mt-1,.my-1{margin-top:.25rem !important}.mr-1,.mx-1{margin-right:.25rem !important}.mb-1,.my-1{margin-bottom:.25rem !important}.ml-1,.mx-1{margin-left:.25rem !important}.m-2{margin:.5rem !important}.mt-2,.my-2{margin-top:.5rem !important}.mr-2,.mx-2{margin-right:.5rem !important}.mb-2,.my-2{margin-bottom:.5rem !important}.ml-2,.mx-2{margin-left:.5rem !important}.m-3{margin:1rem !important}.mt-3,.my-3{margin-top:1rem !important}.mr-3,.mx-3{margin-right:1rem !important}.mb-3,.my-3{margin-bottom:1rem !important}.ml-3,.mx-3{margin-left:1rem !important}.m-4{margin:1.5rem !important}.mt-4,.my-4{margin-top:1.5rem !important}.mr-4,.mx-4{margin-right:1.5rem !important}.mb-4,.my-4{margin-bottom:1.5rem !important}.ml-4,.mx-4{margin-left:1.5rem !important}.m-5{margin:2rem !important}.mt-5,.my-5{margin-top:2rem !important}.mr-5,.mx-5{margin-right:2rem !important}.mb-5,.my-5{margin-bottom:2rem !important}.ml-5,.mx-5{margin-left:2rem !important}.m-6{margin:3rem !important}.mt-6,.my-6{margin-top:3rem !important}.mr-6,.mx-6{margin-right:3rem !important}.mb-6,.my-6{margin-bottom:3rem !important}.ml-6,.mx-6{margin-left:3rem !important}.p-0{padding:0 !important}.pt-0,.py-0{padding-top:0 !important}.pr-0,.px-0{padding-right:0 !important}.pb-0,.py-0{padding-bottom:0 !important}.pl-0,.px-0{padding-left:0 !important}.p-1{padding:.25rem !important}.pt-1,.py-1{padding-top:.25rem !important}.pr-1,.px-1{padding-right:.25rem !important}.pb-1,.py-1{padding-bottom:.25rem !important}.pl-1,.px-1{padding-left:.25rem !important}.p-2{padding:.5rem !important}.pt-2,.py-2{padding-top:.5rem !important}.pr-2,.px-2{padding-right:.5rem !important}.pb-2,.py-2{padding-bottom:.5rem !important}.pl-2,.px-2{padding-left:.5rem !important}.p-3{padding:1rem !important}.pt-3,.py-3{padding-top:1rem !important}.pr-3,.px-3{padding-right:1rem !important}.pb-3,.py-3{padding-bottom:1rem !important}.pl-3,.px-3{padding-left:1rem !important}.p-4{padding:1.5rem !important}.pt-4,.py-4{padding-top:1.5rem !important}.pr-4,.px-4{padding-right:1.5rem !important}.pb-4,.py-4{padding-bottom:1.5rem !important}.pl-4,.px-4{padding-left:1.5rem !important}.p-5{padding:2rem !important}.pt-5,.py-5{padding-top:2rem !important}.pr-5,.px-5{padding-right:2rem !important}.pb-5,.py-5{padding-bottom:2rem !important}.pl-5,.px-5{padding-left:2rem !important}.p-6{padding:3rem !important}.pt-6,.py-6{padding-top:3rem !important}.pr-6,.px-6{padding-right:3rem !important}.pb-6,.py-6{padding-bottom:3rem !important}.pl-6,.px-6{padding-left:3rem !important}.input-group{position:relative;margin-bottom:1.5rem}.input-group label{display:block;padding:0 .25rem;position:absolute;left:.75rem;top:.95rem;background-color:var(--color-background);font-size:1rem;font-weight:400;color:var(--color-placeholders);transition:transform .15s ease-out,color .15s ease-out;cursor:text;pointer-events:none;transform-origin:left center;white-space:nowrap}.input-group.with-arrow::after{content:"";position:absolute;height:.75rem;width:.75rem;border-left:1px var(--color-text-secondary) solid;border-bottom:1px var(--color-text-secondary) solid;transform:rotate(-45deg);right:2rem;top:1rem}.input-group.touched label,.input-group.error label,.input-group.success label,.input-group .form-control:focus+label,.input-group .form-control.focus+label{transform:scale(0.75) translate(-0.5rem, -2.25rem)}.input-group input::placeholder,.input-group .form-control::placeholder{color:var(--color-placeholders)}.input-group.touched label{color:var(--color-text-secondary)}.input-group.error label{color:var(--color-error) !important}.input-group.success label{color:var(--color-text-green) !important}.input-group.disabled{opacity:.5;pointer-events:none}.input-group[dir=rtl] input{text-align:right}.input-group[dir=rtl] label{left:auto;right:.75rem}.input-group[dir=rtl].with-arrow::after{border-left:none;border-right:1px var(--color-text-secondary) solid;right:auto;left:2rem}.input-group[dir=rtl].touched label,.input-group[dir=rtl].error label,.input-group[dir=rtl].success label,.input-group[dir=rtl] .form-control:focus+label,.input-group[dir=rtl] .form-control.focus+label{transform:scale(0.75) translate(1.5rem, -2.25rem)}.form-control{--border-width: 1px;display:block;width:100%;height:3.375rem;padding:calc(0.75rem - var(--border-width)) calc(.9rem - var(--border-width));border:var(--border-width) solid var(--color-borders-input);border-radius:var(--border-radius-default);color:var(--color-text);background-color:var(--color-background);outline:none;transition:border-color .15s ease;word-break:break-word;-webkit-appearance:none;font-size:1rem;line-height:1.25rem}.form-control[dir]{text-align:initial}.form-control:hover{border-color:var(--color-primary)}.form-control:hover+label{color:var(--color-primary)}.form-control:focus,.form-control.focus{border-color:var(--color-primary);box-shadow:inset 0 0 0 1px var(--color-primary);caret-color:var(--color-primary)}.form-control:focus+label,.form-control.focus+label{color:var(--color-primary)}.form-control:disabled{background:none !important}.error .form-control{border-color:var(--color-error);box-shadow:inset 0 0 0 1px var(--color-error);caret-color:var(--color-error)}.success .form-control{border-color:var(--color-text-green);box-shadow:inset 0 0 0 1px var(--color-text-green);caret-color:var(--color-text-green)}select.form-control option{line-height:2rem}textarea.form-control{resize:none;overflow:hidden;line-height:1.3125rem;padding-top:calc(1rem - var(--border-width));padding-bottom:calc(1rem - var(--border-width))}.input-group.password-input{position:relative}.input-group.password-input .form-control{padding-right:3.375rem}.input-group.password-input .toggle-password{position:absolute;top:0;right:0;width:3.375rem;height:3.375rem;display:flex;align-items:center;justify-content:center;cursor:pointer;outline:none !important;color:var(--color-text-secondary);opacity:.7;font-size:1.5rem}.input-group.password-input .toggle-password:hover,.input-group.password-input .toggle-password:focus{opacity:1}.input-group.password-input[dir=rtl] .form-control{padding-left:3.375rem;padding-right:calc(.9rem - var(--border-width))}.input-group.password-input[dir=rtl] .toggle-password{left:0;right:auto}@font-face{font-family:"icomoon";src:url(icomoon.580bc3e2c3dee26e29f8..woff2) format("woff2"),url(icomoon.9038252296eb264b5aa7..woff) format("woff");font-weight:normal;font-style:normal;font-display:block}[class^=icon-],[class*=" icon-"]{font-family:"icomoon" !important;speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}[class^=icon-char-]::before,[class*=" icon-char-"]::before{font-family:Roboto,"Helvetica Neue",sans-serif;content:attr(data-char);width:1.5rem;text-align:center;display:block}.icon-bot-commands-filled:before{content:""}.icon-reply-filled:before{content:""}.icon-bug:before{content:""}.icon-data:before{content:""}.icon-darkmode:before{content:""}.icon-animations:before{content:""}.icon-enter:before{content:""}.icon-fontsize:before{content:""}.icon-permissions:before{content:""}.icon-card:before{content:""}.icon-truck:before{content:""}.icon-share-filled:before{content:""}.icon-bold:before{content:""}.icon-bot-command:before{content:""}.icon-calendar-filter:before{content:""}.icon-comments:before{content:""}.icon-comments-sticker:before{content:""}.icon-arrow-down:before{content:""}.icon-email:before{content:""}.icon-italic:before{content:""}.icon-link:before{content:""}.icon-mention:before{content:""}.icon-monospace:before{content:""}.icon-next:before{content:""}.icon-password-off:before{content:""}.icon-pin-list:before{content:""}.icon-previous:before{content:""}.icon-replace:before{content:""}.icon-schedule:before{content:""}.icon-strikethrough:before{content:""}.icon-underlined:before{content:""}.icon-zoom-in:before{content:""}.icon-zoom-out:before{content:""}.icon-select:before{content:""}.icon-folder:before{content:""}.icon-bots:before{content:""}.icon-calendar:before{content:""}.icon-cloud-download:before{content:""}.icon-colorize:before{content:""}.icon-forward:before{content:""}.icon-reply:before{content:""}.icon-help:before{content:""}.icon-info:before{content:""}.icon-info-filled:before{content:""}.icon-delete-filled:before{content:""}.icon-delete:before{content:""}.icon-edit:before{content:""}.icon-new-chat-filled:before{content:""}.icon-send:before{content:""}.icon-send-outline:before{content:""}.icon-add-user-filled:before{content:""}.icon-add-user:before{content:""}.icon-delete-user:before{content:""}.icon-microphone:before{content:""}.icon-microphone-alt:before{content:""}.icon-poll:before{content:""}.icon-revote:before{content:""}.icon-photo:before{content:""}.icon-document:before{content:""}.icon-camera:before{content:""}.icon-camera-add:before{content:""}.icon-logout:before{content:""}.icon-saved-messages:before{content:""}.icon-settings:before{content:""}.icon-phone:before{content:""}.icon-attach:before{content:""}.icon-copy:before{content:""}.icon-channel:before{content:""}.icon-group:before{content:""}.icon-user:before{content:""}.icon-non-contacts:before{content:""}.icon-active-sessions:before{content:""}.icon-admin:before{content:""}.icon-download:before{content:""}.icon-location:before{content:""}.icon-stop:before{content:""}.icon-archive:before{content:""}.icon-unarchive:before{content:""}.icon-readchats:before{content:""}.icon-unread:before{content:""}.icon-message:before{content:""}.icon-lock:before{content:""}.icon-unlock:before{content:""}.icon-mute:before{content:""}.icon-unmute:before{content:""}.icon-pin:before{content:""}.icon-unpin:before{content:""}.icon-smallscreen:before{content:""}.icon-fullscreen:before{content:""}.icon-large-pause:before{content:""}.icon-large-play:before{content:""}.icon-pause:before{content:""}.icon-play:before{content:""}.icon-channelviews:before{content:""}.icon-message-succeeded:before{content:""}.icon-message-read:before{content:""}.icon-message-pending:before{content:""}.icon-message-failed:before{content:""}.icon-favorite:before{content:""}.icon-keyboard:before{content:""}.icon-delete-left:before{content:""}.icon-recent:before{content:""}.icon-gifs:before{content:""}.icon-stickers:before{content:""}.icon-smile:before{content:""}.icon-animals:before{content:""}.icon-eats:before{content:""}.icon-sport:before{content:""}.icon-car:before{content:""}.icon-lamp:before{content:""}.icon-language:before{content:""}.icon-flag:before{content:""}.icon-more:before{content:""}.icon-search:before{content:""}.icon-remove:before{content:""}.icon-add:before{content:""}.icon-check:before{content:""}.icon-close:before{content:""}.icon-arrow-left:before{content:""}.icon-arrow-right:before{content:""}.icon-down:before{content:""}.icon-up:before{content:""}.icon-eye-closed:before{content:""}.icon-eye:before{content:""}.icon-muted-chat:before{content:""}.icon-avatar-archived-chats:before{content:""}.icon-avatar-deleted-account:before{content:""}.icon-avatar-saved-messages:before{content:""}.icon-pinned-chat:before{content:""}.media-inner{position:relative}.media-inner video,.media-inner img{display:block}.media-inner img,.media-inner video{object-fit:cover}.media-inner video{background:no-repeat 50% 50%;background-size:contain}.media-inner .thumbnail~.thumbnail,.media-inner .thumbnail~.full-media,.media-inner .media-loading{position:absolute}.animated-close-icon{position:absolute;transform:rotate(-45deg)}.animated-close-icon,.animated-close-icon::before,.animated-close-icon::after{width:1.125rem;height:.125rem;border-radius:.125rem;background-color:var(--color-text-secondary);transition:transform var(--slide-transition)}.animated-close-icon::before,.animated-close-icon::after{position:absolute;left:0;top:0;content:""}.animated-close-icon::before{transform:rotate(90deg)}.animated-close-icon.no-transition,.animated-close-icon.no-transition::before,.animated-close-icon.no-transition::after{transition:none}.animated-close-icon.state-back{transform:rotate(180deg)}.animated-close-icon.state-back::before{transform:rotate(45deg) scaleX(0.75) translate(0, -0.375rem)}.animated-close-icon.state-back::after{transform:rotate(-45deg) scaleX(0.75) translate(0, 0.375rem)}.chat-list{background:var(--color-background);height:100%;padding:.5rem .125rem .5rem .4375rem;overflow-y:auto}@supports(overflow-y: overlay){body.is-android .chat-list{overflow-y:overlay;overflow-x:hidden}}.chat-list .scroll-container{position:relative}.chat-list .ListItem.chat-item-clickable{margin:0}@media(max-width: 600px){.chat-list{padding-left:0;padding-right:0}}.chat-list .no-results{color:var(--color-text-meta);margin-top:2rem;text-align:center}div.color-bg-1{--color-user: var(--color-user-1)}div.color-bg-2{--color-user: var(--color-user-2)}div.color-bg-4{--color-user: var(--color-user-4)}div.color-bg-5{--color-user: var(--color-user-5)}div.color-bg-6{--color-user: var(--color-user-6)}div.color-bg-7{--color-user: var(--color-user-7)}div.color-bg-8{--color-user: var(--color-user-8)}div.saved-messages{--color-user: var(--color-primary)}div.deleted-account{--color-user: var(--color-gray)}html,body{width:100%;height:100%;background:var(--color-background);margin:0;padding:0;font-size:16px;font-family:"Roboto",-apple-system,BlinkMacSystemFont,"Apple Color Emoji","Helvetica Neue",sans-serif;color:var(--color-text);overflow:hidden;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(max-width: 600px){html,body{height:calc(var(--vh, 1vh) * 100)}}body.is-ios,body.is-macos{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Roboto","Apple Color Emoji","Helvetica Neue",sans-serif}html[lang=fa],html[lang=fa] body{font-family:"Vazir","Roboto",-apple-system,BlinkMacSystemFont,"Apple Color Emoji","Helvetica Neue",sans-serif}html[lang=fa].is-ios,html[lang=fa].is-macos,html[lang=fa] body.is-ios,html[lang=fa] body.is-macos{font-family:"Vazir",-apple-system,BlinkMacSystemFont,"Roboto","Apple Color Emoji","Helvetica Neue",sans-serif}body.cursor-grabbing,body.cursor-grabbing *{cursor:grabbing !important}#root{height:100%;max-width:1680px;margin:0 auto}@media(max-width: 600px){#root{height:calc(var(--vh, 1vh) * 100)}}#middle-column-portals,#portals{position:absolute;top:0;left:0;right:0}.hidden{visibility:hidden}.no-selection{user-select:none;-webkit-user-select:none !important}.visually-hidden{position:absolute !important;width:0;height:0;overflow:hidden;clip:rect(0, 0, 0, 0);z-index:-1}.not-implemented{opacity:.5}.not-implemented,.not-implemented *{cursor:not-allowed !important}*{box-sizing:border-box}.no-animations #root *,.no-animations #root *::before,.no-animations #root *::after{transition:none !important}.custom-scroll,.custom-scroll-x{scrollbar-width:thin;scrollbar-color:rgba(90,90,90,0) transparent;transition:scrollbar-color .3s ease;-webkit-overflow-scrolling:touch;pointer-events:auto}.custom-scroll::-webkit-scrollbar-thumb,.custom-scroll-x::-webkit-scrollbar-thumb{background-color:rgba(90,90,90,0);border-radius:.35rem}.custom-scroll:hover,.custom-scroll:focus,.custom-scroll:focus-within,.custom-scroll-x:hover,.custom-scroll-x:focus,.custom-scroll-x:focus-within{scrollbar-color:rgba(90,90,90,.3) transparent}.custom-scroll:hover::-webkit-scrollbar-thumb,.custom-scroll:focus::-webkit-scrollbar-thumb,.custom-scroll:focus-within::-webkit-scrollbar-thumb,.custom-scroll-x:hover::-webkit-scrollbar-thumb,.custom-scroll-x:focus::-webkit-scrollbar-thumb,.custom-scroll-x:focus-within::-webkit-scrollbar-thumb{background-color:rgba(90,90,90,.3)}.custom-scroll::-webkit-scrollbar{width:.375rem}.custom-scroll-x::-webkit-scrollbar{height:.35rem}.no-scrollbar{scrollbar-width:none}.no-scrollbar::-webkit-scrollbar{display:none}.emoji-small{background:no-repeat;background-size:1.25rem;color:transparent;display:inline-block;width:1.25rem;height:1.25rem;margin-inline-end:1px;overflow:hidden;flex-shrink:0}.emoji-small::selection{background-color:var(--color-selection-highlight-emoji);color:transparent}div[role=button]{outline:none !important;cursor:pointer}.opacity-transition{opacity:1;transition:opacity .15s ease}.opacity-transition:not(.open){opacity:0}.opacity-transition:not(.shown){display:none}.opacity-transition.slow{transition-duration:.3s}.color-primary{color:var(--color-primary) !important}.color-danger{color:var(--color-error) !important}.text-muted{color:var(--color-text-secondary) !important}.for-ios-autocapitalization-fix{position:fixed;font-size:16px;opacity:0;bottom:1rem;z-index:-1}@keyframes grow-icon{0%{transform:scale(0.5);opacity:.8}50%{transform:scale(1.1);opacity:1}100%{transform:scale(1)}}@keyframes hide-icon{from{transform:scale(1);opacity:.4}to{transform:scale(0.5);opacity:0}} -/*# sourceMappingURL=main.ae6f9de5758018d957f8.css.map*/ \ No newline at end of file +/*# sourceMappingURL=main.1caddd72e47829af6ab5.css.map*/ \ No newline at end of file diff --git a/dist/main.ae6f9de5758018d957f8.css.map b/dist/main.1caddd72e47829af6ab5.css.map similarity index 99% rename from dist/main.ae6f9de5758018d957f8.css.map rename to dist/main.1caddd72e47829af6ab5.css.map index d56f84e7..e786a67f 100644 --- a/dist/main.ae6f9de5758018d957f8.css.map +++ b/dist/main.1caddd72e47829af6ab5.css.map @@ -1 +1 @@ -{"version":3,"file":"main.ae6f9de5758018d957f8.css","mappings":"AAAA,MACE,cAEA,YACE,c;ACJJ,UACE,YACA,yBAFF,UAGI,mCAGF,gBACE,eACA,MACA,OACA,QACA,cACA,WACA,iBACA,YACA,gCACA,aAEA,sBACE,OACA,mCACA,kBACA,kBAEA,0BANF,sBAOI,4CAGF,0BAVF,sBAWI,QAGF,yBAdF,sBAeI,mBAGF,yBAlBF,sBAmBI,eACA,aAIJ,wBACE,OACA,2CACA,4CACA,kBACA,UACA,gBAEA,gCACE,WACA,cACA,kBACA,MACA,OACA,SACA,QACA,4BACA,sBACA,WACA,6BAEA,yDACE,yBAGF,6GAEE,yDAIJ,kDACE,sBAGF,sCACE,gCACE,8BAIJ,gDACE,aACA,iCAGF,0BA9CF,wBA+CI,OACA,mBAGF,yBAnDF,wBAoDI,cAIJ,uBACE,kBACA,MACA,QACA,UACA,YACA,gCACA,kBACA,kBACA,2CACA,mCAIJ,iBACE,OACA,kC;AClHJ,SACE,qBAEA,kBACA,aACA,mBACA,uBAEA,0BACA,2BAEA,aACE,kBACA,MACA,OACA,QACA,SAEA,4BACA,qBAEA,oBACA,sBACA,mCACA,iCAIA,iCACE,WACA,kBACA,eACA,cACA,iBACA,gBACA,kBACA,2BAKF,mBACE,2CAIA,mCACE,gDAMJ,kBACE,0CACA,8BACE,+CAMJ,mBACE,2CAKF,mBACE,2CAKF,kBACE,0CAKN,gBACE,KACE,uBAEF,GACE,0B;ACvEJ,4BACE,KACE,mBACA,UAEF,IACE,UAEF,GACE,UACA,oBAIJ,kBACE,kBACA,MACA,OACA,SACA,QAEA,yCACE,aAGF,uBACE,kBACA,cACA,0DACA,kBACA,mBACA,iC;ACtBJ,QACE,wBACA,aACA,mBACA,uBACA,WACA,cACA,SACA,2CACA,uBACA,gBACA,WACA,gBACA,eACA,yBACA,cACA,kBACA,gBACA,4CACA,gCAGA,8DACE,2BAGF,iBACE,sBACA,eACA,oBAGF,cACE,aACA,kBAEA,gBACE,iBAIJ,gBACE,gCACA,yBACA,mCAjEA,8JAoEE,sCAjEF,qBACE,oDAgEA,uCAtDA,4EA0DA,6CAIJ,kBACE,mCACA,kDACA,mCA/EA,oKAkFE,gCACA,WAhFF,qBACE,sDA8EA,gCACA,YArEA,8EAyEA,sCAIJ,aACE,mCACA,kCACA,mCA9FA,qJAiGE,2BA9FF,qBACE,iDA6FA,4BAnFA,yEAuFA,mCAIJ,eACE,mCACA,yBACA,kDA5GA,2JA+GE,8BACA,yBA7GF,qBACE,mDA2GA,8BACA,0BAlGA,2EAsGA,oCAIJ,aACE,gBAEA,qBACE,2BACA,gBA7HF,6KAgII,sDA7HJ,qBACE,yDA4HE,uDAlHF,iFAsHE,sDAIJ,uBACE,gBACA,kCA1IF,0KA+II,8CACA,yBA7IJ,qBACE,wDA2IE,8CACA,0BAlIF,gFAsIE,8CAKN,cACE,WA1JA,wJA6JE,UA1JF,qBACE,kDAyJA,WAGF,wBACE,UAIJ,oBACE,6BACA,kCAEA,uDAzKA,0KA4KE,wDAzKF,qBACE,wDAwKA,yDA9JA,gFAkKA,6DAGF,8BACE,2BAIJ,0BACE,6BACA,2BACA,0CA3LA,4LA8LE,uCACA,WA5LF,qBACE,8DA0LA,uCACA,YAjLA,sFAqLA,uCAIJ,aACE,iCACA,WACA,0CA1MA,qJA6ME,iCACA,WA3MF,qBACE,iDAyMA,iCACA,YAhMA,yEAoMA,iCAIJ,gBACE,eACA,iBAEA,sBACE,cAGF,qBACE,cACA,sBACA,sBAGF,0BACE,oBACA,sBAEA,4BACE,iBACA,mBAGF,mCACE,qBACA,qBAEA,qCACE,kBACA,eAKN,yBAlCF,gBAmCI,cAEA,sBACE,cAKN,aACE,eACA,iBACA,iDACA,kBACA,gBAEA,mBACE,cACA,eACA,kBAGF,eACE,kBAGF,kBACE,YACA,mBACA,sBACA,eAIJ,cACE,qBACA,sBACA,WAEA,mBACE,sBACA,uBAIJ,aACE,sBACA,qBACA,sBACA,oBAGF,gBACE,kBACA,oBAEA,yBACE,kBACA,cACA,YAEA,uBAIJ,eACE,oB;AC5TJ,UACE,cACA,kBACA,oBACA,gBACA,qBACA,mBACA,eAEA,mBACE,oBACA,WAKE,uCACE,kBAGF,sCACE,0FACA,qBACA,kBAMJ,iFAEE,qBAGF,2BACE,kBACA,aACA,YACA,UACA,oCACA,wBAMA,8DACE,gCAGF,6DACE,yDACA,UAGA,yBACA,wCAKN,gBACE,kBACA,uBACA,UAIA,iEACE,WACA,cACA,kBACA,eACA,aACA,eACA,gBAGF,iCACE,4CACA,qBACA,yCACA,2DAGF,gCACE,oEACA,wBACA,UACA,4BAGF,gCACE,cACA,mBAGF,mCACE,cACA,kBACA,iBACA,kCAKF,+CACE,kCACA,sCAGF,8CACE,UAIJ,mBACE,eACA,qBAGE,oCACE,UACA,cAIJ,uDAEE,iBAIA,mFACE,UACA,g1C;ACvIR,SACE,aACA,YACA,mBACA,uBAEA,kBACE,wB;ACNF,oBACE,kBACA,WAGF,gBACE,eACA,YACA,aACA,WACA,cACA,+BAGF,cACE,gBACA,cACA,gBACA,gBACA,SACA,kBACA,yCACA,8DACA,2CACA,kBACA,6BAEA,qBACA,0GAmBA,gCACA,cAlBA,mBACE,mBAGF,sBACE,gEAGF,qCACE,0BACA,mCAGF,mCACE,2BAMF,kBACE,oBAGF,qBACE,uBAGF,mBACE,qBAGF,oBACE,sBAGF,0BACE,iBAIJ,cACE,gBACA,mCACA,kCACA,mBACA,kB;AC7EJ,cACE,kB;ACDF,UACE,WACA,gBACA,uBACA,2BACA,wBACA,aACA,aACA,kBACA,gBACA,mBACA,mBACA,wBACA,mCACA,eACA,uBAEA,qBACE,gCACE,yCACA,qBACA,eAIJ,yBACE,iDACE,qBACA,cAGF,iBACE,0CAIJ,YACE,iBACA,kBACA,kCAGF,0BACE,kBAEA,qCACE,0BAIJ,mBACE,sBACA,0BAGF,sBACE,yBAEA,wBACE,cAIJ,iDACE,0CACA,2BAGF,oBACE,iBAIA,qBACE,iBACA,eAGF,mCACE,iBACA,eAGF,6BACE,cACA,kB;ACnFJ,+BACE,eAEA,0CAEA,wCACE,kBACA,SACA,aACA,WACA,uBAIF,8CACE,kBACA,aACA,WACA,aACA,cACA,6CACA,aACA,cACA,kCACA,0DAEA,mDACE,kCACA,mCACA,WAKN,0BACE,WACA,mBACA,gBACA,uCACA,sBAEA,+BACE,oBAKF,mCACE,aACA,mBAGF,8CACE,uBACA,mBAEA,mDACE,kBAKN,gCACE,eACA,kBAEA,uCACE,WACA,YACA,qBACA,mBACA,uBAIJ,gCACE,mBACA,gBACA,uBACA,kBACA,gBAGF,gCACE,iBACA,W;ACvFJ,WACE,WACA,kBACA,cACA,aACA,iBACA,kBAEA,gDARF,WASI,eACA,mBAEA,cACE,kBAIJ,kDACE,cACA,iBACA,kBACA,aACA,cACA,sBAEA,gDARF,kDASI,YACA,aACA,sBAIJ,iBACE,qBACA,oEAGF,cACE,kBACA,cAEA,yBAJF,cAKI,eACA,iBAIJ,iBACE,kBACA,iBACA,qBACA,kCAEA,yBANF,iBAOI,eACA,oBAKN,kGAKE,YACA,gBAIA,6BACE,oBAGF,gCACE,mBAGF,wCACE,gBAMF,0CACE,aACA,mBACA,uBAIJ,kBACE,aACA,cACA,cACA,iBACA,kCACA,YACA,aACA,mBACA,uBACA,eAEA,gDACE,UAKF,sDACE,aAGF,4BACE,UACA,mBACA,2EAEA,wCACE,WACA,qBAIJ,iBACE,uBAGF,iBACE,gBACA,mBACA,kBAEA,oBACE,uBACA,gBACA,gBACA,aAEA,4BACE,sBACA,aACA,uBACA,mBACA,iBACA,cACA,UACA,oBACA,gCACA,kBACA,kBACA,WAMR,kBACE,kC;AC/JF,aACE,YACA,aACA,sBACA,mBACA,uBAEA,sBACE,gBACA,YACA,eACA,kBAGF,oBACE,gBAGF,0BACE,kCACA,kBAGF,iBACE,WACA,gBAGF,qBACE,gB;AC7BJ,iBAAiB;AACjB;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,sFAAsF;AACxF;AACA,aAAa;AACb;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,4DAA4D;AAC9D;AACA,cAAc;AACd;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,0BAA0B;AAC5B;AACA,UAAU;AACV;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,0BAA0B;AAC5B;AACA,eAAe;AACf;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,4DAA4D;A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0BACA,6BACA,6CACA,CAIA,6EAEF,aACE,MAGF,QACE,wJACA,eACA,gBACA,gBACA,cACA,gBACA,sBACA,uBAGF,uBACE,IAGF,sBACE,SACA,iBACA,mBAGF,YACE,oBACA,gBACA,GAGF,YACE,mBACA,uCAGF,yBAEE,yCACA,CADA,gCACA,YACA,gBACA,SAGF,kBACE,kBACA,oBACA,UAGF,YAGE,mBACA,yBAGF,eAIE,IAGF,eACE,IAGF,mBACE,cACA,YAGF,eACE,KAGF,iBACE,UAGF,eAEE,OAGF,aACE,SAGF,iBAEE,cACA,cACA,wBACA,KAGF,cACE,KAGF,UACE,GAGF,wBACE,qBACA,6BACA,qCACA,SAEF,aACE,0BACA,+BAGF,aACE,qBACA,yEAEF,aACE,qBACA,qCAEF,SACE,mBAGF,uHAIE,qBACA,KAGF,YACE,mBACA,cACA,6BACA,QAGF,eACE,KAGF,qBACE,kBACA,gBAGF,eACE,mFAGF,yBASE,OAGF,wBACE,SAGF,kBACE,sBACA,cACA,gBACA,oBACA,IAGF,kBACE,OAGF,oBACE,oBACA,QAGF,eACE,cAGF,kBACE,0CACA,uCAGF,QAKE,oBACA,kBACA,oBACA,cAGF,gBAEE,eAGF,mBAEE,sDAGF,yBAIE,yHAGF,SAIE,kBACA,wCAGF,qBAEE,UACA,gFAGF,0BAIE,UAGF,aACE,gBACA,UAGF,WACE,UACA,SACA,SACA,QAGF,aACE,WACA,eACA,UACA,oBACA,iBACA,oBACA,cACA,mBACA,UAGF,uBACE,mFAGF,WAEE,eAGF,mBACE,wBACA,sFAGF,uBAEE,8BAGF,YACE,0BACA,QAGF,oBACE,SAGF,iBACE,UAGF,YACE,UAGF,uBACE,OC7QF,2BACE,qCACA,sCACA,6CACA,gCACA,yCACA,0CACA,sBACA,8BACA,gCACA,0CACA,sCACA,2BACA,qCACA,mCACA,iCACA,4BACA,oCACA,yBACA,+BACA,0BACA,4CACA,iDACA,0EACA,0EACA,+EACA,yBAEA,kCACA,+BACA,sCACA,wCACA,0DACA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EF,8BAEE,aAEF,+BAEE,aAEF,6BAEE,MAfF,oCACA,2BAEE,aAEF,6BAEE,aAEF,8BAEE,aAEF,4BAEE,MAfF,sCACA,6BAEE,aAEF,+BAEE,aAEF,gCAEE,aAEF,8BAEE,MAfF,oCACA,2BAEE,aAEF,6BAEE,aAEF,8BAEE,aAEF,4BAEE,MAfF,oCACA,2BAEE,aAEF,6BAEE,aAEF,8BAEE,aAEF,4BAEE,cCnCN,iBACE,qBACA,oBAEA,aACE,iBACA,kBACA,YACA,WACA,yCACA,eACA,gBACA,gCACA,uDACA,YACA,oBACA,6BACA,mBACA,gCAIA,UACE,kBACA,cACA,aACA,kDACA,oDACA,yBACA,WACA,SACA,8JAIJ,kDAKE,yEAGF,+BAEE,4BAGF,iCACE,0BAGF,mCACE,4BAGF,wCACE,uBAGF,UACE,oBACA,6BAIA,gBACE,6BAGF,SACE,aACA,yCAIA,gBACE,mDACA,WACA,UACA,2MAIJ,iDAKE,eAKN,mBACE,cACA,WACA,gBACA,8EACA,4DACA,2CACA,wBACA,yCACA,aACA,kCACA,sBACA,wBACA,eAEA,oBACA,oBAEA,kBACE,qBAGF,iCACE,2BAEA,0BACE,yCAIJ,iCAEE,gDACA,iCACA,qDAEA,0BACE,wBAIJ,0BACE,sBAGF,+BACE,8CACA,+BACA,wBAGF,oCACE,mDACA,oCACA,4BAKF,gBACE,uBAIJ,WACE,gBACA,sBACA,6CACA,gDACA,6BAGF,iBACE,2CAEA,sBACE,8CAGF,iBACE,MACA,QACA,eACA,gBACA,aACA,mBACA,uBACA,eACA,wBACA,kCAEA,WACA,iBACA,uGAEA,SACE,oDAKF,qBACE,gDACA,uDAGF,MACE,WACA,YC1MN,qBACE,oHACA,mBAEA,kBACA,mBACA,kCAGF,gCAEE,WACA,kBACA,mBACA,oBACA,oBACA,cACA,mCAGA,kCACA,4DAIA,8CACE,wBACA,aACA,kBACA,cACA,kCAIJ,WACE,2BAEF,WACE,kBAEF,WACE,mBAEF,WACE,uBAEF,WAC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ACE,wBACA,kBACA,qBACA,cACA,eACA,sBACA,gBACA,cACA,yBAEA,uDACE,kBACA,kBAIJ,uBACE,eACA,qBAGF,SACE,6BACA,gCAEA,SACE,iCAGF,YACE,0BAGF,uBACE,gBAIJ,qCACE,eAGF,mCACE,aAGF,4CACE,iCAGF,cACE,eACA,UACA,YACA,WACA,sBAGF,GACE,oBACE,WACA,KAEF,oBACE,UACA,MAEF,kBACE,uBAIJ,KACE,kBACE,WACA,IAEF,oBACE,UACA,0tG","sources":["webpack://telegram-t/./src/components/ui/Link.scss","webpack://telegram-t/./src/components/common/UiLoader.scss","webpack://telegram-t/./src/components/ui/Spinner.scss","webpack://telegram-t/./src/components/ui/RippleEffect.scss","webpack://telegram-t/./src/components/ui/Button.scss","webpack://telegram-t/./src/components/ui/Checkbox.scss","webpack://telegram-t/./src/components/ui/Loading.scss","webpack://telegram-t/./src/components/ui/Menu.scss","webpack://telegram-t/./src/components/ui/DropdownMenu.scss","webpack://telegram-t/./src/components/ui/MenuItem.scss","webpack://telegram-t/./src/components/auth/CountryCodeInput.scss","webpack://telegram-t/./src/components/auth/Auth.scss","webpack://telegram-t/./src/components/main/AppInactive.scss","webpack://telegram-t/./src/assets/fonts/roboto.css","webpack://telegram-t/./src/styles/index.scss","webpack://telegram-t/./src/styles/reboot.css","webpack://telegram-t/./src/styles/_variables.scss","webpack://telegram-t/./src/styles/_spacing.scss","webpack://telegram-t/./src/styles/_forms.scss","webpack://telegram-t/./src/styles/icons.scss","webpack://telegram-t/./src/styles/_common.scss","webpack://telegram-t/./src/styles/_mixins.scss"],"sourcesContent":[".Link {\n color: inherit;\n\n &:hover {\n color: inherit;\n }\n}\n","#UiLoader {\n height: 100%;\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n\n .mask {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n margin: 0 auto;\n width: 100%;\n max-width: 1680px;\n height: 100%;\n z-index: var(--z-ui-loader-mask);\n display: flex;\n\n .left {\n flex: 1;\n background: var(--color-background);\n min-width: 15.5rem;\n max-width: 26.5rem;\n\n @media (min-width: 1680px) {\n border-left: 1px solid var(--color-borders);\n }\n\n @media (max-width: 1275px) {\n flex: 2;\n }\n\n @media (max-width: 925px) {\n min-width: 26.5rem;\n }\n\n @media (max-width: 600px) {\n max-width: none;\n width: 100vw;\n }\n }\n\n .middle {\n flex: 3;\n border-left: 1px solid var(--color-borders);\n border-right: 1px solid var(--color-borders);\n position: relative;\n z-index: 1;\n overflow: hidden;\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n background: no-repeat center;\n background-size: cover;\n z-index: -1;\n transform-origin: left center;\n\n .theme-dark body.initial & {\n background-color: #0f0f0f;\n }\n\n .theme-light body.initial &,\n body:not(.initial) & {\n background-image: url('../../assets/chat-bg.jpg');\n }\n }\n\n &.with-right-column::before {\n transform: scale(0.67);\n }\n\n @media screen and (min-width: 1276px) {\n &::before {\n margin: -16rem -5rem -20rem 0;\n }\n }\n\n &.custom-bg-image::before {\n margin: -1rem;\n background-image: none !important;\n }\n\n @media (max-width: 1275px) {\n flex: 3;\n border-right: none;\n }\n\n @media (max-width: 600px) {\n display: none;\n }\n }\n\n .right {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n height: 100%;\n width: var(--right-column-width);\n min-width: 15.5rem;\n max-width: 26.5rem;\n border-left: 1px solid var(--color-borders);\n background: var(--color-background);\n }\n }\n\n .blank {\n flex: 1;\n background: var(--color-background);\n }\n}\n",".Spinner {\n --spinner-size: 2rem;\n\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: var(--spinner-size);\n height: var(--spinner-size);\n\n > div {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n\n background-repeat: no-repeat;\n background-size: 100%;\n\n animation-name: spin;\n animation-duration: 1s;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n }\n\n &.with-background {\n &::before {\n content: '';\n position: absolute;\n left: -0.125rem;\n top: -0.125rem;\n bottom: -0.125rem;\n right: -0.125rem;\n border-radius: 50%;\n background: rgba(0,0,0,0.25);\n }\n }\n\n &.white {\n > div {\n background-image: var(--spinner-white-data);\n }\n\n &.with-background {\n > div {\n background-image: var(--spinner-white-thin-data);\n }\n }\n }\n\n &.blue {\n > div {\n background-image: var(--spinner-blue-data);\n .theme-dark & {\n background-image: var(--spinner-dark-blue-data);\n }\n }\n }\n\n &.black {\n > div {\n background-image: var(--spinner-black-data);\n }\n }\n\n &.green {\n > div {\n background-image: var(--spinner-green-data);\n }\n }\n\n &.gray {\n > div {\n background-image: var(--spinner-gray-data);\n }\n }\n}\n\n@keyframes spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n","@-webkit-keyframes ripple-animation {\n from {\n transform: scale(0);\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n to {\n opacity: 0;\n transform: scale(2);\n }\n}\n\n@keyframes ripple-animation {\n from {\n transform: scale(0);\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n to {\n opacity: 0;\n transform: scale(2);\n }\n}\n\n.ripple-container {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n\n body.animation-level-0 & {\n display: none;\n }\n\n span {\n position: absolute;\n display: block;\n background-color: var(--ripple-color, rgba(0, 0, 0, .08));\n border-radius: 50%;\n transform: scale(0);\n animation: ripple-animation 700ms;\n }\n}\n","@mixin active-styles() {\n &:not(.disabled):not(:disabled) {\n &:active, &.active, &:focus {\n @content;\n }\n @media (hover:hover) {\n &:hover {\n @content;\n }\n }\n }\n}\n\n@mixin no-ripple-styles() {\n body.animation-level-0 & {\n &:not(.disabled):not(:disabled) {\n &:active {\n @content;\n }\n }\n }\n}\n\n.Button {\n outline: none !important;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 3.5rem;\n border: 0;\n border-radius: var(--border-radius-default);\n background: transparent;\n padding: 0.625rem;\n color: white;\n line-height: 1.2;\n cursor: pointer;\n text-transform: uppercase;\n flex-shrink: 0;\n position: relative;\n overflow: hidden;\n transition: background-color .15s, color .15s;\n text-decoration: none !important;\n\n // @optimization\n &:active, &.clicked, body.animation-level-0 & {\n transition: none !important;\n }\n\n &.disabled {\n opacity: 0.5 !important;\n cursor: default;\n pointer-events: none;\n }\n\n &.round {\n width: 3.5rem;\n border-radius: 50%;\n\n i {\n font-size: 1.5rem;\n }\n }\n\n &.primary {\n background: var(--color-primary);\n color: var(--color-white);\n --ripple-color: rgba(0, 0, 0, .08);\n\n @include active-styles() {\n background: var(--color-primary-shade);\n }\n\n @include no-ripple-styles() {\n background: var(--color-primary-shade-darker);\n }\n }\n\n &.secondary {\n background: var(--color-background);\n color: rgba(var(--color-text-secondary-rgb), 0.75);\n --ripple-color: rgba(0, 0, 0, .08);\n\n @include active-styles() {\n background: var(--color-primary);\n color: white;\n }\n\n @include no-ripple-styles() {\n background: var(--color-primary-shade);\n }\n }\n\n &.gray {\n background: var(--color-background);\n color: var(--color-text-secondary);\n --ripple-color: rgba(0, 0, 0, .08);\n\n @include active-styles() {\n color: var(--color-primary);\n }\n\n @include no-ripple-styles() {\n background: var(--color-chat-hover);\n }\n }\n\n &.danger {\n background: var(--color-background);\n color: var(--color-error);\n --ripple-color: rgba(var(--color-error-rgb), .16);\n\n @include active-styles() {\n background: var(--color-error);\n color: var(--color-white);\n }\n\n @include no-ripple-styles() {\n background: var(--color-error-shade);\n }\n }\n\n &.text {\n background: none;\n\n &.primary {\n color: var(--color-primary);\n background: none;\n\n @include active-styles() {\n background: rgba(var(--color-primary-shade-rgb), .08);\n }\n\n @include no-ripple-styles() {\n background: rgba(var(--color-primary-shade-rgb), .16);\n }\n }\n\n &.secondary {\n background: none;\n color: var(--color-text-secondary);\n }\n\n &.danger {\n @include active-styles() {\n background: rgba(var(--color-error-rgb), .08);\n color: var(--color-error);\n }\n\n @include no-ripple-styles() {\n background: rgba(var(--color-error-rgb), .16);\n }\n }\n }\n\n &.faded {\n opacity: 0.8;\n\n @include active-styles() {\n opacity: 1;\n }\n\n &.activated {\n opacity: 1;\n }\n }\n\n &.translucent {\n background-color: transparent;\n color: var(--color-text-secondary);\n\n --ripple-color: var(--color-interactive-element-hover);\n\n @include active-styles() {\n background-color: var(--color-interactive-element-hover);\n }\n\n @include no-ripple-styles() {\n background-color: rgba(var(--color-text-secondary-rgb), 0.16);\n }\n\n &.activated {\n color: var(--color-primary);\n }\n }\n\n &.translucent-white {\n background-color: transparent;\n color: rgba(255, 255, 255, 0.5);\n --ripple-color: rgba(255, 255, 255, 0.08);\n\n @include active-styles() {\n background-color: rgba(255, 255, 255, 0.08);\n color: white;\n }\n\n @include no-ripple-styles() {\n background-color: rgba(255, 255, 255, 0.16);\n }\n }\n\n &.dark {\n background-color: rgba(0, 0, 0, 0.75);\n color: white;\n --ripple-color: rgba(255, 255, 255, 0.08);\n\n @include active-styles() {\n background-color: rgba(0, 0, 0, 0.85);\n color: white;\n }\n\n @include no-ripple-styles() {\n background-color: rgba(0, 0, 0, 0.95);\n }\n }\n\n &.smaller {\n height: 2.75rem;\n padding: 0.3125rem;\n\n &.round {\n width: 2.75rem;\n }\n\n &.pill {\n height: 2.5rem;\n border-radius: 1.25rem;\n padding: 0.3125rem 1rem;\n }\n\n &.with-icon {\n padding-left: 0.75rem;\n padding-right: 1.25rem;\n\n i {\n font-size: 1.5rem;\n margin-right: 0.5rem;\n }\n\n &[dir=rtl] {\n padding-left: 1.25rem;\n padding-right: 0.75rem;\n\n i {\n margin-left: 0.5rem;\n margin-right: 0;\n }\n }\n }\n\n @media (max-width: 600px) {\n height: 2.5rem;\n\n &.round {\n width: 2.5rem;\n }\n }\n }\n\n &.tiny {\n height: 2.25rem;\n padding: .4375rem;\n border-radius: var(--border-radius-default-small);\n font-size: .875rem;\n font-weight: 500;\n\n &.round {\n width: 2.25rem;\n height: 2.25rem;\n border-radius: 50%;\n }\n\n i {\n font-size: 1.25rem;\n }\n\n &.pill {\n height: 2rem;\n border-radius: 1rem;\n padding: 0.3125rem 1rem;\n font-size: 1rem;\n }\n }\n\n &.fluid {\n padding-left: 1.75rem;\n padding-right: 1.75rem;\n width: auto;\n\n &.tiny {\n padding-left: 1.375rem;\n padding-right: 1.375rem;\n }\n }\n\n &.pill {\n border-radius: 1.75rem;\n padding-left: 1.75rem;\n padding-right: 1.75rem;\n text-transform: none;\n }\n\n &.loading {\n position: relative;\n pointer-events: none;\n\n .Spinner {\n position: absolute;\n right: 0.875rem;\n top: 0.875rem;\n\n --spinner-size: 1.8rem;\n }\n }\n\n .emoji {\n vertical-align: -3px;\n }\n}\n",".Checkbox {\n display: block;\n position: relative;\n padding-left: 4.5rem;\n text-align: left;\n margin-bottom: 1.5rem;\n line-height: 1.5rem;\n cursor: pointer;\n\n &.disabled {\n pointer-events: none;\n opacity: 0.5;\n }\n\n &.round {\n .Checkbox-main {\n &::before {\n border-radius: 50%;\n }\n\n &::after {\n background: var(--color-primary) url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEzLjkuOEw1LjggOC45IDIuMSA1LjJjLS40LS40LTEuMS0uNC0xLjYgMC0uNC40LS40IDEuMSAwIDEuNkw1IDExLjJjLjQuNCAxLjEuNCAxLjYgMGw4LjktOC45Yy40LS40LjQtMS4xIDAtMS42LS41LS40LTEuMi0uNC0xLjYuMXoiIGZpbGw9IiNGRkYiLz48L3N2Zz4=) no-repeat 50% 50%;\n background-size: 12px;\n border-radius: 50%;\n }\n }\n }\n\n &.loading {\n .Checkbox-main::before,\n .Checkbox-main::after {\n opacity: 0 !important;\n }\n\n .Spinner {\n position: absolute;\n left: 0.375rem;\n top: 0.125rem;\n opacity: 0;\n animation: fade-in .2s ease forwards;\n --spinner-size: 1.25rem;\n }\n }\n\n &.blocking {\n input:not(:checked) ~ .Checkbox-main {\n &::before {\n border-color: var(--color-error);\n }\n\n &::after {\n background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgPHBvbHlnb24gcG9pbnRzPSIwIDAgMjQgMCAyNCAyNCAwIDI0Ii8+CiAgICA8cGF0aCBmaWxsPSIjZTUzOTM1IiBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0xOCwzIEMxOS42NTY4NTQyLDMgMjEsNC4zNDMxNDU3NSAyMSw2IEwyMSwxOCBDMjEsMTkuNjU2ODU0MiAxOS42NTY4NTQyLDIxIDE4LDIxIEw2LDIxIEM0LjM0MzE0NTc1LDIxIDMsMTkuNjU2ODU0MiAzLDE4IEwzLDYgQzMsNC4zNDMxNDU3NSA0LjM0MzE0NTc1LDMgNiwzIEwxOCwzIFogTTE2LDExIEw4LDExIEM3LjQ0NzcxNTI1LDExIDcsMTEuNDQ3NzE1MyA3LDEyIEM3LDEyLjU1MjI4NDcgNy40NDc3MTUyNSwxMyA4LDEzIEwxNiwxMyBDMTYuNTUyMjg0NywxMyAxNywxMi41NTIyODQ3IDE3LDEyIEMxNywxMS40NDc3MTUzIDE2LjU1MjI4NDcsMTEgMTYsMTEgWiIvPgogIDwvZz4KPC9zdmc+Cg==);\n opacity: 1;\n\n // Compensate for svg having incorrect size\n background-size: 1.375rem;\n background-position: -0.125rem -0.125rem;\n }\n }\n }\n\n input {\n position: absolute;\n z-index: var(--z-below);\n opacity: 0;\n }\n\n .Checkbox-main {\n &::before, &::after {\n content: '';\n display: block;\n position: absolute;\n left: 1.1875rem;\n top: 0.1875rem;\n width: 1.125rem;\n height: 1.125rem;\n }\n\n &::before {\n border: 2px solid var(--color-borders-input);\n border-radius: .25rem;\n background-color: var(--color-background);\n transition: border-color .1s ease, background-color .1s ease;\n }\n\n &::after {\n background: center no-repeat url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEzLjkuOEw1LjggOC45IDIuMSA1LjJjLS40LS40LTEuMS0uNC0xLjYgMC0uNC40LS40IDEuMSAwIDEuNkw1IDExLjJjLjQuNCAxLjEuNCAxLjYgMGw4LjktOC45Yy40LS40LjQtMS4xIDAtMS42LS41LS40LTEuMi0uNC0xLjYuMXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvc3ZnPg==);\n background-size: .875rem;\n opacity: 0;\n transition: opacity .1s ease;\n }\n\n .label {\n display: block;\n text-align: initial;\n }\n\n .subLabel {\n display: block;\n font-size: 0.875rem;\n line-height: 1rem;\n color: var(--color-text-secondary);\n }\n }\n\n input:checked ~ .Checkbox-main {\n &::before {\n border-color: var(--color-primary);\n background-color: var(--color-primary);\n }\n\n &::after {\n opacity: 1;\n }\n }\n\n &[dir=rtl] {\n padding-left: 0;\n padding-right: 4.5rem;\n\n &.loading {\n .Spinner {\n left: auto;\n right: 0.375rem;\n }\n }\n\n .label,\n .subLabel {\n text-align: right;\n }\n\n .Checkbox-main {\n &::before, &::after {\n left: auto;\n right: 1.1875rem;\n }\n }\n }\n}\n",".Loading {\n display: flex;\n height: 100%;\n align-items: center;\n justify-content: center;\n\n .Spinner {\n --spinner-size: 2.75rem;\n }\n}\n",".Menu {\n &.fluid .bubble {\n min-width: 13.5rem;\n width: auto;\n }\n\n .backdrop {\n position: fixed;\n left: -100vw;\n right: -100vw;\n top: -100vh;\n bottom: -100vh;\n z-index: var(--z-menu-backdrop);\n }\n\n .bubble {\n overflow: hidden;\n display: block;\n list-style: none;\n padding: 0.5rem 0;\n margin: 0;\n position: absolute;\n background-color: var(--color-background);\n box-shadow: 0 .25rem .5rem .125rem var(--color-default-shadow);\n border-radius: var(--border-radius-default);\n min-width: 13.5rem;\n z-index: var(--z-menu-bubble);\n\n transform: scale(0.2);\n transition: opacity .2s cubic-bezier(0.2, 0, 0.2, 1), transform .2s cubic-bezier(0.2, 0, 0.2, 1) !important;\n\n &.open {\n transform: scale(1);\n }\n\n &.closing {\n transition: opacity .2s ease-in, transform .2s ease-in !important;\n }\n\n body.animation-level-0 & {\n transform: none !important;\n transition: opacity .15s !important;\n }\n\n body.has-open-dialog & {\n transition: none !important;\n }\n\n --offset-y: calc(100% + 0.5rem);\n --offset-x: 0;\n\n &.top {\n top: var(--offset-y);\n }\n\n &.bottom {\n bottom: var(--offset-y);\n }\n\n &.left {\n left: var(--offset-x);\n }\n\n &.right {\n right: var(--offset-x);\n }\n\n &.with-footer {\n padding-bottom: 0;\n }\n }\n\n .footer {\n padding: 0.5rem 0;\n background: var(--color-chat-hover);\n color: var(--color-text-secondary);\n font-size: 0.8125rem;\n text-align: center;\n }\n}\n",".DropdownMenu {\n position: relative;\n}\n",".MenuItem {\n width: 100%;\n background: none;\n border: none !important;\n box-shadow: none !important;\n outline: none !important;\n display: flex;\n padding: 1rem;\n position: relative;\n overflow: hidden;\n line-height: 1.5rem;\n white-space: nowrap;\n color: var(--color-text);\n --ripple-color: rgba(0, 0, 0, .08);\n cursor: pointer;\n unicode-bidi: plaintext;\n\n @media (hover: hover) {\n &:hover, &:focus {\n background-color: var(--color-chat-hover);\n text-decoration: none;\n color: inherit;\n }\n }\n\n @media (max-width: 600px) {\n &:focus, &:hover, &:active {\n text-decoration: none;\n color: inherit;\n }\n\n &:active {\n background-color: var(--color-chat-hover);\n }\n }\n\n i {\n font-size: 1.5rem;\n margin-right: 2rem;\n color: var(--color-text-secondary);\n }\n\n .menu-item-name {\n margin-right: 2rem;\n\n &.capitalize {\n text-transform: capitalize;\n }\n }\n\n &.disabled {\n opacity: 0.5 !important;\n cursor: default !important;\n }\n\n &.destructive {\n color: var(--color-error);\n\n i {\n color: inherit;\n }\n }\n\n &:not(.has-ripple):not(.disabled):active {\n background-color: var(--color-item-active);\n transition: none !important;\n }\n\n & > .Switcher {\n margin-left: auto;\n }\n\n &[dir=rtl] {\n i {\n margin-left: 2rem;\n margin-right: 0;\n }\n\n .menu-item-name {\n margin-left: 2rem;\n margin-right: 0;\n }\n\n > .Switcher {\n margin-left: 0;\n margin-right: auto;\n }\n }\n}\n",".CountryCodeInput {\n\n .input-group {\n cursor: pointer;\n\n z-index: var(--z-country-code-input-group);\n\n .Spinner {\n position: absolute;\n top: 1rem;\n right: 0.75rem;\n opacity: 0.5;\n --spinner-size: 1.5rem;\n }\n\n // Prevent loading additional 10 kB of icomoon font on initial load.\n .css-icon-down {\n position: absolute;\n top: 1.125rem;\n right: 1rem;\n width: .75rem;\n height: .75rem;\n border: 2px solid var(--color-text-secondary);\n border-top: 0;\n border-left: 0;\n transform: scaleY(1) rotate(45deg);\n transition: color .2s ease, transform .2s ease, top .2s ease;\n\n &.open {\n border-color: var(--color-primary);\n transform: scaleY(-1) rotate(45deg);\n top: 1.5rem;\n }\n }\n }\n\n .bubble {\n width: 100%;\n max-height: 23.5rem;\n overflow-y: auto;\n transform-origin: top center !important;\n transform: scale(0.95);\n\n &.open {\n transform: scaleY(1);\n }\n }\n\n .MenuItem {\n button {\n display: flex;\n align-items: center;\n }\n\n &.no-results button {\n justify-content: center;\n padding: .5rem 1rem;\n\n span {\n font-size: 0.875rem;\n }\n }\n }\n\n .country-flag {\n font-size: 2rem;\n margin-right: 2rem;\n\n .emoji {\n width: 2rem;\n height: 2rem;\n display: inline-block;\n vertical-align: 4px;\n margin: -.5rem .125rem;\n }\n }\n\n .country-name {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-right: 1rem;\n text-align: left;\n }\n\n .country-code {\n margin-left: auto;\n opacity: 0.5;\n }\n}\n",".auth-form {\n width: 100%;\n max-width: 25.5rem;\n margin: 0 auto;\n padding: 1rem;\n padding-top: 6rem;\n text-align: center;\n\n @media (min-width: 600px) and (min-height: 450px) {\n padding: 1.5rem;\n padding-top: 6.8rem;\n\n &.qr {\n padding-top: 5rem;\n }\n }\n\n #logo, .AvatarEditable label {\n display: block;\n margin-left: auto;\n margin-right: auto;\n width: 7.5rem;\n height: 7.5rem;\n margin-bottom: 1.75rem;\n\n @media (min-width: 600px) and (min-height: 450px) {\n width: 10rem;\n height: 10rem;\n margin-bottom: 2.5rem;\n }\n }\n\n #logo {\n background-size: 100%;\n background: url('../../assets/telegram-logo.svg') center no-repeat;\n }\n\n h2 {\n font-size: 1.25rem;\n line-height: 1;\n\n @media (min-width: 600px) {\n font-size: 2rem;\n line-height: 1.5;\n }\n }\n\n .note {\n font-size: 0.875rem;\n line-height: 1.35;\n margin-bottom: 2.5rem;\n color: var(--color-text-secondary);\n\n @media (min-width: 600px) {\n font-size: 1rem;\n margin-bottom: 3rem;\n }\n }\n}\n\n#auth-registration-form,\n#auth-phone-number-form,\n#auth-code-form,\n#auth-password-form,\n#auth-qr-form {\n height: 100%;\n overflow-y: auto;\n}\n\n#auth-phone-number-form {\n form {\n min-height: 26.25rem;\n }\n\n .Button {\n margin-top: 2.75rem;\n }\n\n .Button + .Button {\n margin-top: 1rem;\n }\n}\n\n#auth-code-form,\n#auth-password-form {\n h2 {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n}\n\n.auth-number-edit {\n width: 2.5rem;\n height: 2.5rem;\n padding: 0.5rem;\n font-size: 1.5rem;\n color: var(--color-text-secondary);\n opacity: 0.75;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n\n &:hover, &:focus {\n opacity: 1;\n }\n}\n\n#auth-qr-form {\n .qr-container, .qr-loading {\n height: 280px;\n }\n\n .qr-container {\n opacity: 1;\n transform: scale(1);\n transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 300ms;\n\n &.pre-animate {\n opacity: 0.5;\n transform: scale(0.8);\n }\n }\n\n h3 {\n margin: 1.5rem 0 1rem 0;\n }\n\n ol {\n list-style: none;\n counter-reset: item;\n padding: 0 1.75rem;\n\n li {\n counter-increment: item;\n text-align: left;\n margin: 0.75rem 0;\n display: flex;\n\n &::before {\n content: counter(item);\n display: flex;\n justify-content: center;\n align-items: center;\n min-width: 1.4rem;\n height: 1.4rem;\n padding: 0;\n margin: 0 0.75rem 0 0;\n background: var(--color-primary);\n border-radius: 50%;\n font-size: smaller;\n color: white;\n }\n }\n }\n}\n\n#sign-in-password {\n word-break: normal !important;\n}\n","#AppInactive {\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n .content {\n max-width: 28rem;\n margin: auto;\n padding: 1.5rem;\n text-align: center;\n }\n\n .title {\n margin-top: 1rem;\n }\n\n .description {\n color: var(--color-text-secondary);\n font-size: 0.875rem;\n }\n\n img {\n width: 100%;\n max-width: 20rem;\n }\n\n .Button {\n margin-top: 1rem;\n }\n}\n","/* cyrillic-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu7mxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n}\n/* greek */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu4WxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0370-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu7WxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fCRc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fCBc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n}\n/* greek */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fBxc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0370-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fCxc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n\n/* Persian, v30.0.0, https://github.com/rastikerdar/vazir-font */\n@font-face {\n font-family: Vazir;\n src: url('Vazir-Regular-WOL.woff2') format('woff2'),\n url('Vazir-Regular-WOL.woff') format('woff');\n font-weight: normal;\n font-display:swap;\n unicode-range:U+0627-06FF;\n}\n\n/* Persian, v30.0.0, https://github.com/rastikerdar/vazir-font */\n@font-face {\n font-family: Vazir;\n src: url('Vazir-Medium-WOL.woff2') format('woff2'),\n url('Vazir-Medium-WOL.woff') format('woff');\n font-weight: 500;\n font-display:swap;\n unicode-range: U+0600-06FF;\n}\n","@import 'reboot';\n@import 'variables';\n@import 'mixins';\n@import 'spacing';\n@import 'forms';\n@import 'icons';\n@import 'common';\n@import '../assets/fonts/roboto.css';\n\nhtml, body {\n width: 100%;\n height: 100%;\n background: var(--color-background);\n margin: 0;\n padding: 0;\n font-size: 16px;\n font-family: \"Roboto\", -apple-system, BlinkMacSystemFont, \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;\n color: var(--color-text);\n overflow: hidden;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n}\n\nbody.is-ios,\nbody.is-macos {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, \"Roboto\", \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;\n}\n\nhtml[lang=fa],\nhtml[lang=fa] body {\n font-family: \"Vazir\", \"Roboto\", -apple-system, BlinkMacSystemFont, \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;\n\n &.is-ios,\n &.is-macos {\n font-family: \"Vazir\", -apple-system, BlinkMacSystemFont, \"Roboto\", \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;\n }\n}\n\nbody.cursor-grabbing, body.cursor-grabbing * {\n cursor: grabbing !important;\n}\n\n#root {\n height: 100%;\n max-width: 1680px;\n margin: 0 auto;\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n}\n\n#middle-column-portals,\n#portals {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n}\n\n.hidden {\n visibility: hidden;\n}\n\n.no-selection {\n user-select: none;\n -webkit-user-select: none !important;\n}\n\n/*\n See the article for more information on this visually-hidden pattern.\n https://snook.ca/archives/html_and_css/hiding-content-for-accessibility\n*/\n.visually-hidden {\n position: absolute !important;\n width: 0;\n height: 0;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n z-index: -1;\n}\n\n.not-implemented {\n opacity: 0.5;\n\n &, & * {\n cursor: not-allowed !important;\n }\n}\n\n* {\n box-sizing: border-box;\n}\n\n.no-animations #root *,\n.no-animations #root *::before,\n.no-animations #root *::after {\n transition: none !important;\n}\n\n.custom-scroll,\n.custom-scroll-x {\n scrollbar-width: thin;\n scrollbar-color: rgba(90, 90, 90, 0) transparent;\n transition: scrollbar-color .3s ease;\n\n -webkit-overflow-scrolling: touch;\n // Fix scroll lock on iOS\n pointer-events: auto;\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(90, 90, 90, 0);\n border-radius: 0.35rem;\n }\n\n &:hover, &:focus, &:focus-within {\n scrollbar-color: rgba(90, 90, 90, 0.3) transparent;\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(90, 90, 90, 0.3);\n }\n }\n}\n\n.custom-scroll {\n &::-webkit-scrollbar {\n width: .375rem;\n }\n}\n\n.custom-scroll-x {\n &::-webkit-scrollbar {\n height: .35rem;\n }\n}\n\n.no-scrollbar {\n scrollbar-width: none;\n\n &::-webkit-scrollbar {\n display: none;\n }\n}\n\n.emoji-small {\n background: no-repeat;\n background-size: 1.25rem;\n color: transparent;\n display: inline-block;\n width: 1.25rem;\n height: 1.25rem;\n margin-inline-end: 1px;\n overflow: hidden;\n flex-shrink: 0;\n\n &::selection {\n background-color: var(--color-selection-highlight-emoji);\n color: transparent;\n }\n}\n\ndiv[role=\"button\"] {\n outline: none !important;\n cursor: pointer;\n}\n\n.opacity-transition {\n opacity: 1;\n transition: opacity .15s ease;\n\n &:not(.open) {\n opacity: 0;\n }\n\n &:not(.shown) {\n display: none;\n }\n\n &.slow {\n transition-duration: .3s;\n }\n}\n\n.color-primary {\n color: var(--color-primary) !important;\n}\n\n.color-danger {\n color: var(--color-error) !important;\n}\n\n.text-muted {\n color: var(--color-text-secondary) !important;\n}\n\n.for-ios-autocapitalization-fix {\n position: fixed;\n font-size: 16px;\n opacity: 0;\n bottom: 1rem;\n z-index: -1;\n}\n\n@keyframes grow-icon {\n 0% {\n transform: scale(0.5);\n opacity: .8;\n }\n 50% {\n transform: scale(1.1);\n opacity: 1;\n }\n 100% {\n transform: scale(1);\n }\n}\n\n@keyframes hide-icon {\n from {\n transform: scale(1);\n opacity: .4;\n }\n to {\n transform: scale(.5);\n opacity: 0;\n }\n}\n","*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\nhtml {\n font-family: sans-serif;\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n -ms-text-size-adjust: 100%;\n -ms-overflow-style: scrollbar;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n@-ms-viewport {\n width: device-width;\n}\narticle, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section {\n display: block;\n}\n\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #212529;\n text-align: left;\n background-color: #fff;\n}\n\n[tabindex=\"-1\"]:focus {\n outline: none !important;\n}\n\nhr {\n box-sizing: content-box;\n height: 0;\n overflow: visible;\n}\n\nh1, h2, h3, h4, h5, h6 {\n margin-top: 0;\n margin-bottom: 0.5rem;\n font-weight: 500;\n}\n\np {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nabbr[title],\nabbr[data-original-title] {\n text-decoration: underline;\n text-decoration: underline dotted;\n cursor: help;\n border-bottom: 0;\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: 500;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0;\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\ndfn {\n font-style: italic;\n}\n\nb,\nstrong {\n font-weight: 500;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -.25em;\n}\n\nsup {\n top: -.5em;\n}\n\na {\n color: var(--color-links);\n text-decoration: none;\n background-color: transparent;\n -webkit-text-decoration-skip: objects;\n}\na:hover {\n color: #0056b3;\n text-decoration: underline;\n}\n\na:not([href]):not([tabindex]) {\n color: inherit;\n text-decoration: none;\n}\na:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus {\n color: inherit;\n text-decoration: none;\n}\na:not([href]):not([tabindex]):focus {\n outline: 0;\n}\n\npre,\ncode,\nkbd,\nsamp {\n font: .9375rem/1.25 'Courier', 'Courier New', 'Nimbus Mono L', 'Courier 10 Pitch', 'FreeMono', sans-serif-monospace, monospace;\n font-size-adjust: .43;\n}\n\npre {\n margin-top: 0;\n margin-bottom: 1rem;\n overflow: auto;\n -ms-overflow-style: scrollbar;\n}\n\nfigure {\n margin: 0 0 1rem;\n}\n\nimg {\n vertical-align: middle;\n border-style: none;\n}\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\na,\narea,\nbutton,\n[role=\"button\"],\ninput:not([type=\"range\"]),\nlabel,\nselect,\nsummary,\ntextarea {\n touch-action: manipulation;\n}\n\ntable {\n border-collapse: collapse;\n}\n\ncaption {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n color: #868e96;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n text-align: inherit;\n}\n\nlabel {\n display: inline-block;\n margin-bottom: .5rem;\n}\n\nbutton {\n border-radius: 0;\n}\n\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\ninput,\nbutton,\nselect,\noptgroup,\ntextarea {\n margin: 0;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\nbutton,\ninput {\n overflow: visible;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\nbutton,\nhtml [type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n box-sizing: border-box;\n padding: 0;\n}\n\ninput[type=\"date\"],\ninput[type=\"time\"],\ninput[type=\"datetime-local\"],\ninput[type=\"month\"] {\n -webkit-appearance: listbox;\n}\n\ntextarea {\n overflow: auto;\n resize: vertical;\n}\n\nfieldset {\n min-width: 0;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\nlegend {\n display: block;\n width: 100%;\n max-width: 100%;\n padding: 0;\n margin-bottom: .5rem;\n font-size: 1.5rem;\n line-height: inherit;\n color: inherit;\n white-space: normal;\n}\n\nprogress {\n vertical-align: baseline;\n}\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type=\"search\"] {\n outline-offset: -2px;\n -webkit-appearance: none;\n}\n\n[type=\"search\"]::-webkit-search-cancel-button,\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n::-webkit-file-upload-button {\n font: inherit;\n -webkit-appearance: button;\n}\n\noutput {\n display: inline-block;\n}\n\nsummary {\n display: list-item;\n}\n\ntemplate {\n display: none;\n}\n\n[hidden] {\n display: none !important;\n}\n","@function toRGB($color) {\n @return red($color) + \", \" + green($color) + \", \" + blue($color);\n}\n\n@function blend-normal ($foreground, $background) {\n $opacity: opacity($foreground);\n $background-opacity: opacity($background);\n\n // calculate opacity\n $bm-red: red($foreground) * $opacity + red($background) * $background-opacity * (1 - $opacity);\n $bm-green: green($foreground) * $opacity + green($background) * $background-opacity * (1 - $opacity);\n $bm-blue: blue($foreground) * $opacity + blue($background) * $background-opacity * (1 - $opacity);\n @return rgb($bm-red, $bm-green, $bm-blue);\n}\n\n$color-primary: #50a2e9;\n\n$color-links: #52a1ef;\n\n$color-placeholders: #A2ACB4;\n\n$color-text-green: #4fae4e;\n$color-green: #4dcd5e;\n$color-light-green: #eefedf;\n\n$color-error: #e53935;\n\n$color-warning: #fb8c00;\n\n$color-yellow: #FDD764;\n\n$color-white: #ffffff;\n$color-black: #000000;\n$color-dark-gray: #2e3939;\n$color-gray: #c4c9cc;\n$color-text-secondary: #707579;\n$color-text-secondary-apple: #8A8A90;\n$color-text-meta: #686c72;\n$color-text-meta-apple: #8C8C91;\n$color-borders: #DADCE0;\n$color-dividers: #C8C6CC;\n$color-item-active: #ededed;\n$color-chat-hover: #f4f4f5;\n$color-chat-active: #5B90E0;\n$color-selection: #3993fb;\n\n// https://github.com/telegramdesktop/tdesktop/wiki/Theme-Reference#user-content-standard-color-constants\n// Colors borrowed from https://github.com/telegramdesktop/tdesktop/blob/dev/Telegram/Resources/day-blue.tdesktop-theme\n// historyPeer[1-8]UserpicBg\n$color-user-1: #E17076;\n$color-user-2: #7BC862;\n//$color-user-3: #E5CA77;\n$color-user-4: #65aadd;\n$color-user-5: #a695e7;\n$color-user-6: #ee7aae;\n$color-user-7: #6ec9cb;\n$color-user-8: #faa774;\n\n:root {\n --color-background: #{$color-white};\n --color-background-selected: #f4f4f5;\n --color-background-secondary: #f4f4f5;\n --color-background-secondary-accent: #E4E4E5;\n --color-background-own: #{$color-light-green};\n --color-background-own-selected: #{darken($color-light-green, 10%)};\n --color-background-own-rgb: #{toRGB($color-light-green)};\n --color-text: #{$color-black};\n --color-text-lighter: #{$color-dark-gray};\n --color-text-secondary: #{$color-text-secondary};\n --color-text-secondary-rgb: #{toRGB($color-text-secondary)};\n --color-text-secondary-apple: #{$color-text-secondary-apple};\n --color-text-meta: #{$color-text-meta};\n --color-text-meta-rgb: #{toRGB($color-text-meta)};\n --color-text-meta-colored: #{$color-text-green};\n --color-text-meta-apple: #{$color-text-meta-apple};\n --color-text-green: #{$color-text-green};\n --color-text-green-rgb: #{toRGB($color-text-green)};\n --color-borders: #{$color-borders};\n --color-borders-input: #{$color-borders};\n --color-dividers: #{$color-dividers};\n --color-webpage-initial-background: #{$color-dark-gray};\n --color-interactive-active: var(--color-primary);\n --color-interactive-inactive: rgba(var(--color-text-secondary-rgb), 0.25);\n --color-interactive-buffered: rgba(var(--color-text-secondary-rgb), 0.25); // Overlays underlying inactive element\n --color-interactive-element-hover: rgba(var(--color-text-secondary-rgb), 0.08);\n\n --color-primary: #{$color-primary};\n --color-primary-rgb: #{toRGB($color-primary)};\n --color-primary-shade: #{mix($color-primary, $color-black, 92%)};\n --color-primary-shade-darker: #{mix($color-primary, $color-black, 84%)};\n --color-primary-shade-rgb: #{toRGB(mix($color-primary, $color-black, 92%))};\n --color-primary-opacity: rgba(var(--color-primary), 0.50);\n --color-green: #{$color-green};\n --color-green-darker: #{mix($color-green, $color-black, 84%)};\n\n --color-error: #{$color-error};\n --color-error-shade: #{mix($color-error, $color-black, 92%)};\n --color-error-rgb: #{toRGB($color-error)};\n\n --color-warning: #{$color-warning};\n\n --color-yellow: #{$color-yellow};\n\n --color-links: #{$color-links};\n --color-links-hover: #{darken($color-links, 8%)};\n --color-links-darker: #{darken($color-links, 15%)};\n --color-links-darker-hover: #{darken($color-links, 23%)};\n\n --color-own-links: #{$color-white};\n\n --color-placeholders: #{$color-placeholders};\n\n --color-pinned: #{$color-white};\n\n --color-code: #4a729a;\n --color-code-bg: #{rgba($color-text-secondary, .08)};\n --color-code-own: #3c7940;\n --color-code-own-bg: #{rgba($color-text-secondary, .08)};\n\n --color-accent-own: #{$color-text-green};\n --color-message-meta-own: #{$color-text-green};\n\n --color-reply-hover: #{blend-normal(rgba($color-text-secondary, 0.08), $color-white)};\n --color-reply-active: #{blend-normal(rgba($color-text-secondary, 0.16), $color-white)};\n --color-reply-own-hover: #{blend-normal(rgba($color-text-green, 0.12), $color-light-green)};\n --color-reply-own-active: #{blend-normal(rgba($color-text-green, 0.24), $color-light-green)};\n\n --color-background-own-apple: #E7FDCC;\n --color-reply-own-hover-apple: #d9f9c1;\n --color-reply-own-active-apple: #d5edc2;\n\n --color-white: #{$color-white};\n --color-gray: #{$color-gray};\n\n --color-chat-hover: #{$color-chat-hover};\n --color-chat-active: #{$color-chat-active};\n --color-item-active: #{$color-item-active};\n\n --color-selection-highlight: #{$color-selection};\n --color-selection-highlight-emoji: rgba(#{toRGB($color-selection)}, .7);\n\n --color-user-1: #{$color-user-1};\n --color-user-2: #{$color-user-2};\n --color-user-4: #{$color-user-4};\n --color-user-5: #{$color-user-5};\n --color-user-6: #{$color-user-6};\n --color-user-7: #{$color-user-7};\n --color-user-8: #{$color-user-8};\n\n --color-default-shadow: #72727240;\n --color-light-shadow: #7272722B;\n\n --vh: 1vh;\n\n --border-radius-default: 0.75rem;\n --border-radius-default-small: 0.625rem;\n --border-radius-default-tiny: 0.375rem;\n --border-radius-messages: 0.75rem;\n --border-radius-messages-small: 0.375rem;\n --messages-container-width: 45.5rem;\n --right-column-width: 26.5rem;\n --header-height: 3.5rem;\n\n --symbol-menu-width: 26.25rem;\n --symbol-menu-height: 23.25rem;\n --symbol-menu-footer-height: 3rem;\n\n @media (min-width: 1276px) and (max-width: 1680px) {\n --right-column-width: 25vw;\n }\n\n @media (max-width: 600px) {\n --right-column-width: 100vw;\n --symbol-menu-width: 100vw;\n --symbol-menu-height: 14.6875rem;\n }\n\n --z-ui-loader-mask: 2000;\n --z-notification: 1000;\n --z-right-column: 900;\n --z-header-menu: 990;\n --z-header-menu-backdrop: 980;\n --z-modal: 1000;\n --z-media-viewer: 1500;\n --z-drop-area: 55;\n --z-animation-fade: 50;\n --z-menu-bubble: 21;\n --z-menu-backdrop: 20;\n --z-message-highlighted: 14;\n --z-message-context-menu: 13;\n --z-scroll-down-button: 12;\n --z-mobile-search: 12;\n --z-middle-header: 11;\n --z-middle-footer: 11;\n --z-country-code-input-group: 10;\n --z-message-select-control: 9;\n --z-message-select-area: 8;\n --z-sticky-date: 9;\n --z-register-add-avatar: 5;\n --z-media-viewer-head: 3;\n --z-below: -1;\n\n --spinner-white-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iI2ZmZmZmZiIvPjwvc3ZnPg==);\n --spinner-white-thin-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iI2ZmZmZmZiIgZD0iTTEyIDIzQzUuOSAyMyAxIDE4LjEgMSAxMlM1LjkgMSAxMiAxVjBDNS40IDAgMCA1LjQgMCAxMnM1LjQgMTIgMTIgMTIgMTItNS40IDEyLTEyaC0xYzAgNi4xLTQuOSAxMS0xMSAxMXoiLz48L3N2Zz4=);\n --spinner-blue-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzRlYTRmNiIvPjwvc3ZnPg==);\n --spinner-dark-blue-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzgzNzhEQiIvPjwvc3ZnPg==);\n --spinner-black-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzJlMzkzOSIvPjwvc3ZnPg==);\n --spinner-green-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzRmYWU0ZSIvPjwvc3ZnPg==);\n --spinner-gray-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzcwNzU3OSIvPjwvc3ZnPg==);\n\n --drag-target-border: url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='8' ry='8' stroke='%23DDDFE0' stroke-width='4' stroke-dasharray='9.1%2c 10.5' stroke-dashoffset='3' stroke-linecap='round'/%3e%3c/svg%3e\");\n --drag-target-border-hovered: url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='8' ry='8' stroke='%2363A2E3' stroke-width='4' stroke-dasharray='9.1%2c 10.5' stroke-dashoffset='3' stroke-linecap='round'/%3e%3c/svg%3e\");\n\n --layer-transition: 300ms cubic-bezier(0.33, 1, 0.68, 1);\n --layer-blackout-opacity: 0.3;\n\n // For some reason these parameters cause worse animation in desktop Chrome\n @media (max-width: 600px) {\n --layer-transition: 450ms cubic-bezier(0.25, 1, 0.5, 1);\n }\n\n --slide-transition: 300ms cubic-bezier(0.25, 1, 0.5, 1);\n\n body.is-android {\n --slide-transition: 200ms ease-in-out;\n }\n\n --select-transition: 200ms ease-out;\n}\n","$spacer: 1rem !default;\n$spacers: () !default;\n$spacers: map-merge(\n (\n 0: 0,\n 1: ($spacer * .25),\n 2: ($spacer * .5),\n 3: $spacer,\n 4: ($spacer * 1.5),\n 5: ($spacer * 2),\n 6: ($spacer * 3),\n ),\n $spacers\n);\n\n// Margin and Padding\n\n@each $prop, $abbrev in (margin: m, padding: p) {\n @each $size, $length in $spacers {\n\n .#{$abbrev}-#{$size} { #{$prop}: $length !important; }\n .#{$abbrev}t-#{$size},\n .#{$abbrev}y-#{$size} {\n #{$prop}-top: $length !important;\n }\n .#{$abbrev}r-#{$size},\n .#{$abbrev}x-#{$size} {\n #{$prop}-right: $length !important;\n }\n .#{$abbrev}b-#{$size},\n .#{$abbrev}y-#{$size} {\n #{$prop}-bottom: $length !important;\n }\n .#{$abbrev}l-#{$size},\n .#{$abbrev}x-#{$size} {\n #{$prop}-left: $length !important;\n }\n }\n}\n",".input-group {\n position: relative;\n margin-bottom: 1.5rem;\n\n label {\n display: block;\n padding: 0 0.25rem;\n position: absolute;\n left: 0.75rem;\n top: 0.95rem;\n background-color: var(--color-background);\n font-size: 1rem;\n font-weight: 400;\n color: var(--color-placeholders);\n transition: transform 0.15s ease-out, color .15s ease-out;\n cursor: text;\n pointer-events: none;\n transform-origin: left center;\n white-space: nowrap;\n }\n\n &.with-arrow {\n &::after {\n content: '';\n position: absolute;\n height: .75rem;\n width: .75rem;\n border-left: 1px var(--color-text-secondary) solid;\n border-bottom: 1px var(--color-text-secondary) solid;\n transform: rotate(-45deg);\n right: 2rem;\n top: 1rem;\n }\n }\n\n &.touched label,\n &.error label,\n &.success label,\n .form-control:focus + label,\n .form-control.focus + label {\n transform: scale(.75) translate(-0.5rem, -2.25rem);\n }\n\n input::placeholder,\n .form-control::placeholder {\n color: var(--color-placeholders);\n }\n\n &.touched label {\n color: var(--color-text-secondary);\n }\n\n &.error label {\n color: var(--color-error) !important;\n }\n\n &.success label {\n color: var(--color-text-green) !important;\n }\n\n &.disabled {\n opacity: 0.5;\n pointer-events: none;\n }\n\n &[dir=rtl] {\n input {\n text-align: right;\n }\n\n label {\n left: auto;\n right: 0.75rem;\n }\n\n &.with-arrow {\n &::after {\n border-left: none;\n border-right: 1px var(--color-text-secondary) solid;\n right: auto;\n left: 2rem;\n }\n }\n\n &.touched label,\n &.error label,\n &.success label,\n .form-control:focus + label,\n .form-control.focus + label {\n transform: scale(.75) translate(1.5rem, -2.25rem);\n }\n }\n}\n\n.form-control {\n --border-width: 1px;\n display: block;\n width: 100%;\n height: 3.375rem;\n padding: calc(0.75rem - var(--border-width)) calc(.9rem - var(--border-width));\n border: var(--border-width) solid var(--color-borders-input);\n border-radius: var(--border-radius-default);\n color: var(--color-text);\n background-color: var(--color-background);\n outline: none;\n transition: border-color 0.15s ease;\n word-break: break-word;\n -webkit-appearance: none;\n\n font-size: 1rem;\n line-height: 1.25rem;\n\n &[dir] {\n text-align: initial;\n }\n\n &:hover {\n border-color: var(--color-primary);\n\n & + label {\n color: var(--color-primary);\n }\n }\n\n &:focus,\n &.focus {\n border-color: var(--color-primary);\n box-shadow: inset 0 0 0 1px var(--color-primary);\n caret-color: var(--color-primary);\n\n & + label {\n color: var(--color-primary);\n }\n }\n\n &:disabled {\n background: none !important;\n }\n\n .error & {\n border-color: var(--color-error);\n box-shadow: inset 0 0 0 1px var(--color-error);\n caret-color: var(--color-error);\n }\n\n .success & {\n border-color: var(--color-text-green);\n box-shadow: inset 0 0 0 1px var(--color-text-green);\n caret-color: var(--color-text-green);\n }\n}\n\nselect.form-control {\n option {\n line-height: 2rem;\n }\n}\n\ntextarea.form-control {\n resize: none;\n overflow: hidden;\n line-height: 1.3125rem;\n padding-top: calc(1rem - var(--border-width));\n padding-bottom: calc(1rem - var(--border-width));\n}\n\n.input-group.password-input {\n position: relative;\n\n .form-control {\n padding-right: 3.375rem;\n }\n\n .toggle-password {\n position: absolute;\n top: 0;\n right: 0;\n width: 3.375rem;\n height: 3.375rem;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n outline: none !important;\n\n color: var(--color-text-secondary);\n opacity: 0.7;\n font-size: 1.5rem;\n\n &:hover, &:focus {\n opacity: 1;\n }\n }\n\n &[dir=rtl] {\n .form-control {\n padding-left: 3.375rem;\n padding-right: calc(.9rem - var(--border-width))\n }\n\n .toggle-password {\n left: 0;\n right: auto;\n }\n }\n}\n","@font-face {\n font-family: 'icomoon';\n src: url('../assets/fonts/icomoon.woff2?n9djnk') format('woff2'),\n url('../assets/fonts/icomoon.woff?n9djnk') format('woff');\n font-weight: normal;\n font-style: normal;\n font-display: block;\n}\n\n[class^=\"icon-\"], [class*=\" icon-\"] {\n /* use !important to prevent issues with browser extensions that change fonts */\n font-family: 'icomoon' !important;\n speak: none;\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n[class^=\"icon-char-\"], [class*=\" icon-char-\"] {\n &::before {\n font-family: Roboto, \"Helvetica Neue\", sans-serif;\n content: attr(data-char);\n width: 1.5rem;\n text-align: center;\n display: block;\n }\n}\n\n.icon-bot-commands-filled:before {\n content: \"\\e97f\";\n}\n.icon-reply-filled:before {\n content: \"\\e980\";\n}\n.icon-bug:before {\n content: \"\\e97e\";\n}\n.icon-data:before {\n content: \"\\e97d\";\n}\n.icon-darkmode:before {\n content: \"\\e979\";\n}\n.icon-animations:before {\n content: \"\\e97a\";\n}\n.icon-enter:before {\n content: \"\\e97b\";\n}\n.icon-fontsize:before {\n content: \"\\e97c\";\n}\n.icon-permissions:before {\n content: \"\\e976\";\n}\n.icon-card:before {\n content: \"\\e977\";\n}\n.icon-truck:before {\n content: \"\\e978\";\n}\n.icon-share-filled:before {\n content: \"\\e95a\";\n}\n.icon-bold:before {\n content: \"\\e961\";\n}\n.icon-bot-command:before {\n content: \"\\e962\";\n}\n.icon-calendar-filter:before {\n content: \"\\e963\";\n}\n.icon-comments:before {\n content: \"\\e964\";\n}\n.icon-comments-sticker:before {\n content: \"\\e965\";\n}\n.icon-arrow-down:before {\n content: \"\\e966\";\n}\n.icon-email:before {\n content: \"\\e967\";\n}\n.icon-italic:before {\n content: \"\\e968\";\n}\n.icon-link:before {\n content: \"\\e969\";\n}\n.icon-mention:before {\n content: \"\\e96a\";\n}\n.icon-monospace:before {\n content: \"\\e96b\";\n}\n.icon-next:before {\n content: \"\\e96c\";\n}\n.icon-password-off:before {\n content: \"\\e96d\";\n}\n.icon-pin-list:before {\n content: \"\\e96e\";\n}\n.icon-previous:before {\n content: \"\\e96f\";\n}\n.icon-replace:before {\n content: \"\\e970\";\n}\n.icon-schedule:before {\n content: \"\\e971\";\n}\n.icon-strikethrough:before {\n content: \"\\e972\";\n}\n.icon-underlined:before {\n content: \"\\e973\";\n}\n.icon-zoom-in:before {\n content: \"\\e974\";\n}\n.icon-zoom-out:before {\n content: \"\\e975\";\n}\n.icon-select:before {\n content: \"\\e960\";\n}\n.icon-folder:before {\n content: \"\\e913\";\n}\n.icon-bots:before {\n content: \"\\e915\";\n}\n.icon-calendar:before {\n content: \"\\e916\";\n}\n.icon-cloud-download:before {\n content: \"\\e917\";\n}\n.icon-colorize:before {\n content: \"\\e918\";\n}\n.icon-forward:before {\n content: \"\\e927\";\n}\n.icon-reply:before {\n content: \"\\e947\";\n}\n.icon-help:before {\n content: \"\\e92a\";\n}\n.icon-info:before {\n content: \"\\e92b\";\n}\n.icon-info-filled:before {\n content: \"\\e91b\";\n}\n.icon-delete-filled:before {\n content: \"\\e91c\";\n}\n.icon-delete:before {\n content: \"\\e91d\";\n}\n.icon-edit:before {\n content: \"\\e923\";\n}\n.icon-new-chat-filled:before {\n content: \"\\e939\";\n}\n.icon-send:before {\n content: \"\\e94a\";\n}\n.icon-send-outline:before {\n content: \"\\e94b\";\n}\n.icon-add-user-filled:before {\n content: \"\\e904\";\n}\n.icon-add-user:before {\n content: \"\\e905\";\n}\n.icon-delete-user:before {\n content: \"\\e91e\";\n}\n.icon-microphone:before {\n content: \"\\e935\";\n}\n.icon-microphone-alt:before {\n content: \"\\e93b\";\n}\n.icon-poll:before {\n content: \"\\e938\";\n}\n.icon-revote:before {\n content: \"\\e93a\";\n}\n.icon-photo:before {\n content: \"\\e940\";\n}\n.icon-document:before {\n content: \"\\e91f\";\n}\n.icon-camera:before {\n content: \"\\e90e\";\n}\n.icon-camera-add:before {\n content: \"\\e90f\";\n}\n.icon-logout:before {\n content: \"\\e932\";\n}\n.icon-saved-messages:before {\n content: \"\\e948\";\n}\n.icon-settings:before {\n content: \"\\e94e\";\n}\n.icon-phone:before {\n content: \"\\e93f\";\n}\n.icon-attach:before {\n content: \"\\e909\";\n}\n.icon-copy:before {\n content: \"\\e91a\";\n}\n.icon-channel:before {\n content: \"\\e911\";\n}\n.icon-group:before {\n content: \"\\e929\";\n}\n.icon-user:before {\n content: \"\\e959\";\n}\n.icon-non-contacts:before {\n content: \"\\e928\";\n}\n.icon-active-sessions:before {\n content: \"\\e902\";\n}\n.icon-admin:before {\n content: \"\\e906\";\n}\n.icon-download:before {\n content: \"\\e921\";\n}\n.icon-location:before {\n content: \"\\e930\";\n}\n.icon-stop:before {\n content: \"\\e952\";\n}\n.icon-archive:before {\n content: \"\\e908\";\n}\n.icon-unarchive:before {\n content: \"\\e953\";\n}\n.icon-readchats:before {\n content: \"\\e933\";\n}\n.icon-unread:before {\n content: \"\\e957\";\n}\n.icon-message:before {\n content: \"\\e934\";\n}\n.icon-lock:before {\n content: \"\\e931\";\n}\n.icon-unlock:before {\n content: \"\\e954\";\n}\n.icon-mute:before {\n content: \"\\e937\";\n}\n.icon-unmute:before {\n content: \"\\e955\";\n}\n.icon-pin:before {\n content: \"\\e941\";\n}\n.icon-unpin:before {\n content: \"\\e956\";\n}\n.icon-smallscreen:before {\n content: \"\\e95e\";\n}\n.icon-fullscreen:before {\n content: \"\\e95f\";\n}\n.icon-large-pause:before {\n content: \"\\e92e\";\n}\n.icon-large-play:before {\n content: \"\\e92f\";\n}\n.icon-pause:before {\n content: \"\\e93d\";\n}\n.icon-play:before {\n content: \"\\e943\";\n}\n.icon-channelviews:before {\n content: \"\\e912\";\n}\n.icon-message-succeeded:before {\n content: \"\\e900\";\n}\n.icon-message-read:before {\n content: \"\\e901\";\n}\n.icon-message-pending:before {\n content: \"\\e94c\";\n}\n.icon-message-failed:before {\n content: \"\\e94d\";\n}\n.icon-favorite:before {\n content: \"\\e93e\";\n}\n.icon-keyboard:before {\n content: \"\\e944\";\n}\n.icon-delete-left:before {\n content: \"\\e945\";\n}\n.icon-recent:before {\n content: \"\\e946\";\n}\n.icon-gifs:before {\n content: \"\\e94f\";\n}\n.icon-stickers:before {\n content: \"\\e95b\";\n}\n.icon-smile:before {\n content: \"\\e950\";\n}\n.icon-animals:before {\n content: \"\\e907\";\n}\n.icon-eats:before {\n content: \"\\e922\";\n}\n.icon-sport:before {\n content: \"\\e951\";\n}\n.icon-car:before {\n content: \"\\e910\";\n}\n.icon-lamp:before {\n content: \"\\e92c\";\n}\n.icon-language:before {\n content: \"\\e92d\";\n}\n.icon-flag:before {\n content: \"\\e926\";\n}\n.icon-more:before {\n content: \"\\e936\";\n}\n.icon-search:before {\n content: \"\\e949\";\n}\n.icon-remove:before {\n content: \"\\e95c\";\n}\n.icon-add:before {\n content: \"\\e903\";\n}\n.icon-check:before {\n content: \"\\e914\";\n}\n.icon-close:before {\n content: \"\\e919\";\n}\n.icon-arrow-left:before {\n content: \"\\e90d\";\n}\n.icon-arrow-right:before {\n content: \"\\e93c\";\n}\n.icon-down:before {\n content: \"\\e920\";\n}\n.icon-up:before {\n content: \"\\e958\";\n}\n.icon-eye-closed:before {\n content: \"\\e925\";\n}\n.icon-eye:before {\n content: \"\\e924\";\n}\n.icon-muted-chat:before {\n content: \"\\e95d\";\n}\n.icon-avatar-archived-chats:before {\n content: \"\\e90a\";\n}\n.icon-avatar-deleted-account:before {\n content: \"\\e90b\";\n}\n.icon-avatar-saved-messages:before {\n content: \"\\e90c\";\n}\n.icon-pinned-chat:before {\n content: \"\\e942\";\n}\n","@import './mixins';\n\n// Common styles for all media-type components across the app.\n.media-inner {\n position: relative;\n\n video,\n img {\n display: block;\n }\n\n img, video {\n object-fit: cover;\n }\n\n video {\n background: no-repeat 50% 50%;\n background-size: contain;\n }\n\n .thumbnail ~ .thumbnail, .thumbnail ~ .full-media, .media-loading {\n position: absolute;\n }\n}\n\n.animated-close-icon {\n position: absolute;\n transform: rotate(-45deg);\n\n &, &::before, &::after {\n width: 1.125rem;\n height: 0.125rem;\n border-radius: 0.125rem;\n background-color: var(--color-text-secondary);\n transition: transform var(--slide-transition);\n }\n\n &::before, &::after {\n position: absolute;\n left: 0;\n top: 0;\n content: '';\n }\n\n &::before {\n transform: rotate(90deg);\n }\n\n &.no-transition {\n &, &::before, &::after {\n transition: none;\n }\n }\n\n &.state-back {\n transform: rotate(180deg);\n\n &::before {\n transform: rotate(45deg) scaleX(0.75) translate(0, -0.375rem);\n }\n\n &::after {\n transform: rotate(-45deg) scaleX(0.75) translate(0, 0.375rem);\n }\n }\n}\n\n// Used by ChatList and ContactList components\n.chat-list {\n background: var(--color-background);\n height: 100%;\n padding: .5rem .125rem .5rem .4375rem;\n\n overflow-y: auto;\n body.is-android & {\n @include overflow-y-overlay();\n }\n\n .scroll-container {\n position: relative;\n }\n\n .ListItem.chat-item-clickable {\n margin: 0;\n }\n\n @media (max-width: 600px) {\n padding-left: 0;\n padding-right: 0;\n }\n\n .no-results {\n color: var(--color-text-meta);\n margin-top: 2rem;\n text-align: center;\n }\n}\n\n// Used by Avatar and ProfilePhoto components\ndiv {\n &.color-bg-1 {\n --color-user: var(--color-user-1);\n }\n\n &.color-bg-2 {\n --color-user: var(--color-user-2);\n }\n\n &.color-bg-4 {\n --color-user: var(--color-user-4);\n }\n\n &.color-bg-5 {\n --color-user: var(--color-user-5);\n }\n\n &.color-bg-6 {\n --color-user: var(--color-user-6);\n }\n\n &.color-bg-7 {\n --color-user: var(--color-user-7);\n }\n\n &.color-bg-8 {\n --color-user: var(--color-user-8);\n }\n\n &.saved-messages {\n --color-user: var(--color-primary);\n }\n\n &.deleted-account {\n --color-user: var(--color-gray);\n }\n}\n","// @optimization\n@mixin while-transition() {\n .Transition > div:not(.active) &, body.animating-right-column & {\n @content;\n }\n}\n\n@mixin overflow-y-overlay() {\n @supports (overflow-y: overlay) {\n overflow-y: overlay;\n\n //Workaround for Android <= 9\n overflow-x: hidden;\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"main.1caddd72e47829af6ab5.css","mappings":"AAAA,MACE,cAEA,YACE,c;ACJJ,UACE,YACA,yBAFF,UAGI,mCAGF,gBACE,eACA,MACA,OACA,QACA,cACA,WACA,iBACA,YACA,gCACA,aAEA,sBACE,OACA,mCACA,kBACA,kBAEA,0BANF,sBAOI,4CAGF,0BAVF,sBAWI,QAGF,yBAdF,sBAeI,mBAGF,yBAlBF,sBAmBI,eACA,aAIJ,wBACE,OACA,2CACA,4CACA,kBACA,UACA,gBAEA,gCACE,WACA,cACA,kBACA,MACA,OACA,SACA,QACA,4BACA,sBACA,WACA,6BAEA,yDACE,yBAGF,6GAEE,yDAIJ,kDACE,sBAGF,sCACE,gCACE,8BAIJ,gDACE,aACA,iCAGF,0BA9CF,wBA+CI,OACA,mBAGF,yBAnDF,wBAoDI,cAIJ,uBACE,kBACA,MACA,QACA,UACA,YACA,gCACA,kBACA,kBACA,2CACA,mCAIJ,iBACE,OACA,kC;AClHJ,SACE,qBAEA,kBACA,aACA,mBACA,uBAEA,0BACA,2BAEA,aACE,kBACA,MACA,OACA,QACA,SAEA,4BACA,qBAEA,oBACA,sBACA,mCACA,iCAIA,iCACE,WACA,kBACA,eACA,cACA,iBACA,gBACA,kBACA,2BAKF,mBACE,2CAIA,mCACE,gDAMJ,kBACE,0CACA,8BACE,+CAMJ,mBACE,2CAKF,mBACE,2CAKF,kBACE,0CAKN,gBACE,KACE,uBAEF,GACE,0B;ACvEJ,4BACE,KACE,mBACA,UAEF,IACE,UAEF,GACE,UACA,oBAIJ,kBACE,kBACA,MACA,OACA,SACA,QAEA,yCACE,aAGF,uBACE,kBACA,cACA,0DACA,kBACA,mBACA,iC;ACtBJ,QACE,wBACA,aACA,mBACA,uBACA,WACA,cACA,SACA,2CACA,uBACA,gBACA,WACA,gBACA,eACA,yBACA,cACA,kBACA,gBACA,4CACA,gCAGA,8DACE,2BAGF,iBACE,sBACA,eACA,oBAGF,cACE,aACA,kBAEA,gBACE,iBAIJ,gBACE,gCACA,yBACA,mCAjEA,8JAoEE,sCAjEF,qBACE,oDAgEA,uCAtDA,4EA0DA,6CAIJ,kBACE,mCACA,kDACA,mCA/EA,oKAkFE,gCACA,WAhFF,qBACE,sDA8EA,gCACA,YArEA,8EAyEA,sCAIJ,aACE,mCACA,kCACA,mCA9FA,qJAiGE,2BA9FF,qBACE,iDA6FA,4BAnFA,yEAuFA,mC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kBACA,uBACA,UAIA,iEACE,WACA,cACA,kBACA,eACA,aACA,eACA,gBAGF,iCACE,4CACA,qBACA,yCACA,2DAGF,gCACE,oEACA,wBACA,UACA,4BAGF,gCACE,cACA,mBAGF,mCACE,cACA,kBACA,iBACA,kCAKF,+CACE,kCACA,sCAGF,8CACE,UAIJ,mBACE,eACA,qBAGE,oCACE,UACA,cAIJ,uDAEE,iBAIA,mFACE,UACA,g1C;ACvIR,SACE,aACA,YACA,mBACA,uBAEA,kBACE,wB;ACNF,oBACE,kBACA,WAGF,gBACE,eACA,YACA,aACA,WACA,cACA,+BAGF,cACE,gBACA,cACA,gBACA,gBACA,SACA,kBACA,yCACA,8DACA,2CACA,kBACA,6BAEA,qBACA,0GAmBA,gCACA,cAlBA,mBACE,mBAGF,sBACE,gEAGF,qCACE,0BACA,mCAGF,mCACE,2BAMF,kBACE,oBAGF,qBACE,uBAGF,mBACE,qBAGF,oBACE,sBAGF,0BACE,iBAIJ,cACE,gBACA,mCACA,kCACA,mBACA,kB;AC7EJ,cACE,kB;ACDF,UACE,WACA,gBACA,uBACA,2BACA,wBACA,aACA,aACA,kBACA,gBACA,mBACA,mBACA,wBACA,mCACA,eACA,uBAEA,qBACE,gCACE,yCACA,qBACA,eAIJ,yBACE,iDACE,qBACA,cAGF,iBACE,0CAIJ,YACE,iBACA,kBACA,kCAGF,0BACE,kBAEA,qCACE,0BAIJ,mBACE,sBACA,0BAGF,sBACE,yBAEA,wBACE,cAIJ,iDACE,0CACA,2BAGF,oBACE,iBAIA,qBACE,iBACA,eAGF,mCACE,iBACA,eAGF,6BACE,cACA,kB;ACnFJ,+BACE,eAEA,0CAEA,wCACE,kBACA,SACA,aACA,WACA,uBAIF,8CACE,kBACA,aACA,WACA,aACA,cACA,6CACA,aACA,cACA,kCACA,0DAEA,mDACE,kCACA,mCACA,WAKN,0BACE,WACA,mBACA,gBACA,uCACA,sBAEA,+BACE,oBAKF,mCACE,aACA,mBAGF,8CACE,uBACA,mBAEA,mDACE,kBAKN,gCACE,eACA,kBAEA,uCACE,WACA,YACA,qBACA,mBACA,uBAIJ,gCACE,mBACA,gBACA,uBACA,kBACA,gBAGF,gCACE,iBACA,W;ACvFJ,WACE,WACA,kBACA,cACA,aACA,iBACA,kBAEA,gDARF,WASI,eACA,mBAEA,cACE,kBAIJ,kDACE,cACA,iBACA,kBACA,aACA,cACA,sBAEA,gDARF,kDASI,YACA,aACA,sBAIJ,iBACE,qBACA,oEAGF,cACE,kBACA,cAEA,yBAJF,cAKI,eACA,iBAIJ,iBACE,kBACA,iBACA,qBACA,kCAEA,yBANF,iBAOI,eACA,oBAKN,kGAKE,YACA,gBAIA,6BACE,oBAGF,gCACE,mBAGF,wCACE,gBAMF,0CACE,aACA,mBACA,uBAIJ,kBACE,aACA,cACA,cACA,iBACA,kCACA,YACA,aACA,mBACA,uBACA,eAEA,gDACE,UAKF,sDACE,aAGF,4BACE,UACA,mBACA,2EAEA,wCACE,WACA,qBAIJ,iBACE,uBAGF,iBACE,gBACA,mBACA,kBAEA,oBACE,uBACA,gBACA,gBACA,aAEA,4BACE,sBACA,aACA,uBACA,mBACA,iBACA,cACA,UACA,oBACA,gCACA,kBACA,kBACA,WAMR,kBACE,kC;AC/JF,aACE,YACA,aACA,sBACA,mBACA,uBAEA,sBACE,gBACA,YACA,eACA,kBAGF,oBACE,gBAGF,0BACE,kCACA,kBAGF,iBACE,WACA,gBAGF,qBACE,gB;AC7BJ,iBAAiB;AACjB;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,sFAAsF;AACxF;AACA,aAAa;AACb;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,4DAA4D;AAC9D;AACA,cAAc;AACd;EACE,qBAAqB;EACrB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,sGAAsG;EACtG,0BAA0B;AAC5B;AACA,UAAU;AACV;EACE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AAmB;EACnB,iBAAiB;EACjB,yBAAyB;AAC3B;;AAEA,gEAAgE;AAChE;EACE,kBAAkB;EAClB;yDAC2C;EAC3C,gBAAgB;EAChB,iBAAiB;EACjB,0BAA0B;AAC5B;;AC1IQ,qBCPR,qBAGE,MAGF,sBACE,iBACA,8BACA,0BACA,6BACA,6CACA,CAIA,6EAEF,aACE,MAGF,QACE,wJACA,eACA,gBACA,gBACA,cACA,gBACA,sBACA,uBAGF,uBACE,IAGF,sBACE,SACA,iBACA,mBAGF,YACE,oBACA,gBACA,GAGF,YACE,mBACA,uCAGF,yBAEE,yCACA,CADA,gCACA,YACA,gBACA,SAGF,kBACE,kBACA,oBACA,UAGF,YAGE,mBACA,yBAGF,eAIE,IAGF,eACE,IAGF,mBACE,cACA,YAGF,eACE,KAGF,iBACE,UAGF,eAEE,OAGF,aACE,SAGF,iBAEE,cACA,cACA,wBACA,KAGF,cACE,KAGF,UACE,GAGF,wBACE,qBACA,6BACA,qCACA,SAEF,aACE,0BACA,+BAGF,aACE,qBACA,yEAEF,aACE,qBACA,qCAEF,SACE,mBAGF,uHAIE,qBACA,KAGF,YACE,mBACA,cACA,6BACA,QAGF,eACE,KAGF,qBACE,kBACA,gBAGF,eACE,mFAGF,yBASE,OAGF,wBACE,SAGF,kBACE,sBACA,cACA,gBACA,oBACA,IAGF,kBACE,OAGF,oBACE,oBACA,QAGF,eACE,cAGF,kBACE,0CACA,uCAGF,QAKE,oBACA,kBACA,oBACA,cAGF,gBAEE,eAGF,mBAEE,sDAGF,yBAIE,yHAGF,SAIE,kBACA,wCAGF,qBAEE,UACA,gFAGF,0BAIE,UAGF,aACE,gBACA,UAGF,WACE,UACA,SACA,SACA,QAGF,aACE,WACA,eACA,UACA,oBACA,iBACA,oBACA,cACA,mBACA,UAGF,uBACE,mFAGF,WAEE,eAGF,mBACE,wBACA,sFAGF,uBAEE,8BAGF,YACE,0BACA,QAGF,oBACE,SAGF,iBACE,UAGF,YACE,UAGF,uBACE,OC7QF,2BACE,qCACA,sCACA,6CACA,gCACA,yCACA,0CACA,sBACA,8BACA,gCACA,0CACA,sCACA,2BACA,qCACA,mCACA,iCACA,4BACA,oCACA,yBACA,+BACA,0BACA,4CACA,iDACA,0EACA,0EACA,+EACA,yBAEA,kCACA,+BACA,sCACA,wCACA,0DACA,uBACA,8BACA,uBAEA,6BACA,+BACA,yBAEA,wBAEA,uBAEA,6BACA,8BACA,oCACA,2BAEA,8BAEA,wBAEA,sBAEA,2CACA,0BACA,+CACA,4BAEA,kCACA,6BAEA,8BACA,iCACA,kCACA,sCAEA,uCACA,wCACA,uBAEA,sBACA,4BAEA,6BACA,6BACA,qCAEA,0DACA,wBAEA,wBACA,wBACA,wBACA,wBACA,wBACA,wBACA,kCAEA,gCACA,UAEA,iCAEA,wCACA,uCACA,kCACA,yCACA,oCACA,8BACA,wBACA,8BAEA,+BACA,kCACA,yBAYA,uBACA,sBACA,qBACA,8BACA,gBACA,uBACA,kBACA,uBACA,oBACA,sBACA,4BACA,6BACA,2BACA,sBACA,sBACA,sBACA,iCACA,8BACA,2BACA,mBACA,2BACA,yBACA,cACA,8DAEA,mEACA,6DACA,kEACA,8DACA,8DACA,6DACA,8DAEA,sEACA,yDAEA,8BACA,wDAOA,oCAMA,kDA5DA,MA7GF,0BA8GI,2BAGF,MAjHF,2BAkHI,2BACA,iCACA,2BA2CF,MA/JF,uDAgKI,wBAKF,qCACE,MC5MA,gCACA,uBAEE,aAEF,yBAEE,aAEF,0BAEE,aAEF,wBAEE,MAfF,qCACA,4BAEE,aAEF,8BAEE,aAEF,+BAEE,aAEF,6BAEE,MAfF,oCACA,2BAEE,aAEF,6BAEE,aAEF,8BAEE,aAEF,4BAEE,MAfF,mCACA,0BAEE,aAEF,4BAEE,aAEF,6BAEE,aAEF,2BAEE,MAfF,qCACA,4BAEE,aAEF,8BAEE,aAEF,+BAEE,aAEF,6BAEE,MAfF,mCACA,0BAEE,aAEF,4BAEE,aAEF,6BAEE,aAEF,2BAEE,MAfF,m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1MN,qBACE,oHACA,mBAEA,kBACA,mBACA,kCAGF,gCAEE,WACA,kBACA,mBACA,oBACA,oBACA,cACA,mCAGA,kCACA,4DAIA,8CACE,wBACA,aACA,kBACA,cACA,kCAIJ,WACE,2BAEF,WACE,kBAEF,WACE,mBAEF,WACE,uBAEF,WACE,yBAEF,WACE,oBAEF,WACE,uBAEF,WACE,0BAEF,WACE,mBAEF,WACE,oBAEF,WACE,2BAEF,WACE,mBAEF,WACE,0BAEF,WACE,8BAEF,WACE,uBAEF,WACE,+BAEF,WACE,yBAEF,WACE,oBAEF,WACE,qBAEF,WACE,mBAEF,WACE,sBAEF,WACE,wBAEF,WACE,mBAEF,WACE,2BAEF,WACE,uBAEF,WACE,uBAEF,WACE,sBAEF,WACE,uBAEF,WACE,4BAEF,WACE,yBAEF,WACE,sBAEF,WACE,uBAEF,WACE,qBAEF,WACE,qBAEF,WACE,mBAEF,WACE,uBAEF,WACE,6BAEF,WACE,uBAEF,WACE,sBAEF,WACE,oBAEF,WACE,mBAEF,WACE,mBAEF,WACE,0BAEF,WACE,4BAEF,WACE,qBAEF,WACE,mBAEF,WACE,8BAEF,WACE,mBAEF,WACE,2BAEF,WACE,8BAEF,WACE,uBAEF,WACE,0BAEF,WACE,yBAEF,WACE,6BAEF,WACE,mBAEF,WACE,qBAEF,WACE,oBAEF,WACE,uBAEF,WACE,qBAEF,WACE,yBAEF,WACE,qBAEF,WACE,6BAEF,WACE,uBAEF,WACE,oBAEF,WACE,qBAEF,WACE,mBAEF,WACE,sBAEF,WACE,oBAEF,WACE,mBAEF,WACE,2BAEF,WACE,8BAEF,WACE,oBAEF,WACE,uBAEF,WACE,uBAEF,WACE,mBAEF,WACE,sBAEF,WACE,wBAEF,WACE,wBAEF,WACE,qBAEF,WACE,sBAEF,WACE,mBAEF,WACE,qBAEF,WACE,mBAEF,WACE,qBAEF,WACE,kBAEF,WACE,oBAEF,WACE,0BAEF,WACE,yBAEF,WACE,0BAEF,WACE,yBAEF,WACE,oBA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ACE,qCAEA,6BACE,GAIJ,qBACE,qFAGF,0BAGE,iCAGF,oBAEE,6CACA,oCACA,iCAEA,oBAEA,mFAEA,iCACE,qBACA,mJAGF,6CACE,ySAEA,kCACE,mCAMJ,aACE,qCAKF,aACE,eAIJ,oBACE,kCAEA,YACE,cAIJ,oBACE,wBACA,kBACA,qBACA,cACA,eACA,sBACA,gBACA,cACA,yBAEA,uDACE,kBACA,kBAIJ,uBACE,eACA,qBAGF,SACE,6BACA,gCAEA,SACE,iCAGF,YACE,0BAGF,uBACE,gBAIJ,qCACE,eAGF,mCACE,aAGF,4CACE,iCAGF,cACE,eACA,UACA,YACA,WACA,sBAGF,GACE,oBACE,WACA,KAEF,oBACE,UACA,MAEF,kBACE,uBAIJ,KACE,kBACE,WACA,IAEF,oBACE,UACA,0tG","sources":["webpack://telegram-t/./src/components/ui/Link.scss","webpack://telegram-t/./src/components/common/UiLoader.scss","webpack://telegram-t/./src/components/ui/Spinner.scss","webpack://telegram-t/./src/components/ui/RippleEffect.scss","webpack://telegram-t/./src/components/ui/Button.scss","webpack://telegram-t/./src/components/ui/Checkbox.scss","webpack://telegram-t/./src/components/ui/Loading.scss","webpack://telegram-t/./src/components/ui/Menu.scss","webpack://telegram-t/./src/components/ui/DropdownMenu.scss","webpack://telegram-t/./src/components/ui/MenuItem.scss","webpack://telegram-t/./src/components/auth/CountryCodeInput.scss","webpack://telegram-t/./src/components/auth/Auth.scss","webpack://telegram-t/./src/components/main/AppInactive.scss","webpack://telegram-t/./src/assets/fonts/roboto.css","webpack://telegram-t/./src/styles/index.scss","webpack://telegram-t/./src/styles/reboot.css","webpack://telegram-t/./src/styles/_variables.scss","webpack://telegram-t/./src/styles/_spacing.scss","webpack://telegram-t/./src/styles/_forms.scss","webpack://telegram-t/./src/styles/icons.scss","webpack://telegram-t/./src/styles/_common.scss","webpack://telegram-t/./src/styles/_mixins.scss"],"sourcesContent":[".Link {\n color: inherit;\n\n &:hover {\n color: inherit;\n }\n}\n","#UiLoader {\n height: 100%;\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n\n .mask {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n margin: 0 auto;\n width: 100%;\n max-width: 1680px;\n height: 100%;\n z-index: var(--z-ui-loader-mask);\n display: flex;\n\n .left {\n flex: 1;\n background: var(--color-background);\n min-width: 15.5rem;\n max-width: 26.5rem;\n\n @media (min-width: 1680px) {\n border-left: 1px solid var(--color-borders);\n }\n\n @media (max-width: 1275px) {\n flex: 2;\n }\n\n @media (max-width: 925px) {\n min-width: 26.5rem;\n }\n\n @media (max-width: 600px) {\n max-width: none;\n width: 100vw;\n }\n }\n\n .middle {\n flex: 3;\n border-left: 1px solid var(--color-borders);\n border-right: 1px solid var(--color-borders);\n position: relative;\n z-index: 1;\n overflow: hidden;\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n background: no-repeat center;\n background-size: cover;\n z-index: -1;\n transform-origin: left center;\n\n .theme-dark body.initial & {\n background-color: #0f0f0f;\n }\n\n .theme-light body.initial &,\n body:not(.initial) & {\n background-image: url('../../assets/chat-bg.jpg');\n }\n }\n\n &.with-right-column::before {\n transform: scale(0.67);\n }\n\n @media screen and (min-width: 1276px) {\n &::before {\n margin: -16rem -5rem -20rem 0;\n }\n }\n\n &.custom-bg-image::before {\n margin: -1rem;\n background-image: none !important;\n }\n\n @media (max-width: 1275px) {\n flex: 3;\n border-right: none;\n }\n\n @media (max-width: 600px) {\n display: none;\n }\n }\n\n .right {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n height: 100%;\n width: var(--right-column-width);\n min-width: 15.5rem;\n max-width: 26.5rem;\n border-left: 1px solid var(--color-borders);\n background: var(--color-background);\n }\n }\n\n .blank {\n flex: 1;\n background: var(--color-background);\n }\n}\n",".Spinner {\n --spinner-size: 2rem;\n\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: var(--spinner-size);\n height: var(--spinner-size);\n\n > div {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n\n background-repeat: no-repeat;\n background-size: 100%;\n\n animation-name: spin;\n animation-duration: 1s;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n }\n\n &.with-background {\n &::before {\n content: '';\n position: absolute;\n left: -0.125rem;\n top: -0.125rem;\n bottom: -0.125rem;\n right: -0.125rem;\n border-radius: 50%;\n background: rgba(0,0,0,0.25);\n }\n }\n\n &.white {\n > div {\n background-image: var(--spinner-white-data);\n }\n\n &.with-background {\n > div {\n background-image: var(--spinner-white-thin-data);\n }\n }\n }\n\n &.blue {\n > div {\n background-image: var(--spinner-blue-data);\n .theme-dark & {\n background-image: var(--spinner-dark-blue-data);\n }\n }\n }\n\n &.black {\n > div {\n background-image: var(--spinner-black-data);\n }\n }\n\n &.green {\n > div {\n background-image: var(--spinner-green-data);\n }\n }\n\n &.gray {\n > div {\n background-image: var(--spinner-gray-data);\n }\n }\n}\n\n@keyframes spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n","@-webkit-keyframes ripple-animation {\n from {\n transform: scale(0);\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n to {\n opacity: 0;\n transform: scale(2);\n }\n}\n\n@keyframes ripple-animation {\n from {\n transform: scale(0);\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n to {\n opacity: 0;\n transform: scale(2);\n }\n}\n\n.ripple-container {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n\n body.animation-level-0 & {\n display: none;\n }\n\n span {\n position: absolute;\n display: block;\n background-color: var(--ripple-color, rgba(0, 0, 0, .08));\n border-radius: 50%;\n transform: scale(0);\n animation: ripple-animation 700ms;\n }\n}\n","@mixin active-styles() {\n &:not(.disabled):not(:disabled) {\n &:active, &.active, &:focus {\n @content;\n }\n @media (hover:hover) {\n &:hover {\n @content;\n }\n }\n }\n}\n\n@mixin no-ripple-styles() {\n body.animation-level-0 & {\n &:not(.disabled):not(:disabled) {\n &:active {\n @content;\n }\n }\n }\n}\n\n.Button {\n outline: none !important;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 3.5rem;\n border: 0;\n border-radius: var(--border-radius-default);\n background: transparent;\n padding: 0.625rem;\n color: white;\n line-height: 1.2;\n cursor: pointer;\n text-transform: uppercase;\n flex-shrink: 0;\n position: relative;\n overflow: hidden;\n transition: background-color .15s, color .15s;\n text-decoration: none !important;\n\n // @optimization\n &:active, &.clicked, body.animation-level-0 & {\n transition: none !important;\n }\n\n &.disabled {\n opacity: 0.5 !important;\n cursor: default;\n pointer-events: none;\n }\n\n &.round {\n width: 3.5rem;\n border-radius: 50%;\n\n i {\n font-size: 1.5rem;\n }\n }\n\n &.primary {\n background: var(--color-primary);\n color: var(--color-white);\n --ripple-color: rgba(0, 0, 0, .08);\n\n @include active-styles() {\n background: var(--color-primary-shade);\n }\n\n @include no-ripple-styles() {\n background: var(--color-primary-shade-darker);\n }\n }\n\n &.secondary {\n background: var(--color-background);\n color: rgba(var(--color-text-secondary-rgb), 0.75);\n --ripple-color: rgba(0, 0, 0, .08);\n\n @include active-styles() {\n background: var(--color-primary);\n color: white;\n }\n\n @include no-ripple-styles() {\n background: var(--color-primary-shade);\n }\n }\n\n &.gray {\n background: var(--color-background);\n color: var(--color-text-secondary);\n --ripple-color: rgba(0, 0, 0, .08);\n\n @include active-styles() {\n color: var(--color-primary);\n }\n\n @include no-ripple-styles() {\n background: var(--color-chat-hover);\n }\n }\n\n &.danger {\n background: var(--color-background);\n color: var(--color-error);\n --ripple-color: rgba(var(--color-error-rgb), .16);\n\n @include active-styles() {\n background: var(--color-error);\n color: var(--color-white);\n }\n\n @include no-ripple-styles() {\n background: var(--color-error-shade);\n }\n }\n\n &.text {\n background: none;\n\n &.primary {\n color: var(--color-primary);\n background: none;\n\n @include active-styles() {\n background: rgba(var(--color-primary-shade-rgb), .08);\n }\n\n @include no-ripple-styles() {\n background: rgba(var(--color-primary-shade-rgb), .16);\n }\n }\n\n &.secondary {\n background: none;\n color: var(--color-text-secondary);\n }\n\n &.danger {\n @include active-styles() {\n background: rgba(var(--color-error-rgb), .08);\n color: var(--color-error);\n }\n\n @include no-ripple-styles() {\n background: rgba(var(--color-error-rgb), .16);\n }\n }\n }\n\n &.faded {\n opacity: 0.8;\n\n @include active-styles() {\n opacity: 1;\n }\n\n &.activated {\n opacity: 1;\n }\n }\n\n &.translucent {\n background-color: transparent;\n color: var(--color-text-secondary);\n\n --ripple-color: var(--color-interactive-element-hover);\n\n @include active-styles() {\n background-color: var(--color-interactive-element-hover);\n }\n\n @include no-ripple-styles() {\n background-color: rgba(var(--color-text-secondary-rgb), 0.16);\n }\n\n &.activated {\n color: var(--color-primary);\n }\n }\n\n &.translucent-white {\n background-color: transparent;\n color: rgba(255, 255, 255, 0.5);\n --ripple-color: rgba(255, 255, 255, 0.08);\n\n @include active-styles() {\n background-color: rgba(255, 255, 255, 0.08);\n color: white;\n }\n\n @include no-ripple-styles() {\n background-color: rgba(255, 255, 255, 0.16);\n }\n }\n\n &.dark {\n background-color: rgba(0, 0, 0, 0.75);\n color: white;\n --ripple-color: rgba(255, 255, 255, 0.08);\n\n @include active-styles() {\n background-color: rgba(0, 0, 0, 0.85);\n color: white;\n }\n\n @include no-ripple-styles() {\n background-color: rgba(0, 0, 0, 0.95);\n }\n }\n\n &.smaller {\n height: 2.75rem;\n padding: 0.3125rem;\n\n &.round {\n width: 2.75rem;\n }\n\n &.pill {\n height: 2.5rem;\n border-radius: 1.25rem;\n padding: 0.3125rem 1rem;\n }\n\n &.with-icon {\n padding-left: 0.75rem;\n padding-right: 1.25rem;\n\n i {\n font-size: 1.5rem;\n margin-right: 0.5rem;\n }\n\n &[dir=rtl] {\n padding-left: 1.25rem;\n padding-right: 0.75rem;\n\n i {\n margin-left: 0.5rem;\n margin-right: 0;\n }\n }\n }\n\n @media (max-width: 600px) {\n height: 2.5rem;\n\n &.round {\n width: 2.5rem;\n }\n }\n }\n\n &.tiny {\n height: 2.25rem;\n padding: .4375rem;\n border-radius: var(--border-radius-default-small);\n font-size: .875rem;\n font-weight: 500;\n\n &.round {\n width: 2.25rem;\n height: 2.25rem;\n border-radius: 50%;\n }\n\n i {\n font-size: 1.25rem;\n }\n\n &.pill {\n height: 2rem;\n border-radius: 1rem;\n padding: 0.3125rem 1rem;\n font-size: 1rem;\n }\n }\n\n &.fluid {\n padding-left: 1.75rem;\n padding-right: 1.75rem;\n width: auto;\n\n &.tiny {\n padding-left: 1.375rem;\n padding-right: 1.375rem;\n }\n }\n\n &.pill {\n border-radius: 1.75rem;\n padding-left: 1.75rem;\n padding-right: 1.75rem;\n text-transform: none;\n }\n\n &.loading {\n position: relative;\n pointer-events: none;\n\n .Spinner {\n position: absolute;\n right: 0.875rem;\n top: 0.875rem;\n\n --spinner-size: 1.8rem;\n }\n }\n\n .emoji {\n vertical-align: -3px;\n }\n}\n",".Checkbox {\n display: block;\n position: relative;\n padding-left: 4.5rem;\n text-align: left;\n margin-bottom: 1.5rem;\n line-height: 1.5rem;\n cursor: pointer;\n\n &.disabled {\n pointer-events: none;\n opacity: 0.5;\n }\n\n &.round {\n .Checkbox-main {\n &::before {\n border-radius: 50%;\n }\n\n &::after {\n background: var(--color-primary) url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEzLjkuOEw1LjggOC45IDIuMSA1LjJjLS40LS40LTEuMS0uNC0xLjYgMC0uNC40LS40IDEuMSAwIDEuNkw1IDExLjJjLjQuNCAxLjEuNCAxLjYgMGw4LjktOC45Yy40LS40LjQtMS4xIDAtMS42LS41LS40LTEuMi0uNC0xLjYuMXoiIGZpbGw9IiNGRkYiLz48L3N2Zz4=) no-repeat 50% 50%;\n background-size: 12px;\n border-radius: 50%;\n }\n }\n }\n\n &.loading {\n .Checkbox-main::before,\n .Checkbox-main::after {\n opacity: 0 !important;\n }\n\n .Spinner {\n position: absolute;\n left: 0.375rem;\n top: 0.125rem;\n opacity: 0;\n animation: fade-in .2s ease forwards;\n --spinner-size: 1.25rem;\n }\n }\n\n &.blocking {\n input:not(:checked) ~ .Checkbox-main {\n &::before {\n border-color: var(--color-error);\n }\n\n &::after {\n background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgPHBvbHlnb24gcG9pbnRzPSIwIDAgMjQgMCAyNCAyNCAwIDI0Ii8+CiAgICA8cGF0aCBmaWxsPSIjZTUzOTM1IiBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0xOCwzIEMxOS42NTY4NTQyLDMgMjEsNC4zNDMxNDU3NSAyMSw2IEwyMSwxOCBDMjEsMTkuNjU2ODU0MiAxOS42NTY4NTQyLDIxIDE4LDIxIEw2LDIxIEM0LjM0MzE0NTc1LDIxIDMsMTkuNjU2ODU0MiAzLDE4IEwzLDYgQzMsNC4zNDMxNDU3NSA0LjM0MzE0NTc1LDMgNiwzIEwxOCwzIFogTTE2LDExIEw4LDExIEM3LjQ0NzcxNTI1LDExIDcsMTEuNDQ3NzE1MyA3LDEyIEM3LDEyLjU1MjI4NDcgNy40NDc3MTUyNSwxMyA4LDEzIEwxNiwxMyBDMTYuNTUyMjg0NywxMyAxNywxMi41NTIyODQ3IDE3LDEyIEMxNywxMS40NDc3MTUzIDE2LjU1MjI4NDcsMTEgMTYsMTEgWiIvPgogIDwvZz4KPC9zdmc+Cg==);\n opacity: 1;\n\n // Compensate for svg having incorrect size\n background-size: 1.375rem;\n background-position: -0.125rem -0.125rem;\n }\n }\n }\n\n input {\n position: absolute;\n z-index: var(--z-below);\n opacity: 0;\n }\n\n .Checkbox-main {\n &::before, &::after {\n content: '';\n display: block;\n position: absolute;\n left: 1.1875rem;\n top: 0.1875rem;\n width: 1.125rem;\n height: 1.125rem;\n }\n\n &::before {\n border: 2px solid var(--color-borders-input);\n border-radius: .25rem;\n background-color: var(--color-background);\n transition: border-color .1s ease, background-color .1s ease;\n }\n\n &::after {\n background: center no-repeat url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEzLjkuOEw1LjggOC45IDIuMSA1LjJjLS40LS40LTEuMS0uNC0xLjYgMC0uNC40LS40IDEuMSAwIDEuNkw1IDExLjJjLjQuNCAxLjEuNCAxLjYgMGw4LjktOC45Yy40LS40LjQtMS4xIDAtMS42LS41LS40LTEuMi0uNC0xLjYuMXoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvc3ZnPg==);\n background-size: .875rem;\n opacity: 0;\n transition: opacity .1s ease;\n }\n\n .label {\n display: block;\n text-align: initial;\n }\n\n .subLabel {\n display: block;\n font-size: 0.875rem;\n line-height: 1rem;\n color: var(--color-text-secondary);\n }\n }\n\n input:checked ~ .Checkbox-main {\n &::before {\n border-color: var(--color-primary);\n background-color: var(--color-primary);\n }\n\n &::after {\n opacity: 1;\n }\n }\n\n &[dir=rtl] {\n padding-left: 0;\n padding-right: 4.5rem;\n\n &.loading {\n .Spinner {\n left: auto;\n right: 0.375rem;\n }\n }\n\n .label,\n .subLabel {\n text-align: right;\n }\n\n .Checkbox-main {\n &::before, &::after {\n left: auto;\n right: 1.1875rem;\n }\n }\n }\n}\n",".Loading {\n display: flex;\n height: 100%;\n align-items: center;\n justify-content: center;\n\n .Spinner {\n --spinner-size: 2.75rem;\n }\n}\n",".Menu {\n &.fluid .bubble {\n min-width: 13.5rem;\n width: auto;\n }\n\n .backdrop {\n position: fixed;\n left: -100vw;\n right: -100vw;\n top: -100vh;\n bottom: -100vh;\n z-index: var(--z-menu-backdrop);\n }\n\n .bubble {\n overflow: hidden;\n display: block;\n list-style: none;\n padding: 0.5rem 0;\n margin: 0;\n position: absolute;\n background-color: var(--color-background);\n box-shadow: 0 .25rem .5rem .125rem var(--color-default-shadow);\n border-radius: var(--border-radius-default);\n min-width: 13.5rem;\n z-index: var(--z-menu-bubble);\n\n transform: scale(0.2);\n transition: opacity .2s cubic-bezier(0.2, 0, 0.2, 1), transform .2s cubic-bezier(0.2, 0, 0.2, 1) !important;\n\n &.open {\n transform: scale(1);\n }\n\n &.closing {\n transition: opacity .2s ease-in, transform .2s ease-in !important;\n }\n\n body.animation-level-0 & {\n transform: none !important;\n transition: opacity .15s !important;\n }\n\n body.has-open-dialog & {\n transition: none !important;\n }\n\n --offset-y: calc(100% + 0.5rem);\n --offset-x: 0;\n\n &.top {\n top: var(--offset-y);\n }\n\n &.bottom {\n bottom: var(--offset-y);\n }\n\n &.left {\n left: var(--offset-x);\n }\n\n &.right {\n right: var(--offset-x);\n }\n\n &.with-footer {\n padding-bottom: 0;\n }\n }\n\n .footer {\n padding: 0.5rem 0;\n background: var(--color-chat-hover);\n color: var(--color-text-secondary);\n font-size: 0.8125rem;\n text-align: center;\n }\n}\n",".DropdownMenu {\n position: relative;\n}\n",".MenuItem {\n width: 100%;\n background: none;\n border: none !important;\n box-shadow: none !important;\n outline: none !important;\n display: flex;\n padding: 1rem;\n position: relative;\n overflow: hidden;\n line-height: 1.5rem;\n white-space: nowrap;\n color: var(--color-text);\n --ripple-color: rgba(0, 0, 0, .08);\n cursor: pointer;\n unicode-bidi: plaintext;\n\n @media (hover: hover) {\n &:hover, &:focus {\n background-color: var(--color-chat-hover);\n text-decoration: none;\n color: inherit;\n }\n }\n\n @media (max-width: 600px) {\n &:focus, &:hover, &:active {\n text-decoration: none;\n color: inherit;\n }\n\n &:active {\n background-color: var(--color-chat-hover);\n }\n }\n\n i {\n font-size: 1.5rem;\n margin-right: 2rem;\n color: var(--color-text-secondary);\n }\n\n .menu-item-name {\n margin-right: 2rem;\n\n &.capitalize {\n text-transform: capitalize;\n }\n }\n\n &.disabled {\n opacity: 0.5 !important;\n cursor: default !important;\n }\n\n &.destructive {\n color: var(--color-error);\n\n i {\n color: inherit;\n }\n }\n\n &:not(.has-ripple):not(.disabled):active {\n background-color: var(--color-item-active);\n transition: none !important;\n }\n\n & > .Switcher {\n margin-left: auto;\n }\n\n &[dir=rtl] {\n i {\n margin-left: 2rem;\n margin-right: 0;\n }\n\n .menu-item-name {\n margin-left: 2rem;\n margin-right: 0;\n }\n\n > .Switcher {\n margin-left: 0;\n margin-right: auto;\n }\n }\n}\n",".CountryCodeInput {\n\n .input-group {\n cursor: pointer;\n\n z-index: var(--z-country-code-input-group);\n\n .Spinner {\n position: absolute;\n top: 1rem;\n right: 0.75rem;\n opacity: 0.5;\n --spinner-size: 1.5rem;\n }\n\n // Prevent loading additional 10 kB of icomoon font on initial load.\n .css-icon-down {\n position: absolute;\n top: 1.125rem;\n right: 1rem;\n width: .75rem;\n height: .75rem;\n border: 2px solid var(--color-text-secondary);\n border-top: 0;\n border-left: 0;\n transform: scaleY(1) rotate(45deg);\n transition: color .2s ease, transform .2s ease, top .2s ease;\n\n &.open {\n border-color: var(--color-primary);\n transform: scaleY(-1) rotate(45deg);\n top: 1.5rem;\n }\n }\n }\n\n .bubble {\n width: 100%;\n max-height: 23.5rem;\n overflow-y: auto;\n transform-origin: top center !important;\n transform: scale(0.95);\n\n &.open {\n transform: scaleY(1);\n }\n }\n\n .MenuItem {\n button {\n display: flex;\n align-items: center;\n }\n\n &.no-results button {\n justify-content: center;\n padding: .5rem 1rem;\n\n span {\n font-size: 0.875rem;\n }\n }\n }\n\n .country-flag {\n font-size: 2rem;\n margin-right: 2rem;\n\n .emoji {\n width: 2rem;\n height: 2rem;\n display: inline-block;\n vertical-align: 4px;\n margin: -.5rem .125rem;\n }\n }\n\n .country-name {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-right: 1rem;\n text-align: left;\n }\n\n .country-code {\n margin-left: auto;\n opacity: 0.5;\n }\n}\n",".auth-form {\n width: 100%;\n max-width: 25.5rem;\n margin: 0 auto;\n padding: 1rem;\n padding-top: 6rem;\n text-align: center;\n\n @media (min-width: 600px) and (min-height: 450px) {\n padding: 1.5rem;\n padding-top: 6.8rem;\n\n &.qr {\n padding-top: 5rem;\n }\n }\n\n #logo, .AvatarEditable label {\n display: block;\n margin-left: auto;\n margin-right: auto;\n width: 7.5rem;\n height: 7.5rem;\n margin-bottom: 1.75rem;\n\n @media (min-width: 600px) and (min-height: 450px) {\n width: 10rem;\n height: 10rem;\n margin-bottom: 2.5rem;\n }\n }\n\n #logo {\n background-size: 100%;\n background: url('../../assets/telegram-logo.svg') center no-repeat;\n }\n\n h2 {\n font-size: 1.25rem;\n line-height: 1;\n\n @media (min-width: 600px) {\n font-size: 2rem;\n line-height: 1.5;\n }\n }\n\n .note {\n font-size: 0.875rem;\n line-height: 1.35;\n margin-bottom: 2.5rem;\n color: var(--color-text-secondary);\n\n @media (min-width: 600px) {\n font-size: 1rem;\n margin-bottom: 3rem;\n }\n }\n}\n\n#auth-registration-form,\n#auth-phone-number-form,\n#auth-code-form,\n#auth-password-form,\n#auth-qr-form {\n height: 100%;\n overflow-y: auto;\n}\n\n#auth-phone-number-form {\n form {\n min-height: 26.25rem;\n }\n\n .Button {\n margin-top: 2.75rem;\n }\n\n .Button + .Button {\n margin-top: 1rem;\n }\n}\n\n#auth-code-form,\n#auth-password-form {\n h2 {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n}\n\n.auth-number-edit {\n width: 2.5rem;\n height: 2.5rem;\n padding: 0.5rem;\n font-size: 1.5rem;\n color: var(--color-text-secondary);\n opacity: 0.75;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n\n &:hover, &:focus {\n opacity: 1;\n }\n}\n\n#auth-qr-form {\n .qr-container, .qr-loading {\n height: 280px;\n }\n\n .qr-container {\n opacity: 1;\n transform: scale(1);\n transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 300ms;\n\n &.pre-animate {\n opacity: 0.5;\n transform: scale(0.8);\n }\n }\n\n h3 {\n margin: 1.5rem 0 1rem 0;\n }\n\n ol {\n list-style: none;\n counter-reset: item;\n padding: 0 1.75rem;\n\n li {\n counter-increment: item;\n text-align: left;\n margin: 0.75rem 0;\n display: flex;\n\n &::before {\n content: counter(item);\n display: flex;\n justify-content: center;\n align-items: center;\n min-width: 1.4rem;\n height: 1.4rem;\n padding: 0;\n margin: 0 0.75rem 0 0;\n background: var(--color-primary);\n border-radius: 50%;\n font-size: smaller;\n color: white;\n }\n }\n }\n}\n\n#sign-in-password {\n word-break: normal !important;\n}\n","#AppInactive {\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n .content {\n max-width: 28rem;\n margin: auto;\n padding: 1.5rem;\n text-align: center;\n }\n\n .title {\n margin-top: 1rem;\n }\n\n .description {\n color: var(--color-text-secondary);\n font-size: 0.875rem;\n }\n\n img {\n width: 100%;\n max-width: 20rem;\n }\n\n .Button {\n margin-top: 1rem;\n }\n}\n","/* cyrillic-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu7mxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n}\n/* greek */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu4WxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0370-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu7WxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: local('Roboto'), local('Roboto-Regular'), url(KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fCRc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fCBc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n}\n/* greek */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fBxc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0370-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fCxc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: local('Roboto Medium'), local('Roboto-Medium'), url(KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n\n/* Persian, v30.1.0, https://github.com/rastikerdar/vazir-font */\n@font-face {\n font-family: Vazir;\n src: url('Vazir-Regular-WOL.woff2') format('woff2'),\n url('Vazir-Regular-WOL.woff') format('woff');\n font-weight: normal;\n font-display:swap;\n unicode-range:U+0627-06FF;\n}\n\n/* Persian, v30.1.0, https://github.com/rastikerdar/vazir-font */\n@font-face {\n font-family: Vazir;\n src: url('Vazir-Medium-WOL.woff2') format('woff2'),\n url('Vazir-Medium-WOL.woff') format('woff');\n font-weight: 500;\n font-display:swap;\n unicode-range: U+0600-06FF;\n}\n","@import 'reboot';\n@import 'variables';\n@import 'mixins';\n@import 'spacing';\n@import 'forms';\n@import 'icons';\n@import 'common';\n@import '../assets/fonts/roboto.css';\n\nhtml, body {\n width: 100%;\n height: 100%;\n background: var(--color-background);\n margin: 0;\n padding: 0;\n font-size: 16px;\n font-family: \"Roboto\", -apple-system, BlinkMacSystemFont, \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;\n color: var(--color-text);\n overflow: hidden;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n}\n\nbody.is-ios,\nbody.is-macos {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, \"Roboto\", \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;\n}\n\nhtml[lang=fa],\nhtml[lang=fa] body {\n font-family: \"Vazir\", \"Roboto\", -apple-system, BlinkMacSystemFont, \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;\n\n &.is-ios,\n &.is-macos {\n font-family: \"Vazir\", -apple-system, BlinkMacSystemFont, \"Roboto\", \"Apple Color Emoji\", \"Helvetica Neue\", sans-serif;\n }\n}\n\nbody.cursor-grabbing, body.cursor-grabbing * {\n cursor: grabbing !important;\n}\n\n#root {\n height: 100%;\n max-width: 1680px;\n margin: 0 auto;\n @media (max-width: 600px) {\n height: calc(var(--vh, 1vh) * 100);\n }\n}\n\n#middle-column-portals,\n#portals {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n}\n\n.hidden {\n visibility: hidden;\n}\n\n.no-selection {\n user-select: none;\n -webkit-user-select: none !important;\n}\n\n/*\n See the article for more information on this visually-hidden pattern.\n https://snook.ca/archives/html_and_css/hiding-content-for-accessibility\n*/\n.visually-hidden {\n position: absolute !important;\n width: 0;\n height: 0;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n z-index: -1;\n}\n\n.not-implemented {\n opacity: 0.5;\n\n &, & * {\n cursor: not-allowed !important;\n }\n}\n\n* {\n box-sizing: border-box;\n}\n\n.no-animations #root *,\n.no-animations #root *::before,\n.no-animations #root *::after {\n transition: none !important;\n}\n\n.custom-scroll,\n.custom-scroll-x {\n scrollbar-width: thin;\n scrollbar-color: rgba(90, 90, 90, 0) transparent;\n transition: scrollbar-color .3s ease;\n\n -webkit-overflow-scrolling: touch;\n // Fix scroll lock on iOS\n pointer-events: auto;\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(90, 90, 90, 0);\n border-radius: 0.35rem;\n }\n\n &:hover, &:focus, &:focus-within {\n scrollbar-color: rgba(90, 90, 90, 0.3) transparent;\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(90, 90, 90, 0.3);\n }\n }\n}\n\n.custom-scroll {\n &::-webkit-scrollbar {\n width: .375rem;\n }\n}\n\n.custom-scroll-x {\n &::-webkit-scrollbar {\n height: .35rem;\n }\n}\n\n.no-scrollbar {\n scrollbar-width: none;\n\n &::-webkit-scrollbar {\n display: none;\n }\n}\n\n.emoji-small {\n background: no-repeat;\n background-size: 1.25rem;\n color: transparent;\n display: inline-block;\n width: 1.25rem;\n height: 1.25rem;\n margin-inline-end: 1px;\n overflow: hidden;\n flex-shrink: 0;\n\n &::selection {\n background-color: var(--color-selection-highlight-emoji);\n color: transparent;\n }\n}\n\ndiv[role=\"button\"] {\n outline: none !important;\n cursor: pointer;\n}\n\n.opacity-transition {\n opacity: 1;\n transition: opacity .15s ease;\n\n &:not(.open) {\n opacity: 0;\n }\n\n &:not(.shown) {\n display: none;\n }\n\n &.slow {\n transition-duration: .3s;\n }\n}\n\n.color-primary {\n color: var(--color-primary) !important;\n}\n\n.color-danger {\n color: var(--color-error) !important;\n}\n\n.text-muted {\n color: var(--color-text-secondary) !important;\n}\n\n.for-ios-autocapitalization-fix {\n position: fixed;\n font-size: 16px;\n opacity: 0;\n bottom: 1rem;\n z-index: -1;\n}\n\n@keyframes grow-icon {\n 0% {\n transform: scale(0.5);\n opacity: .8;\n }\n 50% {\n transform: scale(1.1);\n opacity: 1;\n }\n 100% {\n transform: scale(1);\n }\n}\n\n@keyframes hide-icon {\n from {\n transform: scale(1);\n opacity: .4;\n }\n to {\n transform: scale(.5);\n opacity: 0;\n }\n}\n","*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\nhtml {\n font-family: sans-serif;\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n -ms-text-size-adjust: 100%;\n -ms-overflow-style: scrollbar;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n@-ms-viewport {\n width: device-width;\n}\narticle, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section {\n display: block;\n}\n\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #212529;\n text-align: left;\n background-color: #fff;\n}\n\n[tabindex=\"-1\"]:focus {\n outline: none !important;\n}\n\nhr {\n box-sizing: content-box;\n height: 0;\n overflow: visible;\n}\n\nh1, h2, h3, h4, h5, h6 {\n margin-top: 0;\n margin-bottom: 0.5rem;\n font-weight: 500;\n}\n\np {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nabbr[title],\nabbr[data-original-title] {\n text-decoration: underline;\n text-decoration: underline dotted;\n cursor: help;\n border-bottom: 0;\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: 500;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0;\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\ndfn {\n font-style: italic;\n}\n\nb,\nstrong {\n font-weight: 500;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -.25em;\n}\n\nsup {\n top: -.5em;\n}\n\na {\n color: var(--color-links);\n text-decoration: none;\n background-color: transparent;\n -webkit-text-decoration-skip: objects;\n}\na:hover {\n color: #0056b3;\n text-decoration: underline;\n}\n\na:not([href]):not([tabindex]) {\n color: inherit;\n text-decoration: none;\n}\na:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus {\n color: inherit;\n text-decoration: none;\n}\na:not([href]):not([tabindex]):focus {\n outline: 0;\n}\n\npre,\ncode,\nkbd,\nsamp {\n font: .9375rem/1.25 'Courier', 'Courier New', 'Nimbus Mono L', 'Courier 10 Pitch', 'FreeMono', sans-serif-monospace, monospace;\n font-size-adjust: .43;\n}\n\npre {\n margin-top: 0;\n margin-bottom: 1rem;\n overflow: auto;\n -ms-overflow-style: scrollbar;\n}\n\nfigure {\n margin: 0 0 1rem;\n}\n\nimg {\n vertical-align: middle;\n border-style: none;\n}\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\na,\narea,\nbutton,\n[role=\"button\"],\ninput:not([type=\"range\"]),\nlabel,\nselect,\nsummary,\ntextarea {\n touch-action: manipulation;\n}\n\ntable {\n border-collapse: collapse;\n}\n\ncaption {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n color: #868e96;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n text-align: inherit;\n}\n\nlabel {\n display: inline-block;\n margin-bottom: .5rem;\n}\n\nbutton {\n border-radius: 0;\n}\n\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\ninput,\nbutton,\nselect,\noptgroup,\ntextarea {\n margin: 0;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\nbutton,\ninput {\n overflow: visible;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\nbutton,\nhtml [type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n box-sizing: border-box;\n padding: 0;\n}\n\ninput[type=\"date\"],\ninput[type=\"time\"],\ninput[type=\"datetime-local\"],\ninput[type=\"month\"] {\n -webkit-appearance: listbox;\n}\n\ntextarea {\n overflow: auto;\n resize: vertical;\n}\n\nfieldset {\n min-width: 0;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\nlegend {\n display: block;\n width: 100%;\n max-width: 100%;\n padding: 0;\n margin-bottom: .5rem;\n font-size: 1.5rem;\n line-height: inherit;\n color: inherit;\n white-space: normal;\n}\n\nprogress {\n vertical-align: baseline;\n}\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type=\"search\"] {\n outline-offset: -2px;\n -webkit-appearance: none;\n}\n\n[type=\"search\"]::-webkit-search-cancel-button,\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n::-webkit-file-upload-button {\n font: inherit;\n -webkit-appearance: button;\n}\n\noutput {\n display: inline-block;\n}\n\nsummary {\n display: list-item;\n}\n\ntemplate {\n display: none;\n}\n\n[hidden] {\n display: none !important;\n}\n","@function toRGB($color) {\n @return red($color) + \", \" + green($color) + \", \" + blue($color);\n}\n\n@function blend-normal ($foreground, $background) {\n $opacity: opacity($foreground);\n $background-opacity: opacity($background);\n\n // calculate opacity\n $bm-red: red($foreground) * $opacity + red($background) * $background-opacity * (1 - $opacity);\n $bm-green: green($foreground) * $opacity + green($background) * $background-opacity * (1 - $opacity);\n $bm-blue: blue($foreground) * $opacity + blue($background) * $background-opacity * (1 - $opacity);\n @return rgb($bm-red, $bm-green, $bm-blue);\n}\n\n$color-primary: #50a2e9;\n\n$color-links: #52a1ef;\n\n$color-placeholders: #A2ACB4;\n\n$color-text-green: #4fae4e;\n$color-green: #4dcd5e;\n$color-light-green: #eefedf;\n\n$color-error: #e53935;\n\n$color-warning: #fb8c00;\n\n$color-yellow: #FDD764;\n\n$color-white: #ffffff;\n$color-black: #000000;\n$color-dark-gray: #2e3939;\n$color-gray: #c4c9cc;\n$color-text-secondary: #707579;\n$color-text-secondary-apple: #8A8A90;\n$color-text-meta: #686c72;\n$color-text-meta-apple: #8C8C91;\n$color-borders: #DADCE0;\n$color-dividers: #C8C6CC;\n$color-item-active: #ededed;\n$color-chat-hover: #f4f4f5;\n$color-chat-active: #5B90E0;\n$color-selection: #3993fb;\n\n// https://github.com/telegramdesktop/tdesktop/wiki/Theme-Reference#user-content-standard-color-constants\n// Colors borrowed from https://github.com/telegramdesktop/tdesktop/blob/dev/Telegram/Resources/day-blue.tdesktop-theme\n// historyPeer[1-8]UserpicBg\n$color-user-1: #E17076;\n$color-user-2: #7BC862;\n//$color-user-3: #E5CA77;\n$color-user-4: #65aadd;\n$color-user-5: #a695e7;\n$color-user-6: #ee7aae;\n$color-user-7: #6ec9cb;\n$color-user-8: #faa774;\n\n:root {\n --color-background: #{$color-white};\n --color-background-selected: #f4f4f5;\n --color-background-secondary: #f4f4f5;\n --color-background-secondary-accent: #E4E4E5;\n --color-background-own: #{$color-light-green};\n --color-background-own-selected: #{darken($color-light-green, 10%)};\n --color-background-own-rgb: #{toRGB($color-light-green)};\n --color-text: #{$color-black};\n --color-text-lighter: #{$color-dark-gray};\n --color-text-secondary: #{$color-text-secondary};\n --color-text-secondary-rgb: #{toRGB($color-text-secondary)};\n --color-text-secondary-apple: #{$color-text-secondary-apple};\n --color-text-meta: #{$color-text-meta};\n --color-text-meta-rgb: #{toRGB($color-text-meta)};\n --color-text-meta-colored: #{$color-text-green};\n --color-text-meta-apple: #{$color-text-meta-apple};\n --color-text-green: #{$color-text-green};\n --color-text-green-rgb: #{toRGB($color-text-green)};\n --color-borders: #{$color-borders};\n --color-borders-input: #{$color-borders};\n --color-dividers: #{$color-dividers};\n --color-webpage-initial-background: #{$color-dark-gray};\n --color-interactive-active: var(--color-primary);\n --color-interactive-inactive: rgba(var(--color-text-secondary-rgb), 0.25);\n --color-interactive-buffered: rgba(var(--color-text-secondary-rgb), 0.25); // Overlays underlying inactive element\n --color-interactive-element-hover: rgba(var(--color-text-secondary-rgb), 0.08);\n\n --color-primary: #{$color-primary};\n --color-primary-rgb: #{toRGB($color-primary)};\n --color-primary-shade: #{mix($color-primary, $color-black, 92%)};\n --color-primary-shade-darker: #{mix($color-primary, $color-black, 84%)};\n --color-primary-shade-rgb: #{toRGB(mix($color-primary, $color-black, 92%))};\n --color-primary-opacity: rgba(var(--color-primary), 0.50);\n --color-green: #{$color-green};\n --color-green-darker: #{mix($color-green, $color-black, 84%)};\n\n --color-error: #{$color-error};\n --color-error-shade: #{mix($color-error, $color-black, 92%)};\n --color-error-rgb: #{toRGB($color-error)};\n\n --color-warning: #{$color-warning};\n\n --color-yellow: #{$color-yellow};\n\n --color-links: #{$color-links};\n --color-links-hover: #{darken($color-links, 8%)};\n --color-links-darker: #{darken($color-links, 15%)};\n --color-links-darker-hover: #{darken($color-links, 23%)};\n\n --color-own-links: #{$color-white};\n\n --color-placeholders: #{$color-placeholders};\n\n --color-pinned: #{$color-white};\n\n --color-code: #4a729a;\n --color-code-bg: #{rgba($color-text-secondary, .08)};\n --color-code-own: #3c7940;\n --color-code-own-bg: #{rgba($color-text-secondary, .08)};\n\n --color-accent-own: #{$color-text-green};\n --color-message-meta-own: #{$color-text-green};\n\n --color-reply-hover: #{blend-normal(rgba($color-text-secondary, 0.08), $color-white)};\n --color-reply-active: #{blend-normal(rgba($color-text-secondary, 0.16), $color-white)};\n --color-reply-own-hover: #{blend-normal(rgba($color-text-green, 0.12), $color-light-green)};\n --color-reply-own-active: #{blend-normal(rgba($color-text-green, 0.24), $color-light-green)};\n\n --color-background-own-apple: #E7FDCC;\n --color-reply-own-hover-apple: #d9f9c1;\n --color-reply-own-active-apple: #d5edc2;\n\n --color-white: #{$color-white};\n --color-gray: #{$color-gray};\n\n --color-chat-hover: #{$color-chat-hover};\n --color-chat-active: #{$color-chat-active};\n --color-item-active: #{$color-item-active};\n\n --color-selection-highlight: #{$color-selection};\n --color-selection-highlight-emoji: rgba(#{toRGB($color-selection)}, .7);\n\n --color-user-1: #{$color-user-1};\n --color-user-2: #{$color-user-2};\n --color-user-4: #{$color-user-4};\n --color-user-5: #{$color-user-5};\n --color-user-6: #{$color-user-6};\n --color-user-7: #{$color-user-7};\n --color-user-8: #{$color-user-8};\n\n --color-default-shadow: #72727240;\n --color-light-shadow: #7272722B;\n\n --vh: 1vh;\n\n --border-radius-default: 0.75rem;\n --border-radius-default-small: 0.625rem;\n --border-radius-default-tiny: 0.375rem;\n --border-radius-messages: 0.75rem;\n --border-radius-messages-small: 0.375rem;\n --messages-container-width: 45.5rem;\n --right-column-width: 26.5rem;\n --header-height: 3.5rem;\n\n --symbol-menu-width: 26.25rem;\n --symbol-menu-height: 23.25rem;\n --symbol-menu-footer-height: 3rem;\n\n @media (min-width: 1276px) and (max-width: 1680px) {\n --right-column-width: 25vw;\n }\n\n @media (max-width: 600px) {\n --right-column-width: 100vw;\n --symbol-menu-width: 100vw;\n --symbol-menu-height: 14.6875rem;\n }\n\n --z-ui-loader-mask: 2000;\n --z-notification: 1000;\n --z-right-column: 900;\n --z-header-menu: 990;\n --z-header-menu-backdrop: 980;\n --z-modal: 1000;\n --z-media-viewer: 1500;\n --z-drop-area: 55;\n --z-animation-fade: 50;\n --z-menu-bubble: 21;\n --z-menu-backdrop: 20;\n --z-message-highlighted: 14;\n --z-message-context-menu: 13;\n --z-scroll-down-button: 12;\n --z-mobile-search: 12;\n --z-middle-header: 11;\n --z-middle-footer: 11;\n --z-country-code-input-group: 10;\n --z-message-select-control: 9;\n --z-message-select-area: 8;\n --z-sticky-date: 9;\n --z-register-add-avatar: 5;\n --z-media-viewer-head: 3;\n --z-below: -1;\n\n --spinner-white-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iI2ZmZmZmZiIvPjwvc3ZnPg==);\n --spinner-white-thin-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iI2ZmZmZmZiIgZD0iTTEyIDIzQzUuOSAyMyAxIDE4LjEgMSAxMlM1LjkgMSAxMiAxVjBDNS40IDAgMCA1LjQgMCAxMnM1LjQgMTIgMTIgMTIgMTItNS40IDEyLTEyaC0xYzAgNi4xLTQuOSAxMS0xMSAxMXoiLz48L3N2Zz4=);\n --spinner-blue-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzRlYTRmNiIvPjwvc3ZnPg==);\n --spinner-dark-blue-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzgzNzhEQiIvPjwvc3ZnPg==);\n --spinner-black-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzJlMzkzOSIvPjwvc3ZnPg==);\n --spinner-green-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzRmYWU0ZSIvPjwvc3ZnPg==);\n --spinner-gray-data: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEwLjggMjIuNEM2IDIxLjkgMi4xIDE4IDEuNiAxMy4yLjkgNy4xIDUuNCAxLjkgMTEuMyAxLjVjLjQgMCAuNy0uMy43LS43IDAtLjQtLjQtLjgtLjgtLjhDNC44LjQtLjIgNS45IDAgMTIuNS4yIDE4LjYgNS40IDIzLjggMTEuNSAyNGM2LjYuMiAxMi00LjggMTIuNC0xMS4yIDAtLjQtLjMtLjgtLjgtLjgtLjQgMC0uNy4zLS43LjctLjMgNS45LTUuNSAxMC40LTExLjYgOS43eiIgZmlsbD0iIzcwNzU3OSIvPjwvc3ZnPg==);\n\n --drag-target-border: url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='8' ry='8' stroke='%23DDDFE0' stroke-width='4' stroke-dasharray='9.1%2c 10.5' stroke-dashoffset='3' stroke-linecap='round'/%3e%3c/svg%3e\");\n --drag-target-border-hovered: url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='8' ry='8' stroke='%2363A2E3' stroke-width='4' stroke-dasharray='9.1%2c 10.5' stroke-dashoffset='3' stroke-linecap='round'/%3e%3c/svg%3e\");\n\n --layer-transition: 300ms cubic-bezier(0.33, 1, 0.68, 1);\n --layer-blackout-opacity: 0.3;\n\n // For some reason these parameters cause worse animation in desktop Chrome\n @media (max-width: 600px) {\n --layer-transition: 450ms cubic-bezier(0.25, 1, 0.5, 1);\n }\n\n --slide-transition: 300ms cubic-bezier(0.25, 1, 0.5, 1);\n\n body.is-android {\n --slide-transition: 200ms ease-in-out;\n }\n\n --select-transition: 200ms ease-out;\n}\n","$spacer: 1rem !default;\n$spacers: () !default;\n$spacers: map-merge(\n (\n 0: 0,\n 1: ($spacer * .25),\n 2: ($spacer * .5),\n 3: $spacer,\n 4: ($spacer * 1.5),\n 5: ($spacer * 2),\n 6: ($spacer * 3),\n ),\n $spacers\n);\n\n// Margin and Padding\n\n@each $prop, $abbrev in (margin: m, padding: p) {\n @each $size, $length in $spacers {\n\n .#{$abbrev}-#{$size} { #{$prop}: $length !important; }\n .#{$abbrev}t-#{$size},\n .#{$abbrev}y-#{$size} {\n #{$prop}-top: $length !important;\n }\n .#{$abbrev}r-#{$size},\n .#{$abbrev}x-#{$size} {\n #{$prop}-right: $length !important;\n }\n .#{$abbrev}b-#{$size},\n .#{$abbrev}y-#{$size} {\n #{$prop}-bottom: $length !important;\n }\n .#{$abbrev}l-#{$size},\n .#{$abbrev}x-#{$size} {\n #{$prop}-left: $length !important;\n }\n }\n}\n",".input-group {\n position: relative;\n margin-bottom: 1.5rem;\n\n label {\n display: block;\n padding: 0 0.25rem;\n position: absolute;\n left: 0.75rem;\n top: 0.95rem;\n background-color: var(--color-background);\n font-size: 1rem;\n font-weight: 400;\n color: var(--color-placeholders);\n transition: transform 0.15s ease-out, color .15s ease-out;\n cursor: text;\n pointer-events: none;\n transform-origin: left center;\n white-space: nowrap;\n }\n\n &.with-arrow {\n &::after {\n content: '';\n position: absolute;\n height: .75rem;\n width: .75rem;\n border-left: 1px var(--color-text-secondary) solid;\n border-bottom: 1px var(--color-text-secondary) solid;\n transform: rotate(-45deg);\n right: 2rem;\n top: 1rem;\n }\n }\n\n &.touched label,\n &.error label,\n &.success label,\n .form-control:focus + label,\n .form-control.focus + label {\n transform: scale(.75) translate(-0.5rem, -2.25rem);\n }\n\n input::placeholder,\n .form-control::placeholder {\n color: var(--color-placeholders);\n }\n\n &.touched label {\n color: var(--color-text-secondary);\n }\n\n &.error label {\n color: var(--color-error) !important;\n }\n\n &.success label {\n color: var(--color-text-green) !important;\n }\n\n &.disabled {\n opacity: 0.5;\n pointer-events: none;\n }\n\n &[dir=rtl] {\n input {\n text-align: right;\n }\n\n label {\n left: auto;\n right: 0.75rem;\n }\n\n &.with-arrow {\n &::after {\n border-left: none;\n border-right: 1px var(--color-text-secondary) solid;\n right: auto;\n left: 2rem;\n }\n }\n\n &.touched label,\n &.error label,\n &.success label,\n .form-control:focus + label,\n .form-control.focus + label {\n transform: scale(.75) translate(1.5rem, -2.25rem);\n }\n }\n}\n\n.form-control {\n --border-width: 1px;\n display: block;\n width: 100%;\n height: 3.375rem;\n padding: calc(0.75rem - var(--border-width)) calc(.9rem - var(--border-width));\n border: var(--border-width) solid var(--color-borders-input);\n border-radius: var(--border-radius-default);\n color: var(--color-text);\n background-color: var(--color-background);\n outline: none;\n transition: border-color 0.15s ease;\n word-break: break-word;\n -webkit-appearance: none;\n\n font-size: 1rem;\n line-height: 1.25rem;\n\n &[dir] {\n text-align: initial;\n }\n\n &:hover {\n border-color: var(--color-primary);\n\n & + label {\n color: var(--color-primary);\n }\n }\n\n &:focus,\n &.focus {\n border-color: var(--color-primary);\n box-shadow: inset 0 0 0 1px var(--color-primary);\n caret-color: var(--color-primary);\n\n & + label {\n color: var(--color-primary);\n }\n }\n\n &:disabled {\n background: none !important;\n }\n\n .error & {\n border-color: var(--color-error);\n box-shadow: inset 0 0 0 1px var(--color-error);\n caret-color: var(--color-error);\n }\n\n .success & {\n border-color: var(--color-text-green);\n box-shadow: inset 0 0 0 1px var(--color-text-green);\n caret-color: var(--color-text-green);\n }\n}\n\nselect.form-control {\n option {\n line-height: 2rem;\n }\n}\n\ntextarea.form-control {\n resize: none;\n overflow: hidden;\n line-height: 1.3125rem;\n padding-top: calc(1rem - var(--border-width));\n padding-bottom: calc(1rem - var(--border-width));\n}\n\n.input-group.password-input {\n position: relative;\n\n .form-control {\n padding-right: 3.375rem;\n }\n\n .toggle-password {\n position: absolute;\n top: 0;\n right: 0;\n width: 3.375rem;\n height: 3.375rem;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n outline: none !important;\n\n color: var(--color-text-secondary);\n opacity: 0.7;\n font-size: 1.5rem;\n\n &:hover, &:focus {\n opacity: 1;\n }\n }\n\n &[dir=rtl] {\n .form-control {\n padding-left: 3.375rem;\n padding-right: calc(.9rem - var(--border-width))\n }\n\n .toggle-password {\n left: 0;\n right: auto;\n }\n }\n}\n","@font-face {\n font-family: 'icomoon';\n src: url('../assets/fonts/icomoon.woff2?n9djnk') format('woff2'),\n url('../assets/fonts/icomoon.woff?n9djnk') format('woff');\n font-weight: normal;\n font-style: normal;\n font-display: block;\n}\n\n[class^=\"icon-\"], [class*=\" icon-\"] {\n /* use !important to prevent issues with browser extensions that change fonts */\n font-family: 'icomoon' !important;\n speak: none;\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n[class^=\"icon-char-\"], [class*=\" icon-char-\"] {\n &::before {\n font-family: Roboto, \"Helvetica Neue\", sans-serif;\n content: attr(data-char);\n width: 1.5rem;\n text-align: center;\n display: block;\n }\n}\n\n.icon-bot-commands-filled:before {\n content: \"\\e97f\";\n}\n.icon-reply-filled:before {\n content: \"\\e980\";\n}\n.icon-bug:before {\n content: \"\\e97e\";\n}\n.icon-data:before {\n content: \"\\e97d\";\n}\n.icon-darkmode:before {\n content: \"\\e979\";\n}\n.icon-animations:before {\n content: \"\\e97a\";\n}\n.icon-enter:before {\n content: \"\\e97b\";\n}\n.icon-fontsize:before {\n content: \"\\e97c\";\n}\n.icon-permissions:before {\n content: \"\\e976\";\n}\n.icon-card:before {\n content: \"\\e977\";\n}\n.icon-truck:before {\n content: \"\\e978\";\n}\n.icon-share-filled:before {\n content: \"\\e95a\";\n}\n.icon-bold:before {\n content: \"\\e961\";\n}\n.icon-bot-command:before {\n content: \"\\e962\";\n}\n.icon-calendar-filter:before {\n content: \"\\e963\";\n}\n.icon-comments:before {\n content: \"\\e964\";\n}\n.icon-comments-sticker:before {\n content: \"\\e965\";\n}\n.icon-arrow-down:before {\n content: \"\\e966\";\n}\n.icon-email:before {\n content: \"\\e967\";\n}\n.icon-italic:before {\n content: \"\\e968\";\n}\n.icon-link:before {\n content: \"\\e969\";\n}\n.icon-mention:before {\n content: \"\\e96a\";\n}\n.icon-monospace:before {\n content: \"\\e96b\";\n}\n.icon-next:before {\n content: \"\\e96c\";\n}\n.icon-password-off:before {\n content: \"\\e96d\";\n}\n.icon-pin-list:before {\n content: \"\\e96e\";\n}\n.icon-previous:before {\n content: \"\\e96f\";\n}\n.icon-replace:before {\n content: \"\\e970\";\n}\n.icon-schedule:before {\n content: \"\\e971\";\n}\n.icon-strikethrough:before {\n content: \"\\e972\";\n}\n.icon-underlined:before {\n content: \"\\e973\";\n}\n.icon-zoom-in:before {\n content: \"\\e974\";\n}\n.icon-zoom-out:before {\n content: \"\\e975\";\n}\n.icon-select:before {\n content: \"\\e960\";\n}\n.icon-folder:before {\n content: \"\\e913\";\n}\n.icon-bots:before {\n content: \"\\e915\";\n}\n.icon-calendar:before {\n content: \"\\e916\";\n}\n.icon-cloud-download:before {\n content: \"\\e917\";\n}\n.icon-colorize:before {\n content: \"\\e918\";\n}\n.icon-forward:before {\n content: \"\\e927\";\n}\n.icon-reply:before {\n content: \"\\e947\";\n}\n.icon-help:before {\n content: \"\\e92a\";\n}\n.icon-info:before {\n content: \"\\e92b\";\n}\n.icon-info-filled:before {\n content: \"\\e91b\";\n}\n.icon-delete-filled:before {\n content: \"\\e91c\";\n}\n.icon-delete:before {\n content: \"\\e91d\";\n}\n.icon-edit:before {\n content: \"\\e923\";\n}\n.icon-new-chat-filled:before {\n content: \"\\e939\";\n}\n.icon-send:before {\n content: \"\\e94a\";\n}\n.icon-send-outline:before {\n content: \"\\e94b\";\n}\n.icon-add-user-filled:before {\n content: \"\\e904\";\n}\n.icon-add-user:before {\n content: \"\\e905\";\n}\n.icon-delete-user:before {\n content: \"\\e91e\";\n}\n.icon-microphone:before {\n content: \"\\e935\";\n}\n.icon-microphone-alt:before {\n content: \"\\e93b\";\n}\n.icon-poll:before {\n content: \"\\e938\";\n}\n.icon-revote:before {\n content: \"\\e93a\";\n}\n.icon-photo:before {\n content: \"\\e940\";\n}\n.icon-document:before {\n content: \"\\e91f\";\n}\n.icon-camera:before {\n content: \"\\e90e\";\n}\n.icon-camera-add:before {\n content: \"\\e90f\";\n}\n.icon-logout:before {\n content: \"\\e932\";\n}\n.icon-saved-messages:before {\n content: \"\\e948\";\n}\n.icon-settings:before {\n content: \"\\e94e\";\n}\n.icon-phone:before {\n content: \"\\e93f\";\n}\n.icon-attach:before {\n content: \"\\e909\";\n}\n.icon-copy:before {\n content: \"\\e91a\";\n}\n.icon-channel:before {\n content: \"\\e911\";\n}\n.icon-group:before {\n content: \"\\e929\";\n}\n.icon-user:before {\n content: \"\\e959\";\n}\n.icon-non-contacts:before {\n content: \"\\e928\";\n}\n.icon-active-sessions:before {\n content: \"\\e902\";\n}\n.icon-admin:before {\n content: \"\\e906\";\n}\n.icon-download:before {\n content: \"\\e921\";\n}\n.icon-location:before {\n content: \"\\e930\";\n}\n.icon-stop:before {\n content: \"\\e952\";\n}\n.icon-archive:before {\n content: \"\\e908\";\n}\n.icon-unarchive:before {\n content: \"\\e953\";\n}\n.icon-readchats:before {\n content: \"\\e933\";\n}\n.icon-unread:before {\n content: \"\\e957\";\n}\n.icon-message:before {\n content: \"\\e934\";\n}\n.icon-lock:before {\n content: \"\\e931\";\n}\n.icon-unlock:before {\n content: \"\\e954\";\n}\n.icon-mute:before {\n content: \"\\e937\";\n}\n.icon-unmute:before {\n content: \"\\e955\";\n}\n.icon-pin:before {\n content: \"\\e941\";\n}\n.icon-unpin:before {\n content: \"\\e956\";\n}\n.icon-smallscreen:before {\n content: \"\\e95e\";\n}\n.icon-fullscreen:before {\n content: \"\\e95f\";\n}\n.icon-large-pause:before {\n content: \"\\e92e\";\n}\n.icon-large-play:before {\n content: \"\\e92f\";\n}\n.icon-pause:before {\n content: \"\\e93d\";\n}\n.icon-play:before {\n content: \"\\e943\";\n}\n.icon-channelviews:before {\n content: \"\\e912\";\n}\n.icon-message-succeeded:before {\n content: \"\\e900\";\n}\n.icon-message-read:before {\n content: \"\\e901\";\n}\n.icon-message-pending:before {\n content: \"\\e94c\";\n}\n.icon-message-failed:before {\n content: \"\\e94d\";\n}\n.icon-favorite:before {\n content: \"\\e93e\";\n}\n.icon-keyboard:before {\n content: \"\\e944\";\n}\n.icon-delete-left:before {\n content: \"\\e945\";\n}\n.icon-recent:before {\n content: \"\\e946\";\n}\n.icon-gifs:before {\n content: \"\\e94f\";\n}\n.icon-stickers:before {\n content: \"\\e95b\";\n}\n.icon-smile:before {\n content: \"\\e950\";\n}\n.icon-animals:before {\n content: \"\\e907\";\n}\n.icon-eats:before {\n content: \"\\e922\";\n}\n.icon-sport:before {\n content: \"\\e951\";\n}\n.icon-car:before {\n content: \"\\e910\";\n}\n.icon-lamp:before {\n content: \"\\e92c\";\n}\n.icon-language:before {\n content: \"\\e92d\";\n}\n.icon-flag:before {\n content: \"\\e926\";\n}\n.icon-more:before {\n content: \"\\e936\";\n}\n.icon-search:before {\n content: \"\\e949\";\n}\n.icon-remove:before {\n content: \"\\e95c\";\n}\n.icon-add:before {\n content: \"\\e903\";\n}\n.icon-check:before {\n content: \"\\e914\";\n}\n.icon-close:before {\n content: \"\\e919\";\n}\n.icon-arrow-left:before {\n content: \"\\e90d\";\n}\n.icon-arrow-right:before {\n content: \"\\e93c\";\n}\n.icon-down:before {\n content: \"\\e920\";\n}\n.icon-up:before {\n content: \"\\e958\";\n}\n.icon-eye-closed:before {\n content: \"\\e925\";\n}\n.icon-eye:before {\n content: \"\\e924\";\n}\n.icon-muted-chat:before {\n content: \"\\e95d\";\n}\n.icon-avatar-archived-chats:before {\n content: \"\\e90a\";\n}\n.icon-avatar-deleted-account:before {\n content: \"\\e90b\";\n}\n.icon-avatar-saved-messages:before {\n content: \"\\e90c\";\n}\n.icon-pinned-chat:before {\n content: \"\\e942\";\n}\n","@import './mixins';\n\n// Common styles for all media-type components across the app.\n.media-inner {\n position: relative;\n\n video,\n img {\n display: block;\n }\n\n img, video {\n object-fit: cover;\n }\n\n video {\n background: no-repeat 50% 50%;\n background-size: contain;\n }\n\n .thumbnail ~ .thumbnail, .thumbnail ~ .full-media, .media-loading {\n position: absolute;\n }\n}\n\n.animated-close-icon {\n position: absolute;\n transform: rotate(-45deg);\n\n &, &::before, &::after {\n width: 1.125rem;\n height: 0.125rem;\n border-radius: 0.125rem;\n background-color: var(--color-text-secondary);\n transition: transform var(--slide-transition);\n }\n\n &::before, &::after {\n position: absolute;\n left: 0;\n top: 0;\n content: '';\n }\n\n &::before {\n transform: rotate(90deg);\n }\n\n &.no-transition {\n &, &::before, &::after {\n transition: none;\n }\n }\n\n &.state-back {\n transform: rotate(180deg);\n\n &::before {\n transform: rotate(45deg) scaleX(0.75) translate(0, -0.375rem);\n }\n\n &::after {\n transform: rotate(-45deg) scaleX(0.75) translate(0, 0.375rem);\n }\n }\n}\n\n// Used by ChatList and ContactList components\n.chat-list {\n background: var(--color-background);\n height: 100%;\n padding: .5rem .125rem .5rem .4375rem;\n\n overflow-y: auto;\n body.is-android & {\n @include overflow-y-overlay();\n }\n\n .scroll-container {\n position: relative;\n }\n\n .ListItem.chat-item-clickable {\n margin: 0;\n }\n\n @media (max-width: 600px) {\n padding-left: 0;\n padding-right: 0;\n }\n\n .no-results {\n color: var(--color-text-meta);\n margin-top: 2rem;\n text-align: center;\n }\n}\n\n// Used by Avatar and ProfilePhoto components\ndiv {\n &.color-bg-1 {\n --color-user: var(--color-user-1);\n }\n\n &.color-bg-2 {\n --color-user: var(--color-user-2);\n }\n\n &.color-bg-4 {\n --color-user: var(--color-user-4);\n }\n\n &.color-bg-5 {\n --color-user: var(--color-user-5);\n }\n\n &.color-bg-6 {\n --color-user: var(--color-user-6);\n }\n\n &.color-bg-7 {\n --color-user: var(--color-user-7);\n }\n\n &.color-bg-8 {\n --color-user: var(--color-user-8);\n }\n\n &.saved-messages {\n --color-user: var(--color-primary);\n }\n\n &.deleted-account {\n --color-user: var(--color-gray);\n }\n}\n","// @optimization\n@mixin while-transition() {\n .Transition > div:not(.active) &, body.animating-right-column & {\n @content;\n }\n}\n\n@mixin overflow-y-overlay() {\n @supports (overflow-y: overlay) {\n overflow-y: overlay;\n\n //Workaround for Android <= 9\n overflow-x: hidden;\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/main.482b1a48855e4e7aae9a.js b/dist/main.482b1a48855e4e7aae9a.js deleted file mode 100644 index ef59490b..00000000 --- a/dist/main.482b1a48855e4e7aae9a.js +++ /dev/null @@ -1,2 +0,0 @@ -(()=>{"use strict";var e,t,n,r,o,d,a={1226:(e,t,n)=>{n.d(t,{t9:()=>c,u3:()=>l,g8:()=>i});var r=n(3716),o=n(6926),d=n(9118);let a;const u=new Map,s=new Map;function i(e,t){return a||(r.eM&&console.log(">>> START LOAD WORKER"),a=new Worker(new URL(n.p+n.u(514),n.b)),function(e){a.addEventListener("message",(({data:t})=>{if("update"===t.type)e(t.update);else if("methodResponse"===t.type){const e=u.get(t.messageId);e&&(t.error?e.reject(t.error):e.resolve(t.response))}else if("methodCallback"===t.type){var n,r;null===(n=u.get(t.messageId))||void 0===n||null===(r=n.callback)||void 0===r||r.call(n,...t.callbackArgs)}else if("unhandledError"===t.type)throw t.error}))}(e),"iOS"===t.platform&&window.addEventListener("focus",(async()=>{try{await Promise.race([f({type:"ping"}),(0,d.wO)(150).then((()=>Promise.reject(new Error("HEALTH_CHECK_TIMEOUT"))))])}catch(e){console.error(e),Date.now()-h>=5e3&&window.location.reload()}}))),f({type:"initApi",args:[t]})}function c(e,...t){if(a)return f({type:"callMethod",name:e,args:t});r.eM&&console.warn("API is not initialized")}function l(e){e.isCanceled=!0;const{messageId:t}=s.get(e)||{};t&&a.postMessage({type:"cancelProgress",messageId:t})}function f(e){const t=(0,o.Z)(u),n={messageId:t,...e},r={messageId:t},d=new Promise(((e,t)=>{Object.assign(r,{resolve:e,reject:t})}));if("args"in n&&"function"==typeof n.args[1]){const e=n.args.pop();r.callback=e,s.set(e,r)}return u.set(t,r),d.catch((()=>{})).finally((()=>{u.delete(t),r.callback&&s.delete(r.callback)})),a.postMessage(n),d}const h=Date.now()},6137:(e,t,n)=>{n.d(t,{Vv:()=>r.Vv,_f:()=>r._f,_Q:()=>r._Q,IU:()=>o.I});var r=n(4746),o=n(9077)},9077:(e,t,n)=>{let r;n.d(t,{I:()=>r}),function(e){e[e.DataUri=0]="DataUri",e[e.BlobUrl=1]="BlobUrl",e[e.Lottie=2]="Lottie",e[e.Progressive=3]="Progressive",e[e.Stream=4]="Stream"}(r||(r={}))},4746:(e,t,n)=>{let r;n.d(t,{Vv:()=>r,_f:()=>o,_Q:()=>d}),function(e){e.Bold="MessageEntityBold",e.Blockquote="MessageEntityBlockquote",e.BotCommand="MessageEntityBotCommand",e.Cashtag="MessageEntityCashtag",e.Code="MessageEntityCode",e.Email="MessageEntityEmail",e.Hashtag="MessageEntityHashtag",e.Italic="MessageEntityItalic",e.MentionName="MessageEntityMentionName",e.Mention="MessageEntityMention",e.Phone="MessageEntityPhone",e.Pre="MessageEntityPre",e.Strike="MessageEntityStrike",e.TextUrl="MessageEntityTextUrl",e.Url="MessageEntityUrl",e.Underline="MessageEntityUnderline",e.Unknown="MessageEntityUnknown"}(r||(r={}));const o=-1,d="MESSAGE_DELETED"},88:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),o=n(5116);const d=36,a=2147483647;function u(e,t,n){let r;for(e=n?Math.floor(e/700):e>>1,e+=Math.floor(e/t),r=0;e>455;r+=d)e=Math.floor(e/35);return Math.floor(r+36*e/(e+38))}function s(e,t){const n=[],r=[],o=e.length;let s,i,c,l,f,h,m,p,g,y,v,b,w;for(s=128,c=0,l=72,f=e.lastIndexOf("-"),f<0&&(f=0),h=0;h=128)throw new RangeError("Illegal input >= 0x80");n.push(e.charCodeAt(h))}for(m=f>0?f+1:0;m=o)throw RangeError("punycode_bad_input(1)");if(v=(I=e.charCodeAt(m++))-48<10?I-22:I-65<26?I-65:I-97<26?I-97:d,v>=d)throw RangeError("punycode_bad_input(2)");if(v>Math.floor((a-c)/g))throw RangeError("punycode_overflow(1)");if(c+=v*g,b=y<=l?1:y>=l+26?26:y-l,vMath.floor(a/(d-b)))throw RangeError("punycode_overflow(2)");g*=d-b}if(i=n.length+1,l=u(c-p,i,0===p),Math.floor(c/i)>a-s)throw RangeError("punycode_overflow(3)");s+=Math.floor(c/i),c%=i,t&&r.splice(c,0,e.charCodeAt(m-1)-65<26),n.splice(c,0,s),c++}var I;if(t)for(c=0,w=n.length;c{const t=[];let n=0;const r=e.length;let o;for(;n65535&&(o-=65536,t.push(String.fromCharCode(o>>>10&1023|55296)),o=56320|1023&o),t.push(String.fromCharCode(o))}return t.join("")})(n)}var i=n(3716),c=n(6752);function l(e){if(e)return e.includes("://")?e:`https://${e}`}function f(e){if(!e)return;const t=l(e);if(t)try{let e=decodeURI(t);const n=e.match(/^https?:\/\/([^/:?#]+)(?:[/:?#]|$)/i);if(!n)return;const r=n[1];return e=e.replace(r,function(e){const t=e.split("."),n=[];for(let e=0;e{const{toggleSafeLinkModal:u,openTelegramLink:s}=(0,o.uC)(),h=d||t,m=e!==h,p=(0,r.I4)((t=>t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e||!e.match(i.FS)&&!e.match(i.Lj)?!m||(u({url:e}),t.preventDefault(),!1):(t.preventDefault(),s({url:e}),!1)),[m,s,u,e]);if(!e)return;const g=(0,c.Z)(n||"text-entity-link",t.length>50&&"long-word-break-all");return r.ZP.createElement("a",{href:l(e),title:f(e),target:"_blank",rel:"noopener noreferrer",className:g,onClick:p,dir:a?"rtl":"auto"},h)}))},5376:(e,t,n)=>{n.d(t,{yW:()=>r,K2:()=>o,mD:()=>d,Oh:()=>a,v6:()=>u});function r(e){return e>536870912?`${(e/1073741824).toFixed(1)} GB`:e>524288?`${(e/1048576).toFixed(1)} MB`:`${(e/1024).toFixed(1)} KB`}function o(e){const{fileName:t,mimeType:n}=e;return d(t,n)}function d(e,t){return e&&-1!==e.indexOf(".")?e.split(".").pop():t.split("/").pop()}function a(e){switch(e){case"apk":case"xls":case"xlsx":return"green";case"zip":case"rar":case"7z":case"tar":case"gz":case"ppt":case"pptx":return"orange";case"pdf":case"xps":return"red";default:return"default"}}function u(e){return Boolean(e.previewBlobUrl||e.thumbnail)}},4784:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(3681);const o=new RegExp(`^(?:${r.Z.source})+$`,""),d=e=>{if(e.length>24)return!1;if(!Boolean(e.match(o)))return!1;let t=0;for(;r.Z.exec(e);)if(t++,t>3)return r.Z.lastIndex=0,!1;return t}},2864:(e,t,n)=>{n.d(t,{D:()=>p});var r=n(4050),o=n(2858),d=n(8035),a=n(9937),u=n(2340),s=n(5116),i=n(782),c=n(6752),l=n(8033);const f=(0,s.c$)(void 0,((e,t)=>(0,i.ei)(t,["openUserInfo"])))((({className:e,sender:t,openUserInfo:n,children:o})=>{const d=(0,r.I4)((()=>{t&&n({id:t.id})}),[t,n]);return t?r.ZP.createElement(l.Z,{className:(0,c.Z)("UserLink",e),onClick:d},o):o})),h=(0,s.c$)(void 0,((e,t)=>(0,i.ei)(t,["focusMessage"])))((({className:e,message:t,children:n,focusMessage:o})=>{const d=(0,r.I4)((()=>{t&&o({chatId:t.chatId,messageId:t.id})}),[o,t]);return t?r.ZP.createElement(l.Z,{className:(0,c.Z)("MessageLink",e),onClick:d},n):n})),m=(0,s.c$)(void 0,((e,t)=>(0,i.ei)(t,["openChat"])))((({className:e,chatId:t,openChat:n,children:o})=>{const d=(0,r.I4)((()=>{t&&n({id:t})}),[t,n]);return t?r.ZP.createElement(l.Z,{className:(0,c.Z)("ChatLink",e),onClick:d},o):o}));function p(e,t,n,s,i,c,l={}){if(!t.content.action)return[];const{text:f,translationValues:p,amount:v,currency:b}=t.content.action,w=[],I={...l,maxTextLength:32};let C,S=e("Chat.Service.Group.UpdatedPinnedMessage1"!==f||i?f:"Message.PinnedGenericMessage",p&&p.length?p:void 0);return S.includes("%payment_amount%")&&(C=y(S,"%payment_amount%",(0,a.x)(v,b,e.code)),S=C.pop(),w.push(...C)),C=y(S,"%action_origin%",n?!l.isEmbedded&&function(e,t,n){return(0,o.iX)(t)?function(e,t,n){const a=(0,d.Z)((0,o.U)(e,t));return n?a:r.ZP.createElement(m,{className:"action-link",chatId:t.id},t&&(0,u.Z)(a))}(e,t,n):g(t,n)}(e,n,l.asPlain)||" ":"User"),S=C.pop(),w.push(...C),C=y(S,"%target_user%",s?s.map((e=>g(e,l.asPlain))).filter(Boolean):"User"),S=C.pop(),w.push(...C),C=y(S,"%message%",i?function(e,t,n={}){const a=(0,o.MK)(e,t),{photo:s,video:i,document:c,sticker:l}=(0,o.qp)(t),{maxTextLength:f,isEmbedded:m,asPlain:p}=n,g=m&&a&&!s&&!i&&!c&&!l;let y=(0,d.Z)(a,f);return m&&(s?y="a photo":i?y=i.isGif?"a GIF":"a video":c?y="a document":l&&(y=a)),p?g?`«${y}»`:y:g?r.ZP.createElement("span",null,"«",r.ZP.createElement(h,{className:"action-link",message:t},(0,u.Z)(y)),"»"):r.ZP.createElement(h,{className:"action-link",message:t},(0,u.Z)(y))}(e,i,I):"a message"),S=C.pop(),w.push(...C),C=y(S,"%product%",i?function(e){return e.content&&e.content.invoice?e.content.invoice.title:"a product"}(i):"a product"),S=C.pop(),w.push(...C),C=y(S,"%target_chat%",c?function(e,t){const n="another chat";return t?n:r.ZP.createElement(m,{className:"action-link",chatId:e},n)}(c,l.asPlain):"another chat"),w.push(...C),l.asPlain?w.join("").trim():w}function g(e,t){const n=(0,d.Z)((0,o.Js)(e));return t?n:r.ZP.createElement(f,{className:"action-link",sender:e},e&&(0,u.Z)(n))}function y(e,t,n){const r=e.indexOf(t);if(r<0||!n)return[e];const o=[];return o.push(e.substring(0,r)),Array.isArray(n)?n.forEach(((e,t)=>{o.push(e),t+1{n.d(t,{Z:()=>h});var r=n(4050),o=n(3681),d=n(3716),a=n(7361),u=n(4284),s=n(6752),i=n(7373),c=n(88);const l=/^[\d\wа-яё]$/i,f=/(\*\*|__).+?\1/g;function h(e,t=["emoji"],n){return"string"!=typeof e?[e]:t.reduce(((e,t)=>{switch(t){case"escape_html":return function(e){const t=document.createElement("div");return e.reduce(((e,n)=>"string"!=typeof n?[...e,n]:(t.innerText=n,[...e,t.innerHTML])),[])}(e);case"hq_emoji":return o.Z.lastIndex=0,m(e,"big","jsx");case"emoji":return o.Z.lastIndex=0,m(e,"small","jsx");case"emoji_html":return o.Z.lastIndex=0,m(e,"small","html");case"br":return p(e,"jsx");case"br_html":return p(e,"html");case"highlight":return d=e,a=n.highlight,d.reduce(((e,t)=>{if("string"!=typeof t||!a)return[...e,t];const n=t.toLowerCase(),o=n.indexOf(a.toLowerCase()),d=n[o+a.length];if(o<0||d&&d.match(l))return[...e,t];const u=[];return u.push(t.substring(0,o)),u.push(r.ZP.createElement("span",{className:"matching-text-highlight"},t.substring(o,o+a.length))),u.push(t.substring(o+a.length)),[...e,...u]}),[]);case"links":return function(e){return e.reduce(((e,t)=>{if("string"!=typeof t)return[...e,t];const n=t.match(g);if(!n||!n.length)return[...e,t];const o=[];let d=n.shift(),a=0;for(;d;){const e=t.indexOf(d,a);o.push(t.substring(a,e)),d.startsWith("@")?o.push(r.ZP.createElement(i.Z,{username:d},d)):(d.endsWith("?")&&(d=d.slice(0,d.length-1)),o.push(r.ZP.createElement(c.Z,{text:d,url:d}))),a=e+d.length,d=n.shift()}return o.push(t.substring(a)),[...e,...o]}),[])}(e);case"simple_markdown":return y(e,"jsx");case"simple_markdown_html":return y(e,"html")}var d,a;return e}),[e])}function m(e,t,n){return a.op?e:e.reduce(((e,d)=>{if("string"!=typeof d)return[...e,d];const a=(d=(0,u.g6)(d)).split(o.Z),i=d.match(o.Z)||[];return e.push(a[0]),i.reduce(((e,d,i)=>{const c=(0,u.U_)((0,o.l)(d));if(!c)return e;const l=(0,s.Z)("emoji","small"===t&&"emoji-small");"jsx"===n&&e.push(r.ZP.createElement("img",{className:l,src:`./img-apple-${"big"===t?"160":"64"}/${c}.png`,alt:d})),"html"===n&&e.push(`${d}`);const f=2*i+2;return a[f]&&e.push(a[f]),e}),e)}),[])}function p(e,t){return e.reduce(((e,n)=>"string"!=typeof n?[...e,n]:[...e,...n.split(/\r\n|\r|\n/g).reduce(((e,n,o,d)=>{const a=n.trimLeft(),u=n.length-a.length;return e.push(String.fromCharCode(160).repeat(u)+a),o!==d.length-1&&e.push("jsx"===t?r.ZP.createElement("br",null):"
"),e}),[])]),[])}const g=new RegExp(`${d.FM}|${d.uW}`,"ig");function y(e,t){return e.reduce(((e,n)=>{if("string"!=typeof n)return[...e,n];const o=n.split(f),d=n.match(f)||[];return e.push(o[0]),d.reduce(((e,n,d)=>{"jsx"===t?e.push(n.startsWith("**")?r.ZP.createElement("b",null,n.replace(/\*\*/g,"")):r.ZP.createElement("i",null,n.replace(/__/g,""))):e.push(n.startsWith("**")?`${n.replace(/\*\*/g,"")}`:`${n.replace(/__/g,"")}`);const a=2*d+2;return o[a]&&e.push(o[a]),e}),e)}),[])}},386:(e,t,n)=>{n.d(t,{q:()=>d,b:()=>a});var r=n(3716),o=n(7361);function d(e,t=!1){o.cj||!document.activeElement||document.activeElement.id!==r.R2||!t&&e.target!==e.currentTarget||e.preventDefault()}function a(e){d(e,!0)}},7373:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),o=n(5116),d=n(782),a=n(8085);const u=(0,o.c$)(((e,{userId:t})=>({userOrChat:t?(0,a.dy)(e,t):void 0})),((e,t)=>(0,d.ei)(t,["openChat","openChatByUsername"])))((({username:e,userOrChat:t,children:n,openChat:o,openChatByUsername:d})=>r.ZP.createElement("a",{onClick:()=>{t?o({id:t.id}):e&&d({username:e.substring(1)})},className:"text-entity-link",dir:"auto"},n)))},231:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),o=n(6752),d=n(9204),a=n(8512);const u=({ref:e,type:t="button",onClick:n,onContextMenu:u,onMouseDown:s,onMouseEnter:i,onMouseLeave:c,onFocus:l,children:f,size:h="default",color:m="primary",className:p,round:g,pill:y,fluid:v,isText:b,isLoading:w,ariaLabel:I,href:C,download:S,disabled:E,ripple:M,faded:P,tabIndex:A,isRtl:T})=>{let k=(0,r.sO)(null);e&&(k=e);const[N,R]=(0,r.eJ)(!1),L=(0,o.Z)("Button",p,h,m,g&&"round",y&&"pill",v&&"fluid",E&&"disabled",b&&"text",w&&"loading",M&&"has-ripple",P&&"faded",N&&"clicked"),D=(0,r.I4)((e=>{!E&&n&&n(e),R(!0),setTimeout((()=>{R(!1)}),400)}),[E,n]),O=(0,r.I4)((e=>{e.preventDefault(),!E&&s&&s(e)}),[s,E]);return C?r.ZP.createElement("a",{ref:k,className:L,href:C,title:I,download:S,tabIndex:A,dir:T?"rtl":void 0},f,!E&&M&&r.ZP.createElement(a.Z,null)):r.ZP.createElement("button",{ref:k,type:t,className:L,onClick:D,onContextMenu:u,onMouseDown:O,onMouseEnter:i&&!E?i:void 0,onMouseLeave:c&&!E?c:void 0,onFocus:l&&!E?l:void 0,"aria-label":I,title:I,tabIndex:A,dir:T?"rtl":void 0},w?r.ZP.createElement("div",null,r.ZP.createElement("span",{dir:T?"auto":void 0},"Please wait.."),r.ZP.createElement(d.Z,{color:b?"blue":"white"})):f,!E&&M&&r.ZP.createElement(a.Z,null))}},4605:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),o=n(6752),d=n(9107),a=n(9204);const u=(0,r.X$)((({id:e,name:t,value:n,label:u,subLabel:s,checked:i,disabled:c,round:l,blocking:f,isLoading:h,onChange:m,onCheck:p})=>{const g=(0,d.Z)(),y=(0,r.I4)((e=>{m&&m(e),p&&p(e.currentTarget.checked)}),[m,p]),v=(0,o.Z)("Checkbox",c&&"disabled",l&&"round",h&&"loading",f&&"blocking");return r.ZP.createElement("label",{className:v,dir:g.isRtl?"rtl":void 0},r.ZP.createElement("input",{type:"checkbox",id:e,name:t,value:n,checked:i,disabled:c,onChange:y}),r.ZP.createElement("div",{className:"Checkbox-main"},r.ZP.createElement("span",{className:"label",dir:"auto"},u),s&&r.ZP.createElement("span",{className:"subLabel",dir:"auto"},s)),h&&r.ZP.createElement(a.Z,null))}))},3106:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(2328);const d=({trigger:e,className:t,children:n,positionX:d="left",positionY:a="top",footer:u,forceOpen:s,onOpen:i,onClose:c})=>{const l=(0,r.sO)(null),f=(0,r.sO)(null),[h,m]=(0,r.eJ)(!1);return r.ZP.createElement("div",{ref:f,className:`DropdownMenu ${t||""}`,onKeyDown:e=>{const t=l.current;if(!h||40!==e.keyCode||!t)return;const n=document.activeElement,r=Array.from(t.children);n&&-1!==r.indexOf(n)||r[0].focus()}},e({onTrigger:()=>{m(!h),h?c&&c():i&&i()},isOpen:h}),r.ZP.createElement(o.Z,{ref:l,containerRef:f,isOpen:h||!!s,className:t||"",positionX:d,positionY:a,footer:u,autoClose:!0,onClose:()=>{m(!1),c&&c()},shouldSkipTransition:s},n))}},7687:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050),o=n(6752),d=n(9107);const a=(0,r.X$)((({ref:e,id:t,className:n,value:a,label:u,error:s,success:i,disabled:c,readOnly:l,placeholder:f,autoComplete:h,inputMode:m,maxLength:p,onChange:g,onInput:y,onKeyPress:v,onKeyDown:b,onBlur:w,onPaste:I})=>{const C=(0,d.Z)(),S=s||i||u,E=(0,o.Z)("input-group",a&&"touched",s?"error":i&&"success",c&&"disabled",l&&"disabled",S&&"with-label",n);return r.ZP.createElement("div",{className:E,dir:C.isRtl?"rtl":void 0},r.ZP.createElement("input",{ref:e,className:"form-control",type:"text",id:t,dir:"auto",value:a||"",placeholder:f,maxLength:p,autoComplete:h,inputMode:m,disabled:c,readOnly:l,onChange:g,onInput:y,onKeyPress:v,onKeyDown:b,onBlur:w,onPaste:I}),S&&r.ZP.createElement("label",{htmlFor:t},S))}))},8033:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(6752);const d=({children:e,className:t,isRtl:n,onClick:d})=>{const a=(0,r.I4)((e=>{e.preventDefault(),d(e)}),[d]);return r.ZP.createElement("a",{href:"#",className:(0,o.Z)("Link",t),dir:n?"rtl":"auto",onClick:d?a:void 0},e)}},4288:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(9204);const d=(0,r.X$)((({color:e="blue"})=>r.ZP.createElement("div",{className:"Loading"},r.ZP.createElement(o.Z,{color:e,withBackground:"white"===e}))))},2328:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),o=n(1212),d=n(2313),a=n(8758),u=n(274),s=n(3989),i=n(6752),c=n(8674),l=n(6590),f=n(386);const h=({ref:e,containerRef:t,isOpen:n,className:h,style:m,children:p,positionX:g="left",positionY:y="top",autoClose:v=!1,footer:b,noCloseOnBackdrop:w=!1,onCloseAnimationEnd:I,onClose:C,onMouseEnter:S,onMouseLeave:E,shouldSkipTransition:M})=>{let P=(0,r.sO)(null);e&&(P=e);const A=t||P,{transitionClassNames:T}=(0,o.Z)(n,I,M,void 0,M);(0,r.d4)((()=>n&&C?(0,s.Z)(C):void 0),[n,C]),(0,l.ZP)(n,C,void 0,void 0,v),(0,u.Z)((([e])=>{void 0!==e&&(0,c.YW)(200)}),[n]);const k=(0,d.Z)(P,n,v?C:void 0,void 0,!0);(0,a.Z)(n,A,w?void 0:C);const N=(0,i.Z)("bubble menu-container custom-scroll",y,g,b&&"with-footer",T);return r.ZP.createElement("div",{className:(0,i.Z)("Menu no-selection",h),onKeyDown:n?k:void 0,onMouseEnter:S,onMouseLeave:n?E:void 0,style:m},n&&r.ZP.createElement("div",{className:"backdrop",onMouseDown:f.b}),r.ZP.createElement("div",{ref:P,className:N,style:`transform-origin: ${y} ${g}`,onClick:v?C:void 0},p,b&&r.ZP.createElement("div",{className:"footer"},b)))}},8964:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050),o=n(6752),d=n(9107);const a=e=>{const{icon:t,className:n,children:a,onClick:u,href:s,download:i,disabled:c,destructive:l,ariaLabel:f}=e,h=(0,d.Z)(),m=(0,r.I4)((e=>{if(c||!u)return e.stopPropagation(),void e.preventDefault();u(e)}),[c,u]),p=(0,r.I4)((e=>{if(13===e.keyCode||32===e.keyCode)return c||!u?(e.stopPropagation(),void e.preventDefault()):void u(e)}),[c,u]),g=(0,o.Z)("MenuItem",n,c&&"disabled",l&&"destructive"),y=r.ZP.createElement(r.ZP.Fragment,null,t&&r.ZP.createElement("i",{className:`icon-${t}`,"data-char":t.startsWith("char-")?t.replace("char-",""):void 0}),a);return s?r.ZP.createElement("a",{tabIndex:0,className:g,href:s,download:i,"aria-label":f,title:f,target:s.startsWith(window.location.origin)?"_self":"_blank",rel:"noopener noreferrer",dir:h.isRtl?"rtl":void 0,onClick:u},y):r.ZP.createElement("div",{role:"button",tabIndex:0,className:g,onClick:m,onKeyDown:p,"aria-label":f,title:f,dir:h.isRtl?"rtl":void 0},y)}},8512:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(9118);const d=(0,r.X$)((()=>{const[e,t]=(0,r.eJ)([]),n=(0,r.Ye)((()=>(0,o.Ds)((()=>{t([])}),700,!1)),[]),d=(0,r.I4)((r=>{if(0!==r.button)return;const o=r.currentTarget,d=o.getBoundingClientRect(),a=o.offsetWidth/2;t([...e,{x:r.clientX-d.x-a/2,y:r.clientY-d.y-a/2,size:a}]),requestAnimationFrame((()=>{n()}))}),[e,n]);return r.ZP.createElement("div",{className:"ripple-container",onMouseDown:d},e.map((({x:e,y:t,size:n})=>r.ZP.createElement("span",{style:`left: ${e}px; top: ${t}px; width: ${n}px; height: ${n}px;`}))))}))},9204:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(6752);const d=({color:e="blue",withBackground:t})=>r.ZP.createElement("div",{className:(0,o.Z)("Spinner",e,t&&"with-background")},r.ZP.createElement("div",null))},3716:(e,t,n)=>{n.d(t,{Ti:()=>r,ou:()=>o,iC:()=>d,Ji:()=>a,eM:()=>u,ZT:()=>s,Cg:()=>i,S:()=>c,b_:()=>l,Vx:()=>f,sd:()=>h,Uh:()=>m,gJ:()=>p,lO:()=>g,Cy:()=>y,lW:()=>v,SG:()=>b,lF:()=>w,fo:()=>I,ee:()=>C,lo:()=>E,gZ:()=>M,hT:()=>P,YQ:()=>A,rS:()=>T,t_:()=>k,Ov:()=>N,EN:()=>R,pn:()=>L,Hk:()=>D,Vk:()=>O,mo:()=>Z,qU:()=>x,ul:()=>_,NM:()=>B,oB:()=>F,zy:()=>U,CX:()=>$,xS:()=>G,b6:()=>j,AR:()=>W,r_:()=>H,R2:()=>V,nY:()=>K,QU:()=>z,jT:()=>Q,_m:()=>J,ks:()=>q,l3:()=>Y,u_:()=>X,rO:()=>ee,AE:()=>te,fK:()=>ne,V$:()=>re,bK:()=>oe,ck:()=>de,xn:()=>ae,K7:()=>ue,w7:()=>se,z7:()=>ie,qp:()=>ce,Q:()=>le,Mw:()=>fe,DC:()=>he,Y7:()=>me,yK:()=>pe,K2:()=>ge,bM:()=>ye,ku:()=>ve,zq:()=>be,n:()=>we,pR:()=>Ie,kU:()=>Ce,Y:()=>Se,AK:()=>Ee,FM:()=>Me,uW:()=>Pe,FS:()=>Ae,Lj:()=>Te,aw:()=>ke,FV:()=>Ne,Nf:()=>Re,WS:()=>Le,DU:()=>De,EG:()=>Oe,t4:()=>Ze,sR:()=>xe,$O:()=>_e,Bg:()=>Be,vi:()=>Fe,Db:()=>Ue,mU:()=>$e,p3:()=>Ge,It:()=>je,Vv:()=>We,g:()=>He});const r="Telegram",o=" [Inactive]",d="Telegram WebZ",a="1.11.13",u=!1,s=!1,i=!1,c="Shoot!\nSomething went wrong, please see the error details in Dev Tools Console.",l="user_auth",f="GramJs:sessionId",h=!1,m="tt-global-state",p=30,g=5e3,y=!1,v="tt-media",b="tt-media-avatars",w="tt-media-progressive",I="tt-custom-bg",C="tt-lang-packs-v5",S="undefined"!=typeof window&&window.innerHeight>=900,E=1,M=750,P=S?60:40,A=2*P,T=72,k=S?30:25,N=100,R=42,L=42,D=20,O=30,Z=200,x=500,_=20,B=!1,F=0,U=2,$=U,G=16,j=17,W=15,H=1e4,V="editable-message-text",K="editable-message-text-modal",z=1440,Q=1150,J=1275,q=925,Y=600,X=950,ee=450,te=1e9,ne=100,re=1500,oe=250,de=600,ae=500,ue=(Math.round((oe+de)/2),new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory"]),13),se=11,ie=160,ce=120,le=64,fe=48,he=32,me=64,pe=64,ge=160,ye=140,ve=80,be=100,we="MEMOJI_STICKER",Ie="en",Ce=200,Se=450,Ee=new Set(["image/png","image/gif","image/jpeg","video/mp4","video/avi","video/quicktime"]),Me="((ftp|https?):\\/\\/)?((www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,63})\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)",Pe="(@[\\w\\d_-]+)",Ae=/^(?:https?:\/\/)?(?:t\.me\/)([\d\w_]+)(?:\/([\d]+))?(?:\/([\d]+))?$/gm,Te=/^(?:https?:\/\/)?(?:t\.me\/joinchat\/)([\d\w_-]+)?$/gm,ke=777e3,Ne=1271266957,Re=0,Le=1,De=10,Oe=5,Ze=2147483646,xe="en",_e="android",Be=["android","ios","tdesktop","macos"],Fe="TelegramTips",Ue=["ar","pt-br","id","it","ko","ms","pl","es","tr"],$e="https://bugs.telegram.org/?tag_ids=41&sort=time",Ge="#A2AF8E",je="#0F0F0F",We="#0a0a0a8c",He="rgba(90, 110, 70, 0.6)"},274:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(7204);const d=(e,t,n)=>{const d=(0,o.Z)(t);return(0,r.d4)((()=>e(d||[])),t,n)}},706:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);const o=(e=!1)=>{const[t,n]=(0,r.eJ)(e);return[t,(0,r.I4)((()=>{n(!0)}),[]),(0,r.I4)((()=>{n(!1)}),[])]}},5326:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);const o=()=>{const[,e]=(0,r.eJ)(!1);return(0,r.I4)((()=>{e((e=>!e))}),[])}},8674:(e,t,n)=>{n.d(t,{_L:()=>o,OV:()=>d,YW:()=>s,ZP:()=>i});var r=n(4050);const o="tt-event-heavy-animation-start",d="tt-event-heavy-animation-end";let a,u=!1;const s=e=>(u||(u=!0,document.dispatchEvent(new Event(o))),a&&(clearTimeout(a),a=void 0),e&&(a=window.setTimeout((()=>{u=!1,document.dispatchEvent(new Event(d)),a=void 0}),e)),()=>{u=!1,document.dispatchEvent(new Event(d))}),i=(e,t)=>{(0,r.d4)((()=>(u&&e(),document.addEventListener(o,e),document.addEventListener(d,t),()=>{document.removeEventListener(d,t),document.removeEventListener(o,e)})),[t,e])}},6590:(e,t,n)=>{n.d(t,{Oy:()=>s,Wv:()=>c,ZP:()=>f});var r=n(4050),o=n(7361),d=n(7204),a=n(5116),u=n(782);const s=window.location.hash,i={currentIndex:0,nextStateIndexToReplace:-1,isHistoryAltered:!1,isDisabled:!1,isEdge:!1,currentIndexes:[]},c=()=>{i.isDisabled=!0},l=()=>{i.isEdge&&setTimeout((()=>{i.isEdge=!1}),350)};function f(e,t,n,o,s=!1,c){const l=(0,r.sO)(-1),f=(0,r.sO)(!1),h=(0,d.Z)(e),m=(0,r.sO)(!0),p=(0,r.sO)([]),g=(0,d.Z)(c),y=(0,r.sO)(!1),v=(0,r.I4)(((t=!1)=>{if(c){const e=g||[];if(e.length0){const e=p.current[p.current.length-t-1];let n=t;if(e){const t=i.currentIndexes.findIndex((t=>t===e.index));n=i.currentIndexes.length-t-1}i.isHistoryAltered=!0,window.history.go(-n),p.current.splice(p.current.length-t-1,t).forEach((({index:e})=>{i.currentIndexes.splice(i.currentIndexes.indexOf(e),1)}))}c.length>0&&setTimeout((()=>{const e=++i.currentIndex;i.currentIndexes[i.currentIndexes.length-1]=e,window.history.replaceState({index:e,state:o},"",`#${c[c.length-1]}`),p.current[p.current.length-1]={index:e,hash:c[c.length-1]}}),0)}}}else e&&!t&&(m.current=!1,f.current?(f.current=!1,i.currentIndexes.push(l.current)):setTimeout((()=>{const e=++i.currentIndex;i.currentIndexes.push(e),window.history[i.currentIndexes.includes(i.nextStateIndexToReplace-1)&&0!==window.history.state.index&&i.nextStateIndexToReplace===e&&!s?"replaceState":"pushState"]({index:e,state:o},""),l.current=e,s&&(i.nextStateIndexToReplace=i.currentIndex+1)}),0)),!t&&e||m.current||(l.current!==i.currentIndex&&s||(i.isHistoryAltered=!0,window.history.back(),setTimeout((()=>{i.nextStateIndexToReplace=-1}),400)),i.currentIndexes.splice(i.currentIndexes.indexOf(l.current),1),m.current=!0)}),[o,c,e,g,s]);return(0,r.d4)((()=>{const r=e=>{if(i.isHistoryAltered)return void setTimeout((()=>{i.isHistoryAltered=!1}),0);const{index:r}=e.state,o=r||0;try{const r=c?p.current[p.current.length-1].index:l.current,d=i.currentIndexes[i.currentIndexes.indexOf(r)-1];if(i.isDisabled)return;!m.current&&(0===o||o===d)||c&&(0===o||o===d)?(c&&(y.current=!0,p.current.pop()),i.currentIndexes.splice(i.currentIndexes.indexOf(r),1),t&&(i.isEdge&&(0,a.uC)().disableHistoryAnimations(),t(!i.isEdge),m.current=!0)):o===r&&m.current&&n&&!c&&(f.current=!0,i.isEdge&&(0,a.uC)().disableHistoryAnimations(),n(e.state.state))}catch(e){}},o=c?!g||!(0,u.et)(g,c):h!==e;return!i.isDisabled&&o&&v(),window.addEventListener("popstate",r),()=>window.removeEventListener("popstate",r)}),[o,v,c,e,t,n,g,h,s]),{forceClose:()=>v(!0)}}o.cj&&(window.addEventListener("touchstart",(e=>{const t=e.touches[0].pageX;(t<=300||t>=window.innerWidth-300)&&(i.isEdge=!0)})),window.addEventListener("touchend",l),window.addEventListener("popstate",l)),window.history.replaceState({index:i.currentIndex},"",window.location.pathname)},2313:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);const o=(e,t,n,o,d)=>{const[a,u]=(0,r.eJ)(-1);return(0,r.d4)((()=>{u(-1);const n=e.current;t&&n&&!d&&(n.tabIndex=-1,n.focus())}),[e,t,d]),(0,r.I4)((t=>{const r=e.current;if(!r)return;if(13===t.keyCode&&n)return void n(a);if(38!==t.keyCode&&40!==t.keyCode)return;const d=document.activeElement,s=Array.from(o?r.querySelectorAll(o):r.children);let i=d&&s.indexOf(d)||a;if(38===t.keyCode&&i>0)i--;else if(40===t.keyCode&&i{n.d(t,{Z:()=>a});var r=n(663),o=n(5326),d=n(9290);const a=()=>{const e=(0,o.Z)();return(0,d.Z)((()=>r.ll(e)),[e]),r.i0}},8778:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050),o=n(9203),d=n(5326);const a=(e,t,n=!1,a=!1)=>{const u=(0,o.o5)(e,t),s=(0,d.Z)();return a&&(0,o.Qt)(s),(0,r.d4)((()=>{n||u||(0,o.$y)(e,t).then(s)}),[e,s,u,t,n]),u}},9290:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(7204);const o=(e,t)=>{const n=(0,r.Z)(t);n&&!t.some(((e,t)=>e!==n[t]))||e(n||[])}},7204:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);const o=function(e,t){const n=(0,r.sO)(),{current:o}=n;return t&&void 0===e||(n.current=e),o}},1212:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(6752);const d=(e=!1,t,n=!1,d="fast",a=!1)=>{const[u,s]=(0,r.eJ)(!e),i=(0,r.sO)(),[c,l]=(0,r.eJ)(e&&n);e?(s(!1),l(!0),i.current&&(window.clearTimeout(i.current),i.current=void 0)):(l(!1),u||i.current||(i.current=window.setTimeout((()=>{s(!0),t&&t(),i.current=void 0}),a?0:350)));const f=c&&!(a&&!e),h=Boolean(i.current),m=e||h;return{shouldRender:m,transitionClassNames:(0,o.Z)(d&&"opacity-transition",d,f&&"open",m&&"shown",h&&"closing")}}},8758:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);function o(e,t,n){(0,r.d4)((()=>{const r=e=>{const r=t.current,o=e.target;r&&o&&(r.contains(e.target)&&!o.classList.contains("backdrop")||(e.preventDefault(),e.stopPropagation(),n&&n()))};return e&&n&&document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}}),[e,t,n])}},5247:(e,t,n)=>{n.d(t,{Oo:()=>s,xg:()=>i,lQ:()=>h});var r=n(3716);const o=new Set(["scroll","mouseenter","mouseleave"]),d={},a=new Map,u={};function s(e,t,n,r=!1){const o=c(t,e);l(o,e,r)?function(e,t,n){u[e]||(u[e]=0,document.addEventListener(e,m)),function(e){return d[e]||(d[e]=new Map),d[e]}(e).set(t,n),function(e){const t=a.get(e);if(t)return t;const n=new Set;return a.set(e,n),n}(t).add(e),u[e]++}(o,e,n):e.addEventListener(o,n,r)}function i(e,t,n,r=!1){const o=c(t,e);l(o,e,r)?f(o,e):e.removeEventListener(o,n,r)}function c(e,t){const n=e.replace(/^on/,"").replace(/Capture$/,"").toLowerCase();return"change"===n&&"SELECT"!==t.tagName?"input":"doubleclick"===n?"dblclick":"focus"===n?"focusin":"blur"===n?"focusout":n}function l(e,t,n){return!n&&!o.has(e)&&"VIDEO"!==t.tagName&&"IFRAME"!==t.tagName}function f(e,t){u[e]--,u[e]||document.removeEventListener(e,m),d[e].delete(t),a.get(t).delete(e)}function h(e){const t=a.get(e);t&&(t.forEach((t=>f(t,e))),a.delete(e))}function m(e){const t=d[e.type];if(t){let n=!1,r=e.target;const o=()=>{n=!0},d=()=>{e.preventDefault()},a=new Proxy(e,{get:(e,t)=>"currentTarget"===t?r:"stopPropagation"===t||"stopImmediatePropagation"===t?o:"preventDefault"===t?d:Reflect.get(e,t)});for(;r&&r!==document.body;){const e=t.get(r);if(e&&(e(a),n))return;r=r.parentNode}}}r.eM&&document.addEventListener("dblclick",(()=>{console.log("DELEGATED EVENTS",{delegationRegistry:d,delegatedEventsByElement:a,documentEventCounters:u})}))},2916:(e,t,n)=>{n.d(t,{Z:()=>v});var r=n(4050),o=n(6926),d=n(3716),a=n(5247);const u=new Set(["key","ref","teactFastList","teactOrderKey"]),s=new Set(["dir"]),i={autoPlay:"autoplay",autoComplete:"autocomplete"},c={};function l(e,t,n,o,a,{skipComponentUpdate:u=!1,forceIndex:s=!1,fragment:i,moveDirection:c}={}){if(!u&&t&&n&&(0,r.op)(t)&&(0,r.op)(n)&&!(0,r.k)(t,n)&&(n=function(e,t){return e.componentInstance.props=t.componentInstance.props,(0,r.SO)(e.componentInstance)}(t,n)),!u&&n&&(0,r.op)(n)&&n.componentInstance.isMounted&&h(n,o,a,e),t===n)return n;if(!t&&n){(0,r.op)(n)&&(n=f(n,o,a,e));const t=m(n);(0,r.CD)(n,t),s&&e.childNodes[a]?e.insertBefore(t,e.childNodes[a]):(i||e).appendChild(t)}else if(t&&!n)e.removeChild((0,r.U9)(t)),(0,r.Zb)(t);else if(t&&n)if((0,r.k)(t,n)){(0,r.op)(n)&&(n=f(n,o,a,e));const d=m(n);(0,r.CD)(n,d),e.replaceChild(d,(0,r.U9)(t)),(0,r.Zb)(t)}else{const o=(0,r.op)(t)&&(0,r.op)(n);if(o||(0,r.CD)(n,(0,r.U9)(t)),(0,r.O_)(t)&&(0,r.O_)(n)){if(c){const n=(0,r.U9)(t),o=e.childNodes["up"===c?a:a+1];o?e.insertBefore(n,o):(i||e).appendChild(n)}o||function(e,t,n){const r=Object.keys(e.props),o=Object.keys(t.props);r.forEach((r=>{void 0!==e.props[r]&&void 0===t.props[r]&&y(n,r,e.props[r])})),o.forEach((r=>{void 0!==t.props[r]&&e.props[r]!==t.props[r]&&(void 0===e.props[r]?g(n,r,t.props[r]):function(e,t,n,r){"value"===t?e.value=void 0!==r?r:"":(y(e,t,n),g(e,t,r))}(n,r,e.props[r],t.props[r]))}))}(t,n,(0,r.U9)(t)),n.children=function(e,t,n){if(t.props.teactFastList)return function(e,t,n){const o=new Set(t.children.map((e=>{const t="props"in e&&e.props.key;return d.eM&&(0,r.O_)(e)&&!t&&console.warn("Missing `key` in `teactFastList`"),t})));let a=0;const u=e.children.reduce(((e,r,d)=>{let u="props"in r?r.props.key:void 0;if(u&&!o.has(u))return l(n,r,void 0,t,-1),e;if(!u){const o=t.children[d],a=o&&"props"in o?o.props.key:void 0;if(!o||a)return l(n,r,void 0,t,-1),e;u=`__indexKey#${d}`}return e[u]={$element:r,index:a++,order:"props"in r?r.props.teactOrderKey:void 0},e}),{});let s,i,c=[],f=0;return t.children.forEach(((e,r)=>{const o="props"in e?e.props.key:`__indexKey#${r}`,d=u[o];if(!d)return s||(s=[],i=r),void s.push(e);s&&(c=c.concat(p(s,i,n,t)),i=void 0,s=void 0);const a="props"in e?e.props.teactOrderKey:void 0,h=d.index!==f&&d.order!==a,m=h&&f>d.index;h&&!m||f++,c.push(l(n,d.$element,e,t,r,{forceIndex:!0,...h&&{moveDirection:m?"down":"up"}}))})),s&&(c=c.concat(p(s,i,n,t))),c}(e,t,n);const o=Math.max(e.children.length,t.children.length),a=[],u=t.children.length>e.children.length+1?document.createDocumentFragment():void 0;for(let r=0;r=e.children.length?{fragment:u}:void 0);o&&a.push(o)}return u&&n.appendChild(u),a}(t,n,o?e:(0,r.U9)(t))}}return n}function f(e,t,n,o){if(!(0,r.op)(e))return e;const{componentInstance:d}=e;if(!d.isMounted){h(e=(0,r.Hb)(d),t,n,o);const a=e.children[0];(0,r.op)(a)&&(e.children=[f(a,e,0,o)]),d.isMounted=!0}return e}function h(e,t,n,r){const{componentInstance:o}=e;o.onUpdate=()=>{t.children[n]=l(r,t.children[n],o.$element,t,n,{skipComponentUpdate:!0})}}function m(e){if((0,r.V2)(e))return document.createTextNode("");if((0,r.iB)(e))return document.createTextNode(e.value);if((0,r.op)(e))return m(e.children[0]);const{tag:t,props:n,children:o=[]}=e,d=document.createElement(t);return"object"==typeof n.ref&&(n.ref.current=d),Object.keys(n).forEach((e=>{g(d,e,n[e])})),e.children=o.map(((t,n)=>l(d,void 0,t,e,n))),d}function p(e,t,n,r){if(1===e.length)return[l(n,void 0,e[0],r,t,{forceIndex:!0})];if(e.length>1){const o=document.createDocumentFragment(),d=e.map((e=>l(n,void 0,e,r,t,{fragment:o})));return n.childNodes[t]?n.insertBefore(o,n.childNodes[t]):n.appendChild(o),d}throw new Error("Unexpected input")}function g(e,t,n){void 0!==n&&("className"===t?e.className=n:"value"===t?e.value=n:"style"===t?e.style.cssText=n:t.startsWith("on")?(0,a.Oo)(e,t,n,t.endsWith("Capture")):t.startsWith("data-")||s.has(t)?e.setAttribute(t,n):u.has(t)||(e[i[t]||t]=n))}function y(e,t,n){"className"===t?e.className="":"value"===t?e.value="":"style"===t?e.style.cssText="":t.startsWith("on")?(0,a.xg)(e,t,n,t.endsWith("Capture")):t.startsWith("data-")||s.has(t)?e.removeAttribute(t):u.has(t)||delete e[i[t]||t]}const v={render:function(e,t){if(!t)return;let n=t.getAttribute("data-teact-head-id");n||(n=(0,o.Z)(c),c[n]={children:[]},t.setAttribute("data-teact-head-id",n));const r=c[n];r.children=[l(t,r.children[0],e,r,0)]}}},4050:(e,t,n)=>{n.d(t,{V2:()=>f,iB:()=>h,op:()=>p,O_:()=>g,SO:()=>S,k:()=>E,Zb:()=>M,Hb:()=>P,U9:()=>k,CD:()=>N,eJ:()=>R,d4:()=>D,bt:()=>O,Ye:()=>Z,I4:()=>x,sO:()=>_,X$:()=>B,ZP:()=>F});var r=n(3716),o=n(9118),d=n(782),a=n(275),u=n(3592),s=n(5247);let i;!function(e){e[e.Empty=0]="Empty",e[e.Text=1]="Text",e[e.Tag=2]="Tag",e[e.Component=3]="Component"}(i||(i={}));const c=Symbol("Fragment");let l;function f(e){return e.type===i.Empty}function h(e){return e.type===i.Text}function m(e){return e.type===i.Tag}function p(e){return e.type===i.Component}function g(e){return m(e)||p(e)}function y(e,t,...n){return t||(t={}),n=(0,d.xH)(n),e===c?n:"function"==typeof e?function(e,t,n){let r;0===n.length?r=void 0:1===n.length?[r]=n:r=n;const o={$element:{},Component:e,name:e.name,props:{...t,...r&&{children:r}},isMounted:!1,hooks:{state:{cursor:0,byCursor:[]},effects:{cursor:0,byCursor:[]},memos:{cursor:0,byCursor:[]}}};return o.$element=v(o),o.$element}(e,t,n):function(e,t,n){return{type:i.Tag,tag:e,props:t,children:b(n).map(I)}}(e,t,n)}function v(e,t=[]){const{props:n}=e;return{componentInstance:e,type:i.Component,props:n,children:t}}function b(e){let t=e.length-1;for(;t>=0&&w(e[t]);t--);return t+17&&console.warn(`[Teact] Slow component render: ${n}, ${Math.round(t)} ms`),C[n].renderTimes.push(t),C[n].renderCount++}}catch(t){(0,u.S)(t),o=e.renderedValue}if(e.isMounted&&o===e.renderedValue)return e.$element;e.renderedValue=o;const d=I(o);return e.$element=v(e,[d]),e.$element}function E(e,t){return typeof e!=typeof t||e.type!==t.type||(h(e)&&h(t)?e.value!==t.value:m(e)&&m(t)?e.tag!==t.tag||e.props.key!==t.props.key:!(!p(e)||!p(t)||e.componentInstance.Component===t.componentInstance.Component&&e.props.key===t.props.key))}function M(e){var t;g(e)&&(p(e)?(t=e.componentInstance).isMounted&&(t.hooks.memos.byCursor.forEach((e=>{e.current=null})),t.hooks.effects.byCursor.forEach((({cleanup:e})=>{if("function"==typeof e)try{e()}catch(e){(0,u.S)(e)}})),t.isMounted=!1,function(e){e.hooks.effects.byCursor.forEach((e=>{e.cleanup=null,e.effect=null,e.dependencies=null})),e.hooks.state.byCursor.forEach((e=>{e.value=null,e.nextValue=null,e.setter=null})),e.hooks.memos.byCursor.forEach((e=>{e.dependencies=null})),e.hooks=null,e.$element=null,e.renderedValue=null,e.Component=null,e.props=null,e.forceUpdate=null,e.onUpdate=null}(t)):e.target&&((0,s.lQ)(e.target),e.target=null),e.children.forEach(M))}function P(e){return S(e),e.isMounted=!0,e.$element}function A(e){e.isMounted&&(e.hooks.state.byCursor.forEach((e=>{e.value=e.nextValue})),e.prepareForFrame=(0,o.wT)((()=>A(e))),e.forceUpdate=(0,o.mS)((()=>T(e))))}function T(e){if(!e.isMounted||!e.onUpdate)return;const t=e.$element;S(e),e.$element!==t&&e.onUpdate()}function k(e){return p(e)?k(e.children[0]):e.target}function N(e,t){p(e)?N(e.children[0],t):e.target=t}function R(e){const{cursor:t,byCursor:n}=l.hooks.state;var d;return void 0===n[t]&&(n[t]={value:e,nextValue:e,setter:(d=l,e=>{n[t].nextValue!==e&&(n[t].nextValue="function"==typeof e?e(n[t].value):e,d.prepareForFrame&&d.forceUpdate||(d.prepareForFrame=(0,o.wT)((()=>A(d))),d.forceUpdate=(0,o.mS)((()=>T(d)))),d.prepareForFrame(),d.forceUpdate(),r.ZT&&"TeactNContainer"!==d.name&&console.log("[Teact.useState]",d.name,d.Component&&d.Component.DEBUG_contentComponentName?`> ${d.Component.DEBUG_contentComponentName}`:"",`Forced update at cursor #${t}, next value: `,n[t].nextValue))})}),l.hooks.state.cursor++,[n[t].value,n[t].setter]}function L(e,t,n,r){const{cursor:o,byCursor:d}=l.hooks.effects,a=l,s=()=>{if(!a.isMounted)return;const{cleanup:e}=d[o];if("function"==typeof e)try{e()}catch(e){(0,u.S)(e)}d[o].cleanup=t()};if(void 0!==d[o]&&n&&d[o].dependencies){if(n.some(((e,t)=>e!==d[o].dependencies[t]))){if(r){const e=n.reduce(((e,t,n)=>{const r=d[o].dependencies[n];return t!==r&&e.push(`${n}: ${r} => ${t}`),e}),[]);console.log("[Teact]",r,"Effect caused by dependencies.",e.join(", "))}e(s)}}else e(s);d[o]={effect:t,dependencies:n,cleanup:d[o]?d[o].cleanup:void 0},l.hooks.effects.cursor++}function D(e,t,n){return L(o.T2,e,t,n)}function O(e,t,n){return L(o.R3,e,t,n)}function Z(e,t,n){const{cursor:o,byCursor:d}=l.hooks.memos;let{current:u}=d[o]||{};return(void 0===d[o]||t.some(((e,t)=>e!==d[o].dependencies[t])))&&(r.eM&&n&&console.log(`[Teact.useMemo] ${l.name} (${n}): Update is caused by:`,d[o]?(0,a.c)(t,d[o].dependencies).join(", "):"[first render]"),u=e()),d[o]={current:u,dependencies:t},l.hooks.memos.cursor++,u}function x(e,t){return Z((()=>e),t)}function _(e){return Z((()=>({current:e})),[])}function B(e,t=a.Z,n){return function(o){const d=_(o),u=_();return(!u.current||d.current&&!t(d.current,o))&&(r.eM&&n&&console.log(`[Teact.memo] ${e.name} (${n}): Update is caused by:`,(0,a.c)(d.current,o).join(", ")),d.current=o,u.current=y(e,o)),u.current}}document.addEventListener("dblclick",(()=>{console.log("COMPONENTS",(0,d.Xo)(Object.values(C),"renderCount","desc"))}));const F={createElement:y,Fragment:c}},5116:(e,t,n)=>{n.d(t,{ZP:()=>f,R3:()=>w,Rd:()=>I,uC:()=>C,Q6:()=>S,ll:()=>E,Iq:()=>M,c$:()=>P});var r=n(4050),o=n(3716),d=n(5326),a=n(6926),u=n(9118),s=n(275),i=n(782),c=n(3592);function l(){return(l=Object.assign||function(e){for(var t=1;t7&&console.warn(`[TeactN] Slow containers update: ${Math.round(t)} ms`)}}],g={},y=new Map;function v(){p.forEach((e=>e(h)))}const b=(0,u.mS)(v);function w(e,t=!1){"object"==typeof e&&e!==h&&(h=e,t?v():b())}function I(){return h}function C(){return g}function S(e,t){m[e]||(m[e]=[],g[e]=(t,n=!1)=>{!function(e,t,n){m[e]&&m[e].forEach((e=>{const r=e(h,g,t);r&&w(r,n)}))}(e,t,n)}),m[e].push(t)}function E(e){p.push(e)}function M(e){const t=p.indexOf(e);-1!==t&&p.splice(t,1)}function P(e=(()=>({})),t=(()=>({}))){return n=>function o(u){o.DEBUG_contentComponentName=n.name;const[i]=(0,r.eJ)((0,a.Z)(y)),f=(0,d.Z)();(0,r.d4)((()=>()=>{y.delete(i)}),[i]);let m=y.get(i);if(m||(m={mapStateToProps:e,mapReducersToProps:t,ownProps:u,areMappedPropsChanged:!1,forceUpdate:f,DEBUG_updates:0,DEBUG_componentName:n.name},y.set(i,m)),m.areMappedPropsChanged&&(m.areMappedPropsChanged=!1),!m.mappedProps||!(0,s.Z)(m.ownProps,u)){m.ownProps=u;try{m.mappedProps={...e(h,u),...t(w,g)}}catch(e){(0,c.S)(e)}}return r.ZP.createElement(n,l({},m.mappedProps,u))}}o.eM&&(window.getGlobal=I,document.addEventListener("dblclick",(()=>{console.log("GLOBAL CONTAINERS",(0,i.Xo)(Array.from(y.values()).map((({DEBUG_componentName:e,DEBUG_updates:t})=>({DEBUG_componentName:e,DEBUG_updates:t}))),"DEBUG_updates","desc"))})))},3681:(e,t,n)=>{n.d(t,{l:()=>d,Z:()=>a});const r=/\uFE0F/g,o=String.fromCharCode(8205);function d(e){return e.indexOf(o)<0?e.replace(r,""):e}const a=/(?:\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d\udc8f\ud83c[\udffb-\udfff]|\ud83d\udc91\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d\udc8f\udc91])|(?:\ud83d[\udc68\udc69]|\ud83e\uddd1)(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf7c\udf84\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc70\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd4\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83d\ude36\u200d\ud83c\udf2b\ufe0f|\u2764\ufe0f\u200d\ud83d\udd25|\u2764\ufe0f\u200d\ud83e\ude79|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc15\u200d\ud83e\uddba|\ud83d\udc3b\u200d\u2744\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83d\ude2e\u200d\ud83d\udca8|\ud83d\ude35\u200d\ud83d\udcab|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f|\ud83d\udc08\u200d\u2b1b)|[#*0-9]\ufe0f?\u20e3|(?:[©®\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26a7\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd0c\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udc8e\udc90\udc92-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5-\uded7\udeeb\udeec\udef4-\udefc\udfe0-\udfeb]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd1d\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78\udd7a-\uddb4\uddb7\uddba\uddbc-\uddcb\uddd0\uddde-\uddff\ude70-\ude74\ude78-\ude7a\ude80-\ude86\ude90-\udea8\udeb0-\udeb6\udec0-\udec2\uded0-\uded6]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g},1363:(e,t,n)=>{var r=n(5116),o=n(1226),d=n(3716),a=n(7361),u=n(8406),s=n(9524),i=n(7358),c=n(4688),l=n(1622);(0,r.Q6)("initApi",((e,t)=>{(async()=>{d.Cg||(await(0,c.Qw)(),(0,c.f3)()),(0,o.g8)(t.apiUpdate,{userAgent:navigator.userAgent,platform:a.Lt,sessionData:(0,c.K8)()})})()})),(0,r.Q6)("setAuthPhoneNumber",((e,t,n)=>{const{phoneNumber:r}=n;return(0,o.t9)("provideAuthPhoneNumber",r.replace(/[^\d]/g,"")),{...e,authIsLoading:!0,authError:void 0}})),(0,r.Q6)("setAuthCode",((e,t,n)=>{const{code:r}=n;return(0,o.t9)("provideAuthCode",r),{...e,authIsLoading:!0,authError:void 0}})),(0,r.Q6)("setAuthPassword",((e,t,n)=>{const{password:r}=n;return(0,o.t9)("provideAuthPassword",r),{...e,authIsLoading:!0,authError:void 0}})),(0,r.Q6)("uploadProfilePhoto",((e,t,n)=>{const{file:r}=n;(0,o.t9)("uploadProfilePhoto",r)})),(0,r.Q6)("signUp",((e,t,n)=>{const{firstName:r,lastName:d}=n;return(0,o.t9)("provideAuthRegistration",{firstName:r,lastName:d}),{...e,authIsLoading:!0,authError:void 0}})),(0,r.Q6)("returnToAuthPhoneNumber",(e=>((0,o.t9)("restartAuth"),{...e,authError:void 0}))),(0,r.Q6)("goToAuthQrCode",(e=>((0,o.t9)("restartAuthWithQr"),{...e,authIsLoadingQrCode:!0,authError:void 0}))),(0,r.Q6)("saveSession",((e,t,n)=>{const{sessionData:r}=n;r?(0,c.wX)(n.sessionData,e.currentUserId):(0,c.jv)()})),(0,r.Q6)("signOut",(()=>{(async()=>{try{await(0,u.r1)(),await(0,o.t9)("destroy"),await(0,l.I)(!1)}catch(e){}(0,r.uC)().reset()})()})),(0,r.Q6)("reset",(()=>{(0,c.jv)(),s.clear(d.lW),s.clear(d.SG),s.clear(d.lF),s.clear(d.fo);const e=d.ee.replace(/\d+$/,""),t=(d.ee.match(/\d+$/)||[0])[0];for(let n=0;n{(async()=>{await(0,o.t9)("disconnect")})()})),(0,r.Q6)("loadNearestCountry",(e=>{"connectionStateReady"===e.connectionState&&(async()=>{const e=await(0,o.t9)("fetchNearestCountry");(0,r.R3)({...(0,r.Rd)(),authNearestCountry:e})})()})),(0,r.Q6)("setDeviceToken",((e,t,n)=>{(0,r.R3)({...e,push:{deviceToken:n,subscribedAt:Date.now()}})})),(0,r.Q6)("deleteDeviceToken",(e=>{const t={...e};delete t.push,(0,r.R3)(t)}))},9667:(e,t,n)=>{var r=n(5116),o=n(1713),d=n(1226),a=n(782),u=n(8406),s=n(8085),i=n(1752),c=n(2858);function l(e,{visibility:t,allowedIds:n,deniedIds:r}){const{users:{byId:o},chats:{byId:d}}=e,a={visibility:t};let u,s;const i=e=>{if(!(0,c.YA)(e))return;const{id:t,accessHash:n}=o[e]||{};return t?{id:t,accessHash:n}:void 0},l=e=>{if((0,c.YA)(e))return;const t=d[e];return t?{id:t.id}:void 0};return"contacts"!==t&&"nobody"!==t||(u=n.map(i).filter(Boolean),s=n.map(l).filter(Boolean),u.length>0&&(a.allowedUsers=u),s.length>0&&(a.allowedChats=s)),"everybody"!==t&&"contacts"!==t||(u=r.map(i).filter(Boolean),s=r.map(l).filter(Boolean),u.length>0&&(a.blockedUsers=u),s.length>0&&(a.blockedChats=s)),a}(0,r.Q6)("updateProfile",((e,t,n)=>{const{photo:a,firstName:u,lastName:c,bio:l,username:f}=n;(async()=>{const{currentUserId:t}=e;if(t){if((0,r.R3)({...(0,r.Rd)(),profileEdit:{progress:o.rN.InProgress}}),a&&await(0,d.t9)("updateProfilePhoto",a),(u||c||l)&&await(0,d.t9)("updateProfile",{firstName:u,lastName:c,about:l})){e=(0,r.Rd)();const n=t&&(0,s.dy)(e,t);n&&(0,r.R3)((0,i.Nq)(e,n.id,{firstName:u,lastName:c,fullInfo:{...n.fullInfo,bio:l}}))}f&&await(0,d.t9)("updateUsername",f)&&t&&(0,r.R3)((0,i.Nq)((0,r.Rd)(),t,{username:f})),(0,r.R3)({...(0,r.Rd)(),profileEdit:{progress:o.rN.Complete}})}})()})),(0,r.Q6)("checkUsername",((e,t,n)=>{const{username:a}=n;(async()=>{if(e.profileEdit&&e.profileEdit.progress===o.rN.InProgress)return;(0,r.R3)({...e,profileEdit:{progress:e.profileEdit?e.profileEdit.progress:o.rN.Idle,isUsernameAvailable:void 0}});const t=await(0,d.t9)("checkUsername",a);e=(0,r.Rd)(),(0,r.R3)({...e,profileEdit:{...e.profileEdit,isUsernameAvailable:t}})})()})),(0,r.Q6)("loadWallpapers",(()=>{(async()=>{const e=await(0,d.t9)("fetchWallpapers",0);if(!e)return;const t=(0,r.Rd)();(0,r.R3)({...t,settings:{...t.settings,loadedWallpapers:e.wallpapers}})})()})),(0,r.Q6)("uploadWallpaper",((e,t,n)=>{const a=n,u=URL.createObjectURL(a);(0,r.R3)({...e,settings:{...e.settings,loadedWallpapers:[{slug:o.mp,document:{fileName:"",size:a.size,mimeType:a.type,previewBlobUrl:u}},...e.settings.loadedWallpapers||[]]}}),(async()=>{const t=await(0,d.t9)("uploadWallpaper",a);if(!t)return;const{wallpaper:n}=t;if(!(e=(0,r.Rd)()).settings.loadedWallpapers)return;const s=e.settings.loadedWallpapers[0];if(!s||s.slug!==o.mp)return;const i={...n,document:{...n.document,previewBlobUrl:u}};(0,r.R3)({...e,settings:{...e.settings,loadedWallpapers:[i,...e.settings.loadedWallpapers.slice(1)]}})})()})),(0,r.Q6)("loadBlockedContacts",(()=>{(async()=>{var e,t;const n=await(0,d.t9)("fetchBlockedContacts");if(!n)return;let o=(0,r.Rd)();null!==(e=n.users)&&void 0!==e&&e.length&&(o=(0,i.Sh)(o,(0,a.ee)(n.users,"id"))),null!==(t=n.chats)&&void 0!==t&&t.length&&(o=(0,i.GL)(o,(0,a.ee)(n.chats,"id"))),o={...o,blocked:{...o.blocked,ids:[...o.blocked.ids||[],...n.blockedIds],totalCount:n.totalCount}},(0,r.R3)(o)})()})),(0,r.Q6)("blockContact",((e,t,n)=>{const{contactId:o,accessHash:a}=n;(async()=>{if(!await(0,d.t9)("blockContact",o,a))return;const e=(0,r.Rd)();(0,r.R3)((0,i.O4)(e,o))})()})),(0,r.Q6)("unblockContact",((e,t,n)=>{const{contactId:o}=n;let a;if((0,c.YA)(o)){const t=(0,s.dy)(e,o);if(!t)return;a=t.accessHash}(async()=>{if(!await(0,d.t9)("unblockContact",o,a))return;const e=(0,r.Rd)();(0,r.R3)((0,i.rB)(e,o))})()})),(0,r.Q6)("loadAuthorizations",(()=>{(async()=>{const e=await(0,d.t9)("fetchAuthorizations");e&&(0,r.R3)({...(0,r.Rd)(),activeSessions:e})})()})),(0,r.Q6)("terminateAuthorization",((e,t,n)=>{const{hash:o}=n;(async()=>{if(!await(0,d.t9)("terminateAuthorization",o))return;const e=(0,r.Rd)();(0,r.R3)({...e,activeSessions:e.activeSessions.filter((e=>e.hash!==o))})})()})),(0,r.Q6)("terminateAllAuthorizations",(()=>{(async()=>{if(!await(0,d.t9)("terminateAllAuthorizations"))return;const e=(0,r.Rd)();(0,r.R3)({...e,activeSessions:e.activeSessions.filter((e=>e.isCurrent))})})()})),(0,r.Q6)("loadNotificationExceptions",(e=>{const{serverTimeOffset:t}=e;(async()=>{const e=await(0,d.t9)("fetchNotificationExceptions",{serverTimeOffset:t});e&&(0,r.R3)((0,i.aJ)((0,r.Rd)(),e))})()})),(0,r.Q6)("loadNotificationSettings",(e=>{const{serverTimeOffset:t}=e;(async()=>{const e=await(0,d.t9)("fetchNotificationSettings",{serverTimeOffset:t});e&&(0,r.R3)((0,i.BI)((0,r.Rd)(),e))})()})),(0,r.Q6)("updateNotificationSettings",((e,t,n)=>{const{peerType:o,isSilent:a,shouldShowPreviews:u}=n;(async()=>{await(0,d.t9)("updateNotificationSettings",o,{isSilent:a,shouldShowPreviews:u})&&(0,r.R3)((0,i.HN)((0,r.Rd)(),o,a,u))})()})),(0,r.Q6)("updateWebNotificationSettings",((e,t,n)=>{(async()=>{(0,r.R3)((0,i.BI)((0,r.Rd)(),n));const e=(0,r.Rd)(),{hasPushNotifications:t,hasWebNotifications:o}=e.settings.byKey;o&&t?await(0,u.Ld)():await(0,u.r1)()})()})),(0,r.Q6)("updateContactSignUpNotification",((e,t,n)=>{const{isSilent:o}=n;(async()=>{await(0,d.t9)("updateContactSignUpNotification",o)&&(0,r.R3)((0,i.BI)((0,r.Rd)(),{hasContactJoinedNotifications:!o}))})()})),(0,r.Q6)("loadLanguages",(()=>{(async()=>{const e=await(0,d.t9)("fetchLanguages");e&&(0,r.R3)((0,i.BI)((0,r.Rd)(),{languages:e}))})()})),(0,r.Q6)("loadPrivacySettings",(()=>{(async()=>{const[e,t,n,o,a]=await Promise.all([(0,d.t9)("fetchPrivacySettings","phoneNumber"),(0,d.t9)("fetchPrivacySettings","lastSeen"),(0,d.t9)("fetchPrivacySettings","profilePhoto"),(0,d.t9)("fetchPrivacySettings","forwards"),(0,d.t9)("fetchPrivacySettings","chatInvite")]);if(!(e&&t&&n&&o&&a))return;const u=(0,r.Rd)();u.settings.privacy.phoneNumber=e,u.settings.privacy.lastSeen=t,u.settings.privacy.profilePhoto=n,u.settings.privacy.forwards=o,u.settings.privacy.chatInvite=a,(0,r.R3)(u)})()})),(0,r.Q6)("setPrivacyVisibility",((e,t,n)=>{const{privacyKey:o,visibility:a}=n,{privacy:{[o]:u}}=e.settings;if(!u)return;const s=l(e,{visibility:a,allowedIds:[...u.allowUserIds,...u.allowChatIds],deniedIds:[...u.blockUserIds,...u.blockChatIds]});(async()=>{const e=await(0,d.t9)("setPrivacySettings",o,s);if(e){const t=(0,r.Rd)();t.settings.privacy[o]=e,(0,r.R3)(t)}})()})),(0,r.Q6)("setPrivacySettings",((e,t,n)=>{const{privacyKey:o,isAllowList:a,contactsIds:u}=n,{privacy:{[o]:s}}=e.settings;if(!s)return;const i=l(e,{visibility:s.visibility,allowedIds:a?u:[...s.allowUserIds,...s.allowChatIds],deniedIds:a?[...s.blockUserIds,...s.blockChatIds]:u});(async()=>{const e=await(0,d.t9)("setPrivacySettings",o,i);if(e){const t=(0,r.Rd)();t.settings.privacy[o]=e,(0,r.R3)(t)}})()})),(0,r.Q6)("updateIsOnline",((e,t,n)=>{(0,d.t9)("updateIsOnline",n)})),(0,r.Q6)("loadContentSettings",(()=>{(async()=>{const e=await(0,d.t9)("fetchContentSettings");e&&(0,r.R3)((0,i.BI)((0,r.Rd)(),e))})()})),(0,r.Q6)("updateContentSettings",((e,t,n)=>{(async()=>{(0,r.R3)((0,i.BI)((0,r.Rd)(),{isSensitiveEnabled:n})),await(0,d.t9)("updateContentSettings",n)||(0,r.R3)((0,i.BI)((0,r.Rd)(),{isSensitiveEnabled:!n}))})()}))},4907:(e,t,n)=>{var r=n(5116),o=n(3716),d=n(8406),a=n(1752),u=n(663),s=n(8085),i=n(1622),c=n(1947);(0,r.Q6)("apiUpdate",((e,t,n)=>{switch(o.eM&&"updateUserStatus"!==n["@type"]&&"updateServerTimeOffset"!==n["@type"]&&console.log("[GramJs] UPDATE",n["@type"],{update:n}),n["@type"]){case"updateApiReady":!function(e){const{hasWebNotifications:t,hasPushNotifications:n}=(0,s.dZ)(e);t&&n&&(0,d.Ld)(),(0,u.m0)(e.settings.byKey.language)}(e);break;case"updateAuthorizationState":!function(e){let t=(0,r.Rd)();const n="authorizationStateReady"===t.authState,o=e.authorizationState;switch((0,r.R3)({...t,authState:o,authIsLoading:!1}),t=(0,r.Rd)(),o){case"authorizationStateLoggingOut":(0,i.I)(!1),(0,r.R3)({...t,isLoggingOut:!0});break;case"authorizationStateWaitCode":(0,r.R3)({...t,authIsCodeViaApp:e.isCodeViaApp});break;case"authorizationStateWaitPassword":(0,r.R3)({...t,authHint:e.hint});break;case"authorizationStateWaitQrCode":(0,r.R3)({...t,authIsLoadingQrCode:!1,authQrCode:e.qrCode});break;case"authorizationStateReady":if(n)break;(0,i.I)(!0),(0,r.R3)({...t,isLoggingOut:!1,lastSyncTime:Date.now()})}}(n);break;case"updateAuthorizationError":!function(e){(0,r.R3)({...(0,r.Rd)(),authError:e.message})}(n);break;case"updateConnectionState":!function(e){const{connectionState:t}=e,n=(0,r.Rd)();(0,r.R3)({...n,connectionState:t}),"connectionStateReady"===t&&"authorizationStateReady"===n.authState?(0,r.uC)().sync():"connectionStateBroken"===t&&(0,r.uC)().signOut()}(n);break;case"updateSession":!function(e){const{sessionData:t}=e,{authRememberMe:n,authState:o}=(0,r.Rd)(),d=!t||!t.mainDcId;n&&"authorizationStateReady"===o&&!d&&(0,r.uC)().saveSession({sessionData:t})}(n);break;case"updateServerTimeOffset":!function(e){const t=(0,r.Rd)();t.serverTimeOffset!==e.serverTimeOffset&&(0,r.R3)({...t,serverTimeOffset:e.serverTimeOffset})}(n);break;case"updateCurrentUser":!function(e){const{currentUser:t}=e;(0,r.R3)({...(0,a.Nq)((0,r.Rd)(),t.id,t),currentUserId:t.id}),function(e){const t=localStorage.getItem(o.b_);if(!t)return;const n=JSON.parse(t);n.id=e,localStorage.setItem(o.b_,JSON.stringify(n))}(t.id)}(n);break;case"error":{"SESSION_REVOKED"===n.error.message&&t.signOut();const e=(0,c.J_)(n.error);e?t.addPaymentError({error:e}):t.showDialog&&t.showDialog({data:{...n.error,hasErrorKey:!0}});break}}}))},7895:(e,t,n)=>{var r=n(5116),o=n(3716),d=n(7361),a=n(663),u=n(6917),s=n(8085),i=n(1622);!function(){function e(){const e=document.documentElement.className.match(/theme-(\w+)/),t=e?e[1]:"light",n=(0,r.Rd)(),d=(0,s.Pu)(n),{animationLevel:a}=n.settings.byKey;d!==t&&((0,u.Z)(d,a===o.zy),(0,r.R3)({...n}))}const t=window.matchMedia("(prefers-color-scheme: dark)");"function"==typeof t.addEventListener?t.addEventListener("change",e):"function"==typeof t.addListener&&t.addListener(e)}(),(0,r.Q6)("init",(e=>{const{animationLevel:t,messageTextSize:n,language:r}=e.settings.byKey,c=(0,s.Pu)(e);(0,a.m0)(r,void 0,!0),document.documentElement.style.setProperty("--composer-text-size",`${Math.max(n,d.cj?16:15)}px`),document.documentElement.style.setProperty("--message-meta-height",`${Math.floor(1.3125*n)}px`),document.documentElement.style.setProperty("--message-text-size",`${n}px`),document.documentElement.setAttribute("data-message-text-size",n.toString()),document.body.classList.add("initial"),document.body.classList.add(`animation-level-${t}`),document.body.classList.add(d.$b?"is-touch-env":"is-pointer-env"),(0,u.Z)(c,t===o.zy),(0,i.p)(),d.cj?document.body.classList.add("is-ios"):d.wZ?document.body.classList.add("is-android"):d.jm&&document.body.classList.add("is-macos")})),(0,r.Q6)("setIsUiReady",((e,t,n)=>{const{uiReadyState:r}=n;return 2===r&&document.body.classList.remove("initial"),{...e,uiReadyState:r}})),(0,r.Q6)("setAuthPhoneNumber",((e,t,n)=>{const{phoneNumber:r}=n;return{...e,authPhoneNumber:r}})),(0,r.Q6)("setAuthRememberMe",((e,t,n)=>({...e,authRememberMe:Boolean(n)}))),(0,r.Q6)("clearAuthError",(e=>({...e,authError:void 0}))),(0,r.Q6)("disableHistoryAnimations",(()=>{setTimeout((()=>{(0,r.R3)({...(0,r.Rd)(),shouldSkipHistoryAnimations:!1}),document.body.classList.remove("no-animate")}),450),(0,r.R3)({...(0,r.Rd)(),shouldSkipHistoryAnimations:!0},!0)}))},3781:(e,t,n)=>{var r=n(5116),o=n(1752);(0,r.Q6)("setSettingOption",((e,t,n)=>(0,o.BI)(e,n))),(0,r.Q6)("setThemeSettings",((e,t,n)=>{const{theme:r,...d}=n;return(0,o.lr)(e,r,d)}))},8332:(e,t,n)=>{n.d(t,{YA:()=>i,Bf:()=>c,G9:()=>l,ZV:()=>f,eA:()=>h,Ru:()=>m,l6:()=>p,zX:()=>g,U:()=>y,GM:()=>v,hu:()=>b,RT:()=>w,Hp:()=>I,Nl:()=>C,VE:()=>S,Mg:()=>E,Qm:()=>M,H5:()=>P,q8:()=>A,Hd:()=>T,OE:()=>k,pE:()=>N,i4:()=>R,Sm:()=>L,cc:()=>D,P4:()=>O,O:()=>Z,Fu:()=>x,SB:()=>_,iX:()=>B,zF:()=>F,ih:()=>U});var r=n(6137),o=n(3716),d=n(782),a=n(5527),u=n(790);const s=Date.now()/1e3+31622400;function i(e){return e>0}function c(e){return l(e)||f(e)}function l(e){return"chatTypeBasicGroup"===e.type}function f(e){return"chatTypeSuperGroup"===e.type}function h(e){return"chatTypeChannel"===e.type}function m(e){return"chatTypePrivate"===e.type||"chatTypeBasicGroup"===e.type}function p(e){switch(e.type){case"chatTypePrivate":return"PrivateChat";case"chatTypeBasicGroup":case"chatTypeSuperGroup":return"AccDescrGroup";case"chatTypeChannel":return"AccDescrChannel";default:return"Chat"}}function g(e){if("chatTypePrivate"===e.type||"chatTypeSecret"===e.type)return e.id}function y(e,t,n,r=!1){return r||n&&t.id===n.id&&n.isSelf?e("SavedMessages"):t.title||e("HiddenName")}function v(e){if(e.fullInfo)return e.fullInfo.about}function b(e){const{username:t}=e;if(t)return`https://t.me/${t}`;const{inviteLink:n}=e.fullInfo||{};return n}function w(e,t="normal"){if(e.avatarHash)switch(t){case"big":return`profile${e.id}?${e.avatarHash}`;default:return`avatar${e.id}?${e.avatarHash}`}}function I(e){return!e.lastMessage}function C(e){return Boolean(e.adminRights)}function S(e,t){return!!e.adminRights&&e.adminRights[t]}function E(e,t){var n,r;return Boolean((null===(n=e.currentUserBannedRights)||void 0===n?void 0:n[t])||(null===(r=e.defaultBannedRights)||void 0===r?void 0:r[t]))}function M(e,t){return t!==r._f||!(e.isRestricted||e.migratedTo||e.isNotJoined)&&(!!e.isCreator||!!i(e.id)||(h(e)?S(e,"postMessages"):C(e)||!E(e,"sendMessages")))}function P(e,t=!1){if(!e)return{canAttachMedia:!1,canAttachPolls:!1,canSendStickers:!1,canSendGifs:!1,canAttachEmbedLinks:!1};const n=C(e);return{canAttachMedia:n||!E(e,"sendMedia"),canAttachPolls:(n||!E(e,"sendPolls"))&&(!i(e.id)||t),canSendStickers:n||!E(e,"sendStickers"),canSendGifs:n||!E(e,"sendGifs"),canAttachEmbedLinks:n||!E(e,"embedLinks")}}function A(e,t,n){if(null!=t&&t.sendMessages){const{untilDate:n}=t;return n&&nfunction(e,t,n,r,o,d,a,u){if(!e.isListed)return!1;if(d&&d.has(e.id))return!1;if(a&&a.has(e.id))return!0;if(u&&u.has(e.id))return!0;if(N(e)&&t.excludeArchived)return!1;if(t.excludeMuted&&!e.unreadMentionsCount&&R(e,r,o))return!1;if(!e.unreadCount&&!e.unreadMentionsCount&&!e.hasUnreadMark&&t.excludeRead)return!1;if(i(e.id)){const r=n[e.id];if(r&&"userTypeBot"===r.type){if(t.bots)return!0}else{if(t.contacts&&r&&r.isContact)return!0;if(t.nonContacts&&r&&!r.isContact)return!0}}else{if(c(e))return!!t.groups;if(h(e))return!!t.channels}return!1}(e[d],n,t,r,o,a,u,s))),n.pinnedChatIds]}function Z(e,t,n,r="all"){function o(e){if(!e||!e.lastMessage||e.migratedTo)return!1;switch(r){case"all":if(N(e))return!1;break;case"archived":if(!N(e))return!1}return!e.isRestricted&&!e.isNotJoined}const a=t.map((t=>e[t])).filter(o),u=new Set(t);return{pinnedChats:n?n.map((t=>e[t])).filter(o).filter((e=>u.has(e.id))):[],otherChats:(0,d.Xo)(n?a.filter((e=>!n.includes(e.id))):a,k,"desc")}}function x(e,t,n,r,o,d){const[a]=O(e,t,n,o,d,r),u=a.map((t=>e[t])).filter((e=>(null==e?void 0:e.lastMessage)&&!e.isRestricted&&!e.isNotJoined));return{unreadDialogsCount:u.reduce(((e,t)=>t.unreadCount||t.hasUnreadMark?e+1:e),0),hasActiveDialogs:u.some((e=>e.unreadMentionsCount||!R(e,o,d)&&(e.unreadCount||e.hasUnreadMark)))}}function _(e,t,n,r,o,d,a){const{id:u,title:s,emoticon:i,description:c,pinnedChatIds:l,excludedChatIds:f,includedChatIds:h,excludeArchived:m,excludeMuted:p,excludeRead:g,...y}=r;return Object.values(y).filter(Boolean).length>1||null!=f&&f.length||null!=h&&h.length?e("Chats",function(e,t,n,r,o,d){const[a,u]=O(e,t,n,o,d,r),{pinnedChats:s,otherChats:i}=Z(e,a,u,"folder");return s.length+i.length}(t,n,r,o,d,a)):y.bots?e("FilterBots"):y.groups?e("FilterGroups"):y.channels?e("FilterChannels"):y.contacts?e("FilterContacts"):y.nonContacts?e("FilterNonContacts"):void 0}function B(e){return!!e&&e.id<0}function F(e,t,n){if(n&&!i(t))return n.isSelf?e("FromYou"):(0,a.Vl)(n)}function U(e,t,n=!1,r){return(0,d.Xo)(e,(e=>{const o=t[e];if(!o)return 0;let d=0;return o.lastMessage&&(d+=o.lastMessage.date),n&&o.isVerified&&(d+=3e9),r&&r.includes(e)&&(d=Date.now()+3e8+(r.length-r.indexOf(e))),d}),"desc")}},2858:(e,t,n)=>{n.d(t,{uw:()=>ue,H5:()=>o.H5,cc:()=>o.cc,Qm:()=>o.Qm,RT:()=>o.RT,GM:()=>o.GM,hu:()=>o.hu,N0:()=>ee,OE:()=>o.OE,Hd:()=>o.Hd,U:()=>o.U,l6:()=>o.l6,T7:()=>y,SB:()=>o.SB,Fu:()=>o.Fu,VE:()=>o.VE,XV:()=>ae,Sc:()=>oe,N5:()=>x,oP:()=>_,I3:()=>T,qp:()=>R,R5:()=>de,$D:()=>p,aE:()=>F,ep:()=>q,c0:()=>Y,eO:()=>j,Tp:()=>c,kG:()=>J,Ti:()=>z,DH:()=>K,KK:()=>f,O$:()=>D,t9:()=>G,Y5:()=>Z,zF:()=>o.zF,q8:()=>o.q8,_O:()=>g,bf:()=>B,MK:()=>h,UD:()=>m,b7:()=>O,s1:()=>W,F$:()=>H,Cg:()=>V,bV:()=>te,HV:()=>ne,zX:()=>o.zX,OU:()=>E,RI:()=>M,Ow:()=>ie,Rs:()=>r.Rs,Vl:()=>r.Vl,Js:()=>r.Js,Tq:()=>r.Tq,jC:()=>re,BM:()=>X,u8:()=>L,Lo:()=>I,Ul:()=>S,iX:()=>o.iX,Nl:()=>o.Nl,pE:()=>o.pE,G9:()=>o.G9,eA:()=>o.eA,Bf:()=>o.Bf,YA:()=>o.YA,Hp:()=>o.Hp,ZV:()=>o.ZV,Ru:()=>o.Ru,NB:()=>r.NB,MF:()=>w,CD:()=>A,rl:()=>U,hC:()=>$,CI:()=>P,B4:()=>v,ss:()=>b,jM:()=>C,cS:()=>r.cS,kM:()=>r.kM,Mg:()=>o.Mg,Ak:()=>l,O:()=>o.O,P4:()=>o.P4,i4:()=>o.i4,Sm:()=>o.Sm,ih:()=>o.ih,Z0:()=>r.Z0});var r=n(5527),o=n(8332),d=n(6137),a=n(3716),u=n(4784);const s="The message is not supported on this version of Telegram",i=new RegExp(a.FM,"i");function c(e){const{chatId:t,id:n}=e;return`msg${t}-${n}`}function l(e){const t=e.match(/^msg(-?\d+)-(\d+)/);return{chatId:Number(t[1]),messageId:Number(t[2])}}function f(e){return e.previousLocalId||e.id}function h(e,t,n=!1){const{text:r,photo:o,video:d,audio:a,voice:u,document:i,sticker:c,contact:l,poll:f,invoice:h}=t.content,m=r&&r.text.substr(0,80);return t.groupedId?`${n?"":"🖼 "}${m||e("lng_in_dlg_album")}`:o?`${n?"":"🖼 "}${m||e("AttachPhoto")}`:d?`${n?"":"📹 "}${m||e(d.isGif?"AttachGif":"AttachVideo")}`:c?`${c.emoji||""} ${e("AttachSticker")}`.trim():a?`${n?"":"🎧 "}${T(t)||e("AttachMusic")}`:u?`${n?"":"🎤 "}${m||e("AttachAudio")}`:i?`${n?"":"📎 "}${m||i.fileName}`:l?e("AttachContact"):f?`${n?"":"📊 "}${f.summary.question}`:h?"Invoice":r?m:s}function m(e){const{text:t,sticker:n,photo:r,video:o,audio:d,voice:a,document:u,poll:i,webPage:c,contact:l,invoice:f}=e.content;return t?t.text:n||r||o||d||a||u||l||i||c||f?void 0:s}function p(e){const{text:t,sticker:n,photo:r,video:o,audio:d,voice:a,document:s,poll:i,webPage:c,contact:l}=e.content;return!!(n||null!=o&&o.isRound)||!(!t||r||o||d||a||s||i||c||l)&&((0,u.Z)(t.text)||!1)}function g(e){const{text:t}=e.content;if(t&&t.text.length<=6&&1===p(e))return t.text}function y(e){const{text:t}=e.content;let n;if(null!=t&&t.entities){let e=t.entities.find((e=>e.type===d.Vv.TextUrl));if(e&&(n=e.url.match(i)),!n&&(e=t.entities.find((e=>e.type===d.Vv.Url)),e)){const{offset:r,length:o}=e;n=t.text.substring(r,r+o).match(i)}}if(!n&&t&&(n=t.text.match(i)),n)return{url:n[0],domain:n[3]}}function v(e){return e.isOutgoing}function b(e){return Boolean(e.replyToMessageId)}function w(e){return Boolean(e.forwardInfo)}function I(e){return!!e.content.action}function C(e){return e.chatId===a.aw&&P(e)}function S(e){return Boolean(e.senderId)&&e.senderId<0&&v(e)}function E(e,t){return t.id>0?(0,r.Js)(t):(0,o.U)(e,t)}function M(e){return e.sendingState?"messageSendingStateFailed"===e.sendingState?"failed":"pending":"succeeded"}function P(e){return e.id>=a.AE}function A(e){return e.content.action&&"historyClear"===e.content.action.type}function T(e){const{audio:t,text:n}=e.content;return t&&[t.title,t.performer].filter(Boolean).join(" — ")||(null==n?void 0:n.text)}var k=n(7361),N=n(5376);function R(e){return e.content}function L(e){return Boolean(D(e)||O(e)||F(e)||B(e)||function(e){return e.content.contact}(e)||G(e)||x(e)||_(e)||function(e){return e.content.voice}(e))}function D(e){return e.content.photo}function O(e){return e.content.video}function Z(e){const{video:t}=e.content;return null!=t&&t.isRound?t:void 0}function x(e){return e.content.action}function _(e){return e.content.audio}function B(e){return e.content.sticker}function F(e){return e.content.document}function U(e){const t=F(e);return t?"photo"===t.mediaType:void 0}function $(e){const t=F(e);return t?"video"===t.mediaType:void 0}function G(e){return e.content.poll}function j(e){return e.content.invoice}function W(e){return e.content.webPage}function H(e){var t;return null===(t=W(e))||void 0===t?void 0:t.photo}function V(e){var t;return null===(t=W(e))||void 0===t?void 0:t.video}function K(e){var t;return null===(t=function(e){const t=D(e)||O(e)||F(e)||B(e)||H(e)||V(e);if(t)return t.thumbnail}(e))||void 0===t?void 0:t.dataUri}function z(e,t){const{photo:n,video:r,sticker:o,audio:d,voice:a,document:u}=e.content,s=H(e),i=V(e),l=r||i,f=n||s;if(!(f||l||o||d||a||u))return;const h=c(e);if(l)switch(t){case"micro":case"pictogram":return`${h}?size=m`;case"inline":return X(e)?void 0:Q(l,h);case"viewerPreview":return`${h}?size=m`;case"viewerFull":return Q(l,h);case"download":return`${h}?download`}if(f)switch(t){case"micro":case"pictogram":return`${h}?size=m`;case"inline":return X(e)?void 0:`${h}?size=x`;case"viewerPreview":return`${h}?size=x`;case"viewerFull":return`${h}?size=z`}if(u)switch(t){case"micro":case"pictogram":case"inline":case"viewerPreview":if(!(0,N.v6)(u)||X(e))return;return`${h}?size=m`;default:return h}if(o)switch(t){case"micro":return;case"pictogram":return`${h}?size=m`;default:return h}if(d)switch(t){case"micro":case"pictogram":return;case"download":return`${h}?download`;default:return Q(d,h)}if(a)switch(t){case"micro":case"pictogram":return;default:return h}}function Q(e,t){return k.I_&&k.s$?`${t}?fileSize=${e.size}&mimeType=${e.mimeType}`:t}function J(e,t){const{sticker:n,video:r,audio:o,voice:a}=e.content,u=r||V(e);return n&&"inline"===t&&n.isAnimated?d.IU.Lottie:u&&k.I_&&("viewerFull"===t||"inline"===t)?d.IU.Progressive:o||a?a&&!k.m5?d.IU.BlobUrl:d.IU.Progressive:d.IU.BlobUrl}function q(e){const{photo:t,video:n,document:r}=e.content,o=H(e),d=V(e);if(t||o)return`photo${e.date}.jpeg`;const{fileName:a}=n||d||r||{};return a}function Y(e){const{video:t,document:n}=e.content,r=V(e),{size:o}=t||r||n||{};return o}function X(e){const{photo:t,video:n,document:r}=e.content;return(null==t?void 0:t.blobUrl)||(null==n?void 0:n.blobUrl)||(null==r?void 0:r.previewBlobUrl)}function ee(e,t,n=!1){const r=de(e,t,n?"media":"inlineMedia");return n?r.reverse():r}function te(e){return e.sizes.find((e=>"z"===e.type))||e.sizes.find((e=>"y"===e.type))||ne(e)}function ne(e){return e.sizes.find((e=>"x"===e.type))||e.sizes.find((e=>"m"===e.type))||e.sizes.find((e=>"s"===e.type))||e.thumbnail}function re(e){if(e.width&&e.height)return e}function oe(e,t,n=!1){const r=P(e);return{isUploading:r,isTransferring:r||n,transferProgress:Number(t)}}function de(e,t,n){let r;switch(n){case"media":r=e=>{const t=O(e);return D(e)||t&&!t.isRound&&!t.isGif};break;case"documents":r=F;break;case"links":r=e=>W(e)||function(e){const{text:t}=e.content,n=t&&t.text.match(i);if(n)return{url:n[0],domain:n[3]}}(e);break;case"audio":r=_;break;case"inlineMedia":r=e=>{const t=O(e);return D(e)||t&&!t.isRound&&!t.isGif||U(e)||$(e)};break;default:return[]}return t.reduce(((t,n)=>(e[n]&&r(e[n])&&t.push(n),t)),[])}function ae(e){const{audio:t,voice:n,video:r}=R(e),o=t||n||r||V(e);if(o)return o.duration}function ue(e,t){return`${e}_${t}`}const se={missing_payment_information:{field:"cardNumber",message:"Incorrect card number"},invalid_number:{field:"cardNumber",message:"Incorrect card number"},number:{field:"cardNumber",message:"Incorrect card number"},exp_year:{field:"expiry",message:"Incorrect year"},exp_month:{field:"expiry",message:"Incorrect month"},invalid_expiry_year:{field:"expiry",message:"Incorrect year"},invalid_expiry_month:{field:"expiry",message:"Incorrect month"},cvc:{field:"cvv",message:"Incorrect CVV"},invalid_cvc:{field:"cvv",message:"Incorrect CVV"}};function ie(e){const{message:t,code:n,param:r}=e,{field:o,message:d}=r?se[r]:se[n];return{field:o,message:d,description:t}}},5527:(e,t,n)=>{n.d(t,{Vl:()=>s,Js:()=>i,Tq:()=>c,kM:()=>l,NB:()=>f,cS:()=>h,Z0:()=>m,Rs:()=>p});var r=n(3716),o=n(790),d=n(782),a=n(2267);const u=[1,8,5,2,7,4,6];function s(e){if(e)switch(e.type){case"userTypeBot":case"userTypeRegular":return e.firstName||e.lastName;case"userTypeDeleted":case"userTypeUnknown":return"Deleted";default:return}}function i(e){if(e){if(f(e))return"Deleted account";switch(e.type){case"userTypeBot":case"userTypeRegular":if(e.firstName&&e.lastName)return`${e.firstName} ${e.lastName}`;if(e.firstName)return e.firstName;if(e.lastName)return e.lastName;break;case"userTypeDeleted":case"userTypeUnknown":return"Deleted account"}}}function c(e,t,n){if(t.id===r.aw)return e("ServiceNotifications").toLowerCase();if(t.type&&"userTypeBot"===t.type)return e("Bot");if(!t.status)return"";switch(t.status.type){case"userStatusEmpty":return e("ALongTimeAgo");case"userStatusLastMonth":return e("WithinAMonth");case"userStatusLastWeek":return e("WithinAWeek");case"userStatusOffline":{const{wasOnline:r}=t.status;if(!r)return e("LastSeen.Offline");const d=new Date((new Date).getTime()+1e3*n),a=new Date(1e3*r);if(a>=d)return e("LastSeen.JustNow");const u=new Date(d.getTime()-a.getTime());if(u.getTime()/1e3<60)return e("LastSeen.JustNow");if(u.getTime()/1e3<3600)return e("LastSeen.MinutesAgo",Math.floor(u.getTime()/1e3/60));const s=new Date;if(s.setHours(0,0,0,0),a>new Date(s.getTime()+1e3*n))return u.getTime()/1e3<21600?e("LastSeen.HoursAgo",Math.floor(u.getTime()/1e3/60/60)):e("LastSeen.TodayAt",(0,o.mr)(a));const i=new Date;return i.setDate(d.getDate()-1),i.setHours(0,0,0,0),a>new Date(i.getTime()+1e3*n)?e("LastSeen.YesterdayAt",(0,o.mr)(a)):e("LastSeen.AtDate",(0,o.Tu)(e,a))}case"userStatusOnline":return e("Online");case"userStatusRecently":return e("Lately");default:return}}function l(e){const{id:t,status:n,type:o}=e;return!!n&&t!==r.aw&&"userStatusOnline"===n.type&&"userTypeBot"!==o}function f(e){return!(!e.status||"userTypeBot"===e.type||e.id===r.aw||"userTypeDeleted"!==e.type&&"userTypeUnknown"!==e.type)}function h(e){return"userTypeBot"===e.type}function m(e,t,n,r=0){return(0,d.Xo)(e,(e=>{const o=(0,a.b)(r);if(n&&n.includes(e))return o+172800-(n.length-n.indexOf(e));const d=t[e];if(!d||!d.status)return 0;if("userStatusOnline"===d.status.type)return d.status.expires;if("userStatusOffline"===d.status.type&&d.status.wasOnline)return d.status.wasOnline;switch(d.status.type){case"userStatusRecently":return o-86400;case"userStatusLastWeek":return o-604800;case"userStatusLastMonth":return o-18144e3;default:return 0}}),"desc")}function p(e){const t=e?Math.abs(e.id)%7:0;return u[t]}},1752:(e,t,n)=>{n.d(t,{O4:()=>Me,c_:()=>I,fZ:()=>l,m6:()=>w,aK:()=>Se,aJ:()=>Ce,Sh:()=>Y,$S:()=>k,bp:()=>Ze,WY:()=>xe,K4:()=>E,bV:()=>M,h8:()=>ee,M6:()=>x,i9:()=>B,vy:()=>H,rB:()=>Pe,g_:()=>j,Mg:()=>d,SL:()=>u,Pb:()=>fe,w3:()=>D,BI:()=>we,lr:()=>Ie,pf:()=>b,s5:()=>K,y9:()=>N,nA:()=>Re,_7:()=>De,Q$:()=>Ne,Dq:()=>Oe,vT:()=>ke,QH:()=>Le,Ob:()=>_,a4:()=>i,B1:()=>a,vv:()=>h,Pi:()=>f,cY:()=>C,GL:()=>c,Wy:()=>g,wV:()=>Z,cq:()=>O,rq:()=>G,No:()=>de,Og:()=>ae,xv:()=>se,px:()=>ue,xj:()=>P,c1:()=>ge,z5:()=>pe,qr:()=>le,dx:()=>he,fw:()=>be,H9:()=>ve,HN:()=>Ee,ff:()=>A,P4:()=>S,x1:()=>X,TM:()=>Te,Rg:()=>$,z3:()=>U,IM:()=>W,Xg:()=>R,j6:()=>L,lG:()=>F,IE:()=>Ae,Nq:()=>J,Lm:()=>te,Q3:()=>ne,eD:()=>q});var r=n(3716),o=n(782);function d(e,t,n){return{...e,chats:{...e.chats,listIds:{...e.chats.listIds,[t]:n}}}}function a(e,t,n){const{[t]:r}=e.chats.listIds,o=null!=r&&r.length?n.filter((e=>!r.includes(e))):n;return r&&!o.length?e:d(e,t,[...r||[],...o])}function u(e,t){return{...e,chats:{...e.chats,byId:t}}}function s(e,t,n,r){const{byId:d}=e.chats,a=d[t],u=n.isMin&&a&&!a.isMin,s={...a,...u?(0,o.CE)(n,["isMin","accessHash"]):n,...r&&{photos:[r,...a.photos||[]]}};return s.id&&s.type,s}function i(e,t,n,r){const{byId:o}=e.chats;return u(e,{...o,[t]:s(e,t,n,r)})}function c(e,t){const n=Object.keys(t).map(Number).reduce(((n,r)=>{const o=s(e,r,t[r]);return o&&(n[r]=o),n}),{});return e=u(e,{...e.chats.byId,...n})}function l(e,t){const{byId:n}=e.chats;let r=!1;const o=Object.keys(t).map(Number).reduce(((o,d)=>{if(!n[d]||n[d].isMin&&!t[d].isMin){const n=s(e,d,t[d]);n&&(o[d]=n,r||(r=!0))}return o}),{});return r&&(e=u(e,{...e.chats.byId,...o})),e}function f(e,t,n){const o=n===r.WS?"archived":"active";let d=e.chats.listIds;return Object.keys(d).forEach((e=>{const n=d[e]||[];e!==o||n.includes(t)?e!==o&&n.includes(t)&&(d={...d,[e]:n.filter((e=>e!==t))}):d={...d,[e]:[...n,t]}})),i(e={...e,chats:{...e.chats,listIds:d}},t,{folderId:n||void 0})}function h(e,t,n){const r="active"===t?"all":"archived";return{...e,chats:{...e.chats,...n.orderedPinnedIds&&{orderedPinnedIds:{...e.chats.orderedPinnedIds,[t]:n.orderedPinnedIds}},totalCount:{...e.chats.totalCount,[r]:n.totalChatCount},isFullyLoaded:{...e.chats.isFullyLoaded,[t]:!1}}}}var m=n(6137),p=n(8085);function g(e,t,n=m._f,o="thread",d){const{messageLists:a}=e.messages;let u=a;if(d||r.Cg)u=t?[{chatId:t,threadId:n,type:o}]:[];else if(t){const e=a[a.length-1];e&&e.chatId===t&&e.threadId===n&&e.type===o||(u=e&&-1===e.chatId?[...a.slice(0,-1),{chatId:t,threadId:n,type:o}]:[...a,{chatId:t,threadId:n,type:o}])}else u=a.slice(0,-1);return{...e,messages:{...e.messages,messageLists:u}}}function y(e,t,n){return v(e,t,{byId:n})}function v(e,t,n){const r=e.messages.byChatId[t]||{byId:{},threadsById:{}};return{...e,messages:{...e.messages,byChatId:{...e.messages.byChatId,[t]:{...r,...n}}}}}function b(e,t,n,r,o){return function(e,t,n,r){const o=e.messages.byChatId[t];return v(e,t,{threadsById:{...null==o?void 0:o.threadsById,[n]:{...null==o?void 0:o.threadsById[n],...r}}})}(e,t,n,{[r]:o})}function w(e,t){const n=t.reduce(((e,t)=>(e[t.chatId]||(e[t.chatId]={}),e[t.chatId][t.id]=t,e)),{});return Object.keys(n).map(Number).forEach((t=>{e=I(e,t,n[t])})),e}function I(e,t,n){const r=(0,p.Zw)(e,t);return r&&Object.keys(n).every((e=>Boolean(r[Number(e)])))?e:y(e,t,{...n,...r})}function C(e,t,n,r){const o=(0,p.Zw)(e,t)||{},d={...o[n],...r};return d.id?y(e,t,{...o,[n]:d}):e}function S(e,t,n,r){const o=(0,p.Fn)(e,t)||{},d={...o[n],...r};return d.id?D(e,t,{...o,[n]:d},void 0):e}function E(e,t,n){const r=(0,p.Zw)(e,t);if(!r)return e;const d=(0,o.CE)(r,n),a=Object.values((0,o.q0)(r,n)).filter((({forwardInfo:e})=>null==e?void 0:e.isLinkedChannelPost));if(Object.keys(e.messages.byChatId[t].threadsById).map(Number).forEach((r=>{const o=(0,p.tZ)(e,t,r);let d=(0,p.gb)(e,t,r),a=(0,p.qC)(e,t,r),u=(0,p.Cb)(e,t,r),s=(0,p.KB)(e,t),i=null==o?void 0:o.messagesCount;n.forEach((e=>{d&&d.includes(e)&&(d=d.filter((t=>t!==e)),void 0!==i&&(i-=1)),a&&a.includes(e)&&(a=a.filter((t=>t!==e))),u&&u.includes(e)&&(u=u.filter((t=>t!==e))),s&&s.includes(e)&&(s=s.filter((t=>t!==e)))})),e=b(e,t,r,"listedIds",d),e=b(e,t,r,"outlyingIds",a),e=b(e,t,r,"viewportIds",u),e=b(e,t,r,"pinnedIds",s),o&&void 0!==i&&(e=b(e,t,r,"threadInfo",{...o,messagesCount:i}))})),a.length){const n=(0,p.Bt)(e),r=n&&n.chatId===t&&"thread"===n.type,o=null==n?void 0:n.threadId;a.forEach((n=>{const{fromChatId:d,fromMessageId:a}=n.forwardInfo,u=(0,p.hj)(e,d,a);r&&o===a&&(e=g(e,t)),u&&(e=C(e,d,a,{threadInfo:void 0}))}))}return e=y(e,t,d)}function M(e,t,n){const r=(0,p.Fn)(e,t);if(!r)return e;const d=(0,o.CE)(r,n);let a=(0,p.qy)(e,t);return a&&(n.forEach((e=>{a.includes(e)&&(a=a.filter((t=>t!==e)))})),e=b(e,t,m._f,"scheduledIds",a)),D(e,t,d,void 0)}function P(e,t,n,r){const o=(0,p.gb)(e,t,n),d=null!=o&&o.length?r.filter((e=>!o.includes(e))):r;return o&&!d.length?e:b(e,t,n,"listedIds",T([...o||[],...d]))}function A(e,t,n,r){const o=(0,p.qC)(e,t,n),d=null!=o&&o.length?r.filter((e=>!o.includes(e))):r;return o&&!d.length?e:b(e,t,n,"outlyingIds",T([...o||[],...d]))}function T(e){return e.sort(((e,t)=>e-t))}function k(e,t,n,o){const d=(0,p.Cb)(e,t,n)||[];return d.includes(o)?e:b(e,t,n,"viewportIds",T([...d.length{e=R(e,t.chatId,t.threadId,t)})),e}function D(e,t,n,r){return function(e,t,n){const r=e.scheduledMessages.byChatId[t]||{byId:{},hash:0};return{...e,scheduledMessages:{byChatId:{...e.scheduledMessages.byChatId,[t]:{...r,...n}}}}}(e,t,{byId:n,hash:r})}function O(e,t,n,r=!1,o=!1){return{...e,focusedMessage:{...e.focusedMessage,chatId:t,messageId:n,noHighlight:r,isResizingContainer:o}}}function Z(e,t){return{...e,focusedMessage:{...e.focusedMessage,direction:t}}}function x(e,t,n){return{...e,selectedMessages:{chatId:t,messageIds:n?Array.prototype.concat([],n):[]}}}function _(e,t,n,r,d,a,u,s=!1){const{selectedMessages:i}=e;a&&(u=(0,p.xH)(e,t,a));const c=u||[d];if(!i)return x(e,t,c);const{messageIds:l}=i;let f;const h=c.filter((e=>!l.includes(e)));if(h&&!h.length)f=l.filter((e=>!c.includes(e)));else if(s&&l.length){const a=(0,p.$W)(e,t,n,r),u=a.indexOf(l[l.length-1]),s=a.indexOf(d),i=Math.min(u,s),c=Math.max(u,s),h=a.slice(i,c+1);f=(0,o.Tw)([...l,...h])}else f=[...l,...h];return f.length?{...e,selectedMessages:{...i,messageIds:f}}:B(e)}function B(e){return{...e,selectedMessages:void 0}}function F(e,t,n,r,o){const{channelPostId:d,fromChatId:a}=t.forwardInfo||{};if(d&&a){const t=(0,p.tZ)(e,n,d);t&&(e=b(e,n,d,"threadInfo",{...t,lastMessageId:r,messagesCount:t.messagesCount+(o?-1:1)}))}return e}function U(e,t,n,r,d){const a=r.map((t=>{const n=e.stickers.setsById[t.id];return n?{...n,...t}:t}));return{...e,stickers:{...e.stickers,setsById:{...e.stickers.setsById,...(0,o.ee)(a,"id")},[t]:{...e.stickers[t],hash:n,..."search"===t?{resultIds:d}:{setIds:r.map((({id:e})=>e))}}}}}function $(e,t,n){const r=e.stickers.setsById[t]||{};return{...e,stickers:{...e.stickers,setsById:{...e.stickers.setsById,[t]:{...r,...n}}}}}function G(e,t,n,r){const{results:o}=e.gifs.search;let d;if(t||!o)d=n;else{const e=new Set(o.map((e=>e.id)));d=[...o,...n.filter((t=>!e.has(t.id)))]}return{...e,gifs:{...e.gifs,search:{...e.gifs.search,offset:r,results:d}}}}function j(e,t){return{...e,animatedEmojis:t}}function W(e,t,n,r){const d=[...(0,p.Pk)(e,t),...n||[]],a=(0,o.Tw)(d.map((({id:e})=>e))),u=(0,o.ee)(d,"id"),s=a.map((e=>u[e]));return{...e,stickers:{...e.stickers,forEmoji:{emoji:t,stickers:s,hash:r}}}}function H(e){const{emoji:t,stickers:n,hash:r}=e.stickers.forEmoji||{};return t?W(e,t,n,r):e}var V=n(735);function K(e,t){return{...e,users:{...e.users,byId:t}}}function z(e,t,n){const{byId:r}=e.users,d=r[t],a=n.isMin&&d&&!d.isMin,u={...d,...a?(0,o.CE)(n,["isMin","accessHash"]):n};return u.id&&u.type?u:d}function Q(e,t){const{hash:n,userIds:r}=e.contactList||{};if(!r)return e;const o=t.filter((e=>(null==e?void 0:e.isContact)&&!r.includes(e.id))).map((e=>e.id));return 0===o.length?e:{...e,contactList:{hash:n||0,userIds:[...o,...r]}}}function J(e,t,n){const{byId:r}=e.users,o=z(e,t,n);return K(e=Q(e,[o]),{...r,[t]:o})}function q(e,t){const n=Object.keys(t).map(Number).reduce(((n,r)=>{const o=z(e,r,t[r]);return o&&(n[r]=o),n}),{});return e=K(e=Q(e,Object.values(n)),{...e.users.byId,...n})}function Y(e,t){const{byId:n}=e.users;let r=!1;const o=Object.keys(t).map(Number).reduce(((o,d)=>{if(!n[d]||n[d].isMin&&!t[d].isMin){const n=z(e,d,t[d]);n&&(o[d]=n,r||(r=!0))}return o}),{});return r&&(e=Q(e=K(e,{...e.users.byId,...o}),Object.values(o))),e}function X(e,t){return e.users.selectedId===t?e:{...e,users:{...e.users,selectedId:t}}}function ee(e,t){const{byId:n}=e.users,{hash:r,userIds:o}=e.contactList||{};return delete n[t],K(e={...e,contactList:{hash:r||0,userIds:o?o.filter((e=>e!==t)):V.D}},n)}function te(e,t){return{...e,userSearch:{...e.userSearch,...t}}}function ne(e,t){return te(e,{fetchingStatus:t})}function re(e,t,n){const{byId:r}=e.users,o=r[t];return o&&o.fullInfo?J(e,t,{...o,fullInfo:{...o.fullInfo,isBlocked:n}}):e}const oe=e=>`${e.chatId}_${e.id}`;function de(e,t){return{...e,globalSearch:{...e.globalSearch,...t}}}function ae(e,t){return de(e,{currentContent:t})}function ue(e,t,n,r,d){var a;const{resultsByType:u}=e.globalSearch||{},s=t.reduce(((e,t)=>(e[oe(t)]=t,e)),{}),i=null==u||null===(a=u[r])||void 0===a?void 0:a.foundIds;if(void 0!==i&&Object.keys(s).every((e=>i.includes(oe(s[e])))))return se(e,{messages:!1});const c=i||[],l=t.map((e=>oe(e))),f=Array.prototype.concat(c,l),h=(0,o.et)(c,f)?c:f;return de(e=se(e,{messages:!1}),{resultsByType:{...(e.globalSearch||{}).resultsByType,[r]:{totalCount:n,nextOffsetId:d,foundIds:h}}})}function se(e,t){return de(e,{fetchingStatus:{...e.globalSearch.fetchingStatus,...t}})}var ie=n(2858);function ce(e,t,n){return{...e,localTextSearch:{byChatThreadKey:{...e.localTextSearch.byChatThreadKey,[t]:n}}}}function le(e,t,n,r,o){const d=(0,ie.uw)(t,n);return ce(e,d,{...e.localTextSearch.byChatThreadKey[d],isActive:r,query:o})}function fe(e,t,n,r,o,d){const a=(0,ie.uw)(t,n);return ce(e,a,{...e.localTextSearch.byChatThreadKey[a],results:{foundIds:r,totalCount:o,nextOffsetId:d}})}function he(e,t,n,r,d,a){const u=(0,ie.uw)(t,n),{results:s}=e.localTextSearch.byChatThreadKey[u]||{},i=(null==s?void 0:s.foundIds)||[],c=ye((0,o.Tw)(Array.prototype.concat(i,r)));return fe(e,t,n,(0,o.et)(i,c)?i:c,d,a)}function me(e,t,n){return{...e,localMediaSearch:{byChatId:{...e.localMediaSearch.byChatId,[t]:n}}}}function pe(e,t,n){return me(e,t,{...e.localMediaSearch.byChatId[t],currentType:n})}function ge(e,t,n,r,d,a){const{resultsByType:u}=e.localMediaSearch.byChatId[t]||{},s=null!=u&&u[n]?u[n].foundIds:[],i=ye((0,o.Tw)(Array.prototype.concat(s,r)));return function(e,t,n,r,o,d){return me(e,t,{...e.localMediaSearch.byChatId[t],resultsByType:{...(e.localMediaSearch.byChatId[t]||{}).resultsByType,[n]:{foundIds:r,totalCount:o,nextOffsetId:d}}})}(e,t,n,(0,o.et)(s,i)?s:i,d,a)}function ye(e){return e.sort(((e,t)=>e-t))}function ve(e,t){return{...e,management:{...e.management,progress:t}}}function be(e,t,n){return{...e,management:{...e.management,byChatId:{...e.management.byChatId,[t]:{...e.management.byChatId[t]||{},...n}}}}}function we(e,t){return{...e,settings:{...e.settings,byKey:{...e.settings.byKey,...t}}}}function Ie(e,t,n){return{...e,settings:{...e.settings,themes:{...e.settings.themes,[t]:{...e.settings.themes[t]||{},...n}}}}}function Ce(e,t){return t.forEach((t=>{const{chatId:n,...r}=t;e=Se(e,n,r)})),e}function Se(e,t,n){return{...e,settings:{...e.settings,notifyExceptions:{...e.settings.notifyExceptions,[t]:n}}}}function Ee(e,t,n,r){switch(t){case"contact":return we(e,{...void 0!==n&&{hasPrivateChatsNotifications:!n},...void 0!==r&&{hasPrivateChatsMessagePreview:r}});case"group":return we(e,{...void 0!==n&&{hasGroupNotifications:!n},...void 0!==r&&{hasGroupMessagePreview:r}});case"broadcast":return we(e,{...void 0!==n&&{hasBroadcastNotifications:!n},...void 0!==r&&{hasBroadcastMessagePreview:r}});default:return}}function Me(e,t){return e=re(e,t,!0),{...e,blocked:{...e.blocked,ids:[t,...e.blocked.ids],totalCount:e.blocked.totalCount+1}}}function Pe(e,t){return e=re(e,t,!1),{...e,blocked:{...e.blocked,ids:e.blocked.ids.filter((e=>e!==t)),totalCount:e.blocked.totalCount-1}}}function Ae(e,t){return{...e,twoFaSettings:{...e.twoFaSettings,...t}}}function Te(e,t){return{...e,payment:{...e.payment,shippingOptions:t}}}function ke(e,t){return{...e,payment:{...e.payment,requestId:t}}}function Ne(e,t){return{...e,payment:{...e.payment,step:t}}}function Re(e,t){if(!t.content||!t.content.invoice)return e;const{title:n,text:r,amount:o,currency:d,isTest:a,photoUrl:u}=t.content.invoice;return{...e,payment:{...e.payment,invoiceContent:{title:n,text:r,photoUrl:u,amount:o,currency:d,isTest:a}}}}function Le(e,t){return{...e,payment:{...e.payment,stripeCredentials:{...t}}}}function De(e,t){return{...e,payment:{...e.payment,...t}}}function Oe(e,t,n){if(!t||!n)return{...e,payment:{...e.payment,receipt:void 0}};const{invoice:r}=n.content,{photoUrl:o,text:d,title:a}=r||{};return{...e,payment:{...e.payment,receipt:{...t,photoUrl:o,text:d,title:a}}}}function Ze(e){return{...e,payment:{}}}function xe(e){return{...e,payment:{...e.payment,isPaymentModalOpen:!1}}}},8085:(e,t,n)=>{n.d(t,{hg:()=>oe,_k:()=>pe,zB:()=>D,g4:()=>w,xl:()=>ge,nB:()=>ye,Z1:()=>f,IK:()=>v,DI:()=>M,Mw:()=>S,Ek:()=>C,hj:()=>ae,ZB:()=>ie,Zw:()=>_,YK:()=>y,Dg:()=>h,X5:()=>Ce,A1:()=>P,jr:()=>x,yN:()=>k,JX:()=>Ge,pP:()=>_e,we:()=>Ze,og:()=>Oe,$W:()=>G,Bt:()=>Z,y5:()=>T,n5:()=>De,Ms:()=>J,_$:()=>z,kK:()=>se,wU:()=>Q,yZ:()=>X,It:()=>we,G$:()=>ce,y8:()=>Me,cv:()=>me,pk:()=>b,N:()=>I,ep:()=>E,xo:()=>p,FM:()=>m,a6:()=>Ae,Ev:()=>Ie,CA:()=>Se,zQ:()=>Be,_X:()=>le,vk:()=>Ee,Jf:()=>Ue,s4:()=>i,b9:()=>de,gb:()=>U,aW:()=>xe,xH:()=>Pe,FT:()=>ke,tV:()=>q,NJ:()=>l,dZ:()=>c,dT:()=>fe,qC:()=>$,gx:()=>je,eh:()=>He,Mz:()=>We,sp:()=>Ve,KB:()=>W,$$:()=>Ke,rd:()=>be,p9:()=>ee,Yy:()=>K,Wq:()=>Fe,qy:()=>H,Tm:()=>ue,Fn:()=>B,Vt:()=>V,D7:()=>Te,Ur:()=>he,TD:()=>Ne,pv:()=>Re,yB:()=>Le,Ny:()=>N,E_:()=>R,Pk:()=>L,i3:()=>ze,P_:()=>g,Pu:()=>$e,Db:()=>re,tZ:()=>Y,Cm:()=>te,qS:()=>ne,uZ:()=>ve,dy:()=>s,Cb:()=>j});var r=n(1713),o=n(7361),d=n(6137),a=n(3716),u=n(2858);function s(e,t){return e.users.byId[t]}function i(e,t){var n;const r=s(e,t);return null==r||null===(n=r.fullInfo)||void 0===n?void 0:n.isBlocked}function c(e){return e.settings.byKey}function l(e){return e.settings.notifyExceptions}function f(e,t){return e.chats.byId[t]}function h(e,t){const n=(0,u.zX)(t);return!!n&&s(e,n)}function m(e,t){return t===e.currentUserId}function p(e,t){const n=h(e,t);return n&&(0,u.cS)(n)}function g(e){return Object.values(e.chats.byId).find((({isSupport:e})=>e))}function y(e,t){if(!(0,u.YA)(t.id)&&!(0,u.eA)(t)&&t.fullInfo)return t.fullInfo.members&&t.fullInfo.members.length!==a.mo?t.fullInfo.members.reduce(((t,{userId:n})=>e.users.byId[n]&&(0,u.kM)(e.users.byId[n])&&n!==e.currentUserId?t+1:t),0):t.fullInfo.onlineCount}function v(e,t){const n=f(e,t),r=n&&(0,u.zX)(n),o=r&&s(e,r);if(o&&(0,u.cS)(o))return o}function b(e,t){const n=f(e,t),r=v(e,t);if(!n||!r)return!1;if(n.lastMessage&&(0,u.CD)(n.lastMessage))return!0;const o=e.messages.byChatId[t];if(!o)return!1;const{listedIds:a}=o.threadsById[d._f]||{};return a&&!a.length}function w(e){return Boolean(e.chats.listIds.active)}function I(e,t,n){const{listIds:r}=e.chats;if(n){const e=r[n];return Boolean(e&&e.includes(t))}return Object.values(r).some((e=>e&&e.includes(t)))}function C(e,t){const n=f(e,t);if(n&&I(e,t))return n.folderId===a.WS?"archived":"active"}function S(e,t){return e.chatFolders.byId[t]}function E(e,t,n=a.Nf){const{active:r,archived:o}=e.chats.orderedPinnedIds;if(n===a.Nf)return!!r&&r.includes(t);if(n===a.WS)return!!o&&o.includes(t);const{byId:d}=e.chatFolders,{pinnedChatIds:u}=d[n]||{};return!!u&&u.includes(t)}function M(e,t){const n=t.toLowerCase();return Object.values(e.chats.byId).find((e=>e.username&&e.username.toLowerCase()===n))}function P(e){const t=e.chats.listIds.active;if(!t)return 0;const n=e.chats.byId,r=c(e),o=l(e);return t.reduce(((e,t)=>{const d=n[t];return!(d&&d.unreadCount&&d.isListed)||d.isNotJoined||d.isRestricted||!d.unreadMentionsCount&&(0,u.i4)(d,r,o)?e:e+d.unreadCount}),0)}var A=n(782);function T(e){return e.stickers.search}function k(e){return e.gifs.search}function N(e,t){return e.stickers.setsById[t]}function R(e,t){return Object.values(e.stickers.setsById).find((e=>e.shortName.toLowerCase()===t.toLowerCase()))}function L(e,t){const n=Object.values(e.stickers.setsById);let r=[];return n.forEach((({packs:e})=>{if(!e)return;const n=e[t];n&&(r=r.concat(n))})),r}function D(e,t){const{animatedEmojis:n}=e;if(!n||!n.stickers)return;const r=t.replace("️","");return n.stickers.find((e=>e.emoji===t||e.emoji===r))}var O=n(2267);function Z(e){const{messageLists:t}=e.messages;if(t.length)return t[t.length-1]}function x(e){const{chatId:t}=Z(e)||{};return t?f(e,t):void 0}function _(e,t){var n;return null===(n=e.messages.byChatId[t])||void 0===n?void 0:n.byId}function B(e,t){var n;return null===(n=e.scheduledMessages.byChatId[t])||void 0===n?void 0:n.byId}function F(e,t,n,r){const o=e.messages.byChatId[t];if(!o)return;const d=o.threadsById[n];return d?d[r]:void 0}function U(e,t,n){return F(e,t,n,"listedIds")}function $(e,t,n){return F(e,t,n,"outlyingIds")}function G(e,t,n,r){switch(r){case"thread":return j(e,t,n);case"pinned":return W(e,t);case"scheduled":return H(e,t)}}function j(e,t,n){return F(e,t,n,"viewportIds")}function W(e,t){return F(e,t,d._f,"pinnedIds")}function H(e,t){return F(e,t,d._f,"scheduledIds")}function V(e,t,n){return F(e,t,n,"scrollOffset")}function K(e,t,n){return F(e,t,n,"replyingToId")}function z(e,t,n){return F(e,t,n,"editingId")}function Q(e,t){return F(e,t,d._f,"editingScheduledId")}function J(e,t,n){return F(e,t,n,"draft")}function q(e,t,n){return F(e,t,n,"noWebPage")}function Y(e,t,n){return F(e,t,n,"threadInfo")}function X(e,t,n){return F(e,t,n,"firstMessageId")}function ee(e,t,n){return F(e,t,n,"replyStack")}function te(e,t,n){if(n===d._f)return f(e,t);const r=Y(e,t,n);return r?f(e,r.originChannelId||t):void 0}function ne(e,t,n){if(n===d._f)return;const r=Y(e,t,n);return r?r.topMessageId:void 0}function re(e,t,n){const r=e.messages.byChatId[t];if(!r)return;const{replyToMessageId:o,replyToTopMessageId:d}=n;return o||d?Object.values(r.threadsById).find((e=>e.threadInfo&&(o&&o===e.threadInfo.topMessageId||d&&d===e.threadInfo.topMessageId))):void 0}function oe(e,t,n){const r=Z(e);if(!r)return!1;const{threadInfo:o}=re(e,t,n)||{};return t===r.chatId&&(r.threadId===d._f||o&&r.threadId===o.threadId)}function de(e,t,n){const r=j(e,t,n);if(!r||!r.length)return!0;let o;if(n===d._f){const n=f(e,t);if(!n||!n.lastMessage)return!0;o=n.lastMessage.id}else{const r=Y(e,t,n);if(!r||!r.lastMessageId)return;o=r.lastMessageId}return o>=a.AE&&!ae(e,t,o)||r[r.length-1]>=o}function ae(e,t,n){const r=_(e,t);return r?r[n]:void 0}function ue(e,t,n){const r=B(e,t);return r?r[n]:void 0}function se(e,t,n,r){if("scheduled"===r){const n=Q(e,t);return n?ue(e,t,n):void 0}{const r=z(e,t,n);return r?ae(e,t,r):void 0}}function ie(e,t){let n;for(const r of Object.values(e.messages.byChatId)){const{byId:e}=r;if(n=Object.values(e).find((e=>e.content.poll&&e.content.poll.id===t)),n)break}return n}function ce(e,t){const{chatId:n,messageId:r}=e.focusedMessage||{};return n===t?r:void 0}function le(e,t){const n=ce(e,t.chatId);return!!n&&(n===t.id||n===t.previousLocalId)}function fe(e,t,n=!1){return function(e,t){const{lastReadOutboxMessageId:n}=f(e,t.chatId)||{};return(0,u.CI)(t)||!n||n0?s(e,n):f(e,n)}function me(e,t){const{forwardInfo:n}=t;if(n)return n.isChannelPost&&n.fromChatId?f(e,n.fromChatId):n.senderUserId?s(e,n.senderUserId)||f(e,n.senderUserId):void 0}function pe(e,t,n){var r;const o=f(e,t.chatId);if(!o||o.isRestricted)return{};const d=(0,u.YA)(o.id),a=m(e,t.chatId),s=(0,u.G9)(o),i=(0,u.ZV)(o),c=(0,u.eA)(o),l=(0,u.jM)(t),h=(0,u.B4)(t),p=(0,u.Lo)(t),{content:g}=t,y=(a||i&&(0,u.VE)(o,"pinMessages")||c&&(0,u.VE)(o,"editMessages")||(0,O.b)(e.serverTimeOffset)-t.date<172800)&&!(g.sticker||g.contact||g.poll||g.action||g.audio||null!==(r=g.video)&&void 0!==r&&r.isRound)&&!(0,u.MF)(t)&&!t.viaBotId,v=(0,u.Qm)(o,n)&&!l,b=d||o.isCreator||!c&&!(0,u.Mg)(o,"pinMessages")||(0,u.VE)(o,"pinMessages");let w=!p&&b,I=!1;const C=W(e,o.id);w&&(I=Boolean(C&&C.includes(t.id)),w=!I);const S=d||h||s||o.isCreator||(0,u.VE)(o,"deleteMessages"),E=!d&&!h,M=S&&!l&&(d&&!a||s&&(h||(0,u.VE)(o,"deleteMessages")||o.isCreator)),P=!p&&y&&(h||c&&(o.isCreator||(0,u.VE)(o,"editMessages"))),A=!p&&!l,T=Boolean(t.content.sticker),k=T&&function(e,t){const{stickers:n}=e.stickers.favorite;return n&&n.some((({id:e})=>e===t.id))}(e,t.content.sticker),N=!p&&T&&!k,R=!p&&k,L=!p,D=!p&&(c||i),Z=!p;return{noOptions:[v,P,w,I,S,M,A,N,R,L,D,Z].every((e=>!e)),canReply:v,canEdit:P,canPin:w,canUnpin:I,canDelete:S,canReport:E,canDeleteForAll:M,canForward:A,canFaveSticker:N,canUnfaveSticker:R,canCopy:L,canCopyLink:D,canSelect:Z}}function ge(e){const{messageIds:t}=e.selectedMessages||{},{chatId:n,threadId:r}=Z(e)||{},o=n&&_(e,n);if(!o||!t||!r)return{};const d=t.map((t=>o[t]&&pe(e,o[t],r))).filter(Boolean);return{canDelete:d.every((e=>e.canDelete)),canDeleteForAll:d.every((e=>e.canDeleteForAll))}}function ye(e){const{messageIds:t}=e.selectedMessages||{},{chatId:n,threadId:r}=Z(e)||{},o=n&&_(e,n);return!!(o&&t&&r)&&t.map((t=>o[t]&&pe(e,o[t],r))).filter(Boolean).every((e=>e.canReport))}function ve(e,t){var n;return null===(n=e.fileUploads.byMessageLocalId[t.previousLocalId||t.id])||void 0===n?void 0:n.progress}function be(e,t,n){if(n===d._f){const n=f(e,t);if(!n)return;if(!n.lastReadInboxMessageId)return;return n.lastMessage?(0,u.CI)(n.lastMessage)?n.lastMessage.id:Math.min(n.lastMessage.id,n.lastReadInboxMessageId):n.lastReadInboxMessageId}{const r=Y(e,t,n);if(!r)return;return r.lastReadInboxMessageId?Math.min(r.lastReadInboxMessageId,r.lastMessageId||1/0):r.topMessageId}}function we(e,t,n){const r=f(e,t);if(n===d._f){if(!r)return}else{const r=Y(e,t,n);if(!r||r.lastMessageId===r.lastReadInboxMessageId)return}const o=$(e,t,n),a=U(e,t,n),u=_(e,t);if(!u||!o&&!a)return;const s=be(e,t,n);if(s||!r||!r.isNotJoined){if(o){const e=s?o.find((e=>e>s&&u[e]&&(!u[e].isOutgoing||u[e].isFromScheduled))):o[0];if(e)return e}if(a){const e=s?a.find((e=>e>s&&u[e]&&(!u[e].isOutgoing||u[e].isFromScheduled))):a[0];if(e)return e}}}function Ie(e){const{forwardMessages:t}=e;return Boolean(t.isModalShown)}function Ce(e,t){const n=Object.values(e.chats.byId).find((e=>(0,u.Ru)(e)&&e.lastMessage&&e.lastMessage.id===t));if(n)return n.id;const{byChatId:r}=e.messages;return Number(Object.keys(r).find((n=>{const o=f(e,Number(n));return o&&(0,u.Ru)(o)&&r[o.id].byId[t]})))}function Se(e){const{selectedMessages:t}=e;return Boolean(t)}function Ee(e,t){const{messageIds:n}=e.selectedMessages||{};return!!n&&n.includes(t)}function Me(e,t,n){const r=_(e,t);if(r)return Object.values(r).filter((e=>e.groupedId===n&&e.forwardInfo)).map((({forwardInfo:e})=>e.fromMessageId))}function Pe(e,t,n){const r=_(e,t);if(r)return Object.keys(r).map(Number).filter((e=>r[e].groupedId===n))}function Ae(e,t,n){const{messageIds:r}=e.selectedMessages||{};if(!r)return!1;const o=Pe(e,t,n);return o&&o.every((e=>r.includes(e)))}function Te(e){const{messageIds:t}=e.selectedMessages||{};return t?t.length:0}function ke(e,t){const n=f(e,t);if(!n)return;if(!p(e,n))return;const r=_(e,t),o=j(e,t,d._f);if(!r||!o)return;const a=(0,A.dF)(o,(e=>!r[e].isOutgoing&&Boolean(r[e].keyboardButtons))),u=(0,A.dF)(o,(e=>Boolean(r[e].shouldHideKeyboardButtons)));return a&&u&&u>a?void 0:a?r[a]:void 0}function Ne(e,t,n,r){const{shouldAutoDownloadMediaFromContacts:o,shouldAutoDownloadMediaInPrivateChats:d,shouldAutoDownloadMediaInGroups:a,shouldAutoDownloadMediaInChannels:s}=e.settings.byKey;return Boolean(d&&(0,u.YA)(n.id)||a&&(0,u.Bf)(n)||s&&(0,u.eA)(n)||o&&r&&(r.id===e.currentUserId||function(e,t){return e.contactList&&e.contactList.userIds.includes(t.id)}(e,r)))}function Re(e,t){const n=(0,u.b7)(t)||(0,u.Cg)(t);if(!n)return;const{shouldAutoPlayVideos:r,shouldAutoPlayGifs:o}=e.settings.byKey,d=n.isGif||n.isRound;return r&&!d||o&&d}function Le(e){return e.settings.byKey.shouldLoopStickers}function De(e){const{chatId:t,threadId:n}=Z(e)||{};if(!t||!n)return;const r=(0,u.uw)(t,n),o=e.localTextSearch.byChatThreadKey[r];return o&&o.isActive?o:void 0}function Oe(e){const{byChatId:t}=e.localMediaSearch,{chatId:n}=Z(e)||{},r=e.users.selectedId;return r&&t[r]?r:n}function Ze(e){const t=Oe(e);if(t)return e.localMediaSearch.byChatId[t]}function xe(e,t){return e.management.byChatId[t]}function _e(e){const{chatId:t,threadId:n}=Z(e)||{};if(!t||!n)return;if((0,u.YA)(t))return"user";const r=f(e,t);return r?(0,u.Bf)(r)?"group":"channel":void 0}function Be(e){const{mediaViewer:t}=e;return Boolean(t.messageId||t.avatarOwnerId)}function Fe(e){const{users:t,isChatInfoShown:n,newChatMembersProgress:d}=e,a=d!==r.WB.Closed,u=function(e){const{pollResults:t}=e;return Boolean(t.messageId)}(e),s=Boolean(!o.wB&&De(e)),i=function(e){const{chatId:t,threadId:n}=Z(e)||{};if(!t||!n)return;const r=e.management.byChatId[t];return r&&r.isActive?r:void 0}(e),c=void 0!==T(e).query,l=void 0!==k(e).query,{chatId:f}=Z(e)||{},h=t.selectedId,m=w(e),p=Boolean(h&&m),g=Boolean(f&&m)&&n;return u?r.qt.PollResults:s?r.qt.Search:i?r.qt.Management:c?r.qt.StickerSearch:l?r.qt.GifSearch:a?r.qt.AddingMembers:p?r.qt.UserInfo:g?r.qt.ChatInfo:void 0}function Ue(e){return void 0!==Fe(e)}function $e(e){const{theme:t,shouldUseSystemTheme:n}=e.settings.byKey;return n?(0,o.vn)():t}function Ge(e){return e.globalSearch.query}function je(e){return e.payment.chatId}function We(e){return e.payment.messageId}function He(e){return e.payment.formId}function Ve(e){return e.payment.requestId}function Ke(e){return e.payment.nativeParams?e.payment.nativeParams.publishableKey:void 0}function ze(e){return e.payment.stripeCredentials}},1713:(e,t,n)=>{let r,o,d,a,u,s,i,c,l,f,h,m,p;n.d(t,{Uq:()=>r,fo:()=>o,MT:()=>d,du:()=>a,nJ:()=>u,qt:()=>s,bZ:()=>i,Nh:()=>c,rN:()=>l,wv:()=>f,WB:()=>h,vi:()=>m,KB:()=>p,mp:()=>g,u1:()=>y}),function(e){e[e.Backwards=0]="Backwards",e[e.Forwards=1]="Forwards",e[e.Around=2]="Around"}(r||(r={})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Static=2]="Static"}(o||(o={})),function(e){e[e.Main=0]="Main",e[e.EditProfile=1]="EditProfile",e[e.Notifications=2]="Notifications",e[e.Language=3]="Language",e[e.General=4]="General",e[e.GeneralChatBackground=5]="GeneralChatBackground",e[e.GeneralChatBackgroundColor=6]="GeneralChatBackgroundColor",e[e.Privacy=7]="Privacy",e[e.PrivacyPhoneNumber=8]="PrivacyPhoneNumber",e[e.PrivacyLastSeen=9]="PrivacyLastSeen",e[e.PrivacyProfilePhoto=10]="PrivacyProfilePhoto",e[e.PrivacyForwarding=11]="PrivacyForwarding",e[e.PrivacyGroupChats=12]="PrivacyGroupChats",e[e.PrivacyPhoneNumberAllowedContacts=13]="PrivacyPhoneNumberAllowedContacts",e[e.PrivacyPhoneNumberDeniedContacts=14]="PrivacyPhoneNumberDeniedContacts",e[e.PrivacyLastSeenAllowedContacts=15]="PrivacyLastSeenAllowedContacts",e[e.PrivacyLastSeenDeniedContacts=16]="PrivacyLastSeenDeniedContacts",e[e.PrivacyProfilePhotoAllowedContacts=17]="PrivacyProfilePhotoAllowedContacts",e[e.PrivacyProfilePhotoDeniedContacts=18]="PrivacyProfilePhotoDeniedContacts",e[e.PrivacyForwardingAllowedContacts=19]="PrivacyForwardingAllowedContacts",e[e.PrivacyForwardingDeniedContacts=20]="PrivacyForwardingDeniedContacts",e[e.PrivacyGroupChatsAllowedContacts=21]="PrivacyGroupChatsAllowedContacts",e[e.PrivacyGroupChatsDeniedContacts=22]="PrivacyGroupChatsDeniedContacts",e[e.PrivacyActiveSessions=23]="PrivacyActiveSessions",e[e.PrivacyBlockedUsers=24]="PrivacyBlockedUsers",e[e.Folders=25]="Folders",e[e.FoldersCreateFolder=26]="FoldersCreateFolder",e[e.FoldersEditFolder=27]="FoldersEditFolder",e[e.FoldersEditFolderFromChatList=28]="FoldersEditFolderFromChatList",e[e.FoldersIncludedChats=29]="FoldersIncludedChats",e[e.FoldersIncludedChatsFromChatList=30]="FoldersIncludedChatsFromChatList",e[e.FoldersExcludedChats=31]="FoldersExcludedChats",e[e.FoldersExcludedChatsFromChatList=32]="FoldersExcludedChatsFromChatList",e[e.TwoFaDisabled=33]="TwoFaDisabled",e[e.TwoFaNewPassword=34]="TwoFaNewPassword",e[e.TwoFaNewPasswordConfirm=35]="TwoFaNewPasswordConfirm",e[e.TwoFaNewPasswordHint=36]="TwoFaNewPasswordHint",e[e.TwoFaNewPasswordEmail=37]="TwoFaNewPasswordEmail",e[e.TwoFaNewPasswordEmailCode=38]="TwoFaNewPasswordEmailCode",e[e.TwoFaEnabled=39]="TwoFaEnabled",e[e.TwoFaChangePasswordCurrent=40]="TwoFaChangePasswordCurrent",e[e.TwoFaChangePasswordNew=41]="TwoFaChangePasswordNew",e[e.TwoFaChangePasswordConfirm=42]="TwoFaChangePasswordConfirm",e[e.TwoFaChangePasswordHint=43]="TwoFaChangePasswordHint",e[e.TwoFaTurnOff=44]="TwoFaTurnOff",e[e.TwoFaRecoveryEmailCurrentPassword=45]="TwoFaRecoveryEmailCurrentPassword",e[e.TwoFaRecoveryEmail=46]="TwoFaRecoveryEmail",e[e.TwoFaRecoveryEmailCode=47]="TwoFaRecoveryEmailCode",e[e.TwoFaCongratulations=48]="TwoFaCongratulations"}(d||(d={})),function(e){e[e.ChatList=0]="ChatList",e[e.GlobalSearch=1]="GlobalSearch",e[e.Settings=2]="Settings",e[e.Contacts=3]="Contacts",e[e.Archived=4]="Archived",e[e.NewChannelStep1=5]="NewChannelStep1",e[e.NewChannelStep2=6]="NewChannelStep2",e[e.NewGroupStep1=7]="NewGroupStep1",e[e.NewGroupStep2=8]="NewGroupStep2"}(a||(a={})),function(e){e[e.ChatList=0]="ChatList",e[e.Media=1]="Media",e[e.Links=2]="Links",e[e.Files=3]="Files",e[e.Music=4]="Music",e[e.Voice=5]="Voice"}(u||(u={})),function(e){e[e.ChatInfo=0]="ChatInfo",e[e.UserInfo=1]="UserInfo",e[e.Search=2]="Search",e[e.Management=3]="Management",e[e.StickerSearch=4]="StickerSearch",e[e.GifSearch=5]="GifSearch",e[e.PollResults=6]="PollResults",e[e.AddingMembers=7]="AddingMembers"}(s||(s={})),function(e){e[e.Inline=0]="Inline",e[e.ScheduledInline=1]="ScheduledInline",e[e.SharedMedia=2]="SharedMedia",e[e.ProfileAvatar=3]="ProfileAvatar",e[e.SettingsAvatar=4]="SettingsAvatar",e[e.MiddleHeaderAvatar=5]="MiddleHeaderAvatar",e[e.Album=6]="Album",e[e.ScheduledAlbum=7]="ScheduledAlbum",e[e.SearchResult=8]="SearchResult"}(i||(i={})),function(e){e[e.Idle=0]="Idle",e[e.InProgress=1]="InProgress",e[e.Complete=2]="Complete",e[e.Error=3]="Error"}(c||(c={})),function(e){e[e.Idle=0]="Idle",e[e.InProgress=1]="InProgress",e[e.Complete=2]="Complete",e[e.Error=3]="Error"}(l||(l={})),function(e){e[e.Idle=0]="Idle",e[e.InProgress=1]="InProgress",e[e.Complete=2]="Complete",e[e.Error=3]="Error"}(f||(f={})),function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Loading=2]="Loading"}(h||(h={})),function(e){e[e.Profile=0]="Profile",e[e.SharedMedia=1]="SharedMedia",e[e.MemberList=2]="MemberList"}(m||(m={})),function(e){e[e.ShippingInfo=0]="ShippingInfo",e[e.Shipping=1]="Shipping",e[e.PaymentInfo=2]="PaymentInfo",e[e.Checkout=3]="Checkout"}(p||(p={}));const g="UPLOADING_WALLPAPER_SLUG";let y;!function(e){e[e.Initial=0]="Initial",e[e.ChatPrivacyType=1]="ChatPrivacyType",e[e.Discussion=2]="Discussion",e[e.ChannelSubscribers=3]="ChannelSubscribers",e[e.GroupType=4]="GroupType",e[e.GroupPermissions=5]="GroupPermissions",e[e.GroupRemovedUsers=6]="GroupRemovedUsers",e[e.GroupUserPermissionsCreate=7]="GroupUserPermissionsCreate",e[e.GroupUserPermissions=8]="GroupUserPermissions",e[e.ChatAdministrators=9]="ChatAdministrators",e[e.GroupRecentActions=10]="GroupRecentActions",e[e.ChatAdminRights=11]="ChatAdminRights",e[e.GroupMembers=12]="GroupMembers"}(y||(y={}))},9933:(e,t,n)=>{n.d(t,{c:()=>d,j:()=>a});var r=n(9118);let o;function d(e,t){t||(o&&!o.isCancelled&&(o.isCancelled=!0),o=t={isCancelled:!1}),(0,r.T2)((()=>{!t.isCancelled&&e()&&d(e,t)}))}function a(e){(0,r.T2)((()=>{e()&&a(e)}))}},7358:(e,t,n)=>{n.d(t,{w:()=>o});var r=n(3716);function o(e){"function"==typeof window.navigator.setAppBadge&&window.navigator.setAppBadge(e).catch((e=>{r.eM&&console.error(e)}))}},275:(e,t,n)=>{function r(e,t){if(e===t)return!0;const n=Object.keys(e),r=n.length;if(r!==Object.keys(t).length)return!1;if(0===r)return!0;for(let o=0;o(e[r]!==t[r]&&n.push(`${r}: ${e[r]} => ${t[r]}`),n)),[])}n.d(t,{Z:()=>r,c:()=>o})},6752:(e,t,n)=>{n.d(t,{Z:()=>r});const r=(...e)=>e.filter(Boolean).join(" ")},9524:(e,t,n)=>{n.d(t,{Type:()=>o,fetch:()=>d,save:()=>a,clear:()=>u});const r=self.caches;let o;async function d(e,t,n,d=!1){if(r)try{const a=new Request(t.replace(/:/g,"_")),u=await r.open(e),s=await u.match(a);if(!s)return;switch(n){case o.Text:return await s.text();case o.Blob:{const e=await s.blob();if("sticker"===t.substr(0,7))return new Blob([e],{type:"image/webp"});if(!e.type){const t=s.headers.get("Content-Type");if(t)return new Blob([e],{type:d?t:t.replace(/html/gi,"")})}return!d&&e.type.includes("html")?new Blob([e],{type:e.type.replace(/html/gi,"")}):e}case o.Json:return await s.json();default:return}}catch(e){return void console.warn(e)}}async function a(e,t,n){if(r)try{const o="string"==typeof n||n instanceof Blob?n:JSON.stringify(n),d=new Request(t.replace(/:/g,"_")),a=new Response(o),u=await r.open(e);return await u.put(d,a)}catch(e){return void console.warn(e)}}async function u(e){try{if(!r)return;return await r.delete(e)}catch(e){return void console.warn(e)}}!function(e){e[e.Text=0]="Text",e[e.Blob=1]="Blob",e[e.Json=2]="Json"}(o||(o={}))},3989:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(517);function o(e){return(0,r.Z)({onEsc:e})}},517:(e,t,n)=>{n.d(t,{Z:()=>d});const r={Enter:"onEnter",Backspace:"onBackspace",Delete:"onDelete",Esc:"onEsc",Escape:"onEsc",ArrowUp:"onUp",ArrowDown:"onDown",ArrowLeft:"onLeft",ArrowRight:"onRight",Tab:"onTab"},o={onEnter:[],onDelete:[],onBackspace:[],onEsc:[],onUp:[],onDown:[],onLeft:[],onRight:[],onTab:[]};function d(e){return a()||document.addEventListener("keydown",u,!0),Object.keys(e).forEach((t=>{const n=e[t];if(!n)return;const r=o[t];r&&r.push(n)})),()=>{!function(e){Object.keys(e).forEach((t=>{const n=e[t],r=o[t];if(r){const e=r.findIndex((e=>e===n));-1!==e&&r.splice(e,1)}})),a()||document.removeEventListener("keydown",u,!1)}(e)}}function a(){return Object.values(o).some((e=>Boolean(e.length)))}function u(e){const t=r[e.key];if(!t)return;const{length:n}=o[t];n&&(e.stopPropagation(),(0,o[t][n-1])(e))}},790:(e,t,n)=>{n.d(t,{$Y:()=>a,_F:()=>u,kj:()=>s,mr:()=>c,VX:()=>l,Tu:()=>f,np:()=>h,j1:()=>m,ZK:()=>g,k9:()=>y,rM:()=>v,xH:()=>b,xk:()=>I,IS:()=>C});const r=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=["January","February","March","April","May","June","July","August","September","October","November","December"],d=o.map((e=>e.toLowerCase()));function a(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function u(e){return a(e).getTime()}function s(e){const t=new Date(1e3*e);return`${t.getFullYear()}-${t.getMonth()}`}function i(e){return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`}function c(e){const t="number"==typeof e?new Date(e):e;return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function l(e,t){const n="number"==typeof t?new Date(t):t,o=a(new Date);if(n>=o)return c(n);const d=new Date(o);if(d.setDate(o.getDate()-7),n>=d)return e(`Weekday.Short${r[n.getDay()]}`);const u=n.getFullYear()!==o.getFullYear(),s=e(u?"formatDateScheduleYear":"formatDateSchedule")||(u?"d MMM yyyy":"d MMM");return p(e,n,s)}function f(e,t){const n="number"==typeof t?new Date(t):t,r=e("formatterYearMax")||"dd.MM.yyyy";return p(e,n,r)}function h(e,t,n=!1){const r=e(n?"formatterMonthYear2":"formatterMonthYear")||"MMM yyyy";return p(e,t,r)}function m(e,t,n=!1,o=!1){const d="number"==typeof t?new Date(t):t,u=a(new Date);if(!o){if(i(d)===i(u))return(n?S:E)(e("Weekday.Today"));const t=new Date(u);if(t.setDate(u.getDate()-1),i(d)===i(t))return(n?S:E)(e("Weekday.Yesterday"));const o=new Date(u),a=new Date(u);if(o.setDate(u.getDate()-7),a.setDate(u.getDate()+7),d>=o&&d<=a){const t=r[d.getDay()];return n?S(e(`Weekday.Short${t}`)):E(e(`Weekday.${t}`))}}const s=d.getFullYear()!==u.getFullYear(),c=e(n?s?"formatDateScheduleYear":"formatDateSchedule":s?"chatFullDate":"chatDate")||"d MMMM yyyy";return(n?S:E)(p(e,d,c))}function p(e,t,n){const r=t.getDate(),d=t.getMonth();return n.replace("LLLL",e(o[d])).replace("MMMM",e(`Month.Gen${o[d]}`)).replace("MMM",e(`Month.Short${o[d]}`)).replace("MM",String(d+1).padStart(2,"0")).replace("dd",String(r).padStart(2,"0")).replace("d",String(r)).replace("yyyy",String(t.getFullYear()))}function g(e,t){const n="number"==typeof t?new Date(t):t;return`${m(e,n,!0)}, ${c(n)}`}function y(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%3600%60);let o="";return t>0?(o+=`${String(t).padStart(2,"0")}:`,o+=`${String(n).padStart(2,"0")}:`):o+=`${String(n)}:`,o+=String(r).padStart(2,"0"),o}function v(e){const t=[];let n=e%1e3;e-=n,n=Math.floor(n/10);const r=(e=Math.floor(e/1e3))%60;e-=r;const o=(e=Math.floor(e/60))%60;e-=o;const d=(e=Math.floor(e/60))%60;return d>0&&t.push(String(d).padStart(2,"0")),t.push(String(o).padStart(d>0?2:1,"0")),t.push(String(r).padStart(2,"0")),`${t.join(":")},${String(n).padStart(2,"0")}`}function b(e,t="en-US"){return e.toLocaleString(t,{year:"numeric",month:"short",day:"numeric"})}function w(e,t,n=2021){if(t>11||e>31)return!1;const r=new Date(n,t,e);return!Number.isNaN(r.getTime())&&r.getDate()===e}function I(e=""){const t=e.match(/\d{1,2}\s[a-zA-Z]{3,}/),n=e.match(/[a-zA-Z]{3,}\s\d{1,2}/),r=e.match(/\d{1,2}[./-]\d{1,2}([./-]\d{2,4})?/);if(!t&&!r&&!n)return;if(r){const[t,n,r]=e.split(/[./-]/).map(Number);return r&&r<2015||!w(t,n-1,r||void 0)?void 0:`${r?`${r}-`:""}${String(n).padStart(2,"0")}-${String(t).padStart(2,"0")}`}const o=e.split(" "),a=t?o[0]:o[1],u=(t?o[1]:o[0]).toLowerCase(),s=d.findIndex((e=>e.startsWith(u)));return-1!==s&&w(Number(a),s)?`${String(s+1).padStart(2,"0")}-${String(a).padStart(2,"0")}`:void 0}function C(e){return e+86400}function S(e){return`${e[0].toLowerCase()}${e.slice(1)}`}function E(e){return`${e[0].toUpperCase()}${e.slice(1)}`}},4284:(e,t,n)=>{n.d(t,{g6:()=>u,U_:()=>s,NM:()=>i});var r=n(3681);const o=["female_sign","male_sign","medical_symbol"],d=[[/\u{1f3f3}\u200d\u{1f308}/gu,"🏳️‍🌈"],[/\u{1f3f3}\u200d\u26a7\ufe0f/gu,"🏳️‍⚧️"],[/\u{1f937}\u200d\u2642/gu,"🤷‍♂️"]];function a(e){const t=e.split("-").map((e=>parseInt(e,16)));return String.fromCodePoint(...t)}function u(e){if(!e.match(r.Z))return e;for(let[t,n]of d)e=e.replace(t,n);return e}function s(e){let t;if(1===e.length)t=e.charCodeAt(0).toString(16).padStart(4,"0");else{const n=[];for(let t=0;t=55296&&e.charCodeAt(t)<=56319?e.charCodeAt(t+1)>=56320&&e.charCodeAt(t+1)<=57343&&n.push(1024*(e.charCodeAt(t)-55296)+(e.charCodeAt(t+1)-56320)+65536):(e.charCodeAt(t)<55296||e.charCodeAt(t)>57343)&&n.push(e.charCodeAt(t));t=n.map((e=>e.toString(16).padStart(4,"0"))).join("-")}return t}function i(e){const t={categories:[],emojis:{}};for(let n=0;n{n.d(t,{cL:()=>T,wZ:()=>p,vX:()=>P,op:()=>C,cj:()=>m,jm:()=>h,m5:()=>M,I_:()=>E,fl:()=>y,s$:()=>g,Mc:()=>S,wB:()=>b,p7:()=>w,$b:()=>v,mh:()=>I,s0:()=>A,aZ:()=>k,Lt:()=>f,vn:()=>i,on:()=>d});var r=n(3716);let o;function d(){return Boolean(o)}var a,u;new Promise((e=>{const t=new Image;t.src="data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA";const n=()=>{e(2===t.height)};t.onload=n,t.onerror=n})).then((e=>{o=e}));let s=null!==(a=(u=window).matchMedia)&&void 0!==a&&a.call(u,"(prefers-color-scheme: dark)").matches?"dark":"light";function i(){return s}function c(e){s=e.matches?"dark":"light"}const l=window.matchMedia("(prefers-color-scheme: dark)");"function"==typeof l.addEventListener?l.addEventListener("change",c):"function"==typeof l.addListener&&l.addListener(c);const f=function(){const{userAgent:e,platform:t}=window.navigator;let n;return-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(t)?n="macOS":-1!==["iPhone","iPad","iPod"].indexOf(t)?n="iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(t)?n="Windows":/Android/.test(e)?n="Android":/Linux/.test(t)&&(n="Linux"),n}(),h="macOS"===f,m="iOS"===f,p="Android"===f,g=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),y=window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone||document.referrer.includes("android-app://"),v=window.matchMedia("(pointer: coarse)").matches,b=window.innerWidth<=r.l3||window.innerWidth<=r.u_&&window.innerHeight<=r.rO,w=!b&&window.innerWidth<=r.ks,I=navigator.mediaDevices&&"getUserMedia"in navigator.mediaDevices&&(window.AudioContext||window.webkitAudioContext),C=(document.documentElement.style,f&&(h||m)),S="serviceWorker"in navigator,E=S,M=(window,Boolean((new Audio).canPlayType("audio/ogg; codecs=opus"))),P=!r.Cg&&"filter"in(document.createElement("canvas").getContext("2d")||{}),A=p?"slide-fade":m?"slide-layers":"push-slide",T=window.devicePixelRatio||1,k=!0},1394:(e,t,n)=>{n.d(t,{A9:()=>d,YJ:()=>a,hl:()=>u,pt:()=>s,jj:()=>i,ud:()=>c,gm:()=>l,ao:()=>f});var r=n(9118);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){const t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=atob(t[1]);let o=r.length;const d=new Uint8Array(o);for(;o--;)d[o]=r.charCodeAt(o);return new Blob([d],{type:n})}function a(e){return new Promise(((t,n)=>{const r=new FileReader;r.onload=e=>{const{result:r}=e.target||{};"string"==typeof r&&t(r),n(new Error("Failed to read blob"))},r.onerror=n,r.readAsDataURL(e)}))}function u(e,t){return new File([e],t,{lastModified:Date.now(),type:e.type})}function s(e){return new Promise(((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=n,r.src=e}))}function i(e){return new Promise(((t,n)=>{const r=document.createElement("video");r.volume=0,r.onloadedmetadata=()=>t(r),r.onerror=n,r.src=e}))}async function c(e){const t=await i(e);return Promise.race([(0,r.wO)(2e3),new Promise(((e,n)=>{t.onseeked=()=>{t.videoWidth&&t.videoHeight||e(void 0);const n=document.createElement("canvas");n.width=t.videoWidth,n.height=t.videoHeight,n.getContext("2d").drawImage(t,0,0),e(n.toDataURL("image/jpeg"))},t.onerror=n,t.currentTime=Math.min(t.duration,1)}))])}async function l(e){return(await fetch(e)).blob()}function f(e){const t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t}"undefined"==typeof File&&(self.File=class extends Blob{constructor(e,t,n){if(n){const{type:t,...r}=n;super(e,{type:t}),o(this,"name",void 0),Object.assign(this,r)}else super(e),o(this,"name",void 0);this.name=t}})},9937:(e,t,n)=>{function r(e,t,n="en"){return new Intl.NumberFormat(n,{style:"currency",currency:t}).format("JPY"===t?e:e/100)}n.d(t,{x:()=>r})},6926:(e,t,n)=>{n.d(t,{Z:()=>r});const r=e=>{let t;do{t=String(Math.random()).replace("0.","id")}while(e.hasOwnProperty(t));return t}},1947:(e,t,n)=>{n.d(t,{ZP:()=>d,J_:()=>a});const r={CHAT_RESTRICTED:"You can't send messages in this chat, you were restricted",CHAT_WRITE_FORBIDDEN:"You can't write in this chat",CHAT_SEND_POLL_FORBIDDEN:"You can't create polls in this chat",CHAT_SEND_STICKERS_FORBIDDEN:"You can't send stickers in this chat",CHAT_SEND_GIFS_FORBIDDEN:"You can't send gifs in this chat",CHAT_SEND_MEDIA_FORBIDDEN:"You can't send media in this chat",CHAT_LINK_EXISTS:"The chat is public, you can't hide the history to new users",SLOWMODE_WAIT_X:"Slowmode is enabled in this chat: you must wait for the specified number of seconds before sending another message to the chat.",USER_BANNED_IN_CHANNEL:"You're banned from sending messages in supergroups / channels",USER_IS_BLOCKED:"You were blocked by this user",YOU_BLOCKED_USER:"You blocked this user",IMAGE_PROCESS_FAILED:"Failure while processing image",MEDIA_EMPTY:"The provided media object is invalid",MEDIA_INVALID:"Media invalid",PHOTO_EXT_INVALID:"The extension of the photo is invalid",PHOTO_INVALID_DIMENSIONS:"The photo dimensions are invalid",PHOTO_SAVE_FILE_INVALID:"Internal issues, try again later",MESSAGE_DELETE_FORBIDDEN:"You can't delete one of the messages you tried to delete, most likely because it is a service message.",MESSAGE_POLL_CLOSED:"Poll closed",MESSAGE_EDIT_TIME_EXPIRED:"You can't edit this message anymore.",CHAT_ADMIN_REQUIRED:"You must be an admin in this chat to do this",PINNED_DIALOGS_TOO_MUCH:"Sorry, you can only pin 5 chats to the top",DIALOG_FILTERS_TOO_MUCH:"Sorry, you can't have more than 10 folders",CHANNEL_PRIVATE:"This channel is private",MEDIA_CAPTION_TOO_LONG:"The provided caption is too long",ADDRESS_STREET_LINE1_INVALID:"The address you provided is not valid",ADDRESS_STREET_LINE2_INVALID:"The address you provided is not valid",ADDRESS_CITY_INVALID:"The city you provided is not valid",ADDRESS_COUNTRY_INVALID:"The country you provided is not valid",ADDRESS_POSTCODE_INVALID:"The postcode you provided is not valid",ADDRESS_STATE_INVALID:"The state you provided is not valid",REQ_INFO_NAME_INVALID:"The name you provided is not valid",REQ_INFO_PHONE_INVALID:"The phone you provided is not valid",REQ_INFO_EMAIL_INVALID:"The email you provided is not valid",LINK_NOT_MODIFIED:"This discussion is already linked to the channel",MESSAGE_TOO_LONG:"Message is too long",SERVICE_WORKER_DISABLED:"Service Worker is disabled. Please reload the page without holding key.",MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS:"The provided message is too long. Please remove {EXTRA_CHARS_COUNT} character{PLURAL_S}.",FRESH_RESET_AUTHORISATION_FORBIDDEN:"You can’t logout other sessions if less than 24 hours have passed since you logged on the current session",BOTS_TOO_MUCH:"There are too many bots in this chat/channel",BOT_GROUPS_BLOCKED:"This bot can't be added to groups",USERS_TOO_MUCH:"The maximum number of users has been exceeded",USER_CHANNELS_TOO_MUCH:"One of the users you tried to add is already in too many channels/supergroups",USER_KICKED:"This user was kicked from this supergroup/channel",USER_NOT_MUTUAL_CONTACT:"The provided user is not a mutual contact",USER_PRIVACY_RESTRICTED:"The user's privacy settings do not allow you to do this",INVITE_HASH_EMPTY:"The invite hash is empty",INVITE_HASH_EXPIRED:"The invite link has expired",INVITE_HASH_INVALID:"The invite hash is invalid",CHANNELS_TOO_MUCH:"You have joined too many channels/supergroups",USER_ALREADY_PARTICIPANT:"You already in the group",SCHEDULE_DATE_INVALID:"Invalid schedule date provided",WALLPAPER_DIMENSIONS_INVALID:"The wallpaper dimensions are invalid, please select another file"},o={ADDRESS_STREET_LINE1_INVALID:{field:"streetLine1",message:"Incorrect street address"},ADDRESS_STREET_LINE2_INVALID:{field:"streetLine2",message:"Incorrect street address"},ADDRESS_CITY_INVALID:{field:"city",message:"Incorrect city"},ADDRESS_COUNTRY_INVALID:{field:"countryIso2",message:"Incorrect country"},ADDRESS_POSTCODE_INVALID:{field:"postCode",message:"Incorrect post code"},ADDRESS_STATE_INVALID:{field:"state",message:"Incorrect state"},REQ_INFO_NAME_INVALID:{field:"fullName",message:"Incorrect name"},REQ_INFO_PHONE_INVALID:{field:"phone",message:"Incorrect phone"},REQ_INFO_EMAIL_INVALID:{field:"email",message:"Incorrect email"}};function d(e){const{message:t,isSlowMode:n,textParams:o}=e;if(n){const e=t.indexOf(" (caused by");return e>0?t.substring(0,e):t}let d=r[t];return d&&o&&(d=Object.keys(o).reduce(((e,t)=>e.replace(t,o[t])),d)),d}function a(e){return o[e.message]}},3592:(e,t,n)=>{n.d(t,{S:()=>d}),n(3716);var r=n(9118);function o(e){e.preventDefault(),d(e instanceof ErrorEvent?e.error:e.reason)}function d(e){console.error(e)}window.addEventListener("error",o),window.addEventListener("unhandledrejection",o),(0,r.P2)(window.alert,1e3)},782:(e,t,n)=>{function r(e,t){return e.reduce(((e,n)=>(e[n[t]]=n,e)),{})}function o(e,t){return Object.keys(e).reduce(((n,r,o)=>(n[r]=t(e[r],r,o,e),n)),{})}function d(e,t){return t.reduce(((t,n)=>(t[n]=e[n],t)),{})}function a(e,t){return t.reduce(((t,n)=>(e[n]&&(t[n]=e[n]),t)),{})}function u(e,t){const n=new Set(t.map(String));return d(e,Object.keys(e).filter((e=>!n.has(e))))}function s(e,t,n="asc"){return e.sort(((e,r)=>{if(Array.isArray(t)){const[o,d]=Array.isArray(n)?n:[n,n],[a,u]=t;let s,i;if("function"==typeof a?(s=a(e)||0,i=a(r)||0):"string"==typeof a&&(s=e[a]||0,i=r[a]||0),s!==i)return"asc"===o?s-i:i-s;{let t,n;return"function"==typeof u?(t=u(e)||0,n=u(r)||0):"string"==typeof u&&(t=e[u]||0,n=r[u]||0),"asc"===d?t-n:n-t}}let o,d;return"function"==typeof t?(o=t(e)||0,d=t(r)||0):"string"==typeof t&&(o=e[t]||0,d=r[t]||0),"asc"===n?o-d:d-o}))}function i(e){return e.reduce(((e,t)=>Array.isArray(t)?e.concat(t):(e.push(t),e)),[])}function c(e){return Array.from(new Set(e))}function l(e){return e.filter(Boolean)}function f(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))}function h(e,t){return e[0]<=t[t.length-1]&&e[e.length-1]>=t[0]}function m(e,t){return e.filter((e=>t.has(e)))}function p(e,t){const n=[];for(let r=0;r(t[n]=g(e[n]),t)),{})}function y(e,t){let n=e.length;for(;n--;)if(t(e[n],n,e))return e[n]}n.d(t,{ee:()=>r,Q8:()=>o,ei:()=>d,q0:()=>a,CE:()=>u,Xo:()=>s,xH:()=>i,Tw:()=>c,oA:()=>l,et:()=>f,YE:()=>h,eL:()=>m,Vl:()=>p,Xh:()=>g,dF:()=>y})},663:(e,t,n)=>{n.d(t,{ll:()=>m,i0:()=>v,Pn:()=>b,m0:()=>w});var r=n(5116),o=n(3716),d=n(9524),a=n(1226),u=n(2155);const s=/%\d?\$?[sdf@]/g,i=["value","zeroValue","oneValue","twoValue","fewValue","manyValue","otherValue"],c={en:e=>1!==e?6:2,ar:e=>0===e?1:1===e?2:2===e?3:e%100>=3&&e%100<=10?4:e%100>=11?5:6,ca:e=>1!==e?6:2,de:e=>1!==e?6:2,es:e=>1!==e?6:2,fa:e=>e>1?6:2,fr:e=>e>1?6:2,id:()=>0,it:e=>1!==e?6:2,ko:()=>0,ms:()=>0,nl:e=>1!==e?6:2,pl:e=>1===e?2:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?4:5,pt_BR:e=>e>1?6:2,ru:e=>e%10==1&&e%100!=11?2:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?4:5,tr:e=>e>1?6:2,uk:e=>e%10==1&&e%100!=11?2:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?4:5,uz:e=>e>1?6:2},l=new Map;let f,h;const{addCallback:m,removeCallback:p,runCallbacks:g}=function(){const e=[];function t(t){const n=e.indexOf(t);-1!==n&&e.splice(n,1)}return{runCallbacks:function(...t){e.forEach((e=>{e(...t)}))},addCallback:function(n){return e.push(n),()=>{t(n)}},removeCallback:t}}();let y;const v=(e,t,n)=>{var r,o;if(void 0!==t){const r=Array.isArray(t)?JSON.stringify(t):t,o=l.get(`${e}_${r}_${n}`);if(o)return o}if(!f&&!h)return e;const d=(null===(r=f)||void 0===r?void 0:r[e])||(null===(o=h)||void 0===o?void 0:o[e]);return d?C(d,e,t,n):(h||I(),e)};async function b(e,t){let n=await d.fetch(o.ee,`${o.$O}_${e}_${t}`,d.Type.Json);return n||(n=await async function(e,t,n){const r=await(0,a.t9)("fetchLangStrings",{langPack:e,langCode:t,keys:[n]});if(null!=r&&r.length)return await d.save(o.ee,`${e}_${t}_${n}`,r[0]),r[0]}(o.$O,e,t)),C(n,t)}async function w(e,t,n=!1){if(f&&e===y)return void(t&&t());let u=await d.fetch(o.ee,e,d.Type.Json);if(!u&&(n&&await I(),u=await async function(e){const t=await(0,a.t9)("fetchLangPack",{sourceLangPacks:o.Bg,langCode:e});if(t)return await d.save(o.ee,e,t.langPack),t.langPack}(e),!u))return;l.clear(),y=e,f=u,document.documentElement.lang=e;const{languages:s}=(0,r.Rd)().settings.byKey,i=null==s?void 0:s.find((t=>t.langCode===e));v.isRtl=Boolean(null==i?void 0:i.rtl),v.code=e,t&&t(),g()}async function I(){h||(h=(await n.e(915).then(n.bind(n,1915))).default,g())}function C(e,t,n,r){const d=e?e["number"==typeof n?function(e){const t=y||o.sR,n=c[t]?c[t](e):0;return i[n]}(n):"value"]:void 0;if(!d||!d.trim()){const e=t.split(".");return e[e.length-1]}if(void 0!==n){const e=function(e,t){t=Array.isArray(t)?t:[t];const n=e.split(s),r=n.shift();return n.reduce(((e,n,r)=>`${e}${String(t[r]||"")}${n}`),r||"")}(d,"i"===r?(0,u.kh)(n):n),o=Array.isArray(n)?JSON.stringify(n):n;return l.set(`${t}_${o}_${r}`,e),e}return d}},647:(e,t,n)=>{n.d(t,{cC:()=>y,he:()=>p,UV:()=>g});var r=n(6137),o=n(3716),d=n(1226),a=n(9524),u=n(1394),s=n(7361);const i=48e3;async function c(e){const t=await new Response(e).arrayBuffer();return new Promise((e=>{const r=new Uint8Array(t);let o=new Worker(new URL(n.p+n.u(745),n.b)),d=new Worker(new URL(n.p+n.u(993),n.b));o.onmessage=e=>{null===e.data?d.postMessage({command:"done"}):d.postMessage({command:"encode",buffers:e.data},e.data.map((({buffer:e})=>e)))},d.onmessage=t=>{"page"===t.data.message&&(e(new Blob([t.data.page],{type:"audio/wav"})),o.terminate(),o=void 0,d.terminate(),d=void 0)},d.postMessage({command:"init",wavBitDepth:16,wavSampleRate:i}),o.postMessage({command:"init",decoderSampleRate:i,outputBufferSampleRate:i}),o.postMessage({command:"decode",pages:r},[r.buffer])}))}var l=n(862);const f={[r.IU.DataUri]:a.Type.Text,[r.IU.BlobUrl]:a.Type.Blob,[r.IU.Lottie]:a.Type.Json,[r.IU.Progressive]:void 0,[r.IU.Stream]:void 0},h=new Map,m=new Map;function p(e,t,n=!1,i){if(t===r.IU.Progressive)return s.I_?function(e){const t=`./progressive/${e}`;return h.set(e,t),Promise.resolve(t)}(e):p(e,r.IU.BlobUrl,n,i);if(!m.has(e)){const p=async function(e,t,n,i){if(!o.Cy){const r=e.startsWith("avatar")?o.SG:o.lW,d=await a.fetch(r,e,f[t],n);if(d){let t=d;if("audio/ogg"!==d.type||s.m5||(t=await c(t)),"image/webp"===d.type&&!(0,s.on)()&&t){const n=await(0,l._y)(e,t);n&&(t=n)}const n=v(t);return h.set(e,n),n}}if(t===r.IU.Stream){const n=new MediaSource,r=URL.createObjectURL(n);let o=!1;return n.addEventListener("sourceopen",(()=>{if(o)return;o=!0;const r=n.addSourceBuffer("audio/mpeg");(0,d.t9)("downloadMedia",{url:e,mediaFormat:t},((e,t)=>{i&&i(e),1===e&&n.endOfStream(),t&&r.appendBuffer(t)}))})),h.set(e,r),r}const m=await(0,d.t9)("downloadMedia",{url:e,mediaFormat:t,isHtmlAllowed:n},i);if(!m)throw new Error("Failed to fetch media");let{prepared:p,mimeType:g}=m;if("audio/ogg"===g&&!s.m5){const e=await(0,u.gm)(p);URL.revokeObjectURL(p),p=v(await c(e)),g=e.type}if("image/webp"===g&&!(0,s.on)()){const t=await(0,u.gm)(p);URL.revokeObjectURL(p);const n=await(0,l._y)(e,t);n&&(p=v(n))}return h.set(e,p),p}(e,t,n,i).catch((e=>{o.eM&&console.warn(e)})).finally((()=>{m.delete(e)}));m.set(e,p)}return m.get(e)}function g(e){return h.get(e)}function y(e){(0,d.u3)(e)}function v(e){return e instanceof Blob?URL.createObjectURL(e):e}s.I_&&navigator.serviceWorker.addEventListener("message",(async e=>{const{type:t,messageId:n,params:o}=e.data;if("requestPart"!==t)return;const a=await(0,d.t9)("downloadMedia",{mediaFormat:r.IU.Progressive,...o});if(!a)return;const{arrayBuffer:u,mimeType:s,fullSize:i}=a;navigator.serviceWorker.controller.postMessage({type:"partResponse",messageId:n,result:{arrayBuffer:u,mimeType:s,fullSize:i}},[u])}))},735:(e,t,n)=>{n.d(t,{D:()=>r});const r=[]},9203:(e,t,n)=>{n.d(t,{gl:()=>o,$y:()=>u,o5:()=>s,Qt:()=>c});var r=n(3716);let o;!function(e){e[e.Auth=0]="Auth",e[e.Main=1]="Main",e[e.Extra=2]="Extra"}(o||(o={}));const d={},a={};async function u(e,t){if(!d[e]){switch(e){case o.Auth:d[o.Auth]=n.e(133).then(n.bind(n,1133));break;case o.Main:r.eM&&console.log(">>> START LOAD MAIN BUNDLE"),d[o.Main]=Promise.all([n.e(484),n.e(433)]).then(n.bind(n,8065));break;case o.Extra:d[o.Extra]=Promise.all([n.e(484),n.e(347)]).then(n.bind(n,6347))}d[e].then(l)}const u=await d[e];return a[e]||(a[e]=u),s(e,t)}function s(e,t){const n=a[e];if(n)return n[t]}const i=[];function c(e){i.includes(e)||i.push(e)}function l(){i.forEach((e=>{e()}))}},8406:(e,t,n)=>{n.d(t,{s_:()=>v,r1:()=>I,Ld:()=>S,VL:()=>E,Vr:()=>M,KC:()=>P});var r=n(1226),o=n(6137),d=n(2864),a=n(3716),u=n(5116),s=n(2858),i=n(663),c=n(1752),l=n(8085),f=n(7361),h=n(647),m=n(9118);function p(e){const t=e.toJSON();return JSON.stringify({endpoint:t.endpoint,keys:t.keys})}function g(){return!!f.Mc&&("showNotification"in ServiceWorkerRegistration.prototype?"denied"===Notification.permission?(a.eM&&console.warn("[PUSH] The user has blocked push notifications."),!1):"PushManager"in window||(a.eM&&console.warn("[PUSH] Push messaging isn't supported."),!1):(a.eM&&console.warn("[PUSH] Push notifications aren't supported."),!1))}const y=new Set,v=(0,m.Ds)((async function(e){if(y.has(e))return;const{notificationSoundVolume:t}=(0,l.dZ)((0,u.Rd)()),n=t/10;if(0===n)return;const r=new Audio("/notification.mp3");r.volume=n,r.setAttribute("mozaudiochannel","notification"),r.addEventListener("ended",(()=>{y.add(e)}),{once:!0}),setTimeout((()=>{y.delete(e)}),3e3);try{await r.play()}catch(e){a.eM&&console.warn("[PUSH] Unable to play notification sound")}}),1e3,!0,!1);async function b(){"Notification"in window&&(["granted","denied"].includes(Notification.permission)||await Notification.requestPermission())}async function w(e){const t=(0,u.Rd)(),n=(0,u.uC)();if(e)try{const t=p(e);return await(0,r.t9)("unregisterDevice",t),await e.unsubscribe(),void n.deleteDeviceToken()}catch(e){a.eM&&console.log("[PUSH] Unable to unsubscribe from push.",e)}t.push&&(await(0,r.t9)("unregisterDevice",t.push.deviceToken),n.deleteDeviceToken())}async function I(){if(!g())return;const e=await navigator.serviceWorker.ready,t=await e.pushManager.getSubscription();await w(t)}let C=!1;async function S(){if(!g())return void await b();const e=await navigator.serviceWorker.ready;let t=await e.pushManager.getSubscription();if(function(e){const t=(0,u.Rd)();return!t.push||!e||p(e)!==t.push.deviceToken||Date.now()-t.push.subscribedAt>432e5}(t)){await w(t);try{t=await e.pushManager.subscribe({userVisibleOnly:!0});const n=p(t);a.eM&&console.log("[PUSH] Received push subscription: ",n),await(0,r.t9)("registerDevice",n),(0,u.uC)().setDeviceToken(n)}catch(e){"denied"===Notification.permission?a.eM&&console.warn("[PUSH] The user has blocked push notifications."):a.eM&&(console.log("[PUSH] Unable to subscribe to push.",e),e.code===DOMException.ABORT_ERR&&await b())}}}async function E({chat:e,message:t,isActiveChat:n}){if(!("Notification"in window?"denied"!==Notification.permission||(a.eM&&console.warn("[PUSH] The user has blocked push notifications."),0):(a.eM&&console.warn("[PUSH] This browser does not support desktop notification"),0)))return;if(!t.id)return;if(await async function(){if(C)return;const[e,t]=await Promise.all([(0,r.t9)("fetchNotificationSettings",{serverTimeOffset:(0,u.Rd)().serverTimeOffset}),(0,r.t9)("fetchNotificationExceptions",{serverTimeOffset:(0,u.Rd)().serverTimeOffset})]);if(!e)return;let n=(0,c.BI)((0,u.Rd)(),e);t&&(n=(0,c.aJ)(n,t)),(0,u.R3)(n),C=!0}(),!function(e,t){if(!C)return!1;const n=(0,u.Rd)();return!((0,s.i4)(e,(0,l.dZ)(n),(0,l.NJ)(n))||e.isNotJoined||!e.isListed||t&&document.hasFocus())}(e,n))return;const{title:f,body:m}=function(e,t){const n=(0,u.Rd)(),{senderId:r,replyToMessageId:o}=t,a=r?(0,l.dy)(n,r):void 0,c=(0,s.N5)(t),f=c&&o?(0,l.hj)(n,e.id,o):void 0,{targetUserIds:h,targetChatId:m}=c||{},p=h?h.map((e=>(0,l.dy)(n,e))).filter(Boolean):void 0,g=(0,s.zX)(e),y=g?(0,l.dy)(n,g):void 0;let v;if((0,s.Sm)(e,(0,l.dZ)(n),(0,l.NJ)(n)))if((0,s.Lo)(t)){const n=e&&((0,s.eA)(e)||t.senderId===t.chatId)?e:a;v=(0,d.D)(i.i0,t,n,p,f,m,{asPlain:!0})}else{const n=(0,s.zF)(i.i0,e.id,a),r=(0,s.MK)(i.i0,t);v=n?`${n}: ${r}`:r}else v="New message";return{title:(0,s.U)(i.i0,e,y),body:v}}(e,t),p=await async function(e){const t=(0,s.RT)(e);if(!t)return;let n=h.UV(t);return n||(await h.he(t,o.IU.BlobUrl),n=h.UV(t)),n}(e);if(g())navigator.serviceWorker.controller&&navigator.serviceWorker.controller.postMessage({type:"newMessageNotification",payload:{title:f,body:m,icon:p,chatId:e.id,messageId:t.id}});else{const n=(0,u.uC)(),r={body:m,icon:p,badge:p,tag:t.id.toString()};"vibrate"in navigator&&(r.vibrate=[200,100,200]);const o=new Notification(f,r);o.onclick=()=>{o.close(),n.focusMessage({chatId:e.id,messageId:t.id}),window.focus&&window.focus()},o.onshow=()=>{v(t.id||e.id)}}}function M(e){!a.Cg&&navigator.serviceWorker.controller&&navigator.serviceWorker.controller.postMessage({type:"closeMessageNotifications",payload:e})}function P(){navigator.serviceWorker.controller&&navigator.serviceWorker.controller.postMessage({type:"clientReady"})}},2969:(e,t,n)=>{n.d(t,{Jm:()=>d,un:()=>s,WZ:()=>i,vQ:()=>a,g3:()=>u});const r={},o=/(\d{1,3})(\d{1,3})?(\d{1,3})?(\d{1,3})?(\d{1,3})?/,d="AF🇦🇫93Afghanistan333\nAO🇦🇴244Angola333\nAL🇦🇱355Albania234\nAD🇦🇩376Andorra222\nAE🇦🇪971United Arab Emirates234\nAI🇦🇮1264Anguilla34\nAR🇦🇷54Argentina\nAM🇦🇲374Armenia233\nAG🇦🇬1268Antigua and Barbuda34\nAU🇦🇺61Australia333\nAS🇦🇸1684American Samoa34\nAT🇦🇹43Austria\nAW🇦🇼297Aruba34\nAZ🇦🇿994Azerbaijan2322\nBI🇧🇮257Burundi224\nBE🇧🇪32Belgium3222\nBJ🇧🇯229Benin233\nBF🇧🇫226Burkina Faso2222\nBD🇧🇩880Bangladesh\nBG🇧🇬359Bulgaria\nBH🇧🇭973Bahrain44\nBS🇧🇸1242Bahamas34\nBA🇧🇦387Bosnia and Herzegovina\nBY🇧🇾375Belarus2322\nBZ🇧🇿501Belize\nBO🇧🇴591Bolivia134\nBR🇧🇷55Brazil254\nBB🇧🇧1246Barbados34\nBM🇧🇲1441Bermuda34\nBN🇧🇳673Brunei34\nBQ🇧🇶599Bonaire, Sint Eustatius and Saba\nBT🇧🇹975Bhutan\nBW🇧🇼267Botswana233\nCF🇨🇫236Central African Republic2222\nCA🇨🇦1Canada334\nCH🇨🇭41Switzerland234\nCK🇨🇰682Cook Islands\nCL🇨🇱56Chile144\nCN🇨🇳86China344\nCI🇨🇮225Côte d`Ivoire233\nCM🇨🇲237Cameroon44\nCD🇨🇩243DR Congo234\nCG🇨🇬242Republic of the Congo234\nCO🇨🇴57Colombia334\nKM🇰🇲269Comoros34\nCV🇨🇻238Cape Verde34\nCR🇨🇷506Costa Rica\nCU🇨🇺53Cuba44\nCY🇨🇾357Cyprus44\nCW🇨🇼599Curaçao\nCZ🇨🇿420Czech Republic\nDE🇩🇪49Germany38\nDJ🇩🇯253Djibouti2222\nDM🇩🇲1767Dominica34\nDK🇩🇰45Denmark44\nDO🇩🇴1Dominican Republic334\nDZ🇩🇿213Algeria3222\nEC🇪🇨593Ecuador\nEG🇪🇬20Egypt234\nER🇪🇷291Eritrea133\nES🇪🇸34Spain333\nEE🇪🇪372Estonia\nET🇪🇹251Ethiopia234\nFI🇫🇮358Finland\nFJ🇫🇯679Fiji\nFK🇫🇰500Falkland Islands\nFM🇫🇲691Micronesia\nFO🇫🇴298Faroe Islands33\nFR🇫🇷33France12222\nGA🇬🇦241Gabon1222\nGB🇬🇧44United Kingdom46\nGE🇬🇪995Georgia\nGF🇬🇫594French Guiana\nGH🇬🇭233Ghana\nGI🇬🇮350Gibraltar44\nGL🇬🇱299Greenland33\nGN🇬🇳224Guinea333\nGM🇬🇲220Gambia34\nGP🇬🇵590Guadeloupe\nGU🇬🇺1671Guam34\nGW🇬🇼245Guinea-Bissau34\nGQ🇬🇶240Equatorial Guinea333\nGR🇬🇷30Greece244\nGD🇬🇩1473Grenada34\nGT🇬🇹502Guatemala134\nGY🇬🇾592Guyana\nHK🇭🇰852Hong Kong\nHN🇭🇳504Honduras44\nHR🇭🇷385Croatia\nHT🇭🇹509Haiti\nHU🇭🇺36Hungary234\nID🇮🇩62Indonesia\nIN🇮🇳91India55\nIO🇩🇬246Diego Garcia34\nIE🇮🇪353Ireland234\nIR🇮🇷98Iran334\nIQ🇮🇶964Iraq334\nIS🇮🇸354Iceland34\nIL🇮🇱972Israel234\nIT🇮🇹39Italy334\nJM🇯🇲1876Jamaica34\nJO🇯🇴962Jordan144\nJP🇯🇵81Japan244\nKZ🇰🇿7Kazakhstan3322\nKE🇰🇪254Kenya333\nKG🇰🇬996Kyrgyzstan\nKH🇰🇭855Cambodia\nKI🇰🇮686Kiribati\nKN🇰🇳1869Saint Kitts and Nevis34\nKR🇰🇷82South Korea\nKW🇰🇼965Kuwait44\nKY🇰🇾1345Cayman Islands34\nLA🇱🇦856Laos\nLB🇱🇧961Lebanon\nLR🇱🇷231Liberia\nLY🇱🇾218Libya234\nLC🇱🇨1758Saint Lucia34\nLI🇱🇮423Liechtenstein\nLK🇱🇰94Sri Lanka234\nLS🇱🇸266Lesotho233\nLT🇱🇹370Lithuania35\nLU🇱🇺352Luxembourg\nLV🇱🇻371Latvia35\nMA🇲🇦212Morocco234\nMC🇲🇨377Monaco44\nMD🇲🇩373Moldova233\nMG🇲🇬261Madagascar2232\nMP🇲🇵1670Northern Mariana Islands34\nMO🇲🇴853Macau\nMS🇲🇸1664Montserrat34\nMV🇲🇻960Maldives\nMX🇲🇽52Mexico\nMH🇲🇭692Marshall Islands\nMK🇲🇰389Macedonia\nML🇲🇱223Mali44\nMT🇲🇹356Malta2222\nMM🇲🇲95Myanmar\nME🇲🇪382Montenegro\nMN🇲🇳976Mongolia\nMZ🇲🇿258Mozambique234\nMQ🇲🇶596Martinique\nMR🇲🇷222Mauritania44\nMU🇲🇺230Mauritius\nMW🇲🇼265Malawi\nMY🇲🇾60Malaysia\nNA🇳🇦264Namibia234\nNC🇳🇨687New Caledonia6\nNE🇳🇪227Niger2222\nNF🇳🇫672Norfolk Island\nNG🇳🇬234Nigeria\nNI🇳🇮505Nicaragua44\nNL🇳🇱31Netherlands12222\nNO🇳🇴47Norway44\nNP🇳🇵977Nepal\nNU🇳🇺683Niue\nNR🇳🇷674Nauru\nNZ🇳🇿64New Zealand\nOM🇴🇲968Oman44\nPK🇵🇰92Pakistan334\nPA🇵🇦507Panama44\nPE🇵🇪51Peru333\nPF🇵🇫689French Polynesia\nPH🇵🇭63Philippines334\nPM🇵🇲508Saint Pierre and Miquelon\nPR🇵🇷1Puerto Rico334\nPS🇵🇸970Palestine324\nPW🇵🇼680Palau\nPG🇵🇬675Papua New Guinea\nPL🇵🇱48Poland333\nKP🇰🇵850North Korea\nPT🇵🇹351Portugal144\nPY🇵🇾595Paraguay333\nQA🇶🇦974Qatar\nRE🇷🇪262Réunion333\nRO🇷🇴40Romania333\nRU🇷🇺7Russia3322\nRW🇷🇼250Rwanda333\nSA🇸🇦966Saudi Arabia\nSD🇸🇩249Sudan234\nSN🇸🇳221Senegal234\nSG🇸🇬65Singapore44\nSH🇸🇭290Saint Helena23\nSH🇸🇭247Saint Helena4\nSB🇸🇧677Solomon Islands\nSL🇸🇱232Sierra Leone233\nSV🇸🇻503El Salvador44\nSM🇸🇲378San Marino334\nSO🇸🇴252Somalia233\nRS🇷🇸381Serbia234\nSS🇸🇸211South Sudan234\nST🇸🇹239São Tomé and Príncipe25\nSR🇸🇷597Suriname34\nSK🇸🇰421Slovakia\nSI🇸🇮386Slovenia\nSE🇸🇪46Sweden234\nSZ🇸🇿268Swaziland44\nSC🇸🇨248Seychelles1222\nSX🇸🇽1721Sint Maarten34\nSY🇸🇾963Syria\nTC🇹🇨1649Turks and Caicos Islands34\nTD🇹🇩235Chad2222\nTG🇹🇬228Togo233\nTH🇹🇭66Thailand144\nTJ🇹🇯992Tajikistan\nTK🇹🇰690Tokelau\nTM🇹🇲993Turkmenistan26\nTL🇹🇱670Timor-Leste\nTO🇹🇴676Tonga\nTT🇹🇹1868Trinidad and Tobago34\nTN🇹🇳216Tunisia233\nTR🇹🇷90Turkey334\nTV🇹🇻688Tuvalu\nTW🇹🇼886Taiwan\nTZ🇹🇿255Tanzania234\nUG🇺🇬256Uganda234\nUA🇺🇦380Ukraine2322\nUY🇺🇾598Uruguay44\nUS🇺🇸1United States334\nUZ🇺🇿998Uzbekistan27\nVA🇻🇦3Vatican City\nVC🇻🇨1784Saint Vincent and the Grenadines34\nVE🇻🇪58Venezuela334\nVG🇻🇬1284British Virgin Islands34\nVI🇻🇮1340US Virgin Islands34\nVN🇻🇳84Vietnam\nVU🇻🇺678Vanuatu\nWF🇼🇫681Wallis and Futuna\nWS🇼🇸685Samoa\nXK🇽🇰383Kosovo44\nYE🇾🇪967Yemen333\nZA🇿🇦27South Africa234\nZM🇿🇲260Zambia234\nZW🇿🇼263Zimbabwe234".split("\n").map((e=>({id:e.substr(0,2),flag:e.substr(2,4),code:`+${e.match(/\d+/)[0]}`,name:e.split(/\d+/)[1],phoneFormat:function(e){if(!e)return o;const t=e[0];let n;if(!r[t]){const e=t.split("").map(Number);n=e.reduce(((e,t,n)=>`${e}(\\d{1,${t}})${n>0?"?":""}`),""),r[t]=new RegExp(`${n}${"()?".repeat(5-e.length)}`)}return r[t]}(e.match(/\d+$/))})));function a(e){return d.find((t=>t.id===e))}function u(e){let t=e.replace(/[^\d+]+/g,"");t.startsWith("+")||(t=`+${t}`);const n=d.filter((e=>t.startsWith(e.code))).sort(((e,t)=>e.code.length-t.code.length));return n[n.length-1]}function s(e,t){let n=e.replace(/[^\d]+/g,"");if(t)n=n.substr(t.code.length-1);else if(e.startsWith("+"))return e;return n=n.replace(function(e){return e?e.phoneFormat:o}(t),((e,n,r,o,d,a)=>{const u=t&&"GB"===t.id?" ":"-";let s="";return n&&(s=`${n}`),r&&(s+=` ${r}`),o&&(s+=`${u}${o}`),d&&(s+=`${u}${d}`),a&&(s+=`${u}${a}`),s})),n}function i(e){const t=e.startsWith("+")?e:`+${e}`,n=u(t);return n?`${n.code} ${s(t,n)}`:t}},9118:(e,t,n)=>{function r(e,t,n=!0,r=!0){let o;return(...d)=>{o?(clearTimeout(o),o=void 0):n&&e(...d),o=self.setTimeout((()=>{r&&e(...d),o=void 0}),t)}}function o(e,t,n=!0){let r,o,d;return(...a)=>{o=!0,d=a,r||(n&&(o=!1,e(...d)),r=self.setInterval((()=>{if(!o)return self.clearInterval(r),void(r=void 0);o=!1,e(...d)}),t))}}function d(e){return u(p,e)}function a(e){return u(g,e)}function u(e,t){let n,r=!1;return(...o)=>{n=o,r||(r=!0,e((()=>{r=!1,t(...n)})))}}function s(e){Promise.resolve().then(e)}function i(e){self.requestIdleCallback?self.requestIdleCallback(e):s(e)}n.d(t,{Ds:()=>r,P2:()=>o,mS:()=>d,wT:()=>a,R3:()=>s,Q8:()=>i,wO:()=>c,Pn:()=>l,T2:()=>p,Gq:()=>y});const c=e=>new Promise((t=>{setTimeout((()=>t()),e)}));function l(){return new Promise((e=>{p(e)}))}let f,h,m;function p(e,t=!1){f?t?h.push(e):f.push(e):(f=t?[]:[e],h=t?[e]:[],requestAnimationFrame((()=>{const e=f,t=h;f=void 0,h=void 0,t.forEach((e=>e())),e.forEach((e=>e()))})))}function g(e){p(e,!0)}function y(e,t=!1){return m||(m=[],self.addEventListener("beforeunload",(()=>{m.forEach((e=>e()))}))),t?m.push(e):m.unshift(e),()=>{m=m.filter((t=>t!==e))}}},5765:(e,t,n)=>{let r;n.d(t,{Z:()=>o});try{r=new RegExp("[^\\p{L}\\p{M}]+","ui")}catch(e){r=new RegExp("[^\\wа-яё]+","i")}function o(e,t){if(!e||!t)return!1;const n=e.toLowerCase().split(r);return t.toLowerCase().split(r).every((e=>n.some((t=>t.startsWith(e)))))}},2267:(e,t,n)=>{n.d(t,{b:()=>r});const r=e=>Math.floor(Date.now()/1e3)+e},4688:(e,t,n)=>{n.d(t,{f3:()=>m,jv:()=>l,ti:()=>i,Qw:()=>h,K8:()=>f,wX:()=>c});function r(e){return new Promise(((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)}))}let o;function d(){return o||(o=function(e,t){const n=function(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let e;return new Promise((t=>{const n=()=>indexedDB.databases().finally(t);e=setInterval(n,100),n()})).finally((()=>clearInterval(e)))}().then((()=>{const e=indexedDB.open("keyval-store");return e.onupgradeneeded=()=>e.result.createObjectStore(t),r(e)}));return(e,r)=>n.then((n=>r(n.transaction(t,e).objectStore(t))))}(0,"keyval")),o}var a=n(3716),u=n(9524);const s=[1,2,3,4,5];function i(e=!1){if(e&&localStorage.getItem(a.Vx))return!0;const t=localStorage.getItem(a.b_);if(!t)return!1;try{const e=JSON.parse(t);return Boolean(e&&e.id&&e.dcID)}catch(e){return!1}}function c(e,t){const{mainDcId:n,keys:r,hashes:o}=e;localStorage.setItem(a.b_,JSON.stringify({dcID:n,id:t})),localStorage.setItem("dc",String(n)),Object.keys(r).map(Number).forEach((e=>{localStorage.setItem(`dc${e}_auth_key`,JSON.stringify(r[e]))})),Object.keys(o).map(Number).forEach((e=>{localStorage.setItem(`dc${e}_hash`,JSON.stringify(o[e]))}))}function l(){[a.b_,"dc",...s.map((e=>`dc${e}_auth_key`)),...s.map((e=>`dc${e}_hash`))].forEach((e=>{localStorage.removeItem(e)}))}function f(){if(!i())return;const e=JSON.parse(localStorage.getItem(a.b_)),t=Number(e.dcID),n={},r={};return s.forEach((e=>{try{const t=localStorage.getItem(`dc${e}_auth_key`);t&&(n[e]=JSON.parse(t));const o=localStorage.getItem(`dc${e}_hash`);o&&(r[e]=JSON.parse(o))}catch(e){a.eM&&console.warn("Failed to load stored session",e)}})),Object.keys(n).length?{mainDcId:t,keys:n,hashes:r}:void 0}async function h(){const e=localStorage.getItem(a.Vx);if(!e)return;const t=await function(e,t=d()){return t("readonly",(t=>r(t.get(e))))}(`GramJs:${e}`);try{c(JSON.parse(t))}catch(e){a.eM&&console.warn("Failed to load legacy session",e)}}async function m(){localStorage.removeItem(a.Vx);const e=await function(e=d()){const t=[];return function(e,t){return e("readonly",(e=>(e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},r(e.transaction))))}(e,(e=>t.push(e.key))).then((()=>t))}();await Promise.all([u.clear("GramJs"),...e.filter((e=>"string"==typeof e&&e.startsWith("GramJs:GramJs-session-"))).map((e=>function(e,t=d()){return t("readwrite",(t=>(t.delete(e),r(t.transaction))))}(e)))])}},6917:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(9933);const o=JSON.parse('{"--color-primary":["#50A2E9","#8378DB"],"--color-primary-opacity":["#50A2E980","#8378DB80"],"--color-primary-shade":["#4a95d6","#7b71c6"],"--color-background":["#FFFFFF","#212121"],"--color-background-secondary":["#f4f4f5","#121212"],"--color-background-secondary-accent":["#E4E4E5","#100f10"],"--color-background-own":["#EEFEDF","#8378DB"],"--color-background-own-apple":["#E7FDCC","#8378DB"],"--color-background-selected":["#F4F4F5","#2C2C2C"],"--color-background-own-selected":["#d4fcae","#7b71c6"],"--color-chat-hover":["#F4F4F5","#2C2C2C"],"--color-chat-active":["#4C90E6","#8378DB"],"--color-item-active":["#ededed","#292929"],"--color-text":["#000000","#FFFFFF"],"--color-text-secondary":["#707579","#AAAAAA"],"--color-text-secondary-apple":["#8E8E92","#AAAAAA"],"--color-borders":["#DADCE0","#303030"],"--color-borders-input":["#DADCE0","#5B5B5A"],"--color-dividers":["#C8C6CC","#404040"],"--color-links":["#52A1EF","#868DF6"],"--color-links-hover":["#2d8dec","#6b5fcc"],"--color-gray":["#C4C9CC","#717579"],"--color-pinned":["#C4C9CC","#707579"],"--color-default-shadow":["#72727240","#1010109c"],"--color-light-shadow":["#7272722B","#00000040"],"--color-green":["#4DCD5E","#8378DB"],"--color-text-meta-colored":["#4DCD5E","#8378DB"],"--color-reply-hover":["#F4F4F4","#272727"],"--color-reply-active":["#E8E9E9","#2E2F2F"],"--color-reply-own-hover":["#DBF4CE","#6458bc"],"--color-reply-own-hover-apple":["#d9f9c1","#6458bc"],"--color-reply-own-active":["#C8EBBC","#4F4A9F"],"--color-reply-own-active-apple":["#d5edc2","#4F4A9F"],"--color-accent-own":["#4FAE4E","#FFFFFF"],"--color-message-meta-own":["#4FAE4EFF","#FFFFFF88"],"--color-own-links":["#52A1EF","#FFFFFF"],"--color-code":["#4a729a","#93c4ef"],"--color-code-own":["#3c7940","#FFFFFF"],"--color-code-bg":["#70757914","#ffffff26"],"--color-code-own-bg":["#70757914","#ffffff26"]}');let d=!1;const a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,u=(e,t,n)=>(1-n)*e+n*t,s=Object.keys(o).map((e=>({property:e,colors:[c(o[e][0]),c(o[e][1])]}))),i=(e,t)=>{const n="dark"===e,o=d&&t,a=n?0:1,u=n?1:0,s=Date.now(),i=document.querySelector('meta[name="theme-color"]');document.documentElement.classList.remove("theme-"+(n?"light":"dark")),d&&document.documentElement.classList.add("no-animations"),document.documentElement.classList.add(`theme-${e}`),i&&i.setAttribute("content",n?"#212121":"#fff"),setTimeout((()=>{document.documentElement.classList.remove("no-animations")}),500),d=!0,o?(0,r.c)((()=>{const e=Math.min((Date.now()-s)/200,1);return l(a,u,function(e){return 1-(1-e)**3.5}(e)),e<1})):l(a,u)};function c(e){const t=a.exec(e);return{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16),a:void 0!==t[4]?parseInt(t[4],16):void 0}}function l(e,t,n=1){s.forEach((({property:r,colors:o})=>{const d=Math.round(u(o[e].r,o[t].r,n)),a=Math.round(u(o[e].g,o[t].g,n)),s=Math.round(u(o[e].b,o[t].b,n)),i=void 0!==o[e].a?Math.round(u(o[e].a,o[t].a,n)):void 0;document.documentElement.style.setProperty(r,void 0!==i?`rgba(${d},${a},${s},${i/255})`:`rgb(${d},${a},${s})`)}))}},2155:(e,t,n)=>{n.d(t,{kh:()=>d,bi:()=>u,Xv:()=>s});var r=n(3681),o=n(4284);function d(e){return String(e).replace(/\d(?=(\d{3})+$)/g,"$& ")}function a(e){return".0"===String(e.toFixed(1)).substr(-2)?Math.round(e):e.toFixed(1).replace(".",",")}function u(e){return e<1e3?e:e<1e6?`${a(e/1e3)}K`:`${a(e/1e6)}M`}function s(e,t=2){return e.replace(/[.,!@#$%^&*()_+=\-`~[\]/\\{}:"|<>?]+/gi,"").trim().split(/\s+/).slice(0,t).map((e=>{if(!e.length)return"";const t=(e=(0,o.g6)(e)).match(r.Z);return t&&e.startsWith(t[0])?t[0]:e.match(/./u)[0].toUpperCase()})).join("")}},8035:(e,t,n)=>{function r(e,t=30){return!e||e.length<=t?e:`${e.substr(0,t)}...`}n.d(t,{Z:()=>r})},862:(e,t,n)=>{n.d(t,{Hu:()=>s,_y:()=>i,p6:()=>c});var r=n(7361),o=n(1394),d=n(9118);let a,u;const s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";async function i(e,t){for(l();!u.wasmReady;)await(0,d.wO)(2e3);const{result:n,width:r,height:o}=await function(e,t){return new Promise((n=>{u.requests||(u.requests=new Map),u.requests.set(e,n),u.postMessage({id:e,blob:t})}))}(e,t);if(r&&o)return function({result:e,width:t,height:n}){return a||(a=document.createElement("canvas")),new Promise((r=>{const o=new ImageData(e,t,n);a.width=t,a.height=n,a.getContext("2d").putImageData(o,0,0),a.toBlob((e=>{r(null!=e?e:void 0)}),"image/png",1)}))}({result:n,width:r,height:o})}async function c(e,t){if((0,r.on)()||"data:image/webp"!==t.substr(0,15))return t;l();const n=await i(e,(0,o.A9)(t));if(!n)throw new Error(`Can't convert webp to png. Url: ${t}`);return(0,o.YJ)(n)}function l(){u||(u=new Worker(new URL(n.p+n.u(536),n.b)),u.wasmReady=!1,u.onmessage=f)}function f(e){const{id:t}=e.data;switch(e.data.type){case"initialized":u.wasmReady=!0;break;case"result":if(u.requests.has(t)){const n=u.requests.get(t);u.requests.delete(t),n(e.data)}}}},1622:(e,t,n)=>{n.d(t,{I:()=>l,p:()=>f});var r=n(3716),o=n(5116),d=n(4688);const a=["t.me","telegram.me"].map((e=>`//${e}/_websync_?`)),u=`${r.Ji} Z`,s="tgme_sync",i=()=>Math.floor(Number(new Date)/1e3);let c;const l=e=>{const t=i(),{canRedirect:n,ts:r}=JSON.parse(localStorage.getItem(s)||"{}");return n!==e||r+86400<=t?Promise.all(a.map((t=>new Promise(((n,r)=>{const o=document.createElement("script"),d=()=>!!document.body.removeChild(o);o.src=t+new URLSearchParams({authed:Number(e).toString(),version:u}),document.body.appendChild(o),o.onload=()=>{(e=>{const t=i();localStorage.setItem(s,JSON.stringify({canRedirect:e,ts:t}))})(e),d(),c&&(clearTimeout(c),c=void 0),f(),n()},o.onerror=()=>{d(),r()}}))))):Promise.resolve()};function f(){if(r.eM)return;if(void 0!==c)return;const e=i(),{ts:t}=JSON.parse(localStorage.getItem(s)||"{}"),n=86400-(e-t);c=setTimeout((()=>{const{authState:e}=(0,o.Rd)(),t="authorizationStateReady"===e||(0,d.ti)(!0);l(t)}),Math.max(0,1e3*n))}},3858:(e,t,n)=>{n.d(t,{z:()=>l,Z:()=>h});var r=n(9118),o=n(3716),d=n(7361);const a=d.wB&&f(),u=window.innerHeight;let s=l(),i=!1;const c=(0,r.P2)((()=>{s=l(),!i&&((s.width<=o.l3||s.width<=o.u_&&s.height<=o.rO)!==d.wB||d.wB&&a!==f())&&window.location.reload()}),250,!0);function l(){const e=.01*window.innerHeight;return document.documentElement.style.setProperty("--vh",`${e}px`),{width:window.innerWidth,height:window.innerHeight}}function f(){return d.cj?window.matchMedia("(orientation: landscape)").matches:window.matchMedia("screen and (min-device-aspect-ratio: 1/1) and (orientation: landscape)").matches}window.addEventListener("resize",c),window.addEventListener("orientationchange",c);const h={get:()=>s,getIsKeyboardVisible:()=>u>s.height,disableRefresh:function(){i=!0},enableRefresh:function(){i=!1}}},5359:(e,t,n)=>{e.exports=n.p+"app-inactive.bc7953c2dfebcabce2c4..png"},2162:(e,t,n)=>{e.exports=n.p+"monkey.a3d5fcdc50b18dc55695..svg"},4128:(e,t,n)=>{e.exports=n.p+"telegram-logo.df3a91becaa9678c529b..svg"}},u={};function s(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return a[e].call(n.exports,n,n.exports,s),n.exports}s.m=a,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);s.r(o);var d={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&n;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>d[e]=()=>n[e]));return d.default=()=>n,s.d(o,d),o},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>e+"."+{99:"f03a947e6e336feffec8",133:"89ca9055166cf90beaa7",161:"286d0207d962142ad548",347:"e76314e5520fe6e65783",354:"66350c1e61029fbd6ca7",433:"29f542772c88e944d938",472:"21e5264f606f2b525030",484:"40f6759b976ebb12ec3f",501:"72ce4b6e27f459e194cd",514:"c2aea8c517396debc7b4",524:"157e5943ba0ef80e2cdd",536:"55dc7dd4ab42a2c9f037",745:"9316c5c2b711c39a20a5",915:"8fb9f0f20311fa368dc5",941:"997469720d84a3a8a3f7",993:"f0aad9f6787f211b4e51"}[e]+".js",s.miniCssF=e=>e+"."+{133:"89ca9055166cf90beaa7",347:"e76314e5520fe6e65783",433:"29f542772c88e944d938",472:"21e5264f606f2b525030",484:"40f6759b976ebb12ec3f"}[e]+".css",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="telegram-t:",s.l=(e,t,o,d)=>{if(n[e])n[e].push(t);else{var a,u;if(void 0!==o)for(var i=document.getElementsByTagName("script"),c=0;c{a.onerror=a.onload=null,clearTimeout(h);var o=n[e];if(delete n[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(r))),t)return t(r)},h=setTimeout(f.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=f.bind(null,a.onerror),a.onload=f.bind(null,a.onload),u&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),o=e=>new Promise(((t,n)=>{var r=s.miniCssF(e),o=s.p+r;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),r=0;r{var o=document.createElement("link");o.rel="stylesheet",o.type="text/css",o.onerror=o.onload=d=>{if(o.onerror=o.onload=null,"load"===d.type)n();else{var a=d&&("load"===d.type?"missing":d.type),u=d&&d.target&&d.target.href||t,s=new Error("Loading CSS chunk "+e+" failed.\n("+u+")");s.code="CSS_CHUNK_LOAD_FAILED",s.type=a,s.request=u,o.parentNode.removeChild(o),r(s)}},o.href=t,document.head.appendChild(o)})(e,o,t,n)})),d={179:0},s.f.miniCss=(e,t)=>{d[e]?t.push(d[e]):0!==d[e]&&{133:1,347:1,433:1,472:1,484:1}[e]&&t.push(d[e]=o(e).then((()=>{d[e]=0}),(t=>{throw delete d[e],t})))},(()=>{s.b=document.baseURI||self.location.href;var e={179:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var d=s.p+s.u(t),a=new Error;s.l(d,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),d=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+d+")",a.name="ChunkLoadError",a.type=o,a.request=d,r[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[d,a,u]=n,i=0;for(r in a)s.o(a,r)&&(s.m[r]=a[r]);for(u&&u(s),t&&t(n);i{s(3592);var e=s(3716),t=s(5116),n=s(7361),r=s(8406);function o(n){const o=n.data;if(e.eM&&console.log("[SW] Message from worker",o),!o.type)return;const d=(0,t.uC)();switch(o.type){case"focusMessage":d.focusMessage&&d.focusMessage(o.payload);break;case"playNotificationSound":(0,r.s_)(o.payload.id)}}function d(){navigator.serviceWorker.removeEventListener("message",o),navigator.serviceWorker.addEventListener("message",o),(0,r.KC)()}n.Mc&&(window.addEventListener("load",(async()=>{try{await navigator.serviceWorker.register(new URL(s.p+s.u(524),s.b)),e.eM&&console.log("[SW] ServiceWorker registered"),await navigator.serviceWorker.ready,navigator.serviceWorker.controller?(e.eM&&console.log("[SW] ServiceWorker ready"),d()):(e.eM&&console.error("[SW] ServiceWorker not available"),n.cj||n.wZ||(0,t.uC)().showDialog({data:{message:"SERVICE_WORKER_DISABLED",hasErrorKey:!0}}))}catch(t){e.eM&&console.error("[SW] ServiceWorker registration failed: ",t)}})),window.addEventListener("focus",(async()=>{await navigator.serviceWorker.ready,d()})));var a=s(2916);const u={isLeftColumnShown:!0,isChatInfoShown:!1,newChatMembersProgress:s(1713).WB.Closed,uiReadyState:0,serverTimeOffset:0,authRememberMe:!0,blocked:{ids:[],totalCount:0},users:{byId:{}},chats:{listIds:{},isFullyLoaded:{},orderedPinnedIds:{},totalCount:{},byId:{}},messages:{byChatId:{},messageLists:[]},scheduledMessages:{byChatId:{}},chatFolders:{byId:{},activeChatFolder:0},fileUploads:{byMessageLocalId:{}},recentEmojis:["grinning","kissing_heart","christmas_tree","brain","trophy"],stickers:{setsById:{},added:{},recent:{stickers:[]},favorite:{stickers:[]},greeting:{stickers:[]},featured:{setIds:[]},search:{},forEmoji:{}},emojiKeywords:{},gifs:{saved:{},search:{}},inlineBots:{isLoading:!1,byUsername:{}},globalSearch:{},userSearch:{},localTextSearch:{byChatThreadKey:{}},localMediaSearch:{byChatId:{}},management:{byChatId:{}},topPeers:{},topInlineBots:{},mediaViewer:{},audioPlayer:{},forwardMessages:{},pollResults:{},payment:{},notifications:[],dialogs:[],activeSessions:[],settings:{byKey:{theme:"light",shouldUseSystemTheme:!0,messageTextSize:n.cj?e.b6:n.jm?e.AR:e.xS,animationLevel:e.CX,messageSendKeyCombo:"enter",shouldAutoDownloadMediaFromContacts:!0,shouldAutoDownloadMediaInPrivateChats:!0,shouldAutoDownloadMediaInGroups:!0,shouldAutoDownloadMediaInChannels:!0,hasWebNotifications:!0,hasPushNotifications:!0,notificationSoundVolume:5,shouldAutoPlayGifs:!0,shouldAutoPlayVideos:!0,shouldSuggestStickers:!0,shouldLoopStickers:!0,language:"en"},themes:{light:{isBlurred:!0,patternColor:e.g},dark:{isBlurred:!0,patternColor:e.Vv}},privacy:{},notifyExceptions:{}},twoFaSettings:{},shouldShowContextMenuHint:!0};var i=s(6137),c=s(9118),l=s(8674),f=s(782),h=s(8085),m=s(4688);const p=(0,c.P2)((()=>(0,c.Q8)(I)),5e3,!1);let g,y=!1,v=!1;function b(){y=!0,g=(0,c.Gq)(I,!0),window.addEventListener("blur",I),(0,t.ll)(p)}function w(){y=!1,(0,t.Iq)(p),window.removeEventListener("blur",I),g&&g()}function I(){if(!y||v)return;const n=(0,t.Rd)();if(n.isLoggingOut)return;const r={...u,...(0,f.ei)(n,["authState","authPhoneNumber","authRememberMe","authNearestCountry","currentUserId","contactList","topPeers","topInlineBots","recentEmojis","push","shouldShowContextMenuHint"]),isChatInfoShown:C(n),users:S(n),chats:E(n),messages:M(n),globalSearch:{recentlyFoundChatIds:n.globalSearch.recentlyFoundChatIds},settings:P(n),chatFolders:A(n)},o=JSON.stringify(r);localStorage.setItem(e.Uh,o)}function C(t){return window.innerWidth>e._m&&t.isChatInfoShown}function S(t){const{users:{byId:n,selectedId:r}}=t,o=[...(t.chats.listIds.active||[]).slice(0,e.gJ).filter((e=>e>0)),...Object.keys(n)].slice(0,e.lO);return{byId:(0,f.ei)(n,o),selectedId:window.innerWidth>e._m?r:void 0}}function E(t){const n=[...(t.chats.listIds.active||[]).slice(0,e.gJ)],{chatId:r}=(0,h.Bt)(t)||{};return{...t.chats,byId:(0,f.ei)(t.chats.byId,r?[...n,r]:n),listIds:{active:n},isFullyLoaded:{},orderedPinnedIds:{active:t.chats.orderedPinnedIds.active}}}function M(t){const r={},{chatId:o}=(0,h.Bt)(t)||{};[...(t.chats.listIds.active||[]).slice(0,e.gJ),...o?[o]:[]].forEach((e=>{const n=t.messages.byChatId[e];if(!n)return;const o=n.threadsById[i._f];o&&o.viewportIds&&(r[e]={byId:(0,f.ei)(n.byId,o.viewportIds),threadsById:{[i._f]:o}})}));const d=(0,h.Bt)(t);return{byChatId:r,messageLists:!d||n.wB?[]:[{...d,threadId:i._f,type:"thread"}]}}function P(e){const{byKey:t,themes:n}=e.settings;return{byKey:t,themes:n,privacy:{},notifyExceptions:{}}}function A(e){return{...e.chatFolders,activeChatFolder:0}}document.addEventListener(l._L,(()=>{v=!0})),document.addEventListener(l.OV,(()=>{v=!1})),e.sd||((0,t.Q6)("saveSession",(()=>{y||b()})),(0,t.Q6)("reset",(()=>{localStorage.removeItem(e.Uh),y&&w()}))),(0,t.Q6)("init",(()=>{const t=(0,f.Xh)(u);return function(t){if(!e.sd)return(0,m.ti)(!0)?(b(),function(t){e.eM&&console.time("global-state-cache-read");const n=localStorage.getItem(e.Uh),r=n?JSON.parse(n):void 0;return e.eM&&console.timeEnd("global-state-cache-read"),r&&(r.settings.byKey={...t.settings.byKey,...r.settings.byKey},r.settings.themes={...t.settings.themes,...r.settings.themes},r.chatFolders={...t.chatFolders,...r.chatFolders},r.messages.messageLists||(r.messages.messageLists=t.messages.messageLists),r.stickers.greeting||(r.stickers.greeting=t.stickers.greeting)),{...t,...r}}(t)):void w()}(t)||t}));var T=s(4050),k=s(3858);const N="tt-active-tab",R=String(Date.now()+Math.random());let L;localStorage.setItem(N,R);const D=window.setInterval((()=>{L&&localStorage.getItem(N)!==R&&(L(),clearInterval(D))}),2e3);var O=s(706),Z=(s(7895),s(3781),s(1363),s(9667),s(4907),s(6590)),x=s(8332),_=s(1212),B=s(1394);const F=["400 1em Roboto","500 1em Roboto"];function U(){if("fonts"in document)return Promise.all(F.map((e=>document.fonts.load(e))))}var $=s(647),G=s(9203),j=s(6752),W=s(4128),H=s(2162);function V(){const{listIds:e,byId:n}=(0,t.Rd)().chats;if(e.active)return Promise.all(e.active.slice(0,10).map((e=>{const t=n[e];if(!t)return;const r=(0,x.RT)(t);return r?$.he(r,i.IU.DataUri):void 0})))}const K={main:()=>Promise.all([(0,G.$y)(G.gl.Main,"Main").then(U),V()]),authPhoneNumber:()=>Promise.all([U(),(0,B.pt)(W)]),authCode:()=>(0,B.pt)(H),authPassword:()=>(0,B.pt)(H),authQrCode:U},z=(0,t.c$)((e=>{const t=(0,h.Pu)(e),{background:n,backgroundColor:r}=e.settings.themes[t]||{};return{shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations,uiReadyState:e.uiReadyState,hasCustomBackground:Boolean(n),hasCustomBackgroundColor:Boolean(r),isRightColumnShown:(0,h.Jf)(e)}}),((e,t)=>(0,f.ei)(t,["setIsUiReady"])))((({page:e,children:t,hasCustomBackground:n,hasCustomBackgroundColor:r,isRightColumnShown:o,shouldSkipHistoryAnimations:d,setIsUiReady:a})=>{const[u,s]=(0,O.Z)(),{shouldRender:i,transitionClassNames:l}=(0,_.Z)(!u,void 0,!0);return(0,T.d4)((()=>{let t;return Promise.race([(0,c.wO)(700),(async()=>{try{await K[e]()}catch(e){}})()]).then((()=>{s(),a({uiReadyState:1}),t=window.setTimeout((()=>{a({uiReadyState:2})}),1e3)})),()=>{t&&(clearTimeout(t),t=void 0),a({uiReadyState:0})}}),[]),T.ZP.createElement("div",{id:"UiLoader"},t,i&&!d&&T.ZP.createElement("div",{className:(0,j.Z)("mask",l)},"main"===e?T.ZP.createElement(T.ZP.Fragment,null,T.ZP.createElement("div",{className:"left"}),T.ZP.createElement("div",{className:(0,j.Z)("middle",n&&"custom-bg-image",r&&"custom-bg-color",o&&"with-right-column")}),o&&T.ZP.createElement("div",{className:"right"})):T.ZP.createElement("div",{className:"blank"})))}));var Q=s(2969),J=s(663),q=s(9107);const Y=(e,t)=>{const[n,r]=(0,T.eJ)();return e&&J.Pn(e,t).then(r),n};function X(){let e=navigator.language;return e&&"pt-br"!==e&&(e=e.substr(0,2)),e}var ee=s(231),te=s(4605),ne=s(7687),re=s(4288),oe=s(5765),de=s(2340),ae=s(3106),ue=s(8964),se=s(9204);const ie=200+e.fK,ce=(0,T.X$)((({id:e,value:t,isLoading:n,onChange:r})=>{const o=(0,q.Z)(),d=(0,T.sO)(null),[a,u]=(0,T.eJ)(),[s,i]=(0,T.eJ)(Q.Jm);function c(e){u(e),i(function(e=""){return e.length?Q.Jm.filter((t=>(0,oe.Z)(t.name,e))):Q.Jm}(e))}const l=(0,T.I4)((e=>{const{countryId:t}=e.currentTarget.firstElementChild.dataset,n=Q.Jm.find((e=>e.id===t));n&&r(n),setTimeout((()=>c(void 0)),ie)}),[r]),f=(0,T.I4)((e=>{c(e.currentTarget.value)}),[]),h=(0,T.I4)((e=>{if(8!==e.keyCode)return;const n=e.currentTarget;t&&void 0===a&&(n.value=""),c(n.value)}),[a,t]);return T.ZP.createElement(ae.Z,{className:"CountryCodeInput",trigger:({onTrigger:r,isOpen:u})=>{const s=()=>{if(u)return;setTimeout((()=>{d.current.select()}),50),r();const e=document.getElementById("auth-phone-number-form");e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},i=void 0!==a?a:(null==t?void 0:t.name)||"";return T.ZP.createElement("div",{className:(0,j.Z)("input-group",t&&"touched")},T.ZP.createElement("input",{ref:d,className:(0,j.Z)("form-control",u&&"focus"),type:"text",id:e,value:i,autoComplete:"off",onClick:s,onFocus:s,onInput:f,onKeyDown:h}),T.ZP.createElement("label",null,o("Login.SelectCountry.Title")),n?T.ZP.createElement(se.Z,{color:"black"}):T.ZP.createElement("i",{onClick:s,className:(0,j.Z)("css-icon-down",u&&"open")}))}},s.map((e=>T.ZP.createElement(ue.Z,{key:e.id,className:t&&e.id===t.id?"selected":"",onClick:l},T.ZP.createElement("span",{"data-country-id":e.id}),T.ZP.createElement("span",{className:"country-flag"},(0,de.Z)(e.flag,["hq_emoji"])),T.ZP.createElement("span",{className:"country-name"},e.name),T.ZP.createElement("span",{className:"country-code"},e.code)))),!s.length&&T.ZP.createElement(ue.Z,{key:"no-results",className:"no-results",disabled:!0},T.ZP.createElement("span",null,o("lng_country_none"))))}));let le=!1;const fe=(0,T.X$)((0,t.c$)((e=>{const{settings:{byKey:{language:t}}}=e;return{...(0,f.ei)(e,["connectionState","authState","authPhoneNumber","authIsLoading","authIsLoadingQrCode","authError","authRememberMe","authNearestCountry"]),language:t}}),((e,t)=>(0,f.ei)(t,["setAuthPhoneNumber","setAuthRememberMe","clearAuthError","loadNearestCountry","goToAuthQrCode","setSettingOption"])))((({connectionState:e,authState:t,authPhoneNumber:r,authIsLoading:o,authIsLoadingQrCode:d,authError:a,authRememberMe:u,authNearestCountry:s,language:i,setAuthPhoneNumber:c,setAuthRememberMe:l,loadNearestCountry:f,clearAuthError:h,goToAuthQrCode:m,setSettingOption:p})=>{const g=(0,q.Z)(),y=(0,T.sO)(null),v=X(),b=Y(v,"ContinueOnThisLanguage"),[w,I]=(0,T.eJ)(),[C,S]=(0,T.eJ)(),[E,M]=(0,T.eJ)(!1),[P,A]=(0,T.eJ)(),[k,N,R]=(0,O.Z)(),L=w?`${w.code} ${C||""}`:C,D=L&&L.replace(/[^\d]+/g,"").length>=7;(0,T.d4)((()=>{n.$b||y.current.focus()}),[w]),(0,T.d4)((()=>{"connectionStateReady"!==e||s||f()}),[e,s,f]),(0,T.d4)((()=>{!s||w||E||I((0,Q.vQ)(s))}),[w,s,E]);const Z=(0,T.I4)((e=>{e.length||S("");const t=(0,Q.g3)(e),n=!w||t&&t.id!==w.id||!t&&e.length?t:w;(!w||!n||n&&n.code!==w.code)&&I(n),S((0,Q.un)(e,n))}),[w]),x=(0,T.I4)((()=>{N(),(0,J.m0)(v,(()=>{R(),p({language:v})}))}),[N,p,v,R]);(0,T.d4)((()=>{void 0===C&&r&&Z(r)}),[r,C,Z]),(0,T.bt)((()=>{y.current&&P&&y.current.setSelectionRange(...P)}),[P]);const _=(0,T.sO)(!1),F=(0,T.I4)((()=>{_.current=!0,requestAnimationFrame((()=>{_.current=!1}))}),[]),$=(0,T.I4)((e=>{a&&h(),le||(le=!0,U(),(0,B.pt)(H));const{value:t,selectionStart:r,selectionEnd:o}=e.target;A(r&&o&&o1&&!_.current;Z(d?`${w.code} ${t}`:t)}),[a,h,w,L,Z]),G=(0,T.I4)((e=>{l(e.target.checked)}),[l]),j="authorizationStateWaitPhoneNumber"===t;return T.ZP.createElement("div",{id:"auth-phone-number-form",className:"custom-scroll"},T.ZP.createElement("div",{className:"auth-form"},T.ZP.createElement("div",{id:"logo"}),T.ZP.createElement("h2",null,"Telegram"),T.ZP.createElement("p",{className:"note"},g("StartText")),T.ZP.createElement("form",{action:"",onSubmit:function(e){e.preventDefault(),o||D&&c({phoneNumber:L})}},T.ZP.createElement(ce,{id:"sign-in-phone-code",value:w,isLoading:!s&&!w,onChange:I}),T.ZP.createElement(ne.Z,{ref:y,id:"sign-in-phone-number",label:g("Login.PhonePlaceholder"),value:L,error:a&&g(a),inputMode:"tel",onChange:$,onPaste:n.s$?F:void 0}),T.ZP.createElement(te.Z,{id:"sign-in-keep-session",label:"Keep me signed in",checked:Boolean(u),onChange:G}),D&&(j?T.ZP.createElement(ee.Z,{type:"submit",ripple:!0,isLoading:o},g("Login.Next")):T.ZP.createElement(re.Z,null)),j&&T.ZP.createElement(ee.Z,{isText:!0,ripple:!0,isLoading:d,onClick:m},g("Login.QR.Login")),v&&v!==i&&b&&T.ZP.createElement(ee.Z,{isText:!0,isLoading:k,onClick:x},b))))})));var he=s(8778);const me=(0,T.X$)((()=>{const e=(0,he.Z)(G.gl.Auth,"AuthCode");return e?T.ZP.createElement(e,null):T.ZP.createElement(re.Z,null)})),pe=(0,T.X$)((()=>{const e=(0,he.Z)(G.gl.Auth,"AuthPassword");return e?T.ZP.createElement(e,null):T.ZP.createElement(re.Z,null)})),ge=(0,T.X$)((()=>{const e=(0,he.Z)(G.gl.Auth,"AuthRegister");return e?T.ZP.createElement(e,null):T.ZP.createElement(re.Z,null)}));let ye=null;class ve{}ve.render=function(e,t){ye(e,t)},self.QrCreator=ve,function(e){function t(t,n,r,o){var d={},a=e(r,n);a.u(t),a.J(),o=o||0;var u=a.h(),s=a.h()+2*o;return d.text=t,d.level=n,d.version=r,d.O=s,d.a=function(e,t){return t-=o,!(0>(e-=o)||e>=u||0>t||t>=u)&&a.a(e,t)},d}function n(e,t,n,r,o,d,a,u,s,i){function c(t,n,r,o,a,u,s){t?(e.lineTo(n+u,r+s),e.arcTo(n,r,o,a,d)):e.lineTo(n,r)}a?e.moveTo(t+d,n):e.moveTo(t,n),c(u,r,n,r,o,-d,0),c(s,r,o,t,o,0,-d),c(i,t,o,t,n,d,0),c(a,t,n,r,n,0,d)}function r(e,t,n,r,o,d,a,u,s,i){function c(t,n,r,o){e.moveTo(t+r,n),e.lineTo(t,n),e.lineTo(t,n+o),e.arcTo(t,n,t+r,n,d)}a&&c(t,n,d,d),u&&c(r,n,-d,d),s&&c(r,o,-d,-d),i&&c(t,o,d,-d)}function o(e,o){e:{var d=o.text,a=o.v,u=o.N,s=o.K,i=o.P;for(u=Math.max(1,u||1),s=Math.min(40,s||40);u<=s;u+=1)try{var c=t(d,a,u,i);break e}catch(e){}c=void 0}if(!c)return null;for(d=e.getContext("2d"),o.background&&(d.fillStyle=o.background,d.fillRect(o.left,o.top,o.size,o.size)),a=c.O,s=o.size/a,d.beginPath(),i=0;iMath.round(e*t.size))),"linear-gradient"===r)var d=e.createLinearGradient.apply(e,n);else{if("radial-gradient"!==r)throw Error("Unsupported fill");d=e.createRadialGradient.apply(e,n)}o.forEach((([e,t])=>{d.addColorStop(e,t)})),e.fillStyle=d}}(d,o),d.fill(),e}var d={minVersion:1,maxVersion:40,ecLevel:"L",left:0,top:0,size:200,fill:"#000",background:null,text:"no text",radius:.5,quiet:0};ye=function(e,t){var n={};Object.assign(n,d,e),n.N=n.minVersion,n.K=n.maxVersion,n.v=n.ecLevel,n.left=n.left,n.top=n.top,n.size=n.size,n.fill=n.fill,n.background=n.background,n.text=n.text,n.R=n.radius,n.P=n.quiet,t instanceof HTMLCanvasElement?(t.width===n.size&&t.height===n.size||(t.width=n.size,t.height=n.size),t.getContext("2d").clearRect(0,0,t.width,t.height),o(t,n)):((e=document.createElement("canvas")).width=n.size,e.height=n.size,n=o(e,n),t.appendChild(n))}}(function(){function e(o,a){function u(e,t){for(var n=-1;7>=n;n+=1)if(!(-1>=e+n||l<=e+n))for(var r=-1;7>=r;r+=1)-1>=t+r||l<=t+r||(c[e+n][t+r]=0<=n&&6>=n&&(0==r||6==r)||0<=r&&6>=r&&(0==n||6==n)||2<=n&&4>=n&&2<=r&&4>=r)}function s(e,n){for(var a=l=4*o+17,s=Array(a),m=0;m=y;y+=1)for(var v=-2;2>=v;v+=1)c[p+y][g+v]=-2==y||2==y||-2==v||2==v||0==y&&0==v}for(a=8;as;s+=1)m=!e&&1==(a>>s&1),c[6>s?s:8>s?s+1:l-15+s][8]=m,c[8][8>s?l-s-1:9>s?15-s:14-s]=m;if(c[l-8][8]=!e,7<=o){for(a=r.A(o),s=0;18>s;s+=1)m=!e&&1==(a>>s&1),c[Math.floor(s/3)][s%3+l-8-3]=m;for(s=0;18>s;s+=1)m=!e&&1==(a>>s&1),c[s%3+l-8-3][Math.floor(s/3)]=m}if(null==f){for(e=d.I(o,i),a=function(){var e=[],t=0,n={B:function(){return e},c:function(t){return 1==(e[Math.floor(t/8)]>>>7-t%8&1)},put:function(e,t){for(var r=0;r>>t-r-1&1))},f:function(){return t},m:function(n){var r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1}};return n}(),s=0;s8*m)throw Error("code length overflow. ("+a.f()+">"+8*m+")");for(a.f()+4<=8*m&&a.put(0,4);0!=a.f()%8;)a.m(!1);for(;!(a.f()>=8*m||(a.put(236,8),a.f()>=8*m));)a.put(17,8);var b=0;for(m=s=0,p=Array(e.length),g=Array(e.length),y=0;yy;y+=1)null==c[s][g-y]&&(v=!1,p>>m&1)),n(s,g-y)&&(v=!v),c[s][g-y]=v,-1==--m&&(p+=1,m=7));if(0>(s+=a)||l<=s){s-=a,a=-a;break}}}var i=n[a],c=null,l=0,f=null,h=[],m={u:function(t){t=function(t){var n=e.s(t);return{S:function(){return 4},b:function(){return n.length},write:function(e){for(var t=0;te||l<=e||0>t||l<=t)throw Error(e+","+t);return c[e][t]},h:function(){return l},J:function(){for(var e=0,t=0,n=0;8>n;n+=1){s(!0,n);var o=r.D(m);(0==n||e>o)&&(e=o,t=n)}s(!1,t)}};return m}function t(e,n){if(void 0===e.length)throw Error(e.length+"/"+n);var r=function(){for(var t=0;td.b()-e.b())return d;for(var n=o.g(d.c(0))-o.g(e.c(0)),r=Array(d.b()),a=0;ar?t.push(r):2048>r?t.push(192|r>>6,128|63&r):55296>r||57344<=r?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t};var n={L:1,M:0,Q:3,H:2},r=function(){function e(e){for(var t=0;0!=e;)t+=1,e>>>=1;return t}var n=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]];return{w:function(t){for(var n=t<<10;0<=e(n)-e(1335);)n^=1335<t||40t?8:16},D:function(e){for(var t=e.h(),n=0,r=0;r=u;u+=1)if(!(0>r+u||t<=r+u))for(var s=-1;1>=s;s+=1)0>o+s||t<=o+s||(0!=u||0!=s)&&a==e.a(r+u,o+s)&&(d+=1);5n;n+=1)e[n]=1<n;n+=1)e[n]=e[n-4]^e[n-5]^e[n-6]^e[n-8];for(n=0;255>n;n+=1)t[e[n]]=n;return{g:function(e){if(1>e)throw Error("glog("+e+")");return t[e]},i:function(t){for(;0>t;)t+=255;for(;256<=t;)t-=255;return e[t]}}}(),d=function(){function e(e,r){switch(r){case n.L:return t[4*(e-1)];case n.M:return t[4*(e-1)+1];case n.Q:return t[4*(e-1)+2];case n.H:return t[4*(e-1)+3]}}var t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];return{I:function(t,n){var r=e(t,n);if(void 0===r)throw Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+n);t=r.length/3,n=[];for(var o=0;o{const{connectionState:t,authState:n,authQrCode:r,settings:{byKey:{language:o}}}=e;return{connectionState:t,authState:n,authQrCode:r,language:o}}),((e,t)=>(0,f.ei)(t,["returnToAuthPhoneNumber","setSettingOption"])))((({connectionState:e,authState:t,authQrCode:n,language:r,returnToAuthPhoneNumber:o,setSettingOption:d})=>{const a=X(),u=(0,q.Z)(),s=(0,T.sO)(null),i=Y(a,"ContinueOnThisLanguage"),[c,l,f]=(0,O.Z)();(0,T.d4)((()=>{if(!n||"connectionStateReady"!==e)return;const t=s.current;t.innerHTML="",t.classList.remove("pre-animate"),be.render({text:`tg://login?token=${n.token}`,radius:.5,ecLevel:"M",fill:"#4E96D4",size:280},t)}),[e,n]);const h=(0,T.I4)((()=>{l(),(0,J.m0)(a,(()=>{f(),d({language:a})}))}),[l,d,a,f]),m="authorizationStateWaitQrCode"===t;return T.ZP.createElement("div",{id:"auth-qr-form",className:"custom-scroll"},T.ZP.createElement("div",{className:"auth-form qr"},n?T.ZP.createElement("div",{key:"qr-container",className:"qr-container pre-animate",ref:s}):T.ZP.createElement("div",{key:"qr-loading",className:"qr-loading"},T.ZP.createElement(re.Z,null)),T.ZP.createElement("h3",null,u("Login.QR.Title")),T.ZP.createElement("ol",null,T.ZP.createElement("li",null,T.ZP.createElement("span",null,u("Login.QR.Help1"))),T.ZP.createElement("li",null,T.ZP.createElement("span",null,(0,de.Z)(u("Login.QR.Help2"),["simple_markdown"]))),T.ZP.createElement("li",null,T.ZP.createElement("span",null,u("Login.QR.Help3")))),m&&T.ZP.createElement(ee.Z,{isText:!0,onClick:o},u("Login.QR.Cancel")),a&&a!==r&&i&&T.ZP.createElement(ee.Z,{isText:!0,isLoading:c,onClick:h},i)))}))),Ie=(0,T.X$)((0,t.c$)((e=>(0,f.ei)(e,["authState"])),((e,t)=>(0,f.ei)(t,["reset","initApi","returnToAuthPhoneNumber","goToAuthQrCode"])))((({authState:e,reset:t,initApi:r,returnToAuthPhoneNumber:o,goToAuthQrCode:d})=>{(0,T.d4)((()=>{t(),r()}),[t,r]);const a="iOS"===n.Lt||"Android"===n.Lt;switch((0,Z.ZP)(!a&&"authorizationStateWaitPhoneNumber"===e||a&&"authorizationStateWaitQrCode"===e,(()=>{a?o():d()})),(0,T.d4)((()=>(k.Z.disableRefresh(),()=>{k.Z.enableRefresh()})),[]),e){case"authorizationStateWaitCode":return T.ZP.createElement(z,{page:"authCode",key:"authCode"},T.ZP.createElement(me,null));case"authorizationStateWaitPassword":return T.ZP.createElement(z,{page:"authPassword",key:"authPassword"},T.ZP.createElement(pe,null));case"authorizationStateWaitRegistration":return T.ZP.createElement(ge,null);case"authorizationStateWaitPhoneNumber":return T.ZP.createElement(z,{page:"authPhoneNumber",key:"authPhoneNumber"},T.ZP.createElement(fe,null));case"authorizationStateWaitQrCode":return T.ZP.createElement(z,{page:"authQrCode",key:"authQrCode"},T.ZP.createElement(we,null));default:return a?T.ZP.createElement(z,{page:"authPhoneNumber",key:"authPhoneNumber"},T.ZP.createElement(fe,null)):T.ZP.createElement(z,{page:"authQrCode",key:"authQrCode"},T.ZP.createElement(we,null))}}))),Ce=(0,T.X$)((()=>{const e=(0,he.Z)(G.gl.Main,"Main");return e?T.ZP.createElement(e,null):void 0}));var Se=s(5359);const Ee=()=>T.ZP.createElement("div",{id:"AppInactive"},T.ZP.createElement("div",{className:"content"},T.ZP.createElement("img",{src:Se,alt:""}),T.ZP.createElement("h3",{className:"title"},"Such error, many tabs"),T.ZP.createElement("div",{className:"description"},"Telegram supports only one active tab with the app.",T.ZP.createElement("br",null),"Please reload this page to continue using this tab or close it."),T.ZP.createElement("div",{className:"actions"},T.ZP.createElement(ee.Z,{isText:!0,ripple:!0,onClick:()=>{window.location.reload()}},"Reload app"))));function Me(){return t.ZP.createElement(z,{page:"main",key:"main"},t.ZP.createElement(Ce,null))}const Pe=(0,t.c$)((e=>(0,f.ei)(e,["authState"])),((e,t)=>(0,f.ei)(t,["disconnect"])))((({authState:n,disconnect:r})=>{const[o,d]=(0,O.Z)(!1);if((0,T.d4)((()=>{(0,k.z)(),L=()=>{r(),document.title=`${e.Ti}${e.ou}`,d()}}),[r,d]),o)return t.ZP.createElement(Ee,null);if(n)switch(n){case"authorizationStateWaitPhoneNumber":case"authorizationStateWaitCode":case"authorizationStateWaitPassword":case"authorizationStateWaitRegistration":case"authorizationStateWaitQrCode":return t.ZP.createElement(Ie,null);case"authorizationStateClosed":case"authorizationStateClosing":case"authorizationStateLoggingOut":case"authorizationStateReady":return Me()}return(0,m.ti)(!0)?Me():t.ZP.createElement(Ie,null)}));e.eM&&console.log(">>> INIT"),(0,t.uC)().init(),e.eM&&console.log(">>> START INITIAL RENDER"),a.Z.render(t.ZP.createElement(Pe,null),document.getElementById("root")),e.eM&&console.log(">>> FINISH INITIAL RENDER"),document.addEventListener("dblclick",(()=>{console.log("GLOBAL STATE",(0,t.Rd)())}))})()})(); -//# sourceMappingURL=main.482b1a48855e4e7aae9a.js.map \ No newline at end of file diff --git a/dist/main.482b1a48855e4e7aae9a.js.map b/dist/main.482b1a48855e4e7aae9a.js.map deleted file mode 100644 index 63b4c798..00000000 --- a/dist/main.482b1a48855e4e7aae9a.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.482b1a48855e4e7aae9a.js","mappings":"uBACIA,EADAC,ECAAC,EACAC,ECwCAC,EASAC,E,wFChCJ,IAAIC,EACJ,MAAMC,EAAgB,IAAIC,IACpBC,EAA0B,IAAID,IAI7B,SAASE,EAAQC,EAAuBC,GAe7C,OAdKN,IACCO,EAAAA,IAEFC,QAAQC,IAAI,yBAGdT,EAAS,IAAIU,OAAO,IAAIC,IAAI,mBA6ChC,SAA2BN,GACzBL,EAAOY,iBAAiB,WAAW,EAAGC,KAAAA,MACpC,GAAkB,WAAdA,EAAKC,KACPT,EAASQ,EAAKE,aACT,GAAkB,mBAAdF,EAAKC,KAA2B,CACzC,MAAME,EAAef,EAAcgB,IAAIJ,EAAKK,WACxCF,IACEH,EAAKM,MACPH,EAAaI,OAAOP,EAAKM,OAEzBH,EAAaK,QAAQR,EAAKS,gBAGzB,GAAkB,mBAAdT,EAAKC,KAA2B,SACzC,UAAAb,EAAcgB,IAAIJ,EAAKK,kBAAvB,mBAAmCK,gBAAnC,mBAAiDV,EAAKW,mBACjD,GAAkB,mBAAdX,EAAKC,KACd,MAAMD,EAAKM,SA5DbM,CAAkBpB,GAEW,QAAzBC,EAAYoB,UAuGlBC,OAAOf,iBAAiB,SAASgB,UAC/B,UACQC,QAAQC,KAAK,CACjBC,EAAY,CAAEjB,KAAM,UACpBkB,EAAAA,EAAAA,IA9HqB,KA8HOC,MAAK,IAAMJ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8lD,KAIb,OAAOtV,EAAAA,EAAAA,KAAiB,GAAQsV,KAAe,mBAAC,GAAD,SC1C7C7/E,EAAAA,IAEFC,QAAQC,IAAI,aAGdsH,EAAAA,EAAAA,MAAc4sB,OAEVp0B,EAAAA,IAEFC,QAAQC,IAAI,4BAGd+/E,EAAAA,EAAAA,OACE,mBAAC,GAAD,MACA/2E,SAASowE,eAAe,SAGtBt5E,EAAAA,IAEFC,QAAQC,IAAI,6BAGdgJ,SAAS7I,iBAAiB,YAAY,KAEpCJ,QAAQC,IAAI,gBAAgB8xB,EAAAA,EAAAA,W","sources":["webpack://telegram-t/webpack/runtime/create fake namespace object","webpack://telegram-t/webpack/runtime/load script","webpack://telegram-t/webpack/runtime/css loading","webpack://telegram-t/./src/api/gramjs/worker/provider.ts","webpack://telegram-t/./src/api/types/media.ts","webpack://telegram-t/./src/api/types/messages.ts","webpack://telegram-t/./src/lib/punycode.js","webpack://telegram-t/./src/components/common/SafeLink.tsx","webpack://telegram-t/./src/components/common/helpers/documentInfo.ts","webpack://telegram-t/./src/components/common/helpers/parseEmojiOnlyString.ts","webpack://telegram-t/./src/components/common/UserLink.tsx","webpack://telegram-t/./src/components/common/MessageLink.tsx","webpack://telegram-t/./src/components/common/ChatLink.tsx","webpack://telegram-t/./src/components/common/helpers/renderActionMessageText.tsx","webpack://telegram-t/./src/components/common/helpers/renderText.tsx","webpack://telegram-t/./src/components/middle/helpers/preventMessageInputBlur.ts","webpack://telegram-t/./src/components/middle/message/MentionLink.tsx","webpack://telegram-t/./src/components/ui/Button.tsx","webpack://telegram-t/./src/components/ui/Checkbox.tsx","webpack://telegram-t/./src/components/ui/DropdownMenu.tsx","webpack://telegram-t/./src/components/ui/InputText.tsx","webpack://telegram-t/./src/components/ui/Link.tsx","webpack://telegram-t/./src/components/ui/Loading.tsx","webpack://telegram-t/./src/components/ui/Menu.tsx","webpack://telegram-t/./src/components/ui/MenuItem.tsx","webpack://telegram-t/./src/components/ui/RippleEffect.tsx","webpack://telegram-t/./src/components/ui/Spinner.tsx","webpack://telegram-t/./src/config.ts","webpack://telegram-t/./src/hooks/useEffectWithPrevDeps.ts","webpack://telegram-t/./src/hooks/useFlag.ts","webpack://telegram-t/./src/hooks/useForceUpdate.ts","webpack://telegram-t/./src/hooks/useHeavyAnimationCheck.ts","webpack://telegram-t/./src/hooks/useHistoryBack.ts","webpack://telegram-t/./src/hooks/useKeyboardListNavigation.ts","webpack://telegram-t/./src/hooks/useLang.ts","webpack://telegram-t/./src/hooks/useModuleLoader.ts","webpack://telegram-t/./src/hooks/useOnChange.ts","webpack://telegram-t/./src/hooks/usePrevious.ts","webpack://telegram-t/./src/hooks/useShowTransition.ts","webpack://telegram-t/./src/hooks/useVirtualBackdrop.ts","webpack://telegram-t/./src/lib/teact/dom-events.ts","webpack://telegram-t/./src/lib/teact/teact-dom.ts","webpack://telegram-t/./src/lib/teact/teact.ts","webpack://telegram-t/./src/lib/teact/teactn.tsx","webpack://telegram-t/./src/lib/twemojiRegex.js","webpack://telegram-t/./src/modules/actions/api/initial.ts","webpack://telegram-t/./src/modules/actions/api/settings.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/initial.ts","webpack://telegram-t/./src/modules/actions/ui/initial.ts","webpack://telegram-t/./src/modules/actions/ui/settings.ts","webpack://telegram-t/./src/modules/helpers/chats.ts","webpack://telegram-t/./src/modules/helpers/messages.ts","webpack://telegram-t/./src/modules/helpers/messageMedia.ts","webpack://telegram-t/./src/modules/helpers/localSearch.ts","webpack://telegram-t/./src/modules/helpers/payments.ts","webpack://telegram-t/./src/modules/helpers/users.ts","webpack://telegram-t/./src/modules/reducers/chats.ts","webpack://telegram-t/./src/modules/reducers/messages.ts","webpack://telegram-t/./src/modules/reducers/symbols.ts","webpack://telegram-t/./src/modules/reducers/users.ts","webpack://telegram-t/./src/modules/reducers/globalSearch.ts","webpack://telegram-t/./src/modules/reducers/localSearch.ts","webpack://telegram-t/./src/modules/reducers/management.ts","webpack://telegram-t/./src/modules/reducers/settings.ts","webpack://telegram-t/./src/modules/reducers/twoFaSettings.ts","webpack://telegram-t/./src/modules/reducers/payments.ts","webpack://telegram-t/./src/modules/selectors/users.ts","webpack://telegram-t/./src/modules/selectors/settings.ts","webpack://telegram-t/./src/modules/selectors/chats.ts","webpack://telegram-t/./src/modules/selectors/symbols.ts","webpack://telegram-t/./src/modules/selectors/messages.ts","webpack://telegram-t/./src/modules/selectors/localSearch.ts","webpack://telegram-t/./src/modules/selectors/management.ts","webpack://telegram-t/./src/modules/selectors/ui.ts","webpack://telegram-t/./src/modules/selectors/globalSearch.ts","webpack://telegram-t/./src/modules/selectors/payments.ts","webpack://telegram-t/./src/types/index.ts","webpack://telegram-t/./src/util/animation.ts","webpack://telegram-t/./src/util/appBadge.ts","webpack://telegram-t/./src/util/arePropsShallowEqual.ts","webpack://telegram-t/./src/util/buildClassName.ts","webpack://telegram-t/./src/util/cacheApi.ts","webpack://telegram-t/./src/util/captureEscKeyListener.ts","webpack://telegram-t/./src/util/captureKeyboardListeners.ts","webpack://telegram-t/./src/util/dateFormat.ts","webpack://telegram-t/./src/util/emoji.ts","webpack://telegram-t/./src/util/environmentWebp.ts","webpack://telegram-t/./src/util/environmentSystemTheme.ts","webpack://telegram-t/./src/util/environment.ts","webpack://telegram-t/./src/util/files.ts","webpack://telegram-t/./src/util/formatCurrency.ts","webpack://telegram-t/./src/util/generateIdFor.ts","webpack://telegram-t/./src/util/getReadableErrorText.ts","webpack://telegram-t/./src/util/handleError.ts","webpack://telegram-t/./src/util/iteratees.ts","webpack://telegram-t/./src/util/langProvider.ts","webpack://telegram-t/./src/util/callbacks.ts","webpack://telegram-t/./src/util/oggToWav.ts","webpack://telegram-t/./src/util/mediaLoader.ts","webpack://telegram-t/./src/util/memo.ts","webpack://telegram-t/./src/util/moduleLoader.ts","webpack://telegram-t/./src/util/notifications.ts","webpack://telegram-t/./src/util/countries.ts","webpack://telegram-t/./src/util/phoneNumber.ts","webpack://telegram-t/./src/util/schedulers.ts","webpack://telegram-t/./src/util/searchWords.ts","webpack://telegram-t/./src/util/serverTime.ts","webpack://telegram-t/./node_modules/idb-keyval/dist/esm/index.js","webpack://telegram-t/./node_modules/safari-14-idb-fix/dist/esm/index.js","webpack://telegram-t/./src/util/sessions.ts","webpack://telegram-t/./src/util/switchTheme.ts","webpack://telegram-t/./src/util/textFormat.ts","webpack://telegram-t/./src/util/trimText.ts","webpack://telegram-t/./src/util/webpToPng.ts","webpack://telegram-t/./src/util/websync.ts","webpack://telegram-t/./src/util/windowSize.ts","webpack://telegram-t/webpack/bootstrap","webpack://telegram-t/webpack/runtime/compat get default export","webpack://telegram-t/webpack/runtime/define property getters","webpack://telegram-t/webpack/runtime/ensure chunk","webpack://telegram-t/webpack/runtime/get javascript chunk filename","webpack://telegram-t/webpack/runtime/get mini-css chunk filename","webpack://telegram-t/webpack/runtime/global","webpack://telegram-t/webpack/runtime/hasOwnProperty shorthand","webpack://telegram-t/webpack/runtime/make namespace object","webpack://telegram-t/webpack/runtime/publicPath","webpack://telegram-t/webpack/runtime/jsonp chunk loading","webpack://telegram-t/./src/util/setupServiceWorker.ts","webpack://telegram-t/./src/global/initial.ts","webpack://telegram-t/./src/global/cache.ts","webpack://telegram-t/./src/global/index.ts","webpack://telegram-t/./src/util/activeTabMonitor.ts","webpack://telegram-t/./src/util/fonts.ts","webpack://telegram-t/./src/components/common/UiLoader.tsx","webpack://telegram-t/./src/hooks/useLangString.ts","webpack://telegram-t/./src/components/auth/helpers/getSuggestedLanguage.ts","webpack://telegram-t/./src/components/auth/CountryCodeInput.tsx","webpack://telegram-t/./src/components/auth/AuthPhoneNumber.tsx","webpack://telegram-t/./src/components/auth/AuthCode.async.tsx","webpack://telegram-t/./src/components/auth/AuthPassword.async.tsx","webpack://telegram-t/./src/components/auth/AuthRegister.async.tsx","webpack://telegram-t/./node_modules/qr-creator/dist/qr-creator.es6.min.js","webpack://telegram-t/./src/components/auth/AuthQrCode.tsx","webpack://telegram-t/./src/components/auth/Auth.tsx","webpack://telegram-t/./src/components/main/Main.async.tsx","webpack://telegram-t/./src/components/main/AppInactive.tsx","webpack://telegram-t/./src/App.tsx","webpack://telegram-t/./src/index.tsx"],"sourcesContent":["var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"telegram-t:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\t;\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","var createStylesheet = (chunkId, fullhref, resolve, reject) => {\n\tvar linkTag = document.createElement(\"link\");\n\n\tlinkTag.rel = \"stylesheet\";\n\tlinkTag.type = \"text/css\";\n\tvar onLinkComplete = (event) => {\n\t\t// avoid mem leaks.\n\t\tlinkTag.onerror = linkTag.onload = null;\n\t\tif (event.type === 'load') {\n\t\t\tresolve();\n\t\t} else {\n\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\tvar realHref = event && event.target && event.target.href || fullhref;\n\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + realHref + \")\");\n\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n\t\t\terr.type = errorType;\n\t\t\terr.request = realHref;\n\t\t\tlinkTag.parentNode.removeChild(linkTag)\n\t\t\treject(err);\n\t\t}\n\t}\n\tlinkTag.onerror = linkTag.onload = onLinkComplete;\n\tlinkTag.href = fullhref;\n\n\tdocument.head.appendChild(linkTag);\n\treturn linkTag;\n};\nvar findStylesheet = (href, fullhref) => {\n\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n\tfor(var i = 0; i < existingLinkTags.length; i++) {\n\t\tvar tag = existingLinkTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return tag;\n\t}\n\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n\tfor(var i = 0; i < existingStyleTags.length; i++) {\n\t\tvar tag = existingStyleTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\");\n\t\tif(dataHref === href || dataHref === fullhref) return tag;\n\t}\n};\nvar loadStylesheet = (chunkId) => {\n\treturn new Promise((resolve, reject) => {\n\t\tvar href = __webpack_require__.miniCssF(chunkId);\n\t\tvar fullhref = __webpack_require__.p + href;\n\t\tif(findStylesheet(href, fullhref)) return resolve();\n\t\tcreateStylesheet(chunkId, fullhref, resolve, reject);\n\t});\n}\n// object to store loaded CSS chunks\nvar installedCssChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.miniCss = (chunkId, promises) => {\n\tvar cssChunks = {\"133\":1,\"347\":1,\"433\":1,\"472\":1,\"484\":1};\n\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n\t\tpromises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(() => {\n\t\t\tinstalledCssChunks[chunkId] = 0;\n\t\t}, (e) => {\n\t\t\tdelete installedCssChunks[chunkId];\n\t\t\tthrow e;\n\t\t}));\n\t}\n};\n\n// no hmr","import { ApiInitialArgs, ApiOnProgress, OnApiUpdate } from '../../types';\nimport { Methods, MethodArgs, MethodResponse } from '../methods/types';\nimport { WorkerMessageEvent, ThenArg, OriginRequest } from './types';\n\nimport { DEBUG } from '../../../config';\nimport generateIdFor from '../../../util/generateIdFor';\nimport { pause } from '../../../util/schedulers';\n\ntype RequestStates = {\n messageId: string;\n resolve: Function;\n reject: Function;\n callback?: AnyToVoidFunction;\n};\n\nconst HEALTH_CHECK_TIMEOUT = 150;\nconst HEALTH_CHECK_MIN_DELAY = 5 * 1000; // 5 sec\n\nlet worker: Worker;\nconst requestStates = new Map();\nconst requestStatesByCallback = new Map();\n\n// TODO Re-use `util/WorkerConnector.ts`\n\nexport function initApi(onUpdate: OnApiUpdate, initialArgs: ApiInitialArgs) {\n if (!worker) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START LOAD WORKER');\n }\n\n worker = new Worker(new URL('./worker.ts', import.meta.url));\n subscribeToWorker(onUpdate);\n\n if (initialArgs.platform === 'iOS') {\n setupIosHealthCheck();\n }\n }\n\n return makeRequest({\n type: 'initApi',\n args: [initialArgs],\n });\n}\n\nexport function callApi(fnName: T, ...args: MethodArgs) {\n if (!worker) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('API is not initialized');\n }\n\n return undefined;\n }\n\n return makeRequest({\n type: 'callMethod',\n name: fnName,\n args,\n }) as MethodResponse;\n}\n\nexport function cancelApiProgress(progressCallback: ApiOnProgress) {\n progressCallback.isCanceled = true;\n\n const { messageId } = requestStatesByCallback.get(progressCallback) || {};\n if (!messageId) {\n return;\n }\n\n worker.postMessage({\n type: 'cancelProgress',\n messageId,\n });\n}\n\nfunction subscribeToWorker(onUpdate: OnApiUpdate) {\n worker.addEventListener('message', ({ data }: WorkerMessageEvent) => {\n if (data.type === 'update') {\n onUpdate(data.update);\n } else if (data.type === 'methodResponse') {\n const requestState = requestStates.get(data.messageId);\n if (requestState) {\n if (data.error) {\n requestState.reject(data.error);\n } else {\n requestState.resolve(data.response);\n }\n }\n } else if (data.type === 'methodCallback') {\n requestStates.get(data.messageId)?.callback?.(...data.callbackArgs);\n } else if (data.type === 'unhandledError') {\n throw data.error;\n }\n });\n}\n\nfunction makeRequest(message: OriginRequest) {\n const messageId = generateIdFor(requestStates);\n const payload: OriginRequest = {\n messageId,\n ...message,\n };\n\n const requestState = { messageId } as RequestStates;\n\n // Re-wrap type because of `postMessage`\n const promise: Promise>> = new Promise((resolve, reject) => {\n Object.assign(requestState, { resolve, reject });\n });\n\n if (('args' in payload) && typeof payload.args[1] === 'function') {\n const callback = payload.args.pop() as AnyToVoidFunction;\n requestState.callback = callback;\n requestStatesByCallback.set(callback, requestState);\n }\n\n requestStates.set(messageId, requestState);\n promise\n .catch(() => undefined)\n .finally(() => {\n requestStates.delete(messageId);\n\n if (requestState.callback) {\n requestStatesByCallback.delete(requestState.callback);\n }\n });\n\n worker.postMessage(payload);\n\n return promise;\n}\n\nconst startedAt = Date.now();\n\n// Workaround for iOS sometimes stops interacting with worker\nfunction setupIosHealthCheck() {\n window.addEventListener('focus', async () => {\n try {\n await Promise.race([\n makeRequest({ type: 'ping' }),\n pause(HEALTH_CHECK_TIMEOUT).then(() => Promise.reject(new Error('HEALTH_CHECK_TIMEOUT'))),\n ]);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n\n if (Date.now() - startedAt >= HEALTH_CHECK_MIN_DELAY) {\n window.location.reload();\n }\n }\n });\n}\n","// We cache avatars as Data URI for faster initial load\n// and messages media as Blob for smaller size.\n\nexport enum ApiMediaFormat {\n DataUri,\n BlobUrl,\n Lottie,\n Progressive,\n Stream,\n}\n\nexport type ApiParsedMedia = string | Blob | AnyLiteral | ArrayBuffer;\nexport type ApiPreparedMedia = string | AnyLiteral;\nexport type ApiMediaFormatToPrepared = T extends ApiMediaFormat.Lottie ? AnyLiteral : string;\n","export interface ApiDimensions {\n width: number;\n height: number;\n}\n\nexport interface ApiPhotoSize extends ApiDimensions {\n type: 's' | 'm' | 'x' | 'y' | 'z';\n}\n\nexport interface ApiThumbnail extends ApiDimensions {\n dataUri: string;\n}\n\nexport interface ApiPhoto {\n id: string;\n thumbnail?: ApiThumbnail;\n sizes: ApiPhotoSize[];\n blobUrl?: string;\n}\n\nexport interface ApiSticker {\n id: string;\n stickerSetId: string;\n stickerSetAccessHash?: string;\n emoji?: string;\n isAnimated: boolean;\n width?: number;\n height?: number;\n thumbnail?: ApiThumbnail;\n isPreloadedGlobally?: boolean;\n}\n\nexport interface ApiStickerSet {\n archived?: true;\n isAnimated?: true;\n installedDate?: number;\n id: string;\n accessHash: string;\n title: string;\n hasThumbnail?: boolean;\n count: number;\n hash: number;\n stickers?: ApiSticker[];\n packs?: Record;\n covers?: ApiSticker[];\n shortName: string;\n}\n\nexport interface ApiVideo {\n id: string;\n mimeType: string;\n duration: number;\n fileName: string;\n width?: number;\n height?: number;\n supportsStreaming?: boolean;\n isRound?: boolean;\n isGif?: boolean;\n thumbnail?: ApiThumbnail;\n blobUrl?: string;\n size: number;\n}\n\nexport interface ApiAudio {\n size: number;\n mimeType: string;\n fileName: string;\n duration: number;\n performer?: string;\n title?: string;\n}\n\nexport interface ApiVoice {\n duration: number;\n waveform?: number[];\n}\n\nexport interface ApiDocument {\n id?: string;\n fileName: string;\n size: number;\n timestamp?: number;\n mimeType: string;\n thumbnail?: ApiThumbnail;\n previewBlobUrl?: string;\n mediaType?: 'photo' | 'video';\n mediaSize?: ApiDimensions;\n}\n\nexport interface ApiContact {\n firstName: string;\n lastName: string;\n phoneNumber: string;\n userId: number;\n}\n\nexport interface ApiPollAnswer {\n text: string;\n option: string;\n}\n\nexport interface ApiPollResult {\n isChosen?: true;\n isCorrect?: true;\n option: string;\n votersCount: number;\n}\n\nexport interface ApiPoll {\n id: string;\n summary: {\n closed?: true;\n isPublic?: true;\n multipleChoice?: true;\n quiz?: true;\n question: string;\n answers: ApiPollAnswer[];\n closePeriod?: number;\n closeDate?: number;\n };\n results: {\n results?: ApiPollResult[];\n totalVoters?: number;\n recentVoterIds?: number[];\n solution?: string;\n solutionEntities?: ApiMessageEntity[];\n };\n}\n\nexport interface ApiInvoice {\n text: string;\n title: string;\n photoUrl?: string;\n amount: number;\n currency: string;\n receiptMsgId?: number;\n isTest?: boolean;\n}\n\nexport type ApiNewPoll = {\n summary: ApiPoll['summary'];\n quiz?: {\n correctAnswers: string[];\n solution?: string;\n solutionEntities?: ApiMessageEntity[];\n };\n};\n\nexport interface ApiAction {\n text: string;\n targetUserIds?: number[];\n targetChatId?: number;\n type: 'historyClear' | 'contactSignUp' | 'chatCreate' | 'other';\n photo?: ApiPhoto;\n amount?: number;\n currency?: string;\n translationValues: string[];\n}\n\nexport interface ApiWebPage {\n id: number;\n url: string;\n displayUrl: string;\n type?: string;\n siteName?: string;\n title?: string;\n description?: string;\n photo?: ApiPhoto;\n duration?: number;\n document?: ApiDocument;\n video?: ApiVideo;\n}\n\nexport interface ApiMessageForwardInfo {\n isChannelPost: boolean;\n channelPostId?: number;\n isLinkedChannelPost?: boolean;\n fromChatId?: number;\n senderUserId?: number;\n fromMessageId?: number;\n hiddenUserName?: string;\n adminTitle?: string;\n}\n\nexport interface ApiMessageEntity {\n type: string;\n offset: number;\n length: number;\n userId?: number;\n url?: string;\n}\n\nexport enum ApiMessageEntityTypes {\n Bold = 'MessageEntityBold',\n Blockquote = 'MessageEntityBlockquote',\n BotCommand = 'MessageEntityBotCommand',\n Cashtag = 'MessageEntityCashtag',\n Code = 'MessageEntityCode',\n Email = 'MessageEntityEmail',\n Hashtag = 'MessageEntityHashtag',\n Italic = 'MessageEntityItalic',\n MentionName = 'MessageEntityMentionName',\n Mention = 'MessageEntityMention',\n Phone = 'MessageEntityPhone',\n Pre = 'MessageEntityPre',\n Strike = 'MessageEntityStrike',\n TextUrl = 'MessageEntityTextUrl',\n Url = 'MessageEntityUrl',\n Underline = 'MessageEntityUnderline',\n Unknown = 'MessageEntityUnknown',\n}\n\nexport interface ApiFormattedText {\n text: string;\n entities?: ApiMessageEntity[];\n}\n\nexport interface ApiMessage {\n id: number;\n chatId: number;\n content: {\n text?: ApiFormattedText;\n photo?: ApiPhoto;\n video?: ApiVideo;\n document?: ApiDocument;\n sticker?: ApiSticker;\n contact?: ApiContact;\n poll?: ApiPoll;\n action?: ApiAction;\n webPage?: ApiWebPage;\n audio?: ApiAudio;\n voice?: ApiVoice;\n invoice?: ApiInvoice;\n };\n date: number;\n isOutgoing: boolean;\n senderId?: number;\n replyToMessageId?: number;\n replyToTopMessageId?: number;\n sendingState?: 'messageSendingStatePending' | 'messageSendingStateFailed';\n forwardInfo?: ApiMessageForwardInfo;\n isDeleting?: boolean;\n previousLocalId?: number;\n views?: number;\n isEdited?: boolean;\n isMediaUnread?: boolean;\n groupedId?: string;\n isInAlbum?: boolean;\n hasUnreadMention?: boolean;\n inlineButtons?: ApiKeyboardButtons;\n keyboardButtons?: ApiKeyboardButtons;\n keyboardPlaceholder?: string;\n isKeyboardSingleUse?: boolean;\n viaBotId?: number;\n threadInfo?: ApiThreadInfo;\n adminTitle?: string;\n isScheduled?: boolean;\n shouldHideKeyboardButtons?: boolean;\n isFromScheduled?: boolean;\n}\n\nexport interface ApiThreadInfo {\n threadId: number;\n chatId: number;\n topMessageId?: number;\n originChannelId?: number;\n messagesCount: number;\n lastMessageId?: number;\n lastReadInboxMessageId?: number;\n recentReplierIds?: number[];\n}\n\nexport type ApiMessageOutgoingStatus = 'read' | 'succeeded' | 'pending' | 'failed';\n\nexport interface ApiKeyboardButton {\n type: 'command' | 'url' | 'callback' | 'requestPoll' | 'buy' | 'NOT_SUPPORTED';\n text: string;\n messageId: number;\n value?: string;\n}\n\nexport type ApiKeyboardButtons = ApiKeyboardButton[][];\nexport type ApiReplyKeyboard = {\n keyboardPlaceholder?: string;\n isKeyboardSingleUse?: boolean;\n} & {\n [K in 'inlineButtons' | 'keyboardButtons']?: ApiKeyboardButtons;\n};\n\nexport type ApiMessageSearchType = 'text' | 'media' | 'documents' | 'links' | 'audio' | 'profilePhoto';\nexport type ApiGlobalMessageSearchType = 'text' | 'media' | 'documents' | 'links' | 'audio' | 'voice';\n\nexport type ApiReportReason = 'spam' | 'violence' | 'pornography' | 'childAbuse'\n| 'copyright' | 'geoIrrelevant' | 'fake' | 'other';\n\nexport const MAIN_THREAD_ID = -1;\n\n// `Symbol` can not be transferred from worker\nexport const MESSAGE_DELETED = 'MESSAGE_DELETED';\n","/* eslint-disable no-nested-ternary */\n/* eslint-disable no-bitwise */\n\nconst utf16 = {\n // The utf16-class is necessary to convert from javascripts internal character representation to unicode and back.\n decode: (input) => {\n const output = [];\n let i = 0;\n const len = input.length;\n let value;\n let extra;\n\n while (i < len) {\n value = input.charCodeAt(i++);\n if ((value & 0xf800) === 0xd800) {\n extra = input.charCodeAt(i++);\n if ((value & 0xfc00) !== 0xd800 || (extra & 0xfc00) !== 0xdc00) {\n throw new RangeError('UTF-16(decode): Illegal UTF-16 sequence');\n }\n value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;\n }\n output.push(value);\n }\n return output;\n },\n encode: (input) => {\n const output = [];\n let i = 0;\n const len = input.length;\n let value;\n\n while (i < len) {\n value = input[i++];\n if ((value & 0xf800) === 0xd800) {\n throw new RangeError('UTF-16(encode): Illegal UTF-16 value');\n }\n if (value > 0xffff) {\n value -= 0x10000;\n output.push(String.fromCharCode(((value >>> 10) & 0x3ff) | 0xd800));\n value = 0xdc00 | (value & 0x3ff);\n }\n output.push(String.fromCharCode(value));\n }\n return output.join('');\n },\n};\n\n// Default parameters\nconst initial_n = 0x80;\nconst initial_bias = 72;\nconst delimiter = '\\x2D';\nconst base = 36;\nconst damp = 700;\nconst tmin = 1;\nconst tmax = 26;\nconst skew = 38;\nconst maxint = 0x7fffffff;\n\n// decode_digit(cp) returns the numeric value of a basic code\n// point (for use in representing integers) in the range 0 to\n// base-1, or base if cp is does not represent a value.\n\nfunction decode_digit(cp) {\n return cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 : cp - 97 < 26 ? cp - 97 : base;\n}\n\n// ** Bias adaptation function **\nfunction adapt(delta, numpoints, firsttime) {\n let k;\n delta = firsttime ? Math.floor(delta / damp) : delta >> 1;\n delta += Math.floor(delta / numpoints);\n\n for (k = 0; delta > ((base - tmin) * tmax) >> 1; k += base) {\n delta = Math.floor(delta / (base - tmin));\n }\n return Math.floor(k + ((base - tmin + 1) * delta) / (delta + skew));\n}\n\n// Main decode\nfunction decode(input, preserveCase) {\n // Dont use utf16\n const output = [];\n const case_flags = [];\n const input_length = input.length;\n\n let n; let out; let i; let bias; let basic; let j; let ic; let oldi; let w; let k; let digit; let t; let len;\n\n // Initialize the state:\n\n n = initial_n;\n i = 0;\n bias = initial_bias;\n\n // Handle the basic code points: Let basic be the number of input code\n // points before the last delimiter, or 0 if there is none, then\n // copy the first basic code points to the output.\n\n basic = input.lastIndexOf(delimiter);\n if (basic < 0) basic = 0;\n\n for (j = 0; j < basic; ++j) {\n if (preserveCase) case_flags[output.length] = input.charCodeAt(j) - 65 < 26;\n if (input.charCodeAt(j) >= 0x80) {\n throw new RangeError('Illegal input >= 0x80');\n }\n output.push(input.charCodeAt(j));\n }\n\n // Main decoding loop: Start just after the last delimiter if any\n // basic code points were copied; start at the beginning otherwise.\n\n for (ic = basic > 0 ? basic + 1 : 0; ic < input_length;) {\n // ic is the index of the next character to be consumed,\n\n // Decode a generalized variable-length integer into delta,\n // which gets added to i. The overflow checking is easier\n // if we increase i as we go, then subtract off its starting\n // value at the end to obtain delta.\n for (oldi = i, w = 1, k = base; ; k += base) {\n if (ic >= input_length) {\n throw RangeError('punycode_bad_input(1)');\n }\n digit = decode_digit(input.charCodeAt(ic++));\n\n if (digit >= base) {\n throw RangeError('punycode_bad_input(2)');\n }\n if (digit > Math.floor((maxint - i) / w)) {\n throw RangeError('punycode_overflow(1)');\n }\n i += digit * w;\n t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;\n if (digit < t) {\n break;\n }\n if (w > Math.floor(maxint / (base - t))) {\n throw RangeError('punycode_overflow(2)');\n }\n w *= base - t;\n }\n\n out = output.length + 1;\n bias = adapt(i - oldi, out, oldi === 0);\n\n // i was supposed to wrap around from out to 0,\n // incrementing n each time, so we'll fix that now:\n if (Math.floor(i / out) > maxint - n) {\n throw RangeError('punycode_overflow(3)');\n }\n n += Math.floor(i / out);\n i %= out;\n\n // Insert n at position i of the output:\n // Case of last character determines uppercase flag:\n if (preserveCase) {\n case_flags.splice(i, 0, input.charCodeAt(ic - 1) - 65 < 26);\n }\n\n output.splice(i, 0, n);\n i++;\n }\n if (preserveCase) {\n for (i = 0, len = output.length; i < len; i++) {\n if (case_flags[i]) {\n output[i] = String.fromCharCode(output[i])\n .toUpperCase()\n .charCodeAt(0);\n }\n }\n }\n return utf16.encode(output);\n}\n\nfunction toUnicode(domain) {\n const domain_array = domain.split('.');\n const out = [];\n for (let i = 0; i < domain_array.length; ++i) {\n const s = domain_array[i];\n out.push(s.match(/^xn--/) ? decode(s.slice(4)) : s);\n }\n return out.join('.');\n}\n\nexport default toUnicode;\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\nimport { getDispatch } from '../../lib/teact/teactn';\nimport convertPunycode from '../../lib/punycode';\n\nimport { DEBUG, RE_TME_INVITE_LINK, RE_TME_LINK } from '../../config';\nimport buildClassName from '../../util/buildClassName';\n\ntype OwnProps = {\n url?: string;\n text: string;\n className?: string;\n children?: any;\n isRtl?: boolean;\n};\n\nconst SafeLink: FC = ({\n url,\n text,\n className,\n children,\n isRtl,\n}) => {\n const { toggleSafeLinkModal, openTelegramLink } = getDispatch();\n\n const content = children || text;\n const isNotSafe = url !== content;\n\n const handleClick = useCallback((e: React.MouseEvent) => {\n if (\n e.ctrlKey || e.altKey || e.shiftKey || e.metaKey\n || !url || (!url.match(RE_TME_LINK) && !url.match(RE_TME_INVITE_LINK))\n ) {\n if (isNotSafe) {\n toggleSafeLinkModal({ url });\n\n e.preventDefault();\n return false;\n }\n\n return true;\n }\n\n e.preventDefault();\n openTelegramLink({ url });\n\n return false;\n }, [isNotSafe, openTelegramLink, toggleSafeLinkModal, url]);\n\n if (!url) {\n return undefined;\n }\n\n const classNames = buildClassName(\n className || 'text-entity-link',\n text.length > 50 && 'long-word-break-all',\n );\n\n return (\n \n {content}\n
\n );\n};\n\nfunction ensureProtocol(url?: string) {\n if (!url) {\n return undefined;\n }\n\n return url.includes('://') ? url : `https://${url}`;\n}\n\nfunction getDomain(url?: string) {\n if (!url) {\n return undefined;\n }\n\n const href = ensureProtocol(url);\n if (!href) {\n return undefined;\n }\n\n try {\n let decodedHref = decodeURI(href);\n\n const match = decodedHref.match(/^https?:\\/\\/([^/:?#]+)(?:[/:?#]|$)/i);\n if (!match) {\n return undefined;\n }\n const domain = match[1];\n decodedHref = decodedHref.replace(domain, convertPunycode(domain));\n\n return decodedHref;\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('SafeLink.getDecodedUrl error ', url, error);\n }\n }\n\n return undefined;\n}\n\nexport default memo(SafeLink);\n","import { ApiDocument } from '../../../api/types';\n\nconst ONE_GIGABYTE = 1024 * 1024 * 1024;\nconst ONE_MEGABYTE = 1024 * 1024;\n\nexport function getFileSizeString(bytes: number) {\n if (bytes > (ONE_GIGABYTE / 2)) {\n return `${(bytes / ONE_GIGABYTE).toFixed(1)} GB`;\n }\n if (bytes > (ONE_MEGABYTE / 2)) {\n return `${(bytes / ONE_MEGABYTE).toFixed(1)} MB`;\n }\n return `${(bytes / (1024)).toFixed(1)} KB`;\n}\n\nexport function getDocumentExtension(document: ApiDocument) {\n const { fileName, mimeType } = document;\n\n return getFileExtension(fileName, mimeType);\n}\n\nexport function getFileExtension(fileName: string, mimeType: string) {\n if (fileName && fileName.indexOf('.') !== -1) {\n return fileName.split('.').pop();\n } else {\n return mimeType.split('/').pop();\n }\n}\n\nexport function getColorFromExtension(extension: string) {\n switch (extension) {\n case 'apk':\n case 'xls':\n case 'xlsx':\n return 'green';\n case 'zip':\n case 'rar':\n case '7z':\n case 'tar':\n case 'gz':\n case 'ppt':\n case 'pptx':\n return 'orange';\n case 'pdf':\n case 'xps':\n return 'red';\n default:\n return 'default';\n }\n}\n\nexport function getDocumentHasPreview(document: ApiDocument) {\n return Boolean(document.previewBlobUrl || document.thumbnail);\n}\n","// @ts-ignore\nimport twemojiRegex from '../../../lib/twemojiRegex';\n\nconst DETECT_UP_TO = 3;\nconst MAX_LENGTH = DETECT_UP_TO * 8; // Maximum 8 per one emoji.\nconst RE_EMOJI_ONLY = new RegExp(`^(?:${twemojiRegex.source})+$`, '');\n\nexport default (text: string): number | false => {\n if (text.length > MAX_LENGTH) {\n return false;\n }\n\n const isEmojiOnly = Boolean(text.match(RE_EMOJI_ONLY));\n if (!isEmojiOnly) {\n return false;\n }\n\n let emojiCount = 0;\n while (twemojiRegex.exec(text)) {\n emojiCount++;\n\n if (emojiCount > DETECT_UP_TO) {\n twemojiRegex.lastIndex = 0;\n return false;\n }\n }\n\n return emojiCount;\n};\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat, ApiUser } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\n\ntype OwnProps = {\n className?: string;\n sender?: ApiUser | ApiChat;\n children: any;\n};\n\ntype DispatchProps = Pick;\n\nconst UserLink: FC = ({\n className, sender, openUserInfo, children,\n}) => {\n const handleClick = useCallback(() => {\n if (sender) {\n openUserInfo({ id: sender.id });\n }\n }, [sender, openUserInfo]);\n\n if (!sender) {\n return children;\n }\n\n return (\n {children}\n );\n};\n\nexport default withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['openUserInfo']),\n)(UserLink);\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiMessage } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\n\ntype OwnProps = {\n className?: string;\n message?: ApiMessage;\n children: any;\n};\n\ntype DispatchProps = Pick;\n\nconst MessageLink: FC = ({\n className, message, children, focusMessage,\n}) => {\n const handleMessageClick = useCallback((): void => {\n if (message) {\n focusMessage({ chatId: message.chatId, messageId: message.id });\n }\n }, [focusMessage, message]);\n\n if (!message) {\n return children;\n }\n\n return (\n {children}\n );\n};\n\nexport default withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['focusMessage']),\n)(MessageLink);\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\n\ntype OwnProps = {\n className?: string;\n chatId?: number;\n children: any;\n};\n\ntype DispatchProps = Pick;\n\nconst ChatLink: FC = ({\n className, chatId, openChat, children,\n}) => {\n const handleClick = useCallback(() => {\n if (chatId) {\n openChat({ id: chatId });\n }\n }, [chatId, openChat]);\n\n if (!chatId) {\n return children;\n }\n\n return (\n {children}\n );\n};\n\nexport default withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['openChat']),\n)(ChatLink);\n","import React from '../../../lib/teact/teact';\n\nimport { ApiChat, ApiMessage, ApiUser } from '../../../api/types';\nimport { LangFn } from '../../../hooks/useLang';\nimport {\n getChatTitle,\n getMessageContent,\n getMessageSummaryText,\n getUserFullName,\n isChat,\n} from '../../../modules/helpers';\nimport trimText from '../../../util/trimText';\nimport { formatCurrency } from '../../../util/formatCurrency';\nimport { TextPart } from './renderMessageText';\nimport renderText from './renderText';\n\nimport UserLink from '../UserLink';\nimport MessageLink from '../MessageLink';\nimport ChatLink from '../ChatLink';\n\ninterface ActionMessageTextOptions {\n maxTextLength?: number;\n asPlain?: boolean;\n isEmbedded?: boolean;\n}\n\nconst NBSP = '\\u00A0';\n\nexport function renderActionMessageText(\n lang: LangFn,\n message: ApiMessage,\n actionOrigin?: ApiUser | ApiChat,\n targetUsers?: ApiUser[],\n targetMessage?: ApiMessage,\n targetChatId?: number,\n options: ActionMessageTextOptions = {},\n) {\n if (!message.content.action) {\n return [];\n }\n const {\n text, translationValues, amount, currency,\n } = message.content.action;\n const content: TextPart[] = [];\n const textOptions: ActionMessageTextOptions = { ...options, maxTextLength: 32 };\n const translationKey = text === 'Chat.Service.Group.UpdatedPinnedMessage1' && !targetMessage\n ? 'Message.PinnedGenericMessage'\n : text;\n\n let unprocessed = lang(translationKey, translationValues && translationValues.length ? translationValues : undefined);\n let processed: TextPart[];\n\n if (unprocessed.includes('%payment_amount%')) {\n processed = processPlaceholder(\n unprocessed,\n '%payment_amount%',\n formatCurrency(amount!, currency, lang.code),\n );\n unprocessed = processed.pop() as string;\n content.push(...processed);\n }\n\n processed = processPlaceholder(\n unprocessed,\n '%action_origin%',\n actionOrigin\n ? (!options.isEmbedded && renderOriginContent(lang, actionOrigin, options.asPlain)) || NBSP\n : 'User',\n );\n\n unprocessed = processed.pop() as string;\n content.push(...processed);\n\n processed = processPlaceholder(\n unprocessed,\n '%target_user%',\n targetUsers\n ? targetUsers.map((user) => renderUserContent(user, options.asPlain)).filter(Boolean as any)\n : 'User',\n );\n\n unprocessed = processed.pop() as string;\n content.push(...processed);\n\n processed = processPlaceholder(\n unprocessed,\n '%message%',\n targetMessage\n ? renderMessageContent(lang, targetMessage, textOptions)\n : 'a message',\n );\n unprocessed = processed.pop() as string;\n content.push(...processed);\n\n processed = processPlaceholder(\n unprocessed,\n '%product%',\n targetMessage\n ? renderProductContent(targetMessage)\n : 'a product',\n );\n unprocessed = processed.pop() as string;\n content.push(...processed);\n\n processed = processPlaceholder(\n unprocessed,\n '%target_chat%',\n targetChatId\n ? renderMigratedContent(targetChatId, options.asPlain)\n : 'another chat',\n );\n content.push(...processed);\n\n if (options.asPlain) {\n return content.join('').trim();\n }\n\n return content;\n}\n\nfunction renderProductContent(message: ApiMessage) {\n return message.content && message.content.invoice\n ? message.content.invoice.title\n : 'a product';\n}\n\nfunction renderMessageContent(lang: LangFn, message: ApiMessage, options: ActionMessageTextOptions = {}) {\n const text = getMessageSummaryText(lang, message);\n const {\n photo, video, document, sticker,\n } = getMessageContent(message);\n\n const { maxTextLength, isEmbedded, asPlain } = options;\n\n const showQuotes = isEmbedded && text && !photo && !video && !document && !sticker;\n let messageText = trimText(text as string, maxTextLength)!;\n\n if (isEmbedded) {\n if (photo) {\n messageText = 'a photo';\n } else if (video) {\n messageText = video.isGif ? 'a GIF' : 'a video';\n } else if (document) {\n messageText = 'a document';\n } else if (sticker) {\n messageText = text;\n }\n }\n\n if (asPlain) {\n return showQuotes ? `«${messageText}»` : messageText;\n }\n\n if (showQuotes) {\n return (\n \n «\n {renderText(messageText)}\n »\n \n );\n }\n\n return (\n {renderText(messageText)}\n );\n}\n\nfunction renderOriginContent(lang: LangFn, origin: ApiUser | ApiChat, asPlain?: boolean) {\n return isChat(origin)\n ? renderChatContent(lang, origin, asPlain)\n : renderUserContent(origin, asPlain);\n}\n\nfunction renderUserContent(sender: ApiUser, asPlain?: boolean): string | TextPart | undefined {\n const text = trimText(getUserFullName(sender));\n\n if (asPlain) {\n return text;\n }\n\n return {sender && renderText(text!)};\n}\n\nfunction renderChatContent(lang: LangFn, chat: ApiChat, asPlain?: boolean): string | TextPart | undefined {\n const text = trimText(getChatTitle(lang, chat));\n\n if (asPlain) {\n return text;\n }\n\n return {chat && renderText(text!)};\n}\n\nfunction renderMigratedContent(chatId: number, asPlain?: boolean): string | TextPart | undefined {\n const text = 'another chat';\n\n if (asPlain) {\n return text;\n }\n\n return {text};\n}\n\nfunction processPlaceholder(text: string, placeholder: string, replaceValue?: TextPart | TextPart[]): TextPart[] {\n const placeholderPosition = text.indexOf(placeholder);\n if (placeholderPosition < 0 || !replaceValue) {\n return [text];\n }\n\n const content: TextPart[] = [];\n content.push(text.substring(0, placeholderPosition));\n if (Array.isArray(replaceValue)) {\n replaceValue.forEach((value, index) => {\n content.push(value);\n if (index + 1 < replaceValue.length) {\n content.push(', ');\n }\n });\n } else {\n content.push(replaceValue);\n }\n content.push(text.substring(placeholderPosition + placeholder.length));\n\n return content;\n}\n","import React from '../../../lib/teact/teact';\nimport EMOJI_REGEX, { removeVS16s } from '../../../lib/twemojiRegex';\n\nimport { RE_LINK_TEMPLATE, RE_MENTION_TEMPLATE } from '../../../config';\nimport { IS_EMOJI_SUPPORTED } from '../../../util/environment';\nimport { fixNonStandardEmoji, nativeToUnified } from '../../../util/emoji';\nimport buildClassName from '../../../util/buildClassName';\n\nimport MentionLink from '../../middle/message/MentionLink';\nimport SafeLink from '../SafeLink';\n\ntype TextPart = string | Element;\n\nconst RE_LETTER_OR_DIGIT = /^[\\d\\wа-яё]$/i;\nconst SIMPLE_MARKDOWN_REGEX = /(\\*\\*|__).+?\\1/g;\n\nexport default function renderText(\n part: TextPart,\n filters: Array<(\n 'escape_html' | 'hq_emoji' | 'emoji' | 'emoji_html' | 'br' | 'br_html' | 'highlight' | 'links' |\n 'simple_markdown' | 'simple_markdown_html'\n )> = ['emoji'],\n params?: { highlight: string | undefined },\n): TextPart[] {\n if (typeof part !== 'string') {\n return [part];\n }\n\n return filters.reduce((text, filter) => {\n switch (filter) {\n case 'escape_html':\n return escapeHtml(text);\n\n case 'hq_emoji':\n EMOJI_REGEX.lastIndex = 0;\n return replaceEmojis(text, 'big', 'jsx');\n\n case 'emoji':\n EMOJI_REGEX.lastIndex = 0;\n return replaceEmojis(text, 'small', 'jsx');\n\n case 'emoji_html':\n EMOJI_REGEX.lastIndex = 0;\n return replaceEmojis(text, 'small', 'html');\n\n case 'br':\n return addLineBreaks(text, 'jsx');\n\n case 'br_html':\n return addLineBreaks(text, 'html');\n\n case 'highlight':\n return addHighlight(text, params!.highlight);\n\n case 'links':\n return addLinks(text);\n\n case 'simple_markdown':\n return replaceSimpleMarkdown(text, 'jsx');\n\n case 'simple_markdown_html':\n return replaceSimpleMarkdown(text, 'html');\n }\n\n return text;\n }, [part] as TextPart[]);\n}\n\nfunction escapeHtml(textParts: TextPart[]): TextPart[] {\n const divEl = document.createElement('div');\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string') {\n return [...result, part];\n }\n\n divEl.innerText = part;\n\n return [...result, divEl.innerHTML];\n }, [] as TextPart[]);\n}\n\nfunction replaceEmojis(textParts: TextPart[], size: 'big' | 'small', type: 'jsx' | 'html'): TextPart[] {\n if (IS_EMOJI_SUPPORTED) {\n return textParts;\n }\n\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string') {\n return [...result, part];\n }\n\n part = fixNonStandardEmoji(part);\n const parts = part.split(EMOJI_REGEX);\n const emojis = part.match(EMOJI_REGEX) || [];\n result.push(parts[0]);\n\n return emojis.reduce((emojiResult: TextPart[], emoji, i) => {\n const code = nativeToUnified(removeVS16s(emoji));\n if (!code) return emojiResult;\n const className = buildClassName(\n 'emoji',\n size === 'small' && 'emoji-small',\n );\n if (type === 'jsx') {\n emojiResult.push(\n ,\n );\n }\n if (type === 'html') {\n emojiResult.push(\n // For preventing extra spaces in html\n // eslint-disable-next-line max-len\n `\"${emoji}\"`,\n );\n }\n\n const index = i * 2 + 2;\n if (parts[index]) {\n emojiResult.push(parts[index]);\n }\n\n return emojiResult;\n }, result);\n }, [] as TextPart[]);\n}\n\nfunction addLineBreaks(textParts: TextPart[], type: 'jsx' | 'html'): TextPart[] {\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string') {\n return [...result, part];\n }\n\n return [...result, ...part\n .split(/\\r\\n|\\r|\\n/g)\n .reduce((parts: TextPart[], line: string, i, source) => {\n // This adds non-breaking space if line was indented with spaces, to preserve the indentation\n const trimmedLine = line.trimLeft();\n const indentLength = line.length - trimmedLine.length;\n parts.push(String.fromCharCode(160).repeat(indentLength) + trimmedLine);\n\n if (i !== source.length - 1) {\n parts.push(\n type === 'jsx' ?
: '
',\n );\n }\n\n return parts;\n }, [])];\n }, [] as TextPart[]);\n}\n\nfunction addHighlight(textParts: TextPart[], highlight: string | undefined): TextPart[] {\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string' || !highlight) {\n return [...result, part];\n }\n\n const lowerCaseText = part.toLowerCase();\n const queryPosition = lowerCaseText.indexOf(highlight.toLowerCase());\n const nextSymbol = lowerCaseText[queryPosition + highlight.length];\n if (queryPosition < 0 || (nextSymbol && nextSymbol.match(RE_LETTER_OR_DIGIT))) {\n return [...result, part];\n }\n\n const newParts: TextPart[] = [];\n newParts.push(part.substring(0, queryPosition));\n newParts.push(\n \n {part.substring(queryPosition, queryPosition + highlight.length)}\n ,\n );\n newParts.push(part.substring(queryPosition + highlight.length));\n\n return [...result, ...newParts];\n }, [] as TextPart[]);\n}\n\nconst RE_LINK = new RegExp(`${RE_LINK_TEMPLATE}|${RE_MENTION_TEMPLATE}`, 'ig');\n\nfunction addLinks(textParts: TextPart[]): TextPart[] {\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string') {\n return [...result, part];\n }\n\n const links = part.match(RE_LINK);\n if (!links || !links.length) {\n return [...result, part];\n }\n\n const content: TextPart[] = [];\n\n let nextLink = links.shift();\n let lastIndex = 0;\n while (nextLink) {\n const index = part.indexOf(nextLink, lastIndex);\n content.push(part.substring(lastIndex, index));\n if (nextLink.startsWith('@')) {\n content.push(\n \n {nextLink}\n ,\n );\n } else {\n if (nextLink.endsWith('?')) {\n nextLink = nextLink.slice(0, nextLink.length - 1);\n }\n\n content.push(\n ,\n );\n }\n lastIndex = index + nextLink.length;\n nextLink = links.shift();\n }\n content.push(part.substring(lastIndex));\n\n return [...result, ...content];\n }, [] as TextPart[]);\n}\n\nfunction replaceSimpleMarkdown(textParts: TextPart[], type: 'jsx' | 'html'): TextPart[] {\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string') {\n return [...result, part];\n }\n\n const parts = part.split(SIMPLE_MARKDOWN_REGEX);\n const entities = part.match(SIMPLE_MARKDOWN_REGEX) || [];\n result.push(parts[0]);\n\n return entities.reduce((entityResult: TextPart[], entity, i) => {\n if (type === 'jsx') {\n entityResult.push(\n entity.startsWith('**')\n ? {entity.replace(/\\*\\*/g, '')}\n : {entity.replace(/__/g, '')},\n );\n } else {\n entityResult.push(\n entity.startsWith('**')\n ? `${entity.replace(/\\*\\*/g, '')}`\n : `${entity.replace(/__/g, '')}`,\n );\n }\n\n const index = i * 2 + 2;\n if (parts[index]) {\n entityResult.push(parts[index]);\n }\n\n return entityResult;\n }, result);\n }, [] as TextPart[]);\n}\n","import React from '../../../lib/teact/teact';\n\nimport { EDITABLE_INPUT_ID } from '../../../config';\nimport { IS_IOS } from '../../../util/environment';\n\nexport function preventMessageInputBlur(e: React.MouseEvent, withBubbling = false) {\n if (\n IS_IOS\n || !document.activeElement\n || document.activeElement.id !== EDITABLE_INPUT_ID\n || (!withBubbling && e.target !== e.currentTarget)\n ) {\n return;\n }\n\n e.preventDefault();\n}\n\nexport function preventMessageInputBlurWithBubbling(e: React.MouseEvent) {\n preventMessageInputBlur(e, true);\n}\n","import React, { FC } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport { pick } from '../../../util/iteratees';\nimport { selectUser } from '../../../modules/selectors';\n\ntype OwnProps = {\n userId?: number;\n username?: string;\n children: any;\n};\n\ntype StateProps = {\n userOrChat?: ApiUser | ApiChat;\n};\n\ntype DispatchProps = Pick;\n\nconst MentionLink: FC = ({\n username,\n userOrChat,\n children,\n openChat,\n openChatByUsername,\n}) => {\n const handleClick = () => {\n if (userOrChat) {\n openChat({ id: userOrChat.id });\n } else if (username) {\n openChatByUsername({ username: username.substring(1) });\n }\n };\n\n return (\n \n {children}\n \n );\n};\n\nexport default withGlobal(\n (global, { userId }): StateProps => {\n return {\n userOrChat: userId ? selectUser(global, userId) : undefined,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['openChat', 'openChatByUsername']),\n)(MentionLink);\n","import { MouseEvent as ReactMouseEvent, RefObject } from 'react';\n\nimport React, {\n FC, useRef, useCallback, useState,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport Spinner from './Spinner';\nimport RippleEffect from './RippleEffect';\n\nimport './Button.scss';\n\nexport type OwnProps = {\n ref?: RefObject;\n type?: 'button' | 'submit' | 'reset';\n children: any;\n size?: 'default' | 'smaller' | 'tiny';\n color?: 'primary' | 'secondary' | 'gray' | 'danger' | 'translucent' | 'translucent-white' | 'dark';\n className?: string;\n round?: boolean;\n pill?: boolean;\n fluid?: boolean;\n isText?: boolean;\n isLoading?: boolean;\n ariaLabel?: string;\n href?: string;\n download?: string;\n disabled?: boolean;\n ripple?: boolean;\n faded?: boolean;\n tabIndex?: number;\n isRtl?: boolean;\n onClick?: (e: ReactMouseEvent) => void;\n onContextMenu?: (e: ReactMouseEvent) => void;\n onMouseDown?: (e: ReactMouseEvent) => void;\n onMouseEnter?: NoneToVoidFunction;\n onMouseLeave?: NoneToVoidFunction;\n onFocus?: NoneToVoidFunction;\n};\n\n// Longest animation duration;\nconst CLICKED_TIMEOUT = 400;\n\nconst Button: FC = ({\n ref,\n type = 'button',\n onClick,\n onContextMenu,\n onMouseDown,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n children,\n size = 'default',\n color = 'primary',\n className,\n round,\n pill,\n fluid,\n isText,\n isLoading,\n ariaLabel,\n href,\n download,\n disabled,\n ripple,\n faded,\n tabIndex,\n isRtl,\n}) => {\n // eslint-disable-next-line no-null/no-null\n let elementRef = useRef(null);\n if (ref) {\n elementRef = ref;\n }\n\n const [isClicked, setIsClicked] = useState(false);\n\n const fullClassName = buildClassName(\n 'Button',\n className,\n size,\n color,\n round && 'round',\n pill && 'pill',\n fluid && 'fluid',\n disabled && 'disabled',\n isText && 'text',\n isLoading && 'loading',\n ripple && 'has-ripple',\n faded && 'faded',\n isClicked && 'clicked',\n );\n\n const handleClick = useCallback((e: ReactMouseEvent) => {\n if (!disabled && onClick) {\n onClick(e);\n }\n\n setIsClicked(true);\n setTimeout(() => {\n setIsClicked(false);\n }, CLICKED_TIMEOUT);\n }, [disabled, onClick]);\n\n const handleMouseDown = useCallback((e: ReactMouseEvent) => {\n e.preventDefault();\n if (!disabled && onMouseDown) {\n onMouseDown(e);\n }\n }, [onMouseDown, disabled]);\n\n if (href) {\n return (\n }\n className={fullClassName}\n href={href}\n title={ariaLabel}\n download={download}\n tabIndex={tabIndex}\n dir={isRtl ? 'rtl' : undefined}\n >\n {children}\n {!disabled && ripple && (\n \n )}\n \n );\n }\n\n return (\n // eslint-disable-next-line react/button-has-type\n }\n type={type}\n className={fullClassName}\n onClick={handleClick}\n onContextMenu={onContextMenu}\n onMouseDown={handleMouseDown}\n onMouseEnter={onMouseEnter && !disabled ? onMouseEnter : undefined}\n onMouseLeave={onMouseLeave && !disabled ? onMouseLeave : undefined}\n onFocus={onFocus && !disabled ? onFocus : undefined}\n aria-label={ariaLabel}\n title={ariaLabel}\n tabIndex={tabIndex}\n dir={isRtl ? 'rtl' : undefined}\n >\n {isLoading ? (\n
\n Please wait..\n \n
\n ) : children}\n {!disabled && ripple && (\n \n )}\n \n );\n};\n\nexport default Button;\n","import { ChangeEvent } from 'react';\nimport React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Spinner from './Spinner';\n\nimport './Checkbox.scss';\n\ntype OwnProps = {\n id?: string;\n name?: string;\n value?: string;\n label: string;\n subLabel?: string;\n checked: boolean;\n disabled?: boolean;\n round?: boolean;\n blocking?: boolean;\n isLoading?: boolean;\n withCheckedCallback?: boolean;\n onChange?: (e: ChangeEvent) => void;\n onCheck?: (isChecked: boolean) => void;\n};\n\nconst Checkbox: FC = ({\n id,\n name,\n value,\n label,\n subLabel,\n checked,\n disabled,\n round,\n blocking,\n isLoading,\n onChange,\n onCheck,\n}) => {\n const lang = useLang();\n const handleChange = useCallback((event: ChangeEvent) => {\n if (onChange) {\n onChange(event);\n }\n\n if (onCheck) {\n onCheck(event.currentTarget.checked);\n }\n }, [onChange, onCheck]);\n\n const className = buildClassName(\n 'Checkbox',\n disabled && 'disabled',\n round && 'round',\n isLoading && 'loading',\n blocking && 'blocking',\n );\n\n return (\n \n );\n};\n\nexport default memo(Checkbox);\n","import React, { FC, useState, useRef } from '../../lib/teact/teact';\n\nimport Menu from './Menu';\n\nimport './DropdownMenu.scss';\n\ntype OwnProps = {\n className?: string;\n trigger: FC<{ onTrigger: () => void; isOpen?: boolean }>;\n positionX?: 'left' | 'right';\n positionY?: 'top' | 'bottom';\n footer?: string;\n forceOpen?: boolean;\n onOpen?: NoneToVoidFunction;\n onClose?: NoneToVoidFunction;\n children: any;\n};\n\nconst DropdownMenu: FC = ({\n trigger,\n className,\n children,\n positionX = 'left',\n positionY = 'top',\n footer,\n forceOpen,\n onOpen,\n onClose,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const menuRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const dropdownRef = useRef(null);\n const [isOpen, setIsOpen] = useState(false);\n\n const toggleIsOpen = () => {\n setIsOpen(!isOpen);\n if (isOpen) {\n if (onClose) onClose();\n } else if (onOpen) onOpen();\n };\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n const menu = menuRef.current;\n\n if (!isOpen || e.keyCode !== 40 || !menu) {\n return;\n }\n\n const focusedElement = document.activeElement;\n const elementChildren = Array.from(menu.children);\n\n if (!focusedElement || elementChildren.indexOf(focusedElement) === -1) {\n (elementChildren[0] as HTMLElement).focus();\n }\n };\n\n const handleClose = () => {\n setIsOpen(false);\n if (onClose) onClose();\n };\n\n return (\n \n {trigger({ onTrigger: toggleIsOpen, isOpen })}\n\n \n {children}\n \n

Cwc5ws#)yoLZ8o!4iGT;f)#6RpU{Y_O|ZB2HMu{YmcrN z;}U-tV*}F$<%=6*L#c}$n6Sp&RS)!NHh95#BuTGOp4P+9uBtTk6_{2dELt2WQ3)8# z^8OX|#=qOKPf4NlpWlW?Dj? zL8I}gaR)GBm|H$*lp{RKh&yy1(_^h*NRgt7?iiF(jP=Epg=e4bkP++-#R&wckhJ|dM?DK->aPCx5%--@Q5q=pNjbh*>n*fRB* zF4Twwmfq&i3!wDzuaworPG<)oX z-)iEf4zHk>^}2q20(N0Br{Iy14zj6n(f|Cw2w%z(8)2Tz`AL-!%K|zuh`m>^tHl|- zK~aM2PVQGK>bA)j3_ZS3Br`*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zU6qm=FTRE6WPjwYp+MX^OL{^dS)<7bUGa7lw^~g9wmbq9*#-B%E|0nj}FwFnJXaC{x-|)Zc|1UfHf5FiI18@E}eDgJOH00aO-~a6S z?&JAxYU3^^6tMjF^r!F~7&G-qoGw*|lM zSh8IreTf%bgQz`UV+HTO6(snbPyt;GQBf*L1Q!efVin(@7a1I)(7H{6U`{Fsga%_| zWVE-Z;F$mpVQiEReklNfXA=>NM~Vj1Fr>lU_XnVqxW^SeH5CBt23fRrG)*}kL8WiW zSMx2wNrbIiYa0eFEG)Rw;J<#kJbp#OPos%USfG61m8@Pf6(f@^Jz{Jq_(>{i1&Bxb zHZ1iwxs$%TMm^_XXo#EHg&YW?8uPqAKqkK>sgFQ%->Dfiyw@QhLEjT%4?oN+;5T{k z@U>Cgon}13E7(ZWML`QkLw%CODgx80ZUcax+_K3UrF=MEM9;!YauH%HoZJ*SpuYhb j&|-HnRht}twfsaHKSIv~)q-E=sjWkw4PpO%JMw=3W(hN2 diff --git a/dist/Vazir-Regular-WOL.a6f663c7a4c514c9de99..woff b/dist/Vazir-Regular-WOL.a6f663c7a4c514c9de99..woff deleted file mode 100644 index 63dee727e4a4aa8c1e7d5aa2bce466a90af8d2c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 31992 zcmZs>W0WR6)GmCtZDZQ*Y1_7K+qP}n_O$KkY1_7K`}Fgk_gm}y__FG%RCetvl~q}L zC)tUcoTw-O2=J4bWn%5gtf z!Mejb5tElw0sw&d0RW^F0Dwe0eBlE{Oi4u$06q_cAkZ`r*3#Z~>723q&((57QqS1ppvv3jhQ$qwZCdo0}LI0|3V9KRT@c z0du(N#QaD2Bb)gt6a0V##Tneq+{W4cM|Shmjvsx9CKezcS8F??A3byBA6fMeHV}nb zmTU~%f4*xC`oCNP5O)N3TLT-D9~sGy4$}`eG@d~Z!rsow833?T|7kNV0Dv}s?6va8 z-qGZT>uvtSjr~EHiEvH!PyRnWvO#VY`11^y_4$1GFW;oMId%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;xp;Kwi|E5#7mXp7W4wYb{L-$X#|! z`n>KROlDA`PzFg*WP;c<;TTfFpaD<8j5---d}OI3qWk+buXwB@C>-rmE5JNjNxRl4 zNr8ErDdA+9w<0SCg{ys$sbrs#RN?9ab}cbYA~O#OuE!!2^^*C^`JruUWjMODXNzWn zsLzuSN&8B5obPT{@TTQmM#8Kf8rxmSbIW9QZ)j0o{3I6YM&Fa-GOpuA(oz@wb2&tn zU0*llUP!+%SMj>rFvMa}_2Mkpv_jBG+`?Pdcv`HTT05o_o*bm)Y@FlP1Di6VT4@K$ zy{1U}o2WE{VFbih!avcaaQC_Zn{4UiFwl;Xab2?(GtK&m$Sf}DKB|Je4DFAYU2Gkj zUFi0s8oIfj{DUY7Ox^kSs(yE*n>69r(~v1O5uWC4Dm=4K-x=q4G%genxz}Z6CrGJu zL>0e|4py7!4%X}Lv}Ra^5=x`z9WSzL;PL!Y1c4F*H3B_iN-=;!C_qDI?Ff4;`oF-W z=DkWvFa(Wd#mWW}!oqjvOq2{$^N<;ZOj8T#Xs1$ertYT@ace=KHvO9h;*8Tt%N(2=8UAqi#xBKh}$qk5z40R8|hO=>CaA3wju`yS( zS%3GLX8stN?rNBAf2j3M=pzTr(Hnr}GO$OFoz{l{^lyyxO!Vy5O8Zw4G3xsAiGT)W z?bk{H_iuLf0HFL(g(Pg1z#*^p&Ght)>`%qu{KfrxO?XvAc&l)uel*!?A8m{b?A9hT R`iFP-fdDemDVG5N{udIdnGgT~ diff --git a/dist/Vazir-Regular-WOL.c7b24ace258717d9a320..woff2 b/dist/Vazir-Regular-WOL.c7b24ace258717d9a320..woff2 new file mode 100644 index 0000000000000000000000000000000000000000..43e08e561b6de282b7d765ebe042b9c1390dae29 GIT binary patch literal 25744 zcmV)MK)AnmPew8T0RR910A!E=5&!@I0PWZS0Awft0RR9100000000000000000000 z0000#Mn+Uk92$XG8^~N7k6H#`0ETi1FbSLt5eN!`hFF2@Dhr2P00A}vBm<8$1Rw>E z1_!HC41p&bm)l1W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kG_dgAA_;iX)B zApe=!VOOc&g_lYGd3V6U{o}*q3J?ew1QZ5LSg<=)8UmI=@*A<7B$9>^(0PTVcb2tq zU0jd;j5zYj!{Zrdp@)D_00jjtZGY~q7$^)h*)8!5W9T7q2n8@OFmQ0&jjM-%P*7Qb z8xPMEv%>^=2nYpWuVwce-tq|XK_!$|^85N#+@$uGSN?6B;KU%4$~BV+hyYb;Nq+#L zp`lA1S4!YXb5ql^@Uj_6BBIfdaIS%duzHG*Hglbo~Fz}FJ- zwIys~D6R(9H(f`|!S*kVd{jLMm3{xHtAm9vJwWQNo@3PGmV0IbVsgWrHJ9P+4QB+B z7Q`5UgTBIn**9?u-g>vu*DZ*S2+{)s4B%G4?1lf^JuA7vkO3`NGXC^} TzC_Rc8l``Q${&P)31rCyQV)p8 literal 0 HcmV?d00001 diff --git a/dist/Vazir-Regular-WOL.ed6379fdf8108ff3bc5b..woff b/dist/Vazir-Regular-WOL.ed6379fdf8108ff3bc5b..woff new file mode 100644 index 0000000000000000000000000000000000000000..b5cd3590f69911390f84dd389d62326c6cdb5c5a GIT binary patch literal 31948 zcmbTbV{|6Lw=eu;V%xTziEVS@WMbR4ZQHh;Ol;e>?VJC3&spofYuzvR*6LqZ*RH*H zbywF$SG&lGiUNQDKgDwbfb^gGa^*kg|5Fha{UZYa044tP;rs{TS9Z^0!XlzSwA!C` z%nw#D?=VlqzmSf=TNB{sh8UFBK{eS`L8|us0*2Lz{lv|2@ex3b%j)M{CbBEQ{0qu&}7)AVeI#jVw@%Rn@ita`60PxNrxB|EWHO2#9@TejL^*FfTe>GdJ|JU)M zMO|vO4r2l06u?CBZ~f8`-`wPG>T%-ri1ybQbIv^ov6x(@#H7)B3T?^ZkP#Ofb2>t= z$1i?%bL2=o)-K8>@`*PI6B&F=v#+QNXb9HIweGa^jAW~A{(c#3R;ygv9p4#m3B^K6 z6OY3(evz~J%%=wv?tAr7QD^(u1e86Bkd+v~DIo~SLjd+wbVtSp^U7KmQX?!HSVw^3 z96w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UoM6I}`pnc_mkgBFn#}XVkczaJjAix(at9r93EJ># z^yOyqG?P&V59>PtO8^?Tfni8Ix7$Px>qOiOeGjz!0(j4m3YuUdS$lJ=OGU;L=_XT_1n zqe%NT=@EDU7?LD9#!UOzzw$+(#v)4$-ih@agp;!2nDfThvmZ6_*z z+l&`S_VN+(&c@o9PBWJOGH?@+S9c5CgmLyLu^FqivlrV4vHt@?JLGh{Z_aLJbfPcb z&STpfn?q%}@pS@%*7u>6O1+Jsr3!*z5o(N0#Qul&tYL)}ET7`NMrl@G(?DL-ni<2% zXrA+sVrwl`48&b_O!~a85H90yf>1iy--vjzY2q=I_(21n{26r$&bWwDM`ZW6YhLjf zM{orC$5xR8|1%%Dxn+w}NZJ#_Zl;HQ?!tlp5K+_*{XUmJao zKWe(;MdDHy<5M|Qm0e#q^}p1gxd2`t_Dx2k@3l$%uHnA6}XH4&cXZ5n*D58oN* zICL&FFu9jyR3~VuG-MUOjt(}Ps1CO4?$l;@g%WC`ryVbfYtZq$QY66=12rN&Qfe`v z0vKRJ7VU6*Y(@c4a`Rp#B{-tSvSMWe31Q(|a{x8d)I4;00bpt&4gFLqqO##nT_IBK zBxhf^U@x_Fi$N4bp?NPS{HmUJo_13i$^!ZYz`A0v@ehSr%53RtO@06)pR%SOZ z%3*4p#5CeAHPEI&1usj;JuE}^+UP46fE6M4Md5 zmUTAri4McVSDuFtV2`g-$KgKIhg~d>fBDvm^_{9B**yX?J9#GroTj*5f{5L@kUR2u z^W9dCWXeIlzF#hRk@czxN9uSP*FChtAB}nM2eKS2hBl}Y^1b=bAUK3sw5#B1i e$Zt*d+6NmW1G}}!^#0-9eGs4w4C-Ydp#KX}Eb9pX literal 0 HcmV?d00001 diff --git a/dist/index.html b/dist/index.html index 78b0c657..0fe58366 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1 +1 @@ -Telegram

\n );\n};\n\nexport default DropdownMenu;\n","import { ChangeEvent, FormEvent, RefObject } from 'react';\nimport React, { FC, memo } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\ntype OwnProps = {\n ref?: RefObject;\n id?: string;\n className?: string;\n value?: string;\n label?: string;\n error?: string;\n success?: string;\n disabled?: boolean;\n readOnly?: boolean;\n placeholder?: string;\n autoComplete?: string;\n maxLength?: number;\n inputMode?: 'text' | 'none' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n onChange?: (e: ChangeEvent) => void;\n onInput?: (e: FormEvent) => void;\n onKeyPress?: (e: React.KeyboardEvent) => void;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n onBlur?: (e: React.FocusEvent) => void;\n onPaste?: (e: React.ClipboardEvent) => void;\n};\n\nconst InputText: FC = ({\n ref,\n id,\n className,\n value,\n label,\n error,\n success,\n disabled,\n readOnly,\n placeholder,\n autoComplete,\n inputMode,\n maxLength,\n onChange,\n onInput,\n onKeyPress,\n onKeyDown,\n onBlur,\n onPaste,\n}) => {\n const lang = useLang();\n const labelText = error || success || label;\n const fullClassName = buildClassName(\n 'input-group',\n value && 'touched',\n error ? 'error' : success && 'success',\n disabled && 'disabled',\n readOnly && 'disabled',\n labelText && 'with-label',\n className,\n );\n\n return (\n
\n \n {labelText && (\n \n )}\n
\n );\n};\n\nexport default memo(InputText);\n","import React, { FC, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport './Link.scss';\n\ntype OwnProps = {\n children: any;\n className?: string;\n isRtl?: boolean;\n onClick?: (e: React.MouseEvent) => void;\n};\n\nconst Link: FC = ({\n children, className, isRtl, onClick,\n}) => {\n const handleClick = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n onClick!(e);\n }, [onClick]);\n\n return (\n \n {children}\n \n );\n};\n\nexport default Link;\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport Spinner from './Spinner';\n\nimport './Loading.scss';\n\ntype OwnProps = {\n color?: 'blue' | 'white' | 'black';\n};\n\nconst Loading: FC = ({ color = 'blue' }) => {\n return (\n
\n \n
\n );\n};\n\nexport default memo(Loading);\n","import { RefObject } from 'react';\nimport React, { FC, useEffect, useRef } from '../../lib/teact/teact';\n\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';\nimport useVirtualBackdrop from '../../hooks/useVirtualBackdrop';\nimport useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport buildClassName from '../../util/buildClassName';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport { preventMessageInputBlurWithBubbling } from '../middle/helpers/preventMessageInputBlur';\n\nimport './Menu.scss';\n\ntype OwnProps = {\n ref?: RefObject;\n containerRef?: RefObject;\n isOpen: boolean;\n className?: string;\n style?: string;\n positionX?: 'left' | 'right';\n positionY?: 'top' | 'bottom';\n autoClose?: boolean;\n shouldSkipTransition?: boolean;\n footer?: string;\n noCloseOnBackdrop?: boolean;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n onCloseAnimationEnd?: () => void;\n onClose?: () => void;\n onMouseEnter?: (e: React.MouseEvent) => void;\n onMouseLeave?: (e: React.MouseEvent) => void;\n children: any;\n};\n\nconst ANIMATION_DURATION = 200;\n\nconst Menu: FC = ({\n ref,\n containerRef,\n isOpen,\n className,\n style,\n children,\n positionX = 'left',\n positionY = 'top',\n autoClose = false,\n footer,\n noCloseOnBackdrop = false,\n onCloseAnimationEnd,\n onClose,\n onMouseEnter,\n onMouseLeave,\n shouldSkipTransition,\n}) => {\n // eslint-disable-next-line no-null/no-null\n let menuRef = useRef(null);\n if (ref) {\n menuRef = ref;\n }\n const backdropContainerRef = containerRef || menuRef;\n\n const {\n transitionClassNames,\n } = useShowTransition(\n isOpen,\n onCloseAnimationEnd,\n shouldSkipTransition,\n undefined,\n shouldSkipTransition,\n );\n\n useEffect(\n () => (isOpen && onClose ? captureEscKeyListener(onClose) : undefined),\n [isOpen, onClose],\n );\n\n useHistoryBack(isOpen, onClose, undefined, undefined, autoClose);\n\n useEffectWithPrevDeps(([prevIsOpen]) => {\n if (prevIsOpen !== undefined) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION);\n }\n }, [isOpen]);\n\n const handleKeyDown = useKeyboardListNavigation(menuRef, isOpen, autoClose ? onClose : undefined, undefined, true);\n\n useVirtualBackdrop(\n isOpen,\n backdropContainerRef,\n noCloseOnBackdrop ? undefined : onClose,\n );\n\n const bubbleClassName = buildClassName(\n 'bubble menu-container custom-scroll',\n positionY,\n positionX,\n footer && 'with-footer',\n transitionClassNames,\n );\n\n return (\n \n {isOpen && (\n // This only prevents click events triggering on underlying elements\n
\n )}\n \n {children}\n {footer &&
{footer}
}\n
\n
\n );\n};\n\nexport default Menu;\n","import React, { FC, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport './MenuItem.scss';\n\ntype OnClickHandler = (e: React.SyntheticEvent) => void;\n\ntype OwnProps = {\n icon?: string;\n className?: string;\n children: any;\n onClick?: OnClickHandler;\n href?: string;\n download?: string;\n disabled?: boolean;\n destructive?: boolean;\n ariaLabel?: string;\n};\n\nconst MenuItem: FC = (props) => {\n const {\n icon,\n className,\n children,\n onClick,\n href,\n download,\n disabled,\n destructive,\n ariaLabel,\n } = props;\n\n const lang = useLang();\n const handleClick = useCallback((e: React.MouseEvent) => {\n if (disabled || !onClick) {\n e.stopPropagation();\n e.preventDefault();\n\n return;\n }\n\n onClick(e);\n }, [disabled, onClick]);\n\n const handleKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.keyCode !== 13 && e.keyCode !== 32) {\n return;\n }\n\n if (disabled || !onClick) {\n e.stopPropagation();\n e.preventDefault();\n\n return;\n }\n\n onClick(e);\n }, [disabled, onClick]);\n\n const fullClassName = buildClassName(\n 'MenuItem',\n className,\n disabled && 'disabled',\n destructive && 'destructive',\n );\n\n const content = (\n <>\n {icon && (\n \n )}\n {children}\n \n );\n\n if (href) {\n return (\n \n {content}\n \n );\n }\n\n return (\n \n {content}\n \n );\n};\n\nexport default MenuItem;\n","import React, {\n FC, useCallback, useMemo, useState, memo,\n} from '../../lib/teact/teact';\nimport { debounce } from '../../util/schedulers';\n\nimport './RippleEffect.scss';\n\ninterface Ripple {\n x: number;\n y: number;\n size: number;\n}\n\nconst ANIMATION_DURATION_MS = 700;\n\nconst RippleEffect: FC = () => {\n const [ripples, setRipples] = useState([]);\n\n const cleanUpDebounced = useMemo(() => {\n return debounce(() => {\n setRipples([]);\n }, ANIMATION_DURATION_MS, false);\n }, []);\n\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n if (e.button !== 0) {\n return;\n }\n\n const container = e.currentTarget as HTMLDivElement;\n const position = container.getBoundingClientRect() as DOMRect;\n\n const rippleSize = container.offsetWidth / 2;\n\n setRipples([\n ...ripples,\n {\n x: e.clientX - position.x - (rippleSize / 2),\n y: e.clientY - position.y - (rippleSize / 2),\n size: rippleSize,\n },\n ]);\n\n requestAnimationFrame(() => {\n cleanUpDebounced();\n });\n }, [ripples, cleanUpDebounced]);\n\n return (\n
\n {ripples.map(({ x, y, size }) => (\n \n ))}\n
\n );\n};\n\nexport default memo(RippleEffect);\n","import React, { FC } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport './Spinner.scss';\n\nconst Spinner: FC<{\n color?: 'blue' | 'white' | 'black' | 'green' | 'gray';\n withBackground?: boolean;\n}> = ({\n color = 'blue',\n withBackground,\n}) => {\n return (\n
\n
\n
\n );\n};\n\nexport default Spinner;\n","export const PAGE_TITLE = 'Telegram';\nexport const INACTIVE_MARKER = ' [Inactive]';\n\nexport const APP_NAME = process.env.APP_NAME || 'Telegram WebZ';\nexport const APP_VERSION = process.env.APP_VERSION || 'dev';\n\nexport const DEBUG = (\n process.env.APP_ENV !== 'production' && process.env.APP_ENV !== 'perf' && process.env.APP_ENV !== 'test'\n);\nexport const DEBUG_MORE = false;\n\nexport const IS_TEST = process.env.APP_ENV === 'test';\nexport const IS_PERF = process.env.APP_ENV === 'perf';\n\nexport const DEBUG_ALERT_MSG = 'Shoot!\\nSomething went wrong, please see the error details in Dev Tools Console.';\nexport const DEBUG_GRAMJS = false;\n\nexport const SESSION_USER_KEY = 'user_auth';\nexport const LEGACY_SESSION_KEY = 'GramJs:sessionId';\n\nexport const GLOBAL_STATE_CACHE_DISABLED = false;\nexport const GLOBAL_STATE_CACHE_KEY = 'tt-global-state';\nexport const GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT = 30;\nexport const GLOBAL_STATE_CACHE_USER_LIST_LIMIT = 5000;\n\nexport const MEDIA_CACHE_DISABLED = false;\nexport const MEDIA_CACHE_NAME = 'tt-media';\nexport const MEDIA_CACHE_NAME_AVATARS = 'tt-media-avatars';\nexport const MEDIA_PROGRESSIVE_CACHE_DISABLED = false;\nexport const MEDIA_PROGRESSIVE_CACHE_NAME = 'tt-media-progressive';\nexport const MEDIA_CACHE_MAX_BYTES = 512 * 1024; // 512 KB\nexport const CUSTOM_BG_CACHE_NAME = 'tt-custom-bg';\nexport const LANG_CACHE_NAME = 'tt-lang-packs-v5';\nexport const ASSET_CACHE_NAME = 'tt-assets';\n\nexport const DOWNLOAD_WORKERS = 16;\nexport const UPLOAD_WORKERS = 16;\n\nconst isBigScreen = typeof window !== 'undefined' && window.innerHeight >= 900;\n\nexport const MIN_PASSWORD_LENGTH = 1;\n\nexport const MESSAGE_LIST_SENSITIVE_AREA = 750;\nexport const MESSAGE_LIST_SLICE = isBigScreen ? 60 : 40;\nexport const MESSAGE_LIST_VIEWPORT_LIMIT = MESSAGE_LIST_SLICE * 2;\n\nexport const CHAT_HEIGHT_PX = 72;\nexport const CHAT_LIST_SLICE = isBigScreen ? 30 : 25;\nexport const CHAT_LIST_LOAD_SLICE = 100;\nexport const SHARED_MEDIA_SLICE = 42;\nexport const MESSAGE_SEARCH_SLICE = 42;\nexport const GLOBAL_SEARCH_SLICE = 20;\nexport const MEMBERS_SLICE = 30;\nexport const MEMBERS_LOAD_SLICE = 200;\nexport const PINNED_MESSAGES_LIMIT = 50;\nexport const BLOCKED_LIST_LIMIT = 100;\nexport const PROFILE_PHOTOS_LIMIT = 40;\nexport const PROFILE_SENSITIVE_AREA = 500;\n\nexport const TOP_CHAT_MESSAGES_PRELOAD_LIMIT = 20;\nexport const ALL_CHATS_PRELOAD_DISABLED = false;\n\nexport const ANIMATION_LEVEL_MIN = 0;\nexport const ANIMATION_LEVEL_MED = 1;\nexport const ANIMATION_LEVEL_MAX = 2;\nexport const ANIMATION_LEVEL_DEFAULT = ANIMATION_LEVEL_MAX;\n\nexport const DEFAULT_MESSAGE_TEXT_SIZE_PX = 16;\nexport const IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 17;\nexport const MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 15;\n\nexport const DRAFT_DEBOUNCE = 10000; // 10s\n\nexport const EDITABLE_INPUT_ID = 'editable-message-text';\nexport const EDITABLE_INPUT_MODAL_ID = 'editable-message-text-modal';\n\n// Screen width where Pinned Message / Audio Player in the Middle Header can be safely displayed\nexport const SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1440; // px\n// Screen width where Pinned Message / Audio Player in the Middle Header shouldn't collapse with ChatInfo\nexport const SAFE_SCREEN_WIDTH_FOR_CHAT_INFO = 1150; // px\n\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1275; // px\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN = 925; // px\nexport const MOBILE_SCREEN_MAX_WIDTH = 600; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH = 950; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT = 450; // px\n\nexport const LOCAL_MESSAGE_ID_BASE = 1e9;\n\nexport const ANIMATION_END_DELAY = 100;\n\nexport const FAST_SMOOTH_MAX_DISTANCE = 1500;\nexport const FAST_SMOOTH_MIN_DURATION = 250;\nexport const FAST_SMOOTH_MAX_DURATION = 600;\nexport const FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE = 500; // px\n\n// Average duration of message sending animation\nexport const API_UPDATE_THROTTLE = Math.round((FAST_SMOOTH_MIN_DURATION + FAST_SMOOTH_MAX_DURATION) / 2);\nexport const API_THROTTLE_RESET_UPDATES = new Set([\n 'newMessage', 'newScheduledMessage', 'deleteMessages', 'deleteScheduledMessages', 'deleteHistory',\n]);\n\nexport const STICKER_SIZE_INLINE_DESKTOP_FACTOR = 13;\nexport const STICKER_SIZE_INLINE_MOBILE_FACTOR = 11;\nexport const STICKER_SIZE_AUTH = 160;\nexport const STICKER_SIZE_AUTH_MOBILE = 120;\nexport const STICKER_SIZE_PICKER = 64;\nexport const STICKER_SIZE_GENERAL_SETTINGS = 48;\nexport const STICKER_SIZE_PICKER_HEADER = 32;\nexport const STICKER_SIZE_SEARCH = 64;\nexport const STICKER_SIZE_MODAL = 64;\nexport const STICKER_SIZE_TWO_FA = 160;\nexport const STICKER_SIZE_DISCUSSION_GROUPS = 140;\nexport const STICKER_SIZE_FOLDER_SETTINGS = 80;\nexport const STICKER_SIZE_INLINE_BOT_RESULT = 100;\nexport const RECENT_STICKERS_LIMIT = 20;\nexport const MEMOJI_STICKER_ID = 'MEMOJI_STICKER';\n\nexport const BASE_EMOJI_KEYWORD_LANG = 'en';\n\nexport const MENU_TRANSITION_DURATION = 200;\nexport const SLIDE_TRANSITION_DURATION = 450;\n\nexport const CONTENT_TYPES_FOR_QUICK_UPLOAD = new Set([\n 'image/png', 'image/gif', 'image/jpeg', 'video/mp4', 'video/avi', 'video/quicktime',\n]);\n\n// eslint-disable-next-line max-len\nexport const RE_LINK_TEMPLATE = '((ftp|https?):\\\\/\\\\/)?((www\\\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\\\.[a-zA-Z0-9()]{1,63})\\\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)';\nexport const RE_MENTION_TEMPLATE = '(@[\\\\w\\\\d_-]+)';\nexport const RE_TME_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/)([\\d\\w_]+)(?:\\/([\\d]+))?(?:\\/([\\d]+))?$/gm;\nexport const RE_TME_INVITE_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/joinchat\\/)([\\d\\w_-]+)?$/gm;\n\n// MTProto constants\nexport const SERVICE_NOTIFICATIONS_USER_ID = 777000;\nexport const REPLIES_USER_ID = 1271266957;\nexport const ALL_FOLDER_ID = 0;\nexport const ARCHIVED_FOLDER_ID = 1;\nexport const DELETED_COMMENTS_CHANNEL_ID = 777;\nexport const MAX_MEDIA_FILES_FOR_ALBUM = 10;\nexport const MAX_ACTIVE_PINNED_CHATS = 5;\nexport const SCHEDULED_WHEN_ONLINE = 0x7FFFFFFE;\nexport const DEFAULT_LANG_CODE = 'en';\nexport const DEFAULT_LANG_PACK = 'android';\nexport const LANG_PACKS = ['android', 'ios', 'tdesktop', 'macos'] as const;\nexport const TIPS_USERNAME = 'TelegramTips';\nexport const LOCALIZED_TIPS = ['ar', 'pt-br', 'id', 'it', 'ko', 'ms', 'pl', 'es', 'tr'];\nexport const FEEDBACK_URL = 'https://bugs.telegram.org/?tag_ids=41&sort=time';\nexport const LIGHT_THEME_BG_COLOR = '#A2AF8E';\nexport const DARK_THEME_BG_COLOR = '#0F0F0F';\nexport const DARK_THEME_PATTERN_COLOR = '#0a0a0a8c';\nexport const DEFAULT_PATTERN_COLOR = 'rgba(90, 110, 70, 0.6)';\n","import { useEffect } from '../lib/teact/teact';\nimport usePrevious from './usePrevious';\n\nexport default (cb: (args: PT) => void, dependencies: T, debugKey?: string) => {\n const prevDeps = usePrevious(dependencies);\n return useEffect(() => {\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n return cb(prevDeps || []);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies, debugKey);\n};\n","import { useCallback, useState } from '../lib/teact/teact';\n\nexport default (initial = false): [boolean, AnyToVoidFunction, AnyToVoidFunction] => {\n const [value, setValue] = useState(initial);\n\n const setTrue = useCallback(() => {\n setValue(true);\n }, []);\n\n const setFalse = useCallback(() => {\n setValue(false);\n }, []);\n\n return [value, setTrue, setFalse];\n};\n","import { useCallback, useState } from '../lib/teact/teact';\n\nexport default () => {\n const [, setTrigger] = useState(false);\n\n return useCallback(() => {\n setTrigger((trigger) => !trigger);\n }, []);\n};\n","import { useEffect } from '../lib/teact/teact';\n\nexport const ANIMATION_START_EVENT = 'tt-event-heavy-animation-start';\nexport const ANIMATION_END_EVENT = 'tt-event-heavy-animation-end';\n\nlet timeout: number | undefined;\nlet isAnimating = false;\n\nexport const dispatchHeavyAnimationEvent = (duration?: number) => {\n if (!isAnimating) {\n isAnimating = true;\n document.dispatchEvent(new Event(ANIMATION_START_EVENT));\n }\n\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n }\n\n if (duration) {\n timeout = window.setTimeout(() => {\n isAnimating = false;\n document.dispatchEvent(new Event(ANIMATION_END_EVENT));\n timeout = undefined;\n }, duration);\n }\n\n return () => {\n isAnimating = false;\n document.dispatchEvent(new Event(ANIMATION_END_EVENT));\n };\n};\n\nexport default (\n handleAnimationStart: AnyToVoidFunction,\n handleAnimationEnd: AnyToVoidFunction,\n) => {\n useEffect(() => {\n if (isAnimating) {\n handleAnimationStart();\n }\n\n document.addEventListener(ANIMATION_START_EVENT, handleAnimationStart);\n document.addEventListener(ANIMATION_END_EVENT, handleAnimationEnd);\n\n return () => {\n document.removeEventListener(ANIMATION_END_EVENT, handleAnimationEnd);\n document.removeEventListener(ANIMATION_START_EVENT, handleAnimationStart);\n };\n }, [handleAnimationEnd, handleAnimationStart]);\n};\n","import { useCallback, useEffect, useRef } from '../lib/teact/teact';\n\nimport { IS_IOS } from '../util/environment';\nimport usePrevious from './usePrevious';\nimport { getDispatch } from '../lib/teact/teactn';\nimport { areSortedArraysEqual } from '../util/iteratees';\n\n// Carefully selected by swiping and observing visual changes\n// TODO: may be different on other devices such as iPad, maybe take dpi into account?\nconst SAFARI_EDGE_BACK_GESTURE_LIMIT = 300;\nconst SAFARI_EDGE_BACK_GESTURE_DURATION = 350;\nexport const LOCATION_HASH = window.location.hash;\n\ntype HistoryState = {\n currentIndex: number;\n nextStateIndexToReplace: number;\n isHistoryAltered: boolean;\n isDisabled: boolean;\n isEdge: boolean;\n currentIndexes: number[];\n};\n\nconst historyState: HistoryState = {\n currentIndex: 0,\n nextStateIndexToReplace: -1,\n isHistoryAltered: false,\n isDisabled: false,\n isEdge: false,\n currentIndexes: [],\n};\n\nexport const disableHistoryBack = () => {\n historyState.isDisabled = true;\n};\n\nconst handleTouchStart = (event: TouchEvent) => {\n const x = event.touches[0].pageX;\n\n if (x <= SAFARI_EDGE_BACK_GESTURE_LIMIT || x >= window.innerWidth - SAFARI_EDGE_BACK_GESTURE_LIMIT) {\n historyState.isEdge = true;\n }\n};\n\nconst handleTouchEnd = () => {\n if (historyState.isEdge) {\n setTimeout(() => {\n historyState.isEdge = false;\n }, SAFARI_EDGE_BACK_GESTURE_DURATION);\n }\n};\n\nif (IS_IOS) {\n window.addEventListener('touchstart', handleTouchStart);\n window.addEventListener('touchend', handleTouchEnd);\n window.addEventListener('popstate', handleTouchEnd);\n}\n\nwindow.history.replaceState({ index: historyState.currentIndex }, '', window.location.pathname);\n\nexport default function useHistoryBack(\n isActive: boolean | undefined,\n onBack: ((noDisableAnimation: boolean) => void) | undefined,\n onForward?: (state: any) => void,\n currentState?: any,\n shouldReplaceNext = false,\n hashes?: string[],\n) {\n const indexRef = useRef(-1);\n const isForward = useRef(false);\n const prevIsActive = usePrevious(isActive);\n const isClosed = useRef(true);\n const indexHashRef = useRef<{ index: number; hash: string }[]>([]);\n const prevHashes = usePrevious(hashes);\n const isHashChangedFromEvent = useRef(false);\n\n const handleChange = useCallback((isForceClose = false) => {\n if (!hashes) {\n if (isActive && !isForceClose) {\n isClosed.current = false;\n\n if (isForward.current) {\n isForward.current = false;\n historyState.currentIndexes.push(indexRef.current);\n } else {\n setTimeout(() => {\n const index = ++historyState.currentIndex;\n\n historyState.currentIndexes.push(index);\n\n window.history[\n (historyState.currentIndexes.includes(historyState.nextStateIndexToReplace - 1)\n && window.history.state.index !== 0\n && historyState.nextStateIndexToReplace === index\n && !shouldReplaceNext)\n ? 'replaceState'\n : 'pushState'\n ]({\n index,\n state: currentState,\n }, '');\n\n indexRef.current = index;\n\n if (shouldReplaceNext) {\n historyState.nextStateIndexToReplace = historyState.currentIndex + 1;\n }\n }, 0);\n }\n }\n\n if ((isForceClose || !isActive) && !isClosed.current) {\n if ((indexRef.current === historyState.currentIndex || !shouldReplaceNext)) {\n historyState.isHistoryAltered = true;\n window.history.back();\n\n setTimeout(() => {\n historyState.nextStateIndexToReplace = -1;\n }, 400);\n }\n historyState.currentIndexes.splice(historyState.currentIndexes.indexOf(indexRef.current), 1);\n\n isClosed.current = true;\n }\n } else {\n const prev = prevHashes || [];\n if (prev.length < hashes.length) {\n const index = ++historyState.currentIndex;\n historyState.currentIndexes.push(index);\n\n window.history.pushState({\n index,\n state: currentState,\n }, '', `#${hashes[hashes.length - 1]}`);\n\n indexHashRef.current.push({\n index,\n hash: hashes[hashes.length - 1],\n });\n } else {\n const delta = prev.length - hashes.length;\n if (isHashChangedFromEvent.current) {\n isHashChangedFromEvent.current = false;\n } else {\n if (hashes.length !== indexHashRef.current.length) {\n if (delta > 0) {\n const last = indexHashRef.current[indexHashRef.current.length - delta - 1];\n let realDelta = delta;\n if (last) {\n const indexLast = historyState.currentIndexes.findIndex(\n (l) => l === last.index,\n );\n realDelta = historyState.currentIndexes.length - indexLast - 1;\n }\n historyState.isHistoryAltered = true;\n window.history.go(-realDelta);\n const removed = indexHashRef.current.splice(indexHashRef.current.length - delta - 1, delta);\n removed.forEach(({ index }) => {\n historyState.currentIndexes.splice(historyState.currentIndexes.indexOf(index), 1);\n });\n }\n }\n\n if (hashes.length > 0) {\n setTimeout(() => {\n const index = ++historyState.currentIndex;\n historyState.currentIndexes[historyState.currentIndexes.length - 1] = index;\n\n window.history.replaceState({\n index,\n state: currentState,\n }, '', `#${hashes[hashes.length - 1]}`);\n\n indexHashRef.current[indexHashRef.current.length - 1] = {\n index,\n hash: hashes[hashes.length - 1],\n };\n }, 0);\n }\n }\n }\n }\n }, [currentState, hashes, isActive, prevHashes, shouldReplaceNext]);\n\n useEffect(() => {\n const handlePopState = (event: PopStateEvent) => {\n if (historyState.isHistoryAltered) {\n setTimeout(() => {\n historyState.isHistoryAltered = false;\n }, 0);\n return;\n }\n const { index: i } = event.state;\n const index = i || 0;\n try {\n const currIndex = hashes ? indexHashRef.current[indexHashRef.current.length - 1].index : indexRef.current;\n\n const prev = historyState.currentIndexes[historyState.currentIndexes.indexOf(currIndex) - 1];\n\n if (historyState.isDisabled) return;\n\n if ((!isClosed.current && (index === 0 || index === prev)) || (hashes && (index === 0 || index === prev))) {\n if (hashes) {\n isHashChangedFromEvent.current = true;\n indexHashRef.current.pop();\n }\n\n historyState.currentIndexes.splice(historyState.currentIndexes.indexOf(currIndex), 1);\n\n if (onBack) {\n if (historyState.isEdge) {\n getDispatch()\n .disableHistoryAnimations();\n }\n onBack(!historyState.isEdge);\n isClosed.current = true;\n }\n } else if (index === currIndex && isClosed.current && onForward && !hashes) {\n isForward.current = true;\n if (historyState.isEdge) {\n getDispatch()\n .disableHistoryAnimations();\n }\n onForward(event.state.state);\n }\n } catch (e) {\n // Forward navigation for hashed is not supported\n }\n };\n\n const hasChanged = hashes\n ? (!prevHashes || !areSortedArraysEqual(prevHashes, hashes))\n : prevIsActive !== isActive;\n\n if (!historyState.isDisabled && hasChanged) {\n handleChange();\n }\n\n window.addEventListener('popstate', handlePopState);\n return () => window.removeEventListener('popstate', handlePopState);\n }, [\n currentState, handleChange, hashes, isActive, onBack, onForward, prevHashes, prevIsActive, shouldReplaceNext,\n ]);\n\n return {\n forceClose: () => handleChange(true),\n };\n}\n","import { RefObject } from 'react';\nimport { useState, useCallback, useEffect } from '../lib/teact/teact';\n\nexport default (\n elementRef: RefObject,\n isOpen: boolean,\n onSelectWithEnter?: (index: number) => void,\n itemSelector?: string,\n noCaptureFocus?: boolean,\n) => {\n const [focusedIndex, setFocusedIndex] = useState(-1);\n\n useEffect(() => {\n setFocusedIndex(-1);\n\n const element = elementRef.current;\n if (isOpen && element && !noCaptureFocus) {\n element.tabIndex = -1;\n element.focus();\n }\n }, [elementRef, isOpen, noCaptureFocus]);\n\n const handleKeyDown = useCallback((e: React.KeyboardEvent) => {\n const element = elementRef.current;\n\n if (!element) {\n return;\n }\n\n if (e.keyCode === 13 && onSelectWithEnter) {\n onSelectWithEnter(focusedIndex);\n return;\n }\n\n if (e.keyCode !== 38 && e.keyCode !== 40) {\n return;\n }\n\n const focusedElement = document.activeElement;\n const elementChildren = Array.from(itemSelector ? element.querySelectorAll(itemSelector) : element.children);\n\n let newIndex = (focusedElement && elementChildren.indexOf(focusedElement)) || focusedIndex;\n\n if (e.keyCode === 38 && newIndex > 0) {\n newIndex--;\n } else if (e.keyCode === 40 && newIndex < elementChildren.length - 1) {\n newIndex++;\n } else if (elementChildren.length === 1) {\n newIndex = 0;\n } else {\n return;\n }\n\n const item = elementChildren[newIndex] as HTMLElement;\n if (item) {\n setFocusedIndex(newIndex);\n item.focus();\n }\n }, [elementRef, onSelectWithEnter, itemSelector, focusedIndex]);\n\n return handleKeyDown;\n};\n","import * as langProvider from '../util/langProvider';\nimport useForceUpdate from './useForceUpdate';\nimport useOnChange from './useOnChange';\n\nexport type LangFn = typeof langProvider.getTranslation;\n\nexport default (): LangFn => {\n const forceUpdate = useForceUpdate();\n\n useOnChange(() => {\n return langProvider.addCallback(forceUpdate);\n }, [forceUpdate]);\n\n return langProvider.getTranslation;\n};\n","import { useEffect } from '../lib/teact/teact';\n\nimport {\n BundleModules, Bundles, getModuleFromMemory, loadModule, addLoadListener,\n} from '../util/moduleLoader';\n\nimport useForceUpdate from './useForceUpdate';\n\nexport default >(\n bundleName: B, moduleName: M, noLoad = false, autoUpdate = false,\n) => {\n const module = getModuleFromMemory(bundleName, moduleName);\n const forceUpdate = useForceUpdate();\n\n if (autoUpdate) {\n // Use effect and cleanup for listener removal\n addLoadListener(forceUpdate);\n }\n\n useEffect(() => {\n if (!noLoad && !module) {\n loadModule(bundleName, moduleName).then(forceUpdate);\n }\n }, [bundleName, forceUpdate, module, moduleName, noLoad]);\n\n return module;\n};\n","import usePrevious from './usePrevious';\n\nexport default (cb: (args: PT) => void, dependencies: T) => {\n const prevDeps = usePrevious(dependencies);\n if (!prevDeps || dependencies.some((d, i) => d !== prevDeps[i])) {\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n cb(prevDeps || []);\n }\n};\n","import { useRef } from '../lib/teact/teact';\n\nfunction usePrevious(next: T): T | undefined;\nfunction usePrevious(next: T, shouldSkipUndefined: true): Exclude | undefined;\nfunction usePrevious(next: T, shouldSkipUndefined?: boolean): Exclude | undefined;\nfunction usePrevious(next: T, shouldSkipUndefined?: boolean) {\n const ref = useRef();\n const { current } = ref;\n if (!shouldSkipUndefined || next !== undefined) {\n ref.current = next;\n }\n\n return current;\n}\n\nexport default usePrevious;\n","import { useRef, useState } from '../lib/teact/teact';\nimport buildClassName from '../util/buildClassName';\n\nconst CLOSE_DURATION = 350;\n\nexport default (\n isOpen = false,\n onCloseTransitionEnd?: () => void,\n noOpenTransition = false,\n className: string | false = 'fast',\n noCloseTransition = false,\n) => {\n const [isClosed, setIsClosed] = useState(!isOpen);\n const closeTimeoutRef = useRef();\n // СSS class should be added in a separate tick to turn on CSS transition.\n const [hasOpenClassName, setHasOpenClassName] = useState(isOpen && noOpenTransition);\n\n if (isOpen) {\n setIsClosed(false);\n setHasOpenClassName(true);\n\n if (closeTimeoutRef.current) {\n window.clearTimeout(closeTimeoutRef.current);\n closeTimeoutRef.current = undefined;\n }\n } else {\n setHasOpenClassName(false);\n\n if (!isClosed && !closeTimeoutRef.current) {\n closeTimeoutRef.current = window.setTimeout(() => {\n setIsClosed(true);\n\n if (onCloseTransitionEnd) {\n onCloseTransitionEnd();\n }\n\n closeTimeoutRef.current = undefined;\n }, noCloseTransition ? 0 : CLOSE_DURATION);\n }\n }\n\n // `noCloseTransition`, when set to true, should remove the open class immediately\n const shouldHaveOpenClassName = hasOpenClassName && !(noCloseTransition && !isOpen);\n const isClosing = Boolean(closeTimeoutRef.current);\n const shouldRender = isOpen || isClosing;\n const transitionClassNames = buildClassName(\n className && 'opacity-transition',\n className,\n shouldHaveOpenClassName && 'open',\n shouldRender && 'shown',\n isClosing && 'closing',\n );\n\n return {\n shouldRender,\n transitionClassNames,\n };\n};\n","import { RefObject } from 'react';\nimport { useEffect } from '../lib/teact/teact';\n\nconst BACKDROP_CLASSNAME = 'backdrop';\n\n// This effect implements closing menus by clicking outside of them\n// without adding extra elements to the DOM\nexport default function useVirtualBackdrop(\n isOpen: boolean,\n menuRef: RefObject,\n onClose?: () => void | undefined,\n) {\n useEffect(() => {\n const handleEvent = (e: Event) => {\n const menu = menuRef.current;\n const target = e.target as HTMLElement | null;\n if (!menu || !target) {\n return;\n }\n\n if (\n !menu.contains(e.target as Node | null)\n || target.classList.contains(BACKDROP_CLASSNAME)\n ) {\n e.preventDefault();\n e.stopPropagation();\n if (onClose) {\n onClose();\n }\n }\n };\n\n if (isOpen && onClose) {\n document.addEventListener('mousedown', handleEvent);\n }\n\n return () => {\n document.removeEventListener('mousedown', handleEvent);\n };\n }, [isOpen, menuRef, onClose]);\n}\n","import { DEBUG } from '../../config';\n\ntype Handler = (e: Event) => void;\n\nconst NON_BUBBLEABLE_EVENTS = new Set(['scroll', 'mouseenter', 'mouseleave']);\n\nconst delegationRegistry: Record> = {};\nconst delegatedEventsByElement = new Map>();\nconst documentEventCounters: Record = {};\n\nexport function addEventListener(element: HTMLElement, propName: string, handler: Handler, asCapture = false) {\n const eventName = resolveEventName(propName, element);\n if (canUseEventDelegation(eventName, element, asCapture)) {\n addDelegatedListener(eventName, element, handler);\n } else {\n element.addEventListener(eventName, handler, asCapture);\n }\n}\n\nexport function removeEventListener(element: HTMLElement, propName: string, handler: Handler, asCapture = false) {\n const eventName = resolveEventName(propName, element);\n if (canUseEventDelegation(eventName, element, asCapture)) {\n removeDelegatedListener(eventName, element);\n } else {\n element.removeEventListener(eventName, handler, asCapture);\n }\n}\n\nfunction resolveEventName(propName: string, element: HTMLElement) {\n const eventName = propName\n .replace(/^on/, '')\n .replace(/Capture$/, '').toLowerCase();\n\n if (eventName === 'change' && element.tagName !== 'SELECT') {\n // React behavior repeated here.\n // https://stackoverflow.com/questions/38256332/in-react-whats-the-difference-between-onchange-and-oninput\n return 'input';\n }\n\n if (eventName === 'doubleclick') {\n return 'dblclick';\n }\n\n // Replace focus/blur by their \"bubbleable\" versions\n if (eventName === 'focus') {\n return 'focusin';\n }\n\n if (eventName === 'blur') {\n return 'focusout';\n }\n\n return eventName;\n}\n\nfunction canUseEventDelegation(realEventName: string, element: HTMLElement, asCapture: boolean) {\n return (\n !asCapture\n && !NON_BUBBLEABLE_EVENTS.has(realEventName)\n && element.tagName !== 'VIDEO'\n && element.tagName !== 'IFRAME'\n );\n}\n\nfunction addDelegatedListener(eventName: string, element: HTMLElement, handler: Handler) {\n if (!documentEventCounters[eventName]) {\n documentEventCounters[eventName] = 0;\n document.addEventListener(eventName, handleEvent);\n }\n\n resolveDelegationRegistryForName(eventName).set(element, handler);\n resolveDelegatedEventsForElement(element).add(eventName);\n documentEventCounters[eventName]++;\n}\n\nfunction removeDelegatedListener(eventName: string, element: HTMLElement) {\n documentEventCounters[eventName]--;\n if (!documentEventCounters[eventName]) {\n // Synchronous deletion on 0 will cause perf degradation in the case of 1 element\n // which is not a real case, so it's ok to do it this way\n document.removeEventListener(eventName, handleEvent);\n }\n\n delegationRegistry[eventName].delete(element);\n delegatedEventsByElement.get(element)!.delete(eventName);\n}\n\nexport function removeAllDelegatedListeners(element: HTMLElement) {\n const eventNames = delegatedEventsByElement.get(element);\n if (!eventNames) {\n return;\n }\n\n eventNames.forEach((eventName) => removeDelegatedListener(eventName, element));\n delegatedEventsByElement.delete(element);\n}\n\nfunction handleEvent(realEvent: Event) {\n const events = delegationRegistry[realEvent.type];\n\n if (events) {\n let furtherCallsPrevented = false;\n let current: HTMLElement = realEvent.target as HTMLElement;\n\n const stopPropagation = () => {\n furtherCallsPrevented = true;\n };\n\n const preventDefault = () => {\n realEvent.preventDefault();\n };\n\n // Proxy is a simplest way to provide an access to the event property\n const event = new Proxy(realEvent, {\n get(target, p) {\n if (p === 'currentTarget') {\n return current;\n }\n if (p === 'stopPropagation' || p === 'stopImmediatePropagation') {\n return stopPropagation;\n }\n if (p === 'preventDefault') {\n // \"this\" is changed to proxy and one can't call methods via it\n return preventDefault;\n }\n return Reflect.get(target, p);\n },\n });\n\n // This can also be limited by teact root\n while (current && current !== document.body) {\n const handler = events.get(current);\n if (handler) {\n handler(event);\n if (furtherCallsPrevented) {\n return;\n }\n }\n\n current = current.parentNode as HTMLElement;\n }\n }\n}\n\nfunction resolveDelegationRegistryForName(eventName: string) {\n if (!delegationRegistry[eventName]) {\n delegationRegistry[eventName] = new Map();\n }\n\n return delegationRegistry[eventName];\n}\n\nfunction resolveDelegatedEventsForElement(element: HTMLElement) {\n const existing = delegatedEventsByElement.get(element);\n if (existing) {\n return existing;\n }\n\n const newSet = new Set();\n delegatedEventsByElement.set(element, newSet);\n\n return newSet;\n}\n\nif (DEBUG) {\n document.addEventListener('dblclick', () => {\n // eslint-disable-next-line no-console\n console.log('DELEGATED EVENTS', { delegationRegistry, delegatedEventsByElement, documentEventCounters });\n });\n}\n","import {\n hasElementChanged,\n isComponentElement,\n isEmptyElement,\n isRealElement,\n isTextElement,\n mountComponent,\n renderComponent,\n unmountTree,\n getTarget,\n setTarget,\n VirtualElement,\n VirtualElementComponent,\n VirtualRealElement,\n} from './teact';\nimport generateIdFor from '../../util/generateIdFor';\nimport { DEBUG } from '../../config';\nimport { addEventListener, removeEventListener } from './dom-events';\n\ntype VirtualDomHead = {\n children: [VirtualElement] | [];\n};\n\nconst FILTERED_ATTRIBUTES = new Set(['key', 'ref', 'teactFastList', 'teactOrderKey']);\nconst HTML_ATTRIBUTES = new Set(['dir']);\nconst MAPPED_ATTRIBUTES: { [k: string]: string } = {\n autoPlay: 'autoplay',\n autoComplete: 'autocomplete',\n};\nconst INDEX_KEY_PREFIX = '__indexKey#';\n\nconst headsByElement: Record = {};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nlet DEBUG_virtualTreeSize = 1;\n\nfunction render($element?: VirtualElement, parentEl?: HTMLElement | null) {\n if (!parentEl) {\n return undefined;\n }\n\n let headId = parentEl.getAttribute('data-teact-head-id');\n if (!headId) {\n headId = generateIdFor(headsByElement);\n headsByElement[headId] = { children: [] };\n parentEl.setAttribute('data-teact-head-id', headId);\n }\n\n const $head = headsByElement[headId];\n $head.children = [renderWithVirtual(parentEl, $head.children[0], $element, $head, 0) as VirtualElement];\n\n if (process.env.APP_ENV === 'perf') {\n DEBUG_virtualTreeSize = 0;\n DEBUG_addToVirtualTreeSize($head);\n\n return DEBUG_virtualTreeSize;\n }\n\n return undefined;\n}\n\nfunction renderWithVirtual(\n parentEl: HTMLElement,\n $current: VirtualElement | undefined,\n $new: VirtualElement | undefined,\n $parent: VirtualRealElement | VirtualDomHead,\n index: number,\n {\n skipComponentUpdate = false,\n forceIndex = false,\n fragment,\n moveDirection,\n }: {\n skipComponentUpdate?: boolean;\n forceIndex?: boolean;\n fragment?: DocumentFragment;\n moveDirection?: 'up' | 'down';\n } = {},\n) {\n if (\n !skipComponentUpdate\n && $current && $new\n && isComponentElement($current) && isComponentElement($new)\n && !hasElementChanged($current, $new)\n ) {\n $new = updateComponent($current, $new);\n }\n\n // Parent element may have changed, so we need to update the listener closure.\n if (!skipComponentUpdate && $new && isComponentElement($new) && $new.componentInstance.isMounted) {\n setupComponentUpdateListener($new, $parent, index, parentEl);\n }\n\n if ($current === $new) {\n return $new;\n }\n\n if (!$current && $new) {\n if (isComponentElement($new)) {\n $new = initComponent($new, $parent, index, parentEl);\n }\n\n const node = createNode($new);\n setTarget($new, node);\n\n if (forceIndex && parentEl.childNodes[index]) {\n parentEl.insertBefore(node, parentEl.childNodes[index]);\n } else {\n (fragment || parentEl).appendChild(node);\n }\n } else if ($current && !$new) {\n parentEl.removeChild(getTarget($current)!);\n unmountTree($current);\n } else if ($current && $new) {\n if (hasElementChanged($current, $new)) {\n if (isComponentElement($new)) {\n $new = initComponent($new, $parent, index, parentEl);\n }\n\n const node = createNode($new);\n setTarget($new, node);\n parentEl.replaceChild(node, getTarget($current)!);\n unmountTree($current);\n } else {\n const areComponents = isComponentElement($current) && isComponentElement($new);\n\n if (!areComponents) {\n setTarget($new, getTarget($current)!);\n }\n\n if (isRealElement($current) && isRealElement($new)) {\n if (moveDirection) {\n const node = getTarget($current)!;\n const nextSibling = parentEl.childNodes[moveDirection === 'up' ? index : index + 1];\n\n if (nextSibling) {\n parentEl.insertBefore(node, nextSibling);\n } else {\n (fragment || parentEl).appendChild(node);\n }\n }\n\n if (!areComponents) {\n updateAttributes($current, $new, getTarget($current) as HTMLElement);\n }\n\n $new.children = renderChildren(\n $current,\n $new,\n areComponents ? parentEl : getTarget($current) as HTMLElement,\n );\n }\n }\n }\n\n return $new;\n}\n\nfunction initComponent(\n $element: VirtualElementComponent, $parent: VirtualRealElement | VirtualDomHead, index: number, parentEl: HTMLElement,\n) {\n if (!isComponentElement($element)) {\n return $element;\n }\n\n const { componentInstance } = $element;\n\n if (!componentInstance.isMounted) {\n $element = mountComponent(componentInstance);\n setupComponentUpdateListener($element, $parent, index, parentEl);\n\n const $firstChild = $element.children[0];\n if (isComponentElement($firstChild)) {\n $element.children = [initComponent($firstChild, $element, 0, parentEl)];\n }\n\n componentInstance.isMounted = true;\n }\n\n return $element;\n}\n\nfunction updateComponent($current: VirtualElementComponent, $new: VirtualElementComponent) {\n $current.componentInstance.props = $new.componentInstance.props;\n\n return renderComponent($current.componentInstance);\n}\n\nfunction setupComponentUpdateListener(\n $element: VirtualElementComponent, $parent: VirtualRealElement | VirtualDomHead, index: number, parentEl: HTMLElement,\n) {\n const { componentInstance } = $element;\n\n componentInstance.onUpdate = () => {\n $parent.children[index] = renderWithVirtual(\n parentEl,\n $parent.children[index],\n componentInstance.$element,\n $parent,\n index,\n { skipComponentUpdate: true },\n ) as VirtualElementComponent;\n };\n}\n\nfunction createNode($element: VirtualElement): Node {\n if (isEmptyElement($element)) {\n return document.createTextNode('');\n }\n\n if (isTextElement($element)) {\n return document.createTextNode($element.value);\n }\n\n if (isComponentElement($element)) {\n return createNode($element.children[0] as VirtualElement);\n }\n\n const { tag, props, children = [] } = $element;\n const element = document.createElement(tag);\n\n if (typeof props.ref === 'object') {\n props.ref.current = element;\n }\n\n Object.keys(props).forEach((key) => {\n addAttribute(element, key, props[key]);\n });\n\n $element.children = children.map(($child, i) => (\n renderWithVirtual(element, undefined, $child, $element, i) as VirtualElement\n ));\n\n return element;\n}\n\nfunction renderChildren(\n $current: VirtualRealElement, $new: VirtualRealElement, currentEl: HTMLElement,\n) {\n if ($new.props.teactFastList) {\n return renderFastListChildren($current, $new, currentEl);\n }\n\n const maxLength = Math.max($current.children.length, $new.children.length);\n const newChildren = [];\n const fragment = $new.children.length > $current.children.length + 1 ? document.createDocumentFragment() : undefined;\n\n for (let i = 0; i < maxLength; i++) {\n const $newChild = renderWithVirtual(\n currentEl,\n $current.children[i],\n $new.children[i],\n $new,\n i,\n i >= $current.children.length ? { fragment } : undefined,\n );\n\n if ($newChild) {\n newChildren.push($newChild);\n }\n }\n\n if (fragment) {\n currentEl.appendChild(fragment);\n }\n\n return newChildren;\n}\n\nfunction renderFastListChildren($current: VirtualRealElement, $new: VirtualRealElement, currentEl: HTMLElement) {\n const newKeys = new Set(\n $new.children.map(($newChild) => {\n const key = 'props' in $newChild && $newChild.props.key;\n\n if (DEBUG && isRealElement($newChild) && !key) {\n // eslint-disable-next-line no-console\n console.warn('Missing `key` in `teactFastList`');\n }\n\n return key;\n }),\n );\n\n let currentRemainingIndex = 0;\n const remainingByKey = $current.children\n .reduce((acc, $currentChild, i) => {\n let key = 'props' in $currentChild ? $currentChild.props.key : undefined;\n\n // First we handle removed children\n if (key && !newKeys.has(key)) {\n renderWithVirtual(currentEl, $currentChild, undefined, $new, -1);\n\n return acc;\n } else if (!key) {\n const $newChild = $new.children[i];\n const newChildKey = ($newChild && 'props' in $newChild) ? $newChild.props.key : undefined;\n // If a non-key element remains at the same index we preserve it with a virtual `key`\n if ($newChild && !newChildKey) {\n key = `${INDEX_KEY_PREFIX}${i}`;\n } else {\n renderWithVirtual(currentEl, $currentChild, undefined, $new, -1);\n\n return acc;\n }\n }\n\n // Then we build up info about remaining children\n acc[key] = {\n $element: $currentChild,\n index: currentRemainingIndex++,\n order: 'props' in $currentChild ? $currentChild.props.teactOrderKey : undefined,\n };\n return acc;\n }, {} as Record);\n\n let newChildren: VirtualElement[] = [];\n\n let fragmentQueue: VirtualElement[] | undefined;\n let fragmentIndex: number | undefined;\n\n let currentPreservedIndex = 0;\n\n $new.children.forEach(($newChild, i) => {\n const key = 'props' in $newChild ? $newChild.props.key : `${INDEX_KEY_PREFIX}${i}`;\n const currentChildInfo = remainingByKey[key];\n\n if (!currentChildInfo) {\n // All new nodes are queued to be inserted with fragments if possible.\n if (!fragmentQueue) {\n fragmentQueue = [];\n fragmentIndex = i;\n }\n\n fragmentQueue.push($newChild);\n return;\n }\n\n if (fragmentQueue) {\n newChildren = newChildren.concat(flushFragmentQueue(fragmentQueue, fragmentIndex!, currentEl, $new));\n fragmentIndex = undefined;\n fragmentQueue = undefined;\n }\n\n // This is a \"magic\" `teactOrderKey` property that tells us the element is updated\n const order = 'props' in $newChild ? $newChild.props.teactOrderKey : undefined;\n const shouldMoveNode = currentChildInfo.index !== currentPreservedIndex && currentChildInfo.order !== order;\n const isMovingDown = shouldMoveNode && currentPreservedIndex > currentChildInfo.index;\n\n // When the node goes down, preserved indexing actually breaks, so the \"magic\" should help.\n if (!shouldMoveNode || isMovingDown) {\n currentPreservedIndex++;\n }\n\n newChildren.push(\n renderWithVirtual(currentEl, currentChildInfo.$element, $newChild, $new, i, {\n forceIndex: true,\n ...(shouldMoveNode && {\n moveDirection: isMovingDown ? 'down' : 'up',\n }),\n })!,\n );\n });\n\n if (fragmentQueue) {\n newChildren = newChildren.concat(flushFragmentQueue(fragmentQueue, fragmentIndex!, currentEl, $new));\n }\n\n return newChildren;\n}\n\nfunction flushFragmentQueue(\n fragmentQueue: VirtualElement[], fragmentIndex: number, parentEl: HTMLElement, $parent: VirtualRealElement,\n) {\n if (fragmentQueue.length === 1) {\n return [renderWithVirtual(parentEl, undefined, fragmentQueue[0], $parent, fragmentIndex, { forceIndex: true })!];\n } else if (fragmentQueue.length > 1) {\n const fragment = document.createDocumentFragment();\n const newChildren = fragmentQueue.map(($fragmentChild) => (\n renderWithVirtual(parentEl, undefined, $fragmentChild, $parent, fragmentIndex!, { fragment })!\n ));\n\n if (parentEl.childNodes[fragmentIndex]) {\n parentEl.insertBefore(fragment, parentEl.childNodes[fragmentIndex]);\n } else {\n parentEl.appendChild(fragment);\n }\n\n return newChildren;\n }\n\n throw new Error('Unexpected input');\n}\n\nfunction updateAttributes($current: VirtualRealElement, $new: VirtualRealElement, element: HTMLElement) {\n const currentKeys = Object.keys($current.props);\n const newKeys = Object.keys($new.props);\n\n currentKeys.forEach((key) => {\n if ($current.props[key] !== undefined && $new.props[key] === undefined) {\n removeAttribute(element, key, $current.props[key]);\n }\n });\n\n newKeys.forEach((key) => {\n if ($new.props[key] === undefined) {\n return;\n }\n\n if ($current.props[key] !== $new.props[key]) {\n if ($current.props[key] === undefined) {\n addAttribute(element, key, $new.props[key]);\n } else {\n updateAttribute(element, key, $current.props[key], $new.props[key]);\n }\n }\n });\n}\n\nfunction addAttribute(element: HTMLElement, key: string, value: any) {\n if (value === undefined) {\n return;\n }\n\n // An optimization attempt\n if (key === 'className') {\n element.className = value;\n // An optimization attempt\n } else if (key === 'value') {\n (element as HTMLInputElement).value = value;\n } else if (key === 'style') {\n element.style.cssText = value;\n } else if (key.startsWith('on')) {\n addEventListener(element, key, value, key.endsWith('Capture'));\n } else if (key.startsWith('data-') || HTML_ATTRIBUTES.has(key)) {\n element.setAttribute(key, value);\n } else if (!FILTERED_ATTRIBUTES.has(key)) {\n (element as any)[MAPPED_ATTRIBUTES[key] || key] = value;\n }\n}\n\nfunction removeAttribute(element: HTMLElement, key: string, value: any) {\n if (key === 'className') {\n element.className = '';\n } else if (key === 'value') {\n (element as HTMLInputElement).value = '';\n } else if (key === 'style') {\n element.style.cssText = '';\n } else if (key.startsWith('on')) {\n removeEventListener(element, key, value, key.endsWith('Capture'));\n } else if (key.startsWith('data-') || HTML_ATTRIBUTES.has(key)) {\n element.removeAttribute(key);\n } else if (!FILTERED_ATTRIBUTES.has(key)) {\n delete (element as any)[MAPPED_ATTRIBUTES[key] || key];\n }\n}\n\nfunction updateAttribute(element: HTMLElement, key: string, oldValue: any, newValue: any) {\n if (key === 'value') {\n // Removing and adding value causes a cursor jump\n (element as HTMLInputElement).value = newValue !== undefined ? newValue : '';\n } else {\n removeAttribute(element, key, oldValue);\n addAttribute(element, key, newValue);\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction DEBUG_addToVirtualTreeSize($current: VirtualRealElement | VirtualDomHead) {\n DEBUG_virtualTreeSize += $current.children.length;\n\n $current.children.forEach(($child) => {\n if (isRealElement($child)) {\n DEBUG_addToVirtualTreeSize($child);\n }\n });\n}\n\nexport default { render };\n","import { DEBUG, DEBUG_MORE } from '../../config';\nimport {\n fastRaf, onTickEnd, throttleWithPrimaryRaf, throttleWithRaf,\n} from '../../util/schedulers';\nimport { flatten, orderBy } from '../../util/iteratees';\nimport arePropsShallowEqual, { getUnequalProps } from '../../util/arePropsShallowEqual';\nimport { handleError } from '../../util/handleError';\nimport { removeAllDelegatedListeners } from './dom-events';\n\nexport type Props = AnyLiteral;\nexport type FC

= (props: P) => any;\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport type FC_withDebug =\n FC\n & {\n DEBUG_contentComponentName?: string;\n };\n\nexport enum VirtualElementTypesEnum {\n Empty,\n Text,\n Tag,\n Component,\n}\n\ninterface VirtualElementEmpty {\n type: VirtualElementTypesEnum.Empty;\n target?: Node;\n}\n\ninterface VirtualElementText {\n type: VirtualElementTypesEnum.Text;\n target?: Node;\n value: string;\n}\n\nexport interface VirtualElementTag {\n type: VirtualElementTypesEnum.Tag;\n target?: Node;\n tag: string;\n props: Props;\n children: VirtualElementChildren;\n}\n\nexport interface VirtualElementComponent {\n type: VirtualElementTypesEnum.Component;\n componentInstance: ComponentInstance;\n props: Props;\n children: VirtualElementChildren;\n}\n\nexport type StateHookSetter = (newValue: ((current: T) => T) | T) => void;\n\ninterface ComponentInstance {\n $element: VirtualElementComponent;\n Component: FC;\n name: string;\n props: Props;\n renderedValue?: any;\n isMounted: boolean;\n hooks: {\n state: {\n cursor: number;\n byCursor: {\n value: any;\n nextValue: any;\n setter: StateHookSetter;\n }[];\n };\n effects: {\n cursor: number;\n byCursor: {\n effect: () => void;\n dependencies?: any[];\n cleanup?: Function;\n }[];\n };\n memos: {\n cursor: number;\n byCursor: {\n current: any;\n dependencies: any[];\n }[];\n };\n };\n prepareForFrame?: () => void;\n forceUpdate?: () => void;\n onUpdate?: () => void;\n}\n\nexport type VirtualElement =\n VirtualElementEmpty\n | VirtualElementText\n | VirtualElementTag\n | VirtualElementComponent;\nexport type VirtualRealElement =\n VirtualElementTag\n | VirtualElementComponent;\nexport type VirtualElementChildren = VirtualElement[];\n\nconst Fragment = Symbol('Fragment');\n\nlet renderingInstance: ComponentInstance;\n\nexport function isEmptyElement($element: VirtualElement): $element is VirtualElementEmpty {\n return $element.type === VirtualElementTypesEnum.Empty;\n}\n\nexport function isTextElement($element: VirtualElement): $element is VirtualElementText {\n return $element.type === VirtualElementTypesEnum.Text;\n}\n\nexport function isTagElement($element: VirtualElement): $element is VirtualElementTag {\n return $element.type === VirtualElementTypesEnum.Tag;\n}\n\nexport function isComponentElement($element: VirtualElement): $element is VirtualElementComponent {\n return $element.type === VirtualElementTypesEnum.Component;\n}\n\nexport function isRealElement($element: VirtualElement): $element is VirtualRealElement {\n return isTagElement($element) || isComponentElement($element);\n}\n\nfunction createElement(\n source: string | FC | typeof Fragment,\n props: Props,\n ...children: any[]\n): VirtualRealElement | VirtualElementChildren {\n if (!props) {\n props = {};\n }\n\n children = flatten(children);\n\n if (source === Fragment) {\n return children;\n } else if (typeof source === 'function') {\n return createComponentInstance(source, props, children);\n } else {\n return buildTagElement(source, props, children);\n }\n}\n\nfunction createComponentInstance(Component: FC, props: Props, children: any[]): VirtualElementComponent {\n let parsedChildren: any | any[] | undefined;\n if (children.length === 0) {\n parsedChildren = undefined;\n } else if (children.length === 1) {\n [parsedChildren] = children;\n } else {\n parsedChildren = children;\n }\n\n const componentInstance: ComponentInstance = {\n $element: {} as VirtualElementComponent,\n Component,\n name: Component.name,\n props: {\n ...props,\n ...(parsedChildren && { children: parsedChildren }),\n },\n isMounted: false,\n hooks: {\n state: {\n cursor: 0,\n byCursor: [],\n },\n effects: {\n cursor: 0,\n byCursor: [],\n },\n memos: {\n cursor: 0,\n byCursor: [],\n },\n },\n };\n\n componentInstance.$element = buildComponentElement(componentInstance);\n\n return componentInstance.$element;\n}\n\nfunction buildComponentElement(\n componentInstance: ComponentInstance,\n children: VirtualElementChildren = [],\n): VirtualElementComponent {\n const { props } = componentInstance;\n\n return {\n componentInstance,\n type: VirtualElementTypesEnum.Component,\n props,\n children,\n };\n}\n\nfunction buildTagElement(tag: string, props: Props, children: any[]): VirtualElementTag {\n return {\n type: VirtualElementTypesEnum.Tag,\n tag,\n props,\n children: dropEmptyTail(children).map(buildChildElement),\n };\n}\n\n// We only need placeholders in the middle of collection (to ensure other elements order).\nfunction dropEmptyTail(children: any[]) {\n let i = children.length - 1;\n\n for (; i >= 0; i--) {\n if (!isEmptyPlaceholder(children[i])) {\n break;\n }\n }\n\n return i + 1 < children.length ? children.slice(0, i + 1) : children;\n}\n\nfunction isEmptyPlaceholder(child: any) {\n // eslint-disable-next-line no-null/no-null\n return child === false || child === null || child === undefined;\n}\n\nfunction buildChildElement(child: any): VirtualElement {\n if (isEmptyPlaceholder(child)) {\n return buildEmptyElement();\n } else if (isRealElement(child)) {\n return child;\n } else {\n return buildTextElement(child);\n }\n}\n\nfunction buildTextElement(value: any): VirtualElementText {\n return {\n type: VirtualElementTypesEnum.Text,\n value: String(value),\n };\n}\n\nfunction buildEmptyElement(): VirtualElementEmpty {\n return { type: VirtualElementTypesEnum.Empty };\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst DEBUG_components: AnyLiteral = {};\n\ndocument.addEventListener('dblclick', () => {\n // eslint-disable-next-line no-console\n console.log('COMPONENTS', orderBy(Object.values(DEBUG_components), 'renderCount', 'desc'));\n});\n\nexport function renderComponent(componentInstance: ComponentInstance) {\n renderingInstance = componentInstance;\n componentInstance.hooks.state.cursor = 0;\n componentInstance.hooks.effects.cursor = 0;\n componentInstance.hooks.memos.cursor = 0;\n\n const { Component, props } = componentInstance;\n let newRenderedValue;\n\n try {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n let DEBUG_startAt: number | undefined;\n if (DEBUG) {\n const componentName = componentInstance.name;\n if (!DEBUG_components[componentName]) {\n DEBUG_components[componentName] = {\n componentName,\n renderCount: 0,\n renderTimes: [],\n };\n }\n\n if (DEBUG_MORE) {\n if (componentName !== 'TeactMemoWrapper' && componentName !== 'TeactNContainer') {\n // eslint-disable-next-line no-console\n console.log(`[Teact] Render ${componentName}`);\n }\n }\n\n DEBUG_startAt = performance.now();\n }\n\n newRenderedValue = Component(props);\n\n if (DEBUG) {\n const renderTime = performance.now() - DEBUG_startAt!;\n const componentName = componentInstance.name;\n if (renderTime > 7) {\n // eslint-disable-next-line no-console\n console.warn(`[Teact] Slow component render: ${componentName}, ${Math.round(renderTime)} ms`);\n }\n DEBUG_components[componentName].renderTimes.push(renderTime);\n DEBUG_components[componentName].renderCount++;\n }\n } catch (err) {\n handleError(err);\n\n newRenderedValue = componentInstance.renderedValue;\n }\n\n if (componentInstance.isMounted && newRenderedValue === componentInstance.renderedValue) {\n return componentInstance.$element;\n }\n\n componentInstance.renderedValue = newRenderedValue;\n\n const newChild = buildChildElement(newRenderedValue);\n componentInstance.$element = buildComponentElement(componentInstance, [newChild]);\n\n return componentInstance.$element;\n}\n\nexport function hasElementChanged($old: VirtualElement, $new: VirtualElement) {\n if (typeof $old !== typeof $new) {\n return true;\n } else if ($old.type !== $new.type) {\n return true;\n } else if (isTextElement($old) && isTextElement($new)) {\n return $old.value !== $new.value;\n } else if (isTagElement($old) && isTagElement($new)) {\n return ($old.tag !== $new.tag) || ($old.props.key !== $new.props.key);\n } else if (isComponentElement($old) && isComponentElement($new)) {\n return (\n $old.componentInstance.Component !== $new.componentInstance.Component\n ) || (\n $old.props.key !== $new.props.key\n );\n }\n\n return false;\n}\n\nexport function unmountTree($element: VirtualElement) {\n if (!isRealElement($element)) {\n return;\n }\n\n if (isComponentElement($element)) {\n unmountComponent($element.componentInstance);\n } else if ($element.target) {\n removeAllDelegatedListeners($element.target as HTMLElement);\n // Trying to help GC\n // eslint-disable-next-line no-null/no-null\n $element.target = null as any;\n }\n\n $element.children.forEach(unmountTree);\n}\n\nexport function mountComponent(componentInstance: ComponentInstance) {\n renderComponent(componentInstance);\n componentInstance.isMounted = true;\n return componentInstance.$element;\n}\n\nfunction unmountComponent(componentInstance: ComponentInstance) {\n if (!componentInstance.isMounted) {\n return;\n }\n\n componentInstance.hooks.memos.byCursor.forEach((hook) => {\n // eslint-disable-next-line no-null/no-null\n hook.current = null;\n });\n\n componentInstance.hooks.effects.byCursor.forEach(({ cleanup }) => {\n if (typeof cleanup === 'function') {\n try {\n cleanup();\n } catch (err) {\n handleError(err);\n }\n }\n });\n\n componentInstance.isMounted = false;\n\n helpGc(componentInstance);\n}\n\n// We need to remove all references to DOM objects. We also clean all other references, just in case.\nfunction helpGc(componentInstance: ComponentInstance) {\n /* eslint-disable no-null/no-null */\n\n componentInstance.hooks.effects.byCursor.forEach((hook) => {\n hook.cleanup = null as any;\n hook.effect = null as any;\n hook.dependencies = null as any;\n });\n\n componentInstance.hooks.state.byCursor.forEach((hook) => {\n hook.value = null as any;\n hook.nextValue = null as any;\n hook.setter = null as any;\n });\n\n componentInstance.hooks.memos.byCursor.forEach((hook) => {\n hook.dependencies = null as any;\n });\n\n componentInstance.hooks = null as any;\n componentInstance.$element = null as any;\n componentInstance.renderedValue = null as any;\n componentInstance.Component = null as any;\n componentInstance.props = null as any;\n componentInstance.forceUpdate = null as any;\n componentInstance.onUpdate = null as any;\n\n /* eslint-enable no-null/no-null */\n}\n\nfunction prepareComponentForFrame(componentInstance: ComponentInstance) {\n if (!componentInstance.isMounted) {\n return;\n }\n\n componentInstance.hooks.state.byCursor.forEach((hook) => {\n hook.value = hook.nextValue;\n });\n\n componentInstance.prepareForFrame = throttleWithPrimaryRaf(() => prepareComponentForFrame(componentInstance));\n componentInstance.forceUpdate = throttleWithRaf(() => forceUpdateComponent(componentInstance));\n}\n\nfunction forceUpdateComponent(componentInstance: ComponentInstance) {\n if (!componentInstance.isMounted || !componentInstance.onUpdate) {\n return;\n }\n\n const currentElement = componentInstance.$element;\n\n renderComponent(componentInstance);\n\n if (componentInstance.$element !== currentElement) {\n componentInstance.onUpdate();\n }\n}\n\nexport function getTarget($element: VirtualElement): Node | undefined {\n if (isComponentElement($element)) {\n return getTarget($element.children[0]);\n } else {\n return $element.target;\n }\n}\n\nexport function setTarget($element: VirtualElement, target: Node) {\n if (isComponentElement($element)) {\n setTarget($element.children[0], target);\n } else {\n $element.target = target;\n }\n}\n\nexport function useState(initial?: T): [T, StateHookSetter] {\n const { cursor, byCursor } = renderingInstance.hooks.state;\n\n if (byCursor[cursor] === undefined) {\n byCursor[cursor] = {\n value: initial,\n nextValue: initial,\n setter: ((componentInstance) => (newValue: ((current: T) => T) | T) => {\n if (byCursor[cursor].nextValue !== newValue) {\n byCursor[cursor].nextValue = typeof newValue === 'function'\n ? (newValue as (current: T) => T)(byCursor[cursor].value)\n : newValue;\n\n if (!componentInstance.prepareForFrame || !componentInstance.forceUpdate) {\n componentInstance.prepareForFrame = throttleWithPrimaryRaf(\n () => prepareComponentForFrame(componentInstance),\n );\n componentInstance.forceUpdate = throttleWithRaf(\n () => forceUpdateComponent(componentInstance),\n );\n }\n\n componentInstance.prepareForFrame();\n componentInstance.forceUpdate();\n\n if (DEBUG_MORE) {\n if (componentInstance.name !== 'TeactNContainer') {\n // eslint-disable-next-line no-console\n console.log(\n '[Teact.useState]',\n componentInstance.name,\n // `componentInstance.Component` may be set to `null` by GC helper\n componentInstance.Component && (componentInstance.Component as FC_withDebug).DEBUG_contentComponentName\n ? `> ${(componentInstance.Component as FC_withDebug).DEBUG_contentComponentName}`\n : '',\n `Forced update at cursor #${cursor}, next value: `,\n byCursor[cursor].nextValue,\n );\n }\n }\n }\n })(renderingInstance),\n };\n }\n\n renderingInstance.hooks.state.cursor++;\n\n return [\n byCursor[cursor].value,\n byCursor[cursor].setter,\n ];\n}\n\nfunction useLayoutEffectBase(\n schedulerFn: typeof onTickEnd | typeof requestAnimationFrame,\n effect: () => Function | void,\n dependencies?: any[],\n debugKey?: string,\n) {\n const { cursor, byCursor } = renderingInstance.hooks.effects;\n const componentInstance = renderingInstance;\n\n const exec = () => {\n if (!componentInstance.isMounted) {\n return;\n }\n\n const { cleanup } = byCursor[cursor];\n if (typeof cleanup === 'function') {\n try {\n cleanup();\n } catch (err) {\n handleError(err);\n }\n }\n\n byCursor[cursor].cleanup = effect() as Function;\n };\n\n if (byCursor[cursor] !== undefined && dependencies && byCursor[cursor].dependencies) {\n if (dependencies.some((dependency, i) => dependency !== byCursor[cursor].dependencies![i])) {\n if (debugKey) {\n const causedBy = dependencies.reduce((res, newValue, i) => {\n const prevValue = byCursor[cursor].dependencies![i];\n if (newValue !== prevValue) {\n res.push(`${i}: ${prevValue} => ${newValue}`);\n }\n\n return res;\n }, []);\n\n // eslint-disable-next-line no-console\n console.log(\n '[Teact]',\n debugKey,\n 'Effect caused by dependencies.',\n causedBy.join(', '),\n );\n }\n\n schedulerFn(exec);\n }\n } else {\n schedulerFn(exec);\n }\n\n byCursor[cursor] = {\n effect,\n dependencies,\n cleanup: byCursor[cursor] ? byCursor[cursor].cleanup : undefined,\n };\n\n renderingInstance.hooks.effects.cursor++;\n}\n\nexport function useEffect(effect: () => Function | void, dependencies?: any[], debugKey?: string) {\n return useLayoutEffectBase(fastRaf, effect, dependencies, debugKey);\n}\n\nexport function useLayoutEffect(effect: () => Function | void, dependencies?: any[], debugKey?: string) {\n return useLayoutEffectBase(onTickEnd, effect, dependencies, debugKey);\n}\n\nexport function useMemo(resolver: () => T, dependencies: any[], debugKey?: string): T {\n const { cursor, byCursor } = renderingInstance.hooks.memos;\n let { current } = byCursor[cursor] || {};\n\n if (\n byCursor[cursor] === undefined\n || dependencies.some((dependency, i) => dependency !== byCursor[cursor].dependencies[i])\n ) {\n if (DEBUG && debugKey) {\n // eslint-disable-next-line no-console\n console.log(\n `[Teact.useMemo] ${renderingInstance.name} (${debugKey}): Update is caused by:`,\n byCursor[cursor]\n ? getUnequalProps(dependencies, byCursor[cursor].dependencies).join(', ')\n : '[first render]',\n );\n }\n\n current = resolver();\n }\n\n byCursor[cursor] = {\n current,\n dependencies,\n };\n\n renderingInstance.hooks.memos.cursor++;\n\n return current;\n}\n\nexport function useCallback(newCallback: F, dependencies: any[]): F {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => newCallback, dependencies);\n}\n\nexport function useRef(initial: T): { current: T };\nexport function useRef(): { current: T | undefined }; // TT way (empty is `undefined`)\nexport function useRef(initial: null): { current: T | null }; // React way (empty is `null`)\n// eslint-disable-next-line no-null/no-null\nexport function useRef(initial?: T | null) {\n return useMemo(() => ({\n current: initial,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), []);\n}\n\nexport function memo(Component: T, areEqual = arePropsShallowEqual, debugKey?: string) {\n return function TeactMemoWrapper(props: Props) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const propsRef = useRef(props);\n const renderedRef = useRef();\n\n if (!renderedRef.current || (propsRef.current && !areEqual(propsRef.current, props))) {\n if (DEBUG && debugKey) {\n // eslint-disable-next-line no-console\n console.log(\n `[Teact.memo] ${Component.name} (${debugKey}): Update is caused by:`,\n getUnequalProps(propsRef.current!, props).join(', '),\n );\n }\n\n propsRef.current = props;\n renderedRef.current = createElement(Component, props) as VirtualElementComponent;\n }\n\n return renderedRef.current;\n } as T;\n}\n\n// We need to keep it here for JSX.\nexport default {\n createElement,\n Fragment,\n};\n","import React, {\n FC, FC_withDebug, Props, useEffect, useState,\n} from './teact';\n\nimport { DEBUG, DEBUG_MORE } from '../../config';\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport generateIdFor from '../../util/generateIdFor';\nimport { throttleWithRaf } from '../../util/schedulers';\nimport arePropsShallowEqual, { getUnequalProps } from '../../util/arePropsShallowEqual';\nimport { orderBy } from '../../util/iteratees';\nimport { GlobalState, GlobalActions, ActionTypes } from '../../global/types';\nimport { handleError } from '../../util/handleError';\n\nexport default React;\n\ntype ActionPayload = AnyLiteral;\n\ntype Reducer = (\n global: GlobalState,\n actions: GlobalActions,\n payload: any,\n) => GlobalState | void;\n\ntype MapStateToProps = ((global: GlobalState, ownProps: OwnProps) => AnyLiteral | null);\ntype MapActionsToProps = ((setGlobal: Function, actions: GlobalActions) => Partial | null);\n\nlet currentGlobal = {} as GlobalState;\n\nconst reducers: Record = {};\nconst callbacks: Function[] = [updateContainers];\nconst actions = {} as GlobalActions;\nconst containers = new Map;\n mapReducersToProps: MapActionsToProps;\n ownProps: Props;\n mappedProps?: Props;\n forceUpdate: Function;\n areMappedPropsChanged: boolean;\n DEBUG_updates: number;\n DEBUG_componentName: string;\n}>();\n\nfunction runCallbacks() {\n callbacks.forEach((cb) => cb(currentGlobal));\n}\n\nconst runCallbacksThrottled = throttleWithRaf(runCallbacks);\n\n// `noThrottle = true` is used as a workaround for iOS gesture history navigation\nexport function setGlobal(newGlobal?: GlobalState, noThrottle = false) {\n if (typeof newGlobal === 'object' && newGlobal !== currentGlobal) {\n currentGlobal = newGlobal;\n if (!noThrottle) {\n runCallbacksThrottled();\n } else {\n runCallbacks();\n }\n }\n}\n\nexport function getGlobal() {\n return currentGlobal;\n}\n\nexport function getDispatch() {\n return actions;\n}\n\nfunction onDispatch(name: string, payload?: ActionPayload, noThrottle?: boolean) {\n if (reducers[name]) {\n reducers[name].forEach((reducer) => {\n const newGlobal = reducer(currentGlobal, actions, payload);\n if (newGlobal) {\n setGlobal(newGlobal, noThrottle);\n }\n });\n }\n}\n\nfunction updateContainers() {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n let DEBUG_startAt: number | undefined;\n if (DEBUG) {\n DEBUG_startAt = performance.now();\n }\n\n // eslint-disable-next-line no-restricted-syntax\n for (const container of containers.values()) {\n const {\n mapStateToProps, mapReducersToProps, ownProps, mappedProps, forceUpdate,\n } = container;\n\n let newMappedProps;\n\n try {\n newMappedProps = {\n ...mapStateToProps(currentGlobal, ownProps),\n ...mapReducersToProps(setGlobal, actions),\n };\n } catch (err) {\n handleError(err);\n\n return;\n }\n\n if (DEBUG) {\n if (Object.values(newMappedProps).some(Number.isNaN)) {\n // eslint-disable-next-line no-console\n console.warn(\n // eslint-disable-next-line max-len\n `[TeactN] Some of \\`${container.DEBUG_componentName}\\` mappers contain NaN values. This may cause redundant updates because of incorrect equality check.`,\n );\n }\n }\n\n if (Object.keys(newMappedProps).length && !arePropsShallowEqual(mappedProps!, newMappedProps)) {\n if (DEBUG_MORE) {\n // eslint-disable-next-line no-console\n console.log(\n '[TeactN] Will update',\n container.DEBUG_componentName,\n 'caused by',\n getUnequalProps(mappedProps!, newMappedProps).join(', '),\n );\n }\n\n container.mappedProps = newMappedProps;\n container.areMappedPropsChanged = true;\n container.DEBUG_updates++;\n\n forceUpdate();\n }\n }\n\n if (DEBUG) {\n const updateTime = performance.now() - DEBUG_startAt!;\n if (updateTime > 7) {\n // eslint-disable-next-line no-console\n console.warn(`[TeactN] Slow containers update: ${Math.round(updateTime)} ms`);\n }\n }\n}\n\nexport function addReducer(name: ActionTypes, reducer: Reducer) {\n if (!reducers[name]) {\n reducers[name] = [];\n\n actions[name] = (payload?: ActionPayload, noThrottle = false) => {\n onDispatch(name, payload, noThrottle);\n };\n }\n\n reducers[name].push(reducer);\n}\n\nexport function addCallback(cb: Function) {\n callbacks.push(cb);\n}\n\nexport function removeCallback(cb: Function) {\n const index = callbacks.indexOf(cb);\n if (index !== -1) {\n callbacks.splice(index, 1);\n }\n}\n\nexport function withGlobal(\n mapStateToProps: MapStateToProps = () => ({}),\n mapReducersToProps: MapActionsToProps = () => ({}),\n) {\n return (Component: FC) => {\n return function TeactNContainer(props: OwnProps) {\n (TeactNContainer as FC_withDebug).DEBUG_contentComponentName = Component.name;\n\n const [id] = useState(generateIdFor(containers));\n const forceUpdate = useForceUpdate();\n\n useEffect(() => {\n return () => {\n containers.delete(id);\n };\n }, [id]);\n\n let container = containers.get(id);\n if (!container) {\n container = {\n mapStateToProps,\n mapReducersToProps,\n ownProps: props,\n areMappedPropsChanged: false,\n forceUpdate,\n DEBUG_updates: 0,\n DEBUG_componentName: Component.name,\n };\n\n containers.set(id, container);\n }\n\n if (container.areMappedPropsChanged) {\n container.areMappedPropsChanged = false;\n }\n\n if (!container.mappedProps || !arePropsShallowEqual(container.ownProps, props)) {\n container.ownProps = props;\n\n try {\n container.mappedProps = {\n ...mapStateToProps(currentGlobal, props),\n ...mapReducersToProps(setGlobal, actions),\n };\n } catch (err) {\n handleError(err);\n }\n }\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ;\n };\n };\n}\n\nif (DEBUG) {\n (window as any).getGlobal = getGlobal;\n\n document.addEventListener('dblclick', () => {\n // eslint-disable-next-line no-console\n console.log(\n 'GLOBAL CONTAINERS',\n orderBy(\n Array.from(containers.values())\n .map(({ DEBUG_componentName, DEBUG_updates }) => ({ DEBUG_componentName, DEBUG_updates })),\n 'DEBUG_updates',\n 'desc',\n ),\n );\n });\n}\n","// Copyright Twitter Inc. Licensed under MIT\n// https://github.com/twitter/twemoji-parser/blob/master/LICENSE.md\n// Version 2c193ce 28.05.2021\n\nconst vs16RegExp = /\\uFE0F/g;\n// avoid using a string literal like '\\u200D' here because minifiers expand it inline\nconst zeroWidthJoiner = String.fromCharCode(0x200d);\n\nexport function removeVS16s(rawEmoji) {\n return rawEmoji.indexOf(zeroWidthJoiner) < 0 ? rawEmoji.replace(vs16RegExp, '') : rawEmoji;\n}\n\n// This file is generated by source/emoji/scripts/generate.sh\n// eslint-disable-next-line max-len\nexport default /(?:\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d[\\udc68\\udc69]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1|\\ud83d\\udc6b\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6c\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6d\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc8f\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc91\\ud83c[\\udffb-\\udfff]|\\ud83d[\\udc6b-\\udc6d\\udc8f\\udc91])|(?:\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1)(?:\\ud83c[\\udffb-\\udfff])?\\u200d(?:\\u2695\\ufe0f|\\u2696\\ufe0f|\\u2708\\ufe0f|\\ud83c[\\udf3e\\udf73\\udf7c\\udf84\\udf93\\udfa4\\udfa8\\udfeb\\udfed]|\\ud83d[\\udcbb\\udcbc\\udd27\\udd2c\\ude80\\ude92]|\\ud83e[\\uddaf-\\uddb3\\uddbc\\uddbd])|(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75]|\\u26f9)((?:\\ud83c[\\udffb-\\udfff]|\\ufe0f)\\u200d[\\u2640\\u2642]\\ufe0f)|(?:\\ud83c[\\udfc3\\udfc4\\udfca]|\\ud83d[\\udc6e\\udc70\\udc71\\udc73\\udc77\\udc81\\udc82\\udc86\\udc87\\ude45-\\ude47\\ude4b\\ude4d\\ude4e\\udea3\\udeb4-\\udeb6]|\\ud83e[\\udd26\\udd35\\udd37-\\udd39\\udd3d\\udd3e\\uddb8\\uddb9\\uddcd-\\uddcf\\uddd4\\uddd6-\\udddd])(?:\\ud83c[\\udffb-\\udfff])?\\u200d[\\u2640\\u2642]\\ufe0f|(?:\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83c\\udff3\\ufe0f\\u200d\\u26a7\\ufe0f|\\ud83c\\udff3\\ufe0f\\u200d\\ud83c\\udf08|\\ud83d\\ude36\\u200d\\ud83c\\udf2b\\ufe0f|\\u2764\\ufe0f\\u200d\\ud83d\\udd25|\\u2764\\ufe0f\\u200d\\ud83e\\ude79|\\ud83c\\udff4\\u200d\\u2620\\ufe0f|\\ud83d\\udc15\\u200d\\ud83e\\uddba|\\ud83d\\udc3b\\u200d\\u2744\\ufe0f|\\ud83d\\udc41\\u200d\\ud83d\\udde8|\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc6f\\u200d\\u2640\\ufe0f|\\ud83d\\udc6f\\u200d\\u2642\\ufe0f|\\ud83d\\ude2e\\u200d\\ud83d\\udca8|\\ud83d\\ude35\\u200d\\ud83d\\udcab|\\ud83e\\udd3c\\u200d\\u2640\\ufe0f|\\ud83e\\udd3c\\u200d\\u2642\\ufe0f|\\ud83e\\uddde\\u200d\\u2640\\ufe0f|\\ud83e\\uddde\\u200d\\u2642\\ufe0f|\\ud83e\\udddf\\u200d\\u2640\\ufe0f|\\ud83e\\udddf\\u200d\\u2642\\ufe0f|\\ud83d\\udc08\\u200d\\u2b1b)|[#*0-9]\\ufe0f?\\u20e3|(?:[©®\\u2122\\u265f]\\ufe0f)|(?:\\ud83c[\\udc04\\udd70\\udd71\\udd7e\\udd7f\\ude02\\ude1a\\ude2f\\ude37\\udf21\\udf24-\\udf2c\\udf36\\udf7d\\udf96\\udf97\\udf99-\\udf9b\\udf9e\\udf9f\\udfcd\\udfce\\udfd4-\\udfdf\\udff3\\udff5\\udff7]|\\ud83d[\\udc3f\\udc41\\udcfd\\udd49\\udd4a\\udd6f\\udd70\\udd73\\udd76-\\udd79\\udd87\\udd8a-\\udd8d\\udda5\\udda8\\uddb1\\uddb2\\uddbc\\uddc2-\\uddc4\\uddd1-\\uddd3\\udddc-\\uddde\\udde1\\udde3\\udde8\\uddef\\uddf3\\uddfa\\udecb\\udecd-\\udecf\\udee0-\\udee5\\udee9\\udef0\\udef3]|[\\u203c\\u2049\\u2139\\u2194-\\u2199\\u21a9\\u21aa\\u231a\\u231b\\u2328\\u23cf\\u23ed-\\u23ef\\u23f1\\u23f2\\u23f8-\\u23fa\\u24c2\\u25aa\\u25ab\\u25b6\\u25c0\\u25fb-\\u25fe\\u2600-\\u2604\\u260e\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262a\\u262e\\u262f\\u2638-\\u263a\\u2640\\u2642\\u2648-\\u2653\\u2660\\u2663\\u2665\\u2666\\u2668\\u267b\\u267f\\u2692-\\u2697\\u2699\\u269b\\u269c\\u26a0\\u26a1\\u26a7\\u26aa\\u26ab\\u26b0\\u26b1\\u26bd\\u26be\\u26c4\\u26c5\\u26c8\\u26cf\\u26d1\\u26d3\\u26d4\\u26e9\\u26ea\\u26f0-\\u26f5\\u26f8\\u26fa\\u26fd\\u2702\\u2708\\u2709\\u270f\\u2712\\u2714\\u2716\\u271d\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u2764\\u27a1\\u2934\\u2935\\u2b05-\\u2b07\\u2b1b\\u2b1c\\u2b50\\u2b55\\u3030\\u303d\\u3297\\u3299])(?:\\ufe0f|(?!\\ufe0e))|(?:(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75\\udd90]|[\\u261d\\u26f7\\u26f9\\u270c\\u270d])(?:\\ufe0f|(?!\\ufe0e))|(?:\\ud83c[\\udf85\\udfc2-\\udfc4\\udfc7\\udfca]|\\ud83d[\\udc42\\udc43\\udc46-\\udc50\\udc66-\\udc69\\udc6e\\udc70-\\udc78\\udc7c\\udc81-\\udc83\\udc85-\\udc87\\udcaa\\udd7a\\udd95\\udd96\\ude45-\\ude47\\ude4b-\\ude4f\\udea3\\udeb4-\\udeb6\\udec0\\udecc]|\\ud83e[\\udd0c\\udd0f\\udd18-\\udd1c\\udd1e\\udd1f\\udd26\\udd30-\\udd39\\udd3d\\udd3e\\udd77\\uddb5\\uddb6\\uddb8\\uddb9\\uddbb\\uddcd-\\uddcf\\uddd1-\\udddd]|[\\u270a\\u270b]))(?:\\ud83c[\\udffb-\\udfff])?|(?:\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc65\\udb40\\udc6e\\udb40\\udc67\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc73\\udb40\\udc63\\udb40\\udc74\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc77\\udb40\\udc6c\\udb40\\udc73\\udb40\\udc7f|\\ud83c\\udde6\\ud83c[\\udde8-\\uddec\\uddee\\uddf1\\uddf2\\uddf4\\uddf6-\\uddfa\\uddfc\\uddfd\\uddff]|\\ud83c\\udde7\\ud83c[\\udde6\\udde7\\udde9-\\uddef\\uddf1-\\uddf4\\uddf6-\\uddf9\\uddfb\\uddfc\\uddfe\\uddff]|\\ud83c\\udde8\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\uddee\\uddf0-\\uddf5\\uddf7\\uddfa-\\uddff]|\\ud83c\\udde9\\ud83c[\\uddea\\uddec\\uddef\\uddf0\\uddf2\\uddf4\\uddff]|\\ud83c\\uddea\\ud83c[\\udde6\\udde8\\uddea\\uddec\\udded\\uddf7-\\uddfa]|\\ud83c\\uddeb\\ud83c[\\uddee-\\uddf0\\uddf2\\uddf4\\uddf7]|\\ud83c\\uddec\\ud83c[\\udde6\\udde7\\udde9-\\uddee\\uddf1-\\uddf3\\uddf5-\\uddfa\\uddfc\\uddfe]|\\ud83c\\udded\\ud83c[\\uddf0\\uddf2\\uddf3\\uddf7\\uddf9\\uddfa]|\\ud83c\\uddee\\ud83c[\\udde8-\\uddea\\uddf1-\\uddf4\\uddf6-\\uddf9]|\\ud83c\\uddef\\ud83c[\\uddea\\uddf2\\uddf4\\uddf5]|\\ud83c\\uddf0\\ud83c[\\uddea\\uddec-\\uddee\\uddf2\\uddf3\\uddf5\\uddf7\\uddfc\\uddfe\\uddff]|\\ud83c\\uddf1\\ud83c[\\udde6-\\udde8\\uddee\\uddf0\\uddf7-\\uddfb\\uddfe]|\\ud83c\\uddf2\\ud83c[\\udde6\\udde8-\\udded\\uddf0-\\uddff]|\\ud83c\\uddf3\\ud83c[\\udde6\\udde8\\uddea-\\uddec\\uddee\\uddf1\\uddf4\\uddf5\\uddf7\\uddfa\\uddff]|\\ud83c\\uddf4\\ud83c\\uddf2|\\ud83c\\uddf5\\ud83c[\\udde6\\uddea-\\udded\\uddf0-\\uddf3\\uddf7-\\uddf9\\uddfc\\uddfe]|\\ud83c\\uddf6\\ud83c\\udde6|\\ud83c\\uddf7\\ud83c[\\uddea\\uddf4\\uddf8\\uddfa\\uddfc]|\\ud83c\\uddf8\\ud83c[\\udde6-\\uddea\\uddec-\\uddf4\\uddf7-\\uddf9\\uddfb\\uddfd-\\uddff]|\\ud83c\\uddf9\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\udded\\uddef-\\uddf4\\uddf7\\uddf9\\uddfb\\uddfc\\uddff]|\\ud83c\\uddfa\\ud83c[\\udde6\\uddec\\uddf2\\uddf3\\uddf8\\uddfe\\uddff]|\\ud83c\\uddfb\\ud83c[\\udde6\\udde8\\uddea\\uddec\\uddee\\uddf3\\uddfa]|\\ud83c\\uddfc\\ud83c[\\uddeb\\uddf8]|\\ud83c\\uddfd\\ud83c\\uddf0|\\ud83c\\uddfe\\ud83c[\\uddea\\uddf9]|\\ud83c\\uddff\\ud83c[\\udde6\\uddf2\\uddfc]|\\ud83c[\\udccf\\udd8e\\udd91-\\udd9a\\udde6-\\uddff\\ude01\\ude32-\\ude36\\ude38-\\ude3a\\ude50\\ude51\\udf00-\\udf20\\udf2d-\\udf35\\udf37-\\udf7c\\udf7e-\\udf84\\udf86-\\udf93\\udfa0-\\udfc1\\udfc5\\udfc6\\udfc8\\udfc9\\udfcf-\\udfd3\\udfe0-\\udff0\\udff4\\udff8-\\udfff]|\\ud83d[\\udc00-\\udc3e\\udc40\\udc44\\udc45\\udc51-\\udc65\\udc6a\\udc6f\\udc79-\\udc7b\\udc7d-\\udc80\\udc84\\udc88-\\udc8e\\udc90\\udc92-\\udca9\\udcab-\\udcfc\\udcff-\\udd3d\\udd4b-\\udd4e\\udd50-\\udd67\\udda4\\uddfb-\\ude44\\ude48-\\ude4a\\ude80-\\udea2\\udea4-\\udeb3\\udeb7-\\udebf\\udec1-\\udec5\\uded0-\\uded2\\uded5-\\uded7\\udeeb\\udeec\\udef4-\\udefc\\udfe0-\\udfeb]|\\ud83e[\\udd0d\\udd0e\\udd10-\\udd17\\udd1d\\udd20-\\udd25\\udd27-\\udd2f\\udd3a\\udd3c\\udd3f-\\udd45\\udd47-\\udd76\\udd78\\udd7a-\\uddb4\\uddb7\\uddba\\uddbc-\\uddcb\\uddd0\\uddde-\\uddff\\ude70-\\ude74\\ude78-\\ude7a\\ude80-\\ude86\\ude90-\\udea8\\udeb0-\\udeb6\\udec0-\\udec2\\uded0-\\uded6]|[\\u23e9-\\u23ec\\u23f0\\u23f3\\u267e\\u26ce\\u2705\\u2728\\u274c\\u274e\\u2753-\\u2755\\u2795-\\u2797\\u27b0\\u27bf\\ue50a])|\\ufe0f/g;\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { initApi, callApi } from '../../../api/gramjs';\nimport { GlobalState } from '../../../global/types';\n\nimport {\n LANG_CACHE_NAME,\n CUSTOM_BG_CACHE_NAME,\n MEDIA_CACHE_NAME,\n MEDIA_CACHE_NAME_AVATARS,\n MEDIA_PROGRESSIVE_CACHE_NAME,\n IS_TEST,\n} from '../../../config';\nimport { PLATFORM_ENV } from '../../../util/environment';\nimport { unsubscribe } from '../../../util/notifications';\nimport * as cacheApi from '../../../util/cacheApi';\nimport { updateAppBadge } from '../../../util/appBadge';\nimport {\n storeSession,\n loadStoredSession,\n clearStoredSession,\n importLegacySession,\n clearLegacySessions,\n} from '../../../util/sessions';\nimport { forceWebsync } from '../../../util/websync';\n\naddReducer('initApi', (global: GlobalState, actions) => {\n (async () => {\n if (!IS_TEST) {\n await importLegacySession();\n void clearLegacySessions();\n }\n\n void initApi(actions.apiUpdate, {\n userAgent: navigator.userAgent,\n platform: PLATFORM_ENV,\n sessionData: loadStoredSession(),\n });\n })();\n});\n\naddReducer('setAuthPhoneNumber', (global, actions, payload) => {\n const { phoneNumber } = payload!;\n\n void callApi('provideAuthPhoneNumber', phoneNumber.replace(/[^\\d]/g, ''));\n\n return {\n ...global,\n authIsLoading: true,\n authError: undefined,\n };\n});\n\naddReducer('setAuthCode', (global, actions, payload) => {\n const { code } = payload!;\n\n void callApi('provideAuthCode', code);\n\n return {\n ...global,\n authIsLoading: true,\n authError: undefined,\n };\n});\n\naddReducer('setAuthPassword', (global, actions, payload) => {\n const { password } = payload!;\n\n void callApi('provideAuthPassword', password);\n\n return {\n ...global,\n authIsLoading: true,\n authError: undefined,\n };\n});\n\naddReducer('uploadProfilePhoto', (global, actions, payload) => {\n const { file } = payload!;\n\n void callApi('uploadProfilePhoto', file);\n});\n\naddReducer('signUp', (global, actions, payload) => {\n const { firstName, lastName } = payload!;\n\n void callApi('provideAuthRegistration', { firstName, lastName });\n\n return {\n ...global,\n authIsLoading: true,\n authError: undefined,\n };\n});\n\naddReducer('returnToAuthPhoneNumber', (global) => {\n void callApi('restartAuth');\n\n return {\n ...global,\n authError: undefined,\n };\n});\n\naddReducer('goToAuthQrCode', (global) => {\n void callApi('restartAuthWithQr');\n\n return {\n ...global,\n authIsLoadingQrCode: true,\n authError: undefined,\n };\n});\n\naddReducer('saveSession', (global, actions, payload) => {\n const { sessionData } = payload;\n\n if (sessionData) {\n storeSession(payload.sessionData, global.currentUserId);\n } else {\n clearStoredSession();\n }\n});\n\naddReducer('signOut', () => {\n (async () => {\n try {\n await unsubscribe();\n await callApi('destroy');\n await forceWebsync(false);\n } catch (err) {\n // Do nothing\n }\n\n getDispatch().reset();\n })();\n});\n\naddReducer('reset', () => {\n clearStoredSession();\n\n void cacheApi.clear(MEDIA_CACHE_NAME);\n void cacheApi.clear(MEDIA_CACHE_NAME_AVATARS);\n void cacheApi.clear(MEDIA_PROGRESSIVE_CACHE_NAME);\n void cacheApi.clear(CUSTOM_BG_CACHE_NAME);\n\n const langCachePrefix = LANG_CACHE_NAME.replace(/\\d+$/, '');\n const langCacheVersion = (LANG_CACHE_NAME.match(/\\d+$/) || [0])[0];\n for (let i = 0; i < langCacheVersion; i++) {\n void cacheApi.clear(`${langCachePrefix}${i === 0 ? '' : i}`);\n }\n\n void clearLegacySessions();\n\n updateAppBadge(0);\n\n getDispatch().init();\n});\n\naddReducer('disconnect', () => {\n (async () => {\n await callApi('disconnect');\n })();\n});\n\naddReducer('loadNearestCountry', (global) => {\n if (global.connectionState !== 'connectionStateReady') {\n return;\n }\n\n (async () => {\n const authNearestCountry = await callApi('fetchNearestCountry');\n\n setGlobal({\n ...getGlobal(),\n authNearestCountry,\n });\n })();\n});\n\naddReducer('setDeviceToken', (global, actions, deviceToken) => {\n setGlobal({\n ...global,\n push: {\n deviceToken,\n subscribedAt: Date.now(),\n },\n });\n});\n\naddReducer('deleteDeviceToken', (global) => {\n const newGlobal = { ...global };\n delete newGlobal.push;\n setGlobal(newGlobal);\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\nimport {\n ApiPrivacyKey, PrivacyVisibility, ProfileEditProgress, IInputPrivacyRules, IInputPrivacyContact,\n UPLOADING_WALLPAPER_SLUG,\n} from '../../../types';\n\nimport { callApi } from '../../../api/gramjs';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { subscribe, unsubscribe } from '../../../util/notifications';\nimport { selectUser } from '../../selectors';\nimport {\n addUsers, addBlockedContact, updateChats, updateUser, removeBlockedContact, replaceSettings, updateNotifySettings,\n addNotifyExceptions,\n} from '../../reducers';\nimport { isChatPrivate } from '../../helpers';\n\naddReducer('updateProfile', (global, actions, payload) => {\n const {\n photo, firstName, lastName, bio: about, username,\n } = payload!;\n\n (async () => {\n const { currentUserId } = global;\n if (!currentUserId) {\n return;\n }\n\n setGlobal({\n ...getGlobal(),\n profileEdit: {\n progress: ProfileEditProgress.InProgress,\n },\n });\n\n if (photo) {\n await callApi('updateProfilePhoto', photo);\n }\n\n if (firstName || lastName || about) {\n const result = await callApi('updateProfile', { firstName, lastName, about });\n if (result) {\n global = getGlobal();\n const currentUser = currentUserId && selectUser(global, currentUserId);\n\n if (currentUser) {\n setGlobal(updateUser(\n global,\n currentUser.id,\n {\n firstName,\n lastName,\n fullInfo: {\n ...currentUser.fullInfo,\n bio: about,\n },\n },\n ));\n }\n }\n }\n\n if (username) {\n const result = await callApi('updateUsername', username);\n if (result && currentUserId) {\n setGlobal(updateUser(getGlobal(), currentUserId, { username }));\n }\n }\n\n setGlobal({\n ...getGlobal(),\n profileEdit: {\n progress: ProfileEditProgress.Complete,\n },\n });\n })();\n});\n\naddReducer('checkUsername', (global, actions, payload) => {\n const { username } = payload!;\n\n (async () => {\n // No need to check the username if profile update is already in progress\n if (global.profileEdit && global.profileEdit.progress === ProfileEditProgress.InProgress) {\n return;\n }\n\n setGlobal({\n ...global,\n profileEdit: {\n progress: global.profileEdit ? global.profileEdit.progress : ProfileEditProgress.Idle,\n isUsernameAvailable: undefined,\n },\n });\n\n const isUsernameAvailable = await callApi('checkUsername', username);\n\n global = getGlobal();\n setGlobal({\n ...global,\n profileEdit: {\n ...global.profileEdit!,\n isUsernameAvailable,\n },\n });\n })();\n});\n\naddReducer('loadWallpapers', () => {\n (async () => {\n const result = await callApi('fetchWallpapers', 0);\n if (!result) {\n return;\n }\n\n const global = getGlobal();\n setGlobal({\n ...global,\n settings: {\n ...global.settings,\n loadedWallpapers: result.wallpapers,\n },\n });\n })();\n});\n\naddReducer('uploadWallpaper', (global, actions, payload) => {\n const file = payload;\n const previewBlobUrl = URL.createObjectURL(file);\n\n setGlobal({\n ...global,\n settings: {\n ...global.settings,\n loadedWallpapers: [\n {\n slug: UPLOADING_WALLPAPER_SLUG,\n document: {\n fileName: '',\n size: file.size,\n mimeType: file.type,\n previewBlobUrl,\n },\n },\n ...(global.settings.loadedWallpapers || []),\n ],\n },\n });\n\n (async () => {\n const result = await callApi('uploadWallpaper', file);\n if (!result) {\n return;\n }\n\n const { wallpaper } = result;\n\n global = getGlobal();\n if (!global.settings.loadedWallpapers) {\n return;\n }\n\n const firstWallpaper = global.settings.loadedWallpapers[0];\n if (!firstWallpaper || firstWallpaper.slug !== UPLOADING_WALLPAPER_SLUG) {\n return;\n }\n\n const withLocalMedia = {\n ...wallpaper,\n document: {\n ...wallpaper.document,\n previewBlobUrl,\n },\n };\n\n setGlobal({\n ...global,\n settings: {\n ...global.settings,\n loadedWallpapers: [\n withLocalMedia,\n ...global.settings.loadedWallpapers.slice(1),\n ],\n },\n });\n })();\n});\n\naddReducer('loadBlockedContacts', () => {\n (async () => {\n const result = await callApi('fetchBlockedContacts');\n\n if (!result) {\n return;\n }\n\n let newGlobal = getGlobal();\n\n if (result.users?.length) {\n newGlobal = addUsers(newGlobal, buildCollectionByKey(result.users, 'id'));\n }\n if (result.chats?.length) {\n newGlobal = updateChats(newGlobal, buildCollectionByKey(result.chats, 'id'));\n }\n\n newGlobal = {\n ...newGlobal,\n blocked: {\n ...newGlobal.blocked,\n ids: [...(newGlobal.blocked.ids || []), ...result.blockedIds],\n totalCount: result.totalCount,\n },\n };\n\n setGlobal(newGlobal);\n })();\n});\n\naddReducer('blockContact', (global, actions, payload) => {\n const { contactId, accessHash } = payload!;\n\n (async () => {\n const result = await callApi('blockContact', contactId, accessHash);\n if (!result) {\n return;\n }\n\n const newGlobal = getGlobal();\n\n setGlobal(addBlockedContact(newGlobal, contactId));\n })();\n});\n\naddReducer('unblockContact', (global, actions, payload) => {\n const { contactId } = payload!;\n let accessHash: string | undefined;\n const isPrivate = isChatPrivate(contactId);\n\n if (isPrivate) {\n const user = selectUser(global, contactId);\n if (!user) {\n return;\n }\n\n accessHash = user.accessHash;\n }\n\n (async () => {\n const result = await callApi('unblockContact', contactId, accessHash);\n if (!result) {\n return;\n }\n\n const newGlobal = getGlobal();\n\n setGlobal(removeBlockedContact(newGlobal, contactId));\n })();\n});\n\naddReducer('loadAuthorizations', () => {\n (async () => {\n const result = await callApi('fetchAuthorizations');\n if (!result) {\n return;\n }\n\n setGlobal({\n ...getGlobal(),\n activeSessions: result,\n });\n })();\n});\n\naddReducer('terminateAuthorization', (global, actions, payload) => {\n const { hash } = payload!;\n\n (async () => {\n const result = await callApi('terminateAuthorization', hash);\n if (!result) {\n return;\n }\n\n const newGlobal = getGlobal();\n\n setGlobal({\n ...newGlobal,\n activeSessions: newGlobal.activeSessions.filter((session) => session.hash !== hash),\n });\n })();\n});\n\naddReducer('terminateAllAuthorizations', () => {\n (async () => {\n const result = await callApi('terminateAllAuthorizations');\n if (!result) {\n return;\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n activeSessions: global.activeSessions.filter((session) => session.isCurrent),\n });\n })();\n});\n\naddReducer('loadNotificationExceptions', (global) => {\n const { serverTimeOffset } = global;\n\n (async () => {\n const result = await callApi('fetchNotificationExceptions', { serverTimeOffset });\n if (!result) {\n return;\n }\n\n setGlobal(addNotifyExceptions(getGlobal(), result));\n })();\n});\n\naddReducer('loadNotificationSettings', (global) => {\n const { serverTimeOffset } = global;\n (async () => {\n const result = await callApi('fetchNotificationSettings', {\n serverTimeOffset,\n });\n if (!result) {\n return;\n }\n\n setGlobal(replaceSettings(getGlobal(), result));\n })();\n});\n\naddReducer('updateNotificationSettings', (global, actions, payload) => {\n const { peerType, isSilent, shouldShowPreviews } = payload!;\n\n (async () => {\n const result = await callApi('updateNotificationSettings', peerType, { isSilent, shouldShowPreviews });\n\n if (!result) {\n return;\n }\n\n setGlobal(updateNotifySettings(getGlobal(), peerType, isSilent, shouldShowPreviews));\n })();\n});\n\naddReducer('updateWebNotificationSettings', (global, actions, payload) => {\n (async () => {\n setGlobal(replaceSettings(getGlobal(), payload));\n const newGlobal = getGlobal();\n const { hasPushNotifications, hasWebNotifications } = newGlobal.settings.byKey;\n if (hasWebNotifications && hasPushNotifications) {\n await subscribe();\n } else {\n await unsubscribe();\n }\n })();\n});\n\naddReducer('updateContactSignUpNotification', (global, actions, payload) => {\n const { isSilent } = payload!;\n\n (async () => {\n const result = await callApi('updateContactSignUpNotification', isSilent);\n if (!result) {\n return;\n }\n\n setGlobal(replaceSettings(getGlobal(), { hasContactJoinedNotifications: !isSilent }));\n })();\n});\n\naddReducer('loadLanguages', () => {\n (async () => {\n const result = await callApi('fetchLanguages');\n if (!result) {\n return;\n }\n\n setGlobal(replaceSettings(getGlobal(), { languages: result }));\n })();\n});\n\naddReducer('loadPrivacySettings', () => {\n (async () => {\n const [\n phoneNumberSettings, lastSeenSettings, profilePhotoSettings, forwardsSettings, chatInviteSettings,\n ] = await Promise.all([\n callApi('fetchPrivacySettings', 'phoneNumber'),\n callApi('fetchPrivacySettings', 'lastSeen'),\n callApi('fetchPrivacySettings', 'profilePhoto'),\n callApi('fetchPrivacySettings', 'forwards'),\n callApi('fetchPrivacySettings', 'chatInvite'),\n ]);\n\n if (\n !phoneNumberSettings || !lastSeenSettings || !profilePhotoSettings || !forwardsSettings || !chatInviteSettings\n ) {\n return;\n }\n\n const global = getGlobal();\n\n global.settings.privacy.phoneNumber = phoneNumberSettings;\n global.settings.privacy.lastSeen = lastSeenSettings;\n global.settings.privacy.profilePhoto = profilePhotoSettings;\n global.settings.privacy.forwards = forwardsSettings;\n global.settings.privacy.chatInvite = chatInviteSettings;\n\n setGlobal(global);\n })();\n});\n\naddReducer('setPrivacyVisibility', (global, actions, payload) => {\n const { privacyKey, visibility } = payload!;\n\n const {\n privacy: { [privacyKey as ApiPrivacyKey]: settings },\n } = global.settings;\n\n if (!settings) {\n return;\n }\n\n const rules = buildInputPrivacyRules(global, {\n visibility,\n allowedIds: [...settings.allowUserIds, ...settings.allowChatIds],\n deniedIds: [...settings.blockUserIds, ...settings.blockChatIds],\n });\n\n (async () => {\n const result = await callApi('setPrivacySettings', privacyKey, rules);\n\n if (result) {\n const newGlobal = getGlobal();\n\n newGlobal.settings.privacy[privacyKey as ApiPrivacyKey] = result;\n\n setGlobal(newGlobal);\n }\n })();\n});\n\naddReducer('setPrivacySettings', (global, actions, payload) => {\n const { privacyKey, isAllowList, contactsIds } = payload!;\n const {\n privacy: { [privacyKey as ApiPrivacyKey]: settings },\n } = global.settings;\n\n if (!settings) {\n return;\n }\n\n const rules = buildInputPrivacyRules(global, {\n visibility: settings.visibility,\n allowedIds: isAllowList ? contactsIds : [...settings.allowUserIds, ...settings.allowChatIds],\n deniedIds: !isAllowList ? contactsIds : [...settings.blockUserIds, ...settings.blockChatIds],\n });\n\n (async () => {\n const result = await callApi('setPrivacySettings', privacyKey, rules);\n\n if (result) {\n const newGlobal = getGlobal();\n\n newGlobal.settings.privacy[privacyKey as ApiPrivacyKey] = result;\n\n setGlobal(newGlobal);\n }\n })();\n});\n\nfunction buildInputPrivacyRules(global: GlobalState, {\n visibility,\n allowedIds,\n deniedIds,\n}: {\n visibility: PrivacyVisibility;\n allowedIds: number[];\n deniedIds: number[];\n}): IInputPrivacyRules {\n const {\n users: { byId: usersById },\n chats: { byId: chatsById },\n } = global;\n\n const rules: IInputPrivacyRules = {\n visibility,\n };\n let users: IInputPrivacyContact[];\n let chats: IInputPrivacyContact[];\n\n const collectUsers = (userId: number) => {\n if (!isChatPrivate(userId)) {\n return undefined;\n }\n const { id, accessHash } = usersById[userId] || {};\n if (!id) {\n return undefined;\n }\n\n return { id, accessHash };\n };\n\n const collectChats = (userId: number) => {\n if (isChatPrivate(userId)) {\n return undefined;\n }\n const chat = chatsById[userId];\n\n return chat ? { id: chat.id } : undefined;\n };\n\n if (visibility === 'contacts' || visibility === 'nobody') {\n users = allowedIds.map(collectUsers).filter(Boolean) as IInputPrivacyContact[];\n chats = allowedIds.map(collectChats).filter(Boolean) as IInputPrivacyContact[];\n\n if (users.length > 0) {\n rules.allowedUsers = users;\n }\n if (chats.length > 0) {\n rules.allowedChats = chats;\n }\n }\n\n if (visibility === 'everybody' || visibility === 'contacts') {\n users = deniedIds.map(collectUsers).filter(Boolean) as IInputPrivacyContact[];\n chats = deniedIds.map(collectChats).filter(Boolean) as IInputPrivacyContact[];\n\n if (users.length > 0) {\n rules.blockedUsers = users;\n }\n if (chats.length > 0) {\n rules.blockedChats = chats;\n }\n }\n\n return rules;\n}\n\naddReducer('updateIsOnline', (global, actions, payload) => {\n callApi('updateIsOnline', payload);\n});\n\naddReducer('loadContentSettings', () => {\n (async () => {\n const result = await callApi('fetchContentSettings');\n if (!result) return;\n\n setGlobal(replaceSettings(getGlobal(), result));\n })();\n});\n\naddReducer('updateContentSettings', (global, actions, payload) => {\n (async () => {\n setGlobal(replaceSettings(getGlobal(), { isSensitiveEnabled: payload }));\n\n const result = await callApi('updateContentSettings', payload);\n if (!result) {\n setGlobal(replaceSettings(getGlobal(), { isSensitiveEnabled: !payload }));\n }\n })();\n});\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\n\nimport {\n ApiUpdate,\n ApiUpdateAuthorizationState,\n ApiUpdateAuthorizationError,\n ApiUpdateConnectionState,\n ApiUpdateSession,\n ApiUpdateCurrentUser, ApiUpdateServerTimeOffset,\n} from '../../../api/types';\nimport { DEBUG, SESSION_USER_KEY } from '../../../config';\nimport { subscribe } from '../../../util/notifications';\nimport { updateUser } from '../../reducers';\nimport { setLanguage } from '../../../util/langProvider';\nimport { selectNotifySettings } from '../../selectors';\nimport { forceWebsync } from '../../../util/websync';\nimport { getShippingError } from '../../../util/getReadableErrorText';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n if (DEBUG) {\n if (update['@type'] !== 'updateUserStatus' && update['@type'] !== 'updateServerTimeOffset') {\n // eslint-disable-next-line no-console\n console.log('[GramJs] UPDATE', update['@type'], { update });\n }\n }\n\n switch (update['@type']) {\n case 'updateApiReady':\n onUpdateApiReady(global);\n break;\n\n case 'updateAuthorizationState':\n onUpdateAuthorizationState(update);\n break;\n\n case 'updateAuthorizationError':\n onUpdateAuthorizationError(update);\n break;\n\n case 'updateConnectionState':\n onUpdateConnectionState(update);\n break;\n\n case 'updateSession':\n onUpdateSession(update);\n break;\n\n case 'updateServerTimeOffset':\n onUpdateServerTimeOffset(update);\n break;\n\n case 'updateCurrentUser':\n onUpdateCurrentUser(update);\n break;\n\n case 'error': {\n if (update.error.message === 'SESSION_REVOKED') {\n actions.signOut();\n }\n\n const paymentShippingError = getShippingError(update.error);\n if (paymentShippingError) {\n actions.addPaymentError({ error: paymentShippingError });\n } else if (actions.showDialog) {\n actions.showDialog({ data: { ...update.error, hasErrorKey: true } });\n }\n\n break;\n }\n }\n});\n\nfunction onUpdateApiReady(global: GlobalState) {\n const { hasWebNotifications, hasPushNotifications } = selectNotifySettings(global);\n if (hasWebNotifications && hasPushNotifications) {\n void subscribe();\n }\n void setLanguage(global.settings.byKey.language);\n}\n\nfunction onUpdateAuthorizationState(update: ApiUpdateAuthorizationState) {\n let global = getGlobal();\n\n const wasAuthReady = global.authState === 'authorizationStateReady';\n const authState = update.authorizationState;\n\n setGlobal({\n ...global,\n authState,\n authIsLoading: false,\n });\n\n global = getGlobal();\n\n switch (authState) {\n case 'authorizationStateLoggingOut':\n void forceWebsync(false);\n\n setGlobal({\n ...global,\n isLoggingOut: true,\n });\n break;\n case 'authorizationStateWaitCode':\n setGlobal({\n ...global,\n authIsCodeViaApp: update.isCodeViaApp,\n });\n break;\n case 'authorizationStateWaitPassword':\n setGlobal({\n ...global,\n authHint: update.hint,\n });\n break;\n case 'authorizationStateWaitQrCode':\n setGlobal({\n ...global,\n authIsLoadingQrCode: false,\n authQrCode: update.qrCode,\n });\n break;\n case 'authorizationStateReady': {\n if (wasAuthReady) {\n break;\n }\n\n void forceWebsync(true);\n\n setGlobal({\n ...global,\n isLoggingOut: false,\n lastSyncTime: Date.now(),\n });\n\n break;\n }\n }\n}\n\nfunction onUpdateAuthorizationError(update: ApiUpdateAuthorizationError) {\n setGlobal({\n ...getGlobal(),\n authError: update.message,\n });\n}\n\nfunction onUpdateConnectionState(update: ApiUpdateConnectionState) {\n const { connectionState } = update;\n const global = getGlobal();\n\n setGlobal({\n ...global,\n connectionState,\n });\n\n if (connectionState === 'connectionStateReady' && global.authState === 'authorizationStateReady') {\n getDispatch().sync();\n } else if (connectionState === 'connectionStateBroken') {\n getDispatch().signOut();\n }\n}\n\nfunction onUpdateSession(update: ApiUpdateSession) {\n const { sessionData } = update;\n const { authRememberMe, authState } = getGlobal();\n const isEmpty = !sessionData || !sessionData.mainDcId;\n\n if (!authRememberMe || authState !== 'authorizationStateReady' || isEmpty) {\n return;\n }\n\n getDispatch().saveSession({ sessionData });\n}\n\nfunction onUpdateServerTimeOffset(update: ApiUpdateServerTimeOffset) {\n const global = getGlobal();\n\n if (global.serverTimeOffset === update.serverTimeOffset) {\n return;\n }\n\n setGlobal({\n ...global,\n serverTimeOffset: update.serverTimeOffset,\n });\n}\n\nfunction onUpdateCurrentUser(update: ApiUpdateCurrentUser) {\n const { currentUser } = update;\n\n setGlobal({\n ...updateUser(getGlobal(), currentUser.id, currentUser),\n currentUserId: currentUser.id,\n });\n\n updateSessionUserId(currentUser.id);\n}\n\nfunction updateSessionUserId(currentUserId: number) {\n const sessionUserAuth = localStorage.getItem(SESSION_USER_KEY);\n if (!sessionUserAuth) return;\n\n const userAuth = JSON.parse(sessionUserAuth);\n userAuth.id = currentUserId;\n\n localStorage.setItem(SESSION_USER_KEY, JSON.stringify(userAuth));\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ANIMATION_LEVEL_MAX } from '../../../config';\nimport {\n IS_ANDROID, IS_IOS, IS_MAC_OS, IS_TOUCH_ENV,\n} from '../../../util/environment';\nimport { setLanguage } from '../../../util/langProvider';\nimport switchTheme from '../../../util/switchTheme';\nimport { selectTheme } from '../../selectors';\nimport { startWebsync } from '../../../util/websync';\n\nconst HISTORY_ANIMATION_DURATION = 450;\n\nsubscribeToSystemThemeChange();\n\naddReducer('init', (global) => {\n const { animationLevel, messageTextSize, language } = global.settings.byKey;\n const theme = selectTheme(global);\n\n void setLanguage(language, undefined, true);\n\n document.documentElement.style.setProperty(\n '--composer-text-size', `${Math.max(messageTextSize, IS_IOS ? 16 : 15)}px`,\n );\n document.documentElement.style.setProperty('--message-meta-height', `${Math.floor(messageTextSize * 1.3125)}px`);\n document.documentElement.style.setProperty('--message-text-size', `${messageTextSize}px`);\n document.documentElement.setAttribute('data-message-text-size', messageTextSize.toString());\n document.body.classList.add('initial');\n document.body.classList.add(`animation-level-${animationLevel}`);\n document.body.classList.add(IS_TOUCH_ENV ? 'is-touch-env' : 'is-pointer-env');\n switchTheme(theme, animationLevel === ANIMATION_LEVEL_MAX);\n startWebsync();\n\n if (IS_IOS) {\n document.body.classList.add('is-ios');\n } else if (IS_ANDROID) {\n document.body.classList.add('is-android');\n } else if (IS_MAC_OS) {\n document.body.classList.add('is-macos');\n }\n});\n\naddReducer('setIsUiReady', (global, actions, payload) => {\n const { uiReadyState } = payload!;\n\n if (uiReadyState === 2) {\n document.body.classList.remove('initial');\n }\n\n return {\n ...global,\n uiReadyState,\n };\n});\n\naddReducer('setAuthPhoneNumber', (global, actions, payload) => {\n const { phoneNumber } = payload!;\n\n return {\n ...global,\n authPhoneNumber: phoneNumber,\n };\n});\n\naddReducer('setAuthRememberMe', (global, actions, payload) => {\n return {\n ...global,\n authRememberMe: Boolean(payload),\n };\n});\n\naddReducer('clearAuthError', (global) => {\n return {\n ...global,\n authError: undefined,\n };\n});\n\naddReducer('disableHistoryAnimations', () => {\n setTimeout(() => {\n setGlobal({\n ...getGlobal(),\n shouldSkipHistoryAnimations: false,\n });\n document.body.classList.remove('no-animate');\n }, HISTORY_ANIMATION_DURATION);\n\n setGlobal({\n ...getGlobal(),\n shouldSkipHistoryAnimations: true,\n }, true);\n});\n\nfunction subscribeToSystemThemeChange() {\n function handleSystemThemeChange() {\n const currentThemeMatch = document.documentElement.className.match(/theme-(\\w+)/);\n const currentTheme = currentThemeMatch ? currentThemeMatch[1] : 'light';\n const global = getGlobal();\n const nextTheme = selectTheme(global);\n const { animationLevel } = global.settings.byKey;\n\n if (nextTheme !== currentTheme) {\n switchTheme(nextTheme, animationLevel === ANIMATION_LEVEL_MAX);\n // Force-update component containers\n setGlobal({ ...global });\n }\n }\n\n const mql = window.matchMedia('(prefers-color-scheme: dark)');\n if (typeof mql.addEventListener === 'function') {\n mql.addEventListener('change', handleSystemThemeChange);\n } else if (typeof mql.addListener === 'function') {\n mql.addListener(handleSystemThemeChange);\n }\n}\n","import { addReducer } from '../../../lib/teact/teactn';\nimport { ISettings, IThemeSettings, ThemeKey } from '../../../types';\nimport { replaceSettings, replaceThemeSettings } from '../../reducers';\n\naddReducer('setSettingOption', (global, actions, payload?: Partial) => {\n return replaceSettings(global, payload);\n});\n\naddReducer('setThemeSettings', (global, actions, payload: { theme: ThemeKey } & Partial) => {\n const { theme, ...settings } = payload;\n\n return replaceThemeSettings(global, theme, settings);\n});\n","import {\n ApiChat,\n ApiUser,\n ApiChatBannedRights,\n ApiChatAdminRights,\n ApiChatFolder,\n MAIN_THREAD_ID,\n} from '../../api/types';\n\nimport { NotifyException, NotifySettings } from '../../types';\nimport { LangFn } from '../../hooks/useLang';\n\nimport { ARCHIVED_FOLDER_ID } from '../../config';\nimport { orderBy } from '../../util/iteratees';\nimport { getUserFirstOrLastName } from './users';\nimport { formatDateToString, formatTime } from '../../util/dateFormat';\n\nconst FOREVER_BANNED_DATE = Date.now() / 1000 + 31622400; // 366 days\n\nconst VERIFIED_PRIORITY_BASE = 3e9;\nconst PINNED_PRIORITY_BASE = 3e8;\n\nexport function isChatPrivate(chatId: number) {\n return chatId > 0;\n}\n\nexport function isChatGroup(chat: ApiChat) {\n return isChatBasicGroup(chat) || isChatSuperGroup(chat);\n}\n\nexport function isChatBasicGroup(chat: ApiChat) {\n return chat.type === 'chatTypeBasicGroup';\n}\n\nexport function isChatSuperGroup(chat: ApiChat) {\n return chat.type === 'chatTypeSuperGroup';\n}\n\nexport function isChatChannel(chat: ApiChat) {\n return chat.type === 'chatTypeChannel';\n}\n\nexport function isCommonBoxChat(chat: ApiChat) {\n return chat.type === 'chatTypePrivate' || chat.type === 'chatTypeBasicGroup';\n}\n\nexport function getChatTypeString(chat: ApiChat) {\n switch (chat.type) {\n case 'chatTypePrivate':\n return 'PrivateChat';\n case 'chatTypeBasicGroup':\n case 'chatTypeSuperGroup':\n return 'AccDescrGroup';\n case 'chatTypeChannel':\n return 'AccDescrChannel';\n default:\n return 'Chat';\n }\n}\n\nexport function getPrivateChatUserId(chat: ApiChat) {\n if (chat.type !== 'chatTypePrivate' && chat.type !== 'chatTypeSecret') {\n return undefined;\n }\n return chat.id;\n}\n\n// TODO Get rid of `user`\nexport function getChatTitle(lang: LangFn, chat: ApiChat, user?: ApiUser, isSelf = false) {\n if (isSelf || (user && chat.id === user.id && user.isSelf)) {\n return lang('SavedMessages');\n }\n return chat.title || lang('HiddenName');\n}\n\nexport function getChatDescription(chat: ApiChat) {\n if (!chat.fullInfo) {\n return undefined;\n }\n return chat.fullInfo.about;\n}\n\nexport function getChatLink(chat: ApiChat) {\n const { username } = chat;\n if (username) {\n return `https://t.me/${username}`;\n }\n\n const { inviteLink } = chat.fullInfo || {};\n\n return inviteLink;\n}\n\nexport function getChatAvatarHash(\n owner: ApiChat | ApiUser,\n size: 'normal' | 'big' = 'normal',\n) {\n if (!owner.avatarHash) {\n return undefined;\n }\n\n switch (size) {\n case 'big':\n return `profile${owner.id}?${owner.avatarHash}`;\n default:\n return `avatar${owner.id}?${owner.avatarHash}`;\n }\n}\n\nexport function isChatSummaryOnly(chat: ApiChat) {\n return !chat.lastMessage;\n}\n\nexport function isChatAdmin(chat: ApiChat) {\n return Boolean(chat.adminRights);\n}\n\nexport function getHasAdminRight(chat: ApiChat, key: keyof ApiChatAdminRights) {\n return chat.adminRights ? chat.adminRights[key] : false;\n}\n\nexport function isUserRightBanned(chat: ApiChat, key: keyof ApiChatBannedRights) {\n return Boolean(\n (chat.currentUserBannedRights?.[key])\n || (chat.defaultBannedRights?.[key]),\n );\n}\n\nexport function getCanPostInChat(chat: ApiChat, threadId: number) {\n if (threadId !== MAIN_THREAD_ID) {\n return true;\n }\n\n if (chat.isRestricted || chat.migratedTo || chat.isNotJoined) {\n return false;\n }\n\n if (chat.isCreator) {\n return true;\n }\n\n if (isChatPrivate(chat.id)) {\n return true;\n }\n\n if (isChatChannel(chat)) {\n return getHasAdminRight(chat, 'postMessages');\n }\n\n return isChatAdmin(chat) || !isUserRightBanned(chat, 'sendMessages');\n}\n\nexport interface IAllowedAttachmentOptions {\n canAttachMedia: boolean;\n canAttachPolls: boolean;\n canSendStickers: boolean;\n canSendGifs: boolean;\n canAttachEmbedLinks: boolean;\n}\n\nexport function getAllowedAttachmentOptions(chat?: ApiChat, isChatWithBot = false): IAllowedAttachmentOptions {\n if (!chat) {\n return {\n canAttachMedia: false,\n canAttachPolls: false,\n canSendStickers: false,\n canSendGifs: false,\n canAttachEmbedLinks: false,\n };\n }\n\n const isAdmin = isChatAdmin(chat);\n\n return {\n canAttachMedia: isAdmin || !isUserRightBanned(chat, 'sendMedia'),\n canAttachPolls: (isAdmin || !isUserRightBanned(chat, 'sendPolls')) && (!isChatPrivate(chat.id) || isChatWithBot),\n canSendStickers: isAdmin || !isUserRightBanned(chat, 'sendStickers'),\n canSendGifs: isAdmin || !isUserRightBanned(chat, 'sendGifs'),\n canAttachEmbedLinks: isAdmin || !isUserRightBanned(chat, 'embedLinks'),\n };\n}\n\nexport function getMessageSendingRestrictionReason(\n lang: LangFn, currentUserBannedRights?: ApiChatBannedRights, defaultBannedRights?: ApiChatBannedRights,\n) {\n if (currentUserBannedRights?.sendMessages) {\n const { untilDate } = currentUserBannedRights;\n return untilDate && untilDate < FOREVER_BANNED_DATE\n ? lang(\n 'Channel.Persmission.Denied.SendMessages.Until',\n lang(\n 'formatDateAtTime',\n [formatDateToString(new Date(untilDate * 1000), lang.code), formatTime(untilDate * 1000)],\n ),\n )\n : lang('Channel.Persmission.Denied.SendMessages.Forever');\n }\n\n if (defaultBannedRights?.sendMessages) {\n return lang('Channel.Persmission.Denied.SendMessages.DefaultRestrictedText');\n }\n\n return undefined;\n}\n\nexport function getChatSlowModeOptions(chat?: ApiChat) {\n if (!chat || !chat.fullInfo) {\n return undefined;\n }\n\n return chat.fullInfo.slowMode;\n}\n\nexport function getChatOrder(chat: ApiChat) {\n return Math.max(\n chat.joinDate || 0,\n chat.draftDate || 0,\n chat.lastMessage ? chat.lastMessage.date : 0,\n );\n}\n\nexport function isChatArchived(chat: ApiChat) {\n return chat.folderId === ARCHIVED_FOLDER_ID;\n}\n\nexport function selectIsChatMuted(\n chat: ApiChat, notifySettings: NotifySettings, notifyExceptions: Record = [],\n) {\n // If this chat is in exceptions they take precedence\n if (notifyExceptions[chat.id] && notifyExceptions[chat.id].isMuted !== undefined) {\n return notifyExceptions[chat.id].isMuted;\n }\n\n return (\n chat.isMuted\n || (isChatPrivate(chat.id) && !notifySettings.hasPrivateChatsNotifications)\n || (isChatChannel(chat) && !notifySettings.hasBroadcastNotifications)\n || (isChatGroup(chat) && !notifySettings.hasGroupNotifications)\n );\n}\n\nexport function selectShouldShowMessagePreview(\n chat: ApiChat, notifySettings: NotifySettings, notifyExceptions: Record = [],\n) {\n const {\n hasPrivateChatsMessagePreview = true,\n hasBroadcastMessagePreview = true,\n hasGroupMessagePreview = true,\n } = notifySettings;\n // If this chat is in exceptions they take precedence\n if (notifyExceptions[chat.id] && notifyExceptions[chat.id].shouldShowPreviews !== undefined) {\n return notifyExceptions[chat.id].shouldShowPreviews;\n }\n\n return (isChatPrivate(chat.id) && hasPrivateChatsMessagePreview)\n || (isChatChannel(chat) && hasBroadcastMessagePreview)\n || (isChatGroup(chat) && hasGroupMessagePreview);\n}\n\nexport function getCanDeleteChat(chat: ApiChat) {\n return isChatBasicGroup(chat) || ((isChatSuperGroup(chat) || isChatChannel(chat)) && chat.isCreator);\n}\n\nexport function prepareFolderListIds(\n chatsById: Record,\n usersById: Record,\n folder: ApiChatFolder,\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n chatIdsCache?: number[],\n) {\n const excludedChatIds = folder.excludedChatIds ? new Set(folder.excludedChatIds) : undefined;\n const includedChatIds = folder.excludedChatIds ? new Set(folder.includedChatIds) : undefined;\n const pinnedChatIds = folder.excludedChatIds ? new Set(folder.pinnedChatIds) : undefined;\n const listIds = (chatIdsCache || Object.keys(chatsById).map(Number))\n .filter((id) => {\n return filterChatFolder(\n chatsById[id],\n folder,\n usersById,\n notifySettings,\n notifyExceptions,\n excludedChatIds,\n includedChatIds,\n pinnedChatIds,\n );\n });\n\n return [listIds, folder.pinnedChatIds] as const;\n}\n\nfunction filterChatFolder(\n chat: ApiChat,\n folder: ApiChatFolder,\n usersById: Record,\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n excludedChatIds?: Set,\n includedChatIds?: Set,\n pinnedChatIds?: Set,\n) {\n if (!chat.isListed) {\n return false;\n }\n\n if (excludedChatIds && excludedChatIds.has(chat.id)) {\n return false;\n }\n\n if (includedChatIds && includedChatIds.has(chat.id)) {\n return true;\n }\n\n if (pinnedChatIds && pinnedChatIds.has(chat.id)) {\n return true;\n }\n\n if (isChatArchived(chat) && folder.excludeArchived) {\n return false;\n }\n\n if (folder.excludeMuted && !chat.unreadMentionsCount && selectIsChatMuted(chat, notifySettings, notifyExceptions)) {\n return false;\n }\n\n if (!chat.unreadCount && !chat.unreadMentionsCount && !chat.hasUnreadMark && folder.excludeRead) {\n return false;\n }\n\n if (isChatPrivate(chat.id)) {\n const privateChatUser = usersById[chat.id];\n\n const isChatWithBot = privateChatUser && privateChatUser.type === 'userTypeBot';\n if (isChatWithBot) {\n if (folder.bots) {\n return true;\n }\n } else {\n if (folder.contacts && privateChatUser && privateChatUser.isContact) {\n return true;\n }\n\n if (folder.nonContacts && privateChatUser && !privateChatUser.isContact) {\n return true;\n }\n }\n } else if (isChatGroup(chat)) {\n return !!folder.groups;\n } else if (isChatChannel(chat)) {\n return !!folder.channels;\n }\n\n return false;\n}\n\nexport function prepareChatList(\n chatsById: Record,\n listIds: number[],\n orderedPinnedIds?: number[],\n folderType: 'all' | 'archived' | 'folder' = 'all',\n) {\n function chatFilter(chat?: ApiChat) {\n if (!chat || !chat.lastMessage || chat.migratedTo) {\n return false;\n }\n\n switch (folderType) {\n case 'all':\n if (isChatArchived(chat)) {\n return false;\n }\n break;\n case 'archived':\n if (!isChatArchived(chat)) {\n return false;\n }\n break;\n }\n\n return !chat.isRestricted && !chat.isNotJoined;\n }\n\n const listedChats = listIds\n .map((id) => chatsById[id])\n .filter(chatFilter);\n\n const listIdsSet = new Set(listIds);\n const pinnedChats = orderedPinnedIds\n ? (\n orderedPinnedIds\n .map((id) => chatsById[id])\n .filter(chatFilter)\n .filter((chat) => listIdsSet.has(chat.id))\n )\n : [];\n\n const otherChats = orderBy(\n orderedPinnedIds\n ? listedChats.filter((chat) => !orderedPinnedIds.includes(chat.id))\n : listedChats,\n getChatOrder,\n 'desc',\n );\n\n return {\n pinnedChats,\n otherChats,\n };\n}\n\nexport function getFolderUnreadDialogs(\n chatsById: Record,\n usersById: Record,\n folder: ApiChatFolder,\n chatIdsCache: number[],\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n) {\n const [listIds] = prepareFolderListIds(chatsById, usersById, folder, notifySettings, notifyExceptions, chatIdsCache);\n\n const listedChats = listIds\n .map((id) => chatsById[id])\n .filter((chat) => (chat?.lastMessage && !chat.isRestricted && !chat.isNotJoined));\n\n const unreadDialogsCount = listedChats\n .reduce((total, chat) => (chat.unreadCount || chat.hasUnreadMark ? total + 1 : total), 0);\n\n const hasActiveDialogs = listedChats.some((chat) => (\n chat.unreadMentionsCount\n || (!selectIsChatMuted(chat, notifySettings, notifyExceptions) && (chat.unreadCount || chat.hasUnreadMark))\n ));\n\n return {\n unreadDialogsCount,\n hasActiveDialogs,\n };\n}\n\nexport function getFolderDescriptionText(\n lang: LangFn,\n chatsById: Record,\n usersById: Record,\n folder: ApiChatFolder,\n chatIdsCache: number[],\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n) {\n const {\n id, title, emoticon, description, pinnedChatIds,\n excludedChatIds, includedChatIds,\n excludeArchived, excludeMuted, excludeRead,\n ...filters\n } = folder;\n\n // If folder has multiple additive filters or uses include/exclude lists,\n // we display folder chats count\n if (\n Object.values(filters).filter(Boolean).length > 1\n || (excludedChatIds?.length)\n || (includedChatIds?.length)\n ) {\n const length = getFolderChatsCount(chatsById, usersById, folder, chatIdsCache, notifySettings, notifyExceptions);\n return lang('Chats', length);\n }\n\n // Otherwise, we return a short description of a single filter\n if (filters.bots) {\n return lang('FilterBots');\n } else if (filters.groups) {\n return lang('FilterGroups');\n } else if (filters.channels) {\n return lang('FilterChannels');\n } else if (filters.contacts) {\n return lang('FilterContacts');\n } else if (filters.nonContacts) {\n return lang('FilterNonContacts');\n } else {\n return undefined;\n }\n}\n\nfunction getFolderChatsCount(\n chatsById: Record,\n usersById: Record,\n folder: ApiChatFolder,\n chatIdsCache: number[],\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n) {\n const [listIds, pinnedIds] = prepareFolderListIds(\n chatsById, usersById, folder, notifySettings, notifyExceptions, chatIdsCache,\n );\n const { pinnedChats, otherChats } = prepareChatList(chatsById, listIds, pinnedIds, 'folder');\n return pinnedChats.length + otherChats.length;\n}\n\nexport function isChat(chatOrUser?: ApiUser | ApiChat): chatOrUser is ApiChat {\n if (!chatOrUser) {\n return false;\n }\n\n return chatOrUser.id < 0;\n}\n\nexport function getMessageSenderName(lang: LangFn, chatId: number, sender?: ApiUser) {\n if (!sender || isChatPrivate(chatId)) {\n return undefined;\n }\n\n if (sender.isSelf) {\n return lang('FromYou');\n }\n\n return getUserFirstOrLastName(sender);\n}\n\nexport function sortChatIds(\n chatIds: number[],\n chatsById: Record,\n shouldPrioritizeVerified = false,\n priorityIds?: number[],\n) {\n return orderBy(chatIds, (id) => {\n const chat = chatsById[id];\n if (!chat) {\n return 0;\n }\n\n let priority = 0;\n\n if (chat.lastMessage) {\n priority += chat.lastMessage.date;\n }\n\n if (shouldPrioritizeVerified && chat.isVerified) {\n priority += VERIFIED_PRIORITY_BASE; // ~100 years in seconds\n }\n\n if (priorityIds && priorityIds.includes(id)) {\n priority = Date.now() + PINNED_PRIORITY_BASE + (priorityIds.length - priorityIds.indexOf(id));\n }\n\n return priority;\n }, 'desc');\n}\n","import {\n ApiChat, ApiMessage, ApiMessageEntityTypes, ApiUser,\n} from '../../api/types';\nimport { LangFn } from '../../hooks/useLang';\n\nimport { LOCAL_MESSAGE_ID_BASE, SERVICE_NOTIFICATIONS_USER_ID, RE_LINK_TEMPLATE } from '../../config';\nimport parseEmojiOnlyString from '../../components/common/helpers/parseEmojiOnlyString';\nimport { getUserFullName } from './users';\nimport { getChatTitle } from './chats';\n\nconst CONTENT_NOT_SUPPORTED = 'The message is not supported on this version of Telegram';\nconst RE_LINK = new RegExp(RE_LINK_TEMPLATE, 'i');\nconst TRUNCATED_SUMMARY_LENGTH = 80;\n\nexport function getMessageKey(message: ApiMessage) {\n const { chatId, id } = message;\n\n return `msg${chatId}-${id}`;\n}\n\nexport function parseMessageKey(key: string) {\n const match = key.match(/^msg(-?\\d+)-(\\d+)/)!;\n\n return { chatId: Number(match[1]), messageId: Number(match[2]) };\n}\n\nexport function getMessageOriginalId(message: ApiMessage) {\n return message.previousLocalId || message.id;\n}\n\nexport function getMessageSummaryText(lang: LangFn, message: ApiMessage, noEmoji = false) {\n const {\n text, photo, video, audio, voice, document, sticker, contact, poll, invoice,\n } = message.content;\n\n const truncatedText = text && text.text.substr(0, TRUNCATED_SUMMARY_LENGTH);\n\n if (message.groupedId) {\n return `${noEmoji ? '' : '🖼 '}${truncatedText || lang('lng_in_dlg_album')}`;\n }\n\n if (photo) {\n return `${noEmoji ? '' : '🖼 '}${truncatedText || lang('AttachPhoto')}`;\n }\n\n if (video) {\n return `${noEmoji ? '' : '📹 '}${truncatedText || lang(video.isGif ? 'AttachGif' : 'AttachVideo')}`;\n }\n\n if (sticker) {\n return `${sticker.emoji || ''} ${lang('AttachSticker')}`.trim();\n }\n\n if (audio) {\n return `${noEmoji ? '' : '🎧 '}${getMessageAudioCaption(message) || lang('AttachMusic')}`;\n }\n\n if (voice) {\n return `${noEmoji ? '' : '🎤 '}${truncatedText || lang('AttachAudio')}`;\n }\n\n if (document) {\n return `${noEmoji ? '' : '📎 '}${truncatedText || document.fileName}`;\n }\n\n if (contact) {\n return lang('AttachContact');\n }\n\n if (poll) {\n return `${noEmoji ? '' : '📊 '}${poll.summary.question}`;\n }\n\n if (invoice) {\n return 'Invoice';\n }\n\n if (text) {\n return truncatedText;\n }\n\n return CONTENT_NOT_SUPPORTED;\n}\n\nexport function getMessageText(message: ApiMessage) {\n const {\n text, sticker, photo, video, audio, voice, document, poll, webPage, contact, invoice,\n } = message.content;\n\n if (text) {\n return text.text;\n }\n\n if (sticker || photo || video || audio || voice || document || contact || poll || webPage || invoice) {\n return undefined;\n }\n\n return CONTENT_NOT_SUPPORTED;\n}\n\nexport function getMessageCustomShape(message: ApiMessage): boolean | number {\n const {\n text, sticker, photo, video, audio, voice, document, poll, webPage, contact,\n } = message.content;\n\n if (sticker || (video?.isRound)) {\n return true;\n }\n\n if (!text || photo || video || audio || voice || document || poll || webPage || contact) {\n return false;\n }\n\n // This is a \"dual-intent\" method used to limit calls of `parseEmojiOnlyString`.\n return parseEmojiOnlyString(text.text) || false;\n}\n\nexport function getMessageSingleEmoji(message: ApiMessage) {\n const { text } = message.content;\n if (!(text && text.text.length <= 6)) {\n return undefined;\n }\n\n if (getMessageCustomShape(message) !== 1) {\n return undefined;\n }\n\n return text.text;\n}\n\nexport function getFirstLinkInMessage(message: ApiMessage) {\n const { text } = message.content;\n\n let match: RegExpMatchArray | null | undefined;\n if (text?.entities) {\n let link = text.entities.find((entity) => entity.type === ApiMessageEntityTypes.TextUrl);\n if (link) {\n match = link.url!.match(RE_LINK);\n }\n\n if (!match) {\n link = text.entities.find((entity) => entity.type === ApiMessageEntityTypes.Url);\n if (link) {\n const { offset, length } = link;\n match = text.text.substring(offset, offset + length).match(RE_LINK);\n }\n }\n }\n\n if (!match && text) {\n match = text.text.match(RE_LINK);\n }\n\n if (!match) {\n return undefined;\n }\n\n return {\n url: match[0],\n domain: match[3],\n };\n}\n\nexport function matchLinkInMessageText(message: ApiMessage) {\n const { text } = message.content;\n const match = text && text.text.match(RE_LINK);\n\n if (!match) {\n return undefined;\n }\n\n return {\n url: match[0],\n domain: match[3],\n };\n}\n\nexport function isOwnMessage(message: ApiMessage) {\n return message.isOutgoing;\n}\n\nexport function isReplyMessage(message: ApiMessage) {\n return Boolean(message.replyToMessageId);\n}\n\nexport function isForwardedMessage(message: ApiMessage) {\n return Boolean(message.forwardInfo);\n}\n\nexport function isActionMessage(message: ApiMessage) {\n return !!message.content.action;\n}\n\nexport function isServiceNotificationMessage(message: ApiMessage) {\n return message.chatId === SERVICE_NOTIFICATIONS_USER_ID && isMessageLocal(message);\n}\n\nexport function isAnonymousOwnMessage(message: ApiMessage) {\n return Boolean(message.senderId) && message.senderId! < 0 && isOwnMessage(message);\n}\n\nexport function getSenderTitle(lang: LangFn, sender: ApiUser | ApiChat) {\n return sender.id > 0 ? getUserFullName(sender as ApiUser) : getChatTitle(lang, sender as ApiChat);\n}\n\nexport function getSendingState(message: ApiMessage) {\n if (!message.sendingState) {\n return 'succeeded';\n }\n\n return message.sendingState === 'messageSendingStateFailed' ? 'failed' : 'pending';\n}\n\nexport function isMessageLocal(message: ApiMessage) {\n return message.id >= LOCAL_MESSAGE_ID_BASE;\n}\n\nexport function isHistoryClearMessage(message: ApiMessage) {\n return message.content.action && message.content.action.type === 'historyClear';\n}\n\nexport function getMessageAudioCaption(message: ApiMessage) {\n const { audio, text } = message.content;\n\n return (audio && [audio.title, audio.performer].filter(Boolean).join(' — ')) || (text?.text);\n}\n","import {\n ApiAudio, ApiMediaFormat, ApiMessage, ApiMessageSearchType, ApiPhoto, ApiVideo, ApiDimensions,\n} from '../../api/types';\n\nimport { IS_OPUS_SUPPORTED, IS_PROGRESSIVE_SUPPORTED, IS_SAFARI } from '../../util/environment';\nimport { getMessageKey, isMessageLocal, matchLinkInMessageText } from './messages';\nimport { getDocumentHasPreview } from '../../components/common/helpers/documentInfo';\n\ntype Target =\n 'micro'\n | 'pictogram'\n | 'inline'\n | 'viewerPreview'\n | 'viewerFull'\n | 'download';\n\nexport function getMessageContent(message: ApiMessage) {\n return message.content;\n}\n\nexport function hasMessageMedia(message: ApiMessage) {\n return Boolean((\n getMessagePhoto(message)\n || getMessageVideo(message)\n || getMessageDocument(message)\n || getMessageSticker(message)\n || getMessageContact(message)\n || getMessagePoll(message)\n || getMessageAction(message)\n || getMessageAudio(message)\n || getMessageVoice(message)\n ));\n}\n\nexport function getMessagePhoto(message: ApiMessage) {\n return message.content.photo;\n}\n\nexport function getMessageVideo(message: ApiMessage) {\n return message.content.video;\n}\n\nexport function getMessageRoundVideo(message: ApiMessage) {\n const { video } = message.content;\n\n return video?.isRound ? video : undefined;\n}\n\nexport function getMessageAction(message: ApiMessage) {\n return message.content.action;\n}\n\nexport function getMessageAudio(message: ApiMessage) {\n return message.content.audio;\n}\n\nexport function getMessageVoice(message: ApiMessage) {\n return message.content.voice;\n}\n\nexport function getMessageSticker(message: ApiMessage) {\n return message.content.sticker;\n}\n\nexport function getMessageDocument(message: ApiMessage) {\n return message.content.document;\n}\n\nexport function isMessageDocumentPhoto(message: ApiMessage) {\n const document = getMessageDocument(message);\n return document ? document.mediaType === 'photo' : undefined;\n}\n\nexport function isMessageDocumentVideo(message: ApiMessage) {\n const document = getMessageDocument(message);\n return document ? document.mediaType === 'video' : undefined;\n}\n\nexport function getMessageContact(message: ApiMessage) {\n return message.content.contact;\n}\n\nexport function getMessagePoll(message: ApiMessage) {\n return message.content.poll;\n}\n\nexport function getMessageInvoice(message: ApiMessage) {\n return message.content.invoice;\n}\n\nexport function getMessageWebPage(message: ApiMessage) {\n return message.content.webPage;\n}\n\nexport function getMessageWebPagePhoto(message: ApiMessage) {\n return getMessageWebPage(message)?.photo;\n}\n\nexport function getMessageWebPageDocument(message: ApiMessage) {\n return getMessageWebPage(message)?.document;\n}\n\nexport function getMessageWebPageVideo(message: ApiMessage): ApiVideo | undefined {\n return getMessageWebPage(message)?.video;\n}\n\nexport function getMessageMediaThumbnail(message: ApiMessage) {\n const media = getMessagePhoto(message)\n || getMessageVideo(message)\n || getMessageDocument(message)\n || getMessageSticker(message)\n || getMessageWebPagePhoto(message)\n || getMessageWebPageVideo(message);\n\n if (!media) {\n return undefined;\n }\n\n return media.thumbnail;\n}\n\nexport function getMessageMediaThumbDataUri(message: ApiMessage) {\n return getMessageMediaThumbnail(message)?.dataUri;\n}\n\nexport function getMessageMediaHash(\n message: ApiMessage,\n target: Target,\n) {\n const {\n photo, video, sticker, audio, voice, document,\n } = message.content;\n const webPagePhoto = getMessageWebPagePhoto(message);\n const webPageVideo = getMessageWebPageVideo(message);\n\n const messageVideo = video || webPageVideo;\n const messagePhoto = photo || webPagePhoto;\n\n if (!(messagePhoto || messageVideo || sticker || audio || voice || document)) {\n return undefined;\n }\n\n const base = getMessageKey(message);\n\n if (messageVideo) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return `${base}?size=m`;\n case 'inline':\n return !hasMessageLocalBlobUrl(message) ? getVideoOrAudioBaseHash(messageVideo, base) : undefined;\n case 'viewerPreview':\n return `${base}?size=m`;\n case 'viewerFull':\n return getVideoOrAudioBaseHash(messageVideo, base);\n case 'download':\n return `${base}?download`;\n }\n }\n\n if (messagePhoto) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return `${base}?size=m`;\n case 'inline':\n return !hasMessageLocalBlobUrl(message) ? `${base}?size=x` : undefined;\n case 'viewerPreview':\n return `${base}?size=x`;\n case 'viewerFull':\n return `${base}?size=z`;\n }\n }\n\n if (document) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n case 'inline':\n case 'viewerPreview':\n if (!getDocumentHasPreview(document) || hasMessageLocalBlobUrl(message)) {\n return undefined;\n }\n\n return `${base}?size=m`;\n default:\n return base;\n }\n }\n\n if (sticker) {\n switch (target) {\n case 'micro':\n return undefined;\n case 'pictogram':\n return `${base}?size=m`;\n default:\n return base;\n }\n }\n\n if (audio) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return undefined;\n case 'download':\n return `${base}?download`;\n default:\n return getVideoOrAudioBaseHash(audio, base);\n }\n }\n\n if (voice) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return undefined;\n default:\n return base;\n }\n }\n\n return undefined;\n}\n\nfunction getVideoOrAudioBaseHash(media: ApiAudio | ApiVideo, base: string) {\n if (IS_PROGRESSIVE_SUPPORTED && IS_SAFARI) {\n return `${base}?fileSize=${media.size}&mimeType=${media.mimeType}`;\n }\n\n return base;\n}\n\nexport function getMessageMediaFormat(\n message: ApiMessage, target: Target,\n): Exclude;\nexport function getMessageMediaFormat(message: ApiMessage, target: Target, canBeLottie: true): ApiMediaFormat;\nexport function getMessageMediaFormat(\n message: ApiMessage, target: Target,\n): ApiMediaFormat {\n const {\n sticker, video, audio, voice,\n } = message.content;\n\n const fullVideo = video || getMessageWebPageVideo(message);\n\n if (sticker && target === 'inline' && sticker.isAnimated) {\n return ApiMediaFormat.Lottie;\n } else if (fullVideo && IS_PROGRESSIVE_SUPPORTED && (\n target === 'viewerFull' || target === 'inline'\n )) {\n return ApiMediaFormat.Progressive;\n } else if (audio || voice) {\n // Safari\n if (voice && !IS_OPUS_SUPPORTED) {\n return ApiMediaFormat.BlobUrl;\n }\n\n return ApiMediaFormat.Progressive;\n }\n\n return ApiMediaFormat.BlobUrl;\n}\n\nexport function getMessageFileName(message: ApiMessage) {\n const {\n photo, video, document,\n } = message.content;\n const webPagePhoto = getMessageWebPagePhoto(message);\n const webPageVideo = getMessageWebPageVideo(message);\n\n if (photo || webPagePhoto) {\n return `photo${message.date}.jpeg`;\n }\n\n const { fileName } = video || webPageVideo || document || {};\n\n return fileName;\n}\n\nexport function getMessageFileSize(message: ApiMessage) {\n const { video, document } = message.content;\n const webPageVideo = getMessageWebPageVideo(message);\n const { size } = video || webPageVideo || document || {};\n\n return size;\n}\n\nexport function hasMessageLocalBlobUrl(message: ApiMessage) {\n const { photo, video, document } = message.content;\n\n return (photo?.blobUrl) || (video?.blobUrl) || (document?.previewBlobUrl);\n}\n\nexport function getChatMediaMessageIds(\n messages: Record, listedIds: number[], isFromSharedMedia = false,\n) {\n const ids = getMessageContentIds(messages, listedIds, isFromSharedMedia ? 'media' : 'inlineMedia');\n\n return isFromSharedMedia ? ids.reverse() : ids;\n}\n\nexport function getPhotoFullDimensions(photo: ApiPhoto): ApiDimensions | undefined {\n return (\n photo.sizes.find((size) => size.type === 'z')\n || photo.sizes.find((size) => size.type === 'y')\n || getPhotoInlineDimensions(photo)\n );\n}\n\nexport function getPhotoInlineDimensions(photo: ApiPhoto): ApiDimensions | undefined {\n return (\n photo.sizes.find((size) => size.type === 'x')\n || photo.sizes.find((size) => size.type === 'm')\n || photo.sizes.find((size) => size.type === 's')\n || photo.thumbnail\n );\n}\n\nexport function getVideoDimensions(video: ApiVideo): ApiDimensions | undefined {\n if (video.width && video.height) {\n return video as ApiDimensions;\n }\n\n return undefined;\n}\n\nexport function getMediaTransferState(message: ApiMessage, progress?: number, isDownloadNeeded = false) {\n const isUploading = isMessageLocal(message);\n const isTransferring = isUploading || isDownloadNeeded;\n const transferProgress = Number(progress);\n\n return {\n isUploading, isTransferring, transferProgress,\n };\n}\n\nexport function getMessageContentIds(\n messages: Record, messageIds: number[], contentType: ApiMessageSearchType | 'inlineMedia',\n) {\n let validator: Function;\n\n switch (contentType) {\n case 'media':\n validator = (message: ApiMessage) => {\n const video = getMessageVideo(message);\n return getMessagePhoto(message) || (video && !video.isRound && !video.isGif);\n };\n break;\n\n case 'documents':\n validator = getMessageDocument;\n break;\n\n case 'links':\n validator = (message: ApiMessage) => getMessageWebPage(message) || matchLinkInMessageText(message);\n break;\n\n case 'audio':\n validator = getMessageAudio;\n break;\n\n case 'inlineMedia':\n validator = (message: ApiMessage) => {\n const video = getMessageVideo(message);\n return (\n getMessagePhoto(message)\n || (video && !video.isRound && !video.isGif)\n || isMessageDocumentPhoto(message)\n || isMessageDocumentVideo(message)\n );\n };\n break;\n\n default:\n return [] as Array;\n }\n\n return messageIds.reduce((result, messageId) => {\n if (messages[messageId] && validator(messages[messageId])) {\n result.push(messageId);\n }\n\n return result;\n }, [] as Array);\n}\n\nexport function getMediaDuration(message: ApiMessage) {\n const { audio, voice, video } = getMessageContent(message);\n const media = audio || voice || video || getMessageWebPageVideo(message);\n if (!media) {\n return undefined;\n }\n\n return media.duration;\n}\n","export function buildChatThreadKey(chatId: number, threadId: number) {\n return `${chatId}_${threadId}`;\n}\n","import { ApiFieldError } from '../../api/types';\n\nconst STRIPE_ERRORS: Record = {\n missing_payment_information: {\n field: 'cardNumber',\n message: 'Incorrect card number',\n },\n invalid_number: {\n field: 'cardNumber',\n message: 'Incorrect card number',\n },\n number: {\n field: 'cardNumber',\n message: 'Incorrect card number',\n },\n exp_year: {\n field: 'expiry',\n message: 'Incorrect year',\n },\n exp_month: {\n field: 'expiry',\n message: 'Incorrect month',\n },\n invalid_expiry_year: {\n field: 'expiry',\n message: 'Incorrect year',\n },\n invalid_expiry_month: {\n field: 'expiry',\n message: 'Incorrect month',\n },\n cvc: {\n field: 'cvv',\n message: 'Incorrect CVV',\n },\n invalid_cvc: {\n field: 'cvv',\n message: 'Incorrect CVV',\n },\n};\n\nexport function getStripeError(error: {\n code: string;\n message: string;\n param?: string;\n}) {\n const { message: description, code, param } = error;\n const { field, message } = param ? STRIPE_ERRORS[param] : STRIPE_ERRORS[code];\n\n return { field, message, description };\n}\n","import { ApiChat, ApiUser } from '../../api/types';\n\nimport { SERVICE_NOTIFICATIONS_USER_ID } from '../../config';\nimport { formatFullDate, formatTime } from '../../util/dateFormat';\nimport { orderBy } from '../../util/iteratees';\nimport { LangFn } from '../../hooks/useLang';\nimport { getServerTime } from '../../util/serverTime';\n\nconst USER_COLOR_KEYS = [1, 8, 5, 2, 7, 4, 6];\n\nexport function getUserFirstOrLastName(user?: ApiUser) {\n if (!user) {\n return undefined;\n }\n\n switch (user.type) {\n case 'userTypeBot':\n case 'userTypeRegular': {\n return user.firstName || user.lastName;\n }\n\n case 'userTypeDeleted':\n case 'userTypeUnknown': {\n return 'Deleted';\n }\n\n default:\n return undefined;\n }\n}\n\nexport function getUserFullName(user?: ApiUser) {\n if (!user) {\n return undefined;\n }\n\n if (isDeletedUser(user)) {\n return 'Deleted account';\n }\n\n switch (user.type) {\n case 'userTypeBot':\n case 'userTypeRegular': {\n if (user.firstName && user.lastName) {\n return `${user.firstName} ${user.lastName}`;\n }\n\n if (user.firstName) {\n return user.firstName;\n }\n\n if (user.lastName) {\n return user.lastName;\n }\n\n break;\n }\n\n case 'userTypeDeleted':\n case 'userTypeUnknown': {\n return 'Deleted account';\n }\n }\n\n return undefined;\n}\n\nexport function getUserStatus(lang: LangFn, user: ApiUser, serverTimeOffset: number) {\n if (user.id === SERVICE_NOTIFICATIONS_USER_ID) {\n return lang('ServiceNotifications').toLowerCase();\n }\n\n if (user.type && user.type === 'userTypeBot') {\n return lang('Bot');\n }\n\n if (!user.status) {\n return '';\n }\n\n switch (user.status.type) {\n case 'userStatusEmpty': {\n return lang('ALongTimeAgo');\n }\n\n case 'userStatusLastMonth': {\n return lang('WithinAMonth');\n }\n\n case 'userStatusLastWeek': {\n return lang('WithinAWeek');\n }\n\n case 'userStatusOffline': {\n const { wasOnline } = user.status;\n\n if (!wasOnline) return lang('LastSeen.Offline');\n\n const now = new Date(new Date().getTime() + serverTimeOffset * 1000);\n const wasOnlineDate = new Date(wasOnline * 1000);\n\n if (wasOnlineDate >= now) {\n return lang('LastSeen.JustNow');\n }\n\n const diff = new Date(now.getTime() - wasOnlineDate.getTime());\n\n // within a minute\n if (diff.getTime() / 1000 < 60) {\n return lang('LastSeen.JustNow');\n }\n\n // within an hour\n if (diff.getTime() / 1000 < 60 * 60) {\n const minutes = Math.floor(diff.getTime() / 1000 / 60);\n return lang('LastSeen.MinutesAgo', minutes);\n }\n\n // today\n const today = new Date();\n today.setHours(0, 0, 0, 0);\n const serverToday = new Date(today.getTime() + serverTimeOffset * 1000);\n if (wasOnlineDate > serverToday) {\n // up to 6 hours ago\n if (diff.getTime() / 1000 < 6 * 60 * 60) {\n const hours = Math.floor(diff.getTime() / 1000 / 60 / 60);\n return lang('LastSeen.HoursAgo', hours);\n }\n\n // other\n return lang('LastSeen.TodayAt', formatTime(wasOnlineDate));\n }\n\n // yesterday\n const yesterday = new Date();\n yesterday.setDate(now.getDate() - 1);\n yesterday.setHours(0, 0, 0, 0);\n const serverYesterday = new Date(yesterday.getTime() + serverTimeOffset * 1000);\n if (wasOnlineDate > serverYesterday) {\n return lang('LastSeen.YesterdayAt', formatTime(wasOnlineDate));\n }\n\n return lang('LastSeen.AtDate', formatFullDate(lang, wasOnlineDate));\n }\n\n case 'userStatusOnline': {\n return lang('Online');\n }\n\n case 'userStatusRecently': {\n return lang('Lately');\n }\n\n default:\n return undefined;\n }\n}\n\nexport function isUserOnline(user: ApiUser) {\n const { id, status, type } = user;\n\n if (!status) {\n return false;\n }\n\n if (id === SERVICE_NOTIFICATIONS_USER_ID) {\n return false;\n }\n\n return status.type === 'userStatusOnline' && type !== 'userTypeBot';\n}\n\nexport function isDeletedUser(user: ApiUser) {\n if (!user.status || user.type === 'userTypeBot' || user.id === SERVICE_NOTIFICATIONS_USER_ID) {\n return false;\n }\n\n return user.type === 'userTypeDeleted'\n || user.type === 'userTypeUnknown';\n}\n\nexport function isUserBot(user: ApiUser) {\n return user.type === 'userTypeBot';\n}\n\nexport function sortUserIds(\n userIds: number[],\n usersById: Record,\n priorityIds?: number[],\n serverTimeOffset = 0,\n) {\n return orderBy(userIds, (id) => {\n const now = getServerTime(serverTimeOffset);\n\n if (priorityIds && priorityIds.includes(id)) {\n // Assuming that online status expiration date can't be as far as two days from now,\n // this should place prioritized on top of the list.\n // Then we subtract index of `id` in `priorityIds` to preserve selected order\n return now + (48 * 60 * 60) - (priorityIds.length - priorityIds.indexOf(id));\n }\n\n const user = usersById[id];\n if (!user || !user.status) {\n return 0;\n }\n\n if (user.status.type === 'userStatusOnline') {\n return user.status.expires;\n } else if (user.status.type === 'userStatusOffline' && user.status.wasOnline) {\n return user.status.wasOnline;\n }\n\n switch (user.status.type) {\n case 'userStatusRecently':\n return now - 60 * 60 * 24;\n case 'userStatusLastWeek':\n return now - 60 * 60 * 24 * 7;\n case 'userStatusLastMonth':\n return now - 60 * 60 * 24 * 7 * 30;\n default:\n return 0;\n }\n }, 'desc');\n}\n\n// eslint-disable-next-line max-len\n// https://github.com/telegramdesktop/tdesktop/blob/371510cfe23b0bd226de8c076bc49248fbe40c26/Telegram/SourceFiles/data/data_peer.cpp#L53\nexport function getUserColorKey(peer: ApiUser | ApiChat | undefined) {\n const index = peer ? Math.abs(peer.id) % 7 : 0;\n\n return USER_COLOR_KEYS[index];\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiChat, ApiPhoto } from '../../api/types';\n\nimport { ARCHIVED_FOLDER_ID } from '../../config';\nimport { omit } from '../../util/iteratees';\n\nexport function replaceChatListIds(\n global: GlobalState,\n type: 'active' | 'archived',\n newIds: number[] | undefined,\n): GlobalState {\n return {\n ...global,\n chats: {\n ...global.chats,\n listIds: {\n ...global.chats.listIds,\n [type]: newIds,\n },\n },\n };\n}\n\nexport function updateChatListIds(global: GlobalState, type: 'active' | 'archived', idsUpdate: number[]): GlobalState {\n const { [type]: listIds } = global.chats.listIds;\n const newIds = listIds?.length\n ? idsUpdate.filter((id) => !listIds.includes(id))\n : idsUpdate;\n\n if (listIds && !newIds.length) {\n return global;\n }\n\n return replaceChatListIds(global, type, [\n ...(listIds || []),\n ...newIds,\n ]);\n}\n\nexport function replaceChats(global: GlobalState, newById: Record): GlobalState {\n return {\n ...global,\n chats: {\n ...global.chats,\n byId: newById,\n },\n };\n}\n\n// @optimization Don't spread/unspread global for each element, do it in a batch\nfunction getUpdatedChat(\n global: GlobalState, chatId: number, chatUpdate: Partial, photo?: ApiPhoto,\n): ApiChat {\n const { byId } = global.chats;\n const chat = byId[chatId];\n const shouldOmitMinInfo = chatUpdate.isMin && chat && !chat.isMin;\n const updatedChat = {\n ...chat,\n ...(shouldOmitMinInfo ? omit(chatUpdate, ['isMin', 'accessHash']) : chatUpdate),\n ...(photo && { photos: [photo, ...(chat.photos || [])] }),\n };\n\n if (!updatedChat.id || !updatedChat.type) {\n return updatedChat;\n }\n\n return updatedChat;\n}\n\nexport function updateChat(\n global: GlobalState, chatId: number, chatUpdate: Partial, photo?: ApiPhoto,\n): GlobalState {\n const { byId } = global.chats;\n\n const updatedChat = getUpdatedChat(global, chatId, chatUpdate, photo);\n\n return replaceChats(global, {\n ...byId,\n [chatId]: updatedChat,\n });\n}\n\nexport function updateChats(global: GlobalState, updatedById: Record): GlobalState {\n const updatedChats = Object.keys(updatedById).map(Number).reduce>((acc, id) => {\n const updatedChat = getUpdatedChat(global, id, updatedById[id]);\n if (updatedChat) {\n acc[id] = updatedChat;\n }\n return acc;\n }, {});\n\n global = replaceChats(global, {\n ...global.chats.byId,\n ...updatedChats,\n });\n\n return global;\n}\n\n// @optimization Allows to avoid redundant updates which cause a lot of renders\nexport function addChats(global: GlobalState, addedById: Record): GlobalState {\n const { byId } = global.chats;\n let isAdded = false;\n\n const addedChats = Object.keys(addedById).map(Number).reduce>((acc, id) => {\n if (!byId[id] || (byId[id].isMin && !addedById[id].isMin)) {\n const updatedChat = getUpdatedChat(global, id, addedById[id]);\n if (updatedChat) {\n acc[id] = updatedChat;\n\n if (!isAdded) {\n isAdded = true;\n }\n }\n }\n return acc;\n }, {});\n\n if (isAdded) {\n global = replaceChats(global, {\n ...global.chats.byId,\n ...addedChats,\n });\n }\n\n return global;\n}\n\nexport function updateChatListType(\n global: GlobalState,\n chatId: number,\n folderId?: number,\n): GlobalState {\n const listType = folderId === ARCHIVED_FOLDER_ID ? 'archived' : 'active';\n\n let currentListIds = global.chats.listIds;\n (Object.keys(currentListIds) as Array).forEach((listTypeKey) => {\n const currentFolderList = currentListIds[listTypeKey] || [];\n if (listTypeKey === listType && !currentFolderList.includes(chatId)) {\n currentListIds = {\n ...currentListIds,\n [listTypeKey]: [...currentFolderList, chatId],\n };\n } else if (listTypeKey !== listType && currentFolderList.includes(chatId)) {\n currentListIds = {\n ...currentListIds,\n [listTypeKey]: currentFolderList.filter((id) => id !== chatId),\n };\n }\n });\n\n global = {\n ...global,\n chats: {\n ...global.chats,\n listIds: currentListIds,\n },\n };\n\n global = updateChat(global, chatId, { folderId: folderId || undefined });\n\n return global;\n}\n\nexport function updateChatListSecondaryInfo(\n global: GlobalState,\n type: 'active' | 'archived',\n info: {\n orderedPinnedIds?: number[];\n totalChatCount: number;\n },\n): GlobalState {\n const totalCountKey = type === 'active' ? 'all' : 'archived';\n\n return {\n ...global,\n chats: {\n ...global.chats,\n ...(info.orderedPinnedIds && {\n orderedPinnedIds: {\n ...global.chats.orderedPinnedIds,\n [type]: info.orderedPinnedIds,\n },\n }),\n totalCount: {\n ...global.chats.totalCount,\n [totalCountKey]: info.totalChatCount,\n },\n isFullyLoaded: {\n ...global.chats.isFullyLoaded,\n [type]: false,\n },\n },\n };\n}\n","import {\n GlobalState, MessageList, MessageListType, Thread,\n} from '../../global/types';\nimport { ApiMessage, ApiThreadInfo, MAIN_THREAD_ID } from '../../api/types';\nimport { FocusDirection } from '../../types';\n\nimport { IS_TEST, MESSAGE_LIST_SLICE, MESSAGE_LIST_VIEWPORT_LIMIT } from '../../config';\nimport {\n selectListedIds,\n selectChatMessages,\n selectViewportIds,\n selectOutlyingIds,\n selectPinnedIds,\n selectThreadInfo,\n selectMessageIdsByGroupId,\n selectScheduledMessages,\n selectScheduledIds,\n selectCurrentMessageIds,\n selectChatMessage,\n selectCurrentMessageList,\n} from '../selectors';\nimport {\n areSortedArraysEqual, omit, pickTruthy, unique,\n} from '../../util/iteratees';\n\nconst TMP_CHAT_ID = -1;\n\ntype MessageStoreSections = {\n byId: Record;\n threadsById: Record;\n};\n\nexport function updateCurrentMessageList(\n global: GlobalState,\n chatId: number | undefined,\n threadId: number = MAIN_THREAD_ID,\n type: MessageListType = 'thread',\n shouldReplaceHistory?: boolean,\n): GlobalState {\n const { messageLists } = global.messages;\n let newMessageLists: MessageList[] = messageLists;\n if (shouldReplaceHistory || IS_TEST) {\n newMessageLists = chatId ? [{ chatId, threadId, type }] : [];\n } else if (chatId) {\n const last = messageLists[messageLists.length - 1];\n if (!last || last.chatId !== chatId || last.threadId !== threadId || last.type !== type) {\n if (last && last.chatId === TMP_CHAT_ID) {\n newMessageLists = [...messageLists.slice(0, -1), { chatId, threadId, type }];\n } else {\n newMessageLists = [...messageLists, { chatId, threadId, type }];\n }\n }\n } else {\n newMessageLists = messageLists.slice(0, -1);\n }\n\n return {\n ...global,\n messages: {\n ...global.messages,\n messageLists: newMessageLists,\n },\n };\n}\n\nfunction replaceChatMessages(global: GlobalState, chatId: number, newById: Record): GlobalState {\n return updateMessageStore(global, chatId, {\n byId: newById,\n });\n}\n\nfunction updateThread(\n global: GlobalState, chatId: number, threadId: number, threadUpdate: Partial,\n): GlobalState {\n const current = global.messages.byChatId[chatId];\n\n return updateMessageStore(global, chatId, {\n threadsById: {\n ...(current?.threadsById),\n [threadId]: {\n ...(current?.threadsById[threadId]),\n ...threadUpdate,\n },\n },\n });\n}\n\nfunction updateMessageStore(\n global: GlobalState, chatId: number, update: Partial,\n): GlobalState {\n const current = global.messages.byChatId[chatId] || { byId: {}, threadsById: {} };\n\n return {\n ...global,\n messages: {\n ...global.messages,\n byChatId: {\n ...global.messages.byChatId,\n [chatId]: {\n ...current,\n ...update,\n },\n },\n },\n };\n}\n\nexport function replaceThreadParam(\n global: GlobalState, chatId: number, threadId: number, paramName: T, newValue: Thread[T] | undefined,\n) {\n return updateThread(global, chatId, threadId, { [paramName]: newValue });\n}\n\nexport function addMessages(\n global: GlobalState, messages: ApiMessage[],\n): GlobalState {\n const addedByChatId = messages.reduce((messagesByChatId, message: ApiMessage) => {\n if (!messagesByChatId[message.chatId]) {\n messagesByChatId[message.chatId] = {};\n }\n messagesByChatId[message.chatId][message.id] = message;\n\n return messagesByChatId;\n }, {} as Record>);\n\n Object.keys(addedByChatId).map(Number).forEach((chatId) => {\n global = addChatMessagesById(global, chatId, addedByChatId[chatId]);\n });\n\n return global;\n}\n\nexport function addChatMessagesById(\n global: GlobalState, chatId: number, newById: Record,\n): GlobalState {\n const byId = selectChatMessages(global, chatId);\n\n if (byId && Object.keys(newById).every((newId) => Boolean(byId[Number(newId)]))) {\n return global;\n }\n\n return replaceChatMessages(global, chatId, {\n ...newById,\n ...byId,\n });\n}\n\nexport function updateChatMessage(\n global: GlobalState, chatId: number, messageId: number, messageUpdate: Partial,\n): GlobalState {\n const byId = selectChatMessages(global, chatId) || {};\n const message = byId[messageId];\n const updatedMessage = {\n ...message,\n ...messageUpdate,\n };\n\n if (!updatedMessage.id) {\n return global;\n }\n\n return replaceChatMessages(global, chatId, {\n ...byId,\n [messageId]: updatedMessage,\n });\n}\n\nexport function updateScheduledMessage(\n global: GlobalState, chatId: number, messageId: number, messageUpdate: Partial,\n): GlobalState {\n const byId = selectScheduledMessages(global, chatId) || {};\n const message = byId[messageId];\n const updatedMessage = {\n ...message,\n ...messageUpdate,\n };\n\n if (!updatedMessage.id) {\n return global;\n }\n\n return replaceScheduledMessages(global, chatId, {\n ...byId,\n [messageId]: updatedMessage,\n }, undefined);\n}\n\nexport function deleteChatMessages(\n global: GlobalState,\n chatId: number,\n messageIds: number[],\n): GlobalState {\n const byId = selectChatMessages(global, chatId);\n if (!byId) {\n return global;\n }\n const newById = omit(byId, messageIds);\n const deletedForwardedPosts = Object.values(pickTruthy(byId, messageIds)).filter(\n ({ forwardInfo }) => forwardInfo?.isLinkedChannelPost,\n );\n\n const threadIds = Object.keys(global.messages.byChatId[chatId].threadsById).map(Number);\n threadIds.forEach((threadId) => {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n\n let listedIds = selectListedIds(global, chatId, threadId);\n let outlyingIds = selectOutlyingIds(global, chatId, threadId);\n let viewportIds = selectViewportIds(global, chatId, threadId);\n let pinnedIds = selectPinnedIds(global, chatId);\n let newMessageCount = threadInfo?.messagesCount;\n\n messageIds.forEach((messageId) => {\n if (listedIds && listedIds.includes(messageId)) {\n listedIds = listedIds.filter((id) => id !== messageId);\n if (newMessageCount !== undefined) newMessageCount -= 1;\n }\n\n if (outlyingIds && outlyingIds.includes(messageId)) {\n outlyingIds = outlyingIds.filter((id) => id !== messageId);\n }\n\n if (viewportIds && viewportIds.includes(messageId)) {\n viewportIds = viewportIds.filter((id) => id !== messageId);\n }\n\n if (pinnedIds && pinnedIds.includes(messageId)) {\n pinnedIds = pinnedIds.filter((id) => id !== messageId);\n }\n });\n\n global = replaceThreadParam(global, chatId, threadId, 'listedIds', listedIds);\n global = replaceThreadParam(global, chatId, threadId, 'outlyingIds', outlyingIds);\n global = replaceThreadParam(global, chatId, threadId, 'viewportIds', viewportIds);\n global = replaceThreadParam(global, chatId, threadId, 'pinnedIds', pinnedIds);\n\n if (threadInfo && newMessageCount !== undefined) {\n global = replaceThreadParam(global, chatId, threadId, 'threadInfo', {\n ...threadInfo,\n messagesCount: newMessageCount,\n });\n }\n });\n\n if (deletedForwardedPosts.length) {\n const currentMessageList = selectCurrentMessageList(global);\n const canDeleteCurrentThread = currentMessageList && currentMessageList.chatId === chatId\n && currentMessageList.type === 'thread';\n const currentThreadId = currentMessageList?.threadId;\n\n deletedForwardedPosts.forEach((message) => {\n const { fromChatId, fromMessageId } = message.forwardInfo!;\n const originalPost = selectChatMessage(global, fromChatId!, fromMessageId!);\n\n if (canDeleteCurrentThread && currentThreadId === fromMessageId) {\n global = updateCurrentMessageList(global, chatId);\n }\n if (originalPost) {\n global = updateChatMessage(global, fromChatId!, fromMessageId!, { threadInfo: undefined });\n }\n });\n }\n\n global = replaceChatMessages(global, chatId, newById);\n\n return global;\n}\n\nexport function deleteChatScheduledMessages(\n global: GlobalState,\n chatId: number,\n messageIds: number[],\n): GlobalState {\n const byId = selectScheduledMessages(global, chatId);\n if (!byId) {\n return global;\n }\n const newById = omit(byId, messageIds);\n\n let scheduledIds = selectScheduledIds(global, chatId);\n if (scheduledIds) {\n messageIds.forEach((messageId) => {\n if (scheduledIds!.includes(messageId)) {\n scheduledIds = scheduledIds!.filter((id) => id !== messageId);\n }\n });\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds', scheduledIds);\n }\n\n global = replaceScheduledMessages(global, chatId, newById, undefined);\n\n return global;\n}\n\nexport function updateListedIds(\n global: GlobalState,\n chatId: number,\n threadId: number,\n idsUpdate: number[],\n): GlobalState {\n const listedIds = selectListedIds(global, chatId, threadId);\n const newIds = listedIds?.length\n ? idsUpdate.filter((id) => !listedIds.includes(id))\n : idsUpdate;\n\n if (listedIds && !newIds.length) {\n return global;\n }\n\n return replaceThreadParam(global, chatId, threadId, 'listedIds', orderHistoryIds([\n ...(listedIds || []),\n ...newIds,\n ]));\n}\n\nexport function updateOutlyingIds(\n global: GlobalState,\n chatId: number,\n threadId: number,\n idsUpdate: number[],\n): GlobalState {\n const outlyingIds = selectOutlyingIds(global, chatId, threadId);\n const newIds = outlyingIds?.length\n ? idsUpdate.filter((id) => !outlyingIds.includes(id))\n : idsUpdate;\n\n if (outlyingIds && !newIds.length) {\n return global;\n }\n\n return replaceThreadParam(global, chatId, threadId, 'outlyingIds', orderHistoryIds([\n ...(outlyingIds || []),\n ...newIds,\n ]));\n}\n\nfunction orderHistoryIds(listedIds: number[]) {\n return listedIds.sort((a, b) => a - b);\n}\n\nexport function addViewportId(\n global: GlobalState,\n chatId: number,\n threadId: number,\n newId: number,\n): GlobalState {\n const viewportIds = selectViewportIds(global, chatId, threadId) || [];\n if (viewportIds.includes(newId)) {\n return global;\n }\n\n const newIds = orderHistoryIds([\n ...(\n viewportIds.length < MESSAGE_LIST_VIEWPORT_LIMIT\n ? viewportIds\n : viewportIds.slice(-(MESSAGE_LIST_SLICE / 2))\n ),\n newId,\n ]);\n\n return replaceThreadParam(global, chatId, threadId, 'viewportIds', newIds);\n}\n\nexport function safeReplaceViewportIds(\n global: GlobalState,\n chatId: number,\n threadId: number,\n newViewportIds: number[],\n): GlobalState {\n const viewportIds = selectViewportIds(global, chatId, threadId) || [];\n\n return replaceThreadParam(\n global,\n chatId,\n threadId,\n 'viewportIds',\n areSortedArraysEqual(viewportIds, newViewportIds) ? viewportIds : newViewportIds,\n );\n}\n\nexport function updateThreadInfo(\n global: GlobalState, chatId: number, threadId: number, update: Partial | undefined,\n): GlobalState {\n const newThreadInfo = {\n ...(selectThreadInfo(global, chatId, threadId) as ApiThreadInfo),\n ...update,\n };\n\n if (!newThreadInfo.threadId) {\n return global;\n }\n\n return replaceThreadParam(global, chatId, threadId, 'threadInfo', newThreadInfo);\n}\n\nexport function updateThreadInfos(\n global: GlobalState, chatId: number, updates: Partial[],\n): GlobalState {\n updates.forEach((update) => {\n global = updateThreadInfo(global, update.chatId!, update.threadId!, update);\n });\n\n return global;\n}\n\nexport function replaceScheduledMessages(\n global: GlobalState, chatId: number, newById: Record, hash: number | undefined,\n): GlobalState {\n return updateScheduledMessages(global, chatId, {\n byId: newById,\n hash,\n });\n}\n\nfunction updateScheduledMessages(\n global: GlobalState, chatId: number, update: Partial<{ byId: Record; hash: number }>,\n): GlobalState {\n const current = global.scheduledMessages.byChatId[chatId] || { byId: {}, hash: 0 };\n\n return {\n ...global,\n scheduledMessages: {\n byChatId: {\n ...global.scheduledMessages.byChatId,\n [chatId]: {\n ...current,\n ...update,\n },\n },\n },\n };\n}\n\nexport function updateFocusedMessage(\n global: GlobalState, chatId?: number, messageId?: number, noHighlight = false, isResizingContainer = false,\n): GlobalState {\n return {\n ...global,\n focusedMessage: {\n ...global.focusedMessage,\n chatId,\n messageId,\n noHighlight,\n isResizingContainer,\n },\n };\n}\n\nexport function updateFocusDirection(\n global: GlobalState, direction?: FocusDirection,\n): GlobalState {\n return {\n ...global,\n focusedMessage: {\n ...global.focusedMessage,\n direction,\n },\n };\n}\n\nexport function enterMessageSelectMode(\n global: GlobalState,\n chatId: number,\n messageId?: number | number[],\n): GlobalState {\n const messageIds = messageId ? Array.prototype.concat([], messageId) : [];\n return {\n ...global,\n selectedMessages: {\n chatId,\n messageIds,\n },\n };\n}\n\nexport function toggleMessageSelection(\n global: GlobalState,\n chatId: number,\n threadId: number,\n messageListType: MessageListType,\n messageId: number,\n groupedId?: string,\n childMessageIds?: number[],\n withShift = false,\n): GlobalState {\n const { selectedMessages: oldSelectedMessages } = global;\n if (groupedId) {\n childMessageIds = selectMessageIdsByGroupId(global, chatId, groupedId);\n }\n const selectedMessageIds = childMessageIds || [messageId];\n if (!oldSelectedMessages) {\n return enterMessageSelectMode(global, chatId, selectedMessageIds);\n }\n\n const { messageIds } = oldSelectedMessages;\n\n let newMessageIds;\n const newSelectedMessageIds = selectedMessageIds.filter((id) => !messageIds.includes(id));\n if (newSelectedMessageIds && !newSelectedMessageIds.length) {\n newMessageIds = messageIds.filter((id) => !selectedMessageIds.includes(id));\n } else if (withShift && messageIds.length) {\n const viewportIds = selectCurrentMessageIds(global, chatId, threadId, messageListType)!;\n const prevIndex = viewportIds.indexOf(messageIds[messageIds.length - 1]);\n const currentIndex = viewportIds.indexOf(messageId);\n const from = Math.min(prevIndex, currentIndex);\n const to = Math.max(prevIndex, currentIndex);\n const slice = viewportIds.slice(from, to + 1);\n newMessageIds = unique([...messageIds, ...slice]);\n } else {\n newMessageIds = [...messageIds, ...newSelectedMessageIds];\n }\n\n if (!newMessageIds.length) {\n return exitMessageSelectMode(global);\n }\n\n return {\n ...global,\n selectedMessages: {\n ...oldSelectedMessages,\n messageIds: newMessageIds,\n },\n };\n}\n\nexport function exitMessageSelectMode(global: GlobalState): GlobalState {\n return {\n ...global,\n selectedMessages: undefined,\n };\n}\n\nexport function updateThreadUnreadFromForwardedMessage(\n global: GlobalState,\n originMessage: ApiMessage,\n chatId: number,\n lastMessageId: number,\n isDeleting?: boolean,\n) {\n const { channelPostId, fromChatId } = originMessage.forwardInfo || {};\n if (channelPostId && fromChatId) {\n const threadInfoOld = selectThreadInfo(global, chatId, channelPostId);\n if (threadInfoOld) {\n global = replaceThreadParam(global, chatId, channelPostId, 'threadInfo', {\n ...threadInfoOld,\n lastMessageId,\n messagesCount: threadInfoOld.messagesCount + (isDeleting ? -1 : 1),\n });\n }\n }\n return global;\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiSticker, ApiStickerSet, ApiVideo } from '../../api/types';\nimport { buildCollectionByKey, unique } from '../../util/iteratees';\nimport { selectStickersForEmoji } from '../selectors';\n\nexport function updateStickerSets(\n global: GlobalState,\n category: 'added' | 'featured' | 'search',\n hash: number,\n sets: ApiStickerSet[],\n resultIds?: string[],\n): GlobalState {\n const updatedSets = sets.map((stickerSet) => {\n const existing = global.stickers.setsById[stickerSet.id];\n if (!existing) {\n return stickerSet;\n }\n\n return {\n ...existing,\n ...stickerSet,\n };\n });\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n setsById: {\n ...global.stickers.setsById,\n ...buildCollectionByKey(updatedSets, 'id'),\n },\n [category]: {\n ...global.stickers[category],\n hash,\n ...(\n category === 'search'\n ? { resultIds }\n : { setIds: sets.map(({ id }) => id) }\n ),\n },\n },\n };\n}\n\nexport function updateStickerSet(\n global: GlobalState, stickerSetId: string, update: Partial,\n): GlobalState {\n const currentStickerSet = global.stickers.setsById[stickerSetId] || {};\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n setsById: {\n ...global.stickers.setsById,\n [stickerSetId]: {\n ...currentStickerSet,\n ...update,\n },\n },\n },\n };\n}\n\nexport function updateGifSearch(\n global: GlobalState, isNew: boolean, results: ApiVideo[], nextOffset?: string,\n): GlobalState {\n const { results: currentResults } = global.gifs.search;\n\n let newResults!: ApiVideo[];\n if (isNew || !currentResults) {\n newResults = results;\n } else {\n const currentIds = new Set(currentResults.map((gif) => gif.id));\n newResults = [\n ...currentResults,\n ...results.filter((gif) => !currentIds.has(gif.id)),\n ];\n }\n\n return {\n ...global,\n gifs: {\n ...global.gifs,\n search: {\n ...global.gifs.search,\n offset: nextOffset,\n results: newResults,\n },\n },\n };\n}\n\nexport function replaceAnimatedEmojis(global: GlobalState, stickerSet: ApiStickerSet): GlobalState {\n return {\n ...global,\n animatedEmojis: stickerSet,\n };\n}\n\nexport function updateStickersForEmoji(\n global: GlobalState, emoji: string, remoteStickers?: ApiSticker[], hash?: number,\n): GlobalState {\n const localStickers = selectStickersForEmoji(global, emoji);\n const allStickers = [...localStickers, ...(remoteStickers || [])];\n const uniqueIds = unique(allStickers.map(({ id }) => id));\n const byId = buildCollectionByKey(allStickers, 'id');\n const stickers = uniqueIds.map((id) => byId[id]);\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n forEmoji: {\n emoji,\n stickers,\n hash,\n },\n },\n };\n}\n\nexport function rebuildStickersForEmoji(global: GlobalState): GlobalState {\n const { emoji, stickers, hash } = global.stickers.forEmoji || {};\n if (!emoji) {\n return global;\n }\n\n return updateStickersForEmoji(global, emoji, stickers, hash);\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiUser } from '../../api/types';\n\nimport { omit } from '../../util/iteratees';\nimport { MEMO_EMPTY_ARRAY } from '../../util/memo';\n\nexport function replaceUsers(global: GlobalState, newById: Record): GlobalState {\n return {\n ...global,\n users: {\n ...global.users,\n byId: newById,\n },\n };\n}\n\n// @optimization Don't spread/unspread global for each element, do it in a batch\nfunction getUpdatedUser(global: GlobalState, userId: number, userUpdate: Partial): ApiUser {\n const { byId } = global.users;\n const user = byId[userId];\n const shouldOmitMinInfo = userUpdate.isMin && user && !user.isMin;\n\n const updatedUser = {\n ...user,\n ...(shouldOmitMinInfo ? omit(userUpdate, ['isMin', 'accessHash']) : userUpdate),\n };\n\n if (!updatedUser.id || !updatedUser.type) {\n return user;\n }\n\n return updatedUser;\n}\n\nfunction updateContactList(global: GlobalState, updatedUsers: ApiUser[]): GlobalState {\n const { hash, userIds: contactUserIds } = global.contactList || {};\n\n if (!contactUserIds) return global;\n\n const newContactUserIds = updatedUsers\n .filter((user) => user?.isContact && !contactUserIds.includes(user.id))\n .map((user) => user.id);\n\n if (newContactUserIds.length === 0) return global;\n\n return {\n ...global,\n contactList: {\n hash: hash || 0,\n userIds: [\n ...newContactUserIds,\n ...contactUserIds,\n ],\n },\n };\n}\n\nexport function updateUser(global: GlobalState, userId: number, userUpdate: Partial): GlobalState {\n const { byId } = global.users;\n\n const updatedUser = getUpdatedUser(global, userId, userUpdate);\n\n global = updateContactList(global, [updatedUser]);\n\n return replaceUsers(global, {\n ...byId,\n [userId]: updatedUser,\n });\n}\n\nexport function updateUsers(global: GlobalState, updatedById: Record): GlobalState {\n const updatedUsers = Object.keys(updatedById).map(Number).reduce>((acc, id) => {\n const updatedUser = getUpdatedUser(global, id, updatedById[id]);\n if (updatedUser) {\n acc[id] = updatedUser;\n }\n return acc;\n }, {});\n\n global = updateContactList(global, Object.values(updatedUsers));\n\n global = replaceUsers(global, {\n ...global.users.byId,\n ...updatedUsers,\n });\n\n return global;\n}\n\n// @optimization Allows to avoid redundant updates which cause a lot of renders\nexport function addUsers(global: GlobalState, addedById: Record): GlobalState {\n const { byId } = global.users;\n let isAdded = false;\n\n const addedUsers = Object.keys(addedById).map(Number).reduce>((acc, id) => {\n if (!byId[id] || (byId[id].isMin && !addedById[id].isMin)) {\n const updatedUser = getUpdatedUser(global, id, addedById[id]);\n if (updatedUser) {\n acc[id] = updatedUser;\n\n if (!isAdded) {\n isAdded = true;\n }\n }\n }\n return acc;\n }, {});\n\n if (isAdded) {\n global = replaceUsers(global, {\n ...global.users.byId,\n ...addedUsers,\n });\n\n global = updateContactList(global, Object.values(addedUsers));\n }\n\n return global;\n}\n\nexport function updateSelectedUserId(global: GlobalState, selectedId?: number): GlobalState {\n if (global.users.selectedId === selectedId) {\n return global;\n }\n\n return {\n ...global,\n users: {\n ...global.users,\n selectedId,\n },\n };\n}\n\nexport function deleteUser(global: GlobalState, userId: number): GlobalState {\n const { byId } = global.users;\n const { hash, userIds } = global.contactList || {};\n delete byId[userId];\n\n global = {\n ...global,\n contactList: {\n hash: hash || 0,\n userIds: userIds ? userIds.filter((id) => id !== userId) : MEMO_EMPTY_ARRAY,\n },\n };\n\n return replaceUsers(global, byId);\n}\n\nexport function updateUserSearch(\n global: GlobalState,\n searchStatePartial: Partial,\n) {\n return {\n ...global,\n userSearch: {\n ...global.userSearch,\n ...searchStatePartial,\n },\n };\n}\n\nexport function updateUserSearchFetchingStatus(\n global: GlobalState, newState: boolean,\n) {\n return updateUserSearch(global, {\n fetchingStatus: newState,\n });\n}\n\nexport function updateUserBlockedState(global: GlobalState, userId: number, isBlocked: boolean) {\n const { byId } = global.users;\n const user = byId[userId];\n if (!user || !user.fullInfo) {\n return global;\n }\n\n return updateUser(global, userId, {\n ...user,\n fullInfo: {\n ...user.fullInfo,\n isBlocked,\n },\n });\n}\n","import { GlobalState } from '../../global/types';\nimport { GlobalSearchContent } from '../../types';\nimport { ApiGlobalMessageSearchType, ApiMessage } from '../../api/types';\nimport { areSortedArraysEqual } from '../../util/iteratees';\n\nconst getComplexKey = (message: ApiMessage) => `${message.chatId}_${message.id}`;\n\nexport function updateGlobalSearch(\n global: GlobalState,\n searchStatePartial: Partial,\n) {\n return {\n ...global,\n globalSearch: {\n ...global.globalSearch,\n ...searchStatePartial,\n },\n };\n}\n\nexport function updateGlobalSearchContent(\n global: GlobalState,\n currentContent: GlobalSearchContent | undefined,\n): GlobalState {\n return updateGlobalSearch(global, { currentContent });\n}\n\nexport function updateGlobalSearchResults(\n global: GlobalState,\n newFoundMessages: ApiMessage[],\n totalCount: number,\n type: ApiGlobalMessageSearchType,\n nextRate?: number,\n): GlobalState {\n const { resultsByType } = global.globalSearch || {};\n const newFoundMessagesById = newFoundMessages.reduce((result, message) => {\n result[getComplexKey(message)] = message;\n\n return result;\n }, {} as Record);\n const foundIdsForType = resultsByType?.[type]?.foundIds;\n\n if (foundIdsForType !== undefined\n && Object.keys(newFoundMessagesById).every(\n (newId) => foundIdsForType.includes(getComplexKey(newFoundMessagesById[newId])),\n )\n ) {\n return updateGlobalSearchFetchingStatus(global, { messages: false });\n }\n\n const prevFoundIds = foundIdsForType || [];\n const newFoundIds = newFoundMessages.map((message) => getComplexKey(message));\n const foundIds = Array.prototype.concat(prevFoundIds, newFoundIds);\n const foundOrPrevFoundIds = areSortedArraysEqual(prevFoundIds, foundIds) ? prevFoundIds : foundIds;\n\n global = updateGlobalSearchFetchingStatus(global, { messages: false });\n\n return updateGlobalSearch(global, {\n resultsByType: {\n ...(global.globalSearch || {}).resultsByType,\n [type]: {\n totalCount,\n nextOffsetId: nextRate,\n foundIds: foundOrPrevFoundIds,\n },\n },\n });\n}\n\nexport function updateGlobalSearchFetchingStatus(\n global: GlobalState, newState: { chats?: boolean; messages?: boolean },\n) {\n return updateGlobalSearch(global, {\n fetchingStatus: {\n ...global.globalSearch.fetchingStatus,\n ...newState,\n },\n });\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiMessageSearchType } from '../../api/types';\n\nimport { areSortedArraysEqual, unique } from '../../util/iteratees';\nimport { SharedMediaType } from '../../types';\nimport { buildChatThreadKey } from '../helpers';\n\ninterface TextSearchParams {\n isActive: boolean;\n query?: string;\n results?: {\n totalCount?: number;\n nextOffsetId?: number;\n foundIds?: number[];\n };\n}\n\ninterface MediaSearchParams {\n currentType?: SharedMediaType;\n resultsByType?: Partial>;\n}\n\nfunction replaceLocalTextSearch(\n global: GlobalState,\n chatThreadKey: string,\n searchParams: TextSearchParams,\n): GlobalState {\n return {\n ...global,\n localTextSearch: {\n byChatThreadKey: {\n ...global.localTextSearch.byChatThreadKey,\n [chatThreadKey]: searchParams,\n },\n },\n };\n}\n\nexport function updateLocalTextSearch(\n global: GlobalState,\n chatId: number,\n threadId: number,\n isActive: boolean,\n query?: string,\n): GlobalState {\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n\n return replaceLocalTextSearch(global, chatThreadKey, {\n ...global.localTextSearch.byChatThreadKey[chatThreadKey],\n isActive,\n query,\n });\n}\n\nexport function replaceLocalTextSearchResults(\n global: GlobalState,\n chatId: number,\n threadId: number,\n foundIds?: number[],\n totalCount?: number,\n nextOffsetId?: number,\n): GlobalState {\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n\n return replaceLocalTextSearch(global, chatThreadKey, {\n ...global.localTextSearch.byChatThreadKey[chatThreadKey],\n results: {\n foundIds,\n totalCount,\n nextOffsetId,\n },\n });\n}\n\nexport function updateLocalTextSearchResults(\n global: GlobalState,\n chatId: number,\n threadId: number,\n newFoundIds: number[],\n totalCount?: number,\n nextOffsetId?: number,\n): GlobalState {\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n const { results } = global.localTextSearch.byChatThreadKey[chatThreadKey] || {};\n const prevFoundIds = (results?.foundIds) || [];\n const foundIds = orderFoundIds(unique(Array.prototype.concat(prevFoundIds, newFoundIds)));\n const foundOrPrevFoundIds = areSortedArraysEqual(prevFoundIds, foundIds) ? prevFoundIds : foundIds;\n\n return replaceLocalTextSearchResults(global, chatId, threadId, foundOrPrevFoundIds, totalCount, nextOffsetId);\n}\n\nfunction replaceLocalMediaSearch(\n global: GlobalState,\n chatId: number,\n searchParams: MediaSearchParams,\n): GlobalState {\n return {\n ...global,\n localMediaSearch: {\n byChatId: {\n ...global.localMediaSearch.byChatId,\n [chatId]: searchParams,\n },\n },\n };\n}\n\nexport function updateLocalMediaSearchType(\n global: GlobalState,\n chatId: number,\n currentType: SharedMediaType | undefined,\n): GlobalState {\n return replaceLocalMediaSearch(global, chatId, {\n ...global.localMediaSearch.byChatId[chatId],\n currentType,\n });\n}\n\nexport function replaceLocalMediaSearchResults(\n global: GlobalState,\n chatId: number,\n type: ApiMessageSearchType,\n foundIds?: number[],\n totalCount?: number,\n nextOffsetId?: number,\n): GlobalState {\n return replaceLocalMediaSearch(global, chatId, {\n ...global.localMediaSearch.byChatId[chatId],\n resultsByType: {\n ...(global.localMediaSearch.byChatId[chatId] || {}).resultsByType,\n [type]: {\n foundIds,\n totalCount,\n nextOffsetId,\n },\n },\n });\n}\n\nexport function updateLocalMediaSearchResults(\n global: GlobalState,\n chatId: number,\n type: SharedMediaType,\n newFoundIds: number[],\n totalCount?: number,\n nextOffsetId?: number,\n): GlobalState {\n const { resultsByType } = global.localMediaSearch.byChatId[chatId] || {};\n const prevFoundIds = resultsByType?.[type] ? resultsByType[type]!.foundIds : [];\n const foundIds = orderFoundIds(unique(Array.prototype.concat(prevFoundIds, newFoundIds)));\n const foundOrPrevFoundIds = areSortedArraysEqual(prevFoundIds, foundIds) ? prevFoundIds : foundIds;\n\n return replaceLocalMediaSearchResults(global, chatId, type, foundOrPrevFoundIds, totalCount, nextOffsetId);\n}\n\nfunction orderFoundIds(listedIds: number[]) {\n return listedIds.sort((a, b) => a - b);\n}\n","import { GlobalState } from '../../global/types';\nimport { ManagementProgress } from '../../types';\n\ninterface ManagementState {\n isActive: boolean;\n isUsernameAvailable?: boolean;\n error?: string;\n}\n\nexport function updateManagementProgress(global: GlobalState, progress: ManagementProgress): GlobalState {\n return {\n ...global,\n management: {\n ...global.management,\n progress,\n },\n };\n}\n\nexport function updateManagement(global: GlobalState, chatId: number, update: Partial): GlobalState {\n return {\n ...global,\n management: {\n ...global.management,\n byChatId: {\n ...global.management.byChatId,\n [chatId]: {\n ...(global.management.byChatId[chatId] || {}),\n ...update,\n },\n },\n },\n };\n}\n","import { GlobalState } from '../../global/types';\nimport {\n ISettings, IThemeSettings, ThemeKey, NotifyException,\n} from '../../types';\nimport { ApiNotifyException } from '../../api/types';\nimport { updateUserBlockedState } from './users';\n\nexport function replaceSettings(global: GlobalState, newSettings?: Partial): GlobalState {\n return {\n ...global,\n settings: {\n ...global.settings,\n byKey: {\n ...global.settings.byKey,\n ...newSettings,\n },\n },\n };\n}\n\nexport function replaceThemeSettings(\n global: GlobalState, theme: ThemeKey, newSettings?: Partial,\n): GlobalState {\n return {\n ...global,\n settings: {\n ...global.settings,\n themes: {\n ...global.settings.themes,\n [theme]: {\n ...(global.settings.themes[theme] || {}),\n ...newSettings,\n },\n },\n },\n };\n}\n\nexport function addNotifyExceptions(\n global: GlobalState, notifyExceptions: ApiNotifyException[],\n): GlobalState {\n notifyExceptions.forEach((notifyException) => {\n const { chatId, ...exceptionData } = notifyException;\n global = addNotifyException(global, chatId, exceptionData);\n });\n\n return global;\n}\n\nexport function addNotifyException(\n global: GlobalState, id: number, notifyException: NotifyException,\n): GlobalState {\n return {\n ...global,\n settings: {\n ...global.settings,\n notifyExceptions: {\n ...global.settings.notifyExceptions,\n [id]: notifyException,\n },\n },\n };\n}\n\nexport function updateNotifySettings(\n global: GlobalState, peerType: 'contact' | 'group' | 'broadcast', isSilent?: boolean, shouldShowPreviews?: boolean,\n) {\n switch (peerType) {\n case 'contact':\n return replaceSettings(global, {\n ...(typeof isSilent !== 'undefined' && { hasPrivateChatsNotifications: !isSilent }),\n ...(typeof shouldShowPreviews !== 'undefined' && { hasPrivateChatsMessagePreview: shouldShowPreviews }),\n });\n case 'group':\n return replaceSettings(global, {\n ...(typeof isSilent !== 'undefined' && { hasGroupNotifications: !isSilent }),\n ...(typeof shouldShowPreviews !== 'undefined' && { hasGroupMessagePreview: shouldShowPreviews }),\n });\n case 'broadcast':\n return replaceSettings(global, {\n ...(typeof isSilent !== 'undefined' && { hasBroadcastNotifications: !isSilent }),\n ...(typeof shouldShowPreviews !== 'undefined' && { hasBroadcastMessagePreview: shouldShowPreviews }),\n });\n\n default:\n return undefined;\n }\n}\n\nexport function addBlockedContact(global: GlobalState, contactId: number): GlobalState {\n global = updateUserBlockedState(global, contactId, true);\n\n return {\n ...global,\n blocked: {\n ...global.blocked,\n ids: [contactId, ...global.blocked.ids],\n totalCount: global.blocked.totalCount + 1,\n },\n };\n}\n\nexport function removeBlockedContact(global: GlobalState, contactId: number): GlobalState {\n global = updateUserBlockedState(global, contactId, false);\n\n return {\n ...global,\n blocked: {\n ...global.blocked,\n ids: global.blocked.ids.filter((id) => id !== contactId),\n totalCount: global.blocked.totalCount - 1,\n },\n };\n}\n","import { GlobalState } from '../../global/types';\n\nexport function updateTwoFaSettings(\n global: GlobalState,\n update: GlobalState['twoFaSettings'],\n): GlobalState {\n return {\n ...global,\n twoFaSettings: {\n ...global.twoFaSettings,\n ...update,\n },\n };\n}\n","import { GlobalState } from '../../global/types';\nimport { ShippingOption, PaymentStep } from '../../types';\nimport { ApiMessage, ApiPaymentForm, ApiReceipt } from '../../api/types';\n\nexport function updateShippingOptions(\n global: GlobalState,\n shippingOptions: ShippingOption[],\n): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n shippingOptions,\n },\n };\n}\n\nexport function setRequestInfoId(global: GlobalState, id: string): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n requestId: id,\n },\n };\n}\n\nexport function setPaymentStep(global: GlobalState, step: PaymentStep): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n step,\n },\n };\n}\n\nexport function setInvoiceMessageInfo(global: GlobalState, message: ApiMessage): GlobalState {\n if (!message.content || !message.content.invoice) {\n return global;\n }\n const {\n title,\n text,\n amount,\n currency,\n isTest,\n photoUrl,\n } = message.content.invoice;\n return {\n ...global,\n payment: {\n ...global.payment,\n invoiceContent: {\n title,\n text,\n photoUrl,\n amount,\n currency,\n isTest,\n },\n },\n };\n}\n\nexport function setStripeCardInfo(global: GlobalState, cardInfo: { type: string; id: string }): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n stripeCredentials: {\n ...cardInfo,\n },\n },\n };\n}\n\nexport function setPaymentForm(global: GlobalState, form: ApiPaymentForm): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n ...form,\n },\n };\n}\n\nexport function setReceipt(\n global: GlobalState,\n receipt?: ApiReceipt,\n message?: ApiMessage,\n): GlobalState {\n if (!receipt || !message) {\n return {\n ...global,\n payment: {\n ...global.payment,\n receipt: undefined,\n },\n };\n }\n\n const { invoice: messageInvoice } = message.content;\n const { photoUrl, text, title } = (messageInvoice || {});\n\n return {\n ...global,\n payment: {\n ...global.payment,\n receipt: {\n ...receipt,\n photoUrl,\n text,\n title,\n },\n },\n };\n}\n\nexport function clearPayment(global: GlobalState): GlobalState {\n return {\n ...global,\n payment: {},\n };\n}\n\nexport function closeInvoice(global: GlobalState): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n isPaymentModalOpen: false,\n },\n };\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiChat, ApiUser } from '../../api/types';\n\nexport function selectUser(global: GlobalState, userId: number): ApiUser | undefined {\n return global.users.byId[userId];\n}\n\nexport function selectIsUserBlocked(global: GlobalState, userId: number) {\n const user = selectUser(global, userId);\n\n return user?.fullInfo?.isBlocked;\n}\n\n// Slow, not to be used in `withGlobal`\nexport function selectUserByUsername(global: GlobalState, username: string) {\n const usernameLowered = username.toLowerCase();\n return Object.values(global.users.byId).find(\n (user) => user.username.toLowerCase() === usernameLowered,\n );\n}\n\nexport function selectIsUserOrChatContact(global: GlobalState, userOrChat: ApiUser | ApiChat) {\n return global.contactList && global.contactList.userIds.includes(userOrChat.id);\n}\n","import { GlobalState } from '../../global/types';\n\nexport function selectNotifySettings(global: GlobalState) {\n return global.settings.byKey;\n}\n\nexport function selectNotifyExceptions(global: GlobalState) {\n return global.settings.notifyExceptions;\n}\n","import { ApiChat, MAIN_THREAD_ID } from '../../api/types';\nimport { GlobalState } from '../../global/types';\n\nimport {\n getPrivateChatUserId, isChatChannel, isChatPrivate, isHistoryClearMessage, isUserBot, isUserOnline, selectIsChatMuted,\n} from '../helpers';\nimport { selectUser } from './users';\nimport { ALL_FOLDER_ID, ARCHIVED_FOLDER_ID, MEMBERS_LOAD_SLICE } from '../../config';\nimport { selectNotifyExceptions, selectNotifySettings } from './settings';\n\nexport function selectChat(global: GlobalState, chatId: number): ApiChat | undefined {\n return global.chats.byId[chatId];\n}\n\nexport function selectChatUser(global: GlobalState, chat: ApiChat) {\n const userId = getPrivateChatUserId(chat);\n if (!userId) {\n return false;\n }\n\n return selectUser(global, userId);\n}\n\nexport function selectIsChatWithSelf(global: GlobalState, chatId: number) {\n return chatId === global.currentUserId;\n}\n\nexport function selectIsChatWithBot(global: GlobalState, chat: ApiChat) {\n const user = selectChatUser(global, chat);\n return user && isUserBot(user);\n}\n\nexport function selectSupportChat(global: GlobalState) {\n return Object.values(global.chats.byId).find(({ isSupport }: ApiChat) => isSupport);\n}\n\nexport function selectChatOnlineCount(global: GlobalState, chat: ApiChat) {\n if (isChatPrivate(chat.id) || isChatChannel(chat) || !chat.fullInfo) {\n return undefined;\n }\n\n if (!chat.fullInfo.members || chat.fullInfo.members.length === MEMBERS_LOAD_SLICE) {\n return chat.fullInfo.onlineCount;\n }\n\n return chat.fullInfo.members.reduce((onlineCount, { userId }) => {\n if (global.users.byId[userId] && isUserOnline(global.users.byId[userId]) && userId !== global.currentUserId) {\n return onlineCount + 1;\n }\n\n return onlineCount;\n }, 0);\n}\n\nexport function selectChatBot(global: GlobalState, chatId: number) {\n const chat = selectChat(global, chatId);\n const userId = chat && getPrivateChatUserId(chat);\n const user = userId && selectUser(global, userId);\n if (!user || !isUserBot(user)) {\n return undefined;\n }\n\n return user;\n}\n\nexport function selectIsChatBotNotStarted(global: GlobalState, chatId: number) {\n const chat = selectChat(global, chatId);\n const bot = selectChatBot(global, chatId);\n if (!chat || !bot) {\n return false;\n }\n\n if (chat.lastMessage && isHistoryClearMessage(chat.lastMessage)) {\n return true;\n }\n\n const messageInfo = global.messages.byChatId[chatId];\n if (!messageInfo) {\n return false;\n }\n\n const { listedIds } = messageInfo.threadsById[MAIN_THREAD_ID] || {};\n return listedIds && !listedIds.length;\n}\n\nexport function selectAreActiveChatsLoaded(global: GlobalState): boolean {\n return Boolean(global.chats.listIds.active);\n}\n\nexport function selectIsChatListed(global: GlobalState, chatId: number, type?: 'active' | 'archived'): boolean {\n const { listIds } = global.chats;\n if (type) {\n const targetList = listIds[type];\n return Boolean(targetList && targetList.includes(chatId));\n }\n\n return Object.values(listIds).some((list) => list && list.includes(chatId));\n}\n\nexport function selectChatListType(global: GlobalState, chatId: number): 'active' | 'archived' | undefined {\n const chat = selectChat(global, chatId);\n if (!chat || !selectIsChatListed(global, chatId)) {\n return undefined;\n }\n\n return chat.folderId === ARCHIVED_FOLDER_ID ? 'archived' : 'active';\n}\n\nexport function selectChatFolder(global: GlobalState, folderId: number) {\n return global.chatFolders.byId[folderId];\n}\n\nexport function selectTotalChatCount(global: GlobalState, listType: 'active' | 'archived'): number {\n const { totalCount } = global.chats;\n const allChatsCount = totalCount.all;\n const archivedChatsCount = totalCount.archived || 0;\n\n if (listType === 'archived') {\n return archivedChatsCount;\n }\n\n return allChatsCount ? allChatsCount - archivedChatsCount : 0;\n}\n\nexport function selectIsChatPinned(global: GlobalState, chatId: number, folderId = ALL_FOLDER_ID): boolean {\n const { active, archived } = global.chats.orderedPinnedIds;\n\n if (folderId === ALL_FOLDER_ID) {\n return !!active && active.includes(chatId);\n }\n\n if (folderId === ARCHIVED_FOLDER_ID) {\n return !!archived && archived.includes(chatId);\n }\n\n const { byId: chatFoldersById } = global.chatFolders;\n\n const { pinnedChatIds } = chatFoldersById[folderId] || {};\n return !!pinnedChatIds && pinnedChatIds.includes(chatId);\n}\n\n// Slow, not to be used in `withGlobal`\nexport function selectChatByUsername(global: GlobalState, username: string) {\n const usernameLowered = username.toLowerCase();\n return Object.values(global.chats.byId).find(\n (chat) => chat.username && chat.username.toLowerCase() === usernameLowered,\n );\n}\n\n// Slow, not to be used in `withGlobal`\nexport function selectCountNotMutedUnread(global: GlobalState) {\n const activeChatIds = global.chats.listIds.active;\n if (!activeChatIds) {\n return 0;\n }\n\n const chats = global.chats.byId;\n const notifySettings = selectNotifySettings(global);\n const notifyExceptions = selectNotifyExceptions(global);\n\n return activeChatIds.reduce((acc, chatId) => {\n const chat = chats[chatId];\n\n if (\n chat\n && chat.unreadCount\n && chat.isListed\n && !chat.isNotJoined\n && !chat.isRestricted\n && (chat.unreadMentionsCount || !selectIsChatMuted(chat, notifySettings, notifyExceptions))\n ) {\n return acc + chat.unreadCount;\n }\n\n return acc;\n }, 0);\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiSticker } from '../../api/types';\n\nexport function selectIsStickerFavorite(global: GlobalState, sticker: ApiSticker) {\n const { stickers } = global.stickers.favorite;\n return stickers && stickers.some(({ id }) => id === sticker.id);\n}\n\nexport function selectCurrentStickerSearch(global: GlobalState) {\n return global.stickers.search;\n}\n\nexport function selectCurrentGifSearch(global: GlobalState) {\n return global.gifs.search;\n}\n\nexport function selectStickerSet(global: GlobalState, id: string) {\n return global.stickers.setsById[id];\n}\n\nexport function selectStickerSetByShortName(global: GlobalState, shortName: string) {\n return Object.values(global.stickers.setsById).find((l) => l.shortName.toLowerCase() === shortName.toLowerCase());\n}\n\nexport function selectStickersForEmoji(global: GlobalState, emoji: string) {\n const stickerSets = Object.values(global.stickers.setsById);\n let stickersForEmoji: ApiSticker[] = [];\n stickerSets.forEach(({ packs }) => {\n if (!packs) {\n return;\n }\n const stickers = packs[emoji];\n if (stickers) {\n stickersForEmoji = stickersForEmoji.concat(stickers);\n }\n });\n return stickersForEmoji;\n}\n\nexport function selectAnimatedEmoji(global: GlobalState, emoji: string) {\n const { animatedEmojis } = global;\n if (!animatedEmojis || !animatedEmojis.stickers) {\n return undefined;\n }\n\n // Some emojis (❤️ for example) with a service symbol 'VARIATION SELECTOR-16' are not recognized as animated\n const cleanedEmoji = emoji.replace('\\ufe0f', '');\n\n return animatedEmojis.stickers.find((sticker) => sticker.emoji === emoji || sticker.emoji === cleanedEmoji);\n}\n","import { GlobalState, MessageListType, Thread } from '../../global/types';\nimport {\n ApiChat,\n ApiMessage,\n ApiMessageOutgoingStatus,\n ApiUser,\n MAIN_THREAD_ID,\n} from '../../api/types';\n\nimport { LOCAL_MESSAGE_ID_BASE } from '../../config';\nimport {\n selectChat, selectIsChatWithBot, selectIsChatWithSelf,\n} from './chats';\nimport { selectIsUserOrChatContact, selectUser } from './users';\nimport {\n getSendingState,\n isChatChannel,\n isMessageLocal,\n isChatPrivate,\n isForwardedMessage,\n getCanPostInChat,\n isUserRightBanned,\n getHasAdminRight,\n isChatBasicGroup,\n isCommonBoxChat,\n isServiceNotificationMessage,\n isOwnMessage,\n isActionMessage,\n isChatGroup,\n isChatSuperGroup,\n getMessageVideo,\n getMessageWebPageVideo,\n} from '../helpers';\nimport { findLast } from '../../util/iteratees';\nimport { selectIsStickerFavorite } from './symbols';\nimport { getServerTime } from '../../util/serverTime';\n\nconst MESSAGE_EDIT_ALLOWED_TIME = 172800; // 48 hours\n\nexport function selectCurrentMessageList(global: GlobalState) {\n const { messageLists } = global.messages;\n\n if (messageLists.length) {\n return messageLists[messageLists.length - 1];\n }\n\n return undefined;\n}\n\nexport function selectCurrentChat(global: GlobalState) {\n const { chatId } = selectCurrentMessageList(global) || {};\n\n return chatId ? selectChat(global, chatId) : undefined;\n}\n\nexport function selectChatMessages(global: GlobalState, chatId: number) {\n return global.messages.byChatId[chatId]?.byId;\n}\n\nexport function selectScheduledMessages(global: GlobalState, chatId: number) {\n return global.scheduledMessages.byChatId[chatId]?.byId;\n}\n\nexport function selectThreadParam(\n global: GlobalState,\n chatId: number,\n threadId: number,\n key: K,\n) {\n const messageInfo = global.messages.byChatId[chatId];\n if (!messageInfo) {\n return undefined;\n }\n\n const thread = messageInfo.threadsById[threadId];\n if (!thread) {\n return undefined;\n }\n\n return thread[key];\n}\n\nexport function selectListedIds(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'listedIds');\n}\n\nexport function selectOutlyingIds(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'outlyingIds');\n}\n\nexport function selectCurrentMessageIds(\n global: GlobalState, chatId: number, threadId: number, messageListType: MessageListType,\n) {\n switch (messageListType) {\n case 'thread':\n return selectViewportIds(global, chatId, threadId);\n case 'pinned':\n return selectPinnedIds(global, chatId);\n case 'scheduled':\n return selectScheduledIds(global, chatId);\n }\n\n return undefined;\n}\n\nexport function selectViewportIds(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'viewportIds');\n}\n\nexport function selectPinnedIds(global: GlobalState, chatId: number) {\n return selectThreadParam(global, chatId, MAIN_THREAD_ID, 'pinnedIds');\n}\n\nexport function selectScheduledIds(global: GlobalState, chatId: number) {\n return selectThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds');\n}\n\nexport function selectScrollOffset(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'scrollOffset');\n}\n\nexport function selectReplyingToId(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'replyingToId');\n}\n\nexport function selectEditingId(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'editingId');\n}\n\nexport function selectEditingScheduledId(global: GlobalState, chatId: number) {\n return selectThreadParam(global, chatId, MAIN_THREAD_ID, 'editingScheduledId');\n}\n\nexport function selectDraft(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'draft');\n}\n\nexport function selectNoWebPage(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'noWebPage');\n}\n\nexport function selectThreadInfo(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'threadInfo');\n}\n\nexport function selectFirstMessageId(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'firstMessageId');\n}\n\nexport function selectReplyStack(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'replyStack');\n}\n\nexport function selectThreadOriginChat(global: GlobalState, chatId: number, threadId: number) {\n if (threadId === MAIN_THREAD_ID) {\n return selectChat(global, chatId);\n }\n\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo) {\n return undefined;\n }\n\n return selectChat(global, threadInfo.originChannelId || chatId);\n}\n\nexport function selectThreadTopMessageId(global: GlobalState, chatId: number, threadId: number) {\n if (threadId === MAIN_THREAD_ID) {\n return undefined;\n }\n\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo) {\n return undefined;\n }\n\n return threadInfo.topMessageId;\n}\n\nexport function selectThreadByMessage(global: GlobalState, chatId: number, message: ApiMessage) {\n const messageInfo = global.messages.byChatId[chatId];\n if (!messageInfo) {\n return undefined;\n }\n\n const { replyToMessageId, replyToTopMessageId } = message;\n if (!replyToMessageId && !replyToTopMessageId) {\n return undefined;\n }\n\n return Object.values(messageInfo.threadsById).find((thread) => {\n return thread.threadInfo && (\n (replyToMessageId && replyToMessageId === thread.threadInfo.topMessageId)\n || (replyToTopMessageId && replyToTopMessageId === thread.threadInfo.topMessageId)\n );\n });\n}\n\nexport function isMessageInCurrentMessageList(global: GlobalState, chatId: number, message: ApiMessage) {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return false;\n }\n\n const { threadInfo } = selectThreadByMessage(global, chatId, message) || {};\n return (\n chatId === currentMessageList.chatId\n && (\n (currentMessageList.threadId === MAIN_THREAD_ID)\n || (threadInfo && currentMessageList.threadId === threadInfo.threadId)\n )\n );\n}\n\nexport function selectIsViewportNewest(global: GlobalState, chatId: number, threadId: number) {\n const viewportIds = selectViewportIds(global, chatId, threadId);\n if (!viewportIds || !viewportIds.length) {\n return true;\n }\n\n let lastMessageId: number;\n\n if (threadId === MAIN_THREAD_ID) {\n const chat = selectChat(global, chatId);\n if (!chat || !chat.lastMessage) {\n return true;\n }\n\n lastMessageId = chat.lastMessage.id;\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo || !threadInfo.lastMessageId) {\n return undefined;\n }\n\n lastMessageId = threadInfo.lastMessageId;\n }\n\n // Edge case: outgoing `lastMessage` is updated with a delay to optimize animation\n if (lastMessageId >= LOCAL_MESSAGE_ID_BASE && !selectChatMessage(global, chatId, lastMessageId)) {\n return true;\n }\n\n return viewportIds[viewportIds.length - 1] >= lastMessageId;\n}\n\nexport function selectChatMessage(global: GlobalState, chatId: number, messageId: number) {\n const chatMessages = selectChatMessages(global, chatId);\n\n return chatMessages ? chatMessages[messageId] : undefined;\n}\n\nexport function selectScheduledMessage(global: GlobalState, chatId: number, messageId: number) {\n const chatMessages = selectScheduledMessages(global, chatId);\n\n return chatMessages ? chatMessages[messageId] : undefined;\n}\n\nexport function selectEditingMessage(\n global: GlobalState, chatId: number, threadId: number, messageListType: MessageListType,\n) {\n if (messageListType === 'scheduled') {\n const messageId = selectEditingScheduledId(global, chatId);\n return messageId ? selectScheduledMessage(global, chatId, messageId) : undefined;\n } else {\n const messageId = selectEditingId(global, chatId, threadId);\n return messageId ? selectChatMessage(global, chatId, messageId) : undefined;\n }\n}\n\nexport function selectChatMessageByPollId(global: GlobalState, pollId: string) {\n let messageWithPoll: ApiMessage | undefined;\n\n // eslint-disable-next-line no-restricted-syntax\n for (const chatMessages of Object.values(global.messages.byChatId)) {\n const { byId } = chatMessages;\n messageWithPoll = Object.values(byId).find((message) => {\n return message.content.poll && message.content.poll.id === pollId;\n });\n if (messageWithPoll) {\n break;\n }\n }\n\n return messageWithPoll;\n}\n\nexport function selectFocusedMessageId(global: GlobalState, chatId: number) {\n const { chatId: focusedChatId, messageId } = global.focusedMessage || {};\n\n return focusedChatId === chatId ? messageId : undefined;\n}\n\nexport function selectIsMessageFocused(global: GlobalState, message: ApiMessage) {\n const focusedId = selectFocusedMessageId(global, message.chatId);\n\n return focusedId ? focusedId === message.id || focusedId === message.previousLocalId : false;\n}\n\nexport function selectIsMessageUnread(global: GlobalState, message: ApiMessage) {\n const { lastReadOutboxMessageId } = selectChat(global, message.chatId) || {};\n return isMessageLocal(message) || !lastReadOutboxMessageId || lastReadOutboxMessageId < message.id;\n}\n\nexport function selectOutgoingStatus(\n global: GlobalState, message: ApiMessage, isScheduledList = false,\n): ApiMessageOutgoingStatus {\n if (!selectIsMessageUnread(global, message) && !isScheduledList) {\n return 'read';\n }\n\n return getSendingState(message);\n}\n\nexport function selectSender(global: GlobalState, message: ApiMessage): ApiUser | ApiChat | undefined {\n const { senderId } = message;\n if (!senderId) {\n return undefined;\n }\n\n return senderId > 0 ? selectUser(global, senderId) : selectChat(global, senderId);\n}\n\nexport function selectForwardedSender(global: GlobalState, message: ApiMessage): ApiUser | ApiChat | undefined {\n const { forwardInfo } = message;\n if (!forwardInfo) {\n return undefined;\n }\n\n if (forwardInfo.isChannelPost && forwardInfo.fromChatId) {\n return selectChat(global, forwardInfo.fromChatId);\n } else if (forwardInfo.senderUserId) {\n return selectUser(global, forwardInfo.senderUserId) || selectChat(global, forwardInfo.senderUserId);\n }\n\n return undefined;\n}\n\nexport function selectAllowedMessageActions(global: GlobalState, message: ApiMessage, threadId: number) {\n const chat = selectChat(global, message.chatId);\n if (!chat || chat.isRestricted) {\n return {};\n }\n\n const isPrivate = isChatPrivate(chat.id);\n const isChatWithSelf = selectIsChatWithSelf(global, message.chatId);\n const isBasicGroup = isChatBasicGroup(chat);\n const isSuperGroup = isChatSuperGroup(chat);\n const isChannel = isChatChannel(chat);\n const isServiceNotification = isServiceNotificationMessage(message);\n\n const isOwn = isOwnMessage(message);\n const isAction = isActionMessage(message);\n const { content } = message;\n const canEditMessagesIndefinitely = isChatWithSelf\n || (isSuperGroup && getHasAdminRight(chat, 'pinMessages'))\n || (isChannel && getHasAdminRight(chat, 'editMessages'));\n const isMessageEditable = (\n (canEditMessagesIndefinitely\n || getServerTime(global.serverTimeOffset) - message.date < MESSAGE_EDIT_ALLOWED_TIME)\n && !(\n content.sticker || content.contact || content.poll || content.action || content.audio\n || (content.video?.isRound)\n )\n && !isForwardedMessage(message)\n && !message.viaBotId\n );\n\n const canReply = getCanPostInChat(chat, threadId) && !isServiceNotification;\n\n const hasPinPermission = isPrivate || (\n chat.isCreator\n || (!isChannel && !isUserRightBanned(chat, 'pinMessages'))\n || getHasAdminRight(chat, 'pinMessages')\n );\n\n let canPin = !isAction && hasPinPermission;\n let canUnpin = false;\n\n const pinnedMessageIds = selectPinnedIds(global, chat.id);\n\n if (canPin) {\n canUnpin = Boolean(pinnedMessageIds && pinnedMessageIds.includes(message.id));\n canPin = !canUnpin;\n }\n\n const canDelete = isPrivate\n || isOwn\n || isBasicGroup\n || chat.isCreator\n || getHasAdminRight(chat, 'deleteMessages');\n\n const canReport = !isPrivate && !isOwn;\n\n const canDeleteForAll = canDelete && !isServiceNotification && (\n (isPrivate && !isChatWithSelf)\n || (isBasicGroup && (\n isOwn || getHasAdminRight(chat, 'deleteMessages') || chat.isCreator\n ))\n );\n\n const canEdit = !isAction && isMessageEditable && (\n isOwn\n || (isChannel && (chat.isCreator || getHasAdminRight(chat, 'editMessages')))\n );\n\n const canForward = !isAction && !isServiceNotification;\n\n const hasSticker = Boolean(message.content.sticker);\n const hasFavoriteSticker = hasSticker && selectIsStickerFavorite(global, message.content.sticker!);\n const canFaveSticker = !isAction && hasSticker && !hasFavoriteSticker;\n const canUnfaveSticker = !isAction && hasFavoriteSticker;\n const canCopy = !isAction;\n const canCopyLink = !isAction && (isChannel || isSuperGroup);\n const canSelect = !isAction;\n const noOptions = [\n canReply,\n canEdit,\n canPin,\n canUnpin,\n canDelete,\n canDeleteForAll,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n ].every((ability) => !ability);\n\n return {\n noOptions,\n canReply,\n canEdit,\n canPin,\n canUnpin,\n canDelete,\n canReport,\n canDeleteForAll,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n };\n}\n\n// This selector always returns a new object which can not be safely used in shallow-equal checks\nexport function selectCanDeleteSelectedMessages(global: GlobalState) {\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n const chatMessages = chatId && selectChatMessages(global, chatId);\n if (!chatMessages || !selectedMessageIds || !threadId) {\n return {};\n }\n\n const messageActions = selectedMessageIds\n .map((id) => chatMessages[id] && selectAllowedMessageActions(global, chatMessages[id], threadId))\n .filter(Boolean);\n\n return {\n canDelete: messageActions.every((actions) => actions.canDelete),\n canDeleteForAll: messageActions.every((actions) => actions.canDeleteForAll),\n };\n}\n\nexport function selectCanReportSelectedMessages(global: GlobalState) {\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n const chatMessages = chatId && selectChatMessages(global, chatId);\n if (!chatMessages || !selectedMessageIds || !threadId) {\n return false;\n }\n\n const messageActions = selectedMessageIds\n .map((id) => chatMessages[id] && selectAllowedMessageActions(global, chatMessages[id], threadId))\n .filter(Boolean);\n\n return messageActions.every((actions) => actions.canReport);\n}\n\nexport function selectUploadProgress(global: GlobalState, message: ApiMessage) {\n return global.fileUploads.byMessageLocalId[message.previousLocalId || message.id]?.progress;\n}\n\nexport function selectRealLastReadId(global: GlobalState, chatId: number, threadId: number) {\n if (threadId === MAIN_THREAD_ID) {\n const chat = selectChat(global, chatId);\n if (!chat) {\n return undefined;\n }\n\n // `lastReadInboxMessageId` is empty for new chats\n if (!chat.lastReadInboxMessageId) {\n return undefined;\n }\n\n if (!chat.lastMessage) {\n return chat.lastReadInboxMessageId;\n }\n\n if (isMessageLocal(chat.lastMessage)) {\n return chat.lastMessage.id;\n }\n\n // Some previously read messages may be deleted\n return Math.min(chat.lastMessage.id, chat.lastReadInboxMessageId);\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo) {\n return undefined;\n }\n\n if (!threadInfo.lastReadInboxMessageId) {\n return threadInfo.topMessageId;\n }\n\n // Some previously read messages may be deleted\n return Math.min(threadInfo.lastReadInboxMessageId, threadInfo.lastMessageId || Infinity);\n }\n}\n\nexport function selectFirstUnreadId(global: GlobalState, chatId: number, threadId: number) {\n const chat = selectChat(global, chatId);\n\n if (threadId === MAIN_THREAD_ID) {\n if (!chat) {\n return undefined;\n }\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo || threadInfo.lastMessageId === threadInfo.lastReadInboxMessageId) {\n return undefined;\n }\n }\n\n const outlyingIds = selectOutlyingIds(global, chatId, threadId);\n const listedIds = selectListedIds(global, chatId, threadId);\n const byId = selectChatMessages(global, chatId);\n if (!byId || !(outlyingIds || listedIds)) {\n return undefined;\n }\n\n const lastReadId = selectRealLastReadId(global, chatId, threadId);\n if (!lastReadId && chat && chat.isNotJoined) {\n return undefined;\n }\n\n if (outlyingIds) {\n const found = !lastReadId ? outlyingIds[0] : outlyingIds.find((id) => {\n return id > lastReadId && byId[id] && (!byId[id].isOutgoing || byId[id].isFromScheduled);\n });\n if (found) {\n return found;\n }\n }\n\n if (listedIds) {\n const found = !lastReadId ? listedIds[0] : listedIds.find((id) => {\n return id > lastReadId && byId[id] && (!byId[id].isOutgoing || byId[id].isFromScheduled);\n });\n if (found) {\n return found;\n }\n }\n\n return undefined;\n}\n\nexport function selectIsPollResultsOpen(global: GlobalState) {\n const { pollResults } = global;\n return Boolean(pollResults.messageId);\n}\n\nexport function selectIsForwardModalOpen(global: GlobalState) {\n const { forwardMessages } = global;\n return Boolean(forwardMessages.isModalShown);\n}\n\nexport function selectCommonBoxChatId(global: GlobalState, messageId: number) {\n const fromLastMessage = Object.values(global.chats.byId).find((chat) => (\n isCommonBoxChat(chat) && chat.lastMessage && chat.lastMessage.id === messageId\n ));\n if (fromLastMessage) {\n return fromLastMessage.id;\n }\n\n const { byChatId } = global.messages;\n return Number(Object.keys(byChatId).find((chatId) => {\n const chat = selectChat(global, Number(chatId));\n return chat && isCommonBoxChat(chat) && byChatId[chat.id].byId[messageId];\n }));\n}\n\nexport function selectIsInSelectMode(global: GlobalState) {\n const { selectedMessages } = global;\n\n return Boolean(selectedMessages);\n}\n\nexport function selectIsMessageSelected(global: GlobalState, messageId: number) {\n const { messageIds } = global.selectedMessages || {};\n if (!messageIds) {\n return false;\n }\n\n return messageIds.includes(messageId);\n}\n\nexport function selectForwardedMessageIdsByGroupId(global: GlobalState, chatId: number, groupedId: string) {\n const chatMessages = selectChatMessages(global, chatId);\n if (!chatMessages) {\n return undefined;\n }\n\n return Object.values(chatMessages)\n .filter((message) => message.groupedId === groupedId && message.forwardInfo)\n .map(({ forwardInfo }) => forwardInfo!.fromMessageId);\n}\n\nexport function selectMessageIdsByGroupId(global: GlobalState, chatId: number, groupedId: string) {\n const chatMessages = selectChatMessages(global, chatId);\n if (!chatMessages) {\n return undefined;\n }\n\n return Object.keys(chatMessages)\n .map(Number)\n .filter((id) => chatMessages[id].groupedId === groupedId);\n}\n\nexport function selectIsDocumentGroupSelected(global: GlobalState, chatId: number, groupedId: string) {\n const { messageIds: selectedIds } = global.selectedMessages || {};\n if (!selectedIds) {\n return false;\n }\n\n const groupIds = selectMessageIdsByGroupId(global, chatId, groupedId);\n return groupIds && groupIds.every((id) => selectedIds.includes(id));\n}\n\nexport function selectSelectedMessagesCount(global: GlobalState) {\n const { messageIds } = global.selectedMessages || {};\n\n return messageIds ? messageIds.length : 0;\n}\n\nexport function selectNewestMessageWithBotKeyboardButtons(\n global: GlobalState, chatId: number,\n): ApiMessage | undefined {\n const chat = selectChat(global, chatId);\n if (!chat) {\n return undefined;\n }\n\n if (!selectIsChatWithBot(global, chat)) {\n return undefined;\n }\n\n const chatMessages = selectChatMessages(global, chatId);\n const viewportIds = selectViewportIds(global, chatId, MAIN_THREAD_ID);\n if (!chatMessages || !viewportIds) {\n return undefined;\n }\n\n const messageId = findLast(viewportIds, (id) => {\n return !chatMessages[id].isOutgoing && Boolean(chatMessages[id].keyboardButtons);\n });\n\n const replyHideMessageId = findLast(viewportIds, (id) => {\n return Boolean(chatMessages[id].shouldHideKeyboardButtons);\n });\n\n if (messageId && replyHideMessageId && replyHideMessageId > messageId) {\n return undefined;\n }\n\n return messageId ? chatMessages[messageId] : undefined;\n}\n\nexport function selectShouldAutoLoadMedia(\n global: GlobalState, message: ApiMessage, chat: ApiChat, sender?: ApiChat | ApiUser,\n) {\n const {\n shouldAutoDownloadMediaFromContacts,\n shouldAutoDownloadMediaInPrivateChats,\n shouldAutoDownloadMediaInGroups,\n shouldAutoDownloadMediaInChannels,\n } = global.settings.byKey;\n\n return Boolean(\n (shouldAutoDownloadMediaInPrivateChats && isChatPrivate(chat.id))\n || (shouldAutoDownloadMediaInGroups && isChatGroup(chat))\n || (shouldAutoDownloadMediaInChannels && isChatChannel(chat))\n || (shouldAutoDownloadMediaFromContacts && sender && (\n sender.id === global.currentUserId\n || selectIsUserOrChatContact(global, sender)\n )),\n );\n}\n\nexport function selectShouldAutoPlayMedia(global: GlobalState, message: ApiMessage) {\n const video = getMessageVideo(message) || getMessageWebPageVideo(message);\n if (!video) {\n return undefined;\n }\n\n const {\n shouldAutoPlayVideos,\n shouldAutoPlayGifs,\n } = global.settings.byKey;\n\n const asGif = video.isGif || video.isRound;\n\n return (shouldAutoPlayVideos && !asGif) || (shouldAutoPlayGifs && asGif);\n}\n\nexport function selectShouldLoopStickers(global: GlobalState) {\n return global.settings.byKey.shouldLoopStickers;\n}\n","import { GlobalState } from '../../global/types';\nimport { selectCurrentMessageList } from './messages';\nimport { buildChatThreadKey } from '../helpers';\n\nexport function selectCurrentTextSearch(global: GlobalState) {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n const currentSearch = global.localTextSearch.byChatThreadKey[chatThreadKey];\n if (!currentSearch || !currentSearch.isActive) {\n return undefined;\n }\n\n return currentSearch;\n}\n\nexport function selectCurrentMediaSearchPeerId(global: GlobalState) {\n const { byChatId } = global.localMediaSearch;\n const { chatId } = selectCurrentMessageList(global) || {};\n const currentProfileUserId = global.users.selectedId;\n\n return currentProfileUserId && byChatId[currentProfileUserId] ? currentProfileUserId : chatId;\n}\n\nexport function selectCurrentMediaSearch(global: GlobalState) {\n const peerId = selectCurrentMediaSearchPeerId(global);\n if (!peerId) {\n return undefined;\n }\n\n return global.localMediaSearch.byChatId[peerId];\n}\n","import { GlobalState } from '../../global/types';\n\nimport { selectCurrentMessageList } from './messages';\nimport { selectChat } from './chats';\nimport { isChatGroup, isChatPrivate } from '../helpers';\n\nexport function selectManagement(global: GlobalState, chatId: number) {\n return global.management.byChatId[chatId];\n}\n\nexport function selectCurrentManagement(global: GlobalState) {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n const currentManagement = global.management.byChatId[chatId];\n if (!currentManagement || !currentManagement.isActive) {\n return undefined;\n }\n\n return currentManagement;\n}\n\nexport function selectCurrentManagementType(global: GlobalState) {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n if (isChatPrivate(chatId)) {\n return 'user';\n }\n\n const chat = selectChat(global, chatId);\n if (!chat) {\n return undefined;\n }\n\n if (isChatGroup(chat)) {\n return 'group';\n }\n\n return 'channel';\n}\n","import { GlobalState } from '../../global/types';\nimport { NewChatMembersProgress, RightColumnContent } from '../../types';\n\nimport { getSystemTheme, IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { selectCurrentMessageList, selectIsPollResultsOpen } from './messages';\nimport { selectCurrentTextSearch } from './localSearch';\nimport { selectCurrentStickerSearch, selectCurrentGifSearch } from './symbols';\nimport { selectAreActiveChatsLoaded } from './chats';\nimport { selectCurrentManagement } from './management';\n\nexport function selectIsMediaViewerOpen(global: GlobalState) {\n const { mediaViewer } = global;\n return Boolean(mediaViewer.messageId || mediaViewer.avatarOwnerId);\n}\n\nexport function selectRightColumnContentKey(global: GlobalState) {\n const {\n users,\n isChatInfoShown,\n newChatMembersProgress,\n } = global;\n\n const isAddingChatMembersShown = newChatMembersProgress !== NewChatMembersProgress.Closed;\n const isPollResults = selectIsPollResultsOpen(global);\n const isSearch = Boolean(!IS_SINGLE_COLUMN_LAYOUT && selectCurrentTextSearch(global));\n const isManagement = selectCurrentManagement(global);\n const stickerSearch = selectCurrentStickerSearch(global);\n const isStickerSearch = stickerSearch.query !== undefined;\n const gifSearch = selectCurrentGifSearch(global);\n const isGifSearch = gifSearch.query !== undefined;\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n const currentProfileUserId = users.selectedId;\n const areActiveChatsLoaded = selectAreActiveChatsLoaded(global);\n const isUserInfo = Boolean(currentProfileUserId && areActiveChatsLoaded);\n const isChatShown = Boolean(currentChatId && areActiveChatsLoaded);\n const isChatInfo = isChatShown && isChatInfoShown;\n\n return isPollResults ? (\n RightColumnContent.PollResults\n ) : isSearch ? (\n RightColumnContent.Search\n ) : isManagement ? (\n RightColumnContent.Management\n ) : isStickerSearch ? (\n RightColumnContent.StickerSearch\n ) : isGifSearch ? (\n RightColumnContent.GifSearch\n ) : isAddingChatMembersShown ? (\n RightColumnContent.AddingMembers\n ) : isUserInfo ? (\n RightColumnContent.UserInfo\n ) : isChatInfo ? (\n RightColumnContent.ChatInfo\n ) : undefined;\n}\n\nexport function selectIsRightColumnShown(global: GlobalState) {\n return selectRightColumnContentKey(global) !== undefined;\n}\n\nexport function selectTheme(global: GlobalState) {\n const { theme, shouldUseSystemTheme } = global.settings.byKey;\n\n return shouldUseSystemTheme ? getSystemTheme() : theme;\n}\n","import { GlobalState } from '../../global/types';\n\nexport function selectCurrentGlobalSearchQuery(global: GlobalState) {\n return global.globalSearch.query;\n}\n","import { GlobalState } from '../../global/types';\n\nexport function selectPaymentChatId(global: GlobalState) {\n return global.payment.chatId;\n}\n\nexport function selectPaymentMessageId(global: GlobalState) {\n return global.payment.messageId;\n}\n\nexport function selectPaymentFormId(global: GlobalState) {\n return global.payment.formId;\n}\n\nexport function selectPaymentRequestId(global: GlobalState) {\n return global.payment.requestId;\n}\n\nexport function selectProviderPublishableKey(global: GlobalState) {\n return global.payment.nativeParams ? global.payment.nativeParams.publishableKey : undefined;\n}\n\nexport function selectStripeCredentials(global: GlobalState) {\n return global.payment.stripeCredentials;\n}\n","import {\n ApiBotInlineMediaResult, ApiBotInlineResult, ApiBotInlineSwitchPm,\n ApiLanguage, ApiMessage, ApiShippingAddress, ApiStickerSet,\n} from '../api/types';\n\nexport enum LoadMoreDirection {\n Backwards,\n Forwards,\n Around,\n}\n\nexport enum FocusDirection {\n Up,\n Down,\n Static,\n}\n\nexport interface IAlbum {\n albumId: string;\n messages: ApiMessage[];\n mainMessage: ApiMessage;\n}\n\nexport type ThemeKey = 'light' | 'dark';\n\nexport interface IThemeSettings {\n background?: string;\n backgroundColor?: string;\n patternColor?: string;\n isBlurred?: boolean;\n}\n\nexport type NotifySettings = {\n hasPrivateChatsNotifications?: boolean;\n hasPrivateChatsMessagePreview?: boolean;\n hasGroupNotifications?: boolean;\n hasGroupMessagePreview?: boolean;\n hasBroadcastNotifications?: boolean;\n hasBroadcastMessagePreview?: boolean;\n hasContactJoinedNotifications?: boolean;\n hasWebNotifications: boolean;\n hasPushNotifications: boolean;\n notificationSoundVolume: number;\n};\n\nexport type LangCode = (\n 'en' | 'ar' | 'be' | 'ca' | 'nl' | 'fr' | 'de' | 'id' | 'it' | 'ko' | 'ms' | 'fa' | 'pl' | 'pt-br' | 'ru' | 'es'\n | 'tr' | 'uk' | 'uz'\n);\n\nexport interface ISettings extends NotifySettings, Record {\n theme: ThemeKey;\n shouldUseSystemTheme: boolean;\n messageTextSize: number;\n animationLevel: 0 | 1 | 2;\n messageSendKeyCombo: 'enter' | 'ctrl-enter';\n shouldAutoDownloadMediaFromContacts: boolean;\n shouldAutoDownloadMediaInPrivateChats: boolean;\n shouldAutoDownloadMediaInGroups: boolean;\n shouldAutoDownloadMediaInChannels: boolean;\n shouldAutoPlayGifs: boolean;\n shouldAutoPlayVideos: boolean;\n shouldSuggestStickers: boolean;\n shouldLoopStickers: boolean;\n hasPassword?: boolean;\n languages?: ApiLanguage[];\n language: LangCode;\n isSensitiveEnabled?: boolean;\n canChangeSensitive?: boolean;\n}\n\nexport interface ApiPrivacySettings {\n visibility: PrivacyVisibility;\n allowUserIds: number[];\n allowChatIds: number[];\n blockUserIds: number[];\n blockChatIds: number[];\n}\n\nexport interface IInputPrivacyContact {\n id: number;\n accessHash?: string;\n}\n\nexport interface IInputPrivacyRules {\n visibility: PrivacyVisibility;\n allowedUsers?: IInputPrivacyContact[];\n allowedChats?: IInputPrivacyContact[];\n blockedUsers?: IInputPrivacyContact[];\n blockedChats?: IInputPrivacyContact[];\n}\n\nexport type IAnchorPosition = {\n x: number;\n y: number;\n};\n\nexport interface ShippingOption {\n id: string;\n title: string;\n amount: number;\n prices: Price[];\n}\n\nexport interface Price {\n label: string;\n amount: number;\n}\n\nexport interface Invoice {\n currency?: string;\n emailRequested?: boolean;\n emailToProvider?: boolean;\n flexible?: boolean;\n nameRequested?: boolean;\n phoneRequested?: boolean;\n phoneToProvider?: boolean;\n prices?: Price[];\n shippingAddressRequested?: boolean;\n test?: boolean;\n}\n\nexport interface Receipt {\n currency: string;\n prices: Price[];\n info?: {\n shippingAddress?: ApiShippingAddress;\n phone?: string;\n name?: string;\n };\n totalAmount: number;\n credentialsTitle: string;\n shippingPrices?: Price[];\n shippingMethod?: string;\n photoUrl?: string;\n text?: string;\n title?: string;\n}\n\nexport enum SettingsScreens {\n Main,\n EditProfile,\n Notifications,\n Language,\n General,\n GeneralChatBackground,\n GeneralChatBackgroundColor,\n Privacy,\n PrivacyPhoneNumber,\n PrivacyLastSeen,\n PrivacyProfilePhoto,\n PrivacyForwarding,\n PrivacyGroupChats,\n PrivacyPhoneNumberAllowedContacts,\n PrivacyPhoneNumberDeniedContacts,\n PrivacyLastSeenAllowedContacts,\n PrivacyLastSeenDeniedContacts,\n PrivacyProfilePhotoAllowedContacts,\n PrivacyProfilePhotoDeniedContacts,\n PrivacyForwardingAllowedContacts,\n PrivacyForwardingDeniedContacts,\n PrivacyGroupChatsAllowedContacts,\n PrivacyGroupChatsDeniedContacts,\n PrivacyActiveSessions,\n PrivacyBlockedUsers,\n Folders,\n FoldersCreateFolder,\n FoldersEditFolder,\n FoldersEditFolderFromChatList,\n FoldersIncludedChats,\n FoldersIncludedChatsFromChatList,\n FoldersExcludedChats,\n FoldersExcludedChatsFromChatList,\n TwoFaDisabled,\n TwoFaNewPassword,\n TwoFaNewPasswordConfirm,\n TwoFaNewPasswordHint,\n TwoFaNewPasswordEmail,\n TwoFaNewPasswordEmailCode,\n TwoFaEnabled,\n TwoFaChangePasswordCurrent,\n TwoFaChangePasswordNew,\n TwoFaChangePasswordConfirm,\n TwoFaChangePasswordHint,\n TwoFaTurnOff,\n TwoFaRecoveryEmailCurrentPassword,\n TwoFaRecoveryEmail,\n TwoFaRecoveryEmailCode,\n TwoFaCongratulations,\n}\n\nexport type StickerSetOrRecent = Pick;\n\nexport enum LeftColumnContent {\n ChatList,\n GlobalSearch,\n Settings,\n Contacts,\n Archived,\n NewChannelStep1,\n NewChannelStep2,\n NewGroupStep1,\n NewGroupStep2,\n}\n\nexport enum GlobalSearchContent {\n ChatList,\n Media,\n Links,\n Files,\n Music,\n Voice,\n}\n\nexport enum RightColumnContent {\n ChatInfo,\n UserInfo,\n Search,\n Management,\n StickerSearch,\n GifSearch,\n PollResults,\n AddingMembers,\n}\n\nexport enum MediaViewerOrigin {\n Inline,\n ScheduledInline,\n SharedMedia,\n ProfileAvatar,\n SettingsAvatar,\n MiddleHeaderAvatar,\n Album,\n ScheduledAlbum,\n SearchResult,\n}\n\nexport enum ChatCreationProgress {\n Idle,\n InProgress,\n Complete,\n Error,\n}\n\nexport enum ProfileEditProgress {\n Idle,\n InProgress,\n Complete,\n Error,\n}\n\nexport enum ManagementProgress {\n Idle,\n InProgress,\n Complete,\n Error,\n}\n\nexport enum NewChatMembersProgress {\n Closed,\n InProgress,\n Loading,\n}\n\nexport type ProfileTabType = 'members' | 'media' | 'documents' | 'links' | 'audio';\nexport type SharedMediaType = 'media' | 'documents' | 'links' | 'audio';\nexport type ApiPrivacyKey = 'phoneNumber' | 'lastSeen' | 'profilePhoto' | 'forwards' | 'chatInvite';\nexport type PrivacyVisibility = 'everybody' | 'contacts' | 'nonContacts' | 'nobody';\n\nexport enum ProfileState {\n Profile,\n SharedMedia,\n MemberList,\n}\n\nexport enum PaymentStep {\n ShippingInfo,\n Shipping,\n PaymentInfo,\n Checkout,\n}\n\nexport const UPLOADING_WALLPAPER_SLUG = 'UPLOADING_WALLPAPER_SLUG';\n\nexport enum ManagementScreens {\n Initial,\n ChatPrivacyType,\n Discussion,\n ChannelSubscribers,\n GroupType,\n GroupPermissions,\n GroupRemovedUsers,\n GroupUserPermissionsCreate,\n GroupUserPermissions,\n ChatAdministrators,\n GroupRecentActions,\n ChatAdminRights,\n GroupMembers,\n}\n\nexport type ManagementType = 'user' | 'group' | 'channel';\n\nexport type NotifyException = {\n isMuted: boolean;\n isSilent?: boolean;\n shouldShowPreviews?: boolean;\n};\n\nexport type EmojiKeywords = {\n isLoading?: boolean;\n version: number;\n keywords: Record;\n};\n\nexport type InlineBotSettings = {\n id: number;\n help?: string;\n query?: string;\n offset?: string;\n canLoadMore?: boolean;\n results?: (ApiBotInlineResult | ApiBotInlineMediaResult)[];\n isGallery?: boolean;\n switchPm?: ApiBotInlineSwitchPm;\n};\n","import { fastRaf } from './schedulers';\n\ninterface AnimationInstance {\n isCancelled: boolean;\n}\n\nlet currentInstance: AnimationInstance | undefined;\n\nexport function animateSingle(tick: Function, instance?: AnimationInstance) {\n if (!instance) {\n if (currentInstance && !currentInstance.isCancelled) {\n currentInstance.isCancelled = true;\n }\n\n instance = { isCancelled: false };\n currentInstance = instance;\n }\n\n fastRaf(() => {\n if (!instance!.isCancelled && tick()) {\n animateSingle(tick, instance);\n }\n });\n}\n\nexport function animate(tick: Function) {\n fastRaf(() => {\n if (tick()) {\n animate(tick);\n }\n });\n}\n","import { DEBUG } from '../config';\n\nexport function updateAppBadge(unreadCount: number) {\n if (typeof window.navigator.setAppBadge !== 'function') {\n return;\n }\n\n window.navigator.setAppBadge(unreadCount).catch((err) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n });\n}\n","export default function arePropsShallowEqual(currentProps: AnyLiteral, newProps: AnyLiteral) {\n if (currentProps === newProps) {\n return true;\n }\n\n const currentKeys = Object.keys(currentProps);\n const currentKeysLength = currentKeys.length;\n const newKeysLength = Object.keys(newProps).length;\n\n if (currentKeysLength !== newKeysLength) {\n return false;\n }\n\n if (currentKeysLength === 0) {\n return true;\n }\n\n for (let i = 0; i < currentKeysLength; i++) {\n const prop = currentKeys[i];\n if (currentProps[prop] !== newProps[prop]) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function getUnequalProps(currentProps: AnyLiteral, newProps: AnyLiteral) {\n const currentKeys = Object.keys(currentProps);\n const currentKeysLength = currentKeys.length;\n const newKeysLength = Object.keys(newProps).length;\n\n if (currentKeysLength !== newKeysLength) {\n return ['%LENGTH%'];\n }\n\n return currentKeys.reduce((res, prop) => {\n if (currentProps[prop] !== newProps[prop]) {\n res.push(`${prop}: ${currentProps[prop]} => ${newProps[prop]}`);\n }\n\n return res;\n }, [] as string[]);\n}\n","type Parts = (string | false | undefined)[];\n\nexport default (...parts: Parts) => {\n return parts.filter(Boolean).join(' ');\n};\n","// eslint-disable-next-line no-restricted-globals\nconst cacheApi = self.caches;\n\nexport enum Type {\n Text,\n Blob,\n Json,\n}\n\nexport async function fetch(\n cacheName: string, key: string, type: Type, isHtmlAllowed = false,\n) {\n if (!cacheApi) {\n return undefined;\n }\n\n try {\n // To avoid the error \"Request scheme 'webdocument' is unsupported\"\n const request = new Request(key.replace(/:/g, '_'));\n const cache = await cacheApi.open(cacheName);\n const response = await cache.match(request);\n if (!response) {\n return undefined;\n }\n\n switch (type) {\n case Type.Text:\n return await response.text();\n case Type.Blob: {\n const blob = await response.blob();\n\n // Safari does not return correct Content-Type header for webp images.\n if (key.substr(0, 7) === 'sticker') {\n return new Blob([blob], { type: 'image/webp' });\n }\n\n // iOS Safari fails to preserve `type` in cache\n if (!blob.type) {\n const contentType = response.headers.get('Content-Type');\n if (contentType) {\n return new Blob([blob], { type: isHtmlAllowed ? contentType : contentType.replace(/html/gi, '') });\n }\n }\n\n // Prevent HTML-in-video attacks (for files that were cached before fix)\n if (!isHtmlAllowed && blob.type.includes('html')) {\n return new Blob([blob], { type: blob.type.replace(/html/gi, '') });\n }\n\n return blob;\n }\n case Type.Json:\n return await response.json();\n default:\n return undefined;\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n return undefined;\n }\n}\n\nexport async function save(cacheName: string, key: string, data: AnyLiteral | Blob | string) {\n if (!cacheApi) {\n return undefined;\n }\n\n try {\n const cacheData = typeof data === 'string' || data instanceof Blob ? data : JSON.stringify(data);\n // To avoid the error \"Request scheme 'webdocument' is unsupported\"\n const request = new Request(key.replace(/:/g, '_'));\n const response = new Response(cacheData);\n const cache = await cacheApi.open(cacheName);\n return await cache.put(request, response);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n return undefined;\n }\n}\n\nexport async function clear(cacheName: string) {\n try {\n if (!cacheApi) {\n return undefined;\n }\n\n return await cacheApi.delete(cacheName);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n return undefined;\n }\n}\n","import captureKeyboardListener from './captureKeyboardListeners';\n\ntype IHandlerFunction = () => void;\n\nexport default function captureEscKeyListener(handler: IHandlerFunction) {\n return captureKeyboardListener({ onEsc: handler });\n}\n","type HandlerName = 'onEnter' | 'onBackspace' | 'onDelete' | 'onEsc' | 'onUp' | 'onDown' | 'onLeft' | 'onRight'\n| 'onTab';\ntype Handler = (e: KeyboardEvent) => void;\ntype CaptureOptions = Partial>;\n\nconst keyToHandlerName: Record = {\n Enter: 'onEnter',\n Backspace: 'onBackspace',\n Delete: 'onDelete',\n Esc: 'onEsc',\n Escape: 'onEsc',\n ArrowUp: 'onUp',\n ArrowDown: 'onDown',\n ArrowLeft: 'onLeft',\n ArrowRight: 'onRight',\n Tab: 'onTab',\n};\n\nconst handlers: Record = {\n onEnter: [],\n onDelete: [],\n onBackspace: [],\n onEsc: [],\n onUp: [],\n onDown: [],\n onLeft: [],\n onRight: [],\n onTab: [],\n};\n\nexport default function captureKeyboardListeners(options: CaptureOptions) {\n if (!hasActiveHandlers()) {\n document.addEventListener('keydown', handleKeyDown, true);\n }\n\n (Object.keys(options) as Array).forEach((handlerName) => {\n const handler = options[handlerName];\n if (!handler) {\n return;\n }\n\n const currentEventHandlers = handlers[handlerName];\n if (currentEventHandlers) {\n currentEventHandlers.push(handler);\n }\n });\n\n return () => {\n releaseKeyboardListener(options);\n };\n}\n\nfunction hasActiveHandlers() {\n return Object.values(handlers).some((keyHandlers) => Boolean(keyHandlers.length));\n}\n\nfunction handleKeyDown(e: KeyboardEvent) {\n const handlerName = keyToHandlerName[e.key];\n if (!handlerName) {\n return;\n }\n\n const { length } = handlers[handlerName];\n if (!length) {\n return;\n }\n e.stopPropagation();\n\n const handler = handlers[handlerName][length - 1];\n handler!(e);\n}\n\nfunction releaseKeyboardListener(options: CaptureOptions) {\n (Object.keys(options) as Array).forEach((handlerName) => {\n const handler = options[handlerName];\n const currentEventHandlers = handlers[handlerName];\n if (currentEventHandlers) {\n const index = currentEventHandlers.findIndex((cb) => cb === handler);\n if (index !== -1) {\n currentEventHandlers.splice(index, 1);\n }\n }\n });\n\n if (!hasActiveHandlers()) {\n document.removeEventListener('keydown', handleKeyDown, false);\n }\n}\n","import { LangFn } from '../hooks/useLang';\n\nconst WEEKDAYS_FULL = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\nconst MONTHS_FULL = [\n 'January', 'February', 'March', 'April', 'May', 'June',\n 'July', 'August', 'September', 'October', 'November', 'December',\n];\n\nconst MONTHS_FULL_LOWERCASE = MONTHS_FULL.map((month) => month.toLowerCase());\nconst MIN_SEARCH_YEAR = 2015;\nconst MAX_DAY_IN_MONTH = 31;\nconst MAX_MONTH_IN_YEAR = 12;\nexport const MILISECONDS_IN_DAY = 24 * 60 * 60 * 1000;\n\nexport function getDayStart(datetime: number | Date) {\n const date = new Date(datetime);\n date.setHours(0, 0, 0, 0);\n return date;\n}\n\nexport function getDayStartAt(datetime: number | Date) {\n return getDayStart(datetime).getTime();\n}\n\nexport function toYearMonth(timestamp: number) {\n const date = new Date(timestamp * 1000);\n return `${date.getFullYear()}-${date.getMonth()}`;\n}\n\nfunction toIsoString(date: Date) {\n return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;\n}\n\nexport function formatTime(datetime: number | Date) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n const hours = String(date.getHours()).padStart(2, '0');\n const minutes = String(date.getMinutes()).padStart(2, '0');\n\n return `${hours}:${minutes}`;\n}\n\nexport function formatPastTimeShort(lang: LangFn, datetime: number | Date) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n\n const today = getDayStart(new Date());\n if (date >= today) {\n return formatTime(date);\n }\n\n const weekAgo = new Date(today);\n weekAgo.setDate(today.getDate() - 7);\n if (date >= weekAgo) {\n return lang(`Weekday.Short${WEEKDAYS_FULL[date.getDay()]}`);\n }\n\n const withYear = date.getFullYear() !== today.getFullYear();\n const format = (\n lang(withYear ? 'formatDateScheduleYear' : 'formatDateSchedule')\n || (withYear ? 'd MMM yyyy' : 'd MMM')\n );\n\n return formatDate(lang, date, format);\n}\n\nexport function formatFullDate(lang: LangFn, datetime: number | Date) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n const format = lang('formatterYearMax') || 'dd.MM.yyyy';\n\n return formatDate(lang, date, format);\n}\n\nexport function formatMonthAndYear(lang: LangFn, date: Date, isShort = false) {\n const format = lang(isShort ? 'formatterMonthYear2' : 'formatterMonthYear') || 'MMM yyyy';\n\n return formatDate(lang, date, format);\n}\n\nexport function formatHumanDate(lang: LangFn, datetime: number | Date, isShort = false, noWeekdays = false) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n\n const today = getDayStart(new Date());\n\n if (!noWeekdays) {\n if (toIsoString(date) === toIsoString(today)) {\n return (isShort ? lowerFirst : upperFirst)(lang('Weekday.Today'));\n }\n\n const yesterday = new Date(today);\n yesterday.setDate(today.getDate() - 1);\n if (toIsoString(date) === toIsoString(yesterday)) {\n return (isShort ? lowerFirst : upperFirst)(lang('Weekday.Yesterday'));\n }\n\n const weekAgo = new Date(today);\n const weekAhead = new Date(today);\n weekAgo.setDate(today.getDate() - 7);\n weekAhead.setDate(today.getDate() + 7);\n if (date >= weekAgo && date <= weekAhead) {\n const weekDay = WEEKDAYS_FULL[date.getDay()];\n return isShort\n ? lowerFirst(lang(`Weekday.Short${weekDay}`))\n : upperFirst(lang(`Weekday.${weekDay}`));\n }\n }\n\n const withYear = date.getFullYear() !== today.getFullYear();\n const formatKey = isShort\n ? (withYear ? 'formatDateScheduleYear' : 'formatDateSchedule')\n : (withYear ? 'chatFullDate' : 'chatDate');\n const format = lang(formatKey) || 'd MMMM yyyy';\n\n return (isShort ? lowerFirst : upperFirst)(formatDate(lang, date, format));\n}\n\nfunction formatDate(lang: LangFn, date: Date, format: string) {\n const day = date.getDate();\n const monthIndex = date.getMonth();\n\n return format\n .replace('LLLL', lang(MONTHS_FULL[monthIndex]))\n .replace('MMMM', lang(`Month.Gen${MONTHS_FULL[monthIndex]}`))\n .replace('MMM', lang(`Month.Short${MONTHS_FULL[monthIndex]}`))\n .replace('MM', String(monthIndex + 1).padStart(2, '0'))\n .replace('dd', String(day).padStart(2, '0'))\n .replace('d', String(day))\n .replace('yyyy', String(date.getFullYear()));\n}\n\nexport function formatMediaDateTime(lang: LangFn, datetime: number | Date) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n\n return `${formatHumanDate(lang, date, true)}, ${formatTime(date)}`;\n}\n\nexport function formatMediaDuration(duration: number) {\n const hours = Math.floor(duration / 3600);\n const minutes = Math.floor((duration % 3600) / 60);\n const seconds = Math.floor(duration % 3600 % 60);\n\n let string = '';\n if (hours > 0) {\n string += `${String(hours).padStart(2, '0')}:`;\n string += `${String(minutes).padStart(2, '0')}:`;\n } else {\n string += `${String(minutes)}:`;\n }\n string += String(seconds).padStart(2, '0');\n\n return string;\n}\n\nexport function formatVoiceRecordDuration(durationInMs: number) {\n const parts = [];\n\n let milliseconds = durationInMs % 1000;\n durationInMs -= milliseconds;\n milliseconds = Math.floor(milliseconds / 10);\n\n durationInMs = Math.floor(durationInMs / 1000);\n const seconds = durationInMs % 60;\n durationInMs -= seconds;\n\n durationInMs = Math.floor(durationInMs / 60);\n const minutes = durationInMs % 60;\n durationInMs -= minutes;\n\n durationInMs = Math.floor(durationInMs / 60);\n const hours = durationInMs % 60;\n\n if (hours > 0) {\n parts.push(String(hours).padStart(2, '0'));\n }\n parts.push(String(minutes).padStart(hours > 0 ? 2 : 1, '0'));\n parts.push(String(seconds).padStart(2, '0'));\n\n return `${parts.join(':')},${String(milliseconds).padStart(2, '0')}`;\n}\n\nexport function formatDateToString(date: Date, locale = 'en-US') {\n return date.toLocaleString(\n locale,\n {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n },\n );\n}\n\nfunction isValidDate(day: number, month: number, year = 2021): boolean {\n if (month > (MAX_MONTH_IN_YEAR - 1) || day > MAX_DAY_IN_MONTH) {\n return false;\n }\n const date = new Date(year, month, day);\n return !Number.isNaN(date.getTime()) && date.getDate() === day;\n}\n\nexport function parseDateString(query = ''): string | undefined {\n const matchStringDate = query.match(/\\d{1,2}\\s[a-zA-Z]{3,}/);\n const matchEuropeStringDate = query.match(/[a-zA-Z]{3,}\\s\\d{1,2}/);\n const matchNumberDate = query.match(/\\d{1,2}[./-]\\d{1,2}([./-]\\d{2,4})?/);\n if (!matchStringDate && !matchNumberDate && !matchEuropeStringDate) {\n return undefined;\n }\n\n if (matchNumberDate) {\n const [date, month, year] = query.split(/[./-]/).map(Number);\n return !(year && year < MIN_SEARCH_YEAR) && isValidDate(date, month - 1, year || undefined)\n ? `${year ? `${year}-` : ''}${String(month).padStart(2, '0')}-${String(date).padStart(2, '0')}`\n : undefined;\n }\n\n const dateParts = query.split(' ');\n const date = matchStringDate ? dateParts[0] : dateParts[1];\n const month = (matchStringDate ? dateParts[1] : dateParts[0]).toLowerCase();\n const monthIndex = MONTHS_FULL_LOWERCASE.findIndex((item) => item.startsWith(month));\n\n return monthIndex !== -1 && isValidDate(Number(date), monthIndex)\n ? `${String(monthIndex + 1).padStart(2, '0')}-${String(date).padStart(2, '0')}`\n : undefined;\n}\n\nexport function timestampPlusDay(timestamp: number) {\n return timestamp + MILISECONDS_IN_DAY / 1000;\n}\n\nfunction lowerFirst(str: string) {\n return `${str[0].toLowerCase()}${str.slice(1)}`;\n}\n\nfunction upperFirst(str: string) {\n return `${str[0].toUpperCase()}${str.slice(1)}`;\n}\n","import EMOJI_REGEX from '../lib/twemojiRegex';\n\n// Due to the fact that emoji from Apple do not contain some characters, it is necessary to remove them from emoji-data\n// https://github.com/iamcal/emoji-data/issues/136\nconst EXCLUDE_EMOJIS = ['female_sign', 'male_sign', 'medical_symbol'];\n\nexport type EmojiRawData = typeof import('emoji-data-ios/emoji-data.json');\nexport type EmojiModule = { default: EmojiRawData };\n\nexport type EmojiData = {\n categories: Array;\n emojis: Record;\n};\n\n// Non-standard variations of emojis, used on some devices\nconst EMOJI_EXCEPTIONS: [string | RegExp, string][] = [\n [/\\u{1f3f3}\\u200d\\u{1f308}/gu, '\\u{1f3f3}\\ufe0f\\u200d\\u{1f308}'], // 🏳‍🌈\n [/\\u{1f3f3}\\u200d\\u26a7\\ufe0f/gu, '\\u{1f3f3}\\ufe0f\\u200d\\u26a7\\ufe0f'], // 🏳️‍⚧️\n [/\\u{1f937}\\u200d\\u2642/gu, '\\u{1f937}\\u200d\\u2642\\ufe0f'], // 🤷‍♂️\n]\n\nfunction unifiedToNative(unified: string) {\n const unicodes = unified.split('-');\n const codePoints = unicodes.map((i) => parseInt(i, 16));\n\n return String.fromCodePoint(...codePoints);\n}\n\nexport function fixNonStandardEmoji(text: string) {\n // Non-standard sequences typically parsed as separate emojis, so no need to fix text without any\n if (!text.match(EMOJI_REGEX)) return text;\n for (let [regex, replacement] of EMOJI_EXCEPTIONS) {\n text = text.replace(regex, replacement);\n }\n\n return text;\n}\n\nexport function nativeToUnified(emoji: string) {\n let code;\n\n if (emoji.length === 1) {\n code = emoji.charCodeAt(0).toString(16).padStart(4, '0');\n } else {\n const pairs = [];\n for (let i = 0; i < emoji.length; i++) {\n if (emoji.charCodeAt(i) >= 0xd800 && emoji.charCodeAt(i) <= 0xdbff) {\n if (emoji.charCodeAt(i + 1) >= 0xdc00 && emoji.charCodeAt(i + 1) <= 0xdfff) {\n pairs.push(\n (emoji.charCodeAt(i) - 0xd800) * 0x400\n + (emoji.charCodeAt(i + 1) - 0xdc00) + 0x10000,\n );\n }\n } else if (emoji.charCodeAt(i) < 0xd800 || emoji.charCodeAt(i) > 0xdfff) {\n pairs.push(emoji.charCodeAt(i));\n }\n }\n\n code = pairs.map((x) => x.toString(16).padStart(4, '0')).join('-');\n }\n\n return code;\n}\n\nexport function uncompressEmoji(data: EmojiRawData): EmojiData {\n const emojiData: EmojiData = { categories: [], emojis: {} };\n\n for (let i = 0; i < data.length; i += 2) {\n const category = {\n id: data[i][0],\n name: data[i][1],\n emojis: [],\n } as EmojiCategory;\n\n for (let j = 0; j < data[i + 1].length; j++) {\n const emojiRaw = data[i + 1][j];\n if (!EXCLUDE_EMOJIS.includes(emojiRaw[1][0])) {\n category.emojis.push(emojiRaw[1][0]);\n emojiData.emojis[emojiRaw[1][0]] = {\n id: emojiRaw[1][0],\n names: emojiRaw[1] as string[],\n native: unifiedToNative(emojiRaw[0] as string),\n image: (emojiRaw[0] as string).toLowerCase(),\n };\n }\n }\n\n emojiData.categories.push(category);\n }\n\n return emojiData;\n}\n","let isWebpSupportedCache: boolean | undefined;\n\nexport function isWebpSupported() {\n return Boolean(isWebpSupportedCache);\n}\n\nfunction testWebp(): Promise {\n return new Promise((resolve) => {\n const webp = new Image();\n // eslint-disable-next-line max-len\n webp.src = 'data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA';\n const handleLoadOrError = () => {\n resolve(webp.height === 2);\n };\n webp.onload = handleLoadOrError;\n webp.onerror = handleLoadOrError;\n });\n}\n\ntestWebp().then((hasWebp) => {\n isWebpSupportedCache = hasWebp;\n});\n","import { ThemeKey } from '../types';\n\nlet systemThemeCache: ThemeKey = (\n window.matchMedia?.('(prefers-color-scheme: dark)').matches\n) ? 'dark' : 'light';\n\nexport function getSystemTheme() {\n return systemThemeCache;\n}\n\nfunction handleSystemThemeChange(e: MediaQueryListEventMap['change']) {\n systemThemeCache = e.matches ? 'dark' : 'light';\n}\n\nconst mql = window.matchMedia('(prefers-color-scheme: dark)');\nif (typeof mql.addEventListener === 'function') {\n mql.addEventListener('change', handleSystemThemeChange);\n} else if (typeof mql.addListener === 'function') {\n mql.addListener(handleSystemThemeChange);\n}\n","import {\n MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,\n MOBILE_SCREEN_MAX_WIDTH,\n MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT,\n MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH,\n IS_TEST,\n} from '../config';\n\nexport * from './environmentWebp';\n\nexport * from './environmentSystemTheme';\n\nexport function getPlatform() {\n const { userAgent, platform } = window.navigator;\n const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'];\n const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'];\n const iosPlatforms = ['iPhone', 'iPad', 'iPod'];\n let os: 'macOS' | 'iOS' | 'Windows' | 'Android' | 'Linux' | undefined;\n\n if (macosPlatforms.indexOf(platform) !== -1) {\n os = 'macOS';\n } else if (iosPlatforms.indexOf(platform) !== -1) {\n os = 'iOS';\n } else if (windowsPlatforms.indexOf(platform) !== -1) {\n os = 'Windows';\n } else if (/Android/.test(userAgent)) {\n os = 'Android';\n } else if (/Linux/.test(platform)) {\n os = 'Linux';\n }\n\n return os;\n}\n\nexport const PLATFORM_ENV = getPlatform();\nexport const IS_MAC_OS = PLATFORM_ENV === 'macOS';\nexport const IS_IOS = PLATFORM_ENV === 'iOS';\nexport const IS_ANDROID = PLATFORM_ENV === 'Android';\nexport const IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\nexport const IS_PWA = window.matchMedia('(display-mode: standalone)').matches\n|| (window.navigator as any).standalone\n|| document.referrer.includes('android-app://');\n\nexport const IS_TOUCH_ENV = window.matchMedia('(pointer: coarse)').matches;\n// Keep in mind the landscape orientation\nexport const IS_SINGLE_COLUMN_LAYOUT = window.innerWidth <= MOBILE_SCREEN_MAX_WIDTH || (\n window.innerWidth <= MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH && window.innerHeight <= MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT\n);\n// Special layout, 1 column while chat opened, 2 columns while collapsed\nexport const IS_TABLET_COLUMN_LAYOUT = !IS_SINGLE_COLUMN_LAYOUT && (\n window.innerWidth <= MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN\n);\nexport const IS_VOICE_RECORDING_SUPPORTED = (navigator.mediaDevices && 'getUserMedia' in navigator.mediaDevices && (\n window.AudioContext || (window as any).webkitAudioContext\n));\nexport const IS_SMOOTH_SCROLL_SUPPORTED = 'scrollBehavior' in document.documentElement.style;\nexport const IS_EMOJI_SUPPORTED = PLATFORM_ENV && (IS_MAC_OS || IS_IOS);\nexport const IS_SERVICE_WORKER_SUPPORTED = 'serviceWorker' in navigator;\n// TODO Consider failed service worker\nexport const IS_PROGRESSIVE_SUPPORTED = IS_SERVICE_WORKER_SUPPORTED;\nexport const IS_STREAMING_SUPPORTED = 'MediaSource' in window;\nexport const IS_OPUS_SUPPORTED = Boolean((new Audio()).canPlayType('audio/ogg; codecs=opus'));\nexport const IS_CANVAS_FILTER_SUPPORTED = (\n !IS_TEST && 'filter' in (document.createElement('canvas').getContext('2d') || {})\n);\nexport const LAYERS_ANIMATION_NAME = IS_ANDROID ? 'slide-fade' : IS_IOS ? 'slide-layers' : 'push-slide';\n\nexport const DPR = window.devicePixelRatio || 1;\n\nexport const MASK_IMAGE_DISABLED = true;\n","import { pause } from './schedulers';\n\n// Polyfill for Safari: `File` is not available in web worker\nif (typeof File === 'undefined') {\n // eslint-disable-next-line no-global-assign, no-restricted-globals, func-names\n self.File = class extends Blob {\n name: string;\n\n constructor(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag) {\n if (options) {\n const { type, ...rest } = options;\n super(fileBits, { type });\n Object.assign(this, rest);\n } else {\n super(fileBits);\n }\n\n this.name = fileName;\n }\n } as typeof File;\n}\n\nexport function dataUriToBlob(dataUri: string) {\n const arr = dataUri.split(',');\n const mime = arr[0].match(/:(.*?);/)![1];\n const bstr = atob(arr[1]);\n let n = bstr.length;\n const u8arr = new Uint8Array(n);\n\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n\n return new Blob([u8arr], { type: mime });\n}\n\nexport function blobToDataUri(blob: Blob): Promise {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = (e: ProgressEvent) => {\n const { result } = e.target || {};\n if (typeof result === 'string') {\n resolve(result);\n }\n\n reject(new Error('Failed to read blob'));\n };\n\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n}\n\nexport function blobToFile(blob: Blob, fileName: string) {\n return new File([blob], fileName, {\n lastModified: Date.now(),\n type: blob.type,\n });\n}\n\nexport function preloadImage(url: string): Promise {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = reject;\n img.src = url;\n });\n}\n\nexport function preloadVideo(url: string): Promise {\n return new Promise((resolve, reject) => {\n const video = document.createElement('video');\n video.volume = 0;\n video.onloadedmetadata = () => resolve(video);\n video.onerror = reject;\n video.src = url;\n });\n}\n\nexport async function createPosterForVideo(url: string): Promise {\n const video = await preloadVideo(url);\n\n return Promise.race([\n pause(2000) as Promise,\n new Promise((resolve, reject) => {\n video.onseeked = () => {\n if (!video.videoWidth || !video.videoHeight) {\n resolve(undefined);\n }\n\n const canvas = document.createElement('canvas');\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n const ctx = canvas.getContext('2d')!;\n ctx.drawImage(video, 0, 0);\n resolve(canvas.toDataURL('image/jpeg'));\n };\n video.onerror = reject;\n video.currentTime = Math.min(video.duration, 1);\n }),\n ]);\n}\n\nexport async function fetchBlob(blobUrl: string) {\n const response = await fetch(blobUrl);\n return response.blob();\n}\n\nexport async function fetchFile(blobUrl: string, fileName: string) {\n const blob = await fetchBlob(blobUrl);\n return blobToFile(blob, fileName);\n}\n\nexport function imgToCanvas(img: HTMLImageElement) {\n const canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n\n const ctx = canvas.getContext('2d')!;\n ctx.drawImage(img, 0, 0);\n\n return canvas;\n}\n","import { LangCode } from '../types';\n\nexport function formatCurrency(totalPrice: number, currency?: string, locale: LangCode = 'en') {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n }).format(currency === 'JPY' ? totalPrice : totalPrice / 100);\n}\n","export default (store: AnyLiteral) => {\n let id;\n\n do {\n id = String(Math.random()).replace('0.', 'id');\n } while (store.hasOwnProperty(id));\n\n return id;\n};\n","import { ApiError, ApiFieldError } from '../api/types';\n\nconst READABLE_ERROR_MESSAGES: Record = {\n CHAT_RESTRICTED: 'You can\\'t send messages in this chat, you were restricted',\n CHAT_WRITE_FORBIDDEN: 'You can\\'t write in this chat',\n CHAT_SEND_POLL_FORBIDDEN: 'You can\\'t create polls in this chat',\n CHAT_SEND_STICKERS_FORBIDDEN: 'You can\\'t send stickers in this chat',\n CHAT_SEND_GIFS_FORBIDDEN: 'You can\\'t send gifs in this chat',\n CHAT_SEND_MEDIA_FORBIDDEN: 'You can\\'t send media in this chat',\n CHAT_LINK_EXISTS: 'The chat is public, you can\\'t hide the history to new users',\n // eslint-disable-next-line max-len\n SLOWMODE_WAIT_X: 'Slowmode is enabled in this chat: you must wait for the specified number of seconds before sending another message to the chat.',\n USER_BANNED_IN_CHANNEL: 'You\\'re banned from sending messages in supergroups / channels',\n USER_IS_BLOCKED: 'You were blocked by this user',\n YOU_BLOCKED_USER: 'You blocked this user',\n IMAGE_PROCESS_FAILED: 'Failure while processing image',\n MEDIA_EMPTY: 'The provided media object is invalid',\n MEDIA_INVALID: 'Media invalid',\n PHOTO_EXT_INVALID: 'The extension of the photo is invalid',\n PHOTO_INVALID_DIMENSIONS: 'The photo dimensions are invalid',\n PHOTO_SAVE_FILE_INVALID: 'Internal issues, try again later',\n // eslint-disable-next-line max-len\n MESSAGE_DELETE_FORBIDDEN: 'You can\\'t delete one of the messages you tried to delete, most likely because it is a service message.',\n MESSAGE_POLL_CLOSED: 'Poll closed',\n MESSAGE_EDIT_TIME_EXPIRED: 'You can\\'t edit this message anymore.',\n CHAT_ADMIN_REQUIRED: 'You must be an admin in this chat to do this',\n PINNED_DIALOGS_TOO_MUCH: 'Sorry, you can only pin 5 chats to the top',\n DIALOG_FILTERS_TOO_MUCH: 'Sorry, you can\\'t have more than 10 folders',\n CHANNEL_PRIVATE: 'This channel is private',\n MEDIA_CAPTION_TOO_LONG: 'The provided caption is too long',\n ADDRESS_STREET_LINE1_INVALID: 'The address you provided is not valid',\n ADDRESS_STREET_LINE2_INVALID: 'The address you provided is not valid',\n ADDRESS_CITY_INVALID: 'The city you provided is not valid',\n ADDRESS_COUNTRY_INVALID: 'The country you provided is not valid',\n ADDRESS_POSTCODE_INVALID: 'The postcode you provided is not valid',\n ADDRESS_STATE_INVALID: 'The state you provided is not valid',\n REQ_INFO_NAME_INVALID: 'The name you provided is not valid',\n REQ_INFO_PHONE_INVALID: 'The phone you provided is not valid',\n REQ_INFO_EMAIL_INVALID: 'The email you provided is not valid',\n // TODO Bring back after fixing the weird bug\n // CHANNEL_INVALID: 'An error occurred. Please try again later',\n LINK_NOT_MODIFIED: 'This discussion is already linked to the channel',\n MESSAGE_TOO_LONG: 'Message is too long',\n\n // Non-API errors\n SERVICE_WORKER_DISABLED: 'Service Worker is disabled. Please reload the page without holding key.',\n // eslint-disable-next-line max-len\n MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS: 'The provided message is too long. Please remove {EXTRA_CHARS_COUNT} character{PLURAL_S}.',\n // eslint-disable-next-line max-len\n FRESH_RESET_AUTHORISATION_FORBIDDEN: 'You can’t logout other sessions if less than 24 hours have passed since you logged on the current session',\n\n BOTS_TOO_MUCH: 'There are too many bots in this chat/channel',\n BOT_GROUPS_BLOCKED: 'This bot can\\'t be added to groups',\n USERS_TOO_MUCH: 'The maximum number of users has been exceeded',\n USER_CHANNELS_TOO_MUCH: 'One of the users you tried to add is already in too many channels/supergroups',\n USER_KICKED: 'This user was kicked from this supergroup/channel',\n USER_NOT_MUTUAL_CONTACT: 'The provided user is not a mutual contact',\n USER_PRIVACY_RESTRICTED: 'The user\\'s privacy settings do not allow you to do this',\n INVITE_HASH_EMPTY: 'The invite hash is empty',\n INVITE_HASH_EXPIRED: 'The invite link has expired',\n INVITE_HASH_INVALID: 'The invite hash is invalid',\n CHANNELS_TOO_MUCH: 'You have joined too many channels/supergroups',\n USER_ALREADY_PARTICIPANT: 'You already in the group',\n SCHEDULE_DATE_INVALID: 'Invalid schedule date provided',\n WALLPAPER_DIMENSIONS_INVALID: 'The wallpaper dimensions are invalid, please select another file',\n};\n\nexport const SHIPPING_ERRORS: Record = {\n ADDRESS_STREET_LINE1_INVALID: {\n field: 'streetLine1',\n message: 'Incorrect street address',\n },\n ADDRESS_STREET_LINE2_INVALID: {\n field: 'streetLine2',\n message: 'Incorrect street address',\n },\n ADDRESS_CITY_INVALID: {\n field: 'city',\n message: 'Incorrect city',\n },\n ADDRESS_COUNTRY_INVALID: {\n field: 'countryIso2',\n message: 'Incorrect country',\n },\n ADDRESS_POSTCODE_INVALID: {\n field: 'postCode',\n message: 'Incorrect post code',\n },\n ADDRESS_STATE_INVALID: {\n field: 'state',\n message: 'Incorrect state',\n },\n REQ_INFO_NAME_INVALID: {\n field: 'fullName',\n message: 'Incorrect name',\n },\n REQ_INFO_PHONE_INVALID: {\n field: 'phone',\n message: 'Incorrect phone',\n },\n REQ_INFO_EMAIL_INVALID: {\n field: 'email',\n message: 'Incorrect email',\n },\n};\n\nexport default function getReadableErrorText(error: ApiError) {\n const { message, isSlowMode, textParams } = error;\n // Currently, Telegram API doesn't return `SLOWMODE_WAIT_X` error as described in the docs\n if (isSlowMode) {\n const extraPartIndex = message.indexOf(' (caused by');\n return extraPartIndex > 0 ? message.substring(0, extraPartIndex) : message;\n }\n let errorMessage = READABLE_ERROR_MESSAGES[message];\n if (errorMessage && textParams) {\n errorMessage = Object.keys(textParams).reduce((acc, current) => {\n return acc.replace(current, textParams[current]);\n }, errorMessage as string);\n }\n return errorMessage;\n}\n\nexport function getShippingError(error: ApiError): ApiFieldError | undefined {\n return SHIPPING_ERRORS[error.message];\n}\n","import { DEBUG_ALERT_MSG } from '../config';\nimport { throttle } from './schedulers';\n\nwindow.addEventListener('error', handleErrorEvent);\nwindow.addEventListener('unhandledrejection', handleErrorEvent);\n\n// eslint-disable-next-line prefer-destructuring\nconst APP_ENV = process.env.APP_ENV;\n\nfunction handleErrorEvent(e: ErrorEvent | PromiseRejectionEvent) {\n e.preventDefault();\n\n handleError(e instanceof ErrorEvent ? e.error : e.reason);\n}\n\nconst throttledAlert = throttle(window.alert, 1000);\n\nexport function handleError(err: Error) {\n // eslint-disable-next-line no-console\n console.error(err);\n\n if (APP_ENV === 'development' || APP_ENV === 'staging') {\n throttledAlert(`${DEBUG_ALERT_MSG}\\n\\n${(err?.message) || err}\\n${err?.stack}`);\n }\n}\n","type CollectionByKey = Record;\n\ntype OrderDirection = 'asc' | 'desc';\n\ninterface OrderCallback {\n (member: T): any;\n}\n\nexport function buildCollectionByKey(collection: T[], key: keyof T) {\n return collection.reduce((byKey: CollectionByKey, member: T) => {\n byKey[member[key]] = member;\n\n return byKey;\n }, {});\n}\n\nexport function mapValues(\n byKey: CollectionByKey,\n callback: (member: M, key: string, index: number, originalByKey: CollectionByKey) => R,\n): CollectionByKey {\n return Object.keys(byKey).reduce((newByKey: CollectionByKey, key, index) => {\n newByKey[key] = callback(byKey[key], key, index, byKey);\n return newByKey;\n }, {});\n}\n\nexport function pick(object: T, keys: K[]) {\n return keys.reduce((result, key) => {\n result[key] = object[key];\n return result;\n }, {} as Pick);\n}\n\nexport function pickTruthy(object: T, keys: K[]) {\n return keys.reduce((result, key) => {\n if (object[key]) {\n result[key] = object[key];\n }\n\n return result;\n }, {} as Pick);\n}\n\nexport function omit(object: T, keys: K[]) {\n const stringKeys = new Set(keys.map(String));\n const savedKeys = Object.keys(object)\n .filter((key) => !stringKeys.has(key)) as Array>;\n\n return pick(object, savedKeys);\n}\n\nexport function orderBy(\n collection: T[],\n orderKey: (keyof T) | OrderCallback | ((keyof T) | OrderCallback)[],\n mode: OrderDirection | [OrderDirection, OrderDirection] = 'asc',\n): T[] {\n return collection.sort((a, b) => {\n if (Array.isArray(orderKey)) {\n const [mode1, mode2] = Array.isArray(mode) ? mode : [mode, mode];\n const [orderKey1, orderKey2] = orderKey;\n\n let aValue1;\n let bValue1;\n\n if (typeof orderKey1 === 'function') {\n aValue1 = orderKey1(a) || 0;\n bValue1 = orderKey1(b) || 0;\n } else if (typeof orderKey1 === 'string') {\n aValue1 = a[orderKey1] || 0;\n bValue1 = b[orderKey1] || 0;\n }\n\n if (aValue1 !== bValue1) {\n return mode1 === 'asc' ? aValue1 - bValue1 : bValue1 - aValue1;\n } else {\n let aValue2;\n let bValue2;\n\n if (typeof orderKey2 === 'function') {\n aValue2 = orderKey2(a) || 0;\n bValue2 = orderKey2(b) || 0;\n } else if (typeof orderKey2 === 'string') {\n aValue2 = a[orderKey2] || 0;\n bValue2 = b[orderKey2] || 0;\n }\n\n return mode2 === 'asc' ? aValue2 - bValue2 : bValue2 - aValue2;\n }\n }\n\n let aValue;\n let bValue;\n\n if (typeof orderKey === 'function') {\n aValue = orderKey(a) || 0;\n bValue = orderKey(b) || 0;\n } else if (typeof orderKey === 'string') {\n aValue = a[orderKey] || 0;\n bValue = b[orderKey] || 0;\n }\n\n return mode === 'asc' ? aValue - bValue : bValue - aValue;\n });\n}\n\nexport function flatten(array: any[]) {\n return array.reduce((result, member) => {\n if (Array.isArray(member)) {\n return result.concat(member);\n } else {\n result.push(member);\n return result;\n }\n }, []);\n}\n\nexport function unique(array: T[]): T[] {\n return Array.from(new Set(array));\n}\n\nexport function compact(array: any[]) {\n return array.filter(Boolean);\n}\n\nexport function areSortedArraysEqual(array1: any[], array2: any[]) {\n if (array1.length !== array2.length) {\n return false;\n }\n\n return array1.every((item, i) => item === array2[i]);\n}\n\nexport function areSortedArraysIntersecting(array1: any[], array2: any[]) {\n return array1[0] <= array2[array2.length - 1] && array1[array1.length - 1] >= array2[0];\n}\n\nexport function findIntersectionWithSet(array: T[], set: Set): T[] {\n return array.filter((a) => set.has(a));\n}\n\nexport function split(array: any[], chunkSize: number) {\n const result = [];\n for (let i = 0; i < array.length; i += chunkSize) {\n result.push(array.slice(i, i + chunkSize));\n }\n\n return result;\n}\n\nexport function cloneDeep(value: T): T {\n if (typeof value !== 'object') {\n return value;\n }\n\n if (Array.isArray(value)) {\n return value.map(cloneDeep) as typeof value;\n }\n\n return Object.keys(value).reduce((acc, key) => {\n acc[key as keyof T] = cloneDeep(value[key as keyof T]);\n return acc;\n }, {} as T);\n}\n\n/**\n * Returns the index of the last element in the array where predicate is true, and -1 otherwise.\n *\n * @param array The source array to search in\n * @param predicate find calls predicate once for each element of the array, in descending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.\n */\nexport function findLast(array: Array, predicate: (value: T, index: number, obj: T[]) => boolean): T | undefined {\n let cursor = array.length;\n\n while (cursor--) {\n if (predicate(array[cursor], cursor, array)) {\n return array[cursor];\n }\n }\n\n return undefined;\n}\n","import { getGlobal } from '../lib/teact/teactn';\n\nimport { ApiLangPack, ApiLangString } from '../api/types';\nimport { LangCode } from '../types';\n\nimport {\n DEFAULT_LANG_CODE, DEFAULT_LANG_PACK, LANG_CACHE_NAME, LANG_PACKS,\n} from '../config';\nimport * as cacheApi from './cacheApi';\nimport { callApi } from '../api/gramjs';\nimport { createCallbackManager } from './callbacks';\nimport { formatInteger } from './textFormat';\n\ninterface LangFn {\n (key: string, value?: any, format?: 'i'): any;\n\n isRtl?: boolean;\n code?: LangCode;\n}\n\nconst SUBSTITUTION_REGEX = /%\\d?\\$?[sdf@]/g;\nconst PLURAL_OPTIONS = ['value', 'zeroValue', 'oneValue', 'twoValue', 'fewValue', 'manyValue', 'otherValue'] as const;\nconst PLURAL_RULES = {\n /* eslint-disable max-len */\n en: (n: number) => (n !== 1 ? 6 : 2),\n ar: (n: number) => (n === 0 ? 1 : n === 1 ? 2 : n === 2 ? 3 : n % 100 >= 3 && n % 100 <= 10 ? 4 : n % 100 >= 11 ? 5 : 6),\n ca: (n: number) => (n !== 1 ? 6 : 2),\n de: (n: number) => (n !== 1 ? 6 : 2),\n es: (n: number) => (n !== 1 ? 6 : 2),\n fa: (n: number) => (n > 1 ? 6 : 2),\n fr: (n: number) => (n > 1 ? 6 : 2),\n id: () => 0,\n it: (n: number) => (n !== 1 ? 6 : 2),\n ko: () => 0,\n ms: () => 0,\n nl: (n: number) => (n !== 1 ? 6 : 2),\n pl: (n: number) => (n === 1 ? 2 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 4 : 5),\n pt_BR: (n: number) => (n > 1 ? 6 : 2),\n ru: (n: number) => (n % 10 === 1 && n % 100 !== 11 ? 2 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 4 : 5),\n tr: (n: number) => (n > 1 ? 6 : 2),\n uk: (n: number) => (n % 10 === 1 && n % 100 !== 11 ? 2 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 4 : 5),\n uz: (n: number) => (n > 1 ? 6 : 2),\n /* eslint-enable max-len */\n};\n\nconst cache = new Map();\n\nlet langPack: ApiLangPack | undefined;\nlet fallbackLangPack: ApiLangPack | undefined;\n\nconst {\n addCallback,\n removeCallback,\n runCallbacks,\n} = createCallbackManager();\n\nexport { addCallback, removeCallback };\n\nlet currentLangCode: string | undefined;\n\nexport const getTranslation: LangFn = (key: string, value?: any, format?: 'i') => {\n if (value !== undefined) {\n const cacheValue = Array.isArray(value) ? JSON.stringify(value) : value;\n const cached = cache.get(`${key}_${cacheValue}_${format}`);\n if (cached) {\n return cached;\n }\n }\n\n if (!langPack && !fallbackLangPack) {\n return key;\n }\n\n const langString = (langPack?.[key]) || (fallbackLangPack?.[key]);\n if (!langString) {\n if (!fallbackLangPack) {\n void importFallbackLangPack();\n }\n\n return key;\n }\n\n return processTranslation(langString, key, value, format);\n};\n\nexport async function getTranslationForLangString(langCode: string, key: string) {\n let translateString = await cacheApi.fetch(\n LANG_CACHE_NAME,\n `${DEFAULT_LANG_PACK}_${langCode}_${key}`,\n cacheApi.Type.Json,\n );\n\n if (!translateString) {\n translateString = await fetchRemoteString(DEFAULT_LANG_PACK, langCode, key);\n }\n\n return processTranslation(translateString, key);\n}\n\nexport async function setLanguage(langCode: LangCode, callback?: NoneToVoidFunction, withFallback = false) {\n if (langPack && langCode === currentLangCode) {\n if (callback) {\n callback();\n }\n\n return;\n }\n\n let newLangPack = await cacheApi.fetch(LANG_CACHE_NAME, langCode, cacheApi.Type.Json);\n if (!newLangPack) {\n if (withFallback) {\n await importFallbackLangPack();\n }\n\n newLangPack = await fetchRemote(langCode);\n if (!newLangPack) {\n return;\n }\n }\n\n cache.clear();\n\n currentLangCode = langCode;\n langPack = newLangPack;\n document.documentElement.lang = langCode;\n\n const { languages } = getGlobal().settings.byKey;\n const langInfo = languages?.find((l) => l.langCode === langCode);\n getTranslation.isRtl = Boolean(langInfo?.rtl);\n getTranslation.code = langCode;\n\n if (callback) {\n callback();\n }\n\n runCallbacks();\n}\n\nasync function importFallbackLangPack() {\n if (fallbackLangPack) {\n return;\n }\n\n fallbackLangPack = (await import('./fallbackLangPack')).default;\n runCallbacks();\n}\n\nasync function fetchRemote(langCode: string): Promise {\n const remote = await callApi('fetchLangPack', { sourceLangPacks: LANG_PACKS, langCode });\n if (remote) {\n await cacheApi.save(LANG_CACHE_NAME, langCode, remote.langPack);\n return remote.langPack;\n }\n\n return undefined;\n}\n\nasync function fetchRemoteString(\n remoteLangPack: typeof LANG_PACKS[number], langCode: string, key: string,\n): Promise {\n const remote = await callApi('fetchLangStrings', {\n langPack: remoteLangPack,\n langCode,\n keys: [key],\n });\n\n if (remote?.length) {\n await cacheApi.save(LANG_CACHE_NAME, `${remoteLangPack}_${langCode}_${key}`, remote[0]);\n\n return remote[0];\n }\n\n return undefined;\n}\n\nfunction getPluralOption(amount: number) {\n const langCode = currentLangCode || DEFAULT_LANG_CODE;\n const optionIndex = PLURAL_RULES[langCode as keyof typeof PLURAL_RULES]\n ? PLURAL_RULES[langCode as keyof typeof PLURAL_RULES](amount)\n : 0;\n\n return PLURAL_OPTIONS[optionIndex];\n}\n\nfunction processTemplate(template: string, value: any) {\n value = Array.isArray(value) ? value : [value];\n const translationSlices = template.split(SUBSTITUTION_REGEX);\n const initialValue = translationSlices.shift();\n\n return translationSlices.reduce((result, str, index) => {\n return `${result}${String(value[index] || '')}${str}`;\n }, initialValue || '');\n}\n\nfunction processTranslation(langString: ApiLangString | undefined, key: string, value?: any, format?: 'i') {\n const template = langString ? langString[typeof value === 'number' ? getPluralOption(value) : 'value'] : undefined;\n if (!template || !template.trim()) {\n const parts = key.split('.');\n\n return parts[parts.length - 1];\n }\n\n if (value !== undefined) {\n const formattedValue = format === 'i' ? formatInteger(value) : value;\n const result = processTemplate(template, formattedValue);\n const cacheValue = Array.isArray(value) ? JSON.stringify(value) : value;\n cache.set(`${key}_${cacheValue}_${format}`, result);\n return result;\n }\n\n return template;\n}\n","export function createCallbackManager() {\n const callbacks: AnyToVoidFunction[] = [];\n\n function addCallback(cb: AnyToVoidFunction) {\n callbacks.push(cb);\n\n return () => {\n removeCallback(cb);\n };\n }\n\n function removeCallback(cb: AnyToVoidFunction) {\n const index = callbacks.indexOf(cb);\n if (index !== -1) {\n callbacks.splice(index, 1);\n }\n }\n\n function runCallbacks(...args: any[]) {\n callbacks.forEach((callback) => {\n callback(...args);\n });\n }\n\n return {\n runCallbacks,\n addCallback,\n removeCallback,\n };\n}\n","const SAMPLE_RATE = 48000;\nconst BIT_DEPTH = 16;\n\nexport async function oggToWav(opusData: Blob): Promise {\n const arrayBuffer = await new Response(opusData).arrayBuffer();\n\n return new Promise((resolve) => {\n const typedArray = new Uint8Array(arrayBuffer);\n\n let decoderWorker: Worker | undefined = new Worker(\n new URL('opus-recorder/dist/decoderWorker.min.js', import.meta.url),\n );\n let wavWorker: Worker | undefined = new Worker(new URL('opus-recorder/dist/waveWorker.min.js', import.meta.url));\n\n decoderWorker.onmessage = (e) => {\n // eslint-disable-next-line no-null/no-null\n if (e.data === null) {\n // `null` means decoder is finished\n wavWorker!.postMessage({ command: 'done' });\n } else {\n // `e.data` contains decoded buffers as float32 values\n wavWorker!.postMessage(\n {\n command: 'encode',\n buffers: e.data,\n },\n e.data.map(({ buffer }: Float32Array) => buffer),\n );\n }\n };\n\n wavWorker.onmessage = (e) => {\n if (e.data.message === 'page') {\n resolve(new Blob([e.data.page], { type: 'audio/wav' }));\n\n decoderWorker!.terminate();\n decoderWorker = undefined;\n wavWorker!.terminate();\n wavWorker = undefined;\n }\n };\n\n wavWorker.postMessage({\n command: 'init',\n wavBitDepth: BIT_DEPTH,\n wavSampleRate: SAMPLE_RATE,\n });\n\n decoderWorker.postMessage({\n command: 'init',\n decoderSampleRate: SAMPLE_RATE,\n outputBufferSampleRate: SAMPLE_RATE,\n });\n\n decoderWorker.postMessage({\n command: 'decode',\n pages: typedArray,\n }, [typedArray.buffer]);\n });\n}\n","import {\n ApiMediaFormat,\n ApiMediaFormatToPrepared,\n ApiOnProgress,\n ApiParsedMedia,\n ApiPreparedMedia,\n} from '../api/types';\n\nimport {\n DEBUG, MEDIA_CACHE_DISABLED, MEDIA_CACHE_NAME, MEDIA_CACHE_NAME_AVATARS,\n} from '../config';\nimport { callApi, cancelApiProgress } from '../api/gramjs';\nimport * as cacheApi from './cacheApi';\nimport { fetchBlob } from './files';\nimport { IS_OPUS_SUPPORTED, IS_PROGRESSIVE_SUPPORTED, isWebpSupported } from './environment';\nimport { oggToWav } from './oggToWav';\nimport { webpToPng } from './webpToPng';\n\nconst asCacheApiType = {\n [ApiMediaFormat.DataUri]: cacheApi.Type.Text,\n [ApiMediaFormat.BlobUrl]: cacheApi.Type.Blob,\n [ApiMediaFormat.Lottie]: cacheApi.Type.Json,\n [ApiMediaFormat.Progressive]: undefined,\n [ApiMediaFormat.Stream]: undefined,\n};\n\nconst PROGRESSIVE_URL_PREFIX = './progressive/';\n\nconst memoryCache = new Map();\nconst fetchPromises = new Map>();\n\nexport function fetch(\n url: string, mediaFormat: T, isHtmlAllowed = false, onProgress?: ApiOnProgress,\n): Promise> {\n if (mediaFormat === ApiMediaFormat.Progressive) {\n return (\n IS_PROGRESSIVE_SUPPORTED\n ? getProgressive(url)\n : fetch(url, ApiMediaFormat.BlobUrl, isHtmlAllowed, onProgress)\n ) as Promise>;\n }\n\n if (!fetchPromises.has(url)) {\n const promise = fetchFromCacheOrRemote(url, mediaFormat, isHtmlAllowed, onProgress)\n .catch((err) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn(err);\n }\n\n return undefined;\n })\n .finally(() => {\n fetchPromises.delete(url);\n });\n\n fetchPromises.set(url, promise);\n }\n\n return fetchPromises.get(url) as Promise>;\n}\n\nexport function getFromMemory(url: string) {\n return memoryCache.get(url) as ApiMediaFormatToPrepared;\n}\n\nexport function cancelProgress(progressCallback: ApiOnProgress) {\n cancelApiProgress(progressCallback);\n}\n\nfunction getProgressive(url: string) {\n const progressiveUrl = `${PROGRESSIVE_URL_PREFIX}${url}`;\n\n memoryCache.set(url, progressiveUrl);\n\n return Promise.resolve(progressiveUrl);\n}\n\nasync function fetchFromCacheOrRemote(\n url: string, mediaFormat: ApiMediaFormat, isHtmlAllowed: boolean, onProgress?: ApiOnProgress,\n) {\n if (!MEDIA_CACHE_DISABLED) {\n const cacheName = url.startsWith('avatar') ? MEDIA_CACHE_NAME_AVATARS : MEDIA_CACHE_NAME;\n const cached = await cacheApi.fetch(cacheName, url, asCacheApiType[mediaFormat]!, isHtmlAllowed);\n if (cached) {\n let media = cached;\n\n if (cached.type === 'audio/ogg' && !IS_OPUS_SUPPORTED) {\n media = await oggToWav(media);\n }\n\n if (cached.type === 'image/webp' && !isWebpSupported() && media) {\n const mediaPng = await webpToPng(url, media);\n if (mediaPng) {\n media = mediaPng;\n }\n }\n\n const prepared = prepareMedia(media);\n\n memoryCache.set(url, prepared);\n\n return prepared;\n }\n }\n\n if (mediaFormat === ApiMediaFormat.Stream) {\n const mediaSource = new MediaSource();\n const streamUrl = URL.createObjectURL(mediaSource);\n let isOpen = false;\n\n mediaSource.addEventListener('sourceopen', () => {\n if (isOpen) {\n return;\n }\n isOpen = true;\n\n const sourceBuffer = mediaSource.addSourceBuffer('audio/mpeg');\n\n void callApi('downloadMedia', { url, mediaFormat }, (progress: number, arrayBuffer: ArrayBuffer) => {\n if (onProgress) {\n onProgress(progress);\n }\n\n if (progress === 1) {\n mediaSource.endOfStream();\n }\n\n if (!arrayBuffer) {\n return;\n }\n\n sourceBuffer.appendBuffer(arrayBuffer!);\n });\n });\n\n memoryCache.set(url, streamUrl);\n return streamUrl;\n }\n\n const remote = await callApi('downloadMedia', { url, mediaFormat, isHtmlAllowed }, onProgress);\n if (!remote) {\n throw new Error('Failed to fetch media');\n }\n\n let { prepared, mimeType } = remote;\n\n if (mimeType === 'audio/ogg' && !IS_OPUS_SUPPORTED) {\n const blob = await fetchBlob(prepared as string);\n URL.revokeObjectURL(prepared as string);\n const media = await oggToWav(blob);\n prepared = prepareMedia(media);\n mimeType = blob.type;\n }\n\n if (mimeType === 'image/webp' && !isWebpSupported()) {\n const blob = await fetchBlob(prepared as string);\n URL.revokeObjectURL(prepared as string);\n const media = await webpToPng(url, blob);\n if (media) {\n prepared = prepareMedia(media);\n }\n }\n\n memoryCache.set(url, prepared);\n\n return prepared;\n}\n\nfunction prepareMedia(mediaData: ApiParsedMedia): ApiPreparedMedia {\n if (mediaData instanceof Blob) {\n return URL.createObjectURL(mediaData);\n }\n\n return mediaData;\n}\n\nif (IS_PROGRESSIVE_SUPPORTED) {\n navigator.serviceWorker.addEventListener('message', async (e) => {\n const { type, messageId, params } = e.data as {\n type: string;\n messageId: string;\n params: { url: string; start: number; end: number };\n };\n\n if (type !== 'requestPart') {\n return;\n }\n\n const result = await callApi('downloadMedia', { mediaFormat: ApiMediaFormat.Progressive, ...params });\n if (!result) {\n return;\n }\n\n const { arrayBuffer, mimeType, fullSize } = result;\n\n navigator.serviceWorker.controller!.postMessage({\n type: 'partResponse',\n messageId,\n result: {\n arrayBuffer,\n mimeType,\n fullSize,\n },\n }, [arrayBuffer!]);\n });\n}\n","export const MEMO_EMPTY_ARRAY = [];\n","import { DEBUG } from '../config';\n\nexport enum Bundles {\n Auth,\n Main,\n Extra,\n}\n\ninterface ImportedBundles {\n [Bundles.Auth]: typeof import('../bundles/auth');\n [Bundles.Main]: typeof import('../bundles/main');\n [Bundles.Extra]: typeof import('../bundles/extra');\n}\n\ntype BundlePromises = {\n [K in keyof ImportedBundles]: Promise\n};\n\nexport type BundleModules = keyof ImportedBundles[B];\n\nconst LOAD_PROMISES: Partial = {};\nconst MEMORY_CACHE: Partial = {};\n\nexport async function loadModule>(bundleName: B, moduleName: M) {\n if (!LOAD_PROMISES[bundleName]) {\n switch (bundleName) {\n case Bundles.Auth:\n LOAD_PROMISES[Bundles.Auth] = import('../bundles/auth');\n break;\n case Bundles.Main:\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START LOAD MAIN BUNDLE');\n }\n\n LOAD_PROMISES[Bundles.Main] = import('../bundles/main');\n break;\n case Bundles.Extra:\n LOAD_PROMISES[Bundles.Extra] = import('../bundles/extra');\n break;\n }\n\n (LOAD_PROMISES[bundleName] as Promise).then(handleBundleLoad);\n }\n\n const bundle = (await LOAD_PROMISES[bundleName]) as unknown as ImportedBundles[B];\n\n if (!MEMORY_CACHE[bundleName]) {\n MEMORY_CACHE[bundleName] = bundle;\n }\n\n return getModuleFromMemory(bundleName, moduleName);\n}\n\nexport function getModuleFromMemory>(bundleName: B, moduleName: M) {\n const bundle = MEMORY_CACHE[bundleName] as ImportedBundles[B];\n\n if (!bundle) {\n return undefined;\n }\n\n return bundle[moduleName];\n}\n\nconst listeners: NoneToVoidFunction[] = [];\n\nexport function addLoadListener(listener: NoneToVoidFunction) {\n if (!listeners.includes(listener)) {\n listeners.push(listener);\n }\n}\n\nfunction handleBundleLoad() {\n listeners.forEach((listener) => {\n listener();\n });\n}\n","import { callApi } from '../api/gramjs';\nimport {\n ApiChat, ApiMediaFormat, ApiMessage, ApiUser,\n} from '../api/types';\nimport { renderActionMessageText } from '../components/common/helpers/renderActionMessageText';\nimport { DEBUG, IS_TEST } from '../config';\nimport { getDispatch, getGlobal, setGlobal } from '../lib/teact/teactn';\nimport {\n getChatAvatarHash,\n getChatTitle,\n getMessageAction,\n getMessageSenderName,\n getMessageSummaryText,\n getPrivateChatUserId,\n isActionMessage,\n isChatChannel,\n selectIsChatMuted, selectShouldShowMessagePreview,\n} from '../modules/helpers';\nimport { getTranslation } from './langProvider';\nimport { addNotifyExceptions, replaceSettings } from '../modules/reducers';\nimport {\n selectChatMessage, selectNotifyExceptions, selectNotifySettings, selectUser,\n} from '../modules/selectors';\nimport { IS_SERVICE_WORKER_SUPPORTED } from './environment';\nimport * as mediaLoader from './mediaLoader';\nimport { debounce } from './schedulers';\n\nfunction getDeviceToken(subscription: PushSubscription) {\n const data = subscription.toJSON();\n return JSON.stringify({\n endpoint: data.endpoint,\n keys: data.keys,\n });\n}\n\nfunction checkIfPushSupported() {\n if (!IS_SERVICE_WORKER_SUPPORTED) return false;\n if (!('showNotification' in ServiceWorkerRegistration.prototype)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] Push notifications aren\\'t supported.');\n }\n return false;\n }\n\n // Check the current Notification permission.\n // If its denied, it's a permanent block until the\n // user changes the permission\n if (Notification.permission === 'denied') {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] The user has blocked push notifications.');\n }\n return false;\n }\n\n // Check if push messaging is supported\n if (!('PushManager' in window)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] Push messaging isn\\'t supported.');\n }\n return false;\n }\n return true;\n}\n\nfunction checkIfNotificationsSupported() {\n // Let's check if the browser supports notifications\n if (!('Notification' in window)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] This browser does not support desktop notification');\n }\n return false;\n }\n\n if (Notification.permission === 'denied' as NotificationPermission) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] The user has blocked push notifications.');\n }\n return false;\n }\n return true;\n}\n\nconst expirationTime = 12 * 60 * 60 * 1000; // 12 hours\n// Notification id is removed from soundPlayed cache after 3 seconds\nconst soundPlayedDelay = 3 * 1000;\nconst soundPlayed = new Set();\n\nasync function playSound(id: number) {\n if (soundPlayed.has(id)) return;\n const { notificationSoundVolume } = selectNotifySettings(getGlobal());\n const volume = notificationSoundVolume / 10;\n if (volume === 0) return;\n\n const audio = new Audio('/notification.mp3');\n audio.volume = volume;\n audio.setAttribute('mozaudiochannel', 'notification');\n audio.addEventListener('ended', () => {\n soundPlayed.add(id);\n }, { once: true });\n\n setTimeout(() => {\n soundPlayed.delete(id);\n }, soundPlayedDelay);\n\n try {\n await audio.play();\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] Unable to play notification sound');\n }\n }\n}\n\nexport const playNotificationSound = debounce(playSound, 1000, true, false);\n\nfunction checkIfShouldResubscribe(subscription: PushSubscription | null) {\n const global = getGlobal();\n if (!global.push || !subscription) return true;\n if (getDeviceToken(subscription) !== global.push.deviceToken) return true;\n return Date.now() - global.push.subscribedAt > expirationTime;\n}\n\nasync function requestPermission() {\n if (!('Notification' in window)) return;\n if (!['granted', 'denied'].includes(Notification.permission)) {\n await Notification.requestPermission();\n }\n}\n\nasync function unsubscribeFromPush(subscription: PushSubscription | null) {\n const global = getGlobal();\n const dispatch = getDispatch();\n if (subscription) {\n try {\n const deviceToken = getDeviceToken(subscription);\n await callApi('unregisterDevice', deviceToken);\n await subscription.unsubscribe();\n dispatch.deleteDeviceToken();\n return;\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[PUSH] Unable to unsubscribe from push.', error);\n }\n }\n }\n if (global.push) {\n await callApi('unregisterDevice', global.push.deviceToken);\n dispatch.deleteDeviceToken();\n }\n}\n\nexport async function unsubscribe() {\n if (!checkIfPushSupported()) return;\n const serviceWorkerRegistration = await navigator.serviceWorker.ready;\n const subscription = await serviceWorkerRegistration.pushManager.getSubscription();\n await unsubscribeFromPush(subscription);\n}\n\n// Indicates if notification settings are loaded from the api\nlet areSettingsLoaded = false;\n\n// Load notification settings from the api\nasync function loadNotificationSettings() {\n if (areSettingsLoaded) return;\n const [resultSettings, resultExceptions] = await Promise.all([\n callApi('fetchNotificationSettings', {\n serverTimeOffset: getGlobal().serverTimeOffset,\n }),\n callApi('fetchNotificationExceptions', {\n serverTimeOffset: getGlobal().serverTimeOffset,\n }),\n ]);\n if (!resultSettings) return;\n\n let global = replaceSettings(getGlobal(), resultSettings);\n if (resultExceptions) {\n global = addNotifyExceptions(global, resultExceptions);\n }\n setGlobal(global);\n areSettingsLoaded = true;\n}\n\nexport async function subscribe() {\n if (!checkIfPushSupported()) {\n // Ask for notification permissions only if service worker notifications are not supported\n // As pushManager.subscribe automatically triggers permission popup\n await requestPermission();\n return;\n }\n const serviceWorkerRegistration = await navigator.serviceWorker.ready;\n let subscription = await serviceWorkerRegistration.pushManager.getSubscription();\n if (!checkIfShouldResubscribe(subscription)) return;\n await unsubscribeFromPush(subscription);\n try {\n subscription = await serviceWorkerRegistration.pushManager.subscribe({\n userVisibleOnly: true,\n });\n const deviceToken = getDeviceToken(subscription);\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[PUSH] Received push subscription: ', deviceToken);\n }\n await callApi('registerDevice', deviceToken);\n getDispatch()\n .setDeviceToken(deviceToken);\n } catch (error) {\n if (Notification.permission === 'denied' as NotificationPermission) {\n // The user denied the notification permission which\n // means we failed to subscribe and the user will need\n // to manually change the notification permission to\n // subscribe to push messages\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] The user has blocked push notifications.');\n }\n } else if (DEBUG) {\n // A problem occurred with the subscription, this can\n // often be down to an issue or lack of the gcm_sender_id\n // and / or gcm_user_visible_only\n // eslint-disable-next-line no-console\n console.log('[PUSH] Unable to subscribe to push.', error);\n\n // Request permissions and fall back to local notifications\n // if pushManager.subscribe was aborted due to invalid VAPID key.\n if (error.code === DOMException.ABORT_ERR) {\n await requestPermission();\n }\n }\n }\n}\n\nfunction checkIfShouldNotify(chat: ApiChat, isActive: boolean) {\n if (!areSettingsLoaded) return false;\n const global = getGlobal();\n const isMuted = selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global));\n if (isMuted || chat.isNotJoined || !chat.isListed) {\n return false;\n }\n // Dont show notification for active chat if client has focus\n return !(isActive && document.hasFocus());\n}\n\nfunction getNotificationContent(chat: ApiChat, message: ApiMessage) {\n const global = getGlobal();\n const {\n senderId,\n replyToMessageId,\n } = message;\n\n const messageSender = senderId ? selectUser(global, senderId) : undefined;\n const messageAction = getMessageAction(message as ApiMessage);\n const actionTargetMessage = messageAction && replyToMessageId\n ? selectChatMessage(global, chat.id, replyToMessageId)\n : undefined;\n const {\n targetUserIds: actionTargetUserIds,\n targetChatId: actionTargetChatId,\n } = messageAction || {};\n\n const actionTargetUsers = actionTargetUserIds\n ? actionTargetUserIds.map((userId) => selectUser(global, userId))\n .filter(Boolean as any)\n : undefined;\n const privateChatUserId = getPrivateChatUserId(chat);\n const privateChatUser = privateChatUserId ? selectUser(global, privateChatUserId) : undefined;\n\n let body: string;\n if (selectShouldShowMessagePreview(chat, selectNotifySettings(global), selectNotifyExceptions(global))) {\n if (isActionMessage(message)) {\n const actionOrigin = chat && (isChatChannel(chat) || message.senderId === message.chatId)\n ? chat\n : messageSender;\n body = renderActionMessageText(\n getTranslation,\n message,\n actionOrigin,\n actionTargetUsers,\n actionTargetMessage,\n actionTargetChatId,\n { asPlain: true },\n ) as string;\n } else {\n const senderName = getMessageSenderName(getTranslation, chat.id, messageSender);\n const summary = getMessageSummaryText(getTranslation, message);\n\n body = senderName ? `${senderName}: ${summary}` : summary;\n }\n } else {\n body = 'New message';\n }\n\n return {\n title: getChatTitle(getTranslation, chat, privateChatUser),\n body,\n };\n}\n\nasync function getAvatar(chat: ApiChat) {\n const imageHash = getChatAvatarHash(chat);\n if (!imageHash) return undefined;\n let mediaData = mediaLoader.getFromMemory(imageHash);\n if (!mediaData) {\n await mediaLoader.fetch(imageHash, ApiMediaFormat.BlobUrl);\n mediaData = mediaLoader.getFromMemory(imageHash);\n }\n return mediaData;\n}\n\nexport async function showNewMessageNotification({\n chat,\n message,\n isActiveChat,\n}: { chat: ApiChat; message: Partial; isActiveChat: boolean }) {\n if (!checkIfNotificationsSupported()) return;\n if (!message.id) return;\n\n await loadNotificationSettings();\n if (!checkIfShouldNotify(chat, isActiveChat)) return;\n\n const {\n title,\n body,\n } = getNotificationContent(chat, message as ApiMessage);\n\n const icon = await getAvatar(chat);\n\n if (checkIfPushSupported()) {\n if (navigator.serviceWorker.controller) {\n // notify service worker about new message notification\n navigator.serviceWorker.controller.postMessage({\n type: 'newMessageNotification',\n payload: {\n title,\n body,\n icon,\n chatId: chat.id,\n messageId: message.id,\n },\n });\n }\n } else {\n const dispatch = getDispatch();\n const options: NotificationOptions = {\n body,\n icon,\n badge: icon,\n tag: message.id.toString(),\n };\n\n if ('vibrate' in navigator) {\n options.vibrate = [200, 100, 200];\n }\n\n const notification = new Notification(title, options);\n\n notification.onclick = () => {\n notification.close();\n dispatch.focusMessage({\n chatId: chat.id,\n messageId: message.id,\n });\n if (window.focus) {\n window.focus();\n }\n };\n\n // Play sound when notification is displayed\n notification.onshow = () => {\n playNotificationSound(message.id || chat.id);\n };\n }\n}\n\nexport function closeMessageNotifications(payload: { chatId: number; lastReadInboxMessageId?: number }) {\n if (IS_TEST || !navigator.serviceWorker.controller) return;\n navigator.serviceWorker.controller.postMessage({\n type: 'closeMessageNotifications',\n payload,\n });\n}\n\n// Notify service worker that client is fully loaded\nexport function notifyClientReady() {\n if (!navigator.serviceWorker.controller) return;\n navigator.serviceWorker.controller.postMessage({\n type: 'clientReady',\n });\n}\n","// This data was received from Telegram Desktop (Telegram/Resources/numbers.txt)\nconst DATA = `AF🇦🇫93Afghanistan333\nAO🇦🇴244Angola333\nAL🇦🇱355Albania234\nAD🇦🇩376Andorra222\nAE🇦🇪971United Arab Emirates234\nAI🇦🇮1264Anguilla34\nAR🇦🇷54Argentina\nAM🇦🇲374Armenia233\nAG🇦🇬1268Antigua and Barbuda34\nAU🇦🇺61Australia333\nAS🇦🇸1684American Samoa34\nAT🇦🇹43Austria\nAW🇦🇼297Aruba34\nAZ🇦🇿994Azerbaijan2322\nBI🇧🇮257Burundi224\nBE🇧🇪32Belgium3222\nBJ🇧🇯229Benin233\nBF🇧🇫226Burkina Faso2222\nBD🇧🇩880Bangladesh\nBG🇧🇬359Bulgaria\nBH🇧🇭973Bahrain44\nBS🇧🇸1242Bahamas34\nBA🇧🇦387Bosnia and Herzegovina\nBY🇧🇾375Belarus2322\nBZ🇧🇿501Belize\nBO🇧🇴591Bolivia134\nBR🇧🇷55Brazil254\nBB🇧🇧1246Barbados34\nBM🇧🇲1441Bermuda34\nBN🇧🇳673Brunei34\nBQ🇧🇶599Bonaire, Sint Eustatius and Saba\nBT🇧🇹975Bhutan\nBW🇧🇼267Botswana233\nCF🇨🇫236Central African Republic2222\nCA🇨🇦1Canada334\nCH🇨🇭41Switzerland234\nCK🇨🇰682Cook Islands\nCL🇨🇱56Chile144\nCN🇨🇳86China344\nCI🇨🇮225Côte d\\`Ivoire233\nCM🇨🇲237Cameroon44\nCD🇨🇩243DR Congo234\nCG🇨🇬242Republic of the Congo234\nCO🇨🇴57Colombia334\nKM🇰🇲269Comoros34\nCV🇨🇻238Cape Verde34\nCR🇨🇷506Costa Rica\nCU🇨🇺53Cuba44\nCY🇨🇾357Cyprus44\nCW🇨🇼599Curaçao\nCZ🇨🇿420Czech Republic\nDE🇩🇪49Germany38\nDJ🇩🇯253Djibouti2222\nDM🇩🇲1767Dominica34\nDK🇩🇰45Denmark44\nDO🇩🇴1Dominican Republic334\nDZ🇩🇿213Algeria3222\nEC🇪🇨593Ecuador\nEG🇪🇬20Egypt234\nER🇪🇷291Eritrea133\nES🇪🇸34Spain333\nEE🇪🇪372Estonia\nET🇪🇹251Ethiopia234\nFI🇫🇮358Finland\nFJ🇫🇯679Fiji\nFK🇫🇰500Falkland Islands\nFM🇫🇲691Micronesia\nFO🇫🇴298Faroe Islands33\nFR🇫🇷33France12222\nGA🇬🇦241Gabon1222\nGB🇬🇧44United Kingdom46\nGE🇬🇪995Georgia\nGF🇬🇫594French Guiana\nGH🇬🇭233Ghana\nGI🇬🇮350Gibraltar44\nGL🇬🇱299Greenland33\nGN🇬🇳224Guinea333\nGM🇬🇲220Gambia34\nGP🇬🇵590Guadeloupe\nGU🇬🇺1671Guam34\nGW🇬🇼245Guinea-Bissau34\nGQ🇬🇶240Equatorial Guinea333\nGR🇬🇷30Greece244\nGD🇬🇩1473Grenada34\nGT🇬🇹502Guatemala134\nGY🇬🇾592Guyana\nHK🇭🇰852Hong Kong\nHN🇭🇳504Honduras44\nHR🇭🇷385Croatia\nHT🇭🇹509Haiti\nHU🇭🇺36Hungary234\nID🇮🇩62Indonesia\nIN🇮🇳91India55\nIO🇩🇬246Diego Garcia34\nIE🇮🇪353Ireland234\nIR🇮🇷98Iran334\nIQ🇮🇶964Iraq334\nIS🇮🇸354Iceland34\nIL🇮🇱972Israel234\nIT🇮🇹39Italy334\nJM🇯🇲1876Jamaica34\nJO🇯🇴962Jordan144\nJP🇯🇵81Japan244\nKZ🇰🇿7Kazakhstan3322\nKE🇰🇪254Kenya333\nKG🇰🇬996Kyrgyzstan\nKH🇰🇭855Cambodia\nKI🇰🇮686Kiribati\nKN🇰🇳1869Saint Kitts and Nevis34\nKR🇰🇷82South Korea\nKW🇰🇼965Kuwait44\nKY🇰🇾1345Cayman Islands34\nLA🇱🇦856Laos\nLB🇱🇧961Lebanon\nLR🇱🇷231Liberia\nLY🇱🇾218Libya234\nLC🇱🇨1758Saint Lucia34\nLI🇱🇮423Liechtenstein\nLK🇱🇰94Sri Lanka234\nLS🇱🇸266Lesotho233\nLT🇱🇹370Lithuania35\nLU🇱🇺352Luxembourg\nLV🇱🇻371Latvia35\nMA🇲🇦212Morocco234\nMC🇲🇨377Monaco44\nMD🇲🇩373Moldova233\nMG🇲🇬261Madagascar2232\nMP🇲🇵1670Northern Mariana Islands34\nMO🇲🇴853Macau\nMS🇲🇸1664Montserrat34\nMV🇲🇻960Maldives\nMX🇲🇽52Mexico\nMH🇲🇭692Marshall Islands\nMK🇲🇰389Macedonia\nML🇲🇱223Mali44\nMT🇲🇹356Malta2222\nMM🇲🇲95Myanmar\nME🇲🇪382Montenegro\nMN🇲🇳976Mongolia\nMZ🇲🇿258Mozambique234\nMQ🇲🇶596Martinique\nMR🇲🇷222Mauritania44\nMU🇲🇺230Mauritius\nMW🇲🇼265Malawi\nMY🇲🇾60Malaysia\nNA🇳🇦264Namibia234\nNC🇳🇨687New Caledonia6\nNE🇳🇪227Niger2222\nNF🇳🇫672Norfolk Island\nNG🇳🇬234Nigeria\nNI🇳🇮505Nicaragua44\nNL🇳🇱31Netherlands12222\nNO🇳🇴47Norway44\nNP🇳🇵977Nepal\nNU🇳🇺683Niue\nNR🇳🇷674Nauru\nNZ🇳🇿64New Zealand\nOM🇴🇲968Oman44\nPK🇵🇰92Pakistan334\nPA🇵🇦507Panama44\nPE🇵🇪51Peru333\nPF🇵🇫689French Polynesia\nPH🇵🇭63Philippines334\nPM🇵🇲508Saint Pierre and Miquelon\nPR🇵🇷1Puerto Rico334\nPS🇵🇸970Palestine324\nPW🇵🇼680Palau\nPG🇵🇬675Papua New Guinea\nPL🇵🇱48Poland333\nKP🇰🇵850North Korea\nPT🇵🇹351Portugal144\nPY🇵🇾595Paraguay333\nQA🇶🇦974Qatar\nRE🇷🇪262Réunion333\nRO🇷🇴40Romania333\nRU🇷🇺7Russia3322\nRW🇷🇼250Rwanda333\nSA🇸🇦966Saudi Arabia\nSD🇸🇩249Sudan234\nSN🇸🇳221Senegal234\nSG🇸🇬65Singapore44\nSH🇸🇭290Saint Helena23\nSH🇸🇭247Saint Helena4\nSB🇸🇧677Solomon Islands\nSL🇸🇱232Sierra Leone233\nSV🇸🇻503El Salvador44\nSM🇸🇲378San Marino334\nSO🇸🇴252Somalia233\nRS🇷🇸381Serbia234\nSS🇸🇸211South Sudan234\nST🇸🇹239São Tomé and Príncipe25\nSR🇸🇷597Suriname34\nSK🇸🇰421Slovakia\nSI🇸🇮386Slovenia\nSE🇸🇪46Sweden234\nSZ🇸🇿268Swaziland44\nSC🇸🇨248Seychelles1222\nSX🇸🇽1721Sint Maarten34\nSY🇸🇾963Syria\nTC🇹🇨1649Turks and Caicos Islands34\nTD🇹🇩235Chad2222\nTG🇹🇬228Togo233\nTH🇹🇭66Thailand144\nTJ🇹🇯992Tajikistan\nTK🇹🇰690Tokelau\nTM🇹🇲993Turkmenistan26\nTL🇹🇱670Timor-Leste\nTO🇹🇴676Tonga\nTT🇹🇹1868Trinidad and Tobago34\nTN🇹🇳216Tunisia233\nTR🇹🇷90Turkey334\nTV🇹🇻688Tuvalu\nTW🇹🇼886Taiwan\nTZ🇹🇿255Tanzania234\nUG🇺🇬256Uganda234\nUA🇺🇦380Ukraine2322\nUY🇺🇾598Uruguay44\nUS🇺🇸1United States334\nUZ🇺🇿998Uzbekistan27\nVA🇻🇦3Vatican City\nVC🇻🇨1784Saint Vincent and the Grenadines34\nVE🇻🇪58Venezuela334\nVG🇻🇬1284British Virgin Islands34\nVI🇻🇮1340US Virgin Islands34\nVN🇻🇳84Vietnam\nVU🇻🇺678Vanuatu\nWF🇼🇫681Wallis and Futuna\nWS🇼🇸685Samoa\nXK🇽🇰383Kosovo44\nYE🇾🇪967Yemen333\nZA🇿🇦27South Africa234\nZM🇿🇲260Zambia234\nZW🇿🇼263Zimbabwe234`;\n\nconst formatsCache: Record = {};\nexport const defaultPhoneNumberFormat = /(\\d{1,3})(\\d{1,3})?(\\d{1,3})?(\\d{1,3})?(\\d{1,3})?/;\n\nconst parsed = DATA\n .split('\\n')\n .map((str) => {\n const id = str.substr(0, 2);\n const flag = str.substr(2, 4);\n const code = `+${str.match(/\\d+/)![0]}`;\n const name = str.split(/\\d+/)[1];\n const format = str.match(/\\d+$/);\n const phoneFormat = getPhoneNumberFormat(format);\n\n return {\n id, flag, code, name, phoneFormat,\n };\n });\n\nfunction getPhoneNumberFormat(format: RegExpMatchArray | null) {\n if (!format) {\n return defaultPhoneNumberFormat;\n }\n\n const formatValue = format[0] as string;\n let phoneNumberFormat;\n\n if (!formatsCache[formatValue]) {\n const phoneNumberGroups = formatValue.split('').map(Number);\n phoneNumberFormat = phoneNumberGroups.reduce((result, count, i) => {\n return `${result}(\\\\d{1,${count}})${i > 0 ? '?' : ''}`;\n }, '');\n formatsCache[formatValue] = new RegExp(`${phoneNumberFormat}${'()?'.repeat(5 - phoneNumberGroups.length)}`);\n }\n\n return formatsCache[formatValue];\n}\n\nexport default parsed;\n","import countryList, { defaultPhoneNumberFormat } from './countries';\n\nexport function getCountryById(id: string) {\n return countryList.find((c) => c.id === id) as Country;\n}\n\n// Empty groups are used to preserve 5 callback arguments for `replace` method\nfunction getPhoneNumberFormat(country?: Country) {\n return country ? country.phoneFormat : defaultPhoneNumberFormat;\n}\n\nexport function getCountryFromPhoneNumber(input: string) {\n let phoneNumber = input.replace(/[^\\d+]+/g, '');\n if (!phoneNumber.startsWith('+')) {\n phoneNumber = `+${phoneNumber}`;\n }\n\n const possibleCountries = countryList\n .filter((country: Country) => phoneNumber.startsWith(country.code))\n .sort((a, b) => a.code.length - b.code.length);\n\n return possibleCountries[possibleCountries.length - 1];\n}\n\nexport function formatPhoneNumber(input: string, country?: Country) {\n let phoneNumber = input.replace(/[^\\d]+/g, '');\n if (country) {\n phoneNumber = phoneNumber.substr(country.code.length - 1);\n } else if (input.startsWith('+')) {\n return input;\n }\n\n phoneNumber = phoneNumber.replace(getPhoneNumberFormat(country), (_, p1, p2, p3, p4, p5) => {\n const separator = country && country.id === 'GB' ? ' ' : '-';\n\n let output = '';\n if (p1) output = `${p1}`;\n if (p2) output += ` ${p2}`;\n if (p3) output += `${separator}${p3}`;\n if (p4) output += `${separator}${p4}`;\n if (p5) output += `${separator}${p5}`;\n return output;\n });\n\n return phoneNumber;\n}\n\nexport function formatPhoneNumberWithCode(phoneNumber: string) {\n const numberWithPlus = phoneNumber.startsWith('+') ? phoneNumber : `+${phoneNumber}`;\n const country = getCountryFromPhoneNumber(numberWithPlus);\n if (!country) {\n return numberWithPlus;\n }\n return `${country.code} ${formatPhoneNumber(numberWithPlus, country)}`;\n}\n\nexport { countryList };\n","type Scheduler =\n typeof requestAnimationFrame\n | typeof onTickEnd\n | typeof runNow;\n\nexport function debounce(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n shouldRunLast = true,\n) {\n let waitingTimeout: number | undefined;\n\n return (...args: Parameters) => {\n if (waitingTimeout) {\n clearTimeout(waitingTimeout);\n waitingTimeout = undefined;\n } else if (shouldRunFirst) {\n // @ts-ignore\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n waitingTimeout = self.setTimeout(() => {\n if (shouldRunLast) {\n // @ts-ignore\n fn(...args);\n }\n\n waitingTimeout = undefined;\n }, ms);\n };\n}\n\nexport function throttle(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n) {\n let interval: number | undefined;\n let isPending: boolean;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n isPending = true;\n args = _args;\n\n if (!interval) {\n if (shouldRunFirst) {\n isPending = false;\n // @ts-ignore\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n interval = self.setInterval(() => {\n if (!isPending) {\n // eslint-disable-next-line no-restricted-globals\n self.clearInterval(interval!);\n interval = undefined;\n return;\n }\n\n isPending = false;\n // @ts-ignore\n fn(...args);\n }, ms);\n }\n };\n}\n\nexport function throttleWithRaf(fn: F) {\n return throttleWith(fastRaf, fn);\n}\n\nexport function throttleWithPrimaryRaf(fn: F) {\n return throttleWith(fastPrimaryRaf, fn);\n}\n\nexport function throttleWithTickEnd(fn: F) {\n return throttleWith(onTickEnd, fn);\n}\n\nexport function throttleWithNow(fn: F) {\n return throttleWith(runNow, fn);\n}\n\nexport function throttleWith(schedulerFn: Scheduler, fn: F) {\n let waiting = false;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n args = _args;\n\n if (!waiting) {\n waiting = true;\n\n schedulerFn(() => {\n waiting = false;\n // @ts-ignore\n fn(...args);\n });\n }\n };\n}\n\nexport function onTickEnd(cb: NoneToVoidFunction) {\n Promise.resolve().then(cb);\n}\n\nexport function onIdle(cb: NoneToVoidFunction) {\n // eslint-disable-next-line no-restricted-globals\n if (self.requestIdleCallback) {\n // eslint-disable-next-line no-restricted-globals\n self.requestIdleCallback(cb);\n } else {\n onTickEnd(cb);\n }\n}\n\nfunction runNow(fn: NoneToVoidFunction) {\n fn();\n}\n\nexport const pause = (ms: number) => new Promise((resolve) => {\n setTimeout(() => resolve(), ms);\n});\n\nexport function rafPromise() {\n return new Promise((resolve) => {\n fastRaf(resolve);\n });\n}\n\nlet fastRafCallbacks: NoneToVoidFunction[] | undefined;\nlet fastRafPrimaryCallbacks: NoneToVoidFunction[] | undefined;\n\n// May result in an immediate execution if called from another `requestAnimationFrame` callback\nexport function fastRaf(callback: NoneToVoidFunction, isPrimary = false) {\n if (!fastRafCallbacks) {\n fastRafCallbacks = isPrimary ? [] : [callback];\n fastRafPrimaryCallbacks = isPrimary ? [callback] : [];\n\n requestAnimationFrame(() => {\n const currentCallbacks = fastRafCallbacks!;\n const currentPrimaryCallbacks = fastRafPrimaryCallbacks!;\n fastRafCallbacks = undefined;\n fastRafPrimaryCallbacks = undefined;\n currentPrimaryCallbacks.forEach((cb) => cb());\n currentCallbacks.forEach((cb) => cb());\n });\n } else if (isPrimary) {\n fastRafPrimaryCallbacks!.push(callback);\n } else {\n fastRafCallbacks.push(callback);\n }\n}\n\nexport function fastPrimaryRaf(callback: NoneToVoidFunction) {\n fastRaf(callback, true);\n}\n\nlet beforeUnloadCallbacks: NoneToVoidFunction[] | undefined;\n\nexport function onBeforeUnload(callback: NoneToVoidFunction, isLast = false) {\n if (!beforeUnloadCallbacks) {\n beforeUnloadCallbacks = [];\n // eslint-disable-next-line no-restricted-globals\n self.addEventListener('beforeunload', () => {\n beforeUnloadCallbacks!.forEach((cb) => cb());\n });\n }\n\n if (isLast) {\n beforeUnloadCallbacks.push(callback);\n } else {\n beforeUnloadCallbacks.unshift(callback);\n }\n\n return () => {\n beforeUnloadCallbacks = beforeUnloadCallbacks!.filter((cb) => cb !== callback);\n };\n}\n","let RE_NOT_LETTER: RegExp;\n\ntry {\n RE_NOT_LETTER = new RegExp('[^\\\\p{L}\\\\p{M}]+', 'ui');\n} catch (e) {\n // Support for older versions of firefox\n RE_NOT_LETTER = new RegExp('[^\\\\wа-яё]+', 'i');\n}\n\nexport default function searchWords(haystack: string, needle: string) {\n if (!haystack || !needle) {\n return false;\n }\n\n const haystackWords = haystack.toLowerCase().split(RE_NOT_LETTER);\n const needleWords = needle.toLowerCase().split(RE_NOT_LETTER);\n\n return needleWords.every((needleWord) => (\n haystackWords.some((haystackWord) => haystackWord.startsWith(needleWord))\n ));\n}\n","export const getServerTime = (serverTimeOffset: number) => {\n return Math.floor(Date.now() / 1000) + serverTimeOffset;\n};\n","import safariFix from 'safari-14-idb-fix';\n\nfunction promisifyRequest(request) {\n return new Promise((resolve, reject) => {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-ignore - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\nfunction createStore(dbName, storeName) {\n const dbp = safariFix().then(() => {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n return promisifyRequest(request);\n });\n return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));\n}\nlet defaultGetStoreFunc;\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore('keyval-store', 'keyval');\n }\n return defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction get(key, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => promisifyRequest(store.get(key)));\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction set(key, value, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic – if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction setMany(entries, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n entries.forEach((entry) => store.put(entry[1], entry[0]));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction getMany(keys, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => Promise.all(keys.map((key) => promisifyRequest(store.get(key)))));\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction update(key, updater, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => \n // Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise((resolve, reject) => {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n }\n catch (err) {\n reject(err);\n }\n };\n }));\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction del(key, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction clear(customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\nfunction eachCursor(customStore, callback) {\n return customStore('readonly', (store) => {\n // This would be store.getAllKeys(), but it isn't supported by Edge or Safari.\n // And openKeyCursor isn't supported by Safari.\n store.openCursor().onsuccess = function () {\n if (!this.result)\n return;\n callback(this.result);\n this.result.continue();\n };\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction keys(customStore = defaultGetStore()) {\n const items = [];\n return eachCursor(customStore, (cursor) => items.push(cursor.key)).then(() => items);\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction values(customStore = defaultGetStore()) {\n const items = [];\n return eachCursor(customStore, (cursor) => items.push(cursor.value)).then(() => items);\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction entries(customStore = defaultGetStore()) {\n const items = [];\n return eachCursor(customStore, (cursor) => items.push([cursor.key, cursor.value])).then(() => items);\n}\n\nexport { clear, createStore, del, entries, get, getMany, keys, promisifyRequest, set, setMany, update, values };\n","/**\n * https://bugs.webkit.org/show_bug.cgi?id=226547\n * Safari has a horrible bug where IDB requests can hang while the browser is starting up.\n * The only solution is to keep nudging it until it's awake.\n * This probably creates garbage, but garbage is better than totally failing.\n */\nfunction idbReady() {\n const isSafari = !navigator.userAgentData &&\n /Safari\\//.test(navigator.userAgent) &&\n !/Chrom(e|ium)\\//.test(navigator.userAgent);\n // No point putting other browsers or older versions of Safari through this mess.\n if (!isSafari || !indexedDB.databases)\n return Promise.resolve();\n let intervalId;\n return new Promise((resolve) => {\n const tryIdb = () => indexedDB.databases().finally(resolve);\n intervalId = setInterval(tryIdb, 100);\n tryIdb();\n }).finally(() => clearInterval(intervalId));\n}\n\nexport default idbReady;\n","import * as idb from 'idb-keyval';\n\nimport { ApiSessionData } from '../api/types';\n\nimport { DEBUG, LEGACY_SESSION_KEY, SESSION_USER_KEY } from '../config';\nimport * as cacheApi from './cacheApi';\n\nconst DC_IDS = [1, 2, 3, 4, 5];\n\nexport function hasStoredSession(withLegacy = false) {\n if (withLegacy && localStorage.getItem(LEGACY_SESSION_KEY)) {\n return true;\n }\n\n const userAuthJson = localStorage.getItem(SESSION_USER_KEY);\n if (!userAuthJson) return false;\n\n try {\n const userAuth = JSON.parse(userAuthJson);\n return Boolean(userAuth && userAuth.id && userAuth.dcID);\n } catch (err) {\n // Do nothing.\n return false;\n }\n}\n\nexport function storeSession(sessionData: ApiSessionData, currentUserId?: number) {\n const { mainDcId, keys, hashes } = sessionData;\n\n localStorage.setItem(SESSION_USER_KEY, JSON.stringify({ dcID: mainDcId, id: currentUserId }));\n localStorage.setItem('dc', String(mainDcId));\n Object.keys(keys).map(Number).forEach((dcId) => {\n localStorage.setItem(`dc${dcId}_auth_key`, JSON.stringify(keys[dcId]));\n });\n Object.keys(hashes).map(Number).forEach((dcId) => {\n localStorage.setItem(`dc${dcId}_hash`, JSON.stringify(hashes[dcId]));\n });\n}\n\nexport function clearStoredSession() {\n [\n SESSION_USER_KEY,\n 'dc',\n ...DC_IDS.map((dcId) => `dc${dcId}_auth_key`),\n ...DC_IDS.map((dcId) => `dc${dcId}_hash`),\n ].forEach((key) => {\n localStorage.removeItem(key);\n });\n}\n\nexport function loadStoredSession(): ApiSessionData | undefined {\n if (!hasStoredSession()) {\n return undefined;\n }\n\n const userAuth = JSON.parse(localStorage.getItem(SESSION_USER_KEY)!);\n const mainDcId = Number(userAuth.dcID);\n const keys: Record = {};\n const hashes: Record = {};\n\n DC_IDS.forEach((dcId) => {\n try {\n const key = localStorage.getItem(`dc${dcId}_auth_key`);\n if (key) {\n keys[dcId] = JSON.parse(key);\n }\n\n const hash = localStorage.getItem(`dc${dcId}_hash`);\n if (hash) {\n hashes[dcId] = JSON.parse(hash);\n }\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('Failed to load stored session', err);\n }\n // Do nothing.\n }\n });\n\n if (!Object.keys(keys).length) return undefined;\n\n return {\n mainDcId,\n keys,\n hashes,\n };\n}\n\nexport async function importLegacySession() {\n const sessionId = localStorage.getItem(LEGACY_SESSION_KEY);\n if (!sessionId) return;\n\n const sessionJson = await idb.get(`GramJs:${sessionId}`);\n try {\n const sessionData = JSON.parse(sessionJson) as ApiSessionData;\n storeSession(sessionData);\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('Failed to load legacy session', err);\n }\n // Do nothing.\n }\n}\n\n// Remove previously created IndexedDB and cache API sessions\nexport async function clearLegacySessions() {\n localStorage.removeItem(LEGACY_SESSION_KEY);\n\n const idbKeys = await idb.keys();\n\n await Promise.all>([\n cacheApi.clear('GramJs'),\n ...idbKeys\n .filter((k) => typeof k === 'string' && k.startsWith('GramJs:GramJs-session-'))\n .map((k) => idb.del(k)),\n ]);\n}\n\nexport function importTestSession() {\n const sessionJson = process.env.TEST_SESSION!;\n try {\n const sessionData = JSON.parse(sessionJson) as ApiSessionData & { userId: number };\n storeSession(sessionData, sessionData.userId);\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('Failed to load test session', err);\n }\n // Do nothing.\n }\n}\n","import { ISettings } from '../types';\n\nimport { animateSingle } from './animation';\n\nimport themeColors from '../styles/themes.json';\n\ntype RGBAColor = {\n r: number;\n g: number;\n b: number;\n a?: number;\n};\n\nlet isInitialized = false;\n\nconst HEX_COLOR_REGEX = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})?$/i;\nconst DURATION_MS = 200;\nconst ENABLE_ANIMATION_DELAY_MS = 500;\n\nconst lerp = (start: number, end: number, interpolationRatio: number) => {\n return (1 - interpolationRatio) * start + interpolationRatio * end;\n};\n\nconst colors = (Object.keys(themeColors) as Array).map((property) => ({\n property,\n colors: [hexToRgb(themeColors[property][0]), hexToRgb(themeColors[property][1])],\n}));\n\nexport default (theme: ISettings['theme'], withAnimation: boolean) => {\n const isDarkTheme = theme === 'dark';\n const shouldAnimate = isInitialized && withAnimation;\n const startIndex = isDarkTheme ? 0 : 1;\n const endIndex = isDarkTheme ? 1 : 0;\n const startAt = Date.now();\n const themeColorTag = document.querySelector('meta[name=\"theme-color\"]');\n\n document.documentElement.classList.remove(`theme-${isDarkTheme ? 'light' : 'dark'}`);\n if (isInitialized) {\n document.documentElement.classList.add('no-animations');\n }\n document.documentElement.classList.add(`theme-${theme}`);\n if (themeColorTag) {\n themeColorTag.setAttribute('content', isDarkTheme ? '#212121' : '#fff');\n }\n\n setTimeout(() => {\n document.documentElement.classList.remove('no-animations');\n }, ENABLE_ANIMATION_DELAY_MS);\n\n isInitialized = true;\n\n if (shouldAnimate) {\n animateSingle(() => {\n const t = Math.min((Date.now() - startAt) / DURATION_MS, 1);\n\n applyColorAnimationStep(startIndex, endIndex, transition(t));\n\n return t < 1;\n });\n } else {\n applyColorAnimationStep(startIndex, endIndex);\n }\n};\n\nfunction transition(t: number) {\n return 1 - ((1 - t) ** 3.5);\n}\n\nfunction hexToRgb(hex: string): RGBAColor {\n const result = HEX_COLOR_REGEX.exec(hex)!;\n\n return {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16),\n a: result[4] !== undefined ? parseInt(result[4], 16) : undefined,\n };\n}\n\nfunction applyColorAnimationStep(startIndex: number, endIndex: number, interpolationRatio: number = 1) {\n colors.forEach(({ property, colors: propertyColors }) => {\n const r = Math.round(lerp(propertyColors[startIndex].r, propertyColors[endIndex].r, interpolationRatio));\n const g = Math.round(lerp(propertyColors[startIndex].g, propertyColors[endIndex].g, interpolationRatio));\n const b = Math.round(lerp(propertyColors[startIndex].b, propertyColors[endIndex].b, interpolationRatio));\n const a = propertyColors[startIndex].a !== undefined\n ? Math.round(lerp(propertyColors[startIndex].a!, propertyColors[endIndex].a!, interpolationRatio))\n : undefined;\n\n document.documentElement.style.setProperty(property, a !== undefined\n ? `rgba(${r},${g},${b},${a / 255})`\n : `rgb(${r},${g},${b})`);\n });\n}\n","import EMOJI_REGEX from \"../lib/twemojiRegex\";\nimport { fixNonStandardEmoji } from \"./emoji\";\n\nexport function formatInteger(value: number) {\n return String(value).replace(/\\d(?=(\\d{3})+$)/g, '$& ');\n}\n\nfunction formatFixedNumber(number: number) {\n const fixed = String(number.toFixed(1));\n if (fixed.substr(-2) === '.0') {\n return Math.round(number);\n }\n\n return number.toFixed(1).replace('.', ',');\n}\n\nexport function formatIntegerCompact(views: number) {\n if (views < 1e3) {\n return views;\n }\n\n if (views < 1e6) {\n return `${formatFixedNumber(views / 1e3)}K`;\n }\n\n return `${formatFixedNumber(views / 1e6)}M`;\n}\n\nexport function getFirstLetters(phrase: string, count = 2) {\n return phrase\n .replace(/[.,!@#$%^&*()_+=\\-`~[\\]/\\\\{}:\"|<>?]+/gi, '')\n .trim()\n .split(/\\s+/)\n .slice(0, count)\n .map((word: string) => {\n if (!word.length) return '';\n word = fixNonStandardEmoji(word);\n const emojis = word.match(EMOJI_REGEX);\n if (emojis && word.startsWith(emojis[0])) {\n return emojis[0];\n }\n return word.match(/./u)![0].toUpperCase()\n })\n .join('');\n}\n","const DEFAULT_MAX_TEXT_LENGTH = 30;\n\nexport default function trimText(text: string | undefined, length = DEFAULT_MAX_TEXT_LENGTH) {\n if (!text || text.length <= length) {\n return text;\n }\n\n return `${text.substr(0, length)}...`;\n}\n","import { isWebpSupported } from './environment';\nimport { dataUriToBlob, blobToDataUri } from './files';\nimport { pause } from './schedulers';\n\nconst WORKER_INITIALIZATION_TIMEOUT = 2000;\n\nlet canvas: HTMLCanvasElement;\nlet worker: IWebpWorker;\n\nexport const EMPTY_IMAGE_DATA_URI = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk'\n + 'YAAAAAYAAjCB0C8AAAAASUVORK5CYII=';\n\nexport async function webpToPng(url: string, blob: Blob): Promise {\n initWebpWorker();\n\n while (!worker.wasmReady) {\n await pause(WORKER_INITIALIZATION_TIMEOUT);\n }\n\n const { result, width, height } = await getDecodePromise(url, blob);\n if (!width || !height) {\n return undefined;\n }\n\n return createPng({ result, width, height });\n}\n\nexport async function webpToPngBase64(key: string, url: string): Promise {\n if (isWebpSupported() || url.substr(0, 15) !== 'data:image/webp') {\n return url;\n }\n\n initWebpWorker();\n\n const pngBlob = await webpToPng(key, dataUriToBlob(url));\n\n if (!pngBlob) {\n throw new Error(`Can't convert webp to png. Url: ${url}`);\n }\n\n return blobToDataUri(pngBlob);\n}\n\nfunction initWebpWorker() {\n if (!worker) {\n worker = new Worker(new URL('../lib/webp/webp_wasm.worker.js', import.meta.url)) as IWebpWorker;\n worker.wasmReady = false;\n worker.onmessage = handleLibWebpMessage;\n }\n}\n\nfunction createPng({ result, width, height }: TEncodedImage): Promise {\n if (!canvas) {\n canvas = document.createElement('canvas');\n }\n\n return new Promise((resolve) => {\n const img = new ImageData(result, width, height);\n\n canvas.width = width;\n canvas.height = height;\n const ctx = canvas.getContext('2d')!;\n ctx.putImageData(img, 0, 0);\n\n canvas.toBlob((blob) => {\n resolve(blob ?? undefined);\n }, 'image/png', 1);\n });\n}\n\nfunction handleLibWebpMessage(e: MessageEvent) {\n const { id } = e.data;\n switch (e.data.type) {\n case 'initialized': {\n worker.wasmReady = true;\n break;\n }\n\n case 'result': {\n if (worker.requests.has(id)) {\n const resolve = worker.requests.get(id)!;\n\n worker.requests.delete(id);\n resolve(e.data!);\n }\n break;\n }\n }\n}\n\nfunction getDecodePromise(url: string, blob: Blob): Promise {\n return new Promise((resolve) => {\n if (!worker.requests) {\n worker.requests = new Map();\n }\n\n worker.requests.set(url, resolve);\n worker.postMessage({ id: url, blob });\n });\n}\n","import { APP_VERSION, DEBUG } from '../config';\nimport { getGlobal } from '../lib/teact/teactn';\nimport { hasStoredSession } from './sessions';\n\nconst WEBSYNC_URLS = [\n 't.me',\n 'telegram.me',\n].map((domain) => `//${domain}/_websync_?`);\nconst WEBSYNC_VERSION = `${APP_VERSION} Z`;\nconst WEBSYNC_KEY = 'tgme_sync';\nconst WEBSYNC_TIMEOUT = 86400;\n\nconst getTs = () => {\n return Math.floor(Number(new Date()) / 1000);\n};\n\nconst saveSync = (authed: boolean) => {\n const ts = getTs();\n localStorage.setItem(WEBSYNC_KEY, JSON.stringify({\n canRedirect: authed,\n ts,\n }));\n};\n\nlet lastTimeout: NodeJS.Timeout | undefined;\n\nexport const forceWebsync = (authed: boolean) => {\n const currentTs = getTs();\n\n const { canRedirect, ts } = JSON.parse(localStorage.getItem(WEBSYNC_KEY) || '{}');\n\n if (canRedirect !== authed || ts + WEBSYNC_TIMEOUT <= currentTs) {\n return Promise.all(WEBSYNC_URLS.map((url) => {\n return new Promise((resolve, reject) => {\n const script = document.createElement('script');\n\n const removeElement = () => !!document.body.removeChild(script);\n\n script.src = url + new URLSearchParams({\n authed: Number(authed).toString(),\n version: WEBSYNC_VERSION,\n });\n\n document.body.appendChild(script);\n\n script.onload = () => {\n saveSync(authed);\n removeElement();\n if (lastTimeout) {\n clearTimeout(lastTimeout);\n lastTimeout = undefined;\n }\n startWebsync();\n resolve();\n };\n\n script.onerror = () => {\n removeElement();\n reject();\n };\n });\n }));\n } else {\n return Promise.resolve();\n }\n};\n\nexport function startWebsync() {\n if (DEBUG) {\n return;\n }\n\n if (lastTimeout !== undefined) return;\n const currentTs = getTs();\n\n const { ts } = JSON.parse(localStorage.getItem(WEBSYNC_KEY) || '{}');\n\n const timeout = WEBSYNC_TIMEOUT - (currentTs - ts);\n\n lastTimeout = setTimeout(() => {\n const { authState } = getGlobal();\n\n const authed = authState === 'authorizationStateReady' || hasStoredSession(true);\n forceWebsync(authed);\n }, Math.max(0, timeout * 1000));\n}\n","import { throttle } from './schedulers';\nimport {\n MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT,\n MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH,\n MOBILE_SCREEN_MAX_WIDTH,\n} from '../config';\nimport { IS_IOS, IS_SINGLE_COLUMN_LAYOUT } from './environment';\n\ntype IDimensions = {\n width: number;\n height: number;\n};\n\nconst IS_LANDSCAPE = IS_SINGLE_COLUMN_LAYOUT && isLandscape();\n\nconst initialHeight = window.innerHeight;\nlet windowSize = updateSizes();\nlet isRefreshDisabled = false;\n\nfunction disableRefresh() {\n isRefreshDisabled = true;\n}\n\nfunction enableRefresh() {\n isRefreshDisabled = false;\n}\n\nconst handleResize = throttle(() => {\n windowSize = updateSizes();\n\n if (!isRefreshDisabled && (\n isMobileScreen() !== IS_SINGLE_COLUMN_LAYOUT\n || (IS_SINGLE_COLUMN_LAYOUT && IS_LANDSCAPE !== isLandscape())\n )) {\n window.location.reload();\n }\n}, 250, true);\n\nwindow.addEventListener('resize', handleResize);\nwindow.addEventListener('orientationchange', handleResize);\n\nexport function updateSizes(): IDimensions {\n const vh = window.innerHeight * 0.01;\n\n document.documentElement.style.setProperty('--vh', `${vh}px`);\n\n return {\n width: window.innerWidth,\n height: window.innerHeight,\n };\n}\n\nfunction isMobileScreen() {\n return windowSize.width <= MOBILE_SCREEN_MAX_WIDTH || (\n windowSize.width <= MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH && windowSize.height <= MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT\n );\n}\n\nfunction isLandscape() {\n if (IS_IOS) {\n return window.matchMedia('(orientation: landscape)').matches;\n }\n\n // eslint-disable-next-line max-len\n // Source: https://web.archive.org/web/20160509220835/http://blog.abouthalf.com/development/orientation-media-query-challenges-in-android-browsers/\n // Feature is marked as deprecated now, but it is still supported\n // https://developer.mozilla.org/en-US/docs/Web/CSS/@media/device-aspect-ratio#browser_compatibility\n return window.matchMedia('screen and (min-device-aspect-ratio: 1/1) and (orientation: landscape)').matches;\n}\n\nexport default {\n get: () => windowSize,\n getIsKeyboardVisible: () => initialHeight > windowSize.height,\n disableRefresh,\n enableRefresh,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".\" + {\"99\":\"f03a947e6e336feffec8\",\"133\":\"89ca9055166cf90beaa7\",\"161\":\"286d0207d962142ad548\",\"347\":\"e76314e5520fe6e65783\",\"354\":\"66350c1e61029fbd6ca7\",\"433\":\"29f542772c88e944d938\",\"472\":\"21e5264f606f2b525030\",\"484\":\"40f6759b976ebb12ec3f\",\"501\":\"72ce4b6e27f459e194cd\",\"514\":\"c2aea8c517396debc7b4\",\"524\":\"157e5943ba0ef80e2cdd\",\"536\":\"55dc7dd4ab42a2c9f037\",\"745\":\"9316c5c2b711c39a20a5\",\"915\":\"8fb9f0f20311fa368dc5\",\"941\":\"997469720d84a3a8a3f7\",\"993\":\"f0aad9f6787f211b4e51\"}[chunkId] + \".js\";\n};","// This function allow to reference all chunks\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".\" + {\"133\":\"89ca9055166cf90beaa7\",\"347\":\"e76314e5520fe6e65783\",\"433\":\"29f542772c88e944d938\",\"472\":\"21e5264f606f2b525030\",\"484\":\"40f6759b976ebb12ec3f\"}[chunkId] + \".css\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tfor(moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) var result = runtime(__webpack_require__);\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkIds[i]] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunktelegram_t\"] = self[\"webpackChunktelegram_t\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","import { DEBUG } from '../config';\nimport { getDispatch } from '../lib/teact/teactn';\nimport { IS_ANDROID, IS_IOS, IS_SERVICE_WORKER_SUPPORTED } from './environment';\nimport { notifyClientReady, playNotificationSound } from './notifications';\n\ntype WorkerAction = {\n type: string;\n payload: Record;\n};\n\nfunction handleWorkerMessage(e: MessageEvent) {\n const action: WorkerAction = e.data;\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] Message from worker', action);\n }\n if (!action.type) return;\n const dispatch = getDispatch();\n switch (action.type) {\n case 'focusMessage':\n if (dispatch.focusMessage) {\n dispatch.focusMessage(action.payload);\n }\n break;\n case 'playNotificationSound':\n playNotificationSound(action.payload.id);\n break;\n }\n}\n\nfunction subscribeToWorker() {\n navigator.serviceWorker.removeEventListener('message', handleWorkerMessage);\n navigator.serviceWorker.addEventListener('message', handleWorkerMessage);\n // Notify web worker that client is ready to receive messages\n notifyClientReady();\n}\n\nif (IS_SERVICE_WORKER_SUPPORTED) {\n window.addEventListener('load', async () => {\n try {\n await navigator.serviceWorker.register(new URL('../serviceWorker.ts', import.meta.url));\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] ServiceWorker registered');\n }\n\n await navigator.serviceWorker.ready;\n\n if (navigator.serviceWorker.controller) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] ServiceWorker ready');\n }\n subscribeToWorker();\n } else {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('[SW] ServiceWorker not available');\n }\n\n if (!IS_IOS && !IS_ANDROID) {\n getDispatch().showDialog({ data: { message: 'SERVICE_WORKER_DISABLED', hasErrorKey: true } });\n }\n }\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('[SW] ServiceWorker registration failed: ', err);\n }\n }\n });\n window.addEventListener('focus', async () => {\n await navigator.serviceWorker.ready;\n subscribeToWorker();\n });\n}\n","import { GlobalState } from './types';\nimport { NewChatMembersProgress } from '../types';\n\nimport {\n ANIMATION_LEVEL_DEFAULT, DARK_THEME_PATTERN_COLOR, DEFAULT_MESSAGE_TEXT_SIZE_PX, DEFAULT_PATTERN_COLOR,\n IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX, MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX,\n} from '../config';\nimport { IS_IOS, IS_MAC_OS } from '../util/environment';\n\nexport const INITIAL_STATE: GlobalState = {\n isLeftColumnShown: true,\n isChatInfoShown: false,\n newChatMembersProgress: NewChatMembersProgress.Closed,\n uiReadyState: 0,\n serverTimeOffset: 0,\n\n authRememberMe: true,\n\n blocked: {\n ids: [],\n totalCount: 0,\n },\n\n users: {\n byId: {},\n },\n\n chats: {\n listIds: {},\n isFullyLoaded: {},\n orderedPinnedIds: {},\n totalCount: {},\n byId: {},\n },\n\n messages: {\n byChatId: {},\n messageLists: [],\n },\n\n scheduledMessages: {\n byChatId: {},\n },\n\n chatFolders: {\n byId: {},\n activeChatFolder: 0,\n },\n\n fileUploads: {\n byMessageLocalId: {},\n },\n\n recentEmojis: ['grinning', 'kissing_heart', 'christmas_tree', 'brain', 'trophy'],\n\n stickers: {\n setsById: {},\n added: {},\n recent: {\n stickers: [],\n },\n favorite: {\n stickers: [],\n },\n greeting: {\n stickers: [],\n },\n featured: {\n setIds: [],\n },\n search: {},\n forEmoji: {},\n },\n\n emojiKeywords: {},\n\n gifs: {\n saved: {},\n search: {},\n },\n\n inlineBots: {\n isLoading: false,\n byUsername: {},\n },\n\n globalSearch: {},\n\n userSearch: {},\n\n localTextSearch: {\n byChatThreadKey: {},\n },\n\n localMediaSearch: {\n byChatId: {},\n },\n\n management: {\n byChatId: {},\n },\n\n topPeers: {},\n\n topInlineBots: {},\n\n mediaViewer: {},\n\n audioPlayer: {},\n\n forwardMessages: {},\n\n pollResults: {},\n\n payment: {},\n\n notifications: [],\n\n dialogs: [],\n\n activeSessions: [],\n\n settings: {\n byKey: {\n theme: 'light',\n shouldUseSystemTheme: true,\n messageTextSize: IS_IOS\n ? IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX\n : (IS_MAC_OS ? MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX : DEFAULT_MESSAGE_TEXT_SIZE_PX),\n animationLevel: ANIMATION_LEVEL_DEFAULT,\n messageSendKeyCombo: 'enter',\n shouldAutoDownloadMediaFromContacts: true,\n shouldAutoDownloadMediaInPrivateChats: true,\n shouldAutoDownloadMediaInGroups: true,\n shouldAutoDownloadMediaInChannels: true,\n hasWebNotifications: true,\n hasPushNotifications: true,\n notificationSoundVolume: 5,\n shouldAutoPlayGifs: true,\n shouldAutoPlayVideos: true,\n shouldSuggestStickers: true,\n shouldLoopStickers: true,\n language: 'en',\n },\n themes: {\n light: {\n isBlurred: true,\n patternColor: DEFAULT_PATTERN_COLOR,\n },\n dark: {\n isBlurred: true,\n patternColor: DARK_THEME_PATTERN_COLOR,\n },\n },\n privacy: {},\n notifyExceptions: {},\n },\n\n twoFaSettings: {},\n\n shouldShowContextMenuHint: true,\n};\n","import {\n addCallback, addReducer, getGlobal, removeCallback,\n} from '../lib/teact/teactn';\n\nimport { GlobalState } from './types';\nimport { MAIN_THREAD_ID } from '../api/types';\n\nimport { onBeforeUnload, onIdle, throttle } from '../util/schedulers';\nimport {\n DEBUG,\n GLOBAL_STATE_CACHE_DISABLED,\n GLOBAL_STATE_CACHE_KEY,\n GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n GLOBAL_STATE_CACHE_USER_LIST_LIMIT,\n} from '../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../util/environment';\nimport { ANIMATION_END_EVENT, ANIMATION_START_EVENT } from '../hooks/useHeavyAnimationCheck';\nimport { pick } from '../util/iteratees';\nimport { selectCurrentMessageList } from '../modules/selectors';\nimport { hasStoredSession } from '../util/sessions';\nimport { INITIAL_STATE } from './initial';\n\nconst UPDATE_THROTTLE = 5000;\n\nconst updateCacheThrottled = throttle(() => onIdle(updateCache), UPDATE_THROTTLE, false);\n\nlet isCaching = false;\nlet isHeavyAnimating = false;\nlet unsubscribeFromBeforeUnload: NoneToVoidFunction | undefined;\n\nsetupHeavyAnimationListeners();\n\nexport function initCache() {\n if (GLOBAL_STATE_CACHE_DISABLED) {\n return;\n }\n\n addReducer('saveSession', () => {\n if (isCaching) {\n return;\n }\n\n setupCaching();\n });\n\n addReducer('reset', () => {\n localStorage.removeItem(GLOBAL_STATE_CACHE_KEY);\n\n if (!isCaching) {\n return;\n }\n\n clearCaching();\n });\n}\n\nexport function loadCache(initialState: GlobalState) {\n if (GLOBAL_STATE_CACHE_DISABLED) {\n return undefined;\n }\n\n if (hasStoredSession(true)) {\n setupCaching();\n\n return readCache(initialState);\n } else {\n clearCaching();\n\n return undefined;\n }\n}\n\nfunction setupCaching() {\n isCaching = true;\n unsubscribeFromBeforeUnload = onBeforeUnload(updateCache, true);\n window.addEventListener('blur', updateCache);\n addCallback(updateCacheThrottled);\n}\n\nfunction clearCaching() {\n isCaching = false;\n removeCallback(updateCacheThrottled);\n window.removeEventListener('blur', updateCache);\n if (unsubscribeFromBeforeUnload) {\n unsubscribeFromBeforeUnload();\n }\n}\n\nfunction readCache(initialState: GlobalState) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.time('global-state-cache-read');\n }\n\n const json = localStorage.getItem(GLOBAL_STATE_CACHE_KEY);\n const cached = json ? JSON.parse(json) as GlobalState : undefined;\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.timeEnd('global-state-cache-read');\n }\n\n if (cached) {\n // Pre-fill defaults in nested objects which may be missing in older cache\n cached.settings.byKey = {\n ...initialState.settings.byKey,\n ...cached.settings.byKey,\n };\n cached.settings.themes = {\n ...initialState.settings.themes,\n ...cached.settings.themes,\n };\n cached.chatFolders = {\n ...initialState.chatFolders,\n ...cached.chatFolders,\n };\n\n if (!cached.messages.messageLists) {\n cached.messages.messageLists = initialState.messages.messageLists;\n }\n\n if (!cached.stickers.greeting) {\n cached.stickers.greeting = initialState.stickers.greeting;\n }\n }\n\n return {\n ...initialState,\n ...cached,\n };\n}\n\nfunction updateCache() {\n if (!isCaching || isHeavyAnimating) {\n return;\n }\n\n const global = getGlobal();\n\n if (global.isLoggingOut) {\n return;\n }\n\n const reducedGlobal: GlobalState = {\n ...INITIAL_STATE,\n ...pick(global, [\n 'authState',\n 'authPhoneNumber',\n 'authRememberMe',\n 'authNearestCountry',\n 'currentUserId',\n 'contactList',\n 'topPeers',\n 'topInlineBots',\n 'recentEmojis',\n 'push',\n 'shouldShowContextMenuHint',\n ]),\n isChatInfoShown: reduceShowChatInfo(global),\n users: reduceUsers(global),\n chats: reduceChats(global),\n messages: reduceMessages(global),\n globalSearch: {\n recentlyFoundChatIds: global.globalSearch.recentlyFoundChatIds,\n },\n settings: reduceSettings(global),\n chatFolders: reduceChatFolders(global),\n };\n\n const json = JSON.stringify(reducedGlobal);\n localStorage.setItem(GLOBAL_STATE_CACHE_KEY, json);\n}\n\nfunction reduceShowChatInfo(global: GlobalState): boolean {\n return window.innerWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n ? global.isChatInfoShown\n : false;\n}\n\nfunction reduceUsers(global: GlobalState): GlobalState['users'] {\n const { users: { byId, selectedId } } = global;\n const idsToSave = [\n ...(global.chats.listIds.active || []).slice(0, GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT).filter((cid) => cid > 0),\n ...Object.keys(byId),\n ].slice(0, GLOBAL_STATE_CACHE_USER_LIST_LIMIT);\n\n return {\n byId: pick(byId, idsToSave as number[]),\n selectedId: window.innerWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN ? selectedId : undefined,\n };\n}\n\nfunction reduceChats(global: GlobalState): GlobalState['chats'] {\n const chatIdsToSave = [\n ...(global.chats.listIds.active || []).slice(0, GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT),\n ];\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n\n return {\n ...global.chats,\n byId: pick(global.chats.byId, currentChatId ? [...chatIdsToSave, currentChatId] : chatIdsToSave),\n listIds: {\n active: chatIdsToSave,\n },\n isFullyLoaded: {},\n orderedPinnedIds: {\n active: global.chats.orderedPinnedIds.active,\n },\n };\n}\n\nfunction reduceMessages(global: GlobalState): GlobalState['messages'] {\n const byChatId: GlobalState['messages']['byChatId'] = {};\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n\n const chatIdsToSave = [\n ...(global.chats.listIds.active || []).slice(0, GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT),\n ...(currentChatId ? [currentChatId] : []),\n ];\n chatIdsToSave.forEach((chatId) => {\n const current = global.messages.byChatId[chatId];\n if (!current) {\n return;\n }\n\n const mainThread = current.threadsById[MAIN_THREAD_ID];\n if (!mainThread || !mainThread.viewportIds) {\n return;\n }\n\n byChatId[chatId] = {\n byId: pick(current.byId, mainThread.viewportIds),\n threadsById: {\n [MAIN_THREAD_ID]: mainThread,\n },\n };\n });\n\n const currentMessageList = selectCurrentMessageList(global);\n\n return {\n byChatId,\n messageLists: !currentMessageList || IS_SINGLE_COLUMN_LAYOUT ? [] : [{\n ...currentMessageList,\n threadId: MAIN_THREAD_ID,\n type: 'thread',\n }],\n };\n}\n\nfunction reduceSettings(global: GlobalState): GlobalState['settings'] {\n const { byKey, themes } = global.settings;\n\n return {\n byKey,\n themes,\n privacy: {},\n notifyExceptions: {},\n };\n}\n\nfunction reduceChatFolders(global: GlobalState): GlobalState['chatFolders'] {\n return {\n ...global.chatFolders,\n activeChatFolder: 0,\n };\n}\n\nfunction setupHeavyAnimationListeners() {\n document.addEventListener(ANIMATION_START_EVENT, () => {\n isHeavyAnimating = true;\n });\n document.addEventListener(ANIMATION_END_EVENT, () => {\n isHeavyAnimating = false;\n });\n}\n","import { addReducer } from '../lib/teact/teactn';\n\nimport { INITIAL_STATE } from './initial';\nimport { initCache, loadCache } from './cache';\nimport { cloneDeep } from '../util/iteratees';\n\ninitCache();\n\naddReducer('init', () => {\n const initial = cloneDeep(INITIAL_STATE);\n return loadCache(initial) || initial;\n});\n","const STORAGE_KEY = 'tt-active-tab';\nconst INTERVAL = 2000;\n\nconst tabKey = String(Date.now() + Math.random());\n\nlocalStorage.setItem(STORAGE_KEY, tabKey);\n\nlet callback: NoneToVoidFunction;\n\nconst interval = window.setInterval(() => {\n if (callback && localStorage.getItem(STORAGE_KEY) !== tabKey) {\n callback();\n clearInterval(interval);\n }\n}, INTERVAL);\n\nexport function addActiveTabChangeListener(_callback: NoneToVoidFunction) {\n callback = _callback;\n}\n","const SITE_FONTS = ['400 1em Roboto', '500 1em Roboto'];\n\nexport default function preloadFonts() {\n if ('fonts' in document) {\n return Promise.all(SITE_FONTS.map((font) => document.fonts.load(font)));\n }\n\n return undefined;\n}\n","import React, { FC, useEffect } from '../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMediaFormat } from '../../api/types';\nimport { GlobalActions, GlobalState } from '../../global/types';\n\nimport { getChatAvatarHash } from '../../modules/helpers/chats'; // Direct import for better module splitting\nimport useFlag from '../../hooks/useFlag';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport { pause } from '../../util/schedulers';\nimport { preloadImage } from '../../util/files';\nimport preloadFonts from '../../util/fonts';\nimport * as mediaLoader from '../../util/mediaLoader';\nimport { Bundles, loadModule } from '../../util/moduleLoader';\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\n\nimport './UiLoader.scss';\n\n// @ts-ignore\nimport telegramLogoPath from '../../assets/telegram-logo.svg';\n// @ts-ignore\nimport monkeyPath from '../../assets/monkey.svg';\nimport { selectIsRightColumnShown, selectTheme } from '../../modules/selectors';\n\ntype OwnProps = {\n page: 'main' | 'authCode' | 'authPassword' | 'authPhoneNumber' | 'authQrCode';\n children: any;\n};\n\ntype StateProps = Pick & {\n hasCustomBackground?: boolean;\n hasCustomBackgroundColor: boolean;\n isRightColumnShown?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst MAX_PRELOAD_DELAY = 700;\nconst SECOND_STATE_DELAY = 1000;\nconst AVATARS_TO_PRELOAD = 10;\n\nfunction preloadAvatars() {\n const { listIds, byId } = getGlobal().chats;\n if (!listIds.active) {\n return undefined;\n }\n\n return Promise.all(listIds.active.slice(0, AVATARS_TO_PRELOAD).map((chatId) => {\n const chat = byId[chatId];\n if (!chat) {\n return undefined;\n }\n\n const avatarHash = getChatAvatarHash(chat);\n if (!avatarHash) {\n return undefined;\n }\n\n return mediaLoader.fetch(avatarHash, ApiMediaFormat.DataUri);\n }));\n}\n\nconst preloadTasks = {\n main: () => Promise.all([\n loadModule(Bundles.Main, 'Main')\n .then(preloadFonts),\n preloadAvatars(),\n ]),\n authPhoneNumber: () => Promise.all([\n preloadFonts(),\n preloadImage(telegramLogoPath),\n ]),\n authCode: () => preloadImage(monkeyPath),\n authPassword: () => preloadImage(monkeyPath),\n authQrCode: preloadFonts,\n};\n\nconst UiLoader: FC = ({\n page,\n children,\n hasCustomBackground,\n hasCustomBackgroundColor,\n isRightColumnShown,\n shouldSkipHistoryAnimations,\n setIsUiReady,\n}) => {\n const [isReady, markReady] = useFlag();\n const {\n shouldRender: shouldRenderMask, transitionClassNames,\n } = useShowTransition(!isReady, undefined, true);\n\n useEffect(() => {\n let timeout: number | undefined;\n\n const safePreload = async () => {\n try {\n await preloadTasks[page]();\n } catch (err) {\n // Do nothing\n }\n };\n\n Promise.race([\n pause(MAX_PRELOAD_DELAY),\n safePreload(),\n ]).then(() => {\n markReady();\n setIsUiReady({ uiReadyState: 1 });\n\n timeout = window.setTimeout(() => {\n setIsUiReady({ uiReadyState: 2 });\n }, SECOND_STATE_DELAY);\n });\n\n return () => {\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n }\n\n setIsUiReady({ uiReadyState: 0 });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n

\n {children}\n {shouldRenderMask && !shouldSkipHistoryAnimations && (\n
\n {page === 'main' ? (\n <>\n
\n \n {isRightColumnShown &&
}\n \n ) : (\n
\n )}\n
\n )}\n
\n );\n};\n\nexport default withGlobal(\n (global): StateProps => {\n const theme = selectTheme(global);\n const { background, backgroundColor } = global.settings.themes[theme] || {};\n\n return {\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n uiReadyState: global.uiReadyState,\n hasCustomBackground: Boolean(background),\n hasCustomBackgroundColor: Boolean(backgroundColor),\n isRightColumnShown: selectIsRightColumnShown(global),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['setIsUiReady']),\n)(UiLoader);\n","import * as langProvider from '../util/langProvider';\nimport { useState } from '../lib/teact/teact';\n\nexport default (langCode: string | undefined, key: string): string | undefined => {\n const [translation, setTranslation] = useState();\n\n if (langCode) {\n langProvider\n .getTranslationForLangString(langCode, key)\n .then(setTranslation);\n }\n\n return translation;\n};\n","import { LangCode } from '../../../types';\n\nexport function getSuggestedLanguage() {\n let suggestedLanguage = navigator.language;\n\n if (suggestedLanguage && suggestedLanguage !== 'pt-br') {\n suggestedLanguage = suggestedLanguage.substr(0, 2);\n }\n\n return suggestedLanguage as LangCode;\n}\n","import React, {\n FC, useState, memo, useCallback, useRef,\n} from '../../lib/teact/teact';\n\nimport { ANIMATION_END_DELAY } from '../../config';\nimport { countryList } from '../../util/phoneNumber';\nimport searchWords from '../../util/searchWords';\nimport buildClassName from '../../util/buildClassName';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport DropdownMenu from '../ui/DropdownMenu';\nimport MenuItem from '../ui/MenuItem';\nimport Spinner from '../ui/Spinner';\n\nimport './CountryCodeInput.scss';\n\ntype OwnProps = {\n id: string;\n value?: Country;\n isLoading?: boolean;\n onChange: (value: Country) => void;\n};\n\nconst MENU_HIDING_DURATION = 200 + ANIMATION_END_DELAY;\nconst SELECT_TIMEOUT = 50;\n\nconst CountryCodeInput: FC = ({\n id,\n value,\n isLoading,\n onChange,\n}) => {\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n\n const [filter, setFilter] = useState();\n const [filteredList, setFilteredList] = useState(countryList);\n\n function updateFilter(filterValue?: string) {\n setFilter(filterValue);\n setFilteredList(getFilteredList(filterValue));\n }\n\n const handleChange = useCallback((e: React.SyntheticEvent) => {\n const { countryId } = (e.currentTarget.firstElementChild as HTMLDivElement).dataset;\n const country = countryList.find((c) => c.id === countryId);\n\n if (country) {\n onChange(country);\n }\n\n setTimeout(() => updateFilter(undefined), MENU_HIDING_DURATION);\n }, [onChange]);\n\n const handleInput = useCallback((e: React.FormEvent) => {\n updateFilter(e.currentTarget.value);\n }, []);\n\n const handleInputKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.keyCode !== 8) {\n return;\n }\n\n const target = e.currentTarget;\n if (value && filter === undefined) {\n target.value = '';\n }\n\n updateFilter(target.value);\n }, [filter, value]);\n\n const CodeInput: FC<{ onTrigger: () => void; isOpen?: boolean }> = ({ onTrigger, isOpen }) => {\n const handleTrigger = () => {\n if (isOpen) {\n return;\n }\n\n setTimeout(() => {\n inputRef.current!.select();\n }, SELECT_TIMEOUT);\n\n onTrigger();\n\n const formEl = document.getElementById('auth-phone-number-form')!;\n formEl.scrollTo({ top: formEl.scrollHeight, behavior: 'smooth' });\n };\n\n const inputValue = filter !== undefined\n ? filter\n : (value?.name) || '';\n\n return (\n
\n \n \n {isLoading ? (\n \n ) : (\n \n )}\n
\n );\n };\n\n return (\n \n {filteredList.map((country: Country) => (\n \n \n {renderText(country.flag, ['hq_emoji'])}\n {country.name}\n {country.code}\n \n ))}\n {!filteredList.length && (\n \n {lang('lng_country_none')}\n \n )}\n \n );\n};\n\nfunction getFilteredList(filter = ''): Country[] {\n return filter.length\n ? countryList.filter((country) => searchWords(country.name, filter))\n : countryList;\n}\n\nexport default memo(CountryCodeInput);\n","import { ChangeEvent } from 'react';\n\n// @ts-ignore\nimport monkeyPath from '../../assets/monkey.svg';\n\nimport React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { LangCode } from '../../types';\n\nimport { IS_SAFARI, IS_TOUCH_ENV } from '../../util/environment';\nimport { preloadImage } from '../../util/files';\nimport preloadFonts from '../../util/fonts';\nimport { pick } from '../../util/iteratees';\nimport { formatPhoneNumber, getCountryById, getCountryFromPhoneNumber } from '../../util/phoneNumber';\nimport { setLanguage } from '../../util/langProvider';\nimport useLang from '../../hooks/useLang';\nimport useFlag from '../../hooks/useFlag';\nimport useLangString from '../../hooks/useLangString';\nimport { getSuggestedLanguage } from './helpers/getSuggestedLanguage';\n\nimport Button from '../ui/Button';\nimport Checkbox from '../ui/Checkbox';\nimport InputText from '../ui/InputText';\nimport Loading from '../ui/Loading';\nimport CountryCodeInput from './CountryCodeInput';\n\ntype StateProps = Pick & {\n language?: LangCode;\n};\ntype DispatchProps = Pick;\n\nconst MIN_NUMBER_LENGTH = 7;\n\nlet isPreloadInitiated = false;\n\nconst AuthPhoneNumber: FC = ({\n connectionState,\n authState,\n authPhoneNumber,\n authIsLoading,\n authIsLoadingQrCode,\n authError,\n authRememberMe,\n authNearestCountry,\n language,\n setAuthPhoneNumber,\n setAuthRememberMe,\n loadNearestCountry,\n clearAuthError,\n goToAuthQrCode,\n setSettingOption,\n}) => {\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const suggestedLanguage = getSuggestedLanguage();\n\n const continueText = useLangString(suggestedLanguage, 'ContinueOnThisLanguage');\n const [country, setCountry] = useState();\n const [phoneNumber, setPhoneNumber] = useState();\n const [isTouched, setIsTouched] = useState(false);\n const [lastSelection, setLastSelection] = useState<[number, number] | undefined>();\n const [isLoading, markIsLoading, unmarkIsLoading] = useFlag();\n\n const fullNumber = country ? `${country.code} ${phoneNumber || ''}` : phoneNumber;\n const canSubmit = fullNumber && fullNumber.replace(/[^\\d]+/g, '').length >= MIN_NUMBER_LENGTH;\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n inputRef.current!.focus();\n }\n }, [country]);\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady' && !authNearestCountry) {\n loadNearestCountry();\n }\n }, [connectionState, authNearestCountry, loadNearestCountry]);\n\n useEffect(() => {\n if (authNearestCountry && !country && !isTouched) {\n setCountry(getCountryById(authNearestCountry));\n }\n }, [country, authNearestCountry, isTouched]);\n\n const parseFullNumber = useCallback((newFullNumber: string) => {\n if (!newFullNumber.length) {\n setPhoneNumber('');\n }\n\n const suggestedCountry = getCountryFromPhoneNumber(newFullNumber);\n\n // Any phone numbers should be allowed, in some cases ignoring formatting\n const selectedCountry = !country\n || (suggestedCountry && suggestedCountry.id !== country.id)\n || (!suggestedCountry && newFullNumber.length)\n ? suggestedCountry\n : country;\n\n if (!country || !selectedCountry || (selectedCountry && selectedCountry.code !== country.code)) {\n setCountry(selectedCountry);\n }\n\n setPhoneNumber(formatPhoneNumber(newFullNumber, selectedCountry));\n }, [country]);\n\n const handleLangChange = useCallback(() => {\n markIsLoading();\n\n void setLanguage(suggestedLanguage, () => {\n unmarkIsLoading();\n\n setSettingOption({ language: suggestedLanguage });\n });\n }, [markIsLoading, setSettingOption, suggestedLanguage, unmarkIsLoading]);\n\n useEffect(() => {\n if (phoneNumber === undefined && authPhoneNumber) {\n parseFullNumber(authPhoneNumber);\n }\n }, [authPhoneNumber, phoneNumber, parseFullNumber]);\n\n useLayoutEffect(() => {\n if (inputRef.current && lastSelection) {\n inputRef.current.setSelectionRange(...lastSelection);\n }\n }, [lastSelection]);\n\n const isJustPastedRef = useRef(false);\n const handlePaste = useCallback(() => {\n isJustPastedRef.current = true;\n requestAnimationFrame(() => {\n isJustPastedRef.current = false;\n });\n }, []);\n\n const handlePhoneNumberChange = useCallback((e: ChangeEvent) => {\n if (authError) {\n clearAuthError();\n }\n\n // This is for further screens. We delay it until user input to speed up the initial loading.\n if (!isPreloadInitiated) {\n isPreloadInitiated = true;\n preloadFonts();\n void preloadImage(monkeyPath);\n }\n\n const { value, selectionStart, selectionEnd } = e.target;\n setLastSelection(\n selectionStart && selectionEnd && selectionEnd < value.length\n ? [selectionStart, selectionEnd]\n : undefined,\n );\n\n setIsTouched(true);\n\n const shouldFixSafariAutoComplete = (\n IS_SAFARI && country && fullNumber !== undefined\n && value.length - fullNumber.length > 1 && !isJustPastedRef.current\n );\n parseFullNumber(shouldFixSafariAutoComplete ? `${country!.code} ${value}` : value);\n }, [authError, clearAuthError, country, fullNumber, parseFullNumber]);\n\n const handleKeepSessionChange = useCallback((e: ChangeEvent) => {\n setAuthRememberMe(e.target.checked);\n }, [setAuthRememberMe]);\n\n function handleSubmit(event: React.FormEvent) {\n event.preventDefault();\n\n if (authIsLoading) {\n return;\n }\n\n if (canSubmit) {\n setAuthPhoneNumber({ phoneNumber: fullNumber });\n }\n }\n\n const isAuthReady = authState === 'authorizationStateWaitPhoneNumber';\n\n return (\n
\n
\n
\n

Telegram

\n

{lang('StartText')}

\n
\n \n \n \n {canSubmit && (\n isAuthReady ? (\n \n ) : (\n \n )\n )}\n {isAuthReady && (\n \n )}\n {suggestedLanguage && suggestedLanguage !== language && continueText && (\n \n )}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n settings: { byKey: { language } },\n } = global;\n\n return {\n ...pick(global, [\n 'connectionState',\n 'authState',\n 'authPhoneNumber',\n 'authIsLoading',\n 'authIsLoadingQrCode',\n 'authError',\n 'authRememberMe',\n 'authNearestCountry',\n ]),\n language,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setAuthPhoneNumber',\n 'setAuthRememberMe',\n 'clearAuthError',\n 'loadNearestCountry',\n 'goToAuthQrCode',\n 'setSettingOption',\n ]),\n)(AuthPhoneNumber));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst AuthCodeAsync: FC = () => {\n const AuthCode = useModuleLoader(Bundles.Auth, 'AuthCode');\n\n return AuthCode ? : ;\n};\n\nexport default memo(AuthCodeAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst AuthPasswordAsync: FC = () => {\n const AuthPassword = useModuleLoader(Bundles.Auth, 'AuthPassword');\n\n return AuthPassword ? : ;\n};\n\nexport default memo(AuthPasswordAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst AuthRegisterAsync: FC = () => {\n const AuthRegister = useModuleLoader(Bundles.Auth, 'AuthRegister');\n\n return AuthRegister ? : ;\n};\n\nexport default memo(AuthRegisterAsync);\n","/*\n jquery-qrcode v0.14.0 - https://larsjung.de/jquery-qrcode/ */\n'use strict';let G=null;class H{}H.render=function(w,B){G(w,B)};self.QrCreator=H;\n(function(w){function B(t,c,a,e){var b={},h=w(a,c);h.u(t);h.J();e=e||0;var r=h.h(),d=h.h()+2*e;b.text=t;b.level=c;b.version=a;b.O=d;b.a=function(b,a){b-=e;a-=e;return 0>b||b>=r||0>a||a>=r?!1:h.a(b,a)};return b}function C(t,c,a,e,b,h,r,d,g,x){function u(b,a,f,c,d,r,g){b?(t.lineTo(a+r,f+g),t.arcTo(a,f,c,d,h)):t.lineTo(a,f)}r?t.moveTo(c+h,a):t.moveTo(c,a);u(d,e,a,e,b,-h,0);u(g,e,b,c,b,0,-h);u(x,c,b,c,a,h,0);u(r,c,a,e,a,0,h)}function z(t,c,a,e,b,h,r,d,g,x){function u(b,a,c,d){t.moveTo(b+c,a);t.lineTo(b,\na);t.lineTo(b,a+d);t.arcTo(b,a,b+c,a,h)}r&&u(c,a,h,h);d&&u(e,a,-h,h);g&&u(e,b,-h,-h);x&&u(c,b,h,-h)}function A(t,c){var a=c.fill;if(\"string\"===typeof a)t.fillStyle=a;else{var e=a.type,b=a.colorStops;a=a.position.map((b)=>Math.round(b*c.size));if(\"linear-gradient\"===e)var h=t.createLinearGradient.apply(t,a);else if(\"radial-gradient\"===e)h=t.createRadialGradient.apply(t,a);else throw Error(\"Unsupported fill\");b.forEach(([b,a])=>{h.addColorStop(b,a)});t.fillStyle=h}}function y(t,c){a:{var a=c.text,e=\nc.v,b=c.N,h=c.K,r=c.P;b=Math.max(1,b||1);for(h=Math.min(40,h||40);b<=h;b+=1)try{var d=B(a,e,b,r);break a}catch(J){}d=void 0}if(!d)return null;a=t.getContext(\"2d\");c.background&&(a.fillStyle=c.background,a.fillRect(c.left,c.top,c.size,c.size));e=d.O;h=c.size/e;a.beginPath();for(r=0;r>>7-b%8&1)},put:function(b,h){for(var a=0;a>>h-a-1&1))},f:function(){return a},m:function(b){var h=Math.floor(a/8);c.length<=h&&c.push(0);b&&(c[h]|=128>>>a%8);a+=1}};return e}function C(c,a){function e(b,h){for(var a=-1;7>=a;a+=1)if(!(-1>=b+a||d<=b+a))for(var c=-1;7>=c;c+=1)-1>=h+c||d<=h+c||(r[b+a][h+c]=0<=a&&6>=a&&(0==c||6==c)||0<=c&&6>=c&&(0==a||6==a)||2<=a&&4>=a&&2<=c&&4>=c?!0:!1)}function b(b,a){for(var f=d=4*c+17,k=Array(f),m=0;m<\nf;m+=1){k[m]=Array(f);for(var p=0;p=n;n+=1)for(var l=-2;2>=l;l+=1)r[p+n][q+l]=-2==n||2==n||-2==l||2==l||0==n&&0==l}for(f=8;fk;k+=1)m=!b&&1==(f>>k&1),r[6>k?k:8>k?k+1:d-15+k][8]=m,r[8][8>k?d-k-1:9>k?15-k:14-k]=m;r[d-8][8]=!b;if(7<=\nc){f=y.A(c);for(k=0;18>k;k+=1)m=!b&&1==(f>>k&1),r[Math.floor(k/3)][k%3+d-8-3]=m;for(k=0;18>k;k+=1)m=!b&&1==(f>>k&1),r[k%3+d-8-3][Math.floor(k/3)]=m}if(null==g){b=t.I(c,h);f=B();for(k=0;k8*m)throw Error(\"code length overflow. (\"+f.f()+\">\"+8*m+\")\");for(f.f()+4<=8*m&&f.put(0,4);0!=f.f()%8;)f.m(!1);for(;!(f.f()>=8*m);){f.put(236,8);if(f.f()>=8*m)break;f.put(17,8)}var u=0;m=k=0;p=Array(b.length);\nq=Array(b.length);for(n=0;nn;n+=1)null==r[k][q-n]&&(l=!1,p>>m&1)),a(k,q-n)&&(l=!l),r[k][q-n]=l,--m,-1==m&&(p+=1,m=7));k+=f;if(0>k||d<=k){k-=f;f=-f;break}}}var h=A[a],r=null,d=0,g=null,x=[],u={u:function(b){b=w(b);x.push(b);g=null},a:function(b,a){if(0>b||d<=b||0>a||d<=a)throw Error(b+\",\"+a);return r[b][a]},h:function(){return d},J:function(){for(var a=0,h=0,c=0;8>c;c+=1){b(!0,c);var d=y.D(u);if(0==c||a>d)a=d,h=c}b(!1,h)}};return u}\nfunction z(c,a){if(\"undefined\"==typeof c.length)throw Error(c.length+\"/\"+a);var e=function(){for(var b=0;bb.b()-a.b())return b;for(var c=v.g(b.c(0))-v.g(a.c(0)),h=Array(b.b()),\ng=0;gb?a.push(b):2048>b?a.push(192|b>>6,128|b&63):55296>b||57344<=b?a.push(224|b>>12,128|b>>6&63,128|b&63):(e++,b=65536+((b&1023)<<10|c.charCodeAt(e)&1023),a.push(240|b>>18,128|b>>12&63,128|b>>6&63,128|b&63))}return a};var A={L:1,M:0,Q:3,H:2},y=function(){function c(b){for(var a=0;0!=b;)a+=1,b>>>=1;return a}var a=[[],[6,18],\n[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],\n[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],e={w:function(b){for(var a=b<<10;0<=c(a)-c(1335);)a^=1335<a||40a?8:16},D:function(b){for(var a=b.h(),c=0,\nd=0;d=p;p+=1)if(!(0>d+p||a<=d+p))for(var q=-1;1>=q;q+=1)0>g+q||a<=g+q||(0!=p||0!=q)&&t==b.a(d+p,g+q)&&(e+=1);5e;e+=1)c[e]=1<e;e+=1)c[e]=c[e-4]^c[e-5]^c[e-6]^c[e-8];for(e=0;255>e;e+=1)a[c[e]]=e;return{g:function(b){if(1>b)throw Error(\"glog(\"+b+\")\");return a[b]},i:function(b){for(;0>b;)b+=255;for(;256<=b;)b-=255;return c[b]}}}(),t=function(){function c(b,c){switch(c){case A.L:return a[4*\n(b-1)];case A.M:return a[4*(b-1)+1];case A.Q:return a[4*(b-1)+2];case A.H:return a[4*(b-1)+3]}}var a=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,\n2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,\n45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,\n151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],\n[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],\n[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e={I:function(b,a){var e=c(b,a);if(\"undefined\"==\ntypeof e)throw Error(\"bad rs block @ typeNumber:\"+b+\"/errorCorrectLevel:\"+a);b=e.length/3;a=[];for(var d=0;d & {\n language?: LangCode;\n};\ntype DispatchProps = Pick;\n\nconst DATA_PREFIX = 'tg://login?token=';\n\nconst AuthCode: FC = ({\n connectionState,\n authState,\n authQrCode,\n language,\n returnToAuthPhoneNumber,\n setSettingOption,\n}) => {\n const suggestedLanguage = getSuggestedLanguage();\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const qrCodeRef = useRef(null);\n const continueText = useLangString(suggestedLanguage, 'ContinueOnThisLanguage');\n const [isLoading, markIsLoading, unmarkIsLoading] = useFlag();\n\n useEffect(() => {\n if (!authQrCode || connectionState !== 'connectionStateReady') {\n return;\n }\n\n const container = qrCodeRef.current!;\n\n container.innerHTML = '';\n container.classList.remove('pre-animate');\n\n QrCreator.render({\n text: `${DATA_PREFIX}${authQrCode.token}`,\n radius: 0.5,\n ecLevel: 'M',\n fill: '#4E96D4',\n size: 280,\n }, container);\n }, [connectionState, authQrCode]);\n\n const handleLangChange = useCallback(() => {\n markIsLoading();\n\n void setLanguage(suggestedLanguage, () => {\n unmarkIsLoading();\n\n setSettingOption({ language: suggestedLanguage });\n });\n }, [markIsLoading, setSettingOption, suggestedLanguage, unmarkIsLoading]);\n\n const isAuthReady = authState === 'authorizationStateWaitQrCode';\n\n return (\n
\n
\n {authQrCode ? (\n
\n ) : (\n
\n )}\n

{lang('Login.QR.Title')}

\n
    \n
  1. {lang('Login.QR.Help1')}
  2. \n
  3. {renderText(lang('Login.QR.Help2'), ['simple_markdown'])}
  4. \n
  5. {lang('Login.QR.Help3')}
  6. \n
\n {isAuthReady && (\n \n )}\n {suggestedLanguage && suggestedLanguage !== language && continueText && (\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n connectionState, authState, authQrCode, settings: { byKey: { language } },\n } = global;\n\n return {\n connectionState,\n authState,\n authQrCode,\n language,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'returnToAuthPhoneNumber', 'setSettingOption',\n ]),\n)(AuthCode));\n","import React, { FC, useEffect, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../global/types';\n\nimport '../../modules/actions/initial';\nimport { pick } from '../../util/iteratees';\nimport { PLATFORM_ENV } from '../../util/environment';\nimport windowSize from '../../util/windowSize';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport UiLoader from '../common/UiLoader';\nimport AuthPhoneNumber from './AuthPhoneNumber';\nimport AuthCode from './AuthCode.async';\nimport AuthPassword from './AuthPassword.async';\nimport AuthRegister from './AuthRegister.async';\nimport AuthQrCode from './AuthQrCode';\n\nimport './Auth.scss';\n\ntype StateProps = Pick;\ntype DispatchProps = Pick;\n\nconst Auth: FC = ({\n authState, reset, initApi, returnToAuthPhoneNumber, goToAuthQrCode,\n}) => {\n useEffect(() => {\n reset();\n initApi();\n }, [reset, initApi]);\n\n const isMobile = PLATFORM_ENV === 'iOS' || PLATFORM_ENV === 'Android';\n\n const handleChangeAuthorizationMethod = () => {\n if (!isMobile) {\n goToAuthQrCode();\n } else {\n returnToAuthPhoneNumber();\n }\n };\n\n useHistoryBack(\n (!isMobile && authState === 'authorizationStateWaitPhoneNumber')\n || (isMobile && authState === 'authorizationStateWaitQrCode'), handleChangeAuthorizationMethod,\n );\n\n // Prevent refresh when rotating device\n useEffect(() => {\n windowSize.disableRefresh();\n\n return () => {\n windowSize.enableRefresh();\n };\n }, []);\n\n switch (authState) {\n case 'authorizationStateWaitCode':\n return ;\n case 'authorizationStateWaitPassword':\n return ;\n case 'authorizationStateWaitRegistration':\n return ;\n case 'authorizationStateWaitPhoneNumber':\n return ;\n case 'authorizationStateWaitQrCode':\n return ;\n default:\n return isMobile\n ? \n : ;\n }\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['authState']),\n (global, actions): DispatchProps => pick(actions, ['reset', 'initApi', 'returnToAuthPhoneNumber', 'goToAuthQrCode']),\n)(Auth));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst MainAsync: FC = () => {\n const Main = useModuleLoader(Bundles.Main, 'Main');\n\n return Main ?
: undefined;\n};\n\nexport default memo(MainAsync);\n","import React, { FC } from '../../lib/teact/teact';\n\nimport Button from '../ui/Button';\n\nimport appInactivePath from '../../assets/app-inactive.png';\nimport './AppInactive.scss';\n\nconst AppInactive: FC = () => {\n const handleReload = () => {\n window.location.reload();\n };\n\n return (\n
\n
\n \"\"\n

Such error, many tabs

\n
\n Telegram supports only one active tab with the app.\n
\n Please reload this page to continue using this tab or close it.\n
\n
\n \n
\n
\n
\n );\n};\n\nexport default AppInactive;\n","import { FC, useEffect } from './lib/teact/teact';\nimport React, { withGlobal } from './lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from './global/types';\n\nimport { INACTIVE_MARKER, PAGE_TITLE } from './config';\nimport { pick } from './util/iteratees';\nimport { updateSizes } from './util/windowSize';\nimport { addActiveTabChangeListener } from './util/activeTabMonitor';\nimport useFlag from './hooks/useFlag';\n\nimport Auth from './components/auth/Auth';\nimport UiLoader from './components/common/UiLoader';\nimport Main from './components/main/Main.async';\nimport AppInactive from './components/main/AppInactive';\nimport { hasStoredSession } from './util/sessions';\n// import Test from './components/test/TestNoRedundancy';\n\ntype StateProps = Pick;\ntype DispatchProps = Pick;\n\nconst App: FC = ({ authState, disconnect }) => {\n const [isInactive, markInactive] = useFlag(false);\n\n useEffect(() => {\n updateSizes();\n addActiveTabChangeListener(() => {\n disconnect();\n document.title = `${PAGE_TITLE}${INACTIVE_MARKER}`;\n\n markInactive();\n });\n }, [disconnect, markInactive]);\n\n // return ;\n\n if (isInactive) {\n return ;\n }\n\n if (authState) {\n switch (authState) {\n case 'authorizationStateWaitPhoneNumber':\n case 'authorizationStateWaitCode':\n case 'authorizationStateWaitPassword':\n case 'authorizationStateWaitRegistration':\n case 'authorizationStateWaitQrCode':\n return ;\n case 'authorizationStateClosed':\n case 'authorizationStateClosing':\n case 'authorizationStateLoggingOut':\n case 'authorizationStateReady':\n return renderMain();\n }\n }\n\n return hasStoredSession(true) ? renderMain() : ;\n};\n\nfunction renderMain() {\n return (\n \n
\n \n );\n}\n\nexport default withGlobal(\n (global): StateProps => pick(global, ['authState']),\n (setGlobal, actions): DispatchProps => pick(actions, ['disconnect']),\n)(App);\n","import './util/handleError';\nimport './util/setupServiceWorker';\n\nimport React, { getDispatch, getGlobal } from './lib/teact/teactn';\nimport TeactDOM from './lib/teact/teact-dom';\n\nimport './global';\n\nimport { DEBUG } from './config';\n\nimport App from './App';\n\nimport './styles/index.scss';\n\nif (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> INIT');\n}\n\ngetDispatch().init();\n\nif (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START INITIAL RENDER');\n}\n\nTeactDOM.render(\n ,\n document.getElementById('root'),\n);\n\nif (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH INITIAL RENDER');\n}\n\ndocument.addEventListener('dblclick', () => {\n // eslint-disable-next-line no-console\n console.log('GLOBAL STATE', getGlobal());\n});\n"],"names":["leafPrototypes","getProto","inProgress","dataWebpackPrefix","loadStylesheet","installedCssChunks","worker","requestStates","Map","requestStatesByCallback","initApi","onUpdate","initialArgs","DEBUG","console","log","Worker","URL","addEventListener","data","type","update","requestState","get","messageId","error","reject","resolve","response","callback","callbackArgs","subscribeToWorker","platform","window","async","Promise","race","makeRequest","pause","then","Error","err","Date","now","startedAt","location","reload","args","callApi","fnName","name","warn","cancelApiProgress","progressCallback","isCanceled","postMessage","message","generateIdFor","payload","promise","Object","assign","pop","set","catch","finally","delete","ApiMediaFormat","ApiMessageEntityTypes","MAIN_THREAD_ID","MESSAGE_DELETED","base","maxint","adapt","delta","numpoints","firsttime","k","Math","floor","decode","input","preserveCase","output","case_flags","input_length","length","n","out","i","bias","basic","j","ic","oldi","w","digit","t","len","lastIndexOf","charCodeAt","RangeError","push","cp","splice","String","fromCharCode","toUpperCase","value","join","utf16","ensureProtocol","url","includes","getDomain","href","decodedHref","decodeURI","match","domain","replace","domain_array","split","s","slice","convertPunycode","memo","text","className","children","isRtl","toggleSafeLinkModal","openTelegramLink","getDispatch","content","isNotSafe","handleClick","useCallback","e","ctrlKey","altKey","shiftKey","metaKey","RE_TME_LINK","RE_TME_INVITE_LINK","preventDefault","classNames","buildClassName","title","target","rel","onClick","dir","getFileSizeString","bytes","ONE_GIGABYTE","toFixed","ONE_MEGABYTE","getDocumentExtension","document","fileName","mimeType","getFileExtension","indexOf","getColorFromExtension","extension","getDocumentHasPreview","Boolean","previewBlobUrl","thumbnail","RE_EMOJI_ONLY","RegExp","twemojiRegex","DETECT_UP_TO","emojiCount","withGlobal","undefined","setGlobal","actions","pick","sender","openUserInfo","id","Link","focusMessage","handleMessageClick","chatId","openChat","renderActionMessageText","lang","actionOrigin","targetUsers","targetMessage","targetChatId","options","action","translationValues","amount","currency","textOptions","maxTextLength","processed","unprocessed","processPlaceholder","formatCurrency","code","isEmbedded","origin","asPlain","isChat","chat","trimText","getChatTitle","renderText","renderChatContent","renderUserContent","renderOriginContent","map","user","filter","getMessageSummaryText","photo","video","sticker","getMessageContent","showQuotes","messageText","isGif","renderMessageContent","invoice","renderProductContent","renderMigratedContent","trim","getUserFullName","placeholder","replaceValue","placeholderPosition","substring","Array","isArray","forEach","index","RE_LETTER_OR_DIGIT","SIMPLE_MARKDOWN_REGEX","part","filters","params","reduce","textParts","divEl","createElement","result","innerText","innerHTML","escapeHtml","EMOJI_REGEX","replaceEmojis","addLineBreaks","highlight","lowerCaseText","toLowerCase","queryPosition","nextSymbol","newParts","links","RE_LINK","nextLink","shift","lastIndex","startsWith","username","endsWith","addLinks","replaceSimpleMarkdown","size","IS_EMOJI_SUPPORTED","parts","fixNonStandardEmoji","emojis","emojiResult","emoji","nativeToUnified","removeVS16s","src","alt","line","source","trimmedLine","trimLeft","indentLength","repeat","RE_LINK_TEMPLATE","RE_MENTION_TEMPLATE","entities","entityResult","entity","preventMessageInputBlur","withBubbling","IS_IOS","activeElement","EDITABLE_INPUT_ID","currentTarget","preventMessageInputBlurWithBubbling","global","userId","userOrChat","selectUser","openChatByUsername","ref","onContextMenu","onMouseDown","onMouseEnter","onMouseLeave","onFocus","color","round","pill","fluid","isText","isLoading","ariaLabel","download","disabled","ripple","faded","tabIndex","elementRef","useRef","isClicked","setIsClicked","useState","fullClassName","setTimeout","handleMouseDown","label","subLabel","checked","blocking","onChange","onCheck","useLang","handleChange","event","trigger","positionX","positionY","footer","forceOpen","onOpen","onClose","menuRef","dropdownRef","isOpen","setIsOpen","onKeyDown","menu","current","keyCode","focusedElement","elementChildren","from","focus","onTrigger","containerRef","autoClose","shouldSkipTransition","success","readOnly","autoComplete","inputMode","maxLength","onInput","onKeyPress","onBlur","onPaste","labelText","htmlFor","withBackground","style","noCloseOnBackdrop","onCloseAnimationEnd","backdropContainerRef","transitionClassNames","useShowTransition","useEffect","captureEscKeyListener","useHistoryBack","useEffectWithPrevDeps","prevIsOpen","dispatchHeavyAnimationEvent","handleKeyDown","useKeyboardListNavigation","useVirtualBackdrop","bubbleClassName","props","icon","destructive","stopPropagation","role","ripples","setRipples","cleanUpDebounced","useMemo","debounce","button","container","position","getBoundingClientRect","rippleSize","offsetWidth","x","clientX","y","clientY","requestAnimationFrame","PAGE_TITLE","INACTIVE_MARKER","APP_NAME","process","APP_VERSION","DEBUG_MORE","IS_TEST","DEBUG_ALERT_MSG","SESSION_USER_KEY","LEGACY_SESSION_KEY","GLOBAL_STATE_CACHE_DISABLED","GLOBAL_STATE_CACHE_KEY","GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT","GLOBAL_STATE_CACHE_USER_LIST_LIMIT","MEDIA_CACHE_DISABLED","MEDIA_CACHE_NAME","MEDIA_CACHE_NAME_AVATARS","MEDIA_PROGRESSIVE_CACHE_NAME","CUSTOM_BG_CACHE_NAME","LANG_CACHE_NAME","isBigScreen","innerHeight","MIN_PASSWORD_LENGTH","MESSAGE_LIST_SENSITIVE_AREA","MESSAGE_LIST_SLICE","MESSAGE_LIST_VIEWPORT_LIMIT","CHAT_HEIGHT_PX","CHAT_LIST_SLICE","CHAT_LIST_LOAD_SLICE","SHARED_MEDIA_SLICE","MESSAGE_SEARCH_SLICE","GLOBAL_SEARCH_SLICE","MEMBERS_SLICE","MEMBERS_LOAD_SLICE","PROFILE_SENSITIVE_AREA","TOP_CHAT_MESSAGES_PRELOAD_LIMIT","ALL_CHATS_PRELOAD_DISABLED","ANIMATION_LEVEL_MIN","ANIMATION_LEVEL_MAX","ANIMATION_LEVEL_DEFAULT","DEFAULT_MESSAGE_TEXT_SIZE_PX","IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX","MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX","DRAFT_DEBOUNCE","EDITABLE_INPUT_MODAL_ID","SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","SAFE_SCREEN_WIDTH_FOR_CHAT_INFO","MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN","MOBILE_SCREEN_MAX_WIDTH","MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH","MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT","LOCAL_MESSAGE_ID_BASE","ANIMATION_END_DELAY","FAST_SMOOTH_MAX_DISTANCE","FAST_SMOOTH_MIN_DURATION","FAST_SMOOTH_MAX_DURATION","FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE","STICKER_SIZE_INLINE_DESKTOP_FACTOR","Set","STICKER_SIZE_INLINE_MOBILE_FACTOR","STICKER_SIZE_AUTH","STICKER_SIZE_AUTH_MOBILE","STICKER_SIZE_PICKER","STICKER_SIZE_GENERAL_SETTINGS","STICKER_SIZE_PICKER_HEADER","STICKER_SIZE_SEARCH","STICKER_SIZE_MODAL","STICKER_SIZE_TWO_FA","STICKER_SIZE_DISCUSSION_GROUPS","STICKER_SIZE_FOLDER_SETTINGS","STICKER_SIZE_INLINE_BOT_RESULT","MEMOJI_STICKER_ID","BASE_EMOJI_KEYWORD_LANG","MENU_TRANSITION_DURATION","SLIDE_TRANSITION_DURATION","CONTENT_TYPES_FOR_QUICK_UPLOAD","SERVICE_NOTIFICATIONS_USER_ID","REPLIES_USER_ID","ALL_FOLDER_ID","ARCHIVED_FOLDER_ID","MAX_MEDIA_FILES_FOR_ALBUM","MAX_ACTIVE_PINNED_CHATS","SCHEDULED_WHEN_ONLINE","DEFAULT_LANG_CODE","DEFAULT_LANG_PACK","LANG_PACKS","TIPS_USERNAME","LOCALIZED_TIPS","FEEDBACK_URL","LIGHT_THEME_BG_COLOR","DARK_THEME_BG_COLOR","DARK_THEME_PATTERN_COLOR","DEFAULT_PATTERN_COLOR","cb","dependencies","debugKey","prevDeps","usePrevious","initial","setValue","setTrigger","ANIMATION_START_EVENT","ANIMATION_END_EVENT","timeout","isAnimating","duration","dispatchEvent","Event","clearTimeout","handleAnimationStart","handleAnimationEnd","removeEventListener","LOCATION_HASH","hash","historyState","currentIndex","nextStateIndexToReplace","isHistoryAltered","isDisabled","isEdge","currentIndexes","disableHistoryBack","handleTouchEnd","isActive","onBack","onForward","currentState","shouldReplaceNext","hashes","indexRef","isForward","prevIsActive","isClosed","indexHashRef","prevHashes","isHashChangedFromEvent","isForceClose","prev","history","pushState","state","last","realDelta","indexLast","findIndex","l","go","replaceState","back","handlePopState","currIndex","disableHistoryAnimations","hasChanged","areSortedArraysEqual","forceClose","touches","pageX","innerWidth","pathname","onSelectWithEnter","itemSelector","noCaptureFocus","focusedIndex","setFocusedIndex","element","querySelectorAll","newIndex","item","forceUpdate","useForceUpdate","useOnChange","langProvider","bundleName","moduleName","noLoad","autoUpdate","module","getModuleFromMemory","addLoadListener","loadModule","some","d","next","shouldSkipUndefined","onCloseTransitionEnd","noOpenTransition","noCloseTransition","setIsClosed","closeTimeoutRef","hasOpenClassName","setHasOpenClassName","shouldHaveOpenClassName","isClosing","shouldRender","handleEvent","contains","classList","NON_BUBBLEABLE_EVENTS","delegationRegistry","delegatedEventsByElement","documentEventCounters","propName","handler","asCapture","eventName","resolveEventName","canUseEventDelegation","resolveDelegationRegistryForName","existing","newSet","resolveDelegatedEventsForElement","add","addDelegatedListener","removeDelegatedListener","tagName","realEventName","has","removeAllDelegatedListeners","eventNames","realEvent","events","furtherCallsPrevented","Proxy","p","Reflect","body","parentNode","FILTERED_ATTRIBUTES","HTML_ATTRIBUTES","MAPPED_ATTRIBUTES","autoPlay","headsByElement","renderWithVirtual","parentEl","$current","$new","$parent","skipComponentUpdate","forceIndex","fragment","moveDirection","isComponentElement","hasElementChanged","componentInstance","renderComponent","updateComponent","isMounted","setupComponentUpdateListener","initComponent","node","createNode","setTarget","childNodes","insertBefore","appendChild","removeChild","getTarget","unmountTree","replaceChild","areComponents","isRealElement","nextSibling","currentKeys","keys","newKeys","key","removeAttribute","addAttribute","oldValue","newValue","updateAttribute","updateAttributes","currentEl","teactFastList","$newChild","currentRemainingIndex","remainingByKey","acc","$currentChild","newChildKey","$element","order","teactOrderKey","fragmentQueue","fragmentIndex","newChildren","currentPreservedIndex","currentChildInfo","concat","flushFragmentQueue","shouldMoveNode","isMovingDown","renderFastListChildren","max","createDocumentFragment","renderChildren","mountComponent","$firstChild","isEmptyElement","createTextNode","isTextElement","tag","$child","$fragmentChild","cssText","setAttribute","render","headId","getAttribute","$head","VirtualElementTypesEnum","Fragment","Symbol","renderingInstance","Empty","Text","isTagElement","Tag","Component","flatten","parsedChildren","hooks","cursor","byCursor","effects","memos","buildComponentElement","createComponentInstance","dropEmptyTail","buildChildElement","buildTagElement","isEmptyPlaceholder","child","DEBUG_components","newRenderedValue","DEBUG_startAt","componentName","renderCount","renderTimes","performance","renderTime","handleError","renderedValue","newChild","$old","hook","cleanup","effect","nextValue","setter","helpGc","prepareComponentForFrame","prepareForFrame","throttleWithPrimaryRaf","throttleWithRaf","forceUpdateComponent","currentElement","DEBUG_contentComponentName","useLayoutEffectBase","schedulerFn","exec","dependency","causedBy","res","prevValue","fastRaf","useLayoutEffect","onTickEnd","resolver","getUnequalProps","newCallback","areEqual","arePropsShallowEqual","propsRef","renderedRef","orderBy","values","React","currentGlobal","reducers","callbacks","containers","mapStateToProps","mapReducersToProps","ownProps","mappedProps","newMappedProps","Number","isNaN","DEBUG_componentName","areMappedPropsChanged","DEBUG_updates","updateTime","runCallbacks","runCallbacksThrottled","newGlobal","noThrottle","getGlobal","addReducer","reducer","onDispatch","addCallback","removeCallback","TeactNContainer","vs16RegExp","zeroWidthJoiner","rawEmoji","importLegacySession","clearLegacySessions","apiUpdate","userAgent","navigator","PLATFORM_ENV","sessionData","loadStoredSession","phoneNumber","authIsLoading","authError","password","file","firstName","lastName","authIsLoadingQrCode","storeSession","currentUserId","clearStoredSession","unsubscribe","forceWebsync","reset","cacheApi","langCachePrefix","langCacheVersion","updateAppBadge","init","connectionState","authNearestCountry","deviceToken","subscribedAt","buildInputPrivacyRules","visibility","allowedIds","deniedIds","users","byId","usersById","chats","chatsById","rules","collectUsers","isChatPrivate","accessHash","collectChats","allowedUsers","allowedChats","blockedUsers","blockedChats","bio","about","profileEdit","progress","ProfileEditProgress","currentUser","updateUser","fullInfo","isUsernameAvailable","settings","loadedWallpapers","wallpapers","createObjectURL","slug","UPLOADING_WALLPAPER_SLUG","wallpaper","firstWallpaper","withLocalMedia","addUsers","buildCollectionByKey","updateChats","blocked","ids","blockedIds","totalCount","contactId","addBlockedContact","removeBlockedContact","activeSessions","session","isCurrent","serverTimeOffset","addNotifyExceptions","replaceSettings","peerType","isSilent","shouldShowPreviews","updateNotifySettings","hasPushNotifications","hasWebNotifications","byKey","subscribe","hasContactJoinedNotifications","languages","phoneNumberSettings","lastSeenSettings","profilePhotoSettings","forwardsSettings","chatInviteSettings","all","privacy","lastSeen","profilePhoto","forwards","chatInvite","privacyKey","allowUserIds","allowChatIds","blockUserIds","blockChatIds","isAllowList","contactsIds","isSensitiveEnabled","selectNotifySettings","setLanguage","language","onUpdateApiReady","wasAuthReady","authState","authorizationState","isLoggingOut","authIsCodeViaApp","isCodeViaApp","authHint","hint","authQrCode","qrCode","lastSyncTime","onUpdateAuthorizationState","onUpdateAuthorizationError","sync","signOut","onUpdateConnectionState","authRememberMe","isEmpty","mainDcId","saveSession","onUpdateSession","onUpdateServerTimeOffset","sessionUserAuth","localStorage","getItem","userAuth","JSON","parse","setItem","stringify","updateSessionUserId","onUpdateCurrentUser","paymentShippingError","getShippingError","addPaymentError","showDialog","hasErrorKey","handleSystemThemeChange","currentThemeMatch","documentElement","currentTheme","nextTheme","selectTheme","animationLevel","switchTheme","mql","matchMedia","addListener","subscribeToSystemThemeChange","messageTextSize","theme","setProperty","toString","IS_TOUCH_ENV","startWebsync","IS_ANDROID","IS_MAC_OS","uiReadyState","remove","authPhoneNumber","shouldSkipHistoryAnimations","replaceThemeSettings","FOREVER_BANNED_DATE","isChatGroup","isChatBasicGroup","isChatSuperGroup","isChatChannel","isCommonBoxChat","getChatTypeString","getPrivateChatUserId","isSelf","getChatDescription","getChatLink","inviteLink","getChatAvatarHash","owner","avatarHash","isChatSummaryOnly","lastMessage","isChatAdmin","adminRights","getHasAdminRight","isUserRightBanned","currentUserBannedRights","defaultBannedRights","getCanPostInChat","threadId","isRestricted","migratedTo","isNotJoined","isCreator","getAllowedAttachmentOptions","isChatWithBot","canAttachMedia","canAttachPolls","canSendStickers","canSendGifs","canAttachEmbedLinks","isAdmin","getMessageSendingRestrictionReason","sendMessages","untilDate","formatDateToString","formatTime","getChatSlowModeOptions","slowMode","getChatOrder","joinDate","draftDate","date","isChatArchived","folderId","selectIsChatMuted","notifySettings","notifyExceptions","isMuted","hasPrivateChatsNotifications","hasBroadcastNotifications","hasGroupNotifications","selectShouldShowMessagePreview","hasPrivateChatsMessagePreview","hasBroadcastMessagePreview","hasGroupMessagePreview","getCanDeleteChat","prepareFolderListIds","folder","chatIdsCache","excludedChatIds","includedChatIds","pinnedChatIds","isListed","excludeArchived","excludeMuted","unreadMentionsCount","unreadCount","hasUnreadMark","excludeRead","privateChatUser","bots","contacts","isContact","nonContacts","groups","channels","filterChatFolder","prepareChatList","listIds","orderedPinnedIds","folderType","chatFilter","listedChats","listIdsSet","pinnedChats","otherChats","getFolderUnreadDialogs","unreadDialogsCount","total","hasActiveDialogs","getFolderDescriptionText","emoticon","description","pinnedIds","getFolderChatsCount","chatOrUser","getMessageSenderName","getUserFirstOrLastName","sortChatIds","chatIds","shouldPrioritizeVerified","priorityIds","priority","isVerified","CONTENT_NOT_SUPPORTED","getMessageKey","parseMessageKey","getMessageOriginalId","previousLocalId","noEmoji","audio","voice","contact","poll","truncatedText","substr","groupedId","getMessageAudioCaption","summary","question","getMessageText","webPage","getMessageCustomShape","isRound","parseEmojiOnlyString","getMessageSingleEmoji","getFirstLinkInMessage","link","find","offset","isOwnMessage","isOutgoing","isReplyMessage","replyToMessageId","isForwardedMessage","forwardInfo","isActionMessage","isServiceNotificationMessage","isMessageLocal","isAnonymousOwnMessage","senderId","getSenderTitle","getSendingState","sendingState","isHistoryClearMessage","performer","hasMessageMedia","getMessagePhoto","getMessageVideo","getMessageDocument","getMessageSticker","getMessageContact","getMessagePoll","getMessageAction","getMessageAudio","getMessageVoice","getMessageRoundVideo","isMessageDocumentPhoto","mediaType","isMessageDocumentVideo","getMessageInvoice","getMessageWebPage","getMessageWebPagePhoto","getMessageWebPageVideo","getMessageMediaThumbDataUri","media","getMessageMediaThumbnail","dataUri","getMessageMediaHash","webPagePhoto","webPageVideo","messageVideo","messagePhoto","hasMessageLocalBlobUrl","getVideoOrAudioBaseHash","IS_PROGRESSIVE_SUPPORTED","IS_SAFARI","getMessageMediaFormat","fullVideo","isAnimated","IS_OPUS_SUPPORTED","getMessageFileName","getMessageFileSize","blobUrl","getChatMediaMessageIds","messages","listedIds","isFromSharedMedia","getMessageContentIds","reverse","getPhotoFullDimensions","sizes","getPhotoInlineDimensions","getVideoDimensions","width","height","getMediaTransferState","isDownloadNeeded","isUploading","isTransferring","transferProgress","messageIds","contentType","validator","matchLinkInMessageText","getMediaDuration","buildChatThreadKey","STRIPE_ERRORS","missing_payment_information","field","invalid_number","number","exp_year","exp_month","invalid_expiry_year","invalid_expiry_month","cvc","invalid_cvc","getStripeError","param","USER_COLOR_KEYS","isDeletedUser","getUserStatus","status","wasOnline","getTime","wasOnlineDate","diff","today","setHours","yesterday","setDate","getDate","formatFullDate","isUserOnline","isUserBot","sortUserIds","userIds","getServerTime","expires","getUserColorKey","peer","abs","replaceChatListIds","newIds","updateChatListIds","idsUpdate","replaceChats","newById","getUpdatedChat","chatUpdate","shouldOmitMinInfo","isMin","updatedChat","omit","photos","updateChat","updatedById","updatedChats","addChats","addedById","isAdded","addedChats","updateChatListType","listType","currentListIds","listTypeKey","currentFolderList","updateChatListSecondaryInfo","info","totalCountKey","totalChatCount","isFullyLoaded","updateCurrentMessageList","shouldReplaceHistory","messageLists","newMessageLists","replaceChatMessages","updateMessageStore","byChatId","threadsById","replaceThreadParam","paramName","threadUpdate","updateThread","addMessages","addedByChatId","messagesByChatId","addChatMessagesById","selectChatMessages","every","newId","updateChatMessage","messageUpdate","updatedMessage","updateScheduledMessage","selectScheduledMessages","replaceScheduledMessages","deleteChatMessages","deletedForwardedPosts","pickTruthy","isLinkedChannelPost","threadInfo","selectThreadInfo","selectListedIds","outlyingIds","selectOutlyingIds","viewportIds","selectViewportIds","selectPinnedIds","newMessageCount","messagesCount","currentMessageList","selectCurrentMessageList","canDeleteCurrentThread","currentThreadId","fromChatId","fromMessageId","originalPost","selectChatMessage","deleteChatScheduledMessages","scheduledIds","selectScheduledIds","updateListedIds","orderHistoryIds","updateOutlyingIds","sort","a","b","addViewportId","safeReplaceViewportIds","newViewportIds","updateThreadInfo","newThreadInfo","updateThreadInfos","updates","scheduledMessages","updateScheduledMessages","updateFocusedMessage","noHighlight","isResizingContainer","focusedMessage","updateFocusDirection","direction","enterMessageSelectMode","selectedMessages","prototype","toggleMessageSelection","messageListType","childMessageIds","withShift","oldSelectedMessages","selectMessageIdsByGroupId","selectedMessageIds","newMessageIds","newSelectedMessageIds","selectCurrentMessageIds","prevIndex","min","to","unique","exitMessageSelectMode","updateThreadUnreadFromForwardedMessage","originMessage","lastMessageId","isDeleting","channelPostId","threadInfoOld","updateStickerSets","category","sets","resultIds","updatedSets","stickerSet","stickers","setsById","setIds","updateStickerSet","stickerSetId","currentStickerSet","updateGifSearch","isNew","results","nextOffset","currentResults","gifs","search","newResults","currentIds","gif","replaceAnimatedEmojis","animatedEmojis","updateStickersForEmoji","remoteStickers","allStickers","selectStickersForEmoji","uniqueIds","forEmoji","rebuildStickersForEmoji","replaceUsers","getUpdatedUser","userUpdate","updatedUser","updateContactList","updatedUsers","contactUserIds","contactList","newContactUserIds","updateUsers","addedUsers","updateSelectedUserId","selectedId","deleteUser","MEMO_EMPTY_ARRAY","updateUserSearch","searchStatePartial","userSearch","updateUserSearchFetchingStatus","newState","fetchingStatus","updateUserBlockedState","isBlocked","getComplexKey","updateGlobalSearch","globalSearch","updateGlobalSearchContent","currentContent","updateGlobalSearchResults","newFoundMessages","nextRate","resultsByType","newFoundMessagesById","foundIdsForType","foundIds","updateGlobalSearchFetchingStatus","prevFoundIds","newFoundIds","foundOrPrevFoundIds","nextOffsetId","replaceLocalTextSearch","chatThreadKey","searchParams","localTextSearch","byChatThreadKey","updateLocalTextSearch","query","replaceLocalTextSearchResults","updateLocalTextSearchResults","orderFoundIds","replaceLocalMediaSearch","localMediaSearch","updateLocalMediaSearchType","currentType","updateLocalMediaSearchResults","replaceLocalMediaSearchResults","updateManagementProgress","management","updateManagement","newSettings","themes","notifyException","exceptionData","addNotifyException","updateTwoFaSettings","twoFaSettings","updateShippingOptions","shippingOptions","payment","setRequestInfoId","requestId","setPaymentStep","step","setInvoiceMessageInfo","isTest","photoUrl","invoiceContent","setStripeCardInfo","cardInfo","stripeCredentials","setPaymentForm","form","setReceipt","receipt","messageInvoice","clearPayment","closeInvoice","isPaymentModalOpen","selectIsUserBlocked","selectNotifyExceptions","selectChat","selectChatUser","selectIsChatWithSelf","selectIsChatWithBot","selectSupportChat","isSupport","selectChatOnlineCount","members","onlineCount","selectChatBot","selectIsChatBotNotStarted","bot","messageInfo","selectAreActiveChatsLoaded","active","selectIsChatListed","targetList","list","selectChatListType","selectChatFolder","chatFolders","selectIsChatPinned","archived","chatFoldersById","selectChatByUsername","usernameLowered","selectCountNotMutedUnread","activeChatIds","selectCurrentStickerSearch","selectCurrentGifSearch","selectStickerSet","selectStickerSetByShortName","shortName","stickerSets","stickersForEmoji","packs","selectAnimatedEmoji","cleanedEmoji","selectCurrentChat","selectThreadParam","thread","selectScrollOffset","selectReplyingToId","selectEditingId","selectEditingScheduledId","selectDraft","selectNoWebPage","selectFirstMessageId","selectReplyStack","selectThreadOriginChat","originChannelId","selectThreadTopMessageId","topMessageId","selectThreadByMessage","replyToTopMessageId","isMessageInCurrentMessageList","selectIsViewportNewest","chatMessages","selectScheduledMessage","selectEditingMessage","selectChatMessageByPollId","pollId","messageWithPoll","selectFocusedMessageId","focusedChatId","selectIsMessageFocused","focusedId","selectOutgoingStatus","isScheduledList","lastReadOutboxMessageId","selectIsMessageUnread","selectSender","selectForwardedSender","isChannelPost","senderUserId","selectAllowedMessageActions","isPrivate","isChatWithSelf","isBasicGroup","isSuperGroup","isChannel","isServiceNotification","isOwn","isAction","isMessageEditable","viaBotId","canReply","hasPinPermission","canPin","canUnpin","pinnedMessageIds","canDelete","canReport","canDeleteForAll","canEdit","canForward","hasSticker","hasFavoriteSticker","favorite","selectIsStickerFavorite","canFaveSticker","canUnfaveSticker","canCopy","canCopyLink","canSelect","noOptions","ability","selectCanDeleteSelectedMessages","messageActions","selectCanReportSelectedMessages","selectUploadProgress","fileUploads","byMessageLocalId","selectRealLastReadId","lastReadInboxMessageId","Infinity","selectFirstUnreadId","lastReadId","found","isFromScheduled","selectIsForwardModalOpen","forwardMessages","isModalShown","selectCommonBoxChatId","fromLastMessage","selectIsInSelectMode","selectIsMessageSelected","selectForwardedMessageIdsByGroupId","selectIsDocumentGroupSelected","selectedIds","groupIds","selectSelectedMessagesCount","selectNewestMessageWithBotKeyboardButtons","findLast","keyboardButtons","replyHideMessageId","shouldHideKeyboardButtons","selectShouldAutoLoadMedia","shouldAutoDownloadMediaFromContacts","shouldAutoDownloadMediaInPrivateChats","shouldAutoDownloadMediaInGroups","shouldAutoDownloadMediaInChannels","selectIsUserOrChatContact","selectShouldAutoPlayMedia","shouldAutoPlayVideos","shouldAutoPlayGifs","asGif","selectShouldLoopStickers","shouldLoopStickers","selectCurrentTextSearch","currentSearch","selectCurrentMediaSearchPeerId","currentProfileUserId","selectCurrentMediaSearch","peerId","selectManagement","selectCurrentManagementType","selectIsMediaViewerOpen","mediaViewer","avatarOwnerId","selectRightColumnContentKey","isChatInfoShown","newChatMembersProgress","isAddingChatMembersShown","NewChatMembersProgress","isPollResults","pollResults","selectIsPollResultsOpen","isSearch","IS_SINGLE_COLUMN_LAYOUT","isManagement","currentManagement","selectCurrentManagement","isStickerSearch","isGifSearch","currentChatId","areActiveChatsLoaded","isUserInfo","isChatInfo","RightColumnContent","selectIsRightColumnShown","shouldUseSystemTheme","getSystemTheme","selectCurrentGlobalSearchQuery","selectPaymentChatId","selectPaymentMessageId","selectPaymentFormId","formId","selectPaymentRequestId","selectProviderPublishableKey","nativeParams","publishableKey","selectStripeCredentials","LoadMoreDirection","FocusDirection","SettingsScreens","LeftColumnContent","GlobalSearchContent","MediaViewerOrigin","ChatCreationProgress","ManagementProgress","ProfileState","PaymentStep","ManagementScreens","currentInstance","animateSingle","tick","instance","isCancelled","animate","setAppBadge","currentProps","newProps","currentKeysLength","prop","self","caches","Type","fetch","cacheName","isHtmlAllowed","request","Request","cache","open","Blob","blob","headers","Json","json","save","cacheData","Response","put","clear","captureKeyboardListener","onEsc","keyToHandlerName","Enter","Backspace","Delete","Esc","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Tab","handlers","onEnter","onDelete","onBackspace","onUp","onDown","onLeft","onRight","onTab","captureKeyboardListeners","hasActiveHandlers","handlerName","currentEventHandlers","releaseKeyboardListener","keyHandlers","WEEKDAYS_FULL","MONTHS_FULL","MONTHS_FULL_LOWERCASE","month","getDayStart","datetime","getDayStartAt","toYearMonth","timestamp","getFullYear","getMonth","toIsoString","getHours","padStart","getMinutes","formatPastTimeShort","weekAgo","getDay","withYear","format","formatDate","formatMonthAndYear","isShort","formatHumanDate","noWeekdays","lowerFirst","upperFirst","weekAhead","weekDay","day","monthIndex","formatMediaDateTime","formatMediaDuration","hours","minutes","seconds","string","formatVoiceRecordDuration","durationInMs","milliseconds","locale","toLocaleString","year","isValidDate","MAX_MONTH_IN_YEAR","parseDateString","matchStringDate","matchEuropeStringDate","matchNumberDate","dateParts","timestampPlusDay","MILISECONDS_IN_DAY","str","EXCLUDE_EMOJIS","EMOJI_EXCEPTIONS","unifiedToNative","unified","codePoints","parseInt","fromCodePoint","regex","replacement","pairs","uncompressEmoji","emojiData","categories","emojiRaw","names","native","image","isWebpSupportedCache","isWebpSupported","webp","Image","handleLoadOrError","onload","onerror","hasWebp","systemThemeCache","matches","os","test","getPlatform","IS_PWA","standalone","referrer","IS_TABLET_COLUMN_LAYOUT","IS_VOICE_RECORDING_SUPPORTED","mediaDevices","AudioContext","webkitAudioContext","IS_SERVICE_WORKER_SUPPORTED","Audio","canPlayType","IS_CANVAS_FILTER_SUPPORTED","getContext","LAYERS_ANIMATION_NAME","DPR","devicePixelRatio","MASK_IMAGE_DISABLED","dataUriToBlob","arr","mime","bstr","atob","u8arr","Uint8Array","blobToDataUri","reader","FileReader","readAsDataURL","blobToFile","File","lastModified","preloadImage","img","preloadVideo","volume","onloadedmetadata","createPosterForVideo","onseeked","videoWidth","videoHeight","canvas","drawImage","toDataURL","currentTime","fetchBlob","imgToCanvas","constructor","fileBits","rest","super","this","totalPrice","Intl","NumberFormat","store","random","hasOwnProperty","READABLE_ERROR_MESSAGES","CHAT_RESTRICTED","CHAT_WRITE_FORBIDDEN","CHAT_SEND_POLL_FORBIDDEN","CHAT_SEND_STICKERS_FORBIDDEN","CHAT_SEND_GIFS_FORBIDDEN","CHAT_SEND_MEDIA_FORBIDDEN","CHAT_LINK_EXISTS","SLOWMODE_WAIT_X","USER_BANNED_IN_CHANNEL","USER_IS_BLOCKED","YOU_BLOCKED_USER","IMAGE_PROCESS_FAILED","MEDIA_EMPTY","MEDIA_INVALID","PHOTO_EXT_INVALID","PHOTO_INVALID_DIMENSIONS","PHOTO_SAVE_FILE_INVALID","MESSAGE_DELETE_FORBIDDEN","MESSAGE_POLL_CLOSED","MESSAGE_EDIT_TIME_EXPIRED","CHAT_ADMIN_REQUIRED","PINNED_DIALOGS_TOO_MUCH","DIALOG_FILTERS_TOO_MUCH","CHANNEL_PRIVATE","MEDIA_CAPTION_TOO_LONG","ADDRESS_STREET_LINE1_INVALID","ADDRESS_STREET_LINE2_INVALID","ADDRESS_CITY_INVALID","ADDRESS_COUNTRY_INVALID","ADDRESS_POSTCODE_INVALID","ADDRESS_STATE_INVALID","REQ_INFO_NAME_INVALID","REQ_INFO_PHONE_INVALID","REQ_INFO_EMAIL_INVALID","LINK_NOT_MODIFIED","MESSAGE_TOO_LONG","SERVICE_WORKER_DISABLED","MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS","FRESH_RESET_AUTHORISATION_FORBIDDEN","BOTS_TOO_MUCH","BOT_GROUPS_BLOCKED","USERS_TOO_MUCH","USER_CHANNELS_TOO_MUCH","USER_KICKED","USER_NOT_MUTUAL_CONTACT","USER_PRIVACY_RESTRICTED","INVITE_HASH_EMPTY","INVITE_HASH_EXPIRED","INVITE_HASH_INVALID","CHANNELS_TOO_MUCH","USER_ALREADY_PARTICIPANT","SCHEDULE_DATE_INVALID","WALLPAPER_DIMENSIONS_INVALID","SHIPPING_ERRORS","getReadableErrorText","isSlowMode","textParams","extraPartIndex","errorMessage","handleErrorEvent","ErrorEvent","reason","throttle","alert","collection","member","mapValues","newByKey","object","stringKeys","orderKey","mode","mode1","mode2","orderKey1","orderKey2","aValue1","bValue1","aValue2","bValue2","aValue","bValue","array","compact","array1","array2","areSortedArraysIntersecting","findIntersectionWithSet","chunkSize","cloneDeep","predicate","SUBSTITUTION_REGEX","PLURAL_OPTIONS","PLURAL_RULES","en","ar","ca","de","es","fa","fr","it","ko","ms","nl","pl","pt_BR","ru","tr","uk","uz","langPack","fallbackLangPack","createCallbackManager","currentLangCode","getTranslation","cacheValue","cached","langString","processTranslation","importFallbackLangPack","getTranslationForLangString","langCode","translateString","remoteLangPack","remote","fetchRemoteString","withFallback","newLangPack","sourceLangPacks","fetchRemote","langInfo","rtl","default","template","optionIndex","getPluralOption","translationSlices","initialValue","processTemplate","formatInteger","SAMPLE_RATE","oggToWav","opusData","arrayBuffer","typedArray","decoderWorker","wavWorker","onmessage","command","buffers","buffer","page","terminate","wavBitDepth","wavSampleRate","decoderSampleRate","outputBufferSampleRate","pages","asCacheApiType","memoryCache","fetchPromises","mediaFormat","onProgress","progressiveUrl","getProgressive","mediaPng","webpToPng","prepared","prepareMedia","mediaSource","MediaSource","streamUrl","sourceBuffer","addSourceBuffer","endOfStream","appendBuffer","revokeObjectURL","fetchFromCacheOrRemote","getFromMemory","cancelProgress","mediaData","serviceWorker","fullSize","controller","Bundles","LOAD_PROMISES","MEMORY_CACHE","Auth","Main","Extra","handleBundleLoad","bundle","listeners","listener","getDeviceToken","subscription","toJSON","endpoint","checkIfPushSupported","ServiceWorkerRegistration","Notification","permission","soundPlayed","playNotificationSound","notificationSoundVolume","once","play","requestPermission","unsubscribeFromPush","dispatch","deleteDeviceToken","serviceWorkerRegistration","ready","pushManager","getSubscription","areSettingsLoaded","checkIfShouldResubscribe","userVisibleOnly","setDeviceToken","DOMException","ABORT_ERR","showNewMessageNotification","isActiveChat","resultSettings","resultExceptions","loadNotificationSettings","hasFocus","checkIfShouldNotify","messageSender","messageAction","actionTargetMessage","targetUserIds","actionTargetUserIds","actionTargetChatId","actionTargetUsers","privateChatUserId","senderName","getNotificationContent","imageHash","mediaLoader","getAvatar","badge","vibrate","notification","onclick","close","onshow","closeMessageNotifications","notifyClientReady","formatsCache","defaultPhoneNumberFormat","flag","phoneFormat","formatValue","phoneNumberFormat","phoneNumberGroups","count","getPhoneNumberFormat","getCountryById","countryList","c","getCountryFromPhoneNumber","possibleCountries","country","formatPhoneNumber","_","p1","p2","p3","p4","p5","separator","formatPhoneNumberWithCode","numberWithPlus","fn","shouldRunFirst","shouldRunLast","waitingTimeout","interval","isPending","_args","setInterval","clearInterval","throttleWith","fastPrimaryRaf","waiting","onIdle","requestIdleCallback","rafPromise","fastRafCallbacks","fastRafPrimaryCallbacks","beforeUnloadCallbacks","isPrimary","currentCallbacks","currentPrimaryCallbacks","onBeforeUnload","isLast","unshift","RE_NOT_LETTER","searchWords","haystack","needle","haystackWords","needleWord","haystackWord","promisifyRequest","oncomplete","onsuccess","onabort","defaultGetStoreFunc","defaultGetStore","dbName","storeName","dbp","userAgentData","indexedDB","databases","intervalId","tryIdb","onupgradeneeded","createObjectStore","txMode","db","transaction","objectStore","createStore","DC_IDS","hasStoredSession","withLegacy","userAuthJson","dcID","dcId","removeItem","sessionId","sessionJson","customStore","idb","idbKeys","items","openCursor","continue","eachCursor","isInitialized","HEX_COLOR_REGEX","lerp","start","end","interpolationRatio","colors","themeColors","property","hexToRgb","withAnimation","isDarkTheme","shouldAnimate","startIndex","endIndex","startAt","themeColorTag","querySelector","applyColorAnimationStep","transition","hex","r","g","propertyColors","formatFixedNumber","formatIntegerCompact","views","getFirstLetters","phrase","word","EMPTY_IMAGE_DATA_URI","initWebpWorker","wasmReady","requests","getDecodePromise","ImageData","putImageData","toBlob","createPng","webpToPngBase64","pngBlob","handleLibWebpMessage","WEBSYNC_URLS","WEBSYNC_VERSION","WEBSYNC_KEY","getTs","lastTimeout","authed","currentTs","canRedirect","ts","script","removeElement","URLSearchParams","version","saveSync","IS_LANDSCAPE","isLandscape","initialHeight","windowSize","updateSizes","isRefreshDisabled","handleResize","vh","getIsKeyboardVisible","disableRefresh","enableRefresh","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","__webpack_modules__","call","m","getter","__esModule","getPrototypeOf","obj","ns","create","def","getOwnPropertyNames","definition","o","defineProperty","enumerable","f","chunkId","promises","u","miniCssF","globalThis","Function","done","needAttach","scripts","getElementsByTagName","charset","nc","onScriptComplete","doneFns","bind","head","toStringTag","scriptUrl","importScripts","currentScript","fullhref","existingLinkTags","dataHref","existingStyleTags","findStylesheet","linkTag","errorType","realHref","createStylesheet","miniCss","baseURI","installedChunks","installedChunkData","realSrc","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","chunkLoadingGlobal","handleWorkerMessage","register","INITIAL_STATE","isLeftColumnShown","activeChatFolder","recentEmojis","added","recent","greeting","featured","emojiKeywords","saved","inlineBots","byUsername","topPeers","topInlineBots","audioPlayer","notifications","dialogs","messageSendKeyCombo","shouldSuggestStickers","light","isBlurred","patternColor","dark","shouldShowContextMenuHint","updateCacheThrottled","updateCache","unsubscribeFromBeforeUnload","isCaching","isHeavyAnimating","setupCaching","clearCaching","reducedGlobal","reduceShowChatInfo","reduceUsers","reduceChats","reduceMessages","recentlyFoundChatIds","reduceSettings","reduceChatFolders","idsToSave","cid","chatIdsToSave","mainThread","initialState","time","timeEnd","readCache","loadCache","STORAGE_KEY","tabKey","SITE_FONTS","preloadFonts","font","fonts","load","preloadAvatars","preloadTasks","main","telegramLogoPath","authCode","monkeyPath","authPassword","background","backgroundColor","hasCustomBackground","hasCustomBackgroundColor","isRightColumnShown","setIsUiReady","isReady","markReady","useFlag","shouldRenderMask","safePreload","translation","setTranslation","getSuggestedLanguage","suggestedLanguage","MENU_HIDING_DURATION","inputRef","setFilter","filteredList","setFilteredList","updateFilter","filterValue","getFilteredList","countryId","firstElementChild","dataset","handleInput","handleInputKeyDown","DropdownMenu","handleTrigger","select","formEl","getElementById","scrollTo","top","scrollHeight","behavior","inputValue","Spinner","MenuItem","isPreloadInitiated","setAuthPhoneNumber","setAuthRememberMe","loadNearestCountry","clearAuthError","goToAuthQrCode","setSettingOption","continueText","useLangString","setCountry","setPhoneNumber","isTouched","setIsTouched","lastSelection","setLastSelection","markIsLoading","unmarkIsLoading","fullNumber","canSubmit","parseFullNumber","newFullNumber","suggestedCountry","selectedCountry","handleLangChange","setSelectionRange","isJustPastedRef","handlePaste","handlePhoneNumberChange","selectionStart","selectionEnd","shouldFixSafariAutoComplete","handleKeepSessionChange","isAuthReady","onSubmit","InputText","Checkbox","Button","Loading","AuthCode","useModuleLoader","AuthPassword","AuthRegister","G","H","B","QrCreator","h","J","level","O","C","lineTo","arcTo","moveTo","z","v","N","K","P","fillStyle","fillRect","left","beginPath","q","D","E","R","I","F","fill","colorStops","createLinearGradient","apply","createRadialGradient","addColorStop","A","minVersion","maxVersion","ecLevel","radius","quiet","HTMLCanvasElement","clearRect","write","S","multiply","L","M","Q","returnToAuthPhoneNumber","qrCodeRef","token","isMobile","AuthQrCode","appInactivePath","renderMain","disconnect","isInactive","markInactive","TeactDOM"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/main.d9882afcc7d8fd6c3156.js b/dist/main.d9882afcc7d8fd6c3156.js new file mode 100644 index 00000000..ff927c22 --- /dev/null +++ b/dist/main.d9882afcc7d8fd6c3156.js @@ -0,0 +1,2 @@ +(()=>{"use strict";var e,t,n,r,o,d,u={1226:(e,t,n)=>{n.d(t,{t9:()=>c,u3:()=>l,g8:()=>i});var r=n(3716),o=n(6926),d=n(9118);let u;const a=new Map,s=new Map;function i(e,t){return u||(r.eM&&console.log(">>> START LOAD WORKER"),u=new Worker(new URL(n.p+n.u(514),n.b)),function(e){u.addEventListener("message",(({data:t})=>{if("update"===t.type)e(t.update);else if("methodResponse"===t.type){const e=a.get(t.messageId);e&&(t.error?e.reject(t.error):e.resolve(t.response))}else if("methodCallback"===t.type){var n,r;null===(n=a.get(t.messageId))||void 0===n||null===(r=n.callback)||void 0===r||r.call(n,...t.callbackArgs)}else if("unhandledError"===t.type)throw t.error}))}(e),"iOS"===t.platform&&window.addEventListener("focus",(async()=>{try{await Promise.race([f({type:"ping"}),(0,d.wO)(150).then((()=>Promise.reject(new Error("HEALTH_CHECK_TIMEOUT"))))])}catch(e){console.error(e),Date.now()-h>=5e3&&window.location.reload()}}))),f({type:"initApi",args:[t]})}function c(e,...t){if(u)return f({type:"callMethod",name:e,args:t});r.eM&&console.warn("API is not initialized")}function l(e){e.isCanceled=!0;const{messageId:t}=s.get(e)||{};t&&u.postMessage({type:"cancelProgress",messageId:t})}function f(e){const t=(0,o.Z)(a),n={messageId:t,...e},r={messageId:t},d=new Promise(((e,t)=>{Object.assign(r,{resolve:e,reject:t})}));if("args"in n&&"function"==typeof n.args[1]){const e=n.args.pop();r.callback=e,s.set(e,r)}return a.set(t,r),d.catch((()=>{})).finally((()=>{a.delete(t),r.callback&&s.delete(r.callback)})),u.postMessage(n),d}const h=Date.now()},6137:(e,t,n)=>{n.d(t,{Vv:()=>r.Vv,_f:()=>r._f,_Q:()=>r._Q,IU:()=>o.I});var r=n(4746),o=n(9077)},9077:(e,t,n)=>{let r;n.d(t,{I:()=>r}),function(e){e[e.DataUri=0]="DataUri",e[e.BlobUrl=1]="BlobUrl",e[e.Lottie=2]="Lottie",e[e.Progressive=3]="Progressive",e[e.Stream=4]="Stream"}(r||(r={}))},4746:(e,t,n)=>{let r;n.d(t,{Vv:()=>r,_f:()=>o,_Q:()=>d}),function(e){e.Bold="MessageEntityBold",e.Blockquote="MessageEntityBlockquote",e.BotCommand="MessageEntityBotCommand",e.Cashtag="MessageEntityCashtag",e.Code="MessageEntityCode",e.Email="MessageEntityEmail",e.Hashtag="MessageEntityHashtag",e.Italic="MessageEntityItalic",e.MentionName="MessageEntityMentionName",e.Mention="MessageEntityMention",e.Phone="MessageEntityPhone",e.Pre="MessageEntityPre",e.Strike="MessageEntityStrike",e.TextUrl="MessageEntityTextUrl",e.Url="MessageEntityUrl",e.Underline="MessageEntityUnderline",e.Unknown="MessageEntityUnknown"}(r||(r={}));const o=-1,d="MESSAGE_DELETED"},88:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),o=n(5116);const d=36,u=2147483647;function a(e,t,n){let r;for(e=n?Math.floor(e/700):e>>1,e+=Math.floor(e/t),r=0;e>455;r+=d)e=Math.floor(e/35);return Math.floor(r+36*e/(e+38))}function s(e,t){const n=[],r=[],o=e.length;let s,i,c,l,f,h,m,p,g,y,v,b,w;for(s=128,c=0,l=72,f=e.lastIndexOf("-"),f<0&&(f=0),h=0;h=128)throw new RangeError("Illegal input >= 0x80");n.push(e.charCodeAt(h))}for(m=f>0?f+1:0;m=o)throw RangeError("punycode_bad_input(1)");if(v=(I=e.charCodeAt(m++))-48<10?I-22:I-65<26?I-65:I-97<26?I-97:d,v>=d)throw RangeError("punycode_bad_input(2)");if(v>Math.floor((u-c)/g))throw RangeError("punycode_overflow(1)");if(c+=v*g,b=y<=l?1:y>=l+26?26:y-l,vMath.floor(u/(d-b)))throw RangeError("punycode_overflow(2)");g*=d-b}if(i=n.length+1,l=a(c-p,i,0===p),Math.floor(c/i)>u-s)throw RangeError("punycode_overflow(3)");s+=Math.floor(c/i),c%=i,t&&r.splice(c,0,e.charCodeAt(m-1)-65<26),n.splice(c,0,s),c++}var I;if(t)for(c=0,w=n.length;c{const t=[];let n=0;const r=e.length;let o;for(;n65535&&(o-=65536,t.push(String.fromCharCode(o>>>10&1023|55296)),o=56320|1023&o),t.push(String.fromCharCode(o))}return t.join("")})(n)}var i=n(3716),c=n(6752);function l(e){if(e)return e.includes("://")?e:`https://${e}`}function f(e){if(!e)return;const t=l(e);if(t)try{let e=decodeURI(t);const n=e.match(/^https?:\/\/([^/:?#]+)(?:[/:?#]|$)/i);if(!n)return;const r=n[1];return e=e.replace(r,function(e){const t=e.split("."),n=[];for(let e=0;e{const{toggleSafeLinkModal:a,openTelegramLink:s}=(0,o.uC)(),h=d||t,m=e!==h,p=(0,r.I4)((t=>t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e||!e.match(i.FS)&&!e.match(i.Lj)?!m||(a({url:e}),t.preventDefault(),!1):(t.preventDefault(),s({url:e}),!1)),[m,s,a,e]);if(!e)return;const g=(0,c.Z)(n||"text-entity-link",t.length>50&&"long-word-break-all");return r.ZP.createElement("a",{href:l(e),title:f(e),target:"_blank",rel:"noopener noreferrer",className:g,onClick:p,dir:u?"rtl":"auto"},h)}))},5376:(e,t,n)=>{n.d(t,{yW:()=>r,K2:()=>o,mD:()=>d,Oh:()=>u,v6:()=>a});function r(e){return e>536870912?`${(e/1073741824).toFixed(1)} GB`:e>524288?`${(e/1048576).toFixed(1)} MB`:`${(e/1024).toFixed(1)} KB`}function o(e){const{fileName:t,mimeType:n}=e;return d(t,n)}function d(e,t){return e&&-1!==e.indexOf(".")?e.split(".").pop():t.split("/").pop()}function u(e){switch(e){case"apk":case"xls":case"xlsx":return"green";case"zip":case"rar":case"7z":case"tar":case"gz":case"ppt":case"pptx":return"orange";case"pdf":case"xps":return"red";default:return"default"}}function a(e){return Boolean(e.previewBlobUrl||e.thumbnail)}},4784:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(3681);const o=new RegExp(`^(?:${r.Z.source})+$`,""),d=e=>{if(e.length>24)return!1;if(!Boolean(e.match(o)))return!1;let t=0;for(;r.Z.exec(e);)if(t++,t>3)return r.Z.lastIndex=0,!1;return t}},2864:(e,t,n)=>{n.d(t,{D:()=>p});var r=n(4050),o=n(2858),d=n(8035),u=n(9937),a=n(2340),s=n(5116),i=n(782),c=n(6752),l=n(8033);const f=(0,s.c$)(void 0,((e,t)=>(0,i.ei)(t,["openUserInfo"])))((({className:e,sender:t,openUserInfo:n,children:o})=>{const d=(0,r.I4)((()=>{t&&n({id:t.id})}),[t,n]);return t?r.ZP.createElement(l.Z,{className:(0,c.Z)("UserLink",e),onClick:d},o):o})),h=(0,s.c$)(void 0,((e,t)=>(0,i.ei)(t,["focusMessage"])))((({className:e,message:t,children:n,focusMessage:o})=>{const d=(0,r.I4)((()=>{t&&o({chatId:t.chatId,messageId:t.id})}),[o,t]);return t?r.ZP.createElement(l.Z,{className:(0,c.Z)("MessageLink",e),onClick:d},n):n})),m=(0,s.c$)(void 0,((e,t)=>(0,i.ei)(t,["openChat"])))((({className:e,chatId:t,openChat:n,children:o})=>{const d=(0,r.I4)((()=>{t&&n({id:t})}),[t,n]);return t?r.ZP.createElement(l.Z,{className:(0,c.Z)("ChatLink",e),onClick:d},o):o}));function p(e,t,n,s,i,c,l={}){if(!t.content.action)return[];const{text:f,translationValues:p,amount:v,currency:b}=t.content.action,w=[],I={...l,maxTextLength:32};let C,E=e("Chat.Service.Group.UpdatedPinnedMessage1"!==f||i?f:"Message.PinnedGenericMessage",p&&p.length?p:void 0);return E.includes("%payment_amount%")&&(C=y(E,"%payment_amount%",(0,u.x)(v,b,e.code)),E=C.pop(),w.push(...C)),C=y(E,"%action_origin%",n?!l.isEmbedded&&function(e,t,n){return(0,o.iX)(t)?function(e,t,n){const u=(0,d.Z)((0,o.U)(e,t));return n?u:r.ZP.createElement(m,{className:"action-link",chatId:t.id},t&&(0,a.Z)(u))}(e,t,n):g(t,n)}(e,n,l.asPlain)||" ":"User"),E=C.pop(),w.push(...C),C=y(E,"%target_user%",s?s.map((e=>g(e,l.asPlain))).filter(Boolean):"User"),E=C.pop(),w.push(...C),C=y(E,"%message%",i?function(e,t,n={}){const u=(0,o.MK)(e,t),{photo:s,video:i,document:c,sticker:l}=(0,o.qp)(t),{maxTextLength:f,isEmbedded:m,asPlain:p}=n,g=m&&u&&!s&&!i&&!c&&!l;let y=(0,d.Z)(u,f);return m&&(s?y="a photo":i?y=i.isGif?"a GIF":"a video":c?y="a document":l&&(y=u)),p?g?`«${y}»`:y:g?r.ZP.createElement("span",null,"«",r.ZP.createElement(h,{className:"action-link",message:t},(0,a.Z)(y)),"»"):r.ZP.createElement(h,{className:"action-link",message:t},(0,a.Z)(y))}(e,i,I):"a message"),E=C.pop(),w.push(...C),C=y(E,"%product%",i?function(e){return e.content&&e.content.invoice?e.content.invoice.title:"a product"}(i):"a product"),E=C.pop(),w.push(...C),C=y(E,"%target_chat%",c?function(e,t){const n="another chat";return t?n:r.ZP.createElement(m,{className:"action-link",chatId:e},n)}(c,l.asPlain):"another chat"),w.push(...C),l.asPlain?w.join("").trim():w}function g(e,t){const n=(0,d.Z)((0,o.Js)(e));return t?n:r.ZP.createElement(f,{className:"action-link",sender:e},e&&(0,a.Z)(n))}function y(e,t,n){const r=e.indexOf(t);if(r<0||!n)return[e];const o=[];return o.push(e.substring(0,r)),Array.isArray(n)?n.forEach(((e,t)=>{o.push(e),t+1{n.d(t,{Z:()=>h});var r=n(4050),o=n(3681),d=n(3716),u=n(7361),a=n(4284),s=n(6752),i=n(7373),c=n(88);const l=/^[\d\wа-яё]$/i,f=/(\*\*|__).+?\1/g;function h(e,t=["emoji"],n){return"string"!=typeof e?[e]:t.reduce(((e,t)=>{switch(t){case"escape_html":return function(e){const t=document.createElement("div");return e.reduce(((e,n)=>"string"!=typeof n?[...e,n]:(t.innerText=n,[...e,t.innerHTML])),[])}(e);case"hq_emoji":return o.Z.lastIndex=0,m(e,"big","jsx");case"emoji":return o.Z.lastIndex=0,m(e,"small","jsx");case"emoji_html":return o.Z.lastIndex=0,m(e,"small","html");case"br":return p(e,"jsx");case"br_html":return p(e,"html");case"highlight":return d=e,u=n.highlight,d.reduce(((e,t)=>{if("string"!=typeof t||!u)return[...e,t];const n=t.toLowerCase(),o=n.indexOf(u.toLowerCase()),d=n[o+u.length];if(o<0||d&&d.match(l))return[...e,t];const a=[];return a.push(t.substring(0,o)),a.push(r.ZP.createElement("span",{className:"matching-text-highlight"},t.substring(o,o+u.length))),a.push(t.substring(o+u.length)),[...e,...a]}),[]);case"links":return function(e){return e.reduce(((e,t)=>{if("string"!=typeof t)return[...e,t];const n=t.match(g);if(!n||!n.length)return[...e,t];const o=[];let d=n.shift(),u=0;for(;d;){const e=t.indexOf(d,u);o.push(t.substring(u,e)),d.startsWith("@")?o.push(r.ZP.createElement(i.Z,{username:d},d)):(d.endsWith("?")&&(d=d.slice(0,d.length-1)),o.push(r.ZP.createElement(c.Z,{text:d,url:d}))),u=e+d.length,d=n.shift()}return o.push(t.substring(u)),[...e,...o]}),[])}(e);case"simple_markdown":return y(e,"jsx");case"simple_markdown_html":return y(e,"html")}var d,u;return e}),[e])}function m(e,t,n){return u.op?e:e.reduce(((e,d)=>{if("string"!=typeof d)return[...e,d];const u=(d=(0,a.g6)(d)).split(o.Z),i=d.match(o.Z)||[];return e.push(u[0]),i.reduce(((e,d,i)=>{const c=(0,a.U_)((0,o.l)(d));if(!c)return e;const l=(0,s.Z)("emoji","small"===t&&"emoji-small");"jsx"===n&&e.push(r.ZP.createElement("img",{className:l,src:`./img-apple-${"big"===t?"160":"64"}/${c}.png`,alt:d})),"html"===n&&e.push(`${d}`);const f=2*i+2;return u[f]&&e.push(u[f]),e}),e)}),[])}function p(e,t){return e.reduce(((e,n)=>"string"!=typeof n?[...e,n]:[...e,...n.split(/\r\n|\r|\n/g).reduce(((e,n,o,d)=>{const u=n.trimLeft(),a=n.length-u.length;return e.push(String.fromCharCode(160).repeat(a)+u),o!==d.length-1&&e.push("jsx"===t?r.ZP.createElement("br",null):"
"),e}),[])]),[])}const g=new RegExp(`${d.FM}|${d.uW}`,"ig");function y(e,t){return e.reduce(((e,n)=>{if("string"!=typeof n)return[...e,n];const o=n.split(f),d=n.match(f)||[];return e.push(o[0]),d.reduce(((e,n,d)=>{"jsx"===t?e.push(n.startsWith("**")?r.ZP.createElement("b",null,n.replace(/\*\*/g,"")):r.ZP.createElement("i",null,n.replace(/__/g,""))):e.push(n.startsWith("**")?`${n.replace(/\*\*/g,"")}`:`${n.replace(/__/g,"")}`);const u=2*d+2;return o[u]&&e.push(o[u]),e}),e)}),[])}},386:(e,t,n)=>{n.d(t,{q:()=>d,b:()=>u});var r=n(3716),o=n(7361);function d(e,t=!1){o.cj||!document.activeElement||document.activeElement.id!==r.R2||!t&&e.target!==e.currentTarget||e.preventDefault()}function u(e){d(e,!0)}},7373:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050),o=n(5116),d=n(782),u=n(8085);const a=(0,o.c$)(((e,{userId:t})=>({userOrChat:t?(0,u.dy)(e,t):void 0})),((e,t)=>(0,d.ei)(t,["openChat","openChatByUsername"])))((({username:e,userOrChat:t,children:n,openChat:o,openChatByUsername:d})=>r.ZP.createElement("a",{onClick:()=>{t?o({id:t.id}):e&&d({username:e.substring(1)})},className:"text-entity-link",dir:"auto"},n)))},231:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050),o=n(6752),d=n(9204),u=n(8512);const a=({ref:e,type:t="button",onClick:n,onContextMenu:a,onMouseDown:s,onMouseEnter:i,onMouseLeave:c,onFocus:l,children:f,size:h="default",color:m="primary",className:p,round:g,pill:y,fluid:v,isText:b,isLoading:w,ariaLabel:I,href:C,download:E,disabled:S,ripple:P,faded:M,tabIndex:A,isRtl:k})=>{let T=(0,r.sO)(null);e&&(T=e);const[N,R]=(0,r.eJ)(!1),L=(0,o.Z)("Button",p,h,m,g&&"round",y&&"pill",v&&"fluid",S&&"disabled",b&&"text",w&&"loading",P&&"has-ripple",M&&"faded",N&&"clicked"),D=(0,r.I4)((e=>{!S&&n&&n(e),R(!0),setTimeout((()=>{R(!1)}),400)}),[S,n]),O=(0,r.I4)((e=>{e.preventDefault(),!S&&s&&s(e)}),[s,S]);return C?r.ZP.createElement("a",{ref:T,className:L,href:C,title:I,download:E,tabIndex:A,dir:k?"rtl":void 0},f,!S&&P&&r.ZP.createElement(u.Z,null)):r.ZP.createElement("button",{ref:T,type:t,className:L,onClick:D,onContextMenu:a,onMouseDown:O,onMouseEnter:i&&!S?i:void 0,onMouseLeave:c&&!S?c:void 0,onFocus:l&&!S?l:void 0,"aria-label":I,title:I,tabIndex:A,dir:k?"rtl":void 0},w?r.ZP.createElement("div",null,r.ZP.createElement("span",{dir:k?"auto":void 0},"Please wait.."),r.ZP.createElement(d.Z,{color:b?"blue":"white"})):f,!S&&P&&r.ZP.createElement(u.Z,null))}},4605:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050),o=n(6752),d=n(9107),u=n(9204);const a=(0,r.X$)((({id:e,name:t,value:n,label:a,subLabel:s,checked:i,disabled:c,round:l,blocking:f,isLoading:h,onChange:m,onCheck:p})=>{const g=(0,d.Z)(),y=(0,r.I4)((e=>{m&&m(e),p&&p(e.currentTarget.checked)}),[m,p]),v=(0,o.Z)("Checkbox",c&&"disabled",l&&"round",h&&"loading",f&&"blocking");return r.ZP.createElement("label",{className:v,dir:g.isRtl?"rtl":void 0},r.ZP.createElement("input",{type:"checkbox",id:e,name:t,value:n,checked:i,disabled:c,onChange:y}),r.ZP.createElement("div",{className:"Checkbox-main"},r.ZP.createElement("span",{className:"label",dir:"auto"},a),s&&r.ZP.createElement("span",{className:"subLabel",dir:"auto"},s)),h&&r.ZP.createElement(u.Z,null))}))},3106:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(2328);const d=({trigger:e,className:t,children:n,positionX:d="left",positionY:u="top",footer:a,forceOpen:s,onOpen:i,onClose:c})=>{const l=(0,r.sO)(null),f=(0,r.sO)(null),[h,m]=(0,r.eJ)(!1);return r.ZP.createElement("div",{ref:f,className:`DropdownMenu ${t||""}`,onKeyDown:e=>{const t=l.current;if(!h||40!==e.keyCode||!t)return;const n=document.activeElement,r=Array.from(t.children);n&&-1!==r.indexOf(n)||r[0].focus()}},e({onTrigger:()=>{m(!h),h?c&&c():i&&i()},isOpen:h}),r.ZP.createElement(o.Z,{ref:l,containerRef:f,isOpen:h||!!s,className:t||"",positionX:d,positionY:u,footer:a,autoClose:!0,onClose:()=>{m(!1),c&&c()},shouldSkipTransition:s},n))}},7687:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),o=n(6752),d=n(9107);const u=(0,r.X$)((({ref:e,id:t,className:n,value:u,label:a,error:s,success:i,disabled:c,readOnly:l,placeholder:f,autoComplete:h,inputMode:m,maxLength:p,onChange:g,onInput:y,onKeyPress:v,onKeyDown:b,onBlur:w,onPaste:I})=>{const C=(0,d.Z)(),E=s||i||a,S=(0,o.Z)("input-group",u&&"touched",s?"error":i&&"success",c&&"disabled",l&&"disabled",E&&"with-label",n);return r.ZP.createElement("div",{className:S,dir:C.isRtl?"rtl":void 0},r.ZP.createElement("input",{ref:e,className:"form-control",type:"text",id:t,dir:"auto",value:u||"",placeholder:f,maxLength:p,autoComplete:h,inputMode:m,disabled:c,readOnly:l,onChange:g,onInput:y,onKeyPress:v,onKeyDown:b,onBlur:w,onPaste:I}),E&&r.ZP.createElement("label",{htmlFor:t},E))}))},8033:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(6752);const d=({children:e,className:t,isRtl:n,onClick:d})=>{const u=(0,r.I4)((e=>{e.preventDefault(),d(e)}),[d]);return r.ZP.createElement("a",{href:"#",className:(0,o.Z)("Link",t),dir:n?"rtl":"auto",onClick:d?u:void 0},e)}},4288:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(9204);const d=(0,r.X$)((({color:e="blue"})=>r.ZP.createElement("div",{className:"Loading"},r.ZP.createElement(o.Z,{color:e,withBackground:"white"===e}))))},2328:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),o=n(1212),d=n(2313),u=n(8758),a=n(274),s=n(3989),i=n(6752),c=n(8674),l=n(6590),f=n(386);const h=({ref:e,containerRef:t,isOpen:n,className:h,style:m,children:p,positionX:g="left",positionY:y="top",autoClose:v=!1,footer:b,noCloseOnBackdrop:w=!1,onCloseAnimationEnd:I,onClose:C,onMouseEnter:E,onMouseLeave:S,shouldSkipTransition:P})=>{let M=(0,r.sO)(null);e&&(M=e);const A=t||M,{transitionClassNames:k}=(0,o.Z)(n,I,P,void 0,P);(0,r.d4)((()=>n&&C?(0,s.Z)(C):void 0),[n,C]),(0,l.ZP)(n,C,void 0,void 0,v),(0,a.Z)((([e])=>{void 0!==e&&(0,c.YW)(200)}),[n]);const T=(0,d.Z)(M,n,v?C:void 0,void 0,!0);(0,u.Z)(n,A,w?void 0:C);const N=(0,i.Z)("bubble menu-container custom-scroll",y,g,b&&"with-footer",k);return r.ZP.createElement("div",{className:(0,i.Z)("Menu no-selection",h),onKeyDown:n?T:void 0,onMouseEnter:E,onMouseLeave:n?S:void 0,style:m},n&&r.ZP.createElement("div",{className:"backdrop",onMouseDown:f.b}),r.ZP.createElement("div",{ref:M,className:N,style:`transform-origin: ${y} ${g}`,onClick:v?C:void 0},p,b&&r.ZP.createElement("div",{className:"footer"},b)))}},8964:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),o=n(6752),d=n(9107);const u=e=>{const{icon:t,className:n,children:u,onClick:a,href:s,download:i,disabled:c,destructive:l,ariaLabel:f}=e,h=(0,d.Z)(),m=(0,r.I4)((e=>{if(c||!a)return e.stopPropagation(),void e.preventDefault();a(e)}),[c,a]),p=(0,r.I4)((e=>{if(13===e.keyCode||32===e.keyCode)return c||!a?(e.stopPropagation(),void e.preventDefault()):void a(e)}),[c,a]),g=(0,o.Z)("MenuItem",n,c&&"disabled",l&&"destructive"),y=r.ZP.createElement(r.ZP.Fragment,null,t&&r.ZP.createElement("i",{className:`icon-${t}`,"data-char":t.startsWith("char-")?t.replace("char-",""):void 0}),u);return s?r.ZP.createElement("a",{tabIndex:0,className:g,href:s,download:i,"aria-label":f,title:f,target:s.startsWith(window.location.origin)?"_self":"_blank",rel:"noopener noreferrer",dir:h.isRtl?"rtl":void 0,onClick:a},y):r.ZP.createElement("div",{role:"button",tabIndex:0,className:g,onClick:m,onKeyDown:p,"aria-label":f,title:f,dir:h.isRtl?"rtl":void 0},y)}},8512:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(9118);const d=(0,r.X$)((()=>{const[e,t]=(0,r.eJ)([]),n=(0,r.Ye)((()=>(0,o.Ds)((()=>{t([])}),700,!1)),[]),d=(0,r.I4)((r=>{if(0!==r.button)return;const o=r.currentTarget,d=o.getBoundingClientRect(),u=o.offsetWidth/2;t([...e,{x:r.clientX-d.x-u/2,y:r.clientY-d.y-u/2,size:u}]),requestAnimationFrame((()=>{n()}))}),[e,n]);return r.ZP.createElement("div",{className:"ripple-container",onMouseDown:d},e.map((({x:e,y:t,size:n})=>r.ZP.createElement("span",{style:`left: ${e}px; top: ${t}px; width: ${n}px; height: ${n}px;`}))))}))},9204:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(6752);const d=({color:e="blue",withBackground:t})=>r.ZP.createElement("div",{className:(0,o.Z)("Spinner",e,t&&"with-background")},r.ZP.createElement("div",null))},3716:(e,t,n)=>{n.d(t,{Ti:()=>r,ou:()=>o,iC:()=>d,Ji:()=>u,eM:()=>a,ZT:()=>s,Cg:()=>i,S:()=>c,b_:()=>l,Vx:()=>f,sd:()=>h,Uh:()=>m,gJ:()=>p,lO:()=>g,Cy:()=>y,lW:()=>v,SG:()=>b,lF:()=>w,fo:()=>I,ee:()=>C,lo:()=>S,gZ:()=>P,hT:()=>M,YQ:()=>A,rS:()=>k,t_:()=>T,Ov:()=>N,EN:()=>R,pn:()=>L,Hk:()=>D,Vk:()=>O,mo:()=>x,qU:()=>_,ul:()=>Z,NM:()=>B,oB:()=>F,zy:()=>U,CX:()=>$,xS:()=>j,b6:()=>W,AR:()=>H,r_:()=>V,R2:()=>G,nY:()=>Q,QU:()=>z,jT:()=>K,_m:()=>J,ks:()=>q,l3:()=>Y,u_:()=>X,rO:()=>ee,AE:()=>te,fK:()=>ne,V$:()=>re,bK:()=>oe,ck:()=>de,xn:()=>ue,K7:()=>ae,w7:()=>se,z7:()=>ie,qp:()=>ce,Q:()=>le,Mw:()=>fe,DC:()=>he,Y7:()=>me,yK:()=>pe,K2:()=>ge,bM:()=>ye,ku:()=>ve,zq:()=>be,n:()=>we,pR:()=>Ie,kU:()=>Ce,Y:()=>Ee,AK:()=>Se,FM:()=>Pe,uW:()=>Me,FS:()=>Ae,Lj:()=>ke,aw:()=>Te,FV:()=>Ne,Nf:()=>Re,WS:()=>Le,DU:()=>De,EG:()=>Oe,t4:()=>xe,sR:()=>_e,$O:()=>Ze,Bg:()=>Be,vi:()=>Fe,Db:()=>Ue,mU:()=>$e,p3:()=>je,It:()=>We,Vv:()=>He,g:()=>Ve});const r="Telegram",o=" [Inactive]",d="Telegram WebZ",u="1.12.1",a=!1,s=!1,i=!1,c="Shoot!\nSomething went wrong, please see the error details in Dev Tools Console.",l="user_auth",f="GramJs:sessionId",h=!1,m="tt-global-state",p=30,g=5e3,y=!1,v="tt-media",b="tt-media-avatars",w="tt-media-progressive",I="tt-custom-bg",C="tt-lang-packs-v5",E="undefined"!=typeof window&&window.innerHeight>=900,S=1,P=750,M=E?60:40,A=2*M,k=72,T=E?30:25,N=100,R=42,L=42,D=20,O=30,x=200,_=500,Z=20,B=!1,F=0,U=2,$=U,j=16,W=17,H=15,V=1e4,G="editable-message-text",Q="editable-message-text-modal",z=1440,K=1150,J=1275,q=925,Y=600,X=950,ee=450,te=1e9,ne=100,re=1500,oe=250,de=600,ue=500,ae=(Math.round((oe+de)/2),new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory"]),13),se=11,ie=160,ce=120,le=64,fe=48,he=32,me=64,pe=64,ge=160,ye=140,ve=80,be=100,we="MEMOJI_STICKER",Ie="en",Ce=200,Ee=450,Se=new Set(["image/png","image/gif","image/jpeg","video/mp4","video/avi","video/quicktime"]),Pe="((ftp|https?):\\/\\/)?((www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,63})\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)",Me="(@[\\w\\d_-]+)",Ae=/^(?:https?:\/\/)?(?:t\.me\/)([\d\w_]+)(?:\/([\d]+))?(?:\/([\d]+))?$/gm,ke=/^(?:https?:\/\/)?(?:t\.me\/joinchat\/)([\d\w_-]+)?$/gm,Te=777e3,Ne=1271266957,Re=0,Le=1,De=10,Oe=5,xe=2147483646,_e="en",Ze="android",Be=["android","ios","tdesktop","macos"],Fe="TelegramTips",Ue=["ar","pt-br","id","it","ko","ms","pl","es","tr"],$e="https://bugs.telegram.org/?tag_ids=41&sort=time",je="#A2AF8E",We="#0F0F0F",He="#0a0a0a8c",Ve="rgba(90, 110, 70, 0.6)"},274:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(7204);const d=(e,t,n)=>{const d=(0,o.Z)(t);return(0,r.d4)((()=>e(d||[])),t,n)}},706:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);const o=(e=!1)=>{const[t,n]=(0,r.eJ)(e);return[t,(0,r.I4)((()=>{n(!0)}),[]),(0,r.I4)((()=>{n(!1)}),[])]}},5326:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);const o=()=>{const[,e]=(0,r.eJ)(!1);return(0,r.I4)((()=>{e((e=>!e))}),[])}},8674:(e,t,n)=>{n.d(t,{_L:()=>o,OV:()=>d,YW:()=>s,ZP:()=>i});var r=n(4050);const o="tt-event-heavy-animation-start",d="tt-event-heavy-animation-end";let u,a=!1;const s=e=>(a||(a=!0,document.dispatchEvent(new Event(o))),u&&(clearTimeout(u),u=void 0),e&&(u=window.setTimeout((()=>{a=!1,document.dispatchEvent(new Event(d)),u=void 0}),e)),()=>{a=!1,document.dispatchEvent(new Event(d))}),i=(e,t)=>{(0,r.d4)((()=>(a&&e(),document.addEventListener(o,e),document.addEventListener(d,t),()=>{document.removeEventListener(d,t),document.removeEventListener(o,e)})),[t,e])}},6590:(e,t,n)=>{n.d(t,{Oy:()=>s,Wv:()=>c,ZP:()=>f});var r=n(4050),o=n(7361),d=n(7204),u=n(5116),a=n(782);const s=window.location.hash,i={currentIndex:0,nextStateIndexToReplace:-1,isHistoryAltered:!1,isDisabled:!1,isEdge:!1,currentIndexes:[]},c=()=>{i.isDisabled=!0},l=()=>{i.isEdge&&setTimeout((()=>{i.isEdge=!1}),350)};function f(e,t,n,o,s=!1,c){const l=(0,r.sO)(-1),f=(0,r.sO)(!1),h=(0,d.Z)(e),m=(0,r.sO)(!0),p=(0,r.sO)([]),g=(0,d.Z)(c),y=(0,r.sO)(!1),v=(0,r.I4)(((t=!1)=>{if(c){const e=g||[];if(e.length{const e=++i.currentIndex;i.currentIndexes.push(e),window.history.pushState({index:e,state:o},"",`#${c[c.length-1]}`),p.current.push({index:e,hash:c[c.length-1]})}),0);else{const t=e.length-c.length;if(y.current)y.current=!1;else{if(c.length!==p.current.length&&t>0){const e=p.current[p.current.length-t-1];let n=t;if(e){const t=i.currentIndexes.findIndex((t=>t===e.index));n=i.currentIndexes.length-t-1}i.isHistoryAltered=!0,window.history.go(-n),p.current.splice(p.current.length-t-1,t).forEach((({index:e})=>{i.currentIndexes.splice(i.currentIndexes.indexOf(e),1)}))}c.length>0&&setTimeout((()=>{const e=++i.currentIndex;i.currentIndexes[i.currentIndexes.length-1]=e,window.history.replaceState({index:e,state:o},"",`#${c[c.length-1]}`),p.current[p.current.length-1]={index:e,hash:c[c.length-1]}}),0)}}}else e&&!t&&(m.current=!1,f.current?(f.current=!1,i.currentIndexes.push(l.current)):setTimeout((()=>{const e=++i.currentIndex;i.currentIndexes.push(e),window.history[i.currentIndexes.includes(i.nextStateIndexToReplace-1)&&0!==window.history.state.index&&i.nextStateIndexToReplace===e&&!s?"replaceState":"pushState"]({index:e,state:o},""),l.current=e,s&&(i.nextStateIndexToReplace=i.currentIndex+1)}),0)),!t&&e||m.current||(l.current!==i.currentIndex&&s||(i.isHistoryAltered=!0,window.history.back(),setTimeout((()=>{i.nextStateIndexToReplace=-1}),400)),i.currentIndexes.splice(i.currentIndexes.indexOf(l.current),1),m.current=!0)}),[o,c,e,g,s]);return(0,r.d4)((()=>{const r=e=>{if(i.isHistoryAltered)return void setTimeout((()=>{i.isHistoryAltered=!1}),0);const{index:r}=e.state,o=r||0;try{const r=c?p.current[p.current.length-1].index:l.current,d=i.currentIndexes[i.currentIndexes.indexOf(r)-1];if(i.isDisabled)return;!m.current&&(0===o||o===d)||c&&(0===o||o===d)?(c&&(y.current=!0,p.current.pop()),i.currentIndexes.splice(i.currentIndexes.indexOf(r),1),t&&(i.isEdge&&(0,u.uC)().disableHistoryAnimations(),t(!i.isEdge),m.current=!0)):o===r&&m.current&&n&&!c&&(f.current=!0,i.isEdge&&(0,u.uC)().disableHistoryAnimations(),n(e.state.state))}catch(e){}},o=c?!g||!(0,a.et)(g,c):h!==e;return!i.isDisabled&&o&&v(),window.addEventListener("popstate",r),()=>window.removeEventListener("popstate",r)}),[o,v,c,e,t,n,g,h,s]),{forceClose:()=>v(!0)}}o.cj&&(window.addEventListener("touchstart",(e=>{const t=e.touches[0].pageX;(t<=300||t>=window.innerWidth-300)&&(i.isEdge=!0)})),window.addEventListener("touchend",l),window.addEventListener("popstate",l)),window.history.replaceState({index:i.currentIndex},"",window.location.pathname)},2313:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);const o=(e,t,n,o,d)=>{const[u,a]=(0,r.eJ)(-1);return(0,r.d4)((()=>{a(-1);const n=e.current;t&&n&&!d&&(n.tabIndex=-1,n.focus())}),[e,t,d]),(0,r.I4)((t=>{const r=e.current;if(!r)return;if(13===t.keyCode&&n)return void n(u);if(38!==t.keyCode&&40!==t.keyCode)return;const d=document.activeElement,s=Array.from(o?r.querySelectorAll(o):r.children);let i=d&&s.indexOf(d)||u;if(38===t.keyCode&&i>0)i--;else if(40===t.keyCode&&i{n.d(t,{Z:()=>u});var r=n(663),o=n(5326),d=n(9290);const u=()=>{const e=(0,o.Z)();return(0,d.Z)((()=>r.ll(e)),[e]),r.i0}},8778:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),o=n(9203),d=n(5326);const u=(e,t,n=!1,u=!1)=>{const a=(0,o.o5)(e,t),s=(0,d.Z)();return u&&(0,o.Qt)(s),(0,r.d4)((()=>{n||a||(0,o.$y)(e,t).then(s)}),[e,s,a,t,n]),a}},9290:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(7204);const o=(e,t)=>{const n=(0,r.Z)(t);n&&!t.some(((e,t)=>e!==n[t]))||e(n||[])}},7204:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);const o=function(e,t){const n=(0,r.sO)(),{current:o}=n;return t&&void 0===e||(n.current=e),o}},1212:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),o=n(6752);const d=(e=!1,t,n=!1,d="fast",u=!1)=>{const[a,s]=(0,r.eJ)(!e),i=(0,r.sO)(),[c,l]=(0,r.eJ)(e&&n);e?(s(!1),l(!0),i.current&&(window.clearTimeout(i.current),i.current=void 0)):(l(!1),a||i.current||(i.current=window.setTimeout((()=>{s(!0),t&&t(),i.current=void 0}),u?0:350)));const f=c&&!(u&&!e),h=Boolean(i.current),m=e||h;return{shouldRender:m,transitionClassNames:(0,o.Z)(d&&"opacity-transition",d,f&&"open",m&&"shown",h&&"closing")}}},8758:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);function o(e,t,n){(0,r.d4)((()=>{const r=e=>{const r=t.current,o=e.target;r&&o&&(r.contains(e.target)&&!o.classList.contains("backdrop")||(e.preventDefault(),e.stopPropagation(),n&&n()))};return e&&n&&document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}}),[e,t,n])}},5247:(e,t,n)=>{n.d(t,{Oo:()=>s,xg:()=>i,lQ:()=>h});var r=n(3716);const o=new Set(["scroll","mouseenter","mouseleave"]),d={},u=new Map,a={};function s(e,t,n,r=!1){const o=c(t,e);l(o,e,r)?function(e,t,n){a[e]||(a[e]=0,document.addEventListener(e,m)),function(e){return d[e]||(d[e]=new Map),d[e]}(e).set(t,n),function(e){const t=u.get(e);if(t)return t;const n=new Set;return u.set(e,n),n}(t).add(e),a[e]++}(o,e,n):e.addEventListener(o,n,r)}function i(e,t,n,r=!1){const o=c(t,e);l(o,e,r)?f(o,e):e.removeEventListener(o,n,r)}function c(e,t){const n=e.replace(/^on/,"").replace(/Capture$/,"").toLowerCase();return"change"===n&&"SELECT"!==t.tagName?"input":"doubleclick"===n?"dblclick":"focus"===n?"focusin":"blur"===n?"focusout":n}function l(e,t,n){return!n&&!o.has(e)&&"VIDEO"!==t.tagName&&"IFRAME"!==t.tagName}function f(e,t){a[e]--,a[e]||document.removeEventListener(e,m),d[e].delete(t),u.get(t).delete(e)}function h(e){const t=u.get(e);t&&(t.forEach((t=>f(t,e))),u.delete(e))}function m(e){const t=d[e.type];if(t){let n=!1,r=e.target;const o=()=>{n=!0},d=()=>{e.preventDefault()},u=new Proxy(e,{get:(e,t)=>"currentTarget"===t?r:"stopPropagation"===t||"stopImmediatePropagation"===t?o:"preventDefault"===t?d:Reflect.get(e,t)});for(;r&&r!==document.body;){const e=t.get(r);if(e&&(e(u),n))return;r=r.parentNode}}}r.eM&&document.addEventListener("dblclick",(()=>{console.log("DELEGATED EVENTS",{delegationRegistry:d,delegatedEventsByElement:u,documentEventCounters:a})}))},2916:(e,t,n)=>{n.d(t,{Z:()=>v});var r=n(4050),o=n(6926),d=n(3716),u=n(5247);const a=new Set(["key","ref","teactFastList","teactOrderKey"]),s=new Set(["dir"]),i={autoPlay:"autoplay",autoComplete:"autocomplete"},c={};function l(e,t,n,o,u,{skipComponentUpdate:a=!1,forceIndex:s=!1,fragment:i,moveDirection:c}={}){if(!a&&t&&n&&(0,r.op)(t)&&(0,r.op)(n)&&!(0,r.k)(t,n)&&(n=function(e,t){return e.componentInstance.props=t.componentInstance.props,(0,r.SO)(e.componentInstance)}(t,n)),!a&&n&&(0,r.op)(n)&&n.componentInstance.isMounted&&h(n,o,u,e),t===n)return n;if(!t&&n){(0,r.op)(n)&&(n=f(n,o,u,e));const t=m(n);(0,r.CD)(n,t),s&&e.childNodes[u]?e.insertBefore(t,e.childNodes[u]):(i||e).appendChild(t)}else if(t&&!n)e.removeChild((0,r.U9)(t)),(0,r.Zb)(t);else if(t&&n)if((0,r.k)(t,n)){(0,r.op)(n)&&(n=f(n,o,u,e));const d=m(n);(0,r.CD)(n,d),e.replaceChild(d,(0,r.U9)(t)),(0,r.Zb)(t)}else{const o=(0,r.op)(t)&&(0,r.op)(n);if(o||(0,r.CD)(n,(0,r.U9)(t)),(0,r.O_)(t)&&(0,r.O_)(n)){if(c){const n=(0,r.U9)(t),o=e.childNodes["up"===c?u:u+1];o?e.insertBefore(n,o):(i||e).appendChild(n)}o||function(e,t,n){const r=Object.keys(e.props),o=Object.keys(t.props);r.forEach((r=>{void 0!==e.props[r]&&void 0===t.props[r]&&y(n,r,e.props[r])})),o.forEach((r=>{void 0!==t.props[r]&&e.props[r]!==t.props[r]&&(void 0===e.props[r]?g(n,r,t.props[r]):function(e,t,n,r){"value"===t?e.value=void 0!==r?r:"":(y(e,t,n),g(e,t,r))}(n,r,e.props[r],t.props[r]))}))}(t,n,(0,r.U9)(t)),n.children=function(e,t,n){if(t.props.teactFastList)return function(e,t,n){const o=new Set(t.children.map((e=>{const t="props"in e&&e.props.key;return d.eM&&(0,r.O_)(e)&&!t&&console.warn("Missing `key` in `teactFastList`"),t})));let u=0;const a=e.children.reduce(((e,r,d)=>{let a="props"in r?r.props.key:void 0;if(a&&!o.has(a))return l(n,r,void 0,t,-1),e;if(!a){const o=t.children[d],u=o&&"props"in o?o.props.key:void 0;if(!o||u)return l(n,r,void 0,t,-1),e;a=`__indexKey#${d}`}return e[a]={$element:r,index:u++,order:"props"in r?r.props.teactOrderKey:void 0},e}),{});let s,i,c=[],f=0;return t.children.forEach(((e,r)=>{const o="props"in e?e.props.key:`__indexKey#${r}`,d=a[o];if(!d)return s||(s=[],i=r),void s.push(e);s&&(c=c.concat(p(s,i,n,t)),i=void 0,s=void 0);const u="props"in e?e.props.teactOrderKey:void 0,h=d.index!==f&&d.order!==u,m=h&&f>d.index;h&&!m||f++,c.push(l(n,d.$element,e,t,r,{forceIndex:!0,...h&&{moveDirection:m?"down":"up"}}))})),s&&(c=c.concat(p(s,i,n,t))),c}(e,t,n);const o=Math.max(e.children.length,t.children.length),u=[],a=t.children.length>e.children.length+1?document.createDocumentFragment():void 0;for(let r=0;r=e.children.length?{fragment:a}:void 0);o&&u.push(o)}return a&&n.appendChild(a),u}(t,n,o?e:(0,r.U9)(t))}}return n}function f(e,t,n,o){if(!(0,r.op)(e))return e;const{componentInstance:d}=e;if(!d.isMounted){h(e=(0,r.Hb)(d),t,n,o);const u=e.children[0];(0,r.op)(u)&&(e.children=[f(u,e,0,o)]),d.isMounted=!0}return e}function h(e,t,n,r){const{componentInstance:o}=e;o.onUpdate=()=>{t.children[n]=l(r,t.children[n],o.$element,t,n,{skipComponentUpdate:!0})}}function m(e){if((0,r.V2)(e))return document.createTextNode("");if((0,r.iB)(e))return document.createTextNode(e.value);if((0,r.op)(e))return m(e.children[0]);const{tag:t,props:n,children:o=[]}=e,d=document.createElement(t);return"object"==typeof n.ref&&(n.ref.current=d),Object.keys(n).forEach((e=>{g(d,e,n[e])})),e.children=o.map(((t,n)=>l(d,void 0,t,e,n))),d}function p(e,t,n,r){if(1===e.length)return[l(n,void 0,e[0],r,t,{forceIndex:!0})];if(e.length>1){const o=document.createDocumentFragment(),d=e.map((e=>l(n,void 0,e,r,t,{fragment:o})));return n.childNodes[t]?n.insertBefore(o,n.childNodes[t]):n.appendChild(o),d}throw new Error("Unexpected input")}function g(e,t,n){void 0!==n&&("className"===t?e.className=n:"value"===t?e.value=n:"style"===t?e.style.cssText=n:t.startsWith("on")?(0,u.Oo)(e,t,n,t.endsWith("Capture")):t.startsWith("data-")||s.has(t)?e.setAttribute(t,n):a.has(t)||(e[i[t]||t]=n))}function y(e,t,n){"className"===t?e.className="":"value"===t?e.value="":"style"===t?e.style.cssText="":t.startsWith("on")?(0,u.xg)(e,t,n,t.endsWith("Capture")):t.startsWith("data-")||s.has(t)?e.removeAttribute(t):a.has(t)||delete e[i[t]||t]}const v={render:function(e,t){if(!t)return;let n=t.getAttribute("data-teact-head-id");n||(n=(0,o.Z)(c),c[n]={children:[]},t.setAttribute("data-teact-head-id",n));const r=c[n];r.children=[l(t,r.children[0],e,r,0)]}}},4050:(e,t,n)=>{n.d(t,{V2:()=>f,iB:()=>h,op:()=>p,O_:()=>g,SO:()=>E,k:()=>S,Zb:()=>P,Hb:()=>M,U9:()=>T,CD:()=>N,eJ:()=>R,d4:()=>D,bt:()=>O,Ye:()=>x,I4:()=>_,sO:()=>Z,X$:()=>B,ZP:()=>F});var r=n(3716),o=n(9118),d=n(782),u=n(275),a=n(3592),s=n(5247);let i;!function(e){e[e.Empty=0]="Empty",e[e.Text=1]="Text",e[e.Tag=2]="Tag",e[e.Component=3]="Component"}(i||(i={}));const c=Symbol("Fragment");let l;function f(e){return e.type===i.Empty}function h(e){return e.type===i.Text}function m(e){return e.type===i.Tag}function p(e){return e.type===i.Component}function g(e){return m(e)||p(e)}function y(e,t,...n){return t||(t={}),n=(0,d.xH)(n),e===c?n:"function"==typeof e?function(e,t,n){let r;0===n.length?r=void 0:1===n.length?[r]=n:r=n;const o={$element:{},Component:e,name:e.name,props:{...t,...r&&{children:r}},isMounted:!1,hooks:{state:{cursor:0,byCursor:[]},effects:{cursor:0,byCursor:[]},memos:{cursor:0,byCursor:[]}}};return o.$element=v(o),o.$element}(e,t,n):function(e,t,n){return{type:i.Tag,tag:e,props:t,children:b(n).map(I)}}(e,t,n)}function v(e,t=[]){const{props:n}=e;return{componentInstance:e,type:i.Component,props:n,children:t}}function b(e){let t=e.length-1;for(;t>=0&&w(e[t]);t--);return t+17&&console.warn(`[Teact] Slow component render: ${n}, ${Math.round(t)} ms`),C[n].renderTimes.push(t),C[n].renderCount++}}catch(t){(0,a.S)(t),o=e.renderedValue}if(e.isMounted&&o===e.renderedValue)return e.$element;e.renderedValue=o;const d=I(o);return e.$element=v(e,[d]),e.$element}function S(e,t){return typeof e!=typeof t||e.type!==t.type||(h(e)&&h(t)?e.value!==t.value:m(e)&&m(t)?e.tag!==t.tag||e.props.key!==t.props.key:!(!p(e)||!p(t)||e.componentInstance.Component===t.componentInstance.Component&&e.props.key===t.props.key))}function P(e){var t;g(e)&&(p(e)?(t=e.componentInstance).isMounted&&(t.hooks.memos.byCursor.forEach((e=>{e.current=null})),t.hooks.effects.byCursor.forEach((({cleanup:e})=>{if("function"==typeof e)try{e()}catch(e){(0,a.S)(e)}})),t.isMounted=!1,function(e){e.hooks.effects.byCursor.forEach((e=>{e.cleanup=null,e.effect=null,e.dependencies=null})),e.hooks.state.byCursor.forEach((e=>{e.value=null,e.nextValue=null,e.setter=null})),e.hooks.memos.byCursor.forEach((e=>{e.dependencies=null})),e.hooks=null,e.$element=null,e.renderedValue=null,e.Component=null,e.props=null,e.forceUpdate=null,e.onUpdate=null}(t)):e.target&&((0,s.lQ)(e.target),e.target=null),e.children.forEach(P))}function M(e){return E(e),e.isMounted=!0,e.$element}function A(e){e.isMounted&&(e.hooks.state.byCursor.forEach((e=>{e.value=e.nextValue})),e.prepareForFrame=(0,o.wT)((()=>A(e))),e.forceUpdate=(0,o.mS)((()=>k(e))))}function k(e){if(!e.isMounted||!e.onUpdate)return;const t=e.$element;E(e),e.$element!==t&&e.onUpdate()}function T(e){return p(e)?T(e.children[0]):e.target}function N(e,t){p(e)?N(e.children[0],t):e.target=t}function R(e){const{cursor:t,byCursor:n}=l.hooks.state;var d;return void 0===n[t]&&(n[t]={value:e,nextValue:e,setter:(d=l,e=>{n[t].nextValue!==e&&(n[t].nextValue="function"==typeof e?e(n[t].value):e,d.prepareForFrame&&d.forceUpdate||(d.prepareForFrame=(0,o.wT)((()=>A(d))),d.forceUpdate=(0,o.mS)((()=>k(d)))),d.prepareForFrame(),d.forceUpdate(),r.ZT&&"TeactNContainer"!==d.name&&console.log("[Teact.useState]",d.name,d.Component&&d.Component.DEBUG_contentComponentName?`> ${d.Component.DEBUG_contentComponentName}`:"",`Forced update at cursor #${t}, next value: `,n[t].nextValue))})}),l.hooks.state.cursor++,[n[t].value,n[t].setter]}function L(e,t,n,r){const{cursor:o,byCursor:d}=l.hooks.effects,u=l,s=()=>{if(!u.isMounted)return;const{cleanup:e}=d[o];if("function"==typeof e)try{e()}catch(e){(0,a.S)(e)}d[o].cleanup=t()};if(void 0!==d[o]&&n&&d[o].dependencies){if(n.some(((e,t)=>e!==d[o].dependencies[t]))){if(r){const e=n.reduce(((e,t,n)=>{const r=d[o].dependencies[n];return t!==r&&e.push(`${n}: ${r} => ${t}`),e}),[]);console.log("[Teact]",r,"Effect caused by dependencies.",e.join(", "))}e(s)}}else e(s);d[o]={effect:t,dependencies:n,cleanup:d[o]?d[o].cleanup:void 0},l.hooks.effects.cursor++}function D(e,t,n){return L(o.T2,e,t,n)}function O(e,t,n){return L(o.R3,e,t,n)}function x(e,t,n){const{cursor:o,byCursor:d}=l.hooks.memos;let{current:a}=d[o]||{};return(void 0===d[o]||t.some(((e,t)=>e!==d[o].dependencies[t])))&&(r.eM&&n&&console.log(`[Teact.useMemo] ${l.name} (${n}): Update is caused by:`,d[o]?(0,u.c)(t,d[o].dependencies).join(", "):"[first render]"),a=e()),d[o]={current:a,dependencies:t},l.hooks.memos.cursor++,a}function _(e,t){return x((()=>e),t)}function Z(e){return x((()=>({current:e})),[])}function B(e,t=u.Z,n){return function(o){const d=Z(o),a=Z();return(!a.current||d.current&&!t(d.current,o))&&(r.eM&&n&&console.log(`[Teact.memo] ${e.name} (${n}): Update is caused by:`,(0,u.c)(d.current,o).join(", ")),d.current=o,a.current=y(e,o)),a.current}}document.addEventListener("dblclick",(()=>{console.log("COMPONENTS",(0,d.Xo)(Object.values(C),"renderCount","desc"))}));const F={createElement:y,Fragment:c}},5116:(e,t,n)=>{n.d(t,{ZP:()=>f,R3:()=>w,Rd:()=>I,uC:()=>C,Q6:()=>E,ll:()=>S,Iq:()=>P,c$:()=>M});var r=n(4050),o=n(3716),d=n(5326),u=n(6926),a=n(9118),s=n(275),i=n(782),c=n(3592);function l(){return(l=Object.assign||function(e){for(var t=1;t7&&console.warn(`[TeactN] Slow containers update: ${Math.round(t)} ms`)}}],g={},y=new Map;function v(){p.forEach((e=>e(h)))}const b=(0,a.mS)(v);function w(e,t=!1){"object"==typeof e&&e!==h&&(h=e,t?v():b())}function I(){return h}function C(){return g}function E(e,t){m[e]||(m[e]=[],g[e]=(t,n=!1)=>{!function(e,t,n){m[e]&&m[e].forEach((e=>{const r=e(h,g,t);r&&w(r,n)}))}(e,t,n)}),m[e].push(t)}function S(e){p.push(e)}function P(e){const t=p.indexOf(e);-1!==t&&p.splice(t,1)}function M(e=(()=>({})),t=(()=>({}))){return n=>function o(a){o.DEBUG_contentComponentName=n.name;const[i]=(0,r.eJ)((0,u.Z)(y)),f=(0,d.Z)();(0,r.d4)((()=>()=>{y.delete(i)}),[i]);let m=y.get(i);if(m||(m={mapStateToProps:e,mapReducersToProps:t,ownProps:a,areMappedPropsChanged:!1,forceUpdate:f,DEBUG_updates:0,DEBUG_componentName:n.name},y.set(i,m)),m.areMappedPropsChanged&&(m.areMappedPropsChanged=!1),!m.mappedProps||!(0,s.Z)(m.ownProps,a)){m.ownProps=a;try{m.mappedProps={...e(h,a),...t(w,g)}}catch(e){(0,c.S)(e)}}return r.ZP.createElement(n,l({},m.mappedProps,a))}}o.eM&&(window.getGlobal=I,document.addEventListener("dblclick",(()=>{console.log("GLOBAL CONTAINERS",(0,i.Xo)(Array.from(y.values()).map((({DEBUG_componentName:e,DEBUG_updates:t})=>({DEBUG_componentName:e,DEBUG_updates:t}))),"DEBUG_updates","desc"))})))},3681:(e,t,n)=>{n.d(t,{l:()=>d,Z:()=>u});const r=/\uFE0F/g,o=String.fromCharCode(8205);function d(e){return e.indexOf(o)<0?e.replace(r,""):e}const u=/(?:\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d\udc8f\ud83c[\udffb-\udfff]|\ud83d\udc91\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d\udc8f\udc91])|(?:\ud83d[\udc68\udc69]|\ud83e\uddd1)(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf7c\udf84\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc70\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd4\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83d\ude36\u200d\ud83c\udf2b\ufe0f|\u2764\ufe0f\u200d\ud83d\udd25|\u2764\ufe0f\u200d\ud83e\ude79|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc15\u200d\ud83e\uddba|\ud83d\udc3b\u200d\u2744\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83d\ude2e\u200d\ud83d\udca8|\ud83d\ude35\u200d\ud83d\udcab|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f|\ud83d\udc08\u200d\u2b1b)|[#*0-9]\ufe0f?\u20e3|(?:[©®\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26a7\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd0c\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udc8e\udc90\udc92-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5-\uded7\udeeb\udeec\udef4-\udefc\udfe0-\udfeb]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd1d\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78\udd7a-\uddb4\uddb7\uddba\uddbc-\uddcb\uddd0\uddde-\uddff\ude70-\ude74\ude78-\ude7a\ude80-\ude86\ude90-\udea8\udeb0-\udeb6\udec0-\udec2\uded0-\uded6]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g},1363:(e,t,n)=>{var r=n(5116),o=n(1226),d=n(3716),u=n(7361),a=n(8406),s=n(9524),i=n(7358),c=n(4688),l=n(1622);(0,r.Q6)("initApi",((e,t)=>{(async()=>{d.Cg||(await(0,c.Qw)(),(0,c.f3)()),(0,o.g8)(t.apiUpdate,{userAgent:navigator.userAgent,platform:u.Lt,sessionData:(0,c.K8)()})})()})),(0,r.Q6)("setAuthPhoneNumber",((e,t,n)=>{const{phoneNumber:r}=n;return(0,o.t9)("provideAuthPhoneNumber",r.replace(/[^\d]/g,"")),{...e,authIsLoading:!0,authError:void 0}})),(0,r.Q6)("setAuthCode",((e,t,n)=>{const{code:r}=n;return(0,o.t9)("provideAuthCode",r),{...e,authIsLoading:!0,authError:void 0}})),(0,r.Q6)("setAuthPassword",((e,t,n)=>{const{password:r}=n;return(0,o.t9)("provideAuthPassword",r),{...e,authIsLoading:!0,authError:void 0}})),(0,r.Q6)("uploadProfilePhoto",((e,t,n)=>{const{file:r}=n;(0,o.t9)("uploadProfilePhoto",r)})),(0,r.Q6)("signUp",((e,t,n)=>{const{firstName:r,lastName:d}=n;return(0,o.t9)("provideAuthRegistration",{firstName:r,lastName:d}),{...e,authIsLoading:!0,authError:void 0}})),(0,r.Q6)("returnToAuthPhoneNumber",(e=>((0,o.t9)("restartAuth"),{...e,authError:void 0}))),(0,r.Q6)("goToAuthQrCode",(e=>((0,o.t9)("restartAuthWithQr"),{...e,authIsLoadingQrCode:!0,authError:void 0}))),(0,r.Q6)("saveSession",((e,t,n)=>{const{sessionData:r}=n;r?(0,c.wX)(n.sessionData,e.currentUserId):(0,c.jv)()})),(0,r.Q6)("signOut",(()=>{(async()=>{try{await(0,a.r1)(),await(0,o.t9)("destroy"),await(0,l.I)(!1)}catch(e){}(0,r.uC)().reset()})()})),(0,r.Q6)("reset",(()=>{(0,c.jv)(),s.clear(d.lW),s.clear(d.SG),s.clear(d.lF),s.clear(d.fo);const e=d.ee.replace(/\d+$/,""),t=(d.ee.match(/\d+$/)||[0])[0];for(let n=0;n{(async()=>{await(0,o.t9)("disconnect")})()})),(0,r.Q6)("loadNearestCountry",(e=>{"connectionStateReady"===e.connectionState&&(async()=>{const e=await(0,o.t9)("fetchNearestCountry");(0,r.R3)({...(0,r.Rd)(),authNearestCountry:e})})()})),(0,r.Q6)("loadCountryList",((e,t,n={})=>{let{langCode:d}=n;d||(d=e.settings.byKey.language),(async()=>{const e=await(0,o.t9)("fetchCountryList",{langCode:d});e&&(0,r.R3)({...(0,r.Rd)(),countryList:e})})()})),(0,r.Q6)("setDeviceToken",((e,t,n)=>{(0,r.R3)({...e,push:{deviceToken:n,subscribedAt:Date.now()}})})),(0,r.Q6)("deleteDeviceToken",(e=>{const t={...e};delete t.push,(0,r.R3)(t)}))},9667:(e,t,n)=>{var r=n(5116),o=n(1713),d=n(1226),u=n(782),a=n(8406),s=n(8085),i=n(1752),c=n(2858);function l(e,{visibility:t,allowedIds:n,deniedIds:r}){const{users:{byId:o},chats:{byId:d}}=e,u={visibility:t};let a,s;const i=e=>{if(!(0,c.YA)(e))return;const{id:t,accessHash:n}=o[e]||{};return t?{id:t,accessHash:n}:void 0},l=e=>{if((0,c.YA)(e))return;const t=d[e];return t?{id:t.id}:void 0};return"contacts"!==t&&"nobody"!==t||(a=n.map(i).filter(Boolean),s=n.map(l).filter(Boolean),a.length>0&&(u.allowedUsers=a),s.length>0&&(u.allowedChats=s)),"everybody"!==t&&"contacts"!==t||(a=r.map(i).filter(Boolean),s=r.map(l).filter(Boolean),a.length>0&&(u.blockedUsers=a),s.length>0&&(u.blockedChats=s)),u}(0,r.Q6)("updateProfile",((e,t,n)=>{const{photo:u,firstName:a,lastName:c,bio:l,username:f}=n;(async()=>{const{currentUserId:t}=e;if(t){if((0,r.R3)({...(0,r.Rd)(),profileEdit:{progress:o.rN.InProgress}}),u&&await(0,d.t9)("updateProfilePhoto",u),(a||c||l)&&await(0,d.t9)("updateProfile",{firstName:a,lastName:c,about:l})){e=(0,r.Rd)();const n=t&&(0,s.dy)(e,t);n&&(0,r.R3)((0,i.Nq)(e,n.id,{firstName:a,lastName:c,fullInfo:{...n.fullInfo,bio:l}}))}f&&await(0,d.t9)("updateUsername",f)&&t&&(0,r.R3)((0,i.Nq)((0,r.Rd)(),t,{username:f})),(0,r.R3)({...(0,r.Rd)(),profileEdit:{progress:o.rN.Complete}})}})()})),(0,r.Q6)("checkUsername",((e,t,n)=>{const{username:u}=n;(async()=>{if(e.profileEdit&&e.profileEdit.progress===o.rN.InProgress)return;(0,r.R3)({...e,profileEdit:{progress:e.profileEdit?e.profileEdit.progress:o.rN.Idle,isUsernameAvailable:void 0}});const t=await(0,d.t9)("checkUsername",u);e=(0,r.Rd)(),(0,r.R3)({...e,profileEdit:{...e.profileEdit,isUsernameAvailable:t}})})()})),(0,r.Q6)("loadWallpapers",(()=>{(async()=>{const e=await(0,d.t9)("fetchWallpapers",0);if(!e)return;const t=(0,r.Rd)();(0,r.R3)({...t,settings:{...t.settings,loadedWallpapers:e.wallpapers}})})()})),(0,r.Q6)("uploadWallpaper",((e,t,n)=>{const u=n,a=URL.createObjectURL(u);(0,r.R3)({...e,settings:{...e.settings,loadedWallpapers:[{slug:o.mp,document:{fileName:"",size:u.size,mimeType:u.type,previewBlobUrl:a}},...e.settings.loadedWallpapers||[]]}}),(async()=>{const t=await(0,d.t9)("uploadWallpaper",u);if(!t)return;const{wallpaper:n}=t;if(!(e=(0,r.Rd)()).settings.loadedWallpapers)return;const s=e.settings.loadedWallpapers[0];if(!s||s.slug!==o.mp)return;const i={...n,document:{...n.document,previewBlobUrl:a}};(0,r.R3)({...e,settings:{...e.settings,loadedWallpapers:[i,...e.settings.loadedWallpapers.slice(1)]}})})()})),(0,r.Q6)("loadBlockedContacts",(()=>{(async()=>{var e,t;const n=await(0,d.t9)("fetchBlockedContacts");if(!n)return;let o=(0,r.Rd)();null!==(e=n.users)&&void 0!==e&&e.length&&(o=(0,i.Sh)(o,(0,u.ee)(n.users,"id"))),null!==(t=n.chats)&&void 0!==t&&t.length&&(o=(0,i.GL)(o,(0,u.ee)(n.chats,"id"))),o={...o,blocked:{...o.blocked,ids:[...o.blocked.ids||[],...n.blockedIds],totalCount:n.totalCount}},(0,r.R3)(o)})()})),(0,r.Q6)("blockContact",((e,t,n)=>{const{contactId:o,accessHash:u}=n;(async()=>{if(!await(0,d.t9)("blockContact",o,u))return;const e=(0,r.Rd)();(0,r.R3)((0,i.O4)(e,o))})()})),(0,r.Q6)("unblockContact",((e,t,n)=>{const{contactId:o}=n;let u;if((0,c.YA)(o)){const t=(0,s.dy)(e,o);if(!t)return;u=t.accessHash}(async()=>{if(!await(0,d.t9)("unblockContact",o,u))return;const e=(0,r.Rd)();(0,r.R3)((0,i.rB)(e,o))})()})),(0,r.Q6)("loadAuthorizations",(()=>{(async()=>{const e=await(0,d.t9)("fetchAuthorizations");e&&(0,r.R3)({...(0,r.Rd)(),activeSessions:e})})()})),(0,r.Q6)("terminateAuthorization",((e,t,n)=>{const{hash:o}=n;(async()=>{if(!await(0,d.t9)("terminateAuthorization",o))return;const e=(0,r.Rd)();(0,r.R3)({...e,activeSessions:e.activeSessions.filter((e=>e.hash!==o))})})()})),(0,r.Q6)("terminateAllAuthorizations",(()=>{(async()=>{if(!await(0,d.t9)("terminateAllAuthorizations"))return;const e=(0,r.Rd)();(0,r.R3)({...e,activeSessions:e.activeSessions.filter((e=>e.isCurrent))})})()})),(0,r.Q6)("loadNotificationExceptions",(e=>{const{serverTimeOffset:t}=e;(async()=>{const e=await(0,d.t9)("fetchNotificationExceptions",{serverTimeOffset:t});e&&(0,r.R3)((0,i.aJ)((0,r.Rd)(),e))})()})),(0,r.Q6)("loadNotificationSettings",(e=>{const{serverTimeOffset:t}=e;(async()=>{const e=await(0,d.t9)("fetchNotificationSettings",{serverTimeOffset:t});e&&(0,r.R3)((0,i.BI)((0,r.Rd)(),e))})()})),(0,r.Q6)("updateNotificationSettings",((e,t,n)=>{const{peerType:o,isSilent:u,shouldShowPreviews:a}=n;(async()=>{await(0,d.t9)("updateNotificationSettings",o,{isSilent:u,shouldShowPreviews:a})&&(0,r.R3)((0,i.HN)((0,r.Rd)(),o,u,a))})()})),(0,r.Q6)("updateWebNotificationSettings",((e,t,n)=>{(async()=>{(0,r.R3)((0,i.BI)((0,r.Rd)(),n));const e=(0,r.Rd)(),{hasPushNotifications:t,hasWebNotifications:o}=e.settings.byKey;o&&t?await(0,a.Ld)():await(0,a.r1)()})()})),(0,r.Q6)("updateContactSignUpNotification",((e,t,n)=>{const{isSilent:o}=n;(async()=>{await(0,d.t9)("updateContactSignUpNotification",o)&&(0,r.R3)((0,i.BI)((0,r.Rd)(),{hasContactJoinedNotifications:!o}))})()})),(0,r.Q6)("loadLanguages",(()=>{(async()=>{const e=await(0,d.t9)("fetchLanguages");e&&(0,r.R3)((0,i.BI)((0,r.Rd)(),{languages:e}))})()})),(0,r.Q6)("loadPrivacySettings",(()=>{(async()=>{const[e,t,n,o,u]=await Promise.all([(0,d.t9)("fetchPrivacySettings","phoneNumber"),(0,d.t9)("fetchPrivacySettings","lastSeen"),(0,d.t9)("fetchPrivacySettings","profilePhoto"),(0,d.t9)("fetchPrivacySettings","forwards"),(0,d.t9)("fetchPrivacySettings","chatInvite")]);if(!(e&&t&&n&&o&&u))return;const a=(0,r.Rd)();a.settings.privacy.phoneNumber=e,a.settings.privacy.lastSeen=t,a.settings.privacy.profilePhoto=n,a.settings.privacy.forwards=o,a.settings.privacy.chatInvite=u,(0,r.R3)(a)})()})),(0,r.Q6)("setPrivacyVisibility",((e,t,n)=>{const{privacyKey:o,visibility:u}=n,{privacy:{[o]:a}}=e.settings;if(!a)return;const s=l(e,{visibility:u,allowedIds:[...a.allowUserIds,...a.allowChatIds],deniedIds:[...a.blockUserIds,...a.blockChatIds]});(async()=>{const e=await(0,d.t9)("setPrivacySettings",o,s);if(e){const t=(0,r.Rd)();t.settings.privacy[o]=e,(0,r.R3)(t)}})()})),(0,r.Q6)("setPrivacySettings",((e,t,n)=>{const{privacyKey:o,isAllowList:u,contactsIds:a}=n,{privacy:{[o]:s}}=e.settings;if(!s)return;const i=l(e,{visibility:s.visibility,allowedIds:u?a:[...s.allowUserIds,...s.allowChatIds],deniedIds:u?[...s.blockUserIds,...s.blockChatIds]:a});(async()=>{const e=await(0,d.t9)("setPrivacySettings",o,i);if(e){const t=(0,r.Rd)();t.settings.privacy[o]=e,(0,r.R3)(t)}})()})),(0,r.Q6)("updateIsOnline",((e,t,n)=>{(0,d.t9)("updateIsOnline",n)})),(0,r.Q6)("loadContentSettings",(()=>{(async()=>{const e=await(0,d.t9)("fetchContentSettings");e&&(0,r.R3)((0,i.BI)((0,r.Rd)(),e))})()})),(0,r.Q6)("updateContentSettings",((e,t,n)=>{(async()=>{(0,r.R3)((0,i.BI)((0,r.Rd)(),{isSensitiveEnabled:n})),await(0,d.t9)("updateContentSettings",n)||(0,r.R3)((0,i.BI)((0,r.Rd)(),{isSensitiveEnabled:!n}))})()}))},4907:(e,t,n)=>{var r=n(5116),o=n(3716),d=n(8406),u=n(1752),a=n(663),s=n(8085),i=n(1622),c=n(1947);(0,r.Q6)("apiUpdate",((e,t,n)=>{switch(o.eM&&"updateUserStatus"!==n["@type"]&&"updateServerTimeOffset"!==n["@type"]&&console.log("[GramJs] UPDATE",n["@type"],{update:n}),n["@type"]){case"updateApiReady":!function(e){const{hasWebNotifications:t,hasPushNotifications:n}=(0,s.dZ)(e);t&&n&&(0,d.Ld)(),(0,a.m0)(e.settings.byKey.language)}(e);break;case"updateAuthorizationState":!function(e){let t=(0,r.Rd)();const n="authorizationStateReady"===t.authState,o=e.authorizationState;switch((0,r.R3)({...t,authState:o,authIsLoading:!1}),t=(0,r.Rd)(),o){case"authorizationStateLoggingOut":(0,i.I)(!1),(0,r.R3)({...t,isLoggingOut:!0});break;case"authorizationStateWaitCode":(0,r.R3)({...t,authIsCodeViaApp:e.isCodeViaApp});break;case"authorizationStateWaitPassword":(0,r.R3)({...t,authHint:e.hint});break;case"authorizationStateWaitQrCode":(0,r.R3)({...t,authIsLoadingQrCode:!1,authQrCode:e.qrCode});break;case"authorizationStateReady":if(n)break;(0,i.I)(!0),(0,r.R3)({...t,isLoggingOut:!1,lastSyncTime:Date.now()})}}(n);break;case"updateAuthorizationError":!function(e){(0,r.R3)({...(0,r.Rd)(),authError:e.message})}(n);break;case"updateConnectionState":!function(e){const{connectionState:t}=e,n=(0,r.Rd)();(0,r.R3)({...n,connectionState:t}),"connectionStateReady"===t&&"authorizationStateReady"===n.authState?(0,r.uC)().sync():"connectionStateBroken"===t&&(0,r.uC)().signOut()}(n);break;case"updateSession":!function(e){const{sessionData:t}=e,{authRememberMe:n,authState:o}=(0,r.Rd)(),d=!t||!t.mainDcId;n&&"authorizationStateReady"===o&&!d&&(0,r.uC)().saveSession({sessionData:t})}(n);break;case"updateServerTimeOffset":!function(e){const t=(0,r.Rd)();t.serverTimeOffset!==e.serverTimeOffset&&(0,r.R3)({...t,serverTimeOffset:e.serverTimeOffset})}(n);break;case"updateCurrentUser":!function(e){const{currentUser:t}=e;(0,r.R3)({...(0,u.Nq)((0,r.Rd)(),t.id,t),currentUserId:t.id}),function(e){const t=localStorage.getItem(o.b_);if(!t)return;const n=JSON.parse(t);n.id=e,localStorage.setItem(o.b_,JSON.stringify(n))}(t.id)}(n);break;case"error":{"SESSION_REVOKED"===n.error.message&&t.signOut();const e=(0,c.J_)(n.error);e?t.addPaymentError({error:e}):t.showDialog&&t.showDialog({data:{...n.error,hasErrorKey:!0}});break}}}))},7895:(e,t,n)=>{var r=n(5116),o=n(3716),d=n(7361),u=n(663),a=n(6917),s=n(8085),i=n(1622);!function(){function e(){const e=document.documentElement.className.match(/theme-(\w+)/),t=e?e[1]:"light",n=(0,r.Rd)(),d=(0,s.Pu)(n),{animationLevel:u}=n.settings.byKey;d!==t&&((0,a.Z)(d,u===o.zy),(0,r.R3)({...n}))}const t=window.matchMedia("(prefers-color-scheme: dark)");"function"==typeof t.addEventListener?t.addEventListener("change",e):"function"==typeof t.addListener&&t.addListener(e)}(),(0,r.Q6)("init",(e=>{const{animationLevel:t,messageTextSize:n,language:r}=e.settings.byKey,c=(0,s.Pu)(e);(0,u.m0)(r,void 0,!0),document.documentElement.style.setProperty("--composer-text-size",`${Math.max(n,d.cj?16:15)}px`),document.documentElement.style.setProperty("--message-meta-height",`${Math.floor(1.3125*n)}px`),document.documentElement.style.setProperty("--message-text-size",`${n}px`),document.documentElement.setAttribute("data-message-text-size",n.toString()),document.body.classList.add("initial"),document.body.classList.add(`animation-level-${t}`),document.body.classList.add(d.$b?"is-touch-env":"is-pointer-env"),(0,a.Z)(c,t===o.zy),(0,i.p)(),d.cj?document.body.classList.add("is-ios"):d.wZ?document.body.classList.add("is-android"):d.jm&&document.body.classList.add("is-macos")})),(0,r.Q6)("setIsUiReady",((e,t,n)=>{const{uiReadyState:r}=n;return 2===r&&document.body.classList.remove("initial"),{...e,uiReadyState:r}})),(0,r.Q6)("setAuthPhoneNumber",((e,t,n)=>{const{phoneNumber:r}=n;return{...e,authPhoneNumber:r}})),(0,r.Q6)("setAuthRememberMe",((e,t,n)=>({...e,authRememberMe:Boolean(n)}))),(0,r.Q6)("clearAuthError",(e=>({...e,authError:void 0}))),(0,r.Q6)("disableHistoryAnimations",(()=>{setTimeout((()=>{(0,r.R3)({...(0,r.Rd)(),shouldSkipHistoryAnimations:!1}),document.body.classList.remove("no-animate")}),450),(0,r.R3)({...(0,r.Rd)(),shouldSkipHistoryAnimations:!0},!0)}))},3781:(e,t,n)=>{var r=n(5116),o=n(1752);(0,r.Q6)("setSettingOption",((e,t,n)=>(0,o.BI)(e,n))),(0,r.Q6)("setThemeSettings",((e,t,n)=>{const{theme:r,...d}=n;return(0,o.lr)(e,r,d)}))},8332:(e,t,n)=>{n.d(t,{YA:()=>i,Bf:()=>c,G9:()=>l,ZV:()=>f,eA:()=>h,Ru:()=>m,l6:()=>p,zX:()=>g,U:()=>y,GM:()=>v,hu:()=>b,RT:()=>w,Hp:()=>I,Nl:()=>C,VE:()=>E,Mg:()=>S,Qm:()=>P,H5:()=>M,q8:()=>A,Hd:()=>k,OE:()=>T,pE:()=>N,i4:()=>R,Sm:()=>L,cc:()=>D,P4:()=>O,O:()=>x,Fu:()=>_,SB:()=>Z,iX:()=>B,zF:()=>F,ih:()=>U});var r=n(6137),o=n(3716),d=n(782),u=n(5527),a=n(790);const s=Date.now()/1e3+31622400;function i(e){return e>0}function c(e){return l(e)||f(e)}function l(e){return"chatTypeBasicGroup"===e.type}function f(e){return"chatTypeSuperGroup"===e.type}function h(e){return"chatTypeChannel"===e.type}function m(e){return"chatTypePrivate"===e.type||"chatTypeBasicGroup"===e.type}function p(e){switch(e.type){case"chatTypePrivate":return"PrivateChat";case"chatTypeBasicGroup":case"chatTypeSuperGroup":return"AccDescrGroup";case"chatTypeChannel":return"AccDescrChannel";default:return"Chat"}}function g(e){if("chatTypePrivate"===e.type||"chatTypeSecret"===e.type)return e.id}function y(e,t,n,r=!1){return r||n&&t.id===n.id&&n.isSelf?e("SavedMessages"):t.title||e("HiddenName")}function v(e){if(e.fullInfo)return e.fullInfo.about}function b(e){const{username:t}=e;if(t)return`https://t.me/${t}`;const{inviteLink:n}=e.fullInfo||{};return n}function w(e,t="normal"){if(e.avatarHash)switch(t){case"big":return`profile${e.id}?${e.avatarHash}`;default:return`avatar${e.id}?${e.avatarHash}`}}function I(e){return!e.lastMessage}function C(e){return Boolean(e.adminRights)}function E(e,t){return!!e.adminRights&&e.adminRights[t]}function S(e,t){var n,r;return Boolean((null===(n=e.currentUserBannedRights)||void 0===n?void 0:n[t])||(null===(r=e.defaultBannedRights)||void 0===r?void 0:r[t]))}function P(e,t){return t!==r._f||!(e.isRestricted||e.migratedTo||e.isNotJoined)&&(!!e.isCreator||!!i(e.id)||(h(e)?E(e,"postMessages"):C(e)||!S(e,"sendMessages")))}function M(e,t=!1){if(!e)return{canAttachMedia:!1,canAttachPolls:!1,canSendStickers:!1,canSendGifs:!1,canAttachEmbedLinks:!1};const n=C(e);return{canAttachMedia:n||!S(e,"sendMedia"),canAttachPolls:(n||!S(e,"sendPolls"))&&(!i(e.id)||t),canSendStickers:n||!S(e,"sendStickers"),canSendGifs:n||!S(e,"sendGifs"),canAttachEmbedLinks:n||!S(e,"embedLinks")}}function A(e,t,n){if(null!=t&&t.sendMessages){const{untilDate:n}=t;return n&&nfunction(e,t,n,r,o,d,u,a){if(!e.isListed)return!1;if(d&&d.has(e.id))return!1;if(u&&u.has(e.id))return!0;if(a&&a.has(e.id))return!0;if(N(e)&&t.excludeArchived)return!1;if(t.excludeMuted&&!e.unreadMentionsCount&&R(e,r,o))return!1;if(!e.unreadCount&&!e.unreadMentionsCount&&!e.hasUnreadMark&&t.excludeRead)return!1;if(i(e.id)){const r=n[e.id];if(r&&"userTypeBot"===r.type){if(t.bots)return!0}else{if(t.contacts&&r&&r.isContact)return!0;if(t.nonContacts&&r&&!r.isContact)return!0}}else{if(c(e))return!!t.groups;if(h(e))return!!t.channels}return!1}(e[d],n,t,r,o,u,a,s))),n.pinnedChatIds]}function x(e,t,n,r="all"){function o(e){if(!e||!e.lastMessage||e.migratedTo)return!1;switch(r){case"all":if(N(e))return!1;break;case"archived":if(!N(e))return!1}return!e.isRestricted&&!e.isNotJoined}const u=t.map((t=>e[t])).filter(o),a=new Set(t);return{pinnedChats:n?n.map((t=>e[t])).filter(o).filter((e=>a.has(e.id))):[],otherChats:(0,d.Xo)(n?u.filter((e=>!n.includes(e.id))):u,T,"desc")}}function _(e,t,n,r,o,d){const[u]=O(e,t,n,o,d,r),a=u.map((t=>e[t])).filter((e=>(null==e?void 0:e.lastMessage)&&!e.isRestricted&&!e.isNotJoined));return{unreadDialogsCount:a.reduce(((e,t)=>t.unreadCount||t.hasUnreadMark?e+1:e),0),hasActiveDialogs:a.some((e=>e.unreadMentionsCount||!R(e,o,d)&&(e.unreadCount||e.hasUnreadMark)))}}function Z(e,t,n,r,o,d,u){const{id:a,title:s,emoticon:i,description:c,pinnedChatIds:l,excludedChatIds:f,includedChatIds:h,excludeArchived:m,excludeMuted:p,excludeRead:g,...y}=r;return Object.values(y).filter(Boolean).length>1||null!=f&&f.length||null!=h&&h.length?e("Chats",function(e,t,n,r,o,d){const[u,a]=O(e,t,n,o,d,r),{pinnedChats:s,otherChats:i}=x(e,u,a,"folder");return s.length+i.length}(t,n,r,o,d,u)):y.bots?e("FilterBots"):y.groups?e("FilterGroups"):y.channels?e("FilterChannels"):y.contacts?e("FilterContacts"):y.nonContacts?e("FilterNonContacts"):void 0}function B(e){return!!e&&e.id<0}function F(e,t,n){if(n&&!i(t))return n.isSelf?e("FromYou"):(0,u.Vl)(n)}function U(e,t,n=!1,r){return(0,d.Xo)(e,(e=>{const o=t[e];if(!o)return 0;let d=0;return o.lastMessage&&(d+=o.lastMessage.date),n&&o.isVerified&&(d+=3e9),r&&r.includes(e)&&(d=Date.now()+3e8+(r.length-r.indexOf(e))),d}),"desc")}},2858:(e,t,n)=>{n.d(t,{uw:()=>ae,H5:()=>o.H5,cc:()=>o.cc,Qm:()=>o.Qm,RT:()=>o.RT,GM:()=>o.GM,hu:()=>o.hu,N0:()=>ee,OE:()=>o.OE,Hd:()=>o.Hd,U:()=>o.U,l6:()=>o.l6,T7:()=>y,SB:()=>o.SB,Fu:()=>o.Fu,VE:()=>o.VE,XV:()=>ue,Sc:()=>oe,N5:()=>_,oP:()=>Z,I3:()=>k,qp:()=>R,R5:()=>de,$D:()=>p,aE:()=>F,ep:()=>q,c0:()=>Y,eO:()=>W,Tp:()=>c,kG:()=>J,Ti:()=>z,DH:()=>Q,KK:()=>f,O$:()=>D,t9:()=>j,Y5:()=>x,zF:()=>o.zF,q8:()=>o.q8,_O:()=>g,bf:()=>B,MK:()=>h,UD:()=>m,b7:()=>O,s1:()=>H,F$:()=>V,Cg:()=>G,bV:()=>te,HV:()=>ne,zX:()=>o.zX,OU:()=>S,RI:()=>P,Ow:()=>ie,Rs:()=>r.Rs,Vl:()=>r.Vl,Js:()=>r.Js,Tq:()=>r.Tq,jC:()=>re,BM:()=>X,u8:()=>L,Lo:()=>I,Ul:()=>E,iX:()=>o.iX,Nl:()=>o.Nl,pE:()=>o.pE,G9:()=>o.G9,eA:()=>o.eA,Bf:()=>o.Bf,YA:()=>o.YA,Hp:()=>o.Hp,ZV:()=>o.ZV,Ru:()=>o.Ru,NB:()=>r.NB,MF:()=>w,CD:()=>A,rl:()=>U,hC:()=>$,CI:()=>M,B4:()=>v,ss:()=>b,jM:()=>C,cS:()=>r.cS,kM:()=>r.kM,Mg:()=>o.Mg,Ak:()=>l,O:()=>o.O,P4:()=>o.P4,i4:()=>o.i4,Sm:()=>o.Sm,ih:()=>o.ih,Z0:()=>r.Z0});var r=n(5527),o=n(8332),d=n(6137),u=n(3716),a=n(4784);const s="The message is not supported on this version of Telegram",i=new RegExp(u.FM,"i");function c(e){const{chatId:t,id:n}=e;return`msg${t}-${n}`}function l(e){const t=e.match(/^msg(-?\d+)-(\d+)/);return{chatId:Number(t[1]),messageId:Number(t[2])}}function f(e){return e.previousLocalId||e.id}function h(e,t,n=!1){const{text:r,photo:o,video:d,audio:u,voice:a,document:i,sticker:c,contact:l,poll:f,invoice:h}=t.content,m=r&&r.text.substr(0,80);return t.groupedId?`${n?"":"🖼 "}${m||e("lng_in_dlg_album")}`:o?`${n?"":"🖼 "}${m||e("AttachPhoto")}`:d?`${n?"":"📹 "}${m||e(d.isGif?"AttachGif":"AttachVideo")}`:c?`${c.emoji||""} ${e("AttachSticker")}`.trim():u?`${n?"":"🎧 "}${k(t)||e("AttachMusic")}`:a?`${n?"":"🎤 "}${m||e("AttachAudio")}`:i?`${n?"":"📎 "}${m||i.fileName}`:l?e("AttachContact"):f?`${n?"":"📊 "}${f.summary.question}`:h?"Invoice":r?m:s}function m(e){const{text:t,sticker:n,photo:r,video:o,audio:d,voice:u,document:a,poll:i,webPage:c,contact:l,invoice:f}=e.content;return t?t.text:n||r||o||d||u||a||l||i||c||f?void 0:s}function p(e){const{text:t,sticker:n,photo:r,video:o,audio:d,voice:u,document:s,poll:i,webPage:c,contact:l}=e.content;return!!(n||null!=o&&o.isRound)||!(!t||r||o||d||u||s||i||c||l)&&((0,a.Z)(t.text)||!1)}function g(e){const{text:t}=e.content;if(t&&t.text.length<=6&&1===p(e))return t.text}function y(e){const{text:t}=e.content;let n;if(null!=t&&t.entities){let e=t.entities.find((e=>e.type===d.Vv.TextUrl));if(e&&(n=e.url.match(i)),!n&&(e=t.entities.find((e=>e.type===d.Vv.Url)),e)){const{offset:r,length:o}=e;n=t.text.substring(r,r+o).match(i)}}if(!n&&t&&(n=t.text.match(i)),n)return{url:n[0],domain:n[3]}}function v(e){return e.isOutgoing}function b(e){return Boolean(e.replyToMessageId)}function w(e){return Boolean(e.forwardInfo)}function I(e){return!!e.content.action}function C(e){return e.chatId===u.aw&&M(e)}function E(e){return Boolean(e.senderId)&&e.senderId<0&&v(e)}function S(e,t){return t.id>0?(0,r.Js)(t):(0,o.U)(e,t)}function P(e){return e.sendingState?"messageSendingStateFailed"===e.sendingState?"failed":"pending":"succeeded"}function M(e){return e.id>=u.AE}function A(e){return e.content.action&&"historyClear"===e.content.action.type}function k(e){const{audio:t,text:n}=e.content;return t&&[t.title,t.performer].filter(Boolean).join(" — ")||(null==n?void 0:n.text)}var T=n(7361),N=n(5376);function R(e){return e.content}function L(e){return Boolean(D(e)||O(e)||F(e)||B(e)||function(e){return e.content.contact}(e)||j(e)||_(e)||Z(e)||function(e){return e.content.voice}(e))}function D(e){return e.content.photo}function O(e){return e.content.video}function x(e){const{video:t}=e.content;return null!=t&&t.isRound?t:void 0}function _(e){return e.content.action}function Z(e){return e.content.audio}function B(e){return e.content.sticker}function F(e){return e.content.document}function U(e){const t=F(e);return t?"photo"===t.mediaType:void 0}function $(e){const t=F(e);return t?"video"===t.mediaType:void 0}function j(e){return e.content.poll}function W(e){return e.content.invoice}function H(e){return e.content.webPage}function V(e){var t;return null===(t=H(e))||void 0===t?void 0:t.photo}function G(e){var t;return null===(t=H(e))||void 0===t?void 0:t.video}function Q(e){var t;return null===(t=function(e){const t=D(e)||O(e)||F(e)||B(e)||V(e)||G(e);if(t)return t.thumbnail}(e))||void 0===t?void 0:t.dataUri}function z(e,t){const{photo:n,video:r,sticker:o,audio:d,voice:u,document:a}=e.content,s=V(e),i=G(e),l=r||i,f=n||s;if(!(f||l||o||d||u||a))return;const h=c(e);if(l)switch(t){case"micro":case"pictogram":return`${h}?size=m`;case"inline":return X(e)?void 0:K(l,h);case"viewerPreview":return`${h}?size=m`;case"viewerFull":return K(l,h);case"download":return`${h}?download`}if(f)switch(t){case"micro":case"pictogram":return`${h}?size=m`;case"inline":return X(e)?void 0:`${h}?size=x`;case"viewerPreview":return`${h}?size=x`;case"viewerFull":return`${h}?size=z`}if(a)switch(t){case"micro":case"pictogram":case"inline":case"viewerPreview":if(!(0,N.v6)(a)||X(e))return;return`${h}?size=m`;default:return h}if(o)switch(t){case"micro":return;case"pictogram":return`${h}?size=m`;default:return h}if(d)switch(t){case"micro":case"pictogram":return;case"download":return`${h}?download`;default:return K(d,h)}if(u)switch(t){case"micro":case"pictogram":return;default:return h}}function K(e,t){return T.I_&&T.s$?`${t}?fileSize=${e.size}&mimeType=${e.mimeType}`:t}function J(e,t){const{sticker:n,video:r,audio:o,voice:u}=e.content,a=r||G(e);return n&&"inline"===t&&n.isAnimated?d.IU.Lottie:a&&T.I_&&("viewerFull"===t||"inline"===t)?d.IU.Progressive:o||u?u&&!T.m5?d.IU.BlobUrl:d.IU.Progressive:d.IU.BlobUrl}function q(e){const{photo:t,video:n,document:r}=e.content,o=V(e),d=G(e);if(t||o)return`photo${e.date}.jpeg`;const{fileName:u}=n||d||r||{};return u}function Y(e){const{video:t,document:n}=e.content,r=G(e),{size:o}=t||r||n||{};return o}function X(e){const{photo:t,video:n,document:r}=e.content;return(null==t?void 0:t.blobUrl)||(null==n?void 0:n.blobUrl)||(null==r?void 0:r.previewBlobUrl)}function ee(e,t,n=!1){const r=de(e,t,n?"media":"inlineMedia");return n?r.reverse():r}function te(e){return e.sizes.find((e=>"z"===e.type))||e.sizes.find((e=>"y"===e.type))||ne(e)}function ne(e){return e.sizes.find((e=>"x"===e.type))||e.sizes.find((e=>"m"===e.type))||e.sizes.find((e=>"s"===e.type))||e.thumbnail}function re(e){if(e.width&&e.height)return e}function oe(e,t,n=!1){const r=M(e);return{isUploading:r,isTransferring:r||n,transferProgress:Number(t)}}function de(e,t,n){let r;switch(n){case"media":r=e=>{const t=O(e);return D(e)||t&&!t.isRound&&!t.isGif};break;case"documents":r=F;break;case"links":r=e=>H(e)||function(e){const{text:t}=e.content,n=t&&t.text.match(i);if(n)return{url:n[0],domain:n[3]}}(e);break;case"audio":r=Z;break;case"inlineMedia":r=e=>{const t=O(e);return D(e)||t&&!t.isRound&&!t.isGif||U(e)||$(e)};break;default:return[]}return t.reduce(((t,n)=>(e[n]&&r(e[n])&&t.push(n),t)),[])}function ue(e){const{audio:t,voice:n,video:r}=R(e),o=t||n||r||G(e);if(o)return o.duration}function ae(e,t){return`${e}_${t}`}const se={missing_payment_information:{field:"cardNumber",message:"Incorrect card number"},invalid_number:{field:"cardNumber",message:"Incorrect card number"},number:{field:"cardNumber",message:"Incorrect card number"},exp_year:{field:"expiry",message:"Incorrect year"},exp_month:{field:"expiry",message:"Incorrect month"},invalid_expiry_year:{field:"expiry",message:"Incorrect year"},invalid_expiry_month:{field:"expiry",message:"Incorrect month"},cvc:{field:"cvv",message:"Incorrect CVV"},invalid_cvc:{field:"cvv",message:"Incorrect CVV"}};function ie(e){const{message:t,code:n,param:r}=e,{field:o,message:d}=r?se[r]:se[n];return{field:o,message:d,description:t}}},5527:(e,t,n)=>{n.d(t,{Vl:()=>s,Js:()=>i,Tq:()=>c,kM:()=>l,NB:()=>f,cS:()=>h,Z0:()=>m,Rs:()=>p});var r=n(3716),o=n(790),d=n(782),u=n(2267);const a=[1,8,5,2,7,4,6];function s(e){if(e)switch(e.type){case"userTypeBot":case"userTypeRegular":return e.firstName||e.lastName;case"userTypeDeleted":case"userTypeUnknown":return"Deleted";default:return}}function i(e){if(e){if(f(e))return"Deleted account";switch(e.type){case"userTypeBot":case"userTypeRegular":if(e.firstName&&e.lastName)return`${e.firstName} ${e.lastName}`;if(e.firstName)return e.firstName;if(e.lastName)return e.lastName;break;case"userTypeDeleted":case"userTypeUnknown":return"Deleted account"}}}function c(e,t,n){if(t.id===r.aw)return e("ServiceNotifications").toLowerCase();if(t.type&&"userTypeBot"===t.type)return e("Bot");if(!t.status)return"";switch(t.status.type){case"userStatusEmpty":return e("ALongTimeAgo");case"userStatusLastMonth":return e("WithinAMonth");case"userStatusLastWeek":return e("WithinAWeek");case"userStatusOffline":{const{wasOnline:r}=t.status;if(!r)return e("LastSeen.Offline");const d=new Date((new Date).getTime()+1e3*n),u=new Date(1e3*r);if(u>=d)return e("LastSeen.JustNow");const a=new Date(d.getTime()-u.getTime());if(a.getTime()/1e3<60)return e("LastSeen.JustNow");if(a.getTime()/1e3<3600)return e("LastSeen.MinutesAgo",Math.floor(a.getTime()/1e3/60));const s=new Date;if(s.setHours(0,0,0,0),u>new Date(s.getTime()+1e3*n))return a.getTime()/1e3<21600?e("LastSeen.HoursAgo",Math.floor(a.getTime()/1e3/60/60)):e("LastSeen.TodayAt",(0,o.mr)(u));const i=new Date;return i.setDate(d.getDate()-1),i.setHours(0,0,0,0),u>new Date(i.getTime()+1e3*n)?e("LastSeen.YesterdayAt",(0,o.mr)(u)):e("LastSeen.AtDate",(0,o.Tu)(e,u))}case"userStatusOnline":return e("Online");case"userStatusRecently":return e("Lately");default:return}}function l(e){const{id:t,status:n,type:o}=e;return!!n&&t!==r.aw&&"userStatusOnline"===n.type&&"userTypeBot"!==o}function f(e){return!(!e.status||"userTypeBot"===e.type||e.id===r.aw||"userTypeDeleted"!==e.type&&"userTypeUnknown"!==e.type)}function h(e){return"userTypeBot"===e.type}function m(e,t,n,r=0){return(0,d.Xo)(e,(e=>{const o=(0,u.b)(r);if(n&&n.includes(e))return o+172800-(n.length-n.indexOf(e));const d=t[e];if(!d||!d.status)return 0;if("userStatusOnline"===d.status.type)return d.status.expires;if("userStatusOffline"===d.status.type&&d.status.wasOnline)return d.status.wasOnline;switch(d.status.type){case"userStatusRecently":return o-86400;case"userStatusLastWeek":return o-604800;case"userStatusLastMonth":return o-18144e3;default:return 0}}),"desc")}function p(e){const t=e?Math.abs(e.id)%7:0;return a[t]}},1752:(e,t,n)=>{n.d(t,{O4:()=>Pe,c_:()=>I,fZ:()=>l,m6:()=>w,aK:()=>Ee,aJ:()=>Ce,Sh:()=>Y,$S:()=>T,bp:()=>xe,WY:()=>_e,K4:()=>S,bV:()=>P,h8:()=>ee,M6:()=>_,i9:()=>B,vy:()=>V,rB:()=>Me,g_:()=>W,Mg:()=>d,SL:()=>a,Pb:()=>fe,w3:()=>D,BI:()=>we,lr:()=>Ie,pf:()=>b,s5:()=>Q,y9:()=>N,nA:()=>Re,_7:()=>De,Q$:()=>Ne,Dq:()=>Oe,vT:()=>Te,QH:()=>Le,Ob:()=>Z,a4:()=>i,B1:()=>u,vv:()=>h,Pi:()=>f,cY:()=>C,GL:()=>c,Wy:()=>g,wV:()=>x,cq:()=>O,rq:()=>j,No:()=>de,Og:()=>ue,xv:()=>se,px:()=>ae,xj:()=>M,c1:()=>ge,z5:()=>pe,qr:()=>le,dx:()=>he,fw:()=>be,H9:()=>ve,HN:()=>Se,ff:()=>A,P4:()=>E,x1:()=>X,TM:()=>ke,Rg:()=>$,z3:()=>U,IM:()=>H,Xg:()=>R,j6:()=>L,lG:()=>F,IE:()=>Ae,Nq:()=>J,Lm:()=>te,Q3:()=>ne,eD:()=>q});var r=n(3716),o=n(782);function d(e,t,n){return{...e,chats:{...e.chats,listIds:{...e.chats.listIds,[t]:n}}}}function u(e,t,n){const{[t]:r}=e.chats.listIds,o=null!=r&&r.length?n.filter((e=>!r.includes(e))):n;return r&&!o.length?e:d(e,t,[...r||[],...o])}function a(e,t){return{...e,chats:{...e.chats,byId:t}}}function s(e,t,n,r){const{byId:d}=e.chats,u=d[t],a=n.isMin&&u&&!u.isMin,s={...u,...a?(0,o.CE)(n,["isMin","accessHash"]):n,...r&&{photos:[r,...u.photos||[]]}};return s.id&&s.type,s}function i(e,t,n,r){const{byId:o}=e.chats;return a(e,{...o,[t]:s(e,t,n,r)})}function c(e,t){const n=Object.keys(t).map(Number).reduce(((n,r)=>{const o=s(e,r,t[r]);return o&&(n[r]=o),n}),{});return e=a(e,{...e.chats.byId,...n})}function l(e,t){const{byId:n}=e.chats;let r=!1;const o=Object.keys(t).map(Number).reduce(((o,d)=>{if(!n[d]||n[d].isMin&&!t[d].isMin){const n=s(e,d,t[d]);n&&(o[d]=n,r||(r=!0))}return o}),{});return r&&(e=a(e,{...e.chats.byId,...o})),e}function f(e,t,n){const o=n===r.WS?"archived":"active";let d=e.chats.listIds;return Object.keys(d).forEach((e=>{const n=d[e]||[];e!==o||n.includes(t)?e!==o&&n.includes(t)&&(d={...d,[e]:n.filter((e=>e!==t))}):d={...d,[e]:[...n,t]}})),i(e={...e,chats:{...e.chats,listIds:d}},t,{folderId:n||void 0})}function h(e,t,n){const r="active"===t?"all":"archived";return{...e,chats:{...e.chats,...n.orderedPinnedIds&&{orderedPinnedIds:{...e.chats.orderedPinnedIds,[t]:n.orderedPinnedIds}},totalCount:{...e.chats.totalCount,[r]:n.totalChatCount},isFullyLoaded:{...e.chats.isFullyLoaded,[t]:!1}}}}var m=n(6137),p=n(8085);function g(e,t,n=m._f,o="thread",d){const{messageLists:u}=e.messages;let a=u;if(d||r.Cg)a=t?[{chatId:t,threadId:n,type:o}]:[];else if(t){const e=u[u.length-1];e&&e.chatId===t&&e.threadId===n&&e.type===o||(a=e&&-1===e.chatId?[...u.slice(0,-1),{chatId:t,threadId:n,type:o}]:[...u,{chatId:t,threadId:n,type:o}])}else a=u.slice(0,-1);return{...e,messages:{...e.messages,messageLists:a}}}function y(e,t,n){return v(e,t,{byId:n})}function v(e,t,n){const r=e.messages.byChatId[t]||{byId:{},threadsById:{}};return{...e,messages:{...e.messages,byChatId:{...e.messages.byChatId,[t]:{...r,...n}}}}}function b(e,t,n,r,o){return function(e,t,n,r){const o=e.messages.byChatId[t];return v(e,t,{threadsById:{...null==o?void 0:o.threadsById,[n]:{...null==o?void 0:o.threadsById[n],...r}}})}(e,t,n,{[r]:o})}function w(e,t){const n=t.reduce(((e,t)=>(e[t.chatId]||(e[t.chatId]={}),e[t.chatId][t.id]=t,e)),{});return Object.keys(n).map(Number).forEach((t=>{e=I(e,t,n[t])})),e}function I(e,t,n){const r=(0,p.Zw)(e,t);return r&&Object.keys(n).every((e=>Boolean(r[Number(e)])))?e:y(e,t,{...n,...r})}function C(e,t,n,r){const o=(0,p.Zw)(e,t)||{},d={...o[n],...r};return d.id?y(e,t,{...o,[n]:d}):e}function E(e,t,n,r){const o=(0,p.Fn)(e,t)||{},d={...o[n],...r};return d.id?D(e,t,{...o,[n]:d},void 0):e}function S(e,t,n){const r=(0,p.Zw)(e,t);if(!r)return e;const d=(0,o.CE)(r,n),u=Object.values((0,o.q0)(r,n)).filter((({forwardInfo:e})=>null==e?void 0:e.isLinkedChannelPost));if(Object.keys(e.messages.byChatId[t].threadsById).map(Number).forEach((r=>{const o=(0,p.tZ)(e,t,r);let d=(0,p.gb)(e,t,r),u=(0,p.qC)(e,t,r),a=(0,p.Cb)(e,t,r),s=(0,p.KB)(e,t),i=null==o?void 0:o.messagesCount;n.forEach((e=>{d&&d.includes(e)&&(d=d.filter((t=>t!==e)),void 0!==i&&(i-=1)),u&&u.includes(e)&&(u=u.filter((t=>t!==e))),a&&a.includes(e)&&(a=a.filter((t=>t!==e))),s&&s.includes(e)&&(s=s.filter((t=>t!==e)))})),e=b(e,t,r,"listedIds",d),e=b(e,t,r,"outlyingIds",u),e=b(e,t,r,"viewportIds",a),e=b(e,t,r,"pinnedIds",s),o&&void 0!==i&&(e=b(e,t,r,"threadInfo",{...o,messagesCount:i}))})),u.length){const n=(0,p.Bt)(e),r=n&&n.chatId===t&&"thread"===n.type,o=null==n?void 0:n.threadId;u.forEach((n=>{const{fromChatId:d,fromMessageId:u}=n.forwardInfo,a=(0,p.hj)(e,d,u);r&&o===u&&(e=g(e,t)),a&&(e=C(e,d,u,{threadInfo:void 0}))}))}return e=y(e,t,d)}function P(e,t,n){const r=(0,p.Fn)(e,t);if(!r)return e;const d=(0,o.CE)(r,n);let u=(0,p.qy)(e,t);return u&&(n.forEach((e=>{u.includes(e)&&(u=u.filter((t=>t!==e)))})),e=b(e,t,m._f,"scheduledIds",u)),D(e,t,d,void 0)}function M(e,t,n,r){const o=(0,p.gb)(e,t,n),d=null!=o&&o.length?r.filter((e=>!o.includes(e))):r;return o&&!d.length?e:b(e,t,n,"listedIds",k([...o||[],...d]))}function A(e,t,n,r){const o=(0,p.qC)(e,t,n),d=null!=o&&o.length?r.filter((e=>!o.includes(e))):r;return o&&!d.length?e:b(e,t,n,"outlyingIds",k([...o||[],...d]))}function k(e){return e.sort(((e,t)=>e-t))}function T(e,t,n,o){const d=(0,p.Cb)(e,t,n)||[];return d.includes(o)?e:b(e,t,n,"viewportIds",k([...d.length{e=R(e,t.chatId,t.threadId,t)})),e}function D(e,t,n,r){return function(e,t,n){const r=e.scheduledMessages.byChatId[t]||{byId:{},hash:0};return{...e,scheduledMessages:{byChatId:{...e.scheduledMessages.byChatId,[t]:{...r,...n}}}}}(e,t,{byId:n,hash:r})}function O(e,t,n,r=!1,o=!1){return{...e,focusedMessage:{...e.focusedMessage,chatId:t,messageId:n,noHighlight:r,isResizingContainer:o}}}function x(e,t){return{...e,focusedMessage:{...e.focusedMessage,direction:t}}}function _(e,t,n){return{...e,selectedMessages:{chatId:t,messageIds:n?Array.prototype.concat([],n):[]}}}function Z(e,t,n,r,d,u,a,s=!1){const{selectedMessages:i}=e;u&&(a=(0,p.xH)(e,t,u));const c=a||[d];if(!i)return _(e,t,c);const{messageIds:l}=i;let f;const h=c.filter((e=>!l.includes(e)));if(h&&!h.length)f=l.filter((e=>!c.includes(e)));else if(s&&l.length){const u=(0,p.$W)(e,t,n,r),a=u.indexOf(l[l.length-1]),s=u.indexOf(d),i=Math.min(a,s),c=Math.max(a,s),h=u.slice(i,c+1);f=(0,o.Tw)([...l,...h])}else f=[...l,...h];return f.length?{...e,selectedMessages:{...i,messageIds:f}}:B(e)}function B(e){return{...e,selectedMessages:void 0}}function F(e,t,n,r,o){const{channelPostId:d,fromChatId:u}=t.forwardInfo||{};if(d&&u){const t=(0,p.tZ)(e,n,d);t&&(e=b(e,n,d,"threadInfo",{...t,lastMessageId:r,messagesCount:t.messagesCount+(o?-1:1)}))}return e}function U(e,t,n,r,d){const u=r.map((t=>{const n=e.stickers.setsById[t.id];return n?{...n,...t}:t}));return{...e,stickers:{...e.stickers,setsById:{...e.stickers.setsById,...(0,o.ee)(u,"id")},[t]:{...e.stickers[t],hash:n,..."search"===t?{resultIds:d}:{setIds:r.map((({id:e})=>e))}}}}}function $(e,t,n){const r=e.stickers.setsById[t]||{};return{...e,stickers:{...e.stickers,setsById:{...e.stickers.setsById,[t]:{...r,...n}}}}}function j(e,t,n,r){const{results:o}=e.gifs.search;let d;if(t||!o)d=n;else{const e=new Set(o.map((e=>e.id)));d=[...o,...n.filter((t=>!e.has(t.id)))]}return{...e,gifs:{...e.gifs,search:{...e.gifs.search,offset:r,results:d}}}}function W(e,t){return{...e,animatedEmojis:t}}function H(e,t,n,r){const d=[...(0,p.Pk)(e,t),...n||[]],u=(0,o.Tw)(d.map((({id:e})=>e))),a=(0,o.ee)(d,"id"),s=u.map((e=>a[e]));return{...e,stickers:{...e.stickers,forEmoji:{emoji:t,stickers:s,hash:r}}}}function V(e){const{emoji:t,stickers:n,hash:r}=e.stickers.forEmoji||{};return t?H(e,t,n,r):e}var G=n(735);function Q(e,t){return{...e,users:{...e.users,byId:t}}}function z(e,t,n){const{byId:r}=e.users,d=r[t],u=n.isMin&&d&&!d.isMin,a={...d,...u?(0,o.CE)(n,["isMin","accessHash"]):n};return a.id&&a.type?a:d}function K(e,t){const{hash:n,userIds:r}=e.contactList||{};if(!r)return e;const o=t.filter((e=>(null==e?void 0:e.isContact)&&!r.includes(e.id))).map((e=>e.id));return 0===o.length?e:{...e,contactList:{hash:n||0,userIds:[...o,...r]}}}function J(e,t,n){const{byId:r}=e.users,o=z(e,t,n);return Q(e=K(e,[o]),{...r,[t]:o})}function q(e,t){const n=Object.keys(t).map(Number).reduce(((n,r)=>{const o=z(e,r,t[r]);return o&&(n[r]=o),n}),{});return e=Q(e=K(e,Object.values(n)),{...e.users.byId,...n})}function Y(e,t){const{byId:n}=e.users;let r=!1;const o=Object.keys(t).map(Number).reduce(((o,d)=>{if(!n[d]||n[d].isMin&&!t[d].isMin){const n=z(e,d,t[d]);n&&(o[d]=n,r||(r=!0))}return o}),{});return r&&(e=K(e=Q(e,{...e.users.byId,...o}),Object.values(o))),e}function X(e,t){return e.users.selectedId===t?e:{...e,users:{...e.users,selectedId:t}}}function ee(e,t){const{byId:n}=e.users,{hash:r,userIds:o}=e.contactList||{};return delete n[t],Q(e={...e,contactList:{hash:r||0,userIds:o?o.filter((e=>e!==t)):G.D}},n)}function te(e,t){return{...e,userSearch:{...e.userSearch,...t}}}function ne(e,t){return te(e,{fetchingStatus:t})}function re(e,t,n){const{byId:r}=e.users,o=r[t];return o&&o.fullInfo?J(e,t,{...o,fullInfo:{...o.fullInfo,isBlocked:n}}):e}const oe=e=>`${e.chatId}_${e.id}`;function de(e,t){return{...e,globalSearch:{...e.globalSearch,...t}}}function ue(e,t){return de(e,{currentContent:t})}function ae(e,t,n,r,d){var u;const{resultsByType:a}=e.globalSearch||{},s=t.reduce(((e,t)=>(e[oe(t)]=t,e)),{}),i=null==a||null===(u=a[r])||void 0===u?void 0:u.foundIds;if(void 0!==i&&Object.keys(s).every((e=>i.includes(oe(s[e])))))return se(e,{messages:!1});const c=i||[],l=t.map((e=>oe(e))),f=Array.prototype.concat(c,l),h=(0,o.et)(c,f)?c:f;return de(e=se(e,{messages:!1}),{resultsByType:{...(e.globalSearch||{}).resultsByType,[r]:{totalCount:n,nextOffsetId:d,foundIds:h}}})}function se(e,t){return de(e,{fetchingStatus:{...e.globalSearch.fetchingStatus,...t}})}var ie=n(2858);function ce(e,t,n){return{...e,localTextSearch:{byChatThreadKey:{...e.localTextSearch.byChatThreadKey,[t]:n}}}}function le(e,t,n,r,o){const d=(0,ie.uw)(t,n);return ce(e,d,{...e.localTextSearch.byChatThreadKey[d],isActive:r,query:o})}function fe(e,t,n,r,o,d){const u=(0,ie.uw)(t,n);return ce(e,u,{...e.localTextSearch.byChatThreadKey[u],results:{foundIds:r,totalCount:o,nextOffsetId:d}})}function he(e,t,n,r,d,u){const a=(0,ie.uw)(t,n),{results:s}=e.localTextSearch.byChatThreadKey[a]||{},i=(null==s?void 0:s.foundIds)||[],c=ye((0,o.Tw)(Array.prototype.concat(i,r)));return fe(e,t,n,(0,o.et)(i,c)?i:c,d,u)}function me(e,t,n){return{...e,localMediaSearch:{byChatId:{...e.localMediaSearch.byChatId,[t]:n}}}}function pe(e,t,n){return me(e,t,{...e.localMediaSearch.byChatId[t],currentType:n})}function ge(e,t,n,r,d,u){const{resultsByType:a}=e.localMediaSearch.byChatId[t]||{},s=null!=a&&a[n]?a[n].foundIds:[],i=ye((0,o.Tw)(Array.prototype.concat(s,r)));return function(e,t,n,r,o,d){return me(e,t,{...e.localMediaSearch.byChatId[t],resultsByType:{...(e.localMediaSearch.byChatId[t]||{}).resultsByType,[n]:{foundIds:r,totalCount:o,nextOffsetId:d}}})}(e,t,n,(0,o.et)(s,i)?s:i,d,u)}function ye(e){return e.sort(((e,t)=>e-t))}function ve(e,t){return{...e,management:{...e.management,progress:t}}}function be(e,t,n){return{...e,management:{...e.management,byChatId:{...e.management.byChatId,[t]:{...e.management.byChatId[t]||{},...n}}}}}function we(e,t){return{...e,settings:{...e.settings,byKey:{...e.settings.byKey,...t}}}}function Ie(e,t,n){return{...e,settings:{...e.settings,themes:{...e.settings.themes,[t]:{...e.settings.themes[t]||{},...n}}}}}function Ce(e,t){return t.forEach((t=>{const{chatId:n,...r}=t;e=Ee(e,n,r)})),e}function Ee(e,t,n){return{...e,settings:{...e.settings,notifyExceptions:{...e.settings.notifyExceptions,[t]:n}}}}function Se(e,t,n,r){switch(t){case"contact":return we(e,{...void 0!==n&&{hasPrivateChatsNotifications:!n},...void 0!==r&&{hasPrivateChatsMessagePreview:r}});case"group":return we(e,{...void 0!==n&&{hasGroupNotifications:!n},...void 0!==r&&{hasGroupMessagePreview:r}});case"broadcast":return we(e,{...void 0!==n&&{hasBroadcastNotifications:!n},...void 0!==r&&{hasBroadcastMessagePreview:r}});default:return}}function Pe(e,t){return e=re(e,t,!0),{...e,blocked:{...e.blocked,ids:[t,...e.blocked.ids],totalCount:e.blocked.totalCount+1}}}function Me(e,t){return e=re(e,t,!1),{...e,blocked:{...e.blocked,ids:e.blocked.ids.filter((e=>e!==t)),totalCount:e.blocked.totalCount-1}}}function Ae(e,t){return{...e,twoFaSettings:{...e.twoFaSettings,...t}}}function ke(e,t){return{...e,payment:{...e.payment,shippingOptions:t}}}function Te(e,t){return{...e,payment:{...e.payment,requestId:t}}}function Ne(e,t){return{...e,payment:{...e.payment,step:t}}}function Re(e,t){if(!t.content||!t.content.invoice)return e;const{title:n,text:r,amount:o,currency:d,isTest:u,photoUrl:a}=t.content.invoice;return{...e,payment:{...e.payment,invoiceContent:{title:n,text:r,photoUrl:a,amount:o,currency:d,isTest:u}}}}function Le(e,t){return{...e,payment:{...e.payment,stripeCredentials:{...t}}}}function De(e,t){return{...e,payment:{...e.payment,...t}}}function Oe(e,t,n){if(!t||!n)return{...e,payment:{...e.payment,receipt:void 0}};const{invoice:r}=n.content,{photoUrl:o,text:d,title:u}=r||{};return{...e,payment:{...e.payment,receipt:{...t,photoUrl:o,text:d,title:u}}}}function xe(e){return{...e,payment:{}}}function _e(e){return{...e,payment:{...e.payment,isPaymentModalOpen:!1}}}},8085:(e,t,n)=>{n.d(t,{hg:()=>oe,_k:()=>pe,zB:()=>D,g4:()=>w,xl:()=>ge,nB:()=>ye,Z1:()=>f,IK:()=>v,DI:()=>P,Mw:()=>E,Ek:()=>C,hj:()=>ue,ZB:()=>ie,Zw:()=>Z,YK:()=>y,Dg:()=>h,X5:()=>Ce,A1:()=>M,jr:()=>_,yN:()=>T,JX:()=>je,pP:()=>Ze,we:()=>xe,og:()=>Oe,$W:()=>j,Bt:()=>x,y5:()=>k,n5:()=>De,Ms:()=>J,_$:()=>z,kK:()=>se,wU:()=>K,yZ:()=>X,It:()=>we,G$:()=>ce,y8:()=>Pe,cv:()=>me,pk:()=>b,N:()=>I,ep:()=>S,xo:()=>p,FM:()=>m,a6:()=>Ae,Ev:()=>Ie,CA:()=>Ee,zQ:()=>Be,_X:()=>le,vk:()=>Se,Jf:()=>Ue,s4:()=>i,b9:()=>de,gb:()=>U,aW:()=>_e,xH:()=>Me,FT:()=>Te,tV:()=>q,NJ:()=>l,dZ:()=>c,dT:()=>fe,qC:()=>$,gx:()=>We,eh:()=>Ve,Mz:()=>He,sp:()=>Ge,KB:()=>H,$$:()=>Qe,rd:()=>be,p9:()=>ee,Yy:()=>Q,Wq:()=>Fe,qy:()=>V,Tm:()=>ae,Fn:()=>B,Vt:()=>G,D7:()=>ke,Ur:()=>he,TD:()=>Ne,pv:()=>Re,yB:()=>Le,Ny:()=>N,E_:()=>R,Pk:()=>L,i3:()=>ze,P_:()=>g,Pu:()=>$e,Db:()=>re,tZ:()=>Y,Cm:()=>te,qS:()=>ne,uZ:()=>ve,dy:()=>s,Cb:()=>W});var r=n(1713),o=n(7361),d=n(6137),u=n(3716),a=n(2858);function s(e,t){return e.users.byId[t]}function i(e,t){var n;const r=s(e,t);return null==r||null===(n=r.fullInfo)||void 0===n?void 0:n.isBlocked}function c(e){return e.settings.byKey}function l(e){return e.settings.notifyExceptions}function f(e,t){return e.chats.byId[t]}function h(e,t){const n=(0,a.zX)(t);return!!n&&s(e,n)}function m(e,t){return t===e.currentUserId}function p(e,t){const n=h(e,t);return n&&(0,a.cS)(n)}function g(e){return Object.values(e.chats.byId).find((({isSupport:e})=>e))}function y(e,t){if(!(0,a.YA)(t.id)&&!(0,a.eA)(t)&&t.fullInfo)return t.fullInfo.members&&t.fullInfo.members.length!==u.mo?t.fullInfo.members.reduce(((t,{userId:n})=>e.users.byId[n]&&(0,a.kM)(e.users.byId[n])&&n!==e.currentUserId?t+1:t),0):t.fullInfo.onlineCount}function v(e,t){const n=f(e,t),r=n&&(0,a.zX)(n),o=r&&s(e,r);if(o&&(0,a.cS)(o))return o}function b(e,t){const n=f(e,t),r=v(e,t);if(!n||!r)return!1;if(n.lastMessage&&(0,a.CD)(n.lastMessage))return!0;const o=e.messages.byChatId[t];if(!o)return!1;const{listedIds:u}=o.threadsById[d._f]||{};return u&&!u.length}function w(e){return Boolean(e.chats.listIds.active)}function I(e,t,n){const{listIds:r}=e.chats;if(n){const e=r[n];return Boolean(e&&e.includes(t))}return Object.values(r).some((e=>e&&e.includes(t)))}function C(e,t){const n=f(e,t);if(n&&I(e,t))return n.folderId===u.WS?"archived":"active"}function E(e,t){return e.chatFolders.byId[t]}function S(e,t,n=u.Nf){const{active:r,archived:o}=e.chats.orderedPinnedIds;if(n===u.Nf)return!!r&&r.includes(t);if(n===u.WS)return!!o&&o.includes(t);const{byId:d}=e.chatFolders,{pinnedChatIds:a}=d[n]||{};return!!a&&a.includes(t)}function P(e,t){const n=t.toLowerCase();return Object.values(e.chats.byId).find((e=>e.username&&e.username.toLowerCase()===n))}function M(e){const t=e.chats.listIds.active;if(!t)return 0;const n=e.chats.byId,r=c(e),o=l(e);return t.reduce(((e,t)=>{const d=n[t];return!(d&&d.unreadCount&&d.isListed)||d.isNotJoined||d.isRestricted||!d.unreadMentionsCount&&(0,a.i4)(d,r,o)?e:e+d.unreadCount}),0)}var A=n(782);function k(e){return e.stickers.search}function T(e){return e.gifs.search}function N(e,t){return e.stickers.setsById[t]}function R(e,t){return Object.values(e.stickers.setsById).find((e=>e.shortName.toLowerCase()===t.toLowerCase()))}function L(e,t){const n=Object.values(e.stickers.setsById);let r=[];return n.forEach((({packs:e})=>{if(!e)return;const n=e[t];n&&(r=r.concat(n))})),r}function D(e,t){const{animatedEmojis:n}=e;if(!n||!n.stickers)return;const r=t.replace("️","");return n.stickers.find((e=>e.emoji===t||e.emoji===r))}var O=n(2267);function x(e){const{messageLists:t}=e.messages;if(t.length)return t[t.length-1]}function _(e){const{chatId:t}=x(e)||{};return t?f(e,t):void 0}function Z(e,t){var n;return null===(n=e.messages.byChatId[t])||void 0===n?void 0:n.byId}function B(e,t){var n;return null===(n=e.scheduledMessages.byChatId[t])||void 0===n?void 0:n.byId}function F(e,t,n,r){const o=e.messages.byChatId[t];if(!o)return;const d=o.threadsById[n];return d?d[r]:void 0}function U(e,t,n){return F(e,t,n,"listedIds")}function $(e,t,n){return F(e,t,n,"outlyingIds")}function j(e,t,n,r){switch(r){case"thread":return W(e,t,n);case"pinned":return H(e,t);case"scheduled":return V(e,t)}}function W(e,t,n){return F(e,t,n,"viewportIds")}function H(e,t){return F(e,t,d._f,"pinnedIds")}function V(e,t){return F(e,t,d._f,"scheduledIds")}function G(e,t,n){return F(e,t,n,"scrollOffset")}function Q(e,t,n){return F(e,t,n,"replyingToId")}function z(e,t,n){return F(e,t,n,"editingId")}function K(e,t){return F(e,t,d._f,"editingScheduledId")}function J(e,t,n){return F(e,t,n,"draft")}function q(e,t,n){return F(e,t,n,"noWebPage")}function Y(e,t,n){return F(e,t,n,"threadInfo")}function X(e,t,n){return F(e,t,n,"firstMessageId")}function ee(e,t,n){return F(e,t,n,"replyStack")}function te(e,t,n){if(n===d._f)return f(e,t);const r=Y(e,t,n);return r?f(e,r.originChannelId||t):void 0}function ne(e,t,n){if(n===d._f)return;const r=Y(e,t,n);return r?r.topMessageId:void 0}function re(e,t,n){const r=e.messages.byChatId[t];if(!r)return;const{replyToMessageId:o,replyToTopMessageId:d}=n;return o||d?Object.values(r.threadsById).find((e=>e.threadInfo&&(o&&o===e.threadInfo.topMessageId||d&&d===e.threadInfo.topMessageId))):void 0}function oe(e,t,n){const r=x(e);if(!r)return!1;const{threadInfo:o}=re(e,t,n)||{};return t===r.chatId&&(r.threadId===d._f||o&&r.threadId===o.threadId)}function de(e,t,n){const r=W(e,t,n);if(!r||!r.length)return!0;let o;if(n===d._f){const n=f(e,t);if(!n||!n.lastMessage)return!0;o=n.lastMessage.id}else{const r=Y(e,t,n);if(!r||!r.lastMessageId)return;o=r.lastMessageId}return o>=u.AE&&!ue(e,t,o)||r[r.length-1]>=o}function ue(e,t,n){const r=Z(e,t);return r?r[n]:void 0}function ae(e,t,n){const r=B(e,t);return r?r[n]:void 0}function se(e,t,n,r){if("scheduled"===r){const n=K(e,t);return n?ae(e,t,n):void 0}{const r=z(e,t,n);return r?ue(e,t,r):void 0}}function ie(e,t){let n;for(const r of Object.values(e.messages.byChatId)){const{byId:e}=r;if(n=Object.values(e).find((e=>e.content.poll&&e.content.poll.id===t)),n)break}return n}function ce(e,t){const{chatId:n,messageId:r}=e.focusedMessage||{};return n===t?r:void 0}function le(e,t){const n=ce(e,t.chatId);return!!n&&(n===t.id||n===t.previousLocalId)}function fe(e,t,n=!1){return function(e,t){const{lastReadOutboxMessageId:n}=f(e,t.chatId)||{};return(0,a.CI)(t)||!n||n0?s(e,n):f(e,n)}function me(e,t){const{forwardInfo:n}=t;if(n)return n.isChannelPost&&n.fromChatId?f(e,n.fromChatId):n.senderUserId?s(e,n.senderUserId)||f(e,n.senderUserId):void 0}function pe(e,t,n){var r;const o=f(e,t.chatId);if(!o||o.isRestricted)return{};const d=(0,a.YA)(o.id),u=m(e,t.chatId),s=(0,a.G9)(o),i=(0,a.ZV)(o),c=(0,a.eA)(o),l=(0,a.jM)(t),h=(0,a.B4)(t),p=(0,a.Lo)(t),{content:g}=t,y=(u||i&&(0,a.VE)(o,"pinMessages")||c&&(0,a.VE)(o,"editMessages")||(0,O.b)(e.serverTimeOffset)-t.date<172800)&&!(g.sticker||g.contact||g.poll||g.action||g.audio||null!==(r=g.video)&&void 0!==r&&r.isRound)&&!(0,a.MF)(t)&&!t.viaBotId,v=(0,a.Qm)(o,n)&&!l,b=d||o.isCreator||!c&&!(0,a.Mg)(o,"pinMessages")||(0,a.VE)(o,"pinMessages");let w=!p&&b,I=!1;const C=H(e,o.id);w&&(I=Boolean(C&&C.includes(t.id)),w=!I);const E=d||h||s||o.isCreator||(0,a.VE)(o,"deleteMessages"),S=!d&&!h,P=E&&!l&&(d&&!u||s&&(h||(0,a.VE)(o,"deleteMessages")||o.isCreator)),M=!p&&y&&(h||c&&(o.isCreator||(0,a.VE)(o,"editMessages"))),A=!p&&!l,k=Boolean(t.content.sticker),T=k&&function(e,t){const{stickers:n}=e.stickers.favorite;return n&&n.some((({id:e})=>e===t.id))}(e,t.content.sticker),N=!p&&k&&!T,R=!p&&T,L=!p,D=!p&&(c||i),x=!p;return{noOptions:[v,M,w,I,E,P,A,N,R,L,D,x].every((e=>!e)),canReply:v,canEdit:M,canPin:w,canUnpin:I,canDelete:E,canReport:S,canDeleteForAll:P,canForward:A,canFaveSticker:N,canUnfaveSticker:R,canCopy:L,canCopyLink:D,canSelect:x}}function ge(e){const{messageIds:t}=e.selectedMessages||{},{chatId:n,threadId:r}=x(e)||{},o=n&&Z(e,n);if(!o||!t||!r)return{};const d=t.map((t=>o[t]&&pe(e,o[t],r))).filter(Boolean);return{canDelete:d.every((e=>e.canDelete)),canDeleteForAll:d.every((e=>e.canDeleteForAll))}}function ye(e){const{messageIds:t}=e.selectedMessages||{},{chatId:n,threadId:r}=x(e)||{},o=n&&Z(e,n);return!!(o&&t&&r)&&t.map((t=>o[t]&&pe(e,o[t],r))).filter(Boolean).every((e=>e.canReport))}function ve(e,t){var n;return null===(n=e.fileUploads.byMessageLocalId[t.previousLocalId||t.id])||void 0===n?void 0:n.progress}function be(e,t,n){if(n===d._f){const n=f(e,t);if(!n)return;if(!n.lastReadInboxMessageId)return;return n.lastMessage?(0,a.CI)(n.lastMessage)?n.lastMessage.id:Math.min(n.lastMessage.id,n.lastReadInboxMessageId):n.lastReadInboxMessageId}{const r=Y(e,t,n);if(!r)return;return r.lastReadInboxMessageId?Math.min(r.lastReadInboxMessageId,r.lastMessageId||1/0):r.topMessageId}}function we(e,t,n){const r=f(e,t);if(n===d._f){if(!r)return}else{const r=Y(e,t,n);if(!r||r.lastMessageId===r.lastReadInboxMessageId)return}const o=$(e,t,n),u=U(e,t,n),a=Z(e,t);if(!a||!o&&!u)return;const s=be(e,t,n);if(s||!r||!r.isNotJoined){if(o){const e=s?o.find((e=>e>s&&a[e]&&(!a[e].isOutgoing||a[e].isFromScheduled))):o[0];if(e)return e}if(u){const e=s?u.find((e=>e>s&&a[e]&&(!a[e].isOutgoing||a[e].isFromScheduled))):u[0];if(e)return e}}}function Ie(e){const{forwardMessages:t}=e;return Boolean(t.isModalShown)}function Ce(e,t){const n=Object.values(e.chats.byId).find((e=>(0,a.Ru)(e)&&e.lastMessage&&e.lastMessage.id===t));if(n)return n.id;const{byChatId:r}=e.messages;return Number(Object.keys(r).find((n=>{const o=f(e,Number(n));return o&&(0,a.Ru)(o)&&r[o.id].byId[t]})))}function Ee(e){const{selectedMessages:t}=e;return Boolean(t)}function Se(e,t){const{messageIds:n}=e.selectedMessages||{};return!!n&&n.includes(t)}function Pe(e,t,n){const r=Z(e,t);if(r)return Object.values(r).filter((e=>e.groupedId===n&&e.forwardInfo)).map((({forwardInfo:e})=>e.fromMessageId))}function Me(e,t,n){const r=Z(e,t);if(r)return Object.keys(r).map(Number).filter((e=>r[e].groupedId===n))}function Ae(e,t,n){const{messageIds:r}=e.selectedMessages||{};if(!r)return!1;const o=Me(e,t,n);return o&&o.every((e=>r.includes(e)))}function ke(e){const{messageIds:t}=e.selectedMessages||{};return t?t.length:0}function Te(e,t){const n=f(e,t);if(!n)return;if(!p(e,n))return;const r=Z(e,t),o=W(e,t,d._f);if(!r||!o)return;const u=(0,A.dF)(o,(e=>!r[e].isOutgoing&&Boolean(r[e].keyboardButtons))),a=(0,A.dF)(o,(e=>Boolean(r[e].shouldHideKeyboardButtons)));return u&&a&&a>u?void 0:u?r[u]:void 0}function Ne(e,t,n,r){const{shouldAutoDownloadMediaFromContacts:o,shouldAutoDownloadMediaInPrivateChats:d,shouldAutoDownloadMediaInGroups:u,shouldAutoDownloadMediaInChannels:s}=e.settings.byKey;return Boolean(d&&(0,a.YA)(n.id)||u&&(0,a.Bf)(n)||s&&(0,a.eA)(n)||o&&r&&(r.id===e.currentUserId||function(e,t){return e.contactList&&e.contactList.userIds.includes(t.id)}(e,r)))}function Re(e,t){const n=(0,a.b7)(t)||(0,a.Cg)(t);if(!n)return;const{shouldAutoPlayVideos:r,shouldAutoPlayGifs:o}=e.settings.byKey,d=n.isGif||n.isRound;return r&&!d||o&&d}function Le(e){return e.settings.byKey.shouldLoopStickers}function De(e){const{chatId:t,threadId:n}=x(e)||{};if(!t||!n)return;const r=(0,a.uw)(t,n),o=e.localTextSearch.byChatThreadKey[r];return o&&o.isActive?o:void 0}function Oe(e){const{byChatId:t}=e.localMediaSearch,{chatId:n}=x(e)||{},r=e.users.selectedId;return r&&t[r]?r:n}function xe(e){const t=Oe(e);if(t)return e.localMediaSearch.byChatId[t]}function _e(e,t){return e.management.byChatId[t]}function Ze(e){const{chatId:t,threadId:n}=x(e)||{};if(!t||!n)return;if((0,a.YA)(t))return"user";const r=f(e,t);return r?(0,a.Bf)(r)?"group":"channel":void 0}function Be(e){const{mediaViewer:t}=e;return Boolean(t.messageId||t.avatarOwnerId)}function Fe(e){const{users:t,isChatInfoShown:n,newChatMembersProgress:d}=e,u=d!==r.WB.Closed,a=function(e){const{pollResults:t}=e;return Boolean(t.messageId)}(e),s=Boolean(!o.wB&&De(e)),i=function(e){const{chatId:t,threadId:n}=x(e)||{};if(!t||!n)return;const r=e.management.byChatId[t];return r&&r.isActive?r:void 0}(e),c=void 0!==k(e).query,l=void 0!==T(e).query,{chatId:f}=x(e)||{},h=t.selectedId,m=w(e),p=Boolean(h&&m),g=Boolean(f&&m)&&n;return a?r.qt.PollResults:s?r.qt.Search:i?r.qt.Management:c?r.qt.StickerSearch:l?r.qt.GifSearch:u?r.qt.AddingMembers:p?r.qt.UserInfo:g?r.qt.ChatInfo:void 0}function Ue(e){return void 0!==Fe(e)}function $e(e){const{theme:t,shouldUseSystemTheme:n}=e.settings.byKey;return n?(0,o.vn)():t}function je(e){return e.globalSearch.query}function We(e){return e.payment.chatId}function He(e){return e.payment.messageId}function Ve(e){return e.payment.formId}function Ge(e){return e.payment.requestId}function Qe(e){return e.payment.nativeParams?e.payment.nativeParams.publishableKey:void 0}function ze(e){return e.payment.stripeCredentials}},1713:(e,t,n)=>{let r,o,d,u,a,s,i,c,l,f,h,m,p;n.d(t,{Uq:()=>r,fo:()=>o,MT:()=>d,du:()=>u,nJ:()=>a,qt:()=>s,bZ:()=>i,Nh:()=>c,rN:()=>l,wv:()=>f,WB:()=>h,vi:()=>m,KB:()=>p,mp:()=>g,u1:()=>y}),function(e){e[e.Backwards=0]="Backwards",e[e.Forwards=1]="Forwards",e[e.Around=2]="Around"}(r||(r={})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Static=2]="Static"}(o||(o={})),function(e){e[e.Main=0]="Main",e[e.EditProfile=1]="EditProfile",e[e.Notifications=2]="Notifications",e[e.Language=3]="Language",e[e.General=4]="General",e[e.GeneralChatBackground=5]="GeneralChatBackground",e[e.GeneralChatBackgroundColor=6]="GeneralChatBackgroundColor",e[e.Privacy=7]="Privacy",e[e.PrivacyPhoneNumber=8]="PrivacyPhoneNumber",e[e.PrivacyLastSeen=9]="PrivacyLastSeen",e[e.PrivacyProfilePhoto=10]="PrivacyProfilePhoto",e[e.PrivacyForwarding=11]="PrivacyForwarding",e[e.PrivacyGroupChats=12]="PrivacyGroupChats",e[e.PrivacyPhoneNumberAllowedContacts=13]="PrivacyPhoneNumberAllowedContacts",e[e.PrivacyPhoneNumberDeniedContacts=14]="PrivacyPhoneNumberDeniedContacts",e[e.PrivacyLastSeenAllowedContacts=15]="PrivacyLastSeenAllowedContacts",e[e.PrivacyLastSeenDeniedContacts=16]="PrivacyLastSeenDeniedContacts",e[e.PrivacyProfilePhotoAllowedContacts=17]="PrivacyProfilePhotoAllowedContacts",e[e.PrivacyProfilePhotoDeniedContacts=18]="PrivacyProfilePhotoDeniedContacts",e[e.PrivacyForwardingAllowedContacts=19]="PrivacyForwardingAllowedContacts",e[e.PrivacyForwardingDeniedContacts=20]="PrivacyForwardingDeniedContacts",e[e.PrivacyGroupChatsAllowedContacts=21]="PrivacyGroupChatsAllowedContacts",e[e.PrivacyGroupChatsDeniedContacts=22]="PrivacyGroupChatsDeniedContacts",e[e.PrivacyActiveSessions=23]="PrivacyActiveSessions",e[e.PrivacyBlockedUsers=24]="PrivacyBlockedUsers",e[e.Folders=25]="Folders",e[e.FoldersCreateFolder=26]="FoldersCreateFolder",e[e.FoldersEditFolder=27]="FoldersEditFolder",e[e.FoldersEditFolderFromChatList=28]="FoldersEditFolderFromChatList",e[e.FoldersIncludedChats=29]="FoldersIncludedChats",e[e.FoldersIncludedChatsFromChatList=30]="FoldersIncludedChatsFromChatList",e[e.FoldersExcludedChats=31]="FoldersExcludedChats",e[e.FoldersExcludedChatsFromChatList=32]="FoldersExcludedChatsFromChatList",e[e.TwoFaDisabled=33]="TwoFaDisabled",e[e.TwoFaNewPassword=34]="TwoFaNewPassword",e[e.TwoFaNewPasswordConfirm=35]="TwoFaNewPasswordConfirm",e[e.TwoFaNewPasswordHint=36]="TwoFaNewPasswordHint",e[e.TwoFaNewPasswordEmail=37]="TwoFaNewPasswordEmail",e[e.TwoFaNewPasswordEmailCode=38]="TwoFaNewPasswordEmailCode",e[e.TwoFaEnabled=39]="TwoFaEnabled",e[e.TwoFaChangePasswordCurrent=40]="TwoFaChangePasswordCurrent",e[e.TwoFaChangePasswordNew=41]="TwoFaChangePasswordNew",e[e.TwoFaChangePasswordConfirm=42]="TwoFaChangePasswordConfirm",e[e.TwoFaChangePasswordHint=43]="TwoFaChangePasswordHint",e[e.TwoFaTurnOff=44]="TwoFaTurnOff",e[e.TwoFaRecoveryEmailCurrentPassword=45]="TwoFaRecoveryEmailCurrentPassword",e[e.TwoFaRecoveryEmail=46]="TwoFaRecoveryEmail",e[e.TwoFaRecoveryEmailCode=47]="TwoFaRecoveryEmailCode",e[e.TwoFaCongratulations=48]="TwoFaCongratulations"}(d||(d={})),function(e){e[e.ChatList=0]="ChatList",e[e.GlobalSearch=1]="GlobalSearch",e[e.Settings=2]="Settings",e[e.Contacts=3]="Contacts",e[e.Archived=4]="Archived",e[e.NewChannelStep1=5]="NewChannelStep1",e[e.NewChannelStep2=6]="NewChannelStep2",e[e.NewGroupStep1=7]="NewGroupStep1",e[e.NewGroupStep2=8]="NewGroupStep2"}(u||(u={})),function(e){e[e.ChatList=0]="ChatList",e[e.Media=1]="Media",e[e.Links=2]="Links",e[e.Files=3]="Files",e[e.Music=4]="Music",e[e.Voice=5]="Voice"}(a||(a={})),function(e){e[e.ChatInfo=0]="ChatInfo",e[e.UserInfo=1]="UserInfo",e[e.Search=2]="Search",e[e.Management=3]="Management",e[e.StickerSearch=4]="StickerSearch",e[e.GifSearch=5]="GifSearch",e[e.PollResults=6]="PollResults",e[e.AddingMembers=7]="AddingMembers"}(s||(s={})),function(e){e[e.Inline=0]="Inline",e[e.ScheduledInline=1]="ScheduledInline",e[e.SharedMedia=2]="SharedMedia",e[e.ProfileAvatar=3]="ProfileAvatar",e[e.SettingsAvatar=4]="SettingsAvatar",e[e.MiddleHeaderAvatar=5]="MiddleHeaderAvatar",e[e.Album=6]="Album",e[e.ScheduledAlbum=7]="ScheduledAlbum",e[e.SearchResult=8]="SearchResult"}(i||(i={})),function(e){e[e.Idle=0]="Idle",e[e.InProgress=1]="InProgress",e[e.Complete=2]="Complete",e[e.Error=3]="Error"}(c||(c={})),function(e){e[e.Idle=0]="Idle",e[e.InProgress=1]="InProgress",e[e.Complete=2]="Complete",e[e.Error=3]="Error"}(l||(l={})),function(e){e[e.Idle=0]="Idle",e[e.InProgress=1]="InProgress",e[e.Complete=2]="Complete",e[e.Error=3]="Error"}(f||(f={})),function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Loading=2]="Loading"}(h||(h={})),function(e){e[e.Profile=0]="Profile",e[e.SharedMedia=1]="SharedMedia",e[e.MemberList=2]="MemberList"}(m||(m={})),function(e){e[e.ShippingInfo=0]="ShippingInfo",e[e.Shipping=1]="Shipping",e[e.PaymentInfo=2]="PaymentInfo",e[e.Checkout=3]="Checkout"}(p||(p={}));const g="UPLOADING_WALLPAPER_SLUG";let y;!function(e){e[e.Initial=0]="Initial",e[e.ChatPrivacyType=1]="ChatPrivacyType",e[e.Discussion=2]="Discussion",e[e.ChannelSubscribers=3]="ChannelSubscribers",e[e.GroupType=4]="GroupType",e[e.GroupPermissions=5]="GroupPermissions",e[e.GroupRemovedUsers=6]="GroupRemovedUsers",e[e.GroupUserPermissionsCreate=7]="GroupUserPermissionsCreate",e[e.GroupUserPermissions=8]="GroupUserPermissions",e[e.ChatAdministrators=9]="ChatAdministrators",e[e.GroupRecentActions=10]="GroupRecentActions",e[e.ChatAdminRights=11]="ChatAdminRights",e[e.GroupMembers=12]="GroupMembers"}(y||(y={}))},9933:(e,t,n)=>{n.d(t,{c:()=>d,j:()=>u});var r=n(9118);let o;function d(e,t){t||(o&&!o.isCancelled&&(o.isCancelled=!0),o=t={isCancelled:!1}),(0,r.T2)((()=>{!t.isCancelled&&e()&&d(e,t)}))}function u(e){(0,r.T2)((()=>{e()&&u(e)}))}},7358:(e,t,n)=>{n.d(t,{w:()=>o});var r=n(3716);function o(e){"function"==typeof window.navigator.setAppBadge&&window.navigator.setAppBadge(e).catch((e=>{r.eM&&console.error(e)}))}},275:(e,t,n)=>{function r(e,t){if(e===t)return!0;const n=Object.keys(e),r=n.length;if(r!==Object.keys(t).length)return!1;if(0===r)return!0;for(let o=0;o(e[r]!==t[r]&&n.push(`${r}: ${e[r]} => ${t[r]}`),n)),[])}n.d(t,{Z:()=>r,c:()=>o})},6752:(e,t,n)=>{n.d(t,{Z:()=>r});const r=(...e)=>e.filter(Boolean).join(" ")},9524:(e,t,n)=>{n.d(t,{Type:()=>o,fetch:()=>d,save:()=>u,clear:()=>a});const r=self.caches;let o;async function d(e,t,n,d=!1){if(r)try{const u=new Request(t.replace(/:/g,"_")),a=await r.open(e),s=await a.match(u);if(!s)return;switch(n){case o.Text:return await s.text();case o.Blob:{const e=await s.blob();if("sticker"===t.substr(0,7))return new Blob([e],{type:"image/webp"});if(!e.type){const t=s.headers.get("Content-Type");if(t)return new Blob([e],{type:d?t:t.replace(/html/gi,"")})}return!d&&e.type.includes("html")?new Blob([e],{type:e.type.replace(/html/gi,"")}):e}case o.Json:return await s.json();default:return}}catch(e){return void console.warn(e)}}async function u(e,t,n){if(r)try{const o="string"==typeof n||n instanceof Blob?n:JSON.stringify(n),d=new Request(t.replace(/:/g,"_")),u=new Response(o),a=await r.open(e);return await a.put(d,u)}catch(e){return void console.warn(e)}}async function a(e){try{if(!r)return;return await r.delete(e)}catch(e){return void console.warn(e)}}!function(e){e[e.Text=0]="Text",e[e.Blob=1]="Blob",e[e.Json=2]="Json"}(o||(o={}))},3989:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(517);function o(e){return(0,r.Z)({onEsc:e})}},517:(e,t,n)=>{n.d(t,{Z:()=>d});const r={Enter:"onEnter",Backspace:"onBackspace",Delete:"onDelete",Esc:"onEsc",Escape:"onEsc",ArrowUp:"onUp",ArrowDown:"onDown",ArrowLeft:"onLeft",ArrowRight:"onRight",Tab:"onTab"},o={onEnter:[],onDelete:[],onBackspace:[],onEsc:[],onUp:[],onDown:[],onLeft:[],onRight:[],onTab:[]};function d(e){return u()||document.addEventListener("keydown",a,!0),Object.keys(e).forEach((t=>{const n=e[t];if(!n)return;const r=o[t];r&&r.push(n)})),()=>{!function(e){Object.keys(e).forEach((t=>{const n=e[t],r=o[t];if(r){const e=r.findIndex((e=>e===n));-1!==e&&r.splice(e,1)}})),u()||document.removeEventListener("keydown",a,!1)}(e)}}function u(){return Object.values(o).some((e=>Boolean(e.length)))}function a(e){const t=r[e.key];if(!t)return;const{length:n}=o[t];n&&(e.stopPropagation(),(0,o[t][n-1])(e))}},790:(e,t,n)=>{n.d(t,{$Y:()=>u,_F:()=>a,kj:()=>s,mr:()=>c,VX:()=>l,Tu:()=>f,np:()=>h,j1:()=>m,ZK:()=>g,k9:()=>y,rM:()=>v,xH:()=>b,xk:()=>I,IS:()=>C});const r=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=["January","February","March","April","May","June","July","August","September","October","November","December"],d=o.map((e=>e.toLowerCase()));function u(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function a(e){return u(e).getTime()}function s(e){const t=new Date(1e3*e);return`${t.getFullYear()}-${t.getMonth()}`}function i(e){return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`}function c(e){const t="number"==typeof e?new Date(e):e;return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function l(e,t){const n="number"==typeof t?new Date(t):t,o=u(new Date);if(n>=o)return c(n);const d=new Date(o);if(d.setDate(o.getDate()-7),n>=d)return e(`Weekday.Short${r[n.getDay()]}`);const a=n.getFullYear()!==o.getFullYear(),s=e(a?"formatDateScheduleYear":"formatDateSchedule")||(a?"d MMM yyyy":"d MMM");return p(e,n,s)}function f(e,t){const n="number"==typeof t?new Date(t):t,r=e("formatterYearMax")||"dd.MM.yyyy";return p(e,n,r)}function h(e,t,n=!1){const r=e(n?"formatterMonthYear2":"formatterMonthYear")||"MMM yyyy";return p(e,t,r)}function m(e,t,n=!1,o=!1){const d="number"==typeof t?new Date(t):t,a=u(new Date);if(!o){if(i(d)===i(a))return(n?E:S)(e("Weekday.Today"));const t=new Date(a);if(t.setDate(a.getDate()-1),i(d)===i(t))return(n?E:S)(e("Weekday.Yesterday"));const o=new Date(a),u=new Date(a);if(o.setDate(a.getDate()-7),u.setDate(a.getDate()+7),d>=o&&d<=u){const t=r[d.getDay()];return n?E(e(`Weekday.Short${t}`)):S(e(`Weekday.${t}`))}}const s=d.getFullYear()!==a.getFullYear(),c=e(n?s?"formatDateScheduleYear":"formatDateSchedule":s?"chatFullDate":"chatDate")||"d MMMM yyyy";return(n?E:S)(p(e,d,c))}function p(e,t,n){const r=t.getDate(),d=t.getMonth();return n.replace("LLLL",e(o[d])).replace("MMMM",e(`Month.Gen${o[d]}`)).replace("MMM",e(`Month.Short${o[d]}`)).replace("MM",String(d+1).padStart(2,"0")).replace("dd",String(r).padStart(2,"0")).replace("d",String(r)).replace("yyyy",String(t.getFullYear()))}function g(e,t){const n="number"==typeof t?new Date(t):t;return`${m(e,n,!0)}, ${c(n)}`}function y(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%3600%60);let o="";return t>0?(o+=`${String(t).padStart(2,"0")}:`,o+=`${String(n).padStart(2,"0")}:`):o+=`${String(n)}:`,o+=String(r).padStart(2,"0"),o}function v(e){const t=[];let n=e%1e3;e-=n,n=Math.floor(n/10);const r=(e=Math.floor(e/1e3))%60;e-=r;const o=(e=Math.floor(e/60))%60;e-=o;const d=(e=Math.floor(e/60))%60;return d>0&&t.push(String(d).padStart(2,"0")),t.push(String(o).padStart(d>0?2:1,"0")),t.push(String(r).padStart(2,"0")),`${t.join(":")},${String(n).padStart(2,"0")}`}function b(e,t="en-US"){return e.toLocaleString(t,{year:"numeric",month:"short",day:"numeric"})}function w(e,t,n=2021){if(t>11||e>31)return!1;const r=new Date(n,t,e);return!Number.isNaN(r.getTime())&&r.getDate()===e}function I(e=""){const t=e.match(/\d{1,2}\s[a-zA-Z]{3,}/),n=e.match(/[a-zA-Z]{3,}\s\d{1,2}/),r=e.match(/\d{1,2}[./-]\d{1,2}([./-]\d{2,4})?/);if(!t&&!r&&!n)return;if(r){const[t,n,r]=e.split(/[./-]/).map(Number);return r&&r<2015||!w(t,n-1,r||void 0)?void 0:`${r?`${r}-`:""}${String(n).padStart(2,"0")}-${String(t).padStart(2,"0")}`}const o=e.split(" "),u=t?o[0]:o[1],a=(t?o[1]:o[0]).toLowerCase(),s=d.findIndex((e=>e.startsWith(a)));return-1!==s&&w(Number(u),s)?`${String(s+1).padStart(2,"0")}-${String(u).padStart(2,"0")}`:void 0}function C(e){return e+86400}function E(e){return`${e[0].toLowerCase()}${e.slice(1)}`}function S(e){return`${e[0].toUpperCase()}${e.slice(1)}`}},4284:(e,t,n)=>{n.d(t,{g6:()=>a,U_:()=>s,NM:()=>i,Wg:()=>c});var r=n(3681);const o=["female_sign","male_sign","medical_symbol"],d=[[/\u{1f3f3}\u200d\u{1f308}/gu,"🏳️‍🌈"],[/\u{1f3f3}\u200d\u26a7\ufe0f/gu,"🏳️‍⚧️"],[/\u{1f937}\u200d\u2642/gu,"🤷‍♂️"]];function u(e){const t=e.split("-").map((e=>parseInt(e,16)));return String.fromCodePoint(...t)}function a(e){if(!e.match(r.Z))return e;for(const[t,n]of d)e=e.replace(t,n);return e}function s(e){let t;if(1===e.length)t=e.charCodeAt(0).toString(16).padStart(4,"0");else{const n=[];for(let t=0;t=55296&&e.charCodeAt(t)<=56319?e.charCodeAt(t+1)>=56320&&e.charCodeAt(t+1)<=57343&&n.push(1024*(e.charCodeAt(t)-55296)+(e.charCodeAt(t+1)-56320)+65536):(e.charCodeAt(t)<55296||e.charCodeAt(t)>57343)&&n.push(e.charCodeAt(t));t=n.map((e=>e.toString(16).padStart(4,"0"))).join("-")}return t}function i(e){const t={categories:[],emojis:{}};for(let n=0;ne.codePointAt(0)+127397));return String.fromCodePoint(...n)}},7361:(e,t,n)=>{n.d(t,{cL:()=>k,wZ:()=>p,vX:()=>M,op:()=>C,cj:()=>m,jm:()=>h,m5:()=>P,I_:()=>S,fl:()=>y,s$:()=>g,Mc:()=>E,wB:()=>b,p7:()=>w,$b:()=>v,mh:()=>I,s0:()=>A,aZ:()=>T,Lt:()=>f,vn:()=>i,on:()=>d});var r=n(3716);let o;function d(){return Boolean(o)}var u,a;new Promise((e=>{const t=new Image;t.src="data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA";const n=()=>{e(2===t.height)};t.onload=n,t.onerror=n})).then((e=>{o=e}));let s=null!==(u=(a=window).matchMedia)&&void 0!==u&&u.call(a,"(prefers-color-scheme: dark)").matches?"dark":"light";function i(){return s}function c(e){s=e.matches?"dark":"light"}const l=window.matchMedia("(prefers-color-scheme: dark)");"function"==typeof l.addEventListener?l.addEventListener("change",c):"function"==typeof l.addListener&&l.addListener(c);const f=function(){const{userAgent:e,platform:t}=window.navigator;let n;return-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(t)?n="macOS":-1!==["iPhone","iPad","iPod"].indexOf(t)?n="iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(t)?n="Windows":/Android/.test(e)?n="Android":/Linux/.test(t)&&(n="Linux"),n}(),h="macOS"===f,m="iOS"===f,p="Android"===f,g=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),y=window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone||document.referrer.includes("android-app://"),v=window.matchMedia("(pointer: coarse)").matches,b=window.innerWidth<=r.l3||window.innerWidth<=r.u_&&window.innerHeight<=r.rO,w=!b&&window.innerWidth<=r.ks,I=navigator.mediaDevices&&"getUserMedia"in navigator.mediaDevices&&(window.AudioContext||window.webkitAudioContext),C=(document.documentElement.style,f&&(h||m)),E="serviceWorker"in navigator,S=E,P=(window,Boolean((new Audio).canPlayType("audio/ogg; codecs=opus"))),M=!r.Cg&&"filter"in(document.createElement("canvas").getContext("2d")||{}),A=p?"slide-fade":m?"slide-layers":"push-slide",k=window.devicePixelRatio||1,T=!0},1394:(e,t,n)=>{n.d(t,{A9:()=>d,YJ:()=>u,hl:()=>a,pt:()=>s,jj:()=>i,ud:()=>c,gm:()=>l,ao:()=>f});var r=n(9118);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){const t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=atob(t[1]);let o=r.length;const d=new Uint8Array(o);for(;o--;)d[o]=r.charCodeAt(o);return new Blob([d],{type:n})}function u(e){return new Promise(((t,n)=>{const r=new FileReader;r.onload=e=>{const{result:r}=e.target||{};"string"==typeof r&&t(r),n(new Error("Failed to read blob"))},r.onerror=n,r.readAsDataURL(e)}))}function a(e,t){return new File([e],t,{lastModified:Date.now(),type:e.type})}function s(e){return new Promise(((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=n,r.src=e}))}function i(e){return new Promise(((t,n)=>{const r=document.createElement("video");r.volume=0,r.onloadedmetadata=()=>t(r),r.onerror=n,r.src=e}))}async function c(e){const t=await i(e);return Promise.race([(0,r.wO)(2e3),new Promise(((e,n)=>{t.onseeked=()=>{t.videoWidth&&t.videoHeight||e(void 0);const n=document.createElement("canvas");n.width=t.videoWidth,n.height=t.videoHeight,n.getContext("2d").drawImage(t,0,0),e(n.toDataURL("image/jpeg"))},t.onerror=n,t.currentTime=Math.min(t.duration,1)}))])}async function l(e){return(await fetch(e)).blob()}function f(e){const t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t}"undefined"==typeof File&&(self.File=class extends Blob{constructor(e,t,n){if(n){const{type:t,...r}=n;super(e,{type:t}),o(this,"name",void 0),Object.assign(this,r)}else super(e),o(this,"name",void 0);this.name=t}})},9937:(e,t,n)=>{function r(e,t,n="en"){return new Intl.NumberFormat(n,{style:"currency",currency:t}).format("JPY"===t?e:e/100)}n.d(t,{x:()=>r})},6926:(e,t,n)=>{n.d(t,{Z:()=>r});const r=e=>{let t;do{t=String(Math.random()).replace("0.","id")}while(e.hasOwnProperty(t));return t}},1947:(e,t,n)=>{n.d(t,{ZP:()=>d,J_:()=>u});const r={CHAT_RESTRICTED:"You can't send messages in this chat, you were restricted",CHAT_WRITE_FORBIDDEN:"You can't write in this chat",CHAT_SEND_POLL_FORBIDDEN:"You can't create polls in this chat",CHAT_SEND_STICKERS_FORBIDDEN:"You can't send stickers in this chat",CHAT_SEND_GIFS_FORBIDDEN:"You can't send gifs in this chat",CHAT_SEND_MEDIA_FORBIDDEN:"You can't send media in this chat",CHAT_LINK_EXISTS:"The chat is public, you can't hide the history to new users",SLOWMODE_WAIT_X:"Slowmode is enabled in this chat: you must wait for the specified number of seconds before sending another message to the chat.",USER_BANNED_IN_CHANNEL:"You're banned from sending messages in supergroups / channels",USER_IS_BLOCKED:"You were blocked by this user",YOU_BLOCKED_USER:"You blocked this user",IMAGE_PROCESS_FAILED:"Failure while processing image",MEDIA_EMPTY:"The provided media object is invalid",MEDIA_INVALID:"Media invalid",PHOTO_EXT_INVALID:"The extension of the photo is invalid",PHOTO_INVALID_DIMENSIONS:"The photo dimensions are invalid",PHOTO_SAVE_FILE_INVALID:"Internal issues, try again later",MESSAGE_DELETE_FORBIDDEN:"You can't delete one of the messages you tried to delete, most likely because it is a service message.",MESSAGE_POLL_CLOSED:"Poll closed",MESSAGE_EDIT_TIME_EXPIRED:"You can't edit this message anymore.",CHAT_ADMIN_REQUIRED:"You must be an admin in this chat to do this",PINNED_DIALOGS_TOO_MUCH:"Sorry, you can only pin 5 chats to the top",DIALOG_FILTERS_TOO_MUCH:"Sorry, you can't have more than 10 folders",CHANNEL_PRIVATE:"This channel is private",MEDIA_CAPTION_TOO_LONG:"The provided caption is too long",ADDRESS_STREET_LINE1_INVALID:"The address you provided is not valid",ADDRESS_STREET_LINE2_INVALID:"The address you provided is not valid",ADDRESS_CITY_INVALID:"The city you provided is not valid",ADDRESS_COUNTRY_INVALID:"The country you provided is not valid",ADDRESS_POSTCODE_INVALID:"The postcode you provided is not valid",ADDRESS_STATE_INVALID:"The state you provided is not valid",REQ_INFO_NAME_INVALID:"The name you provided is not valid",REQ_INFO_PHONE_INVALID:"The phone you provided is not valid",REQ_INFO_EMAIL_INVALID:"The email you provided is not valid",LINK_NOT_MODIFIED:"This discussion is already linked to the channel",MESSAGE_TOO_LONG:"Message is too long",SERVICE_WORKER_DISABLED:"Service Worker is disabled. Please reload the page without holding key.",MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS:"The provided message is too long. Please remove {EXTRA_CHARS_COUNT} character{PLURAL_S}.",FRESH_RESET_AUTHORISATION_FORBIDDEN:"You can’t logout other sessions if less than 24 hours have passed since you logged on the current session",BOTS_TOO_MUCH:"There are too many bots in this chat/channel",BOT_GROUPS_BLOCKED:"This bot can't be added to groups",USERS_TOO_MUCH:"The maximum number of users has been exceeded",USER_CHANNELS_TOO_MUCH:"One of the users you tried to add is already in too many channels/supergroups",USER_KICKED:"This user was kicked from this supergroup/channel",USER_NOT_MUTUAL_CONTACT:"The provided user is not a mutual contact",USER_PRIVACY_RESTRICTED:"The user's privacy settings do not allow you to do this",INVITE_HASH_EMPTY:"The invite hash is empty",INVITE_HASH_EXPIRED:"The invite link has expired",INVITE_HASH_INVALID:"The invite hash is invalid",CHANNELS_TOO_MUCH:"You have joined too many channels/supergroups",USER_ALREADY_PARTICIPANT:"You already in the group",SCHEDULE_DATE_INVALID:"Invalid schedule date provided",WALLPAPER_DIMENSIONS_INVALID:"The wallpaper dimensions are invalid, please select another file"},o={ADDRESS_STREET_LINE1_INVALID:{field:"streetLine1",message:"Incorrect street address"},ADDRESS_STREET_LINE2_INVALID:{field:"streetLine2",message:"Incorrect street address"},ADDRESS_CITY_INVALID:{field:"city",message:"Incorrect city"},ADDRESS_COUNTRY_INVALID:{field:"countryIso2",message:"Incorrect country"},ADDRESS_POSTCODE_INVALID:{field:"postCode",message:"Incorrect post code"},ADDRESS_STATE_INVALID:{field:"state",message:"Incorrect state"},REQ_INFO_NAME_INVALID:{field:"fullName",message:"Incorrect name"},REQ_INFO_PHONE_INVALID:{field:"phone",message:"Incorrect phone"},REQ_INFO_EMAIL_INVALID:{field:"email",message:"Incorrect email"}};function d(e){const{message:t,isSlowMode:n,textParams:o}=e;if(n){const e=t.indexOf(" (caused by");return e>0?t.substring(0,e):t}let d=r[t];return d&&o&&(d=Object.keys(o).reduce(((e,t)=>e.replace(t,o[t])),d)),d}function u(e){return o[e.message]}},3592:(e,t,n)=>{n.d(t,{S:()=>d}),n(3716);var r=n(9118);function o(e){e.preventDefault(),d(e instanceof ErrorEvent?e.error:e.reason)}function d(e){console.error(e)}window.addEventListener("error",o),window.addEventListener("unhandledrejection",o),(0,r.P2)(window.alert,1e3)},782:(e,t,n)=>{function r(e,t){return e.reduce(((e,n)=>(e[n[t]]=n,e)),{})}function o(e,t){return Object.keys(e).reduce(((n,r,o)=>(n[r]=t(e[r],r,o,e),n)),{})}function d(e,t){return t.reduce(((t,n)=>(t[n]=e[n],t)),{})}function u(e,t){return t.reduce(((t,n)=>(e[n]&&(t[n]=e[n]),t)),{})}function a(e,t){const n=new Set(t.map(String));return d(e,Object.keys(e).filter((e=>!n.has(e))))}function s(e,t,n="asc"){return e.sort(((e,r)=>{if(Array.isArray(t)){const[o,d]=Array.isArray(n)?n:[n,n],[u,a]=t;let s,i;if("function"==typeof u?(s=u(e)||0,i=u(r)||0):"string"==typeof u&&(s=e[u]||0,i=r[u]||0),s!==i)return"asc"===o?s-i:i-s;{let t,n;return"function"==typeof a?(t=a(e)||0,n=a(r)||0):"string"==typeof a&&(t=e[a]||0,n=r[a]||0),"asc"===d?t-n:n-t}}let o,d;return"function"==typeof t?(o=t(e)||0,d=t(r)||0):"string"==typeof t&&(o=e[t]||0,d=r[t]||0),"asc"===n?o-d:d-o}))}function i(e){return e.reduce(((e,t)=>Array.isArray(t)?e.concat(t):(e.push(t),e)),[])}function c(e){return Array.from(new Set(e))}function l(e){return e.filter(Boolean)}function f(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))}function h(e,t){return e[0]<=t[t.length-1]&&e[e.length-1]>=t[0]}function m(e,t){return e.filter((e=>t.has(e)))}function p(e,t){const n=[];for(let r=0;r(t[n]=g(e[n]),t)),{})}function y(e,t){let n=e.length;for(;n--;)if(t(e[n],n,e))return e[n]}n.d(t,{ee:()=>r,Q8:()=>o,ei:()=>d,q0:()=>u,CE:()=>a,Xo:()=>s,xH:()=>i,Tw:()=>c,oA:()=>l,et:()=>f,YE:()=>h,eL:()=>m,Vl:()=>p,Xh:()=>g,dF:()=>y})},663:(e,t,n)=>{n.d(t,{ll:()=>m,i0:()=>v,Pn:()=>b,m0:()=>w});var r=n(5116),o=n(3716),d=n(9524),u=n(1226),a=n(2155);const s=/%\d?\$?[sdf@]/g,i=["value","zeroValue","oneValue","twoValue","fewValue","manyValue","otherValue"],c={en:e=>1!==e?6:2,ar:e=>0===e?1:1===e?2:2===e?3:e%100>=3&&e%100<=10?4:e%100>=11?5:6,ca:e=>1!==e?6:2,de:e=>1!==e?6:2,es:e=>1!==e?6:2,fa:e=>e>1?6:2,fr:e=>e>1?6:2,id:()=>0,it:e=>1!==e?6:2,ko:()=>0,ms:()=>0,nl:e=>1!==e?6:2,pl:e=>1===e?2:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?4:5,pt_BR:e=>e>1?6:2,ru:e=>e%10==1&&e%100!=11?2:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?4:5,tr:e=>e>1?6:2,uk:e=>e%10==1&&e%100!=11?2:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?4:5,uz:e=>e>1?6:2},l=new Map;let f,h;const{addCallback:m,removeCallback:p,runCallbacks:g}=function(){const e=[];function t(t){const n=e.indexOf(t);-1!==n&&e.splice(n,1)}return{runCallbacks:function(...t){e.forEach((e=>{e(...t)}))},addCallback:function(n){return e.push(n),()=>{t(n)}},removeCallback:t}}();let y;const v=(e,t,n)=>{var r,o;if(void 0!==t){const r=Array.isArray(t)?JSON.stringify(t):t,o=l.get(`${e}_${r}_${n}`);if(o)return o}if(!f&&!h)return e;const d=(null===(r=f)||void 0===r?void 0:r[e])||(null===(o=h)||void 0===o?void 0:o[e]);return d?C(d,e,t,n):(h||I(),e)};async function b(e,t){let n=await d.fetch(o.ee,`${o.$O}_${e}_${t}`,d.Type.Json);return n||(n=await async function(e,t,n){const r=await(0,u.t9)("fetchLangStrings",{langPack:e,langCode:t,keys:[n]});if(null!=r&&r.length)return await d.save(o.ee,`${e}_${t}_${n}`,r[0]),r[0]}(o.$O,e,t)),C(n,t)}async function w(e,t,n=!1){if(f&&e===y)return void(t&&t());let a=await d.fetch(o.ee,e,d.Type.Json);if(!a&&(n&&await I(),a=await async function(e){const t=await(0,u.t9)("fetchLangPack",{sourceLangPacks:o.Bg,langCode:e});if(t)return await d.save(o.ee,e,t.langPack),t.langPack}(e),!a))return;l.clear(),y=e,f=a,document.documentElement.lang=e;const{languages:s}=(0,r.Rd)().settings.byKey,i=null==s?void 0:s.find((t=>t.langCode===e));v.isRtl=Boolean(null==i?void 0:i.rtl),v.code=e,t&&t(),g()}async function I(){h||(h=(await n.e(915).then(n.bind(n,1915))).default,g())}function C(e,t,n,r){const d=e?e["number"==typeof n?function(e){const t=y||o.sR,n=c[t]?c[t](e):0;return i[n]}(n):"value"]:void 0;if(!d||!d.trim()){const e=t.split(".");return e[e.length-1]}if(void 0!==n){const e=function(e,t){t=Array.isArray(t)?t:[t];const n=e.split(s),r=n.shift();return n.reduce(((e,n,r)=>`${e}${String(t[r]||"")}${n}`),r||"")}(d,"i"===r?(0,a.kh)(n):n),o=Array.isArray(n)?JSON.stringify(n):n;return l.set(`${t}_${o}_${r}`,e),e}return d}},647:(e,t,n)=>{n.d(t,{cC:()=>y,he:()=>p,UV:()=>g});var r=n(6137),o=n(3716),d=n(1226),u=n(9524),a=n(1394),s=n(7361);const i=48e3;async function c(e){const t=await new Response(e).arrayBuffer();return new Promise((e=>{const r=new Uint8Array(t);let o=new Worker(new URL(n.p+n.u(745),n.b)),d=new Worker(new URL(n.p+n.u(993),n.b));o.onmessage=e=>{null===e.data?d.postMessage({command:"done"}):d.postMessage({command:"encode",buffers:e.data},e.data.map((({buffer:e})=>e)))},d.onmessage=t=>{"page"===t.data.message&&(e(new Blob([t.data.page],{type:"audio/wav"})),o.terminate(),o=void 0,d.terminate(),d=void 0)},d.postMessage({command:"init",wavBitDepth:16,wavSampleRate:i}),o.postMessage({command:"init",decoderSampleRate:i,outputBufferSampleRate:i}),o.postMessage({command:"decode",pages:r},[r.buffer])}))}var l=n(862);const f={[r.IU.DataUri]:u.Type.Text,[r.IU.BlobUrl]:u.Type.Blob,[r.IU.Lottie]:u.Type.Json,[r.IU.Progressive]:void 0,[r.IU.Stream]:void 0},h=new Map,m=new Map;function p(e,t,n=!1,i){if(t===r.IU.Progressive)return s.I_?function(e){const t=`./progressive/${e}`;return h.set(e,t),Promise.resolve(t)}(e):p(e,r.IU.BlobUrl,n,i);if(!m.has(e)){const p=async function(e,t,n,i){if(!o.Cy){const r=e.startsWith("avatar")?o.SG:o.lW,d=await u.fetch(r,e,f[t],n);if(d){let t=d;if("audio/ogg"!==d.type||s.m5||(t=await c(t)),"image/webp"===d.type&&!(0,s.on)()&&t){const n=await(0,l._y)(e,t);n&&(t=n)}const n=v(t);return h.set(e,n),n}}if(t===r.IU.Stream){const n=new MediaSource,r=URL.createObjectURL(n);let o=!1;return n.addEventListener("sourceopen",(()=>{if(o)return;o=!0;const r=n.addSourceBuffer("audio/mpeg");(0,d.t9)("downloadMedia",{url:e,mediaFormat:t},((e,t)=>{i&&i(e),1===e&&n.endOfStream(),t&&r.appendBuffer(t)}))})),h.set(e,r),r}const m=await(0,d.t9)("downloadMedia",{url:e,mediaFormat:t,isHtmlAllowed:n},i);if(!m)throw new Error("Failed to fetch media");let{prepared:p,mimeType:g}=m;if("audio/ogg"===g&&!s.m5){const e=await(0,a.gm)(p);URL.revokeObjectURL(p),p=v(await c(e)),g=e.type}if("image/webp"===g&&!(0,s.on)()){const t=await(0,a.gm)(p);URL.revokeObjectURL(p);const n=await(0,l._y)(e,t);n&&(p=v(n))}return h.set(e,p),p}(e,t,n,i).catch((e=>{o.eM&&console.warn(e)})).finally((()=>{m.delete(e)}));m.set(e,p)}return m.get(e)}function g(e){return h.get(e)}function y(e){(0,d.u3)(e)}function v(e){return e instanceof Blob?URL.createObjectURL(e):e}s.I_&&navigator.serviceWorker.addEventListener("message",(async e=>{const{type:t,messageId:n,params:o}=e.data;if("requestPart"!==t)return;const u=await(0,d.t9)("downloadMedia",{mediaFormat:r.IU.Progressive,...o});if(!u)return;const{arrayBuffer:a,mimeType:s,fullSize:i}=u;navigator.serviceWorker.controller.postMessage({type:"partResponse",messageId:n,result:{arrayBuffer:a,mimeType:s,fullSize:i}},[a])}))},735:(e,t,n)=>{n.d(t,{D:()=>r});const r=[]},9203:(e,t,n)=>{n.d(t,{gl:()=>o,$y:()=>a,o5:()=>s,Qt:()=>c});var r=n(3716);let o;!function(e){e[e.Auth=0]="Auth",e[e.Main=1]="Main",e[e.Extra=2]="Extra"}(o||(o={}));const d={},u={};async function a(e,t){if(!d[e]){switch(e){case o.Auth:d[o.Auth]=n.e(133).then(n.bind(n,1133));break;case o.Main:r.eM&&console.log(">>> START LOAD MAIN BUNDLE"),d[o.Main]=Promise.all([n.e(484),n.e(433)]).then(n.bind(n,8065));break;case o.Extra:d[o.Extra]=Promise.all([n.e(484),n.e(860)]).then(n.bind(n,860))}d[e].then(l)}const a=await d[e];return u[e]||(u[e]=a),s(e,t)}function s(e,t){const n=u[e];if(n)return n[t]}const i=[];function c(e){i.includes(e)||i.push(e)}function l(){i.forEach((e=>{e()}))}},8406:(e,t,n)=>{n.d(t,{s_:()=>v,r1:()=>I,Ld:()=>E,VL:()=>S,Vr:()=>P,KC:()=>M});var r=n(1226),o=n(6137),d=n(2864),u=n(3716),a=n(5116),s=n(2858),i=n(663),c=n(1752),l=n(8085),f=n(7361),h=n(647),m=n(9118);function p(e){const t=e.toJSON();return JSON.stringify({endpoint:t.endpoint,keys:t.keys})}function g(){return!!f.Mc&&("showNotification"in ServiceWorkerRegistration.prototype?"denied"===Notification.permission?(u.eM&&console.warn("[PUSH] The user has blocked push notifications."),!1):"PushManager"in window||(u.eM&&console.warn("[PUSH] Push messaging isn't supported."),!1):(u.eM&&console.warn("[PUSH] Push notifications aren't supported."),!1))}const y=new Set,v=(0,m.Ds)((async function(e){if(y.has(e))return;const{notificationSoundVolume:t}=(0,l.dZ)((0,a.Rd)()),n=t/10;if(0===n)return;const r=new Audio("/notification.mp3");r.volume=n,r.setAttribute("mozaudiochannel","notification"),r.addEventListener("ended",(()=>{y.add(e)}),{once:!0}),setTimeout((()=>{y.delete(e)}),3e3);try{await r.play()}catch(e){u.eM&&console.warn("[PUSH] Unable to play notification sound")}}),1e3,!0,!1);async function b(){"Notification"in window&&(["granted","denied"].includes(Notification.permission)||await Notification.requestPermission())}async function w(e){const t=(0,a.Rd)(),n=(0,a.uC)();if(e)try{const t=p(e);return await(0,r.t9)("unregisterDevice",t),await e.unsubscribe(),void n.deleteDeviceToken()}catch(e){u.eM&&console.log("[PUSH] Unable to unsubscribe from push.",e)}t.push&&(await(0,r.t9)("unregisterDevice",t.push.deviceToken),n.deleteDeviceToken())}async function I(){if(!g())return;const e=await navigator.serviceWorker.ready,t=await e.pushManager.getSubscription();await w(t)}let C=!1;async function E(){if(!g())return void await b();const e=await navigator.serviceWorker.ready;let t=await e.pushManager.getSubscription();if(function(e){const t=(0,a.Rd)();return!t.push||!e||p(e)!==t.push.deviceToken||Date.now()-t.push.subscribedAt>432e5}(t)){await w(t);try{t=await e.pushManager.subscribe({userVisibleOnly:!0});const n=p(t);u.eM&&console.log("[PUSH] Received push subscription: ",n),await(0,r.t9)("registerDevice",n),(0,a.uC)().setDeviceToken(n)}catch(e){"denied"===Notification.permission?u.eM&&console.warn("[PUSH] The user has blocked push notifications."):u.eM&&(console.log("[PUSH] Unable to subscribe to push.",e),e.code===DOMException.ABORT_ERR&&await b())}}}async function S({chat:e,message:t,isActiveChat:n}){if(!("Notification"in window?"denied"!==Notification.permission||(u.eM&&console.warn("[PUSH] The user has blocked push notifications."),0):(u.eM&&console.warn("[PUSH] This browser does not support desktop notification"),0)))return;if(!t.id)return;if(await async function(){if(C)return;const[e,t]=await Promise.all([(0,r.t9)("fetchNotificationSettings",{serverTimeOffset:(0,a.Rd)().serverTimeOffset}),(0,r.t9)("fetchNotificationExceptions",{serverTimeOffset:(0,a.Rd)().serverTimeOffset})]);if(!e)return;let n=(0,c.BI)((0,a.Rd)(),e);t&&(n=(0,c.aJ)(n,t)),(0,a.R3)(n),C=!0}(),!function(e,t){if(!C)return!1;const n=(0,a.Rd)();return!((0,s.i4)(e,(0,l.dZ)(n),(0,l.NJ)(n))||e.isNotJoined||!e.isListed||t&&document.hasFocus())}(e,n))return;const{title:f,body:m}=function(e,t){const n=(0,a.Rd)(),{senderId:r,replyToMessageId:o}=t,u=r?(0,l.dy)(n,r):void 0,c=(0,s.N5)(t),f=c&&o?(0,l.hj)(n,e.id,o):void 0,{targetUserIds:h,targetChatId:m}=c||{},p=h?h.map((e=>(0,l.dy)(n,e))).filter(Boolean):void 0,g=(0,s.zX)(e),y=g?(0,l.dy)(n,g):void 0;let v;if((0,s.Sm)(e,(0,l.dZ)(n),(0,l.NJ)(n)))if((0,s.Lo)(t)){const n=e&&((0,s.eA)(e)||t.senderId===t.chatId)?e:u;v=(0,d.D)(i.i0,t,n,p,f,m,{asPlain:!0})}else{const n=(0,s.zF)(i.i0,e.id,u),r=(0,s.MK)(i.i0,t);v=n?`${n}: ${r}`:r}else v="New message";return{title:(0,s.U)(i.i0,e,y),body:v}}(e,t),p=await async function(e){const t=(0,s.RT)(e);if(!t)return;let n=h.UV(t);return n||(await h.he(t,o.IU.BlobUrl),n=h.UV(t)),n}(e);if(g())navigator.serviceWorker.controller&&navigator.serviceWorker.controller.postMessage({type:"newMessageNotification",payload:{title:f,body:m,icon:p,chatId:e.id,messageId:t.id}});else{const n=(0,a.uC)(),r={body:m,icon:p,badge:p,tag:t.id.toString()};"vibrate"in navigator&&(r.vibrate=[200,100,200]);const o=new Notification(f,r);o.onclick=()=>{o.close(),n.focusMessage({chatId:e.id,messageId:t.id}),window.focus&&window.focus()},o.onshow=()=>{v(t.id||e.id)}}}function P(e){!u.Cg&&navigator.serviceWorker.controller&&navigator.serviceWorker.controller.postMessage({type:"closeMessageNotifications",payload:e})}function M(){navigator.serviceWorker.controller&&navigator.serviceWorker.controller.postMessage({type:"clientReady"})}},6272:(e,t,n)=>{n.d(t,{U9:()=>u,g3:()=>a,un:()=>s,WZ:()=>i});var r=n(782);const o="X",d="XXX XXX XXX XXX";function u(e,t){return e.filter((e=>e.iso2===t))}function a(e,t=""){var n;let o=t.replace(/[^\d+]+/g,"");o.startsWith("+")&&(o=o.substr(1));const d=e.filter((e=>o.startsWith(e.countryCode))),u=(0,r.xH)(d.map((e=>(e.prefixes||[""]).map((t=>({code:`${e.countryCode}${t}`,country:e})))))).filter((({code:e})=>o.startsWith(e))).sort(((e,t)=>e.code.length-t.code.length));return null===(n=u[u.length-1])||void 0===n?void 0:n.country}function s(e,t){let n=e.replace(/[^\d]+/g,"");if(t)n=n.substr(t.countryCode.length);else if(e.startsWith("+"))return e;const r=function(e,t){if(!t||0===t.length)return d;if(1===t.length)return t[0];const n=t.find((e=>e.startsWith(o)))||d,r=t.filter((t=>{const n=t.replace(/[^\dX]+/g,"");if(n.startsWith(o))return!1;for(let t=0;tn.length-1||n[t]!==o&&n[t]!==e[t])return!1;return!0}));return 1===r.length?r[0]:n}(n,null==t?void 0:t.patterns),u=[];let a=0;for(let e=0;e{function r(e,t,n=!0,r=!0){let o;return(...d)=>{o?(clearTimeout(o),o=void 0):n&&e(...d),o=self.setTimeout((()=>{r&&e(...d),o=void 0}),t)}}function o(e,t,n=!0){let r,o,d;return(...u)=>{o=!0,d=u,r||(n&&(o=!1,e(...d)),r=self.setInterval((()=>{if(!o)return self.clearInterval(r),void(r=void 0);o=!1,e(...d)}),t))}}function d(e){return a(p,e)}function u(e){return a(g,e)}function a(e,t){let n,r=!1;return(...o)=>{n=o,r||(r=!0,e((()=>{r=!1,t(...n)})))}}function s(e){Promise.resolve().then(e)}function i(e){self.requestIdleCallback?self.requestIdleCallback(e):s(e)}n.d(t,{Ds:()=>r,P2:()=>o,mS:()=>d,wT:()=>u,R3:()=>s,Q8:()=>i,wO:()=>c,Pn:()=>l,T2:()=>p,Gq:()=>y});const c=e=>new Promise((t=>{setTimeout((()=>t()),e)}));function l(){return new Promise((e=>{p(e)}))}let f,h,m;function p(e,t=!1){f?t?h.push(e):f.push(e):(f=t?[]:[e],h=t?[e]:[],requestAnimationFrame((()=>{const e=f,t=h;f=void 0,h=void 0,t.forEach((e=>e())),e.forEach((e=>e()))})))}function g(e){p(e,!0)}function y(e,t=!1){return m||(m=[],self.addEventListener("beforeunload",(()=>{m.forEach((e=>e()))}))),t?m.push(e):m.unshift(e),()=>{m=m.filter((t=>t!==e))}}},5765:(e,t,n)=>{let r;n.d(t,{Z:()=>o});try{r=new RegExp("[^\\p{L}\\p{M}]+","ui")}catch(e){r=new RegExp("[^\\wа-яё]+","i")}function o(e,t){if(!e||!t)return!1;const n=e.toLowerCase().split(r);return t.toLowerCase().split(r).every((e=>n.some((t=>t.startsWith(e)))))}},2267:(e,t,n)=>{n.d(t,{b:()=>r});const r=e=>Math.floor(Date.now()/1e3)+e},4688:(e,t,n)=>{n.d(t,{f3:()=>m,jv:()=>l,ti:()=>i,Qw:()=>h,K8:()=>f,wX:()=>c});function r(e){return new Promise(((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)}))}let o;function d(){return o||(o=function(e,t){const n=function(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let e;return new Promise((t=>{const n=()=>indexedDB.databases().finally(t);e=setInterval(n,100),n()})).finally((()=>clearInterval(e)))}().then((()=>{const e=indexedDB.open("keyval-store");return e.onupgradeneeded=()=>e.result.createObjectStore(t),r(e)}));return(e,r)=>n.then((n=>r(n.transaction(t,e).objectStore(t))))}(0,"keyval")),o}var u=n(3716),a=n(9524);const s=[1,2,3,4,5];function i(e=!1){if(e&&localStorage.getItem(u.Vx))return!0;const t=localStorage.getItem(u.b_);if(!t)return!1;try{const e=JSON.parse(t);return Boolean(e&&e.id&&e.dcID)}catch(e){return!1}}function c(e,t){const{mainDcId:n,keys:r,hashes:o}=e;localStorage.setItem(u.b_,JSON.stringify({dcID:n,id:t})),localStorage.setItem("dc",String(n)),Object.keys(r).map(Number).forEach((e=>{localStorage.setItem(`dc${e}_auth_key`,JSON.stringify(r[e]))})),Object.keys(o).map(Number).forEach((e=>{localStorage.setItem(`dc${e}_hash`,JSON.stringify(o[e]))}))}function l(){[u.b_,"dc",...s.map((e=>`dc${e}_auth_key`)),...s.map((e=>`dc${e}_hash`))].forEach((e=>{localStorage.removeItem(e)}))}function f(){if(!i())return;const e=JSON.parse(localStorage.getItem(u.b_)),t=Number(e.dcID),n={},r={};return s.forEach((e=>{try{const t=localStorage.getItem(`dc${e}_auth_key`);t&&(n[e]=JSON.parse(t));const o=localStorage.getItem(`dc${e}_hash`);o&&(r[e]=JSON.parse(o))}catch(e){u.eM&&console.warn("Failed to load stored session",e)}})),Object.keys(n).length?{mainDcId:t,keys:n,hashes:r}:void 0}async function h(){const e=localStorage.getItem(u.Vx);if(!e)return;const t=await function(e,t=d()){return t("readonly",(t=>r(t.get(e))))}(`GramJs:${e}`);try{c(JSON.parse(t))}catch(e){u.eM&&console.warn("Failed to load legacy session",e)}}async function m(){localStorage.removeItem(u.Vx);const e=await function(e=d()){const t=[];return function(e,t){return e("readonly",(e=>(e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},r(e.transaction))))}(e,(e=>t.push(e.key))).then((()=>t))}();await Promise.all([a.clear("GramJs"),...e.filter((e=>"string"==typeof e&&e.startsWith("GramJs:GramJs-session-"))).map((e=>function(e,t=d()){return t("readwrite",(t=>(t.delete(e),r(t.transaction))))}(e)))])}},6917:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(9933);const o=JSON.parse('{"--color-primary":["#50A2E9","#8378DB"],"--color-primary-opacity":["#50A2E980","#8378DB80"],"--color-primary-shade":["#4a95d6","#7b71c6"],"--color-background":["#FFFFFF","#212121"],"--color-background-secondary":["#f4f4f5","#121212"],"--color-background-secondary-accent":["#E4E4E5","#100f10"],"--color-background-own":["#EEFEDF","#8378DB"],"--color-background-own-apple":["#E7FDCC","#8378DB"],"--color-background-selected":["#F4F4F5","#2C2C2C"],"--color-background-own-selected":["#d4fcae","#7b71c6"],"--color-chat-hover":["#F4F4F5","#2C2C2C"],"--color-chat-active":["#4C90E6","#8378DB"],"--color-item-active":["#ededed","#292929"],"--color-text":["#000000","#FFFFFF"],"--color-text-secondary":["#707579","#AAAAAA"],"--color-text-secondary-apple":["#8E8E92","#AAAAAA"],"--color-borders":["#DADCE0","#303030"],"--color-borders-input":["#DADCE0","#5B5B5A"],"--color-dividers":["#C8C6CC","#404040"],"--color-links":["#52A1EF","#868DF6"],"--color-links-hover":["#2d8dec","#6b5fcc"],"--color-gray":["#C4C9CC","#717579"],"--color-pinned":["#C4C9CC","#707579"],"--color-default-shadow":["#72727240","#1010109c"],"--color-light-shadow":["#7272722B","#00000040"],"--color-green":["#4DCD5E","#8378DB"],"--color-text-meta-colored":["#4DCD5E","#8378DB"],"--color-reply-hover":["#F4F4F4","#272727"],"--color-reply-active":["#E8E9E9","#2E2F2F"],"--color-reply-own-hover":["#DBF4CE","#6458bc"],"--color-reply-own-hover-apple":["#d9f9c1","#6458bc"],"--color-reply-own-active":["#C8EBBC","#4F4A9F"],"--color-reply-own-active-apple":["#d5edc2","#4F4A9F"],"--color-accent-own":["#4FAE4E","#FFFFFF"],"--color-message-meta-own":["#4FAE4EFF","#FFFFFF88"],"--color-own-links":["#52A1EF","#FFFFFF"],"--color-code":["#4a729a","#93c4ef"],"--color-code-own":["#3c7940","#FFFFFF"],"--color-code-bg":["#70757914","#ffffff26"],"--color-code-own-bg":["#70757914","#ffffff26"]}');let d=!1;const u=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,a=(e,t,n)=>(1-n)*e+n*t,s=Object.keys(o).map((e=>({property:e,colors:[c(o[e][0]),c(o[e][1])]}))),i=(e,t)=>{const n="dark"===e,o=d&&t,u=n?0:1,a=n?1:0,s=Date.now(),i=document.querySelector('meta[name="theme-color"]');document.documentElement.classList.remove("theme-"+(n?"light":"dark")),d&&document.documentElement.classList.add("no-animations"),document.documentElement.classList.add(`theme-${e}`),i&&i.setAttribute("content",n?"#212121":"#fff"),setTimeout((()=>{document.documentElement.classList.remove("no-animations")}),500),d=!0,o?(0,r.c)((()=>{const e=Math.min((Date.now()-s)/200,1);return l(u,a,function(e){return 1-(1-e)**3.5}(e)),e<1})):l(u,a)};function c(e){const t=u.exec(e);return{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16),a:void 0!==t[4]?parseInt(t[4],16):void 0}}function l(e,t,n=1){s.forEach((({property:r,colors:o})=>{const d=Math.round(a(o[e].r,o[t].r,n)),u=Math.round(a(o[e].g,o[t].g,n)),s=Math.round(a(o[e].b,o[t].b,n)),i=void 0!==o[e].a?Math.round(a(o[e].a,o[t].a,n)):void 0;document.documentElement.style.setProperty(r,void 0!==i?`rgba(${d},${u},${s},${i/255})`:`rgb(${d},${u},${s})`)}))}},2155:(e,t,n)=>{n.d(t,{kh:()=>d,bi:()=>a,Xv:()=>s});var r=n(3681),o=n(4284);function d(e){return String(e).replace(/\d(?=(\d{3})+$)/g,"$& ")}function u(e){return".0"===String(e.toFixed(1)).substr(-2)?Math.round(e):e.toFixed(1).replace(".",",")}function a(e){return e<1e3?e:e<1e6?`${u(e/1e3)}K`:`${u(e/1e6)}M`}function s(e,t=2){return e.replace(/[.,!@#$%^&*()_+=\-`~[\]/\\{}:"|<>?]+/gi,"").trim().split(/\s+/).slice(0,t).map((e=>{if(!e.length)return"";const t=(e=(0,o.g6)(e)).match(r.Z);return t&&e.startsWith(t[0])?t[0]:e.match(/./u)[0].toUpperCase()})).join("")}},8035:(e,t,n)=>{function r(e,t=30){return!e||e.length<=t?e:`${e.substr(0,t)}...`}n.d(t,{Z:()=>r})},862:(e,t,n)=>{n.d(t,{Hu:()=>s,_y:()=>i,p6:()=>c});var r=n(7361),o=n(1394),d=n(9118);let u,a;const s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";async function i(e,t){for(l();!a.wasmReady;)await(0,d.wO)(2e3);const{result:n,width:r,height:o}=await function(e,t){return new Promise((n=>{a.requests||(a.requests=new Map),a.requests.set(e,n),a.postMessage({id:e,blob:t})}))}(e,t);if(r&&o)return function({result:e,width:t,height:n}){return u||(u=document.createElement("canvas")),new Promise((r=>{const o=new ImageData(e,t,n);u.width=t,u.height=n,u.getContext("2d").putImageData(o,0,0),u.toBlob((e=>{r(null!=e?e:void 0)}),"image/png",1)}))}({result:n,width:r,height:o})}async function c(e,t){if((0,r.on)()||"data:image/webp"!==t.substr(0,15))return t;l();const n=await i(e,(0,o.A9)(t));if(!n)throw new Error(`Can't convert webp to png. Url: ${t}`);return(0,o.YJ)(n)}function l(){a||(a=new Worker(new URL(n.p+n.u(536),n.b)),a.wasmReady=!1,a.onmessage=f)}function f(e){const{id:t}=e.data;switch(e.data.type){case"initialized":a.wasmReady=!0;break;case"result":if(a.requests.has(t)){const n=a.requests.get(t);a.requests.delete(t),n(e.data)}}}},1622:(e,t,n)=>{n.d(t,{I:()=>l,p:()=>f});var r=n(3716),o=n(5116),d=n(4688);const u=["t.me","telegram.me"].map((e=>`//${e}/_websync_?`)),a=`${r.Ji} Z`,s="tgme_sync",i=()=>Math.floor(Number(new Date)/1e3);let c;const l=e=>{const t=i(),{canRedirect:n,ts:r}=JSON.parse(localStorage.getItem(s)||"{}");return n!==e||r+86400<=t?Promise.all(u.map((t=>new Promise(((n,r)=>{const o=document.createElement("script"),d=()=>!!document.body.removeChild(o);o.src=t+new URLSearchParams({authed:Number(e).toString(),version:a}),document.body.appendChild(o),o.onload=()=>{(e=>{const t=i();localStorage.setItem(s,JSON.stringify({canRedirect:e,ts:t}))})(e),d(),c&&(clearTimeout(c),c=void 0),f(),n()},o.onerror=()=>{d(),r()}}))))):Promise.resolve()};function f(){if(r.eM)return;if(void 0!==c)return;const e=i(),{ts:t}=JSON.parse(localStorage.getItem(s)||"{}"),n=86400-(e-t);c=setTimeout((()=>{const{authState:e}=(0,o.Rd)(),t="authorizationStateReady"===e||(0,d.ti)(!0);l(t)}),Math.max(0,1e3*n))}},3858:(e,t,n)=>{n.d(t,{z:()=>l,Z:()=>h});var r=n(9118),o=n(3716),d=n(7361);const u=d.wB&&f(),a=window.innerHeight;let s=l(),i=!1;const c=(0,r.P2)((()=>{s=l(),!i&&((s.width<=o.l3||s.width<=o.u_&&s.height<=o.rO)!==d.wB||d.wB&&u!==f())&&window.location.reload()}),250,!0);function l(){const e=.01*window.innerHeight;return document.documentElement.style.setProperty("--vh",`${e}px`),{width:window.innerWidth,height:window.innerHeight}}function f(){return d.cj?window.matchMedia("(orientation: landscape)").matches:window.matchMedia("screen and (min-device-aspect-ratio: 1/1) and (orientation: landscape)").matches}window.addEventListener("resize",c),window.addEventListener("orientationchange",c);const h={get:()=>s,getIsKeyboardVisible:()=>a>s.height,disableRefresh:function(){i=!0},enableRefresh:function(){i=!1}}},5359:(e,t,n)=>{e.exports=n.p+"app-inactive.bc7953c2dfebcabce2c4..png"},2162:(e,t,n)=>{e.exports=n.p+"monkey.a3d5fcdc50b18dc55695..svg"},4128:(e,t,n)=>{e.exports=n.p+"telegram-logo.df3a91becaa9678c529b..svg"}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return u[e].call(n.exports,n,n.exports,s),n.exports}s.m=u,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);s.r(o);var d={};e=e||[null,t({}),t([]),t(t)];for(var u=2&r&&n;"object"==typeof u&&!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach((e=>d[e]=()=>n[e]));return d.default=()=>n,s.d(o,d),o},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>e+"."+{99:"f03a947e6e336feffec8",133:"89ca9055166cf90beaa7",161:"286d0207d962142ad548",354:"701ac7c1e3f066f82e25",433:"c66cb5158ff9fdb2297f",472:"21e5264f606f2b525030",484:"87953bd73fba4543a4f6",501:"72ce4b6e27f459e194cd",514:"e85ae04366b5ac2cfcb1",524:"c17eab1f1ac04dc51e06",536:"55dc7dd4ab42a2c9f037",745:"9316c5c2b711c39a20a5",860:"71a26210d53a0e37c47e",915:"8fb9f0f20311fa368dc5",941:"997469720d84a3a8a3f7",993:"f0aad9f6787f211b4e51"}[e]+".js",s.miniCssF=e=>e+"."+{133:"89ca9055166cf90beaa7",433:"c66cb5158ff9fdb2297f",472:"21e5264f606f2b525030",484:"87953bd73fba4543a4f6",860:"71a26210d53a0e37c47e"}[e]+".css",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="telegram-t:",s.l=(e,t,o,d)=>{if(n[e])n[e].push(t);else{var u,a;if(void 0!==o)for(var i=document.getElementsByTagName("script"),c=0;c{u.onerror=u.onload=null,clearTimeout(h);var o=n[e];if(delete n[e],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach((e=>e(r))),t)return t(r)},h=setTimeout(f.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=f.bind(null,u.onerror),u.onload=f.bind(null,u.onload),a&&document.head.appendChild(u)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),o=e=>new Promise(((t,n)=>{var r=s.miniCssF(e),o=s.p+r;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),r=0;r{var o=document.createElement("link");o.rel="stylesheet",o.type="text/css",o.onerror=o.onload=d=>{if(o.onerror=o.onload=null,"load"===d.type)n();else{var u=d&&("load"===d.type?"missing":d.type),a=d&&d.target&&d.target.href||t,s=new Error("Loading CSS chunk "+e+" failed.\n("+a+")");s.code="CSS_CHUNK_LOAD_FAILED",s.type=u,s.request=a,o.parentNode.removeChild(o),r(s)}},o.href=t,document.head.appendChild(o)})(e,o,t,n)})),d={179:0},s.f.miniCss=(e,t)=>{d[e]?t.push(d[e]):0!==d[e]&&{133:1,433:1,472:1,484:1,860:1}[e]&&t.push(d[e]=o(e).then((()=>{d[e]=0}),(t=>{throw delete d[e],t})))},(()=>{s.b=document.baseURI||self.location.href;var e={179:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var d=s.p+s.u(t),u=new Error;s.l(d,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),d=n&&n.target&&n.target.src;u.message="Loading chunk "+t+" failed.\n("+o+": "+d+")",u.name="ChunkLoadError",u.type=o,u.request=d,r[1](u)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[d,u,a]=n,i=0;for(r in u)s.o(u,r)&&(s.m[r]=u[r]);for(a&&a(s),t&&t(n);i{s(3592);var e=s(3716),t=s(5116),n=s(7361),r=s(8406);function o(n){const o=n.data;if(e.eM&&console.log("[SW] Message from worker",o),!o.type)return;const d=(0,t.uC)();switch(o.type){case"focusMessage":d.focusMessage&&d.focusMessage(o.payload);break;case"playNotificationSound":(0,r.s_)(o.payload.id)}}function d(){navigator.serviceWorker.removeEventListener("message",o),navigator.serviceWorker.addEventListener("message",o),(0,r.KC)()}n.Mc&&(window.addEventListener("load",(async()=>{try{await navigator.serviceWorker.register(new URL(s.p+s.u(524),s.b)),e.eM&&console.log("[SW] ServiceWorker registered"),await navigator.serviceWorker.ready,navigator.serviceWorker.controller?(e.eM&&console.log("[SW] ServiceWorker ready"),d()):(e.eM&&console.error("[SW] ServiceWorker not available"),n.cj||n.wZ||(0,t.uC)().showDialog({data:{message:"SERVICE_WORKER_DISABLED",hasErrorKey:!0}}))}catch(t){e.eM&&console.error("[SW] ServiceWorker registration failed: ",t)}})),window.addEventListener("focus",(async()=>{await navigator.serviceWorker.ready,d()})));var u=s(2916);const a={isLeftColumnShown:!0,isChatInfoShown:!1,newChatMembersProgress:s(1713).WB.Closed,uiReadyState:0,serverTimeOffset:0,authRememberMe:!0,countryList:{phoneCodes:[],general:[]},blocked:{ids:[],totalCount:0},users:{byId:{}},chats:{listIds:{},isFullyLoaded:{},orderedPinnedIds:{},totalCount:{},byId:{}},messages:{byChatId:{},messageLists:[]},scheduledMessages:{byChatId:{}},chatFolders:{byId:{},activeChatFolder:0},fileUploads:{byMessageLocalId:{}},recentEmojis:["grinning","kissing_heart","christmas_tree","brain","trophy"],stickers:{setsById:{},added:{},recent:{stickers:[]},favorite:{stickers:[]},greeting:{stickers:[]},featured:{setIds:[]},search:{},forEmoji:{}},emojiKeywords:{},gifs:{saved:{},search:{}},inlineBots:{isLoading:!1,byUsername:{}},globalSearch:{},userSearch:{},localTextSearch:{byChatThreadKey:{}},localMediaSearch:{byChatId:{}},management:{byChatId:{}},topPeers:{},topInlineBots:{},mediaViewer:{},audioPlayer:{},forwardMessages:{},pollResults:{},payment:{},notifications:[],dialogs:[],activeSessions:[],settings:{byKey:{theme:"light",shouldUseSystemTheme:!0,messageTextSize:n.cj?e.b6:n.jm?e.AR:e.xS,animationLevel:e.CX,messageSendKeyCombo:"enter",shouldAutoDownloadMediaFromContacts:!0,shouldAutoDownloadMediaInPrivateChats:!0,shouldAutoDownloadMediaInGroups:!0,shouldAutoDownloadMediaInChannels:!0,hasWebNotifications:!0,hasPushNotifications:!0,notificationSoundVolume:5,shouldAutoPlayGifs:!0,shouldAutoPlayVideos:!0,shouldSuggestStickers:!0,shouldLoopStickers:!0,language:"en"},themes:{light:{isBlurred:!0,patternColor:e.g},dark:{isBlurred:!0,patternColor:e.Vv}},privacy:{},notifyExceptions:{}},twoFaSettings:{},shouldShowContextMenuHint:!0};var i=s(6137),c=s(9118),l=s(8674),f=s(782),h=s(8085),m=s(4688);const p=(0,c.P2)((()=>(0,c.Q8)(I)),5e3,!1);let g,y=!1,v=!1;function b(){y=!0,g=(0,c.Gq)(I,!0),window.addEventListener("blur",I),(0,t.ll)(p)}function w(){y=!1,(0,t.Iq)(p),window.removeEventListener("blur",I),g&&g()}function I(){if(!y||v)return;const n=(0,t.Rd)();if(n.isLoggingOut)return;const r={...a,...(0,f.ei)(n,["authState","authPhoneNumber","authRememberMe","authNearestCountry","currentUserId","contactList","topPeers","topInlineBots","recentEmojis","push","shouldShowContextMenuHint"]),isChatInfoShown:C(n),users:E(n),chats:S(n),messages:P(n),globalSearch:{recentlyFoundChatIds:n.globalSearch.recentlyFoundChatIds},settings:M(n),chatFolders:A(n)},o=JSON.stringify(r);localStorage.setItem(e.Uh,o)}function C(t){return window.innerWidth>e._m&&t.isChatInfoShown}function E(t){const{users:{byId:n,selectedId:r}}=t,o=[...(t.chats.listIds.active||[]).slice(0,e.gJ).filter((e=>e>0)),...Object.keys(n)].slice(0,e.lO);return{byId:(0,f.ei)(n,o),selectedId:window.innerWidth>e._m?r:void 0}}function S(t){const n=[...(t.chats.listIds.active||[]).slice(0,e.gJ)],{chatId:r}=(0,h.Bt)(t)||{};return{...t.chats,byId:(0,f.ei)(t.chats.byId,r?[...n,r]:n),listIds:{active:n},isFullyLoaded:{},orderedPinnedIds:{active:t.chats.orderedPinnedIds.active}}}function P(t){const r={},{chatId:o}=(0,h.Bt)(t)||{};[...(t.chats.listIds.active||[]).slice(0,e.gJ),...o?[o]:[]].forEach((e=>{const n=t.messages.byChatId[e];if(!n)return;const o=n.threadsById[i._f];o&&o.viewportIds&&(r[e]={byId:(0,f.ei)(n.byId,o.viewportIds),threadsById:{[i._f]:o}})}));const d=(0,h.Bt)(t);return{byChatId:r,messageLists:!d||n.wB?[]:[{...d,threadId:i._f,type:"thread"}]}}function M(e){const{byKey:t,themes:n}=e.settings;return{byKey:t,themes:n,privacy:{},notifyExceptions:{}}}function A(e){return{...e.chatFolders,activeChatFolder:0}}document.addEventListener(l._L,(()=>{v=!0})),document.addEventListener(l.OV,(()=>{v=!1})),e.sd||((0,t.Q6)("saveSession",(()=>{y||b()})),(0,t.Q6)("reset",(()=>{localStorage.removeItem(e.Uh),y&&w()}))),(0,t.Q6)("init",(()=>{const t=(0,f.Xh)(a);return function(t){if(!e.sd)return(0,m.ti)(!0)?(b(),function(t){e.eM&&console.time("global-state-cache-read");const n=localStorage.getItem(e.Uh),r=n?JSON.parse(n):void 0;return e.eM&&console.timeEnd("global-state-cache-read"),r&&(r.settings.byKey={...t.settings.byKey,...r.settings.byKey},r.settings.themes={...t.settings.themes,...r.settings.themes},r.chatFolders={...t.chatFolders,...r.chatFolders},r.messages.messageLists||(r.messages.messageLists=t.messages.messageLists),r.stickers.greeting||(r.stickers.greeting=t.stickers.greeting)),{...t,...r}}(t)):void w()}(t)||t}));var k=s(4050),T=s(3858);const N="tt-active-tab",R=String(Date.now()+Math.random());let L;localStorage.setItem(N,R);const D=window.setInterval((()=>{L&&localStorage.getItem(N)!==R&&(L(),clearInterval(D))}),2e3);var O=s(706),x=(s(7895),s(3781),s(1363),s(9667),s(4907),s(6590)),_=s(8332),Z=s(1212),B=s(1394);const F=["400 1em Roboto","500 1em Roboto"];function U(){if("fonts"in document)return Promise.all(F.map((e=>document.fonts.load(e))))}var $=s(647),j=s(9203),W=s(6752),H=s(4128),V=s(2162);function G(){const{listIds:e,byId:n}=(0,t.Rd)().chats;if(e.active)return Promise.all(e.active.slice(0,10).map((e=>{const t=n[e];if(!t)return;const r=(0,_.RT)(t);return r?$.he(r,i.IU.DataUri):void 0})))}const Q={main:()=>Promise.all([(0,j.$y)(j.gl.Main,"Main").then(U),G()]),authPhoneNumber:()=>Promise.all([U(),(0,B.pt)(H)]),authCode:()=>(0,B.pt)(V),authPassword:()=>(0,B.pt)(V),authQrCode:U},z=(0,t.c$)((e=>{const t=(0,h.Pu)(e),{background:n,backgroundColor:r}=e.settings.themes[t]||{};return{shouldSkipHistoryAnimations:e.shouldSkipHistoryAnimations,uiReadyState:e.uiReadyState,hasCustomBackground:Boolean(n),hasCustomBackgroundColor:Boolean(r),isRightColumnShown:(0,h.Jf)(e)}}),((e,t)=>(0,f.ei)(t,["setIsUiReady"])))((({page:e,children:t,hasCustomBackground:n,hasCustomBackgroundColor:r,isRightColumnShown:o,shouldSkipHistoryAnimations:d,setIsUiReady:u})=>{const[a,s]=(0,O.Z)(),{shouldRender:i,transitionClassNames:l}=(0,Z.Z)(!a,void 0,!0);return(0,k.d4)((()=>{let t;return Promise.race([(0,c.wO)(700),(async()=>{try{await Q[e]()}catch(e){}})()]).then((()=>{s(),u({uiReadyState:1}),t=window.setTimeout((()=>{u({uiReadyState:2})}),1e3)})),()=>{t&&(clearTimeout(t),t=void 0),u({uiReadyState:0})}}),[]),k.ZP.createElement("div",{id:"UiLoader"},t,i&&!d&&k.ZP.createElement("div",{className:(0,W.Z)("mask",l)},"main"===e?k.ZP.createElement(k.ZP.Fragment,null,k.ZP.createElement("div",{className:"left"}),k.ZP.createElement("div",{className:(0,W.Z)("middle",n&&"custom-bg-image",r&&"custom-bg-color",o&&"with-right-column")}),o&&k.ZP.createElement("div",{className:"right"})):k.ZP.createElement("div",{className:"blank"})))}));var K=s(6272),J=s(663),q=s(9107);const Y=(e,t)=>{const[n,r]=(0,k.eJ)();return e&&J.Pn(e,t).then(r),n};function X(){let e=navigator.language;return e&&"pt-br"!==e&&(e=e.substr(0,2)),e}var ee=s(231),te=s(4605),ne=s(7687),re=s(4288),oe=s(5765),de=s(2340),ue=s(4284),ae=s(9290),se=s(3106),ie=s(8964),ce=s(9204);const le=200+e.fK,fe=(0,k.X$)((0,t.c$)((e=>{const{countryList:{phoneCodes:t}}=e;return{phoneCodeList:t}}))((({id:e,value:t,isLoading:n,onChange:r,phoneCodeList:o})=>{const d=(0,q.Z)(),u=(0,k.sO)(null),[a,s]=(0,k.eJ)(),[i,c]=(0,k.eJ)([]),l=(0,k.I4)((e=>{s(e),c(function(e,t=""){return t.length?e.filter((e=>(0,oe.Z)(e.defaultName,t)||e.name&&(0,oe.Z)(e.name,t))):e}(o,e))}),[o]);(0,ae.Z)((([e])=>{0===(null==e?void 0:e.length)&&o.length>0&&l(a)}),[o,l]);const f=(0,k.I4)((e=>{const{countryCode:t}=e.currentTarget.firstElementChild.dataset,n=o.find((e=>e.countryCode===t));n&&r(n),setTimeout((()=>l(void 0)),le)}),[o,r,l]),h=(0,k.I4)((e=>{l(e.currentTarget.value)}),[l]),m=(0,k.I4)((e=>{if(8!==e.keyCode)return;const n=e.currentTarget;t&&void 0===a&&(n.value=""),l(n.value)}),[a,l,t]);return k.ZP.createElement(se.Z,{className:"CountryCodeInput",trigger:({onTrigger:r,isOpen:o})=>{const s=()=>{if(o)return;setTimeout((()=>{u.current.select()}),50),r();const e=document.getElementById("auth-phone-number-form");e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},i=null!=a?a:(null==t?void 0:t.name)||(null==t?void 0:t.defaultName)||"";return k.ZP.createElement("div",{className:(0,W.Z)("input-group",t&&"touched")},k.ZP.createElement("input",{ref:u,className:(0,W.Z)("form-control",o&&"focus"),type:"text",id:e,value:i,autoComplete:"off",onClick:s,onFocus:s,onInput:e=>{h(e),s()},onKeyDown:m}),k.ZP.createElement("label",null,d("Login.SelectCountry.Title")),n?k.ZP.createElement(ce.Z,{color:"black"}):k.ZP.createElement("i",{onClick:s,className:(0,W.Z)("css-icon-down",o&&"open")}))}},i.map((e=>k.ZP.createElement(ie.Z,{key:e.countryCode,className:t&&e.iso2===t.iso2?"selected":"",onClick:f},k.ZP.createElement("span",{"data-country-code":e.countryCode}),k.ZP.createElement("span",{className:"country-flag"},(0,de.Z)((0,ue.Wg)(e.iso2),["hq_emoji"])),k.ZP.createElement("span",{className:"country-name"},e.name||e.defaultName),k.ZP.createElement("span",{className:"country-code"},e.countryCode)))),!i.length&&k.ZP.createElement(ie.Z,{key:"no-results",className:"no-results",disabled:!0},k.ZP.createElement("span",null,d("lng_country_none"))))})));let he=!1;const me=(0,k.X$)((0,t.c$)((e=>{const{settings:{byKey:{language:t}},countryList:{phoneCodes:n}}=e;return{...(0,f.ei)(e,["connectionState","authState","authPhoneNumber","authIsLoading","authIsLoadingQrCode","authError","authRememberMe","authNearestCountry"]),language:t,phoneCodeList:n}}),((e,t)=>(0,f.ei)(t,["setAuthPhoneNumber","setAuthRememberMe","clearAuthError","loadNearestCountry","loadCountryList","goToAuthQrCode","setSettingOption"])))((({connectionState:e,authState:t,authPhoneNumber:r,authIsLoading:o,authIsLoadingQrCode:d,authError:u,authRememberMe:a,authNearestCountry:s,phoneCodeList:i,language:c,setAuthPhoneNumber:l,setAuthRememberMe:f,loadNearestCountry:h,loadCountryList:m,clearAuthError:p,goToAuthQrCode:g,setSettingOption:y})=>{const v=(0,q.Z)(),b=(0,k.sO)(null),w=X(),I=Y(w,"ContinueOnThisLanguage"),[C,E]=(0,k.eJ)(),[S,P]=(0,k.eJ)(),[M,A]=(0,k.eJ)(!1),[T,N]=(0,k.eJ)(),[R,L,D]=(0,O.Z)(),x=C?`+${C.countryCode} ${S||""}`:S,_=x&&x.replace(/[^\d]+/g,"").length>=7;(0,k.d4)((()=>{n.$b||b.current.focus()}),[C]),(0,k.d4)((()=>{"connectionStateReady"!==e||s||h()}),[e,s,h]),(0,k.d4)((()=>{"connectionStateReady"===e&&m({langCode:c})}),[e,c,m]),(0,k.d4)((()=>{s&&i&&!C&&!M&&E((0,K.U9)(i,s)[0])}),[C,s,M,i]);const Z=(0,k.I4)((e=>{e.length||P("");const t=i&&(0,K.g3)(i,e),n=!C||t&&t.iso2!==C.iso2||!t&&e.length?t:C;(!C||!n||n&&n.iso2!==C.iso2)&&E(n),P((0,K.un)(e,n))}),[i,C]),F=(0,k.I4)((()=>{L(),(0,J.m0)(w,(()=>{D(),y({language:w})}))}),[L,y,w,D]);(0,k.d4)((()=>{void 0===S&&r&&Z(r)}),[r,S,Z]),(0,k.bt)((()=>{b.current&&T&&b.current.setSelectionRange(...T)}),[T]);const $=(0,k.sO)(!1),j=(0,k.I4)((()=>{$.current=!0,requestAnimationFrame((()=>{$.current=!1}))}),[]),W=(0,k.I4)((e=>{E(e),P("")}),[]),H=(0,k.I4)((e=>{u&&p(),he||(he=!0,U(),(0,B.pt)(V));const{value:t,selectionStart:r,selectionEnd:o}=e.target;N(r&&o&&o1&&!$.current;Z(d?`${C.countryCode} ${t}`:t)}),[u,p,C,x,Z]),G=(0,k.I4)((e=>{f(e.target.checked)}),[f]),Q="authorizationStateWaitPhoneNumber"===t;return k.ZP.createElement("div",{id:"auth-phone-number-form",className:"custom-scroll"},k.ZP.createElement("div",{className:"auth-form"},k.ZP.createElement("div",{id:"logo"}),k.ZP.createElement("h2",null,"Telegram"),k.ZP.createElement("p",{className:"note"},v("StartText")),k.ZP.createElement("form",{action:"",onSubmit:function(e){e.preventDefault(),o||_&&l({phoneNumber:x})}},k.ZP.createElement(fe,{id:"sign-in-phone-code",value:C,isLoading:!s&&!C,onChange:W}),k.ZP.createElement(ne.Z,{ref:b,id:"sign-in-phone-number",label:v("Login.PhonePlaceholder"),value:x,error:u&&v(u),inputMode:"tel",onChange:H,onPaste:n.s$?j:void 0}),k.ZP.createElement(te.Z,{id:"sign-in-keep-session",label:"Keep me signed in",checked:Boolean(a),onChange:G}),_&&(Q?k.ZP.createElement(ee.Z,{type:"submit",ripple:!0,isLoading:o},v("Login.Next")):k.ZP.createElement(re.Z,null)),Q&&k.ZP.createElement(ee.Z,{isText:!0,ripple:!0,isLoading:d,onClick:g},v("Login.QR.Login")),w&&w!==c&&I&&k.ZP.createElement(ee.Z,{isText:!0,isLoading:R,onClick:F},I))))})));var pe=s(8778);const ge=(0,k.X$)((()=>{const e=(0,pe.Z)(j.gl.Auth,"AuthCode");return e?k.ZP.createElement(e,null):k.ZP.createElement(re.Z,null)})),ye=(0,k.X$)((()=>{const e=(0,pe.Z)(j.gl.Auth,"AuthPassword");return e?k.ZP.createElement(e,null):k.ZP.createElement(re.Z,null)})),ve=(0,k.X$)((()=>{const e=(0,pe.Z)(j.gl.Auth,"AuthRegister");return e?k.ZP.createElement(e,null):k.ZP.createElement(re.Z,null)}));let be=null;class we{}we.render=function(e,t){be(e,t)},self.QrCreator=we,function(e){function t(t,n,r,o){var d={},u=e(r,n);u.u(t),u.J(),o=o||0;var a=u.h(),s=u.h()+2*o;return d.text=t,d.level=n,d.version=r,d.O=s,d.a=function(e,t){return t-=o,!(0>(e-=o)||e>=a||0>t||t>=a)&&u.a(e,t)},d}function n(e,t,n,r,o,d,u,a,s,i){function c(t,n,r,o,u,a,s){t?(e.lineTo(n+a,r+s),e.arcTo(n,r,o,u,d)):e.lineTo(n,r)}u?e.moveTo(t+d,n):e.moveTo(t,n),c(a,r,n,r,o,-d,0),c(s,r,o,t,o,0,-d),c(i,t,o,t,n,d,0),c(u,t,n,r,n,0,d)}function r(e,t,n,r,o,d,u,a,s,i){function c(t,n,r,o){e.moveTo(t+r,n),e.lineTo(t,n),e.lineTo(t,n+o),e.arcTo(t,n,t+r,n,d)}u&&c(t,n,d,d),a&&c(r,n,-d,d),s&&c(r,o,-d,-d),i&&c(t,o,d,-d)}function o(e,o){e:{var d=o.text,u=o.v,a=o.N,s=o.K,i=o.P;for(a=Math.max(1,a||1),s=Math.min(40,s||40);a<=s;a+=1)try{var c=t(d,u,a,i);break e}catch(e){}c=void 0}if(!c)return null;for(d=e.getContext("2d"),o.background&&(d.fillStyle=o.background,d.fillRect(o.left,o.top,o.size,o.size)),u=c.O,s=o.size/u,d.beginPath(),i=0;iMath.round(e*t.size))),"linear-gradient"===r)var d=e.createLinearGradient.apply(e,n);else{if("radial-gradient"!==r)throw Error("Unsupported fill");d=e.createRadialGradient.apply(e,n)}o.forEach((([e,t])=>{d.addColorStop(e,t)})),e.fillStyle=d}}(d,o),d.fill(),e}var d={minVersion:1,maxVersion:40,ecLevel:"L",left:0,top:0,size:200,fill:"#000",background:null,text:"no text",radius:.5,quiet:0};be=function(e,t){var n={};Object.assign(n,d,e),n.N=n.minVersion,n.K=n.maxVersion,n.v=n.ecLevel,n.left=n.left,n.top=n.top,n.size=n.size,n.fill=n.fill,n.background=n.background,n.text=n.text,n.R=n.radius,n.P=n.quiet,t instanceof HTMLCanvasElement?(t.width===n.size&&t.height===n.size||(t.width=n.size,t.height=n.size),t.getContext("2d").clearRect(0,0,t.width,t.height),o(t,n)):((e=document.createElement("canvas")).width=n.size,e.height=n.size,n=o(e,n),t.appendChild(n))}}(function(){function e(o,u){function a(e,t){for(var n=-1;7>=n;n+=1)if(!(-1>=e+n||l<=e+n))for(var r=-1;7>=r;r+=1)-1>=t+r||l<=t+r||(c[e+n][t+r]=0<=n&&6>=n&&(0==r||6==r)||0<=r&&6>=r&&(0==n||6==n)||2<=n&&4>=n&&2<=r&&4>=r)}function s(e,n){for(var u=l=4*o+17,s=Array(u),m=0;m=y;y+=1)for(var v=-2;2>=v;v+=1)c[p+y][g+v]=-2==y||2==y||-2==v||2==v||0==y&&0==v}for(u=8;us;s+=1)m=!e&&1==(u>>s&1),c[6>s?s:8>s?s+1:l-15+s][8]=m,c[8][8>s?l-s-1:9>s?15-s:14-s]=m;if(c[l-8][8]=!e,7<=o){for(u=r.A(o),s=0;18>s;s+=1)m=!e&&1==(u>>s&1),c[Math.floor(s/3)][s%3+l-8-3]=m;for(s=0;18>s;s+=1)m=!e&&1==(u>>s&1),c[s%3+l-8-3][Math.floor(s/3)]=m}if(null==f){for(e=d.I(o,i),u=function(){var e=[],t=0,n={B:function(){return e},c:function(t){return 1==(e[Math.floor(t/8)]>>>7-t%8&1)},put:function(e,t){for(var r=0;r>>t-r-1&1))},f:function(){return t},m:function(n){var r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1}};return n}(),s=0;s8*m)throw Error("code length overflow. ("+u.f()+">"+8*m+")");for(u.f()+4<=8*m&&u.put(0,4);0!=u.f()%8;)u.m(!1);for(;!(u.f()>=8*m||(u.put(236,8),u.f()>=8*m));)u.put(17,8);var b=0;for(m=s=0,p=Array(e.length),g=Array(e.length),y=0;yy;y+=1)null==c[s][g-y]&&(v=!1,p>>m&1)),n(s,g-y)&&(v=!v),c[s][g-y]=v,-1==--m&&(p+=1,m=7));if(0>(s+=u)||l<=s){s-=u,u=-u;break}}}var i=n[u],c=null,l=0,f=null,h=[],m={u:function(t){t=function(t){var n=e.s(t);return{S:function(){return 4},b:function(){return n.length},write:function(e){for(var t=0;te||l<=e||0>t||l<=t)throw Error(e+","+t);return c[e][t]},h:function(){return l},J:function(){for(var e=0,t=0,n=0;8>n;n+=1){s(!0,n);var o=r.D(m);(0==n||e>o)&&(e=o,t=n)}s(!1,t)}};return m}function t(e,n){if(void 0===e.length)throw Error(e.length+"/"+n);var r=function(){for(var t=0;td.b()-e.b())return d;for(var n=o.g(d.c(0))-o.g(e.c(0)),r=Array(d.b()),u=0;ur?t.push(r):2048>r?t.push(192|r>>6,128|63&r):55296>r||57344<=r?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t};var n={L:1,M:0,Q:3,H:2},r=function(){function e(e){for(var t=0;0!=e;)t+=1,e>>>=1;return t}var n=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]];return{w:function(t){for(var n=t<<10;0<=e(n)-e(1335);)n^=1335<t||40t?8:16},D:function(e){for(var t=e.h(),n=0,r=0;r=a;a+=1)if(!(0>r+a||t<=r+a))for(var s=-1;1>=s;s+=1)0>o+s||t<=o+s||(0!=a||0!=s)&&u==e.a(r+a,o+s)&&(d+=1);5n;n+=1)e[n]=1<n;n+=1)e[n]=e[n-4]^e[n-5]^e[n-6]^e[n-8];for(n=0;255>n;n+=1)t[e[n]]=n;return{g:function(e){if(1>e)throw Error("glog("+e+")");return t[e]},i:function(t){for(;0>t;)t+=255;for(;256<=t;)t-=255;return e[t]}}}(),d=function(){function e(e,r){switch(r){case n.L:return t[4*(e-1)];case n.M:return t[4*(e-1)+1];case n.Q:return t[4*(e-1)+2];case n.H:return t[4*(e-1)+3]}}var t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];return{I:function(t,n){var r=e(t,n);if(void 0===r)throw Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+n);t=r.length/3,n=[];for(var o=0;o{const{connectionState:t,authState:n,authQrCode:r,settings:{byKey:{language:o}}}=e;return{connectionState:t,authState:n,authQrCode:r,language:o}}),((e,t)=>(0,f.ei)(t,["returnToAuthPhoneNumber","setSettingOption"])))((({connectionState:e,authState:t,authQrCode:n,language:r,returnToAuthPhoneNumber:o,setSettingOption:d})=>{const u=X(),a=(0,q.Z)(),s=(0,k.sO)(null),i=Y(u,"ContinueOnThisLanguage"),[c,l,f]=(0,O.Z)();(0,k.d4)((()=>{if(!n||"connectionStateReady"!==e)return;const t=s.current;t.innerHTML="",t.classList.remove("pre-animate"),Ie.render({text:`tg://login?token=${n.token}`,radius:.5,ecLevel:"M",fill:"#4E96D4",size:280},t)}),[e,n]);const h=(0,k.I4)((()=>{l(),(0,J.m0)(u,(()=>{f(),d({language:u})}))}),[l,d,u,f]),m="authorizationStateWaitQrCode"===t;return k.ZP.createElement("div",{id:"auth-qr-form",className:"custom-scroll"},k.ZP.createElement("div",{className:"auth-form qr"},n?k.ZP.createElement("div",{key:"qr-container",className:"qr-container pre-animate",ref:s}):k.ZP.createElement("div",{key:"qr-loading",className:"qr-loading"},k.ZP.createElement(re.Z,null)),k.ZP.createElement("h3",null,a("Login.QR.Title")),k.ZP.createElement("ol",null,k.ZP.createElement("li",null,k.ZP.createElement("span",null,a("Login.QR.Help1"))),k.ZP.createElement("li",null,k.ZP.createElement("span",null,(0,de.Z)(a("Login.QR.Help2"),["simple_markdown"]))),k.ZP.createElement("li",null,k.ZP.createElement("span",null,a("Login.QR.Help3")))),m&&k.ZP.createElement(ee.Z,{isText:!0,onClick:o},a("Login.QR.Cancel")),u&&u!==r&&i&&k.ZP.createElement(ee.Z,{isText:!0,isLoading:c,onClick:h},i)))}))),Ee=(0,k.X$)((0,t.c$)((e=>(0,f.ei)(e,["authState"])),((e,t)=>(0,f.ei)(t,["reset","initApi","returnToAuthPhoneNumber","goToAuthQrCode"])))((({authState:e,reset:t,initApi:r,returnToAuthPhoneNumber:o,goToAuthQrCode:d})=>{(0,k.d4)((()=>{t(),r()}),[t,r]);const u="iOS"===n.Lt||"Android"===n.Lt;switch((0,x.ZP)(!u&&"authorizationStateWaitPhoneNumber"===e||u&&"authorizationStateWaitQrCode"===e,(()=>{u?o():d()})),(0,k.d4)((()=>(T.Z.disableRefresh(),()=>{T.Z.enableRefresh()})),[]),e){case"authorizationStateWaitCode":return k.ZP.createElement(z,{page:"authCode",key:"authCode"},k.ZP.createElement(ge,null));case"authorizationStateWaitPassword":return k.ZP.createElement(z,{page:"authPassword",key:"authPassword"},k.ZP.createElement(ye,null));case"authorizationStateWaitRegistration":return k.ZP.createElement(ve,null);case"authorizationStateWaitPhoneNumber":return k.ZP.createElement(z,{page:"authPhoneNumber",key:"authPhoneNumber"},k.ZP.createElement(me,null));case"authorizationStateWaitQrCode":return k.ZP.createElement(z,{page:"authQrCode",key:"authQrCode"},k.ZP.createElement(Ce,null));default:return u?k.ZP.createElement(z,{page:"authPhoneNumber",key:"authPhoneNumber"},k.ZP.createElement(me,null)):k.ZP.createElement(z,{page:"authQrCode",key:"authQrCode"},k.ZP.createElement(Ce,null))}}))),Se=(0,k.X$)((()=>{const e=(0,pe.Z)(j.gl.Main,"Main");return e?k.ZP.createElement(e,null):void 0}));var Pe=s(5359);const Me=()=>k.ZP.createElement("div",{id:"AppInactive"},k.ZP.createElement("div",{className:"content"},k.ZP.createElement("img",{src:Pe,alt:""}),k.ZP.createElement("h3",{className:"title"},"Such error, many tabs"),k.ZP.createElement("div",{className:"description"},"Telegram supports only one active tab with the app.",k.ZP.createElement("br",null),"Please reload this page to continue using this tab or close it."),k.ZP.createElement("div",{className:"actions"},k.ZP.createElement(ee.Z,{isText:!0,ripple:!0,onClick:()=>{window.location.reload()}},"Reload app"))));function Ae(){return t.ZP.createElement(z,{page:"main",key:"main"},t.ZP.createElement(Se,null))}const ke=(0,t.c$)((e=>(0,f.ei)(e,["authState"])),((e,t)=>(0,f.ei)(t,["disconnect"])))((({authState:n,disconnect:r})=>{const[o,d]=(0,O.Z)(!1);if((0,k.d4)((()=>{(0,T.z)(),L=()=>{r(),document.title=`${e.Ti}${e.ou}`,d()}}),[r,d]),o)return t.ZP.createElement(Me,null);if(n)switch(n){case"authorizationStateWaitPhoneNumber":case"authorizationStateWaitCode":case"authorizationStateWaitPassword":case"authorizationStateWaitRegistration":case"authorizationStateWaitQrCode":return t.ZP.createElement(Ee,null);case"authorizationStateClosed":case"authorizationStateClosing":case"authorizationStateLoggingOut":case"authorizationStateReady":return Ae()}return(0,m.ti)(!0)?Ae():t.ZP.createElement(Ee,null)}));e.eM&&console.log(">>> INIT"),(0,t.uC)().init(),e.eM&&console.log(">>> START INITIAL RENDER"),u.Z.render(t.ZP.createElement(ke,null),document.getElementById("root")),e.eM&&console.log(">>> FINISH INITIAL RENDER"),document.addEventListener("dblclick",(()=>{console.log("GLOBAL STATE",(0,t.Rd)())}))})()})(); +//# sourceMappingURL=main.d9882afcc7d8fd6c3156.js.map \ No newline at end of file diff --git a/dist/main.d9882afcc7d8fd6c3156.js.map b/dist/main.d9882afcc7d8fd6c3156.js.map new file mode 100644 index 00000000..3a0e1bea --- /dev/null +++ b/dist/main.d9882afcc7d8fd6c3156.js.map @@ -0,0 +1 @@ +{"version":3,"file":"main.d9882afcc7d8fd6c3156.js","mappings":"uBACIA,EADAC,ECAAC,EACAC,ECwCAC,EASAC,E,wFChCJ,IAAIC,EACJ,MAAMC,EAAgB,IAAIC,IACpBC,EAA0B,IAAID,IAI7B,SAASE,EAAQC,EAAuBC,GAe7C,OAdKN,IACCO,EAAAA,IAEFC,QAAQC,IAAI,yBAGdT,EAAS,IAAIU,OAAO,IAAIC,IAAI,mBA6ChC,SAA2BN,GACzBL,EAAOY,iBAAiB,WAAW,EAAGC,KAAAA,MACpC,GAAkB,WAAdA,EAAKC,KACPT,EAASQ,EAAKE,aACT,GAAkB,mBAAdF,EAAKC,KAA2B,CACzC,MAAME,EAAef,EAAcgB,IAAIJ,EAAKK,WACxCF,IACEH,EAAKM,MACPH,EAAaI,OAAOP,EAAKM,OAEzBH,EAAaK,QAAQR,EAAKS,gBAGzB,GAAkB,mBAAdT,EAAKC,KAA2B,SACzC,UAAAb,EAAcgB,IAAIJ,EAAKK,kBAAvB,mBAAmCK,gBAAnC,mBAAiDV,EAAKW,mBACjD,GAAkB,mBAAdX,EAAKC,KACd,MAAMD,EAAKM,SA5DbM,CAAkBpB,GAEW,QAAzBC,EAAYoB,UA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ACL,IAAK,+BACH,OAAO,mBAAC,GAAD,MACT,IAAK,2BACL,IAAK,4BACL,IAAK,+BACL,IAAK,0BACH,OAAOmmD,KAIb,OAAO5V,EAAAA,EAAAA,KAAiB,GAAQ4V,KAAe,mBAAC,GAAD,SC1C7CpgF,EAAAA,IAEFC,QAAQC,IAAI,aAGdsH,EAAAA,EAAAA,MAAc4sB,OAEVp0B,EAAAA,IAEFC,QAAQC,IAAI,4BAGdsgF,EAAAA,EAAAA,OACE,mBAAC,GAAD,MACAt3E,SAASywE,eAAe,SAGtB35E,EAAAA,IAEFC,QAAQC,IAAI,6BAGdgJ,SAAS7I,iBAAiB,YAAY,KAEpCJ,QAAQC,IAAI,gBAAgB8xB,EAAAA,EAAAA,W","sources":["webpack://telegram-t/webpack/runtime/create fake namespace object","webpack://telegram-t/webpack/runtime/load script","webpack://telegram-t/webpack/runtime/css loading","webpack://telegram-t/./src/api/gramjs/worker/provider.ts","webpack://telegram-t/./src/api/types/media.ts","webpack://telegram-t/./src/api/types/messages.ts","webpack://telegram-t/./src/lib/punycode.js","webpack://telegram-t/./src/components/common/SafeLink.tsx","webpack://telegram-t/./src/components/common/helpers/documentInfo.ts","webpack://telegram-t/./src/components/common/helpers/parseEmojiOnlyString.ts","webpack://telegram-t/./src/components/common/UserLink.tsx","webpack://telegram-t/./src/components/common/MessageLink.tsx","webpack://telegram-t/./src/components/common/ChatLink.tsx","webpack://telegram-t/./src/components/common/helpers/renderActionMessageText.tsx","webpack://telegram-t/./src/components/common/helpers/renderText.tsx","webpack://telegram-t/./src/components/middle/helpers/preventMessageInputBlur.ts","webpack://telegram-t/./src/components/middle/message/MentionLink.tsx","webpack://telegram-t/./src/components/ui/Button.tsx","webpack://telegram-t/./src/components/ui/Checkbox.tsx","webpack://telegram-t/./src/components/ui/DropdownMenu.tsx","webpack://telegram-t/./src/components/ui/InputText.tsx","webpack://telegram-t/./src/components/ui/Link.tsx","webpack://telegram-t/./src/components/ui/Loading.tsx","webpack://telegram-t/./src/components/ui/Menu.tsx","webpack://telegram-t/./src/components/ui/MenuItem.tsx","webpack://telegram-t/./src/components/ui/RippleEffect.tsx","webpack://telegram-t/./src/components/ui/Spinner.tsx","webpack://telegram-t/./src/config.ts","webpack://telegram-t/./src/hooks/useEffectWithPrevDeps.ts","webpack://telegram-t/./src/hooks/useFlag.ts","webpack://telegram-t/./src/hooks/useForceUpdate.ts","webpack://telegram-t/./src/hooks/useHeavyAnimationCheck.ts","webpack://telegram-t/./src/hooks/useHistoryBack.ts","webpack://telegram-t/./src/hooks/useKeyboardListNavigation.ts","webpack://telegram-t/./src/hooks/useLang.ts","webpack://telegram-t/./src/hooks/useModuleLoader.ts","webpack://telegram-t/./src/hooks/useOnChange.ts","webpack://telegram-t/./src/hooks/usePrevious.ts","webpack://telegram-t/./src/hooks/useShowTransition.ts","webpack://telegram-t/./src/hooks/useVirtualBackdrop.ts","webpack://telegram-t/./src/lib/teact/dom-events.ts","webpack://telegram-t/./src/lib/teact/teact-dom.ts","webpack://telegram-t/./src/lib/teact/teact.ts","webpack://telegram-t/./src/lib/teact/teactn.tsx","webpack://telegram-t/./src/lib/twemojiRegex.js","webpack://telegram-t/./src/modules/actions/api/initial.ts","webpack://telegram-t/./src/modules/actions/api/settings.ts","webpack://telegram-t/./src/modules/actions/apiUpdaters/initial.ts","webpack://telegram-t/./src/modules/actions/ui/initial.ts","webpack://telegram-t/./src/modules/actions/ui/settings.ts","webpack://telegram-t/./src/modules/helpers/chats.ts","webpack://telegram-t/./src/modules/helpers/messages.ts","webpack://telegram-t/./src/modules/helpers/messageMedia.ts","webpack://telegram-t/./src/modules/helpers/localSearch.ts","webpack://telegram-t/./src/modules/helpers/payments.ts","webpack://telegram-t/./src/modules/helpers/users.ts","webpack://telegram-t/./src/modules/reducers/chats.ts","webpack://telegram-t/./src/modules/reducers/messages.ts","webpack://telegram-t/./src/modules/reducers/symbols.ts","webpack://telegram-t/./src/modules/reducers/users.ts","webpack://telegram-t/./src/modules/reducers/globalSearch.ts","webpack://telegram-t/./src/modules/reducers/localSearch.ts","webpack://telegram-t/./src/modules/reducers/management.ts","webpack://telegram-t/./src/modules/reducers/settings.ts","webpack://telegram-t/./src/modules/reducers/twoFaSettings.ts","webpack://telegram-t/./src/modules/reducers/payments.ts","webpack://telegram-t/./src/modules/selectors/users.ts","webpack://telegram-t/./src/modules/selectors/settings.ts","webpack://telegram-t/./src/modules/selectors/chats.ts","webpack://telegram-t/./src/modules/selectors/symbols.ts","webpack://telegram-t/./src/modules/selectors/messages.ts","webpack://telegram-t/./src/modules/selectors/localSearch.ts","webpack://telegram-t/./src/modules/selectors/management.ts","webpack://telegram-t/./src/modules/selectors/ui.ts","webpack://telegram-t/./src/modules/selectors/globalSearch.ts","webpack://telegram-t/./src/modules/selectors/payments.ts","webpack://telegram-t/./src/types/index.ts","webpack://telegram-t/./src/util/animation.ts","webpack://telegram-t/./src/util/appBadge.ts","webpack://telegram-t/./src/util/arePropsShallowEqual.ts","webpack://telegram-t/./src/util/buildClassName.ts","webpack://telegram-t/./src/util/cacheApi.ts","webpack://telegram-t/./src/util/captureEscKeyListener.ts","webpack://telegram-t/./src/util/captureKeyboardListeners.ts","webpack://telegram-t/./src/util/dateFormat.ts","webpack://telegram-t/./src/util/emoji.ts","webpack://telegram-t/./src/util/environmentWebp.ts","webpack://telegram-t/./src/util/environmentSystemTheme.ts","webpack://telegram-t/./src/util/environment.ts","webpack://telegram-t/./src/util/files.ts","webpack://telegram-t/./src/util/formatCurrency.ts","webpack://telegram-t/./src/util/generateIdFor.ts","webpack://telegram-t/./src/util/getReadableErrorText.ts","webpack://telegram-t/./src/util/handleError.ts","webpack://telegram-t/./src/util/iteratees.ts","webpack://telegram-t/./src/util/langProvider.ts","webpack://telegram-t/./src/util/callbacks.ts","webpack://telegram-t/./src/util/oggToWav.ts","webpack://telegram-t/./src/util/mediaLoader.ts","webpack://telegram-t/./src/util/memo.ts","webpack://telegram-t/./src/util/moduleLoader.ts","webpack://telegram-t/./src/util/notifications.ts","webpack://telegram-t/./src/util/phoneNumber.ts","webpack://telegram-t/./src/util/schedulers.ts","webpack://telegram-t/./src/util/searchWords.ts","webpack://telegram-t/./src/util/serverTime.ts","webpack://telegram-t/./node_modules/idb-keyval/dist/esm/index.js","webpack://telegram-t/./node_modules/safari-14-idb-fix/dist/esm/index.js","webpack://telegram-t/./src/util/sessions.ts","webpack://telegram-t/./src/util/switchTheme.ts","webpack://telegram-t/./src/util/textFormat.ts","webpack://telegram-t/./src/util/trimText.ts","webpack://telegram-t/./src/util/webpToPng.ts","webpack://telegram-t/./src/util/websync.ts","webpack://telegram-t/./src/util/windowSize.ts","webpack://telegram-t/webpack/bootstrap","webpack://telegram-t/webpack/runtime/compat get default export","webpack://telegram-t/webpack/runtime/define property getters","webpack://telegram-t/webpack/runtime/ensure chunk","webpack://telegram-t/webpack/runtime/get javascript chunk filename","webpack://telegram-t/webpack/runtime/get mini-css chunk filename","webpack://telegram-t/webpack/runtime/global","webpack://telegram-t/webpack/runtime/hasOwnProperty shorthand","webpack://telegram-t/webpack/runtime/make namespace object","webpack://telegram-t/webpack/runtime/publicPath","webpack://telegram-t/webpack/runtime/jsonp chunk loading","webpack://telegram-t/./src/util/setupServiceWorker.ts","webpack://telegram-t/./src/global/initial.ts","webpack://telegram-t/./src/global/cache.ts","webpack://telegram-t/./src/global/index.ts","webpack://telegram-t/./src/util/activeTabMonitor.ts","webpack://telegram-t/./src/util/fonts.ts","webpack://telegram-t/./src/components/common/UiLoader.tsx","webpack://telegram-t/./src/hooks/useLangString.ts","webpack://telegram-t/./src/components/auth/helpers/getSuggestedLanguage.ts","webpack://telegram-t/./src/components/auth/CountryCodeInput.tsx","webpack://telegram-t/./src/components/auth/AuthPhoneNumber.tsx","webpack://telegram-t/./src/components/auth/AuthCode.async.tsx","webpack://telegram-t/./src/components/auth/AuthPassword.async.tsx","webpack://telegram-t/./src/components/auth/AuthRegister.async.tsx","webpack://telegram-t/./node_modules/qr-creator/dist/qr-creator.es6.min.js","webpack://telegram-t/./src/components/auth/AuthQrCode.tsx","webpack://telegram-t/./src/components/auth/Auth.tsx","webpack://telegram-t/./src/components/main/Main.async.tsx","webpack://telegram-t/./src/components/main/AppInactive.tsx","webpack://telegram-t/./src/App.tsx","webpack://telegram-t/./src/index.tsx"],"sourcesContent":["var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"telegram-t:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\t;\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","var createStylesheet = (chunkId, fullhref, resolve, reject) => {\n\tvar linkTag = document.createElement(\"link\");\n\n\tlinkTag.rel = \"stylesheet\";\n\tlinkTag.type = \"text/css\";\n\tvar onLinkComplete = (event) => {\n\t\t// avoid mem leaks.\n\t\tlinkTag.onerror = linkTag.onload = null;\n\t\tif (event.type === 'load') {\n\t\t\tresolve();\n\t\t} else {\n\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\tvar realHref = event && event.target && event.target.href || fullhref;\n\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + realHref + \")\");\n\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n\t\t\terr.type = errorType;\n\t\t\terr.request = realHref;\n\t\t\tlinkTag.parentNode.removeChild(linkTag)\n\t\t\treject(err);\n\t\t}\n\t}\n\tlinkTag.onerror = linkTag.onload = onLinkComplete;\n\tlinkTag.href = fullhref;\n\n\tdocument.head.appendChild(linkTag);\n\treturn linkTag;\n};\nvar findStylesheet = (href, fullhref) => {\n\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n\tfor(var i = 0; i < existingLinkTags.length; i++) {\n\t\tvar tag = existingLinkTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return tag;\n\t}\n\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n\tfor(var i = 0; i < existingStyleTags.length; i++) {\n\t\tvar tag = existingStyleTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\");\n\t\tif(dataHref === href || dataHref === fullhref) return tag;\n\t}\n};\nvar loadStylesheet = (chunkId) => {\n\treturn new Promise((resolve, reject) => {\n\t\tvar href = __webpack_require__.miniCssF(chunkId);\n\t\tvar fullhref = __webpack_require__.p + href;\n\t\tif(findStylesheet(href, fullhref)) return resolve();\n\t\tcreateStylesheet(chunkId, fullhref, resolve, reject);\n\t});\n}\n// object to store loaded CSS chunks\nvar installedCssChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.miniCss = (chunkId, promises) => {\n\tvar cssChunks = {\"133\":1,\"433\":1,\"472\":1,\"484\":1,\"860\":1};\n\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n\t\tpromises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(() => {\n\t\t\tinstalledCssChunks[chunkId] = 0;\n\t\t}, (e) => {\n\t\t\tdelete installedCssChunks[chunkId];\n\t\t\tthrow e;\n\t\t}));\n\t}\n};\n\n// no hmr","import { ApiInitialArgs, ApiOnProgress, OnApiUpdate } from '../../types';\nimport { Methods, MethodArgs, MethodResponse } from '../methods/types';\nimport { WorkerMessageEvent, ThenArg, OriginRequest } from './types';\n\nimport { DEBUG } from '../../../config';\nimport generateIdFor from '../../../util/generateIdFor';\nimport { pause } from '../../../util/schedulers';\n\ntype RequestStates = {\n messageId: string;\n resolve: Function;\n reject: Function;\n callback?: AnyToVoidFunction;\n};\n\nconst HEALTH_CHECK_TIMEOUT = 150;\nconst HEALTH_CHECK_MIN_DELAY = 5 * 1000; // 5 sec\n\nlet worker: Worker;\nconst requestStates = new Map();\nconst requestStatesByCallback = new Map();\n\n// TODO Re-use `util/WorkerConnector.ts`\n\nexport function initApi(onUpdate: OnApiUpdate, initialArgs: ApiInitialArgs) {\n if (!worker) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START LOAD WORKER');\n }\n\n worker = new Worker(new URL('./worker.ts', import.meta.url));\n subscribeToWorker(onUpdate);\n\n if (initialArgs.platform === 'iOS') {\n setupIosHealthCheck();\n }\n }\n\n return makeRequest({\n type: 'initApi',\n args: [initialArgs],\n });\n}\n\nexport function callApi(fnName: T, ...args: MethodArgs) {\n if (!worker) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('API is not initialized');\n }\n\n return undefined;\n }\n\n return makeRequest({\n type: 'callMethod',\n name: fnName,\n args,\n }) as MethodResponse;\n}\n\nexport function cancelApiProgress(progressCallback: ApiOnProgress) {\n progressCallback.isCanceled = true;\n\n const { messageId } = requestStatesByCallback.get(progressCallback) || {};\n if (!messageId) {\n return;\n }\n\n worker.postMessage({\n type: 'cancelProgress',\n messageId,\n });\n}\n\nfunction subscribeToWorker(onUpdate: OnApiUpdate) {\n worker.addEventListener('message', ({ data }: WorkerMessageEvent) => {\n if (data.type === 'update') {\n onUpdate(data.update);\n } else if (data.type === 'methodResponse') {\n const requestState = requestStates.get(data.messageId);\n if (requestState) {\n if (data.error) {\n requestState.reject(data.error);\n } else {\n requestState.resolve(data.response);\n }\n }\n } else if (data.type === 'methodCallback') {\n requestStates.get(data.messageId)?.callback?.(...data.callbackArgs);\n } else if (data.type === 'unhandledError') {\n throw data.error;\n }\n });\n}\n\nfunction makeRequest(message: OriginRequest) {\n const messageId = generateIdFor(requestStates);\n const payload: OriginRequest = {\n messageId,\n ...message,\n };\n\n const requestState = { messageId } as RequestStates;\n\n // Re-wrap type because of `postMessage`\n const promise: Promise>> = new Promise((resolve, reject) => {\n Object.assign(requestState, { resolve, reject });\n });\n\n if (('args' in payload) && typeof payload.args[1] === 'function') {\n const callback = payload.args.pop() as AnyToVoidFunction;\n requestState.callback = callback;\n requestStatesByCallback.set(callback, requestState);\n }\n\n requestStates.set(messageId, requestState);\n promise\n .catch(() => undefined)\n .finally(() => {\n requestStates.delete(messageId);\n\n if (requestState.callback) {\n requestStatesByCallback.delete(requestState.callback);\n }\n });\n\n worker.postMessage(payload);\n\n return promise;\n}\n\nconst startedAt = Date.now();\n\n// Workaround for iOS sometimes stops interacting with worker\nfunction setupIosHealthCheck() {\n window.addEventListener('focus', async () => {\n try {\n await Promise.race([\n makeRequest({ type: 'ping' }),\n pause(HEALTH_CHECK_TIMEOUT).then(() => Promise.reject(new Error('HEALTH_CHECK_TIMEOUT'))),\n ]);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n\n if (Date.now() - startedAt >= HEALTH_CHECK_MIN_DELAY) {\n window.location.reload();\n }\n }\n });\n}\n","// We cache avatars as Data URI for faster initial load\n// and messages media as Blob for smaller size.\n\nexport enum ApiMediaFormat {\n DataUri,\n BlobUrl,\n Lottie,\n Progressive,\n Stream,\n}\n\nexport type ApiParsedMedia = string | Blob | AnyLiteral | ArrayBuffer;\nexport type ApiPreparedMedia = string | AnyLiteral;\nexport type ApiMediaFormatToPrepared = T extends ApiMediaFormat.Lottie ? AnyLiteral : string;\n","export interface ApiDimensions {\n width: number;\n height: number;\n}\n\nexport interface ApiPhotoSize extends ApiDimensions {\n type: 's' | 'm' | 'x' | 'y' | 'z';\n}\n\nexport interface ApiThumbnail extends ApiDimensions {\n dataUri: string;\n}\n\nexport interface ApiPhoto {\n id: string;\n thumbnail?: ApiThumbnail;\n sizes: ApiPhotoSize[];\n blobUrl?: string;\n}\n\nexport interface ApiSticker {\n id: string;\n stickerSetId: string;\n stickerSetAccessHash?: string;\n emoji?: string;\n isAnimated: boolean;\n width?: number;\n height?: number;\n thumbnail?: ApiThumbnail;\n isPreloadedGlobally?: boolean;\n}\n\nexport interface ApiStickerSet {\n archived?: true;\n isAnimated?: true;\n installedDate?: number;\n id: string;\n accessHash: string;\n title: string;\n hasThumbnail?: boolean;\n count: number;\n hash: number;\n stickers?: ApiSticker[];\n packs?: Record;\n covers?: ApiSticker[];\n shortName: string;\n}\n\nexport interface ApiVideo {\n id: string;\n mimeType: string;\n duration: number;\n fileName: string;\n width?: number;\n height?: number;\n supportsStreaming?: boolean;\n isRound?: boolean;\n isGif?: boolean;\n thumbnail?: ApiThumbnail;\n blobUrl?: string;\n size: number;\n}\n\nexport interface ApiAudio {\n size: number;\n mimeType: string;\n fileName: string;\n duration: number;\n performer?: string;\n title?: string;\n}\n\nexport interface ApiVoice {\n duration: number;\n waveform?: number[];\n}\n\nexport interface ApiDocument {\n id?: string;\n fileName: string;\n size: number;\n timestamp?: number;\n mimeType: string;\n thumbnail?: ApiThumbnail;\n previewBlobUrl?: string;\n mediaType?: 'photo' | 'video';\n mediaSize?: ApiDimensions;\n}\n\nexport interface ApiContact {\n firstName: string;\n lastName: string;\n phoneNumber: string;\n userId: number;\n}\n\nexport interface ApiPollAnswer {\n text: string;\n option: string;\n}\n\nexport interface ApiPollResult {\n isChosen?: true;\n isCorrect?: true;\n option: string;\n votersCount: number;\n}\n\nexport interface ApiPoll {\n id: string;\n summary: {\n closed?: true;\n isPublic?: true;\n multipleChoice?: true;\n quiz?: true;\n question: string;\n answers: ApiPollAnswer[];\n closePeriod?: number;\n closeDate?: number;\n };\n results: {\n results?: ApiPollResult[];\n totalVoters?: number;\n recentVoterIds?: number[];\n solution?: string;\n solutionEntities?: ApiMessageEntity[];\n };\n}\n\nexport interface ApiInvoice {\n text: string;\n title: string;\n photoUrl?: string;\n amount: number;\n currency: string;\n receiptMsgId?: number;\n isTest?: boolean;\n}\n\nexport type ApiNewPoll = {\n summary: ApiPoll['summary'];\n quiz?: {\n correctAnswers: string[];\n solution?: string;\n solutionEntities?: ApiMessageEntity[];\n };\n};\n\nexport interface ApiAction {\n text: string;\n targetUserIds?: number[];\n targetChatId?: number;\n type: 'historyClear' | 'contactSignUp' | 'chatCreate' | 'other';\n photo?: ApiPhoto;\n amount?: number;\n currency?: string;\n translationValues: string[];\n}\n\nexport interface ApiWebPage {\n id: number;\n url: string;\n displayUrl: string;\n type?: string;\n siteName?: string;\n title?: string;\n description?: string;\n photo?: ApiPhoto;\n duration?: number;\n document?: ApiDocument;\n video?: ApiVideo;\n}\n\nexport interface ApiMessageForwardInfo {\n isChannelPost: boolean;\n channelPostId?: number;\n isLinkedChannelPost?: boolean;\n fromChatId?: number;\n senderUserId?: number;\n fromMessageId?: number;\n hiddenUserName?: string;\n adminTitle?: string;\n}\n\nexport interface ApiMessageEntity {\n type: string;\n offset: number;\n length: number;\n userId?: number;\n url?: string;\n}\n\nexport enum ApiMessageEntityTypes {\n Bold = 'MessageEntityBold',\n Blockquote = 'MessageEntityBlockquote',\n BotCommand = 'MessageEntityBotCommand',\n Cashtag = 'MessageEntityCashtag',\n Code = 'MessageEntityCode',\n Email = 'MessageEntityEmail',\n Hashtag = 'MessageEntityHashtag',\n Italic = 'MessageEntityItalic',\n MentionName = 'MessageEntityMentionName',\n Mention = 'MessageEntityMention',\n Phone = 'MessageEntityPhone',\n Pre = 'MessageEntityPre',\n Strike = 'MessageEntityStrike',\n TextUrl = 'MessageEntityTextUrl',\n Url = 'MessageEntityUrl',\n Underline = 'MessageEntityUnderline',\n Unknown = 'MessageEntityUnknown',\n}\n\nexport interface ApiFormattedText {\n text: string;\n entities?: ApiMessageEntity[];\n}\n\nexport interface ApiMessage {\n id: number;\n chatId: number;\n content: {\n text?: ApiFormattedText;\n photo?: ApiPhoto;\n video?: ApiVideo;\n document?: ApiDocument;\n sticker?: ApiSticker;\n contact?: ApiContact;\n poll?: ApiPoll;\n action?: ApiAction;\n webPage?: ApiWebPage;\n audio?: ApiAudio;\n voice?: ApiVoice;\n invoice?: ApiInvoice;\n };\n date: number;\n isOutgoing: boolean;\n senderId?: number;\n replyToMessageId?: number;\n replyToTopMessageId?: number;\n sendingState?: 'messageSendingStatePending' | 'messageSendingStateFailed';\n forwardInfo?: ApiMessageForwardInfo;\n isDeleting?: boolean;\n previousLocalId?: number;\n views?: number;\n isEdited?: boolean;\n isMediaUnread?: boolean;\n groupedId?: string;\n isInAlbum?: boolean;\n hasUnreadMention?: boolean;\n inlineButtons?: ApiKeyboardButtons;\n keyboardButtons?: ApiKeyboardButtons;\n keyboardPlaceholder?: string;\n isKeyboardSingleUse?: boolean;\n viaBotId?: number;\n threadInfo?: ApiThreadInfo;\n adminTitle?: string;\n isScheduled?: boolean;\n shouldHideKeyboardButtons?: boolean;\n isFromScheduled?: boolean;\n}\n\nexport interface ApiThreadInfo {\n threadId: number;\n chatId: number;\n topMessageId?: number;\n originChannelId?: number;\n messagesCount: number;\n lastMessageId?: number;\n lastReadInboxMessageId?: number;\n recentReplierIds?: number[];\n}\n\nexport type ApiMessageOutgoingStatus = 'read' | 'succeeded' | 'pending' | 'failed';\n\nexport interface ApiKeyboardButton {\n type: 'command' | 'url' | 'callback' | 'requestPoll' | 'buy' | 'NOT_SUPPORTED';\n text: string;\n messageId: number;\n value?: string;\n}\n\nexport type ApiKeyboardButtons = ApiKeyboardButton[][];\nexport type ApiReplyKeyboard = {\n keyboardPlaceholder?: string;\n isKeyboardSingleUse?: boolean;\n} & {\n [K in 'inlineButtons' | 'keyboardButtons']?: ApiKeyboardButtons;\n};\n\nexport type ApiMessageSearchType = 'text' | 'media' | 'documents' | 'links' | 'audio' | 'profilePhoto';\nexport type ApiGlobalMessageSearchType = 'text' | 'media' | 'documents' | 'links' | 'audio' | 'voice';\n\nexport type ApiReportReason = 'spam' | 'violence' | 'pornography' | 'childAbuse'\n| 'copyright' | 'geoIrrelevant' | 'fake' | 'other';\n\nexport const MAIN_THREAD_ID = -1;\n\n// `Symbol` can not be transferred from worker\nexport const MESSAGE_DELETED = 'MESSAGE_DELETED';\n","/* eslint-disable no-nested-ternary */\n/* eslint-disable no-bitwise */\n\nconst utf16 = {\n // The utf16-class is necessary to convert from javascripts internal character representation to unicode and back.\n decode: (input) => {\n const output = [];\n let i = 0;\n const len = input.length;\n let value;\n let extra;\n\n while (i < len) {\n value = input.charCodeAt(i++);\n if ((value & 0xf800) === 0xd800) {\n extra = input.charCodeAt(i++);\n if ((value & 0xfc00) !== 0xd800 || (extra & 0xfc00) !== 0xdc00) {\n throw new RangeError('UTF-16(decode): Illegal UTF-16 sequence');\n }\n value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;\n }\n output.push(value);\n }\n return output;\n },\n encode: (input) => {\n const output = [];\n let i = 0;\n const len = input.length;\n let value;\n\n while (i < len) {\n value = input[i++];\n if ((value & 0xf800) === 0xd800) {\n throw new RangeError('UTF-16(encode): Illegal UTF-16 value');\n }\n if (value > 0xffff) {\n value -= 0x10000;\n output.push(String.fromCharCode(((value >>> 10) & 0x3ff) | 0xd800));\n value = 0xdc00 | (value & 0x3ff);\n }\n output.push(String.fromCharCode(value));\n }\n return output.join('');\n },\n};\n\n// Default parameters\nconst initial_n = 0x80;\nconst initial_bias = 72;\nconst delimiter = '\\x2D';\nconst base = 36;\nconst damp = 700;\nconst tmin = 1;\nconst tmax = 26;\nconst skew = 38;\nconst maxint = 0x7fffffff;\n\n// decode_digit(cp) returns the numeric value of a basic code\n// point (for use in representing integers) in the range 0 to\n// base-1, or base if cp is does not represent a value.\n\nfunction decode_digit(cp) {\n return cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 : cp - 97 < 26 ? cp - 97 : base;\n}\n\n// ** Bias adaptation function **\nfunction adapt(delta, numpoints, firsttime) {\n let k;\n delta = firsttime ? Math.floor(delta / damp) : delta >> 1;\n delta += Math.floor(delta / numpoints);\n\n for (k = 0; delta > ((base - tmin) * tmax) >> 1; k += base) {\n delta = Math.floor(delta / (base - tmin));\n }\n return Math.floor(k + ((base - tmin + 1) * delta) / (delta + skew));\n}\n\n// Main decode\nfunction decode(input, preserveCase) {\n // Dont use utf16\n const output = [];\n const case_flags = [];\n const input_length = input.length;\n\n let n; let out; let i; let bias; let basic; let j; let ic; let oldi; let w; let k; let digit; let t; let len;\n\n // Initialize the state:\n\n n = initial_n;\n i = 0;\n bias = initial_bias;\n\n // Handle the basic code points: Let basic be the number of input code\n // points before the last delimiter, or 0 if there is none, then\n // copy the first basic code points to the output.\n\n basic = input.lastIndexOf(delimiter);\n if (basic < 0) basic = 0;\n\n for (j = 0; j < basic; ++j) {\n if (preserveCase) case_flags[output.length] = input.charCodeAt(j) - 65 < 26;\n if (input.charCodeAt(j) >= 0x80) {\n throw new RangeError('Illegal input >= 0x80');\n }\n output.push(input.charCodeAt(j));\n }\n\n // Main decoding loop: Start just after the last delimiter if any\n // basic code points were copied; start at the beginning otherwise.\n\n for (ic = basic > 0 ? basic + 1 : 0; ic < input_length;) {\n // ic is the index of the next character to be consumed,\n\n // Decode a generalized variable-length integer into delta,\n // which gets added to i. The overflow checking is easier\n // if we increase i as we go, then subtract off its starting\n // value at the end to obtain delta.\n for (oldi = i, w = 1, k = base; ; k += base) {\n if (ic >= input_length) {\n throw RangeError('punycode_bad_input(1)');\n }\n digit = decode_digit(input.charCodeAt(ic++));\n\n if (digit >= base) {\n throw RangeError('punycode_bad_input(2)');\n }\n if (digit > Math.floor((maxint - i) / w)) {\n throw RangeError('punycode_overflow(1)');\n }\n i += digit * w;\n t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;\n if (digit < t) {\n break;\n }\n if (w > Math.floor(maxint / (base - t))) {\n throw RangeError('punycode_overflow(2)');\n }\n w *= base - t;\n }\n\n out = output.length + 1;\n bias = adapt(i - oldi, out, oldi === 0);\n\n // i was supposed to wrap around from out to 0,\n // incrementing n each time, so we'll fix that now:\n if (Math.floor(i / out) > maxint - n) {\n throw RangeError('punycode_overflow(3)');\n }\n n += Math.floor(i / out);\n i %= out;\n\n // Insert n at position i of the output:\n // Case of last character determines uppercase flag:\n if (preserveCase) {\n case_flags.splice(i, 0, input.charCodeAt(ic - 1) - 65 < 26);\n }\n\n output.splice(i, 0, n);\n i++;\n }\n if (preserveCase) {\n for (i = 0, len = output.length; i < len; i++) {\n if (case_flags[i]) {\n output[i] = String.fromCharCode(output[i])\n .toUpperCase()\n .charCodeAt(0);\n }\n }\n }\n return utf16.encode(output);\n}\n\nfunction toUnicode(domain) {\n const domain_array = domain.split('.');\n const out = [];\n for (let i = 0; i < domain_array.length; ++i) {\n const s = domain_array[i];\n out.push(s.match(/^xn--/) ? decode(s.slice(4)) : s);\n }\n return out.join('.');\n}\n\nexport default toUnicode;\n","import React, { FC, memo, useCallback } from '../../lib/teact/teact';\nimport { getDispatch } from '../../lib/teact/teactn';\nimport convertPunycode from '../../lib/punycode';\n\nimport { DEBUG, RE_TME_INVITE_LINK, RE_TME_LINK } from '../../config';\nimport buildClassName from '../../util/buildClassName';\n\ntype OwnProps = {\n url?: string;\n text: string;\n className?: string;\n children?: any;\n isRtl?: boolean;\n};\n\nconst SafeLink: FC = ({\n url,\n text,\n className,\n children,\n isRtl,\n}) => {\n const { toggleSafeLinkModal, openTelegramLink } = getDispatch();\n\n const content = children || text;\n const isNotSafe = url !== content;\n\n const handleClick = useCallback((e: React.MouseEvent) => {\n if (\n e.ctrlKey || e.altKey || e.shiftKey || e.metaKey\n || !url || (!url.match(RE_TME_LINK) && !url.match(RE_TME_INVITE_LINK))\n ) {\n if (isNotSafe) {\n toggleSafeLinkModal({ url });\n\n e.preventDefault();\n return false;\n }\n\n return true;\n }\n\n e.preventDefault();\n openTelegramLink({ url });\n\n return false;\n }, [isNotSafe, openTelegramLink, toggleSafeLinkModal, url]);\n\n if (!url) {\n return undefined;\n }\n\n const classNames = buildClassName(\n className || 'text-entity-link',\n text.length > 50 && 'long-word-break-all',\n );\n\n return (\n \n {content}\n \n );\n};\n\nfunction ensureProtocol(url?: string) {\n if (!url) {\n return undefined;\n }\n\n return url.includes('://') ? url : `https://${url}`;\n}\n\nfunction getDomain(url?: string) {\n if (!url) {\n return undefined;\n }\n\n const href = ensureProtocol(url);\n if (!href) {\n return undefined;\n }\n\n try {\n let decodedHref = decodeURI(href);\n\n const match = decodedHref.match(/^https?:\\/\\/([^/:?#]+)(?:[/:?#]|$)/i);\n if (!match) {\n return undefined;\n }\n const domain = match[1];\n decodedHref = decodedHref.replace(domain, convertPunycode(domain));\n\n return decodedHref;\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('SafeLink.getDecodedUrl error ', url, error);\n }\n }\n\n return undefined;\n}\n\nexport default memo(SafeLink);\n","import { ApiDocument } from '../../../api/types';\n\nconst ONE_GIGABYTE = 1024 * 1024 * 1024;\nconst ONE_MEGABYTE = 1024 * 1024;\n\nexport function getFileSizeString(bytes: number) {\n if (bytes > (ONE_GIGABYTE / 2)) {\n return `${(bytes / ONE_GIGABYTE).toFixed(1)} GB`;\n }\n if (bytes > (ONE_MEGABYTE / 2)) {\n return `${(bytes / ONE_MEGABYTE).toFixed(1)} MB`;\n }\n return `${(bytes / (1024)).toFixed(1)} KB`;\n}\n\nexport function getDocumentExtension(document: ApiDocument) {\n const { fileName, mimeType } = document;\n\n return getFileExtension(fileName, mimeType);\n}\n\nexport function getFileExtension(fileName: string, mimeType: string) {\n if (fileName && fileName.indexOf('.') !== -1) {\n return fileName.split('.').pop();\n } else {\n return mimeType.split('/').pop();\n }\n}\n\nexport function getColorFromExtension(extension: string) {\n switch (extension) {\n case 'apk':\n case 'xls':\n case 'xlsx':\n return 'green';\n case 'zip':\n case 'rar':\n case '7z':\n case 'tar':\n case 'gz':\n case 'ppt':\n case 'pptx':\n return 'orange';\n case 'pdf':\n case 'xps':\n return 'red';\n default:\n return 'default';\n }\n}\n\nexport function getDocumentHasPreview(document: ApiDocument) {\n return Boolean(document.previewBlobUrl || document.thumbnail);\n}\n","// @ts-ignore\nimport twemojiRegex from '../../../lib/twemojiRegex';\n\nconst DETECT_UP_TO = 3;\nconst MAX_LENGTH = DETECT_UP_TO * 8; // Maximum 8 per one emoji.\nconst RE_EMOJI_ONLY = new RegExp(`^(?:${twemojiRegex.source})+$`, '');\n\nexport default (text: string): number | false => {\n if (text.length > MAX_LENGTH) {\n return false;\n }\n\n const isEmojiOnly = Boolean(text.match(RE_EMOJI_ONLY));\n if (!isEmojiOnly) {\n return false;\n }\n\n let emojiCount = 0;\n while (twemojiRegex.exec(text)) {\n emojiCount++;\n\n if (emojiCount > DETECT_UP_TO) {\n twemojiRegex.lastIndex = 0;\n return false;\n }\n }\n\n return emojiCount;\n};\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat, ApiUser } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\n\ntype OwnProps = {\n className?: string;\n sender?: ApiUser | ApiChat;\n children: any;\n};\n\ntype DispatchProps = Pick;\n\nconst UserLink: FC = ({\n className, sender, openUserInfo, children,\n}) => {\n const handleClick = useCallback(() => {\n if (sender) {\n openUserInfo({ id: sender.id });\n }\n }, [sender, openUserInfo]);\n\n if (!sender) {\n return children;\n }\n\n return (\n {children}\n );\n};\n\nexport default withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['openUserInfo']),\n)(UserLink);\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiMessage } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\n\ntype OwnProps = {\n className?: string;\n message?: ApiMessage;\n children: any;\n};\n\ntype DispatchProps = Pick;\n\nconst MessageLink: FC = ({\n className, message, children, focusMessage,\n}) => {\n const handleMessageClick = useCallback((): void => {\n if (message) {\n focusMessage({ chatId: message.chatId, messageId: message.id });\n }\n }, [focusMessage, message]);\n\n if (!message) {\n return children;\n }\n\n return (\n {children}\n );\n};\n\nexport default withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['focusMessage']),\n)(MessageLink);\n","import React, { FC, useCallback } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\n\nimport Link from '../ui/Link';\n\ntype OwnProps = {\n className?: string;\n chatId?: number;\n children: any;\n};\n\ntype DispatchProps = Pick;\n\nconst ChatLink: FC = ({\n className, chatId, openChat, children,\n}) => {\n const handleClick = useCallback(() => {\n if (chatId) {\n openChat({ id: chatId });\n }\n }, [chatId, openChat]);\n\n if (!chatId) {\n return children;\n }\n\n return (\n {children}\n );\n};\n\nexport default withGlobal(\n undefined,\n (setGlobal, actions): DispatchProps => pick(actions, ['openChat']),\n)(ChatLink);\n","import React from '../../../lib/teact/teact';\n\nimport { ApiChat, ApiMessage, ApiUser } from '../../../api/types';\nimport { LangFn } from '../../../hooks/useLang';\nimport {\n getChatTitle,\n getMessageContent,\n getMessageSummaryText,\n getUserFullName,\n isChat,\n} from '../../../modules/helpers';\nimport trimText from '../../../util/trimText';\nimport { formatCurrency } from '../../../util/formatCurrency';\nimport { TextPart } from './renderMessageText';\nimport renderText from './renderText';\n\nimport UserLink from '../UserLink';\nimport MessageLink from '../MessageLink';\nimport ChatLink from '../ChatLink';\n\ninterface ActionMessageTextOptions {\n maxTextLength?: number;\n asPlain?: boolean;\n isEmbedded?: boolean;\n}\n\nconst NBSP = '\\u00A0';\n\nexport function renderActionMessageText(\n lang: LangFn,\n message: ApiMessage,\n actionOrigin?: ApiUser | ApiChat,\n targetUsers?: ApiUser[],\n targetMessage?: ApiMessage,\n targetChatId?: number,\n options: ActionMessageTextOptions = {},\n) {\n if (!message.content.action) {\n return [];\n }\n const {\n text, translationValues, amount, currency,\n } = message.content.action;\n const content: TextPart[] = [];\n const textOptions: ActionMessageTextOptions = { ...options, maxTextLength: 32 };\n const translationKey = text === 'Chat.Service.Group.UpdatedPinnedMessage1' && !targetMessage\n ? 'Message.PinnedGenericMessage'\n : text;\n\n let unprocessed = lang(translationKey, translationValues && translationValues.length ? translationValues : undefined);\n let processed: TextPart[];\n\n if (unprocessed.includes('%payment_amount%')) {\n processed = processPlaceholder(\n unprocessed,\n '%payment_amount%',\n formatCurrency(amount!, currency, lang.code),\n );\n unprocessed = processed.pop() as string;\n content.push(...processed);\n }\n\n processed = processPlaceholder(\n unprocessed,\n '%action_origin%',\n actionOrigin\n ? (!options.isEmbedded && renderOriginContent(lang, actionOrigin, options.asPlain)) || NBSP\n : 'User',\n );\n\n unprocessed = processed.pop() as string;\n content.push(...processed);\n\n processed = processPlaceholder(\n unprocessed,\n '%target_user%',\n targetUsers\n ? targetUsers.map((user) => renderUserContent(user, options.asPlain)).filter(Boolean as any)\n : 'User',\n );\n\n unprocessed = processed.pop() as string;\n content.push(...processed);\n\n processed = processPlaceholder(\n unprocessed,\n '%message%',\n targetMessage\n ? renderMessageContent(lang, targetMessage, textOptions)\n : 'a message',\n );\n unprocessed = processed.pop() as string;\n content.push(...processed);\n\n processed = processPlaceholder(\n unprocessed,\n '%product%',\n targetMessage\n ? renderProductContent(targetMessage)\n : 'a product',\n );\n unprocessed = processed.pop() as string;\n content.push(...processed);\n\n processed = processPlaceholder(\n unprocessed,\n '%target_chat%',\n targetChatId\n ? renderMigratedContent(targetChatId, options.asPlain)\n : 'another chat',\n );\n content.push(...processed);\n\n if (options.asPlain) {\n return content.join('').trim();\n }\n\n return content;\n}\n\nfunction renderProductContent(message: ApiMessage) {\n return message.content && message.content.invoice\n ? message.content.invoice.title\n : 'a product';\n}\n\nfunction renderMessageContent(lang: LangFn, message: ApiMessage, options: ActionMessageTextOptions = {}) {\n const text = getMessageSummaryText(lang, message);\n const {\n photo, video, document, sticker,\n } = getMessageContent(message);\n\n const { maxTextLength, isEmbedded, asPlain } = options;\n\n const showQuotes = isEmbedded && text && !photo && !video && !document && !sticker;\n let messageText = trimText(text as string, maxTextLength)!;\n\n if (isEmbedded) {\n if (photo) {\n messageText = 'a photo';\n } else if (video) {\n messageText = video.isGif ? 'a GIF' : 'a video';\n } else if (document) {\n messageText = 'a document';\n } else if (sticker) {\n messageText = text;\n }\n }\n\n if (asPlain) {\n return showQuotes ? `«${messageText}»` : messageText;\n }\n\n if (showQuotes) {\n return (\n \n «\n {renderText(messageText)}\n »\n \n );\n }\n\n return (\n {renderText(messageText)}\n );\n}\n\nfunction renderOriginContent(lang: LangFn, origin: ApiUser | ApiChat, asPlain?: boolean) {\n return isChat(origin)\n ? renderChatContent(lang, origin, asPlain)\n : renderUserContent(origin, asPlain);\n}\n\nfunction renderUserContent(sender: ApiUser, asPlain?: boolean): string | TextPart | undefined {\n const text = trimText(getUserFullName(sender));\n\n if (asPlain) {\n return text;\n }\n\n return {sender && renderText(text!)};\n}\n\nfunction renderChatContent(lang: LangFn, chat: ApiChat, asPlain?: boolean): string | TextPart | undefined {\n const text = trimText(getChatTitle(lang, chat));\n\n if (asPlain) {\n return text;\n }\n\n return {chat && renderText(text!)};\n}\n\nfunction renderMigratedContent(chatId: number, asPlain?: boolean): string | TextPart | undefined {\n const text = 'another chat';\n\n if (asPlain) {\n return text;\n }\n\n return {text};\n}\n\nfunction processPlaceholder(text: string, placeholder: string, replaceValue?: TextPart | TextPart[]): TextPart[] {\n const placeholderPosition = text.indexOf(placeholder);\n if (placeholderPosition < 0 || !replaceValue) {\n return [text];\n }\n\n const content: TextPart[] = [];\n content.push(text.substring(0, placeholderPosition));\n if (Array.isArray(replaceValue)) {\n replaceValue.forEach((value, index) => {\n content.push(value);\n if (index + 1 < replaceValue.length) {\n content.push(', ');\n }\n });\n } else {\n content.push(replaceValue);\n }\n content.push(text.substring(placeholderPosition + placeholder.length));\n\n return content;\n}\n","import React from '../../../lib/teact/teact';\nimport EMOJI_REGEX, { removeVS16s } from '../../../lib/twemojiRegex';\n\nimport { RE_LINK_TEMPLATE, RE_MENTION_TEMPLATE } from '../../../config';\nimport { IS_EMOJI_SUPPORTED } from '../../../util/environment';\nimport { fixNonStandardEmoji, nativeToUnified } from '../../../util/emoji';\nimport buildClassName from '../../../util/buildClassName';\n\nimport MentionLink from '../../middle/message/MentionLink';\nimport SafeLink from '../SafeLink';\n\ntype TextPart = string | Element;\n\nconst RE_LETTER_OR_DIGIT = /^[\\d\\wа-яё]$/i;\nconst SIMPLE_MARKDOWN_REGEX = /(\\*\\*|__).+?\\1/g;\n\nexport default function renderText(\n part: TextPart,\n filters: Array<(\n 'escape_html' | 'hq_emoji' | 'emoji' | 'emoji_html' | 'br' | 'br_html' | 'highlight' | 'links' |\n 'simple_markdown' | 'simple_markdown_html'\n )> = ['emoji'],\n params?: { highlight: string | undefined },\n): TextPart[] {\n if (typeof part !== 'string') {\n return [part];\n }\n\n return filters.reduce((text, filter) => {\n switch (filter) {\n case 'escape_html':\n return escapeHtml(text);\n\n case 'hq_emoji':\n EMOJI_REGEX.lastIndex = 0;\n return replaceEmojis(text, 'big', 'jsx');\n\n case 'emoji':\n EMOJI_REGEX.lastIndex = 0;\n return replaceEmojis(text, 'small', 'jsx');\n\n case 'emoji_html':\n EMOJI_REGEX.lastIndex = 0;\n return replaceEmojis(text, 'small', 'html');\n\n case 'br':\n return addLineBreaks(text, 'jsx');\n\n case 'br_html':\n return addLineBreaks(text, 'html');\n\n case 'highlight':\n return addHighlight(text, params!.highlight);\n\n case 'links':\n return addLinks(text);\n\n case 'simple_markdown':\n return replaceSimpleMarkdown(text, 'jsx');\n\n case 'simple_markdown_html':\n return replaceSimpleMarkdown(text, 'html');\n }\n\n return text;\n }, [part] as TextPart[]);\n}\n\nfunction escapeHtml(textParts: TextPart[]): TextPart[] {\n const divEl = document.createElement('div');\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string') {\n return [...result, part];\n }\n\n divEl.innerText = part;\n\n return [...result, divEl.innerHTML];\n }, [] as TextPart[]);\n}\n\nfunction replaceEmojis(textParts: TextPart[], size: 'big' | 'small', type: 'jsx' | 'html'): TextPart[] {\n if (IS_EMOJI_SUPPORTED) {\n return textParts;\n }\n\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string') {\n return [...result, part];\n }\n\n part = fixNonStandardEmoji(part);\n const parts = part.split(EMOJI_REGEX);\n const emojis = part.match(EMOJI_REGEX) || [];\n result.push(parts[0]);\n\n return emojis.reduce((emojiResult: TextPart[], emoji, i) => {\n const code = nativeToUnified(removeVS16s(emoji));\n if (!code) return emojiResult;\n const className = buildClassName(\n 'emoji',\n size === 'small' && 'emoji-small',\n );\n if (type === 'jsx') {\n emojiResult.push(\n ,\n );\n }\n if (type === 'html') {\n emojiResult.push(\n // For preventing extra spaces in html\n // eslint-disable-next-line max-len\n `\"${emoji}\"`,\n );\n }\n\n const index = i * 2 + 2;\n if (parts[index]) {\n emojiResult.push(parts[index]);\n }\n\n return emojiResult;\n }, result);\n }, [] as TextPart[]);\n}\n\nfunction addLineBreaks(textParts: TextPart[], type: 'jsx' | 'html'): TextPart[] {\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string') {\n return [...result, part];\n }\n\n return [...result, ...part\n .split(/\\r\\n|\\r|\\n/g)\n .reduce((parts: TextPart[], line: string, i, source) => {\n // This adds non-breaking space if line was indented with spaces, to preserve the indentation\n const trimmedLine = line.trimLeft();\n const indentLength = line.length - trimmedLine.length;\n parts.push(String.fromCharCode(160).repeat(indentLength) + trimmedLine);\n\n if (i !== source.length - 1) {\n parts.push(\n type === 'jsx' ?
: '
',\n );\n }\n\n return parts;\n }, [])];\n }, [] as TextPart[]);\n}\n\nfunction addHighlight(textParts: TextPart[], highlight: string | undefined): TextPart[] {\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string' || !highlight) {\n return [...result, part];\n }\n\n const lowerCaseText = part.toLowerCase();\n const queryPosition = lowerCaseText.indexOf(highlight.toLowerCase());\n const nextSymbol = lowerCaseText[queryPosition + highlight.length];\n if (queryPosition < 0 || (nextSymbol && nextSymbol.match(RE_LETTER_OR_DIGIT))) {\n return [...result, part];\n }\n\n const newParts: TextPart[] = [];\n newParts.push(part.substring(0, queryPosition));\n newParts.push(\n \n {part.substring(queryPosition, queryPosition + highlight.length)}\n ,\n );\n newParts.push(part.substring(queryPosition + highlight.length));\n\n return [...result, ...newParts];\n }, [] as TextPart[]);\n}\n\nconst RE_LINK = new RegExp(`${RE_LINK_TEMPLATE}|${RE_MENTION_TEMPLATE}`, 'ig');\n\nfunction addLinks(textParts: TextPart[]): TextPart[] {\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string') {\n return [...result, part];\n }\n\n const links = part.match(RE_LINK);\n if (!links || !links.length) {\n return [...result, part];\n }\n\n const content: TextPart[] = [];\n\n let nextLink = links.shift();\n let lastIndex = 0;\n while (nextLink) {\n const index = part.indexOf(nextLink, lastIndex);\n content.push(part.substring(lastIndex, index));\n if (nextLink.startsWith('@')) {\n content.push(\n \n {nextLink}\n ,\n );\n } else {\n if (nextLink.endsWith('?')) {\n nextLink = nextLink.slice(0, nextLink.length - 1);\n }\n\n content.push(\n ,\n );\n }\n lastIndex = index + nextLink.length;\n nextLink = links.shift();\n }\n content.push(part.substring(lastIndex));\n\n return [...result, ...content];\n }, [] as TextPart[]);\n}\n\nfunction replaceSimpleMarkdown(textParts: TextPart[], type: 'jsx' | 'html'): TextPart[] {\n return textParts.reduce((result, part) => {\n if (typeof part !== 'string') {\n return [...result, part];\n }\n\n const parts = part.split(SIMPLE_MARKDOWN_REGEX);\n const entities = part.match(SIMPLE_MARKDOWN_REGEX) || [];\n result.push(parts[0]);\n\n return entities.reduce((entityResult: TextPart[], entity, i) => {\n if (type === 'jsx') {\n entityResult.push(\n entity.startsWith('**')\n ? {entity.replace(/\\*\\*/g, '')}\n : {entity.replace(/__/g, '')},\n );\n } else {\n entityResult.push(\n entity.startsWith('**')\n ? `${entity.replace(/\\*\\*/g, '')}`\n : `${entity.replace(/__/g, '')}`,\n );\n }\n\n const index = i * 2 + 2;\n if (parts[index]) {\n entityResult.push(parts[index]);\n }\n\n return entityResult;\n }, result);\n }, [] as TextPart[]);\n}\n","import React from '../../../lib/teact/teact';\n\nimport { EDITABLE_INPUT_ID } from '../../../config';\nimport { IS_IOS } from '../../../util/environment';\n\nexport function preventMessageInputBlur(e: React.MouseEvent, withBubbling = false) {\n if (\n IS_IOS\n || !document.activeElement\n || document.activeElement.id !== EDITABLE_INPUT_ID\n || (!withBubbling && e.target !== e.currentTarget)\n ) {\n return;\n }\n\n e.preventDefault();\n}\n\nexport function preventMessageInputBlurWithBubbling(e: React.MouseEvent) {\n preventMessageInputBlur(e, true);\n}\n","import React, { FC } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../../global/types';\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport { pick } from '../../../util/iteratees';\nimport { selectUser } from '../../../modules/selectors';\n\ntype OwnProps = {\n userId?: number;\n username?: string;\n children: any;\n};\n\ntype StateProps = {\n userOrChat?: ApiUser | ApiChat;\n};\n\ntype DispatchProps = Pick;\n\nconst MentionLink: FC = ({\n username,\n userOrChat,\n children,\n openChat,\n openChatByUsername,\n}) => {\n const handleClick = () => {\n if (userOrChat) {\n openChat({ id: userOrChat.id });\n } else if (username) {\n openChatByUsername({ username: username.substring(1) });\n }\n };\n\n return (\n \n {children}\n \n );\n};\n\nexport default withGlobal(\n (global, { userId }): StateProps => {\n return {\n userOrChat: userId ? selectUser(global, userId) : undefined,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['openChat', 'openChatByUsername']),\n)(MentionLink);\n","import { MouseEvent as ReactMouseEvent, RefObject } from 'react';\n\nimport React, {\n FC, useRef, useCallback, useState,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport Spinner from './Spinner';\nimport RippleEffect from './RippleEffect';\n\nimport './Button.scss';\n\nexport type OwnProps = {\n ref?: RefObject;\n type?: 'button' | 'submit' | 'reset';\n children: any;\n size?: 'default' | 'smaller' | 'tiny';\n color?: 'primary' | 'secondary' | 'gray' | 'danger' | 'translucent' | 'translucent-white' | 'dark';\n className?: string;\n round?: boolean;\n pill?: boolean;\n fluid?: boolean;\n isText?: boolean;\n isLoading?: boolean;\n ariaLabel?: string;\n href?: string;\n download?: string;\n disabled?: boolean;\n ripple?: boolean;\n faded?: boolean;\n tabIndex?: number;\n isRtl?: boolean;\n onClick?: (e: ReactMouseEvent) => void;\n onContextMenu?: (e: ReactMouseEvent) => void;\n onMouseDown?: (e: ReactMouseEvent) => void;\n onMouseEnter?: NoneToVoidFunction;\n onMouseLeave?: NoneToVoidFunction;\n onFocus?: NoneToVoidFunction;\n};\n\n// Longest animation duration;\nconst CLICKED_TIMEOUT = 400;\n\nconst Button: FC = ({\n ref,\n type = 'button',\n onClick,\n onContextMenu,\n onMouseDown,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n children,\n size = 'default',\n color = 'primary',\n className,\n round,\n pill,\n fluid,\n isText,\n isLoading,\n ariaLabel,\n href,\n download,\n disabled,\n ripple,\n faded,\n tabIndex,\n isRtl,\n}) => {\n // eslint-disable-next-line no-null/no-null\n let elementRef = useRef(null);\n if (ref) {\n elementRef = ref;\n }\n\n const [isClicked, setIsClicked] = useState(false);\n\n const fullClassName = buildClassName(\n 'Button',\n className,\n size,\n color,\n round && 'round',\n pill && 'pill',\n fluid && 'fluid',\n disabled && 'disabled',\n isText && 'text',\n isLoading && 'loading',\n ripple && 'has-ripple',\n faded && 'faded',\n isClicked && 'clicked',\n );\n\n const handleClick = useCallback((e: ReactMouseEvent) => {\n if (!disabled && onClick) {\n onClick(e);\n }\n\n setIsClicked(true);\n setTimeout(() => {\n setIsClicked(false);\n }, CLICKED_TIMEOUT);\n }, [disabled, onClick]);\n\n const handleMouseDown = useCallback((e: ReactMouseEvent) => {\n e.preventDefault();\n if (!disabled && onMouseDown) {\n onMouseDown(e);\n }\n }, [onMouseDown, disabled]);\n\n if (href) {\n return (\n }\n className={fullClassName}\n href={href}\n title={ariaLabel}\n download={download}\n tabIndex={tabIndex}\n dir={isRtl ? 'rtl' : undefined}\n >\n {children}\n {!disabled && ripple && (\n \n )}\n \n );\n }\n\n return (\n // eslint-disable-next-line react/button-has-type\n }\n type={type}\n className={fullClassName}\n onClick={handleClick}\n onContextMenu={onContextMenu}\n onMouseDown={handleMouseDown}\n onMouseEnter={onMouseEnter && !disabled ? onMouseEnter : undefined}\n onMouseLeave={onMouseLeave && !disabled ? onMouseLeave : undefined}\n onFocus={onFocus && !disabled ? onFocus : undefined}\n aria-label={ariaLabel}\n title={ariaLabel}\n tabIndex={tabIndex}\n dir={isRtl ? 'rtl' : undefined}\n >\n {isLoading ? (\n
\n Please wait..\n \n
\n ) : children}\n {!disabled && ripple && (\n \n )}\n \n );\n};\n\nexport default Button;\n","import { ChangeEvent } from 'react';\nimport React, { FC, memo, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Spinner from './Spinner';\n\nimport './Checkbox.scss';\n\ntype OwnProps = {\n id?: string;\n name?: string;\n value?: string;\n label: string;\n subLabel?: string;\n checked: boolean;\n disabled?: boolean;\n round?: boolean;\n blocking?: boolean;\n isLoading?: boolean;\n withCheckedCallback?: boolean;\n onChange?: (e: ChangeEvent) => void;\n onCheck?: (isChecked: boolean) => void;\n};\n\nconst Checkbox: FC = ({\n id,\n name,\n value,\n label,\n subLabel,\n checked,\n disabled,\n round,\n blocking,\n isLoading,\n onChange,\n onCheck,\n}) => {\n const lang = useLang();\n const handleChange = useCallback((event: ChangeEvent) => {\n if (onChange) {\n onChange(event);\n }\n\n if (onCheck) {\n onCheck(event.currentTarget.checked);\n }\n }, [onChange, onCheck]);\n\n const className = buildClassName(\n 'Checkbox',\n disabled && 'disabled',\n round && 'round',\n isLoading && 'loading',\n blocking && 'blocking',\n );\n\n return (\n \n );\n};\n\nexport default memo(Checkbox);\n","import React, { FC, useState, useRef } from '../../lib/teact/teact';\n\nimport Menu from './Menu';\n\nimport './DropdownMenu.scss';\n\ntype OwnProps = {\n className?: string;\n trigger: FC<{ onTrigger: () => void; isOpen?: boolean }>;\n positionX?: 'left' | 'right';\n positionY?: 'top' | 'bottom';\n footer?: string;\n forceOpen?: boolean;\n onOpen?: NoneToVoidFunction;\n onClose?: NoneToVoidFunction;\n children: any;\n};\n\nconst DropdownMenu: FC = ({\n trigger,\n className,\n children,\n positionX = 'left',\n positionY = 'top',\n footer,\n forceOpen,\n onOpen,\n onClose,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const menuRef = useRef(null);\n // eslint-disable-next-line no-null/no-null\n const dropdownRef = useRef(null);\n const [isOpen, setIsOpen] = useState(false);\n\n const toggleIsOpen = () => {\n setIsOpen(!isOpen);\n if (isOpen) {\n if (onClose) onClose();\n } else if (onOpen) onOpen();\n };\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n const menu = menuRef.current;\n\n if (!isOpen || e.keyCode !== 40 || !menu) {\n return;\n }\n\n const focusedElement = document.activeElement;\n const elementChildren = Array.from(menu.children);\n\n if (!focusedElement || elementChildren.indexOf(focusedElement) === -1) {\n (elementChildren[0] as HTMLElement).focus();\n }\n };\n\n const handleClose = () => {\n setIsOpen(false);\n if (onClose) onClose();\n };\n\n return (\n \n {trigger({ onTrigger: toggleIsOpen, isOpen })}\n\n \n {children}\n \n
\n );\n};\n\nexport default DropdownMenu;\n","import { ChangeEvent, FormEvent, RefObject } from 'react';\nimport React, { FC, memo } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\ntype OwnProps = {\n ref?: RefObject;\n id?: string;\n className?: string;\n value?: string;\n label?: string;\n error?: string;\n success?: string;\n disabled?: boolean;\n readOnly?: boolean;\n placeholder?: string;\n autoComplete?: string;\n maxLength?: number;\n inputMode?: 'text' | 'none' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n onChange?: (e: ChangeEvent) => void;\n onInput?: (e: FormEvent) => void;\n onKeyPress?: (e: React.KeyboardEvent) => void;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n onBlur?: (e: React.FocusEvent) => void;\n onPaste?: (e: React.ClipboardEvent) => void;\n};\n\nconst InputText: FC = ({\n ref,\n id,\n className,\n value,\n label,\n error,\n success,\n disabled,\n readOnly,\n placeholder,\n autoComplete,\n inputMode,\n maxLength,\n onChange,\n onInput,\n onKeyPress,\n onKeyDown,\n onBlur,\n onPaste,\n}) => {\n const lang = useLang();\n const labelText = error || success || label;\n const fullClassName = buildClassName(\n 'input-group',\n value && 'touched',\n error ? 'error' : success && 'success',\n disabled && 'disabled',\n readOnly && 'disabled',\n labelText && 'with-label',\n className,\n );\n\n return (\n
\n \n {labelText && (\n \n )}\n
\n );\n};\n\nexport default memo(InputText);\n","import React, { FC, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport './Link.scss';\n\ntype OwnProps = {\n children: any;\n className?: string;\n isRtl?: boolean;\n onClick?: (e: React.MouseEvent) => void;\n};\n\nconst Link: FC = ({\n children, className, isRtl, onClick,\n}) => {\n const handleClick = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n onClick!(e);\n }, [onClick]);\n\n return (\n \n {children}\n \n );\n};\n\nexport default Link;\n","import React, { FC, memo } from '../../lib/teact/teact';\n\nimport Spinner from './Spinner';\n\nimport './Loading.scss';\n\ntype OwnProps = {\n color?: 'blue' | 'white' | 'black';\n};\n\nconst Loading: FC = ({ color = 'blue' }) => {\n return (\n
\n \n
\n );\n};\n\nexport default memo(Loading);\n","import { RefObject } from 'react';\nimport React, { FC, useEffect, useRef } from '../../lib/teact/teact';\n\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';\nimport useVirtualBackdrop from '../../hooks/useVirtualBackdrop';\nimport useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';\nimport captureEscKeyListener from '../../util/captureEscKeyListener';\nimport buildClassName from '../../util/buildClassName';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport { preventMessageInputBlurWithBubbling } from '../middle/helpers/preventMessageInputBlur';\n\nimport './Menu.scss';\n\ntype OwnProps = {\n ref?: RefObject;\n containerRef?: RefObject;\n isOpen: boolean;\n className?: string;\n style?: string;\n positionX?: 'left' | 'right';\n positionY?: 'top' | 'bottom';\n autoClose?: boolean;\n shouldSkipTransition?: boolean;\n footer?: string;\n noCloseOnBackdrop?: boolean;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n onCloseAnimationEnd?: () => void;\n onClose?: () => void;\n onMouseEnter?: (e: React.MouseEvent) => void;\n onMouseLeave?: (e: React.MouseEvent) => void;\n children: any;\n};\n\nconst ANIMATION_DURATION = 200;\n\nconst Menu: FC = ({\n ref,\n containerRef,\n isOpen,\n className,\n style,\n children,\n positionX = 'left',\n positionY = 'top',\n autoClose = false,\n footer,\n noCloseOnBackdrop = false,\n onCloseAnimationEnd,\n onClose,\n onMouseEnter,\n onMouseLeave,\n shouldSkipTransition,\n}) => {\n // eslint-disable-next-line no-null/no-null\n let menuRef = useRef(null);\n if (ref) {\n menuRef = ref;\n }\n const backdropContainerRef = containerRef || menuRef;\n\n const {\n transitionClassNames,\n } = useShowTransition(\n isOpen,\n onCloseAnimationEnd,\n shouldSkipTransition,\n undefined,\n shouldSkipTransition,\n );\n\n useEffect(\n () => (isOpen && onClose ? captureEscKeyListener(onClose) : undefined),\n [isOpen, onClose],\n );\n\n useHistoryBack(isOpen, onClose, undefined, undefined, autoClose);\n\n useEffectWithPrevDeps(([prevIsOpen]) => {\n if (prevIsOpen !== undefined) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION);\n }\n }, [isOpen]);\n\n const handleKeyDown = useKeyboardListNavigation(menuRef, isOpen, autoClose ? onClose : undefined, undefined, true);\n\n useVirtualBackdrop(\n isOpen,\n backdropContainerRef,\n noCloseOnBackdrop ? undefined : onClose,\n );\n\n const bubbleClassName = buildClassName(\n 'bubble menu-container custom-scroll',\n positionY,\n positionX,\n footer && 'with-footer',\n transitionClassNames,\n );\n\n return (\n \n {isOpen && (\n // This only prevents click events triggering on underlying elements\n
\n )}\n \n {children}\n {footer &&
{footer}
}\n
\n
\n );\n};\n\nexport default Menu;\n","import React, { FC, useCallback } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport './MenuItem.scss';\n\ntype OnClickHandler = (e: React.SyntheticEvent) => void;\n\ntype OwnProps = {\n icon?: string;\n className?: string;\n children: any;\n onClick?: OnClickHandler;\n href?: string;\n download?: string;\n disabled?: boolean;\n destructive?: boolean;\n ariaLabel?: string;\n};\n\nconst MenuItem: FC = (props) => {\n const {\n icon,\n className,\n children,\n onClick,\n href,\n download,\n disabled,\n destructive,\n ariaLabel,\n } = props;\n\n const lang = useLang();\n const handleClick = useCallback((e: React.MouseEvent) => {\n if (disabled || !onClick) {\n e.stopPropagation();\n e.preventDefault();\n\n return;\n }\n\n onClick(e);\n }, [disabled, onClick]);\n\n const handleKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.keyCode !== 13 && e.keyCode !== 32) {\n return;\n }\n\n if (disabled || !onClick) {\n e.stopPropagation();\n e.preventDefault();\n\n return;\n }\n\n onClick(e);\n }, [disabled, onClick]);\n\n const fullClassName = buildClassName(\n 'MenuItem',\n className,\n disabled && 'disabled',\n destructive && 'destructive',\n );\n\n const content = (\n <>\n {icon && (\n \n )}\n {children}\n \n );\n\n if (href) {\n return (\n \n {content}\n \n );\n }\n\n return (\n \n {content}\n
\n );\n};\n\nexport default MenuItem;\n","import React, {\n FC, useCallback, useMemo, useState, memo,\n} from '../../lib/teact/teact';\nimport { debounce } from '../../util/schedulers';\n\nimport './RippleEffect.scss';\n\ninterface Ripple {\n x: number;\n y: number;\n size: number;\n}\n\nconst ANIMATION_DURATION_MS = 700;\n\nconst RippleEffect: FC = () => {\n const [ripples, setRipples] = useState([]);\n\n const cleanUpDebounced = useMemo(() => {\n return debounce(() => {\n setRipples([]);\n }, ANIMATION_DURATION_MS, false);\n }, []);\n\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n if (e.button !== 0) {\n return;\n }\n\n const container = e.currentTarget as HTMLDivElement;\n const position = container.getBoundingClientRect() as DOMRect;\n\n const rippleSize = container.offsetWidth / 2;\n\n setRipples([\n ...ripples,\n {\n x: e.clientX - position.x - (rippleSize / 2),\n y: e.clientY - position.y - (rippleSize / 2),\n size: rippleSize,\n },\n ]);\n\n requestAnimationFrame(() => {\n cleanUpDebounced();\n });\n }, [ripples, cleanUpDebounced]);\n\n return (\n
\n {ripples.map(({ x, y, size }) => (\n \n ))}\n
\n );\n};\n\nexport default memo(RippleEffect);\n","import React, { FC } from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport './Spinner.scss';\n\nconst Spinner: FC<{\n color?: 'blue' | 'white' | 'black' | 'green' | 'gray';\n withBackground?: boolean;\n}> = ({\n color = 'blue',\n withBackground,\n}) => {\n return (\n
\n
\n
\n );\n};\n\nexport default Spinner;\n","export const PAGE_TITLE = 'Telegram';\nexport const INACTIVE_MARKER = ' [Inactive]';\n\nexport const APP_NAME = process.env.APP_NAME || 'Telegram WebZ';\nexport const APP_VERSION = process.env.APP_VERSION || 'dev';\n\nexport const DEBUG = (\n process.env.APP_ENV !== 'production' && process.env.APP_ENV !== 'perf' && process.env.APP_ENV !== 'test'\n);\nexport const DEBUG_MORE = false;\n\nexport const IS_TEST = process.env.APP_ENV === 'test';\nexport const IS_PERF = process.env.APP_ENV === 'perf';\n\nexport const DEBUG_ALERT_MSG = 'Shoot!\\nSomething went wrong, please see the error details in Dev Tools Console.';\nexport const DEBUG_GRAMJS = false;\n\nexport const SESSION_USER_KEY = 'user_auth';\nexport const LEGACY_SESSION_KEY = 'GramJs:sessionId';\n\nexport const GLOBAL_STATE_CACHE_DISABLED = false;\nexport const GLOBAL_STATE_CACHE_KEY = 'tt-global-state';\nexport const GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT = 30;\nexport const GLOBAL_STATE_CACHE_USER_LIST_LIMIT = 5000;\n\nexport const MEDIA_CACHE_DISABLED = false;\nexport const MEDIA_CACHE_NAME = 'tt-media';\nexport const MEDIA_CACHE_NAME_AVATARS = 'tt-media-avatars';\nexport const MEDIA_PROGRESSIVE_CACHE_DISABLED = false;\nexport const MEDIA_PROGRESSIVE_CACHE_NAME = 'tt-media-progressive';\nexport const MEDIA_CACHE_MAX_BYTES = 512 * 1024; // 512 KB\nexport const CUSTOM_BG_CACHE_NAME = 'tt-custom-bg';\nexport const LANG_CACHE_NAME = 'tt-lang-packs-v5';\nexport const ASSET_CACHE_NAME = 'tt-assets';\n\nexport const DOWNLOAD_WORKERS = 16;\nexport const UPLOAD_WORKERS = 16;\n\nconst isBigScreen = typeof window !== 'undefined' && window.innerHeight >= 900;\n\nexport const MIN_PASSWORD_LENGTH = 1;\n\nexport const MESSAGE_LIST_SENSITIVE_AREA = 750;\nexport const MESSAGE_LIST_SLICE = isBigScreen ? 60 : 40;\nexport const MESSAGE_LIST_VIEWPORT_LIMIT = MESSAGE_LIST_SLICE * 2;\n\nexport const CHAT_HEIGHT_PX = 72;\nexport const CHAT_LIST_SLICE = isBigScreen ? 30 : 25;\nexport const CHAT_LIST_LOAD_SLICE = 100;\nexport const SHARED_MEDIA_SLICE = 42;\nexport const MESSAGE_SEARCH_SLICE = 42;\nexport const GLOBAL_SEARCH_SLICE = 20;\nexport const MEMBERS_SLICE = 30;\nexport const MEMBERS_LOAD_SLICE = 200;\nexport const PINNED_MESSAGES_LIMIT = 50;\nexport const BLOCKED_LIST_LIMIT = 100;\nexport const PROFILE_PHOTOS_LIMIT = 40;\nexport const PROFILE_SENSITIVE_AREA = 500;\n\nexport const TOP_CHAT_MESSAGES_PRELOAD_LIMIT = 20;\nexport const ALL_CHATS_PRELOAD_DISABLED = false;\n\nexport const ANIMATION_LEVEL_MIN = 0;\nexport const ANIMATION_LEVEL_MED = 1;\nexport const ANIMATION_LEVEL_MAX = 2;\nexport const ANIMATION_LEVEL_DEFAULT = ANIMATION_LEVEL_MAX;\n\nexport const DEFAULT_MESSAGE_TEXT_SIZE_PX = 16;\nexport const IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 17;\nexport const MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 15;\n\nexport const DRAFT_DEBOUNCE = 10000; // 10s\n\nexport const EDITABLE_INPUT_ID = 'editable-message-text';\nexport const EDITABLE_INPUT_MODAL_ID = 'editable-message-text-modal';\n\n// Screen width where Pinned Message / Audio Player in the Middle Header can be safely displayed\nexport const SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1440; // px\n// Screen width where Pinned Message / Audio Player in the Middle Header shouldn't collapse with ChatInfo\nexport const SAFE_SCREEN_WIDTH_FOR_CHAT_INFO = 1150; // px\n\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN = 1275; // px\nexport const MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN = 925; // px\nexport const MOBILE_SCREEN_MAX_WIDTH = 600; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH = 950; // px\nexport const MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT = 450; // px\n\nexport const LOCAL_MESSAGE_ID_BASE = 1e9;\n\nexport const ANIMATION_END_DELAY = 100;\n\nexport const FAST_SMOOTH_MAX_DISTANCE = 1500;\nexport const FAST_SMOOTH_MIN_DURATION = 250;\nexport const FAST_SMOOTH_MAX_DURATION = 600;\nexport const FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE = 500; // px\n\n// Average duration of message sending animation\nexport const API_UPDATE_THROTTLE = Math.round((FAST_SMOOTH_MIN_DURATION + FAST_SMOOTH_MAX_DURATION) / 2);\nexport const API_THROTTLE_RESET_UPDATES = new Set([\n 'newMessage', 'newScheduledMessage', 'deleteMessages', 'deleteScheduledMessages', 'deleteHistory',\n]);\n\nexport const STICKER_SIZE_INLINE_DESKTOP_FACTOR = 13;\nexport const STICKER_SIZE_INLINE_MOBILE_FACTOR = 11;\nexport const STICKER_SIZE_AUTH = 160;\nexport const STICKER_SIZE_AUTH_MOBILE = 120;\nexport const STICKER_SIZE_PICKER = 64;\nexport const STICKER_SIZE_GENERAL_SETTINGS = 48;\nexport const STICKER_SIZE_PICKER_HEADER = 32;\nexport const STICKER_SIZE_SEARCH = 64;\nexport const STICKER_SIZE_MODAL = 64;\nexport const STICKER_SIZE_TWO_FA = 160;\nexport const STICKER_SIZE_DISCUSSION_GROUPS = 140;\nexport const STICKER_SIZE_FOLDER_SETTINGS = 80;\nexport const STICKER_SIZE_INLINE_BOT_RESULT = 100;\nexport const RECENT_STICKERS_LIMIT = 20;\nexport const MEMOJI_STICKER_ID = 'MEMOJI_STICKER';\n\nexport const BASE_EMOJI_KEYWORD_LANG = 'en';\n\nexport const MENU_TRANSITION_DURATION = 200;\nexport const SLIDE_TRANSITION_DURATION = 450;\n\nexport const CONTENT_TYPES_FOR_QUICK_UPLOAD = new Set([\n 'image/png', 'image/gif', 'image/jpeg', 'video/mp4', 'video/avi', 'video/quicktime',\n]);\n\n// eslint-disable-next-line max-len\nexport const RE_LINK_TEMPLATE = '((ftp|https?):\\\\/\\\\/)?((www\\\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\\\.[a-zA-Z0-9()]{1,63})\\\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)';\nexport const RE_MENTION_TEMPLATE = '(@[\\\\w\\\\d_-]+)';\nexport const RE_TME_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/)([\\d\\w_]+)(?:\\/([\\d]+))?(?:\\/([\\d]+))?$/gm;\nexport const RE_TME_INVITE_LINK = /^(?:https?:\\/\\/)?(?:t\\.me\\/joinchat\\/)([\\d\\w_-]+)?$/gm;\n\n// MTProto constants\nexport const SERVICE_NOTIFICATIONS_USER_ID = 777000;\nexport const REPLIES_USER_ID = 1271266957;\nexport const ALL_FOLDER_ID = 0;\nexport const ARCHIVED_FOLDER_ID = 1;\nexport const DELETED_COMMENTS_CHANNEL_ID = 777;\nexport const MAX_MEDIA_FILES_FOR_ALBUM = 10;\nexport const MAX_ACTIVE_PINNED_CHATS = 5;\nexport const SCHEDULED_WHEN_ONLINE = 0x7FFFFFFE;\nexport const DEFAULT_LANG_CODE = 'en';\nexport const DEFAULT_LANG_PACK = 'android';\nexport const LANG_PACKS = ['android', 'ios', 'tdesktop', 'macos'] as const;\nexport const TIPS_USERNAME = 'TelegramTips';\nexport const LOCALIZED_TIPS = ['ar', 'pt-br', 'id', 'it', 'ko', 'ms', 'pl', 'es', 'tr'];\nexport const FEEDBACK_URL = 'https://bugs.telegram.org/?tag_ids=41&sort=time';\nexport const LIGHT_THEME_BG_COLOR = '#A2AF8E';\nexport const DARK_THEME_BG_COLOR = '#0F0F0F';\nexport const DARK_THEME_PATTERN_COLOR = '#0a0a0a8c';\nexport const DEFAULT_PATTERN_COLOR = 'rgba(90, 110, 70, 0.6)';\n","import { useEffect } from '../lib/teact/teact';\nimport usePrevious from './usePrevious';\n\nexport default (cb: (args: PT) => void, dependencies: T, debugKey?: string) => {\n const prevDeps = usePrevious(dependencies);\n return useEffect(() => {\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n return cb(prevDeps || []);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies, debugKey);\n};\n","import { useCallback, useState } from '../lib/teact/teact';\n\nexport default (initial = false): [boolean, AnyToVoidFunction, AnyToVoidFunction] => {\n const [value, setValue] = useState(initial);\n\n const setTrue = useCallback(() => {\n setValue(true);\n }, []);\n\n const setFalse = useCallback(() => {\n setValue(false);\n }, []);\n\n return [value, setTrue, setFalse];\n};\n","import { useCallback, useState } from '../lib/teact/teact';\n\nexport default () => {\n const [, setTrigger] = useState(false);\n\n return useCallback(() => {\n setTrigger((trigger) => !trigger);\n }, []);\n};\n","import { useEffect } from '../lib/teact/teact';\n\nexport const ANIMATION_START_EVENT = 'tt-event-heavy-animation-start';\nexport const ANIMATION_END_EVENT = 'tt-event-heavy-animation-end';\n\nlet timeout: number | undefined;\nlet isAnimating = false;\n\nexport const dispatchHeavyAnimationEvent = (duration?: number) => {\n if (!isAnimating) {\n isAnimating = true;\n document.dispatchEvent(new Event(ANIMATION_START_EVENT));\n }\n\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n }\n\n if (duration) {\n timeout = window.setTimeout(() => {\n isAnimating = false;\n document.dispatchEvent(new Event(ANIMATION_END_EVENT));\n timeout = undefined;\n }, duration);\n }\n\n return () => {\n isAnimating = false;\n document.dispatchEvent(new Event(ANIMATION_END_EVENT));\n };\n};\n\nexport default (\n handleAnimationStart: AnyToVoidFunction,\n handleAnimationEnd: AnyToVoidFunction,\n) => {\n useEffect(() => {\n if (isAnimating) {\n handleAnimationStart();\n }\n\n document.addEventListener(ANIMATION_START_EVENT, handleAnimationStart);\n document.addEventListener(ANIMATION_END_EVENT, handleAnimationEnd);\n\n return () => {\n document.removeEventListener(ANIMATION_END_EVENT, handleAnimationEnd);\n document.removeEventListener(ANIMATION_START_EVENT, handleAnimationStart);\n };\n }, [handleAnimationEnd, handleAnimationStart]);\n};\n","import { useCallback, useEffect, useRef } from '../lib/teact/teact';\n\nimport { IS_IOS } from '../util/environment';\nimport usePrevious from './usePrevious';\nimport { getDispatch } from '../lib/teact/teactn';\nimport { areSortedArraysEqual } from '../util/iteratees';\n\n// Carefully selected by swiping and observing visual changes\n// TODO: may be different on other devices such as iPad, maybe take dpi into account?\nconst SAFARI_EDGE_BACK_GESTURE_LIMIT = 300;\nconst SAFARI_EDGE_BACK_GESTURE_DURATION = 350;\nexport const LOCATION_HASH = window.location.hash;\n\ntype HistoryState = {\n currentIndex: number;\n nextStateIndexToReplace: number;\n isHistoryAltered: boolean;\n isDisabled: boolean;\n isEdge: boolean;\n currentIndexes: number[];\n};\n\nconst historyState: HistoryState = {\n currentIndex: 0,\n nextStateIndexToReplace: -1,\n isHistoryAltered: false,\n isDisabled: false,\n isEdge: false,\n currentIndexes: [],\n};\n\nexport const disableHistoryBack = () => {\n historyState.isDisabled = true;\n};\n\nconst handleTouchStart = (event: TouchEvent) => {\n const x = event.touches[0].pageX;\n\n if (x <= SAFARI_EDGE_BACK_GESTURE_LIMIT || x >= window.innerWidth - SAFARI_EDGE_BACK_GESTURE_LIMIT) {\n historyState.isEdge = true;\n }\n};\n\nconst handleTouchEnd = () => {\n if (historyState.isEdge) {\n setTimeout(() => {\n historyState.isEdge = false;\n }, SAFARI_EDGE_BACK_GESTURE_DURATION);\n }\n};\n\nif (IS_IOS) {\n window.addEventListener('touchstart', handleTouchStart);\n window.addEventListener('touchend', handleTouchEnd);\n window.addEventListener('popstate', handleTouchEnd);\n}\n\nwindow.history.replaceState({ index: historyState.currentIndex }, '', window.location.pathname);\n\nexport default function useHistoryBack(\n isActive: boolean | undefined,\n onBack: ((noDisableAnimation: boolean) => void) | undefined,\n onForward?: (state: any) => void,\n currentState?: any,\n shouldReplaceNext = false,\n hashes?: string[],\n) {\n const indexRef = useRef(-1);\n const isForward = useRef(false);\n const prevIsActive = usePrevious(isActive);\n const isClosed = useRef(true);\n const indexHashRef = useRef<{ index: number; hash: string }[]>([]);\n const prevHashes = usePrevious(hashes);\n const isHashChangedFromEvent = useRef(false);\n\n const handleChange = useCallback((isForceClose = false) => {\n if (!hashes) {\n if (isActive && !isForceClose) {\n isClosed.current = false;\n\n if (isForward.current) {\n isForward.current = false;\n historyState.currentIndexes.push(indexRef.current);\n } else {\n setTimeout(() => {\n const index = ++historyState.currentIndex;\n\n historyState.currentIndexes.push(index);\n\n window.history[\n (historyState.currentIndexes.includes(historyState.nextStateIndexToReplace - 1)\n && window.history.state.index !== 0\n && historyState.nextStateIndexToReplace === index\n && !shouldReplaceNext)\n ? 'replaceState'\n : 'pushState'\n ]({\n index,\n state: currentState,\n }, '');\n\n indexRef.current = index;\n\n if (shouldReplaceNext) {\n historyState.nextStateIndexToReplace = historyState.currentIndex + 1;\n }\n }, 0);\n }\n }\n\n if ((isForceClose || !isActive) && !isClosed.current) {\n if ((indexRef.current === historyState.currentIndex || !shouldReplaceNext)) {\n historyState.isHistoryAltered = true;\n window.history.back();\n\n setTimeout(() => {\n historyState.nextStateIndexToReplace = -1;\n }, 400);\n }\n historyState.currentIndexes.splice(historyState.currentIndexes.indexOf(indexRef.current), 1);\n\n isClosed.current = true;\n }\n } else {\n const prev = prevHashes || [];\n if (prev.length < hashes.length) {\n setTimeout(() => {\n const index = ++historyState.currentIndex;\n historyState.currentIndexes.push(index);\n\n window.history.pushState({\n index,\n state: currentState,\n }, '', `#${hashes[hashes.length - 1]}`);\n\n indexHashRef.current.push({\n index,\n hash: hashes[hashes.length - 1],\n });\n }, 0);\n } else {\n const delta = prev.length - hashes.length;\n if (isHashChangedFromEvent.current) {\n isHashChangedFromEvent.current = false;\n } else {\n if (hashes.length !== indexHashRef.current.length) {\n if (delta > 0) {\n const last = indexHashRef.current[indexHashRef.current.length - delta - 1];\n let realDelta = delta;\n if (last) {\n const indexLast = historyState.currentIndexes.findIndex(\n (l) => l === last.index,\n );\n realDelta = historyState.currentIndexes.length - indexLast - 1;\n }\n historyState.isHistoryAltered = true;\n window.history.go(-realDelta);\n const removed = indexHashRef.current.splice(indexHashRef.current.length - delta - 1, delta);\n removed.forEach(({ index }) => {\n historyState.currentIndexes.splice(historyState.currentIndexes.indexOf(index), 1);\n });\n }\n }\n\n if (hashes.length > 0) {\n setTimeout(() => {\n const index = ++historyState.currentIndex;\n historyState.currentIndexes[historyState.currentIndexes.length - 1] = index;\n\n window.history.replaceState({\n index,\n state: currentState,\n }, '', `#${hashes[hashes.length - 1]}`);\n\n indexHashRef.current[indexHashRef.current.length - 1] = {\n index,\n hash: hashes[hashes.length - 1],\n };\n }, 0);\n }\n }\n }\n }\n }, [currentState, hashes, isActive, prevHashes, shouldReplaceNext]);\n\n useEffect(() => {\n const handlePopState = (event: PopStateEvent) => {\n if (historyState.isHistoryAltered) {\n setTimeout(() => {\n historyState.isHistoryAltered = false;\n }, 0);\n return;\n }\n const { index: i } = event.state;\n const index = i || 0;\n try {\n const currIndex = hashes ? indexHashRef.current[indexHashRef.current.length - 1].index : indexRef.current;\n\n const prev = historyState.currentIndexes[historyState.currentIndexes.indexOf(currIndex) - 1];\n\n if (historyState.isDisabled) return;\n\n if ((!isClosed.current && (index === 0 || index === prev)) || (hashes && (index === 0 || index === prev))) {\n if (hashes) {\n isHashChangedFromEvent.current = true;\n indexHashRef.current.pop();\n }\n\n historyState.currentIndexes.splice(historyState.currentIndexes.indexOf(currIndex), 1);\n\n if (onBack) {\n if (historyState.isEdge) {\n getDispatch()\n .disableHistoryAnimations();\n }\n onBack(!historyState.isEdge);\n isClosed.current = true;\n }\n } else if (index === currIndex && isClosed.current && onForward && !hashes) {\n isForward.current = true;\n if (historyState.isEdge) {\n getDispatch()\n .disableHistoryAnimations();\n }\n onForward(event.state.state);\n }\n } catch (e) {\n // Forward navigation for hashed is not supported\n }\n };\n\n const hasChanged = hashes\n ? (!prevHashes || !areSortedArraysEqual(prevHashes, hashes))\n : prevIsActive !== isActive;\n\n if (!historyState.isDisabled && hasChanged) {\n handleChange();\n }\n\n window.addEventListener('popstate', handlePopState);\n return () => window.removeEventListener('popstate', handlePopState);\n }, [\n currentState, handleChange, hashes, isActive, onBack, onForward, prevHashes, prevIsActive, shouldReplaceNext,\n ]);\n\n return {\n forceClose: () => handleChange(true),\n };\n}\n","import { RefObject } from 'react';\nimport { useState, useCallback, useEffect } from '../lib/teact/teact';\n\nexport default (\n elementRef: RefObject,\n isOpen: boolean,\n onSelectWithEnter?: (index: number) => void,\n itemSelector?: string,\n noCaptureFocus?: boolean,\n) => {\n const [focusedIndex, setFocusedIndex] = useState(-1);\n\n useEffect(() => {\n setFocusedIndex(-1);\n\n const element = elementRef.current;\n if (isOpen && element && !noCaptureFocus) {\n element.tabIndex = -1;\n element.focus();\n }\n }, [elementRef, isOpen, noCaptureFocus]);\n\n const handleKeyDown = useCallback((e: React.KeyboardEvent) => {\n const element = elementRef.current;\n\n if (!element) {\n return;\n }\n\n if (e.keyCode === 13 && onSelectWithEnter) {\n onSelectWithEnter(focusedIndex);\n return;\n }\n\n if (e.keyCode !== 38 && e.keyCode !== 40) {\n return;\n }\n\n const focusedElement = document.activeElement;\n const elementChildren = Array.from(itemSelector ? element.querySelectorAll(itemSelector) : element.children);\n\n let newIndex = (focusedElement && elementChildren.indexOf(focusedElement)) || focusedIndex;\n\n if (e.keyCode === 38 && newIndex > 0) {\n newIndex--;\n } else if (e.keyCode === 40 && newIndex < elementChildren.length - 1) {\n newIndex++;\n } else if (elementChildren.length === 1) {\n newIndex = 0;\n } else {\n return;\n }\n\n const item = elementChildren[newIndex] as HTMLElement;\n if (item) {\n setFocusedIndex(newIndex);\n item.focus();\n }\n }, [elementRef, onSelectWithEnter, itemSelector, focusedIndex]);\n\n return handleKeyDown;\n};\n","import * as langProvider from '../util/langProvider';\nimport useForceUpdate from './useForceUpdate';\nimport useOnChange from './useOnChange';\n\nexport type LangFn = typeof langProvider.getTranslation;\n\nexport default (): LangFn => {\n const forceUpdate = useForceUpdate();\n\n useOnChange(() => {\n return langProvider.addCallback(forceUpdate);\n }, [forceUpdate]);\n\n return langProvider.getTranslation;\n};\n","import { useEffect } from '../lib/teact/teact';\n\nimport {\n BundleModules, Bundles, getModuleFromMemory, loadModule, addLoadListener,\n} from '../util/moduleLoader';\n\nimport useForceUpdate from './useForceUpdate';\n\nexport default >(\n bundleName: B, moduleName: M, noLoad = false, autoUpdate = false,\n) => {\n const module = getModuleFromMemory(bundleName, moduleName);\n const forceUpdate = useForceUpdate();\n\n if (autoUpdate) {\n // Use effect and cleanup for listener removal\n addLoadListener(forceUpdate);\n }\n\n useEffect(() => {\n if (!noLoad && !module) {\n loadModule(bundleName, moduleName).then(forceUpdate);\n }\n }, [bundleName, forceUpdate, module, moduleName, noLoad]);\n\n return module;\n};\n","import usePrevious from './usePrevious';\n\nexport default (cb: (args: PT) => void, dependencies: T) => {\n const prevDeps = usePrevious(dependencies);\n if (!prevDeps || dependencies.some((d, i) => d !== prevDeps[i])) {\n // @ts-ignore (workaround for \"could be instantiated with a different subtype\" issue)\n cb(prevDeps || []);\n }\n};\n","import { useRef } from '../lib/teact/teact';\n\nfunction usePrevious(next: T): T | undefined;\nfunction usePrevious(next: T, shouldSkipUndefined: true): Exclude | undefined;\nfunction usePrevious(next: T, shouldSkipUndefined?: boolean): Exclude | undefined;\nfunction usePrevious(next: T, shouldSkipUndefined?: boolean) {\n const ref = useRef();\n const { current } = ref;\n if (!shouldSkipUndefined || next !== undefined) {\n ref.current = next;\n }\n\n return current;\n}\n\nexport default usePrevious;\n","import { useRef, useState } from '../lib/teact/teact';\nimport buildClassName from '../util/buildClassName';\n\nconst CLOSE_DURATION = 350;\n\nexport default (\n isOpen = false,\n onCloseTransitionEnd?: () => void,\n noOpenTransition = false,\n className: string | false = 'fast',\n noCloseTransition = false,\n) => {\n const [isClosed, setIsClosed] = useState(!isOpen);\n const closeTimeoutRef = useRef();\n // СSS class should be added in a separate tick to turn on CSS transition.\n const [hasOpenClassName, setHasOpenClassName] = useState(isOpen && noOpenTransition);\n\n if (isOpen) {\n setIsClosed(false);\n setHasOpenClassName(true);\n\n if (closeTimeoutRef.current) {\n window.clearTimeout(closeTimeoutRef.current);\n closeTimeoutRef.current = undefined;\n }\n } else {\n setHasOpenClassName(false);\n\n if (!isClosed && !closeTimeoutRef.current) {\n closeTimeoutRef.current = window.setTimeout(() => {\n setIsClosed(true);\n\n if (onCloseTransitionEnd) {\n onCloseTransitionEnd();\n }\n\n closeTimeoutRef.current = undefined;\n }, noCloseTransition ? 0 : CLOSE_DURATION);\n }\n }\n\n // `noCloseTransition`, when set to true, should remove the open class immediately\n const shouldHaveOpenClassName = hasOpenClassName && !(noCloseTransition && !isOpen);\n const isClosing = Boolean(closeTimeoutRef.current);\n const shouldRender = isOpen || isClosing;\n const transitionClassNames = buildClassName(\n className && 'opacity-transition',\n className,\n shouldHaveOpenClassName && 'open',\n shouldRender && 'shown',\n isClosing && 'closing',\n );\n\n return {\n shouldRender,\n transitionClassNames,\n };\n};\n","import { RefObject } from 'react';\nimport { useEffect } from '../lib/teact/teact';\n\nconst BACKDROP_CLASSNAME = 'backdrop';\n\n// This effect implements closing menus by clicking outside of them\n// without adding extra elements to the DOM\nexport default function useVirtualBackdrop(\n isOpen: boolean,\n menuRef: RefObject,\n onClose?: () => void | undefined,\n) {\n useEffect(() => {\n const handleEvent = (e: Event) => {\n const menu = menuRef.current;\n const target = e.target as HTMLElement | null;\n if (!menu || !target) {\n return;\n }\n\n if (\n !menu.contains(e.target as Node | null)\n || target.classList.contains(BACKDROP_CLASSNAME)\n ) {\n e.preventDefault();\n e.stopPropagation();\n if (onClose) {\n onClose();\n }\n }\n };\n\n if (isOpen && onClose) {\n document.addEventListener('mousedown', handleEvent);\n }\n\n return () => {\n document.removeEventListener('mousedown', handleEvent);\n };\n }, [isOpen, menuRef, onClose]);\n}\n","import { DEBUG } from '../../config';\n\ntype Handler = (e: Event) => void;\n\nconst NON_BUBBLEABLE_EVENTS = new Set(['scroll', 'mouseenter', 'mouseleave']);\n\nconst delegationRegistry: Record> = {};\nconst delegatedEventsByElement = new Map>();\nconst documentEventCounters: Record = {};\n\nexport function addEventListener(element: HTMLElement, propName: string, handler: Handler, asCapture = false) {\n const eventName = resolveEventName(propName, element);\n if (canUseEventDelegation(eventName, element, asCapture)) {\n addDelegatedListener(eventName, element, handler);\n } else {\n element.addEventListener(eventName, handler, asCapture);\n }\n}\n\nexport function removeEventListener(element: HTMLElement, propName: string, handler: Handler, asCapture = false) {\n const eventName = resolveEventName(propName, element);\n if (canUseEventDelegation(eventName, element, asCapture)) {\n removeDelegatedListener(eventName, element);\n } else {\n element.removeEventListener(eventName, handler, asCapture);\n }\n}\n\nfunction resolveEventName(propName: string, element: HTMLElement) {\n const eventName = propName\n .replace(/^on/, '')\n .replace(/Capture$/, '').toLowerCase();\n\n if (eventName === 'change' && element.tagName !== 'SELECT') {\n // React behavior repeated here.\n // https://stackoverflow.com/questions/38256332/in-react-whats-the-difference-between-onchange-and-oninput\n return 'input';\n }\n\n if (eventName === 'doubleclick') {\n return 'dblclick';\n }\n\n // Replace focus/blur by their \"bubbleable\" versions\n if (eventName === 'focus') {\n return 'focusin';\n }\n\n if (eventName === 'blur') {\n return 'focusout';\n }\n\n return eventName;\n}\n\nfunction canUseEventDelegation(realEventName: string, element: HTMLElement, asCapture: boolean) {\n return (\n !asCapture\n && !NON_BUBBLEABLE_EVENTS.has(realEventName)\n && element.tagName !== 'VIDEO'\n && element.tagName !== 'IFRAME'\n );\n}\n\nfunction addDelegatedListener(eventName: string, element: HTMLElement, handler: Handler) {\n if (!documentEventCounters[eventName]) {\n documentEventCounters[eventName] = 0;\n document.addEventListener(eventName, handleEvent);\n }\n\n resolveDelegationRegistryForName(eventName).set(element, handler);\n resolveDelegatedEventsForElement(element).add(eventName);\n documentEventCounters[eventName]++;\n}\n\nfunction removeDelegatedListener(eventName: string, element: HTMLElement) {\n documentEventCounters[eventName]--;\n if (!documentEventCounters[eventName]) {\n // Synchronous deletion on 0 will cause perf degradation in the case of 1 element\n // which is not a real case, so it's ok to do it this way\n document.removeEventListener(eventName, handleEvent);\n }\n\n delegationRegistry[eventName].delete(element);\n delegatedEventsByElement.get(element)!.delete(eventName);\n}\n\nexport function removeAllDelegatedListeners(element: HTMLElement) {\n const eventNames = delegatedEventsByElement.get(element);\n if (!eventNames) {\n return;\n }\n\n eventNames.forEach((eventName) => removeDelegatedListener(eventName, element));\n delegatedEventsByElement.delete(element);\n}\n\nfunction handleEvent(realEvent: Event) {\n const events = delegationRegistry[realEvent.type];\n\n if (events) {\n let furtherCallsPrevented = false;\n let current: HTMLElement = realEvent.target as HTMLElement;\n\n const stopPropagation = () => {\n furtherCallsPrevented = true;\n };\n\n const preventDefault = () => {\n realEvent.preventDefault();\n };\n\n // Proxy is a simplest way to provide an access to the event property\n const event = new Proxy(realEvent, {\n get(target, p) {\n if (p === 'currentTarget') {\n return current;\n }\n if (p === 'stopPropagation' || p === 'stopImmediatePropagation') {\n return stopPropagation;\n }\n if (p === 'preventDefault') {\n // \"this\" is changed to proxy and one can't call methods via it\n return preventDefault;\n }\n return Reflect.get(target, p);\n },\n });\n\n // This can also be limited by teact root\n while (current && current !== document.body) {\n const handler = events.get(current);\n if (handler) {\n handler(event);\n if (furtherCallsPrevented) {\n return;\n }\n }\n\n current = current.parentNode as HTMLElement;\n }\n }\n}\n\nfunction resolveDelegationRegistryForName(eventName: string) {\n if (!delegationRegistry[eventName]) {\n delegationRegistry[eventName] = new Map();\n }\n\n return delegationRegistry[eventName];\n}\n\nfunction resolveDelegatedEventsForElement(element: HTMLElement) {\n const existing = delegatedEventsByElement.get(element);\n if (existing) {\n return existing;\n }\n\n const newSet = new Set();\n delegatedEventsByElement.set(element, newSet);\n\n return newSet;\n}\n\nif (DEBUG) {\n document.addEventListener('dblclick', () => {\n // eslint-disable-next-line no-console\n console.log('DELEGATED EVENTS', { delegationRegistry, delegatedEventsByElement, documentEventCounters });\n });\n}\n","import {\n hasElementChanged,\n isComponentElement,\n isEmptyElement,\n isRealElement,\n isTextElement,\n mountComponent,\n renderComponent,\n unmountTree,\n getTarget,\n setTarget,\n VirtualElement,\n VirtualElementComponent,\n VirtualRealElement,\n} from './teact';\nimport generateIdFor from '../../util/generateIdFor';\nimport { DEBUG } from '../../config';\nimport { addEventListener, removeEventListener } from './dom-events';\n\ntype VirtualDomHead = {\n children: [VirtualElement] | [];\n};\n\nconst FILTERED_ATTRIBUTES = new Set(['key', 'ref', 'teactFastList', 'teactOrderKey']);\nconst HTML_ATTRIBUTES = new Set(['dir']);\nconst MAPPED_ATTRIBUTES: { [k: string]: string } = {\n autoPlay: 'autoplay',\n autoComplete: 'autocomplete',\n};\nconst INDEX_KEY_PREFIX = '__indexKey#';\n\nconst headsByElement: Record = {};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nlet DEBUG_virtualTreeSize = 1;\n\nfunction render($element?: VirtualElement, parentEl?: HTMLElement | null) {\n if (!parentEl) {\n return undefined;\n }\n\n let headId = parentEl.getAttribute('data-teact-head-id');\n if (!headId) {\n headId = generateIdFor(headsByElement);\n headsByElement[headId] = { children: [] };\n parentEl.setAttribute('data-teact-head-id', headId);\n }\n\n const $head = headsByElement[headId];\n $head.children = [renderWithVirtual(parentEl, $head.children[0], $element, $head, 0) as VirtualElement];\n\n if (process.env.APP_ENV === 'perf') {\n DEBUG_virtualTreeSize = 0;\n DEBUG_addToVirtualTreeSize($head);\n\n return DEBUG_virtualTreeSize;\n }\n\n return undefined;\n}\n\nfunction renderWithVirtual(\n parentEl: HTMLElement,\n $current: VirtualElement | undefined,\n $new: VirtualElement | undefined,\n $parent: VirtualRealElement | VirtualDomHead,\n index: number,\n {\n skipComponentUpdate = false,\n forceIndex = false,\n fragment,\n moveDirection,\n }: {\n skipComponentUpdate?: boolean;\n forceIndex?: boolean;\n fragment?: DocumentFragment;\n moveDirection?: 'up' | 'down';\n } = {},\n) {\n if (\n !skipComponentUpdate\n && $current && $new\n && isComponentElement($current) && isComponentElement($new)\n && !hasElementChanged($current, $new)\n ) {\n $new = updateComponent($current, $new);\n }\n\n // Parent element may have changed, so we need to update the listener closure.\n if (!skipComponentUpdate && $new && isComponentElement($new) && $new.componentInstance.isMounted) {\n setupComponentUpdateListener($new, $parent, index, parentEl);\n }\n\n if ($current === $new) {\n return $new;\n }\n\n if (!$current && $new) {\n if (isComponentElement($new)) {\n $new = initComponent($new, $parent, index, parentEl);\n }\n\n const node = createNode($new);\n setTarget($new, node);\n\n if (forceIndex && parentEl.childNodes[index]) {\n parentEl.insertBefore(node, parentEl.childNodes[index]);\n } else {\n (fragment || parentEl).appendChild(node);\n }\n } else if ($current && !$new) {\n parentEl.removeChild(getTarget($current)!);\n unmountTree($current);\n } else if ($current && $new) {\n if (hasElementChanged($current, $new)) {\n if (isComponentElement($new)) {\n $new = initComponent($new, $parent, index, parentEl);\n }\n\n const node = createNode($new);\n setTarget($new, node);\n parentEl.replaceChild(node, getTarget($current)!);\n unmountTree($current);\n } else {\n const areComponents = isComponentElement($current) && isComponentElement($new);\n\n if (!areComponents) {\n setTarget($new, getTarget($current)!);\n }\n\n if (isRealElement($current) && isRealElement($new)) {\n if (moveDirection) {\n const node = getTarget($current)!;\n const nextSibling = parentEl.childNodes[moveDirection === 'up' ? index : index + 1];\n\n if (nextSibling) {\n parentEl.insertBefore(node, nextSibling);\n } else {\n (fragment || parentEl).appendChild(node);\n }\n }\n\n if (!areComponents) {\n updateAttributes($current, $new, getTarget($current) as HTMLElement);\n }\n\n $new.children = renderChildren(\n $current,\n $new,\n areComponents ? parentEl : getTarget($current) as HTMLElement,\n );\n }\n }\n }\n\n return $new;\n}\n\nfunction initComponent(\n $element: VirtualElementComponent, $parent: VirtualRealElement | VirtualDomHead, index: number, parentEl: HTMLElement,\n) {\n if (!isComponentElement($element)) {\n return $element;\n }\n\n const { componentInstance } = $element;\n\n if (!componentInstance.isMounted) {\n $element = mountComponent(componentInstance);\n setupComponentUpdateListener($element, $parent, index, parentEl);\n\n const $firstChild = $element.children[0];\n if (isComponentElement($firstChild)) {\n $element.children = [initComponent($firstChild, $element, 0, parentEl)];\n }\n\n componentInstance.isMounted = true;\n }\n\n return $element;\n}\n\nfunction updateComponent($current: VirtualElementComponent, $new: VirtualElementComponent) {\n $current.componentInstance.props = $new.componentInstance.props;\n\n return renderComponent($current.componentInstance);\n}\n\nfunction setupComponentUpdateListener(\n $element: VirtualElementComponent, $parent: VirtualRealElement | VirtualDomHead, index: number, parentEl: HTMLElement,\n) {\n const { componentInstance } = $element;\n\n componentInstance.onUpdate = () => {\n $parent.children[index] = renderWithVirtual(\n parentEl,\n $parent.children[index],\n componentInstance.$element,\n $parent,\n index,\n { skipComponentUpdate: true },\n ) as VirtualElementComponent;\n };\n}\n\nfunction createNode($element: VirtualElement): Node {\n if (isEmptyElement($element)) {\n return document.createTextNode('');\n }\n\n if (isTextElement($element)) {\n return document.createTextNode($element.value);\n }\n\n if (isComponentElement($element)) {\n return createNode($element.children[0] as VirtualElement);\n }\n\n const { tag, props, children = [] } = $element;\n const element = document.createElement(tag);\n\n if (typeof props.ref === 'object') {\n props.ref.current = element;\n }\n\n Object.keys(props).forEach((key) => {\n addAttribute(element, key, props[key]);\n });\n\n $element.children = children.map(($child, i) => (\n renderWithVirtual(element, undefined, $child, $element, i) as VirtualElement\n ));\n\n return element;\n}\n\nfunction renderChildren(\n $current: VirtualRealElement, $new: VirtualRealElement, currentEl: HTMLElement,\n) {\n if ($new.props.teactFastList) {\n return renderFastListChildren($current, $new, currentEl);\n }\n\n const maxLength = Math.max($current.children.length, $new.children.length);\n const newChildren = [];\n const fragment = $new.children.length > $current.children.length + 1 ? document.createDocumentFragment() : undefined;\n\n for (let i = 0; i < maxLength; i++) {\n const $newChild = renderWithVirtual(\n currentEl,\n $current.children[i],\n $new.children[i],\n $new,\n i,\n i >= $current.children.length ? { fragment } : undefined,\n );\n\n if ($newChild) {\n newChildren.push($newChild);\n }\n }\n\n if (fragment) {\n currentEl.appendChild(fragment);\n }\n\n return newChildren;\n}\n\nfunction renderFastListChildren($current: VirtualRealElement, $new: VirtualRealElement, currentEl: HTMLElement) {\n const newKeys = new Set(\n $new.children.map(($newChild) => {\n const key = 'props' in $newChild && $newChild.props.key;\n\n if (DEBUG && isRealElement($newChild) && !key) {\n // eslint-disable-next-line no-console\n console.warn('Missing `key` in `teactFastList`');\n }\n\n return key;\n }),\n );\n\n let currentRemainingIndex = 0;\n const remainingByKey = $current.children\n .reduce((acc, $currentChild, i) => {\n let key = 'props' in $currentChild ? $currentChild.props.key : undefined;\n\n // First we handle removed children\n if (key && !newKeys.has(key)) {\n renderWithVirtual(currentEl, $currentChild, undefined, $new, -1);\n\n return acc;\n } else if (!key) {\n const $newChild = $new.children[i];\n const newChildKey = ($newChild && 'props' in $newChild) ? $newChild.props.key : undefined;\n // If a non-key element remains at the same index we preserve it with a virtual `key`\n if ($newChild && !newChildKey) {\n key = `${INDEX_KEY_PREFIX}${i}`;\n } else {\n renderWithVirtual(currentEl, $currentChild, undefined, $new, -1);\n\n return acc;\n }\n }\n\n // Then we build up info about remaining children\n acc[key] = {\n $element: $currentChild,\n index: currentRemainingIndex++,\n order: 'props' in $currentChild ? $currentChild.props.teactOrderKey : undefined,\n };\n return acc;\n }, {} as Record);\n\n let newChildren: VirtualElement[] = [];\n\n let fragmentQueue: VirtualElement[] | undefined;\n let fragmentIndex: number | undefined;\n\n let currentPreservedIndex = 0;\n\n $new.children.forEach(($newChild, i) => {\n const key = 'props' in $newChild ? $newChild.props.key : `${INDEX_KEY_PREFIX}${i}`;\n const currentChildInfo = remainingByKey[key];\n\n if (!currentChildInfo) {\n // All new nodes are queued to be inserted with fragments if possible.\n if (!fragmentQueue) {\n fragmentQueue = [];\n fragmentIndex = i;\n }\n\n fragmentQueue.push($newChild);\n return;\n }\n\n if (fragmentQueue) {\n newChildren = newChildren.concat(flushFragmentQueue(fragmentQueue, fragmentIndex!, currentEl, $new));\n fragmentIndex = undefined;\n fragmentQueue = undefined;\n }\n\n // This is a \"magic\" `teactOrderKey` property that tells us the element is updated\n const order = 'props' in $newChild ? $newChild.props.teactOrderKey : undefined;\n const shouldMoveNode = currentChildInfo.index !== currentPreservedIndex && currentChildInfo.order !== order;\n const isMovingDown = shouldMoveNode && currentPreservedIndex > currentChildInfo.index;\n\n // When the node goes down, preserved indexing actually breaks, so the \"magic\" should help.\n if (!shouldMoveNode || isMovingDown) {\n currentPreservedIndex++;\n }\n\n newChildren.push(\n renderWithVirtual(currentEl, currentChildInfo.$element, $newChild, $new, i, {\n forceIndex: true,\n ...(shouldMoveNode && {\n moveDirection: isMovingDown ? 'down' : 'up',\n }),\n })!,\n );\n });\n\n if (fragmentQueue) {\n newChildren = newChildren.concat(flushFragmentQueue(fragmentQueue, fragmentIndex!, currentEl, $new));\n }\n\n return newChildren;\n}\n\nfunction flushFragmentQueue(\n fragmentQueue: VirtualElement[], fragmentIndex: number, parentEl: HTMLElement, $parent: VirtualRealElement,\n) {\n if (fragmentQueue.length === 1) {\n return [renderWithVirtual(parentEl, undefined, fragmentQueue[0], $parent, fragmentIndex, { forceIndex: true })!];\n } else if (fragmentQueue.length > 1) {\n const fragment = document.createDocumentFragment();\n const newChildren = fragmentQueue.map(($fragmentChild) => (\n renderWithVirtual(parentEl, undefined, $fragmentChild, $parent, fragmentIndex!, { fragment })!\n ));\n\n if (parentEl.childNodes[fragmentIndex]) {\n parentEl.insertBefore(fragment, parentEl.childNodes[fragmentIndex]);\n } else {\n parentEl.appendChild(fragment);\n }\n\n return newChildren;\n }\n\n throw new Error('Unexpected input');\n}\n\nfunction updateAttributes($current: VirtualRealElement, $new: VirtualRealElement, element: HTMLElement) {\n const currentKeys = Object.keys($current.props);\n const newKeys = Object.keys($new.props);\n\n currentKeys.forEach((key) => {\n if ($current.props[key] !== undefined && $new.props[key] === undefined) {\n removeAttribute(element, key, $current.props[key]);\n }\n });\n\n newKeys.forEach((key) => {\n if ($new.props[key] === undefined) {\n return;\n }\n\n if ($current.props[key] !== $new.props[key]) {\n if ($current.props[key] === undefined) {\n addAttribute(element, key, $new.props[key]);\n } else {\n updateAttribute(element, key, $current.props[key], $new.props[key]);\n }\n }\n });\n}\n\nfunction addAttribute(element: HTMLElement, key: string, value: any) {\n if (value === undefined) {\n return;\n }\n\n // An optimization attempt\n if (key === 'className') {\n element.className = value;\n // An optimization attempt\n } else if (key === 'value') {\n (element as HTMLInputElement).value = value;\n } else if (key === 'style') {\n element.style.cssText = value;\n } else if (key.startsWith('on')) {\n addEventListener(element, key, value, key.endsWith('Capture'));\n } else if (key.startsWith('data-') || HTML_ATTRIBUTES.has(key)) {\n element.setAttribute(key, value);\n } else if (!FILTERED_ATTRIBUTES.has(key)) {\n (element as any)[MAPPED_ATTRIBUTES[key] || key] = value;\n }\n}\n\nfunction removeAttribute(element: HTMLElement, key: string, value: any) {\n if (key === 'className') {\n element.className = '';\n } else if (key === 'value') {\n (element as HTMLInputElement).value = '';\n } else if (key === 'style') {\n element.style.cssText = '';\n } else if (key.startsWith('on')) {\n removeEventListener(element, key, value, key.endsWith('Capture'));\n } else if (key.startsWith('data-') || HTML_ATTRIBUTES.has(key)) {\n element.removeAttribute(key);\n } else if (!FILTERED_ATTRIBUTES.has(key)) {\n delete (element as any)[MAPPED_ATTRIBUTES[key] || key];\n }\n}\n\nfunction updateAttribute(element: HTMLElement, key: string, oldValue: any, newValue: any) {\n if (key === 'value') {\n // Removing and adding value causes a cursor jump\n (element as HTMLInputElement).value = newValue !== undefined ? newValue : '';\n } else {\n removeAttribute(element, key, oldValue);\n addAttribute(element, key, newValue);\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction DEBUG_addToVirtualTreeSize($current: VirtualRealElement | VirtualDomHead) {\n DEBUG_virtualTreeSize += $current.children.length;\n\n $current.children.forEach(($child) => {\n if (isRealElement($child)) {\n DEBUG_addToVirtualTreeSize($child);\n }\n });\n}\n\nexport default { render };\n","import { DEBUG, DEBUG_MORE } from '../../config';\nimport {\n fastRaf, onTickEnd, throttleWithPrimaryRaf, throttleWithRaf,\n} from '../../util/schedulers';\nimport { flatten, orderBy } from '../../util/iteratees';\nimport arePropsShallowEqual, { getUnequalProps } from '../../util/arePropsShallowEqual';\nimport { handleError } from '../../util/handleError';\nimport { removeAllDelegatedListeners } from './dom-events';\n\nexport type Props = AnyLiteral;\nexport type FC

= (props: P) => any;\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport type FC_withDebug =\n FC\n & {\n DEBUG_contentComponentName?: string;\n };\n\nexport enum VirtualElementTypesEnum {\n Empty,\n Text,\n Tag,\n Component,\n}\n\ninterface VirtualElementEmpty {\n type: VirtualElementTypesEnum.Empty;\n target?: Node;\n}\n\ninterface VirtualElementText {\n type: VirtualElementTypesEnum.Text;\n target?: Node;\n value: string;\n}\n\nexport interface VirtualElementTag {\n type: VirtualElementTypesEnum.Tag;\n target?: Node;\n tag: string;\n props: Props;\n children: VirtualElementChildren;\n}\n\nexport interface VirtualElementComponent {\n type: VirtualElementTypesEnum.Component;\n componentInstance: ComponentInstance;\n props: Props;\n children: VirtualElementChildren;\n}\n\nexport type StateHookSetter = (newValue: ((current: T) => T) | T) => void;\n\ninterface ComponentInstance {\n $element: VirtualElementComponent;\n Component: FC;\n name: string;\n props: Props;\n renderedValue?: any;\n isMounted: boolean;\n hooks: {\n state: {\n cursor: number;\n byCursor: {\n value: any;\n nextValue: any;\n setter: StateHookSetter;\n }[];\n };\n effects: {\n cursor: number;\n byCursor: {\n effect: () => void;\n dependencies?: any[];\n cleanup?: Function;\n }[];\n };\n memos: {\n cursor: number;\n byCursor: {\n current: any;\n dependencies: any[];\n }[];\n };\n };\n prepareForFrame?: () => void;\n forceUpdate?: () => void;\n onUpdate?: () => void;\n}\n\nexport type VirtualElement =\n VirtualElementEmpty\n | VirtualElementText\n | VirtualElementTag\n | VirtualElementComponent;\nexport type VirtualRealElement =\n VirtualElementTag\n | VirtualElementComponent;\nexport type VirtualElementChildren = VirtualElement[];\n\nconst Fragment = Symbol('Fragment');\n\nlet renderingInstance: ComponentInstance;\n\nexport function isEmptyElement($element: VirtualElement): $element is VirtualElementEmpty {\n return $element.type === VirtualElementTypesEnum.Empty;\n}\n\nexport function isTextElement($element: VirtualElement): $element is VirtualElementText {\n return $element.type === VirtualElementTypesEnum.Text;\n}\n\nexport function isTagElement($element: VirtualElement): $element is VirtualElementTag {\n return $element.type === VirtualElementTypesEnum.Tag;\n}\n\nexport function isComponentElement($element: VirtualElement): $element is VirtualElementComponent {\n return $element.type === VirtualElementTypesEnum.Component;\n}\n\nexport function isRealElement($element: VirtualElement): $element is VirtualRealElement {\n return isTagElement($element) || isComponentElement($element);\n}\n\nfunction createElement(\n source: string | FC | typeof Fragment,\n props: Props,\n ...children: any[]\n): VirtualRealElement | VirtualElementChildren {\n if (!props) {\n props = {};\n }\n\n children = flatten(children);\n\n if (source === Fragment) {\n return children;\n } else if (typeof source === 'function') {\n return createComponentInstance(source, props, children);\n } else {\n return buildTagElement(source, props, children);\n }\n}\n\nfunction createComponentInstance(Component: FC, props: Props, children: any[]): VirtualElementComponent {\n let parsedChildren: any | any[] | undefined;\n if (children.length === 0) {\n parsedChildren = undefined;\n } else if (children.length === 1) {\n [parsedChildren] = children;\n } else {\n parsedChildren = children;\n }\n\n const componentInstance: ComponentInstance = {\n $element: {} as VirtualElementComponent,\n Component,\n name: Component.name,\n props: {\n ...props,\n ...(parsedChildren && { children: parsedChildren }),\n },\n isMounted: false,\n hooks: {\n state: {\n cursor: 0,\n byCursor: [],\n },\n effects: {\n cursor: 0,\n byCursor: [],\n },\n memos: {\n cursor: 0,\n byCursor: [],\n },\n },\n };\n\n componentInstance.$element = buildComponentElement(componentInstance);\n\n return componentInstance.$element;\n}\n\nfunction buildComponentElement(\n componentInstance: ComponentInstance,\n children: VirtualElementChildren = [],\n): VirtualElementComponent {\n const { props } = componentInstance;\n\n return {\n componentInstance,\n type: VirtualElementTypesEnum.Component,\n props,\n children,\n };\n}\n\nfunction buildTagElement(tag: string, props: Props, children: any[]): VirtualElementTag {\n return {\n type: VirtualElementTypesEnum.Tag,\n tag,\n props,\n children: dropEmptyTail(children).map(buildChildElement),\n };\n}\n\n// We only need placeholders in the middle of collection (to ensure other elements order).\nfunction dropEmptyTail(children: any[]) {\n let i = children.length - 1;\n\n for (; i >= 0; i--) {\n if (!isEmptyPlaceholder(children[i])) {\n break;\n }\n }\n\n return i + 1 < children.length ? children.slice(0, i + 1) : children;\n}\n\nfunction isEmptyPlaceholder(child: any) {\n // eslint-disable-next-line no-null/no-null\n return child === false || child === null || child === undefined;\n}\n\nfunction buildChildElement(child: any): VirtualElement {\n if (isEmptyPlaceholder(child)) {\n return buildEmptyElement();\n } else if (isRealElement(child)) {\n return child;\n } else {\n return buildTextElement(child);\n }\n}\n\nfunction buildTextElement(value: any): VirtualElementText {\n return {\n type: VirtualElementTypesEnum.Text,\n value: String(value),\n };\n}\n\nfunction buildEmptyElement(): VirtualElementEmpty {\n return { type: VirtualElementTypesEnum.Empty };\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst DEBUG_components: AnyLiteral = {};\n\ndocument.addEventListener('dblclick', () => {\n // eslint-disable-next-line no-console\n console.log('COMPONENTS', orderBy(Object.values(DEBUG_components), 'renderCount', 'desc'));\n});\n\nexport function renderComponent(componentInstance: ComponentInstance) {\n renderingInstance = componentInstance;\n componentInstance.hooks.state.cursor = 0;\n componentInstance.hooks.effects.cursor = 0;\n componentInstance.hooks.memos.cursor = 0;\n\n const { Component, props } = componentInstance;\n let newRenderedValue;\n\n try {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n let DEBUG_startAt: number | undefined;\n if (DEBUG) {\n const componentName = componentInstance.name;\n if (!DEBUG_components[componentName]) {\n DEBUG_components[componentName] = {\n componentName,\n renderCount: 0,\n renderTimes: [],\n };\n }\n\n if (DEBUG_MORE) {\n if (componentName !== 'TeactMemoWrapper' && componentName !== 'TeactNContainer') {\n // eslint-disable-next-line no-console\n console.log(`[Teact] Render ${componentName}`);\n }\n }\n\n DEBUG_startAt = performance.now();\n }\n\n newRenderedValue = Component(props);\n\n if (DEBUG) {\n const renderTime = performance.now() - DEBUG_startAt!;\n const componentName = componentInstance.name;\n if (renderTime > 7) {\n // eslint-disable-next-line no-console\n console.warn(`[Teact] Slow component render: ${componentName}, ${Math.round(renderTime)} ms`);\n }\n DEBUG_components[componentName].renderTimes.push(renderTime);\n DEBUG_components[componentName].renderCount++;\n }\n } catch (err) {\n handleError(err);\n\n newRenderedValue = componentInstance.renderedValue;\n }\n\n if (componentInstance.isMounted && newRenderedValue === componentInstance.renderedValue) {\n return componentInstance.$element;\n }\n\n componentInstance.renderedValue = newRenderedValue;\n\n const newChild = buildChildElement(newRenderedValue);\n componentInstance.$element = buildComponentElement(componentInstance, [newChild]);\n\n return componentInstance.$element;\n}\n\nexport function hasElementChanged($old: VirtualElement, $new: VirtualElement) {\n if (typeof $old !== typeof $new) {\n return true;\n } else if ($old.type !== $new.type) {\n return true;\n } else if (isTextElement($old) && isTextElement($new)) {\n return $old.value !== $new.value;\n } else if (isTagElement($old) && isTagElement($new)) {\n return ($old.tag !== $new.tag) || ($old.props.key !== $new.props.key);\n } else if (isComponentElement($old) && isComponentElement($new)) {\n return (\n $old.componentInstance.Component !== $new.componentInstance.Component\n ) || (\n $old.props.key !== $new.props.key\n );\n }\n\n return false;\n}\n\nexport function unmountTree($element: VirtualElement) {\n if (!isRealElement($element)) {\n return;\n }\n\n if (isComponentElement($element)) {\n unmountComponent($element.componentInstance);\n } else if ($element.target) {\n removeAllDelegatedListeners($element.target as HTMLElement);\n // Trying to help GC\n // eslint-disable-next-line no-null/no-null\n $element.target = null as any;\n }\n\n $element.children.forEach(unmountTree);\n}\n\nexport function mountComponent(componentInstance: ComponentInstance) {\n renderComponent(componentInstance);\n componentInstance.isMounted = true;\n return componentInstance.$element;\n}\n\nfunction unmountComponent(componentInstance: ComponentInstance) {\n if (!componentInstance.isMounted) {\n return;\n }\n\n componentInstance.hooks.memos.byCursor.forEach((hook) => {\n // eslint-disable-next-line no-null/no-null\n hook.current = null;\n });\n\n componentInstance.hooks.effects.byCursor.forEach(({ cleanup }) => {\n if (typeof cleanup === 'function') {\n try {\n cleanup();\n } catch (err) {\n handleError(err);\n }\n }\n });\n\n componentInstance.isMounted = false;\n\n helpGc(componentInstance);\n}\n\n// We need to remove all references to DOM objects. We also clean all other references, just in case.\nfunction helpGc(componentInstance: ComponentInstance) {\n /* eslint-disable no-null/no-null */\n\n componentInstance.hooks.effects.byCursor.forEach((hook) => {\n hook.cleanup = null as any;\n hook.effect = null as any;\n hook.dependencies = null as any;\n });\n\n componentInstance.hooks.state.byCursor.forEach((hook) => {\n hook.value = null as any;\n hook.nextValue = null as any;\n hook.setter = null as any;\n });\n\n componentInstance.hooks.memos.byCursor.forEach((hook) => {\n hook.dependencies = null as any;\n });\n\n componentInstance.hooks = null as any;\n componentInstance.$element = null as any;\n componentInstance.renderedValue = null as any;\n componentInstance.Component = null as any;\n componentInstance.props = null as any;\n componentInstance.forceUpdate = null as any;\n componentInstance.onUpdate = null as any;\n\n /* eslint-enable no-null/no-null */\n}\n\nfunction prepareComponentForFrame(componentInstance: ComponentInstance) {\n if (!componentInstance.isMounted) {\n return;\n }\n\n componentInstance.hooks.state.byCursor.forEach((hook) => {\n hook.value = hook.nextValue;\n });\n\n componentInstance.prepareForFrame = throttleWithPrimaryRaf(() => prepareComponentForFrame(componentInstance));\n componentInstance.forceUpdate = throttleWithRaf(() => forceUpdateComponent(componentInstance));\n}\n\nfunction forceUpdateComponent(componentInstance: ComponentInstance) {\n if (!componentInstance.isMounted || !componentInstance.onUpdate) {\n return;\n }\n\n const currentElement = componentInstance.$element;\n\n renderComponent(componentInstance);\n\n if (componentInstance.$element !== currentElement) {\n componentInstance.onUpdate();\n }\n}\n\nexport function getTarget($element: VirtualElement): Node | undefined {\n if (isComponentElement($element)) {\n return getTarget($element.children[0]);\n } else {\n return $element.target;\n }\n}\n\nexport function setTarget($element: VirtualElement, target: Node) {\n if (isComponentElement($element)) {\n setTarget($element.children[0], target);\n } else {\n $element.target = target;\n }\n}\n\nexport function useState(initial?: T): [T, StateHookSetter] {\n const { cursor, byCursor } = renderingInstance.hooks.state;\n\n if (byCursor[cursor] === undefined) {\n byCursor[cursor] = {\n value: initial,\n nextValue: initial,\n setter: ((componentInstance) => (newValue: ((current: T) => T) | T) => {\n if (byCursor[cursor].nextValue !== newValue) {\n byCursor[cursor].nextValue = typeof newValue === 'function'\n ? (newValue as (current: T) => T)(byCursor[cursor].value)\n : newValue;\n\n if (!componentInstance.prepareForFrame || !componentInstance.forceUpdate) {\n componentInstance.prepareForFrame = throttleWithPrimaryRaf(\n () => prepareComponentForFrame(componentInstance),\n );\n componentInstance.forceUpdate = throttleWithRaf(\n () => forceUpdateComponent(componentInstance),\n );\n }\n\n componentInstance.prepareForFrame();\n componentInstance.forceUpdate();\n\n if (DEBUG_MORE) {\n if (componentInstance.name !== 'TeactNContainer') {\n // eslint-disable-next-line no-console\n console.log(\n '[Teact.useState]',\n componentInstance.name,\n // `componentInstance.Component` may be set to `null` by GC helper\n componentInstance.Component && (componentInstance.Component as FC_withDebug).DEBUG_contentComponentName\n ? `> ${(componentInstance.Component as FC_withDebug).DEBUG_contentComponentName}`\n : '',\n `Forced update at cursor #${cursor}, next value: `,\n byCursor[cursor].nextValue,\n );\n }\n }\n }\n })(renderingInstance),\n };\n }\n\n renderingInstance.hooks.state.cursor++;\n\n return [\n byCursor[cursor].value,\n byCursor[cursor].setter,\n ];\n}\n\nfunction useLayoutEffectBase(\n schedulerFn: typeof onTickEnd | typeof requestAnimationFrame,\n effect: () => Function | void,\n dependencies?: any[],\n debugKey?: string,\n) {\n const { cursor, byCursor } = renderingInstance.hooks.effects;\n const componentInstance = renderingInstance;\n\n const exec = () => {\n if (!componentInstance.isMounted) {\n return;\n }\n\n const { cleanup } = byCursor[cursor];\n if (typeof cleanup === 'function') {\n try {\n cleanup();\n } catch (err) {\n handleError(err);\n }\n }\n\n byCursor[cursor].cleanup = effect() as Function;\n };\n\n if (byCursor[cursor] !== undefined && dependencies && byCursor[cursor].dependencies) {\n if (dependencies.some((dependency, i) => dependency !== byCursor[cursor].dependencies![i])) {\n if (debugKey) {\n const causedBy = dependencies.reduce((res, newValue, i) => {\n const prevValue = byCursor[cursor].dependencies![i];\n if (newValue !== prevValue) {\n res.push(`${i}: ${prevValue} => ${newValue}`);\n }\n\n return res;\n }, []);\n\n // eslint-disable-next-line no-console\n console.log(\n '[Teact]',\n debugKey,\n 'Effect caused by dependencies.',\n causedBy.join(', '),\n );\n }\n\n schedulerFn(exec);\n }\n } else {\n schedulerFn(exec);\n }\n\n byCursor[cursor] = {\n effect,\n dependencies,\n cleanup: byCursor[cursor] ? byCursor[cursor].cleanup : undefined,\n };\n\n renderingInstance.hooks.effects.cursor++;\n}\n\nexport function useEffect(effect: () => Function | void, dependencies?: any[], debugKey?: string) {\n return useLayoutEffectBase(fastRaf, effect, dependencies, debugKey);\n}\n\nexport function useLayoutEffect(effect: () => Function | void, dependencies?: any[], debugKey?: string) {\n return useLayoutEffectBase(onTickEnd, effect, dependencies, debugKey);\n}\n\nexport function useMemo(resolver: () => T, dependencies: any[], debugKey?: string): T {\n const { cursor, byCursor } = renderingInstance.hooks.memos;\n let { current } = byCursor[cursor] || {};\n\n if (\n byCursor[cursor] === undefined\n || dependencies.some((dependency, i) => dependency !== byCursor[cursor].dependencies[i])\n ) {\n if (DEBUG && debugKey) {\n // eslint-disable-next-line no-console\n console.log(\n `[Teact.useMemo] ${renderingInstance.name} (${debugKey}): Update is caused by:`,\n byCursor[cursor]\n ? getUnequalProps(dependencies, byCursor[cursor].dependencies).join(', ')\n : '[first render]',\n );\n }\n\n current = resolver();\n }\n\n byCursor[cursor] = {\n current,\n dependencies,\n };\n\n renderingInstance.hooks.memos.cursor++;\n\n return current;\n}\n\nexport function useCallback(newCallback: F, dependencies: any[]): F {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => newCallback, dependencies);\n}\n\nexport function useRef(initial: T): { current: T };\nexport function useRef(): { current: T | undefined }; // TT way (empty is `undefined`)\nexport function useRef(initial: null): { current: T | null }; // React way (empty is `null`)\n// eslint-disable-next-line no-null/no-null\nexport function useRef(initial?: T | null) {\n return useMemo(() => ({\n current: initial,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), []);\n}\n\nexport function memo(Component: T, areEqual = arePropsShallowEqual, debugKey?: string) {\n return function TeactMemoWrapper(props: Props) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const propsRef = useRef(props);\n const renderedRef = useRef();\n\n if (!renderedRef.current || (propsRef.current && !areEqual(propsRef.current, props))) {\n if (DEBUG && debugKey) {\n // eslint-disable-next-line no-console\n console.log(\n `[Teact.memo] ${Component.name} (${debugKey}): Update is caused by:`,\n getUnequalProps(propsRef.current!, props).join(', '),\n );\n }\n\n propsRef.current = props;\n renderedRef.current = createElement(Component, props) as VirtualElementComponent;\n }\n\n return renderedRef.current;\n } as T;\n}\n\n// We need to keep it here for JSX.\nexport default {\n createElement,\n Fragment,\n};\n","import React, {\n FC, FC_withDebug, Props, useEffect, useState,\n} from './teact';\n\nimport { DEBUG, DEBUG_MORE } from '../../config';\nimport useForceUpdate from '../../hooks/useForceUpdate';\nimport generateIdFor from '../../util/generateIdFor';\nimport { throttleWithRaf } from '../../util/schedulers';\nimport arePropsShallowEqual, { getUnequalProps } from '../../util/arePropsShallowEqual';\nimport { orderBy } from '../../util/iteratees';\nimport { GlobalState, GlobalActions, ActionTypes } from '../../global/types';\nimport { handleError } from '../../util/handleError';\n\nexport default React;\n\ntype ActionPayload = AnyLiteral;\n\ntype Reducer = (\n global: GlobalState,\n actions: GlobalActions,\n payload: any,\n) => GlobalState | void;\n\ntype MapStateToProps = ((global: GlobalState, ownProps: OwnProps) => AnyLiteral | null);\ntype MapActionsToProps = ((setGlobal: Function, actions: GlobalActions) => Partial | null);\n\nlet currentGlobal = {} as GlobalState;\n\nconst reducers: Record = {};\nconst callbacks: Function[] = [updateContainers];\nconst actions = {} as GlobalActions;\nconst containers = new Map;\n mapReducersToProps: MapActionsToProps;\n ownProps: Props;\n mappedProps?: Props;\n forceUpdate: Function;\n areMappedPropsChanged: boolean;\n DEBUG_updates: number;\n DEBUG_componentName: string;\n}>();\n\nfunction runCallbacks() {\n callbacks.forEach((cb) => cb(currentGlobal));\n}\n\nconst runCallbacksThrottled = throttleWithRaf(runCallbacks);\n\n// `noThrottle = true` is used as a workaround for iOS gesture history navigation\nexport function setGlobal(newGlobal?: GlobalState, noThrottle = false) {\n if (typeof newGlobal === 'object' && newGlobal !== currentGlobal) {\n currentGlobal = newGlobal;\n if (!noThrottle) {\n runCallbacksThrottled();\n } else {\n runCallbacks();\n }\n }\n}\n\nexport function getGlobal() {\n return currentGlobal;\n}\n\nexport function getDispatch() {\n return actions;\n}\n\nfunction onDispatch(name: string, payload?: ActionPayload, noThrottle?: boolean) {\n if (reducers[name]) {\n reducers[name].forEach((reducer) => {\n const newGlobal = reducer(currentGlobal, actions, payload);\n if (newGlobal) {\n setGlobal(newGlobal, noThrottle);\n }\n });\n }\n}\n\nfunction updateContainers() {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n let DEBUG_startAt: number | undefined;\n if (DEBUG) {\n DEBUG_startAt = performance.now();\n }\n\n // eslint-disable-next-line no-restricted-syntax\n for (const container of containers.values()) {\n const {\n mapStateToProps, mapReducersToProps, ownProps, mappedProps, forceUpdate,\n } = container;\n\n let newMappedProps;\n\n try {\n newMappedProps = {\n ...mapStateToProps(currentGlobal, ownProps),\n ...mapReducersToProps(setGlobal, actions),\n };\n } catch (err) {\n handleError(err);\n\n return;\n }\n\n if (DEBUG) {\n if (Object.values(newMappedProps).some(Number.isNaN)) {\n // eslint-disable-next-line no-console\n console.warn(\n // eslint-disable-next-line max-len\n `[TeactN] Some of \\`${container.DEBUG_componentName}\\` mappers contain NaN values. This may cause redundant updates because of incorrect equality check.`,\n );\n }\n }\n\n if (Object.keys(newMappedProps).length && !arePropsShallowEqual(mappedProps!, newMappedProps)) {\n if (DEBUG_MORE) {\n // eslint-disable-next-line no-console\n console.log(\n '[TeactN] Will update',\n container.DEBUG_componentName,\n 'caused by',\n getUnequalProps(mappedProps!, newMappedProps).join(', '),\n );\n }\n\n container.mappedProps = newMappedProps;\n container.areMappedPropsChanged = true;\n container.DEBUG_updates++;\n\n forceUpdate();\n }\n }\n\n if (DEBUG) {\n const updateTime = performance.now() - DEBUG_startAt!;\n if (updateTime > 7) {\n // eslint-disable-next-line no-console\n console.warn(`[TeactN] Slow containers update: ${Math.round(updateTime)} ms`);\n }\n }\n}\n\nexport function addReducer(name: ActionTypes, reducer: Reducer) {\n if (!reducers[name]) {\n reducers[name] = [];\n\n actions[name] = (payload?: ActionPayload, noThrottle = false) => {\n onDispatch(name, payload, noThrottle);\n };\n }\n\n reducers[name].push(reducer);\n}\n\nexport function addCallback(cb: Function) {\n callbacks.push(cb);\n}\n\nexport function removeCallback(cb: Function) {\n const index = callbacks.indexOf(cb);\n if (index !== -1) {\n callbacks.splice(index, 1);\n }\n}\n\nexport function withGlobal(\n mapStateToProps: MapStateToProps = () => ({}),\n mapReducersToProps: MapActionsToProps = () => ({}),\n) {\n return (Component: FC) => {\n return function TeactNContainer(props: OwnProps) {\n (TeactNContainer as FC_withDebug).DEBUG_contentComponentName = Component.name;\n\n const [id] = useState(generateIdFor(containers));\n const forceUpdate = useForceUpdate();\n\n useEffect(() => {\n return () => {\n containers.delete(id);\n };\n }, [id]);\n\n let container = containers.get(id);\n if (!container) {\n container = {\n mapStateToProps,\n mapReducersToProps,\n ownProps: props,\n areMappedPropsChanged: false,\n forceUpdate,\n DEBUG_updates: 0,\n DEBUG_componentName: Component.name,\n };\n\n containers.set(id, container);\n }\n\n if (container.areMappedPropsChanged) {\n container.areMappedPropsChanged = false;\n }\n\n if (!container.mappedProps || !arePropsShallowEqual(container.ownProps, props)) {\n container.ownProps = props;\n\n try {\n container.mappedProps = {\n ...mapStateToProps(currentGlobal, props),\n ...mapReducersToProps(setGlobal, actions),\n };\n } catch (err) {\n handleError(err);\n }\n }\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return ;\n };\n };\n}\n\nif (DEBUG) {\n (window as any).getGlobal = getGlobal;\n\n document.addEventListener('dblclick', () => {\n // eslint-disable-next-line no-console\n console.log(\n 'GLOBAL CONTAINERS',\n orderBy(\n Array.from(containers.values())\n .map(({ DEBUG_componentName, DEBUG_updates }) => ({ DEBUG_componentName, DEBUG_updates })),\n 'DEBUG_updates',\n 'desc',\n ),\n );\n });\n}\n","// Copyright Twitter Inc. Licensed under MIT\n// https://github.com/twitter/twemoji-parser/blob/master/LICENSE.md\n// Version 2c193ce 28.05.2021\n\nconst vs16RegExp = /\\uFE0F/g;\n// avoid using a string literal like '\\u200D' here because minifiers expand it inline\nconst zeroWidthJoiner = String.fromCharCode(0x200d);\n\nexport function removeVS16s(rawEmoji) {\n return rawEmoji.indexOf(zeroWidthJoiner) < 0 ? rawEmoji.replace(vs16RegExp, '') : rawEmoji;\n}\n\n// This file is generated by source/emoji/scripts/generate.sh\n// eslint-disable-next-line max-len\nexport default /(?:\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d[\\udc68\\udc69]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1|\\ud83d\\udc6b\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6c\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6d\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc8f\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc91\\ud83c[\\udffb-\\udfff]|\\ud83d[\\udc6b-\\udc6d\\udc8f\\udc91])|(?:\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1)(?:\\ud83c[\\udffb-\\udfff])?\\u200d(?:\\u2695\\ufe0f|\\u2696\\ufe0f|\\u2708\\ufe0f|\\ud83c[\\udf3e\\udf73\\udf7c\\udf84\\udf93\\udfa4\\udfa8\\udfeb\\udfed]|\\ud83d[\\udcbb\\udcbc\\udd27\\udd2c\\ude80\\ude92]|\\ud83e[\\uddaf-\\uddb3\\uddbc\\uddbd])|(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75]|\\u26f9)((?:\\ud83c[\\udffb-\\udfff]|\\ufe0f)\\u200d[\\u2640\\u2642]\\ufe0f)|(?:\\ud83c[\\udfc3\\udfc4\\udfca]|\\ud83d[\\udc6e\\udc70\\udc71\\udc73\\udc77\\udc81\\udc82\\udc86\\udc87\\ude45-\\ude47\\ude4b\\ude4d\\ude4e\\udea3\\udeb4-\\udeb6]|\\ud83e[\\udd26\\udd35\\udd37-\\udd39\\udd3d\\udd3e\\uddb8\\uddb9\\uddcd-\\uddcf\\uddd4\\uddd6-\\udddd])(?:\\ud83c[\\udffb-\\udfff])?\\u200d[\\u2640\\u2642]\\ufe0f|(?:\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83c\\udff3\\ufe0f\\u200d\\u26a7\\ufe0f|\\ud83c\\udff3\\ufe0f\\u200d\\ud83c\\udf08|\\ud83d\\ude36\\u200d\\ud83c\\udf2b\\ufe0f|\\u2764\\ufe0f\\u200d\\ud83d\\udd25|\\u2764\\ufe0f\\u200d\\ud83e\\ude79|\\ud83c\\udff4\\u200d\\u2620\\ufe0f|\\ud83d\\udc15\\u200d\\ud83e\\uddba|\\ud83d\\udc3b\\u200d\\u2744\\ufe0f|\\ud83d\\udc41\\u200d\\ud83d\\udde8|\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc6f\\u200d\\u2640\\ufe0f|\\ud83d\\udc6f\\u200d\\u2642\\ufe0f|\\ud83d\\ude2e\\u200d\\ud83d\\udca8|\\ud83d\\ude35\\u200d\\ud83d\\udcab|\\ud83e\\udd3c\\u200d\\u2640\\ufe0f|\\ud83e\\udd3c\\u200d\\u2642\\ufe0f|\\ud83e\\uddde\\u200d\\u2640\\ufe0f|\\ud83e\\uddde\\u200d\\u2642\\ufe0f|\\ud83e\\udddf\\u200d\\u2640\\ufe0f|\\ud83e\\udddf\\u200d\\u2642\\ufe0f|\\ud83d\\udc08\\u200d\\u2b1b)|[#*0-9]\\ufe0f?\\u20e3|(?:[©®\\u2122\\u265f]\\ufe0f)|(?:\\ud83c[\\udc04\\udd70\\udd71\\udd7e\\udd7f\\ude02\\ude1a\\ude2f\\ude37\\udf21\\udf24-\\udf2c\\udf36\\udf7d\\udf96\\udf97\\udf99-\\udf9b\\udf9e\\udf9f\\udfcd\\udfce\\udfd4-\\udfdf\\udff3\\udff5\\udff7]|\\ud83d[\\udc3f\\udc41\\udcfd\\udd49\\udd4a\\udd6f\\udd70\\udd73\\udd76-\\udd79\\udd87\\udd8a-\\udd8d\\udda5\\udda8\\uddb1\\uddb2\\uddbc\\uddc2-\\uddc4\\uddd1-\\uddd3\\udddc-\\uddde\\udde1\\udde3\\udde8\\uddef\\uddf3\\uddfa\\udecb\\udecd-\\udecf\\udee0-\\udee5\\udee9\\udef0\\udef3]|[\\u203c\\u2049\\u2139\\u2194-\\u2199\\u21a9\\u21aa\\u231a\\u231b\\u2328\\u23cf\\u23ed-\\u23ef\\u23f1\\u23f2\\u23f8-\\u23fa\\u24c2\\u25aa\\u25ab\\u25b6\\u25c0\\u25fb-\\u25fe\\u2600-\\u2604\\u260e\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262a\\u262e\\u262f\\u2638-\\u263a\\u2640\\u2642\\u2648-\\u2653\\u2660\\u2663\\u2665\\u2666\\u2668\\u267b\\u267f\\u2692-\\u2697\\u2699\\u269b\\u269c\\u26a0\\u26a1\\u26a7\\u26aa\\u26ab\\u26b0\\u26b1\\u26bd\\u26be\\u26c4\\u26c5\\u26c8\\u26cf\\u26d1\\u26d3\\u26d4\\u26e9\\u26ea\\u26f0-\\u26f5\\u26f8\\u26fa\\u26fd\\u2702\\u2708\\u2709\\u270f\\u2712\\u2714\\u2716\\u271d\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u2764\\u27a1\\u2934\\u2935\\u2b05-\\u2b07\\u2b1b\\u2b1c\\u2b50\\u2b55\\u3030\\u303d\\u3297\\u3299])(?:\\ufe0f|(?!\\ufe0e))|(?:(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75\\udd90]|[\\u261d\\u26f7\\u26f9\\u270c\\u270d])(?:\\ufe0f|(?!\\ufe0e))|(?:\\ud83c[\\udf85\\udfc2-\\udfc4\\udfc7\\udfca]|\\ud83d[\\udc42\\udc43\\udc46-\\udc50\\udc66-\\udc69\\udc6e\\udc70-\\udc78\\udc7c\\udc81-\\udc83\\udc85-\\udc87\\udcaa\\udd7a\\udd95\\udd96\\ude45-\\ude47\\ude4b-\\ude4f\\udea3\\udeb4-\\udeb6\\udec0\\udecc]|\\ud83e[\\udd0c\\udd0f\\udd18-\\udd1c\\udd1e\\udd1f\\udd26\\udd30-\\udd39\\udd3d\\udd3e\\udd77\\uddb5\\uddb6\\uddb8\\uddb9\\uddbb\\uddcd-\\uddcf\\uddd1-\\udddd]|[\\u270a\\u270b]))(?:\\ud83c[\\udffb-\\udfff])?|(?:\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc65\\udb40\\udc6e\\udb40\\udc67\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc73\\udb40\\udc63\\udb40\\udc74\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc77\\udb40\\udc6c\\udb40\\udc73\\udb40\\udc7f|\\ud83c\\udde6\\ud83c[\\udde8-\\uddec\\uddee\\uddf1\\uddf2\\uddf4\\uddf6-\\uddfa\\uddfc\\uddfd\\uddff]|\\ud83c\\udde7\\ud83c[\\udde6\\udde7\\udde9-\\uddef\\uddf1-\\uddf4\\uddf6-\\uddf9\\uddfb\\uddfc\\uddfe\\uddff]|\\ud83c\\udde8\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\uddee\\uddf0-\\uddf5\\uddf7\\uddfa-\\uddff]|\\ud83c\\udde9\\ud83c[\\uddea\\uddec\\uddef\\uddf0\\uddf2\\uddf4\\uddff]|\\ud83c\\uddea\\ud83c[\\udde6\\udde8\\uddea\\uddec\\udded\\uddf7-\\uddfa]|\\ud83c\\uddeb\\ud83c[\\uddee-\\uddf0\\uddf2\\uddf4\\uddf7]|\\ud83c\\uddec\\ud83c[\\udde6\\udde7\\udde9-\\uddee\\uddf1-\\uddf3\\uddf5-\\uddfa\\uddfc\\uddfe]|\\ud83c\\udded\\ud83c[\\uddf0\\uddf2\\uddf3\\uddf7\\uddf9\\uddfa]|\\ud83c\\uddee\\ud83c[\\udde8-\\uddea\\uddf1-\\uddf4\\uddf6-\\uddf9]|\\ud83c\\uddef\\ud83c[\\uddea\\uddf2\\uddf4\\uddf5]|\\ud83c\\uddf0\\ud83c[\\uddea\\uddec-\\uddee\\uddf2\\uddf3\\uddf5\\uddf7\\uddfc\\uddfe\\uddff]|\\ud83c\\uddf1\\ud83c[\\udde6-\\udde8\\uddee\\uddf0\\uddf7-\\uddfb\\uddfe]|\\ud83c\\uddf2\\ud83c[\\udde6\\udde8-\\udded\\uddf0-\\uddff]|\\ud83c\\uddf3\\ud83c[\\udde6\\udde8\\uddea-\\uddec\\uddee\\uddf1\\uddf4\\uddf5\\uddf7\\uddfa\\uddff]|\\ud83c\\uddf4\\ud83c\\uddf2|\\ud83c\\uddf5\\ud83c[\\udde6\\uddea-\\udded\\uddf0-\\uddf3\\uddf7-\\uddf9\\uddfc\\uddfe]|\\ud83c\\uddf6\\ud83c\\udde6|\\ud83c\\uddf7\\ud83c[\\uddea\\uddf4\\uddf8\\uddfa\\uddfc]|\\ud83c\\uddf8\\ud83c[\\udde6-\\uddea\\uddec-\\uddf4\\uddf7-\\uddf9\\uddfb\\uddfd-\\uddff]|\\ud83c\\uddf9\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\udded\\uddef-\\uddf4\\uddf7\\uddf9\\uddfb\\uddfc\\uddff]|\\ud83c\\uddfa\\ud83c[\\udde6\\uddec\\uddf2\\uddf3\\uddf8\\uddfe\\uddff]|\\ud83c\\uddfb\\ud83c[\\udde6\\udde8\\uddea\\uddec\\uddee\\uddf3\\uddfa]|\\ud83c\\uddfc\\ud83c[\\uddeb\\uddf8]|\\ud83c\\uddfd\\ud83c\\uddf0|\\ud83c\\uddfe\\ud83c[\\uddea\\uddf9]|\\ud83c\\uddff\\ud83c[\\udde6\\uddf2\\uddfc]|\\ud83c[\\udccf\\udd8e\\udd91-\\udd9a\\udde6-\\uddff\\ude01\\ude32-\\ude36\\ude38-\\ude3a\\ude50\\ude51\\udf00-\\udf20\\udf2d-\\udf35\\udf37-\\udf7c\\udf7e-\\udf84\\udf86-\\udf93\\udfa0-\\udfc1\\udfc5\\udfc6\\udfc8\\udfc9\\udfcf-\\udfd3\\udfe0-\\udff0\\udff4\\udff8-\\udfff]|\\ud83d[\\udc00-\\udc3e\\udc40\\udc44\\udc45\\udc51-\\udc65\\udc6a\\udc6f\\udc79-\\udc7b\\udc7d-\\udc80\\udc84\\udc88-\\udc8e\\udc90\\udc92-\\udca9\\udcab-\\udcfc\\udcff-\\udd3d\\udd4b-\\udd4e\\udd50-\\udd67\\udda4\\uddfb-\\ude44\\ude48-\\ude4a\\ude80-\\udea2\\udea4-\\udeb3\\udeb7-\\udebf\\udec1-\\udec5\\uded0-\\uded2\\uded5-\\uded7\\udeeb\\udeec\\udef4-\\udefc\\udfe0-\\udfeb]|\\ud83e[\\udd0d\\udd0e\\udd10-\\udd17\\udd1d\\udd20-\\udd25\\udd27-\\udd2f\\udd3a\\udd3c\\udd3f-\\udd45\\udd47-\\udd76\\udd78\\udd7a-\\uddb4\\uddb7\\uddba\\uddbc-\\uddcb\\uddd0\\uddde-\\uddff\\ude70-\\ude74\\ude78-\\ude7a\\ude80-\\ude86\\ude90-\\udea8\\udeb0-\\udeb6\\udec0-\\udec2\\uded0-\\uded6]|[\\u23e9-\\u23ec\\u23f0\\u23f3\\u267e\\u26ce\\u2705\\u2728\\u274c\\u274e\\u2753-\\u2755\\u2795-\\u2797\\u27b0\\u27bf\\ue50a])|\\ufe0f/g;\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { initApi, callApi } from '../../../api/gramjs';\nimport { GlobalState } from '../../../global/types';\n\nimport {\n LANG_CACHE_NAME,\n CUSTOM_BG_CACHE_NAME,\n MEDIA_CACHE_NAME,\n MEDIA_CACHE_NAME_AVATARS,\n MEDIA_PROGRESSIVE_CACHE_NAME,\n IS_TEST,\n} from '../../../config';\nimport { PLATFORM_ENV } from '../../../util/environment';\nimport { unsubscribe } from '../../../util/notifications';\nimport * as cacheApi from '../../../util/cacheApi';\nimport { updateAppBadge } from '../../../util/appBadge';\nimport {\n storeSession,\n loadStoredSession,\n clearStoredSession,\n importLegacySession,\n clearLegacySessions,\n} from '../../../util/sessions';\nimport { forceWebsync } from '../../../util/websync';\n\naddReducer('initApi', (global: GlobalState, actions) => {\n (async () => {\n if (!IS_TEST) {\n await importLegacySession();\n void clearLegacySessions();\n }\n\n void initApi(actions.apiUpdate, {\n userAgent: navigator.userAgent,\n platform: PLATFORM_ENV,\n sessionData: loadStoredSession(),\n });\n })();\n});\n\naddReducer('setAuthPhoneNumber', (global, actions, payload) => {\n const { phoneNumber } = payload!;\n\n void callApi('provideAuthPhoneNumber', phoneNumber.replace(/[^\\d]/g, ''));\n\n return {\n ...global,\n authIsLoading: true,\n authError: undefined,\n };\n});\n\naddReducer('setAuthCode', (global, actions, payload) => {\n const { code } = payload!;\n\n void callApi('provideAuthCode', code);\n\n return {\n ...global,\n authIsLoading: true,\n authError: undefined,\n };\n});\n\naddReducer('setAuthPassword', (global, actions, payload) => {\n const { password } = payload!;\n\n void callApi('provideAuthPassword', password);\n\n return {\n ...global,\n authIsLoading: true,\n authError: undefined,\n };\n});\n\naddReducer('uploadProfilePhoto', (global, actions, payload) => {\n const { file } = payload!;\n\n void callApi('uploadProfilePhoto', file);\n});\n\naddReducer('signUp', (global, actions, payload) => {\n const { firstName, lastName } = payload!;\n\n void callApi('provideAuthRegistration', { firstName, lastName });\n\n return {\n ...global,\n authIsLoading: true,\n authError: undefined,\n };\n});\n\naddReducer('returnToAuthPhoneNumber', (global) => {\n void callApi('restartAuth');\n\n return {\n ...global,\n authError: undefined,\n };\n});\n\naddReducer('goToAuthQrCode', (global) => {\n void callApi('restartAuthWithQr');\n\n return {\n ...global,\n authIsLoadingQrCode: true,\n authError: undefined,\n };\n});\n\naddReducer('saveSession', (global, actions, payload) => {\n const { sessionData } = payload;\n\n if (sessionData) {\n storeSession(payload.sessionData, global.currentUserId);\n } else {\n clearStoredSession();\n }\n});\n\naddReducer('signOut', () => {\n (async () => {\n try {\n await unsubscribe();\n await callApi('destroy');\n await forceWebsync(false);\n } catch (err) {\n // Do nothing\n }\n\n getDispatch().reset();\n })();\n});\n\naddReducer('reset', () => {\n clearStoredSession();\n\n void cacheApi.clear(MEDIA_CACHE_NAME);\n void cacheApi.clear(MEDIA_CACHE_NAME_AVATARS);\n void cacheApi.clear(MEDIA_PROGRESSIVE_CACHE_NAME);\n void cacheApi.clear(CUSTOM_BG_CACHE_NAME);\n\n const langCachePrefix = LANG_CACHE_NAME.replace(/\\d+$/, '');\n const langCacheVersion = (LANG_CACHE_NAME.match(/\\d+$/) || [0])[0];\n for (let i = 0; i < langCacheVersion; i++) {\n void cacheApi.clear(`${langCachePrefix}${i === 0 ? '' : i}`);\n }\n\n void clearLegacySessions();\n\n updateAppBadge(0);\n\n getDispatch().init();\n});\n\naddReducer('disconnect', () => {\n (async () => {\n await callApi('disconnect');\n })();\n});\n\naddReducer('loadNearestCountry', (global) => {\n if (global.connectionState !== 'connectionStateReady') {\n return;\n }\n\n (async () => {\n const authNearestCountry = await callApi('fetchNearestCountry');\n\n setGlobal({\n ...getGlobal(),\n authNearestCountry,\n });\n })();\n});\n\naddReducer('loadCountryList', (global, actions, payload = {}) => {\n let { langCode } = payload;\n if (!langCode) langCode = global.settings.byKey.language;\n\n (async () => {\n const countryList = await callApi('fetchCountryList', { langCode });\n if (!countryList) return;\n\n setGlobal({\n ...getGlobal(),\n countryList,\n });\n })();\n});\n\naddReducer('setDeviceToken', (global, actions, deviceToken) => {\n setGlobal({\n ...global,\n push: {\n deviceToken,\n subscribedAt: Date.now(),\n },\n });\n});\n\naddReducer('deleteDeviceToken', (global) => {\n const newGlobal = { ...global };\n delete newGlobal.push;\n setGlobal(newGlobal);\n});\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\nimport {\n ApiPrivacyKey, PrivacyVisibility, ProfileEditProgress, IInputPrivacyRules, IInputPrivacyContact,\n UPLOADING_WALLPAPER_SLUG,\n} from '../../../types';\n\nimport { callApi } from '../../../api/gramjs';\nimport { buildCollectionByKey } from '../../../util/iteratees';\nimport { subscribe, unsubscribe } from '../../../util/notifications';\nimport { selectUser } from '../../selectors';\nimport {\n addUsers, addBlockedContact, updateChats, updateUser, removeBlockedContact, replaceSettings, updateNotifySettings,\n addNotifyExceptions,\n} from '../../reducers';\nimport { isChatPrivate } from '../../helpers';\n\naddReducer('updateProfile', (global, actions, payload) => {\n const {\n photo, firstName, lastName, bio: about, username,\n } = payload!;\n\n (async () => {\n const { currentUserId } = global;\n if (!currentUserId) {\n return;\n }\n\n setGlobal({\n ...getGlobal(),\n profileEdit: {\n progress: ProfileEditProgress.InProgress,\n },\n });\n\n if (photo) {\n await callApi('updateProfilePhoto', photo);\n }\n\n if (firstName || lastName || about) {\n const result = await callApi('updateProfile', { firstName, lastName, about });\n if (result) {\n global = getGlobal();\n const currentUser = currentUserId && selectUser(global, currentUserId);\n\n if (currentUser) {\n setGlobal(updateUser(\n global,\n currentUser.id,\n {\n firstName,\n lastName,\n fullInfo: {\n ...currentUser.fullInfo,\n bio: about,\n },\n },\n ));\n }\n }\n }\n\n if (username) {\n const result = await callApi('updateUsername', username);\n if (result && currentUserId) {\n setGlobal(updateUser(getGlobal(), currentUserId, { username }));\n }\n }\n\n setGlobal({\n ...getGlobal(),\n profileEdit: {\n progress: ProfileEditProgress.Complete,\n },\n });\n })();\n});\n\naddReducer('checkUsername', (global, actions, payload) => {\n const { username } = payload!;\n\n (async () => {\n // No need to check the username if profile update is already in progress\n if (global.profileEdit && global.profileEdit.progress === ProfileEditProgress.InProgress) {\n return;\n }\n\n setGlobal({\n ...global,\n profileEdit: {\n progress: global.profileEdit ? global.profileEdit.progress : ProfileEditProgress.Idle,\n isUsernameAvailable: undefined,\n },\n });\n\n const isUsernameAvailable = await callApi('checkUsername', username);\n\n global = getGlobal();\n setGlobal({\n ...global,\n profileEdit: {\n ...global.profileEdit!,\n isUsernameAvailable,\n },\n });\n })();\n});\n\naddReducer('loadWallpapers', () => {\n (async () => {\n const result = await callApi('fetchWallpapers', 0);\n if (!result) {\n return;\n }\n\n const global = getGlobal();\n setGlobal({\n ...global,\n settings: {\n ...global.settings,\n loadedWallpapers: result.wallpapers,\n },\n });\n })();\n});\n\naddReducer('uploadWallpaper', (global, actions, payload) => {\n const file = payload;\n const previewBlobUrl = URL.createObjectURL(file);\n\n setGlobal({\n ...global,\n settings: {\n ...global.settings,\n loadedWallpapers: [\n {\n slug: UPLOADING_WALLPAPER_SLUG,\n document: {\n fileName: '',\n size: file.size,\n mimeType: file.type,\n previewBlobUrl,\n },\n },\n ...(global.settings.loadedWallpapers || []),\n ],\n },\n });\n\n (async () => {\n const result = await callApi('uploadWallpaper', file);\n if (!result) {\n return;\n }\n\n const { wallpaper } = result;\n\n global = getGlobal();\n if (!global.settings.loadedWallpapers) {\n return;\n }\n\n const firstWallpaper = global.settings.loadedWallpapers[0];\n if (!firstWallpaper || firstWallpaper.slug !== UPLOADING_WALLPAPER_SLUG) {\n return;\n }\n\n const withLocalMedia = {\n ...wallpaper,\n document: {\n ...wallpaper.document,\n previewBlobUrl,\n },\n };\n\n setGlobal({\n ...global,\n settings: {\n ...global.settings,\n loadedWallpapers: [\n withLocalMedia,\n ...global.settings.loadedWallpapers.slice(1),\n ],\n },\n });\n })();\n});\n\naddReducer('loadBlockedContacts', () => {\n (async () => {\n const result = await callApi('fetchBlockedContacts');\n\n if (!result) {\n return;\n }\n\n let newGlobal = getGlobal();\n\n if (result.users?.length) {\n newGlobal = addUsers(newGlobal, buildCollectionByKey(result.users, 'id'));\n }\n if (result.chats?.length) {\n newGlobal = updateChats(newGlobal, buildCollectionByKey(result.chats, 'id'));\n }\n\n newGlobal = {\n ...newGlobal,\n blocked: {\n ...newGlobal.blocked,\n ids: [...(newGlobal.blocked.ids || []), ...result.blockedIds],\n totalCount: result.totalCount,\n },\n };\n\n setGlobal(newGlobal);\n })();\n});\n\naddReducer('blockContact', (global, actions, payload) => {\n const { contactId, accessHash } = payload!;\n\n (async () => {\n const result = await callApi('blockContact', contactId, accessHash);\n if (!result) {\n return;\n }\n\n const newGlobal = getGlobal();\n\n setGlobal(addBlockedContact(newGlobal, contactId));\n })();\n});\n\naddReducer('unblockContact', (global, actions, payload) => {\n const { contactId } = payload!;\n let accessHash: string | undefined;\n const isPrivate = isChatPrivate(contactId);\n\n if (isPrivate) {\n const user = selectUser(global, contactId);\n if (!user) {\n return;\n }\n\n accessHash = user.accessHash;\n }\n\n (async () => {\n const result = await callApi('unblockContact', contactId, accessHash);\n if (!result) {\n return;\n }\n\n const newGlobal = getGlobal();\n\n setGlobal(removeBlockedContact(newGlobal, contactId));\n })();\n});\n\naddReducer('loadAuthorizations', () => {\n (async () => {\n const result = await callApi('fetchAuthorizations');\n if (!result) {\n return;\n }\n\n setGlobal({\n ...getGlobal(),\n activeSessions: result,\n });\n })();\n});\n\naddReducer('terminateAuthorization', (global, actions, payload) => {\n const { hash } = payload!;\n\n (async () => {\n const result = await callApi('terminateAuthorization', hash);\n if (!result) {\n return;\n }\n\n const newGlobal = getGlobal();\n\n setGlobal({\n ...newGlobal,\n activeSessions: newGlobal.activeSessions.filter((session) => session.hash !== hash),\n });\n })();\n});\n\naddReducer('terminateAllAuthorizations', () => {\n (async () => {\n const result = await callApi('terminateAllAuthorizations');\n if (!result) {\n return;\n }\n\n const global = getGlobal();\n\n setGlobal({\n ...global,\n activeSessions: global.activeSessions.filter((session) => session.isCurrent),\n });\n })();\n});\n\naddReducer('loadNotificationExceptions', (global) => {\n const { serverTimeOffset } = global;\n\n (async () => {\n const result = await callApi('fetchNotificationExceptions', { serverTimeOffset });\n if (!result) {\n return;\n }\n\n setGlobal(addNotifyExceptions(getGlobal(), result));\n })();\n});\n\naddReducer('loadNotificationSettings', (global) => {\n const { serverTimeOffset } = global;\n (async () => {\n const result = await callApi('fetchNotificationSettings', {\n serverTimeOffset,\n });\n if (!result) {\n return;\n }\n\n setGlobal(replaceSettings(getGlobal(), result));\n })();\n});\n\naddReducer('updateNotificationSettings', (global, actions, payload) => {\n const { peerType, isSilent, shouldShowPreviews } = payload!;\n\n (async () => {\n const result = await callApi('updateNotificationSettings', peerType, { isSilent, shouldShowPreviews });\n\n if (!result) {\n return;\n }\n\n setGlobal(updateNotifySettings(getGlobal(), peerType, isSilent, shouldShowPreviews));\n })();\n});\n\naddReducer('updateWebNotificationSettings', (global, actions, payload) => {\n (async () => {\n setGlobal(replaceSettings(getGlobal(), payload));\n const newGlobal = getGlobal();\n const { hasPushNotifications, hasWebNotifications } = newGlobal.settings.byKey;\n if (hasWebNotifications && hasPushNotifications) {\n await subscribe();\n } else {\n await unsubscribe();\n }\n })();\n});\n\naddReducer('updateContactSignUpNotification', (global, actions, payload) => {\n const { isSilent } = payload!;\n\n (async () => {\n const result = await callApi('updateContactSignUpNotification', isSilent);\n if (!result) {\n return;\n }\n\n setGlobal(replaceSettings(getGlobal(), { hasContactJoinedNotifications: !isSilent }));\n })();\n});\n\naddReducer('loadLanguages', () => {\n (async () => {\n const result = await callApi('fetchLanguages');\n if (!result) {\n return;\n }\n\n setGlobal(replaceSettings(getGlobal(), { languages: result }));\n })();\n});\n\naddReducer('loadPrivacySettings', () => {\n (async () => {\n const [\n phoneNumberSettings, lastSeenSettings, profilePhotoSettings, forwardsSettings, chatInviteSettings,\n ] = await Promise.all([\n callApi('fetchPrivacySettings', 'phoneNumber'),\n callApi('fetchPrivacySettings', 'lastSeen'),\n callApi('fetchPrivacySettings', 'profilePhoto'),\n callApi('fetchPrivacySettings', 'forwards'),\n callApi('fetchPrivacySettings', 'chatInvite'),\n ]);\n\n if (\n !phoneNumberSettings || !lastSeenSettings || !profilePhotoSettings || !forwardsSettings || !chatInviteSettings\n ) {\n return;\n }\n\n const global = getGlobal();\n\n global.settings.privacy.phoneNumber = phoneNumberSettings;\n global.settings.privacy.lastSeen = lastSeenSettings;\n global.settings.privacy.profilePhoto = profilePhotoSettings;\n global.settings.privacy.forwards = forwardsSettings;\n global.settings.privacy.chatInvite = chatInviteSettings;\n\n setGlobal(global);\n })();\n});\n\naddReducer('setPrivacyVisibility', (global, actions, payload) => {\n const { privacyKey, visibility } = payload!;\n\n const {\n privacy: { [privacyKey as ApiPrivacyKey]: settings },\n } = global.settings;\n\n if (!settings) {\n return;\n }\n\n const rules = buildInputPrivacyRules(global, {\n visibility,\n allowedIds: [...settings.allowUserIds, ...settings.allowChatIds],\n deniedIds: [...settings.blockUserIds, ...settings.blockChatIds],\n });\n\n (async () => {\n const result = await callApi('setPrivacySettings', privacyKey, rules);\n\n if (result) {\n const newGlobal = getGlobal();\n\n newGlobal.settings.privacy[privacyKey as ApiPrivacyKey] = result;\n\n setGlobal(newGlobal);\n }\n })();\n});\n\naddReducer('setPrivacySettings', (global, actions, payload) => {\n const { privacyKey, isAllowList, contactsIds } = payload!;\n const {\n privacy: { [privacyKey as ApiPrivacyKey]: settings },\n } = global.settings;\n\n if (!settings) {\n return;\n }\n\n const rules = buildInputPrivacyRules(global, {\n visibility: settings.visibility,\n allowedIds: isAllowList ? contactsIds : [...settings.allowUserIds, ...settings.allowChatIds],\n deniedIds: !isAllowList ? contactsIds : [...settings.blockUserIds, ...settings.blockChatIds],\n });\n\n (async () => {\n const result = await callApi('setPrivacySettings', privacyKey, rules);\n\n if (result) {\n const newGlobal = getGlobal();\n\n newGlobal.settings.privacy[privacyKey as ApiPrivacyKey] = result;\n\n setGlobal(newGlobal);\n }\n })();\n});\n\nfunction buildInputPrivacyRules(global: GlobalState, {\n visibility,\n allowedIds,\n deniedIds,\n}: {\n visibility: PrivacyVisibility;\n allowedIds: number[];\n deniedIds: number[];\n}): IInputPrivacyRules {\n const {\n users: { byId: usersById },\n chats: { byId: chatsById },\n } = global;\n\n const rules: IInputPrivacyRules = {\n visibility,\n };\n let users: IInputPrivacyContact[];\n let chats: IInputPrivacyContact[];\n\n const collectUsers = (userId: number) => {\n if (!isChatPrivate(userId)) {\n return undefined;\n }\n const { id, accessHash } = usersById[userId] || {};\n if (!id) {\n return undefined;\n }\n\n return { id, accessHash };\n };\n\n const collectChats = (userId: number) => {\n if (isChatPrivate(userId)) {\n return undefined;\n }\n const chat = chatsById[userId];\n\n return chat ? { id: chat.id } : undefined;\n };\n\n if (visibility === 'contacts' || visibility === 'nobody') {\n users = allowedIds.map(collectUsers).filter(Boolean) as IInputPrivacyContact[];\n chats = allowedIds.map(collectChats).filter(Boolean) as IInputPrivacyContact[];\n\n if (users.length > 0) {\n rules.allowedUsers = users;\n }\n if (chats.length > 0) {\n rules.allowedChats = chats;\n }\n }\n\n if (visibility === 'everybody' || visibility === 'contacts') {\n users = deniedIds.map(collectUsers).filter(Boolean) as IInputPrivacyContact[];\n chats = deniedIds.map(collectChats).filter(Boolean) as IInputPrivacyContact[];\n\n if (users.length > 0) {\n rules.blockedUsers = users;\n }\n if (chats.length > 0) {\n rules.blockedChats = chats;\n }\n }\n\n return rules;\n}\n\naddReducer('updateIsOnline', (global, actions, payload) => {\n callApi('updateIsOnline', payload);\n});\n\naddReducer('loadContentSettings', () => {\n (async () => {\n const result = await callApi('fetchContentSettings');\n if (!result) return;\n\n setGlobal(replaceSettings(getGlobal(), result));\n })();\n});\n\naddReducer('updateContentSettings', (global, actions, payload) => {\n (async () => {\n setGlobal(replaceSettings(getGlobal(), { isSensitiveEnabled: payload }));\n\n const result = await callApi('updateContentSettings', payload);\n if (!result) {\n setGlobal(replaceSettings(getGlobal(), { isSensitiveEnabled: !payload }));\n }\n })();\n});\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport { GlobalState } from '../../../global/types';\n\nimport {\n ApiUpdate,\n ApiUpdateAuthorizationState,\n ApiUpdateAuthorizationError,\n ApiUpdateConnectionState,\n ApiUpdateSession,\n ApiUpdateCurrentUser, ApiUpdateServerTimeOffset,\n} from '../../../api/types';\nimport { DEBUG, SESSION_USER_KEY } from '../../../config';\nimport { subscribe } from '../../../util/notifications';\nimport { updateUser } from '../../reducers';\nimport { setLanguage } from '../../../util/langProvider';\nimport { selectNotifySettings } from '../../selectors';\nimport { forceWebsync } from '../../../util/websync';\nimport { getShippingError } from '../../../util/getReadableErrorText';\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n if (DEBUG) {\n if (update['@type'] !== 'updateUserStatus' && update['@type'] !== 'updateServerTimeOffset') {\n // eslint-disable-next-line no-console\n console.log('[GramJs] UPDATE', update['@type'], { update });\n }\n }\n\n switch (update['@type']) {\n case 'updateApiReady':\n onUpdateApiReady(global);\n break;\n\n case 'updateAuthorizationState':\n onUpdateAuthorizationState(update);\n break;\n\n case 'updateAuthorizationError':\n onUpdateAuthorizationError(update);\n break;\n\n case 'updateConnectionState':\n onUpdateConnectionState(update);\n break;\n\n case 'updateSession':\n onUpdateSession(update);\n break;\n\n case 'updateServerTimeOffset':\n onUpdateServerTimeOffset(update);\n break;\n\n case 'updateCurrentUser':\n onUpdateCurrentUser(update);\n break;\n\n case 'error': {\n if (update.error.message === 'SESSION_REVOKED') {\n actions.signOut();\n }\n\n const paymentShippingError = getShippingError(update.error);\n if (paymentShippingError) {\n actions.addPaymentError({ error: paymentShippingError });\n } else if (actions.showDialog) {\n actions.showDialog({ data: { ...update.error, hasErrorKey: true } });\n }\n\n break;\n }\n }\n});\n\nfunction onUpdateApiReady(global: GlobalState) {\n const { hasWebNotifications, hasPushNotifications } = selectNotifySettings(global);\n if (hasWebNotifications && hasPushNotifications) {\n void subscribe();\n }\n void setLanguage(global.settings.byKey.language);\n}\n\nfunction onUpdateAuthorizationState(update: ApiUpdateAuthorizationState) {\n let global = getGlobal();\n\n const wasAuthReady = global.authState === 'authorizationStateReady';\n const authState = update.authorizationState;\n\n setGlobal({\n ...global,\n authState,\n authIsLoading: false,\n });\n\n global = getGlobal();\n\n switch (authState) {\n case 'authorizationStateLoggingOut':\n void forceWebsync(false);\n\n setGlobal({\n ...global,\n isLoggingOut: true,\n });\n break;\n case 'authorizationStateWaitCode':\n setGlobal({\n ...global,\n authIsCodeViaApp: update.isCodeViaApp,\n });\n break;\n case 'authorizationStateWaitPassword':\n setGlobal({\n ...global,\n authHint: update.hint,\n });\n break;\n case 'authorizationStateWaitQrCode':\n setGlobal({\n ...global,\n authIsLoadingQrCode: false,\n authQrCode: update.qrCode,\n });\n break;\n case 'authorizationStateReady': {\n if (wasAuthReady) {\n break;\n }\n\n void forceWebsync(true);\n\n setGlobal({\n ...global,\n isLoggingOut: false,\n lastSyncTime: Date.now(),\n });\n\n break;\n }\n }\n}\n\nfunction onUpdateAuthorizationError(update: ApiUpdateAuthorizationError) {\n setGlobal({\n ...getGlobal(),\n authError: update.message,\n });\n}\n\nfunction onUpdateConnectionState(update: ApiUpdateConnectionState) {\n const { connectionState } = update;\n const global = getGlobal();\n\n setGlobal({\n ...global,\n connectionState,\n });\n\n if (connectionState === 'connectionStateReady' && global.authState === 'authorizationStateReady') {\n getDispatch().sync();\n } else if (connectionState === 'connectionStateBroken') {\n getDispatch().signOut();\n }\n}\n\nfunction onUpdateSession(update: ApiUpdateSession) {\n const { sessionData } = update;\n const { authRememberMe, authState } = getGlobal();\n const isEmpty = !sessionData || !sessionData.mainDcId;\n\n if (!authRememberMe || authState !== 'authorizationStateReady' || isEmpty) {\n return;\n }\n\n getDispatch().saveSession({ sessionData });\n}\n\nfunction onUpdateServerTimeOffset(update: ApiUpdateServerTimeOffset) {\n const global = getGlobal();\n\n if (global.serverTimeOffset === update.serverTimeOffset) {\n return;\n }\n\n setGlobal({\n ...global,\n serverTimeOffset: update.serverTimeOffset,\n });\n}\n\nfunction onUpdateCurrentUser(update: ApiUpdateCurrentUser) {\n const { currentUser } = update;\n\n setGlobal({\n ...updateUser(getGlobal(), currentUser.id, currentUser),\n currentUserId: currentUser.id,\n });\n\n updateSessionUserId(currentUser.id);\n}\n\nfunction updateSessionUserId(currentUserId: number) {\n const sessionUserAuth = localStorage.getItem(SESSION_USER_KEY);\n if (!sessionUserAuth) return;\n\n const userAuth = JSON.parse(sessionUserAuth);\n userAuth.id = currentUserId;\n\n localStorage.setItem(SESSION_USER_KEY, JSON.stringify(userAuth));\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\n\nimport { ANIMATION_LEVEL_MAX } from '../../../config';\nimport {\n IS_ANDROID, IS_IOS, IS_MAC_OS, IS_TOUCH_ENV,\n} from '../../../util/environment';\nimport { setLanguage } from '../../../util/langProvider';\nimport switchTheme from '../../../util/switchTheme';\nimport { selectTheme } from '../../selectors';\nimport { startWebsync } from '../../../util/websync';\n\nconst HISTORY_ANIMATION_DURATION = 450;\n\nsubscribeToSystemThemeChange();\n\naddReducer('init', (global) => {\n const { animationLevel, messageTextSize, language } = global.settings.byKey;\n const theme = selectTheme(global);\n\n void setLanguage(language, undefined, true);\n\n document.documentElement.style.setProperty(\n '--composer-text-size', `${Math.max(messageTextSize, IS_IOS ? 16 : 15)}px`,\n );\n document.documentElement.style.setProperty('--message-meta-height', `${Math.floor(messageTextSize * 1.3125)}px`);\n document.documentElement.style.setProperty('--message-text-size', `${messageTextSize}px`);\n document.documentElement.setAttribute('data-message-text-size', messageTextSize.toString());\n document.body.classList.add('initial');\n document.body.classList.add(`animation-level-${animationLevel}`);\n document.body.classList.add(IS_TOUCH_ENV ? 'is-touch-env' : 'is-pointer-env');\n switchTheme(theme, animationLevel === ANIMATION_LEVEL_MAX);\n startWebsync();\n\n if (IS_IOS) {\n document.body.classList.add('is-ios');\n } else if (IS_ANDROID) {\n document.body.classList.add('is-android');\n } else if (IS_MAC_OS) {\n document.body.classList.add('is-macos');\n }\n});\n\naddReducer('setIsUiReady', (global, actions, payload) => {\n const { uiReadyState } = payload!;\n\n if (uiReadyState === 2) {\n document.body.classList.remove('initial');\n }\n\n return {\n ...global,\n uiReadyState,\n };\n});\n\naddReducer('setAuthPhoneNumber', (global, actions, payload) => {\n const { phoneNumber } = payload!;\n\n return {\n ...global,\n authPhoneNumber: phoneNumber,\n };\n});\n\naddReducer('setAuthRememberMe', (global, actions, payload) => {\n return {\n ...global,\n authRememberMe: Boolean(payload),\n };\n});\n\naddReducer('clearAuthError', (global) => {\n return {\n ...global,\n authError: undefined,\n };\n});\n\naddReducer('disableHistoryAnimations', () => {\n setTimeout(() => {\n setGlobal({\n ...getGlobal(),\n shouldSkipHistoryAnimations: false,\n });\n document.body.classList.remove('no-animate');\n }, HISTORY_ANIMATION_DURATION);\n\n setGlobal({\n ...getGlobal(),\n shouldSkipHistoryAnimations: true,\n }, true);\n});\n\nfunction subscribeToSystemThemeChange() {\n function handleSystemThemeChange() {\n const currentThemeMatch = document.documentElement.className.match(/theme-(\\w+)/);\n const currentTheme = currentThemeMatch ? currentThemeMatch[1] : 'light';\n const global = getGlobal();\n const nextTheme = selectTheme(global);\n const { animationLevel } = global.settings.byKey;\n\n if (nextTheme !== currentTheme) {\n switchTheme(nextTheme, animationLevel === ANIMATION_LEVEL_MAX);\n // Force-update component containers\n setGlobal({ ...global });\n }\n }\n\n const mql = window.matchMedia('(prefers-color-scheme: dark)');\n if (typeof mql.addEventListener === 'function') {\n mql.addEventListener('change', handleSystemThemeChange);\n } else if (typeof mql.addListener === 'function') {\n mql.addListener(handleSystemThemeChange);\n }\n}\n","import { addReducer } from '../../../lib/teact/teactn';\nimport { ISettings, IThemeSettings, ThemeKey } from '../../../types';\nimport { replaceSettings, replaceThemeSettings } from '../../reducers';\n\naddReducer('setSettingOption', (global, actions, payload?: Partial) => {\n return replaceSettings(global, payload);\n});\n\naddReducer('setThemeSettings', (global, actions, payload: { theme: ThemeKey } & Partial) => {\n const { theme, ...settings } = payload;\n\n return replaceThemeSettings(global, theme, settings);\n});\n","import {\n ApiChat,\n ApiUser,\n ApiChatBannedRights,\n ApiChatAdminRights,\n ApiChatFolder,\n MAIN_THREAD_ID,\n} from '../../api/types';\n\nimport { NotifyException, NotifySettings } from '../../types';\nimport { LangFn } from '../../hooks/useLang';\n\nimport { ARCHIVED_FOLDER_ID } from '../../config';\nimport { orderBy } from '../../util/iteratees';\nimport { getUserFirstOrLastName } from './users';\nimport { formatDateToString, formatTime } from '../../util/dateFormat';\n\nconst FOREVER_BANNED_DATE = Date.now() / 1000 + 31622400; // 366 days\n\nconst VERIFIED_PRIORITY_BASE = 3e9;\nconst PINNED_PRIORITY_BASE = 3e8;\n\nexport function isChatPrivate(chatId: number) {\n return chatId > 0;\n}\n\nexport function isChatGroup(chat: ApiChat) {\n return isChatBasicGroup(chat) || isChatSuperGroup(chat);\n}\n\nexport function isChatBasicGroup(chat: ApiChat) {\n return chat.type === 'chatTypeBasicGroup';\n}\n\nexport function isChatSuperGroup(chat: ApiChat) {\n return chat.type === 'chatTypeSuperGroup';\n}\n\nexport function isChatChannel(chat: ApiChat) {\n return chat.type === 'chatTypeChannel';\n}\n\nexport function isCommonBoxChat(chat: ApiChat) {\n return chat.type === 'chatTypePrivate' || chat.type === 'chatTypeBasicGroup';\n}\n\nexport function getChatTypeString(chat: ApiChat) {\n switch (chat.type) {\n case 'chatTypePrivate':\n return 'PrivateChat';\n case 'chatTypeBasicGroup':\n case 'chatTypeSuperGroup':\n return 'AccDescrGroup';\n case 'chatTypeChannel':\n return 'AccDescrChannel';\n default:\n return 'Chat';\n }\n}\n\nexport function getPrivateChatUserId(chat: ApiChat) {\n if (chat.type !== 'chatTypePrivate' && chat.type !== 'chatTypeSecret') {\n return undefined;\n }\n return chat.id;\n}\n\n// TODO Get rid of `user`\nexport function getChatTitle(lang: LangFn, chat: ApiChat, user?: ApiUser, isSelf = false) {\n if (isSelf || (user && chat.id === user.id && user.isSelf)) {\n return lang('SavedMessages');\n }\n return chat.title || lang('HiddenName');\n}\n\nexport function getChatDescription(chat: ApiChat) {\n if (!chat.fullInfo) {\n return undefined;\n }\n return chat.fullInfo.about;\n}\n\nexport function getChatLink(chat: ApiChat) {\n const { username } = chat;\n if (username) {\n return `https://t.me/${username}`;\n }\n\n const { inviteLink } = chat.fullInfo || {};\n\n return inviteLink;\n}\n\nexport function getChatAvatarHash(\n owner: ApiChat | ApiUser,\n size: 'normal' | 'big' = 'normal',\n) {\n if (!owner.avatarHash) {\n return undefined;\n }\n\n switch (size) {\n case 'big':\n return `profile${owner.id}?${owner.avatarHash}`;\n default:\n return `avatar${owner.id}?${owner.avatarHash}`;\n }\n}\n\nexport function isChatSummaryOnly(chat: ApiChat) {\n return !chat.lastMessage;\n}\n\nexport function isChatAdmin(chat: ApiChat) {\n return Boolean(chat.adminRights);\n}\n\nexport function getHasAdminRight(chat: ApiChat, key: keyof ApiChatAdminRights) {\n return chat.adminRights ? chat.adminRights[key] : false;\n}\n\nexport function isUserRightBanned(chat: ApiChat, key: keyof ApiChatBannedRights) {\n return Boolean(\n (chat.currentUserBannedRights?.[key])\n || (chat.defaultBannedRights?.[key]),\n );\n}\n\nexport function getCanPostInChat(chat: ApiChat, threadId: number) {\n if (threadId !== MAIN_THREAD_ID) {\n return true;\n }\n\n if (chat.isRestricted || chat.migratedTo || chat.isNotJoined) {\n return false;\n }\n\n if (chat.isCreator) {\n return true;\n }\n\n if (isChatPrivate(chat.id)) {\n return true;\n }\n\n if (isChatChannel(chat)) {\n return getHasAdminRight(chat, 'postMessages');\n }\n\n return isChatAdmin(chat) || !isUserRightBanned(chat, 'sendMessages');\n}\n\nexport interface IAllowedAttachmentOptions {\n canAttachMedia: boolean;\n canAttachPolls: boolean;\n canSendStickers: boolean;\n canSendGifs: boolean;\n canAttachEmbedLinks: boolean;\n}\n\nexport function getAllowedAttachmentOptions(chat?: ApiChat, isChatWithBot = false): IAllowedAttachmentOptions {\n if (!chat) {\n return {\n canAttachMedia: false,\n canAttachPolls: false,\n canSendStickers: false,\n canSendGifs: false,\n canAttachEmbedLinks: false,\n };\n }\n\n const isAdmin = isChatAdmin(chat);\n\n return {\n canAttachMedia: isAdmin || !isUserRightBanned(chat, 'sendMedia'),\n canAttachPolls: (isAdmin || !isUserRightBanned(chat, 'sendPolls')) && (!isChatPrivate(chat.id) || isChatWithBot),\n canSendStickers: isAdmin || !isUserRightBanned(chat, 'sendStickers'),\n canSendGifs: isAdmin || !isUserRightBanned(chat, 'sendGifs'),\n canAttachEmbedLinks: isAdmin || !isUserRightBanned(chat, 'embedLinks'),\n };\n}\n\nexport function getMessageSendingRestrictionReason(\n lang: LangFn, currentUserBannedRights?: ApiChatBannedRights, defaultBannedRights?: ApiChatBannedRights,\n) {\n if (currentUserBannedRights?.sendMessages) {\n const { untilDate } = currentUserBannedRights;\n return untilDate && untilDate < FOREVER_BANNED_DATE\n ? lang(\n 'Channel.Persmission.Denied.SendMessages.Until',\n lang(\n 'formatDateAtTime',\n [formatDateToString(new Date(untilDate * 1000), lang.code), formatTime(untilDate * 1000)],\n ),\n )\n : lang('Channel.Persmission.Denied.SendMessages.Forever');\n }\n\n if (defaultBannedRights?.sendMessages) {\n return lang('Channel.Persmission.Denied.SendMessages.DefaultRestrictedText');\n }\n\n return undefined;\n}\n\nexport function getChatSlowModeOptions(chat?: ApiChat) {\n if (!chat || !chat.fullInfo) {\n return undefined;\n }\n\n return chat.fullInfo.slowMode;\n}\n\nexport function getChatOrder(chat: ApiChat) {\n return Math.max(\n chat.joinDate || 0,\n chat.draftDate || 0,\n chat.lastMessage ? chat.lastMessage.date : 0,\n );\n}\n\nexport function isChatArchived(chat: ApiChat) {\n return chat.folderId === ARCHIVED_FOLDER_ID;\n}\n\nexport function selectIsChatMuted(\n chat: ApiChat, notifySettings: NotifySettings, notifyExceptions: Record = [],\n) {\n // If this chat is in exceptions they take precedence\n if (notifyExceptions[chat.id] && notifyExceptions[chat.id].isMuted !== undefined) {\n return notifyExceptions[chat.id].isMuted;\n }\n\n return (\n chat.isMuted\n || (isChatPrivate(chat.id) && !notifySettings.hasPrivateChatsNotifications)\n || (isChatChannel(chat) && !notifySettings.hasBroadcastNotifications)\n || (isChatGroup(chat) && !notifySettings.hasGroupNotifications)\n );\n}\n\nexport function selectShouldShowMessagePreview(\n chat: ApiChat, notifySettings: NotifySettings, notifyExceptions: Record = [],\n) {\n const {\n hasPrivateChatsMessagePreview = true,\n hasBroadcastMessagePreview = true,\n hasGroupMessagePreview = true,\n } = notifySettings;\n // If this chat is in exceptions they take precedence\n if (notifyExceptions[chat.id] && notifyExceptions[chat.id].shouldShowPreviews !== undefined) {\n return notifyExceptions[chat.id].shouldShowPreviews;\n }\n\n return (isChatPrivate(chat.id) && hasPrivateChatsMessagePreview)\n || (isChatChannel(chat) && hasBroadcastMessagePreview)\n || (isChatGroup(chat) && hasGroupMessagePreview);\n}\n\nexport function getCanDeleteChat(chat: ApiChat) {\n return isChatBasicGroup(chat) || ((isChatSuperGroup(chat) || isChatChannel(chat)) && chat.isCreator);\n}\n\nexport function prepareFolderListIds(\n chatsById: Record,\n usersById: Record,\n folder: ApiChatFolder,\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n chatIdsCache?: number[],\n) {\n const excludedChatIds = folder.excludedChatIds ? new Set(folder.excludedChatIds) : undefined;\n const includedChatIds = folder.excludedChatIds ? new Set(folder.includedChatIds) : undefined;\n const pinnedChatIds = folder.excludedChatIds ? new Set(folder.pinnedChatIds) : undefined;\n const listIds = (chatIdsCache || Object.keys(chatsById).map(Number))\n .filter((id) => {\n return filterChatFolder(\n chatsById[id],\n folder,\n usersById,\n notifySettings,\n notifyExceptions,\n excludedChatIds,\n includedChatIds,\n pinnedChatIds,\n );\n });\n\n return [listIds, folder.pinnedChatIds] as const;\n}\n\nfunction filterChatFolder(\n chat: ApiChat,\n folder: ApiChatFolder,\n usersById: Record,\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n excludedChatIds?: Set,\n includedChatIds?: Set,\n pinnedChatIds?: Set,\n) {\n if (!chat.isListed) {\n return false;\n }\n\n if (excludedChatIds && excludedChatIds.has(chat.id)) {\n return false;\n }\n\n if (includedChatIds && includedChatIds.has(chat.id)) {\n return true;\n }\n\n if (pinnedChatIds && pinnedChatIds.has(chat.id)) {\n return true;\n }\n\n if (isChatArchived(chat) && folder.excludeArchived) {\n return false;\n }\n\n if (folder.excludeMuted && !chat.unreadMentionsCount && selectIsChatMuted(chat, notifySettings, notifyExceptions)) {\n return false;\n }\n\n if (!chat.unreadCount && !chat.unreadMentionsCount && !chat.hasUnreadMark && folder.excludeRead) {\n return false;\n }\n\n if (isChatPrivate(chat.id)) {\n const privateChatUser = usersById[chat.id];\n\n const isChatWithBot = privateChatUser && privateChatUser.type === 'userTypeBot';\n if (isChatWithBot) {\n if (folder.bots) {\n return true;\n }\n } else {\n if (folder.contacts && privateChatUser && privateChatUser.isContact) {\n return true;\n }\n\n if (folder.nonContacts && privateChatUser && !privateChatUser.isContact) {\n return true;\n }\n }\n } else if (isChatGroup(chat)) {\n return !!folder.groups;\n } else if (isChatChannel(chat)) {\n return !!folder.channels;\n }\n\n return false;\n}\n\nexport function prepareChatList(\n chatsById: Record,\n listIds: number[],\n orderedPinnedIds?: number[],\n folderType: 'all' | 'archived' | 'folder' = 'all',\n) {\n function chatFilter(chat?: ApiChat) {\n if (!chat || !chat.lastMessage || chat.migratedTo) {\n return false;\n }\n\n switch (folderType) {\n case 'all':\n if (isChatArchived(chat)) {\n return false;\n }\n break;\n case 'archived':\n if (!isChatArchived(chat)) {\n return false;\n }\n break;\n }\n\n return !chat.isRestricted && !chat.isNotJoined;\n }\n\n const listedChats = listIds\n .map((id) => chatsById[id])\n .filter(chatFilter);\n\n const listIdsSet = new Set(listIds);\n const pinnedChats = orderedPinnedIds\n ? (\n orderedPinnedIds\n .map((id) => chatsById[id])\n .filter(chatFilter)\n .filter((chat) => listIdsSet.has(chat.id))\n )\n : [];\n\n const otherChats = orderBy(\n orderedPinnedIds\n ? listedChats.filter((chat) => !orderedPinnedIds.includes(chat.id))\n : listedChats,\n getChatOrder,\n 'desc',\n );\n\n return {\n pinnedChats,\n otherChats,\n };\n}\n\nexport function getFolderUnreadDialogs(\n chatsById: Record,\n usersById: Record,\n folder: ApiChatFolder,\n chatIdsCache: number[],\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n) {\n const [listIds] = prepareFolderListIds(chatsById, usersById, folder, notifySettings, notifyExceptions, chatIdsCache);\n\n const listedChats = listIds\n .map((id) => chatsById[id])\n .filter((chat) => (chat?.lastMessage && !chat.isRestricted && !chat.isNotJoined));\n\n const unreadDialogsCount = listedChats\n .reduce((total, chat) => (chat.unreadCount || chat.hasUnreadMark ? total + 1 : total), 0);\n\n const hasActiveDialogs = listedChats.some((chat) => (\n chat.unreadMentionsCount\n || (!selectIsChatMuted(chat, notifySettings, notifyExceptions) && (chat.unreadCount || chat.hasUnreadMark))\n ));\n\n return {\n unreadDialogsCount,\n hasActiveDialogs,\n };\n}\n\nexport function getFolderDescriptionText(\n lang: LangFn,\n chatsById: Record,\n usersById: Record,\n folder: ApiChatFolder,\n chatIdsCache: number[],\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n) {\n const {\n id, title, emoticon, description, pinnedChatIds,\n excludedChatIds, includedChatIds,\n excludeArchived, excludeMuted, excludeRead,\n ...filters\n } = folder;\n\n // If folder has multiple additive filters or uses include/exclude lists,\n // we display folder chats count\n if (\n Object.values(filters).filter(Boolean).length > 1\n || (excludedChatIds?.length)\n || (includedChatIds?.length)\n ) {\n const length = getFolderChatsCount(chatsById, usersById, folder, chatIdsCache, notifySettings, notifyExceptions);\n return lang('Chats', length);\n }\n\n // Otherwise, we return a short description of a single filter\n if (filters.bots) {\n return lang('FilterBots');\n } else if (filters.groups) {\n return lang('FilterGroups');\n } else if (filters.channels) {\n return lang('FilterChannels');\n } else if (filters.contacts) {\n return lang('FilterContacts');\n } else if (filters.nonContacts) {\n return lang('FilterNonContacts');\n } else {\n return undefined;\n }\n}\n\nfunction getFolderChatsCount(\n chatsById: Record,\n usersById: Record,\n folder: ApiChatFolder,\n chatIdsCache: number[],\n notifySettings: NotifySettings,\n notifyExceptions?: Record,\n) {\n const [listIds, pinnedIds] = prepareFolderListIds(\n chatsById, usersById, folder, notifySettings, notifyExceptions, chatIdsCache,\n );\n const { pinnedChats, otherChats } = prepareChatList(chatsById, listIds, pinnedIds, 'folder');\n return pinnedChats.length + otherChats.length;\n}\n\nexport function isChat(chatOrUser?: ApiUser | ApiChat): chatOrUser is ApiChat {\n if (!chatOrUser) {\n return false;\n }\n\n return chatOrUser.id < 0;\n}\n\nexport function getMessageSenderName(lang: LangFn, chatId: number, sender?: ApiUser) {\n if (!sender || isChatPrivate(chatId)) {\n return undefined;\n }\n\n if (sender.isSelf) {\n return lang('FromYou');\n }\n\n return getUserFirstOrLastName(sender);\n}\n\nexport function sortChatIds(\n chatIds: number[],\n chatsById: Record,\n shouldPrioritizeVerified = false,\n priorityIds?: number[],\n) {\n return orderBy(chatIds, (id) => {\n const chat = chatsById[id];\n if (!chat) {\n return 0;\n }\n\n let priority = 0;\n\n if (chat.lastMessage) {\n priority += chat.lastMessage.date;\n }\n\n if (shouldPrioritizeVerified && chat.isVerified) {\n priority += VERIFIED_PRIORITY_BASE; // ~100 years in seconds\n }\n\n if (priorityIds && priorityIds.includes(id)) {\n priority = Date.now() + PINNED_PRIORITY_BASE + (priorityIds.length - priorityIds.indexOf(id));\n }\n\n return priority;\n }, 'desc');\n}\n","import {\n ApiChat, ApiMessage, ApiMessageEntityTypes, ApiUser,\n} from '../../api/types';\nimport { LangFn } from '../../hooks/useLang';\n\nimport { LOCAL_MESSAGE_ID_BASE, SERVICE_NOTIFICATIONS_USER_ID, RE_LINK_TEMPLATE } from '../../config';\nimport parseEmojiOnlyString from '../../components/common/helpers/parseEmojiOnlyString';\nimport { getUserFullName } from './users';\nimport { getChatTitle } from './chats';\n\nconst CONTENT_NOT_SUPPORTED = 'The message is not supported on this version of Telegram';\nconst RE_LINK = new RegExp(RE_LINK_TEMPLATE, 'i');\nconst TRUNCATED_SUMMARY_LENGTH = 80;\n\nexport function getMessageKey(message: ApiMessage) {\n const { chatId, id } = message;\n\n return `msg${chatId}-${id}`;\n}\n\nexport function parseMessageKey(key: string) {\n const match = key.match(/^msg(-?\\d+)-(\\d+)/)!;\n\n return { chatId: Number(match[1]), messageId: Number(match[2]) };\n}\n\nexport function getMessageOriginalId(message: ApiMessage) {\n return message.previousLocalId || message.id;\n}\n\nexport function getMessageSummaryText(lang: LangFn, message: ApiMessage, noEmoji = false) {\n const {\n text, photo, video, audio, voice, document, sticker, contact, poll, invoice,\n } = message.content;\n\n const truncatedText = text && text.text.substr(0, TRUNCATED_SUMMARY_LENGTH);\n\n if (message.groupedId) {\n return `${noEmoji ? '' : '🖼 '}${truncatedText || lang('lng_in_dlg_album')}`;\n }\n\n if (photo) {\n return `${noEmoji ? '' : '🖼 '}${truncatedText || lang('AttachPhoto')}`;\n }\n\n if (video) {\n return `${noEmoji ? '' : '📹 '}${truncatedText || lang(video.isGif ? 'AttachGif' : 'AttachVideo')}`;\n }\n\n if (sticker) {\n return `${sticker.emoji || ''} ${lang('AttachSticker')}`.trim();\n }\n\n if (audio) {\n return `${noEmoji ? '' : '🎧 '}${getMessageAudioCaption(message) || lang('AttachMusic')}`;\n }\n\n if (voice) {\n return `${noEmoji ? '' : '🎤 '}${truncatedText || lang('AttachAudio')}`;\n }\n\n if (document) {\n return `${noEmoji ? '' : '📎 '}${truncatedText || document.fileName}`;\n }\n\n if (contact) {\n return lang('AttachContact');\n }\n\n if (poll) {\n return `${noEmoji ? '' : '📊 '}${poll.summary.question}`;\n }\n\n if (invoice) {\n return 'Invoice';\n }\n\n if (text) {\n return truncatedText;\n }\n\n return CONTENT_NOT_SUPPORTED;\n}\n\nexport function getMessageText(message: ApiMessage) {\n const {\n text, sticker, photo, video, audio, voice, document, poll, webPage, contact, invoice,\n } = message.content;\n\n if (text) {\n return text.text;\n }\n\n if (sticker || photo || video || audio || voice || document || contact || poll || webPage || invoice) {\n return undefined;\n }\n\n return CONTENT_NOT_SUPPORTED;\n}\n\nexport function getMessageCustomShape(message: ApiMessage): boolean | number {\n const {\n text, sticker, photo, video, audio, voice, document, poll, webPage, contact,\n } = message.content;\n\n if (sticker || (video?.isRound)) {\n return true;\n }\n\n if (!text || photo || video || audio || voice || document || poll || webPage || contact) {\n return false;\n }\n\n // This is a \"dual-intent\" method used to limit calls of `parseEmojiOnlyString`.\n return parseEmojiOnlyString(text.text) || false;\n}\n\nexport function getMessageSingleEmoji(message: ApiMessage) {\n const { text } = message.content;\n if (!(text && text.text.length <= 6)) {\n return undefined;\n }\n\n if (getMessageCustomShape(message) !== 1) {\n return undefined;\n }\n\n return text.text;\n}\n\nexport function getFirstLinkInMessage(message: ApiMessage) {\n const { text } = message.content;\n\n let match: RegExpMatchArray | null | undefined;\n if (text?.entities) {\n let link = text.entities.find((entity) => entity.type === ApiMessageEntityTypes.TextUrl);\n if (link) {\n match = link.url!.match(RE_LINK);\n }\n\n if (!match) {\n link = text.entities.find((entity) => entity.type === ApiMessageEntityTypes.Url);\n if (link) {\n const { offset, length } = link;\n match = text.text.substring(offset, offset + length).match(RE_LINK);\n }\n }\n }\n\n if (!match && text) {\n match = text.text.match(RE_LINK);\n }\n\n if (!match) {\n return undefined;\n }\n\n return {\n url: match[0],\n domain: match[3],\n };\n}\n\nexport function matchLinkInMessageText(message: ApiMessage) {\n const { text } = message.content;\n const match = text && text.text.match(RE_LINK);\n\n if (!match) {\n return undefined;\n }\n\n return {\n url: match[0],\n domain: match[3],\n };\n}\n\nexport function isOwnMessage(message: ApiMessage) {\n return message.isOutgoing;\n}\n\nexport function isReplyMessage(message: ApiMessage) {\n return Boolean(message.replyToMessageId);\n}\n\nexport function isForwardedMessage(message: ApiMessage) {\n return Boolean(message.forwardInfo);\n}\n\nexport function isActionMessage(message: ApiMessage) {\n return !!message.content.action;\n}\n\nexport function isServiceNotificationMessage(message: ApiMessage) {\n return message.chatId === SERVICE_NOTIFICATIONS_USER_ID && isMessageLocal(message);\n}\n\nexport function isAnonymousOwnMessage(message: ApiMessage) {\n return Boolean(message.senderId) && message.senderId! < 0 && isOwnMessage(message);\n}\n\nexport function getSenderTitle(lang: LangFn, sender: ApiUser | ApiChat) {\n return sender.id > 0 ? getUserFullName(sender as ApiUser) : getChatTitle(lang, sender as ApiChat);\n}\n\nexport function getSendingState(message: ApiMessage) {\n if (!message.sendingState) {\n return 'succeeded';\n }\n\n return message.sendingState === 'messageSendingStateFailed' ? 'failed' : 'pending';\n}\n\nexport function isMessageLocal(message: ApiMessage) {\n return message.id >= LOCAL_MESSAGE_ID_BASE;\n}\n\nexport function isHistoryClearMessage(message: ApiMessage) {\n return message.content.action && message.content.action.type === 'historyClear';\n}\n\nexport function getMessageAudioCaption(message: ApiMessage) {\n const { audio, text } = message.content;\n\n return (audio && [audio.title, audio.performer].filter(Boolean).join(' — ')) || (text?.text);\n}\n","import {\n ApiAudio, ApiMediaFormat, ApiMessage, ApiMessageSearchType, ApiPhoto, ApiVideo, ApiDimensions,\n} from '../../api/types';\n\nimport { IS_OPUS_SUPPORTED, IS_PROGRESSIVE_SUPPORTED, IS_SAFARI } from '../../util/environment';\nimport { getMessageKey, isMessageLocal, matchLinkInMessageText } from './messages';\nimport { getDocumentHasPreview } from '../../components/common/helpers/documentInfo';\n\ntype Target =\n 'micro'\n | 'pictogram'\n | 'inline'\n | 'viewerPreview'\n | 'viewerFull'\n | 'download';\n\nexport function getMessageContent(message: ApiMessage) {\n return message.content;\n}\n\nexport function hasMessageMedia(message: ApiMessage) {\n return Boolean((\n getMessagePhoto(message)\n || getMessageVideo(message)\n || getMessageDocument(message)\n || getMessageSticker(message)\n || getMessageContact(message)\n || getMessagePoll(message)\n || getMessageAction(message)\n || getMessageAudio(message)\n || getMessageVoice(message)\n ));\n}\n\nexport function getMessagePhoto(message: ApiMessage) {\n return message.content.photo;\n}\n\nexport function getMessageVideo(message: ApiMessage) {\n return message.content.video;\n}\n\nexport function getMessageRoundVideo(message: ApiMessage) {\n const { video } = message.content;\n\n return video?.isRound ? video : undefined;\n}\n\nexport function getMessageAction(message: ApiMessage) {\n return message.content.action;\n}\n\nexport function getMessageAudio(message: ApiMessage) {\n return message.content.audio;\n}\n\nexport function getMessageVoice(message: ApiMessage) {\n return message.content.voice;\n}\n\nexport function getMessageSticker(message: ApiMessage) {\n return message.content.sticker;\n}\n\nexport function getMessageDocument(message: ApiMessage) {\n return message.content.document;\n}\n\nexport function isMessageDocumentPhoto(message: ApiMessage) {\n const document = getMessageDocument(message);\n return document ? document.mediaType === 'photo' : undefined;\n}\n\nexport function isMessageDocumentVideo(message: ApiMessage) {\n const document = getMessageDocument(message);\n return document ? document.mediaType === 'video' : undefined;\n}\n\nexport function getMessageContact(message: ApiMessage) {\n return message.content.contact;\n}\n\nexport function getMessagePoll(message: ApiMessage) {\n return message.content.poll;\n}\n\nexport function getMessageInvoice(message: ApiMessage) {\n return message.content.invoice;\n}\n\nexport function getMessageWebPage(message: ApiMessage) {\n return message.content.webPage;\n}\n\nexport function getMessageWebPagePhoto(message: ApiMessage) {\n return getMessageWebPage(message)?.photo;\n}\n\nexport function getMessageWebPageDocument(message: ApiMessage) {\n return getMessageWebPage(message)?.document;\n}\n\nexport function getMessageWebPageVideo(message: ApiMessage): ApiVideo | undefined {\n return getMessageWebPage(message)?.video;\n}\n\nexport function getMessageMediaThumbnail(message: ApiMessage) {\n const media = getMessagePhoto(message)\n || getMessageVideo(message)\n || getMessageDocument(message)\n || getMessageSticker(message)\n || getMessageWebPagePhoto(message)\n || getMessageWebPageVideo(message);\n\n if (!media) {\n return undefined;\n }\n\n return media.thumbnail;\n}\n\nexport function getMessageMediaThumbDataUri(message: ApiMessage) {\n return getMessageMediaThumbnail(message)?.dataUri;\n}\n\nexport function getMessageMediaHash(\n message: ApiMessage,\n target: Target,\n) {\n const {\n photo, video, sticker, audio, voice, document,\n } = message.content;\n const webPagePhoto = getMessageWebPagePhoto(message);\n const webPageVideo = getMessageWebPageVideo(message);\n\n const messageVideo = video || webPageVideo;\n const messagePhoto = photo || webPagePhoto;\n\n if (!(messagePhoto || messageVideo || sticker || audio || voice || document)) {\n return undefined;\n }\n\n const base = getMessageKey(message);\n\n if (messageVideo) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return `${base}?size=m`;\n case 'inline':\n return !hasMessageLocalBlobUrl(message) ? getVideoOrAudioBaseHash(messageVideo, base) : undefined;\n case 'viewerPreview':\n return `${base}?size=m`;\n case 'viewerFull':\n return getVideoOrAudioBaseHash(messageVideo, base);\n case 'download':\n return `${base}?download`;\n }\n }\n\n if (messagePhoto) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return `${base}?size=m`;\n case 'inline':\n return !hasMessageLocalBlobUrl(message) ? `${base}?size=x` : undefined;\n case 'viewerPreview':\n return `${base}?size=x`;\n case 'viewerFull':\n return `${base}?size=z`;\n }\n }\n\n if (document) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n case 'inline':\n case 'viewerPreview':\n if (!getDocumentHasPreview(document) || hasMessageLocalBlobUrl(message)) {\n return undefined;\n }\n\n return `${base}?size=m`;\n default:\n return base;\n }\n }\n\n if (sticker) {\n switch (target) {\n case 'micro':\n return undefined;\n case 'pictogram':\n return `${base}?size=m`;\n default:\n return base;\n }\n }\n\n if (audio) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return undefined;\n case 'download':\n return `${base}?download`;\n default:\n return getVideoOrAudioBaseHash(audio, base);\n }\n }\n\n if (voice) {\n switch (target) {\n case 'micro':\n case 'pictogram':\n return undefined;\n default:\n return base;\n }\n }\n\n return undefined;\n}\n\nfunction getVideoOrAudioBaseHash(media: ApiAudio | ApiVideo, base: string) {\n if (IS_PROGRESSIVE_SUPPORTED && IS_SAFARI) {\n return `${base}?fileSize=${media.size}&mimeType=${media.mimeType}`;\n }\n\n return base;\n}\n\nexport function getMessageMediaFormat(\n message: ApiMessage, target: Target,\n): Exclude;\nexport function getMessageMediaFormat(message: ApiMessage, target: Target, canBeLottie: true): ApiMediaFormat;\nexport function getMessageMediaFormat(\n message: ApiMessage, target: Target,\n): ApiMediaFormat {\n const {\n sticker, video, audio, voice,\n } = message.content;\n\n const fullVideo = video || getMessageWebPageVideo(message);\n\n if (sticker && target === 'inline' && sticker.isAnimated) {\n return ApiMediaFormat.Lottie;\n } else if (fullVideo && IS_PROGRESSIVE_SUPPORTED && (\n target === 'viewerFull' || target === 'inline'\n )) {\n return ApiMediaFormat.Progressive;\n } else if (audio || voice) {\n // Safari\n if (voice && !IS_OPUS_SUPPORTED) {\n return ApiMediaFormat.BlobUrl;\n }\n\n return ApiMediaFormat.Progressive;\n }\n\n return ApiMediaFormat.BlobUrl;\n}\n\nexport function getMessageFileName(message: ApiMessage) {\n const {\n photo, video, document,\n } = message.content;\n const webPagePhoto = getMessageWebPagePhoto(message);\n const webPageVideo = getMessageWebPageVideo(message);\n\n if (photo || webPagePhoto) {\n return `photo${message.date}.jpeg`;\n }\n\n const { fileName } = video || webPageVideo || document || {};\n\n return fileName;\n}\n\nexport function getMessageFileSize(message: ApiMessage) {\n const { video, document } = message.content;\n const webPageVideo = getMessageWebPageVideo(message);\n const { size } = video || webPageVideo || document || {};\n\n return size;\n}\n\nexport function hasMessageLocalBlobUrl(message: ApiMessage) {\n const { photo, video, document } = message.content;\n\n return (photo?.blobUrl) || (video?.blobUrl) || (document?.previewBlobUrl);\n}\n\nexport function getChatMediaMessageIds(\n messages: Record, listedIds: number[], isFromSharedMedia = false,\n) {\n const ids = getMessageContentIds(messages, listedIds, isFromSharedMedia ? 'media' : 'inlineMedia');\n\n return isFromSharedMedia ? ids.reverse() : ids;\n}\n\nexport function getPhotoFullDimensions(photo: ApiPhoto): ApiDimensions | undefined {\n return (\n photo.sizes.find((size) => size.type === 'z')\n || photo.sizes.find((size) => size.type === 'y')\n || getPhotoInlineDimensions(photo)\n );\n}\n\nexport function getPhotoInlineDimensions(photo: ApiPhoto): ApiDimensions | undefined {\n return (\n photo.sizes.find((size) => size.type === 'x')\n || photo.sizes.find((size) => size.type === 'm')\n || photo.sizes.find((size) => size.type === 's')\n || photo.thumbnail\n );\n}\n\nexport function getVideoDimensions(video: ApiVideo): ApiDimensions | undefined {\n if (video.width && video.height) {\n return video as ApiDimensions;\n }\n\n return undefined;\n}\n\nexport function getMediaTransferState(message: ApiMessage, progress?: number, isDownloadNeeded = false) {\n const isUploading = isMessageLocal(message);\n const isTransferring = isUploading || isDownloadNeeded;\n const transferProgress = Number(progress);\n\n return {\n isUploading, isTransferring, transferProgress,\n };\n}\n\nexport function getMessageContentIds(\n messages: Record, messageIds: number[], contentType: ApiMessageSearchType | 'inlineMedia',\n) {\n let validator: Function;\n\n switch (contentType) {\n case 'media':\n validator = (message: ApiMessage) => {\n const video = getMessageVideo(message);\n return getMessagePhoto(message) || (video && !video.isRound && !video.isGif);\n };\n break;\n\n case 'documents':\n validator = getMessageDocument;\n break;\n\n case 'links':\n validator = (message: ApiMessage) => getMessageWebPage(message) || matchLinkInMessageText(message);\n break;\n\n case 'audio':\n validator = getMessageAudio;\n break;\n\n case 'inlineMedia':\n validator = (message: ApiMessage) => {\n const video = getMessageVideo(message);\n return (\n getMessagePhoto(message)\n || (video && !video.isRound && !video.isGif)\n || isMessageDocumentPhoto(message)\n || isMessageDocumentVideo(message)\n );\n };\n break;\n\n default:\n return [] as Array;\n }\n\n return messageIds.reduce((result, messageId) => {\n if (messages[messageId] && validator(messages[messageId])) {\n result.push(messageId);\n }\n\n return result;\n }, [] as Array);\n}\n\nexport function getMediaDuration(message: ApiMessage) {\n const { audio, voice, video } = getMessageContent(message);\n const media = audio || voice || video || getMessageWebPageVideo(message);\n if (!media) {\n return undefined;\n }\n\n return media.duration;\n}\n","export function buildChatThreadKey(chatId: number, threadId: number) {\n return `${chatId}_${threadId}`;\n}\n","import { ApiFieldError } from '../../api/types';\n\nconst STRIPE_ERRORS: Record = {\n missing_payment_information: {\n field: 'cardNumber',\n message: 'Incorrect card number',\n },\n invalid_number: {\n field: 'cardNumber',\n message: 'Incorrect card number',\n },\n number: {\n field: 'cardNumber',\n message: 'Incorrect card number',\n },\n exp_year: {\n field: 'expiry',\n message: 'Incorrect year',\n },\n exp_month: {\n field: 'expiry',\n message: 'Incorrect month',\n },\n invalid_expiry_year: {\n field: 'expiry',\n message: 'Incorrect year',\n },\n invalid_expiry_month: {\n field: 'expiry',\n message: 'Incorrect month',\n },\n cvc: {\n field: 'cvv',\n message: 'Incorrect CVV',\n },\n invalid_cvc: {\n field: 'cvv',\n message: 'Incorrect CVV',\n },\n};\n\nexport function getStripeError(error: {\n code: string;\n message: string;\n param?: string;\n}) {\n const { message: description, code, param } = error;\n const { field, message } = param ? STRIPE_ERRORS[param] : STRIPE_ERRORS[code];\n\n return { field, message, description };\n}\n","import { ApiChat, ApiUser } from '../../api/types';\n\nimport { SERVICE_NOTIFICATIONS_USER_ID } from '../../config';\nimport { formatFullDate, formatTime } from '../../util/dateFormat';\nimport { orderBy } from '../../util/iteratees';\nimport { LangFn } from '../../hooks/useLang';\nimport { getServerTime } from '../../util/serverTime';\n\nconst USER_COLOR_KEYS = [1, 8, 5, 2, 7, 4, 6];\n\nexport function getUserFirstOrLastName(user?: ApiUser) {\n if (!user) {\n return undefined;\n }\n\n switch (user.type) {\n case 'userTypeBot':\n case 'userTypeRegular': {\n return user.firstName || user.lastName;\n }\n\n case 'userTypeDeleted':\n case 'userTypeUnknown': {\n return 'Deleted';\n }\n\n default:\n return undefined;\n }\n}\n\nexport function getUserFullName(user?: ApiUser) {\n if (!user) {\n return undefined;\n }\n\n if (isDeletedUser(user)) {\n return 'Deleted account';\n }\n\n switch (user.type) {\n case 'userTypeBot':\n case 'userTypeRegular': {\n if (user.firstName && user.lastName) {\n return `${user.firstName} ${user.lastName}`;\n }\n\n if (user.firstName) {\n return user.firstName;\n }\n\n if (user.lastName) {\n return user.lastName;\n }\n\n break;\n }\n\n case 'userTypeDeleted':\n case 'userTypeUnknown': {\n return 'Deleted account';\n }\n }\n\n return undefined;\n}\n\nexport function getUserStatus(lang: LangFn, user: ApiUser, serverTimeOffset: number) {\n if (user.id === SERVICE_NOTIFICATIONS_USER_ID) {\n return lang('ServiceNotifications').toLowerCase();\n }\n\n if (user.type && user.type === 'userTypeBot') {\n return lang('Bot');\n }\n\n if (!user.status) {\n return '';\n }\n\n switch (user.status.type) {\n case 'userStatusEmpty': {\n return lang('ALongTimeAgo');\n }\n\n case 'userStatusLastMonth': {\n return lang('WithinAMonth');\n }\n\n case 'userStatusLastWeek': {\n return lang('WithinAWeek');\n }\n\n case 'userStatusOffline': {\n const { wasOnline } = user.status;\n\n if (!wasOnline) return lang('LastSeen.Offline');\n\n const now = new Date(new Date().getTime() + serverTimeOffset * 1000);\n const wasOnlineDate = new Date(wasOnline * 1000);\n\n if (wasOnlineDate >= now) {\n return lang('LastSeen.JustNow');\n }\n\n const diff = new Date(now.getTime() - wasOnlineDate.getTime());\n\n // within a minute\n if (diff.getTime() / 1000 < 60) {\n return lang('LastSeen.JustNow');\n }\n\n // within an hour\n if (diff.getTime() / 1000 < 60 * 60) {\n const minutes = Math.floor(diff.getTime() / 1000 / 60);\n return lang('LastSeen.MinutesAgo', minutes);\n }\n\n // today\n const today = new Date();\n today.setHours(0, 0, 0, 0);\n const serverToday = new Date(today.getTime() + serverTimeOffset * 1000);\n if (wasOnlineDate > serverToday) {\n // up to 6 hours ago\n if (diff.getTime() / 1000 < 6 * 60 * 60) {\n const hours = Math.floor(diff.getTime() / 1000 / 60 / 60);\n return lang('LastSeen.HoursAgo', hours);\n }\n\n // other\n return lang('LastSeen.TodayAt', formatTime(wasOnlineDate));\n }\n\n // yesterday\n const yesterday = new Date();\n yesterday.setDate(now.getDate() - 1);\n yesterday.setHours(0, 0, 0, 0);\n const serverYesterday = new Date(yesterday.getTime() + serverTimeOffset * 1000);\n if (wasOnlineDate > serverYesterday) {\n return lang('LastSeen.YesterdayAt', formatTime(wasOnlineDate));\n }\n\n return lang('LastSeen.AtDate', formatFullDate(lang, wasOnlineDate));\n }\n\n case 'userStatusOnline': {\n return lang('Online');\n }\n\n case 'userStatusRecently': {\n return lang('Lately');\n }\n\n default:\n return undefined;\n }\n}\n\nexport function isUserOnline(user: ApiUser) {\n const { id, status, type } = user;\n\n if (!status) {\n return false;\n }\n\n if (id === SERVICE_NOTIFICATIONS_USER_ID) {\n return false;\n }\n\n return status.type === 'userStatusOnline' && type !== 'userTypeBot';\n}\n\nexport function isDeletedUser(user: ApiUser) {\n if (!user.status || user.type === 'userTypeBot' || user.id === SERVICE_NOTIFICATIONS_USER_ID) {\n return false;\n }\n\n return user.type === 'userTypeDeleted'\n || user.type === 'userTypeUnknown';\n}\n\nexport function isUserBot(user: ApiUser) {\n return user.type === 'userTypeBot';\n}\n\nexport function sortUserIds(\n userIds: number[],\n usersById: Record,\n priorityIds?: number[],\n serverTimeOffset = 0,\n) {\n return orderBy(userIds, (id) => {\n const now = getServerTime(serverTimeOffset);\n\n if (priorityIds && priorityIds.includes(id)) {\n // Assuming that online status expiration date can't be as far as two days from now,\n // this should place prioritized on top of the list.\n // Then we subtract index of `id` in `priorityIds` to preserve selected order\n return now + (48 * 60 * 60) - (priorityIds.length - priorityIds.indexOf(id));\n }\n\n const user = usersById[id];\n if (!user || !user.status) {\n return 0;\n }\n\n if (user.status.type === 'userStatusOnline') {\n return user.status.expires;\n } else if (user.status.type === 'userStatusOffline' && user.status.wasOnline) {\n return user.status.wasOnline;\n }\n\n switch (user.status.type) {\n case 'userStatusRecently':\n return now - 60 * 60 * 24;\n case 'userStatusLastWeek':\n return now - 60 * 60 * 24 * 7;\n case 'userStatusLastMonth':\n return now - 60 * 60 * 24 * 7 * 30;\n default:\n return 0;\n }\n }, 'desc');\n}\n\n// eslint-disable-next-line max-len\n// https://github.com/telegramdesktop/tdesktop/blob/371510cfe23b0bd226de8c076bc49248fbe40c26/Telegram/SourceFiles/data/data_peer.cpp#L53\nexport function getUserColorKey(peer: ApiUser | ApiChat | undefined) {\n const index = peer ? Math.abs(peer.id) % 7 : 0;\n\n return USER_COLOR_KEYS[index];\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiChat, ApiPhoto } from '../../api/types';\n\nimport { ARCHIVED_FOLDER_ID } from '../../config';\nimport { omit } from '../../util/iteratees';\n\nexport function replaceChatListIds(\n global: GlobalState,\n type: 'active' | 'archived',\n newIds: number[] | undefined,\n): GlobalState {\n return {\n ...global,\n chats: {\n ...global.chats,\n listIds: {\n ...global.chats.listIds,\n [type]: newIds,\n },\n },\n };\n}\n\nexport function updateChatListIds(global: GlobalState, type: 'active' | 'archived', idsUpdate: number[]): GlobalState {\n const { [type]: listIds } = global.chats.listIds;\n const newIds = listIds?.length\n ? idsUpdate.filter((id) => !listIds.includes(id))\n : idsUpdate;\n\n if (listIds && !newIds.length) {\n return global;\n }\n\n return replaceChatListIds(global, type, [\n ...(listIds || []),\n ...newIds,\n ]);\n}\n\nexport function replaceChats(global: GlobalState, newById: Record): GlobalState {\n return {\n ...global,\n chats: {\n ...global.chats,\n byId: newById,\n },\n };\n}\n\n// @optimization Don't spread/unspread global for each element, do it in a batch\nfunction getUpdatedChat(\n global: GlobalState, chatId: number, chatUpdate: Partial, photo?: ApiPhoto,\n): ApiChat {\n const { byId } = global.chats;\n const chat = byId[chatId];\n const shouldOmitMinInfo = chatUpdate.isMin && chat && !chat.isMin;\n const updatedChat = {\n ...chat,\n ...(shouldOmitMinInfo ? omit(chatUpdate, ['isMin', 'accessHash']) : chatUpdate),\n ...(photo && { photos: [photo, ...(chat.photos || [])] }),\n };\n\n if (!updatedChat.id || !updatedChat.type) {\n return updatedChat;\n }\n\n return updatedChat;\n}\n\nexport function updateChat(\n global: GlobalState, chatId: number, chatUpdate: Partial, photo?: ApiPhoto,\n): GlobalState {\n const { byId } = global.chats;\n\n const updatedChat = getUpdatedChat(global, chatId, chatUpdate, photo);\n\n return replaceChats(global, {\n ...byId,\n [chatId]: updatedChat,\n });\n}\n\nexport function updateChats(global: GlobalState, updatedById: Record): GlobalState {\n const updatedChats = Object.keys(updatedById).map(Number).reduce>((acc, id) => {\n const updatedChat = getUpdatedChat(global, id, updatedById[id]);\n if (updatedChat) {\n acc[id] = updatedChat;\n }\n return acc;\n }, {});\n\n global = replaceChats(global, {\n ...global.chats.byId,\n ...updatedChats,\n });\n\n return global;\n}\n\n// @optimization Allows to avoid redundant updates which cause a lot of renders\nexport function addChats(global: GlobalState, addedById: Record): GlobalState {\n const { byId } = global.chats;\n let isAdded = false;\n\n const addedChats = Object.keys(addedById).map(Number).reduce>((acc, id) => {\n if (!byId[id] || (byId[id].isMin && !addedById[id].isMin)) {\n const updatedChat = getUpdatedChat(global, id, addedById[id]);\n if (updatedChat) {\n acc[id] = updatedChat;\n\n if (!isAdded) {\n isAdded = true;\n }\n }\n }\n return acc;\n }, {});\n\n if (isAdded) {\n global = replaceChats(global, {\n ...global.chats.byId,\n ...addedChats,\n });\n }\n\n return global;\n}\n\nexport function updateChatListType(\n global: GlobalState,\n chatId: number,\n folderId?: number,\n): GlobalState {\n const listType = folderId === ARCHIVED_FOLDER_ID ? 'archived' : 'active';\n\n let currentListIds = global.chats.listIds;\n (Object.keys(currentListIds) as Array).forEach((listTypeKey) => {\n const currentFolderList = currentListIds[listTypeKey] || [];\n if (listTypeKey === listType && !currentFolderList.includes(chatId)) {\n currentListIds = {\n ...currentListIds,\n [listTypeKey]: [...currentFolderList, chatId],\n };\n } else if (listTypeKey !== listType && currentFolderList.includes(chatId)) {\n currentListIds = {\n ...currentListIds,\n [listTypeKey]: currentFolderList.filter((id) => id !== chatId),\n };\n }\n });\n\n global = {\n ...global,\n chats: {\n ...global.chats,\n listIds: currentListIds,\n },\n };\n\n global = updateChat(global, chatId, { folderId: folderId || undefined });\n\n return global;\n}\n\nexport function updateChatListSecondaryInfo(\n global: GlobalState,\n type: 'active' | 'archived',\n info: {\n orderedPinnedIds?: number[];\n totalChatCount: number;\n },\n): GlobalState {\n const totalCountKey = type === 'active' ? 'all' : 'archived';\n\n return {\n ...global,\n chats: {\n ...global.chats,\n ...(info.orderedPinnedIds && {\n orderedPinnedIds: {\n ...global.chats.orderedPinnedIds,\n [type]: info.orderedPinnedIds,\n },\n }),\n totalCount: {\n ...global.chats.totalCount,\n [totalCountKey]: info.totalChatCount,\n },\n isFullyLoaded: {\n ...global.chats.isFullyLoaded,\n [type]: false,\n },\n },\n };\n}\n","import {\n GlobalState, MessageList, MessageListType, Thread,\n} from '../../global/types';\nimport { ApiMessage, ApiThreadInfo, MAIN_THREAD_ID } from '../../api/types';\nimport { FocusDirection } from '../../types';\n\nimport { IS_TEST, MESSAGE_LIST_SLICE, MESSAGE_LIST_VIEWPORT_LIMIT } from '../../config';\nimport {\n selectListedIds,\n selectChatMessages,\n selectViewportIds,\n selectOutlyingIds,\n selectPinnedIds,\n selectThreadInfo,\n selectMessageIdsByGroupId,\n selectScheduledMessages,\n selectScheduledIds,\n selectCurrentMessageIds,\n selectChatMessage,\n selectCurrentMessageList,\n} from '../selectors';\nimport {\n areSortedArraysEqual, omit, pickTruthy, unique,\n} from '../../util/iteratees';\n\nconst TMP_CHAT_ID = -1;\n\ntype MessageStoreSections = {\n byId: Record;\n threadsById: Record;\n};\n\nexport function updateCurrentMessageList(\n global: GlobalState,\n chatId: number | undefined,\n threadId: number = MAIN_THREAD_ID,\n type: MessageListType = 'thread',\n shouldReplaceHistory?: boolean,\n): GlobalState {\n const { messageLists } = global.messages;\n let newMessageLists: MessageList[] = messageLists;\n if (shouldReplaceHistory || IS_TEST) {\n newMessageLists = chatId ? [{ chatId, threadId, type }] : [];\n } else if (chatId) {\n const last = messageLists[messageLists.length - 1];\n if (!last || last.chatId !== chatId || last.threadId !== threadId || last.type !== type) {\n if (last && last.chatId === TMP_CHAT_ID) {\n newMessageLists = [...messageLists.slice(0, -1), { chatId, threadId, type }];\n } else {\n newMessageLists = [...messageLists, { chatId, threadId, type }];\n }\n }\n } else {\n newMessageLists = messageLists.slice(0, -1);\n }\n\n return {\n ...global,\n messages: {\n ...global.messages,\n messageLists: newMessageLists,\n },\n };\n}\n\nfunction replaceChatMessages(global: GlobalState, chatId: number, newById: Record): GlobalState {\n return updateMessageStore(global, chatId, {\n byId: newById,\n });\n}\n\nfunction updateThread(\n global: GlobalState, chatId: number, threadId: number, threadUpdate: Partial,\n): GlobalState {\n const current = global.messages.byChatId[chatId];\n\n return updateMessageStore(global, chatId, {\n threadsById: {\n ...(current?.threadsById),\n [threadId]: {\n ...(current?.threadsById[threadId]),\n ...threadUpdate,\n },\n },\n });\n}\n\nfunction updateMessageStore(\n global: GlobalState, chatId: number, update: Partial,\n): GlobalState {\n const current = global.messages.byChatId[chatId] || { byId: {}, threadsById: {} };\n\n return {\n ...global,\n messages: {\n ...global.messages,\n byChatId: {\n ...global.messages.byChatId,\n [chatId]: {\n ...current,\n ...update,\n },\n },\n },\n };\n}\n\nexport function replaceThreadParam(\n global: GlobalState, chatId: number, threadId: number, paramName: T, newValue: Thread[T] | undefined,\n) {\n return updateThread(global, chatId, threadId, { [paramName]: newValue });\n}\n\nexport function addMessages(\n global: GlobalState, messages: ApiMessage[],\n): GlobalState {\n const addedByChatId = messages.reduce((messagesByChatId, message: ApiMessage) => {\n if (!messagesByChatId[message.chatId]) {\n messagesByChatId[message.chatId] = {};\n }\n messagesByChatId[message.chatId][message.id] = message;\n\n return messagesByChatId;\n }, {} as Record>);\n\n Object.keys(addedByChatId).map(Number).forEach((chatId) => {\n global = addChatMessagesById(global, chatId, addedByChatId[chatId]);\n });\n\n return global;\n}\n\nexport function addChatMessagesById(\n global: GlobalState, chatId: number, newById: Record,\n): GlobalState {\n const byId = selectChatMessages(global, chatId);\n\n if (byId && Object.keys(newById).every((newId) => Boolean(byId[Number(newId)]))) {\n return global;\n }\n\n return replaceChatMessages(global, chatId, {\n ...newById,\n ...byId,\n });\n}\n\nexport function updateChatMessage(\n global: GlobalState, chatId: number, messageId: number, messageUpdate: Partial,\n): GlobalState {\n const byId = selectChatMessages(global, chatId) || {};\n const message = byId[messageId];\n const updatedMessage = {\n ...message,\n ...messageUpdate,\n };\n\n if (!updatedMessage.id) {\n return global;\n }\n\n return replaceChatMessages(global, chatId, {\n ...byId,\n [messageId]: updatedMessage,\n });\n}\n\nexport function updateScheduledMessage(\n global: GlobalState, chatId: number, messageId: number, messageUpdate: Partial,\n): GlobalState {\n const byId = selectScheduledMessages(global, chatId) || {};\n const message = byId[messageId];\n const updatedMessage = {\n ...message,\n ...messageUpdate,\n };\n\n if (!updatedMessage.id) {\n return global;\n }\n\n return replaceScheduledMessages(global, chatId, {\n ...byId,\n [messageId]: updatedMessage,\n }, undefined);\n}\n\nexport function deleteChatMessages(\n global: GlobalState,\n chatId: number,\n messageIds: number[],\n): GlobalState {\n const byId = selectChatMessages(global, chatId);\n if (!byId) {\n return global;\n }\n const newById = omit(byId, messageIds);\n const deletedForwardedPosts = Object.values(pickTruthy(byId, messageIds)).filter(\n ({ forwardInfo }) => forwardInfo?.isLinkedChannelPost,\n );\n\n const threadIds = Object.keys(global.messages.byChatId[chatId].threadsById).map(Number);\n threadIds.forEach((threadId) => {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n\n let listedIds = selectListedIds(global, chatId, threadId);\n let outlyingIds = selectOutlyingIds(global, chatId, threadId);\n let viewportIds = selectViewportIds(global, chatId, threadId);\n let pinnedIds = selectPinnedIds(global, chatId);\n let newMessageCount = threadInfo?.messagesCount;\n\n messageIds.forEach((messageId) => {\n if (listedIds && listedIds.includes(messageId)) {\n listedIds = listedIds.filter((id) => id !== messageId);\n if (newMessageCount !== undefined) newMessageCount -= 1;\n }\n\n if (outlyingIds && outlyingIds.includes(messageId)) {\n outlyingIds = outlyingIds.filter((id) => id !== messageId);\n }\n\n if (viewportIds && viewportIds.includes(messageId)) {\n viewportIds = viewportIds.filter((id) => id !== messageId);\n }\n\n if (pinnedIds && pinnedIds.includes(messageId)) {\n pinnedIds = pinnedIds.filter((id) => id !== messageId);\n }\n });\n\n global = replaceThreadParam(global, chatId, threadId, 'listedIds', listedIds);\n global = replaceThreadParam(global, chatId, threadId, 'outlyingIds', outlyingIds);\n global = replaceThreadParam(global, chatId, threadId, 'viewportIds', viewportIds);\n global = replaceThreadParam(global, chatId, threadId, 'pinnedIds', pinnedIds);\n\n if (threadInfo && newMessageCount !== undefined) {\n global = replaceThreadParam(global, chatId, threadId, 'threadInfo', {\n ...threadInfo,\n messagesCount: newMessageCount,\n });\n }\n });\n\n if (deletedForwardedPosts.length) {\n const currentMessageList = selectCurrentMessageList(global);\n const canDeleteCurrentThread = currentMessageList && currentMessageList.chatId === chatId\n && currentMessageList.type === 'thread';\n const currentThreadId = currentMessageList?.threadId;\n\n deletedForwardedPosts.forEach((message) => {\n const { fromChatId, fromMessageId } = message.forwardInfo!;\n const originalPost = selectChatMessage(global, fromChatId!, fromMessageId!);\n\n if (canDeleteCurrentThread && currentThreadId === fromMessageId) {\n global = updateCurrentMessageList(global, chatId);\n }\n if (originalPost) {\n global = updateChatMessage(global, fromChatId!, fromMessageId!, { threadInfo: undefined });\n }\n });\n }\n\n global = replaceChatMessages(global, chatId, newById);\n\n return global;\n}\n\nexport function deleteChatScheduledMessages(\n global: GlobalState,\n chatId: number,\n messageIds: number[],\n): GlobalState {\n const byId = selectScheduledMessages(global, chatId);\n if (!byId) {\n return global;\n }\n const newById = omit(byId, messageIds);\n\n let scheduledIds = selectScheduledIds(global, chatId);\n if (scheduledIds) {\n messageIds.forEach((messageId) => {\n if (scheduledIds!.includes(messageId)) {\n scheduledIds = scheduledIds!.filter((id) => id !== messageId);\n }\n });\n global = replaceThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds', scheduledIds);\n }\n\n global = replaceScheduledMessages(global, chatId, newById, undefined);\n\n return global;\n}\n\nexport function updateListedIds(\n global: GlobalState,\n chatId: number,\n threadId: number,\n idsUpdate: number[],\n): GlobalState {\n const listedIds = selectListedIds(global, chatId, threadId);\n const newIds = listedIds?.length\n ? idsUpdate.filter((id) => !listedIds.includes(id))\n : idsUpdate;\n\n if (listedIds && !newIds.length) {\n return global;\n }\n\n return replaceThreadParam(global, chatId, threadId, 'listedIds', orderHistoryIds([\n ...(listedIds || []),\n ...newIds,\n ]));\n}\n\nexport function updateOutlyingIds(\n global: GlobalState,\n chatId: number,\n threadId: number,\n idsUpdate: number[],\n): GlobalState {\n const outlyingIds = selectOutlyingIds(global, chatId, threadId);\n const newIds = outlyingIds?.length\n ? idsUpdate.filter((id) => !outlyingIds.includes(id))\n : idsUpdate;\n\n if (outlyingIds && !newIds.length) {\n return global;\n }\n\n return replaceThreadParam(global, chatId, threadId, 'outlyingIds', orderHistoryIds([\n ...(outlyingIds || []),\n ...newIds,\n ]));\n}\n\nfunction orderHistoryIds(listedIds: number[]) {\n return listedIds.sort((a, b) => a - b);\n}\n\nexport function addViewportId(\n global: GlobalState,\n chatId: number,\n threadId: number,\n newId: number,\n): GlobalState {\n const viewportIds = selectViewportIds(global, chatId, threadId) || [];\n if (viewportIds.includes(newId)) {\n return global;\n }\n\n const newIds = orderHistoryIds([\n ...(\n viewportIds.length < MESSAGE_LIST_VIEWPORT_LIMIT\n ? viewportIds\n : viewportIds.slice(-(MESSAGE_LIST_SLICE / 2))\n ),\n newId,\n ]);\n\n return replaceThreadParam(global, chatId, threadId, 'viewportIds', newIds);\n}\n\nexport function safeReplaceViewportIds(\n global: GlobalState,\n chatId: number,\n threadId: number,\n newViewportIds: number[],\n): GlobalState {\n const viewportIds = selectViewportIds(global, chatId, threadId) || [];\n\n return replaceThreadParam(\n global,\n chatId,\n threadId,\n 'viewportIds',\n areSortedArraysEqual(viewportIds, newViewportIds) ? viewportIds : newViewportIds,\n );\n}\n\nexport function updateThreadInfo(\n global: GlobalState, chatId: number, threadId: number, update: Partial | undefined,\n): GlobalState {\n const newThreadInfo = {\n ...(selectThreadInfo(global, chatId, threadId) as ApiThreadInfo),\n ...update,\n };\n\n if (!newThreadInfo.threadId) {\n return global;\n }\n\n return replaceThreadParam(global, chatId, threadId, 'threadInfo', newThreadInfo);\n}\n\nexport function updateThreadInfos(\n global: GlobalState, chatId: number, updates: Partial[],\n): GlobalState {\n updates.forEach((update) => {\n global = updateThreadInfo(global, update.chatId!, update.threadId!, update);\n });\n\n return global;\n}\n\nexport function replaceScheduledMessages(\n global: GlobalState, chatId: number, newById: Record, hash: number | undefined,\n): GlobalState {\n return updateScheduledMessages(global, chatId, {\n byId: newById,\n hash,\n });\n}\n\nfunction updateScheduledMessages(\n global: GlobalState, chatId: number, update: Partial<{ byId: Record; hash: number }>,\n): GlobalState {\n const current = global.scheduledMessages.byChatId[chatId] || { byId: {}, hash: 0 };\n\n return {\n ...global,\n scheduledMessages: {\n byChatId: {\n ...global.scheduledMessages.byChatId,\n [chatId]: {\n ...current,\n ...update,\n },\n },\n },\n };\n}\n\nexport function updateFocusedMessage(\n global: GlobalState, chatId?: number, messageId?: number, noHighlight = false, isResizingContainer = false,\n): GlobalState {\n return {\n ...global,\n focusedMessage: {\n ...global.focusedMessage,\n chatId,\n messageId,\n noHighlight,\n isResizingContainer,\n },\n };\n}\n\nexport function updateFocusDirection(\n global: GlobalState, direction?: FocusDirection,\n): GlobalState {\n return {\n ...global,\n focusedMessage: {\n ...global.focusedMessage,\n direction,\n },\n };\n}\n\nexport function enterMessageSelectMode(\n global: GlobalState,\n chatId: number,\n messageId?: number | number[],\n): GlobalState {\n const messageIds = messageId ? Array.prototype.concat([], messageId) : [];\n return {\n ...global,\n selectedMessages: {\n chatId,\n messageIds,\n },\n };\n}\n\nexport function toggleMessageSelection(\n global: GlobalState,\n chatId: number,\n threadId: number,\n messageListType: MessageListType,\n messageId: number,\n groupedId?: string,\n childMessageIds?: number[],\n withShift = false,\n): GlobalState {\n const { selectedMessages: oldSelectedMessages } = global;\n if (groupedId) {\n childMessageIds = selectMessageIdsByGroupId(global, chatId, groupedId);\n }\n const selectedMessageIds = childMessageIds || [messageId];\n if (!oldSelectedMessages) {\n return enterMessageSelectMode(global, chatId, selectedMessageIds);\n }\n\n const { messageIds } = oldSelectedMessages;\n\n let newMessageIds;\n const newSelectedMessageIds = selectedMessageIds.filter((id) => !messageIds.includes(id));\n if (newSelectedMessageIds && !newSelectedMessageIds.length) {\n newMessageIds = messageIds.filter((id) => !selectedMessageIds.includes(id));\n } else if (withShift && messageIds.length) {\n const viewportIds = selectCurrentMessageIds(global, chatId, threadId, messageListType)!;\n const prevIndex = viewportIds.indexOf(messageIds[messageIds.length - 1]);\n const currentIndex = viewportIds.indexOf(messageId);\n const from = Math.min(prevIndex, currentIndex);\n const to = Math.max(prevIndex, currentIndex);\n const slice = viewportIds.slice(from, to + 1);\n newMessageIds = unique([...messageIds, ...slice]);\n } else {\n newMessageIds = [...messageIds, ...newSelectedMessageIds];\n }\n\n if (!newMessageIds.length) {\n return exitMessageSelectMode(global);\n }\n\n return {\n ...global,\n selectedMessages: {\n ...oldSelectedMessages,\n messageIds: newMessageIds,\n },\n };\n}\n\nexport function exitMessageSelectMode(global: GlobalState): GlobalState {\n return {\n ...global,\n selectedMessages: undefined,\n };\n}\n\nexport function updateThreadUnreadFromForwardedMessage(\n global: GlobalState,\n originMessage: ApiMessage,\n chatId: number,\n lastMessageId: number,\n isDeleting?: boolean,\n) {\n const { channelPostId, fromChatId } = originMessage.forwardInfo || {};\n if (channelPostId && fromChatId) {\n const threadInfoOld = selectThreadInfo(global, chatId, channelPostId);\n if (threadInfoOld) {\n global = replaceThreadParam(global, chatId, channelPostId, 'threadInfo', {\n ...threadInfoOld,\n lastMessageId,\n messagesCount: threadInfoOld.messagesCount + (isDeleting ? -1 : 1),\n });\n }\n }\n return global;\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiSticker, ApiStickerSet, ApiVideo } from '../../api/types';\nimport { buildCollectionByKey, unique } from '../../util/iteratees';\nimport { selectStickersForEmoji } from '../selectors';\n\nexport function updateStickerSets(\n global: GlobalState,\n category: 'added' | 'featured' | 'search',\n hash: number,\n sets: ApiStickerSet[],\n resultIds?: string[],\n): GlobalState {\n const updatedSets = sets.map((stickerSet) => {\n const existing = global.stickers.setsById[stickerSet.id];\n if (!existing) {\n return stickerSet;\n }\n\n return {\n ...existing,\n ...stickerSet,\n };\n });\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n setsById: {\n ...global.stickers.setsById,\n ...buildCollectionByKey(updatedSets, 'id'),\n },\n [category]: {\n ...global.stickers[category],\n hash,\n ...(\n category === 'search'\n ? { resultIds }\n : { setIds: sets.map(({ id }) => id) }\n ),\n },\n },\n };\n}\n\nexport function updateStickerSet(\n global: GlobalState, stickerSetId: string, update: Partial,\n): GlobalState {\n const currentStickerSet = global.stickers.setsById[stickerSetId] || {};\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n setsById: {\n ...global.stickers.setsById,\n [stickerSetId]: {\n ...currentStickerSet,\n ...update,\n },\n },\n },\n };\n}\n\nexport function updateGifSearch(\n global: GlobalState, isNew: boolean, results: ApiVideo[], nextOffset?: string,\n): GlobalState {\n const { results: currentResults } = global.gifs.search;\n\n let newResults!: ApiVideo[];\n if (isNew || !currentResults) {\n newResults = results;\n } else {\n const currentIds = new Set(currentResults.map((gif) => gif.id));\n newResults = [\n ...currentResults,\n ...results.filter((gif) => !currentIds.has(gif.id)),\n ];\n }\n\n return {\n ...global,\n gifs: {\n ...global.gifs,\n search: {\n ...global.gifs.search,\n offset: nextOffset,\n results: newResults,\n },\n },\n };\n}\n\nexport function replaceAnimatedEmojis(global: GlobalState, stickerSet: ApiStickerSet): GlobalState {\n return {\n ...global,\n animatedEmojis: stickerSet,\n };\n}\n\nexport function updateStickersForEmoji(\n global: GlobalState, emoji: string, remoteStickers?: ApiSticker[], hash?: number,\n): GlobalState {\n const localStickers = selectStickersForEmoji(global, emoji);\n const allStickers = [...localStickers, ...(remoteStickers || [])];\n const uniqueIds = unique(allStickers.map(({ id }) => id));\n const byId = buildCollectionByKey(allStickers, 'id');\n const stickers = uniqueIds.map((id) => byId[id]);\n\n return {\n ...global,\n stickers: {\n ...global.stickers,\n forEmoji: {\n emoji,\n stickers,\n hash,\n },\n },\n };\n}\n\nexport function rebuildStickersForEmoji(global: GlobalState): GlobalState {\n const { emoji, stickers, hash } = global.stickers.forEmoji || {};\n if (!emoji) {\n return global;\n }\n\n return updateStickersForEmoji(global, emoji, stickers, hash);\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiUser } from '../../api/types';\n\nimport { omit } from '../../util/iteratees';\nimport { MEMO_EMPTY_ARRAY } from '../../util/memo';\n\nexport function replaceUsers(global: GlobalState, newById: Record): GlobalState {\n return {\n ...global,\n users: {\n ...global.users,\n byId: newById,\n },\n };\n}\n\n// @optimization Don't spread/unspread global for each element, do it in a batch\nfunction getUpdatedUser(global: GlobalState, userId: number, userUpdate: Partial): ApiUser {\n const { byId } = global.users;\n const user = byId[userId];\n const shouldOmitMinInfo = userUpdate.isMin && user && !user.isMin;\n\n const updatedUser = {\n ...user,\n ...(shouldOmitMinInfo ? omit(userUpdate, ['isMin', 'accessHash']) : userUpdate),\n };\n\n if (!updatedUser.id || !updatedUser.type) {\n return user;\n }\n\n return updatedUser;\n}\n\nfunction updateContactList(global: GlobalState, updatedUsers: ApiUser[]): GlobalState {\n const { hash, userIds: contactUserIds } = global.contactList || {};\n\n if (!contactUserIds) return global;\n\n const newContactUserIds = updatedUsers\n .filter((user) => user?.isContact && !contactUserIds.includes(user.id))\n .map((user) => user.id);\n\n if (newContactUserIds.length === 0) return global;\n\n return {\n ...global,\n contactList: {\n hash: hash || 0,\n userIds: [\n ...newContactUserIds,\n ...contactUserIds,\n ],\n },\n };\n}\n\nexport function updateUser(global: GlobalState, userId: number, userUpdate: Partial): GlobalState {\n const { byId } = global.users;\n\n const updatedUser = getUpdatedUser(global, userId, userUpdate);\n\n global = updateContactList(global, [updatedUser]);\n\n return replaceUsers(global, {\n ...byId,\n [userId]: updatedUser,\n });\n}\n\nexport function updateUsers(global: GlobalState, updatedById: Record): GlobalState {\n const updatedUsers = Object.keys(updatedById).map(Number).reduce>((acc, id) => {\n const updatedUser = getUpdatedUser(global, id, updatedById[id]);\n if (updatedUser) {\n acc[id] = updatedUser;\n }\n return acc;\n }, {});\n\n global = updateContactList(global, Object.values(updatedUsers));\n\n global = replaceUsers(global, {\n ...global.users.byId,\n ...updatedUsers,\n });\n\n return global;\n}\n\n// @optimization Allows to avoid redundant updates which cause a lot of renders\nexport function addUsers(global: GlobalState, addedById: Record): GlobalState {\n const { byId } = global.users;\n let isAdded = false;\n\n const addedUsers = Object.keys(addedById).map(Number).reduce>((acc, id) => {\n if (!byId[id] || (byId[id].isMin && !addedById[id].isMin)) {\n const updatedUser = getUpdatedUser(global, id, addedById[id]);\n if (updatedUser) {\n acc[id] = updatedUser;\n\n if (!isAdded) {\n isAdded = true;\n }\n }\n }\n return acc;\n }, {});\n\n if (isAdded) {\n global = replaceUsers(global, {\n ...global.users.byId,\n ...addedUsers,\n });\n\n global = updateContactList(global, Object.values(addedUsers));\n }\n\n return global;\n}\n\nexport function updateSelectedUserId(global: GlobalState, selectedId?: number): GlobalState {\n if (global.users.selectedId === selectedId) {\n return global;\n }\n\n return {\n ...global,\n users: {\n ...global.users,\n selectedId,\n },\n };\n}\n\nexport function deleteUser(global: GlobalState, userId: number): GlobalState {\n const { byId } = global.users;\n const { hash, userIds } = global.contactList || {};\n delete byId[userId];\n\n global = {\n ...global,\n contactList: {\n hash: hash || 0,\n userIds: userIds ? userIds.filter((id) => id !== userId) : MEMO_EMPTY_ARRAY,\n },\n };\n\n return replaceUsers(global, byId);\n}\n\nexport function updateUserSearch(\n global: GlobalState,\n searchStatePartial: Partial,\n) {\n return {\n ...global,\n userSearch: {\n ...global.userSearch,\n ...searchStatePartial,\n },\n };\n}\n\nexport function updateUserSearchFetchingStatus(\n global: GlobalState, newState: boolean,\n) {\n return updateUserSearch(global, {\n fetchingStatus: newState,\n });\n}\n\nexport function updateUserBlockedState(global: GlobalState, userId: number, isBlocked: boolean) {\n const { byId } = global.users;\n const user = byId[userId];\n if (!user || !user.fullInfo) {\n return global;\n }\n\n return updateUser(global, userId, {\n ...user,\n fullInfo: {\n ...user.fullInfo,\n isBlocked,\n },\n });\n}\n","import { GlobalState } from '../../global/types';\nimport { GlobalSearchContent } from '../../types';\nimport { ApiGlobalMessageSearchType, ApiMessage } from '../../api/types';\nimport { areSortedArraysEqual } from '../../util/iteratees';\n\nconst getComplexKey = (message: ApiMessage) => `${message.chatId}_${message.id}`;\n\nexport function updateGlobalSearch(\n global: GlobalState,\n searchStatePartial: Partial,\n) {\n return {\n ...global,\n globalSearch: {\n ...global.globalSearch,\n ...searchStatePartial,\n },\n };\n}\n\nexport function updateGlobalSearchContent(\n global: GlobalState,\n currentContent: GlobalSearchContent | undefined,\n): GlobalState {\n return updateGlobalSearch(global, { currentContent });\n}\n\nexport function updateGlobalSearchResults(\n global: GlobalState,\n newFoundMessages: ApiMessage[],\n totalCount: number,\n type: ApiGlobalMessageSearchType,\n nextRate?: number,\n): GlobalState {\n const { resultsByType } = global.globalSearch || {};\n const newFoundMessagesById = newFoundMessages.reduce((result, message) => {\n result[getComplexKey(message)] = message;\n\n return result;\n }, {} as Record);\n const foundIdsForType = resultsByType?.[type]?.foundIds;\n\n if (foundIdsForType !== undefined\n && Object.keys(newFoundMessagesById).every(\n (newId) => foundIdsForType.includes(getComplexKey(newFoundMessagesById[newId])),\n )\n ) {\n return updateGlobalSearchFetchingStatus(global, { messages: false });\n }\n\n const prevFoundIds = foundIdsForType || [];\n const newFoundIds = newFoundMessages.map((message) => getComplexKey(message));\n const foundIds = Array.prototype.concat(prevFoundIds, newFoundIds);\n const foundOrPrevFoundIds = areSortedArraysEqual(prevFoundIds, foundIds) ? prevFoundIds : foundIds;\n\n global = updateGlobalSearchFetchingStatus(global, { messages: false });\n\n return updateGlobalSearch(global, {\n resultsByType: {\n ...(global.globalSearch || {}).resultsByType,\n [type]: {\n totalCount,\n nextOffsetId: nextRate,\n foundIds: foundOrPrevFoundIds,\n },\n },\n });\n}\n\nexport function updateGlobalSearchFetchingStatus(\n global: GlobalState, newState: { chats?: boolean; messages?: boolean },\n) {\n return updateGlobalSearch(global, {\n fetchingStatus: {\n ...global.globalSearch.fetchingStatus,\n ...newState,\n },\n });\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiMessageSearchType } from '../../api/types';\n\nimport { areSortedArraysEqual, unique } from '../../util/iteratees';\nimport { SharedMediaType } from '../../types';\nimport { buildChatThreadKey } from '../helpers';\n\ninterface TextSearchParams {\n isActive: boolean;\n query?: string;\n results?: {\n totalCount?: number;\n nextOffsetId?: number;\n foundIds?: number[];\n };\n}\n\ninterface MediaSearchParams {\n currentType?: SharedMediaType;\n resultsByType?: Partial>;\n}\n\nfunction replaceLocalTextSearch(\n global: GlobalState,\n chatThreadKey: string,\n searchParams: TextSearchParams,\n): GlobalState {\n return {\n ...global,\n localTextSearch: {\n byChatThreadKey: {\n ...global.localTextSearch.byChatThreadKey,\n [chatThreadKey]: searchParams,\n },\n },\n };\n}\n\nexport function updateLocalTextSearch(\n global: GlobalState,\n chatId: number,\n threadId: number,\n isActive: boolean,\n query?: string,\n): GlobalState {\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n\n return replaceLocalTextSearch(global, chatThreadKey, {\n ...global.localTextSearch.byChatThreadKey[chatThreadKey],\n isActive,\n query,\n });\n}\n\nexport function replaceLocalTextSearchResults(\n global: GlobalState,\n chatId: number,\n threadId: number,\n foundIds?: number[],\n totalCount?: number,\n nextOffsetId?: number,\n): GlobalState {\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n\n return replaceLocalTextSearch(global, chatThreadKey, {\n ...global.localTextSearch.byChatThreadKey[chatThreadKey],\n results: {\n foundIds,\n totalCount,\n nextOffsetId,\n },\n });\n}\n\nexport function updateLocalTextSearchResults(\n global: GlobalState,\n chatId: number,\n threadId: number,\n newFoundIds: number[],\n totalCount?: number,\n nextOffsetId?: number,\n): GlobalState {\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n const { results } = global.localTextSearch.byChatThreadKey[chatThreadKey] || {};\n const prevFoundIds = (results?.foundIds) || [];\n const foundIds = orderFoundIds(unique(Array.prototype.concat(prevFoundIds, newFoundIds)));\n const foundOrPrevFoundIds = areSortedArraysEqual(prevFoundIds, foundIds) ? prevFoundIds : foundIds;\n\n return replaceLocalTextSearchResults(global, chatId, threadId, foundOrPrevFoundIds, totalCount, nextOffsetId);\n}\n\nfunction replaceLocalMediaSearch(\n global: GlobalState,\n chatId: number,\n searchParams: MediaSearchParams,\n): GlobalState {\n return {\n ...global,\n localMediaSearch: {\n byChatId: {\n ...global.localMediaSearch.byChatId,\n [chatId]: searchParams,\n },\n },\n };\n}\n\nexport function updateLocalMediaSearchType(\n global: GlobalState,\n chatId: number,\n currentType: SharedMediaType | undefined,\n): GlobalState {\n return replaceLocalMediaSearch(global, chatId, {\n ...global.localMediaSearch.byChatId[chatId],\n currentType,\n });\n}\n\nexport function replaceLocalMediaSearchResults(\n global: GlobalState,\n chatId: number,\n type: ApiMessageSearchType,\n foundIds?: number[],\n totalCount?: number,\n nextOffsetId?: number,\n): GlobalState {\n return replaceLocalMediaSearch(global, chatId, {\n ...global.localMediaSearch.byChatId[chatId],\n resultsByType: {\n ...(global.localMediaSearch.byChatId[chatId] || {}).resultsByType,\n [type]: {\n foundIds,\n totalCount,\n nextOffsetId,\n },\n },\n });\n}\n\nexport function updateLocalMediaSearchResults(\n global: GlobalState,\n chatId: number,\n type: SharedMediaType,\n newFoundIds: number[],\n totalCount?: number,\n nextOffsetId?: number,\n): GlobalState {\n const { resultsByType } = global.localMediaSearch.byChatId[chatId] || {};\n const prevFoundIds = resultsByType?.[type] ? resultsByType[type]!.foundIds : [];\n const foundIds = orderFoundIds(unique(Array.prototype.concat(prevFoundIds, newFoundIds)));\n const foundOrPrevFoundIds = areSortedArraysEqual(prevFoundIds, foundIds) ? prevFoundIds : foundIds;\n\n return replaceLocalMediaSearchResults(global, chatId, type, foundOrPrevFoundIds, totalCount, nextOffsetId);\n}\n\nfunction orderFoundIds(listedIds: number[]) {\n return listedIds.sort((a, b) => a - b);\n}\n","import { GlobalState } from '../../global/types';\nimport { ManagementProgress } from '../../types';\n\ninterface ManagementState {\n isActive: boolean;\n isUsernameAvailable?: boolean;\n error?: string;\n}\n\nexport function updateManagementProgress(global: GlobalState, progress: ManagementProgress): GlobalState {\n return {\n ...global,\n management: {\n ...global.management,\n progress,\n },\n };\n}\n\nexport function updateManagement(global: GlobalState, chatId: number, update: Partial): GlobalState {\n return {\n ...global,\n management: {\n ...global.management,\n byChatId: {\n ...global.management.byChatId,\n [chatId]: {\n ...(global.management.byChatId[chatId] || {}),\n ...update,\n },\n },\n },\n };\n}\n","import { GlobalState } from '../../global/types';\nimport {\n ISettings, IThemeSettings, ThemeKey, NotifyException,\n} from '../../types';\nimport { ApiNotifyException } from '../../api/types';\nimport { updateUserBlockedState } from './users';\n\nexport function replaceSettings(global: GlobalState, newSettings?: Partial): GlobalState {\n return {\n ...global,\n settings: {\n ...global.settings,\n byKey: {\n ...global.settings.byKey,\n ...newSettings,\n },\n },\n };\n}\n\nexport function replaceThemeSettings(\n global: GlobalState, theme: ThemeKey, newSettings?: Partial,\n): GlobalState {\n return {\n ...global,\n settings: {\n ...global.settings,\n themes: {\n ...global.settings.themes,\n [theme]: {\n ...(global.settings.themes[theme] || {}),\n ...newSettings,\n },\n },\n },\n };\n}\n\nexport function addNotifyExceptions(\n global: GlobalState, notifyExceptions: ApiNotifyException[],\n): GlobalState {\n notifyExceptions.forEach((notifyException) => {\n const { chatId, ...exceptionData } = notifyException;\n global = addNotifyException(global, chatId, exceptionData);\n });\n\n return global;\n}\n\nexport function addNotifyException(\n global: GlobalState, id: number, notifyException: NotifyException,\n): GlobalState {\n return {\n ...global,\n settings: {\n ...global.settings,\n notifyExceptions: {\n ...global.settings.notifyExceptions,\n [id]: notifyException,\n },\n },\n };\n}\n\nexport function updateNotifySettings(\n global: GlobalState, peerType: 'contact' | 'group' | 'broadcast', isSilent?: boolean, shouldShowPreviews?: boolean,\n) {\n switch (peerType) {\n case 'contact':\n return replaceSettings(global, {\n ...(typeof isSilent !== 'undefined' && { hasPrivateChatsNotifications: !isSilent }),\n ...(typeof shouldShowPreviews !== 'undefined' && { hasPrivateChatsMessagePreview: shouldShowPreviews }),\n });\n case 'group':\n return replaceSettings(global, {\n ...(typeof isSilent !== 'undefined' && { hasGroupNotifications: !isSilent }),\n ...(typeof shouldShowPreviews !== 'undefined' && { hasGroupMessagePreview: shouldShowPreviews }),\n });\n case 'broadcast':\n return replaceSettings(global, {\n ...(typeof isSilent !== 'undefined' && { hasBroadcastNotifications: !isSilent }),\n ...(typeof shouldShowPreviews !== 'undefined' && { hasBroadcastMessagePreview: shouldShowPreviews }),\n });\n\n default:\n return undefined;\n }\n}\n\nexport function addBlockedContact(global: GlobalState, contactId: number): GlobalState {\n global = updateUserBlockedState(global, contactId, true);\n\n return {\n ...global,\n blocked: {\n ...global.blocked,\n ids: [contactId, ...global.blocked.ids],\n totalCount: global.blocked.totalCount + 1,\n },\n };\n}\n\nexport function removeBlockedContact(global: GlobalState, contactId: number): GlobalState {\n global = updateUserBlockedState(global, contactId, false);\n\n return {\n ...global,\n blocked: {\n ...global.blocked,\n ids: global.blocked.ids.filter((id) => id !== contactId),\n totalCount: global.blocked.totalCount - 1,\n },\n };\n}\n","import { GlobalState } from '../../global/types';\n\nexport function updateTwoFaSettings(\n global: GlobalState,\n update: GlobalState['twoFaSettings'],\n): GlobalState {\n return {\n ...global,\n twoFaSettings: {\n ...global.twoFaSettings,\n ...update,\n },\n };\n}\n","import { GlobalState } from '../../global/types';\nimport { ShippingOption, PaymentStep } from '../../types';\nimport { ApiMessage, ApiPaymentForm, ApiReceipt } from '../../api/types';\n\nexport function updateShippingOptions(\n global: GlobalState,\n shippingOptions: ShippingOption[],\n): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n shippingOptions,\n },\n };\n}\n\nexport function setRequestInfoId(global: GlobalState, id: string): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n requestId: id,\n },\n };\n}\n\nexport function setPaymentStep(global: GlobalState, step: PaymentStep): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n step,\n },\n };\n}\n\nexport function setInvoiceMessageInfo(global: GlobalState, message: ApiMessage): GlobalState {\n if (!message.content || !message.content.invoice) {\n return global;\n }\n const {\n title,\n text,\n amount,\n currency,\n isTest,\n photoUrl,\n } = message.content.invoice;\n return {\n ...global,\n payment: {\n ...global.payment,\n invoiceContent: {\n title,\n text,\n photoUrl,\n amount,\n currency,\n isTest,\n },\n },\n };\n}\n\nexport function setStripeCardInfo(global: GlobalState, cardInfo: { type: string; id: string }): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n stripeCredentials: {\n ...cardInfo,\n },\n },\n };\n}\n\nexport function setPaymentForm(global: GlobalState, form: ApiPaymentForm): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n ...form,\n },\n };\n}\n\nexport function setReceipt(\n global: GlobalState,\n receipt?: ApiReceipt,\n message?: ApiMessage,\n): GlobalState {\n if (!receipt || !message) {\n return {\n ...global,\n payment: {\n ...global.payment,\n receipt: undefined,\n },\n };\n }\n\n const { invoice: messageInvoice } = message.content;\n const { photoUrl, text, title } = (messageInvoice || {});\n\n return {\n ...global,\n payment: {\n ...global.payment,\n receipt: {\n ...receipt,\n photoUrl,\n text,\n title,\n },\n },\n };\n}\n\nexport function clearPayment(global: GlobalState): GlobalState {\n return {\n ...global,\n payment: {},\n };\n}\n\nexport function closeInvoice(global: GlobalState): GlobalState {\n return {\n ...global,\n payment: {\n ...global.payment,\n isPaymentModalOpen: false,\n },\n };\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiChat, ApiUser } from '../../api/types';\n\nexport function selectUser(global: GlobalState, userId: number): ApiUser | undefined {\n return global.users.byId[userId];\n}\n\nexport function selectIsUserBlocked(global: GlobalState, userId: number) {\n const user = selectUser(global, userId);\n\n return user?.fullInfo?.isBlocked;\n}\n\n// Slow, not to be used in `withGlobal`\nexport function selectUserByUsername(global: GlobalState, username: string) {\n const usernameLowered = username.toLowerCase();\n return Object.values(global.users.byId).find(\n (user) => user.username.toLowerCase() === usernameLowered,\n );\n}\n\nexport function selectIsUserOrChatContact(global: GlobalState, userOrChat: ApiUser | ApiChat) {\n return global.contactList && global.contactList.userIds.includes(userOrChat.id);\n}\n","import { GlobalState } from '../../global/types';\n\nexport function selectNotifySettings(global: GlobalState) {\n return global.settings.byKey;\n}\n\nexport function selectNotifyExceptions(global: GlobalState) {\n return global.settings.notifyExceptions;\n}\n","import { ApiChat, MAIN_THREAD_ID } from '../../api/types';\nimport { GlobalState } from '../../global/types';\n\nimport {\n getPrivateChatUserId, isChatChannel, isChatPrivate, isHistoryClearMessage, isUserBot, isUserOnline, selectIsChatMuted,\n} from '../helpers';\nimport { selectUser } from './users';\nimport { ALL_FOLDER_ID, ARCHIVED_FOLDER_ID, MEMBERS_LOAD_SLICE } from '../../config';\nimport { selectNotifyExceptions, selectNotifySettings } from './settings';\n\nexport function selectChat(global: GlobalState, chatId: number): ApiChat | undefined {\n return global.chats.byId[chatId];\n}\n\nexport function selectChatUser(global: GlobalState, chat: ApiChat) {\n const userId = getPrivateChatUserId(chat);\n if (!userId) {\n return false;\n }\n\n return selectUser(global, userId);\n}\n\nexport function selectIsChatWithSelf(global: GlobalState, chatId: number) {\n return chatId === global.currentUserId;\n}\n\nexport function selectIsChatWithBot(global: GlobalState, chat: ApiChat) {\n const user = selectChatUser(global, chat);\n return user && isUserBot(user);\n}\n\nexport function selectSupportChat(global: GlobalState) {\n return Object.values(global.chats.byId).find(({ isSupport }: ApiChat) => isSupport);\n}\n\nexport function selectChatOnlineCount(global: GlobalState, chat: ApiChat) {\n if (isChatPrivate(chat.id) || isChatChannel(chat) || !chat.fullInfo) {\n return undefined;\n }\n\n if (!chat.fullInfo.members || chat.fullInfo.members.length === MEMBERS_LOAD_SLICE) {\n return chat.fullInfo.onlineCount;\n }\n\n return chat.fullInfo.members.reduce((onlineCount, { userId }) => {\n if (global.users.byId[userId] && isUserOnline(global.users.byId[userId]) && userId !== global.currentUserId) {\n return onlineCount + 1;\n }\n\n return onlineCount;\n }, 0);\n}\n\nexport function selectChatBot(global: GlobalState, chatId: number) {\n const chat = selectChat(global, chatId);\n const userId = chat && getPrivateChatUserId(chat);\n const user = userId && selectUser(global, userId);\n if (!user || !isUserBot(user)) {\n return undefined;\n }\n\n return user;\n}\n\nexport function selectIsChatBotNotStarted(global: GlobalState, chatId: number) {\n const chat = selectChat(global, chatId);\n const bot = selectChatBot(global, chatId);\n if (!chat || !bot) {\n return false;\n }\n\n if (chat.lastMessage && isHistoryClearMessage(chat.lastMessage)) {\n return true;\n }\n\n const messageInfo = global.messages.byChatId[chatId];\n if (!messageInfo) {\n return false;\n }\n\n const { listedIds } = messageInfo.threadsById[MAIN_THREAD_ID] || {};\n return listedIds && !listedIds.length;\n}\n\nexport function selectAreActiveChatsLoaded(global: GlobalState): boolean {\n return Boolean(global.chats.listIds.active);\n}\n\nexport function selectIsChatListed(global: GlobalState, chatId: number, type?: 'active' | 'archived'): boolean {\n const { listIds } = global.chats;\n if (type) {\n const targetList = listIds[type];\n return Boolean(targetList && targetList.includes(chatId));\n }\n\n return Object.values(listIds).some((list) => list && list.includes(chatId));\n}\n\nexport function selectChatListType(global: GlobalState, chatId: number): 'active' | 'archived' | undefined {\n const chat = selectChat(global, chatId);\n if (!chat || !selectIsChatListed(global, chatId)) {\n return undefined;\n }\n\n return chat.folderId === ARCHIVED_FOLDER_ID ? 'archived' : 'active';\n}\n\nexport function selectChatFolder(global: GlobalState, folderId: number) {\n return global.chatFolders.byId[folderId];\n}\n\nexport function selectTotalChatCount(global: GlobalState, listType: 'active' | 'archived'): number {\n const { totalCount } = global.chats;\n const allChatsCount = totalCount.all;\n const archivedChatsCount = totalCount.archived || 0;\n\n if (listType === 'archived') {\n return archivedChatsCount;\n }\n\n return allChatsCount ? allChatsCount - archivedChatsCount : 0;\n}\n\nexport function selectIsChatPinned(global: GlobalState, chatId: number, folderId = ALL_FOLDER_ID): boolean {\n const { active, archived } = global.chats.orderedPinnedIds;\n\n if (folderId === ALL_FOLDER_ID) {\n return !!active && active.includes(chatId);\n }\n\n if (folderId === ARCHIVED_FOLDER_ID) {\n return !!archived && archived.includes(chatId);\n }\n\n const { byId: chatFoldersById } = global.chatFolders;\n\n const { pinnedChatIds } = chatFoldersById[folderId] || {};\n return !!pinnedChatIds && pinnedChatIds.includes(chatId);\n}\n\n// Slow, not to be used in `withGlobal`\nexport function selectChatByUsername(global: GlobalState, username: string) {\n const usernameLowered = username.toLowerCase();\n return Object.values(global.chats.byId).find(\n (chat) => chat.username && chat.username.toLowerCase() === usernameLowered,\n );\n}\n\n// Slow, not to be used in `withGlobal`\nexport function selectCountNotMutedUnread(global: GlobalState) {\n const activeChatIds = global.chats.listIds.active;\n if (!activeChatIds) {\n return 0;\n }\n\n const chats = global.chats.byId;\n const notifySettings = selectNotifySettings(global);\n const notifyExceptions = selectNotifyExceptions(global);\n\n return activeChatIds.reduce((acc, chatId) => {\n const chat = chats[chatId];\n\n if (\n chat\n && chat.unreadCount\n && chat.isListed\n && !chat.isNotJoined\n && !chat.isRestricted\n && (chat.unreadMentionsCount || !selectIsChatMuted(chat, notifySettings, notifyExceptions))\n ) {\n return acc + chat.unreadCount;\n }\n\n return acc;\n }, 0);\n}\n","import { GlobalState } from '../../global/types';\nimport { ApiSticker } from '../../api/types';\n\nexport function selectIsStickerFavorite(global: GlobalState, sticker: ApiSticker) {\n const { stickers } = global.stickers.favorite;\n return stickers && stickers.some(({ id }) => id === sticker.id);\n}\n\nexport function selectCurrentStickerSearch(global: GlobalState) {\n return global.stickers.search;\n}\n\nexport function selectCurrentGifSearch(global: GlobalState) {\n return global.gifs.search;\n}\n\nexport function selectStickerSet(global: GlobalState, id: string) {\n return global.stickers.setsById[id];\n}\n\nexport function selectStickerSetByShortName(global: GlobalState, shortName: string) {\n return Object.values(global.stickers.setsById).find((l) => l.shortName.toLowerCase() === shortName.toLowerCase());\n}\n\nexport function selectStickersForEmoji(global: GlobalState, emoji: string) {\n const stickerSets = Object.values(global.stickers.setsById);\n let stickersForEmoji: ApiSticker[] = [];\n stickerSets.forEach(({ packs }) => {\n if (!packs) {\n return;\n }\n const stickers = packs[emoji];\n if (stickers) {\n stickersForEmoji = stickersForEmoji.concat(stickers);\n }\n });\n return stickersForEmoji;\n}\n\nexport function selectAnimatedEmoji(global: GlobalState, emoji: string) {\n const { animatedEmojis } = global;\n if (!animatedEmojis || !animatedEmojis.stickers) {\n return undefined;\n }\n\n // Some emojis (❤️ for example) with a service symbol 'VARIATION SELECTOR-16' are not recognized as animated\n const cleanedEmoji = emoji.replace('\\ufe0f', '');\n\n return animatedEmojis.stickers.find((sticker) => sticker.emoji === emoji || sticker.emoji === cleanedEmoji);\n}\n","import { GlobalState, MessageListType, Thread } from '../../global/types';\nimport {\n ApiChat,\n ApiMessage,\n ApiMessageOutgoingStatus,\n ApiUser,\n MAIN_THREAD_ID,\n} from '../../api/types';\n\nimport { LOCAL_MESSAGE_ID_BASE } from '../../config';\nimport {\n selectChat, selectIsChatWithBot, selectIsChatWithSelf,\n} from './chats';\nimport { selectIsUserOrChatContact, selectUser } from './users';\nimport {\n getSendingState,\n isChatChannel,\n isMessageLocal,\n isChatPrivate,\n isForwardedMessage,\n getCanPostInChat,\n isUserRightBanned,\n getHasAdminRight,\n isChatBasicGroup,\n isCommonBoxChat,\n isServiceNotificationMessage,\n isOwnMessage,\n isActionMessage,\n isChatGroup,\n isChatSuperGroup,\n getMessageVideo,\n getMessageWebPageVideo,\n} from '../helpers';\nimport { findLast } from '../../util/iteratees';\nimport { selectIsStickerFavorite } from './symbols';\nimport { getServerTime } from '../../util/serverTime';\n\nconst MESSAGE_EDIT_ALLOWED_TIME = 172800; // 48 hours\n\nexport function selectCurrentMessageList(global: GlobalState) {\n const { messageLists } = global.messages;\n\n if (messageLists.length) {\n return messageLists[messageLists.length - 1];\n }\n\n return undefined;\n}\n\nexport function selectCurrentChat(global: GlobalState) {\n const { chatId } = selectCurrentMessageList(global) || {};\n\n return chatId ? selectChat(global, chatId) : undefined;\n}\n\nexport function selectChatMessages(global: GlobalState, chatId: number) {\n return global.messages.byChatId[chatId]?.byId;\n}\n\nexport function selectScheduledMessages(global: GlobalState, chatId: number) {\n return global.scheduledMessages.byChatId[chatId]?.byId;\n}\n\nexport function selectThreadParam(\n global: GlobalState,\n chatId: number,\n threadId: number,\n key: K,\n) {\n const messageInfo = global.messages.byChatId[chatId];\n if (!messageInfo) {\n return undefined;\n }\n\n const thread = messageInfo.threadsById[threadId];\n if (!thread) {\n return undefined;\n }\n\n return thread[key];\n}\n\nexport function selectListedIds(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'listedIds');\n}\n\nexport function selectOutlyingIds(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'outlyingIds');\n}\n\nexport function selectCurrentMessageIds(\n global: GlobalState, chatId: number, threadId: number, messageListType: MessageListType,\n) {\n switch (messageListType) {\n case 'thread':\n return selectViewportIds(global, chatId, threadId);\n case 'pinned':\n return selectPinnedIds(global, chatId);\n case 'scheduled':\n return selectScheduledIds(global, chatId);\n }\n\n return undefined;\n}\n\nexport function selectViewportIds(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'viewportIds');\n}\n\nexport function selectPinnedIds(global: GlobalState, chatId: number) {\n return selectThreadParam(global, chatId, MAIN_THREAD_ID, 'pinnedIds');\n}\n\nexport function selectScheduledIds(global: GlobalState, chatId: number) {\n return selectThreadParam(global, chatId, MAIN_THREAD_ID, 'scheduledIds');\n}\n\nexport function selectScrollOffset(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'scrollOffset');\n}\n\nexport function selectReplyingToId(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'replyingToId');\n}\n\nexport function selectEditingId(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'editingId');\n}\n\nexport function selectEditingScheduledId(global: GlobalState, chatId: number) {\n return selectThreadParam(global, chatId, MAIN_THREAD_ID, 'editingScheduledId');\n}\n\nexport function selectDraft(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'draft');\n}\n\nexport function selectNoWebPage(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'noWebPage');\n}\n\nexport function selectThreadInfo(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'threadInfo');\n}\n\nexport function selectFirstMessageId(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'firstMessageId');\n}\n\nexport function selectReplyStack(global: GlobalState, chatId: number, threadId: number) {\n return selectThreadParam(global, chatId, threadId, 'replyStack');\n}\n\nexport function selectThreadOriginChat(global: GlobalState, chatId: number, threadId: number) {\n if (threadId === MAIN_THREAD_ID) {\n return selectChat(global, chatId);\n }\n\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo) {\n return undefined;\n }\n\n return selectChat(global, threadInfo.originChannelId || chatId);\n}\n\nexport function selectThreadTopMessageId(global: GlobalState, chatId: number, threadId: number) {\n if (threadId === MAIN_THREAD_ID) {\n return undefined;\n }\n\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo) {\n return undefined;\n }\n\n return threadInfo.topMessageId;\n}\n\nexport function selectThreadByMessage(global: GlobalState, chatId: number, message: ApiMessage) {\n const messageInfo = global.messages.byChatId[chatId];\n if (!messageInfo) {\n return undefined;\n }\n\n const { replyToMessageId, replyToTopMessageId } = message;\n if (!replyToMessageId && !replyToTopMessageId) {\n return undefined;\n }\n\n return Object.values(messageInfo.threadsById).find((thread) => {\n return thread.threadInfo && (\n (replyToMessageId && replyToMessageId === thread.threadInfo.topMessageId)\n || (replyToTopMessageId && replyToTopMessageId === thread.threadInfo.topMessageId)\n );\n });\n}\n\nexport function isMessageInCurrentMessageList(global: GlobalState, chatId: number, message: ApiMessage) {\n const currentMessageList = selectCurrentMessageList(global);\n if (!currentMessageList) {\n return false;\n }\n\n const { threadInfo } = selectThreadByMessage(global, chatId, message) || {};\n return (\n chatId === currentMessageList.chatId\n && (\n (currentMessageList.threadId === MAIN_THREAD_ID)\n || (threadInfo && currentMessageList.threadId === threadInfo.threadId)\n )\n );\n}\n\nexport function selectIsViewportNewest(global: GlobalState, chatId: number, threadId: number) {\n const viewportIds = selectViewportIds(global, chatId, threadId);\n if (!viewportIds || !viewportIds.length) {\n return true;\n }\n\n let lastMessageId: number;\n\n if (threadId === MAIN_THREAD_ID) {\n const chat = selectChat(global, chatId);\n if (!chat || !chat.lastMessage) {\n return true;\n }\n\n lastMessageId = chat.lastMessage.id;\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo || !threadInfo.lastMessageId) {\n return undefined;\n }\n\n lastMessageId = threadInfo.lastMessageId;\n }\n\n // Edge case: outgoing `lastMessage` is updated with a delay to optimize animation\n if (lastMessageId >= LOCAL_MESSAGE_ID_BASE && !selectChatMessage(global, chatId, lastMessageId)) {\n return true;\n }\n\n return viewportIds[viewportIds.length - 1] >= lastMessageId;\n}\n\nexport function selectChatMessage(global: GlobalState, chatId: number, messageId: number) {\n const chatMessages = selectChatMessages(global, chatId);\n\n return chatMessages ? chatMessages[messageId] : undefined;\n}\n\nexport function selectScheduledMessage(global: GlobalState, chatId: number, messageId: number) {\n const chatMessages = selectScheduledMessages(global, chatId);\n\n return chatMessages ? chatMessages[messageId] : undefined;\n}\n\nexport function selectEditingMessage(\n global: GlobalState, chatId: number, threadId: number, messageListType: MessageListType,\n) {\n if (messageListType === 'scheduled') {\n const messageId = selectEditingScheduledId(global, chatId);\n return messageId ? selectScheduledMessage(global, chatId, messageId) : undefined;\n } else {\n const messageId = selectEditingId(global, chatId, threadId);\n return messageId ? selectChatMessage(global, chatId, messageId) : undefined;\n }\n}\n\nexport function selectChatMessageByPollId(global: GlobalState, pollId: string) {\n let messageWithPoll: ApiMessage | undefined;\n\n // eslint-disable-next-line no-restricted-syntax\n for (const chatMessages of Object.values(global.messages.byChatId)) {\n const { byId } = chatMessages;\n messageWithPoll = Object.values(byId).find((message) => {\n return message.content.poll && message.content.poll.id === pollId;\n });\n if (messageWithPoll) {\n break;\n }\n }\n\n return messageWithPoll;\n}\n\nexport function selectFocusedMessageId(global: GlobalState, chatId: number) {\n const { chatId: focusedChatId, messageId } = global.focusedMessage || {};\n\n return focusedChatId === chatId ? messageId : undefined;\n}\n\nexport function selectIsMessageFocused(global: GlobalState, message: ApiMessage) {\n const focusedId = selectFocusedMessageId(global, message.chatId);\n\n return focusedId ? focusedId === message.id || focusedId === message.previousLocalId : false;\n}\n\nexport function selectIsMessageUnread(global: GlobalState, message: ApiMessage) {\n const { lastReadOutboxMessageId } = selectChat(global, message.chatId) || {};\n return isMessageLocal(message) || !lastReadOutboxMessageId || lastReadOutboxMessageId < message.id;\n}\n\nexport function selectOutgoingStatus(\n global: GlobalState, message: ApiMessage, isScheduledList = false,\n): ApiMessageOutgoingStatus {\n if (!selectIsMessageUnread(global, message) && !isScheduledList) {\n return 'read';\n }\n\n return getSendingState(message);\n}\n\nexport function selectSender(global: GlobalState, message: ApiMessage): ApiUser | ApiChat | undefined {\n const { senderId } = message;\n if (!senderId) {\n return undefined;\n }\n\n return senderId > 0 ? selectUser(global, senderId) : selectChat(global, senderId);\n}\n\nexport function selectForwardedSender(global: GlobalState, message: ApiMessage): ApiUser | ApiChat | undefined {\n const { forwardInfo } = message;\n if (!forwardInfo) {\n return undefined;\n }\n\n if (forwardInfo.isChannelPost && forwardInfo.fromChatId) {\n return selectChat(global, forwardInfo.fromChatId);\n } else if (forwardInfo.senderUserId) {\n return selectUser(global, forwardInfo.senderUserId) || selectChat(global, forwardInfo.senderUserId);\n }\n\n return undefined;\n}\n\nexport function selectAllowedMessageActions(global: GlobalState, message: ApiMessage, threadId: number) {\n const chat = selectChat(global, message.chatId);\n if (!chat || chat.isRestricted) {\n return {};\n }\n\n const isPrivate = isChatPrivate(chat.id);\n const isChatWithSelf = selectIsChatWithSelf(global, message.chatId);\n const isBasicGroup = isChatBasicGroup(chat);\n const isSuperGroup = isChatSuperGroup(chat);\n const isChannel = isChatChannel(chat);\n const isServiceNotification = isServiceNotificationMessage(message);\n\n const isOwn = isOwnMessage(message);\n const isAction = isActionMessage(message);\n const { content } = message;\n const canEditMessagesIndefinitely = isChatWithSelf\n || (isSuperGroup && getHasAdminRight(chat, 'pinMessages'))\n || (isChannel && getHasAdminRight(chat, 'editMessages'));\n const isMessageEditable = (\n (canEditMessagesIndefinitely\n || getServerTime(global.serverTimeOffset) - message.date < MESSAGE_EDIT_ALLOWED_TIME)\n && !(\n content.sticker || content.contact || content.poll || content.action || content.audio\n || (content.video?.isRound)\n )\n && !isForwardedMessage(message)\n && !message.viaBotId\n );\n\n const canReply = getCanPostInChat(chat, threadId) && !isServiceNotification;\n\n const hasPinPermission = isPrivate || (\n chat.isCreator\n || (!isChannel && !isUserRightBanned(chat, 'pinMessages'))\n || getHasAdminRight(chat, 'pinMessages')\n );\n\n let canPin = !isAction && hasPinPermission;\n let canUnpin = false;\n\n const pinnedMessageIds = selectPinnedIds(global, chat.id);\n\n if (canPin) {\n canUnpin = Boolean(pinnedMessageIds && pinnedMessageIds.includes(message.id));\n canPin = !canUnpin;\n }\n\n const canDelete = isPrivate\n || isOwn\n || isBasicGroup\n || chat.isCreator\n || getHasAdminRight(chat, 'deleteMessages');\n\n const canReport = !isPrivate && !isOwn;\n\n const canDeleteForAll = canDelete && !isServiceNotification && (\n (isPrivate && !isChatWithSelf)\n || (isBasicGroup && (\n isOwn || getHasAdminRight(chat, 'deleteMessages') || chat.isCreator\n ))\n );\n\n const canEdit = !isAction && isMessageEditable && (\n isOwn\n || (isChannel && (chat.isCreator || getHasAdminRight(chat, 'editMessages')))\n );\n\n const canForward = !isAction && !isServiceNotification;\n\n const hasSticker = Boolean(message.content.sticker);\n const hasFavoriteSticker = hasSticker && selectIsStickerFavorite(global, message.content.sticker!);\n const canFaveSticker = !isAction && hasSticker && !hasFavoriteSticker;\n const canUnfaveSticker = !isAction && hasFavoriteSticker;\n const canCopy = !isAction;\n const canCopyLink = !isAction && (isChannel || isSuperGroup);\n const canSelect = !isAction;\n const noOptions = [\n canReply,\n canEdit,\n canPin,\n canUnpin,\n canDelete,\n canDeleteForAll,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n ].every((ability) => !ability);\n\n return {\n noOptions,\n canReply,\n canEdit,\n canPin,\n canUnpin,\n canDelete,\n canReport,\n canDeleteForAll,\n canForward,\n canFaveSticker,\n canUnfaveSticker,\n canCopy,\n canCopyLink,\n canSelect,\n };\n}\n\n// This selector always returns a new object which can not be safely used in shallow-equal checks\nexport function selectCanDeleteSelectedMessages(global: GlobalState) {\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n const chatMessages = chatId && selectChatMessages(global, chatId);\n if (!chatMessages || !selectedMessageIds || !threadId) {\n return {};\n }\n\n const messageActions = selectedMessageIds\n .map((id) => chatMessages[id] && selectAllowedMessageActions(global, chatMessages[id], threadId))\n .filter(Boolean);\n\n return {\n canDelete: messageActions.every((actions) => actions.canDelete),\n canDeleteForAll: messageActions.every((actions) => actions.canDeleteForAll),\n };\n}\n\nexport function selectCanReportSelectedMessages(global: GlobalState) {\n const { messageIds: selectedMessageIds } = global.selectedMessages || {};\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n const chatMessages = chatId && selectChatMessages(global, chatId);\n if (!chatMessages || !selectedMessageIds || !threadId) {\n return false;\n }\n\n const messageActions = selectedMessageIds\n .map((id) => chatMessages[id] && selectAllowedMessageActions(global, chatMessages[id], threadId))\n .filter(Boolean);\n\n return messageActions.every((actions) => actions.canReport);\n}\n\nexport function selectUploadProgress(global: GlobalState, message: ApiMessage) {\n return global.fileUploads.byMessageLocalId[message.previousLocalId || message.id]?.progress;\n}\n\nexport function selectRealLastReadId(global: GlobalState, chatId: number, threadId: number) {\n if (threadId === MAIN_THREAD_ID) {\n const chat = selectChat(global, chatId);\n if (!chat) {\n return undefined;\n }\n\n // `lastReadInboxMessageId` is empty for new chats\n if (!chat.lastReadInboxMessageId) {\n return undefined;\n }\n\n if (!chat.lastMessage) {\n return chat.lastReadInboxMessageId;\n }\n\n if (isMessageLocal(chat.lastMessage)) {\n return chat.lastMessage.id;\n }\n\n // Some previously read messages may be deleted\n return Math.min(chat.lastMessage.id, chat.lastReadInboxMessageId);\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo) {\n return undefined;\n }\n\n if (!threadInfo.lastReadInboxMessageId) {\n return threadInfo.topMessageId;\n }\n\n // Some previously read messages may be deleted\n return Math.min(threadInfo.lastReadInboxMessageId, threadInfo.lastMessageId || Infinity);\n }\n}\n\nexport function selectFirstUnreadId(global: GlobalState, chatId: number, threadId: number) {\n const chat = selectChat(global, chatId);\n\n if (threadId === MAIN_THREAD_ID) {\n if (!chat) {\n return undefined;\n }\n } else {\n const threadInfo = selectThreadInfo(global, chatId, threadId);\n if (!threadInfo || threadInfo.lastMessageId === threadInfo.lastReadInboxMessageId) {\n return undefined;\n }\n }\n\n const outlyingIds = selectOutlyingIds(global, chatId, threadId);\n const listedIds = selectListedIds(global, chatId, threadId);\n const byId = selectChatMessages(global, chatId);\n if (!byId || !(outlyingIds || listedIds)) {\n return undefined;\n }\n\n const lastReadId = selectRealLastReadId(global, chatId, threadId);\n if (!lastReadId && chat && chat.isNotJoined) {\n return undefined;\n }\n\n if (outlyingIds) {\n const found = !lastReadId ? outlyingIds[0] : outlyingIds.find((id) => {\n return id > lastReadId && byId[id] && (!byId[id].isOutgoing || byId[id].isFromScheduled);\n });\n if (found) {\n return found;\n }\n }\n\n if (listedIds) {\n const found = !lastReadId ? listedIds[0] : listedIds.find((id) => {\n return id > lastReadId && byId[id] && (!byId[id].isOutgoing || byId[id].isFromScheduled);\n });\n if (found) {\n return found;\n }\n }\n\n return undefined;\n}\n\nexport function selectIsPollResultsOpen(global: GlobalState) {\n const { pollResults } = global;\n return Boolean(pollResults.messageId);\n}\n\nexport function selectIsForwardModalOpen(global: GlobalState) {\n const { forwardMessages } = global;\n return Boolean(forwardMessages.isModalShown);\n}\n\nexport function selectCommonBoxChatId(global: GlobalState, messageId: number) {\n const fromLastMessage = Object.values(global.chats.byId).find((chat) => (\n isCommonBoxChat(chat) && chat.lastMessage && chat.lastMessage.id === messageId\n ));\n if (fromLastMessage) {\n return fromLastMessage.id;\n }\n\n const { byChatId } = global.messages;\n return Number(Object.keys(byChatId).find((chatId) => {\n const chat = selectChat(global, Number(chatId));\n return chat && isCommonBoxChat(chat) && byChatId[chat.id].byId[messageId];\n }));\n}\n\nexport function selectIsInSelectMode(global: GlobalState) {\n const { selectedMessages } = global;\n\n return Boolean(selectedMessages);\n}\n\nexport function selectIsMessageSelected(global: GlobalState, messageId: number) {\n const { messageIds } = global.selectedMessages || {};\n if (!messageIds) {\n return false;\n }\n\n return messageIds.includes(messageId);\n}\n\nexport function selectForwardedMessageIdsByGroupId(global: GlobalState, chatId: number, groupedId: string) {\n const chatMessages = selectChatMessages(global, chatId);\n if (!chatMessages) {\n return undefined;\n }\n\n return Object.values(chatMessages)\n .filter((message) => message.groupedId === groupedId && message.forwardInfo)\n .map(({ forwardInfo }) => forwardInfo!.fromMessageId);\n}\n\nexport function selectMessageIdsByGroupId(global: GlobalState, chatId: number, groupedId: string) {\n const chatMessages = selectChatMessages(global, chatId);\n if (!chatMessages) {\n return undefined;\n }\n\n return Object.keys(chatMessages)\n .map(Number)\n .filter((id) => chatMessages[id].groupedId === groupedId);\n}\n\nexport function selectIsDocumentGroupSelected(global: GlobalState, chatId: number, groupedId: string) {\n const { messageIds: selectedIds } = global.selectedMessages || {};\n if (!selectedIds) {\n return false;\n }\n\n const groupIds = selectMessageIdsByGroupId(global, chatId, groupedId);\n return groupIds && groupIds.every((id) => selectedIds.includes(id));\n}\n\nexport function selectSelectedMessagesCount(global: GlobalState) {\n const { messageIds } = global.selectedMessages || {};\n\n return messageIds ? messageIds.length : 0;\n}\n\nexport function selectNewestMessageWithBotKeyboardButtons(\n global: GlobalState, chatId: number,\n): ApiMessage | undefined {\n const chat = selectChat(global, chatId);\n if (!chat) {\n return undefined;\n }\n\n if (!selectIsChatWithBot(global, chat)) {\n return undefined;\n }\n\n const chatMessages = selectChatMessages(global, chatId);\n const viewportIds = selectViewportIds(global, chatId, MAIN_THREAD_ID);\n if (!chatMessages || !viewportIds) {\n return undefined;\n }\n\n const messageId = findLast(viewportIds, (id) => {\n return !chatMessages[id].isOutgoing && Boolean(chatMessages[id].keyboardButtons);\n });\n\n const replyHideMessageId = findLast(viewportIds, (id) => {\n return Boolean(chatMessages[id].shouldHideKeyboardButtons);\n });\n\n if (messageId && replyHideMessageId && replyHideMessageId > messageId) {\n return undefined;\n }\n\n return messageId ? chatMessages[messageId] : undefined;\n}\n\nexport function selectShouldAutoLoadMedia(\n global: GlobalState, message: ApiMessage, chat: ApiChat, sender?: ApiChat | ApiUser,\n) {\n const {\n shouldAutoDownloadMediaFromContacts,\n shouldAutoDownloadMediaInPrivateChats,\n shouldAutoDownloadMediaInGroups,\n shouldAutoDownloadMediaInChannels,\n } = global.settings.byKey;\n\n return Boolean(\n (shouldAutoDownloadMediaInPrivateChats && isChatPrivate(chat.id))\n || (shouldAutoDownloadMediaInGroups && isChatGroup(chat))\n || (shouldAutoDownloadMediaInChannels && isChatChannel(chat))\n || (shouldAutoDownloadMediaFromContacts && sender && (\n sender.id === global.currentUserId\n || selectIsUserOrChatContact(global, sender)\n )),\n );\n}\n\nexport function selectShouldAutoPlayMedia(global: GlobalState, message: ApiMessage) {\n const video = getMessageVideo(message) || getMessageWebPageVideo(message);\n if (!video) {\n return undefined;\n }\n\n const {\n shouldAutoPlayVideos,\n shouldAutoPlayGifs,\n } = global.settings.byKey;\n\n const asGif = video.isGif || video.isRound;\n\n return (shouldAutoPlayVideos && !asGif) || (shouldAutoPlayGifs && asGif);\n}\n\nexport function selectShouldLoopStickers(global: GlobalState) {\n return global.settings.byKey.shouldLoopStickers;\n}\n","import { GlobalState } from '../../global/types';\nimport { selectCurrentMessageList } from './messages';\nimport { buildChatThreadKey } from '../helpers';\n\nexport function selectCurrentTextSearch(global: GlobalState) {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n const chatThreadKey = buildChatThreadKey(chatId, threadId);\n const currentSearch = global.localTextSearch.byChatThreadKey[chatThreadKey];\n if (!currentSearch || !currentSearch.isActive) {\n return undefined;\n }\n\n return currentSearch;\n}\n\nexport function selectCurrentMediaSearchPeerId(global: GlobalState) {\n const { byChatId } = global.localMediaSearch;\n const { chatId } = selectCurrentMessageList(global) || {};\n const currentProfileUserId = global.users.selectedId;\n\n return currentProfileUserId && byChatId[currentProfileUserId] ? currentProfileUserId : chatId;\n}\n\nexport function selectCurrentMediaSearch(global: GlobalState) {\n const peerId = selectCurrentMediaSearchPeerId(global);\n if (!peerId) {\n return undefined;\n }\n\n return global.localMediaSearch.byChatId[peerId];\n}\n","import { GlobalState } from '../../global/types';\n\nimport { selectCurrentMessageList } from './messages';\nimport { selectChat } from './chats';\nimport { isChatGroup, isChatPrivate } from '../helpers';\n\nexport function selectManagement(global: GlobalState, chatId: number) {\n return global.management.byChatId[chatId];\n}\n\nexport function selectCurrentManagement(global: GlobalState) {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n const currentManagement = global.management.byChatId[chatId];\n if (!currentManagement || !currentManagement.isActive) {\n return undefined;\n }\n\n return currentManagement;\n}\n\nexport function selectCurrentManagementType(global: GlobalState) {\n const { chatId, threadId } = selectCurrentMessageList(global) || {};\n if (!chatId || !threadId) {\n return undefined;\n }\n\n if (isChatPrivate(chatId)) {\n return 'user';\n }\n\n const chat = selectChat(global, chatId);\n if (!chat) {\n return undefined;\n }\n\n if (isChatGroup(chat)) {\n return 'group';\n }\n\n return 'channel';\n}\n","import { GlobalState } from '../../global/types';\nimport { NewChatMembersProgress, RightColumnContent } from '../../types';\n\nimport { getSystemTheme, IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport { selectCurrentMessageList, selectIsPollResultsOpen } from './messages';\nimport { selectCurrentTextSearch } from './localSearch';\nimport { selectCurrentStickerSearch, selectCurrentGifSearch } from './symbols';\nimport { selectAreActiveChatsLoaded } from './chats';\nimport { selectCurrentManagement } from './management';\n\nexport function selectIsMediaViewerOpen(global: GlobalState) {\n const { mediaViewer } = global;\n return Boolean(mediaViewer.messageId || mediaViewer.avatarOwnerId);\n}\n\nexport function selectRightColumnContentKey(global: GlobalState) {\n const {\n users,\n isChatInfoShown,\n newChatMembersProgress,\n } = global;\n\n const isAddingChatMembersShown = newChatMembersProgress !== NewChatMembersProgress.Closed;\n const isPollResults = selectIsPollResultsOpen(global);\n const isSearch = Boolean(!IS_SINGLE_COLUMN_LAYOUT && selectCurrentTextSearch(global));\n const isManagement = selectCurrentManagement(global);\n const stickerSearch = selectCurrentStickerSearch(global);\n const isStickerSearch = stickerSearch.query !== undefined;\n const gifSearch = selectCurrentGifSearch(global);\n const isGifSearch = gifSearch.query !== undefined;\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n const currentProfileUserId = users.selectedId;\n const areActiveChatsLoaded = selectAreActiveChatsLoaded(global);\n const isUserInfo = Boolean(currentProfileUserId && areActiveChatsLoaded);\n const isChatShown = Boolean(currentChatId && areActiveChatsLoaded);\n const isChatInfo = isChatShown && isChatInfoShown;\n\n return isPollResults ? (\n RightColumnContent.PollResults\n ) : isSearch ? (\n RightColumnContent.Search\n ) : isManagement ? (\n RightColumnContent.Management\n ) : isStickerSearch ? (\n RightColumnContent.StickerSearch\n ) : isGifSearch ? (\n RightColumnContent.GifSearch\n ) : isAddingChatMembersShown ? (\n RightColumnContent.AddingMembers\n ) : isUserInfo ? (\n RightColumnContent.UserInfo\n ) : isChatInfo ? (\n RightColumnContent.ChatInfo\n ) : undefined;\n}\n\nexport function selectIsRightColumnShown(global: GlobalState) {\n return selectRightColumnContentKey(global) !== undefined;\n}\n\nexport function selectTheme(global: GlobalState) {\n const { theme, shouldUseSystemTheme } = global.settings.byKey;\n\n return shouldUseSystemTheme ? getSystemTheme() : theme;\n}\n","import { GlobalState } from '../../global/types';\n\nexport function selectCurrentGlobalSearchQuery(global: GlobalState) {\n return global.globalSearch.query;\n}\n","import { GlobalState } from '../../global/types';\n\nexport function selectPaymentChatId(global: GlobalState) {\n return global.payment.chatId;\n}\n\nexport function selectPaymentMessageId(global: GlobalState) {\n return global.payment.messageId;\n}\n\nexport function selectPaymentFormId(global: GlobalState) {\n return global.payment.formId;\n}\n\nexport function selectPaymentRequestId(global: GlobalState) {\n return global.payment.requestId;\n}\n\nexport function selectProviderPublishableKey(global: GlobalState) {\n return global.payment.nativeParams ? global.payment.nativeParams.publishableKey : undefined;\n}\n\nexport function selectStripeCredentials(global: GlobalState) {\n return global.payment.stripeCredentials;\n}\n","import {\n ApiBotInlineMediaResult, ApiBotInlineResult, ApiBotInlineSwitchPm,\n ApiLanguage, ApiMessage, ApiShippingAddress, ApiStickerSet,\n} from '../api/types';\n\nexport enum LoadMoreDirection {\n Backwards,\n Forwards,\n Around,\n}\n\nexport enum FocusDirection {\n Up,\n Down,\n Static,\n}\n\nexport interface IAlbum {\n albumId: string;\n messages: ApiMessage[];\n mainMessage: ApiMessage;\n}\n\nexport type ThemeKey = 'light' | 'dark';\n\nexport interface IThemeSettings {\n background?: string;\n backgroundColor?: string;\n patternColor?: string;\n isBlurred?: boolean;\n}\n\nexport type NotifySettings = {\n hasPrivateChatsNotifications?: boolean;\n hasPrivateChatsMessagePreview?: boolean;\n hasGroupNotifications?: boolean;\n hasGroupMessagePreview?: boolean;\n hasBroadcastNotifications?: boolean;\n hasBroadcastMessagePreview?: boolean;\n hasContactJoinedNotifications?: boolean;\n hasWebNotifications: boolean;\n hasPushNotifications: boolean;\n notificationSoundVolume: number;\n};\n\nexport type LangCode = (\n 'en' | 'ar' | 'be' | 'ca' | 'nl' | 'fr' | 'de' | 'id' | 'it' | 'ko' | 'ms' | 'fa' | 'pl' | 'pt-br' | 'ru' | 'es'\n | 'tr' | 'uk' | 'uz'\n);\n\nexport interface ISettings extends NotifySettings, Record {\n theme: ThemeKey;\n shouldUseSystemTheme: boolean;\n messageTextSize: number;\n animationLevel: 0 | 1 | 2;\n messageSendKeyCombo: 'enter' | 'ctrl-enter';\n shouldAutoDownloadMediaFromContacts: boolean;\n shouldAutoDownloadMediaInPrivateChats: boolean;\n shouldAutoDownloadMediaInGroups: boolean;\n shouldAutoDownloadMediaInChannels: boolean;\n shouldAutoPlayGifs: boolean;\n shouldAutoPlayVideos: boolean;\n shouldSuggestStickers: boolean;\n shouldLoopStickers: boolean;\n hasPassword?: boolean;\n languages?: ApiLanguage[];\n language: LangCode;\n isSensitiveEnabled?: boolean;\n canChangeSensitive?: boolean;\n}\n\nexport interface ApiPrivacySettings {\n visibility: PrivacyVisibility;\n allowUserIds: number[];\n allowChatIds: number[];\n blockUserIds: number[];\n blockChatIds: number[];\n}\n\nexport interface IInputPrivacyContact {\n id: number;\n accessHash?: string;\n}\n\nexport interface IInputPrivacyRules {\n visibility: PrivacyVisibility;\n allowedUsers?: IInputPrivacyContact[];\n allowedChats?: IInputPrivacyContact[];\n blockedUsers?: IInputPrivacyContact[];\n blockedChats?: IInputPrivacyContact[];\n}\n\nexport type IAnchorPosition = {\n x: number;\n y: number;\n};\n\nexport interface ShippingOption {\n id: string;\n title: string;\n amount: number;\n prices: Price[];\n}\n\nexport interface Price {\n label: string;\n amount: number;\n}\n\nexport interface Invoice {\n currency?: string;\n emailRequested?: boolean;\n emailToProvider?: boolean;\n flexible?: boolean;\n nameRequested?: boolean;\n phoneRequested?: boolean;\n phoneToProvider?: boolean;\n prices?: Price[];\n shippingAddressRequested?: boolean;\n test?: boolean;\n}\n\nexport interface Receipt {\n currency: string;\n prices: Price[];\n info?: {\n shippingAddress?: ApiShippingAddress;\n phone?: string;\n name?: string;\n };\n totalAmount: number;\n credentialsTitle: string;\n shippingPrices?: Price[];\n shippingMethod?: string;\n photoUrl?: string;\n text?: string;\n title?: string;\n}\n\nexport enum SettingsScreens {\n Main,\n EditProfile,\n Notifications,\n Language,\n General,\n GeneralChatBackground,\n GeneralChatBackgroundColor,\n Privacy,\n PrivacyPhoneNumber,\n PrivacyLastSeen,\n PrivacyProfilePhoto,\n PrivacyForwarding,\n PrivacyGroupChats,\n PrivacyPhoneNumberAllowedContacts,\n PrivacyPhoneNumberDeniedContacts,\n PrivacyLastSeenAllowedContacts,\n PrivacyLastSeenDeniedContacts,\n PrivacyProfilePhotoAllowedContacts,\n PrivacyProfilePhotoDeniedContacts,\n PrivacyForwardingAllowedContacts,\n PrivacyForwardingDeniedContacts,\n PrivacyGroupChatsAllowedContacts,\n PrivacyGroupChatsDeniedContacts,\n PrivacyActiveSessions,\n PrivacyBlockedUsers,\n Folders,\n FoldersCreateFolder,\n FoldersEditFolder,\n FoldersEditFolderFromChatList,\n FoldersIncludedChats,\n FoldersIncludedChatsFromChatList,\n FoldersExcludedChats,\n FoldersExcludedChatsFromChatList,\n TwoFaDisabled,\n TwoFaNewPassword,\n TwoFaNewPasswordConfirm,\n TwoFaNewPasswordHint,\n TwoFaNewPasswordEmail,\n TwoFaNewPasswordEmailCode,\n TwoFaEnabled,\n TwoFaChangePasswordCurrent,\n TwoFaChangePasswordNew,\n TwoFaChangePasswordConfirm,\n TwoFaChangePasswordHint,\n TwoFaTurnOff,\n TwoFaRecoveryEmailCurrentPassword,\n TwoFaRecoveryEmail,\n TwoFaRecoveryEmailCode,\n TwoFaCongratulations,\n}\n\nexport type StickerSetOrRecent = Pick;\n\nexport enum LeftColumnContent {\n ChatList,\n GlobalSearch,\n Settings,\n Contacts,\n Archived,\n NewChannelStep1,\n NewChannelStep2,\n NewGroupStep1,\n NewGroupStep2,\n}\n\nexport enum GlobalSearchContent {\n ChatList,\n Media,\n Links,\n Files,\n Music,\n Voice,\n}\n\nexport enum RightColumnContent {\n ChatInfo,\n UserInfo,\n Search,\n Management,\n StickerSearch,\n GifSearch,\n PollResults,\n AddingMembers,\n}\n\nexport enum MediaViewerOrigin {\n Inline,\n ScheduledInline,\n SharedMedia,\n ProfileAvatar,\n SettingsAvatar,\n MiddleHeaderAvatar,\n Album,\n ScheduledAlbum,\n SearchResult,\n}\n\nexport enum ChatCreationProgress {\n Idle,\n InProgress,\n Complete,\n Error,\n}\n\nexport enum ProfileEditProgress {\n Idle,\n InProgress,\n Complete,\n Error,\n}\n\nexport enum ManagementProgress {\n Idle,\n InProgress,\n Complete,\n Error,\n}\n\nexport enum NewChatMembersProgress {\n Closed,\n InProgress,\n Loading,\n}\n\nexport type ProfileTabType = 'members' | 'media' | 'documents' | 'links' | 'audio';\nexport type SharedMediaType = 'media' | 'documents' | 'links' | 'audio';\nexport type ApiPrivacyKey = 'phoneNumber' | 'lastSeen' | 'profilePhoto' | 'forwards' | 'chatInvite';\nexport type PrivacyVisibility = 'everybody' | 'contacts' | 'nonContacts' | 'nobody';\n\nexport enum ProfileState {\n Profile,\n SharedMedia,\n MemberList,\n}\n\nexport enum PaymentStep {\n ShippingInfo,\n Shipping,\n PaymentInfo,\n Checkout,\n}\n\nexport const UPLOADING_WALLPAPER_SLUG = 'UPLOADING_WALLPAPER_SLUG';\n\nexport enum ManagementScreens {\n Initial,\n ChatPrivacyType,\n Discussion,\n ChannelSubscribers,\n GroupType,\n GroupPermissions,\n GroupRemovedUsers,\n GroupUserPermissionsCreate,\n GroupUserPermissions,\n ChatAdministrators,\n GroupRecentActions,\n ChatAdminRights,\n GroupMembers,\n}\n\nexport type ManagementType = 'user' | 'group' | 'channel';\n\nexport type NotifyException = {\n isMuted: boolean;\n isSilent?: boolean;\n shouldShowPreviews?: boolean;\n};\n\nexport type EmojiKeywords = {\n isLoading?: boolean;\n version: number;\n keywords: Record;\n};\n\nexport type InlineBotSettings = {\n id: number;\n help?: string;\n query?: string;\n offset?: string;\n canLoadMore?: boolean;\n results?: (ApiBotInlineResult | ApiBotInlineMediaResult)[];\n isGallery?: boolean;\n switchPm?: ApiBotInlineSwitchPm;\n};\n","import { fastRaf } from './schedulers';\n\ninterface AnimationInstance {\n isCancelled: boolean;\n}\n\nlet currentInstance: AnimationInstance | undefined;\n\nexport function animateSingle(tick: Function, instance?: AnimationInstance) {\n if (!instance) {\n if (currentInstance && !currentInstance.isCancelled) {\n currentInstance.isCancelled = true;\n }\n\n instance = { isCancelled: false };\n currentInstance = instance;\n }\n\n fastRaf(() => {\n if (!instance!.isCancelled && tick()) {\n animateSingle(tick, instance);\n }\n });\n}\n\nexport function animate(tick: Function) {\n fastRaf(() => {\n if (tick()) {\n animate(tick);\n }\n });\n}\n","import { DEBUG } from '../config';\n\nexport function updateAppBadge(unreadCount: number) {\n if (typeof window.navigator.setAppBadge !== 'function') {\n return;\n }\n\n window.navigator.setAppBadge(unreadCount).catch((err) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n });\n}\n","export default function arePropsShallowEqual(currentProps: AnyLiteral, newProps: AnyLiteral) {\n if (currentProps === newProps) {\n return true;\n }\n\n const currentKeys = Object.keys(currentProps);\n const currentKeysLength = currentKeys.length;\n const newKeysLength = Object.keys(newProps).length;\n\n if (currentKeysLength !== newKeysLength) {\n return false;\n }\n\n if (currentKeysLength === 0) {\n return true;\n }\n\n for (let i = 0; i < currentKeysLength; i++) {\n const prop = currentKeys[i];\n if (currentProps[prop] !== newProps[prop]) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function getUnequalProps(currentProps: AnyLiteral, newProps: AnyLiteral) {\n const currentKeys = Object.keys(currentProps);\n const currentKeysLength = currentKeys.length;\n const newKeysLength = Object.keys(newProps).length;\n\n if (currentKeysLength !== newKeysLength) {\n return ['%LENGTH%'];\n }\n\n return currentKeys.reduce((res, prop) => {\n if (currentProps[prop] !== newProps[prop]) {\n res.push(`${prop}: ${currentProps[prop]} => ${newProps[prop]}`);\n }\n\n return res;\n }, [] as string[]);\n}\n","type Parts = (string | false | undefined)[];\n\nexport default (...parts: Parts) => {\n return parts.filter(Boolean).join(' ');\n};\n","// eslint-disable-next-line no-restricted-globals\nconst cacheApi = self.caches;\n\nexport enum Type {\n Text,\n Blob,\n Json,\n}\n\nexport async function fetch(\n cacheName: string, key: string, type: Type, isHtmlAllowed = false,\n) {\n if (!cacheApi) {\n return undefined;\n }\n\n try {\n // To avoid the error \"Request scheme 'webdocument' is unsupported\"\n const request = new Request(key.replace(/:/g, '_'));\n const cache = await cacheApi.open(cacheName);\n const response = await cache.match(request);\n if (!response) {\n return undefined;\n }\n\n switch (type) {\n case Type.Text:\n return await response.text();\n case Type.Blob: {\n const blob = await response.blob();\n\n // Safari does not return correct Content-Type header for webp images.\n if (key.substr(0, 7) === 'sticker') {\n return new Blob([blob], { type: 'image/webp' });\n }\n\n // iOS Safari fails to preserve `type` in cache\n if (!blob.type) {\n const contentType = response.headers.get('Content-Type');\n if (contentType) {\n return new Blob([blob], { type: isHtmlAllowed ? contentType : contentType.replace(/html/gi, '') });\n }\n }\n\n // Prevent HTML-in-video attacks (for files that were cached before fix)\n if (!isHtmlAllowed && blob.type.includes('html')) {\n return new Blob([blob], { type: blob.type.replace(/html/gi, '') });\n }\n\n return blob;\n }\n case Type.Json:\n return await response.json();\n default:\n return undefined;\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n return undefined;\n }\n}\n\nexport async function save(cacheName: string, key: string, data: AnyLiteral | Blob | string) {\n if (!cacheApi) {\n return undefined;\n }\n\n try {\n const cacheData = typeof data === 'string' || data instanceof Blob ? data : JSON.stringify(data);\n // To avoid the error \"Request scheme 'webdocument' is unsupported\"\n const request = new Request(key.replace(/:/g, '_'));\n const response = new Response(cacheData);\n const cache = await cacheApi.open(cacheName);\n return await cache.put(request, response);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n return undefined;\n }\n}\n\nexport async function clear(cacheName: string) {\n try {\n if (!cacheApi) {\n return undefined;\n }\n\n return await cacheApi.delete(cacheName);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.warn(err);\n return undefined;\n }\n}\n","import captureKeyboardListener from './captureKeyboardListeners';\n\ntype IHandlerFunction = () => void;\n\nexport default function captureEscKeyListener(handler: IHandlerFunction) {\n return captureKeyboardListener({ onEsc: handler });\n}\n","type HandlerName = 'onEnter' | 'onBackspace' | 'onDelete' | 'onEsc' | 'onUp' | 'onDown' | 'onLeft' | 'onRight'\n| 'onTab';\ntype Handler = (e: KeyboardEvent) => void;\ntype CaptureOptions = Partial>;\n\nconst keyToHandlerName: Record = {\n Enter: 'onEnter',\n Backspace: 'onBackspace',\n Delete: 'onDelete',\n Esc: 'onEsc',\n Escape: 'onEsc',\n ArrowUp: 'onUp',\n ArrowDown: 'onDown',\n ArrowLeft: 'onLeft',\n ArrowRight: 'onRight',\n Tab: 'onTab',\n};\n\nconst handlers: Record = {\n onEnter: [],\n onDelete: [],\n onBackspace: [],\n onEsc: [],\n onUp: [],\n onDown: [],\n onLeft: [],\n onRight: [],\n onTab: [],\n};\n\nexport default function captureKeyboardListeners(options: CaptureOptions) {\n if (!hasActiveHandlers()) {\n document.addEventListener('keydown', handleKeyDown, true);\n }\n\n (Object.keys(options) as Array).forEach((handlerName) => {\n const handler = options[handlerName];\n if (!handler) {\n return;\n }\n\n const currentEventHandlers = handlers[handlerName];\n if (currentEventHandlers) {\n currentEventHandlers.push(handler);\n }\n });\n\n return () => {\n releaseKeyboardListener(options);\n };\n}\n\nfunction hasActiveHandlers() {\n return Object.values(handlers).some((keyHandlers) => Boolean(keyHandlers.length));\n}\n\nfunction handleKeyDown(e: KeyboardEvent) {\n const handlerName = keyToHandlerName[e.key];\n if (!handlerName) {\n return;\n }\n\n const { length } = handlers[handlerName];\n if (!length) {\n return;\n }\n e.stopPropagation();\n\n const handler = handlers[handlerName][length - 1];\n handler!(e);\n}\n\nfunction releaseKeyboardListener(options: CaptureOptions) {\n (Object.keys(options) as Array).forEach((handlerName) => {\n const handler = options[handlerName];\n const currentEventHandlers = handlers[handlerName];\n if (currentEventHandlers) {\n const index = currentEventHandlers.findIndex((cb) => cb === handler);\n if (index !== -1) {\n currentEventHandlers.splice(index, 1);\n }\n }\n });\n\n if (!hasActiveHandlers()) {\n document.removeEventListener('keydown', handleKeyDown, false);\n }\n}\n","import { LangFn } from '../hooks/useLang';\n\nconst WEEKDAYS_FULL = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\nconst MONTHS_FULL = [\n 'January', 'February', 'March', 'April', 'May', 'June',\n 'July', 'August', 'September', 'October', 'November', 'December',\n];\n\nconst MONTHS_FULL_LOWERCASE = MONTHS_FULL.map((month) => month.toLowerCase());\nconst MIN_SEARCH_YEAR = 2015;\nconst MAX_DAY_IN_MONTH = 31;\nconst MAX_MONTH_IN_YEAR = 12;\nexport const MILISECONDS_IN_DAY = 24 * 60 * 60 * 1000;\n\nexport function getDayStart(datetime: number | Date) {\n const date = new Date(datetime);\n date.setHours(0, 0, 0, 0);\n return date;\n}\n\nexport function getDayStartAt(datetime: number | Date) {\n return getDayStart(datetime).getTime();\n}\n\nexport function toYearMonth(timestamp: number) {\n const date = new Date(timestamp * 1000);\n return `${date.getFullYear()}-${date.getMonth()}`;\n}\n\nfunction toIsoString(date: Date) {\n return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;\n}\n\nexport function formatTime(datetime: number | Date) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n const hours = String(date.getHours()).padStart(2, '0');\n const minutes = String(date.getMinutes()).padStart(2, '0');\n\n return `${hours}:${minutes}`;\n}\n\nexport function formatPastTimeShort(lang: LangFn, datetime: number | Date) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n\n const today = getDayStart(new Date());\n if (date >= today) {\n return formatTime(date);\n }\n\n const weekAgo = new Date(today);\n weekAgo.setDate(today.getDate() - 7);\n if (date >= weekAgo) {\n return lang(`Weekday.Short${WEEKDAYS_FULL[date.getDay()]}`);\n }\n\n const withYear = date.getFullYear() !== today.getFullYear();\n const format = (\n lang(withYear ? 'formatDateScheduleYear' : 'formatDateSchedule')\n || (withYear ? 'd MMM yyyy' : 'd MMM')\n );\n\n return formatDate(lang, date, format);\n}\n\nexport function formatFullDate(lang: LangFn, datetime: number | Date) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n const format = lang('formatterYearMax') || 'dd.MM.yyyy';\n\n return formatDate(lang, date, format);\n}\n\nexport function formatMonthAndYear(lang: LangFn, date: Date, isShort = false) {\n const format = lang(isShort ? 'formatterMonthYear2' : 'formatterMonthYear') || 'MMM yyyy';\n\n return formatDate(lang, date, format);\n}\n\nexport function formatHumanDate(lang: LangFn, datetime: number | Date, isShort = false, noWeekdays = false) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n\n const today = getDayStart(new Date());\n\n if (!noWeekdays) {\n if (toIsoString(date) === toIsoString(today)) {\n return (isShort ? lowerFirst : upperFirst)(lang('Weekday.Today'));\n }\n\n const yesterday = new Date(today);\n yesterday.setDate(today.getDate() - 1);\n if (toIsoString(date) === toIsoString(yesterday)) {\n return (isShort ? lowerFirst : upperFirst)(lang('Weekday.Yesterday'));\n }\n\n const weekAgo = new Date(today);\n const weekAhead = new Date(today);\n weekAgo.setDate(today.getDate() - 7);\n weekAhead.setDate(today.getDate() + 7);\n if (date >= weekAgo && date <= weekAhead) {\n const weekDay = WEEKDAYS_FULL[date.getDay()];\n return isShort\n ? lowerFirst(lang(`Weekday.Short${weekDay}`))\n : upperFirst(lang(`Weekday.${weekDay}`));\n }\n }\n\n const withYear = date.getFullYear() !== today.getFullYear();\n const formatKey = isShort\n ? (withYear ? 'formatDateScheduleYear' : 'formatDateSchedule')\n : (withYear ? 'chatFullDate' : 'chatDate');\n const format = lang(formatKey) || 'd MMMM yyyy';\n\n return (isShort ? lowerFirst : upperFirst)(formatDate(lang, date, format));\n}\n\nfunction formatDate(lang: LangFn, date: Date, format: string) {\n const day = date.getDate();\n const monthIndex = date.getMonth();\n\n return format\n .replace('LLLL', lang(MONTHS_FULL[monthIndex]))\n .replace('MMMM', lang(`Month.Gen${MONTHS_FULL[monthIndex]}`))\n .replace('MMM', lang(`Month.Short${MONTHS_FULL[monthIndex]}`))\n .replace('MM', String(monthIndex + 1).padStart(2, '0'))\n .replace('dd', String(day).padStart(2, '0'))\n .replace('d', String(day))\n .replace('yyyy', String(date.getFullYear()));\n}\n\nexport function formatMediaDateTime(lang: LangFn, datetime: number | Date) {\n const date = typeof datetime === 'number' ? new Date(datetime) : datetime;\n\n return `${formatHumanDate(lang, date, true)}, ${formatTime(date)}`;\n}\n\nexport function formatMediaDuration(duration: number) {\n const hours = Math.floor(duration / 3600);\n const minutes = Math.floor((duration % 3600) / 60);\n const seconds = Math.floor(duration % 3600 % 60);\n\n let string = '';\n if (hours > 0) {\n string += `${String(hours).padStart(2, '0')}:`;\n string += `${String(minutes).padStart(2, '0')}:`;\n } else {\n string += `${String(minutes)}:`;\n }\n string += String(seconds).padStart(2, '0');\n\n return string;\n}\n\nexport function formatVoiceRecordDuration(durationInMs: number) {\n const parts = [];\n\n let milliseconds = durationInMs % 1000;\n durationInMs -= milliseconds;\n milliseconds = Math.floor(milliseconds / 10);\n\n durationInMs = Math.floor(durationInMs / 1000);\n const seconds = durationInMs % 60;\n durationInMs -= seconds;\n\n durationInMs = Math.floor(durationInMs / 60);\n const minutes = durationInMs % 60;\n durationInMs -= minutes;\n\n durationInMs = Math.floor(durationInMs / 60);\n const hours = durationInMs % 60;\n\n if (hours > 0) {\n parts.push(String(hours).padStart(2, '0'));\n }\n parts.push(String(minutes).padStart(hours > 0 ? 2 : 1, '0'));\n parts.push(String(seconds).padStart(2, '0'));\n\n return `${parts.join(':')},${String(milliseconds).padStart(2, '0')}`;\n}\n\nexport function formatDateToString(date: Date, locale = 'en-US') {\n return date.toLocaleString(\n locale,\n {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n },\n );\n}\n\nfunction isValidDate(day: number, month: number, year = 2021): boolean {\n if (month > (MAX_MONTH_IN_YEAR - 1) || day > MAX_DAY_IN_MONTH) {\n return false;\n }\n const date = new Date(year, month, day);\n return !Number.isNaN(date.getTime()) && date.getDate() === day;\n}\n\nexport function parseDateString(query = ''): string | undefined {\n const matchStringDate = query.match(/\\d{1,2}\\s[a-zA-Z]{3,}/);\n const matchEuropeStringDate = query.match(/[a-zA-Z]{3,}\\s\\d{1,2}/);\n const matchNumberDate = query.match(/\\d{1,2}[./-]\\d{1,2}([./-]\\d{2,4})?/);\n if (!matchStringDate && !matchNumberDate && !matchEuropeStringDate) {\n return undefined;\n }\n\n if (matchNumberDate) {\n const [date, month, year] = query.split(/[./-]/).map(Number);\n return !(year && year < MIN_SEARCH_YEAR) && isValidDate(date, month - 1, year || undefined)\n ? `${year ? `${year}-` : ''}${String(month).padStart(2, '0')}-${String(date).padStart(2, '0')}`\n : undefined;\n }\n\n const dateParts = query.split(' ');\n const date = matchStringDate ? dateParts[0] : dateParts[1];\n const month = (matchStringDate ? dateParts[1] : dateParts[0]).toLowerCase();\n const monthIndex = MONTHS_FULL_LOWERCASE.findIndex((item) => item.startsWith(month));\n\n return monthIndex !== -1 && isValidDate(Number(date), monthIndex)\n ? `${String(monthIndex + 1).padStart(2, '0')}-${String(date).padStart(2, '0')}`\n : undefined;\n}\n\nexport function timestampPlusDay(timestamp: number) {\n return timestamp + MILISECONDS_IN_DAY / 1000;\n}\n\nfunction lowerFirst(str: string) {\n return `${str[0].toLowerCase()}${str.slice(1)}`;\n}\n\nfunction upperFirst(str: string) {\n return `${str[0].toUpperCase()}${str.slice(1)}`;\n}\n","import EMOJI_REGEX from '../lib/twemojiRegex';\n\n// Due to the fact that emoji from Apple do not contain some characters, it is necessary to remove them from emoji-data\n// https://github.com/iamcal/emoji-data/issues/136\nconst EXCLUDE_EMOJIS = ['female_sign', 'male_sign', 'medical_symbol'];\n\nconst ISO_FLAGS_OFFSET = 127397;\n\nexport type EmojiRawData = typeof import('emoji-data-ios/emoji-data.json');\nexport type EmojiModule = { default: EmojiRawData };\n\nexport type EmojiData = {\n categories: Array;\n emojis: Record;\n};\n\n// Non-standard variations of emojis, used on some devices\nconst EMOJI_EXCEPTIONS: [string | RegExp, string][] = [\n [/\\u{1f3f3}\\u200d\\u{1f308}/gu, '\\u{1f3f3}\\ufe0f\\u200d\\u{1f308}'], // 🏳‍🌈\n [/\\u{1f3f3}\\u200d\\u26a7\\ufe0f/gu, '\\u{1f3f3}\\ufe0f\\u200d\\u26a7\\ufe0f'], // 🏳️‍⚧️\n [/\\u{1f937}\\u200d\\u2642/gu, '\\u{1f937}\\u200d\\u2642\\ufe0f'], // 🤷‍♂️\n];\n\nfunction unifiedToNative(unified: string) {\n const unicodes = unified.split('-');\n const codePoints = unicodes.map((i) => parseInt(i, 16));\n\n return String.fromCodePoint(...codePoints);\n}\n\nexport function fixNonStandardEmoji(text: string) {\n // Non-standard sequences typically parsed as separate emojis, so no need to fix text without any\n if (!text.match(EMOJI_REGEX)) return text;\n // eslint-disable-next-line no-restricted-syntax\n for (const [regex, replacement] of EMOJI_EXCEPTIONS) {\n text = text.replace(regex, replacement);\n }\n\n return text;\n}\n\nexport function nativeToUnified(emoji: string) {\n let code;\n\n if (emoji.length === 1) {\n code = emoji.charCodeAt(0).toString(16).padStart(4, '0');\n } else {\n const pairs = [];\n for (let i = 0; i < emoji.length; i++) {\n if (emoji.charCodeAt(i) >= 0xd800 && emoji.charCodeAt(i) <= 0xdbff) {\n if (emoji.charCodeAt(i + 1) >= 0xdc00 && emoji.charCodeAt(i + 1) <= 0xdfff) {\n pairs.push(\n (emoji.charCodeAt(i) - 0xd800) * 0x400\n + (emoji.charCodeAt(i + 1) - 0xdc00) + 0x10000,\n );\n }\n } else if (emoji.charCodeAt(i) < 0xd800 || emoji.charCodeAt(i) > 0xdfff) {\n pairs.push(emoji.charCodeAt(i));\n }\n }\n\n code = pairs.map((x) => x.toString(16).padStart(4, '0')).join('-');\n }\n\n return code;\n}\n\nexport function uncompressEmoji(data: EmojiRawData): EmojiData {\n const emojiData: EmojiData = { categories: [], emojis: {} };\n\n for (let i = 0; i < data.length; i += 2) {\n const category = {\n id: data[i][0],\n name: data[i][1],\n emojis: [],\n } as EmojiCategory;\n\n for (let j = 0; j < data[i + 1].length; j++) {\n const emojiRaw = data[i + 1][j];\n if (!EXCLUDE_EMOJIS.includes(emojiRaw[1][0])) {\n category.emojis.push(emojiRaw[1][0]);\n emojiData.emojis[emojiRaw[1][0]] = {\n id: emojiRaw[1][0],\n names: emojiRaw[1] as string[],\n native: unifiedToNative(emojiRaw[0] as string),\n image: (emojiRaw[0] as string).toLowerCase(),\n };\n }\n }\n\n emojiData.categories.push(category);\n }\n\n return emojiData;\n}\n\nexport function isoToEmoji(iso: string) {\n const code = iso.toUpperCase();\n\n if (!/^[A-Z]{2}$/.test(code)) return iso;\n const codePoints = [...code].map((c) => c.codePointAt(0)! + ISO_FLAGS_OFFSET);\n return String.fromCodePoint(...codePoints);\n}\n","let isWebpSupportedCache: boolean | undefined;\n\nexport function isWebpSupported() {\n return Boolean(isWebpSupportedCache);\n}\n\nfunction testWebp(): Promise {\n return new Promise((resolve) => {\n const webp = new Image();\n // eslint-disable-next-line max-len\n webp.src = 'data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA';\n const handleLoadOrError = () => {\n resolve(webp.height === 2);\n };\n webp.onload = handleLoadOrError;\n webp.onerror = handleLoadOrError;\n });\n}\n\ntestWebp().then((hasWebp) => {\n isWebpSupportedCache = hasWebp;\n});\n","import { ThemeKey } from '../types';\n\nlet systemThemeCache: ThemeKey = (\n window.matchMedia?.('(prefers-color-scheme: dark)').matches\n) ? 'dark' : 'light';\n\nexport function getSystemTheme() {\n return systemThemeCache;\n}\n\nfunction handleSystemThemeChange(e: MediaQueryListEventMap['change']) {\n systemThemeCache = e.matches ? 'dark' : 'light';\n}\n\nconst mql = window.matchMedia('(prefers-color-scheme: dark)');\nif (typeof mql.addEventListener === 'function') {\n mql.addEventListener('change', handleSystemThemeChange);\n} else if (typeof mql.addListener === 'function') {\n mql.addListener(handleSystemThemeChange);\n}\n","import {\n MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,\n MOBILE_SCREEN_MAX_WIDTH,\n MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT,\n MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH,\n IS_TEST,\n} from '../config';\n\nexport * from './environmentWebp';\n\nexport * from './environmentSystemTheme';\n\nexport function getPlatform() {\n const { userAgent, platform } = window.navigator;\n const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'];\n const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'];\n const iosPlatforms = ['iPhone', 'iPad', 'iPod'];\n let os: 'macOS' | 'iOS' | 'Windows' | 'Android' | 'Linux' | undefined;\n\n if (macosPlatforms.indexOf(platform) !== -1) {\n os = 'macOS';\n } else if (iosPlatforms.indexOf(platform) !== -1) {\n os = 'iOS';\n } else if (windowsPlatforms.indexOf(platform) !== -1) {\n os = 'Windows';\n } else if (/Android/.test(userAgent)) {\n os = 'Android';\n } else if (/Linux/.test(platform)) {\n os = 'Linux';\n }\n\n return os;\n}\n\nexport const PLATFORM_ENV = getPlatform();\nexport const IS_MAC_OS = PLATFORM_ENV === 'macOS';\nexport const IS_IOS = PLATFORM_ENV === 'iOS';\nexport const IS_ANDROID = PLATFORM_ENV === 'Android';\nexport const IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\nexport const IS_PWA = window.matchMedia('(display-mode: standalone)').matches\n|| (window.navigator as any).standalone\n|| document.referrer.includes('android-app://');\n\nexport const IS_TOUCH_ENV = window.matchMedia('(pointer: coarse)').matches;\n// Keep in mind the landscape orientation\nexport const IS_SINGLE_COLUMN_LAYOUT = window.innerWidth <= MOBILE_SCREEN_MAX_WIDTH || (\n window.innerWidth <= MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH && window.innerHeight <= MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT\n);\n// Special layout, 1 column while chat opened, 2 columns while collapsed\nexport const IS_TABLET_COLUMN_LAYOUT = !IS_SINGLE_COLUMN_LAYOUT && (\n window.innerWidth <= MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN\n);\nexport const IS_VOICE_RECORDING_SUPPORTED = (navigator.mediaDevices && 'getUserMedia' in navigator.mediaDevices && (\n window.AudioContext || (window as any).webkitAudioContext\n));\nexport const IS_SMOOTH_SCROLL_SUPPORTED = 'scrollBehavior' in document.documentElement.style;\nexport const IS_EMOJI_SUPPORTED = PLATFORM_ENV && (IS_MAC_OS || IS_IOS);\nexport const IS_SERVICE_WORKER_SUPPORTED = 'serviceWorker' in navigator;\n// TODO Consider failed service worker\nexport const IS_PROGRESSIVE_SUPPORTED = IS_SERVICE_WORKER_SUPPORTED;\nexport const IS_STREAMING_SUPPORTED = 'MediaSource' in window;\nexport const IS_OPUS_SUPPORTED = Boolean((new Audio()).canPlayType('audio/ogg; codecs=opus'));\nexport const IS_CANVAS_FILTER_SUPPORTED = (\n !IS_TEST && 'filter' in (document.createElement('canvas').getContext('2d') || {})\n);\nexport const LAYERS_ANIMATION_NAME = IS_ANDROID ? 'slide-fade' : IS_IOS ? 'slide-layers' : 'push-slide';\n\nexport const DPR = window.devicePixelRatio || 1;\n\nexport const MASK_IMAGE_DISABLED = true;\n","import { pause } from './schedulers';\n\n// Polyfill for Safari: `File` is not available in web worker\nif (typeof File === 'undefined') {\n // eslint-disable-next-line no-global-assign, no-restricted-globals, func-names\n self.File = class extends Blob {\n name: string;\n\n constructor(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag) {\n if (options) {\n const { type, ...rest } = options;\n super(fileBits, { type });\n Object.assign(this, rest);\n } else {\n super(fileBits);\n }\n\n this.name = fileName;\n }\n } as typeof File;\n}\n\nexport function dataUriToBlob(dataUri: string) {\n const arr = dataUri.split(',');\n const mime = arr[0].match(/:(.*?);/)![1];\n const bstr = atob(arr[1]);\n let n = bstr.length;\n const u8arr = new Uint8Array(n);\n\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n\n return new Blob([u8arr], { type: mime });\n}\n\nexport function blobToDataUri(blob: Blob): Promise {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = (e: ProgressEvent) => {\n const { result } = e.target || {};\n if (typeof result === 'string') {\n resolve(result);\n }\n\n reject(new Error('Failed to read blob'));\n };\n\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n}\n\nexport function blobToFile(blob: Blob, fileName: string) {\n return new File([blob], fileName, {\n lastModified: Date.now(),\n type: blob.type,\n });\n}\n\nexport function preloadImage(url: string): Promise {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = reject;\n img.src = url;\n });\n}\n\nexport function preloadVideo(url: string): Promise {\n return new Promise((resolve, reject) => {\n const video = document.createElement('video');\n video.volume = 0;\n video.onloadedmetadata = () => resolve(video);\n video.onerror = reject;\n video.src = url;\n });\n}\n\nexport async function createPosterForVideo(url: string): Promise {\n const video = await preloadVideo(url);\n\n return Promise.race([\n pause(2000) as Promise,\n new Promise((resolve, reject) => {\n video.onseeked = () => {\n if (!video.videoWidth || !video.videoHeight) {\n resolve(undefined);\n }\n\n const canvas = document.createElement('canvas');\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n const ctx = canvas.getContext('2d')!;\n ctx.drawImage(video, 0, 0);\n resolve(canvas.toDataURL('image/jpeg'));\n };\n video.onerror = reject;\n video.currentTime = Math.min(video.duration, 1);\n }),\n ]);\n}\n\nexport async function fetchBlob(blobUrl: string) {\n const response = await fetch(blobUrl);\n return response.blob();\n}\n\nexport async function fetchFile(blobUrl: string, fileName: string) {\n const blob = await fetchBlob(blobUrl);\n return blobToFile(blob, fileName);\n}\n\nexport function imgToCanvas(img: HTMLImageElement) {\n const canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n\n const ctx = canvas.getContext('2d')!;\n ctx.drawImage(img, 0, 0);\n\n return canvas;\n}\n","import { LangCode } from '../types';\n\nexport function formatCurrency(totalPrice: number, currency?: string, locale: LangCode = 'en') {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n }).format(currency === 'JPY' ? totalPrice : totalPrice / 100);\n}\n","export default (store: AnyLiteral) => {\n let id;\n\n do {\n id = String(Math.random()).replace('0.', 'id');\n } while (store.hasOwnProperty(id));\n\n return id;\n};\n","import { ApiError, ApiFieldError } from '../api/types';\n\nconst READABLE_ERROR_MESSAGES: Record = {\n CHAT_RESTRICTED: 'You can\\'t send messages in this chat, you were restricted',\n CHAT_WRITE_FORBIDDEN: 'You can\\'t write in this chat',\n CHAT_SEND_POLL_FORBIDDEN: 'You can\\'t create polls in this chat',\n CHAT_SEND_STICKERS_FORBIDDEN: 'You can\\'t send stickers in this chat',\n CHAT_SEND_GIFS_FORBIDDEN: 'You can\\'t send gifs in this chat',\n CHAT_SEND_MEDIA_FORBIDDEN: 'You can\\'t send media in this chat',\n CHAT_LINK_EXISTS: 'The chat is public, you can\\'t hide the history to new users',\n // eslint-disable-next-line max-len\n SLOWMODE_WAIT_X: 'Slowmode is enabled in this chat: you must wait for the specified number of seconds before sending another message to the chat.',\n USER_BANNED_IN_CHANNEL: 'You\\'re banned from sending messages in supergroups / channels',\n USER_IS_BLOCKED: 'You were blocked by this user',\n YOU_BLOCKED_USER: 'You blocked this user',\n IMAGE_PROCESS_FAILED: 'Failure while processing image',\n MEDIA_EMPTY: 'The provided media object is invalid',\n MEDIA_INVALID: 'Media invalid',\n PHOTO_EXT_INVALID: 'The extension of the photo is invalid',\n PHOTO_INVALID_DIMENSIONS: 'The photo dimensions are invalid',\n PHOTO_SAVE_FILE_INVALID: 'Internal issues, try again later',\n // eslint-disable-next-line max-len\n MESSAGE_DELETE_FORBIDDEN: 'You can\\'t delete one of the messages you tried to delete, most likely because it is a service message.',\n MESSAGE_POLL_CLOSED: 'Poll closed',\n MESSAGE_EDIT_TIME_EXPIRED: 'You can\\'t edit this message anymore.',\n CHAT_ADMIN_REQUIRED: 'You must be an admin in this chat to do this',\n PINNED_DIALOGS_TOO_MUCH: 'Sorry, you can only pin 5 chats to the top',\n DIALOG_FILTERS_TOO_MUCH: 'Sorry, you can\\'t have more than 10 folders',\n CHANNEL_PRIVATE: 'This channel is private',\n MEDIA_CAPTION_TOO_LONG: 'The provided caption is too long',\n ADDRESS_STREET_LINE1_INVALID: 'The address you provided is not valid',\n ADDRESS_STREET_LINE2_INVALID: 'The address you provided is not valid',\n ADDRESS_CITY_INVALID: 'The city you provided is not valid',\n ADDRESS_COUNTRY_INVALID: 'The country you provided is not valid',\n ADDRESS_POSTCODE_INVALID: 'The postcode you provided is not valid',\n ADDRESS_STATE_INVALID: 'The state you provided is not valid',\n REQ_INFO_NAME_INVALID: 'The name you provided is not valid',\n REQ_INFO_PHONE_INVALID: 'The phone you provided is not valid',\n REQ_INFO_EMAIL_INVALID: 'The email you provided is not valid',\n // TODO Bring back after fixing the weird bug\n // CHANNEL_INVALID: 'An error occurred. Please try again later',\n LINK_NOT_MODIFIED: 'This discussion is already linked to the channel',\n MESSAGE_TOO_LONG: 'Message is too long',\n\n // Non-API errors\n SERVICE_WORKER_DISABLED: 'Service Worker is disabled. Please reload the page without holding key.',\n // eslint-disable-next-line max-len\n MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS: 'The provided message is too long. Please remove {EXTRA_CHARS_COUNT} character{PLURAL_S}.',\n // eslint-disable-next-line max-len\n FRESH_RESET_AUTHORISATION_FORBIDDEN: 'You can’t logout other sessions if less than 24 hours have passed since you logged on the current session',\n\n BOTS_TOO_MUCH: 'There are too many bots in this chat/channel',\n BOT_GROUPS_BLOCKED: 'This bot can\\'t be added to groups',\n USERS_TOO_MUCH: 'The maximum number of users has been exceeded',\n USER_CHANNELS_TOO_MUCH: 'One of the users you tried to add is already in too many channels/supergroups',\n USER_KICKED: 'This user was kicked from this supergroup/channel',\n USER_NOT_MUTUAL_CONTACT: 'The provided user is not a mutual contact',\n USER_PRIVACY_RESTRICTED: 'The user\\'s privacy settings do not allow you to do this',\n INVITE_HASH_EMPTY: 'The invite hash is empty',\n INVITE_HASH_EXPIRED: 'The invite link has expired',\n INVITE_HASH_INVALID: 'The invite hash is invalid',\n CHANNELS_TOO_MUCH: 'You have joined too many channels/supergroups',\n USER_ALREADY_PARTICIPANT: 'You already in the group',\n SCHEDULE_DATE_INVALID: 'Invalid schedule date provided',\n WALLPAPER_DIMENSIONS_INVALID: 'The wallpaper dimensions are invalid, please select another file',\n};\n\nexport const SHIPPING_ERRORS: Record = {\n ADDRESS_STREET_LINE1_INVALID: {\n field: 'streetLine1',\n message: 'Incorrect street address',\n },\n ADDRESS_STREET_LINE2_INVALID: {\n field: 'streetLine2',\n message: 'Incorrect street address',\n },\n ADDRESS_CITY_INVALID: {\n field: 'city',\n message: 'Incorrect city',\n },\n ADDRESS_COUNTRY_INVALID: {\n field: 'countryIso2',\n message: 'Incorrect country',\n },\n ADDRESS_POSTCODE_INVALID: {\n field: 'postCode',\n message: 'Incorrect post code',\n },\n ADDRESS_STATE_INVALID: {\n field: 'state',\n message: 'Incorrect state',\n },\n REQ_INFO_NAME_INVALID: {\n field: 'fullName',\n message: 'Incorrect name',\n },\n REQ_INFO_PHONE_INVALID: {\n field: 'phone',\n message: 'Incorrect phone',\n },\n REQ_INFO_EMAIL_INVALID: {\n field: 'email',\n message: 'Incorrect email',\n },\n};\n\nexport default function getReadableErrorText(error: ApiError) {\n const { message, isSlowMode, textParams } = error;\n // Currently, Telegram API doesn't return `SLOWMODE_WAIT_X` error as described in the docs\n if (isSlowMode) {\n const extraPartIndex = message.indexOf(' (caused by');\n return extraPartIndex > 0 ? message.substring(0, extraPartIndex) : message;\n }\n let errorMessage = READABLE_ERROR_MESSAGES[message];\n if (errorMessage && textParams) {\n errorMessage = Object.keys(textParams).reduce((acc, current) => {\n return acc.replace(current, textParams[current]);\n }, errorMessage as string);\n }\n return errorMessage;\n}\n\nexport function getShippingError(error: ApiError): ApiFieldError | undefined {\n return SHIPPING_ERRORS[error.message];\n}\n","import { DEBUG_ALERT_MSG } from '../config';\nimport { throttle } from './schedulers';\n\nwindow.addEventListener('error', handleErrorEvent);\nwindow.addEventListener('unhandledrejection', handleErrorEvent);\n\n// eslint-disable-next-line prefer-destructuring\nconst APP_ENV = process.env.APP_ENV;\n\nfunction handleErrorEvent(e: ErrorEvent | PromiseRejectionEvent) {\n e.preventDefault();\n\n handleError(e instanceof ErrorEvent ? e.error : e.reason);\n}\n\nconst throttledAlert = throttle(window.alert, 1000);\n\nexport function handleError(err: Error) {\n // eslint-disable-next-line no-console\n console.error(err);\n\n if (APP_ENV === 'development' || APP_ENV === 'staging') {\n throttledAlert(`${DEBUG_ALERT_MSG}\\n\\n${(err?.message) || err}\\n${err?.stack}`);\n }\n}\n","type CollectionByKey = Record;\n\ntype OrderDirection = 'asc' | 'desc';\n\ninterface OrderCallback {\n (member: T): any;\n}\n\nexport function buildCollectionByKey(collection: T[], key: keyof T) {\n return collection.reduce((byKey: CollectionByKey, member: T) => {\n byKey[member[key]] = member;\n\n return byKey;\n }, {});\n}\n\nexport function mapValues(\n byKey: CollectionByKey,\n callback: (member: M, key: string, index: number, originalByKey: CollectionByKey) => R,\n): CollectionByKey {\n return Object.keys(byKey).reduce((newByKey: CollectionByKey, key, index) => {\n newByKey[key] = callback(byKey[key], key, index, byKey);\n return newByKey;\n }, {});\n}\n\nexport function pick(object: T, keys: K[]) {\n return keys.reduce((result, key) => {\n result[key] = object[key];\n return result;\n }, {} as Pick);\n}\n\nexport function pickTruthy(object: T, keys: K[]) {\n return keys.reduce((result, key) => {\n if (object[key]) {\n result[key] = object[key];\n }\n\n return result;\n }, {} as Pick);\n}\n\nexport function omit(object: T, keys: K[]) {\n const stringKeys = new Set(keys.map(String));\n const savedKeys = Object.keys(object)\n .filter((key) => !stringKeys.has(key)) as Array>;\n\n return pick(object, savedKeys);\n}\n\nexport function orderBy(\n collection: T[],\n orderKey: (keyof T) | OrderCallback | ((keyof T) | OrderCallback)[],\n mode: OrderDirection | [OrderDirection, OrderDirection] = 'asc',\n): T[] {\n return collection.sort((a, b) => {\n if (Array.isArray(orderKey)) {\n const [mode1, mode2] = Array.isArray(mode) ? mode : [mode, mode];\n const [orderKey1, orderKey2] = orderKey;\n\n let aValue1;\n let bValue1;\n\n if (typeof orderKey1 === 'function') {\n aValue1 = orderKey1(a) || 0;\n bValue1 = orderKey1(b) || 0;\n } else if (typeof orderKey1 === 'string') {\n aValue1 = a[orderKey1] || 0;\n bValue1 = b[orderKey1] || 0;\n }\n\n if (aValue1 !== bValue1) {\n return mode1 === 'asc' ? aValue1 - bValue1 : bValue1 - aValue1;\n } else {\n let aValue2;\n let bValue2;\n\n if (typeof orderKey2 === 'function') {\n aValue2 = orderKey2(a) || 0;\n bValue2 = orderKey2(b) || 0;\n } else if (typeof orderKey2 === 'string') {\n aValue2 = a[orderKey2] || 0;\n bValue2 = b[orderKey2] || 0;\n }\n\n return mode2 === 'asc' ? aValue2 - bValue2 : bValue2 - aValue2;\n }\n }\n\n let aValue;\n let bValue;\n\n if (typeof orderKey === 'function') {\n aValue = orderKey(a) || 0;\n bValue = orderKey(b) || 0;\n } else if (typeof orderKey === 'string') {\n aValue = a[orderKey] || 0;\n bValue = b[orderKey] || 0;\n }\n\n return mode === 'asc' ? aValue - bValue : bValue - aValue;\n });\n}\n\nexport function flatten(array: any[]) {\n return array.reduce((result, member) => {\n if (Array.isArray(member)) {\n return result.concat(member);\n } else {\n result.push(member);\n return result;\n }\n }, []);\n}\n\nexport function unique(array: T[]): T[] {\n return Array.from(new Set(array));\n}\n\nexport function compact(array: any[]) {\n return array.filter(Boolean);\n}\n\nexport function areSortedArraysEqual(array1: any[], array2: any[]) {\n if (array1.length !== array2.length) {\n return false;\n }\n\n return array1.every((item, i) => item === array2[i]);\n}\n\nexport function areSortedArraysIntersecting(array1: any[], array2: any[]) {\n return array1[0] <= array2[array2.length - 1] && array1[array1.length - 1] >= array2[0];\n}\n\nexport function findIntersectionWithSet(array: T[], set: Set): T[] {\n return array.filter((a) => set.has(a));\n}\n\nexport function split(array: any[], chunkSize: number) {\n const result = [];\n for (let i = 0; i < array.length; i += chunkSize) {\n result.push(array.slice(i, i + chunkSize));\n }\n\n return result;\n}\n\nexport function cloneDeep(value: T): T {\n if (typeof value !== 'object') {\n return value;\n }\n\n if (Array.isArray(value)) {\n return value.map(cloneDeep) as typeof value;\n }\n\n return Object.keys(value).reduce((acc, key) => {\n acc[key as keyof T] = cloneDeep(value[key as keyof T]);\n return acc;\n }, {} as T);\n}\n\n/**\n * Returns the index of the last element in the array where predicate is true, and -1 otherwise.\n *\n * @param array The source array to search in\n * @param predicate find calls predicate once for each element of the array, in descending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.\n */\nexport function findLast(array: Array, predicate: (value: T, index: number, obj: T[]) => boolean): T | undefined {\n let cursor = array.length;\n\n while (cursor--) {\n if (predicate(array[cursor], cursor, array)) {\n return array[cursor];\n }\n }\n\n return undefined;\n}\n","import { getGlobal } from '../lib/teact/teactn';\n\nimport { ApiLangPack, ApiLangString } from '../api/types';\nimport { LangCode } from '../types';\n\nimport {\n DEFAULT_LANG_CODE, DEFAULT_LANG_PACK, LANG_CACHE_NAME, LANG_PACKS,\n} from '../config';\nimport * as cacheApi from './cacheApi';\nimport { callApi } from '../api/gramjs';\nimport { createCallbackManager } from './callbacks';\nimport { formatInteger } from './textFormat';\n\ninterface LangFn {\n (key: string, value?: any, format?: 'i'): any;\n\n isRtl?: boolean;\n code?: LangCode;\n}\n\nconst SUBSTITUTION_REGEX = /%\\d?\\$?[sdf@]/g;\nconst PLURAL_OPTIONS = ['value', 'zeroValue', 'oneValue', 'twoValue', 'fewValue', 'manyValue', 'otherValue'] as const;\nconst PLURAL_RULES = {\n /* eslint-disable max-len */\n en: (n: number) => (n !== 1 ? 6 : 2),\n ar: (n: number) => (n === 0 ? 1 : n === 1 ? 2 : n === 2 ? 3 : n % 100 >= 3 && n % 100 <= 10 ? 4 : n % 100 >= 11 ? 5 : 6),\n ca: (n: number) => (n !== 1 ? 6 : 2),\n de: (n: number) => (n !== 1 ? 6 : 2),\n es: (n: number) => (n !== 1 ? 6 : 2),\n fa: (n: number) => (n > 1 ? 6 : 2),\n fr: (n: number) => (n > 1 ? 6 : 2),\n id: () => 0,\n it: (n: number) => (n !== 1 ? 6 : 2),\n ko: () => 0,\n ms: () => 0,\n nl: (n: number) => (n !== 1 ? 6 : 2),\n pl: (n: number) => (n === 1 ? 2 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 4 : 5),\n pt_BR: (n: number) => (n > 1 ? 6 : 2),\n ru: (n: number) => (n % 10 === 1 && n % 100 !== 11 ? 2 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 4 : 5),\n tr: (n: number) => (n > 1 ? 6 : 2),\n uk: (n: number) => (n % 10 === 1 && n % 100 !== 11 ? 2 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 4 : 5),\n uz: (n: number) => (n > 1 ? 6 : 2),\n /* eslint-enable max-len */\n};\n\nconst cache = new Map();\n\nlet langPack: ApiLangPack | undefined;\nlet fallbackLangPack: ApiLangPack | undefined;\n\nconst {\n addCallback,\n removeCallback,\n runCallbacks,\n} = createCallbackManager();\n\nexport { addCallback, removeCallback };\n\nlet currentLangCode: string | undefined;\n\nexport const getTranslation: LangFn = (key: string, value?: any, format?: 'i') => {\n if (value !== undefined) {\n const cacheValue = Array.isArray(value) ? JSON.stringify(value) : value;\n const cached = cache.get(`${key}_${cacheValue}_${format}`);\n if (cached) {\n return cached;\n }\n }\n\n if (!langPack && !fallbackLangPack) {\n return key;\n }\n\n const langString = (langPack?.[key]) || (fallbackLangPack?.[key]);\n if (!langString) {\n if (!fallbackLangPack) {\n void importFallbackLangPack();\n }\n\n return key;\n }\n\n return processTranslation(langString, key, value, format);\n};\n\nexport async function getTranslationForLangString(langCode: string, key: string) {\n let translateString = await cacheApi.fetch(\n LANG_CACHE_NAME,\n `${DEFAULT_LANG_PACK}_${langCode}_${key}`,\n cacheApi.Type.Json,\n );\n\n if (!translateString) {\n translateString = await fetchRemoteString(DEFAULT_LANG_PACK, langCode, key);\n }\n\n return processTranslation(translateString, key);\n}\n\nexport async function setLanguage(langCode: LangCode, callback?: NoneToVoidFunction, withFallback = false) {\n if (langPack && langCode === currentLangCode) {\n if (callback) {\n callback();\n }\n\n return;\n }\n\n let newLangPack = await cacheApi.fetch(LANG_CACHE_NAME, langCode, cacheApi.Type.Json);\n if (!newLangPack) {\n if (withFallback) {\n await importFallbackLangPack();\n }\n\n newLangPack = await fetchRemote(langCode);\n if (!newLangPack) {\n return;\n }\n }\n\n cache.clear();\n\n currentLangCode = langCode;\n langPack = newLangPack;\n document.documentElement.lang = langCode;\n\n const { languages } = getGlobal().settings.byKey;\n const langInfo = languages?.find((l) => l.langCode === langCode);\n getTranslation.isRtl = Boolean(langInfo?.rtl);\n getTranslation.code = langCode;\n\n if (callback) {\n callback();\n }\n\n runCallbacks();\n}\n\nasync function importFallbackLangPack() {\n if (fallbackLangPack) {\n return;\n }\n\n fallbackLangPack = (await import('./fallbackLangPack')).default;\n runCallbacks();\n}\n\nasync function fetchRemote(langCode: string): Promise {\n const remote = await callApi('fetchLangPack', { sourceLangPacks: LANG_PACKS, langCode });\n if (remote) {\n await cacheApi.save(LANG_CACHE_NAME, langCode, remote.langPack);\n return remote.langPack;\n }\n\n return undefined;\n}\n\nasync function fetchRemoteString(\n remoteLangPack: typeof LANG_PACKS[number], langCode: string, key: string,\n): Promise {\n const remote = await callApi('fetchLangStrings', {\n langPack: remoteLangPack,\n langCode,\n keys: [key],\n });\n\n if (remote?.length) {\n await cacheApi.save(LANG_CACHE_NAME, `${remoteLangPack}_${langCode}_${key}`, remote[0]);\n\n return remote[0];\n }\n\n return undefined;\n}\n\nfunction getPluralOption(amount: number) {\n const langCode = currentLangCode || DEFAULT_LANG_CODE;\n const optionIndex = PLURAL_RULES[langCode as keyof typeof PLURAL_RULES]\n ? PLURAL_RULES[langCode as keyof typeof PLURAL_RULES](amount)\n : 0;\n\n return PLURAL_OPTIONS[optionIndex];\n}\n\nfunction processTemplate(template: string, value: any) {\n value = Array.isArray(value) ? value : [value];\n const translationSlices = template.split(SUBSTITUTION_REGEX);\n const initialValue = translationSlices.shift();\n\n return translationSlices.reduce((result, str, index) => {\n return `${result}${String(value[index] || '')}${str}`;\n }, initialValue || '');\n}\n\nfunction processTranslation(langString: ApiLangString | undefined, key: string, value?: any, format?: 'i') {\n const template = langString ? langString[typeof value === 'number' ? getPluralOption(value) : 'value'] : undefined;\n if (!template || !template.trim()) {\n const parts = key.split('.');\n\n return parts[parts.length - 1];\n }\n\n if (value !== undefined) {\n const formattedValue = format === 'i' ? formatInteger(value) : value;\n const result = processTemplate(template, formattedValue);\n const cacheValue = Array.isArray(value) ? JSON.stringify(value) : value;\n cache.set(`${key}_${cacheValue}_${format}`, result);\n return result;\n }\n\n return template;\n}\n","export function createCallbackManager() {\n const callbacks: AnyToVoidFunction[] = [];\n\n function addCallback(cb: AnyToVoidFunction) {\n callbacks.push(cb);\n\n return () => {\n removeCallback(cb);\n };\n }\n\n function removeCallback(cb: AnyToVoidFunction) {\n const index = callbacks.indexOf(cb);\n if (index !== -1) {\n callbacks.splice(index, 1);\n }\n }\n\n function runCallbacks(...args: any[]) {\n callbacks.forEach((callback) => {\n callback(...args);\n });\n }\n\n return {\n runCallbacks,\n addCallback,\n removeCallback,\n };\n}\n","const SAMPLE_RATE = 48000;\nconst BIT_DEPTH = 16;\n\nexport async function oggToWav(opusData: Blob): Promise {\n const arrayBuffer = await new Response(opusData).arrayBuffer();\n\n return new Promise((resolve) => {\n const typedArray = new Uint8Array(arrayBuffer);\n\n let decoderWorker: Worker | undefined = new Worker(\n new URL('opus-recorder/dist/decoderWorker.min.js', import.meta.url),\n );\n let wavWorker: Worker | undefined = new Worker(new URL('opus-recorder/dist/waveWorker.min.js', import.meta.url));\n\n decoderWorker.onmessage = (e) => {\n // eslint-disable-next-line no-null/no-null\n if (e.data === null) {\n // `null` means decoder is finished\n wavWorker!.postMessage({ command: 'done' });\n } else {\n // `e.data` contains decoded buffers as float32 values\n wavWorker!.postMessage(\n {\n command: 'encode',\n buffers: e.data,\n },\n e.data.map(({ buffer }: Float32Array) => buffer),\n );\n }\n };\n\n wavWorker.onmessage = (e) => {\n if (e.data.message === 'page') {\n resolve(new Blob([e.data.page], { type: 'audio/wav' }));\n\n decoderWorker!.terminate();\n decoderWorker = undefined;\n wavWorker!.terminate();\n wavWorker = undefined;\n }\n };\n\n wavWorker.postMessage({\n command: 'init',\n wavBitDepth: BIT_DEPTH,\n wavSampleRate: SAMPLE_RATE,\n });\n\n decoderWorker.postMessage({\n command: 'init',\n decoderSampleRate: SAMPLE_RATE,\n outputBufferSampleRate: SAMPLE_RATE,\n });\n\n decoderWorker.postMessage({\n command: 'decode',\n pages: typedArray,\n }, [typedArray.buffer]);\n });\n}\n","import {\n ApiMediaFormat,\n ApiMediaFormatToPrepared,\n ApiOnProgress,\n ApiParsedMedia,\n ApiPreparedMedia,\n} from '../api/types';\n\nimport {\n DEBUG, MEDIA_CACHE_DISABLED, MEDIA_CACHE_NAME, MEDIA_CACHE_NAME_AVATARS,\n} from '../config';\nimport { callApi, cancelApiProgress } from '../api/gramjs';\nimport * as cacheApi from './cacheApi';\nimport { fetchBlob } from './files';\nimport { IS_OPUS_SUPPORTED, IS_PROGRESSIVE_SUPPORTED, isWebpSupported } from './environment';\nimport { oggToWav } from './oggToWav';\nimport { webpToPng } from './webpToPng';\n\nconst asCacheApiType = {\n [ApiMediaFormat.DataUri]: cacheApi.Type.Text,\n [ApiMediaFormat.BlobUrl]: cacheApi.Type.Blob,\n [ApiMediaFormat.Lottie]: cacheApi.Type.Json,\n [ApiMediaFormat.Progressive]: undefined,\n [ApiMediaFormat.Stream]: undefined,\n};\n\nconst PROGRESSIVE_URL_PREFIX = './progressive/';\n\nconst memoryCache = new Map();\nconst fetchPromises = new Map>();\n\nexport function fetch(\n url: string, mediaFormat: T, isHtmlAllowed = false, onProgress?: ApiOnProgress,\n): Promise> {\n if (mediaFormat === ApiMediaFormat.Progressive) {\n return (\n IS_PROGRESSIVE_SUPPORTED\n ? getProgressive(url)\n : fetch(url, ApiMediaFormat.BlobUrl, isHtmlAllowed, onProgress)\n ) as Promise>;\n }\n\n if (!fetchPromises.has(url)) {\n const promise = fetchFromCacheOrRemote(url, mediaFormat, isHtmlAllowed, onProgress)\n .catch((err) => {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn(err);\n }\n\n return undefined;\n })\n .finally(() => {\n fetchPromises.delete(url);\n });\n\n fetchPromises.set(url, promise);\n }\n\n return fetchPromises.get(url) as Promise>;\n}\n\nexport function getFromMemory(url: string) {\n return memoryCache.get(url) as ApiMediaFormatToPrepared;\n}\n\nexport function cancelProgress(progressCallback: ApiOnProgress) {\n cancelApiProgress(progressCallback);\n}\n\nfunction getProgressive(url: string) {\n const progressiveUrl = `${PROGRESSIVE_URL_PREFIX}${url}`;\n\n memoryCache.set(url, progressiveUrl);\n\n return Promise.resolve(progressiveUrl);\n}\n\nasync function fetchFromCacheOrRemote(\n url: string, mediaFormat: ApiMediaFormat, isHtmlAllowed: boolean, onProgress?: ApiOnProgress,\n) {\n if (!MEDIA_CACHE_DISABLED) {\n const cacheName = url.startsWith('avatar') ? MEDIA_CACHE_NAME_AVATARS : MEDIA_CACHE_NAME;\n const cached = await cacheApi.fetch(cacheName, url, asCacheApiType[mediaFormat]!, isHtmlAllowed);\n if (cached) {\n let media = cached;\n\n if (cached.type === 'audio/ogg' && !IS_OPUS_SUPPORTED) {\n media = await oggToWav(media);\n }\n\n if (cached.type === 'image/webp' && !isWebpSupported() && media) {\n const mediaPng = await webpToPng(url, media);\n if (mediaPng) {\n media = mediaPng;\n }\n }\n\n const prepared = prepareMedia(media);\n\n memoryCache.set(url, prepared);\n\n return prepared;\n }\n }\n\n if (mediaFormat === ApiMediaFormat.Stream) {\n const mediaSource = new MediaSource();\n const streamUrl = URL.createObjectURL(mediaSource);\n let isOpen = false;\n\n mediaSource.addEventListener('sourceopen', () => {\n if (isOpen) {\n return;\n }\n isOpen = true;\n\n const sourceBuffer = mediaSource.addSourceBuffer('audio/mpeg');\n\n void callApi('downloadMedia', { url, mediaFormat }, (progress: number, arrayBuffer: ArrayBuffer) => {\n if (onProgress) {\n onProgress(progress);\n }\n\n if (progress === 1) {\n mediaSource.endOfStream();\n }\n\n if (!arrayBuffer) {\n return;\n }\n\n sourceBuffer.appendBuffer(arrayBuffer!);\n });\n });\n\n memoryCache.set(url, streamUrl);\n return streamUrl;\n }\n\n const remote = await callApi('downloadMedia', { url, mediaFormat, isHtmlAllowed }, onProgress);\n if (!remote) {\n throw new Error('Failed to fetch media');\n }\n\n let { prepared, mimeType } = remote;\n\n if (mimeType === 'audio/ogg' && !IS_OPUS_SUPPORTED) {\n const blob = await fetchBlob(prepared as string);\n URL.revokeObjectURL(prepared as string);\n const media = await oggToWav(blob);\n prepared = prepareMedia(media);\n mimeType = blob.type;\n }\n\n if (mimeType === 'image/webp' && !isWebpSupported()) {\n const blob = await fetchBlob(prepared as string);\n URL.revokeObjectURL(prepared as string);\n const media = await webpToPng(url, blob);\n if (media) {\n prepared = prepareMedia(media);\n }\n }\n\n memoryCache.set(url, prepared);\n\n return prepared;\n}\n\nfunction prepareMedia(mediaData: ApiParsedMedia): ApiPreparedMedia {\n if (mediaData instanceof Blob) {\n return URL.createObjectURL(mediaData);\n }\n\n return mediaData;\n}\n\nif (IS_PROGRESSIVE_SUPPORTED) {\n navigator.serviceWorker.addEventListener('message', async (e) => {\n const { type, messageId, params } = e.data as {\n type: string;\n messageId: string;\n params: { url: string; start: number; end: number };\n };\n\n if (type !== 'requestPart') {\n return;\n }\n\n const result = await callApi('downloadMedia', { mediaFormat: ApiMediaFormat.Progressive, ...params });\n if (!result) {\n return;\n }\n\n const { arrayBuffer, mimeType, fullSize } = result;\n\n navigator.serviceWorker.controller!.postMessage({\n type: 'partResponse',\n messageId,\n result: {\n arrayBuffer,\n mimeType,\n fullSize,\n },\n }, [arrayBuffer!]);\n });\n}\n","export const MEMO_EMPTY_ARRAY = [];\n","import { DEBUG } from '../config';\n\nexport enum Bundles {\n Auth,\n Main,\n Extra,\n}\n\ninterface ImportedBundles {\n [Bundles.Auth]: typeof import('../bundles/auth');\n [Bundles.Main]: typeof import('../bundles/main');\n [Bundles.Extra]: typeof import('../bundles/extra');\n}\n\ntype BundlePromises = {\n [K in keyof ImportedBundles]: Promise\n};\n\nexport type BundleModules = keyof ImportedBundles[B];\n\nconst LOAD_PROMISES: Partial = {};\nconst MEMORY_CACHE: Partial = {};\n\nexport async function loadModule>(bundleName: B, moduleName: M) {\n if (!LOAD_PROMISES[bundleName]) {\n switch (bundleName) {\n case Bundles.Auth:\n LOAD_PROMISES[Bundles.Auth] = import('../bundles/auth');\n break;\n case Bundles.Main:\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START LOAD MAIN BUNDLE');\n }\n\n LOAD_PROMISES[Bundles.Main] = import('../bundles/main');\n break;\n case Bundles.Extra:\n LOAD_PROMISES[Bundles.Extra] = import('../bundles/extra');\n break;\n }\n\n (LOAD_PROMISES[bundleName] as Promise).then(handleBundleLoad);\n }\n\n const bundle = (await LOAD_PROMISES[bundleName]) as unknown as ImportedBundles[B];\n\n if (!MEMORY_CACHE[bundleName]) {\n MEMORY_CACHE[bundleName] = bundle;\n }\n\n return getModuleFromMemory(bundleName, moduleName);\n}\n\nexport function getModuleFromMemory>(bundleName: B, moduleName: M) {\n const bundle = MEMORY_CACHE[bundleName] as ImportedBundles[B];\n\n if (!bundle) {\n return undefined;\n }\n\n return bundle[moduleName];\n}\n\nconst listeners: NoneToVoidFunction[] = [];\n\nexport function addLoadListener(listener: NoneToVoidFunction) {\n if (!listeners.includes(listener)) {\n listeners.push(listener);\n }\n}\n\nfunction handleBundleLoad() {\n listeners.forEach((listener) => {\n listener();\n });\n}\n","import { callApi } from '../api/gramjs';\nimport {\n ApiChat, ApiMediaFormat, ApiMessage, ApiUser,\n} from '../api/types';\nimport { renderActionMessageText } from '../components/common/helpers/renderActionMessageText';\nimport { DEBUG, IS_TEST } from '../config';\nimport { getDispatch, getGlobal, setGlobal } from '../lib/teact/teactn';\nimport {\n getChatAvatarHash,\n getChatTitle,\n getMessageAction,\n getMessageSenderName,\n getMessageSummaryText,\n getPrivateChatUserId,\n isActionMessage,\n isChatChannel,\n selectIsChatMuted, selectShouldShowMessagePreview,\n} from '../modules/helpers';\nimport { getTranslation } from './langProvider';\nimport { addNotifyExceptions, replaceSettings } from '../modules/reducers';\nimport {\n selectChatMessage, selectNotifyExceptions, selectNotifySettings, selectUser,\n} from '../modules/selectors';\nimport { IS_SERVICE_WORKER_SUPPORTED } from './environment';\nimport * as mediaLoader from './mediaLoader';\nimport { debounce } from './schedulers';\n\nfunction getDeviceToken(subscription: PushSubscription) {\n const data = subscription.toJSON();\n return JSON.stringify({\n endpoint: data.endpoint,\n keys: data.keys,\n });\n}\n\nfunction checkIfPushSupported() {\n if (!IS_SERVICE_WORKER_SUPPORTED) return false;\n if (!('showNotification' in ServiceWorkerRegistration.prototype)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] Push notifications aren\\'t supported.');\n }\n return false;\n }\n\n // Check the current Notification permission.\n // If its denied, it's a permanent block until the\n // user changes the permission\n if (Notification.permission === 'denied') {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] The user has blocked push notifications.');\n }\n return false;\n }\n\n // Check if push messaging is supported\n if (!('PushManager' in window)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] Push messaging isn\\'t supported.');\n }\n return false;\n }\n return true;\n}\n\nfunction checkIfNotificationsSupported() {\n // Let's check if the browser supports notifications\n if (!('Notification' in window)) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] This browser does not support desktop notification');\n }\n return false;\n }\n\n if (Notification.permission === 'denied' as NotificationPermission) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] The user has blocked push notifications.');\n }\n return false;\n }\n return true;\n}\n\nconst expirationTime = 12 * 60 * 60 * 1000; // 12 hours\n// Notification id is removed from soundPlayed cache after 3 seconds\nconst soundPlayedDelay = 3 * 1000;\nconst soundPlayed = new Set();\n\nasync function playSound(id: number) {\n if (soundPlayed.has(id)) return;\n const { notificationSoundVolume } = selectNotifySettings(getGlobal());\n const volume = notificationSoundVolume / 10;\n if (volume === 0) return;\n\n const audio = new Audio('/notification.mp3');\n audio.volume = volume;\n audio.setAttribute('mozaudiochannel', 'notification');\n audio.addEventListener('ended', () => {\n soundPlayed.add(id);\n }, { once: true });\n\n setTimeout(() => {\n soundPlayed.delete(id);\n }, soundPlayedDelay);\n\n try {\n await audio.play();\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] Unable to play notification sound');\n }\n }\n}\n\nexport const playNotificationSound = debounce(playSound, 1000, true, false);\n\nfunction checkIfShouldResubscribe(subscription: PushSubscription | null) {\n const global = getGlobal();\n if (!global.push || !subscription) return true;\n if (getDeviceToken(subscription) !== global.push.deviceToken) return true;\n return Date.now() - global.push.subscribedAt > expirationTime;\n}\n\nasync function requestPermission() {\n if (!('Notification' in window)) return;\n if (!['granted', 'denied'].includes(Notification.permission)) {\n await Notification.requestPermission();\n }\n}\n\nasync function unsubscribeFromPush(subscription: PushSubscription | null) {\n const global = getGlobal();\n const dispatch = getDispatch();\n if (subscription) {\n try {\n const deviceToken = getDeviceToken(subscription);\n await callApi('unregisterDevice', deviceToken);\n await subscription.unsubscribe();\n dispatch.deleteDeviceToken();\n return;\n } catch (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[PUSH] Unable to unsubscribe from push.', error);\n }\n }\n }\n if (global.push) {\n await callApi('unregisterDevice', global.push.deviceToken);\n dispatch.deleteDeviceToken();\n }\n}\n\nexport async function unsubscribe() {\n if (!checkIfPushSupported()) return;\n const serviceWorkerRegistration = await navigator.serviceWorker.ready;\n const subscription = await serviceWorkerRegistration.pushManager.getSubscription();\n await unsubscribeFromPush(subscription);\n}\n\n// Indicates if notification settings are loaded from the api\nlet areSettingsLoaded = false;\n\n// Load notification settings from the api\nasync function loadNotificationSettings() {\n if (areSettingsLoaded) return;\n const [resultSettings, resultExceptions] = await Promise.all([\n callApi('fetchNotificationSettings', {\n serverTimeOffset: getGlobal().serverTimeOffset,\n }),\n callApi('fetchNotificationExceptions', {\n serverTimeOffset: getGlobal().serverTimeOffset,\n }),\n ]);\n if (!resultSettings) return;\n\n let global = replaceSettings(getGlobal(), resultSettings);\n if (resultExceptions) {\n global = addNotifyExceptions(global, resultExceptions);\n }\n setGlobal(global);\n areSettingsLoaded = true;\n}\n\nexport async function subscribe() {\n if (!checkIfPushSupported()) {\n // Ask for notification permissions only if service worker notifications are not supported\n // As pushManager.subscribe automatically triggers permission popup\n await requestPermission();\n return;\n }\n const serviceWorkerRegistration = await navigator.serviceWorker.ready;\n let subscription = await serviceWorkerRegistration.pushManager.getSubscription();\n if (!checkIfShouldResubscribe(subscription)) return;\n await unsubscribeFromPush(subscription);\n try {\n subscription = await serviceWorkerRegistration.pushManager.subscribe({\n userVisibleOnly: true,\n });\n const deviceToken = getDeviceToken(subscription);\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[PUSH] Received push subscription: ', deviceToken);\n }\n await callApi('registerDevice', deviceToken);\n getDispatch()\n .setDeviceToken(deviceToken);\n } catch (error) {\n if (Notification.permission === 'denied' as NotificationPermission) {\n // The user denied the notification permission which\n // means we failed to subscribe and the user will need\n // to manually change the notification permission to\n // subscribe to push messages\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('[PUSH] The user has blocked push notifications.');\n }\n } else if (DEBUG) {\n // A problem occurred with the subscription, this can\n // often be down to an issue or lack of the gcm_sender_id\n // and / or gcm_user_visible_only\n // eslint-disable-next-line no-console\n console.log('[PUSH] Unable to subscribe to push.', error);\n\n // Request permissions and fall back to local notifications\n // if pushManager.subscribe was aborted due to invalid VAPID key.\n if (error.code === DOMException.ABORT_ERR) {\n await requestPermission();\n }\n }\n }\n}\n\nfunction checkIfShouldNotify(chat: ApiChat, isActive: boolean) {\n if (!areSettingsLoaded) return false;\n const global = getGlobal();\n const isMuted = selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global));\n if (isMuted || chat.isNotJoined || !chat.isListed) {\n return false;\n }\n // Dont show notification for active chat if client has focus\n return !(isActive && document.hasFocus());\n}\n\nfunction getNotificationContent(chat: ApiChat, message: ApiMessage) {\n const global = getGlobal();\n const {\n senderId,\n replyToMessageId,\n } = message;\n\n const messageSender = senderId ? selectUser(global, senderId) : undefined;\n const messageAction = getMessageAction(message as ApiMessage);\n const actionTargetMessage = messageAction && replyToMessageId\n ? selectChatMessage(global, chat.id, replyToMessageId)\n : undefined;\n const {\n targetUserIds: actionTargetUserIds,\n targetChatId: actionTargetChatId,\n } = messageAction || {};\n\n const actionTargetUsers = actionTargetUserIds\n ? actionTargetUserIds.map((userId) => selectUser(global, userId))\n .filter(Boolean as any)\n : undefined;\n const privateChatUserId = getPrivateChatUserId(chat);\n const privateChatUser = privateChatUserId ? selectUser(global, privateChatUserId) : undefined;\n\n let body: string;\n if (selectShouldShowMessagePreview(chat, selectNotifySettings(global), selectNotifyExceptions(global))) {\n if (isActionMessage(message)) {\n const actionOrigin = chat && (isChatChannel(chat) || message.senderId === message.chatId)\n ? chat\n : messageSender;\n body = renderActionMessageText(\n getTranslation,\n message,\n actionOrigin,\n actionTargetUsers,\n actionTargetMessage,\n actionTargetChatId,\n { asPlain: true },\n ) as string;\n } else {\n const senderName = getMessageSenderName(getTranslation, chat.id, messageSender);\n const summary = getMessageSummaryText(getTranslation, message);\n\n body = senderName ? `${senderName}: ${summary}` : summary;\n }\n } else {\n body = 'New message';\n }\n\n return {\n title: getChatTitle(getTranslation, chat, privateChatUser),\n body,\n };\n}\n\nasync function getAvatar(chat: ApiChat) {\n const imageHash = getChatAvatarHash(chat);\n if (!imageHash) return undefined;\n let mediaData = mediaLoader.getFromMemory(imageHash);\n if (!mediaData) {\n await mediaLoader.fetch(imageHash, ApiMediaFormat.BlobUrl);\n mediaData = mediaLoader.getFromMemory(imageHash);\n }\n return mediaData;\n}\n\nexport async function showNewMessageNotification({\n chat,\n message,\n isActiveChat,\n}: { chat: ApiChat; message: Partial; isActiveChat: boolean }) {\n if (!checkIfNotificationsSupported()) return;\n if (!message.id) return;\n\n await loadNotificationSettings();\n if (!checkIfShouldNotify(chat, isActiveChat)) return;\n\n const {\n title,\n body,\n } = getNotificationContent(chat, message as ApiMessage);\n\n const icon = await getAvatar(chat);\n\n if (checkIfPushSupported()) {\n if (navigator.serviceWorker.controller) {\n // notify service worker about new message notification\n navigator.serviceWorker.controller.postMessage({\n type: 'newMessageNotification',\n payload: {\n title,\n body,\n icon,\n chatId: chat.id,\n messageId: message.id,\n },\n });\n }\n } else {\n const dispatch = getDispatch();\n const options: NotificationOptions = {\n body,\n icon,\n badge: icon,\n tag: message.id.toString(),\n };\n\n if ('vibrate' in navigator) {\n options.vibrate = [200, 100, 200];\n }\n\n const notification = new Notification(title, options);\n\n notification.onclick = () => {\n notification.close();\n dispatch.focusMessage({\n chatId: chat.id,\n messageId: message.id,\n });\n if (window.focus) {\n window.focus();\n }\n };\n\n // Play sound when notification is displayed\n notification.onshow = () => {\n playNotificationSound(message.id || chat.id);\n };\n }\n}\n\nexport function closeMessageNotifications(payload: { chatId: number; lastReadInboxMessageId?: number }) {\n if (IS_TEST || !navigator.serviceWorker.controller) return;\n navigator.serviceWorker.controller.postMessage({\n type: 'closeMessageNotifications',\n payload,\n });\n}\n\n// Notify service worker that client is fully loaded\nexport function notifyClientReady() {\n if (!navigator.serviceWorker.controller) return;\n navigator.serviceWorker.controller.postMessage({\n type: 'clientReady',\n });\n}\n","import { ApiCountryCode } from '../api/types';\nimport { flatten } from './iteratees';\n\nconst PATTERN_PLACEHOLDER = 'X';\nconst DEFAULT_PATTERN = 'XXX XXX XXX XXX';\n\nexport function getCountryCodesByIso(phoneCodeList: ApiCountryCode[], iso: string) {\n return phoneCodeList.filter((country) => country.iso2 === iso);\n}\n\nexport function getCountryFromPhoneNumber(phoneCodeList: ApiCountryCode[], input: string = '') {\n let phoneNumber = input.replace(/[^\\d+]+/g, '');\n if (phoneNumber.startsWith('+')) {\n phoneNumber = phoneNumber.substr(1);\n }\n\n const possibleCountries = phoneCodeList\n .filter((country) => phoneNumber.startsWith(country.countryCode));\n const codesWithPrefix: { code: string; country: ApiCountryCode }[] = flatten(possibleCountries\n .map((country) => (country.prefixes || ['']).map((prefix) => {\n return {\n code: `${country.countryCode}${prefix}`,\n country,\n };\n })));\n\n const bestMatches = codesWithPrefix\n .filter(({ code }) => phoneNumber.startsWith(code))\n .sort((a, b) => a.code.length - b.code.length);\n\n return bestMatches[bestMatches.length - 1]?.country;\n}\n\nexport function formatPhoneNumber(input: string, country?: ApiCountryCode) {\n let phoneNumber = input.replace(/[^\\d]+/g, '');\n if (country) {\n phoneNumber = phoneNumber.substr(country.countryCode.length);\n } else if (input.startsWith('+')) {\n return input;\n }\n const pattern = getBestPattern(phoneNumber, country?.patterns);\n\n const result: string[] = []; // Result character array\n let j = 0; // Position inside pattern\n for (let i = 0; i < phoneNumber.length; i++) {\n while (pattern[j] !== PATTERN_PLACEHOLDER && j < pattern.length) {\n result.push(pattern[j]);\n if (pattern[j] === phoneNumber[i]) { // If pattern contains digits, move input position too\n i++;\n if (i === phoneNumber.length) break; // But don't overdo it, or it will insert full pattern unexpectedly\n }\n j++;\n }\n\n result.push(phoneNumber[i]); // For placeholder characters, setting current input digit\n j++;\n }\n\n return result.join('');\n}\n\nfunction getBestPattern(numberWithoutCode: string, patterns?: string[]) {\n if (!patterns || patterns.length === 0) return DEFAULT_PATTERN;\n if (patterns.length === 1) return patterns[0];\n\n const defaultPattern = patterns.find((pattern) => pattern.startsWith(PATTERN_PLACEHOLDER)) || DEFAULT_PATTERN;\n\n const bestMatches = patterns.filter((pattern) => {\n const stripped = pattern.replace(/[^\\dX]+/g, '');\n if (stripped.startsWith(PATTERN_PLACEHOLDER)) return false; // Don't consider default number format here\n for (let i = 0; i < numberWithoutCode.length; i++) {\n if (i > stripped.length - 1 || (stripped[i] !== PATTERN_PLACEHOLDER && stripped[i] !== numberWithoutCode[i])) {\n return false;\n }\n }\n return true;\n });\n\n // Playing it safe: if not sure, use default for that region\n return bestMatches.length === 1 ? bestMatches[0] : defaultPattern;\n}\n\nexport function formatPhoneNumberWithCode(phoneCodeList: ApiCountryCode[], phoneNumber: string) {\n const numberWithPlus = phoneNumber.startsWith('+') ? phoneNumber : `+${phoneNumber}`;\n const country = getCountryFromPhoneNumber(phoneCodeList, numberWithPlus);\n if (!country) {\n return numberWithPlus;\n }\n return `+${country.countryCode} ${formatPhoneNumber(numberWithPlus, country)}`;\n}\n","type Scheduler =\n typeof requestAnimationFrame\n | typeof onTickEnd\n | typeof runNow;\n\nexport function debounce(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n shouldRunLast = true,\n) {\n let waitingTimeout: number | undefined;\n\n return (...args: Parameters) => {\n if (waitingTimeout) {\n clearTimeout(waitingTimeout);\n waitingTimeout = undefined;\n } else if (shouldRunFirst) {\n // @ts-ignore\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n waitingTimeout = self.setTimeout(() => {\n if (shouldRunLast) {\n // @ts-ignore\n fn(...args);\n }\n\n waitingTimeout = undefined;\n }, ms);\n };\n}\n\nexport function throttle(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n) {\n let interval: number | undefined;\n let isPending: boolean;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n isPending = true;\n args = _args;\n\n if (!interval) {\n if (shouldRunFirst) {\n isPending = false;\n // @ts-ignore\n fn(...args);\n }\n\n // eslint-disable-next-line no-restricted-globals\n interval = self.setInterval(() => {\n if (!isPending) {\n // eslint-disable-next-line no-restricted-globals\n self.clearInterval(interval!);\n interval = undefined;\n return;\n }\n\n isPending = false;\n // @ts-ignore\n fn(...args);\n }, ms);\n }\n };\n}\n\nexport function throttleWithRaf(fn: F) {\n return throttleWith(fastRaf, fn);\n}\n\nexport function throttleWithPrimaryRaf(fn: F) {\n return throttleWith(fastPrimaryRaf, fn);\n}\n\nexport function throttleWithTickEnd(fn: F) {\n return throttleWith(onTickEnd, fn);\n}\n\nexport function throttleWithNow(fn: F) {\n return throttleWith(runNow, fn);\n}\n\nexport function throttleWith(schedulerFn: Scheduler, fn: F) {\n let waiting = false;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n args = _args;\n\n if (!waiting) {\n waiting = true;\n\n schedulerFn(() => {\n waiting = false;\n // @ts-ignore\n fn(...args);\n });\n }\n };\n}\n\nexport function onTickEnd(cb: NoneToVoidFunction) {\n Promise.resolve().then(cb);\n}\n\nexport function onIdle(cb: NoneToVoidFunction) {\n // eslint-disable-next-line no-restricted-globals\n if (self.requestIdleCallback) {\n // eslint-disable-next-line no-restricted-globals\n self.requestIdleCallback(cb);\n } else {\n onTickEnd(cb);\n }\n}\n\nfunction runNow(fn: NoneToVoidFunction) {\n fn();\n}\n\nexport const pause = (ms: number) => new Promise((resolve) => {\n setTimeout(() => resolve(), ms);\n});\n\nexport function rafPromise() {\n return new Promise((resolve) => {\n fastRaf(resolve);\n });\n}\n\nlet fastRafCallbacks: NoneToVoidFunction[] | undefined;\nlet fastRafPrimaryCallbacks: NoneToVoidFunction[] | undefined;\n\n// May result in an immediate execution if called from another `requestAnimationFrame` callback\nexport function fastRaf(callback: NoneToVoidFunction, isPrimary = false) {\n if (!fastRafCallbacks) {\n fastRafCallbacks = isPrimary ? [] : [callback];\n fastRafPrimaryCallbacks = isPrimary ? [callback] : [];\n\n requestAnimationFrame(() => {\n const currentCallbacks = fastRafCallbacks!;\n const currentPrimaryCallbacks = fastRafPrimaryCallbacks!;\n fastRafCallbacks = undefined;\n fastRafPrimaryCallbacks = undefined;\n currentPrimaryCallbacks.forEach((cb) => cb());\n currentCallbacks.forEach((cb) => cb());\n });\n } else if (isPrimary) {\n fastRafPrimaryCallbacks!.push(callback);\n } else {\n fastRafCallbacks.push(callback);\n }\n}\n\nexport function fastPrimaryRaf(callback: NoneToVoidFunction) {\n fastRaf(callback, true);\n}\n\nlet beforeUnloadCallbacks: NoneToVoidFunction[] | undefined;\n\nexport function onBeforeUnload(callback: NoneToVoidFunction, isLast = false) {\n if (!beforeUnloadCallbacks) {\n beforeUnloadCallbacks = [];\n // eslint-disable-next-line no-restricted-globals\n self.addEventListener('beforeunload', () => {\n beforeUnloadCallbacks!.forEach((cb) => cb());\n });\n }\n\n if (isLast) {\n beforeUnloadCallbacks.push(callback);\n } else {\n beforeUnloadCallbacks.unshift(callback);\n }\n\n return () => {\n beforeUnloadCallbacks = beforeUnloadCallbacks!.filter((cb) => cb !== callback);\n };\n}\n","let RE_NOT_LETTER: RegExp;\n\ntry {\n RE_NOT_LETTER = new RegExp('[^\\\\p{L}\\\\p{M}]+', 'ui');\n} catch (e) {\n // Support for older versions of firefox\n RE_NOT_LETTER = new RegExp('[^\\\\wа-яё]+', 'i');\n}\n\nexport default function searchWords(haystack: string, needle: string) {\n if (!haystack || !needle) {\n return false;\n }\n\n const haystackWords = haystack.toLowerCase().split(RE_NOT_LETTER);\n const needleWords = needle.toLowerCase().split(RE_NOT_LETTER);\n\n return needleWords.every((needleWord) => (\n haystackWords.some((haystackWord) => haystackWord.startsWith(needleWord))\n ));\n}\n","export const getServerTime = (serverTimeOffset: number) => {\n return Math.floor(Date.now() / 1000) + serverTimeOffset;\n};\n","import safariFix from 'safari-14-idb-fix';\n\nfunction promisifyRequest(request) {\n return new Promise((resolve, reject) => {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-ignore - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\nfunction createStore(dbName, storeName) {\n const dbp = safariFix().then(() => {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n return promisifyRequest(request);\n });\n return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));\n}\nlet defaultGetStoreFunc;\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore('keyval-store', 'keyval');\n }\n return defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction get(key, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => promisifyRequest(store.get(key)));\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction set(key, value, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic – if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction setMany(entries, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n entries.forEach((entry) => store.put(entry[1], entry[0]));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction getMany(keys, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => Promise.all(keys.map((key) => promisifyRequest(store.get(key)))));\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction update(key, updater, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => \n // Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise((resolve, reject) => {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n }\n catch (err) {\n reject(err);\n }\n };\n }));\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction del(key, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction clear(customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\nfunction eachCursor(customStore, callback) {\n return customStore('readonly', (store) => {\n // This would be store.getAllKeys(), but it isn't supported by Edge or Safari.\n // And openKeyCursor isn't supported by Safari.\n store.openCursor().onsuccess = function () {\n if (!this.result)\n return;\n callback(this.result);\n this.result.continue();\n };\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction keys(customStore = defaultGetStore()) {\n const items = [];\n return eachCursor(customStore, (cursor) => items.push(cursor.key)).then(() => items);\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction values(customStore = defaultGetStore()) {\n const items = [];\n return eachCursor(customStore, (cursor) => items.push(cursor.value)).then(() => items);\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction entries(customStore = defaultGetStore()) {\n const items = [];\n return eachCursor(customStore, (cursor) => items.push([cursor.key, cursor.value])).then(() => items);\n}\n\nexport { clear, createStore, del, entries, get, getMany, keys, promisifyRequest, set, setMany, update, values };\n","/**\n * https://bugs.webkit.org/show_bug.cgi?id=226547\n * Safari has a horrible bug where IDB requests can hang while the browser is starting up.\n * The only solution is to keep nudging it until it's awake.\n * This probably creates garbage, but garbage is better than totally failing.\n */\nfunction idbReady() {\n const isSafari = !navigator.userAgentData &&\n /Safari\\//.test(navigator.userAgent) &&\n !/Chrom(e|ium)\\//.test(navigator.userAgent);\n // No point putting other browsers or older versions of Safari through this mess.\n if (!isSafari || !indexedDB.databases)\n return Promise.resolve();\n let intervalId;\n return new Promise((resolve) => {\n const tryIdb = () => indexedDB.databases().finally(resolve);\n intervalId = setInterval(tryIdb, 100);\n tryIdb();\n }).finally(() => clearInterval(intervalId));\n}\n\nexport default idbReady;\n","import * as idb from 'idb-keyval';\n\nimport { ApiSessionData } from '../api/types';\n\nimport { DEBUG, LEGACY_SESSION_KEY, SESSION_USER_KEY } from '../config';\nimport * as cacheApi from './cacheApi';\n\nconst DC_IDS = [1, 2, 3, 4, 5];\n\nexport function hasStoredSession(withLegacy = false) {\n if (withLegacy && localStorage.getItem(LEGACY_SESSION_KEY)) {\n return true;\n }\n\n const userAuthJson = localStorage.getItem(SESSION_USER_KEY);\n if (!userAuthJson) return false;\n\n try {\n const userAuth = JSON.parse(userAuthJson);\n return Boolean(userAuth && userAuth.id && userAuth.dcID);\n } catch (err) {\n // Do nothing.\n return false;\n }\n}\n\nexport function storeSession(sessionData: ApiSessionData, currentUserId?: number) {\n const { mainDcId, keys, hashes } = sessionData;\n\n localStorage.setItem(SESSION_USER_KEY, JSON.stringify({ dcID: mainDcId, id: currentUserId }));\n localStorage.setItem('dc', String(mainDcId));\n Object.keys(keys).map(Number).forEach((dcId) => {\n localStorage.setItem(`dc${dcId}_auth_key`, JSON.stringify(keys[dcId]));\n });\n Object.keys(hashes).map(Number).forEach((dcId) => {\n localStorage.setItem(`dc${dcId}_hash`, JSON.stringify(hashes[dcId]));\n });\n}\n\nexport function clearStoredSession() {\n [\n SESSION_USER_KEY,\n 'dc',\n ...DC_IDS.map((dcId) => `dc${dcId}_auth_key`),\n ...DC_IDS.map((dcId) => `dc${dcId}_hash`),\n ].forEach((key) => {\n localStorage.removeItem(key);\n });\n}\n\nexport function loadStoredSession(): ApiSessionData | undefined {\n if (!hasStoredSession()) {\n return undefined;\n }\n\n const userAuth = JSON.parse(localStorage.getItem(SESSION_USER_KEY)!);\n const mainDcId = Number(userAuth.dcID);\n const keys: Record = {};\n const hashes: Record = {};\n\n DC_IDS.forEach((dcId) => {\n try {\n const key = localStorage.getItem(`dc${dcId}_auth_key`);\n if (key) {\n keys[dcId] = JSON.parse(key);\n }\n\n const hash = localStorage.getItem(`dc${dcId}_hash`);\n if (hash) {\n hashes[dcId] = JSON.parse(hash);\n }\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('Failed to load stored session', err);\n }\n // Do nothing.\n }\n });\n\n if (!Object.keys(keys).length) return undefined;\n\n return {\n mainDcId,\n keys,\n hashes,\n };\n}\n\nexport async function importLegacySession() {\n const sessionId = localStorage.getItem(LEGACY_SESSION_KEY);\n if (!sessionId) return;\n\n const sessionJson = await idb.get(`GramJs:${sessionId}`);\n try {\n const sessionData = JSON.parse(sessionJson) as ApiSessionData;\n storeSession(sessionData);\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('Failed to load legacy session', err);\n }\n // Do nothing.\n }\n}\n\n// Remove previously created IndexedDB and cache API sessions\nexport async function clearLegacySessions() {\n localStorage.removeItem(LEGACY_SESSION_KEY);\n\n const idbKeys = await idb.keys();\n\n await Promise.all>([\n cacheApi.clear('GramJs'),\n ...idbKeys\n .filter((k) => typeof k === 'string' && k.startsWith('GramJs:GramJs-session-'))\n .map((k) => idb.del(k)),\n ]);\n}\n\nexport function importTestSession() {\n const sessionJson = process.env.TEST_SESSION!;\n try {\n const sessionData = JSON.parse(sessionJson) as ApiSessionData & { userId: number };\n storeSession(sessionData, sessionData.userId);\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('Failed to load test session', err);\n }\n // Do nothing.\n }\n}\n","import { ISettings } from '../types';\n\nimport { animateSingle } from './animation';\n\nimport themeColors from '../styles/themes.json';\n\ntype RGBAColor = {\n r: number;\n g: number;\n b: number;\n a?: number;\n};\n\nlet isInitialized = false;\n\nconst HEX_COLOR_REGEX = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})?$/i;\nconst DURATION_MS = 200;\nconst ENABLE_ANIMATION_DELAY_MS = 500;\n\nconst lerp = (start: number, end: number, interpolationRatio: number) => {\n return (1 - interpolationRatio) * start + interpolationRatio * end;\n};\n\nconst colors = (Object.keys(themeColors) as Array).map((property) => ({\n property,\n colors: [hexToRgb(themeColors[property][0]), hexToRgb(themeColors[property][1])],\n}));\n\nexport default (theme: ISettings['theme'], withAnimation: boolean) => {\n const isDarkTheme = theme === 'dark';\n const shouldAnimate = isInitialized && withAnimation;\n const startIndex = isDarkTheme ? 0 : 1;\n const endIndex = isDarkTheme ? 1 : 0;\n const startAt = Date.now();\n const themeColorTag = document.querySelector('meta[name=\"theme-color\"]');\n\n document.documentElement.classList.remove(`theme-${isDarkTheme ? 'light' : 'dark'}`);\n if (isInitialized) {\n document.documentElement.classList.add('no-animations');\n }\n document.documentElement.classList.add(`theme-${theme}`);\n if (themeColorTag) {\n themeColorTag.setAttribute('content', isDarkTheme ? '#212121' : '#fff');\n }\n\n setTimeout(() => {\n document.documentElement.classList.remove('no-animations');\n }, ENABLE_ANIMATION_DELAY_MS);\n\n isInitialized = true;\n\n if (shouldAnimate) {\n animateSingle(() => {\n const t = Math.min((Date.now() - startAt) / DURATION_MS, 1);\n\n applyColorAnimationStep(startIndex, endIndex, transition(t));\n\n return t < 1;\n });\n } else {\n applyColorAnimationStep(startIndex, endIndex);\n }\n};\n\nfunction transition(t: number) {\n return 1 - ((1 - t) ** 3.5);\n}\n\nfunction hexToRgb(hex: string): RGBAColor {\n const result = HEX_COLOR_REGEX.exec(hex)!;\n\n return {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16),\n a: result[4] !== undefined ? parseInt(result[4], 16) : undefined,\n };\n}\n\nfunction applyColorAnimationStep(startIndex: number, endIndex: number, interpolationRatio: number = 1) {\n colors.forEach(({ property, colors: propertyColors }) => {\n const r = Math.round(lerp(propertyColors[startIndex].r, propertyColors[endIndex].r, interpolationRatio));\n const g = Math.round(lerp(propertyColors[startIndex].g, propertyColors[endIndex].g, interpolationRatio));\n const b = Math.round(lerp(propertyColors[startIndex].b, propertyColors[endIndex].b, interpolationRatio));\n const a = propertyColors[startIndex].a !== undefined\n ? Math.round(lerp(propertyColors[startIndex].a!, propertyColors[endIndex].a!, interpolationRatio))\n : undefined;\n\n document.documentElement.style.setProperty(property, a !== undefined\n ? `rgba(${r},${g},${b},${a / 255})`\n : `rgb(${r},${g},${b})`);\n });\n}\n","import EMOJI_REGEX from \"../lib/twemojiRegex\";\nimport { fixNonStandardEmoji } from \"./emoji\";\n\nexport function formatInteger(value: number) {\n return String(value).replace(/\\d(?=(\\d{3})+$)/g, '$& ');\n}\n\nfunction formatFixedNumber(number: number) {\n const fixed = String(number.toFixed(1));\n if (fixed.substr(-2) === '.0') {\n return Math.round(number);\n }\n\n return number.toFixed(1).replace('.', ',');\n}\n\nexport function formatIntegerCompact(views: number) {\n if (views < 1e3) {\n return views;\n }\n\n if (views < 1e6) {\n return `${formatFixedNumber(views / 1e3)}K`;\n }\n\n return `${formatFixedNumber(views / 1e6)}M`;\n}\n\nexport function getFirstLetters(phrase: string, count = 2) {\n return phrase\n .replace(/[.,!@#$%^&*()_+=\\-`~[\\]/\\\\{}:\"|<>?]+/gi, '')\n .trim()\n .split(/\\s+/)\n .slice(0, count)\n .map((word: string) => {\n if (!word.length) return '';\n word = fixNonStandardEmoji(word);\n const emojis = word.match(EMOJI_REGEX);\n if (emojis && word.startsWith(emojis[0])) {\n return emojis[0];\n }\n return word.match(/./u)![0].toUpperCase()\n })\n .join('');\n}\n","const DEFAULT_MAX_TEXT_LENGTH = 30;\n\nexport default function trimText(text: string | undefined, length = DEFAULT_MAX_TEXT_LENGTH) {\n if (!text || text.length <= length) {\n return text;\n }\n\n return `${text.substr(0, length)}...`;\n}\n","import { isWebpSupported } from './environment';\nimport { dataUriToBlob, blobToDataUri } from './files';\nimport { pause } from './schedulers';\n\nconst WORKER_INITIALIZATION_TIMEOUT = 2000;\n\nlet canvas: HTMLCanvasElement;\nlet worker: IWebpWorker;\n\nexport const EMPTY_IMAGE_DATA_URI = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk'\n + 'YAAAAAYAAjCB0C8AAAAASUVORK5CYII=';\n\nexport async function webpToPng(url: string, blob: Blob): Promise {\n initWebpWorker();\n\n while (!worker.wasmReady) {\n await pause(WORKER_INITIALIZATION_TIMEOUT);\n }\n\n const { result, width, height } = await getDecodePromise(url, blob);\n if (!width || !height) {\n return undefined;\n }\n\n return createPng({ result, width, height });\n}\n\nexport async function webpToPngBase64(key: string, url: string): Promise {\n if (isWebpSupported() || url.substr(0, 15) !== 'data:image/webp') {\n return url;\n }\n\n initWebpWorker();\n\n const pngBlob = await webpToPng(key, dataUriToBlob(url));\n\n if (!pngBlob) {\n throw new Error(`Can't convert webp to png. Url: ${url}`);\n }\n\n return blobToDataUri(pngBlob);\n}\n\nfunction initWebpWorker() {\n if (!worker) {\n worker = new Worker(new URL('../lib/webp/webp_wasm.worker.js', import.meta.url)) as IWebpWorker;\n worker.wasmReady = false;\n worker.onmessage = handleLibWebpMessage;\n }\n}\n\nfunction createPng({ result, width, height }: TEncodedImage): Promise {\n if (!canvas) {\n canvas = document.createElement('canvas');\n }\n\n return new Promise((resolve) => {\n const img = new ImageData(result, width, height);\n\n canvas.width = width;\n canvas.height = height;\n const ctx = canvas.getContext('2d')!;\n ctx.putImageData(img, 0, 0);\n\n canvas.toBlob((blob) => {\n resolve(blob ?? undefined);\n }, 'image/png', 1);\n });\n}\n\nfunction handleLibWebpMessage(e: MessageEvent) {\n const { id } = e.data;\n switch (e.data.type) {\n case 'initialized': {\n worker.wasmReady = true;\n break;\n }\n\n case 'result': {\n if (worker.requests.has(id)) {\n const resolve = worker.requests.get(id)!;\n\n worker.requests.delete(id);\n resolve(e.data!);\n }\n break;\n }\n }\n}\n\nfunction getDecodePromise(url: string, blob: Blob): Promise {\n return new Promise((resolve) => {\n if (!worker.requests) {\n worker.requests = new Map();\n }\n\n worker.requests.set(url, resolve);\n worker.postMessage({ id: url, blob });\n });\n}\n","import { APP_VERSION, DEBUG } from '../config';\nimport { getGlobal } from '../lib/teact/teactn';\nimport { hasStoredSession } from './sessions';\n\nconst WEBSYNC_URLS = [\n 't.me',\n 'telegram.me',\n].map((domain) => `//${domain}/_websync_?`);\nconst WEBSYNC_VERSION = `${APP_VERSION} Z`;\nconst WEBSYNC_KEY = 'tgme_sync';\nconst WEBSYNC_TIMEOUT = 86400;\n\nconst getTs = () => {\n return Math.floor(Number(new Date()) / 1000);\n};\n\nconst saveSync = (authed: boolean) => {\n const ts = getTs();\n localStorage.setItem(WEBSYNC_KEY, JSON.stringify({\n canRedirect: authed,\n ts,\n }));\n};\n\nlet lastTimeout: NodeJS.Timeout | undefined;\n\nexport const forceWebsync = (authed: boolean) => {\n const currentTs = getTs();\n\n const { canRedirect, ts } = JSON.parse(localStorage.getItem(WEBSYNC_KEY) || '{}');\n\n if (canRedirect !== authed || ts + WEBSYNC_TIMEOUT <= currentTs) {\n return Promise.all(WEBSYNC_URLS.map((url) => {\n return new Promise((resolve, reject) => {\n const script = document.createElement('script');\n\n const removeElement = () => !!document.body.removeChild(script);\n\n script.src = url + new URLSearchParams({\n authed: Number(authed).toString(),\n version: WEBSYNC_VERSION,\n });\n\n document.body.appendChild(script);\n\n script.onload = () => {\n saveSync(authed);\n removeElement();\n if (lastTimeout) {\n clearTimeout(lastTimeout);\n lastTimeout = undefined;\n }\n startWebsync();\n resolve();\n };\n\n script.onerror = () => {\n removeElement();\n reject();\n };\n });\n }));\n } else {\n return Promise.resolve();\n }\n};\n\nexport function startWebsync() {\n if (DEBUG) {\n return;\n }\n\n if (lastTimeout !== undefined) return;\n const currentTs = getTs();\n\n const { ts } = JSON.parse(localStorage.getItem(WEBSYNC_KEY) || '{}');\n\n const timeout = WEBSYNC_TIMEOUT - (currentTs - ts);\n\n lastTimeout = setTimeout(() => {\n const { authState } = getGlobal();\n\n const authed = authState === 'authorizationStateReady' || hasStoredSession(true);\n forceWebsync(authed);\n }, Math.max(0, timeout * 1000));\n}\n","import { throttle } from './schedulers';\nimport {\n MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT,\n MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH,\n MOBILE_SCREEN_MAX_WIDTH,\n} from '../config';\nimport { IS_IOS, IS_SINGLE_COLUMN_LAYOUT } from './environment';\n\ntype IDimensions = {\n width: number;\n height: number;\n};\n\nconst IS_LANDSCAPE = IS_SINGLE_COLUMN_LAYOUT && isLandscape();\n\nconst initialHeight = window.innerHeight;\nlet windowSize = updateSizes();\nlet isRefreshDisabled = false;\n\nfunction disableRefresh() {\n isRefreshDisabled = true;\n}\n\nfunction enableRefresh() {\n isRefreshDisabled = false;\n}\n\nconst handleResize = throttle(() => {\n windowSize = updateSizes();\n\n if (!isRefreshDisabled && (\n isMobileScreen() !== IS_SINGLE_COLUMN_LAYOUT\n || (IS_SINGLE_COLUMN_LAYOUT && IS_LANDSCAPE !== isLandscape())\n )) {\n window.location.reload();\n }\n}, 250, true);\n\nwindow.addEventListener('resize', handleResize);\nwindow.addEventListener('orientationchange', handleResize);\n\nexport function updateSizes(): IDimensions {\n const vh = window.innerHeight * 0.01;\n\n document.documentElement.style.setProperty('--vh', `${vh}px`);\n\n return {\n width: window.innerWidth,\n height: window.innerHeight,\n };\n}\n\nfunction isMobileScreen() {\n return windowSize.width <= MOBILE_SCREEN_MAX_WIDTH || (\n windowSize.width <= MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH && windowSize.height <= MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT\n );\n}\n\nfunction isLandscape() {\n if (IS_IOS) {\n return window.matchMedia('(orientation: landscape)').matches;\n }\n\n // eslint-disable-next-line max-len\n // Source: https://web.archive.org/web/20160509220835/http://blog.abouthalf.com/development/orientation-media-query-challenges-in-android-browsers/\n // Feature is marked as deprecated now, but it is still supported\n // https://developer.mozilla.org/en-US/docs/Web/CSS/@media/device-aspect-ratio#browser_compatibility\n return window.matchMedia('screen and (min-device-aspect-ratio: 1/1) and (orientation: landscape)').matches;\n}\n\nexport default {\n get: () => windowSize,\n getIsKeyboardVisible: () => initialHeight > windowSize.height,\n disableRefresh,\n enableRefresh,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".\" + {\"99\":\"f03a947e6e336feffec8\",\"133\":\"89ca9055166cf90beaa7\",\"161\":\"286d0207d962142ad548\",\"354\":\"701ac7c1e3f066f82e25\",\"433\":\"c66cb5158ff9fdb2297f\",\"472\":\"21e5264f606f2b525030\",\"484\":\"87953bd73fba4543a4f6\",\"501\":\"72ce4b6e27f459e194cd\",\"514\":\"e85ae04366b5ac2cfcb1\",\"524\":\"c17eab1f1ac04dc51e06\",\"536\":\"55dc7dd4ab42a2c9f037\",\"745\":\"9316c5c2b711c39a20a5\",\"860\":\"71a26210d53a0e37c47e\",\"915\":\"8fb9f0f20311fa368dc5\",\"941\":\"997469720d84a3a8a3f7\",\"993\":\"f0aad9f6787f211b4e51\"}[chunkId] + \".js\";\n};","// This function allow to reference all chunks\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".\" + {\"133\":\"89ca9055166cf90beaa7\",\"433\":\"c66cb5158ff9fdb2297f\",\"472\":\"21e5264f606f2b525030\",\"484\":\"87953bd73fba4543a4f6\",\"860\":\"71a26210d53a0e37c47e\"}[chunkId] + \".css\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tfor(moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) var result = runtime(__webpack_require__);\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkIds[i]] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunktelegram_t\"] = self[\"webpackChunktelegram_t\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","import { DEBUG } from '../config';\nimport { getDispatch } from '../lib/teact/teactn';\nimport { IS_ANDROID, IS_IOS, IS_SERVICE_WORKER_SUPPORTED } from './environment';\nimport { notifyClientReady, playNotificationSound } from './notifications';\n\ntype WorkerAction = {\n type: string;\n payload: Record;\n};\n\nfunction handleWorkerMessage(e: MessageEvent) {\n const action: WorkerAction = e.data;\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] Message from worker', action);\n }\n if (!action.type) return;\n const dispatch = getDispatch();\n switch (action.type) {\n case 'focusMessage':\n if (dispatch.focusMessage) {\n dispatch.focusMessage(action.payload);\n }\n break;\n case 'playNotificationSound':\n playNotificationSound(action.payload.id);\n break;\n }\n}\n\nfunction subscribeToWorker() {\n navigator.serviceWorker.removeEventListener('message', handleWorkerMessage);\n navigator.serviceWorker.addEventListener('message', handleWorkerMessage);\n // Notify web worker that client is ready to receive messages\n notifyClientReady();\n}\n\nif (IS_SERVICE_WORKER_SUPPORTED) {\n window.addEventListener('load', async () => {\n try {\n await navigator.serviceWorker.register(new URL('../serviceWorker.ts', import.meta.url));\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] ServiceWorker registered');\n }\n\n await navigator.serviceWorker.ready;\n\n if (navigator.serviceWorker.controller) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('[SW] ServiceWorker ready');\n }\n subscribeToWorker();\n } else {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('[SW] ServiceWorker not available');\n }\n\n if (!IS_IOS && !IS_ANDROID) {\n getDispatch().showDialog({ data: { message: 'SERVICE_WORKER_DISABLED', hasErrorKey: true } });\n }\n }\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('[SW] ServiceWorker registration failed: ', err);\n }\n }\n });\n window.addEventListener('focus', async () => {\n await navigator.serviceWorker.ready;\n subscribeToWorker();\n });\n}\n","import { GlobalState } from './types';\nimport { NewChatMembersProgress } from '../types';\n\nimport {\n ANIMATION_LEVEL_DEFAULT, DARK_THEME_PATTERN_COLOR, DEFAULT_MESSAGE_TEXT_SIZE_PX, DEFAULT_PATTERN_COLOR,\n IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX, MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX,\n} from '../config';\nimport { IS_IOS, IS_MAC_OS } from '../util/environment';\n\nexport const INITIAL_STATE: GlobalState = {\n isLeftColumnShown: true,\n isChatInfoShown: false,\n newChatMembersProgress: NewChatMembersProgress.Closed,\n uiReadyState: 0,\n serverTimeOffset: 0,\n\n authRememberMe: true,\n countryList: {\n phoneCodes: [],\n general: [],\n },\n\n blocked: {\n ids: [],\n totalCount: 0,\n },\n\n users: {\n byId: {},\n },\n\n chats: {\n listIds: {},\n isFullyLoaded: {},\n orderedPinnedIds: {},\n totalCount: {},\n byId: {},\n },\n\n messages: {\n byChatId: {},\n messageLists: [],\n },\n\n scheduledMessages: {\n byChatId: {},\n },\n\n chatFolders: {\n byId: {},\n activeChatFolder: 0,\n },\n\n fileUploads: {\n byMessageLocalId: {},\n },\n\n recentEmojis: ['grinning', 'kissing_heart', 'christmas_tree', 'brain', 'trophy'],\n\n stickers: {\n setsById: {},\n added: {},\n recent: {\n stickers: [],\n },\n favorite: {\n stickers: [],\n },\n greeting: {\n stickers: [],\n },\n featured: {\n setIds: [],\n },\n search: {},\n forEmoji: {},\n },\n\n emojiKeywords: {},\n\n gifs: {\n saved: {},\n search: {},\n },\n\n inlineBots: {\n isLoading: false,\n byUsername: {},\n },\n\n globalSearch: {},\n\n userSearch: {},\n\n localTextSearch: {\n byChatThreadKey: {},\n },\n\n localMediaSearch: {\n byChatId: {},\n },\n\n management: {\n byChatId: {},\n },\n\n topPeers: {},\n\n topInlineBots: {},\n\n mediaViewer: {},\n\n audioPlayer: {},\n\n forwardMessages: {},\n\n pollResults: {},\n\n payment: {},\n\n notifications: [],\n\n dialogs: [],\n\n activeSessions: [],\n\n settings: {\n byKey: {\n theme: 'light',\n shouldUseSystemTheme: true,\n messageTextSize: IS_IOS\n ? IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX\n : (IS_MAC_OS ? MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX : DEFAULT_MESSAGE_TEXT_SIZE_PX),\n animationLevel: ANIMATION_LEVEL_DEFAULT,\n messageSendKeyCombo: 'enter',\n shouldAutoDownloadMediaFromContacts: true,\n shouldAutoDownloadMediaInPrivateChats: true,\n shouldAutoDownloadMediaInGroups: true,\n shouldAutoDownloadMediaInChannels: true,\n hasWebNotifications: true,\n hasPushNotifications: true,\n notificationSoundVolume: 5,\n shouldAutoPlayGifs: true,\n shouldAutoPlayVideos: true,\n shouldSuggestStickers: true,\n shouldLoopStickers: true,\n language: 'en',\n },\n themes: {\n light: {\n isBlurred: true,\n patternColor: DEFAULT_PATTERN_COLOR,\n },\n dark: {\n isBlurred: true,\n patternColor: DARK_THEME_PATTERN_COLOR,\n },\n },\n privacy: {},\n notifyExceptions: {},\n },\n\n twoFaSettings: {},\n\n shouldShowContextMenuHint: true,\n};\n","import {\n addCallback, addReducer, getGlobal, removeCallback,\n} from '../lib/teact/teactn';\n\nimport { GlobalState } from './types';\nimport { MAIN_THREAD_ID } from '../api/types';\n\nimport { onBeforeUnload, onIdle, throttle } from '../util/schedulers';\nimport {\n DEBUG,\n GLOBAL_STATE_CACHE_DISABLED,\n GLOBAL_STATE_CACHE_KEY,\n GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT,\n MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,\n GLOBAL_STATE_CACHE_USER_LIST_LIMIT,\n} from '../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../util/environment';\nimport { ANIMATION_END_EVENT, ANIMATION_START_EVENT } from '../hooks/useHeavyAnimationCheck';\nimport { pick } from '../util/iteratees';\nimport { selectCurrentMessageList } from '../modules/selectors';\nimport { hasStoredSession } from '../util/sessions';\nimport { INITIAL_STATE } from './initial';\n\nconst UPDATE_THROTTLE = 5000;\n\nconst updateCacheThrottled = throttle(() => onIdle(updateCache), UPDATE_THROTTLE, false);\n\nlet isCaching = false;\nlet isHeavyAnimating = false;\nlet unsubscribeFromBeforeUnload: NoneToVoidFunction | undefined;\n\nsetupHeavyAnimationListeners();\n\nexport function initCache() {\n if (GLOBAL_STATE_CACHE_DISABLED) {\n return;\n }\n\n addReducer('saveSession', () => {\n if (isCaching) {\n return;\n }\n\n setupCaching();\n });\n\n addReducer('reset', () => {\n localStorage.removeItem(GLOBAL_STATE_CACHE_KEY);\n\n if (!isCaching) {\n return;\n }\n\n clearCaching();\n });\n}\n\nexport function loadCache(initialState: GlobalState) {\n if (GLOBAL_STATE_CACHE_DISABLED) {\n return undefined;\n }\n\n if (hasStoredSession(true)) {\n setupCaching();\n\n return readCache(initialState);\n } else {\n clearCaching();\n\n return undefined;\n }\n}\n\nfunction setupCaching() {\n isCaching = true;\n unsubscribeFromBeforeUnload = onBeforeUnload(updateCache, true);\n window.addEventListener('blur', updateCache);\n addCallback(updateCacheThrottled);\n}\n\nfunction clearCaching() {\n isCaching = false;\n removeCallback(updateCacheThrottled);\n window.removeEventListener('blur', updateCache);\n if (unsubscribeFromBeforeUnload) {\n unsubscribeFromBeforeUnload();\n }\n}\n\nfunction readCache(initialState: GlobalState) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.time('global-state-cache-read');\n }\n\n const json = localStorage.getItem(GLOBAL_STATE_CACHE_KEY);\n const cached = json ? JSON.parse(json) as GlobalState : undefined;\n\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.timeEnd('global-state-cache-read');\n }\n\n if (cached) {\n // Pre-fill defaults in nested objects which may be missing in older cache\n cached.settings.byKey = {\n ...initialState.settings.byKey,\n ...cached.settings.byKey,\n };\n cached.settings.themes = {\n ...initialState.settings.themes,\n ...cached.settings.themes,\n };\n cached.chatFolders = {\n ...initialState.chatFolders,\n ...cached.chatFolders,\n };\n\n if (!cached.messages.messageLists) {\n cached.messages.messageLists = initialState.messages.messageLists;\n }\n\n if (!cached.stickers.greeting) {\n cached.stickers.greeting = initialState.stickers.greeting;\n }\n }\n\n return {\n ...initialState,\n ...cached,\n };\n}\n\nfunction updateCache() {\n if (!isCaching || isHeavyAnimating) {\n return;\n }\n\n const global = getGlobal();\n\n if (global.isLoggingOut) {\n return;\n }\n\n const reducedGlobal: GlobalState = {\n ...INITIAL_STATE,\n ...pick(global, [\n 'authState',\n 'authPhoneNumber',\n 'authRememberMe',\n 'authNearestCountry',\n 'currentUserId',\n 'contactList',\n 'topPeers',\n 'topInlineBots',\n 'recentEmojis',\n 'push',\n 'shouldShowContextMenuHint',\n ]),\n isChatInfoShown: reduceShowChatInfo(global),\n users: reduceUsers(global),\n chats: reduceChats(global),\n messages: reduceMessages(global),\n globalSearch: {\n recentlyFoundChatIds: global.globalSearch.recentlyFoundChatIds,\n },\n settings: reduceSettings(global),\n chatFolders: reduceChatFolders(global),\n };\n\n const json = JSON.stringify(reducedGlobal);\n localStorage.setItem(GLOBAL_STATE_CACHE_KEY, json);\n}\n\nfunction reduceShowChatInfo(global: GlobalState): boolean {\n return window.innerWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN\n ? global.isChatInfoShown\n : false;\n}\n\nfunction reduceUsers(global: GlobalState): GlobalState['users'] {\n const { users: { byId, selectedId } } = global;\n const idsToSave = [\n ...(global.chats.listIds.active || []).slice(0, GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT).filter((cid) => cid > 0),\n ...Object.keys(byId),\n ].slice(0, GLOBAL_STATE_CACHE_USER_LIST_LIMIT);\n\n return {\n byId: pick(byId, idsToSave as number[]),\n selectedId: window.innerWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN ? selectedId : undefined,\n };\n}\n\nfunction reduceChats(global: GlobalState): GlobalState['chats'] {\n const chatIdsToSave = [\n ...(global.chats.listIds.active || []).slice(0, GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT),\n ];\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n\n return {\n ...global.chats,\n byId: pick(global.chats.byId, currentChatId ? [...chatIdsToSave, currentChatId] : chatIdsToSave),\n listIds: {\n active: chatIdsToSave,\n },\n isFullyLoaded: {},\n orderedPinnedIds: {\n active: global.chats.orderedPinnedIds.active,\n },\n };\n}\n\nfunction reduceMessages(global: GlobalState): GlobalState['messages'] {\n const byChatId: GlobalState['messages']['byChatId'] = {};\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n\n const chatIdsToSave = [\n ...(global.chats.listIds.active || []).slice(0, GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT),\n ...(currentChatId ? [currentChatId] : []),\n ];\n chatIdsToSave.forEach((chatId) => {\n const current = global.messages.byChatId[chatId];\n if (!current) {\n return;\n }\n\n const mainThread = current.threadsById[MAIN_THREAD_ID];\n if (!mainThread || !mainThread.viewportIds) {\n return;\n }\n\n byChatId[chatId] = {\n byId: pick(current.byId, mainThread.viewportIds),\n threadsById: {\n [MAIN_THREAD_ID]: mainThread,\n },\n };\n });\n\n const currentMessageList = selectCurrentMessageList(global);\n\n return {\n byChatId,\n messageLists: !currentMessageList || IS_SINGLE_COLUMN_LAYOUT ? [] : [{\n ...currentMessageList,\n threadId: MAIN_THREAD_ID,\n type: 'thread',\n }],\n };\n}\n\nfunction reduceSettings(global: GlobalState): GlobalState['settings'] {\n const { byKey, themes } = global.settings;\n\n return {\n byKey,\n themes,\n privacy: {},\n notifyExceptions: {},\n };\n}\n\nfunction reduceChatFolders(global: GlobalState): GlobalState['chatFolders'] {\n return {\n ...global.chatFolders,\n activeChatFolder: 0,\n };\n}\n\nfunction setupHeavyAnimationListeners() {\n document.addEventListener(ANIMATION_START_EVENT, () => {\n isHeavyAnimating = true;\n });\n document.addEventListener(ANIMATION_END_EVENT, () => {\n isHeavyAnimating = false;\n });\n}\n","import { addReducer } from '../lib/teact/teactn';\n\nimport { INITIAL_STATE } from './initial';\nimport { initCache, loadCache } from './cache';\nimport { cloneDeep } from '../util/iteratees';\n\ninitCache();\n\naddReducer('init', () => {\n const initial = cloneDeep(INITIAL_STATE);\n return loadCache(initial) || initial;\n});\n","const STORAGE_KEY = 'tt-active-tab';\nconst INTERVAL = 2000;\n\nconst tabKey = String(Date.now() + Math.random());\n\nlocalStorage.setItem(STORAGE_KEY, tabKey);\n\nlet callback: NoneToVoidFunction;\n\nconst interval = window.setInterval(() => {\n if (callback && localStorage.getItem(STORAGE_KEY) !== tabKey) {\n callback();\n clearInterval(interval);\n }\n}, INTERVAL);\n\nexport function addActiveTabChangeListener(_callback: NoneToVoidFunction) {\n callback = _callback;\n}\n","const SITE_FONTS = ['400 1em Roboto', '500 1em Roboto'];\n\nexport default function preloadFonts() {\n if ('fonts' in document) {\n return Promise.all(SITE_FONTS.map((font) => document.fonts.load(font)));\n }\n\n return undefined;\n}\n","import React, { FC, useEffect } from '../../lib/teact/teact';\nimport { getGlobal, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiMediaFormat } from '../../api/types';\nimport { GlobalActions, GlobalState } from '../../global/types';\n\nimport { getChatAvatarHash } from '../../modules/helpers/chats'; // Direct import for better module splitting\nimport useFlag from '../../hooks/useFlag';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport { pause } from '../../util/schedulers';\nimport { preloadImage } from '../../util/files';\nimport preloadFonts from '../../util/fonts';\nimport * as mediaLoader from '../../util/mediaLoader';\nimport { Bundles, loadModule } from '../../util/moduleLoader';\nimport { pick } from '../../util/iteratees';\nimport buildClassName from '../../util/buildClassName';\n\nimport './UiLoader.scss';\n\n// @ts-ignore\nimport telegramLogoPath from '../../assets/telegram-logo.svg';\n// @ts-ignore\nimport monkeyPath from '../../assets/monkey.svg';\nimport { selectIsRightColumnShown, selectTheme } from '../../modules/selectors';\n\ntype OwnProps = {\n page: 'main' | 'authCode' | 'authPassword' | 'authPhoneNumber' | 'authQrCode';\n children: any;\n};\n\ntype StateProps = Pick & {\n hasCustomBackground?: boolean;\n hasCustomBackgroundColor: boolean;\n isRightColumnShown?: boolean;\n};\n\ntype DispatchProps = Pick;\n\nconst MAX_PRELOAD_DELAY = 700;\nconst SECOND_STATE_DELAY = 1000;\nconst AVATARS_TO_PRELOAD = 10;\n\nfunction preloadAvatars() {\n const { listIds, byId } = getGlobal().chats;\n if (!listIds.active) {\n return undefined;\n }\n\n return Promise.all(listIds.active.slice(0, AVATARS_TO_PRELOAD).map((chatId) => {\n const chat = byId[chatId];\n if (!chat) {\n return undefined;\n }\n\n const avatarHash = getChatAvatarHash(chat);\n if (!avatarHash) {\n return undefined;\n }\n\n return mediaLoader.fetch(avatarHash, ApiMediaFormat.DataUri);\n }));\n}\n\nconst preloadTasks = {\n main: () => Promise.all([\n loadModule(Bundles.Main, 'Main')\n .then(preloadFonts),\n preloadAvatars(),\n ]),\n authPhoneNumber: () => Promise.all([\n preloadFonts(),\n preloadImage(telegramLogoPath),\n ]),\n authCode: () => preloadImage(monkeyPath),\n authPassword: () => preloadImage(monkeyPath),\n authQrCode: preloadFonts,\n};\n\nconst UiLoader: FC = ({\n page,\n children,\n hasCustomBackground,\n hasCustomBackgroundColor,\n isRightColumnShown,\n shouldSkipHistoryAnimations,\n setIsUiReady,\n}) => {\n const [isReady, markReady] = useFlag();\n const {\n shouldRender: shouldRenderMask, transitionClassNames,\n } = useShowTransition(!isReady, undefined, true);\n\n useEffect(() => {\n let timeout: number | undefined;\n\n const safePreload = async () => {\n try {\n await preloadTasks[page]();\n } catch (err) {\n // Do nothing\n }\n };\n\n Promise.race([\n pause(MAX_PRELOAD_DELAY),\n safePreload(),\n ]).then(() => {\n markReady();\n setIsUiReady({ uiReadyState: 1 });\n\n timeout = window.setTimeout(() => {\n setIsUiReady({ uiReadyState: 2 });\n }, SECOND_STATE_DELAY);\n });\n\n return () => {\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n }\n\n setIsUiReady({ uiReadyState: 0 });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n

\n {children}\n {shouldRenderMask && !shouldSkipHistoryAnimations && (\n
\n {page === 'main' ? (\n <>\n
\n \n {isRightColumnShown &&
}\n \n ) : (\n
\n )}\n
\n )}\n
\n );\n};\n\nexport default withGlobal(\n (global): StateProps => {\n const theme = selectTheme(global);\n const { background, backgroundColor } = global.settings.themes[theme] || {};\n\n return {\n shouldSkipHistoryAnimations: global.shouldSkipHistoryAnimations,\n uiReadyState: global.uiReadyState,\n hasCustomBackground: Boolean(background),\n hasCustomBackgroundColor: Boolean(backgroundColor),\n isRightColumnShown: selectIsRightColumnShown(global),\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['setIsUiReady']),\n)(UiLoader);\n","import * as langProvider from '../util/langProvider';\nimport { useState } from '../lib/teact/teact';\n\nexport default (langCode: string | undefined, key: string): string | undefined => {\n const [translation, setTranslation] = useState();\n\n if (langCode) {\n langProvider\n .getTranslationForLangString(langCode, key)\n .then(setTranslation);\n }\n\n return translation;\n};\n","import { LangCode } from '../../../types';\n\nexport function getSuggestedLanguage() {\n let suggestedLanguage = navigator.language;\n\n if (suggestedLanguage && suggestedLanguage !== 'pt-br') {\n suggestedLanguage = suggestedLanguage.substr(0, 2);\n }\n\n return suggestedLanguage as LangCode;\n}\n","import React, {\n FC, useState, memo, useCallback, useRef,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiCountryCode } from '../../api/types';\n\nimport { ANIMATION_END_DELAY } from '../../config';\nimport searchWords from '../../util/searchWords';\nimport buildClassName from '../../util/buildClassName';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\nimport { isoToEmoji } from '../../util/emoji';\nimport useOnChange from '../../hooks/useOnChange';\n\nimport DropdownMenu from '../ui/DropdownMenu';\nimport MenuItem from '../ui/MenuItem';\nimport Spinner from '../ui/Spinner';\n\nimport './CountryCodeInput.scss';\n\ntype StateProps = {\n phoneCodeList: ApiCountryCode[];\n};\n\ntype OwnProps = {\n id: string;\n value?: ApiCountryCode;\n isLoading?: boolean;\n onChange: (value: ApiCountryCode) => void;\n};\n\nconst MENU_HIDING_DURATION = 200 + ANIMATION_END_DELAY;\nconst SELECT_TIMEOUT = 50;\n\nconst CountryCodeInput: FC = ({\n id,\n value,\n isLoading,\n onChange,\n phoneCodeList,\n}) => {\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n\n const [filter, setFilter] = useState();\n const [filteredList, setFilteredList] = useState([]);\n\n const updateFilter = useCallback((filterValue?: string) => {\n setFilter(filterValue);\n setFilteredList(getFilteredList(phoneCodeList, filterValue));\n }, [phoneCodeList]);\n\n useOnChange(([prevPhoneCodeList]) => {\n if (prevPhoneCodeList?.length === 0 && phoneCodeList.length > 0) {\n updateFilter(filter);\n }\n }, [phoneCodeList, updateFilter]);\n\n const handleChange = useCallback((e: React.SyntheticEvent) => {\n const { countryCode } = (e.currentTarget.firstElementChild as HTMLDivElement).dataset;\n const country = phoneCodeList.find((c) => c.countryCode === countryCode);\n\n if (country) {\n onChange(country);\n }\n\n setTimeout(() => updateFilter(undefined), MENU_HIDING_DURATION);\n }, [phoneCodeList, onChange, updateFilter]);\n\n const handleInput = useCallback((e: React.FormEvent) => {\n updateFilter(e.currentTarget.value);\n }, [updateFilter]);\n\n const handleInputKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.keyCode !== 8) {\n return;\n }\n\n const target = e.currentTarget;\n if (value && filter === undefined) {\n target.value = '';\n }\n\n updateFilter(target.value);\n }, [filter, updateFilter, value]);\n\n const CodeInput: FC<{ onTrigger: () => void; isOpen?: boolean }> = ({ onTrigger, isOpen }) => {\n const handleTrigger = () => {\n if (isOpen) {\n return;\n }\n\n setTimeout(() => {\n inputRef.current!.select();\n }, SELECT_TIMEOUT);\n\n onTrigger();\n\n const formEl = document.getElementById('auth-phone-number-form')!;\n formEl.scrollTo({ top: formEl.scrollHeight, behavior: 'smooth' });\n };\n\n const handleCodeInput = (e: React.FormEvent) => {\n handleInput(e);\n handleTrigger();\n };\n\n const inputValue = filter ?? (value?.name || value?.defaultName || '');\n\n return (\n
\n \n \n {isLoading ? (\n \n ) : (\n \n )}\n
\n );\n };\n\n return (\n \n {filteredList\n .map((country: ApiCountryCode) => (\n \n \n {renderText(isoToEmoji(country.iso2), ['hq_emoji'])}\n {country.name || country.defaultName}\n {country.countryCode}\n \n ))}\n {!filteredList.length && (\n \n {lang('lng_country_none')}\n \n )}\n \n );\n};\n\nfunction getFilteredList(countryList: ApiCountryCode[], filter = ''): ApiCountryCode[] {\n const filtered = filter.length\n ? countryList.filter((country) => (\n searchWords(country.defaultName, filter) || (country.name && searchWords(country.name, filter))\n )) : countryList;\n return filtered;\n}\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const { countryList: { phoneCodes: phoneCodeList } } = global;\n return {\n phoneCodeList,\n };\n },\n)(CountryCodeInput));\n","import { ChangeEvent } from 'react';\n\n// @ts-ignore\nimport monkeyPath from '../../assets/monkey.svg';\n\nimport React, {\n FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,\n} from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../global/types';\nimport { LangCode } from '../../types';\nimport { ApiCountryCode } from '../../api/types';\n\nimport { IS_SAFARI, IS_TOUCH_ENV } from '../../util/environment';\nimport { preloadImage } from '../../util/files';\nimport preloadFonts from '../../util/fonts';\nimport { pick } from '../../util/iteratees';\nimport { formatPhoneNumber, getCountryCodesByIso, getCountryFromPhoneNumber } from '../../util/phoneNumber';\nimport { setLanguage } from '../../util/langProvider';\nimport useLang from '../../hooks/useLang';\nimport useFlag from '../../hooks/useFlag';\nimport useLangString from '../../hooks/useLangString';\nimport { getSuggestedLanguage } from './helpers/getSuggestedLanguage';\n\nimport Button from '../ui/Button';\nimport Checkbox from '../ui/Checkbox';\nimport InputText from '../ui/InputText';\nimport Loading from '../ui/Loading';\nimport CountryCodeInput from './CountryCodeInput';\n\ntype StateProps = Pick & {\n language?: LangCode;\n phoneCodeList: ApiCountryCode[];\n};\ntype DispatchProps = Pick;\n\nconst MIN_NUMBER_LENGTH = 7;\n\nlet isPreloadInitiated = false;\n\nconst AuthPhoneNumber: FC = ({\n connectionState,\n authState,\n authPhoneNumber,\n authIsLoading,\n authIsLoadingQrCode,\n authError,\n authRememberMe,\n authNearestCountry,\n phoneCodeList,\n language,\n setAuthPhoneNumber,\n setAuthRememberMe,\n loadNearestCountry,\n loadCountryList,\n clearAuthError,\n goToAuthQrCode,\n setSettingOption,\n}) => {\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null);\n const suggestedLanguage = getSuggestedLanguage();\n\n const continueText = useLangString(suggestedLanguage, 'ContinueOnThisLanguage');\n const [country, setCountry] = useState();\n const [phoneNumber, setPhoneNumber] = useState();\n const [isTouched, setIsTouched] = useState(false);\n const [lastSelection, setLastSelection] = useState<[number, number] | undefined>();\n const [isLoading, markIsLoading, unmarkIsLoading] = useFlag();\n\n const fullNumber = country ? `+${country.countryCode} ${phoneNumber || ''}` : phoneNumber;\n const canSubmit = fullNumber && fullNumber.replace(/[^\\d]+/g, '').length >= MIN_NUMBER_LENGTH;\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n inputRef.current!.focus();\n }\n }, [country]);\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady' && !authNearestCountry) {\n loadNearestCountry();\n }\n }, [connectionState, authNearestCountry, loadNearestCountry]);\n\n useEffect(() => {\n if (connectionState === 'connectionStateReady') {\n loadCountryList({ langCode: language });\n }\n }, [connectionState, language, loadCountryList]);\n\n useEffect(() => {\n if (authNearestCountry && phoneCodeList && !country && !isTouched) {\n setCountry(getCountryCodesByIso(phoneCodeList, authNearestCountry)[0]);\n }\n }, [country, authNearestCountry, isTouched, phoneCodeList]);\n\n const parseFullNumber = useCallback((newFullNumber: string) => {\n if (!newFullNumber.length) {\n setPhoneNumber('');\n }\n\n const suggestedCountry = phoneCodeList && getCountryFromPhoneNumber(phoneCodeList, newFullNumber);\n\n // Any phone numbers should be allowed, in some cases ignoring formatting\n const selectedCountry = !country\n || (suggestedCountry && suggestedCountry.iso2 !== country.iso2)\n || (!suggestedCountry && newFullNumber.length)\n ? suggestedCountry\n : country;\n\n if (!country || !selectedCountry || (selectedCountry && selectedCountry.iso2 !== country.iso2)) {\n setCountry(selectedCountry);\n }\n setPhoneNumber(formatPhoneNumber(newFullNumber, selectedCountry));\n }, [phoneCodeList, country]);\n\n const handleLangChange = useCallback(() => {\n markIsLoading();\n\n void setLanguage(suggestedLanguage, () => {\n unmarkIsLoading();\n\n setSettingOption({ language: suggestedLanguage });\n });\n }, [markIsLoading, setSettingOption, suggestedLanguage, unmarkIsLoading]);\n\n useEffect(() => {\n if (phoneNumber === undefined && authPhoneNumber) {\n parseFullNumber(authPhoneNumber);\n }\n }, [authPhoneNumber, phoneNumber, parseFullNumber]);\n\n useLayoutEffect(() => {\n if (inputRef.current && lastSelection) {\n inputRef.current.setSelectionRange(...lastSelection);\n }\n }, [lastSelection]);\n\n const isJustPastedRef = useRef(false);\n const handlePaste = useCallback(() => {\n isJustPastedRef.current = true;\n requestAnimationFrame(() => {\n isJustPastedRef.current = false;\n });\n }, []);\n\n const handleCountryChange = useCallback((value: ApiCountryCode) => {\n setCountry(value);\n setPhoneNumber('');\n }, []);\n\n const handlePhoneNumberChange = useCallback((e: ChangeEvent) => {\n if (authError) {\n clearAuthError();\n }\n\n // This is for further screens. We delay it until user input to speed up the initial loading.\n if (!isPreloadInitiated) {\n isPreloadInitiated = true;\n preloadFonts();\n void preloadImage(monkeyPath);\n }\n\n const { value, selectionStart, selectionEnd } = e.target;\n setLastSelection(\n selectionStart && selectionEnd && selectionEnd < value.length\n ? [selectionStart, selectionEnd]\n : undefined,\n );\n\n setIsTouched(true);\n\n const shouldFixSafariAutoComplete = (\n IS_SAFARI && country && fullNumber !== undefined\n && value.length - fullNumber.length > 1 && !isJustPastedRef.current\n );\n parseFullNumber(shouldFixSafariAutoComplete ? `${country!.countryCode} ${value}` : value);\n }, [authError, clearAuthError, country, fullNumber, parseFullNumber]);\n\n const handleKeepSessionChange = useCallback((e: ChangeEvent) => {\n setAuthRememberMe(e.target.checked);\n }, [setAuthRememberMe]);\n\n function handleSubmit(event: React.FormEvent) {\n event.preventDefault();\n\n if (authIsLoading) {\n return;\n }\n\n if (canSubmit) {\n setAuthPhoneNumber({ phoneNumber: fullNumber });\n }\n }\n\n const isAuthReady = authState === 'authorizationStateWaitPhoneNumber';\n\n return (\n
\n
\n
\n

Telegram

\n

{lang('StartText')}

\n
\n \n \n \n {canSubmit && (\n isAuthReady ? (\n \n ) : (\n \n )\n )}\n {isAuthReady && (\n \n )}\n {suggestedLanguage && suggestedLanguage !== language && continueText && (\n \n )}\n \n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n settings: { byKey: { language } },\n countryList: { phoneCodes: phoneCodeList },\n } = global;\n\n return {\n ...pick(global, [\n 'connectionState',\n 'authState',\n 'authPhoneNumber',\n 'authIsLoading',\n 'authIsLoadingQrCode',\n 'authError',\n 'authRememberMe',\n 'authNearestCountry',\n ]),\n language,\n phoneCodeList,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'setAuthPhoneNumber',\n 'setAuthRememberMe',\n 'clearAuthError',\n 'loadNearestCountry',\n 'loadCountryList',\n 'goToAuthQrCode',\n 'setSettingOption',\n ]),\n)(AuthPhoneNumber));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst AuthCodeAsync: FC = () => {\n const AuthCode = useModuleLoader(Bundles.Auth, 'AuthCode');\n\n return AuthCode ? : ;\n};\n\nexport default memo(AuthCodeAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst AuthPasswordAsync: FC = () => {\n const AuthPassword = useModuleLoader(Bundles.Auth, 'AuthPassword');\n\n return AuthPassword ? : ;\n};\n\nexport default memo(AuthPasswordAsync);\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\nimport Loading from '../ui/Loading';\n\nconst AuthRegisterAsync: FC = () => {\n const AuthRegister = useModuleLoader(Bundles.Auth, 'AuthRegister');\n\n return AuthRegister ? : ;\n};\n\nexport default memo(AuthRegisterAsync);\n","/*\n jquery-qrcode v0.14.0 - https://larsjung.de/jquery-qrcode/ */\n'use strict';let G=null;class H{}H.render=function(w,B){G(w,B)};self.QrCreator=H;\n(function(w){function B(t,c,a,e){var b={},h=w(a,c);h.u(t);h.J();e=e||0;var r=h.h(),d=h.h()+2*e;b.text=t;b.level=c;b.version=a;b.O=d;b.a=function(b,a){b-=e;a-=e;return 0>b||b>=r||0>a||a>=r?!1:h.a(b,a)};return b}function C(t,c,a,e,b,h,r,d,g,x){function u(b,a,f,c,d,r,g){b?(t.lineTo(a+r,f+g),t.arcTo(a,f,c,d,h)):t.lineTo(a,f)}r?t.moveTo(c+h,a):t.moveTo(c,a);u(d,e,a,e,b,-h,0);u(g,e,b,c,b,0,-h);u(x,c,b,c,a,h,0);u(r,c,a,e,a,0,h)}function z(t,c,a,e,b,h,r,d,g,x){function u(b,a,c,d){t.moveTo(b+c,a);t.lineTo(b,\na);t.lineTo(b,a+d);t.arcTo(b,a,b+c,a,h)}r&&u(c,a,h,h);d&&u(e,a,-h,h);g&&u(e,b,-h,-h);x&&u(c,b,h,-h)}function A(t,c){var a=c.fill;if(\"string\"===typeof a)t.fillStyle=a;else{var e=a.type,b=a.colorStops;a=a.position.map((b)=>Math.round(b*c.size));if(\"linear-gradient\"===e)var h=t.createLinearGradient.apply(t,a);else if(\"radial-gradient\"===e)h=t.createRadialGradient.apply(t,a);else throw Error(\"Unsupported fill\");b.forEach(([b,a])=>{h.addColorStop(b,a)});t.fillStyle=h}}function y(t,c){a:{var a=c.text,e=\nc.v,b=c.N,h=c.K,r=c.P;b=Math.max(1,b||1);for(h=Math.min(40,h||40);b<=h;b+=1)try{var d=B(a,e,b,r);break a}catch(J){}d=void 0}if(!d)return null;a=t.getContext(\"2d\");c.background&&(a.fillStyle=c.background,a.fillRect(c.left,c.top,c.size,c.size));e=d.O;h=c.size/e;a.beginPath();for(r=0;r>>7-b%8&1)},put:function(b,h){for(var a=0;a>>h-a-1&1))},f:function(){return a},m:function(b){var h=Math.floor(a/8);c.length<=h&&c.push(0);b&&(c[h]|=128>>>a%8);a+=1}};return e}function C(c,a){function e(b,h){for(var a=-1;7>=a;a+=1)if(!(-1>=b+a||d<=b+a))for(var c=-1;7>=c;c+=1)-1>=h+c||d<=h+c||(r[b+a][h+c]=0<=a&&6>=a&&(0==c||6==c)||0<=c&&6>=c&&(0==a||6==a)||2<=a&&4>=a&&2<=c&&4>=c?!0:!1)}function b(b,a){for(var f=d=4*c+17,k=Array(f),m=0;m<\nf;m+=1){k[m]=Array(f);for(var p=0;p=n;n+=1)for(var l=-2;2>=l;l+=1)r[p+n][q+l]=-2==n||2==n||-2==l||2==l||0==n&&0==l}for(f=8;fk;k+=1)m=!b&&1==(f>>k&1),r[6>k?k:8>k?k+1:d-15+k][8]=m,r[8][8>k?d-k-1:9>k?15-k:14-k]=m;r[d-8][8]=!b;if(7<=\nc){f=y.A(c);for(k=0;18>k;k+=1)m=!b&&1==(f>>k&1),r[Math.floor(k/3)][k%3+d-8-3]=m;for(k=0;18>k;k+=1)m=!b&&1==(f>>k&1),r[k%3+d-8-3][Math.floor(k/3)]=m}if(null==g){b=t.I(c,h);f=B();for(k=0;k8*m)throw Error(\"code length overflow. (\"+f.f()+\">\"+8*m+\")\");for(f.f()+4<=8*m&&f.put(0,4);0!=f.f()%8;)f.m(!1);for(;!(f.f()>=8*m);){f.put(236,8);if(f.f()>=8*m)break;f.put(17,8)}var u=0;m=k=0;p=Array(b.length);\nq=Array(b.length);for(n=0;nn;n+=1)null==r[k][q-n]&&(l=!1,p>>m&1)),a(k,q-n)&&(l=!l),r[k][q-n]=l,--m,-1==m&&(p+=1,m=7));k+=f;if(0>k||d<=k){k-=f;f=-f;break}}}var h=A[a],r=null,d=0,g=null,x=[],u={u:function(b){b=w(b);x.push(b);g=null},a:function(b,a){if(0>b||d<=b||0>a||d<=a)throw Error(b+\",\"+a);return r[b][a]},h:function(){return d},J:function(){for(var a=0,h=0,c=0;8>c;c+=1){b(!0,c);var d=y.D(u);if(0==c||a>d)a=d,h=c}b(!1,h)}};return u}\nfunction z(c,a){if(\"undefined\"==typeof c.length)throw Error(c.length+\"/\"+a);var e=function(){for(var b=0;bb.b()-a.b())return b;for(var c=v.g(b.c(0))-v.g(a.c(0)),h=Array(b.b()),\ng=0;gb?a.push(b):2048>b?a.push(192|b>>6,128|b&63):55296>b||57344<=b?a.push(224|b>>12,128|b>>6&63,128|b&63):(e++,b=65536+((b&1023)<<10|c.charCodeAt(e)&1023),a.push(240|b>>18,128|b>>12&63,128|b>>6&63,128|b&63))}return a};var A={L:1,M:0,Q:3,H:2},y=function(){function c(b){for(var a=0;0!=b;)a+=1,b>>>=1;return a}var a=[[],[6,18],\n[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],\n[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],e={w:function(b){for(var a=b<<10;0<=c(a)-c(1335);)a^=1335<a||40a?8:16},D:function(b){for(var a=b.h(),c=0,\nd=0;d=p;p+=1)if(!(0>d+p||a<=d+p))for(var q=-1;1>=q;q+=1)0>g+q||a<=g+q||(0!=p||0!=q)&&t==b.a(d+p,g+q)&&(e+=1);5e;e+=1)c[e]=1<e;e+=1)c[e]=c[e-4]^c[e-5]^c[e-6]^c[e-8];for(e=0;255>e;e+=1)a[c[e]]=e;return{g:function(b){if(1>b)throw Error(\"glog(\"+b+\")\");return a[b]},i:function(b){for(;0>b;)b+=255;for(;256<=b;)b-=255;return c[b]}}}(),t=function(){function c(b,c){switch(c){case A.L:return a[4*\n(b-1)];case A.M:return a[4*(b-1)+1];case A.Q:return a[4*(b-1)+2];case A.H:return a[4*(b-1)+3]}}var a=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,\n2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,\n45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,\n151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],\n[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],\n[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e={I:function(b,a){var e=c(b,a);if(\"undefined\"==\ntypeof e)throw Error(\"bad rs block @ typeNumber:\"+b+\"/errorCorrectLevel:\"+a);b=e.length/3;a=[];for(var d=0;d & {\n language?: LangCode;\n};\ntype DispatchProps = Pick;\n\nconst DATA_PREFIX = 'tg://login?token=';\n\nconst AuthCode: FC = ({\n connectionState,\n authState,\n authQrCode,\n language,\n returnToAuthPhoneNumber,\n setSettingOption,\n}) => {\n const suggestedLanguage = getSuggestedLanguage();\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const qrCodeRef = useRef(null);\n const continueText = useLangString(suggestedLanguage, 'ContinueOnThisLanguage');\n const [isLoading, markIsLoading, unmarkIsLoading] = useFlag();\n\n useEffect(() => {\n if (!authQrCode || connectionState !== 'connectionStateReady') {\n return;\n }\n\n const container = qrCodeRef.current!;\n\n container.innerHTML = '';\n container.classList.remove('pre-animate');\n\n QrCreator.render({\n text: `${DATA_PREFIX}${authQrCode.token}`,\n radius: 0.5,\n ecLevel: 'M',\n fill: '#4E96D4',\n size: 280,\n }, container);\n }, [connectionState, authQrCode]);\n\n const handleLangChange = useCallback(() => {\n markIsLoading();\n\n void setLanguage(suggestedLanguage, () => {\n unmarkIsLoading();\n\n setSettingOption({ language: suggestedLanguage });\n });\n }, [markIsLoading, setSettingOption, suggestedLanguage, unmarkIsLoading]);\n\n const isAuthReady = authState === 'authorizationStateWaitQrCode';\n\n return (\n
\n
\n {authQrCode ? (\n
\n ) : (\n
\n )}\n

{lang('Login.QR.Title')}

\n
    \n
  1. {lang('Login.QR.Help1')}
  2. \n
  3. {renderText(lang('Login.QR.Help2'), ['simple_markdown'])}
  4. \n
  5. {lang('Login.QR.Help3')}
  6. \n
\n {isAuthReady && (\n \n )}\n {suggestedLanguage && suggestedLanguage !== language && continueText && (\n \n )}\n
\n
\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const {\n connectionState, authState, authQrCode, settings: { byKey: { language } },\n } = global;\n\n return {\n connectionState,\n authState,\n authQrCode,\n language,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, [\n 'returnToAuthPhoneNumber', 'setSettingOption',\n ]),\n)(AuthCode));\n","import React, { FC, useEffect, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from '../../global/types';\n\nimport '../../modules/actions/initial';\nimport { pick } from '../../util/iteratees';\nimport { PLATFORM_ENV } from '../../util/environment';\nimport windowSize from '../../util/windowSize';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport UiLoader from '../common/UiLoader';\nimport AuthPhoneNumber from './AuthPhoneNumber';\nimport AuthCode from './AuthCode.async';\nimport AuthPassword from './AuthPassword.async';\nimport AuthRegister from './AuthRegister.async';\nimport AuthQrCode from './AuthQrCode';\n\nimport './Auth.scss';\n\ntype StateProps = Pick;\ntype DispatchProps = Pick;\n\nconst Auth: FC = ({\n authState, reset, initApi, returnToAuthPhoneNumber, goToAuthQrCode,\n}) => {\n useEffect(() => {\n reset();\n initApi();\n }, [reset, initApi]);\n\n const isMobile = PLATFORM_ENV === 'iOS' || PLATFORM_ENV === 'Android';\n\n const handleChangeAuthorizationMethod = () => {\n if (!isMobile) {\n goToAuthQrCode();\n } else {\n returnToAuthPhoneNumber();\n }\n };\n\n useHistoryBack(\n (!isMobile && authState === 'authorizationStateWaitPhoneNumber')\n || (isMobile && authState === 'authorizationStateWaitQrCode'), handleChangeAuthorizationMethod,\n );\n\n // Prevent refresh when rotating device\n useEffect(() => {\n windowSize.disableRefresh();\n\n return () => {\n windowSize.enableRefresh();\n };\n }, []);\n\n switch (authState) {\n case 'authorizationStateWaitCode':\n return ;\n case 'authorizationStateWaitPassword':\n return ;\n case 'authorizationStateWaitRegistration':\n return ;\n case 'authorizationStateWaitPhoneNumber':\n return ;\n case 'authorizationStateWaitQrCode':\n return ;\n default:\n return isMobile\n ? \n : ;\n }\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['authState']),\n (global, actions): DispatchProps => pick(actions, ['reset', 'initApi', 'returnToAuthPhoneNumber', 'goToAuthQrCode']),\n)(Auth));\n","import React, { FC, memo } from '../../lib/teact/teact';\nimport { Bundles } from '../../util/moduleLoader';\n\nimport useModuleLoader from '../../hooks/useModuleLoader';\n\nconst MainAsync: FC = () => {\n const Main = useModuleLoader(Bundles.Main, 'Main');\n\n return Main ?
: undefined;\n};\n\nexport default memo(MainAsync);\n","import React, { FC } from '../../lib/teact/teact';\n\nimport Button from '../ui/Button';\n\nimport appInactivePath from '../../assets/app-inactive.png';\nimport './AppInactive.scss';\n\nconst AppInactive: FC = () => {\n const handleReload = () => {\n window.location.reload();\n };\n\n return (\n
\n
\n \"\"\n

Such error, many tabs

\n
\n Telegram supports only one active tab with the app.\n
\n Please reload this page to continue using this tab or close it.\n
\n
\n \n
\n
\n
\n );\n};\n\nexport default AppInactive;\n","import { FC, useEffect } from './lib/teact/teact';\nimport React, { withGlobal } from './lib/teact/teactn';\n\nimport { GlobalActions, GlobalState } from './global/types';\n\nimport { INACTIVE_MARKER, PAGE_TITLE } from './config';\nimport { pick } from './util/iteratees';\nimport { updateSizes } from './util/windowSize';\nimport { addActiveTabChangeListener } from './util/activeTabMonitor';\nimport useFlag from './hooks/useFlag';\n\nimport Auth from './components/auth/Auth';\nimport UiLoader from './components/common/UiLoader';\nimport Main from './components/main/Main.async';\nimport AppInactive from './components/main/AppInactive';\nimport { hasStoredSession } from './util/sessions';\n// import Test from './components/test/TestNoRedundancy';\n\ntype StateProps = Pick;\ntype DispatchProps = Pick;\n\nconst App: FC = ({ authState, disconnect }) => {\n const [isInactive, markInactive] = useFlag(false);\n\n useEffect(() => {\n updateSizes();\n addActiveTabChangeListener(() => {\n disconnect();\n document.title = `${PAGE_TITLE}${INACTIVE_MARKER}`;\n\n markInactive();\n });\n }, [disconnect, markInactive]);\n\n // return ;\n\n if (isInactive) {\n return ;\n }\n\n if (authState) {\n switch (authState) {\n case 'authorizationStateWaitPhoneNumber':\n case 'authorizationStateWaitCode':\n case 'authorizationStateWaitPassword':\n case 'authorizationStateWaitRegistration':\n case 'authorizationStateWaitQrCode':\n return ;\n case 'authorizationStateClosed':\n case 'authorizationStateClosing':\n case 'authorizationStateLoggingOut':\n case 'authorizationStateReady':\n return renderMain();\n }\n }\n\n return hasStoredSession(true) ? renderMain() : ;\n};\n\nfunction renderMain() {\n return (\n \n
\n \n );\n}\n\nexport default withGlobal(\n (global): StateProps => pick(global, ['authState']),\n (setGlobal, actions): DispatchProps => pick(actions, ['disconnect']),\n)(App);\n","import './util/handleError';\nimport './util/setupServiceWorker';\n\nimport React, { getDispatch, getGlobal } from './lib/teact/teactn';\nimport TeactDOM from './lib/teact/teact-dom';\n\nimport './global';\n\nimport { DEBUG } from './config';\n\nimport App from './App';\n\nimport './styles/index.scss';\n\nif (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> INIT');\n}\n\ngetDispatch().init();\n\nif (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> START INITIAL RENDER');\n}\n\nTeactDOM.render(\n ,\n document.getElementById('root'),\n);\n\nif (DEBUG) {\n // eslint-disable-next-line no-console\n console.log('>>> FINISH INITIAL RENDER');\n}\n\ndocument.addEventListener('dblclick', () => {\n // eslint-disable-next-line no-console\n console.log('GLOBAL STATE', getGlobal());\n});\n"],"names":["leafPrototypes","getProto","inProgress","dataWebpackPrefix","loadStylesheet","installedCssChunks","worker","requestStates","Map","requestStatesByCallback","initApi","onUpdate","initialArgs","DEBUG","console","log","Worker","URL","addEventListener","data","type","update","requestState","get","messageId","error","reject","resolve","response","callback","callbackArgs","subscribeToWorker","platform","window","async","Promise","race","makeRequest","pause","then","Error","err","Date","now","startedAt","location","reload","args","callApi","fnName","name","warn","cancelApiProgress","progressCallback","isCanceled","postMessage","message","generateIdFor","payload","promise","Object","assign","pop","set","catch","finally","delete","ApiMediaFormat","ApiMessageEntityTypes","MAIN_THREAD_ID","MESSAGE_DELETED","base","maxint","adapt","delta","numpoints","firsttime","k","Math","floor","decode","input","preserveCase","output","case_flags","input_length","length","n","out","i","bias","basic","j","ic","oldi","w","digit","t","len","lastIndexOf","charCodeAt","RangeError","push","cp","splice","String","fromCharCode","toUpperCase","value","join","utf16","ensureProtocol","url","includes","getDomain","href","decodedHref","decodeURI","match","domain","replace","domain_array","split","s","slice","convertPunycode","memo","text","className","children","isRtl","toggleSafeLinkModal","openTelegramLink","getDispatch","content","isNotSafe","handleClick","useCallback","e","ctrlKey","altKey","shiftKey","metaKey","RE_TME_LINK","RE_TME_INVITE_LINK","preventDefault","classNames","buildClassName","title","target","rel","onClick","dir","getFileSizeString","bytes","ONE_GIGABYTE","toFixed","ONE_MEGABYTE","getDocumentExtension","document","fileName","mimeType","getFileExtension","indexOf","getColorFromExtension","extension","getDocumentHasPreview","Boolean","previewBlobUrl","thumbnail","RE_EMOJI_ONLY","RegExp","twemojiRegex","DETECT_UP_TO","emojiCount","withGlobal","undefined","setGlobal","actions","pick","sender","openUserInfo","id","Link","focusMessage","handleMessageClick","chatId","openChat","renderActionMessageText","lang","actionOrigin","targetUsers","targetMessage","targetChatId","options","action","translationValues","amount","currency","textOptions","maxTextLength","processed","unprocessed","processPlaceholder","formatCurrency","code","isEmbedded","origin","asPlain","isChat","chat","trimText","getChatTitle","renderText","renderChatContent","renderUserContent","renderOriginContent","map","user","filter","getMessageSummaryText","photo","video","sticker","getMessageContent","showQuotes","messageText","isGif","renderMessageContent","invoice","renderProductContent","renderMigratedContent","trim","getUserFullName","placeholder","replaceValue","placeholderPosition","substring","Array","isArray","forEach","index","RE_LETTER_OR_DIGIT","SIMPLE_MARKDOWN_REGEX","part","filters","params","reduce","textParts","divEl","createElement","result","innerText","innerHTML","escapeHtml","EMOJI_REGEX","replaceEmojis","addLineBreaks","highlight","lowerCaseText","toLowerCase","queryPosition","nextSymbol","newParts","links","RE_LINK","nextLink","shift","lastIndex","startsWith","username","endsWith","addLinks","replaceSimpleMarkdown","size","IS_EMOJI_SUPPORTED","parts","fixNonStandardEmoji","emojis","emojiResult","emoji","nativeToUnified","removeVS16s","src","alt","line","source","trimmedLine","trimLeft","indentLength","repeat","RE_LINK_TEMPLATE","RE_MENTION_TEMPLATE","entities","entityResult","entity","preventMessageInputBlur","withBubbling","IS_IOS","activeElement","EDITABLE_INPUT_ID","currentTarget","preventMessageInputBlurWithBubbling","global","userId","userOrChat","selectUser","openChatByUsername","ref","onContextMenu","onMouseDown","onMouseEnter","onMouseLeave","onFocus","color","round","pill","fluid","isText","isLoading","ariaLabel","download","disabled","ripple","faded","tabIndex","elementRef","useRef","isClicked","setIsClicked","useState","fullClassName","setTimeout","handleMouseDown","label","subLabel","checked","blocking","onChange","onCheck","useLang","handleChange","event","trigger","positionX","positionY","footer","forceOpen","onOpen","onClose","menuRef","dropdownRef","isOpen","setIsOpen","onKeyDown","menu","current","keyCode","focusedElement","elementChildren","from","focus","onTrigger","containerRef","autoClose","shouldSkipTransition","success","readOnly","autoComplete","inputMode","maxLength","onInput","onKeyPress","onBlur","onPaste","labelText","htmlFor","withBackground","style","noCloseOnBackdrop","onCloseAnimationEnd","backdropContainerRef","transitionClassNames","useShowTransition","useEffect","captureEscKeyListener","useHistoryBack","useEffectWithPrevDeps","prevIsOpen","dispatchHeavyAnimationEvent","handleKeyDown","useKeyboardListNavigation","useVirtualBackdrop","bubbleClassName","props","icon","destructive","stopPropagation","role","ripples","setRipples","cleanUpDebounced","useMemo","debounce","button","container","position","getBoundingClientRect","rippleSize","offsetWidth","x","clientX","y","clientY","requestAnimationFrame","PAGE_TITLE","INACTIVE_MARKER","APP_NAME","process","APP_VERSION","DEBUG_MORE","IS_TEST","DEBUG_ALERT_MSG","SESSION_USER_KEY","LEGACY_SESSION_KEY","GLOBAL_STATE_CACHE_DISABLED","GLOBAL_STATE_CACHE_KEY","GLOBAL_STATE_CACHE_CHAT_LIST_LIMIT","GLOBAL_STATE_CACHE_USER_LIST_LIMIT","MEDIA_CACHE_DISABLED","MEDIA_CACHE_NAME","MEDIA_CACHE_NAME_AVATARS","MEDIA_PROGRESSIVE_CACHE_NAME","CUSTOM_BG_CACHE_NAME","LANG_CACHE_NAME","isBigScreen","innerHeight","MIN_PASSWORD_LENGTH","MESSAGE_LIST_SENSITIVE_AREA","MESSAGE_LIST_SLICE","MESSAGE_LIST_VIEWPORT_LIMIT","CHAT_HEIGHT_PX","CHAT_LIST_SLICE","CHAT_LIST_LOAD_SLICE","SHARED_MEDIA_SLICE","MESSAGE_SEARCH_SLICE","GLOBAL_SEARCH_SLICE","MEMBERS_SLICE","MEMBERS_LOAD_SLICE","PROFILE_SENSITIVE_AREA","TOP_CHAT_MESSAGES_PRELOAD_LIMIT","ALL_CHATS_PRELOAD_DISABLED","ANIMATION_LEVEL_MIN","ANIMATION_LEVEL_MAX","ANIMATION_LEVEL_DEFAULT","DEFAULT_MESSAGE_TEXT_SIZE_PX","IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX","MACOS_DEFAULT_MESSAGE_TEXT_SIZE_PX","DRAFT_DEBOUNCE","EDITABLE_INPUT_MODAL_ID","SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","SAFE_SCREEN_WIDTH_FOR_CHAT_INFO","MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN","MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN","MOBILE_SCREEN_MAX_WIDTH","MOBILE_SCREEN_LANDSCAPE_MAX_WIDTH","MOBILE_SCREEN_LANDSCAPE_MAX_HEIGHT","LOCAL_MESSAGE_ID_BASE","ANIMATION_END_DELAY","FAST_SMOOTH_MAX_DISTANCE","FAST_SMOOTH_MIN_DURATION","FAST_SMOOTH_MAX_DURATION","FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE","STICKER_SIZE_INLINE_DESKTOP_FACTOR","Set","STICKER_SIZE_INLINE_MOBILE_FACTOR","STICKER_SIZE_AUTH","STICKER_SIZE_AUTH_MOBILE","STICKER_SIZE_PICKER","STICKER_SIZE_GENERAL_SETTINGS","STICKER_SIZE_PICKER_HEADER","STICKER_SIZE_SEARCH","STICKER_SIZE_MODAL","STICKER_SIZE_TWO_FA","STICKER_SIZE_DISCUSSION_GROUPS","STICKER_SIZE_FOLDER_SETTINGS","STICKER_SIZE_INLINE_BOT_RESULT","MEMOJI_STICKER_ID","BASE_EMOJI_KEYWORD_LANG","MENU_TRANSITION_DURATION","SLIDE_TRANSITION_DURATION","CONTENT_TYPES_FOR_QUICK_UPLOAD","SERVICE_NOTIFICATIONS_USER_ID","REPLIES_USER_ID","ALL_FOLDER_ID","ARCHIVED_FOLDER_ID","MAX_MEDIA_FILES_FOR_ALBUM","MAX_ACTIVE_PINNED_CHATS","SCHEDULED_WHEN_ONLINE","DEFAULT_LANG_CODE","DEFAULT_LANG_PACK","LANG_PACKS","TIPS_USERNAME","LOCALIZED_TIPS","FEEDBACK_URL","LIGHT_THEME_BG_COLOR","DARK_THEME_BG_COLOR","DARK_THEME_PATTERN_COLOR","DEFAULT_PATTERN_COLOR","cb","dependencies","debugKey","prevDeps","usePrevious","initial","setValue","setTrigger","ANIMATION_START_EVENT","ANIMATION_END_EVENT","timeout","isAnimating","duration","dispatchEvent","Event","clearTimeout","handleAnimationStart","handleAnimationEnd","removeEventListener","LOCATION_HASH","hash","historyState","currentIndex","nextStateIndexToReplace","isHistoryAltered","isDisabled","isEdge","currentIndexes","disableHistoryBack","handleTouchEnd","isActive","onBack","onForward","currentState","shouldReplaceNext","hashes","indexRef","isForward","prevIsActive","isClosed","indexHashRef","prevHashes","isHashChangedFromEvent","isForceClose","prev","history","pushState","state","last","realDelta","indexLast","findIndex","l","go","replaceState","back","handlePopState","currIndex","disableHistoryAnimations","hasChanged","areSortedArraysEqual","forceClose","touches","pageX","innerWidth","pathname","onSelectWithEnter","itemSelector","noCaptureFocus","focusedIndex","setFocusedIndex","element","querySelectorAll","newIndex","item","forceUpdate","useForceUpdate","useOnChange","langProvider","bundleName","moduleName","noLoad","autoUpdate","module","getModuleFromMemory","addLoadListener","loadModule","some","d","next","shouldSkipUndefined","onCloseTransitionEnd","noOpenTransition","noCloseTransition","setIsClosed","closeTimeoutRef","hasOpenClassName","setHasOpenClassName","shouldHaveOpenClassName","isClosing","shouldRender","handleEvent","contains","classList","NON_BUBBLEABLE_EVENTS","delegationRegistry","delegatedEventsByElement","documentEventCounters","propName","handler","asCapture","eventName","resolveEventName","canUseEventDelegation","resolveDelegationRegistryForName","existing","newSet","resolveDelegatedEventsForElement","add","addDelegatedListener","removeDelegatedListener","tagName","realEventName","has","removeAllDelegatedListeners","eventNames","realEvent","events","furtherCallsPrevented","Proxy","p","Reflect","body","parentNode","FILTERED_ATTRIBUTES","HTML_ATTRIBUTES","MAPPED_ATTRIBUTES","autoPlay","headsByElement","renderWithVirtual","parentEl","$current","$new","$parent","skipComponentUpdate","forceIndex","fragment","moveDirection","isComponentElement","hasElementChanged","componentInstance","renderComponent","updateComponent","isMounted","setupComponentUpdateListener","initComponent","node","createNode","setTarget","childNodes","insertBefore","appendChild","removeChild","getTarget","unmountTree","replaceChild","areComponents","isRealElement","nextSibling","currentKeys","keys","newKeys","key","removeAttribute","addAttribute","oldValue","newValue","updateAttribute","updateAttributes","currentEl","teactFastList","$newChild","currentRemainingIndex","remainingByKey","acc","$currentChild","newChildKey","$element","order","teactOrderKey","fragmentQueue","fragmentIndex","newChildren","currentPreservedIndex","currentChildInfo","concat","flushFragmentQueue","shouldMoveNode","isMovingDown","renderFastListChildren","max","createDocumentFragment","renderChildren","mountComponent","$firstChild","isEmptyElement","createTextNode","isTextElement","tag","$child","$fragmentChild","cssText","setAttribute","render","headId","getAttribute","$head","VirtualElementTypesEnum","Fragment","Symbol","renderingInstance","Empty","Text","isTagElement","Tag","Component","flatten","parsedChildren","hooks","cursor","byCursor","effects","memos","buildComponentElement","createComponentInstance","dropEmptyTail","buildChildElement","buildTagElement","isEmptyPlaceholder","child","DEBUG_components","newRenderedValue","DEBUG_startAt","componentName","renderCount","renderTimes","performance","renderTime","handleError","renderedValue","newChild","$old","hook","cleanup","effect","nextValue","setter","helpGc","prepareComponentForFrame","prepareForFrame","throttleWithPrimaryRaf","throttleWithRaf","forceUpdateComponent","currentElement","DEBUG_contentComponentName","useLayoutEffectBase","schedulerFn","exec","dependency","causedBy","res","prevValue","fastRaf","useLayoutEffect","onTickEnd","resolver","getUnequalProps","newCallback","areEqual","arePropsShallowEqual","propsRef","renderedRef","orderBy","values","React","currentGlobal","reducers","callbacks","containers","mapStateToProps","mapReducersToProps","ownProps","mappedProps","newMappedProps","Number","isNaN","DEBUG_componentName","areMappedPropsChanged","DEBUG_updates","updateTime","runCallbacks","runCallbacksThrottled","newGlobal","noThrottle","getGlobal","addReducer","reducer","onDispatch","addCallback","removeCallback","TeactNContainer","vs16RegExp","zeroWidthJoiner","rawEmoji","importLegacySession","clearLegacySessions","apiUpdate","userAgent","navigator","PLATFORM_ENV","sessionData","loadStoredSession","phoneNumber","authIsLoading","authError","password","file","firstName","lastName","authIsLoadingQrCode","storeSession","currentUserId","clearStoredSession","unsubscribe","forceWebsync","reset","cacheApi","langCachePrefix","langCacheVersion","updateAppBadge","init","connectionState","authNearestCountry","langCode","settings","byKey","language","countryList","deviceToken","subscribedAt","buildInputPrivacyRules","visibility","allowedIds","deniedIds","users","byId","usersById","chats","chatsById","rules","collectUsers","isChatPrivate","accessHash","collectChats","allowedUsers","allowedChats","blockedUsers","blockedChats","bio","about","profileEdit","progress","ProfileEditProgress","currentUser","updateUser","fullInfo","isUsernameAvailable","loadedWallpapers","wallpapers","createObjectURL","slug","UPLOADING_WALLPAPER_SLUG","wallpaper","firstWallpaper","withLocalMedia","addUsers","buildCollectionByKey","updateChats","blocked","ids","blockedIds","totalCount","contactId","addBlockedContact","removeBlockedContact","activeSessions","session","isCurrent","serverTimeOffset","addNotifyExceptions","replaceSettings","peerType","isSilent","shouldShowPreviews","updateNotifySettings","hasPushNotifications","hasWebNotifications","subscribe","hasContactJoinedNotifications","languages","phoneNumberSettings","lastSeenSettings","profilePhotoSettings","forwardsSettings","chatInviteSettings","all","privacy","lastSeen","profilePhoto","forwards","chatInvite","privacyKey","allowUserIds","allowChatIds","blockUserIds","blockChatIds","isAllowList","contactsIds","isSensitiveEnabled","selectNotifySettings","setLanguage","onUpdateApiReady","wasAuthReady","authState","authorizationState","isLoggingOut","authIsCodeViaApp","isCodeViaApp","authHint","hint","authQrCode","qrCode","lastSyncTime","onUpdateAuthorizationState","onUpdateAuthorizationError","sync","signOut","onUpdateConnectionState","authRememberMe","isEmpty","mainDcId","saveSession","onUpdateSession","onUpdateServerTimeOffset","sessionUserAuth","localStorage","getItem","userAuth","JSON","parse","setItem","stringify","updateSessionUserId","onUpdateCurrentUser","paymentShippingError","getShippingError","addPaymentError","showDialog","hasErrorKey","handleSystemThemeChange","currentThemeMatch","documentElement","currentTheme","nextTheme","selectTheme","animationLevel","switchTheme","mql","matchMedia","addListener","subscribeToSystemThemeChange","messageTextSize","theme","setProperty","toString","IS_TOUCH_ENV","startWebsync","IS_ANDROID","IS_MAC_OS","uiReadyState","remove","authPhoneNumber","shouldSkipHistoryAnimations","replaceThemeSettings","FOREVER_BANNED_DATE","isChatGroup","isChatBasicGroup","isChatSuperGroup","isChatChannel","isCommonBoxChat","getChatTypeString","getPrivateChatUserId","isSelf","getChatDescription","getChatLink","inviteLink","getChatAvatarHash","owner","avatarHash","isChatSummaryOnly","lastMessage","isChatAdmin","adminRights","getHasAdminRight","isUserRightBanned","currentUserBannedRights","defaultBannedRights","getCanPostInChat","threadId","isRestricted","migratedTo","isNotJoined","isCreator","getAllowedAttachmentOptions","isChatWithBot","canAttachMedia","canAttachPolls","canSendStickers","canSendGifs","canAttachEmbedLinks","isAdmin","getMessageSendingRestrictionReason","sendMessages","untilDate","formatDateToString","formatTime","getChatSlowModeOptions","slowMode","getChatOrder","joinDate","draftDate","date","isChatArchived","folderId","selectIsChatMuted","notifySettings","notifyExceptions","isMuted","hasPrivateChatsNotifications","hasBroadcastNotifications","hasGroupNotifications","selectShouldShowMessagePreview","hasPrivateChatsMessagePreview","hasBroadcastMessagePreview","hasGroupMessagePreview","getCanDeleteChat","prepareFolderListIds","folder","chatIdsCache","excludedChatIds","includedChatIds","pinnedChatIds","isListed","excludeArchived","excludeMuted","unreadMentionsCount","unreadCount","hasUnreadMark","excludeRead","privateChatUser","bots","contacts","isContact","nonContacts","groups","channels","filterChatFolder","prepareChatList","listIds","orderedPinnedIds","folderType","chatFilter","listedChats","listIdsSet","pinnedChats","otherChats","getFolderUnreadDialogs","unreadDialogsCount","total","hasActiveDialogs","getFolderDescriptionText","emoticon","description","pinnedIds","getFolderChatsCount","chatOrUser","getMessageSenderName","getUserFirstOrLastName","sortChatIds","chatIds","shouldPrioritizeVerified","priorityIds","priority","isVerified","CONTENT_NOT_SUPPORTED","getMessageKey","parseMessageKey","getMessageOriginalId","previousLocalId","noEmoji","audio","voice","contact","poll","truncatedText","substr","groupedId","getMessageAudioCaption","summary","question","getMessageText","webPage","getMessageCustomShape","isRound","parseEmojiOnlyString","getMessageSingleEmoji","getFirstLinkInMessage","link","find","offset","isOwnMessage","isOutgoing","isReplyMessage","replyToMessageId","isForwardedMessage","forwardInfo","isActionMessage","isServiceNotificationMessage","isMessageLocal","isAnonymousOwnMessage","senderId","getSenderTitle","getSendingState","sendingState","isHistoryClearMessage","performer","hasMessageMedia","getMessagePhoto","getMessageVideo","getMessageDocument","getMessageSticker","getMessageContact","getMessagePoll","getMessageAction","getMessageAudio","getMessageVoice","getMessageRoundVideo","isMessageDocumentPhoto","mediaType","isMessageDocumentVideo","getMessageInvoice","getMessageWebPage","getMessageWebPagePhoto","getMessageWebPageVideo","getMessageMediaThumbDataUri","media","getMessageMediaThumbnail","dataUri","getMessageMediaHash","webPagePhoto","webPageVideo","messageVideo","messagePhoto","hasMessageLocalBlobUrl","getVideoOrAudioBaseHash","IS_PROGRESSIVE_SUPPORTED","IS_SAFARI","getMessageMediaFormat","fullVideo","isAnimated","IS_OPUS_SUPPORTED","getMessageFileName","getMessageFileSize","blobUrl","getChatMediaMessageIds","messages","listedIds","isFromSharedMedia","getMessageContentIds","reverse","getPhotoFullDimensions","sizes","getPhotoInlineDimensions","getVideoDimensions","width","height","getMediaTransferState","isDownloadNeeded","isUploading","isTransferring","transferProgress","messageIds","contentType","validator","matchLinkInMessageText","getMediaDuration","buildChatThreadKey","STRIPE_ERRORS","missing_payment_information","field","invalid_number","number","exp_year","exp_month","invalid_expiry_year","invalid_expiry_month","cvc","invalid_cvc","getStripeError","param","USER_COLOR_KEYS","isDeletedUser","getUserStatus","status","wasOnline","getTime","wasOnlineDate","diff","today","setHours","yesterday","setDate","getDate","formatFullDate","isUserOnline","isUserBot","sortUserIds","userIds","getServerTime","expires","getUserColorKey","peer","abs","replaceChatListIds","newIds","updateChatListIds","idsUpdate","replaceChats","newById","getUpdatedChat","chatUpdate","shouldOmitMinInfo","isMin","updatedChat","omit","photos","updateChat","updatedById","updatedChats","addChats","addedById","isAdded","addedChats","updateChatListType","listType","currentListIds","listTypeKey","currentFolderList","updateChatListSecondaryInfo","info","totalCountKey","totalChatCount","isFullyLoaded","updateCurrentMessageList","shouldReplaceHistory","messageLists","newMessageLists","replaceChatMessages","updateMessageStore","byChatId","threadsById","replaceThreadParam","paramName","threadUpdate","updateThread","addMessages","addedByChatId","messagesByChatId","addChatMessagesById","selectChatMessages","every","newId","updateChatMessage","messageUpdate","updatedMessage","updateScheduledMessage","selectScheduledMessages","replaceScheduledMessages","deleteChatMessages","deletedForwardedPosts","pickTruthy","isLinkedChannelPost","threadInfo","selectThreadInfo","selectListedIds","outlyingIds","selectOutlyingIds","viewportIds","selectViewportIds","selectPinnedIds","newMessageCount","messagesCount","currentMessageList","selectCurrentMessageList","canDeleteCurrentThread","currentThreadId","fromChatId","fromMessageId","originalPost","selectChatMessage","deleteChatScheduledMessages","scheduledIds","selectScheduledIds","updateListedIds","orderHistoryIds","updateOutlyingIds","sort","a","b","addViewportId","safeReplaceViewportIds","newViewportIds","updateThreadInfo","newThreadInfo","updateThreadInfos","updates","scheduledMessages","updateScheduledMessages","updateFocusedMessage","noHighlight","isResizingContainer","focusedMessage","updateFocusDirection","direction","enterMessageSelectMode","selectedMessages","prototype","toggleMessageSelection","messageListType","childMessageIds","withShift","oldSelectedMessages","selectMessageIdsByGroupId","selectedMessageIds","newMessageIds","newSelectedMessageIds","selectCurrentMessageIds","prevIndex","min","to","unique","exitMessageSelectMode","updateThreadUnreadFromForwardedMessage","originMessage","lastMessageId","isDeleting","channelPostId","threadInfoOld","updateStickerSets","category","sets","resultIds","updatedSets","stickerSet","stickers","setsById","setIds","updateStickerSet","stickerSetId","currentStickerSet","updateGifSearch","isNew","results","nextOffset","currentResults","gifs","search","newResults","currentIds","gif","replaceAnimatedEmojis","animatedEmojis","updateStickersForEmoji","remoteStickers","allStickers","selectStickersForEmoji","uniqueIds","forEmoji","rebuildStickersForEmoji","replaceUsers","getUpdatedUser","userUpdate","updatedUser","updateContactList","updatedUsers","contactUserIds","contactList","newContactUserIds","updateUsers","addedUsers","updateSelectedUserId","selectedId","deleteUser","MEMO_EMPTY_ARRAY","updateUserSearch","searchStatePartial","userSearch","updateUserSearchFetchingStatus","newState","fetchingStatus","updateUserBlockedState","isBlocked","getComplexKey","updateGlobalSearch","globalSearch","updateGlobalSearchContent","currentContent","updateGlobalSearchResults","newFoundMessages","nextRate","resultsByType","newFoundMessagesById","foundIdsForType","foundIds","updateGlobalSearchFetchingStatus","prevFoundIds","newFoundIds","foundOrPrevFoundIds","nextOffsetId","replaceLocalTextSearch","chatThreadKey","searchParams","localTextSearch","byChatThreadKey","updateLocalTextSearch","query","replaceLocalTextSearchResults","updateLocalTextSearchResults","orderFoundIds","replaceLocalMediaSearch","localMediaSearch","updateLocalMediaSearchType","currentType","updateLocalMediaSearchResults","replaceLocalMediaSearchResults","updateManagementProgress","management","updateManagement","newSettings","themes","notifyException","exceptionData","addNotifyException","updateTwoFaSettings","twoFaSettings","updateShippingOptions","shippingOptions","payment","setRequestInfoId","requestId","setPaymentStep","step","setInvoiceMessageInfo","isTest","photoUrl","invoiceContent","setStripeCardInfo","cardInfo","stripeCredentials","setPaymentForm","form","setReceipt","receipt","messageInvoice","clearPayment","closeInvoice","isPaymentModalOpen","selectIsUserBlocked","selectNotifyExceptions","selectChat","selectChatUser","selectIsChatWithSelf","selectIsChatWithBot","selectSupportChat","isSupport","selectChatOnlineCount","members","onlineCount","selectChatBot","selectIsChatBotNotStarted","bot","messageInfo","selectAreActiveChatsLoaded","active","selectIsChatListed","targetList","list","selectChatListType","selectChatFolder","chatFolders","selectIsChatPinned","archived","chatFoldersById","selectChatByUsername","usernameLowered","selectCountNotMutedUnread","activeChatIds","selectCurrentStickerSearch","selectCurrentGifSearch","selectStickerSet","selectStickerSetByShortName","shortName","stickerSets","stickersForEmoji","packs","selectAnimatedEmoji","cleanedEmoji","selectCurrentChat","selectThreadParam","thread","selectScrollOffset","selectReplyingToId","selectEditingId","selectEditingScheduledId","selectDraft","selectNoWebPage","selectFirstMessageId","selectReplyStack","selectThreadOriginChat","originChannelId","selectThreadTopMessageId","topMessageId","selectThreadByMessage","replyToTopMessageId","isMessageInCurrentMessageList","selectIsViewportNewest","chatMessages","selectScheduledMessage","selectEditingMessage","selectChatMessageByPollId","pollId","messageWithPoll","selectFocusedMessageId","focusedChatId","selectIsMessageFocused","focusedId","selectOutgoingStatus","isScheduledList","lastReadOutboxMessageId","selectIsMessageUnread","selectSender","selectForwardedSender","isChannelPost","senderUserId","selectAllowedMessageActions","isPrivate","isChatWithSelf","isBasicGroup","isSuperGroup","isChannel","isServiceNotification","isOwn","isAction","isMessageEditable","viaBotId","canReply","hasPinPermission","canPin","canUnpin","pinnedMessageIds","canDelete","canReport","canDeleteForAll","canEdit","canForward","hasSticker","hasFavoriteSticker","favorite","selectIsStickerFavorite","canFaveSticker","canUnfaveSticker","canCopy","canCopyLink","canSelect","noOptions","ability","selectCanDeleteSelectedMessages","messageActions","selectCanReportSelectedMessages","selectUploadProgress","fileUploads","byMessageLocalId","selectRealLastReadId","lastReadInboxMessageId","Infinity","selectFirstUnreadId","lastReadId","found","isFromScheduled","selectIsForwardModalOpen","forwardMessages","isModalShown","selectCommonBoxChatId","fromLastMessage","selectIsInSelectMode","selectIsMessageSelected","selectForwardedMessageIdsByGroupId","selectIsDocumentGroupSelected","selectedIds","groupIds","selectSelectedMessagesCount","selectNewestMessageWithBotKeyboardButtons","findLast","keyboardButtons","replyHideMessageId","shouldHideKeyboardButtons","selectShouldAutoLoadMedia","shouldAutoDownloadMediaFromContacts","shouldAutoDownloadMediaInPrivateChats","shouldAutoDownloadMediaInGroups","shouldAutoDownloadMediaInChannels","selectIsUserOrChatContact","selectShouldAutoPlayMedia","shouldAutoPlayVideos","shouldAutoPlayGifs","asGif","selectShouldLoopStickers","shouldLoopStickers","selectCurrentTextSearch","currentSearch","selectCurrentMediaSearchPeerId","currentProfileUserId","selectCurrentMediaSearch","peerId","selectManagement","selectCurrentManagementType","selectIsMediaViewerOpen","mediaViewer","avatarOwnerId","selectRightColumnContentKey","isChatInfoShown","newChatMembersProgress","isAddingChatMembersShown","NewChatMembersProgress","isPollResults","pollResults","selectIsPollResultsOpen","isSearch","IS_SINGLE_COLUMN_LAYOUT","isManagement","currentManagement","selectCurrentManagement","isStickerSearch","isGifSearch","currentChatId","areActiveChatsLoaded","isUserInfo","isChatInfo","RightColumnContent","selectIsRightColumnShown","shouldUseSystemTheme","getSystemTheme","selectCurrentGlobalSearchQuery","selectPaymentChatId","selectPaymentMessageId","selectPaymentFormId","formId","selectPaymentRequestId","selectProviderPublishableKey","nativeParams","publishableKey","selectStripeCredentials","LoadMoreDirection","FocusDirection","SettingsScreens","LeftColumnContent","GlobalSearchContent","MediaViewerOrigin","ChatCreationProgress","ManagementProgress","ProfileState","PaymentStep","ManagementScreens","currentInstance","animateSingle","tick","instance","isCancelled","animate","setAppBadge","currentProps","newProps","currentKeysLength","prop","self","caches","Type","fetch","cacheName","isHtmlAllowed","request","Request","cache","open","Blob","blob","headers","Json","json","save","cacheData","Response","put","clear","captureKeyboardListener","onEsc","keyToHandlerName","Enter","Backspace","Delete","Esc","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Tab","handlers","onEnter","onDelete","onBackspace","onUp","onDown","onLeft","onRight","onTab","captureKeyboardListeners","hasActiveHandlers","handlerName","currentEventHandlers","releaseKeyboardListener","keyHandlers","WEEKDAYS_FULL","MONTHS_FULL","MONTHS_FULL_LOWERCASE","month","getDayStart","datetime","getDayStartAt","toYearMonth","timestamp","getFullYear","getMonth","toIsoString","getHours","padStart","getMinutes","formatPastTimeShort","weekAgo","getDay","withYear","format","formatDate","formatMonthAndYear","isShort","formatHumanDate","noWeekdays","lowerFirst","upperFirst","weekAhead","weekDay","day","monthIndex","formatMediaDateTime","formatMediaDuration","hours","minutes","seconds","string","formatVoiceRecordDuration","durationInMs","milliseconds","locale","toLocaleString","year","isValidDate","MAX_MONTH_IN_YEAR","parseDateString","matchStringDate","matchEuropeStringDate","matchNumberDate","dateParts","timestampPlusDay","MILISECONDS_IN_DAY","str","EXCLUDE_EMOJIS","EMOJI_EXCEPTIONS","unifiedToNative","unified","codePoints","parseInt","fromCodePoint","regex","replacement","pairs","uncompressEmoji","emojiData","categories","emojiRaw","names","native","image","isoToEmoji","iso","test","c","codePointAt","isWebpSupportedCache","isWebpSupported","webp","Image","handleLoadOrError","onload","onerror","hasWebp","systemThemeCache","matches","os","getPlatform","IS_PWA","standalone","referrer","IS_TABLET_COLUMN_LAYOUT","IS_VOICE_RECORDING_SUPPORTED","mediaDevices","AudioContext","webkitAudioContext","IS_SERVICE_WORKER_SUPPORTED","Audio","canPlayType","IS_CANVAS_FILTER_SUPPORTED","getContext","LAYERS_ANIMATION_NAME","DPR","devicePixelRatio","MASK_IMAGE_DISABLED","dataUriToBlob","arr","mime","bstr","atob","u8arr","Uint8Array","blobToDataUri","reader","FileReader","readAsDataURL","blobToFile","File","lastModified","preloadImage","img","preloadVideo","volume","onloadedmetadata","createPosterForVideo","onseeked","videoWidth","videoHeight","canvas","drawImage","toDataURL","currentTime","fetchBlob","imgToCanvas","constructor","fileBits","rest","super","this","totalPrice","Intl","NumberFormat","store","random","hasOwnProperty","READABLE_ERROR_MESSAGES","CHAT_RESTRICTED","CHAT_WRITE_FORBIDDEN","CHAT_SEND_POLL_FORBIDDEN","CHAT_SEND_STICKERS_FORBIDDEN","CHAT_SEND_GIFS_FORBIDDEN","CHAT_SEND_MEDIA_FORBIDDEN","CHAT_LINK_EXISTS","SLOWMODE_WAIT_X","USER_BANNED_IN_CHANNEL","USER_IS_BLOCKED","YOU_BLOCKED_USER","IMAGE_PROCESS_FAILED","MEDIA_EMPTY","MEDIA_INVALID","PHOTO_EXT_INVALID","PHOTO_INVALID_DIMENSIONS","PHOTO_SAVE_FILE_INVALID","MESSAGE_DELETE_FORBIDDEN","MESSAGE_POLL_CLOSED","MESSAGE_EDIT_TIME_EXPIRED","CHAT_ADMIN_REQUIRED","PINNED_DIALOGS_TOO_MUCH","DIALOG_FILTERS_TOO_MUCH","CHANNEL_PRIVATE","MEDIA_CAPTION_TOO_LONG","ADDRESS_STREET_LINE1_INVALID","ADDRESS_STREET_LINE2_INVALID","ADDRESS_CITY_INVALID","ADDRESS_COUNTRY_INVALID","ADDRESS_POSTCODE_INVALID","ADDRESS_STATE_INVALID","REQ_INFO_NAME_INVALID","REQ_INFO_PHONE_INVALID","REQ_INFO_EMAIL_INVALID","LINK_NOT_MODIFIED","MESSAGE_TOO_LONG","SERVICE_WORKER_DISABLED","MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS","FRESH_RESET_AUTHORISATION_FORBIDDEN","BOTS_TOO_MUCH","BOT_GROUPS_BLOCKED","USERS_TOO_MUCH","USER_CHANNELS_TOO_MUCH","USER_KICKED","USER_NOT_MUTUAL_CONTACT","USER_PRIVACY_RESTRICTED","INVITE_HASH_EMPTY","INVITE_HASH_EXPIRED","INVITE_HASH_INVALID","CHANNELS_TOO_MUCH","USER_ALREADY_PARTICIPANT","SCHEDULE_DATE_INVALID","WALLPAPER_DIMENSIONS_INVALID","SHIPPING_ERRORS","getReadableErrorText","isSlowMode","textParams","extraPartIndex","errorMessage","handleErrorEvent","ErrorEvent","reason","throttle","alert","collection","member","mapValues","newByKey","object","stringKeys","orderKey","mode","mode1","mode2","orderKey1","orderKey2","aValue1","bValue1","aValue2","bValue2","aValue","bValue","array","compact","array1","array2","areSortedArraysIntersecting","findIntersectionWithSet","chunkSize","cloneDeep","predicate","SUBSTITUTION_REGEX","PLURAL_OPTIONS","PLURAL_RULES","en","ar","ca","de","es","fa","fr","it","ko","ms","nl","pl","pt_BR","ru","tr","uk","uz","langPack","fallbackLangPack","createCallbackManager","currentLangCode","getTranslation","cacheValue","cached","langString","processTranslation","importFallbackLangPack","getTranslationForLangString","translateString","remoteLangPack","remote","fetchRemoteString","withFallback","newLangPack","sourceLangPacks","fetchRemote","langInfo","rtl","default","template","optionIndex","getPluralOption","translationSlices","initialValue","processTemplate","formatInteger","SAMPLE_RATE","oggToWav","opusData","arrayBuffer","typedArray","decoderWorker","wavWorker","onmessage","command","buffers","buffer","page","terminate","wavBitDepth","wavSampleRate","decoderSampleRate","outputBufferSampleRate","pages","asCacheApiType","memoryCache","fetchPromises","mediaFormat","onProgress","progressiveUrl","getProgressive","mediaPng","webpToPng","prepared","prepareMedia","mediaSource","MediaSource","streamUrl","sourceBuffer","addSourceBuffer","endOfStream","appendBuffer","revokeObjectURL","fetchFromCacheOrRemote","getFromMemory","cancelProgress","mediaData","serviceWorker","fullSize","controller","Bundles","LOAD_PROMISES","MEMORY_CACHE","Auth","Main","Extra","handleBundleLoad","bundle","listeners","listener","getDeviceToken","subscription","toJSON","endpoint","checkIfPushSupported","ServiceWorkerRegistration","Notification","permission","soundPlayed","playNotificationSound","notificationSoundVolume","once","play","requestPermission","unsubscribeFromPush","dispatch","deleteDeviceToken","serviceWorkerRegistration","ready","pushManager","getSubscription","areSettingsLoaded","checkIfShouldResubscribe","userVisibleOnly","setDeviceToken","DOMException","ABORT_ERR","showNewMessageNotification","isActiveChat","resultSettings","resultExceptions","loadNotificationSettings","hasFocus","checkIfShouldNotify","messageSender","messageAction","actionTargetMessage","targetUserIds","actionTargetUserIds","actionTargetChatId","actionTargetUsers","privateChatUserId","senderName","getNotificationContent","imageHash","mediaLoader","getAvatar","badge","vibrate","notification","onclick","close","onshow","closeMessageNotifications","notifyClientReady","PATTERN_PLACEHOLDER","DEFAULT_PATTERN","getCountryCodesByIso","phoneCodeList","country","iso2","getCountryFromPhoneNumber","possibleCountries","countryCode","bestMatches","prefixes","prefix","formatPhoneNumber","pattern","numberWithoutCode","patterns","defaultPattern","stripped","getBestPattern","formatPhoneNumberWithCode","numberWithPlus","fn","shouldRunFirst","shouldRunLast","waitingTimeout","interval","isPending","_args","setInterval","clearInterval","throttleWith","fastPrimaryRaf","waiting","onIdle","requestIdleCallback","rafPromise","fastRafCallbacks","fastRafPrimaryCallbacks","beforeUnloadCallbacks","isPrimary","currentCallbacks","currentPrimaryCallbacks","onBeforeUnload","isLast","unshift","RE_NOT_LETTER","searchWords","haystack","needle","haystackWords","needleWord","haystackWord","promisifyRequest","oncomplete","onsuccess","onabort","defaultGetStoreFunc","defaultGetStore","dbName","storeName","dbp","userAgentData","indexedDB","databases","intervalId","tryIdb","onupgradeneeded","createObjectStore","txMode","db","transaction","objectStore","createStore","DC_IDS","hasStoredSession","withLegacy","userAuthJson","dcID","dcId","removeItem","sessionId","sessionJson","customStore","idb","idbKeys","items","openCursor","continue","eachCursor","isInitialized","HEX_COLOR_REGEX","lerp","start","end","interpolationRatio","colors","themeColors","property","hexToRgb","withAnimation","isDarkTheme","shouldAnimate","startIndex","endIndex","startAt","themeColorTag","querySelector","applyColorAnimationStep","transition","hex","r","g","propertyColors","formatFixedNumber","formatIntegerCompact","views","getFirstLetters","phrase","count","word","EMPTY_IMAGE_DATA_URI","initWebpWorker","wasmReady","requests","getDecodePromise","ImageData","putImageData","toBlob","createPng","webpToPngBase64","pngBlob","handleLibWebpMessage","WEBSYNC_URLS","WEBSYNC_VERSION","WEBSYNC_KEY","getTs","lastTimeout","authed","currentTs","canRedirect","ts","script","removeElement","URLSearchParams","version","saveSync","IS_LANDSCAPE","isLandscape","initialHeight","windowSize","updateSizes","isRefreshDisabled","handleResize","vh","getIsKeyboardVisible","disableRefresh","enableRefresh","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","__webpack_modules__","call","m","getter","__esModule","getPrototypeOf","obj","ns","create","def","getOwnPropertyNames","definition","o","defineProperty","enumerable","f","chunkId","promises","u","miniCssF","globalThis","Function","done","needAttach","scripts","getElementsByTagName","charset","nc","onScriptComplete","doneFns","bind","head","toStringTag","scriptUrl","importScripts","currentScript","fullhref","existingLinkTags","dataHref","existingStyleTags","findStylesheet","linkTag","errorType","realHref","createStylesheet","miniCss","baseURI","installedChunks","installedChunkData","realSrc","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","chunkLoadingGlobal","handleWorkerMessage","register","INITIAL_STATE","isLeftColumnShown","phoneCodes","general","activeChatFolder","recentEmojis","added","recent","greeting","featured","emojiKeywords","saved","inlineBots","byUsername","topPeers","topInlineBots","audioPlayer","notifications","dialogs","messageSendKeyCombo","shouldSuggestStickers","light","isBlurred","patternColor","dark","shouldShowContextMenuHint","updateCacheThrottled","updateCache","unsubscribeFromBeforeUnload","isCaching","isHeavyAnimating","setupCaching","clearCaching","reducedGlobal","reduceShowChatInfo","reduceUsers","reduceChats","reduceMessages","recentlyFoundChatIds","reduceSettings","reduceChatFolders","idsToSave","cid","chatIdsToSave","mainThread","initialState","time","timeEnd","readCache","loadCache","STORAGE_KEY","tabKey","SITE_FONTS","preloadFonts","font","fonts","load","preloadAvatars","preloadTasks","main","telegramLogoPath","authCode","monkeyPath","authPassword","background","backgroundColor","hasCustomBackground","hasCustomBackgroundColor","isRightColumnShown","setIsUiReady","isReady","markReady","useFlag","shouldRenderMask","safePreload","translation","setTranslation","getSuggestedLanguage","suggestedLanguage","MENU_HIDING_DURATION","inputRef","setFilter","filteredList","setFilteredList","updateFilter","filterValue","defaultName","getFilteredList","prevPhoneCodeList","firstElementChild","dataset","handleInput","handleInputKeyDown","DropdownMenu","handleTrigger","select","formEl","getElementById","scrollTo","top","scrollHeight","behavior","inputValue","Spinner","MenuItem","isPreloadInitiated","setAuthPhoneNumber","setAuthRememberMe","loadNearestCountry","loadCountryList","clearAuthError","goToAuthQrCode","setSettingOption","continueText","useLangString","setCountry","setPhoneNumber","isTouched","setIsTouched","lastSelection","setLastSelection","markIsLoading","unmarkIsLoading","fullNumber","canSubmit","parseFullNumber","newFullNumber","suggestedCountry","selectedCountry","handleLangChange","setSelectionRange","isJustPastedRef","handlePaste","handleCountryChange","handlePhoneNumberChange","selectionStart","selectionEnd","shouldFixSafariAutoComplete","handleKeepSessionChange","isAuthReady","onSubmit","InputText","Checkbox","Button","Loading","AuthCode","useModuleLoader","AuthPassword","AuthRegister","G","H","B","QrCreator","h","J","level","O","C","lineTo","arcTo","moveTo","z","v","N","K","P","fillStyle","fillRect","left","beginPath","q","D","E","R","I","F","fill","colorStops","createLinearGradient","apply","createRadialGradient","addColorStop","A","minVersion","maxVersion","ecLevel","radius","quiet","HTMLCanvasElement","clearRect","write","S","multiply","L","M","Q","returnToAuthPhoneNumber","qrCodeRef","token","isMobile","AuthQrCode","appInactivePath","renderMain","disconnect","isInactive","markInactive","TeactDOM"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/report.html b/dist/report.html index 30188b86..29524c9a 100644 --- a/dist/report.html +++ b/dist/report.html @@ -3,7 +3,7 @@ - telegram-t [27 Aug 2021 at 21:10] + telegram-t [3 Sep 2021 at 19:09]