"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[5718],{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),l=n(94189),c=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,c.Y)(l.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:l,metaKey:c,shiftKey:u,key:h}=t;if(n!==d)return!1;if(s){if(!l&&!c)return!1}else{if(o!==l)return!1;if(i!==c)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),l=n(36353),c=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,c.LV)(w.current);return o.match(d.TL?A:y)?.[0]},[t,C,w,e],v),F=(0,m.A)(k,[k,t,C],!0),P=(0,p.A)(()=>Boolean(F()),[F]),T=Boolean(I?.length);(0,o.vJ)(()=>{if(!e||!P)return;const t=F();if(t){if(!T){const e=d.TL?t:t.match(/.+alt="(.+)"/)?.[1];e&&b({emoji:e})}}else S()},[e,P,F,T,S,b]);const D=(0,f.A)(t=>{const o=F();if(!e||!o)return;const i=w.current,s=(0,c.LV)(i),r=d.TL?o:o.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),h=new RegExp(`(${r})\\1*$`,""),m=s.match(h)[0].length/o.length,p=Array.from({length:m},()=>(0,u.hB)(t)),g=s.replace(h,p.join("")),f=i.innerHTML.substring(s.length);n(`${g}${f}`),(0,a.Uz)(()=>{(0,l.A)(i,!0,!0)})});return(0,o.vJ)(Y,[Y,t]),{isCustomEmojiTooltipOpen:Boolean(P&&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},l=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),l.catch(()=>{}).finally(()=>{t.delete(a),d.callback&&n.delete(d.callback)}),this.postMessageOnTickEnd(r,i),l}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:()=>f});var o=n(84051),i=n(66644),s=n(83868),a=n(82117),r=n(17712);const d=7,l=100,c=7,u="no-overscroll",h="no-touch",m=350,p=75,g={lastDeltas:new Array(d).fill(0),lastAverageDelta:0,isStartedAtTop:!1,resetStartTopAt:void 0,timeout:void 0};function f({containerRef:e,isOverscrolled:t,isDisabled:n,onOverscroll:f,onReset:v}){const[A,y]=(0,o.Ul)("normal"),C=(0,o.li)({...g}),w=(0,o.li)(),I=(0,o.li)(),b=(0,r.A)(()=>{clearTimeout(w.current),y("overscroll"),f?.()}),S=(0,r.A)(()=>{y("animating"),w.current=window.setTimeout(()=>{y("normal")},m),v?.()}),M=(0,r.A)(e=>{clearTimeout(C.current.timeout),C.current.timeout=window.setTimeout(()=>{C.current={...g}},e)}),N=(0,r.A)(t=>{const n=e.current;if(!n||t.defaultPrevented)return;const{deltaY:o}=t,{scrollTop:i}=n,a=A(),r=C.current,u=r.lastAverageDelta,h=0===r.lastDeltas.at(-1)||r.resetStartTopAt&&Date.now()>=r.resetStartTopAt;0===i&&h&&(r.isStartedAtTop=!0,r.resetStartTopAt=void 0);const m=C.current.lastDeltas.slice();m.push(o),m.length>d&&m.shift(),C.current.lastDeltas=m;const p=m.reduce((e,t)=>e+t,0)/m.length;C.current.lastAverageDelta=p;const g=Math.abs(p)-Math.abs(u)>c;return M(l),0===i&&o<0&&"overscroll"!==a?(r.resetStartTopAt||(r.resetStartTopAt=Date.now()+l),void(g&&r.isStartedAtTop&&b())):"animating"===a&&o>0?void(0,s.A)(t):"overscroll"===a&&o>0?(S(),void(0,s.A)(t)):void 0}),Y=(0,r.A)(t=>{const n=e.current;if(!n||1!==t.touches.length)return;const{scrollTop:o}=n,i=A();0!==o&&"overscroll"!==i||(I.current=t.touches[0].clientY)}),k=(0,r.A)(t=>{const n=e.current,o=I.current;if(!n||void 0===o||1!==t.touches.length)return;const{scrollTop:i}=n,s=A(),a=t.touches[0].clientY-o;return"animating"!==s?0===i&&a>p&&"overscroll"!==s?(b(),void(I.current=void 0)):"overscroll"===s&&a<-p?(S(),void(I.current=void 0)):void 0:void 0}),F=(0,r.A)(()=>{I.current=void 0});(0,o.vJ)(()=>{const t=e.current;if(!n&&t)return(0,i.RK)(()=>{t.classList.add(u)}),()=>{(0,i.RK)(()=>{t.classList.remove(u)})}},[e,n]),(0,o.vJ)(()=>{const t=e.current;if(!n&&t)return(0,i.RK)(()=>{t.classList.toggle(h,"normal"!==A())}),()=>{(0,i.RK)(()=>{t.classList.remove(h)})}},[e,n,A]),(0,a.A)(([e])=>{e!==t&&(t||"animating"!==A())&&y(t?"overscroll":"normal")},[t,A,y]),(0,o.vJ)(()=>{const t=e.current;if(!n&&t)return t.addEventListener("wheel",N,{passive:"normal"===A()}),t.addEventListener("touchstart",Y,{passive:!0}),t.addEventListener("touchmove",k,{passive:!0}),t.addEventListener("touchend",F,{passive:!0}),t.addEventListener("touchcancel",F,{passive:!0}),()=>{t.removeEventListener("wheel",N),t.removeEventListener("touchstart",Y),t.removeEventListener("touchmove",k),t.removeEventListener("touchend",F),t.removeEventListener("touchcancel",F);const e=C.current;e?.timeout&&clearTimeout(e.timeout)}},[e,N,Y,k,F,A,n])}},8247:(e,t,n)=>{n.d(t,{A:()=>g});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(91048),l=n(79824),c=n(18501),u=n(43874),h=n(74984),m=n(39351),p=n(17712);const g=e=>{const{sidebarMode:t,orderedFolderIds:n,chatFoldersById:g,maxFolders:f,isReadOnly:v}=e,{maxChatLists:A,folderInvitesById:y,maxFolderInvites:C}=v?{}:e,w=(0,m.A)(),{isMobile:I}=(0,u.Ay)(),{openShareChatFolderModal:b,openDeleteChatFolderModal:S,openEditChatFolder:M,openLimitReachedModal:N,markChatMessagesRead:Y,openSettingsScreen:k,setSharedSettingOption:F}=(0,i.ko)(),P=(0,o.Kr)(()=>({id:r.DSF,title:{text:n?.[0]===r.DSF?w("FilterAllChatsShort"):w("FilterAllChats")},includedChatIds:l.p,excludedChatIds:l.p,emoticon:"💬"}),[n,w]),T=(0,o.Kr)(()=>n?n.map(e=>e===r.DSF?P:g[e]||{}).filter(Boolean):void 0,[g,P,n]),D=(0,h.Jm)(),x=(0,p.A)(e=>{const t=D[e];t?.length&&t.forEach(e=>{Y({id:e})})}),L=(0,h.ic)(),E=(0,o.Kr)(()=>{if(T&&T.length)return T.map((e,n)=>{const{id:o,title:l}=e,u=o!==r.DSF&&n>f-1,h=(0,d.w5O)((0,i.mS)(),o),m=[];v||(h&&m.push({title:w("FilterShare"),icon:"link",handler:()=>{Object.values(g).reduce((e,t)=>e+(t.isChatList?1:0),0)>=A&&!e.isChatList?N({limit:"chatlistJoined"}):y[o]?.length>=C?N({limit:"chatlistInvites"}):b({folderId:o})}}),o===r.DSF?(m.push({title:w("FilterEditFolders"),icon:"edit",handler:()=>{k({screen:a.VS.Folders})}}),D[o]?.length&&m.push({title:w("ChatListMarkAllAsRead"),icon:"readchats",handler:()=>x(e.id)})):(m.push({title:w("EditFolder"),icon:"edit",handler:()=>{M({folderId:o})}}),D[o]?.length&&m.push({title:w("ChatListMarkAllAsRead"),icon:"readchats",handler:()=>x(e.id)}),m.push({title:w("FilterMenuDelete"),icon:"delete",destructive:!0,handler:()=>{S({folderId:o})}})),I||(m.push({isSeparator:!0}),m.push({title:w(t?"TabsPositionTop":"TabsPositionLeft"),icon:"forums",handler:()=>{F({foldersPosition:t?"top":"left"})}})));const p={text:l.text,entities:l.entities,noCustomEmojiPlayback:e.noTitleAnimations};let Y=e.emoticon;if(t){p.emojiSize=10;const e=l.entities?.find(e=>e.type===s.C7.CustomEmoji&&0===e.offset);if(e){Y=e;const{offset:t,length:n}=e;p.text=l.text.replace(l.text.substring(t,t+n),""),p.entities=l.entities?.filter(e=>e.offset!==t).map(e=>({...e,offset:e.offset-n}))}}const P=(0,c.fd)(p);return{id:o,title:P,badgeCount:L[o]?.chatsCount,isBadgeActive:Boolean(L[o]?.notificationsCount),isBlocked:u,contextActions:m.length?m:void 0,emoticon:Y,noTitleAnimations:e.noTitleAnimations}})},[T,f,L,w,g,A,y,C,D,v,t,I]);return{displayedFolders:T,folderTabs:E}}},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),l=n(36353),c=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)(),[F,P,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,c.Am)([...L()&&S||[],...n||[]]),query:o,type:"user"});k(Object.values((0,c._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),c=(0,d.F9)(N,e)||"",h=i?`@${i}`:`${c}`,m=I.current,p=w((0,u.LV)(m)),g=o?p.length:p.lastIndexOf("@"),f=(i?i.length+1:c.length)-(p.length-g);if(-1!==g){const e=`${p.substr(0,g)}${h} `,o=w(m.innerHTML).substring(p.length),i=(0,u.JC)(m);n(`${e}${o}`),(0,a.Uz)(()=>{const e=i+f+1;(0,l.A)(m,t),e>=0&&(0,u.vZ)(m,e)})}k(void 0)});return(0,o.vJ)(T,[T,t]),{isMentionTooltipOpen:Boolean(Y?.length&&!F),closeMentionTooltip:P,insertMention:E,mentionFilteredUsers:Y}}function w(e){return e.replace(/
n.width-q&&(o=n.width-q),Ee({x:o,y:t.top-n.top}),Re(e),De()}function We(){Ie.current&&window.clearTimeout(Ie.current),Ie.current=window.setTimeout(He,260)}const _e=(0,b.A)(e=>"Enter"===e.key&&!e.shiftKey&&!ze&&("enter"===de&&!e.shiftKey||"ctrl-enter"===de&&(e.ctrlKey||e.metaKey))),Qe=(0,b.A)(e=>{e.preventDefault(),xe(),me()}),Ze=(0,b.A)(()=>Ce());(0,o.vJ)(()=>{c.TF||te&&Ge()},[n,Ge,se,te]),(0,o.vJ)(()=>{if(!n||j!==s.CfG&&j!==s.e0F||ze||ae)return;const e=e=>{const t=e.target,n=we.current;if(!(_&&n&&t&&t!==n&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName)||t.isContentEditable||(0,h.N)("Enter"))return;if(_e(e))return void Qe(e);const{key:o}=e;if(ne||(0,m.ZJ)()||H.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,ze,_,ae,ne]),(0,o.vJ)(()=>{const e=(0,f.sg)(e=>{"Tab"!==e.key||(0,m.ZJ)()||(e.preventDefault(),(0,a.RK)(Ge))},2e3,!0,!1);return(0,h.A)({onTab:e})},[Ge]),(0,o.vJ)(()=>{const e=we.current;function t(){e.blur()}return oe&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}},[oe]);const Xe=(0,C.A)(()=>Boolean(_&&Q()),[_,Q]),et=(0,u.A)("form-control allow-selection",Xe&&"touched",oe&&"focus-disabled"),tt=(0,u.A)("input-scroller-content",le&&"is-need-premium"),nt="string"==typeof Z?Z:void 0;return(0,J.FD)("div",{id:t,onClick:oe?he:void 0,dir:Fe.isRtl?"rtl":void 0,children:[(0,J.Y)("div",{className:(0,u.A)("custom-scroll",$,le&&"is-need-premium"),onScroll:pe,onClick:N||ee?void 0:function(){N||ee||T&&le||ye({chatId:n,messageListType:ce})},children:(0,J.FD)("div",{className:tt,children:[(0,J.Y)("div",{ref:we,id:j||s.CfG,className:et,contentEditable:N||ee,role:"textbox",dir:"auto",spellCheck:!l.Vq&&void 0,tabIndex:0,onClick:Ge,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(ue("
"===t?"":t),!c.TF&&(!n||!n.length)&&(c.TL||!t.includes("emoji-small"))&&!t.includes("custom-emoji")){const e=window.getSelection();e&&(we.current.blur(),e.removeAllRanges(),(0,g.A)(we.current,!0))}},onKeyDown:function(e){const{isComposing:t}=e,n=Q();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 Ae({targetIndexDelta:t})}!t&&_e(e)?Qe(e):t||"ArrowUp"!==e.key||n||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",We,{once:!0}):(e.preventDefault(),ve())},onMouseDown:function(e){function t(e){e instanceof KeyboardEvent&&"Esc"!==e.key&&"Escape"!==e.key||(setTimeout(()=>{Pe.current=!1},100),window.removeEventListener("keydown",t),window.removeEventListener("mousedown",t))}2===e.button?Pe.current||(Pe.current=!0,document.addEventListener("mousedown",t),document.addEventListener("keydown",t)):(e.currentTarget.closest(".message-input-wrapper")||e.target).addEventListener("mouseup",We,{once:!0})},onContextMenu:c.Ni?function(e){qe()&&(Ue(!Oe),Oe?xe():(e.preventDefault(),e.stopPropagation(),He()))}:void 0,onTouchCancel:c.Ni?We:void 0,"aria-label":nt,onFocus:le?void 0:ge,onBlur:le?void 0:fe}),!X&&(0,J.FD)("span",{className:(0,u.A)("placeholder-text",!N&&!ee&&"with-icon",le&&"is-need-premium"),dir:"auto",children:[!N&&!ee&&(0,J.Y)(K.A,{name:"lock-badge",className:"placeholder-icon"}),Z,T&&le&&(0,J.Y)(z.A,{className:"unlock-button",size:"tiny",color:"adaptive",onClick:Ze,children:ke("StoryRepliesLockedButton")})]}),(0,J.Y)("canvas",{ref:Me,className:"shared-canvas"}),(0,J.Y)("canvas",{ref:Ne,className:"shared-canvas"}),(0,J.Y)("div",{ref:Ye,className:"absolute-video-container"})]})}),(0,J.Y)("div",{ref:Se,className:(0,u.A)("custom-scroll",$,"clone",le&&"is-need-premium"),children:(0,J.Y)("div",{className:tt,children:(0,J.Y)("div",{ref:be,className:(0,u.A)(et,"clone"),dir:"auto"})})}),void 0!==d&&(0,J.Y)("div",{className:"max-length-indicator",dir:"auto",children:d}),(0,J.Y)(G,{isOpen:Te,anchorPosition:Le,selectedRange:Be,setSelectedRange:Re,onClose:$e}),X&&(0,J.Y)("span",{className:"forced-placeholder",children:(0,v.A)(X)})]})}))},79882:(e,t,n)=>{n.d(t,{E5:()=>s,IP:()=>i,We:()=>a});var o=n(84051);let i=function(e){return e[e.Shift=0]="Shift",e[e.Move=1]="Move",e[e.Opacity=2]="Opacity",e[e.None=3]="None",e}({});const s="archive";function a(e,t,n){return(0,o.Kr)(()=>{if(t)return()=>i.None;const o=Object.values(e),s=o.filter(e=>e<0).length,a=o.filter(e=>e>0).length;return t=>{const o=e[t];return o?o===1/0||o===-1/0||s<=a&&o<0||a0?i.Opacity:i.Move:n?i.Shift:i.None}},[e,n,t])}},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),l=n(80999),c=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,c.FD)("p",{className:"typing-status",dir:n.isRtl?"rtl":"auto",children:[o&&(0,c.Y)("span",{className:"sender-name",dir:"auto",children:(0,r.A)(o)}),(0,c.Y)(l.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),l=n(35749),c=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,c.A)(e),k=(0,l.A)(e,"pictogram"),F=(0,p.A)(k,!b),P=(0,g.A)(F),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",P),muted:!0,loop:!0,playsInline:!0,draggable:!1,disablePictureInPicture:!0,onContextMenu:n?d.A:void 0}):(0,A.Y)("img",{src:F,className:(0,a.A)("full-media","media-miniature",P),alt:"",draggable:!1,decoding:"async",onContextMenu:n?d.A:void 0}),L&&(0,A.Y)(v.A,{thumbDataUri:F||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:()=>l});var o=n(84051),i=n(87357),s=n(17663),a=n(59030),r=n(45),d=n(20021);const l=(0,o.ph)(({className:e,message:t,outgoingStatus:n,draftDate:o})=>{const l=(0,a.A)(),c=o&&o>t.date;return(0,d.FD)("div",{className:(0,i.A)("LastMessageMeta",e),children:[n&&!c&&(0,d.Y)(r.A,{status:n}),(0,d.Y)("span",{className:"time",children:(0,s.be)(l,1e3*(c?o:t.date))})]})})},84313:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(84051),i=n(13439),s=n(96454),a=n(17712),r=n(59030);const d=8e3;function l(e,t,n){const{showNotification:l}=(0,i.ko)(),c=(0,r.A)(),[u,h]=(0,o.J0)(!1),m=(0,a.A)(()=>{h(!0),t||l({message:s.yS?c("Video.Unsupported.Mobile"):c("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),l=n(17663),c=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,F=2*(k-6)*Math.PI;let P;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),le=!Boolean(de)||oe||re,ce=(0,w.A)(W,le);(0,v.A)({hasMediaData:!le,ref:ce});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=F-we()*F;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,c.A)(j.current))}),Se=(0,f.A)(()=>{P?.(),P=be}),Me=(0,f.A)(()=>{const e=j.current;ge?e.paused?((0,c.A)(e),(0,r._K)()):e.pause():(Se(),e.pause(),e.currentTime=0,(0,c.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})}),Fe=(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:ce,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":F,"stroke-dashoffset":F})})}),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,iconName:"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,l.QO)(ve):(0,l.QO)(W.duration),(!ge||j.current.paused)&&(0,Y.Y)(I.A,{name:"muted"})]}),O&&(0,Y.FD)(S.A,{onClick:Fe,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)}},87021:(e,t,n)=>{n.d(t,{A:()=>Hn});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(90709),l=n(70636),c=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 F(e,t){return e.reduce((e,t)=>e+t,t)}function P(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,l=i.some(e=>e>2),c=(0,b.w4)(e,!1,t,o);let u;const h={ratios:i,proportions:s,averageRatio:a,maxWidth:c,minWidth:100,maxHeight:c,spacing:2};return u=r>=5||l?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),l=[],c=e=>{const t=[];let o=0;e.forEach(e=>{t.push(((e,t)=>{const o=F(a.slice(e,e+t),0);return(n-(t-1)*i)/o})(o,e)),o+=e}),l.push({lineCounts:e,heights:t})};for(let e=1;e!==r;++e){const t=r-e;e<=3&&t<=3&&c([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&&c([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&&c([e,t,n,o])}let u,h=0;for(let e=0;e{for(let e=1;e!==a;++e)if(n[e-1]>n[e])return 1.5;return 1})(),m=Math.abs(r-s)*d*c;(!u||m 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,l=Math.min(s,Math.round(Math.min(d/t[0],r/t[1])));return[{dimensions:{x:0,y:0,width:d,height:l},sides:13},{dimensions:{x:d+i,y:0,width:r,height:l},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,l=Math.max(s,Math.round(Math.min((i-n)/2,Math.min(r*o[2],d*o[1])))),c=Math.min(Math.round(a*o[0]),i-n-l);return[{dimensions:{x:0,y:0,width:c,height:a},sides:13},{dimensions:{x:c+n,y:0,width:l,height:d},sides:3},{dimensions:{x:c+n,y:d+n,width:l,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]))),l=Math.round(Math.max(Math.max(i,.33*(e-2*n)),r*t[3])),c=s-d-l-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:c,height:u},sides:4},{dimensions:{x:d+n+c+n,y:a+n,width:l,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]),l=Math.round(r/t[2]),c=s-d-l-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:l},sides:2},{dimensions:{x:a+o,y:d+l+2*o,width:u,height:c},sides:6}]}(e)}(h),{layout:u,containerStyle:P(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(34201),J=n(9705),G=n(5130);let $,q;const H=new J.A;function W(){return Boolean(q||$)}g.CM&&setTimeout(async function(){if(!W()){if(g.zf)try{return q=await LanguageDetector.create(),void H.resolve()}catch(e){r.Oig&&console.error("Failed to initialize language detector: ",e)}$||($=(0,G.U)(new Worker(new URL(n.p+n.u(6197),n.b))),H.resolve())}},4e3);var _=n(84947),Q=n(37836);const Z=new Map;const X=(0,Q.nF)(function(e){const{updateChatDetectedLanguage:t}=(0,i.ko)(),n=Z.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 ee=n(42211),te=n(46275),ne=n(64154),oe=n(66644),ie=n(50442),se=n(43503),ae=n(54464),re=n(672);const de=3*b.$,le=Number(b.$),ce="data-is-document-group-hover";function ue(e,t,n,s,a,r,d,l,c,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,re.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,l=a+r/2,c=Math.abs(d-n) {if(!g.TF||s||!a||u||!p?.())return;let e;return(0,ie.wJ)(t.current,{selectorToPreventScroll:".MessageList",excludedClosestSelector:".no-word-wrap",onSwipe:(t,n)=>n===ie.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,ae.l)(e),l(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:c,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;se.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:c,messageId:n})},handleMouseLeave:function(e){(0,oe.YS)(C),m&&function(e){const t=me(e.currentTarget);t&&t.removeAttribute(ce)}(e)},isSwiped:I,isQuickReactionVisible:A,handleDocumentGroupMouseEnter:he}}function he(e){const t=me(e.currentTarget);t&&t.setAttribute(ce,"")}function me(e){let t=e;do{t=t.nextElementSibling}while(t&&!t.classList.contains("last-in-document-group"));return t}var pe=n(65240),ge=n(21849),fe=n(87412),ve=n(55723),Ae=n(80999),ye=n(91930),Ce=n(11217),we=n(62587),Ie=n(18276),be=n(86070),Se=n(20021);function Me(e,t){const{width:n,height:o}=(0,b.mr)();return(0,Se.FD)("div",{className:"embedded-thumb",children:[(0,Se.Y)("img",{src:e,width:n,height:o,alt:"",className:"pictogram",draggable:!1}),t&&(0,Se.Y)("span",{className:"protector"})]})}const Ne=({story:e,sender:t,noUserColors:n,isProtected:s,observeIntersectionForLoading:a,onClick:r})=>{const{showNotification:c}=(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,we.A)(p&&(0,d.EN)(e,"pictogram"),!m),C=v?e.content.video.thumbnail?.dataUri:void 0,w=y||C,I=t?(0,l.F9)(u,t):void 0,b=(0,U.A)(()=>{e&&!g?r():c({message:u("StoryNotFound")})}),{handleClick:M,handleMouseDown:N}=(0,Ce.Q)(b);return(0,Se.FD)(be.A,{ref:h,peerColor:t?.color,noUserColors:n,shouldReset:!0,className:(0,f.A)("EmbeddedMessage",w&&"with-thumb"),onClick:M,onMouseDown:N,children:[w&&Me(w,s),(0,Se.FD)("div",{className:"message-text with-message-color",children:[(0,Se.FD)("p",{className:"embedded-text-wrapper",children:[g&&(0,Se.Y)(Ie.A,{name:"story-expired",className:"embedded-origin-icon"}),p&&(0,Se.Y)(Ie.A,{name:"story-reply",className:"embedded-origin-icon"}),u(A)]}),(0,Se.Y)("div",{className:"message-title",children:(0,S.A)(I||" ")})]})]})};var Ye=n(2578),ke=n(9267),Fe=n(57076),Pe=n(17794),Te=n(90603),De=n(38102);var xe=n(61911);const Le=1.125*b.$,Ee=(0,o.ph)(({topic:e,className:t,onClick:n})=>{const o=(0,K.A)();return(0,Se.FD)("div",{className:(0,f.A)("JldIqqof",t),style:`--topic-button-accent-color: var(${(0,Te.Mt)(e?.iconColor)})`,onClick:n,children:[e?(0,Se.Y)(De.A,{topic:e,size:Le}):(0,Se.Y)("img",{src:xe,alt:"",draggable:!1}),e?.title?(0,S.A)(e.title):o("Loading"),e?.isClosed&&(0,Se.Y)(Ie.A,{name:"lock"}),(0,Se.Y)(Ie.A,{name:"next"})]})});var Be=n(15006),Re=n(64493),Oe=n(94189),Ue=n(40664);function Ke(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)(),l=(0,U.A)(e=>{e.stopPropagation(),d({messageId:r,withShift:e?.shiftKey})}),c=(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,Se.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?l:void 0,children:[n&&(0,Se.Y)("div",{className:"message-select-control",children:s&&(0,Se.Y)(Ie.A,{name:"select"})}),(0,Se.Y)(e,{...c})]})}))}var ze=n(51644),Ve=n(25477);const je=Ke(ze.A),Je=Ke(Ve.A),Ge=(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:l,uploadsByKey:c,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=>{l(e.mainMessage.id,t)}),A=(0,U.A)(e=>{l(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,Se.Y)("div",{className:"Album",style:`width: ${I}px; height: ${b}px;`,children:w.map(function(o,l){const p=e.isPaidMedia?o.content.paidMedia?.extendedMedia[l]: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=c[(0,y.bj)(o)],M=S?.progress,{dimensions:N,sides:Y}=r.layout[l],k=(0,u.wwb)((0,i.mS)(),o),F=(0,u.OEt)((0,i.mS)(),o);if(I){const i=n&&(s?l===f-1:Boolean(8&Y&&4&Y));return(0,Se.Y)(je,{id:`album-media-${(0,d.GZ)(o.id,e.isPaidMedia?l:void 0)}`,photo:I,isOwn:s,observeIntersectionForLoading:t,canAutoLoad:k,shouldAffectAppendix:i,uploadProgress:M,dimensions:N,isProtected:a,clickArg:e.isPaidMedia?l: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,Se.Y)(Je,{id:`album-media-${(0,d.GZ)(o.id)}`,video:b,observeIntersectionForLoading:t,canAutoLoad:k,canAutoPlay:F,uploadProgress:M,dimensions:N,isProtected:a,clickArg:e.isPaidMedia?l:o.id,onClick:e.isPaidMedia?v:A,onCancelUpload:C,isDownloading:"extendedMediaPreview"!==b.mediaType&&(0,d.$r)(h,b),theme:m,noSelectControls:e.isPaidMedia})})})});var $e=n(41733);const qe=7*b.$;function He(e,t,n,s,a,r,d){const{interactWithAnimatedEmoji:l,sendEmojiInteraction:c,sendWatchingEmojiInteraction:u}=(0,i.ko)(),h=(0,o.li)(),m=(0,o.li)(),g=(0,we.A)(n?`document${n}`:void 0,!n),f=d||qe,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&&(c({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,$e.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();l({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:l}=n.getBoundingClientRect();u({id:o,chatId:e,emoticon:r,startSize:f,x:d,y:l,isReversed:!a}),I()})},[s,e,r,a,t,I,u,f]),{ref:h,size:f,style:A,handleClick:b}}const We=(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:l})=>{const{ref:c,size:u,style:h,handleClick:m}=He(o,n,r,i,e,a?.emoji,(0,M.Rr)(1));return(0,Se.Y)(fe.A,{ref:c,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:l,onClick:m})}));var _e=n(79577);const Qe=(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:l,size:c,style:u,handleClick:h}=He(i,o,d,s,e,r?.emoji),m=(0,R.Vz)(l,t);return(0,Se.Y)(_e.A,{sticker:a,size:c,quality:1,noLoad:!m,forcePreview:n,play:m,forceAlways:!0,ref:l,className:(0,f.A)("AnimatedEmoji media-inner",a?.id===b.AC&&"like-sticker-thumb"),style:u,onClick:h})}));var Ze=n(14242),Xe=n(93809),et=n(68292),tt=n(57474);const nt=(0,o.ph)(({isCustomShape:e,threadInfo:t,disabled:n,isLoading:s,asActionButton:a})=>{const{openThread:r,openFrozenAccountModal:d}=(0,i.ko)(),l=(0,Xe.A)([s],450),c=(0,K.A)(),h=(0,O.A)(),{originMessageId:m,chatId:p,messagesCount:g,lastMessageId:v,lastReadInboxMessageId:A,recentReplierIds:y,originChannelId:C}=t||{},w=(0,U.A)(()=>{const e=(0,i.mS)();m&&C&&((0,u.trm)(e)?d():r({isComments:!0,chatId:p,originMessageId:m,originChannelId:C}))}),I=(0,o.Kr)(()=>{if(!y?.length)return;const e=(0,i.mS)();return y.map(t=>(0,u.PVB)(e,t)).filter(Boolean)},[y]),b=Boolean(A&&v&&A "COMMENTS_COUNT"===e?(0,Se.Y)(et.A,{text:(0,Ze.Vw)(h,g)}):e):void 0;return(0,Se.FD)("div",{"data-cnt":(0,Ze.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,Se.Y)(Ie.A,{name:"comments-sticker",className:(0,f.A)("CommentButton_icon-comments",s&&l&&"CommentButton_hidden")}),!I?.length&&(0,Se.Y)(Ie.A,{name:"comments"}),Boolean(I?.length)&&(0,Se.Y)("div",{className:"recent-repliers",dir:h.isRtl?"rtl":"ltr",children:I.map(e=>(0,Se.Y)(ge.A,{size:"small",peer:e},e.id))}),(0,Se.Y)("div",{className:"label",dir:"auto",children:g?S:c("LeaveAComment")}),(0,Se.FD)("div",{className:"CommentButton_right",children:[s&&(0,Se.Y)(tt.A,{className:(0,f.A)("CommentButton_loading",!l&&"CommentButton_hidden"),color:e?"white":"blue"}),(0,Se.Y)(Ie.A,{name:"next",className:(0,f.A)("CommentButton_icon-open",s&&l&&"CommentButton_hidden")})]})]})});var ot=n(85982),it=n(64713);const st="ReDHhQHm";function at(e){return e.firstName&&e.lastName?`${e.firstName} ${e.lastName}`:e.firstName?e.firstName:e.lastName?e.lastName:""}const rt=(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:l,openChatWithInfo:c}=(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?c({id:h}):((0,ot.eM)(u),l({message:s("PhoneCopied")}))});return(0,Se.FD)(be.A,{noUserColors:o,peer:t,emojiIconClassName:"SjZYi3sJ",className:"AAHWWWvU",children:[(0,Se.FD)("div",{className:"tpDpg82n",onClick:v,children:[(0,Se.Y)(ge.A,{size:"medium",peer:t,text:at(e)}),(0,Se.FD)("div",{className:"fpYynE5s",children:[(0,Se.Y)("div",{className:"_PNTJc_V",children:t?(0,d.Yg)(t):at(e)}),(0,Se.Y)("div",{className:"JP_3wes8",children:(0,it.Ox)(n,u)})]})]}),m&&(0,Se.FD)(Se.FK,{children:[(0,Se.Y)("div",{className:"_OSJcuqH"}),(0,Se.FD)("div",{className:"Blui4M4G",children:[(0,Se.Y)(Re.A,{isText:!0,color:"translucent",ripple:!0,size:"tiny",onClick:g,className:st,children:s("SharedContactMessage")}),p&&(0,Se.Y)(Re.A,{isText:!0,color:"translucent",ripple:!0,size:"tiny",onClick:f,className:st,children:s("SharedContactAdd")})]})]})]})});var dt=n(80089),lt=n(80464);const ct=e=>{const{isOpen:t}=e,n=(0,lt.A)(dt.ar.Extra,"ContextMenuContainer",!t);return n?(0,Se.Y)(n,{...e}):void 0};var ut=n(18501),ht=n(57675),mt=n(32581);const pt={type:"regular",color:0},gt=(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,ht.A)(i,4,s),l=(0,o.Kr)(()=>{if(e.countryCode&&n.code)return new Intl.DisplayNames([n.code],{type:"region"}).of(e.countryCode)},[e.countryCode,n.code]),c=!t&&a,u=(0,U.A)(()=>{d(!1)}),h=(0,U.A)(()=>{d(e=>!e)});if(e.text)return(0,Se.FD)(be.A,{peerColor:pt,className:"HMB5LgeX",onClick:c?u:void 0,children:[(0,Se.FD)("div",{ref:s,className:(0,f.A)("nfCzKu78",a&&"hYzpXwTM"),children:[(0,Se.Y)("div",{className:"vZnCPl3t",children:n("FactCheck")}),(0,Se.Y)("div",{ref:i,className:"k_dGolcu",children:(0,ut.fd)({text:e.text.text,entities:e.text.entities})}),(0,Se.Y)(mt.A,{className:"qRaSs5iA"}),(0,Se.Y)("div",{className:"EDmr0wJG",children:n("FactCheckFooter",l)})]}),r&&(0,Se.Y)("div",{className:(0,f.A)("mxPizZpR",!t&&"Cj2cLczd"),onClick:t?void 0:h,"aria-hidden":!0,children:(0,Se.Y)(Ie.A,{name:a?"down":"up"})})]})});var ft=n(55158);const vt=(0,o.ph)(({message:e,threadId:t,canAutoLoadMedia:n})=>{const{clickBotInlineButton:o}=(0,i.ko)(),s=e.content.game,{title:a,description:r}=s,l=(0,d.zb)(s),c=(0,d.ih)(s),u=(0,we.A)(l,!n),h=(0,we.A)(c,!n);return(0,Se.FD)("div",{className:"Game",children:[(0,Se.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,Se.Y)(ft.A,{className:"skeleton preview-content"}),u&&(0,Se.Y)("img",{className:"preview-content",src:u,alt:a,draggable:!1}),h&&(0,Se.Y)("video",{className:"preview-content",playsInline:!0,muted:!0,disablePictureInPicture:!0,autoPlay:!0,loop:!0,src:h})]}),(0,Se.Y)("div",{className:"title",children:a}),!(0,d.P5)(e)&&(0,Se.Y)("div",{className:"description",children:r})]})});var At=n(17663),yt=n(52491),Ct=n(4875),wt=n(36175),It=n(64489),bt=n(10187);const St="ogvcv3mr",Mt="MSFa9BPf",Nt="HfZ6SuLI",Yt="rPyyNYxK",kt="FV70u896",Ft=(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)(),c=(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,yt.D0)(t)} ${e.of(t)}`).join(", ")},[p,v,m.code]),k=(0,U.A)(e=>{r({id:e})}),F=(0,U.A)(async()=>{if(c.current)return;c.current=!0;const t=await(0,Ct.px)("fetchGiveawayInfo",{peer:e,messageId:n.id});h(t),c.current=!1}),P=(0,U.A)(()=>{h(void 0)}),T=(0,o.Kr)(()=>{if(u)return m("results"===u.type?"BoostingGiveawayEnd":"BoostingGiveAwayAbout")},[u,m]);return(0,Se.FD)("div",{className:"CbpKtOey",children:[(0,Se.FD)("div",{className:(0,f.A)("hjjKhvVv",v&&"JEiR48jJ"),children:[v?(0,Se.Y)(It.A,{size:150,tgsUrl:wt.w.PartyPopper,nonInteractive:!0,noLoop:!0}):(0,Se.Y)(_e.A,{sticker:a,play:s&&N,noLoop:!0,nonInteractive:!0,size:175}),(0,Se.Y)("span",{className:"n_QCMv_A",children:`x${M}`})]}),v?function(e){const t=e.winnerIds;return(0,Se.FD)(Se.FK,{children:[(0,Se.FD)("div",{className:Mt,children:[(0,Se.Y)("strong",{className:St,children:(0,S.A)(m("BoostingGiveawayResultsMsgWinnersSelected"),["simple_markdown"])}),(0,Se.Y)("p",{className:Nt,children:(0,S.A)(m("BoostingGiveawayResultsMsgWinnersTitle",t.length),["simple_markdown"])}),(0,Se.Y)("strong",{className:St,children:m("lng_prizes_results_winners")}),(0,Se.Y)("div",{className:Yt,children:t.map(e=>(0,Se.Y)(bt.A,{peerId:e,forceShowSelf:!0,withPeerColors:!b,className:kt,clickArg:e,onClick:k}))})]}),(0,Se.Y)("div",{className:Mt,children:(0,Se.Y)("p",{className:Nt,children:m("BoostingGiveawayResultsMsgAllWinnersReceivedLinks")})})]})}(g):function(e){const t=e.channelIds;return(0,Se.FD)(Se.FK,{children:[(0,Se.FD)("div",{className:Mt,children:[(0,Se.Y)("strong",{className:St,children:(0,S.A)(m("BoostingGiveawayPrizes"),["simple_markdown"])}),w&&(0,Se.FD)(Se.FK,{children:[(0,Se.Y)("p",{className:Nt,children:(0,S.A)(m("BoostingGiveawayMsgPrizes",[M,w],void 0,M),["simple_markdown"])}),(0,Se.Y)(mt.A,{children:m("BoostingGiveawayMsgWithDivider")})]}),(0,Se.Y)("p",{className:Nt,children:n?.content?.giveaway?.stars?(0,Se.FD)(Se.FK,{children:[(0,S.A)(m("Chat.Giveaway.Message.Stars.PrizeText",m("Stars",n?.content?.giveaway?.stars)),["simple_markdown"]),(0,Se.Y)("br",{}),(0,S.A)(m("AmongWinners",M),["simple_markdown"])]}):(0,Se.FD)(Se.FK,{children:[(0,S.A)(m("Chat.Giveaway.Info.Subscriptions",M),["simple_markdown"]),(0,Se.Y)("br",{}),(0,S.A)(m("ActionGiftPremiumSubtitle",m("Chat.Giveaway.Info.Months",A)),["simple_markdown"])]})})]}),(0,Se.FD)("div",{className:Mt,children:[(0,Se.Y)("strong",{className:St,children:(0,S.A)(m("BoostingGiveawayMsgParticipants"),["simple_markdown"])}),(0,Se.Y)("p",{className:Nt,children:(0,S.A)(m("BoostingGiveawayMsgAllSubsPlural",t.length),["simple_markdown"])}),(0,Se.Y)("div",{className:Yt,children:t.map(e=>(0,Se.Y)(bt.A,{peerId:e,forceShowSelf:!0,withPeerColors:!b,className:kt,clickArg:e,onClick:k}))}),Y&&(0,Se.Y)("span",{children:(0,S.A)(m("Chat.Giveaway.Message.CountriesFrom",Y))})]}),(0,Se.FD)("div",{className:Mt,children:[(0,Se.Y)("strong",{className:St,children:(0,S.A)(m("BoostingWinnersDate"),["simple_markdown"])}),(0,Se.Y)("p",{className:Nt,children:(0,At.L2)(1e3*y,m.code,!0)})]})]})}(p),(0,Se.Y)(Re.A,{className:"jMBw7STU",color:"adaptive",onClick:F,children:m("BoostingHowItWork")}),(0,Se.Y)(Oe.A,{isOpen:Boolean(u),isOnlyConfirm:!0,title:T,confirmHandler:P,onClose:P,children:function(){if(!t||!u)return;const e="results"===u.type,n=(0,l.vj)(t)?(0,d.Js)(m,t):(0,d.Yg)(t),o=(0,At.U)(m,1e3*y),s=p?.channelIds?p.channelIds.length-1:0,a=m("Chat.Giveaway.Info.OtherChannels",s),r=s>0,c=e?"BoostingGiveawayHowItWorksTextEnd":"BoostingGiveawayHowItWorksText",h=e?m("Chat.Giveaway.Info.Months",A):m("Stars",I,"i"),g=m(c,[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,At.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,Se.FD)(Se.FK,{children:[b&&(0,Se.Y)("p",{className:"ZQ4aVVkI",children:(0,S.A)(b,["simple_markdown"])}),(0,Se.Y)("p",{children:(0,S.A)(g,["simple_markdown"])}),f&&(0,Se.Y)("p",{children:(0,S.A)(f,["simple_markdown"])}),(0,Se.Y)("p",{children:(0,S.A)(C,["simple_markdown"])}),N&&(0,Se.Y)("p",{children:(0,S.A)(N,["simple_markdown"])})]})}()})]})}));var Pt=n(85449);const Tt=(0,o.ph)(({inlineButtons:e,onClick:t})=>{const n=(0,O.A)(),i=e=>{const{type:t}=e;switch(t){case"url":{const{url:t}=e;return t.startsWith(r.jsp)&&t.includes("?startapp")?(0,Se.Y)(Ie.A,{className:"corner-icon",name:"webapp"}):r.OFc.test(t)?void 0:(0,Se.Y)(Ie.A,{className:"corner-icon",name:"arrow-right"})}case"urlAuth":return(0,Se.Y)(Ie.A,{className:"corner-icon",name:"arrow-right"});case"buy":case"receipt":return(0,Se.Y)(Ie.A,{className:"corner-icon",name:"card"});case"switchBotInline":return(0,Se.Y)(Ie.A,{className:"corner-icon",name:"share-filled"});case"webView":case"simpleWebView":return(0,Se.Y)(Ie.A,{className:"corner-icon",name:"webapp"});case"copy":return(0,Se.Y)(Ie.A,{className:"corner-icon",name:"copy"});case"suggestedMessage":if("suggestChanges"===e.buttonType)return(0,Se.Y)(Ie.A,{className:"left-icon",name:"edit"});if("approve"===e.buttonType)return(0,Se.Y)(Ie.A,{className:"left-icon",name:"check"});if("decline"===e.buttonType)return(0,Se.Y)(Ie.A,{className:"left-icon",name:"close"})}},s=(0,o.Kr)(()=>{const t=[];return e.forEach(e=>{t.push(e.map(e=>(0,Pt.A)(n,e)))}),t},[n,e]);return(0,Se.Y)("div",{className:"InlineButtons",children:e.map((e,n)=>(0,Se.Y)("div",{className:"row",children:e.map((e,o)=>(0,Se.FD)(Re.A,{size:"tiny",ripple:!0,disabled:"unsupported"===e.type||"suggestedMessage"===e.type&&e.disabled,onClick:()=>t(e),children:[i(e),(0,Se.Y)("span",{className:"inline-button-text",children:s[n][o]})]}))}))})});var Dt=n(17142),xt=n(40435),Lt=n(37859),Et=n(61097);const Bt=(0,o.ph)(({message:e,shouldAffectAppendix:t,isInSelectMode:n,isSelected:i,theme:s,forcedWidth:a})=>{const l=(0,o.li)(),c=(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,we.A)((0,d.cy)(y)),w=Boolean(a),I=(0,Et.A)(C,!w),b=e.id;(0,Lt.A)(([e])=>{if(t){if(C){const e=l.current.closest(r.KFG);(0,xt.A)(C,!1,b,i,s).then(t=>{(0,oe.RK)(()=>{e.style.setProperty("--appendix-bg",t),e.setAttribute(r.D3G,"")})})}}else e&&l.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,Se.FD)("div",{ref:l,className:"Invoice",children:[m&&(0,Se.Y)("p",{className:"title",children:(0,S.A)(m)}),p&&(0,Se.Y)("div",{className:"info",children:(0,S.A)(p,["emoji","br"])}),(0,Se.FD)("div",{className:"description "+(y?"has-image":""),children:[Boolean(y)&&(0,Se.FD)("div",{className:"invoice-image-container",children:[w&&(0,Se.Y)("canvas",{ref:I,className:"thumbnail blurred-bg"}),C&&(0,Se.Y)("img",{className:"invoice-image",src:C,alt:"",style:N,crossOrigin:"anonymous",draggable:!1}),!C&&y&&(0,Se.Y)(ft.A,{width:M,height:y.dimensions?.height,forceAspectRatio:!0})]}),(0,Se.FD)("p",{className:"description-text",children:[(0,Dt.vv)(u,g,f,{iconClassName:"invoice-currency-icon"}),A&&(0,Se.Y)("span",{className:"test-invoice",children:c("PaymentTestInvoice")})]})]})]})});var Rt=n(32625),Ot=n(27860);const Ut={root:"dCK8GQ_8",duration:"CWT8ZMwV",buy:"C38zhCDM",spoiler:"CG55VZP1"},Kt=(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:l}=e,c=(0,U.A)(()=>{o({chatId:r,ids:[l]})});(0,Rt.A)(c,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:l,isExtendedMedia:!0})});return(0,Se.FD)("div",{className:(0,f.A)(Ut.root,"media-inner"),onClick:y,children:[(0,Se.Y)(Ot.A,{thumbDataUri:v?.dataUri,width:p,height:g,isVisible:!0,className:Ut.spoiler}),Boolean(A)&&(0,Se.Y)("div",{className:Ut.duration,children:(0,At.QO)(A)}),(0,Se.FD)("div",{className:Ut.buy,children:[(0,Se.Y)(Ie.A,{name:"lock",className:Ut.lock}),s("Checkout.PayPrice",(0,Dt.Ad)(u,h))]})]})});var zt=n(47526),Vt=n(14737),jt=n(30857),Jt=n(38691);const Gt=n.p+"map-pin.899635f6fe777c28998a.svg",$t=24*Math.PI,qt=1e-4,Ht={width:400,height:300,zoom:16};function Wt(){return(0,Se.FD)("svg",{className:"round-pin",style:"enable-background:new 0 0 64 64",viewBox:"0 0 64 64",children:[(0,Se.Y)("circle",{cx:"32",cy:"32",r:"24.5"}),(0,Se.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,Se.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,Se.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 _t=(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)(),l=(0,jt.A)(),c=(0,d.fB)(e),{mediaType:u,geo:h}=c,m=(0,C.Fm)(),p=(0,d.vz)(e),g="geoLive"!==u||p?void 0:e.date+c.period-m,[v,A]=(0,o.J0)(h),y="venue"===u||"geoLive"===u&&!p,{width:w,height:I,zoom:b}=Ht,S=(0,Jt.A)(),M=(0,d.rt)(v,w,I,b,S),N=(0,we.A)(M),Y=(0,V.A)(N,!0),k=N||Y,F=(0,o.Kr)(()=>{if("geoLive"!==u||!v.accuracyRadius)return 0;const{lat:e,accuracyRadius:t}=v;return t/(0,zt._u)(e,b)},[u,v,b]),P=(0,U.A)(t=>{if("geoLive"!==u)return;const n=t.lastElementChild,o=t.firstElementChild,i=e.date+c.period-(0,C.Fm)(),s=(1-i/c.period)*$t,a=(0,At.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,Se.FD)("div",{className:e,children:[(0,Se.Y)(Wt,{}),(0,Se.Y)(ge.A,{peer:t,className:"location-avatar"}),void 0!==c.heading&&(0,Se.Y)("div",{className:"direction",style:`--direction: ${c.heading}deg`})]});if("venue"===u){const t=(0,zt.PP)(c.venueType),n=(0,zt.KE)(c.venueType);if(n)return(0,Se.FD)("div",{className:e,style:`--pin-color: ${t}`,children:[(0,Se.Y)(Wt,{}),(0,Se.Y)("img",{src:n,draggable:!1,className:"venue-icon",alt:""})]})}return(0,Se.Y)("img",{className:e,draggable:!1,src:Gt,alt:""})}return(0,o.Nf)(()=>{a.current&&P(a.current)},[P]),(0,o.vJ)(()=>{Math.abs(h.lat-v.lat) {l()},p?void 0:1e3*(g||0)),(0,Rt.A)(()=>{(0,oe.RK)(()=>{const e=a.current;e&&P(e)})},g?1e3:void 0),(0,Se.FD)("div",{ref:s,className:"Location media-inner interactive",onClick:()=>{n({geoPoint:v,zoom:b})},children:[(0,Se.FD)("div",{className:"map-wrapper",children:[k?(0,Se.Y)("img",{className:"full-media map",src:k,alt:"Location on a map",draggable:!1,style:`width: ${Ht.width}px; height: ${Ht.height}px;`}):(0,Se.Y)(ft.A,{width:w,height:I}),function(){if(k)return(0,Se.FD)(Se.FK,{children:[Boolean(F)&&!p&&(0,Se.Y)("div",{className:"location-accuracy",style:`width: ${2*F}px; height: ${2*F}px`}),T()]})}()]}),function(){if(y)return"venue"===u?(0,Se.FD)("div",{className:"location-info",children:[(0,Se.Y)("div",{className:"location-info-title",children:c.title}),(0,Se.Y)("div",{className:"location-info-subtitle",children:c.address})]}):"geoLive"===u?(0,Se.FD)("div",{className:"location-info",children:[(0,Se.Y)("div",{className:"location-info-title",children:r("AttachLiveLocation")}),(0,Se.Y)("div",{className:"location-info-subtitle",children:(0,At.IF)(r,m,e.editDate)}),!p&&(0,Se.FD)("div",{className:"geo-countdown",ref:a,children:[(0,Se.Y)("span",{className:"geo-countdown-text"}),(0,Se.Y)("svg",{width:"32px",height:"32px",children:(0,Se.Y)("circle",{cx:"16",cy:"16",r:12,className:"geo-countdown-progress",transform:"rotate(-90, 16, 16)","stroke-dasharray":$t,"stroke-dashoffset":"0"})})]})]}):void 0}()]})});var Qt=n(48906),Zt=n(97676),Xt=n(48775),en=n(15379),tn=n(45);const nn=(0,o.ph)(({message:e,outgoingStatus:t,signature:n,withReactionOffset:s,repliesThreadInfo:a,renderQuickReactionButton:r,noReplies:d,isTranslated:l,isPinned:c,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)(()=>(0,en.Ee)(e.scheduleRepeatPeriod,b),[e.scheduleRepeatPeriod,b]),Y=(0,o.Kr)(()=>{if(!C)return;const t=(0,At.L2)(1e3*e.date,I.code,void 0,I.timeFormat),n=e.isEdited&&(0,At.L2)(1e3*e.editDate,I.code,void 0,I.timeFormat),o=e.forwardInfo&&(0,At.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]),k=(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]),F=(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,At.fU)(I,1e3*e.date),n=u?(0,At.be)(I,1e3*(e.forwardInfo?.date||e.date),!0):t;return N?b("FormatDateAtTime",{date:N,time:n}):n},[I,e.date,e.forwardInfo?.date,u,N,b]),T=(0,f.A)("MessageMeta",s&&"reactions-offset",e.forwardInfo?.isImported&&"is-imported");return(0,Se.FD)("span",{className:T,dir:b.isRtl?"rtl":"ltr",onClick:m,"data-ignore-on-paste":!0,children:[h&&(0,Se.Y)("span",{className:"message-effect-icon",onClick:g,children:(0,S.A)(h)}),l&&(0,Se.Y)(Ie.A,{name:"language",className:"message-translated",onClick:p}),Boolean(e.viewsCount)&&(0,Se.FD)(Se.FK,{children:[(0,Se.Y)("span",{className:"message-views",title:k,children:(0,Ze.Vw)(b,e.viewsCount)}),(0,Se.Y)(Ie.A,{name:"channelviews"})]}),!d&&Boolean(a?.messagesCount)&&(0,Se.FD)("span",{onClick:function(e){e.stopPropagation(),v()},className:"message-replies-wrapper",title:F,children:[(0,Se.Y)("span",{className:"message-replies",children:(0,Se.Y)(et.A,{text:(0,Ze.Vw)(b,a.messagesCount)})}),(0,Se.Y)(Ie.A,{name:"reply-filled"})]}),c&&(0,Se.Y)(Ie.A,{name:"pinned-message",className:"message-pinned"}),n&&(0,Se.Y)("span",{className:"message-signature",children:(0,S.A)(n)}),Boolean(A)&&(0,Se.Y)("span",{className:"message-price",children:(0,Xt.U2)(b,A,{asFont:!0,className:"message-price-star-icon",containerClassName:"message-price-stars-container"})}),(0,Se.FD)("span",{className:"message-time",title:Y,onMouseEnter:w,children:[e.forwardInfo?.isImported&&(0,Se.FD)(Se.FK,{children:[(0,Se.Y)("span",{className:"message-imported",onClick:M,children:(0,At.L2)(1e3*e.forwardInfo.date,b.code,!0)}),(0,Se.Y)("span",{className:"message-imported",onClick:M,children:b("MessageMetaImported")})]}),e.isEdited&&`${b("MessageMetaEdited")} `,e.isVideoProcessingPending&&`${b("MessageMetaApproximate")} `,P]}),t&&(0,Se.Y)(tn.A,{status:t}),r&&r()]})});var on=n(4262);const sn=(0,o.ph)(({phoneCall:e,message:t,chatId:n})=>{const{requestMasterAndRequestCall:s}=(0,i.ko)(),a=(0,K.A)(),{isVideo:r,reason:d,duration:l}=e,c=t.isOutgoing,u="missed"===d,h="busy"===d||void 0===l,m=(0,U.A)(()=>{s({isVideo:r,userId:n})}),p=(0,o.Kr)(()=>e.duration?(0,At.zA)(a,e.duration):void 0,[a,e.duration]),v=(0,At.fU)(a,1e3*t.date);return(0,Se.FD)("div",{className:"wqsZyy8u",children:[(0,Se.Y)(Re.A,{size:"smaller",color:"translucent",round:!0,ripple:!0,onClick:m,className:"NGmo4ADz",disabled:!g.OL,ariaLabel:a(c?"CallAgain":"CallBack"),iconName:r?"video-outlined":"phone"}),(0,Se.FD)("div",{className:"iFn6m6hd",children:[(0,Se.Y)("div",{className:"l8QfocIQ",children:a((0,on.fB)(e,t.isOutgoing))}),(0,Se.FD)("div",{className:"rF5tkx92",children:[(0,Se.Y)(Ie.A,{name:"arrow-right",className:(0,f.A)("ONmpzmUS",u&&"Alra_BWu",h&&"J7xsuCAm",!c&&"BfgDXljM")}),(0,Se.Y)("span",{className:"kKPKwFzu",children:p?a("CallMessageWithDuration",[v,p]):v})]})]})]})});var an=n(98607);const rn=(0,o.ph)(({paidMedia:e,chatId:t,messageId:n,isOutgoing:s,children:a})=>{const{openInvoice:d}=(0,i.ko)(),l=(0,K.A)(),c=(0,O.A)(),u=!e.isBought,h=(0,o.Kr)(()=>{const t=l("UnlockPaidContent",e.starsAmount);return(0,an.i)(t,r.Cyx,(0,Se.Y)(ke.A,{className:"ywiOugiH",type:"gold",size:"adaptive"}))},[l,e]),m=(0,U.A)(e=>{d({type:"message",chatId:t,messageId:n}),(0,w.A)(e)});return(0,Se.FD)("div",{className:"mVaSjZRJ",onClick:u?m:void 0,children:[a,u&&(0,Se.Y)(Re.A,{className:"GnKGu6D9",color:"dark",size:"tiny",fluid:!0,pill:!0,children:(0,Se.Y)("span",{className:"gLaaVQXr",children:h})}),e.isBought&&(0,Se.Y)("div",{className:(0,f.A)("message-paid-media-status","IGXW5hWr"),children:s?(0,Xt.U2)(c,e.starsAmount):l("Chat.PaidMedia.Purchased")})]})});var dn=n(26875),ln=n(77561),cn=n(1087);function un(e,t){return t>0?(e/t*100).toFixed():0}const hn=({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),l=0===s.length||-1!==s.indexOf(e.option),c=s.length>0&&l||d?.isChosen,u=d?un(d.votersCount,n||0):0,[h,m]=(0,o.J0)(a?0:u),p=d?un(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,Se.FD)("div",{className:"PollOption",dir:r.isRtl?"rtl":void 0,children:[(0,Se.FD)("div",{className:"poll-option-share "+("100"===u?"limit-width":""),children:[u,"%",c&&(0,Se.Y)("span",{className:(0,f.A)("poll-option-chosen",!l&&"wrong",a&&"animate"),children:(0,Se.Y)(Ie.A,{name:l?"check":"close",className:"poll-option-icon"})})]}),(0,Se.FD)("div",{className:"poll-option-right",children:[(0,Se.Y)("div",{className:"poll-option-text",dir:"auto",children:(0,ut.fd)({text:e.text.text,entities:e.text.entities})}),(0,Se.FD)("div",{className:(0,f.A)("poll-option-answer",c&&!l&&"wrong"),children:[a&&(0,Se.Y)("svg",{className:"poll-line",style:g?"":"stroke-dasharray: 100% 200%; stroke-dashoffset: -44",children:(0,Se.Y)("path",{d:"M4.47 5.33v13.6a9 9 0 009 9h13"})}),(0,Se.Y)("div",{className:"poll-option-line",style:v})]})]})]})},mn=12*Math.PI;function pn(e){return void 0===e.isPublic?" ":e.closed?"FinalResults":e.quiz?e.isPublic?"QuizPoll":"AnonymousQuizPoll":e.isPublic?"PublicPoll":"AnonymousPoll"}function gn(e,t,n){return n?e(t?"Answer":"Vote",n,"i"):e(t?"Chat.Quiz.TotalVotesEmpty":"Chat.Poll.TotalVotesResultEmpty")}function fn(e){e.stopPropagation()}const vn=(0,o.ph)(({message:e,poll:t,observeIntersectionForLoading:n,observeIntersectionForPlaying:s,onSendVote:a})=>{const{loadMessage:r,openPollResults:d,requestConfetti:l,showNotification:c}=(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:F}=g,P=k&&k.some(e=>e.isChosen),T=!p.closed&&!P,D=!T&&p.isPublic&&Number(g.totalVoters)>0,x=T&&p.multipleChoice,L=g.recentVoterIds,E=k?Math.max(...k.map(e=>e.votersCount)):F,B=(0,o.Kr)(()=>k?.filter(e=>e.isCorrect).map(e=>e.option)||[],[k]),R=(0,o.Kr)(()=>p.answers.map(e=>({label:(0,ut.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&&l({}),v(!1))},[f,t.results.results,l]),(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*mn;Y.current.setAttribute("stroke-dashoffset",`-${e}`)},[S,p.closePeriod]),(0,o.vJ)(()=>{p.quiz&&(S<=0||P&&!p.closed)&&r({chatId:m,messageId:h})},[m,S,P,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)(()=>{c({localId:(0,y.bj)(e),message:(0,ut.fd)({text:t.results.solution,entities:t.results.solutionEntities}),duration:5e3,containerSelector:"#middle-column-portals"})});(0,o.vJ)(()=>{I&&P&&p.quiz&&g.results&&t.results.solution&&(g.results.find(e=>e.isChosen&&e.isCorrect)||G())},[P,I,g.results,p.quiz,t.results.solution]);const $=(0,K.A)();return(0,Se.FD)("div",{className:"Poll",dir:$.isRtl?"auto":"ltr",children:[(0,Se.Y)("div",{className:"poll-question",children:(0,ut.fd)({text:p.question.text,entities:p.question.entities,observeIntersectionForLoading:n,observeIntersectionForPlaying:s})}),(0,Se.FD)("div",{className:"poll-type",children:[$(pn(p)),O.length>0&&(0,Se.Y)("div",{className:"poll-recent-voters",children:(0,Se.Y)(dn.A,{size:"micro",peers:O})}),S>0&&T&&(0,Se.FD)("div",{ref:N,className:"poll-countdown",children:[(0,Se.Y)("span",{children:(0,At.QO)(S)}),(0,Se.Y)("svg",{width:"16px",height:"16px",children:(0,Se.Y)("circle",{ref:Y,cx:"8",cy:"8",r:6,className:"poll-countdown-progress",transform:"rotate(-90, 8, 8)","stroke-dasharray":mn,"stroke-dashoffset":"0"})})]}),p.quiz&&t.results.solution&&!T&&(0,Se.Y)(Re.A,{round:!0,size:"tiny",color:"translucent",className:"poll-quiz-help",onClick:G,ariaLabel:"Show Solution",iconName:"lamp"})]}),T&&(0,Se.Y)("div",{className:"poll-answers",onClick:fn,children:x?(0,Se.Y)(ln.A,{options:R,selected:A,onChange:V,disabled:e.isScheduled||f,loadingOptions:f?A:void 0,isRound:!0}):(0,Se.Y)(cn.A,{name:`poll-${h}`,options:R,onChange:z,disabled:e.isScheduled||f,loadingOption:f?A[0]:void 0})}),!T&&(0,Se.Y)("div",{className:"poll-results",children:p.answers.map(function(e){return(0,Se.Y)(hn,{shouldAnimate:I||!T,answer:e,voteResults:k,totalVoters:F,maxVotersCount:E,correctResults:B},e.option)})}),!D&&!x&&(0,Se.Y)("div",{className:"poll-voters-count",children:gn($,p.quiz,g.totalVoters)}),x&&(0,Se.Y)(Re.A,{isText:!0,disabled:0===A.length,size:"tiny",onClick:j,children:$("PollSubmitVotes")}),D&&(0,Se.Y)(Re.A,{isText:!0,size:"tiny",onClick:J,children:$("PollViewResults")})]})});var An=n(43581),yn=n(84555),Cn=n(10221),wn=n(18104),In=n(14413),bn=n(82855),Sn=n(3325);const Mn="GydRBA08",Nn=(0,o.ph)((0,i.EK)(e=>({needsAgeVerification:e.appConfig.needAgeVideoVerification}))(({message:e,shouldLoop:t,shouldPlayEffect:n,withEffect:a,isMediaNsfw:r,onStopEffect:l,observeIntersection:c,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,[F,P,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,c),$=(0,R.Vz)(w,u),q=`sticker${S.id}?size=f`,H=(0,we.A)(q,!G||!Y||!a,s.qZ.BlobUrl),[W,_,Q]=(0,B.A)(),Z=(0,d.VD)(S),X=(0,U.A)(()=>{Q(),l?.()});(0,o.vJ)(()=>{Y&&a&&$&&n&&_()},[Y,$,n,_,a]);const ee=Y&&a&&H&&W;(0,Cn.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 P():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&&Mn);return(0,Se.FD)("div",{ref:w,className:ae,style:`width: ${ie}px; height: ${se}px;`,onClick:oe?void 0:ne,children:[(0,Se.Y)(bn.A,{containerRef:w,sticker:S,fullMediaHash:J,fullMediaClassName:"full-media",size:ie,shouldLoop:t,noLoad:!G,noPlay:!$,withSharedAnimation:!0}),(0,Se.Y)(Ot.A,{isVisible:O,withAnimation:!0,thumbDataUri:Z,width:ie,height:se,className:"media-spoiler",isNsfw:r}),ee&&(0,Se.Y)(Sn.A,{children:(0,Se.Y)(wn.A,{ref:I,className:(0,f.A)("WMMaWlOL",k&&Mn),tgsUrl:H,size:1.49*ie,play:!0,isLowPriority:!0,noLoop:!0,onEnded:X},q)}),(0,Se.Y)(In.A,{isOpen:F,onClose:T,shouldAlwaysShow:x,onAlwaysShowChanged:L,confirmHandler:j})]})}));var Yn=n(45470),kn=n(14),Fn=n(50680),Pn=n(59816);const Tn=(0,o.ph)(function({story:e,isPreview:t,isProtected:n,isConnected:s}){const{openStoryViewer:a,loadPeerStoriesByIds:r,showNotification:l}=(0,i.ko)(),c=(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,we.A)(v),y=m?p?p.thumbnail?.dataUri:e.content.photo?.thumbnail?.dataUri:void 0,C=(0,kn.A)(A,!0),{shouldRender:w,transitionClassNames:I}=(0,Fn.A)(Boolean(C)),b=(0,Yn.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?l({message:c("StoryNotFound")}):a({peerId:e.peerId,storyId:e.id,isSinglePeer:!0,isSingleStory:!0})});return(0,Se.FD)("div",{className:S,onClick:s?M:void 0,children:[!h&&t&&(0,Se.Y)("canvas",{ref:b,className:"thumbnail blurred-bg"}),w&&(0,Se.FD)(Se.FK,{children:[(0,Se.Y)("img",{src:C,alt:"",className:(0,f.A)("WAItYc5d",t&&"ClGe8yij",I),draggable:!1}),m&&(0,Se.Y)(Pn.A,{story:e,className:I})]}),h&&(0,Se.FD)("span",{children:[(0,Se.Y)(Ie.A,{name:"story-expired",className:"nLA7VEhv"}),c("StoryExpiredSubtitle")]}),Boolean(p?.duration)&&(0,Se.Y)("div",{className:"message-media-duration",children:(0,At.QO)(p.duration)}),n&&(0,Se.Y)("span",{className:"protector"})]})}),Dn=(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,Se.Y)(Tn,{story:t||i,isProtected:n,isConnected:o})})),xn=(0,o.ph)((0,i.EK)((e,{message:t})=>{const{id:n,peerId:o}=t.content.storyData,i=(0,u._bp)(e,o)?.lastReadId;return{story:(0,u.Msb)(e,o,n),peer:(0,u.PVB)(e,o),targetUser:(0,u.mBe)(e,t.chatId),isUnread:Boolean(i&&i {a({peerId:t.peerId,storyId:t.id,isSinglePeer:!0,isSingleStory:!0})}),h=t&&"isDeleted"in t,m=t&&"content"in t,p=m?t.content.video:void 0,g=m?(0,d.EN)(t,"pictogram"):void 0,v=(0,we.A)(g)||p?.thumbnail?.dataUri;return(0,E.A)(c.peerId,c.id,t),(0,Se.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,Se.Y)("span",{className:"story-media-wrapper",children:v&&(0,Se.Y)("img",{src:v,alt:"",className:"story-media"})}),(0,Se.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,l.F9)(r,n)),["emoji","simple_markdown"])})]})})),Ln=(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:c}=(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&&c({})}),M=Boolean(e.forwardInfo)||!v&&!e.isOutgoing,N=e.isOutgoing,Y=(0,o.Kr)(()=>g.map(e=>{const t=m?.find(t=>t.itemId===e.id)?.completedBy,n=v&&t?(0,u.PVB)((0,i.mS)(),t):void 0,o=n?(0,l.em)(I,n):void 0;return{label:(0,ut.fd)(e.title),value:e.id.toString(),peer:n,subLabel:o}}),[g,v,m,I]);return(0,Se.FD)("div",{className:"todo-list",dir:I.isRtl?"auto":"ltr",children:[(0,Se.FD)("div",{className:"todo-list-header",children:[(0,Se.Y)("div",{className:"todo-list-title",children:(0,ut.fd)(p)}),(0,Se.Y)("div",{className:"list-type",children:e.forwardInfo?I("TitleToDoList"):v?I("TitleGroupToDoList"):N?I("TitleYourToDoList"):n?I("TitleUserToDoList",{peer:(0,l.F9)(I,n)},{withNodes:!0}):I("TitleToDoList")})]}),(0,Se.Y)("div",{className:"todo-list-items",children:M?(0,Se.Y)("div",{className:"todo-list-items",children:Y.map(e=>(0,Se.FD)("div",{className:"todo-list-readonly-item",children:[(0,Se.Y)("div",{className:"todo-readonly-item-checkbox",children:C.has(e.value)?(0,Se.Y)(Ie.A,{name:"check"}):(0,Se.Y)("div",{className:"todo-item-bullet-point"})}),(0,Se.Y)("div",{className:(0,f.A)("readonly-item-label",C.has(e.value)&&"completed-label"),children:e.label})]},e.value))}):(0,Se.Y)(ln.A,{options:Y,selected:A,onChange:S,onClickLabel:s?void 0:b,disabled:!w,isRound:!0})}),(0,Se.Y)("div",{className:"completed-tasks-count",children:(0,Se.Y)(et.A,{text:I("DescriptionCompletedToDoTasks",{number:A.length,count:Y.length})})})]})}));var En=n(58849),Bn=n(87094),Rn=n(39877),On=n(84685),Un=n(95773),Kn=n(40558),zn=n(61361);const Vn=(0,o.ph)(({auction:e,observeIntersectionForLoading:t,observeIntersectionForPlaying:n,onClick:i})=>{const s=(0,O.A)(),a=(0,o.li)(),[r,d,l]=(0,B.A)(),{gift:c,endDate:u}=e,{background:h,title:m,availabilityTotal:p,isSoldOut:v}=c,A=h?.textColor||"#ffffff",[y,w]=(0,o.J0)(()=>u<(0,C.Fm)()),I=(0,U.A)(()=>{w(!0)}),b=(0,o.Kr)(()=>[h?.centerColor||"#254e7a",h?.edgeColor||"#0f2a49"],[h]),S=(0,o.Kr)(()=>y||v?s("GiftAuctionSoldOut"):s("GiftAuctionGifts",{count:p||0},{pluralValue:p||0}),[p,y,v,s]);return(0,Se.FD)("div",{className:(0,f.A)("interactive-gift","rK3ug8nc"),style:`color: ${A}`,onClick:i,onMouseEnter:g.TF?void 0:d,onMouseLeave:g.TF?void 0:l,children:[(0,Se.Y)(Kn.A,{className:"PsJFZPEc",backgroundColors:b,withAdaptiveHeight:!0}),(0,Se.Y)("div",{className:"rV1S0P1o",style:`background-color: ${b[0]}`,children:y?s("GiftAuctionFinished"):(0,Se.Y)(zn.A,{endsAt:u,onEnd:I})}),(0,Se.Y)(Un.A,{ref:a,className:"g5kNvwaj",withSparkles:!0,sparklesColor:A,children:(0,Se.Y)(bn.A,{containerRef:a,sticker:c.sticker,size:120,shouldLoop:r,observeIntersectionForPlaying:n,observeIntersectionForLoading:t})}),(0,Se.Y)("div",{className:"WHFbvlSl",children:m}),(0,Se.Y)("div",{className:"GWFm_Jl4",children:S})]})});var jn=n(66833);const Jn=(0,o.ph)(({gift:e,observeIntersectionForLoading:t,observeIntersectionForPlaying:n,onClick:i})=>{const s=(0,o.li)(),{backdrop:a,model:r,pattern:d}=(0,jn.uc)(e),[l,c,u]=(0,B.A)(),h=[a.centerColor,a.edgeColor];return(0,Se.FD)("div",{className:(0,f.A)("interactive-gift","LaOdPURl"),onClick:i,onMouseEnter:g.TF?void 0:c,onMouseLeave:g.TF?void 0:u,children:[(0,Se.Y)(Kn.A,{className:"EdXfeKWY",backgroundColors:h,patternIcon:d.sticker,centerEmptiness:.15,ringsCount:2,ovalFactor:1.2,withAdaptiveHeight:!0}),(0,Se.Y)("div",{ref:s,className:"o_DYZEMV",children:(0,Se.Y)(bn.A,{containerRef:s,sticker:r.sticker,size:120,shouldLoop:l,observeIntersectionForPlaying:n,observeIntersectionForLoading:t})})]})}),Gn=(0,o.ph)((0,i.EK)(e=>({canPlayAnimatedEmojis:(0,u.BWX)(e)}))(({messageWebPage:e,webPage:t,message:n,noAvatars:s,canAutoLoad:r,canAutoPlay:l,asForwarded:c,isDownloading:u=!1,isProtected:h,isConnected:m,story:p,theme:g,backgroundEmojiId:v,shouldWarnAboutFiles:A,autoLoadFileMaxSizeMb:y,lastPlaybackTimestamp:w,observeIntersectionForLoading:I,observeIntersectionForPlaying:b,onMediaClick:M,onDocumentClick:N,onContainerClick:Y,onAudioPlay:k,onCancelMediaTransfer:F})=>{const{openUrl:P,openTelegramLink:T}=(0,i.ko)(),D=(0,o.li)(),x=(0,O.A)(),L=(0,U.A)(()=>{M()}),B=(0,U.A)(e=>{Y?.(e)}),R="full"===t?.webpageType?t:void 0,{story:K,stickers:z}=R||{};(0,E.A)(K?.peerId,K?.id,p);const V=z?.isWithTextColor||z?.documents?.[0]?.shouldUseTextColor,j=(0,Bn.A)(D,void 0,!V),J=(0,o.Kr)(()=>{const e=t?.url&&(0,te.vG)(t?.url);if(e&&"timestamp"in e)return e.timestamp},[t?.url]);if("full"!==t?.webpageType)return;const G=(0,U.A)(()=>{T({url:t.url})}),{siteName:$,url:q,displayUrl:H,title:W,description:_,photo:Q,video:Z,audio:X,type:ee,document:ne}=t,{mediaSize:oe}=e,ie="telegram_story"===ee,se="telegram_nft"===ee,ae="telegram_auction"===ee,re=p&&"isDeleted"in p,de=z?.isEmoji?"telegram_emojiset":ee,le=ae&&t.auction?t.auction.endDate:void 0,ce=re?void 0:function(e,t){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";case"telegram_auction":return void 0!==t&&t<(0,C.Fm)()?"PollViewResults":"GiftAuctionJoin";default:return}}(de,le),ue=ce&&x(ce),he=function(e){if("telegram_auction"===e)return"auction-filled"}(de),me=(0,En.A)(_,170),ge=Boolean(me||W||$);let fe=Boolean(z);ge&&t?.photo&&!t.video&&!t.document&&(fe=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,oe));const Ae=(Q||Z)&&M&&!fe,ye=(0,f.A)("WebPage",fe&&"with-square-photo",!Q&&!Z&&"without-media",Z&&"with-video",!ge&&"no-article",ne&&"with-document",ue&&"with-quick-button",(se||ae)&&"with-gift");return(0,Se.FD)(be.A,{className:ye,"data-initial":($||H)[0],dir:x.isRtl?"rtl":"auto",onClick:B,children:[(0,Se.FD)("div",{className:(0,f.A)("WebPage--content",ie&&"is-story",(se||ae)&&"is-gift"),children:[v&&(0,Se.Y)(Rn.A,{emojiDocumentId:v,className:"WebPage--background-icons"}),ie&&(0,Se.Y)(Tn,{story:p,isProtected:h,isConnected:m,isPreview:!0}),se&&(0,Se.Y)(Jn,{gift:t.gift,observeIntersectionForLoading:I,observeIntersectionForPlaying:b,onClick:G}),ae&&t.auction&&(0,Se.Y)(Vn,{auction:t.auction,observeIntersectionForLoading:I,observeIntersectionForPlaying:b,onClick:G}),ge&&(0,Se.FD)("div",{className:(0,f.A)("WebPage-text","WebPage-text_interactive"),onClick:()=>P({url:q,shouldSkipModal:e.isSafe}),children:[(0,Se.Y)(On.A,{className:"site-name",url:q,text:$||H}),W&&(0,Se.Y)("p",{className:"site-title",children:(0,S.A)(W)}),me&&!se&&!ae&&(0,Se.Y)("p",{className:"site-description",children:(0,S.A)(me,["emoji","br"])})]}),Q&&!se&&!ae&&!Z&&!ne&&(0,Se.Y)(ze.A,{photo:Q,isOwn:n?.isOutgoing,isInWebPage:!0,observeIntersection:I,noAvatars:s,canAutoLoad:r,size:fe?"pictogram":"inline",asForwarded:c,nonInteractive:!Ae,isDownloading:u,isProtected:h,theme:g,onClick:Ae?L:void 0,onCancelUpload:F}),Z&&(0,Se.Y)(Ve.A,{video:Z,isOwn:n?.isOutgoing,isInWebPage:!0,observeIntersectionForLoading:I,noAvatars:s,canAutoLoad:r,canAutoPlay:l,asForwarded:c,isDownloading:u,isProtected:h,lastPlaybackTimestamp:w||J,onClick:Ae?L:void 0,onCancelUpload:F}),X&&(0,Se.Y)(pe.Ay,{theme:g,message:n,origin:a.d9.Inline,noAvatars:s,isDownloading:u,onPlay:k,onCancelUpload:F}),ne&&(0,Se.Y)(ve.A,{document:ne,message:n,observeIntersection:I,autoLoadFileMaxSizeMb:y,onMediaClick:N,onCancelUpload:F,isDownloading:u,shouldWarnAboutFiles:A}),z&&(0,Se.Y)("div",{ref:D,className:(0,f.A)("media-inner","square-image",z.isEmoji&&"WebPage--emoji-grid","WebPage--stickers"),children:z.documents.map(e=>(0,Se.Y)("div",{className:"WebPage--sticker",children:(0,Se.Y)(bn.A,{containerRef:D,sticker:e,shouldLoop:!0,size:z.isEmoji?38:80,customColor:j,observeIntersectionForPlaying:b,observeIntersectionForLoading:I})},e.id))})]}),ue&&(0,Se.FD)(Re.A,{className:"WebPage--quick-button",size:"tiny",color:"translucent",isRectangular:!0,noForcedUpperCase:!ae,onClick:G,children:[he&&(0,Se.Y)(Ie.A,{name:he}),ue]})]})})),$n=1.75*b.$,qn=2.25*b.$,Hn=(0,o.ph)((0,i.EK)((e,t)=>{const{focusedMessage:n,forwardMessages:o,activeReactions:i,activeEmojiInteractions:a,loadingThread:r}=(0,u.nTw)(e),{message:l,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:F,isPinned:P,viaBusinessBotId:T,effectId:D,paidMessageStars:x}=l,L=(0,u.k9R)(e,l),{shouldWarnAboutFiles:E}=(0,m.lS)(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)(l),H=f||v||q,W=(0,u.Y7C)(e,l),_=(0,u.Szq)(e,l),Q=N?(0,u.mBe)(e,N):void 0,Z=W?.id&&V?j?.adminMembersById?.[W?.id]:void 0,X=l.id===C,{replyToMsgId:ee,replyToPeerId:te,replyFrom:ne}=(0,c.Q)(l)||{},{peerId:oe,storyId:ie}=(0,c.W)(l)||{},se=ee&&ee===C,ae=(0,u.gMr)(e,l),re=k||ne,de=ae?(0,u.Y7C)(e,ae):!re||U||K?void 0:(0,u.HdA)(e,re),le=ae&&(0,u.Szq)(e,ae),ce=te?(0,u.hds)(e,te):void 0,ue=!U&&!K&&ce&&!(0,d.gA)(ce)&&(ce.isNotJoined||(0,u._ls)(e,ce.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,l),fe="thread"===w&&(p?p.messages.some(t=>(0,u.nJv)(e,t,C)):(0,u.nJv)(e,l,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)(l),Ne=Me&&(0,u.oei)(e,Me)?Me:void 0,Ye=(0,d.Jw)(l);let ke;ke=p?.messages?p.messages.every(({id:t})=>(0,u.H1_)(e,t)):(0,u.H1_)(e,S);const Fe="thread"===w&&(0,u.tOf)(e,l,C),Pe=(0,u.yuw)(e),Te=(0,h.iS)(e,l),De=Te&&(0,d.$r)(Pe,Te),xe=(0,u.Vw0)(e,M,p?.commentsMessage?.id||S),Le=Boolean(l.groupedId)&&!l.isInAlbum,Ee=Le?(0,u.D_S)(e,M,l.groupedId)[0]:void 0,Be=Le?I?(0,u.O5q)(e,M,Ee):void 0:l,Re=R?.unreadReactions?.includes(l.id),Oe=C===s.l3&&R?.isForum&&!R.isBotForum&&b,Ue=(0,u.nkm)(e,l),Ke=(0,u.RnX)(e,M),ze=(0,u.Rny)(e,M,l.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??l.senderBoosts:l.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,l),et=(0,h.me)(e,l),tt=(0,h.xd)(e,M,l.id),nt=(0,u.trm)(e),ot=e.appConfig.starsSuggestedPostFutureMin,it=(0,h.B9)(e,l),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:le,replyMessageChat:ce,replyStory:me,isReplyPrivate:ue,storySender:pe,isInDocumentGroup:Le,isProtected:(0,u.ynf)(e,l),isChatProtected:(0,u.ryq)(e,M),isFocused:fe,isForwarding:$,reactionMessage:Be,isChatWithSelf:O,isBotForum:R?.isBotForum,isRepliesChat:U,isAnonymousForwards:K,isChannel:z,isGroup:V,canReply:Fe,highlight:Se,animatedEmoji:Ne,animatedCustomEmoji:Ye,isInSelectMode:(0,u.rTV)(e),isSelected:ke,isGroupSelected:Boolean(l.groupedId)&&!l.isInAlbum&&(0,u.SLS)(e,M,l.groupedId),threadId:C,isDownloading:De,isPinnedList:"pinned"===w,isPinned:P,canAutoLoadMedia:(0,u.wwb)(e,l),canAutoPlayMedia:(0,u.OEt)(e,l),autoLoadFileMaxSizeMb:e.settings.byKey.autoLoadFileMaxSizeMb,shouldLoopStickers:(0,u.ML4)(e),repliesThreadInfo:xe,availableReactions:e.reactions.availableReactions,defaultReaction:(0,d.Nb)(l)||"scheduled"===w?void 0:(0,u.nTJ)(e,M),hasActiveReactions:Ge,activeEmojiInteractions:a,hasUnreadReaction:Re,isTranscribing:void 0!==F&&e.transcriptions[F]?.isPending,transcribedText:void 0!==F?e.transcriptions[F]?.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,l,"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:F,appearanceOrder:P,isJustAdded:J,isFirstInGroup:G,isPremium:Q,isLastInGroup:oe,isFirstInDocumentGroup:ie,isLastInDocumentGroup:se,isTranscribing:ae,transcribedText:re,isLastInList:de,theme:le,forceSenderName:ce,sender:he,canShowSender:me,originSender:Ce,botSender:we,isThreadTop:be,shouldHideReply:Me,replyMessage:Te,replyMessageSender:De,replyMessageForwardSender:xe,replyMessageChat:Le,replyStory:Ke,isReplyPrivate:je,storySender:Je,outgoingStatus:$e,uploadProgress:qe,isInDocumentGroup:He,isLoadingComments:_e,isProtected:Ze,isChatProtected:Xe,isFocused:et,focusDirection:tt,focusedQuote:ot,focusedQuoteOffset:it,noFocusHighlight:st,scrollTargetPosition:at,isResizingContainer:dt,isForwarding:lt,isChatWithSelf:ut,isBotForum:ht,isRepliesChat:mt,isAnonymousForwards:pt,isChannel:ft,isGroup:At,canReply:yt,highlight:Ct,animatedEmoji:wt,animatedCustomEmoji:It,hasActiveReactions:bt,hasLinkedChat:St,isInSelectMode:Mt,isSelected:Nt,isGroupSelected:Yt,threadId:kt,reactionMessage:Pt,availableReactions:Dt,defaultReaction:xt,activeEmojiInteractions:Lt,messageListType:Et,isPinnedList:Rt,isPinned:Ot,isDownloading:Ut,canAutoLoadMedia:zt,canAutoPlayMedia:Vt,shouldLoopStickers:jt,autoLoadFileMaxSizeMb:Jt,repliesThreadInfo:Gt,hasUnreadReaction:$t,memoFirstUnreadIdRef:qt,senderAdminMember:Ht,messageTopic:Wt,hasTopicChip:Xt,chatTranslations:en,areTranslationsEnabled:tn,shouldDetectChatLanguage:on,requestedTranslationLanguage:an,requestedChatTranslationLanguage:dn,withAnimatedEffects:ln,webPageStory:cn,isConnected:un,getIsMessageListReady:hn,shouldWarnAboutFiles:mn,senderBoosts:pn,tags:gn,canTranscribeVoice:fn,viaBusinessBot:Cn,effect:wn,poll:In,maxTimestamp:bn,lastPlaybackTimestamp:Sn,isMediaNsfw:Mn,isReplyMediaNsfw:Yn,paidMessageStars:kn,isChatWithUser:Fn,isAccountFrozen:Pn,minFutureTime:Tn,webPage:En,onIntersectPinnedMessage:Bn})=>{const{toggleMessageSelection:Rn,clickBotInlineButton:On,clickSuggestedMessageButton:Un,rejectSuggestedPost:Kn,openSuggestedPostApprovalModal:zn,disableContextMenuHint:Vn,animateUnreadReaction:jn,focusMessage:Jn,markMentionsRead:Hn,openThread:Wn}=(0,i.ko)(),_n=(0,o.li)(),Qn=(0,o.li)(),Zn=(0,o.li)(),Xn=(0,K.A)(),eo=(0,O.A)(),[to,no]=(0,o.J0)(!1),[oo,io]=(0,o.J0)(!1),[so,ao]=(0,o.J0)(!1),[ro,lo,co]=(0,B.A)(),[uo,ho,mo]=(0,B.A)(),[po,go]=(0,o.J0)(""),{isMobile:fo,isTouchScreen:vo}=(0,D.Ay)();(0,R.mv)(Qn,t);const{isContextMenuOpen:Ao,contextMenuAnchor:yo,contextMenuTarget:Co,handleBeforeContextMenu:wo,handleContextMenu:Io,handleContextMenuClose:bo,handleContextMenuHide:So}=(0,x.A)(_n,vo&&Mt||Pn,!p.Vq,g.Ni,hn);(0,o.vJ)(()=>{Ao&&Vn()},[Ao,Vn]);const Mo=P<=0,[No,Yo]=(0,B.A)(Mo);(0,o.vJ)(()=>{Mo||setTimeout(Yo,P*r.zq7)},[P,Yo,Mo]),(0,j.A)({ref:_n,isOpen:No||J,noMountTransition:Mo&&!J,className:!1});const{id:ko,chatId:Fo,forwardInfo:Po,viaBotId:To,isTranscriptionError:Do,factCheck:xo,isTypingDraft:Lo}=e;(0,o._W)(()=>{if(e.isPinned){const e=h?h.mainMessage.id:ko;Bn?.({viewportPinnedIdsToRemove:[e]})}});const Eo=(0,d.Nb)(e),Bo=(0,d.Ie)(e),Ro="scheduled"===Et||e.isScheduled,Oo=(0,d.Tv)(e)&&!Me,{paidMedia:Uo}=(0,d.r_)(e),{photo:Ko,video:zo}=N(Uo),{photo:Vo=Ko,video:jo=zo,audio:Jo,voice:Go,document:$o,sticker:qo,contact:Ho,invoice:Wo,location:_o,action:Qo,game:Zo,storyData:Xo,giveaway:ei,giveawayResults:ti,todo:ni}=(0,d.r_)(e),oi=(0,c.Q)(e),ii=(0,c.W)(e),si=Boolean(!to&&(Do||re)),ai=Boolean(ii),ri=Boolean(Gt)&&"thread"===Et,di=!si&&(0,d.aN)(e),li=di&&(wt||It),ci=Pt?.reactions&&!(0,d.G)(Pt.reactions),ui=Po&&(!ut||Ro)&&!mt&&!Po.isLinkedChannelPost&&!pt&&!we||Boolean(Xo&&!Xo.isMention),hi=Boolean(pn)&&!ui&&G,mi=Xo?.isMention,pi="video"===jo?.mediaType&&jo.isRound,gi=Boolean(h)&&(h.isPaidMedia&&Uo.extendedMedia.length>1||h.messages.length>1)&&!h.messages.some(e=>0===Object.keys(e.content).length),fi=He&&!ie,vi=He&&!se,Ai=void 0!==yo,yi=!(Ai||Mt||lt||vi||mi),Ci=ft&&!Ro&&e.isForwardingAllowed&&!Xe,wi=Boolean(Rt||Po&&(Po.isChannelPost||ut||mt||pt)&&Po.fromMessageId),Ii=Boolean(xo?.text),bi=ui&&di,Si=Xt||Oo||ai||bi,Mi=(0,U.A)((e,t)=>{Pn||Rn({messageId:ko,groupedId:t,...e?.shiftKey&&{withShift:!0},...gi&&{childMessageIds:h.messages.map(({id:e})=>e)}})}),Ni=me?he:void 0,Yi=Po&&(ut||mt||pt||!Ni)?Ce:Ni,ki=ui?Ce:he,Fi=Bo&&!di,Pi=Po||Xo?Ce:Ni,Ti=(0,d.G5)(e),{handleMouseDown:Di,handleClick:xi,handleContextMenu:Li,handleDoubleClick:Ei,handleContentDoubleClick:Bi,handleMouseMove:Ri,handleSendQuickReaction:Oi,handleMouseLeave:Ui,isSwiped:Ki,isQuickReactionVisible:zi,handleDocumentGroupMouseEnter:Vi}=ue(Mi,_n,ko,Boolean(Mt),Boolean(yt),Boolean(Ze),Io,wo,Fo,Ai,Zn,vi,hn),{handleSenderClick:ji,handleViaBotClick:Ji,handleReplyClick:Gi,handleMediaClick:$i,handleDocumentClick:qi,handleAudioPlay:Hi,handleAlbumMediaClick:Wi,handlePhotoMediaClick:_i,handleVideoMediaClick:Qi,handleMetaClick:Zi,handleTranslationClick:Xi,handleOpenThread:es,handleReadMedia:ts,handleCancelUpload:ns,handleVoteSend:os,handleGroupForward:is,handleForward:ss,handleFocus:as,handleFocusForwarded:rs,handleDocumentGroupSelectAll:ds,handleTopicChipClick:ls,handleStoryClick:cs}=function({lang:e,selectMessage:t,message:n,webPage:o,chatId:r,threadId:l,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:F,markMessagesRead:P,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,c.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:l,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?$:l,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:l,messageId:O,origin:m?a.TQ.ScheduledInline:a.TQ.Inline})}),ee=(0,U.A)(e=>{if(V&&!V.isBought)return;e&&R({chatId:r,threadId:l,currentMediaMessageId:O});const t=o?.url&&(0,te.vG)(o.url),n=j||(0,d.rU)(o),i=t&&"timestamp"in t?t.timestamp:void 0;k({chatId:r,threadId:l,messageId:O,origin:m?a.TQ.ScheduledInline:a.TQ.Inline,timestamp:b||n?.timestamp||i,withDynamicLoading:e})}),ne=(0,U.A)(()=>{ee(!m&&!V)}),oe=(0,U.A)(()=>{const e=n.content?.video?.isGif;ee(!e&&!m&&!V)}),ie=(0,U.A)(()=>{((0,d.yl)(n)||(0,d.eY)(o))&&ne(),oe()}),se=(0,U.A)(()=>{F({chatId:r,messageId:O})}),ae=(0,U.A)((e,t)=>{V&&!V.isBought||(R({chatId:r,threadId:l,currentMediaMessageId:O}),k({chatId:r,threadId:l,messageId:e,mediaIndex:t,origin:m?a.TQ.ScheduledAlbum:a.TQ.Album,withDynamicLoading:!V}))}),re=(0,U.A)(()=>{P({messageIds:[O]})}),de=(0,U.A)(()=>{T({chatId:r,messageId:O})}),le=(0,U.A)(e=>{D({chatId:r,messageId:O,options:e})}),ce=(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:le,handleGroupForward:ce,handleForward:ue,handleFocus:he,handleFocusForwarded:me,handleDocumentGroupSelectAll:pe,handleTopicChipClick:ve,handleStoryClick:Ae}}({lang:Xn,selectMessage:Mi,message:e,webPage:En,chatId:Fo,threadId:kt,isInDocumentGroup:He,asForwarded:ui,isScheduled:Ro,album:h,avatarPeer:Yi,senderPeer:Pi,botSender:we,messageTopic:Wt,isTranslatingChat:Boolean(dn),story:Ke&&"content"in Ke?Ke:void 0,isReplyPrivate:je,isRepliesChat:mt,isSavedMessages:ut,lastPlaybackTimestamp:Sn}),us=(0,U.A)(e=>{e.stopPropagation(),lo()}),hs=(0,U.A)(()=>{Jn({chatId:Fo,threadId:kt,messageId:ko,noHighlight:!0})});(0,o.vJ)(()=>{de&&si&&re&&hs()},[de,re,si]),(0,o.vJ)(()=>{const t=_n.current,n=e.isInAlbum&&h?.messages.some(e=>!e.isDeleting);e.isDeleting&&t&&!n&&((0,Be.U)(t)?io(!0):ao(!0))},[e.isDeleting]);const ms=h?.hasMultipleCaptions?void 0:h?.captionMessage||e,ps=ms&&(0,d.XR)(ms),gs=ps||Ii,fs=(0,f.A)("Message message-list-item",G&&"first-in-group",Ze&&"hide-on-print",Ze&&!ps?"is-protected":"allow-selection",oe&&"last-in-group",ie&&"first-in-document-group",se&&"last-in-document-group",de&&"last-in-list",Bo&&"own",Boolean(e.viewsCount)&&"has-views",e.isEdited&&"was-edited",Oo&&"has-reply",Ao&&"has-menu-open",et&&!st&&"focused",lt&&"is-forwarding",so&&"is-deleting",oo&&"is-dissolving",He&&"is-in-document-group",gi&&"is-album",e.hasUnreadMention&&"has-unread-mention",Nt&&"is-selected",Mt&&"is-in-selection-mode",be&&!A&&"is-thread-top",Boolean(e.inlineButtons)&&"has-inline-buttons",Ki&&"is-swiped",J&&"is-just-added",(bt||ro)&&"has-active-effect",mi&&"is-story-mention"),vs=ms&&(0,d.r_)(ms).text,As=Boolean(e.isInvertedMedia),{replyToMsgId:ys,replyToPeerId:Cs}=oi||{},{peerId:ws,storyId:Is}=ii||{};(0,o.vJ)(()=>{(qo?.hasEffect||wn)&&(qt?.current&&ko>=qt.current||Eo)&&lo()},[wn,Eo,qt,ko,qo?.hasEffect]);const bs=function(e,t,n){const[i,s]=(0,o.J0)(),a=(0,o.li)();return(0,o.vJ)(()=>{if(t||n&&!n()||a.current===e)return;let o=!1;return e?(async function(e,t=.2){if(W()||await H.promise,q)try{const n=(await q.detect(e))[0];if(!n||"und"===n.detectedLanguage||!n.confidence||n.confidence {o||s(e)}).finally(()=>{o||(a.current=e)}),()=>{o=!0}):(s(void 0),void(a.current=void 0))},[t,e,n]),i}(vs?.text,!(tn&&on)||Lo,hn);!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=Z.get(e)||new _.A(150),s=i.get(t);s&&s.detectedLanguage===o&&s.isTranslatable===n||(i.set(t,{id:t,isTranslatable:n,detectedLanguage:o}),Z.set(e,i),X(e))}({chatId:e.chatId,id:e.id,isTranslatable:o,detectedLanguage:t})},[e,t,n,i])}(e,bs,!on,hn);const Ss=(0,d.ZR)(e,!dn),{isPending:Ms,translatedText:Ns}=(0,ne.A)(en,Fo,Ss?ko:void 0,an),Ys=(0,V.A)(Ns,Boolean(Ss)),ks=Ns||Ys,Fs="phoneCall"===Qo?.type?Qo:void 0,Ps=Gt?.isCommentsInfo?Gt:void 0,Ts=St&&ft&&Eo,Ds=(Ps||Ts)&&!vi&&"thread"===Et&&!Y,xs=(Ps||Ts)&&!vi&&"thread"===Et&&!Y,Ls=!vo&&!Fs&&!Mt&&xt&&!vi&&!mi&&!Ti&&!Pn,Es=!si&&ci&&(di||(Vo||jo||Xo||"geo"===_o?.mediaType)&&(!gs||As)),{className:Bs,style:Rs}=(0,z.Ay)({peer:ki,noUserColors:Fi,shouldReset:!0,theme:le}),Os=function(e,t,{poll:n,webPage:o,hasSubheader:i,isCustomShape:s,isLastInGroup:a,asForwarded:l,hasThread:c,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:F,contact:P,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")):F?z.push("document"):P?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"),o.auction&&z.push("auction")),D&&!D.extendedMedia&&z.push("invoice"),D&&D.photo&&z.push("has-photo"),x&&z.push("story"),l&&z.push("is-forwarded"),i&&z.push("has-subheader"),c&&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&&c&&z.push("has-background"),(i||l||$||!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:In,webPage:En,hasSubheader:Si,isCustomShape:di,isLastInGroup:oe,asForwarded:ui,hasThread:ri&&!Y,forceSenderName:ce,hasCommentCounter:ri&&Gt.messagesCount>0,hasBottomCommentButton:xs&&!di,hasActionButton:Ci||wi||xs&&di,hasReactions:ci,isGeoLiveActive:"geoLive"===_o?.mediaType&&!(0,d.vz)(e),withVoiceTranscription:si,peerColorClass:Bs,hasOutsideReactions:Es}),Us=Os.includes("has-appendix"),Ks=(0,M.Rr)(vs?.emojiOnlyCount),zs=Fn?void 0:gi&&kn?h.messages.length*kn:kn;let Vs,js;Vs=Fs||vi?"none":!gs||En||Ks||As?As&&!Ks&&(Ii||En)?"in-text":"standalone":"in-text",ci?Es?js="outside":ui?(Vs="standalone",js="inside"):js="inside":js="none";const Js=di?"in-meta":"in-content";(0,L.A)(Cs||Fo,ys,Te,e.id,Me||je),(0,E.A)(ws||Fo,Is,Ke),(0,ee.A)({elementRef:_n,isFocused:et,focusDirection:tt,noFocusHighlight:st,isResizingContainer:dt,isJustAdded:J,isQuote:Boolean(ot),scrollTargetPosition:at});const Gs=Cn?(0,l.em)(Xn,Cn):void 0,$s=!e.senderId,qs=Gs||$s&&e.postAuthorTitle||(ui||ut)&&Po?.postAuthorTitle||void 0;(0,o.vJ)(()=>{const t=Qn.current;if(!t||!(0,I.Y)(t))return;$t&&jn({messageIds:[ko]});let n=[];e.hasUnreadMention&&(n=[ko]),h&&(n=h.messages.filter(e=>e.hasUnreadMention).map(e=>e.id)),n.length&&Hn({chatId:Fo,messageIds:n})},[$t,h,Fo,ko,jn,e.hasUnreadMention]);const Hs=(0,o.Kr)(()=>gi?T(Bo,Boolean(m),h,fo):void 0,[gi,Bo,m,h,fo]),Ws=ui&&!di?28:0,_s=(0,o.Kr)(()=>{let e,t,n,o="";if(!gi&&(Vo||jo||Wo?.extendedMedia)){let n;if(Vo||jo){const e=Vo||jo;e&&!pi&&(n=(0,k.yA)({media:e,isOwn:Bo,asForwarded:ui,noAvatars:m,isMobile:fo}).width)}else if(Wo?.extendedMedia&&Wo.extendedMedia.width&&Wo.extendedMedia.height){const{width:e,height:t}=Wo.extendedMedia;n=(0,b.kn)({width:e,height:t,fromOwnMessage:Bo,asForwarded:ui,noAvatars:m,isMobile:fo}).width}n&&(n<(0,k.Ay)(fo)&&(t=n),e=Math.max((0,k.nP)(vs?.text,fo,Ds),n))}else if(Hs){const t=(0,k.nP)(vs?.text,fo,Ds);e=Math.max(t,Hs.containerStyle.width)}if(e)o=`width: ${e}px`,n=e+qn;else if(qo&&!Si){const{width:e}=(0,b.bu)(qo,fo);o=`width: ${e+Ws}px`,n=e+qn}return{contentWidth:t,style:o,reactionsMaxWidth:n}},[Hs,ui,Ws,Si,Wo?.extendedMedia,gi,Ds,fo,Bo,m,Vo,qo,vs?.text,jo,pi]),{contentWidth:Qs,style:Zs,reactionsMaxWidth:Xs}=_s,ea=(0,v.A)(Rs,Zs);function ta(e){if(ms)return(0,Se.Y)(Fe.A,{messageOrStory:ms,translatedText:an?ks:void 0,isForAnimation:e,focusedQuote:ot,focusedQuoteOffset:it,emojiSize:Ks,highlight:Ct,isProtected:Ze,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,withTranslucentThumbs:di,isInSelectMode:Mt,canBeEmpty:Ii,maxTimestamp:bn,threadId:kt,shouldAnimateTyping:Lo})}const na=(0,o.hb)(()=>{if(xt)return(0,Se.Y)("div",{className:(0,f.A)("quick-reaction","no-selection",zi&&!bt&&"visible"),onClick:Oi,ref:Zn,children:(0,Se.Y)(Pe.A,{reaction:xt,size:$n,availableReactions:Dt,observeIntersection:u})})},[bt,Dt,xt,Oi,zi,u]);function oa(){const t=(0,Se.Y)(nn,{message:e,isPinned:Ot,withFullDate:ut&&!Bo,noReplies:F,repliesThreadInfo:Gt,outgoingStatus:$e,signature:qs,withReactionOffset:"inside"===js,renderQuickReactionButton:Ls&&"in-meta"===Js?na:void 0,availableReactions:Dt,isTranslated:Boolean(an?ks:void 0),effectEmoji:wn?.emoticon,onClick:Zi,onEffectClick:us,onTranslationClick:Xi,onOpenThread:es,paidMessageStars:zs});return"inside"!==js?t:(0,Se.Y)(An.A,{message:Pt,threadId:kt,metaChildren:t,observeIntersection:u,noRecentReactors:ft,tags:gn,isCurrentUserPremium:Q,isAccountFrozen:Pn})}function ia(e){const t=(0,f.A)("text-content","clearfix"),n=(0,f.A)("text-content","clearfix","in-text"===Vs&&"with-meta",$e&&"with-outgoing-icon"),o=gi||!gi&&Vo||!gi&&jo&&!pi||!li&&Ii,i="in-text"===Vs;return(0,Se.FD)(Se.FK,{children:[sa(),gs&&!li&&(0,Se.FD)("div",{className:t,dir:"auto",children:[ta(),Ms&&(0,Se.Y)("div",{className:"translation-animation",children:(0,Se.Y)("div",{className:"text-loading",children:ta(!0)})}),!o&&i&&oa()]}),o&&(0,Se.FD)(Se.FK,{children:[aa(e),!li&&(0,Se.FD)("div",{className:n,dir:"auto",children:[Ii&&(0,Se.Y)(gt,{factCheck:xo,isToggleDisabled:Mt}),i&&oa()]})]})]})}function sa(){const t=(0,d.T_)(e);if(t&&En)return(0,Se.Y)(Gn,{messageWebPage:t,webPage:En,message:e,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,noAvatars:m,canAutoLoad:zt,canAutoPlay:Vt,asForwarded:ui,isDownloading:Ut,isProtected:Ze,theme:le,story:cn,isConnected:un,lastPlaybackTimestamp:Sn,backgroundEmojiId:ki?.color?.backgroundEmojiId,shouldWarnAboutFiles:mn,autoLoadFileMaxSizeMb:Jt,onAudioPlay:Hi,onMediaClick:$i,onDocumentClick:qi,onCancelMediaTransfer:ns})}function aa(e){const t=(0,Se.FD)(Se.FK,{children:[gi&&n&&(0,Se.Y)(Ge,{album:h,albumLayout:Hs,observeIntersection:n,isOwn:Bo,isProtected:Ze,hasCustomAppendix:e,onMediaClick:Wi}),!gi&&Vo&&(0,Se.Y)(ze.A,{messageText:vs?.text,photo:Vo,isOwn:Bo,observeIntersection:n,noAvatars:m,canAutoLoad:zt,uploadProgress:qe,shouldAffectAppendix:e,isDownloading:Ut,isProtected:Ze,asForwarded:ui,theme:le,isMediaNsfw:Mn,forcedWidth:Qs,onClick:_i,onCancelUpload:ns}),!gi&&jo&&!pi&&(0,Se.Y)(Ve.A,{video:jo,isOwn:Bo,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,forcedWidth:Qs,noAvatars:m,canAutoLoad:zt,canAutoPlay:Vt,uploadProgress:qe,isDownloading:Ut,isProtected:Ze,asForwarded:ui,isMediaNsfw:Mn,lastPlaybackTimestamp:Sn,onClick:Qi,onCancelUpload:ns})]});return Uo?(0,Se.Y)(rn,{chatId:Fo,messageId:ko,paidMedia:Uo,isOutgoing:Bo,children:t}):t}function ra(){return!(di&&!To)&&(y&&(!(Vo||jo||_o||Uo)||Xt)||ui||To||ce)&&!fi&&!(Oo&&di)}function da(){return(0,Se.FD)("span",{className:"forward-title-container",children:[ui&&(0,Se.Y)(Ie.A,{name:Po?.hiddenUserName?"forward":"share-filled"}),ui&&(0,Se.Y)("span",{className:"forward-title",children:Xn("ForwardedFrom")})]})}const la=(0,U.A)(t=>{On({chatId:Fo,messageId:e.id,threadId:kt,button:t})}),ca=(0,U.A)(t=>{if("openThread"!==t.type)return"suggestedMessage"===t.type?"approve"===t.buttonType?void zn({chatId:Fo,messageId:e.id}):"decline"===t.buttonType?void ho():void Un({chatId:Fo,messageId:e.id,button:t}):void 0;Wn({chatId:Fo,threadId:Wt.id})}),ua=(0,U.A)(e=>{go(e.target.value)}),ha=(0,U.A)(()=>{Kn({chatId:Fo,messageId:e.id,rejectComment:po.trim()||void 0}),mo(),go("")});function ma(t=!1,o=!1){let i;!Pi||di&&To?Po?.hiddenUserName?i=Po.hiddenUserName:Xo&&Ce&&(i=(0,l.em)(Xn,Ce)):i=(0,l.em)(Xn,Pi);const s=Pi&&"emojiStatus"in Pi&&Pi.emojiStatus,a=Pi&&"isPremium"in Pi&&Pi.isPremium,c=ui&&Pi,h=we?.hasUsername;return(0,Se.FD)("div",{className:"message-title",dir:"ltr",children:[i||ui?(0,Se.FD)("span",{className:(0,f.A)("message-title-name-container",Po?.hiddenUserName?"sender-hidden":"interactive",void 0),dir:"ltr",children:[!t&&da(),(0,Se.FD)("span",{className:"message-title-name",children:[Xo&&(0,Se.Y)(Ie.A,{name:"play-story"}),c&&(0,Se.Y)(ge.A,{className:"forward-avatar",peer:Pi,size:"micro"}),(0,Se.Y)("span",{className:"sender-title",onClick:ji,children:i?(0,S.A)(i):ui?" ":void 0}),!ui&&s&&(0,Se.Y)(fe.A,{documentId:s.documentId,className:"no-selection",loopLimit:r.J$1,observeIntersectionForLoading:n,observeIntersectionForPlaying:u}),!ui&&!s&&a&&(0,Se.Y)(ke.A,{}),Pi?.fakeType&&(0,Se.Y)(Ye.A,{fakeType:Pi.fakeType})]})]}):we?void 0:" ",we?.hasUsername&&(0,Se.FD)("span",{className:"interactive",children:[(0,Se.Y)("span",{className:"via",children:Xn("ViaBot")}),(0,Se.Y)("span",{className:"sender-title",onClick:Ji,children:(0,S.A)(`@${(0,d.Kl)(we)}`)})]}),(0,Se.Y)("div",{className:"title-spacer"}),o||h?void 0:Po?.isLinkedChannelPost?(0,Se.Y)("span",{className:"admin-title",dir:"auto",children:Xn("DiscussChannel")}):e.postAuthorTitle&&At&&!ui?(0,Se.Y)("span",{className:"admin-title",dir:"auto",children:e.postAuthorTitle}):!Ht||ui||To?void 0:(0,Se.Y)("span",{className:"admin-title",dir:"auto",children:Ht.customTitle||Xn(Ht.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin")}),hi&&(0,Se.FD)("span",{className:"sender-boosts","aria-hidden":!0,children:[(0,Se.Y)(Ie.A,{name:pn>1?"boosts":"boost"}),pn>1?pn:void 0]})]})}const pa=At&&ui?e.postAuthorTitle:void 0,ga=e.suggestedPostInfo&&!e.isOutgoing&&!e.suggestedPostInfo.isAccepted&&!e.suggestedPostInfo.isRejected,fa=(()=>{if(!e.suggestedPostInfo?.scheduleDate||!Tn)return!1;const t=(0,C.Fm)();return e.suggestedPostInfo.scheduleDate<=t+Tn})(),va=(0,o.Kr)(()=>{if(ga)return[[{type:"suggestedMessage",buttonType:"decline",text:eo("SuggestedPostDecline")},{type:"suggestedMessage",buttonType:"approve",text:eo("SuggestedPostApprove"),disabled:fa}],[{type:"suggestedMessage",buttonType:"suggestChanges",text:eo("SuggestedPostSuggestChanges")}]]},[fa,eo,ga]),Aa=(0,o.Kr)(()=>{if(ht&&!e.inlineButtons&&Wt&&de&&kt===s.l3)return[[{type:"openThread",text:eo("BotForumContinueThreadButton")}]]},[ht,eo,e.inlineButtons,Wt,de,kt]),ya=va||Aa;return(0,Se.FD)("div",{ref:_n,id:(0,d.GZ)(e.id),className:fs,"data-message-id":ko,onCopy:Ze?w.A:void 0,onMouseDown:Di,onClick:xi,onContextMenu:Li,onDoubleClick:Ei,onMouseEnter:vi?Vi:void 0,onMouseMove:Ls?Ri:void 0,onMouseLeave:Ls||vi?Ui:void 0,children:[(0,Se.Y)("div",{ref:Qn,className:"bottom-marker","data-message-id":ko,"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":$t||void 0,"data-is-pinned":Ot||void 0,"data-should-update-views":void 0!==e.viewsCount}),!He&&(0,Se.Y)("div",{className:"message-select-control no-selection",children:Nt&&(0,Se.Y)(Ie.A,{name:"select"})}),se&&(0,Se.Y)("div",{className:(0,f.A)("message-select-control group-select no-selection",Yt&&"is-selected"),onClick:ds,children:Yt&&(0,Se.Y)(Ie.A,{name:"select"})}),(0,Se.FD)("div",{className:(0,f.A)("message-content-wrapper",Os.includes("text")&&"can-select-text",Os.includes("giveaway")&&"giveaway-result-content"),children:[(0,Se.FD)("div",{className:Os,style:ea,dir:"auto",children:[ui&&!fi&&(0,Se.FD)(Se.FK,{children:[ra()&&ma(),pa&&(0,Se.Y)("span",{className:"admin-title",dir:"auto",children:pa})]}),function(){const t=(0,f.A)("content-inner",ui&&"forwarded-message",bi&&"forwarded-custom-shape",Si&&"with-subheader"),o=oe&&(!gs||As&&!Ii&&"inside"!==js)&&!xs,i=(0,f.A)("text-content","clearfix","in-text"===Vs&&"with-meta",$e&&"with-outgoing-icon"),s=!Ti||!Bo||ut;return(0,Se.FD)("div",{className:t,onDoubleClick:Bi,dir:"auto",children:[!ui&&ra()&&ma(),Si&&(0,Se.FD)("div",{className:"message-subheader",children:[Xt&&(0,Se.Y)(Ee,{topic:Wt,onClick:ls,className:"message-topic"}),bi&&(0,Se.FD)("div",{className:"forward-custom-shape-subheader",children:[(0,Se.Y)("div",{className:"message-title",children:da()}),ma(!0,!0)]}),Oo&&(0,Se.Y)(ye.A,{message:Te,replyInfo:oi,noUserColors:Fi,isProtected:Ze,sender:De,senderChat:Le,forwardSender:xe,chatTranslations:en,isMediaNsfw:Yn,requestedChatTranslationLanguage:dn,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,onClick:Gi}),ai&&(0,Se.Y)(Ne,{story:Ke,sender:Je,noUserColors:Fi,isProtected:Ze,observeIntersectionForLoading:n,onClick:cs})]}),qo&&n&&u&&(0,Se.Y)(Nn,{message:e,observeIntersection:n,observeIntersectionForPlaying:u,shouldLoop:jt,shouldPlayEffect:ro,withEffect:ln,isMediaNsfw:Mn,onStopEffect:co}),li&&It&&(0,Se.Y)(We,{customEmojiId:It,withEffects:ln&&Fn&&!wn,isOwn:Bo,observeIntersection:n,forceLoadPreview:Eo,messageId:ko,chatId:Fo,activeEmojiInteractions:Lt}),li&&wt&&(0,Se.Y)(Qe,{emoji:wt,withEffects:ln&&Fn&&!wn,isOwn:Bo,observeIntersection:n,forceLoadPreview:Eo,messageId:ko,chatId:Fo,activeEmojiInteractions:Lt}),ln&&wn&&!Eo&&(0,Se.Y)(Zt.A,{shouldPlay:ro,messageId:e.id,isMirrored:!e.isOutgoing,effect:wn,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,onStop:co}),Fs&&(0,Se.Y)(sn,{message:e,phoneCall:Fs,chatId:Fo}),!gi&&pi&&!si&&(0,Se.Y)(yn.A,{message:e,observeIntersection:n,canAutoLoad:zt,isDownloading:Ut,onReadMedia:s?ts:void 0,onHideTranscription:no,isTranscriptionError:Do,isTranscribed:Boolean(re),canTranscribe:fn&&!Ti,isTranscriptionHidden:to,isTranscribing:ae}),(Jo||Go||si)&&(0,Se.Y)(pe.Ay,{theme:le,message:e,origin:a.d9.Inline,uploadProgress:qe,isSelectable:He,isSelected:Nt,noAvatars:m,onPlay:Hi,onReadMedia:Go&&s?ts:void 0,onCancelUpload:ns,isDownloading:Ut,isTranscribing:ae,isTranscriptionHidden:to,isTranscribed:Boolean(re),isTranscriptionError:Do,canDownload:!Ze,onHideTranscription:no,canTranscribe:fn&&!Ti}),$o&&(0,Se.Y)(ve.A,{document:$o,message:e,observeIntersection:n,canAutoLoad:zt,autoLoadFileMaxSizeMb:Jt,uploadProgress:qe,isSelectable:He,isSelected:Nt,onMediaClick:qi,onCancelUpload:ns,isDownloading:Ut,shouldWarnAboutFiles:mn}),Xo&&!mi&&(0,Se.Y)(Dn,{message:e,isProtected:Ze}),mi&&(0,Se.Y)(xn,{message:e}),Ho&&(0,Se.Y)(rt,{contact:Ho,noUserColors:Bo}),In&&(0,Se.Y)(vn,{message:e,poll:In,onSendVote:os}),ni&&(0,Se.Y)(Ln,{message:e,todoList:ni}),(ei||ti)&&(0,Se.Y)(Ft,{message:e}),Zo&&(0,Se.Y)(vt,{message:e,threadId:kt,canAutoLoadMedia:zt}),Wo?.extendedMedia&&(0,Se.Y)(Kt,{message:e,isConnected:un}),si&&(0,Se.Y)("p",{className:(0,f.A)("transcription",!to&&Do&&"transcription-error"),dir:"auto",children:Do?Xn("NoWordsRecognized"):ae&&re?(0,Se.Y)(Ae.A,{content:re}):re}),As&&ia(o),!As&&(0,Se.FD)(Se.FK,{children:[aa(o),gs&&!li&&(0,Se.FD)("div",{className:i,dir:"auto",children:[ta(),Ms&&(0,Se.Y)("div",{className:"translation-animation",children:(0,Se.Y)("div",{className:"text-loading",children:ta(!0)})}),Ii&&(0,Se.Y)(gt,{factCheck:xo,isToggleDisabled:Mt}),"in-text"===Vs&&oa()]}),sa()]}),Wo&&!Wo.extendedMedia&&(0,Se.Y)(Bt,{message:e,shouldAffectAppendix:o&&!ci,isInSelectMode:Mt,isSelected:Nt,theme:le,forcedWidth:Qs}),_o&&(0,Se.Y)(_t,{message:e,isInSelectMode:Mt,isSelected:Nt,theme:le,peer:he})]})}(),!vi&&"standalone"===Vs&&!mi&&oa(),yi&&(0,Se.FD)("div",{className:(0,f.A)("message-action-buttons",_e&&"message-action-buttons-shown"),children:[xs&&di&&(0,Se.Y)(nt,{threadInfo:Ps,disabled:Y||!Ps,isLoading:_e,isCustomShape:!0,asActionButton:!0}),Ci&&(0,Se.Y)(Re.A,{className:"message-action-button",color:"translucent-white",round:!0,ariaLabel:Xn("lng_context_forward_msg"),onClick:se?is:ss,iconName:"share-filled"}),wi&&(0,Se.Y)(Re.A,{className:"message-action-button",color:"translucent-white",round:!0,ariaLabel:eo("FocusMessage"),onClick:Rt?as:rs,iconName:"arrow-right"})]}),xs&&!di&&(0,Se.Y)(nt,{threadInfo:Ps,disabled:Y||!Ps,isLoading:_e}),Us&&(0,Se.Y)(Qt.A,{isOwn:Bo}),Ls&&"in-content"===Js&&na()]}),e.inlineButtons&&(0,Se.Y)(Tt,{inlineButtons:e.inlineButtons,onClick:la}),ya&&(0,Se.Y)(Tt,{inlineButtons:ya,onClick:ca}),"outside"===js&&!mi&&(0,Se.Y)(An.A,{message:Pt,threadId:kt,isOutside:!0,isCurrentUserPremium:Q,maxWidth:Xs,observeIntersection:u,noRecentReactors:ft,tags:gn,isAccountFrozen:Pn})]}),yo&&(0,Se.Y)(ct,{isOpen:Ao,anchor:yo,targetHref:Co?.matches("a[href]")?Co.href:void 0,message:e,album:h,messageListType:Et,onClose:bo,onCloseAnimationEnd:So,repliesThreadInfo:Gt,noReplies:F,detectedLanguage:bs}),uo&&(0,Se.FD)(Oe.A,{isOpen:uo,onClose:mo,title:eo("SuggestedPostDecline"),confirmLabel:eo("SuggestedPostDecline"),confirmHandler:ha,confirmIsDestructive:!0,children:[(0,Se.Y)("div",{className:"decline-dialog-question",children:(0,S.A)(eo("DeclinePostDialogQuestion",{sender:he?(0,l.em)(Xn,he):""},{withNodes:!0,withMarkdown:!0}))}),(0,Se.Y)(Ue.A,{placeholder:eo("DeclineReasonPlaceholder"),value:po,onChange:ua,maxLength:200})]})]})}))},87970:(e,t,n)=>{n.d(t,{A:()=>de});var o=n(84051),i=n(89925),s=n(31481),a=n(90709),r=n(13439),d=n(91048),l=n(30708),c=n(96454),u=n(87357),h=n(95807),m=n(50442),p=n(79824),g=n(31460),f=n(76023),v=n(4961),A=n(41385),y=n(54699),C=n(39351),w=n(17712),I=n(59030),b=n(73767),S=n(45294),M=n(23174),N=n(58554),Y=n(41036),k=n(21849),F=n(34431),P=n(18276),T=n(38102),D=n(48899),x=n(14242),L=n(43874),E=n(45470),B=n(37661),R=n(62587),O=n(83057),U=n(39996),K=n(65843),z=n(57474),V=n(20021);const j=(0,o.ph)(({chat:e,user:t,photo:n,isSavedMessages:i,isSavedDialog:s,canPlayVideo:r,className:d,style:l,theme:m,onClick:p})=>{const g=(0,o.li)(),f=(0,C.A)(),{isMobile:A}=(0,L.Ay)(),y=t&&(0,a.PL)(t),w=e&&(0,a.kE)(e.id),I=e&&(0,a.Qe)(e.id),b=t||e,S=b&&!i&&!y&&!w&&!I,{isVideo:M}=n||{},N=(!n||n.id===b.avatarPhotoId)&&(0,a.cP)(b,"normal"),Y=S&&n&&!N&&(0,a.rI)(n,"pictogram"),k=(0,R.A)(Y||N),F=S&&n&&!M&&(0,a.mU)(n),T=(0,R.A)(F),j=S&&n&&M&&(0,a.Pg)(n),J=(0,R.A)(j)||T,[G,$]=(0,B.A)(),q=Boolean(J&&(!M||G)),H=(0,O.A)(q),W=S&&!q&&!k&&n?.thumbnail?.dataUri,_=(0,E.A)(n?.thumbnail?.dataUri,!W,A&&!c.QH),Q=n||k||W,{className:Z,style:X}=(0,U.Ay)({peer:b,theme:m});(0,o.vJ)(()=>{g.current&&!r&&(g.current.currentTime=0)},[r]);const ee=(0,o.Kr)(()=>i?s?"my-notes":"avatar-saved-messages":y?"avatar-deleted-account":w?"reply-filled":I?"author-hidden":void 0,[I,y,s,w,i]);let te;if(ee)te=(0,V.Y)(P.A,{name:ee,role:"img"});else if(Q)te=(0,V.FD)(V.FK,{children:[W?(0,V.Y)("canvas",{ref:_,className:"thumb"}):(0,V.Y)("img",{src:k,draggable:!1,className:"thumb",alt:""}),n&&(M?(0,V.Y)(K.A,{canPlay:r,ref:g,src:J,className:(0,u.A)("avatar-media",H),muted:!0,disablePictureInPicture:!0,loop:!0,playsInline:!0,onReady:$}):(0,V.Y)("img",{src:J,draggable:!1,className:(0,u.A)("avatar-media",H),alt:""}))]});else if(t){const e=(0,a.Yg)(t);te=e?(0,x.Qh)(e,2):void 0}else if(e){const t=(0,a.Js)(f,e);te=t&&(0,x.Qh)(t,(0,D.L8)(e.id)?2:1)}else te=(0,V.Y)("div",{className:"spinner-wrapper",children:(0,V.Y)(z.A,{color:"white"})});const ne=(0,u.A)("ProfilePhoto",Z,i&&"saved-messages",I&&"anonymous-forwards",y&&"deleted-account",w&&"replies-bot-account",!i&&!Q&&"no-photo",d);return(0,V.Y)("div",{className:ne,style:(0,h.A)(l,X),onClick:Q?p:void 0,children:"string"==typeof te?(0,v.A)(te,["hq_emoji"]):te})});var J=n(43336),G=n(66833),$=n(95773),q=n(82855);const H=2*f.$,W=[{x:-.2,y:-.3},{x:.3,y:.1},{x:-.4,y:-.1},{x:.4,y:-.1},{x:-.25,y:.1},{x:.25,y:-.25}],_=({gift:e,style:t,className:n,withGlow:i,peerId:s})=>{const{openGiftInfoModal:a}=(0,r.ko)(),d=(0,o.li)(),l=(0,o.Kr)(()=>(0,G.uc)(e.gift),[e]),c=(0,w.A)(()=>{a({peerId:s,gift:e})});if(l?.model&&l.backdrop)return(0,V.Y)($.A,{withSparkles:!0,sparklesColor:l.backdrop.textColor,glowColor:i?l.backdrop.edgeColor:void 0,ref:d,className:n,style:t,onClick:c,children:(0,V.Y)(q.A,{containerRef:d,sticker:l.model.sticker,size:H,withTranslucentThumb:!0,noPlay:!0})})},Q=(0,o.ph)(({peerId:e,gifts:t,isExpanded:n,className:o,withGlow:i})=>{const{createVtnStyle:s}=(0,A.k)();if(t)return(0,V.Y)("div",{className:(0,u.A)("dspICZx5",o),children:t.slice(0,W.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)}}(W[o]):W[o],r=(0,h.A)(`top: ${100*(.5+a.y)}%`,`left: ${100*(.5+a.x)}%`);return(0,V.Y)(_,{peerId:e,className:"GtRefNqT",gift:t,style:(0,h.A)(r,s(`profilePinnedGift${o}`,"profilePinnedGift")),withGlow:i},t.gift.id)})})});var Z=n(40558);const X="XxRtPe_4",ee="eZ2DGNou",te="ldzIKEUp",ne="uNvH08Qp",oe="UZ7NDj8N",ie="Yr9FHqbF",se="eFsZljMG",ae=8*f.$,re=5.25*f.$,de=(0,o.ph)((0,r.EK)((e,{peerId:t})=>{const n=(0,d.PVB)(e,t),o=(0,d.mBe)(e,t),i=o?(0,d.vGo)(e,t):void 0,r=(0,d.K0y)(e,t),c=(0,d.hds)(e,t),u=(0,d.IVq)(e,t),{mediaIndex:h,chatId:m}=(0,d.nTw)(e).mediaViewer,p=c?.isForum,{threadId:g}=(0,d.Xf0)(e)||{},f=p&&g?(0,d.S0q)(e,t,g):void 0,{animationLevel:v}=(0,l.lS)(e),A=n?.emojiStatus,y=A?(0,d.O8F)(e,A.documentId):void 0,C="collectible"===A?.type?A.slug:void 0,w=n&&(0,d.Vi6)(e,n),I=(0,d.SJA)(e),b=(0,d.c7s)(e,t),S=(0,d.FDg)(e,t),M=Boolean(n?.avatarPhotoId),N=(0,a.Qe)(t),Y=(0,a.DX)(t)||N||n?.id===s.zv8;return{user:o,userFullInfo:i,userStatus:r,chat:c,mediaIndex:h,avatarOwnerId:m,animationLevel:v,emojiStatusSticker:y,emojiStatusSlug:C,emojiStatus:A,profilePhotos:u,topic:f,messagesCount:f?(0,d.QbG)(e,t,g):void 0,profileColorOption:w,theme:I,isPlain:!b,savedGifts:S,hasAvatar:M,isSystemAccount:Y}})(({isExpanded:e,isForSettings:t,canPlayVideo:n,user:s,userFullInfo:d,userStatus:l,chat:f,mediaIndex:D,avatarOwnerId:x,topic:L,messagesCount:E,animationLevel:B,emojiStatus:R,emojiStatusSticker:O,emojiStatusSlug:U,profilePhotos:K,peerId:z,isForMonoforum:J,profileColorOption:G,theme:$,isPlain:q,savedGifts:H,hasAvatar:W,isSystemAccount:_,onExpand:de})=>{const{openMediaViewer:le,openPremiumModal:ce,openStickerSet:ue,openPrivacySettingsNoticeModal:he,loadMoreProfilePhotos:me,openUniqueGiftBySlug:pe,openProfileRatingModal:ge,loadPeerSavedGifts:fe}=(0,r.ko)(),ve=(0,I.A)(),Ae=(0,C.A)();(0,y.A)(s?6e4:void 0);const{createVtnStyle:ye}=(0,A.k)(),Ce=K?.photos||p.p,we=(0,b.A)(D),Ie=(0,b.A)(x),[be,Se]=(0,o.J0)(!0),[Me,Ne]=(0,o.J0)(0),Ye=Ce.length<=1||0===Me,ke=Ce.length<=1||Me===Ce.length-1,Fe="collectible"===R?.type?R:void 0,Pe=s||f,{customEmoji:Te}=(0,S.A)(Fe?.patternDocumentId||Pe?.profileColor?.backgroundEmojiId),De=(0,o.Kr)(()=>{if(Fe)return{bgColors:[Fe.centerColor,Fe.edgeColor],storyColors:[Fe.textColor,Fe.textColor]};const e=G&&("dark"===$?G.darkColors:G.colors);return e?{bgColors:[...e.bgColors].reverse(),storyColors:[...e.storyColors].reverse()}:void 0},[G,$,Fe]),xe=De?.bgColors||Te,Le=(0,o.Kr)(()=>H?.gifts.filter(e=>"starGiftUnique"===e.gift.type?e.isPinned&&e.gift.slug!==Fe?.slug:e.isPinned),[H,Fe?.slug]);(0,o.vJ)(()=>{Ce.length-Me<=3&&me({peerId:z})},[Me,z,Ce.length]),(0,o.vJ)(()=>{fe({peerId:z})},[z]),(0,o.vJ)(()=>{Ie&&void 0!==we&&void 0===D&&(Se(!1),Ne(we))},[D,we,Ie]),(0,o.vJ)(()=>{Me>Ce.length&&(Se(!1),Ne(Math.max(0,Ce.length-1)))},[Me,Ce.length]),(0,o.vJ)(()=>{e||Ne(0)},[e]),function(e,t){(0,o.vJ)(()=>{e.slice(t,t+4).forEach(e=>{const t=(0,a.mU)(e);N.Ih(t)||N.hd(t,M.qZ.BlobUrl)})},[t,e])}(Ce,Me);const Ee=(0,w.A)(()=>{le({isAvatarView:!0,chatId:z,mediaIndex:Me,origin:t?i.TQ.SettingsAvatar:i.TQ.ProfileAvatar})}),Be=(0,w.A)(()=>{U?pe({slug:U}):z?ce({fromUserId:z}):ue({stickerSetInfo:O.stickerSetInfo})}),Re=(0,w.A)(()=>{Ye||(Se(!0),Ne(Me-1))}),Oe=(0,w.A)(()=>{ke||(Se(!0),Ne(Me+1))}),Ue=(0,w.A)(()=>{he({chatId:f.id,isReadDate:!1})}),Ke=(0,w.A)(e=>{s&&ge({userId:s.id,level:e})}),ze=(0,w.A)(()=>{t?Ee():W&&de?.()});if((0,o.vJ)(()=>{const e=document.querySelector(`.${oe}`);if(e)return(0,m.wJ)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:c.TF?(e,t)=>t===m.ez.Right?(Re(),!0):t===m.ez.Left&&(Oe(),!0):void 0})},[Oe,Re]),s||f)return L?(0,V.FD)("div",{className:"dNcezQH8",children:[(0,V.Y)(T.A,{topic:L,size:120,className:"YwVcTLvK",letterClassName:"_sQEevF7",noLoopLimit:!0}),(0,V.Y)("h3",{className:"hjk4U031",dir:Ae.isRtl?"rtl":void 0,children:(0,v.A)(L.title)}),(0,V.Y)("p",{className:"GXxwbzqF",children:E?ve("Chat.Title.Topic",E,"i"):ve("lng_forum_no_messages")})]}):(0,V.FD)("div",{className:(0,u.A)("ProfileInfo","Z_HM0Jqg",!e&&"blI_IH7j",q&&"YIhgPXW6"),style:(0,h.A)(De&&`--rating-outline-color: ${e?"transparent":De?.bgColors[0]}`,De&&!e&&`--rating-text-color: ${De?.bgColors[0]}`,ye("profileInfo",!0)),dir:Ae.isRtl?"rtl":void 0,children:[xe&&(0,V.Y)(Z.A,{backgroundColors:De?.bgColors,patternIcon:Te,patternSize:16,withLinearGradient:!Fe,className:"BvunKb6r",yPosition:q?re:ae}),Boolean(Le?.length)&&(0,V.Y)(Q,{peerId:z,gifts:Le,isExpanded:e,className:"JX3wjADD",withGlow:!q}),e&&(0,V.FD)("div",{className:oe,style:ye("photoWrapper",!0),children:[function(){const e=Math.max(Ce.length,K?.count||0);if(!Ce||e<=1)return;const t=Array.from({length:Math.min(e,30)}),n=Me>=30?29:Me;return(0,V.Y)("div",{className:"e7iOf_3T",style:ye("photoDashes",!0),children:t.map((e,t)=>(0,V.Y)("span",{className:(0,u.A)("eD0Is6TL",t===n&&"MSdiAM06")}))})}(),!t&&K?.personalPhoto&&(0,V.Y)("div",{className:(0,u.A)(ee,Ye&&ne),children:(0,V.Y)("div",{className:te,children:ve(K.personalPhoto.isVideo?"UserInfo.CustomVideo":"UserInfo.CustomPhoto")})}),t&&K?.fallbackPhoto&&(0,V.Y)("div",{className:(0,u.A)(ee,(Ye||ke)&&ne),children:(0,V.FD)("div",{className:te,onClick:function(){Ye&&(Se(!0),Ne(Ce.length-1))},children:[!ke&&(0,V.Y)(k.A,{photo:K.fallbackPhoto,className:"a9OwsvOP",size:"mini"}),ve(K.fallbackPhoto.isVideo?"UserInfo.PublicVideo":"UserInfo.PublicPhoto")]})}),(0,V.Y)(Y.Ay,{activeKey:Me,name:(0,g.P)("slide",B,!be,Ae.isRtl),children:function(e){const t=Ce.length>0?Ce[Me]:void 0;return(0,V.Y)(j,{user:s,chat:f,photo:t,theme:$,canPlayVideo:Boolean(e&&n),className:(0,u.A)(e&&"yltXKQri"),style:e?ye("avatar",!0):void 0,onClick:Ee},Me)}}),!Ye&&(0,V.Y)("button",{type:"button",dir:Ae.isRtl?"rtl":void 0,className:(0,u.A)(ie,"Z1ZX2xot"),"aria-label":ve("AccDescrPrevious"),onClick:Re}),!ke&&(0,V.Y)("button",{type:"button",dir:Ae.isRtl?"rtl":void 0,className:(0,u.A)(ie,"X0stLWTl"),"aria-label":ve("Next"),onClick:Oe})]}),!e&&(0,V.Y)(k.A,{withStory:!0,storyColors:De?.storyColors,className:"rLHO_VQT",size:"jumbo",peer:Pe,style:ye("avatar",!0),onClick:W?ze:void 0},Pe?.id),(0,V.FD)("div",{className:"ZFBuRDGK",dir:Ae.isRtl?"rtl":"auto",style:ye("info",!0),children:[(s||f)&&(0,V.Y)(F.A,{className:"atYgxkWV",style:ye("title",!0),peer:s||f,withEmojiStatus:!0,withStatusTextColor:!0,emojiStatusSize:24,onEmojiStatusClick:Be,noLoopLimit:!0,canCopyTitle:!0}),function(){const e=(0,a.Qe)(z),t=(0,a.DX)(z);if(!e&&!t)return J?(0,V.Y)("span",{className:(0,u.A)(X,"status"),dir:"auto",style:ye("status",!0),children:Ae("MonoforumStatus")}):s?(0,V.FD)("div",{className:(0,u.A)(X,"status",(0,a.PF)(s,l)&&"online"),style:ye("status",!0),children:[Ve(),(0,V.Y)("span",{className:"F4JyLH2c",dir:"auto",children:(0,a.CD)(ve,s,l)}),l?.isReadDateRestrictedByMe&&!_&&(0,V.Y)("span",{className:"wCXGPPTY",onClick:Ue,children:(0,V.Y)("span",{children:ve("StatusHiddenShow")})})]}):(0,V.Y)("span",{className:(0,u.A)(X,"status"),dir:"auto",style:ye("status",!0),children:(0,a.WX)(f)?ve("Subscribers",f.membersCount??0,"i"):ve("Members",f.membersCount??0,"i")})}()]})]});function Ve(){if(!d?.starsRating)return;const e=d.starsRating.level,t=()=>Ke(e);if(e<0)return(0,V.FD)("span",{role:"button",tabIndex:0,className:"vuUzgWI1",onClick:t,children:[(0,V.Y)(P.A,{name:"rating-icons-negative",className:"JZBCjHv0"}),(0,V.Y)("span",{className:se,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,V.FD)("span",{role:"button",tabIndex:0,className:"P6tsZMON",onClick:t,children:[(0,V.Y)(P.A,{name:i,className:"Yvu9iM5n"}),(0,V.Y)("span",{className:se,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),l=n(80853),c=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[F,P]=(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:l}=M.current,c=(0,i.mS)();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:l,isLast:c}=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)}},c()||(t.nexttrack=()=>{r()}),l()||(t.previoustrack=()=>{d()})}return t}(M)),(0,d.HW)("playing");const{audioPlayer:u}=(0,a.nTw)(c),{audioPlayer:h}=c;e(h.volume),r(Boolean(u.isMuted));const m=l.duration&&Number.isFinite(l.duration)?l.duration:t;("voice"===n||m>s.CVm)&&o(u.playbackRate),(0,d.hm)({duration:l.duration||0,playbackRate:l.playbackRate,position:l.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||P(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,l.f)(E)||w||P(E.currentTime/G))},[G,F,E,w,b]),(0,o.vJ)(()=>()=>{B?.(C)},[B,C]),(0,c.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&&P(E.currentTime/G)});return{isPlaying:k,playProgress:F,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),l=n(24433),c=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)(l.A,{icon:"channel",onClick:v,children:C("SponsoredMessageSponsor")}),!h&&(0,u.Y)(l.A,{icon:"info",onClick:g,children:C(n?"AboutRevenueSharingAds":"SponsoredMessageInfo")}),n&&A&&(0,u.Y)(l.A,{icon:"hand-stop",onClick:A,children:C("ReportAd")}),M&&(0,u.Y)(c.A,{}),(0,u.Y)(l.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:l,shouldSkipAbout:c,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:l,canReport:r,sponsorInfo:n,shouldSkipAbout:c,onClose:p,onCloseAnimationEnd:p,onAboutAdsClick:I,onSponsoredHide:b,onSponsorInfo:S,onSponsoredReport:M})})})},90423:(e,t,n)=>{n.d(t,{Ay:()=>r,j9:()=>c,zk:()=>d});var o=n(84051),i=n(63495),s=n(96454);const a=l();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(c())};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 l(){return void 0!==document.fullscreenElement?"fullscreenElement":void 0!==document.mozFullScreenElement?"mozFullScreenElement":void 0!==document.webkitFullscreenElement?"webkitFullscreenElement":""}function c(){const e=l();return Boolean(e&&document[e])}},91930:(e,t,n)=>{n.d(t,{A:()=>T});var o=n(84051),i=n(31481),s=n(90709),a=n(3544),r=n(70636),d=n(87357),l=n(17663),c=n(48899),u=n(48775),h=n(76023),m=n(4961),p=n(18501),g=n(35749),f=n(2338),v=n(11217),A=n(5912),y=n(39351),C=n(62587),w=n(59030),I=n(64154),b=n(42452),S=n(18276),M=n(27860),N=n(18653),Y=n(86070),k=n(20021);const F=" ";function P(e,t,n,o,i,s){const{width:a,height:r}=(0,h.mr)(),l=t||e,c=n&&t;return(0,k.FD)("div",{className:(0,d.A)("embedded-thumb",o&&"round"),children:[!s&&!c&&(0,k.Y)("img",{src:l,width:a,height:r,alt:"",className:"pictogram",draggable:!1}),!s&&c&&(0,k.Y)("video",{src:t,width:a,height:r,playsInline:!0,disablePictureInPicture:!0,className:"pictogram"}),(0,k.Y)(M.A,{thumbDataUri:c?e:l,isVisible:Boolean(s),width:a,height:r}),i&&(0,k.Y)("span",{className:"protector"})]})}const T=({className:e,message:t,replyInfo:n,suggestedPostInfo:h,sender:M,senderChat:T,forwardSender:D,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,A.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,g.A)(H,_?"full":"pictogram"),Z=(0,C.A)(Q,!q),X=(0,f.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,I.A)(U,t?.chatId,ie?t?.id:void 0,K),ae=(0,w.A)(),re=(0,y.A)(),de=M?(0,r.F9)(ae,M):oe?.hiddenUserName||t?.forwardInfo?.hiddenUserName,le=(0,o.Kr)(()=>{if(!x)return;const e=x.map(e=>(0,r.F9)(re,e)).filter(Boolean);return re.conjunction(e)},[x,re]),ce=T?(0,r.F9)(ae,T):void 0,ue=D?(0,r.F9)(ae,D):t?.forwardInfo?.hiddenUserName,he=M&&M.id===D?.id,{handleClick:me,handleMouseDown:pe}=(0,v.Q)(G);return(0,k.FD)(Y.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",h&&"is-suggested-post"),dir:re.isRtl?"rtl":void 0,onClick:me,onMouseDown:pe,children:[(0,k.Y)("div",{className:"hover-effect"}),(0,k.Y)(b.A,{}),X&&P(X,Z,_,ee,B,te),(0,k.FD)("div",{className:"message-text",children:[(0,k.Y)("p",{className:(0,d.A)("embedded-text-wrapper",ne&&"multiline"),children:function(){if(h){if(!h?.price?.amount&&!h.scheduleDate)return re("ComposerEmbeddedMessageSuggestedPostDescription");const e=h.price?h.price.currency===i.ykW?(0,u.Ms)(re,h.price.amount,{className:"suggested-price-ton-icon",shouldConvertFromNanos:!0}):(0,u.U2)(re,h.price.amount,{className:"suggested-price-star-icon"}):"",t=h.scheduleDate?(0,l.e0)(h.scheduleDate,re,ae):"";return e&&!t?(0,k.Y)("span",{className:"suggested-post-price-wrapper",children:re("TitleSuggestedPostAmountForAnyTime",{amount:e},{withNodes:!0,withMarkdown:!0})}):(0,k.FD)("span",{className:"suggested-post-price-wrapper",children:[e,t?` • ${t}`:""]})}return"message"===n?.type&&n.quoteText?(0,p.fd)({text:n.quoteText.text,entities:n.quoteText.entities,asPreview:!0,emojiSize:17}):t?V?re("EmbeddedMessageNoCaption"):(0,k.Y)(N.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,k.Y)("span",{children:(0,m.A)(t)}):F}(H)||F}()}),(0,k.FD)("div",{className:"message-title",children:[function(){if(L)return(0,m.A)(L);if(h&&n)return re("TitleSuggestedChanges");if(h)return re("ComposerEmbeddedMessageSuggestedPostTitle");if(!de&&!le)return F;let e;T&&((0,s.WX)(T)&&(e="channel-filled"),(0,s.YE)(T)&&(e="group-filled"));const t=R&&Boolean(n&&"quoteText"in n&&n?.quoteText);return(0,k.FD)("span",{className:"embedded-sender-wrapper",children:[(!T||!!(0,c.L8)(T?.id)||T.id!==M?.id)&&(0,k.FD)("span",{className:"embedded-sender",children:[!x&&de&&(0,m.A)(t?ae("ReplyToQuote",de):de),le&&(0,m.A)(re("ComposerTitleForwardFrom",{users:le},{withNodes:!0,withMarkdown:!0}))]}),e&&(0,k.Y)(S.A,{name:e,className:"embedded-chat-icon"}),e&&ce&&(0,k.Y)("span",{className:"embedded-sender-chat",children:(0,m.A)(ce)})]})}(),ue&&!he&&(0,k.FD)("span",{className:"embedded-forward-sender-wrapper",children:[(0,k.Y)(S.A,{name:D?"share-filled":"forward",className:"embedded-origin-icon"}),(0,k.Y)("span",{className:"forward-sender-title",children:(0,m.A)(ue)})]})]})]})]})}},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),l=n(87679),c=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,c.RB)(e));let n=0;for await(const e of t)if(n+=e.byteLength,n>=2097152)break}(e):c.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,l.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.video?.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])}},93005:(e,t,n)=>{n.d(t,{NH:()=>d,QG:()=>c,S$:()=>g,Xz:()=>p,gh:()=>r,pV:()=>a,rG:()=>u,w7:()=>h});class o{hierarchy=[];constructor(e){this.hierarchy=[...e||[]]}with(e){return new o([...this.hierarchy,e])}getTypes(){return this.hierarchy}}const i=new o(["rightColumn"]),s=i.with("profileAvatar"),a=s.with("profileExpand"),r=s.with("profileCollapse"),d=i.with("profileGifts"),l=i.with("chatExtra"),c=l.with("profileBusinessHours"),u=c.with("profileBusinessHoursExpand"),h=c.with("profileBusinessHoursCollapse"),m=l.with("profileNote"),p=m.with("profileNoteExpand"),g=m.with("profileNoteCollapse")},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)l(t),e++,e===i&&(await(0,o.v7)(s),e=0);a=[]}(),r=!1},s))}function l({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:()=>c});var o=n(23174),i=n(4875);const s=262144,a=5242879,r=new Map,d=new Map,l=new Map;async function*c(e,t=0,n=s){const c=e.match(/fileSize=(\d+)/);let u;for(u=c?c&&Number(c[1]):d.get(e);;){if(u&&t>=u)return;let s=t+n-1;u&&s>u&&(s=u-1);const c=`${e}:${t}-${s}`;let h=r.get(c);if(!h){let n=l.get(c);n||(n=(0,i.px)("downloadMedia",{mediaFormat:o.qZ.Progressive,url:e,start:t,end:s}),l.set(c,n));const m=await n.finally(()=>{l.delete(c)});if(!m?.arrayBuffer)return;m.fullSize&&!u&&(u=m.fullSize,d.set(e,m.fullSize)),h=m.arrayBuffer,s<=a&&r.set(c,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),l=n(10221),c=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),F=(0,r.A)(()=>{b(),f?.()}),P=(0,l.A)({anchorRef:v,overlayRef:A,isMirrored:t,isDisabled:!w,isForMessageEffect:!0,id:n.id});(0,o.vJ)(()=>{S&&P(),N()},[P,N,S]),(0,o.vJ)(()=>{C&&m&&k&&(I(),M())},[C,k,m,P]);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)(c.A,{ref:A,className:T,tgsUrl:k,size:256,play:!0,isLowPriority:!0,noLoop:!0,forceAlways:!0,onEnded:F},`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}},98021:(e,t,n)=>{n.d(t,{E6:()=>o,FQ:()=>i});const o={"🗂":"folder-tabs-folder","⭐":"folder-tabs-star","🤖":"folder-tabs-bot","👥":"folder-tabs-group","👤":"folder-tabs-user","✅":"folder-tabs-chat","📢":"folder-tabs-channel","💬":"folder-tabs-chats"},i=e=>o[e]}}]); //# sourceMappingURL=5718.c5cd403ac67d80eb99d9.js.map