2 lines
409 KiB
JavaScript
2 lines
409 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[3892],{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,b){const{loadCustomEmojiForEmoji:I,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(b?.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&&I({emoji:e})}}else S()},[e,P,F,T,S,I]);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)(),b=(0,o.li)(),I=(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&&I())):"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||(b.current=t.touches[0].clientY)}),k=(0,r.A)(t=>{const n=e.current,o=b.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?(I(),void(b.current=void 0)):"overscroll"===s&&a<-p?(S(),void(b.current=void 0)):void 0:void 0}),F=(0,r.A)(()=>{b.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])}},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,b,I,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)(b.current);return(0,h.S)(o).match(y)?.[0].trim()},[e,t,C,b],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||!I&&!S)return void k(void 0);const t=(0,i.mS)().users.byId;if(!t)return void k(void 0);const n=I?.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,I,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}`:`<a\n class="text-entity-link"\n data-entity-type="${s.C7.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n dir="auto"\n >${c}</a>`,m=b.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(/<div>(<br>|<br\s?\/>)?<\/div>/gi,"<br>")}},9717:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(84051),i=n(66644),s=n(87894),a=n(79882),r=n(30857),d=n(17712),l=n(73767),c=n(35297);const u={};function h(e,t,n){const h=(0,o.Kr)(()=>{if(e)return e.reduce((e,t,n)=>(e[t]=n,e),{})},[e]),m=(0,l.A)(h),p=(0,l.A)(n),g=(0,l.A)(t),f=(0,o.li)(!0);(0,o.vJ)(()=>{(0,i.Uz)(()=>{f.current=!1})},[]);const v=(0,o.li)(u),A=(0,r.A)(),y=(0,d.A)(()=>{v.current!==u&&(v.current=u,A())}),C=void 0!==g?t-g:0;(0,c.A)(()=>{if(!h||!m||n!==p||m===h)return void(v.current=u);const e=(0,s.LG)(h,(e,t)=>void 0!==m[t]?e-m[t]:-1/0),t=Object.values(e).some(e=>0!==e);v.current=t?e:u},[n,h,p,m,t]);const w=(0,a.We)(v.current,f.current,Boolean(C));return{orderDiffById:v.current,shiftDiff:C,getAnimationType:w,onReorderAnimationEnd:y}}},10221:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(84051),i=n(66644),s=n(76023),a=n(17712);const r=s.$;function d({anchorRef:e,overlayRef:t,isMirrored:n,isForMessageEffect:s,isDisabled:d,id:l}){const c=(0,a.A)(()=>{const o=t.current,a=e.current;if(!o||!a)return;const d=a.getBoundingClientRect(),l=o.getBoundingClientRect(),c=window.innerWidth;(0,i.RK)(()=>{const e=d.top+d.height/2,t=d.bottom,i=s?t:e;o.style.top=i-l.height/2+"px",n?o.style.left=d.left-r+"px":o.style.right=c-d.right-r+"px"})});return(0,o.vJ)(()=>{d||c()},[d,l]),(0,o.vJ)(()=>{if(d)return;const t=e.current.closest(".MessageList");return t?(t.addEventListener("scroll",c,{passive:!0}),()=>{t.removeEventListener("scroll",c)}):void 0},[d,e]),c}},11359:(e,t,n)=>{n.d(t,{L:()=>i});const o=5;function i(e,t){const{commonAncestorContainer:n}=e;let i=n,s=1;for(;i&&i.id!==t&&s<o;)i=i.parentElement,s++;return Boolean(i&&i.id===t)}},11462:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(30857),s=n(17712),a=n(35297);function r(e=!1){const t=(0,o.li)(e),n=(0,o.li)(!1),r=(0,i.A)();(0,a.A)(()=>{e&&(t.current=!0)},[e]);const d=(0,s.A)(()=>{t.current=!1,n.current=!1,r()}),l=(0,s.A)(()=>{n.current=!0,r()});return{shouldRenderForumPanel:t.current,isAnimationStarted:n.current,handleForumPanelAnimationEnd:d,handleForumPanelAnimationStart:l}}},13481:(e,t,n)=>{n.d(t,{A:()=>ge});var o=n(84051),i=n(13439),s=n(89925),a=n(31481),r=n(96454),d=n(87357),l=n(75956),c=n(49763),u=n(37959),h=n(23459),m=n(7985),p=n(74984),g=n(2178),f=n(96374),v=n(5912),A=n(17712),y=n(9717),C=n(46222),w=n(52745),b=n(90709),I=n(30708),S=n(95807),M=n(25903),N=n(87894),Y=n(14242),k=n(4961),F=n(63527),P=n(39351),T=n(35297),D=n(21849),x=n(18276),L=n(24713),E=n(22720);const B={root:"sG8AAzvK",noAnimation:"z7YCLnQC",minimized:"lTOui0dp",noMarginTop:"CODezO4o",button:"bNkLqJf1",title:"rMTpNazX","unread-count":"O7esHjyC",unreadCount:"O7esHjyC",info:"OS2LWzdu",name:"bkCtPuPQ",icon:"f4LUPgr4",avatarWrapper:"RMY__Znz",avatar:"qeb0Aox1",chatsPreview:"_1817Hwgd",unread:"SS39xuL3"};var R=n(20021);const O={isCustomPeer:!0,title:"Archived Chats",avatarIcon:"archive-filled",customPeerAvatarColor:"#9EAAB5"},U=(0,o.ph)(({archiveSettings:e,isFoldersSidebarShown:t,offsetTop:n,animationType:s,onDragEnter:r,onClick:l})=>{const{updateArchiveSettings:c}=(0,i.ko)(),h=(0,o.li)(),m=(0,F.A)(I.Vu),g=(0,o.li)(m!==a.dnp),f=(0,P.A)();(0,T.A)(()=>{if(m===a.dnp)return void(g.current=!1);if(s!==u.IP.None)return void(g.current=!0);const e=setTimeout(()=>{g.current=!1},200),t=h.current;return t&&(0,M.j)(t,()=>{g.current=!1},"transform"),()=>clearTimeout(e)},[s,m]);const v=(0,p.Rh)(a._E9),A=(0,p.ic)(),y=A[a._E9]?.chatsCount,C=(0,o.Kr)(()=>{if(!v?.length)return f("Loading");const e=(0,i.mS)().chats.byId;return v.slice(0,5).map((t,n,o)=>{const i=n===o.length-1,s=e[t];if(!s)return;const a=(0,b.Js)(f,s);return(0,R.FD)(R.FK,{children:[(0,R.Y)("span",{className:(0,d.A)(B.chat,y&&s.unreadCount&&B.unread),children:(0,k.A)(a)}),i?"":", "]})})},[v,f,y]),w=(0,o.Kr)(()=>{const t=!e.isMinimized&&{title:f("ContextArchiveCollapse"),icon:"collapse",handler:()=>{c({isMinimized:!0})}},n=e.isMinimized&&{title:f("ContextArchiveExpand"),icon:"expand",handler:()=>{c({isMinimized:!1})}},o={title:f("ContextArchiveToMenu"),icon:"archive-to-main",handler:()=>{c({isHidden:!0})}};return(0,N.oE)([t,n,o])},[e.isMinimized,f,c]),U=(0,o.hb)(e=>{e.preventDefault(),r?.()},[r]);return(0,R.Y)(E.A,{ref:h,onClick:l,onDragEnter:U,className:(0,d.A)(B.root,e.isMinimized&&B.minimized,t&&e.isMinimized&&B.noMarginTop,!g.current&&B.noAnimation,n&&B.noMarginTop,"chat-item-clickable","chat-item-archive"),style:(0,S.A)(Boolean(n)&&`transform: translateY(${n}px)`),buttonClassName:B.button,contextActions:w,withPortalForMenu:!0,children:e.isMinimized?(0,R.Y)("div",{className:(0,d.A)(B.info,"info"),children:(0,R.FD)("div",{className:"info-row",children:[(0,R.Y)("div",{className:(0,d.A)("title",B.title),children:(0,R.FD)("h3",{dir:"auto",className:(0,d.A)(B.name,"fullName"),children:[(0,R.Y)(x.A,{name:"archive-filled",className:B.icon}),f("ArchivedChats")]})}),(0,R.Y)(L.A,{className:B.unreadCount,text:y?(0,Y.Vw)(f,y):void 0})]})}):(0,R.FD)(R.FK,{children:[(0,R.Y)("div",{className:(0,d.A)("status",B.avatarWrapper),children:(0,R.Y)(D.A,{peer:O})}),(0,R.FD)("div",{className:(0,d.A)(B.info,"info"),children:[(0,R.Y)("div",{className:"info-row",children:(0,R.Y)("div",{className:(0,d.A)("title",B.title),children:(0,R.Y)("h3",{dir:"auto",className:(0,d.A)(B.name,"fullName"),children:f("ArchivedChats")})})}),(0,R.FD)("div",{className:"subtitle",children:[(0,R.Y)("div",{className:(0,d.A)("status",B.chatsPreview),children:C}),(0,R.Y)(L.A,{className:B.unreadCount,text:y?(0,Y.Vw)(f,y):void 0})]})]})]})})});var K=n(19210),z=n(91048),V=n(43874),j=n(59030),G=n(79577),J=n(64493);const $=(0,o.ph)((0,i.EK)((e,{folderId:t,folderType:n})=>({chatFolder:t&&"folder"===n?(0,z.$aQ)(e,t):void 0,animatedEmoji:(0,z.oei)(e,"📂")}))(({chatFolder:e,animatedEmoji:t,foldersDispatch:n})=>{const{openSettingsScreen:a}=(0,i.ko)(),r=(0,j.A)(),{isMobile:d}=(0,V.Ay)(),l=(0,o.hb)(()=>{n({type:"editFolder",payload:e}),a({screen:s.VS.FoldersEditFolderFromChatList})},[e,n]);return(0,R.FD)("div",{className:"yftKUVDQ",children:[(0,R.Y)("div",{className:"UCBfMOiz",children:t&&(0,R.Y)(G.A,{sticker:t,size:96})}),(0,R.Y)("h3",{className:"dB9cHelg",dir:"auto",children:r("FilterNoChatsToDisplay")}),(0,R.Y)("p",{className:"TJ_liZcJ",dir:"auto",children:r(e?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")}),e&&(0,R.Y)(J.A,{ripple:!d,fluid:!0,pill:!0,iconName:"settings",onClick:l,isRtl:r.isRtl,children:(0,R.Y)("div",{className:"aL7e0w4t",children:r("ChatList.EmptyChatListEditFilter")})})]})}));var q=n(61433),H=n(80140),W=n(76023),_=n(15283),Q=n(34201),Z=n(5718),X=n(48885);const ee=(0,o.ph)(({isAccountFrozen:e,onPaneStateChange:t})=>{const{openFrozenAccountModal:n}=(0,i.ko)(),o=(0,P.A)(),{ref:s,shouldRender:a}=(0,X.A)({isOpen:e,onStateChange:t,withResizeObserver:!0}),r=(0,A.A)(()=>{n()});if(a)return(0,R.FD)("div",{ref:s,className:"lx6b4nbs",role:"button",tabIndex:0,onClick:r,children:[(0,R.Y)("div",{className:"JjWxp6pv",children:o("TitleFrozenAccount")}),(0,R.Y)("div",{className:"sGa3VcFf",children:o("SubtitleFrozenAccount")})]})});var te=n(18501),ne=n(14);const oe="BIRTHDAY_SETUP",ie=new Set([oe]),se=new Set([oe]),ae={BIRTHDAY_SETUP:["SuggestionBirthdaySetupTitle","SuggestionBirthdaySetupMessage"]},re=(0,o.ph)(({promoData:e,onPaneStateChange:t})=>{const{openBirthdaySetupModal:n,dismissSuggestion:s,openUrl:a}=(0,i.ko)(),r=(0,P.A)(),d=(0,o.Kr)(()=>e?.customPendingSuggestion?e.customPendingSuggestion:e?.pendingSuggestions.find(e=>ie.has(e)),[e]),l=(0,ne.A)(d),c="object"==typeof l,{ref:u,shouldRender:h}=(0,X.A)({isOpen:Boolean(d),onStateChange:t,withResizeObserver:!0}),m=(0,A.A)(()=>{if(!l)return;const e=c?l.suggestion:l;se.has(e)&&s({suggestion:e}),c?a({url:l.url}):l===oe&&n({})}),p=(0,A.A)(e=>{if(e.stopPropagation(),!l)return;const t=c?l.suggestion:l;s({suggestion:t})});if(!h||!l)return;const g=c?(0,te.fd)(l.title):r(ae[l][0],void 0,{withNodes:!0}),f=c?(0,te.fd)(l.description):r(ae[l][1],void 0,{withNodes:!0});return(0,R.FD)("div",{ref:u,className:"SDkananZ",role:"button",tabIndex:0,onClick:m,children:[(0,R.Y)("div",{className:"A0XudHG_",children:g}),(0,R.Y)("div",{className:"jjwC84Vs",children:f}),(0,R.Y)(x.A,{name:"close",className:"iY6Fyv9_",onClick:p})]})}),de="EPR4baV0",le=(0,o.ph)(({unconfirmedSession:e,onPaneStateChange:t})=>{const{changeSessionSettings:n,terminateAuthorization:s,showNotification:a}=(0,i.ko)(),r=(0,P.A)(),d=Boolean(e),l=(0,ne.A)(e),{ref:c,shouldRender:u}=(0,X.A)({isOpen:d,withResizeObserver:!0,onStateChange:t}),h=(0,o.Kr)(()=>l?l.region?r("UnconfirmedAuthLocationRegion",{deviceModel:l.deviceModel,region:l.region,country:l.country}):r("UnconfirmedAuthLocationCountry",{deviceModel:l.deviceModel,country:l.country}):"",[l,r]),m=(0,A.A)(()=>{l&&n({hash:l.hash,isConfirmed:!0})}),p=(0,A.A)(()=>{l&&(s({hash:l.hash}),a({title:r("UnconfirmedAuthDeniedTitle"),message:r("UnconfirmedAuthDeniedMessage",{location:h})}))});if(u&&l)return(0,R.FD)("div",{className:"sjWwxV5d",ref:c,children:[(0,R.Y)("h2",{className:"XXUAbrjx",children:r("UnconfirmedAuthTitle")}),(0,R.Y)("p",{className:"XQfnrzqW",children:r("UnconfirmedAuthSingle",{location:h})}),(0,R.FD)("div",{className:"ASbVib3E",children:[(0,R.Y)(J.A,{fluid:!0,isText:!0,className:de,onClick:m,children:r("UnconfirmedAuthConfirm")}),(0,R.Y)(J.A,{fluid:!0,isText:!0,color:"danger",onClick:p,className:de,children:r("UnconfirmedAuthDeny")})]})]})}),ce=.5*W.$,ue=.25*W.$,he={height:0},me=(0,o.ph)((0,i.EK)(e=>({sessions:e.activeSessions.byHash,promoData:e.promoData,isAccountFrozen:(0,z.trm)(e)}))(({className:e,sessions:t,promoData:n,isAccountFrozen:i,onHeightChange:s})=>{const[r,l]=(0,o.Ul)(he),[c,u]=(0,o.Ul)(he),[h,m]=(0,o.Ul)(he),p=(0,o.li)(!0),{shouldRender:g,ref:f}=(0,Q.A)({isOpen:!0,withShouldRender:!0,noMountTransition:!0});(0,_.A)(()=>{p.current=!1});const v=(0,o.Kr)(()=>{const e=Object.values(t||{}),n=e.find(e=>e.isCurrent);if(n&&!((0,H.Fm)()-n.dateCreated<a.C7Y))return e.find(e=>e.isUnconfirmed)},[t]),A=!i&&v,y=!i&&!v&&n;if((0,Z.R)(()=>{const e=[r(),c(),h()],t=p.current,n=e.reduce((e,t)=>e+t.height,0),o=n?n+ue:0;s(o);const i=document.getElementById("LeftColumn");i&&((0,X.S)({list:e,noTransition:t,topMargin:ce,zIndexIncrease:!0}),(0,q.Tv)(i,{"--chat-list-panes-height":`${o}px`}))},[r,c,h]),g)return(0,R.FD)("div",{ref:f,className:(0,d.A)("l4B81S5u",e),children:[(0,R.Y)(ee,{isAccountFrozen:i,onPaneStateChange:u}),(0,R.Y)(le,{unconfirmedSession:A?v:void 0,onPaneStateChange:l}),(0,R.Y)(re,{promoData:y?n:void 0,onPaneStateChange:m})]})})),pe=new Set(["9","0"]),ge=(0,o.ph)(({className:e,folderType:t,folderId:n,isActive:b,isForumPanelOpen:I,canDisplayArchive:S,archiveSettings:M,isMainList:N,withTags:Y,isFoldersSidebarShown:k,isStoryRibbonShown:F,foldersDispatch:P})=>{const{openChat:T,openNextChat:D,closeForumPanel:x,toggleStoryRibbon:L,openLeftColumnContent:E}=(0,i.ko)(),B=(0,o.li)(),[O,z]=(0,o.J0)(0),V="archived"===t,j="all"===t,G="saved"===t,J=j?a.DSF:V?a._E9:G?a.pX9:n,q=j&&S&&M,H=(0,p.Rh)(J);(0,h.A)(H);const W=(H?.length||0)*a.yq1,_=q?M?.isMinimized?a.eqO:a.yq1:0,{orderDiffById:Q,shiftDiff:Z,getAnimationType:X,onReorderAnimationEnd:ee}=(0,y.A)(H,O),[te,ne]=(0,f.A)(void 0,H,void 0,a.T7t);(0,g.v)((0,o.Kr)(()=>b&&H?.length?{"Alt+ArrowUp":e=>{e.preventDefault(),D({targetIndexDelta:-1,orderedIds:H})},"Alt+ArrowDown":e=>{e.preventDefault(),D({targetIndexDelta:1,orderedIds:H})}}:void 0,[b,H])),(0,o.vJ)(()=>{if(b&&!G&&H&&r.lE)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){if((r.MP&&e.metaKey||!r.MP&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t||pe.has(t))return;const n=q&&M&&!M.isMinimized,o=n?-1:0,i=Number(t)+o-1;if(n&&-1===i)return void(N&&E({contentKey:s.Bn.Archived}));if(i>H.length-1)return;T({id:H[i],shouldReplaceHistory:!0})}}},[M,G,b,T,D,H,q,N]);const{observe:oe}=(0,v.BL)({rootRef:B,throttleMs:200}),ie=(0,A.A)(()=>{E({contentKey:s.Bn.Archived}),x()}),se=(0,A.A)(()=>{L({isShown:!0,isArchived:V})}),ae=(0,A.A)(()=>{L({isShown:!1,isArchived:V})}),re=(0,A.A)(()=>{(0,l.W)(()=>{ie()})}),de=(0,A.A)(e=>{(0,l.W)(()=>{T({id:e,shouldReplaceHistory:!0})})});return(0,m.A)({containerRef:B,onOverscroll:se,onReset:ae,isDisabled:G,isOverscrolled:F}),(0,R.FD)(C.A,{className:(0,d.A)("chat-list custom-scroll",I&&"forum-panel-open",e),ref:B,items:te,itemSelector:".ListItem:not(.chat-item-archive)",preloadBackwards:a.T7t,withAbsolutePositioning:!0,maxHeight:W+_+O,onLoadMore:ne,children:[j&&(0,R.Y)(me,{onHeightChange:z},"panes"),q&&(0,R.Y)(U,{archiveSettings:M,onClick:ie,onDragEnter:re,animationType:X(u.E5),offsetTop:O,isFoldersSidebarShown:k},"archive"),te?.length?function(){const e=H.indexOf(te[0]),t=(0,c.zm)(J)||0;return te.map((o,i)=>{const s=e+i<t,r=O+_+(e+i)*a.yq1;return(0,R.Y)(K.A,{teactOrderKey:s?i:(0,c.uk)(o,G),chatId:o,isPinned:s,folderId:n,isSavedDialog:G,animationType:X(o),orderDiff:Q[o],shiftDiff:Z,onReorderAnimationEnd:ee,offsetTop:r,observeIntersection:oe,onDragEnter:de,onDragLeave:l.d,withTags:Y,isFoldersSidebarShown:k},o)})}():!te||te.length||G?(0,R.Y)(w.A,{},"loading"):(0,R.Y)($,{folderId:n,folderType:t,foldersDispatch:P})]})})},14413:(e,t,n)=>{n.d(t,{A:()=>c});var o=n(84051),i=n(13439),s=n(31481),a=n(39351),r=n(19806),d=n(94189);var l=n(20021);const c=(0,o.ph)((0,i.EK)(e=>({verifyAgeMin:e.appConfig.verifyAgeMin||s.lYi}))(({isOpen:e,onClose:t,shouldAlwaysShow:n,onAlwaysShowChanged:o,confirmHandler:i,verifyAgeMin:s})=>{const c=(0,a.A)();return(0,l.FD)(d.A,{title:c("TitleSensitiveModal",{years:s}),confirmLabel:c("ButtonSensitiveView"),isOpen:e,onClose:t,confirmHandler:i,children:[c("TextSensitiveModal"),(0,l.Y)(r.A,{className:"mYXi2mIC",label:c("ButtonSensitiveAlways",{years:s}),checked:n,onCheck:o})]})}))},15006:(e,t,n)=>{n.d(t,{U:()=>p,A:()=>m});var o=n(84051),i=n(13439),s=n(31481),a=n(91048),r=n(6842),d=n(14235);const l={root:"AN8wkEiR",ghost:"ANWk2pWP",scale:"kMHxyoSt",elementContainer:"UDCMfXxs"};var c=n(20021);const u=50,h=1e3,m=(0,o.ph)(()=>(0,c.Y)("div",{className:l.root,id:s.Lj4}));function p(e){const t=(0,i.mS)();if(!(0,a.Rwe)(t))return!1;const n=e.getBoundingClientRect(),o=n.left+window.scrollX,h=n.top+window.scrollY,m=n.width,p=n.height;if(o+m+u<0||o-u>window.innerWidth||h+p+u<0||h-u>window.innerHeight)return!1;const f=Math.floor(Date.now()/1e3),v=`${s.xcU}-${(0,d.A)()}`,A=(0,c.FD)("svg",{className:l.ghost,width:m,height:p,style:`left: ${o}px; top: ${h}px;`,viewBox:`0 0 ${m} ${p}`,children:[(0,c.Y)("defs",{children:g(v,Math.min(m,p),f)}),(0,c.Y)("g",{filter:`url(#${v})`,children:(0,c.Y)("foreignObject",{className:l.elementContainer,width:m,height:p})})]}),y=(0,r.A)(A)[0],C=y.querySelector("foreignObject"),w=window.getComputedStyle(e),b=e.cloneNode(!0);Array.from(w).forEach(e=>b.style.setProperty(e,w.getPropertyValue(e),"important")),C.appendChild(b);const I=document.getElementById(s.Lj4);return I.appendChild(y),y.addEventListener("animationend",()=>{I.removeChild(y)},{once:!0}),!0}function g(e,t,n=42){return(0,c.FD)("filter",{xmlns:s.jNX,id:e,x:"-150%",y:"-150%",width:"400%",height:"400%","color-interpolation-filters":"sRGB",children:[(0,c.Y)("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"1",result:"dustNoise",seed:n}),(0,c.Y)("feComponentTransfer",{in:"dustNoise",result:"dustNoiseMask",children:(0,c.Y)("feFuncA",{type:"linear",slope:"5",intercept:"0",children:(0,c.Y)("animate",{attributeName:"slope",values:"5; 2; 1; 0",dur:`${h}ms`,fill:"freeze"})})}),(0,c.Y)("feComposite",{in:"SourceGraphic",in2:"dustNoiseMask",operator:"in",result:"dustySource"}),(0,c.Y)("feTurbulence",{type:"fractalNoise",baseFrequency:"0.015",numOctaves:"1",result:"displacementNoise1",seed:n+1}),(0,c.Y)("feTurbulence",{type:"fractalNoise",baseFrequency:"1",numOctaves:"2",result:"displacementNoise2",seed:n+2}),(0,c.FD)("feMerge",{result:"combinedNoise",children:[(0,c.Y)("feMergeNode",{in:"displacementNoise1"}),(0,c.Y)("feMergeNode",{in:"displacementNoise2"})]}),(0,c.Y)("feDisplacementMap",{in:"dustySource",in2:"combinedNoise",scale:"0",xChannelSelector:"R",yChannelSelector:"G",children:(0,c.Y)("animate",{attributeName:"scale",values:"0; "+3*t,dur:`${h}ms`,fill:"freeze"})})]})}},17169:(e,t,n)=>{n.d(t,{A:()=>o});const o={name:"BDZrSTO_",root:"QOz6fQFU",avatar:"dXSy0i2c",avatarHidden:"n0vJEdNW",ghost:"E1IeDpeb",ghostAnimateName:"HMp3KTKQ",ghostRevealName:"unYkDic1",ghostLast:"dZJGfaXC"}},17751:(e,t,n)=>{n.d(t,{A:()=>M});var o=n(84051),i=n(13439),s=n(89925),a=n(90709),r=n(91048),d=n(87357),l=n(76023),c=n(4961),u=n(54699),h=n(39351),m=n(17712),p=n(59030),g=n(42452),f=n(41036),v=n(21849),A=n(80999),y=n(34431),C=n(18276),w=n(38102),b=n(80477),I=n(20021);const S=2.5*l.$,M=(0,o.ph)((0,i.EK)((e,{userId:t,threadId:n,forceShowSelf:o})=>{const{isSynced:i}=e,s=t?(0,r.mBe)(e,t):void 0,a=t?(0,r.K0y)(e,t):void 0,d=!o&&s&&s.isSelf,l=d?s:(0,r.mBe)(e,e.currentUserId),c=Boolean(t?(0,r.zeq)(e,t):void 0),u=n?(0,r.S0q)(e,t,n):void 0;return{user:s,userStatus:a,isSavedMessages:d,areMessagesLoaded:c,self:l,isSynced:i,topic:u,messagesCount:u&&t?(0,r.QbG)(e,t,n):void 0}})(({userId:e,customPeer:t,typingStatus:n,avatarSize:r="medium",status:l,statusIcon:M,withDots:N,withMediaViewer:Y,withUsername:k,withStory:F,withFullInfo:P,withUpdatingStatus:T,emojiStatusSize:D,noStatusOrTyping:x,noEmojiStatus:L,noFake:E,noVerified:B,noRtl:R,user:O,userStatus:U,self:K,topic:z,messagesCount:V,isSavedMessages:j,isSavedDialog:G,areMessagesLoaded:J,adminMember:$,ripple:q,className:H,storyViewerOrigin:W,noAvatar:_,isSynced:Q,iconElement:Z,rightElement:X,onClick:ee,onEmojiStatusClick:te})=>{const{loadFullUser:ne,openMediaViewer:oe,loadMoreProfilePhotos:ie}=(0,i.ko)(),se=(0,p.A)(),ae=(0,h.A)(),re=Boolean(O?.isBotForum&&z),de=Y&&!j;(0,o.vJ)(()=>{e&&(P&&Q&&ne({userId:e}),Y&&ie({peerId:e,isPreload:!0}))},[e,P,Y,Q]),(0,u.A)(6e4);const le=(0,m.A)((t,n)=>{n&&(t.stopPropagation(),oe({isAvatarView:!0,chatId:e,mediaIndex:0,origin:"jumbo"===r?s.TQ.ProfileAvatar:s.TQ.MiddleHeaderAvatar}))}),ce=(0,o.Kr)(()=>O&&k&&(0,a.Kl)(O),[O,k]);if(!O&&!t)return;const ue=$?$.customTitle||se($.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin"):void 0;return(0,I.FD)("div",{className:(0,d.A)("ChatInfo",H),dir:!R&&ae.isRtl?"rtl":void 0,onClick:ee,children:[G&&K&&(0,I.Y)(v.A,{size:r,peer:K,isSavedMessages:!0,className:"saved-dialog-avatar"},"saved-messages"),!_&&!re&&(0,I.Y)(v.A,{size:r,peer:t||O,className:(0,d.A)(G&&"overlay-avatar"),isSavedMessages:j,isSavedDialog:G,withStory:F,storyViewerOrigin:W,storyViewerMode:"single-peer",onClick:de?le:void 0},O?.id),re&&(0,I.Y)(w.A,{topic:z,className:"topic-header-icon",size:S}),(0,I.FD)("div",{className:"info",children:[re?(0,I.Y)("h3",{dir:"auto",className:"fullName",children:(0,c.A)(z.title)}):ue?(0,I.FD)("div",{className:"info-name-title",children:[(0,I.Y)(y.A,{peer:O,withEmojiStatus:!L,emojiStatusSize:D,isSavedMessages:j,isSavedDialog:G,onEmojiStatusClick:te}),ue&&(0,I.Y)("span",{className:"custom-title",children:ue})]}):(0,I.Y)(y.A,{peer:t||O,noFake:E,noVerified:B,withEmojiStatus:!L,emojiStatusSize:D,isSavedMessages:j,isSavedDialog:G,onEmojiStatusClick:te,iconElement:Z}),(l||!j&&!x)&&function(){if(l)return N?(0,I.Y)(A.A,{className:"status",content:l}):(0,I.FD)("span",{className:"status",dir:"auto",children:[M&&(0,I.Y)(C.A,{className:"status-icon",name:M}),(0,c.A)(l)]});if(T&&!J)return(0,I.Y)(A.A,{className:"status",content:se("Updating")});if(t?.subtitleKey)return(0,I.Y)("span",{className:"status",dir:"auto",children:(0,I.Y)("span",{className:"user-status",dir:"auto",children:se(t.subtitleKey)})});if(!O)return;if(n)return(0,I.Y)(b.A,{typingStatus:n});if(re)return(0,I.Y)("span",{className:"status",dir:"auto",children:(0,I.Y)(f.Ay,{name:"fade",shouldRestoreHeight:!0,activeKey:void 0!==V?1:2,className:"message-count-transition",children:void 0!==V?se("messages",V,"i"):se("lng_forum_no_messages")})});if((0,a.DX)(O.id))return;const e=(0,a.CD)(se,O,U),o=(0,d.A)("handle",e&&"withStatus");return(0,I.FD)("span",{className:(0,d.A)("status",(0,a.PF)(O,U,!0)&&"online"),children:[ce&&(0,I.Y)("span",{className:o,children:ce}),e&&(0,I.Y)("span",{className:"user-status",dir:"auto",children:e})]})}()]}),q&&(0,I.Y)(g.A,{}),X]})}))},17778:(e,t,n)=>{n.d(t,{S:()=>r});const o=/(<br>|<br\s?\/>)/g,i=/( |\u00A0)/g,s=/(<div>|<\/div>)/gi,a=/\n$/i;function r(e){return e.replace(i," ").replace(o,"\n").replace(s,"").replace(a,"")}},19210:(e,t,n)=>{n.d(t,{A:()=>G});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(90709),l=n(27109),c=n(91048),u=n(96454),h=n(87357),m=n(48899),p=n(49763),g=n(66414),f=n(98255),v=n(43874),A=n(47067),y=n(49746),C=n(37661),w=n(5912),b=n(17712),I=n(50680),S=n(73176),M=n(21849),N=n(54314),Y=n(34431),k=n(18276),F=n(9267),P=n(81642),T=n(22720),D=n(97967),x=n(97046),L=n(24384);const E="AA5s1Pu4";var B=n(20021);const R=(0,o.ph)(({isSelected:e,isActive:t,isMobile:n})=>(0,B.Y)("div",{className:(0,h.A)("byPckqUT",t&&"IsUWP16T",e&&!n&&"qy2i51dM"),children:(0,B.FD)("div",{className:"nl36F75B",children:[(0,B.Y)("div",{className:E}),(0,B.Y)("div",{className:E}),(0,B.Y)("div",{className:E})]})}));var O=n(76023),U=n(18501),K=n(39996);const z="oIgI9O0L",V=.875*O.$,j=(0,o.ph)(({orderedFolderIds:e,chatFoldersById:t,isFoldersSidebarShown:n,itemClassName:i})=>{if(!e)return;const a=e.slice(0,3),r=e.length-a.length,d=(0,o.hb)(e=>{let t=e.title.text,o=e.title.entities;if(n){const n=e.title.entities?.find(e=>e.type===s.C7.CustomEmoji&&0===e.offset);if(n){const{offset:i,length:s}=n;t=e.title.text.replace(e.title.text.substring(i,i+s),""),o=e.title.entities?.filter(e=>e.offset!==i).map(e=>({...e,offset:e.offset-s}))}}return(0,U.fd)({text:t,entities:o,noCustomEmojiPlayback:e.noTitleAnimations,emojiSize:V})},[n]);return(0,B.FD)("div",{className:"cgAMX02q",children:[a.map(e=>{const n=t?.[e];return n&&(0,B.Y)("div",{className:(0,h.A)(z,void 0!==n.color&&-1!==n.color&&(0,K.yp)(n.color),i),children:d(n)},n.id)}),r>0&&(0,B.FD)("div",{className:(0,h.A)(z,"hZDqIz3W",i),children:["+",r]})]})}),G=(0,o.ph)((0,i.EK)((e,{chatId:t,isSavedDialog:n,isPreview:o,previewMessageId:i})=>{const a=(0,c.hds)(e,t),r=(0,c.mBe)(e,t);if(!a)return{currentUserId:e.currentUserId};const d=(0,p.N)(t),{areTagsEnabled:u}=e.chatFolders,h=(0,c.g29)(e),m=i||(0,c.ZZX)(e,t,n?"saved":"all"),g=i?(0,c.O5q)(e,t,i):(0,c.yHC)(e,t,n?"saved":"all"),{isOutgoing:f,forwardInfo:v}=g||{},A=n&&v?.fromId?(0,c.PVB)(e,v.fromId):void 0,y=g?(0,c.Y7C)(e,g):void 0,C=A||y,{chatId:w,threadId:b,type:I}=(0,c.Xf0)(e)||{},S=!o&&t===w&&(n?t===b:b===s.l3),M=a.isForum&&t===w||t===(0,c.nTw)(e).forumPanelChatId,N=(0,c.K0y)(e,t),Y=g&&(0,c.nkm)(e,g),k=(0,c.C5H)(e,t,s.l3,"typingStatus"),F=(0,c.xyP)(e,t),P=g?.content.storyData,T=P&&(0,c.Msb)(e,P.peerId,P.id),D=(0,c.trm)(e),x=(0,c.k2W)(e,t);return{chat:a,isMuted:(0,l.If)(a,(0,c.K52)(e),(0,c.P5N)(e,a.id)),lastMessageSender:C,draft:(0,c.GA4)(e,t,s.l3),isSelected:S,isSelectedForum:M,isForumPanelOpen:(0,c.clw)(e),canScrollDown:S&&"thread"===I,canChangeFolder:(e.chatFolders.orderedIds?.length||0)>1,lastMessageOutgoingStatus:f&&g?(0,c.Tl2)(e,g):void 0,user:r,userStatus:N,lastMessageTopic:Y,typingStatus:k,withInterfaceAnimations:(0,c.PKK)(e),lastMessage:g,lastMessageId:m,currentUserId:e.currentUserId,listedTopicIds:F?.listedTopicIds,topics:F?.topicsById,isSynced:e.isSynced,lastMessageStory:T,isAccountFrozen:D,monoforumChannel:x,chatFolderIds:d,orderedFolderIds:e.chatFolders.orderedIds,chatFoldersById:e.chatFolders.byId,areTagsEnabled:u&&h}})(({chatId:e,folderId:t,orderDiff:n,shiftDiff:l,animationType:p,isPinned:E,listedTopicIds:O,topics:U,observeIntersection:K,chat:z,monoforumChannel:V,lastMessageStory:G,isMuted:J,user:$,userStatus:q,lastMessageSender:H,lastMessageOutgoingStatus:W,offsetTop:_,draft:Q,withInterfaceAnimations:Z,isSelected:X,isSelectedForum:ee,isForumPanelOpen:te,canScrollDown:ne,canChangeFolder:oe,lastMessageTopic:ie,typingStatus:se,lastMessageId:ae,lastMessage:re,isSavedDialog:de,currentUserId:le,isPreview:ce,previewMessageId:ue,className:he,isSynced:me,onDragEnter:pe,onDragLeave:ge,isAccountFrozen:fe,chatFolderIds:ve,orderedFolderIds:Ae,chatFoldersById:ye,areTagsEnabled:Ce,withTags:we,onReorderAnimationEnd:be,isFoldersSidebarShown:Ie})=>{const{openChat:Se,openSavedDialog:Me,toggleChatInfo:Ne,focusMessage:Ye,loadTopics:ke,openForumPanel:Fe,closeForumPanel:Pe,setShouldCloseRightColumn:Te,reportMessages:De,openFrozenAccountModal:xe,updateChatMutedState:Le,openQuickPreview:Ee,scrollMessageListToBottom:Be}=(0,i.ko)(),{isMobile:Re}=(0,v.Ay)(),[Oe,Ue,Ke]=(0,C.A)(),[ze,Ve,je]=(0,C.A)(),[Ge,Je,$e]=(0,C.A)(),[qe,He,We]=(0,C.A)(),[_e,Qe,Ze]=(0,C.A)(),[Xe,et,tt]=(0,C.A)(),{isForum:nt,isForumAsMessages:ot,isMonoforum:it}=z||{};(0,y.A)(de?le:e,ae,re);const st=(0,o.Kr)(()=>{const e=new Set(ve);return Ae?.filter(n=>{if(!e.has(n))return;const o=n===t,i=n===r.DSF,s=ye?.[n],a=void 0!==s?.color&&-1!==s.color;return!o&&!i&&a})},[Ae,t,ye,ve]),at=Ce&&we,rt=at&&Boolean(st?.length),{renderSubtitle:dt,ref:lt}=(0,S.A)({chat:z,chatId:e,lastMessage:re,typingStatus:se,draft:Q,statefulMediaContent:(0,d.FE)({story:G}),lastMessageTopic:ie,lastMessageSender:H,observeIntersection:K,animationType:p,withInterfaceAnimations:Z,orderDiff:n,shiftDiff:l,isSavedDialog:de,isPreview:ce,onReorderAnimationEnd:be,topics:U,hasTags:rt}),ct=(0,f.A)(c.sRo),ut=(0,b.A)(t=>{if(t.altKey&&!de&&!nt&&!ce)return t.preventDefault(),void Ee({id:e});const n=Re&&ot;if(Re&&Te({value:!0}),ce)Ye({chatId:e,messageId:ue});else{if(de)return Me({chatId:e,noForumTopicPanel:!0},{forceOnHeavyAnimation:!0}),void(Re&&Ne({force:!1}));if(nt){if(te)return void Pe(void 0,{forceOnHeavyAnimation:!0});if(n||Fe({chatId:e},{forceOnHeavyAnimation:!0}),!ot)return}Se({id:e,noForumTopicPanel:n,shouldReplaceHistory:!0},{forceOnHeavyAnimation:!0}),X&&ne&&Be()}}),ht=(0,b.A)(t=>{t.preventDefault(),pe?.(e)}),mt=(0,b.A)(()=>{fe?xe():(He(),Ue())}),pt=(0,b.A)(()=>{fe?xe():(Qe(),Ve())}),gt=(0,b.A)(()=>{fe?xe():Le({chatId:e,mutedUntil:r.Os5})}),ft=(0,b.A)(()=>{et(),Je()}),vt=(0,b.A)(()=>{fe?xe():z&&De({chatId:z.id,messageIds:[]})}),At=(0,A.A)({chat:z,user:$,handleDelete:mt,handleMute:pt,handleUnmute:gt,handleChatFolderChange:ft,handleReport:vt,folderId:t,isPinned:E,isMuted:J,canChangeFolder:oe,isSavedDialog:de,currentUserId:le,isPreview:ce,topics:U}),yt=(0,w.Vz)(lt,z?K:void 0);(0,o.vJ)(()=>{yt&&nt&&me&&void 0===O&&ke({chatId:e})},[e,O,me,nt,yt]);const Ct=$&&q&&(0,d.PF)($,q),{hasShownClass:wt}=(0,I.A)(Ct),bt=(0,o.Kr)(()=>{if(u.OS)return de?`#${(0,g.az)(le,"thread",e)}`:`#${(0,g.az)(e,"thread",s.l3)}`},[e,le,de]);if(!z)return;const It=$||z,St=(0,h.A)("Chat chat-item-clickable",(0,m.L8)(e)?"private":"group",nt&&"forum",X&&"selected",ee&&"selected-forum",ce&&"standalone",Ce&&we&&"chat-item-with-tags",he);return(0,B.FD)(T.A,{ref:lt,className:St,href:bt,style:`top: ${_}px`,ripple:!nt&&!Re,contextActions:At,withPortalForMenu:!0,onClick:ut,onDragEnter:ht,onDragLeave:ge,children:[(0,B.FD)("div",{className:(0,h.A)("status","status-clickable"),children:[(0,B.Y)(M.A,{peer:it?V:It,isSavedMessages:$?.isSelf,isSavedDialog:de,size:ce?"medium":"large",asMessageBubble:it,withStory:!$?.isSelf&&!it,withStoryGap:wt||Boolean(z.subscriptionUntil),storyViewerOrigin:a.G9.ChatList,storyViewerMode:"single-peer"}),(0,B.FD)("div",{className:"avatar-badge-wrapper",children:[(0,B.Y)("div",{className:(0,h.A)("avatar-online","avatar-badge",wt&&"avatar-online-shown")}),!wt&&Boolean(z.subscriptionUntil)&&(0,B.Y)(F.A,{type:"gold",className:"avatar-badge avatar-subscription",size:"adaptive"}),(0,B.Y)(L.A,{chat:z,isMuted:J,shouldShowOnlyMostImportant:!0,forceHidden:ct,topics:U,isSelected:X,isOnAvatar:!0})]}),z.isCallActive&&z.isCallNotEmpty&&(0,B.Y)(R,{isMobile:Re,isSelected:X,isActive:Z})]}),(0,B.FD)("div",{className:(0,h.A)("info",at&&"has-tags"),children:[(0,B.FD)("div",{className:"info-row",children:[(0,B.Y)(Y.A,{peer:it?V:It,isMonoforum:it,monoforumBadgeClassName:"monoforum-badge",withEmojiStatus:!0,isSavedMessages:e===$?.id&&$?.isSelf,isSavedDialog:de,observeIntersection:K,withStatusTextColor:X}),J&&!de&&(0,B.Y)(k.A,{name:"muted"}),(0,B.Y)("div",{className:"separator"}),re&&(0,B.Y)(P.A,{message:re,outgoingStatus:de?void 0:W,draftDate:Q?.date})]}),(0,B.FD)("div",{className:"subtitle",children:[dt(),!ce&&(0,B.Y)(L.A,{chat:z,isPinned:E,isMuted:J,isSavedDialog:de,hasMiniApp:$?.hasMainMiniApp,topics:U,isSelected:X,transitionClassName:"chat-badge-transition"})]}),rt&&(0,B.Y)(j,{itemClassName:"chat-tag",orderedFolderIds:st,chatFoldersById:ye,isFoldersSidebarShown:Ie})]}),qe&&(0,B.Y)(N.A,{isOpen:Oe,onClose:Ke,onCloseAnimationEnd:We,chat:z,isSavedDialog:de}),_e&&(0,B.Y)(x.A,{isOpen:ze,onClose:je,onCloseAnimationEnd:Ze,chatId:e}),Xe&&(0,B.Y)(D.A,{isOpen:Ge,onClose:$e,onCloseAnimationEnd:tt,chatId:e})]})}))},20247:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(13439),s=n(31481),a=n(17712);function r(e,t,n){const{shouldPaidMessageAutoApprove:r}=(0,i.mS)().settings.byKey,[d,l]=(0,o.J0)(Boolean(r)),[c,u]=(0,o.J0)(!1),h=(0,o.li)(void 0),m=(0,a.A)(()=>{(0,i.ko)().closePaymentMessageConfirmDialogOpen()});(0,o.vJ)(()=>{c&&!t&&(u(!1),n>e&&h?.current?.())},[c,t,n,e]);const p=(0,a.A)(()=>{(0,i.ko)().openStarsBalanceModal({topup:{balanceNeeded:e,purpose:s.D3m}}),u(!0)});return{closeConfirmDialog:m,handleWithConfirmation:(t,...o)=>{if(e){if(h.current=()=>t(...o),!r)return void(0,i.ko)().openPaymentMessageConfirmDialogOpen();if(e>n)return void p()}t(...o)},dialogHandler:(0,a.A)(()=>{e>n?p():h?.current?.(),(0,i.ko)().closePaymentMessageConfirmDialogOpen(),d&&(0,i.ko)().setPaidMessageAutoApprove()}),shouldAutoApprove:d,setAutoApprove:l}}},21488:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051),i=n(13439),s=n(37836);const a=function(e,t,n){const{loadPeerStoriesByIds:a}=(0,i.ko)(),r=(0,o.Kr)(()=>{const n=(0,s.nF)(a,200,!0);return()=>{n({peerId:e,storyIds:[t]})}},[t,e]);(0,o.vJ)(()=>{e&&t&&(!n||!("content"in n)&&!("isDeleted"in n))&&r()},[r,n,t,e])}},22081:(e,t,n)=>{n.d(t,{A:()=>Wt});var o=n(84051),i=n(13439),s=n(23174),a=n(31481),r=n(66644),d=n(90709),l=n(27109),c=n(70636),u=n(91048),h=n(64520),m=n(30708),p=n(96454),g=n(87357),f=n(17663),v=n(55148),A=n(46275),y=n(60261),C=n(48899),w=n(36353),b=n(48775),I=n(79824),S=n(80539),M=n(39074),N=n(80140),Y=n(43503),k=n(13235);let F;function P(e){F.focus(),e.focus()}p.pz&&(F=document.createElement("input"),F.classList.add("for-ios-autocapitalization-fix"),document.body.appendChild(F));var T=n(55153),D=n(58734),x=n(11359),L=n(4961),E=n(18501),B=n(32625),R=n(14737),O=n(10722),U=n(19129),K=n(82117),z=n(37661),V=n(30857),j=n(41316),G=n(39351),J=n(17712),$=n(59030),q=n(39996),H=n(29886),W=n(73767),_=n(24531),Q=n(73172),Z=n(50680),X=n(41257),ee=n(35297),te=n(17778),ne=n(63988),oe=n(83414);const ie=/^\/([\w@]{1,32})?$/i;var se=n(78396);const ae=/id="docs-internal-guid/i,re=["H1","H2","H3","H4","H5","H6"];function de(e){return(new DOMParser).parseFromString(e,"text/html").body}function le(e,t){const n=document.createElement("a");return n.href=t,n.appendChild(e.cloneNode(!0)),n}function ce(e,t){const n=document.createElement(t);return n.appendChild(e.cloneNode(!0)),n}function ue(e,t){let n=t.cloneNode(!0);return e?(e.style&&"700"===e.style.fontWeight&&(n=ce(n,"strong")),e.style&&"italic"===e.style.fontStyle&&(n=ce(n,"em")),e.style&&"underline"===e.style.textDecoration&&(n=ce(n,"u")),e.style&&"line-through"===e.style.textDecoration&&(n=ce(n,"del")),e.style&&"super"===e.style.verticalAlign&&(n=ce(n,"sup")),e.style&&"sub"===e.style.verticalAlign&&(n=ce(n,"sub")),n):n}function he(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),o=t;return"A"===t.nodeName&&(n=le(n,t.href),"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(o=t.childNodes[0])),n=ue(o,n),n}function me(e){if(e.childNodes&&(e.childNodes.length<=1||"OL"===e.nodeName||"UL"===e.nodeName)){let t,n=document.createTextNode(e.textContent||"");if("UL"===e.nodeName||"OL"===e.nodeName||"LI"===e.nodeName){t=document.createElement(e.nodeName),n=document.createDocumentFragment();const o=[];for(let t=0;t<e.childNodes.length;t++)o.push(...me(e.childNodes[t]));o.map(e=>n.appendChild(e))}else-1!==re.indexOf(e.nodeName)?(t=document.createElement(e.nodeName),n=he(e.childNodes[0])):"P"===e.nodeName?(t=document.createElement("p"),n=function(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),o=document.createTextNode("");return"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(o=t.childNodes[0]),t.childNodes[0]&&"A"===t.childNodes[0].nodeName&&(n=le(n.cloneNode(!0),t.childNodes[0].href),o=t.childNodes[0].childNodes[0]),n=ue(o,n),n}(e)):"BR"===e.nodeName?n=e:(t=document.createElement("span"),n=he(e));return t?(t.appendChild(n),[t]):[e.cloneNode(!0)]}if(e.childNodes){const t=[];for(let n=0;n<e.childNodes.length;n++)t.push(...me(e.childNodes[n]));return t}return[e]}function pe(e){return 8!==e.nodeType}const ge=/<style>(.*?)<\/style>/gs;var fe=n(45761);const ve=new Set([a.CfG,a.e0F,a.YVZ]),Ae=(e,t,n,r,l,c,u,h)=>{const{showNotification:m,updateShouldSaveAttachmentsCompression:p,applyDefaultAttachmentsCompression:g}=(0,i.ko)(),f=(0,G.A)();(0,o.vJ)(()=>{if(e)return document.addEventListener("paste",o,!1),()=>{document.removeEventListener("paste",o,!1)};async function o(e){if(!e.clipboardData)return;const o=e.target?.closest("div[contenteditable]");if(!o||!ve.has(o.id))return;if(e.preventDefault(),document.activeElement!==o)return;const i=e.clipboardData.getData("text"),v=e.clipboardData.getData("text/html");let A=v?(0,S.Ay)(function(e){let t=document.createElement("div");try{e=(n=e).match(ae)?function(e){const t=document.createElement("body"),n=e.childNodes,o=Array.from(n).filter(pe),i=[];for(const e of o)i.push(...me(e));for(let e=0;e<i.length;e++)t.appendChild(i[e].cloneNode(!0));return t}(de(n.replace(/(\r\n|\n|\r)/,""))).innerHTML:de(n.replace(/(\r\n|\n|\r)/,"")).innerHTML}catch(e){a.Oig&&console.error(e)}var n;t.innerHTML=e.replace(/\u00a0/g," ").replace(ge,"");const o=t.querySelectorAll(".text-content");return o.length&&(t=o[o.length-1]),Array.from(t.getElementsByTagName("*")).forEach(e=>{if(e instanceof HTMLElement)switch(e.removeAttribute("style"),"BR"===e.tagName&&e.replaceWith("\n"),"P"===e.tagName&&e.appendChild(document.createTextNode("\n")),"IMG"!==e.tagName||e.dataset.entityType||e.replaceWith(e.getAttribute("alt")||""),e.dataset.ignoreOnPaste&&e.remove(),S.qh[e.tagName]&&e.setAttribute("data-entity-type",S.qh[e.tagName]),e.dataset.entityType||e.textContent!==e.innerText||e.replaceWith(e.textContent),e.dataset.alt&&e.setAttribute("alt",e.dataset.alt),e.dataset.entityType){case s.C7.MentionName:e.replaceWith(e.textContent||"");break;case s.C7.CustomEmoji:e.textContent=e.dataset.alt||""}else e.remove()}),t.innerHTML.trimEnd()}(v),void 0,!0):void 0;A&&(0,se.T8)(A)&&c&&(A=(0,se.m4)(A),u?.());const{items:y}=e.clipboardData;let C=[];if(y.length>0&&(C=await(0,fe.A)(y),l&&(C=C?.slice(0,1))),!C?.length&&!i)return;const w=A?.entities?.length?A:{text:i};let b=!1;try{b="urn:schemas-microsoft-com:office:word"===(new DOMParser).parseFromString(v,"text/html").documentElement.getAttribute("xmlns:w")}catch(e){}const I=w&&w.text;let M=C?.length&&!b;const N=C?await Promise.all(C.map(e=>(0,T.A)(e.name,e))):[],Y=l&&N?.length&&(0,d.eh)(l,N[0])||Boolean(I),k=(0,d.NK)(N[0]),F=l&&l?.groupedId;l&&N?.length>1?m({message:f("MediaReplaceInvalidError",void 0,{pluralValue:N.length})}):l&&k?m({message:f("MediaReplaceInvalidError",void 0,{pluralValue:1})}):!F||(M=Y,M)?(M&&(h&&(p({shouldSave:!0}),g()),n(l?N:e=>e.concat(N))),I&&(M?r(w):t(w,o?.id))):m({message:f("MediaReplaceInvalidError",void 0,{pluralValue:N.length})})}},[t,l,n,e,c,u,r,f,h])};var ye=n(3225),Ce=n(37859),we=n(56133),be=n(61157),Ie=n(60138);let Se=!1;const Me=new Set([s.C7.TextUrl,s.C7.Url]);var Ne=n(25498),Ye=n(37830);const ke=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/is,Fe=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+\n{2,}/i,Pe={username:"",query:"",canShowHelp:!1,usernameLowered:""},Te=document.createElement("div");const De=(0,Ye.A)((e,t,n)=>({username:e,query:t,canShowHelp:n,usernameLowered:e.toLowerCase()})),xe=new RegExp(a.kNZ,"i");var Le=n(9442),Ee=n(20247),Be=n(16120),Re=n(17237);const Oe=new RegExp(`^${a.bpX.source}$`,"g");var Ue=n(11778);const Ke={encoderPath:new URL(n(89755),n.b).href,reuseWorker:!0},ze={type:"audio/ogg"};let Ve,je,Ge;async function Je(){return Ve||(Ve=n.e(4550).then(n.t.bind(n,14550,23)),je=(await Ve).default,Ge=new je(Ke)),Ve}async function $e(e){await async function(){await Je(),await Ge.start()}();const t=Date.now();let n;const o=[],i=[];Ge.ondataavailable=e=>{o.push(e)};const s=function(t){const n=t.sourceNode,o=n.context.createAnalyser();o.fftSize=64,n.connect(o);const s=o.frequencyBinCount,a=new Uint8Array(s);let d=!1;return function t(){if(d)return;o.getByteFrequencyData(a);const n=a.reduce((e,t)=>e+t,0)/s/255;(t=>{i.push(255*t),e(t)})(n<.1?0:n),(0,r.YS)(t)}(),()=>{d=!0}}(Ge);return{stop:()=>new Promise((e,a)=>{Ge.onstop=()=>{e({blob:new Blob(o,ze),duration:Math.round(((n||Date.now())-t)/1e3),waveform:i})},Ge.onerror=a;const r=Math.max(0,t+1e3-Date.now());setTimeout(()=>{Ge.stop(),s()},r)}),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout(()=>{Ge.pause(),n=Date.now(),s()},e)}}}var qe=n(80089),He=n(80464),We=n(20021);const _e=e=>{const{attachments:t}=e,n=(0,He.A)(qe.ar.Extra,"AttachmentModal",!t.length);return n?(0,We.Y)(n,{...e}):void 0};var Qe=n(61182),Ze=n(87679),Xe=n(52844),et=n(36680),tt=n(18276),nt=n(71429),ot=n(24433),it=n(66469),st=n(54639);const at=(0,o.ph)(({chatId:e,threadId:t,isButtonVisible:n,canAttachMedia:s,canAttachPolls:r,canAttachToDoLists:l,canSendPhotos:c,canSendVideos:u,canSendDocuments:h,canSendAudios:m,attachBots:f,peerType:v,isScheduled:A,theme:y,shouldCollectDebugLogs:C,canEditMedia:w,editingMessage:b,messageListType:I,paidMessagesStars:S,onFileSelect:M,onMenuOpen:N,onMenuClose:Y,onPollCreate:k,onTodoListCreate:F})=>{const{updateAttachmentSettings:P}=(0,i.ko)(),[T,D,x]=(0,z.A)(),[L,E,B]=(0,et.A)(T,x),R=c&&u,O=c||u,[U,K,V]=(0,z.A)(),j=T||U,q=b&&b?.groupedId&&Boolean((0,d.yl)(b)||Boolean((0,d.zX)(b))),H=b&&b?.groupedId&&Boolean((0,d.wp)(b)||(0,d.gB)(b)||(0,d.zC)(b));(0,o.vJ)(()=>{T&&B()},[T,B]),(0,o.vJ)(()=>{j?N():Y()},[j,Y,N]);const W=(0,J.A)(()=>{T?x():D()}),_=(0,J.A)(e=>{const{files:t}=e.target,n=(0,Ze.kc)(t);n?.length&&M(n)}),Q=(0,J.A)(()=>{P({shouldCompress:!0}),(0,Xe.p)(Array.from(R?a.mxD:c?a.gex:a.fNs).join(","),e=>_(e))}),Z=(0,J.A)(()=>{P({shouldCompress:!1}),(0,Xe.p)(!h&&m?Array.from(a.IH3).join(","):"*",e=>_(e))}),X=(0,J.A)(()=>{const e=new File([(0,Qe.F8)()],a.lFE,{type:"text/plain"});M([e])}),ee=(0,o.Kr)(()=>f?Object.values(f).filter(t=>!(!v||!t.isForAttachMenu)&&(!("bots"!==v||t.id!==e||!t.attachMenuPeerTypes||!t.attachMenuPeerTypes.includes("self"))||t.attachMenuPeerTypes.includes(v))):void 0,[f,e,v]),te=(0,$.A)(),ne=(0,G.A)();if(n)return(0,We.FD)("div",{className:"AttachMenu",children:[b&&w?(0,We.Y)(it.A,{id:"replace-menu-button",className:(0,g.A)("AttachMenu--button composer-action-button",T&&"activated"),round:!0,color:"translucent",onActivate:W,ariaLabel:"Replace an attachment",ariaControls:"replace-menu-controls",hasPopup:!0,children:(0,We.Y)(tt.A,{name:"replace"})}):(0,We.Y)(it.A,{id:"attach-menu-button",disabled:Boolean(b),className:(0,g.A)("AttachMenu--button composer-action-button",T&&"activated"),round:!0,color:"translucent",onActivate:W,ariaLabel:"Add an attachment",ariaControls:"attach-menu-controls",hasPopup:!0,children:(0,We.Y)(tt.A,{name:"attach"})}),(0,We.FD)(nt.A,{id:"attach-menu-controls",isOpen:j,autoClose:!0,positionX:"right",positionY:"bottom",onClose:x,className:"AttachMenu--menu fluid",onCloseAnimationEnd:x,onMouseEnter:p.TF?void 0:L,onMouseLeave:p.TF?void 0:E,noCloseOnBackdrop:!p.TF,ariaLabelledBy:"attach-menu-button",children:[!s&&(0,We.Y)(ot.A,{className:"media-disabled",disabled:!0,children:ne("scheduled"===I&&S?"DescriptionScheduledPaidMediaNotAllowed":"DescriptionRestrictedMedia")}),s&&(0,We.FD)(We.FK,{children:[O&&!H&&(0,We.Y)(ot.A,{icon:"photo",onClick:Q,children:te(R?"AttachmentMenu.PhotoOrVideo":c?"InputAttach.Popover.Photo":"InputAttach.Popover.Video")}),(h||m)&&!q&&(0,We.Y)(ot.A,{icon:"document",onClick:Z,children:te(!h&&m?"InputAttach.Popover.Music":"AttachDocument")}),h&&C&&(0,We.Y)(ot.A,{icon:"bug",onClick:X,children:te("DebugSendLogs")})]}),r&&!b&&(0,We.Y)(ot.A,{icon:"poll",onClick:k,children:te("Poll")}),l&&!b&&(0,We.Y)(ot.A,{icon:"select",onClick:F,children:ne("TitleToDoList")}),!b&&!w&&!A&&ee?.map(n=>(0,We.Y)(st.A,{bot:n,chatId:e,threadId:t,theme:y,onMenuOpened:K,onMenuClosed:V}))]})]})}),rt=e=>{const{isOpen:t}=e,n=(0,He.A)(qe.ar.Extra,"BotCommandMenu",!t);return n?(0,We.Y)(n,{...e}):void 0};var dt=n(85449),lt=n(64493);const ct=(0,o.ph)((0,i.EK)((e,{messageId:t})=>{const{chatId:n}=(0,u.Xf0)(e)||{};return{message:n?(0,u.O5q)(e,n,t):void 0}})(({isOpen:e,threadId:t,message:n,onClose:s})=>{const{clickBotInlineButton:a}=(0,i.ko)(),r=(0,G.A)(),[d,l]=(0,et.A)(e,s),{isKeyboardSingleUse:c}=n||{},u=(0,o.Kr)(()=>{const e=[];return n?.keyboardButtons.forEach(t=>{e.push(t.map(e=>(0,dt.A)(r,e)))}),e},[r,n?.keyboardButtons]);if(n&&n.keyboardButtons)return(0,We.Y)(nt.A,{isOpen:e,autoClose:c,positionX:"right",positionY:"bottom",onClose:s,className:"BotKeyboardMenu",onCloseAnimationEnd:s,onMouseEnter:p.TF?void 0:d,onMouseLeave:p.TF?void 0:l,noCompact:!0,children:(0,We.Y)("div",{className:"content custom-scroll",children:n.keyboardButtons.map((e,o)=>(0,We.Y)("div",{className:"row",children:e.map((e,i)=>(0,We.Y)(lt.A,{ripple:!0,disabled:"unsupported"===e.type,onClick:()=>a({chatId:n.chatId,messageId:n.id,threadId:t,button:e}),children:u?.[o][i]}))}))})})})),ut=(0,o.ph)(({isOpen:e,onClick:t,text:n,isDisabled:i})=>{const s=(0,o.li)();return(0,o.vJ)(()=>{const e=s.current;if(!e)return;const t=e.scrollWidth+1;e.closest(".Composer").style.setProperty("--bot-menu-text-width",`${t}px`)},[e,n]),(0,o.vJ)(()=>{const e=s.current;if(!e)return;const t=e.closest(".Composer");return()=>{t.style.removeProperty("--bot-menu-text-width")}},[]),(0,We.FD)(lt.A,{className:(0,g.A)("composer-action-button bot-menu",e&&"open"),round:!0,color:"translucent",disabled:i,onClick:t,ariaLabel:"Open bot command keyboard",children:[(0,We.Y)(tt.A,{name:"webapp",className:(0,g.A)("bot-menu-icon",e&&"open")}),(0,We.Y)("span",{ref:s,className:"bot-menu-text",children:(0,L.A)(n)})]})}),ht=e=>{const{isOpen:t}=e,n=(0,He.A)(qe.ar.Extra,"ChatCommandTooltip",!t);return n?(0,We.Y)(n,{...e}):void 0};var mt=n(56494),pt=n(87894),gt=n(14),ft=n(91930),vt=n(60859);const At=(0,o.ph)((0,i.EK)((e,{shouldForceShowEditing:t,chatId:n,threadId:o,messageListType:i})=>{const{forwardMessages:{fromChatId:s,toChatId:a,messageIds:r,noAuthors:l,noCaptions:c},isShareMessageModalShown:h,shouldPreventComposerAnimation:m}=(0,u.nTw)(e),p="scheduled"===i?(0,u.VlN)(e,n):(0,u.Ys6)(e,n,o),g=(0,u.PKK)(e)&&!m,f=a===n,v=r?.map(t=>(0,u.O5q)(e,s,t)),A=(0,u.GA4)(e,n,o),y=A?.replyInfo,C=A?.suggestedPostInfo,w=y?.replyToPeerId,b=w?(0,u.hds)(e,w):void 0;let I,S;if(p?I=(0,u.KLw)(e,n,o,i):f&&1===r.length?I=v?.[0]:y&&!t&&(I=(0,u.O5q)(e,y.replyToPeerId||n,y.replyToMsgId)),p&&I)S=(0,u.Y7C)(e,I);else if(f){let t=v?.map(t=>{return n=t,S=(0,u.Szq)(e,n),S||(S=(0,u.Y7C)(e,n)),S;var n}).filter(Boolean);t=t?(0,pt.Am)(t):void 0,S=1===t?.length?t?.[0]:void 0}else if(y&&I&&!t){const{forwardInfo:t}=I,o=(0,u.nZ4)(e,n);t&&(t.isChannelPost||o)&&(S=(0,u.Szq)(e,I)),S||t?.hiddenUserName&&!Boolean(y.quoteText)||(S=(0,u.Y7C)(e,I))}const M=S&&(0,u.hds)(e,S.id),N=M&&(0,d.WX)(M),Y=v?.some(e=>e?.content.text&&Object.keys(e.content).length>1),k=f&&1===r.length&&Boolean(I?.content.storyData),F=y?.replyToMsgId===o&&!y.replyToPeerId,P=I&&(0,mt.B9)(e,I);return{replyInfo:y,suggestedPostInfo:C,editingId:p,message:I,sender:S,shouldAnimate:g,forwardedMessagesCount:f?r.length:void 0,noAuthors:l,noCaptions:c,forwardsHaveCaptions:Y,isCurrentUserPremium:(0,u.g29)(e),isContextMenuDisabled:k,isReplyToDiscussion:F,isInChangingRecipientMode:h,shouldPreventComposerAnimation:m,senderChat:b,currentUserId:e.currentUserId,isSenderChannel:N,forwardMessageIds:r,fromChatId:s,isMediaNsfw:P,theme:(0,u.SJA)(e)}})(({replyInfo:e,suggestedPostInfo:t,editingId:n,message:s,sender:a,shouldAnimate:r,forwardedMessagesCount:l,noAuthors:c,noCaptions:h,forwardsHaveCaptions:m,shouldForceShowEditing:p,isCurrentUserPremium:f,isContextMenuDisabled:v,isReplyToDiscussion:A,isInChangingRecipientMode:y,shouldPreventComposerAnimation:C,senderChat:w,chatId:b,currentUserId:I,isSenderChannel:S,forwardMessageIds:M,fromChatId:N,isMediaNsfw:Y,theme:k,onClear:F})=>{const{resetDraftReplyInfo:P,resetDraftSuggestedPostInfo:T,updateDraftReplyInfo:D,setEditingId:x,focusMessage:L,changeRecipient:E,openChatOrTopicWithReplyInDraft:B,setForwardNoAuthors:R,setForwardNoCaptions:U,exitForwardMode:K,setShouldPreventComposerAnimation:z,openSuggestMessageModal:V}=(0,i.ko)(),j=(0,o.li)(),H=(0,$.A)(),W=(0,G.A)(),_="topicCreate"===s?.content.action?.type,Q=e&&!p,X=Boolean(e?.quoteText),ee=Boolean(t)&&!p,te=Boolean(l),ne=(0,J.A)(e=>{const t=(0,i.mS)();return(a=(0,u.Szq)(t,e))||(a=(0,u.Y7C)(t,e)),a}),oe=(0,o.Kr)(()=>{if(!te)return;const e=M?.map(e=>(0,u.O5q)((0,i.mS)(),N,e)).filter(Boolean),t=e?.map(e=>ne(e)).filter(Boolean);return t?(0,pt.Am)(t):void 0},[te,M,N]),ie=!(y||(!s||!e&&!n)&&(!oe||!te)&&!ee),{shouldRender:se,transitionClassNames:ae}=(0,Z.A)(ie&&!_&&!A,void 0,!r,void 0,!r,350,!r);(0,o.vJ)(()=>{C&&z({shouldPreventComposerAnimation:!1})});const re=(0,J.A)(()=>{n?x({messageId:void 0}):l?K():ee?(T(),P()):e&&!p&&P(),F?.()});(0,o.vJ)(()=>ie?(0,Ue.A)(re):void 0,[ie,re]);const{isContextMenuOpen:de,contextMenuAnchor:le,handleContextMenu:ce,handleContextMenuClose:ue,handleContextMenuHide:he}=(0,O.A)(j),me=(0,J.A)(e=>{t?V({chatId:b}):ce(e)}),pe=(0,J.A)(e=>{e.stopPropagation(),re(),he()}),ge=e=>()=>{ue(),e()},fe=(0,J.A)(ge(E)),ve=(0,J.A)(ge(()=>{L({chatId:s.chatId,messageId:s.id,noForumTopicPanel:!0})})),Ae=(0,J.A)(ge(()=>D({quoteText:void 0}))),ye=(0,J.A)(ge(E)),Ce=(0,J.A)(()=>{ue(),a&&B({chatId:a.id})}),we=(0,J.A)(ge(re)),be=(0,J.A)(()=>j.current),Ie=(0,J.A)(()=>j.current),Se=(0,J.A)(()=>j.current.querySelector(".forward-context-menu .bubble"));(0,o.vJ)(()=>{se||(ue(),he())},[ue,he,se]);const Me=(0,g.A)("ComposerEmbeddedMessage",ae),Ne=(0,gt.A)(a,!0),{className:Ye,style:ke}=(0,q.Ay)({peer:Ne,theme:k}),Fe=(0,g.A)("ComposerEmbeddedMessage_inner",Ye),Pe=(0,o.Kr)(()=>n?"edit":ee?"cash-circle":te?"forward":Q?"reply":void 0,[n,te,Q,ee]),Te=l&&l>1?H("ForwardedMessageCount",l):void 0,De=(0,o.Kr)(()=>{if(!s||!te||!s.content.text||!c||f)return s;const e=(0,d.m4)(s.content.text);return{...s,content:{...s.content,text:e}}},[f,te,s,c]),xe=(0,gt.A)(Pe,!0);if(!se)return;const Le=a&&!S&&b!==a.id&&a.id!==I;return(0,We.Y)("div",{className:Me,ref:j,onContextMenu:ce,children:(0,We.FD)("div",{className:Fe,style:ke,children:[(0,We.FD)("div",{className:"embedded-left-icon",onClick:ce,children:[xe&&(0,We.Y)(tt.A,{name:xe}),Boolean(e?.quoteText)&&(0,We.Y)(tt.A,{name:"quote",className:"quote-reply"})]}),(0,We.Y)(ft.b,{isOpen:ie,className:"inside-input",replyInfo:e,suggestedPostInfo:t,isMediaNsfw:Y,isInComposer:!0,message:De,sender:c?void 0:a,composerForwardSenders:oe,customText:Te,noCaptions:h,title:n&&!Q?H("EditMessage"):c?H("HiddenSendersNameDescription"):void 0,onClick:me,senderChat:w}),(0,We.Y)(lt.A,{className:"embedded-cancel",round:!0,faded:!0,color:"translucent",ariaLabel:H("Cancel"),onClick:pe,iconName:"close"}),(Q||te)&&!v&&(0,We.FD)(nt.A,{isOpen:de,anchor:le,getTriggerElement:be,getRootElement:Ie,getMenuElement:Se,className:"forward-context-menu",onClose:ue,onCloseAnimationEnd:he,children:[te&&(0,We.FD)(We.FK,{children:[(0,We.Y)(ot.A,{icon:c?void 0:"message-succeeded",customIcon:c?(0,We.Y)(tt.A,{name:"placeholder"}):void 0,onClick:()=>R({noAuthors:!1}),children:H(l>1?"ShowSenderNames":"ShowSendersName")}),(0,We.Y)(ot.A,{icon:c?"message-succeeded":void 0,customIcon:c?void 0:(0,We.Y)(tt.A,{name:"placeholder"}),onClick:()=>R({noAuthors:!0}),children:H(l>1?"HideSenderNames":"HideSendersName")}),m&&(0,We.FD)(We.FK,{children:[(0,We.Y)(vt.A,{}),(0,We.Y)(ot.A,{icon:h?void 0:"message-succeeded",customIcon:h?(0,We.Y)(tt.A,{name:"placeholder"}):void 0,onClick:()=>U({noCaptions:!1}),children:H(l>1?"Conversation.ForwardOptions.ShowCaption":"ShowCaption")}),(0,We.Y)(ot.A,{icon:h?"message-succeeded":void 0,customIcon:h?void 0:(0,We.Y)(tt.A,{name:"placeholder"}),onClick:()=>U({noCaptions:!0}),children:H(l>1?"Conversation.ForwardOptions.HideCaption":"HideCaption")})]}),(0,We.Y)(vt.A,{}),(0,We.Y)(ot.A,{icon:"replace",onClick:fe,children:H("ForwardAnotherChat")})]}),Q&&(0,We.FD)(We.FK,{children:[(0,We.Y)(ot.A,{icon:"show-message",onClick:ve,children:H("Message.Context.Goto")}),X&&(0,We.Y)(ot.A,{icon:"remove-quote",onClick:Ae,children:H("RemoveQuote")}),Le&&(0,We.Y)(ot.A,{icon:"user",onClick:Ce,children:W("ReplyInPrivateMessage")}),(0,We.Y)(ot.A,{icon:"replace",onClick:ye,children:H("ReplyToAnotherChat")}),(0,We.Y)(ot.A,{icon:"delete",onClick:we,children:H("DoNotReply")})]})]})]})})}));var yt=n(25897),Ct=n(6070),wt=n(41510);const bt=e=>{const{isOpen:t}=e,n=(0,He.A)(qe.ar.Extra,"DropArea",!t);return n?(0,We.Y)(n,{...e}):void 0};var It=n(49068);const St=e=>{const{isOpen:t}=e,n=(0,He.A)(qe.ar.Extra,"InlineBotTooltip",!t);return n?(0,We.Y)(n,{...e}):void 0},Mt=e=>{const{isOpen:t}=e,n=(0,He.A)(qe.ar.Extra,"MentionTooltip",!t);return n?(0,We.Y)(n,{...e}):void 0};var Nt=n(78407);const Yt=e=>{const{isOpen:t}=e,n=(0,He.A)(qe.ar.Extra,"PollModal",!t);return n?(0,We.Y)(n,{...e}):void 0},kt=e=>{const{isOpen:t}=e,n=(0,He.A)(qe.ar.Extra,"SendAsMenu",!t);return n?(0,We.Y)(n,{...e}):void 0},Ft=e=>{const{isOpen:t}=e,n=(0,He.A)(qe.ar.Extra,"StickerTooltip",!t);return n?(0,We.Y)(n,{...e}):void 0};var Pt=n(26440);const Tt=e=>{const{modal:t}=e,n=(0,He.A)(qe.ar.Extra,"ToDoListModal",!t);return n?(0,We.Y)(n,{...e}):void 0};var Dt=n(2338),xt=n(62587),Lt=n(34201),Et=n(86070);const Bt="zqTOc7LU",Rt="b0A9Zfoa";const Ot=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n})=>{const o=(0,u.nTw)(e),i=(0,u.rQx)(e,t,n),{attachmentSettings:s}=e,a=o.webPagePreviewId?(0,u.kgA)(e,o.webPagePreviewId):void 0;return{webPagePreview:"empty"===a?.webpageType?void 0:a,noWebPage:i,attachmentSettings:s}})(({chatId:e,threadId:t,isDisabled:n,webPagePreview:s,noWebPage:a,attachmentSettings:r,isEditing:l})=>{const{toggleMessageWebPage:c,updateAttachmentSettings:u}=(0,i.ko)(),h=(0,G.A)(),m=(0,o.li)(),p=r.isInvertedMedia,f="small"===r.webPageMediaSize,v=(0,U.A)(()=>Boolean(s&&!a&&!n),[n,a,s]),{shouldRender:A}=(0,Lt.A)({isOpen:v,ref:m,withShouldRender:!0}),y="full"===s?.webpageType&&s.hasLargeMedia,C=(0,o.li)(s);s&&s!==C.current&&(C.current=s);const w=s||C.current,b="full"===w?.webpageType,I=(0,Dt.A)(b?{content:w}:void 0),S=(0,d.eY)(w)||(0,d.rU)(w)||(0,d.y3)(w)||(0,d.rj)(w),M=S&&(0,d.VO)(S,"pictogram"),N=(0,xt.A)(M),{shouldRender:Y,ref:k}=(0,Lt.A)({isOpen:Boolean(N),withShouldRender:!0,noCloseTransition:!0}),F=Boolean(N||Y),P=(0,J.A)(()=>{c({chatId:e,threadId:t,noWebPage:!0})}),{isContextMenuOpen:T,contextMenuAnchor:D,handleContextMenu:x,handleContextMenuClose:L,handleContextMenuHide:E,handleBeforeContextMenu:B}=(0,O.A)(m,l,!0),R=(0,J.A)(()=>m.current),K=(0,J.A)(()=>m.current),z=(0,J.A)(()=>m.current.querySelector(`.${Bt} .bubble`)),V=(0,J.A)(e=>{x(e)});function j(e){u({isInvertedMedia:e})}function $(e){u({webPageMediaSize:e})}if((0,o.vJ)(()=>{A&&w||(L(),E())},[L,E,A,w]),A&&w)return(0,We.Y)("div",{className:(0,g.A)("O3di3ULC",!l&&"G5_7x_Hn"),ref:m,children:(0,We.FD)("div",{className:"m3DBx9f5",children:[(0,We.Y)("div",{className:"vFWsMwfP",onClick:V,children:(0,We.Y)(tt.A,{name:"link"})}),w&&"empty"!==w.webpageType&&(0,We.FD)(Et.A,{noUserColors:!0,className:"otSxF62k",onContextMenu:x,onMouseDown:B,onClick:V,children:[F&&(0,We.FD)("div",{className:"VvwZOug9",children:[I&&(0,We.Y)("img",{src:I,alt:"",className:Rt}),Y&&(0,We.Y)("img",{ref:k,src:N,alt:"",className:Rt})]}),(0,We.FD)("div",{className:"itmZe2qi",children:[(0,We.Y)("span",{className:"ER149gdz",children:b?w.siteName||w.url:h("Loading")}),(0,We.Y)("span",{className:"FSYSqC60",children:b?w.description||h((q=w,q.photo?"AttachPhoto":q.video?"AttachVideo":q.audio?"AttachMusic":q.document?"AttachDocument":q.story?"AttachStory":"LinkPreview")):w.url})]})]}),(0,We.Y)(lt.A,{className:"yhxytYkd",round:!0,faded:!0,color:"translucent",ariaLabel:h("AccLinkRemovePreview"),onClick:P,iconName:"close"}),!l&&(0,We.Y)(nt.A,{isOpen:T,anchor:D,getTriggerElement:R,getRootElement:K,getMenuElement:z,className:Bt,onClose:L,onCloseAnimationEnd:E,autoClose:!0,children:(0,We.FD)(We.FK,{children:[p?(0,We.Y)(ot.A,{icon:"move-caption-up",onClick:()=>j(void 0),children:h("ContextMoveTextUp")}):(0,We.Y)(ot.A,{icon:"move-caption-down",onClick:()=>j(!0),children:h("ContextMoveTextDown")}),y&&(f?(0,We.Y)(ot.A,{icon:"expand",onClick:()=>$("large"),children:h("ContextLinkLargerMedia")}):(0,We.Y)(ot.A,{icon:"collapse",onClick:()=>$("small"),children:h("ContextLinkSmallerMedia")})),(0,We.Y)(ot.A,{icon:"delete",onClick:P,children:h("ContextLinkRemovePreview")})]})})]})});var q}));var Ut=n(97676),Kt=n(76283),zt=n(57474),Vt=n(61361),jt=n(41036),Gt=n(68292),Jt=n(21849),$t=n(48227),qt=n(11241),Ht=function(e){return e.Send="send",e.Record="record",e.Edit="edit",e.Schedule="schedule",e.Forward="forward",e.SendOneTime="sendOneTime",e}(Ht||{});const Wt=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n,storyId:o,messageListType:i,isMobile:r,type:c})=>{const p=e.appConfig,g=(0,u.hds)(e,t),f=(0,d.DX)(t)?void 0:(0,u.yps)(e,t),v=Boolean(f),A=(0,u.nZ4)(e,t),y=(0,C.L8)(t),w=y?(0,u.vGo)(e,t):void 0,b=(0,u.WA9)(e,t),I=y?void 0:(0,u.AWZ)(e,t),S=(v||!y)&&(0,u.tVS)(e,t,n),{shouldSuggestStickers:M,shouldSuggestCustomEmoji:N,shouldUpdateStickerSetOrder:Y,shouldPaidMessageAutoApprove:F}=e.settings.byKey,{language:P,shouldCollectDebugLogs:T}=(0,m.lS)(e),{forwardMessages:{messageIds:D}}=(0,u.nTw)(e),x=e.emojiKeywords[a.cUY],L=P!==a.cUY?e.emojiKeywords[P]:void 0,E=S?S.id:void 0,B=E?(0,u.O5q)(e,t,E):void 0,{currentUserId:R}=e,O=(0,u.mBe)(e,R),U=I?I?.sendAsId||R:void 0,K=U?(0,u.PVB)(e,U):void 0,z=(0,u.sam)(e,t),V=(0,u.p6T)(e,t),j=(0,u.nTw)(e),G=Boolean(j.storyViewer.storyId),J=(0,u.Xf0)(e),$=t===J?.chatId&&n===J?.threadId&&i===J?.type&&!G,q=((0,u.mBe)(e,t)&&!w?.noVoiceMessages)??!0,H=I?.slowMode,W=(0,u.g29)(e),_="scheduled"===i?(0,u.dkp)(e,t):(0,u.U0A)(e,t,n),Q=o&&(0,u.Msb)(e,t,o),Z=Q&&"sentReaction"in Q?Q.sentReaction:void 0,X=(0,u.GA4)(e,t,n),ee=X?.replyInfo?(0,u.O5q)(e,t,X.replyInfo.replyToMsgId):void 0,te=g?.isForum&&g.isForumAsMessages&&n===s.l3&&ee?(0,u.nkm)(e,ee):void 0,ne="scheduled"===i,oe=y&&!v&&!ne&&!A,ie=(0,u.rQx)(e,t,n),se=g&&(0,l.RY)(g,(0,u.K52)(e),(0,u.P5N)(e,t))?.isSilentPosting,ae=y&&!v&&!ne&&!A&&"story"!==c&&t!==a.zv8,re=(0,u.xYJ)(e,"stickerEffects"),de=j.shouldPlayEffectInComposer,le=ae&&X?.effectId,ce=le?e.availableEffectById[le]:void 0,ue=e.reactions.effectReactions,he=e.config?.maxMessageLength||k.Yf,me=t===j.forwardMessages.toChatId,pe=Boolean(X?.replyInfo),ge=Boolean(X?.suggestedPostInfo),fe=e.stars?.balance.amount||0,ve=Boolean(j.starsBalanceModal),Ae=(0,u.trm)(e),ye=e.isAppConfigLoaded,Ce=j.insertingPeerIdMention,we=j.webPagePreviewId?(0,u.kgA)(e,j.webPagePreviewId):void 0;return{availableReactions:e.reactions.availableReactions,topReactions:"story"===c?e.reactions.topReactions:void 0,isOnActiveTab:!j.isBlurred,editingMessage:(0,u.KLw)(e,t,n,i),draft:X,chat:g,isChatWithBot:v,isChatWithSelf:A,isForCurrentMessageList:$,canScheduleUntilOnline:(0,u.RBq)(e,t),isChannel:g?(0,d.WX)(g):void 0,isRightColumnShown:(0,u.gjV)(e,r),isSelectModeActive:(0,u.rTV)(e),withScheduledButton:"thread"===i&&(w||I)?.hasScheduledMessages,isInScheduledList:ne,botKeyboardMessageId:E,botKeyboardPlaceholder:B?.keyboardPlaceholder,isForwarding:me,isReplying:pe,hasSuggestedPost:ge,forwardedMessagesCount:me?D.length:void 0,pollModal:j.pollModal,todoListModal:j.todoListModal,stickersForEmoji:e.stickers.forEmoji.stickers,customEmojiForEmoji:e.customEmojis.forEmoji.stickers,chatFullInfo:I,topInlineBotIds:e.topInlineBots?.userIds,currentUserId:R,currentUser:O,contentToBeScheduled:j.contentToBeScheduled,shouldSuggestStickers:M,shouldSuggestCustomEmoji:N,shouldUpdateStickerSetOrder:Y,recentEmojis:e.recentEmojis,baseEmojiKeywords:x?.keywords,emojiKeywords:L?.keywords,inlineBots:j.inlineBots.byUsername,isInlineBotLoading:j.inlineBots.isLoading,botCommands:w?w.botInfo?.commands||!1:void 0,botMenuButton:w?.botInfo?.menuButton,sendAsPeer:K,sendAsId:U,editingDraft:_,requestedDraft:z,requestedDraftFiles:V,attachBots:e.attachMenu.bots,attachMenuPeerType:(0,u.dfQ)(e,t),theme:(0,u.SJA)(e),fileSizeLimit:(0,h.d)(e,"uploadMaxFileparts")*a.dK5,captionLimit:(0,h.d)(e,"captionLength"),isCurrentUserPremium:W,canSendVoiceByPrivacy:q,attachmentSettings:e.attachmentSettings,slowMode:H,currentMessageList:J,isReactionPickerOpen:(0,u.Ani)(e),canBuyPremium:!W&&!(0,u.n_C)(e),canPlayAnimatedEmojis:(0,u.BWX)(e),canSendOneTimeMedia:!A&&y&&!v&&!ne,shouldCollectDebugLogs:T,sentStoryReaction:Z,stealthMode:e.stories.stealthMode,replyToTopic:te,quickReplyMessages:e.quickReplies.messagesById,quickReplies:e.quickReplies.byId,canSendQuickReplies:oe,noWebPage:ie,webPagePreview:we,isContactRequirePremium:w?.isContactRequirePremium,effect:ce,effectReactions:ue,areEffectsSupported:ae,canPlayEffect:re,shouldPlayEffect:de,maxMessageLength:he,paidMessagesStars:b,shouldPaidMessageAutoApprove:F,isSilentPosting:se,isPaymentMessageConfirmDialogOpen:j.isPaymentMessageConfirmDialogOpen,starsBalance:fe,isStarsBalanceModalOpen:ve,shouldDisplayGiftsButton:w?.shouldDisplayGiftsButton,disallowedGifts:w?.disallowedGifts,isAccountFrozen:Ae,isAppConfigLoaded:ye,insertingPeerIdMention:Ce,pollMaxAnswers:p.pollMaxAnswers}})(({type:e,isOnActiveTab:t,dropAreaState:n,isInScheduledList:l,canScheduleUntilOnline:h,isReady:m,isMobile:C,editingMessage:k,chatId:F,threadId:se,storyId:ae,currentMessageList:re,messageListType:de,draft:le,chat:ce,chatFullInfo:ue,replyToTopic:he,isForCurrentMessageList:me,isCurrentUserPremium:pe,canSendVoiceByPrivacy:ge,isChatWithBot:fe,isChatWithSelf:ve,isChannel:Ye,fileSizeLimit:Ke,isRightColumnShown:ze,isSelectModeActive:Ve,isReactionPickerOpen:je,shouldDisplayGiftsButton:Ge,isForwarding:qe,isReplying:He,hasSuggestedPost:Qe,forwardedMessagesCount:Ze,pollModal:Xe,todoListModal:et,botKeyboardMessageId:nt,botKeyboardPlaceholder:ot,inputPlaceholder:st,withScheduledButton:dt,stickersForEmoji:mt,customEmojiForEmoji:pt,topInlineBotIds:gt,currentUserId:ft,currentUser:vt,captionLimit:Dt,contentToBeScheduled:xt,shouldSuggestStickers:Lt,shouldSuggestCustomEmoji:Et,baseEmojiKeywords:Bt,emojiKeywords:Rt,recentEmojis:Wt,inlineBots:_t,isInlineBotLoading:Qt,botCommands:Zt,sendAsPeer:Xt,sendAsId:en,editingDraft:tn,requestedDraft:nn,requestedDraftFiles:on,botMenuButton:sn,attachBots:an,attachMenuPeerType:rn,attachmentSettings:dn,theme:ln,slowMode:cn,shouldUpdateStickerSetOrder:un,editableInputCssSelector:hn,editableInputId:mn,inputId:pn,className:gn,availableReactions:fn,topReactions:vn,canBuyPremium:An,canPlayAnimatedEmojis:yn,shouldCollectDebugLogs:Cn,sentStoryReaction:wn,stealthMode:bn,canSendOneTimeMedia:In,quickReplyMessages:Sn,quickReplies:Mn,canSendQuickReplies:Nn,webPagePreview:Yn,noWebPage:kn,isContactRequirePremium:Fn,paidMessagesStars:Pn,effect:Tn,effectReactions:Dn,areEffectsSupported:xn,canPlayEffect:Ln,shouldPlayEffect:En,maxMessageLength:Bn,isSilentPosting:Rn,isPaymentMessageConfirmDialogOpen:On,starsBalance:Un,isStarsBalanceModalOpen:Kn,disallowedGifts:zn,isAccountFrozen:Vn,isAppConfigLoaded:jn,insertingPeerIdMention:Gn,pollMaxAnswers:Jn,onDropHide:$n,onFocus:qn,onBlur:Hn,onForward:Wn})=>{const{sendMessage:_n,clearDraft:Qn,showDialog:Zn,openPollModal:Xn,closePollModal:eo,openTodoListModal:to,closeTodoListModal:no,loadScheduledHistory:oo,openThread:io,addRecentEmoji:so,sendInlineBotResult:ao,loadSendAs:ro,resetOpenChatWithDraft:lo,callAttachBot:co,addRecentCustomEmoji:uo,showNotification:ho,showAllowedMessageTypesNotification:mo,openStoryReactionPicker:po,openGiftModal:go,closeReactionPicker:fo,sendStoryReaction:vo,editMessage:Ao,updateAttachmentSettings:yo,saveEffectInDraft:Co,setReactionEffect:wo,hideEffectInComposer:bo,updateChatSilentPosting:Io,updateInsertingPeerIdMention:So,updateDraftSuggestedPostInfo:Mo,updateShouldSaveAttachmentsCompression:No,applyDefaultAttachmentsCompression:Yo}=(0,i.ko)(),ko=(0,$.A)(),Fo=(0,G.A)(),Po=(0,o.li)(),To=(0,o.li)(),Do=(0,o.li)(),[xo,Lo]=(0,o.Ul)(""),[Eo,Bo]=(0,o.J0)(!1),Ro=(0,j.A)(hn),Oo=(0,o.li)(),Uo=(0,W.A)(n),{width:Ko}=Y.A.get(),zo=(0,V.A)(),Vo="messageList"===e,jo="story"===e,Go=Vo?ce?.sendAsPeerIds:void 0,Jo=Boolean(Go?.length),[$o,qo,Ho]=(0,z.A)(),Wo=(0,Q.A)(F,se),[_o,Qo,Zo]=(0,z.A)(),[Xo,ei,ti]=(0,z.A)(),ni=k&&(0,d.ZV)(k),oi=ce?.isMonoforum,{emojiSet:ii,members:si,botCommands:ai}=ue||{},ri=ii?.id,di=!Pn&&!oi,li=wn&&(0,d.a0)(wn,a.tNZ);(0,o.vJ)(y.VU,[xo]);const ci=(0,o.li)(0),[ui,hi]=(0,_.A)(Vo&&h,Ho);(0,R.A)(()=>{Bo(!0)},430),(0,o.vJ)(()=>{Vo||fo()},[Vo,ae]),(0,o.vJ)(()=>{Oo.current=void 0},[F]),(0,o.vJ)(()=>{jn&&F&&m&&!jo&&!oi&&oo({chatId:F})},[m,F,se,jo,jn,oi]),(0,o.vJ)(()=>{const e=Ye&&ce?.areProfilesShown,t=ce&&(0,d.Vs)(ce)&&Boolean((0,d.gA)(ce)||ce.isLinkedInDiscussion||ce.hasGeo);!Go&&m&&(t||e)&&ro({chatId:F})},[ce,F,Ye,m,ro,Go]);const mi=(0,o.li)(!1);(0,ee.A)(([e,t])=>{mi.current=Boolean(F===e&&Go&&!t)},[F,Go]);const[pi,gi]=(0,o.J0)([]),fi=Boolean(pi.length),[vi,Ai]=(0,o.J0)(void 0);(0,o.vJ)(()=>{pi.length&&pi||No({shouldSave:!1})},[pi]);const{canSendStickers:yi,canSendGifs:Ci,canAttachMedia:wi,canAttachPolls:bi,canAttachEmbedLinks:Ii,canAttachToDoLists:Si,canSendVoices:Mi,canSendPlainText:Ni,canSendAudios:Yi,canSendVideos:ki,canSendPhotos:Fi,canSendDocuments:Pi}=(0,o.Kr)(()=>(0,d.Q_)(ce,ue,fe,ve,jo,Pn,l),[ce,ue,fe,ve,jo,Pn,l]),Ti=Fn&&jo,Di=Ti||!Ni,xi=(0,U.A)(()=>{if(fi)return pi.length;const e=xo()||fi?1:0;return qe&&Ze?Ze+e:e||1},[xo,fi,pi,qe,Ze]),Li=Pn?xi*Pn:0,{closeConfirmDialog:Ei,dialogHandler:Bi,shouldAutoApprove:Ri,setAutoApprove:Oi,handleWithConfirmation:Ui}=(0,Ee.A)(Li,Kn,Un),Ki=!fi&&Ii&&!kn&&Boolean(Yn),zi=Di&&!k;(0,o.vJ)(()=>{Ki||yo({isInvertedMedia:void 0})},[Ki]);const Vi=(0,J.A)((e,t=mn,n=!1)=>{if(t===mn&&zi)return;const o=window.getSelection();let i;if(i=t===mn?document.querySelector(hn):document.getElementById(t),o.rangeCount&&!n){const n=o.getRangeAt(0);if((0,x.L)(n,t))return(0,M.oR)(e),void i.dispatchEvent(new Event("input",{bubbles:!0}))}if(n){const t=e.split(" ")[0],n=xo().startsWith(t);Lo(n?e:`${e}${xo()}`)}else Lo(`${xo()}${e}`);(0,r.Uz)(()=>{(0,w.A)(i)})}),ji=(0,J.A)((e,t=mn)=>{const n=(0,L.A)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"");Vi(n,t)}),Gi=(0,J.A)((e,t=mn,n=!1)=>{const o=(0,E.QY)(e);Vi(o,t,n)}),Ji=(0,J.A)((e,t=mn)=>{Vi((0,D.hB)(e),t)}),$i=(0,J.A)(()=>{vi&&(Gi(vi,mn),Ai(void 0))}),{shouldForceCompression:qi,shouldForceAsFile:Hi,handleAppendFiles:Wi,handleFileSelect:_i,onCaptionUpdate:Qi,handleClearAttachments:Zi,handleSetAttachments:Xi}=function({attachments:e,fileSizeLimit:t,setHtml:n,setAttachments:s,chatId:a,canSendAudios:r,canSendVideos:l,canSendPhotos:c,canSendDocuments:u,insertNextText:h,editedMessage:m,shouldSendInHighQuality:p}){const g=(0,G.A)(),{openLimitReachedModal:f,showAllowedMessageTypesNotification:v,showNotification:A}=(0,i.ko)(),[y,C]=(0,o.J0)(!1),[w,b]=(0,o.J0)(!1),S=(0,J.A)(()=>{s(I.p),h()}),M=(0,J.A)(n=>{const o="function"==typeof n?n(e):n;if(o.length)if(o.some(e=>{const t=(0,d.ES)(e);return"audio"===t&&!r&&!u||"video"===t&&!l&&!u||"photo"===t&&!c&&!u||"file"===t&&!u}))v({chatId:a});else if(o.some(({size:e})=>e>t))f({limit:"uploadMaxFileparts"});else{s(o);const e=o.some(e=>{const t=(0,d.ES)(e);return"audio"===t&&!r||"video"===t&&!l||"photo"===t&&!c});C(Boolean(e&&u)),b(!u)}else S()}),N=(0,J.A)(async(t,n)=>{if(m){const e=await(0,T.A)(t[0].name,t[0]),n=m&&(0,d.eh)(m,e);m?.groupedId?n?M([e]):A({message:g("MediaReplaceInvalidError",void 0,{pluralValue:t.length})}):M([e])}else{const o=await Promise.all(t.map(e=>(0,T.A)(e.name,e,{shouldSendAsSpoiler:n||void 0,shouldSendInHighQuality:p})));M([...e,...o])}}),Y=(0,J.A)(async e=>{if(m){const t=await(0,T.A)(e[0].name,e[0]),n=m&&(0,d.eh)(m,t);m?.groupedId?n?M([t]):A({message:g("MediaReplaceInvalidError",void 0,{pluralValue:e.length})}):M([t])}else{const t=await Promise.all(e.map(e=>(0,T.A)(e.name,e,{shouldSendInHighQuality:p})));M(t)}}),k=(0,J.A)(async()=>{const t=await Promise.all(e.map(e=>(0,T.A)(e.filename,e.blob,{shouldSendInHighQuality:p})));M(t)});return(0,o.vJ)(()=>{k()},[p]),{handleAppendFiles:N,handleFileSelect:Y,onCaptionUpdate:n,handleClearAttachments:S,handleSetAttachments:M,shouldForceCompression:w,shouldForceAsFile:y}}({attachments:pi,setHtml:Lo,setAttachments:gi,fileSizeLimit:Ke,chatId:F,canSendAudios:Yi,canSendVideos:ki,canSendPhotos:Fi,canSendDocuments:Pi,insertNextText:$i,editedMessage:k,shouldSendInHighQuality:dn.shouldSendInHighQuality}),[es,ts,ns]=(0,z.A)(),[os,is,ss]=(0,z.A)(),[as,rs,ds]=(0,z.A)(),[ls,cs,us]=(0,z.A)(),[hs,ms,ps]=(0,z.A)(),{startRecordingVoice:gs,stopRecordingVoice:fs,pauseRecordingVoice:vs,activeVoiceRecording:As,currentRecordTime:ys,recordButtonRef:Cs,startRecordTimeRef:ws,isViewOnceEnabled:bs,setIsViewOnceEnabled:Is,toogleViewOnceEnabled:Ss}=(()=>{const e=(0,o.li)(),[t,n]=(0,o.J0)(),i=(0,o.li)(),[s,a]=(0,o.J0)(),[d,l]=(0,o.J0)(!1);(0,o.vJ)(()=>{p.Yw&&p.pW&&Je()},[]);const c=(0,J.A)(async()=>{try{const{stop:t,pause:o}=await $e(t=>{e.current&&(i.current&&Date.now()%4==0&&(0,r.RK)(()=>{e.current&&(e.current.style.boxShadow=`0 0 0 ${50*(t||0)}px rgba(0,0,0,.15)`)}),a(Date.now()))});i.current=Date.now(),a(Date.now()),n({stop:t,pause:o})}catch(e){console.error(e)}}),u=(0,J.A)(()=>{if(t){(0,r.RK)(()=>{e.current&&(e.current.style.boxShadow="none")});try{return t.pause()}catch(e){return void console.error(e)}}}),h=(0,J.A)(()=>{if(t){n(void 0),i.current=void 0,a(void 0),(0,r.RK)(()=>{e.current&&(e.current.style.boxShadow="none")});try{return t.stop()}catch(e){return void console.error(e)}}});(0,o.vJ)(()=>t?(0,Ue.A)(h):void 0,[t,h]);const m=(0,J.A)(()=>{l(!d)});return{startRecordingVoice:c,pauseRecordingVoice:u,stopRecordingVoice:h,activeVoiceRecording:t,currentRecordTime:s,recordButtonRef:e,startRecordTimeRef:i,isViewOnceEnabled:d,setIsViewOnceEnabled:l,toogleViewOnceEnabled:m}})(),Ms=me&&!jo;(0,B.A)(()=>{Wo({type:"recordAudio"})},Ms?As&&a.cqp:void 0),(0,o.vJ)(()=>{me&&!jo&&(As||Wo({type:"cancel"}))},[As,me,jo,Wo]);const Ns=(0,X.i)(Boolean(k));(0,o.vJ)(()=>{me&&!jo&&xo()&&!Ns.current&&Wo({type:"typing"})},[xo,Ns,me,jo,Wo]);const Ys=ce&&(0,d.SJ)(ce),{isEmojiTooltipOpen:ks,closeEmojiTooltip:Fs,filteredEmojis:Ps,filteredCustomEmojis:Ts,insertEmoji:Ds}=(0,Ne.A)(Boolean(m&&t&&(jo||me)&&Lt&&!fi),xo,Lo,void 0,Wt,Bt,Rt),{isCustomEmojiTooltipOpen:xs,closeCustomEmojiTooltip:Ls,insertCustomEmoji:Es}=(0,ye.A)(Boolean(m&&t&&(jo||me)&&Et&&!fi),xo,Lo,Ro,Po,pt),{isStickerTooltipOpen:Bs,closeStickerTooltip:Rs}=function(e,t,n){const{loadStickersForEmoji:s,clearStickersForEmoji:r}=(0,i.ko)(),[d,l,c]=(0,z.A)(!1),u=(0,oe.A)(()=>{const n=t();if(!e||!n||p.TL&&n.length>8)return;if(!n.match(p.TL?Be.A:a.bpX))return;const o=(0,te.S)(n);return o&&(p.TL&&1===(0,Re.A)(o)||!p.TL&&Boolean(n.match(Oe)))?p.TL?o:o.match(/alt="(.+)"/)?.[1]:void 0},[t,e]),h=(0,U.A)(()=>Boolean(u()),[u]),m=Boolean(n?.length);return(0,o.vJ)(()=>{if(!e||!h)return;const t=u();t?m||s({emoji:t}):r()},[e,h,u,m,s,r]),(0,o.vJ)(c,[c,t]),{isStickerTooltipOpen:Boolean(h&&m&&!d),closeStickerTooltip:l}}(Boolean(m&&t&&(jo||me)&&Lt&&yi&&!fi),xo,mt),{isMentionTooltipOpen:Os,closeMentionTooltip:Us,insertMention:Ks,mentionFilteredUsers:zs}=(0,Le.A)(Boolean(Vo&&m&&me&&!fi),xo,Lo,Ro,Po,si,gt,ft);(0,o.vJ)(()=>{if(!Gn)return;const e=(0,u.PVB)((0,i.mS)(),Gn);e&&Ks(e,!0,!0),So({peerId:void 0})},[Gn,Ks]);const{isOpen:Vs,botId:js,isGallery:Gs,switchPm:Js,switchWebview:$s,results:qs,closeTooltip:Hs,help:Ws,loadMore:_s}=function(e,t,n,s){const{queryInlineBot:a,resetInlineBot:r,resetAllInlineBots:d}=(0,i.ko)(),[l,c,u]=(0,z.A)(!1),h=(0,ne.gs)(()=>{const t=n();return e&&t.startsWith("@")?function(e){if(!e.startsWith("@"))return Pe;const t=function(e){return Te.innerHTML=e.replace(/<br>/g,"\n"),Te.querySelectorAll("[alt]").forEach(e=>{e.innerText||(e.innerText=e.getAttribute("alt"))}),Te.innerText}(e),n=t.match(ke);return n?De(n[1],n[2],""===n[2]&&!t.match(Fe)):Pe}(t):Pe},[n,e],300),{username:m,query:p,canShowHelp:g,usernameLowered:f}=(0,U.A)(h,[h,n],!0);(0,ee.A)(([e])=>{e&&r({username:e})},[m,r]),(0,o.vJ)(()=>{f&&a({chatId:t,username:f,query:p})},[t,p,a,f]),(0,o.vJ)(u,[u,n]);const{id:v,switchPm:A,switchWebview:y,offset:C,results:w,isGallery:b,help:I}=f&&s?.[f]||{},S=Boolean((w?.length||A||y)&&!l);(0,o.vJ)(()=>{S||m||d()},[S,d,m]);const M=(0,J.A)(()=>{f&&a({chatId:t,username:f,query:p,offset:C})});return{isOpen:S,botId:v,isGallery:b,switchPm:A,switchWebview:y,results:w,closeTooltip:c,help:g&&I?`@${m} ${I}`:void 0,loadMore:M}}(Boolean(Vo&&m&&me&&!fi),F,xo,_t),Qs=Boolean(Mn&&Object.keys(Mn).length),{isOpen:Zs,close:Xs,filteredBotCommands:ea,filteredQuickReplies:ta}=function(e,t,n,i,s){const[a,r]=(0,o.J0)(),[d,l]=(0,o.J0)(),[c,u,h]=(0,z.A)(!1),m=(0,ne.gs)(()=>{const n=t();return e&&n.startsWith("/")?(0,te.S)(n).match(ie)?.[0].trim():void 0},[t,e],300),p=(0,oe.A)(m,[m,t],!0);return(0,o.vJ)(()=>{const e=p(),t=n||i;if(!e||!t&&!s)return r(void 0),void l(void 0);const o=e.substring(1),a=t?.filter(e=>!o||e.command.startsWith(o));r(a?.length?a:void 0);const d=Object.values(s||{}).filter(e=>!o||e.shortcut.startsWith(o));l(d?.length?d:void 0)},[p,n,i,s]),(0,o.vJ)(h,[h,t]),{isOpen:Boolean((a?.length||d?.length)&&!c),close:u,filteredBotCommands:a,filteredQuickReplies:d}}(Boolean(Vo&&m&&me&&(Zt&&Zt?.length||ai?.length||Qs&&Nn)),xo,Zt,ai,Nn?Mn:void 0);(({draft:e,chatId:t,threadId:n,getHtml:d,setHtml:l,editedMessage:c,isDisabled:u})=>{const{saveDraft:h,clearDraft:m,loadCustomEmojis:p}=(0,i.ko)(),g=(0,o.li)(!1);(0,o.vJ)(()=>{const t=d(),n=void 0!==e?.isLocal;(0,E.QY)(e?.text)!==t||n?g.current=!0:g.current=!1},[e,d]),(0,o.vJ)(()=>{g.current=!1},[t,n]);const f=Boolean(c),v=(0,J.A)((e={})=>{if(u||f||!g.current)return;const o=d();o?(0,r.YS)(()=>{h({chatId:e.chatId??t,threadId:e.threadId??n,text:(0,S.Ay)(o)})}):m({chatId:e.chatId??t,threadId:e.threadId??n,shouldKeepReply:!0,shouldKeepSuggestedPost:!0})}),A=(0,we.A)(a.mPG,!0,void 0,[t,n]);(0,Ce.A)(([o,i,d])=>{if(u)return;const h=g.current,m=e?.suggestedPostInfo&&!d?.suggestedPostInfo;if(t===o&&n===i){if(h&&!e)return;if(!e&&d&&l(""),h&&!m)return}if(c||!e)return;l((0,E.QY)(e.text)),m&&(0,r.Uz)(()=>{const e=document.querySelector(a.m$5);e&&(0,w.A)(e,!0)});const f=e.text?.entities?.map(e=>e.type===s.C7.CustomEmoji&&e.documentId).filter(Boolean)||[];f.length&&p({ids:f})},[t,n,e,d,l,c,u]),(0,o.Nf)(()=>{if(!u)return()=>{f||v({chatId:t,threadId:n}),Se=!0,(0,r.YS)(()=>{Se=!1})}},[t,n,f,v,u]);const y=(0,X.i)(t),C=(0,X.i)(n);(0,o.vJ)(()=>{if(u||Se)return;if(!d())return void v();const e=y.current,t=C.current;A(()=>{y.current===e&&C.current===t&&v()})},[y,d,u,A,C,v]),(0,be.Ay)(v),(0,Ie.A)(v)})({draft:le,chatId:F,threadId:se,getHtml:xo,setHtml:Lo,editedMessage:k,isDisabled:jo||Boolean(nn)||!Qe&&oi}),function({getHtml:e,chatId:t,threadId:n}){const{loadWebPagePreview:a,clearWebPagePreview:r,toggleMessageWebPage:d}=(0,i.ko)(),l=(0,o.li)(),c=(0,ne.tF)(()=>{const t=(0,S.Ay)(e()),n=t.entities?.find(e=>e.type===s.C7.TextUrl);return l.current=t,n?.url||t.text.match(xe)?.[0]},[e],300,!0),u=(0,oe.A)(c,[c,e],!0);(0,o.vJ)(()=>{const e=u(),o=l.current;e?a({text:o}):(r(),d({chatId:t,threadId:n}))},[u,t,n]),(0,ee.A)(()=>{r(),d({chatId:t,threadId:n})},[t,r,n,d])}({chatId:F,threadId:se,getHtml:xo});const na=(0,J.A)((e=!1)=>{e||Lo(""),gi(I.p),Ai(void 0),Fs(),Ls(),Rs(),Us(),C?setTimeout(()=>ds(),350):ds()}),[oa,ia,sa]=((e,t,n,s,l,c,u,h,m)=>{const{editMessage:p,setEditingDraft:g,toggleMessageWebPage:f,openDeleteMessageModal:v}=(0,i.ko)(),[A,y]=(0,o.J0)(!1),C=h?.replyInfo?.replyToMsgId;(0,K.A)(([e,o])=>{if(!n)return;if(C&&o!==C)return t(""),void y(!1);if(e?.id===n.id&&C===o)return;const i=!e&&m?.text.length?m:n.content.text,s=(0,E.QY)(i);t(s),y(!0),(0,r.Uz)(()=>{const e=document.querySelector(a.m$5);e&&(0,w.A)(e,!0)})},[n,C,m,t]),(0,o.vJ)(()=>{if(!n)return;const e=!("webPage"in n.content)&&n.content.text?.entities?.some(e=>Me.has(e.type));f({chatId:l,threadId:c,noWebPage:e})},[l,c,n]),(0,o.vJ)(()=>{if(n)return()=>{const t=(0,S.Ay)(e()),n=t.text.length?t:void 0;g({chatId:l,threadId:c,type:u,text:n})}},[l,n,e,g,c,u]);const b=(0,ne.tF)(()=>{if(!n)return!1;const t=(0,S.Ay)(e());return!("webPage"in n.content)&&n.content.text?.entities?.some(e=>Me.has(e.type))&&!t.entities?.some(e=>Me.has(e.type))},[n,e],300,!0),I=(0,oe.A)(b,[b,e],!0);(0,K.A)(([e])=>{n&&e?.id===n.id&&I()&&f({chatId:l,threadId:c,noWebPage:!1})},[n,l,e,c,I]);const M=(0,J.A)(()=>{h&&(0,r.YS)(()=>{t((0,E.QY)(h.text)),(0,r.Uz)(()=>{const e=document.querySelector(a.m$5);e&&(0,w.A)(e,!0)})})}),N=(0,J.A)(()=>{s(),M()}),Y=(0,J.A)(()=>{const{text:t,entities:o}=(0,S.Ay)(e());n&&(t||(0,d.mR)(n)?(p({messageList:{chatId:l,threadId:c,type:u},text:t,entities:o}),s(),M()):v({chatId:l,messageIds:[n.id],isSchedule:"scheduled"===u}))}),k=(0,J.A)(()=>{if(!n)return;const t=(0,S.Ay)(e()),o=t.text.length?t:void 0;g({chatId:l,threadId:c,type:u,text:o})});return(0,be.Ay)(k),(0,Ie.A)(k),[Y,N,A]})(xo,Lo,k,na,F,se,de,le,tn),aa=(0,X.i)(na),ra=(0,X.i)(fs);(0,o.vJ)(()=>()=>{ra.current(),aa.current()},[F,se,aa,ra]);const da=(0,o.Kr)(()=>{if(zn)return Object.values(zn).every(Boolean)},[zn]),la=Boolean(!ve&&Ge&&!da),ca=oi&&!k&&!qe&&!He&&!le?.suggestedPostInfo,ua=(0,J.A)(()=>{const e=ci.current;ho(e?{message:ko("UnlockPremiumEmojiHint2"),action:{action:"openChat",payload:{id:ft,shouldReplaceHistory:!0}},actionText:ko("Open")}:{message:ko("UnlockPremiumEmojiHint"),action:{action:"openPremiumModal",payload:{initialSection:"animated_emoji"}},actionText:ko("PremiumMore")}),ci.current=Number(!e)}),ha=(0,U.A)(()=>_o||!Wn||xo()&&!fi?k&&sa?Ht.Edit:!p.pW||As||qe||xo()&&!fi?l?Ht.Schedule:Ht.Send:Ht.Record:Ht.Forward,[As,k,xo,fi,qe,_o,Wn,sa,l]),ma=!l,{isContextMenuOpen:pa,handleContextMenu:ga,handleContextMenuClose:fa,handleContextMenuHide:va}=(0,O.A)(Cs,!(ha===Ht.Send&&ma)),{contextMenuAnchor:Aa,handleContextMenu:ya,handleBeforeContextMenu:Ca,handleContextMenuHide:wa}=(0,O.A)(Do,!jo);(0,o.vJ)(()=>{je||Aa&&(po({peerId:F,storyId:ae,position:Aa}),wa())},[F,wa,je,ae,Aa]);const{className:ba,style:Ia}=(0,q.Ay)({peer:Xt||vt,theme:ln});Ae(me||jo,Gi,Xi,Ai,k,!pe&&!ve,ua,!pi.length);const Sa=(0,J.A)(()=>{k&&ia()}),Ma=(0,J.A)((e,t)=>{const n=t?Dt:Bn;if(e?.length>n){const t=e.length-n;return Zn({data:{message:"MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS",textParams:{"{EXTRA_CHARS_COUNT}":t.toString(),"{PLURAL_S}":t>1?"s":""},hasErrorKey:!0}}),!1}return!0}),Na=(0,J.A)(()=>{if(cn&&!Ys){const e=document.querySelector(hn),t=(0,N.Fm)(),n=Oo.current&&Math.floor(t-Oo.current),o=cn.nextSendDate&&cn.nextSendDate>t;if(n&&n<cn.seconds||o){const i=o?cn.nextSendDate-t:cn.seconds-n;return Zn({data:{message:ko("SlowModeHint",(0,f.QO)(i)),isSlowMode:!0,hasErrorKey:!1}}),e?.blur(),!1}}return!0}),Ya=e=>{if(!re&&!ae)return!1;const{text:t}=(0,S.Ay)(xo());return!(!t&&!e.length||!Ma(t,!0)||!Na())},ka=(0,J.A)(({attachments:e,sendCompressed:t=dn.shouldCompress,sendGrouped:n=dn.shouldSendGrouped,isSilent:o,scheduledAt:i,scheduleRepeatPeriod:s,isInvertedMedia:a})=>{if(!re&&!ae)return;o=o||Rn;const{text:d,entities:l}=(0,S.Ay)(xo());a=d&&t&&n?a:void 0,k?Ao({messageList:re,text:d,entities:l,attachments:(0,T.L)(e,t)}):_n({messageList:re,text:d,entities:l,scheduledAt:i,scheduleRepeatPeriod:s,isSilent:o,shouldUpdateStickerSetOrder:un,attachments:(0,T.L)(e,t),shouldGroupMessages:n,isInvertedMedia:a}),Oo.current=(0,N.Fm)(),Qn({chatId:F,threadId:se,isLocalOnly:!0}),(0,r.YS)(()=>{na()})}),Fa=(0,J.A)((e,t,n)=>{if(Ya(pi)){if(k)return void ka({attachments:pi,sendCompressed:e,sendGrouped:t,isInvertedMedia:n});Ui(ka,{attachments:pi,sendCompressed:e,sendGrouped:t,isInvertedMedia:n})}}),Pa=(0,J.A)((e,t,n,o,i,s)=>{Ya(pi)&&ka({attachments:pi,sendCompressed:e,sendGrouped:t,isSilent:n,scheduledAt:o,scheduleRepeatPeriod:s,isInvertedMedia:i})}),Ta=(0,J.A)((e,t=!1,n,o)=>{const{text:i,entities:s}=(0,S.Ay)(xo());if(e.length)return void(Ya(e)&&ka({attachments:e,scheduledAt:n,scheduleRepeatPeriod:o,isSilent:t}));if(!i&&!qe)return;if(!Ma(i))return;const a=document.querySelector(hn),d=Tn?.id;if(i||qe){if(!Na())return;const e=Ki?dn.isInvertedMedia:void 0;xn&&Co({chatId:F,threadId:se,effectId:void 0}),_n({messageList:re,text:i,entities:s,scheduledAt:n,scheduleRepeatPeriod:o,isSilent:t,shouldUpdateStickerSetOrder:un,isInvertedMedia:e,effectId:d,webPageMediaSize:dn.webPageMediaSize,webPageUrl:Ki?Yn.url:void 0,isForwarding:qe})}Oo.current=(0,N.Fm)(),Qn({chatId:F,threadId:se,isLocalOnly:!0,shouldKeepReply:qe}),p.pz&&a&&a===document.activeElement&&P(a),(0,r.YS)(()=>{na()})}),Da=(0,J.A)(async(e=!1,t,n)=>{if(!re&&!ae)return;e=e||Rn;let o=pi;if(As){const e=await fs(),t=bs?a.dxe:void 0;if(e){const{blob:n,duration:i,waveform:s}=e;o=[await(0,T.A)("wonderful-voice-message.ogg",n,{voice:{duration:i,waveform:s},ttlSeconds:t})]}}Ta(o,e,t,n)}),xa=(0,J.A)((e=!1,t,n)=>{Ui(Da,e,t,n)}),La=(0,J.A)(()=>{pe?to({chatId:F}):ho({message:Fo("SubscribeToTelegramPremiumForCreateToDo"),action:{action:"openPremiumModal",payload:{initialSection:"todo"}},actionText:Fo("PremiumMore")})}),Ea=(0,J.A)(()=>{if("webApp"!==sn?.type)return;const e=(0,A.vG)(sn.url);"publicUsernameOrBotLink"===e?.type&&e.appName?(0,v._)(sn.url):co({chatId:F,url:sn.url,threadId:se})}),Ba=(0,J.A)(()=>{ds(),is()}),Ra=(0,J.A)((e,t,n,o,i)=>{if(e&&"queryId"in e){const{id:n,queryId:o,isSilent:i}=e;return void ao({id:n,chatId:F,threadId:se,queryId:o,scheduledAt:t,isSilent:i||Rn})}const{isSilent:s,...a}=e||{};if(e&&0!==Object.keys(a).length)if(void 0!==e.sendCompressed||void 0!==e.sendGrouped){const{sendCompressed:o=!1,sendGrouped:i=!1,isInvertedMedia:a}=e;Pa(o,i,s,t,a,n)}else _n({...e,messageList:o,scheduledAt:t,scheduleRepeatPeriod:n,effectId:i});else Da(Boolean(s),t,n)});(0,K.A)(([e])=>{re&&xt&&xt!==e&&ui((e,t)=>{Ra(xt,e,t,re,void 0)})},[xt,re,Ra,ui]),(0,o.vJ)(()=>{nn&&(Gi(nn,void 0,!0),lo(),(0,r.Uz)(()=>{const e=document.getElementById(mn);(0,w.A)(e,!0)}))},[mn,nn,lo,Lo]),(0,o.vJ)(()=>{on?.length&&(_i(on),lo())},[_i,on,lo]),(0,o.vJ)(()=>{on?.length?(No({shouldSave:!0}),Yo()):No({shouldSave:!1})},[on,No,Yo]);const Oa=(0,J.A)((e,t)=>{const n="id"in e.stickerSetInfo&&e.stickerSetInfo.id;e.isFree||pe||ve||n===ri?Ji(e,t):ua()}),Ua=(0,J.A)(e=>{Oa(e,a.e0F)}),Ka=(0,J.A)((e,t,n)=>{(re||ae)&&(t=t||Rn,l||n?(qo(),ui((n,o)=>{Ho(),Ui(Ra,{gif:e,isSilent:t},n,o,re),(0,r.YS)(()=>{na(!0)})})):(Ui(_n,{messageList:re,gif:e,isSilent:t}),(0,r.YS)(()=>{na(!0)})),Qn({chatId:F,threadId:se,isLocalOnly:!0}))}),za=(0,J.A)((e,t,n,o=!1,i)=>{(re||ae)&&(t=t||Rn,e={...e,isPreloadedGlobally:!0},l||n?(qo(),ui((n,i)=>{Ho(),Ui(Ra,{sticker:e,isSilent:t},n,i,re),(0,r.YS)(()=>{na(o)})})):(Ui(_n,{messageList:re,sticker:e,isSilent:t,shouldUpdateStickerSetOrder:un&&i}),Qn({chatId:F,threadId:se,isLocalOnly:!0}),(0,r.YS)(()=>{na(o)})))}),Va=(0,J.A)((e,t,n)=>{if(!re&&!ae)return;t=t||Rn,l||n?ui((n,o)=>{Ui(Ra,{id:e.id,queryId:e.queryId,isSilent:t},n,o,re)}):Ui(ao,{id:e.id,queryId:e.queryId,threadId:se,chatId:F,isSilent:t});const o=document.querySelector(hn);p.pz&&o&&o===document.activeElement&&P(o),Qn({chatId:F,threadId:se,isLocalOnly:!0}),(0,r.YS)(()=>{na()})}),ja=(0,J.A)(()=>{Qn({chatId:F,threadId:se,isLocalOnly:!0}),(0,r.YS)(()=>{na()})}),Ga=(0,J.A)(e=>{re&&(l?(ui((t,n)=>{Ui(Ra,{poll:e},t,n,re)}),eo()):(Ui(_n,{messageList:re,poll:e,isSilent:Rn}),eo()))}),Ja=(0,J.A)(e=>{re&&(l?ui((t,n)=>{Ui(Ra,{todo:e},t,n,re)}):Ui(_n,{messageList:re,todo:e,isSilent:Rn}))}),$a=(0,J.A)(e=>{if(l)ui((t,n)=>{Ra({...e,isSilent:!0},t,n,re)});else if(e&&("sendCompressed"in e||"sendGrouped"in e)){const{sendCompressed:t=!1,sendGrouped:n=!1,isInvertedMedia:o}=e;Pa(t,n,!0,void 0,o)}else Da(!0)}),qa=(0,J.A)(()=>{const e=document.querySelector(hn);if(!C||e!==document.activeElement)return ss(),ds(),void cs();e?.blur(),setTimeout(()=>{ss(),ds(),cs()},100)});(0,o.vJ)(()=>{zi&&Lo("")},[zi,Lo,pi]);const Ha=(0,J.A)(e=>{ji(e,a.e0F)}),Wa=(0,J.A)((e=mn)=>{const t=window.getSelection();if(t.rangeCount){const n=t.getRangeAt(0);if((0,x.L)(n,e))return void document.execCommand("delete",!1)}Lo(function(e){const t=document.createElement("div");t.contentEditable="true",t.style.position="absolute",t.style.left="-10000px",t.style.top="-10000px",t.innerHTML=e,t.className="allow-selection",document.body.appendChild(t);let n=t.lastChild;if(n.lastChild)for(;n.lastChild;)n=n.lastChild;const o=n.textContent.length,i=document.createRange(),s=window.getSelection();i.setStart(n,o),i.setEnd(n,o),s.removeAllRanges(),s.addRange(i),document.execCommand("delete",!1);const a=t.innerHTML;return document.body.removeChild(t),a}(xo()))}),_a=(0,J.A)(()=>{Wa(a.e0F)}),Qa=(0,J.A)(()=>{io({chatId:F,threadId:se,type:"scheduled",noForumTopicPanel:!0})}),Za=(0,J.A)(()=>{go({forUserId:F})}),Xa=(0,J.A)(()=>{Mo({price:{currency:a.OUy,amount:0,nanos:0}})}),er=(0,J.A)(()=>{const e=!Rn;Io({chatId:F,isEnabled:e}),ho({localId:"silentPosting",icon:e?"mute":"unmute",message:Fo(`ComposerSilentPosting${e?"Enabled":"Disabled"}Tootlip`)})});(0,o.vJ)(()=>{ze&&C&&ds()},[ze,ds,C]),(0,o.vJ)(()=>{m&&(Ve?ms():setTimeout(()=>{ps()},200))},[Ve,ps,ms,m]);const tr=(0,U.A)(()=>Boolean(xo()),[xo]),nr=fe&&"webApp"===sn?.type&&!k&&"thread"===de,or=nr&&!tr&&!As,ir=es||as||ks||ls||Os||Vs||os||Xo||Bs||Zs||xs||or||pa||Boolean(As)||pi.length>0||_o,sr=ir&&!je&&jo&&!Xo&&!as,ar=(()=>{if(cn?.nextSendDate&&!(cn.nextSendDate<(0,N.Fm)()))return Fo("SlowModePlaceholder",{timer:(0,We.Y)(Vt.A,{endsAt:cn.nextSendDate,onEnd:zo})},{withNodes:!0})})(),rr=(0,o.Kr)(()=>As&&Ko<=600?"":zi?Fo(jo?"ComposerStoryPlaceholderLocked":"ComposerPlaceholderNoText"):ar||ot||st||(Pn?Fo("ComposerPlaceholderPaidMessage",{amount:(0,b.U2)(Fo,Pn,{asFont:!0,className:"placeholder-star-icon"})},{withNodes:!0}):He&&Qe?Fo("ComposerPlaceholderCaption"):bn?.activeUntil&&jo&&bn.activeUntil>(0,N.Fm)()?Fo("StealthModeComposerPlaceholder",{timer:(0,We.Y)(Vt.A,{endsAt:bn.activeUntil,onEnd:zo})},{withNodes:!0}):ce?.adminRights?.anonymous?Fo("ComposerPlaceholderAnonymous"):ce?.isForum&&!ce.isBotForum&&ce.isForumAsMessages&&se===s.l3?he?Fo("ComposerPlaceholderTopic",{topic:he.title}):Fo("ComposerPlaceholderTopicGeneral"):Fo(Ye?Rn?"ComposerPlaceholderBroadcastSilent":"ComposerPlaceholderBroadcast":"ComposerPlaceholder")),[As,ot,ce,st,Ye,zi,jo,Rn,Fo,he,He,se,Ko,Pn,Qe,ar,bn?.activeUntil]);(0,o.vJ)(()=>{ir?qn?.():Hn?.()},[ir,Hn,qn]);const{shouldRender:dr,transitionClassNames:lr}=(0,Z.A)(sr),cr=!(ha!==Ht.Record||wi&&ge&&Mi),ur=(0,J.A)(()=>{switch(ha){case Ht.Forward:Wn?.();break;case Ht.Send:xa();break;case Ht.Record:cr?ge?Mi||mo({chatId:F,messageListType:de}):ho({message:ko("VoiceMessagesRestrictedByPrivacy",ce?.title)}):(Is(!1),gs());break;case Ht.Edit:oa();break;case Ht.Schedule:if(As&&vs(),!re)return;ui((e,t)=>{Ra({},e,t,re,Tn?.id)})}}),hr=new Date;hr.setSeconds(0),hr.setMilliseconds(0);const mr=new Date;mr.setFullYear(mr.getFullYear()+1);let pr="SendMessage";switch(ha){case Ht.Forward:pr="Forward";break;case Ht.Edit:pr="Save edited message";break;case Ht.Record:pr=wi?"AccDescrVoiceMessage":"Conversation.DefaultRestrictedMedia"}const gr=(0,g.A)("Composer",!Ve&&"shown",hs&&"hover-disabled",Eo&&"mounted",gn),fr=(0,J.A)(e=>{let t,n;if("emoji"===e.type&&(t=e.emoticon),"custom"===e.type){const o=(0,u.O8F)((0,i.mS)(),e.documentId);if(!o)return;if(!o.isFree&&!pe&&!ve)return void ua();const s=(0,S.Ay)((0,D.hB)(o));t=s.text,n=s.entities}Ui(_n,{text:t,entities:n,isReaction:!0}),fo()}),vr=(0,J.A)(e=>{wo({chatId:F,threadId:se,reaction:e}),fo()}),Ar=(0,J.A)(e=>{po({peerId:F,storyId:ae,position:e,sendAsMessage:!0})}),yr=(0,J.A)(()=>{const e=wn?void 0:a.tNZ;vo({peerId:F,storyId:ae,containerId:(0,d.$_)(F,ae),reaction:e})}),Cr=(0,J.A)(()=>{ui((e,t)=>{Ra({},e,t,re,void 0)})}),wr=(0,J.A)(()=>{Ui($a)}),br=(0,J.A)(()=>{Ui(Ra,{},a.NkL,void 0,re,Tn?.id)}),Ir=(0,J.A)((e,t,n)=>{ui((o,i)=>{Ui(Ra,{sendCompressed:e,sendGrouped:t,isInvertedMedia:n},o,i,re,void 0)})}),Sr=(0,J.A)((e,t,n)=>{Ui($a,{sendCompressed:e,sendGrouped:t,isInvertedMedia:n})}),Mr=(0,J.A)(()=>{Co({chatId:F,threadId:se,effectId:void 0})}),Nr=(0,J.A)(()=>{bo({})}),Yr=(0,o.Kr)(()=>{switch(ha){case Ht.Edit:return oa;case Ht.Schedule:return Cr;default:return xa}},[ha,oa,xa]),kr=fe&&"commands"===sn?.type&&!k&&!1!==Zt&&!As,Fr=xn&&Tn?.emoticon,Pr=Boolean(Pn&&ha===Ht.Send),Tr=(0,H.A)(Pr);return(0,We.FD)("div",{className:gr,children:[Vo&&wi&&m&&(0,We.Y)(bt,{isOpen:n!==wt.I.None,withQuick:n===wt.I.QuickFile||Uo===wt.I.QuickFile,onHide:$n,onFileSelect:_i,editingMessage:k}),dr&&!Ti&&(0,We.Y)(Kt.A,{topReactions:vn,allAvailableReactions:fn,onToggleReaction:fr,isPrivate:!0,isReady:m,canBuyPremium:An,isCurrentUserPremium:pe,isInSavedMessages:ve,isInStoryViewer:jo,canPlayAnimatedEmojis:yn,onShowMore:Ar,className:lr}),(0,We.Y)(_e,{chatId:F,threadId:se,canShowCustomSendMenu:ma,attachments:pi,getHtml:xo,isReady:m,shouldForceCompression:qi,shouldForceAsFile:Hi,isForCurrentMessageList:me,isForMessage:Vo,shouldSchedule:di&&l,canSchedule:di,forceDarkTheme:jo,onCaptionUpdate:Qi,onSendSilent:Sr,onSend:Fa,onSendScheduled:Ir,onFileAppend:Wi,onClear:Zi,onAttachmentsUpdate:Xi,onCustomEmojiSelect:Ua,onRemoveSymbol:_a,onEmojiSelect:Ha,editingMessage:k,onSendWhenOnline:br,canScheduleUntilOnline:h&&!bs,paidMessagesStars:Pn}),(0,We.Y)(Yt,{isOpen:Xe.isOpen,isQuiz:Xe.isQuiz,shouldBeAnonymous:Ye,maxOptionsCount:Jn,onClear:eo,onSend:Ga}),(0,We.Y)(Tt,{modal:et,onClear:no,onSend:Ja}),(0,We.Y)(kt,{isOpen:ls,onClose:us,chatId:F,selectedSendAsId:en,sendAsPeerIds:Go,isCurrentUserPremium:pe}),(0,We.Y)(Mt,{isOpen:Os,filteredUsers:zs,onInsertUserName:Ks,onClose:Us}),(0,We.Y)(ht,{isOpen:Zs,chatId:F,withUsername:Boolean(ai),botCommands:ea,quickReplies:ta,getHtml:xo,self:vt,quickReplyMessages:Sn,onClick:ja,onClose:Xs}),(0,We.FD)("div",{className:(0,g.A)("composer-wrapper",jo&&"with-story-tweaks",Ti&&"is-need-premium"),children:[!Ti&&(0,We.FD)("svg",{className:"svg-appendix",width:"9",height:"20",children:[(0,We.Y)("defs",{children:(0,We.FD)("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"composerAppendix",children:[(0,We.Y)("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,We.Y)("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,We.Y)("feColorMatrix",{values:"0 0 0 0 0.0621962482 0 0 0 0 0.138574144 0 0 0 0 0.185037364 0 0 0 0.15 0",in:"shadowBlurOuter1"})]})}),(0,We.FD)("g",{fill:"none","fill-rule":"evenodd",children:[(0,We.Y)("path",{d:"M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z",fill:"#000",filter:"url(#composerAppendix)"}),(0,We.Y)("path",{d:"M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z",fill:"#FFF",className:"corner"})]})]}),Vo&&(0,We.FD)(We.FK,{children:[(0,We.Y)(St,{isOpen:Vs,botId:js,isGallery:Gs,inlineBotResults:qs,switchPm:Js,switchWebview:$s,loadMore:_s,isSavedMessages:ve,canSendGifs:Ci,isCurrentUserPremium:pe,onSelectResult:Va,onClose:Hs}),(0,We.Y)(At,{onClear:Sa,shouldForceShowEditing:Boolean(sa&&k),chatId:F,threadId:se,messageListType:de}),(0,We.Y)(Ot,{chatId:F,threadId:se,isDisabled:!Ii||fi||!tr,isEditing:Boolean(k)})]}),(0,We.FD)("div",{className:(0,g.A)("message-input-wrapper",ba),style:Ia,children:[Vo&&(0,We.FD)(We.FK,{children:[nr&&(0,We.Y)(ut,{isOpen:or,text:sn.text,isDisabled:Boolean(As),onClick:Ea}),kr&&(0,We.Y)(it.A,{className:(0,g.A)("bot-commands","composer-action-button"),round:!0,disabled:void 0===Zt,color:"translucent",onActivate:Ba,ariaLabel:"Open bot command keyboard",children:(0,We.Y)(tt.A,{name:"bot-commands-filled"})}),Jo&&Xt&&(0,We.Y)(lt.A,{round:!0,color:"translucent",onClick:ls?us:qa,ariaLabel:ko("SendMessageAsTitle"),className:(0,g.A)("send-as-button","composer-action-button",mi.current&&"appear-animation"),children:(0,We.Y)(Jt.A,{peer:Xt,size:"tiny"})})]}),(!zi||Ci||yi)&&!Ti&&!Vn&&(0,We.Y)(Pt.A,{chatId:F,threadId:se,isMobile:C,isReady:m,isSymbolMenuOpen:as,openSymbolMenu:rs,closeSymbolMenu:ds,canSendStickers:yi,canSendGifs:Ci,isMessageComposer:Vo,onGifSelect:Ka,onStickerSelect:za,onCustomEmojiSelect:Oa,onRemoveSymbol:Wa,onEmojiSelect:ji,closeBotCommandMenu:ss,closeSendAsMenu:us,isSymbolMenuForced:$o,canSendPlainText:!zi,inputCssSelector:hn,idPrefix:e,forceDarkTheme:jo}),(0,We.Y)(Nt.A,{ref:Po,id:pn,editableInputId:mn,customEmojiPrefix:e,isStoryInput:jo,chatId:F,canSendPlainText:!zi,threadId:se,isReady:m,isActive:!fi,getHtml:xo,placeholder:rr,forcedPlaceholder:Ws,canAutoFocus:m&&me&&!fi&&Vo,noFocusInterception:fi,shouldSuppressFocus:C&&as,shouldSuppressTextFormatter:ks||Os||Vs,onUpdate:Lo,onSend:Yr,onSuppressedFocus:ds,onFocus:Qo,onBlur:Zo,isNeedPremium:Ti,messageListType:de}),Vo&&(0,We.FD)(We.FK,{children:[Qt&&Boolean(js)&&(0,We.Y)(zt.A,{color:"gray"}),(0,We.Y)(jt.Ay,{className:"composer-action-buttons-container",slideClassName:"composer-action-buttons",activeKey:Number(tr),direction:"inverse",name:"slideFadeAndroid",children:!tr&&(0,We.FD)(We.FK,{children:[Ye&&(0,We.Y)(jt.Ay,{className:"composer-action-button",name:"reveal",activeKey:Number(Rn),children:(0,We.Y)(lt.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:er,ariaLabel:Fo(Rn?"AriaComposerSilentPostingDisable":"AriaComposerSilentPostingEnable"),iconName:Rn?"mute":"unmute"})}),dt&&(0,We.Y)(lt.A,{round:!0,faded:!0,className:"composer-action-button scheduled-button",color:"translucent",onClick:Qa,ariaLabel:Fo("AriaComposerOpenScheduled"),iconName:"scheduled"}),la&&(0,We.Y)(lt.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:Za,iconName:"gift"}),ca&&(0,We.Y)(lt.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:Xa,iconName:"cash-circle"}),Boolean(nt)&&!As&&!k&&(0,We.Y)(it.A,{className:(0,g.A)("composer-action-button",es&&"activated"),round:!0,color:"translucent",onActivate:ts,ariaLabel:Fo("AriaComposerBotKeyboard"),children:(0,We.Y)(tt.A,{name:"bot-command"})})]})})]}),As&&Boolean(ys)&&(0,We.Y)("span",{className:"recording-state",children:(0,f.JW)(ys-ws.current)}),!Ti&&(0,We.Y)(at,{chatId:F,threadId:se,editingMessage:k,canEditMedia:ni,isButtonVisible:!As,canAttachMedia:wi,canAttachPolls:bi,canAttachToDoLists:Si,canSendPhotos:Fi,canSendVideos:ki,canSendDocuments:Pi,canSendAudios:Yi,onFileSelect:_i,onPollCreate:Xn,onTodoListCreate:La,isScheduled:l,attachBots:Vo?an:void 0,peerType:rn,shouldCollectDebugLogs:Cn,theme:ln,onMenuOpen:ei,onMenuClose:ti,messageListType:de,paidMessagesStars:Pn}),Vo&&Boolean(nt)&&(0,We.Y)(ct,{messageId:nt,threadId:se,isOpen:es,onClose:ns}),Vo&&Zt&&(0,We.Y)(rt,{isOpen:os,botCommands:Zt,onClose:ss}),(0,We.Y)(yt.A,{chatId:F,isOpen:xs,onCustomEmojiSelect:Es,addRecentCustomEmoji:uo,onClose:Ls},`custom-emoji-tooltip-${mn}`),(0,We.Y)(Ft,{chatId:F,threadId:se,isOpen:Bs,onStickerSelect:za,onClose:Rs},`sticker-tooltip-${mn}`),(0,We.Y)(It.A,{isOpen:ks,emojis:Ps,customEmojis:Ts,addRecentEmoji:so,addRecentCustomEmoji:uo,onEmojiSelect:Ds,onCustomEmojiSelect:Ds,onClose:Fs},`emoji-tooltip-${mn}`)]})]}),In&&As&&(0,We.FD)(lt.A,{className:(0,g.A)("view-once",bs&&"active"),round:!0,color:"secondary",ariaLabel:ko("Chat.PlayOnceVoiceMessageTooltip"),onClick:Ss,children:[(0,We.Y)(tt.A,{name:"view-once"}),(0,We.Y)(tt.A,{name:"one-filled"})]}),As&&(0,We.Y)(lt.A,{round:!0,color:"danger",className:"cancel",onClick:fs,ariaLabel:"Cancel voice recording",iconName:"delete"}),jo&&!As&&(0,We.FD)(lt.A,{round:!0,className:"story-reaction-button",color:"secondary",onClick:yr,onContextMenu:ya,onMouseDown:Ca,ariaLabel:ko("AccDescrLike"),ref:Do,children:[wn&&(0,We.Y)(qt.A,{containerId:(0,d.$_)(F,ae),reaction:wn,withEffectOnly:li},(0,d.Jj)(wn)),(!wn||li)&&(0,We.Y)(tt.A,{name:"heart",className:(0,g.A)(li&&"story-reaction-heart")})]}),(0,We.FD)(lt.A,{ref:Cs,round:!0,color:"secondary",className:(0,g.A)(ha,"main-button",!m&&"not-ready",As&&"recording"),disabled:cr,allowDisabledClick:!0,noFastClick:!0,ariaLabel:ko(pr),onClick:ur,onContextMenu:ha===Ht.Send&&ma?ga:void 0,children:[(0,We.Y)(tt.A,{name:"send"}),(0,We.Y)(tt.A,{name:"microphone-alt"}),Wn&&(0,We.Y)(tt.A,{name:"forward"}),Vo&&(0,We.Y)(tt.A,{name:"schedule"}),Vo&&(0,We.Y)(tt.A,{name:"check"}),(0,We.Y)(lt.A,{className:(0,g.A)("paidStarsBadge",Pr&&"visible",Tr&&!Pr&&"hiding",!Tr&&!Pr&&"hidden"),nonInteractive:!0,size:"tiny",color:"stars",pill:!0,fluid:!0,children:(0,We.FD)("div",{className:"paidStarsBadgeText",children:[(0,We.Y)(tt.A,{name:"star",className:(0,g.A)("star-amount-icon",gn)}),(0,We.Y)(Gt.A,{ref:To,text:Fo.number(Li)})]})})]}),Fr&&(0,We.Y)("span",{className:"effect-icon",onClick:Mr,children:(0,L.A)(Fr)}),Tn&&Ln&&(0,We.Y)(Ut.A,{shouldPlay:En,effect:Tn,onStop:Nr}),ma&&(0,We.Y)(Ct.A,{isOpen:pa,canSchedule:di&&Vo&&!bs,canScheduleUntilOnline:h&&!bs,onSendSilent:ve?void 0:wr,onSendSchedule:l?void 0:Cr,onSendWhenOnline:br,onRemoveEffect:Mr,onClose:fa,onCloseAnimationEnd:va,isSavedMessages:ve,chatId:F,withEffects:xn,hasCurrentEffect:Boolean(Tn),effectReactions:Dn,allAvailableReactions:fn,onToggleReaction:vr,isCurrentUserPremium:pe,isInSavedMessages:ve,isInStoryViewer:jo,canPlayAnimatedEmojis:yn}),hi,(0,We.Y)($t.A,{isOpen:On,onClose:Ei,userName:ce?(0,c.F9)(Fo,ce):void 0,messagePriceInStars:Pn||0,messagesCount:xi,shouldAutoApprove:Ri,setAutoApprove:Oi,confirmHandler:Bi})]})}))},23459:(e,t,n)=>{n.d(t,{A:()=>m});var o=n(84051),i=n(13439),s=n(90709),a=n(91048),r=n(48899),d=n(37836);const l=36e5,c=new Map;let u=new Set;const h=(0,d.nF)(()=>{const e=Array.from(u),t=e.slice(0,100),n=e.slice(100);(0,i.ko)().loadStoriesMaxIds({peerIds:t}),t.forEach(e=>c.set(e,Date.now())),u=new Set(n),u.size&&h()},500);function m(e){const t=(0,o.Kr)(()=>{const t=(0,i.mS)();return e?.map(e=>(0,a.PVB)(t,e)).filter(Boolean)},[e]),n=(0,o.Kr)(()=>{const e=(0,i.mS)();return t?.filter(t=>{const n=c.get(t.id)||0;if(Date.now()-n<l)return!1;if((0,r.L8)(t.id)){const n=t,o=(0,a.K0y)(e,n.id),i=o&&"userStatusEmpty"!==o.type;return!n.isContact&&!n.isSelf&&!(0,s.tv)(n)&&!t.isSupport&&i}{const n=t,o=(0,a._ls)(e,n.id);return(0,s.WX)(n)&&!o}}).map(e=>e.id)},[t]);(0,o.vJ)(()=>{n?.length&&(n.forEach(e=>u.add(e)),h())},[n])}},23565:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(30857),s=n(73767),a=n(35297);function r(e,t){const n=(0,s.A)(e,!0),r=(0,o.li)(),d=(0,i.A)(),l=null!=e,c=null!=n;return l&&r.current&&(clearTimeout(r.current),r.current=void 0),(0,a.A)(()=>{t&&!l&&c&&!r.current&&(r.current=window.setTimeout(()=>{r.current=void 0,d()},t))},[t,d,l,c]),r.current&&t&&!l?n:e}},24384:(e,t,n)=>{n.d(t,{A:()=>y});var o=n(84051),i=n(13439),s=n(87357),a=n(80140),r=n(22237),d=n(14242),l=n(59852),c=n(19129),u=n(39351),h=n(17712),m=n(68292),p=n(18276),g=n(64493),f=n(26607);const v="PNHSXmwb";var A=n(20021);const y=(0,o.ph)(({topic:e,topics:t,chat:n,isPinned:y,isMuted:C,shouldShowOnlyMostImportant:w,wasTopicOpened:b,forceHidden:I,isSavedDialog:S,hasMiniApp:M,isSelected:N,isOnAvatar:Y,transitionClassName:k,badgeClassName:F})=>{const{requestMainWebView:P}=(0,i.ko)(),T=(0,u.A)(),{unreadMentionsCount:D=0,unreadReactionsCount:x=0}=n.isForum?{}:n,L=!y&&e&&!b,E=n.isForum&&!e,B=(0,o.Kr)(()=>E&&t?Object.values(t).filter(({unreadCount:e})=>e):void 0,[t,E]),R=(0,o.Kr)(()=>E?B?.length:(e||n).unreadCount,[n,e,B,E]),O=(0,o.Kr)(()=>{if(!E)return!C||0===e?.notifySettings.mutedUntil;if(C)return B?.some(e=>0===e.notifySettings.mutedUntil);const t=B?.every(e=>e.notifySettings.mutedUntil&&e.notifySettings.mutedUntil>(0,a.Fm)());return!t},[E,C,B,e?.notifySettings.mutedUntil]),U=!e&&n.hasUnreadMark,K=Boolean((R||U)&&!S),z=!(0,c.A)(()=>(0,r.Hp)(I)?I():I,[I])&&Boolean(R||D||U||y||x||L||M),V=(0,h.A)(e=>{e.stopPropagation();const t=(0,l.A)();P({botId:n.id,peerId:n.id,theme:t})});return(0,A.Y)(f.A,{isCustom:!0,className:(0,s.A)("zGiYriqE",N&&"x5LnLky3",Y&&"ZJcE67F7",k),isOpen:z,children:function(){const e=(0,s.A)("vbb34kEa",!O&&"H0NRx4u_",F),t=x&&(0,A.Y)("div",{className:(0,s.A)(e,"R31SqbQj",v),children:(0,A.Y)(p.A,{name:"heart"})}),n=D&&(0,A.Y)("div",{className:(0,s.A)(e,"IOO6C469",v),children:(0,A.Y)(p.A,{name:"mention"})}),o=L&&(0,A.Y)("div",{className:(0,s.A)(e,"qbAbFaK3")}),i=K?(0,A.Y)("div",{className:(0,s.A)(e,"RqISI7Dg"),children:!U&&(0,A.Y)(m.A,{text:(0,d.Vw)(T,R)})}):void 0,a=y&&(0,A.Y)("div",{className:(0,s.A)(e,"lVbUgp6W"),children:(0,A.Y)(p.A,{name:"pinned-chat"})}),r=M&&(0,A.Y)(g.A,{color:N?"secondary":"primary",className:(0,s.A)(e,"x2AM544v"),pill:!0,size:"tiny",onClick:V,children:T("BotChatMiniAppOpen")}),l=!i&&!n&&!t&&a,c=[o,t,n,i,l].filter(Boolean);return S?a:M&&(0===c.length||l)?r:0!==c.length?1===c.length?c[0]:w?[n,i,t,a].filter(Boolean)[0]:(0,A.Y)("div",{className:"R5lXhuMd",children:c}):void 0}()})})},24899:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(31481);function i(e,t){return t?`${o.jsp}${e}`:`@${e}`}},24920:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051),i=n(30857),s=n(73767);function a(e){const t=(0,i.A)(),n=(0,o.li)(e),a=(0,s.A)(e);return!1===e&&a!==e&&(n.current=!1),{shouldDisableDropdownMenuTransitionRef:n,handleDropdownMenuTransitionEnd:function(){n.current=Boolean(e),t()}}}},25301:(e,t,n)=>{n.d(t,{A:()=>de});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(90709),l=n(27109),c=n(91048),u=n(93005),h=n(87357),m=n(85982),p=n(64713),g=n(83868),f=n(59852),v=n(37959),A=n(24899),y=n(4961),C=n(18501),w=n(68323),b=n(41385),I=n(57675),S=n(82117),M=n(39351),N=n(17712),Y=n(62587),k=n(59030),F=n(38691),P=n(19210),T=n(64493),D=n(22720),x=n(55158),L=n(63152),E=n(87412),B=n(18276),R=n(84685),O=n(96454),U=n(17663);const K=1440,z=10080;function V(){const e=new Date;e.setHours(0,0,0,0);const t=e.getDay(),n=e.getDate()-t+(0===t?-6:1);return new Date(e.setDate(n)).getTime()}function j(e,t){if(0===t)return e;const n=[];for(const o of e){let e=(o.startMinute+t)%z,i=(o.endMinute+t)%z;e<0&&(e+=z),i<=0&&(i+=z),e>i?(n.push({startMinute:e,endMinute:10079}),n.push({startMinute:0,endMinute:i})):n.push({startMinute:e,endMinute:i})}return n.sort((e,t)=>e.startMinute-t.startMinute),n.reduce((e,t)=>{const n=e[e.length-1];return n&&n.endMinute>=t.startMinute?n.endMinute=Math.max(n.endMinute,t.endMinute):e.push(t),e},[])}var G=n(98255),J=n(32625),$=n(19129),q=n(37661),H=n(30857);var W=n(20021);const _=Array.from({length:7},(e,t)=>t),Q=(0,o.ph)(({businessHours:e,className:t})=>{const[n,i,s]=(0,q.A)(!1),[a,r,d]=(0,q.A)(!1),l=(0,k.A)(),c=(0,H.A)(),{startViewTransition:m}=(0,w.Y)(),{createVtnStyle:p}=(0,b.k)();(0,J.A)(c,6e4);const g=(0,G.A)(e=>e.timezones?.byId),f=(0,$.A)(g,[g]),v=(0,o.Kr)(()=>{if(!f)return 0;const t=f[e.timezoneId];return(-60*(new Date).getTimezoneOffset()-t.utcOffset)/60},[e.timezoneId,f]),A=(0,o.Kr)(()=>{const t=V(),n=function(e){const t={};for(const n of e){const e=n.startMinute,o=n.endMinute,i=Math.floor(e/K),s=Math.floor((o-1)/K);for(let n=i;n<=s;n++)t[n]||(t[n]=[]),t[n].push({startMinute:Math.max(0,e-n*K),endMinute:Math.min(K,o-n*K)})}return t}(j(e.workHours,a?v:0)),o={};return _.forEach(e=>{const i=n[e];o[e]=i?i.map(({startMinute:e,endMinute:n})=>n-e===1440?l("BusinessHoursDayFullOpened"):`${(0,U.fU)(l,t+60*e*1e3)} – ${(0,U.fU)(l,t+60*n*1e3)}`):[l("BusinessHoursDayClosed")]}),o},[e.workHours,a,l,v]),y=(0,o.Kr)(()=>{const t=j(e.workHours,v),n=V(),o=((new Date).getTime()-n)/1e3/60;return t.some(({startMinute:e,endMinute:t})=>e<=o&&o<=t)},[e.workHours,v]),C=(0,o.Kr)(()=>(new Date(Date.now()-(a?0:60*v*1e3)).getDay()+6)%7,[a,v]),I=(0,N.A)(()=>{n?m(u.w7,()=>{s()}):m(u.rG,()=>{i()})}),S=(0,N.A)(e=>{e.stopPropagation(),m(u.QG,()=>{a?d():r()})});return(0,W.FD)(D.A,{icon:"clock",iconClassName:"rlM4Mbnn",multiline:!0,className:(0,h.A)("Ef_0p5Qm",t),style:p("businessHours",!0),isStatic:n,ripple:!0,narrow:!0,withColorTransition:!0,onClick:I,children:[(0,W.FD)("div",{className:"nHSmCUNs",children:[(0,W.FD)("div",{className:"JTZ8UnnP",children:[(0,W.Y)("div",{children:l("BusinessHoursProfile")}),(0,W.Y)("div",{className:(0,h.A)("JVL7ZnnJ",y&&"segAfYXs"),children:l(y?"BusinessHoursProfileNowOpen":"BusinessHoursProfileNowClosed")})]}),(0,W.Y)(B.A,{className:"dYxw2cFn",style:p("expandArrow",!0),name:n?"up":"down"})]}),n&&(0,W.FD)("div",{className:"lp9VIV1o",children:[Boolean(v)&&(0,W.Y)("div",{className:"gVwflFhz",style:p("offsetTrigger"),role:"button",tabIndex:0,onMouseDown:O.TF?void 0:S,onClick:O.TF?S:void 0,children:l(a?"BusinessHoursProfileSwitchMy":"BusinessHoursProfileSwitchLocal")}),(0,W.Y)("dl",{className:"MPBKHdZL",children:_.map(e=>(0,W.FD)(W.FK,{children:[(0,W.Y)("dt",{className:(0,h.A)("cmxPqAof",e===C&&"YZVvP_56"),children:(0,U.wv)(l,6===e?0:e+1)}),(0,W.Y)("dd",{className:"Rs0VPgpq",children:A[e].map(e=>(0,W.Y)("div",{children:e}))})]}))})]})]})});var Z=n(66644),X=n(87894),ee=n(58554),te=n(14737),ne=n(82855);const oe=["🎉","🎆","🎈"],ie=(0,o.ph)((0,i.EK)(e=>{const{birthdayNumbers:t,animatedEmojiEffects:n}=e;return{birthdayNumbers:t,animatedEmojiEffects:n,isPremiumPurchaseBlocked:(0,c.n_C)(e)}})(({user:e,birthday:t,isPremiumPurchaseBlocked:n,birthdayNumbers:a,animatedEmojiEffects:r,isInSettings:l})=>{const{openGiftModal:c,requestConfetti:u}=(0,i.ko)(),m=(0,o.li)(),p=(0,o.li)(!1),[g,f,v]=(0,q.A)(),A=(0,M.A)(),{formattedDate:C,isToday:w,age:b}=(0,o.Kr)(()=>{const e=new Date,n=new Date(t.year||2024,t.month-1,t.day);return{formattedDate:(0,U.A)(n,A.code,!0,"long"),isToday:n.getDate()===e.getDate()&&n.getMonth()===e.getMonth(),age:t.year&&se(n)}},[t,A]),I=(0,o.Kr)(()=>{if(!b||!w)return;const e=a?.stickers?.filter(({emoji:e})=>e?.endsWith("️⃣"));if(!e)return;const t=(0,X.dU)(e,"emoji");return b.toString().split("").map(e=>t[e+"️⃣"])},[b,a?.stickers,w]),S=(0,o.Kr)(()=>{if(!w)return;const e=oe[Math.floor(Math.random()*oe.length)];return r?.stickers?.find(({emoji:t})=>t===e)},[r?.stickers,w]);(0,o.vJ)(()=>{if(w&&I&&(I.forEach(e=>{const t=(0,d.Mw)(e,"preview");ee.hd(t,s.qZ.BlobUrl)}),S)){const e=(0,d.Mw)(S,"preview");ee.hd(e,s.qZ.BlobUrl)}},[S,w,I]),(0,te.A)(v,g?3e3:void 0),(0,o.vJ)(()=>{if(g){p.current=!0;const e=document.getElementById(l?"LeftColumn":"RightColumn");if(!e)return;(0,Z.YS)(()=>{const{top:t,left:n,width:o,height:i}=e.getBoundingClientRect();u({top:t,left:n,width:o,height:i,style:"top-down"})})}},[l,g]);const Y=(0,o.Kr)(()=>b?A(`ProfileBirthday${w?"Today":""}ValueYear`,{date:C,age:b},{pluralValue:b}):A(`ProfileBirthday${w?"Today":""}Value`,{date:C}),[b,C,w,A]),k=w&&!e.isPremium&&!e.isSelf&&!n,F=(0,N.A)(()=>{c({forUserId:e.id})}),P=(0,N.A)(()=>{w&&(k&&p.current?F():f())}),T=!w&&!k;return(0,W.FD)("div",{className:"wCp6TBYF",children:[(0,W.FD)(D.A,{icon:"calendar",secondaryIcon:k?"gift":void 0,secondaryIconClassName:"c4HDQNGJ",multiline:!0,narrow:!0,ref:m,ripple:!T,onClick:P,isStatic:T,onSecondaryIconClick:F,children:[(0,W.Y)("div",{className:"title",dir:A.isRtl?"rtl":void 0,children:(0,y.A)(Y)}),(0,W.Y)("span",{className:"subtitle",children:A(w?"ProfileBirthdayToday":"ProfileBirthday")})]}),g&&O.ol&&I?.map((e,t)=>(0,W.Y)("div",{className:(0,h.A)("lQeU96Fj",t>0&&"e1ezfWJb"),style:`--digit-offset: ${t}`,children:(0,W.Y)(ne.A,{containerRef:m,sticker:e,size:128,forceAlways:!0})})),g&&S&&(0,W.Y)("div",{className:"cFEXGUih",children:(0,W.Y)(ne.A,{containerRef:m,sticker:S,size:288,shouldLoop:!0,forceAlways:!0})})]})}));function se(e){const t=new Date;let n=t.getFullYear()-e.getFullYear();const o=t.getMonth()-e.getMonth();return(o<0||0===o&&t.getDate()<e.getDate())&&n--,n}const ae="UZbkeFDB",re={width:64,height:64,zoom:15},de=(0,o.ph)((0,i.EK)((e,{chatOrUserId:t,isSavedDialog:n})=>{const{countryList:{phoneCodes:o}}=e,i=t?(0,c.hds)(e,t):void 0,s=t?(0,c.mBe)(e,t):void 0,a=t?(0,c.XOs)(e,t):void 0,r=i?.isForum,u=i&&(0,l.If)(i,(0,c.K52)(e),(0,c.P5N)(e,i.id)),{threadId:h}=(0,c.Xf0)(e)||{},m=r&&h?Number(h):void 0,p=i&&(0,c.AWZ)(e,i.id),g=s&&(0,c.vGo)(e,s.id),f=g?.botVerification||p?.botVerification,v=p?.inviteLink,A=g?.bio||p?.about,y=i&&(0,d.WX)(i)&&(0,d.SJ)(i),C=i&&!s&&(!(0,d.WX)(i)&&!(0,d.Sq)(i,"inviteUsers")||(0,d.ub)(i,"inviteUsers")),w=m?(0,c.sZk)(e,t,m):void 0,b=!n&&e.chats.listIds.saved?.includes(t),I=g?.personalChannelId?(0,c.hds)(e,g.personalChannelId):void 0,S=s?.hasMainMiniApp;return{phoneCodeList:o,chat:i,user:s,userFullInfo:g,canInviteUsers:C,botAppPermissions:a,isMuted:u,topicId:m,chatInviteLink:v,description:A,topicLink:w,hasSavedMessages:b,personalChannel:I,hasMainMiniApp:S,isBotCanManageEmojiStatus:g?.isBotCanManageEmojiStatus,botVerification:f,canViewSubscribers:y}})(({chatOrUserId:e,user:t,chat:n,userFullInfo:l,isOwnProfile:O,canInviteUsers:U,isMuted:K,phoneCodeList:z,topicId:V,description:j,chatInviteLink:G,topicLink:J,hasSavedMessages:$,personalChannel:q,hasMainMiniApp:H,isBotCanManageEmojiStatus:_,botAppPermissions:Z,botVerification:X,className:ee,isInSettings:te,canViewSubscribers:ne})=>{const{showNotification:oe,updateChatMutedState:se,updateTopicMutedState:de,loadPeerStories:le,openSavedDialog:ce,openMapModal:ue,requestCollectibleInfo:he,requestMainWebView:me,toggleUserEmojiStatusPermission:pe,toggleUserLocationPermission:ge,requestNextManagementScreen:fe}=(0,i.ko)(),{id:ve,usernames:Ae,phoneNumber:ye,isSelf:Ce}=t||{},{id:we,usernames:be}=n||{},Ie=ve||we,{businessLocation:Se,businessWorkHours:Me,personalChannelMessageId:Ne,birthday:Ye,note:ke}=l||{},Fe=(0,k.A)(),Pe=(0,M.A)(),{startViewTransition:Te}=(0,w.Y)(),{createVtnStyle:De}=(0,b.k)(),xe=(0,o.li)(),Le=Boolean(ke),{isCollapsed:Ee,isCollapsible:Be,setIsCollapsed:Re}=(0,I.A)(xe,3,void 0,!Le);(0,S.A)(([e])=>{Ie&&e!==Ie&&(t||n&&(0,d.WX)(n))&&le({peerId:Ie})},[Ie,n,t]);const{width:Oe,height:Ue,zoom:Ke}=re,ze=(0,F.A)(),Ve=Se?.geo&&(0,d.rt)(Se.geo,Oe,Ue,Ke,ze),je=(0,Y.A)(Ve),Ge=(0,o.Kr)(()=>{if(Se?.geo)return je?(0,W.Y)("img",{src:je,alt:"",className:ae}):(0,W.Y)(x.A,{className:ae})},[Se,je]),Je=Boolean(V&&V!==s.l3),$e=n&&(0,d.WX)(n)||t?.isPremium,qe=(0,o.Kr)(()=>{const e=Ae?.filter(e=>e.isActive);return e?.length?e:void 0},[Ae]),He=(0,o.Kr)(()=>{const e=t?void 0:be?.filter(e=>e.isActive);return e?.length?e:void 0},[be,t]),We=(0,o.Kr)(()=>{if(n)return Je?J:(0,d.L7)(n)||G},[n,Je,J,G]),_e=(0,N.A)(()=>{const{address:e,geo:t}=Se;if(!t)return(0,m.eM)(e),void oe({message:Fe("BusinessLocationCopied")});ue({geoPoint:t,zoom:Ke})}),Qe=(0,N.A)(()=>{const e=K?r.Os5:r.xEh;Je?de({chatId:we,topicId:V,mutedUntil:e}):se({chatId:we,mutedUntil:e})}),Ze=(0,N.A)(()=>{t&&pe({botId:t.id,isEnabled:!_})}),Xe=(0,N.A)(()=>{t&&ge({botId:t.id,isAccessGranted:!Z?.geolocation})}),et=(0,N.A)(()=>{ce({chatId:e})}),tt=Be&&Ee,nt=(0,N.A)(()=>{Te(u.Xz,()=>{Re(!1)})}),ot=(0,N.A)(()=>{const e=Ee;Te(e?u.Xz:u.S$,()=>{Re(()=>!e)})});function it(e,t){(0,m.eM)(e),oe({message:`${t} was copied`})}const st=ye&&(0,p.Ox)(z,ye),at=(0,N.A)(()=>{ye?.length===r.PGI&&ye.startsWith(r._Bb)?he({collectible:ye,peerId:Ie,type:"phone"}):it(st,Fe("Phone"))}),rt=(0,N.A)((e,t)=>{e.isEditable?it((0,A.A)(e.username,t),Fe(t?"Link":"Username")):he({collectible:e.username,peerId:Ie,type:"username"})}),dt=(0,N.A)(()=>{fe({screen:a.je.ChannelSubscribers})}),lt=(0,N.A)(()=>{const e=t?.id;if(!e)return;const n=(0,f.A)();me({botId:e,peerId:e,theme:n,shouldMarkBotTrusted:!0})}),ct=Pe("ProfileOpenAppAbout",{terms:(0,W.Y)(R.A,{text:Pe("ProfileOpenAppTerms"),url:Pe("ProfileBotOpenAppInfoLink")})},{withNodes:!0});if((!we||!(0,c._ls)((0,i.mS)(),we))&&(!Ce||O||te))return(0,W.FD)("div",{className:(0,h.A)("ChatExtra",ee),style:De("chatExtra"),children:[q&&(0,W.FD)("div",{className:"HP5EJx7s",style:De("personalChannel"),children:[(0,W.Y)("h3",{className:"cHyTGri2",children:Fe("ProfileChannel")}),(0,W.Y)("span",{className:"kYd2GrmU",children:Fe("Subscribers",q.membersCount,"i")}),(0,W.Y)(P.A,{chatId:q.id,orderDiff:0,shiftDiff:0,animationType:v.IP.None,isPreview:!0,previewMessageId:Ne,className:"qOJwhXMC"})]}),Boolean(st?.length)&&(0,W.FD)(D.A,{icon:"phone",className:"Kz3Kt7V9",multiline:!0,narrow:!0,ripple:!0,onClick:at,style:De("phone"),children:[(0,W.Y)("span",{className:"title",dir:Pe.isRtl?"rtl":void 0,children:st}),(0,W.Y)("span",{className:"subtitle",children:Fe("Phone")})]}),qe&&ut(qe),j&&Boolean(j.length)&&(0,W.FD)(D.A,{icon:"info",className:"sfYp5akl",multiline:!0,narrow:!0,isStatic:!0,allowSelection:!0,style:De("description"),children:[(0,W.Y)("span",{className:"title word-break allow-selection",dir:Pe.isRtl?"rtl":void 0,children:(0,y.A)(j,["br",$e?"links":"tg_links","emoji"])}),(0,W.Y)("span",{className:"subtitle",children:Fe(ve?"UserBio":"Info")})]}),He&&!Je&&ut(He,!0),(!He&&U||Je)&&We&&(0,W.FD)(D.A,{icon:"link",multiline:!0,className:"I6wEM4Gg",narrow:!0,ripple:!0,onClick:()=>it(We,Fe("SetUrlPlaceholder")),style:De("link"),children:[(0,W.Y)("div",{className:"title",children:We}),(0,W.Y)("span",{className:"subtitle",children:Fe("SetUrlPlaceholder")})]}),Ye&&(0,W.Y)(ie,{birthday:Ye,user:t,isInSettings:te},Ie),H&&(0,W.FD)(D.A,{multiline:!0,className:"GQTzMGTi",isStatic:!0,narrow:!0,style:De("miniapp"),children:[(0,W.Y)(T.A,{className:"x925YeS3",onClick:lt,children:Fe("ProfileBotOpenApp")}),(0,W.Y)("div",{className:"IrqRJFxm",children:ct})]}),!O&&!te&&(0,W.FD)(D.A,{icon:K?"mute":"unmute",className:"RBvIJLG2",narrow:!0,ripple:!0,onClick:Qe,style:De("notifications"),children:[(0,W.Y)("span",{children:Pe("Notifications")}),(0,W.Y)(L.A,{id:"group-notifications",label:Pe(ve?"AriaToggleUserNotifications":"AriaToggleChatNotifications"),checked:!K,inactive:!0})]}),Me&&(0,W.Y)(Q,{businessHours:Me}),Se&&(0,W.FD)(D.A,{icon:"location",ripple:!0,multiline:!0,narrow:!0,className:"_xXKFqUd",style:De("location"),rightElement:Ge,onClick:_e,children:[(0,W.Y)("div",{className:"title",children:Se.address}),(0,W.Y)("span",{className:"subtitle",children:Fe("BusinessProfileLocation")})]}),Le&&(0,W.FD)(D.A,{icon:"note",iconClassName:"tzdaXm4b",multiline:!0,narrow:!0,isStatic:!0,allowSelection:!0,className:"NTIM9Ilb",style:De("note"),children:[(0,W.Y)("div",{ref:xe,className:(0,h.A)("title","word-break","allow-selection","wfFIBsS9",Ee&&"XDGCHF3C"),style:De("noteText",!0),dir:Pe.isRtl?"rtl":void 0,onClick:tt?nt:void 0,children:(0,C.fd)({text:ke.text,entities:ke.entities})}),(0,W.FD)("div",{className:(0,h.A)("subtitle","PZmqBGnF"),style:De("noteSubtitle"),children:[(0,W.Y)("span",{children:Pe("UserNoteTitle")}),(0,W.Y)("span",{className:"ULBE6izv",children:Pe("UserNoteHint")}),Be&&(0,W.Y)(B.A,{className:(0,h.A)("sUNntQ81","emWTh6l1"),style:De("noteExpandIcon",!0),onClick:ot,name:Ee?"down":"up"})]})]}),$&&!O&&!te&&(0,W.Y)(D.A,{icon:"saved-messages",className:"zOAUgAZz",narrow:!0,ripple:!0,onClick:et,style:De("savedMessages"),children:(0,W.Y)("span",{children:Fe("SavedMessagesTab")})}),l&&"isBotAccessEmojiGranted"in l&&(0,W.FD)(D.A,{icon:"user",className:"wlATcqd6",narrow:!0,ripple:!0,onClick:Ze,style:De("botEmojiStatus"),children:[(0,W.Y)("span",{children:Fe("BotProfilePermissionEmojiStatus")}),(0,W.Y)(L.A,{label:Fe("BotProfilePermissionEmojiStatus"),checked:_,inactive:!0})]}),void 0!==Z?.geolocation&&(0,W.FD)(D.A,{icon:"location",className:"AM09D0iF",narrow:!0,ripple:!0,onClick:Xe,style:De("botLocation"),children:[(0,W.Y)("span",{children:Fe("BotProfilePermissionLocation")}),(0,W.Y)(L.A,{label:Fe("BotProfilePermissionLocation"),checked:Z?.geolocation,inactive:!0})]}),ne&&(0,W.FD)(D.A,{icon:"group",narrow:!0,multiline:!0,ripple:!0,className:"nKT9b7NU",onClick:dt,style:De("subscribers"),children:[(0,W.Y)("div",{className:"title",children:Pe("ProfileItemSubscribers")}),(0,W.Y)("span",{className:"subtitle",children:Pe.number(n?.membersCount||0)})]}),X&&(0,W.FD)("div",{className:"RWFu5ENh",style:De("botVerification"),children:[(0,W.Y)(E.A,{className:"b32hsSPS",documentId:X.iconId,size:16}),X.description]})]});function ut(e,t){const[n,...o]=e,i=o.length?Fe("UsernameAlso","%USERNAMES%").split("%").map(e=>"USERNAMES"===e?(0,W.Y)(W.FK,{children:o.map((e,n)=>(0,W.FD)(W.FK,{children:[n>0?", ":"",(0,W.Y)("a",{href:(0,A.A)(e.username,!0),onMouseDown:g.A,onClick:n=>{(0,g.A)(n),rt(e,t)},className:"text-entity-link username-link",children:(0,A.A)(e.username)},e.username)]}))}):e):void 0;return(0,W.FD)(D.A,{icon:t?"link":"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>{rt(n,t)},children:[(0,W.Y)("span",{className:"title",dir:Pe.isRtl?"rtl":void 0,children:(0,A.A)(n.username,t)}),(0,W.FD)("span",{className:"subtitle",children:[i&&(0,W.Y)("span",{className:"other-usernames",children:i}),Fe(t?"Link":"Username")]})]})}}))},25477:(e,t,n)=>{n.d(t,{A:()=>k});var o=n(84051),i=n(13439),s=n(90709),a=n(87357),r=n(17663),d=n(58554),l=n(76023),c=n(35127),u=n(84313),h=n(43874),m=n(37661),p=n(5912),g=n(17712),f=n(62587),v=n(37960),A=n(69419),y=n(73767),C=n(34201),w=n(61097),b=n(18276),I=n(27860),S=n(14413),M=n(65843),N=n(35913),Y=n(20021);const k=(0,o.ph)((0,i.EK)(e=>({needsAgeVerification:e.appConfig.needAgeVideoVerification}))(({id:e,video:t,isOwn:n,isInWebPage:k,noAvatars:F,canAutoLoad:P,canAutoPlay:T,uploadProgress:D,forcedWidth:x,dimensions:L,asForwarded:E,isDownloading:B,isProtected:R,className:O,lastPlaybackTimestamp:U,clickArg:K,isMediaNsfw:z,observeIntersectionForLoading:V,observeIntersectionForPlaying:j,onClick:G,onCancelUpload:J,needsAgeVerification:$})=>{const{cancelMediaDownload:q,updateContentSettings:H,openAgeVerificationModal:W}=(0,i.ko)(),_=(0,o.li)(),Q=(0,o.li)(),[Z,X,ee]=(0,m.A)(),[te,ne]=(0,o.J0)(!1),oe="extendedMediaPreview"===t.mediaType,ie=oe?void 0:t.blobUrl,se=oe||t.isSpoiler||z,[ae,re,de]=(0,m.A)(se);(0,o.vJ)(()=>{se?re():de()},[se]);const le=(0,g.A)(()=>{ee(),de(),te&&H({isSensitiveEnabled:!0})}),ce=(0,p.Vz)(_,V),ue=(0,p.Vz)(_,j)&&ce,he=(0,o.li)(ce);ue&&!he.current&&(he.current=!0);const{isMobile:me}=(0,h.Ay)(),[pe,ge]=(0,o.J0)(P),fe=Boolean(pe&&ce&&!oe),[ve,Ae]=(0,o.J0)(Boolean(T&&!ae)),ye=oe?void 0:(0,s.sC)(t,"inline"),[Ce]=(0,o.J0)(Boolean(ye&&d.Ih(ye))),{mediaData:we,loadProgress:be}=(0,A.A)(ye,!fe,oe?void 0:(0,s.Cz)(t,"inline")),Ie=ie||we,[Se,Me]=(0,m.A)(),Ne=(0,s.VD)(t),Ye=Boolean(Ne),ke=Boolean(x),Fe=Ie&&he.current,Pe=(0,u.A)(Q,!0,!Fe),Te=oe?void 0:(0,s.sC)(t,"preview"),[De]=(0,o.J0)(Boolean(Te&&d.Ih(Te))),xe=ce,Le=(0,f.A)(Te,!xe),Ee=Se&&!Pe,{ref:Be}=(0,v.A)({hasMediaData:Boolean((Ye||Le)&&!Ee)}),Re=Boolean(!Ye||Le||Se),Oe=(0,w.A)(t,Re);(0,v.A)({ref:Oe,hasMediaData:!Re});const Ue=(0,w.A)(t,!ke),{loadProgress:Ke}=(0,A.A)(oe?void 0:(0,s.sC)(t,"download"),!B,oe?void 0:(0,s.Cz)(t,"download")),{isUploading:ze,isTransferring:Ve,transferProgress:je}=(0,s.LK)(D||(B?Ke:be),fe&&!Se&&!Ce||B,void 0!==D),Ge=!1===(0,y.A)(pe),{ref:Je,shouldRender:$e}=(0,C.A)({isOpen:Ve&&!Pe,noMountTransition:Ge,withShouldRender:!0}),{ref:qe}=(0,C.A)({isOpen:Boolean((pe||Ie)&&!ve&&!$e)}),{ref:He,shouldRender:We}=(0,C.A)({isOpen:Ve&&(!Pe||B),noMountTransition:Ge,withShouldRender:!0}),[_e,Qe]=(0,o.J0)(0),Ze=(0,g.A)(e=>{Qe(Math.max(0,e.currentTarget.currentTime-1))}),Xe=(Number.isFinite(Q.current?.duration)&&!Pe?Q.current?.duration:t.duration)||0,{width:et,height:tt}=L||(oe?(0,l.ri)(t,Boolean(n),E,k,F,me):(0,l.rO)(t,Boolean(n),E,k,F,me)),nt=(0,g.A)((e,n)=>{if(ze)J?.(K);else if(oe||!B){if(Ie)return Ie&&!ve&&Ae(!0),ae?z?$?void W():void X():void de():n&&fe&&!Se&&!Ce?(ge(!1),void e.stopPropagation()):void G?.(K,e);ge(e=>!e)}else q({media:t})}),ot=(0,g.A)(e=>{nt(e,!0)}),it=(0,a.A)("media-inner dark",!ze&&"interactive",tt<c.ej&&"fix-min-height",O),st=`height: ${tt}px;${L?` width: ${et}px; left: ${L.x}px; top: ${L.y}px;`:""}`;return(0,Y.FD)("div",{ref:_,id:e,className:it,style:st,onClick:ze?void 0:e=>nt(e),children:[ke&&(0,Y.Y)("canvas",{ref:Ue,className:"thumbnail blurred-bg"}),Fe&&(0,Y.Y)(M.A,{ref:Q,src:Ie,className:(0,a.A)("full-media",ke&&"with-blurred-bg"),canPlay:ve&&ue&&!Pe,defaultMuted:!0,muted:!0,loop:!0,playsInline:!0,disablePictureInPicture:!0,draggable:!R,onTimeUpdate:Ze,onReady:Me,style:x?`width: ${x}px`:void 0}),(0,Y.Y)("img",{ref:Be,src:Le,className:(0,a.A)("thumbnail",ke&&"with-blurred-bg"),alt:"",style:x?`width: ${x}px;`:void 0,draggable:!R}),Ye&&!De&&(0,Y.Y)("canvas",{ref:Oe,className:"thumbnail"}),R&&(0,Y.Y)("span",{className:"protector"}),(0,Y.Y)(b.A,{ref:qe,name:"large-play"}),(0,Y.Y)(I.A,{isVisible:ae,withAnimation:!0,thumbDataUri:Ne,isNsfw:z,width:et,height:tt,className:"media-spoiler"}),$e&&(0,Y.Y)("div",{ref:Je,className:"media-loading",children:(0,Y.Y)(N.A,{progress:je,onClick:ot})}),!pe&&!Ie&&(0,Y.Y)(b.A,{name:"download"}),We?(0,Y.Y)("span",{ref:He,className:"message-transfer-progress",children:ze||B?`${Math.round(100*je)}%`:"..."}):(0,Y.FD)("div",{className:"message-media-duration",children:[!oe&&t.isGif?"GIF":(0,r.QO)(Math.max(Xe-_e,0)),Pe&&(0,Y.Y)(b.A,{name:"message-failed",className:"playback-failed"})]}),Boolean(U)&&(0,Y.Y)("div",{className:"message-media-last-progress",style:`--_progress: ${Math.floor(U/Xe*100)}%`}),(0,Y.Y)(S.A,{isOpen:Z,onClose:ee,shouldAlwaysShow:te,onAlwaysShowChanged:ne,confirmHandler:le})]})}))},25498:(e,t,n)=>{n.d(t,{A:()=>T});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(91048),d=n(52491),l=n(36353),c=n(87894),u=n(79824),h=n(37830),m=n(4961),p=n(58734),g=n(17778),f=n(63988),v=n(83414),A=n(37661),y=n(17712);let C,w,b,I,S;const M=36,N=2,Y=300,k=(0,h.A)(function(e,t,n){return e&&t.length?Object.values((0,c._E)(e,t)).slice(0,n):u.p}),F=(0,h.A)(function(e,t,n){const o=Object.values(e),i=(0,c.dU)(o,"native"),s=t?(0,c.LG)(t,e=>Object.values((0,c._E)(i,e))):{},a=n?(0,c.LG)(n,e=>Object.values((0,c._E)(i,e))):{},r={...s,...a},d=[].concat(Object.keys(s),Object.keys(a)),l=o.reduce((e,t)=>(t.names.forEach(n=>{e[n]||(e[n]=[]),e[n].push(t)}),e),{}),u=Object.keys(l),h=d.reduce((e,t)=>Math.max(e,t.length),0);return{byKeyword:r,keywords:d,byName:l,names:u,maxKeyLength:h}}),P=(0,h.A)(function(e,t,n){const{byKeyword:o,keywords:i,byName:s,names:a,maxKeyLength:r}=e;let d=[];if(t.length>r)return u.p;const l=i.filter(e=>e.startsWith(t)).sort();d=d.concat(Object.values((0,c._E)(o,l)).flat());const h=a.filter(e=>e.startsWith(t));return d=d.concat(Object.values((0,c._E)(s,h)).flat()),d=(0,c.Am)(d),d.length?d.slice(0,n):u.p});try{I=/(^|\s):(?!\s)[-+_:'\s\p{L}\p{N}]*$/giu,S=/\p{Ll}/u}catch(e){I=/(^|\s):(?!\s)[-+_:'\s\d\wа-яёґєії]*$/gi,S=/[a-zяёґєії]/}function T(e,t,h,T=s.CfG,D,x,L){const[E,B,R]=(0,A.A)(!1),[O,U]=(0,o.J0)(),[K,z]=(0,o.J0)(u.p),[V,j]=(0,o.J0)(u.p);(0,o.vJ)(()=>{function t(){U(b.emojis)}e&&(b?t():async function(){return C||(C=n.e(996).then(n.t.bind(n,20996,19)),w=(await C).default,b=(0,d.cp)(w)),C}().then(t))},[e]);const G=(0,f.gs)(()=>{const n=t();return e&&n.includes(":")?(0,g.S)(n).match(I)?.[0].trim():void 0},[t,e],Y),J=(0,v.A)(G,[G,t],!0),$=(0,y.A)(e=>{if(z(e),e===u.p)return void j(u.p);const t=e.map(e=>e.native),n=(0,c.Xd)((0,r.oZ0)((0,i.mS)(),t),"id");j(n)}),q=(0,y.A)((e,n=!1)=>{const o=t();if(!o)return;const i=o.lastIndexOf(":",n?o.lastIndexOf(":")-1:void 0);if(-1!==i){const t="string"==typeof e?(0,m.A)(e,["emoji_html"])[0]:(0,p.hB)(e);h(`${o.substring(0,i)}${t}`);const n=T===s.CfG?document.querySelector(s.m$5):document.getElementById(T);(0,a.Uz)(()=>{(0,l.A)(n,!0,!0)})}$(u.p)});return(0,o.vJ)(()=>{const e=J();if(!e||!O)return void $(u.p);const t=e.length>2&&e.endsWith(":"),n=e.substring(1,t?1+e.length-2:void 0);let o=u.p;if(n){if(1===n.length&&S.test(n)||n.length>=N){const e=F(O,x,L);o=P(e,n.toLowerCase(),M)}}else o=k(O,D,M);o.length?t?q(o[0].native,!0):$(o):$(u.p)},[x,O,J,L,q,D,$]),(0,o.vJ)(R,[R,t]),{isEmojiTooltipOpen:Boolean(K.length||V.length)&&!E,closeEmojiTooltip:B,filteredEmojis:K,filteredCustomEmojis:V,insertEmoji:q}}},25897:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"CustomEmojiTooltip",!t);return n?(0,s.Y)(n,{...e}):void 0}},26087:(e,t,n)=>{n.d(t,{A:()=>p});var o=n(84051),i=n(13439),s=n(91048),a=n(99375),r=n(4961),d=n(37661),l=n(39351),c=n(64493),u=n(22337),h=n(20021);function m(e){return e.isSlowMode?"Slowmode enabled":e.hasErrorKey?"Something went wrong":"Telegram"}const p=(0,o.ph)((0,i.EK)(e=>({dialogs:(0,s.nTw)(e).dialogs,currentMessageList:(0,s.Xf0)(e)}))(({dialogs:e,currentMessageList:t})=>{const{dismissDialog:n,sendMessage:s}=(0,i.ko)(),[p,g,f]=(0,d.A)(),v=(0,l.A)();var A,y,C;if((0,o.vJ)(()=>{e.length>0&&g()},[e,g]),e.length)return Boolean(e.length)&&("phoneNumber"in(A=e[e.length-1])?(y=A,(0,h.FD)(u.A,{isOpen:p,onClose:f,className:"confirm",title:v("ShareYouPhoneNumberTitle"),onCloseAnimationEnd:n,children:[v("AreYouSureShareMyContactInfoBot",void 0,{withNodes:!0,withMarkdown:!0,renderTextFilters:["br"]}),(0,h.FD)("div",{className:"dialog-buttons mt-2",children:[(0,h.Y)(c.A,{className:"confirm-dialog-button",isText:!0,onClick:()=>{t&&(s({contact:y,messageList:t}),f())},children:v("OK")}),(0,h.Y)(c.A,{className:"confirm-dialog-button",isText:!0,onClick:f,children:v("Cancel")})]})]})):(C=A,(0,h.FD)(u.A,{isOpen:p,onClose:f,onCloseAnimationEnd:n,className:"error",title:m(C),children:[C.hasErrorKey?(0,a.Ay)(C):(0,r.A)(C.message,["simple_markdown","emoji","br"]),(0,h.Y)("div",{className:"dialog-buttons mt-2",children:(0,h.Y)(c.A,{isText:!0,onClick:f,children:v("OK")})})]})))}))},26440:(e,t,n)=>{n.d(t,{A:()=>v});var o=n(84051),i=n(13439),s=n(31481),a=n(87357),r=n(37661),d=n(17712),l=n(18276),c=n(64493),u=n(66469),h=n(57474),m=n(80089),p=n(80464),g=n(20021);const f=e=>{const{isOpen:t}=e,n=(0,p.A)(m.ar.Extra,"SymbolMenu",!t);return n?(0,g.Y)(n,{...e}):void 0},v=(0,o.ph)(({chatId:e,threadId:t,isMobile:n,canSendGifs:m,canSendStickers:p,isMessageComposer:v,isReady:A,isSymbolMenuOpen:y,idPrefix:C,isAttachmentModal:w,canSendPlainText:b,isSymbolMenuForced:I,className:S,forceDarkTheme:M,inputCssSelector:N=s.m$5,openSymbolMenu:Y,closeSymbolMenu:k,onCustomEmojiSelect:F,onStickerSelect:P,onGifSelect:T,onRemoveSymbol:D,onEmojiSelect:x,closeBotCommandMenu:L,closeSendAsMenu:E})=>{const{setStickerSearchQuery:B,setGifSearchQuery:R,addRecentEmoji:O,addRecentCustomEmoji:U}=(0,i.ko)(),K=(0,o.li)(),[z,V]=(0,r.A)(),[j,G]=(0,o.J0)(void 0),J=(0,a.A)("composer-action-button mobile-symbol-menu-button",!A&&"not-ready",z?y&&"menu-opened":y&&"is-loading"),$=(0,d.A)(()=>{L?.(),E?.(),Y();const e=K.current;if(!e)return;const{x:t,y:n}=e.getBoundingClientRect();G({x:t,y:n})}),q=(0,d.A)(e=>{"stickers"===e?(B({query:""}),R({query:void 0})):(R({query:""}),B({query:void 0}))}),H=(0,d.A)(()=>{const e=document.querySelector(w?s.wVm:N);n&&e===document.activeElement?(e?.blur(),setTimeout(()=>{L?.(),Y()},100)):Y()}),W=(0,d.A)(()=>K.current),_=(0,d.A)(()=>K.current?.closest(".custom-scroll, .no-scrollbar")),Q=(0,d.A)(()=>document.querySelector("#portals .SymbolMenu .bubble")),Z=(0,d.A)(()=>({withPortal:!0}));return(0,g.FD)(g.FK,{children:[n?(0,g.FD)(c.A,{className:J,round:!0,color:"translucent",onClick:y?k:H,ariaLabel:"Choose emoji, sticker or GIF",children:[(0,g.Y)(l.A,{name:"smile"}),(0,g.Y)(l.A,{name:"keyboard"}),y&&!z&&(0,g.Y)(h.A,{color:"gray"})]}):(0,g.FD)(u.A,{className:(0,a.A)("composer-action-button symbol-menu-button",y&&"activated"),round:!0,color:"translucent",onActivate:$,ariaLabel:"Choose emoji, sticker or GIF",children:[(0,g.Y)("div",{ref:K,className:"symbol-menu-trigger"}),(0,g.Y)(l.A,{name:"smile"})]}),(0,g.Y)(f,{chatId:e,threadId:t,isOpen:y||Boolean(I),canSendGifs:m,canSendStickers:p,isMessageComposer:v,idPrefix:C,onLoad:V,onClose:k,onEmojiSelect:x,onStickerSelect:P,onCustomEmojiSelect:F,onGifSelect:T,onRemoveSymbol:D,onSearchOpen:q,addRecentEmoji:O,addRecentCustomEmoji:U,isAttachmentModal:w,canSendPlainText:b,className:(0,a.A)(S,M&&"component-theme-dark"),anchor:w?j:void 0,getTriggerElement:w?W:void 0,getRootElement:w?_:void 0,getMenuElement:w?Q:void 0,getLayout:w?Z:void 0})]})})},31880:(e,t,n)=>{n.d(t,{A:()=>m,a:()=>l});var o=n(13439),i=n(91048),s=n(87894),a=n(42215);const r=["includedChatIds","bots","channels","groups","contacts","nonContacts"],d=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function l(e,t,n){let a=[],l=[];if("included"===t){const{includedChatIds:t,...o}=n?e.includeFilters||{}:(0,s.Up)(e.folder,r);a=t||[],l=Object.keys(o).filter(e=>Boolean(o[e]))}else{const{excludedChatIds:t,...o}=n?e.excludeFilters||{}:(0,s.Up)(e.folder,d);a=t||[],l=Object.keys(o).filter(e=>Boolean(o[e]))}const c=(0,o.mS)();return{selectedChatIds:a.filter(e=>(0,i.hds)(c,e)),selectedChatTypes:l}}function c(e){if(e){const{includedChatIds:t,...n}=e;if(Object.values(n).filter(Boolean).length>1||t?.length)return"";if(n.bots)return"Bots";if(n.groups)return"Groups";if(n.channels)return"Channels";if(n.contacts)return"Contacts";if(n.nonContacts)return"Non-Contacts"}return""}const u={mode:"create",chatFilter:"",folder:{title:{text:""},includedChatIds:[],excludedChatIds:[]}},h=(e,t)=>{switch(t.type){case"setTitle":return{...e,folder:{...e.folder,title:"string"==typeof t.payload?{...e.folder.title,text:t.payload}:{...e.folder.title,...t.payload}},isTouched:!0};case"setFolderId":return{...e,folderId:t.payload,mode:"edit"};case"editIncludeFilters":return{...e,includeFilters:(0,s.Up)(e.folder,r)};case"editExcludeFilters":return{...e,excludeFilters:(0,s.Up)(e.folder,d)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...(0,s.cJ)(e.folder,r),title:e.folder.title?e.folder.title:{text:c(e.includeFilters)},...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...(0,s.cJ)(e.folder,d),...e.excludeFilters},excludeFilters:void 0,chatFilter:"",isTouched:!0}:e;case"editFolder":{const{id:e,...n}=t.payload;return{mode:"edit",folderId:e,folder:n,chatFilter:""}}case"setChatFilter":return{...e,chatFilter:t.payload};case"setIsTouched":return{...e,isTouched:t.payload};case"setIsLoading":return{...e,isLoading:t.payload};case"setError":return{...e,isLoading:!1,error:t.payload};case"setIsChatlist":return{...e,folder:{...e.folder,isChatList:t.payload}};case"setColor":return{...e,folder:{...e.folder,color:t.payload},isTouched:!0};case"setEmoticon":return{...e,folder:{...e.folder,emoticon:t.payload},isTouched:!0};case"reset":return u;default:return e}},m=()=>(0,a.A)(h,u)},34458:(e,t,n)=>{n.d(t,{$:()=>v,UG:()=>c,wV:()=>f});var o=n(31481),i=n(66644),s=n(19822),a=n(83868),r=n(76023),d=n(2429),l=n(17169);const c=250,u=.25*r.$,h=11,m=.1875*r.$,p=.125*r.$,g=new Set;function f(e){I();const{container:t,toggler:n,leftMainHeader:a,ribbonPeers:r,toggleAvatars:d,sidebar:p}=A(e);if(!(n&&d&&r&&t&&a))return;const{bottom:f,right:v}=a.getBoundingClientRect(),S=f+u,M=p?p.getBoundingClientRect().width:0,N=d[0],Y=d[d.length-1],k=C(N);Array.from(r).reverse().forEach((e,a,{length:r})=>{const d=C(e);if(!d)return;const u=d===k;let p=w(n,d),f=h+a+1;if(p||(p=a===r-1?Y:N,f=h),!p)return;let{top:A,left:I,width:F}=p.getBoundingClientRect();I-=M;const P=e.getBoundingClientRect(),T=P.left-M,D=P.width;if(T>v)return;I-=m,F+=2*m;const x=I-T,L=A-S,E=F/D;A-=m;const B=T-I+2*m,R=S-A+m,O=D/(F+2*m);(0,i.RK)(()=>{if(!p)return;const n=y(e);let a;f>h?(a=y(p),u&&a.classList.add(l.A.ghostLast)):n.classList.add(l.A.ghostAnimateName),(0,s.ZM)(n,{top:`${S}px`,left:`${T}px`,zIndex:String(f),opacity:a?"0":"",transform:`translate3d(${x}px, ${L}px, 0) scale(${E})`}),a&&(0,s.ZM)(a,{top:`${A}px`,left:`${I}px`,zIndex:String(f)}),t.appendChild(n),a&&t.appendChild(a),p.classList.add("animating"),e.classList.add("animating"),(0,i.RK)(()=>{(0,s.ZM)(n,{opacity:"",transform:""}),a?(0,s.ZM)(a,{opacity:"0",transform:`translate3d(${B}px, ${R}px, 0) scale(${O})`}):n.classList.add(l.A.ghostRevealName);const r=b(()=>{(0,i.RK)(()=>{t.contains(n)&&t.removeChild(n),a&&t.contains(a)&&t.removeChild(a),p?.classList.remove("animating"),e.classList.remove("animating"),g.delete(r)})},c+o.xB5);g.add(r)})})})}function v(e){I();const{container:t,toggler:n,toggleAvatars:a,ribbonPeers:r,leftMainHeader:d,sidebar:u}=A(e);if(!(n&&a&&r&&t&&d))return;const{right:f}=d.getBoundingClientRect(),v=u?u.getBoundingClientRect().width:0,S=a[0],M=a[a.length-1],N=C(S);Array.from(r).reverse().forEach((e,a,{length:r})=>{const d=C(e);if(!d)return;const u=d===N;let A=w(n,d),I=h+a+1;if(A||(A=a===r-1?M:S,I=h),!A)return;const Y=e.getBoundingClientRect(),k=Y.top,F=Y.left-v,P=Y.width;let{left:T,width:D,top:x}=A.getBoundingClientRect();if(T-=v,F>f)return;T-=m,D+=2*m;const L=T-F,E=x-k-p,B=D/P;x-=m;const R=F-T+2*m,O=k-x+m,U=P/(D+2*m);(0,i.RK)(()=>{const n=y(e);let a;I>h?(a=y(A),u&&a.classList.add(l.A.ghostLast)):n.classList.add(l.A.ghostAnimateName,l.A.ghostRevealName),(0,s.ZM)(n,{top:`${k}px`,left:`${F}px`,width:`${P}px`,zIndex:String(I)}),a&&(0,s.ZM)(a,{top:`${x}px`,left:`${T}px`,zIndex:String(I),opacity:"0",transform:`translate3d(${R}px, ${O}px, 0) scale(${U})`}),e.classList.add("animating"),A.classList.add("animating"),t.appendChild(n),a&&t.appendChild(a),(0,i.RK)(()=>{(0,s.ZM)(n,{opacity:a?"0":"",transform:`translate3d(${L}px, ${E}px, 0) scale(${B})`}),a?(0,s.ZM)(a,{opacity:"",transform:""}):n.classList.remove(l.A.ghostRevealName);const r=b(()=>{(0,i.RK)(()=>{t.contains(n)&&t.removeChild(n),a&&t.contains(a)&&t.removeChild(a),e.classList.remove("animating"),A.classList.remove("animating")}),g.delete(r)},c+o.xB5);g.add(r)})})})}function A(e){let t=document.getElementById("LeftColumn");if(t&&e&&(t=t.querySelector(".ArchivedChats")),!t)return{};const n=t.querySelector("#StoryToggler"),o=t.querySelector("#StoryRibbon"),i=t.querySelector(".left-header"),s=o?.querySelectorAll(`.${d.A.peer}`),a=n?.querySelectorAll(".Avatar");return{container:t,toggler:n,leftMainHeader:i,ribbonPeers:s,toggleAvatars:a,sidebar:document.getElementById("FoldersSidebar")}}function y(e){const t=e.cloneNode(!0);t.classList.add(l.A.ghost),t.classList.remove("animating"),t.draggable=!1,t.oncontextmenu=a.A;const n=e.querySelector("canvas");if(n){const e=t.querySelector("canvas");e?.getContext("2d")?.drawImage(n,0,0)}return t}function C(e){return e?.getAttribute("data-peer-id")}function w(e,t){return e?.querySelector(`[data-peer-id="${t}"]`)}function b(e,t){const n=setTimeout(e,t);return()=>{clearTimeout(n),e()}}function I(){g.forEach(e=>e()),g.clear()}},35127:(e,t,n)=>{n.d(t,{Ay:()=>d,ej:()=>r,nP:()=>l,yA:()=>c});var o=n(76023);const i=12,s=40,a=i*o.$,r=5*o.$;function d(e){return(e?14:20)*o.$}function l(e="",t,n){return e.length>s||n?d(t):a}function c({media:e,messageText:t,isOwn:n,isInWebPage:s,asForwarded:a,noAvatars:d,isMobile:c}){const u="photo"===e.mediaType,h="video"===e.mediaType,m=u&&s,p=h&&s,{width:g,height:f}=u?(0,o.ck)(e,n,a,m,d,c):h?(0,o.rO)(e,n,a,p,d,c):(0,o.ri)(e,n,a,s,d,c),v=l(t,c);let A=1;g<v&&v-g<i&&(A=v/g),f*A<r&&r-f*A<i&&(A=r/f);const y=Math.round(g*A),C=Math.round(f*A);return{width:y,height:C,isSmall:y<v||C<r}}},35749:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(77312),i=n(63527);function s(e){return e.messages.webPageById}function a(e,t){const n=(0,i.A)(s);if(!e)return;const a=e.content.webPage?.id,r=a?n[a]:void 0;return(0,o.EO)(e,{webPage:r},t)}},36353:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(96454);function i(e,t,n){if(!t&&e===document.activeElement)return;const i=window.getSelection(),s=document.createRange(),a=e.lastChild||e;o.TF||n||a&&a.nodeValue?(s.selectNodeContents(n?e:a),s.collapse(!1),i.removeAllRanges(),i.addRange(s)):e.focus()}},36680:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(84051),i=n(96454),s=n(17712);const a=250;let r;function d(e,t,n=a,d=!1){const l=(0,o.li)(!1),c=(0,s.A)(()=>{l.current=!0});return(0,o.vJ)(()=>{r&&(clearTimeout(r),r=void 0),!e||i.TF||d||(r=window.setTimeout(()=>{l.current||t()},2*n))},[d,e,n,t]),[(0,s.A)(()=>{l.current=!0}),(0,s.A)(()=>{l.current=!1,r&&(clearTimeout(r),r=void 0),r=window.setTimeout(()=>{l.current||t()},n)}),c]}},37378:(e,t,n)=>{n.d(t,{A:()=>y});var o=n(84051),i=n(13439),s=n(90709),a=n(91048),r=n(87357),d=n(17663),l=n(58849),c=n(49086),u=n(4961),h=n(39351),m=n(17712),p=n(59030),g=n(96530),f=n(81524),v=n(84685),A=n(20021);const y=(0,o.ph)((0,i.EK)((e,{message:t})=>({webPage:(0,a.Pn$)(e,t)}))(({message:e,webPage:t,senderTitle:n,isProtected:i,observeIntersection:a,onMessageClick:y})=>{const C=(0,h.A)(),w=(0,p.A)(),b=(0,m.A)(()=>{y(e)});let I=t;if(!I){const t=(0,s.ZD)(e);if(t){const{url:n,domain:o}=t;I={mediaType:"webpage",webpageType:"full",id:"",displayUrl:n,siteName:o.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,formattedDescription:(0,s.BN)(C,e)?.text!==n?(0,c.C)(C,e,void 0,void 0,170):void 0}}}const S="full"===I?.webpageType?I:void 0,{url:M}=I||{},N=(0,o.Kr)(()=>(0,s.BN)(C,e)?.text!==M?(0,c.C)(C,e,void 0,void 0,170):void 0,[C,e,M]),{siteName:Y,displayUrl:k,title:F,description:P,formattedDescription:T=N,photo:D,video:x}=S||{},L=(0,o.Kr)(()=>{const e=F||Y||k;if(e)return e;if(!M)return"";try{return new URL(M).hostname}catch(e){return""}},[F,Y,k,M]);if(!M)return;const E=!n&&P&&(0,l.A)(P,170),B=(0,r.A)("WebLink scroll-item",!D&&!x&&"without-media"),R=k||M.replace("mailto:","");return(0,A.FD)("div",{className:B,"data-initial":L[0],dir:C.isRtl?"rtl":void 0,children:[D&&(0,A.Y)(f.A,{message:e,isProtected:i,observeIntersection:a}),(0,A.FD)("div",{className:"content",children:[(0,A.Y)(g.A,{isRtl:C.isRtl,className:"site-title",onClick:b,children:(0,u.A)(L)}),(E||T)&&(0,A.Y)(g.A,{isRtl:C.isRtl,className:"site-description",onClick:b,children:T||E&&(0,u.A)(E)}),(0,A.Y)(v.A,{url:M,className:"site-name",text:R,isRtl:C.isRtl}),n&&(0,A.Y)("div",{className:"sender-name",children:(0,u.A)(n)})]}),n&&(0,A.Y)("div",{className:"message-date",children:(0,A.Y)(g.A,{className:"date",onClick:b,isRtl:C.isRtl,children:(0,d.be)(w,1e3*e.date)})})]})}))},37830:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(87894);const i=new WeakMap;function s(e){return(...t)=>{const n=i.get(e);if(n&&(0,o.k)(n.lastArgs,t))return n.lastResult;const s=e(...t);return i.set(e,{lastArgs:t,lastResult:s}),s}}},37959:(e,t,n)=>{n.d(t,{E5:()=>o.E5,IP:()=>o.IP});var o=n(79882)},38102:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(87412),s=n(76471),a=n(20021);const r=(0,o.ph)(({topic:e,className:t,letterClassName:n,size:o,noLoopLimit:r,observeIntersection:d,onClick:l})=>e.iconEmojiId&&"0"!==e.iconEmojiId?(0,a.Y)(i.A,{documentId:e.iconEmojiId,className:t,size:o,observeIntersectionForPlaying:d,loopLimit:r?void 0:2,onClick:l}):(0,a.Y)(s.A,{iconColor:e.iconColor,title:e.title,topicId:e.id,className:t,letterClassName:n,onClick:l}))},38218:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(84051),i=n(17712);const s=function({onClick:e,onStart:t,onEnd:n,threshold:s=250}){const a=(0,o.li)(!1),r=(0,o.li)(!1),d=(0,o.li)(void 0),l=(0,i.A)(e=>{const n="button"in e&&0===e.button||"touches"in e&&e.touches.length>0;!r.current&&n&&(r.current=!0,d.current=window.setTimeout(()=>{t?.(),a.current=!0},s))}),c=(0,i.A)(t=>{r.current&&(a.current?n?.():e?.(t),u())}),u=(0,i.A)(()=>{a.current=!1,r.current=!1,window.clearTimeout(d.current)});return(0,o._W)(()=>{window.clearTimeout(d.current)}),{onMouseDown:l,onMouseUp:c,onMouseLeave:c,onTouchStart:l,onTouchEnd:c}}},38353:(e,t,n)=>{n.d(t,{A:()=>o});const o={background:"LzylDSXD",customBgImage:"iBGWkDsW",customBgColor:"HnpqkkHj",withTransition:"V96TOnoY",blurred:"K_W7XNrk",withRightColumn:"EiMC9Ymb"}},39074:(e,t,n)=>{n.d(t,{DY:()=>d,JC:()=>a,LV:()=>s,oR:()=>i,vZ:()=>r});const o=document.createElement("div");function i(e){const t=window.getSelection();if(t?.getRangeAt&&t.rangeCount){const n=t.getRangeAt(0);n.deleteContents();const o=n.createContextualFragment(e),i=o.lastChild;n.insertNode(o),i?(n.setStartAfter(i),n.setEndAfter(i)):n.collapse(!1),t.removeAllRanges(),t.addRange(n)}}function s(e,t){if(!e)return"";const n=window.getSelection();if(!n||!n.rangeCount)return e.innerHTML;const i=n.getRangeAt(0).cloneRange();return i.intersectsNode(e)?t||e.contains(i.commonAncestorContainer)?(i.collapse(!0),i.setStart(e,0),o.innerHTML="",o.appendChild(i.cloneContents()),o.innerHTML):"":e.innerHTML}function a(e){let t=0;const n=window.getSelection();if(!n||0===n.rangeCount)return t;const o=n.getRangeAt(0),i=o.cloneRange();return i.selectNodeContents(e),i.setEnd(o.endContainer,o.endOffset),t=i.toString().length,t}function r(e,t){for(const n of e.childNodes)if(n.nodeType===Node.TEXT_NODE){if(n.length>=t){const e=document.createRange(),o=window.getSelection();return e.setStart(n,t),e.collapse(!0),o.removeAllRanges(),o.addRange(e),-1}t-="length"in n?n.length:0}else if(-1===(t=r(n,t)))return-1;return t}function d(){const e=window.getSelection();e?.removeAllRanges()}},40175:(e,t,n)=>{n.d(t,{A:()=>p});var o=n(84051),i=n(13439),s=n(31481),a=n(91048),r=n(34458),d=n(39351),l=n(34201),c=n(92111),u=n(21849),h=n(17169),m=n(20021);const p=(0,o.ph)((0,i.EK)((e,{isArchived:t})=>{const{orderedPeerIds:{archived:n,active:o},byPeerId:i}=e.stories,{storyViewer:{isRibbonShown:s,isArchivedRibbonShown:r}}=(0,a.nTw)(e),d=(0,a.clw)(e),l=(0,a.xYJ)(e,"storyRibbonAnimations");return{currentUserId:e.currentUserId,orderedPeerIds:t?n:o,isShown:t?!r:!s,isForumPanelOpen:d,withAnimation:l,usersById:e.users.byId,chatsById:e.chats.byId,peerStories:i}})(function({currentUserId:e,orderedPeerIds:t,usersById:n,chatsById:a,canShow:p,isShown:g,isForumPanelOpen:f,isArchived:v,withAnimation:A,peerStories:y}){const{toggleStoryRibbon:C}=(0,i.ko)(),w=(0,d.A)(),b=(0,o.Kr)(()=>1===t.length?[n[t[0]]||a[t[0]]]:t.map(e=>n[e]||a[e]).filter(t=>t&&t.id!==e).slice(0,s.dqH).reverse(),[e,t,n,a]),I=(0,o.Kr)(()=>b?.length?b.reduce((e,t)=>{const n=y[t.id];if(!n)return e;const o=n.orderedIds.some(e=>{const t=n.byId[e];if(!t||!("isForCloseFriends"in t))return!1;const o=n.lastReadId&&t.id<=n.lastReadId;return t.isForCloseFriends&&!o});return e[t.id]=o,e},{}):{},[y,b]),S=(0,o.Kr)(()=>t.slice(0,5),[t]);(0,c.A)(S);const M=p&&g,{ref:N,shouldRender:Y}=(0,l.A)({isOpen:M,className:"slow",withShouldRender:!0});if((0,o.vJ)(()=>{A&&!f&&(M?((0,o.VK)(r.UG+s.xB5),(0,r.$)(v)):((0,o.VK)(r.UG+s.xB5),(0,r.wV)(v)))},[v,M,A,f]),Y)return(0,m.Y)("button",{ref:N,type:"button",id:"StoryToggler",className:h.A.root,"aria-label":w("AriaStoryTogglerOpen"),onClick:()=>C({isShown:!0,isArchived:v}),dir:w.isRtl?"rtl":void 0,children:b.map(e=>(0,m.Y)(u.A,{peer:e,size:"tiny",className:h.A.avatar,withStorySolid:!0,forceFriendStorySolid:I[e.id]},e.id))})}))},40435:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(41074);const i={dark:{outgoing:"rgb(135,116,225)",incoming:"rgb(33,33,33)"},light:{outgoing:"rgb(238,255,222)",incoming:"rgb(255,255,255)"}};function s(e,t,n,s,a){return s?Promise.resolve(i[a||"light"][t?"outgoing":"incoming"]):(0,o.M1)({name:"offscreen-canvas:getAppendixColorFromImage",args:[e,t]},Math.round(n)%o.bP)}},41074:(e,t,n)=>{n.d(t,{Ay:()=>r,M1:()=>d,bP:()=>s});var o=n(31481),i=n(5130);const s=Math.min(navigator.hardwareConcurrency||4,4);let a;function r(){return o.W75?[]:(a||(a=new Array(s).fill(void 0).map(()=>{const e=new Worker(new URL(n.p+n.u(9443),n.b));return{worker:e,connector:(0,i.U)(e,void 0,"media")}})),a)}function d(e,t){return r()[t].connector.request(e)}},41316:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(84051);function i(e){const[t,n]=(0,o.Ul)();return(0,o.vJ)(()=>{function t(){const t=window.getSelection();if(!t?.rangeCount)return;const o=t.getRangeAt(0);if(!o)return;if(!document.querySelector(e))return;const{commonAncestorContainer:i}=o;(i instanceof Element?i:i.parentElement).closest(e)&&n(o)}return document.addEventListener("selectionchange",t),()=>document.removeEventListener("selectionchange",t)},[e,n]),t}},41385:(e,t,n)=>{n.d(t,{k:()=>r});var o=n(95807),i=n(17712),s=n(14745);const a="--_vtn";function r(e){const t=(0,s.A)();return{createVtnStyle:(0,i.A)((n,i)=>{const s=!0===i?n:i||void 0;return(0,o.A)(`${a}: vtn-${n}-${e||t}`,s&&`view-transition-class: ${s}`)})}}CSS.registerProperty?.({name:a,syntax:"*",inherits:!1})},41510:(e,t,n)=>{n.d(t,{I:()=>y,A:()=>C});var o=n(84051),i=n(13439),s=n(90709),a=n(87357),r=n(11778),d=n(55153),l=n(45761),c=n(39351),u=n(17712),h=n(73767),m=n(50680),p=n(3325),g=n(37661),f=n(18276),v=n(20021);const A=(0,o.ph)(({isQuick:e,isGeneric:t,onFileSelect:n})=>{const i=(0,o.li)(),s=(0,c.A)(),[r,d,l]=(0,g.A)(),h=(0,u.A)(e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),l()}),m=(0,a.A)("DropTarget",r&&"hovered");return(0,v.FD)("div",{className:m,ref:i,onDrop:n,onDragEnter:d,onDragLeave:h,"data-dropzone":!0,children:[(0,v.Y)("svg",{className:"target-outline-container",children:(0,v.Y)("rect",{className:"target-outline",x:"0",y:"0",width:"100%",height:"100%",rx:"8"})}),(0,v.FD)("div",{className:"target-content",children:[(0,v.Y)(f.A,{name:e?"photo":"document"}),(0,v.Y)("div",{className:"title",children:s("FileDropZoneTitle")}),!t&&(0,v.Y)("div",{className:"description",children:s(e?"FileDropZoneQuick":"FileDropZoneNoCompression")})]})]})});let y=function(e){return e.None="none",e.Document="document",e.QuickFile="quick_file",e}({});const C=(0,o.ph)(({isOpen:e,withQuick:t,editingMessage:n,onHide:g,onFileSelect:f})=>{const y=(0,c.A)(),{showNotification:C,updateAttachmentSettings:w}=(0,i.ko)(),b=(0,o.li)(),I=(0,h.A)(t),{shouldRender:S,transitionClassNames:M}=(0,m.A)(e);(0,o.vJ)(()=>e?(0,r.A)(g):void 0,[e,g]);const N=(0,u.A)(async e=>{const{dataTransfer:o}=e;let i=[];if(!(o.files&&o.files.length>0)||o.items&&o.items.length){if(o.items&&o.items.length>0){const e=await(0,l.A)(o.items);e?.length&&(i=i.concat(e))}}else i=i.concat(Array.from(o.files));if(n){if(i.length>1)return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:i.length})});if(1===i.length){const e=await(0,d.A)(i[0].name,i[0]);if(!(n&&e&&(0,s.eh)(n,e)))return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:i.length})})}}g(),w({shouldCompress:!t&&void 0}),f(i)}),Y=(0,u.A)(async e=>{const{dataTransfer:t}=e;if(t.files&&t.files.length>0){const e=Array.from(t.files);if(n){if(e.length>1)return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:e.length})});if(1===e.length){const t=await(0,d.A)(e[0].name,e[0]);if(!(n&&t&&(0,s.eh)(n,t)))return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:e.length})})}}g(),w({shouldCompress:!0}),f(e)}}),k=(0,u.A)(e=>{e.stopPropagation();const{target:t,relatedTarget:n}=e;!t.matches(".DropTarget, .DropArea")||n&&n.matches(".DropTarget, .DropArea")||(b.current=window.setTimeout(()=>{g()},150))});if(!S)return;const F=t||I,P=(0,a.A)("DropArea",M);return(0,v.Y)(p.A,{containerSelector:"#middle-column-portals",children:(0,v.FD)("div",{className:P,onDragLeave:k,onDragOver:()=>{b.current&&window.clearTimeout(b.current)},onDrop:g,onClick:g,children:[(0,v.Y)(A,{onFileSelect:N,isGeneric:!F}),F&&(0,v.Y)(A,{onFileSelect:Y,isQuick:!0})]})})})},42215:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(84051),i=n(30857);function s(e,t){const n=(0,i.A)(),s=(0,o.li)(e),a=(0,o.li)(t),r=(0,o.hb)(e=>(a.current=s.current(a.current,e),n(),a.current),[]);return[a.current,r]}},42827:(e,t,n)=>{n.d(t,{A:()=>u});var o=n(84051),i=n(87357),s=n(36175),a=n(4961),r=n(59030),d=n(50680),l=n(64489),c=n(20021);const u=(0,o.ph)(({text:e="Nothing found.",description:t,withSticker:n})=>{const o=(0,r.A)(),{transitionClassNames:u}=(0,d.A)(!0);return(0,c.FD)("div",{className:(0,i.A)("NothingFound",u,t&&"with-description",n&&"with-sticker"),children:[n&&(0,c.Y)(l.A,{className:"sticker",size:120,tgsUrl:s.w.DuckNothingFound,previewUrl:s.d.DuckNothingFound,nonInteractive:!0,noLoop:!1}),e,t&&(0,c.Y)("p",{className:"description",children:(0,a.A)(o(t),["br"])})]})})},45318:(e,t,n)=>{e.exports=n.p+"GiftStar.59a3e3598fdbab13b181.svg"},45761:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(87679);async function i(e){const t=[];function n(e,o){return new Promise(i=>{if(e instanceof File)t.push(e),i(e);else if(e.isFile){const n=o.getAsFile();e.file(e=>{t.push(e),i(e)},()=>{n&&t.push(n),i(n)})}else e.isDirectory&&e.createReader().readEntries(e=>{const t=[];for(let i=0;i<e.length;i++)t.push(n(e[i],o));i(Promise.all(t))})})}const i=[];for(let t=0;t<e.length;t++){const o=e[t];if("file"===o.kind){const e=o.webkitGetAsEntry()||o.getAsFile();e&&i.push(n(e,o))}}return await Promise.all(i),(0,o.kc)(t)}},46051:(e,t,n)=>{n.d(t,{G:()=>o,w:()=>i});const o="video/mp4; codecs=hvc1.1.6.L63.00",i="video/mp4; codecs=avc1.64001E"},46442:(e,t,n)=>{n.d(t,{A:()=>at});var o=n(84051),i=n(61433),s=n(13439),a=n(23174),r=n(89925),d=n(31481),l=n(66644),c=n(90709),u=n(91048),h=n(21133),m=n(19408),p=n(81954),g=n(96454),f=n(87357),v=n(48899),A=n(87894),y=n(60343),C=n(9718),w=n(37836),b=n(16460),I=n(76023),S=n(17663);function M(e){return"albumId"in e}function N(e,t,n,o,i){let s;const a=[{originalDate:e[0].date,datetime:(0,S.CS)(1e3*e[0].date),senderGroups:[[]]}];return e.forEach((r,d)=>{const l=a[a.length-1],u=l.senderGroups[l.senderGroups.length-1];r.isInAlbum?s?(s.messages.push(r),r.hasComments&&(s.commentsMessage=r),r.content.text&&!s.hasMultipleCaptions&&(s.captionMessage?(s.hasMultipleCaptions=!0,s.captionMessage=void 0):s.captionMessage=r)):s={albumId:r.groupedId,messages:[r],mainMessage:r,hasMultipleCaptions:!1}:(r.content.paidMedia?.extendedMedia.length||0)>1?u.push({albumId:`paid-${r.id}`,messages:[r],mainMessage:r,hasMultipleCaptions:!1,isPaidMedia:!0}):u.push(r);const h=e[d+1];!s||h&&h.groupedId&&h.groupedId===s.albumId||(u.push(s),s=void 0);const m=u[u.length-1];if(h&&!s){const e=(0,S.CS)(1e3*h.date);if(l.datetime!==e){const t={originalDate:h.date,datetime:e,senderGroups:[[]]};a.push(t)}else(h.id===t||r.senderId!==h.senderId||!i&&r.paidMessageStars||h.suggestedPostInfo||r.isOutgoing!==h.isOutgoing||r.postAuthorTitle!==h.postAuthorTitle||(0,c._P)(r)&&"phoneCall"!==r.content.action?.type||(0,c._P)(h)&&"phoneCall"!==h.content.action?.type||r.inlineButtons||h.inlineButtons||h.date-r.date>600||n&&(r.id===n||m&&"mainMessage"in m&&m.mainMessage?.id===n)&&h.id!==n||o&&r.forwardInfo?.fromId!==h.forwardInfo?.fromId)&&l.senderGroups.push([])}}),a}var Y=n(54464),k=n(32625),F=n(82117),P=n(17712),T=n(37859),D=n(81686),x=n(2178);var L=n(41257),E=n(35297),B=n(61157),R=n(93545),O=n(37661),U=n(56133);var K=n(52745),z=n(41036),V=n(59030),j=n(82855);var G=n(20021);const J=(0,o.ph)((0,s.EK)((e,{userId:t})=>{const{stickers:n}=e.stickers.greeting,o=(0,u.hds)(e,t);if(!o)return{};const i=(0,u.mBe)(e,t),s=(0,u.vGo)(e,t),a=(0,u.yHC)(e,o.id);return{defaultStickers:n,lastUnreadMessageId:a&&a.id!==o.lastReadInboxMessageId?a.id:void 0,connectionState:e.connectionState,currentMessageList:(0,u.Xf0)(e),businessIntro:s?.businessIntro,user:i}})(({defaultStickers:e,connectionState:t,lastUnreadMessageId:n,currentMessageList:i,businessIntro:a,user:r})=>{const{loadGreetingStickers:d,sendMessage:l,markMessageListRead:u}=(0,s.ko)(),h=(0,V.A)(),m=(0,o.li)(),p=(0,o.Kr)(()=>{if(a?.sticker)return a.sticker;if(!e?.length)return;const t=Math.floor(Math.random()*e.length);return e[t]},[a?.sticker,e]);(0,o.vJ)(()=>{e?.length||"connectionStateReady"!==t||d()},[t,d,e]),(0,o.vJ)(()=>{"connectionStateReady"===t&&n&&u({maxId:n})},[t,u,n]);const g=(0,P.A)(()=>{i&&l({sticker:{...p,isPreloadedGlobally:!0},messageList:i})}),f=a?.title||h("Conversation.EmptyPlaceholder"),v=a?.description||h("Conversation.GreetingText");return(0,G.FD)("div",{className:"osdROIcA",children:[(0,G.FD)("div",{className:"c3NtU3JZ",children:[(0,G.Y)("p",{className:"n2KO1cAv",dir:"auto",children:f}),(0,G.Y)("p",{className:"MVSedxKc",dir:"auto",children:v}),(0,G.Y)("div",{ref:m,className:"qsfxNv7L",onClick:g,children:p&&(0,G.Y)(j.A,{containerRef:m,sticker:p,size:160,shouldLoop:!0})})]}),a&&(0,G.Y)("div",{className:"WIbO6rja",children:h("Chat.EmptyStateIntroFooter",(0,c.Yg)(r))})]})}));var $=n(95807),q=n(52491),H=n(64713),W=n(83868),_=n(4961),Q=n(39351),Z=n(62587),X=n(26875),ee=n(18276),te=n(92108),ne=n(96530),oe=n(65843),ie=n(55158);const se="ubFGDy3d",ae="kpMdEhns",re="mtKNWJmZ",de="BH_g_jqY",le=(0,o.ph)((0,s.EK)((e,{chatId:t})=>{const{countryList:{phoneCodes:n}}=e,o=(0,u.hds)(e,t),i=(0,u.vGo)(e,t),s=(0,u.Ua4)(e,t);let a,r=!1;return(0,u.yps)(e,t)&&(i?a=i.botInfo:r=!0),{chat:o,userFullInfo:i,botInfo:a,isLoadingFullUser:r,phoneCodeList:n,commonChats:s}})(({chat:e,chatId:t,botInfo:n,isLoadingFullUser:i,phoneCodeList:a,commonChats:r,userFullInfo:d,hasMessages:l})=>{const{loadCommonChats:h,openChatWithInfo:m}=(0,s.ko)(),p=(0,V.A)(),g=(0,Q.A)(),{phoneCountry:v,registrationMonth:A,nameChangeDate:y,photoChangeDate:C}=d?.settings||{};(0,o.vJ)(()=>{h({userId:t})},[t]);const w=(0,o.Kr)(()=>{if(a&&v)return(0,H.gH)(a,v)},[a,v]),b=(0,Z.A)(n?.photo?(0,c.Fi)(n.photo):void 0),I=(0,Z.A)(n?.gif?(0,c.sC)(n.gif,"full"):void 0),M=n?.photo?(0,c.Xn)(n.photo):n?.gif?(0,c.NZ)(n.gif):void 0,N=n&&!n.description&&!n.gif&&!n.photo,Y=!w||!A,k=(0,c.Rl)(t),{width:F,height:T}=M||{},D=(0,P.A)(e=>{(0,W.A)(e),m({id:t,shouldReplaceHistory:!0,profileTab:"commonChats",forceScrollProfileTab:!0})}),x=y&&e?(0,G.Y)("div",{className:"local-action-message",children:(0,G.Y)("span",{children:g("UserUpdatedName",{user:e.title,time:(0,S.vm)(g,y)},{withNodes:!0,withMarkdown:!0})})},"security-name-message"):void 0,L=C&&e?(0,G.Y)("div",{className:"local-action-message",children:(0,G.Y)("span",{children:g("UserUpdatedPhoto",{user:e.title,time:(0,S.vm)(g,C)},{withNodes:!0,withMarkdown:!0})})},"security-photo-message"):void 0,E=(0,o.Kr)(()=>{const e=[];if(w&&e.push([p("PrivacyPhone"),(0,G.FD)("span",{className:"TYJGFKqJ",children:[(0,G.Y)("span",{className:"WuX68A65",children:(0,_.A)((0,q.D0)(w?.iso2))}),w?.defaultName]})]),A&&e.push([g("ContactInfoRegistration"),(0,S.BR)(g.code,A)]),d?.commonChatsCount){const t=(0,s.mS)(),n=r?.ids.slice(0,3).map(e=>(0,u.PVB)(t,e)).filter(Boolean);e.push([g("ChatNonContactUserGroups"),(0,G.FD)(ne.A,{className:"yIJ4jRxH",onClick:D,children:[(0,G.Y)("span",{className:"_MPDNfhr",children:g("ChatGroups",{count:d.commonChatsCount},{pluralValue:d.commonChatsCount})}),Boolean(n?.length)&&(0,G.Y)(X.A,{size:"micro",peers:n}),(0,G.Y)(ee.A,{name:"next",className:"KYcoeDmo"})]})])}return e},[g,p,w,A,r,d]);return(0,G.FD)("div",{className:(0,f.A)("tFPZHCMt","empty"),children:[i&&Y&&(0,G.Y)("span",{children:p("Loading")}),N&&Y&&!i&&!l&&(0,G.Y)("span",{children:p("NoMessages")}),n&&(0,G.FD)("div",{className:(0,f.A)(se,"kXKBpNnb"),style:(0,$.A)(F?`width: ${F}px`:void 0),children:[b&&(0,G.Y)("img",{className:re,src:b,width:F,height:T,alt:"Bot info"}),I&&(0,G.Y)(oe.A,{canPlay:!0,className:re,src:I,loop:!0,disablePictureInPicture:!0,muted:!0,playsInline:!0,style:(0,$.A)(Boolean(F)&&`width: ${F}px`,Boolean(T)&&`height: ${T}px`)}),M&&!b&&!I&&(0,G.Y)(ie.A,{className:re,width:F,height:T,forceAspectRatio:!0}),k&&(0,G.Y)("div",{className:ae,children:p("VerifyChatInfo")}),!k&&n.description&&(0,G.FD)("div",{className:ae,children:[(0,G.Y)("p",{className:"H__cBlx8",children:p("BotInfoTitle")}),(0,_.A)(n.description,["br","emoji","links"])]})]}),!Y&&e&&(0,G.FD)("div",{className:(0,f.A)(se,"niS9Gfcl"),children:[(0,G.Y)("h3",{className:"RyB2zw9K",children:(0,_.A)((0,c.Js)(g,e))}),(0,G.Y)("p",{className:(0,f.A)("n9OcHdnh",de),children:g("ChatNonContactUserSubtitle")}),(0,G.Y)(te.A,{keyClassName:de,data:E}),!e?.isVerified&&(0,G.FD)("div",{className:(0,f.A)("sCB3zhO3",de),children:[(0,G.Y)(ee.A,{name:"info-filled"}),(0,G.Y)("p",{className:"dlaTjW_s",children:g("ContactInfoNotVerified")})]})]}),x,L]})}));var ce=n(70636),ue=n(17142),he=n(48775),me=n(4262),pe=n(83414),ge=n(73767),fe=n(43874),ve=n(5912);const Ae=g.Ni?1e3:350;var ye=n(63988),Ce=n(16581),we=n(5718),be=n(36143),Ie=n(87021),Se=n(10722),Me=n(34201),Ne=n(21849),Ye=n(71429),ke=n(24433);const Fe="FHxnbOg6",Pe=(0,o.ph)((0,s.EK)((e,t)=>{const{message:n,withAvatar:o}=t,{chatId:i}=n,s=(0,u.nZ4)(e,i),a=(0,c.DX)(i),r=(0,c.Qe)(i),d=!s&&(0,c.zP)(n),l=o||d;return{sender:(0,u.Y7C)(e,n),canShowSender:l,originSender:(0,u.Szq)(e,n),isChatWithSelf:s,isRepliesChat:a,isAnonymousForwards:r}})(({message:e,withAvatar:t,children:n,id:i,appearanceOrder:a,sender:r,canShowSender:l,originSender:u,isChatWithSelf:h,isRepliesChat:m,isAnonymousForwards:p,canPost:g})=>{const{openChat:v,updateInsertingPeerIdMention:A}=(0,s.ko)(),{forwardInfo:y}=e,C=l?r:void 0,w=(0,Q.A)(),b=a<=0,[I,S]=(0,O.A)(b);(0,o.vJ)(()=>{b||setTimeout(S,a*d.zq7)},[a,S,b]);const M=y&&(h||m||p||!C)?u:C,N=M&&(0,ce.mO)(M),Y=(0,P.A)(()=>{M&&v({id:M.id})}),k=(0,P.A)(()=>{M&&document.querySelector(d.m$5)&&A({peerId:M.id})}),F=(0,P.A)(()=>{Y()}),{ref:T,shouldRender:D}=(0,Me.A)({isOpen:t&&I,noMountTransition:I,withShouldRender:!0}),{isContextMenuOpen:x,contextMenuAnchor:L,handleContextMenu:E,handleContextMenuClose:B,handleContextMenuHide:R}=(0,Se.A)(T),U=(0,P.A)(()=>T.current),K=(0,P.A)(()=>document.querySelector(".Transition_slide-active > .MessageList")),z=(0,P.A)(()=>T?.current?.querySelector(`.${Fe} .bubble`)),V=(0,P.A)(()=>({withPortal:!0})),j=g&&M&&(N||Boolean((0,c.Kl)(M))),J=Boolean(L)&&(N||j),$=(0,f.A)("sender-group-container","Tk8btfOT");return(0,G.FD)("div",{id:i,className:$,children:[D&&(0,G.FD)("div",{ref:T,className:"UPrRM3Ks",children:[function(){const e=!M&&y?y.hiddenUserName:void 0;return(0,G.Y)(Ne.A,{size:"small",className:"jdvqXfYh",peer:M,text:e,onClick:M?F:void 0,onContextMenu:E})}(),J&&(0,G.Y)(Ye.A,{isOpen:x,anchor:L,getTriggerElement:U,getRootElement:K,getLayout:V,getMenuElement:z,className:Fe,onClose:B,onCloseAnimationEnd:R,withPortal:!0,autoClose:!0,children:(0,G.FD)(G.FK,{children:[N&&(0,G.Y)(ke.A,{icon:"comments",onClick:Y,children:w("SendMessage")}),j&&(0,G.Y)(ke.A,{icon:"mention",onClick:k,children:w("ContextMenuItemMention")})]})})]}),n]})}));var Te=n(56494),De=n(18501),xe=n(35127),Le=n(81949),Ee=n(86070),Be=n(64493),Re=n(48906),Oe=n(51644),Ue=n(80089),Ke=n(80464);const ze=e=>{const{isOpen:t}=e,n=(0,Ke.A)(Ue.ar.Extra,"SponsoredContextMenuContainer",!t);return n?(0,G.Y)(n,{...e}):void 0};var Ve=n(25477);const je=(0,o.ph)((0,s.EK)((e,{chatId:t})=>{const n=(0,u.v8U)(e,t),o=(0,u.yuw)(e),i=n?(0,Te.iS)(e,n):void 0,s=i&&(0,c.$r)(o,i);return{message:n,theme:(0,u.SJA)(e),isDownloading:s,canAutoLoadMedia:n?(0,u.wwb)(e,n):void 0,canAutoPlayMedia:n?(0,u.OEt)(e,n):void 0}})(({chatId:e,message:t,containerRef:n,theme:i,observeIntersectionForLoading:a,observeIntersectionForPlaying:d,isDownloading:l,canAutoLoadMedia:u,canAutoPlayMedia:h})=>{const{viewSponsored:m,openUrl:p,hideSponsored:v,clickSponsored:A,openMediaViewer:y,openAboutAdsModal:C}=(0,s.ko)(),w=(0,V.A)(),b=(0,o.li)(),I=(0,o.li)(),S=Boolean(t),{isMobile:M}=(0,fe.Ay)(),{observe:N}=(0,ve.BL)({rootRef:n,debounceMs:200,threshold:1}),{isContextMenuOpen:k,contextMenuAnchor:F,handleBeforeContextMenu:T,handleContextMenu:D,handleContextMenuClose:x,handleContextMenuHide:L}=(0,Se.A)(I,void 0,!0,g.Ni);(0,o.vJ)(()=>S?N(b.current,e=>{e.isIntersecting&&t?.randomId&&m({randomId:t.randomId})}):void 0,[t?.randomId,S,N,m]);const E=(0,P.A)(()=>{v()}),B=t&&(0,c.r_)(t),{photo:R,video:O,text:U}=B||{},K=O?.isGif,z=Boolean(R||O),j=(0,P.A)(()=>{t&&(A({randomId:t.randomId,isMedia:!(!R&&!K)||void 0}),p({url:t.url,shouldSkipModal:!0}))}),J=(0,P.A)(()=>{t&&(A({randomId:t.randomId,isMedia:!0}),y({origin:r.TQ.SponsoredMessage,chatId:e,isSponsoredMessage:!0}))}),$=(0,P.A)(()=>{t&&C({randomId:t.randomId,canReport:t.canReport,additionalInfo:t.additionalInfo,sponsorInfo:t.sponsorInfo})}),q=(0,o.Kr)(()=>{let e,t,n="";if(R||O){let n;R?n=(0,xe.yA)({media:R,isMobile:M}).width:O&&(n=(0,xe.yA)({media:O,isMobile:M}).width),n&&(n<(0,xe.Ay)(M)&&(t=n),e=Math.max((0,xe.nP)(U?.text,M),n))}return e&&(n=`width: ${e+0}px`),{contentWidth:t,noMediaCorners:!1,style:n}},[R,O,M,U?.text]),{contentWidth:H,style:W}=q;if(t&&t.content)return(0,G.FD)("div",{ref:I,className:"SponsoredMessage Message open sponsored-media-preview",children:[(0,G.FD)("div",{className:"message-content media has-shadow has-solid-background has-appendix",dir:"auto",style:W,onMouseDown:e=>{(0,Y.l)(e),T(e)},onContextMenu:D,children:[(0,G.FD)(Ee.A,{peerColor:t.peerColor,className:"content-inner",dir:"auto",children:[function(){if(t)return R?(0,G.Y)(Oe.A,{photo:R,theme:i,canAutoLoad:u,isDownloading:l,observeIntersection:a,noAvatars:!0,onClick:j,forcedWidth:H}):O?(0,G.Y)(Ve.A,{video:O,observeIntersectionForLoading:a,observeIntersectionForPlaying:d,noAvatars:!0,canAutoLoad:u,canAutoPlay:h,isDownloading:l,onClick:K?j:J,forcedWidth:H}):void 0}(),t.photo&&(0,G.Y)(Ne.A,{size:"large",photo:t.photo,className:(0,f.A)("channel-avatar",w.isRtl&&"is-rtl")}),(0,G.FD)("span",{className:(0,f.A)("message-title message-type",z&&"has-media"),children:[t.isRecommended?w("Message.RecommendedLabel"):w("SponsoredMessage"),(0,G.Y)(Le.A,{onClick:$,className:"ad-about",children:w("SponsoredMessageAdWhatIsThis")})]}),function(){if(t)return(0,G.FD)(G.FK,{children:[(0,G.Y)("div",{className:"message-title message-peer",dir:"auto",children:t.title}),Boolean(t.content?.text)&&(0,G.Y)("div",{className:"text-content with-meta",dir:"auto",ref:b,children:(0,G.Y)("span",{className:"text-content-inner",dir:"auto",children:(0,De.fd)({text:t.content.text.text,entities:t.content.text.entities})})}),(0,G.Y)(Be.A,{className:"SponsoredMessage__button",size:"tiny",color:"translucent",isRectangular:!0,onClick:j,children:t.buttonText})]})}()]}),(0,G.Y)(Re.A,{}),(0,G.FD)("div",{className:"message-action-buttons",children:[(0,G.Y)(Be.A,{className:"message-action-button",color:"translucent-white",round:!0,iconName:"close",iconClassName:"sponsored-action-icon",ariaLabel:w("Close"),onClick:E}),t.canReport&&(0,G.Y)(Be.A,{className:"message-action-button",color:"translucent-white",round:!0,iconName:"more",iconClassName:"sponsored-action-icon",ariaLabel:w("More"),onClick:D,onContextMenu:D})]})]}),F&&(0,G.Y)(ze,{isOpen:k,anchor:F,triggerRef:I,randomId:t.randomId,canReport:t.canReport,sponsorInfo:t.sponsorInfo,additionalInfo:t.additionalInfo,onClose:x,onCloseAnimationEnd:L})]},"sponsored-message")}));var Ge=n(42211);const Je=(0,o.ph)(({isFocused:e,className:t})=>{const n=(0,o.li)();return(0,Ge.A)({elementRef:n,isJustAdded:!0,isFocused:e,noFocusHighlight:!0}),(0,G.Y)("div",{ref:n,className:(0,f.A)("list-bottom-marker",t)})});var $e=n(50805);const qe=(0,o.ph)(({canShowAds:e,chatId:t,threadId:n,messageIds:i,messageGroups:h,getContainerHeight:m,isViewportNewest:p,isUnread:v,isComments:y,isEmptyThread:C,withUsers:b,isChannelChat:I,isChatMonoforum:N,isBotForum:k,noAvatars:F,containerRef:T,anchorIdRef:D,memoUnreadDividerBeforeIdRef:x,memoFirstUnreadIdRef:L,type:R,isReady:O,hasLinkedChat:U,isSchedule:K,shouldRenderAccountInfo:z,nameChangeDate:j,photoChangeDate:J,noAppearanceAnimation:$,isSavedDialog:q,isQuickPreview:H,shouldScrollToBottom:W,canPost:_,onScrollDownToggle:Z,onNotchToggle:X,onIntersectPinnedMessage:ne})=>{const{openHistoryCalendar:oe}=(0,s.ko)(),ie=o.OV,se=(0,pe.A)(()=>O&&!ie(),[O,ie]),ae=!q&&!K,re=e&&p,{observeIntersectionForReading:de,observeIntersectionForLoading:Se,observeIntersectionForPlaying:Me}=function(e,t,n,o,i,a){const{markMessageListRead:r,markMentionsRead:d,animateUnreadReaction:l,scheduleForViewsIncrement:c}=(0,s.ko)(),{isMobile:u}=(0,fe.Ay)(),h=u?300:500,{observe:m,freeze:p,unfreeze:g}=(0,ve.BL)({rootRef:t,throttleMs:150},t=>{if("thread"!==e||(0,B.g1)())return;let s=0;const u=[],h=[],m=[],p=[],g=[];t.forEach(e=>{const{isIntersecting:t,target:n}=e,{dataset:o}=n,i=Number(o.lastMessageId||o.messageId),a="true"===o.shouldUpdateViews,r=o.albumMainId?Number(o.albumMainId):void 0;t?(i>s&&(s=i),o.hasUnreadMention&&u.push(i),o.hasUnreadReaction&&h.push(i),o.isPinned&&m.push(r||i),a&&g.push(r||i)):o.isPinned&&p.push(r||i)}),a||(n.current&&s&&s>=n.current&&r({maxId:s}),u.length&&d({chatId:i,messageIds:u}),g.length&&c({chatId:i,ids:g})),h.length&&l({messageIds:h}),(m.length||p.length)&&o?.({viewportPinnedIdsToAdd:m,viewportPinnedIdsToRemove:p})});(0,B.Ay)(p,g);const{observe:f}=(0,ve.BL)({rootRef:t,throttleMs:Ae,margin:h}),{observe:v}=(0,ve.BL)({rootRef:t,throttleMs:Ae});return{observeIntersectionForReading:m,observeIntersectionForLoading:f,observeIntersectionForPlaying:v}}(R,T,L,ne,t,H),{withHistoryTriggers:Ne,backwardsTriggerRef:Ye,forwardsTriggerRef:ke,fabTriggerRef:Fe}=function({type:e,containerRef:t,messageIds:n,getContainerHeight:i,isViewportNewest:a,isUnread:d,isReady:c,onScrollDownToggle:u,onNotchToggle:h}){const{loadViewportMessages:m}=(0,s.ko)(),[p,f]=(0,o.Kr)(()=>"thread"===e?[(0,w.sg)(()=>m({direction:r.TN.Backwards}),1e3,!0,!1),(0,w.sg)(()=>m({direction:r.TN.Forwards}),1e3,!0,!1)]:[],[m,n]),v=(0,o.li)(),A=(0,o.li)(),y=(0,o.li)(),C=(0,P.A)((e,t)=>{u?.(e),h?.(t)}),b=(0,Ce.A)(C,[C],100,!0,!1),I=(0,P.A)(()=>{if(!c)return;if(!n?.length)return void C(!1,!1);if(!a)return void b(!0,!0);const e=t.current,o=y.current;if(!e||!o)return;const{offsetHeight:i,scrollHeight:s,scrollTop:r}=e,l=o.offsetTop,u=Math.round(l-r-i),h=u<=1;0!==s&&b(d?!h:!(u<=50),!h)}),{observe:S}=(0,ve.BL)({rootRef:t,margin:g.et},e=>{f&&p&&e.forEach(({isIntersecting:e,target:t})=>{e&&("backwards-trigger"===t.className&&p(),"forwards-trigger"===t.className&&f())})}),M=n&&n.length>1;(0,ve.mv)(v,M?S:void 0),(0,ve.mv)(A,M?S:void 0);const{observe:N,freeze:Y,unfreeze:k}=(0,ve.BL)({rootRef:t,margin:100,throttleScheduler:l.YS},I);(0,ve.mv)(y,N);const{observe:F,freeze:T,unfreeze:D}=(0,ve.BL)({rootRef:t,margin:1,throttleScheduler:l.YS},I);(0,ve.mv)(y,F),(0,o.vJ)(()=>{c&&I()},[c]),(0,o.vJ)(()=>{const e=t.current;if(e)return e.addEventListener("scrollend",I),()=>{e.removeEventListener("scrollend",I)}},[t]);const x=(0,P.A)(()=>{Y(),T(),setTimeout(()=>{D(),k()},350)});(0,E.A)(x,[x,n]);const L=(0,ye.D7)(i,200);return(0,we.R)(x,[x,L]),{withHistoryTriggers:M,backwardsTriggerRef:v,forwardsTriggerRef:A,fabTriggerRef:y}}({type:R,containerRef:T,messageIds:i,getContainerHeight:m,isViewportNewest:p,isUnread:v,isReady:O,onScrollDownToggle:Z,onNotchToggle:X}),Te=(0,V.A)(),De=(0,Q.A)(),xe=(0,G.Y)("div",{className:(0,f.A)("unread-divider","local-action-message"),children:(0,G.Y)("span",{children:Te("UnreadMessages")})},"unread-messages"),Le=(e,t)=>{if(e.paidMessageStars){const n=t?.messages?.length||1,o=e.paidMessageStars*n;return(0,G.Y)("div",{className:(0,f.A)("local-action-message"),children:(0,G.Y)("span",{children:e.isOutgoing?De("ActionPaidOneMessageOutgoing",{amount:(0,he.Kk)(De,o)}):(()=>{const t=(0,u.Y7C)((0,s.mS)(),e),n=t?(0,ce.F9)(De,t):"";return De("ActionPaidOneMessageIncoming",{user:n,amount:(0,he.Kk)(De,o)})})()})},`paid-messages-action-${e.id}`)}},Ee=e=>{if(e.suggestedPostInfo){const{price:t,scheduleDate:n}=e.suggestedPostInfo,o=(0,u.Y7C)((0,s.mS)(),e),i=o?(0,ce.F9)(De,o):"",a=(0,me.Nm)(o?.id,i||De("ActionFallbackUser")),r="message"===e.replyInfo?.type&&e.replyInfo.replyToMsgId?(0,u.O5q)((0,s.mS)(),e.chatId,e.replyInfo.replyToMsgId):void 0,d=(0,c.Do)(e,r)?(0,c.EQ)(De,e,r,e.isOutgoing,a):e.isOutgoing?De("ActionSuggestedPostOutgoing",void 0,{withNodes:!0,withMarkdown:!0}):De("ActionSuggestedPostIncoming",{user:a},{withNodes:!0,withMarkdown:!0}),l=(0,A.oE)([[De("TitlePrice"),t?"TON"===t.currency?(0,he.QH)(De,(0,ue.wD)(t.amount)):(0,he.Kk)(De,t.amount):De("SuggestMessageNoPrice")],[De("TitleTime"),n?(0,S.e0)(n,De,Te):De("SuggestMessageAnytime")]]);return(0,G.Y)("div",{className:(0,f.A)("local-action-message"),children:(0,G.FD)("span",{className:$e.A.suggestedPostContainer,children:[(0,G.Y)("div",{className:$e.A.suggestedPostTitle,children:d}),Boolean(l.length)&&(0,G.Y)(te.A,{className:$e.A.suggestedPostInfo,data:l})]})},`suggested-post-action-${e.id}`)}},Be=$?0:h.reduce((e,t)=>e+t.senderGroups.flat().length,0);let Re=0;const Oe=(0,ge.A)(i),Ue=Boolean(i&&Oe&&i[i.length-2]===Oe[Oe.length-1]),Ke=h.map((e,t,o)=>{const i=function(e,t,o){return e.senderGroups.map((e,i,s)=>{if(1===e.length&&!M(e[0])&&(0,c._P)(e[0])&&"phoneCall"!==e[0].content.action?.type){const a=e[0],r=i===s.length-1&&t===o.length-1;return(0,A.oE)([a.id===x.current&&xe,(0,G.Y)(be.A,{message:a,threadId:n,observeIntersectionForBottom:de,observeIntersectionForLoading:Se,observeIntersectionForPlaying:Me,memoFirstUnreadIdRef:L,appearanceOrder:Be-++Re,isJustAdded:r&&Ue,isLastInList:r,getIsMessageListReady:se,onIntersectPinnedMessage:ne},a.id)])}let r;const d=e.map((d,l)=>{const u=M(d)?d.mainMessage:d,h=M(d)?d:void 0,m=(0,c.Ie)(u),p=M(d),g=e[l+1];u.previousLocalId&&D.current===(0,c.GZ)(u.previousLocalId)&&(D.current=(0,c.GZ)(u.id));const f=!p&&u.groupedId?u.groupedId:void 0,v=g&&!M(g)?g.groupedId:void 0,C=u.id===n,w={isFirstInGroup:0===l,isLastInGroup:l===e.length-1,isFirstInDocumentGroup:Boolean(f&&f!==r),isLastInDocumentGroup:Boolean(f&&f!==v),isLastInList:l===e.length-1&&i===s.length-1&&t===o.length-1};r=f;const S=(0,c.sj)(u),Y=(0,c.u7)(u)?`${u.date}_${S}`:S,k=!1===U||!I||Boolean(N);return(0,A.oE)([u.id===x.current&&xe,u.paidMessageStars&&!b&&Le(u,h),u.suggestedPostInfo&&Ee(u),(0,G.Y)(Ie.A,{message:u,observeIntersectionForBottom:de,observeIntersectionForLoading:Se,observeIntersectionForPlaying:Me,album:h,noAvatars:F,withAvatar:w.isLastInGroup&&b&&!m&&(!C||!y),withSenderName:w.isFirstInGroup&&b&&!m,threadId:n,messageListType:R,noComments:k,noReplies:!k||n!==a.l3||"scheduled"===R,appearanceOrder:Be-++Re,isJustAdded:w.isLastInList&&Ue,isFirstInGroup:w.isFirstInGroup,isLastInGroup:w.isLastInGroup,isFirstInDocumentGroup:w.isFirstInDocumentGroup,isLastInDocumentGroup:w.isLastInDocumentGroup,isLastInList:w.isLastInList,memoFirstUnreadIdRef:L,onIntersectPinnedMessage:ne,getIsMessageListReady:se},Y)])}).flat();if(!b)return d;const l=e[e.length-1],u=M(l)?l.mainMessage:l,h=(0,c.sj)(u),m=Be-Re,p=u.id===n,g=(0,c.Ie)(u),f=e[0],v=M(f)?f.mainMessage:f,w=(0,c.sj)(v),S=`${w}-${h}`,Y=w===h?`message-group-${w}`:`message-group-${w}-${h}`,k=b&&!g&&(!p||!y);return(0,A.oE)([(0,G.Y)(Pe,{id:Y,message:u,withAvatar:k,appearanceOrder:m,canPost:_,children:d},S),p&&(0,G.Y)("div",{className:"local-action-message",children:(0,G.Y)("span",{children:Te(C?y?"NoComments":"NoReplies":"DiscussionStarted")})},`discussion-started-${h}`)])}).flat()}(e,t,o);return(0,G.FD)("div",{className:(0,f.A)("message-date-group",!(j||J)&&0===t&&"first-message-date-group"),onMouseDown:Y.l,teactFastList:!0,children:[(0,G.Y)("div",{className:(0,f.A)("sticky-date",ae&&"interactive"),onMouseDown:Y.l,onClick:ae?()=>oe({selectedAt:e.datetime}):void 0,children:(0,G.FD)("span",{dir:"auto",children:[K&&e.originalDate===d.NkL&&Te("MessageScheduledUntilOnline"),K&&e.originalDate!==d.NkL&&Te("MessageScheduledOn",(0,S.F5)(Te,e.datetime,void 0,!0)),!K&&(0,S.F5)(Te,e.datetime)]})},"date-header"),i.flat()]},e.datetime)});return(0,G.FD)("div",{className:"messages-container",teactFastList:!0,children:[Ne&&(0,G.Y)("div",{ref:Ye,className:"backwards-trigger"},"backwards-trigger"),z&&(0,G.Y)(le,{chatId:t,hasMessages:!0},`account_info_${t}`),Ke.flat(),p&&(()=>{if(k&&n===a.l3)return(0,G.Y)("div",{className:(0,f.A)("local-action-message",$e.A.root),children:(0,G.FD)("div",{className:$e.A.contentBox,children:[(0,G.Y)(ee.A,{className:$e.A.botForumTopicIcon,name:"topic-new"}),(0,G.Y)("h3",{className:$e.A.botForumTopicTitle,children:De("BotForumActionNew")}),(0,G.Y)("span",{className:$e.A.botForumTopicDescription,children:De("BotForumActionNewDescription")}),(0,G.Y)(ee.A,{className:$e.A.botForumTopicArrow,name:"down"})]})},"botforum-new-topic")})(),Ne&&(0,G.Y)("div",{ref:ke,className:"forwards-trigger"},"forwards-trigger"),(0,G.Y)("div",{ref:Fe,className:"fab-trigger"},"fab-trigger"),p&&(0,G.Y)(Je,{isFocused:W,className:re?"with-sponsored":void 0},"bottom-marker"),re&&(0,G.Y)(je,{chatId:t,containerRef:T,observeIntersectionForLoading:Se,observeIntersectionForPlaying:Me},t)]})});var He=n(38102);const We=3*I.$,_e=(0,o.ph)(({isChatWithSelf:e,type:t,isGroupChatJustCreated:n,topic:o})=>{const i=(0,V.A)();return"scheduled"===t?function(e){return(0,G.Y)("div",{className:"empty",children:(0,G.Y)("span",{children:e("ScheduledMessages.EmptyPlaceholder")})})}(i):e?function(e){return(0,G.Y)("div",{className:"NoMessages",children:(0,G.FD)("div",{className:"wrapper",children:[(0,G.Y)(ee.A,{name:"cloud-download",className:"no-messages-icon"}),(0,G.Y)("h3",{className:"title",children:e("Conversation.CloudStorageInfo.Title")}),(0,G.FD)("ul",{className:"description",children:[(0,G.Y)("li",{children:e("Conversation.ClousStorageInfo.Description1")}),(0,G.Y)("li",{children:e("Conversation.ClousStorageInfo.Description2")}),(0,G.Y)("li",{children:e("Conversation.ClousStorageInfo.Description3")}),(0,G.Y)("li",{children:e("Conversation.ClousStorageInfo.Description4")})]})]})})}(i):n?function(e){return(0,G.Y)("div",{className:"NoMessages",children:(0,G.FD)("div",{className:"wrapper",dir:e.isRtl?"rtl":void 0,children:[(0,G.Y)("h3",{className:"title",children:e("EmptyGroupInfo.Title")}),(0,G.Y)("p",{className:"description",children:e("EmptyGroupInfo.Subtitle")}),(0,G.FD)("ul",{className:"list-checkmarks",children:[(0,G.Y)("li",{children:e("EmptyGroupInfo.Line1")}),(0,G.Y)("li",{children:e("EmptyGroupInfo.Line2")}),(0,G.Y)("li",{children:e("EmptyGroupInfo.Line3")}),(0,G.Y)("li",{children:e("EmptyGroupInfo.Line4")})]})]})})}(i):o?function(e,t){return(0,G.Y)("div",{className:"NoMessages",children:(0,G.FD)("div",{className:"wrapper",children:[(0,G.Y)(He.A,{topic:t,size:We,className:"no-messages-icon topic-icon"}),(0,G.Y)("h3",{className:"title",children:e("Chat.EmptyTopicPlaceholder.Title")}),(0,G.Y)("p",{className:"description topic-description",children:(0,_.A)(e("Chat.EmptyTopicPlaceholder.Text"),["br"])})]})})}(i,o):(0,G.Y)("div",{className:"empty",children:(0,G.Y)("span",{children:i("NoMessages")})})});var Qe=n(36175),Ze=n(64489),Xe=n(85118);const et=(0,o.ph)((0,s.EK)((e,{peerId:t})=>{const n=(0,u.SJA)(e),{patternColor:o}=(0,u.Gyz)(e,n)||{};return{patternColor:o,peer:(0,u.PVB)(e,t)}})(function({patternColor:e,peer:t,paidMessagesStars:n}){const o=(0,V.A)(),i=(0,Q.A)(),{openPremiumModal:a,openStarsBalanceModal:r}=(0,s.ko)(),d=(0,P.A)(()=>a()),l=(0,P.A)(()=>{r({})});if(t)return(0,G.Y)("div",{className:"J2RfusJI",children:(0,G.FD)("div",{className:"C90W_KKX",children:[(0,G.FD)("div",{className:"Qi7tZATP",children:[(0,G.Y)(Ze.A,{tgsUrl:Qe.w.Unlock,size:54,color:e,className:"lfcZJyxp"}),(0,G.Y)(ee.A,{name:"comments-sticker",className:"zd5EAc5e"})]}),(0,G.Y)("span",{className:"E_YZ3IQs",children:n?i((0,ce.mO)(t)?"MessagesPlaceholderPaidUser":"MessagesPlaceholderPaidChannel",{peer:(0,ce.F9)(i,t),amount:(0,he.U2)(i,n,{asFont:!0,className:"C_e1ij6A",containerClassName:"IL_EHscS"})},{withNodes:!0,withMarkdown:!0}):(0,_.A)(o("MessageLockedPremium",(0,ce.F9)(i,t)),["simple_markdown"])}),(0,G.Y)(Be.A,{color:"translucent-black",size:"default",pill:!0,onClick:n?l:d,className:"Nz8BOo0i",children:n?(0,G.FD)(G.FK,{children:[i("ButtonBuyStars"),(0,G.Y)(Xe.A,{preset:"button"})]}):o("MessagePremiumUnlock")})]})})}));var tt=function(e){return e[e.Loading=0]="Loading",e[e.Restricted=1]="Restricted",e[e.StarsRequired=2]="StarsRequired",e[e.PremiumRequired=3]="PremiumRequired",e[e.AccountInfo=4]="AccountInfo",e[e.ContactGreeting=5]="ContactGreeting",e[e.NoMessages=6]="NoMessages",e[e.MessageList=7]="MessageList",e}(tt||{});const nt=.5*I.$,ot="force-messages-scroll",it="with-bottom-snap",st=(0,w.sg)(e=>e(),200,!1),at=(0,o.ph)((0,s.EK)((e,{chatId:t,threadId:n,type:o})=>{const i=(0,u.nTw)(e),s=e.currentUserId,r=(0,u.hds)(e,t),l=(0,u.vGo)(e,t);if(!r)return{currentUserId:s};const p=(0,u.vRX)(e,t,n,o),g="scheduled"===o?(0,u.yFI)(e,t):(0,u.zeq)(e,t),f=(0,c.cG)(t,n,s);if(!(n===a.l3||f||r?.isForum||g&&n&&g[Number(n)]))return{currentUserId:s};const A=(0,h._l)(e,t),y=(0,m.G6)(e,r?.restrictionReasons),C=(0,u.yHC)(e,t,f?"saved":"all"),w=(0,u.kdX)(e,t),b=n===a.l3&&!p&&!r.unreadCount&&!w&&C&&!C.groupedId,I=(0,u.yps)(e,t),S=Boolean(l?.settings?.canAddContact),M=l?.settings?.nameChangeDate,N=l?.settings?.photoChangeDate,Y=(0,u.S0q)(e,t,n),k=(0,v.L8)(t)?void 0:(0,u.AWZ)(e,t),F=!(0,u.Vw0)(e,t,n)?.messagesCount,P=!(0,u.g29)(e)||(0,u.vGo)(e,s)?.areAdsEnabled,T=(0,u.trm)(e),D=Boolean(l?.businessIntro),x=e.isAppConfigLoaded,L=(0,u.k2W)(e,t)?.id,E=(0,u.jGY)(e,t)&&!k?.isTranslationDisabled,B=r?.hasAutoTranslation,R=(0,u.Qq_)(e),O=(0,m.Xf)(e),U=O&&O.chatId===t&&O.threadId===n&&O.type===o,{chatId:K,threadId:z,messageId:V}=i.focusedMessage||{},j=K===t&&z===n&&!V;return{isActive:U,areAdsEnabled:P,isChatLoaded:!0,isRestricted:A,restrictionReasons:y,isChannelChat:(0,c.WX)(r),isChatMonoforum:(0,c.Ve)(r),isGroupChat:(0,c.YE)(r),isChannelWithAvatars:r.areProfilesShown,isCreator:r.isCreator,isChatWithSelf:(0,u.nZ4)(e,t),isSystemBotChat:(0,c.DX)(t),isAnonymousForwards:(0,c.Qe)(t),isBot:Boolean(I),isNonContact:S,nameChangeDate:M,photoChangeDate:N,isSynced:e.isSynced,messageIds:p,messagesById:g,firstUnreadId:(0,u.RjD)(e,t,n),isViewportNewest:"thread"!==o||(0,u.haw)(e,t,n),focusingId:w,isSelectModeActive:(0,u.rTV)(e),hasLinkedChat:k?Boolean(k.linkedChatId):void 0,channelJoinInfo:k?.joinInfo,topic:Y,noMessageSendingAnimation:!(0,u.xYJ)(e,"messageSendingAnimations"),isServiceNotificationsChat:t===d.zv8,isForum:r.isForum,isEmptyThread:F,currentUserId:s,isChatProtected:(0,u.ryq)(e,t),lastMessage:b?C:void 0,isAccountFrozen:T,hasCustomGreeting:D,isAppConfigLoaded:x,monoforumChannelId:L,canTranslate:E,translationLanguage:R,shouldAutoTranslate:B,isBotForum:r.isBotForum,shouldScrollToBottom:j}})(({chatId:e,threadId:t,type:n,isChatLoaded:h,isForum:m,isChannelChat:I,isGroupChat:S,isChannelWithAvatars:M,canPost:V,isSynced:j,isActive:$,isBotForum:q,shouldScrollToBottom:H,isChatMonoforum:W,isReady:_,isChatWithSelf:Q,isSystemBotChat:Z,isAnonymousForwards:X,isCreator:ee,isBot:te,isNonContact:ne,nameChangeDate:oe,photoChangeDate:ie,messageIds:se,messagesById:ae,firstUnreadId:re,isComments:de,isViewportNewest:ce,isRestricted:ue,restrictionReasons:he,isEmptyThread:me,focusingId:pe,isSelectModeActive:ge,lastMessage:fe,hasLinkedChat:ve,withBottomShift:Ae,withDefaultBg:ye,topic:Ce,noMessageSendingAnimation:we,isServiceNotificationsChat:be,currentUserId:Ie,isContactRequirePremium:Se,paidMessagesStars:Me,areAdsEnabled:Ne,channelJoinInfo:Ye,isChatProtected:ke,isAccountFrozen:Fe,hasCustomGreeting:Pe,monoforumChannelId:Te,isAppConfigLoaded:De,canTranslate:xe,translationLanguage:Le,shouldAutoTranslate:Ee,isQuickPreview:Be,onIntersectPinnedMessage:Re,onScrollDownToggle:Oe,onNotchToggle:Ue})=>{const{loadViewportMessages:Ke,setScrollOffset:ze,loadSponsoredMessages:Ve,loadMessageReactions:je,copyMessagesByIds:Ge,loadMessageViews:Je,loadPeerStoriesByIds:$e,loadFactChecks:He,requestChatTranslation:We}=(0,s.ko)(),Qe=(0,o.li)(),Ze=(0,o.li)("thread"===n&&(0,u.j_4)((0,s.mS)(),e,t)||(0,u.rKQ)((0,s.mS)(),e,t)||0),Xe=(0,o.li)(),at=(0,o.li)(),dt=(0,o.li)(),lt=(0,o.li)(),ct=(0,o.li)(),ut=(0,o.li)(),ht=(0,o.li)(!1),mt=(0,o.li)(Boolean(fe)),pt=(0,o.li)(),gt=(0,c.cG)(e,t,Ie),ft=gt&&t!==d.Ckz,vt=Boolean(se),At=(0,v.L8)(e),yt=Boolean(!At&&!I||Q||Z||X||M);(0,E.A)(()=>{vt&&(0,w.aj)(()=>{mt.current=!1})},[vt]),(0,E.A)(()=>{lt.current=re},[re]),(0,o.vJ)(()=>{Ne&&(I||te)&&j&&_&&De&&Ve({peerId:e})},[e,j,_,I,te,Ne,De]),(0,E.A)(()=>{vt&&(ct.current=lt.current)},[vt]),(0,E.A)(()=>{ut.current=pe},[pe]),(0,o.vJ)(()=>{Ee&&xe&&We({chatId:e,toLanguageCode:Le})},[Ee,xe,Le,e]),(e=>{const t=(0,P.A)(t=>{const n=(0,D.A)();n&&n.length>1&&(t.preventDefault(),e({messageIds:n}))});(0,x.v)((0,o.Kr)(()=>({"Mod+C":t}),[]))})(Ge);const Ct=(0,o.Kr)(()=>{if(!se?.length||!ae)return;const e=[];se.forEach((t,o,i)=>{const s=e[e.length-1],a=ae[t];if(!a)return;const{shouldAppendJoinMessage:r,shouldAppendJoinMessageAfterCurrent:d}=(()=>{if(Ye&&"thread"===n)return s&&s.date<Ye.joinedDate&&Ye.joinedDate<=a.date?{shouldAppendJoinMessage:!0,shouldAppendJoinMessageAfterCurrent:!1}:o===i.length-1&&a.date<Ye.joinedDate?{shouldAppendJoinMessage:!0,shouldAppendJoinMessageAfterCurrent:!0}:void 0})()||{};if(d&&e.push(a),r){const t=d?a.id:s?.id||a.id-1;e.push({id:rt(t),chatId:a.chatId,date:Ye.joinedDate,isOutgoing:!1,content:{action:{mediaType:"action",type:"channelJoined",inviterId:Ye?.inviterId,isViaRequest:Ye?.isViaRequest||void 0}}})}d||e.push(a)});const o="scheduled"===n||be?["date","id"]:["id"];return e.length?N((0,A.My)(e,o),ct.current,m?void 0:Number(t),Q,yt):void 0},[yt,se,ae,n,be,m,t,Q,Ye]);(0,k.A)(()=>{if(!se||!ae||"scheduled"===n||Fe||!$)return;if(!I&&!S)return;const t=se.filter(e=>{const t=ae[e];return t&&t.reactions&&!t.content.action});t.length&&je({chatId:e,ids:t})},2e4),(0,k.A)(()=>{if(!se||!ae||"scheduled"===n||!$)return;const e=se.map(e=>ae[e]?.content.storyData).filter(Boolean);if(!e.length)return;const t=e.reduce((e,t)=>{const{peerId:n,id:o}=t;return e[n]||(e[n]=[]),e[n].push(o),e},{});Object.entries(t).forEach(([e,t])=>{$e({peerId:e,storyIds:t})})},3e5),(0,k.A)(()=>{if(!se||!ae||t!==a.l3||"scheduled"===n||!$)return;const o=(0,s.mS)(),i=se.filter(t=>(0,u.Vw0)(o,e,t)?.isCommentsInfo||void 0!==ae[t]?.viewsCount);i.length&&Je({chatId:e,ids:i})},2e4,!0),(0,k.A)(()=>{if(!se||!ae||t!==a.l3||"scheduled"===n||!$)return;const o=se.filter(e=>ae[e]?.factCheck?.shouldFetch);o.length&&He({chatId:e,ids:o})},5e3);const wt=(0,o.Kr)(()=>{if("thread"===n)return(0,w.sg)(()=>Ke({direction:r.TN.Around,chatId:e,threadId:t}),1e3,!0,!1)},[Ke,se]),{isScrolled:bt,updateStickyDates:It}=function(){const[e,t]=(0,O.A)(!1),n=(0,U.A)(1e3,!0);return{isScrolled:e,updateStickyDates:(0,P.A)(e=>{t(),document.body.classList.contains("is-scrolling-messages")||(0,l.RK)(()=>{document.body.classList.add("is-scrolling-messages")}),n(()=>{const t=function(e){const t=e.querySelectorAll(".sticky-date"),n=e.scrollTop,o=getComputedStyle(e),i=parseInt(o.getPropertyValue("--middle-header-panes-height"),10);return Array.from(t).find(e=>{const{offsetTop:t,offsetHeight:o}=e,s=t-n;return-o<=s&&s<=i+10})}(e);(0,l.RK)(()=>{const e=document.querySelector(".stuck");e&&e.classList.remove("stuck"),t&&t.classList.add("stuck"),document.body.classList.remove("is-scrolling-messages")})})})}}(),St=(0,P.A)(()=>{const e=Qe.current,t=e?.querySelector(".fab-trigger");if(!e||!t)return;const n=e.scrollTop+e.offsetHeight,o=t.offsetTop,s=o-7<=n&&n<=o+14;e.classList.contains(it)!==s&&(s?(0,l.RK)(()=>{(0,i.YM)(e,it)}):(clearTimeout(pt.current),pt.current=void 0,(0,l.RK)(()=>{(0,i.HW)(e,it)})))}),Mt=(0,P.A)(()=>{if(ht.current)return void(ht.current=!1);const o=Qe.current;o&&(ut.current||It(o),void 0===pt.current&&St(),st(()=>{const i=(0,s.mS)();Boolean((0,u.nTw)(i).focusedMessage?.chatId)||Re?.({shouldCancelWaiting:!0}),o.parentElement&&(Ze.current=o.scrollHeight-o.scrollTop,"thread"!==n||Be||ze({chatId:e,threadId:t,scrollOffset:Ze.current}))}))}),[Nt,Yt]=function(e,t){const[n,i]=(0,o.Ul)(),s=(0,P.A)(e=>{i(e.contentRect.height)});(0,R.A)(e,s),(0,o.vJ)(()=>{const o=Number(e.current.dataset.normalHeight)||0,i=n();i&&i>o&&t&&(e.current.dataset.normalHeight=String(i))},[t,e,n]);const a=(0,o.li)();return[n,a]}(Qe,V&&!ge),kt=(0,P.A)(e=>{if(g.$M&&e.deltaY<0){const e=Qe.current;if(!e)return;(0,l.RK)(()=>{(0,i.HW)(e,it)})}});(0,o.vJ)(()=>{if(!wt||!h||ue||pe)return;if(se&&(0,y.iL)(se[se.length-1]))return;const e=Qe.current;(!se||1===se.length||se.length<d.yo2/2&&e.firstElementChild.clientHeight<=e.offsetHeight)&&wt()},[h,se,wt,pe,ue]);const Ft=(0,L.i)(()=>{if(!se||!dt.current)return;const e=dt.current.filter(e=>se.includes(Number(e.dataset.messageId))),t=e[1]||e[0];t&&(Xe.current=t.id,at.current=t.getBoundingClientRect().top)});(0,E.A)(()=>(0,l.Uj)(()=>Ft.current()),[se,ce,Ft]),(0,o.vJ)(()=>Ft.current(),[Nt,Ft]),(0,T.A)(([e,t])=>{const n=Nt(),o=Yt.current;if(Yt.current=n,se===e&&ce===t&&n!==o&&void 0===o)return;const s=Qe.current;dt.current=Array.from(s.querySelectorAll(".message-list-item"));const a=dt.current[dt.current.length-1],r=lt.current?s.querySelector(`#${(0,c.GZ)(lt.current)}`):void 0,u=se&&e&&se[se.length-1]!==e[e.length-1],h=se?.[0]!==e?.[0]&&se?.length===d.yo2/2+1,m=u&&!h;ce&&m&&se&&se.length<d.yo2/2&&!s.parentElement.classList.contains(ot)&&(0,l.Uj)(()=>s.firstElementChild.clientHeight<=2*s.offsetHeight)&&((0,i.YM)(s.parentElement,ot),setTimeout(()=>{s.parentElement&&(0,i.HW)(s.parentElement,ot)},500)),m&&(clearTimeout(pt.current),pt.current=void 0,(0,i.HW)(s,it),pt.current=window.setTimeout(()=>{(0,l.RK)(()=>{(0,i.YM)(s,it),pt.current=void 0})},500)),(0,l.gm)(()=>{const{scrollTop:e,scrollHeight:i,offsetHeight:d}=s,c=Ze.current;let u=c-(o||d);m&&(u-=a?a.offsetHeight:0);const h=ce&&t&&u<=50,g=se&&ut.current===se[se.length-1];m&&h&&!g&&(0,l.YS)(()=>{const e=!(0,B.g1)()||!r;(0,p.Ay)({container:s,element:e?a:r,position:e?"end":"start",margin:nt,forceDuration:we?0:void 0})});const f=void 0!==o&&o!==n;if(f&&(0,p.o8)())return;const v=Xe.current&&s.querySelector(`#${Xe.current}`),A=!v&&ct.current&&s.querySelector(".unread-divider");let y;if(h&&f)y=i-d;else if(v){const t=v.getBoundingClientRect().top;y=e+(t-(at.current||0))}else y=A?Math.min((0,b.A)(A,s).top-10,i-c):i-c;return()=>{(0,C.A)(s,Math.ceil(y)),(0,p._v)(),Ze.current=Math.max(Math.ceil(i-y),d),ut.current||(ht.current=!0,(0,l.YS)(()=>{ht.current=!1,St()}))}})},[se,ce,Nt,Yt,we]),(0,F.A)(([e])=>{void 0!==e&&(0,o.VK)(200+d.xB5)},[ge]);const Pt=Boolean(!yt||I&&!M),Tt=(0,v.L8)(e)&&!Q&&!te&&!X&&"thread"===n&&(!Ct&&!fe&&se&&(!dt.current||0===dt.current.length)||1===se?.length&&"contactSignUp"===ae?.[se[0]]?.content.action?.type||"contactSignUp"===fe?.content?.action?.type),Dt=S&&ee&&1===se?.length&&"chatCreate"===ae?.[se[0]]?.content.action?.type,xt=1===se?.length&&"topicCreate"===ae?.[se[0]]?.content.action?.type,Lt=(0,f.A)("MessageList custom-scroll",Pt&&"no-avatars",!V&&"no-composer","pinned"===n&&"type-pinned",Ae&&"with-bottom-shift",ye&&"with-default-bg",ge&&"select-mode-active",bt&&"scrolled",!_&&"is-animating",ft&&"saved-dialog",ke&&"hide-on-print"),Et=Boolean(se&&Ct||fe);(0,o.vJ)(()=>{Et||Oe?.(!1)},[Et,Oe]);const Bt=ue?tt.Restricted:!Me||Et||Pe?Se&&!Et?tt.PremiumRequired:!te&&!ne||Et?Tt?tt.ContactGreeting:se&&(!Ct||Dt||xt)?tt.NoMessages:Et?tt.MessageList:tt.Loading:tt.AccountInfo:tt.StarsRequired;return(0,G.Y)(z.Ay,{ref:Qe,className:Lt,name:"fade",activeKey:Bt,shouldCleanup:!0,onScroll:Mt,onWheel:kt,onMouseDown:Y.l,children:Bt===tt.Restricted?(0,G.Y)("div",{className:"empty",children:(0,G.Y)("span",{children:he?.[0]?.text||"This is a private "+(I?"channel":"chat")})}):Bt===tt.StarsRequired?(0,G.Y)(et,{paidMessagesStars:Me,peerId:Te||e}):Bt===tt.PremiumRequired?(0,G.Y)(et,{peerId:e}):Bt===tt.AccountInfo?(0,G.Y)(le,{chatId:e,hasMessages:Et}):Bt===tt.ContactGreeting?(0,G.Y)(J,{userId:e},e):Bt===tt.NoMessages?(0,G.Y)(_e,{chatId:e,topic:Ce,type:n,isChatWithSelf:Q,isGroupChatJustCreated:Dt}):Bt===tt.MessageList?(0,G.Y)(qe,{canShowAds:Ne&&I,chatId:e,isComments:de,isChannelChat:I,isChatMonoforum:W,isSavedDialog:gt,messageIds:se||[fe.id],messageGroups:Ct||N([fe]),getContainerHeight:Nt,isViewportNewest:Boolean(ce),isUnread:Boolean(re),isEmptyThread:me,withUsers:yt,noAvatars:Pt,containerRef:Qe,anchorIdRef:Xe,memoUnreadDividerBeforeIdRef:ct,memoFirstUnreadIdRef:lt,threadId:t,type:n,isReady:_,hasLinkedChat:ve,isSchedule:!!Ct&&"scheduled"===n,shouldRenderAccountInfo:te||ne,nameChangeDate:oe,photoChangeDate:ie,noAppearanceAnimation:!Ct||!mt.current,isQuickPreview:Be,canPost:V,isBotForum:q,shouldScrollToBottom:H,onScrollDownToggle:Oe,onNotchToggle:Ue,onIntersectPinnedMessage:Re}):(0,G.Y)(K.A,{color:"white",backgroundColor:"dark"})})}));function rt(e){return e+1e-6}},47058:(e,t,n)=>{n.d(t,{A:()=>g});var o=n(84051),i=n(13439),s=n(87357),a=n(85982),r=n(43874),d=n(39351),l=n(17712),c=n(59030),u=n(64493),h=n(22699),m=n(24433);var p=n(20021);const g=(0,o.ph)(({title:e,link:t,isDisabled:n,className:g,withShare:f,onRevoke:v})=>{const A=(0,d.A)(),y=(0,c.A)(),{showNotification:C,openChatWithDraft:w}=(0,i.ko)(),{isMobile:b}=(0,r.Ay)(),I=!v,S=(0,l.A)(()=>{(0,a.eM)(t),C({message:{key:"LinkCopied"}})}),M=(0,l.A)(()=>{n||S()}),N=(0,l.A)(()=>{w({text:{text:t}})}),Y=(0,o.Kr)(()=>({onTrigger:e,isOpen:t})=>(0,p.Y)(u.A,{round:!0,ripple:!b,size:"smaller",color:"translucent",className:t?"active":"",iconName:"more",onClick:e,ariaLabel:A("AriaLabelOpenMenu")}),[b,A]);return(0,p.FD)("div",{className:g,children:[(0,p.Y)("p",{className:"vCMpiQTJ",children:y(e||"InviteLink.InviteLink")}),(0,p.FD)("div",{className:"xNjJHI7j",children:[(0,p.Y)("input",{className:(0,s.A)("form-control","Ag6k_p7b"),value:t,readOnly:!0,onClick:M}),I?(0,p.Y)(u.A,{color:"translucent",className:"obuPXobw",size:"smaller",round:!0,iconName:"copy",disabled:n,onClick:M}):(0,p.FD)(h.A,{className:"p7t3macG",trigger:Y,positionX:"right",children:[(0,p.Y)(m.A,{icon:"copy",onClick:M,disabled:n,children:y("Copy")}),v&&(0,p.Y)(m.A,{icon:"delete",onClick:v,destructive:!0,children:y("RevokeButton")})]})]}),f&&(0,p.Y)(u.A,{disabled:n,onClick:N,className:"Sbagy_Tm",children:y("FolderLinkScreen.LinkActionShare")})]})})},47067:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(84051),i=n(13439),s=n(31481),a=n(90709),r=n(63495),d=n(96454),l=n(48899),c=n(87894),u=n(39351);const h=({chat:e,user:t,folderId:n,isPinned:h,isMuted:m,canChangeFolder:p,isSavedDialog:g,currentUserId:f,isPreview:v,topics:A,handleDelete:y,handleMute:C,handleUnmute:w,handleChatFolderChange:b,handleReport:I},S=!1)=>{const M=(0,u.A)(),{isSelf:N}=t||{},Y=t?.id===s.zv8,k=(0,o.Kr)(()=>{if(e)return g?M("Delete"):(0,l.L8)(e.id)||(0,a.IC)(e)?M("DeleteChat"):(0,a.WX)(e)?M("ChannelLeave"):M("GroupLeaveGroup")},[e,g,M]);return(0,o.Kr)(()=>{if(!e||v)return;const{toggleChatPinned:o,toggleSavedDialogPinned:s,toggleChatArchived:l,markChatMessagesRead:u,markChatUnread:F,openChatInNewTab:P,openQuickPreview:T}=(0,i.ko)(),D=d.OS&&{title:r.Vq?M("ChatListOpenInNewWindow"):M("ChatListOpenInNewTab"),icon:"open-in-new-tab",handler:()=>{P(g?{chatId:f,threadId:e.id}:{chatId:e.id})}},x=!g&&!e.isForum&&{title:M("QuickPreview"),icon:"eye-outline",handler:()=>{T({id:e.id})}},L=()=>{g?s({id:e.id}):o({id:e.id,folderId:n})},E=h?{title:M("ChatListUnpinFromTop"),icon:"unpin",handler:L}:{title:M("ChatListPinToTop"),icon:"pin",handler:L},B={title:k,icon:"delete",destructive:!0,handler:y};if(g)return(0,c.oE)([D,x,E,B]);const R=p?{title:M("ChatListContextAddToFolder"),icon:"folder",handler:b}:void 0,O=m?{title:M("ChatsUnmute"),icon:"unmute",handler:w}:{title:`${M("ChatsMute")}...`,icon:"mute",handler:C};if(S)return(0,c.oE)([D,x,E,R,O]);const U=e.unreadCount||e.hasUnreadMark||Object.values(A||{}).some(({unreadCount:e})=>e)?{title:M("ChatListContextMaskAsRead"),icon:"readchats",handler:()=>u({id:e.id})}:void 0,K=e.unreadCount||e.hasUnreadMark||e.isForum?void 0:{title:M("ChatListContextMaskAsUnread"),icon:"unread",handler:()=>F({id:e.id})},z=(0,a.TJ)(e)?{title:M("Unarchive"),icon:"unarchive",handler:()=>l({id:e.id})}:{title:M("Archive"),icon:"archive",handler:()=>l({id:e.id})},V=I&&!t&&((0,a.WX)(e)||(0,a.YE)(e))?{title:M("ReportPeerReport"),icon:"flag",handler:I}:void 0,j=void 0!==n;return(0,c.oE)([D,x,R,U,K,E,!N&&O,!N&&!Y&&!j&&z,V,B])},[e,t,p,M,b,h,S,m,f,y,C,I,n,N,Y,g,k,v,A,w])}},47366:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051),i=n(17712);const s=5;function a(e=s){const[t,n]=(0,o.J0)(!0),[a,r]=(0,o.J0)(!0);return{isAtBeginning:t,isAtEnd:a,handleScroll:(0,i.A)(t=>{const{scrollHeight:o,scrollTop:i,clientHeight:s}=t.target;n(i<e),r(o-i-s<e)})}}},47526:(e,t,n)=>{n.d(t,{KE:()=>d,PP:()=>l,_u:()=>r,zS:()=>a});const o={google:"https://maps.google.com/maps",bing:"https://bing.com/maps/default.aspx",osm:"https://www.openstreetmap.org",apple:"https://maps.apple.com"},i=new Map(Object.entries({"building/medical":"#43b3f4","building/gym":"#43b3f4","education/cafeteria":"#f7943f","travel/bedandbreakfast":"#9987ff","travel/hotel":"#9987ff","travel/hostel":"#9987ff","travel/resort":"#9987ff","travel/hotel_bar":"#e56dd6",arts_entertainment:"#e56dd6",building:"#6e81b2",education:"#a57348",event:"#959595",food:"#f7943f",home:"#00aeef",nightlife:"#e56dd6",parks_outdoors:"#6cc039",shops:"#ffb300",travel:"#1c9fff",work:"#ad7854"})),s=["#e56cd5","#f89440","#9986ff","#44b3f5","#6dc139","#ff5d5a","#f87aad","#6e82b3","#f5ba21"];function a(e,t,n=15){const{lat:i,long:s}=t,a=o[e];switch(e){case"google":return`${a}/place/${i}+${s}/@${i},${s},${n}z`;case"bing":return`${a}?cp=${i}~${s}&lvl=${n}&sp=point.${i}_${s}`;case"apple":return`${a}?q=${i},${s}`;default:return`${a}/?mlat=${i}&mlon=${s}&zoom=${n}`}}function r(e,t){return 156543.03392*Math.cos(e*(Math.PI/180))/2**t}function d(e){return e?`https://ss3.4sqi.net/img/categories_v2/${e}_88.png`:""}function l(e){return e?i.get(e)||i.get(e.split("/")[0])||s[(t=e,t.split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0)%s.length)]:"#008df2";var t}},48227:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(84051),i=n(48775),s=n(39351),a=n(19806),r=n(94189);var d=n(20021);const l=(0,o.ph)(({isOpen:e,onClose:t,userName:n,messagePriceInStars:o,messagesCount:l,shouldAutoApprove:c,setAutoApprove:u,confirmHandler:h})=>{const m=(0,s.A)(),p=m("ConfirmationModalPaymentForMessage",{user:n,amount:(0,i.Kk)(m,o),totalAmount:(0,i.Kk)(m,o*l),count:l},{withMarkdown:!0,withNodes:!0,pluralValue:l}),g=m("PayForMessage",{count:l},{withNodes:!0,pluralValue:l});return(0,d.FD)(r.A,{title:m("TitleConfirmPayment"),confirmLabel:g,isOpen:e,onClose:t,confirmHandler:h,children:[p,(0,d.Y)(a.A,{className:"eScpikxM",label:m("DoNotAskAgain"),checked:c,onCheck:u})]})})},48553:(e,t,n)=>{n.d(t,{A:()=>S});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(66644),d=n(90709),l=n(91048),c=n(96454),u=n(48899),h=n(97822),m=n(2178),p=n(17712),g=n(59030),f=n(64493),v=n(22699),A=n(24433),y=n(60859),C=n(80089),w=n(80464),b=n(20021);const I=e=>{const{isOpen:t}=e,n=(0,w.A)(C.ar.Extra,"HeaderMenuContainer",!t);return n?(0,b.Y)(n,{...e}):void 0},S=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n,messageListType:o,isMobile:i})=>{const a=(0,l.hds)(e,t),r=Boolean(a&&(0,d.WX)(a)),h=Boolean(a&&(0,d.Vs)(a)),m=(0,l.wmb)(e),p=(0,l.Qq_)(e),g=(0,u.L8)(t),{doNotTranslate:f}=e.settings.byKey,v=(0,l._ls)(e,t);if(!a||v||(0,l.rTV)(e))return{noMenu:!0,language:m,translationLanguage:p,doNotTranslate:f};const A=(0,l.yps)(e,t),y=g?void 0:(0,l.AWZ)(e,t),C=g?(0,l.vGo)(e,t):void 0,w=y||C,b=(0,l.nZ4)(e,t),I="thread"===o&&n===s.l3,S="thread"===o&&n!==s.l3,M=(0,l.gjV)(e,i),N=(0,d.cG)(t,n,e.currentUserId),Y=!!g&&(0,l.apd)(e,t),k=Boolean(A&&Y),F=!k&&Boolean((0,l.I_m)(e,t)),P=Y&&!A,T=Boolean((I||a.isForum)&&(r||h)&&a.isNotJoined&&!a.isMonoforum),D=I||S,x=c.OL&&(0,u.L8)(a.id)&&!b&&!A&&!a.isSupport&&!(0,d.Qe)(a.id),L=I&&!b&&!T,E=N||I&&!T,B=c.OL&&I&&a.isCallActive,R=c.OL&&I&&!a.isCallActive&&(a.adminRights?.manageCall||a.isCreator&&(0,d.yn)(a))&&!a.isMonoforum,O=I&&y?.canViewStatistics,U=I&&y?.canViewMonetization,K=I&&!a.isMonoforum&&(h||r)&&(O||(0,d.ub)(a,"postStories")),z=!K&&(h||r)&&!a.isMonoforum,V=I?y?.requestsPending:void 0,j=Boolean(a?.isNotJoined&&a.isJoinToSend),G=Boolean(a?.isNotJoined&&a.isJoinRequest),J=!(0,l.PKK)(e),$=Boolean((0,l.qZq)(e,t)),q=(0,l.jGY)(e,t)&&!w?.isTranslationDisabled,H=(0,l.trm)(e),W=(0,d.WX)(a)?a.linkedMonoforumId:void 0;return{noMenu:!1,isChannel:r,isRightColumnShown:M,canStartBot:F,canRestartBot:k,canSubscribe:T,canSearch:D,canCall:x,canMute:L,canViewStatistics:O,canViewMonetization:U,canViewBoosts:K,canShowBoostModal:z,canLeave:E,canEnterVoiceChat:B,canCreateVoiceChat:R,pendingJoinRequests:V,shouldJoinToSend:j,shouldSendJoinRequest:G,noAnimation:J,canTranslate:q,isTranslating:$,translationLanguage:p,language:m,doNotTranslate:f,detectedChatLanguage:a.detectedLanguage,canUnblock:P,isAccountFrozen:H,channelMonoforumId:W}})(({chatId:e,threadId:t,noMenu:n,isMobile:s,isChannel:d,canStartBot:l,canRestartBot:u,canUnblock:h,canSubscribe:C,canSearch:w,canCall:S,canMute:N,canViewStatistics:Y,canViewMonetization:k,canViewBoosts:F,canShowBoostModal:P,canLeave:T,canEnterVoiceChat:D,canCreateVoiceChat:x,channelMonoforumId:L,pendingJoinRequests:E,isRightColumnShown:B,isForForum:R,canExpandActions:O,shouldJoinToSend:U,shouldSendJoinRequest:K,noAnimation:z,canTranslate:V,isTranslating:j,translationLanguage:G,language:J,detectedChatLanguage:$,doNotTranslate:q,isAccountFrozen:H,onTopicSearch:W})=>{const{joinChannel:_,sendBotCommand:Q,openMiddleSearch:Z,restartBot:X,requestMasterAndRequestCall:ee,requestNextManagementScreen:te,showNotification:ne,openChat:oe,requestChatTranslation:ie,togglePeerTranslations:se,openChatLanguageModal:ae,setSettingOption:re,unblockUser:de,setViewForumAsMessages:le,openFrozenAccountModal:ce}=(0,i.ko)(),ue=(0,o.li)(),he=(0,g.A)(),[me,pe]=(0,o.J0)(!1),[ge,fe]=(0,o.J0)(void 0),ve=(0,p.A)(()=>{pe(!0);const e=ue.current.getBoundingClientRect();fe({x:e.right,y:e.bottom})}),Ae=(0,p.A)(()=>{pe(!1)}),ye=(0,p.A)(()=>{fe(void 0)}),Ce=(0,p.A)(()=>{_({chatId:e}),K&&ne({message:he(d?"RequestToJoinChannelSentDescription":"RequestToJoinGroupSentDescription")})}),we=(0,p.A)(()=>{Q({command:"/start"})}),be=(0,p.A)(()=>{X({chatId:e})}),Ie=(0,p.A)(()=>{de({userId:e})}),Se=(0,p.A)(()=>{ie(j?{chatId:e,toLanguageCode:void 0}:{chatId:e,toLanguageCode:G})}),Me=(0,p.A)(()=>{te({screen:a.je.JoinRequests})}),Ne=(0,p.A)(()=>{R?W?.():(Z(),z?(0,r.YS)(()=>{(0,r.Uz)(M)}):M())}),Ye=(0,p.A)(()=>{oe({id:e}),le({chatId:e,isEnabled:!0})}),ke=(0,p.A)(()=>{H?ce():ee({userId:e})}),Fe=(0,p.A)(e=>{w&&c.lE&&!e.shiftKey&&(e.preventDefault(),Ne())}),Pe=(0,o.hb)((e,t)=>{const n=`TranslateLanguage${t.split("-")[0].toUpperCase()}`,o=he(n);if(o!==n)return he(e,o);const i=new Intl.DisplayNames([J],{type:"language"}).of(t);return he(`${e}Other`,i)},[J,he]),Te=(0,o.Kr)(()=>j?he("ShowOriginalButton"):Pe("TranslateToButton",G),[G,Pe,j,he]),De=(0,o.Kr)(()=>{if($)return Pe("DoNotTranslateLanguage",$)},[Pe,$]),xe=(0,p.A)(()=>{se({chatId:e,isEnabled:!1}),ie({chatId:e,toLanguageCode:void 0})}),Le=(0,p.A)(()=>{ae({chatId:e})}),Ee=(0,p.A)(()=>{$&&(re({doNotTranslate:[...q,$]}),ie({chatId:e,toLanguageCode:void 0}),ne({message:Pe("AddedToDoNotTranslate",$)}))});(0,m.v)((0,o.Kr)(()=>({"Mod+F":Fe}),[]));const Be=(0,o.Kr)(()=>({onTrigger:e,isOpen:t})=>(0,b.Y)(f.A,{round:!0,ripple:B,color:"translucent",size:"smaller",className:t?"active":"",onClick:e,ariaLabel:he("TranslateMessage"),iconName:"language"}),[B,he]);return(0,b.FD)("div",{className:"HeaderActions",children:[!R&&V&&(0,b.FD)(v.A,{className:"stickers-more-menu with-menu-transitions",trigger:Be,positionX:"right",children:[(0,b.Y)(A.A,{icon:"language",onClick:Se,children:Te}),(0,b.Y)(A.A,{icon:"replace",onClick:Le,children:he("Chat.Translate.Menu.To")}),(0,b.Y)(y.A,{}),$&&(0,b.Y)(A.A,{icon:"hand-stop",onClick:Ee,children:De}),(0,b.Y)(A.A,{icon:"close-circle",onClick:xe,children:he("Hide")})]}),!s&&(0,b.FD)(b.FK,{children:[O&&!K&&(C||U)&&(0,b.Y)(f.A,{size:"smaller",ripple:!0,fluid:!0,onClick:Ce,children:he(d?"ProfileJoinChannel":"ProfileJoinGroup")}),O&&K&&(0,b.Y)(f.A,{size:"smaller",ripple:!0,fluid:!0,onClick:Ce,children:he("ChannelJoinRequest")}),O&&l&&(0,b.Y)(f.A,{size:"smaller",ripple:!0,fluid:!0,onClick:we,children:he("BotStart")}),O&&u&&(0,b.Y)(f.A,{size:"tiny",ripple:!0,fluid:!0,onClick:be,children:he("BotRestart")}),O&&h&&(0,b.Y)(f.A,{size:"smaller",ripple:!0,fluid:!0,onClick:Ie,children:he("Unblock")}),w&&(0,b.Y)(f.A,{round:!0,ripple:B,color:"translucent",size:"smaller",onClick:Ne,ariaLabel:he("Conversation.SearchPlaceholder"),iconName:"search"}),S&&(0,b.Y)(f.A,{round:!0,color:"translucent",size:"smaller",onClick:ke,ariaLabel:"Call",iconName:"phone"})]}),!R&&Boolean(E)&&(0,b.Y)(f.A,{round:!0,className:"badge-button",ripple:B,color:"translucent",size:"smaller",iconName:"user",onClick:Me,ariaLabel:he(d?"SubscribeRequests":"MemberRequests"),children:(0,b.Y)("div",{className:"badge",children:E})}),(0,b.Y)(f.A,{ref:ue,className:me?"active":"",round:!0,ripple:!s,size:"smaller",color:"translucent",disabled:n,ariaLabel:"More actions",onClick:ve,iconName:"more"}),ge&&(0,b.Y)(I,{chatId:e,threadId:t,isOpen:me,anchor:ge,withExtraActions:s||!O,isChannel:d,canStartBot:l,canSubscribe:C,canSearch:w,canCall:S,canMute:N,canViewStatistics:Y,canViewBoosts:F,canViewMonetization:k,canShowBoostModal:P,canLeave:T,canEnterVoiceChat:D,canCreateVoiceChat:x,pendingJoinRequests:E,onJoinRequestsClick:Me,withForumActions:R,channelMonoforumId:L,onSubscribeChannel:Ce,onSearchClick:Ne,onAsMessagesClick:Ye,onClose:Ae,onCloseAnimationEnd:ye})]})}));function M(){const e=document.querySelector("#MiddleSearch input");e&&(0,h.A)(e)}},48885:(e,t,n)=>{n.d(t,{A:()=>h,S:()=>m});var o=n(84051),i=n(61433),s=n(66644),a=n(14737),r=n(17712),d=n(93545),l=n(672);const c=450,u=100;function h({ref:e,isOpen:t,isDisabled:n,withResizeObserver:i,onStateChange:h}){const[m,p]=(0,o.J0)(t),g=(0,o.li)(),f=e||g,v=(0,o.li)(0),A=(0,r.A)(()=>{p(!0),h?.({element:void 0,height:0,isOpen:!1})});(0,o.vJ)(()=>{n&&A()},[n]),(0,o.vJ)(()=>{t&&p(!0)},[t]),(0,o._W)(A),(0,a.A)(()=>{p(!1),h?.({height:0,isOpen:!1})},t?void 0:c);const y=(0,o.hb)(()=>{const e=f.current;!n&&e&&m&&(t?(0,s.gm)(()=>{const n=e.offsetHeight;return v.current=n,()=>{h?.({element:e,height:n,isOpen:t})}}):h?.({element:e,height:0,isOpen:!1}))},[t,m,n,f,h]),C=(0,l.A)(()=>{const e=f.current;e&&e.offsetHeight!==v.current&&y()},[y,f],u,!0);return(0,o.Nf)(y,[y]),(0,d.A)(f,C,!i||!m),{shouldRender:m,ref:f}}function m({list:e,noTransition:t=!1,zIndexIncrease:n,topMargin:o=0}){let a=0;for(let r=0;r<e.length;r++){const d=e[r],l=d.element;if(!l)continue;const c=`${a}px`,u=()=>{(0,i.Tv)(l,{transform:`translateY(${d.isOpen?c:`calc(${c} - ${o}px - 100%)`})`,zIndex:String(-r),transition:t?"none":""})};l.dataset.isPanelOpen||!d.isOpen||t?u():((0,i.Tv)(l,{transform:`translateY(calc(${c} - ${o}px - 100%))`,zIndex:String(n?r:-r),transition:"none"}),l.dataset.isPanelOpen="true",(0,s.Uz)(u)),a+=d.height}}},48906:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(20021);const i=function({isOwn:e}){const t=e?"M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z":"M3 17h6V0c-.193 2.84-.876 5.767-2.05 8.782-.904 2.325-2.446 4.485-4.625 6.48A1 1 0 003 17z";return(0,o.FD)("svg",{width:"9",height:"20",className:"svg-appendix",children:[(0,o.Y)("defs",{children:(0,o.FD)("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"messageAppendix",children:[(0,o.Y)("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,o.Y)("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,o.Y)("feColorMatrix",{values:"0 0 0 0 0.0621962482 0 0 0 0 0.138574144 0 0 0 0 0.185037364 0 0 0 0.15 0",in:"shadowBlurOuter1"})]})}),(0,o.FD)("g",{fill:"none","fill-rule":"evenodd",children:[(0,o.Y)("path",{d:t,fill:"#000",filter:"url(#messageAppendix)"}),(0,o.Y)("path",{d:t,fill:e?"#EEFFDE":"FFF",className:"corner"})]})]})}},49068:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"EmojiTooltip",!t);return n?(0,s.Y)(n,{...e}):void 0}},49642:(e,t,n)=>{n.d(t,{D5:()=>s,Eg:()=>r,HW:()=>d,MV:()=>i,hm:()=>l,wp:()=>c});const o={play:void 0,pause:void 0,seekbackward:void 0,seekforward:void 0,previoustrack:void 0,nexttrack:void 0,stop:void 0,seekTo:void 0};function i(e,t){const{mediaSession:n}=window.navigator;n?(e&&s(e),t&&a(t)):console.warn("MediaSession API not supported in this browser")}function s(e){const{mediaSession:t}=window.navigator;t&&(t.metadata=e??null)}function a(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...o,...e}).forEach(([e,n])=>{try{t.setActionHandler(e,n)}catch(e){}})}function r(){const{mediaSession:e}=window.navigator;e&&(e.metadata=null,a(o),e.playbackState&&(e.playbackState="none"),e.setPositionState?.())}function d(e="none"){const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function l(e){if(!e||void 0===e.position||void 0===e.duration)return;e.position=Math.min(e.position,e.duration);const{mediaSession:t}=window.navigator;t?.setPositionState?.(e)}function c({title:e,artist:t,album:n,artwork:o}){if("MediaMetadata"in window)return new window.MediaMetadata({title:e,artist:t,album:n,artwork:o})}},51083:(e,t,n)=>{n.d(t,{A:()=>I});var o=n(84051),i=n(13439),s=n(89925),a=n(90709),r=n(91048),d=n(87357),l=n(76023),c=n(4961),u=n(39351),h=n(17712),m=n(59030),p=n(41036),g=n(21849),f=n(80999),v=n(34431),A=n(18276),y=n(38102),C=n(80477),w=n(20021);const b=2.5*l.$,I=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n})=>{const o=(0,r.hds)(e,t),i=o?(0,r.ToO)(e,o):void 0,s=Boolean((0,r.zeq)(e,t)),a=n?(0,r.S0q)(e,t,n):void 0;return{chat:o,onlineCount:i,topic:a,areMessagesLoaded:s,messagesCount:a&&(0,r.QbG)(e,t,n),self:(0,r.mBe)(e,e.currentUserId),monoforumChannel:(0,r.k2W)(e,t)}})(({typingStatus:e,className:t,statusIcon:n,avatarSize:l="medium",noAvatar:I,status:S,withDots:M,withMediaViewer:N,withUsername:Y,withFullInfo:k,withUpdatingStatus:F,withChatType:P,noRtl:T,chat:D,onlineCount:x,areMessagesLoaded:L,topic:E,messagesCount:B,noStatusOrTyping:R,withStory:O,storyViewerOrigin:U,noEmojiStatus:K,emojiStatusSize:z,isSavedDialog:V,self:j,withMonoforumStatus:G,monoforumChannel:J,onClick:$,onEmojiStatusClick:q})=>{const{loadFullChat:H,openMediaViewer:W,loadMoreProfilePhotos:_}=(0,i.ko)(),Q=!G&&J?J:D,Z=(0,m.A)(),X=(0,u.A)(),ee=Q&&(0,a.Vs)(Q),te=Boolean(Q?.isForum&&E),{id:ne,isMin:oe}=Q||{},ie=(0,r._ls)((0,i.mS)(),ne);(0,o.vJ)(()=>{ne&&!oe&&(k&&H({chatId:ne}),N&&_({peerId:ne,isPreload:!0}))},[ne,oe,k,ee,N]);const se=(0,h.A)((e,t)=>{Q&&t&&(e.stopPropagation(),W({isAvatarView:!0,chatId:Q.id,mediaIndex:0,origin:"jumbo"===l?s.TQ.ProfileAvatar:s.TQ.MiddleHeaderAvatar}))}),ae=(0,o.Kr)(()=>Q&&Y&&(0,a.Kl)(Q),[Q,Y]);if(Q)return(0,w.FD)("div",{className:(0,d.A)("ChatInfo",t),dir:!T&&X.isRtl?"rtl":void 0,onClick:$,children:[!I&&!te&&(0,w.FD)(w.FK,{children:[V&&j&&(0,w.Y)(g.A,{size:l,peer:j,isSavedMessages:!0,className:"saved-dialog-avatar"},"saved-messages"),(0,w.Y)(g.A,{className:(0,d.A)(V&&"overlay-avatar"),size:l,peer:Q,withStory:O,asMessageBubble:Boolean(J),storyViewerOrigin:U,storyViewerMode:"single-peer",isSavedDialog:V,onClick:N?se:void 0},Q.id)]}),te&&(0,w.Y)(y.A,{topic:E,className:"topic-header-icon",size:b}),(0,w.FD)("div",{className:"info",children:[E?(0,w.Y)("h3",{dir:"auto",className:"fullName",children:(0,c.A)(E.title)}):(0,w.Y)(v.A,{peer:Q,isMonoforum:!G&&Boolean(J),emojiStatusSize:z,withEmojiStatus:!K,isSavedDialog:V,onEmojiStatusClick:q}),!R&&function(){if(F&&!L&&!ie)return(0,w.Y)(f.A,{className:"status",content:Z("Updating")});if(G)return(0,w.Y)("span",{className:"status",dir:"auto",children:X("MonoforumStatus")});if(D?.isMonoforum)return;if(S)return M?(0,w.Y)(f.A,{className:"status",content:S}):(0,w.FD)("span",{className:"status",dir:"auto",children:[n&&(0,w.Y)(A.A,{className:"status-icon",name:n}),(0,c.A)(S)]});if(!Q)return;if(e)return(0,w.Y)(C.A,{typingStatus:e});if(te)return(0,w.Y)("span",{className:"status",dir:"auto",children:(0,w.Y)(p.Ay,{name:"fade",shouldRestoreHeight:!0,activeKey:void 0!==B?1:2,className:"message-count-transition",children:void 0!==B?Z("messages",B,"i"):Z("lng_forum_no_messages")})});if(P)return(0,w.Y)("span",{className:"status",dir:"auto",children:Z((0,a.Gg)(Q))});const t=(0,a.sT)(Z,Q),o=x?`, ${Z("OnlineCount",x,"i")}`:void 0;return(0,w.FD)("span",{className:"status",children:[ae&&(0,w.Y)("span",{className:"handle withStatus",children:ae}),(0,w.Y)("span",{className:"group-status",children:t}),o&&(0,w.Y)("span",{className:"online-status",children:o})]})}()]})]})}))},51644:(e,t,n)=>{n.d(t,{A:()=>Y});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(90709),d=n(87357),l=n(40435),c=n(35127),u=n(43874),h=n(37661),m=n(5912),p=n(17712),g=n(37859),f=n(37960),v=n(69419),A=n(29886),y=n(73767),C=n(34201),w=n(61097),b=n(18276),I=n(27860),S=n(14413),M=n(35913),N=n(20021);const Y=(0,o.ph)((0,i.EK)(e=>({needsAgeVerification:e.appConfig.needAgeVideoVerification}))(({id:e,photo:t,messageText:n,isOwn:Y,noAvatars:k,canAutoLoad:F,isInSelectMode:P,isSelected:T,uploadProgress:D,forcedWidth:x,size:L="inline",dimensions:E,asForwarded:B,nonInteractive:R,shouldAffectAppendix:O,isDownloading:U,isProtected:K,theme:z,isInWebPage:V,clickArg:j,className:G,isMediaNsfw:J,observeIntersection:$,onClick:q,onCancelUpload:H,needsAgeVerification:W})=>{const _=(0,o.li)(),Q="extendedMediaPreview"===t.mediaType,Z=Q?void 0:t.blobUrl,X=(0,m.Vz)(_,$),{isMobile:ee}=(0,u.Ay)(),[te,ne]=(0,o.J0)(F),oe=te&&X&&!Q,{mediaData:ie,loadProgress:se}=(0,v.A)(Q?void 0:(0,r.rI)(t,L),!oe),ae=(0,A.A)(ie),re=Z||ie,{ref:de,shouldRender:le}=(0,f.A)({hasMediaData:Boolean(re),withShouldRender:!0}),ce=Boolean(x),[ue]=(0,o.J0)(!re),he=Boolean(re),me=(0,w.A)(t,he);(0,f.A)({ref:me,hasMediaData:!he});const pe=(0,w.A)(t,!ce),ge=(0,r.VD)(t),{updateContentSettings:fe,openAgeVerificationModal:ve}=(0,i.ko)(),[Ae,ye,Ce]=(0,h.A)(),[we,be]=(0,o.J0)(!1),Ie=Q||t.isSpoiler||J,[Se,Me,Ne]=(0,h.A)(Ie);(0,o.vJ)(()=>{Ie?Me():Ne()},[Ie]);const Ye=(0,p.A)(()=>{Ce(),Ne(),we&&fe({isSensitiveEnabled:!0})}),{loadProgress:ke}=(0,v.A)(Q?void 0:(0,r.rI)(t,"download"),!U,Q?void 0:(0,r.Cz)(t,"download")),{isUploading:Fe,isTransferring:Pe,transferProgress:Te}=(0,r.LK)(D||(U?ke:se),oe&&!re,void 0!==D),De=!1===(0,y.A)(te),{ref:xe,shouldRender:Le}=(0,C.A)({isOpen:Pe,noMountTransition:De,className:"slow",withShouldRender:!0}),{ref:Ee,shouldRender:Be}=(0,C.A)({isOpen:!re&&!te,withShouldRender:!0}),{ref:Re,shouldRender:Oe}=(0,C.A)({isOpen:Pe,noMountTransition:De,withShouldRender:!0}),Ue=(0,p.A)(e=>{if(Fe)H?.(j);else{if(re)return Se?J?W?void ve():void ye():void Ne():void q?.(j,e);ne(e=>!e)}});(0,g.A)(([e])=>{if(!O)return void(e&&_.current.closest(s.KFG).removeAttribute(s.D3G));const t=_.current.closest(s.KFG);if(re){const e=Number(t.closest(".Message").dataset.messageId);(0,l.A)(re,Boolean(Y),e,T,z).then(e=>{(0,a.RK)(()=>{t.style.setProperty("--appendix-bg",e),t.setAttribute(s.D3G,"")})})}else t.classList.add("has-appendix-thumb")},[O,re,Y,P,T,z]);const{width:Ke,height:ze,isSmall:Ve}=E||(0,c.yA)({media:t,isOwn:Y,asForwarded:B,noAvatars:k,isMobile:ee,messageText:n,isInWebPage:V}),je=(0,d.A)("media-inner",!Fe&&!R&&"interactive",Ve&&"small-image",(Ke===ze||"pictogram"===L)&&"square-image",ze<c.ej&&"fix-min-height",G),Ge=E?` width: ${Ke}px; left: ${E.x}px; top: ${E.y}px;`:"",Je="inline"===L?`height: ${ze}px;${Ge}`:void 0;return(0,N.FD)("div",{id:e,ref:_,className:je,style:Je,onClick:Fe?void 0:Ue,children:[ce&&(0,N.Y)("canvas",{ref:pe,className:"thumbnail blurred-bg"}),le&&(0,N.Y)("img",{ref:de,src:re||ae,className:(0,d.A)("full-media",ce&&"with-blurred-bg"),alt:"",style:x?`width: ${x}px`:void 0,draggable:!K}),ue&&(0,N.Y)("canvas",{ref:me,className:"thumbnail"}),K&&(0,N.Y)("span",{className:"protector"}),Le&&!Be&&(0,N.Y)("div",{ref:xe,className:"media-loading",children:(0,N.Y)(M.A,{progress:Te,onClick:Fe?Ue:void 0})}),Be&&(0,N.Y)(b.A,{ref:Ee,name:"download"}),(0,N.Y)(I.A,{isVisible:Se,withAnimation:!0,thumbDataUri:ge,width:Ke,height:ze,className:"media-spoiler",isNsfw:J}),Oe&&(0,N.Y)("span",{ref:Re,className:"message-transfer-progress",children:`${Math.round(100*Te)}%`}),(0,N.Y)(S.A,{isOpen:Ae,onClose:Ce,shouldAlwaysShow:we,onAlwaysShowChanged:be,confirmHandler:Ye})]})}))},52844:(e,t,n)=>{let o;function i(e="*",t,n=!1){o||(o=document.createElement("input"),o.setAttribute("type","file")),o.setAttribute("accept",e),n?o.removeAttribute("multiple"):o.setAttribute("multiple","multiple"),o.onchange=null,o.value="",o.onchange=t,o.click()}n.d(t,{p:()=>i})},52988:(e,t,n)=>{n.d(t,{A:()=>w});var o=n(84051),i=n(96454),s=n(87357),a=n(17663),r=n(91525),d=n(76023),l=n(4961),c=n(43874),u=n(45470),h=n(39351),m=n(83057),p=n(59030),g=n(50680),f=n(96530),v=n(35913),A=n(70832),y=n(18276),C=n(20021);const w=(0,o.ph)(({ref:e,id:t,name:n,size:w,extension:b="",timestamp:I,sender:S,thumbnailDataUri:M,previewData:N,className:Y,smaller:k,isTransferring:F,isUploading:P,isSelectable:T,isSelected:D,transferProgress:x,actionIcon:L,onClick:E,onDateClick:B})=>{const R=(0,p.A)(),O=(0,h.A)();let U=(0,o.li)();e&&(U=e);const{isMobile:K}=(0,c.Ay)(),[z]=(0,o.J0)(!N),V=Boolean(N),j=(0,u.A)(M,V,K&&!i.QH),G=(0,m.A)(!V),{shouldRender:J,transitionClassNames:$}=(0,g.A)(F,void 0,!0),q=(0,r.fE)(b),{width:H,height:W}=(0,d.tP)(k),_=(0,s.A)("File",Y,k&&"smaller",E&&!P&&"interactive",D&&"file-is-selected");return(0,C.FD)("div",{id:t,ref:U,className:_,dir:O.isRtl?"rtl":void 0,children:[T&&(0,C.Y)("div",{className:"message-select-control no-selection",children:D&&(0,C.Y)(y.A,{name:"select"})}),(0,C.FD)("div",{className:"file-icon-container",onClick:P?void 0:E,children:[M||N?(0,C.FD)("div",{className:"file-preview media-inner",children:[(0,C.Y)("img",{src:N,className:"full-media",width:H,height:W,draggable:!1,alt:""}),z&&(0,C.Y)("canvas",{ref:j,className:(0,s.A)("thumbnail",G)})]}):(0,C.Y)("div",{className:`file-icon ${q}`,children:b.length<=4&&(0,C.Y)("span",{className:"file-ext",dir:"auto",children:b})}),J&&(0,C.Y)("div",{className:(0,s.A)("file-progress",q,$),children:(0,C.Y)(v.A,{progress:x,size:k?"s":"m",onClick:P?E:void 0})}),E&&(0,C.Y)(y.A,{name:L||"download",className:(0,s.A)("action-icon",J&&"hidden")})]}),(0,C.FD)("div",{className:"file-info",children:[(0,C.Y)("div",{className:"file-title",dir:"auto",title:n,children:(0,l.A)(n)}),(0,C.FD)("div",{className:"file-subtitle",dir:"auto",children:[(0,C.Y)(A.A,{size:w,progress:F?x:void 0}),S&&(0,C.FD)(C.FK,{children:[(0,C.Y)("span",{className:"bullet",children:"•"}),(0,C.Y)("span",{className:"file-sender",children:(0,l.A)(S)})]}),!S&&Boolean(I)&&(0,C.FD)(C.FK,{children:[(0,C.Y)("span",{className:"bullet",children:"•"}),(0,C.Y)(f.A,{onClick:B,children:(0,a.fS)(R,1e3*I,!0)})]})]})]}),S&&Boolean(I)&&(0,C.Y)(f.A,{onClick:B,children:(0,a.be)(R,1e3*I)})]})})},53827:(e,t,n)=>{n.d(t,{_K:()=>g,dj:()=>A,kz:()=>f});var o=n(13439),i=n(89925),s=n(91048),a=n(96454),r=n(60343),d=n(80853),l=n(41733);const c=new Map;let u,h=[],m=[];function p(e,t){const n=u&&c.get(u);n&&(n.audio.pause(),n.audio.currentTime=0,n.onTrackChange&&n.onTrackChange());const a=v(e,(0,s.nTw)((0,o.mS)()).audioPlayer.origin||i.d9.Inline,t);if(!a)return;if(!c.has(a))return void(0,o.ko)().openAudioPlayer((0,r.ES)(y(a).messageKey));const d=c.get(a);d.onForcePlay&&d.onForcePlay(),u=a,d.audio.src&&(0,l.A)(d.audio)}function g(){const e=u&&c.get(u);e&&e.audio.pause()}function f(e,t,n,g,f){if(!c.has(e)){const n=function(e,t,n,o){const i=new Audio;function s(t){return n=>{c.has(e)&&((0,d.f)(i)||c.get(e).handlers.forEach(e=>{e(t,n)}))}}return i.addEventListener("timeupdate",s("onTimeUpdate")),i.addEventListener("play",s("onPlay")),i.addEventListener("pause",s("onPause")),i.addEventListener("loadstart",s("onLoadStart")),i.addEventListener("loadeddata",s("onLoadedData")),i.addEventListener("playing",s("onPlaying")),i.addEventListener("ended",()=>{c.has(e)&&((0,d.f)(i)||p(e))}),{audio:i,type:t,proxy:new Proxy(i,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:n,onTrackChange:o}}(e,t,g,f);c.set(e,n),function(e,t){"audio"!==e.type||m.includes(t)||(m.push(t),m.sort(C)),"voice"!==e.type||h.includes(t)||(h.push(t),h.sort(C))}(n,e)}const{audio:A,proxy:w,handlers:b}=c.get(e);return b.push(n),{play(n){if(!A.paused)return;const p=u&&c.get(u);p&&u!==e&&(p.audio.pause(),p.audio.currentTime=0,(0,d.f)(p.audio)&&(p.audio.dataset.preventPlayAfterPatch="true"),p.onTrackChange&&p.onTrackChange()),u=e,A.src||(A.src=n,A.preload="auto",n.includes("/progressive/")&&a.Yw&&(delete A.dataset.preventPlayAfterPatch,(0,d.C)(A))),(0,l.A)(A),function(e,t){if((0,s.nTw)((0,o.mS)()).globalSearch.currentContent===i.$C.Music)return;const{chatId:n}=(0,r.ES)(y(t).messageKey),a=(0,s.Xf0)((0,o.mS)())?.chatId,d=e=>e.startsWith(`msg${n}`)||a&&e.startsWith(`msg${a}`);"audio"===e&&(m=m.filter(d)),"voice"===e&&(h=h.filter(d))}(t,e)},pause(){u===e&&A.pause()},stop(){if(u===e){const e=A.src;A.pause(),A.addEventListener("pause",()=>{A.src="",A.src=e},{once:!0})}},setCurrentTime(t){u===e&&(A.fastSeek?A.fastSeek(t):A.currentTime=t)},setVolume(t){u===e&&(A.volume=t,A.muted=!1)},setPlaybackRate(t){u===e&&(A.playbackRate=t)},toggleMuted(e){A.muted=void 0===e?!A.muted:e},proxy:w,requestNextTrack(){p(e)},isLast:()=>!v(e,(0,s.nTw)((0,o.mS)()).audioPlayer.origin),isFirst:()=>!v(e,(0,s.nTw)((0,o.mS)()).audioPlayer.origin,!0),requestPreviousTrack(){p(e,!0)},destroy(t=!1){const o=c.get(e);o&&(o.handlers=o.handlers.filter(e=>e!==n),o.handlers.length||(o.audio.pause(),c.delete(e),t&&function(e,t){const n=e=>e!==t;"audio"===e.type&&(m=m.filter(n)),"voice"===e.type&&(h=h.filter(n))}(o,e),e===u&&(u=void 0)))}}}function v(e,t=i.d9.Inline,n){const o=function(e){switch(e.type){case"audio":return m;case"voice":return h;default:return}}(c.get(e));if(!o)return;if(t===i.d9.Search){const t=o.indexOf(e);if(t<0)return;return o[t+(n?-1:1)]}const{chatId:s}=(0,r.ES)(y(e).messageKey),a=o.filter(e=>e.startsWith(`msg${s}`)),d=a.indexOf(e);if(d<0)return;let l=t===i.d9.Inline?-1:1;return n&&(l*=-1),a[d+l]}function A(e){const t=(0,r.AD)(e);if(t)return`${t}-${e.date}`}function y(e){return{messageKey:e.match(/^msg(-?\d+)-(\d+)/)[0],date:Number(e.split("-").pop())}}function C(e,t){if(!e||!t)return 0;const{date:n,messageKey:o}=y(e),{date:i,messageKey:s}=y(t),a=i-n;return 0===a?s.localeCompare(o):a}},54314:(e,t,n)=>{n.d(t,{A:()=>f});var o=n(84051),i=n(13439),s=n(90709),a=n(91048),r=n(48899),d=n(4961),l=n(39351),c=n(17712),u=n(59030),h=n(64493),m=n(22337),p=n(21849),g=n(20021);const f=(0,o.ph)((0,i.EK)((e,{chat:t,isSavedDialog:n})=>{const o=(0,r.L8)(t.id),i=(0,a.nZ4)(e,t.id),d=o&&(0,a.mBe)(e,(0,s.e7)(t)),l=d&&(0,s.tv)(d)&&!t.isSupport,c=o&&!i&&!l&&!n,u=o?(0,s.u0)((0,a.mBe)(e,(0,s.e7)(t))):void 0;return{isPrivateChat:o,isChatWithSelf:i,isBot:l,isChannel:(0,s.WX)(t),isBasicGroup:(0,s.yn)(t),isSuperGroup:(0,s.Vs)(t),currentUserId:e.currentUserId,canDeleteForAll:c,contactName:u}})(({isOpen:e,chat:t,isSavedDialog:n,isChannel:o,isPrivateChat:a,isChatWithSelf:r,isBot:f,isBasicGroup:v,isSuperGroup:A,currentUserId:y,canDeleteForAll:C,contactName:w,onClose:b,onCloseAnimationEnd:I})=>{const{leaveChannel:S,deleteHistory:M,deleteSavedHistory:N,deleteChannel:Y,deleteChatUser:k,blockUser:F,deleteChat:P}=(0,i.ko)(),T=(0,u.A)(),D=(0,l.A)(),x=(0,s.Js)(D,t),L=(0,c.A)(()=>{M({chatId:t.id,shouldDeleteForAll:!0}),b()}),E=(0,c.A)(()=>{M({chatId:t.id,shouldDeleteForAll:!0}),F({userId:t.id}),b()}),B=(0,c.A)(()=>{n?N({chatId:t.id}):a?M({chatId:t.id,shouldDeleteForAll:!1}):v?t.isCreator?(M({chatId:t.id,shouldDeleteForAll:!0}),P({chatId:t.id})):(M({chatId:t.id,shouldDeleteForAll:!1}),k({chatId:t.id,userId:y})):!o&&!A||t.isCreator?(o||A)&&t.isCreator&&Y({chatId:t.id}):S({chatId:t.id}),b()}),R=(0,c.A)(()=>{o||A?(S({chatId:t.id}),b()):v&&t.isCreator?(M({chatId:t.id,shouldDeleteForAll:!1}),k({chatId:t.id,userId:y})):B()});return(0,g.FD)(m.A,{isOpen:e,className:"DeleteChatModal",header:(0,g.FD)("div",{className:"modal-header",dir:D.isRtl?"rtl":void 0,children:[(0,g.Y)(p.A,{size:"tiny",peer:t,isSavedMessages:r}),(0,g.Y)("h3",{className:"modal-title",children:T(n?r?"ClearHistoryMyNotesTitle":"ClearHistoryTitleSingle2":o&&!t.isCreator?"LeaveChannel":o&&t.isCreator?"ChannelDelete":v||A?"Group.LeaveGroup":"DeleteChatUser")})]}),onClose:b,onCloseAnimationEnd:I,children:[n?(0,g.Y)("p",{children:(0,d.A)(r?T("ClearHistoryMyNotesMessage"):T("ClearHistoryMessageSingle",x),["simple_markdown","emoji"])}):o&&t.isCreator?(0,g.Y)("p",{children:(0,d.A)(T("ChatList.DeleteAndLeaveGroupConfirmation",x),["simple_markdown","emoji"])}):o&&!t.isCreator||v||A?(0,g.Y)("p",{children:(0,d.A)(T("ChannelLeaveAlertWithName",x),["simple_markdown","emoji"])}):(0,g.Y)("p",{children:(0,d.A)(T("ChatList.DeleteChatConfirmation",w),["simple_markdown","emoji"])}),(0,g.FD)("div",{className:"dialog-buttons-column",children:[f&&!n&&(0,g.Y)(h.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:E,children:T("DeleteAndStop")}),C&&(0,g.Y)(h.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:L,children:w?(0,d.A)(T("ChatList.DeleteForEveryone",w)):T("DeleteForAll")}),!a&&t.isCreator&&!n&&(0,g.Y)(h.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:B,children:T("DeleteForAll")}),(0,g.Y)(h.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:a||n?B:R,children:T(n?"Delete":o&&!t.isCreator?"LeaveChannel":o&&t.isCreator?"Chat.Input.Delete":v||A?"Group.LeaveGroup":C?"ChatList.DeleteForCurrentUser":"Delete")}),(0,g.Y)(h.A,{className:"confirm-dialog-button",isText:!0,onClick:b,children:T("Cancel")})]})]})}))},54639:(e,t,n)=>{n.d(t,{A:()=>y});var o=n(84051),i=n(13439),s=n(37661),a=n(17712),r=n(59030),d=n(71429),l=n(24433),c=n(23174),u=n(90709),h=n(87357),m=n(43874),p=n(62587);const g="VGmPJoga";var f=n(20021);const v=/#fff/gi,A=(0,o.ph)(({icon:e,theme:t})=>{const{isTouchScreen:n}=(0,m.Ay)(),i=(0,p.A)((0,u.mr)(e,"full"),!1,c.qZ.Text),s=(0,o.Kr)(()=>{if(!i)return"";const e="dark"===t?"rgb(170, 170, 170)":"rgb(112, 117, 121)",n=i.replace(v,e),o=(new DOMParser).parseFromString(n,"image/svg+xml");return o.querySelectorAll("path").forEach(t=>{t.style.stroke=e,t.style.strokeWidth="0.5px"}),`data:image/svg+xml;utf8,${o.documentElement.outerHTML}`},[i,t]);return(0,f.Y)("i",{className:(0,h.A)("mklnEg0s","icon",!n&&g),children:(0,f.Y)("img",{src:s,alt:"",className:(0,h.A)("tT8KQwg0",!n&&g),draggable:!1})})}),y=(0,o.ph)(({bot:e,theme:t,chatId:n,threadId:c,isInSideMenu:u,canShowNew:h,onMenuOpened:m,onMenuClosed:p})=>{const{callAttachBot:g,toggleAttachBot:v}=(0,i.ko)(),y=(0,r.A)(),C=(0,o.Kr)(()=>e.icons.find(({name:e})=>"default_static"===e)?.document,[e.icons]),[w,b,I]=(0,s.A)(),[S,M]=(0,o.J0)(void 0),N=(0,a.A)(e=>{e.preventDefault();const t=e.currentTarget.getBoundingClientRect();M({x:t.right,y:t.bottom}),m(),b()}),Y=(0,a.A)(()=>{g(u?{bot:e,isFromSideMenu:!0}:{bot:e,chatId:n,threadId:c})}),k=(0,a.A)(()=>{I(),p()}),F=(0,a.A)(()=>{M(void 0)}),P=(0,a.A)(()=>{v({botId:e.id,isEnabled:!1})});return(0,f.FD)(l.A,{customIcon:C&&(0,f.Y)(A,{icon:C,theme:t}),icon:C?void 0:"bots",onClick:Y,onContextMenu:N,children:[e.shortName,h&&e.isDisclaimerNeeded&&(0,f.Y)("span",{className:"menu-item-badge",children:y("New")}),S&&(0,f.Y)(d.A,{isOpen:w,positionX:"right",style:`left: ${S.x}px;top: ${S.y}px;`,className:"bot-attach-context-menu",autoClose:!0,withPortal:!0,onClose:k,onCloseAnimationEnd:F,children:(0,f.Y)(l.A,{icon:"stop",destructive:!0,onClick:P,children:y("WebApp.RemoveBot")})})]},e.id)})},54699:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(30857),i=n(32625);function s(e){const t=(0,o.A)();(0,i.A)(t,e,!0)}},55153:(e,t,n)=>{n.d(t,{A:()=>u,L:()=>h});var o=n(31481),i=n(87679),s=n(24909);const a=1280,r=2560,d=40,l=20,c=/\.[^/.]+$/;async function u(e,t,l){const h=URL.createObjectURL(t),{type:p,size:g}=t;let f,v,A,y;const C=l?.shouldSendInHighQuality;if(o.gex.has(p)){const n=await(0,i.NN)(h),{width:g,height:v}=n;y=!m(g,v);const w=C?r:a,b=Math.max(g,v)>w,I=p===o.Vz3;if(!y){if(!l?.compressedBlobUrl&&!I&&(b||"image/jpeg"!==p)){const n=await(0,s.s)(h,b?w/Math.max(g,v):1,"image/jpeg");return URL.revokeObjectURL(h),u(e,t,{...l,compressedBlobUrl:n})}"image/jpeg"===p&&(e=e.replace(c,".jpg")),f={width:g,height:v}}A=Math.max(g,v)>d?await(0,s.s)(h,d/Math.max(g,v),"image/jpeg"):h}else if(o.fNs.has(p)){try{const{videoWidth:e,videoHeight:t,duration:n}=await(0,i.FW)(h);y=!m(e,t),y||(f={width:e,height:t,duration:n})}catch(e){y=!0}A=await(0,i.eT)(h)}else if(o.IH3.has(p)){const{duration:e,title:t,performer:o,coverUrl:s}=await async function(e){const{parseBlob:t,selectCover:o}=await n.e(6911).then(n.bind(n,26911)),s=await(0,i.sZ)(e),a=await t(s),{common:{title:r,artist:d,picture:l},format:{duration:c}}=a,u=o(l),h=u?new Blob([u.data],{type:u.format}):void 0;return{title:r,performer:d,duration:c,coverUrl:h?URL.createObjectURL(h):void 0}}(h);v={duration:e||0,title:t,performer:o},A=s}return{blob:t,blobUrl:h,filename:e,mimeType:p,size:g,quick:f,audio:v,previewBlobUrl:A,shouldSendAsFile:y||void 0,uniqueId:`${Date.now()}-${Math.random()}`,...l}}function h(e,t){return e.map(e=>t?e.compressedBlobUrl?{...e,blobUrl:e.compressedBlobUrl}:e:{...e,shouldSendAsFile:!(e.voice||e.audio)||void 0,shouldSendAsSpoiler:void 0})}function m(e,t){return Math.max(e,t)/Math.min(e,t)<=l}},55317:(e,t,n)=>{function o(e,t){const{level:n,boosts:o,currentLevelBoosts:i,nextLevelBoosts:s,hasMyBoost:a,prepaidGiveaways:r}=e,d=t&&o===i&&a;return{currentLevel:d?n-1:n,hasNextLevel:Boolean(s),boosts:o,levelProgress:!s||d?1:(o-i)/(s-i),remainingBoosts:s?s-o:0,isMaxLevel:void 0===s,prepaidGiveaways:r}}n.d(t,{z:()=>o})},55429:(e,t,n)=>{n.d(t,{N:()=>a});var o=n(90709),i=n(70636),s=n(48899);function a(e,t,n,a){const{senderId:r}=t;if(!r)return;const d=(0,s.L8)(r)?a[r]:n[r];let l=(0,i.F9)(e,d);const c=n[t.chatId];return c&&("isSelf"in d&&d.isSelf?l=`${e("FromYou")} → ${(0,o.Js)(e,c)}`:(0,o.YE)(c)&&(l+=` → ${(0,o.Js)(e,c)}`)),l}},55723:(e,t,n)=>{n.d(t,{A:()=>S});var o=n(84051),i=n(13439),s=n(90709),a=n(10315),r=n(91525),d=n(27336),l=n(91048),c=n(96454),u=n(87679),h=n(58554);const m=new(n(84947).A)(100);var p=n(37661),g=n(5912),f=n(17712),v=n(62587),A=n(69419),y=n(59030),C=n(19806),w=n(94189),b=n(52988),I=n(20021);const S=(0,o.ph)(({document:e,observeIntersection:t,smaller:n,canAutoLoad:S,autoLoadFileMaxSizeMb:M,uploadProgress:N,datetime:Y,className:k,sender:F,isSelected:P,isSelectable:T,shouldWarnAboutFiles:D,isDownloading:x,message:L,id:E,onCancelUpload:B,onMediaClick:R,onDateClick:O})=>{const{cancelMediaDownload:U,downloadMedia:K,setSharedSettingOption:z}=(0,i.ko)(),V=(0,o.li)(),j=(0,y.A)(),[G,J,$]=(0,p.A)(),[q,H]=(0,o.J0)(!1),{fileName:W,size:_,mimeType:Q}=e,Z=(0,r.rK)(e)||"",X=(0,g.Vz)(V,t),[ee,te]=(0,p.A)();(0,o.vJ)(()=>{X&&te()},[X,te]);const[ne,oe]=(0,o.J0)(S&&(!M||_<=1048576*M)),ie=Boolean(x||ne&&ee),se=(0,s.mr)(e,"download"),{loadProgress:ae,mediaData:re}=(0,A.A)(se,!ie,(0,s.Cz)(e,"download"),void 0,!0),de=Boolean(re),{isUploading:le,isTransferring:ce,transferProgress:ue}=(0,s.LK)(N||ae,ie&&!de,void 0!==N),he=(0,r.ON)(e),me=he?(0,s.VD)(e):void 0,pe=he?e.previewBlobUrl:void 0,ge=(0,v.A)((0,s.mr)(e,"pictogram"),!X),fe="photo"===e.innerMediaType&&e.mediaSize&&!e.mediaSize.fromDocumentAttribute&&!e.mediaSize.fromPreload,ve=R&&e.innerMediaType&&!fe;(0,o.vJ)(()=>{const e=V.current;if(!ve||!e||!L)return;const t=()=>{!async function(e){const t=(0,s.Op)(e),n=(0,s.nd)(e),o=t||n,a=n&&n.mediaSize&&!n.mediaSize.fromDocumentAttribute;if(!o||o.previewBlobUrl||a)return;const r=(0,s.mr)(o,"full");if(!r||m.has(r))return;m.set(r,void 0);const p=await(0,h.hd)(r,(0,s.Cz)(o,"full"));if(!p)return;let g;if(t&&c.Uz){const e=await(0,u.FW)(p);g={width:e.videoWidth,height:e.videoHeight,fromPreload:!0}}if(n){const e=await(0,u.NN)(p);g={width:e.naturalWidth,height:e.naturalHeight,fromPreload:!0}}if(!g||g.width<=0||g.height<=0)return;let f=(0,i.mS)();const v=(0,l.O5q)(f,e.chatId,e.id);v&&v.content.document&&(f=(0,d.r3y)(f,e.chatId,e.id,{content:{...v.content,document:{...v.content.document,mediaSize:g}}}),(0,i.UF)(f))}(L)};return e.addEventListener("mouseenter",t),()=>{e.removeEventListener("mouseenter",t)}},[ve,L]);const Ae=(0,f.A)(()=>{K({media:e,originMessage:L})}),ye=(0,f.A)(()=>{le?B&&B():x?U({media:e}):ce?oe(!1):ve?L?R?.(L.id):R&&R():(0,a.N)({mimeType:Q,extension:Z})&&D?J():Ae()}),Ce=(0,f.A)(()=>{z({shouldWarnAboutFiles:!q}),$(),Ae()}),we=(0,f.A)(()=>{O?.(L)});return(0,I.FD)(I.FK,{children:[(0,I.Y)(b.A,{ref:V,id:E,name:W,extension:Z,size:_,timestamp:Y,thumbnailDataUri:me,previewData:pe||ge,smaller:n,isTransferring:ce,isUploading:le,transferProgress:ue,className:k,sender:F,isSelectable:T,isSelected:P,actionIcon:ve?(0,s.hr)(e)?"play":"eye":"download",onClick:ye,onDateClick:O?we:void 0}),(0,I.FD)(w.A,{isOpen:G,onClose:$,confirmHandler:Ce,children:[j("lng_launch_svg_warning"),(0,I.Y)(C.A,{className:"dialog-checkbox",checked:q,label:j("lng_launch_exe_dont_ask"),onCheck:H})]})]})})},59324:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(84051),i=n(57474),s=n(41036),a=n(18276);var r=n(20021);const d=(0,o.ph)(({iconName:e,isLoading:t})=>(0,r.Y)(s.Ay,{className:"LLqNvbR9",activeKey:t?0:1,name:"fade",children:t?(0,r.Y)(i.A,{className:"PbV71feg",color:"white"}):(0,r.Y)(a.A,{className:"sohV68PB",name:e})}))},59816:(e,t,n)=>{n.d(t,{A:()=>F});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(87357),d=n(95807),l=n(39751),c=n(90709),u=n(48899),h=n(76023),m=n(82117),p=n(17712),g=n(93545),f=n(11241);const v="pruw1nLm";var A=n(20021);const y=(0,o.ph)(({story:e,mediaArea:t,index:n,className:s,style:a,isPreview:l})=>{const{sendStoryReaction:v}=(0,i.ko)(),y=(0,o.li)(),[C,w]=(0,o.J0)(1.5*h.$),{peerId:b,id:I,views:S}=e,{reactions:M}=S||{},{reaction:N,isDark:Y,isFlipped:k}=t,F=!(0,u.L8)(b),P=`${(0,c.$_)(b,I)}-${n}-${l?"preview":"viewer"}`,T=(0,o.Kr)(()=>M?.find(e=>(0,c.a0)(e.reaction,N))?.count,[N,M]),D=!l&&Boolean(T)&&F,x=(0,p.A)(()=>{if(!y.current)return;const e=y.current.clientHeight;w(Math.round(.6*e))});(0,m.A)(([e])=>{Boolean(T)!==Boolean(e)&&x()},[T]),(0,g.A)(y,x);const L=(0,p.A)(()=>{v({peerId:b,storyId:I,containerId:P,reaction:N})});return(0,A.FD)("div",{ref:y,className:(0,r.A)(Y?"eic2vQ8c":"_7esBA3m",s),style:(0,d.A)(a,`--custom-emoji-size: ${C}px`),onClick:L,children:[(0,A.Y)("div",{className:(0,r.A)("c3ajA3hg",k&&"furSXGdL")}),Boolean(C)&&(0,A.Y)(f.A,{className:(0,r.A)("Et3MvYmN",D&&"mFTLUHm2"),reaction:N,containerId:P,size:C,effectSize:4*C,shouldPause:l,shouldLoop:!l}),D&&(0,A.Y)("span",{className:"Tr8mYyDk",children:T})]})});var C=n(61433),w=n(91048),b=n(48894);const I=e=>Boolean("en-US"===navigator.language)?`${Math.round(9*e/5+32)}°F`:`${Math.round(e)}°C`;var S=n(87412);const M=(0,o.ph)((0,i.EK)((e,t)=>{const{mediaArea:n}=t;return{restrictedEmoji:(0,w.GHK)(e,n.emoji)}})(({mediaArea:e,className:t,style:n,restrictedEmoji:i,isPreview:s})=>{const l=(0,o.li)(),[c,u]=(0,o.J0)(0),{temperatureC:h,color:m}=e,f=(0,b.t)(m),v=(0,b.vG)(m),y=(0,p.A)(e=>{if(!l.current)return;const t=l.current,n=t.clientHeight,o=Math.round(.7*n);u(o);const i=()=>{(0,C.Tv)(t,{"--custom-emoji-size":`${o}px`,"font-size":n/32+"rem"})};if(e)return i;(0,a.RK)(i)});return(0,o.Nf)(()=>{(0,a.gm)(()=>y(!0))},[]),(0,g.A)(l,()=>y()),(0,A.Y)("div",{ref:l,className:(0,r.A)("KBjMtRUS",t),style:(0,d.A)(n,`--custom-background-color: ${f}`,`color: ${v}`),children:(0,A.FD)("div",{className:"IFChB3tD",children:[i&&(0,A.Y)(S.A,{documentId:i.id,size:c,noPlay:s,withTranslucentThumb:!0,forceAlways:!0},i.id),(0,A.Y)("p",{className:"_ke1UBIl",children:I(h)})]})})})),N=9/16,Y=new Set(["channelPost","uniqueGift"]);function k(e,t){const{x:n,y:o,width:i,height:s,rotation:a,radius:r}=e.coordinates;let l="";if(t&&r&&t>0){const e=t*(i/100),n=t*(s/100);l=Math.min(e,n)*(r/100)+"px"}return(0,d.A)(`left: ${n}%`,`top: ${o}%`,`width: ${i}%`,`height: ${s}%`,`transform: rotate(${a}deg) translate(-50%, -50%)`,l&&`border-radius: ${l}`)}const F=(0,o.ph)(({story:e,isActive:t,className:n,isStoryPlaying:d})=>{const{openMapModal:c,openUniqueGiftBySlug:u,focusMessage:h,closeStoryViewer:m,openUrl:p}=(0,i.ko)(),g=(0,o.li)(),[f,C]=(0,o.J0)(0),w=(0,l.A)();(0,o.vJ)(()=>{if(!g.current)return;const e=g.current;if(C(e.clientWidth),w.width>s.c2m)return void(0,a.RK)(()=>{e.style.removeProperty("--media-width"),e.style.removeProperty("--media-height")});const t=w.width/w.height,n=t<N?e.clientHeight*N:e.clientWidth,o=t<N?e.clientHeight:e.clientWidth/N;(0,a.RK)(()=>{e.style.setProperty("--media-width",`${n}px`),e.style.setProperty("--media-height",`${o}px`)})},[t,w]);const b=e.mediaAreas;return(0,A.Y)("div",{className:(0,r.A)("RXAMu4VD",!t&&"_5HkplWee",n),ref:g,children:b?.map((n,o)=>{switch(n.type){case"geoPoint":case"venue":case"channelPost":case"url":case"uniqueGift":{const e=t&&!Y.has(n.type);return(0,A.Y)("div",{className:(0,r.A)(v,e&&"xFjJpeOA"),style:k(n),onClick:()=>(e=>{switch(e.type){case"geoPoint":case"venue":c({geoPoint:e.geo});break;case"channelPost":h({chatId:e.channelId,messageId:e.messageId}),m();break;case"url":p({url:e.url});break;case"uniqueGift":u({slug:e.slug})}})(n)})}case"suggestedReaction":return(0,A.Y)(y,{story:e,mediaArea:n,index:o,isPreview:!t,className:v,style:k(n)},`${n.type}-${o}`);case"weather":return(0,A.Y)(M,{mediaArea:n,className:v,style:k(n,f),isPreview:!t||d},`${n.type}-${o}`);default:return}})})})},60138:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051),i=n(37836),s=n(17712);function a(e){const t=(0,s.A)(e);(0,o.vJ)(()=>(0,i.yu)(t),[t])}},61097:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(90709),i=n(84051),s=n(66644),a=n(67054),r=n(87679),d=n(41074),l=n(17712);const c=.1;let u=-1;function h(e,t){return function(e,t=!1){const n=(0,i.li)(),o=(0,i.Kr)(()=>(0,a.A)(d.bP,++u),[]),h=(0,i.li)(),m=(0,l.A)(async(e,t)=>{const n=await(0,r.NN)(t);n&&(0,s.RK)(()=>{e.width=n.width,e.height=n.height,h.current=e.transferControlToOffscreen();const i=Math.ceil(Math.min(n.width,n.height)*c);(0,d.M1)({name:"offscreen-canvas:blurThumb",args:[h.current,t,i],transferables:[h.current]},o)})});return(0,i.Nf)(()=>{if(!e||t||h.current)return;const o=n.current;o&&m(o,e)},[m,t,e]),n}(e?"string"==typeof e?e:(0,o.VD)(e):void 0,t)}},63744:(e,t,n)=>{n.d(t,{A:()=>p});var o=n(84051),i=n(13439),s=n(91048),a=n(71331),r=n(87357),d=n(14),l=n(59030),c=n(48885),u=n(26875),h=n(64493),m=n(20021);const p=(0,o.ph)((0,i.EK)((e,{chatId:t})=>{const n=(0,s.hds)(e,t),o=(0,a.mD)(e,t);return{groupCall:o,isActive:((0,s.nTw)(e).isMasterTab?e.groupCalls.activeGroupCallId:void 0)!==o?.id&&Boolean(o?o.participantsCount>0&&o.isLoaded:n&&n.isCallNotEmpty&&n.isCallActive)}})(({chatId:e,isActive:t,className:n,groupCall:s,onPaneStateChange:a})=>{const{requestMasterAndJoinGroupCall:p}=(0,i.ko)(),g=(0,l.A)(),f=(0,o.hb)(()=>{p({chatId:e})},[p,e]),v=s?.participants,A=(0,o.Kr)(()=>{if(!v)return[];const e=(0,i.mS)().users.byId,t=(0,i.mS)().chats.byId;return Object.values(v).slice(0,3).map(({id:n})=>e[n]||t[n]).filter(Boolean)},[v]),y=(0,d.A)(s?.participantsCount,!0),C=(0,d.A)(A,!0),w=Boolean(s&&t),{ref:b,shouldRender:I}=(0,c.A)({isOpen:w,onStateChange:a});if(I)return(0,m.FD)("div",{ref:b,className:(0,r.A)("GroupCallTopPane",n),onClick:f,children:[(0,m.FD)("div",{className:"info",children:[(0,m.Y)("span",{className:"title",children:g("VoipGroupVoiceChat")}),(0,m.Y)("span",{className:"participants",children:g("Participants",y??0,"i")})]}),Boolean(C?.length)&&(0,m.Y)(u.A,{size:"small",peers:C,className:"avatars"}),(0,m.Y)(h.A,{round:!0,className:"join",children:g("VoipChatJoin")})]})}))},63988:(e,t,n)=>{n.d(t,{D7:()=>l,aG:()=>r,gs:()=>a,tF:()=>d});var o=n(16581),i=n(83414),s=n(672);function a(e,t,n,o=!1){return(0,s.A)(t=>{t(e())},t,n,o)}function r(e,t,n=!1){const o=a(()=>e(),[e],t,n);return(0,i.A)(o,[o,e],!0)}function d(e,t,n,i=!1,s=!1){return(0,o.A)(t=>{t(e())},t,n,i,s)}function l(e,t,n=!1,o=!1){const s=d(()=>e(),[e],t,n,o);return(0,i.A)(s,[s,e],!0)}},64154:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(13439),s=n(37836);const a=new Map;function r(e,t,n,s){const r=s&&n?e?.byLangCode[s]?.[n]:void 0,{isPending:l,text:c}=r||{};return(0,o.vJ)(()=>{t&&n&&!c&&void 0===l&&s&&function(e,t,n){const o=a.get(n)||new Map,s=o.get(e)||[];s.includes(t)||(s.push(t),o.set(e,s),a.set(n,o),(0,i.ko)().markMessagesTranslationPending({chatId:e,messageIds:s,toLanguageCode:n})),d()}(t,n,s)},[t,c,l,n,s]),t&&n?{isPending:l,translatedText:c}:{isPending:!1,translatedText:void 0}}const d=(0,s.nF)(function(){const{translateMessages:e}=(0,i.ko)();let t=!1;a.forEach((n,o)=>{n.forEach((n,i)=>{const s=n.slice(0,20);s.length<n.length&&(t=!0),e({chatId:i,messageIds:s,toLanguageCode:o}),function(e,t,n){const o=a.get(n);if(!o?.size)return void a.delete(n);const i=o.get(e);if(!i?.length)return void o.delete(e);const s=i.filter(e=>!t.includes(e));if(!s?.length)return o.delete(e),void(o.size||a.delete(n));o.set(e,s)}(i,s,o)})}),t&&d()},500)},65240:(e,t,n)=>{n.d(t,{Ay:()=>R});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(90709),d=n(91048),l=n(56494),c=n(53827),u=n(87357),h=n(50442),m=n(17663),p=n(36175),g=n(4961),f=n(43874),v=n(88792),A=n(71533),y=n(39351),C=n(17712),w=n(62587),b=n(69419),I=n(59030),S=n(50680),M=n(64493),N=n(96530),Y=n(35913),k=n(70832),F=n(4438),P=n(18276),T=n(20021);const D=window.matchMedia("(max-width: 375px)"),x=window.matchMedia("(max-width: 410px)");function L(e,t,n,o,i,s,a,r,d,l,c,u){const{title:h,performer:p,fileName:f}=n,v=i||s>0&&s<1,{isRtl:A}=e;return(0,T.FD)("div",{className:"content",children:[(0,T.Y)("p",{className:"title",dir:"auto",title:h,children:(0,g.A)(h||f)}),v&&(0,T.FD)("div",{className:"meta",dir:A?"rtl":void 0,children:[(0,T.Y)("span",{className:"duration with-seekline",dir:"auto",children:(0,m.QO)(o*s,o)}),B(s,a,r)]}),!v&&d&&(0,T.Y)(k.A,{className:"meta",size:n.size,progress:c}),!v&&!d&&(0,T.FD)("div",{className:"meta",dir:A?"rtl":void 0,children:[(0,T.Y)("span",{className:"duration",dir:"auto",children:(0,m.QO)(o)}),p&&(0,T.FD)(T.FK,{children:[(0,T.Y)("span",{className:"bullet",children:"•"}),(0,T.Y)("span",{className:"performer",dir:"auto",title:p,children:(0,g.A)(p)})]}),Boolean(l)&&(0,T.FD)(T.FK,{children:[(0,T.Y)("span",{className:"bullet",children:"•"}),(0,T.Y)(N.A,{className:"date",onClick:u,children:(0,m.fS)(t,1e3*l,!0)})]})]})]})}function E(e,t,n,o,i,s,r,d,l,c,h,p){return(0,T.FD)("div",{className:"content",children:[(0,T.FD)("div",{className:"waveform-wrapper",children:[(0,T.Y)("div",{className:"waveform",draggable:!1,ref:t,children:(0,T.Y)("canvas",{ref:n})}),c&&(0,T.FD)(M.A,{onClick:()=>{(d||l)&&h?h(!r):s||c()},children:[(0,T.Y)(P.A,{name:d||l?"down":"transcribe",className:(0,u.A)("transcribe-icon",(d||l)&&!r&&"transcribe-shown")}),s&&(0,T.Y)("svg",{viewBox:"0 0 32 24",className:"loading-svg",children:(0,T.Y)("rect",{className:"loading-rect",fill:"transparent",width:"32",height:"24","stroke-width":"3","stroke-linejoin":"round",rx:"6",ry:"6",stroke:"white","stroke-dashoffset":"1","stroke-dasharray":"32,68"})})]})]}),(0,T.Y)("p",{className:(0,u.A)("voice-duration",p!==a.d9.OneTimeModal&&i&&"unread"),dir:"auto",children:0===o||1===o?(0,m.QO)(e.duration):(0,m.QO)(e.duration*o)})]})}function B(e,t,n){return(0,T.FD)("div",{className:"seekline",ref:n,children:[t.map(({start:e,end:t})=>(0,T.Y)("div",{className:"seekline-buffered-progress",style:`left: ${100*e}%; right: ${100-100*t}%`})),(0,T.Y)("span",{className:"seekline-play-progress",children:(0,T.Y)("i",{className:"seekline-play-progress-inner",style:`transform: translateX(${100*e}%)`})}),(0,T.Y)("span",{className:"seekline-thumb",children:(0,T.Y)("i",{className:"seekline-thumb-inner",style:`transform: translateX(${100*e}%)`})})]})}const R=(0,o.ph)((0,i.EK)((e,{message:t})=>({webPage:(0,d.Pn$)(e,t),mediaDuration:(0,l.Y9)(e,t)}))(({theme:e,message:t,senderTitle:n,uploadProgress:d,origin:l,date:k,noAvatars:R,className:O,isSelectable:U,isSelected:K,isDownloading:z,isTranscribing:V,isTranscriptionHidden:j,isTranscribed:G,isTranscriptionError:J,canDownload:$,canTranscribe:q,autoPlay:H,webPage:W,mediaDuration:_,onHideTranscription:Q,onPlay:Z,onPause:X,onReadMedia:ee,onCancelUpload:te,onDateClick:ne})=>{const{cancelMediaDownload:oe,downloadMedia:ie,transcribeAudio:se,openOneTimeMediaModal:ae}=(0,i.ko)(),{content:{audio:re,voice:de,video:le},isMediaUnread:ce}=t,ue=re||(0,r.y3)(W),he=de||le||ue,me=de||le,pe=Boolean(de||le),ge=(0,o.li)(!1),fe=(0,o.li)(),ve=(0,I.A)(),Ae=(0,y.A)(),{isMobile:ye}=(0,f.Ay)(),[Ce,we]=(0,o.J0)(!1),be=Ce||!0,Ie=(0,r.VO)(he,"pictogram"),Se=(0,w.A)(Ie,!1,s.qZ.BlobUrl),Me=(0,r.G5)(t),Ne=l===a.d9.OneTimeModal,Ye=pe?Me?"oneTimeVoice":"voice":"audio",ke=(0,w.A)((0,r.VO)(he,"inline"),!be,(0,r.Cz)(he,"inline")),{loadProgress:Fe}=(0,b.A)((0,r.VO)(he,"download"),!z,(0,r.Cz)(he,"download")),Pe=(0,C.A)(()=>{we(!0),Z?.(t.id,t.chatId)}),Te=(0,C.A)(()=>{we(!1)}),{isBuffered:De,bufferedRanges:xe,bufferingHandlers:Le,checkBuffering:Ee}=(0,A.A)(),Be=Ne,{isPlaying:Re,playProgress:Oe,playPause:Ue,setCurrentTime:Ke,duration:ze}=(0,v.A)((0,c.dj)(t),_,Ye,ke,Le,void 0,Ee,Boolean(Ce||H),Pe,Te,(0,r.Nb)(t)||Me,void 0,X,Be,Me&&!Ne),Ve=1-Oe,je=(0,r.Ie)(t),Ge=Me&&Ne,Je=function(e,t,n=0,i=!1,s=!1,a=!1,r=!1){const d=(0,o.li)(),{data:l,peak:c}=(0,o.Kr)(()=>{if(!t)return;const{waveform:e,duration:n}=t;if(!e)return{data:new Array(Math.min(n,30)).fill(0),peak:0};const{MIN_SPIKES:o,MAX_SPIKES:i}=function(e,t){return{MIN_SPIKES:e?D.matches?16:20:25,MAX_SPIKES:e?D.matches?35:t&&x.matches?40:45:75}}(a,s),r=Math.min(n/10,1),d=Math.round(o+(i-o)*r);return function(e,t){let n=0;const o=new Array(t),i=e.length/t,s=e[0],a=e[e.length-1];for(let r=0;r<t;r++){const t=Math.floor(r*i),d=((e[t-1]??s)+(e[t]??s)+(e[t+1]??a))/3;o[r]=d,n<d&&(n=d)}return{data:o,peak:n}}(function(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const o=Array(n),i=e;for(let e=0,t=n-1;e!==t;++e){const t=Math.floor(5*e/8),n=Math.floor(5*e%8),s=i[t]+(i[t+1]<<8);o[e]=s>>n&31}const s=Math.floor(5*(n-1)/8),a=Math.floor(5*(n-1)%8),r=i[s]+(i[s+1]<<8);return o[n-1]=r>>a&31,o}(new Uint8Array(e)),d)},[a,t,s])||{};return(0,o.Nf)(()=>{const t=d.current;t&&l&&void 0!==c&&function(e,t,n,{peak:o,fillStyle:i,progressFillStyle:s}){const a=4*t.length;e.width=2*a,e.height=46,e.style.width=`${a}px`,e.style.height="23px";const r=e.getContext("2d");r.scale(2,2),t.forEach((e,a)=>{r.globalAlpha=a/t.length>=n?.5:1,r.fillStyle=n>a/t.length?s:i;const d=Math.max(2,e/Math.max(1,o)*23);!function(e,t,n,o,i,s){2<2*s&&(s=1),i<2*s&&(s=i/2),e.beginPath(),e.moveTo(t+s,n),e.arcTo(t+2,n,t+2,n-i,s),e.arcTo(t+2,n-i,t,n-i,s),e.arcTo(t,n-i,t,n,s),e.arcTo(t,n,t+2,n,s),e.closePath()}(r,4*a,(23+d)/2,0,d,1),r.fill()})}(t,l,r?1-n:n,{peak:c,fillStyle:i?"dark"===e?"#B7ABED":"#AEDFA4":"dark"===e?"#494A78":"#ADD3F7",progressFillStyle:i?"dark"===e?"#FFFFFF":"#4FAE4E":"dark"===e?"#8774E1":"#3390EC"})},[i,c,n,l,e,r]),d}(e,me,!ce||je||Ge?Oe:1,je,!R,ye,Ge),$e=Re||Oe>0&&Oe<1;(0,o.vJ)(()=>{we(Re)},[Re]);const qe=Ce&&!De,{isUploading:He,isTransferring:We,transferProgress:_e}=(0,r.LK)(d||Fe,qe||z,void 0!==d),{shouldRender:Qe,transitionClassNames:Ze}=(0,S.A)(We),Xe=Qe&&(qe||He),et=(0,C.A)(()=>{if(He)te?.();else{if(Me)return ae({message:t}),void ee?.();Re||Z?.(t.id,t.chatId),(0,i.ko)().setAudioPlayerOrigin({origin:l}),we(!Ce),Ue()}});(0,o.vJ)(()=>{ee&&ce&&Re&&ee()},[Re,ce,ee]);const tt=(0,C.A)(()=>{z?oe({media:he}):ie({media:he,originMessage:t})}),nt=(0,C.A)(e=>{if(ge.current&&fe.current){const{width:t,left:n}=fe.current.getBoundingClientRect(),o=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),Ke(Math.max(Math.min(ze*((o-n)/t),ze-.1),.001))}}),ot=(0,C.A)(e=>{e instanceof MouseEvent&&2===e.button||(ge.current=!0,nt(e))}),it=(0,C.A)(()=>{ge.current=!1}),st=(0,C.A)(()=>{ne(t)}),at=(0,C.A)(()=>{se({chatId:t.chatId,messageId:t.id})});function rt(){if(pe)return n||"Voice";const{title:e,fileName:t}=ue;return e||t}function dt(){if(pe)return(0,T.Y)("div",{className:"meta",dir:Ae.isRtl?"rtl":void 0,children:(0,m.QO)((de||le).duration)});const{performer:e}=ue;return(0,T.FD)("div",{className:"meta",dir:Ae.isRtl?"rtl":void 0,children:[(0,m.QO)(ze),(0,T.Y)("span",{className:"bullet",children:"•"}),e&&(0,T.Y)("span",{className:"performer",title:e,children:(0,g.A)(e)}),e&&n&&(0,T.Y)("span",{className:"bullet",children:"•"}),n&&(0,T.Y)("span",{title:n,children:(0,g.A)(n)})]})}(0,o.vJ)(()=>{if(fe.current&&$e&&!Ne)return(0,h.wJ)(fe.current,{onCapture:ot,onRelease:it,onClick:it,onDrag:nt})},[$e,ot,nt,it,Ne]);const lt=(0,u.A)("Audio",O,Ne&&"non-interactive",l===a.d9.Inline&&"inline",je&&l===a.d9.Inline&&"own",(l===a.d9.Search||l===a.d9.SharedMedia)&&"bigger",K&&"audio-is-selected"),ct=["toogle-play-wrapper"];Xe?ct.push("loading"):ct.push(Re?"pause":"play");const ut=(0,u.A)("content",$e&&"with-seekline");function ht(){return(0,T.FD)("div",{className:ut,children:[(0,T.FD)("div",{className:"content-row",children:[(0,T.Y)("p",{className:"title",dir:"auto",title:rt(),children:(0,g.A)(rt())}),(0,T.Y)("div",{className:"message-date",children:Boolean(k)&&(0,T.Y)(N.A,{className:"date",onClick:st,children:(0,m.be)(ve,1e3*k)})})]}),$e&&(0,T.FD)("div",{className:"meta search-result",dir:Ae.isRtl?"rtl":void 0,children:[(0,T.Y)("span",{className:"duration with-seekline",dir:"auto",children:Oe<1&&(0,m.QO)(ze*Oe,ze)}),B(Oe,xe,fe)]}),!$e&&dt()]})}return(0,T.FD)("div",{className:lt,dir:Ae.isRtl?"rtl":"ltr",children:[U&&(0,T.Y)("div",{className:"message-select-control no-selection",children:K&&(0,T.Y)(P.A,{name:"select"})}),(0,T.FD)("div",{className:(0,u.A)(...ct),children:[(0,T.FD)(M.A,{round:!0,ripple:!ye,size:"smaller",className:"toggle-play",color:Se?"translucent-white":"primary",ariaLabel:Re?"Pause audio":"Play audio",onClick:et,isRtl:Ae.isRtl,backgroundImage:Se,nonInteractive:Ne,children:[!Ne&&(0,T.Y)(P.A,{name:"play"}),!Ne&&(0,T.Y)(P.A,{name:"pause"}),Ne&&(0,T.Y)(F.A,{className:"flame",tgsUrl:p.w.Flame,nonInteractive:!0,noLoop:!1,size:40})]}),Me&&!Ne&&(0,T.Y)(P.A,{name:"view-once"})]}),Qe&&(0,T.Y)("div",{className:(0,u.A)("media-loading",Ze,Xe&&"interactive"),children:(0,T.Y)(Y.A,{progress:_e,transparent:!0,withColor:!0,size:"m",onClick:Xe?et:void 0,noCross:!Xe})}),Ne&&!Qe&&(0,T.Y)("div",{className:(0,u.A)("media-loading"),children:(0,T.Y)(Y.A,{progress:Oe,transparent:!0,size:"m",noCross:!0,rotationOffset:3/4})}),ue&&$&&!He&&(0,T.Y)(M.A,{round:!0,size:"tiny",className:"download-button",ariaLabel:z?"Cancel download":"Download",onClick:tt,iconName:z?"close":"arrow-down"}),l===a.d9.Search&&ht(),l!==a.d9.Search&&ue&&L(Ae,ve,ue,ze,Re,Oe,xe,fe,z||He,k,_e,ne?st:void 0),l===a.d9.SharedMedia&&me&&ht(),(l===a.d9.Inline||Ne||G)&&me&&E(me,fe,Je,Me?Ve:Oe,ce,V,j,G,J,q?at:void 0,Q,l)]})}))},65741:(e,t,n)=>{e.exports=n.p+"GiftRedRound.a86b78b0b99e07f69a70.svg"},66991:(e,t,n)=>{n.d(t,{Y:()=>u,c:()=>h});var o=n(84051),i=n(31481),s=n(66644),a=n(19822),r=n(39761),d=n(96454),l=n(95704);const c=100;function u(e,t,n){return(0,o.vJ)(()=>{if(!t||!e.current)return;const o=g(),i=e.current;if(!d.Yw||!n||!o?.isTypeSupported(n))return;const u=new o;function h(){if(!t||!n)return;const e=u.addSourceBuffer(n),o=(0,l.h)(t);e.addEventListener("updateend",function(){o.next().then(({value:t,done:n})=>{"open"===u.readyState&&(n?p(u):m(e,t))})}),o.next().then(({value:t,done:n})=>{n||"open"!==u.readyState||((0,s.RK)(()=>{i.style.display="block",setTimeout(()=>{(0,s.RK)(()=>{(0,a.ZM)(i,{opacity:"1"})})},c)}),m(e,t))})}return u.addEventListener("sourceopen",h,{once:!0}),(0,s.RK)(()=>{(0,a.ZM)(i,{display:"none",opacity:"0"}),i.src=URL.createObjectURL(u)}),()=>{(0,s.RK)(()=>{const e=i.src;(0,r.A)(i),u.removeEventListener("sourceopen",h),"open"===u.readyState&&p(u),URL.revokeObjectURL(e)})}},[n,t,e]),h(n)}function h(e){return!(!d.Yw||!e)&&Boolean(g()?.isTypeSupported(e))}function m(e,t){try{e.appendBuffer(t)}catch(e){i.Oig&&console.warn("[Stream] failed to append buffer",e)}}function p(e){try{e.endOfStream()}catch(e){i.Oig&&console.warn("[Stream] failed to end stream",e)}}function g(){return"ManagedMediaSource"in window?ManagedMediaSource:"MediaSource"in window?MediaSource:void 0}},67054:(e,t,n)=>{function o(e,t){return t-Math.floor(t/e)*e}n.d(t,{A:()=>o})},68153:(e,t,n)=>{e.exports=n.p+"GiftGreenRound.f66f0acd5d3dda1c7baf.svg"},69419:(e,t,n)=>{n.d(t,{A:()=>g});var o=n(84051),i=n(23174),s=n(91048),a=n(96454),r=n(58554),d=n(63527),l=n(30857),c=n(672),u=n(14745);const h=.75,m=1500,p=500;function g(e,t=!1,n=i.qZ.BlobUrl,g,f=!1){const v=a.Uz&&n===i.qZ.Progressive,A=e?v&&!t?r.RB(e):r.Ih(e):void 0,y=(0,l.A)(),C=(0,d.A)(s.nIz),w=(0,u.A)(),[b,I]=(0,o.J0)(A&&!v?1:0),S=(0,o.li)(),M=(0,c.A)(e=>{S.current&&w&&(!g||Date.now()-S.current>g)&&I(e)},[g,w],p,!0);return(0,o.vJ)(()=>{!t&&e&&(A?v&&setTimeout(()=>{I(h)},m):(I(0),S.current&&r.ch(M),S.current=Date.now(),r.hd(e,n,f,M,w).then(()=>{const e=Date.now()-S.current;S.current=void 0,!g||e>=g?y():setTimeout(y,g-e)})))},[t,e,A,n,v,g,M,f,w,C]),(0,o.vJ)(()=>{t&&S.current&&(r.ch(M),I(0),S.current=void 0)},[M,t]),(0,o.vJ)(()=>()=>{e&&r.Cn(e,w)},[w,e]),{mediaData:A,loadProgress:b}}},70832:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(84051),i=n(14242),s=n(39351),a=n(17712),r=n(20021);const d=(0,o.ph)(({className:e,size:t,progress:n})=>{const d=(0,s.A)(),[l,c]=(0,o.J0)(0),u=(0,o.li)(),h=(0,a.A)(()=>{clearTimeout(u.current),u.current=void 0}),m=(0,a.A)(()=>{if(void 0===n)return;const e=t*n,o=e-l;if(0!==o){const t=Math.max(262144,o/10),n=Math.min(e,l+t);c(n)}u.current=window.setTimeout(()=>{m()},100)});(0,o.vJ)(()=>{if(void 0===n)return h(),void c(0);const e=t*n;if(e>1073741824||1===n)return h(),void c(e);u.current||m()},[n,t]),(0,o._W)(h);const p=(0,i.v7)(d,l,2),g=(0,i.v7)(d,t);return void 0===n||1===n?g:(0,r.Y)("span",{className:e,dir:d.isRtl?"rtl":void 0,children:d("FileTransferProgress",{currentSize:p,totalSize:g},{withNodes:!0})})})},71331:(e,t,n)=>{n.d(t,{Ip:()=>r,O7:()=>h,iT:()=>c,mD:()=>a,n5:()=>d,qI:()=>l,uu:()=>u});var o=n(90709),i=n(21133),s=n(19926);function a(e,t){const n=(0,i.AW)(e,t);if(n&&n.groupCallId)return r(e,n.groupCallId)}function r(e,t){return e.groupCalls.byId[t]}function d(e,t,n){return r(e,t)?.participants[n]}function l(e){const t=c(e)?.chatId;if(!t)return!1;const n=(0,i.hd)(e,t);return!!n&&((0,o.yn)(n)&&n.isCreator||Boolean(n.adminRights?.manageCall))}function c(e){const{groupCalls:{activeGroupCallId:t}}=e;if(t)return r(e,t)}function u(e){const{phoneCall:t,currentUserId:n}=e;if(!t||!t.participantId||!t.adminId)return;const o=t.adminId===n?t.participantId:t.adminId;return(0,s.mB)(e,o)}function h(e){const t=c(e);if(!t||!t.chatId)return!1;const n=(0,i.hd)(e,t.chatId);if(!n)return!1;if(Boolean((0,o.Kl)(n)))return!0;const s=(0,i.AW)(e,n.id)?.inviteLink;return Boolean(s)}},71950:(e,t,n)=>{n.d(t,{A:()=>C});var o=n(84051),i=n(87357),s=n(17663),a=n(17142),r=n(14242),d=n(39351),l=n(59030),c=n(18276);const u="gvrp3KoR",h="IHb3ZATQ",m="zAPFdKbZ";var p=n(20021);const g=[[{name:"followers",title:"ChannelStats.Overview.Followers"},{name:"enabledNotifications",title:"ChannelStats.Overview.EnabledNotifications",isPercentage:!0}],[{name:"viewsPerPost",title:"ChannelStats.Overview.ViewsPerPost"},{name:"viewsPerStory",title:"ChannelStats.Overview.ViewsPerStory"}],[{name:"sharesPerPost",title:"ChannelStats.Overview.SharesPerPost"},{name:"sharesPerStory",title:"ChannelStats.Overview.SharesPerStory"}],[{name:"reactionsPerPost",title:"ChannelStats.Overview.ReactionsPerPost"},{name:"reactionsPerStory",title:"ChannelStats.Overview.ReactionsPerStory"}]],f=[[{name:"members",title:"Stats.GroupMembers"},{name:"messages",title:"Stats.GroupMessages"}],[{name:"viewers",title:"Stats.GroupViewers"},{name:"posters",title:"Stats.GroupPosters"}]],v=[[{name:"viewsCount",title:"Stats.Message.Views",isPlain:!0},{name:"publicForwards",title:"Stats.Message.PublicShares",isPlain:!0}],[{name:"reactionsCount",title:"Channel.Stats.Overview.Reactions",isPlain:!0},{name:"forwardsCount",title:"Stats.Message.PrivateShares",isPlain:!0,isApproximate:!0}]],A=[[{name:"viewsCount",title:"Channel.Stats.Overview.Views",isPlain:!0},{name:"publicForwards",title:"PublicShares",isPlain:!0}],[{name:"reactionsCount",title:"Channel.Stats.Overview.Reactions",isPlain:!0},{name:"forwardsCount",title:"PrivateShares",isPlain:!0}]],y=[[{name:"level",title:"Stats.Boosts.Level",isPlain:!0},{name:"premiumSubscribers",title:"Stats.Boosts.PremiumSubscribers",isPercentage:!0,isApproximate:!0,withAbsoluteValue:!0}],[{name:"boosts",title:"Stats.Boosts.ExistingBoosts",isPlain:!0},{name:"remainingBoosts",title:"Stats.Boosts.BoostsToLevelUp",isPlain:!0}]],C=(0,o.ph)(({title:e,type:t,statistics:n,isToncoin:o,className:C,subtitle:w})=>{const b=(0,l.A)(),I=(0,d.A)(),S=({change:e,percentage:t})=>{if(!e)return;const n=Number(e)<0;return(0,p.FD)("span",{className:(0,i.A)("idLrmbhS",n&&"SLfwGHQC"),children:[n?`-${(0,r.Vw)(I,Math.abs(e))}`:`+${(0,r.Vw)(I,e)}`,t&&(0,p.FD)(p.FK,{children:[" ","(",t,"%)"]})]})},M=(e,t,n)=>{const[o,i]=e.toFixed(4).split("."),[s,a]=(e*t).toFixed(2).split(".");return(0,p.FD)("div",{children:[(0,p.Y)(c.A,{className:"it39BC_c",name:"toncoin"}),(0,p.FD)("b",{className:m,children:[o,(0,p.FD)("span",{className:"ZAfXkuWL",children:[".",i]})]})," ",(0,p.FD)("span",{className:h,children:["≈ $",s,(0,p.FD)("span",{className:"HRXb_S2M",children:[".",a]})]}),(0,p.Y)("h3",{className:h,children:b(n)})]})},{period:N}=n,{balances:Y,usdRate:k}=n,F=function(e){switch(e){case"group":return f;case"message":return v;case"boost":return y;case"story":return A;default:return g}}(t);return(0,p.FD)("div",{className:(0,i.A)("Gi8Nokbl",C),children:[(0,p.FD)("div",{className:"H01lE7mv",children:[e&&(0,p.Y)("div",{className:"VQbs04hT",children:e}),N&&(0,p.FD)("div",{className:"X7bBlGdi",children:[(0,s.Lu)(b,1e3*N.minDate)," ","—",(0,s.Lu)(b,1e3*N.maxDate)]})]}),(0,p.Y)("table",{className:"s5beXqqL",children:o?(0,p.Y)("tr",{children:(0,p.FD)("td",{className:u,children:[M(Y?.availableBalance?(0,a.wD)(Y.availableBalance.amount):0,k||0,"lng_channel_earn_available"),M(Y?.currentBalance?(0,a.wD)(Y.currentBalance.amount):0,k||0,"lng_channel_earn_reward"),M(Y?.overallRevenue?(0,a.wD)(Y.overallRevenue.amount):0,k||0,"lng_channel_earn_total")]})}):F.map(e=>(0,p.Y)("tr",{children:e.map(e=>{const t=n?.[e.name];if(e.isPlain)return(0,p.FD)("td",{className:u,children:[(0,p.Y)("b",{className:m,children:`${e.isApproximate?"≈ ":""}${(0,r.Sm)(t??0)}`}),(0,p.Y)("h3",{className:h,children:b(e.title)})]});if(e.isPercentage){const n=t?.part??0,o=t?.percentage??0;return(0,p.FD)("td",{className:u,children:[e.withAbsoluteValue&&(0,p.Y)("span",{className:m,children:`${e.isApproximate?"≈ ":""}${(0,r.Sm)(n)}`}),(0,p.FD)("span",{className:e.withAbsoluteValue?"_mYEmh_u":m,children:[o,"%"]}),(0,p.Y)("h3",{className:h,children:b(e.title)})]})}return(0,p.FD)("td",{className:u,children:[(0,p.Y)("b",{className:m,children:(0,r.Vw)(I,t?.current??0)})," ",S(t),(0,p.Y)("h3",{className:h,children:b(e.title)})]})})}))}),w]})})},72078:(e,t,n)=>{e.exports=n.p+"GiftBlueRound.90e369f0f350cdfb20d4.svg"},72167:(e,t,n)=>{n.d(t,{A:()=>u});var o=n(84051),i=n(98021),s=n(76023),a=n(4961),r=n(87412),d=n(18276);var l=n(20021);const c=2.25*s.$,u=(0,o.ph)(({emoji:e,customEmojiId:t,shouldAnimate:n})=>{if(t)return(0,l.Y)(r.A,{documentId:t,size:c,shouldNotLoop:!n});if(!e)return(0,l.Y)(d.A,{name:"folder-tabs-folder"});const o=(0,i.FQ)(e);return o?(0,l.Y)(d.A,{name:o}):(0,l.Y)("div",{className:"pAEvaw7s",children:(0,a.A)(e)})})},73172:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(13439),s=n(31481),a=n(37836);const r=(e,t)=>(0,o.Kr)(()=>(0,a.nF)(n=>{e&&t&&(0,i.ko)().sendMessageAction({chatId:e,threadId:t,action:n})},s.cqp),[e,t])},73176:(e,t,n)=>{n.d(t,{A:()=>L});var o=n(84051),i=n(31481),s=n(66644),a=n(90709),r=n(70636),d=n(37836);function l(e,t=d.IJ){return new Promise(n=>{t(()=>{(function(e){return Promise.allSettled(e.getAnimations({subtree:!0}).filter(e=>e instanceof CSSTransition).map(e=>e.finished))})(e).then(()=>n())})})}var c=n(87357),u=n(4961),h=n(18501),m=n(79882),p=n(35749),g=n(2338),f=n(21488),v=n(39351),A=n(62587),y=n(13439),C=n(76023),w=n(43874),b=n(11217),I=n(38102);const S="CBda1UmC",M="BhS75ocD",N="uWo2dhui",Y="g3XnC73g";var k=n(20021);const F=Number(C.$),P=(0,o.ph)(({chat:e,topics:t,hasTags:n,renderLastMessage:i,observeIntersection:s})=>{const{openThread:r}=(0,y.ko)(),d=(0,o.li)(),l=(0,o.li)(),h=(0,v.A)(),[m,...p]=(0,o.Kr)(()=>t?(0,a.CO)(Object.values(t),void 0,!0).slice(0,3):[],[t]),[g,f]=(0,o.J0)(!1),[A,C]=(0,o.J0)(void 0),{handleClick:P,handleMouseDown:T}=(0,b.Q)(t=>{0===m.unreadCount||e.isForumAsMessages&&!e.isBotForum||(t.stopPropagation(),t.preventDefault(),r({chatId:e.id,threadId:m.id,shouldReplaceHistory:!0,noForumTopicPanel:(0,w.Ny)()}))});return(0,o.vJ)(()=>{const e=d.current,t=l.current;if(!e||!t||n)return;const o=e.offsetWidth,i=t.offsetWidth;Math.abs(o-i)<F?C(Math.max(o,i)):C(void 0),f(o>i)},[m,i,n]),(0,k.FD)("div",{className:(0,c.A)("Ow6Ij9O5",g&&"U_yhhC0w",A&&"HV0wCR4O"),dir:h.isRtl?"rtl":void 0,style:A?`--overwritten-width: ${A}px`:void 0,children:[!n&&(0,k.FD)(k.FK,{children:[m&&(0,k.FD)("div",{className:S,children:[(0,k.FD)("div",{className:(0,c.A)("lEbV6HrI",m.unreadCount&&M),ref:l,onClick:P,onMouseDown:T,children:[(0,k.Y)(I.A,{topic:m,observeIntersection:s}),(0,k.Y)("div",{className:"k3Ch25ZQ",children:(0,u.A)(m.title)}),!A&&g&&(0,k.Y)("div",{className:N,children:(0,k.Y)("div",{className:Y})})]}),(0,k.Y)("div",{className:"IkuCBmvA",children:p.map(e=>(0,k.FD)("div",{className:(0,c.A)("d0hTIVJn",e.unreadCount&&M),children:[(0,k.Y)(I.A,{topic:e,className:"oknhG11L",observeIntersection:s}),(0,k.Y)("span",{className:"ZUj3xAjs",children:(0,u.A)(e.title)})]},e.id))}),(0,k.Y)("div",{className:"_m_2xcPW"})]}),!m&&(0,k.Y)("div",{className:(0,c.A)(S,"L4Zk0yMN"),children:h("Loading")})]}),(0,k.FD)("div",{className:(0,c.A)("KJ16dBus",m?.unreadCount&&!n&&M),ref:d,onClick:P,onMouseDown:T,children:[i(),!A&&!g&&(0,k.Y)("div",{className:N,children:(0,k.Y)("div",{className:Y})})]})]})});var T=n(18276),D=n(18653),x=n(80477);function L({chat:e,topics:t,lastMessage:n,statefulMediaContent:d,chatId:c,typingStatus:y,draft:C,lastMessageTopic:w,lastMessageSender:b,observeIntersection:I,animationType:S,orderDiff:M,shiftDiff:N,withInterfaceAnimations:Y,isTopic:F,isSavedDialog:D,isPreview:L,hasTags:B,onReorderAnimationEnd:R}){const O=(0,v.A)(),U=(0,o.li)(),K=n?.content.storyData,z=d&&!d.story;(0,f.A)(z?K?.peerId:void 0,K?.id,d?.story);const V=d?.story||n,j=V&&!(0,a.fP)(V),G=(0,g.A)(V),J=j?G:void 0,$=(0,p.A)(V,"micro"),q=(0,A.A)(j?$:void 0),H=Boolean(n&&(0,a.lk)(n)),W=(0,o.hb)(()=>{if(!D&&!L&&y&&n&&y.timestamp>1e3*n.date)return(0,k.Y)(x.A,{typingStatus:y});const t=C&&C.replyInfo?.replyToMsgId===w?.id,o=C?.replyInfo&&!C.text&&C.isLocal;if(!e?.isForum&&!D&&!L&&C&&!o&&(!F||!t))return(0,k.FD)("p",{className:"last-message",dir:O.isRtl?"auto":"ltr",children:[(0,k.Y)("span",{className:"draft",children:O("ChatDraftPrefix")}),(0,k.Y)("span",{className:"last-message-summary",dir:"auto",children:(0,h.fd)({text:C.text?.text||"",entities:C.text?.entities,asPreview:!0,withTranslucentThumbs:!0})})]});if(!n)return;const i=b?(0,r.Q5)(O,c,b):void 0;return(0,k.FD)("p",{className:"last-message shared-canvas-container",dir:O.isRtl?"auto":"ltr",children:[i&&(0,k.FD)(k.FK,{children:[(0,k.Y)("span",{className:"sender-name",children:(0,u.A)(i)}),(0,k.Y)("span",{className:"colon",children:":"})]}),!D&&n.forwardInfo&&(0,k.Y)(T.A,{name:"share-filled",className:"chat-prefix-icon"}),"story"===n.replyInfo?.type&&(0,k.Y)(T.A,{name:"story-reply",className:"chat-prefix-icon"}),(0,k.Y)("span",{className:"last-message-summary",dir:"auto",children:E(n,I,q||J,H)})]})},[e,c,C,H,F,O,n,b,w,q,J,I,y,D,L]);return(0,o.Nf)(()=>{const e=U.current;if(!Y||!e)return;let t=!1;const n=()=>{t||((0,s.RK)(()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""}),R?.())};return S===m.IP.Opacity&&(e.style.opacity="0",(0,s.RK)(()=>{e.classList.add("animate-opacity"),e.style.opacity="1",l(e).then(n)})),S===m.IP.Move&&(e.style.transform=`translate3d(0, ${-M*i.yq1-N}px, 0)`,(0,s.RK)(()=>{e.classList.add("animate-transform"),e.style.transform="",l(e).then(n)})),S===m.IP.Shift&&(e.style.transform=`translate3d(0, ${-N}px, 0)`,(0,s.RK)(()=>{e.classList.add("animate-transform"),e.style.transform="",l(e).then(n)})),S!==m.IP.None?()=>{t=!0}:void 0},[Y,M,N,S,R]),{renderSubtitle:function(){return e?.isForum&&!F?(0,k.Y)(P,{chat:e,renderLastMessage:W,observeIntersection:I,topics:t,hasTags:B}):W()},ref:U}}function E(e,t,n,o){const i=(0,k.Y)(D.A,{message:e,noEmoji:Boolean(n),observeIntersectionForLoading:t,inChatList:!0});if(!n)return i;const s=(0,a.y2)(e);return(0,k.FD)("span",{className:"media-preview",children:[(0,k.Y)("img",{src:n,alt:"",className:(0,c.A)("media-preview--image",o&&"round",s&&"media-preview-spoiler"),draggable:!1}),(0,a.zX)(e)&&(0,k.Y)(T.A,{name:"play"}),i]})}},75319:(e,t,n)=>{function o(e){return"object"==typeof e&&null!==e&&"graphType"in e}n.d(t,{R:()=>o})},75343:(e,t,n)=>{n.d(t,{A:()=>S});var o=n(84051),i=n(13439),s=n(87357),a=n(43874),r=n(36838),d=n(39351),l=n(89925),c=n(70636),u=n(17663),h=n(48899),m=n(80140),p=n(54464),g=n(10722),f=n(17712),v=n(92111),A=n(21849),y=n(71429),C=n(24433),w=n(2429),b=n(20021);const I=(0,o.ph)(function({peer:e,isArchived:t,stealthModeActiveUntil:n}){const{openChat:a,openChatWithInfo:r,openStoryViewer:I,toggleStoriesHidden:S,openStealthModal:M,showNotification:N}=(0,i.ko)(),Y=(0,d.A)(),k=(0,o.li)(),F="isSelf"in e&&e.isSelf,P=!(0,h.L8)(e.id);(0,v.A)(e.id);const{isContextMenuOpen:T,contextMenuAnchor:D,handleBeforeContextMenu:x,handleContextMenu:L,handleContextMenuClose:E,handleContextMenuHide:B}=(0,g.A)(k),R=(0,f.A)(()=>k.current),O=(0,f.A)(()=>document.body),U=(0,f.A)(()=>k.current.querySelector(".story-peer-context-menu .bubble")),K=(0,f.A)(()=>({withPortal:!0,isDense:!0})),z=(0,f.A)(()=>{T||I({peerId:e.id,origin:l.G9.StoryRibbon})}),V=(0,f.A)(e=>{(0,p.u)(e),x(e)}),j=(0,f.A)(()=>{r({id:e.id,shouldReplaceHistory:!0,profileTab:"stories"})}),G=(0,f.A)(()=>{r({id:e.id,shouldReplaceHistory:!0,profileTab:"storiesArchive"})}),J=(0,f.A)(()=>{a({id:e.id,shouldReplaceHistory:!0})}),$=(0,f.A)(()=>{r({id:e.id,shouldReplaceHistory:!0})}),q=(0,f.A)(()=>{S({peerId:e.id,isHidden:!t})}),H=(0,f.A)(()=>{const t=n?n-(0,m.Fm)():0;if(t>0)return N({title:Y("StealthModeOnTitle"),message:Y("StealthModeOnHint",{time:(0,u.QO)(t)}),duration:1e3}),void I({peerId:e.id,origin:l.G9.StoryRibbon});M({targetPeerId:e.id})});return(0,b.FD)("div",{ref:k,role:"button","data-peer-id":e.id,tabIndex:0,className:w.A.peer,onMouseDown:V,onClick:z,onContextMenu:L,children:[(0,b.Y)(A.A,{peer:e,withStory:!0,storyViewerOrigin:l.G9.StoryRibbon,storyViewerMode:"full"}),(0,b.Y)("div",{className:(0,s.A)(w.A.name,e.hasUnreadStories&&w.A.name_hasUnreadStory),children:F?Y("StoryRibbonMyStory"):(0,c.F9)(Y,e)}),void 0!==D&&(0,b.Y)(y.A,{isOpen:T,anchor:D,getTriggerElement:R,getRootElement:O,getMenuElement:U,getLayout:K,className:(0,s.A)("story-peer-context-menu",w.A.contextMenu),autoClose:!0,withPortal:!0,onClose:E,onCloseAnimationEnd:B,children:F?(0,b.FD)(b.FK,{children:[(0,b.Y)(C.A,{onClick:j,icon:"play-story",children:Y("StoryMenuSavedStories")}),(0,b.Y)(C.A,{onClick:G,icon:"archive",children:Y("StoryMenuArchivedStories")})]}):(0,b.FD)(b.FK,{children:[!P&&(0,b.Y)(C.A,{onClick:J,icon:"message",children:Y("StoryMenuSendMessage")}),P?(0,b.Y)(C.A,{onClick:$,icon:"channel",children:Y("StoryMenuViewChannel")}):(0,b.Y)(C.A,{onClick:$,icon:"user",children:Y("StoryMenuViewProfile")}),!P&&(0,b.Y)(C.A,{onClick:H,icon:"eye-crossed-outline",children:Y("StoryMenuOpenStealth")}),(0,b.Y)(C.A,{onClick:q,icon:t?"unarchive":"archive",children:Y(t?"StoryMenuUnarchivePeer":"StoryMenuArchivePeer")})]})})]})}),S=(0,o.ph)((0,i.EK)((e,{isArchived:t})=>{const{orderedPeerIds:{active:n,archived:o}}=e.stories,i=e.users.byId,s=e.chats.byId;return{orderedPeerIds:t?o:n,stealthModeActiveUntil:e.stories.stealthMode.activeUntil,usersById:i,chatsById:s}})(function({isArchived:e,className:t,orderedPeerIds:n,stealthModeActiveUntil:i,usersById:l,chatsById:c,isClosing:u}){const h=(0,d.A)(),m=(0,s.A)(w.A.root,!n.length&&w.A.hidden,u&&w.A.closing,t,"no-scrollbar"),p=(0,o.li)();return(0,r.A)(p,(0,a.Ny)()),(0,b.Y)("div",{ref:p,id:"StoryRibbon",className:m,dir:h.isRtl?"rtl":void 0,children:n.map(t=>{const n=l[t]||c[t];if(n)return(0,b.Y)(I,{peer:n,isArchived:e,stealthModeActiveUntil:i},t)})})}))},75956:(e,t,n)=>{n.d(t,{W:()=>a,d:()=>r});var o=n(37836);let i,s=!1;const a=(0,o.sg)((e,t=!1)=>{i&&(clearTimeout(i),i=void 0),s?s=!1:i=window.setTimeout(()=>{t&&(s=!0),e()},500)},50,!1);function r(){i&&(clearTimeout(i),i=void 0)}},76786:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(84051);let i=function(e){return e[e.waitingForNetwork=0]="waitingForNetwork",e[e.syncing=1]="syncing",e[e.online=2]="online",e}({});function s(e,t,n,s,a,r){let d,l,c;return d=function(){const[e,t]=(0,o.J0)(window.navigator.onLine);return(0,o.vJ)(()=>{function e(){t(window.navigator.onLine)}return window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("offline",e),window.removeEventListener("online",e)}},[]),e}()&&"connectionStateConnecting"!==t?n?i.syncing:i.online:i.waitingForNetwork,l=d===i.online||r?"none":s?"middleHeader":a?"minimized":"overlay",d===i.waitingForNetwork?c=e("WaitingForNetwork"):d===i.syncing&&(c=e("Updating")),"middleHeader"===l&&(c=c.toLowerCase().replace(/\.+$/,"")),{connectionStatus:d,connectionStatusPosition:l,connectionStatusText:c}}},77018:(e,t,n)=>{n.d(t,{A:()=>ne});var o=n(84051),i=n(13439),s=n(23174),a=n(31481),r=n(66644),d=n(90709),l=n(91048),c=n(96454),u=n(87357),h=n(11778),m=n(50442),p=n(25903),g=n(48899),f=n(43874),v=n(26072),A=n(96374),y=n(5912),C=n(39351),w=n(17712),b=n(73767),I=n(9717),S=n(63744),M=n(51083),N=n(17751),Y=n(48553),k=n(64493),F=n(46222),P=n(52745),T=n(66414),D=n(81642),x=n(22720);const L="lqZyVmVG";var E=n(20021);const B=(0,o.ph)((0,i.EK)((e,{chatId:t})=>({lastMessage:(0,l.yHC)(e,t,"all")}))(({chatId:e,isSelected:t,style:n,lastMessage:o})=>{const{openThread:a,openQuickPreview:r}=(0,i.ko)(),d=(0,C.A)(),l=(0,w.A)(t=>{if(t.altKey)return t.preventDefault(),void r({id:e});a({chatId:e,threadId:s.l3,shouldReplaceHistory:!0})});return(0,E.Y)(x.A,{className:(0,u.A)(L,"Chat",t&&"selected","chat-item-clickable"),onClick:l,style:n,href:c.OS?`#${(0,T.az)(e,"thread",s.l3)}`:void 0,children:(0,E.FD)("div",{className:"info",children:[(0,E.FD)("div",{className:"info-row",children:[(0,E.Y)("div",{className:(0,u.A)("title"),children:(0,E.Y)("h3",{dir:"auto",className:"fullName",children:d("BotForumAllTopicTitle")})}),(0,E.Y)("div",{className:"separator"}),o&&(0,E.Y)(D.A,{message:o})]}),(0,E.Y)("div",{className:"subtitle",children:(0,E.Y)("span",{className:"last-message",children:d("BotForumAllTopicDescription")})})]})})}));var R=n(76023),O=n(59030),U=n(79577);const K={root:"WPgq_7q8","button-text":"X68lc0hu",buttonText:"X68lc0hu",sticker:"jyXw4GPj",title:"_bhNYUNF",description:"zlgqVt7f","is-ios":"iUlEHnLc",isIos:"iUlEHnLc","is-macos":"mOsbMLNN",isMacos:"mOsbMLNN"},z=7*R.$,V=(0,o.ph)((0,i.EK)((e,{chatId:t})=>{const n=(0,l.hds)(e,t),o=n&&(n.isCreator||(0,d.ub)(n,"manageTopics"));return{animatedEmoji:(0,l.oei)(e,"🐣"),canManageTopics:o}})(({chatId:e,animatedEmoji:t,canManageTopics:n})=>{const{openCreateTopicPanel:o}=(0,i.ko)(),s=(0,C.A)(),a=(0,O.A)(),{isMobile:r}=(0,f.Ay)(),d=(0,w.A)(()=>{o({chatId:e})});return(0,E.FD)("div",{className:K.root,children:[(0,E.Y)("div",{className:K.sticker,children:t&&(0,E.Y)(U.A,{sticker:t,size:z})}),(0,E.Y)("h3",{className:K.title,dir:"auto",children:a("ChatList.EmptyTopicsTitle")}),(0,E.Y)("p",{className:(0,u.A)(K.description,K.centered),dir:"auto",children:a("ChatList.EmptyTopicsDescription")}),n&&(0,E.Y)(k.A,{ripple:!r,fluid:!0,onClick:d,isRtl:s.isRtl,children:(0,E.Y)("div",{className:K.buttonText,children:a("ChatList.EmptyTopicsCreate")})})]})}));var j=n(27109),G=n(4961),J=n(37661),$=n(73176),q=n(63495),H=n(87894),W=n(18276),_=n(38102),Q=n(94189),Z=n(97046),X=n(24384);const ee=(0,o.ph)((0,i.EK)((e,{chatId:t,topic:n,isSelected:o})=>{const i=(0,l.hds)(e,t),s=(0,l.O5q)(e,t,n.lastMessageId),{isOutgoing:a}=s||{},r=s&&(0,l.Y7C)(e,s),d=(0,l.C5H)(e,t,n.id,"typingStatus"),c=(0,l.GA4)(e,t,n.id),u=(0,l.Vw0)(e,t,n.id),h=i?.isBotForum||Boolean(u?.lastReadInboxMessageId),m=(0,l.pSx)(e,t),{chatId:p,threadId:g}=(0,l.Xf0)(e)||{},f=s?.content.storyData,v=f&&(0,l.Msb)(e,f.peerId,f.id);return{chat:i,lastMessage:s,lastMessageSender:r,typingStatus:d,isChatMuted:i&&(0,j.If)(i,(0,l.K52)(e),(0,l.P5N)(e,i.id)),canDelete:(0,l.DBV)(e,t,n.id),withInterfaceAnimations:(0,l.PKK)(e),draft:c,...a&&s&&{lastMessageOutgoingStatus:(0,l.Tl2)(e,s)},canScrollDown:o&&i?.id===p&&g===n.id,wasTopicOpened:h,topics:m,lastMessageStory:v}})(({topic:e,isSelected:t,chatId:n,chat:s,isChatMuted:r,style:l,lastMessage:h,lastMessageStory:m,canScrollDown:p,lastMessageOutgoingStatus:g,observeIntersection:f,canDelete:v,lastMessageSender:A,animationType:y,withInterfaceAnimations:b,orderDiff:I,shiftDiff:S,typingStatus:M,draft:N,wasTopicOpened:Y,topics:k,onReorderAnimationEnd:F})=>{const{openThread:P,deleteTopic:B,scrollMessageListToBottom:R,setViewForumAsMessages:U,updateTopicMutedState:K,openQuickPreview:z}=(0,i.ko)(),V=(0,O.A)(),[j,ee,te]=(0,J.A)(),[ne,oe,ie]=(0,J.A)(),[se,ae,re]=(0,J.A)(),[de,le,ce]=(0,J.A)(),{isPinned:ue,isClosed:he,notifySettings:me}=e,pe=Boolean(me.mutedUntil||void 0===me.mutedUntil&&r),ge=(0,w.A)(()=>{ae(),ee()}),fe=(0,w.A)(()=>{B({chatId:s.id,topicId:e.id})}),ve=(0,w.A)(()=>{le(),oe()}),Ae=(0,w.A)(()=>{K({chatId:n,topicId:e.id,mutedUntil:a.Os5})}),{renderSubtitle:ye,ref:Ce}=(0,$.A)({chat:s,chatId:n,lastMessage:h,draft:N,lastMessageSender:A,lastMessageTopic:e,observeIntersection:f,isTopic:!0,typingStatus:M,topics:k,statefulMediaContent:(0,d.FE)({story:m}),animationType:y,withInterfaceAnimations:b,orderDiff:I,shiftDiff:S,onReorderAnimationEnd:F}),we=(0,w.A)(t=>{if(t.altKey)return t.preventDefault(),void z({id:n,threadId:e.id});P({chatId:n,threadId:e.id,shouldReplaceHistory:!0}),s.isBotForum||s.isMonoforum||U({chatId:n,isEnabled:!1}),p&&R()}),be=function({topic:e,chat:t,isChatMuted:n,wasOpened:s,canDelete:a,handleDelete:r,handleMute:l,handleUnmute:u}){const h=(0,C.A)(),m=(0,O.A)();return(0,o.Kr)(()=>{const{isPinned:o,notifySettings:p,isClosed:g,id:f}=e,v=t.id,{editTopic:A,toggleTopicPinned:y,markTopicRead:C,openChatInNewTab:w,openQuickPreview:b}=(0,i.ko)(),I=(0,d.l1)(t,e)&&!t.isBotForum,S=t.isCreator||(0,d.ub)(t,"manageTopics"),M=c.OS&&{title:q.Vq?h("ChatListOpenInNewWindow"):h("ChatListOpenInNewTab"),icon:"open-in-new-tab",handler:()=>{w({chatId:t.id,threadId:f})}},N={title:h("QuickPreview"),icon:"eye-outline",handler:()=>{b({id:v,threadId:f})}},Y=e.unreadCount||!s?{title:m("MarkAsRead"),icon:"readchats",handler:()=>{C({chatId:v,topicId:f})}}:void 0,k=S?o?{title:m("UnpinFromTop"),icon:"unpin",handler:()=>y({chatId:v,topicId:f,isPinned:!1})}:{title:m("PinToTop"),icon:"pin",handler:()=>y({chatId:v,topicId:f,isPinned:!0})}:void 0,F=n&&void 0===p.mutedUntil||p.mutedUntil?{title:m("ChatList.Unmute"),icon:"unmute",handler:u}:{title:`${m("ChatList.Mute")}...`,icon:"mute",handler:l},P=I?g?{title:m("lng_forum_topic_reopen"),icon:"reopen-topic",handler:()=>A({chatId:v,topicId:f,isClosed:!1})}:{title:m("lng_forum_topic_close"),icon:"close-topic",handler:()=>A({chatId:v,topicId:f,isClosed:!0})}:void 0,T=a?{title:m("lng_forum_topic_delete"),icon:"delete",destructive:!0,handler:r}:void 0;return(0,H.oE)([M,N,k,Y,F,P,T])},[e,t,n,s,h,m,a,r,l,u])}({topic:e,chat:s,isChatMuted:r,wasOpened:Y,canDelete:v,handleDelete:ge,handleMute:ve,handleUnmute:Ae});return(0,E.FD)(x.A,{className:(0,u.A)(L,"Chat",t&&"selected","chat-item-clickable"),onClick:we,style:l,href:c.OS?`#${(0,T.az)(n,"thread",e.id)}`:void 0,contextActions:be,withPortalForMenu:!0,ref:Ce,children:[(0,E.FD)("div",{className:"info",children:[(0,E.FD)("div",{className:"info-row",children:[(0,E.FD)("div",{className:(0,u.A)("title"),children:[(0,E.Y)(_.A,{topic:e,className:"tEQjGvh6",observeIntersection:f}),(0,E.Y)("h3",{dir:"auto",className:"fullName",children:(0,G.A)(e.title)})]}),Boolean(me.mutedUntil)&&(0,E.Y)(W.A,{name:"muted"}),(0,E.Y)("div",{className:"separator"}),he&&(0,E.Y)(W.A,{name:"lock-badge",className:"kIae39BG"}),h&&(0,E.Y)(D.A,{message:h,outgoingStatus:g})]}),(0,E.FD)("div",{className:"subtitle",children:[ye(),(0,E.Y)(X.A,{chat:s,isPinned:ue,isMuted:pe,topic:e,wasTopicOpened:Y,topics:k,isSelected:t})]})]}),se&&(0,E.Y)(Q.A,{isOpen:j,onClose:te,onCloseAnimationEnd:re,confirmIsDestructive:!0,confirmHandler:fe,text:V("lng_forum_topic_delete_sure"),confirmLabel:V("Delete")}),de&&(0,E.Y)(Z.A,{isOpen:ne,onClose:ie,onCloseAnimationEnd:ce,chatId:n,topicId:e.id})]})})),te="XjZQCsMW",ne=(0,o.ph)((0,i.EK)(e=>{const t=(0,l.nTw)(e).forumPanelChatId,n=t?(0,l.hds)(e,t):void 0,{chatId:o,threadId:i}=(0,l.Xf0)(e)||{},s=t?(0,l.xyP)(e,t):void 0;return{chat:n,currentTopicId:t===o?Number(i):void 0,withInterfaceAnimations:(0,l.PKK)(e),topicsInfo:s}},e=>(0,l.clw)(e))(({chat:e,currentTopicId:t,isOpen:n,isHidden:l,topicsInfo:T,withInterfaceAnimations:D,onTopicSearch:x,onCloseAnimationEnd:L,onOpenAnimationStart:R})=>{const{closeForumPanel:O,openChatWithInfo:U,loadTopics:K}=(0,i.ko)(),z=(0,o.li)(),j=(0,o.li)(),G=(0,o.li)(),{isMobile:J}=(0,f.Ay)(),$=e?.id;(0,o.vJ)(()=>{$&&!T&&K({chatId:$})},[T,$]);const[q,H]=(0,o.J0)(!1),W=(0,C.A)(),_=(0,w.A)(()=>{O()});(0,o.vJ)(()=>{D||n||L?.()},[D,n,L]);const Q=(0,w.A)(()=>{e&&U({id:e.id,shouldReplaceHistory:!0})}),{observe:Z}=(0,y.BL)({rootRef:j,throttleMs:200});(0,y.mv)(G,Z,({isIntersecting:e})=>{H(!e)});const X=(0,o.Kr)(()=>{const t=T?(0,d.CO)(Object.values(T.topicsById),T.orderedPinnedTopicIds).map(({id:e})=>e):[];return e?.isBotForum?[s.l3,...t]:t},[e?.isBotForum,T]),{orderDiffById:ne,shiftDiff:oe,getAnimationType:ie,onReorderAnimationEnd:se}=(0,I.A)(X,0,e?.id),[ae,re]=(0,A.A)(()=>{e&&K({chatId:e.id})},X,!T?.totalCount||X.length>=T.totalCount,a.iIc),de=(0,o.li)(!1),le=n&&!l,ce=(0,b.A)(le);ce!==le&&(de.current=!1),(0,v.A)({isActive:le,onBack:_}),(0,o.vJ)(()=>le?(0,h.A)(_):void 0,[_,le]),(0,o.vJ)(()=>{ce!==le&&(0,r.Uz)(()=>{if(!z.current)return;const e=(0,o.VK)();(0,p.j)(z.current,e),R?.(),le?(de.current=!0,z.current.style.transform="none"):(de.current=!1,z.current.style.transform="")})},[le,R,ce]),(0,o.vJ)(()=>{if(c.TF)return(0,m.wJ)(z.current,{selectorToPreventScroll:".chat-list",onSwipe:(e,t)=>t===(W.isRtl?m.ez.Left:m.ez.Right)&&(O(),!0)})},[O,W.isRtl]);const ue=void 0===T;if(e)return(0,E.FD)("div",{ref:z,className:(0,u.A)("lrlHKC_D",q&&"H5tiS5xY",W.isRtl&&"Lt4eKHrj",!D&&"c1q2bVwa"),onTransitionEnd:n?void 0:L,children:[(0,E.FD)("div",{id:"TopicListHeader",className:"left-header",children:[(0,E.Y)(k.A,{round:!0,size:"smaller",color:"translucent",onClick:_,ariaLabel:W("Close"),iconName:"close"}),(0,g.L8)(e.id)?(0,E.Y)(N.A,{noAvatar:!0,className:te,userId:e.id,onClick:Q}):(0,E.Y)(M.A,{noAvatar:!0,className:te,chatId:e.id,onClick:Q}),(0,E.Y)(Y.A,{chatId:e.id,threadId:s.l3,messageListType:"thread",canExpandActions:!1,isForForum:!0,isMobile:J,onTopicSearch:x})]}),!(0,g.L8)(e.id)&&(0,E.Y)(S.A,{chatId:e.id}),(0,E.Y)("div",{className:"JTeUtfo5"}),(0,E.FD)(F.A,{className:"chat-list custom-scroll",ref:j,items:ae,preloadBackwards:a.iIc,withAbsolutePositioning:!0,maxHeight:(X?.length||0)*a.HGU,onLoadMore:re,sensitiveArea:a.C$_,beforeChildren:(0,E.Y)("div",{ref:G,className:"RtZDYhKR"}),children:[Boolean(ae?.length)&&function(){const n=X.indexOf(ae[0]);return ae?.map((o,i)=>o===s.l3?(0,E.Y)(B,{chatId:e.id,isSelected:t===o},o):(0,E.Y)(ee,{chatId:e.id,topic:T.topicsById[o],style:`top: ${(n+i)*a.HGU}px;`,isSelected:t===o,observeIntersection:Z,animationType:ie(o),orderDiff:ne[o],shiftDiff:oe,onReorderAnimationEnd:se},o))}(),ue&&!ae?.length&&(0,E.Y)(P.A,{},"loading")]}),!ue&&1===ae?.length&&ae[0]===a.HxB&&(0,E.Y)(V,{chatId:$})]})}))},78407:(e,t,n)=>{n.d(t,{A:()=>W});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(91048),d=n(30708),l=n(63495),c=n(96454),u=n(87357),h=n(52674),m=n(14680),p=n(17237),g=n(36353),f=n(37836),v=n(4961),A=n(11359),y=n(43874),C=n(19129),w=n(37661),b=n(39351),I=n(17712),S=n(59030),M=n(88458),N=n(41733);class Y{isPlaying=!1;constructor(e,t,n){this.container=t,this.options=n,this.video=document.createElement("video"),this.video.src=e,this.video.disablePictureInPicture=!0,this.video.muted=!0,n.style&&this.video.setAttribute("style",n.style),this.video.style.position="absolute",this.video.load(),this.options.noLoop||(this.video.loop=!0),(0,a.RK)(()=>{this.container.appendChild(this.video),this.recalculatePositionAndSize()})}play(){!this.isPlaying&&this.video&&(this.recalculatePositionAndSize(),this.video.paused&&(0,N.A)(this.video),this.isPlaying=!0)}pause(){this.isPlaying&&this.video&&(this.video.paused||this.video.pause(),this.isPlaying=!1)}destroy(){this.pause(),this.video?.remove(),this.video=void 0}updatePosition(e){this.options.position=e,this.recalculatePositionAndSize()}recalculatePositionAndSize(){const{size:e,position:{x:t,y:n}}=this.options;(0,a.YS)(()=>{if(!this.video)return;const o=this.video,{width:i,height:s}=this.container.getBoundingClientRect();(0,a.RK)(()=>{o.style.left=`${Math.round(t*i)}px`,o.style.top=`${Math.round(n*s)}px`,o.style.width=`${e}px`,o.style.height=`${e}px`})})}}var k=n(48894),F=n(60261),P=n(43336),T=n(76023),D=n(37479),x=n(87094),L=n(82117),E=n(93545),B=n(672),R=n(61157),O=n(38691);const U=1.25*T.$;var K=n(18276),z=n(64493),V=n(80089),j=n(80464),G=n(20021);const J=e=>{const{isOpen:t}=e,n=(0,j.A)(V.ar.Extra,"TextFormatter",!t);return n?(0,G.Y)(n,{...e}):void 0},$="input-scroller",q=140,H=["Esc","Escape","Enter","PageUp","PageDown","Meta","Alt","Ctrl","ArrowDown","ArrowUp","Control","Shift"],W=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n})=>{const{messageSendKeyCombo:o}=(0,d.lS)(e);return{messageSendKeyCombo:o,replyInfo:t&&n?(0,r.GA4)(e,t,n)?.replyInfo:void 0,isSelectModeActive:(0,r.rTV)(e),canPlayAnimatedEmojis:(0,r.BWX)(e)}})(({ref:e,id:t,chatId:n,captionLimit:d,isAttachmentModalInput:N,isStoryInput:T,customEmojiPrefix:V,editableInputId:j,isReady:W,isActive:_,getHtml:Q,placeholder:Z,forcedPlaceholder:X,canSendPlainText:ee,canAutoFocus:te,noFocusInterception:ne,shouldSuppressFocus:oe,shouldSuppressTextFormatter:ie,replyInfo:se,isSelectModeActive:ae,canPlayAnimatedEmojis:re,messageSendKeyCombo:de,isNeedPremium:le,messageListType:ce,onUpdate:ue,onSuppressedFocus:he,onSend:me,onScroll:pe,onFocus:ge,onBlur:fe})=>{const{editLastMessage:ve,replyToNextMessage:Ae,showAllowedMessageTypesNotification:ye,openPremiumModal:Ce}=(0,i.ko)();let we=(0,o.li)();e&&(we=e);const be=(0,o.li)(),Ie=(0,o.li)(),Se=(0,o.li)(),Me=(0,o.li)(),Ne=(0,o.li)(),Ye=(0,o.li)(),ke=(0,S.A)(),Fe=(0,b.A)(),Pe=(0,o.li)(!1),[Te,De,xe]=(0,w.A)(),[Le,Ee]=(0,o.J0)(),[Be,Re]=(0,o.J0)(),[Oe,Ue]=(0,o.J0)(!1),{isMobile:Ke}=(0,y.Ay)(),ze=Ke&&(c.pz||c.Ni);!function(e,t,n,s,d,l,c,u,h){const m=(0,x.A)(t,void 0,!u),p=(0,D.A)(m,!0),g=(0,O.A)(),f=(0,o.li)(new Map),v=(0,I.A)(e=>{e.forEach(e=>{const t=f.current.get(e);t&&(t.destroy(),f.current.delete(e))})}),A=(0,I.A)(()=>{if(!(u&&t.current&&n.current&&s.current))return;const e=(0,i.mS)(),o=new Set(f.current.keys());Array.from(t.current.querySelectorAll(".custom-emoji")).forEach(t=>{if(!t.dataset.uniqueId)return;const i=`${l}${t.dataset.uniqueId}${m||""}`,a=t.dataset.documentId;o.delete(i);const u=(0,F.ZR)(a);if(!u)return;const h=n.current.getBoundingClientRect(),v=t.getBoundingClientRect(),A=(0,P.LI)((v.left-h.left)/h.width,4),y=(0,P.LI)((v.top-h.top)/h.height,4);if(f.current.has(i))return void f.current.get(i).updatePosition(A,y);const C=(0,r.O8F)(e,a);if(!C)return;const w=C?.stickerSetInfo&&(0,r.CzR)(e,C.stickerSetInfo),b=[l,a,m,g].filter(Boolean).join("_");(async function({customEmoji:e,sharedCanvasRef:t,sharedCanvasHqRef:n,absoluteContainerRef:o,renderId:i,viewId:s,mediaUrl:a,position:r,isHq:d,textColor:l,colorFilter:c}){if(e.isLottie){const o=e.shouldUseTextColor&&l?(0,k.hF)(l):void 0,c=(await(0,M.Y)()).init(a,d?n.current:t.current,i,{size:U,coords:r,isLowPriority:!d},s,o?[o.r,o.g,o.b]:void 0);return{play:()=>c.play(),pause:()=>c.pause(),destroy:()=>c.removeView(s),updatePosition:(e,t)=>c.setSharedCanvasCoords(s,{x:e,y:t})}}if(e.isVideo){const t=e.shouldUseTextColor&&c?`filter: ${c};`:void 0,n=new Y(a,o.current,{size:U,position:r,style:t});return{play:()=>n.play(),pause:()=>n.pause(),destroy:()=>n.destroy(),updatePosition:(e,t)=>n.updatePosition({x:e,y:t})}}throw new Error("Unsupported custom emoji type")})({customEmoji:C,sharedCanvasRef:n,sharedCanvasHqRef:s,absoluteContainerRef:d,renderId:b,viewId:i,mediaUrl:u,isHq:w,position:{x:A,y},textColor:m,colorFilter:p}).then(e=>{c&&e.play(),f.current.set(i,e)})}),v(Array.from(o))});(0,o.vJ)(()=>(0,F.K3)(A),[A]),(0,o.vJ)(()=>{const e=f.current;return()=>{v(Array.from(e.keys()))}},[]),(0,o.vJ)(()=>{e()&&t.current&&n.current&&h&&u?(0,a.YS)(()=>{A()}):v(Array.from(f.current.keys()))},[e,A,t,v,n,h,u]),(0,o.Nf)(()=>{document.documentElement.style.setProperty("--input-custom-emoji-filter",p||"none")},[p]),(0,L.A)(([e])=>{void 0!==e&&m!==e&&A()},[m,A]);const y=(0,B.A)(A,[A],300,!1);(0,E.A)(n,y),(0,L.A)(([e])=>{g!==e&&(v(Array.from(f.current.keys())),A())},[g,A]);const C=(0,I.A)(()=>{f.current.forEach(e=>{e.pause()})}),w=(0,I.A)(()=>{c&&f.current?.forEach(e=>{e.play()})}),b=(0,I.A)(()=>{(0,a.YS)(w)});(0,R.Ay)(C,b)}(Q,we,Me,Ne,Ye,V,re,W,_);const Ve=N?160:T?128:Ke?256:416,je=(0,I.A)((e=!1)=>{(0,f.IJ)(()=>{(0,a.gm)(()=>{const t=we.current.closest(`.${$}`),n=Number(t.style.height.replace("px","")),o=Se.current,{scrollHeight:i}=o,s=Math.min(i,Ve);if(s===n)return;const r=i>Ve;function d(){const e=Math.round(50*Math.log(Math.abs(s-n)));t.style.height=`${s}px`,t.style.transitionDuration=`${e}ms`,t.classList.toggle("overflown",r)}return e?void(0,a.RK)(d):d})})});(0,o.Nf)(()=>{N&&je(!1)},[N,je]);const Ge=(0,o.li)(Q());(0,o.Nf)(()=>{const e=_?Q():"";!_&&we.current&&we.current.blur(),e!==we.current.innerHTML&&(we.current.innerHTML=e),e!==Ie.current.innerHTML&&(Ie.current.innerHTML=e),e!==Ge.current&&(Ge.current=e,je(!e))},[Q,_,je]),(0,o.li)(n).current=n;const Je=(0,I.A)(()=>{we.current&&!le&&(0,g.A)(we.current)}),$e=(0,I.A)(()=>{xe(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()});function qe(){if(c.pz)return!1;const e=window.getSelection();if(!e||!e.rangeCount||Pe.current)return xe(),c.Ni&&Ue(!1),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(ie||!(0,A.L)(t,j||s.CfG)||!n||(0,p.A)(n)||!t.START_TO_END)||(xe(),!1)}function He(){if(!qe())return;if(Oe)return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=we.current.closest(`.${$}`).getBoundingClientRect();let o=t.left+t.width/2-n.left;o<q?o=q:o>n.width-q&&(o=n.width-q),Ee({x:o,y:t.top-n.top}),Re(e),De()}function We(){be.current&&window.clearTimeout(be.current),be.current=window.setTimeout(He,260)}const _e=(0,I.A)(e=>"Enter"===e.key&&!e.shiftKey&&!ze&&("enter"===de&&!e.shiftKey||"ctrl-enter"===de&&(e.ctrlKey||e.metaKey))),Qe=(0,I.A)(e=>{e.preventDefault(),xe(),me()}),Ze=(0,I.A)(()=>Ce());(0,o.vJ)(()=>{c.TF||te&&Je()},[n,Je,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)(Je))},2e3,!0,!1);return(0,h.A)({onTab:e})},[Je]),(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,G.FD)("div",{id:t,onClick:oe?he:void 0,dir:Fe.isRtl?"rtl":void 0,children:[(0,G.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,G.FD)("div",{className:tt,children:[(0,G.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:Je,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(ue("<br>"===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,G.FD)("span",{className:(0,u.A)("placeholder-text",!N&&!ee&&"with-icon",le&&"is-need-premium"),dir:"auto",children:[!N&&!ee&&(0,G.Y)(K.A,{name:"lock-badge",className:"placeholder-icon"}),Z,T&&le&&(0,G.Y)(z.A,{className:"unlock-button",size:"tiny",color:"adaptive",onClick:Ze,children:ke("StoryRepliesLockedButton")})]}),(0,G.Y)("canvas",{ref:Me,className:"shared-canvas"}),(0,G.Y)("canvas",{ref:Ne,className:"shared-canvas"}),(0,G.Y)("div",{ref:Ye,className:"absolute-video-container"})]})}),(0,G.Y)("div",{ref:Se,className:(0,u.A)("custom-scroll",$,"clone",le&&"is-need-premium"),children:(0,G.Y)("div",{className:tt,children:(0,G.Y)("div",{ref:Ie,className:(0,u.A)(et,"clone"),dir:"auto"})})}),void 0!==d&&(0,G.Y)("div",{className:"max-length-indicator",dir:"auto",children:d}),(0,G.Y)(J,{isOpen:Te,anchorPosition:Le,selectedRange:Be,setSelectedRange:Re,onClose:$e}),X&&(0,G.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||a<s&&o>0?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 b=(0,o.li)(),I=(0,h.Vz)(b,C),[S,M,N]=(0,u.A)(),Y=(0,c.A)(e),k=(0,l.A)(e,"pictogram"),F=(0,p.A)(k,!I),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,!I),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:b,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:I&&!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),b=n(18276),I=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)(),G=(0,o.li)(),{cancelMediaDownload:J,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||!G.current)return;const e=F-we()*F;G.current.setAttribute("stroke-dashoffset",e.toString())},[ge,we]);const be=Boolean(ee&&H),Ie=(0,f.A)(()=>{j.current&&(fe(!1),Ce(0),(0,c.A)(j.current))}),Se=(0,f.A)(()=>{P?.(),P=Ie}),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();J({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)(I.A,{isVisible:!0,thumbDataUri:de,width:u.Wd,height:u.Wd,className:"media-spoiler"}),(0,Y.Y)(M.A,{canPlay:be,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??Ie: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:G,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)(b.A,{name:"view-once"})]}),!ee&&!Q&&(0,Y.Y)(b.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)(b.A,{name:"muted"})]}),O&&(0,Y.FD)(S.A,{onClick:Fe,className:"transcribe-button",children:[R||B?(0,Y.Y)(b.A,{name:"down"}):(0,Y.Y)(b.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),b=n(41512),I=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,I.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<l.length;e++){const{heights:t,lineCounts:n}=l[e],a=n.length,r=F(t,0)+i*(a-1),d=Math.min(...t)<o?1.5:1,c=(()=>{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<h)&&(u=l[e],h=m)}const m=u.lineCounts,p=u.heights,g=m.length;let f=0,v=0;for(let e=0;e!==g;++e){const t=m[e],o=p[e],s=Math.round(o);let r=0;for(let l=0;l!==t;++l){const c=0|(0===e?1:0)|(e===g-1?4:0)|(0===l?8:0)|(l===t-1?2:0),u=a[f],h=l===t-1?n-r:Math.round(u*o);d[f]={dimensions:{x:r,y:v,width:h,height:s},sides:c},r+=h+i,++f}v+=s+i}return d}(h):2===r?function(e){const{ratios:t,proportions:n,averageRatio:o}=e;return"ww"===n&&o>1.4&&t[1]-t[0]<.2?function(e){const{ratios:t,maxWidth:n,spacing:o,maxHeight:i}=e,s=Math.round(Math.min(n/t[0],Math.min(n/t[1],(i-o)/2)));return[{dimensions:{x:0,y:0,width:n,height:s},sides:11},{dimensions:{x:0,y:s+o,width:n,height:s},sides:14}]}(e):"ww"===n||"qq"===n?function(e){const{ratios:t,maxWidth:n,spacing:o,maxHeight:i}=e,s=(n-o)/2,a=Math.round(Math.min(s/t[0],Math.min(s/t[1],i)));return[{dimensions:{x:0,y:0,width:s,height:a},sides:13},{dimensions:{x:s+o,y:0,width:s,height:a},sides:7}]}(e):function(e){const{ratios:t,minWidth:n,maxWidth:o,spacing:i,maxHeight:s}=e,a=Math.round(1.5*n),r=Math.min(Math.round(Math.max(.4*(o-i),(o-i)/t[0]/(1/t[0]+1/t[1]))),o-i-a),d=o-r-i,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),G=n(9705),J=n(5130);let $,q;const H=new G.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,J.U)(new Worker(new URL(n.p+n.u(520),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*I.$,le=Number(I.$),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)(),[b,I,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)<de,u=Math.abs(l-o)<le;c&&u?y():C()},[h],oe.YS);return(0,o.vJ)(()=>{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()),I(),!0),onRelease:()=>{e&&a&&(f({replyToMsgId:n}),setTimeout(S,Math.max(0,150-(Date.now()-e))),e=void 0)}})},[t,s,n,I,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:b,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),be=n(18276),Ie=n(86070),Se=n(20021);function Me(e,t){const{width:n,height:o}=(0,I.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,b=t?(0,l.F9)(u,t):void 0,I=(0,U.A)(()=>{e&&!g?r():c({message:u("StoryNotFound")})}),{handleClick:M,handleMouseDown:N}=(0,Ce.Q)(I);return(0,Se.FD)(Ie.A,{ref:h,peerColor:t?.color,noUserColors:n,shouldReset:!0,className:(0,f.A)("EmbeddedMessage",w&&"with-thumb"),onClick:M,onMouseDown:N,children:[w&&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)(be.A,{name:"story-expired",className:"embedded-origin-icon"}),p&&(0,Se.Y)(be.A,{name:"story-reply",className:"embedded-origin-icon"}),u(A)]}),(0,Se.Y)("div",{className:"message-title",children:(0,S.A)(b||" ")})]})]})};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*I.$,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)(be.A,{name:"lock"}),(0,Se.Y)(be.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)(be.A,{name:"select"})}),(0,Se.Y)(e,{...c})]})}))}var ze=n(51644),Ve=n(25477);const je=Ke(ze.A),Ge=Ke(Ve.A),Je=(0,i.EK)(e=>{const t=(0,u.SJA)(e),n=(0,u.yuw)(e);return{theme:t,uploadsByKey:e.fileUploads.byMessageKey,activeDownloads:n}})(({album:e,observeIntersection:t,hasCustomAppendix:n,isOwn:s,isProtected:a,albumLayout:r,onMediaClick: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:b,height:I}=r.containerStyle;return(0,Se.Y)("div",{className:"Album",style:`width: ${b}px; height: ${I}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,b=g||(0,d.yl)(o),I=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(b){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:b,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"!==b.mediaType&&(0,d.$r)(h,b),theme:m,noSelectControls:e.isPaidMedia})}if(I)return(0,Se.Y)(Ge,{id:`album-media-${(0,d.GZ)(o.id)}`,video:I,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"!==I.mediaType&&(0,d.$r)(h,I),theme:m,noSelectControls:e.isPaidMedia})})})});var $e=n(41733);const qe=7*I.$;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)}),b=(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}))}),I=(0,U.A)(()=>{b();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}),b()})},[s,e,r,a,t,b,u,f]),{ref:h,size:f,style:A,handleClick:I}}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===I.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===I.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}))}),b=(0,o.Kr)(()=>{if(!y?.length)return;const e=(0,i.mS)();return y.map(t=>(0,u.PVB)(e,t)).filter(Boolean)},[y]),I=Boolean(A&&v&&A<v),S=g?c("CommentsCount","%COMMENTS_COUNT%",void 0,g).split("%").map(e=>"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",I&&"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)(be.A,{name:"comments-sticker",className:(0,f.A)("CommentButton_icon-comments",s&&l&&"CommentButton_hidden")}),!b?.length&&(0,Se.Y)(be.A,{name:"comments"}),Boolean(b?.length)&&(0,Se.Y)("div",{className:"recent-repliers",dir:h.isRtl?"rtl":"ltr",children:b.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)(be.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)(Ie.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)(Ie.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)(be.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),bt=n(64489),It=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:b}=p||g,I=(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)(bt.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)(It.A,{peerId:e,forceShowSelf:!0,withPeerColors:!I,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)(It.A,{peerId:e,forceShowSelf:!0,withPeerColors:!I,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",b,"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 I="";e&&(I=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:[I&&(0,Se.Y)("p",{className:"ZQ4aVVkI",children:(0,S.A)(I,["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)(be.A,{className:"corner-icon",name:"webapp"}):r.OFc.test(t)?void 0:(0,Se.Y)(be.A,{className:"corner-icon",name:"arrow-right"})}case"urlAuth":return(0,Se.Y)(be.A,{className:"corner-icon",name:"arrow-right"});case"buy":case"receipt":return(0,Se.Y)(be.A,{className:"corner-icon",name:"card"});case"switchBotInline":return(0,Se.Y)(be.A,{className:"corner-icon",name:"share-filled"});case"webView":case"simpleWebView":return(0,Se.Y)(be.A,{className:"corner-icon",name:"webapp"});case"copy":return(0,Se.Y)(be.A,{className:"corner-icon",name:"copy"});case"suggestedMessage":if("suggestChanges"===e.buttonType)return(0,Se.Y)(be.A,{className:"left-icon",name:"edit"});if("approve"===e.buttonType)return(0,Se.Y)(be.A,{className:"left-icon",name:"check"});if("decline"===e.buttonType)return(0,Se.Y)(be.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),b=(0,Et.A)(C,!w),I=e.id;(0,Lt.A)(([e])=>{if(t){if(C){const e=l.current.closest(r.KFG);(0,xt.A)(C,!1,I,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,I]);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:b,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)(be.A,{name:"lock",className:Ut.lock}),s("Checkout.PayPrice",(0,Dt.Ad)(u,h))]})]})});var zt=n(47526),Vt=n(14737),jt=n(30857),Gt=n(38691);const Jt=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:b,zoom:I}=Ht,S=(0,Gt.A)(),M=(0,d.rt)(v,w,b,I,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,I)},[u,v,I]),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:Jt,alt:""})}return(0,o.Nf)(()=>{a.current&&P(a.current)},[P]),(0,o.vJ)(()=>{Math.abs(h.lat-v.lat)<qt&&Math.abs(h.long-v.long)<qt?v.accuracyRadius!==h.accuracyRadius&&A({...v,accuracyRadius:h.accuracyRadius}):A(h)},[h,v]),(0,Vt.A)(()=>{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:I})},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:b}),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)(),b=(0,K.A)(),I=(0,O.A)();function M(e){e.stopPropagation(),y({message:{key:"ImportedInfo"}})}const N=(0,o.Kr)(()=>(0,en.Ee)(e.scheduleRepeatPeriod,I),[e.scheduleRepeatPeriod,I]),Y=(0,o.Kr)(()=>{if(!C)return;const t=(0,At.L2)(1e3*e.date,b.code,void 0,b.timeFormat),n=e.isEdited&&(0,At.L2)(1e3*e.editDate,b.code,void 0,b.timeFormat),o=e.forwardInfo&&(0,At.L2)(1e3*(e.forwardInfo.savedDate||e.forwardInfo.date),b.code,void 0,b.timeFormat);let i=t;return n&&(i+="\n",i+=I("MessageTooltipEditedDate",{date:n})),o&&(i+="\n",i+=I("MessageTooltipForwardedDate",{date:o})),i},[C,b,e,b.timeFormat]),k=(0,o.Kr)(()=>{if(!e.viewsCount)return;let t=I("MessageTooltipViews",{count:I.number(e.viewsCount)},{pluralValue:e.viewsCount});return e.forwardsCount&&(t+="\n",t+=I("MessageTooltipForwards",{count:I.number(e.forwardsCount)},{pluralValue:e.forwardsCount})),t},[I,e.forwardsCount,e.viewsCount]),F=(0,o.Kr)(()=>{const e=a?.messagesCount;if(e)return I("MessageTooltipReplies",{count:e},{pluralValue:e})},[I,a]),P=(0,o.Kr)(()=>{const t=(0,At.fU)(b,1e3*e.date),n=u?(0,At.be)(b,1e3*(e.forwardInfo?.date||e.date),!0):t;return N?I("FormatDateAtTime",{date:N,time:n}):n},[b,e.date,e.forwardInfo?.date,u,N,I]),T=(0,f.A)("MessageMeta",s&&"reactions-offset",e.forwardInfo?.isImported&&"is-imported");return(0,Se.FD)("span",{className:T,dir:I.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)(be.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)(I,e.viewsCount)}),(0,Se.Y)(be.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)(I,a.messagesCount)})}),(0,Se.Y)(be.A,{name:"reply-filled"})]}),c&&(0,Se.Y)(be.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)(I,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,I.code,!0)}),(0,Se.Y)("span",{className:"message-imported",onClick:M,children:I("MessageMetaImported")})]}),e.isEdited&&`${I("MessageMetaEdited")} `,e.isVideoProcessingPending&&`${I("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)(be.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)(be.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)([]),[b,I]=(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),I(!0),a([e])}),V=(0,U.A)(e=>{w(e)}),j=(0,U.A)(()=>{v(!0),I(!0),a(A)}),G=(0,U.A)(()=>{d({chatId:m,messageId:h})}),J=(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)(()=>{b&&P&&p.quiz&&g.results&&t.results.solution&&(g.results.find(e=>e.isChosen&&e.isCorrect)||J())},[P,b,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:J,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:b||!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:G,children:$("PollViewResults")})]})});var An=n(43581),yn=n(84555),Cn=n(10221),wn=n(18104),bn=n(14413),In=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)(),b=(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})}),G=S.isPreloadedGlobally?void 0:(0,d.Mw)(S,N&&!g.OF?"pictogram":"inline"),J=(0,R.Vz)(w,c),$=(0,R.Vz)(w,u),q=`sticker${S.id}?size=f`,H=(0,we.A)(q,!J||!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:b,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,I.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)(In.A,{containerRef:w,sticker:S,fullMediaHash:G,fullMediaClassName:"full-media",size:ie,shouldLoop:t,noLoad:!J,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:b,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)(bn.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:b}=(0,Fn.A)(Boolean(C)),I=(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:I,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",b),draggable:!1}),m&&(0,Se.Y)(Pn.A,{story:e,className:b})]}),h&&(0,Se.FD)("span",{children:[(0,Se.Y)(be.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<n)}})(function({message:e,story:t,peer:n,isUnread:o,targetUser:s}){const{openStoryViewer:a}=(0,i.ko)(),r=(0,K.A)(),{storyData:c}=e.content,u=(0,U.A)(()=>{a({peerId:t.peerId,storyId:t.id,isSinglePeer:!0,isSingleStory:!0})}),h=t&&"isDeleted"in t,m=t&&"content"in t,p=m?t.content.video:void 0,g=m?(0,d.EN)(t,"pictogram"):void 0,v=(0,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 b=(0,O.A)(),I=(0,U.A)(e=>{e.preventDefault(),e.stopPropagation(),s||d({message:b("SubscribeToTelegramPremiumForToggleTask"),action:{action:"openPremiumModal",payload:{initialSection:"todo"}},actionText:b("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)(b,n):void 0;return{label:(0,ut.fd)(e.title),value:e.id.toString(),peer:n,subLabel:o}}),[g,v,m,b]);return(0,Se.FD)("div",{className:"todo-list",dir:b.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?b("TitleToDoList"):v?b("TitleGroupToDoList"):N?b("TitleYourToDoList"):n?b("TitleUserToDoList",{peer:(0,l.F9)(b,n)},{withNodes:!0}):b("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)(be.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:I,disabled:!w,isRound:!0})}),(0,Se.Y)("div",{className:"completed-tasks-count",children:(0,Se.Y)(et.A,{text:b("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)()),b=(0,U.A)(()=>{w(!0)}),I=(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:I,withAdaptiveHeight:!0}),(0,Se.Y)("div",{className:"rV1S0P1o",style:`background-color: ${I[0]}`,children:y?s("GiftAuctionFinished"):(0,Se.Y)(zn.A,{endsAt:u,onEnd:b})}),(0,Se.Y)(Un.A,{ref:a,className:"g5kNvwaj",withSparkles:!0,sparklesColor:A,children:(0,Se.Y)(In.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 Gn=(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)(In.A,{containerRef:s,sticker:r.sticker,size:120,shouldLoop:l,observeIntersectionForPlaying:n,observeIntersectionForLoading:t})})]})}),Jn=(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:b,observeIntersectionForPlaying:I,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),G=(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 J=(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)(Ie.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)(Gn,{gift:t.gift,observeIntersectionForLoading:b,observeIntersectionForPlaying:I,onClick:J}),ae&&t.auction&&(0,Se.Y)(Vn,{auction:t.auction,observeIntersectionForLoading:b,observeIntersectionForPlaying:I,onClick:J}),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:b,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:b,noAvatars:s,canAutoLoad:r,canAutoPlay:l,asForwarded:c,isDownloading:u,isProtected:h,lastPlaybackTimestamp:w||G,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:b,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)(In.A,{containerRef:D,sticker:e,shouldLoop:!0,size:z.isEmoji?38:80,customColor:j,observeIntersectionForPlaying:I,observeIntersectionForLoading:b})},e.id))})]}),ue&&(0,Se.FD)(Re.A,{className:"WebPage--quick-button",size:"tiny",color:"translucent",isRectangular:!0,noForcedUpperCase:!ae,onClick:J,children:[he&&(0,Se.Y)(be.A,{name:he}),ue]})]})})),$n=1.75*I.$,qn=2.25*I.$,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:b,isFirstInGroup:I}=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),G=L?.story,J=G?(0,u.Msb)(e,G.peerId,G.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:be}=fe&&n||{},Ie=(0,u.TCk)(e),Se=Ie?.results?.query&&`${Ie.isHashtag?"#":""}${Ie.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?b?(0,u.O5q)(e,M,Ee):void 0:l,Re=R?.unreadReactions?.includes(l.id),Oe=C===s.l3&&R?.isForum&&!R.isBotForum&&I,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,Ge="connectionStateReady"===e.connectionState,Je=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:Je,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:J,isConnected:Ge,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?be: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:G,isFirstInGroup:J,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:Ie,shouldHideReply:Me,replyMessage:Te,replyMessageSender:De,replyMessageForwardSender:xe,replyMessageChat:Le,replyStory:Ke,isReplyPrivate:je,storySender:Ge,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:bt,hasActiveReactions:It,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:Gt,repliesThreadInfo:Jt,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:bn,maxTimestamp:In,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:Gn,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:bo,handleContextMenuClose:Io,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||G,noMountTransition:Mo&&!G,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:Go,voice:Jo,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(Jt)&&"thread"===Et,di=!si&&(0,d.aN)(e),li=di&&(wt||bt),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&&J,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),bi=Boolean(xo?.text),Ii=ui&&di,Si=Xt||Oo||ai||Ii,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),bo,wo,Fo,Ai,Zn,vi,hn),{handleSenderClick:ji,handleViaBotClick:Gi,handleReplyClick:Ji,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:b,lastPlaybackTimestamp:I}){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:G,replyToPeerId:J,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)(()=>{G&&!C?w&&J&&$?E({isComments:!0,originChannelId:J,originMessageId:$,focusMessageId:G}):Y({chatId:J||r,threadId:w?$:l,messageId:G,replyMessageId:J?void 0:O,noForumTopicPanel:!J,...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:I||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=b&&K.savedFromPeerId||K.fromChatId;u?Y({chatId:e,groupedId:z,groupedChatId:r,messageId:K.fromMessageId}):J&&$?w?E({isComments:!0,originChannelId:J,originMessageId:$,focusMessageId:K.fromMessageId}):Y({chatId:J,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:J||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)(()=>{Gn({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||bi,fs=(0,f.A)("Message message-list-item",J&&"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",Ie&&!A&&"is-thread-top",Boolean(e.inlineButtons)&&"has-inline-buttons",Ki&&"is-swiped",G&&"is-just-added",(It||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:bs}=ii||{};(0,o.vJ)(()=>{(qo?.hasEffect||wn)&&(qt?.current&&ko>=qt.current||Eo)&&lo()},[wn,Eo,qt,ko,qo?.hasEffect]);const Is=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<t)return;return n.detectedLanguage}catch(e){return void(r.Oig&&console.error("Failed to detect language: ",e))}return await $.request({name:"detectLanguage",args:[e,t]})}(e).then(e=>{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,Is,!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=Jt?.isCommentsInfo?Jt: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:b}=N(C),I=(0,d.r_)(e),{photo:S=w,video:M=b,audio:Y,voice:k,document:F,contact:P,location:T,invoice:D,storyData:x,giveaway:L,giveawayResults:E}=I,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,G=V&&!j,J=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(I).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||$||!G||u||R||v)&&z.push("has-solid-background"),R&&z.push("has-fact-check"),!a||J||!S&&G&&!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:bn,webPage:En,hasSubheader:Si,isCustomShape:di,isLastInGroup:oe,asForwarded:ui,hasThread:ri&&!Y,forceSenderName:ce,hasCommentCounter:ri&&Jt.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&&(bi||En)?"in-text":"standalone":"in-text",ci?Es?js="outside":ui?(Vs="standalone",js="inside"):js="inside":js="none";const Gs=di?"in-meta":"in-content";(0,L.A)(Cs||Fo,ys,Te,e.id,Me||je),(0,E.A)(ws||Fo,bs,Ke),(0,ee.A)({elementRef:_n,isFocused:et,focusDirection:tt,noFocusHighlight:st,isResizingContainer:dt,isJustAdded:G,isQuote:Boolean(ot),scrollTargetPosition:at});const Js=Cn?(0,l.em)(Xn,Cn):void 0,$s=!e.senderId,qs=Js||$s&&e.postAuthorTitle||(ui||ut)&&Po?.postAuthorTitle||void 0;(0,o.vJ)(()=>{const t=Qn.current;if(!t||!(0,b.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,I.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,I.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:bi,maxTimestamp:In,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&&!It&&"visible"),onClick:Oi,ref:Zn,children:(0,Se.Y)(Pe.A,{reaction:xt,size:$n,availableReactions:Dt,observeIntersection:u})})},[It,Dt,xt,Oi,zi,u]);function oa(){const t=(0,Se.Y)(nn,{message:e,isPinned:Ot,withFullDate:ut&&!Bo,noReplies:F,repliesThreadInfo:Jt,outgoingStatus:$e,signature:qs,withReactionOffset:"inside"===js,renderQuickReactionButton:Ls&&"in-meta"===Gs?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&&bi,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:[bi&&(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)(Jn,{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:Gt,onAudioPlay:Hi,onMediaClick:$i,onDocumentClick:qi,onCancelMediaTransfer:ns})}function aa(e){const t=(0,Se.FD)(Se.FK,{children:[gi&&n&&(0,Se.Y)(Je,{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)(be.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)(be.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:Gi,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)(be.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)(be.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)(be.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",Ii&&"forwarded-custom-shape",Si&&"with-subheader"),o=oe&&(!gs||As&&!bi&&"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"}),Ii&&(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:Ji}),ai&&(0,Se.Y)(Ne,{story:Ke,sender:Ge,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&&bt&&(0,Se.Y)(We,{customEmojiId:bt,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}),(Go||Jo||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:Jo&&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:Gt,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}),bn&&(0,Se.Y)(vn,{message:e,poll:bn,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)})}),bi&&(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"===Gs&&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:Io,onCloseAnimationEnd:So,repliesThreadInfo:Jt,noReplies:F,detectedLanguage:Is}),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),b=n(59030),I=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),b=e&&(0,a.Qe)(e.id),I=t||e,S=I&&!i&&!y&&!w&&!b,{isVideo:M}=n||{},N=(!n||n.id===I.avatarPhotoId)&&(0,a.cP)(I,"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),G=(0,R.A)(j)||T,[J,$]=(0,B.A)(),q=Boolean(G&&(!M||J)),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:I,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":b?"author-hidden":void 0,[b,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:G,className:(0,u.A)("avatar-media",H),muted:!0,disablePictureInPicture:!0,loop:!0,playsInline:!0,onReady:$}):(0,V.Y)("img",{src:G,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",b&&"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 G=n(43336),J=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,J.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,G.qE)(1.5*e.x,-.45,.45),y:(0,G.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),b=(0,d.SJA)(e),I=(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:b,isPlain:!I,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:G,profileColorOption:J,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,b.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,I.A)(D),be=(0,I.A)(x),[Ie,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=J&&("dark"===$?J.darkColors:J.colors);return e?{bgColors:[...e.bgColors].reverse(),storyColors:[...e.storyColors].reverse()}:void 0},[J,$,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)(()=>{be&&void 0!==we&&void 0===D&&(Se(!1),Ne(we))},[D,we,be]),(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,!Ie,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 G?(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,b,I=!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"),b?.();break;case"onTimeUpdate":{const{proxy:e}=M.current;if(I&&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:G}=M.current??{},J=(0,o.Kr)(()=>E?.duration&&Number.isFinite(E.duration)?E.duration:t,[E?.duration,t]);(0,o.vJ)(()=>{E&&(I&&0===E.currentTime||!J||(0,l.f)(E)||w||P(E.currentTime/J))},[J,F,E,w,I]),(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),J&&E&&P(E.currentTime/J)});return{isPlaying:k,playProgress:F,playPause:q,pause:x,play:$,stop:O,setCurrentTime:H,setVolume:R,audioProxy:E,duration:J,requestNextTrack:z,requestPreviousTrack:V,isFirst:U,isLast:K,setPlaybackRate:j,toggleMuted:G}}},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),b=(0,s.A)(()=>({withPortal:!0})),I=(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:b,getTriggerElement:w,getMenuElement:I,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()}),b=(0,s.A)(()=>{f({randomId:t,additionalInfo:o,canReport:r,sponsorInfo:n}),w()}),I=(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:b,onSponsoredHide:I,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:()=>L,b:()=>x});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(91034),h=n(48775),m=n(76023),p=n(4961),g=n(18501),f=n(35749),v=n(2338),A=n(11217),y=n(5912),C=n(39351),w=n(62587),b=n(59030),I=n(64154),S=n(42452),M=n(18276),N=n(27860),Y=n(18653),k=n(86070),F=n(20021);const P=" ",T=({className:e,message:t,replyInfo:n,suggestedPostInfo:u,sender:m,senderChat:N,forwardSender:T,composerForwardSenders:x,title:L,customText:E,isProtected:B,isInComposer:R,noUserColors:O,chatTranslations:U,requestedChatTranslationLanguage:K,isMediaNsfw:z,noCaptions:V,observeIntersectionForLoading:j,observeIntersectionForPlaying:G,onClick:J})=>{const $=(0,o.li)(),q=(0,y.Vz)($,j),H=(0,o.Kr)(()=>{const e="message"===n?.type&&n.replyMedia||t?.content;if(e)return{content:e}},[t,n]),W=H?.content?.video?.isGif?H.content.video:void 0,_=Boolean(W&&!W.previewPhotoSizes?.length),Q=(0,f.A)(H,_?"full":"pictogram"),Z=(0,w.A)(Q,!q),X=(0,v.A)(H),ee=Boolean(H&&(0,s.lk)(H)),te=Boolean(H&&(0,s.y2)(H))||z,ne=Boolean("message"===n?.type&&n.isQuote),oe="message"===n?.type?n.replyFrom:void 0,ie=t&&(0,s.ZR)(t),{translatedText:se}=(0,I.A)(U,t?.chatId,ie?t?.id:void 0,K),ae=(0,b.A)(),re=(0,C.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=N?(0,r.F9)(ae,N):void 0,ue=T?(0,r.F9)(ae,T):t?.forwardInfo?.hiddenUserName,he=m&&m.id===T?.id,{handleClick:me,handleMouseDown:pe}=(0,A.Q)(J);return(0,F.FD)(k.A,{peer:m,emojiIconClassName:"EmbeddedMessage--background-icons",ref:$,shouldReset:!0,isReply:Boolean(n),noUserColors:O,className:(0,d.A)("EmbeddedMessage",e,ne&&"is-quote",X&&"with-thumb","no-selection",x&&"is-input-forward",u&&"is-suggested-post"),dir:re.isRtl?"rtl":void 0,onClick:me,onMouseDown:pe,children:[(0,F.Y)("div",{className:"hover-effect"}),(0,F.Y)(S.A,{}),X&&D(X,Z,_,ee,B,te),(0,F.FD)("div",{className:"message-text",children:[(0,F.Y)("p",{className:(0,d.A)("embedded-text-wrapper",ne&&"multiline"),children:function(){if(u){if(!u?.price?.amount&&!u.scheduleDate)return re("ComposerEmbeddedMessageSuggestedPostDescription");const e=u.price?u.price.currency===i.ykW?(0,h.Ms)(re,u.price.amount,{className:"suggested-price-ton-icon",shouldConvertFromNanos:!0}):(0,h.U2)(re,u.price.amount,{className:"suggested-price-star-icon"}):"",t=u.scheduleDate?(0,l.e0)(u.scheduleDate,re,ae):"";return e&&!t?(0,F.Y)("span",{className:"suggested-post-price-wrapper",children:re("TitleSuggestedPostAmountForAnyTime",{amount:e},{withNodes:!0,withMarkdown:!0})}):(0,F.FD)("span",{className:"suggested-post-price-wrapper",children:[e,t?` • ${t}`:""]})}return"message"===n?.type&&n.quoteText?(0,g.fd)({text:n.quoteText.text,entities:n.quoteText.entities,asPreview:!0,emojiSize:17}):t?V?re("EmbeddedMessageNoCaption"):(0,F.Y)(Y.A,{message:t,noEmoji:Boolean(X),translatedText:se,observeIntersectionForLoading:j,observeIntersectionForPlaying:G,emojiSize:17}):E||function(e){if(!e||e.content.text)return P;const t=(0,a.GG)(re,e.content,{});return t?(0,F.Y)("span",{children:(0,p.A)(t)}):P}(H)||P}()}),(0,F.FD)("div",{className:"message-title",children:[function(){if(L)return(0,p.A)(L);if(u&&n)return re("TitleSuggestedChanges");if(u)return re("ComposerEmbeddedMessageSuggestedPostTitle");if(!de&&!le)return P;let e;N&&((0,s.WX)(N)&&(e="channel-filled"),(0,s.YE)(N)&&(e="group-filled"));const t=R&&Boolean(n&&"quoteText"in n&&n?.quoteText);return(0,F.FD)("span",{className:"embedded-sender-wrapper",children:[(!N||!!(0,c.L8)(N?.id)||N.id!==m?.id)&&(0,F.FD)("span",{className:"embedded-sender",children:[!x&&de&&(0,p.A)(t?ae("ReplyToQuote",de):de),le&&(0,p.A)(re("ComposerTitleForwardFrom",{users:le},{withNodes:!0,withMarkdown:!0}))]}),e&&(0,F.Y)(M.A,{name:e,className:"embedded-chat-icon"}),e&&ce&&(0,F.Y)("span",{className:"embedded-sender-chat",children:(0,p.A)(ce)})]})}(),ue&&!he&&(0,F.FD)("span",{className:"embedded-forward-sender-wrapper",children:[(0,F.Y)(M.A,{name:T?"share-filled":"forward",className:"embedded-origin-icon"}),(0,F.Y)("span",{className:"forward-sender-title",children:(0,p.A)(ue)})]})]})]})]})};function D(e,t,n,o,i,s){const{width:a,height:r}=(0,m.mr)(),l=t||e,c=n&&t;return(0,F.FD)("div",{className:(0,d.A)("embedded-thumb",o&&"round"),children:[!s&&!c&&(0,F.Y)("img",{src:l,width:a,height:r,alt:"",className:"pictogram",draggable:!1}),!s&&c&&(0,F.Y)("video",{src:t,width:a,height:r,playsInline:!0,disablePictureInPicture:!0,className:"pictogram"}),(0,F.Y)(N.A,{thumbDataUri:c?e:l,isVisible:Boolean(s),width:a,height:r}),i&&(0,F.Y)("span",{className:"protector"})]})}const x=(0,u.A)(T),L=T},92111:(e,t,n)=>{n.d(t,{A:()=>v});var o=n(84051),i=n(13439),s=n(23174),a=n(90709),r=n(91048),d=n(39761),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.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,b,I]=(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)(()=>{I(),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&&(b(),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=3892.b4ad2ee6db189b612f86.js.map
|