TelegramPWA/dist/1670.d18268523d1d879daf81.js
Alexander Zinchuk 79226910fd [Build]
2025-12-23 12:51:18 +01:00

2 lines
103 KiB
JavaScript

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[1670],{101:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(84051),i=n(87679),a=n(56863);function s(e){const t=(0,o.li)(),{result:n}=(0,a.A)(()=>{if(!e)return Promise.resolve(void 0);t.current&&URL.revokeObjectURL(t.current);const n=URL.createObjectURL(e);return t.current=n,(0,i.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:()=>i});var o=n(84051);function i(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:()=>g});var o=n(84051),i=n(13439),a=n(70636),s=n(91048),r=n(87357),c=n(95807),l=n(39351),d=n(39996),u=n(21849),h=n(34431),m=n(18276);var p=n(20021);const g=(0,o.ph)((0,i.EK)((e,{peerId:t,forceShowSelf:n})=>{const o=(0,s.SJA)(e);if(!t)return{peer:void 0,isSavedMessages:void 0,theme:o};const i=(0,s.PVB)(e,t),a=(0,s.mBe)(e,t);return{peer:i,isSavedMessages:!n&&a&&a.isSelf,theme:o}})(({icon:e,title:t,isMinimized:n,canClose:o,isCloseNonDestructive:i,clickArg:s,peer:g,mockPeer:A,customPeer:v,className:f,isSavedMessages:y,withPeerColors:C,withEmojiStatus:I,itemClassName:S,theme:w,onClick:b})=>{const N=(0,l.A)(),R=A||g,M=v||R,{className:P,style:k}=(0,d.Ay)({peer:M,theme:w}),Y=R&&(0,a.vj)(R)?R:void 0;let x,T,F;e&&t?(x=(0,p.Y)("div",{className:"NtoGLT22",children:(0,p.Y)(m.A,{name:e,style:"f91Ad80i"})}),T=t):M&&(x=(0,p.Y)(u.A,{className:"La8BQ9yr",peer:M,size:"small",isSavedMessages:y}),F=(0,a.F9)(N,M)||t,T=t||(0,p.Y)(h.A,{peer:M,isSavedMessages:y,withEmojiStatus:I}));const D=(0,r.A)("_Lq6_4e5",(Y?.isForum||v?.isAvatarSquare)&&"JIHfTUVn",n&&"UhOZvxvs",o&&"uvvgSFUJ",i&&"fAk5yEeV",!b&&"P8r3OoaX",C&&P,f),E=(0,c.A)(C&&k);return(0,p.FD)("div",{className:D,style:E,onClick:()=>b?.(s),title:n?F:void 0,dir:N.isRtl?"rtl":void 0,children:[x,!n&&(0,p.Y)("div",{className:(0,r.A)("XPVuH29G",S),dir:"auto",children:T}),o&&(0,p.Y)("div",{className:"xVPG2UTy",children:(0,p.Y)(m.A,{name:"close"})})]})}))},11241:(e,t,n)=>{n.d(t,{A:()=>N});var o=n(84051),i=n(13439),a=n(90709),s=n(91048),r=n(87357),c=n(43336),l=n(76023),d=n(37661),u=n(5912),h=n(17712),m=n(62587),p=n(50680),g=n(45294),A=n(18104),v=n(87412),f=n(83594),y=n(17794),C=n(93879),I=n(20021);const S=1.5*l.$,w=6.5*l.$,b=l.$,N=(0,o.ph)((0,i.EK)((e,{containerId:t})=>{const{genericEmojiEffects:n,reactions:o}=e,{activeReactions:i}=(0,s.nTw)(e),a=(0,s.xYJ)(e,"reactionEffects");return{activeReactions:i?.[t],availableReactions:o.availableReactions,genericEffects:n,withEffects:a}})(({containerId:e,reaction:t,className:n,size:s=S,effectSize:l=w,activeReactions:N,availableReactions:R,genericEffects:M,withEffects:P,withEffectOnly:k,shouldPause:Y,shouldLoop:x,loopLimit:T,observeIntersection:F})=>{const{stopActiveReaction:D}=(0,i.ko)(),E=(0,o.li)(),L="custom"===t.type,B=(0,o.Kr)(()=>R?.find(e=>(0,a.a0)(e.reaction,t)),[R,t]),U=B?.centerIcon?.id,{customEmoji:O}=(0,g.A)(L?t.documentId:void 0),K=(0,o.Kr)(()=>{if(!L)return B?.aroundAnimation?.id;if(!O)return;const e=R?.find(e=>e.reaction.emoticon===O.emoji)?.aroundAnimation?.id;return e},[B,R,O,L]),G=(0,o.Kr)(()=>{if(K)return K;if(!M?.stickers)return;const{stickers:e}=M;return e[Math.floor(Math.random()*e.length)].id},[K,M]),j=(0,u.Vz)(E,F),J=U&&(0,a.aL)(U),$=G&&(0,a.aL)(G),z=(0,m.A)(J),_=(0,m.A)($),V=(0,o.Kr)(()=>N?.find(e=>(0,a.a0)(e,t)),[N,t]),H=Boolean(P&&V&&(L||z)&&_),q=j&&(H&&!k||x),{shouldRender:W,transitionClassNames:X}=(0,p.A)(H,void 0,!0,"slow"),{shouldRender:Q,transitionClassNames:Z}=(0,p.A)(q,void 0,!0,"slow"),ee=(0,h.A)(()=>{D({containerId:e,reaction:t})}),[te,ne,oe]=(0,d.A)(),ie=!(L||q&&te),{shouldRender:ae,transitionClassNames:se}=(0,p.A)(ie,void 0,!0),re=(0,r.A)(C.A.root,W&&C.A.animating,k&&C.A.withEffectOnly,n);return(0,I.FD)("div",{className:re,ref:E,children:[!k&&ae&&(0,I.Y)(y.A,{className:se,reaction:t,availableReactions:R,size:s,observeIntersection:F}),!k&&L&&(0,I.Y)(v.A,{documentId:t.documentId,className:C.A.customEmoji,size:s,noPlay:Y,noVideoOnMobile:!0,loopLimit:T,observeIntersectionForPlaying:F,forceAlways:!0}),Q&&!L&&(0,I.Y)(A.A,{className:(0,r.A)(C.A.animatedIcon,Z),size:(0,c.Ki)(1.9*s),tgsUrl:z,play:j&&!Y,noLoop:!x,onLoad:ne,onEnded:oe,forceAlways:!0},`${U}-${s}`),W&&(0,I.FD)(I.FK,{children:[(0,I.Y)(A.A,{className:(0,r.A)(C.A.effect,X),size:l,tgsUrl:_,play:j,noLoop:!0,onEnded:ee,forceAlways:!0},`${G}-${l}`),L&&!K&&j&&(0,I.Y)(f.A,{reaction:t,className:X,particleSize:Math.max(.5*s,b),onEnded:ee})]})]})}))},14737:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051),i=n(17712);const a=function(e,t){const n=(0,i.A)(e);(0,o.vJ)(()=>{if("number"!=typeof t)return;const e=setTimeout(()=>n(),t);return()=>clearTimeout(e)},[t])}},15379:(e,t,n)=>{n.d(t,{Ay:()=>r,Ee:()=>l,Vb:()=>s,j5:()=>d,to:()=>a,w1:()=>c});var o=n(21309);const i={everyminute:o.pY,every5minutes:5*o.pY,daily:o.d_,weekly:o.V8,biweekly:2*o.V8,monthly:o.Lp,every3months:91*o.d_,every6months:182*o.d_,yearly:365*o.d_},a=["never",...Object.keys(i)],s=new Set(["everyminute","every5minutes"]);function r(e){if(e&&"never"!==e)return i[e]}function c(e){if(e)return Object.keys(i).find(t=>i[t]===e)}function l(e,t){if(!e)return;const n=c(e);if(n)switch(n){case"everyminute":return t("MessageRepeatPeriodEveryMinutes",{count:1},{pluralValue:1});case"every5minutes":return t("MessageRepeatPeriodEveryMinutes",{count:5},{pluralValue:5});case"daily":return t("MessageRepeatPeriodDaily");case"weekly":return t("MessageRepeatPeriodWeekly");case"biweekly":return t("MessageRepeatPeriodBiweekly");case"monthly":return t("MessageRepeatPeriodMonthly");case"every3months":return t("MessageRepeatPeriodEveryMonths",{count:3},{pluralValue:3});case"every6months":return t("MessageRepeatPeriodEveryMonths",{count:6},{pluralValue:6});case"yearly":return t("MessageRepeatPeriodYearly");default:return}}function d(e,t){switch(e){case"never":default:return t("ScheduleRepeatNever");case"everyminute":return t("ScheduleRepeatEveryMinutes",{count:1},{pluralValue:1});case"every5minutes":return t("ScheduleRepeatEveryMinutes",{count:5},{pluralValue:5});case"daily":return t("ScheduleRepeatDaily");case"weekly":return t("ScheduleRepeatWeekly");case"biweekly":return t("ScheduleRepeatBiweekly");case"monthly":return t("ScheduleRepeatMonthly");case"every3months":return t("ScheduleRepeatEveryMonths",{count:3},{pluralValue:3});case"every6months":return t("ScheduleRepeatEveryMonths",{count:6},{pluralValue:6});case"yearly":return t("ScheduleRepeatYearly")}}},15535:(e,t,n)=>{n.d(t,{A:()=>A});var o=n(84051),i=n(31481),a=n(66644),s=n(63495),r=n(96454),c=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:v,submitLabel:f,description:y,shouldShowSubmit:C,shouldResetValue:I,shouldDisablePasswordManager:S=!1,noRipple:w=!1,onClearError:b,onChangePasswordVisibility:N,onInputChange:R,onSubmit:M})=>{const P=(0,o.li)(),k=(0,h.A)(),{isMobile:Y}=(0,u.Ay)(),[x,T]=(0,o.J0)(""),[F,D]=(0,o.J0)(!1),E=Y?550:400;return(0,o.vJ)(()=>{I&&T("")},[I]),(0,d.A)(()=>{r.TF||P.current.focus()},E),(0,o.vJ)(()=>{n&&(0,a.RK)(()=>{P.current.focus(),P.current.select()})},[n]),(0,g.FD)("form",{action:"",onSubmit:M?function(t){t.preventDefault(),e||F&&M(x)}:l.A,autoComplete:"off",children:[(0,g.FD)("div",{className:(0,c.A)("input-group password-input",x&&"touched",n&&"error"),dir:k.isRtl?"rtl":void 0,children:[S&&(0,g.Y)("input",{type:"password",id:"prevent_autofill",autoComplete:"off",className:"visually-hidden",tabIndex:-2}),(0,g.Y)("input",{ref:P,className:"form-control",type:t?"text":"password",id:"sign-in-password",value:x||"",autoComplete:S?"one-time-code":"current-password",spellCheck:!s.Vq&&void 0,onChange:function(e){n&&b();const{target:t}=e;T(t.value),D(t.value.length>=i.AGC),R&&R(t.value)},maxLength:256,dir:"auto"}),(0,g.Y)("label",{children:n||A||v||k("PasswordFormPlaceholder")}),(0,g.Y)("div",{className:"div-button toggle-password",onClick:function(){N(!t)},role:"button",tabIndex:0,title:k("AriaPasswordToggle"),"aria-label":k("AriaPasswordToggle"),children:(0,g.Y)(p.A,{name:t?"eye":"eye-crossed"})})]}),y&&(0,g.Y)("p",{className:"description",children:y}),M&&(F||C)&&(0,g.Y)(m.A,{type:"submit",ripple:!w,isLoading:e,disabled:!F,children:f||k("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),i=n(90709),a=n(87357),s=n(62587),r=n(83057),c=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,i.a0)(t.reaction,e)),[t,e]),A=g?.staticIcon?.id,v=A?`document${A}`:void 0,f=(0,s.A)(v),y=(0,r.A)(f),C="emoji"===e.type&&"🦄"===e.emoticon,I=m&&"emoji"===e.type&&"❤"===e.emoticon;return"custom"===e.type?(0,u.Y)(c.A,{documentId:e.documentId,className:(0,a.A)("ReactionStaticEmoji",n),size:h,observeIntersectionForPlaying:p}):I?(0,u.Y)(l.A,{name:"heart",className:"ReactionStaticEmoji",style:`font-size: ${h}px; width: ${h}px`}):(0,u.Y)("img",{className:(0,a.A)("ReactionStaticEmoji",C&&"with-unicorn-fix",y,n),style:h?`width: ${h}px; height: ${h}px`:void 0,src:f||d,alt:g?.title,draggable:!1})})},20333:(e,t,n)=>{n.d(t,{A:()=>C});var o=n(84051),i=n(87357),a=n(95807),s=n(76023),r=n(537),c=n(30857),l=n(39351),d=n(29886),u=n(93545),h=n(35297),m=n(41036),p=n(18276);const g="HS9PzRKt",A="_b5HgBXr",v="P6mch4bB",f="xdKGgbKQ";var y=n(20021);const C=(0,o.ph)(({leftText:e,rightText:t,floatingBadgeText:n,floatingBadgeIcon:C,progress:I=0,isPrimary:S,isNegative:w,isInverted:b,shouldSkipGradient:N,animationDirection:R="none",className:M})=>{const P=(0,o.li)(),k=(0,o.li)(),[Y,x]=(0,o.J0)(0),[T,F]=(0,o.J0)(0),[D,E]=(0,o.J0)(0),L=(0,d.A)(D),[B,U]=(0,o.J0)(w?0:I),[O,K]=(0,o.J0)(w?I:0),[G,j]=(0,o.J0)(I),[J,$]=(0,o.J0)(0),[z,_]=(0,o.J0)(!1),[V,H]=(0,o.J0)(!1),[q,W]=(0,o.J0)(!1),[X,Q]=(0,o.J0)(!1),[Z,ee]=(0,o.J0)(!1),te=(0,r.A)([n,C]),ne=(0,o.li)(!1),oe=(0,d.A)(e),ie=(0,d.A)(t),ae=(0,d.A)(w),se=(0,l.A)(),re=14+s.$,ce=1.5*s.$,le=()=>{if(P.current&&k.current){const e=k.current.offsetWidth,t=D/2,n=t,o=e-t,i=14,a=(b||w?1-G:G)*e;let s=Math.max(n,Math.min(a,o));a<re&&(s=a+t),a>e-re&&(s=a-t);const r=t+(a-s)-i;x(s/e),F(r)}};(0,o.vJ)(le,[G,D,w,b,re]),(0,u.A)(k,le),(0,o.vJ)(()=>{E((P?.current?.clientWidth||0)+ce)},[n,C,ce]);const de=(0,c.A)();(0,h.A)(()=>{let e;if((oe||ie)&&(void 0!==ae&&ae!==w||Z)&&!ne.current){ne.current=!0;const t=Z?800:400;e=window.setTimeout(()=>{ne.current=!1,de()},t)}return()=>{e&&(clearTimeout(e),ne.current=!1)}},[e,oe,t,ie,ae,w,R,Z]);const ue=ne.current;(0,o.vJ)(()=>{w?(U(0),K(I)):(K(0),U(I)),j(I)},[I,w]);const he=Boolean(C||n),me=ue?oe:e,pe=ue?ie:t,ge=(0,d.A)(I);(0,o.vJ)(()=>{const e=[];if("none"===R||void 0===ge)return;const t=I,n=e=>{w?K(e):U(e)};if("forward"===R||"backward"===R){const o="forward"===R;ee(!0),n(o?1:0),W(!0),$(o?0:1),e.push(window.setTimeout(()=>{W(!1),_(!0),$(t),o&&(H(!0),n(0))},400)),e.push(window.setTimeout(()=>{H(!0),W(!0),Q(!1),n(t),_(!1),e.push(window.setTimeout(()=>{H(!1),W(!1),ee(!1)},50))},800))}return()=>{e.forEach(clearTimeout)}},[I,R,w,ge,800]);const Ae=(e,t,n,o)=>{const a=e?"MzFvyMb5":"S6H6hBpP";return(0,y.FD)("div",{className:(0,i.A)(a,n,o&&g),style:`--layer-progress: ${t}`,children:[(0,y.Y)("div",{className:A,children:(0,y.Y)("span",{children:me})}),(0,y.Y)("div",{className:v,children:(0,y.Y)("span",{children:pe})})]})};return(0,y.FD)("div",{ref:k,className:(0,i.A)("nY2ggBsF",he&&"RYtVQAjM",S&&"Zi0w7QJ3",w&&"dXs41qvC",b&&"Ef0g9liZ",N&&"dazw12V7",ue&&"I7toQztx",Z&&"SxTCkiyg",M),style:(0,a.A)(`--positive-progress: ${B}`,`--negative-progress: ${O}`,`--layer-progress: ${J}`,`--shift-x: ${Y}`,"--cycling-animation-badge-position: 800ms","--cycling-animation-progress: 400ms"),children:[he&&(0,y.Y)("div",{className:"dhigNjAq",children:(0,y.FD)("div",{className:"cOpfCGPh",children:[(0,y.Y)("div",{className:(0,i.A)("uNwBLNOy",(!L||0===L)&&g),style:`width: ${D}px;`,children:(0,y.Y)(m.Ay,{activeKey:te,name:"fade",shouldCleanup:!0,children:(0,y.FD)("div",{ref:P,className:"W4rqGyJl",children:[C&&(0,y.Y)(p.A,{name:C,className:"MJ7MTmxi"}),n&&(0,y.Y)("div",{className:"MwzZt3Qo",dir:se.isRtl?"rtl":void 0,children:n})]})})}),(0,y.Y)("div",{className:"qRwO7SZm",style:`left: ${T}px`,children:(0,y.Y)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",children:(0,y.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,y.Y)("div",{className:A,children:(0,y.Y)("span",{children:me})}),(0,y.Y)("div",{className:v,children:(0,y.Y)("span",{children:pe})}),(0,y.FD)("div",{className:"_B4r3D5W",children:[Ae(!0,B,(0,i.A)(X&&f),V),Ae(!1,O,(0,i.A)(X&&f),V),Ae(!w,J,(0,i.A)(w?"QZwWHVdB":"VmyTBAzN",z&&"tkyw4hXo"),q)]})]})})},24531:(e,t,n)=>{n.d(t,{A:()=>p});var o=n(84051),i=n(31481),a=n(17663),s=n(15379),r=n(80140),c=n(17712),l=n(59030),d=n(80089),u=n(80464),h=n(20021);const m=e=>{const{isOpen:t}=e,n=(0,u.A)(d.ar.Extra,"CalendarModal",!t);return n?(0,h.Y)(n,{...e}):void 0},p=(e,t,n,d)=>{const u=(0,l.A)(),[p,g]=(0,o.J0)(),A=(0,c.A)((e,t)=>{const n=e.getTime()===1e3*i.NkL,o=Math.round(Math.max(e.getTime(),Date.now()+6e4)/1e3)+(n?0:(0,r.SF)()),a=(0,s.Ay)(t);p?.(o,a),g(void 0)}),v=(0,c.A)(()=>{A(new Date(1e3*i.NkL))}),f=(0,c.A)(()=>{g(void 0),t?.()}),y=(0,c.A)(e=>{g(()=>e)}),C=n?new Date(1e3*n):new Date;C.setSeconds(0),C.setMilliseconds(0);const I=new Date;I.setFullYear(I.getFullYear()+1);const S=(0,s.w1)(d);return[y,(0,h.Y)(m,{isOpen:Boolean(p),withTimePicker:!0,withRepeatMode:!0,initialRepeatMode:S,selectedAt:C.getTime(),maxAt:(0,a.CS)(I),isFutureMode:!0,secondButtonLabel:e?u("Schedule.SendWhenOnline"):void 0,onClose:f,onSubmit:A,onSecondButtonClick:e?v:void 0})]}},26875:(e,t,n)=>{n.d(t,{A:()=>c});var o=n(84051),i=n(87357),a=n(39351),s=n(21849);var r=n(20021);const c=(0,o.ph)(({peers:e,size:t,className:n,limit:c=3,badgeText:l})=>{const d=(0,a.A)(),u="number"==typeof t?t:s.R[t],h=(0,o.Kr)(()=>l||(!e?.length||e.length<=c?void 0:"+"+(e.length-c)),[l,e,c]);return(0,r.FD)("div",{className:(0,i.A)(n,"kXs18Nmi"),style:`--_size: ${u}px;`,dir:d.isRtl?"rtl":"ltr",children:[e?.slice(0,c).map(e=>(0,r.Y)(s.A,{size:t,peer:e,className:"XND8fhC1"})),h&&(0,r.Y)("div",{className:"SHyAyGFO",children:h})]})})},27860:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(84051),i=n(66644),a=n(87357),s=n(45470),r=n(39351),c=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)(),v=(0,r.A)(),{shouldRender:f,transitionClassNames:y}=(0,l.A)(e,void 0,!0,!t&&void 0,void 0,500),C=(0,s.A)(n,!f,void 0,25,p,g),I=(0,c.A)(e=>{if(!A.current)return;const t=A.current,n=e.currentTarget.getBoundingClientRect(),o=e.clientX-n.left,a=e.clientY-n.top,s=o-n.width/2,r=a-n.height/2;(0,i.RK)(()=>{t.setAttribute("style",`--click-shift-x: ${s}px; --click-shift-y: ${r}px`)})});if(f)return(0,u.FD)("div",{className:(0,a.A)("qF2WgYVg",y,m,t&&"pNM3cgkY"),ref:A,onClick:t?I:void 0,children:[(0,u.Y)("canvas",{ref:C,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"}),v("MediaSpoilerSensitive")]})]})})},31460:(e,t,n)=>{n.d(t,{P:()=>a});var o=n(31481),i=n(96454);function a(e,t,n=!1,a=!1){return n||t===o.dnp?"none":t===o.zHL?"slideFade":"slideOptimized"===e?a?"slideOptimizedRtl":"slideOptimized":"slide"===e?a?"slideRtl":"slide":i.Ni?"slideFade":i.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"}},36143:(e,t,n)=>{n.d(t,{A:()=>xe});var o=n(84051),i=n(13439),a=n(23174),s=n(89925),r=n(31481),c=n(90709),l=n(26129),d=n(91048),u=n(63495),h=n(96454),m=n(87357),p=n(60343),g=n(41512),A=n(54464),v=n(43874),f=n(10722),y=n(49746),C=n(37661),I=n(5912),S=n(17712),w=n(34201),b=n(48196),N=n(42211),R=n(96773),M=n(76023),P=n(21849),k=n(50805),Y=n(20021);const x=15*M.$,T=(0,o.ph)(({action:e,onClick:t,observeIntersection:n})=>(0,Y.Y)(P.A,{className:k.A.channelPhoto,photo:e.photo,loopIndefinitely:!0,withVideo:!0,observeIntersection:n,onClick:t,size:x}));var F=n(17663),D=n(17142),E=n(18501),L=n(39351),B=n(85118),U=n(82855);const O=(0,o.ph)((0,i.EK)((e,{action:t})=>({sticker:"giftPremium"===t.type?(0,d.t0O)(e,t.days):"giftStars"===t.type?(0,d.WLj)(e,t.stars):(0,d.OD9)(e,t.cryptoAmount),canPlayAnimatedEmojis:(0,d.BWX)(e)}))(({action:e,sticker:t,canPlayAnimatedEmojis:n,onClick:i,observeIntersectionForLoading:a,observeIntersectionForPlaying:s})=>{const r=(0,o.li)(),c=(0,L.A)(),l="giftPremium"===e.type?e.message:void 0;return(0,Y.FD)("div",{className:k.A.contentBox,tabIndex:0,role:"button",onClick:i,children:[(0,Y.Y)("div",{ref:r,className:k.A.stickerWrapper,style:"width: 150px; height: 150px",children:t&&(0,Y.Y)(U.A,{containerRef:r,sticker:t,size:150,observeIntersectionForLoading:a,observeIntersectionForPlaying:s,noLoad:!n})}),(0,Y.FD)("div",{className:k.A.info,children:[(0,Y.Y)("h3",{className:k.A.title,children:"giftPremium"===e.type?c("ActionGiftPremiumDuration",{duration:(0,F.w6)(c,e.days)}):"giftStars"===e.type?c("ActionGiftStarsTitle",{amount:e.stars},{pluralValue:e.stars}):(()=>{const{cryptoAmount:t,cryptoCurrency:n}=e;return t?(0,D.vv)(c,t,n,{asFontIcon:!0}):void 0})()}),(0,Y.FD)("div",{children:[l&&(0,E.fd)(l),!l&&c("giftTon"===e.type?"DescriptionAboutTon":"giftPremium"===e.type?"ActionGiftPremiumText":"ActionGiftStarsText")]})]}),(0,Y.FD)("div",{className:k.A.actionButton,children:[(0,Y.Y)(B.A,{preset:"button"}),c("ActionViewButton")]})]})}));var K=n(70636),G=n(4262);const j=(0,o.ph)((0,i.EK)((e,{action:t})=>({currentUserId:e.currentUserId,sticker:"giftCode"===t.type?(0,d.t0O)(e,t.days):(0,d.WLj)(e,t.stars),canPlayAnimatedEmojis:(0,d.BWX)(e),channel:t.boostPeerId?(0,d.hds)(e,t.boostPeerId):void 0}))(({currentUserId:e,action:t,sender:n,sticker:i,canPlayAnimatedEmojis:a,channel:s,onClick:r,observeIntersectionForLoading:c,observeIntersectionForPlaying:l})=>{const d=(0,o.li)(),u=(0,L.A)(),h=(0,o.Kr)(()=>{const e=s&&(0,K.F9)(u,s),t=u("ActionFallbackChannel");return(0,G.Nm)(s?.id,e||t)},[s,u]),m=(0,o.Kr)(()=>{const e=s||n,t=e&&(0,K.F9)(u,e),o=u("ActionFallbackChat");return(0,G.Nm)(e?.id,t||o)},[s,n,u]);return(0,Y.FD)("div",{className:k.A.contentBox,tabIndex:0,role:"button",onClick:r,children:[(0,Y.Y)("div",{ref:d,className:k.A.stickerWrapper,style:"width: 150px; height: 150px",children:i&&(0,Y.Y)(U.A,{containerRef:d,sticker:i,size:150,observeIntersectionForLoading:c,observeIntersectionForPlaying:l,noLoad:!a})}),(0,Y.FD)("div",{children:[(0,Y.Y)("h3",{className:k.A.title,children:u("giftCode"!==t.type||t.isViaGiveaway?"ActionGiveawayResultTitle":"GiftInfoTitle")}),(0,Y.FD)("div",{children:["giftCode"===t.type&&(t.isViaGiveaway?u("ActionGiveawayResultPremiumDuration",{channel:h,duration:(0,F.w6)(u,t.days)},{withNodes:!0,withMarkdown:!0,renderTextFilters:["br"]}):u(n?.id===e?"ActionGiftCodeSubscriptionDurationYou":"ActionGiftCodeSubscriptionDuration",{peer:m,duration:(0,F.w6)(u,t.days)},{withNodes:!0,renderTextFilters:["br"]})),"prizeStars"===t.type&&u("ActionGiveawayResultStarsText",{amount:t.stars,channel:h},{withNodes:!0,withMarkdown:!0,pluralValue:t.stars,renderTextFilters:["br"]})]})]}),(0,Y.FD)("div",{className:k.A.actionButton,children:[(0,Y.Y)(B.A,{preset:"button"}),u("giftCode"===t.type?"ActionOpenGiftButton":"ActionViewButton")]})]})}));var J=n(48775),$=n(80140),z=n(14242),_=n(66833),V=n(87094),H=n(87049);const q=(0,o.ph)((0,i.EK)((e,{message:t,action:n})=>{const o=(0,d.mBe)(e,e.currentUserId),i=(0,d.BWX)(e),a=(0,d.Y7C)(e,t),s=n.fromId?(0,d.PVB)(e,n.fromId):void 0,r=t.isOutgoing?(0,d.PVB)(e,t.chatId):o,c=n.toId||n.peerId;return{canPlayAnimatedEmojis:i,sender:s||a,recipient:(c?(0,d.PVB)(e,c):void 0)||r,starGiftMaxConvertPeriod:e.appConfig.starGiftMaxConvertPeriod}})(({action:e,message:t,canPlayAnimatedEmojis:n,sender:i,recipient:a,starGiftMaxConvertPeriod:s,onClick:r,observeIntersectionForLoading:l,observeIntersectionForPlaying:d})=>{const u=(0,o.li)(),p=(0,o.li)(),g=(0,L.A)(),[A,v,f]=(0,C.A)(),{isOutgoing:y}=t,I=(0,_.yQ)(e.gift),S=y?a:i,w=S&&(0,K.vj)(S)&&(0,c.WX)(S),b=e.isAuctionAcquired,N=(0,V.A)(u,"background-color",!e.gift.availabilityTotal),R=g("ActionFallbackSomeone"),M=S&&(0,K.F9)(g,S),P=a&&(0,K.F9)(g,a),x=i?.id===a?.id,T=b?e.gift.stars:void 0,F=(0,o.Kr)(()=>{const n=(0,G.Nm)(S?.id,M||R),o=void 0!==e.starsToConvert?(0,J.Kk)(g,e.starsToConvert):void 0;return b&&void 0!==T?g("ActionStarGiftAuctionBought",{cost:(0,J.Kk)(g,T)}):e.isUpgraded?g("ActionStarGiftUpgraded"):e.alreadyPaidUpgradeStars&&!b?(0,G.AD)(g,"ActionStarGiftUpgradeText",!y||x,{peer:n}):e.isConverted?(0,G.AD)(g,"ActionStarGiftConvertedText",!y||x,{peer:n,amount:o}):s&&(0,$.Fm)()<t.date+s&&o?(0,G.AD)(g,"ActionStarGiftConvertText",!y||x,{peer:n,amount:o}):w?g("ActionStarGiftChannelText",{amount:o},{withNodes:!0}):(0,G.AD)(g,"ActionStarGiftNoConvertText",!y||x,{peer:n})},[e,T,R,b,w,y,g,t.date,S?.id,M,s,x]);return(0,Y.FD)("div",{ref:u,className:(0,m.A)("interactive-gift",k.A.contentBox,k.A.starGift),tabIndex:0,role:"button",onClick:r,onMouseEnter:h.TF?void 0:v,onMouseLeave:h.TF?void 0:f,children:[(0,Y.Y)("div",{ref:p,className:k.A.stickerWrapper,style:"width: 120px; height: 120px",children:I&&(0,Y.Y)(U.A,{containerRef:p,sticker:I,size:120,shouldLoop:A,observeIntersectionForLoading:l,observeIntersectionForPlaying:d,noLoad:!n})}),Boolean(e.gift.availabilityTotal)&&(0,Y.Y)(H.A,{color:N||"blue",text:g("ActionStarGiftLimitedRibbon",{total:(0,z.Vw)(g,e.gift.availabilityTotal)})}),(0,Y.FD)("div",{className:k.A.info,children:[(0,Y.Y)("h3",{className:k.A.title,children:b&&a?g("ActionStarGiftAuctionFor",{peer:(0,G.Nm)(a.id,P||R)},{withNodes:!0}):x?g("ActionStarGiftSelf"):g(y?"ActionStarGiftTo":"ActionStarGiftFrom",{peer:(0,G.Nm)(S?.id,M||R)},{withNodes:!0})}),(0,Y.FD)("div",{className:k.A.subtitle,children:[e.message&&(0,E.fd)(e.message),!e.message&&F]})]}),(0,Y.FD)("div",{className:k.A.actionButton,children:[(0,Y.Y)(B.A,{preset:"button"}),!e.alreadyPaidUpgradeStars||e.isUpgraded||y?g("ActionViewButton"):g("ActionStarGiftUnpack")]})]})}));var W=n(95807),X=n(92108),Q=n(40558);const Z=(0,o.ph)((0,i.EK)((e,{message:t,action:n})=>{const o=(0,d.mBe)(e,e.currentUserId),i=(0,d.BWX)(e),a=(0,d.Y7C)(e,t),s=n.fromId?(0,d.PVB)(e,n.fromId):void 0,r=t.isOutgoing?(0,d.PVB)(e,t.chatId):o;return{canPlayAnimatedEmojis:i,sender:s||a,recipient:(n.peerId?(0,d.PVB)(e,n.peerId):void 0)||r}})(({action:e,message:t,canPlayAnimatedEmojis:n,sender:i,recipient:a,onClick:s,observeIntersectionForLoading:r,observeIntersectionForPlaying:c})=>{const l=(0,o.li)(),d=(0,L.A)(),[u,p,g]=(0,C.A)(),{isOutgoing:A}=t,v=(0,_.yQ)(e.gift),f=(0,_.uc)(e.gift),y=f.model,I=f.pattern,S=f.backdrop,w=[S.centerColor,S.edgeColor],b=`${S.patternColor.slice(0,7)}55`,N=(0,o.Kr)(()=>[[d("ActionStarGiftUniqueModel"),y.name],[d("ActionStarGiftUniqueBackdrop"),S.name],[d("ActionStarGiftUniqueSymbol"),I.name]],[d,y,I,S]),R=!A||e.isUpgrade,P=R&&!e.isUpgrade?i:a,x=d("ActionFallbackSomeone"),T=P&&(0,K.F9)(d,P),F=i?.id===a?.id;return(0,Y.FD)("div",{className:(0,m.A)("interactive-gift",k.A.contentBox,k.A.starGift,k.A.uniqueGift),tabIndex:0,role:"button",onClick:s,onMouseEnter:h.TF?void 0:p,onMouseLeave:h.TF?void 0:g,children:[(0,Y.Y)("div",{className:k.A.uniqueBackgroundWrapper,children:(0,Y.Y)(Q.A,{className:k.A.uniqueBackground,backgroundColors:w,patternIcon:I.sticker,patternSize:14,yPosition:5*M.$,clearBottomSector:!0})}),(0,Y.Y)("div",{ref:l,className:k.A.stickerWrapper,style:"width: 120px; height: 120px",children:v&&(0,Y.Y)(U.A,{containerRef:l,sticker:v,size:120,shouldLoop:u,observeIntersectionForLoading:r,observeIntersectionForPlaying:c,noLoad:!n})}),(0,Y.Y)(H.A,{color:b,text:d("ActionStarGiftUniqueRibbon")}),(0,Y.FD)("div",{className:k.A.info,children:[(0,Y.Y)("h3",{className:k.A.title,children:F?d("ActionStarGiftSelf"):d(R?"ActionStarGiftFrom":"ActionStarGiftTo",{peer:(0,G.Nm)(P?.id,T||x)},{withNodes:!0})}),(0,Y.Y)("div",{className:k.A.subtitle,style:`color: ${S.textColor}`,children:d("GiftUnique",{title:e.gift.title,number:e.gift.number})}),(0,Y.Y)(X.A,{data:N,style:`color: ${S.textColor}`,valueClassName:k.A.uniqueValue})]}),(0,Y.FD)("div",{className:k.A.actionButton,style:(0,W.A)(b&&`background-color: ${b}`),children:[(0,Y.Y)(B.A,{preset:"button"}),d("ActionViewButton")]})]})}));var ee=n(87679),te=n(62587),ne=n(94189),oe=n(90751);const ie=(0,o.ph)((0,i.EK)((e,{message:t})=>({peer:(0,d.PVB)(e,t.chatId)}))(({message:e,action:t,peer:n,observeIntersection:r})=>{const{openMediaViewer:l,uploadProfilePhoto:d,showNotification:u}=(0,i.ko)(),{isOutgoing:h}=e,m=t.photo,p=(0,L.A)(),[g,A]=(0,o.J0)(),[v,f,y]=(0,C.A)(!1),I=(0,te.A)((0,c.rI)(m,"full")),w=(0,te.A)((0,c.Pg)(m)),b=m.isVideo,N=(0,o.Kr)(()=>{const e=n&&(0,K.F9)(p,n)||p("ActionFallbackUser"),t=(0,G.Nm)(n?.id,e);return p(h?"ActionSuggestedPhotoYou":"ActionSuggestedPhoto",{user:t},{withNodes:!0})},[p,h,n]),R=(0,S.A)(()=>{u({title:p("ActionSuggestedPhotoUpdatedTitle"),message:p("ActionSuggestedPhotoUpdatedDescription"),action:{action:"openSettingsScreen",payload:{screen:s.VS.Main}},actionText:p("Open")})}),M=(0,S.A)(e=>{A(void 0),d({file:e}),R()}),x=(0,S.A)(()=>{A(void 0)}),T=(0,S.A)(async()=>{if(!w)return;y(),R();const e=await(0,ee.sZ)(w);d({file:new File([e],"avatar.mp4"),isVideo:!0,videoTs:m.videoSizes?.find(e=>void 0!==e.videoStartTs)?.videoStartTs})});return(0,Y.FD)("div",{className:k.A.contentBox,tabIndex:0,role:"button",onClick:async()=>{!h&&I?b?f():A(await(0,ee.sZ)(I)):l({chatId:e.chatId,messageId:e.id,threadId:a.l3,origin:s.TQ.SuggestedAvatar})},children:[(0,Y.Y)(P.A,{className:k.A.suggestedAvatar,photo:t.photo,loopIndefinitely:!0,withVideo:!0,observeIntersection:r,size:"jumbo"}),(0,Y.Y)("div",{className:k.A.suggestedText,children:N}),(0,Y.Y)("div",{className:k.A.actionButton,children:p("ActionSuggestedPhotoButton")}),(0,Y.Y)(oe.A,{file:g,onClose:x,onChange:M}),(0,Y.Y)(ne.A,{isOpen:v,title:p("ActionSuggestedVideoTitle"),confirmHandler:T,onClose:y,text:p("ActionSuggestedVideoText")})]})}));var ae=n(4961),se=n(59030);const re=(0,o.ph)((0,i.EK)((e,{message:t})=>{const n=(0,d.Y7C)(e,t),o=(0,d.k2W)(e,t.chatId),i=(0,l.Q)(t);let a;if("message"===i?.type&&i.replyToMsgId){const n=(0,d.gMr)(e,t);n&&(a=(0,d.Y7C)(e,n))}const{appConfig:s}=e;return{sender:n,chat:o,originalSender:a,ageMinSeconds:s.starsSuggestedPostAgeMin,isAdmin:!!o&&Boolean((0,d.ODG)(e,t.chatId))}})(({message:e,action:t,sender:n,chat:o,originalSender:i,ageMinSeconds:a,isAdmin:s,onClick:c})=>{const l=(0,L.A)(),d=(0,se.A)(),{scheduleDate:u,amount:h}=t,p=o&&(0,K.em)(l,o),g=()=>(0,G.Nm)(o?.id,p||l("ActionFallbackChat")),A=i&&(0,K.em)(l,i),v=(0,G.Nm)(i?.id,A||l("ActionFallbackUser")),f=u?(0,F.e0)(u,l,d):l("SuggestMessageAnytime"),y=!!u&&u<=(0,$.Fm)(),C=h?.currency,I=h?.amount||0,S=I>0?C===r.ykW?(0,J.QH)(l,(0,D.wD)(I)):(0,J.Kk)(l,I):void 0,w=(0,F.A$)(l,a,!0);return(0,Y.FD)("div",{className:(0,m.A)(k.A.contentBox,k.A.suggestedPostContentBox),onClick:c,children:[(0,Y.Y)("div",{className:k.A.suggestedPostApprovalTitle,children:(0,ae.A)(l("SuggestedPostAgreementReached"))}),(0,Y.Y)("div",{className:k.A.suggestedPostApprovalSection,children:(0,G.AD)(l,y?"SuggestedPostPublished":"SuggestedPostPublishSchedule",!s,{peer:g(),date:f},{withMarkdown:!0})}),S&&(0,Y.Y)("div",{className:k.A.suggestedPostApprovalSection,children:(0,G.AD)(l,"SuggestedPostCharged",!s,{user:v,amount:S},{withMarkdown:!0})}),y&&S&&(0,Y.FD)(Y.FK,{children:[(0,Y.Y)("div",{className:k.A.suggestedPostApprovalSection,children:(0,G.AD)(l,"SuggestedPostReceiveAmount",!s,{peer:g(),duration:w},{withMarkdown:!0})}),(0,Y.Y)("div",{className:k.A.suggestedPostApprovalSection,children:(0,G.AD)(l,"SuggestedPostRefund",!s,{peer:g(),duration:w},{withMarkdown:!0})})]})]})})),ce=(0,o.ph)((0,i.EK)((e,{message:t})=>{const n=(0,d.Y7C)(e,t),o="message"===t.replyInfo?.type&&t.replyInfo.replyToMsgId?(0,d.O5q)(e,t.chatId,t.replyInfo.replyToMsgId):void 0;return{sender:n,replyMessageSender:o?(0,d.Y7C)(e,o):void 0,replyMessage:o}})(({onClick:e,message:t,sender:n,replyMessageSender:o,replyMessage:a})=>{const{openStarsBalanceModal:s}=(0,i.ko)(),c=(0,L.A)(),l=(0,S.A)(e=>{e.preventDefault(),e.stopPropagation(),s({})}),d=o||n,u=d&&(0,K.em)(c,d),h=(0,G.Nm)(d?.id,u||c("ActionFallbackUser")),p=a?.suggestedPostInfo?.price?.currency||r.OUy,g=p===r.ykW?c("CurrencyTon"):c("CurrencyStars"),A=p===r.ykW?c("ButtonTopUpViaFragment"):c("ButtonBuyStars");return(0,Y.FD)("div",{className:(0,m.A)(k.A.contentBox,k.A.suggestedPostBalanceTooLowBox),onClick:e,children:[(0,Y.Y)("div",{className:k.A.suggestedPostBalanceTooLowTitle,children:c("SuggestedPostBalanceTooLow",{peer:h,currency:g},{withNodes:!0,withMarkdown:!0})}),!t.isOutgoing&&(0,Y.FD)("div",{className:k.A.actionButton,onClick:l,children:[(0,Y.Y)(B.A,{preset:"button"}),A]})]})}));var le=n(18276);const de=(0,o.ph)((0,i.EK)((e,{message:t})=>({sender:(0,d.Y7C)(e,t)}))(({message:e,action:t,sender:n,onClick:o})=>{const i=(0,L.A)(),{isOutgoing:a}=e,{rejectComment:s}=t,r=n&&(0,K.F9)(i,n),c=(0,G.Nm)(n?.id,r||i("ActionFallbackUser"));return(0,Y.FD)("div",{className:(0,m.A)(k.A.contentBox,k.A.suggestedPostRejectedContentBox),onClick:o,children:[(0,Y.FD)("div",{className:k.A.suggestedPostRejectedTitle,children:[(0,Y.Y)(le.A,{className:k.A.rejectedIcon,name:"close"}),(0,G.AD)(i,s?"SuggestedPostRejectedWithReason":"SuggestedPostRejected",a,{peer:c},{withMarkdown:!0})]}),s&&(0,Y.Y)("div",{className:k.A.suggestedPostRejectedComment,children:i("SuggestedPostRejectedComment",{comment:s})})]})}));var ue=n(99515),he=n(43581),me=n(14737),pe=n(48894);var ge=n(36838),Ae=n(64493),ve=n(55158);const fe="d8axZxyN",ye="glDpC2av",Ce="gqCs9fSo",Ie="gnYhwnvf",Se="HWgwnKui",we="BTNQ4KBH",be="Xl9MVMTn",Ne="Qizai7yv";function Re({channel:e}){const{openChat:t}=(0,i.ko)(),n=function(e,t="#00000000"){const[n,i]=(0,o.J0)(t),s=(0,te.A)((0,c.cP)(e),!1,a.qZ.BlobUrl);return(0,o.vJ)(()=>{(async()=>{if(!s)return;const e=await(0,pe.rX)(s);i((0,pe.v2)(e))})()},[s]),n}(e,"#3C3C4399"),s=(0,L.A)();return(0,Y.FD)("div",{className:ye,onClick:()=>t({id:e.id}),children:[(0,Y.Y)(P.A,{className:Ce,size:"large",peer:e},e.id),(0,Y.FD)("div",{style:`background: ${n}`,className:Ie,children:[(0,Y.Y)(le.A,{name:"user-filled",className:fe}),(0,Y.Y)("span",{className:Se,children:(0,z.Vw)(s,e?.membersCount||0)})]}),(0,Y.Y)("span",{className:we,children:e.title})]})}function Me({channel:e,chatId:t,channelsCount:n,isCurrentUserPremium:o}){const{openPremiumModal:a,openChatWithInfo:s}=(0,i.ko)(),r=(0,se.A)();return(0,Y.FD)("div",{className:(0,m.A)(ye,"MBChXyXk"),onClick:()=>{o?s({id:t,shouldReplaceHistory:!0,profileTab:"similarChannels",forceScrollProfileTab:!0}):a()},children:[(0,Y.Y)(P.A,{className:Ce,size:"large",peer:e},e.id),(0,Y.Y)("div",{className:be,children:(0,Y.Y)("div",{className:Ne})}),(0,Y.Y)("div",{className:(0,m.A)(be,"JxSmtOFi"),children:(0,Y.Y)("div",{className:Ne})}),(0,Y.FD)("div",{className:Ie,children:[(0,Y.Y)("span",{className:Se,children:`+${n}`}),!o&&(0,Y.Y)(le.A,{name:"lock-badge",className:fe})]}),(0,Y.Y)("span",{className:we,children:r("MoreSimilar")})]})}const Pe=(0,o.ph)((0,i.EK)((e,{chatId:t})=>{const{similarChannelIds:n,isExpanded:o,count:i}=(0,d.dg4)(e,t)||{},a=(0,d.g29)(e),s=(0,d.AWZ)(e,t);return{similarChannelIds:n,isExpanded:o,count:i,isCurrentUserPremium:a,channelJoinInfo:s?.joinInfo}})(({chatId:e,similarChannelIds:t,isExpanded:n,count:a,isCurrentUserPremium:s,channelJoinInfo:r})=>{const{toggleChannelRecommendations:c,loadChannelRecommendations:l}=(0,i.ko)(),u=(0,se.A)(),[h,p,g]=(0,C.A)(!1),[A,v,f]=(0,C.A)(!1),y=(0,o.li)(),I=(0,o.li)(!1),w=(0,o.Kr)(()=>{if(!t)return;const e=(0,i.mS)();return t.map(t=>(0,d.hds)(e,t)).filter(Boolean)},[t]),[b,N]=(0,o.J0)(!1),R=(0,o.Kr)(()=>w?.slice(0,10),[w]),M=Boolean(R?.length),P=Boolean(!b&&(n||A||h)&&M);(0,ge.A)(y,!P,!0),(0,o.vJ)(()=>{t||l({chatId:e})},[e,t]),(0,me.A)(()=>N(!1),2e3),(0,o.vJ)(()=>{if(b&&w&&n){const e=setTimeout(()=>{N(!1)},300);return()=>clearTimeout(e)}},[w,n,b]),(0,o.vJ)(()=>{n?(p(),f(),N(!t),I.current||setTimeout(()=>{y.current?.scrollIntoView({behavior:"smooth"})},150)):(g(),v())},[n,t]);const k=(0,S.A)(()=>{c({chatId:e})});if((0,o.vJ)(()=>{r?.joinedDate&&!n&&(0,$.Fm)()-r.joinedDate<=10&&(k(),I.current=!0)},[r,n]),P||b)return(0,Y.FD)("div",{className:(0,m.A)("V3RHiOJR"),children:[b&&(0,Y.Y)(ve.A,{className:"xKVZv7KE"}),P&&(0,Y.FD)("div",{className:(0,m.A)(h&&"eb8rX09E",A&&"XR6_qLCc"),children:[(0,Y.Y)("div",{className:"tfG_BSDt",children:(0,Y.Y)("svg",{width:"19",height:"7",viewBox:"0 0 19 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Y.Y)("path",{className:"HVbeGv4t","fill-rule":"evenodd","clip-rule":"evenodd",d:"M19 7C16.8992 7 13.59 3.88897 11.5003 1.67424C10.7648 0.894688 10.397 0.50491 10.0434 0.385149C9.70568 0.270811 9.4225 0.270474 9.08456 0.38401C8.73059 0.50293 8.36133 0.892443 7.62279 1.67147C5.52303 3.88637 2.18302 7 0 7L19 7Z",fill:"white"})})}),(0,Y.FD)("div",{className:"njAC8dR9",children:[(0,Y.FD)("div",{className:"s7QOi22Q",children:[(0,Y.Y)("span",{className:"JstcOhAN",children:u("SimilarChannels")}),(0,Y.Y)(Ae.A,{className:"meewH7t_",color:"translucent",onClick:k,iconName:"close"})]}),(0,Y.Y)("div",{ref:y,className:(0,m.A)("h4gWlNen","no-scrollbar"),children:R?.map((t,n)=>9===n?(0,Y.Y)(Me,{channel:t,chatId:e,channelsCount:a-10+1,isCurrentUserPremium:s}):(0,Y.Y)(Re,{channel:t}))})]})]})]})})),ke=new Set(["pinMessage","chatEditPhoto","chatDeletePhoto","todoCompletions","todoAppendTasks","unsupported"]),Ye=new Set(["giftCode","prizeStars","suggestProfilePhoto","suggestedPostApproval"]),xe=(0,o.ph)((0,i.EK)((e,{message:t,threadId:n})=>{const o=(0,d.nTw)(e),i=(0,d.hds)(e,t.chatId),s=(0,d.Y7C)(e,t),r=i?.isForum&&n!==a.l3,{replyToMsgId:c,replyToPeerId:u}=(0,l.Q)(t)||{},h=c?(0,d.O5q)(e,u||t.chatId,c):void 0,m=!!n&&(0,d.nJv)(e,t,n),{direction:p,noHighlight:g,isResizingContainer:A,scrollTargetPosition:v}=m&&o.focusedMessage||{},f=(0,d.g29)(e),y=i?.unreadReactions?.includes(t.id),C=(0,d.trm)(e);return{sender:s,currentUserId:e.currentUserId,isCurrentUserPremium:f,isFocused:m,focusDirection:p,noFocusHighlight:g,isInsideTopic:r,replyMessage:h,isInSelectMode:(0,d.rTV)(e),actionMessageBg:(0,d.bdt)(e),hasUnreadReaction:y,isResizingContainer:A,scrollTargetPosition:v,isAccountFrozen:C}})(({message:e,threadId:t,sender:n,currentUserId:a,appearanceOrder:d,isJustAdded:M,isLastInList:P,memoFirstUnreadIdRef:x,getIsMessageListReady:F,isInsideTopic:D,isFocused:E,focusDirection:L,noFocusHighlight:B,replyMessage:U,actionMessageBg:K,isCurrentUserPremium:G,isInSelectMode:J,hasUnreadReaction:$,isResizingContainer:z,scrollTargetPosition:_,isAccountFrozen:V,onIntersectPinnedMessage:H,observeIntersectionForBottom:W,observeIntersectionForLoading:X,observeIntersectionForPlaying:Q})=>{const{requestConfetti:ee,openMediaViewer:te,getReceipt:ne,checkGiftCode:oe,openPrizeStarsTransactionFromGiveaway:ae,openPremiumModal:se,openStarsTransactionFromGift:le,openGiftInfoModalFromMessage:me,toggleChannelRecommendations:pe,animateUnreadReaction:ge,markMentionsRead:Ae,focusMessage:ve}=(0,i.ko)(),fe=(0,o.li)(),{id:ye,chatId:Ce}=e,Ie=e.content.action,Se=(0,p.iL)(ye),we=Ye.has(Ie.type),be=ke.has(Ie.type),Ne=h.uH&&!be,Re="suggestedPostSuccess"===Ie.type,Me=(0,l.Q)(e),{replyToMsgId:xe,replyToPeerId:Te}=Me||{},Fe=Boolean(e.areReactionsPossible&&e?.reactions?.results?.length),De=D&&"topicCreate"===Ie.type,{isTouchScreen:Ee}=(0,v.Ay)();(0,I.mv)(fe,De?void 0:W),(0,y.A)(Te||Ce,xe,U,ye),(0,N.A)({elementRef:fe,isFocused:E,focusDirection:L,noFocusHighlight:B,isResizingContainer:z,isJustAdded:M,scrollTargetPosition:_}),(0,o._W)(()=>{e.isPinned&&H?.({viewportPinnedIdsToRemove:[e.id]})});const{isContextMenuOpen:Le,contextMenuAnchor:Be,handleBeforeContextMenu:Ue,handleContextMenu:Oe,handleContextMenuClose:Ke,handleContextMenuHide:Ge}=(0,f.A)(fe,Ee&&J||V,!u.Vq,h.Ni,F),je=void 0!==Be,Je=d<=0,[$e,ze]=(0,C.A)(Je);(0,o.vJ)(()=>{Je||setTimeout(ze,d*r.zq7)},[d,ze,Je]);const{ref:_e}=(0,w.A)({isOpen:$e,noOpenTransition:Je,noCloseTransition:!0,className:!1,ref:fe});(0,o.vJ)(()=>{const t=fe.current;t&&(0,g.Y)(t)&&($&&ge({messageIds:[ye]}),e.hasUnreadMention&&Ae({chatId:Ce,messageIds:[ye]}))},[$,Ce,ye,ge,e.hasUnreadMention]),(0,o.vJ)(()=>{"giftPremium"===Ie.type&&(x?.current&&ye>=x.current||Se)&&ee({})},[Ie.type,ye,Se,x]);const Ve=(0,b.A)(Ne?K:void 0),He=(0,S.A)(()=>{switch(Ie.type){case"paymentSent":case"paymentRefunded":ne({chatId:e.chatId,messageId:e.id});break;case"chatEditPhoto":te({chatId:e.chatId,messageId:e.id,threadId:t,origin:s.TQ.ChannelAvatar});break;case"giftCode":oe({slug:Ie.slug,message:{chatId:e.chatId,messageId:e.id}});break;case"prizeStars":ae({chatId:e.chatId,messageId:e.id});break;case"giftPremium":se({isGift:!0,fromUserId:n?.id,toUserId:n&&n.id===a?Ce:a,daysAmount:Ie.days});break;case"giftTon":case"giftStars":le({chatId:e.chatId,messageId:e.id});break;case"starGift":case"starGiftUnique":me({chatId:e.chatId,messageId:e.id});break;case"channelJoined":pe({chatId:Ce});break;case"suggestedPostApproval":{const n=(0,l.Q)(e);"message"===n?.type&&n.replyToMsgId&&ve({chatId:e.chatId,threadId:t,messageId:n.replyToMsgId});break}case"suggestedPostSuccess":{const n=(0,l.Q)(e);"message"===n?.type&&n.replyToMsgId&&ve({chatId:e.chatId,threadId:t,messageId:n.replyToMsgId});break}}}),qe=(0,o.Kr)(()=>{switch(Ie.type){case"chatEditPhoto":if(!Ie.photo)return;return(0,Y.Y)(T,{action:Ie,observeIntersection:X,onClick:He});case"suggestProfilePhoto":return(0,Y.Y)(ie,{message:e,action:Ie,observeIntersection:X});case"prizeStars":case"giftCode":return(0,Y.Y)(j,{action:Ie,sender:n,observeIntersectionForLoading:X,observeIntersectionForPlaying:Q,onClick:He});case"giftPremium":case"giftTon":case"giftStars":return(0,Y.Y)(O,{action:Ie,observeIntersectionForLoading:X,observeIntersectionForPlaying:Q,onClick:He});case"starGift":return(0,Y.Y)(q,{action:Ie,message:e,observeIntersectionForLoading:X,observeIntersectionForPlaying:Q,onClick:He});case"starGiftUnique":return(0,Y.Y)(Z,{action:Ie,message:e,observeIntersectionForLoading:X,observeIntersectionForPlaying:Q,onClick:He});case"channelJoined":return(0,Y.Y)(Pe,{chatId:e.chatId});case"suggestedPostApproval":return Ie.isBalanceTooLow?(0,Y.Y)(ce,{message:e,action:Ie,onClick:He}):Ie.isRejected?(0,Y.Y)(de,{message:e,action:Ie,onClick:He}):(0,Y.Y)(re,{message:e,action:Ie,onClick:He});default:return}},[Ie,e,X,n,Q]);if(!(D&&"topicCreate"===Ie.type||"phoneCall"===Ie.type))return(0,Y.FD)("div",{ref:_e,id:(0,c.GZ)(ye),className:(0,m.A)("ActionMessage","message-list-item",k.A.root,be&&k.A.singleLine,Ne&&k.A.fluidMultiline,qe&&k.A.hasFullContent,E&&!B&&"focused",je&&"has-menu-open",P&&"last-in-list"),"data-message-id":e.id,"data-is-pinned":e.isPinned||void 0,"data-has-unread-mention":e.hasUnreadMention||void 0,"data-has-unread-reaction":$||void 0,onMouseDown:e=>{(0,A.l)(e),Ue(e)},onContextMenu:Oe,children:[!we&&(0,Y.FD)(Y.FK,{children:[Ne&&(0,Y.Y)("div",{className:(0,m.A)(k.A.inlineWrapper,Re&&k.A.hoverable),children:(0,Y.Y)("span",{className:k.A.fluidBackground,style:Ve,children:(0,Y.Y)(R.A,{message:e,isInsideTopic:D})})}),(0,Y.Y)("div",{className:(0,m.A)(k.A.inlineWrapper,Re&&k.A.hoverable),children:(0,Y.Y)("span",{className:k.A.textContent,onClick:He,children:(0,Y.Y)(R.A,{message:e,isInsideTopic:D})})})]}),qe,Be&&(0,Y.Y)(ue.A,{isOpen:Le,anchor:Be,message:e,messageListType:"thread",className:k.A.contextContainer,onClose:Ke,onCloseAnimationEnd:Ge}),Fe&&(0,Y.Y)(he.A,{isOutside:!0,message:e,threadId:t,observeIntersection:Q,isCurrentUserPremium:G,isAccountFrozen:V})]})}))},36838:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(84051);const i=(e,t,n=!1)=>{(0,o.vJ)(()=>{if(t)return;const o=e.current;function i(e){e.deltaX||(o.scrollLeft+=e.deltaY/4,n&&e.preventDefault())}return o.addEventListener("wheel",i,{passive:!n}),()=>{o.removeEventListener("wheel",i)}},[e,t,n])}},40558:(e,t,n)=>{n.d(t,{A:()=>v});var o=n(84051),i=n(66644),a=n(90709),s=n(87357),r=n(95807),c=n(48894),l=n(87679),d=n(76023),u=n(17712),h=n(62587),m=n(93545),p=n(38691);var g=n(20021);const A=4*d.$,v=(0,o.ph)(({backgroundColors:e,patternIcon:t,patternSize:n=20,centerEmptiness:d=.1,ringsCount:v=3,ovalFactor:f=1.4,maxRadius:y=.42,withLinearGradient:C,clearBottomSector:I,className:S,canvasClassName:w,yPosition:b,withAdaptiveHeight:N})=>{const R=(0,o.li)(),M=(0,o.li)(),[P,k]=(0,o.Ul)({width:0,height:0}),Y=(0,p.A)(),[x,T]=(0,o.J0)(),F=t&&(0,a.Mw)(t,"preview"),D=(0,h.A)(F);(0,o.vJ)(()=>{D&&(0,l.NN)(D).then(T)},[D]);const E=(0,o.Kr)(()=>{const e=[];for(let t=1;t<=v;t++){const n=Math.floor(8*(1+.5*(t-1))),o=t/v,i=d+(y-d)*o,a=t%2==0?Math.PI/n:0;for(let t=0;t<n;t++){const s=t/n*Math.PI*2+a;if(I&&s>.45*Math.PI&&s<.55*Math.PI)continue;const r=i*Math.cos(s)*f,c=i*Math.sin(s),l=1.65-o+Math.random()/v;e.push({x:r,y:c,sizeFactor:l})}}return e},[d,I,y,f,v]);(0,m.A)(R,e=>{k({width:e.contentRect.width,height:e.contentRect.height})}),(0,o.vJ)(()=>{const e=R.current;e&&k({width:e.clientWidth,height:e.clientHeight})},[k]);const L=(0,u.A)(()=>{const t=M.current;if(!t||!x)return;const o=t.getContext("2d"),{width:i,height:a}=t;if(!i||!a)return;const s=i/2,r=N?a/2:void 0!==b?b*Y:i/2;o.clearRect(0,0,i,a),E.forEach(({x:e,y:t,sizeFactor:c})=>{const l=e*Math.max(i,A*Y)+s,d=t*Math.max(N?a:i,A*Y)+r,u=n*Y*c;o.drawImage(x,l-u/2,d-u/2,u,u)});const l=e?.[1]??e?.[0]??"#000000",d=(0,c.LS)((0,c.xp)(l))<51;o.fillStyle=(0,c.VT)(l,.5,d?.28:-.28),o.globalCompositeOperation="source-in",o.fillRect(0,0,i,a);const u=o.createRadialGradient(s,r,0,s,r,i*y);u.addColorStop(0,"rgb(255 255 255 / 0.4)"),u.addColorStop(1,"rgb(255 255 255 / 0.9)"),o.translate(s,r),o.scale(1,1/f),o.translate(-s,-r),o.globalCompositeOperation="destination-out",o.fillStyle=u;const h=a*f;o.fillRect(0,-h,i,2*h)});return(0,o.vJ)(()=>{L()},[x,E,b,f]),(0,o.Nf)(()=>{const{width:e,height:t}=P(),n=M.current;e&&t&&n&&(0,i.RK)(()=>{n.width=e*Y,n.height=t*Y,L()})},[P,Y]),(0,g.Y)("div",{ref:R,className:(0,s.A)("Af3tYFMg",C&&Boolean(e?.length)&&"NorYkjxC",S),style:(0,r.A)(e&&`--_bg-light: ${e[0]}`,e&&`--_bg-dark: ${e[1]??e[0]}`,void 0!==b&&`--_y-shift: ${b}px`),children:(0,g.Y)("canvas",{ref:M,className:(0,s.A)("GbpiDSS_",x&&"Y5FyX1oo",w),"aria-hidden":"true"})})})},41512:(e,t,n)=>{n.d(t,{Y:()=>i});var o=n(43503);function i(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}},42211:(e,t,n)=>{n.d(t,{A:()=>m});var o=n(84051),i=n(61433),a=n(31481),s=n(66644),r=n(81954),c=n(76023);const l=500,d=a.nxZ,u=1.25*c.$,h=.5*c.$;function m({elementRef:e,isFocused:t,focusDirection:n,noFocusHighlight:a,isResizingContainer:c,isJustAdded:m,isQuote:p,scrollTargetPosition:g}){const A=(0,o.li)(!m);(0,o.Nf)(()=>{const o=A.current;if(A.current=!1,t&&e.current){const t=e.current.closest(".MessageList");if(!t)return;const m=a,A=g||(m?"end":"centerOrTop"),v=()=>{const o=void 0!==n?m?l:d:void 0,a=(0,r.Ay)({container:t,element:e.current,position:A,margin:m?h:u,maxDistance:o,forceDirection:n,forceNormalContainerHeight:c,shouldReturnMutationFn:!0});if(p){const t=e.current.querySelector(".is-quote");t&&(0,s.RK)(()=>{(0,i.YM)(t,"animate")})}return a};o?(0,s.gm)(v):(0,s.YS)(()=>{(0,s.RK)(v())})}},[e,t,n,a,c,p,g])}},43581:(e,t,n)=>{n.d(t,{A:()=>j});var o=n(84051),i=n(13439),a=n(90709),s=n(91048),r=n(87357),c=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),v=n(39351),f=n(29886),y=n(34201),C=n(68292),I=n(26875),S=n(96454),w=n(36175),b=n(5912),N=n(4438),R=n(9267),M=n(93879),P=n(20021);const k=1.5*m.$,Y=6.5*m.$,x=S.pz||S.Ni?2:5,T=S.pz||S.Ni?2:3,F=(0,o.ph)((0,i.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=k,effectSize:c=Y,activeReactions:l,localAmount:u,withEffects:h,observeIntersection:m})=>{const{stopActiveReaction:p}=(0,i.ko)(),g=(0,o.li)(),v=(0,o.li)(),[f,C]=(0,o.J0)([]),I=(0,b.Vz)(g,m),S=(0,o.Kr)(()=>l?.find(e=>(0,a.a0)(e,t)),[l,t]),F=Boolean(h&&S),D=f.length<x;(0,A.A)(([e])=>{F?!u||u<=(e||0)||D&&C(e=>[...e,Date.now()]):C([])},[u,D,F]);const{shouldRender:E}=(0,y.A)({ref:v,noMountTransition:!0,isOpen:F,className:"slow",withShouldRender:!0}),L=(0,d.A)(()=>{const n=f.slice(1);C(n),n.length||p({containerId:e,reaction:t})}),B=(0,r.A)(M.A.root,E&&M.A.animating,n);return(0,P.FD)("div",{className:B,ref:g,teactFastList:!0,children:[(0,P.Y)(R.A,{type:"gold",size:"adaptive",style:`width: ${s}px; height: ${s}px`},"icon"),E&&f.map(e=>(0,P.Y)(N.A,{ref:v,className:M.A.effect,size:c,tgsUrl:w.w.StarReactionEffect,play:I,noLoop:!0,forceAlways:!0,nonInteractive:!0,quality:T,onEnded:L},e))]})}));var D=n(11241),E=n(85118),L=n(64493),B=n(69988);const U=1.25*m.$;function O(e){return e.stars}const K=(0,o.ph)(({reaction:e,containerId:t,isOwnMessage:n,recentReactors:s,className:c,chosenClassName:l,chatId:u,messageId:m,isOutside:S,observeIntersection:w,onClick:b,onPaidClick:N})=>{const{openStarsBalanceModal:R,resetLocalPaidReactions:M,openPaidReactionModal:k,requestWave:Y}=(0,i.ko)(),x=(0,o.li)(),T=(0,o.li)(),K=(0,o.li)(),G=(0,v.A)(),j="paid"===e.reaction.type,J=(0,p.A)(O),$=Boolean(J),z=(0,d.A)((e=1)=>{N?.(e)}),_=(0,d.A)(t=>{if("paid"===e.reaction.type)return t.stopPropagation(),void z();b?.(e.reaction)}),{isContextMenuOpen:V,handleBeforeContextMenu:H,handleContextMenu:q,handleContextMenuClose:W,handleContextMenuHide:X}=(0,g.A)(x,"paid"!==e.reaction.type,void 0,void 0,void 0,!0);(0,o.vJ)(()=>{V&&(k({chatId:u,messageId:m}),W(),X())},[W,X,V,u,m]),(0,A.A)(([t])=>{const n=e.localAmount,o=x.current;if(!n||!o||n===t?.localAmount)return;if($&&n>J.balance.amount)return R({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,i=t+o.offsetHeight/2;Y({startX:n,startY:i})}const i=Number(getComputedStyle(o).scale)||1;K.current?.cancel(),K.current=o.animate([{scale:i},{scale:Math.min(1.2*i,3),offset:.2},{scale:1}],{duration:500*i,easing:"ease-out"})},[e,J?.balance,$,u,m]);const Q=(0,f.A)(e.localAmount),{shouldRender:Z}=(0,y.A)({isOpen:Boolean(e.localAmount),ref:T,className:"slow",withShouldRender:!0});return(0,P.FD)(L.A,{className:(0,r.A)(B.A.root,n&&B.A.own,j&&B.A.paid,S&&B.A.outside,(0,a.eu)(e)&&B.A.chosen,(0,a.eu)(e)&&l,c),size:"tiny",ref:x,onMouseDown:H,onContextMenu:q,onClick:_,children:["paid"===e.reaction.type?(0,P.FD)(P.FK,{children:[(0,P.Y)(E.A,{preset:"button"}),(0,P.Y)(F,{className:B.A.animatedEmoji,containerId:t,reaction:e.reaction,size:U,localAmount:e.localAmount,observeIntersection:w}),Z&&(0,P.Y)(C.A,{ref:T,text:`+${(0,h.Vw)(G,e.localAmount||Q)}`,className:B.A.paidCounter})]}):(0,P.Y)(D.A,{className:B.A.animatedEmoji,containerId:t,reaction:e.reaction,size:U,observeIntersection:w}),s?.length?(0,P.Y)(I.A,{size:"mini",peers:s}):(0,P.Y)(C.A,{text:(0,h.Vw)(G,e.count+(e.localAmount||0)),className:B.A.counter})]})});var G=n(92915);const j=(0,o.ph)(({message:e,threadId:t,isOutside:n,maxWidth:h,metaChildren:m,observeIntersection:p,noRecentReactors:g,isCurrentUserPremium:A,tags:v,isAccountFrozen:f})=>{const{toggleReaction:y,addLocalPaidReaction:C,updateMiddleSearch:I,performMiddleSearch:S,openPremiumModal:w,resetLocalPaidReactions:b,showNotification:N,openFrozenAccountModal:R}=(0,i.ko)(),M=(0,u.A)(),{results:k,areTags:Y,recentReactions:x}=e.reactions,T=Boolean(e.areReactionsPossible&&e.reactions),F=(0,o.Kr)(()=>k.reduce((e,t)=>e+t.count,0),[k]),D=(0,o.Kr)(()=>{const e=(0,i.mS)();return x?.reduce((t,n)=>{const{reaction:o,peerId:i}=n,r=(0,a.Jj)(o),c=(0,s.PVB)(e,i);if(!c)return t;const l=t[r]||[];return l.push(c),t[r]=l,t},{})},[x]),E=(0,o.Kr)(()=>{const t=(0,c.bj)(e);return k.map(e=>{const n=(0,a.Jj)(e.reaction),o=D?.[n],i=F>3||g,s=Y?v?.[n]:void 0;return{reaction:e,reactionKey:n,messageKey:t,recentReactors:i?void 0:o,isChosen:(0,a.eu)(e),tag:s}})},[e,g,D,k,Y,v,F]),L=(0,d.A)(n=>{if(!f)return Y?A?(I({chatId:e.chatId,threadId:t,update:{savedTag:n}}),void S({chatId:e.chatId,threadId:t})):void w({initialSection:"saved_tags"}):void y({chatId:e.chatId,messageId:e.id,reaction:n});R()}),B=(0,o.Kr)(()=>k.find(e=>"paid"===e.reaction.type)?.localAmount||0,[k]),U=(0,d.A)(t=>{f?R():C({chatId:e.chatId,messageId:e.id,count:t})});(0,o.vJ)(()=>{B&&N({localId:(0,c.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 O=(0,d.A)(t=>{f?R():y({chatId:e.chatId,messageId:e.id,reaction:t})});return(0,l.A)(()=>()=>{b({chatId:e.chatId,messageId:e.id})}),(0,P.FD)("div",{className:(0,r.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:i,reactionKey:a,isChosen:s,tag:r})=>Y?(0,P.Y)(G.A,{className:"message-reaction",chosenClassName:"chosen",containerId:i,isOwnMessage:e.isOutgoing,isChosen:s,reaction:t.reaction,tag:r,withContextMenu:A,onClick:L,onRemove:O,observeIntersection:p},a):(0,P.Y)(K,{chatId:e.chatId,messageId:e.id,className:"message-reaction",chosenClassName:"chosen",containerId:i,isOwnMessage:e.isOutgoing,recentReactors:o,isOutside:n,reaction:t,onClick:L,onPaidClick:U,observeIntersection:p},a)),m]})})},45470:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(84051),i=n(32587),a=n(66644),s=n(96454),r=n(35297);const c=2,l=2;function d(e,t=!1,n,d=c,u,h){const m=(0,o.li)(),p=(0,o.li)();return(0,r.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 r=new Image,c=()=>{const e=u||r.width,t=h||r.height,n=o.getContext("2d",{alpha:!1});(0,a.RK)(()=>{o.width=e,o.height=t,s.QH&&(n.filter=`blur(${d}px)`),n.drawImage(r,2*-d,2*-d,e+4*d,t+4*d),s.QH||(0,i.A)(n,0,0,e,t,d,l)})};r.onload=()=>{n?(0,a.YS)(c):c()},r.src=e},[e,t,h,u,d,n]),m}},45780:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(96454),i=n(87357),a=n(39351),s=n(17712),r=n(42452);var c=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:v,onClick:f,onDisabledClick:y})=>{const C=(0,a.A)(),I=!h&&!u,S=(0,s.A)(()=>{h||(u?y?.():f?.())});return(0,c.FD)("div",{className:(0,i.A)("OHkx_W75",t&&"neXqB2_A",u&&"tvZeVJPh",I&&"VUSwo4t5",n&&"dMT9byM6",p),onClick:S,style:v,dir:C.isRtl?"rtl":void 0,role:I?"button":void 0,tabIndex:I?0:void 0,children:[!u&&!h&&m&&(0,c.Y)(r.A,{}),Boolean(l)&&(0,c.Y)("div",{className:(0,i.A)("kmjqObdP","end"===d?"iqGhSQGm":"F0Hv3EQm"),children:l}),Boolean(n)&&(0,c.Y)("div",{className:"dnAaRPCo",children:n}),(0,c.Y)("div",{className:(0,i.A)("JSSC0N8V",g),children:e}),Boolean(t)&&(0,c.Y)("div",{className:(0,i.A)("OYmzCSp2",A),children:t}),!l&&o.pz&&(0,c.Y)("div",{className:"P53DrbWA"})]})}},48196:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(84051),i=n(31481),a=n(28470),s=n(20021);const r=new Map;class c{referenceCount=0;constructor(e){this.color=e,this.filterId=`fluid-background-filter-${e.slice(1)}`,(0,a.z)((0,s.FD)("filter",{"color-interpolation-filters":"sRGB",xmlns:i.jNX,children:[(0,s.Y)("feGaussianBlur",{in:"SourceAlpha",stdDeviation:"4",result:"blur"}),(0,s.Y)("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 30 -15",result:"goo"}),(0,s.Y)("feComposite",{in:"SourceAlpha",in2:"goo",operator:"over",result:"outline"}),(0,s.Y)("feFlood",{"flood-color":e,result:"color"}),(0,s.Y)("feComposite",{in:"color",in2:"outline",operator:"in"})]}),this.filterId)}getFilterId(){return this.referenceCount+=1,this.filterId}removeReference(){this.referenceCount-=1,0===this.referenceCount&&(0,a.e)(this.filterId)}isUsed(){return this.referenceCount>0}}function l(e,t){if((0,o.vJ)(()=>{if(e)return()=>{const t=r.get(e);t&&(t.removeReference(),t.isUsed()||r.delete(t.color))}},[e]),!e)return;if(r.has(e))return d(r.get(e).getFilterId(),t);const n=new c(e);return r.set(e,n),d(n.getFilterId(),t)}function d(e,t){return t?`url(#${e})`:`filter: url(#${e});`}},49086:(e,t,n)=>{n.d(t,{C:()=>m,V:()=>h});var o=n(13439),i=n(23174),a=n(90709),s=n(3544),r=n(60343),c=n(43044),l=n(58849),d=n(4961),u=n(18501);function h({message:e,highlight:t,emojiSize:n,asPreview:o,truncateLength:i,isProtected:s,forcePlayback:d,shouldRenderAsHtml:h,isForMediaViewer:m,threadId:p,maxTimestamp:g}){const{text:A,entities:v}=e.content.text||{};if(!A){const t=(0,a.BN)((0,c.Yw)(),e)?.text;return t?[(0,l.A)(t,i)]:void 0}const f=(0,r.bj)(e);return(0,u.fd)({text:(0,l.A)(A,i),entities:v,highlight:t,emojiSize:n,shouldRenderAsHtml:h,containerId:`${m?"mv-":""}${f}`,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,r,c=s.vs){const{entities:u}=t.content.text||{},m=(0,o.mS)(),p=(0,a.ni)(m,t),g=u?.some(e=>e.type===i.C7.Spoiler),A=u?.some(e=>e.type===i.C7.CustomEmoji);if(!g&&!A){const o=(0,l.A)((0,s.dS)(e,t,p,n),c);return r?(0,d.A)(o,["emoji","highlight"],{highlight:r}):(0,d.A)(o)}const v=!n&&(0,s.Su)(t),f=v?`${v} `:"",y=h({message:t,highlight:r,asPreview:!0,truncateLength:c}),C=(0,s.oL)(e,t,p,y);return[...(0,d.A)(f),...Array.isArray(C)?C:[C]].filter(Boolean)}},49746:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051),i=n(13439);function a(e,t,n,a,s){const{loadMessage:r}=(0,i.ko)();(0,o.vJ)(()=>{s||t&&!n&&r({chatId:e,messageId:t,replyOriginForId:a})},[s,e,n,t,a])}},54960:(e,t,n)=>{n.d(t,{A:()=>Y});var o=n(84051),i=n(13439),a=n(31481),s=n(66644),r=n(90709),c=n(70636),l=n(91048),d=n(87357),u=n(97822),h=n(87894),m=n(79824),p=n(96374),g=n(17712),A=n(59030),v=n(19806),f=n(46222),y=n(40664),C=n(52745),I=n(24956),S=n(21849),w=n(34431),b=n(18276),N=n(10187),R=n(45780),M=n(31722),P=n(20021);const k="PeerPickerItem",Y=(0,o.ph)(({className:e,categories:t,itemIds:n,categoryPlaceholderKey:Y,filterValue:x,filterPlaceholder:T,notFoundText:F,searchInputId:D,itemClassName:E,isLoading:L,noScrollRestore:B,isSearchable:U,lockedUnselectedSubtitle:O,forceShowSelf:K,isViewOnly:G,itemInputType:j,withStatus:J,withPeerTypes:$,withPeerUsernames:z,withDefaultPadding:_,onFilterChange:V,onDisabledClick:H,onLoadMore:q,...W})=>{const X=(0,A.A)(),Q=W.allowMultiple,Z=Q?W.lockedSelectedIds:void 0,ee=Q?W.lockedUnselectedIds:void 0,te=(0,o.Kr)(()=>Q?W.selectedCategories:W.selectedCategory?[W.selectedCategory]:m.p,[Q,W.selectedCategory,W.selectedCategories]),ne=(0,o.Kr)(()=>Q?W.selectedIds:W.selectedId?[W.selectedId]:m.p,[Q,W.selectedId,W.selectedIds]),oe=(0,o.li)(),ie=ne.length>10;(0,o.vJ)(()=>{U&&(0,s.YS)(()=>{(0,u.A)(oe.current)})},[U]);const ae=(0,o.Kr)(()=>new Set(Z),[Z]),se=(0,o.Kr)(()=>new Set(ee),[ee]),re=(0,o.Kr)(()=>ne.filter(e=>!ae.has(e)),[ae,ne]),ce=(0,o.Kr)(()=>t?(0,h.dU)(t,"type"):{},[t]),le=(0,o.Kr)(()=>{if(x)return n;const e=[],t=[],o=[];return n.forEach(n=>{ae.has(n)?e.push(n):se.has(n)?o.push(n):t.push(n)}),e.concat(t,o)},[x,n,ae,se]),de=(0,g.A)(e=>{if(ae.has(e))H?.(e,!0);else if(se.has(e))H?.(e,!1);else{if(Q&&ce[e]){const t=ce[e].type,n=te?.slice()||[];return n.includes(t)?n.splice(n.indexOf(t),1):n.push(t),void W.onSelectedCategoriesChange?.(n)}if(Q){const t=ne.slice();return t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),void W.onSelectedIdsChange?.(t)}ce[e]?W.onSelectedCategoryChange?.(ce[e].type):W.onSelectedIdChange?.(e)}}),ue=(0,g.A)(e=>{const{value:t}=e.currentTarget;V?.(t)}),[he,me]=(0,p.A)(q,le,Boolean(x)),pe=(0,o.hb)((e,t)=>{const n=(0,i.mS)(),o=t?ce[e]:void 0,s=t?void 0:(0,l.PVB)(n,e),u=s||o;if(!u)return a.Oig?(0,P.FD)("div",{children:["No peer or category with ID",e]},e):void 0;const h=s&&!(0,c.vj)(s)?s.isSelf&&!K:void 0,m=se.has(e),p=ae.has(e),g=m||p,A=o?te?.includes(o.type):ne.includes(e),[f,y]=function(){if(m)return[O];if(s){if(z){const e=(0,r.Kl)(s);if(e)return[`@${e}`]}if(J){if((0,c.vj)(s))return[(0,r.sT)(X,s)];const e=(0,l.K0y)(n,s.id);return[(0,r.CD)(X,s,e),(0,d.A)((0,r.PF)(s,e,!0)&&M.A.onlineStatus)]}if($){const e=(0,c.cy)(s);return e&&[X(e)]}}}()||[];return(0,P.Y)(R.A,{className:(0,d.A)(k,E),title:(0,P.Y)(w.A,{peer:u}),avatarElement:(0,P.Y)(S.A,{peer:s||o,isSavedMessages:h,size:"medium"}),subtitle:f,subtitleClassName:y,disabled:g,inactive:G,ripple:!0,inputElement:g?(0,P.Y)(b.A,{name:"lock-badge"}):"radio"===j?(0,P.Y)(I.A,{checked:A,disabled:g,onlyInput:!0}):"checkbox"===j?(0,P.Y)(v.A,{checked:A,disabled:g,onlyInput:!0}):void 0,inputPosition:"end",onClick:()=>de(e),onDisabledClick:H&&(()=>H(e,p))},e)},[ce,K,G,E,j,X,ae,se,O,H,te,ne,$,J,z]),ge=(0,o.Kr)(()=>{if(t?.length)return(0,P.FD)("div",{children:[Y&&(0,P.Y)("div",{className:M.A.pickerCategoryTitle,children:X(Y)}),t?.map(e=>pe(e.type,!0)),(0,P.Y)("div",{className:M.A.pickerCategoryTitle,children:X("FilterChats")})]},"categories")},[t,Y,X,pe]);return(0,P.FD)("div",{className:(0,d.A)(M.A.container,e),children:[U&&(0,P.FD)("div",{className:(0,d.A)(M.A.header,"custom-scroll"),dir:X.isRtl?"rtl":void 0,children:[te?.map(e=>(0,P.Y)(N.A,{className:M.A.peerChip,customPeer:ce[e],onClick:de,clickArg:e,canClose:!0})),Z?.map((e,t)=>(0,P.Y)(N.A,{className:M.A.peerChip,peerId:e,isMinimized:ie&&t<ne.length-5,forceShowSelf:K,onClick:de,clickArg:e})),re.map((e,t)=>(0,P.Y)(N.A,{className:M.A.peerChip,peerId:e,isMinimized:ie&&t+(Z?.length||0)<ne.length-5,canClose:!0,onClick:de,clickArg:e})),(0,P.Y)(y.A,{id:D,ref:oe,value:x,onChange:ue,placeholder:T||X("SelectChat")})]}),he?.length?(0,P.Y)(f.A,{className:(0,d.A)(M.A.pickerList,_&&M.A.padded,"custom-scroll"),items:he,itemSelector:`.${k}`,beforeChildren:ge,onLoadMore:me,noScrollRestore:B,children:he.map(e=>pe(e))}):L||!he||he.length?(0,P.Y)(C.A,{}):(0,P.Y)("p",{className:M.A.noResults,children:F||"Sorry, nothing found."})]})})},56133:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(16581);function i(e,t,n,i=[]){return(0,o.A)(e=>{e()},i,e,t,n)}},57446:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(13439),i=n(66644),a=n(91048),s=n(19822);const r=300,c=new Map;function l(e,t,n=r){(0,a.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&&c.has(m)&&c.get(m)();const g=d+p;return new Promise(t=>{(0,i.RK)(()=>{if(0===n)return e.scrollLeft=g,void t();let o=!1;const a=Math.random().toString();e.dataset.scrollId=a,c.set(a,()=>{o=!0}),e.style.scrollSnapType="none";const r=Date.now();function l(){e.style.scrollSnapType="",delete e.dataset.scrollId,c.delete(a)}(0,s.i0)(()=>{if(o)return l(),!1;const i=Math.min((Date.now()-r)/n,1),a=p*(1-function(e){return 1-(1-e)**3.5}(i));return e.scrollLeft=Math.round(g-a),i>=1&&(l(),t()),i<1},i.RK)})})}},58968:(e,t,n)=>{n.d(t,{I5:()=>s,LS:()=>a,V2:()=>i,lw:()=>o});const o={isCustomPeer:!0,type:"premium",titleKey:"PrivacyPremium",subtitleKey:"PrivacyPremiumText",avatarIcon:"star",isAvatarSquare:!0,withPremiumGradient:!0},i=[{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}],a=[{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}},60406:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(61433),a=n(66644),s=n(37836);const r=({containerRef:e,selector:t,isBottomNotch:n,shouldHideTopNotch:r},c)=>{(0,o.Nf)(()=>{const o=e.current?.querySelectorAll(t);if(!o?.length)return;const c=(0,s.nF)(e=>{const t=e.target,o=t.scrollTop>0,{scrollHeight:s,scrollTop:c,clientHeight:l}=t,d=s-c-l<5;(0,a.RK)(()=>{r||(0,i.dH)(t,"scrolled",o),n&&(0,i.dH)(t,"scrolled-to-end",d)})},100);return o.forEach(e=>{r||(0,i.YM)(e,"with-notch"),n&&(0,i.YM)(e,"with-bottom-notch"),e.addEventListener("scroll",c,{passive:!0})}),()=>{o.forEach(e=>{e.removeEventListener("scroll",c),(0,i.HW)(e,"with-notch"),(0,i.HW)(e,"with-bottom-notch"),(0,i.HW)(e,"scrolled"),(0,i.HW)(e,"scrolled-to-end")})}},[e,t,n,r,...c]),(0,o.vJ)(()=>{const o=e.current?.querySelectorAll(t);o?.length&&o.forEach(e=>{const t=e.scrollTop>0,{scrollHeight:o,scrollTop:s,clientHeight:c}=e,l=o-s-c<5;(0,a.RK)(()=>{r||(0,i.dH)(e,"scrolled",t),n&&(0,i.dH)(e,"scrolled-to-end",l)})})},[e,t,n,r,...c])}},64489:(e,t,n)=>{n.d(t,{A:()=>m});var o=n(84051),i=n(87357),a=n(95807),s=n(37661),r=n(17712),c=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,c.A)(p),[v,f,y]=(0,s.A)(h.has(t)),C=(0,c.A)(v),[I,S]=(0,s.A)(!1),w=(0,r.A)(()=>{f(),h.add(t)}),b=(0,r.A)(()=>{g(),y(),setTimeout(S,300)}),{size:N}=e;return(0,u.FD)("div",{className:(0,i.A)(o,"xCi2f0YH"),style:(0,a.A)(void 0!==N&&`width: ${N}px; height: ${N}px;`),children:[n&&!I&&(0,u.Y)("img",{src:n,className:(0,i.A)(d,A),draggable:!1}),t&&!I&&(0,u.Y)("img",{src:t,className:(0,i.A)(d,C),draggable:!1,onLoad:w}),(0,u.Y)(l.A,{...m,onLoad:b})]})})},65632:(e,t,n)=>{n.d(t,{A:()=>c});var o=n(84051),i=n(13439),a=n(31481),s=n(74824),r=n(87679);const c=(e,t)=>{const{setThemeSettings:n}=(0,i.ko)(),[c,l]=(0,o.J0)(t);return(0,o.vJ)(()=>{t&&(t.startsWith("#")?l(t):s.fetch(a.nfi,e,s.Type.Blob).then(e=>{const t=URL.createObjectURL(e);(0,r.NN)(t).then(()=>{l(`url(${t})`)})}).catch(()=>{n({theme:e,background:void 0,backgroundColor:void 0,isBlurred:!0,patternColor:"dark"===e?a.MkD:a.be8})}))},[t,e]),t?c:void 0}},66833:(e,t,n)=>{function o(e){return"starGift"===e.type?e.sticker:e.attributes.find(e=>"model"===e.type)?.sticker}function i(e){return"starGift"===e.type?e.availabilityTotal:e.totalCount}function a(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)}function s(e,t){const n=e.filter(e=>"model"===e.type&&e.name!==t?.model.name),o=e.filter(e=>"pattern"===e.type&&e.name!==t?.pattern.name),i=e.filter(e=>"backdrop"===e.type&&e.name!==t?.backdrop.name);if(!n.length||!o.length||!i.length){const t=n.length?n:e.filter(e=>"model"===e.type),a=o.length?o:e.filter(e=>"pattern"===e.type),s=i.length?i:e.filter(e=>"backdrop"===e.type);return{model:t[Math.floor(Math.random()*t.length)],pattern:a[Math.floor(Math.random()*a.length)],backdrop:s[Math.floor(Math.random()*s.length)]}}return{model:n[Math.floor(Math.random()*n.length)],pattern:o[Math.floor(Math.random()*o.length)],backdrop:i[Math.floor(Math.random()*i.length)]}}n.d(t,{HM:()=>s,UC:()=>i,uc:()=>a,yQ:()=>o})},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,i;n.d(t,{M6:()=>c,v5:()=>l});const a={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(i&&e.target.closest(i))return;e.preventDefault()}};function r(e){a[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 c(e,t){return o=e,i=t,document.addEventListener("wheel",s,{passive:!1}),document.addEventListener("touchmove",s,{passive:!1}),document.onkeydown=r,l}function l(){o=void 0,i=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:()=>c,ic:()=>r});var o=n(84051),i=n(49763),a=n(30857);function s(e){const t=(0,a.A)();return(0,o.vJ)(()=>(0,i.Yw)(e,t),[e,t]),(0,i.YA)(e)}function r(){const e=(0,a.A)();return(0,o.vJ)(()=>(0,i.P1)(e),[e]),(0,i.PZ)()}function c(){const e=(0,a.A)();return(0,o.vJ)(()=>(0,i.BU)(e),[e]),(0,i.jn)()}function l(){const e=(0,a.A)();return(0,o.vJ)(()=>(0,i.dk)(e),[e]),(0,i.Xq)()}},76283:(e,t,n)=>{n.d(t,{A:()=>k});var o=n(84051),i=n(13439),a=n(90709),s=n(87357),r=n(17712),c=n(59030),l=n(64493),d=n(96530),u=n(36175),h=n(76023),m=n(10722),p=n(4438),g=n(87412),A=n(18276);const v="uGUjDZKl",f="M62HGuIV",y="WMpEr5XQ";var C=n(20021);const I=2*h.$,S=(0,o.ph)(({reaction:e,chosen:t,isReady:n,noAppearAnimation:i,style:a,isLocked:c,onToggleReaction:l,onSendPaidReaction:d,onShowPaidReactionModal:h})=>{const S=(0,o.li)(),w=(0,r.A)(()=>{"paid"!==e.type?l(e):d?.()}),{isContextMenuOpen:b,handleBeforeContextMenu:N,handleContextMenu:R,handleContextMenuClose:M,handleContextMenuHide:P}=(0,m.A)(S,"paid"!==e.type,void 0,void 0,void 0,!0);return(0,o.vJ)(()=>{b&&(h?.(),M(),P())},[M,h,P,b]),(0,C.FD)("div",{className:(0,s.A)(v,"oc1hpMwv",t&&"paid"!==e.type&&f,!i&&n&&"sx6RTuAU",i&&"kqcWe4tf"),ref:S,style:a,onClick:w,onMouseDown:N,onContextMenu:R,children:["paid"===e.type?(0,C.Y)(p.A,{tgsUrl:u.w.StarReaction,size:I,noLoop:!1}):(0,C.Y)(g.A,{documentId:e.documentId,size:I}),c&&(0,C.Y)(A.A,{className:y,name:"lock-badge"})]})});var w=n(37661),b=n(62587),N=n(18104);const R=2*h.$,M=(0,o.ph)(({reaction:e,isReady:t,noAppearAnimation:n,chosen:o,isLocked:i,onToggleReaction:a})=>{const r=(0,b.A)(`sticker${e.appearAnimation?.id}`,!t||n),c=(0,b.A)(`document${e.selectAnimation?.id}`,!t||n),l=(0,b.A)(`document${e.staticIcon?.id}`,!n),[d,u]=(0,w.A)(),[h,,m]=(0,w.A)(!0),[p,g,I]=(0,w.A)();return(0,C.FD)("div",{className:(0,s.A)(v,o&&f),onClick:function(){a(e.reaction)},onMouseEnter:t&&!h?g:void 0,children:[n&&(0,C.Y)("img",{className:"MZ2tH980",src:l,alt:e.reaction.emoticon,draggable:!1}),!d&&!n&&(0,C.Y)(N.A,{tgsUrl:r,play:h,noLoop:!0,size:R,onEnded:m,forceAlways:!0},e.appearAnimation?.id),!h&&!n&&(0,C.Y)(N.A,{tgsUrl:c,play:p,noLoop:!0,size:R,onLoad:u,onEnded:I,forceAlways:!0},e.selectAnimation?.id),i&&(0,C.Y)(A.A,{className:y,name:"lock-badge"})]})}),P=(0,s.x)("ReactionSelector"),k=(0,o.ph)(({allAvailableReactions:e,topReactions:t,defaultTagReactions:n,enabledReactions:u,currentReactions:h,reactionsLimit:m,isPrivate:p,isReady:g,canPlayAnimatedEmojis:A,className:v,isCurrentUserPremium:f,isInSavedMessages:y,isInStoryViewer:I,isForEffects:w,effectReactions:b,isWithPaidReaction:N,onClose:R,onToggleReaction:k,onSendPaidReaction:Y,onShowPaidReactionModal:x,onShowMore:T})=>{const{openPremiumModal:F}=(0,i.ko)(),D=(0,o.li)(),E=(0,c.A)(),L=y&&!f&&!I,B=Boolean(m&&h&&h.length>=m),U=(0,o.Kr)(()=>{const o=B?h?.map(e=>e.reaction):w?b:y?n:"some"===u?.type?u.allowed:e?.map(e=>e.reaction),i=o?.map(t=>{const n="custom"===t.type,o=e?.find(e=>(0,a.a0)(e.reaction,t));return w?o:(n||o)&&!o?.isInactive&&(p||B||u&&(0,a.A3)(t,u))?n?t:o:void 0}).filter(Boolean)||[],s=(0,a.fu)(i,t);return N&&s.unshift({type:"paid"}),s},[e,h,n,u,y,p,t,w,b,B,N]),O=(0,o.Kr)(()=>8===U.length?U:U.slice(0,7),[U]),K=O.length<U.length,G=(0,o.Kr)(()=>{const e=h?.filter(({chosenOrder:e})=>void 0!==e)||[];return new Set(e.map(({reaction:e})=>O.findIndex(t=>t&&(0,a.a0)("reaction"in t?t.reaction:t,e))))},[h,O]),j=(0,r.A)(()=>{const e=D.current?.getBoundingClientRect()||{x:0,y:0};T({x:e.x,y:e.y})}),J=(0,r.A)(()=>{R?.(),F({initialSection:"saved_tags"})}),$=(0,o.Kr)(()=>{if(y){if(!f){const e=E("lng_subscribe_tag_about").split("{link}");return(0,C.FD)("span",{children:[e[0],(0,C.Y)(d.A,{isPrimary:!0,onClick:J,children:E("lng_subscribe_tag_link")}),e[1]]})}return E("SavedTagReactionsHint2")}return I?E("StoryReactionsHint"):w?E("AddEffectMessageHint"):void 0},[f,y,I,E,w]);if(O.length)return(0,C.FD)("div",{className:(0,s.A)(P("&"),v),ref:D,children:[(0,C.Y)("div",{className:P("bubble-small",E.isRtl&&"isRtl")}),(0,C.FD)("div",{className:P("items-wrapper"),children:[(0,C.Y)("div",{className:P("bubble-big",E.isRtl&&"isRtl")}),(0,C.FD)("div",{className:P("items"),children:[$&&(0,C.Y)("div",{className:P("hint"),children:$}),(0,C.FD)("div",{className:P("reactions"),dir:E.isRtl?"rtl":void 0,children:[O.map((e,t)=>"reaction"in e?(0,C.Y)(M,{isReady:g,onToggleReaction:k,reaction:e,noAppearAnimation:!A,chosen:G.has(t),isLocked:L},(0,a.Jj)(e.reaction)):(0,C.Y)(S,{isReady:g,onToggleReaction:k,onSendPaidReaction:Y,onShowPaidReactionModal:x,reaction:e,noAppearAnimation:!A,chosen:G.has(t),isLocked:L,style:`--_animation-delay: ${20*(7-t)}ms`},(0,a.Jj)(e))),K&&(0,C.Y)(l.A,{color:"translucent",className:P("show-more"),onClick:j,iconName:"down"})]})]})]})]})})},79174:(e,t,n)=>{n.d(t,{A:()=>c});var o=n(84051),i=n(66644),a=n(96454),s=n(97822);const r=300;function c(e,t,n){(0,o.vJ)(()=>{t?!a.TF&&e.current?.isConnected&&(0,i.YS)(()=>{(0,s.A)(e.current)}):(e.current?.isConnected&&e.current.blur(),n&&setTimeout(n,r))},[e,t,n])}},79577:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(84051),i=n(23174),a=n(90709),s=n(62587),r=n(64489),c=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,a.Mw)(t,"full"),h=(0,s.A)(t?(0,a.Mw)(t,"preview"):void 0,n&&!o,i.qZ.BlobUrl),m=(0,s.A)(u,n);return(0,c.Y)(r.A,{tgsUrl:m,previewUrl:h,thumbDataUri:d,...l})})},79582:(e,t,n)=>{n.d(t,{A:()=>c});var o=n(13439),i=n(91048),a=n(87894);const s=3e9,r=3e8;function c(e,t=!1,n,c){const l=(0,o.mS)();return(0,a.My)(e,e=>{if(e===c)return 1/0;const o=(0,i.hds)(l,e);if(!o)return 0;let a=0;const d=(0,i.yHC)(l,e);return d&&(a+=d.date),t&&o.isVerified&&(a+=s),n&&n.includes(e)&&(a=Date.now()+r+(n.length-n.indexOf(e))),a},"desc")}},80539:(e,t,n)=>{n.d(t,{Ay:()=>c,g4:()=>l,qh:()=>s});var o=n(23174),i=n(31481),a=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},r=3;function c(e,t=!1,n=!1){const c=document.createElement("div");c.innerHTML=n?e:function(e){let t=e.slice(0);return t=t.replace(/&nbsp;/g," "),t=t.replace(/<div><br([^>]*)?><\/div>/g,"\n"),t=t.replace(/<br([^>]*)?>/g,"\n"),t=t.replace(/<\/div>(\s*)<div>/g,"\n"),t=t.replace(/<div>/g,"\n"),t=t.replace(/<\/div>/g,""),t=t.replace(/^`{3}(.*?)[\n\r](.*?[\n\r]?)`{3}/gms,'<pre data-language="$1">$2</pre>'),t=t.replace(/^`{3}[\n\r]?(.*?)[\n\r]?`{3}/gms,"<pre>$1</pre>"),t=t.replace(/[`]{3}([^`]+)[`]{3}/g,"<pre>$1</pre>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[`]{1}([^`\n]+)[`]{1}(?![^<]*<\/(code|pre)>)/g,"<code>$2</code>"),a.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(`\\[([^\\]]+?)]\\((${i.kNZ}+?)\\)`,"g"),(e,t,n)=>`<a href="${n.includes("://")?n:n.includes("@")?`mailto:${n}`:`https://${n}`}">${t}</a>`)}(e):e),l(c);const d=c.innerText.trim().replace(/\u200b+/g,"");let u=-c.innerText.indexOf(d[0]),h=0;const m=[];function p(e){if(e.nodeType===Node.COMMENT_NODE)return;const{index:t,entity:n}=function(e,t,n){const i=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(!i||!e.textContent)return{index:n,entity:void 0};const a=t.indexOf(e.textContent,n),r=a>=0?a:n,c=t.substring(0,r).length,{length:l}=t.substring(r,r+e.textContent.length);if(i===o.C7.TextUrl)return{index:r,entity:{type:i,offset:c,length:l,url:e.href}};if(i===o.C7.MentionName)return{index:r,entity:{type:i,offset:c,length:l,userId:e.dataset.userId}};if(i===o.C7.Pre)return{index:r,entity:{type:i,offset:c,length:l,language:e.dataset.language}};if(i===o.C7.CustomEmoji)return{index:r,entity:{type:i,offset:c,length:l,documentId:e.dataset.documentId}};if(i===o.C7.Timestamp){const t=Number(e.dataset.timestamp);return Number.isNaN(t)?{index:r,entity:void 0}:{index:r,entity:{type:i,offset:c,length:l,timestamp:t}}}return{index:r,entity:{type:i,offset:c,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<=r&&(h+=1,Array.from(e.childNodes).forEach(p))}return Array.from(c.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:()=>a});var o=n(31481);const i=1;function a(){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 a=Array.from(t.children).reduce((e,t)=>t.nodeType===i&&t.classList.contains("message-date-group")?Array.from(t.querySelectorAll(".Message")).reduce((e,t)=>e.concat(Number(t.dataset.messageId)),e):t.nodeType===i&&t.classList.contains("Message")?e.concat(Number(t.dataset.messageId)):e,[]);for(;t.firstChild;)t.removeChild(t.firstChild);return t=void 0,n||a.pop(),a}function s(e,t){return!(e.nodeType!==i||!e.classList.contains(t))||!!e.parentNode&&s(e.parentNode,t)}},81949:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(87357);var i=n(20021);const a=({children:e,className:t,onClick:n,onMouseDown:a})=>(0,i.Y)("div",{className:(0,o.A)("hJUqHi4B",n&&"hjDEmFaT",t),onClick:n,onMouseDown:a,children:e})},81954:(e,t,n)=>{n.d(t,{Ay:()=>A,H$:()=>C,_v:()=>v,o8:()=>y});var o=n(61433),i=n(84051),a=n(13439),s=n(89925),r=n(31481),c=n(66644),l=n(91048),d=n(96454),u=n(16460),h=n(19822);let m,p,g=!1;function A(e){m=e;const t=f(e);if(e.shouldReturnMutationFn)return t;(0,c.RK)(t)}function v(){g&&((0,h.vk)(),(0,c.YS)(()=>{(0,c.RK)(f(m))}))}function f(e){const{container:t,element:n,position:A,margin:v=0,maxDistance:f=r.nxZ,forceDirection:y,forceNormalContainerHeight:C}=e;let w=e.forceDuration;y!==s.CC.Static&&(0,l.PKK)((0,a.mS)())||(w=0);const{offsetHeight:b}=n,{scrollTop:N,clientHeight:R,scrollHeight:M}=t,P=(0,u.A)(n,t).top,k=C&&t.dataset.normalHeight?Number(t.dataset.normalHeight):R;let Y;switch(A){case"start":Y=P-v+(d.Ni?1:0);break;case"end":Y=P+b+v-k;break;case"nearest":case"center":case"centerOrTop":Y=b<k?P+b/2-k/2:P-v}const x=function(e,t,n=r.nxZ,o){const{scrollTop:i}=e;if(void 0===o){const e=t-i;if(e<-n)return i+(e+n);if(e>n)return i+(e-n)}else{if(o===s.CC.Up)return t+n;if(o===s.CC.Down)return Math.max(0,t-n)}return i}(t,Y,f,y);let T=Y-x;if(T<0){const e=-x;T=Math.max(T,e)}else if(T>0){const e=M-(x+k);T=Math.min(T,e)}const F=Math.abs(T);return()=>{if(F<1)return void(N!==x&&(t.scrollTop=x));const e=x+T;if(0===w)return void(t.scrollTop=e);const n=F<=r.s8T?I:S,a=w||r.SKD+F/r.nxZ*(r.OzO-r.SKD),s=Date.now();g=!0,(0,o.Tv)(t,{scrollSnapType:"none"});const l=p;p=(0,i.VK)(void 0,!0),l?.(),(0,h.S0)(()=>{const i=Math.min((Date.now()-s)/a,1),r=T*(1-n(i)),c=Math.round(e-r);return t.scrollTop=c,g=i<1&&c!==e,g||(m=void 0,(0,o.Tv)(t,{scrollSnapType:""}),p?.(),p=void 0),g},c.RK)}}function y(){return g}function C(){m?.container&&(0,o.Tv)(m.container,{scrollSnapType:""}),p?.(),p=void 0}function I(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),i=n(90709),a=n(96454),s=n(87357),r=n(95807),c=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,i.aL)(e.documentId,!0),g=(0,c.A)(t?void 0:p),A=(0,o.Kr)(()=>a.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,r.A)(Boolean(h)&&`--particle-size: ${h}px`),children:A.map((n,o)=>{const i=`--offset-path: path('${n}');`;return t?(0,u.Y)(l.A,{documentId:e.documentId,className:d,style:i,withSharedAnimation:!0,size:h,onAnimationEnd:0===o?m:void 0}):(0,u.Y)("img",{src:g,alt:"",className:d,style:i,draggable:!1,onAnimationEnd:0===o?m:void 0})})})})},87049:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(84051),i=n(13439),a=n(91048),s=n(87357),r=n(14745);const c={root:"AmQSvxpZ",text:"pQW7dcwr"};var l=n(20021);const d={red:[["#FF5B54","#ED1C26"],["#653633","#532224"]],blue:[["#6ED2FF","#34A4FC"],["#344F5A","#152E42"]],purple:[["#E367D7","#757BF6"],["#E367D7","#757BF6"]],green:[["#52D553","#4BB121"],["#52D553","#4BB121"]],orange:[["#D48F23","#BE7E15"],["#D48F23","#BE7E15"]]},u=new Set(Object.keys(d)),h=(0,o.ph)((0,i.EK)(e=>({theme:(0,a.SJA)(e)}))(({text:e,color:t,className:n,theme:o})=>{const i=`svg-${(0,r.A)()}`,a=u.has(t)?t:void 0,h="dark"===o,m=Array.isArray(t)?t:a?d[a][h?1:0]:void 0,p=m?m[0]:t,g=m?m[1]:t;return(0,l.FD)("div",{className:(0,s.A)(c.root,n),children:[(0,l.FD)("svg",{className:c.ribbon,width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",children:[(0,l.Y)("path",{d:"M52.4851 26.4853L29.5145 3.51472C27.2641 1.26428 24.2119 0 21.0293 0H2.82824C1.04643 0 0.154103 2.15429 1.41403 3.41422L52.5856 54.5858C53.8455 55.8457 55.9998 54.9534 55.9998 53.1716V34.9706C55.9998 31.788 54.7355 28.7357 52.4851 26.4853Z",fill:`url(#${i})`}),(0,l.Y)("defs",{children:(0,l.FD)("linearGradient",{id:i,x1:"27.9998",y1:"1",x2:"27.9998",y2:"55",gradientUnits:"userSpaceOnUse",children:[(0,l.Y)("stop",{"stop-color":p}),(0,l.Y)("stop",{offset:"1","stop-color":g})]})})]}),(0,l.Y)("div",{className:c.text,children:e})]})}))},92108:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(84051),i=n(87357);var a=n(20021);const s=(0,o.ph)(({data:e,style:t,className:n,valueClassName:o,keyClassName:s})=>(0,a.Y)("div",{className:(0,i.A)("cKr8J5k_",n),style:t,children:e.map(([e,t])=>(0,a.FD)(a.FK,{children:[(0,a.Y)("div",{className:(0,i.A)("c9RLLvfs",s),children:e}),(0,a.Y)("div",{className:(0,i.A)("QEuGpzIc",o),children:t})]}))}))},92915:(e,t,n)=>{n.d(t,{A:()=>I});var o=n(84051),i=n(13439),a=n(87357),s=n(76023),r=n(10722),c=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:i,submitText:a,maxLength:s,initialValue:r="",onClose:c,onSubmit:u})=>{const A=(0,d.A)(),[v,f]=(0,o.J0)(r),y=(0,l.A)(e=>{f(e.target.value)}),C=(0,l.A)(()=>{u(v)});return(0,g.FD)(p.A,{className:"narrow",title:t,isOpen:e,onClose:c,isSlim:!0,children:[Boolean(n)&&(0,g.Y)("div",{className:"cGrbcqD_",children:n}),(0,g.Y)(m.A,{placeholder:i,value:v,onChange:y,maxLength:s,teactExperimentControlled:!0}),(0,g.FD)("div",{className:"dialog-buttons mt-2",children:[(0,g.Y)(h.A,{className:"confirm-dialog-button",onClick:C,children:a||A("Save")}),(0,g.Y)(h.A,{className:"confirm-dialog-button",isText:!0,onClick:c,children:A("Cancel")})]})]})});var v=n(71429),f=n(24433),y=n(69988);const C=1.25*s.$,I=(0,o.ph)(({reaction:e,tag:t,containerId:n,isChosen:s,isOwnMessage:m,className:p,chosenClassName:I,withCount:S,isDisabled:w,withContextMenu:b,observeIntersection:N,onClick:R,onRemove:M})=>{const{editSavedReactionTag:P}=(0,i.ko)(),k=(0,o.li)(),Y=(0,o.li)(),x=(0,d.A)(),[T,F,D]=(0,c.A)(),{title:E,count:L}=t||{},B=Boolean(E||S&&L),U=(0,l.A)(()=>{R?.(e)}),O=(0,l.A)(()=>{M?.(e)}),K=(0,l.A)(t=>{P({reaction:e,title:t}),D()}),{isContextMenuOpen:G,contextMenuAnchor:j,handleBeforeContextMenu:J,handleContextMenu:$,handleContextMenuClose:z,handleContextMenuHide:_}=(0,r.A)(k,!b,void 0,void 0,void 0,!0),V=(0,l.A)(()=>k.current),H=(0,l.A)(()=>document.body),q=(0,l.A)(()=>Y.current),W=(0,l.A)(()=>({withPortal:!0,shouldAvoidNegativePosition:!0}));if(!S||0!==L)return(0,g.FD)(h.A,{className:(0,a.A)(y.A.root,y.A.tag,m&&y.A.own,s&&y.A.chosen,s&&I,w&&y.A.disabled,p),size:"tiny",onClick:U,onMouseDown:J,onContextMenu:$,ref:k,children:[(0,g.Y)(u.A,{className:y.A.animatedEmoji,containerId:n,reaction:e,loopLimit:1,size:C,observeIntersection:N}),B&&(0,g.FD)("span",{className:y.A.tagText,children:[E&&(0,g.Y)("span",{children:E}),S&&(0,g.Y)("span",{children:L})]}),(0,g.Y)("svg",{className:y.A.tail,width:"15",height:"30",viewBox:"0 0 15 30",children:(0,g.Y)("path",{className:y.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"})}),b&&(0,g.Y)(A,{isOpen:T,maxLength:15,title:x(t?.title?"SavedTagRenameTag":"SavedTagLabelTag"),subtitle:x("SavedTagLabelTagText"),placeholder:x("SavedTagLabelPlaceholder"),initialValue:t?.title,onClose:D,onSubmit:K}),b&&j&&(0,g.FD)(v.A,{ref:Y,isOpen:G,anchor:j,getTriggerElement:V,getRootElement:H,getMenuElement:q,getLayout:W,autoClose:!0,withPortal:!0,onClose:z,onCloseAnimationEnd:_,children:[(0,g.Y)(f.A,{icon:"tag-filter",onClick:U,children:x("SavedTagFilterByTag")}),(0,g.Y)(f.A,{icon:"tag-name",onClick:F,children:x(t?.title?"SavedTagRenameTag":"SavedTagLabelTag")}),(0,g.Y)(f.A,{icon:"tag-crossed",destructive:!0,onClick:O,children:x("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"}},97822:(e,t,n)=>{function o(e){e&&e.focus({preventScroll:!0})}n.d(t,{A:()=>o})},99515:(e,t,n)=>{n.d(t,{A:()=>ee});var o=n(84051),i=n(13439),a=n(23174),s=n(31481),r=n(90709),c=n(91048),l=n(56494),d=n(87357),u=n(85982),h=n(48899),m=n(80539);const p=document.createElement("div"),g=new Set([a.C7.Bold,a.C7.Italic,a.C7.Underline,a.C7.Strike,a.C7.Spoiler,a.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(/&nbsp;/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 v=n(37661),f=n(39351),y=n(17712),C=n(59030),I=n(24531),S=n(34201),w=n(80089),b=n(80464),N=n(20021);const R=e=>{const{isOpen:t}=e,n=(0,b.A)(w.ar.Extra,"PinMessageModal",!t);return n?(0,N.Y)(n,{...e}):void 0};var M=n(94189),P=n(73104),k=n(76023),Y=n(4961),x=n(3544),T=n(96454),F=n(81686),D=n(43044),E=n(58554),L=n(49086);function B(e){return e?"lng_context_copy_selected":"lng_context_copy_text"}var U=n(43874),O=n(26875),K=n(71429),G=n(24433),j=n(60859),J=n(55158),$=n(17663);const z="C3LVl_JT",_="cd1ZZeSy",V=(0,o.ph)(function({message:e}){const t=(0,C.A)(),{editDate:n}=e,o=!n;return(0,N.Y)(G.A,{icon:"clock-edit",className:z,children:o?(0,N.Y)(J.A,{className:_}):Boolean(n)&&t("Chat.PrivateMessageEditTimestamp.Date",(0,$.U)(t,1e3*n))})});var H=n(76283),q=n(41036);const W=(0,o.ph)(function({message:e,shouldRenderShowWhen:t,canLoadReadDate:n,closeContextMenu:o}){const{openPrivacySettingsNoticeModal:a}=(0,i.ko)(),s=(0,C.A)(),{readDate:r}=e,c=n&&!r&&!t;return(0,N.Y)(G.A,{icon:"message-read",className:z,children:(0,N.Y)(q.Ay,{name:"fade",activeKey:c?1:2,className:"mg4sBQ9n",children:c?(0,N.Y)(J.A,{className:_}):(0,N.FD)(N.FK,{children:[Boolean(r)&&s("PmReadAt",(0,$.U)(s,1e3*r)),!r&&t&&(0,N.FD)("div",{children:[s("PmRead"),(0,N.Y)("span",{className:"bmxij_dk",onClick:()=>{o(),a({chatId:e.chatId,isReadDate:!0})},children:s("PmReadShowWhen")})]})]})})})}),X=(0,o.ph)(({isReactionPickerOpen:e,availableReactions:t,topReactions:n,defaultTagReactions:s,isOpen:c,message:l,poll:m,webPage:p,story:g,isPrivate:A,isCurrentUserPremium:I,enabledReactions:S,isWithPaidReaction:w,reactionsLimit:b,anchor:R,targetHref:M,canSendNow:$,canReschedule:z,canBuyPremium:_,canReply:q,canQuote:X,canEdit:Q,canAppendTodoList:Z,noReplies:ee,canPin:te,canUnpin:ne,canDelete:oe,canForward:ie,canReport:ae,canFaveSticker:se,canUnfaveSticker:re,canCopy:ce,canCopyLink:le,canSelect:de,canDownload:ue,canSaveGif:he,canRevote:me,canClosePoll:pe,canTranslate:ge,canShowOriginal:Ae,canSelectLanguage:ve,isDownloading:fe,repliesThreadInfo:ye,canShowSeenBy:Ce,canShowReactionsCount:Ie,canShowReactionList:Se,seenByRecentPeers:we,hasCustomEmoji:be,customEmojiSets:Ne,canPlayAnimatedEmojis:Re,isInSavedMessages:Me,shouldRenderShowWhen:Pe,canLoadReadDate:ke,onReply:Ye,onOpenThread:xe,onEdit:Te,onAppendTodoList:Fe,onPin:De,onUnpin:Ee,onForward:Le,onDelete:Be,onFaveSticker:Ue,onReport:Oe,onUnfaveSticker:Ke,onSelect:Ge,onSend:je,onReschedule:Je,onClose:$e,onCloseAnimationEnd:ze,onCopyLink:_e,onCopyNumber:Ve,onDownload:He,onSaveGif:qe,onCancelVote:We,onClosePoll:Xe,onShowSeenBy:Qe,onShowReactors:Ze,onToggleReaction:et,onSendPaidReaction:tt,onShowPaidReactionModal:nt,onCopyMessages:ot,onReactionPickerOpen:it,onTranslate:at,onShowOriginal:st,onSelectLanguage:rt,userFullName:ct,canGift:lt})=>{const{showNotification:dt,openStickerSet:ut,openCustomEmojiSets:ht,loadStickers:mt,openGiftModal:pt}=(0,i.ko)(),gt=(0,o.li)(),At=(0,o.li)(),vt=(0,C.A)(),ft=(0,f.A)(),yt=!A&&!S,Ct=l.areReactionsPossible,It=Se&&!yt||Ct,St="isEdited"in l&&l.isEdited,wt=l.seenByDates,bt="giftPremium"===l.content.action?.type,Nt="giftCode"===l.content.action?.type,Rt="starGift"===l.content.action?.type,Mt="starGiftUnique"===l.content.action?.type,Pt=(0,h.L8)(l.chatId)&&lt&&(bt||Nt||Rt||Mt),[kt,Yt,xt]=(0,v.A)(),{isMobile:Tt}=(0,U.Ay)(),Ft=(0,o.Kr)(()=>wt?Object.keys(wt).length:0,[wt]),Dt=(0,y.A)(()=>{dt({message:vt("Share.Link.Copied")}),$e()}),Et=(0,y.A)(()=>{pt({forUserId:l.chatId}),$e()});(0,o.vJ)(()=>{Ne?.length&&Ne.map(e=>mt({stickerSetInfo:{id:e.id,accessHash:e.accessHash}}))},[Ne,ht]);const Lt=(0,y.A)(()=>{Ne&&(1===Ne.length?ut({stickerSetInfo:{shortName:Ne[0].shortName}}):ht({setIds:Ne.map(e=>e.id)}),$e())}),Bt=function(e,t,n,o,i,s,c,l){const{webPage:d}=t||{},h=[],m=(0,r.P5)(e),p=(0,r.yl)(e)||((0,r.rU)(d)?void 0:(0,r.eY)(d)),g=(0,r.Qm)(e),A=p?(0,r.rI)(p,"full"):void 0,v=o&&p&&(A||(0,r.KG)(p))&&u.WO&&!T.Yw,f=window.getSelection();if(v&&h.push({label:"lng_context_copy_image",icon:"copy-media",handler:()=>{Promise.resolve(A?E.hd(A,a.qZ.BlobUrl):p.blobUrl).then(u.qp),i?.()}}),o&&n)h.push({label:"lng_context_copy_link",icon:"copy",handler:()=>{(0,u.eM)(n),i?.()}});else if(o&&m){const n=Boolean(f?.anchorNode?.parentNode&&f.anchorNode.parentNode.closest(".Message .content-inner")&&""!==f.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,r.GZ)(e.id)===o?.id}(e));h.push({label:B(n),icon:"copy",handler:()=>{const o=(0,F.A)();if(o?.length&&c)c(o);else if(n)document.execCommand("copy");else{const n=(0,L.V)({message:e,shouldRenderAsHtml:!0});n&&(0,u.A)(n.join(""),(0,x.Gn)((0,D.Yw)(),e,t))}i?.()}})}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(),i?.()}}),h}(l,(0,r.FE)({poll:m,webPage:p,story:g}),M,ce,Dt,le?_e:void 0,ot,Ve),Ut=(0,y.A)(()=>document.querySelector(".Transition_slide-active > .MessageList")),Ot=(0,y.A)(()=>document.body),Kt=(0,y.A)(()=>document.querySelector(".MessageContextMenu .bubble")),Gt=(0,y.A)(()=>({extraPaddingX:10,extraTopPadding:document.querySelector(".MiddleHeader").offsetHeight,shouldAvoidNegativePosition:!0,menuElMinWidth:It&&Tt?19.25*k.$:void 0,withPortal:!0}));(0,o.vJ)(()=>{c?setTimeout(()=>{Yt()},200):xt()},[c,Yt,xt]),(0,o.vJ)(()=>(0,P.M6)(At.current,".ReactionPicker"),[c]);const jt=(0,y.A)(e=>{it(e),$e()});return(0,N.FD)(K.A,{ref:gt,isOpen:c,anchor:R,getTriggerElement:Ut,getRootElement:Ot,getMenuElement:Kt,getLayout:Gt,withMaxHeight:!0,className:(0,d.A)("MessageContextMenu","fluid",It&&"with-reactions"),withPortal:!0,onClose:$e,onCloseAnimationEnd:ze,children:[It&&(0,N.Y)(H.A,{enabledReactions:S,topReactions:n,allAvailableReactions:t,defaultTagReactions:s,currentReactions:l.reactions?.results,reactionsLimit:b,onToggleReaction:et,onSendPaidReaction:tt,onShowPaidReactionModal:nt,isWithPaidReaction:w,isPrivate:A,isReady:kt,canBuyPremium:_,isCurrentUserPremium:I,isInSavedMessages:Me,canPlayAnimatedEmojis:Re,onShowMore:jt,onClose:$e}),(0,N.FD)("div",{ref:At,className:(0,d.A)("MessageContextMenu_items scrollable-content custom-scroll"),dir:ft.isRtl?"rtl":void 0,children:[Pt&&(0,N.Y)(G.A,{icon:"gift",onClick:Et,children:l?.isOutgoing?vt("SendAnotherGift"):vt("Conversation.ContextMenuSendGiftTo",ct)}),$&&(0,N.Y)(G.A,{icon:"send-outline",onClick:je,children:vt("MessageScheduleSend")}),z&&(0,N.Y)(G.A,{icon:"schedule",onClick:Je,children:vt("MessageScheduleEditTime")}),q&&(0,N.Y)(G.A,{icon:"reply",onClick:Ye,children:vt(X?"lng_context_quote_and_reply":"Reply")}),!ee&&Boolean(ye?.messagesCount)&&(0,N.Y)(G.A,{icon:"replies",onClick:xe,children:vt("Conversation.ContextViewReplies",ye.messagesCount,"i")}),Q&&(0,N.Y)(G.A,{icon:"edit",onClick:Te,children:vt("Edit")}),Z&&(0,N.Y)(G.A,{icon:"add",onClick:Fe,children:ft("MenuButtonAppendTodoList")}),se&&(0,N.Y)(G.A,{icon:"favorite",onClick:Ue,children:vt("AddToFavorites")}),re&&(0,N.Y)(G.A,{icon:"favorite",onClick:Ke,children:vt("Stickers.RemoveFromFavorites")}),ge&&(0,N.Y)(G.A,{icon:"language",onClick:at,children:vt("TranslateMessage")}),Ae&&(0,N.Y)(G.A,{icon:"language",onClick:st,children:vt("ShowOriginalButton")}),ve&&(0,N.Y)(G.A,{icon:"web",onClick:rt,children:vt("lng_settings_change_lang")}),Bt.map(e=>(0,N.Y)(G.A,{icon:e.icon,onClick:e.handler,withPreventDefaultOnMouseDown:!0,children:vt(e.label)},e.label)),te&&(0,N.Y)(G.A,{icon:"pin",onClick:De,children:vt("DialogPin")}),ne&&(0,N.Y)(G.A,{icon:"unpin",onClick:Ee,children:vt("DialogUnpin")}),he&&(0,N.Y)(G.A,{icon:"gifs",onClick:qe,children:vt("lng_context_save_gif")}),me&&(0,N.Y)(G.A,{icon:"revote",onClick:We,children:vt("lng_polls_retract")}),pe&&(0,N.Y)(G.A,{icon:"stop",onClick:Xe,children:vt("lng_polls_stop")}),ue&&(0,N.Y)(G.A,{icon:"download",onClick:He,children:vt(fe?"lng_context_cancel_download":"lng_media_download")}),ie&&(0,N.Y)(G.A,{icon:"forward",onClick:Le,children:vt("Forward")}),de&&(0,N.Y)(G.A,{icon:"select",onClick:Ge,children:vt("Common.Select")}),ae&&(0,N.Y)(G.A,{icon:"flag",onClick:Oe,children:vt("lng_context_report_msg")}),oe&&(0,N.Y)(G.A,{destructive:!0,icon:"delete",onClick:Be,children:vt("Delete")}),be&&(0,N.FD)(N.FK,{children:[(0,N.Y)(j.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)(G.A,{withWrap:!0,onClick:Lt,className:"menu-custom-emoji-sets",children:(0,Y.A)(vt("MessageContainsEmojiPack",Ne[0].title),["simple_markdown","emoji"])}),Ne&&Ne.length>1&&(0,N.Y)(G.A,{withWrap:!0,onClick:Lt,className:"menu-custom-emoji-sets",children:(0,Y.A)(vt("MessageContainsEmojiPacks",Ne.length),["simple_markdown"])})]}),(Ce||Ie)&&(0,N.FD)(N.FK,{children:[(0,N.Y)(j.A,{size:be?"thin":"thick"}),(0,N.FD)(G.A,{icon:Ie?"heart-outline":"group",onClick:Ie?Ze:Qe,disabled:!Ie&&!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:Ie&&l.reactors?.count?Ce&&Ft?vt("Chat.OutgoingContextMixedReactionCount",[l.reactors.count,Ft]):vt("Chat.ContextReactionCount",l.reactors.count,"i"):1===Ft&&we?(0,Y.A)((0,h.L8)(we[0].id)?(0,r.Yg)(we[0]):we[0].title):Ft?vt("Conversation.ContextMenuSeen",Ft,"i"):vt("Conversation.ContextMenuNoViews")})}),(0,N.Y)(O.A,{className:"avatars",size:"micro",peers:we})]})]}),(ke||Pe||St)&&(0,N.Y)(j.A,{size:be?"thin":"thick"}),(ke||Pe)&&(0,N.Y)(W,{canLoadReadDate:ke,shouldRenderShowWhen:Pe,message:l,closeContextMenu:$e}),St&&(0,N.Y)(V,{message:l})]})]})}),Q=window.getSelection(),Z=-1,ee=(0,o.ph)((0,i.EK)((e,{message:t,messageListType:n,detectedLanguage:o})=>{const{threadId:i}=(0,c.Xf0)(e)||{},{defaultTags:a,topReactions:l,availableReactions:d}=e.reactions,u=(0,c.yuw)(e),m=(0,c.hds)(e,t.chatId),p=m&&(0,h.L8)(m.id),g=p?void 0:(0,c.AWZ)(e,t.chatId),A=(0,c.mBe)(e,t.chatId),v=A&&(0,r.Yg)(A),{seenByExpiresAt:f,seenByMaxChatMembers:y,maxUniqueReactions:C,readDateExpiresAt:I}=e.appConfig,S=g?.reactionsLimit||C,{noOptions:w,canReplyGlobally:b,canPin:N,canUnpin:R,canDelete:M,canReport:P,canEdit:k,canFaveSticker:Y,canUnfaveSticker:x,canCopy:T,canCopyLink:F,canSelect:D,canDownload:E,canSaveGif:L,canRevote:B,canClosePoll:U}=i&&(0,c.WAX)(e,t,i)||{},O=(0,c.R4s)(e,t),K=p?(0,c.K0y)(e,m.id):void 0,G=(0,r.Ie)(t),j=m&&(0,c.yps)(e,m.id),J=Boolean(j),$=(0,c.Jbz)(e,t),z=Boolean(p&&G&&!J&&!$&&I&&t.date>Date.now()/1e3-I&&!K?.isReadDateRestricted&&"scheduled"!==n),_=Boolean(z&&p&&(0,c.K0y)(e,m.id)?.isReadDateRestrictedByMe),V="pinned"===n,H="scheduled"===n,q=m&&(0,r.WX)(m),W=i&&(0,c.Vw0)(e,t.chatId,i),X=Boolean(W&&!W?.isCommentsInfo&&W?.fromChannelId),Q=i?(0,c.S0q)(e,t.chatId,i):void 0,Z=m&&!(0,r.Sq)(m,"sendPlain",g),ee=!(!m||!i)&&(0,r.__)(m,Q,X,g)&&Z,te=(0,r.Nb)(t),ne=(0,r.G5)(t),oe=Boolean(!te&&m&&!m.isMonoforum&&!$&&y&&f&&(0,r.YE)(m)&&G&&!H&&m.membersCount&&m.membersCount<=y&&t.date>Date.now()/1e3-f),ie=(0,r._P)(t),ae=!te&&!q&&!H&&!ie&&!p&&t.reactions&&!(0,r.G)(t.reactions)&&t.reactions.canSeeList,se=(0,c.ynf)(e,t),re=Boolean(t.content.contact),ce=(0,c.g29)(e),le=(0,c.S1W)(e,t),de=le?.map(t=>(0,c.ycM)(e,t)),ue=de?.every(Boolean)?de:void 0,he=(0,c.Rny)(e,t.chatId,t.id),me=he?Boolean((0,c.a_$)(e,t.chatId,he)[t.id]?.text):void 0,pe=!me&&(0,c.S86)(e,t,o),ge=(0,c.qZq)(e,t.chatId),Ae=(0,c.nZ4)(e,t.chatId),ve=(0,c.zcZ)(e,t),fe=(0,c.Pn$)(e,t),ye=t.content.storyData,Ce=ye?(0,c.Msb)(e,ye.peerId,ye.id):void 0,Ie=(0,c.X2D)(e,t.chatId),Se=(0,c.QP5)(e,t),we=e.appConfig.todoItemsMax;return{threadId:i,chat:m,availableReactions:d,topReactions:l,defaultTagReactions:a,noOptions:w,canReport:P,canSendNow:H,canReschedule:H,canReply:!V&&!H&&b,canPin:!H&&N,canUnpin:!H&&R,canDelete:M,canEdit:!V&&k,canAppendTodoList:t.content.todo?.todo.othersCanAppend&&t.content.todo?.todo.items?.length<we,canForward:!H&&O,canFaveSticker:!H&&Y,canUnfaveSticker:!H&&x,canCopy:re||!se&&T,canCopyLink:!H&&F,canSelect:D,canDownload:!se&&E,canSaveGif:!se&&L,canRevote:B,canClosePoll:!H&&U,activeDownloads:u,canShowSeenBy:oe,canLoadReadDate:z,shouldRenderShowWhen:_,enabledReactions:m?.isForbidden?void 0:g?.enabledReactions,reactionsLimit:S,isPrivate:p,isCurrentUserPremium:ce,hasFullInfo:Boolean(g),canShowReactionsCount:ae,canShowReactionList:!(te||ie||H||m?.id===s.zv8||ne),canBuyPremium:!ce&&!(0,c.n_C)(e),customEmojiSetsInfo:le,customEmojiSets:ue,canScheduleUntilOnline:(0,c.RBq)(e,t.chatId),canTranslate:pe,canShowOriginal:me&&!ge,canSelectLanguage:me&&!ge,isMessageTranslated:me,canPlayAnimatedEmojis:(0,c.BWX)(e),isReactionPickerOpen:(0,c.Ani)(e),isInSavedMessages:Ae,isChannel:q,canReplyInChat:ee,isWithPaidReaction:g?.isPaidReactionAvailable,poll:ve,story:Ce,userFullName:v,canGift:Ie,savedDialogId:Se,webPage:fe}})(({threadId:e,availableReactions:t,topReactions:n,defaultTagReactions:c,isOpen:h,messageListType:m,message:p,customEmojiSetsInfo:g,customEmojiSets:w,album:b,poll:P,webPage:k,story:Y,anchor:x,targetHref:T,noOptions:F,canSendNow:D,hasFullInfo:E,canReschedule:L,canReply:B,canPin:U,repliesThreadInfo:O,canUnpin:K,canDelete:G,canShowReactionsCount:j,chat:J,canReport:$,canShowReactionList:z,canEdit:_,canAppendTodoList:V,enabledReactions:H,reactionsLimit:q,isPrivate:W,isCurrentUserPremium:ee,canForward:te,canBuyPremium:ne,canFaveSticker:oe,canUnfaveSticker:ie,canCopy:ae,canCopyLink:se,canSelect:re,canDownload:ce,canSaveGif:le,canRevote:de,canClosePoll:ue,canPlayAnimatedEmojis:he,canLoadReadDate:me,shouldRenderShowWhen:pe,activeDownloads:ge,noReplies:Ae,canShowSeenBy:ve,canScheduleUntilOnline:fe,canTranslate:ye,isMessageTranslated:Ce,canShowOriginal:Ie,canSelectLanguage:Se,isReactionPickerOpen:we,isInSavedMessages:be,canReplyInChat:Ne,isWithPaidReaction:Re,userFullName:Me,canGift:Pe,className:ke,savedDialogId:Ye,onClose:xe,onCloseAnimationEnd:Te})=>{const{openThread:Fe,updateDraftReplyInfo:De,setEditingId:Ee,pinMessage:Le,openForwardMenu:Be,openReplyMenu:Ue,faveSticker:Oe,unfaveSticker:Ke,toggleMessageSelection:Ge,sendScheduledMessages:je,rescheduleMessage:Je,downloadMedia:$e,cancelMediaDownload:ze,loadSeenBy:_e,openSeenByModal:Ve,openReactorListModal:He,loadFullChat:qe,loadReactors:We,copyMessagesByIds:Xe,saveGif:Qe,loadStickers:Ze,cancelPollVote:et,closePoll:tt,toggleReaction:nt,requestMessageTranslation:ot,showOriginalMessage:it,openChatLanguageModal:at,openMessageReactionPicker:st,openPremiumModal:rt,loadOutboxReadDate:ct,copyMessageLink:lt,openDeleteMessageModal:dt,addLocalPaidReaction:ut,openPaidReactionModal:ht,reportMessages:mt,openTodoListModal:pt,showNotification:gt}=(0,i.ko)(),At=(0,C.A)(),vt=(0,f.A)(),{ref:ft}=(0,S.A)({isOpen:h,onCloseAnimationEnd:Te,className:!1}),[yt,Ct]=(0,o.J0)(!0),[It,St]=(0,o.J0)(!1),[wt,bt,Nt]=(0,v.A)(),[Rt,Mt]=(0,o.J0)(Z),[Pt,kt]=(0,I.A)(fe,xe,p.date,p.scheduleRepeatPeriod),Yt=void 0===g||Boolean(g.length);(0,o.vJ)(()=>{ve&&h&&_e({chatId:p.chatId,messageId:p.id})},[_e,h,p.chatId,p.id,ve]),(0,o.vJ)(()=>{me&&h&&ct({chatId:p.chatId,messageId:p.id})},[me,h,p.chatId,p.id,p.readDate]),(0,o.vJ)(()=>{j&&h&&We({chatId:p.chatId,messageId:p.id})},[j,h,We,p.chatId,p.id]),(0,o.vJ)(()=>{g?.length&&w?.length!==g.length&&g.forEach(e=>{Ze({stickerSetInfo:e})})},[g,w,Ze]),(0,o.vJ)(()=>{E||W||!h||qe({chatId:p.chatId})},[E,h,W,qe,p.chatId]);const xt=(0,o.Kr)(()=>{const e=(0,i.mS)().chats.byId,t=(0,i.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,i.mS)();if(b)return b.messages.some(t=>{const n=(0,l.iS)(e,t);return!!n&&(0,r.$r)(ge,n)});const t=(0,l.iS)(e,p);return!!t&&(0,r.$r)(ge,t)},[ge,b,p]),Ft=B&&Q?.rangeCount?Q.getRangeAt(0):void 0;(0,o.vJ)(()=>{if(Ce)return void Mt(Z);if(!Ft||Ft.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")))}(Ft))return void Mt(Z);const e=A(Ft),t=p.content.text.text.replace(/\u00A0/g," ");e.text.trim().length>0&&t.includes(e.text)?Mt(Ft.startOffset):Mt(Z)},[Ft,Ft?.collapsed,Ft?.startOffset,Ft?.endOffset,Ce,p.content.text]);const Dt=(0,y.A)(()=>{Ct(!1),xe()}),Et=(0,y.A)(()=>{Ct(!1),Dt();const e=b?.messages?b.messages.map(({id:e})=>e):[p.id];dt({chatId:p.chatId,messageIds:e,isSchedule:"scheduled"===m})}),Lt=(0,y.A)(()=>{St(!1),xe()}),Bt=(0,y.A)(()=>{const e=Rt!==Z&&Ft?A(Ft):void 0;Ne?De({replyToMsgId:p.id,quoteText:e,quoteOffset:Rt,monoforumPeerId:Ye,replyToPeerId:void 0}):Ue({fromChatId:p.chatId,messageId:p.id,quoteText:e,quoteOffset:Rt}),Dt()}),Ut=(0,y.A)(()=>{Fe({chatId:p.chatId,threadId:p.id}),Dt()}),Ot=(0,y.A)(()=>{p.content.todo?pt({chatId:p.chatId,messageId:p.id}):Ee({messageId:p.id}),Dt()}),Kt=(0,y.A)(()=>{ee?pt({chatId:p.chatId,messageId:p.id,forNewTask:!0}):gt({message:vt("SubscribeToTelegramPremiumForAppendToDo"),action:{action:"openPremiumModal",payload:{initialSection:"todo"}},actionText:At("PremiumMore")}),Dt()}),Gt=(0,y.A)(()=>{Ct(!1),St(!0)}),jt=(0,y.A)(()=>{Le({chatId:p.chatId,messageId:p.id,isUnpin:!0}),Dt()}),Jt=(0,y.A)(()=>{if(Dt(),b?.messages){const e=b.messages.map(({id:e})=>e);Be({fromChatId:p.chatId,messageIds:e})}else Be({fromChatId:p.chatId,messageIds:[p.id]})}),$t=(0,y.A)(()=>{Dt(),Oe({sticker:p.content.sticker})}),zt=(0,y.A)(()=>{Dt(),Ke({sticker:p.content.sticker})}),_t=(0,y.A)(()=>{Dt(),et({chatId:p.chatId,messageId:p.id})}),Vt=(0,y.A)(()=>{Dt(),tt({chatId:p.chatId,messageId:p.id})}),Ht=(0,y.A)(()=>{const e=b?.messages?{messageId:p.id,childMessageIds:b.messages.map(({id:e})=>e),withShift:!1}:{messageId:p.id,withShift:!1};Ge(e),Dt()}),qt=(0,y.A)(()=>{je({chatId:p.chatId,id:p.id}),Dt()}),Wt=(0,y.A)((e,t)=>{Je({chatId:p.chatId,messageId:p.id,scheduledAt:e,scheduleRepeatPeriod:t}),xe()}),Xt=(0,y.A)(()=>{Ct(!1),Pt(Wt)}),Qt=(0,y.A)(()=>{Dt(),Ve({chatId:p.chatId,messageId:p.id})}),Zt=(0,y.A)(()=>{Dt(),He({chatId:p.chatId,messageId:p.id})}),en=(0,y.A)(e=>{Xe({messageIds:e}),Dt()}),tn=(0,y.A)(()=>{lt({chatId:p.chatId,messageId:p.id,shouldIncludeThread:e!==a.l3,shouldIncludeGrouped:!0}),Dt()}),nn=(0,y.A)(()=>{(0,u.eM)(p.content.contact.phoneNumber),Dt()}),on=(0,y.A)(()=>{const e=(0,i.mS)();(b?.messages||[p]).forEach(t=>{const n=(0,l.iS)(e,t);n&&(Tt?ze({media:n}):$e({media:n,originMessage:t}))}),Dt()}),an=(0,y.A)(()=>{const e=(0,r.zX)(p);Qe({gif:e}),Dt()}),sn=(0,y.A)(e=>{be&&!ee?rt({initialSection:"saved_tags"}):nt({chatId:p.chatId,messageId:p.id,reaction:e,shouldAddToRecent:!0}),Dt()}),rn=(0,y.A)(()=>{ut({chatId:p.chatId,messageId:p.id,count:1}),Dt()}),cn=(0,y.A)(()=>{ht({chatId:p.chatId,messageId:p.id}),Dt()}),ln=(0,y.A)(e=>{st({chatId:p.chatId,messageId:p.id,position:e})}),dn=(0,y.A)(()=>{ot({chatId:p.chatId,id:p.id}),Dt()}),un=(0,y.A)(()=>{it({chatId:p.chatId,id:p.id}),Dt()}),hn=(0,y.A)(()=>{at({chatId:p.chatId,messageId:p.id}),Dt()}),mn=(0,o.Kr)(()=>(b?b.messages:[p]).map(({id:e})=>e),[b,p]),pn=(0,y.A)(()=>{J&&(Ct(!1),xe(),mt({chatId:J.id,messageIds:mn}))});if(F)return void Dt();const gn=new Date;return gn.setFullYear(gn.getFullYear()+1),(0,N.FD)("div",{ref:ft,className:(0,d.A)("ContextMenuContainer",ke),children:[(0,N.Y)(X,{isReactionPickerOpen:we,availableReactions:t,topReactions:n,defaultTagReactions:c,isWithPaidReaction:Re,message:p,isPrivate:W,isCurrentUserPremium:ee,canBuyPremium:ne,isOpen:yt,enabledReactions:H,reactionsLimit:q,anchor:x,targetHref:T,canShowReactionsCount:j,canShowReactionList:z,canSendNow:D,canReschedule:L,canReply:B,canQuote:Rt!==Z,canDelete:G,canPin:U,canReport:$,repliesThreadInfo:O,canUnpin:K,canEdit:_,canAppendTodoList:V,canForward:te,canFaveSticker:oe,canUnfaveSticker:ie,canCopy:ae,canCopyLink:se,canSelect:re,canDownload:ce,canSaveGif:le,canRevote:de,canClosePoll:ue,canShowSeenBy:ve,canTranslate:ye,canShowOriginal:Ie,canSelectLanguage:Se,canPlayAnimatedEmojis:he,shouldRenderShowWhen:pe,canLoadReadDate:me,hasCustomEmoji:Yt,customEmojiSets:w,isDownloading:Tt,seenByRecentPeers:xt,isInSavedMessages:be,noReplies:Ae,poll:P,webPage:k,story:Y,onOpenThread:Ut,onReply:Bt,onEdit:Ot,onAppendTodoList:Kt,onPin:Gt,onUnpin:jt,onForward:Jt,onDelete:Et,onReport:pn,onFaveSticker:$t,onUnfaveSticker:zt,onSelect:Ht,onSend:qt,onReschedule:Xt,onClose:Dt,onCopyLink:tn,onCopyMessages:en,onCopyNumber:nn,onDownload:on,onSaveGif:an,onCancelVote:_t,onClosePoll:bt,onShowSeenBy:Qt,onToggleReaction:sn,onSendPaidReaction:rn,onShowPaidReactionModal:cn,onShowReactors:Zt,onReactionPickerOpen:ln,onTranslate:dn,onShowOriginal:un,onSelectLanguage:hn,userFullName:Me,canGift:Pe}),(0,N.Y)(R,{isOpen:It,messageId:p.id,chatId:p.chatId,onClose:Lt}),(0,N.Y)(M.A,{isOpen:wt,onClose:Nt,text:At("lng_polls_stop_warning"),confirmLabel:At("lng_polls_stop_sure"),confirmHandler:Vt}),L&&kt]})}))}}]);
//# sourceMappingURL=1670.d18268523d1d879daf81.js.map