mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-15 10:47:04 +01:00
2 lines
132 KiB
JavaScript
2 lines
132 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[7916],{45601:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(14050),r=n(6137),o=n(6202),i=n(21179);function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},s.apply(this,arguments)}const l=(0,a.X$)((function(e){var t;const{sticker:n,noLoad:l,forcePreview:c,lastSyncTime:d,...u}=e,m=null==n||null===(t=n.thumbnail)||void 0===t?void 0:t.dataUri,h=`sticker${null==n?void 0:n.id}`,v=(0,o.Z)(n?`${h}?size=m`:void 0,l&&!c,r.IU.BlobUrl,d),p=(0,o.Z)(h,l,void 0,d);return a.ZP.createElement(i.Z,s({tgsUrl:p,previewUrl:v,thumbDataUri:m},u))}))},21179:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(14050),r=n(46752),o=n(70692),i=n(58912);const s="gp5OwinzPeHwkesmaEIR";var l=n(60706),c=n(80036);function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},d.apply(this,arguments)}const u=(0,a.X$)((function(e){const{previewUrl:t,thumbDataUri:n,className:u,...m}=e,h=(0,o.Z)(t),[v,p]=(0,l.Z)(!1),{size:f}=e;return a.ZP.createElement("div",{className:(0,r.Z)(u,"oGmd77AsTbJeJk8CV6gl"),style:(0,c.Z)(void 0!==f&&`width: ${f}px; height: ${f}px;`)},!v&&n&&a.ZP.createElement("img",{src:n,className:(0,r.Z)(s)}),!v&&a.ZP.createElement("img",{src:t,className:(0,r.Z)(s,h)}),a.ZP.createElement(i.Z,d({},m,{onLoad:p,noTransition:!0})))}))},54752:(e,t,n)=>{n.d(t,{ZP:()=>L});var a=n(14050),r=n(33555),o=n(6137),i=n(91713),s=n(77361),l=n(790),c=n(83158);function d(e,t,n,a){let{peak:r,fillStyle:o,progressFillStyle:i}=a;const s=4*t.length;e.width=2*s,e.height=46,e.style.width=`${s}px`,e.style.height="23px";const l=e.getContext("2d");l.scale(2,2),t.forEach(((e,a)=>{l.globalAlpha=a/t.length>=n?.5:1,l.fillStyle=n>a/t.length?i:o;const s=Math.max(2,e/Math.max(1,r)*23);!function(e,t,n,a,r,o){2<2*o&&(o=1),r<2*o&&(o=r/2),e.beginPath(),e.moveTo(t+o,n),e.arcTo(t+2,n,t+2,n-r,o),e.arcTo(t+2,n-r,t,n-r,o),e.arcTo(t,n-r,t,n,o),e.arcTo(t,n,t+2,n,o),e.closePath()}(l,4*a,(23+s)/2,0,s,1),l.fill()}))}var u=n(46752),m=n(32340),h=n(15376);function v(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const a=Array(n),r=e;for(let e=0,t=n-1;e!==t;++e){const t=Math.floor(5*e/8),n=Math.floor(5*e%8),o=r[t]+(r[t+1]<<8);a[e]=o>>n&31}const o=Math.floor(5*(n-1)/8),i=Math.floor(5*(n-1)%8),s=r[o]+(r[o+1]<<8);return a[n-1]=s>>i&31,a}function p(e,t){let n=0;const a=new Array(t),r=e.length/t,o=e[0],i=e[e.length-1];for(let d=0;d<t;d++){var s,l,c;const t=Math.floor(d*r),u=((null!==(s=e[t-1])&&void 0!==s?s:o)+(null!==(l=e[t])&&void 0!==l?l:o)+(null!==(c=e[t+1])&&void 0!==c?c:i))/3;a[d]=u,n<u&&(n=u)}return{data:a,peak:n}}var f=n(92566),g=n(31212),Z=n(12019),P=n(23186),E=n(59107),y=n(64963),C=n(6202),b=n(10396),w=n(50711),N=n(231),k=n(39196),I=n(88033);const S=window.matchMedia("(max-width: 375px)"),M=window.matchMedia("(max-width: 410px)");function T(e){return{MIN_SPIKES:s.wB?S.matches?16:20:25,MAX_SPIKES:s.wB?S.matches?35:e&&M.matches?40:45:75}}function x(e,t,n){return a.ZP.createElement("div",{className:"seekline no-selection",ref:n},t.map((e=>{let{start:t,end:n}=e;return a.ZP.createElement("div",{className:"seekline-buffered-progress",style:`left: ${100*t}%; right: ${100-100*n}%`})})),a.ZP.createElement("span",{className:"seekline-play-progress"},a.ZP.createElement("i",{style:`transform: translateX(${100*e}%)`})),a.ZP.createElement("span",{className:"seekline-thumb"},a.ZP.createElement("i",{style:`transform: translateX(${100*e}%)`})))}const L=(0,a.X$)((e=>{let{theme:t,message:n,senderTitle:S,uploadProgress:M,origin:L,date:$,lastSyncTime:D,noAvatars:O,className:A,isSelectable:F,isSelected:R,isDownloading:U,isTranscribing:B,isTranscriptionHidden:X,isTranscribed:Y,isTranscriptionError:_,canDownload:V,canTranscribe:K,onHideTranscription:j,onPlay:z,onReadMedia:H,onCancelUpload:W,onDateClick:J}=e;const{cancelMessageMediaDownload:q,downloadMessageMedia:G,transcribeAudio:Q}=(0,r.Sv)(),{content:{audio:ee,voice:te,video:ne},isMediaUnread:ae}=n,re=Boolean(te||ne),oe=(0,a.sO)(!1),ie=(0,a.sO)(null),se=(0,E.Z)(),{isRtl:le}=se,[ce,de]=(0,a.eJ)(!1),ue=D,me=(0,c.Ti)(n,"pictogram"),he=(0,C.Z)(me,!1,o.IU.BlobUrl),ve=(0,C.Z)((0,c.Ti)(n,"inline"),!ue,(0,c.kG)(n,"inline")),{loadProgress:pe}=(0,f.Z)((0,c.Ti)(n,"download"),!U,(0,c.kG)(n,"download")),fe=(0,a.I4)((()=>{de(!0),z(n.id,n.chatId)}),[n,z]),ge=(0,a.I4)((()=>{de(!1)}),[]),{isBuffered:Ze,bufferedRanges:Pe,bufferingHandlers:Ee,checkBuffering:ye}=(0,Z.Z)(),{isPlaying:Ce,playProgress:be,playPause:we,setCurrentTime:Ne,duration:ke}=(0,P.Z)((0,b.An)(n),(0,c.XV)(n),re?"voice":"audio",ve,Ee,void 0,ye,ce,fe,ge,(0,c.CI)(n)),Ie=(0,c.B4)(n),Se=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const i=(0,a.sO)(null),{data:s,peak:l}=(0,a.Ye)((()=>{if(!t)return;const{waveform:e,duration:n}=t;if(!e)return{data:new Array(Math.min(n,30)).fill(0),peak:0};const{MIN_SPIKES:a,MAX_SPIKES:r}=T(o),i=Math.min(n/10,1),s=Math.round(a+(r-a)*i);return p(v(new Uint8Array(e)),s)}),[t,o])||{};return(0,a.bt)((()=>{const t=i.current;t&&s&&void 0!==l&&d(t,s,n,{peak:l,fillStyle:r?"dark"===e?"#B7ABED":"#AEDFA4":"dark"===e?"#494A78":"#ADD3F7",progressFillStyle:r?"dark"===e?"#FFFFFF":"#4FAE4E":"dark"===e?"#8774E1":"#3390EC"})}),[r,l,n,s,e]),i}(t,te,ae&&!Ie?1:be,Ie,!O),Me=Ce||be>0&&be<1;(0,a.d4)((()=>{de(Ce)}),[Ce]);const Te=ce&&!Ze,{isUploading:xe,isTransferring:Le,transferProgress:$e}=(0,c.Sc)(n,M||pe,Te||U),{shouldRender:De,transitionClassNames:Oe}=(0,g.Z)(Le),Ae=De&&(Te||xe),Fe=(0,a.I4)((()=>{xe?null==W||W():(Ce||z(n.id,n.chatId),(0,r.Sv)().setAudioPlayerOrigin({origin:L}),de(!ce),we())}),[xe,Ce,ce,we,W,z,n.id,n.chatId,L]);(0,a.d4)((()=>{H&&ae&&(Ce||U)&&H()}),[Ce,ae,H,U]);const Re=(0,a.I4)((()=>{U?q({message:n}):G({message:n})}),[q,G,U,n]),Ue=(0,a.I4)((e=>{if(oe.current&&ie.current){const{width:t,left:n}=ie.current.getBoundingClientRect(),a=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),Ne(Math.max(Math.min(ke*((a-n)/t),ke-.1),.001))}}),[ke,Ne]),Be=(0,a.I4)((e=>{e instanceof MouseEvent&&2===e.button||(oe.current=!0,Ue(e))}),[Ue]),Xe=(0,a.I4)((()=>{oe.current=!1}),[]),Ye=(0,a.I4)((()=>{J(n.id,n.chatId)}),[J,n.id,n.chatId]),_e=(0,a.I4)((()=>{Q({chatId:n.chatId,messageId:n.id})}),[n.chatId,n.id,Q]);(0,a.d4)((()=>{if(ie.current&&Me)return(0,y.sf)(ie.current,{onCapture:Be,onRelease:Xe,onClick:Xe,onDrag:Ue})}),[Me,Be,Ue,Xe]);const Ve=(0,a.Ye)((()=>a.ZP.createElement("div",{dangerouslySetInnerHTML:{__html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 24" class="loading-svg"><rect class="loading-rect" fill="transparent" width="32" height="24" stroke-width="3" stroke-linejoin="round" rx="6" ry="6" stroke="var(--accent-color)" stroke-dashoffset="1" stroke-dasharray="32,68"></rect></svg>'}})),[]);function Ke(){if(re)return S||"Voice";const{title:e,fileName:t}=ee;return e||t}const je=(0,u.Z)("Audio",A,Ie&&L===i.Cr.Inline&&"own",(L===i.Cr.Search||L===i.Cr.SharedMedia)&&"bigger",R&&"audio-is-selected"),ze=["toggle-play"];Ae?ze.push("loading"):ze.push(Ce?"pause":"play");const He=(0,u.Z)("content",Me&&"with-seekline");function We(){return a.ZP.createElement("div",{className:He},a.ZP.createElement("div",{className:"content-row"},a.ZP.createElement("p",{className:"title",dir:"auto",title:Ke()},(0,m.Z)(Ke())),a.ZP.createElement("div",{className:"message-date"},$&&a.ZP.createElement(I.Z,{className:"date",onClick:Ye},(0,l.VX)(se,1e3*$)))),Me&&a.ZP.createElement("div",{className:"meta search-result",dir:le?"rtl":void 0},a.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},be<1&&`${(0,l.k9)(ke*be,ke)}`),x(be,Pe,ie)),!Me&&function(){if(re)return a.ZP.createElement("div",{className:"meta",dir:le?"rtl":void 0},(0,l.k9)((te||ne).duration));const{performer:e}=ee;return a.ZP.createElement("div",{className:"meta",dir:le?"rtl":void 0},(0,l.k9)(ke),a.ZP.createElement("span",{className:"bullet"},"•"),e&&a.ZP.createElement("span",{className:"performer",title:e},(0,m.Z)(e)),e&&S&&a.ZP.createElement("span",{className:"bullet"},"•"),S&&a.ZP.createElement("span",{title:S},(0,m.Z)(S)))}())}return a.ZP.createElement("div",{className:je,dir:se.isRtl?"rtl":"ltr"},F&&a.ZP.createElement("div",{className:"message-select-control"},R&&a.ZP.createElement("i",{className:"icon-select"})),a.ZP.createElement(N.Z,{round:!0,ripple:!s.wB,size:"smaller",color:he?"translucent-white":"primary",className:ze.join(" "),ariaLabel:Ce?"Pause audio":"Play audio",onClick:Fe,isRtl:se.isRtl,backgroundImage:he},a.ZP.createElement("i",{className:"icon-play"}),a.ZP.createElement("i",{className:"icon-pause"})),De&&a.ZP.createElement("div",{className:(0,u.Z)("media-loading",Oe,Ae&&"interactive")},a.ZP.createElement(k.Z,{progress:$e,transparent:!0,size:"m",onClick:Ae?Fe:void 0,noCross:!Ae})),ee&&V&&!xe&&a.ZP.createElement(N.Z,{round:!0,size:"tiny",className:"download-button",ariaLabel:U?"Cancel download":"Download",onClick:Re},a.ZP.createElement("i",{className:U?"icon-close":"icon-arrow-down"})),L===i.Cr.Search&&We(),L!==i.Cr.Search&&ee&&function(e,t,n,r,o,i,s,c,d,u,v){const{title:p,performer:f,fileName:g}=t,Z=r||o>0&&o<1,{isRtl:P}=w.i0;return a.ZP.createElement("div",{className:"content"},a.ZP.createElement("p",{className:"title",dir:"auto",title:p},(0,m.Z)(p||g)),Z&&a.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},a.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},(0,l.k9)(n*o,n)),x(o,i,s)),!Z&&c&&a.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},u?`${(0,h.yW)(t.size*u)} / `:void 0,(0,h.yW)(t.size)),!Z&&!c&&a.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},a.ZP.createElement("span",{className:"duration",dir:"auto"},(0,l.k9)(n)),f&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"},"•"),a.ZP.createElement("span",{className:"performer",dir:"auto",title:f},(0,m.Z)(f))),d&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"},"•"),a.ZP.createElement(I.Z,{className:"date",onClick:v},(0,l.ZK)(e,1e3*d,!0)))))}(se,ee,ke,Ce,be,Pe,ie,U||xe,$,$e,J?Ye:void 0),L===i.Cr.SharedMedia&&(te||ne)&&We(),L===i.Cr.Inline&&te&&function(e,t,n,r,o,i,s,c,d,m,h,v){return a.ZP.createElement("div",{className:"content"},a.ZP.createElement("div",{className:"waveform-wrapper"},a.ZP.createElement("div",{className:"waveform",draggable:!1,ref:t},a.ZP.createElement("canvas",{ref:n})),h&&a.ZP.createElement(N.Z,{onClick:()=>{(c||d)&&v?v(!s):i||h()}},a.ZP.createElement("i",{className:(0,u.Z)("transcribe-icon",c||d?"icon-down":"icon-transcribe",(c||d)&&!s&&"transcribe-shown")}),i&&m)),a.ZP.createElement("p",{className:(0,u.Z)("voice-duration",o&&"unread"),dir:"auto"},0===r?(0,l.k9)(e.duration):(0,l.k9)(e.duration*r)))}(te,ie,Se,be,ae,B,X,Y,_,Ve,K?_e:void 0,j))}))},70180:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(14050),r=n(33555),o=n(11192),i=n(83158),s=n(32340),l=n(64319),c=n(6272),d=n(59107),u=n(31876),m=n(83321);const h=(0,a.X$)((0,r.c$)(((e,t)=>{let{chatOrUserId:n}=t;const{lastSyncTime:a,countryList:{phoneCodes:r}}=e,s=n?(0,o.Z1)(e,n):void 0,l=(0,i.YC)(n)?(0,o.dy)(e,n):void 0,c=s&&(0,i.i4)(s,(0,o.dZ)(e),(0,o.NJ)(e));return{lastSyncTime:a,phoneCodeList:r,chat:s,user:l,canInviteUsers:s&&!l&&(!(0,i.eA)(s)&&!(0,i.Mg)(s,"inviteUsers")||(0,i.VE)(s,"inviteUsers")),isMuted:c}}))((e=>{let{lastSyncTime:t,user:n,chat:o,forceShowSelf:h,canInviteUsers:v,isMuted:p,phoneCodeList:f}=e;const{loadFullUser:g,showNotification:Z,updateChatMutedState:P}=(0,r.Sv)(),{id:E,fullInfo:y,username:C,phoneNumber:b,isSelf:w}=n||{},{id:N}=o||{},k=(0,d.Z)();(0,a.d4)((()=>{t&&E&&g({userId:E})}),[g,E,t]);const I=(0,a.I4)((()=>{P({chatId:N,isMuted:!p})}),[N,p,P]);if(!o||o.isRestricted||w&&!h)return;function S(e,t){(0,l.TE)(e),Z({message:`${t} was copied`})}const M=b&&(0,c.WZ)(f,b),T=(0,i.hu)(o),x=(null==y?void 0:y.bio)||(0,i.GM)(o);return a.ZP.createElement("div",{className:"ChatExtra"},M&&Boolean(M.length)&&a.ZP.createElement(u.Z,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:()=>S(M,k("Phone"))},a.ZP.createElement("span",{className:"title",dir:"auto"},M),a.ZP.createElement("span",{className:"subtitle"},k("Phone"))),C&&a.ZP.createElement(u.Z,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>S(`@${C}`,k("Username"))},a.ZP.createElement("span",{className:"title",dir:"auto"},(0,s.Z)(C)),a.ZP.createElement("span",{className:"subtitle"},k("Username"))),x&&Boolean(x.length)&&a.ZP.createElement(u.Z,{icon:"info",multiline:!0,narrow:!0,isStatic:!0},a.ZP.createElement("span",{className:"title word-break",dir:"auto"},(0,s.Z)(x,["br","links","emoji"])),a.ZP.createElement("span",{className:"subtitle"},k(E?"UserBio":"Info"))),(v||!C)&&T&&a.ZP.createElement(u.Z,{icon:o.username?"mention":"link",multiline:!0,narrow:!0,ripple:!0,onClick:()=>S(T,k("SetUrlPlaceholder"))},a.ZP.createElement("div",{className:"title"},T),a.ZP.createElement("span",{className:"subtitle"},k("SetUrlPlaceholder"))),!h&&a.ZP.createElement(u.Z,{icon:"unmute",ripple:!0,onClick:I},a.ZP.createElement("span",null,k("Notifications")),a.ZP.createElement(m.Z,{id:"group-notifications",label:E?"Toggle User Notifications":"Toggle Chat Notifications",checked:!p,inactive:!0})))})))},40329:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(14050),r=n(33555),o=n(11192),i=n(83158),s=n(59107),l=n(32340),c=n(70172),d=n(13103),u=n(231);const m=(0,a.X$)((0,r.c$)(((e,t)=>{let{chat:n}=t;const a=(0,i.YC)(n.id),r=(0,o.FM)(e,n.id),s=a&&(0,o.dy)(e,(0,i.zX)(n)),l=s&&(0,i.cS)(s)&&!n.isSupport,c=a&&!r&&!l,d=a?(0,i.Vl)((0,o.dy)(e,(0,i.zX)(n))):void 0;return{isPrivateChat:a,isChatWithSelf:r,isBot:l,isChannel:(0,i.eA)(n),isBasicGroup:(0,i.G9)(n),isSuperGroup:(0,i.ZV)(n),currentUserId:e.currentUserId,canDeleteForAll:c,contactName:d}}))((e=>{let{isOpen:t,chat:n,isChannel:o,isPrivateChat:m,isChatWithSelf:h,isBot:v,isBasicGroup:p,isSuperGroup:f,currentUserId:g,canDeleteForAll:Z,contactName:P,onClose:E,onCloseAnimationEnd:y}=e;const{leaveChannel:C,deleteHistory:b,deleteChannel:w,deleteChatUser:N,blockContact:k}=(0,r.Sv)(),I=(0,s.Z)(),S=(0,i.U)(I,n),M=(0,a.I4)((()=>{b({chatId:n.id,shouldDeleteForAll:!0}),E()}),[b,n.id,E]),T=(0,a.I4)((()=>{b({chatId:n.id,shouldDeleteForAll:!0}),k({contactId:n.id,accessHash:n.accessHash}),E()}),[b,n.id,n.accessHash,k,E]),x=(0,a.I4)((()=>{m?b({chatId:n.id,shouldDeleteForAll:!1}):p?(N({chatId:n.id,userId:g}),b({chatId:n.id,shouldDeleteForAll:!1})):!o&&!f||n.isCreator?(o||f)&&n.isCreator&&w({chatId:n.id}):C({chatId:n.id}),E()}),[m,p,o,f,g,n.isCreator,n.id,E,b,N,C,w]),L=(0,a.I4)((()=>{o||f?(C({chatId:n.id}),E()):x()}),[n.id,x,o,f,C,E]);return a.ZP.createElement(d.Z,{isOpen:t,className:"DeleteChatModal",header:a.ZP.createElement("div",{className:"modal-header",dir:I.isRtl?"rtl":void 0},a.ZP.createElement(c.Z,{size:"tiny",chat:n,isSavedMessages:h}),a.ZP.createElement("h3",{className:"modal-title"},I(o&&!n.isCreator?"LeaveChannel":o&&n.isCreator?"ChannelDelete":p||f?"Group.LeaveGroup":"DeleteChatUser"))),onClose:E,onCloseAnimationEnd:y},o&&n.isCreator?a.ZP.createElement("p",null,(0,l.Z)(I("ChatList.DeleteAndLeaveGroupConfirmation",S),["simple_markdown"])):o&&!n.isCreator||p||f?a.ZP.createElement("p",null,(0,l.Z)(I("ChannelLeaveAlertWithName",S),["simple_markdown"])):a.ZP.createElement("p",null,(0,l.Z)(I("ChatList.DeleteChatConfirmation",P),["simple_markdown"])),v&&a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:T},I("DeleteAndStop")),Z&&a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:M},P?(0,l.Z)(I("ChatList.DeleteForEveryone",P)):I("DeleteForAll")),!m&&n.isCreator&&a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:x},I("DeleteForAll")),a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:m?x:L},I(o&&!n.isCreator?"LeaveChannel":o&&n.isCreator?"Chat.Input.Delete":p||f?"Group.LeaveGroup":Z?"ChatList.DeleteForCurrentUser":"Delete")),a.ZP.createElement(u.Z,{className:"confirm-dialog-button",isText:!0,onClick:E},I("Cancel")))})))},82535:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(14050),r=n(33555),o=n(15376),i=n(83158),s=n(3657),l=n(92566),c=n(6202),d=n(60706),u=n(47002);const m=(0,a.X$)((e=>{let{message:t,observeIntersection:n,smaller:m,canAutoLoad:h,autoLoadFileMaxSizeMb:v,uploadProgress:p,withDate:f,datetime:g,className:Z,sender:P,isSelected:E,isSelectable:y,onCancelUpload:C,onMediaClick:b,onDateClick:w,isDownloading:N}=e;const k=(0,r.Sv)(),I=(0,a.sO)(null),S=t.content.document,{fileName:M,size:T,timestamp:x}=S,L=(0,o.K2)(S)||"",$=(0,s.Op)(I,n),[D,O]=(0,d.Z)();(0,a.d4)((()=>{$&&O()}),[$,O]);const[A,F]=(0,a.eJ)(h&&(!v||T<=1048576*v)),R=Boolean(N||A&&D),U=(0,i.Ti)(t,"download"),{loadProgress:B,mediaData:X}=(0,l.Z)(U,!R,(0,i.kG)(t,"download"),void 0,void 0,!0),Y=Boolean(X),{isUploading:_,isTransferring:V,transferProgress:K}=(0,i.Sc)(t,p||B,R&&!Y),j=(0,o.v6)(S),z=j?(0,i.DH)(t):void 0,H=j?S.previewBlobUrl:void 0,W=(0,c.Z)((0,i.Ti)(t,"pictogram"),!$),J=b&&Boolean(S.mediaType),q=(0,a.I4)((()=>{_?C&&C():N?k.cancelMessageMediaDownload({message:t}):V?F(!1):J?b():k.downloadMessageMedia({message:t})}),[_,N,V,J,C,k,t,b]),G=(0,a.I4)((()=>{w(t.id,t.chatId)}),[w,t.id,t.chatId]);return a.ZP.createElement(u.Z,{ref:I,name:M,extension:L,size:T,timestamp:f?g||x:void 0,thumbnailDataUri:z,previewData:H||W,smaller:m,isTransferring:V,isUploading:_,transferProgress:K,className:Z,sender:P,isSelectable:y,isSelected:E,actionIcon:J?(0,i.hC)(t)?"icon-play":"icon-eye":"icon-download",onClick:q,onDateClick:w?G:void 0})}))},78780:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(59107),o=n(46752);const i=e=>{let{content:t,className:n}=e;const i=(0,r.Z)();return a.ZP.createElement("span",{className:(0,o.Z)("DotAnimation",n),dir:i.isRtl?"rtl":"auto"},t,a.ZP.createElement("span",{className:"ellipsis"}))}},50685:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(14050),r=n(59107);const o=(0,a.X$)((e=>{let{fakeType:t}=e;const n=(0,r.Z)();return a.ZP.createElement("span",{className:"FakeIcon"},n("fake"===t?"FakeMessage":"ScamMessage"))}))},47002:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(14050),r=n(31212),o=n(70692),i=n(46752),s=n(790),l=n(15376),c=n(74399),d=n(32340),u=n(59107),m=n(39196),h=n(88033);const v=(0,a.X$)((e=>{let{ref:t,name:n,size:v,extension:p="",timestamp:f,sender:g,thumbnailDataUri:Z,previewData:P,className:E,smaller:y,isTransferring:C,isUploading:b,isSelectable:w,isSelected:N,transferProgress:k,actionIcon:I,onClick:S,onDateClick:M}=e;const T=(0,u.Z)();let x=(0,a.sO)(null);t&&(x=t);const L=(0,o.Z)(P),{shouldRender:$,transitionClassNames:D}=(0,r.Z)(C,void 0,!0),O=(0,l.Oh)(p),A=(0,l.yW)(v),{width:F,height:R}=(0,c.lE)(y),U=(0,i.Z)("File",E,y&&"smaller",S&&!b&&"interactive",N&&"file-is-selected");return a.ZP.createElement("div",{ref:x,className:U,dir:T.isRtl?"rtl":void 0},w&&a.ZP.createElement("div",{className:"message-select-control"},N&&a.ZP.createElement("i",{className:"icon-select"})),a.ZP.createElement("div",{className:"file-icon-container",onClick:b?void 0:S},Z||P?a.ZP.createElement("div",{className:"file-preview media-inner"},a.ZP.createElement("img",{src:Z,width:F,height:R,className:"thumbnail",alt:""}),a.ZP.createElement("img",{src:P,className:(0,i.Z)("full-media",L),width:F,height:R,alt:""})):a.ZP.createElement("div",{className:`file-icon ${O}`},p.length<=4&&a.ZP.createElement("span",{className:"file-ext",dir:"auto"},p)),$&&a.ZP.createElement("div",{className:(0,i.Z)("file-progress",O,D)},a.ZP.createElement(m.Z,{progress:k,size:y?"s":"m",onClick:b?S:void 0})),S&&a.ZP.createElement("i",{className:(0,i.Z)("action-icon",I||"icon-download",$&&"hidden")})),a.ZP.createElement("div",{className:"file-info"},a.ZP.createElement("div",{className:"file-title",dir:"auto"},(0,d.Z)(n)),a.ZP.createElement("div",{className:"file-subtitle",dir:"auto"},a.ZP.createElement("span",null,C&&k?`${Math.round(100*k)}%`:A),g&&a.ZP.createElement("span",{className:"file-sender"},(0,d.Z)(g)),!g&&f&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"}),a.ZP.createElement(h.Z,{onClick:M},(0,s.ZK)(T,1e3*f,!0))))),g&&f&&a.ZP.createElement(h.Z,{onClick:M},(0,s.VX)(T,1e3*f)))}))},98799:(e,t,n)=>{n.d(t,{Z:()=>p});var a=n(14050),r=n(33555),o=n(91713),i=n(83158),s=n(11192),l=n(32340),c=n(59107),d=n(70172),u=n(89411),m=n(68729),h=n(78780),v=n(50685);const p=(0,a.X$)((0,r.c$)(((e,t)=>{let{chatId:n}=t;const{lastSyncTime:a}=e,r=(0,s.Z1)(e,n);return{lastSyncTime:a,chat:r,onlineCount:r?(0,s.YK)(e,r):void 0,areMessagesLoaded:Boolean((0,s.Zw)(e,n))}}))((e=>{let{typingStatus:t,avatarSize:n="medium",status:s,withDots:p,withMediaViewer:f,withUsername:g,withFullInfo:Z,withUpdatingStatus:P,withChatType:E,withVideoAvatar:y,noRtl:C,chat:b,onlineCount:w,areMessagesLoaded:N,lastSyncTime:k}=e;const{loadFullChat:I,openMediaViewer:S,loadProfilePhotos:M}=(0,r.Sv)(),T=b&&(0,i.ZV)(b),{id:x,isMin:L,isRestricted:$}=b||{};(0,a.d4)((()=>{x&&!L&&k&&(Z&&I({chatId:x}),f&&M({profileId:x}))}),[x,L,k,Z,I,M,T,f]);const D=(0,a.I4)(((e,t)=>{b&&t&&(e.stopPropagation(),S({avatarOwnerId:b.id,mediaId:0,origin:"jumbo"===n?o.bZ.ProfileAvatar:o.bZ.MiddleHeaderAvatar}))}),[b,n,S]),O=(0,c.Z)();if(b)return a.ZP.createElement("div",{className:"ChatInfo",dir:!C&&O.isRtl?"rtl":void 0},a.ZP.createElement(d.Z,{key:b.id,size:n,chat:b,onClick:f?D:void 0,noVideo:!y}),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},(0,l.Z)((0,i.U)(O,b))),b.isVerified&&a.ZP.createElement(u.Z,null),b.fakeType&&a.ZP.createElement(v.Z,{fakeType:b.fakeType})),function(){if(s)return p?a.ZP.createElement(h.Z,{className:"status",content:s}):a.ZP.createElement("span",{className:"status",dir:"auto"},s);if(P&&!N&&!$)return a.ZP.createElement(h.Z,{className:"status",content:O("Updating")});if(!b)return;if(t)return a.ZP.createElement(m.Z,{typingStatus:t});if(E)return a.ZP.createElement("span",{className:"status",dir:"auto"},O((0,i.l6)(b)));const e=g?b.username:void 0,n=function(e,t){const n=e((0,i.l6)(t)),{membersCount:a}=t;return t.isRestricted?"Channel"===n?"channel is inaccessible":"group is inaccessible":a?e("Channel"===n?"Subscribers":"Members",a,"i"):n}(O,b),r=w?`, ${O("OnlineCount",w,"i")}`:void 0;return a.ZP.createElement("span",{className:"status"},e&&a.ZP.createElement("span",{className:"handle"},e),a.ZP.createElement("span",{className:"group-status"},n),r&&a.ZP.createElement("span",{className:"online-status"},r))}()))})))},76844:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(14050),r=n(790),o=n(59107),i=n(8018);const s=(0,a.X$)((e=>{let{message:t,outgoingStatus:n}=e;const s=(0,o.Z)();return a.ZP.createElement("div",{className:"LastMessageMeta"},n&&a.ZP.createElement(i.Z,{status:n}),a.ZP.createElement("span",{className:"time"},(0,r.VX)(s,1e3*t.date)))}))},13709:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(14050),r=n(790),o=n(3858),i=n(83158),s=n(46752),l=n(6202),c=n(70692),d=n(3657);const u=(0,a.X$)((e=>{let{message:t,idPrefix:n="shared-media",isProtected:u,observeIntersection:m,onClick:h}=e;const v=(0,a.sO)(null),p=(0,d.Op)(v,m),f=(0,i.DH)(t),g=(0,l.Z)((0,i.Ti)(t,"pictogram"),!p),Z=(0,c.Z)(g),P=(0,i.b7)(t),E=(0,a.I4)((()=>{h(t.id,t.chatId)}),[t.id,t.chatId,h]);return a.ZP.createElement("div",{ref:v,id:`${n}${(0,i.d0)(t.id)}`,className:"Media scroll-item",onClick:h?E:void 0},a.ZP.createElement("img",{src:f,alt:"",draggable:!u,decoding:"async",onContextMenu:u?o.Z:void 0}),a.ZP.createElement("img",{src:g,className:(0,s.Z)("full-media",Z),alt:"",draggable:!u,decoding:"async",onContextMenu:u?o.Z:void 0}),P&&a.ZP.createElement("span",{className:"video-duration"},P.isGif?"GIF":(0,r.k9)(P.duration)),u&&a.ZP.createElement("span",{className:"protector"}))}))},8018:(e,t,n)=>{n.d(t,{Z:()=>i});var a,r=n(14050),o=n(2255);!function(e){e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read"}(a||(a={}));const i=(0,r.X$)((e=>{let{status:t}=e;return r.ZP.createElement("div",{className:"MessageOutgoingStatus"},r.ZP.createElement(o.Z,{name:"reveal",activeKey:a[t]},r.ZP.createElement("i",{className:`icon-message-${t}`})))}))},47262:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(14050),r=n(46752),o=n(31212),i=n(32340),s=n(59107);const l="Nothing found.",c=(0,a.X$)((e=>{let{text:t=l,description:n}=e;const c=(0,s.Z)(),{transitionClassNames:d}=(0,o.Z)(!0);return a.ZP.createElement("div",{className:(0,r.Z)("NothingFound",d,n&&"with-description")},t,n&&a.ZP.createElement("p",{className:"description"},(0,i.Z)(c(n),["br"])))}))},99364:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(14050),r=n(83716),o=n(77361),i=n(46752),s=n(59107),l=n(28183),c=n(231);const d=o.wB?550:400,u=(0,a.X$)((e=>{let{isLoading:t=!1,isPasswordVisible:n,error:u,hint:m,placeholder:h="Password",submitLabel:v="Next",shouldShowSubmit:p,shouldResetValue:f,shouldDisablePasswordManager:g=!1,noRipple:Z=!1,clearError:P,onChangePasswordVisibility:E,onInputChange:y,onSubmit:C}=e;const b=(0,a.sO)(null),w=(0,s.Z)(),[N,k]=(0,a.eJ)(""),[I,S]=(0,a.eJ)(!1);return(0,a.d4)((()=>{f&&k("")}),[f]),(0,l.Z)((()=>{o.$b||b.current.focus()}),d),(0,a.d4)((()=>{u&&requestAnimationFrame((()=>{b.current.focus(),b.current.select()}))}),[u]),a.ZP.createElement("form",{action:"",onSubmit:function(e){e.preventDefault(),t||I&&C(N)},autoComplete:"off"},a.ZP.createElement("div",{className:(0,i.Z)("input-group password-input",N&&"touched",u&&"error"),dir:w.isRtl?"rtl":void 0},g&&a.ZP.createElement("input",{type:"password",id:"prevent_autofill",autoComplete:"off",className:"visually-hidden",tabIndex:-2}),a.ZP.createElement("input",{ref:b,className:"form-control",type:n?"text":"password",id:"sign-in-password",value:N||"",autoComplete:g?"one-time-code":"current-password",onChange:function(e){u&&P();const{target:t}=e;k(t.value),S(t.value.length>=r.lo),y&&y(t.value)},maxLength:256,dir:"auto"}),a.ZP.createElement("label",null,u||m||h),a.ZP.createElement("div",{className:"toggle-password",onClick:function(){E(!n)},role:"button",tabIndex:0,title:"Toggle password visibility"},a.ZP.createElement("i",{className:n?"icon-eye":"icon-eye-closed"}))),(I||p)&&a.ZP.createElement(c.Z,{type:"submit",ripple:!Z,isLoading:t,disabled:!I},v))}))},11820:(e,t,n)=>{n.d(t,{Z:()=>p});var a=n(14050),r=n(83158),o=n(21273),i=n(14605),s=n(97687),l=n(31876),c=n(6058),d=n(98799),u=n(49187),m=n(27407),h=n(59107),v=n(34288);const p=(0,a.X$)((e=>{let{itemIds:t,selectedIds:n,filterValue:p,filterPlaceholder:f,notFoundText:g,searchInputId:Z,isLoading:P,noScrollRestore:E,onSelectedIdsChange:y,onFilterChange:C,onLoadMore:b}=e;const w=(0,a.sO)(null),N=n.length>10;(0,a.d4)((()=>{setTimeout((()=>{requestAnimationFrame((()=>{w.current.focus()}))}),500)}),[]);const k=(0,a.I4)((e=>{const t=[...n];t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),y(t),C("")}),[n,y,C]),I=(0,a.I4)((e=>{const{value:t}=e.currentTarget;C(t)}),[C]),[S,M]=(0,m.Z)(b,t,Boolean(p)),T=(0,h.Z)();return a.ZP.createElement("div",{className:"Picker"},a.ZP.createElement("div",{className:"picker-header custom-scroll",dir:T.isRtl?"rtl":void 0},n.map(((e,t)=>a.ZP.createElement(u.Z,{chatOrUserId:e,isMinimized:N&&t<n.length-5,canClose:!0,onClick:k,clickArg:e}))),a.ZP.createElement(s.Z,{id:Z,ref:w,value:p,onChange:I,placeholder:f||T("SelectChat")})),null!=S&&S.length?a.ZP.createElement(o.Z,{className:"picker-list custom-scroll",items:S,onLoadMore:M,noScrollRestore:E},S.map((e=>a.ZP.createElement(l.Z,{key:e,className:"chat-item-clickable picker-list-item",onClick:()=>k(e),ripple:!0},a.ZP.createElement(i.Z,{label:"",checked:n.includes(e)}),(0,r.YC)(e)?a.ZP.createElement(c.Z,{userId:e}):a.ZP.createElement(d.Z,{chatId:e}))))):P||!S||S.length?a.ZP.createElement(v.Z,null):a.ZP.createElement("p",{className:"no-results"},g||"Sorry, nothing found."))}))},49187:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(14050),r=n(33555),o=n(11192),i=n(83158),s=n(32340),l=n(46752),c=n(59107),d=n(70172);const u=(0,a.X$)((0,r.c$)(((e,t)=>{let{chatOrUserId:n}=t;return n?{chat:n?(0,o.Z1)(e,n):void 0,user:(0,i.YC)(n)?(0,o.dy)(e,n):void 0}:{}}))((e=>{let{icon:t,title:n,isMinimized:r,canClose:o,onClick:u,clickArg:m,chat:h,user:v,className:p}=e;const f=(0,c.Z)();let g,Z;if(t&&n)g=a.ZP.createElement("div",{className:"item-icon"},a.ZP.createElement("i",{className:`icon-${t}`})),Z=n;else if(h||v){g=a.ZP.createElement(d.Z,{chat:h,user:v,size:"small",isSavedMessages:null==v?void 0:v.isSelf,noVideo:!0});const e=!h||v&&!v.isSelf?(0,i.Vl)(v):(0,i.U)(f,h,v);Z=e?(0,s.Z)(e):void 0}const P=(0,l.Z)("PickerSelectedItem",p,r&&"minimized",o&&"closeable");return a.ZP.createElement("div",{className:P,onClick:()=>u(m),title:r?Z:void 0,dir:f.isRtl?"rtl":void 0},g,!r&&a.ZP.createElement("div",{className:"item-name",dir:"auto"},Z),o&&a.ZP.createElement("div",{className:"item-remove"},a.ZP.createElement("i",{className:"icon-close"})))})))},4863:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(14050),r=n(26926),o=n(46752);const i={__html:'<svg width="14" height="15" viewBox="0 0 14 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6.63869 12.1902L3.50621 14.1092C3.18049 14.3087 2.75468 14.2064 2.55515 13.8807C2.45769 13.7216 2.42864 13.5299 2.47457 13.3491L2.95948 11.4405C3.13452 10.7515 3.60599 10.1756 4.24682 9.86791L7.6642 8.22716C7.82352 8.15067 7.89067 7.95951 7.81418 7.80019C7.75223 7.67116 7.61214 7.59896 7.47111 7.62338L3.66713 8.28194C2.89387 8.41581 2.1009 8.20228 1.49941 7.69823L0.297703 6.69116C0.00493565 6.44581 -0.0335059 6.00958 0.211842 5.71682C0.33117 5.57442 0.502766 5.48602 0.687982 5.47153L4.35956 5.18419C4.61895 5.16389 4.845 4.99974 4.94458 4.75937L6.36101 1.3402C6.5072 0.987302 6.91179 0.819734 7.26469 0.965925C7.43413 1.03612 7.56876 1.17075 7.63896 1.3402L9.05539 4.75937C9.15496 4.99974 9.38101 5.16389 9.6404 5.18419L13.3322 5.47311C13.713 5.50291 13.9975 5.83578 13.9677 6.2166C13.9534 6.39979 13.8667 6.56975 13.7269 6.68896L10.9114 9.08928C10.7131 9.25826 10.6267 9.52425 10.6876 9.77748L11.5532 13.3733C11.6426 13.7447 11.414 14.1182 11.0427 14.2076C10.8642 14.2506 10.676 14.2208 10.5195 14.1249L7.36128 12.1902C7.13956 12.0544 6.8604 12.0544 6.63869 12.1902Z" fill="var(--color-fill)"/></svg>'},s={},l=(0,a.X$)((e=>{let{withGradient:t,big:n,onClick:l}=e;const c=(0,a.Ye)((()=>t?function(){const e=(0,r.Z)(s);return{__html:`<svg width="14" height="15" viewBox="0 0 14 15" fill="none" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="${e}" x1="3" y1="63.5001" x2="84.1475" y2="-1.32262" gradientUnits="userSpaceOnUse"><stop stop-color="#6B93FF"/><stop offset="0.439058" stop-color="#976FFF"/><stop offset="1" stop-color="#E46ACE"/></linearGradient></defs><path fill-rule="evenodd" clip-rule="evenodd" d="M6.63869 12.1902L3.50621 14.1092C3.18049 14.3087 2.75468 14.2064 2.55515 13.8807C2.45769 13.7216 2.42864 13.5299 2.47457 13.3491L2.95948 11.4405C3.13452 10.7515 3.60599 10.1756 4.24682 9.86791L7.6642 8.22716C7.82352 8.15067 7.89067 7.95951 7.81418 7.80019C7.75223 7.67116 7.61214 7.59896 7.47111 7.62338L3.66713 8.28194C2.89387 8.41581 2.1009 8.20228 1.49941 7.69823L0.297703 6.69116C0.00493565 6.44581 -0.0335059 6.00958 0.211842 5.71682C0.33117 5.57442 0.502766 5.48602 0.687982 5.47153L4.35956 5.18419C4.61895 5.16389 4.845 4.99974 4.94458 4.75937L6.36101 1.3402C6.5072 0.987302 6.91179 0.819734 7.26469 0.965925C7.43413 1.03612 7.56876 1.17075 7.63896 1.3402L9.05539 4.75937C9.15496 4.99974 9.38101 5.16389 9.6404 5.18419L13.3322 5.47311C13.713 5.50291 13.9975 5.83578 13.9677 6.2166C13.9534 6.39979 13.8667 6.56975 13.7269 6.68896L10.9114 9.08928C10.7131 9.25826 10.6267 9.52425 10.6876 9.77748L11.5532 13.3733C11.6426 13.7447 11.414 14.1182 11.0427 14.2076C10.8642 14.2506 10.676 14.2208 10.5195 14.1249L7.36128 12.1902C7.13956 12.0544 6.8604 12.0544 6.63869 12.1902Z" fill="url(#${e})"/></svg>`}}():i),[t]);return a.ZP.createElement("i",{onClick:l,className:(0,o.Z)("PremiumIcon",t&&"gradient",l&&"clickable",n&&"big"),dangerouslySetInnerHTML:c,title:"Premium"})}))},6058:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(14050),r=n(33555),o=n(91713),i=n(11192),s=n(83158),l=n(32340),c=n(59107),d=n(70172),u=n(89411),m=n(68729),h=n(78780),v=n(50685),p=n(4863);const f=(0,a.X$)((0,r.c$)(((e,t)=>{let{userId:n,forceShowSelf:a}=t;const{lastSyncTime:r,serverTimeOffset:o}=e,s=(0,i.dy)(e,n);return{lastSyncTime:r,user:s,userStatus:(0,i.ss)(e,n),isSavedMessages:!a&&s&&s.isSelf,areMessagesLoaded:Boolean((0,i.Zw)(e,n)),serverTimeOffset:o}}))((e=>{let{typingStatus:t,avatarSize:n="medium",status:i,withDots:f,withMediaViewer:g,withUsername:Z,withFullInfo:P,withUpdatingStatus:E,withVideoAvatar:y,noStatusOrTyping:C,noRtl:b,user:w,userStatus:N,isSavedMessages:k,areMessagesLoaded:I,lastSyncTime:S,serverTimeOffset:M}=e;const{loadFullUser:T,openMediaViewer:x,loadProfilePhotos:L}=(0,r.Sv)(),{id:$}=w||{},D=(0,s.Js)(w);(0,a.d4)((()=>{$&&S&&(P&&T({userId:$}),g&&L({profileId:$}))}),[$,T,L,S,P,g]);const O=(0,a.I4)(((e,t)=>{w&&t&&(e.stopPropagation(),x({avatarOwnerId:w.id,mediaId:0,origin:"jumbo"===n?o.bZ.ProfileAvatar:o.bZ.MiddleHeaderAvatar}))}),[w,n,x]),A=(0,c.Z)();if(w)return a.ZP.createElement("div",{className:"ChatInfo",dir:!b&&A.isRtl?"rtl":void 0},a.ZP.createElement(d.Z,{key:w.id,size:n,user:w,isSavedMessages:k,onClick:g?O:void 0,noVideo:!y}),a.ZP.createElement("div",{className:"info"},k?a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",null,A("SavedMessages"))):a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},D&&(0,l.Z)(D)),(null==w?void 0:w.isVerified)&&a.ZP.createElement(u.Z,null),w.isPremium&&a.ZP.createElement(p.Z,null),w.fakeType&&a.ZP.createElement(v.Z,{fakeType:w.fakeType})),(i||!k&&!C)&&(i?f?a.ZP.createElement(h.Z,{className:"status",content:i}):a.ZP.createElement("span",{className:"status",dir:"auto"},i):E&&!I?a.ZP.createElement(h.Z,{className:"status",content:A("Updating")}):w?t?a.ZP.createElement(m.Z,{typingStatus:t}):a.ZP.createElement("span",{className:"status "+((0,s.kM)(w,N)?"online":"")},Z&&w.username&&a.ZP.createElement("span",{className:"handle"},w.username),a.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,s.Tq)(A,w,N,M))):void 0)))})))},20787:(e,t,n)=>{n.d(t,{Z:()=>k});var a=n(14050),r=n(33555),o=n(91713),i=n(77361),s=n(70735),l=n(11192),c=n(83158),d=n(32340),u=n(64963),m=n(46752),h=n(6137),v=n(40647),p=n(59107),f=n(87204),g=n(89411),Z=n(74753),P=n(2155),E=n(6202),y=n(49204);const C=(0,a.X$)((e=>{var t;let{chat:n,user:r,photo:o,isFirstPhoto:i,isSavedMessages:s,notActive:l,lastSyncTime:u,onClick:v}=e;const f=(0,a.sO)(null),g=(0,p.Z)(),C=r&&(0,c.NB)(r),b=n&&(0,c.pK)(n.id);function w(e){var t;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"photo";const l=r||n,d=o||(null==l||null===(t=l.fullInfo)||void 0===t?void 0:t.profilePhoto),u=null==d?void 0:d.isVideo,m=i;if("video"!==a||u){if(o&&!m){if(u&&"video"===a)return(0,c.Dk)(o);if("photo"===a)return`photo${o.id}?size=c`}return s||C||b||!l?void 0:(0,c.RT)(l,e,a)}}(0,a.d4)((()=>{f.current&&(l?(f.current.pause(),f.current.currentTime=0):(0,Z.Z)(f.current))}),[l]);const N=w("big","photo"),k=(0,E.Z)(N,!1,h.IU.BlobUrl,u),I=w("normal","video"),S=(0,E.Z)(I,!1,h.IU.BlobUrl,u),M=S||k||(null==o||null===(t=o.thumbnail)||void 0===t?void 0:t.dataUri);let T;if(s)T=a.ZP.createElement("i",{className:"icon-avatar-saved-messages"});else if(C)T=a.ZP.createElement("i",{className:"icon-avatar-deleted-account"});else if(b)T=a.ZP.createElement("i",{className:"icon-reply-filled"});else if(M)T=S?a.ZP.createElement("video",{ref:f,src:M,className:"avatar-media",muted:!0,disablePictureInPicture:!0,autoPlay:!l,loop:!0,playsInline:!0}):a.ZP.createElement("img",{src:M,className:"avatar-media",alt:""});else if(r){const e=(0,c.Js)(r);T=e?(0,P.Xv)(e,2):void 0}else if(n){const e=(0,c.U)(g,n);T=e&&(0,P.Xv)(e,(0,c.YC)(n.id)?2:1)}else T=a.ZP.createElement("div",{className:"spinner-wrapper"},a.ZP.createElement(y.Z,{color:"white"}));const x=(0,m.Z)("ProfilePhoto",`color-bg-${(0,c.Rs)(r||n)}`,s&&"saved-messages",C&&"deleted-account",b&&"replies-bot-account",!s&&!M&&"no-photo");return a.ZP.createElement("div",{className:x,onClick:M?v:void 0},"string"==typeof T?(0,d.Z)(T,["hq_emoji"]):T)}));var b=n(2255),w=n(50685),N=n(4863);const k=(0,a.X$)((0,r.c$)(((e,t)=>{let{userId:n,forceShowSelf:a}=t;const{connectionState:r,serverTimeOffset:o}=e,i=(0,l.dy)(e,n),s=(0,l.ss)(e,n),c=(0,l.Z1)(e,n),d=!a&&i&&i.isSelf,{animationLevel:u}=e.settings.byKey,{mediaId:m,avatarOwnerId:h}=e.mediaViewer;return{connectionState:r,user:i,userStatus:s,chat:c,isSavedMessages:d,animationLevel:u,serverTimeOffset:o,mediaId:m,avatarOwnerId:h}}))((e=>{var t,n;let{forceShowSelf:l,user:Z,userStatus:P,chat:E,isSavedMessages:y,connectionState:k,animationLevel:I,serverTimeOffset:S,mediaId:M,avatarOwnerId:T}=e;const{loadFullUser:x,openMediaViewer:L,openPremiumModal:$}=(0,r.Sv)(),D=(0,p.Z)(),{id:O}=Z||{},{id:A}=E||{},F=Z?(0,c.Js)(Z):E?E.title:"",R=(null==Z?void 0:Z.photos)||(null==E?void 0:E.photos)||s.D,U=(0,f.Z)(M),B=(0,f.Z)(T),[X,Y]=(0,a.eJ)(!0),_=X&&I>=1?D.isRtl?"slide-optimized-rtl":"slide-optimized":"none",[V,K]=(0,a.eJ)(0),j=y||R.length<=1||0===V,z=y||R.length<=1||V===R.length-1;(0,a.d4)((()=>{B&&void 0!==U&&void 0===M&&(Y(!1),K(U))}),[M,U,B]),(0,a.d4)((()=>{V>R.length&&K(Math.max(0,R.length-1))}),[V,R.length]),(0,a.d4)((()=>{"connectionStateReady"===k&&O&&!l&&x({userId:O})}),[O,x,k,l]),function(e,t,n){(0,a.d4)((()=>{t.slice(n,n+4).forEach((e=>{v.UV(`photo${e.id}?size=c`)||v.he(`photo${e.id}?size=c`,h.IU.BlobUrl)}))}),[n,t])}(0,R,V);const H=(0,a.I4)((()=>{L({avatarOwnerId:O||A,mediaId:V,origin:l?o.bZ.SettingsAvatar:o.bZ.ProfileAvatar})}),[L,O,A,V,l]),W=(0,a.I4)((()=>{Z&&$({fromUserId:Z.id})}),[$,Z]),J=(0,a.I4)((()=>{j||(Y(!0),K(V-1))}),[V,j]),q=(0,a.I4)((()=>{z||(Y(!0),K(V+1))}),[V,z]);if((0,a.d4)((()=>{const e=document.querySelector(".photo-wrapper");if(e)return(0,u.sf)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:i.$b?(e,t)=>t===u.eM.Right?(J(),!0):t===u.eM.Left&&(q(),!0):void 0})}),[q,J]),!Z&&!E)return;function G(e){const t=!y&&R.length>0?R[V]:void 0;return a.ZP.createElement(C,{key:V,user:Z,chat:E,photo:t,isSavedMessages:y,isFirstPhoto:j,notActive:!e,onClick:H})}const Q=null===(t=Z||E)||void 0===t?void 0:t.isVerified,ee=null==Z?void 0:Z.isPremium,te=null===(n=Z||E)||void 0===n?void 0:n.fakeType;return a.ZP.createElement("div",{className:(0,m.Z)("ProfileInfo",l&&"self"),dir:D.isRtl?"rtl":void 0},a.ZP.createElement("div",{className:"photo-wrapper"},function(){if(!(y||!R||R.length<=1))return a.ZP.createElement("div",{className:"photo-dashes"},R.map(((e,t)=>a.ZP.createElement("span",{className:"photo-dash "+(t===V?"current":"")}))))}(),a.ZP.createElement(b.Z,{activeKey:V,name:_,className:"profile-slide-container"},G),!j&&a.ZP.createElement("button",{type:"button",className:"navigation prev","aria-label":D("AccDescrPrevious"),onClick:J}),!z&&a.ZP.createElement("button",{type:"button",className:"navigation next","aria-label":D("Next"),onClick:q})),a.ZP.createElement("div",{className:"info",dir:D.isRtl?"rtl":"auto"},y?a.ZP.createElement("div",{className:"title"},a.ZP.createElement("div",{className:"fullName",dir:"auto"},D("SavedMessages"))):a.ZP.createElement("div",{className:"title"},a.ZP.createElement("div",{className:"fullName",dir:"auto"},F&&(0,d.Z)(F)),Q&&a.ZP.createElement(g.Z,null),ee&&a.ZP.createElement(N.Z,{onClick:W}),te&&a.ZP.createElement(w.Z,{fakeType:te})),!y&&(Z?a.ZP.createElement("div",{className:"status "+((0,c.kM)(Z,P)?"online":"")},a.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,c.Tq)(D,Z,P,S))):a.ZP.createElement("span",{className:"status",dir:"auto"},(0,c.eA)(E)?D("Subscribers",null!==(ne=E.membersCount)&&void 0!==ne?ne:0,"i"):D("Members",null!==(ae=E.membersCount)&&void 0!==ae?ae:0,"i")))));var ne,ae})))},48198:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(14050),r=n(33555),o=n(6137),i=n(6202),s=n(46752);const l=(0,a.X$)((e=>{var t,n,l;let{reaction:c,ref:d,className:u}=e;const m=null===(t=(0,r.Rd)().availableReactions)||void 0===t||null===(n=t.find((e=>e.reaction===c)))||void 0===n||null===(l=n.staticIcon)||void 0===l?void 0:l.id,h=(0,i.Z)(`document${m}`,!m,o.IU.BlobUrl);return a.ZP.createElement("img",{className:(0,s.Z)("ReactionStaticEmoji",u),ref:d,src:h,alt:""})}))},66534:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(14050),r=n(33555),o=n(59107),i=n(13103),s=n(231),l=n(14434),c=n(97687);const d=(0,a.X$)((e=>{let{isOpen:t,subject:n="messages",chatId:d,photo:u,messageIds:m,onClose:h,onCloseAnimationEnd:v}=e;const{reportMessages:p,reportPeer:f,reportProfilePhoto:g,exitMessageSelectMode:Z}=(0,r.Sv)(),[P,E]=(0,a.eJ)("spam"),[y,C]=(0,a.eJ)(""),b=(0,a.I4)((()=>{switch(n){case"messages":p({messageIds:m,reason:P,description:y}),Z();break;case"peer":f({chatId:d,reason:P,description:y});break;case"media":g({chatId:d,photo:u,reason:P,description:y})}h()}),[y,Z,m,u,h,p,P,d,g,f,n]),w=(0,a.I4)((e=>{E(e)}),[]),N=(0,a.I4)((e=>{C(e.target.value)}),[]),k=(0,o.Z)(),I=(0,a.Ye)((()=>[{value:"spam",label:k("lng_report_reason_spam")},{value:"violence",label:k("lng_report_reason_violence")},{value:"pornography",label:k("lng_report_reason_pornography")},{value:"childAbuse",label:k("lng_report_reason_child_abuse")},{value:"copyright",label:k("ReportPeer.ReasonCopyright")},{value:"illegalDrugs",label:"Illegal Drugs"},{value:"personalDetails",label:"Personal Details"},{value:"other",label:k("lng_report_reason_other")}]),[k]);if("messages"===n&&!m||"peer"===n&&!d||"media"===n&&(!d||!u))return;const S=k("messages"===n?"lng_report_message_title":"ReportPeer.Report");return a.ZP.createElement(i.Z,{isOpen:t,onClose:h,onEnter:t?b:void 0,onCloseAnimationEnd:v,className:"report",title:S},a.ZP.createElement(l.Z,{name:"report-message",options:I,onChange:w,selected:P}),a.ZP.createElement(c.Z,{label:k("lng_report_reason_description"),value:y,onChange:N}),a.ZP.createElement(s.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:b},k("lng_report_button")),a.ZP.createElement(s.Z,{className:"confirm-dialog-button",isText:!0,onClick:h},k("Cancel")))}))},73547:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(14050),r=n(33555),o=n(6137),i=n(46752),s=n(30386),l=n(74753),c=n(77361),d=n(3657),u=n(6202),m=n(31212),h=n(60706),v=n(59107),p=n(17240),f=n(63394),g=n(97799),Z=n(231),P=n(52328),E=n(58964);const y=(0,a.X$)((e=>{let{sticker:t,size:n,noAnimate:y,title:C,className:b,clickArg:w,noContextMenu:N,isSavedMessages:k,canViewSet:I,observeIntersection:S,onClick:M,onFaveClick:T,onUnfaveClick:x,onRemoveRecentClick:L,isCurrentUserPremium:$}=e;const{openStickerSet:D,openPremiumModal:O}=(0,r.Sv)(),A=(0,a.sO)(null),F=(0,v.Z)(),R=`sticker${t.id}`,U=`sticker-button-${t.id}`,B=(0,d.Op)(A,S),X=t.thumbnail?t.thumbnail.dataUri:void 0,Y=(0,u.Z)(`${R}?size=m`,!B,o.IU.BlobUrl),_=B&&!y,V=(0,u.Z)(t.isLottie&&R,!_),[K,j,z]=(0,h.Z)(Boolean(V)),H=K&&_,W=t.isVideo&&c.Hh,J=(0,u.Z)(W&&R,!_,o.IU.BlobUrl),q=Boolean(W&&J&&_),G=t.hasEffect,Q=!$&&G,{transitionClassNames:ee}=(0,m.Z)(Boolean(Y||H),void 0,void 0,"slow"),{isContextMenuOpen:te,contextMenuPosition:ne,handleBeforeContextMenu:ae,handleContextMenu:re,handleContextMenuClose:oe,handleContextMenuHide:ie}=(0,p.Z)(A),se=(0,a.I4)((()=>A.current),[]),le=(0,a.I4)((()=>A.current.closest(".custom-scroll, .no-scrollbar")),[]),ce=(0,a.I4)((()=>A.current.querySelector(".sticker-context-menu .bubble")),[]),{positionX:de,positionY:ue,transformOriginX:me,transformOriginY:he,style:ve}=(0,f.Z)(ne,se,le,ce);(0,a.d4)((()=>{_||z()}),[z,_]),(0,a.d4)((()=>{if(!W||!A.current)return;const e=A.current.querySelector("video");e&&(q?(0,l.Z)(e):e.pause())}),[W,q]),(0,a.d4)((()=>{B||oe()}),[oe,B]);const pe=(0,a.I4)((e=>{e.stopPropagation(),e.preventDefault(),L(t)}),[L,t]),fe=(0,a.I4)((()=>{L(t)}),[L,t]),ge=(0,a.I4)((()=>{x(t)}),[x,t]),Ze=(0,a.I4)((()=>{T(t)}),[T,t]),Pe=(0,a.I4)((()=>{null==M||M(w,!0)}),[w,M]),Ee=(0,a.I4)((()=>{null==M||M(w,void 0,!0)}),[w,M]),ye=(0,a.I4)((()=>{D({sticker:t})}),[D,t]),Ce=!c.$b&&L,be=(0,i.Z)("StickerButton",M&&"interactive",U,b),we=!X||H||q?"":`background-image: url('${X}');`,Ne=(0,a.Ye)((()=>{const e=[];return N||(x&&e.push(a.ZP.createElement(E.Z,{icon:"favorite",onClick:ge},F("Stickers.RemoveFromFavorites"))),T&&e.push(a.ZP.createElement(E.Z,{icon:"favorite",onClick:Ze},F("Stickers.AddToFavorites"))),!Q&&M&&(k||e.push(a.ZP.createElement(E.Z,{onClick:Pe,icon:"muted"},F("SendWithoutSound"))),e.push(a.ZP.createElement(E.Z,{onClick:Ee,icon:"calendar"},F(k?"SetReminder":"ScheduleMessage")))),I&&e.push(a.ZP.createElement(E.Z,{onClick:ye,icon:"stickers"},F("ViewPackPreview"))),L&&e.push(a.ZP.createElement(E.Z,{icon:"delete",onClick:fe},F("DeleteFromRecent")))),e}),[I,Ze,fe,ge,ye,Pe,Ee,Q,k,F,T,L,x,M,N]);return a.ZP.createElement("div",{ref:A,className:be,title:C||(null==t?void 0:t.emoji),style:we,"data-sticker-id":t.id,onMouseDown:e=>{(0,s.b)(e),ae(e)},onClick:()=>{te||(Q?O({initialSection:"stickers"}):null==M||M(w))},onContextMenu:re},!H&&!q&&a.ZP.createElement("img",{src:Y,className:ee}),W&&a.ZP.createElement("video",{className:ee,src:J,autoPlay:q,loop:!0,playsInline:!0,disablePictureInPicture:!0,muted:!0}),_&&V&&a.ZP.createElement(g.Z,{tgsUrl:V,play:!0,size:n,isLowPriority:!0,onLoad:j}),Q&&a.ZP.createElement("div",{className:"sticker-locked"},a.ZP.createElement("i",{className:"icon-lock-badge"})),G&&!Q&&a.ZP.createElement("div",{className:"sticker-premium"},a.ZP.createElement("i",{className:"icon-premium"})),Ce&&a.ZP.createElement(Z.Z,{className:"sticker-remove-button",color:"dark",round:!0,onClick:pe},a.ZP.createElement("i",{className:"icon-close"})),Boolean(Ne.length)&&void 0!==ne&&a.ZP.createElement(P.Z,{isOpen:te,transformOriginX:me,transformOriginY:he,positionX:de,positionY:ue,style:ve,className:"sticker-context-menu",autoClose:!0,onClose:oe,onCloseAnimationEnd:ie},Ne))}))},94851:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(99203),o=n(48778);const i=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,o.Z)(r.gl.Extra,"StickerSetModal",!t);return n?a.ZP.createElement(n,e):void 0}))},68729:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(14050),r=n(33555),o=n(11192),i=n(83158),s=n(32340),l=n(59107),c=n(78780);const d=(0,a.X$)((0,r.c$)(((e,t)=>{let{typingStatus:n}=t;return n.userId?{typingUser:(0,o.dy)(e,n.userId)}:{}}))((e=>{let{typingStatus:t,typingUser:n}=e;const r=(0,l.Z)(),o=n&&!n.isSelf&&(0,i.Vl)(n),d=r(t.action).replace("{user}","").replace("{emoji}",t.emoji).trim();return a.ZP.createElement("p",{className:"typing-status",dir:r.isRtl?"rtl":"auto"},o&&a.ZP.createElement("span",{className:"sender-name",dir:"auto"},(0,s.Z)(o)),a.ZP.createElement(c.Z,{content:d}))})))},89411:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(14050);const r={__html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12.3 2.9c.1.1.2.1.3.2.7.6 1.3 1.1 2 1.7.3.2.6.4.9.4.9.1 1.7.2 2.6.2.5 0 .6.1.7.7.1.9.1 1.8.2 2.6 0 .4.2.7.4 1 .6.7 1.1 1.3 1.7 2 .3.4.3.5 0 .8-.5.6-1.1 1.3-1.6 1.9-.3.3-.5.7-.5 1.2-.1.8-.2 1.7-.2 2.5 0 .4-.2.5-.6.6-.8 0-1.6.1-2.5.2-.5 0-1 .2-1.4.5-.6.5-1.3 1.1-1.9 1.6-.3.3-.5.3-.8 0-.7-.6-1.4-1.2-2-1.8-.3-.2-.6-.4-.9-.4-.9-.1-1.8-.2-2.7-.2-.4 0-.5-.2-.6-.5 0-.9-.1-1.7-.2-2.6 0-.4-.2-.8-.4-1.1-.6-.6-1.1-1.3-1.6-2-.4-.4-.3-.5 0-1 .6-.6 1.1-1.3 1.7-1.9.3-.3.4-.6.4-1 0-.8.1-1.6.2-2.5 0-.5.1-.6.6-.6.9-.1 1.7-.1 2.6-.2.4 0 .7-.2 1-.4.7-.6 1.4-1.2 2.1-1.7.1-.2.3-.3.5-.2z" style="fill: var(--color-fill)"/><path class="lol" d="M16.4 10.1l-.2.2-5.4 5.4c-.1.1-.2.2-.4 0l-2.6-2.6c-.2-.2-.1-.3 0-.4.2-.2.5-.6.7-.6.3 0 .5.4.7.6l1.1 1.1c.2.2.3.2.5 0l4.3-4.3c.2-.2.4-.3.6 0 .1.2.3.3.4.5.2 0 .3.1.3.1z" style="fill: var(--color-checkmark)"/></svg>'},o=()=>a.ZP.createElement("span",{className:"VerifiedIcon",dangerouslySetInnerHTML:r})},45418:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(14050),r=n(83158),o=n(46752),i=n(48035),s=n(32340),l=n(790),c=n(59107),d=n(996),u=n(13709),m=n(88033),h=n(10088);const v=(0,a.X$)((e=>{let{message:t,senderTitle:n,isProtected:v,observeIntersection:p,onMessageClick:f}=e;const g=(0,c.Z)();let Z=(0,r.s1)(t);if(!Z){const e=(0,r.T7)(t);if(e){const{url:n,domain:a}=e;Z={siteName:a.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,formattedDescription:(0,r.UD)(t)!==n?(0,d.e)(g,t,void 0,void 0,170):void 0}}}const P=(0,a.I4)((()=>{f(t.id,t.chatId)}),[f,t.id,t.chatId]);if(!Z)return;const{siteName:E,url:y,displayUrl:C,title:b,description:w,formattedDescription:N,photo:k,video:I}=Z,S=!n&&w&&(0,i.Z)(w,170),M=(0,o.Z)("WebLink scroll-item",!k&&!I&&"without-media");return a.ZP.createElement("div",{className:M,"data-initial":(E||C)[0],dir:g.isRtl?"rtl":void 0},k&&a.ZP.createElement(u.Z,{message:t,isProtected:v,observeIntersection:p}),a.ZP.createElement("div",{className:"content"},a.ZP.createElement(m.Z,{isRtl:g.isRtl,className:"site-title",onClick:P},(0,s.Z)(b||E||C)),(S||N)&&a.ZP.createElement(m.Z,{isRtl:g.isRtl,className:"site-description",onClick:P},N||S&&(0,s.Z)(S)),a.ZP.createElement(h.Z,{url:y,className:"site-name",text:"",isRtl:g.isRtl},y.replace("mailto:","")||C),n&&a.ZP.createElement("div",{className:"sender-name"},(0,s.Z)(n))),n&&a.ZP.createElement("div",{className:"message-date"},a.ZP.createElement(m.Z,{className:"date",onClick:P,isRtl:g.isRtl},(0,l.VX)(g,1e3*t.date))))}))},74399:(e,t,n)=>{n.d(t,{Eh:()=>E,Fp:()=>u,GC:()=>y,Gw:()=>l,L6:()=>s,PA:()=>N,Rj:()=>c,W7:()=>C,Wr:()=>w,fM:()=>P,jg:()=>k,kc:()=>g,lE:()=>b,vY:()=>d,wB:()=>m});var a=n(83716),r=n(77361),o=n(43858),i=n(83158);const s="(max-height: 640px)",l=parseInt(getComputedStyle(document.documentElement).fontSize,10),c=240,d={width:640,height:640},u={width:800,height:800},m="4986041492570112461",h={width:100,height:100};let v,p,f;function g(e,t,n,a){const i=t||n?1.625:0,s=function(e,t){const n=e?30:29;if(!r.wB)return n;const{width:a}=o.Z.get();return v||(v=Math.min(30,a/l-4.5)),p||(p=Math.min(29,a/l-7)),f||(f=Math.min(29,a/l-4.5)),e?v:t?f:p}(e,a)-i;return s*l}function Z(e){let{width:t,height:n,fromOwnMessage:a,isForwarded:r,isWebPagePhoto:o,isGif:i,noAvatars:s}=e;const c=n/t,d=g(a,r,o,s),u=function(e,t){return e&&t&&t>=.75&&t<=1.25?20*l:27*l}(i,c),m=i?Math.max(300,t):t;return k(d,u,m,i?n*(m/t):n)}function P(e,t){const n=window.matchMedia(s),{width:a,height:i}=o.Z.get();let c=t&&n.matches?10:8.25;return e&&!r.$b&&(c=n.matches?10:12.5),{width:a,height:i-c*l}}function E(e,t,n,a,r){const{width:o,height:s}=(0,i.HV)(e)||h;return Z({width:o,height:s,fromOwnMessage:t,isForwarded:n,isWebPagePhoto:a,noAvatars:r})}function y(e,t,n,a){const{width:r,height:o}=(0,i.jC)(e)||h;return Z({width:r,height:o,fromOwnMessage:t,isForwarded:n,isGif:e.isGif,noAvatars:a})}function C(){return{width:2*l,height:2*l}}function b(e){return e?{width:3*l,height:3*l}:{width:3.375*l,height:3.375*l}}function w(e){const{width:t}=e;let{height:n}=e;e.id===m&&(n=t);const o=n&&t&&n/t,i=l*(r.wB?a.w7:a.K7),s=o?i*o:i;return o&&s>i?{width:Math.round(i/o),height:i}:{width:i,height:s}}function N(e,t){let{width:n,height:a}=e,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{width:o,height:i}=P(t,r);return k(o,i,n,a)}function k(e,t,n,a){const r=a/n,o=Math.min(n,e);return Math.round(o*r)>t?{width:Math.round(t/r),height:t}:{width:o,height:Math.round(o*r)}}},50742:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(99203),o=n(48778);const i=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,o.Z)(r.gl.Extra,"ChatFolderModal",!t);return n?a.ZP.createElement(n,e):void 0}))},1080:(e,t,n)=>{n.d(t,{Z:()=>J});var a=n(14050),r=n(33555),o=n(83716),i=n(77361),s=n(60782),l=n(16974),c=n(87204),d=n(27407),u=n(95616);let m;!function(e){e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None"}(m||(m={}));var h=n(3657),v=n(73541),p=n(67360),f=n(21273),g=n(34288),Z=n(6137),P=n(83158),E=n(11192),y=n(18005),C=n(32340),b=n(69118),w=n(46752),N=n(996),k=n(75790),I=n(41470),S=n(60706),M=n(6202),T=n(59107),x=n(70172),L=n(89411),$=n(68729),D=n(76844),O=n(40329),A=n(31876),F=n(2155),R=n(40126);const U=(0,a.X$)((e=>{let{chat:t,isPinned:n,isMuted:r}=e;const o=Boolean(t.unreadCount||t.unreadMentionsCount||t.hasUnreadMark||n||t.unreadReactionsCount),i=Boolean(t.unreadCount||t.hasUnreadMark),s=(0,w.Z)("Badge",r&&"muted",!i&&n&&"pinned",i&&"unread");return a.ZP.createElement(R.Z,{isCustom:!0,className:"Badge-transition",isOpen:o},function(){const e=t.unreadReactionsCount&&a.ZP.createElement("div",{className:(0,w.Z)("Badge reaction",r&&"muted")},a.ZP.createElement("i",{className:"icon-heart"})),o=t.unreadMentionsCount&&a.ZP.createElement("div",{className:"Badge mention"},a.ZP.createElement("i",{className:"icon-mention"})),i=t.hasUnreadMark||t.unreadCount?a.ZP.createElement("div",{className:s},!t.hasUnreadMark&&(0,F.bi)(t.unreadCount)):void 0,l=[e,o,i,n&&!i&&!o&&!e&&a.ZP.createElement("div",{className:s},a.ZP.createElement("i",{className:"icon-pinned-chat"}))].filter(Boolean);if(0!==l.length)return 1===l.length?l[0]:a.ZP.createElement("div",{className:"Badge-wrapper"},l)}())}));var B=n(50742);const X=(0,a.X$)((e=>{let{isSelected:t,isActive:n}=e;return a.ZP.createElement("div",{className:(0,w.Z)("ChatCallStatus",n&&"active",t&&!i.wB&&"selected")},a.ZP.createElement("div",{className:"indicator"},a.ZP.createElement("div",null),a.ZP.createElement("div",null),a.ZP.createElement("div",null)))}));var Y=n(66534),_=n(50685),V=n(4863);const K=(0,a.X$)((0,r.c$)(((e,t)=>{var n;let{chatId:a}=t;const r=(0,E.Z1)(e,a);if(!r||!r.lastMessage)return{};const{senderId:o,replyToMessageId:i,isOutgoing:s}=r.lastMessage,l=o?(0,E.dy)(e,o):void 0,c=(0,P.N5)(r.lastMessage),d=c&&i?(0,E.hj)(e,r.id,i):void 0,{targetUserIds:u,targetChatId:m}=c||{},h=(0,P.zX)(r),{chatId:v,threadId:p,type:f}=(0,E.Bt)(e)||{},g=a===v&&p===Z._f;return{chat:r,isMuted:(0,P.i4)(r,(0,E.dZ)(e),(0,E.NJ)(e)),lastMessageSender:l,actionTargetUserIds:u,actionTargetChatId:m,actionTargetMessage:d,draft:(0,E.Ms)(e,a,Z._f),animationLevel:e.settings.byKey.animationLevel,isSelected:g,canScrollDown:g&&"thread"===f,canChangeFolder:((null===(n=e.chatFolders.orderedIds)||void 0===n?void 0:n.length)||0)>1,lastSyncTime:e.lastSyncTime,...s&&{lastMessageOutgoingStatus:(0,E.dT)(e,r.lastMessage)},...h&&{user:(0,E.dy)(e,h),userStatus:(0,E.ss)(e,h)}}}))((e=>{let{style:t,chatId:n,folderId:s,orderDiff:l,animationType:c,isPinned:d,observeIntersection:u,chat:h,isMuted:v,user:p,userStatus:f,actionTargetUserIds:g,lastMessageSender:Z,lastMessageOutgoingStatus:E,actionTargetMessage:F,actionTargetChatId:R,draft:K,animationLevel:j,isSelected:z,canScrollDown:H,canChangeFolder:W,lastSyncTime:J,onDragEnter:q}=e;const{openChat:G,focusLastMessage:Q}=(0,r.Sv)(),ee=(0,a.sO)(null),[te,ne,ae]=(0,S.Z)(),[re,oe,ie]=(0,S.Z)(),[se,le,ce]=(0,S.Z)(),[de,ue,me]=(0,S.Z)(),[he,ve,pe]=(0,S.Z)(),[fe,ge,Ze]=(0,S.Z)(),{lastMessage:Pe,typingStatus:Ee}=h||{},ye=Pe&&(0,P.Lo)(Pe);(0,k.Z)(n,ye?Pe.replyToMessageId:void 0,F);const Ce=Pe&&!(0,P.bf)(Pe)?(0,P.DH)(Pe):void 0,be=(0,M.Z)(Pe?(0,P.Ti)(Pe,"micro"):void 0),we=Boolean(Pe&&(0,P.Y5)(Pe)),Ne=(0,a.Ye)((()=>{if(!g)return;const e=(0,r.Rd)().users.byId;return g.map((t=>e[t])).filter(Boolean)}),[g]);(0,a.bt)((()=>{const e=ee.current;if(0!==j&&e){if(c===m.Opacity)e.style.opacity="0",(0,b.T2)((()=>{e.classList.add("animate-opacity"),e.style.opacity="1"}));else{if(c!==m.Move)return;e.style.transform=`translate3d(0, ${100*-l}%, 0)`,(0,b.T2)((()=>{e.classList.add("animate-transform"),e.style.transform=""}))}setTimeout((()=>{(0,b.T2)((()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""}))}),200+o.fK)}}),[j,l,c]);const ke=(0,a.I4)((()=>{G({id:n,shouldReplaceHistory:!0}),z&&H&&Q()}),[z,H,G,n,Q]),Ie=(0,a.I4)((e=>{e.preventDefault(),null==q||q(n)}),[n,q]),Se=(0,a.I4)((()=>{ue(),ne()}),[ue,ne]),Me=(0,a.I4)((()=>{ve(),oe()}),[ve,oe]),Te=(0,a.I4)((()=>{ge(),le()}),[ge,le]),xe=(0,I.Z)({chat:h,user:p,handleDelete:Se,handleChatFolderChange:Me,handleReport:Te,folderId:s,isPinned:d,isMuted:v,canChangeFolder:W}),Le=(0,T.Z)();if(!h)return;const $e=(0,w.Z)("Chat chat-item-clickable",(0,P.YC)(n)?"private":"group",z&&"selected");return a.ZP.createElement(A.Z,{ref:ee,className:$e,style:t,ripple:!i.wB,contextActions:xe,onClick:ke,onDragEnter:Ie},a.ZP.createElement("div",{className:"status"},a.ZP.createElement(x.Z,{chat:h,user:p,userStatus:f,isSavedMessages:null==p?void 0:p.isSelf,lastSyncTime:J,observeIntersection:u}),h.isCallActive&&h.isCallNotEmpty&&a.ZP.createElement(X,{isSelected:z,isActive:0!==j})),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",null,(0,C.Z)((0,P.U)(Le,h,p))),h.isVerified&&a.ZP.createElement(L.Z,null),(null==p?void 0:p.isPremium)&&!p.isSelf&&a.ZP.createElement(V.Z,null),h.fakeType&&a.ZP.createElement(_.Z,{fakeType:h.fakeType}),v&&a.ZP.createElement("i",{className:"icon-muted"}),h.lastMessage&&a.ZP.createElement(D.Z,{message:h.lastMessage,outgoingStatus:E})),a.ZP.createElement("div",{className:"subtitle"},function(){if(Ee&&Pe&&Ee.timestamp>1e3*Pe.date)return a.ZP.createElement($.Z,{typingStatus:Ee});if(null!=K&&K.text.length)return a.ZP.createElement("p",{className:"last-message",dir:Le.isRtl?"auto":"ltr"},a.ZP.createElement("span",{className:"draft"},Le("Draft")),(0,C.Z)(K.text));if(!Pe)return;if(ye){const e=h&&((0,P.eA)(h)||Pe.senderId===Pe.chatId);return a.ZP.createElement("p",{className:"last-message",dir:Le.isRtl?"auto":"ltr"},(0,y.D)(Le,Pe,e?void 0:Z,e?h:void 0,Ne,F,R,{asTextWithSpoilers:!0}))}const e=(0,P.zF)(Le,n,Z);return a.ZP.createElement("p",{className:"last-message",dir:Le.isRtl?"auto":"ltr"},e&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"sender-name"},(0,C.Z)(e)),a.ZP.createElement("span",{className:"colon"},":")),function(e,t,n,r){return n?a.ZP.createElement("span",{className:"media-preview"},a.ZP.createElement("img",{src:n,alt:"",className:(0,w.Z)("media-preview--image",r&&"round")}),(0,P.b7)(t)&&a.ZP.createElement("i",{className:"icon-play"}),(0,N.e)(e,t,!0)):(0,N.e)(e,t)}(Le,Pe,be||Ce,we))}(),a.ZP.createElement(U,{chat:h,isPinned:d,isMuted:v}))),de&&a.ZP.createElement(O.Z,{isOpen:te,onClose:ae,onCloseAnimationEnd:me,chat:h}),he&&a.ZP.createElement(B.Z,{isOpen:re,onClose:ie,onCloseAnimationEnd:pe,chatId:n}),fe&&a.ZP.createElement(Y.Z,{isOpen:se,onClose:ce,onCloseAnimationEnd:Ze,chatId:n,subject:"peer"}))})));var j=n(91713),z=n(231),H=n(45601);const W=(0,a.X$)((0,r.c$)(((e,t)=>{let{folderId:n,folderType:a}=t;return{chatFolder:n&&"folder"===a?(0,E.Mw)(e,n):void 0,animatedEmoji:(0,E.zB)(e,"📂")}}))((e=>{let{chatFolder:t,animatedEmoji:n,foldersDispatch:r,onScreenSelect:o}=e;const s=(0,T.Z)(),l=(0,a.I4)((()=>{r({type:"editFolder",payload:t}),o(j.MT.FoldersEditFolderFromChatList)}),[t,r,o]);return a.ZP.createElement("div",{className:"EmptyFolder"},a.ZP.createElement("div",{className:"sticker"},n&&a.ZP.createElement(H.Z,{sticker:n,size:128})),a.ZP.createElement("h3",{className:"title",dir:"auto"},s("FilterNoChatsToDisplay")),a.ZP.createElement("p",{className:"description",dir:"auto"},s(t?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")),t&&r&&o&&a.ZP.createElement(z.Z,{ripple:!i.wB,fluid:!0,pill:!0,onClick:l,size:"smaller",isRtl:s.isRtl},a.ZP.createElement("i",{className:"icon-settings"}),s("ChatList.EmptyChatListEditFilter")))}))),J=(0,a.X$)((e=>{let{folderType:t,folderId:n,isActive:Z,foldersDispatch:P,onScreenSelect:E}=e;const{openChat:y,openNextChat:C}=(0,r.Sv)(),b=(0,a.sO)(null),w=(0,a.sO)(!1),N="all"===t?o.Nf:"archived"===t?o.WS:n,k=(0,u.d7)(N),I=(0,a.Ye)((()=>{if(k)return k.reduce(((e,t,n)=>(e[t]=n,e)),{})}),[k]),S=(0,c.Z)(I),M=(0,a.Ye)((()=>I&&S?(0,s.Q8)(I,((e,t)=>void 0!==S[t]?e-S[t]:-1/0)):{}),[I,S]),[T,x]=(0,d.Z)(void 0,k,void 0,o.t_);(0,v.y)(Z&&null!=k&&k.length?{"Alt+ArrowUp":e=>{e.preventDefault(),C({targetIndexDelta:-1,orderedIds:k})},"Alt+ArrowDown":e=>{e.preventDefault(),C({targetIndexDelta:1,orderedIds:k})}}:void 0),(0,a.d4)((()=>{if(Z&&k&&i.fl)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){if((i.jm&&e.metaKey||!i.jm&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t)return;const n=Number(t)-1;if(n>k.length-1||n<0)return;y({id:k[n],shouldReplaceHistory:!0})}}}),[Z,y,C,k]);const L=function(e){return(0,a.Ye)((()=>{const t=Object.values(e),n=t.filter((e=>e<0)).length,a=t.filter((e=>e>0)).length;return t=>{const r=e[t];return 0===r?m.None:r===1/0||r===-1/0||n<=a&&r<0||a<n&&r>0?m.Opacity:m.Move}}),[e])}(M),{observe:$}=(0,h.S1)({rootRef:b,throttleMs:200}),D=(0,p.Z)((e=>{w.current?w.current=!1:y({id:e,shouldReplaceHistory:!0})}),[],500,!0),O=(0,a.I4)((e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,a=e.clientY-t.top;n<t.width||a<t.y||(w.current=!0)}),[]);return a.ZP.createElement(f.Z,{className:"chat-list custom-scroll",ref:b,items:T,preloadBackwards:o.t_,withAbsolutePositioning:!0,maxHeight:((null==k?void 0:k.length)||0)*o.rS,onLoadMore:x,onDragLeave:O},null!=T&&T.length?function(){const e=k.indexOf(T[0]),t=(0,l.aE)(N)||0;return T.map(((r,i)=>{const s=e+i<t;return a.ZP.createElement(K,{key:r,teactOrderKey:s?i:(0,l.jK)(r),chatId:r,isPinned:s,folderId:n,animationType:L(r),orderDiff:M[r],style:`top: ${(e+i)*o.rS}px;`,observeIntersection:$,onDragEnter:D})}))}():T&&!T.length?a.ZP.createElement(W,{folderId:n,folderType:t,foldersDispatch:P,onScreenSelect:E}):a.ZP.createElement(g.Z,{key:"loading"}))}))},91:(e,t,n)=>{n.d(t,{F:()=>r});var a=n(83158);function r(e,t,n,r){const{senderId:o}=t;if(!o)return;const i=(0,a.YC)(o)?r[o]:n[o];let s=(0,a.OU)(e,i);const l=n[t.chatId];return l&&((0,a.YC)(o)&&i.isSelf?s=`${e("FromYou")} → ${(0,a.U)(e,l)}`:(0,a.Bf)(l)&&(s+=` → ${(0,a.U)(e,l)}`)),s}},67146:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(99203),o=n(48778);const i=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,o.Z)(r.gl.Extra,"CustomSendMenu",!t);return n?a.ZP.createElement(n,e):void 0}))},12420:(e,t,n)=>{n.d(t,{t:()=>m,Z:()=>h});var a=n(14050),r=n(31212),o=n(46752),i=n(21262),s=n(23989),l=n(87204),c=n(62898),d=n(60706);const u=(0,a.X$)((e=>{let{isQuick:t,onFileSelect:n}=e;const[r,i,s]=(0,d.Z)(),l=(0,o.Z)("DropTarget",r&&"hovered");return a.ZP.createElement("div",{className:l,onDrop:n,onDragEnter:i,onDragLeave:e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),s()},"data-dropzone":!0},a.ZP.createElement("div",{className:"target-content"},a.ZP.createElement("div",{className:"icon icon-"+(t?"photo":"document")}),a.ZP.createElement("div",{className:"title"},"Drop files here to send them"),a.ZP.createElement("div",{className:"description"},t?"in a quick way":"without compression")))}));let m;!function(e){e.None="none",e.Document="document",e.QuickFile="quick_file"}(m||(m={}));const h=(0,a.X$)((e=>{let{isOpen:t,withQuick:n,onHide:d,onFileSelect:m}=e;const h=(0,a.sO)(null),v=(0,l.Z)(n),{shouldRender:p,transitionClassNames:f}=(0,r.Z)(t);(0,a.d4)((()=>t?(0,s.Z)(d):void 0),[t,d]);const g=(0,a.I4)((async e=>{const{dataTransfer:t}=e;let n=[];if(!(t.files&&t.files.length>0)||t.items&&t.items.length){if(t.items&&t.items.length>0){const e=await(0,i.Z)(t.items);e.length&&(n=n.concat(e))}}else n=n.concat(Array.from(t.files));d(),m(n,!1)}),[m,d]),Z=(0,a.I4)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(d(),m(Array.from(t.files),!0))}),[m,d]),P=(0,a.I4)((e=>{e.stopPropagation();const{target:t,relatedTarget:n}=e;t.matches(".DropTarget, .DropArea")&&!n&&(h.current=window.setTimeout((()=>{d()}),150))}),[d]);if(!p)return;const E=(0,o.Z)("DropArea",f);return a.ZP.createElement(c.Z,{containerId:"#middle-column-portals"},a.ZP.createElement("div",{className:E,onDragLeave:P,onDragOver:()=>{h.current&&window.clearTimeout(h.current)},onDrop:d,onClick:d},a.ZP.createElement(u,{onFileSelect:g}),(n||v)&&a.ZP.createElement(u,{onFileSelect:Z,isQuick:!0})))}))},19830:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(99203),o=n(48778);const i=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,o.Z)(r.gl.Extra,"EmojiTooltip",!t);return n?a.ZP.createElement(n,e):void 0}))},13616:(e,t,n)=>{n.d(t,{Z:()=>C});var a=n(14050),r=n(33555),o=n(83716),i=n(11192),s=n(69118),l=n(65723),c=n(46752),d=n(77361),u=n(517),m=n(72645),h=n(60706),v=n(18674),p=n(56389),f=n(59107),g=n(64784),Z=n(96391),P=n(32340),E=n(72087);const y=d.wB?256:416,C=(0,a.X$)((0,r.c$)(((e,t)=>{let{chatId:n,threadId:a}=t;const{messageSendKeyCombo:r}=e.settings.byKey;return{messageSendKeyCombo:r,replyingToId:n&&a?(0,i.Yy)(e,n,a):void 0,noTabCapture:e.pollModal.isOpen||e.payment.isPaymentModalOpen}}))((e=>{let{id:t,chatId:n,threadId:i,captionLimit:C,isAttachmentModalInput:b,editableInputId:w,html:N,placeholder:k,forcedPlaceholder:I,canAutoFocus:S,shouldSuppressFocus:M,shouldSuppressTextFormatter:T,replyingToId:x,noTabCapture:L,messageSendKeyCombo:$,onUpdate:D,onSuppressedFocus:O,onSend:A}=e;const{editLastMessage:F,replyToNextMessage:R}=(0,r.Sv)(),U=(0,a.sO)(null),B=(0,a.sO)(null),X=(0,a.sO)(null),Y=(0,f.Z)(),_=(0,a.sO)(!1),[V,K,j]=(0,h.Z)(),[z,H]=(0,a.eJ)(),[W,J]=(0,a.eJ)(),q=(0,p.Z)(n,i);(0,a.d4)((()=>{b&&ae(!1)}),[b]),(0,m.Z)((e=>{let[t]=e;N!==U.current.innerHTML&&(U.current.innerHTML=N),N!==X.current.innerHTML&&(X.current.innerHTML=N),void 0!==t&&t!==N&&ae(!N.length)}),[N]),(0,a.sO)(n).current=n;const G=(0,a.I4)((()=>{U.current&&((0,v.zG)()?setTimeout(G,350):(0,l.Z)(U.current))}),[]),Q=(0,a.I4)((()=>{j(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()}),[j]);function ee(){if(d.cj)return!1;const e=window.getSelection();if(!e||!e.rangeCount||_.current)return j(),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(T||!(0,Z.R)(t,w||o.R2)||!n||(0,g.Z)(n)||!t.START_TO_END)||(j(),!1)}function te(){if(!ee())return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=U.current.getBoundingClientRect();let a=t.left+t.width/2-n.left;a<90?a=90:a>n.width-90&&(a=n.width-90),H({x:a,y:t.top-n.top}),J(e),K()}function ne(){B.current&&window.clearTimeout(B.current),B.current=window.setTimeout(te,260)}function ae(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=U.current,n=X.current,a=Number(t.style.height.replace("px","")),r=Math.min(n.scrollHeight,y);if(r===a)return;const o=Math.round(50*Math.log(Math.abs(r-a))),i=()=>{t.style.height=`${r}px`,t.style.transitionDuration=`${o}ms`,t.classList.toggle("overflown",n.scrollHeight>y)};e?requestAnimationFrame(i):i()}(0,a.d4)((()=>{d.$b||S&&G()}),[n,G,x,S]),(0,a.d4)((()=>{if(L)return;const e=(0,s.Ds)((e=>{"Tab"===e.key&&(e.preventDefault(),requestAnimationFrame(G))}),2e3,!0,!1);return(0,u.Z)({onTab:e})}),[G,L]),(0,a.d4)((()=>{const e=U.current;function t(){e.blur()}return M&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}}),[M]);const re=(0,c.Z)("form-control custom-scroll",N.length>0&&"touched",M&&"focus-disabled");return a.ZP.createElement("div",{id:t,onClick:M?O:void 0,dir:Y.isRtl?"rtl":void 0},a.ZP.createElement("div",{ref:U,id:w||o.R2,className:re,contentEditable:!0,dir:"auto",onClick:G,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(D("<br>"===t?"":t),q({type:"typing"}),!d.$b&&(!n||!n.length)&&(d.op||!t.includes("emoji-small"))){const e=window.getSelection();e&&(U.current.blur(),e.removeAllRanges(),(0,l.Z)(U.current,!0))}},onKeyDown:function(e){const{isComposing:t}=e;if(!t&&!N.length&&(e.metaKey||e.ctrlKey)){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void R({targetIndexDelta:t})}t||"Enter"!==e.key||e.shiftKey?t||"ArrowUp"!==e.key||N.length||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",ne,{once:!0}):(e.preventDefault(),F()):d.cj||d.wZ||!("enter"===$&&!e.shiftKey||"ctrl-enter"===$&&(e.ctrlKey||e.metaKey))||(e.preventDefault(),j(),A())},onMouseDown:function(e){function t(e){e instanceof KeyboardEvent&&"Esc"!==e.key&&"Escape"!==e.key||(setTimeout((()=>{_.current=!1}),100),window.removeEventListener("keydown",t),window.removeEventListener("mousedown",t))}2===e.button?_.current||(_.current=!0,document.addEventListener("mousedown",t),document.addEventListener("keydown",t)):e.target.addEventListener("mouseup",ne,{once:!0})},onContextMenu:d.wZ?function(e){ee()&&(e.preventDefault(),e.stopPropagation())}:void 0,onTouchCancel:d.wZ?ne:void 0,"aria-label":k}),C&&a.ZP.createElement("div",{className:"max-length-indicator",dir:"auto"},C),a.ZP.createElement("div",{ref:X,className:(0,c.Z)(re,"clone"),dir:"auto"}),!I&&a.ZP.createElement("span",{className:"placeholder-text",dir:"auto"},k),a.ZP.createElement(E.Z,{isOpen:V,anchorPosition:z,selectedRange:W,setSelectedRange:J,onClose:Q}),I&&a.ZP.createElement("span",{className:"forced-placeholder"},(0,P.Z)(I)))})))},72087:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(14050),r=n(6137),o=n(83716),i=n(46752),s=n(81396),l=n(23989),c=n(31212),d=n(58758),u=n(60706),m=n(59107),h=n(231);const v={B:"bold",STRONG:"bold",I:"italic",EM:"italic",U:"underline",DEL:"strikethrough",CODE:"monospace",SPAN:"spoiler"},p=document.createElement("div"),f=(0,a.X$)((e=>{let{isOpen:t,anchorPosition:n,selectedRange:f,setSelectedRange:g,onClose:Z}=e;const P=(0,a.sO)(null),E=(0,a.sO)(null),{shouldRender:y,transitionClassNames:C}=(0,c.Z)(t),[b,w,N]=(0,u.Z)(),[k,I]=(0,a.eJ)(""),[S,M]=(0,a.eJ)(!1),[T,x]=(0,a.eJ)(),[L,$]=(0,a.eJ)({});(0,a.d4)((()=>t?(0,l.Z)(Z):void 0),[t,Z]),(0,d.Z)(t,P,Z),(0,a.d4)((()=>{b?E.current.focus():(I(""),M(!1))}),[b]),(0,a.d4)((()=>{y||(N(),$({}),x(void 0))}),[N,y]),(0,a.d4)((()=>{if(!t||!f)return;const e={};let{parentElement:n}=f.commonAncestorContainer;for(;n&&n.id!==o.R2;){const t=v[n.tagName];t&&(e[t]=!0),n=n.parentElement}$(e)}),[t,f,w]);const D=(0,a.I4)((()=>{if(!f)return;const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(f))}),[f]),O=(0,a.I4)((()=>{const e=window.getSelection();e&&g(e.getRangeAt(0))}),[g]),A=(0,a.I4)((()=>{if(f)return p.replaceChildren(f.cloneContents()),p.innerHTML}),[f]),F=(0,a.I4)((()=>{if(f)return f.commonAncestorContainer.parentElement}),[f]);function R(){const e=E.current;if(!e)return;const{offsetWidth:t,scrollWidth:n,scrollLeft:a}=e;if(n<=t)return void x(void 0);let r="";a<n-t&&(r="mask-right"),a>0&&(r+=" mask-left"),x(r)}function U(e){if(L[e])return"active";if("monospace"===e||"strikethrough"===e){if(Object.keys(L).some((t=>t!==e&&Boolean(L[t]))))return"disabled"}else if(L.monospace||L.strikethrough)return"disabled"}const B=(0,a.I4)((()=>{if(L.spoiler){const e=F();if(!f||!e||e.dataset.entityType!==r.Vv.Spoiler||!e.textContent)return;return e.replaceWith(e.textContent),void $((e=>({...e,spoiler:!1})))}const e=A();document.execCommand("insertHTML",!1,`<span class="spoiler" data-entity-type="${r.Vv.Spoiler}">${e}</span>`),Z()}),[F,A,Z,f,L.spoiler]),X=(0,a.I4)((()=>{$((e=>(document.execCommand(e.bold?"removeFormat":"bold"),Object.keys(e).forEach((t=>{"italic"!==t&&"underline"!==t||!Boolean(e[t])||document.execCommand(t)})),O(),{...e,bold:!e.bold})))}),[O]),Y=(0,a.I4)((()=>{document.execCommand("italic"),O(),$((e=>({...e,italic:!e.italic})))}),[O]),_=(0,a.I4)((()=>{document.execCommand("underline"),O(),$((e=>({...e,underline:!e.underline})))}),[O]),V=(0,a.I4)((()=>{if(L.strikethrough){const e=F();if(!f||!e||"DEL"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void $((e=>({...e,strikethrough:!1})))}const e=A();document.execCommand("insertHTML",!1,`<del>${e}</del>`),Z()}),[F,A,Z,f,L.strikethrough]),K=(0,a.I4)((()=>{if(L.monospace){const e=F();if(!f||!e||"CODE"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void $((e=>({...e,monospace:!1})))}const e=A();document.execCommand("insertHTML",!1,`<code class="text-entity-code" dir="auto">${e}</code>`),Z()}),[F,A,Z,f,L.monospace]),j=(0,a.I4)((()=>{const e=((0,s.X)(k)||"").split("%").map(encodeURI).join("%");if(S){const t=F();if(!t||"A"!==t.tagName)return;return t.href=e,void Z()}const t=A();D(),document.execCommand("insertHTML",!1,`<a href=${e} class="text-entity-link" dir="auto">${t}</a>`),Z()}),[F,A,S,k,Z,D]),z=(0,a.I4)((e=>{const t={k:w,b:X,u:_,i:Y,m:K,s:V,p:B}[function(e){const t="key"in e?e.key:e.code;return t.startsWith("Key")?t.slice(3).toLowerCase():t}(e)];!e.altKey&&(e.ctrlKey||e.metaKey)&&t&&(e.preventDefault(),e.stopPropagation(),t())}),[w,X,_,Y,K,V,B]);(0,a.d4)((()=>(t&&document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z))),[t,z]);const H=(0,m.Z)();if(!y)return;const W=(0,i.Z)("TextFormatter",C,b&&"link-control-shown"),J=(0,i.Z)("TextFormatter-link-url-confirm",Boolean(k.length)&&"shown"),q=n?`left: ${n.x}px; top: ${n.y}px;--text-formatter-left: ${n.x}px;`:"";return a.ZP.createElement("div",{ref:P,className:W,style:q,onKeyDown:function(e){"Enter"===e.key&&b&&(j(),e.preventDefault())}},a.ZP.createElement("div",{className:"TextFormatter-buttons"},a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Spoiler text",className:U("spoiler"),onClick:B},a.ZP.createElement("i",{className:"icon-eye-closed"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Bold text",className:U("bold"),onClick:X},a.ZP.createElement("i",{className:"icon-bold"})),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Italic text",className:U("italic"),onClick:Y},a.ZP.createElement("i",{className:"icon-italic"})),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Underlined text",className:U("underline"),onClick:_},a.ZP.createElement("i",{className:"icon-underlined"})),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Strikethrough text",className:U("strikethrough"),onClick:V},a.ZP.createElement("i",{className:"icon-strikethrough"})),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Monospace text",className:U("monospace"),onClick:K},a.ZP.createElement("i",{className:"icon-monospace"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:H("TextFormat.AddLinkTitle"),onClick:w},a.ZP.createElement("i",{className:"icon-link"}))),a.ZP.createElement("div",{className:"TextFormatter-link-control"},a.ZP.createElement("div",{className:"TextFormatter-buttons"},a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:H("Cancel"),onClick:N},a.ZP.createElement("i",{className:"icon-arrow-left"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement("div",{className:(0,i.Z)("TextFormatter-link-url-input-wrapper",T)},a.ZP.createElement("input",{ref:E,className:"TextFormatter-link-url-input",type:"text",value:k,placeholder:"Enter URL...",autoComplete:"off",inputMode:"url",dir:"auto",onChange:function(e){I(e.target.value),R()},onScroll:R})),a.ZP.createElement("div",{className:J},a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:H("Save"),className:"color-primary",onClick:j},a.ZP.createElement("i",{className:"icon-check"}))))))}))},21262:(e,t,n)=>{async function a(e){const t=[];function n(e,a){return new Promise((r=>{if(e instanceof File)t.push(e),r(e);else if(e.isFile){const n=a.getAsFile();e.file((e=>{t.push(e),r(e)}),(()=>{n&&t.push(n),r(n)}))}else e.isDirectory&&e.createReader().readEntries((e=>{const t=[];for(let r=0;r<e.length;r++)t.push(n(e[r],a));r(Promise.all(t))}))}))}const a=[];for(let t=0;t<e.length;t++){const r=e[t];if("file"===r.kind){const e=r.webkitGetAsEntry()||r.getAsFile();e&&a.push(n(e,r))}}return await Promise.all(a),t.map(r)}function r(e){const t=e.name.split(".").pop();return e.type||"mov"!==t.toLowerCase()?e:new File([e],e.name,{type:"video/quicktime"})}n.d(t,{Z:()=>a})},52400:(e,t,n)=>{n.d(t,{_:()=>s});const a=/(<br>|<br\s?\/>)/g,r=/( |\u00A0)/g,o=/(<div>|<\/div>)/gi,i=/\n$/i;function s(e){return e.replace(r," ").replace(a,"\n").replace(o,"").replace(i,"")}},96391:(e,t,n)=>{function a(e,t){const{commonAncestorContainer:n}=e;let a=n,r=1;for(;a&&a.id!==t&&r<5;)a=a.parentElement,r++;return Boolean(a&&a.id===t)}n.d(t,{R:()=>a})},72162:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(14050),r=n(83716),o=n(70735),i=n(52400),s=n(34284),l=n(65723),c=n(60782);const d=new WeakMap;function u(e){return function(){const t=d.get(e);for(var n=arguments.length,a=new Array(n),r=0;r<n;r++)a[r]=arguments[r];if(t&&(0,c.et)(t.lastArgs,a))return t.lastResult;const o=e(...a);return d.set(e,{lastArgs:a,lastResult:o}),o}}var m=n(60706),h=n(32340);let v,p,f,g;const Z=u((function(e,t,n){return e&&t.length?Object.values((0,c.q0)(e,t)).slice(0,n):o.D})),P=u((function(e,t,n){const a=Object.values(e),r=(0,c.ee)(a,"native"),o=t?(0,c.Q8)(t,(e=>Object.values((0,c.q0)(r,e)))):{},i=n?(0,c.Q8)(n,(e=>Object.values((0,c.q0)(r,e)))):{},s={...o,...i},l=[].concat(Object.keys(o),Object.keys(i)),d=a.reduce(((e,t)=>(t.names.forEach((n=>{e[n]||(e[n]=[]),e[n].push(t)})),e)),{});return{byKeyword:s,keywords:l,byName:d,names:Object.keys(d)}})),E=u((function(e,t,n){const{byKeyword:a,keywords:r,byName:i,names:s}=e;let l=o.D;const d=r.filter((e=>e.startsWith(t))).sort();l=l.concat(Object.values((0,c.q0)(a,d)).flat());const u=s.filter((e=>e.startsWith(t)));return l=l.concat(Object.values((0,c.q0)(i,u)).flat()),l=(0,c.Tw)(l),l.slice(0,n)}));try{g=/(^|\s):[-+_:\p{L}\p{N}]*$/giu}catch(e){g=/(^|\s):[-+_:\d\wа-яё]*$/gi}function y(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r.R2,s=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,d=arguments.length>6?arguments[6]:void 0,u=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const[v,p,g]=(0,m.Z)(),[y,w]=(0,a.eJ)(),[N,k]=(0,a.eJ)(!1),[I,S]=(0,a.eJ)(o.D);(0,a.d4)((()=>{if(u)return;const e=()=>{w(f.emojis)};f?e():b().then(e)}),[u]);const M=t.current;(0,a.d4)((()=>{if(!e||!M||!y||u)return void g();const t=M.includes(":")&&C(M);if(!t)return S(o.D),void g();const a=t.length>2&&t.endsWith(":"),r=t.substr(1,a?t.length-2:void 0);let i=o.D;if(k(a),r){if(r.length>=2){const e=P(y,c,d);i=E(e,r,36)}}else i=Z(y,n,36);i.length?(a||p(),S(i)):g()}),[y,M,e,p,n,g,k,u,c,d]);const T=(0,a.I4)(((e,n)=>{const a=t.current,o=a.lastIndexOf(":",n?a.lastIndexOf(":")-1:void 0);if(-1!==o){let t;s(`${a.substr(0,o)}${(0,h.Z)(e,["emoji_html"])}`),t=i===r.R2?document.querySelector(r.Ed):document.getElementById(i),requestAnimationFrame((()=>{(0,l.Z)(t,!0,!0)}))}g()}),[t,i,s,g]);return(0,a.d4)((()=>{v&&N&&I.length&&T(I[0].native,!0)}),[I,T,v,N]),{isEmojiTooltipOpen:v,closeEmojiTooltip:g,filteredEmojis:I,insertEmoji:T}}function C(e){const t=(0,i._)(e).match(g);return t?t[0].trim():void 0}async function b(){return v||(v=n.e(7501).then(n.t.bind(n,47501,19)),p=(await v).default,f=(0,s.NM)(p)),v}},29295:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(14050),r=n(33555),o=n(6137),i=n(83716),s=n(83158),l=n(52400),c=n(65723),d=n(60706),u=n(60782);const m=(0,n(69118).P2)((e=>e()),500,!0);let h;try{h=/(^|\s)@[-_\p{L}\p{M}\p{N}]*$/giu}catch(e){h=/(^|\s)@[-_\d\wа-яё]*$/gi}function v(e,t,n){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i.R2,h=arguments.length>4?arguments[4]:void 0,v=arguments.length>5?arguments[5]:void 0,g=arguments.length>6?arguments[6]:void 0;const[Z,P,E]=(0,d.Z)(),[y,C]=(0,a.eJ)(),b=(0,a.I4)(((e,t)=>{const n=(0,r.Rd)().users.byId;(h||v)&&n?m((()=>{const a=null==h?void 0:h.reduce(((e,t)=>(t.userId!==g&&e.push(t.userId),e)),[]),r=(0,s.kK)((0,u.Tw)([...t&&v||[],...a||[]]),n,e);C(Object.values((0,u.q0)(n,r)))})):C(void 0)}),[g,h,v]),w=t.current;(0,a.d4)((()=>{if(!e||!w.length)return void E();const t=w.includes("@")&&p(w);if(t){const e=t?t.substr(1):"";b(e,f(w))}else E()}),[e,b,P,E,w]),(0,a.d4)((()=>{null!=y&&y.length?P():E()}),[P,E,y]);const N=(0,a.I4)((function(e){let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.username&&!(0,s.Vl)(e))return;const r=e.username?`@${e.username}`:`<a\n class="text-entity-link"\n data-entity-type="${o.Vv.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n dir="auto"\n >${(0,s.Vl)(e)}</a>`,i=t.current,d=i.lastIndexOf("@");if(-1!==d){n(`${i.substr(0,d)}${r} `);const e=document.getElementById(l);requestAnimationFrame((()=>{(0,c.Z)(e,a)}))}E()}),[t,l,n,E]);return{isMentionTooltipOpen:Z,closeMentionTooltip:E,insertMention:N,mentionFilteredUsers:y}}function p(e){const t=(0,l._)(e).match(h);return t?t[0].trim():void 0}function f(e){return e.startsWith("@")}},17891:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(29290),o=n(65326);function i(e,t){const n=void 0===t,i=(0,a.sO)(n),s=(0,a.sO)(),l=(0,o.Z)();return(0,r.Z)((()=>{n||(i.current=!1,s.current&&(clearTimeout(s.current),s.current=void 0))}),e),(0,a.d4)((()=>{if(n||i.current)return;const e=()=>{i.current=!0,l()};t>0?s.current=window.setTimeout(e,t):e()}),e),i.current}},51218:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(14050),r=n(14605);const o=(0,a.X$)((e=>{let{id:t,options:n,selected:o=[],disabled:i,round:s,loadingOptions:l,onChange:c}=e;const[d,u]=(0,a.eJ)(o||[]),m=(0,a.I4)((e=>{const{value:t,checked:n}=e.currentTarget;let a;a=n?[...d,t]:d.filter((e=>e!==t)),u(a),c(a)}),[c,d]);return a.ZP.createElement("div",{id:t,className:"radio-group"},n.map((e=>a.ZP.createElement(r.Z,{label:e.label,subLabel:e.subLabel,value:e.value,checked:-1!==o.indexOf(e.value),disabled:i,round:s,isLoading:l?-1!==l.indexOf(e.value):void 0,onChange:m}))))}))},17551:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(14050),r=n(59107),o=n(72313),i=n(13103),s=n(231);const l=(0,a.X$)((e=>{let{isOpen:t,onClose:n,onCloseAnimationEnd:l,title:c,header:d,text:u,textParts:m,confirmLabel:h="Confirm",confirmHandler:v,confirmIsDestructive:p,isButtonsInOneRow:f,children:g}=e;const Z=(0,r.Z)(),P=(0,a.sO)(null),E=(0,a.I4)((e=>{-1===e&&v()}),[v]),y=(0,o.Z)(P,t,E,".Button");return a.ZP.createElement(i.Z,{className:"confirm",title:c||Z("Telegram"),header:d,isOpen:t,onClose:n,onCloseAnimationEnd:l},u&&u.split("\\n").map((e=>a.ZP.createElement("p",null,e))),m||g,a.ZP.createElement("div",{className:f?"dialog-buttons mt-2":"",ref:P,onKeyDown:y},a.ZP.createElement(s.Z,{className:"confirm-dialog-button",isText:!0,onClick:v,color:p?"danger":"primary"},h),a.ZP.createElement(s.Z,{className:"confirm-dialog-button",isText:!0,onClick:n},Z("Cancel"))))}))},41151:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(46752),o=n(231);const i=e=>{let{isShown:t,className:n,color:i="primary",ariaLabel:s,disabled:l,onClick:c,children:d}=e;const u=(0,r.Z)("FloatingActionButton",t&&"revealed",n);return a.ZP.createElement(o.Z,{className:u,color:i,round:!0,disabled:l,onClick:t&&!l?c:void 0,ariaLabel:s,tabIndex:-1},d)}},31876:(e,t,n)=>{n.d(t,{Z:()=>p});var a=n(14050),r=n(77361),o=n(69118),i=n(46752),s=n(17240),l=n(63394),c=n(60706),d=n(59107),u=n(68512),m=n(52328),h=n(58964),v=n(231);const p=e=>{let{ref:t,buttonRef:n,icon:p,leftElement:f,buttonClassName:g,secondaryIcon:Z,className:P,style:E,children:y,disabled:C,ripple:b,narrow:w,inactive:N,focus:k,destructive:I,multiline:S,isStatic:M,contextActions:T,onMouseDown:x,onClick:L,onSecondaryIconClick:$,onDragEnter:D}=e,O=(0,a.sO)(null);t&&(O=t);const[A,F,R]=(0,c.Z)(),{isContextMenuOpen:U,contextMenuPosition:B,handleBeforeContextMenu:X,handleContextMenu:Y,handleContextMenuClose:_,handleContextMenuHide:V}=(0,s.Z)(O,!T),K=(0,a.I4)((()=>O.current),[]),j=(0,a.I4)((()=>O.current.closest(".custom-scroll")),[]),z=(0,a.I4)((()=>O.current.querySelector(".ListItem-context-menu .bubble")),[]),{positionX:H,positionY:W,transformOriginX:J,transformOriginY:q,style:G}=(0,l.Z)(B,K,j,z),Q=(0,a.I4)((e=>{!C&&L&&(L(e),r.$b&&!b&&(F(),(0,o.T2)(R)))}),[C,F,L,b,R]),ee=e=>{C||0!==e.button||!$&&!T||(e.stopPropagation(),$?$(e):Y(e))},te=(0,a.I4)((e=>{N||r.$b||(!T||2!==e.button&&L||X(e),0===e.button&&(L?Q(e):Y(e)))}),[N,T,L,X,Y,Q]),ne=(0,d.Z)(),ae=(0,i.Z)("ListItem",P,!M&&"no-selection",b&&"has-ripple",w&&"narrow",C&&"disabled",N&&"inactive",B&&"has-menu-open",k&&"focus",I&&"destructive",S&&"multiline",M&&"is-static");return a.ZP.createElement("div",{ref:O,className:ae,dir:ne.isRtl?"rtl":void 0,style:E,onMouseDown:x,onDragEnter:D},a.ZP.createElement("div",{className:(0,i.Z)("ListItem-button",A&&"active",g),role:M?void 0:"button",ref:n,tabIndex:M?void 0:0,onClick:!N&&r.$b?Q:void 0,onMouseDown:te,onContextMenu:!N&&T?Y:void 0},f,p&&a.ZP.createElement("i",{className:`icon-${p}`}),S&&a.ZP.createElement("div",{className:"multiline-item"},y),!S&&y,!C&&!N&&b&&a.ZP.createElement(u.Z,null),Z&&a.ZP.createElement(v.Z,{className:"secondary-icon",round:!0,color:"translucent",size:"smaller",onClick:r.$b?ee:void 0,onMouseDown:r.$b?void 0:ee},a.ZP.createElement("i",{className:`icon-${Z}`}))),T&&void 0!==B&&a.ZP.createElement(m.Z,{isOpen:U,transformOriginX:J,transformOriginY:q,positionX:H,positionY:W,style:G,className:"ListItem-context-menu",autoClose:!0,onClose:_,onCloseAnimationEnd:V},T.map((e=>a.ZP.createElement(h.Z,{key:e.title,icon:e.icon,destructive:e.destructive,disabled:!e.handler,onClick:e.handler},e.title)))))}},96937:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(14050),r=n(83716),o=n(31212),i=n(46752),s=n(23989),l=n(62898),c=n(231);const d=3e3,u=e=>{let{title:t,className:n,message:u,duration:m=d,containerId:h,onDismiss:v,action:p,actionText:f}=e;const[g,Z]=(0,a.eJ)(!0),P=(0,a.sO)(null),{transitionClassNames:E}=(0,o.Z)(g),y=(0,a.I4)((()=>{Z(!1),setTimeout(v,150+r.fK)}),[v]);(0,a.d4)((()=>g?(0,s.Z)(y):void 0),[g,y]),(0,a.d4)((()=>(P.current=window.setTimeout(y,m),()=>{P.current&&(clearTimeout(P.current),P.current=void 0)})),[m,y]);const C=(0,a.I4)((()=>{P.current&&(clearTimeout(P.current),P.current=void 0)}),[]),b=(0,a.I4)((()=>{P.current=window.setTimeout(y,m)}),[m,y]);return a.ZP.createElement(l.Z,{className:"Notification-container",containerId:h},a.ZP.createElement("div",{className:(0,i.Z)("Notification",E,n),onClick:function(){null==p||p(),y()},onMouseEnter:C,onMouseLeave:b},a.ZP.createElement("div",{className:"content"},t&&a.ZP.createElement("div",{className:"notification-title"},t),u),p&&f&&a.ZP.createElement(c.Z,{color:"translucent-white",onClick:p,className:"Notification-button"},f)))}},39196:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(46752);const o={s:22,m:25,l:28,xl:20},i=(0,a.X$)((e=>{let{progress:t=0,size:n="l",square:i,transparent:s,noCross:l,onClick:c}=e;const d=o[n],u=d-4,m=d-1,h=2*u*Math.PI,v=(0,a.sO)(null);(0,a.d4)((()=>{if(!v.current)return;const e=v.current.firstElementChild,n=h-Math.min(Math.max(.05,t),1)*h;e?e.firstElementChild.setAttribute("stroke-dashoffset",n.toString()):v.current.innerHTML=`<svg\n viewBox="0 0 ${2*m} ${2*m}"\n height="${2*m}"\n width="${2*m}"\n >\n <circle\n stroke="white"\n fill="transparent"\n stroke-width=2\n stroke-dasharray="${h} ${h}"}\n stroke-dashoffset="${n}"\n stroke-linecap="round"\n r=${u}\n cx=${m}\n cy=${m}\n />\n </svg>`}),[v,h,m,u,t]);const p=(0,r.Z)(`ProgressSpinner size-${n}`,s&&"transparent",i&&"square",l&&"no-cross");return a.ZP.createElement("div",{ref:v,className:p,onClick:c})}))},14434:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(14050),r=n(46752),o=n(59107),i=n(49204);const s=(0,a.X$)((e=>{let{id:t,label:n,subLabel:s,value:l,name:c,checked:d,disabled:u,hidden:m,isLoading:h,onChange:v}=e;const p=(0,o.Z)(),f=(0,r.Z)("Radio",u&&"disabled",m&&"hidden-widget",h&&"loading");return a.ZP.createElement("label",{className:f,dir:p.isRtl?"rtl":void 0},a.ZP.createElement("input",{type:"radio",name:c,value:l,id:t,checked:d,onChange:v,disabled:u||m}),a.ZP.createElement("div",{className:"Radio-main"},a.ZP.createElement("span",{className:"label",dir:p.isRtl?"auto":void 0},n),s&&a.ZP.createElement("span",{className:"subLabel",dir:p.isRtl?"auto":void 0},s)),h&&a.ZP.createElement(i.Z,null))})),l=(0,a.X$)((e=>{let{id:t,name:n,options:r,selected:o,disabled:i,loadingOption:l,onChange:c}=e;const d=(0,a.I4)((e=>{const{value:t}=e.currentTarget;c(t,e)}),[c]);return a.ZP.createElement("div",{id:t,className:"radio-group"},r.map((e=>a.ZP.createElement(s,{name:n,label:e.label,subLabel:e.subLabel,value:e.value,checked:e.value===o,hidden:e.hidden,disabled:i,isLoading:l?l===e.value:void 0,onChange:d}))))}))},18051:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(46752),o=n(59107);const i=(0,a.X$)((e=>{let{options:t,min:n=0,max:i=(t?t.length-1:100),step:s=1,label:l,value:c,disabled:d,bold:u,className:m,renderValue:h,onChange:v}=e;const p=(0,o.Z)(),f=(0,a.I4)((e=>{v(Number(e.currentTarget.value))}),[v]),g=(0,r.Z)(m,"RangeSlider",d&&"disabled",u&&"bold"),Z=(0,a.Ye)((()=>t?c/(t.length-1)*100:(c-n)/((i-n)/s)*100),[t,c,i,n,s]);return a.ZP.createElement("div",{className:g},l&&a.ZP.createElement("div",{className:"slider-top-row",dir:p.isRtl?"rtl":void 0},a.ZP.createElement("span",{className:"label",dir:"auto"},l),!t&&a.ZP.createElement("span",{className:"value",dir:"auto"},h?h(c):c)),a.ZP.createElement("div",{className:"slider-main"},a.ZP.createElement("div",{className:"slider-fill-track",style:`width: ${Z}%`}),a.ZP.createElement("input",{min:n,max:i,value:c,step:s,type:"range",className:"RangeSlider__input",onChange:f}),t&&a.ZP.createElement("div",{className:"slider-options"},t.map(((e,t)=>a.ZP.createElement("div",{className:(0,r.Z)("slider-option no-selection",t===c&&"active"),onClick:()=>v(t)},e))))))}))},69589:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(14050),r=n(46752),o=n(60706),i=n(59107),s=n(12515),l=n(34288),c=n(231),d=n(40126);const u=(0,a.X$)((e=>{let{ref:t,children:n,parentContainerClassName:u,value:m,inputId:h,className:v,focused:p,isLoading:f,spinnerColor:g,spinnerBackgroundColor:Z,placeholder:P,disabled:E,autoComplete:y,canClose:C,autoFocusSearch:b,onChange:w,onReset:N,onFocus:k,onBlur:I,onSpinnerClick:S}=e,M=(0,a.sO)(null);t&&(M=t);const[T,x,L]=(0,o.Z)(p);(0,s.Z)(M,b,L),(0,a.d4)((()=>{M.current&&(p?M.current.focus():M.current.blur())}),[p,P]);const $=(0,i.Z)(),D=(0,a.I4)((e=>{if("ArrowDown"===e.key||"Enter"===e.key){const e=document.querySelector(`.${u} .ListItem-button`);e&&e.focus()}}),[u]);return a.ZP.createElement("div",{className:(0,r.Z)("SearchInput",v,T&&"has-focus"),dir:$.isRtl?"rtl":void 0},n,a.ZP.createElement("input",{ref:M,id:h,type:"text",dir:"auto",placeholder:P||$("Search"),className:"form-control",value:m,disabled:E,autoComplete:y,onChange:function(e){const{currentTarget:t}=e;w(t.value)},onFocus:function(){x(),k&&k()},onBlur:function(){L(),I&&I()},onKeyDown:D}),a.ZP.createElement("i",{className:"icon-search"}),a.ZP.createElement(d.Z,{isOpen:Boolean(f),className:"slow"},a.ZP.createElement(l.Z,{color:g,backgroundColor:Z,onClick:S})),!f&&(m||C)&&N&&a.ZP.createElement(c.Z,{round:!0,size:"tiny",color:"translucent",onClick:N},a.ZP.createElement("span",{className:"icon-close"})))}))},40126:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(14050),r=n(31212),o=n(87204),i=n(46752);const s=e=>{let{isOpen:t,isCustom:n,id:s,className:l,onClick:c,children:d}=e;const{shouldRender:u,transitionClassNames:m}=(0,r.Z)(t,void 0,void 0,!n&&void 0),h=(0,o.Z)(t),v=(0,o.Z)(d),p=(0,a.sO)();return h&&!t&&(p.current=v),u&&a.ZP.createElement("div",{id:s,className:(0,i.Z)(l,m),onClick:c},t?d:p.current)}},17921:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(46752),o=n(80036);const i=e=>{let{variant:t="rectangular",animation:n="wave",width:i,height:s,forceAspectRatio:l,className:c}=e;const d=(0,r.Z)("Skeleton",t,n,c),u=l?i&&s?`aspect-ratio: ${i}/${s}`:void 0:(0,o.Z)(Boolean(i)&&`width: ${i}px`,Boolean(s)&&`height: ${s}px`);return a.ZP.createElement("div",{className:d,style:u})}},83321:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(14050),r=n(46752);const o=(0,a.X$)((e=>{let{id:t,name:n,value:o,label:i,checked:s=!1,disabled:l,inactive:c,noAnimation:d,onChange:u,onCheck:m}=e;const h=(0,a.I4)((e=>{u&&u(e),m&&m(e.currentTarget.checked)}),[u,m]),v=(0,r.Z)("Switcher",l&&"disabled",c&&"inactive",d&&"no-animation");return a.ZP.createElement("label",{className:v,title:i},a.ZP.createElement("input",{type:"checkbox",id:t,name:n,value:o,checked:s,disabled:l,onChange:h}),a.ZP.createElement("span",{className:"widget"}))}))},93133:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(14050),r=n(83716),o=n(77361),i=n(81367),s=n(87204),l=n(78781),c=n(59107),d=n(46752),u=n(82972),m=n(32340);const h="Tab--active",v=(0,a.X$)((e=>{let{className:t,title:n,isActive:r,isBlocked:o,badgeCount:i,isBadgeActive:s,previousActiveTab:l,onClick:c,clickArg:v}=e;const p=(0,a.sO)(null);return(0,a.d4)((()=>{if(r&&void 0===l&&p.current&&p.current.classList.add(h),!r||void 0===l)return;const e=p.current,t=e.parentElement.children[l];if(!t)return;const n=e.querySelector(".platform"),a=t.querySelector(".platform"),o=a.parentElement.offsetLeft-n.parentElement.offsetLeft,i=a.clientWidth/n.clientWidth;a.classList.remove("animate"),n.classList.remove("animate"),n.style.transform=`translate3d(${o}px, 0, 0) scale3d(${i}, 1, 1)`,(0,u.Z)(n),n.classList.add("animate"),n.style.transform="none",t.classList.remove(h),e.classList.add(h)}),[r,l]),a.ZP.createElement("div",{className:(0,d.Z)("Tab",t),onClick:()=>c(v),ref:p},a.ZP.createElement("span",null,(0,m.Z)(n),Boolean(i)&&a.ZP.createElement("span",{className:(0,d.Z)("badge",s&&"Tab__badge--active")},i),o&&a.ZP.createElement("i",{className:"icon-lock-badge blocked"}),a.ZP.createElement("i",{className:"platform"})))})),p=o.cj?450:o.wZ?400:300,f=(0,a.X$)((e=>{let{tabs:t,areFolders:n,activeTab:o,big:d,onSwitchTab:u}=e;const m=(0,a.sO)(null),h=(0,s.Z)(o);(0,l.Z)(m.current,void 0,!0),(0,a.d4)((()=>{const e=m.current,{scrollWidth:t,offsetWidth:n,scrollLeft:a}=e;if(t<=n)return;const r=e.childNodes[o];if(!r)return;const{offsetLeft:s,offsetWidth:l}=r,c=s-n/2+l/2;Math.abs(c-a)<16||(0,i.Z)(e,c,p)}),[o]);const f=(0,c.Z)();return a.ZP.createElement("div",{className:"TabList no-selection no-scrollbar "+(d?"big":""),ref:m,dir:f.isRtl?"rtl":void 0},t.map(((e,t)=>{var i;return a.ZP.createElement(v,{key:null!==(i=e.id)&&void 0!==i?i:e.title,title:n&&e.id!==r.Nf?e.title:f(e.title),isActive:t===o,isBlocked:e.isBlocked,badgeCount:e.badgeCount,isBadgeActive:e.isBadgeActive,previousActiveTab:h,onClick:u,clickArg:t})})))}))},53455:(e,t,n)=>{n.d(t,{Yy:()=>i,ZP:()=>h,fi:()=>o,vb:()=>c});var a=n(91090),r=n(60782);const o=[{icon:"user",title:"FilterContacts",key:"contacts"},{icon:"non-contacts",title:"FilterNonContacts",key:"nonContacts"},{icon:"group",title:"FilterGroups",key:"groups"},{icon:"channel",title:"FilterChannels",key:"channels"},{icon:"bots",title:"FilterBots",key:"bots"}],i=[{icon:"mute",title:"FilterMuted",key:"excludeMuted"},{icon:"archive",title:"FilterArchived",key:"excludeArchived"},{icon:"readchats",title:"FilterRead",key:"excludeRead"}],s=["includedChatIds","bots","channels","groups","contacts","nonContacts"],l=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function c(e,t,n){let a=[],o=[];if("included"===t){const{includedChatIds:t,...i}=n?e.includeFilters||{}:(0,r.ei)(e.folder,s);a=t||[],o=Object.keys(i).filter((e=>Boolean(i[e])))}else{const{excludedChatIds:t,...i}=n?e.excludeFilters||{}:(0,r.ei)(e.folder,l);a=t||[],o=Object.keys(i).filter((e=>Boolean(i[e])))}return{selectedChatIds:a,selectedChatTypes:o}}function d(e){if(e){const{includedChatIds:t,...n}=e;if(Object.values(n).filter(Boolean).length>1||null!=t&&t.length)return"";if(n.bots)return"Bots";if(n.groups)return"Groups";if(n.channels)return"Channels";if(n.contacts)return"Contacts";if(n.nonContacts)return"Non-Contacts"}return""}const u={mode:"create",chatFilter:"",folder:{title:"",includedChatIds:[],excludedChatIds:[]}},m=(e,t)=>{switch(t.type){case"setTitle":return{...e,folder:{...e.folder,title:t.payload},isTouched:!0};case"editIncludeFilters":return{...e,includeFilters:(0,r.ei)(e.folder,s)};case"editExcludeFilters":return{...e,excludeFilters:(0,r.ei)(e.folder,l)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...(0,r.CE)(e.folder,s),title:e.folder.title?e.folder.title:d(e.includeFilters),...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...(0,r.CE)(e.folder,l),...e.excludeFilters},excludeFilters:void 0,chatFilter:"",isTouched:!0}:e;case"editFolder":{const{id:e,description:n,...a}=t.payload;return{mode:"edit",folderId:e,folder:a,chatFilter:""}}case"setChatFilter":return{...e,chatFilter:t.payload};case"setIsLoading":return{...e,isLoading:t.payload};case"setError":return{...e,error:t.payload};case"reset":return u;default:return e}},h=()=>(0,a.Z)(m,u)},23186:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(14050),r=n(33555),o=n(83716),i=n(10396),s=n(85266),l=n(64532),c=n(274),d=n(29290);function u(e){let t={};if(e&&e.current){const{play:n,pause:a,setCurrentTime:o,proxy:i,requestNextTrack:s,requestPreviousTrack:l,isFirst:c,isLast:d}=e.current;t={play:()=>{n(i.src)},pause:()=>{a()},stop:()=>{a(),o(0),(0,r.Sv)().closeAudioPlayer()},seekbackward:e=>{const t=e.seekOffset||10;o(Math.max(i.currentTime-t,0))},seekforward:e=>{const t=e.seekOffset||10;o(Math.min(i.currentTime+t,i.duration))},seekTo:e=>{e.seekTime&&o(e.seekTime)}},d()||(t.nexttrack=()=>{s()}),c()||(t.previoustrack=()=>{l()})}return t}const m=function(e,t,n,m,h,v,p){let f=arguments.length>7&&void 0!==arguments[7]&&arguments[7],g=arguments.length>8?arguments[8]:void 0,Z=arguments.length>9?arguments[9]:void 0,P=arguments.length>10&&void 0!==arguments[10]&&arguments[10],E=arguments.length>11&&void 0!==arguments[11]&&arguments[11];const y=(0,a.sO)(null),[C,b]=(0,a.eJ)(!1);let w=C;const[N,k]=(0,a.eJ)(0),I=(0,a.I4)((()=>{b(!1),Z&&Z()}),[Z]);(0,d.Z)((()=>{y.current=(0,i.z2)(e,n,((e,a)=>{var i;switch(e){case"onPlay":{const{setVolume:e,setPlaybackRate:a,toggleMuted:i,proxy:s}=y.current;b(!0),(0,l.N)(v,u(y)),(0,l.pC)("playing"),e((0,r.Rd)().audioPlayer.volume),i(Boolean((0,r.Rd)().audioPlayer.isMuted));const c=s.duration&&Number.isFinite(s.duration)?s.duration:t;("voice"===n||c>o.J0)&&a((0,r.Rd)().audioPlayer.playbackRate),(0,l.NS)({duration:s.duration||0,playbackRate:s.playbackRate,position:s.currentTime});break}case"onRateChange":{const{proxy:e}=y.current;(0,l.NS)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":b(!1),(0,l.pC)("paused");break;case"onTimeUpdate":{const{proxy:e}=y.current,n=e.duration&&Number.isFinite(e.duration)?e.duration:t;E||k(e.currentTime/n);break}case"onEnded":(0,l.pC)("paused")}null==h||null===(i=h[e])||void 0===i||i.call(h,a)}),g,I);const{proxy:a}=y.current;C||a.paused||(b(!0),w=!0),p&&p(a)}),[e]),(0,a.d4)((()=>{C&&v&&(0,l.Ym)(v)}),[v,C]);const{play:S,pause:M,setCurrentTime:T,proxy:x,destroy:L,setVolume:$,stop:D,isFirst:O,isLast:A,requestNextTrack:F,requestPreviousTrack:R,setPlaybackRate:U,toggleMuted:B}=y.current,X=x.duration&&Number.isFinite(x.duration)?x.duration:t;(0,a.d4)((()=>{!X||(0,s.z)(x)||E||k(x.currentTime/X)}),[X,N,x,E]),(0,a.d4)((()=>()=>{L(P)}),[L,P]),(0,c.Z)((e=>{let[t,n]=e;t===f&&m===n||x.src&&x.paused||f&&m&&!C&&S(m)}),[f,m,C,S,x.src,x.paused]);const Y=(0,a.I4)((()=>{m&&S(m)}),[m,S]),_=(0,a.I4)((()=>{C?M():Y()}),[M,Y,C]),V=(0,a.I4)((e=>{T(e),X&&k(x.currentTime/X)}),[X,x,T]);return{isPlaying:w,playProgress:N,playPause:_,pause:M,play:Y,stop:D,setCurrentTime:V,setVolume:$,audioProxy:x,duration:X,requestNextTrack:F,requestPreviousTrack:R,isFirst:O,isLast:A,setPlaybackRate:U,toggleMuted:B}}},12019:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(14050),r=n(69118),o=n(85266);function i(e,t){const n=[];for(let a=0;a<e.length;a++)n.push({start:e.start(a)/t,end:e.end(a)/t});return n}const s=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const[t,n]=(0,a.eJ)(!e),[s,l]=(0,a.eJ)(0),[c,d]=(0,a.eJ)([]),u=(0,a.Ye)((()=>(0,r.Ds)(n,200,!1,!0)),[]),m=(0,a.I4)((e=>{const t=e.currentTarget;if(!(0,o.z)(t)){if(t.buffered.length){const e=i(t.buffered,t.duration);d(e);const n=e.reduce(((e,t)=>{let{start:n,end:a}=t;return e+a-n}),0);l(n/t.duration)}u(t.readyState>=3||t.currentTime>0)}}),[u]),h={onLoadedData:m,onPlaying:m,onLoadStart:m,onPause:m,onTimeUpdate:m,onProgress:m};return{isBuffered:t,bufferedProgress:s,bufferedRanges:c,bufferingHandlers:h,checkBuffering(e){u(e.readyState>=3)}}}},15866:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(14050),r=n(96264),o=n(65326),i=n(77361);function s(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;const s=(0,a.sO)(null),l=(0,o.Z)();return(0,a.d4)((()=>{const a=s.current;if(!e||!a||t)return;const o=new Image,l=()=>{a.width=o.width,a.height=o.height;const e=a.getContext("2d",{alpha:!1});i.vX&&(e.filter="blur(2px)"),e.drawImage(o,-4,-4,a.width+8,a.height+8),i.vX||(0,r.Z)(e,0,0,a.width,a.height,2,2)};o.onload=()=>{n?requestAnimationFrame(l):l()},o.src=e}),[s,e,l,t,n]),s}},41470:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(14050),r=n(33555),o=n(83716),i=n(83158),s=n(60782),l=n(59107);const c=function(e){let{chat:t,user:n,folderId:c,isPinned:d,isMuted:u,canChangeFolder:m,handleDelete:h,handleChatFolderChange:v,handleReport:p}=e,f=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const g=(0,l.Z)(),{isSelf:Z}=n||{},P=(null==n?void 0:n.id)===o.aw;return(0,a.Ye)((()=>{if(!t)return;const{toggleChatPinned:e,updateChatMutedState:a,toggleChatArchived:o,toggleChatUnread:l}=(0,r.Sv)(),E=m?{title:g("ChatList.Filter.AddToFolder"),icon:"folder",handler:v}:void 0,y=d?{title:g("UnpinFromTop"),icon:"unpin",handler:()=>e({id:t.id,folderId:c})}:{title:g("PinToTop"),icon:"pin",handler:()=>e({id:t.id,folderId:c})};if(f)return(0,s.oA)([y,E]);const C=t.unreadCount||t.hasUnreadMark?{title:g("MarkAsRead"),icon:"readchats",handler:()=>l({id:t.id})}:{title:g("MarkAsUnread"),icon:"unread",handler:()=>l({id:t.id})},b=u?{title:g("ChatList.Unmute"),icon:"unmute",handler:()=>a({chatId:t.id,isMuted:!1})}:{title:g("ChatList.Mute"),icon:"mute",handler:()=>a({chatId:t.id,isMuted:!0})},w=(0,i.pE)(t)?{title:g("Unarchive"),icon:"unarchive",handler:()=>o({id:t.id})}:{title:g("Archive"),icon:"archive",handler:()=>o({id:t.id})},N=p&&((0,i.eA)(t)||(0,i.Bf)(t)||n&&!n.isSelf)?{title:g("ReportPeer.Report"),icon:"flag",handler:p}:void 0,k={title:(0,i.YC)(t.id)?g("Delete"):g((0,i.cc)(t)?"DeleteChat":(0,i.eA)(t)?"LeaveChannel":"Group.LeaveGroup"),icon:"delete",destructive:!0,handler:h},I=void 0!==c;return(0,s.oA)([E,C,y,!Z&&b,!Z&&!P&&!I&&w,N,k])}),[t,n,m,g,v,d,f,u,h,p,c,Z,P])}},17240:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(77361);function o(e){e.stopImmediatePropagation(),e.preventDefault(),e.stopPropagation()}const i=(e,t,n,i)=>{const[s,l]=(0,a.eJ)(!1),[c,d]=(0,a.eJ)(void 0),u=(0,a.I4)((e=>{t||2!==e.button||e.target.classList.add("no-selection")}),[t]),m=(0,a.I4)((e=>{e.target.classList.remove("no-selection"),t||n&&e.target.matches("a[href]")||(e.preventDefault(),c||(l(!0),d({x:e.clientX,y:e.clientY})))}),[t,n,c]),h=(0,a.I4)((()=>{l(!1)}),[]),v=(0,a.I4)((()=>{d(void 0)}),[]);return(0,a.d4)((()=>{if(t||!r.$b||i)return;const a=e.current;if(!a)return;let s;const u=()=>{s&&(clearTimeout(s),s=void 0)},m=e=>{t||(u(),s=window.setTimeout((()=>(e=>{u();const{clientX:t,clientY:i,target:s}=e.touches[0];c||n&&s.matches("a[href]")||(a.addEventListener("touchend",(function e(t){a.removeEventListener("touchend",e,!0),o(t)}),!0),r.fl&&r.cj&&a.addEventListener("mousedown",(function e(t){a.removeEventListener("mousedown",e,!0),o(t)}),!0),l(!0),d({x:t,y:i}))})(e)),200))};return a.addEventListener("touchstart",m,{passive:!0}),a.addEventListener("touchcancel",u,!0),a.addEventListener("touchend",u,!0),a.addEventListener("touchmove",u,{passive:!0}),()=>{u(),a.removeEventListener("touchstart",m),a.removeEventListener("touchcancel",u,!0),a.removeEventListener("touchend",u,!0),a.removeEventListener("touchmove",u)}}),[c,t,i,e,n]),{isContextMenuOpen:s,contextMenuPosition:c,handleBeforeContextMenu:u,handleContextMenu:m,handleContextMenuClose:h,handleContextMenuHide:v}}},63394:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(14050);const r={width:0,left:0,height:0,top:0};function o(e,t,n,o,i){const[s,l]=(0,a.eJ)("right"),[c,d]=(0,a.eJ)("bottom"),[u,m]=(0,a.eJ)(),[h,v]=(0,a.eJ)(),[p,f]=(0,a.eJ)(!1),[g,Z]=(0,a.eJ)(""),[P,E]=(0,a.eJ)("opacity: 0;");return(0,a.d4)((()=>{const a=t();if(!e||!a)return;let{x:s,y:c}=e;const u=s,h=c,p=o(),g=n(),{extraPaddingX:P=0,extraTopPadding:y=0,marginSides:C=0,extraMarginTop:b=0}=(null==i?void 0:i())||{},w=p?parseInt(getComputedStyle(p).marginTop,10)+b:void 0,N=p?{width:p.offsetWidth,height:p.offsetHeight+w}:r,k=g?g.getBoundingClientRect():r;let I,S;s+N.width+P<k.width+k.left?(s+=3,I="left"):s-N.width>0?(I="right",s-=3):(I="left",s=16),l(I),C&&"right"===I&&s+P+C>=k.width+k.left&&(s-=C),C&&"left"===I&&(s+P+C+N.width>=k.width+k.left?s-=C:s-C<=0&&(s+=C)),c+N.height<k.height+k.top?S="top":(S="bottom",c-N.height<k.top+y&&(c=k.top+k.height)),d(S);const M=a.getBoundingClientRect(),T="left"===I?Math.min(s-M.left,k.width-N.width-16):s-M.left,x=c-M.top,L=k.height-12-(w||0);f(L<N.height),E(`max-height: ${L}px;`),Z(`left: ${T}px; top: ${x}px`);const $=u-M.left-T,D=h-M.top-x-(w||0);m("left"===I?$:N.width+$),v("bottom"===S?N.height+D:D)}),[e,o,n,t,i]),{positionX:s,positionY:c,transformOriginX:u,transformOriginY:h,style:g,menuStyle:P,withScroll:p}}},75790:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(33555),o=n(69118);const i=(e,t,n,i)=>{const{loadMessage:s}=(0,r.Sv)(),l=(0,a.Ye)((()=>{const n=(0,o.P2)(s,500,!0);return()=>{n({chatId:e,messageId:t,replyOriginForId:i})}}),[s,e,t,i]);(0,a.d4)((()=>{t&&!n&&l()}))}},95616:(e,t,n)=>{n.d(t,{d7:()=>i,mE:()=>l,yi:()=>s});var a=n(14050),r=n(16974),o=n(65326);function i(e){const t=(0,o.Z)();return(0,a.d4)((()=>(0,r.M2)(e,t)),[e,t]),(0,r.gO)(e)}function s(){const e=(0,o.Z)();return(0,a.d4)((()=>(0,r.O6)(e)),[e]),(0,r.wC)()}function l(){const e=(0,o.Z)();return(0,a.d4)((()=>(0,r.r_)(e)),[e]),(0,r.Yz)()}},78781:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(14050);const r=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,a.d4)((()=>{if(e&&!t)return e.addEventListener("wheel",a,{passive:!n}),()=>{e.removeEventListener("wheel",a)};function a(t){t.deltaX||(e.scrollLeft+=t.deltaY/4,n&&t.preventDefault())}}),[e,t,n])}},73541:(e,t,n)=>{n.d(t,{y:()=>s});var a=n(14050);var r=n(16063);const o=new Set(["INPUT","TEXTAREA","SELECT"]),i=(0,r._)();function s(e){(0,a.d4)((()=>{if(!e)return;const t=Object.entries(e);return i.addCallback((function(e){(function(e){return!(e.target instanceof HTMLElement)||!o.has(e.target.tagName)})(e)&&t.forEach((t=>{let[n,a]=t;(function(e){return t=>function(e,t){const{alt:n,ctrl:a,meta:r,mod:o,shift:i,key:s}=e,{altKey:l,ctrlKey:c,metaKey:d,shiftKey:u,key:m}=t;if(n!==l)return!1;if(o){if(!c&&!d)return!1}else{if(a!==c)return!1;if(r!==d)return!1}return i===u&&Boolean(s&&(m.toLowerCase()===s.toLowerCase()||t.code.replace("Key","").toLowerCase()===s.toLowerCase()))}(function(e){const t=e.toLowerCase().split("+").map((e=>e.trim())),n={alt:t.includes("alt"),ctrl:t.includes("ctrl"),meta:t.includes("meta"),mod:t.includes("mod"),shift:t.includes("shift")},a=["alt","ctrl","meta","shift","mod"];return{...n,key:t.find((e=>!a.includes(e)))}}(e),t)})(n)(e)&&a(e)}))}))}),[e])}document.documentElement.addEventListener("keydown",i.runCallbacks)},12515:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(14050),r=n(77361);function o(e,t,n){(0,a.d4)((()=>{t?r.wB||setTimeout((()=>{requestAnimationFrame((()=>{e.current&&e.current.focus()}))}),500):(e.current&&e.current.blur(),n&&setTimeout(n,300))}),[e,t,n])}},72645:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(14050),r=n(87204);const o=(e,t,n)=>{const o=(0,r.Z)(t);return(0,a.bt)((()=>e(o||[])),t,n)}},92566:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(14050),r=n(77361),o=n(6137),i=n(69118),s=n(40647),l=n(65326),c=n(26926);const d={},u=()=>{const e=(0,a.sO)();return e.current||(e.current=(0,c.Z)(d),d[e.current]=!0),e.current};function m(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.IU.BlobUrl,c=arguments.length>3?arguments[3]:void 0,d=arguments.length>4?arguments[4]:void 0,m=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const h=e?s.UV(e):void 0,v=n===o.IU.Stream||r.I_&&n===o.IU.Progressive,p=(0,l.Z)(),f=u(),[g,Z]=(0,a.eJ)(h&&!v?1:0),P=(0,a.sO)(),E=(0,a.Ye)((()=>(0,i.P2)((e=>{P.current&&(!d||Date.now()-P.current>d)&&Z(e)}),500,!0)),[d]);return(0,a.d4)((()=>{!t&&e&&(h?v&&setTimeout((()=>{Z(.75)}),1500):(Z(0),P.current&&s.cC(E),P.current=Date.now(),s.he(e,n,m,E,f).then((()=>{const e=Date.now()-P.current;P.current=void 0,!d||e>=d?p():setTimeout(p,d-e)}))))}),[t,e,h,n,c,p,v,d,E,m,f]),(0,a.d4)((()=>{t&&P.current&&(s.cC(E),Z(0),P.current=void 0)}),[E,t]),(0,a.d4)((()=>()=>{e&&s.Iq(e,f)}),[f,e]),{mediaData:h,loadProgress:g}}},56503:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(77361);let o;function i(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:250,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const s=(0,a.sO)(!1),l=(0,a.I4)((()=>{s.current=!0}),[]);(0,a.d4)((()=>{o&&(clearTimeout(o),o=void 0),!e||r.$b||i||(o=window.setTimeout((()=>{s.current||t()}),2*n))}),[i,e,n,t]);const c=(0,a.I4)((()=>{s.current=!0}),[]),d=(0,a.I4)((()=>{s.current=!1,o&&(clearTimeout(o),o=void 0),o=window.setTimeout((()=>{s.current||t()}),n)}),[n,t]);return[c,d,l]}},52678:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(14050),r=n(87204),o=n(65326),i=n(29290);function s(e,t){const n=(0,r.Z)(e,!0),s=(0,a.sO)(),l=(0,o.Z)(),c=null!=e,d=null!=n;return c&&s.current&&(clearTimeout(s.current),s.current=void 0),(0,i.Z)((()=>{t&&!c&&d&&!s.current&&(s.current=window.setTimeout((()=>{s.current=void 0,l()}),t))}),[e]),s.current&&t&&!c?n:e}},91090:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(14050),r=n(65326);function o(e,t){const n=(0,r.Z)(),o=(0,a.sO)(e),i=(0,a.sO)(t),s=(0,a.I4)((e=>{i.current=o.current(i.current,e),n()}),[n]);return[i.current,s]}},88957:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(67360);function r(e,t,n){return(0,a.Z)((e=>{e()}),[],e,t,n)}},33057:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(14050),r=n(65116),o=n(83716),i=n(790),s=n(59107),l=n(99203),c=n(48778);const d=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,c.Z)(l.gl.Extra,"CalendarModal",!t);return n?a.ZP.createElement(n,e):void 0})),u=(e,t)=>{const n=(0,s.Z)(),[l,c]=(0,a.eJ)(),u=(0,a.I4)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{serverTimeOffset:n}=(0,r.Rd)(),a=Math.round(Math.max(e.getTime(),Date.now()+6e4)/1e3)+(t?0:n);null==l||l(a),c(void 0)}),[l]),m=(0,a.I4)((()=>{u(new Date(1e3*o.t4),!0)}),[u]),h=(0,a.I4)((()=>{c(void 0),null==t||t()}),[t]),v=(0,a.I4)((e=>{c((()=>e))}),[]),p=new Date;p.setSeconds(0),p.setMilliseconds(0);const f=new Date;return f.setFullYear(f.getFullYear()+1),[v,a.ZP.createElement(d,{isOpen:Boolean(l),withTimePicker:!0,selectedAt:p.getTime(),maxAt:(0,i._F)(f),isFutureMode:!0,secondButtonLabel:e?n("Schedule.SendWhenOnline"):void 0,onClose:h,onSubmit:u,onSecondButtonClick:e?m:void 0})]}},56389:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(14050),r=n(33555),o=n(83716),i=n(69118);const s=(e,t)=>(0,a.Ye)((()=>(0,i.P2)((n=>{(0,r.Sv)().sendMessageAction({chatId:e,threadId:t,action:n})}),o.o_)),[e,t])},70971:(e,t,n)=>{n.d(t,{Y:()=>o});var a=n(14050),r=n(29290);function o(e){const t=(0,a.sO)(e);return(0,r.Z)((()=>{t.current=e}),[e]),t}},28183:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(14050);const r=function(e,t){const n=(0,a.sO)(e);(0,a.bt)((()=>{n.current=e}),[e]),(0,a.d4)((()=>{if("number"!=typeof t)return;const e=setTimeout((()=>n.current()),t);return()=>clearTimeout(e)}),[t])}},46898:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(14050),r=n(69118);function o(e,t){(0,a.d4)((()=>{const t=e.current;return()=>{t&&(0,r.T2)((()=>{t.pause(),t.src="",t.load()}))}}),t)}},96264:(e,t,n)=>{n.d(t,{Z:()=>o});const a=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1],r=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18];function o(e,t,n,o,i,s,l){if(Number.isNaN(s)||s<1)return;s|=0,Number.isNaN(l)&&(l=1),(l|=0)>3&&(l=3),l<1&&(l=1);const c=e.getImageData(t,n,o,i),d=c.data;let u,m,h,v,p,f,g,Z,P,E,y,C,b=o-1,w=i-1,N=s+1,k=[],I=[],S=[],M=a[s],T=r[s],x=[],L=[];for(;l-- >0;){for(C=y=0,p=0;p<i;p++){for(u=d[C]*N,m=d[C+1]*N,h=d[C+2]*N,f=1;f<=s;f++)g=C+((f>b?b:f)<<2),u+=d[g++],m+=d[g++],h+=d[g++];for(v=0;v<o;v++)k[y]=u,I[y]=m,S[y]=h,0==p&&(x[v]=((g=v+N)<b?g:b)<<2,L[v]=(g=v-s)>0?g<<2:0),Z=C+x[v],P=C+L[v],u+=d[Z++]-d[P++],m+=d[Z++]-d[P++],h+=d[Z++]-d[P++],y++;C+=o<<2}for(v=0;v<o;v++){for(E=v,u=k[E]*N,m=I[E]*N,h=S[E]*N,f=1;f<=s;f++)E+=f>w?0:o,u+=k[E],m+=I[E],h+=S[E];for(y=v<<2,p=0;p<i;p++)d[y]=u*M>>>T,d[y+1]=m*M>>>T,d[y+2]=h*M>>>T,0==v&&(x[p]=((g=p+N)<w?g:w)*o,L[p]=(g=p-s)>0?g*o:0),Z=v+x[p],P=v+L[p],u+=k[Z]-k[P],m+=I[Z]-I[P],h+=S[Z]-S[P],y+=o<<2}}e.putImageData(c,t,n)}},10396:(e,t,n)=>{n.d(t,{An:()=>E,Es:()=>f,z2:()=>g});var a=n(33555),r=n(91713),o=n(77361),i=n(74753),s=n(85266),l=n(83158),c=n(69118),d=n(11192);const u=new Map;let m,h=[],v=[];function p(e,t){const n=m&&u.get(m);n&&(n.audio.pause(),n.audio.currentTime=0,n.onTrackChange&&n.onTrackChange());const o=P(e,(0,a.Rd)().audioPlayer.origin||r.Cr.Inline,t);if(!o)return;if(!u.has(o))return void(0,a.Sv)().openAudioPlayer((0,l.Ak)(y(o).messageKey));const s=u.get(o);s.onForcePlay&&s.onForcePlay(),m=o,s.audio.src&&(0,i.Z)(s.audio)}function f(){const e=m&&u.get(m);e&&e.audio.pause()}function g(e,t,n,f,g){if(!u.has(e)){const n=function(e,t,n,a){const r=new Audio;function o(t){return n=>{u.has(e)&&((0,s.z)(r)||u.get(e).handlers.forEach((e=>{e(t,n)})))}}return r.addEventListener("timeupdate",o("onTimeUpdate")),r.addEventListener("play",o("onPlay")),r.addEventListener("pause",o("onPause")),r.addEventListener("loadstart",o("onLoadStart")),r.addEventListener("loadeddata",o("onLoadedData")),r.addEventListener("playing",o("onPlaying")),r.addEventListener("ended",(()=>{u.has(e)&&((0,s.z)(r)||p(e))})),{audio:r,type:t,proxy:new Proxy(r,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:n,onTrackChange:a}}(e,t,f,g);u.set(e,n),function(e,t){"audio"!==e.type||v.includes(t)||(v.push(t),v.sort(C)),"voice"!==e.type||h.includes(t)||(h.push(t),h.sort(C))}(n,e)}const{audio:Z,proxy:E,handlers:b}=u.get(e);return b.push(n),{play(n){if(!Z.paused)return;const c=m&&u.get(m);c&&m!==e&&(c.audio.pause(),c.audio.currentTime=0,(0,s.z)(c.audio)&&(c.audio.dataset.preventPlayAfterPatch="true"),c.onTrackChange&&c.onTrackChange()),m=e,Z.src||(Z.src=n,Z.preload="auto",n.includes("/progressive/")&&o.s$&&(delete Z.dataset.preventPlayAfterPatch,(0,s.B)(Z))),(0,i.Z)(Z),function(e,t){var n;if((0,a.Rd)().globalSearch.currentContent===r.nJ.Music)return;const{chatId:o}=(0,l.Ak)(y(t).messageKey),i=null===(n=(0,d.Bt)((0,a.Rd)()))||void 0===n?void 0:n.chatId,s=e=>e.startsWith(`msg${o}`)||i&&e.startsWith(`msg${i}`);"audio"===e&&(v=v.filter(s)),"voice"===e&&(h=h.filter(s))}(t,e)},pause(){m===e&&Z.pause()},stop(){if(m===e){const e=Z.src;Z.pause(),(0,c.T2)((()=>{Z.src="",Z.src=e}))}},setCurrentTime(t){m===e&&(Z.fastSeek?Z.fastSeek(t):Z.currentTime=t)},setVolume(t){m===e&&(Z.volume=t,Z.muted=!1)},setPlaybackRate(t){m===e&&(Z.playbackRate=t)},toggleMuted(e){Z.muted=void 0===e?!Z.muted:e},proxy:E,requestNextTrack(){p(e)},isLast:()=>!P(e,(0,a.Rd)().audioPlayer.origin),isFirst:()=>!P(e,(0,a.Rd)().audioPlayer.origin,!0),requestPreviousTrack(){p(e,!0)},destroy(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const a=u.get(e);a&&(a.handlers=a.handlers.filter((e=>e!==n)),a.handlers.length||(a.audio.pause(),u.delete(e),t&&function(e,t){const n=e=>e!==t;"audio"===e.type&&(v=v.filter(n)),"voice"===e.type&&(h=h.filter(n))}(a,e),e===m&&(m=void 0)))}}}function Z(e){switch(e.type){case"audio":return v;case"voice":return h;default:return}}function P(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.Cr.Inline,n=arguments.length>2?arguments[2]:void 0;const a=u.get(e),o=Z(a);if(!o)return;if(t===r.Cr.Search){const t=o.indexOf(e);if(t<0)return;return o[t+(n?-1:1)]}const{chatId:i}=(0,l.Ak)(y(e).messageKey),s=o.filter((e=>e.startsWith(`msg${i}`))),c=s.indexOf(e);if(c<0)return;let d=t===r.Cr.Inline?-1:1;return n&&(d*=-1),s[c+d]}function E(e){return`${(0,l.Tp)(e)}-${e.date}`}function y(e){return{messageKey:e.match(/^msg(-?\d+)-(\d+)/)[0],date:Number(e.split("-").pop())}}function C(e,t){if(!e||!t)return 0;const{date:n,messageKey:a}=y(e),{date:r,messageKey:o}=y(t),i=r-n;return 0===i?o.localeCompare(a):i}},64963:(e,t,n)=>{n.d(t,{vJ:()=>l,eM:()=>s,sf:()=>h});var a=n(77361);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(28712),i=n(69118);let s;!function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Left=2]="Left",e[e.Right=3]="Right"}(s||(s={}));const l=20;function c(e,t){return t?Math.hypot(t.pageX-e.pageX,t.pageY-e.pageY):0}function d(e,t){return{x:(e.pageX+t.pageX)/2,y:(e.pageY+t.pageY)/2}}let u=0;const m=new class{constructor(){let{stability:e=8,sensitivity:t=100,tolerance:n=1.1,delay:a=150}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,"stability",void 0),r(this,"sensitivity",void 0),r(this,"tolerance",void 0),r(this,"delay",void 0),r(this,"lastUpDeltas",void 0),r(this,"lastDownDeltas",void 0),r(this,"deltasTimestamp",void 0),this.stability=e,this.sensitivity=t,this.tolerance=n,this.delay=a,this.lastUpDeltas=new Array(2*this.stability).fill(0),this.lastDownDeltas=new Array(2*this.stability).fill(0),this.deltasTimestamp=new Array(2*this.stability).fill(0)}check(e){let t;return void 0!==(e=e.originalEvent||e).wheelDelta?t=e.wheelDelta:void 0!==e.deltaY?t=-40*e.deltaY:void 0===e.detail&&0!==e.detail||(t=-40*e.detail),this.deltasTimestamp.push(Date.now()),this.deltasTimestamp.shift(),t>0?(this.lastUpDeltas.push(t),this.lastUpDeltas.shift(),this.isInertia(1)):(this.lastDownDeltas.push(t),this.lastDownDeltas.shift(),this.isInertia(-1))}isInertia(e){const t=-1===e?this.lastDownDeltas:this.lastUpDeltas;if(void 0===t[0])return e;if(this.deltasTimestamp[2*this.stability-2]+this.delay>Date.now()&&t[0]===t[2*this.stability-1])return!1;const n=t.slice(0,this.stability),a=t.slice(this.stability,2*this.stability),r=n.reduce(((e,t)=>e+t)),o=a.reduce(((e,t)=>e+t)),i=r/n.length,s=o/a.length;return Math.abs(i)<Math.abs(s*this.tolerance)&&this.sensitivity<Math.abs(s)}}({stability:5,sensitivity:25,tolerance:.6,delay:150});function h(e,t){var n,r,h;let v,p,f=!1,g=!1,Z=!1,P=0,E=null!==(n=t.initialZoom)&&void 0!==n?n:1,y={x:0,y:0},C={x:!1,y:!1},b={x:window.innerWidth/2,y:window.innerHeight/2};const w=null!==(r=t.minZoom)&&void 0!==r?r:1,N=null!==(h=t.maxZoom)&&void 0!==h?h:4;function k(e){if(!t.excludedClosestSelector||!e.target.matches(t.excludedClosestSelector)&&!e.target.closest(t.excludedClosestSelector)){if(v=e,"mousedown"===e.type)!t.withNativeDrag&&t.onDrag&&e.preventDefault(),document.addEventListener("mousemove",S),document.addEventListener("mouseup",I);else if("touchstart"===e.type){const t=e.target;t.addEventListener("touchmove",S,{passive:!0}),t.addEventListener("touchend",I),t.addEventListener("touchcancel",I),"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY),2===e.touches.length&&(P=c(e.touches[0],e.touches[1]),b=d(e.touches[0],e.touches[1])))}t.withCursor&&document.body.classList.add("cursor-grabbing"),t.onCapture&&t.onCapture(e)}}function I(e){v&&(t.withCursor&&document.body.classList.remove("cursor-grabbing"),document.removeEventListener("mouseup",I),document.removeEventListener("mousemove",S),v.target.removeEventListener("touchcancel",I),v.target.removeEventListener("touchend",I),v.target.removeEventListener("touchmove",S),a.cj&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow=""})),e&&(f?t.onRelease&&t.onRelease(e):"mouseup"===e.type&&(t.onDoubleClick&&Date.now()-u<300?t.onDoubleClick(e,{centerX:v.pageX,centerY:v.pageY}):!t.onClick||"button"in e&&0!==e.button||t.onClick(e),u=Date.now()))),f=!1,g=!1,Z=!1,P=0,E=(0,o.uZ)(E,w,N),p=void 0,y={x:0,y:0},C={x:!1,y:!1},b={x:window.innerWidth/2,y:window.innerHeight/2},v=void 0}function S(e){if(v){if("touchmove"===e.type&&"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY),t.onZoom&&P>0&&2===e.touches.length)){const n=c(e.touches[0],e.touches[1]),a=d(e.touches[0],e.touches[1]),r=a.x-b.x,o=a.y-b.y,i=n/P;t.onZoom(e,{zoomFactor:i,initialCenterX:b.x,initialCenterY:b.y,dragOffsetX:r,dragOffsetY:o,currentCenterX:a.x,currentCenterY:a.y}),1!==i&&(f=!0)}const n=e.pageX-v.pageX,r=e.pageY-v.pageY;(Math.abs(n)>=15||Math.abs(r)>=15)&&(f=!0);let o=!1;t.onDrag&&(t.onDrag(e,v,{dragOffsetX:n,dragOffsetY:r}),o=!0),t.onSwipe&&!g&&(g=function(e,n,r){if(a.cj){const t=e.touches[0].pageX;if(t<=l||t>=window.innerWidth-l)return!1}const o=Math.abs(n),i=Math.abs(r);if(n&&r&&Math.max(o,i)/Math.min(o,i)<2)return!1;let c;if(o>=50?c="x":i>=50&&(c="y"),!c)return!1;if(p){if(p!==c)return!1}else p=c;return function(e,t,n,a,r){return"x"===t?r(e,n<0?s.Left:s.Right):"y"===t&&r(e,a<0?s.Up:s.Down)}(e,c,n,r,t.onSwipe)}(e,n,r),o=g),a.cj&&o&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow="hidden"}))}}const M=(0,i.Ds)(I,150,!1),T=(0,i.Ds)(I,150,!1);function x(e){f||(k(e),f=!0,b={x:e.x,y:e.y})}function L(e){if(!t.onZoom&&!t.onDrag)return;if(t.excludedClosestSelector&&(e.target.matches(t.excludedClosestSelector)||e.target.closest(t.excludedClosestSelector)))return;e.preventDefault(),e.stopPropagation();const{doubleTapZoom:n=3}=t;if(t.onDoubleClick&&Object.is(e.deltaX,-0)&&Object.is(e.deltaY,-0)&&e.ctrlKey)return x(e),E=E>1?1:n,t.onDoubleClick(e,{centerX:e.pageX,centerY:e.pageY}),void(f=!1);const a=e.metaKey||e.ctrlKey||e.shiftKey;if(a&&function(e){if(!t.onZoom)return;x(e);const n=e.x-b.x,a=e.y-b.y,r=(0,o.uZ)(e.deltaY,-25,25);E-=.01*r,E=(0,o.uZ)(E,.5*w,3*N),t.onZoom(e,{zoom:(0,o.NM)(E,2),initialCenterX:b.x,initialCenterY:b.y,dragOffsetX:n,dragOffsetY:a,currentCenterX:e.x,currentCenterY:e.y}),T(e)}(e),!a&&!Z){const n=m.check(e);(1!==E||n)&&function(e){if(!t.onDrag)return;x(e),C.x&&Math.sign(y.x)!==Math.sign(e.deltaX)||(y.x-=e.deltaX),C.y&&Math.sign(y.y)!==Math.sign(e.deltaY)||(y.y-=e.deltaY);const{x:n,y:a}=y;t.onDrag(e,v,{dragOffsetX:n,dragOffsetY:a},((e,t)=>{C={x:e,y:t}})),M(e)}(e)}}return e.addEventListener("wheel",L),e.addEventListener("mousedown",k),e.addEventListener("touchstart",k,{passive:!t.isNotPassive}),()=>{I(),e.removeEventListener("wheel",L),e.removeEventListener("touchstart",k),e.removeEventListener("mousedown",k)}}},75851:(e,t,n)=>{n.d(t,{CO:()=>o,eb:()=>s,ix:()=>l,rZ:()=>c,uR:()=>d,wK:()=>r,xP:()=>i});var a=n(71394);function r(e){return[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)]}function o(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 i(e){let[t,n,a]=e;t/=255,n/=255,a/=255;let r,o,i=Math.max(t,n,a),s=Math.min(t,n,a),l=i,c=i-s;if(o=0==i?0:c/i,i==s)r=0;else{switch(i){case t:r=(n-a)/c+(n<a?6:0);break;case n:r=(a-t)/c+2;break;case a:r=(t-n)/c+4}r/=6}return[r,o,l]}function s(e){let t,n,a,[r,o,i]=e,s=Math.floor(6*r),l=6*r-s,c=i*(1-o),d=i*(1-l*o),u=i*(1-(1-l)*o);switch(s%6){case 0:t=i,n=u,a=c;break;case 1:t=d,n=i,a=c;break;case 2:t=c,n=i,a=u;break;case 3:t=c,n=d,a=i;break;case 4:t=u,n=c,a=i;break;case 5:t=i,n=c,a=d}return[Math.round(255*t),Math.round(255*n),Math.round(255*a)]}async function l(e){const t=[0,0,0];let n,r,o,i,s=-4,l=[0,0,0],c=0;const d=document.createElement("canvas"),u=d.getContext&&d.getContext("2d");if(!u)return t;const m=await(0,a.pt)(e);o=m.naturalHeight||m.offsetHeight||m.height,r=m.naturalWidth||m.offsetWidth||m.width,d.height=o,d.width=r,u.drawImage(m,0,0);try{n=u.getImageData(0,0,r,o)}catch(e){return t}for(i=n.data.length;(s+=20)<i;)0!==n.data[s+3]&&(++c,l[0]+=n.data[s],l[1]+=n.data[s+1],l[2]+=n.data[s+2]);return l[0]=Math.floor(l[0]/c),l[1]=Math.floor(l[1]/c),l[2]=Math.floor(l[2]/c),l}function c(e){const[t,n,a]=e;return.2126*t+.7152*n+.0722*a}function d(e){let[t,n,a]=i(e);return n=Math.min(1,n+.05+.1*(1-n)),a=a>.5?Math.max(0,.65*a):Math.max(0,Math.min(1,1-.65*a)),`hsla(${360*t}, ${100*n}%, ${100*a}%, .4)`}},3570:(e,t,n)=>{function a(e,t){return t-Math.floor(t/e)*e}n.d(t,{Z:()=>a})},60539:(e,t,n)=>{n.d(t,{N:()=>m,Z:()=>u});var a=n(33555),r=n(91713),o=n(83716),i=n(77361),s=n(18674),l=n(9933),c=n(69118);let d=!1;function u(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:o.V$,l=arguments.length>5?arguments[5]:void 0,c=arguments.length>6?arguments[6]:void 0,d=arguments.length>7?arguments[7]:void 0;const u=h(e,t,s,l);l!==r.fo.Static?((0,a.Rd)().settings.byKey.animationLevel===o.oB&&(c=0),v(e,t,u,n,i,c,d)):v(e,t,u,n,i,0)}function m(){return d}function h(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.V$,a=arguments.length>3?arguments[3]:void 0;const{offsetTop:i}=t,{scrollTop:s}=e;if(void 0===a){const t=i-e.scrollTop;if(t<-n)return s+(t+n);if(t>n)return s+(t-n)}else{if(a===r.fo.Up)return i+n;if(a===r.fo.Down)return Math.max(0,i-n)}return s}function v(e,t,n,a){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5?arguments[5]:void 0,m=arguments.length>6?arguments[6]:void 0;const{offsetTop:h,offsetHeight:v}=t,{scrollTop:g,offsetHeight:Z,scrollHeight:P}=e,E=m&&e.dataset.normalHeight?Number(e.dataset.normalHeight):Z;let y;switch(g!==n&&(e.scrollTop=n),a){case"start":y=h-r-n+(i.wZ?1:0);break;case"end":y=h+v+r-(n+E);break;case"nearest":case"center":case"centerOrTop":y=v<E?h+v/2-(n+E/2):h-r-n}if(y<0){const e=-n;y=Math.max(y,e)}else if(y>0){const e=P-(n+E);y=Math.min(y,e)}if(0===y)return;const C=n+y;if(0===u)return void(e.scrollTop=C);d=!0;const b=Math.abs(y),w=b<o.xn?f:p,N=u||o.bK+b/o.V$*(o.ck-o.bK),k=Date.now(),I=(0,s.YW)();(0,c.T2)((()=>{(0,l.cK)((()=>{const t=Math.min((Date.now()-k)/N,1),n=y*(1-w(t));return e.scrollTop=Math.round(C-n),d=t<1,d||I(),d}))}))}function p(e){return 1-(1-e)**5}function f(e){return 1-(1-e)**3.5}},81367:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(33555),r=n(83716),o=n(9933),i=n(69118);const s=new Map;function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300;return(0,a.Rd)().settings.byKey.animationLevel===r.oB&&(n=0),c(e,t,n)}function c(e,t,n){const a="rtl"===e.getAttribute("dir"),{scrollLeft:r,offsetWidth:l,scrollWidth:c,dataset:{scrollId:d}}=e;let u=t-r;if(u<0){const e=-r*(a?-1:1);u=Math.max(u,e)}else if(u>0){const e=c-(r+l);u=Math.min(u,e)}if(0===u)return Promise.resolve();d&&s.has(d)&&s.get(d)();const m=r+u;if(0===n)return e.scrollLeft=m,Promise.resolve();let h=!1;const v=Math.random().toString();let p;e.dataset.scrollId=v,s.set(v,(()=>{h=!0})),e.style.scrollSnapType="none";const f=new Promise((e=>{p=e})),g=Date.now();return(0,i.T2)((()=>{(0,o.jt)((()=>{if(h)return!1;const t=Math.min((Date.now()-g)/n,1),a=u*(1-function(e){return 1-(1-e)**3.5}(t));return e.scrollLeft=Math.round(m-a),t>=1&&(e.style.scrollSnapType="",e.dataset.scrollId=void 0,s.delete(v),p()),t<1}))})),f}},65723:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(77361);function r(e,t,n){if(!t&&e===document.activeElement)return;const r=window.getSelection(),o=document.createRange(),i=e.lastChild||e;a.$b||n||i&&i.nodeValue?(o.selectNodeContents(n?e:i),o.collapse(!1),r.removeAllRanges(),r.addRange(o)):e.focus()}},60998:(e,t,n)=>{function a(){const e=window.getSelection();let t=e&&e.rangeCount?e.getRangeAt(0).cloneContents():void 0;if(!t||0===t.childElementCount)return;const n=Array.from(t.children).reduce(((e,t)=>1===t.nodeType&&t.classList.contains("message-date-group")?Array.from(t.querySelectorAll(".Message")).reduce(((e,t)=>e.concat(Number(t.dataset.messageId))),e):1===t.nodeType&&t.classList.contains("Message")?e.concat(Number(t.dataset.messageId)):e),[]);for(;t.firstChild;)t.removeChild(t.firstChild);return t=void 0,n}n.d(t,{Z:()=>a})},55254:(e,t,n)=>{n.d(t,{P:()=>r});var a=n(43858);function r(e){if("none"===e.style.display)return!1;const t=e.getBoundingClientRect(),{height:n}=a.Z.get();return t.top<=n&&t.top+t.height>=0}},64532:(e,t,n)=>{n.d(t,{Ay:()=>s,N:()=>r,NS:()=>c,Of:()=>d,Ym:()=>o,pC:()=>l});const a={play:void 0,pause:void 0,seekbackward:void 0,seekforward:void 0,previoustrack:void 0,nexttrack:void 0,stop:void 0,seekTo:void 0};function r(e,t){const{mediaSession:n}=window.navigator;n?(e&&o(e),t&&i(t)):console.warn("MediaSession API not supported in this browser")}function o(e){const{mediaSession:t}=window.navigator;t&&(t.metadata=null!=e?e:null)}function i(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...a,...e}).forEach((e=>{let[n,a]=e;try{t.setActionHandler(n,a)}catch(e){}}))}function s(){const{mediaSession:e}=window.navigator;var t;e&&(e.metadata=null,i(a),e.playbackState&&(e.playbackState="none"),null===(t=e.setPositionState)||void 0===t||t.call(e))}function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function c(e){var t;if(!e||void 0===e.position||void 0===e.duration)return;e.position=Math.min(e.position,e.duration);const{mediaSession:n}=window.navigator;null==n||null===(t=n.setPositionState)||void 0===t||t.call(n,e)}function d(e){let{title:t,artist:n,album:a,artwork:r}=e;if("MediaMetadata"in window)return new window.MediaMetadata({title:t,artist:n,album:a,artwork:r})}},83099:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(6137),r=n(77361),o=n(83716);const i={B:a.Vv.Bold,STRONG:a.Vv.Bold,I:a.Vv.Italic,EM:a.Vv.Italic,U:a.Vv.Underline,S:a.Vv.Strike,STRIKE:a.Vv.Strike,DEL:a.Vv.Strike,CODE:a.Vv.Code,PRE:a.Vv.Pre,BLOCKQUOTE:a.Vv.Blockquote};function s(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=document.createElement("div");n.innerHTML=l(t?c(e):e);const a=n.innerText.trim().replace(/\u200b+/g,"");let r=0,o=0;const i=[];function s(e){const{index:t,entity:n}=d(e,a,r);if(n)r=t,i.push(n);else if(e.textContent){if(0===t&&""===e.textContent.trim())return;r+=e.textContent.length}e.hasChildNodes()&&o<=3&&(o+=1,Array.from(e.childNodes).forEach(s))}return Array.from(n.childNodes).forEach((e=>{o=1,s(e)})),{text:a,entities:i.length?i:void 0}}function l(e){let t=e.slice(0);return r.op||(t=t.replace(/<img[^>]+alt="([^"]+)"[^>]*>/gm,"$1")),t=t.replace(/ /g," "),t=t.replace(/<div><br([^>]*)?><\/div>/g,"\n"),t=t.replace(/<br([^>]*)?>/g,"\n"),t=t.replace(/<\/div>(\s*)<div>/g,"\n"),t=t.replace(/<div>/g,"\n"),t=t.replace(/<\/div>/g,""),t=t.replace(/^`{3}(.*?)[\n\r](.*?[\n\r]?)`{3}/gms,'<pre data-language="$1">$2</pre>'),t=t.replace(/^`{3}[\n\r]?(.*?)[\n\r]?`{3}/gms,"<pre>$1</pre>"),t=t.replace(/[`]{3}([^`]+)[`]{3}/g,"<pre>$1</pre>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[`]{1}([^`\n]+)[`]{1}(?![^<]*<\/(code|pre)>)/g,"<code>$2</code>"),t=t.replace(/(^|\s)(?!<(code|pre)[^<]*|<\/)[*]{2}([^*\n]+)[*]{2}(?![^<]*<\/(code|pre)>)(\s|$)/g,"$1<b>$3</b>$5"),t=t.replace(/(^|\s)(?!<(code|pre)[^<]*|<\/)[_]{2}([^_\n]+)[_]{2}(?![^<]*<\/(code|pre)>)(\s|$)/g,"$1<i>$3</i>$5"),t=t.replace(/(^|\s)(?!<(code|pre)[^<]*|<\/)[~]{2}([^~\n]+)[~]{2}(?![^<]*<\/(code|pre)>)(\s|$)/g,"$1<s>$3</s>$5"),t=t.replace(/(^|\s)(?!<(code|pre)[^<]*|<\/)[|]{2}([^|\n]+)[|]{2}(?![^<]*<\/(code|pre)>)(\s|$)/g,`$1<span data-entity-type="${a.Vv.Spoiler}">$3</span>$5`),t}function c(e){return e.replace(new RegExp(`\\[([^\\]]+?)]\\((${o.FM}+?)\\)`,"g"),((e,t,n)=>`<a href="${n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`}">${t}</a>`))}function d(e,t,n){const r=function(e){if(i[e.nodeName])return i[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===a.Vv.MentionName?a.Vv.MentionName:t.dataset.entityType===a.Vv.Url?a.Vv.Url:t.href.startsWith("mailto:")?a.Vv.Email:t.href.startsWith("tel:")?a.Vv.Phone:t.href!==t.textContent?a.Vv.TextUrl:a.Vv.Url}return"SPAN"===e.nodeName?e.dataset.entityType:void 0}(e);if(!r||!e.textContent)return{index:n,entity:void 0};const o=t.indexOf(e.textContent,n),s=o>=0?o:n,l=t.substring(0,s).length,{length:c}=t.substring(s,s+e.textContent.length);let d,u,m;return r===a.Vv.TextUrl&&(d=e.href),r===a.Vv.MentionName&&(u=e.dataset.userId),r===a.Vv.Pre&&(m=e.dataset.language),{index:s,entity:{type:r,offset:l,length:c,...d&&{url:d},...u&&{userId:u},...m&&{language:m}}}}},85266:(e,t,n)=>{function a(e){e.dataset.patchedForSafari||(e.addEventListener("play",(()=>{const t=e.currentTime;e.dataset.patchForSafariInProgress="true",e.addEventListener("progress",(function n(){e.buffered.length&&(e.currentTime=e.duration-1,e.addEventListener("progress",(()=>{delete e.dataset.patchForSafariInProgress,e.currentTime=t,e.paused&&!e.dataset.preventPlayAfterPatch&&e.play()}),{once:!0}),e.removeEventListener("progress",n))}))}),{once:!0}),e.dataset.patchedForSafari="true")}function r(e){return Boolean(e.dataset.patchForSafariInProgress)}n.d(t,{B:()=>a,z:()=>r})},3858:(e,t,n)=>{n.d(t,{Z:()=>a});const a=e=>{e.stopPropagation(),e.preventDefault()}},85655:(e,t,n)=>{let a;function r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"*",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];a||(a=document.createElement("input"),a.setAttribute("type","file")),a.setAttribute("accept",e),n?a.removeAttribute("multiple"):a.setAttribute("multiple","multiple"),a.onchange=null,a.value="",a.onchange=t,a.click()}n.d(t,{g:()=>r})},18629:(e,t,n)=>{function a(){const e=getComputedStyle(document.documentElement),t=o(e,"--color-background"),n=o(e,"--color-text"),a=o(e,"--color-primary"),r=o(e,"--color-white"),i=o(e,"--color-links");return{bg_color:t,text_color:n,hint_color:o(e,"--color-text-secondary"),link_color:i,button_color:a,button_text_color:r,secondary_bg_color:o(e,"--color-background-secondary")}}function r(e){return/^#[0-9A-F]{6}$/i.test(e)}function o(e,t){return r(n=e.getPropertyValue(t).trim())?n:`#${n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+\.{0,1}\d*))?\)$/).slice(1).map(((e,t)=>(3===t?Math.round(255*parseFloat(e)):parseFloat(e)).toString(16).padStart(2,"0").replace("NaN",""))).join("")}`;var n}n.d(t,{B:()=>a,U:()=>r})}}]);
|
||
//# sourceMappingURL=7916.0316c9805db8e80b41b5.js.map
|