>n&31}const s=Math.floor(5*(n-1)/8),a=Math.floor(5*(n-1)%8),r=i[s]+(i[s+1]<<8);return o[n-1]=r>>a&31,o}(new Uint8Array(e)),d)},[a,t,s])||{};return(0,o.Nf)(()=>{const t=d.current;t&&c&&void 0!==l&&function(e,t,n,{peak:o,fillStyle:i,progressFillStyle:s}){const a=4*t.length;e.width=2*a,e.height=46,e.style.width=`${a}px`,e.style.height="23px";const r=e.getContext("2d");r.scale(2,2),t.forEach((e,a)=>{r.globalAlpha=a/t.length>=n?.5:1,r.fillStyle=n>a/t.length?s:i;const d=Math.max(2,e/Math.max(1,o)*23);!function(e,t,n,o,i,s){2<2*s&&(s=1),i<2*s&&(s=i/2),e.beginPath(),e.moveTo(t+s,n),e.arcTo(t+2,n,t+2,n-i,s),e.arcTo(t+2,n-i,t,n-i,s),e.arcTo(t,n-i,t,n,s),e.arcTo(t,n,t+2,n,s),e.closePath()}(r,4*a,(23+d)/2,0,d,1),r.fill()})}(t,c,r?1-n:n,{peak:l,fillStyle:i?"dark"===e?"#B7ABED":"#AEDFA4":"dark"===e?"#494A78":"#ADD3F7",progressFillStyle:i?"dark"===e?"#FFFFFF":"#4FAE4E":"dark"===e?"#8774E1":"#3390EC"})},[i,l,n,c,e,r]),d}(e,me,!le||je||Je?Oe:1,je,!R,ye,Je),$e=Re||Oe>0&&Oe<1;(0,o.vJ)(()=>{we(Re)},[Re]);const qe=Ce&&!De,{isUploading:He,isTransferring:We,transferProgress:_e}=(0,r.LK)(d||Pe,qe||z,void 0!==d),{shouldRender:Qe,transitionClassNames:Ze}=(0,M.A)(We),Xe=Qe&&(qe||He),et=(0,w.A)(()=>{if(He)te?.();else{if(Me)return ae({message:t}),void ee?.();Re||Z?.(t.id,t.chatId),(0,i.ko)().setAudioPlayerOrigin({origin:c}),we(!Ce),Ue()}});(0,o.vJ)(()=>{ee&&le&&Re&&ee()},[Re,le,ee]);const tt=(0,w.A)(()=>{z?oe({media:he}):ie({media:he,originMessage:t})}),nt=(0,w.A)(e=>{if(ge.current&&fe.current){const{width:t,left:n}=fe.current.getBoundingClientRect(),o=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),Ke(Math.max(Math.min(ze*((o-n)/t),ze-.1),.001))}}),ot=(0,w.A)(e=>{e instanceof MouseEvent&&2===e.button||(ge.current=!0,nt(e))}),it=(0,w.A)(()=>{ge.current=!1}),st=(0,w.A)(()=>{ne(t)}),at=(0,w.A)(()=>{se({chatId:t.chatId,messageId:t.id})});function rt(){if(pe)return n||"Voice";const{title:e,fileName:t}=ue;return e||t}function dt(){if(pe)return(0,T.Y)("div",{className:"meta",dir:Ae.isRtl?"rtl":void 0,children:(0,m.QO)((de||ce).duration)});const{performer:e}=ue;return(0,T.FD)("div",{className:"meta",dir:Ae.isRtl?"rtl":void 0,children:[(0,m.QO)(ze),(0,T.Y)("span",{className:"bullet",children:"•"}),e&&(0,T.Y)("span",{className:"performer",title:e,children:(0,f.A)(e)}),e&&n&&(0,T.Y)("span",{className:"bullet",children:"•"}),n&&(0,T.Y)("span",{title:n,children:(0,f.A)(n)})]})}(0,o.vJ)(()=>{if(fe.current&&$e&&!Ne)return(0,h.wJ)(fe.current,{onCapture:ot,onRelease:it,onClick:it,onDrag:nt})},[$e,ot,nt,it,Ne]);const ct=(0,u.A)("Audio",O,Ne&&"non-interactive",c===a.d9.Inline&&"inline",je&&c===a.d9.Inline&&"own",(c===a.d9.Search||c===a.d9.SharedMedia)&&"bigger",K&&"audio-is-selected"),lt=["toogle-play-wrapper"];Xe?lt.push("loading"):lt.push(Re?"pause":"play");const ut=(0,u.A)("content",$e&&"with-seekline");function ht(){return(0,T.FD)("div",{className:ut,children:[(0,T.FD)("div",{className:"content-row",children:[(0,T.Y)("p",{className:"title",dir:"auto",title:rt(),children:(0,f.A)(rt())}),(0,T.Y)("div",{className:"message-date",children:Boolean(g)&&(0,T.Y)(Y.A,{className:"date",onClick:st,children:(0,m.be)(ve,1e3*g)})})]}),$e&&(0,T.FD)("div",{className:"meta search-result",dir:Ae.isRtl?"rtl":void 0,children:[(0,T.Y)("span",{className:"duration with-seekline",dir:"auto",children:Oe<1&&(0,m.QO)(ze*Oe,ze)}),B(Oe,xe,fe)]}),!$e&&dt()]})}return(0,T.FD)("div",{className:ct,dir:Ae.isRtl?"rtl":"ltr",children:[U&&(0,T.Y)("div",{className:"message-select-control no-selection",children:K&&(0,T.Y)(F.A,{name:"select"})}),(0,T.FD)("div",{className:(0,u.A)(...lt),children:[(0,T.FD)(N.A,{round:!0,ripple:!ye,size:"smaller",className:"toggle-play",color:Se?"translucent-white":"primary",ariaLabel:Re?"Pause audio":"Play audio",onClick:et,isRtl:Ae.isRtl,backgroundImage:Se,nonInteractive:Ne,children:[!Ne&&(0,T.Y)(F.A,{name:"play"}),!Ne&&(0,T.Y)(F.A,{name:"pause"}),Ne&&(0,T.Y)(P.A,{className:"flame",tgsUrl:p.w.Flame,nonInteractive:!0,noLoop:!1,size:40})]}),Me&&!Ne&&(0,T.Y)(F.A,{name:"view-once"})]}),Qe&&(0,T.Y)("div",{className:(0,u.A)("media-loading",Ze,Xe&&"interactive"),children:(0,T.Y)(k.A,{progress:_e,transparent:!0,withColor:!0,size:"m",onClick:Xe?et:void 0,noCross:!Xe})}),Ne&&!Qe&&(0,T.Y)("div",{className:(0,u.A)("media-loading"),children:(0,T.Y)(k.A,{progress:Oe,transparent:!0,size:"m",noCross:!0,rotationOffset:3/4})}),ue&&$&&!He&&(0,T.Y)(N.A,{round:!0,size:"tiny",className:"download-button",ariaLabel:z?"Cancel download":"Download",onClick:tt,children:(0,T.Y)(F.A,{name:z?"close":"arrow-down"})}),c===a.d9.Search&&ht(),c!==a.d9.Search&&ue&&L(Ae,ve,ue,ze,Re,Oe,xe,fe,z||He,g,_e,ne?st:void 0),c===a.d9.SharedMedia&&me&&ht(),(c===a.d9.Inline||Ne||J)&&me&&E(me,fe,Ge,Me?Ve:Oe,le,V,j,J,G,q?at:void 0,Q,c)]})}))},65741:(e,t,n)=>{e.exports=n.p+"GiftRedRound.a86b78b0b99e07f69a70.svg"},66991:(e,t,n)=>{n.d(t,{Y:()=>u,c:()=>h});var o=n(84051),i=n(31481),s=n(66644),a=n(19822),r=n(39761),d=n(96454),c=n(95704);const l=100;function u(e,t,n){return(0,o.vJ)(()=>{if(!t||!e.current)return;const o=g(),i=e.current;if(!d.Yw||!n||!o?.isTypeSupported(n))return;const u=new o;function h(){if(!t||!n)return;const e=u.addSourceBuffer(n),o=(0,c.h)(t);e.addEventListener("updateend",function(){o.next().then(({value:t,done:n})=>{"open"===u.readyState&&(n?p(u):m(e,t))})}),o.next().then(({value:t,done:n})=>{n||"open"!==u.readyState||((0,s.RK)(()=>{i.style.display="block",setTimeout(()=>{(0,s.RK)(()=>{(0,a.ZM)(i,{opacity:"1"})})},l)}),m(e,t))})}return u.addEventListener("sourceopen",h,{once:!0}),(0,s.RK)(()=>{(0,a.ZM)(i,{display:"none",opacity:"0"}),i.src=URL.createObjectURL(u)}),()=>{(0,s.RK)(()=>{const e=i.src;(0,r.A)(i),u.removeEventListener("sourceopen",h),"open"===u.readyState&&p(u),URL.revokeObjectURL(e)})}},[n,t,e]),h(n)}function h(e){return!(!d.Yw||!e)&&Boolean(g()?.isTypeSupported(e))}function m(e,t){try{e.appendBuffer(t)}catch(e){i.Oig&&console.warn("[Stream] failed to append buffer",e)}}function p(e){try{e.endOfStream()}catch(e){i.Oig&&console.warn("[Stream] failed to end stream",e)}}function g(){return"ManagedMediaSource"in window?ManagedMediaSource:"MediaSource"in window?MediaSource:void 0}},67054:(e,t,n)=>{function o(e,t){return t-Math.floor(t/e)*e}n.d(t,{A:()=>o})},68153:(e,t,n)=>{e.exports=n.p+"GiftGreenRound.f66f0acd5d3dda1c7baf.svg"},69419:(e,t,n)=>{n.d(t,{A:()=>g});var o=n(84051),i=n(23174),s=n(91048),a=n(96454),r=n(58554),d=n(37836),c=n(63527),l=n(30857),u=n(14745);const h=.75,m=1500,p=500;function g(e,t=!1,n=i.qZ.BlobUrl,g,f=!1){const v=a.Uz&&n===i.qZ.Progressive,A=e?v&&!t?r.RB(e):r.Ih(e):void 0,y=(0,l.A)(),C=(0,c.A)(s.nIz),w=(0,u.A)(),[I,b]=(0,o.J0)(A&&!v?1:0),S=(0,o.li)(),M=(0,o.Kr)(()=>(0,d.nF)(e=>{S.current&&(!g||Date.now()-S.current>g)&&b(e)},p,!0),[g]);return(0,o.vJ)(()=>{!t&&e&&(A?v&&setTimeout(()=>{b(h)},m):(b(0),S.current&&r.ch(M),S.current=Date.now(),r.hd(e,n,f,M,w).then(()=>{const e=Date.now()-S.current;S.current=void 0,!g||e>=g?y():setTimeout(y,g-e)})))},[t,e,A,n,v,g,M,f,w,C]),(0,o.vJ)(()=>{t&&S.current&&(r.ch(M),b(0),S.current=void 0)},[M,t]),(0,o.vJ)(()=>()=>{e&&r.Cn(e,w)},[w,e]),{mediaData:A,loadProgress:I}}},71331:(e,t,n)=>{n.d(t,{Ip:()=>r,O7:()=>h,iT:()=>l,mD:()=>a,n5:()=>d,qI:()=>c,uu:()=>u});var o=n(90709),i=n(21133),s=n(19926);function a(e,t){const n=(0,i.AW)(e,t);if(n&&n.groupCallId)return r(e,n.groupCallId)}function r(e,t){return e.groupCalls.byId[t]}function d(e,t,n){return r(e,t)?.participants[n]}function c(e){const t=l(e)?.chatId;if(!t)return!1;const n=(0,i.hd)(e,t);return!!n&&((0,o.yn)(n)&&n.isCreator||Boolean(n.adminRights?.manageCall))}function l(e){const{groupCalls:{activeGroupCallId:t}}=e;if(t)return r(e,t)}function u(e){const{phoneCall:t,currentUserId:n}=e;if(!t||!t.participantId||!t.adminId)return;const o=t.adminId===n?t.participantId:t.adminId;return(0,s.mB)(e,o)}function h(e){const t=l(e);if(!t||!t.chatId)return!1;const n=(0,i.hd)(e,t.chatId);if(!n)return!1;if(Boolean((0,o.Kl)(n)))return!0;const s=(0,i.AW)(e,n.id)?.inviteLink;return Boolean(s)}},71950:(e,t,n)=>{n.d(t,{A:()=>C});var o=n(84051),i=n(87357),s=n(17663),a=n(17142),r=n(14242),d=n(39351),c=n(59030),l=n(18276);const u="gvrp3KoR",h="IHb3ZATQ",m="zAPFdKbZ";var p=n(20021);const g=[[{name:"followers",title:"ChannelStats.Overview.Followers"},{name:"enabledNotifications",title:"ChannelStats.Overview.EnabledNotifications",isPercentage:!0}],[{name:"viewsPerPost",title:"ChannelStats.Overview.ViewsPerPost"},{name:"viewsPerStory",title:"ChannelStats.Overview.ViewsPerStory"}],[{name:"sharesPerPost",title:"ChannelStats.Overview.SharesPerPost"},{name:"sharesPerStory",title:"ChannelStats.Overview.SharesPerStory"}],[{name:"reactionsPerPost",title:"ChannelStats.Overview.ReactionsPerPost"},{name:"reactionsPerStory",title:"ChannelStats.Overview.ReactionsPerStory"}]],f=[[{name:"members",title:"Stats.GroupMembers"},{name:"messages",title:"Stats.GroupMessages"}],[{name:"viewers",title:"Stats.GroupViewers"},{name:"posters",title:"Stats.GroupPosters"}]],v=[[{name:"viewsCount",title:"Stats.Message.Views",isPlain:!0},{name:"publicForwards",title:"Stats.Message.PublicShares",isPlain:!0}],[{name:"reactionsCount",title:"Channel.Stats.Overview.Reactions",isPlain:!0},{name:"forwardsCount",title:"Stats.Message.PrivateShares",isPlain:!0,isApproximate:!0}]],A=[[{name:"viewsCount",title:"Channel.Stats.Overview.Views",isPlain:!0},{name:"publicForwards",title:"PublicShares",isPlain:!0}],[{name:"reactionsCount",title:"Channel.Stats.Overview.Reactions",isPlain:!0},{name:"forwardsCount",title:"PrivateShares",isPlain:!0}]],y=[[{name:"level",title:"Stats.Boosts.Level",isPlain:!0},{name:"premiumSubscribers",title:"Stats.Boosts.PremiumSubscribers",isPercentage:!0,isApproximate:!0,withAbsoluteValue:!0}],[{name:"boosts",title:"Stats.Boosts.ExistingBoosts",isPlain:!0},{name:"remainingBoosts",title:"Stats.Boosts.BoostsToLevelUp",isPlain:!0}]],C=(0,o.ph)(({title:e,type:t,statistics:n,isToncoin:o,className:C,subtitle:w})=>{const I=(0,c.A)(),b=(0,d.A)(),S=({change:e,percentage:t})=>{if(!e)return;const n=Number(e)<0;return(0,p.FD)("span",{className:(0,i.A)("idLrmbhS",n&&"SLfwGHQC"),children:[n?`-${(0,r.Vw)(b,Math.abs(e))}`:`+${(0,r.Vw)(b,e)}`,t&&(0,p.FD)(p.FK,{children:[" ","(",t,"%)"]})]})},M=(e,t,n)=>{const[o,i]=e.toFixed(4).split("."),[s,a]=(e*t).toFixed(2).split(".");return(0,p.FD)("div",{children:[(0,p.Y)(l.A,{className:"it39BC_c",name:"toncoin"}),(0,p.FD)("b",{className:m,children:[o,(0,p.FD)("span",{className:"ZAfXkuWL",children:[".",i]})]})," ",(0,p.FD)("span",{className:h,children:["≈ $",s,(0,p.FD)("span",{className:"HRXb_S2M",children:[".",a]})]}),(0,p.Y)("h3",{className:h,children:I(n)})]})},{period:N}=n,{balances:Y,usdRate:k}=n,P=function(e){switch(e){case"group":return f;case"message":return v;case"boost":return y;case"story":return A;default:return g}}(t);return(0,p.FD)("div",{className:(0,i.A)("Gi8Nokbl",C),children:[(0,p.FD)("div",{className:"H01lE7mv",children:[e&&(0,p.Y)("div",{className:"VQbs04hT",children:e}),N&&(0,p.FD)("div",{className:"X7bBlGdi",children:[(0,s.Lu)(I,1e3*N.minDate)," ","—",(0,s.Lu)(I,1e3*N.maxDate)]})]}),(0,p.Y)("table",{className:"s5beXqqL",children:o?(0,p.Y)("tr",{children:(0,p.FD)("td",{className:u,children:[M(Y?.availableBalance?(0,a.wD)(Y.availableBalance.amount):0,k||0,"lng_channel_earn_available"),M(Y?.currentBalance?(0,a.wD)(Y.currentBalance.amount):0,k||0,"lng_channel_earn_reward"),M(Y?.overallRevenue?(0,a.wD)(Y.overallRevenue.amount):0,k||0,"lng_channel_earn_total")]})}):P.map(e=>(0,p.Y)("tr",{children:e.map(e=>{const t=n?.[e.name];if(e.isPlain)return(0,p.FD)("td",{className:u,children:[(0,p.Y)("b",{className:m,children:`${e.isApproximate?"≈ ":""}${(0,r.Sm)(t??0)}`}),(0,p.Y)("h3",{className:h,children:I(e.title)})]});if(e.isPercentage){const n=t?.part??0,o=t?.percentage??0;return(0,p.FD)("td",{className:u,children:[e.withAbsoluteValue&&(0,p.Y)("span",{className:m,children:`${e.isApproximate?"≈ ":""}${(0,r.Sm)(n)}`}),(0,p.FD)("span",{className:e.withAbsoluteValue?"_mYEmh_u":m,children:[o,"%"]}),(0,p.Y)("h3",{className:h,children:I(e.title)})]})}return(0,p.FD)("td",{className:u,children:[(0,p.Y)("b",{className:m,children:(0,r.Vw)(b,t?.current??0)})," ",S(t),(0,p.Y)("h3",{className:h,children:I(e.title)})]})})}))}),w]})})},72078:(e,t,n)=>{e.exports=n.p+"GiftBlueRound.90e369f0f350cdfb20d4.svg"},73172:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(13439),s=n(31481),a=n(37836);const r=(e,t)=>(0,o.Kr)(()=>(0,a.nF)(n=>{e&&t&&(0,i.ko)().sendMessageAction({chatId:e,threadId:t,action:n})},s.cqp),[e,t])},73176:(e,t,n)=>{n.d(t,{A:()=>L});var o=n(84051),i=n(31481),s=n(66644),a=n(90709),r=n(70636),d=n(37836);function c(e,t=d.IJ){return new Promise(n=>{t(()=>{(function(e){return Promise.allSettled(e.getAnimations({subtree:!0}).filter(e=>e instanceof CSSTransition).map(e=>e.finished))})(e).then(()=>n())})})}var l=n(87357),u=n(4961),h=n(18501),m=n(79882),p=n(35749),g=n(2338),f=n(21488),v=n(39351),A=n(62587),y=n(13439),C=n(76023),w=n(43874),I=n(11217),b=n(38102);const S="CBda1UmC",M="BhS75ocD",N="uWo2dhui",Y="g3XnC73g";var k=n(20021);const P=Number(C.$),F=(0,o.ph)(({chat:e,topics:t,hasTags:n,renderLastMessage:i,observeIntersection:s})=>{const{openThread:r}=(0,y.ko)(),d=(0,o.li)(),c=(0,o.li)(),h=(0,v.A)(),[m,...p]=(0,o.Kr)(()=>t?(0,a.CO)(Object.values(t),void 0,!0).slice(0,3):[],[t]),[g,f]=(0,o.J0)(!1),[A,C]=(0,o.J0)(void 0),{handleClick:F,handleMouseDown:T}=(0,I.Q)(t=>{0===m.unreadCount||e.isForumAsMessages||(t.stopPropagation(),t.preventDefault(),r({chatId:e.id,threadId:m.id,shouldReplaceHistory:!0,noForumTopicPanel:(0,w.Ny)()}))});return(0,o.vJ)(()=>{const e=d.current,t=c.current;if(!e||!t||n)return;const o=e.offsetWidth,i=t.offsetWidth;Math.abs(o-i)i)},[m,i,n]),(0,k.FD)("div",{className:(0,l.A)("Ow6Ij9O5",g&&"U_yhhC0w",A&&"HV0wCR4O"),dir:h.isRtl?"rtl":void 0,style:A?`--overwritten-width: ${A}px`:void 0,children:[!n&&(0,k.FD)(k.FK,{children:[m&&(0,k.FD)("div",{className:S,children:[(0,k.FD)("div",{className:(0,l.A)("lEbV6HrI",m.unreadCount&&M),ref:c,onClick:F,onMouseDown:T,children:[(0,k.Y)(b.A,{topic:m,observeIntersection:s}),(0,k.Y)("div",{className:"k3Ch25ZQ",children:(0,u.A)(m.title)}),!A&&g&&(0,k.Y)("div",{className:N,children:(0,k.Y)("div",{className:Y})})]}),(0,k.Y)("div",{className:"IkuCBmvA",children:p.map(e=>(0,k.FD)("div",{className:(0,l.A)("d0hTIVJn",e.unreadCount&&M),children:[(0,k.Y)(b.A,{topic:e,className:"oknhG11L",observeIntersection:s}),(0,k.Y)("span",{className:"ZUj3xAjs",children:(0,u.A)(e.title)})]},e.id))}),(0,k.Y)("div",{className:"_m_2xcPW"})]}),!m&&(0,k.Y)("div",{className:(0,l.A)(S,"L4Zk0yMN"),children:h("Loading")})]}),(0,k.FD)("div",{className:(0,l.A)("KJ16dBus",m?.unreadCount&&!n&&M),ref:d,onClick:F,onMouseDown:T,children:[i(),!A&&!g&&(0,k.Y)("div",{className:N,children:(0,k.Y)("div",{className:Y})})]})]})});var T=n(18276),D=n(18653),x=n(80477);function L({chat:e,topics:t,lastMessage:n,statefulMediaContent:d,chatId:l,typingStatus:y,draft:C,lastMessageTopic:w,lastMessageSender:I,observeIntersection:b,animationType:S,orderDiff:M,withInterfaceAnimations:N,isTopic:Y,isSavedDialog:P,isPreview:D,hasTags:L,onReorderAnimationEnd:B}){const R=(0,v.A)(),O=(0,o.li)(),U=n?.content.storyData,K=d&&!d.story;(0,f.A)(K?U?.peerId:void 0,U?.id,d?.story);const z=d?.story||n,V=z&&!(0,a.fP)(z),j=(0,g.A)(z),J=V?j:void 0,G=(0,p.A)(z,"micro"),$=(0,A.A)(V?G:void 0),q=Boolean(n&&(0,a.lk)(n)),H=(0,o.hb)(()=>{if(!P&&!D&&y&&n&&y.timestamp>1e3*n.date)return(0,k.Y)(x.A,{typingStatus:y});const t=C&&C.replyInfo?.replyToMsgId===w?.id,o=C?.replyInfo&&!C.text&&C.isLocal;if(!e?.isForum&&!P&&!D&&C&&!o&&(!Y||!t))return(0,k.FD)("p",{className:"last-message",dir:R.isRtl?"auto":"ltr",children:[(0,k.Y)("span",{className:"draft",children:R("ChatDraftPrefix")}),(0,k.Y)("span",{className:"last-message-summary",dir:"auto",children:(0,h.fd)({text:C.text?.text||"",entities:C.text?.entities,asPreview:!0,withTranslucentThumbs:!0})})]});if(!n)return;const i=I?(0,r.Q5)(R,l,I):void 0;return(0,k.FD)("p",{className:"last-message shared-canvas-container",dir:R.isRtl?"auto":"ltr",children:[i&&(0,k.FD)(k.FK,{children:[(0,k.Y)("span",{className:"sender-name",children:(0,u.A)(i)}),(0,k.Y)("span",{className:"colon",children:":"})]}),!P&&n.forwardInfo&&(0,k.Y)(T.A,{name:"share-filled",className:"chat-prefix-icon"}),"story"===n.replyInfo?.type&&(0,k.Y)(T.A,{name:"story-reply",className:"chat-prefix-icon"}),(0,k.Y)("span",{className:"last-message-summary",dir:"auto",children:E(n,b,$||J,q)})]})},[e,l,C,q,Y,R,n,I,w,$,J,b,y,P,D]);return(0,o.Nf)(()=>{const e=O.current;if(!N||!e)return;let t=!1;const n=()=>{t||((0,s.RK)(()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""}),B?.())};if(S===m.I.Opacity)e.style.opacity="0",(0,s.RK)(()=>{e.classList.add("animate-opacity"),e.style.opacity="1",c(e).then(n)});else{if(S!==m.I.Move)return;e.style.transform=`translate3d(0, ${-M*i.yq1}px, 0)`,(0,s.RK)(()=>{e.classList.add("animate-transform"),e.style.transform="",c(e).then(n)})}return()=>{t=!0}},[N,M,S,B]),{renderSubtitle:function(){return e?.isForum&&!Y?(0,k.Y)(F,{chat:e,renderLastMessage:H,observeIntersection:b,topics:t,hasTags:L}):H()},ref:O}}function E(e,t,n,o){const i=(0,k.Y)(D.A,{message:e,noEmoji:Boolean(n),observeIntersectionForLoading:t,inChatList:!0});if(!n)return i;const s=(0,a.y2)(e);return(0,k.FD)("span",{className:"media-preview",children:[(0,k.Y)("img",{src:n,alt:"",className:(0,l.A)("media-preview--image",o&&"round",s&&"media-preview-spoiler"),draggable:!1}),(0,a.zX)(e)&&(0,k.Y)(T.A,{name:"play"}),i]})}},75319:(e,t,n)=>{function o(e){return"object"==typeof e&&null!==e&&"graphType"in e}n.d(t,{R:()=>o})},75343:(e,t,n)=>{n.d(t,{A:()=>b});var o=n(84051),i=n(13439),s=n(87357),a=n(43874),r=n(36838),d=n(39351),c=n(89925),l=n(70636),u=n(48899),h=n(54464),m=n(10722),p=n(17712),g=n(59030),f=n(92111),v=n(21849),A=n(71429),y=n(24433),C=n(2429),w=n(20021);const I=(0,o.ph)(function({peer:e,isArchived:t}){const{openChat:n,openChatWithInfo:a,openStoryViewer:r,toggleStoriesHidden:d}=(0,i.ko)(),I=(0,g.A)(),b=(0,o.li)(),S="isSelf"in e&&e.isSelf,M=!(0,u.L8)(e.id);(0,f.A)(e.id);const{isContextMenuOpen:N,contextMenuAnchor:Y,handleBeforeContextMenu:k,handleContextMenu:P,handleContextMenuClose:F,handleContextMenuHide:T}=(0,m.A)(b),D=(0,p.A)(()=>b.current),x=(0,p.A)(()=>document.body),L=(0,p.A)(()=>b.current.querySelector(".story-peer-context-menu .bubble")),E=(0,p.A)(()=>({withPortal:!0,isDense:!0})),B=(0,p.A)(()=>{N||r({peerId:e.id,origin:c.G9.StoryRibbon})}),R=(0,p.A)(e=>{(0,h.u)(e),k(e)}),O=(0,p.A)(()=>{a({id:e.id,shouldReplaceHistory:!0,profileTab:"stories"})}),U=(0,p.A)(()=>{a({id:e.id,shouldReplaceHistory:!0,profileTab:"storiesArchive"})}),K=(0,p.A)(()=>{n({id:e.id,shouldReplaceHistory:!0})}),z=(0,p.A)(()=>{a({id:e.id,shouldReplaceHistory:!0})}),V=(0,p.A)(()=>{d({peerId:e.id,isHidden:!t})});return(0,w.FD)("div",{ref:b,role:"button","data-peer-id":e.id,tabIndex:0,className:C.A.peer,onMouseDown:R,onClick:B,onContextMenu:P,children:[(0,w.Y)(v.A,{peer:e,withStory:!0,storyViewerOrigin:c.G9.StoryRibbon,storyViewerMode:"full"}),(0,w.Y)("div",{className:(0,s.A)(C.A.name,e.hasUnreadStories&&C.A.name_hasUnreadStory),children:S?I("MyStory"):(0,l.F9)(I,e)}),void 0!==Y&&(0,w.Y)(A.A,{isOpen:N,anchor:Y,getTriggerElement:D,getRootElement:x,getMenuElement:L,getLayout:E,className:(0,s.A)("story-peer-context-menu",C.A.contextMenu),autoClose:!0,withPortal:!0,onClose:F,onCloseAnimationEnd:T,children:S?(0,w.FD)(w.FK,{children:[(0,w.Y)(y.A,{onClick:O,icon:"play-story",children:I("StoryList.Context.SavedStories")}),(0,w.Y)(y.A,{onClick:U,icon:"archive",children:I("StoryList.Context.ArchivedStories")})]}):(0,w.FD)(w.FK,{children:[!M&&(0,w.Y)(y.A,{onClick:K,icon:"message",children:I("SendMessageTitle")}),M?(0,w.Y)(y.A,{onClick:z,icon:"channel",children:I("ChatList.ContextOpenChannel")}):(0,w.Y)(y.A,{onClick:z,icon:"user",children:I("StoryList.Context.ViewProfile")}),(0,w.Y)(y.A,{onClick:V,icon:t?"unarchive":"archive",children:I(t?"StoryList.Context.Unarchive":"StoryList.Context.Archive")})]})})]})}),b=(0,o.ph)((0,i.EK)((e,{isArchived:t})=>{const{orderedPeerIds:{active:n,archived:o}}=e.stories;return{orderedPeerIds:t?o:n,usersById:e.users.byId,chatsById:e.chats.byId}})(function({isArchived:e,className:t,orderedPeerIds:n,usersById:i,chatsById:c,isClosing:l}){const u=(0,d.A)(),h=(0,s.A)(C.A.root,!n.length&&C.A.hidden,l&&C.A.closing,t,"no-scrollbar"),m=(0,o.li)();return(0,r.A)(m,(0,a.Ny)()),(0,w.Y)("div",{ref:m,id:"StoryRibbon",className:h,dir:u.isRtl?"rtl":void 0,children:n.map(t=>{const n=i[t]||c[t];if(n)return(0,w.Y)(I,{peer:n,isArchived:e},t)})})}))},75956:(e,t,n)=>{n.d(t,{W:()=>a,d:()=>r});var o=n(37836);let i,s=!1;const a=(0,o.sg)((e,t=!1)=>{i&&(clearTimeout(i),i=void 0),s?s=!1:i=window.setTimeout(()=>{t&&(s=!0),e()},500)},50,!1);function r(){i&&(clearTimeout(i),i=void 0)}},76786:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(84051);let i=function(e){return e[e.waitingForNetwork=0]="waitingForNetwork",e[e.syncing=1]="syncing",e[e.online=2]="online",e}({});function s(e,t,n,s,a,r){let d,c,l;return d=function(){const[e,t]=(0,o.J0)(window.navigator.onLine);return(0,o.vJ)(()=>{function e(){t(window.navigator.onLine)}return window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("offline",e),window.removeEventListener("online",e)}},[]),e}()&&"connectionStateConnecting"!==t?n?i.syncing:i.online:i.waitingForNetwork,c=d===i.online||r?"none":s?"middleHeader":a?"minimized":"overlay",d===i.waitingForNetwork?l=e("WaitingForNetwork"):d===i.syncing&&(l=e("Updating")),"middleHeader"===c&&(l=l.toLowerCase().replace(/\.+$/,"")),{connectionStatus:d,connectionStatusPosition:c,connectionStatusText:l}}},78407:(e,t,n)=>{n.d(t,{A:()=>_});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(91048),d=n(30708),c=n(63495),l=n(96454),u=n(87357),h=n(52674),m=n(14680),p=n(17237),g=n(36353),f=n(37836),v=n(4961),A=n(11359),y=n(43874),C=n(19129),w=n(37661),I=n(39351),b=n(17712),S=n(59030),M=n(88458),N=n(41733);class Y{isPlaying=!1;constructor(e,t,n){this.container=t,this.options=n,this.video=document.createElement("video"),this.video.src=e,this.video.disablePictureInPicture=!0,this.video.muted=!0,n.style&&this.video.setAttribute("style",n.style),this.video.style.position="absolute",this.video.load(),this.options.noLoop||(this.video.loop=!0),(0,a.RK)(()=>{this.container.appendChild(this.video),this.recalculatePositionAndSize()})}play(){!this.isPlaying&&this.video&&(this.recalculatePositionAndSize(),this.video.paused&&(0,N.A)(this.video),this.isPlaying=!0)}pause(){this.isPlaying&&this.video&&(this.video.paused||this.video.pause(),this.isPlaying=!1)}destroy(){this.pause(),this.video?.remove(),this.video=void 0}updatePosition(e){this.options.position=e,this.recalculatePositionAndSize()}recalculatePositionAndSize(){const{size:e,position:{x:t,y:n}}=this.options;(0,a.YS)(()=>{if(!this.video)return;const o=this.video,{width:i,height:s}=this.container.getBoundingClientRect();(0,a.RK)(()=>{o.style.left=`${Math.round(t*i)}px`,o.style.top=`${Math.round(n*s)}px`,o.style.width=`${e}px`,o.style.height=`${e}px`})})}}var k=n(48894),P=n(60261),F=n(43336),T=n(76023),D=n(37479),x=n(87094),L=n(82117),E=n(93545),B=n(672),R=n(61157),O=n(38691);const U=1.25*T.$;var K=n(18276),z=n(64493),V=n(61361),j=n(80089),J=n(80464),G=n(20021);const $=e=>{const{isOpen:t}=e,n=(0,J.A)(j.ar.Extra,"TextFormatter",!t);return n?(0,G.Y)(n,{...e}):void 0},q="input-scroller",H=140,W=["Esc","Escape","Enter","PageUp","PageDown","Meta","Alt","Ctrl","ArrowDown","ArrowUp","Control","Shift"],_=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n})=>{const{messageSendKeyCombo:o}=(0,d.l)(e);return{messageSendKeyCombo:o,replyInfo:t&&n?(0,r.GA4)(e,t,n)?.replyInfo:void 0,isSelectModeActive:(0,r.rTV)(e),canPlayAnimatedEmojis:(0,r.BWX)(e)}})(({ref:e,id:t,chatId:n,captionLimit:d,isAttachmentModalInput:N,isStoryInput:T,customEmojiPrefix:j,editableInputId:J,isReady:_,isActive:Q,getHtml:Z,placeholder:X,timedPlaceholderLangKey:ee,timedPlaceholderDate:te,forcedPlaceholder:ne,canSendPlainText:oe,canAutoFocus:ie,noFocusInterception:se,shouldSuppressFocus:ae,shouldSuppressTextFormatter:re,replyInfo:de,isSelectModeActive:ce,canPlayAnimatedEmojis:le,messageSendKeyCombo:ue,onUpdate:he,onSuppressedFocus:me,onSend:pe,onScroll:ge,onFocus:fe,onBlur:ve,isNeedPremium:Ae,messageListType:ye})=>{const{editLastMessage:Ce,replyToNextMessage:we,showAllowedMessageTypesNotification:Ie,openPremiumModal:be}=(0,i.ko)();let Se=(0,o.li)();e&&(Se=e);const Me=(0,o.li)(),Ne=(0,o.li)(),Ye=(0,o.li)(),ke=(0,o.li)(),Pe=(0,o.li)(),Fe=(0,o.li)(),Te=(0,S.A)(),De=(0,I.A)(),xe=(0,o.li)(!1),[Le,Ee,Be]=(0,w.A)(),[Re,Oe]=(0,o.J0)(),[Ue,Ke]=(0,o.J0)(),[ze,Ve]=(0,o.J0)(!1),{isMobile:je}=(0,y.Ay)(),Je=je&&(l.pz||l.Ni),[Ge,$e]=(0,o.J0)(!1);(0,o.vJ)(()=>{$e(Boolean(ee&&te))},[te,ee]);const qe=(0,b.A)(()=>{$e(!1)});!function(e,t,n,s,d,c,l,u,h){const m=(0,x.A)(t,void 0,!u),p=(0,D.A)(m,!0),g=(0,O.A)(),f=(0,o.li)(new Map),v=(0,b.A)(e=>{e.forEach(e=>{const t=f.current.get(e);t&&(t.destroy(),f.current.delete(e))})}),A=(0,b.A)(()=>{if(!(u&&t.current&&n.current&&s.current))return;const e=(0,i.mS)(),o=new Set(f.current.keys());Array.from(t.current.querySelectorAll(".custom-emoji")).forEach(t=>{if(!t.dataset.uniqueId)return;const i=`${c}${t.dataset.uniqueId}${m||""}`,a=t.dataset.documentId;o.delete(i);const u=(0,P.ZR)(a);if(!u)return;const h=n.current.getBoundingClientRect(),v=t.getBoundingClientRect(),A=(0,F.LI)((v.left-h.left)/h.width,4),y=(0,F.LI)((v.top-h.top)/h.height,4);if(f.current.has(i))return void f.current.get(i).updatePosition(A,y);const C=(0,r.O8F)(e,a);if(!C)return;const w=C?.stickerSetInfo&&(0,r.CzR)(e,C.stickerSetInfo),I=[c,a,m,g].filter(Boolean).join("_");(async function({customEmoji:e,sharedCanvasRef:t,sharedCanvasHqRef:n,absoluteContainerRef:o,renderId:i,viewId:s,mediaUrl:a,position:r,isHq:d,textColor:c,colorFilter:l}){if(e.isLottie){const o=e.shouldUseTextColor&&c?(0,k.hF)(c):void 0,l=(await(0,M.Y)()).init(a,d?n.current:t.current,i,{size:U,coords:r,isLowPriority:!d},s,o?[o.r,o.g,o.b]:void 0);return{play:()=>l.play(),pause:()=>l.pause(),destroy:()=>l.removeView(s),updatePosition:(e,t)=>l.setSharedCanvasCoords(s,{x:e,y:t})}}if(e.isVideo){const t=e.shouldUseTextColor&&l?`filter: ${l};`:void 0,n=new Y(a,o.current,{size:U,position:r,style:t});return{play:()=>n.play(),pause:()=>n.pause(),destroy:()=>n.destroy(),updatePosition:(e,t)=>n.updatePosition({x:e,y:t})}}throw new Error("Unsupported custom emoji type")})({customEmoji:C,sharedCanvasRef:n,sharedCanvasHqRef:s,absoluteContainerRef:d,renderId:I,viewId:i,mediaUrl:u,isHq:w,position:{x:A,y},textColor:m,colorFilter:p}).then(e=>{l&&e.play(),f.current.set(i,e)})}),v(Array.from(o))});(0,o.vJ)(()=>(0,P.K3)(A),[A]),(0,o.vJ)(()=>{const e=f.current;return()=>{v(Array.from(e.keys()))}},[]),(0,o.vJ)(()=>{e()&&t.current&&n.current&&h&&u?(0,a.YS)(()=>{A()}):v(Array.from(f.current.keys()))},[e,A,t,v,n,h,u]),(0,o.Nf)(()=>{document.documentElement.style.setProperty("--input-custom-emoji-filter",p||"none")},[p]),(0,L.A)(([e])=>{void 0!==e&&m!==e&&A()},[m,A]);const y=(0,B.A)(A,[A],300,!1);(0,E.A)(n,y),(0,L.A)(([e])=>{g!==e&&(v(Array.from(f.current.keys())),A())},[g,A]);const C=(0,b.A)(()=>{f.current.forEach(e=>{e.pause()})}),w=(0,b.A)(()=>{l&&f.current?.forEach(e=>{e.play()})}),I=(0,b.A)(()=>{(0,a.YS)(w)});(0,R.Ay)(C,I)}(Z,Se,ke,Pe,Fe,j,le,_,Q);const He=N?160:T?128:je?256:416,We=(0,b.A)((e=!1)=>{(0,f.IJ)(()=>{(0,a.gm)(()=>{const t=Se.current.closest(`.${q}`),n=Number(t.style.height.replace("px","")),o=Ye.current,{scrollHeight:i}=o,s=Math.min(i,He);if(s===n)return;const r=i>He;function d(){const e=Math.round(50*Math.log(Math.abs(s-n)));t.style.height=`${s}px`,t.style.transitionDuration=`${e}ms`,t.classList.toggle("overflown",r)}return e?void(0,a.RK)(d):d})})});(0,o.Nf)(()=>{N&&We(!1)},[N,We]);const _e=(0,o.li)(Z());(0,o.Nf)(()=>{const e=Q?Z():"";!Q&&Se.current&&Se.current.blur(),e!==Se.current.innerHTML&&(Se.current.innerHTML=e),e!==Ne.current.innerHTML&&(Ne.current.innerHTML=e),e!==_e.current&&(_e.current=e,We(!e))},[Z,Q,We]),(0,o.li)(n).current=n;const Qe=(0,b.A)(()=>{Se.current&&!Ae&&(0,g.A)(Se.current)}),Ze=(0,b.A)(()=>{Be(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()});function Xe(){if(l.pz)return!1;const e=window.getSelection();if(!e||!e.rangeCount||xe.current)return Be(),l.Ni&&Ve(!1),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(re||!(0,A.L)(t,J||s.CfG)||!n||(0,p.A)(n)||!t.START_TO_END)||(Be(),!1)}function et(){if(!Xe())return;if(ze)return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=Se.current.closest(`.${q}`).getBoundingClientRect();let o=t.left+t.width/2-n.left;on.width-H&&(o=n.width-H),Oe({x:o,y:t.top-n.top}),Ke(e),Ee()}function tt(){Me.current&&window.clearTimeout(Me.current),Me.current=window.setTimeout(et,260)}const nt=(0,b.A)(e=>"Enter"===e.key&&!e.shiftKey&&!Je&&("enter"===ue&&!e.shiftKey||"ctrl-enter"===ue&&(e.ctrlKey||e.metaKey))),ot=(0,b.A)(e=>{e.preventDefault(),Be(),pe()}),it=(0,b.A)(()=>be());(0,o.vJ)(()=>{l.TF||ie&&Qe()},[n,Qe,de,ie]),(0,o.vJ)(()=>{if(!n||J!==s.CfG&&J!==s.e0F||Je||ce)return;const e=e=>{const t=e.target,n=Se.current;if(!(Q&&n&&t&&t!==n&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName)||t.isContentEditable||(0,h.N)("Enter"))return;if(nt(e))return void ot(e);const{key:o}=e;if(se||(0,m.ZJ)()||W.includes(o))return;const i=document.getSelection()?.isCollapsed;if((o.startsWith("Arrow")||e.shiftKey&&"Shift"===o)&&!i||"KeyC"===e.code&&(e.ctrlKey||e.metaKey)&&"INPUT"!==t.tagName)return;(0,g.A)(n,!0,!0);const s=new KeyboardEvent(e.type,e);n.dispatchEvent(s)};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}},[n,J,Je,Q,ce,se]),(0,o.vJ)(()=>{const e=(0,f.sg)(e=>{"Tab"!==e.key||(0,m.ZJ)()||(e.preventDefault(),(0,a.RK)(Qe))},2e3,!0,!1);return(0,h.A)({onTab:e})},[Qe]),(0,o.vJ)(()=>{const e=Se.current;function t(){e.blur()}return ae&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}},[ae]);const st=(0,C.A)(()=>Boolean(Q&&Z()),[Q,Z]),at=(0,u.A)("form-control allow-selection",st&&"touched",ae&&"focus-disabled"),rt=(0,u.A)("input-scroller-content",Ae&&"is-need-premium"),dt="string"==typeof X?X:void 0;return(0,G.FD)("div",{id:t,onClick:ae?me:void 0,dir:De.isRtl?"rtl":void 0,children:[(0,G.Y)("div",{className:(0,u.A)("custom-scroll",q,Ae&&"is-need-premium"),onScroll:ge,onClick:N||oe?void 0:function(){N||oe||T&&Ae||Ie({chatId:n,messageListType:ye})},children:(0,G.FD)("div",{className:rt,children:[(0,G.Y)("div",{ref:Se,id:J||s.CfG,className:at,contentEditable:N||oe,role:"textbox",dir:"auto",spellCheck:!c.Vq&&void 0,tabIndex:0,onClick:Qe,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(he("
"===t?"":t),!l.TF&&(!n||!n.length)&&(l.TL||!t.includes("emoji-small"))&&!t.includes("custom-emoji")){const e=window.getSelection();e&&(Se.current.blur(),e.removeAllRanges(),(0,g.A)(Se.current,!0))}},onKeyDown:function(e){const{isComposing:t}=e,n=Z();if(!t&&!n&&(e.metaKey||e.ctrlKey)){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void we({targetIndexDelta:t})}!t&&nt(e)?ot(e):t||"ArrowUp"!==e.key||n||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",tt,{once:!0}):(e.preventDefault(),Ce())},onMouseDown:function(e){function t(e){e instanceof KeyboardEvent&&"Esc"!==e.key&&"Escape"!==e.key||(setTimeout(()=>{xe.current=!1},100),window.removeEventListener("keydown",t),window.removeEventListener("mousedown",t))}2===e.button?xe.current||(xe.current=!0,document.addEventListener("mousedown",t),document.addEventListener("keydown",t)):(e.currentTarget.closest(".message-input-wrapper")||e.target).addEventListener("mouseup",tt,{once:!0})},onContextMenu:l.Ni?function(e){Xe()&&(Ve(!ze),ze?Be():(e.preventDefault(),e.stopPropagation(),et()))}:void 0,onTouchCancel:l.Ni?tt:void 0,"aria-label":dt,onFocus:Ae?void 0:fe,onBlur:Ae?void 0:ve}),!ne&&(0,G.FD)("span",{className:(0,u.A)("placeholder-text",!N&&!oe&&"with-icon",Ae&&"is-need-premium"),dir:"auto",children:[!N&&!oe&&(0,G.Y)(K.A,{name:"lock-badge",className:"placeholder-icon"}),Ge?(0,G.Y)(V.A,{langKey:ee,endsAt:te,onEnd:qe}):X,T&&Ae&&(0,G.Y)(z.A,{className:"unlock-button",size:"tiny",color:"adaptive",onClick:it,children:Te("StoryRepliesLockedButton")})]}),(0,G.Y)("canvas",{ref:ke,className:"shared-canvas"}),(0,G.Y)("canvas",{ref:Pe,className:"shared-canvas"}),(0,G.Y)("div",{ref:Fe,className:"absolute-video-container"})]})}),(0,G.Y)("div",{ref:Ye,className:(0,u.A)("custom-scroll",q,"clone",Ae&&"is-need-premium"),children:(0,G.Y)("div",{className:rt,children:(0,G.Y)("div",{ref:Ne,className:(0,u.A)(at,"clone"),dir:"auto"})})}),void 0!==d&&(0,G.Y)("div",{className:"max-length-indicator",dir:"auto",children:d}),(0,G.Y)($,{isOpen:Le,anchorPosition:Re,selectedRange:Ue,setSelectedRange:Ke,onClose:Ze}),ne&&(0,G.Y)("span",{className:"forced-placeholder",children:(0,v.A)(ne)})]})}))},79882:(e,t,n)=>{n.d(t,{I:()=>i,W:()=>s});var o=n(84051);let i=function(e){return e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None",e}({});function s(e){return(0,o.Kr)(()=>{const t=Object.values(e),n=t.filter(e=>e<0).length,o=t.filter(e=>e>0).length;return t=>{const s=e[t];return 0===s?i.None:s===1/0||s===-1/0||n<=o&&s<0||o0?i.Opacity:i.Move}},[e])}},80477:(e,t,n)=>{n.d(t,{A:()=>u});var o=n(84051),i=n(13439),s=n(90709),a=n(91048),r=n(4961),d=n(59030),c=n(80999),l=n(20021);const u=(0,o.ph)((0,i.EK)((e,{typingStatus:t})=>t.userId?{typingUser:(0,a.mBe)(e,t.userId)}:{typingUser:void 0})(({typingStatus:e,typingUser:t})=>{const n=(0,d.A)(),o=t&&!t.isSelf&&(0,s.u0)(t),i=n(e.action).replace("{user}","").replace("{emoji}",e.emoji||"").trim();return(0,l.FD)("p",{className:"typing-status",dir:n.isRtl?"rtl":"auto",children:[o&&(0,l.Y)("span",{className:"sender-name",dir:"auto",children:(0,r.A)(o)}),(0,l.Y)(c.A,{content:i})]})}))},80999:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(84051),i=n(87357),s=n(4961),a=n(39351),r=n(20021);const d=(0,o.ph)(({content:e,className:t})=>{const n=(0,a.A)();return(0,r.FD)("span",{className:(0,i.A)("DotAnimation",t),dir:n.isRtl?"rtl":"auto",children:[(0,s.A)(e),(0,r.Y)("span",{className:"ellipsis"})]})})},81524:(e,t,n)=>{n.d(t,{A:()=>y});var o=n(84051),i=n(90709),s=n(96454),a=n(87357),r=n(17663),d=n(83868),c=n(35749),l=n(2338),u=n(37661),h=n(5912),m=n(17712),p=n(62587),g=n(83057),f=n(65843),v=n(27860),A=n(20021);const y=(0,o.ph)(({message:e,idPrefix:t="shared-media",isProtected:n,canAutoPlay:y,observeIntersection:C,onClick:w})=>{const I=(0,o.li)(),b=(0,h.Vz)(I,C),[S,M,N]=(0,u.A)(),Y=(0,l.A)(e),k=(0,c.A)(e,"pictogram"),P=(0,p.A)(k,!b),F=(0,g.A)(P),T=(0,i.zX)(e),D=T?.isGif?(0,i.sC)(T,"full"):void 0,x=(0,p.A)(D,!b),L=(0,i.y2)(e),[E,,B]=(0,u.A)(L),R=(0,m.A)(()=>{B(),w(e.id,e.chatId)});return(0,A.FD)("div",{ref:I,id:`${t}${(0,i.GZ)(e.id)}`,className:"Media scroll-item",onClick:w?R:void 0,onMouseOver:s.TF?void 0:M,onMouseOut:s.TF?void 0:N,children:[(0,A.Y)("img",{src:Y,className:"media-miniature",alt:"",draggable:!n,decoding:"async",onContextMenu:n?d.A:void 0}),x?(0,A.Y)(f.A,{canPlay:b&&!L&&S&&Boolean(y),src:x,className:(0,a.A)("full-media","media-miniature",F),muted:!0,loop:!0,playsInline:!0,draggable:!1,disablePictureInPicture:!0,onContextMenu:n?d.A:void 0}):(0,A.Y)("img",{src:P,className:(0,a.A)("full-media","media-miniature",F),alt:"",draggable:!1,decoding:"async",onContextMenu:n?d.A:void 0}),L&&(0,A.Y)(v.A,{thumbDataUri:P||Y,isVisible:E,className:"media-spoiler"}),T&&(0,A.Y)("span",{className:"video-duration",children:T.isGif?"GIF":(0,r.QO)(T.duration)}),n&&(0,A.Y)("span",{className:"protector"})]})})},81642:(e,t,n)=>{n.d(t,{A:()=>c});var o=n(84051),i=n(87357),s=n(17663),a=n(59030),r=n(45),d=n(20021);const c=(0,o.ph)(({className:e,message:t,outgoingStatus:n,draftDate:o})=>{const c=(0,a.A)(),l=o&&o>t.date;return(0,d.FD)("div",{className:(0,i.A)("LastMessageMeta",e),children:[n&&!l&&(0,d.Y)(r.A,{status:n}),(0,d.Y)("span",{className:"time",children:(0,s.be)(c,1e3*(l?o:t.date))})]})})},84313:(e,t,n)=>{n.d(t,{A:()=>c});var o=n(84051),i=n(13439),s=n(96454),a=n(17712),r=n(59030);const d=8e3;function c(e,t,n){const{showNotification:c}=(0,i.ko)(),l=(0,r.A)(),[u,h]=(0,o.J0)(!1),m=(0,a.A)(()=>{h(!0),t||c({message:s.yS?l("Video.Unsupported.Mobile"):l("Video.Unsupported.Desktop"),duration:d})}),p=(0,a.A)(e=>{const t=e.currentTarget,{error:n}=t;n&&(3!==n.code&&4!==n.code||m())}),g=(0,a.A)(e=>{const t=e.currentTarget;t.videoHeight&&t.videoWidth||m()});return(0,o.vJ)(()=>{if(n)return;const{current:t}=e;return t?(t.addEventListener("error",p),t.addEventListener("canplay",g),()=>{t.removeEventListener("error",p),t.removeEventListener("canplay",g)}):void 0},[n,e]),u}},84555:(e,t,n)=>{n.d(t,{A:()=>T});var o=n(84051),i=n(13439),s=n(23174),a=n(90709),r=n(53827),d=n(87357),c=n(17663),l=n(41733),u=n(76023),h=n(2338),m=n(63988),p=n(37661),g=n(5912),f=n(17712),v=n(37960),A=n(69419),y=n(73767),C=n(34201),w=n(61097),I=n(18276),b=n(27860),S=n(64493),M=n(65843),N=n(35913),Y=n(20021);const k=u.Wd/2,P=2*(k-6)*Math.PI;let F;const T=({message:e,className:t,canAutoLoad:n,isDownloading:T,origin:D,observeIntersection:x,onStop:L,onReadMedia:E,isTranscriptionError:B,isTranscribed:R,canTranscribe:O,onHideTranscription:U,isTranscriptionHidden:K,isTranscribing:z})=>{const V=(0,o.li)(),j=(0,o.li)(),J=(0,o.li)(),{cancelMediaDownload:G,openOneTimeMediaModal:$,transcribeAudio:q}=(0,i.ko)(),H=(0,g.Vz)(V,x),W=e.content.video,_=e.isMediaUnread,[Q,Z]=(0,o.J0)(n),X=Boolean(Q&&H),{mediaData:ee,loadProgress:te}=(0,A.A)((0,a.sC)(W,"inline"),!X,(0,a.Cz)(W,"inline")),{loadProgress:ne}=(0,A.A)((0,a.sC)(W,"download"),!T,s.qZ.BlobUrl),[oe,ie]=(0,p.A)(),se=(0,a.G5)(e),ae="oneTimeModal"===D,re=se&&!ae,de=(0,h.A)(e),ce=!Boolean(de)||oe||re,le=(0,w.A)(W,ce);(0,v.A)({hasMediaData:!ce,ref:le});const ue=Q&&!oe||T,he=!1===(0,y.A)(Q),{ref:me,shouldRender:pe}=(0,C.A)({isOpen:ue,noMountTransition:he,withShouldRender:!0}),[ge,fe]=(0,o.J0)(!1),[ve,Ae]=(0,o.J0)(0),[ye,Ce]=(0,o.Ul)(0),we=(0,m.aG)(ye,16);(0,o.vJ)(()=>{if(!ge)return;const e=j.current;Ce(e.currentTime/e.duration)},[Ce,ge,we]),(0,o.Nf)(()=>{if(!ge||!J.current)return;const e=P-we()*P;J.current.setAttribute("stroke-dashoffset",e.toString())},[ge,we]);const Ie=Boolean(ee&&H),be=(0,f.A)(()=>{j.current&&(fe(!1),Ce(0),(0,l.A)(j.current))}),Se=(0,f.A)(()=>{F?.(),F=be}),Me=(0,f.A)(()=>{const e=j.current;ge?e.paused?((0,l.A)(e),(0,r._K)()):e.pause():(Se(),e.pause(),e.currentTime=0,(0,l.A)(e),(0,r._K)(),fe(!0))});(0,o.vJ)(()=>{ae&&Me()},[ae]);const Ne=(0,f.A)(t=>{if(!t.target.closest(".transcribe-button"))if(ee){if(!T)return se&&!ae?($({message:e}),void E?.()):void Me();G({media:W})}else Z(e=>!e)});(0,o.vJ)(()=>{E&&_&&ge&&E()},[ge,_,E]);const Ye=(0,f.A)(e=>{const t=e.currentTarget;Ce(t.currentTime/t.duration),Ae(Math.floor(t.currentTime))}),ke=(0,f.A)(()=>{q({chatId:e.chatId,messageId:e.id})}),Pe=(0,f.A)(()=>{(R||B)&&U?U(!K):z||ke()});return(0,Y.FD)("div",{ref:V,className:(0,d.A)("RoundVideo","media-inner",ae&&"non-interactive",t),onClick:Ne,children:[ee&&(0,Y.FD)("div",{className:"video-wrapper",children:[re&&(0,Y.Y)(b.A,{isVisible:!0,thumbDataUri:de,width:u.Wd,height:u.Wd,className:"media-spoiler"}),(0,Y.Y)(M.A,{canPlay:Ie,ref:j,src:ee,className:"full-media",width:u.Wd,height:u.Wd,autoPlay:!re,disablePictureInPicture:!0,muted:!ge,defaultMuted:!0,loop:!ge,playsInline:!0,isPriority:!0,onEnded:ge?L??be:void 0,onTimeUpdate:ge?Ye:void 0,onReady:ie})]}),!re&&(0,Y.Y)("canvas",{ref:le,className:"thumbnail",style:`width: ${u.Wd}px; height: ${u.Wd}px`}),(0,Y.Y)("div",{className:"progress",children:ge&&(0,Y.Y)("svg",{width:u.Wd,height:u.Wd,children:(0,Y.Y)("circle",{ref:J,cx:k,cy:k,r:k-6,className:"progress-circle",transform:`rotate(-90, ${k}, ${k})`,"stroke-dasharray":P,"stroke-dashoffset":P})})}),pe&&(0,Y.Y)("div",{ref:me,className:"media-loading",children:(0,Y.Y)(N.A,{progress:T?ne:te})}),re&&!pe&&(0,Y.FD)("div",{className:"play-wrapper",children:[(0,Y.Y)(S.A,{color:"dark",round:!0,size:"smaller",className:"play",nonInteractive:!0,children:(0,Y.Y)(I.A,{name:"play"})}),(0,Y.Y)(I.A,{name:"view-once"})]}),!ee&&!Q&&(0,Y.Y)(I.A,{name:"download"}),!ae&&(0,Y.FD)("div",{className:(0,d.A)("message-media-duration",_&&"unread"),children:[ge?(0,c.QO)(ve):(0,c.QO)(W.duration),(!ge||j.current.paused)&&(0,Y.Y)(I.A,{name:"muted"})]}),O&&(0,Y.FD)(S.A,{onClick:Pe,className:"transcribe-button",children:[R||B?(0,Y.Y)(I.A,{name:"down"}):(0,Y.Y)(I.A,{name:"transcribe"}),z&&(0,Y.Y)("svg",{viewBox:"0 0 32 24",className:"loading-svg",children:(0,Y.Y)("rect",{className:"loading-rect",fill:"transparent",width:"32",height:"24","stroke-width":"3","stroke-linejoin":"round",rx:"6",ry:"6",stroke:"white","stroke-dashoffset":"1","stroke-dasharray":"32,68"})})]})]})}},85449:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(31481),i=n(98607),s=n(4961),a=n(18276),r=n(20021);function d(e,t){return"receipt"===t.type?e("PaymentReceipt"):"buy"===t.type?(0,i.i)(t.text,o.Cyx,(0,r.Y)(a.A,{className:"star-currency-icon",name:"star"})):(0,s.A)(t.text)}},87970:(e,t,n)=>{n.d(t,{A:()=>re});var o=n(84051),i=n(89925),s=n(90709),a=n(13439),r=n(91048),d=n(30708),c=n(96454),l=n(87357),u=n(95807),h=n(50442),m=n(79824),p=n(31460),g=n(76023),f=n(4961),v=n(41385),A=n(54699),y=n(39351),C=n(17712),w=n(59030),I=n(73767),b=n(45294),S=n(23174),M=n(58554),N=n(41036),Y=n(21849),k=n(34431),P=n(18276),F=n(38102),T=n(48899),D=n(14242),x=n(43874),L=n(45470),E=n(37661),B=n(62587),R=n(83057),O=n(39996),U=n(65843),K=n(57474),z=n(20021);const V=(0,o.ph)(({chat:e,user:t,photo:n,isSavedMessages:i,isSavedDialog:a,canPlayVideo:r,className:d,style:h,theme:m,onClick:p})=>{const g=(0,o.li)(),v=(0,y.A)(),{isMobile:A}=(0,x.Ay)(),C=t&&(0,s.PL)(t),w=e&&(0,s.kE)(e.id),I=e&&(0,s.Qe)(e.id),b=t||e,S=b&&!i&&!C&&!w&&!I,{isVideo:M}=n||{},N=(!n||n.id===b.avatarPhotoId)&&(0,s.cP)(b,"normal"),Y=S&&n&&!N&&(0,s.rI)(n,"pictogram"),k=(0,B.A)(Y||N),F=S&&n&&!M&&(0,s.mU)(n),V=(0,B.A)(F),j=S&&n&&M&&(0,s.Pg)(n),J=(0,B.A)(j)||V,[G,$]=(0,E.A)(),q=Boolean(J&&(!M||G)),H=(0,R.A)(q),W=S&&!q&&!k&&n?.thumbnail?.dataUri,_=(0,L.A)(n?.thumbnail?.dataUri,!W,A&&!c.QH),Q=n||k||W,{className:Z,style:X}=(0,O.Ay)({peer:b,theme:m});(0,o.vJ)(()=>{g.current&&!r&&(g.current.currentTime=0)},[r]);const ee=(0,o.Kr)(()=>i?a?"my-notes":"avatar-saved-messages":C?"avatar-deleted-account":w?"reply-filled":I?"author-hidden":void 0,[I,C,a,w,i]);let te;if(ee)te=(0,z.Y)(P.A,{name:ee,role:"img"});else if(Q)te=(0,z.FD)(z.FK,{children:[W?(0,z.Y)("canvas",{ref:_,className:"thumb"}):(0,z.Y)("img",{src:k,draggable:!1,className:"thumb",alt:""}),n&&(M?(0,z.Y)(U.A,{canPlay:r,ref:g,src:J,className:(0,l.A)("avatar-media",H),muted:!0,disablePictureInPicture:!0,loop:!0,playsInline:!0,onReady:$}):(0,z.Y)("img",{src:J,draggable:!1,className:(0,l.A)("avatar-media",H),alt:""}))]});else if(t){const e=(0,s.Yg)(t);te=e?(0,D.Qh)(e,2):void 0}else if(e){const t=(0,s.Js)(v,e);te=t&&(0,D.Qh)(t,(0,T.L8)(e.id)?2:1)}else te=(0,z.Y)("div",{className:"spinner-wrapper",children:(0,z.Y)(K.A,{color:"white"})});const ne=(0,l.A)("ProfilePhoto",Z,i&&"saved-messages",I&&"anonymous-forwards",C&&"deleted-account",w&&"replies-bot-account",!i&&!Q&&"no-photo",d);return(0,z.Y)("div",{className:ne,style:(0,u.A)(h,X),onClick:Q?p:void 0,children:"string"==typeof te?(0,f.A)(te,["hq_emoji"]):te})});var j=n(43336),J=n(66833),G=n(95773),$=n(82855);const q=2*g.$,H=[{x:-.2,y:-.3},{x:.3,y:.1},{x:-.4,y:-.1},{x:.4,y:-.1},{x:-.25,y:.1},{x:.25,y:-.25}],W=({gift:e,style:t,className:n,withGlow:i,peerId:s})=>{const{openGiftInfoModal:r}=(0,a.ko)(),d=(0,o.li)(),c=(0,o.Kr)(()=>(0,J.uc)(e.gift),[e]),l=(0,C.A)(()=>{r({peerId:s,gift:e})});if(c?.model&&c.backdrop)return(0,z.Y)(G.A,{withSparkles:!0,sparklesColor:c.backdrop.textColor,glowColor:i?c.backdrop.edgeColor:void 0,ref:d,className:n,style:t,onClick:l,children:(0,z.Y)($.A,{containerRef:d,sticker:c.model.sticker,size:q,withTranslucentThumb:!0,noPlay:!0})})},_=(0,o.ph)(({peerId:e,gifts:t,isExpanded:n,className:o,withGlow:i})=>{const{createVtnStyle:s}=(0,v.k)();if(t)return(0,z.Y)("div",{className:(0,l.A)("dspICZx5",o),children:t.slice(0,H.length).map((t,o)=>{const a=n?function(e){return{x:(0,j.qE)(1.5*e.x,-.45,.45),y:(0,j.qE)(1.5*e.y,-.45,.45)}}(H[o]):H[o],r=(0,u.A)(`top: ${100*(.5+a.y)}%`,`left: ${100*(.5+a.x)}%`);return(0,z.Y)(W,{peerId:e,className:"GtRefNqT",gift:t,style:(0,u.A)(r,s(`profilePinnedGift${o}`,"profilePinnedGift")),withGlow:i},t.gift.id)})})});var Q=n(40558);const Z="XxRtPe_4",X="eZ2DGNou",ee="ldzIKEUp",te="uNvH08Qp",ne="UZ7NDj8N",oe="Yr9FHqbF",ie="eFsZljMG",se=8*g.$,ae=5.25*g.$,re=(0,o.ph)((0,a.EK)((e,{peerId:t})=>{const n=(0,r.PVB)(e,t),o=(0,r.mBe)(e,t),i=o?(0,r.vGo)(e,t):void 0,s=(0,r.K0y)(e,t),a=(0,r.hds)(e,t),c=(0,r.IVq)(e,t),{mediaIndex:l,chatId:u}=(0,r.nTw)(e).mediaViewer,h=a?.isForum,{threadId:m}=(0,r.Xf0)(e)||{},p=h&&m?(0,r.S0q)(e,t,m):void 0,{animationLevel:g}=(0,d.l)(e),f=n?.emojiStatus,v=f?(0,r.O8F)(e,f.documentId):void 0,A="collectible"===f?.type?f.slug:void 0,y=n&&(0,r.Vi6)(e,n),C=(0,r.SJA)(e),w=(0,r.c7s)(e,t),I=(0,r.FDg)(e,t),b=Boolean(n?.avatarPhotoId);return{user:o,userFullInfo:i,userStatus:s,chat:a,mediaIndex:l,avatarOwnerId:u,animationLevel:g,emojiStatusSticker:v,emojiStatusSlug:A,emojiStatus:f,profilePhotos:c,topic:p,messagesCount:p?(0,r.QbG)(e,t,m):void 0,profileColorOption:y,theme:C,isPlain:!w,savedGifts:I,hasAvatar:b}})(({isExpanded:e,isForSettings:t,canPlayVideo:n,user:r,userFullInfo:d,userStatus:g,chat:T,mediaIndex:D,avatarOwnerId:x,topic:L,messagesCount:E,animationLevel:B,emojiStatus:R,emojiStatusSticker:O,emojiStatusSlug:U,profilePhotos:K,peerId:j,isForMonoforum:J,profileColorOption:G,theme:$,isPlain:q,savedGifts:H,hasAvatar:W,onExpand:re})=>{const{openMediaViewer:de,openPremiumModal:ce,openStickerSet:le,openPrivacySettingsNoticeModal:ue,loadMoreProfilePhotos:he,openUniqueGiftBySlug:me,openProfileRatingModal:pe,loadPeerSavedGifts:ge}=(0,a.ko)(),fe=(0,w.A)(),ve=(0,y.A)();(0,A.A)(r?6e4:void 0);const{createVtnStyle:Ae}=(0,v.k)(),ye=K?.photos||m.p,Ce=(0,I.A)(D),we=(0,I.A)(x),[Ie,be]=(0,o.J0)(!0),[Se,Me]=(0,o.J0)(0),Ne=ye.length<=1||0===Se,Ye=ye.length<=1||Se===ye.length-1,ke="collectible"===R?.type?R:void 0,Pe=r||T,{customEmoji:Fe}=(0,b.A)(ke?.patternDocumentId||Pe?.profileColor?.backgroundEmojiId),Te=(0,o.Kr)(()=>{if(ke)return{bgColors:[ke.centerColor,ke.edgeColor],storyColors:[ke.textColor,ke.textColor]};const e=G&&("dark"===$?G.darkColors:G.colors);return e?{bgColors:[...e.bgColors].reverse(),storyColors:[...e.storyColors].reverse()}:void 0},[G,$,ke]),De=Te?.bgColors||Fe,xe=(0,o.Kr)(()=>H?.gifts.filter(e=>"starGiftUnique"===e.gift.type?e.isPinned&&e.gift.slug!==ke?.slug:e.isPinned),[H,ke?.slug]);(0,o.vJ)(()=>{ye.length-Se<=3&&he({peerId:j})},[Se,j,ye.length]),(0,o.vJ)(()=>{ge({peerId:j})},[j]),(0,o.vJ)(()=>{we&&void 0!==Ce&&void 0===D&&(be(!1),Me(Ce))},[D,Ce,we]),(0,o.vJ)(()=>{Se>ye.length&&(be(!1),Me(Math.max(0,ye.length-1)))},[Se,ye.length]),(0,o.vJ)(()=>{e||Me(0)},[e]),function(e,t){(0,o.vJ)(()=>{e.slice(t,t+4).forEach(e=>{const t=(0,s.mU)(e);M.Ih(t)||M.hd(t,S.qZ.BlobUrl)})},[t,e])}(ye,Se);const Le=(0,C.A)(()=>{de({isAvatarView:!0,chatId:j,mediaIndex:Se,origin:t?i.TQ.SettingsAvatar:i.TQ.ProfileAvatar})}),Ee=(0,C.A)(()=>{U?me({slug:U}):j?ce({fromUserId:j}):le({stickerSetInfo:O.stickerSetInfo})}),Be=(0,C.A)(()=>{Ne||(be(!0),Me(Se-1))}),Re=(0,C.A)(()=>{Ye||(be(!0),Me(Se+1))}),Oe=(0,C.A)(()=>{ue({chatId:T.id,isReadDate:!1})}),Ue=(0,C.A)(e=>{r&&pe({userId:r.id,level:e})}),Ke=(0,C.A)(()=>{t?Le():W&&re?.()});if((0,o.vJ)(()=>{const e=document.querySelector(`.${ne}`);if(e)return(0,h.wJ)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:c.TF?(e,t)=>t===h.ez.Right?(Be(),!0):t===h.ez.Left&&(Re(),!0):void 0})},[Re,Be]),r||T)return L?(0,z.FD)("div",{className:"dNcezQH8",children:[(0,z.Y)(F.A,{topic:L,size:120,className:"YwVcTLvK",letterClassName:"_sQEevF7",noLoopLimit:!0}),(0,z.Y)("h3",{className:"hjk4U031",dir:ve.isRtl?"rtl":void 0,children:(0,f.A)(L.title)}),(0,z.Y)("p",{className:"GXxwbzqF",children:E?fe("Chat.Title.Topic",E,"i"):fe("lng_forum_no_messages")})]}):(0,z.FD)("div",{className:(0,l.A)("ProfileInfo","Z_HM0Jqg",!e&&"blI_IH7j",q&&"YIhgPXW6"),style:(0,u.A)(Te&&`--rating-outline-color: ${e?"transparent":Te?.bgColors[0]}`,Te&&!e&&`--rating-text-color: ${Te?.bgColors[0]}`,Ae("profileInfo",!0)),dir:ve.isRtl?"rtl":void 0,children:[De&&(0,z.Y)(Q.A,{backgroundColors:Te?.bgColors,patternIcon:Fe,patternSize:16,withLinearGradient:!ke,className:"BvunKb6r",yPosition:q?ae:se}),Boolean(xe?.length)&&(0,z.Y)(_,{peerId:j,gifts:xe,isExpanded:e,className:"JX3wjADD",withGlow:!q}),e&&(0,z.FD)("div",{className:ne,style:Ae("photoWrapper",!0),children:[function(){const e=Math.max(ye.length,K?.count||0);if(!ye||e<=1)return;const t=Array.from({length:Math.min(e,30)}),n=Se>=30?29:Se;return(0,z.Y)("div",{className:"e7iOf_3T",style:Ae("photoDashes",!0),children:t.map((e,t)=>(0,z.Y)("span",{className:(0,l.A)("eD0Is6TL",t===n&&"MSdiAM06")}))})}(),!t&&K?.personalPhoto&&(0,z.Y)("div",{className:(0,l.A)(X,Ne&&te),children:(0,z.Y)("div",{className:ee,children:fe(K.personalPhoto.isVideo?"UserInfo.CustomVideo":"UserInfo.CustomPhoto")})}),t&&K?.fallbackPhoto&&(0,z.Y)("div",{className:(0,l.A)(X,(Ne||Ye)&&te),children:(0,z.FD)("div",{className:ee,onClick:function(){Ne&&(be(!0),Me(ye.length-1))},children:[!Ye&&(0,z.Y)(Y.A,{photo:K.fallbackPhoto,className:"a9OwsvOP",size:"mini"}),fe(K.fallbackPhoto.isVideo?"UserInfo.PublicVideo":"UserInfo.PublicPhoto")]})}),(0,z.Y)(N.Ay,{activeKey:Se,name:(0,p.P)("slide",B,!Ie,ve.isRtl),children:function(e){const t=ye.length>0?ye[Se]:void 0;return(0,z.Y)(V,{user:r,chat:T,photo:t,theme:$,canPlayVideo:Boolean(e&&n),className:(0,l.A)(e&&"yltXKQri"),style:e?Ae("avatar",!0):void 0,onClick:Le},Se)}}),!Ne&&(0,z.Y)("button",{type:"button",dir:ve.isRtl?"rtl":void 0,className:(0,l.A)(oe,"Z1ZX2xot"),"aria-label":fe("AccDescrPrevious"),onClick:Be}),!Ye&&(0,z.Y)("button",{type:"button",dir:ve.isRtl?"rtl":void 0,className:(0,l.A)(oe,"X0stLWTl"),"aria-label":fe("Next"),onClick:Re})]}),!e&&(0,z.Y)(Y.A,{withStory:!0,storyColors:Te?.storyColors,className:"rLHO_VQT",size:"jumbo",peer:Pe,style:Ae("avatar",!0),onClick:W?Ke:void 0},Pe?.id),(0,z.FD)("div",{className:"ZFBuRDGK",dir:ve.isRtl?"rtl":"auto",style:Ae("info",!0),children:[(r||T)&&(0,z.Y)(k.A,{className:"atYgxkWV",style:Ae("title",!0),peer:r||T,withEmojiStatus:!0,withStatusTextColor:!0,emojiStatusSize:24,onEmojiStatusClick:Ee,noLoopLimit:!0,canCopyTitle:!0}),function(){const e=(0,s.Qe)(j),t=(0,s.DX)(j);if(!e&&!t)return J?(0,z.Y)("span",{className:(0,l.A)(Z,"status"),dir:"auto",style:Ae("status",!0),children:ve("MonoforumStatus")}):r?(0,z.FD)("div",{className:(0,l.A)(Z,"status",(0,s.PF)(r,g)&&"online"),style:Ae("status",!0),children:[ze(),(0,z.Y)("span",{className:"F4JyLH2c",dir:"auto",children:(0,s.CD)(fe,r,g)}),g?.isReadDateRestrictedByMe&&(0,z.Y)("span",{className:"wCXGPPTY",onClick:Oe,children:(0,z.Y)("span",{children:fe("StatusHiddenShow")})})]}):(0,z.Y)("span",{className:(0,l.A)(Z,"status"),dir:"auto",style:Ae("status",!0),children:(0,s.WX)(T)?fe("Subscribers",T.membersCount??0,"i"):fe("Members",T.membersCount??0,"i")})}()]})]});function ze(){if(!d?.starsRating)return;const e=d.starsRating.level,t=()=>Ue(e);if(e<0)return(0,z.FD)("span",{role:"button",tabIndex:0,className:"vuUzgWI1",onClick:t,children:[(0,z.Y)(P.A,{name:"rating-icons-negative",className:"JZBCjHv0"}),(0,z.Y)("span",{className:ie,children:"!"})]});const n=Math.max(e,1),o=Math.min(n,90),i=o<10?`rating-icons-level${o}`:"rating-icons-level"+10*Math.floor(o/10);return(0,z.FD)("span",{role:"button",tabIndex:0,className:"P6tsZMON",onClick:t,children:[(0,z.Y)(P.A,{name:i,className:"Yvu9iM5n"}),(0,z.Y)("span",{className:ie,children:e})]})}}))},88792:(e,t,n)=>{n.d(t,{A:()=>m});var o=n(84051),i=n(13439),s=n(31481),a=n(91048),r=n(53827),d=n(49642),c=n(80853),l=n(82117),u=n(17712),h=n(35297);const m=(e,t,n,m,p,g,f,v=!1,A,y,C=!1,w=!1,I,b=!1,S=!1)=>{const M=(0,o.li)(),[N,Y]=(0,o.J0)(!1);let k=N;const[P,F]=(0,o.J0)(0),T=(0,u.A)(()=>{Y(!1),y&&y()});(0,h.A)(()=>{if(!e)return;M.current=(0,r.kz)(e,n,(e,o)=>{if(!S){switch(e){case"onPlay":{const{setVolume:e,setPlaybackRate:o,toggleMuted:r,proxy:c}=M.current;Y(!0),"oneTimeVoice"!==n&&(0,d.MV)(g,function(e){let t={};if(e&&e.current){const{play:n,pause:o,setCurrentTime:s,proxy:a,requestNextTrack:r,requestPreviousTrack:d,isFirst:c,isLast:l}=e.current;t={play:()=>{n(a.src)},pause:()=>{o()},stop:()=>{o(),s(0),(0,i.ko)().closeAudioPlayer()},seekbackward:e=>{const t=e.seekOffset||10;s(Math.max(a.currentTime-t,0))},seekforward:e=>{const t=e.seekOffset||10;s(Math.min(a.currentTime+t,a.duration))},seekTo:e=>{e.seekTime&&s(e.seekTime)}},l()||(t.nexttrack=()=>{r()}),c()||(t.previoustrack=()=>{d()})}return t}(M)),(0,d.HW)("playing");const{audioPlayer:l}=(0,a.nTw)((0,i.mS)());e(l.volume),r(Boolean(l.isMuted));const u=c.duration&&Number.isFinite(c.duration)?c.duration:t;("voice"===n||u>s.CVm)&&o(l.playbackRate),(0,d.hm)({duration:c.duration||0,playbackRate:c.playbackRate,position:c.currentTime});break}case"onRateChange":{const{proxy:e}=M.current;(0,d.hm)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":Y(!1),(0,d.HW)("paused"),I?.();break;case"onTimeUpdate":{const{proxy:e}=M.current;if(b&&0===e.currentTime)break;const n=e.duration&&Number.isFinite(e.duration)?e.duration:t;w||F(e.currentTime/n);break}case"onEnded":(0,d.HW)("paused")}p?.[e]?.(o)}},A,T);const{proxy:o}=M.current;N||o.paused||(Y(!0),k=!0),f&&!S&&f(o)},[e]),(0,o.vJ)(()=>{N&&g&&(0,d.D5)(g)},[g,N]);const{play:D,pause:x,setCurrentTime:L,proxy:E,destroy:B,setVolume:R,stop:O,isFirst:U,isLast:K,requestNextTrack:z,requestPreviousTrack:V,setPlaybackRate:j,toggleMuted:J}=M.current??{},G=(0,o.Kr)(()=>E?.duration&&Number.isFinite(E.duration)?E.duration:t,[E?.duration,t]);(0,o.vJ)(()=>{E&&(b&&0===E.currentTime||!G||(0,c.f)(E)||w||F(E.currentTime/G))},[G,P,E,w,b]),(0,o.vJ)(()=>()=>{B?.(C)},[B,C]),(0,l.A)(([e,t])=>{e===v&&m===t||E?.src&&E?.paused||v&&m&&!N&&D?.(m)},[v,m,N,D,E?.src,E?.paused,n]);const $=(0,u.A)(()=>{m&&D?.(m)}),q=(0,u.A)(()=>{N?x?.():$()}),H=(0,u.A)(e=>{L?.(e),G&&E&&F(E.currentTime/G)});return{isPlaying:k,playProgress:P,playPause:q,pause:x,play:$,stop:O,setCurrentTime:H,setVolume:R,audioProxy:E,duration:G,requestNextTrack:z,requestPreviousTrack:V,isFirst:U,isLast:K,setPlaybackRate:j,toggleMuted:J}}},89755:(e,t,n)=>{e.exports=n.p+"encoderWorker.min.41c911dd9e2bbe20c518.js"},89873:(e,t,n)=>{n.d(t,{A:()=>m});var o=n(84051),i=n(13439),s=n(17712),a=n(34201),r=n(59030),d=n(71429),c=n(24433),l=n(60859),u=n(20021);const h=(0,o.ph)(({isOpen:e,sponsorInfo:t,canReport:n,anchor:i,triggerRef:a,shouldSkipAbout:h,onClose:m,onCloseAnimationEnd:p,onAboutAdsClick:g,onSponsoredHide:f,onSponsorInfo:v,onSponsoredReport:A})=>{const y=(0,o.li)(),C=(0,r.A)(),w=(0,s.A)(()=>a.current),I=(0,s.A)(()=>({withPortal:!0})),b=(0,s.A)(()=>y.current),S=(0,s.A)(()=>document.body),M=t||!h||n;return(0,u.FD)(d.A,{ref:y,isOpen:e,anchor:i,withPortal:!0,className:"with-menu-transitions",getLayout:I,getTriggerElement:w,getMenuElement:b,getRootElement:S,onClose:m,onCloseAnimationEnd:p,children:[t&&v&&(0,u.Y)(c.A,{icon:"channel",onClick:v,children:C("SponsoredMessageSponsor")}),!h&&(0,u.Y)(c.A,{icon:"info",onClick:g,children:C(n?"AboutRevenueSharingAds":"SponsoredMessageInfo")}),n&&A&&(0,u.Y)(c.A,{icon:"hand-stop",onClick:A,children:C("ReportAd")}),M&&(0,u.Y)(l.A,{}),(0,u.Y)(c.A,{icon:"close-circle",onClick:f,children:C("HideAd")})]})}),m=(0,o.ph)(({isOpen:e,randomId:t,sponsorInfo:n,additionalInfo:o,canReport:r,anchor:d,triggerRef:c,shouldSkipAbout:l,onItemClick:m,onClose:p,onCloseAnimationEnd:g})=>{const{openAboutAdsModal:f,showDialog:v,reportSponsored:A,hideSponsored:y}=(0,i.ko)(),{ref:C}=(0,a.A)({isOpen:e,onCloseAnimationEnd:g}),w=(0,s.A)(()=>{m?.(),p()}),I=(0,s.A)(()=>{f({randomId:t,additionalInfo:o,canReport:r,sponsorInfo:n}),w()}),b=(0,s.A)(()=>{y(),w()}),S=(0,s.A)(()=>{v({data:{message:[n,o].filter(Boolean).join("\n")}}),w()}),M=(0,s.A)(()=>{A({randomId:t}),w()});if(d)return(0,u.Y)("div",{ref:C,className:"ContextMenuContainer",children:(0,u.Y)(h,{isOpen:e,anchor:d,triggerRef:c,canReport:r,sponsorInfo:n,shouldSkipAbout:l,onClose:p,onCloseAnimationEnd:p,onAboutAdsClick:I,onSponsoredHide:b,onSponsorInfo:S,onSponsoredReport:M})})})},90054:(e,t,n)=>{n.d(t,{A:()=>_});var o=n(84051),i=n(13439),s=n(23174),a=n(31481),r=n(66644),d=n(90709),c=n(91048),l=n(96454),u=n(87357),h=n(11778),m=n(50442),p=n(25903),g=n(43874),f=n(26072),v=n(96374),A=n(5912),y=n(17712),C=n(59030),w=n(73767),I=n(9717),b=n(63744),S=n(51083),M=n(18276),N=n(48553),Y=n(64493),k=n(46222),P=n(52745),F=n(76023),T=n(79577);const D={root:"Ky16H_sV","button-text":"W01t9CIf",buttonText:"W01t9CIf",sticker:"c8lE3XW5",title:"wlwD1B1Q",description:"V8OCFHmp","is-ios":"IxW_z_r0",isIos:"IxW_z_r0","is-macos":"OFxKGCEJ",isMacos:"OFxKGCEJ"};var x=n(20021);const L=7*F.$,E=(0,o.ph)((0,i.EK)((e,{chatId:t})=>{const n=(0,c.hds)(e,t),o=n&&(n.isCreator||(0,d.ub)(n,"manageTopics"));return{animatedEmoji:(0,c.oei)(e,"🐣"),canManageTopics:o}})(({chatId:e,animatedEmoji:t,canManageTopics:n})=>{const{openCreateTopicPanel:s}=(0,i.ko)(),a=(0,C.A)(),{isMobile:r}=(0,g.Ay)(),d=(0,o.hb)(()=>{s({chatId:e})},[e,s]);return(0,x.FD)("div",{className:D.root,children:[(0,x.Y)("div",{className:D.sticker,children:t&&(0,x.Y)(T.A,{sticker:t,size:L})}),(0,x.Y)("h3",{className:D.title,dir:"auto",children:a("ChatList.EmptyTopicsTitle")}),(0,x.Y)("p",{className:(0,u.A)(D.description,D.centered),dir:"auto",children:a("ChatList.EmptyTopicsDescription")}),n&&(0,x.Y)(Y.A,{ripple:!r,fluid:!0,onClick:d,isRtl:a.isRtl,children:(0,x.Y)("div",{className:D.buttonText,children:a("ChatList.EmptyTopicsCreate")})})]})}));var B=n(27109),R=n(66414),O=n(4961),U=n(37661),K=n(73176),z=n(87894),V=n(39351),j=n(81642),J=n(38102),G=n(94189),$=n(22720),q=n(97046),H=n(24384);const W=(0,o.ph)((0,i.EK)((e,{chatId:t,topic:n,isSelected:o})=>{const i=(0,c.hds)(e,t),s=(0,c.O5q)(e,t,n.lastMessageId),{isOutgoing:a}=s||{},r=s&&(0,c.Y7C)(e,s),d=(0,c.C5H)(e,t,n.id,"typingStatus"),l=(0,c.GA4)(e,t,n.id),u=(0,c.Vw0)(e,t,n.id),h=Boolean(u?.lastReadInboxMessageId),m=(0,c.pSx)(e,t),{chatId:p,threadId:g}=(0,c.Xf0)(e)||{},f=s?.content.storyData,v=f&&(0,c.Msb)(e,f.peerId,f.id);return{chat:i,lastMessage:s,lastMessageSender:r,typingStatus:d,isChatMuted:i&&(0,B.If)(i,(0,c.K52)(e),(0,c.P5N)(e,i.id)),canDelete:(0,c.DBV)(e,t,n.id),withInterfaceAnimations:(0,c.PKK)(e),draft:l,...a&&s&&{lastMessageOutgoingStatus:(0,c.Tl2)(e,s)},canScrollDown:o&&i?.id===p&&g===n.id,wasTopicOpened:h,topics:m,lastMessageStory:v}})(({topic:e,isSelected:t,chatId:n,chat:s,isChatMuted:r,style:c,lastMessage:h,lastMessageStory:m,canScrollDown:p,lastMessageOutgoingStatus:g,observeIntersection:f,canDelete:v,lastMessageSender:A,animationType:w,withInterfaceAnimations:I,orderDiff:b,typingStatus:S,draft:N,wasTopicOpened:Y,topics:k,onReorderAnimationEnd:P})=>{const{openThread:F,deleteTopic:T,scrollMessageListToBottom:D,setViewForumAsMessages:L,updateTopicMutedState:E,openQuickPreview:B}=(0,i.ko)(),W=(0,C.A)(),[_,Q,Z]=(0,U.A)(),[X,ee,te]=(0,U.A)(),[ne,oe,ie]=(0,U.A)(),[se,ae,re]=(0,U.A)(),{isPinned:de,isClosed:ce,notifySettings:le}=e,ue=Boolean(le.mutedUntil||void 0===le.mutedUntil&&r),he=(0,y.A)(()=>{oe(),Q()}),me=(0,y.A)(()=>{T({chatId:s.id,topicId:e.id})}),pe=(0,y.A)(()=>{ae(),ee()}),ge=(0,y.A)(()=>{E({chatId:n,topicId:e.id,mutedUntil:a.Os5})}),{renderSubtitle:fe,ref:ve}=(0,K.A)({chat:s,chatId:n,lastMessage:h,draft:N,lastMessageSender:A,lastMessageTopic:e,observeIntersection:f,isTopic:!0,typingStatus:S,topics:k,statefulMediaContent:(0,d.FE)({story:m}),animationType:w,withInterfaceAnimations:I,orderDiff:b,onReorderAnimationEnd:P}),Ae=(0,y.A)(t=>{if(t.altKey)return t.preventDefault(),void B({id:n,threadId:e.id});F({chatId:n,threadId:e.id,shouldReplaceHistory:!0}),L({chatId:n,isEnabled:!1}),p&&D()}),ye=function({topic:e,chat:t,isChatMuted:n,wasOpened:s,canDelete:a,handleDelete:r,handleMute:c,handleUnmute:u}){const h=(0,V.A)(),m=(0,C.A)();return(0,o.Kr)(()=>{const{isPinned:o,notifySettings:p,isClosed:g,id:f}=e,v=t.id,{editTopic:A,toggleTopicPinned:y,markTopicRead:C,openChatInNewTab:w,openQuickPreview:I}=(0,i.ko)(),b=(0,d.l1)(t,e),S=t.isCreator||(0,d.ub)(t,"manageTopics"),M=l.OS&&{title:"Open in new tab",icon:"open-in-new-tab",handler:()=>{w({chatId:t.id,threadId:f})}},N={title:h("QuickPreview"),icon:"eye-outline",handler:()=>{I({id:v,threadId:f})}},Y=e.unreadCount||!s?{title:m("MarkAsRead"),icon:"readchats",handler:()=>{C({chatId:v,topicId:f})}}:void 0,k=S?o?{title:m("UnpinFromTop"),icon:"unpin",handler:()=>y({chatId:v,topicId:f,isPinned:!1})}:{title:m("PinToTop"),icon:"pin",handler:()=>y({chatId:v,topicId:f,isPinned:!0})}:void 0,P=n&&void 0===p.mutedUntil||p.mutedUntil?{title:m("ChatList.Unmute"),icon:"unmute",handler:u}:{title:`${m("ChatList.Mute")}...`,icon:"mute",handler:c},F=b?g?{title:m("lng_forum_topic_reopen"),icon:"reopen-topic",handler:()=>A({chatId:v,topicId:f,isClosed:!1})}:{title:m("lng_forum_topic_close"),icon:"close-topic",handler:()=>A({chatId:v,topicId:f,isClosed:!0})}:void 0,T=a?{title:m("lng_forum_topic_delete"),icon:"delete",destructive:!0,handler:r}:void 0;return(0,z.oE)([M,N,k,Y,P,F,T])},[e,t,n,s,h,m,a,r,c,u])}({topic:e,chat:s,isChatMuted:r,wasOpened:Y,canDelete:v,handleDelete:he,handleMute:pe,handleUnmute:ge});return(0,x.FD)($.A,{className:(0,u.A)("Fn34Vu_9","Chat",t&&"selected","chat-item-clickable"),onClick:Ae,style:c,href:l.OS?`#${(0,R.az)(n,"thread",e.id)}`:void 0,contextActions:ye,withPortalForMenu:!0,ref:ve,children:[(0,x.FD)("div",{className:"info",children:[(0,x.FD)("div",{className:"info-row",children:[(0,x.FD)("div",{className:(0,u.A)("title"),children:[(0,x.Y)(J.A,{topic:e,className:"oXJl4tra",observeIntersection:f}),(0,x.Y)("h3",{dir:"auto",className:"fullName",children:(0,O.A)(e.title)})]}),Boolean(le.mutedUntil)&&(0,x.Y)(M.A,{name:"muted"}),(0,x.Y)("div",{className:"separator"}),ce&&(0,x.Y)(M.A,{name:"lock-badge",className:"MB7Gomjn"}),h&&(0,x.Y)(j.A,{message:h,outgoingStatus:g})]}),(0,x.FD)("div",{className:"subtitle",children:[fe(),(0,x.Y)(H.A,{chat:s,isPinned:de,isMuted:ue,topic:e,wasTopicOpened:Y,topics:k,isSelected:t})]})]}),ne&&(0,x.Y)(G.A,{isOpen:_,onClose:Z,onCloseAnimationEnd:ie,confirmIsDestructive:!0,confirmHandler:me,text:W("lng_forum_topic_delete_sure"),confirmLabel:W("Delete")}),se&&(0,x.Y)(q.A,{isOpen:X,onClose:te,onCloseAnimationEnd:re,chatId:n,topicId:e.id})]})})),_=(0,o.ph)((0,i.EK)(e=>{const t=(0,c.nTw)(e).forumPanelChatId,n=t?(0,c.hds)(e,t):void 0,{chatId:o,threadId:i}=(0,c.Xf0)(e)||{},s=t?(0,c.xyP)(e,t):void 0;return{chat:n,currentTopicId:t===o?Number(i):void 0,withInterfaceAnimations:(0,c.PKK)(e),topicsInfo:s}},e=>(0,c.clw)(e))(({chat:e,currentTopicId:t,isOpen:n,isHidden:c,topicsInfo:F,onTopicSearch:T,onCloseAnimationEnd:D,onOpenAnimationStart:L,withInterfaceAnimations:B})=>{const{closeForumPanel:R,openChatWithInfo:O,loadTopics:U}=(0,i.ko)(),K=(0,o.li)(),z=(0,o.li)(),V=(0,o.li)(),{isMobile:j}=(0,g.Ay)(),J=e?.id;(0,o.vJ)(()=>{J&&!F&&U({chatId:J})},[F,J]);const[G,$]=(0,o.J0)(!1),q=(0,C.A)(),H=(0,y.A)(()=>{R()});(0,o.vJ)(()=>{B||n||D?.()},[B,n,D]);const _=(0,y.A)(()=>{e&&O({id:e.id,shouldReplaceHistory:!0})}),{observe:Q}=(0,A.BL)({rootRef:z,throttleMs:200});(0,A.mv)(V,Q,({isIntersecting:e})=>{$(!e)});const Z=(0,o.Kr)(()=>F?(0,d.CO)(Object.values(F.topicsById),F.orderedPinnedTopicIds).map(({id:e})=>e):[],[F]),{orderDiffById:X,getAnimationType:ee,onReorderAnimationEnd:te}=(0,I.A)(Z,e?.id),[ne,oe]=(0,v.A)(()=>{e&&U({chatId:e.id})},Z,!F?.totalCount||Z.length>=F.totalCount,a.iIc),ie=(0,o.li)(!1),se=n&&!c,ae=(0,w.A)(se);ae!==se&&(ie.current=!1),(0,f.A)({isActive:se,onBack:H}),(0,o.vJ)(()=>se?(0,h.A)(H):void 0,[H,se]),(0,o.vJ)(()=>{ae!==se&&(0,r.Uz)(()=>{if(!K.current)return;const e=(0,o.VK)();(0,p.j)(K.current,e),L?.(),se?(ie.current=!0,K.current.style.transform="none"):(ie.current=!1,K.current.style.transform="")})},[se,L,ae]),(0,o.vJ)(()=>{if(l.TF)return(0,m.wJ)(K.current,{selectorToPreventScroll:".chat-list",onSwipe:(e,t)=>t===(q.isRtl?m.ez.Left:m.ez.Right)&&(R(),!0)})},[R,q.isRtl]);const re=void 0===F;return(0,x.FD)("div",{ref:K,className:(0,u.A)("MlF2n1nb",G&&"SZ24u3cn",q.isRtl&&"Xs2y1fCE",!B&&"kmDMv6D8"),onTransitionEnd:n?void 0:D,children:[(0,x.FD)("div",{id:"TopicListHeader",className:"left-header",children:[(0,x.Y)(Y.A,{round:!0,size:"smaller",color:"translucent",onClick:H,ariaLabel:q("Close"),children:(0,x.Y)(M.A,{name:"close"})}),e&&(0,x.Y)(S.A,{noAvatar:!0,className:"Sf633zAP",chatId:e.id,onClick:_}),e&&(0,x.Y)(N.A,{chatId:e.id,threadId:s.l3,messageListType:"thread",canExpandActions:!1,isForForum:!0,isMobile:j,onTopicSearch:T})]}),e&&(0,x.Y)(b.A,{chatId:e.id}),(0,x.Y)("div",{className:"hGeb3TQJ"}),(0,x.FD)(k.A,{className:"chat-list custom-scroll",ref:z,items:ne,preloadBackwards:a.iIc,withAbsolutePositioning:!0,maxHeight:(Z?.length||0)*a.HGU,onLoadMore:oe,sensitiveArea:a.C$_,beforeChildren:(0,x.Y)("div",{ref:V,className:"ERz3fcar"}),children:[Boolean(ne?.length)&&function(){const n=Z.indexOf(ne[0]);return ne?.map((o,i)=>(0,x.Y)(W,{chatId:e.id,topic:F.topicsById[o],style:`top: ${(n+i)*a.HGU}px;`,isSelected:t===o,observeIntersection:Q,animationType:ee(o),orderDiff:X[o],onReorderAnimationEnd:te},o))}(),re&&!ne?.length&&(0,x.Y)(P.A,{},"loading")]}),!re&&1===ne?.length&&ne[0]===a.HxB&&(0,x.Y)(E,{chatId:J})]})}))},90423:(e,t,n)=>{n.d(t,{Ay:()=>r,j9:()=>l,zk:()=>d});var o=n(84051),i=n(63495),s=n(96454);const a=c();function r(e,t,n){const[i,r]=(0,o.J0)(Boolean(a&&document[a]));return(0,o.Nf)(()=>{const o=e.current,i=()=>{const e=Boolean(a&&document[a]);r(e),e?n?.(!1):t?.(!1),o instanceof HTMLVideoElement&&(o.controls=e)},s=()=>{r(!0),n&&n(!0)},d=()=>{r(!1),t&&t(!1)};return document.addEventListener("fullscreenchange",i,!1),document.addEventListener("webkitfullscreenchange",i,!1),document.addEventListener("mozfullscreenchange",i,!1),o&&(o.addEventListener("webkitbeginfullscreen",s,!1),o.addEventListener("webkitendfullscreen",d,!1)),()=>{document.removeEventListener("fullscreenchange",i,!1),document.removeEventListener("webkitfullscreenchange",i,!1),document.removeEventListener("mozfullscreenchange",i,!1),o&&(o.removeEventListener("webkitbeginfullscreen",s,!1),o.removeEventListener("webkitendfullscreen",d,!1))}},[]),a||s.pz?[i,()=>{var t;e.current&&(a||s.pz)&&!i&&((t=e.current).requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.webkitEnterFullscreen?t.webkitEnterFullscreen():t.mozRequestFullScreen&&t.mozRequestFullScreen(),r(!0))},()=>{e.current&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen(),r(!1))}]:[!1]}const d=()=>{const[e,t]=(0,o.J0)(!1);return(0,o.vJ)(()=>{const e=()=>{t(l())};let n;return i.Vq&&(window.tauri?.getCurrentWindow().then(e=>{e.isFullscreen().then(t)}),(async()=>{const e=await(window.tauri?.getCurrentWindow());n=await e.onResized(()=>{e.isFullscreen().then(t)})})()),document.addEventListener("fullscreenchange",e,!1),document.addEventListener("webkitfullscreenchange",e,!1),document.addEventListener("mozfullscreenchange",e,!1),()=>{n?.(),document.removeEventListener("fullscreenchange",e,!1),document.removeEventListener("webkitfullscreenchange",e,!1),document.removeEventListener("mozfullscreenchange",e,!1)}},[]),e};function c(){return void 0!==document.fullscreenElement?"fullscreenElement":void 0!==document.mozFullScreenElement?"mozFullScreenElement":void 0!==document.webkitFullscreenElement?"webkitFullscreenElement":""}function l(){const e=c();return Boolean(e&&document[e])}},90596:(e,t,n)=>{n.d(t,{A:()=>jn});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(90709),c=n(70636),l=n(26129),u=n(91048),h=n(56494),m=n(30708),p=n(63495),g=n(96454),f=n(87357),v=n(95807),A=n(48899),y=n(60343),C=n(80140),w=n(83868),I=n(41512),b=n(76023),S=n(4961),M=n(58734);function N(e){if(!e||1!==e.extendedMedia.length)return{photo:void 0,video:void 0};const t=e.extendedMedia[0],n="mediaType"in t;return{photo:n?t.duration?void 0:t:t.photo,video:n?t.duration?t:void 0:t.video}}var Y=n(43336),k=n(35127);function P(e,t){return e.reduce((e,t)=>e+t,t)}function F(e){const t={width:0,height:0};return e.forEach(({dimensions:e,sides:n})=>{2&n&&(t.width=e.width+e.x),4&n&&(t.height=e.height+e.y)}),t}function T(e,t,n,o){const i=function(e,t,n){const o=e[0].isOutgoing,i=(t?e[0].content.paidMedia.extendedMedia.map(e=>"mediaType"in e?e:e.photo||e.video):e.map(e=>(0,d.r_)(e).photo||(0,d.r_)(e).video)).filter(Boolean);return i.map(e=>{const t=(0,k.yA)({media:e,isOwn:o,isMobile:n});return t.width/t.height})}(n.messages,Boolean(n.isPaidMedia),o),s=function(e){return e.map(e=>e>1.2?"w":e<.8?"n":"q").join("")}(i),a=function(e){return e.reduce((e,t)=>t+e,1)/e.length}(i),r=i.length,c=i.some(e=>e>2),l=(0,b.w4)(e,!1,t,o);let u;const h={ratios:i,proportions:s,averageRatio:a,maxWidth:l,minWidth:100,maxHeight:l,spacing:2};return u=r>=5||c?function({ratios:e,averageRatio:t,maxWidth:n,minWidth:o,spacing:i,maxHeight:s=4*n/3}){const a=function(e,t){return e.map(e=>t>1.1?(0,Y.qE)(e,1,2.75):(0,Y.qE)(e,.6667,1))}(e,t),r=e.length,d=new Array(r),c=[],l=e=>{const t=[];let o=0;e.forEach(e=>{t.push(((e,t)=>{const o=P(a.slice(e,e+t),0);return(n-(t-1)*i)/o})(o,e)),o+=e}),c.push({lineCounts:e,heights:t})};for(let e=1;e!==r;++e){const t=r-e;e<=3&&t<=3&&l([e,t])}for(let e=1;e!==r-1;++e)for(let n=1;n!==r-e;++n){const o=r-e-n;e<=3&&n<=(t<.85?4:3)&&o<=3&&l([e,n,o])}for(let e=1;e!==r-1;++e)for(let t=1;t!==r-e;++t)for(let n=1;n!==r-e-t;++n){const o=r-e-t-n;e<=3&&t<=3&&n<=3&&o<=4&&l([e,t,n,o])}let u,h=0;for(let e=0;e{for(let e=1;e!==a;++e)if(n[e-1]>n[e])return 1.5;return 1})(),m=Math.abs(r-s)*d*l;(!u||m1.4&&t[1]-t[0]<.2?function(e){const{ratios:t,maxWidth:n,spacing:o,maxHeight:i}=e,s=Math.round(Math.min(n/t[0],Math.min(n/t[1],(i-o)/2)));return[{dimensions:{x:0,y:0,width:n,height:s},sides:11},{dimensions:{x:0,y:s+o,width:n,height:s},sides:14}]}(e):"ww"===n||"qq"===n?function(e){const{ratios:t,maxWidth:n,spacing:o,maxHeight:i}=e,s=(n-o)/2,a=Math.round(Math.min(s/t[0],Math.min(s/t[1],i)));return[{dimensions:{x:0,y:0,width:s,height:a},sides:13},{dimensions:{x:s+o,y:0,width:s,height:a},sides:7}]}(e):function(e){const{ratios:t,minWidth:n,maxWidth:o,spacing:i,maxHeight:s}=e,a=Math.round(1.5*n),r=Math.min(Math.round(Math.max(.4*(o-i),(o-i)/t[0]/(1/t[0]+1/t[1]))),o-i-a),d=o-r-i,c=Math.min(s,Math.round(Math.min(d/t[0],r/t[1])));return[{dimensions:{x:0,y:0,width:d,height:c},sides:13},{dimensions:{x:d+i,y:0,width:r,height:c},sides:7}]}(e)}(h):3===r?function(e){const{proportions:t}=e;return"n"===t[0]?function(e){const{maxHeight:t,spacing:n,ratios:o,maxWidth:i,minWidth:s}=e,a=t,r=Math.round(Math.min((t-n)/2,o[1]*(i-n)/(o[2]+o[1]))),d=a-r-n,c=Math.max(s,Math.round(Math.min((i-n)/2,Math.min(r*o[2],d*o[1])))),l=Math.min(Math.round(a*o[0]),i-n-c);return[{dimensions:{x:0,y:0,width:l,height:a},sides:13},{dimensions:{x:l+n,y:0,width:c,height:d},sides:3},{dimensions:{x:l+n,y:d+n,width:c,height:r},sides:6}]}(e):function(e){const{maxWidth:t,ratios:n,maxHeight:o,spacing:i}=e,s=t,a=Math.round(Math.min(s/n[0],.66*(o-i))),r=(t-i)/2,d=Math.min(o-a-i,Math.round(Math.min(r/n[1],r/n[2])));return[{dimensions:{x:0,y:0,width:s,height:a},sides:11},{dimensions:{x:0,y:a+i,width:r,height:d},sides:12},{dimensions:{x:r+i,y:a+i,width:s-r-i,height:d},sides:6}]}(e)}(h):function(e){const{proportions:t}=e;return"w"===t[0]?function({maxWidth:e,ratios:t,spacing:n,maxHeight:o,minWidth:i}){const s=e,a=Math.round(Math.min(s/t[0],.66*(o-n))),r=Math.round((e-2*n)/(t[1]+t[2]+t[3])),d=Math.max(i,Math.round(Math.min(.4*(e-2*n),r*t[1]))),c=Math.round(Math.max(Math.max(i,.33*(e-2*n)),r*t[3])),l=s-d-c-2*n,u=Math.min(o-a-n,r);return[{dimensions:{x:0,y:0,width:s,height:a},sides:11},{dimensions:{x:0,y:a+n,width:d,height:u},sides:12},{dimensions:{x:d+n,y:a+n,width:l,height:u},sides:4},{dimensions:{x:d+n+l+n,y:a+n,width:c,height:u},sides:6}]}(e):function({maxHeight:e,ratios:t,maxWidth:n,spacing:o,minWidth:i}){const s=e,a=Math.round(Math.min(s*t[0],.6*(n-o))),r=Math.round((e-2*o)/(1/t[1]+1/t[2]+1/t[3])),d=Math.round(r/t[1]),c=Math.round(r/t[2]),l=s-d-c-2*o,u=Math.max(i,Math.min(n-a-o,r));return[{dimensions:{x:0,y:0,width:a,height:s},sides:13},{dimensions:{x:a+o,y:0,width:u,height:d},sides:3},{dimensions:{x:a+o,y:d+o,width:u,height:c},sides:2},{dimensions:{x:a+o,y:d+c+2*o,width:u,height:l},sides:6}]}(e)}(h),{layout:u,containerStyle:F(u)}}var D=n(43874),x=n(10722),L=n(49746),E=n(21488),B=n(37661),R=n(5912),O=n(39351),U=n(17712),K=n(59030),z=n(39996),V=n(73767),j=n(14622),J=n(34201),G=n(9705),$=n(5130);let q;const H=new G.A;g.CM&&setTimeout(function(){q||(q=(0,$.U)(new Worker(new URL(n.p+n.u(520),n.b))),H.resolve())},4e3);var W=n(84947),_=n(37836);const Q=new Map;const Z=(0,_.nF)(function(e){const{updateChatDetectedLanguage:t}=(0,i.ko)(),n=Q.get(e);if(!n)return;const o=n.size;if(o<8)return;let s=0,a=0;const r=new Map;for(const e of n.values()){e.isTranslatable&&s++,e.detectedLanguage&&a++;const t=e.detectedLanguage;if(t){const e=r.get(t)||0;r.set(t,e+1)}}if(s/o<.3||a/s<.6)return;t({chatId:e,detectedLanguage:Array.from(r.entries()).sort(([,e],[,t])=>t-e)[0][0]})},1e3);var X=n(42211),ee=n(46275),te=n(64154),ne=n(66644),oe=n(50442),ie=n(43503),se=n(54464),ae=n(672);const re=3*b.$,de=Number(b.$),ce="data-is-document-group-hover";function le(e,t,n,s,a,r,d,c,l,u,h,m,p){const{updateDraftReplyInfo:f,sendDefaultReaction:v}=(0,i.ko)(),[A,y,C]=(0,B.A)(),[I,b,S]=(0,B.A)(),M=(0,o.li)(),N=(0,ae.A)(e=>{const t=h.current;if(!t)return;const{clientX:n,clientY:o}=e,{x:i,width:s,y:a,height:r}=t.getBoundingClientRect(),d=i+s/2,c=a+r/2,l=Math.abs(d-n){if(!g.TF||s||!a||u||!p?.())return;let e;return(0,oe.wJ)(t.current,{selectorToPreventScroll:".MessageList",excludedClosestSelector:".no-word-wrap",onSwipe:(t,n)=>n===oe.ez.Left&&(e||(e=Date.now()),b(),!0),onRelease:()=>{e&&a&&(f({replyToMsgId:n}),setTimeout(S,Math.max(0,150-(Date.now()-e))),e=void 0)}})},[t,s,n,b,S,a,u,p]),{handleMouseDown:s?void 0:function(e){(0,se.l)(e),c(e)},handleClick:function(t){if(s)e(t);else if(g.TF)return M.current?(clearInterval(M.current),M.current=void 0,void v({chatId:l,messageId:n})):void(M.current=setTimeout(()=>{M.current=void 0,function(e){if(g.Ni){const t=e.target;if(!t.classList.contains("text-content")&&!t.classList.contains("Message"))return;ie.A.getIsKeyboardVisible()?setTimeout(()=>{d(e)},350):d(e)}}(t)},200))},handleContextMenu:s?r?w.A:void 0:function(t){if(g.Ni){if(t.target.matches("a[href]")||u)return;t.preventDefault(),e()}else d(t)},handleDoubleClick:s?void 0:function(){!g.TF&&a&&f({replyToMsgId:n,replyToPeerId:void 0,quoteText:void 0,quoteOffset:void 0})},handleContentDoubleClick:g.TF?void 0:function(e){e.stopPropagation()},handleMouseMove:N,handleSendQuickReaction:function(e){e.stopPropagation(),v({chatId:l,messageId:n})},handleMouseLeave:function(e){(0,ne.YS)(C),m&&function(e){const t=he(e.currentTarget);t&&t.removeAttribute(ce)}(e)},isSwiped:I,isQuickReactionVisible:A,handleDocumentGroupMouseEnter:ue}}function ue(e){const t=he(e.currentTarget);t&&t.setAttribute(ce,"")}function he(e){let t=e;do{t=t.nextElementSibling}while(t&&!t.classList.contains("last-in-document-group"));return t}var me=n(65240),pe=n(21849),ge=n(87412),fe=n(55723),ve=n(80999),Ae=n(91930),ye=n(11217),Ce=n(62587),we=n(18276),Ie=n(86070),be=n(20021);function Se(e,t){const{width:n,height:o}=(0,b.mr)();return(0,be.FD)("div",{className:"embedded-thumb",children:[(0,be.Y)("img",{src:e,width:n,height:o,alt:"",className:"pictogram",draggable:!1}),t&&(0,be.Y)("span",{className:"protector"})]})}const Me=({story:e,sender:t,noUserColors:n,isProtected:s,observeIntersectionForLoading:a,onClick:r})=>{const{showNotification:l}=(0,i.ko)(),u=(0,K.A)(),h=(0,o.li)(),m=(0,R.Vz)(h,a),p=e&&"content"in e,g=e&&"isDeleted"in e,v=p&&Boolean(e.content.video),A=p?"Story":g?"ExpiredStory":"Loading",y=(0,Ce.A)(p&&(0,d.EN)(e,"pictogram"),!m),C=v?e.content.video.thumbnail?.dataUri:void 0,w=y||C,I=t?(0,c.F9)(u,t):void 0,b=(0,U.A)(()=>{e&&!g?r():l({message:u("StoryNotFound")})}),{handleClick:M,handleMouseDown:N}=(0,ye.Q)(b);return(0,be.FD)(Ie.A,{ref:h,peerColor:t?.color,noUserColors:n,shouldReset:!0,className:(0,f.A)("EmbeddedMessage",w&&"with-thumb"),onClick:M,onMouseDown:N,children:[w&&Se(w,s),(0,be.FD)("div",{className:"message-text with-message-color",children:[(0,be.FD)("p",{className:"embedded-text-wrapper",children:[g&&(0,be.Y)(we.A,{name:"story-expired",className:"embedded-origin-icon"}),p&&(0,be.Y)(we.A,{name:"story-reply",className:"embedded-origin-icon"}),u(A)]}),(0,be.Y)("div",{className:"message-title",children:(0,S.A)(I||" ")})]})]})};var Ne=n(2578),Ye=n(9267),ke=n(74936),Pe=n(17794),Fe=n(90603),Te=n(38102);var De=n(61911);const xe=1.125*b.$,Le=(0,o.ph)(({topic:e,className:t,onClick:n})=>{const o=(0,K.A)();return(0,be.FD)("div",{className:(0,f.A)("JldIqqof",t),style:`--topic-button-accent-color: var(${(0,Fe.Mt)(e?.iconColor)})`,onClick:n,children:[e?(0,be.Y)(Te.A,{topic:e,size:xe}):(0,be.Y)("img",{src:De,alt:"",draggable:!1}),e?.title?(0,S.A)(e.title):o("Loading"),e?.isClosed&&(0,be.Y)(we.A,{name:"lock"}),(0,be.Y)(we.A,{name:"next"})]})});var Ee=n(15006),Be=n(64493),Re=n(94189),Oe=n(40664);function Ue(e){return(0,o.ph)((0,i.EK)((e,t)=>{const{clickArg:n,noSelectControls:o}=t;return{isInSelectMode:!o&&(0,u.rTV)(e),isSelected:!o&&(0,u.H1_)(e,n)}})(t=>{const{isInSelectMode:n,isSelected:s,dimensions:a,clickArg:r}=t,{toggleMessageSelection:d}=(0,i.ko)(),c=(0,U.A)(e=>{e.stopPropagation(),d({messageId:r,withShift:e?.shiftKey})}),l=(0,o.Kr)(()=>{const{dimensions:e,onClick:o}=t;return{...t,isInSelectMode:n,isSelected:s,dimensions:{...e,x:0,y:0},onClick:n?void 0:o}},[t,n,s]);return(0,be.FD)("div",{className:(0,f.A)("album-item-select-wrapper",s&&"is-selected"),style:a?`left: ${a.x}px; top: ${a.y}px;`:"",onClick:n?c:void 0,children:[n&&(0,be.Y)("div",{className:"message-select-control",children:s&&(0,be.Y)(we.A,{name:"select"})}),(0,be.Y)(e,{...l})]})}))}var Ke=n(51644),ze=n(25477);const Ve=Ue(Ke.A),je=Ue(ze.A),Je=(0,i.EK)(e=>{const t=(0,u.SJA)(e),n=(0,u.yuw)(e);return{theme:t,uploadsByKey:e.fileUploads.byMessageKey,activeDownloads:n}})(({album:e,observeIntersection:t,hasCustomAppendix:n,isOwn:s,isProtected:a,albumLayout:r,onMediaClick:c,uploadsByKey:l,activeDownloads:h,theme:m})=>{const{cancelUploadMedia:p}=(0,i.ko)(),{content:{paidMedia:g}}=e.mainMessage,f=e.isPaidMedia?g.extendedMedia.length:e.messages.length,v=(0,U.A)(t=>{c(e.mainMessage.id,t)}),A=(0,U.A)(e=>{c(e)}),C=(0,U.A)(t=>{p({chatId:e.mainMessage.chatId,messageId:t})}),w=(0,o.Kr)(()=>e.isPaidMedia?e.mainMessage.content.paidMedia.extendedMedia.map(()=>e.mainMessage):e.messages,[e]),{width:I,height:b}=r.containerStyle;return(0,be.Y)("div",{className:"Album",style:`width: ${I}px; height: ${b}px;`,children:w.map(function(o,c){const p=e.isPaidMedia?o.content.paidMedia?.extendedMedia[c]:void 0,g=p&&"mediaType"in p?p:p?.photo,w=p&&"mediaType"in p?p:p?.video,I=g||(0,d.yl)(o),b=w||(0,d.r_)(o).video,S=l[(0,y.bj)(o)],M=S?.progress,{dimensions:N,sides:Y}=r.layout[c],k=(0,u.wwb)((0,i.mS)(),o),P=(0,u.OEt)((0,i.mS)(),o);if(I){const i=n&&(s?c===f-1:Boolean(8&Y&&4&Y));return(0,be.Y)(Ve,{id:`album-media-${(0,d.GZ)(o.id,e.isPaidMedia?c:void 0)}`,photo:I,isOwn:s,observeIntersectionForLoading:t,canAutoLoad:k,shouldAffectAppendix:i,uploadProgress:M,dimensions:N,isProtected:a,clickArg:e.isPaidMedia?c:o.id,onClick:e.isPaidMedia?v:A,onCancelUpload:C,isDownloading:"extendedMediaPreview"!==I.mediaType&&(0,d.$r)(h,I),theme:m,noSelectControls:e.isPaidMedia})}if(b)return(0,be.Y)(je,{id:`album-media-${(0,d.GZ)(o.id)}`,video:b,observeIntersectionForLoading:t,canAutoLoad:k,canAutoPlay:P,uploadProgress:M,dimensions:N,isProtected:a,clickArg:e.isPaidMedia?c:o.id,onClick:e.isPaidMedia?v:A,onCancelUpload:C,isDownloading:"extendedMediaPreview"!==b.mediaType&&(0,d.$r)(h,b),theme:m,noSelectControls:e.isPaidMedia})})})});var Ge=n(41733);const $e=7*b.$;function qe(e,t,n,s,a,r,d){const{interactWithAnimatedEmoji:c,sendEmojiInteraction:l,sendWatchingEmojiInteraction:u}=(0,i.ko)(),h=(0,o.li)(),m=(0,o.li)(),g=(0,Ce.A)(n?`document${n}`:void 0,!n),f=d||$e,A=(0,v.A)(`width: ${f}px`,`height: ${f}px`,r&&!p.Vq&&"cursor: pointer"),y=(0,o.li)(void 0),C=(0,o.li)(void 0),w=(0,U.A)(()=>{h.current&&(l({chatId:e,messageId:t,emoji:r,interactions:y.current}),C.current=void 0,y.current=void 0)}),I=(0,U.A)(()=>{const e=m.current;g&&(e&&(e.pause(),e.remove()),m.current=new Audio,m.current.src=g,(0,Ge.A)(m.current),m.current.addEventListener("ended",()=>{m.current=void 0},{once:!0}))}),b=(0,U.A)(()=>{I();const n=h.current;if(!(r&&n&&t&&e))return;const{x:o,y:i}=n.getBoundingClientRect();c({emoji:r,x:o,y:i,startSize:f,isReversed:!a}),y.current||(y.current=[],C.current=performance.now(),setTimeout(w,1e3)),y.current.push(C.current?(performance.now()-C.current)/1e3:0)});return(0,o.vJ)(()=>{const n=h.current;n&&s&&s.forEach(({id:o,startSize:i,messageId:s})=>{if(i||t!==s)return;const{x:d,y:c}=n.getBoundingClientRect();u({id:o,chatId:e,emoticon:r,startSize:f,x:d,y:c,isReversed:!a}),I()})},[s,e,r,a,t,I,u,f]),{ref:h,size:f,style:A,handleClick:b}}const He=(0,o.ph)((0,i.EK)((e,{customEmojiId:t,withEffects:n})=>{const o=(0,u.O8F)(e,t);return{sticker:o,effect:o?.emoji&&n?(0,u.Nr8)(e,o.emoji):void 0,soundId:o?.emoji&&(0,u.tKM)(e,o.emoji),noPlay:!(0,u.BWX)(e)}})(({isOwn:e,customEmojiId:t,messageId:n,chatId:o,activeEmojiInteractions:i,sticker:s,effect:a,soundId:r,noPlay:d,observeIntersection:c})=>{const{ref:l,size:u,style:h,handleClick:m}=qe(o,n,r,i,e,a?.emoji,(0,M.Rr)(1));return(0,be.Y)(ge.A,{ref:l,documentId:t,className:(0,f.A)("AnimatedEmoji media-inner",s?.id===b.AC&&"like-sticker-thumb"),style:h,size:u,isBig:!0,noPlay:d,withSharedAnimation:!0,forceOnHeavyAnimation:Boolean(a&&i?.length),observeIntersectionForLoading:c,onClick:m})}));var We=n(79577);const _e=(0,o.ph)((0,i.EK)((e,{emoji:t,withEffects:n})=>({sticker:(0,u.oei)(e,t),effect:n?(0,u.Nr8)(e,t):void 0,soundId:(0,u.tKM)(e,t)}))(({isOwn:e,observeIntersection:t,forceLoadPreview:n,messageId:o,chatId:i,activeEmojiInteractions:s,sticker:a,effect:r,soundId:d})=>{const{ref:c,size:l,style:u,handleClick:h}=qe(i,o,d,s,e,r?.emoji),m=(0,R.Vz)(c,t);return(0,be.Y)(We.A,{sticker:a,size:l,quality:1,noLoad:!m,forcePreview:n,play:m,forceAlways:!0,ref:c,className:(0,f.A)("AnimatedEmoji media-inner",a?.id===b.AC&&"like-sticker-thumb"),style:u,onClick:h})}));var Qe=n(14242),Ze=n(93809),Xe=n(68292),et=n(57474);const tt=(0,o.ph)(({isCustomShape:e,threadInfo:t,disabled:n,isLoading:s,asActionButton:a})=>{const{openThread:r,openFrozenAccountModal:d}=(0,i.ko)(),c=(0,Ze.A)([s],450),l=(0,K.A)(),h=(0,O.A)(),{originMessageId:m,chatId:p,messagesCount:g,lastMessageId:v,lastReadInboxMessageId:A,recentReplierIds:y,originChannelId:C}=t||{},w=(0,U.A)(()=>{const e=(0,i.mS)();m&&C&&((0,u.trm)(e)?d():r({isComments:!0,chatId:p,originMessageId:m,originChannelId:C}))}),I=(0,o.Kr)(()=>{if(!y?.length)return;const e=(0,i.mS)();return y.map(t=>(0,u.PVB)(e,t)).filter(Boolean)},[y]),b=Boolean(A&&v&&A"COMMENTS_COUNT"===e?(0,be.Y)(Xe.A,{text:(0,Qe.Vw)(h,g)}):e):void 0;return(0,be.FD)("div",{"data-cnt":(0,Qe.Vw)(h,g||0),className:(0,f.A)("CommentButton",b&&"has-unread",n&&"disabled",e&&"CommentButton-custom-shape",s&&"loading",a&&"as-action-button"),dir:h.isRtl?"rtl":"ltr",onClick:w,role:"button",tabIndex:0,children:[(0,be.Y)(we.A,{name:"comments-sticker",className:(0,f.A)("CommentButton_icon-comments",s&&c&&"CommentButton_hidden")}),!I?.length&&(0,be.Y)(we.A,{name:"comments"}),Boolean(I?.length)&&(0,be.Y)("div",{className:"recent-repliers",dir:h.isRtl?"rtl":"ltr",children:I.map(e=>(0,be.Y)(pe.A,{size:"small",peer:e},e.id))}),(0,be.Y)("div",{className:"label",dir:"auto",children:g?S:l("LeaveAComment")}),(0,be.FD)("div",{className:"CommentButton_right",children:[s&&(0,be.Y)(et.A,{className:(0,f.A)("CommentButton_loading",!c&&"CommentButton_hidden"),color:e?"white":"blue"}),(0,be.Y)(we.A,{name:"next",className:(0,f.A)("CommentButton_icon-open",s&&c&&"CommentButton_hidden")})]})]})});var nt=n(85982),ot=n(64713);const it="ReDHhQHm";function st(e){return e.firstName&&e.lastName?`${e.firstName} ${e.lastName}`:e.firstName?e.firstName:e.lastName?e.lastName:""}const at=(0,i.EK)((e,{contact:t})=>{const{countryList:{phoneCodes:n}}=e;return{user:(0,u.mBe)(e,t.userId),phoneCodeList:n}})(({contact:e,user:t,phoneCodeList:n,noUserColors:o})=>{const s=(0,K.A)(),{openChat:a,openAddContactDialog:r,showNotification:c,openChatWithInfo:l}=(0,i.ko)(),{phoneNumber:u,userId:h}=e,m="0"!==h,p=m&&t&&(0,d.Gh)(t),g=(0,U.A)(()=>{a({id:h})}),f=(0,U.A)(()=>{r({userId:t?.id})}),v=(0,U.A)(()=>{t?l({id:h}):((0,nt.eM)(u),c({message:s("PhoneCopied")}))});return(0,be.FD)(Ie.A,{noUserColors:o,peer:t,emojiIconClassName:"SjZYi3sJ",className:"AAHWWWvU",children:[(0,be.FD)("div",{className:"tpDpg82n",onClick:v,children:[(0,be.Y)(pe.A,{size:"medium",peer:t,text:st(e)}),(0,be.FD)("div",{className:"fpYynE5s",children:[(0,be.Y)("div",{className:"_PNTJc_V",children:t?(0,d.Yg)(t):st(e)}),(0,be.Y)("div",{className:"JP_3wes8",children:(0,ot.Ox)(n,u)})]})]}),m&&(0,be.FD)(be.FK,{children:[(0,be.Y)("div",{className:"_OSJcuqH"}),(0,be.FD)("div",{className:"Blui4M4G",children:[(0,be.Y)(Be.A,{isText:!0,color:"translucent",ripple:!0,size:"tiny",onClick:g,className:it,children:s("SharedContactMessage")}),p&&(0,be.Y)(Be.A,{isText:!0,color:"translucent",ripple:!0,size:"tiny",onClick:f,className:it,children:s("SharedContactAdd")})]})]})]})});var rt=n(80089),dt=n(80464);const ct=e=>{const{isOpen:t}=e,n=(0,dt.A)(rt.ar.Extra,"ContextMenuContainer",!t);return n?(0,be.Y)(n,{...e}):void 0};var lt=n(18501),ut=n(57675),ht=n(32581);const mt={type:"regular",color:0},pt=(0,o.ph)(({factCheck:e,isToggleDisabled:t})=>{const n=(0,K.A)(),i=(0,o.li)(),s=(0,o.li)(),{isCollapsed:a,isCollapsible:r,setIsCollapsed:d}=(0,ut.A)(i,4,s),c=(0,o.Kr)(()=>{if(e.countryCode&&n.code)return new Intl.DisplayNames([n.code],{type:"region"}).of(e.countryCode)},[e.countryCode,n.code]),l=!t&&a,u=(0,U.A)(()=>{d(!1)}),h=(0,U.A)(()=>{d(e=>!e)});if(e.text)return(0,be.FD)(Ie.A,{peerColor:mt,className:"HMB5LgeX",onClick:l?u:void 0,children:[(0,be.FD)("div",{ref:s,className:(0,f.A)("nfCzKu78",a&&"hYzpXwTM"),children:[(0,be.Y)("div",{className:"vZnCPl3t",children:n("FactCheck")}),(0,be.Y)("div",{ref:i,className:"k_dGolcu",children:(0,lt.fd)({text:e.text.text,entities:e.text.entities})}),(0,be.Y)(ht.A,{className:"qRaSs5iA"}),(0,be.Y)("div",{className:"EDmr0wJG",children:n("FactCheckFooter",c)})]}),r&&(0,be.Y)("div",{className:(0,f.A)("mxPizZpR",!t&&"Cj2cLczd"),onClick:t?void 0:h,"aria-hidden":!0,children:(0,be.Y)(we.A,{name:a?"down":"up"})})]})});var gt=n(55158);const ft=(0,o.ph)(({message:e,threadId:t,canAutoLoadMedia:n})=>{const{clickBotInlineButton:o}=(0,i.ko)(),s=e.content.game,{title:a,description:r}=s,c=(0,d.zb)(s),l=(0,d.ih)(s),u=(0,Ce.A)(c,!n),h=(0,Ce.A)(l,!n);return(0,be.FD)("div",{className:"Game",children:[(0,be.FD)("div",{className:"preview",style:"width: 480px; height: 270px",onClick:()=>{o({chatId:e.chatId,messageId:e.id,threadId:t,button:e.inlineButtons[0][0]})},children:[!u&&!h&&(0,be.Y)(gt.A,{className:"skeleton preview-content"}),u&&(0,be.Y)("img",{className:"preview-content",src:u,alt:a,draggable:!1}),h&&(0,be.Y)("video",{className:"preview-content",playsInline:!0,muted:!0,disablePictureInPicture:!0,autoPlay:!0,loop:!0,src:h})]}),(0,be.Y)("div",{className:"title",children:a}),!(0,d.P5)(e)&&(0,be.Y)("div",{className:"description",children:r})]})});var vt=n(17663),At=n(52491),yt=n(4875),Ct=n(58443),wt=n(64489),It=n(10187);const bt="ogvcv3mr",St="MSFa9BPf",Mt="HfZ6SuLI",Nt="rPyyNYxK",Yt="FV70u896",kt=(0,o.ph)((0,i.EK)((e,{message:t})=>{const{giveaway:n}=t.content,o=(0,u.hds)(e,t.chatId);return{chat:o,sender:(n?.channelIds[0]?(0,u.hds)(e,n.channelIds[0]):void 0)||(0,u.Szq)(e,t)||o,giftSticker:n&&(0,u.t0O)(e,n.months),canPlayAnimatedEmojis:(0,u.BWX)(e)}})(({chat:e,sender:t,message:n,canPlayAnimatedEmojis:s,giftSticker:a})=>{const{openChat:r}=(0,i.ko)(),l=(0,o.li)(!1),[u,h]=(0,o.J0)(),m=(0,K.A)(),{giveaway:p,giveawayResults:g}=n.content,v=Boolean(g),{months:A,untilDate:y,prizeDescription:w,stars:I}=p||g,b=(0,d.Ie)(n),M=v?g.winnersCount:p.quantity,N=(0,C.Fm)()>y,Y=(0,o.Kr)(()=>{if(v)return;const e=new Intl.DisplayNames([m.code,"en"].filter(Boolean),{type:"region"});return p?.countries?.map(t=>`${(0,At.D0)(t)} ${e.of(t)}`).join(", ")},[p,v,m.code]),k=(0,U.A)(e=>{r({id:e})}),P=(0,U.A)(async()=>{if(l.current)return;l.current=!0;const t=await(0,yt.px)("fetchGiveawayInfo",{peer:e,messageId:n.id});h(t),l.current=!1}),F=(0,U.A)(()=>{h(void 0)}),T=(0,o.Kr)(()=>{if(u)return m("results"===u.type?"BoostingGiveawayEnd":"BoostingGiveAwayAbout")},[u,m]);return(0,be.FD)("div",{className:"CbpKtOey",children:[(0,be.FD)("div",{className:(0,f.A)("hjjKhvVv",v&&"JEiR48jJ"),children:[v?(0,be.Y)(wt.A,{size:150,tgsUrl:Ct.w.PartyPopper,nonInteractive:!0,noLoop:!0}):(0,be.Y)(We.A,{sticker:a,play:s&&N,noLoop:!0,nonInteractive:!0,size:175}),(0,be.Y)("span",{className:"n_QCMv_A",children:`x${M}`})]}),v?function(e){const t=e.winnerIds;return(0,be.FD)(be.FK,{children:[(0,be.FD)("div",{className:St,children:[(0,be.Y)("strong",{className:bt,children:(0,S.A)(m("BoostingGiveawayResultsMsgWinnersSelected"),["simple_markdown"])}),(0,be.Y)("p",{className:Mt,children:(0,S.A)(m("BoostingGiveawayResultsMsgWinnersTitle",t.length),["simple_markdown"])}),(0,be.Y)("strong",{className:bt,children:m("lng_prizes_results_winners")}),(0,be.Y)("div",{className:Nt,children:t.map(e=>(0,be.Y)(It.A,{peerId:e,forceShowSelf:!0,withPeerColors:!b,className:Yt,clickArg:e,onClick:k}))})]}),(0,be.Y)("div",{className:St,children:(0,be.Y)("p",{className:Mt,children:m("BoostingGiveawayResultsMsgAllWinnersReceivedLinks")})})]})}(g):function(e){const t=e.channelIds;return(0,be.FD)(be.FK,{children:[(0,be.FD)("div",{className:St,children:[(0,be.Y)("strong",{className:bt,children:(0,S.A)(m("BoostingGiveawayPrizes"),["simple_markdown"])}),w&&(0,be.FD)(be.FK,{children:[(0,be.Y)("p",{className:Mt,children:(0,S.A)(m("BoostingGiveawayMsgPrizes",[M,w],void 0,M),["simple_markdown"])}),(0,be.Y)(ht.A,{children:m("BoostingGiveawayMsgWithDivider")})]}),(0,be.Y)("p",{className:Mt,children:n?.content?.giveaway?.stars?(0,be.FD)(be.FK,{children:[(0,S.A)(m("Chat.Giveaway.Message.Stars.PrizeText",m("Stars",n?.content?.giveaway?.stars)),["simple_markdown"]),(0,be.Y)("br",{}),(0,S.A)(m("AmongWinners",M),["simple_markdown"])]}):(0,be.FD)(be.FK,{children:[(0,S.A)(m("Chat.Giveaway.Info.Subscriptions",M),["simple_markdown"]),(0,be.Y)("br",{}),(0,S.A)(m("ActionGiftPremiumSubtitle",m("Chat.Giveaway.Info.Months",A)),["simple_markdown"])]})})]}),(0,be.FD)("div",{className:St,children:[(0,be.Y)("strong",{className:bt,children:(0,S.A)(m("BoostingGiveawayMsgParticipants"),["simple_markdown"])}),(0,be.Y)("p",{className:Mt,children:(0,S.A)(m("BoostingGiveawayMsgAllSubsPlural",t.length),["simple_markdown"])}),(0,be.Y)("div",{className:Nt,children:t.map(e=>(0,be.Y)(It.A,{peerId:e,forceShowSelf:!0,withPeerColors:!b,className:Yt,clickArg:e,onClick:k}))}),Y&&(0,be.Y)("span",{children:(0,S.A)(m("Chat.Giveaway.Message.CountriesFrom",Y))})]}),(0,be.FD)("div",{className:St,children:[(0,be.Y)("strong",{className:bt,children:(0,S.A)(m("BoostingWinnersDate"),["simple_markdown"])}),(0,be.Y)("p",{className:Mt,children:(0,vt.L2)(1e3*y,m.code,!0)})]})]})}(p),(0,be.Y)(Be.A,{className:"jMBw7STU",color:"adaptive",onClick:P,children:m("BoostingHowItWork")}),(0,be.Y)(Re.A,{isOpen:Boolean(u),isOnlyConfirm:!0,title:T,confirmHandler:F,onClose:F,children:function(){if(!t||!u)return;const e="results"===u.type,n=(0,c.vj)(t)?(0,d.Js)(m,t):(0,d.Yg)(t),o=(0,vt.U)(m,1e3*y),s=p?.channelIds?p.channelIds.length-1:0,a=m("Chat.Giveaway.Info.OtherChannels",s),r=s>0,l=e?"BoostingGiveawayHowItWorksTextEnd":"BoostingGiveawayHowItWorksText",h=e?m("Chat.Giveaway.Info.Months",A):m("Stars",I,"i"),g=m(l,[n,M,h],void 0,M),f=w?m("BoostingGiveawayHowItWorksIncludeText",[n,M,w],void 0,M):void 0;let v="";v=e?r?"BoostingGiveawayHowItWorksSubTextSeveralEnd":"BoostingGiveawayHowItWorksSubTextEnd":r?"BoostingGiveawayHowItWorksSubTextSeveral":"BoostingGiveawayHowItWorksSubText";let C=m(v,[o,M,n,s],void 0,M);e&&u.activatedCount&&(C+=` ${m("BoostingGiveawayUsedLinksPlural",u.activatedCount)}`);let b="";e&&(b=u.isRefunded?m("BoostingGiveawayCanceledByPayment"):m(u.isWinner?"BoostingGiveawayYouWon":"BoostingGiveawayYouNotWon"));let N="";if(e);else if(u.disallowedCountry)N=m("BoostingGiveawayNotEligibleCountry");else if(u.adminDisallowedChatId){const e=(0,i.mS)().chats.byId[u.adminDisallowedChatId],t=e&&(0,d.Js)(m,e);N=m("BoostingGiveawayNotEligibleAdmin",t)}else if(u.joinedTooEarlyDate){const e=(0,vt.U)(m,1e3*u.joinedTooEarlyDate);N=m("BoostingGiveawayNotEligible",e)}else N=u.isParticipating?r?m("Chat.Giveaway.Info.ParticipatingMany",[n,s]):m("Chat.Giveaway.Info.Participating",n):r?m("Chat.Giveaway.Info.NotQualifiedMany",[n,a,o]):m("Chat.Giveaway.Info.NotQualified",[n,o]);return(0,be.FD)(be.FK,{children:[b&&(0,be.Y)("p",{className:"ZQ4aVVkI",children:(0,S.A)(b,["simple_markdown"])}),(0,be.Y)("p",{children:(0,S.A)(g,["simple_markdown"])}),f&&(0,be.Y)("p",{children:(0,S.A)(f,["simple_markdown"])}),(0,be.Y)("p",{children:(0,S.A)(C,["simple_markdown"])}),N&&(0,be.Y)("p",{children:(0,S.A)(N,["simple_markdown"])})]})}()})]})}));var Pt=n(85449);const Ft=(0,o.ph)(({message:e,onClick:t})=>{const n=(0,K.A)(),i=e=>{const{type:t}=e;switch(t){case"url":{const{url:t}=e;return t.startsWith(r.jsp)&&t.includes("?startapp")?(0,be.Y)(we.A,{className:"corner-icon",name:"webapp"}):r.OFc.test(t)?void 0:(0,be.Y)(we.A,{className:"corner-icon",name:"arrow-right"})}case"urlAuth":return(0,be.Y)(we.A,{className:"corner-icon",name:"arrow-right"});case"buy":case"receipt":return(0,be.Y)(we.A,{className:"corner-icon",name:"card"});case"switchBotInline":return(0,be.Y)(we.A,{className:"corner-icon",name:"share-filled"});case"webView":case"simpleWebView":return(0,be.Y)(we.A,{className:"corner-icon",name:"webapp"});case"copy":return(0,be.Y)(we.A,{className:"corner-icon",name:"copy"});case"suggestedMessage":if("suggestChanges"===e.buttonType)return(0,be.Y)(we.A,{className:"left-icon",name:"edit"});if("approve"===e.buttonType)return(0,be.Y)(we.A,{className:"left-icon",name:"check"});if("decline"===e.buttonType)return(0,be.Y)(we.A,{className:"left-icon",name:"close"})}},s=(0,o.Kr)(()=>{const t=[];return e.inlineButtons.forEach(e=>{t.push(e.map(e=>(0,Pt.A)(n,e)))}),t},[n,e.inlineButtons]);return(0,be.Y)("div",{className:"InlineButtons",children:e.inlineButtons.map((n,o)=>(0,be.Y)("div",{className:"row",children:n.map((n,a)=>(0,be.FD)(Be.A,{size:"tiny",ripple:!0,disabled:"unsupported"===n.type||"suggestedMessage"===n.type&&n.disabled,onClick:()=>t({chatId:e.chatId,messageId:e.id,button:n}),children:[i(n),(0,be.Y)("span",{className:"inline-button-text",children:s[o][a]})]}))}))})});var Tt=n(17142),Dt=n(40435),xt=n(37859),Lt=n(61097);const Et=(0,o.ph)(({message:e,shouldAffectAppendix:t,isInSelectMode:n,isSelected:i,theme:s,forcedWidth:a})=>{const c=(0,o.li)(),l=(0,K.A)(),u=(0,O.A)(),h=(0,d.NO)(e),{title:m,description:p,amount:g,currency:f,isTest:A,photo:y}=h,C=(0,Ce.A)((0,d.cy)(y)),w=Boolean(a),I=(0,Lt.A)(C,!w),b=e.id;(0,xt.A)(([e])=>{if(t){if(C){const e=c.current.closest(r.KFG);(0,Dt.A)(C,!1,b,i,s).then(t=>{(0,ne.RK)(()=>{e.style.setProperty("--appendix-bg",t),e.setAttribute(r.D3G,"")})})}}else e&&c.current.closest(r.KFG).removeAttribute(r.D3G)},[t,C,n,i,s,b]);const M=a||y?.dimensions?.width,N=(0,v.A)(y?.dimensions&&`width: ${M}px`,y?.dimensions&&`aspect-ratio: ${y.dimensions.width} / ${y.dimensions.height}`,Boolean(!y?.dimensions&&a)&&`width: ${a}px`);return(0,be.FD)("div",{ref:c,className:"Invoice",children:[m&&(0,be.Y)("p",{className:"title",children:(0,S.A)(m)}),p&&(0,be.Y)("div",{className:"info",children:(0,S.A)(p,["emoji","br"])}),(0,be.FD)("div",{className:"description "+(y?"has-image":""),children:[Boolean(y)&&(0,be.FD)("div",{className:"invoice-image-container",children:[w&&(0,be.Y)("canvas",{ref:I,className:"thumbnail blurred-bg"}),C&&(0,be.Y)("img",{className:"invoice-image",src:C,alt:"",style:N,crossOrigin:"anonymous",draggable:!1}),!C&&y&&(0,be.Y)(gt.A,{width:M,height:y.dimensions?.height,forceAspectRatio:!0})]}),(0,be.FD)("p",{className:"description-text",children:[(0,Tt.vv)(u,g,f,{iconClassName:"invoice-currency-icon"}),A&&(0,be.Y)("span",{className:"test-invoice",children:l("PaymentTestInvoice")})]})]})]})});var Bt=n(32625),Rt=n(27860);const Ot={root:"dCK8GQ_8",duration:"CWT8ZMwV",buy:"C38zhCDM",spoiler:"CG55VZP1"},Ut=(0,o.ph)(({message:e,isConnected:t})=>{const{openInvoice:n,loadExtendedMedia:o}=(0,i.ko)(),s=(0,K.A)(),a=(0,d.NO)(e),{chatId:r,id:c}=e,l=(0,U.A)(()=>{o({chatId:r,ids:[c]})});(0,Bt.A)(l,t?3e4:void 0);const{amount:u,currency:h,extendedMedia:m}=a,{width:p,height:g,thumbnail:v,duration:A}=m,y=(0,U.A)(()=>{n({type:"message",chatId:r,messageId:c,isExtendedMedia:!0})});return(0,be.FD)("div",{className:(0,f.A)(Ot.root,"media-inner"),onClick:y,children:[(0,be.Y)(Rt.A,{thumbDataUri:v?.dataUri,width:p,height:g,isVisible:!0,className:Ot.spoiler}),Boolean(A)&&(0,be.Y)("div",{className:Ot.duration,children:(0,vt.QO)(A)}),(0,be.FD)("div",{className:Ot.buy,children:[(0,be.Y)(we.A,{name:"lock",className:Ot.lock}),s("Checkout.PayPrice",(0,Tt.Ad)(u,h))]})]})});var Kt=n(47526),zt=n(14737),Vt=n(30857),jt=n(38691);const Jt=n.p+"map-pin.899635f6fe777c28998a.svg",Gt=24*Math.PI,$t=1e-4,qt={width:400,height:300,zoom:16};function Ht(){return(0,be.FD)("svg",{className:"round-pin",style:"enable-background:new 0 0 64 64",viewBox:"0 0 64 64",children:[(0,be.Y)("circle",{cx:"32",cy:"32",r:"24.5"}),(0,be.Y)("path",{d:"M32 8c13.23 0 24 10.77 24 24S45.23 56 32 56 8 45.23 8 32 18.77 8 32 8m0-1C18.19 7 7 18.19 7 32s11.19 25 25 25 25-11.19 25-25S45.81 7 32 7z"}),(0,be.Y)("path",{d:"m29.38 57.67-1.98-1.59 3.02-1.66L32 51.54l1.58 2.88 3.02 1.66-1.91 1.53L32 60.73z"}),(0,be.Y)("path",{d:"m32 52.58 1.07 1.95.14.26.26.14 2.24 1.22-1.33 1.06-.07.06-.06.07L32 59.96l-2.24-2.61-.06-.07-.07-.06-1.33-1.06 2.24-1.22.26-.14.14-.26L32 52.58m0-2.08-1.94 3.56L26.5 56l2.5 2 3 3.5 3-3.5 2.5-2-3.56-1.94L32 50.5z"})]})}const Wt=(0,o.ph)(({message:e,peer:t})=>{const{openMapModal:n}=(0,i.ko)(),s=(0,o.li)(),a=(0,o.li)(),r=(0,K.A)(),c=(0,Vt.A)(),l=(0,d.fB)(e),{mediaType:u,geo:h}=l,m=(0,C.Fm)(),p=(0,d.vz)(e),g="geoLive"!==u||p?void 0:e.date+l.period-m,[v,A]=(0,o.J0)(h),y="venue"===u||"geoLive"===u&&!p,{width:w,height:I,zoom:b}=qt,S=(0,jt.A)(),M=(0,d.rt)(v,w,I,b,S),N=(0,Ce.A)(M),Y=(0,V.A)(N,!0),k=N||Y,P=(0,o.Kr)(()=>{if("geoLive"!==u||!v.accuracyRadius)return 0;const{lat:e,accuracyRadius:t}=v;return t/(0,Kt._u)(e,b)},[u,v,b]),F=(0,U.A)(t=>{if("geoLive"!==u)return;const n=t.lastElementChild,o=t.firstElementChild,i=e.date+l.period-(0,C.Fm)(),s=(1-i/l.period)*Gt,a=(0,vt.dq)(r,1e3*i);o.textContent=a,n.firstElementChild.setAttribute("stroke-dashoffset",`-${s}`)});function T(){const e=(0,f.A)("pin",u,p&&"expired");if("geoLive"===u)return(0,be.FD)("div",{className:e,children:[(0,be.Y)(Ht,{}),(0,be.Y)(pe.A,{peer:t,className:"location-avatar"}),void 0!==l.heading&&(0,be.Y)("div",{className:"direction",style:`--direction: ${l.heading}deg`})]});if("venue"===u){const t=(0,Kt.PP)(l.venueType),n=(0,Kt.KE)(l.venueType);if(n)return(0,be.FD)("div",{className:e,style:`--pin-color: ${t}`,children:[(0,be.Y)(Ht,{}),(0,be.Y)("img",{src:n,draggable:!1,className:"venue-icon",alt:""})]})}return(0,be.Y)("img",{className:e,draggable:!1,src:Jt,alt:""})}return(0,o.Nf)(()=>{a.current&&F(a.current)},[F]),(0,o.vJ)(()=>{Math.abs(h.lat-v.lat)<$t&&Math.abs(h.long-v.long)<$t?v.accuracyRadius!==h.accuracyRadius&&A({...v,accuracyRadius:h.accuracyRadius}):A(h)},[h,v]),(0,zt.A)(()=>{c()},p?void 0:1e3*(g||0)),(0,Bt.A)(()=>{(0,ne.RK)(()=>{const e=a.current;e&&F(e)})},g?1e3:void 0),(0,be.FD)("div",{ref:s,className:"Location media-inner interactive",onClick:()=>{n({geoPoint:v,zoom:b})},children:[(0,be.FD)("div",{className:"map-wrapper",children:[k?(0,be.Y)("img",{className:"full-media map",src:k,alt:"Location on a map",draggable:!1,style:`width: ${qt.width}px; height: ${qt.height}px;`}):(0,be.Y)(gt.A,{width:w,height:I}),function(){if(k)return(0,be.FD)(be.FK,{children:[Boolean(P)&&!p&&(0,be.Y)("div",{className:"location-accuracy",style:`width: ${2*P}px; height: ${2*P}px`}),T()]})}()]}),function(){if(y)return"venue"===u?(0,be.FD)("div",{className:"location-info",children:[(0,be.Y)("div",{className:"location-info-title",children:l.title}),(0,be.Y)("div",{className:"location-info-subtitle",children:l.address})]}):"geoLive"===u?(0,be.FD)("div",{className:"location-info",children:[(0,be.Y)("div",{className:"location-info-title",children:r("AttachLiveLocation")}),(0,be.Y)("div",{className:"location-info-subtitle",children:(0,vt.IF)(r,m,e.editDate)}),!p&&(0,be.FD)("div",{className:"geo-countdown",ref:a,children:[(0,be.Y)("span",{className:"geo-countdown-text"}),(0,be.Y)("svg",{width:"32px",height:"32px",children:(0,be.Y)("circle",{cx:"16",cy:"16",r:12,className:"geo-countdown-progress",transform:"rotate(-90, 16, 16)","stroke-dasharray":Gt,"stroke-dashoffset":"0"})})]})]}):void 0}()]})});var _t=n(48906),Qt=n(97676),Zt=n(48775),Xt=n(45);const en=(0,o.ph)(({message:e,outgoingStatus:t,signature:n,withReactionOffset:s,repliesThreadInfo:a,renderQuickReactionButton:r,noReplies:d,isTranslated:c,isPinned:l,withFullDate:u,effectEmoji:h,onClick:m,onTranslationClick:p,onEffectClick:g,onOpenThread:v,paidMessageStars:A})=>{const{showNotification:y}=(0,i.ko)(),[C,w]=(0,B.A)(),I=(0,K.A)(),b=(0,O.A)();function M(e){e.stopPropagation(),y({message:{key:"ImportedInfo"}})}const N=(0,o.Kr)(()=>{if(!C)return;const t=(0,vt.L2)(1e3*e.date,I.code,void 0,I.timeFormat),n=e.isEdited&&(0,vt.L2)(1e3*e.editDate,I.code,void 0,I.timeFormat),o=e.forwardInfo&&(0,vt.L2)(1e3*(e.forwardInfo.savedDate||e.forwardInfo.date),I.code,void 0,I.timeFormat);let i=t;return n&&(i+="\n",i+=b("MessageTooltipEditedDate",{date:n})),o&&(i+="\n",i+=b("MessageTooltipForwardedDate",{date:o})),i},[C,I,e,I.timeFormat]),Y=(0,o.Kr)(()=>{if(!e.viewsCount)return;let t=b("MessageTooltipViews",{count:b.number(e.viewsCount)},{pluralValue:e.viewsCount});return e.forwardsCount&&(t+="\n",t+=b("MessageTooltipForwards",{count:b.number(e.forwardsCount)},{pluralValue:e.forwardsCount})),t},[b,e.forwardsCount,e.viewsCount]),k=(0,o.Kr)(()=>{const e=a?.messagesCount;if(e)return b("MessageTooltipReplies",{count:e},{pluralValue:e})},[b,a]),P=(0,o.Kr)(()=>{const t=(0,vt.fU)(I,1e3*e.date);return u?(0,vt.be)(I,1e3*(e.forwardInfo?.date||e.date),!0):t},[I,e.date,e.forwardInfo?.date,u]),F=(0,f.A)("MessageMeta",s&&"reactions-offset",e.forwardInfo?.isImported&&"is-imported");return(0,be.FD)("span",{className:F,dir:b.isRtl?"rtl":"ltr",onClick:m,"data-ignore-on-paste":!0,children:[h&&(0,be.Y)("span",{className:"message-effect-icon",onClick:g,children:(0,S.A)(h)}),c&&(0,be.Y)(we.A,{name:"language",className:"message-translated",onClick:p}),Boolean(e.viewsCount)&&(0,be.FD)(be.FK,{children:[(0,be.Y)("span",{className:"message-views",title:Y,children:(0,Qe.Vw)(b,e.viewsCount)}),(0,be.Y)(we.A,{name:"channelviews"})]}),!d&&Boolean(a?.messagesCount)&&(0,be.FD)("span",{onClick:function(e){e.stopPropagation(),v()},className:"message-replies-wrapper",title:k,children:[(0,be.Y)("span",{className:"message-replies",children:(0,be.Y)(Xe.A,{text:(0,Qe.Vw)(b,a.messagesCount)})}),(0,be.Y)(we.A,{name:"reply-filled"})]}),l&&(0,be.Y)(we.A,{name:"pinned-message",className:"message-pinned"}),n&&(0,be.Y)("span",{className:"message-signature",children:(0,S.A)(n)}),Boolean(A)&&(0,be.Y)("span",{className:"message-price",children:(0,Zt.U2)(b,A,{asFont:!0,className:"message-price-star-icon",containerClassName:"message-price-stars-container"})}),(0,be.FD)("span",{className:"message-time",title:N,onMouseEnter:w,children:[e.forwardInfo?.isImported&&(0,be.FD)(be.FK,{children:[(0,be.Y)("span",{className:"message-imported",onClick:M,children:(0,vt.L2)(1e3*e.forwardInfo.date,b.code,!0)}),(0,be.Y)("span",{className:"message-imported",onClick:M,children:b("MessageMetaImported")})]}),e.isEdited&&`${b("MessageMetaEdited")} `,e.isVideoProcessingPending&&`${b("MessageMetaApproximate")} `,P]}),t&&(0,be.Y)(Xt.A,{status:t}),r&&r()]})});var tn=n(4262);const nn=(0,o.ph)(({phoneCall:e,message:t,chatId:n})=>{const{requestMasterAndRequestCall:s}=(0,i.ko)(),a=(0,K.A)(),{isVideo:r,reason:d,duration:c}=e,l=t.isOutgoing,u="missed"===d,h="busy"===d||void 0===c,m=(0,U.A)(()=>{s({isVideo:r,userId:n})}),p=(0,o.Kr)(()=>e.duration?(0,vt.zA)(a,e.duration):void 0,[a,e.duration]),v=(0,vt.fU)(a,1e3*t.date);return(0,be.FD)("div",{className:"wqsZyy8u",children:[(0,be.Y)(Be.A,{size:"smaller",color:"translucent",round:!0,ripple:!0,onClick:m,className:"NGmo4ADz",disabled:!g.OL,ariaLabel:a(l?"CallAgain":"CallBack"),children:(0,be.Y)(we.A,{name:r?"video-outlined":"phone"})}),(0,be.FD)("div",{className:"iFn6m6hd",children:[(0,be.Y)("div",{className:"l8QfocIQ",children:a((0,tn.fB)(e,t.isOutgoing))}),(0,be.FD)("div",{className:"rF5tkx92",children:[(0,be.Y)(we.A,{name:"arrow-right",className:(0,f.A)("ONmpzmUS",u&&"Alra_BWu",h&&"J7xsuCAm",!l&&"BfgDXljM")}),(0,be.Y)("span",{className:"kKPKwFzu",children:p?a("CallMessageWithDuration",[v,p]):v})]})]})]})});var on=n(98607);const sn=(0,o.ph)(({paidMedia:e,chatId:t,messageId:n,isOutgoing:s,children:a})=>{const{openInvoice:d}=(0,i.ko)(),c=(0,K.A)(),l=(0,O.A)(),u=!e.isBought,h=(0,o.Kr)(()=>{const t=c("UnlockPaidContent",e.starsAmount);return(0,on.i)(t,r.Cyx,(0,be.Y)(Ye.A,{className:"ywiOugiH",type:"gold",size:"adaptive"}))},[c,e]),m=(0,U.A)(e=>{d({type:"message",chatId:t,messageId:n}),(0,w.A)(e)});return(0,be.FD)("div",{className:"mVaSjZRJ",onClick:u?m:void 0,children:[a,u&&(0,be.Y)(Be.A,{className:"GnKGu6D9",color:"dark",size:"tiny",fluid:!0,pill:!0,children:(0,be.Y)("span",{className:"gLaaVQXr",children:h})}),e.isBought&&(0,be.Y)("div",{className:(0,f.A)("message-paid-media-status","IGXW5hWr"),children:s?(0,Zt.U2)(l,e.starsAmount):c("Chat.PaidMedia.Purchased")})]})});var an=n(26875),rn=n(77561),dn=n(1087);function cn(e,t){return t>0?(e/t*100).toFixed():0}const ln=({answer:e,voteResults:t,totalVoters:n,maxVotersCount:i,correctResults:s,shouldAnimate:a})=>{const r=(0,O.A)(),d=t&&t.find(t=>t.option===e.option),c=0===s.length||-1!==s.indexOf(e.option),l=s.length>0&&c||d?.isChosen,u=d?cn(d.votersCount,n||0):0,[h,m]=(0,o.J0)(a?0:u),p=d?cn(d.votersCount,i||0):0,g=h!==u;if((0,o.vJ)(()=>{a&&m(u)},[a,u]),!t||!d)return;const v=`width: ${p}%; transform:scaleX(${g?0:1})`;return(0,be.FD)("div",{className:"PollOption",dir:r.isRtl?"rtl":void 0,children:[(0,be.FD)("div",{className:"poll-option-share "+("100"===u?"limit-width":""),children:[u,"%",l&&(0,be.Y)("span",{className:(0,f.A)("poll-option-chosen",!c&&"wrong",a&&"animate"),children:(0,be.Y)(we.A,{name:c?"check":"close",className:"poll-option-icon"})})]}),(0,be.FD)("div",{className:"poll-option-right",children:[(0,be.Y)("div",{className:"poll-option-text",dir:"auto",children:(0,lt.fd)({text:e.text.text,entities:e.text.entities})}),(0,be.FD)("div",{className:(0,f.A)("poll-option-answer",l&&!c&&"wrong"),children:[a&&(0,be.Y)("svg",{className:"poll-line",style:g?"":"stroke-dasharray: 100% 200%; stroke-dashoffset: -44",children:(0,be.Y)("path",{d:"M4.47 5.33v13.6a9 9 0 009 9h13"})}),(0,be.Y)("div",{className:"poll-option-line",style:v})]})]})]})},un=12*Math.PI;function hn(e){return void 0===e.isPublic?" ":e.closed?"FinalResults":e.quiz?e.isPublic?"QuizPoll":"AnonymousQuizPoll":e.isPublic?"PublicPoll":"AnonymousPoll"}function mn(e,t,n){return n?e(t?"Answer":"Vote",n,"i"):e(t?"Chat.Quiz.TotalVotesEmpty":"Chat.Poll.TotalVotesResultEmpty")}function pn(e){e.stopPropagation()}const gn=(0,o.ph)(({message:e,poll:t,observeIntersectionForLoading:n,observeIntersectionForPlaying:s,onSendVote:a})=>{const{loadMessage:r,openPollResults:d,requestConfetti:c,showNotification:l}=(0,i.ko)(),{id:h,chatId:m}=e,{summary:p,results:g}=t,[f,v]=(0,o.J0)(!1),[A,w]=(0,o.J0)([]),[I,b]=(0,o.J0)(!1),[S,M]=(0,o.J0)(()=>!p.closed&&p.closeDate&&p.closeDate>0?Math.min(p.closeDate-(0,C.Fm)(),p.closePeriod):0),N=(0,o.li)(),Y=(0,o.li)(),{results:k,totalVoters:P}=g,F=k&&k.some(e=>e.isChosen),T=!p.closed&&!F,D=!T&&p.isPublic&&Number(g.totalVoters)>0,x=T&&p.multipleChoice,L=g.recentVoterIds,E=k?Math.max(...k.map(e=>e.votersCount)):P,B=(0,o.Kr)(()=>k?.filter(e=>e.isCorrect).map(e=>e.option)||[],[k]),R=(0,o.Kr)(()=>p.answers.map(e=>({label:(0,lt.fd)({text:e.text.text,entities:e.text.entities,observeIntersectionForLoading:n,observeIntersectionForPlaying:s}),value:e.option,hidden:Boolean(p.quiz&&p.closePeriod&&S<=0)})),[S,n,s,p.answers,p.closePeriod,p.quiz]);(0,o.vJ)(()=>{const e=t.results.results?.find(e=>e.isChosen);f&&e&&(e.isCorrect&&c({}),v(!1))},[f,t.results.results,c]),(0,o.Nf)(()=>{if(S>0&&setTimeout(()=>M(S-1),1e3),!Y.current)return;S<=5&&N.current.classList.add("hurry-up");const e=(p.closePeriod-S)/p.closePeriod*un;Y.current.setAttribute("stroke-dashoffset",`-${e}`)},[S,p.closePeriod]),(0,o.vJ)(()=>{p.quiz&&(S<=0||F&&!p.closed)&&r({chatId:m,messageId:h})},[m,S,F,r,h,p.closed,p.quiz]),(0,o.vJ)(()=>{let e;return p.quiz&&!p.closed&&p.closePeriod&&p.closePeriod>0&&(e=window.setTimeout(()=>{r({chatId:m,messageId:h})},1e3*p.closePeriod)),()=>{e&&window.clearTimeout(e)}},[T,m,r,h,p.closePeriod,p.closed,p.quiz]);const O=(0,o.Kr)(()=>{const e=(0,i.mS)();return L?L.reduce((t,n)=>{const o=(0,u.PVB)(e,n);return o&&t.push(o),t},[]):[]},[L]),z=(0,U.A)(e=>{w([e]),v(!0),b(!0),a([e])}),V=(0,U.A)(e=>{w(e)}),j=(0,U.A)(()=>{v(!0),b(!0),a(A)}),J=(0,U.A)(()=>{d({chatId:m,messageId:h})}),G=(0,U.A)(()=>{l({localId:(0,y.bj)(e),message:(0,lt.fd)({text:t.results.solution,entities:t.results.solutionEntities}),duration:5e3,containerSelector:"#middle-column-portals"})});(0,o.vJ)(()=>{I&&F&&p.quiz&&g.results&&t.results.solution&&(g.results.find(e=>e.isChosen&&e.isCorrect)||G())},[F,I,g.results,p.quiz,t.results.solution]);const $=(0,K.A)();return(0,be.FD)("div",{className:"Poll",dir:$.isRtl?"auto":"ltr",children:[(0,be.Y)("div",{className:"poll-question",children:(0,lt.fd)({text:p.question.text,entities:p.question.entities,observeIntersectionForLoading:n,observeIntersectionForPlaying:s})}),(0,be.FD)("div",{className:"poll-type",children:[$(hn(p)),O.length>0&&(0,be.Y)("div",{className:"poll-recent-voters",children:(0,be.Y)(an.A,{size:"micro",peers:O})}),S>0&&T&&(0,be.FD)("div",{ref:N,className:"poll-countdown",children:[(0,be.Y)("span",{children:(0,vt.QO)(S)}),(0,be.Y)("svg",{width:"16px",height:"16px",children:(0,be.Y)("circle",{ref:Y,cx:"8",cy:"8",r:6,className:"poll-countdown-progress",transform:"rotate(-90, 8, 8)","stroke-dasharray":un,"stroke-dashoffset":"0"})})]}),p.quiz&&t.results.solution&&!T&&(0,be.Y)(Be.A,{round:!0,size:"tiny",color:"translucent",className:"poll-quiz-help",onClick:G,ariaLabel:"Show Solution",children:(0,be.Y)(we.A,{name:"lamp"})})]}),T&&(0,be.Y)("div",{className:"poll-answers",onClick:pn,children:x?(0,be.Y)(rn.A,{options:R,selected:A,onChange:V,disabled:e.isScheduled||f,loadingOptions:f?A:void 0,isRound:!0}):(0,be.Y)(dn.A,{name:`poll-${h}`,options:R,onChange:z,disabled:e.isScheduled||f,loadingOption:f?A[0]:void 0})}),!T&&(0,be.Y)("div",{className:"poll-results",children:p.answers.map(function(e){return(0,be.Y)(ln,{shouldAnimate:I||!T,answer:e,voteResults:k,totalVoters:P,maxVotersCount:E,correctResults:B},e.option)})}),!D&&!x&&(0,be.Y)("div",{className:"poll-voters-count",children:mn($,p.quiz,g.totalVoters)}),x&&(0,be.Y)(Be.A,{isText:!0,disabled:0===A.length,size:"tiny",onClick:j,children:$("PollSubmitVotes")}),D&&(0,be.Y)(Be.A,{isText:!0,size:"tiny",onClick:J,children:$("PollViewResults")})]})});var fn=n(43581),vn=n(84555),An=n(10221),yn=n(18104),Cn=n(14413),wn=n(82855),In=n(3325);const bn="GydRBA08",Sn=(0,o.ph)((0,i.EK)(e=>({needsAgeVerification:e.appConfig.needAgeVideoVerification}))(({message:e,shouldLoop:t,shouldPlayEffect:n,withEffect:a,isMediaNsfw:r,onStopEffect:c,observeIntersection:l,observeIntersectionForPlaying:u,needsAgeVerification:h})=>{const{showNotification:m,openStickerSet:p,updateContentSettings:v,openAgeVerificationModal:A}=(0,i.ko)(),y=(0,K.A)(),{isMobile:C}=(0,D.Ay)(),w=(0,o.li)(),I=(0,o.li)(),S=e.content.sticker,{stickerSetInfo:M,isVideo:N,hasEffect:Y}=S,k=!e.isOutgoing,[P,F,T]=(0,B.A)(),[x,L]=(0,o.J0)(!1),E=r,[O,z,V]=(0,B.A)(E);(0,o.vJ)(()=>{E?z():V()},[E]);const j=(0,U.A)(()=>{T(),V(),x&&v({isSensitiveEnabled:!0})}),J=S.isPreloadedGlobally?void 0:(0,d.Mw)(S,N&&!g.OF?"pictogram":"inline"),G=(0,R.Vz)(w,l),$=(0,R.Vz)(w,u),q=`sticker${S.id}?size=f`,H=(0,Ce.A)(q,!G||!Y||!a,s.qZ.BlobUrl),[W,_,Q]=(0,B.A)(),Z=(0,d.VD)(S),X=(0,U.A)(()=>{Q(),c?.()});(0,o.vJ)(()=>{Y&&a&&$&&n&&_()},[Y,$,n,_,a]);const ee=Y&&a&&H&&W;(0,An.A)({anchorRef:w,overlayRef:I,isMirrored:k,isDisabled:!ee});const te=(0,U.A)(()=>{p({stickerSetInfo:S.stickerSetInfo})}),ne=(0,U.A)(()=>{if(O)return r?h?void A():void F():void V();if(Y){if(W||!a)return void m({message:y("PremiumStickerTooltip"),action:{action:"openStickerSet",payload:{stickerSetInfo:S.stickerSetInfo}},actionText:y("ViewAction")});if(a)return void _()}te()}),oe="isMissing"in M,{width:ie,height:se}=(0,b.bu)(S,C),ae=(0,f.A)("media-inner","FPceNkgD",oe&&"hruUWBuj",Y&&k&&bn);return(0,be.FD)("div",{ref:w,className:ae,style:`width: ${ie}px; height: ${se}px;`,onClick:oe?void 0:ne,children:[(0,be.Y)(wn.A,{containerRef:w,sticker:S,fullMediaHash:J,fullMediaClassName:"full-media",size:ie,shouldLoop:t,noLoad:!G,noPlay:!$,withSharedAnimation:!0}),(0,be.Y)(Rt.A,{isVisible:O,withAnimation:!0,thumbDataUri:Z,width:ie,height:se,className:"media-spoiler",isNsfw:r}),ee&&(0,be.Y)(In.A,{children:(0,be.Y)(yn.A,{ref:I,className:(0,f.A)("WMMaWlOL",k&&bn),tgsUrl:H,size:1.49*ie,play:!0,isLowPriority:!0,noLoop:!0,onEnded:X},q)}),(0,be.Y)(Cn.A,{isOpen:P,onClose:T,shouldAlwaysShow:x,onAlwaysShowChanged:L,confirmHandler:j})]})}));var Mn=n(45470),Nn=n(14),Yn=n(50680),kn=n(59816);const Pn=(0,o.ph)(function({story:e,isPreview:t,isProtected:n,isConnected:s}){const{openStoryViewer:a,loadPeerStoriesByIds:r,showNotification:c}=(0,i.ko)(),l=(0,K.A)(),{isMobile:u}=(0,D.Ay)(),h=e&&"isDeleted"in e,m=e&&"content"in e,p=m?e.content.video:void 0,v=m?(0,d.EN)(e):void 0,A=(0,Ce.A)(v),y=m?p?p.thumbnail?.dataUri:e.content.photo?.thumbnail?.dataUri:void 0,C=(0,Nn.A)(A,!0),{shouldRender:w,transitionClassNames:I}=(0,Yn.A)(Boolean(C)),b=(0,Mn.A)(y,h&&!t,u&&!g.QH),S=(0,f.A)("EVLTkrt1","media-inner",(!s||h)&&"AQWPv0bP",h&&"tprkr7qf",t&&"V3HabdKr");(0,o.vJ)(()=>{!e||m||h||r({peerId:e.peerId,storyIds:[e.id]})},[e,h,m]);const M=(0,U.A)(()=>{h?c({message:l("StoryNotFound")}):a({peerId:e.peerId,storyId:e.id,isSinglePeer:!0,isSingleStory:!0})});return(0,be.FD)("div",{className:S,onClick:s?M:void 0,children:[!h&&t&&(0,be.Y)("canvas",{ref:b,className:"thumbnail blurred-bg"}),w&&(0,be.FD)(be.FK,{children:[(0,be.Y)("img",{src:C,alt:"",className:(0,f.A)("WAItYc5d",t&&"ClGe8yij",I),draggable:!1}),m&&(0,be.Y)(kn.A,{story:e,className:I})]}),h&&(0,be.FD)("span",{children:[(0,be.Y)(we.A,{name:"story-expired",className:"nLA7VEhv"}),l("StoryExpiredSubtitle")]}),Boolean(p?.duration)&&(0,be.Y)("div",{className:"message-media-duration",children:(0,vt.QO)(p.duration)}),n&&(0,be.Y)("span",{className:"protector"})]})}),Fn=(0,o.ph)((0,i.EK)((e,{message:t})=>{const{id:n,peerId:o}=t.content.storyData;return{story:(0,u.Msb)(e,o,n),isConnected:"connectionStateReady"===e.connectionState}})(function({message:e,story:t,isProtected:n,isConnected:o}){const{storyData:i}=e.content;return(0,be.Y)(Pn,{story:t||i,isProtected:n,isConnected:o})})),Tn=(0,o.ph)((0,i.EK)((e,{message:t})=>{const{id:n,peerId:o}=t.content.storyData,i=(0,u._bp)(e,o)?.lastReadId;return{story:(0,u.Msb)(e,o,n),peer:(0,u.PVB)(e,o),targetUser:(0,u.mBe)(e,t.chatId),isUnread:Boolean(i&&i{a({peerId:t.peerId,storyId:t.id,isSinglePeer:!0,isSingleStory:!0})}),h=t&&"isDeleted"in t,m=t&&"content"in t,p=m?t.content.video:void 0,g=m?(0,d.EN)(t,"pictogram"):void 0,v=(0,Ce.A)(g)||p?.thumbnail?.dataUri;return(0,E.A)(l.peerId,l.id,t),(0,be.FD)("div",{className:(0,f.A)("action-message-story-mention",o&&"is-unread",m&&"with-preview"),tabIndex:0,role:"button",onClick:m?u:void 0,children:[m&&(0,be.Y)("span",{className:"story-media-wrapper",children:v&&(0,be.Y)("img",{src:v,alt:"",className:"story-media"})}),(0,be.Y)("span",{className:"story-title",children:(0,S.A)(n&&"isSelf"in n&&n.isSelf?r(h?"ExpiredStoryMentioned":"StoryYouMentionedTitle",(0,d.u0)(s)):h?r("ExpiredStoryMention"):r("StoryMentionedTitle",(0,c.F9)(r,n)),["emoji","simple_markdown"])})]})})),Dn=(0,o.ph)((0,i.EK)((e,{message:t})=>({sender:(0,u.Y7C)(e,t),isCurrentUserPremium:(0,u.g29)(e),isSynced:e.isSynced}))(({message:e,todoList:t,sender:n,isCurrentUserPremium:s,isSynced:a})=>{const{toggleTodoCompleted:r,showNotification:d,requestConfetti:l}=(0,i.ko)(),{todo:h,completions:m}=t,{title:p,items:g,othersCanComplete:v}=h,[A,y]=(0,o.J0)([]),C=(0,o.Kr)(()=>new Set(A),[A]),w=!e.isScheduled&&s&&a;(0,o.Nf)(()=>{const e=m?.map(e=>e.itemId.toString())||[];y(e)},[m]);const I=(0,O.A)(),b=(0,U.A)(e=>{e.preventDefault(),e.stopPropagation(),s||d({message:I("SubscribeToTelegramPremiumForToggleTask"),action:{action:"openPremiumModal",payload:{initialSection:"todo"}},actionText:I("PremiumMore")})}),S=(0,U.A)(t=>{const n=t.find(e=>!C.has(e)),o=Array.from(C).find(e=>!t.includes(e));r({chatId:e.chatId,messageId:e.id,completedIds:n?[Number(n)]:[],incompletedIds:o?[Number(o)]:[]}),t.length===g.length&&l({})}),M=Boolean(e.forwardInfo)||!v&&!e.isOutgoing,N=e.isOutgoing,Y=(0,o.Kr)(()=>g.map(e=>{const t=v?(0,u.mBe)((0,i.mS)(),m?.find(t=>t.itemId===e.id)?.completedBy||""):void 0,n=t?(0,c.em)(I,t):void 0;return{label:(0,lt.fd)(e.title),value:e.id.toString(),user:t,subLabel:n}}),[g,v,m,I]);return(0,be.FD)("div",{className:"todo-list",dir:I.isRtl?"auto":"ltr",children:[(0,be.FD)("div",{className:"todo-list-header",children:[(0,be.Y)("div",{className:"todo-list-title",children:(0,lt.fd)(p)}),(0,be.Y)("div",{className:"list-type",children:e.forwardInfo?I("TitleToDoList"):v?I("TitleGroupToDoList"):N?I("TitleYourToDoList"):n?I("TitleUserToDoList",{peer:(0,c.F9)(I,n)},{withNodes:!0}):I("TitleToDoList")})]}),(0,be.Y)("div",{className:"todo-list-items",children:M?(0,be.Y)("div",{className:"todo-list-items",children:Y.map(e=>(0,be.FD)("div",{className:"todo-list-readonly-item",children:[(0,be.Y)("div",{className:"todo-readonly-item-checkbox",children:C.has(e.value)?(0,be.Y)(we.A,{name:"check"}):(0,be.Y)("div",{className:"todo-item-bullet-point"})}),(0,be.Y)("div",{className:(0,f.A)("readonly-item-label",C.has(e.value)&&"completed-label"),children:e.label})]},e.value))}):(0,be.Y)(rn.A,{options:Y,selected:A,onChange:S,onClickLabel:s?void 0:b,disabled:!w,isRound:!0})}),(0,be.Y)("div",{className:"completed-tasks-count",children:(0,be.Y)(Xe.A,{text:I("DescriptionCompletedToDoTasks",{number:A.length,count:Y.length})})})]})}));var xn=n(58849),Ln=n(87094),En=n(39877),Bn=n(84685),Rn=n(66833),On=n(40558);const Un=(0,o.ph)(({gift:e,observeIntersectionForLoading:t,observeIntersectionForPlaying:n,onClick:i})=>{const s=(0,o.li)(),{backdrop:a,model:r,pattern:d}=(0,Rn.uc)(e),[c,l,u]=(0,B.A)(),h=[a.centerColor,a.edgeColor];return(0,be.FD)("div",{className:(0,f.A)("interactive-gift","LaOdPURl"),onClick:i,onMouseEnter:g.TF?void 0:l,onMouseLeave:g.TF?void 0:u,children:[(0,be.Y)(On.A,{className:"EdXfeKWY",backgroundColors:h,patternIcon:d.sticker,centerEmptiness:.15,ringsCount:2,ovalFactor:1.2,withAdaptiveHeight:!0}),(0,be.Y)("div",{ref:s,className:"o_DYZEMV",children:(0,be.Y)(wn.A,{containerRef:s,sticker:r.sticker,size:120,shouldLoop:c,observeIntersectionForPlaying:n,observeIntersectionForLoading:t})})]})}),Kn=(0,o.ph)((0,i.EK)(e=>({canPlayAnimatedEmojis:(0,u.BWX)(e)}))(({messageWebPage:e,webPage:t,message:n,noAvatars:s,canAutoLoad:r,canAutoPlay:c,asForwarded:l,isDownloading:u=!1,isProtected:h,isConnected:m,story:p,theme:g,backgroundEmojiId:v,shouldWarnAboutFiles:A,autoLoadFileMaxSizeMb:y,lastPlaybackTimestamp:C,observeIntersectionForLoading:w,observeIntersectionForPlaying:I,onMediaClick:b,onDocumentClick:M,onContainerClick:N,onAudioPlay:Y,onCancelMediaTransfer:k})=>{const{openUrl:P,openTelegramLink:F}=(0,i.ko)(),T=(0,o.li)(),D=(0,O.A)(),x=(0,U.A)(()=>{b()}),L=(0,U.A)(e=>{N?.(e)}),B="full"===t?.webpageType?t:void 0,{story:R,stickers:K}=B||{};(0,E.A)(R?.peerId,R?.id,p);const z=K?.isWithTextColor||K?.documents?.[0]?.shouldUseTextColor,V=(0,Ln.A)(T,void 0,!z),j=(0,o.Kr)(()=>{const e=t?.url&&(0,ee.vG)(t?.url);if(e&&"timestamp"in e)return e.timestamp},[t?.url]);if("full"!==t?.webpageType)return;const J=(0,U.A)(()=>{F({url:t.url})}),{siteName:G,url:$,displayUrl:q,title:H,description:W,photo:_,video:Q,audio:Z,type:X,document:te}=t,{mediaSize:ne}=e,oe="telegram_story"===X,ie="telegram_nft"===X,se=p&&"isDeleted"in p?void 0:function(e){switch(e){case"telegram_channel_request":case"telegram_megagroup_request":case"telegram_chat_request":return"ViewButtonRequestJoin";case"telegram_message":return"ViewButtonMessage";case"telegram_bot":return"ViewButtonBot";case"telegram_voicechat":return"ViewButtonVoiceChat";case"telegram_livestream":return"ViewButtonVoiceChatChannel";case"telegram_megagroup":case"telegram_chat":return"ViewButtonGroup";case"telegram_channel":return"ViewButtonChannel";case"telegram_user":return"ViewButtonUser";case"telegram_botapp":return"ViewButtonBotApp";case"telegram_chatlist":return"ViewChatList";case"telegram_story":return"ViewButtonStory";case"telegram_channel_boost":case"telegram_group_boost":return"ViewButtonBoost";case"telegram_stickerset":return"ViewButtonStickerset";case"telegram_emojiset":return"ViewButtonEmojiset";case"telegram_nft":return"ViewButtonGiftUnique";default:return}}(K?.isEmoji?"telegram_emojiset":X),ae=se&&D(se),re=(0,xn.A)(W,170),de=Boolean(re||H||G);let ce=Boolean(K);de&&t?.photo&&!t.video&&!t.document&&(ce=function(e,t){if(!e?.photo)return!1;if("small"===t)return!0;if("large"===t)return!1;const{width:n,height:o}=(0,d.Xn)(e.photo)||{};return!(!n||!o||n!==o||e.hasLargeMedia)}(t,ne));const le=(_||Q)&&b&&!ce,ue=(0,f.A)("WebPage",ce&&"with-square-photo",!_&&!Q&&"without-media",Q&&"with-video",!de&&"no-article",te&&"with-document",ae&&"with-quick-button",ie&&"with-gift");return(0,be.FD)(Ie.A,{className:ue,"data-initial":(G||q)[0],dir:D.isRtl?"rtl":"auto",onClick:L,children:[(0,be.FD)("div",{className:(0,f.A)("WebPage--content",oe&&"is-story",ie&&"is-gift"),children:[v&&(0,be.Y)(En.A,{emojiDocumentId:v,className:"WebPage--background-icons"}),oe&&(0,be.Y)(Pn,{story:p,isProtected:h,isConnected:m,isPreview:!0}),ie&&(0,be.Y)(Un,{gift:t.gift,observeIntersectionForLoading:w,observeIntersectionForPlaying:I,onClick:J}),de&&(0,be.FD)("div",{className:(0,f.A)("WebPage-text","WebPage-text_interactive"),onClick:()=>P({url:$,shouldSkipModal:e.isSafe}),children:[(0,be.Y)(Bn.A,{className:"site-name",url:$,text:G||q}),H&&(0,be.Y)("p",{className:"site-title",children:(0,S.A)(H)}),re&&!ie&&(0,be.Y)("p",{className:"site-description",children:(0,S.A)(re,["emoji","br"])})]}),_&&!ie&&!Q&&!te&&(0,be.Y)(Ke.A,{photo:_,isOwn:n?.isOutgoing,isInWebPage:!0,observeIntersection:w,noAvatars:s,canAutoLoad:r,size:ce?"pictogram":"inline",asForwarded:l,nonInteractive:!le,isDownloading:u,isProtected:h,theme:g,onClick:le?x:void 0,onCancelUpload:k}),Q&&(0,be.Y)(ze.A,{video:Q,isOwn:n?.isOutgoing,isInWebPage:!0,observeIntersectionForLoading:w,noAvatars:s,canAutoLoad:r,canAutoPlay:c,asForwarded:l,isDownloading:u,isProtected:h,lastPlaybackTimestamp:C||j,onClick:le?x:void 0,onCancelUpload:k}),Z&&(0,be.Y)(me.Ay,{theme:g,message:n,origin:a.d9.Inline,noAvatars:s,isDownloading:u,onPlay:Y,onCancelUpload:k}),te&&(0,be.Y)(fe.A,{document:te,message:n,observeIntersection:w,autoLoadFileMaxSizeMb:y,onMediaClick:M,onCancelUpload:k,isDownloading:u,shouldWarnAboutFiles:A}),K&&(0,be.Y)("div",{ref:T,className:(0,f.A)("media-inner","square-image",K.isEmoji&&"WebPage--emoji-grid","WebPage--stickers"),children:K.documents.map(e=>(0,be.Y)("div",{className:"WebPage--sticker",children:(0,be.Y)(wn.A,{containerRef:T,sticker:e,shouldLoop:!0,size:K.isEmoji?38:80,customColor:V,observeIntersectionForPlaying:I,observeIntersectionForLoading:w})},e.id))})]}),ae&&(he=ae,(0,be.Y)(Be.A,{className:"WebPage--quick-button",size:"tiny",color:"translucent",isRectangular:!0,noForcedUpperCase:!0,onClick:J,children:he}))]});var he})),zn=1.75*b.$,Vn=2.25*b.$,jn=(0,o.ph)((0,i.EK)((e,t)=>{const{focusedMessage:n,forwardMessages:o,activeReactions:i,activeEmojiInteractions:a,loadingThread:r}=(0,u.nTw)(e),{message:c,album:p,withSenderName:f,withAvatar:v,threadId:C,messageListType:w,isLastInDocumentGroup:I,isFirstInGroup:b}=t,{id:S,chatId:M,viaBotId:N,isOutgoing:Y,forwardInfo:k,transcriptionId:P,isPinned:F,viaBusinessBotId:T,effectId:D,paidMessageStars:x}=c,L=(0,u.k9R)(e,c),{shouldWarnAboutFiles:E}=(0,m.l)(e),B=(0,A.L8)(M),R=(0,u.hds)(e,M),O=(0,u.nZ4)(e,M),U=(0,d.DX)(M),K=(0,d.Qe)(M),z=R&&(0,d.WX)(R),V=R&&(0,d.YE)(R),j=B?void 0:(0,u.AWZ)(e,M),J=L?.story,G=J?(0,u.Msb)(e,J.peerId,J.id):void 0,$=o.messageIds&&o.messageIds.includes(S),q=!O&&(0,d.zP)(c),H=f||v||q,W=(0,u.Y7C)(e,c),_=(0,u.Szq)(e,c),Q=N?(0,u.mBe)(e,N):void 0,Z=W?.id&&V?j?.adminMembersById?.[W?.id]:void 0,X=c.id===C,{replyToMsgId:ee,replyToPeerId:te,replyFrom:ne}=(0,l.Q)(c)||{},{peerId:oe,storyId:ie}=(0,l.W)(c)||{},se=ee&&ee===C,ae=(0,u.gMr)(e,c),re=k||ne,de=ae?(0,u.Y7C)(e,ae):!re||U||K?void 0:(0,u.HdA)(e,re),ce=ae&&(0,u.Szq)(e,ae),le=te?(0,u.hds)(e,te):void 0,ue=!U&&!K&&le&&!(0,d.gA)(le)&&(le.isNotJoined||(0,u._ls)(e,le.id)),he="topicCreate"===ae?.content.action?.type,me=ie&&oe?(0,u.Msb)(e,oe,ie):void 0,pe=oe?(0,u.PVB)(e,oe):void 0,ge=(0,u.ldX)(e,c),fe="thread"===w&&(p?p.messages.some(t=>(0,u.nJv)(e,t,C)):(0,u.nJv)(e,c,C)),{direction:ve,noHighlight:Ae,isResizingContainer:ye,quote:Ce,quoteOffset:we,scrollTargetPosition:Ie}=fe&&n||{},be=(0,u.TCk)(e),Se=be?.results?.query&&`${be.isHashtag?"#":""}${be.results.query}`,Me=(0,d.wb)(c),Ne=Me&&(0,u.oei)(e,Me)?Me:void 0,Ye=(0,d.Jw)(c);let ke;ke=p?.messages?p.messages.every(({id:t})=>(0,u.H1_)(e,t)):(0,u.H1_)(e,S);const Pe="thread"===w&&(0,u.tOf)(e,c,C),Fe=(0,u.yuw)(e),Te=(0,h.iS)(e,c),De=Te&&(0,d.$r)(Fe,Te),xe=(0,u.Vw0)(e,M,p?.commentsMessage?.id||S),Le=Boolean(c.groupedId)&&!c.isInAlbum,Ee=Le?(0,u.D_S)(e,M,c.groupedId)[0]:void 0,Be=Le?I?(0,u.O5q)(e,M,Ee):void 0:c,Re=R?.unreadReactions?.includes(c.id),Oe=C===s.l3&&R?.isForum&&b,Ue=Oe?(0,u.nkm)(e,c):void 0,Ke=(0,u.RnX)(e,M),ze=(0,u.Rny)(e,M,c.id),Ve=(0,u.qZq)(e,M),je=g.CM&&e.settings.byKey.canTranslate&&!Ve,Je="connectionStateReady"===e.connectionState,Ge=Boolean(Be&&i[(0,y.bj)(Be)]?.length),$e=(0,u.g29)(e),qe=W&&(0,u.nZ4)(e,W.id)?j?.boostsApplied??c.senderBoosts:c.senderBoosts,He=R?.boostLevel||0,We=e.appConfig.groupTranscribeLevelMin,_e=$e||Boolean(We&&He>=We),Qe=T?(0,u.mBe)(e,T):void 0,Ze=D?e.availableEffectById[D]:void 0,Xe=(0,u.zcZ)(e,c),et=(0,h.me)(e,c),tt=(0,h.xd)(e,M,c.id),nt=(0,u.trm)(e),ot=e.appConfig.starsSuggestedPostFutureMin,it=(0,h.B9)(e,c),st=ae&&(0,h.B9)(e,ae);return{theme:(0,u.SJA)(e),forceSenderName:q,sender:W,canShowSender:H,originSender:_,botSender:Q,shouldHideReply:se||he,isThreadTop:X,replyMessage:ae,replyMessageSender:de,replyMessageForwardSender:ce,replyMessageChat:le,replyStory:me,isReplyPrivate:ue,storySender:pe,isInDocumentGroup:Le,isProtected:(0,u.ynf)(e,c),isChatProtected:(0,u.ryq)(e,M),isFocused:fe,isForwarding:$,reactionMessage:Be,isChatWithSelf:O,isRepliesChat:U,isAnonymousForwards:K,isChannel:z,isGroup:V,canReply:Pe,highlight:Se,animatedEmoji:Ne,animatedCustomEmoji:Ye,isInSelectMode:(0,u.rTV)(e),isSelected:ke,isGroupSelected:Boolean(c.groupedId)&&!c.isInAlbum&&(0,u.SLS)(e,M,c.groupedId),threadId:C,isDownloading:De,isPinnedList:"pinned"===w,isPinned:F,canAutoLoadMedia:(0,u.wwb)(e,c),canAutoPlayMedia:(0,u.OEt)(e,c),autoLoadFileMaxSizeMb:e.settings.byKey.autoLoadFileMaxSizeMb,shouldLoopStickers:(0,u.ML4)(e),repliesThreadInfo:xe,availableReactions:e.reactions.availableReactions,defaultReaction:(0,d.Nb)(c)||"scheduled"===w?void 0:(0,u.nTJ)(e,M),hasActiveReactions:Ge,activeEmojiInteractions:a,hasUnreadReaction:Re,isTranscribing:void 0!==P&&e.transcriptions[P]?.isPending,transcribedText:void 0!==P?e.transcriptions[P]?.text:void 0,isPremium:$e,senderAdminMember:Z,messageTopic:Ue,hasTopicChip:Oe,chatTranslations:Ke,areTranslationsEnabled:je,shouldDetectChatLanguage:(0,u.LRV)(e,M),requestedTranslationLanguage:ze,requestedChatTranslationLanguage:Ve,hasLinkedChat:Boolean(j?.linkedChatId),withAnimatedEffects:(0,u.xYJ)(e,"stickerEffects"),webPageStory:G,isConnected:Je,isLoadingComments:xe?.isCommentsInfo&&r?.loadingChatId===xe?.originChannelId&&r?.loadingMessageId===xe?.originMessageId,shouldWarnAboutFiles:E,outgoingStatus:Y?(0,u.Tl2)(e,c,"scheduled"===w):void 0,uploadProgress:"number"==typeof ge?ge:void 0,focusDirection:fe?ve:void 0,noFocusHighlight:fe?Ae:void 0,isResizingContainer:fe?ye:void 0,focusedQuote:fe?Ce:void 0,focusedQuoteOffset:fe?we:void 0,scrollTargetPosition:fe?Ie:void 0,senderBoosts:qe,tags:e.savedReactionTags?.byKey,canTranscribeVoice:_e,viaBusinessBot:Qe,minFutureTime:ot,effect:Ze,poll:Xe,maxTimestamp:et,lastPlaybackTimestamp:tt,paidMessageStars:x,isChatWithUser:B,isAccountFrozen:nt,isMediaNsfw:it,isReplyMediaNsfw:st,webPage:L}})(({message:e,observeIntersectionForBottom:t,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,album:h,noAvatars:m,withAvatar:A,withSenderName:y,noComments:Y,noReplies:P,appearanceOrder:F,isJustAdded:G,isFirstInGroup:$,isPremium:_,isLastInGroup:ne,isFirstInDocumentGroup:oe,isLastInDocumentGroup:ie,isTranscribing:se,transcribedText:ae,isLastInList:re,theme:de,forceSenderName:ce,sender:ue,canShowSender:he,originSender:ye,botSender:Ce,isThreadTop:Ie,shouldHideReply:Se,replyMessage:Fe,replyMessageSender:Te,replyMessageForwardSender:De,replyMessageChat:xe,replyStory:Ue,isReplyPrivate:Ve,storySender:je,outgoingStatus:Ge,uploadProgress:$e,isInDocumentGroup:qe,isLoadingComments:We,isProtected:Qe,isChatProtected:Ze,isFocused:Xe,focusDirection:et,focusedQuote:nt,focusedQuoteOffset:ot,noFocusHighlight:it,scrollTargetPosition:st,isResizingContainer:rt,isForwarding:dt,isChatWithSelf:lt,isRepliesChat:ut,isAnonymousForwards:ht,isChannel:mt,isGroup:gt,canReply:vt,highlight:At,animatedEmoji:yt,animatedCustomEmoji:Ct,hasActiveReactions:wt,hasLinkedChat:It,isInSelectMode:bt,isSelected:St,isGroupSelected:Mt,threadId:Nt,reactionMessage:Yt,availableReactions:Pt,defaultReaction:Tt,activeEmojiInteractions:Dt,messageListType:xt,isPinnedList:Lt,isPinned:Bt,isDownloading:Rt,canAutoLoadMedia:Ot,canAutoPlayMedia:Kt,shouldLoopStickers:zt,autoLoadFileMaxSizeMb:Vt,repliesThreadInfo:jt,hasUnreadReaction:Jt,memoFirstUnreadIdRef:Gt,senderAdminMember:$t,messageTopic:qt,hasTopicChip:Ht,chatTranslations:Zt,areTranslationsEnabled:Xt,shouldDetectChatLanguage:tn,requestedTranslationLanguage:on,requestedChatTranslationLanguage:an,withAnimatedEffects:rn,webPageStory:dn,isConnected:cn,getIsMessageListReady:ln,shouldWarnAboutFiles:un,senderBoosts:hn,tags:mn,canTranscribeVoice:pn,viaBusinessBot:An,effect:yn,poll:Cn,maxTimestamp:wn,lastPlaybackTimestamp:In,isMediaNsfw:bn,isReplyMediaNsfw:Mn,paidMessageStars:Nn,isChatWithUser:Yn,isAccountFrozen:kn,minFutureTime:Pn,webPage:xn,onIntersectPinnedMessage:Ln})=>{const{toggleMessageSelection:En,clickBotInlineButton:Bn,clickSuggestedMessageButton:Rn,rejectSuggestedPost:On,openSuggestedPostApprovalModal:Un,disableContextMenuHint:jn,animateUnreadReaction:Jn,focusMessage:Gn,markMentionsRead:$n}=(0,i.ko)(),qn=(0,o.li)(),Hn=(0,o.li)(),Wn=(0,o.li)(),_n=(0,K.A)(),Qn=(0,O.A)(),[Zn,Xn]=(0,o.J0)(!1),[eo,to]=(0,o.J0)(!1),[no,oo]=(0,o.J0)(!1),[io,so,ao]=(0,B.A)(),[ro,co,lo]=(0,B.A)(),[uo,ho]=(0,o.J0)(""),{isMobile:mo,isTouchScreen:po}=(0,D.Ay)();(0,R.mv)(Hn,t);const{isContextMenuOpen:go,contextMenuAnchor:fo,contextMenuTarget:vo,handleBeforeContextMenu:Ao,handleContextMenu:yo,handleContextMenuClose:Co,handleContextMenuHide:wo}=(0,x.A)(qn,po&&bt||kn,!p.Vq,g.Ni,ln);(0,o.vJ)(()=>{go&&jn()},[go,jn]);const Io=F<=0,[bo,So]=(0,B.A)(Io);(0,o.vJ)(()=>{Io||setTimeout(So,F*r.zq7)},[F,So,Io]),(0,J.A)({ref:qn,isOpen:bo||G,noMountTransition:Io&&!G,className:!1});const{id:Mo,chatId:No,forwardInfo:Yo,viaBotId:ko,isTranscriptionError:Po,factCheck:Fo}=e;(0,o._W)(()=>{if(e.isPinned){const e=h?h.mainMessage.id:Mo;Ln?.({viewportPinnedIdsToRemove:[e]})}});const To=(0,d.Nb)(e),Do=(0,d.Ie)(e),xo="scheduled"===xt||e.isScheduled,Lo=(0,d.Tv)(e)&&!Se,{paidMedia:Eo}=(0,d.r_)(e),{photo:Bo,video:Ro}=N(Eo),{photo:Oo=Bo,video:Uo=Ro,audio:Ko,voice:zo,document:Vo,sticker:jo,contact:Jo,invoice:Go,location:$o,action:qo,game:Ho,storyData:Wo,giveaway:_o,giveawayResults:Qo,todo:Zo}=(0,d.r_)(e),Xo=(0,l.Q)(e),ei=(0,l.W)(e),ti=Boolean(!Zn&&(Po||ae)),ni=Boolean(ei),oi=Boolean(jt)&&"thread"===xt,ii=!ti&&(0,d.aN)(e),si=ii&&(yt||Ct),ai=Yt?.reactions&&!(0,d.G)(Yt.reactions),ri=Yo&&(!lt||xo)&&!ut&&!Yo.isLinkedChannelPost&&!ht&&!Ce||Boolean(Wo&&!Wo.isMention),di=Boolean(hn)&&!ri&&$,ci=Wo?.isMention,li="video"===Uo?.mediaType&&Uo.isRound,ui=Boolean(h)&&(h.isPaidMedia&&Eo.extendedMedia.length>1||h.messages.length>1)&&!h.messages.some(e=>0===Object.keys(e.content).length),hi=qe&&!oe,mi=qe&&!ie,pi=void 0!==fo,gi=!(pi||bt||dt||mi||ci),fi=mt&&!xo&&e.isForwardingAllowed&&!Ze,vi=Boolean(Lt||Yo&&(Yo.isChannelPost||lt||ut||ht)&&Yo.fromMessageId),Ai=Boolean(Fo?.text),yi=ri&&ii,Ci=Ht||Lo||ni||yi,wi=(0,U.A)((e,t)=>{kn||En({messageId:Mo,groupedId:t,...e?.shiftKey&&{withShift:!0},...ui&&{childMessageIds:h.messages.map(({id:e})=>e)}})}),Ii=he?ue:void 0,bi=Yo&&(lt||ut||ht||!Ii)?ye:Ii,Si=ri?ye:ue,Mi=Do&&!ii,Ni=Yo||Wo?ye:Ii,Yi=(0,d.G5)(e),{handleMouseDown:ki,handleClick:Pi,handleContextMenu:Fi,handleDoubleClick:Ti,handleContentDoubleClick:Di,handleMouseMove:xi,handleSendQuickReaction:Li,handleMouseLeave:Ei,isSwiped:Bi,isQuickReactionVisible:Ri,handleDocumentGroupMouseEnter:Oi}=le(wi,qn,Mo,Boolean(bt),Boolean(vt),Boolean(Qe),yo,Ao,No,pi,Wn,mi,ln),{handleSenderClick:Ui,handleViaBotClick:Ki,handleReplyClick:zi,handleMediaClick:Vi,handleDocumentClick:ji,handleAudioPlay:Ji,handleAlbumMediaClick:Gi,handlePhotoMediaClick:$i,handleVideoMediaClick:qi,handleMetaClick:Hi,handleTranslationClick:Wi,handleOpenThread:_i,handleReadMedia:Qi,handleCancelUpload:Zi,handleVoteSend:Xi,handleGroupForward:es,handleForward:ts,handleFocus:ns,handleFocusForwarded:os,handleDocumentGroupSelectAll:is,handleTopicChipClick:ss,handleStoryClick:as}=function({lang:e,selectMessage:t,message:n,webPage:o,chatId:r,threadId:c,isInDocumentGroup:u,asForwarded:h,isScheduled:m,album:p,senderPeer:g,botSender:f,messageTopic:v,isTranslatingChat:A,story:y,isReplyPrivate:C,isRepliesChat:w,isSavedMessages:I,lastPlaybackTimestamp:b}){const{openChat:S,openChatWithDraft:M,showNotification:N,focusMessage:Y,openMediaViewer:k,openAudioPlayer:P,markMessagesRead:F,cancelUploadMedia:T,sendPollVote:D,openForwardMenu:x,openChatLanguageModal:L,openThread:E,openStoryViewer:B,searchChatMediaMessages:R}=(0,i.ko)(),{id:O,forwardInfo:K,groupedId:z,content:{paidMedia:V,video:j}}=n,{replyToMsgId:J,replyToPeerId:G,replyToTopId:$,isQuote:q,quoteText:H,quoteOffset:W}=(0,l.Q)(n)||{},_=(0,U.A)(()=>{g?h&&K?.channelPostId?Y({chatId:g.id,messageId:K.channelPostId}):S({id:g.id}):N({message:e("HidAccount")})}),Q=(0,U.A)(()=>{f&&M({chatId:r,threadId:c,text:{text:`@${(0,d.Kl)(f)} `}})}),Z=(0,U.A)(()=>{J&&!C?w&&G&&$?E({isComments:!0,originChannelId:G,originMessageId:$,focusMessageId:J}):Y({chatId:G||r,threadId:w?$:c,messageId:J,replyMessageId:G?void 0:O,noForumTopicPanel:!G,...q&&{quote:H?.text,quoteOffset:W}}):N({message:e(q?"QuotePrivate":"ReplyPrivate")})}),X=(0,U.A)(()=>{k({chatId:r,threadId:c,messageId:O,origin:m?a.TQ.ScheduledInline:a.TQ.Inline})}),te=(0,U.A)(e=>{if(V&&!V.isBought)return;e&&R({chatId:r,threadId:c,currentMediaMessageId:O});const t=o?.url&&(0,ee.vG)(o.url),n=j||(0,d.rU)(o),i=t&&"timestamp"in t?t.timestamp:void 0;k({chatId:r,threadId:c,messageId:O,origin:m?a.TQ.ScheduledInline:a.TQ.Inline,timestamp:b||n?.timestamp||i,withDynamicLoading:e})}),ne=(0,U.A)(()=>{te(!m&&!V)}),oe=(0,U.A)(()=>{const e=n.content?.video?.isGif;te(!e&&!m&&!V)}),ie=(0,U.A)(()=>{((0,d.yl)(n)||(0,d.eY)(o))&&ne(),oe()}),se=(0,U.A)(()=>{P({chatId:r,messageId:O})}),ae=(0,U.A)((e,t)=>{V&&!V.isBought||(R({chatId:r,threadId:c,currentMediaMessageId:O}),k({chatId:r,threadId:c,messageId:e,mediaIndex:t,origin:m?a.TQ.ScheduledAlbum:a.TQ.Album,withDynamicLoading:!V}))}),re=(0,U.A)(()=>{F({messageIds:[O]})}),de=(0,U.A)(()=>{T({chatId:r,messageId:O})}),ce=(0,U.A)(e=>{D({chatId:r,messageId:O,options:e})}),le=(0,U.A)(()=>{x({fromChatId:r,groupedId:z})}),ue=(0,U.A)(()=>{if(p&&p.messages){const e=p.messages.map(({id:e})=>e);x({fromChatId:r,messageIds:e})}else x({fromChatId:r,messageIds:[O]})}),he=(0,U.A)(()=>{Y({chatId:r,threadId:s.l3,messageId:O})}),me=(0,U.A)(()=>{const e=I&&K.savedFromPeerId||K.fromChatId;u?Y({chatId:e,groupedId:z,groupedChatId:r,messageId:K.fromMessageId}):G&&$?w?E({isComments:!0,originChannelId:G,originMessageId:$,focusMessageId:K.fromMessageId}):Y({chatId:G,threadId:$,messageId:K.fromMessageId}):Y({chatId:e,messageId:K.fromMessageId})}),pe=(0,U.A)(e=>{e.stopPropagation(),t(e,z)}),ge=(0,U.A)(e=>{e.stopPropagation(),L({chatId:r,messageId:A?void 0:O})}),fe=(0,U.A)(()=>{E({chatId:n.chatId,threadId:n.id})}),ve=(0,U.A)(()=>{v&&Y({chatId:G||r,threadId:v.id,messageId:O})}),Ae=(0,U.A)(()=>{y&&B({peerId:y.peerId,storyId:y.id,isSingleStory:!0})});return{handleSenderClick:_,handleViaBotClick:Q,handleReplyClick:Z,handleDocumentClick:X,handleMediaClick:ie,handleAudioPlay:se,handleAlbumMediaClick:ae,handlePhotoMediaClick:ne,handleVideoMediaClick:oe,handleMetaClick:pe,handleTranslationClick:ge,handleOpenThread:fe,handleReadMedia:re,handleCancelUpload:de,handleVoteSend:ce,handleGroupForward:le,handleForward:ue,handleFocus:he,handleFocusForwarded:me,handleDocumentGroupSelectAll:pe,handleTopicChipClick:ve,handleStoryClick:Ae}}({lang:_n,selectMessage:wi,message:e,webPage:xn,chatId:No,threadId:Nt,isInDocumentGroup:qe,asForwarded:ri,isScheduled:xo,album:h,avatarPeer:bi,senderPeer:Ni,botSender:Ce,messageTopic:qt,isTranslatingChat:Boolean(an),story:Ue&&"content"in Ue?Ue:void 0,isReplyPrivate:Ve,isRepliesChat:ut,isSavedMessages:lt,lastPlaybackTimestamp:In}),rs=(0,U.A)(e=>{e.stopPropagation(),so()}),ds=(0,U.A)(()=>{Gn({chatId:No,threadId:Nt,messageId:Mo,noHighlight:!0})});(0,o.vJ)(()=>{re&&ti&&ae&&ds()},[re,ae,ti]),(0,o.vJ)(()=>{const t=qn.current,n=e.isInAlbum&&h?.messages.some(e=>!e.isDeleting);e.isDeleting&&t&&!n&&((0,Ee.U)(t)?to(!0):oo(!0))},[e.isDeleting]);const cs=h?.hasMultipleCaptions?void 0:h?.captionMessage||e,ls=cs&&(0,d.XR)(cs),us=ls||Ai,hs=(0,f.A)("Message message-list-item",$&&"first-in-group",Qe&&"hide-on-print",Qe&&!ls?"is-protected":"allow-selection",ne&&"last-in-group",oe&&"first-in-document-group",ie&&"last-in-document-group",re&&"last-in-list",Do&&"own",Boolean(e.viewsCount)&&"has-views",e.isEdited&&"was-edited",Lo&&"has-reply",go&&"has-menu-open",Xe&&!it&&"focused",dt&&"is-forwarding",no&&"is-deleting",eo&&"is-dissolving",qe&&"is-in-document-group",ui&&"is-album",e.hasUnreadMention&&"has-unread-mention",St&&"is-selected",bt&&"is-in-selection-mode",Ie&&!A&&"is-thread-top",Boolean(e.inlineButtons)&&"has-inline-buttons",Bi&&"is-swiped",G&&"is-just-added",(wt||io)&&"has-active-effect",ci&&"is-story-mention"),ms=cs&&(0,d.r_)(cs).text,ps=Boolean(e.isInvertedMedia),{replyToMsgId:gs,replyToPeerId:fs}=Xo||{},{peerId:vs,storyId:As}=ei||{};(0,o.vJ)(()=>{(jo?.hasEffect||yn)&&(Gt?.current&&Mo>=Gt.current||To)&&so()},[yn,To,Gt,Mo,jo?.hasEffect]);const ys=function(e,t,n){const[i,s]=(0,o.J0)();return(0,o.vJ)(()=>{t||n&&!n()||(e?async function(e,t=.2){return q||await H.promise,await q.request({name:"detectLanguage",args:[e,t]})}(e).then(s):s(void 0))},[t,e,n]),i}(ms?.text,!(Xt&&tn),ln);!function(e,t,n,i){(0,o.vJ)(()=>{if(n||i&&!i())return;const o=Boolean(e.content.text?.text.length);!function({chatId:e,id:t,isTranslatable:n,detectedLanguage:o}){const i=Q.get(e)||new W.A(150),s=i.get(t);s&&s.detectedLanguage===o&&s.isTranslatable===n||(i.set(t,{id:t,isTranslatable:n,detectedLanguage:o}),Q.set(e,i),Z(e))}({chatId:e.chatId,id:e.id,isTranslatable:o,detectedLanguage:t})},[e,t,n,i])}(e,ys,!tn,ln);const Cs=(0,d.ZR)(e,!an),{isPending:ws,translatedText:Is}=(0,te.A)(Zt,No,Cs?Mo:void 0,on),bs=(0,V.A)(Is,Boolean(Cs)),Ss=Is||bs,Ms="phoneCall"===qo?.type?qo:void 0,Ns=jt?.isCommentsInfo?jt:void 0,Ys=It&&mt&&To,ks=(Ns||Ys)&&!mi&&"thread"===xt&&!Y,Ps=(Ns||Ys)&&!mi&&"thread"===xt&&!Y,Fs=!po&&!Ms&&!bt&&Tt&&!mi&&!ci&&!Yi&&!kn,Ts=!ti&&ai&&(ii||(Oo||Uo||Wo||"geo"===$o?.mediaType)&&(!us||ps)),{className:Ds,style:xs}=(0,z.Ay)({peer:Si,noUserColors:Mi,shouldReset:!0,theme:de}),Ls=function(e,t,{poll:n,webPage:o,hasSubheader:i,isCustomShape:s,isLastInGroup:a,asForwarded:c,hasThread:l,forceSenderName:u,hasCommentCounter:h,hasBottomCommentButton:m,hasActionButton:p,hasReactions:g,isGeoLiveActive:f,withVoiceTranscription:v,peerColorClass:A,hasOutsideReactions:y}={}){const{paidMedia:C}=(0,d.r_)(e),{photo:w,video:I}=N(C),b=(0,d.r_)(e),{photo:S=w,video:M=I,audio:Y,voice:k,document:P,contact:F,location:T,invoice:D,storyData:x,giveaway:L,giveawayResults:E}=b,B=t?.hasMultipleCaptions?void 0:(0,d.r_)(t?.captionMessage||e).text,R=Boolean(e.factCheck?.text),O="video"===M?.mediaType&&M.isRound,U=e.isInvertedMedia,K=S||M&&!O||t||o,z=[r.zPk],V=x||S||M||T||D?.extendedMedia||C,j=B||"venue"===T?.mediaType||f||R,J=V&&!j,G=Boolean(e.inlineButtons),$=Boolean(e.viaBotId),q=U&&K?!(!g||y)||!!R||!(!o||!j):j;return A&&z.push(A),!V&&B?.emojiOnlyCount?(z.push("emoji-only"),B.emojiOnlyCount<=r.Apc&&z.push(`emoji-only-${B.emojiOnlyCount}`)):j?z.push("text"):z.push("no-text"),Object.keys(b).length||z.push("unsupported"),p&&z.push("has-action-button"),s&&(z.push("custom-shape"),O&&z.push("round"),h&&z.push("has-comment-counter")),V&&!v?z.push("media"):M?z.push("video"):Y?z.push("audio"):k?(z.push("voice"),v&&z.push("with-voice-transcription")):P?z.push("document"):F?z.push("contact"):n?z.push("poll"):L||E?z.push("giveaway"):"full"===o?.webpageType&&(z.push("web-page"),(o.photo||o.video)&&z.push("media"),o.document&&z.push("document"),o.gift&&z.push("gift")),D&&!D.extendedMedia&&z.push("invoice"),D&&D.photo&&z.push("has-photo"),x&&z.push("story"),c&&z.push("is-forwarded"),i&&z.push("has-subheader"),l&&z.push("has-replies"),g&&z.push("has-reactions"),y&&z.push("has-outside-reactions"),$&&z.push("is-via-bot"),u&&z.push("force-sender-name"),s||(z.push("has-shadow"),V&&l&&z.push("has-background"),(i||c||$||!J||u||R||v)&&z.push("has-solid-background"),R&&z.push("has-fact-check"),!a||G||!S&&J&&!m||z.push("has-appendix")),K&&U&&z.push("is-inverted-media"),q?z.push("has-footer"):z.push("no-footer"),z.join(" ")}(e,h,{poll:Cn,webPage:xn,hasSubheader:Ci,isCustomShape:ii,isLastInGroup:ne,asForwarded:ri,hasThread:oi&&!Y,forceSenderName:ce,hasCommentCounter:oi&&jt.messagesCount>0,hasBottomCommentButton:Ps&&!ii,hasActionButton:fi||vi||Ps&&ii,hasReactions:ai,isGeoLiveActive:"geoLive"===$o?.mediaType&&!(0,d.vz)(e),withVoiceTranscription:ti,peerColorClass:Ds,hasOutsideReactions:Ts}),Es=Ls.includes("has-appendix"),Bs=(0,M.Rr)(ms?.emojiOnlyCount),Rs=Yn?void 0:ui&&Nn?h.messages.length*Nn:Nn;let Os,Us;Os=Ms||mi?"none":!us||xn||Bs||ps?ps&&!Bs&&(Ai||xn)?"in-text":"standalone":"in-text",ai?Ts?Us="outside":ri?(Os="standalone",Us="inside"):Us="inside":Us="none";const Ks=ii?"in-meta":"in-content";(0,L.A)(fs||No,gs,Fe,e.id,Se||Ve),(0,E.A)(vs||No,As,Ue),(0,X.A)({elementRef:qn,isFocused:Xe,focusDirection:et,noFocusHighlight:it,isResizingContainer:rt,isJustAdded:G,isQuote:Boolean(nt),scrollTargetPosition:st});const zs=An?(0,c.em)(_n,An):void 0,Vs=!e.senderId,js=zs||Vs&&e.postAuthorTitle||(ri||lt)&&Yo?.postAuthorTitle||void 0;(0,j.A)(qn,re),(0,o.vJ)(()=>{const t=Hn.current;if(!t||!(0,I.Y)(t))return;Jt&&Jn({messageIds:[Mo]});let n=[];e.hasUnreadMention&&(n=[Mo]),h&&(n=h.messages.filter(e=>e.hasUnreadMention).map(e=>e.id)),n.length&&$n({chatId:No,messageIds:n})},[Jt,h,No,Mo,Jn,e.hasUnreadMention]);const Js=(0,o.Kr)(()=>ui?T(Do,Boolean(m),h,mo):void 0,[ui,Do,m,h,mo]),Gs=ri&&!ii?28:0,$s=(0,o.Kr)(()=>{let e,t,n,o="";if(!ui&&(Oo||Uo||Go?.extendedMedia)){let n;if(Oo||Uo){const e=Oo||Uo;e&&!li&&(n=(0,k.yA)({media:e,isOwn:Do,asForwarded:ri,noAvatars:m,isMobile:mo}).width)}else if(Go?.extendedMedia&&Go.extendedMedia.width&&Go.extendedMedia.height){const{width:e,height:t}=Go.extendedMedia;n=(0,b.kn)({width:e,height:t,fromOwnMessage:Do,asForwarded:ri,noAvatars:m,isMobile:mo}).width}n&&(n<(0,k.Ay)(mo)&&(t=n),e=Math.max((0,k.nP)(ms?.text,mo,ks),n))}else if(Js){const t=(0,k.nP)(ms?.text,mo,ks);e=Math.max(t,Js.containerStyle.width)}if(e)o=`width: ${e}px`,n=e+Vn;else if(jo&&!Ci){const{width:e}=(0,b.bu)(jo,mo);o=`width: ${e+Gs}px`,n=e+Vn}return{contentWidth:t,style:o,reactionsMaxWidth:n}},[Js,ri,Gs,Ci,Go?.extendedMedia,ui,ks,mo,Do,m,Oo,jo,ms?.text,Uo,li]),{contentWidth:qs,style:Hs,reactionsMaxWidth:Ws}=$s,_s=(0,v.A)(xs,Hs);function Qs(e){if(cs)return(0,be.Y)(ke.A,{messageOrStory:cs,translatedText:on?Ss:void 0,isForAnimation:e,focusedQuote:nt,focusedQuoteOffset:ot,emojiSize:Bs,highlight:At,isProtected:Qe,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,withTranslucentThumbs:ii,isInSelectMode:bt,canBeEmpty:Ai,maxTimestamp:wn,threadId:Nt})}const Zs=(0,o.hb)(()=>{if(Tt)return(0,be.Y)("div",{className:(0,f.A)("quick-reaction","no-selection",Ri&&!wt&&"visible"),onClick:Li,ref:Wn,children:(0,be.Y)(Pe.A,{reaction:Tt,size:zn,availableReactions:Pt,observeIntersection:u})})},[wt,Pt,Tt,Li,Ri,u]);function Xs(){const t=(0,be.Y)(en,{message:e,isPinned:Bt,withFullDate:lt&&!Do,noReplies:P,repliesThreadInfo:jt,outgoingStatus:Ge,signature:js,withReactionOffset:"inside"===Us,renderQuickReactionButton:Fs&&"in-meta"===Ks?Zs:void 0,availableReactions:Pt,isTranslated:Boolean(on?Ss:void 0),effectEmoji:yn?.emoticon,onClick:Hi,onEffectClick:rs,onTranslationClick:Wi,onOpenThread:_i,paidMessageStars:Rs});return"inside"!==Us?t:(0,be.Y)(fn.A,{message:Yt,threadId:Nt,metaChildren:t,observeIntersection:u,noRecentReactors:mt,tags:mn,isCurrentUserPremium:_,isAccountFrozen:kn})}function ea(e){const t=(0,f.A)("text-content","clearfix"),n=(0,f.A)("text-content","clearfix","in-text"===Os&&"with-meta",Ge&&"with-outgoing-icon"),o=ui||!ui&&Oo||!ui&&Uo&&!li||!si&&Ai,i="in-text"===Os;return(0,be.FD)(be.FK,{children:[ta(),us&&!si&&(0,be.FD)("div",{className:t,dir:"auto",children:[Qs(),ws&&(0,be.Y)("div",{className:"translation-animation",children:(0,be.Y)("div",{className:"text-loading",children:Qs(!0)})}),!o&&i&&Xs()]}),o&&(0,be.FD)(be.FK,{children:[na(e),!si&&(0,be.FD)("div",{className:n,dir:"auto",children:[Ai&&(0,be.Y)(pt,{factCheck:Fo,isToggleDisabled:bt}),i&&Xs()]})]})]})}function ta(){const t=(0,d.T_)(e);if(t&&xn)return(0,be.Y)(Kn,{messageWebPage:t,webPage:xn,message:e,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,noAvatars:m,canAutoLoad:Ot,canAutoPlay:Kt,asForwarded:ri,isDownloading:Rt,isProtected:Qe,theme:de,story:dn,isConnected:cn,lastPlaybackTimestamp:In,backgroundEmojiId:Si?.color?.backgroundEmojiId,shouldWarnAboutFiles:un,autoLoadFileMaxSizeMb:Vt,onAudioPlay:Ji,onMediaClick:Vi,onDocumentClick:ji,onCancelMediaTransfer:Zi})}function na(e){const t=(0,be.FD)(be.FK,{children:[ui&&n&&(0,be.Y)(Je,{album:h,albumLayout:Js,observeIntersection:n,isOwn:Do,isProtected:Qe,hasCustomAppendix:e,onMediaClick:Gi}),!ui&&Oo&&(0,be.Y)(Ke.A,{messageText:ms?.text,photo:Oo,isOwn:Do,observeIntersection:n,noAvatars:m,canAutoLoad:Ot,uploadProgress:$e,shouldAffectAppendix:e,isDownloading:Rt,isProtected:Qe,asForwarded:ri,theme:de,isMediaNsfw:bn,forcedWidth:qs,onClick:$i,onCancelUpload:Zi}),!ui&&Uo&&!li&&(0,be.Y)(ze.A,{video:Uo,isOwn:Do,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,forcedWidth:qs,noAvatars:m,canAutoLoad:Ot,canAutoPlay:Kt,uploadProgress:$e,isDownloading:Rt,isProtected:Qe,asForwarded:ri,isMediaNsfw:bn,lastPlaybackTimestamp:In,onClick:qi,onCancelUpload:Zi})]});return Eo?(0,be.Y)(sn,{chatId:No,messageId:Mo,paidMedia:Eo,isOutgoing:Do,children:t}):t}function oa(){return!(ii&&!ko)&&(y&&(!(Oo||Uo||$o||Eo)||Ht)||ri||ko||ce)&&!hi&&!(Lo&&ii)}function ia(){return(0,be.FD)("span",{className:"forward-title-container",children:[ri&&(0,be.Y)(we.A,{name:Yo?.hiddenUserName?"forward":"share-filled"}),ri&&(0,be.Y)("span",{className:"forward-title",children:_n("ForwardedFrom")})]})}const sa=(0,U.A)(t=>{"suggestedMessage"===t.button.type&&("approve"!==t.button.buttonType?"decline"!==t.button.buttonType?Rn({...t,button:t.button}):co():Un({chatId:No,messageId:e.id}))}),aa=(0,U.A)(e=>{ho(e.target.value)}),ra=(0,U.A)(()=>{On({chatId:No,messageId:e.id,rejectComment:uo.trim()||void 0}),lo(),ho("")});function da(t=!1,o=!1){let i;!Ni||ii&&ko?Yo?.hiddenUserName?i=Yo.hiddenUserName:Wo&&ye&&(i=(0,c.em)(_n,ye)):i=(0,c.em)(_n,Ni);const s=Ni&&"emojiStatus"in Ni&&Ni.emojiStatus,a=Ni&&"isPremium"in Ni&&Ni.isPremium,l=ri&&Ni,h=Ce?.hasUsername;return(0,be.FD)("div",{className:"message-title",dir:"ltr",children:[i||ri?(0,be.FD)("span",{className:(0,f.A)("message-title-name-container",Yo?.hiddenUserName?"sender-hidden":"interactive",void 0),dir:"ltr",children:[!t&&ia(),(0,be.FD)("span",{className:"message-title-name",children:[Wo&&(0,be.Y)(we.A,{name:"play-story"}),l&&(0,be.Y)(pe.A,{className:"forward-avatar",peer:Ni,size:"micro"}),(0,be.Y)("span",{className:"sender-title",onClick:Ui,children:i?(0,S.A)(i):ri?" ":void 0}),!ri&&s&&(0,be.Y)(ge.A,{documentId:s.documentId,className:"no-selection",loopLimit:r.J$1,observeIntersectionForLoading:n,observeIntersectionForPlaying:u}),!ri&&!s&&a&&(0,be.Y)(Ye.A,{}),Ni?.fakeType&&(0,be.Y)(Ne.A,{fakeType:Ni.fakeType})]})]}):Ce?void 0:" ",Ce?.hasUsername&&(0,be.FD)("span",{className:"interactive",children:[(0,be.Y)("span",{className:"via",children:_n("ViaBot")}),(0,be.Y)("span",{className:"sender-title",onClick:Ki,children:(0,S.A)(`@${(0,d.Kl)(Ce)}`)})]}),(0,be.Y)("div",{className:"title-spacer"}),o||h?void 0:Yo?.isLinkedChannelPost?(0,be.Y)("span",{className:"admin-title",dir:"auto",children:_n("DiscussChannel")}):e.postAuthorTitle&>&&!ri?(0,be.Y)("span",{className:"admin-title",dir:"auto",children:e.postAuthorTitle}):!$t||ri||ko?void 0:(0,be.Y)("span",{className:"admin-title",dir:"auto",children:$t.customTitle||_n($t.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin")}),di&&(0,be.FD)("span",{className:"sender-boosts","aria-hidden":!0,children:[(0,be.Y)(we.A,{name:hn>1?"boosts":"boost"}),hn>1?hn:void 0]})]})}const ca=gt&&ri?e.postAuthorTitle:void 0,la=e.suggestedPostInfo&&!e.isOutgoing&&!e.suggestedPostInfo.isAccepted&&!e.suggestedPostInfo.isRejected,ua=(0,o.Kr)(()=>{if(!e.suggestedPostInfo?.scheduleDate||!Pn)return!1;const t=(0,C.Fm)();return e.suggestedPostInfo.scheduleDate<=t+Pn},[e.suggestedPostInfo,Pn]);return(0,be.FD)("div",{ref:qn,id:(0,d.GZ)(e.id),className:hs,"data-message-id":Mo,onCopy:Qe?w.A:void 0,onMouseDown:ki,onClick:Pi,onContextMenu:Fi,onDoubleClick:Ti,onMouseEnter:mi?Oi:void 0,onMouseMove:Fs?xi:void 0,onMouseLeave:Fs||mi?Ei:void 0,children:[(0,be.Y)("div",{ref:Hn,className:"bottom-marker","data-message-id":Mo,"data-last-message-id":h?h.messages[h.messages.length-1].id:void 0,"data-album-main-id":h?h.mainMessage.id:void 0,"data-has-unread-mention":e.hasUnreadMention||void 0,"data-has-unread-reaction":Jt||void 0,"data-is-pinned":Bt||void 0,"data-should-update-views":void 0!==e.viewsCount}),!qe&&(0,be.Y)("div",{className:"message-select-control no-selection",children:St&&(0,be.Y)(we.A,{name:"select"})}),ie&&(0,be.Y)("div",{className:(0,f.A)("message-select-control group-select no-selection",Mt&&"is-selected"),onClick:is,children:Mt&&(0,be.Y)(we.A,{name:"select"})}),(0,be.FD)("div",{className:(0,f.A)("message-content-wrapper",Ls.includes("text")&&"can-select-text",Ls.includes("giveaway")&&"giveaway-result-content"),children:[(0,be.FD)("div",{className:Ls,style:_s,dir:"auto",children:[ri&&!hi&&(0,be.FD)(be.FK,{children:[oa()&&da(),ca&&(0,be.Y)("span",{className:"admin-title",dir:"auto",children:ca})]}),function(){const t=(0,f.A)("content-inner",ri&&"forwarded-message",yi&&"forwarded-custom-shape",Ci&&"with-subheader"),o=ne&&(!us||ps&&!Ai&&"inside"!==Us)&&!Ps,i=(0,f.A)("text-content","clearfix","in-text"===Os&&"with-meta",Ge&&"with-outgoing-icon"),s=!Yi||!Do||lt;return(0,be.FD)("div",{className:t,onDoubleClick:Di,dir:"auto",children:[!ri&&oa()&&da(),Ci&&(0,be.FD)("div",{className:"message-subheader",children:[Ht&&(0,be.Y)(Le,{topic:qt,onClick:ss,className:"message-topic"}),yi&&(0,be.FD)("div",{className:"forward-custom-shape-subheader",children:[(0,be.Y)("div",{className:"message-title",children:ia()}),da(!0,!0)]}),Lo&&(0,be.Y)(Ae.A,{message:Fe,replyInfo:Xo,noUserColors:Mi,isProtected:Qe,sender:Te,senderChat:xe,forwardSender:De,chatTranslations:Zt,isMediaNsfw:Mn,requestedChatTranslationLanguage:an,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,onClick:zi}),ni&&(0,be.Y)(Me,{story:Ue,sender:je,noUserColors:Mi,isProtected:Qe,observeIntersectionForLoading:n,onClick:as})]}),jo&&n&&u&&(0,be.Y)(Sn,{message:e,observeIntersection:n,observeIntersectionForPlaying:u,shouldLoop:zt,shouldPlayEffect:io,withEffect:rn,isMediaNsfw:bn,onStopEffect:ao}),si&&Ct&&(0,be.Y)(He,{customEmojiId:Ct,withEffects:rn&&Yn&&!yn,isOwn:Do,observeIntersection:n,forceLoadPreview:To,messageId:Mo,chatId:No,activeEmojiInteractions:Dt}),si&&yt&&(0,be.Y)(_e,{emoji:yt,withEffects:rn&&Yn&&!yn,isOwn:Do,observeIntersection:n,forceLoadPreview:To,messageId:Mo,chatId:No,activeEmojiInteractions:Dt}),rn&&yn&&!To&&(0,be.Y)(Qt.A,{shouldPlay:io,messageId:e.id,isMirrored:!e.isOutgoing,effect:yn,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,onStop:ao}),Ms&&(0,be.Y)(nn,{message:e,phoneCall:Ms,chatId:No}),!ui&&li&&!ti&&(0,be.Y)(vn.A,{message:e,observeIntersection:n,canAutoLoad:Ot,isDownloading:Rt,onReadMedia:s?Qi:void 0,onHideTranscription:Xn,isTranscriptionError:Po,isTranscribed:Boolean(ae),canTranscribe:pn&&!Yi,isTranscriptionHidden:Zn,isTranscribing:se}),(Ko||zo||ti)&&(0,be.Y)(me.Ay,{theme:de,message:e,origin:a.d9.Inline,uploadProgress:$e,isSelectable:qe,isSelected:St,noAvatars:m,onPlay:Ji,onReadMedia:zo&&s?Qi:void 0,onCancelUpload:Zi,isDownloading:Rt,isTranscribing:se,isTranscriptionHidden:Zn,isTranscribed:Boolean(ae),isTranscriptionError:Po,canDownload:!Qe,onHideTranscription:Xn,canTranscribe:pn&&!Yi}),Vo&&(0,be.Y)(fe.A,{document:Vo,message:e,observeIntersection:n,canAutoLoad:Ot,autoLoadFileMaxSizeMb:Vt,uploadProgress:$e,isSelectable:qe,isSelected:St,onMediaClick:ji,onCancelUpload:Zi,isDownloading:Rt,shouldWarnAboutFiles:un}),Wo&&!ci&&(0,be.Y)(Fn,{message:e,isProtected:Qe}),ci&&(0,be.Y)(Tn,{message:e}),Jo&&(0,be.Y)(at,{contact:Jo,noUserColors:Do}),Cn&&(0,be.Y)(gn,{message:e,poll:Cn,onSendVote:Xi}),Zo&&(0,be.Y)(Dn,{message:e,todoList:Zo}),(_o||Qo)&&(0,be.Y)(kt,{message:e}),Ho&&(0,be.Y)(ft,{message:e,threadId:Nt,canAutoLoadMedia:Ot}),Go?.extendedMedia&&(0,be.Y)(Ut,{message:e,isConnected:cn}),ti&&(0,be.Y)("p",{className:(0,f.A)("transcription",!Zn&&Po&&"transcription-error"),dir:"auto",children:Po?_n("NoWordsRecognized"):se&&ae?(0,be.Y)(ve.A,{content:ae}):ae}),ps&&ea(o),!ps&&(0,be.FD)(be.FK,{children:[na(o),us&&!si&&(0,be.FD)("div",{className:i,dir:"auto",children:[Qs(),ws&&(0,be.Y)("div",{className:"translation-animation",children:(0,be.Y)("div",{className:"text-loading",children:Qs(!0)})}),Ai&&(0,be.Y)(pt,{factCheck:Fo,isToggleDisabled:bt}),"in-text"===Os&&Xs()]}),ta()]}),Go&&!Go.extendedMedia&&(0,be.Y)(Et,{message:e,shouldAffectAppendix:o&&!ai,isInSelectMode:bt,isSelected:St,theme:de,forcedWidth:qs}),$o&&(0,be.Y)(Wt,{message:e,isInSelectMode:bt,isSelected:St,theme:de,peer:ue})]})}(),!mi&&"standalone"===Os&&!ci&&Xs(),gi&&(0,be.FD)("div",{className:(0,f.A)("message-action-buttons",We&&"message-action-buttons-shown"),children:[Ps&&ii&&(0,be.Y)(tt,{threadInfo:Ns,disabled:Y||!Ns,isLoading:We,isCustomShape:!0,asActionButton:!0}),fi&&(0,be.Y)(Be.A,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:_n("lng_context_forward_msg"),onClick:ie?es:ts,children:(0,be.Y)(we.A,{name:"share-filled"})}),vi&&(0,be.Y)(Be.A,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:Qn("FocusMessage"),onClick:Lt?ns:os,children:(0,be.Y)(we.A,{name:"arrow-right"})})]}),Ps&&!ii&&(0,be.Y)(tt,{threadInfo:Ns,disabled:Y||!Ns,isLoading:We}),Es&&(0,be.Y)(_t.A,{isOwn:Do}),Fs&&"in-content"===Ks&&Zs()]}),e.inlineButtons&&(0,be.Y)(Ft,{message:e,onClick:Bn}),la&&(0,be.Y)(Ft,{message:{...e,inlineButtons:[[{type:"suggestedMessage",buttonType:"decline",text:Qn("SuggestedPostDecline")},{type:"suggestedMessage",buttonType:"approve",text:Qn("SuggestedPostApprove"),disabled:ua}],[{type:"suggestedMessage",buttonType:"suggestChanges",text:Qn("SuggestedPostSuggestChanges")}]]},onClick:sa}),"outside"===Us&&!ci&&(0,be.Y)(fn.A,{message:Yt,threadId:Nt,isOutside:!0,isCurrentUserPremium:_,maxWidth:Ws,observeIntersection:u,noRecentReactors:mt,tags:mn,isAccountFrozen:kn})]}),fo&&(0,be.Y)(ct,{isOpen:go,anchor:fo,targetHref:vo?.matches("a[href]")?vo.href:void 0,message:e,album:h,messageListType:xt,onClose:Co,onCloseAnimationEnd:wo,repliesThreadInfo:jt,noReplies:P,detectedLanguage:ys}),ro&&(0,be.FD)(Re.A,{isOpen:ro,onClose:lo,title:Qn("SuggestedPostDecline"),confirmLabel:Qn("SuggestedPostDecline"),confirmHandler:ra,confirmIsDestructive:!0,children:[(0,be.Y)("div",{className:"decline-dialog-question",children:(0,S.A)(Qn("DeclinePostDialogQuestion",{sender:ue?(0,c.em)(_n,ue):""},{withNodes:!0,withMarkdown:!0}))}),(0,be.Y)(Oe.A,{placeholder:Qn("DeclineReasonPlaceholder"),value:uo,onChange:aa,maxLength:200})]})]})}))},91930:(e,t,n)=>{n.d(t,{A:()=>L,b:()=>x});var o=n(84051),i=n(31481),s=n(90709),a=n(3544),r=n(70636),d=n(87357),c=n(17663),l=n(48899),u=n(91034),h=n(48775),m=n(76023),p=n(4961),g=n(18501),f=n(35749),v=n(2338),A=n(11217),y=n(5912),C=n(39351),w=n(62587),I=n(59030),b=n(64154),S=n(42452),M=n(18276),N=n(27860),Y=n(18653),k=n(86070),P=n(20021);const F=" ",T=({className:e,message:t,replyInfo:n,suggestedPostInfo:u,sender:m,senderChat:N,forwardSender:T,composerForwardSenders:x,title:L,customText:E,isProtected:B,isInComposer:R,noUserColors:O,chatTranslations:U,requestedChatTranslationLanguage:K,isMediaNsfw:z,noCaptions:V,observeIntersectionForLoading:j,observeIntersectionForPlaying:J,onClick:G})=>{const $=(0,o.li)(),q=(0,y.Vz)($,j),H=(0,o.Kr)(()=>{const e="message"===n?.type&&n.replyMedia||t?.content;if(e)return{content:e}},[t,n]),W=H?.content?.video?.isGif?H.content.video:void 0,_=Boolean(W&&!W.previewPhotoSizes?.length),Q=(0,f.A)(H,_?"full":"pictogram"),Z=(0,w.A)(Q,!q),X=(0,v.A)(H),ee=Boolean(H&&(0,s.lk)(H)),te=Boolean(H&&(0,s.y2)(H))||z,ne=Boolean("message"===n?.type&&n.isQuote),oe="message"===n?.type?n.replyFrom:void 0,ie=t&&(0,s.ZR)(t),{translatedText:se}=(0,b.A)(U,t?.chatId,ie?t?.id:void 0,K),ae=(0,I.A)(),re=(0,C.A)(),de=m?(0,r.F9)(ae,m):oe?.hiddenUserName||t?.forwardInfo?.hiddenUserName,ce=(0,o.Kr)(()=>{if(!x)return;const e=x.map(e=>(0,r.F9)(re,e)).filter(Boolean);return re.conjunction(e)},[x,re]),le=N?(0,r.F9)(ae,N):void 0,ue=T?(0,r.F9)(ae,T):t?.forwardInfo?.hiddenUserName,he=m&&m.id===T?.id,{handleClick:me,handleMouseDown:pe}=(0,A.Q)(G);return(0,P.FD)(k.A,{peer:m,emojiIconClassName:"EmbeddedMessage--background-icons",ref:$,shouldReset:!0,isReply:Boolean(n),noUserColors:O,className:(0,d.A)("EmbeddedMessage",e,ne&&"is-quote",X&&"with-thumb","no-selection",x&&"is-input-forward",u&&"is-suggested-post"),dir:re.isRtl?"rtl":void 0,onClick:me,onMouseDown:pe,children:[(0,P.Y)("div",{className:"hover-effect"}),(0,P.Y)(S.A,{}),X&&D(X,Z,_,ee,B,te),(0,P.FD)("div",{className:"message-text",children:[(0,P.Y)("p",{className:(0,d.A)("embedded-text-wrapper",ne&&"multiline"),children:function(){if(u){if(!u?.price?.amount&&!u.scheduleDate)return re("ComposerEmbeddedMessageSuggestedPostDescription");const e=u.price?u.price.currency===i.ykW?(0,h.Ms)(re,u.price.amount,{className:"suggested-price-ton-icon",shouldConvertFromNanos:!0}):(0,h.U2)(re,u.price.amount,{className:"suggested-price-star-icon"}):"",t=u.scheduleDate?(0,c.e0)(u.scheduleDate,re,ae):"";return e&&!t?(0,P.Y)("span",{className:"suggested-post-price-wrapper",children:re("TitleSuggestedPostAmountForAnyTime",{amount:e},{withNodes:!0,withMarkdown:!0})}):(0,P.FD)("span",{className:"suggested-post-price-wrapper",children:[e,t?` • ${t}`:""]})}return"message"===n?.type&&n.quoteText?(0,g.fd)({text:n.quoteText.text,entities:n.quoteText.entities,asPreview:!0,emojiSize:17}):t?V?re("EmbeddedMessageNoCaption"):(0,P.Y)(Y.A,{message:t,noEmoji:Boolean(X),translatedText:se,observeIntersectionForLoading:j,observeIntersectionForPlaying:J,emojiSize:17}):E||function(e){if(!e||e.content.text)return F;const t=(0,a.GG)(re,e.content,{});return t?(0,P.Y)("span",{children:(0,p.A)(t)}):F}(H)||F}()}),(0,P.FD)("div",{className:"message-title",children:[function(){if(L)return(0,p.A)(L);if(u&&n)return re("TitleSuggestedChanges");if(u)return re("ComposerEmbeddedMessageSuggestedPostTitle");if(!de&&!ce)return F;let e;N&&((0,s.WX)(N)&&(e="channel-filled"),(0,s.YE)(N)&&(e="group-filled"));const t=R&&Boolean(n&&"quoteText"in n&&n?.quoteText);return(0,P.FD)("span",{className:"embedded-sender-wrapper",children:[(!N||!!(0,l.L8)(N?.id)||N.id!==m?.id)&&(0,P.FD)("span",{className:"embedded-sender",children:[!x&&de&&(0,p.A)(t?ae("ReplyToQuote",de):de),ce&&(0,p.A)(re("ComposerTitleForwardFrom",{users:ce},{withNodes:!0,withMarkdown:!0}))]}),e&&(0,P.Y)(M.A,{name:e,className:"embedded-chat-icon"}),e&&le&&(0,P.Y)("span",{className:"embedded-sender-chat",children:(0,p.A)(le)})]})}(),ue&&!he&&(0,P.FD)("span",{className:"embedded-forward-sender-wrapper",children:[(0,P.Y)(M.A,{name:T?"share-filled":"forward",className:"embedded-origin-icon"}),(0,P.Y)("span",{className:"forward-sender-title",children:(0,p.A)(ue)})]})]})]})]})};function D(e,t,n,o,i,s){const{width:a,height:r}=(0,m.mr)(),c=t||e,l=n&&t;return(0,P.FD)("div",{className:(0,d.A)("embedded-thumb",o&&"round"),children:[!s&&!l&&(0,P.Y)("img",{src:c,width:a,height:r,alt:"",className:"pictogram",draggable:!1}),!s&&l&&(0,P.Y)("video",{src:t,width:a,height:r,playsInline:!0,disablePictureInPicture:!0,className:"pictogram"}),(0,P.Y)(N.A,{thumbDataUri:l?e:c,isVisible:Boolean(s),width:a,height:r}),i&&(0,P.Y)("span",{className:"protector"})]})}const x=(0,u.A)(T),L=T},92111:(e,t,n)=>{n.d(t,{A:()=>v});var o=n(84051),i=n(13439),s=n(23174),a=n(90709),r=n(91048),d=n(39761),c=n(87679),l=n(58554),u=n(95704),h=n(37836),m=n(46051),p=n(66991);const g={},f=(0,h.v7)(1e3),v=function(e,t){(0,o.vJ)(()=>{if(void 0===e)return;(Array.isArray(e)?e:[e]).forEach(e=>{const n=t||(0,i.mS)().stories.byPeerId[e]?.orderedIds?.[0];n&&(async e=>{await f,e.forEach(({hash:e,format:t,isStream:n})=>{n?async function(e){const t=(0,u.h)((0,l.RB)(e));let n=0;for await(const e of t)if(n+=e.byteLength,n>=2097152)break}(e):l.hd(e,t).then(e=>{e&&(t===s.qZ.Progressive&&function(e){const t=document.head,n=document.createElement("video");n.preload="auto",n.src=e,n.muted=!0,n.autoplay=!0,n.disableRemotePlayback=!0,n.style.display="none",t.appendChild(n),n.load(),setTimeout(()=>{(0,d.A)(n),t.removeChild(n)},1e3)}(e),t===s.qZ.BlobUrl&&(0,c.NN)(e))})})})(function(e,t){const n=(0,r._bp)((0,i.mS)(),e);if(!n||!n.orderedIds?.length)return[];const o=function(e,t){const n=e.indexOf(t),o=Math.max(n-5,0),i=Math.min(n+5,e.length);return e.slice(o,i)}(n.orderedIds,t),d=[];return o.forEach(t=>{if(g[e]?.has(t))return;const o=n.byId[t];if(!o||!("content"in o))return;const i=Boolean(o.content.video);d.push({hash:(0,a.EN)(o,"full"),format:i?s.qZ.Progressive:s.qZ.BlobUrl,isStream:i&&(0,p.c)(m.G)}),d.push({hash:(0,a.EN)(o),format:s.qZ.BlobUrl}),o.content.altVideos&&d.push({hash:(0,a.EN)(o,"full",!0),format:s.qZ.Progressive}),g[e]=(g[e]||new Set).add(t)}),d}(e,n))})},[t,e])}},93809:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051),i=n(30857),s=n(35297);function a(e,t){const n=void 0===t,a=(0,o.li)(n),r=(0,o.li)(),d=(0,i.A)();return(0,s.A)(()=>{n||(a.current=!1,r.current&&(clearTimeout(r.current),r.current=void 0))},e),(0,o.vJ)(()=>{if(n||a.current)return;const e=()=>{a.current=!0,d()};t>0?r.current=window.setTimeout(e,t):e()},e),a.current}},95362:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(37836);const i=10,s=1e3;let a=[],r=!1;function d(e,t){a.push({url:e,filename:t}),r||(r=!0,setTimeout(async()=>{await async function(){let e=0;for(const t of a)c(t),e++,e===i&&(await(0,o.v7)(s),e=0);a=[]}(),r=!1},s))}function c({url:e,filename:t}){const n=document.createElement("a");n.href=e,n.target="_blank",n.rel="noopener noreferrer",n.download=t;try{n.click()}catch(e){console.error(e)}}},95704:(e,t,n)=>{n.d(t,{h:()=>l});var o=n(23174),i=n(4875);const s=262144,a=5242879,r=new Map,d=new Map,c=new Map;async function*l(e,t=0,n=s){const l=e.match(/fileSize=(\d+)/);let u;for(u=l?l&&Number(l[1]):d.get(e);;){if(u&&t>=u)return;let s=t+n-1;u&&s>u&&(s=u-1);const l=`${e}:${t}-${s}`;let h=r.get(l);if(!h){let n=c.get(l);n||(n=(0,i.px)("downloadMedia",{mediaFormat:o.qZ.Progressive,url:e,start:t,end:s}),c.set(l,n));const m=await n.finally(()=>{c.delete(l)});if(!m?.arrayBuffer)return;m.fullSize&&!u&&(u=m.fullSize,d.set(e,m.fullSize)),h=m.arrayBuffer,s<=a&&r.set(l,m.arrayBuffer)}yield h,t=s+1}}},97046:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"MuteChatModal",!t);return n?(0,s.Y)(n,{...e}):void 0}},97676:(e,t,n)=>{n.d(t,{A:()=>m});var o=n(84051),i=n(87357),s=n(37661),a=n(5912),r=n(17712),d=n(62587),c=n(10221),l=n(18104),u=n(3325);var h=n(20021);const m=(0,o.ph)(({messageId:e,isMirrored:t,effect:n,shouldPlay:m,observeIntersectionForLoading:p,observeIntersectionForPlaying:g,onStop:f})=>{const v=(0,o.li)(),A=(0,o.li)(),y=(0,a.Vz)(v,p),C=(0,a.Vz)(v,g),[w,I,b]=(0,s.A)(),[S,M,N]=(0,s.A)(),Y=function(e){return e.effectAnimationId?`sticker${e.effectAnimationId}`:`sticker${e.effectStickerId}?size=f`}(n),k=(0,d.A)(Y,!y),P=(0,r.A)(()=>{b(),f?.()}),F=(0,c.A)({anchorRef:v,overlayRef:A,isMirrored:t,isDisabled:!w,isForMessageEffect:!0,id:n.id});(0,o.vJ)(()=>{S&&F(),N()},[F,N,S]),(0,o.vJ)(()=>{C&&m&&k&&(I(),M())},[C,k,m,F]);const T=(0,i.A)("McmbiWZE",t&&"wNvU2uqi");return(0,h.Y)("div",{className:(0,i.A)("IYu2f7FM",t&&"GsTZawTE"),ref:v,children:w&&(0,h.Y)(u.A,{children:(0,h.Y)(l.A,{ref:A,className:T,tgsUrl:k,size:256,play:!0,isLowPriority:!0,noLoop:!0,forceAlways:!0,onEnded:P},`effect-${e??n.id}`)})})})},97967:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"ChatFolderModal",!t);return n?(0,s.Y)(n,{...e}):void 0}}}]);
//# sourceMappingURL=1767.8e41a93c91cdf9433fbb.js.map