TelegramPWA/dist/488.82d1c15969d65f4b1a4d.js
Alexander Zinchuk daea14f37c [Build]
2025-05-14 19:17:41 +03:00

2 lines
72 KiB
JavaScript

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[488],{68292:(e,t,n)=>{n.d(t,{A:()=>h});var a=n(84051),o=n(13439),i=n(29807),s=n(87357),c=n(37836),r=n(30857),l=n(39351),d=n(73767);let m=0;const u=(0,c.Fe)((()=>{m=0})),h=(0,a.ph)((({text:e,className:t,isDisabled:n,ref:c})=>{const{isRtl:h}=(0,l.A)(),A=(0,d.A)(e),p=(0,r.A)(),g=!(!(!n&&(0,i.PKK)((0,o.mS)())&&void 0!==A&&A!==e)||m>=10||(0===m&&u(),m++,0)),y=(0,a.Kr)((()=>g?function(e,t){const n=[],o=e.length,i=t?.length??0;for(let s=0;s<=o;s++){const c=o-s,r=i-s;t&&r>=0&&e[c]!==t[r]?n.unshift(a.Ay.createElement("div",{className:"IYTzbS8o"},a.Ay.createElement("div",{className:"Jw1oQFdk"},e[c]??""),a.Ay.createElement("div",{className:"TZfEz3sc"},t[r]),a.Ay.createElement("div",{className:"Y9ied8_t"},e[c]??""))):n.unshift(a.Ay.createElement("span",null,e[c]??""))}return n}(e,A):e),[g,A,e]);return(0,a.vJ)((()=>{if(!g)return;const e=window.setTimeout((()=>{p()}),200);return()=>{window.clearTimeout(e)}}),[g,e]),a.Ay.createElement("span",{ref:c,className:(0,s.A)(t,!n&&"tgKbsVmz"),dir:h?"rtl":void 0},y)}))},79577:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(84051),o=n(23174),i=n(90709),s=n(62587),c=n(64489);function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},r.apply(this,arguments)}const l=(0,a.ph)((function(e){const{sticker:t,noLoad:n,forcePreview:l,...d}=e,m=t?.thumbnail?.dataUri,u=t&&(0,i.Mw)(t,"full"),h=(0,s.A)(t?(0,i.Mw)(t,"preview"):void 0,n&&!l,o.qZ.BlobUrl),A=(0,s.A)(u,n);return a.Ay.createElement(c.A,r({tgsUrl:A,previewUrl:h,thumbDataUri:m},d))}))},64489:(e,t,n)=>{n.d(t,{A:()=>h});var a=n(84051),o=n(87357),i=n(95807),s=n(37661),c=n(17712),r=n(83057),l=n(4438);const d="lM2usrZU";function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},m.apply(this,arguments)}const u=new Set,h=(0,a.ph)((function(e){const{previewUrl:t,thumbDataUri:n,className:h,...A}=e,[p,,g]=(0,s.A)(Boolean(n)),y=(0,r.A)(p),[f,v,C]=(0,s.A)(u.has(t)),E=(0,r.A)(f),[S,I]=(0,s.A)(!1),R=(0,c.A)((()=>{v(),u.add(t)})),w=(0,c.A)((()=>{g(),C(),setTimeout(I,300)})),{size:N}=e;return a.Ay.createElement("div",{className:(0,o.A)(h,"xCi2f0YH"),style:(0,i.A)(void 0!==N&&`width: ${N}px; height: ${N}px;`)},n&&!S&&a.Ay.createElement("img",{src:n,className:(0,o.A)(d,y),draggable:!1}),t&&!S&&a.Ay.createElement("img",{src:t,className:(0,o.A)(d,E),draggable:!1,onLoad:R}),a.Ay.createElement(l.A,m({},A,{onLoad:w})))}))},26875:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(84051),o=n(87357),i=n(59030),s=n(21849);const c=(0,a.ph)((({peers:e,size:t,className:n,limit:c=3,badgeText:r})=>{const l=(0,i.A)(),d="number"==typeof t?t:s.R[t],m=(0,a.Kr)((()=>r||(!e?.length||e.length<=c?void 0:"+"+(e.length-c))),[r,e,c]);return a.Ay.createElement("div",{className:(0,o.A)(n,"kXs18Nmi"),style:`--_size: ${d}px;`,dir:l.isRtl?"rtl":"ltr"},e?.slice(0,c).map((e=>a.Ay.createElement(s.A,{size:t,peer:e,className:"XND8fhC1"}))),m&&a.Ay.createElement("div",{className:"SHyAyGFO"},m))}))},81949:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(84051),o=n(87357);const i=({children:e,className:t,onClick:n,onMouseDown:i})=>a.Ay.createElement("div",{className:(0,o.A)("hJUqHi4B",n&&"hjDEmFaT",t),onClick:n,onMouseDown:i},e)},27860:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(84051),o=n(66644),i=n(87357),s=n(45470),c=n(17712),r=n(50680);const l=(0,a.ph)((({isVisible:e,withAnimation:t,thumbDataUri:n,className:l,width:d,height:m})=>{const u=(0,a.li)(null),{shouldRender:h,transitionClassNames:A}=(0,r.A)(e,void 0,!0,!t&&void 0,void 0,500),p=(0,s.A)(n,!h,void 0,25,d,m),g=(0,c.A)((e=>{if(!u.current)return;const t=u.current,n=e.currentTarget.getBoundingClientRect(),a=e.clientX-n.left,i=e.clientY-n.top,s=a-n.width/2,c=i-n.height/2;(0,o.RK)((()=>{t.setAttribute("style",`--click-shift-x: ${s}px; --click-shift-y: ${c}px`)}))}));if(h)return a.Ay.createElement("div",{className:(0,i.A)("qF2WgYVg",A,l,t&&"pNM3cgkY"),ref:u,onClick:t?g:void 0},a.Ay.createElement("canvas",{ref:p,className:"eULqS2yR",width:d,height:m}),a.Ay.createElement("div",{className:"XBor45hE"}))}))},15535:(e,t,n)=>{n.d(t,{A:()=>A});var a=n(84051),o=n(31481),i=n(66644),s=n(96454),c=n(87357),r=n(83868),l=n(14737),d=n(43874),m=n(59030),u=n(64493),h=n(18276);const A=(0,a.ph)((({isLoading:e=!1,isPasswordVisible:t,error:n,hint:A,placeholder:p="Password",submitLabel:g="Next",description:y,shouldShowSubmit:f,shouldResetValue:v,shouldDisablePasswordManager:C=!1,noRipple:E=!1,clearError:S,onChangePasswordVisibility:I,onInputChange:R,onSubmit:w})=>{const N=(0,a.li)(null),b=(0,m.A)(),{isMobile:M}=(0,d.Ay)(),[k,x]=(0,a.J0)(""),[P,T]=(0,a.J0)(!1),L=M?550:400;return(0,a.vJ)((()=>{v&&x("")}),[v]),(0,l.A)((()=>{s.TF||N.current.focus()}),L),(0,a.vJ)((()=>{n&&(0,i.RK)((()=>{N.current.focus(),N.current.select()}))}),[n]),a.Ay.createElement("form",{action:"",onSubmit:w?function(t){t.preventDefault(),e||P&&w(k)}:r.A,autoComplete:"off"},a.Ay.createElement("div",{className:(0,c.A)("input-group password-input",k&&"touched",n&&"error"),dir:b.isRtl?"rtl":void 0},C&&a.Ay.createElement("input",{type:"password",id:"prevent_autofill",autoComplete:"off",className:"visually-hidden",tabIndex:-2}),a.Ay.createElement("input",{ref:N,className:"form-control",type:t?"text":"password",id:"sign-in-password",value:k||"",autoComplete:C?"one-time-code":"current-password",onChange:function(e){n&&S();const{target:t}=e;x(t.value),T(t.value.length>=o.AGC),R&&R(t.value)},maxLength:256,dir:"auto"}),a.Ay.createElement("label",null,n||A||p),a.Ay.createElement("div",{className:"div-button toggle-password",onClick:function(){I(!t)},role:"button",tabIndex:0,title:"Toggle password visibility","aria-label":"Toggle password visibility"},a.Ay.createElement(h.A,{name:t?"eye":"eye-crossed"}))),y&&a.Ay.createElement("p",{className:"description"},y),w&&(P||f)&&a.Ay.createElement(u.A,{size:"smaller",type:"submit",ripple:!E,isLoading:e,disabled:!P},g))}))},10187:(e,t,n)=>{n.d(t,{A:()=>h});var a=n(84051),o=n(13439),i=n(70636),s=n(29807),c=n(87357),r=n(35049),l=n(59030),d=n(21849),m=n(34431),u=n(18276);const h=(0,a.ph)((0,o.EK)(((e,{peerId:t,forceShowSelf:n})=>{if(!t)return{};const a=(0,s.PVB)(e,t),o=(0,s.mBe)(e,t);return{peer:a,isSavedMessages:!n&&o&&o.isSelf}}))((({icon:e,title:t,isMinimized:n,canClose:o,isCloseNonDestructive:s,clickArg:h,peer:A,mockPeer:p,customPeer:g,className:y,isSavedMessages:f,withPeerColors:v,withEmojiStatus:C,onClick:E,itemClassName:S})=>{const I=(0,l.A)(),R=p||A,w=g||R,N=R&&(0,i.vj)(R)?R:void 0;let b,M,k;e&&t?(b=a.Ay.createElement("div",{className:"NtoGLT22"},a.Ay.createElement(u.A,{name:e,style:"f91Ad80i"})),M=t):w&&(b=a.Ay.createElement(d.A,{className:"La8BQ9yr",peer:w,size:"small",isSavedMessages:f}),k=(0,i.F9)(I,w)||t,M=t||a.Ay.createElement(m.A,{peer:w,isSavedMessages:f,withEmojiStatus:C}));const x=(0,c.A)("_Lq6_4e5",(N?.isForum||g?.isAvatarSquare)&&"JIHfTUVn",n&&"UhOZvxvs",o&&"uvvgSFUJ",s&&"fAk5yEeV",!E&&"P8r3OoaX",v&&(0,r.y)(g||A),y);return a.Ay.createElement("div",{className:x,onClick:()=>E?.(h),title:n?k:void 0,dir:I.isRtl?"rtl":void 0},b,!n&&a.Ay.createElement("div",{className:(0,c.A)("XPVuH29G",S),dir:"auto"},M),o&&a.Ay.createElement("div",{className:"xVPG2UTy"},a.Ay.createElement(u.A,{name:"close"})))})))},20333:(e,t,n)=>{n.d(t,{A:()=>m});var a=n(84051),o=n(87357),i=n(95807),s=n(59030),c=n(93545),r=n(18276);const l="_b5HgBXr",d="P6mch4bB",m=(0,a.ph)((({leftText:e,rightText:t,floatingBadgeText:n,floatingBadgeIcon:m,progress:u,isPrimary:h,className:A})=>{const p=(0,s.A)(),g=(0,a.li)(null),y=(0,a.li)(null),[f,v]=(0,a.J0)(0),[C,E]=(0,a.J0)(0),S=()=>{if(g.current&&y.current&&void 0!==u){const e=g.current.offsetWidth,t=y.current.offsetWidth,n=e/2,a=t-e/2,o=u*t,i=Math.max(n,Math.min(o,a));let s;v(i/t),s=o<n?u*t/(2*n):o>a?.5+(u-a/t)/(1-a/t)*.4:.5,E(s)}};(0,a.vJ)(S,[u]),(0,c.A)(y,S);const I=Boolean(m||n),R=Boolean(u)&&u>.99;return a.Ay.createElement("div",{ref:y,className:(0,o.A)("nY2ggBsF",I&&"RYtVQAjM",h&&"Zi0w7QJ3",A),style:(0,i.A)(void 0!==u&&`--progress: ${u}`,void 0!==C&&`--tail-position: ${C}`,`--shift-x: ${f}`)},I&&a.Ay.createElement("div",{className:"dhigNjAq"},a.Ay.createElement("div",{className:"cOpfCGPh"},a.Ay.createElement("div",{className:"uNwBLNOy",ref:g},m&&a.Ay.createElement(r.A,{name:m,className:"MJ7MTmxi"}),n&&a.Ay.createElement("div",{className:"MwzZt3Qo",dir:p.isRtl?"rtl":void 0},n)),a.Ay.createElement("div",{className:"qRwO7SZm"},a.Ay.createElement("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none"},a.Ay.createElement("path",{d:"m 28,4 v 9 c 0.0089,7.283278 -3.302215,5.319646 -6.750951,8.589815 l -5.8284,5.82843 c -0.781,0.78105 -2.0474,0.78104 -2.8284,0 L 6.7638083,21.589815 C 2.8288652,17.959047 0.04527024,20.332086 0,13 V 4 C 0,4 0.00150581,0.97697493 3,1 5.3786658,1.018266 22.594519,0.9142007 25,1 c 2.992326,0.1067311 3,3 3,3 z",fill:"#7E85FF"}))))),a.Ay.createElement("div",{className:l},a.Ay.createElement("span",null,e)),a.Ay.createElement("div",{className:d},a.Ay.createElement("span",null,t)),a.Ay.createElement("div",{className:(0,o.A)("sZZV0yoe",R&&"m8ie8IxL")},a.Ay.createElement("div",{className:l},a.Ay.createElement("span",null,e)),a.Ay.createElement("div",{className:d},a.Ay.createElement("span",null,t))))}))},66833:(e,t,n)=>{function a(e){return"starGift"===e.type?e.sticker:e.attributes.find((e=>"model"===e.type))?.sticker}function o(e){return"starGift"===e.type?e.availabilityTotal:e.totalCount}function i(e){if("starGiftUnique"===e.type)return function(e){const t=e.find((e=>"model"===e.type)),n=e.find((e=>"backdrop"===e.type)),a=e.find((e=>"pattern"===e.type));return{model:t,originalDetails:e.find((e=>"originalDetails"===e.type)),pattern:a,backdrop:n}}(e.attributes)}n.d(t,{UC:()=>o,uc:()=>i,yQ:()=>a})},49086:(e,t,n)=>{n.d(t,{C:()=>u,V:()=>m});var a=n(13439),o=n(23174),i=n(90709),s=n(3544),c=n(60343),r=n(58849),l=n(4961),d=n(18501);function m({message:e,highlight:t,emojiSize:n,asPreview:a,truncateLength:o,isProtected:s,forcePlayback:l,shouldRenderAsHtml:m,isForMediaViewer:u,threadId:h,maxTimestamp:A}){const{text:p,entities:g}=e.content.text||{};if(!p){const t=(0,i.P5)(e)?.text;return t?[(0,r.A)(t,o)]:void 0}const y=(0,c.bj)(e);return(0,d.fd)({text:(0,r.A)(p,o),entities:g,highlight:t,emojiSize:n,shouldRenderAsHtml:m,containerId:`${u?"mv-":""}${y}`,asPreview:a,isProtected:s,forcePlayback:l,messageId:"id"in e?e.id:void 0,chatId:e.chatId,threadId:h,maxTimestamp:A})}function u(e,t,n=!1,c,d=s.vs){const{entities:u}=t.content.text||{},h=(0,a.mS)(),A=(0,i.ni)(h,t),p=u?.some((e=>e.type===o.C7.Spoiler)),g=u?.some((e=>e.type===o.C7.CustomEmoji));if(!p&&!g){const a=(0,r.A)((0,s.dS)(e,t,A,n),d);return c?(0,l.A)(a,["emoji","highlight"],{highlight:c}):(0,l.A)(a)}const y=!n&&(0,s.Su)(t),f=y?`${y} `:"",v=m({message:t,highlight:c,asPreview:!0,truncateLength:d}),C=(0,s.oL)(e,t,A,v);return[...(0,l.A)(f),...Array.isArray(C)?C:[C]].filter(Boolean)}},79582:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(13439),o=n(29807),i=n(87894);const s=3e9,c=3e8;function r(e,t=!1,n,r){const l=(0,a.mS)();return(0,i.My)(e,(e=>{if(e===r)return 1/0;const a=(0,o.hds)(l,e);if(!a)return 0;let i=0;const d=(0,o.yHC)(l,e);return d&&(i+=d.date),t&&a.isVerified&&(i+=s),n&&n.includes(e)&&(i=Date.now()+c+(n.length-n.indexOf(e))),i}),"desc")}},54960:(e,t,n)=>{n.d(t,{A:()=>M});var a=n(84051),o=n(13439),i=n(31481),s=n(66644),c=n(90709),r=n(70636),l=n(29807),d=n(87357),m=n(87894),u=n(79824),h=n(96374),A=n(17712),p=n(59030),g=n(19806),y=n(46222),f=n(40664),v=n(52745),C=n(24956),E=n(21849),S=n(34431),I=n(18276),R=n(10187),w=n(45780),N=n(31722);const b="PeerPickerItem",M=(0,a.ph)((({className:e,categories:t,itemIds:n,categoryPlaceholderKey:M,filterValue:k,filterPlaceholder:x,notFoundText:P,searchInputId:T,itemClassName:L,isLoading:D,noScrollRestore:O,isSearchable:B,lockedUnselectedSubtitle:F,forceShowSelf:_,isViewOnly:K,itemInputType:U,withStatus:j,withPeerTypes:$,withPeerUsernames:z,withDefaultPadding:J,onFilterChange:H,onDisabledClick:q,onLoadMore:G,...V})=>{const W=(0,p.A)(),Y=V.allowMultiple,Z=Y?V.lockedSelectedIds:void 0,X=Y?V.lockedUnselectedIds:void 0,Q=(0,a.Kr)((()=>Y?V.selectedCategories:V.selectedCategory?[V.selectedCategory]:u.p),[Y,V.selectedCategory,V.selectedCategories]),ee=(0,a.Kr)((()=>Y?V.selectedIds:V.selectedId?[V.selectedId]:u.p),[Y,V.selectedId,V.selectedIds]),te=(0,a.li)(null),ne=ee.length>10;(0,a.vJ)((()=>{if(!B)return;const e=window.setTimeout((()=>{(0,s.YS)((()=>{te.current?.focus()}))}),500);return()=>{window.clearTimeout(e)}}),[B]);const ae=(0,a.Kr)((()=>new Set(Z)),[Z]),oe=(0,a.Kr)((()=>new Set(X)),[X]),ie=(0,a.Kr)((()=>ee.filter((e=>!ae.has(e)))),[ae,ee]),se=(0,a.Kr)((()=>t?(0,m.dU)(t,"type"):{}),[t]),ce=(0,a.Kr)((()=>{if(k)return n;const e=[],t=[],a=[];return n.forEach((n=>{ae.has(n)?e.push(n):oe.has(n)?a.push(n):t.push(n)})),e.concat(t,a)}),[k,n,ae,oe]),re=(0,A.A)((e=>{if(ae.has(e))q?.(e,!0);else if(oe.has(e))q?.(e,!1);else{if(Y&&se[e]){const t=se[e].type,n=Q?.slice()||[];return n.includes(t)?n.splice(n.indexOf(t),1):n.push(t),void V.onSelectedCategoriesChange?.(n)}if(Y){const t=ee.slice();return t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),void V.onSelectedIdsChange?.(t)}se[e]?V.onSelectedCategoryChange?.(se[e].type):V.onSelectedIdChange?.(e)}})),le=(0,A.A)((e=>{const{value:t}=e.currentTarget;H?.(t)})),[de,me]=(0,h.A)(G,ce,Boolean(k)),ue=(0,a.hb)(((e,t)=>{const n=(0,o.mS)(),s=t?se[e]:void 0,m=t?void 0:(0,l.PVB)(n,e),u=m||s;if(!u)return i.Oig?a.Ay.createElement("div",{key:e},"No peer or category with ID ",e):void 0;const h=m&&!(0,r.vj)(m)?m.isSelf&&!_:void 0,A=oe.has(e),p=ae.has(e),y=A||p,f=s?Q?.includes(s.type):ee.includes(e),[v,R]=function(){if(A)return[F];if(m){if(z){const e=m.usernames?.[0]?.username;if(e)return[`@${e}`]}if(j){if((0,r.vj)(m))return[(0,c.sT)(W,m)];const e=(0,l.K0y)(n,m.id);return[(0,c.CD)(W,m,e),(0,d.A)((0,c.PF)(m,e,!0)&&N.A.onlineStatus)]}if($){const e=(0,r.cy)(m);return e&&[W(e)]}}}()||[];return a.Ay.createElement(w.A,{key:e,className:(0,d.A)(b,L),title:a.Ay.createElement(S.A,{peer:u}),avatarElement:a.Ay.createElement(E.A,{peer:m||s,isSavedMessages:h,size:"medium"}),subtitle:v,subtitleClassName:R,disabled:y,inactive:K,ripple:!0,inputElement:y?a.Ay.createElement(I.A,{name:"lock-badge"}):"radio"===U?a.Ay.createElement(C.A,{checked:f,disabled:y,onlyInput:!0}):"checkbox"===U?a.Ay.createElement(g.A,{checked:f,disabled:y,onlyInput:!0}):void 0,inputPosition:"end",onClick:()=>re(e),onDisabledClick:q&&(()=>q(e,p))})}),[se,_,K,L,U,W,ae,oe,F,q,Q,ee,$,j,z]),he=(0,a.Kr)((()=>{if(t?.length)return a.Ay.createElement("div",{key:"categories"},M&&a.Ay.createElement("div",{className:N.A.pickerCategoryTitle},W(M)),t?.map((e=>ue(e.type,!0))),a.Ay.createElement("div",{className:N.A.pickerCategoryTitle},W("FilterChats")))}),[t,M,W,ue]);return a.Ay.createElement("div",{className:(0,d.A)(N.A.container,e)},B&&a.Ay.createElement("div",{className:(0,d.A)(N.A.header,"custom-scroll"),dir:W.isRtl?"rtl":void 0},Q?.map((e=>a.Ay.createElement(R.A,{className:N.A.peerChip,customPeer:se[e],onClick:re,clickArg:e,canClose:!0}))),Z?.map(((e,t)=>a.Ay.createElement(R.A,{className:N.A.peerChip,peerId:e,isMinimized:ne&&t<ee.length-5,forceShowSelf:_,onClick:re,clickArg:e}))),ie.map(((e,t)=>a.Ay.createElement(R.A,{className:N.A.peerChip,peerId:e,isMinimized:ne&&t+(Z?.length||0)<ee.length-5,canClose:!0,onClick:re,clickArg:e}))),a.Ay.createElement(f.A,{id:T,ref:te,value:k,onChange:le,placeholder:x||W("SelectChat")})),de?.length?a.Ay.createElement(y.A,{className:(0,d.A)(N.A.pickerList,J&&N.A.padded,"custom-scroll"),items:de,itemSelector:`.${b}`,beforeChildren:he,onLoadMore:me,noScrollRestore:O},de.map((e=>ue(e)))):D||!de||de.length?a.Ay.createElement(v.A,null):a.Ay.createElement("p",{className:N.A.noResults},P||"Sorry, nothing found."))}))},45780:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(84051),o=n(96454),i=n(87357),s=n(17712),c=n(59030),r=n(42452);const l=({title:e,subtitle:t,avatarElement:n,inputElement:l,inputPosition:d="start",disabled:m,inactive:u,ripple:h,className:A,titleClassName:p,subtitleClassName:g,style:y,onClick:f,onDisabledClick:v})=>{const C=(0,c.A)(),E=!u&&!m,S=(0,s.A)((()=>{u||(m?v?.():f?.())}));return a.Ay.createElement("div",{className:(0,i.A)("OHkx_W75",t&&"neXqB2_A",m&&"tvZeVJPh",E&&"VUSwo4t5",n&&"dMT9byM6",A),onClick:S,style:y,dir:C.isRtl?"rtl":void 0,role:E?"button":void 0,tabIndex:E?0:void 0},!m&&!u&&h&&a.Ay.createElement(r.A,null),l&&a.Ay.createElement("div",{className:(0,i.A)("kmjqObdP","end"===d?"iqGhSQGm":"F0Hv3EQm")},l),n&&a.Ay.createElement("div",{className:"dnAaRPCo"},n),a.Ay.createElement("div",{className:(0,i.A)("JSSC0N8V",p)},e),t&&a.Ay.createElement("div",{className:(0,i.A)("OYmzCSp2",g)},t),!l&&o.pz&&a.Ay.createElement("div",{className:"P53DrbWA"}))}},40558:(e,t,n)=>{n.d(t,{A:()=>h});var a=n(84051),o=n(66644),i=n(90709),s=n(87357),c=n(95807),r=n(87679),l=n(17712),d=n(62587),m=n(93545),u=n(38691);const h=(0,a.ph)((({backgroundColors:e,patternColor:t,patternIcon:n,clearBottomSector:h,className:A})=>{const p=(0,a.li)(null),g=(0,a.li)(null),[y,f]=(0,a.Ul)({width:0,height:0}),v=(0,u.A)(),[C,E]=(0,a.J0)(),S=n&&(0,i.Mw)(n,"preview"),I=(0,d.A)(S);(0,a.vJ)((()=>{I&&(0,r.NN)(I).then(E)}),[I]);const R=(0,a.Kr)((()=>{const e=[];for(let t=1;t<=3;t++){const n=Math.floor(8*(1+.5*(t-1))),a=t/3,o=.05+(.4-.05)*a,i=t%2==0?Math.PI/n:0;for(let t=0;t<n;t++){const s=t/n*Math.PI*2+i;if(h&&s>.45*Math.PI&&s<.55*Math.PI)continue;const c=.5+1.71*o*Math.cos(s),r=.5+o*Math.sin(s),l=1.4-a*Math.random();e.push({x:c,y:r,sizeFactor:l})}}return e}),[h]);(0,m.A)(p,(e=>{f({width:e.contentRect.width,height:e.contentRect.height})})),(0,a.vJ)((()=>{const e=p.current;e&&f({width:e.clientWidth,height:e.clientHeight})}),[f]);const w=(0,l.A)((()=>{const e=g.current;if(!e||!C)return;const n=e.getContext("2d"),{width:a,height:o}=e;if(!a||!o)return;n.save(),R.forEach((({x:e,y:t,sizeFactor:i})=>{const s=(a-Math.max(a,250*v))/2,c=e*Math.max(a,250*v)+s,r=t*Math.max(o,250*v)+s,l=20*v*i*(s?.8:1);n.drawImage(C,c-l/2,r-l/2,l,l)})),n.restore(),t&&(n.save(),n.fillStyle=t,n.globalCompositeOperation="source-atop",n.fillRect(0,0,a,o),n.restore());const i=n.createRadialGradient(a/2,o/2,0,a/2,o/2,a/2);i.addColorStop(0,"#FFFFFF77"),i.addColorStop(1,"#FFFFFF"),n.save(),n.globalCompositeOperation="destination-out",n.fillStyle=i,n.fillRect(0,0,a,o),n.restore()}));return(0,a.vJ)((()=>{w()}),[C]),(0,a.vJ)((()=>{const{width:e,height:t}=y(),n=g.current;if(!e||!t)return;const a=Math.max(e,t);(0,o.RK)((()=>{n.width=a*v,n.height=a*v,w()}))}),[y,v]),a.Ay.createElement("div",{ref:p,className:(0,s.A)("Af3tYFMg",A),style:(0,c.A)(`--_bg-1: ${e[0]}`,`--_bg-2: ${e[1]||e[0]}`)},a.Ay.createElement("canvas",{className:"GbpiDSS_",ref:g}))}))},83594:(e,t,n)=>{n.d(t,{A:()=>m});var a=n(84051),o=n(90709),i=n(96454),s=n(87357),c=n(95807),r=n(62587),l=n(87412);const d="PZAuNVZH",m=(0,a.ph)((({reaction:e,isLottie:t,className:n,particleSize:m,onEnded:u})=>{const h=(0,o.aL)(e.documentId,!0),A=(0,r.A)(t?void 0:h),p=(0,a.Kr)((()=>i.ol?Array.from({length:7}).map((()=>function(e=20){const t=(e/2+Math.random()*e*3)*(Math.random()>.5?1:-1),n=e+Math.random()*e*4;return`M 0 0 C 0 0 ${t} ${-n-e} ${t} ${n}`}(m))):[]),[m]);if(A||t)return a.Ay.createElement("div",{className:(0,s.A)("aInga6VW",n),style:(0,c.A)(Boolean(m)&&`--particle-size: ${m}px`)},p.map(((n,o)=>{const i=`--offset-path: path('${n}');`;return t?a.Ay.createElement(l.A,{documentId:e.documentId,className:d,style:i,withSharedAnimation:!0,size:m,onAnimationEnd:0===o?u:void 0}):a.Ay.createElement("img",{src:A,alt:"",className:d,style:i,draggable:!1,onAnimationEnd:0===o?u:void 0})})))}))},11241:(e,t,n)=>{n.d(t,{A:()=>R});var a=n(84051),o=n(13439),i=n(90709),s=n(29807),c=n(87357),r=n(43336),l=n(76023),d=n(37661),m=n(5912),u=n(17712),h=n(62587),A=n(50680),p=n(47483),g=n(18104),y=n(87412),f=n(83594),v=n(17794),C=n(93879);const E=1.5*l.$,S=6.5*l.$,I=l.$,R=(0,a.ph)((0,o.EK)(((e,{containerId:t})=>{const{genericEmojiEffects:n,reactions:a}=e,{activeReactions:o}=(0,s.nTw)(e),i=(0,s.xYJ)(e,"reactionEffects");return{activeReactions:o?.[t],availableReactions:a.availableReactions,genericEffects:n,withEffects:i}}))((({containerId:e,reaction:t,className:n,size:s=E,effectSize:l=S,activeReactions:R,availableReactions:w,genericEffects:N,withEffects:b,withEffectOnly:M,shouldPause:k,shouldLoop:x,loopLimit:P,observeIntersection:T})=>{const{stopActiveReaction:L}=(0,o.ko)(),D=(0,a.li)(null),O="custom"===t.type,B=(0,a.Kr)((()=>w?.find((e=>(0,i.a0)(e.reaction,t)))),[w,t]),F=B?.centerIcon?.id,{customEmoji:_}=(0,p.A)(O?t.documentId:void 0),K=(0,a.Kr)((()=>{if(!O)return B?.aroundAnimation?.id;if(!_)return;const e=w?.find((e=>e.reaction.emoticon===_.emoji))?.aroundAnimation?.id;return e}),[B,w,_,O]),U=(0,a.Kr)((()=>{if(K)return K;if(!N?.stickers)return;const{stickers:e}=N;return e[Math.floor(Math.random()*e.length)].id}),[K,N]),j=(0,m.Vz)(D,T),$=F&&(0,i.aL)(F),z=U&&(0,i.aL)(U),J=(0,h.A)($),H=(0,h.A)(z),q=(0,a.Kr)((()=>R?.find((e=>(0,i.a0)(e,t)))),[R,t]),G=Boolean(b&&q&&(O||J)&&H),V=j&&(G&&!M||x),{shouldRender:W,transitionClassNames:Y}=(0,A.A)(G,void 0,!0,"slow"),{shouldRender:Z,transitionClassNames:X}=(0,A.A)(V,void 0,!0,"slow"),Q=(0,u.A)((()=>{L({containerId:e,reaction:t})})),[ee,te,ne]=(0,d.A)(),ae=!(O||V&&ee),{shouldRender:oe,transitionClassNames:ie}=(0,A.A)(ae,void 0,!0),se=(0,c.A)(C.A.root,W&&C.A.animating,M&&C.A.withEffectOnly,n);return a.Ay.createElement("div",{className:se,ref:D},!M&&oe&&a.Ay.createElement(v.A,{className:ie,reaction:t,availableReactions:w,size:s,observeIntersection:T}),!M&&O&&a.Ay.createElement(y.A,{documentId:t.documentId,className:C.A.customEmoji,size:s,noPlay:k,noVideoOnMobile:!0,loopLimit:P,observeIntersectionForPlaying:T,forceAlways:!0}),Z&&!O&&a.Ay.createElement(g.A,{key:`${F}-${s}`,className:(0,c.A)(C.A.animatedIcon,X),size:(0,r.Ki)(1.9*s),tgsUrl:J,play:j&&!k,noLoop:!x,onLoad:te,onEnded:ne,forceAlways:!0}),W&&a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement(g.A,{key:`${U}-${l}`,className:(0,c.A)(C.A.effect,Y),size:l,tgsUrl:H,play:j,noLoop:!0,onEnded:Q,forceAlways:!0}),O&&!K&&j&&a.Ay.createElement(f.A,{reaction:t,className:Y,particleSize:Math.max(.5*s,I),onEnded:Q})))})))},17794:(e,t,n)=>{n.d(t,{A:()=>m});var a=n(84051),o=n(90709),i=n(87357),s=n(62587),c=n(83057),r=n(87412),l=n(18276),d=n(61911);const m=(0,a.ph)((({reaction:e,availableReactions:t,className:n,size:m,withIconHeart:u,observeIntersection:h})=>{const A=(0,a.Kr)((()=>t?.find((t=>(0,o.a0)(t.reaction,e)))),[t,e]),p=A?.staticIcon?.id,g=p?`document${p}`:void 0,y=(0,s.A)(g),f=(0,c.A)(y),v="emoji"===e.type&&"🦄"===e.emoticon,C=u&&"emoji"===e.type&&"❤"===e.emoticon;return"custom"===e.type?a.Ay.createElement(r.A,{documentId:e.documentId,className:(0,i.A)("ReactionStaticEmoji",n),size:m,observeIntersectionForPlaying:h}):C?a.Ay.createElement(l.A,{name:"heart",className:"ReactionStaticEmoji",style:`font-size: ${m}px; width: ${m}px`}):a.Ay.createElement("img",{className:(0,i.A)("ReactionStaticEmoji",v&&"with-unicorn-fix",f,n),style:m?`width: ${m}px; height: ${m}px`:void 0,src:y||d,alt:A?.title,draggable:!1})}))},99515:(e,t,n)=>{n.d(t,{A:()=>W});var a=n(84051),o=n(13439),i=n(23174),s=n(31481),c=n(90709),r=n(29807),l=n(87357),d=n(85982),m=n(80539);const u=document.createElement("div"),h=new Set([i.C7.Bold,i.C7.Italic,i.C7.Underline,i.C7.Strike,i.C7.Spoiler,i.C7.CustomEmoji]);function A(e){const t=function(e){const t=e.cloneContents();u.appendChild(t);const n=function(e,t){const n=e.commonAncestorContainer;if(n.nodeType===Node.ELEMENT_NODE&&n.classList.contains("text-content"))return t;let a=e.commonAncestorContainer.parentElement;for(;a&&!a.classList.contains("text-content");){const e=a.tagName.toLowerCase(),n=a.dataset.entityType;t=`<${e} ${n?`data-entity-type="${n}"`:""}>${t}</${e}>`,a=a.parentElement}return t}(e,u.innerHTML);return u.innerHTML="",n.replace(/<br\s*\/?>/gi,"\n").replace(/&nbsp;/gi," ").replace(/\u00a0/gi," ")}(e);return function(e){if(!e.entities)return e;const t=e.entities.filter((e=>h.has(e.type)));return{...e,entities:t.length?t:void 0}}((0,m.Ay)(t,!1,!0))}var p=n(37661),g=n(17712),y=n(59030),f=n(24531),v=n(21511),C=n(80089),E=n(80464);const S=e=>{const{isOpen:t}=e,n=(0,E.A)(C.ar.Extra,"PinMessageModal",!t);return n?a.Ay.createElement(n,e):void 0};var I=n(94189),R=n(73104),w=n(76023),N=n(4961),b=n(3544),M=n(96454),k=n(81686),x=n(58554),P=n(49086);function T(e){return e?"lng_context_copy_selected":"lng_context_copy_text"}var L=n(43874),D=n(26875),O=n(71429),B=n(24433),F=n(60859),_=n(55158),K=n(17663);const U="C3LVl_JT",j="cd1ZZeSy",$=(0,a.ph)((function({message:e}){const t=(0,y.A)(),{editDate:n}=e,o=!n;return a.Ay.createElement(B.A,{icon:"clock-edit",className:U},o?a.Ay.createElement(_.A,{className:j}):Boolean(n)&&t("Chat.PrivateMessageEditTimestamp.Date",(0,K.U)(t,1e3*n)))}));var z=n(76283),J=n(41036);const H=(0,a.ph)((function({message:e,shouldRenderShowWhen:t,canLoadReadDate:n,closeContextMenu:i}){const{openPrivacySettingsNoticeModal:s}=(0,o.ko)(),c=(0,y.A)(),{readDate:r}=e,l=n&&!r&&!t;return a.Ay.createElement(B.A,{icon:"message-read",className:U},a.Ay.createElement(J.Ay,{name:"fade",activeKey:l?1:2,className:"mg4sBQ9n"},l?a.Ay.createElement(_.A,{className:j}):a.Ay.createElement(a.Ay.Fragment,null,Boolean(r)&&c("PmReadAt",(0,K.U)(c,1e3*r)),!r&&t&&a.Ay.createElement("div",null,c("PmRead"),a.Ay.createElement("span",{className:"bmxij_dk",onClick:()=>{i(),s({chatId:e.chatId,isReadDate:!0})}},c("PmReadShowWhen"))))))})),q=(0,a.ph)((({isReactionPickerOpen:e,availableReactions:t,topReactions:n,defaultTagReactions:s,isOpen:r,message:m,poll:u,story:h,isPrivate:A,isCurrentUserPremium:f,enabledReactions:v,isWithPaidReaction:C,reactionsLimit:E,anchor:S,targetHref:I,canSendNow:K,canReschedule:U,canBuyPremium:j,canReply:J,canQuote:q,canEdit:G,noReplies:V,canPin:W,canUnpin:Y,canDelete:Z,canForward:X,canReport:Q,canFaveSticker:ee,canUnfaveSticker:te,canCopy:ne,canCopyLink:ae,canSelect:oe,canDownload:ie,canSaveGif:se,canRevote:ce,canClosePoll:re,canTranslate:le,canShowOriginal:de,canSelectLanguage:me,isDownloading:ue,repliesThreadInfo:he,canShowSeenBy:Ae,canShowReactionsCount:pe,canShowReactionList:ge,seenByRecentPeers:ye,hasCustomEmoji:fe,customEmojiSets:ve,canPlayAnimatedEmojis:Ce,isInSavedMessages:Ee,shouldRenderShowWhen:Se,canLoadReadDate:Ie,onReply:Re,onOpenThread:we,onEdit:Ne,onPin:be,onUnpin:Me,onForward:ke,onDelete:xe,onFaveSticker:Pe,onReport:Te,onUnfaveSticker:Le,onSelect:De,onSend:Oe,onReschedule:Be,onClose:Fe,onCloseAnimationEnd:_e,onCopyLink:Ke,onCopyNumber:Ue,onDownload:je,onSaveGif:$e,onCancelVote:ze,onClosePoll:Je,onShowSeenBy:He,onShowReactors:qe,onToggleReaction:Ge,onSendPaidReaction:Ve,onShowPaidReactionModal:We,onCopyMessages:Ye,onReactionPickerOpen:Ze,onTranslate:Xe,onShowOriginal:Qe,onSelectLanguage:et,userFullName:tt,canGift:nt})=>{const{showNotification:at,openStickerSet:ot,openCustomEmojiSets:it,loadStickers:st,openGiftModal:ct}=(0,o.ko)(),rt=(0,a.li)(null),lt=(0,a.li)(null),dt=(0,y.A)(),mt=!A&&!v,ut=m.areReactionsPossible,ht=ge&&!mt||ut,At="isEdited"in m&&m.isEdited,pt=m.seenByDates,gt="giftPremium"===m.content.action?.type,yt="giftCode"===m.content.action?.type,ft="starGift"===m.content.action?.type,vt="starGiftUnique"===m.content.action?.type,Ct=(0,c.L8)(m.chatId)&&nt&&(gt||yt||ft||vt),[Et,St]=(0,p.A)(),[It,Rt,wt]=(0,p.A)(),{isMobile:Nt,isDesktop:bt}=(0,L.Ay)(),Mt=(0,a.Kr)((()=>pt?Object.keys(pt).length:0),[pt]),kt=(0,g.A)((()=>{at({message:dt("Share.Link.Copied")}),Fe()})),xt=(0,g.A)((()=>{ct({forUserId:m.chatId}),Fe()}));(0,a.vJ)((()=>{r&&Et&&!e&&Fe()}),[Fe,r,e,Et]),(0,a.vJ)((()=>{ve?.length&&ve.map((e=>st({stickerSetInfo:{id:e.id,accessHash:e.accessHash}})))}),[ve,it]);const Pt=(0,g.A)((()=>{ve&&(1===ve.length?ot({stickerSetInfo:{shortName:ve[0].shortName}}):it({setIds:ve.map((e=>e.id))}),Fe())})),Tt=function(e,t,n,a,o,s,r,l){const m=[],u=(0,c.P5)(e),h=(0,c.yl)(e)||((0,c.QC)(e)?void 0:(0,c.dc)(e)),A=(0,c.Qm)(e),p=h?(0,c.rI)(h,"full"):void 0,g=a&&h&&(p||(0,c.KG)(h))&&d.WO&&!M.Yw,y=window.getSelection();if(g&&m.push({label:"lng_context_copy_image",icon:"copy-media",handler:()=>{Promise.resolve(p?x.hd(p,i.qZ.BlobUrl):h.blobUrl).then(d.qp),o?.()}}),a&&n)m.push({label:"lng_context_copy_link",icon:"copy",handler:()=>{(0,d.eM)(n),o?.()}});else if(a&&u){const n=Boolean(y?.anchorNode?.parentNode&&y.anchorNode.parentNode.closest(".Message .content-inner")&&""!==y.toString().replace(/(?:\r\n|\r|\n)/g,"")&&function(e){const t=window.getSelection(),n=t?.anchorNode?.parentNode,a=n?.closest(".Message.message-list-item");return(0,c.GZ)(e.id)===a?.id}(e));m.push({label:T(n),icon:"copy",handler:()=>{const a=(0,k.A)();if(a?.length&&r)r(a);else if(n)document.execCommand("copy");else{const n=(0,P.V)({message:e,shouldRenderAsHtml:!0});n&&(0,d.A)(n.join(""),(0,b.Gn)(e,t))}o?.()}})}return s&&m.push({label:"lng_context_copy_message_link",icon:"link",handler:s}),A&&l&&m.push({label:"lng_profile_copy_phone",icon:"copy",handler:()=>{l(),o?.()}}),m}(m,(0,c.FE)({poll:u,story:h}),I,ne,kt,ae?Ke:void 0,Ye,Ue),Lt=(0,g.A)((()=>document.querySelector(`.Transition_slide-active > .MessageList div[data-message-id="${m.id}"]`))),Dt=(0,g.A)((()=>document.querySelector(".Transition_slide-active > .MessageList"))),Ot=(0,g.A)((()=>document.querySelector(".MessageContextMenu .bubble"))),Bt=(0,g.A)((()=>{const e=Nt&&document.querySelector(".AudioPlayer-content")?.offsetHeight||0,t=document.getElementById("MiddleColumn"),n=getComputedStyle(t),a=parseFloat(n.getPropertyValue("--middle-header-panes-height"))||0;return{extraPaddingX:10,extraTopPadding:document.querySelector(".MiddleHeader").offsetHeight,extraMarginTop:a+e,shouldAvoidNegativePosition:!bt,menuElMinWidth:ht&&Nt?19.25*w.$:void 0}}));(0,a.vJ)((()=>{r?setTimeout((()=>{Rt()}),200):wt()}),[r,Rt,wt]),(0,a.vJ)((()=>(0,R.M6)(lt.current,".ReactionPicker")),[r]);const Ft=(0,g.A)((e=>{Ze(e),St()}));return a.Ay.createElement(O.A,{ref:rt,isOpen:r,anchor:S,getTriggerElement:Lt,getRootElement:Dt,getMenuElement:Ot,getLayout:Bt,withMaxHeight:!0,className:(0,l.A)("MessageContextMenu","fluid",ht&&"with-reactions"),onClose:Fe,onCloseAnimationEnd:_e},ht&&a.Ay.createElement(z.A,{enabledReactions:v,topReactions:n,allAvailableReactions:t,defaultTagReactions:s,currentReactions:m.reactions?.results,reactionsLimit:E,onToggleReaction:Ge,onSendPaidReaction:Ve,onShowPaidReactionModal:We,isWithPaidReaction:C,isPrivate:A,isReady:It,canBuyPremium:j,isCurrentUserPremium:f,isInSavedMessages:Ee,canPlayAnimatedEmojis:Ce,onShowMore:Ft,onClose:Fe,className:(0,l.A)(Et&&"ReactionSelector-hidden")}),a.Ay.createElement("div",{ref:lt,className:(0,l.A)("MessageContextMenu_items scrollable-content custom-scroll",Et&&"MessageContextMenu_items-hidden"),dir:dt.isRtl?"rtl":void 0},Ct&&a.Ay.createElement(B.A,{icon:"gift",onClick:xt},m?.isOutgoing?dt("SendAnotherGift"):dt("Conversation.ContextMenuSendGiftTo",tt)),K&&a.Ay.createElement(B.A,{icon:"send-outline",onClick:Oe},dt("MessageScheduleSend")),U&&a.Ay.createElement(B.A,{icon:"schedule",onClick:Be},dt("MessageScheduleEditTime")),J&&a.Ay.createElement(B.A,{icon:"reply",onClick:Re},dt(q?"lng_context_quote_and_reply":"Reply")),!V&&Boolean(he?.messagesCount)&&a.Ay.createElement(B.A,{icon:"replies",onClick:we},dt("Conversation.ContextViewReplies",he.messagesCount,"i")),G&&a.Ay.createElement(B.A,{icon:"edit",onClick:Ne},dt("Edit")),ee&&a.Ay.createElement(B.A,{icon:"favorite",onClick:Pe},dt("AddToFavorites")),te&&a.Ay.createElement(B.A,{icon:"favorite",onClick:Le},dt("Stickers.RemoveFromFavorites")),le&&a.Ay.createElement(B.A,{icon:"language",onClick:Xe},dt("TranslateMessage")),de&&a.Ay.createElement(B.A,{icon:"language",onClick:Qe},dt("ShowOriginalButton")),me&&a.Ay.createElement(B.A,{icon:"web",onClick:et},dt("lng_settings_change_lang")),Tt.map((e=>a.Ay.createElement(B.A,{key:e.label,icon:e.icon,onClick:e.handler,withPreventDefaultOnMouseDown:!0},dt(e.label)))),W&&a.Ay.createElement(B.A,{icon:"pin",onClick:be},dt("DialogPin")),Y&&a.Ay.createElement(B.A,{icon:"unpin",onClick:Me},dt("DialogUnpin")),se&&a.Ay.createElement(B.A,{icon:"gifs",onClick:$e},dt("lng_context_save_gif")),ce&&a.Ay.createElement(B.A,{icon:"revote",onClick:ze},dt("lng_polls_retract")),re&&a.Ay.createElement(B.A,{icon:"stop",onClick:Je},dt("lng_polls_stop")),ie&&a.Ay.createElement(B.A,{icon:"download",onClick:je},dt(ue?"lng_context_cancel_download":"lng_media_download")),X&&a.Ay.createElement(B.A,{icon:"forward",onClick:ke},dt("Forward")),oe&&a.Ay.createElement(B.A,{icon:"select",onClick:De},dt("Common.Select")),Q&&a.Ay.createElement(B.A,{icon:"flag",onClick:Te},dt("lng_context_report_msg")),Z&&a.Ay.createElement(B.A,{destructive:!0,icon:"delete",onClick:xe},dt("Delete")),fe&&a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement(F.A,{size:"thick"}),!ve&&a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement(_.A,{inline:!0,className:"menu-loading-row"}),a.Ay.createElement(_.A,{inline:!0,className:"menu-loading-row"})),ve&&1===ve.length&&a.Ay.createElement(B.A,{withWrap:!0,onClick:Pt,className:"menu-custom-emoji-sets"},(0,N.A)(dt("MessageContainsEmojiPack",ve[0].title),["simple_markdown","emoji"])),ve&&ve.length>1&&a.Ay.createElement(B.A,{withWrap:!0,onClick:Pt,className:"menu-custom-emoji-sets"},(0,N.A)(dt("MessageContainsEmojiPacks",ve.length),["simple_markdown"]))),(Ae||pe)&&a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement(F.A,{size:fe?"thin":"thick"}),a.Ay.createElement(B.A,{icon:pe?"heart-outline":"group",onClick:pe?qe:He,disabled:!pe&&!Mt},a.Ay.createElement("span",{className:"MessageContextMenu--seen-by-label-wrapper"},a.Ay.createElement("span",{className:"MessageContextMenu--seen-by-label",dir:dt.isRtl?"rtl":void 0},pe&&m.reactors?.count?Ae&&Mt?dt("Chat.OutgoingContextMixedReactionCount",[m.reactors.count,Mt]):dt("Chat.ContextReactionCount",m.reactors.count,"i"):1===Mt&&ye?(0,N.A)((0,c.L8)(ye[0].id)?(0,c.Yg)(ye[0]):ye[0].title):Mt?dt("Conversation.ContextMenuSeen",Mt,"i"):dt("Conversation.ContextMenuNoViews"))),a.Ay.createElement(D.A,{className:"avatars",size:"micro",peers:ye}))),(Ie||Se||At)&&a.Ay.createElement(F.A,{size:fe?"thin":"thick"}),(Ie||Se)&&a.Ay.createElement(H,{canLoadReadDate:Ie,shouldRenderShowWhen:Se,message:m,closeContextMenu:Fe}),At&&a.Ay.createElement($,{message:m})))})),G=window.getSelection(),V=-1,W=(0,a.ph)((0,o.EK)(((e,{message:t,messageListType:n,detectedLanguage:a})=>{const{threadId:o}=(0,r.Xf0)(e)||{},{defaultTags:i,topReactions:l,availableReactions:d}=e.reactions,m=(0,r.yuw)(e),u=(0,r.hds)(e,t.chatId),h=u&&(0,c.L8)(u.id),A=h?void 0:(0,r.AWZ)(e,t.chatId),p=(0,r.mBe)(e,t.chatId),g=p&&(0,c.Yg)(p),{seenByExpiresAt:y,seenByMaxChatMembers:f,maxUniqueReactions:v,readDateExpiresAt:C}=e.appConfig||{},E=A?.reactionsLimit||v,{noOptions:S,canReplyGlobally:I,canPin:R,canUnpin:w,canDelete:N,canReport:b,canEdit:M,canFaveSticker:k,canUnfaveSticker:x,canCopy:P,canCopyLink:T,canSelect:L,canDownload:D,canSaveGif:O,canRevote:B,canClosePoll:F}=o&&(0,r.WAX)(e,t,o)||{},_=(0,r.R4s)(e,t),K=h?(0,r.K0y)(e,u.id):void 0,U=(0,c.Ie)(t),j=u&&(0,r.yps)(e,u.id),$=Boolean(j),z=(0,r.Jbz)(e,t),J=Boolean(h&&U&&!$&&!z&&C&&t.date>Date.now()/1e3-C&&!K?.isReadDateRestricted&&"scheduled"!==n),H=Boolean(J&&h&&(0,r.K0y)(e,u.id)?.isReadDateRestrictedByMe),q="pinned"===n,G="scheduled"===n,V=u&&(0,c.WX)(u),W=o&&(0,r.Vw0)(e,t.chatId,o),Y=Boolean(W&&!W?.isCommentsInfo&&W?.fromChannelId),Z=o?(0,r.S0q)(e,t.chatId,o):void 0,X=u&&!(0,c.Sq)(u,"sendPlain",A),Q=!(!u||!o)&&(0,c.__)(u,Z,Y,A)&&X,ee=(0,c.Nb)(t),te=(0,c.G5)(t),ne=Boolean(!ee&&u&&!z&&f&&y&&(0,c.YE)(u)&&U&&!G&&u.membersCount&&u.membersCount<=f&&t.date>Date.now()/1e3-y),ae=(0,c._P)(t),oe=!ee&&!V&&!G&&!ae&&!h&&t.reactions&&!(0,c.G)(t.reactions)&&t.reactions.canSeeList,ie=(0,r.ynf)(e,t),se=Boolean(t.content.contact),ce=(0,r.g29)(e),re=(0,r.S1W)(e,t),le=re?.map((t=>(0,r.ycM)(e,t))),de=le?.every(Boolean)?le:void 0,me=(0,r.Rny)(e,t.chatId,t.id),ue=me?Boolean((0,r.a_$)(e,t.chatId,me)[t.id]?.text):void 0,he=!ue&&(0,r.S86)(e,t,a),Ae=(0,r.qZq)(e,t.chatId),pe=(0,r.nZ4)(e,t.chatId),ge=(0,r.zcZ)(e,t),ye=t.content.storyData,fe=ye?(0,r.Msb)(e,ye.peerId,ye.id):void 0,ve=(0,r.X2D)(e,t.chatId);return{threadId:o,chat:u,availableReactions:d,topReactions:l,defaultTagReactions:i,noOptions:S,canReport:b,canSendNow:G,canReschedule:G,canReply:!q&&!G&&I,canPin:!G&&R,canUnpin:!G&&w,canDelete:N,canEdit:!q&&M,canForward:!G&&_,canFaveSticker:!G&&k,canUnfaveSticker:!G&&x,canCopy:se||!ie&&P,canCopyLink:!G&&T,canSelect:L,canDownload:!ie&&D,canSaveGif:!ie&&O,canRevote:B,canClosePoll:!G&&F,activeDownloads:m,canShowSeenBy:ne,canLoadReadDate:J,shouldRenderShowWhen:H,enabledReactions:u?.isForbidden?void 0:A?.enabledReactions,reactionsLimit:E,isPrivate:h,isCurrentUserPremium:ce,hasFullInfo:Boolean(A),canShowReactionsCount:oe,canShowReactionList:!(ee||ae||G||u?.id===s.zv8||te),canBuyPremium:!ce&&!(0,r.n_C)(e),customEmojiSetsInfo:re,customEmojiSets:de,canScheduleUntilOnline:(0,r.RBq)(e,t.chatId),canTranslate:he,canShowOriginal:ue&&!Ae,canSelectLanguage:ue&&!Ae,isMessageTranslated:ue,canPlayAnimatedEmojis:(0,r.BWX)(e),isReactionPickerOpen:(0,r.Ani)(e),isInSavedMessages:pe,isChannel:V,canReplyInChat:Q,isWithPaidReaction:A?.isPaidReactionAvailable,poll:ge,story:fe,userFullName:g,canGift:ve}}))((({threadId:e,availableReactions:t,topReactions:n,defaultTagReactions:r,isOpen:m,messageListType:u,message:h,customEmojiSetsInfo:C,customEmojiSets:E,album:R,poll:w,story:N,anchor:b,targetHref:M,noOptions:k,canSendNow:x,hasFullInfo:P,canReschedule:T,canReply:L,canPin:D,repliesThreadInfo:O,canUnpin:B,canDelete:F,canShowReactionsCount:_,chat:K,canReport:U,canShowReactionList:j,canEdit:$,enabledReactions:z,reactionsLimit:J,isPrivate:H,isCurrentUserPremium:W,canForward:Y,canBuyPremium:Z,canFaveSticker:X,canUnfaveSticker:Q,canCopy:ee,canCopyLink:te,canSelect:ne,canDownload:ae,canSaveGif:oe,canRevote:ie,canClosePoll:se,canPlayAnimatedEmojis:ce,canLoadReadDate:re,shouldRenderShowWhen:le,activeDownloads:de,noReplies:me,canShowSeenBy:ue,canScheduleUntilOnline:he,canTranslate:Ae,isMessageTranslated:pe,canShowOriginal:ge,canSelectLanguage:ye,isReactionPickerOpen:fe,isInSavedMessages:ve,canReplyInChat:Ce,isWithPaidReaction:Ee,userFullName:Se,canGift:Ie,className:Re,onClose:we,onCloseAnimationEnd:Ne})=>{const{openThread:be,updateDraftReplyInfo:Me,setEditingId:ke,pinMessage:xe,openForwardMenu:Pe,openReplyMenu:Te,faveSticker:Le,unfaveSticker:De,toggleMessageSelection:Oe,sendScheduledMessages:Be,rescheduleMessage:Fe,downloadMedia:_e,cancelMediaDownload:Ke,loadSeenBy:Ue,openSeenByModal:je,openReactorListModal:$e,loadFullChat:ze,loadReactors:Je,copyMessagesByIds:He,saveGif:qe,loadStickers:Ge,cancelPollVote:Ve,closePoll:We,toggleReaction:Ye,requestMessageTranslation:Ze,showOriginalMessage:Xe,openChatLanguageModal:Qe,openMessageReactionPicker:et,openPremiumModal:tt,loadOutboxReadDate:nt,copyMessageLink:at,openDeleteMessageModal:ot,addLocalPaidReaction:it,openPaidReactionModal:st,reportMessages:ct}=(0,o.ko)(),rt=(0,y.A)(),{ref:lt}=(0,v.A)({isOpen:m,onCloseAnimationEnd:Ne,className:!1}),[dt,mt]=(0,a.J0)(!0),[ut,ht]=(0,a.J0)(!1),[At,pt,gt]=(0,p.A)(),[yt,ft]=(0,a.J0)(V),[vt,Ct]=(0,f.A)(he,we,h.date),Et=void 0===C||Boolean(C.length);(0,a.vJ)((()=>{ue&&m&&Ue({chatId:h.chatId,messageId:h.id})}),[Ue,m,h.chatId,h.id,ue]),(0,a.vJ)((()=>{re&&m&&nt({chatId:h.chatId,messageId:h.id})}),[re,m,h.chatId,h.id,h.readDate]),(0,a.vJ)((()=>{_&&m&&Je({chatId:h.chatId,messageId:h.id})}),[_,m,Je,h.chatId,h.id]),(0,a.vJ)((()=>{C?.length&&E?.length!==C.length&&C.forEach((e=>{Ge({stickerSetInfo:e})}))}),[C,E,Ge]),(0,a.vJ)((()=>{P||H||!m||ze({chatId:h.chatId})}),[P,m,H,ze,h.chatId]);const St=(0,a.Kr)((()=>{const e=(0,o.mS)().chats.byId,t=(0,o.mS)().users.byId;if(h.reactions?.recentReactions?.length){const n=new Set(h.reactions?.recentReactions?.map((({peerId:n})=>t[n]||e[n])));return Array.from(n).filter(Boolean).slice(0,s.dqH)}if(h.seenByDates)return Object.keys(h.seenByDates).slice(0,s.dqH).map((n=>t[n]||e[n])).filter(Boolean)}),[h.reactions?.recentReactions,h.seenByDates]),It=(0,a.Kr)((()=>{if(R)return R.messages.some((e=>{const t=(0,c.ed)(e);return!!t&&(0,c.$r)(de,t)}));const e=(0,c.ed)(h);return!!e&&(0,c.$r)(de,e)}),[de,R,h]),Rt=L&&G?.rangeCount?G.getRangeAt(0):void 0;(0,a.vJ)((()=>{if(pe)return void ft(V);if(!Rt||Rt.collapsed||!Boolean(h.content.text?.text)||!function(e){const t=e.commonAncestorContainer,n=t.nodeType===Node.TEXT_NODE?t.parentNode:t;return Boolean(n.closest(".message-content-wrapper .text-content"))&&!(Boolean(n.closest(".EmbeddedMessage"))||Boolean(n.closest(".WebPage")))}(Rt))return void ft(V);const e=A(Rt),t=h.content.text.text.replace(/\u00A0/g," ");e.text.trim().length>0&&t.includes(e.text)?ft(Rt.startOffset):ft(V)}),[Rt,Rt?.collapsed,Rt?.startOffset,Rt?.endOffset,pe,h.content.text]);const wt=(0,g.A)((()=>{mt(!1),we()})),Nt=(0,g.A)((()=>{mt(!1),wt();const e=R?.messages?R.messages.map((({id:e})=>e)):[h.id];ot({chatId:h.chatId,messageIds:e,isSchedule:"scheduled"===u})})),bt=(0,g.A)((()=>{ht(!1),we()})),Mt=(0,g.A)((()=>{const e=yt!==V&&Rt?A(Rt):void 0;Ce?Me({replyToMsgId:h.id,quoteText:e,quoteOffset:yt,replyToPeerId:void 0}):Te({fromChatId:h.chatId,messageId:h.id,quoteText:e,quoteOffset:yt}),wt()})),kt=(0,g.A)((()=>{be({chatId:h.chatId,threadId:h.id}),wt()})),xt=(0,g.A)((()=>{ke({messageId:h.id}),wt()})),Pt=(0,g.A)((()=>{mt(!1),ht(!0)})),Tt=(0,g.A)((()=>{xe({chatId:h.chatId,messageId:h.id,isUnpin:!0}),wt()})),Lt=(0,g.A)((()=>{if(wt(),R?.messages){const e=R.messages.map((({id:e})=>e));Pe({fromChatId:h.chatId,messageIds:e})}else Pe({fromChatId:h.chatId,messageIds:[h.id]})})),Dt=(0,g.A)((()=>{wt(),Le({sticker:h.content.sticker})})),Ot=(0,g.A)((()=>{wt(),De({sticker:h.content.sticker})})),Bt=(0,g.A)((()=>{wt(),Ve({chatId:h.chatId,messageId:h.id})})),Ft=(0,g.A)((()=>{wt(),We({chatId:h.chatId,messageId:h.id})})),_t=(0,g.A)((()=>{const e=R?.messages?{messageId:h.id,childMessageIds:R.messages.map((({id:e})=>e)),withShift:!1}:{messageId:h.id,withShift:!1};Oe(e),wt()})),Kt=(0,g.A)((()=>{Be({chatId:h.chatId,id:h.id}),wt()})),Ut=(0,g.A)((e=>{Fe({chatId:h.chatId,messageId:h.id,scheduledAt:e}),we()})),jt=(0,g.A)((()=>{mt(!1),vt(Ut)})),$t=(0,g.A)((()=>{wt(),je({chatId:h.chatId,messageId:h.id})})),zt=(0,g.A)((()=>{wt(),$e({chatId:h.chatId,messageId:h.id})})),Jt=(0,g.A)((e=>{He({messageIds:e}),wt()})),Ht=(0,g.A)((()=>{at({chatId:h.chatId,messageId:h.id,shouldIncludeThread:e!==i.l3,shouldIncludeGrouped:!0}),wt()})),qt=(0,g.A)((()=>{(0,d.eM)(h.content.contact.phoneNumber),wt()})),Gt=(0,g.A)((()=>{(R?.messages||[h]).forEach((e=>{const t=(0,c.ed)(e);t&&(It?Ke({media:t}):_e({media:t,originMessage:e}))})),wt()})),Vt=(0,g.A)((()=>{const e=(0,c.zX)(h);qe({gif:e}),wt()})),Wt=(0,g.A)((e=>{ve&&!W?tt({initialSection:"saved_tags"}):Ye({chatId:h.chatId,messageId:h.id,reaction:e,shouldAddToRecent:!0}),wt()})),Yt=(0,g.A)((()=>{it({chatId:h.chatId,messageId:h.id,count:1}),wt()})),Zt=(0,g.A)((()=>{st({chatId:h.chatId,messageId:h.id}),wt()})),Xt=(0,g.A)((e=>{et({chatId:h.chatId,messageId:h.id,position:e})})),Qt=(0,g.A)((()=>{Ze({chatId:h.chatId,id:h.id}),wt()})),en=(0,g.A)((()=>{Xe({chatId:h.chatId,id:h.id}),wt()})),tn=(0,g.A)((()=>{Qe({chatId:h.chatId,messageId:h.id}),wt()})),nn=(0,a.Kr)((()=>(R?R.messages:[h]).map((({id:e})=>e))),[R,h]),an=(0,g.A)((()=>{K&&(mt(!1),we(),ct({chatId:K.id,messageIds:nn}))}));if(k)return void wt();const on=new Date;return on.setFullYear(on.getFullYear()+1),a.Ay.createElement("div",{ref:lt,className:(0,l.A)("ContextMenuContainer",Re)},a.Ay.createElement(q,{isReactionPickerOpen:fe,availableReactions:t,topReactions:n,defaultTagReactions:r,isWithPaidReaction:Ee,message:h,isPrivate:H,isCurrentUserPremium:W,canBuyPremium:Z,isOpen:dt,enabledReactions:z,reactionsLimit:J,anchor:b,targetHref:M,canShowReactionsCount:_,canShowReactionList:j,canSendNow:x,canReschedule:T,canReply:L,canQuote:yt!==V,canDelete:F,canPin:D,canReport:U,repliesThreadInfo:O,canUnpin:B,canEdit:$,canForward:Y,canFaveSticker:X,canUnfaveSticker:Q,canCopy:ee,canCopyLink:te,canSelect:ne,canDownload:ae,canSaveGif:oe,canRevote:ie,canClosePoll:se,canShowSeenBy:ue,canTranslate:Ae,canShowOriginal:ge,canSelectLanguage:ye,canPlayAnimatedEmojis:ce,shouldRenderShowWhen:le,canLoadReadDate:re,hasCustomEmoji:Et,customEmojiSets:E,isDownloading:It,seenByRecentPeers:St,isInSavedMessages:ve,noReplies:me,poll:w,story:N,onOpenThread:kt,onReply:Mt,onEdit:xt,onPin:Pt,onUnpin:Tt,onForward:Lt,onDelete:Nt,onReport:an,onFaveSticker:Dt,onUnfaveSticker:Ot,onSelect:_t,onSend:Kt,onReschedule:jt,onClose:wt,onCopyLink:Ht,onCopyMessages:Jt,onCopyNumber:qt,onDownload:Gt,onSaveGif:Vt,onCancelVote:Bt,onClosePoll:pt,onShowSeenBy:$t,onToggleReaction:Wt,onSendPaidReaction:Yt,onShowPaidReactionModal:Zt,onShowReactors:zt,onReactionPickerOpen:Xt,onTranslate:Qt,onShowOriginal:en,onSelectLanguage:tn,userFullName:Se,canGift:Ie}),a.Ay.createElement(S,{isOpen:ut,messageId:h.id,chatId:h.chatId,onClose:bt}),a.Ay.createElement(I.A,{isOpen:At,onClose:gt,text:rt("lng_polls_stop_warning"),confirmLabel:rt("lng_polls_stop_sure"),confirmHandler:Ft}),T&&Ct)})))},79519:(e,t,n)=>{n.d(t,{A:()=>m});var a=n(84051),o=n(61433),i=n(31481),s=n(66644),c=n(81954);const r=500,l=i.nxZ,d=20;function m({elementRef:e,chatId:t,isFocused:n,focusDirection:i,noFocusHighlight:m,isResizingContainer:u,isJustAdded:h,isQuote:A,scrollTargetPosition:p}){const g=(0,a.li)(!h);(0,a.Nf)((()=>{const t=g.current;if(g.current=!1,n&&e.current){const n=e.current.closest(".MessageList"),a=m,h=p||a?"end":"centerOrTop",g=()=>{const t=void 0!==i?a?r:l:void 0,m=(0,c.Ay)({container:n,element:e.current,position:h,margin:d,maxDistance:t,forceDirection:i,forceNormalContainerHeight:u,shouldReturnMutationFn:!0});if(A){const t=e.current.querySelector(".is-quote");t&&(0,s.RK)((()=>{(0,o.YM)(t,"animate")}))}return m};t?(0,s.gm)(g):(0,s.YS)((()=>{(0,s.RK)(g())}))}}),[e,t,n,i,m,u,A,p])}},76283:(e,t,n)=>{n.d(t,{A:()=>M});var a=n(84051),o=n(13439),i=n(90709),s=n(87357),c=n(17712),r=n(59030),l=n(18276),d=n(64493),m=n(96530),u=n(78376),h=n(76023),A=n(10722),p=n(4438),g=n(87412);const y="uGUjDZKl",f="M62HGuIV",v="WMpEr5XQ",C=2*h.$,E=(0,a.ph)((({reaction:e,chosen:t,isReady:n,noAppearAnimation:o,style:i,isLocked:r,onToggleReaction:d,onSendPaidReaction:m,onShowPaidReactionModal:h})=>{const E=(0,a.li)(null),S=(0,c.A)((()=>{"paid"!==e.type?d(e):m?.()})),{isContextMenuOpen:I,handleBeforeContextMenu:R,handleContextMenu:w,handleContextMenuClose:N,handleContextMenuHide:b}=(0,A.A)(E,"paid"!==e.type,void 0,void 0,void 0,!0);return(0,a.vJ)((()=>{I&&(h?.(),N(),b())}),[N,h,b,I]),a.Ay.createElement("div",{className:(0,s.A)(y,"oc1hpMwv",t&&"paid"!==e.type&&f,!o&&n&&"sx6RTuAU",o&&"kqcWe4tf"),ref:E,style:i,onClick:S,onMouseDown:R,onContextMenu:w},"paid"===e.type?a.Ay.createElement(p.A,{tgsUrl:u.w.StarReaction,size:C,noLoop:!1}):a.Ay.createElement(g.A,{documentId:e.documentId,size:C}),r&&a.Ay.createElement(l.A,{className:v,name:"lock-badge"}))}));var S=n(37661),I=n(62587),R=n(18104);const w=2*h.$,N=(0,a.ph)((({reaction:e,isReady:t,noAppearAnimation:n,chosen:o,isLocked:i,onToggleReaction:c})=>{const r=(0,I.A)(`sticker${e.appearAnimation?.id}`,!t||n),d=(0,I.A)(`document${e.selectAnimation?.id}`,!t||n),m=(0,I.A)(`document${e.staticIcon?.id}`,!n),[u,h]=(0,S.A)(),[A,,p]=(0,S.A)(!0),[g,C,E]=(0,S.A)();return a.Ay.createElement("div",{className:(0,s.A)(y,o&&f),onClick:function(){c(e.reaction)},onMouseEnter:t&&!A?C:void 0},n&&a.Ay.createElement("img",{className:"MZ2tH980",src:m,alt:e.reaction.emoticon,draggable:!1}),!u&&!n&&a.Ay.createElement(R.A,{key:e.appearAnimation?.id,tgsUrl:r,play:A,noLoop:!0,size:w,onEnded:p,forceAlways:!0}),!A&&!n&&a.Ay.createElement(R.A,{key:e.selectAnimation?.id,tgsUrl:d,play:g,noLoop:!0,size:w,onLoad:h,onEnded:E,forceAlways:!0}),i&&a.Ay.createElement(l.A,{className:v,name:"lock-badge"}))})),b=(0,s.x)("ReactionSelector"),M=(0,a.ph)((({allAvailableReactions:e,topReactions:t,defaultTagReactions:n,enabledReactions:u,currentReactions:h,reactionsLimit:A,isPrivate:p,isReady:g,canPlayAnimatedEmojis:y,className:f,isCurrentUserPremium:v,isInSavedMessages:C,isInStoryViewer:S,isForEffects:I,effectReactions:R,isWithPaidReaction:w,onClose:M,onToggleReaction:k,onSendPaidReaction:x,onShowPaidReactionModal:P,onShowMore:T})=>{const{openPremiumModal:L}=(0,o.ko)(),D=(0,a.li)(null),O=(0,r.A)(),B=C&&!v&&!S,F=Boolean(A&&h&&h.length>=A),_=(0,a.Kr)((()=>{const a=F?h?.map((e=>e.reaction)):I?R:C?n:"some"===u?.type?u.allowed:e?.map((e=>e.reaction)),o=a?.map((t=>{const n="custom"===t.type,a=e?.find((e=>(0,i.a0)(e.reaction,t)));return I?a:(n||a)&&!a?.isInactive&&(p||F||u&&(0,i.A3)(t,u))?n?t:a:void 0})).filter(Boolean)||[],s=(0,i.fu)(o,t);return w&&s.unshift({type:"paid"}),s}),[e,h,n,u,C,p,t,I,R,F,w]),K=(0,a.Kr)((()=>8===_.length?_:_.slice(0,7)),[_]),U=K.length<_.length,j=(0,a.Kr)((()=>{const e=h?.filter((({chosenOrder:e})=>void 0!==e))||[];return new Set(e.map((({reaction:e})=>K.findIndex((t=>t&&(0,i.a0)("reaction"in t?t.reaction:t,e))))))}),[h,K]),$=(0,c.A)((()=>{const e=D.current?.getBoundingClientRect()||{x:0,y:0};T({x:e.x,y:e.y})})),z=(0,c.A)((()=>{M?.(),L({initialSection:"saved_tags"})})),J=(0,a.Kr)((()=>{if(C){if(!v){const e=O("lng_subscribe_tag_about").split("{link}");return a.Ay.createElement("span",null,e[0],a.Ay.createElement(m.A,{isPrimary:!0,onClick:z},O("lng_subscribe_tag_link")),e[1])}return O("SavedTagReactionsHint2")}return S?O("StoryReactionsHint"):I?O("AddEffectMessageHint"):void 0}),[v,C,S,O,I]);if(K.length)return a.Ay.createElement("div",{className:(0,s.A)(b("&"),f),ref:D},a.Ay.createElement("div",{className:b("bubble-small",O.isRtl&&"isRtl")}),a.Ay.createElement("div",{className:b("items-wrapper")},a.Ay.createElement("div",{className:b("bubble-big",O.isRtl&&"isRtl")}),a.Ay.createElement("div",{className:b("items")},J&&a.Ay.createElement("div",{className:b("hint")},J),a.Ay.createElement("div",{className:b("reactions"),dir:O.isRtl?"rtl":void 0},K.map(((e,t)=>"reaction"in e?a.Ay.createElement(N,{key:(0,i.Jj)(e.reaction),isReady:g,onToggleReaction:k,reaction:e,noAppearAnimation:!y,chosen:j.has(t),isLocked:B}):a.Ay.createElement(E,{key:(0,i.Jj)(e),isReady:g,onToggleReaction:k,onSendPaidReaction:x,onShowPaidReactionModal:P,reaction:e,noAppearAnimation:!y,chosen:j.has(t),isLocked:B,style:`--_animation-delay: ${20*(7-t)}ms`}))),U&&a.Ay.createElement(d.A,{color:"translucent",className:b("show-more"),onClick:$},a.Ay.createElement(l.A,{name:"down"}))))))}))},43581:(e,t,n)=>{n.d(t,{A:()=>j});var a=n(84051),o=n(13439),i=n(90709),s=n(29807),c=n(87357),r=n(60343),l=n(15283),d=n(17712),m=n(59030),u=n(14242),h=n(76023),A=n(63527),p=n(10722),g=n(82117),y=n(39351),f=n(29886),v=n(21511),C=n(68292),E=n(26875),S=n(96454),I=n(78376),R=n(5912),w=n(4438),N=n(9267),b=n(93879);const M=1.5*h.$,k=6.5*h.$,x=S.pz||S.Ni?2:5,P=S.pz||S.Ni?2:3,T=(0,a.ph)((0,o.EK)(((e,{containerId:t})=>{const{activeReactions:n}=(0,s.nTw)(e),a=(0,s.xYJ)(e,"reactionEffects");return{activeReactions:n?.[t],withEffects:a}}))((({containerId:e,reaction:t,className:n,size:s=M,effectSize:r=k,activeReactions:l,localAmount:m,withEffects:u,observeIntersection:h})=>{const{stopActiveReaction:A}=(0,o.ko)(),p=(0,a.li)(null),y=(0,a.li)(null),[f,C]=(0,a.J0)([]),E=(0,R.Vz)(p,h),S=(0,a.Kr)((()=>l?.find((e=>(0,i.a0)(e,t)))),[l,t]),T=Boolean(u&&S),L=f.length<x;(0,g.A)((([e])=>{T?!m||m<=(e||0)||L&&C((e=>[...e,Date.now()])):C([])}),[m,L,T]);const{shouldRender:D}=(0,v.A)({ref:y,noMountTransition:!0,isOpen:T,className:"slow",withShouldRender:!0}),O=(0,d.A)((()=>{const n=f.slice(1);C(n),n.length||A({containerId:e,reaction:t})})),B=(0,c.A)(b.A.root,D&&b.A.animating,n);return a.Ay.createElement("div",{className:B,ref:p,teactFastList:!0},a.Ay.createElement(N.A,{key:"icon",type:"gold",size:"adaptive",style:`width: ${s}px; height: ${s}px`}),D&&f.map((e=>a.Ay.createElement(w.A,{key:e,ref:y,className:b.A.effect,size:r,tgsUrl:I.w.StarReactionEffect,play:E,noLoop:!0,forceAlways:!0,nonInteractive:!0,quality:P,onEnded:O}))))})));var L=n(11241),D=n(85118),O=n(64493),B=n(69988);const F=1.25*h.$;function _(e){return e.stars}const K=(0,a.ph)((({reaction:e,containerId:t,isOwnMessage:n,recentReactors:s,className:r,chosenClassName:l,chatId:m,messageId:h,isOutside:S,observeIntersection:I,onClick:R,onPaidClick:w})=>{const{openStarsBalanceModal:N,resetLocalPaidReactions:b,openPaidReactionModal:M,requestWave:k}=(0,o.ko)(),x=(0,a.li)(null),P=(0,a.li)(null),K=(0,a.li)(),U=(0,y.A)(),j="paid"===e.reaction.type,$=(0,A.A)(_),z=Boolean($),J=(0,d.A)(((e=1)=>{w?.(e)})),H=(0,d.A)((t=>{if("paid"===e.reaction.type)return t.stopPropagation(),void J();R?.(e.reaction)})),{isContextMenuOpen:q,handleBeforeContextMenu:G,handleContextMenu:V,handleContextMenuClose:W,handleContextMenuHide:Y}=(0,p.A)(x,"paid"!==e.reaction.type,void 0,void 0,void 0,!0);(0,a.vJ)((()=>{q&&(M({chatId:m,messageId:h}),W(),Y())}),[W,Y,q,m,h]),(0,g.A)((([t])=>{const n=e.localAmount,a=x.current;if(!n||!a||n===t?.localAmount)return;if(z&&n>$.balance.amount)return N({originReaction:{chatId:m,messageId:h,amount:n}}),void b({chatId:m,messageId:h});if(e.localAmount){const{left:e,top:t}=a.getBoundingClientRect(),n=e+a.offsetWidth/2,o=t+a.offsetHeight/2;k({startX:n,startY:o})}const o=Number(getComputedStyle(a).scale)||1;K.current?.cancel(),K.current=a.animate([{scale:o},{scale:Math.min(1.2*o,3),offset:.2},{scale:1}],{duration:500*o,easing:"ease-out"})}),[e,$?.balance,z,m,h]);const Z=(0,f.A)(e.localAmount),{shouldRender:X}=(0,v.A)({isOpen:Boolean(e.localAmount),ref:P,className:"slow",withShouldRender:!0});return a.Ay.createElement(O.A,{className:(0,c.A)(B.A.root,n&&B.A.own,j&&B.A.paid,S&&B.A.outside,(0,i.eu)(e)&&B.A.chosen,(0,i.eu)(e)&&l,r),size:"tiny",ref:x,onMouseDown:G,onContextMenu:V,onClick:H},"paid"===e.reaction.type?a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement(D.A,{preset:"button"}),a.Ay.createElement(T,{className:B.A.animatedEmoji,containerId:t,reaction:e.reaction,size:F,localAmount:e.localAmount,observeIntersection:I}),X&&a.Ay.createElement(C.A,{ref:P,text:`+${(0,u.Vw)(U,e.localAmount||Z)}`,className:B.A.paidCounter})):a.Ay.createElement(L.A,{className:B.A.animatedEmoji,containerId:t,reaction:e.reaction,size:F,observeIntersection:I}),s?.length?a.Ay.createElement(E.A,{size:"mini",peers:s}):a.Ay.createElement(C.A,{text:(0,u.Vw)(U,e.count+(e.localAmount||0)),className:B.A.counter}))}));var U=n(92915);const j=(0,a.ph)((({message:e,threadId:t,isOutside:n,maxWidth:u,metaChildren:h,observeIntersection:A,noRecentReactors:p,isCurrentUserPremium:g,tags:y,isAccountFrozen:f})=>{const{toggleReaction:v,addLocalPaidReaction:C,updateMiddleSearch:E,performMiddleSearch:S,openPremiumModal:I,resetLocalPaidReactions:R,showNotification:w,openFrozenAccountModal:N}=(0,o.ko)(),b=(0,m.A)(),{results:M,areTags:k,recentReactions:x}=e.reactions,P=Boolean(e.areReactionsPossible&&e.reactions),T=(0,a.Kr)((()=>M.reduce(((e,t)=>e+t.count),0)),[M]),L=(0,a.Kr)((()=>{const e=(0,o.mS)();return x?.reduce(((t,n)=>{const{reaction:a,peerId:o}=n,c=(0,i.Jj)(a),r=(0,s.PVB)(e,o);if(!r)return t;const l=t[c]||[];return l.push(r),t[c]=l,t}),{})}),[x]),D=(0,a.Kr)((()=>{const t=(0,r.bj)(e);return M.map((e=>{const n=(0,i.Jj)(e.reaction),a=L?.[n],o=T>3||p,s=k?y?.[n]:void 0;return{reaction:e,reactionKey:n,messageKey:t,recentReactors:o?void 0:a,isChosen:(0,i.eu)(e),tag:s}}))}),[e,p,L,M,k,y,T]),O=(0,d.A)((n=>{if(!f)return k?g?(E({chatId:e.chatId,threadId:t,update:{savedTag:n}}),void S({chatId:e.chatId,threadId:t})):void I({initialSection:"saved_tags"}):void v({chatId:e.chatId,messageId:e.id,reaction:n});N()})),B=(0,a.Kr)((()=>M.find((e=>"paid"===e.reaction.type))?.localAmount||0),[M]),F=(0,d.A)((t=>{f?N():C({chatId:e.chatId,messageId:e.id,count:t})}));(0,a.vJ)((()=>{B&&w({localId:(0,r.bj)(e),title:b("StarsSentTitle"),message:b("StarsSentText",B),actionText:b("StarsSentUndo"),cacheBreaker:B.toString(),action:{action:"resetLocalPaidReactions",payload:{chatId:e.chatId,messageId:e.id}},dismissAction:{action:"sendPaidReaction",payload:{chatId:e.chatId,messageId:e.id}},duration:5e3,shouldShowTimer:!0,disableClickDismiss:!0,icon:"star"})}),[b,e,B]);const _=(0,d.A)((t=>{f?N():v({chatId:e.chatId,messageId:e.id,reaction:t})}));return(0,l.A)((()=>()=>{R({chatId:e.chatId,messageId:e.id})})),a.Ay.createElement("div",{className:(0,c.A)("Reactions",n&&"is-outside",P&&"is-service"),style:u?`max-width: ${u}px`:void 0,dir:b.isRtl?"rtl":"ltr"},D.map((({reaction:t,recentReactors:o,messageKey:i,reactionKey:s,isChosen:c,tag:r})=>k?a.Ay.createElement(U.A,{key:s,className:"message-reaction",chosenClassName:"chosen",containerId:i,isOwnMessage:e.isOutgoing,isChosen:c,reaction:t.reaction,tag:r,withContextMenu:g,onClick:O,onRemove:_,observeIntersection:A}):a.Ay.createElement(K,{key:s,chatId:e.chatId,messageId:e.id,className:"message-reaction",chosenClassName:"chosen",containerId:i,isOwnMessage:e.isOutgoing,recentReactors:o,isOutside:n,reaction:t,onClick:O,onPaidClick:F,observeIntersection:A}))),h)}))},92915:(e,t,n)=>{n.d(t,{A:()=>C});var a=n(84051),o=n(13439),i=n(87357),s=n(76023),c=n(10722),r=n(37661),l=n(17712),d=n(59030),m=n(11241),u=n(64493),h=n(40664),A=n(22337);const p=(0,a.ph)((({isOpen:e,title:t,subtitle:n,placeholder:o,submitText:i,maxLength:s,initialValue:c="",onClose:r,onSubmit:m})=>{const p=(0,d.A)(),[g,y]=(0,a.J0)(c),f=(0,l.A)((e=>{y(e.target.value)})),v=(0,l.A)((()=>{m(g)}));return a.Ay.createElement(A.A,{className:"narrow",title:t,isOpen:e,onClose:r,isSlim:!0},Boolean(n)&&a.Ay.createElement("div",{className:"cGrbcqD_"},n),a.Ay.createElement(h.A,{placeholder:o,value:g,onChange:f,maxLength:s,teactExperimentControlled:!0}),a.Ay.createElement("div",{className:"dialog-buttons mt-2"},a.Ay.createElement(u.A,{className:"confirm-dialog-button",onClick:v},i||p("Save")),a.Ay.createElement(u.A,{className:"confirm-dialog-button",isText:!0,onClick:r},p("Cancel"))))}));var g=n(71429),y=n(24433),f=n(69988);const v=1.25*s.$,C=(0,a.ph)((({reaction:e,tag:t,containerId:n,isChosen:s,isOwnMessage:h,className:A,chosenClassName:C,withCount:E,isDisabled:S,withContextMenu:I,observeIntersection:R,onClick:w,onRemove:N})=>{const{editSavedReactionTag:b}=(0,o.ko)(),M=(0,a.li)(null),k=(0,a.li)(null),x=(0,d.A)(),[P,T,L]=(0,r.A)(),{title:D,count:O}=t||{},B=Boolean(D||E&&O),F=(0,l.A)((()=>{w?.(e)})),_=(0,l.A)((()=>{N?.(e)})),K=(0,l.A)((t=>{b({reaction:e,title:t}),L()})),{isContextMenuOpen:U,contextMenuAnchor:j,handleBeforeContextMenu:$,handleContextMenu:z,handleContextMenuClose:J,handleContextMenuHide:H}=(0,c.A)(M,!I,void 0,void 0,void 0,!0),q=(0,l.A)((()=>M.current)),G=(0,l.A)((()=>document.body)),V=(0,l.A)((()=>k.current)),W=(0,l.A)((()=>({withPortal:!0,shouldAvoidNegativePosition:!0})));if(!E||0!==O)return a.Ay.createElement(u.A,{className:(0,i.A)(f.A.root,f.A.tag,h&&f.A.own,s&&f.A.chosen,s&&C,S&&f.A.disabled,A),size:"tiny",onClick:F,onMouseDown:$,onContextMenu:z,ref:M},a.Ay.createElement(m.A,{className:f.A.animatedEmoji,containerId:n,reaction:e,loopLimit:1,size:v,observeIntersection:R}),B&&a.Ay.createElement("span",{className:f.A.tagText},D&&a.Ay.createElement("span",null,D),E&&a.Ay.createElement("span",null,O)),a.Ay.createElement("svg",{className:f.A.tail,width:"15",height:"30",viewBox:"0 0 15 30"},a.Ay.createElement("path",{className:f.A.tailFill,d:"m 0,30 c 3.1855,0 6.1803,-1.5176 8.0641,-4.0864 l 5.835,-7.9568 c 1.2906,-1.7599 1.2906,-4.1537 0,-5.9136 L 8.0641,4.08636 C 6.1803,1.51761 3.1855,0 0,0"})),I&&a.Ay.createElement(p,{isOpen:P,maxLength:15,title:x(t?.title?"SavedTagRenameTag":"SavedTagLabelTag"),subtitle:x("SavedTagLabelTagText"),placeholder:x("SavedTagLabelPlaceholder"),initialValue:t?.title,onClose:L,onSubmit:K}),I&&j&&a.Ay.createElement(g.A,{ref:k,isOpen:U,anchor:j,getTriggerElement:q,getRootElement:G,getMenuElement:V,getLayout:W,autoClose:!0,withPortal:!0,onClose:J,onCloseAnimationEnd:H},a.Ay.createElement(y.A,{icon:"tag-filter",onClick:F},x("SavedTagFilterByTag")),a.Ay.createElement(y.A,{icon:"tag-name",onClick:T},x(t?.title?"SavedTagRenameTag":"SavedTagLabelTag")),a.Ay.createElement(y.A,{icon:"tag-crossed",destructive:!0,onClick:_},x("SavedTagRemoveTag"))))}))},14737:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(84051),o=n(17712);const i=function(e,t){const n=(0,o.A)(e);(0,a.vJ)((()=>{if("number"!=typeof t)return;const e=setTimeout((()=>n()),t);return()=>clearTimeout(e)}),[t])}},45470:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(84051),o=n(32610),i=n(66644),s=n(96454),c=n(35297);const r=2,l=2;function d(e,t=!1,n,d=r,m,u){const h=(0,a.li)(null),A=(0,a.li)();return(0,c.A)((()=>{t||(A.current=!1)}),[e,t]),(0,a.vJ)((()=>{const a=h.current;if(!e||!a||t||A.current)return;A.current=!0;const c=new Image,r=()=>{const e=m||c.width,t=u||c.height,n=a.getContext("2d",{alpha:!1});(0,i.RK)((()=>{a.width=e,a.height=t,s.QH&&(n.filter=`blur(${d}px)`),n.drawImage(c,2*-d,2*-d,e+4*d,t+4*d),s.QH||(0,o.A)(n,0,0,e,t,d,l)}))};c.onload=()=>{n?(0,i.YS)(r):r()},c.src=e}),[e,t,u,m,d,n]),h}},65632:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(84051),o=n(13439),i=n(31481),s=n(74824),c=n(87679);const r=(e,t)=>{const{setThemeSettings:n}=(0,o.ko)(),[r,l]=(0,a.J0)(t);return(0,a.vJ)((()=>{t&&(t.startsWith("#")?l(t):s.fetch(i.nfi,e,s.Type.Blob).then((e=>{const t=URL.createObjectURL(e);(0,c.NN)(t).then((()=>{l(`url(${t})`)}))})).catch((()=>{n({theme:e,background:void 0,backgroundColor:void 0,isBlurred:!0,patternColor:"dark"===e?i.MkD:i.be8})})))}),[t,e]),t?r:void 0}},49746:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(84051),o=n(13439);function i(e,t,n,i,s){const{loadMessage:c}=(0,o.ko)();(0,a.vJ)((()=>{s||t&&!n&&c({chatId:e,messageId:t,replyOriginForId:i})}),[s,e,n,t,i])}},74984:(e,t,n)=>{n.d(t,{Jm:()=>l,Rh:()=>s,g5:()=>r,ic:()=>c});var a=n(84051),o=n(49763),i=n(30857);function s(e){const t=(0,i.A)();return(0,a.vJ)((()=>(0,o.Yw)(e,t)),[e,t]),(0,o.YA)(e)}function c(){const e=(0,i.A)();return(0,a.vJ)((()=>(0,o.P1)(e)),[e]),(0,o.PZ)()}function r(){const e=(0,i.A)();return(0,a.vJ)((()=>(0,o.BU)(e)),[e]),(0,o.jn)()}function l(){const e=(0,i.A)();return(0,a.vJ)((()=>(0,o.dk)(e)),[e]),(0,o.Xq)()}},36838:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(84051);const o=(e,t,n=!1)=>{(0,a.vJ)((()=>{if(t)return;const a=e.current;function o(e){e.deltaX||(a.scrollLeft+=e.deltaY/4,n&&e.preventDefault())}return a.addEventListener("wheel",o,{passive:!n}),()=>{a.removeEventListener("wheel",o)}}),[e,t,n])}},29886:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(84051);function o(e){const t=(0,a.li)(),n=(0,a.li)();return n.current!==e&&(t.current=n.current),n.current=e,t.current}},14622:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(84051),o=n(13439),i=n(81954),s=n(17712),c=n(93545),r=n(672);const l=function(e,t=!1){const{focusLastMessage:n}=(0,o.ko)(),l=(0,a.li)(0),d=(0,s.A)((e=>{const t=l.current,o=e.contentRect.height;if(l.current=o,(0,i.o8)()||!t||o<=t)return;const s=e.target.closest(".MessageList");if(!s)return;(0,a.VK)(400);const c=o-t,{offsetHeight:r,scrollHeight:d,scrollTop:m}=s;Math.round(d-m-r)-c<=5&&n()})),m=(0,r.A)(d,[d],300,!1);(0,c.A)(e,m,!t)}},56133:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(16581);function o(e,t,n,o=[]){return(0,a.A)((e=>{e()}),o,e,t,n)}},24531:(e,t,n)=>{n.d(t,{A:()=>u});var a=n(84051),o=n(31481),i=n(17663),s=n(80140),c=n(17712),r=n(59030),l=n(80089),d=n(80464);const m=e=>{const{isOpen:t}=e,n=(0,d.A)(l.ar.Extra,"CalendarModal",!t);return n?a.Ay.createElement(n,e):void 0},u=(e,t,n)=>{const l=(0,r.A)(),[d,u]=(0,a.J0)(),h=(0,c.A)(((e,t=!1)=>{const n=Math.round(Math.max(e.getTime(),Date.now()+6e4)/1e3)+(t?0:(0,s.SF)());d?.(n),u(void 0)})),A=(0,c.A)((()=>{h(new Date(1e3*o.NkL),!0)})),p=(0,c.A)((()=>{u(void 0),t?.()})),g=(0,c.A)((e=>{u((()=>e))})),y=n?new Date(1e3*n):new Date;y.setSeconds(0),y.setMilliseconds(0);const f=new Date;return f.setFullYear(f.getFullYear()+1),[g,a.Ay.createElement(m,{isOpen:Boolean(d),withTimePicker:!0,selectedAt:y.getTime(),maxAt:(0,i.CS)(f),isFutureMode:!0,secondButtonLabel:e?l("Schedule.SendWhenOnline"):void 0,onClose:p,onSubmit:h,onSecondButtonClick:e?A:void 0})]}},57446:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(13439),o=n(66644),i=n(29807),s=n(19822);const c=300,r=new Map;function l(e,t,n=c){(0,i.PKK)((0,a.mS)())||(n=0);const l="rtl"===e.getAttribute("dir"),{scrollLeft:d,offsetWidth:m,scrollWidth:u,dataset:{scrollId:h}}=e;let A=t-d;if(A<0){const e=-d*(l?-1:1);A=Math.max(A,e)}else if(A>0){const e=u-(d+m);A=Math.min(A,e)}if(0===A)return Promise.resolve();h&&r.has(h)&&r.get(h)();const p=d+A;return new Promise((t=>{(0,o.RK)((()=>{if(0===n)return e.scrollLeft=p,void t();let a=!1;const i=Math.random().toString();e.dataset.scrollId=i,r.set(i,(()=>{a=!0})),e.style.scrollSnapType="none";const c=Date.now();function l(){e.style.scrollSnapType="",delete e.dataset.scrollId,r.delete(i)}(0,s.i0)((()=>{if(a)return l(),!1;const o=Math.min((Date.now()-c)/n,1),i=A*(1-function(e){return 1-(1-e)**3.5}(o));return e.scrollLeft=Math.round(p-i),o>=1&&(l(),t()),o<1}),o.RK)}))}))}},81954:(e,t,n)=>{n.d(t,{Ay:()=>p,H$:()=>v,_v:()=>g,o8:()=>f});var a=n(84051),o=n(13439),i=n(89925),s=n(31481),c=n(66644),r=n(29807),l=n(96454),d=n(16460),m=n(19822);let u,h,A=!1;function p(e){u=e;const t=y(e);if(e.shouldReturnMutationFn)return t;(0,c.RK)(t)}function g(){A&&((0,m.vk)(),(0,c.YS)((()=>{(0,c.RK)(y(u))})))}function y(e){const{container:t,element:n,position:p,margin:g=0,maxDistance:y=s.nxZ,forceDirection:f,forceNormalContainerHeight:v}=e;let S=e.forceDuration;f!==i.CC.Static&&(0,r.PKK)((0,o.mS)())||(S=0);const{offsetHeight:I}=n,{scrollTop:R,offsetHeight:w,scrollHeight:N}=t,b=(0,d.A)(n,t).top,M=v&&t.dataset.normalHeight?Number(t.dataset.normalHeight):w;let k;switch(p){case"start":k=b-g+(l.Ni?1:0);break;case"end":k=b+I+g-M;break;case"nearest":case"center":case"centerOrTop":k=I<M?b+I/2-M/2:b-g}const x=function(e,t,n=s.nxZ,a){const{scrollTop:o}=e;if(void 0===a){const e=t-o;if(e<-n)return o+(e+n);if(e>n)return o+(e-n)}else{if(a===i.CC.Up)return t+n;if(a===i.CC.Down)return Math.max(0,t-n)}return o}(t,k,y,f);let P=k-x;if(P<0){const e=-x;P=Math.max(P,e)}else if(P>0){const e=N-(x+M);P=Math.min(P,e)}const T=Math.abs(P);return()=>{if(T<1)return void(R!==x&&(t.scrollTop=x));const e=x+P;if(0===S)return void(t.scrollTop=e);const n=T<=s.s8T?C:E,o=S||s.SKD+T/s.nxZ*(s.OzO-s.SKD),i=Date.now();A=!0;const r=h;h=(0,a.VK)(void 0,!0),r?.(),(0,m.S0)((()=>{const a=Math.min((Date.now()-i)/o,1),s=P*(1-n(a)),c=Math.round(e-s);return t.scrollTop=c,A=a<1&&c!==e,A||(u=void 0,h?.(),h=void 0),A}),c.RK)}}function f(){return A}function v(){h(),h=void 0}function C(e){return 1-(1-e)**3.5}function E(e){return 1-(1-e)**6}},81686:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(31481);const o=1;function i(){const e=window.getSelection();let t=e?.rangeCount?e.getRangeAt(0).cloneContents():void 0;const n=e?.focusNode&&e.focusOffset>0&&s(e.focusNode,a.zPk);if(!t||0===t.childElementCount)return;const i=Array.from(t.children).reduce(((e,t)=>t.nodeType===o&&t.classList.contains("message-date-group")?Array.from(t.querySelectorAll(".Message")).reduce(((e,t)=>e.concat(Number(t.dataset.messageId))),e):t.nodeType===o&&t.classList.contains("Message")?e.concat(Number(t.dataset.messageId)):e),[]);for(;t.firstChild;)t.removeChild(t.firstChild);return t=void 0,n||i.pop(),i}function s(e,t){return!(e.nodeType!==o||!e.classList.contains(t))||!!e.parentNode&&s(e.parentNode,t)}},58968:(e,t,n)=>{n.d(t,{I5:()=>s,LS:()=>i,V2:()=>o,lw:()=>a});const a={isCustomPeer:!0,type:"premium",titleKey:"PrivacyPremium",subtitleKey:"PrivacyPremiumText",avatarIcon:"star",isAvatarSquare:!0,withPremiumGradient:!0},o=[{isCustomPeer:!0,type:"contacts",titleKey:"FilterContacts",avatarIcon:"user",isAvatarSquare:!0,peerColorId:5},{isCustomPeer:!0,type:"nonContacts",titleKey:"FilterNonContacts",avatarIcon:"non-contacts",isAvatarSquare:!0,peerColorId:4},{isCustomPeer:!0,type:"groups",titleKey:"FilterGroups",avatarIcon:"group",isAvatarSquare:!0,peerColorId:3},{isCustomPeer:!0,type:"channels",titleKey:"FilterChannels",avatarIcon:"channel",isAvatarSquare:!0,peerColorId:1},{isCustomPeer:!0,type:"bots",titleKey:"FilterBots",avatarIcon:"bots",isAvatarSquare:!0,peerColorId:6}],i=[{isCustomPeer:!0,type:"excludeMuted",titleKey:"FilterMuted",avatarIcon:"mute",isAvatarSquare:!0,peerColorId:6},{isCustomPeer:!0,type:"excludeRead",titleKey:"FilterRead",avatarIcon:"readchats",isAvatarSquare:!0,peerColorId:4},{isCustomPeer:!0,type:"excludeArchived",titleKey:"FilterArchived",avatarIcon:"archive",isAvatarSquare:!0,peerColorId:5}],s={isCustomPeer:!0,type:"hidden",titleKey:"StarsTransactionHidden",avatarIcon:"author-hidden",peerColorId:4}},80539:(e,t,n)=>{n.d(t,{Ay:()=>r,g4:()=>l,qh:()=>s});var a=n(23174),o=n(31481),i=n(96454);const s={B:a.C7.Bold,STRONG:a.C7.Bold,I:a.C7.Italic,EM:a.C7.Italic,INS:a.C7.Underline,U:a.C7.Underline,S:a.C7.Strike,STRIKE:a.C7.Strike,DEL:a.C7.Strike,CODE:a.C7.Code,PRE:a.C7.Pre,BLOCKQUOTE:a.C7.Blockquote},c=3;function r(e,t=!1,n=!1){const r=document.createElement("div");r.innerHTML=n?e:function(e){let t=e.slice(0);return t=t.replace(/&nbsp;/g," "),t=t.replace(/<div><br([^>]*)?><\/div>/g,"\n"),t=t.replace(/<br([^>]*)?>/g,"\n"),t=t.replace(/<\/div>(\s*)<div>/g,"\n"),t=t.replace(/<div>/g,"\n"),t=t.replace(/<\/div>/g,""),t=t.replace(/^`{3}(.*?)[\n\r](.*?[\n\r]?)`{3}/gms,'<pre data-language="$1">$2</pre>'),t=t.replace(/^`{3}[\n\r]?(.*?)[\n\r]?`{3}/gms,"<pre>$1</pre>"),t=t.replace(/[`]{3}([^`]+)[`]{3}/g,"<pre>$1</pre>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[`]{1}([^`\n]+)[`]{1}(?![^<]*<\/(code|pre)>)/g,"<code>$2</code>"),i.TL||(t=t.replace(/\[<img[^>]+alt="([^"]+)"[^>]*>]/gm,"[$1]")),t=t.replace(/(?!<(?:code|pre)[^<]*|<\/)\[([^\]\n]+)\]\(customEmoji:(\d+)\)(?![^<]*<\/(?:code|pre)>)/g,'<img alt="$1" data-document-id="$2">'),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[*]{2}([^*\n]+)[*]{2}(?![^<]*<\/(code|pre)>)/g,"<b>$2</b>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[_]{2}([^_\n]+)[_]{2}(?![^<]*<\/(code|pre)>)/g,"<i>$2</i>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[~]{2}([^~\n]+)[~]{2}(?![^<]*<\/(code|pre)>)/g,"<s>$2</s>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[|]{2}([^|\n]+)[|]{2}(?![^<]*<\/(code|pre)>)/g,`<span data-entity-type="${a.C7.Spoiler}">$2</span>`),t}(t?function(e){return e.replace(new RegExp(`\\[([^\\]]+?)]\\((${o.kNZ}+?)\\)`,"g"),((e,t,n)=>`<a href="${n.includes("://")?n:n.includes("@")?`mailto:${n}`:`https://${n}`}">${t}</a>`))}(e):e),l(r);const d=r.innerText.trim().replace(/\u200b+/g,"");let m=-r.innerText.indexOf(d[0]),u=0;const h=[];function A(e){if(e.nodeType===Node.COMMENT_NODE)return;const{index:t,entity:n}=function(e,t,n){const o=function(e){if(e instanceof HTMLElement&&e.dataset.entityType)return e.dataset.entityType;if(s[e.nodeName])return s[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===a.C7.MentionName?a.C7.MentionName:t.dataset.entityType===a.C7.Url?a.C7.Url:t.href.startsWith("mailto:")?a.C7.Email:t.href.startsWith("tel:")?a.C7.Phone:t.href!==t.textContent?a.C7.TextUrl:a.C7.Url}return"SPAN"===e.nodeName?e.dataset.entityType:"IMG"===e.nodeName&&e.dataset.documentId?a.C7.CustomEmoji:void 0}(e);if(!o||!e.textContent)return{index:n,entity:void 0};const i=t.indexOf(e.textContent,n),c=i>=0?i:n,r=t.substring(0,c).length,{length:l}=t.substring(c,c+e.textContent.length);if(o===a.C7.TextUrl)return{index:c,entity:{type:o,offset:r,length:l,url:e.href}};if(o===a.C7.MentionName)return{index:c,entity:{type:o,offset:r,length:l,userId:e.dataset.userId}};if(o===a.C7.Pre)return{index:c,entity:{type:o,offset:r,length:l,language:e.dataset.language}};if(o===a.C7.CustomEmoji)return{index:c,entity:{type:o,offset:r,length:l,documentId:e.dataset.documentId}};if(o===a.C7.Timestamp){const t=Number(e.dataset.timestamp);return Number.isNaN(t)?{index:c,entity:void 0}:{index:c,entity:{type:o,offset:r,length:l,timestamp:t}}}return{index:c,entity:{type:o,offset:r,length:l}}}(e,d,m);if(n)m=t,h.push(n);else if(e.textContent){if(0===t&&""===e.textContent.trim())return;m+=e.textContent.length}e.hasChildNodes()&&u<=c&&(u+=1,Array.from(e.childNodes).forEach(A))}return Array.from(r.childNodes).forEach((e=>{u=1,A(e)})),{text:d,entities:h.length?h:void 0}}function l(e){e.querySelectorAll("img").forEach((e=>{e.dataset.documentId?e.textContent=e.alt||"":e.replaceWith(e.alt||"")}))}},73104:(e,t,n)=>{let a,o;n.d(t,{M6:()=>r,v5:()=>l});const i={Down:!0,ArrowDown:!0,Up:!0,ArrowUp:!0,Left:!0,ArrowLeft:!0,Right:!0,ArrowRight:!0," ":!0,PageUp:!0,PageDown:!0,End:!0,Home:!0,Tab:!0},s=e=>{const t="deltaY"in e?e.deltaY:(e=>"changedTouches"in e?e.changedTouches[0].clientY:0)(e);if(!a||!a.contains(e.target)||a.scrollTop<=0&&t<=0||a.scrollTop>=a.scrollHeight-a.offsetHeight&&t>=0){if(o&&e.target.closest(o))return;e.preventDefault()}};function c(e){i[e.key]&&!function(e){if(!(e&&e instanceof HTMLElement))return!1;const t=e,n=t.tagName.toLowerCase();if("textarea"===n)return!0;if("input"!==n)return!1;const a=t.getAttribute("type");return!!a&&["text","password","number","email","tel","url","search","date","datetime","datetime-local","time","month","week"].indexOf(a.toLowerCase())>-1}(e.target)&&e.preventDefault()}function r(e,t){return a=e,o=t,document.addEventListener("wheel",s,{passive:!1}),document.addEventListener("touchmove",s,{passive:!1}),document.onkeydown=c,l}function l(){a=void 0,o=void 0,document.removeEventListener("wheel",s),document.removeEventListener("touchmove",s),document.onkeydown=null}},16460:(e,t,n)=>{function a(e,t){let n=0,a=0,o=e;for(;o&&o!==t&&!o.contains(t);)n+=o.offsetTop,a+=o.offsetLeft,o=o.offsetParent;return{top:n,left:a}}n.d(t,{A:()=>a})},41512:(e,t,n)=>{n.d(t,{Y:()=>o});var a=n(43503);function o(e){if("none"===e.style.display)return!1;const t=e.getBoundingClientRect(),{height:n}=a.A.get();return t.top<=n&&t.top+t.height>=0}},31722:(e,t,n)=>{n.d(t,{A:()=>a});const a={container:"YmM5biTv",header:"S7WFT2bv",pickerCategoryTitle:"YK1300x2",peerChip:"gsKPBPoK",pickerList:"yLCbiItq",padded:"bXzIGw8s",noResults:"dXWKD0ve",onlineStatus:"d5GDOYh9"}},93879:(e,t,n)=>{n.d(t,{A:()=>a});const a={root:"O9uCTt5C","animated-icon":"HiI6SMxF",animatedIcon:"HiI6SMxF",effect:"NhFcTGja",animating:"ikfZ6Igz",withEffectOnly:"jjRJmHCg"}},69988:(e,t,n)=>{n.d(t,{A:()=>a});const a={root:"gXO57D98",chosen:"VXSJn0Sm",paid:"N3lcrsh8",outside:"Hqw10FGl","animated-emoji":"lFjoRm_p",animatedEmoji:"lFjoRm_p",tag:"Dr889Kzc",tail:"cUfY1b26","is-safari":"rxxUijuG",isSafari:"rxxUijuG","tail-fill":"y591o4fN",tailFill:"y591o4fN","tag-text":"ly7cruxF",tagText:"ly7cruxF",counter:"P2FqNJAi",disabled:"NRtGofbf",paidCounter:"CW4UO1n3"}}}]);
//# sourceMappingURL=488.82d1c15969d65f4b1a4d.js.map