TelegramPWA/dist/1767.8e41a93c91cdf9433fbb.js
Alexander Zinchuk f944ea6dc1 [Build]
2025-11-06 12:19:52 +01:00

2 lines
395 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[1767],{45:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(84051),i=n(41036),s=n(18276),a=n(20021),r=function(e){return e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read",e}(r||{});const d=(0,o.ph)(({status:e})=>(0,a.Y)("div",{className:"MessageOutgoingStatus",children:(0,a.Y)(i.Ay,{name:"reveal",activeKey:r[e],children:"failed"===e?(0,a.Y)("div",{className:"MessageOutgoingStatus--failed",children:(0,a.Y)(s.A,{name:"message-failed"})}):(0,a.Y)(s.A,{name:`message-${e}`})})}))},285:(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(94189),l=n(20021);const u=(0,o.ph)((0,i.EK)((e,{userId:t})=>{const n=(0,a.meB)(e),o=t&&(0,a.mBe)(e,t);return{chat:n,contactName:o?(0,s.u0)(o):void 0}})(({isOpen:e,chat:t,userId:n,contactName:s,onClose:a})=>{const{deleteChatMember:u}=(0,i.ko)(),h=(0,d.A)(),m=(0,o.hb)(()=>{u({chatId:t.id,userId:n}),a()},[t,u,a,n]);if(t&&n)return(0,l.Y)(c.A,{isOpen:e,onClose:a,title:h("GroupRemoved.Remove"),textParts:(0,r.A)(h("PeerInfo.Confirm.RemovePeer",s)),confirmLabel:h("lng_box_remove"),confirmHandler:m,confirmIsDestructive:!0})}))},2178:(e,t,n)=>{n.d(t,{v:()=>r});var o=n(84051),i=n(46536);const s=new Set(["INPUT","TEXTAREA","SELECT"]),a=(0,i.h)();function r(e){(0,o.vJ)(()=>{if(!e)return;const t=Object.entries(e);return a.addCallback(function(e){(function(e){return!(e.target instanceof HTMLElement)||!s.has(e.target.tagName)})(e)&&t.forEach(([t,n])=>{(function(e){return t=>function(e,t){const{alt:n,ctrl:o,meta:i,mod:s,shift:a,key:r}=e,{altKey:d,ctrlKey:c,metaKey:l,shiftKey:u,key:h}=t;if(n!==d)return!1;if(s){if(!c&&!l)return!1}else{if(o!==c)return!1;if(i!==l)return!1}return a===u&&Boolean(r&&(h.toLowerCase()===r.toLowerCase()||t.code.replace("Key","").toLowerCase()===r.toLowerCase()))}(function(e){const t=e.toLowerCase().split("+").map(e=>e.trim()),n={alt:t.includes("alt"),ctrl:t.includes("ctrl"),meta:t.includes("meta"),mod:t.includes("mod"),shift:t.includes("shift")},o=["alt","ctrl","meta","shift","mod"];return{...n,key:t.find(e=>!o.includes(e))}}(e),t)})(t)(e)&&n(e)})})},[e])}document.documentElement.addEventListener("keydown",a.runCallbacks)},2429:(e,t,n)=>{n.d(t,{A:()=>o});const o={root:"CdTfL4f7",fadeIn:"MyeHARy0",closing:"EZbKn_M3",peer:"kW0xpExG",name:"BDZrSTO_",name_hasUnreadStory:"OoUm5AUZ",nameHasUnreadStory:"OoUm5AUZ",hidden:"lnVtxMZI",contextMenu:"N1sagA0s"}},3225:(e,t,n)=>{n.d(t,{A:()=>C});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(16120),d=n(96454),c=n(36353),l=n(39074),u=n(58734),h=n(63988),m=n(83414),p=n(19129),g=n(37661),f=n(17712);const v=300,A=new RegExp(`(${r.A.source})$`,"g"),y=new RegExp(`${s.bpX.source}$`,"g");function C(e,t,n,C,w,I){const{loadCustomEmojiForEmoji:b,clearCustomEmojiForEmoji:S}=(0,i.ko)(),[M,N,Y]=(0,g.A)(!1),k=(0,h.gs)(()=>{const n=t();if(!e||!n||!C()?.collapsed)return;if(!n.match(d.TL?r.A:s.bpX))return;const o=(0,l.LV)(w.current);return o.match(d.TL?A:y)?.[0]},[t,C,w,e],v),P=(0,m.A)(k,[k,t,C],!0),F=(0,p.A)(()=>Boolean(P()),[P]),T=Boolean(I?.length);(0,o.vJ)(()=>{if(!e||!F)return;const t=P();if(t){if(!T){const e=d.TL?t:t.match(/.+alt="(.+)"/)?.[1];e&&b({emoji:e})}}else S()},[e,F,P,T,S,b]);const D=(0,f.A)(t=>{const o=P();if(!e||!o)return;const i=w.current,s=(0,l.LV)(i),r=d.TL?o:o.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),h=new RegExp(`(${r})\\1*$`,""),m=s.match(h)[0].length/o.length,p=s.replace(h,(0,u.hB)(t).repeat(m)),g=i.innerHTML.substring(s.length);n(`${p}${g}`),(0,a.Uz)(()=>{(0,c.A)(i,!0,!0)})});return(0,o.vJ)(Y,[Y,t]),{isCustomEmojiTooltipOpen:Boolean(F&&T&&!M),closeCustomEmojiTooltip:N,insertCustomEmoji:D}}},5130:(e,t,n)=>{n.d(t,{U:()=>a});var o=n(14235),i=n(37836);class s{requestStates=new Map;requestStatesByCallback=new Map;pendingPayloads=[];pendingTransferables=[];constructor(e,t,n){this.target=e,this.onUpdate=t,this.channel=n}destroy(){}init(...e){this.postMessageOnTickEnd({type:"init",args:e})}request(e){const{requestStates:t,requestStatesByCallback:n}=this,{transferables:i,...s}=e,a=(0,o.A)(),r={type:"callMethod",messageId:a,...s},d={messageId:a},c=new Promise((e,t)=>{Object.assign(d,{resolve:e,reject:t})});if("function"==typeof r.args[r.args.length-1]){r.withCallback=!0;const e=r.args.pop();d.callback=e,n.set(e,d)}return t.set(a,d),c.catch(()=>{}).finally(()=>{t.delete(a),d.callback&&n.delete(d.callback)}),this.postMessageOnTickEnd(r,i),c}cancelCallback(e){e.isCanceled=!0;const{messageId:t}=this.requestStatesByCallback.get(e)||{};t&&this.postMessageOnTickEnd({type:"cancelProgress",messageId:t})}onMessage(e){const{requestStates:t,channel:n}=this;e.channel===n&&e.payloads.forEach(e=>{if("update"===e.type&&this.onUpdate&&this.onUpdate(e.update),"methodResponse"===e.type){const n=t.get(e.messageId);n&&(e.error?n.reject(e.error):n.resolve(e.response))}else if("methodCallback"===e.type){const n=t.get(e.messageId);n?.callback?.(...e.callbackArgs)}else if("unhandledError"===e.type)throw new Error(e.error?.message)})}postMessageOnTickEnd(e,t){this.pendingPayloads.push(e),t&&this.pendingTransferables.push(...t),this.postMessagesOnTickEnd()}postMessagesOnTickEnd=(0,i.Fe)(()=>{const{channel:e}=this,t=this.pendingPayloads,n=this.pendingTransferables;this.pendingPayloads=[],this.pendingTransferables=[],this.target.postMessage({channel:e,payloads:t},n)})}function a(e,t,n){const o=new s(e,t,n);function i({data:e}){o.onMessage(e)}return e.addEventListener("message",i),o.destroy=()=>{e.removeEventListener("message",i)},o}},6070:(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,"CustomSendMenu",!t);return n?(0,s.Y)(n,{...e}):void 0}},7985:(e,t,n)=>{n.d(t,{A:()=>g});var o=n(84051),i=n(66644),s=n(83868),a=n(17712);const r=7,d=100,c=7,l="no-overscroll",u="no-touch",h=350,m=75,p={lastDeltas:new Array(r).fill(0),lastAverageDelta:0,isStartedAtTop:!1,resetStartTopAt:void 0,timeout:void 0};function g({containerRef:e,isOverscrolled:t,isDisabled:n,onOverscroll:g,onReset:f}){const[v,A]=(0,o.Ul)("normal"),y=(0,o.li)({...p}),C=(0,o.li)(),w=(0,o.li)(),I=(0,a.A)(()=>{clearTimeout(C.current),A("overscroll"),g?.()}),b=(0,a.A)(()=>{A("animating"),C.current=window.setTimeout(()=>{A("normal")},h),f?.()}),S=(0,a.A)(e=>{clearTimeout(y.current.timeout),y.current.timeout=window.setTimeout(()=>{y.current={...p}},e)}),M=(0,a.A)(t=>{const n=e.current;if(!n||t.defaultPrevented)return;const{deltaY:o}=t,{scrollTop:i}=n,a=v(),l=y.current,u=l.lastAverageDelta,h=0===l.lastDeltas.at(-1)||l.resetStartTopAt&&Date.now()>=l.resetStartTopAt;0===i&&h&&(l.isStartedAtTop=!0,l.resetStartTopAt=void 0);const m=y.current.lastDeltas.slice();m.push(o),m.length>r&&m.shift(),y.current.lastDeltas=m;const p=m.reduce((e,t)=>e+t,0)/m.length;y.current.lastAverageDelta=p;const g=Math.abs(p)-Math.abs(u)>c;return S(d),0===i&&o<0&&"overscroll"!==a?(l.resetStartTopAt||(l.resetStartTopAt=Date.now()+d),void(g&&l.isStartedAtTop&&I())):"animating"===a&&o>0?void(0,s.A)(t):"overscroll"===a&&o>0?(b(),void(0,s.A)(t)):void 0}),N=(0,a.A)(t=>{const n=e.current;if(!n||1!==t.touches.length)return;const{scrollTop:o}=n,i=v();0!==o&&"overscroll"!==i||(w.current=t.touches[0].clientY)}),Y=(0,a.A)(t=>{const n=e.current,o=w.current;if(!n||void 0===o||1!==t.touches.length)return;const{scrollTop:i}=n,s=v(),a=t.touches[0].clientY-o;return"animating"!==s?0===i&&a>m&&"overscroll"!==s?(I(),void(w.current=void 0)):"overscroll"===s&&a<-m?(b(),void(w.current=void 0)):void 0:void 0}),k=(0,a.A)(()=>{w.current=void 0});(0,o.vJ)(()=>{const t=e.current;if(!n&&t)return(0,i.RK)(()=>{t.classList.add(l)}),()=>{(0,i.RK)(()=>{t.classList.remove(l)})}},[e,n]),(0,o.vJ)(()=>{const t=e.current;if(!n&&t)return(0,i.RK)(()=>{t.classList.toggle(u,"normal"!==v())}),()=>{(0,i.RK)(()=>{t.classList.remove(u)})}},[e,n,v]),(0,o.vJ)(()=>{(t||"animating"!==v())&&A(t?"overscroll":"normal")},[t,v,A]),(0,o.vJ)(()=>{const t=e.current;if(!n&&t)return t.addEventListener("wheel",M,{passive:"normal"===v()}),t.addEventListener("touchstart",N,{passive:!0}),t.addEventListener("touchmove",Y,{passive:!0}),t.addEventListener("touchend",k,{passive:!0}),t.addEventListener("touchcancel",k,{passive:!0}),()=>{t.removeEventListener("wheel",M),t.removeEventListener("touchstart",N),t.removeEventListener("touchmove",Y),t.removeEventListener("touchend",k),t.removeEventListener("touchcancel",k);const e=y.current;e?.timeout&&clearTimeout(e.timeout)}},[e,M,N,Y,k,v,n])}},9442:(e,t,n)=>{n.d(t,{A:()=>C});var o=n(84051),i=n(13439),s=n(23174),a=n(66644),r=n(90709),d=n(70636),c=n(36353),l=n(87894),u=n(39074),h=n(17778),m=n(63988),p=n(83414),g=n(37661),f=n(39351),v=n(17712);const A=300;let y;try{y=/(^|\s)@[-_\p{L}\p{M}\p{N}]*$/giu}catch(e){y=/(^|\s)@[-_\d\wа-яёґєії]*$/gi}function C(e,t,n,C,I,b,S,M){const N=(0,f.A)(),[Y,k]=(0,o.J0)(),[P,F,T]=(0,g.A)(!1),D=(0,m.gs)(()=>{const n=t();if(!e||!C()?.collapsed||!n.includes("@"))return;const o=(0,u.LV)(I.current);return(0,h.S)(o).match(y)?.[0].trim()},[e,t,C,I],A),x=(0,p.A)(D,[D,t,C],!0),L=(0,p.A)(()=>e&&t().startsWith("@"),[t,e]);(0,o.vJ)(()=>{const e=x();if(!e||!b&&!S)return void k(void 0);const t=(0,i.mS)().users.byId;if(!t)return void k(void 0);const n=b?.reduce((e,t)=>(t.userId!==M&&e.push(t.userId),e),[]),o=e.substring(1),s=(0,d.PU)({ids:(0,l.Am)([...L()&&S||[],...n||[]]),query:o,type:"user"});k(Object.values((0,l._E)(t,s)))},[M,b,S,x,L]);const E=(0,v.A)((e,t=!1,o=!1)=>{if(!e.hasUsername&&!(0,d.F9)(N,e))return;const i=(0,r.Kl)(e),l=(0,d.F9)(N,e)||"",h=i?`@${i}`:`<a\n class="text-entity-link"\n data-entity-type="${s.C7.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n dir="auto"\n >${l}</a>`,m=I.current,p=w((0,u.LV)(m)),g=o?p.length:p.lastIndexOf("@"),f=(i?i.length+1:l.length)-(p.length-g);if(-1!==g){const e=`${p.substr(0,g)}${h}&nbsp;`,o=w(m.innerHTML).substring(p.length),i=(0,u.JC)(m);n(`${e}${o}`),(0,a.Uz)(()=>{const e=i+f+1;(0,c.A)(m,t),e>=0&&(0,u.vZ)(m,e)})}k(void 0)});return(0,o.vJ)(T,[T,t]),{isMentionTooltipOpen:Boolean(Y?.length&&!P),closeMentionTooltip:F,insertMention:E,mentionFilteredUsers:Y}}function w(e){return e.replace(/<div>(<br>|<br\s?\/>)?<\/div>/gi,"<br>")}},9717:(e,t,n)=>{n.d(t,{A:()=>u});var o=n(84051),i=n(87894),s=n(79882),a=n(30857),r=n(17712),d=n(73767),c=n(35297);const l={};function u(e,t){const n=(0,o.Kr)(()=>{if(e)return e.reduce((e,t,n)=>(e[t]=n,e),{})},[e]),u=(0,d.A)(n),h=(0,d.A)(t),m=(0,o.li)(l),p=(0,a.A)(),g=(0,r.A)(()=>{m.current!==l&&(m.current=l,p())});(0,c.A)(()=>{if(!n||!u||t!==h)return void(m.current=l);const e=(0,i.LG)(n,(e,t)=>void 0!==u[t]?e-u[t]:-1/0),o=Object.values(e).some(e=>0!==e);m.current=o?e:l},[t,n,h,u]);const f=(0,s.W)(m.current);return{orderDiffById:m.current,getAnimationType:f,onReorderAnimationEnd:g}}},10221:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(84051),i=n(66644),s=n(76023),a=n(17712);const r=s.$;function d({anchorRef:e,overlayRef:t,isMirrored:n,isForMessageEffect:s,isDisabled:d,id:c}){const l=(0,a.A)(()=>{const o=t.current,a=e.current;if(!o||!a)return;const d=a.getBoundingClientRect(),c=o.getBoundingClientRect(),l=window.innerWidth;(0,i.RK)(()=>{const e=d.top+d.height/2,t=d.bottom,i=s?t:e;o.style.top=i-c.height/2+"px",n?o.style.left=d.left-r+"px":o.style.right=l-d.right-r+"px"})});return(0,o.vJ)(()=>{d||l()},[d,c]),(0,o.vJ)(()=>{if(d)return;const t=e.current.closest(".MessageList");return t?(t.addEventListener("scroll",l,{passive:!0}),()=>{t.removeEventListener("scroll",l)}):void 0},[d,e]),l}},11359:(e,t,n)=>{n.d(t,{L:()=>i});const o=5;function i(e,t){const{commonAncestorContainer:n}=e;let i=n,s=1;for(;i&&i.id!==t&&s<o;)i=i.parentElement,s++;return Boolean(i&&i.id===t)}},11462:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(30857),s=n(17712),a=n(35297);function r(e=!1){const t=(0,o.li)(e),n=(0,o.li)(!1),r=(0,i.A)();(0,a.A)(()=>{e&&(t.current=!0)},[e]);const d=(0,s.A)(()=>{t.current=!1,n.current=!1,r()}),c=(0,s.A)(()=>{n.current=!0,r()});return{shouldRenderForumPanel:t.current,isAnimationStarted:n.current,handleForumPanelAnimationEnd:d,handleForumPanelAnimationStart:c}}},14413:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(84051),i=n(13439),s=n(31481),a=n(39351),r=n(19806),d=n(94189);var c=n(20021);const l=(0,o.ph)((0,i.EK)(e=>({verifyAgeMin:e.appConfig.verifyAgeMin||s.lYi}))(({isOpen:e,onClose:t,shouldAlwaysShow:n,onAlwaysShowChanged:o,confirmHandler:i,verifyAgeMin:s})=>{const l=(0,a.A)();return(0,c.FD)(d.A,{title:l("TitleSensitiveModal",{years:s}),confirmLabel:l("ButtonSensitiveView"),isOpen:e,onClose:t,confirmHandler:i,children:[l("TextSensitiveModal"),(0,c.Y)(r.A,{className:"mYXi2mIC",label:l("ButtonSensitiveAlways",{years:s}),checked:n,onCheck:o})]})}))},15006:(e,t,n)=>{n.d(t,{U:()=>p,A:()=>m});var o=n(84051),i=n(13439),s=n(31481),a=n(91048),r=n(6842),d=n(14235);const c={root:"AN8wkEiR",ghost:"ANWk2pWP",scale:"kMHxyoSt",elementContainer:"UDCMfXxs"};var l=n(20021);const u=50,h=1e3,m=(0,o.ph)(()=>(0,l.Y)("div",{className:c.root,id:s.Lj4}));function p(e){const t=(0,i.mS)();if(!(0,a.Rwe)(t))return!1;const n=e.getBoundingClientRect(),o=n.left+window.scrollX,h=n.top+window.scrollY,m=n.width,p=n.height;if(o+m+u<0||o-u>window.innerWidth||h+p+u<0||h-u>window.innerHeight)return!1;const f=Math.floor(Date.now()/1e3),v=`${s.xcU}-${(0,d.A)()}`,A=(0,l.FD)("svg",{className:c.ghost,width:m,height:p,style:`left: ${o}px; top: ${h}px;`,viewBox:`0 0 ${m} ${p}`,children:[(0,l.Y)("defs",{children:g(v,Math.min(m,p),f)}),(0,l.Y)("g",{filter:`url(#${v})`,children:(0,l.Y)("foreignObject",{className:c.elementContainer,width:m,height:p})})]}),y=(0,r.A)(A)[0],C=y.querySelector("foreignObject"),w=window.getComputedStyle(e),I=e.cloneNode(!0);Array.from(w).forEach(e=>I.style.setProperty(e,w.getPropertyValue(e),"important")),C.appendChild(I);const b=document.getElementById(s.Lj4);return b.appendChild(y),y.addEventListener("animationend",()=>{b.removeChild(y)},{once:!0}),!0}function g(e,t,n=42){return(0,l.FD)("filter",{xmlns:s.jNX,id:e,x:"-150%",y:"-150%",width:"400%",height:"400%","color-interpolation-filters":"sRGB",children:[(0,l.Y)("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"1",result:"dustNoise",seed:n}),(0,l.Y)("feComponentTransfer",{in:"dustNoise",result:"dustNoiseMask",children:(0,l.Y)("feFuncA",{type:"linear",slope:"5",intercept:"0",children:(0,l.Y)("animate",{attributeName:"slope",values:"5; 2; 1; 0",dur:`${h}ms`,fill:"freeze"})})}),(0,l.Y)("feComposite",{in:"SourceGraphic",in2:"dustNoiseMask",operator:"in",result:"dustySource"}),(0,l.Y)("feTurbulence",{type:"fractalNoise",baseFrequency:"0.015",numOctaves:"1",result:"displacementNoise1",seed:n+1}),(0,l.Y)("feTurbulence",{type:"fractalNoise",baseFrequency:"1",numOctaves:"2",result:"displacementNoise2",seed:n+2}),(0,l.FD)("feMerge",{result:"combinedNoise",children:[(0,l.Y)("feMergeNode",{in:"displacementNoise1"}),(0,l.Y)("feMergeNode",{in:"displacementNoise2"})]}),(0,l.Y)("feDisplacementMap",{in:"dustySource",in2:"combinedNoise",scale:"0",xChannelSelector:"R",yChannelSelector:"G",children:(0,l.Y)("animate",{attributeName:"scale",values:"0; "+3*t,dur:`${h}ms`,fill:"freeze"})})]})}},17169:(e,t,n)=>{n.d(t,{A:()=>o});const o={name:"BDZrSTO_",root:"QOz6fQFU",avatar:"dXSy0i2c",avatarHidden:"n0vJEdNW",ghost:"E1IeDpeb",ghostAnimateName:"HMp3KTKQ",ghostRevealName:"unYkDic1",ghostLast:"dZJGfaXC"}},17751:(e,t,n)=>{n.d(t,{A:()=>w});var o=n(84051),i=n(13439),s=n(89925),a=n(90709),r=n(91048),d=n(87357),c=n(4961),l=n(54699),u=n(39351),h=n(17712),m=n(59030),p=n(42452),g=n(21849),f=n(80999),v=n(34431),A=n(18276),y=n(80477),C=n(20021);const w=(0,o.ph)((0,i.EK)((e,{userId:t,forceShowSelf:n})=>{const{isSynced:o}=e,i=t?(0,r.mBe)(e,t):void 0,s=t?(0,r.K0y)(e,t):void 0,a=!n&&i&&i.isSelf,d=a?i:(0,r.mBe)(e,e.currentUserId);return{user:i,userStatus:s,isSavedMessages:a,areMessagesLoaded:Boolean(t&&(0,r.zeq)(e,t)),self:d,isSynced:o}})(({customPeer:e,typingStatus:t,avatarSize:n="medium",status:r,statusIcon:w,withDots:I,withMediaViewer:b,withUsername:S,withStory:M,withFullInfo:N,withUpdatingStatus:Y,emojiStatusSize:k,noStatusOrTyping:P,noEmojiStatus:F,noFake:T,noVerified:D,noRtl:x,user:L,userStatus:E,self:B,isSavedMessages:R,isSavedDialog:O,areMessagesLoaded:U,adminMember:K,ripple:z,className:V,storyViewerOrigin:j,isSynced:J,onEmojiStatusClick:G,iconElement:$,rightElement:q})=>{const{loadFullUser:H,openMediaViewer:W,loadMoreProfilePhotos:_}=(0,i.ko)(),Q=(0,m.A)(),Z=(0,u.A)(),{id:X}=L||{},ee=b&&!R;(0,o.vJ)(()=>{X&&(N&&J&&H({userId:X}),b&&_({peerId:X,isPreload:!0}))},[X,N,b,J]),(0,l.A)(6e4);const te=(0,h.A)((e,t)=>{L&&t&&(e.stopPropagation(),W({isAvatarView:!0,chatId:L.id,mediaIndex:0,origin:"jumbo"===n?s.TQ.ProfileAvatar:s.TQ.MiddleHeaderAvatar}))}),ne=(0,o.Kr)(()=>L&&S&&(0,a.Kl)(L),[L,S]);if(!L&&!e)return;const oe=K?K.customTitle||Q(K.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin"):void 0;return(0,C.FD)("div",{className:(0,d.A)("ChatInfo",V),dir:!x&&Z.isRtl?"rtl":void 0,children:[O&&B&&(0,C.Y)(g.A,{size:n,peer:B,isSavedMessages:!0,className:"saved-dialog-avatar"},"saved-messages"),(0,C.Y)(g.A,{size:n,peer:e||L,className:(0,d.A)(O&&"overlay-avatar"),isSavedMessages:R,isSavedDialog:O,withStory:M,storyViewerOrigin:j,storyViewerMode:"single-peer",onClick:ee?te:void 0},L?.id),(0,C.FD)("div",{className:"info",children:[oe?(0,C.FD)("div",{className:"info-name-title",children:[(0,C.Y)(v.A,{peer:L,withEmojiStatus:!F,emojiStatusSize:k,isSavedMessages:R,isSavedDialog:O,onEmojiStatusClick:G}),oe&&(0,C.Y)("span",{className:"custom-title",children:oe})]}):(0,C.Y)(v.A,{peer:e||L,noFake:T,noVerified:D,withEmojiStatus:!F,emojiStatusSize:k,isSavedMessages:R,isSavedDialog:O,onEmojiStatusClick:G,iconElement:$}),(r||!R&&!P)&&function(){if(r)return I?(0,C.Y)(f.A,{className:"status",content:r}):(0,C.FD)("span",{className:"status",dir:"auto",children:[w&&(0,C.Y)(A.A,{className:"status-icon",name:w}),(0,c.A)(r)]});if(Y&&!U)return(0,C.Y)(f.A,{className:"status",content:Q("Updating")});if(e?.subtitleKey)return(0,C.Y)("span",{className:"status",dir:"auto",children:(0,C.Y)("span",{className:"user-status",dir:"auto",children:Q(e.subtitleKey)})});if(!L)return;if(t)return(0,C.Y)(y.A,{typingStatus:t});if((0,a.DX)(L.id))return;const n=(0,a.CD)(Q,L,E),o=(0,d.A)("handle",n&&"withStatus");return(0,C.FD)("span",{className:(0,d.A)("status",(0,a.PF)(L,E,!0)&&"online"),children:[ne&&(0,C.Y)("span",{className:o,children:ne}),n&&(0,C.Y)("span",{className:"user-status",dir:"auto",children:n})]})}()]}),z&&(0,C.Y)(p.A,{}),q]})}))},17778:(e,t,n)=>{n.d(t,{S:()=>r});const o=/(<br>|<br\s?\/>)/g,i=/(&nbsp;|\u00A0)/g,s=/(<div>|<\/div>)/gi,a=/\n$/i;function r(e){return e.replace(i," ").replace(o,"\n").replace(s,"").replace(a,"")}},19210:(e,t,n)=>{n.d(t,{A:()=>J});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(90709),c=n(27109),l=n(91048),u=n(96454),h=n(87357),m=n(48899),p=n(49763),g=n(66414),f=n(98255),v=n(43874),A=n(47067),y=n(49746),C=n(37661),w=n(5912),I=n(17712),b=n(50680),S=n(73176),M=n(21849),N=n(54314),Y=n(34431),k=n(18276),P=n(9267),F=n(81642),T=n(22720),D=n(97967),x=n(97046),L=n(24384);const E="AA5s1Pu4";var B=n(20021);const R=(0,o.ph)(({isSelected:e,isActive:t,isMobile:n})=>(0,B.Y)("div",{className:(0,h.A)("byPckqUT",t&&"IsUWP16T",e&&!n&&"qy2i51dM"),children:(0,B.FD)("div",{className:"nl36F75B",children:[(0,B.Y)("div",{className:E}),(0,B.Y)("div",{className:E}),(0,B.Y)("div",{className:E})]})}));var O=n(76023),U=n(18501),K=n(39996);const z="oIgI9O0L",V=.875*O.$,j=(0,o.ph)(({orderedFolderIds:e,chatFoldersById:t,itemClassName:n})=>{if(!e)return;const o=e.slice(0,3),i=e.length-o.length;return(0,B.FD)("div",{className:"cgAMX02q",children:[o.map(e=>{const o=t?.[e];return o&&(0,B.Y)("div",{className:(0,h.A)(z,void 0!==o.color&&-1!==o.color&&(0,K.yp)(o.color),n),children:(0,U.fd)({text:o.title.text,entities:o.title.entities,noCustomEmojiPlayback:o.noTitleAnimations,emojiSize:V})},o.id)}),i>0&&(0,B.FD)("div",{className:(0,h.A)(z,"hZDqIz3W",n),children:["+",i]})]})}),J=(0,o.ph)((0,i.EK)((e,{chatId:t,isSavedDialog:n,isPreview:o,previewMessageId:i})=>{const a=(0,l.hds)(e,t),r=(0,l.mBe)(e,t);if(!a)return{currentUserId:e.currentUserId};const d=(0,p.N)(t),{areTagsEnabled:u}=e.chatFolders,h=(0,l.g29)(e),m=i||(0,l.ZZX)(e,t,n?"saved":"all"),g=i?(0,l.O5q)(e,t,i):(0,l.yHC)(e,t,n?"saved":"all"),{isOutgoing:f,forwardInfo:v}=g||{},A=n&&v?.fromId?(0,l.PVB)(e,v.fromId):void 0,y=g?(0,l.Y7C)(e,g):void 0,C=A||y,{chatId:w,threadId:I,type:b}=(0,l.Xf0)(e)||{},S=!o&&t===w&&(n?t===I:I===s.l3),M=a.isForum&&t===w||t===(0,l.nTw)(e).forumPanelChatId,N=(0,l.K0y)(e,t),Y=g&&(0,l.nkm)(e,g),k=(0,l.C5H)(e,t,s.l3,"typingStatus"),P=(0,l.xyP)(e,t),F=g?.content.storyData,T=F&&(0,l.Msb)(e,F.peerId,F.id),D=(0,l.trm)(e),x=(0,l.k2W)(e,t);return{chat:a,isMuted:(0,c.If)(a,(0,l.K52)(e),(0,l.P5N)(e,a.id)),lastMessageSender:C,draft:(0,l.GA4)(e,t,s.l3),isSelected:S,isSelectedForum:M,isForumPanelOpen:(0,l.clw)(e),canScrollDown:S&&"thread"===b,canChangeFolder:(e.chatFolders.orderedIds?.length||0)>1,lastMessageOutgoingStatus:f&&g?(0,l.Tl2)(e,g):void 0,user:r,userStatus:N,lastMessageTopic:Y,typingStatus:k,withInterfaceAnimations:(0,l.PKK)(e),lastMessage:g,lastMessageId:m,currentUserId:e.currentUserId,listedTopicIds:P?.listedTopicIds,topics:P?.topicsById,isSynced:e.isSynced,lastMessageStory:T,isAccountFrozen:D,monoforumChannel:x,chatFolderIds:d,orderedFolderIds:e.chatFolders.orderedIds,chatFoldersById:e.chatFolders.byId,areTagsEnabled:u&&h}})(({chatId:e,folderId:t,orderDiff:n,animationType:c,isPinned:p,listedTopicIds:E,topics:O,observeIntersection:U,chat:K,monoforumChannel:z,lastMessageStory:V,isMuted:J,user:G,userStatus:$,lastMessageSender:q,lastMessageOutgoingStatus:H,offsetTop:W,draft:_,withInterfaceAnimations:Q,isSelected:Z,isSelectedForum:X,isForumPanelOpen:ee,canScrollDown:te,canChangeFolder:ne,lastMessageTopic:oe,typingStatus:ie,lastMessageId:se,lastMessage:ae,isSavedDialog:re,currentUserId:de,isPreview:ce,previewMessageId:le,className:ue,isSynced:he,onDragEnter:me,onDragLeave:pe,isAccountFrozen:ge,chatFolderIds:fe,orderedFolderIds:ve,chatFoldersById:Ae,areTagsEnabled:ye,withTags:Ce,onReorderAnimationEnd:we})=>{const{openChat:Ie,openSavedDialog:be,toggleChatInfo:Se,focusMessage:Me,loadTopics:Ne,openForumPanel:Ye,closeForumPanel:ke,setShouldCloseRightColumn:Pe,reportMessages:Fe,openFrozenAccountModal:Te,updateChatMutedState:De,openQuickPreview:xe,scrollMessageListToBottom:Le}=(0,i.ko)(),{isMobile:Ee}=(0,v.Ay)(),[Be,Re,Oe]=(0,C.A)(),[Ue,Ke,ze]=(0,C.A)(),[Ve,je,Je]=(0,C.A)(),[Ge,$e,qe]=(0,C.A)(),[He,We,_e]=(0,C.A)(),[Qe,Ze,Xe]=(0,C.A)(),{isForum:et,isForumAsMessages:tt,isMonoforum:nt}=K||{};(0,y.A)(re?de:e,se,ae);const ot=(0,o.Kr)(()=>{const e=new Set(fe);return ve?.filter(n=>{if(!e.has(n))return;const o=n===t,i=n===r.DSF,s=Ae?.[n],a=void 0!==s?.color&&-1!==s.color;return!o&&!i&&a})},[ve,t,Ae,fe]),it=ye&&Ce,st=it&&Boolean(ot?.length),{renderSubtitle:at,ref:rt}=(0,S.A)({chat:K,chatId:e,lastMessage:ae,typingStatus:ie,draft:_,statefulMediaContent:(0,d.FE)({story:V}),lastMessageTopic:oe,lastMessageSender:q,observeIntersection:U,animationType:c,withInterfaceAnimations:Q,orderDiff:n,isSavedDialog:re,isPreview:ce,onReorderAnimationEnd:we,topics:O,hasTags:st}),dt=(0,f.A)(l.sRo),ct=(0,I.A)(t=>{if(t.altKey&&!re&&!et&&!ce)return t.preventDefault(),void xe({id:e});const n=Ee&&tt;if(Ee&&Pe({value:!0}),ce)Me({chatId:e,messageId:le});else{if(re)return be({chatId:e,noForumTopicPanel:!0},{forceOnHeavyAnimation:!0}),void(Ee&&Se({force:!1}));if(et){if(ee)return void ke(void 0,{forceOnHeavyAnimation:!0});if(n||Ye({chatId:e},{forceOnHeavyAnimation:!0}),!tt)return}Ie({id:e,noForumTopicPanel:n,shouldReplaceHistory:!0},{forceOnHeavyAnimation:!0}),Z&&te&&Le()}}),lt=(0,I.A)(t=>{t.preventDefault(),me?.(e)}),ut=(0,I.A)(()=>{ge?Te():($e(),Re())}),ht=(0,I.A)(()=>{ge?Te():(We(),Ke())}),mt=(0,I.A)(()=>{ge?Te():De({chatId:e,mutedUntil:r.Os5})}),pt=(0,I.A)(()=>{Ze(),je()}),gt=(0,I.A)(()=>{ge?Te():K&&Fe({chatId:K.id,messageIds:[]})}),ft=(0,A.A)({chat:K,user:G,handleDelete:ut,handleMute:ht,handleUnmute:mt,handleChatFolderChange:pt,handleReport:gt,folderId:t,isPinned:p,isMuted:J,canChangeFolder:ne,isSavedDialog:re,currentUserId:de,isPreview:ce,topics:O}),vt=(0,w.Vz)(rt,K?U:void 0);(0,o.vJ)(()=>{vt&&et&&he&&void 0===E&&Ne({chatId:e})},[e,E,he,et,vt]);const At=G&&$&&(0,d.PF)(G,$),{hasShownClass:yt}=(0,b.A)(At),Ct=(0,o.Kr)(()=>{if(u.OS)return re?`#${(0,g.az)(de,"thread",e)}`:`#${(0,g.az)(e,"thread",s.l3)}`},[e,de,re]);if(!K)return;const wt=G||K,It=(0,h.A)("Chat chat-item-clickable",(0,m.L8)(e)?"private":"group",et&&"forum",Z&&"selected",X&&"selected-forum",ce&&"standalone",ye&&Ce&&"chat-item-with-tags",ue);return(0,B.FD)(T.A,{ref:rt,className:It,href:Ct,style:`top: ${W}px`,ripple:!et&&!Ee,contextActions:ft,withPortalForMenu:!0,onClick:ct,onDragEnter:lt,onDragLeave:pe,children:[(0,B.FD)("div",{className:(0,h.A)("status","status-clickable"),children:[(0,B.Y)(M.A,{peer:nt?z:wt,isSavedMessages:G?.isSelf,isSavedDialog:re,size:ce?"medium":"large",asMessageBubble:nt,withStory:!G?.isSelf&&!nt,withStoryGap:yt||Boolean(K.subscriptionUntil),storyViewerOrigin:a.G9.ChatList,storyViewerMode:"single-peer"}),(0,B.FD)("div",{className:"avatar-badge-wrapper",children:[(0,B.Y)("div",{className:(0,h.A)("avatar-online","avatar-badge",yt&&"avatar-online-shown")}),!yt&&Boolean(K.subscriptionUntil)&&(0,B.Y)(P.A,{type:"gold",className:"avatar-badge avatar-subscription",size:"adaptive"}),(0,B.Y)(L.A,{chat:K,isMuted:J,shouldShowOnlyMostImportant:!0,forceHidden:dt,topics:O,isSelected:Z,isOnAvatar:!0})]}),K.isCallActive&&K.isCallNotEmpty&&(0,B.Y)(R,{isMobile:Ee,isSelected:Z,isActive:Q})]}),(0,B.FD)("div",{className:(0,h.A)("info",it&&"has-tags"),children:[(0,B.FD)("div",{className:"info-row",children:[(0,B.Y)(Y.A,{peer:nt?z:wt,isMonoforum:nt,monoforumBadgeClassName:"monoforum-badge",withEmojiStatus:!0,isSavedMessages:e===G?.id&&G?.isSelf,isSavedDialog:re,observeIntersection:U,withStatusTextColor:Z}),J&&!re&&(0,B.Y)(k.A,{name:"muted"}),(0,B.Y)("div",{className:"separator"}),ae&&(0,B.Y)(F.A,{message:ae,outgoingStatus:re?void 0:H,draftDate:_?.date})]}),(0,B.FD)("div",{className:"subtitle",children:[at(),!ce&&(0,B.Y)(L.A,{chat:K,isPinned:p,isMuted:J,isSavedDialog:re,hasMiniApp:G?.hasMainMiniApp,topics:O,isSelected:Z,transitionClassName:"chat-badge-transition"})]}),st&&(0,B.Y)(j,{itemClassName:"chat-tag",orderedFolderIds:ot,chatFoldersById:Ae})]}),Ge&&(0,B.Y)(N.A,{isOpen:Be,onClose:Oe,onCloseAnimationEnd:qe,chat:K,isSavedDialog:re}),He&&(0,B.Y)(x.A,{isOpen:Ue,onClose:ze,onCloseAnimationEnd:_e,chatId:e}),Qe&&(0,B.Y)(D.A,{isOpen:Ve,onClose:Je,onCloseAnimationEnd:Xe,chatId:e})]})}))},20247:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(13439),s=n(31481),a=n(17712);function r(e,t,n){const{shouldPaidMessageAutoApprove:r}=(0,i.mS)().settings.byKey,[d,c]=(0,o.J0)(Boolean(r)),[l,u]=(0,o.J0)(!1),h=(0,o.li)(void 0),m=(0,a.A)(()=>{(0,i.ko)().closePaymentMessageConfirmDialogOpen()});(0,o.vJ)(()=>{l&&!t&&(u(!1),n>e&&h?.current?.())},[l,t,n,e]);const p=(0,a.A)(()=>{(0,i.ko)().openStarsBalanceModal({topup:{balanceNeeded:e,purpose:s.D3m}}),u(!0)});return{closeConfirmDialog:m,handleWithConfirmation:(t,...o)=>{if(e){if(h.current=()=>t(...o),!r)return void(0,i.ko)().openPaymentMessageConfirmDialogOpen();if(e>n)return void p()}t(...o)},dialogHandler:(0,a.A)(()=>{e>n?p():h?.current?.(),(0,i.ko)().closePaymentMessageConfirmDialogOpen(),d&&(0,i.ko)().setPaidMessageAutoApprove()}),shouldAutoApprove:d,setAutoApprove:c}}},21488:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051),i=n(13439),s=n(37836);const a=function(e,t,n){const{loadPeerStoriesByIds:a}=(0,i.ko)(),r=(0,o.Kr)(()=>{const n=(0,s.nF)(a,200,!0);return()=>{n({peerId:e,storyIds:[t]})}},[t,e]);(0,o.vJ)(()=>{e&&t&&(!n||!("content"in n)&&!("isDeleted"in n))&&r()},[r,n,t,e])}},22081:(e,t,n)=>{n.d(t,{A:()=>qt});var o=n(84051),i=n(13439),s=n(23174),a=n(31481),r=n(66644),d=n(90709),c=n(27109),l=n(70636),u=n(91048),h=n(64520),m=n(30708),p=n(96454),g=n(87357),f=n(17663),v=n(55148),A=n(46275),y=n(60261),C=n(48899),w=n(36353),I=n(48775),b=n(79824),S=n(80539),M=n(39074),N=n(80140),Y=n(43503),k=n(13235);let P;function F(e){P.focus(),e.focus()}p.pz&&(P=document.createElement("input"),P.classList.add("for-ios-autocapitalization-fix"),document.body.appendChild(P));var T=n(55153),D=n(58734),x=n(11359),L=n(4961),E=n(18501),B=n(32625),R=n(14737),O=n(10722),U=n(19129),K=n(82117),z=n(37661),V=n(41316),j=n(39351),J=n(17712),G=n(59030),$=n(39996),q=n(29886),H=n(73767),W=n(24531),_=n(73172),Q=n(50680),Z=n(41257),X=n(35297),ee=n(17778),te=n(63988),ne=n(83414);const oe=/^\/([\w@]{1,32})?$/i;var ie=n(78396);const se=/id="docs-internal-guid/i,ae=["H1","H2","H3","H4","H5","H6"];function re(e){return(new DOMParser).parseFromString(e,"text/html").body}function de(e,t){const n=document.createElement("a");return n.href=t,n.appendChild(e.cloneNode(!0)),n}function ce(e,t){const n=document.createElement(t);return n.appendChild(e.cloneNode(!0)),n}function le(e,t){let n=t.cloneNode(!0);return e?(e.style&&"700"===e.style.fontWeight&&(n=ce(n,"strong")),e.style&&"italic"===e.style.fontStyle&&(n=ce(n,"em")),e.style&&"underline"===e.style.textDecoration&&(n=ce(n,"u")),e.style&&"line-through"===e.style.textDecoration&&(n=ce(n,"del")),e.style&&"super"===e.style.verticalAlign&&(n=ce(n,"sup")),e.style&&"sub"===e.style.verticalAlign&&(n=ce(n,"sub")),n):n}function ue(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),o=t;return"A"===t.nodeName&&(n=de(n,t.href),"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(o=t.childNodes[0])),n=le(o,n),n}function he(e){if(e.childNodes&&(e.childNodes.length<=1||"OL"===e.nodeName||"UL"===e.nodeName)){let t,n=document.createTextNode(e.textContent||"");if("UL"===e.nodeName||"OL"===e.nodeName||"LI"===e.nodeName){t=document.createElement(e.nodeName),n=document.createDocumentFragment();const o=[];for(let t=0;t<e.childNodes.length;t++)o.push(...he(e.childNodes[t]));o.map(e=>n.appendChild(e))}else-1!==ae.indexOf(e.nodeName)?(t=document.createElement(e.nodeName),n=ue(e.childNodes[0])):"P"===e.nodeName?(t=document.createElement("p"),n=function(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),o=document.createTextNode("");return"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(o=t.childNodes[0]),t.childNodes[0]&&"A"===t.childNodes[0].nodeName&&(n=de(n.cloneNode(!0),t.childNodes[0].href),o=t.childNodes[0].childNodes[0]),n=le(o,n),n}(e)):"BR"===e.nodeName?n=e:(t=document.createElement("span"),n=ue(e));return t?(t.appendChild(n),[t]):[e.cloneNode(!0)]}if(e.childNodes){const t=[];for(let n=0;n<e.childNodes.length;n++)t.push(...he(e.childNodes[n]));return t}return[e]}function me(e){return 8!==e.nodeType}const pe=/<style>(.*?)<\/style>/gs;var ge=n(45761);const fe=new Set([a.CfG,a.e0F,a.YVZ]),ve=(e,t,n,r,c,l,u,h)=>{const{showNotification:m,updateShouldSaveAttachmentsCompression:p,applyDefaultAttachmentsCompression:g}=(0,i.ko)(),f=(0,j.A)();(0,o.vJ)(()=>{if(e)return document.addEventListener("paste",o,!1),()=>{document.removeEventListener("paste",o,!1)};async function o(e){if(!e.clipboardData)return;const o=e.target?.closest("div[contenteditable]");if(!o||!fe.has(o.id))return;if(e.preventDefault(),document.activeElement!==o)return;const i=e.clipboardData.getData("text"),v=e.clipboardData.getData("text/html");let A=v?(0,S.Ay)(function(e){let t=document.createElement("div");try{e=(n=e).match(se)?function(e){const t=document.createElement("body"),n=e.childNodes,o=Array.from(n).filter(me),i=[];for(const e of o)i.push(...he(e));for(let e=0;e<i.length;e++)t.appendChild(i[e].cloneNode(!0));return t}(re(n.replace(/(\r\n|\n|\r)/,""))).innerHTML:re(n.replace(/(\r\n|\n|\r)/,"")).innerHTML}catch(e){a.Oig&&console.error(e)}var n;t.innerHTML=e.replace(/\u00a0/g," ").replace(pe,"");const o=t.querySelectorAll(".text-content");return o.length&&(t=o[o.length-1]),Array.from(t.getElementsByTagName("*")).forEach(e=>{if(e instanceof HTMLElement)switch(e.removeAttribute("style"),"BR"===e.tagName&&e.replaceWith("\n"),"P"===e.tagName&&e.appendChild(document.createTextNode("\n")),"IMG"!==e.tagName||e.dataset.entityType||e.replaceWith(e.getAttribute("alt")||""),e.dataset.ignoreOnPaste&&e.remove(),S.qh[e.tagName]&&e.setAttribute("data-entity-type",S.qh[e.tagName]),e.dataset.entityType||e.textContent!==e.innerText||e.replaceWith(e.textContent),e.dataset.alt&&e.setAttribute("alt",e.dataset.alt),e.dataset.entityType){case s.C7.MentionName:e.replaceWith(e.textContent||"");break;case s.C7.CustomEmoji:e.textContent=e.dataset.alt||""}else e.remove()}),t.innerHTML.trimEnd()}(v),void 0,!0):void 0;A&&(0,ie.T8)(A)&&l&&(A=(0,ie.m4)(A),u?.());const{items:y}=e.clipboardData;let C=[];if(y.length>0&&(C=await(0,ge.A)(y),c&&(C=C?.slice(0,1))),!C?.length&&!i)return;const w=A?.entities?.length?A:{text:i};let I=!1;try{I="urn:schemas-microsoft-com:office:word"===(new DOMParser).parseFromString(v,"text/html").documentElement.getAttribute("xmlns:w")}catch(e){}const b=w&&w.text;let M=C?.length&&!I;const N=C?await Promise.all(C.map(e=>(0,T.A)(e.name,e))):[],Y=c&&N?.length&&(0,d.eh)(c,N[0])||Boolean(b),k=(0,d.NK)(N[0]),P=c&&c?.groupedId;c&&N?.length>1?m({message:f("MediaReplaceInvalidError",void 0,{pluralValue:N.length})}):c&&k?m({message:f("MediaReplaceInvalidError",void 0,{pluralValue:1})}):!P||(M=Y,M)?(M&&(h&&(p({shouldSave:!0}),g()),n(c?N:e=>e.concat(N))),b&&(M?r(w):t(w,o?.id))):m({message:f("MediaReplaceInvalidError",void 0,{pluralValue:N.length})})}},[t,c,n,e,l,u,r,f,h])};var Ae=n(3225),ye=n(37859),Ce=n(56133),we=n(61157),Ie=n(60138);let be=!1;const Se=new Set([s.C7.TextUrl,s.C7.Url]);var Me=n(25498),Ne=n(37830);const Ye=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/is,ke=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+\n{2,}/i,Pe={username:"",query:"",canShowHelp:!1,usernameLowered:""},Fe=document.createElement("div");const Te=(0,Ne.A)((e,t,n)=>({username:e,query:t,canShowHelp:n,usernameLowered:e.toLowerCase()})),De=new RegExp(a.kNZ,"i");var xe=n(9442),Le=n(20247),Ee=n(16120),Be=n(17237);const Re=new RegExp(`^${a.bpX.source}$`,"g");var Oe=n(11778);const Ue={encoderPath:new URL(n(89755),n.b).href,reuseWorker:!0},Ke={type:"audio/ogg"};let ze,Ve,je;async function Je(){return ze||(ze=n.e(4550).then(n.t.bind(n,14550,23)),Ve=(await ze).default,je=new Ve(Ue)),ze}async function Ge(e){await async function(){await Je(),await je.start()}();const t=Date.now();let n;const o=[],i=[];je.ondataavailable=e=>{o.push(e)};const s=function(t){const n=t.sourceNode,o=n.context.createAnalyser();o.fftSize=64,n.connect(o);const s=o.frequencyBinCount,a=new Uint8Array(s);let d=!1;return function t(){if(d)return;o.getByteFrequencyData(a);const n=a.reduce((e,t)=>e+t,0)/s/255;(t=>{i.push(255*t),e(t)})(n<.1?0:n),(0,r.YS)(t)}(),()=>{d=!0}}(je);return{stop:()=>new Promise((e,a)=>{je.onstop=()=>{e({blob:new Blob(o,Ke),duration:Math.round(((n||Date.now())-t)/1e3),waveform:i})},je.onerror=a;const r=Math.max(0,t+1e3-Date.now());setTimeout(()=>{je.stop(),s()},r)}),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout(()=>{je.pause(),n=Date.now(),s()},e)}}}var $e=n(80089),qe=n(80464),He=n(20021);const We=e=>{const{attachments:t}=e,n=(0,qe.A)($e.ar.Extra,"AttachmentModal",!t.length);return n?(0,He.Y)(n,{...e}):void 0};var _e=n(61182),Qe=n(87679),Ze=n(52844),Xe=n(36680),et=n(18276),tt=n(71429),nt=n(24433),ot=n(66469),it=n(54639);const st=(0,o.ph)(({chatId:e,threadId:t,isButtonVisible:n,canAttachMedia:s,canAttachPolls:r,canAttachToDoLists:c,canSendPhotos:l,canSendVideos:u,canSendDocuments:h,canSendAudios:m,attachBots:f,peerType:v,isScheduled:A,theme:y,shouldCollectDebugLogs:C,canEditMedia:w,editingMessage:I,messageListType:b,paidMessagesStars:S,onFileSelect:M,onMenuOpen:N,onMenuClose:Y,onPollCreate:k,onTodoListCreate:P})=>{const{updateAttachmentSettings:F}=(0,i.ko)(),[T,D,x]=(0,z.A)(),[L,E,B]=(0,Xe.A)(T,x),R=l&&u,O=l||u,[U,K,V]=(0,z.A)(),$=T||U,q=I&&I?.groupedId&&Boolean((0,d.yl)(I)||Boolean((0,d.zX)(I))),H=I&&I?.groupedId&&Boolean((0,d.wp)(I)||(0,d.gB)(I)||(0,d.zC)(I));(0,o.vJ)(()=>{T&&B()},[T,B]),(0,o.vJ)(()=>{$?N():Y()},[$,Y,N]);const W=(0,J.A)(()=>{T?x():D()}),_=(0,J.A)(e=>{const{files:t}=e.target,n=(0,Qe.kc)(t);n?.length&&M(n)}),Q=(0,J.A)(()=>{F({shouldCompress:!0}),(0,Ze.p)(Array.from(R?a.mxD:l?a.gex:a.fNs).join(","),e=>_(e))}),Z=(0,J.A)(()=>{F({shouldCompress:!1}),(0,Ze.p)(!h&&m?Array.from(a.IH3).join(","):"*",e=>_(e))}),X=(0,J.A)(()=>{const e=new File([(0,_e.F8)()],a.lFE,{type:"text/plain"});M([e])}),ee=(0,o.Kr)(()=>f?Object.values(f).filter(t=>!(!v||!t.isForAttachMenu)&&(!("bots"!==v||t.id!==e||!t.attachMenuPeerTypes||!t.attachMenuPeerTypes.includes("self"))||t.attachMenuPeerTypes.includes(v))):void 0,[f,e,v]),te=(0,G.A)(),ne=(0,j.A)();if(n)return(0,He.FD)("div",{className:"AttachMenu",children:[I&&w?(0,He.Y)(ot.A,{id:"replace-menu-button",className:(0,g.A)("AttachMenu--button composer-action-button",T&&"activated"),round:!0,color:"translucent",onActivate:W,ariaLabel:"Replace an attachment",ariaControls:"replace-menu-controls",hasPopup:!0,children:(0,He.Y)(et.A,{name:"replace"})}):(0,He.Y)(ot.A,{id:"attach-menu-button",disabled:Boolean(I),className:(0,g.A)("AttachMenu--button composer-action-button",T&&"activated"),round:!0,color:"translucent",onActivate:W,ariaLabel:"Add an attachment",ariaControls:"attach-menu-controls",hasPopup:!0,children:(0,He.Y)(et.A,{name:"attach"})}),(0,He.FD)(tt.A,{id:"attach-menu-controls",isOpen:$,autoClose:!0,positionX:"right",positionY:"bottom",onClose:x,className:"AttachMenu--menu fluid",onCloseAnimationEnd:x,onMouseEnter:p.TF?void 0:L,onMouseLeave:p.TF?void 0:E,noCloseOnBackdrop:!p.TF,ariaLabelledBy:"attach-menu-button",children:[!s&&(0,He.Y)(nt.A,{className:"media-disabled",disabled:!0,children:ne("scheduled"===b&&S?"DescriptionScheduledPaidMediaNotAllowed":"DescriptionRestrictedMedia")}),s&&(0,He.FD)(He.FK,{children:[O&&!H&&(0,He.Y)(nt.A,{icon:"photo",onClick:Q,children:te(R?"AttachmentMenu.PhotoOrVideo":l?"InputAttach.Popover.Photo":"InputAttach.Popover.Video")}),(h||m)&&!q&&(0,He.Y)(nt.A,{icon:"document",onClick:Z,children:te(!h&&m?"InputAttach.Popover.Music":"AttachDocument")}),h&&C&&(0,He.Y)(nt.A,{icon:"bug",onClick:X,children:te("DebugSendLogs")})]}),r&&!I&&(0,He.Y)(nt.A,{icon:"poll",onClick:k,children:te("Poll")}),c&&!I&&(0,He.Y)(nt.A,{icon:"select",onClick:P,children:ne("TitleToDoList")}),!I&&!w&&!A&&ee?.map(n=>(0,He.Y)(it.A,{bot:n,chatId:e,threadId:t,theme:y,onMenuOpened:K,onMenuClosed:V}))]})]})}),at=e=>{const{isOpen:t}=e,n=(0,qe.A)($e.ar.Extra,"BotCommandMenu",!t);return n?(0,He.Y)(n,{...e}):void 0};var rt=n(85449),dt=n(64493);const ct=(0,o.ph)((0,i.EK)((e,{messageId:t})=>{const{chatId:n}=(0,u.Xf0)(e)||{};return{message:n?(0,u.O5q)(e,n,t):void 0}})(({isOpen:e,threadId:t,message:n,onClose:s})=>{const{clickBotInlineButton:a}=(0,i.ko)(),r=(0,G.A)(),[d,c]=(0,Xe.A)(e,s),{isKeyboardSingleUse:l}=n||{},u=(0,o.Kr)(()=>{const e=[];return n?.keyboardButtons.forEach(t=>{e.push(t.map(e=>(0,rt.A)(r,e)))}),e},[r,n?.keyboardButtons]);if(n&&n.keyboardButtons)return(0,He.Y)(tt.A,{isOpen:e,autoClose:l,positionX:"right",positionY:"bottom",onClose:s,className:"BotKeyboardMenu",onCloseAnimationEnd:s,onMouseEnter:p.TF?void 0:d,onMouseLeave:p.TF?void 0:c,noCompact:!0,children:(0,He.Y)("div",{className:"content custom-scroll",children:n.keyboardButtons.map((e,o)=>(0,He.Y)("div",{className:"row",children:e.map((e,i)=>(0,He.Y)(dt.A,{ripple:!0,disabled:"unsupported"===e.type,onClick:()=>a({chatId:n.chatId,messageId:n.id,threadId:t,button:e}),children:u?.[o][i]}))}))})})})),lt=(0,o.ph)(({isOpen:e,onClick:t,text:n,isDisabled:i})=>{const s=(0,o.li)();return(0,o.vJ)(()=>{const e=s.current;if(!e)return;const t=e.scrollWidth+1;e.closest(".Composer").style.setProperty("--bot-menu-text-width",`${t}px`)},[e,n]),(0,o.vJ)(()=>{const e=s.current;if(!e)return;const t=e.closest(".Composer");return()=>{t.style.removeProperty("--bot-menu-text-width")}},[]),(0,He.FD)(dt.A,{className:(0,g.A)("composer-action-button bot-menu",e&&"open"),round:!0,color:"translucent",disabled:i,onClick:t,ariaLabel:"Open bot command keyboard",children:[(0,He.Y)(et.A,{name:"webapp",className:(0,g.A)("bot-menu-icon",e&&"open")}),(0,He.Y)("span",{ref:s,className:"bot-menu-text",children:(0,L.A)(n)})]})}),ut=e=>{const{isOpen:t}=e,n=(0,qe.A)($e.ar.Extra,"ChatCommandTooltip",!t);return n?(0,He.Y)(n,{...e}):void 0};var ht=n(56494),mt=n(87894),pt=n(14),gt=n(91930),ft=n(60859);const vt=(0,o.ph)((0,i.EK)((e,{shouldForceShowEditing:t,chatId:n,threadId:o,messageListType:i})=>{const{forwardMessages:{fromChatId:s,toChatId:a,messageIds:r,noAuthors:c,noCaptions:l},isShareMessageModalShown:h,shouldPreventComposerAnimation:m}=(0,u.nTw)(e),p="scheduled"===i?(0,u.VlN)(e,n):(0,u.Ys6)(e,n,o),g=(0,u.PKK)(e)&&!m,f=a===n,v=r?.map(t=>(0,u.O5q)(e,s,t)),A=(0,u.GA4)(e,n,o),y=A?.replyInfo,C=A?.suggestedPostInfo,w=y?.replyToPeerId,I=w?(0,u.hds)(e,w):void 0;let b,S;if(p?b=(0,u.KLw)(e,n,o,i):f&&1===r.length?b=v?.[0]:y&&!t&&(b=(0,u.O5q)(e,y.replyToPeerId||n,y.replyToMsgId)),p&&b)S=(0,u.Y7C)(e,b);else if(f){let t=v?.map(t=>{return n=t,S=(0,u.Szq)(e,n),S||(S=(0,u.Y7C)(e,n)),S;var n}).filter(Boolean);t=t?(0,mt.Am)(t):void 0,S=1===t?.length?t?.[0]:void 0}else if(y&&b&&!t){const{forwardInfo:t}=b,o=(0,u.nZ4)(e,n);t&&(t.isChannelPost||o)&&(S=(0,u.Szq)(e,b)),S||t?.hiddenUserName&&!Boolean(y.quoteText)||(S=(0,u.Y7C)(e,b))}const M=S&&(0,u.hds)(e,S.id),N=M&&(0,d.WX)(M),Y=v?.some(e=>e?.content.text&&Object.keys(e.content).length>1),k=f&&1===r.length&&Boolean(b?.content.storyData),P=y?.replyToMsgId===o&&!y.replyToPeerId,F=b&&(0,ht.B9)(e,b);return{replyInfo:y,suggestedPostInfo:C,editingId:p,message:b,sender:S,shouldAnimate:g,forwardedMessagesCount:f?r.length:void 0,noAuthors:c,noCaptions:l,forwardsHaveCaptions:Y,isCurrentUserPremium:(0,u.g29)(e),isContextMenuDisabled:k,isReplyToDiscussion:P,isInChangingRecipientMode:h,shouldPreventComposerAnimation:m,senderChat:I,currentUserId:e.currentUserId,isSenderChannel:N,forwardMessageIds:r,fromChatId:s,isMediaNsfw:F,theme:(0,u.SJA)(e)}})(({replyInfo:e,suggestedPostInfo:t,editingId:n,message:s,sender:a,shouldAnimate:r,forwardedMessagesCount:c,noAuthors:l,noCaptions:h,forwardsHaveCaptions:m,shouldForceShowEditing:p,isCurrentUserPremium:f,isContextMenuDisabled:v,isReplyToDiscussion:A,isInChangingRecipientMode:y,shouldPreventComposerAnimation:C,senderChat:w,chatId:I,currentUserId:b,isSenderChannel:S,forwardMessageIds:M,fromChatId:N,isMediaNsfw:Y,theme:k,onClear:P})=>{const{resetDraftReplyInfo:F,resetDraftSuggestedPostInfo:T,updateDraftReplyInfo:D,setEditingId:x,focusMessage:L,changeRecipient:E,openChatOrTopicWithReplyInDraft:B,setForwardNoAuthors:R,setForwardNoCaptions:U,exitForwardMode:K,setShouldPreventComposerAnimation:z,openSuggestMessageModal:V}=(0,i.ko)(),q=(0,o.li)(),H=(0,G.A)(),W=(0,j.A)(),_="topicCreate"===s?.content.action?.type,Z=e&&!p,X=Boolean(e?.quoteText),ee=Boolean(t)&&!p,te=Boolean(c),ne=(0,J.A)(e=>{const t=(0,i.mS)();return(a=(0,u.Szq)(t,e))||(a=(0,u.Y7C)(t,e)),a}),oe=(0,o.Kr)(()=>{if(!te)return;const e=M?.map(e=>(0,u.O5q)((0,i.mS)(),N,e)).filter(Boolean),t=e?.map(e=>ne(e)).filter(Boolean);return t?(0,mt.Am)(t):void 0},[te,M,N]),ie=!(y||(!s||!e&&!n)&&(!oe||!te)&&!ee),{shouldRender:se,transitionClassNames:ae}=(0,Q.A)(ie&&!_&&!A,void 0,!r,void 0,!r,350,!r);(0,o.vJ)(()=>{C&&z({shouldPreventComposerAnimation:!1})});const re=(0,J.A)(()=>{n?x({messageId:void 0}):c?K():ee?(T(),F()):e&&!p&&F(),P?.()});(0,o.vJ)(()=>ie?(0,Oe.A)(re):void 0,[ie,re]);const{isContextMenuOpen:de,contextMenuAnchor:ce,handleContextMenu:le,handleContextMenuClose:ue,handleContextMenuHide:he}=(0,O.A)(q),me=(0,J.A)(e=>{t?V({chatId:I}):le(e)}),pe=(0,J.A)(e=>{e.stopPropagation(),re(),he()}),ge=e=>()=>{ue(),e()},fe=(0,J.A)(ge(E)),ve=(0,J.A)(ge(()=>{L({chatId:s.chatId,messageId:s.id,noForumTopicPanel:!0})})),Ae=(0,J.A)(ge(()=>D({quoteText:void 0}))),ye=(0,J.A)(ge(E)),Ce=(0,J.A)(()=>{ue(),a&&B({chatId:a.id})}),we=(0,J.A)(ge(re)),Ie=(0,J.A)(()=>q.current),be=(0,J.A)(()=>q.current),Se=(0,J.A)(()=>q.current.querySelector(".forward-context-menu .bubble"));(0,o.vJ)(()=>{se||(ue(),he())},[ue,he,se]);const Me=(0,g.A)("ComposerEmbeddedMessage",ae),Ne=(0,pt.A)(a,!0),{className:Ye,style:ke}=(0,$.Ay)({peer:Ne,theme:k}),Pe=(0,g.A)("ComposerEmbeddedMessage_inner",Ye),Fe=(0,o.Kr)(()=>n?"edit":ee?"cash-circle":te?"forward":Z?"reply":void 0,[n,te,Z,ee]),Te=c&&c>1?H("ForwardedMessageCount",c):void 0,De=(0,o.Kr)(()=>{if(!s||!te||!s.content.text||!l||f)return s;const e=(0,d.m4)(s.content.text);return{...s,content:{...s.content,text:e}}},[f,te,s,l]),xe=(0,pt.A)(Fe,!0);if(!se)return;const Le=a&&!S&&I!==a.id&&a.id!==b;return(0,He.Y)("div",{className:Me,ref:q,onContextMenu:le,children:(0,He.FD)("div",{className:Pe,style:ke,children:[(0,He.FD)("div",{className:"embedded-left-icon",onClick:le,children:[xe&&(0,He.Y)(et.A,{name:xe}),Boolean(e?.quoteText)&&(0,He.Y)(et.A,{name:"quote",className:"quote-reply"})]}),(0,He.Y)(gt.b,{isOpen:ie,className:"inside-input",replyInfo:e,suggestedPostInfo:t,isMediaNsfw:Y,isInComposer:!0,message:De,sender:l?void 0:a,composerForwardSenders:oe,customText:Te,noCaptions:h,title:n&&!Z?H("EditMessage"):l?H("HiddenSendersNameDescription"):void 0,onClick:me,senderChat:w}),(0,He.Y)(dt.A,{className:"embedded-cancel",round:!0,faded:!0,color:"translucent",ariaLabel:H("Cancel"),onClick:pe,children:(0,He.Y)(et.A,{name:"close"})}),(Z||te)&&!v&&(0,He.FD)(tt.A,{isOpen:de,anchor:ce,getTriggerElement:Ie,getRootElement:be,getMenuElement:Se,className:"forward-context-menu",onClose:ue,onCloseAnimationEnd:he,children:[te&&(0,He.FD)(He.FK,{children:[(0,He.Y)(nt.A,{icon:l?void 0:"message-succeeded",customIcon:l?(0,He.Y)(et.A,{name:"placeholder"}):void 0,onClick:()=>R({noAuthors:!1}),children:H(c>1?"ShowSenderNames":"ShowSendersName")}),(0,He.Y)(nt.A,{icon:l?"message-succeeded":void 0,customIcon:l?void 0:(0,He.Y)(et.A,{name:"placeholder"}),onClick:()=>R({noAuthors:!0}),children:H(c>1?"HideSenderNames":"HideSendersName")}),m&&(0,He.FD)(He.FK,{children:[(0,He.Y)(ft.A,{}),(0,He.Y)(nt.A,{icon:h?void 0:"message-succeeded",customIcon:h?(0,He.Y)(et.A,{name:"placeholder"}):void 0,onClick:()=>U({noCaptions:!1}),children:H(c>1?"Conversation.ForwardOptions.ShowCaption":"ShowCaption")}),(0,He.Y)(nt.A,{icon:h?"message-succeeded":void 0,customIcon:h?void 0:(0,He.Y)(et.A,{name:"placeholder"}),onClick:()=>U({noCaptions:!0}),children:H(c>1?"Conversation.ForwardOptions.HideCaption":"HideCaption")})]}),(0,He.Y)(ft.A,{}),(0,He.Y)(nt.A,{icon:"replace",onClick:fe,children:H("ForwardAnotherChat")})]}),Z&&(0,He.FD)(He.FK,{children:[(0,He.Y)(nt.A,{icon:"show-message",onClick:ve,children:H("Message.Context.Goto")}),X&&(0,He.Y)(nt.A,{icon:"remove-quote",onClick:Ae,children:H("RemoveQuote")}),Le&&(0,He.Y)(nt.A,{icon:"user",onClick:Ce,children:W("ReplyInPrivateMessage")}),(0,He.Y)(nt.A,{icon:"replace",onClick:ye,children:H("ReplyToAnotherChat")}),(0,He.Y)(nt.A,{icon:"delete",onClick:we,children:H("DoNotReply")})]})]})]})})}));var At=n(25897),yt=n(6070),Ct=n(41510);const wt=e=>{const{isOpen:t}=e,n=(0,qe.A)($e.ar.Extra,"DropArea",!t);return n?(0,He.Y)(n,{...e}):void 0};var It=n(49068);const bt=e=>{const{isOpen:t}=e,n=(0,qe.A)($e.ar.Extra,"InlineBotTooltip",!t);return n?(0,He.Y)(n,{...e}):void 0},St=e=>{const{isOpen:t}=e,n=(0,qe.A)($e.ar.Extra,"MentionTooltip",!t);return n?(0,He.Y)(n,{...e}):void 0};var Mt=n(78407);const Nt=e=>{const{isOpen:t}=e,n=(0,qe.A)($e.ar.Extra,"PollModal",!t);return n?(0,He.Y)(n,{...e}):void 0},Yt=e=>{const{isOpen:t}=e,n=(0,qe.A)($e.ar.Extra,"SendAsMenu",!t);return n?(0,He.Y)(n,{...e}):void 0},kt=e=>{const{isOpen:t}=e,n=(0,qe.A)($e.ar.Extra,"StickerTooltip",!t);return n?(0,He.Y)(n,{...e}):void 0};var Pt=n(26440);const Ft=e=>{const{modal:t}=e,n=(0,qe.A)($e.ar.Extra,"ToDoListModal",!t);return n?(0,He.Y)(n,{...e}):void 0};var Tt=n(2338),Dt=n(62587),xt=n(34201),Lt=n(86070);const Et="zqTOc7LU",Bt="b0A9Zfoa";const Rt=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n})=>{const o=(0,u.nTw)(e),i=(0,u.rQx)(e,t,n),{attachmentSettings:s}=e,a=o.webPagePreviewId?(0,u.kgA)(e,o.webPagePreviewId):void 0;return{webPagePreview:"empty"===a?.webpageType?void 0:a,noWebPage:i,attachmentSettings:s}})(({chatId:e,threadId:t,isDisabled:n,webPagePreview:s,noWebPage:a,attachmentSettings:r,isEditing:c})=>{const{toggleMessageWebPage:l,updateAttachmentSettings:u}=(0,i.ko)(),h=(0,j.A)(),m=(0,o.li)(),p=r.isInvertedMedia,f="small"===r.webPageMediaSize,v=(0,U.A)(()=>Boolean(s&&!a&&!n),[n,a,s]),{shouldRender:A}=(0,xt.A)({isOpen:v,ref:m,withShouldRender:!0}),y="full"===s?.webpageType&&s.hasLargeMedia,C=(0,o.li)(s);s&&s!==C.current&&(C.current=s);const w=s||C.current,I="full"===w?.webpageType,b=(0,Tt.A)(I?{content:w}:void 0),S=(0,d.eY)(w)||(0,d.rU)(w)||(0,d.y3)(w)||(0,d.rj)(w),M=S&&(0,d.VO)(S,"pictogram"),N=(0,Dt.A)(M),{shouldRender:Y,ref:k}=(0,xt.A)({isOpen:Boolean(N),withShouldRender:!0,noCloseTransition:!0}),P=Boolean(N||Y),F=(0,J.A)(()=>{l({chatId:e,threadId:t,noWebPage:!0})}),{isContextMenuOpen:T,contextMenuAnchor:D,handleContextMenu:x,handleContextMenuClose:L,handleContextMenuHide:E,handleBeforeContextMenu:B}=(0,O.A)(m,c,!0),R=(0,J.A)(()=>m.current),K=(0,J.A)(()=>m.current),z=(0,J.A)(()=>m.current.querySelector(`.${Et} .bubble`)),V=(0,J.A)(e=>{x(e)});function G(e){u({isInvertedMedia:e})}function $(e){u({webPageMediaSize:e})}if((0,o.vJ)(()=>{A&&w||(L(),E())},[L,E,A,w]),A&&w)return(0,He.Y)("div",{className:(0,g.A)("O3di3ULC",!c&&"G5_7x_Hn"),ref:m,children:(0,He.FD)("div",{className:"m3DBx9f5",children:[(0,He.Y)("div",{className:"vFWsMwfP",onClick:V,children:(0,He.Y)(et.A,{name:"link"})}),w&&"empty"!==w.webpageType&&(0,He.FD)(Lt.A,{noUserColors:!0,className:"otSxF62k",onContextMenu:x,onMouseDown:B,onClick:V,children:[P&&(0,He.FD)("div",{className:"VvwZOug9",children:[b&&(0,He.Y)("img",{src:b,alt:"",className:Bt}),Y&&(0,He.Y)("img",{ref:k,src:N,alt:"",className:Bt})]}),(0,He.FD)("div",{className:"itmZe2qi",children:[(0,He.Y)("span",{className:"ER149gdz",children:I?w.siteName||w.url:h("Loading")}),(0,He.Y)("span",{className:"FSYSqC60",children:I?w.description||h((q=w,q.photo?"AttachPhoto":q.video?"AttachVideo":q.audio?"AttachMusic":q.document?"AttachDocument":q.story?"AttachStory":"LinkPreview")):w.url})]})]}),(0,He.Y)(dt.A,{className:"yhxytYkd",round:!0,faded:!0,color:"translucent",ariaLabel:h("AccLinkRemovePreview"),onClick:F,children:(0,He.Y)(et.A,{name:"close"})}),!c&&(0,He.Y)(tt.A,{isOpen:T,anchor:D,getTriggerElement:R,getRootElement:K,getMenuElement:z,className:Et,onClose:L,onCloseAnimationEnd:E,autoClose:!0,children:(0,He.FD)(He.FK,{children:[p?(0,He.Y)(nt.A,{icon:"move-caption-up",onClick:()=>G(void 0),children:h("ContextMoveTextUp")}):(0,He.Y)(nt.A,{icon:"move-caption-down",onClick:()=>G(!0),children:h("ContextMoveTextDown")}),y&&(f?(0,He.Y)(nt.A,{icon:"expand",onClick:()=>$("large"),children:h("ContextLinkLargerMedia")}):(0,He.Y)(nt.A,{icon:"collapse",onClick:()=>$("small"),children:h("ContextLinkSmallerMedia")})),(0,He.Y)(nt.A,{icon:"delete",onClick:F,children:h("ContextLinkRemovePreview")})]})})]})});var q}));var Ot=n(97676),Ut=n(76283),Kt=n(57474),zt=n(41036),Vt=n(68292),jt=n(21849),Jt=n(48227),Gt=n(11241),$t=function(e){return e.Send="send",e.Record="record",e.Edit="edit",e.Schedule="schedule",e.Forward="forward",e.SendOneTime="sendOneTime",e}($t||{});const qt=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n,storyId:o,messageListType:i,isMobile:r,type:l})=>{const p=e.appConfig,g=(0,u.hds)(e,t),f=(0,d.DX)(t)?void 0:(0,u.yps)(e,t),v=Boolean(f),A=(0,u.nZ4)(e,t),y=(0,C.L8)(t),w=y?(0,u.vGo)(e,t):void 0,I=(0,u.WA9)(e,t),b=y?void 0:(0,u.AWZ)(e,t),S=(v||!y)&&(0,u.tVS)(e,t,n),{shouldSuggestStickers:M,shouldSuggestCustomEmoji:N,shouldUpdateStickerSetOrder:Y,shouldPaidMessageAutoApprove:P}=e.settings.byKey,{language:F,shouldCollectDebugLogs:T}=(0,m.l)(e),{forwardMessages:{messageIds:D}}=(0,u.nTw)(e),x=e.emojiKeywords[a.cUY],L=F!==a.cUY?e.emojiKeywords[F]:void 0,E=S?S.id:void 0,B=E?(0,u.O5q)(e,t,E):void 0,{currentUserId:R}=e,O=(0,u.mBe)(e,R),U=b?b?.sendAsId||R:void 0,K=U?(0,u.PVB)(e,U):void 0,z=(0,u.sam)(e,t),V=(0,u.p6T)(e,t),j=(0,u.nTw)(e),J=Boolean(j.storyViewer.storyId),G=(0,u.Xf0)(e),$=t===G?.chatId&&n===G?.threadId&&i===G?.type&&!J,q=((0,u.mBe)(e,t)&&!w?.noVoiceMessages)??!0,H=b?.slowMode,W=(0,u.g29)(e),_="scheduled"===i?(0,u.dkp)(e,t):(0,u.U0A)(e,t,n),Q=o&&(0,u.Msb)(e,t,o),Z=Q&&"sentReaction"in Q?Q.sentReaction:void 0,X=(0,u.GA4)(e,t,n),ee=X?.replyInfo?(0,u.O5q)(e,t,X.replyInfo.replyToMsgId):void 0,te=g?.isForum&&g.isForumAsMessages&&n===s.l3&&ee?(0,u.nkm)(e,ee):void 0,ne="scheduled"===i,oe=y&&!v&&!ne&&!A,ie=(0,u.rQx)(e,t,n),se=g&&(0,c.RY)(g,(0,u.K52)(e),(0,u.P5N)(e,t))?.isSilentPosting,ae=y&&!v&&!ne&&!A&&"story"!==l&&t!==a.zv8,re=(0,u.xYJ)(e,"stickerEffects"),de=j.shouldPlayEffectInComposer,ce=ae&&X?.effectId,le=ce?e.availableEffectById[ce]:void 0,ue=e.reactions.effectReactions,he=e.config?.maxMessageLength||k.Yf,me=t===j.forwardMessages.toChatId,pe=Boolean(X?.replyInfo),ge=Boolean(X?.suggestedPostInfo),fe=e.stars?.balance.amount||0,ve=Boolean(j.starsBalanceModal),Ae=(0,u.trm)(e),ye=e.isAppConfigLoaded,Ce=j.insertingPeerIdMention,we=j.webPagePreviewId?(0,u.kgA)(e,j.webPagePreviewId):void 0;return{availableReactions:e.reactions.availableReactions,topReactions:"story"===l?e.reactions.topReactions:void 0,isOnActiveTab:!j.isBlurred,editingMessage:(0,u.KLw)(e,t,n,i),draft:X,chat:g,isChatWithBot:v,isChatWithSelf:A,isForCurrentMessageList:$,canScheduleUntilOnline:(0,u.RBq)(e,t),isChannel:g?(0,d.WX)(g):void 0,isRightColumnShown:(0,u.gjV)(e,r),isSelectModeActive:(0,u.rTV)(e),withScheduledButton:"thread"===i&&(w||b)?.hasScheduledMessages,isInScheduledList:ne,botKeyboardMessageId:E,botKeyboardPlaceholder:B?.keyboardPlaceholder,isForwarding:me,isReplying:pe,hasSuggestedPost:ge,forwardedMessagesCount:me?D.length:void 0,pollModal:j.pollModal,todoListModal:j.todoListModal,stickersForEmoji:e.stickers.forEmoji.stickers,customEmojiForEmoji:e.customEmojis.forEmoji.stickers,chatFullInfo:b,topInlineBotIds:e.topInlineBots?.userIds,currentUserId:R,currentUser:O,contentToBeScheduled:j.contentToBeScheduled,shouldSuggestStickers:M,shouldSuggestCustomEmoji:N,shouldUpdateStickerSetOrder:Y,recentEmojis:e.recentEmojis,baseEmojiKeywords:x?.keywords,emojiKeywords:L?.keywords,inlineBots:j.inlineBots.byUsername,isInlineBotLoading:j.inlineBots.isLoading,botCommands:w?w.botInfo?.commands||!1:void 0,botMenuButton:w?.botInfo?.menuButton,sendAsPeer:K,sendAsId:U,editingDraft:_,requestedDraft:z,requestedDraftFiles:V,attachBots:e.attachMenu.bots,attachMenuPeerType:(0,u.dfQ)(e,t),theme:(0,u.SJA)(e),fileSizeLimit:(0,h.d)(e,"uploadMaxFileparts")*a.dK5,captionLimit:(0,h.d)(e,"captionLength"),isCurrentUserPremium:W,canSendVoiceByPrivacy:q,attachmentSettings:e.attachmentSettings,slowMode:H,currentMessageList:G,isReactionPickerOpen:(0,u.Ani)(e),canBuyPremium:!W&&!(0,u.n_C)(e),canPlayAnimatedEmojis:(0,u.BWX)(e),canSendOneTimeMedia:!A&&y&&!v&&!ne,shouldCollectDebugLogs:T,sentStoryReaction:Z,stealthMode:e.stories.stealthMode,replyToTopic:te,quickReplyMessages:e.quickReplies.messagesById,quickReplies:e.quickReplies.byId,canSendQuickReplies:oe,noWebPage:ie,webPagePreview:we,isContactRequirePremium:w?.isContactRequirePremium,effect:le,effectReactions:ue,areEffectsSupported:ae,canPlayEffect:re,shouldPlayEffect:de,maxMessageLength:he,paidMessagesStars:I,shouldPaidMessageAutoApprove:P,isSilentPosting:se,isPaymentMessageConfirmDialogOpen:j.isPaymentMessageConfirmDialogOpen,starsBalance:fe,isStarsBalanceModalOpen:ve,shouldDisplayGiftsButton:w?.shouldDisplayGiftsButton,disallowedGifts:w?.disallowedGifts,isAccountFrozen:Ae,isAppConfigLoaded:ye,insertingPeerIdMention:Ce,pollMaxAnswers:p.pollMaxAnswers}})(({type:e,isOnActiveTab:t,dropAreaState:n,isInScheduledList:c,canScheduleUntilOnline:h,isReady:m,isMobile:C,editingMessage:k,chatId:P,threadId:ie,storyId:se,currentMessageList:ae,messageListType:re,draft:de,chat:ce,chatFullInfo:le,replyToTopic:ue,isForCurrentMessageList:he,isCurrentUserPremium:me,canSendVoiceByPrivacy:pe,isChatWithBot:ge,isChatWithSelf:fe,isChannel:Ne,fileSizeLimit:Ue,isRightColumnShown:Ke,isSelectModeActive:ze,isReactionPickerOpen:Ve,shouldDisplayGiftsButton:je,isForwarding:$e,isReplying:qe,hasSuggestedPost:_e,forwardedMessagesCount:Qe,pollModal:Ze,todoListModal:Xe,botKeyboardMessageId:tt,botKeyboardPlaceholder:nt,inputPlaceholder:it,withScheduledButton:rt,stickersForEmoji:ht,customEmojiForEmoji:mt,topInlineBotIds:pt,currentUserId:gt,currentUser:ft,captionLimit:Tt,contentToBeScheduled:Dt,shouldSuggestStickers:xt,shouldSuggestCustomEmoji:Lt,baseEmojiKeywords:Et,emojiKeywords:Bt,recentEmojis:qt,inlineBots:Ht,isInlineBotLoading:Wt,botCommands:_t,sendAsPeer:Qt,sendAsId:Zt,editingDraft:Xt,requestedDraft:en,requestedDraftFiles:tn,botMenuButton:nn,attachBots:on,attachMenuPeerType:sn,attachmentSettings:an,theme:rn,slowMode:dn,shouldUpdateStickerSetOrder:cn,editableInputCssSelector:ln,editableInputId:un,inputId:hn,className:mn,availableReactions:pn,topReactions:gn,canBuyPremium:fn,canPlayAnimatedEmojis:vn,shouldCollectDebugLogs:An,sentStoryReaction:yn,stealthMode:Cn,canSendOneTimeMedia:wn,quickReplyMessages:In,quickReplies:bn,canSendQuickReplies:Sn,webPagePreview:Mn,noWebPage:Nn,isContactRequirePremium:Yn,paidMessagesStars:kn,effect:Pn,effectReactions:Fn,areEffectsSupported:Tn,canPlayEffect:Dn,shouldPlayEffect:xn,maxMessageLength:Ln,isSilentPosting:En,isPaymentMessageConfirmDialogOpen:Bn,starsBalance:Rn,isStarsBalanceModalOpen:On,disallowedGifts:Un,isAccountFrozen:Kn,isAppConfigLoaded:zn,insertingPeerIdMention:Vn,pollMaxAnswers:jn,onDropHide:Jn,onFocus:Gn,onBlur:$n,onForward:qn})=>{const{sendMessage:Hn,clearDraft:Wn,showDialog:_n,openPollModal:Qn,closePollModal:Zn,openTodoListModal:Xn,closeTodoListModal:eo,loadScheduledHistory:to,openThread:no,addRecentEmoji:oo,sendInlineBotResult:io,loadSendAs:so,resetOpenChatWithDraft:ao,callAttachBot:ro,addRecentCustomEmoji:co,showNotification:lo,showAllowedMessageTypesNotification:uo,openStoryReactionPicker:ho,openGiftModal:mo,closeReactionPicker:po,sendStoryReaction:go,editMessage:fo,updateAttachmentSettings:vo,saveEffectInDraft:Ao,setReactionEffect:yo,hideEffectInComposer:Co,updateChatSilentPosting:wo,updateInsertingPeerIdMention:Io,updateDraftSuggestedPostInfo:bo,updateShouldSaveAttachmentsCompression:So,applyDefaultAttachmentsCompression:Mo}=(0,i.ko)(),No=(0,G.A)(),Yo=(0,j.A)(),ko=(0,o.li)(),Po=(0,o.li)(),Fo=(0,o.li)(),[To,Do]=(0,o.Ul)(""),[xo,Lo]=(0,o.J0)(!1),Eo=(0,V.A)(ln),Bo=(0,o.li)(),Ro=(0,H.A)(n),{width:Oo}=Y.A.get(),Uo="messageList"===e,Ko="story"===e,zo=Uo?ce?.sendAsPeerIds:void 0,Vo=Boolean(zo?.length),[jo,Jo,Go]=(0,z.A)(),$o=(0,_.A)(P,ie),[qo,Ho,Wo]=(0,z.A)(),[_o,Qo,Zo]=(0,z.A)(),Xo=k&&(0,d.ZV)(k),ei=ce?.isMonoforum,{emojiSet:ti,members:ni,botCommands:oi}=le||{},ii=ti?.id,si=!kn&&!ei,ai=yn&&(0,d.a0)(yn,a.tNZ);(0,o.vJ)(y.VU,[To]);const ri=(0,o.li)(0),[di,ci]=(0,W.A)(Uo&&h,Go);(0,R.A)(()=>{Lo(!0)},430),(0,o.vJ)(()=>{Uo||po()},[Uo,se]),(0,o.vJ)(()=>{Bo.current=void 0},[P]),(0,o.vJ)(()=>{zn&&P&&m&&!Ko&&!ei&&to({chatId:P})},[m,P,ie,Ko,zn,ei]),(0,o.vJ)(()=>{const e=Ne&&ce?.areProfilesShown,t=ce&&(0,d.Vs)(ce)&&Boolean((0,d.gA)(ce)||ce.isLinkedInDiscussion||ce.hasGeo);!zo&&m&&(t||e)&&so({chatId:P})},[ce,P,Ne,m,so,zo]);const li=(0,o.li)(!1);(0,X.A)(([e,t])=>{li.current=Boolean(P===e&&zo&&!t)},[P,zo]);const[ui,hi]=(0,o.J0)([]),mi=Boolean(ui.length),[pi,gi]=(0,o.J0)(void 0);(0,o.vJ)(()=>{ui.length&&ui||So({shouldSave:!1})},[ui]);const{canSendStickers:fi,canSendGifs:vi,canAttachMedia:Ai,canAttachPolls:yi,canAttachEmbedLinks:Ci,canAttachToDoLists:wi,canSendVoices:Ii,canSendPlainText:bi,canSendAudios:Si,canSendVideos:Mi,canSendPhotos:Ni,canSendDocuments:Yi}=(0,o.Kr)(()=>(0,d.Q_)(ce,le,ge,fe,Ko,kn,c),[ce,le,ge,fe,Ko,kn,c]),ki=Yn&&Ko,Pi=ki||!bi,Fi=(0,U.A)(()=>{if(mi)return ui.length;const e=To()||mi?1:0;return $e&&Qe?Qe+e:e||1},[To,mi,ui,$e,Qe]),Ti=kn?Fi*kn:0,{closeConfirmDialog:Di,dialogHandler:xi,shouldAutoApprove:Li,setAutoApprove:Ei,handleWithConfirmation:Bi}=(0,Le.A)(Ti,On,Rn),Ri=!mi&&Ci&&!Nn&&Boolean(Mn),Oi=Pi&&!k;(0,o.vJ)(()=>{Ri||vo({isInvertedMedia:void 0})},[Ri]);const Ui=(0,J.A)((e,t=un,n=!1)=>{if(t===un&&Oi)return;const o=window.getSelection();let i;if(i=t===un?document.querySelector(ln):document.getElementById(t),o.rangeCount&&!n){const n=o.getRangeAt(0);if((0,x.L)(n,t))return(0,M.oR)(e),void i.dispatchEvent(new Event("input",{bubbles:!0}))}if(n){const t=e.split(" ")[0],n=To().startsWith(t);Do(n?e:`${e}${To()}`)}else Do(`${To()}${e}`);(0,r.Uz)(()=>{(0,w.A)(i)})}),Ki=(0,J.A)((e,t=un)=>{const n=(0,L.A)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"");Ui(n,t)}),zi=(0,J.A)((e,t=un,n=!1)=>{const o=(0,E.QY)(e);Ui(o,t,n)}),Vi=(0,J.A)((e,t=un)=>{Ui((0,D.hB)(e),t)}),ji=(0,J.A)(()=>{pi&&(zi(pi,un),gi(void 0))}),{shouldForceCompression:Ji,shouldForceAsFile:Gi,handleAppendFiles:$i,handleFileSelect:qi,onCaptionUpdate:Hi,handleClearAttachments:Wi,handleSetAttachments:_i}=function({attachments:e,fileSizeLimit:t,setHtml:n,setAttachments:s,chatId:a,canSendAudios:r,canSendVideos:c,canSendPhotos:l,canSendDocuments:u,insertNextText:h,editedMessage:m,shouldSendInHighQuality:p}){const g=(0,j.A)(),{openLimitReachedModal:f,showAllowedMessageTypesNotification:v,showNotification:A}=(0,i.ko)(),[y,C]=(0,o.J0)(!1),[w,I]=(0,o.J0)(!1),S=(0,J.A)(()=>{s(b.p),h()}),M=(0,J.A)(n=>{const o="function"==typeof n?n(e):n;if(o.length)if(o.some(e=>{const t=(0,d.ES)(e);return"audio"===t&&!r&&!u||"video"===t&&!c&&!u||"photo"===t&&!l&&!u||"file"===t&&!u}))v({chatId:a});else if(o.some(({size:e})=>e>t))f({limit:"uploadMaxFileparts"});else{s(o);const e=o.some(e=>{const t=(0,d.ES)(e);return"audio"===t&&!r||"video"===t&&!c||"photo"===t&&!l});C(Boolean(e&&u)),I(!u)}else S()}),N=(0,J.A)(async(t,n)=>{if(m){const e=await(0,T.A)(t[0].name,t[0]),n=m&&(0,d.eh)(m,e);m?.groupedId?n?M([e]):A({message:g("MediaReplaceInvalidError",void 0,{pluralValue:t.length})}):M([e])}else{const o=await Promise.all(t.map(e=>(0,T.A)(e.name,e,{shouldSendAsSpoiler:n||void 0,shouldSendInHighQuality:p})));M([...e,...o])}}),Y=(0,J.A)(async e=>{if(m){const t=await(0,T.A)(e[0].name,e[0]),n=m&&(0,d.eh)(m,t);m?.groupedId?n?M([t]):A({message:g("MediaReplaceInvalidError",void 0,{pluralValue:e.length})}):M([t])}else{const t=await Promise.all(e.map(e=>(0,T.A)(e.name,e,{shouldSendInHighQuality:p})));M(t)}}),k=(0,J.A)(async()=>{const t=await Promise.all(e.map(e=>(0,T.A)(e.filename,e.blob,{shouldSendInHighQuality:p})));M(t)});return(0,o.vJ)(()=>{k()},[p]),{handleAppendFiles:N,handleFileSelect:Y,onCaptionUpdate:n,handleClearAttachments:S,handleSetAttachments:M,shouldForceCompression:w,shouldForceAsFile:y}}({attachments:ui,setHtml:Do,setAttachments:hi,fileSizeLimit:Ue,chatId:P,canSendAudios:Si,canSendVideos:Mi,canSendPhotos:Ni,canSendDocuments:Yi,insertNextText:ji,editedMessage:k,shouldSendInHighQuality:an.shouldSendInHighQuality}),[Qi,Zi,Xi]=(0,z.A)(),[es,ts,ns]=(0,z.A)(),[os,is,ss]=(0,z.A)(),[as,rs,ds]=(0,z.A)(),[cs,ls,us]=(0,z.A)(),{startRecordingVoice:hs,stopRecordingVoice:ms,pauseRecordingVoice:ps,activeVoiceRecording:gs,currentRecordTime:fs,recordButtonRef:vs,startRecordTimeRef:As,isViewOnceEnabled:ys,setIsViewOnceEnabled:Cs,toogleViewOnceEnabled:ws}=(()=>{const e=(0,o.li)(),[t,n]=(0,o.J0)(),i=(0,o.li)(),[s,a]=(0,o.J0)(),[d,c]=(0,o.J0)(!1);(0,o.vJ)(()=>{p.Yw&&p.pW&&Je()},[]);const l=(0,J.A)(async()=>{try{const{stop:t,pause:o}=await Ge(t=>{e.current&&(i.current&&Date.now()%4==0&&(0,r.RK)(()=>{e.current&&(e.current.style.boxShadow=`0 0 0 ${50*(t||0)}px rgba(0,0,0,.15)`)}),a(Date.now()))});i.current=Date.now(),a(Date.now()),n({stop:t,pause:o})}catch(e){console.error(e)}}),u=(0,J.A)(()=>{if(t){(0,r.RK)(()=>{e.current&&(e.current.style.boxShadow="none")});try{return t.pause()}catch(e){return void console.error(e)}}}),h=(0,J.A)(()=>{if(t){n(void 0),i.current=void 0,a(void 0),(0,r.RK)(()=>{e.current&&(e.current.style.boxShadow="none")});try{return t.stop()}catch(e){return void console.error(e)}}});(0,o.vJ)(()=>t?(0,Oe.A)(h):void 0,[t,h]);const m=(0,J.A)(()=>{c(!d)});return{startRecordingVoice:l,pauseRecordingVoice:u,stopRecordingVoice:h,activeVoiceRecording:t,currentRecordTime:s,recordButtonRef:e,startRecordTimeRef:i,isViewOnceEnabled:d,setIsViewOnceEnabled:c,toogleViewOnceEnabled:m}})(),Is=he&&!Ko;(0,B.A)(()=>{$o({type:"recordAudio"})},Is?gs&&a.cqp:void 0),(0,o.vJ)(()=>{he&&!Ko&&(gs||$o({type:"cancel"}))},[gs,he,Ko,$o]);const bs=(0,Z.i)(Boolean(k));(0,o.vJ)(()=>{he&&!Ko&&To()&&!bs.current&&$o({type:"typing"})},[To,bs,he,Ko,$o]);const Ss=ce&&(0,d.SJ)(ce),{isEmojiTooltipOpen:Ms,closeEmojiTooltip:Ns,filteredEmojis:Ys,filteredCustomEmojis:ks,insertEmoji:Ps}=(0,Me.A)(Boolean(m&&t&&(Ko||he)&&xt&&!mi),To,Do,void 0,qt,Et,Bt),{isCustomEmojiTooltipOpen:Fs,closeCustomEmojiTooltip:Ts,insertCustomEmoji:Ds}=(0,Ae.A)(Boolean(m&&t&&(Ko||he)&&Lt&&!mi),To,Do,Eo,ko,mt),{isStickerTooltipOpen:xs,closeStickerTooltip:Ls}=function(e,t,n){const{loadStickersForEmoji:s,clearStickersForEmoji:r}=(0,i.ko)(),[d,c,l]=(0,z.A)(!1),u=(0,ne.A)(()=>{const n=t();if(!e||!n||p.TL&&n.length>8)return;if(!n.match(p.TL?Ee.A:a.bpX))return;const o=(0,ee.S)(n);return o&&(p.TL&&1===(0,Be.A)(o)||!p.TL&&Boolean(n.match(Re)))?p.TL?o:o.match(/alt="(.+)"/)?.[1]:void 0},[t,e]),h=(0,U.A)(()=>Boolean(u()),[u]),m=Boolean(n?.length);return(0,o.vJ)(()=>{if(!e||!h)return;const t=u();t?m||s({emoji:t}):r()},[e,h,u,m,s,r]),(0,o.vJ)(l,[l,t]),{isStickerTooltipOpen:Boolean(h&&m&&!d),closeStickerTooltip:c}}(Boolean(m&&t&&(Ko||he)&&xt&&fi&&!mi),To,ht),{isMentionTooltipOpen:Es,closeMentionTooltip:Bs,insertMention:Rs,mentionFilteredUsers:Os}=(0,xe.A)(Boolean(Uo&&m&&he&&!mi),To,Do,Eo,ko,ni,pt,gt);(0,o.vJ)(()=>{if(!Vn)return;const e=(0,u.PVB)((0,i.mS)(),Vn);e&&Rs(e,!0,!0),Io({peerId:void 0})},[Vn,Rs]);const{isOpen:Us,botId:Ks,isGallery:zs,switchPm:Vs,switchWebview:js,results:Js,closeTooltip:Gs,help:$s,loadMore:qs}=function(e,t,n,s){const{queryInlineBot:a,resetInlineBot:r,resetAllInlineBots:d}=(0,i.ko)(),[c,l,u]=(0,z.A)(!1),h=(0,te.gs)(()=>{const t=n();return e&&t.startsWith("@")?function(e){if(!e.startsWith("@"))return Pe;const t=function(e){return Fe.innerHTML=e.replace(/<br>/g,"\n"),Fe.querySelectorAll("[alt]").forEach(e=>{e.innerText||(e.innerText=e.getAttribute("alt"))}),Fe.innerText}(e),n=t.match(Ye);return n?Te(n[1],n[2],""===n[2]&&!t.match(ke)):Pe}(t):Pe},[n,e],300),{username:m,query:p,canShowHelp:g,usernameLowered:f}=(0,U.A)(h,[h,n],!0);(0,X.A)(([e])=>{e&&r({username:e})},[m,r]),(0,o.vJ)(()=>{f&&a({chatId:t,username:f,query:p})},[t,p,a,f]),(0,o.vJ)(u,[u,n]);const{id:v,switchPm:A,switchWebview:y,offset:C,results:w,isGallery:I,help:b}=f&&s?.[f]||{},S=Boolean((w?.length||A||y)&&!c);(0,o.vJ)(()=>{S||m||d()},[S,d,m]);const M=(0,J.A)(()=>{f&&a({chatId:t,username:f,query:p,offset:C})});return{isOpen:S,botId:v,isGallery:I,switchPm:A,switchWebview:y,results:w,closeTooltip:l,help:g&&b?`@${m} ${b}`:void 0,loadMore:M}}(Boolean(Uo&&m&&he&&!mi),P,To,Ht),Hs=Boolean(bn&&Object.keys(bn).length),{isOpen:Ws,close:_s,filteredBotCommands:Qs,filteredQuickReplies:Zs}=function(e,t,n,i,s){const[a,r]=(0,o.J0)(),[d,c]=(0,o.J0)(),[l,u,h]=(0,z.A)(!1),m=(0,te.gs)(()=>{const n=t();return e&&n.startsWith("/")?(0,ee.S)(n).match(oe)?.[0].trim():void 0},[t,e],300),p=(0,ne.A)(m,[m,t],!0);return(0,o.vJ)(()=>{const e=p(),t=n||i;if(!e||!t&&!s)return r(void 0),void c(void 0);const o=e.substring(1),a=t?.filter(e=>!o||e.command.startsWith(o));r(a?.length?a:void 0);const d=Object.values(s||{}).filter(e=>!o||e.shortcut.startsWith(o));c(d?.length?d:void 0)},[p,n,i,s]),(0,o.vJ)(h,[h,t]),{isOpen:Boolean((a?.length||d?.length)&&!l),close:u,filteredBotCommands:a,filteredQuickReplies:d}}(Boolean(Uo&&m&&he&&(_t&&_t?.length||oi?.length||Hs&&Sn)),To,_t,oi,Sn?bn:void 0);(({draft:e,chatId:t,threadId:n,getHtml:d,setHtml:c,editedMessage:l,isDisabled:u})=>{const{saveDraft:h,clearDraft:m,loadCustomEmojis:p}=(0,i.ko)(),g=(0,o.li)(!1);(0,o.vJ)(()=>{const t=d(),n=void 0!==e?.isLocal;(0,E.QY)(e?.text)!==t||n?g.current=!0:g.current=!1},[e,d]),(0,o.vJ)(()=>{g.current=!1},[t,n]);const f=Boolean(l),v=(0,J.A)((e={})=>{if(u||f||!g.current)return;const o=d();o?(0,r.YS)(()=>{h({chatId:e.chatId??t,threadId:e.threadId??n,text:(0,S.Ay)(o)})}):m({chatId:e.chatId??t,threadId:e.threadId??n,shouldKeepReply:!0,shouldKeepSuggestedPost:!0})}),A=(0,Ce.A)(a.mPG,!0,void 0,[t,n]);(0,ye.A)(([o,i,d])=>{if(u)return;const h=g.current,m=e?.suggestedPostInfo&&!d?.suggestedPostInfo;if(t===o&&n===i){if(h&&!e)return;if(!e&&d&&c(""),h&&!m)return}if(l||!e)return;c((0,E.QY)(e.text)),m&&(0,r.Uz)(()=>{const e=document.querySelector(a.m$5);e&&(0,w.A)(e,!0)});const f=e.text?.entities?.map(e=>e.type===s.C7.CustomEmoji&&e.documentId).filter(Boolean)||[];f.length&&p({ids:f})},[t,n,e,d,c,l,u]),(0,o.Nf)(()=>{if(!u)return()=>{f||v({chatId:t,threadId:n}),be=!0,(0,r.YS)(()=>{be=!1})}},[t,n,f,v,u]);const y=(0,Z.i)(t),C=(0,Z.i)(n);(0,o.vJ)(()=>{if(u||be)return;if(!d())return void v();const e=y.current,t=C.current;A(()=>{y.current===e&&C.current===t&&v()})},[y,d,u,A,C,v]),(0,we.Ay)(v),(0,Ie.A)(v)})({draft:de,chatId:P,threadId:ie,getHtml:To,setHtml:Do,editedMessage:k,isDisabled:Ko||Boolean(en)||!_e&&ei}),function({getHtml:e,chatId:t,threadId:n}){const{loadWebPagePreview:a,clearWebPagePreview:r,toggleMessageWebPage:d}=(0,i.ko)(),c=(0,o.li)(),l=(0,te.tF)(()=>{const t=(0,S.Ay)(e()),n=t.entities?.find(e=>e.type===s.C7.TextUrl);return c.current=t,n?.url||t.text.match(De)?.[0]},[e],300,!0),u=(0,ne.A)(l,[l,e],!0);(0,o.vJ)(()=>{const e=u(),o=c.current;e?a({text:o}):(r(),d({chatId:t,threadId:n}))},[u,t,n]),(0,X.A)(()=>{r(),d({chatId:t,threadId:n})},[t,r,n,d])}({chatId:P,threadId:ie,getHtml:To});const Xs=(0,J.A)((e=!1)=>{e||Do(""),hi(b.p),gi(void 0),Ns(),Ts(),Ls(),Bs(),C?setTimeout(()=>ss(),350):ss()}),[ea,ta,na]=((e,t,n,s,c,l,u,h,m)=>{const{editMessage:p,setEditingDraft:g,toggleMessageWebPage:f,openDeleteMessageModal:v}=(0,i.ko)(),[A,y]=(0,o.J0)(!1),C=h?.replyInfo?.replyToMsgId;(0,K.A)(([e,o])=>{if(!n)return;if(C&&o!==C)return t(""),void y(!1);if(e?.id===n.id&&C===o)return;const i=!e&&m?.text.length?m:n.content.text,s=(0,E.QY)(i);t(s),y(!0),(0,r.Uz)(()=>{const e=document.querySelector(a.m$5);e&&(0,w.A)(e,!0)})},[n,C,m,t]),(0,o.vJ)(()=>{if(!n)return;const e=!("webPage"in n.content)&&n.content.text?.entities?.some(e=>Se.has(e.type));f({chatId:c,threadId:l,noWebPage:e})},[c,l,n]),(0,o.vJ)(()=>{if(n)return()=>{const t=(0,S.Ay)(e()),n=t.text.length?t:void 0;g({chatId:c,threadId:l,type:u,text:n})}},[c,n,e,g,l,u]);const I=(0,te.tF)(()=>{if(!n)return!1;const t=(0,S.Ay)(e());return!("webPage"in n.content)&&n.content.text?.entities?.some(e=>Se.has(e.type))&&!t.entities?.some(e=>Se.has(e.type))},[n,e],300,!0),b=(0,ne.A)(I,[I,e],!0);(0,K.A)(([e])=>{n&&e?.id===n.id&&b()&&f({chatId:c,threadId:l,noWebPage:!1})},[n,c,e,l,b]);const M=(0,J.A)(()=>{h&&(0,r.YS)(()=>{t((0,E.QY)(h.text)),(0,r.Uz)(()=>{const e=document.querySelector(a.m$5);e&&(0,w.A)(e,!0)})})}),N=(0,J.A)(()=>{s(),M()}),Y=(0,J.A)(()=>{const{text:t,entities:o}=(0,S.Ay)(e());n&&(t||(0,d.mR)(n)?(p({messageList:{chatId:c,threadId:l,type:u},text:t,entities:o}),s(),M()):v({chatId:c,messageIds:[n.id],isSchedule:"scheduled"===u}))}),k=(0,J.A)(()=>{if(!n)return;const t=(0,S.Ay)(e()),o=t.text.length?t:void 0;g({chatId:c,threadId:l,type:u,text:o})});return(0,we.Ay)(k),(0,Ie.A)(k),[Y,N,A]})(To,Do,k,Xs,P,ie,re,de,Xt),oa=(0,Z.i)(Xs),ia=(0,Z.i)(ms);(0,o.vJ)(()=>()=>{ia.current(),oa.current()},[P,ie,oa,ia]);const sa=(0,o.Kr)(()=>{if(Un)return Object.values(Un).every(Boolean)},[Un]),aa=Boolean(!fe&&je&&!sa),ra=ei&&!k&&!$e&&!qe&&!de?.suggestedPostInfo,da=(0,J.A)(()=>{const e=ri.current;lo(e?{message:No("UnlockPremiumEmojiHint2"),action:{action:"openChat",payload:{id:gt,shouldReplaceHistory:!0}},actionText:No("Open")}:{message:No("UnlockPremiumEmojiHint"),action:{action:"openPremiumModal",payload:{initialSection:"animated_emoji"}},actionText:No("PremiumMore")}),ri.current=Number(!e)}),ca=(0,U.A)(()=>qo||!qn||To()&&!mi?k&&na?$t.Edit:!p.pW||gs||$e||To()&&!mi?c?$t.Schedule:$t.Send:$t.Record:$t.Forward,[gs,k,To,mi,$e,qo,qn,na,c]),la=!c,{isContextMenuOpen:ua,handleContextMenu:ha,handleContextMenuClose:ma,handleContextMenuHide:pa}=(0,O.A)(vs,!(ca===$t.Send&&la)),{contextMenuAnchor:ga,handleContextMenu:fa,handleBeforeContextMenu:va,handleContextMenuHide:Aa}=(0,O.A)(Fo,!Ko);(0,o.vJ)(()=>{Ve||ga&&(ho({peerId:P,storyId:se,position:ga}),Aa())},[P,Aa,Ve,se,ga]);const{className:ya,style:Ca}=(0,$.Ay)({peer:Qt||ft,theme:rn});ve(he||Ko,zi,_i,gi,k,!me&&!fe,da,!ui.length);const wa=(0,J.A)(()=>{k&&ta()}),Ia=(0,J.A)((e,t)=>{const n=t?Tt:Ln;if(e?.length>n){const t=e.length-n;return _n({data:{message:"MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS",textParams:{"{EXTRA_CHARS_COUNT}":t.toString(),"{PLURAL_S}":t>1?"s":""},hasErrorKey:!0}}),!1}return!0}),ba=(0,J.A)(()=>{if(dn&&!Ss){const e=document.querySelector(ln),t=(0,N.Fm)(),n=Bo.current&&Math.floor(t-Bo.current),o=dn.nextSendDate&&dn.nextSendDate>t;if(n&&n<dn.seconds||o){const i=o?dn.nextSendDate-t:dn.seconds-n;return _n({data:{message:No("SlowModeHint",(0,f.QO)(i)),isSlowMode:!0,hasErrorKey:!1}}),e?.blur(),!1}}return!0}),Sa=e=>{if(!ae&&!se)return!1;const{text:t}=(0,S.Ay)(To());return!(!t&&!e.length||!Ia(t,!0)||!ba())},Ma=(0,J.A)(({attachments:e,sendCompressed:t=an.shouldCompress,sendGrouped:n=an.shouldSendGrouped,isSilent:o,scheduledAt:i,isInvertedMedia:s})=>{if(!ae&&!se)return;o=o||En;const{text:a,entities:d}=(0,S.Ay)(To());s=a&&t&&n?s:void 0,k?fo({messageList:ae,text:a,entities:d,attachments:(0,T.L)(e,t)}):Hn({messageList:ae,text:a,entities:d,scheduledAt:i,isSilent:o,shouldUpdateStickerSetOrder:cn,attachments:(0,T.L)(e,t),shouldGroupMessages:n,isInvertedMedia:s}),Bo.current=(0,N.Fm)(),Wn({chatId:P,threadId:ie,isLocalOnly:!0}),(0,r.YS)(()=>{Xs()})}),Na=(0,J.A)((e,t,n)=>{if(Sa(ui)){if(k)return void Ma({attachments:ui,sendCompressed:e,sendGrouped:t,isInvertedMedia:n});Bi(Ma,{attachments:ui,sendCompressed:e,sendGrouped:t,isInvertedMedia:n})}}),Ya=(0,J.A)((e,t,n,o,i)=>{Sa(ui)&&Ma({attachments:ui,sendCompressed:e,sendGrouped:t,isSilent:n,scheduledAt:o,isInvertedMedia:i})}),ka=(0,J.A)((e,t=!1,n)=>{const{text:o,entities:i}=(0,S.Ay)(To());if(e.length)return void(Sa(e)&&Ma({attachments:e,scheduledAt:n,isSilent:t}));if(!o&&!$e)return;if(!Ia(o))return;const s=document.querySelector(ln),a=Pn?.id;if(o||$e){if(!ba())return;const e=Ri?an.isInvertedMedia:void 0;Tn&&Ao({chatId:P,threadId:ie,effectId:void 0}),Hn({messageList:ae,text:o,entities:i,scheduledAt:n,isSilent:t,shouldUpdateStickerSetOrder:cn,isInvertedMedia:e,effectId:a,webPageMediaSize:an.webPageMediaSize,webPageUrl:Ri?Mn.url:void 0,isForwarding:$e})}Bo.current=(0,N.Fm)(),Wn({chatId:P,threadId:ie,isLocalOnly:!0,shouldKeepReply:$e}),p.pz&&s&&s===document.activeElement&&F(s),(0,r.YS)(()=>{Xs()})}),Pa=(0,J.A)(async(e=!1,t)=>{if(!ae&&!se)return;e=e||En;let n=ui;if(gs){const e=await ms(),t=ys?a.dxe:void 0;if(e){const{blob:o,duration:i,waveform:s}=e;n=[await(0,T.A)("wonderful-voice-message.ogg",o,{voice:{duration:i,waveform:s},ttlSeconds:t})]}}ka(n,e,t)}),Fa=(0,J.A)((e=!1,t)=>{Bi(Pa,e,t)}),Ta=(0,J.A)(()=>{me?Xn({chatId:P}):lo({message:Yo("SubscribeToTelegramPremiumForCreateToDo"),action:{action:"openPremiumModal",payload:{initialSection:"todo"}},actionText:Yo("PremiumMore")})}),Da=(0,J.A)(()=>{if("webApp"!==nn?.type)return;const e=(0,A.vG)(nn.url);"publicUsernameOrBotLink"===e?.type&&e.appName?(0,v._)(nn.url):ro({chatId:P,url:nn.url,threadId:ie})}),xa=(0,J.A)(()=>{ss(),ts()}),La=(0,J.A)((e,t,n,o)=>{if(e&&"queryId"in e){const{id:n,queryId:o,isSilent:i}=e;return void io({id:n,chatId:P,threadId:ie,queryId:o,scheduledAt:t,isSilent:i||En})}const{isSilent:i,...s}=e||{};if(e&&0!==Object.keys(s).length)if(void 0!==e.sendCompressed||void 0!==e.sendGrouped){const{sendCompressed:n=!1,sendGrouped:o=!1,isInvertedMedia:s}=e;Ya(n,o,i,t,s)}else Hn({...e,messageList:n,scheduledAt:t,effectId:o});else Pa(Boolean(i),t)});(0,K.A)(([e])=>{ae&&Dt&&Dt!==e&&di(e=>{La(Dt,e,ae)})},[Dt,ae,La,di]),(0,o.vJ)(()=>{en&&(zi(en,void 0,!0),ao(),(0,r.Uz)(()=>{const e=document.getElementById(un);(0,w.A)(e,!0)}))},[un,en,ao,Do]),(0,o.vJ)(()=>{tn?.length&&(qi(tn),ao())},[qi,tn,ao]),(0,o.vJ)(()=>{tn?.length?(So({shouldSave:!0}),Mo()):So({shouldSave:!1})},[tn,So,Mo]);const Ea=(0,J.A)((e,t)=>{const n="id"in e.stickerSetInfo&&e.stickerSetInfo.id;e.isFree||me||fe||n===ii?Vi(e,t):da()}),Ba=(0,J.A)(e=>{Ea(e,a.e0F)}),Ra=(0,J.A)((e,t,n)=>{(ae||se)&&(t=t||En,c||n?(Jo(),di(n=>{Go(),Bi(La,{gif:e,isSilent:t},n,ae),(0,r.YS)(()=>{Xs(!0)})})):(Bi(Hn,{messageList:ae,gif:e,isSilent:t}),(0,r.YS)(()=>{Xs(!0)})),Wn({chatId:P,threadId:ie,isLocalOnly:!0}))}),Oa=(0,J.A)((e,t,n,o=!1,i)=>{(ae||se)&&(t=t||En,e={...e,isPreloadedGlobally:!0},c||n?(Jo(),di(n=>{Go(),Bi(La,{sticker:e,isSilent:t},n,ae),(0,r.YS)(()=>{Xs(o)})})):(Bi(Hn,{messageList:ae,sticker:e,isSilent:t,shouldUpdateStickerSetOrder:cn&&i}),Wn({chatId:P,threadId:ie,isLocalOnly:!0}),(0,r.YS)(()=>{Xs(o)})))}),Ua=(0,J.A)((e,t,n)=>{if(!ae&&!se)return;t=t||En,c||n?di(n=>{Bi(La,{id:e.id,queryId:e.queryId,isSilent:t},n,ae)}):Bi(io,{id:e.id,queryId:e.queryId,threadId:ie,chatId:P,isSilent:t});const o=document.querySelector(ln);p.pz&&o&&o===document.activeElement&&F(o),Wn({chatId:P,threadId:ie,isLocalOnly:!0}),(0,r.YS)(()=>{Xs()})}),Ka=(0,J.A)(()=>{Wn({chatId:P,threadId:ie,isLocalOnly:!0}),(0,r.YS)(()=>{Xs()})}),za=(0,J.A)(e=>{ae&&(c?(di(t=>{Bi(La,{poll:e},t,ae)}),Zn()):(Bi(Hn,{messageList:ae,poll:e,isSilent:En}),Zn()))}),Va=(0,J.A)(e=>{ae&&(c?di(t=>{Bi(La,{todo:e},t,ae)}):Bi(Hn,{messageList:ae,todo:e,isSilent:En}))}),ja=(0,J.A)(e=>{if(c)di(t=>{La({...e,isSilent:!0},t,ae)});else if(e&&("sendCompressed"in e||"sendGrouped"in e)){const{sendCompressed:t=!1,sendGrouped:n=!1,isInvertedMedia:o}=e;Ya(t,n,!0,void 0,o)}else Pa(!0)}),Ja=(0,J.A)(()=>{const e=document.querySelector(ln);if(!C||e!==document.activeElement)return ns(),ss(),void rs();e?.blur(),setTimeout(()=>{ns(),ss(),rs()},100)});(0,o.vJ)(()=>{Oi&&Do("")},[Oi,Do,ui]);const Ga=(0,J.A)(e=>{Ki(e,a.e0F)}),$a=(0,J.A)((e=un)=>{const t=window.getSelection();if(t.rangeCount){const n=t.getRangeAt(0);if((0,x.L)(n,e))return void document.execCommand("delete",!1)}Do(function(e){const t=document.createElement("div");t.contentEditable="true",t.style.position="absolute",t.style.left="-10000px",t.style.top="-10000px",t.innerHTML=e,t.className="allow-selection",document.body.appendChild(t);let n=t.lastChild;if(n.lastChild)for(;n.lastChild;)n=n.lastChild;const o=n.textContent.length,i=document.createRange(),s=window.getSelection();i.setStart(n,o),i.setEnd(n,o),s.removeAllRanges(),s.addRange(i),document.execCommand("delete",!1);const a=t.innerHTML;return document.body.removeChild(t),a}(To()))}),qa=(0,J.A)(()=>{$a(a.e0F)}),Ha=(0,J.A)(()=>{no({chatId:P,threadId:ie,type:"scheduled",noForumTopicPanel:!0})}),Wa=(0,J.A)(()=>{mo({forUserId:P})}),_a=(0,J.A)(()=>{bo({price:{currency:a.OUy,amount:0,nanos:0}})}),Qa=(0,J.A)(()=>{const e=!En;wo({chatId:P,isEnabled:e}),lo({localId:"silentPosting",icon:e?"mute":"unmute",message:Yo(`ComposerSilentPosting${e?"Enabled":"Disabled"}Tootlip`)})});(0,o.vJ)(()=>{Ke&&C&&ss()},[Ke,ss,C]),(0,o.vJ)(()=>{m&&(ze?ls():setTimeout(()=>{us()},200))},[ze,us,ls,m]);const Za=(0,U.A)(()=>Boolean(To()),[To]),Xa=ge&&"webApp"===nn?.type&&!k&&"thread"===re,er=Xa&&!Za&&!gs,[tr,nr]=(0,o.Kr)(()=>dn?.nextSendDate?["SlowModeWait",dn.nextSendDate]:Cn?.activeUntil&&Ko?["StealthModeActiveHint",Cn.activeUntil]:[],[Ko,dn?.nextSendDate,Cn?.activeUntil]),or=Qi||os||Ms||as||Es||Us||es||_o||xs||Ws||Fs||er||ua||Boolean(gs)||ui.length>0||qo,ir=or&&!Ve&&Ko&&!_o&&!os,sr=(0,o.Kr)(()=>gs&&Oo<=600?"":Oi?Yo(Ko?"ComposerStoryPlaceholderLocked":"ComposerPlaceholderNoText"):nt||it||(kn?Yo("ComposerPlaceholderPaidMessage",{amount:(0,I.U2)(Yo,kn,{asFont:!0,className:"placeholder-star-icon"})},{withNodes:!0}):qe&&_e?Yo("ComposerPlaceholderCaption"):ce?.adminRights?.anonymous?Yo("ComposerPlaceholderAnonymous"):ce?.isForum&&ce?.isForumAsMessages&&ie===s.l3?ue?Yo("ComposerPlaceholderTopic",{topic:ue.title}):Yo("ComposerPlaceholderTopicGeneral"):Yo(Ne?En?"ComposerPlaceholderBroadcastSilent":"ComposerPlaceholderBroadcast":"ComposerPlaceholder")),[gs,nt,ce,it,Ne,Oi,Ko,En,Yo,ue,qe,ie,Oo,kn,_e]);(0,o.vJ)(()=>{or?Gn?.():$n?.()},[or,$n,Gn]);const{shouldRender:ar,transitionClassNames:rr}=(0,Q.A)(ir),dr=!(ca!==$t.Record||Ai&&pe&&Ii),cr=(0,J.A)(()=>{switch(ca){case $t.Forward:qn?.();break;case $t.Send:Fa();break;case $t.Record:dr?pe?Ii||uo({chatId:P,messageListType:re}):lo({message:No("VoiceMessagesRestrictedByPrivacy",ce?.title)}):(Cs(!1),hs());break;case $t.Edit:ea();break;case $t.Schedule:if(gs&&ps(),!ae)return;di(e=>{La({},e,ae,Pn?.id)})}}),lr=new Date;lr.setSeconds(0),lr.setMilliseconds(0);const ur=new Date;ur.setFullYear(ur.getFullYear()+1);let hr="SendMessage";switch(ca){case $t.Forward:hr="Forward";break;case $t.Edit:hr="Save edited message";break;case $t.Record:hr=Ai?"AccDescrVoiceMessage":"Conversation.DefaultRestrictedMedia"}const mr=(0,g.A)("Composer",!ze&&"shown",cs&&"hover-disabled",xo&&"mounted",mn),pr=(0,J.A)(e=>{let t,n;if("emoji"===e.type&&(t=e.emoticon),"custom"===e.type){const o=(0,u.O8F)((0,i.mS)(),e.documentId);if(!o)return;if(!o.isFree&&!me&&!fe)return void da();const s=(0,S.Ay)((0,D.hB)(o));t=s.text,n=s.entities}Bi(Hn,{text:t,entities:n,isReaction:!0}),po()}),gr=(0,J.A)(e=>{yo({chatId:P,threadId:ie,reaction:e}),po()}),fr=(0,J.A)(e=>{ho({peerId:P,storyId:se,position:e,sendAsMessage:!0})}),vr=(0,J.A)(()=>{const e=yn?void 0:a.tNZ;go({peerId:P,storyId:se,containerId:(0,d.$_)(P,se),reaction:e})}),Ar=(0,J.A)(()=>{di(e=>{La({},e,ae)})}),yr=(0,J.A)(()=>{Bi(ja)}),Cr=(0,J.A)(()=>{Bi(La,{},a.NkL,ae,Pn?.id)}),wr=(0,J.A)((e,t,n)=>{di(o=>{Bi(La,{sendCompressed:e,sendGrouped:t,isInvertedMedia:n},o,ae)})}),Ir=(0,J.A)((e,t,n)=>{Bi(ja,{sendCompressed:e,sendGrouped:t,isInvertedMedia:n})}),br=(0,J.A)(()=>{Ao({chatId:P,threadId:ie,effectId:void 0})}),Sr=(0,J.A)(()=>{Co({})}),Mr=(0,o.Kr)(()=>{switch(ca){case $t.Edit:return ea;case $t.Schedule:return Ar;default:return Fa}},[ca,ea,Fa]),Nr=ge&&"commands"===nn?.type&&!k&&!1!==_t&&!gs,Yr=Tn&&Pn?.emoticon,kr=Boolean(kn&&ca===$t.Send),Pr=(0,q.A)(kr);return(0,He.FD)("div",{className:mr,children:[Uo&&Ai&&m&&(0,He.Y)(wt,{isOpen:n!==Ct.I.None,withQuick:n===Ct.I.QuickFile||Ro===Ct.I.QuickFile,onHide:Jn,onFileSelect:qi,editingMessage:k}),ar&&!ki&&(0,He.Y)(Ut.A,{topReactions:gn,allAvailableReactions:pn,onToggleReaction:pr,isPrivate:!0,isReady:m,canBuyPremium:fn,isCurrentUserPremium:me,isInSavedMessages:fe,isInStoryViewer:Ko,canPlayAnimatedEmojis:vn,onShowMore:fr,className:rr}),(0,He.Y)(We,{chatId:P,threadId:ie,canShowCustomSendMenu:la,attachments:ui,getHtml:To,isReady:m,shouldForceCompression:Ji,shouldForceAsFile:Gi,isForCurrentMessageList:he,isForMessage:Uo,shouldSchedule:si&&c,canSchedule:si,forceDarkTheme:Ko,onCaptionUpdate:Hi,onSendSilent:Ir,onSend:Na,onSendScheduled:wr,onFileAppend:$i,onClear:Wi,onAttachmentsUpdate:_i,onCustomEmojiSelect:Ba,onRemoveSymbol:qa,onEmojiSelect:Ga,editingMessage:k,onSendWhenOnline:Cr,canScheduleUntilOnline:h&&!ys,paidMessagesStars:kn}),(0,He.Y)(Nt,{isOpen:Ze.isOpen,isQuiz:Ze.isQuiz,shouldBeAnonymous:Ne,maxOptionsCount:jn,onClear:Zn,onSend:za}),(0,He.Y)(Ft,{modal:Xe,onClear:eo,onSend:Va}),(0,He.Y)(Yt,{isOpen:as,onClose:ds,chatId:P,selectedSendAsId:Zt,sendAsPeerIds:zo,isCurrentUserPremium:me}),(0,He.Y)(St,{isOpen:Es,filteredUsers:Os,onInsertUserName:Rs,onClose:Bs}),(0,He.Y)(ut,{isOpen:Ws,chatId:P,withUsername:Boolean(oi),botCommands:Qs,quickReplies:Zs,getHtml:To,self:ft,quickReplyMessages:In,onClick:Ka,onClose:_s}),(0,He.FD)("div",{className:(0,g.A)("composer-wrapper",Ko&&"with-story-tweaks",ki&&"is-need-premium"),children:[!ki&&(0,He.FD)("svg",{className:"svg-appendix",width:"9",height:"20",children:[(0,He.Y)("defs",{children:(0,He.FD)("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"composerAppendix",children:[(0,He.Y)("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,He.Y)("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,He.Y)("feColorMatrix",{values:"0 0 0 0 0.0621962482 0 0 0 0 0.138574144 0 0 0 0 0.185037364 0 0 0 0.15 0",in:"shadowBlurOuter1"})]})}),(0,He.FD)("g",{fill:"none","fill-rule":"evenodd",children:[(0,He.Y)("path",{d:"M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z",fill:"#000",filter:"url(#composerAppendix)"}),(0,He.Y)("path",{d:"M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z",fill:"#FFF",className:"corner"})]})]}),Uo&&(0,He.FD)(He.FK,{children:[(0,He.Y)(bt,{isOpen:Us,botId:Ks,isGallery:zs,inlineBotResults:Js,switchPm:Vs,switchWebview:js,loadMore:qs,isSavedMessages:fe,canSendGifs:vi,isCurrentUserPremium:me,onSelectResult:Ua,onClose:Gs}),(0,He.Y)(vt,{onClear:wa,shouldForceShowEditing:Boolean(na&&k),chatId:P,threadId:ie,messageListType:re}),(0,He.Y)(Rt,{chatId:P,threadId:ie,isDisabled:!Ci||mi||!Za,isEditing:Boolean(k)})]}),(0,He.FD)("div",{className:(0,g.A)("message-input-wrapper",ya),style:Ca,children:[Uo&&(0,He.FD)(He.FK,{children:[Xa&&(0,He.Y)(lt,{isOpen:er,text:nn.text,isDisabled:Boolean(gs),onClick:Da}),Nr&&(0,He.Y)(ot.A,{className:(0,g.A)("bot-commands","composer-action-button"),round:!0,disabled:void 0===_t,color:"translucent",onActivate:xa,ariaLabel:"Open bot command keyboard",children:(0,He.Y)(et.A,{name:"bot-commands-filled"})}),Vo&&Qt&&(0,He.Y)(dt.A,{round:!0,color:"translucent",onClick:as?ds:Ja,ariaLabel:No("SendMessageAsTitle"),className:(0,g.A)("send-as-button","composer-action-button",li.current&&"appear-animation"),children:(0,He.Y)(jt.A,{peer:Qt,size:"tiny"})})]}),(!Oi||vi||fi)&&!ki&&!Kn&&(0,He.Y)(Pt.A,{chatId:P,threadId:ie,isMobile:C,isReady:m,isSymbolMenuOpen:os,openSymbolMenu:is,closeSymbolMenu:ss,canSendStickers:fi,canSendGifs:vi,isMessageComposer:Uo,onGifSelect:Ra,onStickerSelect:Oa,onCustomEmojiSelect:Ea,onRemoveSymbol:$a,onEmojiSelect:Ki,closeBotCommandMenu:ns,closeSendAsMenu:ds,isSymbolMenuForced:jo,canSendPlainText:!Oi,inputCssSelector:ln,idPrefix:e,forceDarkTheme:Ko}),(0,He.Y)(Mt.A,{ref:ko,id:hn,editableInputId:un,customEmojiPrefix:e,isStoryInput:Ko,chatId:P,canSendPlainText:!Oi,threadId:ie,isReady:m,isActive:!mi,getHtml:To,placeholder:sr,timedPlaceholderDate:nr,timedPlaceholderLangKey:tr,forcedPlaceholder:$s,canAutoFocus:m&&he&&!mi&&Uo,noFocusInterception:mi,shouldSuppressFocus:C&&os,shouldSuppressTextFormatter:Ms||Es||Us,onUpdate:Do,onSend:Mr,onSuppressedFocus:ss,onFocus:Ho,onBlur:Wo,isNeedPremium:ki,messageListType:re}),Uo&&(0,He.FD)(He.FK,{children:[Wt&&Boolean(Ks)&&(0,He.Y)(Kt.A,{color:"gray"}),(0,He.Y)(zt.Ay,{className:"composer-action-buttons-container",slideClassName:"composer-action-buttons",activeKey:Number(Za),direction:"inverse",name:"slideFadeAndroid",children:!Za&&(0,He.FD)(He.FK,{children:[Ne&&(0,He.Y)(zt.Ay,{className:"composer-action-button",name:"reveal",activeKey:Number(En),children:(0,He.Y)(dt.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:Qa,ariaLabel:Yo(En?"AriaComposerSilentPostingDisable":"AriaComposerSilentPostingEnable"),children:(0,He.Y)(et.A,{name:En?"mute":"unmute"})})}),rt&&(0,He.Y)(dt.A,{round:!0,faded:!0,className:"composer-action-button scheduled-button",color:"translucent",onClick:Ha,ariaLabel:Yo("AriaComposerOpenScheduled"),children:(0,He.Y)(et.A,{name:"scheduled"})}),aa&&(0,He.Y)(dt.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:Wa,children:(0,He.Y)(et.A,{name:"gift"})}),ra&&(0,He.Y)(dt.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:_a,children:(0,He.Y)(et.A,{name:"cash-circle"})}),Boolean(tt)&&!gs&&!k&&(0,He.Y)(ot.A,{className:(0,g.A)("composer-action-button",Qi&&"activated"),round:!0,color:"translucent",onActivate:Zi,ariaLabel:Yo("AriaComposerBotKeyboard"),children:(0,He.Y)(et.A,{name:"bot-command"})})]})})]}),gs&&Boolean(fs)&&(0,He.Y)("span",{className:"recording-state",children:(0,f.JW)(fs-As.current)}),!ki&&(0,He.Y)(st,{chatId:P,threadId:ie,editingMessage:k,canEditMedia:Xo,isButtonVisible:!gs,canAttachMedia:Ai,canAttachPolls:yi,canAttachToDoLists:wi,canSendPhotos:Ni,canSendVideos:Mi,canSendDocuments:Yi,canSendAudios:Si,onFileSelect:qi,onPollCreate:Qn,onTodoListCreate:Ta,isScheduled:c,attachBots:Uo?on:void 0,peerType:sn,shouldCollectDebugLogs:An,theme:rn,onMenuOpen:Qo,onMenuClose:Zo,messageListType:re,paidMessagesStars:kn}),Uo&&Boolean(tt)&&(0,He.Y)(ct,{messageId:tt,threadId:ie,isOpen:Qi,onClose:Xi}),Uo&&_t&&(0,He.Y)(at,{isOpen:es,botCommands:_t,onClose:ns}),(0,He.Y)(At.A,{chatId:P,isOpen:Fs,onCustomEmojiSelect:Ds,addRecentCustomEmoji:co,onClose:Ts},`custom-emoji-tooltip-${un}`),(0,He.Y)(kt,{chatId:P,threadId:ie,isOpen:xs,onStickerSelect:Oa,onClose:Ls},`sticker-tooltip-${un}`),(0,He.Y)(It.A,{isOpen:Ms,emojis:Ys,customEmojis:ks,addRecentEmoji:oo,addRecentCustomEmoji:co,onEmojiSelect:Ps,onCustomEmojiSelect:Ps,onClose:Ns},`emoji-tooltip-${un}`)]})]}),wn&&gs&&(0,He.FD)(dt.A,{className:(0,g.A)("view-once",ys&&"active"),round:!0,color:"secondary",ariaLabel:No("Chat.PlayOnceVoiceMessageTooltip"),onClick:ws,children:[(0,He.Y)(et.A,{name:"view-once"}),(0,He.Y)(et.A,{name:"one-filled"})]}),gs&&(0,He.Y)(dt.A,{round:!0,color:"danger",className:"cancel",onClick:ms,ariaLabel:"Cancel voice recording",children:(0,He.Y)(et.A,{name:"delete"})}),Ko&&!gs&&(0,He.FD)(dt.A,{round:!0,className:"story-reaction-button",color:"secondary",onClick:vr,onContextMenu:fa,onMouseDown:va,ariaLabel:No("AccDescrLike"),ref:Fo,children:[yn&&(0,He.Y)(Gt.A,{containerId:(0,d.$_)(P,se),reaction:yn,withEffectOnly:ai},(0,d.Jj)(yn)),(!yn||ai)&&(0,He.Y)(et.A,{name:"heart",className:(0,g.A)(ai&&"story-reaction-heart")})]}),(0,He.FD)(dt.A,{ref:vs,round:!0,color:"secondary",className:(0,g.A)(ca,"main-button",!m&&"not-ready",gs&&"recording"),disabled:dr,allowDisabledClick:!0,noFastClick:!0,ariaLabel:No(hr),onClick:cr,onContextMenu:ca===$t.Send&&la?ha:void 0,children:[(0,He.Y)(et.A,{name:"send"}),(0,He.Y)(et.A,{name:"microphone-alt"}),qn&&(0,He.Y)(et.A,{name:"forward"}),Uo&&(0,He.Y)(et.A,{name:"schedule"}),Uo&&(0,He.Y)(et.A,{name:"check"}),(0,He.Y)(dt.A,{className:(0,g.A)("paidStarsBadge",kr&&"visible",Pr&&!kr&&"hiding",!Pr&&!kr&&"hidden"),nonInteractive:!0,size:"tiny",color:"stars",pill:!0,fluid:!0,children:(0,He.FD)("div",{className:"paidStarsBadgeText",children:[(0,He.Y)(et.A,{name:"star",className:(0,g.A)("star-amount-icon",mn)}),(0,He.Y)(Vt.A,{ref:Po,text:Yo.number(Ti)})]})})]}),Yr&&(0,He.Y)("span",{className:"effect-icon",onClick:br,children:(0,L.A)(Yr)}),Pn&&Dn&&(0,He.Y)(Ot.A,{shouldPlay:xn,effect:Pn,onStop:Sr}),la&&(0,He.Y)(yt.A,{isOpen:ua,canSchedule:si&&Uo&&!ys,canScheduleUntilOnline:h&&!ys,onSendSilent:fe?void 0:yr,onSendSchedule:c?void 0:Ar,onSendWhenOnline:Cr,onRemoveEffect:br,onClose:ma,onCloseAnimationEnd:pa,isSavedMessages:fe,chatId:P,withEffects:Tn,hasCurrentEffect:Boolean(Pn),effectReactions:Fn,allAvailableReactions:pn,onToggleReaction:gr,isCurrentUserPremium:me,isInSavedMessages:fe,isInStoryViewer:Ko,canPlayAnimatedEmojis:vn}),ci,(0,He.Y)(Jt.A,{isOpen:Bn,onClose:Di,userName:ce?(0,l.F9)(Yo,ce):void 0,messagePriceInStars:kn||0,messagesCount:Fi,shouldAutoApprove:Li,setAutoApprove:Ei,confirmHandler:xi})]})}))},23459:(e,t,n)=>{n.d(t,{A:()=>m});var o=n(84051),i=n(13439),s=n(90709),a=n(91048),r=n(48899),d=n(37836);const c=36e5,l=new Map;let u=new Set;const h=(0,d.nF)(()=>{const e=Array.from(u),t=e.slice(0,100),n=e.slice(100);(0,i.ko)().loadStoriesMaxIds({peerIds:t}),t.forEach(e=>l.set(e,Date.now())),u=new Set(n),u.size&&h()},500);function m(e){const t=(0,o.Kr)(()=>{const t=(0,i.mS)();return e?.map(e=>(0,a.PVB)(t,e)).filter(Boolean)},[e]),n=(0,o.Kr)(()=>{const e=(0,i.mS)();return t?.filter(t=>{const n=l.get(t.id)||0;if(Date.now()-n<c)return!1;if((0,r.L8)(t.id)){const n=t,o=(0,a.K0y)(e,n.id),i=o&&"userStatusEmpty"!==o.type;return!n.isContact&&!n.isSelf&&!(0,s.tv)(n)&&!t.isSupport&&i}{const n=t,o=(0,a._ls)(e,n.id);return(0,s.WX)(n)&&!o}}).map(e=>e.id)},[t]);(0,o.vJ)(()=>{n?.length&&(n.forEach(e=>u.add(e)),h())},[n])}},23565:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(30857),s=n(73767),a=n(35297);function r(e,t){const n=(0,s.A)(e,!0),r=(0,o.li)(),d=(0,i.A)(),c=null!=e,l=null!=n;return c&&r.current&&(clearTimeout(r.current),r.current=void 0),(0,a.A)(()=>{t&&!c&&l&&!r.current&&(r.current=window.setTimeout(()=>{r.current=void 0,d()},t))},[t,d,c,l]),r.current&&t&&!c?n:e}},24384:(e,t,n)=>{n.d(t,{A:()=>y});var o=n(84051),i=n(13439),s=n(87357),a=n(80140),r=n(22237),d=n(14242),c=n(59852),l=n(19129),u=n(39351),h=n(17712),m=n(68292),p=n(18276),g=n(64493),f=n(26607);const v="PNHSXmwb";var A=n(20021);const y=(0,o.ph)(({topic:e,topics:t,chat:n,isPinned:y,isMuted:C,shouldShowOnlyMostImportant:w,wasTopicOpened:I,forceHidden:b,isSavedDialog:S,hasMiniApp:M,isSelected:N,isOnAvatar:Y,transitionClassName:k,badgeClassName:P})=>{const{requestMainWebView:F}=(0,i.ko)(),T=(0,u.A)(),{unreadMentionsCount:D=0,unreadReactionsCount:x=0}=n.isForum?{}:n,L=!y&&e&&!I,E=n.isForum&&!e,B=(0,o.Kr)(()=>E&&t?Object.values(t).filter(({unreadCount:e})=>e):void 0,[t,E]),R=(0,o.Kr)(()=>E?B?.length:(e||n).unreadCount,[n,e,B,E]),O=(0,o.Kr)(()=>{if(!E)return!C||0===e?.notifySettings.mutedUntil;if(C)return B?.some(e=>0===e.notifySettings.mutedUntil);const t=B?.every(e=>e.notifySettings.mutedUntil&&e.notifySettings.mutedUntil>(0,a.Fm)());return!t},[E,C,B,e?.notifySettings.mutedUntil]),U=!e&&n.hasUnreadMark,K=Boolean((R||U)&&!S),z=!(0,l.A)(()=>(0,r.Hp)(b)?b():b,[b])&&Boolean(R||D||U||y||x||L||M),V=(0,h.A)(e=>{e.stopPropagation();const t=(0,c.A)();F({botId:n.id,peerId:n.id,theme:t})});return(0,A.Y)(f.A,{isCustom:!0,className:(0,s.A)("zGiYriqE",N&&"x5LnLky3",Y&&"ZJcE67F7",k),isOpen:z,children:function(){const e=(0,s.A)("vbb34kEa",!O&&"H0NRx4u_",P),t=x&&(0,A.Y)("div",{className:(0,s.A)(e,"R31SqbQj",v),children:(0,A.Y)(p.A,{name:"heart"})}),n=D&&(0,A.Y)("div",{className:(0,s.A)(e,"IOO6C469",v),children:(0,A.Y)(p.A,{name:"mention"})}),o=L&&(0,A.Y)("div",{className:(0,s.A)(e,"qbAbFaK3")}),i=K?(0,A.Y)("div",{className:(0,s.A)(e,"RqISI7Dg"),children:!U&&(0,A.Y)(m.A,{text:(0,d.Vw)(T,R)})}):void 0,a=y&&(0,A.Y)("div",{className:(0,s.A)(e,"lVbUgp6W"),children:(0,A.Y)(p.A,{name:"pinned-chat"})}),r=M&&(0,A.Y)(g.A,{color:N?"secondary":"primary",className:(0,s.A)(e,"x2AM544v"),pill:!0,size:"tiny",onClick:V,children:T("BotChatMiniAppOpen")}),c=!i&&!n&&!t&&a,l=[o,t,n,i,c].filter(Boolean);return S?a:M&&(0===l.length||c)?r:0!==l.length?1===l.length?l[0]:w?[n,i,t,a].filter(Boolean)[0]:(0,A.Y)("div",{className:"R5lXhuMd",children:l}):void 0}()})})},24899:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(31481);function i(e,t){return t?`${o.jsp}${e}`:`@${e}`}},24920:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051),i=n(30857),s=n(73767);function a(e){const t=(0,i.A)(),n=(0,o.li)(e),a=(0,s.A)(e);return!1===e&&a!==e&&(n.current=!1),{shouldDisableDropdownMenuTransitionRef:n,handleDropdownMenuTransitionEnd:function(){n.current=Boolean(e),t()}}}},25477:(e,t,n)=>{n.d(t,{A:()=>k});var o=n(84051),i=n(13439),s=n(90709),a=n(87357),r=n(17663),d=n(58554),c=n(76023),l=n(35127),u=n(84313),h=n(43874),m=n(37661),p=n(5912),g=n(17712),f=n(62587),v=n(37960),A=n(69419),y=n(73767),C=n(34201),w=n(61097),I=n(18276),b=n(27860),S=n(14413),M=n(65843),N=n(35913),Y=n(20021);const k=(0,o.ph)((0,i.EK)(e=>({needsAgeVerification:e.appConfig.needAgeVideoVerification}))(({id:e,video:t,isOwn:n,isInWebPage:k,noAvatars:P,canAutoLoad:F,canAutoPlay:T,uploadProgress:D,forcedWidth:x,dimensions:L,asForwarded:E,isDownloading:B,isProtected:R,className:O,lastPlaybackTimestamp:U,clickArg:K,isMediaNsfw:z,observeIntersectionForLoading:V,observeIntersectionForPlaying:j,onClick:J,onCancelUpload:G,needsAgeVerification:$})=>{const{cancelMediaDownload:q,updateContentSettings:H,openAgeVerificationModal:W}=(0,i.ko)(),_=(0,o.li)(),Q=(0,o.li)(),[Z,X,ee]=(0,m.A)(),[te,ne]=(0,o.J0)(!1),oe="extendedMediaPreview"===t.mediaType,ie=oe?void 0:t.blobUrl,se=oe||t.isSpoiler||z,[ae,re,de]=(0,m.A)(se);(0,o.vJ)(()=>{se?re():de()},[se]);const ce=(0,g.A)(()=>{ee(),de(),te&&H({isSensitiveEnabled:!0})}),le=(0,p.Vz)(_,V),ue=(0,p.Vz)(_,j)&&le,he=(0,o.li)(le);ue&&!he.current&&(he.current=!0);const{isMobile:me}=(0,h.Ay)(),[pe,ge]=(0,o.J0)(F),fe=Boolean(pe&&le&&!oe),[ve,Ae]=(0,o.J0)(Boolean(T&&!ae)),ye=oe?void 0:(0,s.sC)(t,"inline"),[Ce]=(0,o.J0)(Boolean(ye&&d.Ih(ye))),{mediaData:we,loadProgress:Ie}=(0,A.A)(ye,!fe,oe?void 0:(0,s.Cz)(t,"inline")),be=ie||we,[Se,Me]=(0,m.A)(),Ne=(0,s.VD)(t),Ye=Boolean(Ne),ke=Boolean(x),Pe=be&&he.current,Fe=(0,u.A)(Q,!0,!Pe),Te=oe?void 0:(0,s.sC)(t,"preview"),[De]=(0,o.J0)(Boolean(Te&&d.Ih(Te))),xe=le,Le=(0,f.A)(Te,!xe),Ee=Se&&!Fe,{ref:Be}=(0,v.A)({hasMediaData:Boolean((Ye||Le)&&!Ee)}),Re=Boolean(!Ye||Le||Se),Oe=(0,w.A)(t,Re);(0,v.A)({ref:Oe,hasMediaData:!Re});const Ue=(0,w.A)(t,!ke),{loadProgress:Ke}=(0,A.A)(oe?void 0:(0,s.sC)(t,"download"),!B,oe?void 0:(0,s.Cz)(t,"download")),{isUploading:ze,isTransferring:Ve,transferProgress:je}=(0,s.LK)(D||(B?Ke:Ie),fe&&!Se&&!Ce||B,void 0!==D),Je=!1===(0,y.A)(pe),{ref:Ge,shouldRender:$e}=(0,C.A)({isOpen:Ve&&!Fe,noMountTransition:Je,withShouldRender:!0}),{ref:qe}=(0,C.A)({isOpen:Boolean((pe||be)&&!ve&&!$e)}),{ref:He,shouldRender:We}=(0,C.A)({isOpen:Ve&&(!Fe||B),noMountTransition:Je,withShouldRender:!0}),[_e,Qe]=(0,o.J0)(0),Ze=(0,g.A)(e=>{Qe(Math.max(0,e.currentTarget.currentTime-1))}),Xe=(Number.isFinite(Q.current?.duration)&&!Fe?Q.current?.duration:t.duration)||0,{width:et,height:tt}=L||(oe?(0,c.ri)(t,Boolean(n),E,k,P,me):(0,c.rO)(t,Boolean(n),E,k,P,me)),nt=(0,g.A)((e,n)=>{if(ze)G?.(K);else if(oe||!B){if(be)return be&&!ve&&Ae(!0),ae?z?$?void W():void X():void de():n&&fe&&!Se&&!Ce?(ge(!1),void e.stopPropagation()):void J?.(K,e);ge(e=>!e)}else q({media:t})}),ot=(0,g.A)(e=>{nt(e,!0)}),it=(0,a.A)("media-inner dark",!ze&&"interactive",tt<l.ej&&"fix-min-height",O),st=`height: ${tt}px;${L?` width: ${et}px; left: ${L.x}px; top: ${L.y}px;`:""}`;return(0,Y.FD)("div",{ref:_,id:e,className:it,style:st,onClick:ze?void 0:e=>nt(e),children:[ke&&(0,Y.Y)("canvas",{ref:Ue,className:"thumbnail blurred-bg"}),Pe&&(0,Y.Y)(M.A,{ref:Q,src:be,className:(0,a.A)("full-media",ke&&"with-blurred-bg"),canPlay:ve&&ue&&!Fe,defaultMuted:!0,muted:!0,loop:!0,playsInline:!0,disablePictureInPicture:!0,draggable:!R,onTimeUpdate:Ze,onReady:Me,style:x?`width: ${x}px`:void 0}),(0,Y.Y)("img",{ref:Be,src:Le,className:(0,a.A)("thumbnail",ke&&"with-blurred-bg"),alt:"",style:x?`width: ${x}px;`:void 0,draggable:!R}),Ye&&!De&&(0,Y.Y)("canvas",{ref:Oe,className:"thumbnail"}),R&&(0,Y.Y)("span",{className:"protector"}),(0,Y.Y)(I.A,{ref:qe,name:"large-play"}),(0,Y.Y)(b.A,{isVisible:ae,withAnimation:!0,thumbDataUri:Ne,isNsfw:z,width:et,height:tt,className:"media-spoiler"}),$e&&(0,Y.Y)("div",{ref:Ge,className:"media-loading",children:(0,Y.Y)(N.A,{progress:je,onClick:ot})}),!pe&&!be&&(0,Y.Y)(I.A,{name:"download"}),We?(0,Y.Y)("span",{ref:He,className:"message-transfer-progress",children:ze||B?`${Math.round(100*je)}%`:"..."}):(0,Y.FD)("div",{className:"message-media-duration",children:[!oe&&t.isGif?"GIF":(0,r.QO)(Math.max(Xe-_e,0)),Fe&&(0,Y.Y)(I.A,{name:"message-failed",className:"playback-failed"})]}),Boolean(U)&&(0,Y.Y)("div",{className:"message-media-last-progress",style:`--_progress: ${Math.floor(U/Xe*100)}%`}),(0,Y.Y)(S.A,{isOpen:Z,onClose:ee,shouldAlwaysShow:te,onAlwaysShowChanged:ne,confirmHandler:ce})]})}))},25498:(e,t,n)=>{n.d(t,{A:()=>T});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(91048),d=n(52491),c=n(36353),l=n(87894),u=n(79824),h=n(37830),m=n(4961),p=n(58734),g=n(17778),f=n(63988),v=n(83414),A=n(37661),y=n(17712);let C,w,I,b,S;const M=36,N=2,Y=300,k=(0,h.A)(function(e,t,n){return e&&t.length?Object.values((0,l._E)(e,t)).slice(0,n):u.p}),P=(0,h.A)(function(e,t,n){const o=Object.values(e),i=(0,l.dU)(o,"native"),s=t?(0,l.LG)(t,e=>Object.values((0,l._E)(i,e))):{},a=n?(0,l.LG)(n,e=>Object.values((0,l._E)(i,e))):{},r={...s,...a},d=[].concat(Object.keys(s),Object.keys(a)),c=o.reduce((e,t)=>(t.names.forEach(n=>{e[n]||(e[n]=[]),e[n].push(t)}),e),{}),u=Object.keys(c),h=d.reduce((e,t)=>Math.max(e,t.length),0);return{byKeyword:r,keywords:d,byName:c,names:u,maxKeyLength:h}}),F=(0,h.A)(function(e,t,n){const{byKeyword:o,keywords:i,byName:s,names:a,maxKeyLength:r}=e;let d=[];if(t.length>r)return u.p;const c=i.filter(e=>e.startsWith(t)).sort();d=d.concat(Object.values((0,l._E)(o,c)).flat());const h=a.filter(e=>e.startsWith(t));return d=d.concat(Object.values((0,l._E)(s,h)).flat()),d=(0,l.Am)(d),d.length?d.slice(0,n):u.p});try{b=/(^|\s):(?!\s)[-+_:'\s\p{L}\p{N}]*$/giu,S=/\p{Ll}/u}catch(e){b=/(^|\s):(?!\s)[-+_:'\s\d\wа-яёґєії]*$/gi,S=/[a-zяёґєії]/}function T(e,t,h,T=s.CfG,D,x,L){const[E,B,R]=(0,A.A)(!1),[O,U]=(0,o.J0)(),[K,z]=(0,o.J0)(u.p),[V,j]=(0,o.J0)(u.p);(0,o.vJ)(()=>{function t(){U(I.emojis)}e&&(I?t():async function(){return C||(C=n.e(996).then(n.t.bind(n,20996,19)),w=(await C).default,I=(0,d.cp)(w)),C}().then(t))},[e]);const J=(0,f.gs)(()=>{const n=t();return e&&n.includes(":")?(0,g.S)(n).match(b)?.[0].trim():void 0},[t,e],Y),G=(0,v.A)(J,[J,t],!0),$=(0,y.A)(e=>{if(z(e),e===u.p)return void j(u.p);const t=e.map(e=>e.native),n=(0,l.Xd)((0,r.oZ0)((0,i.mS)(),t),"id");j(n)}),q=(0,y.A)((e,n=!1)=>{const o=t();if(!o)return;const i=o.lastIndexOf(":",n?o.lastIndexOf(":")-1:void 0);if(-1!==i){const t="string"==typeof e?(0,m.A)(e,["emoji_html"])[0]:(0,p.hB)(e);h(`${o.substring(0,i)}${t}`);const n=T===s.CfG?document.querySelector(s.m$5):document.getElementById(T);(0,a.Uz)(()=>{(0,c.A)(n,!0,!0)})}$(u.p)});return(0,o.vJ)(()=>{const e=G();if(!e||!O)return void $(u.p);const t=e.length>2&&e.endsWith(":"),n=e.substring(1,t?1+e.length-2:void 0);let o=u.p;if(n){if(1===n.length&&S.test(n)||n.length>=N){const e=P(O,x,L);o=F(e,n.toLowerCase(),M)}}else o=k(O,D,M);o.length?t?q(o[0].native,!0):$(o):$(u.p)},[x,O,G,L,q,D,$]),(0,o.vJ)(R,[R,t]),{isEmojiTooltipOpen:Boolean(K.length||V.length)&&!E,closeEmojiTooltip:B,filteredEmojis:K,filteredCustomEmojis:V,insertEmoji:q}}},25897:(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,"CustomEmojiTooltip",!t);return n?(0,s.Y)(n,{...e}):void 0}},26440:(e,t,n)=>{n.d(t,{A:()=>v});var o=n(84051),i=n(13439),s=n(31481),a=n(87357),r=n(37661),d=n(17712),c=n(18276),l=n(64493),u=n(66469),h=n(57474),m=n(80089),p=n(80464),g=n(20021);const f=e=>{const{isOpen:t}=e,n=(0,p.A)(m.ar.Extra,"SymbolMenu",!t);return n?(0,g.Y)(n,{...e}):void 0},v=(0,o.ph)(({chatId:e,threadId:t,isMobile:n,canSendGifs:m,canSendStickers:p,isMessageComposer:v,isReady:A,isSymbolMenuOpen:y,idPrefix:C,isAttachmentModal:w,canSendPlainText:I,isSymbolMenuForced:b,className:S,forceDarkTheme:M,inputCssSelector:N=s.m$5,openSymbolMenu:Y,closeSymbolMenu:k,onCustomEmojiSelect:P,onStickerSelect:F,onGifSelect:T,onRemoveSymbol:D,onEmojiSelect:x,closeBotCommandMenu:L,closeSendAsMenu:E})=>{const{setStickerSearchQuery:B,setGifSearchQuery:R,addRecentEmoji:O,addRecentCustomEmoji:U}=(0,i.ko)(),K=(0,o.li)(),[z,V]=(0,r.A)(),[j,J]=(0,o.J0)(void 0),G=(0,a.A)("composer-action-button mobile-symbol-menu-button",!A&&"not-ready",z?y&&"menu-opened":y&&"is-loading"),$=(0,d.A)(()=>{L?.(),E?.(),Y();const e=K.current;if(!e)return;const{x:t,y:n}=e.getBoundingClientRect();J({x:t,y:n})}),q=(0,d.A)(e=>{"stickers"===e?(B({query:""}),R({query:void 0})):(R({query:""}),B({query:void 0}))}),H=(0,d.A)(()=>{const e=document.querySelector(w?s.wVm:N);n&&e===document.activeElement?(e?.blur(),setTimeout(()=>{L?.(),Y()},100)):Y()}),W=(0,d.A)(()=>K.current),_=(0,d.A)(()=>K.current?.closest(".custom-scroll, .no-scrollbar")),Q=(0,d.A)(()=>document.querySelector("#portals .SymbolMenu .bubble")),Z=(0,d.A)(()=>({withPortal:!0}));return(0,g.FD)(g.FK,{children:[n?(0,g.FD)(l.A,{className:G,round:!0,color:"translucent",onClick:y?k:H,ariaLabel:"Choose emoji, sticker or GIF",children:[(0,g.Y)(c.A,{name:"smile"}),(0,g.Y)(c.A,{name:"keyboard"}),y&&!z&&(0,g.Y)(h.A,{color:"gray"})]}):(0,g.FD)(u.A,{className:(0,a.A)("composer-action-button symbol-menu-button",y&&"activated"),round:!0,color:"translucent",onActivate:$,ariaLabel:"Choose emoji, sticker or GIF",children:[(0,g.Y)("div",{ref:K,className:"symbol-menu-trigger"}),(0,g.Y)(c.A,{name:"smile"})]}),(0,g.Y)(f,{chatId:e,threadId:t,isOpen:y||Boolean(b),canSendGifs:m,canSendStickers:p,isMessageComposer:v,idPrefix:C,onLoad:V,onClose:k,onEmojiSelect:x,onStickerSelect:F,onCustomEmojiSelect:P,onGifSelect:T,onRemoveSymbol:D,onSearchOpen:q,addRecentEmoji:O,addRecentCustomEmoji:U,isAttachmentModal:w,canSendPlainText:I,className:(0,a.A)(S,M&&"component-theme-dark"),anchor:w?j:void 0,getTriggerElement:w?W:void 0,getRootElement:w?_:void 0,getMenuElement:w?Q:void 0,getLayout:w?Z:void 0})]})})},31880:(e,t,n)=>{n.d(t,{A:()=>m,a:()=>c});var o=n(13439),i=n(91048),s=n(87894),a=n(42215);const r=["includedChatIds","bots","channels","groups","contacts","nonContacts"],d=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function c(e,t,n){let a=[],c=[];if("included"===t){const{includedChatIds:t,...o}=n?e.includeFilters||{}:(0,s.Up)(e.folder,r);a=t||[],c=Object.keys(o).filter(e=>Boolean(o[e]))}else{const{excludedChatIds:t,...o}=n?e.excludeFilters||{}:(0,s.Up)(e.folder,d);a=t||[],c=Object.keys(o).filter(e=>Boolean(o[e]))}const l=(0,o.mS)();return{selectedChatIds:a.filter(e=>(0,i.hds)(l,e)),selectedChatTypes:c}}function l(e){if(e){const{includedChatIds:t,...n}=e;if(Object.values(n).filter(Boolean).length>1||t?.length)return"";if(n.bots)return"Bots";if(n.groups)return"Groups";if(n.channels)return"Channels";if(n.contacts)return"Contacts";if(n.nonContacts)return"Non-Contacts"}return""}const u={mode:"create",chatFilter:"",folder:{title:{text:""},includedChatIds:[],excludedChatIds:[]}},h=(e,t)=>{switch(t.type){case"setTitle":return{...e,folder:{...e.folder,title:{text:t.payload}},isTouched:!0};case"setFolderId":return{...e,folderId:t.payload,mode:"edit"};case"editIncludeFilters":return{...e,includeFilters:(0,s.Up)(e.folder,r)};case"editExcludeFilters":return{...e,excludeFilters:(0,s.Up)(e.folder,d)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...(0,s.cJ)(e.folder,r),title:e.folder.title?e.folder.title:{text:l(e.includeFilters)},...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...(0,s.cJ)(e.folder,d),...e.excludeFilters},excludeFilters:void 0,chatFilter:"",isTouched:!0}:e;case"editFolder":{const{id:e,...n}=t.payload;return{mode:"edit",folderId:e,folder:n,chatFilter:""}}case"setChatFilter":return{...e,chatFilter:t.payload};case"setIsTouched":return{...e,isTouched:t.payload};case"setIsLoading":return{...e,isLoading:t.payload};case"setError":return{...e,isLoading:!1,error:t.payload};case"setIsChatlist":return{...e,folder:{...e.folder,isChatList:t.payload}};case"setColor":return{...e,folder:{...e.folder,color:t.payload},isTouched:!0};case"reset":return u;default:return e}},m=()=>(0,a.A)(h,u)},34458:(e,t,n)=>{n.d(t,{$:()=>v,UG:()=>l,wV:()=>f});var o=n(31481),i=n(66644),s=n(19822),a=n(83868),r=n(76023),d=n(2429),c=n(17169);const l=250,u=.25*r.$,h=11,m=.1875*r.$,p=.125*r.$,g=new Set;function f(e){b();const{container:t,toggler:n,leftMainHeader:a,ribbonPeers:r,toggleAvatars:d}=A(e);if(!(n&&d&&r&&t&&a))return;const{bottom:p,right:f}=a.getBoundingClientRect(),v=p+u,S=d[0],M=d[d.length-1],N=C(S);Array.from(r).reverse().forEach((e,a,{length:r})=>{const d=C(e);if(!d)return;const u=d===N;let p=w(n,d),A=h+a+1;if(p||(p=a===r-1?M:S,A=h),!p)return;let{top:b,left:Y,width:k}=p.getBoundingClientRect();const{left:P,width:F}=e.getBoundingClientRect();if(P>f)return;Y-=m,k+=2*m;const T=Y-P,D=b-v,x=k/F;b-=m;const L=P-Y+2*m,E=v-b+m,B=F/(k+2*m);(0,i.RK)(()=>{if(!p)return;const n=y(e);let a;A>h?(a=y(p),u&&a.classList.add(c.A.ghostLast)):n.classList.add(c.A.ghostAnimateName),(0,s.ZM)(n,{top:`${v}px`,left:`${P}px`,zIndex:String(A),opacity:a?"0":"",transform:`translate3d(${T}px, ${D}px, 0) scale(${x})`}),a&&(0,s.ZM)(a,{top:`${b}px`,left:`${Y}px`,zIndex:String(A)}),t.appendChild(n),a&&t.appendChild(a),p.classList.add("animating"),e.classList.add("animating"),(0,i.RK)(()=>{(0,s.ZM)(n,{opacity:"",transform:""}),a?(0,s.ZM)(a,{opacity:"0",transform:`translate3d(${L}px, ${E}px, 0) scale(${B})`}):n.classList.add(c.A.ghostRevealName);const r=I(()=>{(0,i.RK)(()=>{t.contains(n)&&t.removeChild(n),a&&t.contains(a)&&t.removeChild(a),p?.classList.remove("animating"),e.classList.remove("animating"),g.delete(r)})},l+o.xB5);g.add(r)})})})}function v(e){b();const{container:t,toggler:n,toggleAvatars:a,ribbonPeers:r,leftMainHeader:d}=A(e);if(!(n&&a&&r&&t&&d))return;const{right:u}=d.getBoundingClientRect(),f=a[0],v=a[a.length-1],S=C(f);Array.from(r).reverse().forEach((e,a,{length:r})=>{const d=C(e);if(!d)return;const A=d===S;let b=w(n,d),M=h+a+1;if(b||(b=a===r-1?v:f,M=h),!b)return;const{top:N,left:Y,width:k}=e.getBoundingClientRect();let{left:P,width:F,top:T}=b.getBoundingClientRect();if(Y>u)return;P-=m,F+=2*m;const D=P-Y,x=T-N-p,L=F/k;T-=m;const E=Y-P+2*m,B=N-T+m,R=k/(F+2*m);(0,i.RK)(()=>{const n=y(e);let a;M>h?(a=y(b),A&&a.classList.add(c.A.ghostLast)):n.classList.add(c.A.ghostAnimateName,c.A.ghostRevealName),(0,s.ZM)(n,{top:`${N}px`,left:`${Y}px`,width:`${k}px`,zIndex:String(M)}),a&&(0,s.ZM)(a,{top:`${T}px`,left:`${P}px`,zIndex:String(M),opacity:"0",transform:`translate3d(${E}px, ${B}px, 0) scale(${R})`}),e.classList.add("animating"),b.classList.add("animating"),t.appendChild(n),a&&t.appendChild(a),(0,i.RK)(()=>{(0,s.ZM)(n,{opacity:a?"0":"",transform:`translate3d(${D}px, ${x}px, 0) scale(${L})`}),a?(0,s.ZM)(a,{opacity:"",transform:""}):n.classList.remove(c.A.ghostRevealName);const r=I(()=>{(0,i.RK)(()=>{t.contains(n)&&t.removeChild(n),a&&t.contains(a)&&t.removeChild(a),e.classList.remove("animating"),b.classList.remove("animating")}),g.delete(r)},l+o.xB5);g.add(r)})})})}function A(e){let t=document.getElementById("LeftColumn");if(t&&e&&(t=t.querySelector(".ArchivedChats")),!t)return{};const n=t.querySelector("#StoryToggler"),o=t.querySelector("#StoryRibbon"),i=t.querySelector(".left-header"),s=o?.querySelectorAll(`.${d.A.peer}`),a=n?.querySelectorAll(".Avatar");return{container:t,toggler:n,leftMainHeader:i,ribbonPeers:s,toggleAvatars:a}}function y(e){const t=e.cloneNode(!0);t.classList.add(c.A.ghost),t.classList.remove("animating"),t.draggable=!1,t.oncontextmenu=a.A;const n=e.querySelector("canvas");if(n){const e=t.querySelector("canvas");e?.getContext("2d")?.drawImage(n,0,0)}return t}function C(e){return e?.getAttribute("data-peer-id")}function w(e,t){return e?.querySelector(`[data-peer-id="${t}"]`)}function I(e,t){const n=setTimeout(e,t);return()=>{clearTimeout(n),e()}}function b(){g.forEach(e=>e()),g.clear()}},35127:(e,t,n)=>{n.d(t,{Ay:()=>d,ej:()=>r,nP:()=>c,yA:()=>l});var o=n(76023);const i=12,s=40,a=i*o.$,r=5*o.$;function d(e){return(e?14:20)*o.$}function c(e="",t,n){return e.length>s||n?d(t):a}function l({media:e,messageText:t,isOwn:n,isInWebPage:s,asForwarded:a,noAvatars:d,isMobile:l}){const u="photo"===e.mediaType,h="video"===e.mediaType,m=u&&s,p=h&&s,{width:g,height:f}=u?(0,o.ck)(e,n,a,m,d,l):h?(0,o.rO)(e,n,a,p,d,l):(0,o.ri)(e,n,a,s,d,l),v=c(t,l);let A=1;g<v&&v-g<i&&(A=v/g),f*A<r&&r-f*A<i&&(A=r/f);const y=Math.round(g*A),C=Math.round(f*A);return{width:y,height:C,isSmall:y<v||C<r}}},35749:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(77312),i=n(63527);function s(e){return e.messages.webPageById}function a(e,t){const n=(0,i.A)(s);if(!e)return;const a=e.content.webPage?.id,r=a?n[a]:void 0;return(0,o.EO)(e,{webPage:r},t)}},36353:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(96454);function i(e,t,n){if(!t&&e===document.activeElement)return;const i=window.getSelection(),s=document.createRange(),a=e.lastChild||e;o.TF||n||a&&a.nodeValue?(s.selectNodeContents(n?e:a),s.collapse(!1),i.removeAllRanges(),i.addRange(s)):e.focus()}},36680:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(84051),i=n(96454),s=n(17712);const a=250;let r;function d(e,t,n=a,d=!1){const c=(0,o.li)(!1),l=(0,s.A)(()=>{c.current=!0});return(0,o.vJ)(()=>{r&&(clearTimeout(r),r=void 0),!e||i.TF||d||(r=window.setTimeout(()=>{c.current||t()},2*n))},[d,e,n,t]),[(0,s.A)(()=>{c.current=!0}),(0,s.A)(()=>{c.current=!1,r&&(clearTimeout(r),r=void 0),r=window.setTimeout(()=>{c.current||t()},n)}),l]}},37378:(e,t,n)=>{n.d(t,{A:()=>y});var o=n(84051),i=n(13439),s=n(90709),a=n(91048),r=n(87357),d=n(17663),c=n(58849),l=n(49086),u=n(4961),h=n(39351),m=n(17712),p=n(59030),g=n(96530),f=n(81524),v=n(84685),A=n(20021);const y=(0,o.ph)((0,i.EK)((e,{message:t})=>({webPage:(0,a.Pn$)(e,t)}))(({message:e,webPage:t,senderTitle:n,isProtected:o,observeIntersection:i,onMessageClick:a})=>{const y=(0,h.A)(),C=(0,p.A)();let w=t;if(!w){const t=(0,s.ZD)(e);if(t){const{url:n,domain:o}=t;w={siteName:o.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,formattedDescription:(0,s.BN)(y,e)?.text!==n?(0,l.C)(y,e,void 0,void 0,170):void 0}}}const I=(0,m.A)(()=>{a(e)});if("full"!==w?.webpageType)return;const{siteName:b,url:S,displayUrl:M,title:N,description:Y,formattedDescription:k,photo:P,video:F}=w,T=!n&&Y&&(0,c.A)(Y,170),D=(0,r.A)("WebLink scroll-item",!P&&!F&&"without-media"),x=S.replace("mailto:","")||M;return(0,A.FD)("div",{className:D,"data-initial":(b||M)[0],dir:y.isRtl?"rtl":void 0,children:[P&&(0,A.Y)(f.A,{message:e,isProtected:o,observeIntersection:i}),(0,A.FD)("div",{className:"content",children:[(0,A.Y)(g.A,{isRtl:y.isRtl,className:"site-title",onClick:I,children:(0,u.A)(N||b||M)}),(T||k)&&(0,A.Y)(g.A,{isRtl:y.isRtl,className:"site-description",onClick:I,children:k||T&&(0,u.A)(T)}),(0,A.Y)(v.A,{url:S,className:"site-name",text:x,isRtl:y.isRtl}),n&&(0,A.Y)("div",{className:"sender-name",children:(0,u.A)(n)})]}),n&&(0,A.Y)("div",{className:"message-date",children:(0,A.Y)(g.A,{className:"date",onClick:I,isRtl:y.isRtl,children:(0,d.be)(C,1e3*e.date)})})]})}))},37830:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(87894);const i=new WeakMap;function s(e){return(...t)=>{const n=i.get(e);if(n&&(0,o.k)(n.lastArgs,t))return n.lastResult;const s=e(...t);return i.set(e,{lastArgs:t,lastResult:s}),s}}},38102:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(87412),s=n(76471),a=n(20021);const r=(0,o.ph)(({topic:e,className:t,letterClassName:n,size:o,noLoopLimit:r,observeIntersection:d,onClick:c})=>e.iconEmojiId&&"0"!==e.iconEmojiId?(0,a.Y)(i.A,{documentId:e.iconEmojiId,className:t,size:o,observeIntersectionForPlaying:d,loopLimit:r?void 0:2,onClick:c}):(0,a.Y)(s.A,{iconColor:e.iconColor,title:e.title,topicId:e.id,className:t,letterClassName:n,onClick:c}))},38218:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(84051),i=n(17712);const s=function({onClick:e,onStart:t,onEnd:n,threshold:s=250}){const a=(0,o.li)(!1),r=(0,o.li)(!1),d=(0,o.li)(void 0),c=(0,i.A)(e=>{const n="button"in e&&0===e.button||"touches"in e&&e.touches.length>0;!r.current&&n&&(r.current=!0,d.current=window.setTimeout(()=>{t?.(),a.current=!0},s))}),l=(0,i.A)(t=>{r.current&&(a.current?n?.():e?.(t),u())}),u=(0,i.A)(()=>{a.current=!1,r.current=!1,window.clearTimeout(d.current)});return(0,o._W)(()=>{window.clearTimeout(d.current)}),{onMouseDown:c,onMouseUp:l,onMouseLeave:l,onTouchStart:c,onTouchEnd:l}}},38353:(e,t,n)=>{n.d(t,{A:()=>o});const o={background:"LzylDSXD",customBgImage:"iBGWkDsW",customBgColor:"HnpqkkHj",withTransition:"V96TOnoY",blurred:"K_W7XNrk",withRightColumn:"EiMC9Ymb"}},39074:(e,t,n)=>{n.d(t,{DY:()=>d,JC:()=>a,LV:()=>s,oR:()=>i,vZ:()=>r});const o=document.createElement("div");function i(e){const t=window.getSelection();if(t?.getRangeAt&&t.rangeCount){const n=t.getRangeAt(0);n.deleteContents();const o=n.createContextualFragment(e),i=o.lastChild;n.insertNode(o),i?(n.setStartAfter(i),n.setEndAfter(i)):n.collapse(!1),t.removeAllRanges(),t.addRange(n)}}function s(e,t){if(!e)return"";const n=window.getSelection();if(!n||!n.rangeCount)return e.innerHTML;const i=n.getRangeAt(0).cloneRange();return i.intersectsNode(e)?t||e.contains(i.commonAncestorContainer)?(i.collapse(!0),i.setStart(e,0),o.innerHTML="",o.appendChild(i.cloneContents()),o.innerHTML):"":e.innerHTML}function a(e){let t=0;const n=window.getSelection();if(!n||0===n.rangeCount)return t;const o=n.getRangeAt(0),i=o.cloneRange();return i.selectNodeContents(e),i.setEnd(o.endContainer,o.endOffset),t=i.toString().length,t}function r(e,t){for(const n of e.childNodes)if(n.nodeType===Node.TEXT_NODE){if(n.length>=t){const e=document.createRange(),o=window.getSelection();return e.setStart(n,t),e.collapse(!0),o.removeAllRanges(),o.addRange(e),-1}t-="length"in n?n.length:0}else if(-1===(t=r(n,t)))return-1;return t}function d(){const e=window.getSelection();e?.removeAllRanges()}},40175:(e,t,n)=>{n.d(t,{A:()=>p});var o=n(84051),i=n(13439),s=n(31481),a=n(91048),r=n(34458),d=n(39351),c=n(34201),l=n(92111),u=n(21849),h=n(17169),m=n(20021);const p=(0,o.ph)((0,i.EK)((e,{isArchived:t})=>{const{orderedPeerIds:{archived:n,active:o},byPeerId:i}=e.stories,{storyViewer:{isRibbonShown:s,isArchivedRibbonShown:r}}=(0,a.nTw)(e),d=(0,a.clw)(e),c=(0,a.xYJ)(e,"storyRibbonAnimations");return{currentUserId:e.currentUserId,orderedPeerIds:t?n:o,isShown:t?!r:!s,isForumPanelOpen:d,withAnimation:c,usersById:e.users.byId,chatsById:e.chats.byId,peerStories:i}})(function({currentUserId:e,orderedPeerIds:t,usersById:n,chatsById:a,canShow:p,isShown:g,isForumPanelOpen:f,isArchived:v,withAnimation:A,peerStories:y}){const{toggleStoryRibbon:C}=(0,i.ko)(),w=(0,d.A)(),I=(0,o.Kr)(()=>1===t.length?[n[t[0]]||a[t[0]]]:t.map(e=>n[e]||a[e]).filter(t=>t&&t.id!==e).slice(0,s.dqH).reverse(),[e,t,n,a]),b=(0,o.Kr)(()=>I?.length?I.reduce((e,t)=>{const n=y[t.id];if(!n)return e;const o=n.orderedIds.some(e=>{const t=n.byId[e];if(!t||!("isForCloseFriends"in t))return!1;const o=n.lastReadId&&t.id<=n.lastReadId;return t.isForCloseFriends&&!o});return e[t.id]=o,e},{}):{},[y,I]),S=(0,o.Kr)(()=>t.slice(0,5),[t]);(0,l.A)(S);const M=p&&g,{ref:N,shouldRender:Y}=(0,c.A)({isOpen:M,className:"slow",withShouldRender:!0});if((0,o.vJ)(()=>{A&&!f&&(M?((0,o.VK)(r.UG+s.xB5),(0,r.$)(v)):((0,o.VK)(r.UG+s.xB5),(0,r.wV)(v)))},[v,M,A,f]),Y)return(0,m.Y)("button",{ref:N,type:"button",id:"StoryToggler",className:h.A.root,"aria-label":w("AriaStoryTogglerOpen"),onClick:()=>C({isShown:!0,isArchived:v}),dir:w.isRtl?"rtl":void 0,children:I.map(e=>(0,m.Y)(u.A,{peer:e,size:"tiny",className:h.A.avatar,withStorySolid:!0,forceFriendStorySolid:b[e.id]},e.id))})}))},40435:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(41074);const i={dark:{outgoing:"rgb(135,116,225)",incoming:"rgb(33,33,33)"},light:{outgoing:"rgb(238,255,222)",incoming:"rgb(255,255,255)"}};function s(e,t,n,s,a){return s?Promise.resolve(i[a||"light"][t?"outgoing":"incoming"]):(0,o.M1)({name:"offscreen-canvas:getAppendixColorFromImage",args:[e,t]},Math.round(n)%o.bP)}},41074:(e,t,n)=>{n.d(t,{Ay:()=>r,M1:()=>d,bP:()=>s});var o=n(31481),i=n(5130);const s=Math.min(navigator.hardwareConcurrency||4,4);let a;function r(){return o.W75?[]:(a||(a=new Array(s).fill(void 0).map(()=>{const e=new Worker(new URL(n.p+n.u(9443),n.b));return{worker:e,connector:(0,i.U)(e,void 0,"media")}})),a)}function d(e,t){return r()[t].connector.request(e)}},41316:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(84051);function i(e){const[t,n]=(0,o.Ul)();return(0,o.vJ)(()=>{function t(){const t=window.getSelection();if(!t?.rangeCount)return;const o=t.getRangeAt(0);if(!o)return;if(!document.querySelector(e))return;const{commonAncestorContainer:i}=o;(i instanceof Element?i:i.parentElement).closest(e)&&n(o)}return document.addEventListener("selectionchange",t),()=>document.removeEventListener("selectionchange",t)},[e,n]),t}},41385:(e,t,n)=>{n.d(t,{k:()=>r});var o=n(95807),i=n(17712),s=n(14745);const a="--_vtn";function r(e){const t=(0,s.A)();return{createVtnStyle:(0,i.A)((n,i)=>{const s=!0===i?n:i||void 0;return(0,o.A)(`${a}: vtn-${n}-${e||t}`,s&&`view-transition-class: ${s}`)})}}CSS.registerProperty?.({name:a,syntax:"*",inherits:!1})},41510:(e,t,n)=>{n.d(t,{I:()=>y,A:()=>C});var o=n(84051),i=n(13439),s=n(90709),a=n(87357),r=n(11778),d=n(55153),c=n(45761),l=n(39351),u=n(17712),h=n(73767),m=n(50680),p=n(3325),g=n(37661),f=n(18276),v=n(20021);const A=(0,o.ph)(({isQuick:e,isGeneric:t,onFileSelect:n})=>{const i=(0,o.li)(),s=(0,l.A)(),[r,d,c]=(0,g.A)(),h=(0,u.A)(e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),c()}),m=(0,a.A)("DropTarget",r&&"hovered");return(0,v.FD)("div",{className:m,ref:i,onDrop:n,onDragEnter:d,onDragLeave:h,"data-dropzone":!0,children:[(0,v.Y)("svg",{className:"target-outline-container",children:(0,v.Y)("rect",{className:"target-outline",x:"0",y:"0",width:"100%",height:"100%",rx:"8"})}),(0,v.FD)("div",{className:"target-content",children:[(0,v.Y)(f.A,{name:e?"photo":"document"}),(0,v.Y)("div",{className:"title",children:s("FileDropZoneTitle")}),!t&&(0,v.Y)("div",{className:"description",children:s(e?"FileDropZoneQuick":"FileDropZoneNoCompression")})]})]})});let y=function(e){return e.None="none",e.Document="document",e.QuickFile="quick_file",e}({});const C=(0,o.ph)(({isOpen:e,withQuick:t,editingMessage:n,onHide:g,onFileSelect:f})=>{const y=(0,l.A)(),{showNotification:C,updateAttachmentSettings:w}=(0,i.ko)(),I=(0,o.li)(),b=(0,h.A)(t),{shouldRender:S,transitionClassNames:M}=(0,m.A)(e);(0,o.vJ)(()=>e?(0,r.A)(g):void 0,[e,g]);const N=(0,u.A)(async e=>{const{dataTransfer:o}=e;let i=[];if(!(o.files&&o.files.length>0)||o.items&&o.items.length){if(o.items&&o.items.length>0){const e=await(0,c.A)(o.items);e?.length&&(i=i.concat(e))}}else i=i.concat(Array.from(o.files));if(n){if(i.length>1)return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:i.length})});if(1===i.length){const e=await(0,d.A)(i[0].name,i[0]);if(!(n&&e&&(0,s.eh)(n,e)))return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:i.length})})}}g(),w({shouldCompress:!t&&void 0}),f(i)}),Y=(0,u.A)(async e=>{const{dataTransfer:t}=e;if(t.files&&t.files.length>0){const e=Array.from(t.files);if(n){if(e.length>1)return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:e.length})});if(1===e.length){const t=await(0,d.A)(e[0].name,e[0]);if(!(n&&t&&(0,s.eh)(n,t)))return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:e.length})})}}g(),w({shouldCompress:!0}),f(e)}}),k=(0,u.A)(e=>{e.stopPropagation();const{target:t,relatedTarget:n}=e;!t.matches(".DropTarget, .DropArea")||n&&n.matches(".DropTarget, .DropArea")||(I.current=window.setTimeout(()=>{g()},150))});if(!S)return;const P=t||b,F=(0,a.A)("DropArea",M);return(0,v.Y)(p.A,{containerSelector:"#middle-column-portals",children:(0,v.FD)("div",{className:F,onDragLeave:k,onDragOver:()=>{I.current&&window.clearTimeout(I.current)},onDrop:g,onClick:g,children:[(0,v.Y)(A,{onFileSelect:N,isGeneric:!P}),P&&(0,v.Y)(A,{onFileSelect:Y,isQuick:!0})]})})})},42215:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(84051),i=n(30857);function s(e,t){const n=(0,i.A)(),s=(0,o.li)(e),a=(0,o.li)(t),r=(0,o.hb)(e=>(a.current=s.current(a.current,e),n(),a.current),[]);return[a.current,r]}},42827:(e,t,n)=>{n.d(t,{A:()=>u});var o=n(84051),i=n(87357),s=n(58443),a=n(4961),r=n(59030),d=n(50680),c=n(64489),l=n(20021);const u=(0,o.ph)(({text:e="Nothing found.",description:t,withSticker:n})=>{const o=(0,r.A)(),{transitionClassNames:u}=(0,d.A)(!0);return(0,l.FD)("div",{className:(0,i.A)("NothingFound",u,t&&"with-description",n&&"with-sticker"),children:[n&&(0,l.Y)(c.A,{className:"sticker",size:120,tgsUrl:s.w.DuckNothingFound,previewUrl:s.d.DuckNothingFound,nonInteractive:!0,noLoop:!1}),e,t&&(0,l.Y)("p",{className:"description",children:(0,a.A)(o(t),["br"])})]})})},44784:(e,t,n)=>{n.d(t,{A:()=>re});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(90709),c=n(27109),l=n(91048),u=n(87357),h=n(85982),m=n(64713),p=n(83868),g=n(59852),f=n(79882),v=n(24899),A=n(4961),y=n(18501),C=n(57675),w=n(82117),I=n(39351),b=n(17712),S=n(62587),M=n(59030),N=n(38691),Y=n(19210),k=n(64493),P=n(22720),F=n(55158),T=n(63152),D=n(87412),x=n(18276),L=n(84685),E=n(66644),B=n(96454),R=n(17663);const O=1440,U=10080;function K(){const e=new Date;e.setHours(0,0,0,0);const t=e.getDay(),n=e.getDate()-t+(0===t?-6:1);return new Date(e.setDate(n)).getTime()}function z(e,t){if(0===t)return e;const n=[];for(const o of e){let e=(o.startMinute+t)%U,i=(o.endMinute+t)%U;e<0&&(e+=U),i<=0&&(i+=U),e>i?(n.push({startMinute:e,endMinute:10079}),n.push({startMinute:0,endMinute:i})):n.push({startMinute:e,endMinute:i})}return n.sort((e,t)=>e.startMinute-t.startMinute),n.reduce((e,t)=>{const n=e[e.length-1];return n&&n.endMinute>=t.startMinute?n.endMinute=Math.max(n.endMinute,t.endMinute):e.push(t),e},[])}var V=n(98255),j=n(32625),J=n(19129),G=n(37661),$=n(30857),q=n(41036);const H="MPBKHdZL";var W=n(20021);const _=Array.from({length:7},(e,t)=>t),Q=(0,o.ph)(({businessHours:e})=>{const t=(0,o.li)(),[n,i,s]=(0,G.A)(!1),[a,r,d]=(0,G.A)(!1),c=(0,M.A)(),l=(0,$.A)();(0,j.A)(l,6e4);const h=(0,V.A)(e=>e.timezones?.byId),m=(0,J.A)(h,[h]),p=(0,o.Kr)(()=>{if(!m)return 0;const t=m[e.timezoneId];return(-60*(new Date).getTimezoneOffset()-t.utcOffset)/60},[e.timezoneId,m]),g=(0,o.Kr)(()=>{const t=K(),n=function(e){const t={};for(const n of e){const e=n.startMinute,o=n.endMinute,i=Math.floor(e/O),s=Math.floor((o-1)/O);for(let n=i;n<=s;n++)t[n]||(t[n]=[]),t[n].push({startMinute:Math.max(0,e-n*O),endMinute:Math.min(O,o-n*O)})}return t}(z(e.workHours,a?p:0)),o={};return _.forEach(e=>{const i=n[e];o[e]=i?i.map(({startMinute:e,endMinute:n})=>n-e===1440?c("BusinessHoursDayFullOpened"):`${(0,R.fU)(c,t+60*e*1e3)} ${(0,R.fU)(c,t+60*n*1e3)}`):[c("BusinessHoursDayClosed")]}),o},[e.workHours,a,c,p]),f=(0,o.Kr)(()=>{const t=z(e.workHours,p),n=K(),o=((new Date).getTime()-n)/1e3/60;return t.some(({startMinute:e,endMinute:t})=>e<=o&&o<=t)},[e.workHours,p]),v=(0,o.Kr)(()=>(new Date(Date.now()-(a?0:60*p*1e3)).getDay()+6)%7,[a,p]),A=(0,b.A)(()=>{n?s():i()}),y=(0,b.A)(e=>{e.stopPropagation(),a?d():r()});(0,o.vJ)(()=>{if(!n)return;const e=document.querySelector(`.${q.uo} > .${H}`);if(!e)return;const o=e.offsetHeight;(0,E.RK)(()=>{t.current.style.height=`${o}px`})},[n]);const C=(0,b.A)(()=>{const e=document.querySelector(`.${q.VY} > .${H}`);(0,E.YS)(()=>{const n=e.offsetHeight;(0,E.RK)(()=>{t.current.style.height=`${n}px`})})});return(0,W.FD)(P.A,{icon:"clock",iconClassName:"rlM4Mbnn",multiline:!0,className:"Ef_0p5Qm",isStatic:n,ripple:!0,narrow:!0,withColorTransition:!0,onClick:A,children:[(0,W.FD)("div",{className:"nHSmCUNs",children:[(0,W.FD)("div",{className:"JTZ8UnnP",children:[(0,W.Y)("div",{children:c("BusinessHoursProfile")}),(0,W.Y)("div",{className:(0,u.A)("JVL7ZnnJ",f&&"segAfYXs"),children:c(f?"BusinessHoursProfileNowOpen":"BusinessHoursProfileNowClosed")})]}),(0,W.Y)(x.A,{className:"dYxw2cFn",name:n?"up":"down"})]}),n&&(0,W.FD)("div",{className:"lp9VIV1o",children:[Boolean(p)&&(0,W.Y)("div",{className:"gVwflFhz",role:"button",tabIndex:0,onMouseDown:B.TF?void 0:y,onClick:B.TF?y:void 0,children:c(a?"BusinessHoursProfileSwitchMy":"BusinessHoursProfileSwitchLocal")}),(0,W.Y)(q.Ay,{className:"WKgL_XiP",ref:t,name:"fade",activeKey:Number(a),onStart:C,children:(0,W.Y)("dl",{className:H,children:_.map(e=>(0,W.FD)(W.FK,{children:[(0,W.Y)("dt",{className:(0,u.A)("cmxPqAof",e===v&&"YZVvP_56"),children:(0,R.wv)(c,6===e?0:e+1)}),(0,W.Y)("dd",{className:"Rs0VPgpq",children:g[e].map(e=>(0,W.Y)("div",{children:e}))})]}))})})]})]})});var Z=n(87894),X=n(58554),ee=n(14737),te=n(82855);const ne=["🎉","🎆","🎈"],oe=(0,o.ph)((0,i.EK)(e=>{const{birthdayNumbers:t,animatedEmojiEffects:n}=e;return{birthdayNumbers:t,animatedEmojiEffects:n,isPremiumPurchaseBlocked:(0,l.n_C)(e)}})(({user:e,birthday:t,isPremiumPurchaseBlocked:n,birthdayNumbers:a,animatedEmojiEffects:r,isInSettings:c})=>{const{openGiftModal:l,requestConfetti:h}=(0,i.ko)(),m=(0,o.li)(),p=(0,o.li)(!1),[g,f,v]=(0,G.A)(),y=(0,I.A)(),{formattedDate:C,isToday:w,age:S}=(0,o.Kr)(()=>{const e=new Date,n=new Date;return t.year&&n.setFullYear(t.year),n.setMonth(t.month-1),n.setDate(t.day),n.setHours(0,0,0,0),{formattedDate:(0,R.A)(n,y.code,!0,"long"),isToday:n.getDate()===e.getDate()&&n.getMonth()===e.getMonth(),age:t.year&&ie(n)}},[t,y]),M=(0,o.Kr)(()=>{if(!S||!w)return;const e=a?.stickers?.filter(({emoji:e})=>e?.endsWith(""));if(!e)return;const t=(0,Z.dU)(e,"emoji");return S.toString().split("").map(e=>t[e+""])},[S,a?.stickers,w]),N=(0,o.Kr)(()=>{if(!w)return;const e=ne[Math.floor(Math.random()*ne.length)];return r?.stickers?.find(({emoji:t})=>t===e)},[r?.stickers,w]);(0,o.vJ)(()=>{if(w&&M&&(M.forEach(e=>{const t=(0,d.Mw)(e,"preview");X.hd(t,s.qZ.BlobUrl)}),N)){const e=(0,d.Mw)(N,"preview");X.hd(e,s.qZ.BlobUrl)}},[N,w,M]),(0,ee.A)(v,g?3e3:void 0),(0,o.vJ)(()=>{if(g){p.current=!0;const e=document.getElementById(c?"LeftColumn":"RightColumn");if(!e)return;(0,E.YS)(()=>{const{top:t,left:n,width:o,height:i}=e.getBoundingClientRect();h({top:t,left:n,width:o,height:i,style:"top-down"})})}},[c,g]);const Y=(0,o.Kr)(()=>S?y(`ProfileBirthday${w?"Today":""}ValueYear`,{date:C,age:S},{pluralValue:S}):y(`ProfileBirthday${w?"Today":""}Value`,{date:C}),[S,C,w,y]),k=w&&!e.isPremium&&!e.isSelf&&!n,F=(0,b.A)(()=>{l({forUserId:e.id})}),T=(0,b.A)(()=>{w&&(k&&p.current?F():f())}),D=!w&&!k;return(0,W.FD)("div",{className:"wCp6TBYF",children:[(0,W.FD)(P.A,{icon:"calendar",secondaryIcon:k?"gift":void 0,secondaryIconClassName:"c4HDQNGJ",multiline:!0,narrow:!0,ref:m,ripple:!D,onClick:T,isStatic:D,onSecondaryIconClick:F,children:[(0,W.Y)("div",{className:"title",dir:y.isRtl?"rtl":void 0,children:(0,A.A)(Y)}),(0,W.Y)("span",{className:"subtitle",children:y(w?"ProfileBirthdayToday":"ProfileBirthday")})]}),g&&B.ol&&M?.map((e,t)=>(0,W.Y)("div",{className:(0,u.A)("lQeU96Fj",t>0&&"e1ezfWJb"),style:`--digit-offset: ${t}`,children:(0,W.Y)(te.A,{containerRef:m,sticker:e,size:128,forceAlways:!0})})),g&&N&&(0,W.Y)("div",{className:"cFEXGUih",children:(0,W.Y)(te.A,{containerRef:m,sticker:N,size:288,shouldLoop:!0,forceAlways:!0})})]})}));function ie(e){const t=new Date;let n=t.getFullYear()-e.getFullYear();const o=t.getMonth()-e.getMonth();return(o<0||0===o&&t.getDate()<e.getDate())&&n--,n}const se="UZbkeFDB",ae={width:64,height:64,zoom:15},re=(0,o.ph)((0,i.EK)((e,{chatOrUserId:t,isSavedDialog:n})=>{const{countryList:{phoneCodes:o}}=e,i=t?(0,l.hds)(e,t):void 0,s=t?(0,l.mBe)(e,t):void 0,a=t?(0,l.XOs)(e,t):void 0,r=i?.isForum,u=i&&(0,c.If)(i,(0,l.K52)(e),(0,l.P5N)(e,i.id)),{threadId:h}=(0,l.Xf0)(e)||{},m=r&&h?Number(h):void 0,p=i&&(0,l.AWZ)(e,i.id),g=s&&(0,l.vGo)(e,s.id),f=g?.botVerification||p?.botVerification,v=p?.inviteLink,A=g?.bio||p?.about,y=i&&(0,d.WX)(i)&&(0,d.SJ)(i),C=i&&!s&&(!(0,d.WX)(i)&&!(0,d.Sq)(i,"inviteUsers")||(0,d.ub)(i,"inviteUsers")),w=m?(0,l.sZk)(e,t,m):void 0,I=!n&&e.chats.listIds.saved?.includes(t),b=g?.personalChannelId?(0,l.hds)(e,g.personalChannelId):void 0,S=s?.hasMainMiniApp;return{phoneCodeList:o,chat:i,user:s,userFullInfo:g,canInviteUsers:C,botAppPermissions:a,isMuted:u,topicId:m,chatInviteLink:v,description:A,topicLink:w,hasSavedMessages:I,personalChannel:b,hasMainMiniApp:S,isBotCanManageEmojiStatus:g?.isBotCanManageEmojiStatus,botVerification:f,canViewSubscribers:y}})(({chatOrUserId:e,user:t,chat:n,userFullInfo:c,isOwnProfile:E,canInviteUsers:B,isMuted:R,phoneCodeList:O,topicId:U,description:K,chatInviteLink:z,topicLink:V,hasSavedMessages:j,personalChannel:J,hasMainMiniApp:G,isBotCanManageEmojiStatus:$,botAppPermissions:q,botVerification:H,className:_,style:Z,isInSettings:X,canViewSubscribers:ee})=>{const{showNotification:te,updateChatMutedState:ne,updateTopicMutedState:ie,loadPeerStories:re,openSavedDialog:de,openMapModal:ce,requestCollectibleInfo:le,requestMainWebView:ue,toggleUserEmojiStatusPermission:he,toggleUserLocationPermission:me,requestNextManagementScreen:pe}=(0,i.ko)(),{id:ge,usernames:fe,phoneNumber:ve,isSelf:Ae}=t||{},{id:ye,usernames:Ce}=n||{},we=ge||ye,{businessLocation:Ie,businessWorkHours:be,personalChannelMessageId:Se,birthday:Me,note:Ne}=c||{},Ye=(0,M.A)(),ke=(0,I.A)(),Pe=(0,o.li)(),Fe=Boolean(Ne),{isCollapsed:Te,isCollapsible:De,setIsCollapsed:xe}=(0,C.A)(Pe,3,void 0,!Fe);(0,w.A)(([e])=>{we&&e!==we&&(t||n&&(0,d.WX)(n))&&re({peerId:we})},[we,n,t]);const{width:Le,height:Ee,zoom:Be}=ae,Re=(0,N.A)(),Oe=Ie?.geo&&(0,d.rt)(Ie.geo,Le,Ee,Be,Re),Ue=(0,S.A)(Oe),Ke=(0,o.Kr)(()=>{if(Ie?.geo)return Ue?(0,W.Y)("img",{src:Ue,alt:"",className:se}):(0,W.Y)(F.A,{className:se})},[Ie,Ue]),ze=Boolean(U&&U!==s.l3),Ve=n&&(0,d.WX)(n)||t?.isPremium,je=(0,o.Kr)(()=>{const e=fe?.filter(e=>e.isActive);return e?.length?e:void 0},[fe]),Je=(0,o.Kr)(()=>{const e=t?void 0:Ce?.filter(e=>e.isActive);return e?.length?e:void 0},[Ce,t]),Ge=(0,o.Kr)(()=>{if(n)return ze?V:(0,d.L7)(n)||z},[n,ze,V,z]),$e=(0,b.A)(()=>{const{address:e,geo:t}=Ie;if(!t)return(0,h.eM)(e),void te({message:Ye("BusinessLocationCopied")});ce({geoPoint:t,zoom:Be})}),qe=(0,b.A)(()=>{const e=R?r.Os5:r.xEh;ze?ie({chatId:ye,topicId:U,mutedUntil:e}):ne({chatId:ye,mutedUntil:e})}),He=(0,b.A)(()=>{t&&he({botId:t.id,isEnabled:!$})}),We=(0,b.A)(()=>{t&&me({botId:t.id,isAccessGranted:!q?.geolocation})}),_e=(0,b.A)(()=>{de({chatId:e})}),Qe=De&&Te,Ze=(0,b.A)(()=>{xe(!1)}),Xe=(0,b.A)(()=>{xe(e=>!e)});function et(e,t){(0,h.eM)(e),te({message:`${t} was copied`})}const tt=ve&&(0,m.Ox)(O,ve),nt=(0,b.A)(()=>{ve?.length===r.PGI&&ve.startsWith(r._Bb)?le({collectible:ve,peerId:we,type:"phone"}):et(tt,Ye("Phone"))}),ot=(0,b.A)((e,t)=>{e.isEditable?et((0,v.A)(e.username,t),Ye(t?"Link":"Username")):le({collectible:e.username,peerId:we,type:"username"})}),it=(0,b.A)(()=>{pe({screen:a.je.ChannelSubscribers})}),st=(0,b.A)(()=>{const e=t?.id;if(!e)return;const n=(0,g.A)();ue({botId:e,peerId:e,theme:n,shouldMarkBotTrusted:!0})}),at=ke("ProfileOpenAppAbout",{terms:(0,W.Y)(L.A,{text:ke("ProfileOpenAppTerms"),url:ke("ProfileBotOpenAppInfoLink")})},{withNodes:!0});if((!ye||!(0,l._ls)((0,i.mS)(),ye))&&(!Ae||E||X))return(0,W.FD)("div",{className:(0,u.A)("ChatExtra",_),style:Z,children:[J&&(0,W.FD)("div",{className:"HP5EJx7s",children:[(0,W.Y)("h3",{className:"cHyTGri2",children:Ye("ProfileChannel")}),(0,W.Y)("span",{className:"kYd2GrmU",children:Ye("Subscribers",J.membersCount,"i")}),(0,W.Y)(Y.A,{chatId:J.id,orderDiff:0,animationType:f.I.None,isPreview:!0,previewMessageId:Se,className:"qOJwhXMC"})]}),Boolean(tt?.length)&&(0,W.FD)(P.A,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:nt,children:[(0,W.Y)("span",{className:"title",dir:ke.isRtl?"rtl":void 0,children:tt}),(0,W.Y)("span",{className:"subtitle",children:Ye("Phone")})]}),je&&rt(je),K&&Boolean(K.length)&&(0,W.FD)(P.A,{icon:"info",multiline:!0,narrow:!0,isStatic:!0,allowSelection:!0,children:[(0,W.Y)("span",{className:"title word-break allow-selection",dir:ke.isRtl?"rtl":void 0,children:(0,A.A)(K,["br",Ve?"links":"tg_links","emoji"])}),(0,W.Y)("span",{className:"subtitle",children:Ye(ge?"UserBio":"Info")})]}),Je&&!ze&&rt(Je,!0),(!Je&&B||ze)&&Ge&&(0,W.FD)(P.A,{icon:"link",multiline:!0,narrow:!0,ripple:!0,onClick:()=>et(Ge,Ye("SetUrlPlaceholder")),children:[(0,W.Y)("div",{className:"title",children:Ge}),(0,W.Y)("span",{className:"subtitle",children:Ye("SetUrlPlaceholder")})]}),Me&&(0,W.Y)(oe,{birthday:Me,user:t,isInSettings:X},we),G&&(0,W.FD)(P.A,{multiline:!0,isStatic:!0,narrow:!0,children:[(0,W.Y)(k.A,{className:"x925YeS3",onClick:st,children:Ye("ProfileBotOpenApp")}),(0,W.Y)("div",{className:"IrqRJFxm",children:at})]}),!E&&!X&&(0,W.FD)(P.A,{icon:R?"mute":"unmute",narrow:!0,ripple:!0,onClick:qe,children:[(0,W.Y)("span",{children:ke("Notifications")}),(0,W.Y)(T.A,{id:"group-notifications",label:ke(ge?"AriaToggleUserNotifications":"AriaToggleChatNotifications"),checked:!R,inactive:!0})]}),be&&(0,W.Y)(Q,{businessHours:be}),Ie&&(0,W.FD)(P.A,{icon:"location",ripple:!0,multiline:!0,narrow:!0,rightElement:Ke,onClick:$e,children:[(0,W.Y)("div",{className:"title",children:Ie.address}),(0,W.Y)("span",{className:"subtitle",children:Ye("BusinessProfileLocation")})]}),Fe&&(0,W.FD)(P.A,{icon:"note",iconClassName:"tzdaXm4b",multiline:!0,narrow:!0,isStatic:!0,allowSelection:!0,children:[(0,W.Y)("div",{ref:Pe,className:(0,u.A)("title","word-break","allow-selection","wfFIBsS9",Te&&"XDGCHF3C"),dir:ke.isRtl?"rtl":void 0,onClick:Qe?Ze:void 0,children:(0,y.fd)({text:Ne.text,entities:Ne.entities})}),(0,W.FD)("div",{className:(0,u.A)("subtitle","PZmqBGnF"),children:[(0,W.Y)("span",{children:ke("UserNoteTitle")}),(0,W.Y)("span",{className:"ULBE6izv",children:ke("UserNoteHint")}),De&&(0,W.Y)(x.A,{className:(0,u.A)("E6jkXMYl","emWTh6l1",!Te&&"ajNtwHmo"),onClick:Xe,name:"down"})]})]}),j&&!E&&!X&&(0,W.Y)(P.A,{icon:"saved-messages",narrow:!0,ripple:!0,onClick:_e,children:(0,W.Y)("span",{children:Ye("SavedMessagesTab")})}),c&&"isBotAccessEmojiGranted"in c&&(0,W.FD)(P.A,{icon:"user",narrow:!0,ripple:!0,onClick:He,children:[(0,W.Y)("span",{children:Ye("BotProfilePermissionEmojiStatus")}),(0,W.Y)(T.A,{label:Ye("BotProfilePermissionEmojiStatus"),checked:$,inactive:!0})]}),void 0!==q?.geolocation&&(0,W.FD)(P.A,{icon:"location",narrow:!0,ripple:!0,onClick:We,children:[(0,W.Y)("span",{children:Ye("BotProfilePermissionLocation")}),(0,W.Y)(T.A,{label:Ye("BotProfilePermissionLocation"),checked:q?.geolocation,inactive:!0})]}),ee&&(0,W.FD)(P.A,{icon:"group",narrow:!0,multiline:!0,ripple:!0,onClick:it,children:[(0,W.Y)("div",{className:"title",children:ke("ProfileItemSubscribers")}),(0,W.Y)("span",{className:"subtitle",children:ke.number(n?.membersCount||0)})]}),H&&(0,W.FD)("div",{className:"RWFu5ENh",children:[(0,W.Y)(D.A,{className:"b32hsSPS",documentId:H.iconId,size:16}),H.description]})]});function rt(e,t){const[n,...o]=e,i=o.length?Ye("UsernameAlso","%USERNAMES%").split("%").map(e=>"USERNAMES"===e?(0,W.Y)(W.FK,{children:o.map((e,n)=>(0,W.FD)(W.FK,{children:[n>0?", ":"",(0,W.Y)("a",{href:(0,v.A)(e.username,!0),onMouseDown:p.A,onClick:n=>{(0,p.A)(n),ot(e,t)},className:"text-entity-link username-link",children:(0,v.A)(e.username)},e.username)]}))}):e):void 0;return(0,W.FD)(P.A,{icon:t?"link":"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>{ot(n,t)},children:[(0,W.Y)("span",{className:"title",dir:ke.isRtl?"rtl":void 0,children:(0,v.A)(n.username,t)}),(0,W.FD)("span",{className:"subtitle",children:[i&&(0,W.Y)("span",{className:"other-usernames",children:i}),Ye(t?"Link":"Username")]})]})}}))},45318:(e,t,n)=>{e.exports=n.p+"GiftStar.59a3e3598fdbab13b181.svg"},45761:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(87679);async function i(e){const t=[];function n(e,o){return new Promise(i=>{if(e instanceof File)t.push(e),i(e);else if(e.isFile){const n=o.getAsFile();e.file(e=>{t.push(e),i(e)},()=>{n&&t.push(n),i(n)})}else e.isDirectory&&e.createReader().readEntries(e=>{const t=[];for(let i=0;i<e.length;i++)t.push(n(e[i],o));i(Promise.all(t))})})}const i=[];for(let t=0;t<e.length;t++){const o=e[t];if("file"===o.kind){const e=o.webkitGetAsEntry()||o.getAsFile();e&&i.push(n(e,o))}}return await Promise.all(i),(0,o.kc)(t)}},46051:(e,t,n)=>{n.d(t,{G:()=>o,w:()=>i});const o="video/mp4; codecs=hvc1.1.6.L63.00",i="video/mp4; codecs=avc1.64001E"},46442:(e,t,n)=>{n.d(t,{A:()=>ot});var o=n(84051),i=n(61433),s=n(13439),a=n(23174),r=n(89925),d=n(31481),c=n(66644),l=n(90709),u=n(91048),h=n(21133),m=n(19408),p=n(81954),g=n(87357),f=n(48899),v=n(87894),A=n(60343),y=n(9718),C=n(37836),w=n(16460),I=n(76023),b=n(17663);function S(e){return"albumId"in e}function M(e,t,n,o,i){let s;const a=[{originalDate:e[0].date,datetime:(0,b.CS)(1e3*e[0].date),senderGroups:[[]]}];return e.forEach((r,d)=>{const c=a[a.length-1],u=c.senderGroups[c.senderGroups.length-1];r.isInAlbum?s?(s.messages.push(r),r.hasComments&&(s.commentsMessage=r),r.content.text&&!s.hasMultipleCaptions&&(s.captionMessage?(s.hasMultipleCaptions=!0,s.captionMessage=void 0):s.captionMessage=r)):s={albumId:r.groupedId,messages:[r],mainMessage:r,hasMultipleCaptions:!1}:(r.content.paidMedia?.extendedMedia.length||0)>1?u.push({albumId:`paid-${r.id}`,messages:[r],mainMessage:r,hasMultipleCaptions:!1,isPaidMedia:!0}):u.push(r);const h=e[d+1];!s||h&&h.groupedId&&h.groupedId===s.albumId||(u.push(s),s=void 0);const m=u[u.length-1];if(h&&!s){const e=(0,b.CS)(1e3*h.date);if(c.datetime!==e){const t={originalDate:h.date,datetime:e,senderGroups:[[]]};a.push(t)}else(h.id===t||r.senderId!==h.senderId||!i&&r.paidMessageStars||h.suggestedPostInfo||r.isOutgoing!==h.isOutgoing||r.postAuthorTitle!==h.postAuthorTitle||(0,l._P)(r)&&"phoneCall"!==r.content.action?.type||(0,l._P)(h)&&"phoneCall"!==h.content.action?.type||r.inlineButtons||h.inlineButtons||h.date-r.date>600||n&&(r.id===n||m&&"mainMessage"in m&&m.mainMessage?.id===n)&&h.id!==n||o&&r.forwardInfo?.fromId!==h.forwardInfo?.fromId)&&c.senderGroups.push([])}}),a}var N=n(54464),Y=n(32625),k=n(82117),P=n(17712),F=n(37859),T=n(81686),D=n(2178);var x=n(41257),L=n(35297),E=n(61157),B=n(93545),R=n(37661),O=n(56133);var U=n(52745),K=n(41036),z=n(59030),V=n(82855);var j=n(20021);const J=(0,o.ph)((0,s.EK)((e,{userId:t})=>{const{stickers:n}=e.stickers.greeting,o=(0,u.hds)(e,t);if(!o)return{};const i=(0,u.mBe)(e,t),s=(0,u.vGo)(e,t),a=(0,u.yHC)(e,o.id);return{defaultStickers:n,lastUnreadMessageId:a&&a.id!==o.lastReadInboxMessageId?a.id:void 0,connectionState:e.connectionState,currentMessageList:(0,u.Xf0)(e),businessIntro:s?.businessIntro,user:i}})(({defaultStickers:e,connectionState:t,lastUnreadMessageId:n,currentMessageList:i,businessIntro:a,user:r})=>{const{loadGreetingStickers:d,sendMessage:c,markMessageListRead:u}=(0,s.ko)(),h=(0,z.A)(),m=(0,o.li)(),p=(0,o.Kr)(()=>{if(a?.sticker)return a.sticker;if(!e?.length)return;const t=Math.floor(Math.random()*e.length);return e[t]},[a?.sticker,e]);(0,o.vJ)(()=>{e?.length||"connectionStateReady"!==t||d()},[t,d,e]),(0,o.vJ)(()=>{"connectionStateReady"===t&&n&&u({maxId:n})},[t,u,n]);const g=(0,P.A)(()=>{i&&c({sticker:{...p,isPreloadedGlobally:!0},messageList:i})}),f=a?.title||h("Conversation.EmptyPlaceholder"),v=a?.description||h("Conversation.GreetingText");return(0,j.FD)("div",{className:"osdROIcA",children:[(0,j.FD)("div",{className:"c3NtU3JZ",children:[(0,j.Y)("p",{className:"n2KO1cAv",dir:"auto",children:f}),(0,j.Y)("p",{className:"MVSedxKc",dir:"auto",children:v}),(0,j.Y)("div",{ref:m,className:"qsfxNv7L",onClick:g,children:p&&(0,j.Y)(V.A,{containerRef:m,sticker:p,size:160,shouldLoop:!0})})]}),a&&(0,j.Y)("div",{className:"WIbO6rja",children:h("Chat.EmptyStateIntroFooter",(0,l.Yg)(r))})]})}));var G=n(95807),$=n(52491),q=n(64713),H=n(83868),W=n(4961),_=n(39351),Q=n(62587),Z=n(26875),X=n(18276),ee=n(92108),te=n(96530),ne=n(65843),oe=n(55158);const ie="ubFGDy3d",se="kpMdEhns",ae="mtKNWJmZ",re="BH_g_jqY",de=(0,o.ph)((0,s.EK)((e,{chatId:t})=>{const{countryList:{phoneCodes:n}}=e,o=(0,u.hds)(e,t),i=(0,u.vGo)(e,t),s=(0,u.Ua4)(e,t);let a,r=!1;return(0,u.yps)(e,t)&&(i?a=i.botInfo:r=!0),{chat:o,userFullInfo:i,botInfo:a,isLoadingFullUser:r,phoneCodeList:n,commonChats:s}})(({chat:e,chatId:t,botInfo:n,isLoadingFullUser:i,phoneCodeList:a,commonChats:r,userFullInfo:d,hasMessages:c})=>{const{loadCommonChats:h,openChatWithInfo:m}=(0,s.ko)(),p=(0,z.A)(),f=(0,_.A)(),{phoneCountry:v,registrationMonth:A,nameChangeDate:y,photoChangeDate:C}=d?.settings||{};(0,o.vJ)(()=>{h({userId:t})},[t]);const w=(0,o.Kr)(()=>{if(a&&v)return(0,q.gH)(a,v)},[a,v]),I=(0,Q.A)(n?.photo?(0,l.Fi)(n.photo):void 0),S=(0,Q.A)(n?.gif?(0,l.sC)(n.gif,"full"):void 0),M=n?.photo?(0,l.Xn)(n.photo):n?.gif?(0,l.NZ)(n.gif):void 0,N=n&&!n.description&&!n.gif&&!n.photo,Y=!w||!A,k=(0,l.Rl)(t),{width:F,height:T}=M||{},D=(0,P.A)(e=>{(0,H.A)(e),m({id:t,shouldReplaceHistory:!0,profileTab:"commonChats",forceScrollProfileTab:!0})}),x=y&&e?(0,j.Y)("div",{className:"local-action-message",children:(0,j.Y)("span",{children:f("UserUpdatedName",{user:e.title,time:(0,b.vm)(f,y)},{withNodes:!0,withMarkdown:!0})})},"security-name-message"):void 0,L=C&&e?(0,j.Y)("div",{className:"local-action-message",children:(0,j.Y)("span",{children:f("UserUpdatedPhoto",{user:e.title,time:(0,b.vm)(f,C)},{withNodes:!0,withMarkdown:!0})})},"security-photo-message"):void 0,E=(0,o.Kr)(()=>{const e=[];if(w&&e.push([p("PrivacyPhone"),(0,j.FD)("span",{className:"TYJGFKqJ",children:[(0,j.Y)("span",{className:"WuX68A65",children:(0,W.A)((0,$.D0)(w?.iso2))}),w?.defaultName]})]),A&&e.push([f("ContactInfoRegistration"),(0,b.BR)(f.code,A)]),d?.commonChatsCount){const t=(0,s.mS)(),n=r?.ids.slice(0,3).map(e=>(0,u.PVB)(t,e)).filter(Boolean);e.push([f("ChatNonContactUserGroups"),(0,j.FD)(te.A,{className:"yIJ4jRxH",onClick:D,children:[(0,j.Y)("span",{className:"_MPDNfhr",children:f("ChatGroups",{count:d.commonChatsCount},{pluralValue:d.commonChatsCount})}),Boolean(n?.length)&&(0,j.Y)(Z.A,{size:"micro",peers:n}),(0,j.Y)(X.A,{name:"next",className:"KYcoeDmo"})]})])}return e},[f,p,w,A,r,d]);return(0,j.FD)("div",{className:(0,g.A)("tFPZHCMt","empty"),children:[i&&Y&&(0,j.Y)("span",{children:p("Loading")}),N&&Y&&!i&&!c&&(0,j.Y)("span",{children:p("NoMessages")}),n&&(0,j.FD)("div",{className:(0,g.A)(ie,"kXKBpNnb"),style:(0,G.A)(F?`width: ${F}px`:void 0),children:[I&&(0,j.Y)("img",{className:ae,src:I,width:F,height:T,alt:"Bot info"}),S&&(0,j.Y)(ne.A,{canPlay:!0,className:ae,src:S,loop:!0,disablePictureInPicture:!0,muted:!0,playsInline:!0,style:(0,G.A)(Boolean(F)&&`width: ${F}px`,Boolean(T)&&`height: ${T}px`)}),M&&!I&&!S&&(0,j.Y)(oe.A,{className:ae,width:F,height:T,forceAspectRatio:!0}),k&&(0,j.Y)("div",{className:se,children:p("VerifyChatInfo")}),!k&&n.description&&(0,j.FD)("div",{className:se,children:[(0,j.Y)("p",{className:"H__cBlx8",children:p("BotInfoTitle")}),(0,W.A)(n.description,["br","emoji","links"])]})]}),!Y&&e&&(0,j.FD)("div",{className:(0,g.A)(ie,"niS9Gfcl"),children:[(0,j.Y)("h3",{className:"RyB2zw9K",children:(0,W.A)((0,l.Js)(f,e))}),(0,j.Y)("p",{className:(0,g.A)("n9OcHdnh",re),children:f("ChatNonContactUserSubtitle")}),(0,j.Y)(ee.A,{keyClassName:re,data:E}),!e?.isVerified&&(0,j.FD)("div",{className:(0,g.A)("sCB3zhO3",re),children:[(0,j.Y)(X.A,{name:"info-filled"}),(0,j.Y)("p",{className:"dlaTjW_s",children:f("ContactInfoNotVerified")})]})]}),x,L]})}));var ce=n(70636),le=n(17142),ue=n(48775),he=n(4262),me=n(83414),pe=n(73767),ge=n(96454),fe=n(43874),ve=n(5912);const Ae=ge.Ni?1e3:350;var ye=n(63988),Ce=n(5718),we=n(36143),Ie=n(90596),be=n(10722),Se=n(34201),Me=n(21849),Ne=n(71429),Ye=n(24433);const ke="FHxnbOg6",Pe=(0,o.ph)((0,s.EK)((e,t)=>{const{message:n,withAvatar:o}=t,{chatId:i}=n,s=(0,u.nZ4)(e,i),a=(0,l.DX)(i),r=(0,l.Qe)(i),d=!s&&(0,l.zP)(n),c=o||d;return{sender:(0,u.Y7C)(e,n),canShowSender:c,originSender:(0,u.Szq)(e,n),isChatWithSelf:s,isRepliesChat:a,isAnonymousForwards:r}})(({message:e,withAvatar:t,children:n,id:i,appearanceOrder:a,sender:r,canShowSender:c,originSender:u,isChatWithSelf:h,isRepliesChat:m,isAnonymousForwards:p,canPost:f})=>{const{openChat:v,updateInsertingPeerIdMention:A}=(0,s.ko)(),{forwardInfo:y}=e,C=c?r:void 0,w=(0,_.A)(),I=a<=0,[b,S]=(0,R.A)(I);(0,o.vJ)(()=>{I||setTimeout(S,a*d.zq7)},[a,S,I]);const M=y&&(h||m||p||!C)?u:C,N=M&&(0,ce.mO)(M),Y=(0,P.A)(()=>{M&&v({id:M.id})}),k=(0,P.A)(()=>{M&&document.querySelector(d.m$5)&&A({peerId:M.id})}),F=(0,P.A)(()=>{Y()}),{ref:T,shouldRender:D}=(0,Se.A)({isOpen:t&&b,noMountTransition:b,withShouldRender:!0}),{isContextMenuOpen:x,contextMenuAnchor:L,handleContextMenu:E,handleContextMenuClose:B,handleContextMenuHide:O}=(0,be.A)(T),U=(0,P.A)(()=>T.current),K=(0,P.A)(()=>document.querySelector(".Transition_slide-active > .MessageList")),z=(0,P.A)(()=>T?.current?.querySelector(`.${ke} .bubble`)),V=(0,P.A)(()=>({withPortal:!0})),J=f&&M&&(N||Boolean((0,l.Kl)(M))),G=Boolean(L)&&(N||J),$=(0,g.A)("sender-group-container","Tk8btfOT");return(0,j.FD)("div",{id:i,className:$,children:[D&&(0,j.FD)("div",{ref:T,className:"UPrRM3Ks",children:[function(){const e=!M&&y?y.hiddenUserName:void 0;return(0,j.Y)(Me.A,{size:"small",className:"jdvqXfYh",peer:M,text:e,onClick:M?F:void 0,onContextMenu:E})}(),G&&(0,j.Y)(Ne.A,{isOpen:x,anchor:L,getTriggerElement:U,getRootElement:K,getLayout:V,getMenuElement:z,className:ke,onClose:B,onCloseAnimationEnd:O,withPortal:!0,autoClose:!0,children:(0,j.FD)(j.FK,{children:[N&&(0,j.Y)(Ye.A,{icon:"comments",onClick:Y,children:w("SendMessage")}),J&&(0,j.Y)(Ye.A,{icon:"mention",onClick:k,children:w("ContextMenuItemMention")})]})})]}),n]})}));var Fe=n(56494),Te=n(18501),De=n(35127),xe=n(81949),Le=n(86070),Ee=n(64493),Be=n(48906),Re=n(51644),Oe=n(80089),Ue=n(80464);const Ke=e=>{const{isOpen:t}=e,n=(0,Ue.A)(Oe.ar.Extra,"SponsoredContextMenuContainer",!t);return n?(0,j.Y)(n,{...e}):void 0};var ze=n(25477);const Ve=(0,o.ph)((0,s.EK)((e,{chatId:t})=>{const n=(0,u.v8U)(e,t),o=(0,u.yuw)(e),i=n?(0,Fe.iS)(e,n):void 0,s=i&&(0,l.$r)(o,i);return{message:n,theme:(0,u.SJA)(e),isDownloading:s,canAutoLoadMedia:n?(0,u.wwb)(e,n):void 0,canAutoPlayMedia:n?(0,u.OEt)(e,n):void 0}})(({chatId:e,message:t,containerRef:n,theme:i,observeIntersectionForLoading:a,observeIntersectionForPlaying:d,isDownloading:c,canAutoLoadMedia:u,canAutoPlayMedia:h})=>{const{viewSponsored:m,openUrl:p,hideSponsored:f,clickSponsored:v,openMediaViewer:A,openAboutAdsModal:y}=(0,s.ko)(),C=(0,z.A)(),w=(0,o.li)(),I=(0,o.li)(),b=Boolean(t),{isMobile:S}=(0,fe.Ay)(),{observe:M}=(0,ve.BL)({rootRef:n,debounceMs:200,threshold:1}),{isContextMenuOpen:Y,contextMenuAnchor:k,handleBeforeContextMenu:F,handleContextMenu:T,handleContextMenuClose:D,handleContextMenuHide:x}=(0,be.A)(I,void 0,!0,ge.Ni);(0,o.vJ)(()=>b?M(w.current,e=>{e.isIntersecting&&t?.randomId&&m({randomId:t.randomId})}):void 0,[t?.randomId,b,M,m]);const L=(0,P.A)(()=>{f()}),E=t&&(0,l.r_)(t),{photo:B,video:R,text:O}=E||{},U=R?.isGif,K=Boolean(B||R),V=(0,P.A)(()=>{t&&(v({randomId:t.randomId,isMedia:!(!B&&!U)||void 0}),p({url:t.url,shouldSkipModal:!0}))}),J=(0,P.A)(()=>{t&&(v({randomId:t.randomId,isMedia:!0}),A({origin:r.TQ.SponsoredMessage,chatId:e,isSponsoredMessage:!0}))}),G=(0,P.A)(()=>{t&&y({randomId:t.randomId,canReport:t.canReport,additionalInfo:t.additionalInfo,sponsorInfo:t.sponsorInfo})}),$=(0,o.Kr)(()=>{let e,t,n="";if(B||R){let n;B?n=(0,De.yA)({media:B,isMobile:S}).width:R&&(n=(0,De.yA)({media:R,isMobile:S}).width),n&&(n<(0,De.Ay)(S)&&(t=n),e=Math.max((0,De.nP)(O?.text,S),n))}return e&&(n=`width: ${e+0}px`),{contentWidth:t,noMediaCorners:!1,style:n}},[B,R,S,O?.text]),{contentWidth:q,style:H}=$;if(t&&t.content)return(0,j.FD)("div",{ref:I,className:"SponsoredMessage Message open sponsored-media-preview",children:[(0,j.FD)("div",{className:"message-content media has-shadow has-solid-background has-appendix",dir:"auto",style:H,onMouseDown:e=>{(0,N.l)(e),F(e)},onContextMenu:T,children:[(0,j.FD)(Le.A,{peerColor:t.peerColor,className:"content-inner",dir:"auto",children:[function(){if(t)return B?(0,j.Y)(Re.A,{photo:B,theme:i,canAutoLoad:u,isDownloading:c,observeIntersection:a,noAvatars:!0,onClick:V,forcedWidth:q}):R?(0,j.Y)(ze.A,{video:R,observeIntersectionForLoading:a,observeIntersectionForPlaying:d,noAvatars:!0,canAutoLoad:u,canAutoPlay:h,isDownloading:c,onClick:U?V:J,forcedWidth:q}):void 0}(),t.photo&&(0,j.Y)(Me.A,{size:"large",photo:t.photo,className:(0,g.A)("channel-avatar",C.isRtl&&"is-rtl")}),(0,j.FD)("span",{className:(0,g.A)("message-title message-type",K&&"has-media"),children:[t.isRecommended?C("Message.RecommendedLabel"):C("SponsoredMessage"),(0,j.Y)(xe.A,{onClick:G,className:"ad-about",children:C("SponsoredMessageAdWhatIsThis")})]}),function(){if(t)return(0,j.FD)(j.FK,{children:[(0,j.Y)("div",{className:"message-title message-peer",dir:"auto",children:t.title}),Boolean(t.content?.text)&&(0,j.Y)("div",{className:"text-content with-meta",dir:"auto",ref:w,children:(0,j.Y)("span",{className:"text-content-inner",dir:"auto",children:(0,Te.fd)({text:t.content.text.text,entities:t.content.text.entities})})}),(0,j.Y)(Ee.A,{className:"SponsoredMessage__button",size:"tiny",color:"translucent",isRectangular:!0,onClick:V,children:t.buttonText})]})}()]}),(0,j.Y)(Be.A,{}),(0,j.FD)("div",{className:"message-action-buttons",children:[(0,j.Y)(Ee.A,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:C("Close"),onClick:L,children:(0,j.Y)(X.A,{name:"close",className:"sponsored-action-icon"})}),t.canReport&&(0,j.Y)(Ee.A,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:C("More"),onClick:T,onContextMenu:T,children:(0,j.Y)(X.A,{name:"more",className:"sponsored-action-icon"})})]})]}),k&&(0,j.Y)(Ke,{isOpen:Y,anchor:k,triggerRef:I,randomId:t.randomId,canReport:t.canReport,sponsorInfo:t.sponsorInfo,additionalInfo:t.additionalInfo,onClose:D,onCloseAnimationEnd:x})]},"sponsored-message")}));var je=n(42211);const Je=(0,o.ph)(({isJustAdded:e,isFocused:t,className:n})=>{const i=(0,o.li)();return(0,je.A)({elementRef:i,isJustAdded:e,isFocused:t,noFocusHighlight:!0}),(0,j.Y)("div",{ref:i,className:(0,g.A)("list-bottom-marker",n)})});var Ge=n(50805);const $e=(0,o.ph)(({canShowAds:e,chatId:t,threadId:n,messageIds:i,messageGroups:h,getContainerHeight:m,isViewportNewest:p,isUnread:f,isComments:A,isEmptyThread:y,withUsers:w,isChannelChat:I,isChatMonoforum:M,noAvatars:Y,containerRef:k,anchorIdRef:F,memoUnreadDividerBeforeIdRef:T,memoFirstUnreadIdRef:D,type:x,isReady:B,hasLinkedChat:R,isSchedule:O,shouldRenderAccountInfo:U,nameChangeDate:K,photoChangeDate:V,noAppearanceAnimation:J,isSavedDialog:G,isQuickPreview:$,shouldScrollToBottom:q,canPost:H,onScrollDownToggle:W,onNotchToggle:Q,onIntersectPinnedMessage:Z})=>{const{openHistoryCalendar:X}=(0,s.ko)(),te=o.OV,ne=(0,me.A)(()=>B&&!te(),[B,te]),oe=!G&&!O,ie=e&&p,{observeIntersectionForReading:se,observeIntersectionForLoading:ae,observeIntersectionForPlaying:re}=function(e,t,n,o,i,a){const{markMessageListRead:r,markMentionsRead:d,animateUnreadReaction:c,scheduleForViewsIncrement:l}=(0,s.ko)(),{isMobile:u}=(0,fe.Ay)(),h=u?300:500,{observe:m,freeze:p,unfreeze:g}=(0,ve.BL)({rootRef:t,throttleMs:150},t=>{if("thread"!==e||(0,E.g1)())return;let s=0;const u=[],h=[],m=[],p=[],g=[];t.forEach(e=>{const{isIntersecting:t,target:n}=e,{dataset:o}=n,i=Number(o.lastMessageId||o.messageId),a="true"===o.shouldUpdateViews,r=o.albumMainId?Number(o.albumMainId):void 0;t?(i>s&&(s=i),o.hasUnreadMention&&u.push(i),o.hasUnreadReaction&&h.push(i),o.isPinned&&m.push(r||i),a&&g.push(r||i)):o.isPinned&&p.push(r||i)}),a||(n.current&&s>=n.current&&r({maxId:s}),u.length&&d({chatId:i,messageIds:u}),g.length&&l({chatId:i,ids:g})),h.length&&c({messageIds:h}),(m.length||p.length)&&o?.({viewportPinnedIdsToAdd:m,viewportPinnedIdsToRemove:p})});(0,E.Ay)(p,g);const{observe:f}=(0,ve.BL)({rootRef:t,throttleMs:Ae,margin:h}),{observe:v}=(0,ve.BL)({rootRef:t,throttleMs:Ae});return{observeIntersectionForReading:m,observeIntersectionForLoading:f,observeIntersectionForPlaying:v}}(x,k,D,Z,t,$),{withHistoryTriggers:be,backwardsTriggerRef:Se,forwardsTriggerRef:Me,fabTriggerRef:Ne}=function({type:e,containerRef:t,messageIds:n,getContainerHeight:i,isViewportNewest:a,isUnread:d,isReady:l,onScrollDownToggle:u,onNotchToggle:h}){const{loadViewportMessages:m}=(0,s.ko)(),[p,g]=(0,o.Kr)(()=>"thread"===e?[(0,C.sg)(()=>m({direction:r.TN.Backwards}),1e3,!0,!1),(0,C.sg)(()=>m({direction:r.TN.Forwards}),1e3,!0,!1)]:[],[m,n]),f=(0,o.li)(),v=(0,o.li)(),A=(0,o.li)(),y=(0,P.A)(()=>{if(!l)return;if(!n?.length)return u?.(!1),void h?.(!1);if(!a)return u?.(!0),void h?.(!0);const e=t.current,o=A.current;if(!e||!o)return;const{offsetHeight:i,scrollHeight:s,scrollTop:r}=e,c=o.offsetTop,m=Math.round(c-r-i),p=m<=50,g=m<=1;0!==s&&(u?.(d?!g:!p),h?.(!g))}),{observe:w}=(0,ve.BL)({rootRef:t,margin:ge.et},e=>{g&&p&&e.forEach(({isIntersecting:e,target:t})=>{e&&("backwards-trigger"===t.className&&p(),"forwards-trigger"===t.className&&g())})}),I=n&&n.length>1;(0,ve.mv)(f,I?w:void 0),(0,ve.mv)(v,I?w:void 0);const{observe:b,freeze:S,unfreeze:M}=(0,ve.BL)({rootRef:t,margin:100,throttleScheduler:c.YS},y);(0,ve.mv)(A,b);const{observe:N,freeze:Y,unfreeze:k}=(0,ve.BL)({rootRef:t,margin:1,throttleScheduler:c.YS},y);(0,ve.mv)(A,N),(0,o.vJ)(()=>{l&&y()},[l]),(0,o.vJ)(()=>{const e=t.current;if(e)return e.addEventListener("scrollend",y),()=>{e.removeEventListener("scrollend",y)}},[t]);const F=(0,P.A)(()=>{S(),Y(),setTimeout(()=>{k(),M()},350)});(0,L.A)(F,[F,n]);const T=(0,ye.D7)(i,200);return(0,Ce.R)(F,[F,T]),{withHistoryTriggers:I,backwardsTriggerRef:f,forwardsTriggerRef:v,fabTriggerRef:A}}({type:x,containerRef:k,messageIds:i,getContainerHeight:m,isViewportNewest:p,isUnread:f,isReady:B,onScrollDownToggle:W,onNotchToggle:Q}),Ye=(0,z.A)(),ke=(0,_.A)(),Fe=(0,j.Y)("div",{className:(0,g.A)("unread-divider","local-action-message"),children:(0,j.Y)("span",{children:Ye("UnreadMessages")})},"unread-messages"),Te=(e,t)=>{if(e.paidMessageStars){const n=t?.messages?.length||1,o=e.paidMessageStars*n;return(0,j.Y)("div",{className:(0,g.A)("local-action-message"),children:(0,j.Y)("span",{children:e.isOutgoing?ke("ActionPaidOneMessageOutgoing",{amount:(0,ue.Kk)(ke,o)}):(()=>{const t=(0,u.Y7C)((0,s.mS)(),e),n=t?(0,ce.F9)(ke,t):"";return ke("ActionPaidOneMessageIncoming",{user:n,amount:(0,ue.Kk)(ke,o)})})()})},`paid-messages-action-${e.id}`)}},De=e=>{if(e.suggestedPostInfo){const{price:t,scheduleDate:n}=e.suggestedPostInfo,o=(0,u.Y7C)((0,s.mS)(),e),i=o?(0,ce.F9)(ke,o):"",a=(0,he.Nm)(o?.id,i||ke("ActionFallbackUser")),r="message"===e.replyInfo?.type&&e.replyInfo.replyToMsgId?(0,u.O5q)((0,s.mS)(),e.chatId,e.replyInfo.replyToMsgId):void 0,d=(0,l.Do)(e,r)?(0,l.EQ)(ke,e,r,e.isOutgoing,a):e.isOutgoing?ke("ActionSuggestedPostOutgoing",void 0,{withNodes:!0,withMarkdown:!0}):ke("ActionSuggestedPostIncoming",{user:a},{withNodes:!0,withMarkdown:!0}),c=(0,v.oE)([[ke("TitlePrice"),t?"TON"===t.currency?(0,ue.QH)(ke,(0,le.wD)(t.amount)):(0,ue.Kk)(ke,t.amount):ke("SuggestMessageNoPrice")],[ke("TitleTime"),n?(0,b.e0)(n,ke,Ye):ke("SuggestMessageAnytime")]]);return(0,j.Y)("div",{className:(0,g.A)("local-action-message"),children:(0,j.FD)("span",{className:Ge.A.suggestedPostContainer,children:[(0,j.Y)("div",{className:Ge.A.suggestedPostTitle,children:d}),Boolean(c.length)&&(0,j.Y)(ee.A,{className:Ge.A.suggestedPostInfo,data:c})]})},`suggested-post-action-${e.id}`)}},xe=J?0:h.reduce((e,t)=>e+t.senderGroups.flat().length,0);let Le=0;const Ee=(0,pe.A)(i),Be=Boolean(i&&Ee&&i[i.length-2]===Ee[Ee.length-1]),Re=h.map((e,t,o)=>{const i=function(e,t,o){return e.senderGroups.map((e,i,s)=>{if(1===e.length&&!S(e[0])&&(0,l._P)(e[0])&&"phoneCall"!==e[0].content.action?.type){const a=e[0],r=i===s.length-1&&t===o.length-1;return(0,v.oE)([a.id===T.current&&Fe,(0,j.Y)(we.A,{message:a,threadId:n,observeIntersectionForBottom:se,observeIntersectionForLoading:ae,observeIntersectionForPlaying:re,memoFirstUnreadIdRef:D,appearanceOrder:xe-++Le,isJustAdded:r&&Be,isLastInList:r,getIsMessageListReady:ne,onIntersectPinnedMessage:Z},a.id)])}let r;const d=e.map((d,c)=>{const u=S(d)?d.mainMessage:d,h=S(d)?d:void 0,m=(0,l.Ie)(u),p=S(d),g=e[c+1];u.previousLocalId&&F.current===(0,l.GZ)(u.previousLocalId)&&(F.current=(0,l.GZ)(u.id));const f=!p&&u.groupedId?u.groupedId:void 0,y=g&&!S(g)?g.groupedId:void 0,C=u.id===n,b={isFirstInGroup:0===c,isLastInGroup:c===e.length-1,isFirstInDocumentGroup:Boolean(f&&f!==r),isLastInDocumentGroup:Boolean(f&&f!==y),isLastInList:c===e.length-1&&i===s.length-1&&t===o.length-1};r=f;const N=(0,l.sj)(u),k=(0,l.u7)(u)?`${u.date}_${N}`:N,P=!1===R||!I||Boolean(M);return(0,v.oE)([u.id===T.current&&Fe,u.paidMessageStars&&!w&&Te(u,h),u.suggestedPostInfo&&De(u),(0,j.Y)(Ie.A,{message:u,observeIntersectionForBottom:se,observeIntersectionForLoading:ae,observeIntersectionForPlaying:re,album:h,noAvatars:Y,withAvatar:b.isLastInGroup&&w&&!m&&(!C||!A),withSenderName:b.isFirstInGroup&&w&&!m,threadId:n,messageListType:x,noComments:P,noReplies:!P||n!==a.l3||"scheduled"===x,appearanceOrder:xe-++Le,isJustAdded:b.isLastInList&&Be,isFirstInGroup:b.isFirstInGroup,isLastInGroup:b.isLastInGroup,isFirstInDocumentGroup:b.isFirstInDocumentGroup,isLastInDocumentGroup:b.isLastInDocumentGroup,isLastInList:b.isLastInList,memoFirstUnreadIdRef:D,onIntersectPinnedMessage:Z,getIsMessageListReady:ne},k)])}).flat();if(!w)return d;const c=e[e.length-1],u=S(c)?c.mainMessage:c,h=(0,l.sj)(u),m=xe-Le,p=u.id===n,g=(0,l.Ie)(u),f=e[0],C=S(f)?f.mainMessage:f,b=(0,l.sj)(C),N=`${b}-${h}`,k=b===h?`message-group-${b}`:`message-group-${b}-${h}`,P=w&&!g&&(!p||!A);return(0,v.oE)([(0,j.Y)(Pe,{id:k,message:u,withAvatar:P,appearanceOrder:m,canPost:H,children:d},N),p&&(0,j.Y)("div",{className:"local-action-message",children:(0,j.Y)("span",{children:Ye(y?A?"NoComments":"NoReplies":"DiscussionStarted")})},`discussion-started-${h}`)])}).flat()}(e,t,o);return(0,j.FD)("div",{className:(0,g.A)("message-date-group",!(K||V)&&0===t&&"first-message-date-group"),onMouseDown:N.l,teactFastList:!0,children:[(0,j.Y)("div",{className:(0,g.A)("sticky-date",oe&&"interactive"),onMouseDown:N.l,onClick:oe?()=>X({selectedAt:e.datetime}):void 0,children:(0,j.FD)("span",{dir:"auto",children:[O&&e.originalDate===d.NkL&&Ye("MessageScheduledUntilOnline"),O&&e.originalDate!==d.NkL&&Ye("MessageScheduledOn",(0,b.F5)(Ye,e.datetime,void 0,!0)),!O&&(0,b.F5)(Ye,e.datetime)]})},"date-header"),i.flat()]},e.datetime)});return(0,j.FD)("div",{className:"messages-container",teactFastList:!0,children:[be&&(0,j.Y)("div",{ref:Se,className:"backwards-trigger"},"backwards-trigger"),U&&(0,j.Y)(de,{chatId:t,hasMessages:!0},`account_info_${t}`),Re.flat(),be&&(0,j.Y)("div",{ref:Me,className:"forwards-trigger"},"forwards-trigger"),(0,j.Y)("div",{ref:Ne,className:"fab-trigger"},"fab-trigger"),p&&(0,j.Y)(Je,{isJustAdded:Be,isFocused:q,className:ie?"with-sponsored":void 0},"bottom-marker"),ie&&(0,j.Y)(Ve,{chatId:t,containerRef:k,observeIntersectionForLoading:ae,observeIntersectionForPlaying:re},t)]})});var qe=n(38102);const He=3*I.$,We=(0,o.ph)(({isChatWithSelf:e,type:t,isGroupChatJustCreated:n,topic:o})=>{const i=(0,z.A)();return"scheduled"===t?function(e){return(0,j.Y)("div",{className:"empty",children:(0,j.Y)("span",{children:e("ScheduledMessages.EmptyPlaceholder")})})}(i):e?function(e){return(0,j.Y)("div",{className:"NoMessages",children:(0,j.FD)("div",{className:"wrapper",children:[(0,j.Y)(X.A,{name:"cloud-download",className:"no-messages-icon"}),(0,j.Y)("h3",{className:"title",children:e("Conversation.CloudStorageInfo.Title")}),(0,j.FD)("ul",{className:"description",children:[(0,j.Y)("li",{children:e("Conversation.ClousStorageInfo.Description1")}),(0,j.Y)("li",{children:e("Conversation.ClousStorageInfo.Description2")}),(0,j.Y)("li",{children:e("Conversation.ClousStorageInfo.Description3")}),(0,j.Y)("li",{children:e("Conversation.ClousStorageInfo.Description4")})]})]})})}(i):n?function(e){return(0,j.Y)("div",{className:"NoMessages",children:(0,j.FD)("div",{className:"wrapper",dir:e.isRtl?"rtl":void 0,children:[(0,j.Y)("h3",{className:"title",children:e("EmptyGroupInfo.Title")}),(0,j.Y)("p",{className:"description",children:e("EmptyGroupInfo.Subtitle")}),(0,j.FD)("ul",{className:"list-checkmarks",children:[(0,j.Y)("li",{children:e("EmptyGroupInfo.Line1")}),(0,j.Y)("li",{children:e("EmptyGroupInfo.Line2")}),(0,j.Y)("li",{children:e("EmptyGroupInfo.Line3")}),(0,j.Y)("li",{children:e("EmptyGroupInfo.Line4")})]})]})})}(i):o?function(e,t){return(0,j.Y)("div",{className:"NoMessages",children:(0,j.FD)("div",{className:"wrapper",children:[(0,j.Y)(qe.A,{topic:t,size:He,className:"no-messages-icon topic-icon"}),(0,j.Y)("h3",{className:"title",children:e("Chat.EmptyTopicPlaceholder.Title")}),(0,j.Y)("p",{className:"description topic-description",children:(0,W.A)(e("Chat.EmptyTopicPlaceholder.Text"),["br"])})]})})}(i,o):(0,j.Y)("div",{className:"empty",children:(0,j.Y)("span",{children:i("NoMessages")})})});var _e=n(58443),Qe=n(64489),Ze=n(85118);const Xe=(0,o.ph)((0,s.EK)((e,{peerId:t})=>{const n=(0,u.SJA)(e),{patternColor:o}=(0,u.Gyz)(e,n)||{};return{patternColor:o,peer:(0,u.PVB)(e,t)}})(function({patternColor:e,peer:t,paidMessagesStars:n}){const o=(0,z.A)(),i=(0,_.A)(),{openPremiumModal:a,openStarsBalanceModal:r}=(0,s.ko)(),d=(0,P.A)(()=>a()),c=(0,P.A)(()=>{r({})});if(t)return(0,j.Y)("div",{className:"J2RfusJI",children:(0,j.FD)("div",{className:"C90W_KKX",children:[(0,j.FD)("div",{className:"Qi7tZATP",children:[(0,j.Y)(Qe.A,{tgsUrl:_e.w.Unlock,size:54,color:e,className:"lfcZJyxp"}),(0,j.Y)(X.A,{name:"comments-sticker",className:"zd5EAc5e"})]}),(0,j.Y)("span",{className:"E_YZ3IQs",children:n?i((0,ce.mO)(t)?"MessagesPlaceholderPaidUser":"MessagesPlaceholderPaidChannel",{peer:(0,ce.F9)(i,t),amount:(0,ue.U2)(i,n,{asFont:!0,className:"C_e1ij6A",containerClassName:"IL_EHscS"})},{withNodes:!0,withMarkdown:!0}):(0,W.A)(o("MessageLockedPremium",(0,ce.F9)(i,t)),["simple_markdown"])}),(0,j.Y)(Ee.A,{color:"translucent-black",size:"default",pill:!0,onClick:n?c:d,className:"Nz8BOo0i",children:n?(0,j.FD)(j.FK,{children:[i("ButtonBuyStars"),(0,j.Y)(Ze.A,{preset:"button"})]}):o("MessagePremiumUnlock")})]})})}));var et=function(e){return e[e.Loading=0]="Loading",e[e.Restricted=1]="Restricted",e[e.StarsRequired=2]="StarsRequired",e[e.PremiumRequired=3]="PremiumRequired",e[e.AccountInfo=4]="AccountInfo",e[e.ContactGreeting=5]="ContactGreeting",e[e.NoMessages=6]="NoMessages",e[e.MessageList=7]="MessageList",e}(et||{});const tt=.5*I.$,nt=(0,C.sg)(e=>e(),200,!1),ot=(0,o.ph)((0,s.EK)((e,{chatId:t,threadId:n,type:o})=>{const i=(0,u.nTw)(e),s=e.currentUserId,r=(0,u.hds)(e,t),c=(0,u.vGo)(e,t);if(!r)return{currentUserId:s};const p=(0,u.vRX)(e,t,n,o),g="scheduled"===o?(0,u.yFI)(e,t):(0,u.zeq)(e,t),v=(0,l.cG)(t,n,s);if(!(n===a.l3||v||r?.isForum||g&&n&&g[Number(n)]))return{currentUserId:s};const A=(0,h._l)(e,t),y=(0,m.G6)(e,r?.restrictionReasons),C=(0,u.yHC)(e,t,v?"saved":"all"),w=(0,u.kdX)(e,t),I=n===a.l3&&!p&&!r.unreadCount&&!w&&C&&!C.groupedId,b=(0,u.yps)(e,t),S=Boolean(c?.settings?.canAddContact),M=c?.settings?.nameChangeDate,N=c?.settings?.photoChangeDate,Y=(0,u.S0q)(e,t,n),k=(0,f.L8)(t)?void 0:(0,u.AWZ)(e,t),P=!(0,u.Vw0)(e,t,n)?.messagesCount,F=!(0,u.g29)(e)||(0,u.vGo)(e,s)?.areAdsEnabled,T=(0,u.trm)(e),D=Boolean(c?.businessIntro),x=e.isAppConfigLoaded,L=(0,u.k2W)(e,t)?.id,E=(0,u.jGY)(e,t)&&!k?.isTranslationDisabled,B=r?.hasAutoTranslation,R=(0,u.Qq_)(e),O=(0,m.Xf)(e),U=O&&O.chatId===t&&O.threadId===n&&O.type===o,{chatId:K,threadId:z,messageId:V}=i.focusedMessage||{},j=K===t&&z===n&&!V;return{isActive:U,areAdsEnabled:F,isChatLoaded:!0,isRestricted:A,restrictionReasons:y,isChannelChat:(0,l.WX)(r),isChatMonoforum:(0,l.Ve)(r),isGroupChat:(0,l.YE)(r),isChannelWithAvatars:r.areProfilesShown,isCreator:r.isCreator,isChatWithSelf:(0,u.nZ4)(e,t),isSystemBotChat:(0,l.DX)(t),isAnonymousForwards:(0,l.Qe)(t),isBot:Boolean(b),isNonContact:S,nameChangeDate:M,photoChangeDate:N,isSynced:e.isSynced,messageIds:p,messagesById:g,firstUnreadId:(0,u.RjD)(e,t,n),isViewportNewest:"thread"!==o||(0,u.haw)(e,t,n),focusingId:w,isSelectModeActive:(0,u.rTV)(e),hasLinkedChat:k?Boolean(k.linkedChatId):void 0,channelJoinInfo:k?.joinInfo,topic:Y,noMessageSendingAnimation:!(0,u.xYJ)(e,"messageSendingAnimations"),isServiceNotificationsChat:t===d.zv8,isForum:r.isForum,isEmptyThread:P,currentUserId:s,isChatProtected:(0,u.ryq)(e,t),lastMessage:I?C:void 0,isAccountFrozen:T,hasCustomGreeting:D,isAppConfigLoaded:x,monoforumChannelId:L,canTranslate:E,translationLanguage:R,shouldAutoTranslate:B,shouldScrollToBottom:j}})(({chatId:e,threadId:t,type:n,isChatLoaded:h,isForum:m,isChannelChat:I,isGroupChat:b,isChannelWithAvatars:S,canPost:z,isSynced:V,isActive:G,shouldScrollToBottom:$,isChatMonoforum:q,isReady:H,isChatWithSelf:W,isSystemBotChat:_,isAnonymousForwards:Q,isCreator:Z,isBot:X,isNonContact:ee,nameChangeDate:te,photoChangeDate:ne,messageIds:oe,messagesById:ie,firstUnreadId:se,isComments:ae,isViewportNewest:re,isRestricted:ce,restrictionReasons:le,isEmptyThread:ue,focusingId:he,isSelectModeActive:me,lastMessage:pe,hasLinkedChat:ge,withBottomShift:fe,withDefaultBg:ve,topic:Ae,noMessageSendingAnimation:ye,isServiceNotificationsChat:Ce,currentUserId:we,isContactRequirePremium:Ie,paidMessagesStars:be,areAdsEnabled:Se,channelJoinInfo:Me,isChatProtected:Ne,isAccountFrozen:Ye,hasCustomGreeting:ke,monoforumChannelId:Pe,isAppConfigLoaded:Fe,canTranslate:Te,translationLanguage:De,shouldAutoTranslate:xe,isQuickPreview:Le,onIntersectPinnedMessage:Ee,onScrollDownToggle:Be,onNotchToggle:Re})=>{const{loadViewportMessages:Oe,setScrollOffset:Ue,loadSponsoredMessages:Ke,loadMessageReactions:ze,copyMessagesByIds:Ve,loadMessageViews:je,loadPeerStoriesByIds:Je,loadFactChecks:Ge,requestChatTranslation:qe}=(0,s.ko)(),He=(0,o.li)(),_e=(0,o.li)("thread"===n&&(0,u.j_4)((0,s.mS)(),e,t)||(0,u.rKQ)((0,s.mS)(),e,t)||0),Qe=(0,o.li)(),Ze=(0,o.li)(),ot=(0,o.li)(),st=(0,o.li)(),at=(0,o.li)(),rt=(0,o.li)(),dt=(0,o.li)(!1),ct=(0,o.li)(Boolean(pe)),lt=(0,l.cG)(e,t,we),ut=lt&&t!==d.Ckz,ht=Boolean(oe),mt=(0,f.L8)(e),pt=Boolean(!mt&&!I||W||_||Q||S);(0,L.A)(()=>{ht&&(0,C.aj)(()=>{ct.current=!1})},[ht]),(0,L.A)(()=>{st.current=se},[se]),(0,o.vJ)(()=>{Se&&(I||X)&&V&&H&&Fe&&Ke({peerId:e})},[e,V,H,I,X,Se,Fe]),(0,L.A)(()=>{ht&&(at.current=st.current)},[ht]),(0,L.A)(()=>{rt.current=he},[he]),(0,o.vJ)(()=>{xe&&Te&&qe({chatId:e,toLanguageCode:De})},[xe,Te,De,e]),(e=>{const t=(0,P.A)(t=>{const n=(0,T.A)();n&&n.length>1&&(t.preventDefault(),e({messageIds:n}))});(0,D.v)((0,o.Kr)(()=>({"Mod+C":t}),[]))})(Ve);const gt=(0,o.Kr)(()=>{if(!oe?.length||!ie)return;const e=[];oe.forEach((t,o,i)=>{const s=e[e.length-1],a=ie[t];if(!a)return;const{shouldAppendJoinMessage:r,shouldAppendJoinMessageAfterCurrent:d}=(()=>{if(Me&&"thread"===n)return s&&s.date<Me.joinedDate&&Me.joinedDate<=a.date?{shouldAppendJoinMessage:!0,shouldAppendJoinMessageAfterCurrent:!1}:o===i.length-1&&a.date<Me.joinedDate?{shouldAppendJoinMessage:!0,shouldAppendJoinMessageAfterCurrent:!0}:void 0})()||{};if(d&&e.push(a),r){const t=d?a.id:s?.id||a.id-1;e.push({id:it(t),chatId:a.chatId,date:Me.joinedDate,isOutgoing:!1,content:{action:{mediaType:"action",type:"channelJoined",inviterId:Me?.inviterId,isViaRequest:Me?.isViaRequest||void 0}}})}d||e.push(a)});const o="scheduled"===n||Ce?["date","id"]:["id"];return e.length?M((0,v.My)(e,o),at.current,m?void 0:Number(t),W,pt):void 0},[pt,oe,ie,n,Ce,m,t,W,Me]);(0,Y.A)(()=>{if(!oe||!ie||"scheduled"===n||Ye||!G)return;if(!I&&!b)return;const t=oe.filter(e=>{const t=ie[e];return t&&t.reactions&&!t.content.action});t.length&&ze({chatId:e,ids:t})},2e4),(0,Y.A)(()=>{if(!oe||!ie||"scheduled"===n||!G)return;const e=oe.map(e=>ie[e]?.content.storyData).filter(Boolean);if(!e.length)return;const t=e.reduce((e,t)=>{const{peerId:n,id:o}=t;return e[n]||(e[n]=[]),e[n].push(o),e},{});Object.entries(t).forEach(([e,t])=>{Je({peerId:e,storyIds:t})})},3e5),(0,Y.A)(()=>{if(!oe||!ie||t!==a.l3||"scheduled"===n||!G)return;const o=(0,s.mS)(),i=oe.filter(t=>(0,u.Vw0)(o,e,t)?.isCommentsInfo||void 0!==ie[t]?.viewsCount);i.length&&je({chatId:e,ids:i})},2e4,!0),(0,Y.A)(()=>{if(!oe||!ie||t!==a.l3||"scheduled"===n||!G)return;const o=oe.filter(e=>ie[e]?.factCheck?.shouldFetch);o.length&&Ge({chatId:e,ids:o})},5e3);const ft=(0,o.Kr)(()=>{if("thread"===n)return(0,C.sg)(()=>Oe({direction:r.TN.Around,chatId:e,threadId:t}),1e3,!0,!1)},[Oe,oe]),{isScrolled:vt,updateStickyDates:At}=function(){const[e,t]=(0,R.A)(!1),n=(0,O.A)(1e3,!0);return{isScrolled:e,updateStickyDates:(0,P.A)(e=>{t(),document.body.classList.contains("is-scrolling-messages")||(0,c.RK)(()=>{document.body.classList.add("is-scrolling-messages")}),n(()=>{const t=function(e){const t=e.querySelectorAll(".sticky-date"),n=e.scrollTop,o=getComputedStyle(e),i=parseInt(o.getPropertyValue("--middle-header-panes-height"),10);return Array.from(t).find(e=>{const{offsetTop:t,offsetHeight:o}=e,s=t-n;return-o<=s&&s<=i+10})}(e);(0,c.RK)(()=>{const e=document.querySelector(".stuck");e&&e.classList.remove("stuck"),t&&t.classList.add("stuck"),document.body.classList.remove("is-scrolling-messages")})})})}}(),yt=(0,P.A)(()=>{if(dt.current)return void(dt.current=!1);const o=He.current;o&&(rt.current||At(o),nt(()=>{const i=(0,s.mS)();Boolean((0,u.nTw)(i).focusedMessage?.chatId)||Ee?.({shouldCancelWaiting:!0}),o.parentElement&&(_e.current=o.scrollHeight-o.scrollTop,"thread"!==n||Le||Ue({chatId:e,threadId:t,scrollOffset:_e.current}))}))}),[Ct,wt]=function(e,t){const[n,i]=(0,o.Ul)(),s=(0,P.A)(e=>{i(e.contentRect.height)});(0,B.A)(e,s),(0,o.vJ)(()=>{const o=Number(e.current.dataset.normalHeight)||0,i=n();i&&i>o&&t&&(e.current.dataset.normalHeight=String(i))},[t,e,n]);const a=(0,o.li)();return[n,a]}(He,z&&!me);(0,o.vJ)(()=>{if(!ft||!h||ce||he)return;if(oe&&(0,A.iL)(oe[oe.length-1]))return;const e=He.current;(!oe||1===oe.length||oe.length<d.yo2/2&&e.firstElementChild.clientHeight<=e.offsetHeight)&&ft()},[h,oe,ft,he,ce]);const It=(0,x.i)(()=>{if(!oe||!ot.current)return;const e=ot.current.filter(e=>oe.includes(Number(e.dataset.messageId))),t=e[1]||e[0];t&&(Qe.current=t.id,Ze.current=t.getBoundingClientRect().top)});(0,L.A)(()=>(0,c.Uj)(()=>It.current()),[oe,re,It]),(0,o.vJ)(()=>It.current(),[Ct,It]),(0,F.A)(([e,t])=>{const n=Ct(),o=wt.current;if(wt.current=n,oe===e&&re===t&&n!==o&&void 0===o)return;const s=He.current;ot.current=Array.from(s.querySelectorAll(".message-list-item"));const a=ot.current[ot.current.length-1],r=st.current?s.querySelector(`#${(0,l.GZ)(st.current)}`):void 0,u=oe&&e&&oe[oe.length-1]!==e[e.length-1],h=oe?.[0]!==e?.[0]&&oe?.length===d.yo2/2+1,m=u&&!h;re&&m&&oe&&oe.length<d.yo2/2&&!s.parentElement.classList.contains("force-messages-scroll")&&(0,c.Uj)(()=>s.firstElementChild.clientHeight<=2*s.offsetHeight)&&((0,i.YM)(s.parentElement,"force-messages-scroll"),s.parentElement.classList.add("force-messages-scroll"),setTimeout(()=>{s.parentElement&&(0,i.HW)(s.parentElement,"force-messages-scroll")},500)),(0,c.gm)(()=>{const{scrollTop:e,scrollHeight:i,offsetHeight:d}=s,l=_e.current;let u=l-(o||d);m&&(u-=a?a.offsetHeight:0);const h=re&&t&&u<=50,g=oe&&rt.current===oe[oe.length-1];m&&h&&!g&&(0,c.YS)(()=>{const e=!(0,E.g1)()||!r;(0,p.Ay)({container:s,element:e?a:r,position:e?"end":"start",margin:tt,forceDuration:ye?0:void 0})});const f=void 0!==o&&o!==n;if(f&&(0,p.o8)())return;const v=Qe.current&&s.querySelector(`#${Qe.current}`),A=!v&&at.current&&s.querySelector(".unread-divider");let C;if(h&&f)C=i-d;else if(v){const t=v.getBoundingClientRect().top;C=e+(t-(Ze.current||0))}else C=A?Math.min((0,w.A)(A,s).top-10,i-l):i-l;return()=>{(0,y.A)(s,Math.ceil(C)),(0,p._v)(),_e.current=Math.max(Math.ceil(i-C),d),rt.current||(dt.current=!0,(0,c.YS)(()=>{dt.current=!1}))}})},[oe,re,Ct,wt,ye]),(0,k.A)(([e])=>{void 0!==e&&(0,o.VK)(200+d.xB5)},[me]);const bt=Boolean(!pt||I&&!S),St=(0,f.L8)(e)&&!W&&!X&&!Q&&"thread"===n&&(!gt&&!pe&&oe&&(!ot.current||0===ot.current.length)||1===oe?.length&&"contactSignUp"===ie?.[oe[0]]?.content.action?.type||"contactSignUp"===pe?.content?.action?.type),Mt=b&&Z&&1===oe?.length&&"chatCreate"===ie?.[oe[0]]?.content.action?.type,Nt=1===oe?.length&&"topicCreate"===ie?.[oe[0]]?.content.action?.type,Yt=(0,g.A)("MessageList custom-scroll",bt&&"no-avatars",!z&&"no-composer","pinned"===n&&"type-pinned",fe&&"with-bottom-shift",ve&&"with-default-bg",me&&"select-mode-active",vt&&"scrolled",!H&&"is-animating",ut&&"saved-dialog",Ne&&"hide-on-print"),kt=Boolean(oe&&gt||pe);(0,o.vJ)(()=>{kt||Be?.(!1)},[kt,Be]);const Pt=ce?et.Restricted:!be||kt||ke?Ie&&!kt?et.PremiumRequired:!X&&!ee||kt?St?et.ContactGreeting:oe&&(!gt||Mt||Nt)?et.NoMessages:kt?et.MessageList:et.Loading:et.AccountInfo:et.StarsRequired;return(0,j.Y)(K.Ay,{ref:He,className:Yt,name:"fade",activeKey:Pt,shouldCleanup:!0,onScroll:yt,onMouseDown:N.l,children:Pt===et.Restricted?(0,j.Y)("div",{className:"empty",children:(0,j.Y)("span",{children:le?.[0]?.text||"This is a private "+(I?"channel":"chat")})}):Pt===et.StarsRequired?(0,j.Y)(Xe,{paidMessagesStars:be,peerId:Pe||e}):Pt===et.PremiumRequired?(0,j.Y)(Xe,{peerId:e}):Pt===et.AccountInfo?(0,j.Y)(de,{chatId:e,hasMessages:kt}):Pt===et.ContactGreeting?(0,j.Y)(J,{userId:e},e):Pt===et.NoMessages?(0,j.Y)(We,{chatId:e,topic:Ae,type:n,isChatWithSelf:W,isGroupChatJustCreated:Mt}):Pt===et.MessageList?(0,j.Y)($e,{canShowAds:Se&&I,chatId:e,isComments:ae,isChannelChat:I,isChatMonoforum:q,isSavedDialog:lt,messageIds:oe||[pe.id],messageGroups:gt||M([pe]),getContainerHeight:Ct,isViewportNewest:Boolean(re),isUnread:Boolean(se),isEmptyThread:ue,withUsers:pt,noAvatars:bt,containerRef:He,anchorIdRef:Qe,memoUnreadDividerBeforeIdRef:at,memoFirstUnreadIdRef:st,threadId:t,type:n,isReady:H,hasLinkedChat:ge,isSchedule:!!gt&&"scheduled"===n,shouldRenderAccountInfo:X||ee,nameChangeDate:te,photoChangeDate:ne,noAppearanceAnimation:!gt||!ct.current,isQuickPreview:Le,canPost:z,shouldScrollToBottom:$,onScrollDownToggle:Be,onNotchToggle:Re,onIntersectPinnedMessage:Ee}):(0,j.Y)(U.A,{color:"white",backgroundColor:"dark"})})}));function it(e){return e+1e-6}},47058:(e,t,n)=>{n.d(t,{A:()=>g});var o=n(84051),i=n(13439),s=n(87357),a=n(85982),r=n(43874),d=n(17712),c=n(59030),l=n(64493),u=n(22699),h=n(24433),m=n(18276);var p=n(20021);const g=(0,o.ph)(({title:e,link:t,isDisabled:n,className:g,withShare:f,onRevoke:v})=>{const A=(0,c.A)(),{showNotification:y,openChatWithDraft:C}=(0,i.ko)(),{isMobile:w}=(0,r.Ay)(),I=!v,b=(0,d.A)(()=>{(0,a.eM)(t),y({message:{key:"LinkCopied"}})}),S=(0,d.A)(()=>{n||b()}),M=(0,d.A)(()=>{C({text:{text:t}})}),N=(0,o.Kr)(()=>({onTrigger:e,isOpen:t})=>(0,p.Y)(l.A,{round:!0,ripple:!w,size:"smaller",color:"translucent",className:t?"active":"",onClick:e,ariaLabel:A("AccDescrOpenMenu2"),children:(0,p.Y)(m.A,{name:"more"})}),[w,A]);return(0,p.FD)("div",{className:g,children:[(0,p.Y)("p",{className:"vCMpiQTJ",children:A(e||"InviteLink.InviteLink")}),(0,p.FD)("div",{className:"xNjJHI7j",children:[(0,p.Y)("input",{className:(0,s.A)("form-control","Ag6k_p7b"),value:t,readOnly:!0,onClick:S}),I?(0,p.Y)(l.A,{color:"translucent",className:"obuPXobw",size:"smaller",round:!0,disabled:n,onClick:S,children:(0,p.Y)(m.A,{name:"copy"})}):(0,p.FD)(u.A,{className:"p7t3macG",trigger:N,positionX:"right",children:[(0,p.Y)(h.A,{icon:"copy",onClick:S,disabled:n,children:A("Copy")}),v&&(0,p.Y)(h.A,{icon:"delete",onClick:v,destructive:!0,children:A("RevokeButton")})]})]}),f&&(0,p.Y)(l.A,{disabled:n,onClick:M,className:"Sbagy_Tm",children:A("FolderLinkScreen.LinkActionShare")})]})})},47067:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(84051),i=n(13439),s=n(31481),a=n(90709),r=n(63495),d=n(96454),c=n(48899),l=n(87894),u=n(39351);const h=({chat:e,user:t,folderId:n,isPinned:h,isMuted:m,canChangeFolder:p,isSavedDialog:g,currentUserId:f,isPreview:v,topics:A,handleDelete:y,handleMute:C,handleUnmute:w,handleChatFolderChange:I,handleReport:b},S=!1)=>{const M=(0,u.A)(),{isSelf:N}=t||{},Y=t?.id===s.zv8,k=(0,o.Kr)(()=>{if(e)return g?M("Delete"):(0,c.L8)(e.id)||(0,a.IC)(e)?M("DeleteChat"):(0,a.WX)(e)?M("ChannelLeave"):M("GroupLeaveGroup")},[e,g,M]);return(0,o.Kr)(()=>{if(!e||v)return;const{toggleChatPinned:o,toggleSavedDialogPinned:s,toggleChatArchived:c,markChatMessagesRead:u,markChatUnread:P,openChatInNewTab:F,openQuickPreview:T}=(0,i.ko)(),D=d.OS&&{title:r.Vq?M("ChatListOpenInNewWindow"):M("ChatListOpenInNewTab"),icon:"open-in-new-tab",handler:()=>{F(g?{chatId:f,threadId:e.id}:{chatId:e.id})}},x=!g&&!e.isForum&&{title:M("QuickPreview"),icon:"eye-outline",handler:()=>{T({id:e.id})}},L=()=>{g?s({id:e.id}):o({id:e.id,folderId:n})},E=h?{title:M("ChatListUnpinFromTop"),icon:"unpin",handler:L}:{title:M("ChatListPinToTop"),icon:"pin",handler:L},B={title:k,icon:"delete",destructive:!0,handler:y};if(g)return(0,l.oE)([D,x,E,B]);const R=p?{title:M("ChatListContextAddToFolder"),icon:"folder",handler:I}:void 0,O=m?{title:M("ChatsUnmute"),icon:"unmute",handler:w}:{title:`${M("ChatsMute")}...`,icon:"mute",handler:C};if(S)return(0,l.oE)([D,x,E,R,O]);const U=e.unreadCount||e.hasUnreadMark||Object.values(A||{}).some(({unreadCount:e})=>e)?{title:M("ChatListContextMaskAsRead"),icon:"readchats",handler:()=>u({id:e.id})}:void 0,K=e.unreadCount||e.hasUnreadMark||e.isForum?void 0:{title:M("ChatListContextMaskAsUnread"),icon:"unread",handler:()=>P({id:e.id})},z=(0,a.TJ)(e)?{title:M("Unarchive"),icon:"unarchive",handler:()=>c({id:e.id})}:{title:M("Archive"),icon:"archive",handler:()=>c({id:e.id})},V=b&&!t&&((0,a.WX)(e)||(0,a.YE)(e))?{title:M("ReportPeerReport"),icon:"flag",handler:b}:void 0,j=void 0!==n;return(0,l.oE)([D,x,R,U,K,E,!N&&O,!N&&!Y&&!j&&z,V,B])},[e,t,p,M,I,h,S,m,f,y,C,b,n,N,Y,g,k,v,A,w])}},47526:(e,t,n)=>{n.d(t,{KE:()=>d,PP:()=>c,_u:()=>r,zS:()=>a});const o={google:"https://maps.google.com/maps",bing:"https://bing.com/maps/default.aspx",osm:"https://www.openstreetmap.org",apple:"https://maps.apple.com"},i=new Map(Object.entries({"building/medical":"#43b3f4","building/gym":"#43b3f4","education/cafeteria":"#f7943f","travel/bedandbreakfast":"#9987ff","travel/hotel":"#9987ff","travel/hostel":"#9987ff","travel/resort":"#9987ff","travel/hotel_bar":"#e56dd6",arts_entertainment:"#e56dd6",building:"#6e81b2",education:"#a57348",event:"#959595",food:"#f7943f",home:"#00aeef",nightlife:"#e56dd6",parks_outdoors:"#6cc039",shops:"#ffb300",travel:"#1c9fff",work:"#ad7854"})),s=["#e56cd5","#f89440","#9986ff","#44b3f5","#6dc139","#ff5d5a","#f87aad","#6e82b3","#f5ba21"];function a(e,t,n=15){const{lat:i,long:s}=t,a=o[e];switch(e){case"google":return`${a}/place/${i}+${s}/@${i},${s},${n}z`;case"bing":return`${a}?cp=${i}~${s}&lvl=${n}&sp=point.${i}_${s}`;case"apple":return`${a}?q=${i},${s}`;default:return`${a}/?mlat=${i}&mlon=${s}&zoom=${n}`}}function r(e,t){return 156543.03392*Math.cos(e*(Math.PI/180))/2**t}function d(e){return e?`https://ss3.4sqi.net/img/categories_v2/${e}_88.png`:""}function c(e){return e?i.get(e)||i.get(e.split("/")[0])||s[(t=e,t.split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0)%s.length)]:"#008df2";var t}},48227:(e,t,n)=>{n.d(t,{A:()=>c});var o=n(84051),i=n(48775),s=n(39351),a=n(19806),r=n(94189);var d=n(20021);const c=(0,o.ph)(({isOpen:e,onClose:t,userName:n,messagePriceInStars:o,messagesCount:c,shouldAutoApprove:l,setAutoApprove:u,confirmHandler:h})=>{const m=(0,s.A)(),p=m("ConfirmationModalPaymentForMessage",{user:n,amount:(0,i.Kk)(m,o),totalAmount:(0,i.Kk)(m,o*c),count:c},{withMarkdown:!0,withNodes:!0,pluralValue:c}),g=m("PayForMessage",{count:c},{withNodes:!0,pluralValue:c});return(0,d.FD)(r.A,{title:m("TitleConfirmPayment"),confirmLabel:g,isOpen:e,onClose:t,confirmHandler:h,children:[p,(0,d.Y)(a.A,{className:"eScpikxM",label:m("DoNotAskAgain"),checked:l,onCheck:u})]})})},48553:(e,t,n)=>{n.d(t,{A:()=>M});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(66644),d=n(90709),c=n(91048),l=n(96454),u=n(48899),h=n(97822),m=n(2178),p=n(17712),g=n(59030),f=n(18276),v=n(64493),A=n(22699),y=n(24433),C=n(60859),w=n(80089),I=n(80464),b=n(20021);const S=e=>{const{isOpen:t}=e,n=(0,I.A)(w.ar.Extra,"HeaderMenuContainer",!t);return n?(0,b.Y)(n,{...e}):void 0},M=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n,messageListType:o,isMobile:i})=>{const a=(0,c.hds)(e,t),r=Boolean(a&&(0,d.WX)(a)),h=Boolean(a&&(0,d.Vs)(a)),m=(0,c.wmb)(e),p=(0,c.Qq_)(e),g=(0,u.L8)(t),{doNotTranslate:f}=e.settings.byKey,v=(0,c._ls)(e,t);if(!a||v||(0,c.rTV)(e))return{noMenu:!0,language:m,translationLanguage:p,doNotTranslate:f};const A=(0,c.yps)(e,t),y=g?void 0:(0,c.AWZ)(e,t),C=g?(0,c.vGo)(e,t):void 0,w=y||C,I=(0,c.nZ4)(e,t),b="thread"===o&&n===s.l3,S="thread"===o&&n!==s.l3,M=(0,c.gjV)(e,i),N=(0,d.cG)(t,n,e.currentUserId),Y=!!g&&(0,c.apd)(e,t),k=Boolean(A&&Y),P=!k&&Boolean((0,c.I_m)(e,t)),F=Y&&!A,T=Boolean((b||a.isForum)&&(r||h)&&a.isNotJoined&&!a.isMonoforum),D=b||S,x=l.OL&&(0,u.L8)(a.id)&&!I&&!A&&!a.isSupport&&!(0,d.Qe)(a.id),L=b&&!I&&!T,E=N||b&&!T,B=l.OL&&b&&a.isCallActive,R=l.OL&&b&&!a.isCallActive&&(a.adminRights?.manageCall||a.isCreator&&(0,d.yn)(a))&&!a.isMonoforum,O=b&&y?.canViewStatistics,U=b&&y?.canViewMonetization,K=b&&!a.isMonoforum&&(h||r)&&(O||(0,d.ub)(a,"postStories")),z=!K&&(h||r)&&!a.isMonoforum,V=b?y?.requestsPending:void 0,j=Boolean(a?.isNotJoined&&a.isJoinToSend),J=Boolean(a?.isNotJoined&&a.isJoinRequest),G=!(0,c.PKK)(e),$=Boolean((0,c.qZq)(e,t)),q=(0,c.jGY)(e,t)&&!w?.isTranslationDisabled,H=(0,c.trm)(e),W=(0,d.WX)(a)?a.linkedMonoforumId:void 0;return{noMenu:!1,isChannel:r,isRightColumnShown:M,canStartBot:P,canRestartBot:k,canSubscribe:T,canSearch:D,canCall:x,canMute:L,canViewStatistics:O,canViewMonetization:U,canViewBoosts:K,canShowBoostModal:z,canLeave:E,canEnterVoiceChat:B,canCreateVoiceChat:R,pendingJoinRequests:V,shouldJoinToSend:j,shouldSendJoinRequest:J,noAnimation:G,canTranslate:q,isTranslating:$,translationLanguage:p,language:m,doNotTranslate:f,detectedChatLanguage:a.detectedLanguage,canUnblock:F,isAccountFrozen:H,channelMonoforumId:W}})(({chatId:e,threadId:t,noMenu:n,isMobile:s,isChannel:d,canStartBot:c,canRestartBot:u,canUnblock:h,canSubscribe:w,canSearch:I,canCall:M,canMute:Y,canViewStatistics:k,canViewMonetization:P,canViewBoosts:F,canShowBoostModal:T,canLeave:D,canEnterVoiceChat:x,canCreateVoiceChat:L,channelMonoforumId:E,pendingJoinRequests:B,isRightColumnShown:R,isForForum:O,canExpandActions:U,shouldJoinToSend:K,shouldSendJoinRequest:z,noAnimation:V,canTranslate:j,isTranslating:J,translationLanguage:G,language:$,detectedChatLanguage:q,doNotTranslate:H,isAccountFrozen:W,onTopicSearch:_})=>{const{joinChannel:Q,sendBotCommand:Z,openMiddleSearch:X,restartBot:ee,requestMasterAndRequestCall:te,requestNextManagementScreen:ne,showNotification:oe,openChat:ie,requestChatTranslation:se,togglePeerTranslations:ae,openChatLanguageModal:re,setSettingOption:de,unblockUser:ce,setViewForumAsMessages:le,openFrozenAccountModal:ue}=(0,i.ko)(),he=(0,o.li)(),me=(0,g.A)(),[pe,ge]=(0,o.J0)(!1),[fe,ve]=(0,o.J0)(void 0),Ae=(0,p.A)(()=>{ge(!0);const e=he.current.getBoundingClientRect();ve({x:e.right,y:e.bottom})}),ye=(0,p.A)(()=>{ge(!1)}),Ce=(0,p.A)(()=>{ve(void 0)}),we=(0,p.A)(()=>{Q({chatId:e}),z&&oe({message:me(d?"RequestToJoinChannelSentDescription":"RequestToJoinGroupSentDescription")})}),Ie=(0,p.A)(()=>{Z({command:"/start"})}),be=(0,p.A)(()=>{ee({chatId:e})}),Se=(0,p.A)(()=>{ce({userId:e})}),Me=(0,p.A)(()=>{se(J?{chatId:e,toLanguageCode:void 0}:{chatId:e,toLanguageCode:G})}),Ne=(0,p.A)(()=>{ne({screen:a.je.JoinRequests})}),Ye=(0,p.A)(()=>{O?_?.():(X(),V?(0,r.YS)(()=>{(0,r.Uz)(N)}):N())}),ke=(0,p.A)(()=>{ie({id:e}),le({chatId:e,isEnabled:!0})}),Pe=(0,p.A)(()=>{W?ue():te({userId:e})}),Fe=(0,p.A)(e=>{I&&l.lE&&!e.shiftKey&&(e.preventDefault(),Ye())}),Te=(0,o.hb)((e,t)=>{const n=`TranslateLanguage${t.split("-")[0].toUpperCase()}`,o=me(n);if(o!==n)return me(e,o);const i=new Intl.DisplayNames([$],{type:"language"}).of(t);return me(`${e}Other`,i)},[$,me]),De=(0,o.Kr)(()=>J?me("ShowOriginalButton"):Te("TranslateToButton",G),[G,Te,J,me]),xe=(0,o.Kr)(()=>{if(q)return Te("DoNotTranslateLanguage",q)},[Te,q]),Le=(0,p.A)(()=>{ae({chatId:e,isEnabled:!1}),se({chatId:e,toLanguageCode:void 0})}),Ee=(0,p.A)(()=>{re({chatId:e})}),Be=(0,p.A)(()=>{q&&(de({doNotTranslate:[...H,q]}),se({chatId:e,toLanguageCode:void 0}),oe({message:Te("AddedToDoNotTranslate",q)}))});(0,m.v)((0,o.Kr)(()=>({"Mod+F":Fe}),[]));const Re=(0,o.Kr)(()=>({onTrigger:e,isOpen:t})=>(0,b.Y)(v.A,{round:!0,ripple:R,color:"translucent",size:"smaller",className:t?"active":"",onClick:e,ariaLabel:me("TranslateMessage"),children:(0,b.Y)(f.A,{name:"language"})}),[R,me]);return(0,b.FD)("div",{className:"HeaderActions",children:[!O&&j&&(0,b.FD)(A.A,{className:"stickers-more-menu with-menu-transitions",trigger:Re,positionX:"right",children:[(0,b.Y)(y.A,{icon:"language",onClick:Me,children:De}),(0,b.Y)(y.A,{icon:"replace",onClick:Ee,children:me("Chat.Translate.Menu.To")}),(0,b.Y)(C.A,{}),q&&(0,b.Y)(y.A,{icon:"hand-stop",onClick:Be,children:xe}),(0,b.Y)(y.A,{icon:"close-circle",onClick:Le,children:me("Hide")})]}),!s&&(0,b.FD)(b.FK,{children:[U&&!z&&(w||K)&&(0,b.Y)(v.A,{size:"smaller",ripple:!0,fluid:!0,onClick:we,children:me(d?"ProfileJoinChannel":"ProfileJoinGroup")}),U&&z&&(0,b.Y)(v.A,{size:"smaller",ripple:!0,fluid:!0,onClick:we,children:me("ChannelJoinRequest")}),U&&c&&(0,b.Y)(v.A,{size:"smaller",ripple:!0,fluid:!0,onClick:Ie,children:me("BotStart")}),U&&u&&(0,b.Y)(v.A,{size:"tiny",ripple:!0,fluid:!0,onClick:be,children:me("BotRestart")}),U&&h&&(0,b.Y)(v.A,{size:"smaller",ripple:!0,fluid:!0,onClick:Se,children:me("Unblock")}),I&&(0,b.Y)(v.A,{round:!0,ripple:R,color:"translucent",size:"smaller",onClick:Ye,ariaLabel:me("Conversation.SearchPlaceholder"),children:(0,b.Y)(f.A,{name:"search"})}),M&&(0,b.Y)(v.A,{round:!0,color:"translucent",size:"smaller",onClick:Pe,ariaLabel:"Call",children:(0,b.Y)(f.A,{name:"phone"})})]}),!O&&Boolean(B)&&(0,b.FD)(v.A,{round:!0,className:"badge-button",ripple:R,color:"translucent",size:"smaller",onClick:Ne,ariaLabel:me(d?"SubscribeRequests":"MemberRequests"),children:[(0,b.Y)(f.A,{name:"user"}),(0,b.Y)("div",{className:"badge",children:B})]}),(0,b.Y)(v.A,{ref:he,className:pe?"active":"",round:!0,ripple:!s,size:"smaller",color:"translucent",disabled:n,ariaLabel:"More actions",onClick:Ae,children:(0,b.Y)(f.A,{name:"more"})}),fe&&(0,b.Y)(S,{chatId:e,threadId:t,isOpen:pe,anchor:fe,withExtraActions:s||!U,isChannel:d,canStartBot:c,canSubscribe:w,canSearch:I,canCall:M,canMute:Y,canViewStatistics:k,canViewBoosts:F,canViewMonetization:P,canShowBoostModal:T,canLeave:D,canEnterVoiceChat:x,canCreateVoiceChat:L,pendingJoinRequests:B,onJoinRequestsClick:Ne,withForumActions:O,channelMonoforumId:E,onSubscribeChannel:we,onSearchClick:Ye,onAsMessagesClick:ke,onClose:ye,onCloseAnimationEnd:Ce})]})}));function N(){const e=document.querySelector("#MiddleSearch input");e&&(0,h.A)(e)}},48885:(e,t,n)=>{n.d(t,{A:()=>h,S:()=>m});var o=n(84051),i=n(61433),s=n(66644),a=n(14737),r=n(17712),d=n(93545),c=n(672);const l=450,u=100;function h({ref:e,isOpen:t,isDisabled:n,withResizeObserver:i,onStateChange:h}){const[m,p]=(0,o.J0)(t),g=(0,o.li)(),f=e||g,v=(0,o.li)(0),A=(0,r.A)(()=>{p(!0),h?.({element:void 0,height:0,isOpen:!1})});(0,o.vJ)(()=>{n&&A()},[n]),(0,o.vJ)(()=>{t&&p(!0)},[t]),(0,o._W)(A),(0,a.A)(()=>{p(!1),h?.({height:0,isOpen:!1})},t?void 0:l);const y=(0,o.hb)(()=>{const e=f.current;!n&&e&&m&&(t?(0,s.gm)(()=>{const n=e.offsetHeight;return v.current=n,()=>{h?.({element:e,height:n,isOpen:t})}}):h?.({element:e,height:0,isOpen:!1}))},[t,m,n,f,h]),C=(0,c.A)(()=>{const e=f.current;e&&e.offsetHeight!==v.current&&y()},[y,f],u,!0);return(0,o.Nf)(y,[y]),(0,d.A)(f,C,!i||!m),{shouldRender:m,ref:f}}function m(e,t=!1){let n=0;for(let o=0;o<e.length;o++){const a=e[o],r=a.element;if(!r)continue;const d=`${n}px`,c=()=>{(0,i.Tv)(r,{transform:`translateY(${a.isOpen?d:`calc(${d} - 100%)`})`,zIndex:String(-o),transition:t?"none":""})};r.dataset.isPanelOpen||!a.isOpen||t?c():((0,i.Tv)(r,{transform:`translateY(calc(${d} - 100%))`,zIndex:String(-o),transition:"none"}),r.dataset.isPanelOpen="true",(0,s.Uz)(c)),n+=a.height}}},48906:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(20021);const i=function({isOwn:e}){const t=e?"M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z":"M3 17h6V0c-.193 2.84-.876 5.767-2.05 8.782-.904 2.325-2.446 4.485-4.625 6.48A1 1 0 003 17z";return(0,o.FD)("svg",{width:"9",height:"20",className:"svg-appendix",children:[(0,o.Y)("defs",{children:(0,o.FD)("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"messageAppendix",children:[(0,o.Y)("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,o.Y)("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,o.Y)("feColorMatrix",{values:"0 0 0 0 0.0621962482 0 0 0 0 0.138574144 0 0 0 0 0.185037364 0 0 0 0.15 0",in:"shadowBlurOuter1"})]})}),(0,o.FD)("g",{fill:"none","fill-rule":"evenodd",children:[(0,o.Y)("path",{d:t,fill:"#000",filter:"url(#messageAppendix)"}),(0,o.Y)("path",{d:t,fill:e?"#EEFFDE":"FFF",className:"corner"})]})]})}},49068:(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,"EmojiTooltip",!t);return n?(0,s.Y)(n,{...e}):void 0}},49642:(e,t,n)=>{n.d(t,{D5:()=>s,Eg:()=>r,HW:()=>d,MV:()=>i,hm:()=>c,wp:()=>l});const o={play:void 0,pause:void 0,seekbackward:void 0,seekforward:void 0,previoustrack:void 0,nexttrack:void 0,stop:void 0,seekTo:void 0};function i(e,t){const{mediaSession:n}=window.navigator;n?(e&&s(e),t&&a(t)):console.warn("MediaSession API not supported in this browser")}function s(e){const{mediaSession:t}=window.navigator;t&&(t.metadata=e??null)}function a(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...o,...e}).forEach(([e,n])=>{try{t.setActionHandler(e,n)}catch(e){}})}function r(){const{mediaSession:e}=window.navigator;e&&(e.metadata=null,a(o),e.playbackState&&(e.playbackState="none"),e.setPositionState?.())}function d(e="none"){const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function c(e){if(!e||void 0===e.position||void 0===e.duration)return;e.position=Math.min(e.position,e.duration);const{mediaSession:t}=window.navigator;t?.setPositionState?.(e)}function l({title:e,artist:t,album:n,artwork:o}){if("MediaMetadata"in window)return new window.MediaMetadata({title:e,artist:t,album:n,artwork:o})}},51067:(e,t,n)=>{n.d(t,{A:()=>q});var o=n(84051),i=n(13439),s=n(89925),a=n(31481),r=n(96454),d=n(87357),c=n(75956),l=n(49763),u=n(80140),h=n(23459),m=n(7985),p=n(74984),g=n(2178),f=n(96374),v=n(5912),A=n(17712),y=n(9717),C=n(46222),w=n(52745),I=n(90709),b=n(87894),S=n(14242),M=n(4961),N=n(39351),Y=n(21849),k=n(18276),P=n(24713),F=n(22720);const T={root:"sG8AAzvK",minimized:"lTOui0dp",button:"bNkLqJf1",title:"rMTpNazX","unread-count":"O7esHjyC",unreadCount:"O7esHjyC",info:"OS2LWzdu",name:"bkCtPuPQ",icon:"f4LUPgr4",avatarWrapper:"RMY__Znz",avatar:"qeb0Aox1",chatsPreview:"_1817Hwgd",unread:"SS39xuL3"};var D=n(20021);const x={isCustomPeer:!0,title:"Archived Chats",avatarIcon:"archive-filled",customPeerAvatarColor:"#9EAAB5"},L=(0,o.ph)(({archiveSettings:e,onDragEnter:t,onClick:n})=>{const{updateArchiveSettings:s}=(0,i.ko)(),r=(0,N.A)(),c=(0,p.Rh)(a._E9),l=(0,p.ic)(),u=l[a._E9]?.chatsCount,h=(0,o.Kr)(()=>{if(!c?.length)return r("Loading");const e=(0,i.mS)().chats.byId;return c.slice(0,5).map((t,n,o)=>{const i=n===o.length-1,s=e[t];if(!s)return;const a=(0,I.Js)(r,s);return(0,D.FD)(D.FK,{children:[(0,D.Y)("span",{className:(0,d.A)(T.chat,u&&s.unreadCount&&T.unread),children:(0,M.A)(a)}),i?"":", "]})})},[c,r,u]),m=(0,o.Kr)(()=>{const t=!e.isMinimized&&{title:r("ContextArchiveCollapse"),icon:"collapse",handler:()=>{s({isMinimized:!0})}},n=e.isMinimized&&{title:r("ContextArchiveExpand"),icon:"expand",handler:()=>{s({isMinimized:!1})}},o={title:r("ContextArchiveToMenu"),icon:"archive-to-main",handler:()=>{s({isHidden:!0})}};return(0,b.oE)([t,n,o])},[e.isMinimized,r,s]),g=(0,o.hb)(e=>{e.preventDefault(),t?.()},[t]);return(0,D.Y)(F.A,{onClick:n,onDragEnter:g,className:(0,d.A)(T.root,e.isMinimized&&T.minimized,"chat-item-clickable","chat-item-archive"),buttonClassName:T.button,contextActions:m,withPortalForMenu:!0,children:e.isMinimized?(0,D.Y)("div",{className:(0,d.A)(T.info,"info"),children:(0,D.FD)("div",{className:"info-row",children:[(0,D.Y)("div",{className:(0,d.A)("title",T.title),children:(0,D.FD)("h3",{dir:"auto",className:(0,d.A)(T.name,"fullName"),children:[(0,D.Y)(k.A,{name:"archive-filled",className:T.icon}),r("ArchivedChats")]})}),(0,D.Y)(P.A,{className:T.unreadCount,text:u?(0,S.Vw)(r,u):void 0})]})}):(0,D.FD)(D.FK,{children:[(0,D.Y)("div",{className:(0,d.A)("status",T.avatarWrapper),children:(0,D.Y)(Y.A,{peer:x})}),(0,D.FD)("div",{className:(0,d.A)(T.info,"info"),children:[(0,D.Y)("div",{className:"info-row",children:(0,D.Y)("div",{className:(0,d.A)("title",T.title),children:(0,D.Y)("h3",{dir:"auto",className:(0,d.A)(T.name,"fullName"),children:r("ArchivedChats")})})}),(0,D.FD)("div",{className:"subtitle",children:[(0,D.Y)("div",{className:(0,d.A)("status",T.chatsPreview),children:h}),(0,D.Y)(P.A,{className:T.unreadCount,text:u?(0,S.Vw)(r,u):void 0})]})]})]})})});var E=n(19210),B=n(91048),R=n(43874),O=n(59030),U=n(79577),K=n(64493);const z=(0,o.ph)((0,i.EK)((e,{folderId:t,folderType:n})=>({chatFolder:t&&"folder"===n?(0,B.$aQ)(e,t):void 0,animatedEmoji:(0,B.oei)(e,"📂")}))(({chatFolder:e,animatedEmoji:t,foldersDispatch:n})=>{const{openSettingsScreen:a}=(0,i.ko)(),r=(0,O.A)(),{isMobile:d}=(0,R.Ay)(),c=(0,o.hb)(()=>{n({type:"editFolder",payload:e}),a({screen:s.VS.FoldersEditFolderFromChatList})},[e,n]);return(0,D.FD)("div",{className:"yftKUVDQ",children:[(0,D.Y)("div",{className:"UCBfMOiz",children:t&&(0,D.Y)(U.A,{sticker:t,size:96})}),(0,D.Y)("h3",{className:"dB9cHelg",dir:"auto",children:r("FilterNoChatsToDisplay")}),(0,D.Y)("p",{className:"TJ_liZcJ",dir:"auto",children:r(e?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")}),e&&(0,D.FD)(K.A,{ripple:!d,fluid:!0,pill:!0,onClick:c,isRtl:r.isRtl,children:[(0,D.Y)(k.A,{name:"settings"}),(0,D.Y)("div",{className:"aL7e0w4t",children:r("ChatList.EmptyChatListEditFilter")})]})]})})),V=(0,o.ph)(({onClick:e})=>{const t=(0,N.A)();return(0,D.FD)("div",{className:"fOmerTkM",onClick:e,children:[(0,D.Y)("div",{className:"URLYINJA",children:t("TitleFrozenAccount")}),(0,D.Y)("div",{className:"mCFsx7Tv",children:t("SubtitleFrozenAccount")})]})});var j=n(93545);const J="pedMJD_v",G=(0,o.ph)(({sessions:e,onHeightChange:t})=>{const{changeSessionSettings:n,terminateAuthorization:s,showNotification:a}=(0,i.ko)(),r=(0,o.li)(),d=(0,O.A)();(0,j.A)(r,e=>{const n=e.borderBoxSize?.[0]?.blockSize||e.contentRect.height;t(n)});const c=(0,o.Kr)(()=>Object.values(e).sort((e,t)=>t.dateCreated-e.dateCreated).find(e=>e.isUnconfirmed),[e]),l=(0,o.Kr)(()=>[c.deviceModel,c.region,c.country].filter(Boolean).join(", "),[c]),u=(0,A.A)(()=>{n({hash:c.hash,isConfirmed:!0})}),h=(0,A.A)(()=>{s({hash:c.hash}),a({title:d("UnconfirmedAuthDeniedTitle",1),message:d("UnconfirmedAuthDeniedMessageSingle",l)})});return(0,D.FD)("div",{className:"yEkGgZVL",ref:r,children:[(0,D.Y)("h2",{className:"VhAJDrnz",children:d("UnconfirmedAuthTitle")}),(0,D.Y)("p",{className:"WmyL1NJ8",children:d("UnconfirmedAuthSingle",l)}),(0,D.FD)("div",{className:"_40UGD1Y",children:[(0,D.Y)(K.A,{fluid:!0,isText:!0,className:J,onClick:u,children:d("UnconfirmedAuthConfirm")}),(0,D.Y)(K.A,{fluid:!0,isText:!0,color:"danger",onClick:h,className:J,children:d("UnconfirmedAuthDeny")})]})]})}),$=new Set(["9","0"]),q=(0,o.ph)(({className:e,folderType:t,folderId:n,isActive:I,isForumPanelOpen:b,canDisplayArchive:S,archiveSettings:M,sessions:N,isAccountFrozen:Y,isMainList:k,withTags:P,isStoryRibbonShown:F,foldersDispatch:T})=>{const{openChat:x,openNextChat:B,closeForumPanel:R,toggleStoryRibbon:O,openFrozenAccountModal:U,openLeftColumnContent:K}=(0,i.ko)(),j=(0,o.li)(),[J,q]=(0,o.J0)(0),H="archived"===t,W="all"===t,_="saved"===t,Q=W?a.DSF:H?a._E9:_?a.pX9:n,Z=W&&S&&M,X=Y&&W,ee=(0,p.Rh)(Q);(0,h.A)(ee);const te=(ee?.length||0)*a.yq1,ne=Z?M?.isMinimized?a.eqO:a.yq1:0,oe=X?68:0,{orderDiffById:ie,getAnimationType:se,onReorderAnimationEnd:ae}=(0,y.A)(ee),[re,de]=(0,f.A)(void 0,ee,void 0,a.T7t),ce=(0,o.Kr)(()=>{const e=Object.values(N||{}),t=e.find(e=>e.isCurrent);return!(!t||(0,u.Fm)()-t.dateCreated<a.C7Y)&&!Y&&W&&e.some(e=>e.isUnconfirmed)},[W,N,Y]);(0,o.vJ)(()=>{ce||q(0)},[ce]),(0,g.v)((0,o.Kr)(()=>I&&ee?.length?{"Alt+ArrowUp":e=>{e.preventDefault(),B({targetIndexDelta:-1,orderedIds:ee})},"Alt+ArrowDown":e=>{e.preventDefault(),B({targetIndexDelta:1,orderedIds:ee})}}:void 0,[I,ee])),(0,o.vJ)(()=>{if(I&&!_&&ee&&r.lE)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){if((r.MP&&e.metaKey||!r.MP&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t||$.has(t))return;const n=Z&&M&&!M.isMinimized,o=n?-1:0,i=Number(t)+o-1;if(n&&-1===i)return void(k&&K({contentKey:s.Bn.Archived}));if(i>ee.length-1)return;x({id:ee[i],shouldReplaceHistory:!0})}}},[M,_,I,x,B,ee,Z,k]);const{observe:le}=(0,v.BL)({rootRef:j,throttleMs:200}),ue=(0,A.A)(()=>{K({contentKey:s.Bn.Archived}),R()}),he=(0,A.A)(()=>{U()}),me=(0,A.A)(()=>{O({isShown:!0,isArchived:H})}),pe=(0,A.A)(()=>{O({isShown:!1,isArchived:H})}),ge=(0,A.A)(()=>{(0,c.W)(()=>{ue()})}),fe=(0,A.A)(e=>{(0,c.W)(()=>{x({id:e,shouldReplaceHistory:!0})})});return(0,m.A)({containerRef:j,onOverscroll:me,onReset:pe,isDisabled:_,isOverscrolled:F}),(0,D.FD)(C.A,{className:(0,d.A)("chat-list custom-scroll",b&&"forum-panel-open",e),ref:j,items:re,itemSelector:".ListItem:not(.chat-item-archive)",preloadBackwards:a.T7t,withAbsolutePositioning:!0,maxHeight:te+ne+oe+J,onLoadMore:de,children:[ce&&(0,D.Y)(G,{sessions:N,onHeightChange:q},"unconfirmed"),X&&(0,D.Y)(V,{onClick:he},"frozen"),Z&&(0,D.Y)(L,{archiveSettings:M,onClick:ue,onDragEnter:ge},"archive"),re?.length?function(){const e=ee.indexOf(re[0]),t=(0,l.zm)(Q)||0;return re.map((o,i)=>{const s=e+i<t,r=J+ne+oe+(e+i)*a.yq1;return(0,D.Y)(E.A,{teactOrderKey:s?i:(0,l.uk)(o,_),chatId:o,isPinned:s,folderId:n,isSavedDialog:_,animationType:se(o),orderDiff:ie[o],onReorderAnimationEnd:ae,offsetTop:r,observeIntersection:le,onDragEnter:fe,onDragLeave:c.d,withTags:P},o)})}():!re||re.length||_?(0,D.Y)(w.A,{},"loading"):(0,D.Y)(z,{folderId:n,folderType:t,foldersDispatch:T})]})})},51083:(e,t,n)=>{n.d(t,{A:()=>b});var o=n(84051),i=n(13439),s=n(89925),a=n(90709),r=n(91048),d=n(87357),c=n(76023),l=n(4961),u=n(39351),h=n(17712),m=n(59030),p=n(41036),g=n(21849),f=n(80999),v=n(34431),A=n(18276),y=n(38102),C=n(80477),w=n(20021);const I=2.5*c.$,b=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n})=>{const o=(0,r.hds)(e,t),i=n?(0,r.Vw0)(e,t,n):void 0,s=o?(0,r.ToO)(e,o):void 0,a=Boolean((0,r.zeq)(e,t)),d=n?(0,r.S0q)(e,t,n):void 0;return{chat:o,threadInfo:i,onlineCount:s,topic:d,areMessagesLoaded:a,messagesCount:d&&(0,r.QbG)(e,t,n),self:(0,r.mBe)(e,e.currentUserId),monoforumChannel:(0,r.k2W)(e,t)}})(({typingStatus:e,className:t,statusIcon:n,avatarSize:c="medium",noAvatar:b,status:S,withDots:M,withMediaViewer:N,withUsername:Y,withFullInfo:k,withUpdatingStatus:P,withChatType:F,threadInfo:T,noRtl:D,chat:x,onlineCount:L,areMessagesLoaded:E,topic:B,messagesCount:R,noStatusOrTyping:O,withStory:U,storyViewerOrigin:K,noEmojiStatus:z,emojiStatusSize:V,isSavedDialog:j,self:J,withMonoforumStatus:G,monoforumChannel:$,onClick:q,onEmojiStatusClick:H})=>{const{loadFullChat:W,openMediaViewer:_,loadMoreProfilePhotos:Q}=(0,i.ko)(),Z=!G&&$?$:x,X=(0,m.A)(),ee=(0,u.A)(),te=Z&&(0,a.Vs)(Z),ne=Boolean(Z?.isForum&&T&&B),{id:oe,isMin:ie}=Z||{},se=(0,r._ls)((0,i.mS)(),oe);(0,o.vJ)(()=>{oe&&!ie&&(k&&W({chatId:oe}),N&&Q({peerId:oe,isPreload:!0}))},[oe,ie,k,te,N]);const ae=(0,h.A)((e,t)=>{Z&&t&&(e.stopPropagation(),_({isAvatarView:!0,chatId:Z.id,mediaIndex:0,origin:"jumbo"===c?s.TQ.ProfileAvatar:s.TQ.MiddleHeaderAvatar}))}),re=(0,o.Kr)(()=>Z&&Y&&(0,a.Kl)(Z),[Z,Y]);if(Z)return(0,w.FD)("div",{className:(0,d.A)("ChatInfo",t),dir:!D&&ee.isRtl?"rtl":void 0,onClick:q,children:[!b&&!ne&&(0,w.FD)(w.FK,{children:[j&&J&&(0,w.Y)(g.A,{size:c,peer:J,isSavedMessages:!0,className:"saved-dialog-avatar"},"saved-messages"),(0,w.Y)(g.A,{className:(0,d.A)(j&&"overlay-avatar"),size:c,peer:Z,withStory:U,asMessageBubble:Boolean($),storyViewerOrigin:K,storyViewerMode:"single-peer",isSavedDialog:j,onClick:N?ae:void 0},Z.id)]}),ne&&(0,w.Y)(y.A,{topic:B,className:"topic-header-icon",size:I}),(0,w.FD)("div",{className:"info",children:[B?(0,w.Y)("h3",{dir:"auto",className:"fullName",children:(0,l.A)(B.title)}):(0,w.Y)(v.A,{peer:Z,isMonoforum:!G&&Boolean($),emojiStatusSize:V,withEmojiStatus:!z,isSavedDialog:j,onEmojiStatusClick:H}),!O&&function(){if(P&&!E&&!se)return(0,w.Y)(f.A,{className:"status",content:X("Updating")});if(G)return(0,w.Y)("span",{className:"status",dir:"auto",children:ee("MonoforumStatus")});if(x?.isMonoforum)return;if(S)return M?(0,w.Y)(f.A,{className:"status",content:S}):(0,w.FD)("span",{className:"status",dir:"auto",children:[n&&(0,w.Y)(A.A,{className:"status-icon",name:n}),(0,l.A)(S)]});if(!Z)return;if(e)return(0,w.Y)(C.A,{typingStatus:e});if(ne)return(0,w.Y)("span",{className:"status",dir:"auto",children:(0,w.Y)(p.Ay,{name:"fade",shouldRestoreHeight:!0,activeKey:void 0!==R?1:2,className:"message-count-transition",children:void 0!==R&&X("messages",R,"i")})});if(F)return(0,w.Y)("span",{className:"status",dir:"auto",children:X((0,a.Gg)(Z))});const t=(0,a.sT)(X,Z),o=L?`, ${X("OnlineCount",L,"i")}`:void 0;return(0,w.FD)("span",{className:"status",children:[re&&(0,w.Y)("span",{className:"handle withStatus",children:re}),(0,w.Y)("span",{className:"group-status",children:t}),o&&(0,w.Y)("span",{className:"online-status",children:o})]})}()]})]})}))},51644:(e,t,n)=>{n.d(t,{A:()=>Y});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(90709),d=n(87357),c=n(40435),l=n(35127),u=n(43874),h=n(37661),m=n(5912),p=n(17712),g=n(37859),f=n(37960),v=n(69419),A=n(29886),y=n(73767),C=n(34201),w=n(61097),I=n(18276),b=n(27860),S=n(14413),M=n(35913),N=n(20021);const Y=(0,o.ph)((0,i.EK)(e=>({needsAgeVerification:e.appConfig.needAgeVideoVerification}))(({id:e,photo:t,messageText:n,isOwn:Y,noAvatars:k,canAutoLoad:P,isInSelectMode:F,isSelected:T,uploadProgress:D,forcedWidth:x,size:L="inline",dimensions:E,asForwarded:B,nonInteractive:R,shouldAffectAppendix:O,isDownloading:U,isProtected:K,theme:z,isInWebPage:V,clickArg:j,className:J,isMediaNsfw:G,observeIntersection:$,onClick:q,onCancelUpload:H,needsAgeVerification:W})=>{const _=(0,o.li)(),Q="extendedMediaPreview"===t.mediaType,Z=Q?void 0:t.blobUrl,X=(0,m.Vz)(_,$),{isMobile:ee}=(0,u.Ay)(),[te,ne]=(0,o.J0)(P),oe=te&&X&&!Q,{mediaData:ie,loadProgress:se}=(0,v.A)(Q?void 0:(0,r.rI)(t,L),!oe),ae=(0,A.A)(ie),re=Z||ie,{ref:de,shouldRender:ce}=(0,f.A)({hasMediaData:Boolean(re),withShouldRender:!0}),le=Boolean(x),[ue]=(0,o.J0)(!re),he=Boolean(re),me=(0,w.A)(t,he);(0,f.A)({ref:me,hasMediaData:!he});const pe=(0,w.A)(t,!le),ge=(0,r.VD)(t),{updateContentSettings:fe,openAgeVerificationModal:ve}=(0,i.ko)(),[Ae,ye,Ce]=(0,h.A)(),[we,Ie]=(0,o.J0)(!1),be=Q||t.isSpoiler||G,[Se,Me,Ne]=(0,h.A)(be);(0,o.vJ)(()=>{be?Me():Ne()},[be]);const Ye=(0,p.A)(()=>{Ce(),Ne(),we&&fe({isSensitiveEnabled:!0})}),{loadProgress:ke}=(0,v.A)(Q?void 0:(0,r.rI)(t,"download"),!U,Q?void 0:(0,r.Cz)(t,"download")),{isUploading:Pe,isTransferring:Fe,transferProgress:Te}=(0,r.LK)(D||(U?ke:se),oe&&!re,void 0!==D),De=!1===(0,y.A)(te),{ref:xe,shouldRender:Le}=(0,C.A)({isOpen:Fe,noMountTransition:De,className:"slow",withShouldRender:!0}),{ref:Ee,shouldRender:Be}=(0,C.A)({isOpen:!re&&!te,withShouldRender:!0}),{ref:Re,shouldRender:Oe}=(0,C.A)({isOpen:Fe,noMountTransition:De,withShouldRender:!0}),Ue=(0,p.A)(e=>{if(Pe)H?.(j);else{if(re)return Se?G?W?void ve():void ye():void Ne():void q?.(j,e);ne(e=>!e)}});(0,g.A)(([e])=>{if(!O)return void(e&&_.current.closest(s.KFG).removeAttribute(s.D3G));const t=_.current.closest(s.KFG);if(re){const e=Number(t.closest(".Message").dataset.messageId);(0,c.A)(re,Boolean(Y),e,T,z).then(e=>{(0,a.RK)(()=>{t.style.setProperty("--appendix-bg",e),t.setAttribute(s.D3G,"")})})}else t.classList.add("has-appendix-thumb")},[O,re,Y,F,T,z]);const{width:Ke,height:ze,isSmall:Ve}=E||(0,l.yA)({media:t,isOwn:Y,asForwarded:B,noAvatars:k,isMobile:ee,messageText:n,isInWebPage:V}),je=(0,d.A)("media-inner",!Pe&&!R&&"interactive",Ve&&"small-image",(Ke===ze||"pictogram"===L)&&"square-image",ze<l.ej&&"fix-min-height",J),Je=E?` width: ${Ke}px; left: ${E.x}px; top: ${E.y}px;`:"",Ge="inline"===L?`height: ${ze}px;${Je}`:void 0;return(0,N.FD)("div",{id:e,ref:_,className:je,style:Ge,onClick:Pe?void 0:Ue,children:[le&&(0,N.Y)("canvas",{ref:pe,className:"thumbnail blurred-bg"}),ce&&(0,N.Y)("img",{ref:de,src:re||ae,className:(0,d.A)("full-media",le&&"with-blurred-bg"),alt:"",style:x?`width: ${x}px`:void 0,draggable:!K}),ue&&(0,N.Y)("canvas",{ref:me,className:"thumbnail"}),K&&(0,N.Y)("span",{className:"protector"}),Le&&!Be&&(0,N.Y)("div",{ref:xe,className:"media-loading",children:(0,N.Y)(M.A,{progress:Te,onClick:Pe?Ue:void 0})}),Be&&(0,N.Y)(I.A,{ref:Ee,name:"download"}),(0,N.Y)(b.A,{isVisible:Se,withAnimation:!0,thumbDataUri:ge,width:Ke,height:ze,className:"media-spoiler",isNsfw:G}),Oe&&(0,N.Y)("span",{ref:Re,className:"message-transfer-progress",children:`${Math.round(100*Te)}%`}),(0,N.Y)(S.A,{isOpen:Ae,onClose:Ce,shouldAlwaysShow:we,onAlwaysShowChanged:Ie,confirmHandler:Ye})]})}))},52844:(e,t,n)=>{let o;function i(e="*",t,n=!1){o||(o=document.createElement("input"),o.setAttribute("type","file")),o.setAttribute("accept",e),n?o.removeAttribute("multiple"):o.setAttribute("multiple","multiple"),o.onchange=null,o.value="",o.onchange=t,o.click()}n.d(t,{p:()=>i})},52988:(e,t,n)=>{n.d(t,{A:()=>C});var o=n(84051),i=n(96454),s=n(87357),a=n(17663),r=n(91525),d=n(76023),c=n(4961),l=n(43874),u=n(45470),h=n(39351),m=n(83057),p=n(59030),g=n(50680),f=n(96530),v=n(35913),A=n(18276),y=n(20021);const C=(0,o.ph)(({ref:e,id:t,name:n,size:C,extension:w="",timestamp:I,sender:b,thumbnailDataUri:S,previewData:M,className:N,smaller:Y,isTransferring:k,isUploading:P,isSelectable:F,isSelected:T,transferProgress:D,actionIcon:x,onClick:L,onDateClick:E})=>{const B=(0,p.A)(),R=(0,h.A)();let O=(0,o.li)();e&&(O=e);const{isMobile:U}=(0,l.Ay)(),[K]=(0,o.J0)(!M),z=Boolean(M),V=(0,u.A)(S,z,U&&!i.QH),j=(0,m.A)(!z),{shouldRender:J,transitionClassNames:G}=(0,g.A)(k,void 0,!0),$=(0,r.fE)(w),q=(0,r.zV)(C),H=(0,o.Kr)(()=>k&&D?`${(0,r.zV)(C*D)} / ${q}`:q,[k,C,q,D]),{width:W,height:_}=(0,d.tP)(Y),Q=(0,s.A)("File",N,Y&&"smaller",L&&!P&&"interactive",T&&"file-is-selected");return(0,y.FD)("div",{id:t,ref:O,className:Q,dir:R.isRtl?"rtl":void 0,children:[F&&(0,y.Y)("div",{className:"message-select-control no-selection",children:T&&(0,y.Y)(A.A,{name:"select"})}),(0,y.FD)("div",{className:"file-icon-container",onClick:P?void 0:L,children:[S||M?(0,y.FD)("div",{className:"file-preview media-inner",children:[(0,y.Y)("img",{src:M,className:"full-media",width:W,height:_,draggable:!1,alt:""}),K&&(0,y.Y)("canvas",{ref:V,className:(0,s.A)("thumbnail",j)})]}):(0,y.Y)("div",{className:`file-icon ${$}`,children:w.length<=4&&(0,y.Y)("span",{className:"file-ext",dir:"auto",children:w})}),J&&(0,y.Y)("div",{className:(0,s.A)("file-progress",$,G),children:(0,y.Y)(v.A,{progress:D,size:Y?"s":"m",onClick:P?L:void 0})}),L&&(0,y.Y)(A.A,{name:x||"download",className:(0,s.A)("action-icon",J&&"hidden")})]}),(0,y.FD)("div",{className:"file-info",children:[(0,y.Y)("div",{className:"file-title",dir:"auto",title:n,children:(0,c.A)(n)}),(0,y.FD)("div",{className:"file-subtitle",dir:"auto",children:[(0,y.Y)("span",{children:H}),b&&(0,y.Y)("span",{className:"file-sender",children:(0,c.A)(b)}),!b&&Boolean(I)&&(0,y.FD)(y.FK,{children:[(0,y.Y)("span",{className:"bullet"}),(0,y.Y)(f.A,{onClick:E,children:(0,a.fS)(B,1e3*I,!0)})]})]})]}),b&&Boolean(I)&&(0,y.Y)(f.A,{onClick:E,children:(0,a.be)(B,1e3*I)})]})})},53827:(e,t,n)=>{n.d(t,{_K:()=>f,dj:()=>y,kz:()=>v});var o=n(13439),i=n(89925),s=n(66644),a=n(91048),r=n(96454),d=n(60343),c=n(80853),l=n(41733);const u=new Map;let h,m=[],p=[];function g(e,t){const n=h&&u.get(h);n&&(n.audio.pause(),n.audio.currentTime=0,n.onTrackChange&&n.onTrackChange());const s=A(e,(0,a.nTw)((0,o.mS)()).audioPlayer.origin||i.d9.Inline,t);if(!s)return;if(!u.has(s))return void(0,o.ko)().openAudioPlayer((0,d.ES)(C(s).messageKey));const r=u.get(s);r.onForcePlay&&r.onForcePlay(),h=s,r.audio.src&&(0,l.A)(r.audio)}function f(){const e=h&&u.get(h);e&&e.audio.pause()}function v(e,t,n,f,v){if(!u.has(e)){const n=function(e,t,n,o){const i=new Audio;function s(t){return n=>{u.has(e)&&((0,c.f)(i)||u.get(e).handlers.forEach(e=>{e(t,n)}))}}return i.addEventListener("timeupdate",s("onTimeUpdate")),i.addEventListener("play",s("onPlay")),i.addEventListener("pause",s("onPause")),i.addEventListener("loadstart",s("onLoadStart")),i.addEventListener("loadeddata",s("onLoadedData")),i.addEventListener("playing",s("onPlaying")),i.addEventListener("ended",()=>{u.has(e)&&((0,c.f)(i)||g(e))}),{audio:i,type:t,proxy:new Proxy(i,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:n,onTrackChange:o}}(e,t,f,v);u.set(e,n),function(e,t){"audio"!==e.type||p.includes(t)||(p.push(t),p.sort(w)),"voice"!==e.type||m.includes(t)||(m.push(t),m.sort(w))}(n,e)}const{audio:y,proxy:I,handlers:b}=u.get(e);return b.push(n),{play(n){if(!y.paused)return;const s=h&&u.get(h);s&&h!==e&&(s.audio.pause(),s.audio.currentTime=0,(0,c.f)(s.audio)&&(s.audio.dataset.preventPlayAfterPatch="true"),s.onTrackChange&&s.onTrackChange()),h=e,y.src||(y.src=n,y.preload="auto",n.includes("/progressive/")&&r.Yw&&(delete y.dataset.preventPlayAfterPatch,(0,c.C)(y))),(0,l.A)(y),function(e,t){if((0,a.nTw)((0,o.mS)()).globalSearch.currentContent===i.$C.Music)return;const{chatId:n}=(0,d.ES)(C(t).messageKey),s=(0,a.Xf0)((0,o.mS)())?.chatId,r=e=>e.startsWith(`msg${n}`)||s&&e.startsWith(`msg${s}`);"audio"===e&&(p=p.filter(r)),"voice"===e&&(m=m.filter(r))}(t,e)},pause(){h===e&&y.pause()},stop(){if(h===e){const e=y.src;y.pause(),(0,s.Uz)(()=>{y.src="",y.src=e})}},setCurrentTime(t){h===e&&(y.fastSeek?y.fastSeek(t):y.currentTime=t)},setVolume(t){h===e&&(y.volume=t,y.muted=!1)},setPlaybackRate(t){h===e&&(y.playbackRate=t)},toggleMuted(e){y.muted=void 0===e?!y.muted:e},proxy:I,requestNextTrack(){g(e)},isLast:()=>!A(e,(0,a.nTw)((0,o.mS)()).audioPlayer.origin),isFirst:()=>!A(e,(0,a.nTw)((0,o.mS)()).audioPlayer.origin,!0),requestPreviousTrack(){g(e,!0)},destroy(t=!1){const o=u.get(e);o&&(o.handlers=o.handlers.filter(e=>e!==n),o.handlers.length||(o.audio.pause(),u.delete(e),t&&function(e,t){const n=e=>e!==t;"audio"===e.type&&(p=p.filter(n)),"voice"===e.type&&(m=m.filter(n))}(o,e),e===h&&(h=void 0)))}}}function A(e,t=i.d9.Inline,n){const o=function(e){switch(e.type){case"audio":return p;case"voice":return m;default:return}}(u.get(e));if(!o)return;if(t===i.d9.Search){const t=o.indexOf(e);if(t<0)return;return o[t+(n?-1:1)]}const{chatId:s}=(0,d.ES)(C(e).messageKey),a=o.filter(e=>e.startsWith(`msg${s}`)),r=a.indexOf(e);if(r<0)return;let c=t===i.d9.Inline?-1:1;return n&&(c*=-1),a[r+c]}function y(e){const t=(0,d.AD)(e);if(t)return`${t}-${e.date}`}function C(e){return{messageKey:e.match(/^msg(-?\d+)-(\d+)/)[0],date:Number(e.split("-").pop())}}function w(e,t){if(!e||!t)return 0;const{date:n,messageKey:o}=C(e),{date:i,messageKey:s}=C(t),a=i-n;return 0===a?s.localeCompare(o):a}},54314:(e,t,n)=>{n.d(t,{A:()=>f});var o=n(84051),i=n(13439),s=n(90709),a=n(91048),r=n(48899),d=n(4961),c=n(39351),l=n(17712),u=n(59030),h=n(64493),m=n(22337),p=n(21849),g=n(20021);const f=(0,o.ph)((0,i.EK)((e,{chat:t,isSavedDialog:n})=>{const o=(0,r.L8)(t.id),i=(0,a.nZ4)(e,t.id),d=o&&(0,a.mBe)(e,(0,s.e7)(t)),c=d&&(0,s.tv)(d)&&!t.isSupport,l=o&&!i&&!c&&!n,u=o?(0,s.u0)((0,a.mBe)(e,(0,s.e7)(t))):void 0;return{isPrivateChat:o,isChatWithSelf:i,isBot:c,isChannel:(0,s.WX)(t),isBasicGroup:(0,s.yn)(t),isSuperGroup:(0,s.Vs)(t),currentUserId:e.currentUserId,canDeleteForAll:l,contactName:u}})(({isOpen:e,chat:t,isSavedDialog:n,isChannel:o,isPrivateChat:a,isChatWithSelf:r,isBot:f,isBasicGroup:v,isSuperGroup:A,currentUserId:y,canDeleteForAll:C,contactName:w,onClose:I,onCloseAnimationEnd:b})=>{const{leaveChannel:S,deleteHistory:M,deleteSavedHistory:N,deleteChannel:Y,deleteChatUser:k,blockUser:P,deleteChat:F}=(0,i.ko)(),T=(0,u.A)(),D=(0,c.A)(),x=(0,s.Js)(D,t),L=(0,l.A)(()=>{M({chatId:t.id,shouldDeleteForAll:!0}),I()}),E=(0,l.A)(()=>{M({chatId:t.id,shouldDeleteForAll:!0}),P({userId:t.id}),I()}),B=(0,l.A)(()=>{n?N({chatId:t.id}):a?M({chatId:t.id,shouldDeleteForAll:!1}):v?t.isCreator?(M({chatId:t.id,shouldDeleteForAll:!0}),F({chatId:t.id})):(M({chatId:t.id,shouldDeleteForAll:!1}),k({chatId:t.id,userId:y})):!o&&!A||t.isCreator?(o||A)&&t.isCreator&&Y({chatId:t.id}):S({chatId:t.id}),I()}),R=(0,l.A)(()=>{o||A?(S({chatId:t.id}),I()):v&&t.isCreator?(M({chatId:t.id,shouldDeleteForAll:!1}),k({chatId:t.id,userId:y})):B()});return(0,g.FD)(m.A,{isOpen:e,className:"DeleteChatModal",header:(0,g.FD)("div",{className:"modal-header",dir:D.isRtl?"rtl":void 0,children:[(0,g.Y)(p.A,{size:"tiny",peer:t,isSavedMessages:r}),(0,g.Y)("h3",{className:"modal-title",children:T(n?r?"ClearHistoryMyNotesTitle":"ClearHistoryTitleSingle2":o&&!t.isCreator?"LeaveChannel":o&&t.isCreator?"ChannelDelete":v||A?"Group.LeaveGroup":"DeleteChatUser")})]}),onClose:I,onCloseAnimationEnd:b,children:[n?(0,g.Y)("p",{children:(0,d.A)(r?T("ClearHistoryMyNotesMessage"):T("ClearHistoryMessageSingle",x),["simple_markdown","emoji"])}):o&&t.isCreator?(0,g.Y)("p",{children:(0,d.A)(T("ChatList.DeleteAndLeaveGroupConfirmation",x),["simple_markdown","emoji"])}):o&&!t.isCreator||v||A?(0,g.Y)("p",{children:(0,d.A)(T("ChannelLeaveAlertWithName",x),["simple_markdown","emoji"])}):(0,g.Y)("p",{children:(0,d.A)(T("ChatList.DeleteChatConfirmation",w),["simple_markdown","emoji"])}),(0,g.FD)("div",{className:"dialog-buttons-column",children:[f&&!n&&(0,g.Y)(h.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:E,children:T("DeleteAndStop")}),C&&(0,g.Y)(h.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:L,children:w?(0,d.A)(T("ChatList.DeleteForEveryone",w)):T("DeleteForAll")}),!a&&t.isCreator&&!n&&(0,g.Y)(h.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:B,children:T("DeleteForAll")}),(0,g.Y)(h.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:a||n?B:R,children:T(n?"Delete":o&&!t.isCreator?"LeaveChannel":o&&t.isCreator?"Chat.Input.Delete":v||A?"Group.LeaveGroup":C?"ChatList.DeleteForCurrentUser":"Delete")}),(0,g.Y)(h.A,{className:"confirm-dialog-button",isText:!0,onClick:I,children:T("Cancel")})]})]})}))},54639:(e,t,n)=>{n.d(t,{A:()=>y});var o=n(84051),i=n(13439),s=n(37661),a=n(17712),r=n(59030),d=n(71429),c=n(24433),l=n(23174),u=n(90709),h=n(87357),m=n(43874),p=n(62587);const g="VGmPJoga";var f=n(20021);const v=/#fff/gi,A=(0,o.ph)(({icon:e,theme:t})=>{const{isTouchScreen:n}=(0,m.Ay)(),i=(0,p.A)((0,u.mr)(e,"full"),!1,l.qZ.Text),s=(0,o.Kr)(()=>{if(!i)return"";const e="dark"===t?"rgb(170, 170, 170)":"rgb(112, 117, 121)",n=i.replace(v,e),o=(new DOMParser).parseFromString(n,"image/svg+xml");return o.querySelectorAll("path").forEach(t=>{t.style.stroke=e,t.style.strokeWidth="0.5px"}),`data:image/svg+xml;utf8,${o.documentElement.outerHTML}`},[i,t]);return(0,f.Y)("i",{className:(0,h.A)("mklnEg0s","icon",!n&&g),children:(0,f.Y)("img",{src:s,alt:"",className:(0,h.A)("tT8KQwg0",!n&&g),draggable:!1})})}),y=(0,o.ph)(({bot:e,theme:t,chatId:n,threadId:l,isInSideMenu:u,canShowNew:h,onMenuOpened:m,onMenuClosed:p})=>{const{callAttachBot:g,toggleAttachBot:v}=(0,i.ko)(),y=(0,r.A)(),C=(0,o.Kr)(()=>e.icons.find(({name:e})=>"default_static"===e)?.document,[e.icons]),[w,I,b]=(0,s.A)(),[S,M]=(0,o.J0)(void 0),N=(0,a.A)(e=>{e.preventDefault();const t=e.currentTarget.getBoundingClientRect();M({x:t.right,y:t.bottom}),m(),I()}),Y=(0,a.A)(()=>{g(u?{bot:e,isFromSideMenu:!0}:{bot:e,chatId:n,threadId:l})}),k=(0,a.A)(()=>{b(),p()}),P=(0,a.A)(()=>{M(void 0)}),F=(0,a.A)(()=>{v({botId:e.id,isEnabled:!1})});return(0,f.FD)(c.A,{customIcon:C&&(0,f.Y)(A,{icon:C,theme:t}),icon:C?void 0:"bots",onClick:Y,onContextMenu:N,children:[e.shortName,h&&e.isDisclaimerNeeded&&(0,f.Y)("span",{className:"menu-item-badge",children:y("New")}),S&&(0,f.Y)(d.A,{isOpen:w,positionX:"right",style:`left: ${S.x}px;top: ${S.y}px;`,className:"bot-attach-context-menu",autoClose:!0,withPortal:!0,onClose:k,onCloseAnimationEnd:P,children:(0,f.Y)(c.A,{icon:"stop",destructive:!0,onClick:F,children:y("WebApp.RemoveBot")})})]},e.id)})},54699:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(30857),i=n(32625);function s(e){const t=(0,o.A)();(0,i.A)(t,e,!0)}},55153:(e,t,n)=>{n.d(t,{A:()=>u,L:()=>h});var o=n(31481),i=n(87679),s=n(24909);const a=1280,r=2560,d=40,c=20,l=/\.[^/.]+$/;async function u(e,t,c){const h=URL.createObjectURL(t),{type:p,size:g}=t;let f,v,A,y;const C=c?.shouldSendInHighQuality;if(o.gex.has(p)){const n=await(0,i.NN)(h),{width:g,height:v}=n;y=!m(g,v);const w=C?r:a,I=Math.max(g,v)>w,b=p===o.Vz3;if(!y){if(!c?.compressedBlobUrl&&!b&&(I||"image/jpeg"!==p)){const n=await(0,s.s)(h,I?w/Math.max(g,v):1,"image/jpeg");return URL.revokeObjectURL(h),u(e,t,{...c,compressedBlobUrl:n})}"image/jpeg"===p&&(e=e.replace(l,".jpg")),f={width:g,height:v}}A=Math.max(g,v)>d?await(0,s.s)(h,d/Math.max(g,v),"image/jpeg"):h}else if(o.fNs.has(p)){try{const{videoWidth:e,videoHeight:t,duration:n}=await(0,i.FW)(h);y=!m(e,t),y||(f={width:e,height:t,duration:n})}catch(e){y=!0}A=await(0,i.eT)(h)}else if(o.IH3.has(p)){const{duration:e,title:t,performer:o,coverUrl:s}=await async function(e){const{parseBlob:t,selectCover:o}=await n.e(3246).then(n.bind(n,3246)),s=await(0,i.sZ)(e),a=await t(s),{common:{title:r,artist:d,picture:c},format:{duration:l}}=a,u=o(c),h=u?new Blob([u.data],{type:u.format}):void 0;return{title:r,performer:d,duration:l,coverUrl:h?URL.createObjectURL(h):void 0}}(h);v={duration:e||0,title:t,performer:o},A=s}return{blob:t,blobUrl:h,filename:e,mimeType:p,size:g,quick:f,audio:v,previewBlobUrl:A,shouldSendAsFile:y||void 0,uniqueId:`${Date.now()}-${Math.random()}`,...c}}function h(e,t){return e.map(e=>t?e.compressedBlobUrl?{...e,blobUrl:e.compressedBlobUrl}:e:{...e,shouldSendAsFile:!(e.voice||e.audio)||void 0,shouldSendAsSpoiler:void 0})}function m(e,t){return Math.max(e,t)/Math.min(e,t)<=c}},55317:(e,t,n)=>{function o(e,t){const{level:n,boosts:o,currentLevelBoosts:i,nextLevelBoosts:s,hasMyBoost:a,prepaidGiveaways:r}=e,d=t&&o===i&&a;return{currentLevel:d?n-1:n,hasNextLevel:Boolean(s),boosts:o,levelProgress:!s||d?1:(o-i)/(s-i),remainingBoosts:s?s-o:0,isMaxLevel:void 0===s,prepaidGiveaways:r}}n.d(t,{z:()=>o})},55429:(e,t,n)=>{n.d(t,{N:()=>a});var o=n(90709),i=n(70636),s=n(48899);function a(e,t,n,a){const{senderId:r}=t;if(!r)return;const d=(0,s.L8)(r)?a[r]:n[r];let c=(0,i.F9)(e,d);const l=n[t.chatId];return l&&("isSelf"in d&&d.isSelf?c=`${e("FromYou")} ${(0,o.Js)(e,l)}`:(0,o.YE)(l)&&(c+=` ${(0,o.Js)(e,l)}`)),c}},55723:(e,t,n)=>{n.d(t,{A:()=>S});var o=n(84051),i=n(13439),s=n(90709),a=n(10315),r=n(91525),d=n(27336),c=n(91048),l=n(96454),u=n(87679),h=n(58554);const m=new(n(84947).A)(100);var p=n(37661),g=n(5912),f=n(17712),v=n(62587),A=n(69419),y=n(59030),C=n(19806),w=n(94189),I=n(52988),b=n(20021);const S=(0,o.ph)(({document:e,observeIntersection:t,smaller:n,canAutoLoad:S,autoLoadFileMaxSizeMb:M,uploadProgress:N,datetime:Y,className:k,sender:P,isSelected:F,isSelectable:T,shouldWarnAboutFiles:D,isDownloading:x,message:L,id:E,onCancelUpload:B,onMediaClick:R,onDateClick:O})=>{const{cancelMediaDownload:U,downloadMedia:K,setSharedSettingOption:z}=(0,i.ko)(),V=(0,o.li)(),j=(0,y.A)(),[J,G,$]=(0,p.A)(),[q,H]=(0,o.J0)(!1),{fileName:W,size:_,mimeType:Q}=e,Z=(0,r.rK)(e)||"",X=(0,g.Vz)(V,t),[ee,te]=(0,p.A)();(0,o.vJ)(()=>{X&&te()},[X,te]);const[ne,oe]=(0,o.J0)(S&&(!M||_<=1048576*M)),ie=Boolean(x||ne&&ee),se=(0,s.mr)(e,"download"),{loadProgress:ae,mediaData:re}=(0,A.A)(se,!ie,(0,s.Cz)(e,"download"),void 0,!0),de=Boolean(re),{isUploading:ce,isTransferring:le,transferProgress:ue}=(0,s.LK)(N||ae,ie&&!de,void 0!==N),he=(0,r.ON)(e),me=he?(0,s.VD)(e):void 0,pe=he?e.previewBlobUrl:void 0,ge=(0,v.A)((0,s.mr)(e,"pictogram"),!X),fe="photo"===e.innerMediaType&&e.mediaSize&&!e.mediaSize.fromDocumentAttribute&&!e.mediaSize.fromPreload,ve=R&&e.innerMediaType&&!fe;(0,o.vJ)(()=>{const e=V.current;if(!ve||!e||!L)return;const t=()=>{!async function(e){const t=(0,s.Op)(e),n=(0,s.nd)(e),o=t||n,a=n&&n.mediaSize&&!n.mediaSize.fromDocumentAttribute;if(!o||o.previewBlobUrl||a)return;const r=(0,s.mr)(o,"full");if(!r||m.has(r))return;m.set(r,void 0);const p=await(0,h.hd)(r,(0,s.Cz)(o,"full"));if(!p)return;let g;if(t&&l.Uz){const e=await(0,u.FW)(p);g={width:e.videoWidth,height:e.videoHeight,fromPreload:!0}}if(n){const e=await(0,u.NN)(p);g={width:e.naturalWidth,height:e.naturalHeight,fromPreload:!0}}if(!g||g.width<=0||g.height<=0)return;let f=(0,i.mS)();const v=(0,c.O5q)(f,e.chatId,e.id);v&&v.content.document&&(f=(0,d.r3y)(f,e.chatId,e.id,{content:{...v.content,document:{...v.content.document,mediaSize:g}}}),(0,i.UF)(f))}(L)};return e.addEventListener("mouseenter",t),()=>{e.removeEventListener("mouseenter",t)}},[ve,L]);const Ae=(0,f.A)(()=>{K({media:e,originMessage:L})}),ye=(0,f.A)(()=>{ce?B&&B():x?U({media:e}):le?oe(!1):ve?L?R?.(L.id):R&&R():(0,a.N)({mimeType:Q,extension:Z})&&D?G():Ae()}),Ce=(0,f.A)(()=>{z({shouldWarnAboutFiles:!q}),$(),Ae()}),we=(0,f.A)(()=>{O?.(L)});return(0,b.FD)(b.FK,{children:[(0,b.Y)(I.A,{ref:V,id:E,name:W,extension:Z,size:_,timestamp:Y,thumbnailDataUri:me,previewData:pe||ge,smaller:n,isTransferring:le,isUploading:ce,transferProgress:ue,className:k,sender:P,isSelectable:T,isSelected:F,actionIcon:ve?(0,s.hr)(e)?"play":"eye":"download",onClick:ye,onDateClick:O?we:void 0}),(0,b.FD)(w.A,{isOpen:J,onClose:$,confirmHandler:Ce,children:[j("lng_launch_svg_warning"),(0,b.Y)(C.A,{className:"dialog-checkbox",checked:q,label:j("lng_launch_exe_dont_ask"),onCheck:H})]})]})})},59324:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(84051),i=n(57474),s=n(41036),a=n(18276);var r=n(20021);const d=(0,o.ph)(({iconName:e,isLoading:t})=>(0,r.Y)(s.Ay,{className:"LLqNvbR9",activeKey:t?0:1,name:"fade",children:t?(0,r.Y)(i.A,{className:"PbV71feg",color:"white"}):(0,r.Y)(a.A,{className:"sohV68PB",name:e})}))},59816:(e,t,n)=>{n.d(t,{A:()=>P});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(87357),d=n(95807),c=n(39751),l=n(90709),u=n(48899),h=n(76023),m=n(82117),p=n(17712),g=n(93545),f=n(11241);const v="pruw1nLm";var A=n(20021);const y=(0,o.ph)(({story:e,mediaArea:t,index:n,className:s,style:a,isPreview:c})=>{const{sendStoryReaction:v}=(0,i.ko)(),y=(0,o.li)(),[C,w]=(0,o.J0)(1.5*h.$),{peerId:I,id:b,views:S}=e,{reactions:M}=S||{},{reaction:N,isDark:Y,isFlipped:k}=t,P=!(0,u.L8)(I),F=`${(0,l.$_)(I,b)}-${n}-${c?"preview":"viewer"}`,T=(0,o.Kr)(()=>M?.find(e=>(0,l.a0)(e.reaction,N))?.count,[N,M]),D=!c&&Boolean(T)&&P,x=(0,p.A)(()=>{if(!y.current)return;const e=y.current.clientHeight;w(Math.round(.6*e))});(0,m.A)(([e])=>{Boolean(T)!==Boolean(e)&&x()},[T]),(0,g.A)(y,x);const L=(0,p.A)(()=>{v({peerId:I,storyId:b,containerId:F,reaction:N})});return(0,A.FD)("div",{ref:y,className:(0,r.A)(Y?"eic2vQ8c":"_7esBA3m",s),style:(0,d.A)(a,`--custom-emoji-size: ${C}px`),onClick:L,children:[(0,A.Y)("div",{className:(0,r.A)("c3ajA3hg",k&&"furSXGdL")}),Boolean(C)&&(0,A.Y)(f.A,{className:(0,r.A)("Et3MvYmN",D&&"mFTLUHm2"),reaction:N,containerId:F,size:C,effectSize:4*C,shouldPause:c,shouldLoop:!c}),D&&(0,A.Y)("span",{className:"Tr8mYyDk",children:T})]})});var C=n(61433),w=n(91048),I=n(48894);const b=e=>Boolean("en-US"===navigator.language)?`${Math.round(9*e/5+32)}°F`:`${Math.round(e)}°C`;var S=n(87412);const M=(0,o.ph)((0,i.EK)((e,t)=>{const{mediaArea:n}=t;return{restrictedEmoji:(0,w.GHK)(e,n.emoji)}})(({mediaArea:e,className:t,style:n,restrictedEmoji:i,isPreview:s})=>{const c=(0,o.li)(),[l,u]=(0,o.J0)(0),{temperatureC:h,color:m}=e,f=(0,I.t)(m),v=(0,I.vG)(m),y=(0,p.A)(e=>{if(!c.current)return;const t=c.current,n=t.clientHeight,o=Math.round(.7*n);u(o);const i=()=>{(0,C.Tv)(t,{"--custom-emoji-size":`${o}px`,"font-size":n/32+"rem"})};if(e)return i;(0,a.RK)(i)});return(0,o.Nf)(()=>{(0,a.gm)(()=>y(!0))},[]),(0,g.A)(c,()=>y()),(0,A.Y)("div",{ref:c,className:(0,r.A)("KBjMtRUS",t),style:(0,d.A)(n,`--custom-background-color: ${f}`,`color: ${v}`),children:(0,A.FD)("div",{className:"IFChB3tD",children:[i&&(0,A.Y)(S.A,{documentId:i.id,size:l,noPlay:s,withTranslucentThumb:!0,forceAlways:!0},i.id),(0,A.Y)("p",{className:"_ke1UBIl",children:b(h)})]})})})),N=9/16,Y=new Set(["channelPost","uniqueGift"]);function k(e,t){const{x:n,y:o,width:i,height:s,rotation:a,radius:r}=e.coordinates;let c="";if(t&&r&&t>0){const e=t*(i/100),n=t*(s/100);c=Math.min(e,n)*(r/100)+"px"}return(0,d.A)(`left: ${n}%`,`top: ${o}%`,`width: ${i}%`,`height: ${s}%`,`transform: rotate(${a}deg) translate(-50%, -50%)`,c&&`border-radius: ${c}`)}const P=(0,o.ph)(({story:e,isActive:t,className:n,isStoryPlaying:d})=>{const{openMapModal:l,openUniqueGiftBySlug:u,focusMessage:h,closeStoryViewer:m,openUrl:p}=(0,i.ko)(),g=(0,o.li)(),[f,C]=(0,o.J0)(0),w=(0,c.A)();(0,o.vJ)(()=>{if(!g.current)return;const e=g.current;if(C(e.clientWidth),w.width>s.c2m)return void(0,a.RK)(()=>{e.style.removeProperty("--media-width"),e.style.removeProperty("--media-height")});const t=w.width/w.height,n=t<N?e.clientHeight*N:e.clientWidth,o=t<N?e.clientHeight:e.clientWidth/N;(0,a.RK)(()=>{e.style.setProperty("--media-width",`${n}px`),e.style.setProperty("--media-height",`${o}px`)})},[t,w]);const I=e.mediaAreas;return(0,A.Y)("div",{className:(0,r.A)("RXAMu4VD",!t&&"_5HkplWee",n),ref:g,children:I?.map((n,o)=>{switch(n.type){case"geoPoint":case"venue":case"channelPost":case"url":case"uniqueGift":{const e=t&&!Y.has(n.type);return(0,A.Y)("div",{className:(0,r.A)(v,e&&"xFjJpeOA"),style:k(n),onClick:()=>(e=>{switch(e.type){case"geoPoint":case"venue":l({geoPoint:e.geo});break;case"channelPost":h({chatId:e.channelId,messageId:e.messageId}),m();break;case"url":p({url:e.url});break;case"uniqueGift":u({slug:e.slug})}})(n)})}case"suggestedReaction":return(0,A.Y)(y,{story:e,mediaArea:n,index:o,isPreview:!t,className:v,style:k(n)},`${n.type}-${o}`);case"weather":return(0,A.Y)(M,{mediaArea:n,className:v,style:k(n,f),isPreview:!t||d},`${n.type}-${o}`);default:return}})})})},60138:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051),i=n(37836),s=n(17712);function a(e){const t=(0,s.A)(e);(0,o.vJ)(()=>(0,i.yu)(t),[t])}},60406:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(61433),s=n(66644),a=n(37836);const r=({containerRef:e,selector:t},n)=>{(0,o.Nf)(()=>{const n=e.current?.querySelectorAll(t);if(!n?.length)return;const o=(0,a.nF)(e=>{const t=e.target,n=t.scrollTop>0;(0,s.RK)(()=>{(0,i.dH)(t,"scrolled",n)})},100);return n.forEach(e=>{(0,i.YM)(e,"with-notch"),e.addEventListener("scroll",o,{passive:!0})}),()=>{n.forEach(e=>{e.removeEventListener("scroll",o),(0,i.HW)(e,"with-notch")})}},[e,t,...n]),(0,o.vJ)(()=>{const n=e.current?.querySelectorAll(t);n?.length&&n.forEach(e=>{const t=e.scrollTop>0;(0,s.RK)(()=>{(0,i.dH)(e,"scrolled",t)})})},[e,t,...n])}},61097:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(90709),i=n(84051),s=n(66644),a=n(67054),r=n(87679),d=n(41074),c=n(17712);const l=.1;let u=-1;function h(e,t){return function(e,t=!1){const n=(0,i.li)(),o=(0,i.Kr)(()=>(0,a.A)(d.bP,++u),[]),h=(0,i.li)(),m=(0,c.A)(async(e,t)=>{const n=await(0,r.NN)(t);n&&(0,s.RK)(()=>{e.width=n.width,e.height=n.height,h.current=e.transferControlToOffscreen();const i=Math.ceil(Math.min(n.width,n.height)*l);(0,d.M1)({name:"offscreen-canvas:blurThumb",args:[h.current,t,i],transferables:[h.current]},o)})});return(0,i.Nf)(()=>{if(!e||t||h.current)return;const o=n.current;o&&m(o,e)},[m,t,e]),n}(e?"string"==typeof e?e:(0,o.VD)(e):void 0,t)}},63744:(e,t,n)=>{n.d(t,{A:()=>p});var o=n(84051),i=n(13439),s=n(91048),a=n(71331),r=n(87357),d=n(14),c=n(59030),l=n(48885),u=n(26875),h=n(64493),m=n(20021);const p=(0,o.ph)((0,i.EK)((e,{chatId:t})=>{const n=(0,s.hds)(e,t),o=(0,a.mD)(e,t);return{groupCall:o,isActive:((0,s.nTw)(e).isMasterTab?e.groupCalls.activeGroupCallId:void 0)!==o?.id&&Boolean(o?o.participantsCount>0&&o.isLoaded:n&&n.isCallNotEmpty&&n.isCallActive)}})(({chatId:e,isActive:t,className:n,groupCall:s,onPaneStateChange:a})=>{const{requestMasterAndJoinGroupCall:p}=(0,i.ko)(),g=(0,c.A)(),f=(0,o.hb)(()=>{p({chatId:e})},[p,e]),v=s?.participants,A=(0,o.Kr)(()=>{if(!v)return[];const e=(0,i.mS)().users.byId,t=(0,i.mS)().chats.byId;return Object.values(v).slice(0,3).map(({id:n})=>e[n]||t[n]).filter(Boolean)},[v]),y=(0,d.A)(s?.participantsCount,!0),C=(0,d.A)(A,!0),w=Boolean(s&&t),{ref:I,shouldRender:b}=(0,l.A)({isOpen:w,onStateChange:a});if(b)return(0,m.FD)("div",{ref:I,className:(0,r.A)("GroupCallTopPane",n),onClick:f,children:[(0,m.FD)("div",{className:"info",children:[(0,m.Y)("span",{className:"title",children:g("VoipGroupVoiceChat")}),(0,m.Y)("span",{className:"participants",children:g("Participants",y??0,"i")})]}),Boolean(C?.length)&&(0,m.Y)(u.A,{size:"small",peers:C,className:"avatars"}),(0,m.Y)(h.A,{round:!0,className:"join",children:g("VoipChatJoin")})]})}))},63988:(e,t,n)=>{n.d(t,{D7:()=>c,aG:()=>r,gs:()=>a,tF:()=>d});var o=n(16581),i=n(83414),s=n(672);function a(e,t,n,o=!1){return(0,s.A)(t=>{t(e())},t,n,o)}function r(e,t,n=!1){const o=a(()=>e(),[e],t,n);return(0,i.A)(o,[o,e],!0)}function d(e,t,n,i=!1,s=!1){return(0,o.A)(t=>{t(e())},t,n,i,s)}function c(e,t,n=!1,o=!1){const s=d(()=>e(),[e],t,n,o);return(0,i.A)(s,[s,e],!0)}},64154:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(13439),s=n(37836);const a=new Map;function r(e,t,n,s){const r=s&&n?e?.byLangCode[s]?.[n]:void 0,{isPending:c,text:l}=r||{};return(0,o.vJ)(()=>{t&&n&&!l&&void 0===c&&s&&function(e,t,n){const o=a.get(n)||new Map,s=o.get(e)||[];s.includes(t)||(s.push(t),o.set(e,s),a.set(n,o),(0,i.ko)().markMessagesTranslationPending({chatId:e,messageIds:s,toLanguageCode:n})),d()}(t,n,s)},[t,l,c,n,s]),t&&n?{isPending:c,translatedText:l}:{isPending:!1,translatedText:void 0}}const d=(0,s.nF)(function(){const{translateMessages:e}=(0,i.ko)();let t=!1;a.forEach((n,o)=>{n.forEach((n,i)=>{const s=n.slice(0,20);s.length<n.length&&(t=!0),e({chatId:i,messageIds:s,toLanguageCode:o}),function(e,t,n){const o=a.get(n);if(!o?.size)return void a.delete(n);const i=o.get(e);if(!i?.length)return void o.delete(e);const s=i.filter(e=>!t.includes(e));if(!s?.length)return o.delete(e),void(o.size||a.delete(n));o.set(e,s)}(i,s,o)})}),t&&d()},500)},65240:(e,t,n)=>{n.d(t,{Ay:()=>R});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(90709),d=n(91048),c=n(56494),l=n(53827),u=n(87357),h=n(50442),m=n(17663),p=n(58443),g=n(91525),f=n(4961),v=n(43874),A=n(88792),y=n(71533),C=n(39351),w=n(17712),I=n(62587),b=n(69419),S=n(59030),M=n(50680),N=n(64493),Y=n(96530),k=n(35913),P=n(4438),F=n(18276),T=n(20021);const D=window.matchMedia("(max-width: 375px)"),x=window.matchMedia("(max-width: 410px)");function L(e,t,n,o,i,s,a,r,d,c,l,u){const{title:h,performer:p,fileName:v}=n,A=i||s>0&&s<1,{isRtl:y}=e;return(0,T.FD)("div",{className:"content",children:[(0,T.Y)("p",{className:"title",dir:"auto",title:h,children:(0,f.A)(h||v)}),A&&(0,T.FD)("div",{className:"meta",dir:y?"rtl":void 0,children:[(0,T.Y)("span",{className:"duration with-seekline",dir:"auto",children:(0,m.QO)(o*s,o)}),B(s,a,r)]}),!A&&d&&(0,T.FD)("div",{className:"meta",dir:y?"rtl":void 0,children:[l?`${(0,g.zV)(n.size*l)} / `:void 0,(0,g.zV)(n.size)]}),!A&&!d&&(0,T.FD)("div",{className:"meta",dir:y?"rtl":void 0,children:[(0,T.Y)("span",{className:"duration",dir:"auto",children:(0,m.QO)(o)}),p&&(0,T.FD)(T.FK,{children:[(0,T.Y)("span",{className:"bullet",children:""}),(0,T.Y)("span",{className:"performer",dir:"auto",title:p,children:(0,f.A)(p)})]}),Boolean(c)&&(0,T.FD)(T.FK,{children:[(0,T.Y)("span",{className:"bullet",children:""}),(0,T.Y)(Y.A,{className:"date",onClick:u,children:(0,m.fS)(t,1e3*c,!0)})]})]})]})}function E(e,t,n,o,i,s,r,d,c,l,h,p){return(0,T.FD)("div",{className:"content",children:[(0,T.FD)("div",{className:"waveform-wrapper",children:[(0,T.Y)("div",{className:"waveform",draggable:!1,ref:t,children:(0,T.Y)("canvas",{ref:n})}),l&&(0,T.FD)(N.A,{onClick:()=>{(d||c)&&h?h(!r):s||l()},children:[(0,T.Y)(F.A,{name:d||c?"down":"transcribe",className:(0,u.A)("transcribe-icon",(d||c)&&!r&&"transcribe-shown")}),s&&(0,T.Y)("svg",{viewBox:"0 0 32 24",className:"loading-svg",children:(0,T.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"})})]})]}),(0,T.Y)("p",{className:(0,u.A)("voice-duration",p!==a.d9.OneTimeModal&&i&&"unread"),dir:"auto",children:0===o||1===o?(0,m.QO)(e.duration):(0,m.QO)(e.duration*o)})]})}function B(e,t,n){return(0,T.FD)("div",{className:"seekline",ref:n,children:[t.map(({start:e,end:t})=>(0,T.Y)("div",{className:"seekline-buffered-progress",style:`left: ${100*e}%; right: ${100-100*t}%`})),(0,T.Y)("span",{className:"seekline-play-progress",children:(0,T.Y)("i",{className:"seekline-play-progress-inner",style:`transform: translateX(${100*e}%)`})}),(0,T.Y)("span",{className:"seekline-thumb",children:(0,T.Y)("i",{className:"seekline-thumb-inner",style:`transform: translateX(${100*e}%)`})})]})}const R=(0,o.ph)((0,i.EK)((e,{message:t})=>({webPage:(0,d.Pn$)(e,t),mediaDuration:(0,c.Y9)(e,t)}))(({theme:e,message:t,senderTitle:n,uploadProgress:d,origin:c,date:g,noAvatars:R,className:O,isSelectable:U,isSelected:K,isDownloading:z,isTranscribing:V,isTranscriptionHidden:j,isTranscribed:J,isTranscriptionError:G,canDownload:$,canTranscribe:q,autoPlay:H,webPage:W,mediaDuration:_,onHideTranscription:Q,onPlay:Z,onPause:X,onReadMedia:ee,onCancelUpload:te,onDateClick:ne})=>{const{cancelMediaDownload:oe,downloadMedia:ie,transcribeAudio:se,openOneTimeMediaModal:ae}=(0,i.ko)(),{content:{audio:re,voice:de,video:ce},isMediaUnread:le}=t,ue=re||(0,r.y3)(W),he=de||ce||ue,me=de||ce,pe=Boolean(de||ce),ge=(0,o.li)(!1),fe=(0,o.li)(),ve=(0,S.A)(),Ae=(0,C.A)(),{isMobile:ye}=(0,v.Ay)(),[Ce,we]=(0,o.J0)(!1),Ie=Ce||!0,be=(0,r.VO)(he,"pictogram"),Se=(0,I.A)(be,!1,s.qZ.BlobUrl),Me=(0,r.G5)(t),Ne=c===a.d9.OneTimeModal,Ye=pe?Me?"oneTimeVoice":"voice":"audio",ke=(0,I.A)((0,r.VO)(he,"inline"),!Ie,(0,r.Cz)(he,"inline")),{loadProgress:Pe}=(0,b.A)((0,r.VO)(he,"download"),!z,(0,r.Cz)(he,"download")),Fe=(0,w.A)(()=>{we(!0),Z?.(t.id,t.chatId)}),Te=(0,w.A)(()=>{we(!1)}),{isBuffered:De,bufferedRanges:xe,bufferingHandlers:Le,checkBuffering:Ee}=(0,y.A)(),Be=Ne,{isPlaying:Re,playProgress:Oe,playPause:Ue,setCurrentTime:Ke,duration:ze}=(0,A.A)((0,l.dj)(t),_,Ye,ke,Le,void 0,Ee,Boolean(Ce||H),Fe,Te,(0,r.Nb)(t)||Me,void 0,X,Be,Me&&!Ne),Ve=1-Oe,je=(0,r.Ie)(t),Je=Me&&Ne,Ge=function(e,t,n=0,i=!1,s=!1,a=!1,r=!1){const d=(0,o.li)(),{data:c,peak:l}=(0,o.Kr)(()=>{if(!t)return;const{waveform:e,duration:n}=t;if(!e)return{data:new Array(Math.min(n,30)).fill(0),peak:0};const{MIN_SPIKES:o,MAX_SPIKES:i}=function(e,t){return{MIN_SPIKES:e?D.matches?16:20:25,MAX_SPIKES:e?D.matches?35:t&&x.matches?40:45:75}}(a,s),r=Math.min(n/10,1),d=Math.round(o+(i-o)*r);return function(e,t){let n=0;const o=new Array(t),i=e.length/t,s=e[0],a=e[e.length-1];for(let r=0;r<t;r++){const t=Math.floor(r*i),d=((e[t-1]??s)+(e[t]??s)+(e[t+1]??a))/3;o[r]=d,n<d&&(n=d)}return{data:o,peak:n}}(function(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const o=Array(n),i=e;for(let e=0,t=n-1;e!==t;++e){const t=Math.floor(5*e/8),n=Math.floor(5*e%8),s=i[t]+(i[t+1]<<8);o[e]=s>>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)<P?C(Math.max(o,i)):C(void 0),f(o>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;o<H?o=H:o>n.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("<br>"===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||o<n&&s>0?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<c.length;e++){const{heights:t,lineCounts:n}=c[e],a=n.length,r=P(t,0)+i*(a-1),d=Math.min(...t)<o?1.5:1,l=(()=>{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||m<h)&&(u=c[e],h=m)}const m=u.lineCounts,p=u.heights,g=m.length;let f=0,v=0;for(let e=0;e!==g;++e){const t=m[e],o=p[e],s=Math.round(o);let r=0;for(let c=0;c!==t;++c){const l=0|(0===e?1:0)|(e===g-1?4:0)|(0===c?8:0)|(c===t-1?2:0),u=a[f],h=c===t-1?n-r:Math.round(u*o);d[f]={dimensions:{x:r,y:v,width:h,height:s},sides:l},r+=h+i,++f}v+=s+i}return d}(h):2===r?function(e){const{ratios:t,proportions:n,averageRatio:o}=e;return"ww"===n&&o>1.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)<re,u=Math.abs(c-o)<de;l&&u?y():C()},[h],ne.YS);return(0,o.vJ)(()=>{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<v),S=g?l("CommentsCount","%COMMENTS_COUNT%",void 0,g).split("%").map(e=>"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<n)}})(function({message:e,story:t,peer:n,isUnread:o,targetUser:s}){const{openStoryViewer:a}=(0,i.ko)(),r=(0,K.A)(),{storyData:l}=e.content,u=(0,U.A)(()=>{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&&gt&&!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