2 lines
75 KiB
JavaScript
2 lines
75 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[3938],{101:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(84051),a=n(87679),i=n(56863);function s(e){const t=(0,o.li)(),{result:n}=(0,i.A)(()=>{if(!e)return Promise.resolve(void 0);t.current&&URL.revokeObjectURL(t.current);const n=URL.createObjectURL(e);return t.current=n,(0,a.NN)(n)},[e]);return(0,o.vJ)(()=>()=>{t.current&&(URL.revokeObjectURL(t.current),t.current=void 0)},[]),{image:n}}},537:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051);function a(e,t){const n=(0,o.li)(0);return(0,o.Kr)(()=>{t||(n.current+=1)},[...e]),n.current}},10187:(e,t,n)=>{n.d(t,{A:()=>p});var o=n(84051),a=n(13439),i=n(70636),s=n(91048),c=n(87357),r=n(35049),l=n(59030),d=n(21849),u=n(34431),h=n(18276);var m=n(20021);const p=(0,o.ph)((0,a.EK)((e,{peerId:t,forceShowSelf:n})=>{if(!t)return{peer:void 0,isSavedMessages:void 0};const o=(0,s.PVB)(e,t),a=(0,s.mBe)(e,t);return{peer:o,isSavedMessages:!n&&a&&a.isSelf}})(({icon:e,title:t,isMinimized:n,canClose:o,isCloseNonDestructive:a,clickArg:s,peer:p,mockPeer:g,customPeer:A,className:f,isSavedMessages:v,withPeerColors:C,withEmojiStatus:y,onClick:S,itemClassName:I})=>{const w=(0,l.A)(),R=g||p,N=A||R,b=R&&(0,i.vj)(R)?R:void 0;let M,x,P;e&&t?(M=(0,m.Y)("div",{className:"NtoGLT22",children:(0,m.Y)(h.A,{name:e,style:"f91Ad80i"})}),x=t):N&&(M=(0,m.Y)(d.A,{className:"La8BQ9yr",peer:N,size:"small",isSavedMessages:v}),P=(0,i.F9)(w,N)||t,x=t||(0,m.Y)(u.A,{peer:N,isSavedMessages:v,withEmojiStatus:y}));const k=(0,c.A)("_Lq6_4e5",(b?.isForum||A?.isAvatarSquare)&&"JIHfTUVn",n&&"UhOZvxvs",o&&"uvvgSFUJ",a&&"fAk5yEeV",!S&&"P8r3OoaX",C&&(0,r.y)(A||p),f);return(0,m.FD)("div",{className:k,onClick:()=>S?.(s),title:n?P:void 0,dir:w.isRtl?"rtl":void 0,children:[M,!n&&(0,m.Y)("div",{className:(0,c.A)("XPVuH29G",I),dir:"auto",children:x}),o&&(0,m.Y)("div",{className:"xVPG2UTy",children:(0,m.Y)(h.A,{name:"close"})})]})}))},11241:(e,t,n)=>{n.d(t,{A:()=>N});var o=n(84051),a=n(13439),i=n(90709),s=n(91048),c=n(87357),r=n(43336),l=n(76023),d=n(37661),u=n(5912),h=n(17712),m=n(62587),p=n(50680),g=n(47483),A=n(18104),f=n(87412),v=n(83594),C=n(17794),y=n(93879),S=n(20021);const I=1.5*l.$,w=6.5*l.$,R=l.$,N=(0,o.ph)((0,a.EK)((e,{containerId:t})=>{const{genericEmojiEffects:n,reactions:o}=e,{activeReactions:a}=(0,s.nTw)(e),i=(0,s.xYJ)(e,"reactionEffects");return{activeReactions:a?.[t],availableReactions:o.availableReactions,genericEffects:n,withEffects:i}})(({containerId:e,reaction:t,className:n,size:s=I,effectSize:l=w,activeReactions:N,availableReactions:b,genericEffects:M,withEffects:x,withEffectOnly:P,shouldPause:k,shouldLoop:Y,loopLimit:T,observeIntersection:D})=>{const{stopActiveReaction:L}=(0,a.ko)(),E=(0,o.li)(),F="custom"===t.type,B=(0,o.Kr)(()=>b?.find(e=>(0,i.a0)(e.reaction,t)),[b,t]),O=B?.centerIcon?.id,{customEmoji:K}=(0,g.A)(F?t.documentId:void 0),_=(0,o.Kr)(()=>{if(!F)return B?.aroundAnimation?.id;if(!K)return;const e=b?.find(e=>e.reaction.emoticon===K.emoji)?.aroundAnimation?.id;return e},[B,b,K,F]),U=(0,o.Kr)(()=>{if(_)return _;if(!M?.stickers)return;const{stickers:e}=M;return e[Math.floor(Math.random()*e.length)].id},[_,M]),$=(0,u.Vz)(E,D),J=O&&(0,i.aL)(O),z=U&&(0,i.aL)(U),j=(0,m.A)(J),H=(0,m.A)(z),q=(0,o.Kr)(()=>N?.find(e=>(0,i.a0)(e,t)),[N,t]),G=Boolean(x&&q&&(F||j)&&H),V=$&&(G&&!P||Y),{shouldRender:W,transitionClassNames:X}=(0,p.A)(G,void 0,!0,"slow"),{shouldRender:Z,transitionClassNames:Q}=(0,p.A)(V,void 0,!0,"slow"),ee=(0,h.A)(()=>{L({containerId:e,reaction:t})}),[te,ne,oe]=(0,d.A)(),ae=!(F||V&&te),{shouldRender:ie,transitionClassNames:se}=(0,p.A)(ae,void 0,!0),ce=(0,c.A)(y.A.root,W&&y.A.animating,P&&y.A.withEffectOnly,n);return(0,S.FD)("div",{className:ce,ref:E,children:[!P&&ie&&(0,S.Y)(C.A,{className:se,reaction:t,availableReactions:b,size:s,observeIntersection:D}),!P&&F&&(0,S.Y)(f.A,{documentId:t.documentId,className:y.A.customEmoji,size:s,noPlay:k,noVideoOnMobile:!0,loopLimit:T,observeIntersectionForPlaying:D,forceAlways:!0}),Z&&!F&&(0,S.Y)(A.A,{className:(0,c.A)(y.A.animatedIcon,Q),size:(0,r.Ki)(1.9*s),tgsUrl:j,play:$&&!k,noLoop:!Y,onLoad:ne,onEnded:oe,forceAlways:!0},`${O}-${s}`),W&&(0,S.FD)(S.FK,{children:[(0,S.Y)(A.A,{className:(0,c.A)(y.A.effect,X),size:l,tgsUrl:H,play:$,noLoop:!0,onEnded:ee,forceAlways:!0},`${U}-${l}`),F&&!_&&$&&(0,S.Y)(v.A,{reaction:t,className:X,particleSize:Math.max(.5*s,R),onEnded:ee})]})]})}))},14622:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(84051),a=n(13439),i=n(81954),s=n(17712),c=n(93545),r=n(672);const l=function(e,t=!1){const{focusLastMessage:n}=(0,a.ko)(),l=(0,o.li)(0),d=(0,s.A)(e=>{const t=l.current,a=e.contentRect.height;if(l.current=a,(0,i.o8)()||!t||a<=t)return;const s=e.target.closest(".MessageList");if(!s)return;(0,o.VK)(400);const c=a-t,{offsetHeight:r,scrollHeight:d,scrollTop:u}=s;Math.round(d-u-r)-c<=5&&n()}),u=(0,r.A)(d,[d],300,!1);(0,c.A)(e,u,!t)}},14737:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(84051),a=n(17712);const i=function(e,t){const n=(0,a.A)(e);(0,o.vJ)(()=>{if("number"!=typeof t)return;const e=setTimeout(()=>n(),t);return()=>clearTimeout(e)},[t])}},15535:(e,t,n)=>{n.d(t,{A:()=>A});var o=n(84051),a=n(31481),i=n(66644),s=n(63495),c=n(96454),r=n(87357),l=n(83868),d=n(14737),u=n(43874),h=n(39351),m=n(64493),p=n(18276),g=n(20021);const A=(0,o.ph)(({isLoading:e=!1,isPasswordVisible:t,error:n,hint:A,placeholder:f,submitLabel:v,description:C,shouldShowSubmit:y,shouldResetValue:S,shouldDisablePasswordManager:I=!1,noRipple:w=!1,onClearError:R,onChangePasswordVisibility:N,onInputChange:b,onSubmit:M})=>{const x=(0,o.li)(),P=(0,h.A)(),{isMobile:k}=(0,u.Ay)(),[Y,T]=(0,o.J0)(""),[D,L]=(0,o.J0)(!1),E=k?550:400;return(0,o.vJ)(()=>{S&&T("")},[S]),(0,d.A)(()=>{c.TF||x.current.focus()},E),(0,o.vJ)(()=>{n&&(0,i.RK)(()=>{x.current.focus(),x.current.select()})},[n]),(0,g.FD)("form",{action:"",onSubmit:M?function(t){t.preventDefault(),e||D&&M(Y)}:l.A,autoComplete:"off",children:[(0,g.FD)("div",{className:(0,r.A)("input-group password-input",Y&&"touched",n&&"error"),dir:P.isRtl?"rtl":void 0,children:[I&&(0,g.Y)("input",{type:"password",id:"prevent_autofill",autoComplete:"off",className:"visually-hidden",tabIndex:-2}),(0,g.Y)("input",{ref:x,className:"form-control",type:t?"text":"password",id:"sign-in-password",value:Y||"",autoComplete:I?"one-time-code":"current-password",spellCheck:!s.Vq&&void 0,onChange:function(e){n&&R();const{target:t}=e;T(t.value),L(t.value.length>=a.AGC),b&&b(t.value)},maxLength:256,dir:"auto"}),(0,g.Y)("label",{children:n||A||f||P("PasswordFormPlaceholder")}),(0,g.Y)("div",{className:"div-button toggle-password",onClick:function(){N(!t)},role:"button",tabIndex:0,title:P("AriaPasswordToggle"),"aria-label":P("AriaPasswordToggle"),children:(0,g.Y)(p.A,{name:t?"eye":"eye-crossed"})})]}),C&&(0,g.Y)("p",{className:"description",children:C}),M&&(D||y)&&(0,g.Y)(m.A,{type:"submit",ripple:!w,isLoading:e,disabled:!D,children:v||P("PasswordFormSubmit")})]})})},15640:(e,t,n)=>{function o(e){return"touches"in e?{x:e.touches[0].clientX,y:e.touches[0].clientY}:{x:e.clientX,y:e.clientY}}n.d(t,{A:()=>o})},17794:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(84051),a=n(90709),i=n(87357),s=n(62587),c=n(83057),r=n(87412),l=n(18276),d=n(61911),u=n(20021);const h=(0,o.ph)(({reaction:e,availableReactions:t,className:n,size:h,withIconHeart:m,observeIntersection:p})=>{const g=(0,o.Kr)(()=>t?.find(t=>(0,a.a0)(t.reaction,e)),[t,e]),A=g?.staticIcon?.id,f=A?`document${A}`:void 0,v=(0,s.A)(f),C=(0,c.A)(v),y="emoji"===e.type&&"🦄"===e.emoticon,S=m&&"emoji"===e.type&&"❤"===e.emoticon;return"custom"===e.type?(0,u.Y)(r.A,{documentId:e.documentId,className:(0,i.A)("ReactionStaticEmoji",n),size:h,observeIntersectionForPlaying:p}):S?(0,u.Y)(l.A,{name:"heart",className:"ReactionStaticEmoji",style:`font-size: ${h}px; width: ${h}px`}):(0,u.Y)("img",{className:(0,i.A)("ReactionStaticEmoji",y&&"with-unicorn-fix",C,n),style:h?`width: ${h}px; height: ${h}px`:void 0,src:v||d,alt:g?.title,draggable:!1})})},20333:(e,t,n)=>{n.d(t,{A:()=>y});var o=n(84051),a=n(87357),i=n(95807),s=n(76023),c=n(537),r=n(30857),l=n(59030),d=n(29886),u=n(93545),h=n(35297),m=n(41036),p=n(18276);const g="HS9PzRKt",A="_b5HgBXr",f="P6mch4bB",v="xdKGgbKQ";var C=n(20021);const y=(0,o.ph)(({leftText:e,rightText:t,floatingBadgeText:n,floatingBadgeIcon:y,progress:S=0,isPrimary:I,isNegative:w,animationDirection:R="none",className:N})=>{const b=(0,l.A)(),M=(0,o.li)(),x=(0,o.li)(),[P,k]=(0,o.J0)(0),[Y,T]=(0,o.J0)(0),[D,L]=(0,o.J0)(0),E=(0,d.A)(D),[F,B]=(0,o.J0)(w?0:S),[O,K]=(0,o.J0)(w?S:0),[_,U]=(0,o.J0)(S),[$,J]=(0,o.J0)(0),[z,j]=(0,o.J0)(!1),[H,q]=(0,o.J0)(!1),[G,V]=(0,o.J0)(!1),[W,X]=(0,o.J0)(!1),[Z,Q]=(0,o.J0)(!1),ee=(0,c.A)([n,y]),te=(0,o.li)(!1),ne=(0,d.A)(e),oe=(0,d.A)(t),ae=(0,d.A)(w),ie=14+s.$,se=1.5*s.$,ce=()=>{if(M.current&&x.current){const e=x.current.offsetWidth,t=D/2,n=t,o=e-t,a=14,i=w?(1-_)*e:_*e;let s=Math.max(n,Math.min(i,o));i<ie&&(s=i+t),i>e-ie&&(s=i-t);const c=t+(i-s)-a;k(s/e),T(c)}};(0,o.vJ)(ce,[_,D,w,ie]),(0,u.A)(x,ce),(0,o.vJ)(()=>{L((M?.current?.clientWidth||0)+se)},[n,y,se]);const re=(0,r.A)();(0,h.A)(()=>{let e;if((ne||oe)&&(void 0!==ae&&ae!==w||Z)&&!te.current){te.current=!0;const t=Z?800:400;e=window.setTimeout(()=>{te.current=!1,re()},t)}return()=>{e&&(clearTimeout(e),te.current=!1)}},[e,ne,t,oe,ae,w,R,Z]);const le=te.current;(0,o.vJ)(()=>{w?(B(0),K(S)):(K(0),B(S)),U(S)},[S,w]);const de=Boolean(y||n),ue=le?ne:e,he=le?oe:t,me=(0,d.A)(S);(0,o.vJ)(()=>{const e=[];if("none"===R||void 0===me)return;const t=S,n=e=>{w?K(e):B(e)};if("forward"===R||"backward"===R){const o="forward"===R;Q(!0),n(o?1:0),V(!0),J(o?0:1),e.push(window.setTimeout(()=>{V(!1),j(!0),J(t),o&&(q(!0),n(0))},400)),e.push(window.setTimeout(()=>{q(!0),V(!0),X(!1),n(t),j(!1),e.push(window.setTimeout(()=>{q(!1),V(!1),Q(!1)},50))},800))}return()=>{e.forEach(clearTimeout)}},[S,R,w,me,800]);const pe=(e,t,n,o)=>{const i=e?"MzFvyMb5":"S6H6hBpP";return(0,C.FD)("div",{className:(0,a.A)(i,n,o&&g),style:`--layer-progress: ${t}`,children:[(0,C.Y)("div",{className:A,children:(0,C.Y)("span",{children:ue})}),(0,C.Y)("div",{className:f,children:(0,C.Y)("span",{children:he})})]})};return(0,C.FD)("div",{ref:x,className:(0,a.A)("nY2ggBsF",de&&"RYtVQAjM",I&&"Zi0w7QJ3",w&&"dXs41qvC",le&&"I7toQztx",Z&&"SxTCkiyg",N),style:(0,i.A)(`--positive-progress: ${F}`,`--negative-progress: ${O}`,`--layer-progress: ${$}`,`--shift-x: ${P}`,"--cycling-animation-badge-position: 800ms","--cycling-animation-progress: 400ms"),children:[de&&(0,C.Y)("div",{className:"dhigNjAq",children:(0,C.FD)("div",{className:"cOpfCGPh",children:[(0,C.Y)("div",{className:(0,a.A)("uNwBLNOy",(!E||0===E)&&g),style:`width: ${D}px;`,children:(0,C.Y)(m.Ay,{activeKey:ee,name:"fade",shouldCleanup:!0,children:(0,C.FD)("div",{ref:M,className:"W4rqGyJl",children:[y&&(0,C.Y)(p.A,{name:y,className:"MJ7MTmxi"}),n&&(0,C.Y)("div",{className:"MwzZt3Qo",dir:b.isRtl?"rtl":void 0,children:n})]})})}),(0,C.Y)("div",{className:"qRwO7SZm",style:`left: ${Y}px`,children:(0,C.Y)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",children:(0,C.Y)("path",{d:"m 28,4 v 9 c 0.0089,7.283278 -3.302215,5.319646 -6.750951,8.589815 l -5.8284,5.82843 c -0.781,0.78105 -2.0474,0.78104 -2.8284,0 L 6.7638083,21.589815 C 2.8288652,17.959047 0.04527024,20.332086 0,13 V 4 C 0,4 0.00150581,0.97697493 3,1 5.3786658,1.018266 22.594519,0.9142007 25,1 c 2.992326,0.1067311 3,3 3,3 z",fill:"currentColor"})})})]})}),(0,C.Y)("div",{className:A,children:(0,C.Y)("span",{children:ue})}),(0,C.Y)("div",{className:f,children:(0,C.Y)("span",{children:he})}),(0,C.FD)("div",{className:"_B4r3D5W",children:[pe(!0,F,(0,a.A)(W&&v),H),pe(!1,O,(0,a.A)(W&&v),H),pe(!w,$,(0,a.A)(w?"QZwWHVdB":"VmyTBAzN",z&&"tkyw4hXo"),G)]})]})})},24531:(e,t,n)=>{n.d(t,{A:()=>m});var o=n(84051),a=n(31481),i=n(17663),s=n(80140),c=n(17712),r=n(59030),l=n(80089),d=n(80464),u=n(20021);const h=e=>{const{isOpen:t}=e,n=(0,d.A)(l.ar.Extra,"CalendarModal",!t);return n?(0,u.Y)(n,{...e}):void 0},m=(e,t,n)=>{const l=(0,r.A)(),[d,m]=(0,o.J0)(),p=(0,c.A)((e,t=!1)=>{const n=Math.round(Math.max(e.getTime(),Date.now()+6e4)/1e3)+(t?0:(0,s.SF)());d?.(n),m(void 0)}),g=(0,c.A)(()=>{p(new Date(1e3*a.NkL),!0)}),A=(0,c.A)(()=>{m(void 0),t?.()}),f=(0,c.A)(e=>{m(()=>e)}),v=n?new Date(1e3*n):new Date;v.setSeconds(0),v.setMilliseconds(0);const C=new Date;return C.setFullYear(C.getFullYear()+1),[f,(0,u.Y)(h,{isOpen:Boolean(d),withTimePicker:!0,selectedAt:v.getTime(),maxAt:(0,i.CS)(C),isFutureMode:!0,secondButtonLabel:e?l("Schedule.SendWhenOnline"):void 0,onClose:A,onSubmit:p,onSecondButtonClick:e?g:void 0})]}},26875:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),a=n(87357),i=n(59030),s=n(21849);var c=n(20021);const r=(0,o.ph)(({peers:e,size:t,className:n,limit:r=3,badgeText:l})=>{const d=(0,i.A)(),u="number"==typeof t?t:s.R[t],h=(0,o.Kr)(()=>l||(!e?.length||e.length<=r?void 0:"+"+(e.length-r)),[l,e,r]);return(0,c.FD)("div",{className:(0,a.A)(n,"kXs18Nmi"),style:`--_size: ${u}px;`,dir:d.isRtl?"rtl":"ltr",children:[e?.slice(0,r).map(e=>(0,c.Y)(s.A,{size:t,peer:e,className:"XND8fhC1"})),h&&(0,c.Y)("div",{className:"SHyAyGFO",children:h})]})})},27860:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(84051),a=n(66644),i=n(87357),s=n(45470),c=n(39351),r=n(17712),l=n(50680),d=n(18276);var u=n(20021);const h=(0,o.ph)(({isVisible:e,withAnimation:t,thumbDataUri:n,isNsfw:h,className:m,width:p,height:g})=>{const A=(0,o.li)(),f=(0,c.A)(),{shouldRender:v,transitionClassNames:C}=(0,l.A)(e,void 0,!0,!t&&void 0,void 0,500),y=(0,s.A)(n,!v,void 0,25,p,g),S=(0,r.A)(e=>{if(!A.current)return;const t=A.current,n=e.currentTarget.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top,s=o-n.width/2,c=i-n.height/2;(0,a.RK)(()=>{t.setAttribute("style",`--click-shift-x: ${s}px; --click-shift-y: ${c}px`)})});if(v)return(0,u.FD)("div",{className:(0,i.A)("qF2WgYVg",C,m,t&&"pNM3cgkY"),ref:A,onClick:t?S:void 0,children:[(0,u.Y)("canvas",{ref:y,className:"eULqS2yR",width:p,height:g}),(0,u.Y)("div",{className:"XBor45hE"}),h&&(0,u.FD)("span",{className:"FJGQoa6s",children:[(0,u.Y)(d.A,{name:"eye-crossed-outline",className:"Y7JVRkxJ"}),f("MediaSpoilerSensitive")]})]})})},29886:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051);function a(e){const t=(0,o.li)(),n=(0,o.li)();return n.current!==e&&(t.current=n.current),n.current=e,t.current}},31460:(e,t,n)=>{n.d(t,{P:()=>i});var o=n(31481),a=n(96454);function i(e,t,n=!1,i=!1){return n||t===o.dnp?"none":t===o.zHL?"slideFade":"slideOptimized"===e?i?"slideOptimizedRtl":"slideOptimized":"slide"===e?i?"slideRtl":"slide":a.Ni?"slideFade":a.pz?"slideLayers":"pushSlide"}},31722:(e,t,n)=>{n.d(t,{A:()=>o});const o={container:"YmM5biTv",header:"S7WFT2bv",pickerCategoryTitle:"YK1300x2",peerChip:"gsKPBPoK",pickerList:"yLCbiItq",padded:"bXzIGw8s",noResults:"dXWKD0ve",onlineStatus:"d5GDOYh9"}},36838:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051);const a=(e,t,n=!1)=>{(0,o.vJ)(()=>{if(t)return;const o=e.current;function a(e){e.deltaX||(o.scrollLeft+=e.deltaY/4,n&&e.preventDefault())}return o.addEventListener("wheel",a,{passive:!n}),()=>{o.removeEventListener("wheel",a)}},[e,t,n])}},40558:(e,t,n)=>{n.d(t,{A:()=>g});var o=n(84051),a=n(66644),i=n(90709),s=n(87357),c=n(95807),r=n(87679),l=n(43336),d=n(17712),u=n(62587),h=n(93545),m=n(38691);var p=n(20021);const g=(0,o.ph)(({backgroundColors:e,patternColor:t,patternIcon:n,patternOpacity:g,clearBottomSector:A,className:f,patternSize:v=1})=>{const C=(0,o.li)(),y=(0,o.li)(),[S,I]=(0,o.Ul)({width:0,height:0}),w=(0,m.A)(),[R,N]=(0,o.J0)(),b=n&&(0,i.Mw)(n,"preview"),M=(0,u.A)(b);(0,o.vJ)(()=>{M&&(0,r.NN)(M).then(N)},[M]);const x=(0,o.Kr)(()=>{const e=[];for(let t=1;t<=3;t++){const n=Math.floor(8*(1+.5*(t-1))),o=t/3,a=.05+(.4-.05)*o,i=t%2==0?Math.PI/n:0;for(let t=0;t<n;t++){const s=t/n*Math.PI*2+i;if(A&&s>.45*Math.PI&&s<.55*Math.PI)continue;const c=1.71*a*Math.cos(s),r=a*Math.sin(s),l=1.4-o*Math.random();e.push({x:c,y:r,sizeFactor:l})}}return e},[A]);(0,h.A)(C,e=>{I({width:e.contentRect.width,height:e.contentRect.height})}),(0,o.vJ)(()=>{const e=C.current;e&&I({width:e.clientWidth,height:e.clientHeight})},[I]);const P=(0,d.A)(()=>{const e=y.current;if(!e||!R)return;const n=e.getContext("2d"),{width:o,height:a}=e;if(!o||!a)return;n.clearRect(0,0,o,a),n.save(),x.forEach(({x:e,y:t,sizeFactor:i})=>{const s=e*v*Math.max(o,250*w)+o/2,c=t*v*Math.max(a,250*w)+a/2,r=20*w*v*i;n.drawImage(R,s-r/2,c-r/2,r,r)}),n.restore(),t&&(n.save(),n.fillStyle=t,n.globalCompositeOperation="source-atop",n.fillRect(0,0,o,a),n.restore());const i=n.createRadialGradient(o/2,a/2,0,o/2,a/2,o/2),s=(0,l.qE)(.6*(g??1),0,1);i.addColorStop(0,`rgb(255 255 255 / ${1-s})`),i.addColorStop(1,"rgb(255 255 255 / 1)"),n.save(),n.globalCompositeOperation="destination-out",n.fillStyle=i,n.fillRect(0,0,o,a),n.restore()});return(0,o.vJ)(()=>{P()},[R,g,v,t,x]),(0,o.vJ)(()=>{const{width:e,height:t}=S(),n=y.current;if(!e||!t||!n)return;const o=Math.max(e,t);(0,a.RK)(()=>{n.width=o*w,n.height=o*w,P()})},[S,w]),(0,p.Y)("div",{ref:C,className:(0,s.A)("Af3tYFMg",f),style:(0,c.A)(`--_bg-1: ${e[0]}`,`--_bg-2: ${e[1]||e[0]}`),children:(0,p.Y)("canvas",{ref:y,className:(0,s.A)("GbpiDSS_",R&&"Y5FyX1oo"),"aria-hidden":"true"})})})},41512:(e,t,n)=>{n.d(t,{Y:()=>a});var o=n(43503);function a(e){if("none"===e.style.display)return!1;const t=e.getBoundingClientRect(),{height:n}=o.A.get();return t.top<=n&&t.top+t.height>=0}},43581:(e,t,n)=>{n.d(t,{A:()=>$});var o=n(84051),a=n(13439),i=n(90709),s=n(91048),c=n(87357),r=n(60343),l=n(15283),d=n(17712),u=n(59030),h=n(14242),m=n(76023),p=n(63527),g=n(10722),A=n(82117),f=n(39351),v=n(29886),C=n(34201),y=n(68292),S=n(26875),I=n(96454),w=n(58443),R=n(5912),N=n(4438),b=n(9267),M=n(93879),x=n(20021);const P=1.5*m.$,k=6.5*m.$,Y=I.pz||I.Ni?2:5,T=I.pz||I.Ni?2:3,D=(0,o.ph)((0,a.EK)((e,{containerId:t})=>{const{activeReactions:n}=(0,s.nTw)(e),o=(0,s.xYJ)(e,"reactionEffects");return{activeReactions:n?.[t],withEffects:o}})(({containerId:e,reaction:t,className:n,size:s=P,effectSize:r=k,activeReactions:l,localAmount:u,withEffects:h,observeIntersection:m})=>{const{stopActiveReaction:p}=(0,a.ko)(),g=(0,o.li)(),f=(0,o.li)(),[v,y]=(0,o.J0)([]),S=(0,R.Vz)(g,m),I=(0,o.Kr)(()=>l?.find(e=>(0,i.a0)(e,t)),[l,t]),D=Boolean(h&&I),L=v.length<Y;(0,A.A)(([e])=>{D?!u||u<=(e||0)||L&&y(e=>[...e,Date.now()]):y([])},[u,L,D]);const{shouldRender:E}=(0,C.A)({ref:f,noMountTransition:!0,isOpen:D,className:"slow",withShouldRender:!0}),F=(0,d.A)(()=>{const n=v.slice(1);y(n),n.length||p({containerId:e,reaction:t})}),B=(0,c.A)(M.A.root,E&&M.A.animating,n);return(0,x.FD)("div",{className:B,ref:g,teactFastList:!0,children:[(0,x.Y)(b.A,{type:"gold",size:"adaptive",style:`width: ${s}px; height: ${s}px`},"icon"),E&&v.map(e=>(0,x.Y)(N.A,{ref:f,className:M.A.effect,size:r,tgsUrl:w.w.StarReactionEffect,play:S,noLoop:!0,forceAlways:!0,nonInteractive:!0,quality:T,onEnded:F},e))]})}));var L=n(11241),E=n(85118),F=n(64493),B=n(69988);const O=1.25*m.$;function K(e){return e.stars}const _=(0,o.ph)(({reaction:e,containerId:t,isOwnMessage:n,recentReactors:s,className:r,chosenClassName:l,chatId:u,messageId:m,isOutside:I,observeIntersection:w,onClick:R,onPaidClick:N})=>{const{openStarsBalanceModal:b,resetLocalPaidReactions:M,openPaidReactionModal:P,requestWave:k}=(0,a.ko)(),Y=(0,o.li)(),T=(0,o.li)(),_=(0,o.li)(),U=(0,f.A)(),$="paid"===e.reaction.type,J=(0,p.A)(K),z=Boolean(J),j=(0,d.A)((e=1)=>{N?.(e)}),H=(0,d.A)(t=>{if("paid"===e.reaction.type)return t.stopPropagation(),void j();R?.(e.reaction)}),{isContextMenuOpen:q,handleBeforeContextMenu:G,handleContextMenu:V,handleContextMenuClose:W,handleContextMenuHide:X}=(0,g.A)(Y,"paid"!==e.reaction.type,void 0,void 0,void 0,!0);(0,o.vJ)(()=>{q&&(P({chatId:u,messageId:m}),W(),X())},[W,X,q,u,m]),(0,A.A)(([t])=>{const n=e.localAmount,o=Y.current;if(!n||!o||n===t?.localAmount)return;if(z&&n>J.balance.amount)return b({originReaction:{chatId:u,messageId:m,amount:n}}),void M({chatId:u,messageId:m});if(e.localAmount){const{left:e,top:t}=o.getBoundingClientRect(),n=e+o.offsetWidth/2,a=t+o.offsetHeight/2;k({startX:n,startY:a})}const a=Number(getComputedStyle(o).scale)||1;_.current?.cancel(),_.current=o.animate([{scale:a},{scale:Math.min(1.2*a,3),offset:.2},{scale:1}],{duration:500*a,easing:"ease-out"})},[e,J?.balance,z,u,m]);const Z=(0,v.A)(e.localAmount),{shouldRender:Q}=(0,C.A)({isOpen:Boolean(e.localAmount),ref:T,className:"slow",withShouldRender:!0});return(0,x.FD)(F.A,{className:(0,c.A)(B.A.root,n&&B.A.own,$&&B.A.paid,I&&B.A.outside,(0,i.eu)(e)&&B.A.chosen,(0,i.eu)(e)&&l,r),size:"tiny",ref:Y,onMouseDown:G,onContextMenu:V,onClick:H,children:["paid"===e.reaction.type?(0,x.FD)(x.FK,{children:[(0,x.Y)(E.A,{preset:"button"}),(0,x.Y)(D,{className:B.A.animatedEmoji,containerId:t,reaction:e.reaction,size:O,localAmount:e.localAmount,observeIntersection:w}),Q&&(0,x.Y)(y.A,{ref:T,text:`+${(0,h.Vw)(U,e.localAmount||Z)}`,className:B.A.paidCounter})]}):(0,x.Y)(L.A,{className:B.A.animatedEmoji,containerId:t,reaction:e.reaction,size:O,observeIntersection:w}),s?.length?(0,x.Y)(S.A,{size:"mini",peers:s}):(0,x.Y)(y.A,{text:(0,h.Vw)(U,e.count+(e.localAmount||0)),className:B.A.counter})]})});var U=n(92915);const $=(0,o.ph)(({message:e,threadId:t,isOutside:n,maxWidth:h,metaChildren:m,observeIntersection:p,noRecentReactors:g,isCurrentUserPremium:A,tags:f,isAccountFrozen:v})=>{const{toggleReaction:C,addLocalPaidReaction:y,updateMiddleSearch:S,performMiddleSearch:I,openPremiumModal:w,resetLocalPaidReactions:R,showNotification:N,openFrozenAccountModal:b}=(0,a.ko)(),M=(0,u.A)(),{results:P,areTags:k,recentReactions:Y}=e.reactions,T=Boolean(e.areReactionsPossible&&e.reactions),D=(0,o.Kr)(()=>P.reduce((e,t)=>e+t.count,0),[P]),L=(0,o.Kr)(()=>{const e=(0,a.mS)();return Y?.reduce((t,n)=>{const{reaction:o,peerId:a}=n,c=(0,i.Jj)(o),r=(0,s.PVB)(e,a);if(!r)return t;const l=t[c]||[];return l.push(r),t[c]=l,t},{})},[Y]),E=(0,o.Kr)(()=>{const t=(0,r.bj)(e);return P.map(e=>{const n=(0,i.Jj)(e.reaction),o=L?.[n],a=D>3||g,s=k?f?.[n]:void 0;return{reaction:e,reactionKey:n,messageKey:t,recentReactors:a?void 0:o,isChosen:(0,i.eu)(e),tag:s}})},[e,g,L,P,k,f,D]),F=(0,d.A)(n=>{if(!v)return k?A?(S({chatId:e.chatId,threadId:t,update:{savedTag:n}}),void I({chatId:e.chatId,threadId:t})):void w({initialSection:"saved_tags"}):void C({chatId:e.chatId,messageId:e.id,reaction:n});b()}),B=(0,o.Kr)(()=>P.find(e=>"paid"===e.reaction.type)?.localAmount||0,[P]),O=(0,d.A)(t=>{v?b():y({chatId:e.chatId,messageId:e.id,count:t})});(0,o.vJ)(()=>{B&&N({localId:(0,r.bj)(e),title:M("StarsSentTitle"),message:M("StarsSentText",B),actionText:M("StarsSentUndo"),cacheBreaker:B.toString(),action:{action:"resetLocalPaidReactions",payload:{chatId:e.chatId,messageId:e.id}},dismissAction:{action:"sendPaidReaction",payload:{chatId:e.chatId,messageId:e.id}},duration:5e3,shouldShowTimer:!0,disableClickDismiss:!0,icon:"star"})},[M,e,B]);const K=(0,d.A)(t=>{v?b():C({chatId:e.chatId,messageId:e.id,reaction:t})});return(0,l.A)(()=>()=>{R({chatId:e.chatId,messageId:e.id})}),(0,x.FD)("div",{className:(0,c.A)("Reactions",n&&"is-outside",T&&"is-service"),style:h?`max-width: ${h}px`:void 0,dir:M.isRtl?"rtl":"ltr",children:[E.map(({reaction:t,recentReactors:o,messageKey:a,reactionKey:i,isChosen:s,tag:c})=>k?(0,x.Y)(U.A,{className:"message-reaction",chosenClassName:"chosen",containerId:a,isOwnMessage:e.isOutgoing,isChosen:s,reaction:t.reaction,tag:c,withContextMenu:A,onClick:F,onRemove:K,observeIntersection:p},i):(0,x.Y)(_,{chatId:e.chatId,messageId:e.id,className:"message-reaction",chosenClassName:"chosen",containerId:a,isOwnMessage:e.isOutgoing,recentReactors:o,isOutside:n,reaction:t,onClick:F,onPaidClick:O,observeIntersection:p},i)),m]})})},45470:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(84051),a=n(32587),i=n(66644),s=n(96454),c=n(35297);const r=2,l=2;function d(e,t=!1,n,d=r,u,h){const m=(0,o.li)(),p=(0,o.li)();return(0,c.A)(()=>{t||(p.current=!1)},[e,t]),(0,o.vJ)(()=>{const o=m.current;if(!e||!o||t||p.current)return;p.current=!0;const c=new Image,r=()=>{const e=u||c.width,t=h||c.height,n=o.getContext("2d",{alpha:!1});(0,i.RK)(()=>{o.width=e,o.height=t,s.QH&&(n.filter=`blur(${d}px)`),n.drawImage(c,2*-d,2*-d,e+4*d,t+4*d),s.QH||(0,a.A)(n,0,0,e,t,d,l)})};c.onload=()=>{n?(0,i.YS)(r):r()},c.src=e},[e,t,h,u,d,n]),m}},45780:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(96454),a=n(87357),i=n(17712),s=n(59030),c=n(42452);var r=n(20021);const l=({title:e,subtitle:t,avatarElement:n,inputElement:l,inputPosition:d="start",disabled:u,inactive:h,ripple:m,className:p,titleClassName:g,subtitleClassName:A,style:f,onClick:v,onDisabledClick:C})=>{const y=(0,s.A)(),S=!h&&!u,I=(0,i.A)(()=>{h||(u?C?.():v?.())});return(0,r.FD)("div",{className:(0,a.A)("OHkx_W75",t&&"neXqB2_A",u&&"tvZeVJPh",S&&"VUSwo4t5",n&&"dMT9byM6",p),onClick:I,style:f,dir:y.isRtl?"rtl":void 0,role:S?"button":void 0,tabIndex:S?0:void 0,children:[!u&&!h&&m&&(0,r.Y)(c.A,{}),Boolean(l)&&(0,r.Y)("div",{className:(0,a.A)("kmjqObdP","end"===d?"iqGhSQGm":"F0Hv3EQm"),children:l}),Boolean(n)&&(0,r.Y)("div",{className:"dnAaRPCo",children:n}),(0,r.Y)("div",{className:(0,a.A)("JSSC0N8V",g),children:e}),Boolean(t)&&(0,r.Y)("div",{className:(0,a.A)("OYmzCSp2",A),children:t}),!l&&o.pz&&(0,r.Y)("div",{className:"P53DrbWA"})]})}},49086:(e,t,n)=>{n.d(t,{C:()=>m,V:()=>h});var o=n(13439),a=n(23174),i=n(90709),s=n(3544),c=n(60343),r=n(43044),l=n(58849),d=n(4961),u=n(18501);function h({message:e,highlight:t,emojiSize:n,asPreview:o,truncateLength:a,isProtected:s,forcePlayback:d,shouldRenderAsHtml:h,isForMediaViewer:m,threadId:p,maxTimestamp:g}){const{text:A,entities:f}=e.content.text||{};if(!A){const t=(0,i.BN)((0,r.Yw)(),e)?.text;return t?[(0,l.A)(t,a)]:void 0}const v=(0,c.bj)(e);return(0,u.fd)({text:(0,l.A)(A,a),entities:f,highlight:t,emojiSize:n,shouldRenderAsHtml:h,containerId:`${m?"mv-":""}${v}`,asPreview:o,isProtected:s,forcePlayback:d,messageId:"id"in e?e.id:void 0,chatId:e.chatId,threadId:p,maxTimestamp:g})}function m(e,t,n=!1,c,r=s.vs){const{entities:u}=t.content.text||{},m=(0,o.mS)(),p=(0,i.ni)(m,t),g=u?.some(e=>e.type===a.C7.Spoiler),A=u?.some(e=>e.type===a.C7.CustomEmoji);if(!g&&!A){const o=(0,l.A)((0,s.dS)(e,t,p,n),r);return c?(0,d.A)(o,["emoji","highlight"],{highlight:c}):(0,d.A)(o)}const f=!n&&(0,s.Su)(t),v=f?`${f} `:"",C=h({message:t,highlight:c,asPreview:!0,truncateLength:r}),y=(0,s.oL)(e,t,p,C);return[...(0,d.A)(v),...Array.isArray(y)?y:[y]].filter(Boolean)}},49746:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(84051),a=n(13439);function i(e,t,n,i,s){const{loadMessage:c}=(0,a.ko)();(0,o.vJ)(()=>{s||t&&!n&&c({chatId:e,messageId:t,replyOriginForId:i})},[s,e,n,t,i])}},54960:(e,t,n)=>{n.d(t,{A:()=>P});var o=n(84051),a=n(13439),i=n(31481),s=n(66644),c=n(90709),r=n(70636),l=n(91048),d=n(87357),u=n(87894),h=n(79824),m=n(96374),p=n(17712),g=n(59030),A=n(19806),f=n(46222),v=n(40664),C=n(52745),y=n(24956),S=n(21849),I=n(34431),w=n(18276),R=n(10187),N=n(45780),b=n(31722),M=n(20021);const x="PeerPickerItem",P=(0,o.ph)(({className:e,categories:t,itemIds:n,categoryPlaceholderKey:P,filterValue:k,filterPlaceholder:Y,notFoundText:T,searchInputId:D,itemClassName:L,isLoading:E,noScrollRestore:F,isSearchable:B,lockedUnselectedSubtitle:O,forceShowSelf:K,isViewOnly:_,itemInputType:U,withStatus:$,withPeerTypes:J,withPeerUsernames:z,withDefaultPadding:j,onFilterChange:H,onDisabledClick:q,onLoadMore:G,...V})=>{const W=(0,g.A)(),X=V.allowMultiple,Z=X?V.lockedSelectedIds:void 0,Q=X?V.lockedUnselectedIds:void 0,ee=(0,o.Kr)(()=>X?V.selectedCategories:V.selectedCategory?[V.selectedCategory]:h.p,[X,V.selectedCategory,V.selectedCategories]),te=(0,o.Kr)(()=>X?V.selectedIds:V.selectedId?[V.selectedId]:h.p,[X,V.selectedId,V.selectedIds]),ne=(0,o.li)(),oe=te.length>10;(0,o.vJ)(()=>{if(!B)return;const e=window.setTimeout(()=>{(0,s.YS)(()=>{ne.current?.focus()})},500);return()=>{window.clearTimeout(e)}},[B]);const ae=(0,o.Kr)(()=>new Set(Z),[Z]),ie=(0,o.Kr)(()=>new Set(Q),[Q]),se=(0,o.Kr)(()=>te.filter(e=>!ae.has(e)),[ae,te]),ce=(0,o.Kr)(()=>t?(0,u.dU)(t,"type"):{},[t]),re=(0,o.Kr)(()=>{if(k)return n;const e=[],t=[],o=[];return n.forEach(n=>{ae.has(n)?e.push(n):ie.has(n)?o.push(n):t.push(n)}),e.concat(t,o)},[k,n,ae,ie]),le=(0,p.A)(e=>{if(ae.has(e))q?.(e,!0);else if(ie.has(e))q?.(e,!1);else{if(X&&ce[e]){const t=ce[e].type,n=ee?.slice()||[];return n.includes(t)?n.splice(n.indexOf(t),1):n.push(t),void V.onSelectedCategoriesChange?.(n)}if(X){const t=te.slice();return t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),void V.onSelectedIdsChange?.(t)}ce[e]?V.onSelectedCategoryChange?.(ce[e].type):V.onSelectedIdChange?.(e)}}),de=(0,p.A)(e=>{const{value:t}=e.currentTarget;H?.(t)}),[ue,he]=(0,m.A)(G,re,Boolean(k)),me=(0,o.hb)((e,t)=>{const n=(0,a.mS)(),o=t?ce[e]:void 0,s=t?void 0:(0,l.PVB)(n,e),u=s||o;if(!u)return i.Oig?(0,M.FD)("div",{children:["No peer or category with ID",e]},e):void 0;const h=s&&!(0,r.vj)(s)?s.isSelf&&!K:void 0,m=ie.has(e),p=ae.has(e),g=m||p,f=o?ee?.includes(o.type):te.includes(e),[v,C]=function(){if(m)return[O];if(s){if(z){const e=(0,c.Kl)(s);if(e)return[`@${e}`]}if($){if((0,r.vj)(s))return[(0,c.sT)(W,s)];const e=(0,l.K0y)(n,s.id);return[(0,c.CD)(W,s,e),(0,d.A)((0,c.PF)(s,e,!0)&&b.A.onlineStatus)]}if(J){const e=(0,r.cy)(s);return e&&[W(e)]}}}()||[];return(0,M.Y)(N.A,{className:(0,d.A)(x,L),title:(0,M.Y)(I.A,{peer:u}),avatarElement:(0,M.Y)(S.A,{peer:s||o,isSavedMessages:h,size:"medium"}),subtitle:v,subtitleClassName:C,disabled:g,inactive:_,ripple:!0,inputElement:g?(0,M.Y)(w.A,{name:"lock-badge"}):"radio"===U?(0,M.Y)(y.A,{checked:f,disabled:g,onlyInput:!0}):"checkbox"===U?(0,M.Y)(A.A,{checked:f,disabled:g,onlyInput:!0}):void 0,inputPosition:"end",onClick:()=>le(e),onDisabledClick:q&&(()=>q(e,p))},e)},[ce,K,_,L,U,W,ae,ie,O,q,ee,te,J,$,z]),pe=(0,o.Kr)(()=>{if(t?.length)return(0,M.FD)("div",{children:[P&&(0,M.Y)("div",{className:b.A.pickerCategoryTitle,children:W(P)}),t?.map(e=>me(e.type,!0)),(0,M.Y)("div",{className:b.A.pickerCategoryTitle,children:W("FilterChats")})]},"categories")},[t,P,W,me]);return(0,M.FD)("div",{className:(0,d.A)(b.A.container,e),children:[B&&(0,M.FD)("div",{className:(0,d.A)(b.A.header,"custom-scroll"),dir:W.isRtl?"rtl":void 0,children:[ee?.map(e=>(0,M.Y)(R.A,{className:b.A.peerChip,customPeer:ce[e],onClick:le,clickArg:e,canClose:!0})),Z?.map((e,t)=>(0,M.Y)(R.A,{className:b.A.peerChip,peerId:e,isMinimized:oe&&t<te.length-5,forceShowSelf:K,onClick:le,clickArg:e})),se.map((e,t)=>(0,M.Y)(R.A,{className:b.A.peerChip,peerId:e,isMinimized:oe&&t+(Z?.length||0)<te.length-5,canClose:!0,onClick:le,clickArg:e})),(0,M.Y)(v.A,{id:D,ref:ne,value:k,onChange:de,placeholder:Y||W("SelectChat")})]}),ue?.length?(0,M.Y)(f.A,{className:(0,d.A)(b.A.pickerList,j&&b.A.padded,"custom-scroll"),items:ue,itemSelector:`.${x}`,beforeChildren:pe,onLoadMore:he,noScrollRestore:F,children:ue.map(e=>me(e))}):E||!ue||ue.length?(0,M.Y)(C.A,{}):(0,M.Y)("p",{className:b.A.noResults,children:T||"Sorry, nothing found."})]})})},56133:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(16581);function a(e,t,n,a=[]){return(0,o.A)(e=>{e()},a,e,t,n)}},57446:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(13439),a=n(66644),i=n(91048),s=n(19822);const c=300,r=new Map;function l(e,t,n=c){(0,i.PKK)((0,o.mS)())||(n=0);const l="rtl"===e.getAttribute("dir"),{scrollLeft:d,offsetWidth:u,scrollWidth:h,dataset:{scrollId:m}}=e;let p=t-d;if(p<0){const e=-d*(l?-1:1);p=Math.max(p,e)}else if(p>0){const e=h-(d+u);p=Math.min(p,e)}if(0===p)return Promise.resolve();m&&r.has(m)&&r.get(m)();const g=d+p;return new Promise(t=>{(0,a.RK)(()=>{if(0===n)return e.scrollLeft=g,void t();let o=!1;const i=Math.random().toString();e.dataset.scrollId=i,r.set(i,()=>{o=!0}),e.style.scrollSnapType="none";const c=Date.now();function l(){e.style.scrollSnapType="",delete e.dataset.scrollId,r.delete(i)}(0,s.i0)(()=>{if(o)return l(),!1;const a=Math.min((Date.now()-c)/n,1),i=p*(1-function(e){return 1-(1-e)**3.5}(a));return e.scrollLeft=Math.round(g-i),a>=1&&(l(),t()),a<1},a.RK)})})}},58968:(e,t,n)=>{n.d(t,{I5:()=>s,LS:()=>i,V2:()=>a,lw:()=>o});const o={isCustomPeer:!0,type:"premium",titleKey:"PrivacyPremium",subtitleKey:"PrivacyPremiumText",avatarIcon:"star",isAvatarSquare:!0,withPremiumGradient:!0},a=[{isCustomPeer:!0,type:"contacts",titleKey:"FilterContacts",avatarIcon:"user",isAvatarSquare:!0,peerColorId:5},{isCustomPeer:!0,type:"nonContacts",titleKey:"FilterNonContacts",avatarIcon:"non-contacts",isAvatarSquare:!0,peerColorId:4},{isCustomPeer:!0,type:"groups",titleKey:"FilterGroups",avatarIcon:"group",isAvatarSquare:!0,peerColorId:3},{isCustomPeer:!0,type:"channels",titleKey:"FilterChannels",avatarIcon:"channel",isAvatarSquare:!0,peerColorId:1},{isCustomPeer:!0,type:"bots",titleKey:"FilterBots",avatarIcon:"bots",isAvatarSquare:!0,peerColorId:6}],i=[{isCustomPeer:!0,type:"excludeMuted",titleKey:"FilterMuted",avatarIcon:"mute",isAvatarSquare:!0,peerColorId:6},{isCustomPeer:!0,type:"excludeRead",titleKey:"FilterRead",avatarIcon:"readchats",isAvatarSquare:!0,peerColorId:4},{isCustomPeer:!0,type:"excludeArchived",titleKey:"FilterArchived",avatarIcon:"archive",isAvatarSquare:!0,peerColorId:5}],s={isCustomPeer:!0,type:"hidden",titleKey:"StarsTransactionHidden",avatarIcon:"author-hidden",peerColorId:4}},64489:(e,t,n)=>{n.d(t,{A:()=>m});var o=n(84051),a=n(87357),i=n(95807),s=n(37661),c=n(17712),r=n(83057),l=n(4438);const d="lM2usrZU";var u=n(20021);const h=new Set,m=(0,o.ph)(function(e){const{previewUrl:t,thumbDataUri:n,className:o,...m}=e,[p,,g]=(0,s.A)(Boolean(n)),A=(0,r.A)(p),[f,v,C]=(0,s.A)(h.has(t)),y=(0,r.A)(f),[S,I]=(0,s.A)(!1),w=(0,c.A)(()=>{v(),h.add(t)}),R=(0,c.A)(()=>{g(),C(),setTimeout(I,300)}),{size:N}=e;return(0,u.FD)("div",{className:(0,a.A)(o,"xCi2f0YH"),style:(0,i.A)(void 0!==N&&`width: ${N}px; height: ${N}px;`),children:[n&&!S&&(0,u.Y)("img",{src:n,className:(0,a.A)(d,A),draggable:!1}),t&&!S&&(0,u.Y)("img",{src:t,className:(0,a.A)(d,y),draggable:!1,onLoad:w}),(0,u.Y)(l.A,{...m,onLoad:R})]})})},65632:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),a=n(13439),i=n(31481),s=n(74824),c=n(87679);const r=(e,t)=>{const{setThemeSettings:n}=(0,a.ko)(),[r,l]=(0,o.J0)(t);return(0,o.vJ)(()=>{t&&(t.startsWith("#")?l(t):s.fetch(i.nfi,e,s.Type.Blob).then(e=>{const t=URL.createObjectURL(e);(0,c.NN)(t).then(()=>{l(`url(${t})`)})}).catch(()=>{n({theme:e,background:void 0,backgroundColor:void 0,isBlurred:!0,patternColor:"dark"===e?i.MkD:i.be8})}))},[t,e]),t?r:void 0}},66833:(e,t,n)=>{function o(e){return"starGift"===e.type?e.sticker:e.attributes.find(e=>"model"===e.type)?.sticker}function a(e){return"starGift"===e.type?e.availabilityTotal:e.totalCount}function i(e){if("starGiftUnique"===e.type)return function(e){const t=e.find(e=>"model"===e.type),n=e.find(e=>"backdrop"===e.type),o=e.find(e=>"pattern"===e.type);return{model:t,originalDetails:e.find(e=>"originalDetails"===e.type),pattern:o,backdrop:n}}(e.attributes)}n.d(t,{UC:()=>a,uc:()=>i,yQ:()=>o})},68292:(e,t,n)=>{n.d(t,{A:()=>p});var o=n(84051),a=n(13439),i=n(91048),s=n(87357),c=n(37836),r=n(30857),l=n(39351),d=n(73767);var u=n(20021);let h=0;const m=(0,c.Fe)(()=>{h=0}),p=(0,o.ph)(({text:e,className:t,isDisabled:n,ref:c})=>{const{isRtl:p}=(0,l.A)(),g=(0,d.A)(e),A=(0,r.A)(),f=!(!(!n&&(0,i.PKK)((0,a.mS)())&&void 0!==g&&g!==e)||h>=10||(0===h&&m(),h++,0)),v=(0,o.Kr)(()=>f?function(e,t){const n=[],o=e.length,a=t?.length??0;for(let i=0;i<=o;i++){const s=o-i,c=a-i;t&&c>=0&&e[s]!==t[c]?n.unshift((0,u.FD)("div",{className:"IYTzbS8o",children:[(0,u.Y)("div",{className:"Jw1oQFdk",children:e[s]??""}),(0,u.Y)("div",{className:"TZfEz3sc",children:t[c]}),(0,u.Y)("div",{className:"Y9ied8_t",children:e[s]??""})]})):n.unshift((0,u.Y)("span",{children:e[s]??""}))}return n}(e,g):e,[f,g,e]);return(0,o.vJ)(()=>{if(!f)return;const e=window.setTimeout(()=>{A()},200);return()=>{window.clearTimeout(e)}},[f,e]),(0,u.Y)("span",{ref:c,className:(0,s.A)(t,!n&&"tgKbsVmz"),dir:p?"rtl":void 0,children:v})})},69988:(e,t,n)=>{n.d(t,{A:()=>o});const o={root:"gXO57D98",chosen:"VXSJn0Sm",paid:"N3lcrsh8",outside:"Hqw10FGl","animated-emoji":"lFjoRm_p",animatedEmoji:"lFjoRm_p",tag:"Dr889Kzc",tail:"cUfY1b26","is-safari":"rxxUijuG",isSafari:"rxxUijuG","tail-fill":"y591o4fN",tailFill:"y591o4fN","tag-text":"ly7cruxF",tagText:"ly7cruxF",counter:"P2FqNJAi",disabled:"NRtGofbf",paidCounter:"CW4UO1n3"}},73104:(e,t,n)=>{let o,a;n.d(t,{M6:()=>r,v5:()=>l});const i={Down:!0,ArrowDown:!0,Up:!0,ArrowUp:!0,Left:!0,ArrowLeft:!0,Right:!0,ArrowRight:!0," ":!0,PageUp:!0,PageDown:!0,End:!0,Home:!0,Tab:!0},s=e=>{const t="deltaY"in e?e.deltaY:(e=>"changedTouches"in e?e.changedTouches[0].clientY:0)(e);if(!o||!o.contains(e.target)||o.scrollTop<=0&&t<=0||o.scrollTop>=o.scrollHeight-o.offsetHeight&&t>=0){if(a&&e.target.closest(a))return;e.preventDefault()}};function c(e){i[e.key]&&!function(e){if(!(e&&e instanceof HTMLElement))return!1;const t=e,n=t.tagName.toLowerCase();if("textarea"===n)return!0;if("input"!==n)return!1;const o=t.getAttribute("type");return!!o&&["text","password","number","email","tel","url","search","date","datetime","datetime-local","time","month","week"].indexOf(o.toLowerCase())>-1}(e.target)&&e.preventDefault()}function r(e,t){return o=e,a=t,document.addEventListener("wheel",s,{passive:!1}),document.addEventListener("touchmove",s,{passive:!1}),document.onkeydown=c,l}function l(){o=void 0,a=void 0,document.removeEventListener("wheel",s),document.removeEventListener("touchmove",s),document.onkeydown=null}},74984:(e,t,n)=>{n.d(t,{Jm:()=>l,Rh:()=>s,g5:()=>r,ic:()=>c});var o=n(84051),a=n(49763),i=n(30857);function s(e){const t=(0,i.A)();return(0,o.vJ)(()=>(0,a.Yw)(e,t),[e,t]),(0,a.YA)(e)}function c(){const e=(0,i.A)();return(0,o.vJ)(()=>(0,a.P1)(e),[e]),(0,a.PZ)()}function r(){const e=(0,i.A)();return(0,o.vJ)(()=>(0,a.BU)(e),[e]),(0,a.jn)()}function l(){const e=(0,i.A)();return(0,o.vJ)(()=>(0,a.dk)(e),[e]),(0,a.Xq)()}},76283:(e,t,n)=>{n.d(t,{A:()=>P});var o=n(84051),a=n(13439),i=n(90709),s=n(87357),c=n(17712),r=n(59030),l=n(18276),d=n(64493),u=n(96530),h=n(58443),m=n(76023),p=n(10722),g=n(4438),A=n(87412);const f="uGUjDZKl",v="M62HGuIV",C="WMpEr5XQ";var y=n(20021);const S=2*m.$,I=(0,o.ph)(({reaction:e,chosen:t,isReady:n,noAppearAnimation:a,style:i,isLocked:r,onToggleReaction:d,onSendPaidReaction:u,onShowPaidReactionModal:m})=>{const I=(0,o.li)(),w=(0,c.A)(()=>{"paid"!==e.type?d(e):u?.()}),{isContextMenuOpen:R,handleBeforeContextMenu:N,handleContextMenu:b,handleContextMenuClose:M,handleContextMenuHide:x}=(0,p.A)(I,"paid"!==e.type,void 0,void 0,void 0,!0);return(0,o.vJ)(()=>{R&&(m?.(),M(),x())},[M,m,x,R]),(0,y.FD)("div",{className:(0,s.A)(f,"oc1hpMwv",t&&"paid"!==e.type&&v,!a&&n&&"sx6RTuAU",a&&"kqcWe4tf"),ref:I,style:i,onClick:w,onMouseDown:N,onContextMenu:b,children:["paid"===e.type?(0,y.Y)(g.A,{tgsUrl:h.w.StarReaction,size:S,noLoop:!1}):(0,y.Y)(A.A,{documentId:e.documentId,size:S}),r&&(0,y.Y)(l.A,{className:C,name:"lock-badge"})]})});var w=n(37661),R=n(62587),N=n(18104);const b=2*m.$,M=(0,o.ph)(({reaction:e,isReady:t,noAppearAnimation:n,chosen:o,isLocked:a,onToggleReaction:i})=>{const c=(0,R.A)(`sticker${e.appearAnimation?.id}`,!t||n),r=(0,R.A)(`document${e.selectAnimation?.id}`,!t||n),d=(0,R.A)(`document${e.staticIcon?.id}`,!n),[u,h]=(0,w.A)(),[m,,p]=(0,w.A)(!0),[g,A,S]=(0,w.A)();return(0,y.FD)("div",{className:(0,s.A)(f,o&&v),onClick:function(){i(e.reaction)},onMouseEnter:t&&!m?A:void 0,children:[n&&(0,y.Y)("img",{className:"MZ2tH980",src:d,alt:e.reaction.emoticon,draggable:!1}),!u&&!n&&(0,y.Y)(N.A,{tgsUrl:c,play:m,noLoop:!0,size:b,onEnded:p,forceAlways:!0},e.appearAnimation?.id),!m&&!n&&(0,y.Y)(N.A,{tgsUrl:r,play:g,noLoop:!0,size:b,onLoad:h,onEnded:S,forceAlways:!0},e.selectAnimation?.id),a&&(0,y.Y)(l.A,{className:C,name:"lock-badge"})]})}),x=(0,s.x)("ReactionSelector"),P=(0,o.ph)(({allAvailableReactions:e,topReactions:t,defaultTagReactions:n,enabledReactions:h,currentReactions:m,reactionsLimit:p,isPrivate:g,isReady:A,canPlayAnimatedEmojis:f,className:v,isCurrentUserPremium:C,isInSavedMessages:S,isInStoryViewer:w,isForEffects:R,effectReactions:N,isWithPaidReaction:b,onClose:P,onToggleReaction:k,onSendPaidReaction:Y,onShowPaidReactionModal:T,onShowMore:D})=>{const{openPremiumModal:L}=(0,a.ko)(),E=(0,o.li)(),F=(0,r.A)(),B=S&&!C&&!w,O=Boolean(p&&m&&m.length>=p),K=(0,o.Kr)(()=>{const o=O?m?.map(e=>e.reaction):R?N:S?n:"some"===h?.type?h.allowed:e?.map(e=>e.reaction),a=o?.map(t=>{const n="custom"===t.type,o=e?.find(e=>(0,i.a0)(e.reaction,t));return R?o:(n||o)&&!o?.isInactive&&(g||O||h&&(0,i.A3)(t,h))?n?t:o:void 0}).filter(Boolean)||[],s=(0,i.fu)(a,t);return b&&s.unshift({type:"paid"}),s},[e,m,n,h,S,g,t,R,N,O,b]),_=(0,o.Kr)(()=>8===K.length?K:K.slice(0,7),[K]),U=_.length<K.length,$=(0,o.Kr)(()=>{const e=m?.filter(({chosenOrder:e})=>void 0!==e)||[];return new Set(e.map(({reaction:e})=>_.findIndex(t=>t&&(0,i.a0)("reaction"in t?t.reaction:t,e))))},[m,_]),J=(0,c.A)(()=>{const e=E.current?.getBoundingClientRect()||{x:0,y:0};D({x:e.x,y:e.y})}),z=(0,c.A)(()=>{P?.(),L({initialSection:"saved_tags"})}),j=(0,o.Kr)(()=>{if(S){if(!C){const e=F("lng_subscribe_tag_about").split("{link}");return(0,y.FD)("span",{children:[e[0],(0,y.Y)(u.A,{isPrimary:!0,onClick:z,children:F("lng_subscribe_tag_link")}),e[1]]})}return F("SavedTagReactionsHint2")}return w?F("StoryReactionsHint"):R?F("AddEffectMessageHint"):void 0},[C,S,w,F,R]);if(_.length)return(0,y.FD)("div",{className:(0,s.A)(x("&"),v),ref:E,children:[(0,y.Y)("div",{className:x("bubble-small",F.isRtl&&"isRtl")}),(0,y.FD)("div",{className:x("items-wrapper"),children:[(0,y.Y)("div",{className:x("bubble-big",F.isRtl&&"isRtl")}),(0,y.FD)("div",{className:x("items"),children:[j&&(0,y.Y)("div",{className:x("hint"),children:j}),(0,y.FD)("div",{className:x("reactions"),dir:F.isRtl?"rtl":void 0,children:[_.map((e,t)=>"reaction"in e?(0,y.Y)(M,{isReady:A,onToggleReaction:k,reaction:e,noAppearAnimation:!f,chosen:$.has(t),isLocked:B},(0,i.Jj)(e.reaction)):(0,y.Y)(I,{isReady:A,onToggleReaction:k,onSendPaidReaction:Y,onShowPaidReactionModal:T,reaction:e,noAppearAnimation:!f,chosen:$.has(t),isLocked:B,style:`--_animation-delay: ${20*(7-t)}ms`},(0,i.Jj)(e))),U&&(0,y.Y)(d.A,{color:"translucent",className:x("show-more"),onClick:J,children:(0,y.Y)(l.A,{name:"down"})})]})]})]})]})})},79174:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),a=n(66644),i=n(43874);const s=500,c=300;function r(e,t,n){const{isMobile:r}=(0,i.Ay)();(0,o.vJ)(()=>{t?r||setTimeout(()=>{(0,a.RK)(()=>{e.current?.isConnected&&e.current.focus()})},s):(e.current?.isConnected&&e.current.blur(),n&&setTimeout(n,c))},[e,r,t,n])}},79519:(e,t,n)=>{n.d(t,{A:()=>u});var o=n(84051),a=n(61433),i=n(31481),s=n(66644),c=n(81954);const r=500,l=i.nxZ,d=20;function u({elementRef:e,chatId:t,isFocused:n,focusDirection:i,noFocusHighlight:u,isResizingContainer:h,isJustAdded:m,isQuote:p,scrollTargetPosition:g}){const A=(0,o.li)(!m);(0,o.Nf)(()=>{const t=A.current;if(A.current=!1,n&&e.current){const n=e.current.closest(".MessageList"),o=u,m=g||o?"end":"centerOrTop",A=()=>{const t=void 0!==i?o?r:l:void 0,u=(0,c.Ay)({container:n,element:e.current,position:m,margin:d,maxDistance:t,forceDirection:i,forceNormalContainerHeight:h,shouldReturnMutationFn:!0});if(p){const t=e.current.querySelector(".is-quote");t&&(0,s.RK)(()=>{(0,a.YM)(t,"animate")})}return u};t?(0,s.gm)(A):(0,s.YS)(()=>{(0,s.RK)(A())})}},[e,t,n,i,u,h,p,g])}},79577:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(84051),a=n(23174),i=n(90709),s=n(62587),c=n(64489),r=n(20021);const l=(0,o.ph)(function(e){const{sticker:t,noLoad:n,forcePreview:o,...l}=e,d=t?.thumbnail?.dataUri,u=t&&(0,i.Mw)(t,"full"),h=(0,s.A)(t?(0,i.Mw)(t,"preview"):void 0,n&&!o,a.qZ.BlobUrl),m=(0,s.A)(u,n);return(0,r.Y)(c.A,{tgsUrl:m,previewUrl:h,thumbDataUri:d,...l})})},79582:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(13439),a=n(91048),i=n(87894);const s=3e9,c=3e8;function r(e,t=!1,n,r){const l=(0,o.mS)();return(0,i.My)(e,e=>{if(e===r)return 1/0;const o=(0,a.hds)(l,e);if(!o)return 0;let i=0;const d=(0,a.yHC)(l,e);return d&&(i+=d.date),t&&o.isVerified&&(i+=s),n&&n.includes(e)&&(i=Date.now()+c+(n.length-n.indexOf(e))),i},"desc")}},80539:(e,t,n)=>{n.d(t,{Ay:()=>r,g4:()=>l,qh:()=>s});var o=n(23174),a=n(31481),i=n(96454);const s={B:o.C7.Bold,STRONG:o.C7.Bold,I:o.C7.Italic,EM:o.C7.Italic,INS:o.C7.Underline,U:o.C7.Underline,S:o.C7.Strike,STRIKE:o.C7.Strike,DEL:o.C7.Strike,CODE:o.C7.Code,PRE:o.C7.Pre,BLOCKQUOTE:o.C7.Blockquote},c=3;function r(e,t=!1,n=!1){const r=document.createElement("div");r.innerHTML=n?e:function(e){let t=e.slice(0);return 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>"),i.TL||(t=t.replace(/\[<img[^>]+alt="([^"]+)"[^>]*>]/gm,"[$1]")),t=t.replace(/(?!<(?:code|pre)[^<]*|<\/)\[([^\]\n]+)\]\(customEmoji:(\d+)\)(?![^<]*<\/(?:code|pre)>)/g,'<img alt="$1" data-document-id="$2">'),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[*]{2}([^*\n]+)[*]{2}(?![^<]*<\/(code|pre)>)/g,"<b>$2</b>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[_]{2}([^_\n]+)[_]{2}(?![^<]*<\/(code|pre)>)/g,"<i>$2</i>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[~]{2}([^~\n]+)[~]{2}(?![^<]*<\/(code|pre)>)/g,"<s>$2</s>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[|]{2}([^|\n]+)[|]{2}(?![^<]*<\/(code|pre)>)/g,`<span data-entity-type="${o.C7.Spoiler}">$2</span>`),t}(t?function(e){return e.replace(new RegExp(`\\[([^\\]]+?)]\\((${a.kNZ}+?)\\)`,"g"),(e,t,n)=>`<a href="${n.includes("://")?n:n.includes("@")?`mailto:${n}`:`https://${n}`}">${t}</a>`)}(e):e),l(r);const d=r.innerText.trim().replace(/\u200b+/g,"");let u=-r.innerText.indexOf(d[0]),h=0;const m=[];function p(e){if(e.nodeType===Node.COMMENT_NODE)return;const{index:t,entity:n}=function(e,t,n){const a=function(e){if(e instanceof HTMLElement&&e.dataset.entityType)return e.dataset.entityType;if(s[e.nodeName])return s[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===o.C7.MentionName?o.C7.MentionName:t.dataset.entityType===o.C7.Url?o.C7.Url:t.href.startsWith("mailto:")?o.C7.Email:t.href.startsWith("tel:")?o.C7.Phone:t.href!==t.textContent?o.C7.TextUrl:o.C7.Url}return"SPAN"===e.nodeName?e.dataset.entityType:"IMG"===e.nodeName&&e.dataset.documentId?o.C7.CustomEmoji:void 0}(e);if(!a||!e.textContent)return{index:n,entity:void 0};const i=t.indexOf(e.textContent,n),c=i>=0?i:n,r=t.substring(0,c).length,{length:l}=t.substring(c,c+e.textContent.length);if(a===o.C7.TextUrl)return{index:c,entity:{type:a,offset:r,length:l,url:e.href}};if(a===o.C7.MentionName)return{index:c,entity:{type:a,offset:r,length:l,userId:e.dataset.userId}};if(a===o.C7.Pre)return{index:c,entity:{type:a,offset:r,length:l,language:e.dataset.language}};if(a===o.C7.CustomEmoji)return{index:c,entity:{type:a,offset:r,length:l,documentId:e.dataset.documentId}};if(a===o.C7.Timestamp){const t=Number(e.dataset.timestamp);return Number.isNaN(t)?{index:c,entity:void 0}:{index:c,entity:{type:a,offset:r,length:l,timestamp:t}}}return{index:c,entity:{type:a,offset:r,length:l}}}(e,d,u);if(n)u=t,m.push(n);else if(e.textContent){if(0===t&&""===e.textContent.trim())return;u+=e.textContent.length}e.hasChildNodes()&&h<=c&&(h+=1,Array.from(e.childNodes).forEach(p))}return Array.from(r.childNodes).forEach(e=>{h=1,p(e)}),{text:d,entities:m.length?m:void 0}}function l(e){e.querySelectorAll("img").forEach(e=>{e.dataset.documentId?e.textContent=e.alt||"":e.replaceWith(e.alt||"")})}},81686:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(31481);const a=1;function i(){const e=window.getSelection();let t=e?.rangeCount?e.getRangeAt(0).cloneContents():void 0;const n=e?.focusNode&&e.focusOffset>0&&s(e.focusNode,o.zPk);if(!t||0===t.childElementCount)return;const i=Array.from(t.children).reduce((e,t)=>t.nodeType===a&&t.classList.contains("message-date-group")?Array.from(t.querySelectorAll(".Message")).reduce((e,t)=>e.concat(Number(t.dataset.messageId)),e):t.nodeType===a&&t.classList.contains("Message")?e.concat(Number(t.dataset.messageId)):e,[]);for(;t.firstChild;)t.removeChild(t.firstChild);return t=void 0,n||i.pop(),i}function s(e,t){return!(e.nodeType!==a||!e.classList.contains(t))||!!e.parentNode&&s(e.parentNode,t)}},81949:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(87357);var a=n(20021);const i=({children:e,className:t,onClick:n,onMouseDown:i})=>(0,a.Y)("div",{className:(0,o.A)("hJUqHi4B",n&&"hjDEmFaT",t),onClick:n,onMouseDown:i,children:e})},81954:(e,t,n)=>{n.d(t,{Ay:()=>g,H$:()=>C,_v:()=>A,o8:()=>v});var o=n(84051),a=n(13439),i=n(89925),s=n(31481),c=n(66644),r=n(91048),l=n(96454),d=n(16460),u=n(19822);let h,m,p=!1;function g(e){h=e;const t=f(e);if(e.shouldReturnMutationFn)return t;(0,c.RK)(t)}function A(){p&&((0,u.vk)(),(0,c.YS)(()=>{(0,c.RK)(f(h))}))}function f(e){const{container:t,element:n,position:g,margin:A=0,maxDistance:f=s.nxZ,forceDirection:v,forceNormalContainerHeight:C}=e;let I=e.forceDuration;v!==i.CC.Static&&(0,r.PKK)((0,a.mS)())||(I=0);const{offsetHeight:w}=n,{scrollTop:R,clientHeight:N,scrollHeight:b}=t,M=(0,d.A)(n,t).top,x=C&&t.dataset.normalHeight?Number(t.dataset.normalHeight):N;let P;switch(g){case"start":P=M-A+(l.Ni?1:0);break;case"end":P=M+w+A-x;break;case"nearest":case"center":case"centerOrTop":P=w<x?M+w/2-x/2:M-A}const k=function(e,t,n=s.nxZ,o){const{scrollTop:a}=e;if(void 0===o){const e=t-a;if(e<-n)return a+(e+n);if(e>n)return a+(e-n)}else{if(o===i.CC.Up)return t+n;if(o===i.CC.Down)return Math.max(0,t-n)}return a}(t,P,f,v);let Y=P-k;if(Y<0){const e=-k;Y=Math.max(Y,e)}else if(Y>0){const e=b-(k+x);Y=Math.min(Y,e)}const T=Math.abs(Y);return()=>{if(T<1)return void(R!==k&&(t.scrollTop=k));const e=k+Y;if(0===I)return void(t.scrollTop=e);const n=T<=s.s8T?y:S,a=I||s.SKD+T/s.nxZ*(s.OzO-s.SKD),i=Date.now();p=!0;const r=m;m=(0,o.VK)(void 0,!0),r?.(),(0,u.S0)(()=>{const o=Math.min((Date.now()-i)/a,1),s=Y*(1-n(o)),c=Math.round(e-s);return t.scrollTop=c,p=o<1&&c!==e,p||(h=void 0,m?.(),m=void 0),p},c.RK)}}function v(){return p}function C(){m(),m=void 0}function y(e){return 1-(1-e)**3.5}function S(e){return 1-(1-e)**6}},83594:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(84051),a=n(90709),i=n(96454),s=n(87357),c=n(95807),r=n(62587),l=n(87412);const d="PZAuNVZH";var u=n(20021);const h=(0,o.ph)(({reaction:e,isLottie:t,className:n,particleSize:h,onEnded:m})=>{const p=(0,a.aL)(e.documentId,!0),g=(0,r.A)(t?void 0:p),A=(0,o.Kr)(()=>i.ol?Array.from({length:7}).map(()=>function(e=20){const t=(e/2+Math.random()*e*3)*(Math.random()>.5?1:-1),n=e+Math.random()*e*4;return`M 0 0 C 0 0 ${t} ${-n-e} ${t} ${n}`}(h)):[],[h]);if(g||t)return(0,u.Y)("div",{className:(0,s.A)("aInga6VW",n),style:(0,c.A)(Boolean(h)&&`--particle-size: ${h}px`),children:A.map((n,o)=>{const a=`--offset-path: path('${n}');`;return t?(0,u.Y)(l.A,{documentId:e.documentId,className:d,style:a,withSharedAnimation:!0,size:h,onAnimationEnd:0===o?m:void 0}):(0,u.Y)("img",{src:g,alt:"",className:d,style:a,draggable:!1,onAnimationEnd:0===o?m:void 0})})})})},92915:(e,t,n)=>{n.d(t,{A:()=>S});var o=n(84051),a=n(13439),i=n(87357),s=n(76023),c=n(10722),r=n(37661),l=n(17712),d=n(59030),u=n(11241),h=n(64493),m=n(40664),p=n(22337);var g=n(20021);const A=(0,o.ph)(({isOpen:e,title:t,subtitle:n,placeholder:a,submitText:i,maxLength:s,initialValue:c="",onClose:r,onSubmit:u})=>{const A=(0,d.A)(),[f,v]=(0,o.J0)(c),C=(0,l.A)(e=>{v(e.target.value)}),y=(0,l.A)(()=>{u(f)});return(0,g.FD)(p.A,{className:"narrow",title:t,isOpen:e,onClose:r,isSlim:!0,children:[Boolean(n)&&(0,g.Y)("div",{className:"cGrbcqD_",children:n}),(0,g.Y)(m.A,{placeholder:a,value:f,onChange:C,maxLength:s,teactExperimentControlled:!0}),(0,g.FD)("div",{className:"dialog-buttons mt-2",children:[(0,g.Y)(h.A,{className:"confirm-dialog-button",onClick:y,children:i||A("Save")}),(0,g.Y)(h.A,{className:"confirm-dialog-button",isText:!0,onClick:r,children:A("Cancel")})]})]})});var f=n(71429),v=n(24433),C=n(69988);const y=1.25*s.$,S=(0,o.ph)(({reaction:e,tag:t,containerId:n,isChosen:s,isOwnMessage:m,className:p,chosenClassName:S,withCount:I,isDisabled:w,withContextMenu:R,observeIntersection:N,onClick:b,onRemove:M})=>{const{editSavedReactionTag:x}=(0,a.ko)(),P=(0,o.li)(),k=(0,o.li)(),Y=(0,d.A)(),[T,D,L]=(0,r.A)(),{title:E,count:F}=t||{},B=Boolean(E||I&&F),O=(0,l.A)(()=>{b?.(e)}),K=(0,l.A)(()=>{M?.(e)}),_=(0,l.A)(t=>{x({reaction:e,title:t}),L()}),{isContextMenuOpen:U,contextMenuAnchor:$,handleBeforeContextMenu:J,handleContextMenu:z,handleContextMenuClose:j,handleContextMenuHide:H}=(0,c.A)(P,!R,void 0,void 0,void 0,!0),q=(0,l.A)(()=>P.current),G=(0,l.A)(()=>document.body),V=(0,l.A)(()=>k.current),W=(0,l.A)(()=>({withPortal:!0,shouldAvoidNegativePosition:!0}));if(!I||0!==F)return(0,g.FD)(h.A,{className:(0,i.A)(C.A.root,C.A.tag,m&&C.A.own,s&&C.A.chosen,s&&S,w&&C.A.disabled,p),size:"tiny",onClick:O,onMouseDown:J,onContextMenu:z,ref:P,children:[(0,g.Y)(u.A,{className:C.A.animatedEmoji,containerId:n,reaction:e,loopLimit:1,size:y,observeIntersection:N}),B&&(0,g.FD)("span",{className:C.A.tagText,children:[E&&(0,g.Y)("span",{children:E}),I&&(0,g.Y)("span",{children:F})]}),(0,g.Y)("svg",{className:C.A.tail,width:"15",height:"30",viewBox:"0 0 15 30",children:(0,g.Y)("path",{className:C.A.tailFill,d:"m 0,30 c 3.1855,0 6.1803,-1.5176 8.0641,-4.0864 l 5.835,-7.9568 c 1.2906,-1.7599 1.2906,-4.1537 0,-5.9136 L 8.0641,4.08636 C 6.1803,1.51761 3.1855,0 0,0"})}),R&&(0,g.Y)(A,{isOpen:T,maxLength:15,title:Y(t?.title?"SavedTagRenameTag":"SavedTagLabelTag"),subtitle:Y("SavedTagLabelTagText"),placeholder:Y("SavedTagLabelPlaceholder"),initialValue:t?.title,onClose:L,onSubmit:_}),R&&$&&(0,g.FD)(f.A,{ref:k,isOpen:U,anchor:$,getTriggerElement:q,getRootElement:G,getMenuElement:V,getLayout:W,autoClose:!0,withPortal:!0,onClose:j,onCloseAnimationEnd:H,children:[(0,g.Y)(v.A,{icon:"tag-filter",onClick:O,children:Y("SavedTagFilterByTag")}),(0,g.Y)(v.A,{icon:"tag-name",onClick:D,children:Y(t?.title?"SavedTagRenameTag":"SavedTagLabelTag")}),(0,g.Y)(v.A,{icon:"tag-crossed",destructive:!0,onClick:K,children:Y("SavedTagRemoveTag")})]})]})})},93879:(e,t,n)=>{n.d(t,{A:()=>o});const o={root:"O9uCTt5C","animated-icon":"HiI6SMxF",animatedIcon:"HiI6SMxF",effect:"NhFcTGja",animating:"ikfZ6Igz",withEffectOnly:"jjRJmHCg"}},99515:(e,t,n)=>{n.d(t,{A:()=>ee});var o=n(84051),a=n(13439),i=n(23174),s=n(31481),c=n(90709),r=n(91048),l=n(56494),d=n(87357),u=n(85982),h=n(9716),m=n(80539);const p=document.createElement("div"),g=new Set([i.C7.Bold,i.C7.Italic,i.C7.Underline,i.C7.Strike,i.C7.Spoiler,i.C7.CustomEmoji]);function A(e){const t=function(e){const t=e.cloneContents();p.appendChild(t);const n=function(e,t){const n=e.commonAncestorContainer;if(n.nodeType===Node.ELEMENT_NODE&&n.classList.contains("text-content"))return t;let o=e.commonAncestorContainer.parentElement;for(;o&&!o.classList.contains("text-content");){const e=o.tagName.toLowerCase(),n=o.dataset.entityType;t=`<${e} ${n?`data-entity-type="${n}"`:""}>${t}</${e}>`,o=o.parentElement}return t}(e,p.innerHTML);return p.innerHTML="",n.replace(/<br\s*\/?>/gi,"\n").replace(/ /gi," ").replace(/\u00a0/gi," ")}(e);return function(e){if(!e.entities)return e;const t=e.entities.filter(e=>g.has(e.type));return{...e,entities:t.length?t:void 0}}((0,m.Ay)(t,!1,!0))}var f=n(37661),v=n(39351),C=n(17712),y=n(59030),S=n(24531),I=n(34201),w=n(80089),R=n(80464),N=n(20021);const b=e=>{const{isOpen:t}=e,n=(0,R.A)(w.ar.Extra,"PinMessageModal",!t);return n?(0,N.Y)(n,{...e}):void 0};var M=n(94189),x=n(73104),P=n(76023),k=n(4961),Y=n(3544),T=n(96454),D=n(81686),L=n(43044),E=n(58554),F=n(49086);function B(e){return e?"lng_context_copy_selected":"lng_context_copy_text"}var O=n(43874),K=n(26875),_=n(71429),U=n(24433),$=n(60859),J=n(55158),z=n(17663);const j="C3LVl_JT",H="cd1ZZeSy",q=(0,o.ph)(function({message:e}){const t=(0,y.A)(),{editDate:n}=e,o=!n;return(0,N.Y)(U.A,{icon:"clock-edit",className:j,children:o?(0,N.Y)(J.A,{className:H}):Boolean(n)&&t("Chat.PrivateMessageEditTimestamp.Date",(0,z.U)(t,1e3*n))})});var G=n(76283),V=n(41036);const W=(0,o.ph)(function({message:e,shouldRenderShowWhen:t,canLoadReadDate:n,closeContextMenu:o}){const{openPrivacySettingsNoticeModal:i}=(0,a.ko)(),s=(0,y.A)(),{readDate:c}=e,r=n&&!c&&!t;return(0,N.Y)(U.A,{icon:"message-read",className:j,children:(0,N.Y)(V.Ay,{name:"fade",activeKey:r?1:2,className:"mg4sBQ9n",children:r?(0,N.Y)(J.A,{className:H}):(0,N.FD)(N.FK,{children:[Boolean(c)&&s("PmReadAt",(0,z.U)(s,1e3*c)),!c&&t&&(0,N.FD)("div",{children:[s("PmRead"),(0,N.Y)("span",{className:"bmxij_dk",onClick:()=>{o(),i({chatId:e.chatId,isReadDate:!0})},children:s("PmReadShowWhen")})]})]})})})}),X=(0,o.ph)(({isReactionPickerOpen:e,availableReactions:t,topReactions:n,defaultTagReactions:s,isOpen:r,message:l,poll:m,webPage:p,story:g,isPrivate:A,isCurrentUserPremium:S,enabledReactions:I,isWithPaidReaction:w,reactionsLimit:R,anchor:b,targetHref:M,canSendNow:z,canReschedule:j,canBuyPremium:H,canReply:V,canQuote:X,canEdit:Z,canAppendTodoList:Q,noReplies:ee,canPin:te,canUnpin:ne,canDelete:oe,canForward:ae,canReport:ie,canFaveSticker:se,canUnfaveSticker:ce,canCopy:re,canCopyLink:le,canSelect:de,canDownload:ue,canSaveGif:he,canRevote:me,canClosePoll:pe,canTranslate:ge,canShowOriginal:Ae,canSelectLanguage:fe,isDownloading:ve,repliesThreadInfo:Ce,canShowSeenBy:ye,canShowReactionsCount:Se,canShowReactionList:Ie,seenByRecentPeers:we,hasCustomEmoji:Re,customEmojiSets:Ne,canPlayAnimatedEmojis:be,isInSavedMessages:Me,shouldRenderShowWhen:xe,canLoadReadDate:Pe,onReply:ke,onOpenThread:Ye,onEdit:Te,onAppendTodoList:De,onPin:Le,onUnpin:Ee,onForward:Fe,onDelete:Be,onFaveSticker:Oe,onReport:Ke,onUnfaveSticker:_e,onSelect:Ue,onSend:$e,onReschedule:Je,onClose:ze,onCloseAnimationEnd:je,onCopyLink:He,onCopyNumber:qe,onDownload:Ge,onSaveGif:Ve,onCancelVote:We,onClosePoll:Xe,onShowSeenBy:Ze,onShowReactors:Qe,onToggleReaction:et,onSendPaidReaction:tt,onShowPaidReactionModal:nt,onCopyMessages:ot,onReactionPickerOpen:at,onTranslate:it,onShowOriginal:st,onSelectLanguage:ct,userFullName:rt,canGift:lt})=>{const{showNotification:dt,openStickerSet:ut,openCustomEmojiSets:ht,loadStickers:mt,openGiftModal:pt}=(0,a.ko)(),gt=(0,o.li)(),At=(0,o.li)(),ft=(0,y.A)(),vt=(0,v.A)(),Ct=!A&&!I,yt=l.areReactionsPossible,St=Ie&&!Ct||yt,It="isEdited"in l&&l.isEdited,wt=l.seenByDates,Rt="giftPremium"===l.content.action?.type,Nt="giftCode"===l.content.action?.type,bt="starGift"===l.content.action?.type,Mt="starGiftUnique"===l.content.action?.type,xt=(0,h.L8)(l.chatId)&<&&(Rt||Nt||bt||Mt),[Pt,kt]=(0,f.A)(),[Yt,Tt,Dt]=(0,f.A)(),{isMobile:Lt,isDesktop:Et}=(0,O.Ay)(),Ft=(0,o.Kr)(()=>wt?Object.keys(wt).length:0,[wt]),Bt=(0,C.A)(()=>{dt({message:ft("Share.Link.Copied")}),ze()}),Ot=(0,C.A)(()=>{pt({forUserId:l.chatId}),ze()});(0,o.vJ)(()=>{r&&Pt&&!e&&ze()},[ze,r,e,Pt]),(0,o.vJ)(()=>{Ne?.length&&Ne.map(e=>mt({stickerSetInfo:{id:e.id,accessHash:e.accessHash}}))},[Ne,ht]);const Kt=(0,C.A)(()=>{Ne&&(1===Ne.length?ut({stickerSetInfo:{shortName:Ne[0].shortName}}):ht({setIds:Ne.map(e=>e.id)}),ze())}),_t=function(e,t,n,o,a,s,r,l){const{webPage:d}=t||{},h=[],m=(0,c.P5)(e),p=(0,c.yl)(e)||((0,c.rU)(d)?void 0:(0,c.eY)(d)),g=(0,c.Qm)(e),A=p?(0,c.rI)(p,"full"):void 0,f=o&&p&&(A||(0,c.KG)(p))&&u.WO&&!T.Yw,v=window.getSelection();if(f&&h.push({label:"lng_context_copy_image",icon:"copy-media",handler:()=>{Promise.resolve(A?E.hd(A,i.qZ.BlobUrl):p.blobUrl).then(u.qp),a?.()}}),o&&n)h.push({label:"lng_context_copy_link",icon:"copy",handler:()=>{(0,u.eM)(n),a?.()}});else if(o&&m){const n=Boolean(v?.anchorNode?.parentNode&&v.anchorNode.parentNode.closest(".Message .content-inner")&&""!==v.toString().replace(/(?:\r\n|\r|\n)/g,"")&&function(e){const t=window.getSelection(),n=t?.anchorNode?.parentNode,o=n?.closest(".Message.message-list-item");return(0,c.GZ)(e.id)===o?.id}(e));h.push({label:B(n),icon:"copy",handler:()=>{const o=(0,D.A)();if(o?.length&&r)r(o);else if(n)document.execCommand("copy");else{const n=(0,F.V)({message:e,shouldRenderAsHtml:!0});n&&(0,u.A)(n.join(""),(0,Y.Gn)((0,L.Yw)(),e,t))}a?.()}})}return s&&h.push({label:"lng_context_copy_message_link",icon:"link",handler:s}),g&&l&&h.push({label:"lng_profile_copy_phone",icon:"copy",handler:()=>{l(),a?.()}}),h}(l,(0,c.FE)({poll:m,webPage:p,story:g}),M,re,Bt,le?He:void 0,ot,qe),Ut=(0,C.A)(()=>document.querySelector(`.Transition_slide-active > .MessageList div[data-message-id="${l.id}"]`)),$t=(0,C.A)(()=>document.querySelector(".Transition_slide-active > .MessageList")),Jt=(0,C.A)(()=>document.querySelector(".MessageContextMenu .bubble")),zt=(0,C.A)(()=>{const e=Lt&&document.querySelector(".AudioPlayer-content")?.offsetHeight||0,t=document.getElementById("MiddleColumn"),n=getComputedStyle(t),o=parseFloat(n.getPropertyValue("--middle-header-panes-height"))||0;return{extraPaddingX:10,extraTopPadding:document.querySelector(".MiddleHeader").offsetHeight,extraMarginTop:o+e,shouldAvoidNegativePosition:!Et,menuElMinWidth:St&&Lt?19.25*P.$:void 0}});(0,o.vJ)(()=>{r?setTimeout(()=>{Tt()},200):Dt()},[r,Tt,Dt]),(0,o.vJ)(()=>(0,x.M6)(At.current,".ReactionPicker"),[r]);const jt=(0,C.A)(e=>{at(e),kt()});return(0,N.FD)(_.A,{ref:gt,isOpen:r,anchor:b,getTriggerElement:Ut,getRootElement:$t,getMenuElement:Jt,getLayout:zt,withMaxHeight:!0,className:(0,d.A)("MessageContextMenu","fluid",St&&"with-reactions"),onClose:ze,onCloseAnimationEnd:je,children:[St&&(0,N.Y)(G.A,{enabledReactions:I,topReactions:n,allAvailableReactions:t,defaultTagReactions:s,currentReactions:l.reactions?.results,reactionsLimit:R,onToggleReaction:et,onSendPaidReaction:tt,onShowPaidReactionModal:nt,isWithPaidReaction:w,isPrivate:A,isReady:Yt,canBuyPremium:H,isCurrentUserPremium:S,isInSavedMessages:Me,canPlayAnimatedEmojis:be,onShowMore:jt,onClose:ze,className:(0,d.A)(Pt&&"ReactionSelector-hidden")}),(0,N.FD)("div",{ref:At,className:(0,d.A)("MessageContextMenu_items scrollable-content custom-scroll",Pt&&"MessageContextMenu_items-hidden"),dir:ft.isRtl?"rtl":void 0,children:[xt&&(0,N.Y)(U.A,{icon:"gift",onClick:Ot,children:l?.isOutgoing?ft("SendAnotherGift"):ft("Conversation.ContextMenuSendGiftTo",rt)}),z&&(0,N.Y)(U.A,{icon:"send-outline",onClick:$e,children:ft("MessageScheduleSend")}),j&&(0,N.Y)(U.A,{icon:"schedule",onClick:Je,children:ft("MessageScheduleEditTime")}),V&&(0,N.Y)(U.A,{icon:"reply",onClick:ke,children:ft(X?"lng_context_quote_and_reply":"Reply")}),!ee&&Boolean(Ce?.messagesCount)&&(0,N.Y)(U.A,{icon:"replies",onClick:Ye,children:ft("Conversation.ContextViewReplies",Ce.messagesCount,"i")}),Z&&(0,N.Y)(U.A,{icon:"edit",onClick:Te,children:ft("Edit")}),Q&&(0,N.Y)(U.A,{icon:"add",onClick:De,children:vt("MenuButtonAppendTodoList")}),se&&(0,N.Y)(U.A,{icon:"favorite",onClick:Oe,children:ft("AddToFavorites")}),ce&&(0,N.Y)(U.A,{icon:"favorite",onClick:_e,children:ft("Stickers.RemoveFromFavorites")}),ge&&(0,N.Y)(U.A,{icon:"language",onClick:it,children:ft("TranslateMessage")}),Ae&&(0,N.Y)(U.A,{icon:"language",onClick:st,children:ft("ShowOriginalButton")}),fe&&(0,N.Y)(U.A,{icon:"web",onClick:ct,children:ft("lng_settings_change_lang")}),_t.map(e=>(0,N.Y)(U.A,{icon:e.icon,onClick:e.handler,withPreventDefaultOnMouseDown:!0,children:ft(e.label)},e.label)),te&&(0,N.Y)(U.A,{icon:"pin",onClick:Le,children:ft("DialogPin")}),ne&&(0,N.Y)(U.A,{icon:"unpin",onClick:Ee,children:ft("DialogUnpin")}),he&&(0,N.Y)(U.A,{icon:"gifs",onClick:Ve,children:ft("lng_context_save_gif")}),me&&(0,N.Y)(U.A,{icon:"revote",onClick:We,children:ft("lng_polls_retract")}),pe&&(0,N.Y)(U.A,{icon:"stop",onClick:Xe,children:ft("lng_polls_stop")}),ue&&(0,N.Y)(U.A,{icon:"download",onClick:Ge,children:ft(ve?"lng_context_cancel_download":"lng_media_download")}),ae&&(0,N.Y)(U.A,{icon:"forward",onClick:Fe,children:ft("Forward")}),de&&(0,N.Y)(U.A,{icon:"select",onClick:Ue,children:ft("Common.Select")}),ie&&(0,N.Y)(U.A,{icon:"flag",onClick:Ke,children:ft("lng_context_report_msg")}),oe&&(0,N.Y)(U.A,{destructive:!0,icon:"delete",onClick:Be,children:ft("Delete")}),Re&&(0,N.FD)(N.FK,{children:[(0,N.Y)($.A,{size:"thick"}),!Ne&&(0,N.FD)(N.FK,{children:[(0,N.Y)(J.A,{inline:!0,className:"menu-loading-row"}),(0,N.Y)(J.A,{inline:!0,className:"menu-loading-row"})]}),Ne&&1===Ne.length&&(0,N.Y)(U.A,{withWrap:!0,onClick:Kt,className:"menu-custom-emoji-sets",children:(0,k.A)(ft("MessageContainsEmojiPack",Ne[0].title),["simple_markdown","emoji"])}),Ne&&Ne.length>1&&(0,N.Y)(U.A,{withWrap:!0,onClick:Kt,className:"menu-custom-emoji-sets",children:(0,k.A)(ft("MessageContainsEmojiPacks",Ne.length),["simple_markdown"])})]}),(ye||Se)&&(0,N.FD)(N.FK,{children:[(0,N.Y)($.A,{size:Re?"thin":"thick"}),(0,N.FD)(U.A,{icon:Se?"heart-outline":"group",onClick:Se?Qe:Ze,disabled:!Se&&!Ft,children:[(0,N.Y)("span",{className:"MessageContextMenu--seen-by-label-wrapper",children:(0,N.Y)("span",{className:"MessageContextMenu--seen-by-label",dir:ft.isRtl?"rtl":void 0,children:Se&&l.reactors?.count?ye&&Ft?ft("Chat.OutgoingContextMixedReactionCount",[l.reactors.count,Ft]):ft("Chat.ContextReactionCount",l.reactors.count,"i"):1===Ft&&we?(0,k.A)((0,h.L8)(we[0].id)?(0,c.Yg)(we[0]):we[0].title):Ft?ft("Conversation.ContextMenuSeen",Ft,"i"):ft("Conversation.ContextMenuNoViews")})}),(0,N.Y)(K.A,{className:"avatars",size:"micro",peers:we})]})]}),(Pe||xe||It)&&(0,N.Y)($.A,{size:Re?"thin":"thick"}),(Pe||xe)&&(0,N.Y)(W,{canLoadReadDate:Pe,shouldRenderShowWhen:xe,message:l,closeContextMenu:ze}),It&&(0,N.Y)(q,{message:l})]})]})}),Z=window.getSelection(),Q=-1,ee=(0,o.ph)((0,a.EK)((e,{message:t,messageListType:n,detectedLanguage:o})=>{const{threadId:a}=(0,r.Xf0)(e)||{},{defaultTags:i,topReactions:l,availableReactions:d}=e.reactions,u=(0,r.yuw)(e),m=(0,r.hds)(e,t.chatId),p=m&&(0,h.L8)(m.id),g=p?void 0:(0,r.AWZ)(e,t.chatId),A=(0,r.mBe)(e,t.chatId),f=A&&(0,c.Yg)(A),{seenByExpiresAt:v,seenByMaxChatMembers:C,maxUniqueReactions:y,readDateExpiresAt:S}=e.appConfig,I=g?.reactionsLimit||y,{noOptions:w,canReplyGlobally:R,canPin:N,canUnpin:b,canDelete:M,canReport:x,canEdit:P,canFaveSticker:k,canUnfaveSticker:Y,canCopy:T,canCopyLink:D,canSelect:L,canDownload:E,canSaveGif:F,canRevote:B,canClosePoll:O}=a&&(0,r.WAX)(e,t,a)||{},K=(0,r.R4s)(e,t),_=p?(0,r.K0y)(e,m.id):void 0,U=(0,c.Ie)(t),$=m&&(0,r.yps)(e,m.id),J=Boolean($),z=(0,r.Jbz)(e,t),j=Boolean(p&&U&&!J&&!z&&S&&t.date>Date.now()/1e3-S&&!_?.isReadDateRestricted&&"scheduled"!==n),H=Boolean(j&&p&&(0,r.K0y)(e,m.id)?.isReadDateRestrictedByMe),q="pinned"===n,G="scheduled"===n,V=m&&(0,c.WX)(m),W=a&&(0,r.Vw0)(e,t.chatId,a),X=Boolean(W&&!W?.isCommentsInfo&&W?.fromChannelId),Z=a?(0,r.S0q)(e,t.chatId,a):void 0,Q=m&&!(0,c.Sq)(m,"sendPlain",g),ee=!(!m||!a)&&(0,c.__)(m,Z,X,g)&&Q,te=(0,c.Nb)(t),ne=(0,c.G5)(t),oe=Boolean(!te&&m&&!m.isMonoforum&&!z&&C&&v&&(0,c.YE)(m)&&U&&!G&&m.membersCount&&m.membersCount<=C&&t.date>Date.now()/1e3-v),ae=(0,c._P)(t),ie=!te&&!V&&!G&&!ae&&!p&&t.reactions&&!(0,c.G)(t.reactions)&&t.reactions.canSeeList,se=(0,r.ynf)(e,t),ce=Boolean(t.content.contact),re=(0,r.g29)(e),le=(0,r.S1W)(e,t),de=le?.map(t=>(0,r.ycM)(e,t)),ue=de?.every(Boolean)?de:void 0,he=(0,r.Rny)(e,t.chatId,t.id),me=he?Boolean((0,r.a_$)(e,t.chatId,he)[t.id]?.text):void 0,pe=!me&&(0,r.S86)(e,t,o),ge=(0,r.qZq)(e,t.chatId),Ae=(0,r.nZ4)(e,t.chatId),fe=(0,r.zcZ)(e,t),ve=(0,r.Pn$)(e,t),Ce=t.content.storyData,ye=Ce?(0,r.Msb)(e,Ce.peerId,Ce.id):void 0,Se=(0,r.X2D)(e,t.chatId),Ie=(0,r.QP5)(e,t),we=e.appConfig.todoItemsMax;return{threadId:a,chat:m,availableReactions:d,topReactions:l,defaultTagReactions:i,noOptions:w,canReport:x,canSendNow:G,canReschedule:G,canReply:!q&&!G&&R,canPin:!G&&N,canUnpin:!G&&b,canDelete:M,canEdit:!q&&P,canAppendTodoList:t.content.todo?.todo.othersCanAppend&&t.content.todo?.todo.items?.length<we,canForward:!G&&K,canFaveSticker:!G&&k,canUnfaveSticker:!G&&Y,canCopy:ce||!se&&T,canCopyLink:!G&&D,canSelect:L,canDownload:!se&&E,canSaveGif:!se&&F,canRevote:B,canClosePoll:!G&&O,activeDownloads:u,canShowSeenBy:oe,canLoadReadDate:j,shouldRenderShowWhen:H,enabledReactions:m?.isForbidden?void 0:g?.enabledReactions,reactionsLimit:I,isPrivate:p,isCurrentUserPremium:re,hasFullInfo:Boolean(g),canShowReactionsCount:ie,canShowReactionList:!(te||ae||G||m?.id===s.zv8||ne),canBuyPremium:!re&&!(0,r.n_C)(e),customEmojiSetsInfo:le,customEmojiSets:ue,canScheduleUntilOnline:(0,r.RBq)(e,t.chatId),canTranslate:pe,canShowOriginal:me&&!ge,canSelectLanguage:me&&!ge,isMessageTranslated:me,canPlayAnimatedEmojis:(0,r.BWX)(e),isReactionPickerOpen:(0,r.Ani)(e),isInSavedMessages:Ae,isChannel:V,canReplyInChat:ee,isWithPaidReaction:g?.isPaidReactionAvailable,poll:fe,story:ye,userFullName:f,canGift:Se,savedDialogId:Ie,webPage:ve}})(({threadId:e,availableReactions:t,topReactions:n,defaultTagReactions:r,isOpen:h,messageListType:m,message:p,customEmojiSetsInfo:g,customEmojiSets:w,album:R,poll:x,webPage:P,story:k,anchor:Y,targetHref:T,noOptions:D,canSendNow:L,hasFullInfo:E,canReschedule:F,canReply:B,canPin:O,repliesThreadInfo:K,canUnpin:_,canDelete:U,canShowReactionsCount:$,chat:J,canReport:z,canShowReactionList:j,canEdit:H,canAppendTodoList:q,enabledReactions:G,reactionsLimit:V,isPrivate:W,isCurrentUserPremium:ee,canForward:te,canBuyPremium:ne,canFaveSticker:oe,canUnfaveSticker:ae,canCopy:ie,canCopyLink:se,canSelect:ce,canDownload:re,canSaveGif:le,canRevote:de,canClosePoll:ue,canPlayAnimatedEmojis:he,canLoadReadDate:me,shouldRenderShowWhen:pe,activeDownloads:ge,noReplies:Ae,canShowSeenBy:fe,canScheduleUntilOnline:ve,canTranslate:Ce,isMessageTranslated:ye,canShowOriginal:Se,canSelectLanguage:Ie,isReactionPickerOpen:we,isInSavedMessages:Re,canReplyInChat:Ne,isWithPaidReaction:be,userFullName:Me,canGift:xe,className:Pe,savedDialogId:ke,onClose:Ye,onCloseAnimationEnd:Te})=>{const{openThread:De,updateDraftReplyInfo:Le,setEditingId:Ee,pinMessage:Fe,openForwardMenu:Be,openReplyMenu:Oe,faveSticker:Ke,unfaveSticker:_e,toggleMessageSelection:Ue,sendScheduledMessages:$e,rescheduleMessage:Je,downloadMedia:ze,cancelMediaDownload:je,loadSeenBy:He,openSeenByModal:qe,openReactorListModal:Ge,loadFullChat:Ve,loadReactors:We,copyMessagesByIds:Xe,saveGif:Ze,loadStickers:Qe,cancelPollVote:et,closePoll:tt,toggleReaction:nt,requestMessageTranslation:ot,showOriginalMessage:at,openChatLanguageModal:it,openMessageReactionPicker:st,openPremiumModal:ct,loadOutboxReadDate:rt,copyMessageLink:lt,openDeleteMessageModal:dt,addLocalPaidReaction:ut,openPaidReactionModal:ht,reportMessages:mt,openTodoListModal:pt,showNotification:gt}=(0,a.ko)(),At=(0,y.A)(),ft=(0,v.A)(),{ref:vt}=(0,I.A)({isOpen:h,onCloseAnimationEnd:Te,className:!1}),[Ct,yt]=(0,o.J0)(!0),[St,It]=(0,o.J0)(!1),[wt,Rt,Nt]=(0,f.A)(),[bt,Mt]=(0,o.J0)(Q),[xt,Pt]=(0,S.A)(ve,Ye,p.date),kt=void 0===g||Boolean(g.length);(0,o.vJ)(()=>{fe&&h&&He({chatId:p.chatId,messageId:p.id})},[He,h,p.chatId,p.id,fe]),(0,o.vJ)(()=>{me&&h&&rt({chatId:p.chatId,messageId:p.id})},[me,h,p.chatId,p.id,p.readDate]),(0,o.vJ)(()=>{$&&h&&We({chatId:p.chatId,messageId:p.id})},[$,h,We,p.chatId,p.id]),(0,o.vJ)(()=>{g?.length&&w?.length!==g.length&&g.forEach(e=>{Qe({stickerSetInfo:e})})},[g,w,Qe]),(0,o.vJ)(()=>{E||W||!h||Ve({chatId:p.chatId})},[E,h,W,Ve,p.chatId]);const Yt=(0,o.Kr)(()=>{const e=(0,a.mS)().chats.byId,t=(0,a.mS)().users.byId;if(p.reactions?.recentReactions?.length){const n=new Set(p.reactions?.recentReactions?.map(({peerId:n})=>t[n]||e[n]));return Array.from(n).filter(Boolean).slice(0,s.dqH)}if(p.seenByDates)return Object.keys(p.seenByDates).slice(0,s.dqH).map(n=>t[n]||e[n]).filter(Boolean)},[p.reactions?.recentReactions,p.seenByDates]),Tt=(0,o.Kr)(()=>{const e=(0,a.mS)();if(R)return R.messages.some(t=>{const n=(0,l.iS)(e,t);return!!n&&(0,c.$r)(ge,n)});const t=(0,l.iS)(e,p);return!!t&&(0,c.$r)(ge,t)},[ge,R,p]),Dt=B&&Z?.rangeCount?Z.getRangeAt(0):void 0;(0,o.vJ)(()=>{if(ye)return void Mt(Q);if(!Dt||Dt.collapsed||!Boolean(p.content.text?.text)||!function(e){const t=e.commonAncestorContainer,n=t.nodeType===Node.TEXT_NODE?t.parentNode:t;return Boolean(n.closest(".message-content-wrapper .text-content"))&&!(Boolean(n.closest(".EmbeddedMessage"))||Boolean(n.closest(".WebPage")))}(Dt))return void Mt(Q);const e=A(Dt),t=p.content.text.text.replace(/\u00A0/g," ");e.text.trim().length>0&&t.includes(e.text)?Mt(Dt.startOffset):Mt(Q)},[Dt,Dt?.collapsed,Dt?.startOffset,Dt?.endOffset,ye,p.content.text]);const Lt=(0,C.A)(()=>{yt(!1),Ye()}),Et=(0,C.A)(()=>{yt(!1),Lt();const e=R?.messages?R.messages.map(({id:e})=>e):[p.id];dt({chatId:p.chatId,messageIds:e,isSchedule:"scheduled"===m})}),Ft=(0,C.A)(()=>{It(!1),Ye()}),Bt=(0,C.A)(()=>{const e=bt!==Q&&Dt?A(Dt):void 0;Ne?Le({replyToMsgId:p.id,quoteText:e,quoteOffset:bt,monoforumPeerId:ke,replyToPeerId:void 0}):Oe({fromChatId:p.chatId,messageId:p.id,quoteText:e,quoteOffset:bt}),Lt()}),Ot=(0,C.A)(()=>{De({chatId:p.chatId,threadId:p.id}),Lt()}),Kt=(0,C.A)(()=>{p.content.todo?pt({chatId:p.chatId,messageId:p.id}):Ee({messageId:p.id}),Lt()}),_t=(0,C.A)(()=>{ee?pt({chatId:p.chatId,messageId:p.id,forNewTask:!0}):gt({message:ft("SubscribeToTelegramPremiumForAppendToDo"),action:{action:"openPremiumModal",payload:{initialSection:"todo"}},actionText:At("PremiumMore")}),Lt()}),Ut=(0,C.A)(()=>{yt(!1),It(!0)}),$t=(0,C.A)(()=>{Fe({chatId:p.chatId,messageId:p.id,isUnpin:!0}),Lt()}),Jt=(0,C.A)(()=>{if(Lt(),R?.messages){const e=R.messages.map(({id:e})=>e);Be({fromChatId:p.chatId,messageIds:e})}else Be({fromChatId:p.chatId,messageIds:[p.id]})}),zt=(0,C.A)(()=>{Lt(),Ke({sticker:p.content.sticker})}),jt=(0,C.A)(()=>{Lt(),_e({sticker:p.content.sticker})}),Ht=(0,C.A)(()=>{Lt(),et({chatId:p.chatId,messageId:p.id})}),qt=(0,C.A)(()=>{Lt(),tt({chatId:p.chatId,messageId:p.id})}),Gt=(0,C.A)(()=>{const e=R?.messages?{messageId:p.id,childMessageIds:R.messages.map(({id:e})=>e),withShift:!1}:{messageId:p.id,withShift:!1};Ue(e),Lt()}),Vt=(0,C.A)(()=>{$e({chatId:p.chatId,id:p.id}),Lt()}),Wt=(0,C.A)(e=>{Je({chatId:p.chatId,messageId:p.id,scheduledAt:e}),Ye()}),Xt=(0,C.A)(()=>{yt(!1),xt(Wt)}),Zt=(0,C.A)(()=>{Lt(),qe({chatId:p.chatId,messageId:p.id})}),Qt=(0,C.A)(()=>{Lt(),Ge({chatId:p.chatId,messageId:p.id})}),en=(0,C.A)(e=>{Xe({messageIds:e}),Lt()}),tn=(0,C.A)(()=>{lt({chatId:p.chatId,messageId:p.id,shouldIncludeThread:e!==i.l3,shouldIncludeGrouped:!0}),Lt()}),nn=(0,C.A)(()=>{(0,u.eM)(p.content.contact.phoneNumber),Lt()}),on=(0,C.A)(()=>{const e=(0,a.mS)();(R?.messages||[p]).forEach(t=>{const n=(0,l.iS)(e,t);n&&(Tt?je({media:n}):ze({media:n,originMessage:t}))}),Lt()}),an=(0,C.A)(()=>{const e=(0,c.zX)(p);Ze({gif:e}),Lt()}),sn=(0,C.A)(e=>{Re&&!ee?ct({initialSection:"saved_tags"}):nt({chatId:p.chatId,messageId:p.id,reaction:e,shouldAddToRecent:!0}),Lt()}),cn=(0,C.A)(()=>{ut({chatId:p.chatId,messageId:p.id,count:1}),Lt()}),rn=(0,C.A)(()=>{ht({chatId:p.chatId,messageId:p.id}),Lt()}),ln=(0,C.A)(e=>{st({chatId:p.chatId,messageId:p.id,position:e})}),dn=(0,C.A)(()=>{ot({chatId:p.chatId,id:p.id}),Lt()}),un=(0,C.A)(()=>{at({chatId:p.chatId,id:p.id}),Lt()}),hn=(0,C.A)(()=>{it({chatId:p.chatId,messageId:p.id}),Lt()}),mn=(0,o.Kr)(()=>(R?R.messages:[p]).map(({id:e})=>e),[R,p]),pn=(0,C.A)(()=>{J&&(yt(!1),Ye(),mt({chatId:J.id,messageIds:mn}))});if(D)return void Lt();const gn=new Date;return gn.setFullYear(gn.getFullYear()+1),(0,N.FD)("div",{ref:vt,className:(0,d.A)("ContextMenuContainer",Pe),children:[(0,N.Y)(X,{isReactionPickerOpen:we,availableReactions:t,topReactions:n,defaultTagReactions:r,isWithPaidReaction:be,message:p,isPrivate:W,isCurrentUserPremium:ee,canBuyPremium:ne,isOpen:Ct,enabledReactions:G,reactionsLimit:V,anchor:Y,targetHref:T,canShowReactionsCount:$,canShowReactionList:j,canSendNow:L,canReschedule:F,canReply:B,canQuote:bt!==Q,canDelete:U,canPin:O,canReport:z,repliesThreadInfo:K,canUnpin:_,canEdit:H,canAppendTodoList:q,canForward:te,canFaveSticker:oe,canUnfaveSticker:ae,canCopy:ie,canCopyLink:se,canSelect:ce,canDownload:re,canSaveGif:le,canRevote:de,canClosePoll:ue,canShowSeenBy:fe,canTranslate:Ce,canShowOriginal:Se,canSelectLanguage:Ie,canPlayAnimatedEmojis:he,shouldRenderShowWhen:pe,canLoadReadDate:me,hasCustomEmoji:kt,customEmojiSets:w,isDownloading:Tt,seenByRecentPeers:Yt,isInSavedMessages:Re,noReplies:Ae,poll:x,webPage:P,story:k,onOpenThread:Ot,onReply:Bt,onEdit:Kt,onAppendTodoList:_t,onPin:Ut,onUnpin:$t,onForward:Jt,onDelete:Et,onReport:pn,onFaveSticker:zt,onUnfaveSticker:jt,onSelect:Gt,onSend:Vt,onReschedule:Xt,onClose:Lt,onCopyLink:tn,onCopyMessages:en,onCopyNumber:nn,onDownload:on,onSaveGif:an,onCancelVote:Ht,onClosePoll:Rt,onShowSeenBy:Zt,onToggleReaction:sn,onSendPaidReaction:cn,onShowPaidReactionModal:rn,onShowReactors:Qt,onReactionPickerOpen:ln,onTranslate:dn,onShowOriginal:un,onSelectLanguage:hn,userFullName:Me,canGift:xe}),(0,N.Y)(b,{isOpen:St,messageId:p.id,chatId:p.chatId,onClose:Ft}),(0,N.Y)(M.A,{isOpen:wt,onClose:Nt,text:At("lng_polls_stop_warning"),confirmLabel:At("lng_polls_stop_sure"),confirmHandler:qt}),F&&Pt]})}))}}]);
|
|
//# sourceMappingURL=3938.0431741108875652fa60.js.map
|